From: support Date: Thu, 5 Jan 2023 16:34:13 +0000 (+0000) Subject: Built motion from commit 449495f6.|2.6.27 X-Git-Tag: 2.6.27 X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=d2fd33d6b242a53e18c7b82fe692ff8c6c0965a8;p=motion2.git Built motion from commit 449495f6.|2.6.27 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index fafc24a..d5eea94 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1,6 +1,6 @@ define({ "name": "xCALLY Motion API", - "version": "2.6.26", + "version": "2.6.27", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-12-29T08:11:16.086Z", + "time": "2023-01-05T16:26:57.371Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 4fb8ff5..4734fb1 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1,6 +1,6 @@ { "name": "xCALLY Motion API", - "version": "2.6.26", + "version": "2.6.27", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-12-29T08:11:16.086Z", + "time": "2023-01-05T16:26:57.371Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 56d8b49..c8e0ad6 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.6.26", + "version": "2.6.27", "dependencies": { "@babel/code-frame": { "version": "7.18.6", diff --git a/package.json b/package.json index c4abd4f..808f6a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.6.26", + "version": "2.6.27", "description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.", "main": "server/app.js", "engines": { diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 27cc0a0..9b55e19 100644 --- a/server/api/action/action.attributes.js +++ b/server/api/action/action.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5926=['urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT'];(function(_0x52fd4d,_0x8aa448){var _0x24e5ab=function(_0x2040a1){while(--_0x2040a1){_0x52fd4d['push'](_0x52fd4d['shift']());}};_0x24e5ab(++_0x8aa448);}(_0x5926,0x10f));var _0x6592=function(_0x176018,_0x4879f3){_0x176018=_0x176018-0x0;var _0x11fe38=_0x5926[_0x176018];return _0x11fe38;};'use strict';var Sequelize=require('sequelize');module[_0x6592('0x0')]={'name':{'type':Sequelize[_0x6592('0x1')],'get':function(_0x4f35db){return this[_0x6592('0x2')](_0x6592('0x3'));}},'action':{'type':Sequelize[_0x6592('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6592('0x5'),'integration','motionbar',_0x6592('0x6'),_0x6592('0x7'),_0x6592('0x8'),_0x6592('0x9'),_0x6592('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x6592('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x6592('0x4')](0x1000),'comment':_0x6592('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x6592('0xd')},'data4':{'type':Sequelize[_0x6592('0x4')](0x1000),'comments':_0x6592('0xe')},'data5':{'type':Sequelize[_0x6592('0x4')](0x1000),'comments':_0x6592('0xf')},'data6':{'type':Sequelize[_0x6592('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x6592('0x10')],'comments':_0x6592('0x11')}}; \ No newline at end of file +var _0x5797=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','getDataValue','STRING','integration','motionbar','jscripty','browser','bot'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5797,0xc4));var _0x7579=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x5797[_0x4b73a2];return _0x383c66;};'use strict';var Sequelize=require('sequelize');module[_0x7579('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3d4c7f){return this[_0x7579('0x1')]('action');}},'action':{'type':Sequelize[_0x7579('0x2')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x7579('0x3'),_0x7579('0x4'),_0x7579('0x5'),'urlForward',_0x7579('0x6'),_0x7579('0x7'),_0x7579('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x7579('0x9')},'data1':{'type':Sequelize[_0x7579('0x2')](0x1000),'comment':_0x7579('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x7579('0x2')](0x1000),'comment':_0x7579('0xb')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x7579('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x7579('0xd')},'data6':{'type':Sequelize[_0x7579('0x2')],'comments':_0x7579('0xe')},'data7':{'type':Sequelize[_0x7579('0xf')],'comments':_0x7579('0x10')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 09aca17..15abf51 100644 --- a/server/api/action/action.controller.js +++ b/server/api/action/action.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f97=['send','body','params','destroy','Action','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','reject','save','update','then','error','stack','name'];(function(_0x503e78,_0x411076){var _0x591b4a=function(_0x1dc3dc){while(--_0x1dc3dc){_0x503e78['push'](_0x503e78['shift']());}};_0x591b4a(++_0x411076);}(_0x3f97,0x1f1));var _0x73f9=function(_0x1b0875,_0x2c460f){_0x1b0875=_0x1b0875-0x0;var _0x5e6a1e=_0x3f97[_0x1b0875];return _0x5e6a1e;};'use strict';var emlformat=require(_0x73f9('0x0'));var rimraf=require(_0x73f9('0x1'));var zipdir=require(_0x73f9('0x2'));var jsonpatch=require(_0x73f9('0x3'));var rp=require(_0x73f9('0x4'));var moment=require(_0x73f9('0x5'));var BPromise=require(_0x73f9('0x6'));var Mustache=require(_0x73f9('0x7'));var util=require('util');var path=require(_0x73f9('0x8'));var sox=require(_0x73f9('0x9'));var csv=require(_0x73f9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73f9('0xb'));var _=require(_0x73f9('0xc'));var squel=require(_0x73f9('0xd'));var crypto=require(_0x73f9('0xe'));var jsforce=require(_0x73f9('0xf'));var deskjs=require(_0x73f9('0x10'));var toCsv=require(_0x73f9('0xa'));var querystring=require('querystring');var Papa=require(_0x73f9('0x11'));var Redis=require(_0x73f9('0x12'));var authService=require(_0x73f9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x73f9('0x14'));var hardwareService=require(_0x73f9('0x15'));var logger=require(_0x73f9('0x16'))(_0x73f9('0x17'));var utils=require(_0x73f9('0x18'));var config=require(_0x73f9('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x73f9('0x1a'))['db'];function respondWithStatusCode(_0x2e153e,_0x4c983e){_0x4c983e=_0x4c983e||0xcc;return function(_0xc09ca8){if(_0xc09ca8){return _0x2e153e[_0x73f9('0x1b')](_0x4c983e);}return _0x2e153e[_0x73f9('0x1c')](_0x4c983e)[_0x73f9('0x1d')]();};}function respondWithResult(_0x5b975e,_0x30ec24){_0x30ec24=_0x30ec24||0xc8;return function(_0x13dc6c){if(_0x13dc6c){return _0x5b975e[_0x73f9('0x1c')](_0x30ec24)[_0x73f9('0x1e')](_0x13dc6c);}};}function respondWithFilteredResult(_0x436236,_0x56b498){return function(_0x868cd1){if(_0x868cd1){var _0x345214=typeof _0x56b498[_0x73f9('0x1f')]===_0x73f9('0x20')&&typeof _0x56b498[_0x73f9('0x21')]===_0x73f9('0x20');var _0x34fb96=_0x868cd1['count'];var _0x3497cc=_0x345214?0x0:_0x56b498[_0x73f9('0x1f')];var _0x3872cf=_0x345214?_0x868cd1['count']:_0x56b498['offset']+_0x56b498[_0x73f9('0x21')];var _0x2e8943;if(_0x3872cf>=_0x34fb96){_0x3872cf=_0x34fb96;_0x2e8943=0xc8;}else{_0x2e8943=0xce;}_0x436236[_0x73f9('0x1c')](_0x2e8943);return _0x436236['set'](_0x73f9('0x22'),_0x3497cc+'-'+_0x3872cf+'/'+_0x34fb96)['json'](_0x868cd1);}return null;};}function patchUpdates(_0x29442f){return function(_0x597c18){try{jsonpatch['apply'](_0x597c18,_0x29442f,!![]);}catch(_0x18a762){return BPromise[_0x73f9('0x23')](_0x18a762);}return _0x597c18[_0x73f9('0x24')]();};}function saveUpdates(_0x500a22,_0x31e03e){return function(_0x1c6d30){if(_0x1c6d30){return _0x1c6d30[_0x73f9('0x25')](_0x500a22)[_0x73f9('0x26')](function(_0x13bdc9){return _0x13bdc9;});}return null;};}function removeEntity(_0x39cc88,_0x1999ed){return function(_0x281c54){if(_0x281c54){return _0x281c54['destroy']()['then'](function(){_0x39cc88[_0x73f9('0x1c')](0xcc)[_0x73f9('0x1d')]();});}};}function handleEntityNotFound(_0x2ceddc,_0x1cb64f){return function(_0xce79b1){if(!_0xce79b1){_0x2ceddc[_0x73f9('0x1b')](0x194);}return _0xce79b1;};}function handleError(_0x13f1fe,_0x4f9d73){_0x4f9d73=_0x4f9d73||0x1f4;return function(_0x555d98){logger[_0x73f9('0x27')](_0x555d98[_0x73f9('0x28')]);if(_0x555d98[_0x73f9('0x29')]){delete _0x555d98['name'];}_0x13f1fe[_0x73f9('0x1c')](_0x4f9d73)[_0x73f9('0x2a')](_0x555d98);};}exports['update']=function(_0x3be7fb,_0x2d8cda){if(_0x3be7fb[_0x73f9('0x2b')]['id']){delete _0x3be7fb[_0x73f9('0x2b')]['id'];}return db['Action']['find']({'where':{'id':_0x3be7fb[_0x73f9('0x2c')]['id']}})[_0x73f9('0x26')](handleEntityNotFound(_0x2d8cda,null))[_0x73f9('0x26')](saveUpdates(_0x3be7fb[_0x73f9('0x2b')],null))[_0x73f9('0x26')](respondWithResult(_0x2d8cda,null))['catch'](handleError(_0x2d8cda,null));};exports[_0x73f9('0x2d')]=function(_0x267842,_0x574337){return db[_0x73f9('0x2e')][_0x73f9('0x2f')]({'where':{'id':_0x267842[_0x73f9('0x2c')]['id']}})[_0x73f9('0x26')](handleEntityNotFound(_0x574337,null))['then'](removeEntity(_0x574337,null))[_0x73f9('0x30')](handleError(_0x574337,null));}; \ No newline at end of file +var _0xd7ff=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x303616,_0xa105d9){var _0xe86373=function(_0x38cc79){while(--_0x38cc79){_0x303616['push'](_0x303616['shift']());}};_0xe86373(++_0xa105d9);}(_0xd7ff,0x17d));var _0xfd7f=function(_0x5d7ef8,_0x190075){_0x5d7ef8=_0x5d7ef8-0x0;var _0x306a8d=_0xd7ff[_0x5d7ef8];return _0x306a8d;};'use strict';var emlformat=require(_0xfd7f('0x0'));var rimraf=require(_0xfd7f('0x1'));var zipdir=require(_0xfd7f('0x2'));var jsonpatch=require(_0xfd7f('0x3'));var rp=require('request-promise');var moment=require(_0xfd7f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfd7f('0x5'));var util=require(_0xfd7f('0x6'));var path=require(_0xfd7f('0x7'));var sox=require(_0xfd7f('0x8'));var csv=require('to-csv');var ejs=require(_0xfd7f('0x9'));var fs=require('fs');var fs_extra=require(_0xfd7f('0xa'));var _=require(_0xfd7f('0xb'));var squel=require(_0xfd7f('0xc'));var crypto=require(_0xfd7f('0xd'));var jsforce=require(_0xfd7f('0xe'));var deskjs=require(_0xfd7f('0xf'));var toCsv=require(_0xfd7f('0x10'));var querystring=require(_0xfd7f('0x11'));var Papa=require(_0xfd7f('0x12'));var Redis=require(_0xfd7f('0x13'));var authService=require(_0xfd7f('0x14'));var qs=require(_0xfd7f('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd7f('0x16'));var logger=require(_0xfd7f('0x17'))(_0xfd7f('0x18'));var utils=require('../../config/utils');var config=require(_0xfd7f('0x19'));var licenseUtil=require(_0xfd7f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11af8b,_0x1401b5){_0x1401b5=_0x1401b5||0xcc;return function(_0x102746){if(_0x102746){return _0x11af8b[_0xfd7f('0x1b')](_0x1401b5);}return _0x11af8b[_0xfd7f('0x1c')](_0x1401b5)[_0xfd7f('0x1d')]();};}function respondWithResult(_0x2f6e28,_0x586e12){_0x586e12=_0x586e12||0xc8;return function(_0x396e25){if(_0x396e25){return _0x2f6e28[_0xfd7f('0x1c')](_0x586e12)[_0xfd7f('0x1e')](_0x396e25);}};}function respondWithFilteredResult(_0xa96aca,_0x4f9e33){return function(_0x1b0659){if(_0x1b0659){var _0x27b91a=typeof _0x4f9e33['offset']===_0xfd7f('0x1f')&&typeof _0x4f9e33[_0xfd7f('0x20')]===_0xfd7f('0x1f');var _0x4d90e9=_0x1b0659[_0xfd7f('0x21')];var _0x5df5a3=_0x27b91a?0x0:_0x4f9e33[_0xfd7f('0x22')];var _0x3d61a6=_0x27b91a?_0x1b0659[_0xfd7f('0x21')]:_0x4f9e33['offset']+_0x4f9e33[_0xfd7f('0x20')];var _0x21cf28;if(_0x3d61a6>=_0x4d90e9){_0x3d61a6=_0x4d90e9;_0x21cf28=0xc8;}else{_0x21cf28=0xce;}_0xa96aca[_0xfd7f('0x1c')](_0x21cf28);return _0xa96aca[_0xfd7f('0x23')](_0xfd7f('0x24'),_0x5df5a3+'-'+_0x3d61a6+'/'+_0x4d90e9)['json'](_0x1b0659);}return null;};}function patchUpdates(_0x3b975a){return function(_0xeeb9e9){try{jsonpatch[_0xfd7f('0x25')](_0xeeb9e9,_0x3b975a,!![]);}catch(_0x2326a5){return BPromise[_0xfd7f('0x26')](_0x2326a5);}return _0xeeb9e9[_0xfd7f('0x27')]();};}function saveUpdates(_0x49a0b6,_0xe5d228){return function(_0x260f7f){if(_0x260f7f){return _0x260f7f[_0xfd7f('0x28')](_0x49a0b6)[_0xfd7f('0x29')](function(_0x39ca52){return _0x39ca52;});}return null;};}function removeEntity(_0x697382,_0x353e5e){return function(_0x1b5eca){if(_0x1b5eca){return _0x1b5eca['destroy']()[_0xfd7f('0x29')](function(){_0x697382[_0xfd7f('0x1c')](0xcc)[_0xfd7f('0x1d')]();});}};}function handleEntityNotFound(_0x4c735b,_0x3aa4b1){return function(_0x81ca6){if(!_0x81ca6){_0x4c735b[_0xfd7f('0x1b')](0x194);}return _0x81ca6;};}function handleError(_0x1f2c02,_0x37efd3){_0x37efd3=_0x37efd3||0x1f4;return function(_0x490592){logger['error'](_0x490592[_0xfd7f('0x2a')]);if(_0x490592[_0xfd7f('0x2b')]){delete _0x490592[_0xfd7f('0x2b')];}_0x1f2c02[_0xfd7f('0x1c')](_0x37efd3)[_0xfd7f('0x2c')](_0x490592);};}exports[_0xfd7f('0x28')]=function(_0x54047f,_0x10d62f){if(_0x54047f[_0xfd7f('0x2d')]['id']){delete _0x54047f[_0xfd7f('0x2d')]['id'];}return db[_0xfd7f('0x2e')][_0xfd7f('0x2f')]({'where':{'id':_0x54047f[_0xfd7f('0x30')]['id']}})[_0xfd7f('0x29')](handleEntityNotFound(_0x10d62f,null))[_0xfd7f('0x29')](saveUpdates(_0x54047f[_0xfd7f('0x2d')],null))[_0xfd7f('0x29')](respondWithResult(_0x10d62f,null))['catch'](handleError(_0x10d62f,null));};exports['destroy']=function(_0x4d4eb2,_0x575f35){return db[_0xfd7f('0x2e')][_0xfd7f('0x2f')]({'where':{'id':_0x4d4eb2[_0xfd7f('0x30')]['id']}})[_0xfd7f('0x29')](handleEntityNotFound(_0x575f35,null))['then'](removeEntity(_0x575f35,null))[_0xfd7f('0x31')](handleError(_0x575f35,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 00d2f57..cca4305 100644 --- a/server/api/action/action.model.js +++ b/server/api/action/action.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x56fc=['path','../../config/environment','./action.attributes','exports','Action','tools_actions','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x56fc,0x13e));var _0xc56f=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x56fc[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0xc56f('0x0'));var util=require('util');var logger=require(_0xc56f('0x1'))(_0xc56f('0x2'));var moment=require(_0xc56f('0x3'));var BPromise=require(_0xc56f('0x4'));var rp=require(_0xc56f('0x5'));var fs=require('fs');var path=require(_0xc56f('0x6'));var rimraf=require('rimraf');var config=require(_0xc56f('0x7'));var attributes=require(_0xc56f('0x8'));module[_0xc56f('0x9')]=function(_0x2d65c6,_0x2bccdd){return _0x2d65c6['define'](_0xc56f('0xa'),attributes,{'tableName':_0xc56f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cc1=['api','moment','bluebird','request-promise','./action.attributes','exports','define','tools_actions','util','../../config/logger'];(function(_0x39c326,_0x3273f5){var _0x2c8578=function(_0x3e6c2c){while(--_0x3e6c2c){_0x39c326['push'](_0x39c326['shift']());}};_0x2c8578(++_0x3273f5);}(_0x5cc1,0xe4));var _0x15cc=function(_0x5a3e4c,_0x5f39e7){_0x5a3e4c=_0x5a3e4c-0x0;var _0x190289=_0x5cc1[_0x5a3e4c];return _0x190289;};'use strict';var _=require('lodash');var util=require(_0x15cc('0x0'));var logger=require(_0x15cc('0x1'))(_0x15cc('0x2'));var moment=require(_0x15cc('0x3'));var BPromise=require(_0x15cc('0x4'));var rp=require(_0x15cc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x15cc('0x6'));module[_0x15cc('0x7')]=function(_0x576be6,_0x5bfa13){return _0x576be6[_0x15cc('0x8')]('Action',attributes,{'tableName':_0x15cc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 7820782..30f1091 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x58b5d3,_0x4fba15){var _0x2130a1=function(_0x4c913f){while(--_0x4c913f){_0x58b5d3['push'](_0x58b5d3['shift']());}};_0x2130a1(++_0x4fba15);}(_0x1261,0x144));var _0x1126=function(_0x3aeb36,_0x312dc9){_0x3aeb36=_0x3aeb36-0x0;var _0xa2ef21=_0x1261[_0x3aeb36];return _0xa2ef21;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x840e9f,_0x4bb2df){var _0xf748ce=function(_0x255dc0){while(--_0x255dc0){_0x840e9f['push'](_0x840e9f['shift']());}};_0xf748ce(++_0x4bb2df);}(_0xe14b,0x93));var _0xbe14=function(_0x539bc1,_0x1eb37f){_0x539bc1=_0x539bc1-0x0;var _0x57528e=_0xe14b[_0x539bc1];return _0x57528e;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 97b8a1b..35a8677 100644 --- a/server/api/action/index.js +++ b/server/api/action/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd84=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','delete','destroy','util','path'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xbd84,0x108));var _0x4bd8=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xbd84[_0x40220a];return _0x3903cc;};'use strict';var multer=require('multer');var util=require(_0x4bd8('0x0'));var path=require(_0x4bd8('0x1'));var timeout=require(_0x4bd8('0x2'));var express=require(_0x4bd8('0x3'));var router=express[_0x4bd8('0x4')]();var fs_extra=require(_0x4bd8('0x5'));var auth=require(_0x4bd8('0x6'));var interaction=require(_0x4bd8('0x7'));var config=require(_0x4bd8('0x8'));var controller=require(_0x4bd8('0x9'));router[_0x4bd8('0xa')]('/:id',auth[_0x4bd8('0xb')](),controller['update']);router[_0x4bd8('0xc')]('/:id',auth[_0x4bd8('0xb')](),controller[_0x4bd8('0xd')]);module['exports']=router; \ No newline at end of file +var _0xb58f=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','update','delete','isAuthenticated','destroy','exports','multer','util'];(function(_0x5c6022,_0x5cd10b){var _0x4ab5af=function(_0x988aff){while(--_0x988aff){_0x5c6022['push'](_0x5c6022['shift']());}};_0x4ab5af(++_0x5cd10b);}(_0xb58f,0xfa));var _0xfb58=function(_0x276cdc,_0x130336){_0x276cdc=_0x276cdc-0x0;var _0x1bd585=_0xb58f[_0x276cdc];return _0x1bd585;};'use strict';var multer=require(_0xfb58('0x0'));var util=require(_0xfb58('0x1'));var path=require('path');var timeout=require(_0xfb58('0x2'));var express=require(_0xfb58('0x3'));var router=express['Router']();var fs_extra=require(_0xfb58('0x4'));var auth=require(_0xfb58('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfb58('0x6'));var controller=require(_0xfb58('0x7'));router[_0xfb58('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xfb58('0x9')]);router[_0xfb58('0xa')]('/:id',auth[_0xfb58('0xb')](),controller[_0xfb58('0xc')]);module[_0xfb58('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 4094cb1..ac6ffcc 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js +++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x17aa79,_0x5c02db){var _0x16ed3c=function(_0x38e37d){while(--_0x38e37d){_0x17aa79['push'](_0x17aa79['shift']());}};_0x16ed3c(++_0x5c02db);}(_0xabce,0x103));var _0xeabc=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xabce[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}}; \ No newline at end of file +var _0xda19=['exports','STRING','TEXT'];(function(_0x394d49,_0x51dfa0){var _0x27dd6c=function(_0x356667){while(--_0x356667){_0x394d49['push'](_0x394d49['shift']());}};_0x27dd6c(++_0x51dfa0);}(_0xda19,0xd5));var _0x9da1=function(_0x597eac,_0x22bcb0){_0x597eac=_0x597eac-0x0;var _0x5f3db1=_0xda19[_0x597eac];return _0x5f3db1;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index e2ecdd0..645135f 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.controller.js +++ b/server/api/analyticCustomReport/analyticCustomReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d2a=['merge','VIRTUAL','options','include','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','from','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','Limited\x20Query:','sequelize','toString','join','right_join','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','MetricId','foreignKey','clone','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','QueryTypes','run','runReport','MAX(%s)','GROUP_CONCAT(%s)','debug','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','undefined','offset','count','limit','set','apply','save','update','then','destroy','get','CustomReports','end','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter'];(function(_0x3bdb09,_0x2f1fb7){var _0x5f3ec7=function(_0x2fe58f){while(--_0x2fe58f){_0x3bdb09['push'](_0x3bdb09['shift']());}};_0x5f3ec7(++_0x2f1fb7);}(_0x6d2a,0x10e));var _0xa6d2=function(_0x5adb18,_0x222326){_0x5adb18=_0x5adb18-0x0;var _0x420c98=_0x6d2a[_0x5adb18];return _0x420c98;};'use strict';var emlformat=require(_0xa6d2('0x0'));var rimraf=require(_0xa6d2('0x1'));var zipdir=require(_0xa6d2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa6d2('0x3'));var BPromise=require(_0xa6d2('0x4'));var Mustache=require('mustache');var util=require(_0xa6d2('0x5'));var path=require(_0xa6d2('0x6'));var sox=require(_0xa6d2('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa6d2('0x8'));var _=require(_0xa6d2('0x9'));var squel=require(_0xa6d2('0xa'));var crypto=require(_0xa6d2('0xb'));var jsforce=require(_0xa6d2('0xc'));var deskjs=require(_0xa6d2('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa6d2('0xe'));var Redis=require(_0xa6d2('0xf'));var authService=require(_0xa6d2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa6d2('0x11'))('api');var utils=require(_0xa6d2('0x12'));var config=require(_0xa6d2('0x13'));var licenseUtil=require(_0xa6d2('0x14'));var db=require(_0xa6d2('0x15'))['db'];var dbH=require('../../mysqldb')[_0xa6d2('0x16')];function respondWithStatusCode(_0x26c233,_0x4dd74f){_0x4dd74f=_0x4dd74f||0xcc;return function(_0x4de15d){if(_0x4de15d){return _0x26c233[_0xa6d2('0x17')](_0x4dd74f);}return _0x26c233[_0xa6d2('0x18')](_0x4dd74f)['end']();};}function respondWithResult(_0x47933e,_0x460820){_0x460820=_0x460820||0xc8;return function(_0x47e4b9){if(_0x47e4b9){return _0x47933e[_0xa6d2('0x18')](_0x460820)[_0xa6d2('0x19')](_0x47e4b9);}};}function respondWithFilteredResult(_0x581e83,_0x6de58c){return function(_0x1e4b65){if(_0x1e4b65){var _0x17c423=typeof _0x6de58c['offset']==='undefined'&&typeof _0x6de58c['limit']===_0xa6d2('0x1a');var _0x5e9ec5=_0x1e4b65['count'];var _0x4f3843=_0x17c423?0x0:_0x6de58c[_0xa6d2('0x1b')];var _0x525aec=_0x17c423?_0x1e4b65[_0xa6d2('0x1c')]:_0x6de58c[_0xa6d2('0x1b')]+_0x6de58c[_0xa6d2('0x1d')];var _0x5615b1;if(_0x525aec>=_0x5e9ec5){_0x525aec=_0x5e9ec5;_0x5615b1=0xc8;}else{_0x5615b1=0xce;}_0x581e83[_0xa6d2('0x18')](_0x5615b1);return _0x581e83[_0xa6d2('0x1e')]('Content-Range',_0x4f3843+'-'+_0x525aec+'/'+_0x5e9ec5)[_0xa6d2('0x19')](_0x1e4b65);}return null;};}function patchUpdates(_0x396dbe){return function(_0xe41488){try{jsonpatch[_0xa6d2('0x1f')](_0xe41488,_0x396dbe,!![]);}catch(_0x33601d){return BPromise['reject'](_0x33601d);}return _0xe41488[_0xa6d2('0x20')]();};}function saveUpdates(_0x3b2d7d,_0x2910e0){return function(_0x5653ba){if(_0x5653ba){return _0x5653ba[_0xa6d2('0x21')](_0x3b2d7d)[_0xa6d2('0x22')](function(_0xbbdb09){return _0xbbdb09;});}return null;};}function removeEntity(_0x2b9a25,_0x29710f){return function(_0x580fd4){if(_0x580fd4){return _0x580fd4[_0xa6d2('0x23')]()[_0xa6d2('0x22')](function(){var _0x3ac971=_0x580fd4[_0xa6d2('0x24')]({'plain':!![]});var _0x10d228=_0xa6d2('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x10d228,'resourceId':_0x3ac971['id']}})[_0xa6d2('0x22')](function(){return _0x580fd4;});})[_0xa6d2('0x22')](function(){_0x2b9a25[_0xa6d2('0x18')](0xcc)[_0xa6d2('0x26')]();});}};}function handleEntityNotFound(_0x1b2c75,_0x1078b9){return function(_0x585b8e){if(!_0x585b8e){_0x1b2c75[_0xa6d2('0x17')](0x194);}return _0x585b8e;};}function handleError(_0x470a0a,_0x5b1027){_0x5b1027=_0x5b1027||0x1f4;return function(_0x560e7e){logger[_0xa6d2('0x27')](_0x560e7e[_0xa6d2('0x28')]);if(_0x560e7e[_0xa6d2('0x29')]){delete _0x560e7e[_0xa6d2('0x29')];}_0x470a0a[_0xa6d2('0x18')](_0x5b1027)[_0xa6d2('0x2a')](_0x560e7e);};}exports[_0xa6d2('0x2b')]=function(_0xee1dc5,_0x465030){var _0x1c6e7d={},_0x3d260b={},_0x4366cd={'count':0x0,'rows':[]};var _0x14fa04=_[_0xa6d2('0x2c')](db[_0xa6d2('0x2d')][_0xa6d2('0x2e')],function(_0x265c73){return{'name':_0x265c73[_0xa6d2('0x2f')],'type':_0x265c73[_0xa6d2('0x30')]['key']};});_0x3d260b['model']=_[_0xa6d2('0x2c')](_0x14fa04,_0xa6d2('0x29'));_0x3d260b[_0xa6d2('0x31')]=_[_0xa6d2('0x32')](_0xee1dc5[_0xa6d2('0x31')]);_0x3d260b['filters']=_['intersection'](_0x3d260b[_0xa6d2('0x33')],_0x3d260b[_0xa6d2('0x31')]);_0x1c6e7d['attributes']=_[_0xa6d2('0x34')](_0x3d260b[_0xa6d2('0x33')],qs[_0xa6d2('0x35')](_0xee1dc5[_0xa6d2('0x31')][_0xa6d2('0x35')]));_0x1c6e7d['attributes']=_0x1c6e7d[_0xa6d2('0x36')][_0xa6d2('0x37')]?_0x1c6e7d['attributes']:_0x3d260b['model'];if(!_0xee1dc5[_0xa6d2('0x31')][_0xa6d2('0x38')]('nolimit')){_0x1c6e7d[_0xa6d2('0x1d')]=qs[_0xa6d2('0x1d')](_0xee1dc5[_0xa6d2('0x31')][_0xa6d2('0x1d')]);_0x1c6e7d[_0xa6d2('0x1b')]=qs[_0xa6d2('0x1b')](_0xee1dc5[_0xa6d2('0x31')]['offset']);}_0x1c6e7d[_0xa6d2('0x39')]=qs[_0xa6d2('0x3a')](_0xee1dc5[_0xa6d2('0x31')][_0xa6d2('0x3a')]);_0x1c6e7d[_0xa6d2('0x3b')]=qs[_0xa6d2('0x3c')](_['pick'](_0xee1dc5[_0xa6d2('0x31')],_0x3d260b[_0xa6d2('0x3c')]),_0x14fa04);if(_0xee1dc5[_0xa6d2('0x31')][_0xa6d2('0x3d')]){_0x1c6e7d['where']=_[_0xa6d2('0x3e')](_0x1c6e7d[_0xa6d2('0x3b')],{'$or':_[_0xa6d2('0x2c')](_0x14fa04,function(_0x18b49a){if(_0x18b49a[_0xa6d2('0x30')]!==_0xa6d2('0x3f')){var _0x3f5421={};_0x3f5421[_0x18b49a[_0xa6d2('0x29')]]={'$like':'%'+_0xee1dc5[_0xa6d2('0x31')][_0xa6d2('0x3d')]+'%'};return _0x3f5421;}})});}_0x1c6e7d=_['merge']({},_0x1c6e7d,_0xee1dc5[_0xa6d2('0x40')]);var _0x1dc07c={'where':_0x1c6e7d[_0xa6d2('0x3b')]};return db[_0xa6d2('0x2d')]['count'](_0x1dc07c)[_0xa6d2('0x22')](function(_0x56f547){_0x4366cd[_0xa6d2('0x1c')]=_0x56f547;if(_0xee1dc5[_0xa6d2('0x31')]['includeAll']){_0x1c6e7d[_0xa6d2('0x41')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x1c6e7d);})['then'](function(_0x4ee192){_0x4366cd[_0xa6d2('0x42')]=_0x4ee192;return _0x4366cd;})[_0xa6d2('0x22')](respondWithFilteredResult(_0x465030,_0x1c6e7d))[_0xa6d2('0x43')](handleError(_0x465030,null));};exports[_0xa6d2('0x44')]=function(_0x1b5cee,_0x7d867d){var _0x41369d={'raw':![],'where':{'id':_0x1b5cee[_0xa6d2('0x45')]['id']}},_0x20f664={};_0x20f664[_0xa6d2('0x33')]=_['keys'](db[_0xa6d2('0x2d')][_0xa6d2('0x2e')]);_0x20f664[_0xa6d2('0x31')]=_[_0xa6d2('0x32')](_0x1b5cee['query']);_0x20f664[_0xa6d2('0x3c')]=_[_0xa6d2('0x34')](_0x20f664[_0xa6d2('0x33')],_0x20f664[_0xa6d2('0x31')]);_0x41369d['attributes']=_[_0xa6d2('0x34')](_0x20f664[_0xa6d2('0x33')],qs['fields'](_0x1b5cee[_0xa6d2('0x31')][_0xa6d2('0x35')]));_0x41369d[_0xa6d2('0x36')]=_0x41369d['attributes']['length']?_0x41369d[_0xa6d2('0x36')]:_0x20f664[_0xa6d2('0x33')];if(_0x1b5cee['query']['includeAll']){_0x41369d['include']=[{'all':!![]}];}_0x41369d=_[_0xa6d2('0x3e')]({},_0x41369d,_0x1b5cee[_0xa6d2('0x40')]);return db['AnalyticCustomReport'][_0xa6d2('0x46')](_0x41369d)[_0xa6d2('0x22')](handleEntityNotFound(_0x7d867d,null))[_0xa6d2('0x22')](respondWithResult(_0x7d867d,null))[_0xa6d2('0x43')](handleError(_0x7d867d,null));};exports['create']=function(_0x4dc280,_0x3ac4e9){return db[_0xa6d2('0x2d')][_0xa6d2('0x47')](_0x4dc280['body'],{})[_0xa6d2('0x22')](function(_0x58a351){var _0x1738d8=_0x4dc280[_0xa6d2('0x48')]['get']({'plain':!![]});if(!_0x1738d8)throw new Error(_0xa6d2('0x49'));if(_0x1738d8[_0xa6d2('0x4a')]===_0xa6d2('0x48')){var _0x18df8b=_0x58a351[_0xa6d2('0x24')]({'plain':!![]});var _0x3e58d2='Reports';return db[_0xa6d2('0x4b')][_0xa6d2('0x46')]({'where':{'name':_0x3e58d2,'userProfileId':_0x1738d8[_0xa6d2('0x4c')]},'raw':!![]})[_0xa6d2('0x22')](function(_0x51fcbb){if(_0x51fcbb&&_0x51fcbb[_0xa6d2('0x4d')]===0x0){return db[_0xa6d2('0x4e')][_0xa6d2('0x47')]({'name':_0x18df8b[_0xa6d2('0x29')],'resourceId':_0x18df8b['id'],'type':'CustomReports','sectionId':_0x51fcbb['id']},{})[_0xa6d2('0x22')](function(){return _0x58a351;});}else{return _0x58a351;}})[_0xa6d2('0x43')](function(_0x1dc83c){logger[_0xa6d2('0x27')](_0xa6d2('0x4f'),_0x1dc83c);throw _0x1dc83c;});}return _0x58a351;})[_0xa6d2('0x22')](respondWithResult(_0x3ac4e9,0xc9))['catch'](handleError(_0x3ac4e9,null));};exports[_0xa6d2('0x21')]=function(_0x3c3fe7,_0x50fbca){if(_0x3c3fe7['body']['id']){delete _0x3c3fe7[_0xa6d2('0x50')]['id'];}return db[_0xa6d2('0x2d')][_0xa6d2('0x46')]({'where':{'id':_0x3c3fe7[_0xa6d2('0x45')]['id']}})[_0xa6d2('0x22')](handleEntityNotFound(_0x50fbca,null))[_0xa6d2('0x22')](saveUpdates(_0x3c3fe7[_0xa6d2('0x50')],null))[_0xa6d2('0x22')](respondWithResult(_0x50fbca,null))[_0xa6d2('0x43')](handleError(_0x50fbca,null));};exports[_0xa6d2('0x23')]=function(_0x37b656,_0x2e1d6b){return db['AnalyticCustomReport'][_0xa6d2('0x46')]({'where':{'id':_0x37b656[_0xa6d2('0x45')]['id']}})[_0xa6d2('0x22')](handleEntityNotFound(_0x2e1d6b,null))[_0xa6d2('0x22')](removeEntity(_0x2e1d6b,null))[_0xa6d2('0x43')](handleError(_0x2e1d6b,null));};exports[_0xa6d2('0x51')]=function(_0x5317bc,_0xb0f01a){var _0xc3c533=0xa;var _0x4bb9b3=['join','left_join','right_join',_0xa6d2('0x52')];var _0x557f28={'SUM':_0xa6d2('0x53'),'COUNT':_0xa6d2('0x54'),'COUNT DISTINCT':_0xa6d2('0x55'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xa6d2('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa6d2('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2c8a1b={'SEC_TO_TIME':_0xa6d2('0x58'),'DATE':_0xa6d2('0x59'),'HOUR':_0xa6d2('0x5a'),'ROUND':_0xa6d2('0x5b'),'UNIX_TIMESTAMP':_0xa6d2('0x5c')};var _0x2b64b4=function(_0x41a193){return!_[_0xa6d2('0x5d')]([_0xa6d2('0x5e'),_0xa6d2('0x5f'),_0xa6d2('0x60'),'IS\x20NOT\x20EMPTY'],_0x41a193);};var _0x282915=function(_0x41806c){if(!_0x41806c||!_0x41806c[_0xa6d2('0x61')][_0xa6d2('0x37')]){return'';}for(var _0x5259f1='(',_0x296884=0x0;_0x296884<_0x41806c[_0xa6d2('0x61')][_0xa6d2('0x37')];_0x296884+=0x1){_0x296884>0x0&&(_0x5259f1+='\x20'+_0x41806c[_0xa6d2('0x62')]+'\x20');_0x5259f1+=_0x41806c[_0xa6d2('0x61')][_0x296884][_0xa6d2('0x63')]?_0x282915(_0x41806c[_0xa6d2('0x61')][_0x296884][_0xa6d2('0x63')]):_0x41806c['rules'][_0x296884][_0xa6d2('0x64')]+'\x20'+_0x41806c[_0xa6d2('0x61')][_0x296884]['condition']+(_0x2b64b4(_0x41806c[_0xa6d2('0x61')][_0x296884][_0xa6d2('0x65')])?'\x20'+_0x41806c[_0xa6d2('0x61')][_0x296884][_0xa6d2('0x66')]:'');}return _0x5259f1+')';};var _0xe10d3f={'where':{'id':_0x5317bc['params']['id']}},_0x3fa261,_0x3dcbfe,_0x599a2c,_0x3e63f9,_0x4fbd82;_0xe10d3f=_[_0xa6d2('0x3e')]({},_0xe10d3f,_0x5317bc[_0xa6d2('0x40')]);return db[_0xa6d2('0x2d')][_0xa6d2('0x46')](_0xe10d3f)['then'](function(_0x5d4b1a){if(_0x5d4b1a){_0x3fa261=_0x5d4b1a;return _0x5d4b1a[_0xa6d2('0x67')]();}return null;})['then'](function(_0x28d1aa){if(_0x28d1aa){if(!_0x28d1aa[_0xa6d2('0x37')]){throw new db['Sequelize'][(_0xa6d2('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3dcbfe=_0x28d1aa;return db[_0xa6d2('0x69')][_0xa6d2('0x6a')]({'raw':!![]});}return null;})[_0xa6d2('0x22')](function(_0x45ba91){if(_0x45ba91){_0x599a2c=_[_0xa6d2('0x6b')](_0x45ba91,'id');var _0x351f00;var _0x2764e6=squel[_0xa6d2('0x6c')]();_0x2764e6[_0xa6d2('0x6d')](_0x3fa261['table']);for(var _0x33f8e=0x0;_0x33f8e<_0x3dcbfe['length'];_0x33f8e+=0x1){_0x351f00=_0x3dcbfe[_0x33f8e]['MetricId']?_0x599a2c[_0x3dcbfe[_0x33f8e]['MetricId']][_0xa6d2('0x6e')]:_0x3dcbfe[_0x33f8e][_0xa6d2('0x64')];_0x351f00=_0x3dcbfe[_0x33f8e][_0xa6d2('0x6f')]?_[_0xa6d2('0x70')](_0x557f28[_0x3dcbfe[_0x33f8e][_0xa6d2('0x6f')]],'%s',_0x351f00):_0x351f00;_0x351f00=_0x3dcbfe[_0x33f8e][_0xa6d2('0x71')]?_['replace'](_0x2c8a1b[_0x3dcbfe[_0x33f8e]['format']],'%s',_0x351f00):_0x351f00;if(_0x3dcbfe[_0x33f8e][_0xa6d2('0x72')]){_0x2764e6['group'](_0x351f00);}_0x3dcbfe[_0x33f8e][_0xa6d2('0x73')]&&_0x2764e6[_0xa6d2('0x39')](_0x351f00,_0x3dcbfe[_0x33f8e][_0xa6d2('0x73')]===_0xa6d2('0x74')?![]:!![]);_0x2764e6[_0xa6d2('0x64')](_0x351f00,_0x3dcbfe[_0x33f8e][_0xa6d2('0x75')]||_0x351f00);}if(_0x3fa261[_0xa6d2('0x76')]){_0x3fa261[_0xa6d2('0x76')]=JSON[_0xa6d2('0x77')](_0x3fa261[_0xa6d2('0x76')]);for(var _0x1c51e2=0x0;_0x1c51e2<_0x3fa261[_0xa6d2('0x76')][_0xa6d2('0x37')];_0x1c51e2+=0x1){if(_0x3fa261[_0xa6d2('0x76')][_0x1c51e2][_0xa6d2('0x30')]&&_['includes'](_0x4bb9b3,_0x3fa261[_0xa6d2('0x76')][_0x1c51e2][_0xa6d2('0x30')])&&_0x3fa261[_0xa6d2('0x76')][_0x1c51e2][_0xa6d2('0x78')]&&_0x3fa261[_0xa6d2('0x76')][_0x1c51e2]['foreignTable']&&_0x3fa261['joins'][_0x1c51e2]['foreignKey']){_0x2764e6[_0x3fa261[_0xa6d2('0x76')][_0x1c51e2][_0xa6d2('0x30')]](_0x3fa261[_0xa6d2('0x76')][_0x1c51e2][_0xa6d2('0x79')],null,util[_0xa6d2('0x71')](_0xa6d2('0x7a'),_0x3fa261[_0xa6d2('0x7b')],_0x3fa261['joins'][_0x1c51e2][_0xa6d2('0x78')],_0x3fa261[_0xa6d2('0x76')][_0x1c51e2]['foreignTable'],_0x3fa261['joins'][_0x1c51e2]['foreignKey']));}}}if(_0x3fa261['conditions']){_0x3fa261[_0xa6d2('0x7c')]=JSON['parse'](_0x3fa261[_0xa6d2('0x7c')]);_0x2764e6[_0xa6d2('0x3b')](_0x282915(_0x3fa261[_0xa6d2('0x7c')][_0xa6d2('0x63')]));}_0x4fbd82=_0x2764e6['clone']();_0x2764e6[_0xa6d2('0x1d')](_0xc3c533);_0x2764e6[_0xa6d2('0x1b')](0x0);logger['debug'](_0xa6d2('0x7d'),_0x2764e6['toString']());return dbH[_0xa6d2('0x7e')][_0xa6d2('0x31')](_0x2764e6[_0xa6d2('0x7f')](),{'type':dbH[_0xa6d2('0x7e')]['QueryTypes']['SELECT']});}})[_0xa6d2('0x22')](respondWithResult(_0xb0f01a,null))[_0xa6d2('0x43')](handleError(_0xb0f01a,null));};function runReport(_0x4fe291,_0x2da5bd,_0x3d9787){var _0x3d409c=_0x2da5bd[_0xa6d2('0x29')];var _0x47f970=0xa;var _0x354eca=[_0xa6d2('0x80'),'left_join',_0xa6d2('0x81'),_0xa6d2('0x52')];var _0x288612={'SUM':_0xa6d2('0x53'),'COUNT':_0xa6d2('0x54'),'COUNT DISTINCT':_0xa6d2('0x55'),'MAX':'MAX(%s)','MIN':_0xa6d2('0x82'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa6d2('0x83')};var _0x4995f7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xa6d2('0x5b'),'UNIX_TIMESTAMP':_0xa6d2('0x5c')};var _0x32eb40=function(_0x24d532){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xa6d2('0x60'),_0xa6d2('0x84')],_0x24d532);};var _0xc1ebbb=function(_0x51b214){if(!_0x51b214||!_0x51b214[_0xa6d2('0x61')]['length']){return'';}for(var _0x30f8a1='(',_0x1dd4e3=0x0;_0x1dd4e3<_0x51b214[_0xa6d2('0x61')][_0xa6d2('0x37')];_0x1dd4e3+=0x1){_0x1dd4e3>0x0&&(_0x30f8a1+='\x20'+_0x51b214['operator']+'\x20');_0x30f8a1+=_0x51b214[_0xa6d2('0x61')][_0x1dd4e3][_0xa6d2('0x63')]?_0xc1ebbb(_0x51b214[_0xa6d2('0x61')][_0x1dd4e3][_0xa6d2('0x63')]):_0x51b214['rules'][_0x1dd4e3]['field']+'\x20'+_0x51b214['rules'][_0x1dd4e3][_0xa6d2('0x65')]+(_0x32eb40(_0x51b214[_0xa6d2('0x61')][_0x1dd4e3]['condition'])?'\x20'+_0x51b214[_0xa6d2('0x61')][_0x1dd4e3][_0xa6d2('0x66')]:'');}return _0x30f8a1+')';};var _0x3ace46={'where':{'id':_0x4fe291['id']}},_0xd45258,_0x5647ac,_0x394709,_0x53e303,_0x2ea398;_0x3ace46=_[_0xa6d2('0x3e')]({},_0x3ace46,_0x3d9787);return db['AnalyticCustomReport'][_0xa6d2('0x46')](_0x3ace46)[_0xa6d2('0x22')](function(_0x33c47d){if(_0x33c47d){_0xd45258=_0x33c47d;return _0x33c47d[_0xa6d2('0x67')]();}return null;})['then'](function(_0x33ed3f){if(_0x33ed3f){if(!_0x33ed3f['length']){throw new db[(_0xa6d2('0x85'))][(_0xa6d2('0x68'))](_0xa6d2('0x86'),0x193);}_0x5647ac=_0x33ed3f;return db[_0xa6d2('0x69')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x254a2b){if(_0x254a2b){_0x394709=_['keyBy'](_0x254a2b,'id');var _0x858ed6;var _0x59cf68=squel[_0xa6d2('0x6c')]();_0x59cf68[_0xa6d2('0x6d')](_0xd45258['table']);for(var _0x2f6a9d=0x0;_0x2f6a9d<_0x5647ac['length'];_0x2f6a9d+=0x1){_0x858ed6=_0x5647ac[_0x2f6a9d]['MetricId']?_0x394709[_0x5647ac[_0x2f6a9d][_0xa6d2('0x87')]][_0xa6d2('0x6e')]:_0x5647ac[_0x2f6a9d][_0xa6d2('0x64')];_0x858ed6=_0x5647ac[_0x2f6a9d][_0xa6d2('0x6f')]?_[_0xa6d2('0x70')](_0x288612[_0x5647ac[_0x2f6a9d][_0xa6d2('0x6f')]],'%s',_0x858ed6):_0x858ed6;_0x858ed6=_0x5647ac[_0x2f6a9d][_0xa6d2('0x71')]?_[_0xa6d2('0x70')](_0x4995f7[_0x5647ac[_0x2f6a9d][_0xa6d2('0x71')]],'%s',_0x858ed6):_0x858ed6;if(_0x5647ac[_0x2f6a9d]['groupBy']){_0x59cf68[_0xa6d2('0x63')](_0x858ed6);}_0x5647ac[_0x2f6a9d][_0xa6d2('0x73')]&&_0x59cf68[_0xa6d2('0x39')](_0x858ed6,_0x5647ac[_0x2f6a9d]['orderBy']==='DESC'?![]:!![]);_0x59cf68[_0xa6d2('0x64')](_0x858ed6,_0x5647ac[_0x2f6a9d][_0xa6d2('0x75')]||_0x858ed6);}if(_0xd45258[_0xa6d2('0x76')]){_0xd45258[_0xa6d2('0x76')]=JSON[_0xa6d2('0x77')](_0xd45258[_0xa6d2('0x76')]);for(var _0x41cb03=0x0;_0x41cb03<_0xd45258['joins']['length'];_0x41cb03+=0x1){if(_0xd45258[_0xa6d2('0x76')][_0x41cb03][_0xa6d2('0x30')]&&_[_0xa6d2('0x5d')](_0x354eca,_0xd45258[_0xa6d2('0x76')][_0x41cb03][_0xa6d2('0x30')])&&_0xd45258[_0xa6d2('0x76')][_0x41cb03]['parentKey']&&_0xd45258['joins'][_0x41cb03]['foreignTable']&&_0xd45258[_0xa6d2('0x76')][_0x41cb03]['foreignKey']){_0x59cf68[_0xd45258[_0xa6d2('0x76')][_0x41cb03]['type']](_0xd45258['joins'][_0x41cb03][_0xa6d2('0x79')],null,util[_0xa6d2('0x71')](_0xa6d2('0x7a'),_0xd45258['table'],_0xd45258[_0xa6d2('0x76')][_0x41cb03][_0xa6d2('0x78')],_0xd45258[_0xa6d2('0x76')][_0x41cb03][_0xa6d2('0x79')],_0xd45258[_0xa6d2('0x76')][_0x41cb03][_0xa6d2('0x88')]));}}}if(_0xd45258['conditions']){_0xd45258[_0xa6d2('0x7c')]=JSON[_0xa6d2('0x77')](_0xd45258[_0xa6d2('0x7c')]);_0x59cf68[_0xa6d2('0x3b')](_0xc1ebbb(_0xd45258['conditions'][_0xa6d2('0x63')]));}_0x2ea398=_0x59cf68[_0xa6d2('0x89')]();_0x59cf68[_0xa6d2('0x1d')](_0x47f970);_0x59cf68[_0xa6d2('0x1b')](0x0);return;}})[_0xa6d2('0x22')](function(){if(_0x2da5bd[_0xa6d2('0x8a')]==='web'){return null;}var _0x1a8672=_[_0xa6d2('0x3e')](_0x2da5bd,{'name':_0x2da5bd[_0xa6d2('0x8b')]||_0x2da5bd[_0xa6d2('0x29')]||_0xd45258[_0xa6d2('0x29')],'basename':_0x3d409c,'savename':util[_0xa6d2('0x71')](_0xa6d2('0x8c'),_0x2da5bd['name']||_0xd45258[_0xa6d2('0x29')],require(_0xa6d2('0x8d'))[_0xa6d2('0x8e')](0x4),_0x2da5bd[_0xa6d2('0x8a')]||_0xa6d2('0x8f')),'reportId':_0xd45258['id'],'reportType':_0xa6d2('0x90')});return db['AnalyticExtractedReport']['create'](_0x1a8672,{'raw':!![]});})[_0xa6d2('0x22')](function(_0x3d687e){if(_0xd45258[_0xa6d2('0x7b')]===_0xa6d2('0x91')){_0x2ea398[_0xa6d2('0x3b')](_0xd45258[_0xa6d2('0x7b')]+_0xa6d2('0x92'),_0x2da5bd[_0xa6d2('0x93')],_0x2da5bd['endDate']);}else{_0x2ea398[_0xa6d2('0x3b')](_0xd45258['table']+_0xa6d2('0x94'),_0x2da5bd['startDate'],_0x2da5bd[_0xa6d2('0x95')]);}if(_0x3d687e){logger[_0xa6d2('0x96')](_0xa6d2('0x97'),_0x2ea398[_0xa6d2('0x7f')]());require(_0xa6d2('0x98'))[_0xa6d2('0x99')](path['join'](__dirname,_0xa6d2('0x9a'),_0x3d687e['output']),[_0x3d687e['id'],_0x2ea398[_0xa6d2('0x7f')](),path[_0xa6d2('0x80')](__dirname,_0xa6d2('0x9b'),_0x3d687e[_0xa6d2('0x9c')]),_0x3d409c]);return _0x3d687e;}else{var _0xced477=squel[_0xa6d2('0x6c')]();_0xced477[_0xa6d2('0x6d')]('('+_0x2ea398['toString']()+')',_0xa6d2('0x9d'));_0xced477['field'](_0xa6d2('0x9e'),_0xa6d2('0x1c'));_0x2ea398['limit'](_0x2da5bd[_0xa6d2('0x1d')]||_0x47f970);_0x2ea398[_0xa6d2('0x1b')](_0x2da5bd[_0xa6d2('0x1b')]||0x0);return dbH['sequelize'][_0xa6d2('0x31')](_0xced477[_0xa6d2('0x7f')](),{'type':dbH[_0xa6d2('0x7e')]['QueryTypes'][_0xa6d2('0x9f')]})['then'](function(_0xc2f24f){if(!_0xc2f24f[_0xa6d2('0x37')]){_0x53e303=0x0;}else{_0x53e303=_0xc2f24f[0x0][_0xa6d2('0x1c')]||0x0;}return dbH[_0xa6d2('0x7e')][_0xa6d2('0x31')](_0x2ea398[_0xa6d2('0x7f')](),{'type':dbH[_0xa6d2('0x7e')][_0xa6d2('0xa0')]['SELECT']});})[_0xa6d2('0x22')](function(_0x2e96ab){return{'rows':_0x2e96ab||[],'count':_0x53e303};});}});}exports[_0xa6d2('0xa1')]=function(_0x4b9eae,_0xb6f46c){return runReport(_0x4b9eae['params'],_0x4b9eae['query'],_0x4b9eae['options'])[_0xa6d2('0x22')](respondWithResult(_0xb6f46c,null))[_0xa6d2('0x43')](handleError(_0xb6f46c,null));};exports[_0xa6d2('0xa2')]=runReport;exports['query']=function(_0x2b7bb6,_0xdcfee4){var _0x1e9ca5=0xa;var _0x2f43c1=[_0xa6d2('0x80'),'left_join',_0xa6d2('0x81'),_0xa6d2('0x52')];var _0x29f2d9={'SUM':_0xa6d2('0x53'),'COUNT':_0xa6d2('0x54'),'COUNT DISTINCT':_0xa6d2('0x55'),'MAX':_0xa6d2('0xa3'),'MIN':_0xa6d2('0x82'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xa6d2('0xa4'),'GROUP_CONCAT ASC':_0xa6d2('0x57'),'GROUP_CONCAT DESC':_0xa6d2('0x83')};var _0x64fb94={'SEC_TO_TIME':_0xa6d2('0x58'),'DATE':_0xa6d2('0x59'),'HOUR':_0xa6d2('0x5a'),'ROUND':_0xa6d2('0x5b'),'UNIX_TIMESTAMP':_0xa6d2('0x5c')};var _0x19329b=function(_0x27f176){return!_['includes']([_0xa6d2('0x5e'),'IS\x20NOT\x20NULL',_0xa6d2('0x60'),_0xa6d2('0x84')],_0x27f176);};var _0x3f5e1c=function(_0x5c52ad){if(!_0x5c52ad||!_0x5c52ad[_0xa6d2('0x61')]['length']){return'';}for(var _0x4191a0='(',_0x2416c1=0x0;_0x2416c1<_0x5c52ad[_0xa6d2('0x61')][_0xa6d2('0x37')];_0x2416c1+=0x1){_0x2416c1>0x0&&(_0x4191a0+='\x20'+_0x5c52ad[_0xa6d2('0x62')]+'\x20');_0x4191a0+=_0x5c52ad['rules'][_0x2416c1][_0xa6d2('0x63')]?_0x3f5e1c(_0x5c52ad[_0xa6d2('0x61')][_0x2416c1][_0xa6d2('0x63')]):_0x5c52ad[_0xa6d2('0x61')][_0x2416c1][_0xa6d2('0x64')]+'\x20'+_0x5c52ad[_0xa6d2('0x61')][_0x2416c1][_0xa6d2('0x65')]+(_0x19329b(_0x5c52ad[_0xa6d2('0x61')][_0x2416c1][_0xa6d2('0x65')])?'\x20'+_0x5c52ad['rules'][_0x2416c1][_0xa6d2('0x66')]:'');}return _0x4191a0+')';};var _0x56d45d={'where':{'id':_0x2b7bb6[_0xa6d2('0x45')]['id']}},_0x28e9b9,_0x457555,_0x3e8299,_0x48928f,_0x26a192;_0x56d45d=_[_0xa6d2('0x3e')]({},_0x56d45d,_0x2b7bb6['options']);return db['AnalyticCustomReport'][_0xa6d2('0x46')](_0x56d45d)[_0xa6d2('0x22')](function(_0x311ec3){if(_0x311ec3){_0x28e9b9=_0x311ec3;return _0x311ec3[_0xa6d2('0x67')]();}return null;})['then'](function(_0x1956d1){if(_0x1956d1){if(!_0x1956d1[_0xa6d2('0x37')]){throw new db[(_0xa6d2('0x85'))][(_0xa6d2('0x68'))](_0xa6d2('0x86'),0x193);}_0x457555=_0x1956d1;return db[_0xa6d2('0x69')][_0xa6d2('0x6a')]({'raw':!![]});}return null;})[_0xa6d2('0x22')](function(_0x5e7de4){if(_0x5e7de4){_0x3e8299=_[_0xa6d2('0x6b')](_0x5e7de4,'id');var _0x4c73be;var _0x524c9e=squel[_0xa6d2('0x6c')]();_0x524c9e[_0xa6d2('0x6d')](_0x28e9b9[_0xa6d2('0x7b')]);for(var _0x731c47=0x0;_0x731c47<_0x457555[_0xa6d2('0x37')];_0x731c47+=0x1){_0x4c73be=_0x457555[_0x731c47][_0xa6d2('0x87')]?_0x3e8299[_0x457555[_0x731c47][_0xa6d2('0x87')]][_0xa6d2('0x6e')]:_0x457555[_0x731c47]['field'];_0x4c73be=_0x457555[_0x731c47][_0xa6d2('0x6f')]?_['replace'](_0x29f2d9[_0x457555[_0x731c47][_0xa6d2('0x6f')]],'%s',_0x4c73be):_0x4c73be;_0x4c73be=_0x457555[_0x731c47]['format']?_['replace'](_0x64fb94[_0x457555[_0x731c47]['format']],'%s',_0x4c73be):_0x4c73be;if(_0x457555[_0x731c47][_0xa6d2('0x72')]){_0x524c9e['group'](_0x4c73be);}_0x457555[_0x731c47][_0xa6d2('0x73')]&&_0x524c9e[_0xa6d2('0x39')](_0x4c73be,_0x457555[_0x731c47][_0xa6d2('0x73')]===_0xa6d2('0x74')?![]:!![]);_0x524c9e['field'](_0x4c73be,_0x457555[_0x731c47][_0xa6d2('0x75')]||_0x4c73be);}if(_0x28e9b9[_0xa6d2('0x76')]){_0x28e9b9[_0xa6d2('0x76')]=JSON['parse'](_0x28e9b9[_0xa6d2('0x76')]);for(var _0x2ac20c=0x0;_0x2ac20c<_0x28e9b9[_0xa6d2('0x76')][_0xa6d2('0x37')];_0x2ac20c+=0x1){if(_0x28e9b9[_0xa6d2('0x76')][_0x2ac20c][_0xa6d2('0x30')]&&_[_0xa6d2('0x5d')](_0x2f43c1,_0x28e9b9[_0xa6d2('0x76')][_0x2ac20c][_0xa6d2('0x30')])&&_0x28e9b9[_0xa6d2('0x76')][_0x2ac20c][_0xa6d2('0x78')]&&_0x28e9b9[_0xa6d2('0x76')][_0x2ac20c][_0xa6d2('0x79')]&&_0x28e9b9[_0xa6d2('0x76')][_0x2ac20c]['foreignKey']){_0x524c9e[_0x28e9b9[_0xa6d2('0x76')][_0x2ac20c][_0xa6d2('0x30')]](_0x28e9b9['joins'][_0x2ac20c][_0xa6d2('0x79')],null,util[_0xa6d2('0x71')](_0xa6d2('0x7a'),_0x28e9b9[_0xa6d2('0x7b')],_0x28e9b9[_0xa6d2('0x76')][_0x2ac20c][_0xa6d2('0x78')],_0x28e9b9[_0xa6d2('0x76')][_0x2ac20c][_0xa6d2('0x79')],_0x28e9b9['joins'][_0x2ac20c][_0xa6d2('0x88')]));}}}if(_0x28e9b9[_0xa6d2('0x7c')]){_0x28e9b9['conditions']=JSON[_0xa6d2('0x77')](_0x28e9b9[_0xa6d2('0x7c')]);_0x524c9e[_0xa6d2('0x3b')](_0x3f5e1c(_0x28e9b9[_0xa6d2('0x7c')][_0xa6d2('0x63')]));}_0x26a192=_0x524c9e[_0xa6d2('0x89')]();_0x524c9e[_0xa6d2('0x1d')](_0x1e9ca5);_0x524c9e[_0xa6d2('0x1b')](0x0);logger[_0xa6d2('0xa5')]('Limited\x20Query:',_0x524c9e[_0xa6d2('0x7f')]());return dbH[_0xa6d2('0x7e')][_0xa6d2('0x31')](_0x524c9e['toString'](),{'type':dbH[_0xa6d2('0x7e')][_0xa6d2('0xa0')][_0xa6d2('0x9f')]});}})[_0xa6d2('0x22')](function(){return{'sql':_0x26a192[_0xa6d2('0x7f')]()};})[_0xa6d2('0x22')](respondWithResult(_0xdcfee4,null))['catch'](handleError(_0xdcfee4,null));}; \ No newline at end of file +var _0x0b0e=['IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','field','condition','value','options','getFields','length','Sequelize','AnalyticMetric','findAll','keyBy','select','table','function','format','groupBy','group','orderBy','DESC','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','from','MetricId','metric','alias','foreignKey','output','web','fullPath','%s-%s.%s','custom','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','replace','Limited\x20Query:','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','undefined','limit','count','set','json','apply','update','destroy','UserProfileResource','then','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','include','rows','catch','show','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','CustomReports','body','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes'];(function(_0x278bd7,_0x2b4b52){var _0x56f13b=function(_0x44f3d3){while(--_0x44f3d3){_0x278bd7['push'](_0x278bd7['shift']());}};_0x56f13b(++_0x2b4b52);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3da72b,_0x4fd809){_0x3da72b=_0x3da72b-0x0;var _0xc64ac4=_0x0b0e[_0x3da72b];return _0xc64ac4;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];var dbH=require(_0xe0b0('0x17'))[_0xe0b0('0x18')];function respondWithStatusCode(_0x45f914,_0x34fed4){_0x34fed4=_0x34fed4||0xcc;return function(_0x4d2bf7){if(_0x4d2bf7){return _0x45f914[_0xe0b0('0x19')](_0x34fed4);}return _0x45f914[_0xe0b0('0x1a')](_0x34fed4)[_0xe0b0('0x1b')]();};}function respondWithResult(_0x24babd,_0x177c24){_0x177c24=_0x177c24||0xc8;return function(_0x55d884){if(_0x55d884){return _0x24babd[_0xe0b0('0x1a')](_0x177c24)['json'](_0x55d884);}};}function respondWithFilteredResult(_0x35cb40,_0xadee6e){return function(_0x519ae8){if(_0x519ae8){var _0x11fdca=typeof _0xadee6e['offset']===_0xe0b0('0x1c')&&typeof _0xadee6e[_0xe0b0('0x1d')]==='undefined';var _0x54a3eb=_0x519ae8[_0xe0b0('0x1e')];var _0x50a441=_0x11fdca?0x0:_0xadee6e['offset'];var _0x4bce65=_0x11fdca?_0x519ae8[_0xe0b0('0x1e')]:_0xadee6e['offset']+_0xadee6e['limit'];var _0x10cde1;if(_0x4bce65>=_0x54a3eb){_0x4bce65=_0x54a3eb;_0x10cde1=0xc8;}else{_0x10cde1=0xce;}_0x35cb40['status'](_0x10cde1);return _0x35cb40[_0xe0b0('0x1f')]('Content-Range',_0x50a441+'-'+_0x4bce65+'/'+_0x54a3eb)[_0xe0b0('0x20')](_0x519ae8);}return null;};}function patchUpdates(_0x1cd7c4){return function(_0x3e10b3){try{jsonpatch[_0xe0b0('0x21')](_0x3e10b3,_0x1cd7c4,!![]);}catch(_0x2cf6a1){return BPromise['reject'](_0x2cf6a1);}return _0x3e10b3['save']();};}function saveUpdates(_0x2fa820,_0x5512bb){return function(_0x12b260){if(_0x12b260){return _0x12b260[_0xe0b0('0x22')](_0x2fa820)['then'](function(_0x170ad8){return _0x170ad8;});}return null;};}function removeEntity(_0x503883,_0x2208d0){return function(_0x49a727){if(_0x49a727){return _0x49a727[_0xe0b0('0x23')]()['then'](function(){var _0x3e5c88=_0x49a727['get']({'plain':!![]});var _0x4700cc='CustomReports';return db[_0xe0b0('0x24')]['destroy']({'where':{'type':_0x4700cc,'resourceId':_0x3e5c88['id']}})[_0xe0b0('0x25')](function(){return _0x49a727;});})[_0xe0b0('0x25')](function(){_0x503883[_0xe0b0('0x1a')](0xcc)[_0xe0b0('0x1b')]();});}};}function handleEntityNotFound(_0x3ec2,_0x10745d){return function(_0x5200a6){if(!_0x5200a6){_0x3ec2[_0xe0b0('0x19')](0x194);}return _0x5200a6;};}function handleError(_0x1b8aa8,_0x5b7a64){_0x5b7a64=_0x5b7a64||0x1f4;return function(_0x15e13b){logger[_0xe0b0('0x26')](_0x15e13b[_0xe0b0('0x27')]);if(_0x15e13b[_0xe0b0('0x28')]){delete _0x15e13b[_0xe0b0('0x28')];}_0x1b8aa8[_0xe0b0('0x1a')](_0x5b7a64)[_0xe0b0('0x29')](_0x15e13b);};}exports['index']=function(_0x1854b8,_0x3c0109){var _0x48a9b5={},_0x4fe400={},_0x158b7f={'count':0x0,'rows':[]};var _0x33e672=_[_0xe0b0('0x2a')](db[_0xe0b0('0x2b')][_0xe0b0('0x2c')],function(_0x5866e5){return{'name':_0x5866e5[_0xe0b0('0x2d')],'type':_0x5866e5[_0xe0b0('0x2e')][_0xe0b0('0x2f')]};});_0x4fe400[_0xe0b0('0x30')]=_[_0xe0b0('0x2a')](_0x33e672,'name');_0x4fe400[_0xe0b0('0x31')]=_[_0xe0b0('0x32')](_0x1854b8[_0xe0b0('0x31')]);_0x4fe400[_0xe0b0('0x33')]=_[_0xe0b0('0x34')](_0x4fe400[_0xe0b0('0x30')],_0x4fe400[_0xe0b0('0x31')]);_0x48a9b5[_0xe0b0('0x35')]=_[_0xe0b0('0x34')](_0x4fe400[_0xe0b0('0x30')],qs[_0xe0b0('0x36')](_0x1854b8[_0xe0b0('0x31')][_0xe0b0('0x36')]));_0x48a9b5[_0xe0b0('0x35')]=_0x48a9b5[_0xe0b0('0x35')]['length']?_0x48a9b5[_0xe0b0('0x35')]:_0x4fe400[_0xe0b0('0x30')];if(!_0x1854b8[_0xe0b0('0x31')][_0xe0b0('0x37')](_0xe0b0('0x38'))){_0x48a9b5[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1854b8['query']['limit']);_0x48a9b5['offset']=qs['offset'](_0x1854b8[_0xe0b0('0x31')][_0xe0b0('0x39')]);}_0x48a9b5[_0xe0b0('0x3a')]=qs['sort'](_0x1854b8[_0xe0b0('0x31')][_0xe0b0('0x3b')]);_0x48a9b5[_0xe0b0('0x3c')]=qs[_0xe0b0('0x33')](_['pick'](_0x1854b8[_0xe0b0('0x31')],_0x4fe400[_0xe0b0('0x33')]),_0x33e672);if(_0x1854b8[_0xe0b0('0x31')][_0xe0b0('0x3d')]){_0x48a9b5[_0xe0b0('0x3c')]=_[_0xe0b0('0x3e')](_0x48a9b5[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x2a')](_0x33e672,function(_0xeaffbb){if(_0xeaffbb['type']!==_0xe0b0('0x3f')){var _0x54f646={};_0x54f646[_0xeaffbb[_0xe0b0('0x28')]]={'$like':'%'+_0x1854b8[_0xe0b0('0x31')][_0xe0b0('0x3d')]+'%'};return _0x54f646;}})});}_0x48a9b5=_[_0xe0b0('0x3e')]({},_0x48a9b5,_0x1854b8['options']);var _0x3e1b6b={'where':_0x48a9b5[_0xe0b0('0x3c')]};return db[_0xe0b0('0x2b')][_0xe0b0('0x1e')](_0x3e1b6b)[_0xe0b0('0x25')](function(_0x1c12bd){_0x158b7f[_0xe0b0('0x1e')]=_0x1c12bd;if(_0x1854b8[_0xe0b0('0x31')]['includeAll']){_0x48a9b5[_0xe0b0('0x40')]=[{'all':!![]}];}return db[_0xe0b0('0x2b')]['findAll'](_0x48a9b5);})['then'](function(_0x327fb4){_0x158b7f[_0xe0b0('0x41')]=_0x327fb4;return _0x158b7f;})['then'](respondWithFilteredResult(_0x3c0109,_0x48a9b5))[_0xe0b0('0x42')](handleError(_0x3c0109,null));};exports[_0xe0b0('0x43')]=function(_0x6bca5c,_0x1c869d){var _0x1a8cc7={'raw':![],'where':{'id':_0x6bca5c['params']['id']}},_0x5c31b5={};_0x5c31b5['model']=_[_0xe0b0('0x32')](db[_0xe0b0('0x2b')]['rawAttributes']);_0x5c31b5[_0xe0b0('0x31')]=_[_0xe0b0('0x32')](_0x6bca5c[_0xe0b0('0x31')]);_0x5c31b5[_0xe0b0('0x33')]=_[_0xe0b0('0x34')](_0x5c31b5['model'],_0x5c31b5['query']);_0x1a8cc7[_0xe0b0('0x35')]=_[_0xe0b0('0x34')](_0x5c31b5[_0xe0b0('0x30')],qs[_0xe0b0('0x36')](_0x6bca5c[_0xe0b0('0x31')]['fields']));_0x1a8cc7[_0xe0b0('0x35')]=_0x1a8cc7[_0xe0b0('0x35')]['length']?_0x1a8cc7['attributes']:_0x5c31b5['model'];if(_0x6bca5c[_0xe0b0('0x31')][_0xe0b0('0x44')]){_0x1a8cc7[_0xe0b0('0x40')]=[{'all':!![]}];}_0x1a8cc7=_[_0xe0b0('0x3e')]({},_0x1a8cc7,_0x6bca5c['options']);return db[_0xe0b0('0x2b')][_0xe0b0('0x45')](_0x1a8cc7)['then'](handleEntityNotFound(_0x1c869d,null))['then'](respondWithResult(_0x1c869d,null))[_0xe0b0('0x42')](handleError(_0x1c869d,null));};exports[_0xe0b0('0x46')]=function(_0x497f4f,_0x2b1917){return db[_0xe0b0('0x2b')]['create'](_0x497f4f['body'],{})[_0xe0b0('0x25')](function(_0x511679){var _0x165dc8=_0x497f4f[_0xe0b0('0x47')][_0xe0b0('0x48')]({'plain':!![]});if(!_0x165dc8)throw new Error(_0xe0b0('0x49'));if(_0x165dc8[_0xe0b0('0x4a')]===_0xe0b0('0x47')){var _0x5f5486=_0x511679['get']({'plain':!![]});var _0x2ef908='Reports';return db['UserProfileSection'][_0xe0b0('0x45')]({'where':{'name':_0x2ef908,'userProfileId':_0x165dc8[_0xe0b0('0x4b')]},'raw':!![]})['then'](function(_0x4b65d1){if(_0x4b65d1&&_0x4b65d1[_0xe0b0('0x4c')]===0x0){return db[_0xe0b0('0x24')][_0xe0b0('0x46')]({'name':_0x5f5486[_0xe0b0('0x28')],'resourceId':_0x5f5486['id'],'type':_0xe0b0('0x4d'),'sectionId':_0x4b65d1['id']},{})[_0xe0b0('0x25')](function(){return _0x511679;});}else{return _0x511679;}})[_0xe0b0('0x42')](function(_0x4ebb0f){logger[_0xe0b0('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ebb0f);throw _0x4ebb0f;});}return _0x511679;})[_0xe0b0('0x25')](respondWithResult(_0x2b1917,0xc9))['catch'](handleError(_0x2b1917,null));};exports['update']=function(_0x33822e,_0x237e8c){if(_0x33822e[_0xe0b0('0x4e')]['id']){delete _0x33822e[_0xe0b0('0x4e')]['id'];}return db[_0xe0b0('0x2b')][_0xe0b0('0x45')]({'where':{'id':_0x33822e[_0xe0b0('0x4f')]['id']}})[_0xe0b0('0x25')](handleEntityNotFound(_0x237e8c,null))[_0xe0b0('0x25')](saveUpdates(_0x33822e['body'],null))[_0xe0b0('0x25')](respondWithResult(_0x237e8c,null))['catch'](handleError(_0x237e8c,null));};exports[_0xe0b0('0x23')]=function(_0x3ae36e,_0x30c4a9){return db[_0xe0b0('0x2b')][_0xe0b0('0x45')]({'where':{'id':_0x3ae36e[_0xe0b0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x30c4a9,null))[_0xe0b0('0x25')](removeEntity(_0x30c4a9,null))[_0xe0b0('0x42')](handleError(_0x30c4a9,null));};exports[_0xe0b0('0x50')]=function(_0x271445,_0x3bb6d6){var _0x3b015e=0xa;var _0x234cb7=[_0xe0b0('0x51'),_0xe0b0('0x52'),_0xe0b0('0x53'),_0xe0b0('0x54')];var _0x18ab99={'SUM':_0xe0b0('0x55'),'COUNT':_0xe0b0('0x56'),'COUNT DISTINCT':_0xe0b0('0x57'),'MAX':_0xe0b0('0x58'),'MIN':_0xe0b0('0x59'),'AVG':_0xe0b0('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe0b0('0x5b'),'GROUP_CONCAT DESC':_0xe0b0('0x5c')};var _0x1182dc={'SEC_TO_TIME':_0xe0b0('0x5d'),'DATE':_0xe0b0('0x5e'),'HOUR':_0xe0b0('0x5f'),'ROUND':_0xe0b0('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x47dcc4=function(_0x139014){return!_[_0xe0b0('0x61')]([_0xe0b0('0x62'),'IS\x20NOT\x20NULL',_0xe0b0('0x63'),_0xe0b0('0x64')],_0x139014);};var _0x309efb=function(_0x3d820c){if(!_0x3d820c||!_0x3d820c[_0xe0b0('0x65')]['length']){return'';}for(var _0x370f8c='(',_0x242120=0x0;_0x242120<_0x3d820c[_0xe0b0('0x65')]['length'];_0x242120+=0x1){_0x242120>0x0&&(_0x370f8c+='\x20'+_0x3d820c[_0xe0b0('0x66')]+'\x20');_0x370f8c+=_0x3d820c[_0xe0b0('0x65')][_0x242120]['group']?_0x309efb(_0x3d820c[_0xe0b0('0x65')][_0x242120]['group']):_0x3d820c['rules'][_0x242120][_0xe0b0('0x67')]+'\x20'+_0x3d820c['rules'][_0x242120]['condition']+(_0x47dcc4(_0x3d820c[_0xe0b0('0x65')][_0x242120][_0xe0b0('0x68')])?'\x20'+_0x3d820c[_0xe0b0('0x65')][_0x242120][_0xe0b0('0x69')]:'');}return _0x370f8c+')';};var _0x5a7913={'where':{'id':_0x271445[_0xe0b0('0x4f')]['id']}},_0x3679e0,_0x2287a5,_0x3e7fb4,_0x41ec8e,_0x1b29c;_0x5a7913=_[_0xe0b0('0x3e')]({},_0x5a7913,_0x271445[_0xe0b0('0x6a')]);return db['AnalyticCustomReport']['find'](_0x5a7913)[_0xe0b0('0x25')](function(_0x35144f){if(_0x35144f){_0x3679e0=_0x35144f;return _0x35144f[_0xe0b0('0x6b')]();}return null;})['then'](function(_0x49b754){if(_0x49b754){if(!_0x49b754[_0xe0b0('0x6c')]){throw new db[(_0xe0b0('0x6d'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2287a5=_0x49b754;return db[_0xe0b0('0x6e')][_0xe0b0('0x6f')]({'raw':!![]});}return null;})[_0xe0b0('0x25')](function(_0x29175a){if(_0x29175a){_0x3e7fb4=_[_0xe0b0('0x70')](_0x29175a,'id');var _0x15f0f8;var _0x1bc7a6=squel[_0xe0b0('0x71')]();_0x1bc7a6['from'](_0x3679e0[_0xe0b0('0x72')]);for(var _0x12e245=0x0;_0x12e245<_0x2287a5[_0xe0b0('0x6c')];_0x12e245+=0x1){_0x15f0f8=_0x2287a5[_0x12e245]['MetricId']?_0x3e7fb4[_0x2287a5[_0x12e245]['MetricId']]['metric']:_0x2287a5[_0x12e245]['field'];_0x15f0f8=_0x2287a5[_0x12e245]['function']?_['replace'](_0x18ab99[_0x2287a5[_0x12e245][_0xe0b0('0x73')]],'%s',_0x15f0f8):_0x15f0f8;_0x15f0f8=_0x2287a5[_0x12e245]['format']?_['replace'](_0x1182dc[_0x2287a5[_0x12e245][_0xe0b0('0x74')]],'%s',_0x15f0f8):_0x15f0f8;if(_0x2287a5[_0x12e245][_0xe0b0('0x75')]){_0x1bc7a6[_0xe0b0('0x76')](_0x15f0f8);}_0x2287a5[_0x12e245][_0xe0b0('0x77')]&&_0x1bc7a6[_0xe0b0('0x3a')](_0x15f0f8,_0x2287a5[_0x12e245][_0xe0b0('0x77')]===_0xe0b0('0x78')?![]:!![]);_0x1bc7a6[_0xe0b0('0x67')](_0x15f0f8,_0x2287a5[_0x12e245]['alias']||_0x15f0f8);}if(_0x3679e0[_0xe0b0('0x79')]){_0x3679e0[_0xe0b0('0x79')]=JSON[_0xe0b0('0x7a')](_0x3679e0[_0xe0b0('0x79')]);for(var _0x173ed8=0x0;_0x173ed8<_0x3679e0[_0xe0b0('0x79')][_0xe0b0('0x6c')];_0x173ed8+=0x1){if(_0x3679e0['joins'][_0x173ed8][_0xe0b0('0x2e')]&&_['includes'](_0x234cb7,_0x3679e0[_0xe0b0('0x79')][_0x173ed8][_0xe0b0('0x2e')])&&_0x3679e0[_0xe0b0('0x79')][_0x173ed8][_0xe0b0('0x7b')]&&_0x3679e0['joins'][_0x173ed8][_0xe0b0('0x7c')]&&_0x3679e0[_0xe0b0('0x79')][_0x173ed8]['foreignKey']){_0x1bc7a6[_0x3679e0['joins'][_0x173ed8][_0xe0b0('0x2e')]](_0x3679e0[_0xe0b0('0x79')][_0x173ed8][_0xe0b0('0x7c')],null,util[_0xe0b0('0x74')](_0xe0b0('0x7d'),_0x3679e0[_0xe0b0('0x72')],_0x3679e0[_0xe0b0('0x79')][_0x173ed8][_0xe0b0('0x7b')],_0x3679e0[_0xe0b0('0x79')][_0x173ed8][_0xe0b0('0x7c')],_0x3679e0['joins'][_0x173ed8]['foreignKey']));}}}if(_0x3679e0[_0xe0b0('0x7e')]){_0x3679e0['conditions']=JSON['parse'](_0x3679e0['conditions']);_0x1bc7a6['where'](_0x309efb(_0x3679e0[_0xe0b0('0x7e')]['group']));}_0x1b29c=_0x1bc7a6[_0xe0b0('0x7f')]();_0x1bc7a6[_0xe0b0('0x1d')](_0x3b015e);_0x1bc7a6[_0xe0b0('0x39')](0x0);logger[_0xe0b0('0x80')]('Limited\x20Query:',_0x1bc7a6[_0xe0b0('0x81')]());return dbH[_0xe0b0('0x82')]['query'](_0x1bc7a6[_0xe0b0('0x81')](),{'type':dbH[_0xe0b0('0x82')][_0xe0b0('0x83')][_0xe0b0('0x84')]});}})[_0xe0b0('0x25')](respondWithResult(_0x3bb6d6,null))['catch'](handleError(_0x3bb6d6,null));};function runReport(_0x55d3f8,_0x55aef7,_0x545694){var _0x5c258b=_0x55aef7[_0xe0b0('0x28')];var _0x567e1a=0xa;var _0x3c09af=['join',_0xe0b0('0x52'),_0xe0b0('0x53'),_0xe0b0('0x54')];var _0x380b4c={'SUM':_0xe0b0('0x55'),'COUNT':_0xe0b0('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xe0b0('0x85'),'GROUP_CONCAT ASC':_0xe0b0('0x5b'),'GROUP_CONCAT DESC':_0xe0b0('0x5c')};var _0x4377f7={'SEC_TO_TIME':_0xe0b0('0x5d'),'DATE':'DATE(%s)','HOUR':_0xe0b0('0x5f'),'ROUND':_0xe0b0('0x60'),'UNIX_TIMESTAMP':_0xe0b0('0x86')};var _0xc6090e=function(_0x154e6d){return!_[_0xe0b0('0x61')]([_0xe0b0('0x62'),_0xe0b0('0x87'),_0xe0b0('0x63'),'IS\x20NOT\x20EMPTY'],_0x154e6d);};var _0x589c47=function(_0x6e0e9){if(!_0x6e0e9||!_0x6e0e9[_0xe0b0('0x65')]['length']){return'';}for(var _0x7feff4='(',_0x4593f1=0x0;_0x4593f1<_0x6e0e9[_0xe0b0('0x65')][_0xe0b0('0x6c')];_0x4593f1+=0x1){_0x4593f1>0x0&&(_0x7feff4+='\x20'+_0x6e0e9[_0xe0b0('0x66')]+'\x20');_0x7feff4+=_0x6e0e9[_0xe0b0('0x65')][_0x4593f1][_0xe0b0('0x76')]?_0x589c47(_0x6e0e9[_0xe0b0('0x65')][_0x4593f1]['group']):_0x6e0e9['rules'][_0x4593f1]['field']+'\x20'+_0x6e0e9[_0xe0b0('0x65')][_0x4593f1][_0xe0b0('0x68')]+(_0xc6090e(_0x6e0e9['rules'][_0x4593f1][_0xe0b0('0x68')])?'\x20'+_0x6e0e9[_0xe0b0('0x65')][_0x4593f1][_0xe0b0('0x69')]:'');}return _0x7feff4+')';};var _0x328832={'where':{'id':_0x55d3f8['id']}},_0x5c45ae,_0x56c4b9,_0x4e1fb1,_0x22029a,_0x266835;_0x328832=_['merge']({},_0x328832,_0x545694);return db[_0xe0b0('0x2b')][_0xe0b0('0x45')](_0x328832)['then'](function(_0x576482){if(_0x576482){_0x5c45ae=_0x576482;return _0x576482[_0xe0b0('0x6b')]();}return null;})['then'](function(_0x251195){if(_0x251195){if(!_0x251195['length']){throw new db[(_0xe0b0('0x6d'))][(_0xe0b0('0x88'))](_0xe0b0('0x89'),0x193);}_0x56c4b9=_0x251195;return db[_0xe0b0('0x6e')][_0xe0b0('0x6f')]({'raw':!![]});}return null;})[_0xe0b0('0x25')](function(_0x434dfa){if(_0x434dfa){_0x4e1fb1=_[_0xe0b0('0x70')](_0x434dfa,'id');var _0xf76449;var _0x48497e=squel[_0xe0b0('0x71')]();_0x48497e[_0xe0b0('0x8a')](_0x5c45ae[_0xe0b0('0x72')]);for(var _0x4e19f4=0x0;_0x4e19f4<_0x56c4b9[_0xe0b0('0x6c')];_0x4e19f4+=0x1){_0xf76449=_0x56c4b9[_0x4e19f4]['MetricId']?_0x4e1fb1[_0x56c4b9[_0x4e19f4][_0xe0b0('0x8b')]][_0xe0b0('0x8c')]:_0x56c4b9[_0x4e19f4]['field'];_0xf76449=_0x56c4b9[_0x4e19f4][_0xe0b0('0x73')]?_['replace'](_0x380b4c[_0x56c4b9[_0x4e19f4]['function']],'%s',_0xf76449):_0xf76449;_0xf76449=_0x56c4b9[_0x4e19f4][_0xe0b0('0x74')]?_['replace'](_0x4377f7[_0x56c4b9[_0x4e19f4]['format']],'%s',_0xf76449):_0xf76449;if(_0x56c4b9[_0x4e19f4][_0xe0b0('0x75')]){_0x48497e[_0xe0b0('0x76')](_0xf76449);}_0x56c4b9[_0x4e19f4][_0xe0b0('0x77')]&&_0x48497e[_0xe0b0('0x3a')](_0xf76449,_0x56c4b9[_0x4e19f4][_0xe0b0('0x77')]===_0xe0b0('0x78')?![]:!![]);_0x48497e['field'](_0xf76449,_0x56c4b9[_0x4e19f4][_0xe0b0('0x8d')]||_0xf76449);}if(_0x5c45ae[_0xe0b0('0x79')]){_0x5c45ae[_0xe0b0('0x79')]=JSON['parse'](_0x5c45ae[_0xe0b0('0x79')]);for(var _0x447641=0x0;_0x447641<_0x5c45ae['joins']['length'];_0x447641+=0x1){if(_0x5c45ae[_0xe0b0('0x79')][_0x447641]['type']&&_[_0xe0b0('0x61')](_0x3c09af,_0x5c45ae[_0xe0b0('0x79')][_0x447641][_0xe0b0('0x2e')])&&_0x5c45ae[_0xe0b0('0x79')][_0x447641][_0xe0b0('0x7b')]&&_0x5c45ae[_0xe0b0('0x79')][_0x447641][_0xe0b0('0x7c')]&&_0x5c45ae['joins'][_0x447641][_0xe0b0('0x8e')]){_0x48497e[_0x5c45ae[_0xe0b0('0x79')][_0x447641][_0xe0b0('0x2e')]](_0x5c45ae[_0xe0b0('0x79')][_0x447641][_0xe0b0('0x7c')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x5c45ae[_0xe0b0('0x72')],_0x5c45ae[_0xe0b0('0x79')][_0x447641][_0xe0b0('0x7b')],_0x5c45ae[_0xe0b0('0x79')][_0x447641][_0xe0b0('0x7c')],_0x5c45ae[_0xe0b0('0x79')][_0x447641][_0xe0b0('0x8e')]));}}}if(_0x5c45ae[_0xe0b0('0x7e')]){_0x5c45ae[_0xe0b0('0x7e')]=JSON[_0xe0b0('0x7a')](_0x5c45ae['conditions']);_0x48497e[_0xe0b0('0x3c')](_0x589c47(_0x5c45ae[_0xe0b0('0x7e')][_0xe0b0('0x76')]));}_0x266835=_0x48497e[_0xe0b0('0x7f')]();_0x48497e['limit'](_0x567e1a);_0x48497e[_0xe0b0('0x39')](0x0);return;}})[_0xe0b0('0x25')](function(){if(_0x55aef7[_0xe0b0('0x8f')]===_0xe0b0('0x90')){return null;}var _0x476763=_['merge'](_0x55aef7,{'name':_0x55aef7[_0xe0b0('0x91')]||_0x55aef7['name']||_0x5c45ae[_0xe0b0('0x28')],'basename':_0x5c258b,'savename':util[_0xe0b0('0x74')](_0xe0b0('0x92'),_0x55aef7[_0xe0b0('0x28')]||_0x5c45ae[_0xe0b0('0x28')],require('randomstring')['generate'](0x4),_0x55aef7[_0xe0b0('0x8f')]||'csv'),'reportId':_0x5c45ae['id'],'reportType':_0xe0b0('0x93')});return db['AnalyticExtractedReport'][_0xe0b0('0x46')](_0x476763,{'raw':!![]});})[_0xe0b0('0x25')](function(_0x205c53){if(_0x5c45ae[_0xe0b0('0x72')]===_0xe0b0('0x94')){_0x266835[_0xe0b0('0x3c')](_0x5c45ae[_0xe0b0('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x55aef7['startDate'],_0x55aef7[_0xe0b0('0x95')]);}else{_0x266835[_0xe0b0('0x3c')](_0x5c45ae[_0xe0b0('0x72')]+_0xe0b0('0x96'),_0x55aef7[_0xe0b0('0x97')],_0x55aef7[_0xe0b0('0x95')]);}if(_0x205c53){logger[_0xe0b0('0x98')](_0xe0b0('0x99'),_0x266835[_0xe0b0('0x81')]());require(_0xe0b0('0x9a'))['fork'](path['join'](__dirname,_0xe0b0('0x9b'),_0x205c53[_0xe0b0('0x8f')]),[_0x205c53['id'],_0x266835[_0xe0b0('0x81')](),path[_0xe0b0('0x51')](__dirname,_0xe0b0('0x9c'),_0x205c53[_0xe0b0('0x9d')]),_0x5c258b]);return _0x205c53;}else{var _0x33b67a=squel['select']();_0x33b67a['from']('('+_0x266835[_0xe0b0('0x81')]()+')',_0xe0b0('0x9e'));_0x33b67a[_0xe0b0('0x67')](_0xe0b0('0x9f'),_0xe0b0('0x1e'));_0x266835[_0xe0b0('0x1d')](_0x55aef7[_0xe0b0('0x1d')]||_0x567e1a);_0x266835[_0xe0b0('0x39')](_0x55aef7[_0xe0b0('0x39')]||0x0);return dbH[_0xe0b0('0x82')]['query'](_0x33b67a[_0xe0b0('0x81')](),{'type':dbH[_0xe0b0('0x82')]['QueryTypes'][_0xe0b0('0x84')]})[_0xe0b0('0x25')](function(_0x3615f9){if(!_0x3615f9[_0xe0b0('0x6c')]){_0x22029a=0x0;}else{_0x22029a=_0x3615f9[0x0][_0xe0b0('0x1e')]||0x0;}return dbH['sequelize'][_0xe0b0('0x31')](_0x266835[_0xe0b0('0x81')](),{'type':dbH[_0xe0b0('0x82')][_0xe0b0('0x83')][_0xe0b0('0x84')]});})['then'](function(_0x475404){return{'rows':_0x475404||[],'count':_0x22029a};});}});}exports['run']=function(_0x44e05a,_0x42dfa9){return runReport(_0x44e05a[_0xe0b0('0x4f')],_0x44e05a['query'],_0x44e05a['options'])[_0xe0b0('0x25')](respondWithResult(_0x42dfa9,null))[_0xe0b0('0x42')](handleError(_0x42dfa9,null));};exports[_0xe0b0('0xa0')]=runReport;exports['query']=function(_0x4d372a,_0x5da5eb){var _0x5175e1=0xa;var _0x57694c=['join',_0xe0b0('0x52'),_0xe0b0('0x53'),'cross_join'];var _0x121257={'SUM':_0xe0b0('0x55'),'COUNT':_0xe0b0('0x56'),'COUNT DISTINCT':_0xe0b0('0x57'),'MAX':_0xe0b0('0x58'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xe0b0('0x85'),'GROUP_CONCAT ASC':_0xe0b0('0x5b'),'GROUP_CONCAT DESC':_0xe0b0('0x5c')};var _0x52dfd8={'SEC_TO_TIME':_0xe0b0('0x5d'),'DATE':_0xe0b0('0x5e'),'HOUR':_0xe0b0('0x5f'),'ROUND':_0xe0b0('0x60'),'UNIX_TIMESTAMP':_0xe0b0('0x86')};var _0x1b8d4a=function(_0x51b616){return!_['includes'](['IS\x20NULL',_0xe0b0('0x87'),_0xe0b0('0x63'),_0xe0b0('0x64')],_0x51b616);};var _0x40809f=function(_0x266cb5){if(!_0x266cb5||!_0x266cb5[_0xe0b0('0x65')][_0xe0b0('0x6c')]){return'';}for(var _0x35f081='(',_0x5e4339=0x0;_0x5e4339<_0x266cb5['rules'][_0xe0b0('0x6c')];_0x5e4339+=0x1){_0x5e4339>0x0&&(_0x35f081+='\x20'+_0x266cb5[_0xe0b0('0x66')]+'\x20');_0x35f081+=_0x266cb5[_0xe0b0('0x65')][_0x5e4339]['group']?_0x40809f(_0x266cb5[_0xe0b0('0x65')][_0x5e4339][_0xe0b0('0x76')]):_0x266cb5[_0xe0b0('0x65')][_0x5e4339]['field']+'\x20'+_0x266cb5[_0xe0b0('0x65')][_0x5e4339]['condition']+(_0x1b8d4a(_0x266cb5[_0xe0b0('0x65')][_0x5e4339][_0xe0b0('0x68')])?'\x20'+_0x266cb5[_0xe0b0('0x65')][_0x5e4339][_0xe0b0('0x69')]:'');}return _0x35f081+')';};var _0x3b133a={'where':{'id':_0x4d372a['params']['id']}},_0x26df60,_0x12e46f,_0x55beb2,_0x287af5,_0xb71713;_0x3b133a=_[_0xe0b0('0x3e')]({},_0x3b133a,_0x4d372a[_0xe0b0('0x6a')]);return db[_0xe0b0('0x2b')]['find'](_0x3b133a)[_0xe0b0('0x25')](function(_0x692a95){if(_0x692a95){_0x26df60=_0x692a95;return _0x692a95[_0xe0b0('0x6b')]();}return null;})['then'](function(_0xed8461){if(_0xed8461){if(!_0xed8461[_0xe0b0('0x6c')]){throw new db[(_0xe0b0('0x6d'))][(_0xe0b0('0x88'))](_0xe0b0('0x89'),0x193);}_0x12e46f=_0xed8461;return db[_0xe0b0('0x6e')]['findAll']({'raw':!![]});}return null;})[_0xe0b0('0x25')](function(_0x701ba){if(_0x701ba){_0x55beb2=_[_0xe0b0('0x70')](_0x701ba,'id');var _0x26315d;var _0x11452e=squel[_0xe0b0('0x71')]();_0x11452e[_0xe0b0('0x8a')](_0x26df60[_0xe0b0('0x72')]);for(var _0xf87779=0x0;_0xf87779<_0x12e46f[_0xe0b0('0x6c')];_0xf87779+=0x1){_0x26315d=_0x12e46f[_0xf87779][_0xe0b0('0x8b')]?_0x55beb2[_0x12e46f[_0xf87779]['MetricId']][_0xe0b0('0x8c')]:_0x12e46f[_0xf87779]['field'];_0x26315d=_0x12e46f[_0xf87779]['function']?_[_0xe0b0('0xa1')](_0x121257[_0x12e46f[_0xf87779][_0xe0b0('0x73')]],'%s',_0x26315d):_0x26315d;_0x26315d=_0x12e46f[_0xf87779]['format']?_[_0xe0b0('0xa1')](_0x52dfd8[_0x12e46f[_0xf87779][_0xe0b0('0x74')]],'%s',_0x26315d):_0x26315d;if(_0x12e46f[_0xf87779][_0xe0b0('0x75')]){_0x11452e[_0xe0b0('0x76')](_0x26315d);}_0x12e46f[_0xf87779][_0xe0b0('0x77')]&&_0x11452e[_0xe0b0('0x3a')](_0x26315d,_0x12e46f[_0xf87779][_0xe0b0('0x77')]===_0xe0b0('0x78')?![]:!![]);_0x11452e[_0xe0b0('0x67')](_0x26315d,_0x12e46f[_0xf87779]['alias']||_0x26315d);}if(_0x26df60[_0xe0b0('0x79')]){_0x26df60[_0xe0b0('0x79')]=JSON[_0xe0b0('0x7a')](_0x26df60[_0xe0b0('0x79')]);for(var _0x48c009=0x0;_0x48c009<_0x26df60['joins'][_0xe0b0('0x6c')];_0x48c009+=0x1){if(_0x26df60[_0xe0b0('0x79')][_0x48c009][_0xe0b0('0x2e')]&&_[_0xe0b0('0x61')](_0x57694c,_0x26df60[_0xe0b0('0x79')][_0x48c009][_0xe0b0('0x2e')])&&_0x26df60[_0xe0b0('0x79')][_0x48c009][_0xe0b0('0x7b')]&&_0x26df60[_0xe0b0('0x79')][_0x48c009][_0xe0b0('0x7c')]&&_0x26df60[_0xe0b0('0x79')][_0x48c009][_0xe0b0('0x8e')]){_0x11452e[_0x26df60[_0xe0b0('0x79')][_0x48c009][_0xe0b0('0x2e')]](_0x26df60[_0xe0b0('0x79')][_0x48c009][_0xe0b0('0x7c')],null,util[_0xe0b0('0x74')](_0xe0b0('0x7d'),_0x26df60[_0xe0b0('0x72')],_0x26df60['joins'][_0x48c009][_0xe0b0('0x7b')],_0x26df60[_0xe0b0('0x79')][_0x48c009][_0xe0b0('0x7c')],_0x26df60['joins'][_0x48c009][_0xe0b0('0x8e')]));}}}if(_0x26df60[_0xe0b0('0x7e')]){_0x26df60[_0xe0b0('0x7e')]=JSON[_0xe0b0('0x7a')](_0x26df60[_0xe0b0('0x7e')]);_0x11452e[_0xe0b0('0x3c')](_0x40809f(_0x26df60[_0xe0b0('0x7e')]['group']));}_0xb71713=_0x11452e[_0xe0b0('0x7f')]();_0x11452e['limit'](_0x5175e1);_0x11452e[_0xe0b0('0x39')](0x0);logger['debug'](_0xe0b0('0xa2'),_0x11452e[_0xe0b0('0x81')]());return dbH['sequelize'][_0xe0b0('0x31')](_0x11452e['toString'](),{'type':dbH[_0xe0b0('0x82')][_0xe0b0('0x83')][_0xe0b0('0x84')]});}})[_0xe0b0('0x25')](function(){return{'sql':_0xb71713[_0xe0b0('0x81')]()};})[_0xe0b0('0x25')](respondWithResult(_0x5da5eb,null))[_0xe0b0('0x42')](handleError(_0x5da5eb,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index ecdb175..9948f19 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.model.js +++ b/server/api/analyticCustomReport/analyticCustomReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e88=['moment','bluebird','request-promise','path','../../config/environment','define','AnalyticCustomReport','analytics_custom_reports'];(function(_0x5c0fd4,_0x20b566){var _0x4a5472=function(_0x55bdd0){while(--_0x55bdd0){_0x5c0fd4['push'](_0x5c0fd4['shift']());}};_0x4a5472(++_0x20b566);}(_0x0e88,0x68));var _0x80e8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0e88[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x80e8('0x0'));var BPromise=require(_0x80e8('0x1'));var rp=require(_0x80e8('0x2'));var fs=require('fs');var path=require(_0x80e8('0x3'));var rimraf=require('rimraf');var config=require(_0x80e8('0x4'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x396e5d,_0x36aa04){return _0x396e5d[_0x80e8('0x5')](_0x80e8('0x6'),attributes,{'tableName':_0x80e8('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3398=['bluebird','path','./analyticCustomReport.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x3398,0xcd));var _0x8339=function(_0xb49d07,_0x3a7261){_0xb49d07=_0xb49d07-0x0;var _0x1da626=_0x3398[_0xb49d07];return _0x1da626;};'use strict';var _=require(_0x8339('0x0'));var util=require(_0x8339('0x1'));var logger=require(_0x8339('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8339('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8339('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8339('0x5'));module[_0x8339('0x6')]=function(_0x11439e,_0x2390a9){return _0x11439e[_0x8339('0x7')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 4034651..1ddec65 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.rpc.js +++ b/server/api/analyticCustomReport/analyticCustomReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa52=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x1893ad,_0x25c0ec){var _0x2b0d88=function(_0x169439){while(--_0x169439){_0x1893ad['push'](_0x1893ad['shift']());}};_0x2b0d88(++_0x25c0ec);}(_0xfa52,0x8b));var _0x2fa5=function(_0x47e91f,_0x33abea){_0x47e91f=_0x47e91f-0x0;var _0x4629c4=_0xfa52[_0x47e91f];return _0x4629c4;};'use strict';var _=require(_0x2fa5('0x0'));var util=require('util');var moment=require(_0x2fa5('0x1'));var BPromise=require(_0x2fa5('0x2'));var rs=require(_0x2fa5('0x3'));var fs=require('fs');var Redis=require(_0x2fa5('0x4'));var db=require(_0x2fa5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2fa5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2fa5('0x7'));var client=jayson[_0x2fa5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ce759,_0x4109f8,_0x5a959a){return new BPromise(function(_0x47d468,_0x3951db){return client[_0x2fa5('0x9')](_0x5ce759,_0x5a959a)[_0x2fa5('0xa')](function(_0x15ea69){logger[_0x2fa5('0xb')](_0x2fa5('0xc'),_0x4109f8,_0x2fa5('0xd'));logger[_0x2fa5('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x4109f8,_0x2fa5('0xd'),JSON[_0x2fa5('0xf')](_0x15ea69));if(_0x15ea69[_0x2fa5('0x10')]){if(_0x15ea69[_0x2fa5('0x10')]['code']===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4109f8,_0x15ea69[_0x2fa5('0x10')][_0x2fa5('0x11')]);return _0x3951db(_0x15ea69[_0x2fa5('0x10')][_0x2fa5('0x11')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4109f8,_0x15ea69['error']['message']);return _0x47d468(_0x15ea69['error'][_0x2fa5('0x11')]);}else{logger[_0x2fa5('0xb')](_0x2fa5('0xc'),_0x4109f8,'request\x20sent');_0x47d468(_0x15ea69[_0x2fa5('0x12')][_0x2fa5('0x11')]);}})[_0x2fa5('0x13')](function(_0x41de26){logger[_0x2fa5('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4109f8,_0x41de26);_0x3951db(_0x41de26);});});} \ No newline at end of file +var _0x1e67=['info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x2fa282,_0x41e98b){var _0x464dbf=function(_0x550205){while(--_0x550205){_0x2fa282['push'](_0x2fa282['shift']());}};_0x464dbf(++_0x41e98b);}(_0x1e67,0x1b4));var _0x71e6=function(_0x25c27c,_0xd78847){_0x25c27c=_0x25c27c-0x0;var _0x5a4bab=_0x1e67[_0x25c27c];return _0x5a4bab;};'use strict';var _=require(_0x71e6('0x0'));var util=require(_0x71e6('0x1'));var moment=require(_0x71e6('0x2'));var BPromise=require(_0x71e6('0x3'));var rs=require(_0x71e6('0x4'));var fs=require('fs');var Redis=require(_0x71e6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x71e6('0x6'));var logger=require(_0x71e6('0x7'))(_0x71e6('0x8'));var config=require('../../config/environment');var jayson=require(_0x71e6('0x9'));var client=jayson[_0x71e6('0xa')][_0x71e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43d7b2,_0x13ad8e,_0x4c8348){return new BPromise(function(_0x31cce7,_0x4c453b){return client[_0x71e6('0xc')](_0x43d7b2,_0x4c8348)[_0x71e6('0xd')](function(_0x4e3488){logger[_0x71e6('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x13ad8e,_0x71e6('0xf'));logger[_0x71e6('0x10')](_0x71e6('0x11'),_0x13ad8e,_0x71e6('0xf'),JSON[_0x71e6('0x12')](_0x4e3488));if(_0x4e3488[_0x71e6('0x13')]){if(_0x4e3488[_0x71e6('0x13')][_0x71e6('0x14')]===0x1f4){logger[_0x71e6('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x13ad8e,_0x4e3488[_0x71e6('0x13')]['message']);return _0x4c453b(_0x4e3488['error'][_0x71e6('0x15')]);}logger[_0x71e6('0x13')](_0x71e6('0x16'),_0x13ad8e,_0x4e3488[_0x71e6('0x13')][_0x71e6('0x15')]);return _0x31cce7(_0x4e3488[_0x71e6('0x13')][_0x71e6('0x15')]);}else{logger['info'](_0x71e6('0x16'),_0x13ad8e,_0x71e6('0xf'));_0x31cce7(_0x4e3488[_0x71e6('0x17')]['message']);}})[_0x71e6('0x18')](function(_0x36569e){logger[_0x71e6('0x13')](_0x71e6('0x16'),_0x13ad8e,_0x36569e);_0x4c453b(_0x36569e);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index a574ca4..7c5849b 100644 --- a/server/api/analyticCustomReport/index.js +++ b/server/api/analyticCustomReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57f6=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/query','query','create','put','update','destroy'];(function(_0x1b91bf,_0x42f146){var _0x2aa4d=function(_0x377459){while(--_0x377459){_0x1b91bf['push'](_0x1b91bf['shift']());}};_0x2aa4d(++_0x42f146);}(_0x57f6,0xd2));var _0x657f=function(_0x403c57,_0x280a51){_0x403c57=_0x403c57-0x0;var _0x35fa69=_0x57f6[_0x403c57];return _0x35fa69;};'use strict';var multer=require(_0x657f('0x0'));var util=require('util');var path=require(_0x657f('0x1'));var timeout=require(_0x657f('0x2'));var express=require('express');var router=express[_0x657f('0x3')]();var fs_extra=require(_0x657f('0x4'));var auth=require(_0x657f('0x5'));var interaction=require(_0x657f('0x6'));var config=require('../../config/environment');var controller=require(_0x657f('0x7'));router[_0x657f('0x8')]('/',auth[_0x657f('0x9')](),controller[_0x657f('0xa')]);router[_0x657f('0x8')](_0x657f('0xb'),auth['isAuthenticated'](),controller[_0x657f('0xc')]);router[_0x657f('0x8')](_0x657f('0xd'),auth[_0x657f('0x9')](),controller[_0x657f('0xe')]);router['get']('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0x657f('0x8')](_0x657f('0xf'),auth['isAuthenticated'](),controller[_0x657f('0x10')]);router['post']('/',auth[_0x657f('0x9')](),controller[_0x657f('0x11')]);router[_0x657f('0x12')](_0x657f('0xb'),auth[_0x657f('0x9')](),controller[_0x657f('0x13')]);router['delete'](_0x657f('0xb'),auth[_0x657f('0x9')](),controller[_0x657f('0x14')]);module['exports']=router; \ No newline at end of file +var _0x33d4=['./analyticCustomReport.controller','get','isAuthenticated','preview','/:id/run','run','query','post','create','put','/:id','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3b7f3c,_0x14bbc0){var _0x198ca7=function(_0x37973c){while(--_0x37973c){_0x3b7f3c['push'](_0x3b7f3c['shift']());}};_0x198ca7(++_0x14bbc0);}(_0x33d4,0x8a));var _0x433d=function(_0xe22099,_0x891a1a){_0xe22099=_0xe22099-0x0;var _0x5cc174=_0x33d4[_0xe22099];return _0x5cc174;};'use strict';var multer=require(_0x433d('0x0'));var util=require('util');var path=require(_0x433d('0x1'));var timeout=require(_0x433d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x433d('0x3'));var auth=require(_0x433d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x433d('0x5'));var controller=require(_0x433d('0x6'));router[_0x433d('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x433d('0x7')]('/:id',auth[_0x433d('0x8')](),controller['show']);router[_0x433d('0x7')]('/:id/preview',auth[_0x433d('0x8')](),controller[_0x433d('0x9')]);router[_0x433d('0x7')](_0x433d('0xa'),auth[_0x433d('0x8')](),controller[_0x433d('0xb')]);router[_0x433d('0x7')]('/:id/query',auth['isAuthenticated'](),controller[_0x433d('0xc')]);router[_0x433d('0xd')]('/',auth['isAuthenticated'](),controller[_0x433d('0xe')]);router[_0x433d('0xf')]('/:id',auth[_0x433d('0x8')](),controller['update']);router['delete'](_0x433d('0x10'),auth[_0x433d('0x8')](),controller['destroy']);module[_0x433d('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 5c3b4ac..511ff34 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['STRING','TEXT','sequelize','exports'];(function(_0x43ad57,_0x463504){var _0x38c75f=function(_0x4c0185){while(--_0x4c0185){_0x43ad57['push'](_0x43ad57['shift']());}};_0x38c75f(++_0x463504);}(_0xf494,0x1c6));var _0x4f49=function(_0x596f57,_0x50c74e){_0x596f57=_0x596f57-0x0;var _0x5c8281=_0xf494[_0x596f57];return _0x5c8281;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4f49('0x2')]},'table':{'type':Sequelize[_0x4f49('0x2')]},'conditions':{'type':Sequelize[_0x4f49('0x3')]},'joins':{'type':Sequelize[_0x4f49('0x3')]}}; \ No newline at end of file +var _0x5496=['TEXT','sequelize','exports','STRING'];(function(_0x477949,_0x375636){var _0x3a61ac=function(_0x3d6a07){while(--_0x3d6a07){_0x477949['push'](_0x477949['shift']());}};_0x3a61ac(++_0x375636);}(_0x5496,0x175));var _0x6549=function(_0x55390b,_0x2fa8db){_0x55390b=_0x55390b-0x0;var _0x51c8a3=_0x5496[_0x55390b];return _0x51c8a3;};'use strict';var Sequelize=require(_0x6549('0x0'));module[_0x6549('0x1')]={'name':{'type':Sequelize[_0x6549('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6549('0x2')]},'parent':{'type':Sequelize[_0x6549('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x6549('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index a257516..f9584c4 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x2c4440,_0x4fe366){var _0x20f1dd=function(_0x7495a5){while(--_0x7495a5){_0x2c4440['push'](_0x2c4440['shift']());}};_0x20f1dd(++_0x4fe366);}(_0x7a54,0x106));var _0x47a5=function(_0xfd9b03,_0x65a386){_0xfd9b03=_0xfd9b03-0x0;var _0x3dc2c1=_0x7a54[_0xfd9b03];return _0x3dc2c1;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));}; \ No newline at end of file +var _0x687b=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x687b,0x14a));var _0xb687=function(_0x149b25,_0x2bb415){_0x149b25=_0x149b25-0x0;var _0x40b742=_0x687b[_0x149b25];return _0x40b742;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 095160d..77cc9fb 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.model.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0810=['./analyticDefaultReport.attributes','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x331a73,_0x5a5941){var _0x267f02=function(_0x2c74f6){while(--_0x2c74f6){_0x331a73['push'](_0x331a73['shift']());}};_0x267f02(++_0x5a5941);}(_0x0810,0x66));var _0x0081=function(_0x4f30c0,_0x56511a){_0x4f30c0=_0x4f30c0-0x0;var _0x43a9bd=_0x0810[_0x4f30c0];return _0x43a9bd;};'use strict';var _=require(_0x0081('0x0'));var util=require(_0x0081('0x1'));var logger=require(_0x0081('0x2'))(_0x0081('0x3'));var moment=require(_0x0081('0x4'));var BPromise=require('bluebird');var rp=require(_0x0081('0x5'));var fs=require('fs');var path=require(_0x0081('0x6'));var rimraf=require('rimraf');var config=require(_0x0081('0x7'));var attributes=require(_0x0081('0x8'));module['exports']=function(_0x1d8f57,_0x10c050){return _0x1d8f57['define'](_0x0081('0x9'),attributes,{'tableName':_0x0081('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb980=['AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define'];(function(_0x1607ee,_0x50aa37){var _0x3fad5b=function(_0x16c8ca){while(--_0x16c8ca){_0x1607ee['push'](_0x1607ee['shift']());}};_0x3fad5b(++_0x50aa37);}(_0xb980,0xbd));var _0x0b98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb980[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x0b98('0x0'));var logger=require(_0x0b98('0x1'))(_0x0b98('0x2'));var moment=require(_0x0b98('0x3'));var BPromise=require(_0x0b98('0x4'));var rp=require(_0x0b98('0x5'));var fs=require('fs');var path=require(_0x0b98('0x6'));var rimraf=require(_0x0b98('0x7'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x3267d9,_0x445a1c){return _0x3267d9[_0x0b98('0x8')](_0x0b98('0x9'),attributes,{'tableName':_0x0b98('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index eb6f43b..f9cd126 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ca=['catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x32b292,_0x100e5e){var _0x490f77=function(_0x41da58){while(--_0x41da58){_0x32b292['push'](_0x32b292['shift']());}};_0x490f77(++_0x100e5e);}(_0x54ca,0x85));var _0xa54c=function(_0x81e39d,_0x4c3934){_0x81e39d=_0x81e39d-0x0;var _0x548fbb=_0x54ca[_0x81e39d];return _0x548fbb;};'use strict';var _=require('lodash');var util=require(_0xa54c('0x0'));var moment=require(_0xa54c('0x1'));var BPromise=require(_0xa54c('0x2'));var rs=require(_0xa54c('0x3'));var fs=require('fs');var Redis=require(_0xa54c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa54c('0x5'));var logger=require(_0xa54c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa54c('0x7'));var client=jayson[_0xa54c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9a37b1,_0x26afb7,_0x432c23){return new BPromise(function(_0x8a2a4b,_0x1a9f30){return client[_0xa54c('0x9')](_0x9a37b1,_0x432c23)[_0xa54c('0xa')](function(_0x3f645b){logger[_0xa54c('0xb')](_0xa54c('0xc'),_0x26afb7,_0xa54c('0xd'));logger[_0xa54c('0xe')](_0xa54c('0xf'),_0x26afb7,_0xa54c('0xd'),JSON[_0xa54c('0x10')](_0x3f645b));if(_0x3f645b[_0xa54c('0x11')]){if(_0x3f645b['error'][_0xa54c('0x12')]===0x1f4){logger[_0xa54c('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x26afb7,_0x3f645b[_0xa54c('0x11')][_0xa54c('0x13')]);return _0x1a9f30(_0x3f645b[_0xa54c('0x11')]['message']);}logger[_0xa54c('0x11')](_0xa54c('0xc'),_0x26afb7,_0x3f645b[_0xa54c('0x11')][_0xa54c('0x13')]);return _0x8a2a4b(_0x3f645b[_0xa54c('0x11')][_0xa54c('0x13')]);}else{logger[_0xa54c('0xb')](_0xa54c('0xc'),_0x26afb7,_0xa54c('0xd'));_0x8a2a4b(_0x3f645b[_0xa54c('0x14')][_0xa54c('0x13')]);}})[_0xa54c('0x15')](function(_0x58b864){logger[_0xa54c('0x11')](_0xa54c('0xc'),_0x26afb7,_0x58b864);_0x1a9f30(_0x58b864);});});} \ No newline at end of file +var _0xeead=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x44454f,_0x4bfbe8){var _0x475150=function(_0x1cde13){while(--_0x1cde13){_0x44454f['push'](_0x44454f['shift']());}};_0x475150(++_0x4bfbe8);}(_0xeead,0x1ad));var _0xdeea=function(_0x18dbf5,_0x505113){_0x18dbf5=_0x18dbf5-0x0;var _0x10ba5c=_0xeead[_0x18dbf5];return _0x10ba5c;};'use strict';var _=require(_0xdeea('0x0'));var util=require(_0xdeea('0x1'));var moment=require(_0xdeea('0x2'));var BPromise=require('bluebird');var rs=require(_0xdeea('0x3'));var fs=require('fs');var Redis=require(_0xdeea('0x4'));var db=require(_0xdeea('0x5'))['db'];var utils=require(_0xdeea('0x6'));var logger=require(_0xdeea('0x7'))(_0xdeea('0x8'));var config=require(_0xdeea('0x9'));var jayson=require(_0xdeea('0xa'));var client=jayson['client'][_0xdeea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x180b29,_0x160988,_0x52d39d){return new BPromise(function(_0x25e06f,_0x2f0ed7){return client['request'](_0x180b29,_0x52d39d)[_0xdeea('0xc')](function(_0x4449df){logger[_0xdeea('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x160988,_0xdeea('0xe'));logger[_0xdeea('0xf')](_0xdeea('0x10'),_0x160988,'request\x20sent',JSON[_0xdeea('0x11')](_0x4449df));if(_0x4449df[_0xdeea('0x12')]){if(_0x4449df[_0xdeea('0x12')][_0xdeea('0x13')]===0x1f4){logger[_0xdeea('0x12')](_0xdeea('0x14'),_0x160988,_0x4449df[_0xdeea('0x12')]['message']);return _0x2f0ed7(_0x4449df[_0xdeea('0x12')][_0xdeea('0x15')]);}logger[_0xdeea('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x160988,_0x4449df[_0xdeea('0x12')]['message']);return _0x25e06f(_0x4449df[_0xdeea('0x12')][_0xdeea('0x15')]);}else{logger[_0xdeea('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x160988,_0xdeea('0xe'));_0x25e06f(_0x4449df[_0xdeea('0x16')][_0xdeea('0x15')]);}})[_0xdeea('0x17')](function(_0x1b3a14){logger[_0xdeea('0x12')](_0xdeea('0x14'),_0x160988,_0x1b3a14);_0x2f0ed7(_0x1b3a14);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index f87ad52..a702d7a 100644 --- a/server/api/analyticDefaultReport/index.js +++ b/server/api/analyticDefaultReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0165=['destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','preview','/:id/run','run','/:id/query','query','post','create','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0165,0x1e4));var _0x5016=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0165[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x5016('0x0'));var util=require(_0x5016('0x1'));var path=require(_0x5016('0x2'));var timeout=require(_0x5016('0x3'));var express=require(_0x5016('0x4'));var router=express[_0x5016('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5016('0x6'));var interaction=require(_0x5016('0x7'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x5016('0x8')]('/',auth['isAuthenticated'](),controller[_0x5016('0x9')]);router[_0x5016('0x8')](_0x5016('0xa'),auth[_0x5016('0xb')](),controller[_0x5016('0xc')]);router[_0x5016('0x8')]('/:id/preview',auth['isAuthenticated'](),controller[_0x5016('0xd')]);router[_0x5016('0x8')](_0x5016('0xe'),auth[_0x5016('0xb')](),controller[_0x5016('0xf')]);router[_0x5016('0x8')](_0x5016('0x10'),auth[_0x5016('0xb')](),controller[_0x5016('0x11')]);router[_0x5016('0x12')]('/',auth[_0x5016('0xb')](),controller[_0x5016('0x13')]);router['put'](_0x5016('0xa'),auth[_0x5016('0xb')](),controller[_0x5016('0x14')]);router[_0x5016('0x15')](_0x5016('0xa'),auth[_0x5016('0xb')](),controller[_0x5016('0x16')]);module['exports']=router; \ No newline at end of file +var _0x6ec2=['post','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','isAuthenticated','show','/:id/run','run','/:id/query','query'];(function(_0x5e4317,_0x4b3aee){var _0x347842=function(_0x210d52){while(--_0x210d52){_0x5e4317['push'](_0x5e4317['shift']());}};_0x347842(++_0x4b3aee);}(_0x6ec2,0x78));var _0x26ec=function(_0x46ece1,_0x1965a8){_0x46ece1=_0x46ece1-0x0;var _0xcf0d7=_0x6ec2[_0x46ece1];return _0xcf0d7;};'use strict';var multer=require(_0x26ec('0x0'));var util=require(_0x26ec('0x1'));var path=require(_0x26ec('0x2'));var timeout=require(_0x26ec('0x3'));var express=require(_0x26ec('0x4'));var router=express[_0x26ec('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x26ec('0x6'));var interaction=require(_0x26ec('0x7'));var config=require(_0x26ec('0x8'));var controller=require(_0x26ec('0x9'));router[_0x26ec('0xa')]('/',auth['isAuthenticated'](),controller[_0x26ec('0xb')]);router['get']('/:id',auth[_0x26ec('0xc')](),controller[_0x26ec('0xd')]);router[_0x26ec('0xa')]('/:id/preview',auth[_0x26ec('0xc')](),controller['preview']);router[_0x26ec('0xa')](_0x26ec('0xe'),auth[_0x26ec('0xc')](),controller[_0x26ec('0xf')]);router[_0x26ec('0xa')](_0x26ec('0x10'),auth[_0x26ec('0xc')](),controller[_0x26ec('0x11')]);router[_0x26ec('0x12')]('/',auth[_0x26ec('0xc')](),controller['create']);router['put'](_0x26ec('0x13'),auth[_0x26ec('0xc')](),controller[_0x26ec('0x14')]);router[_0x26ec('0x15')](_0x26ec('0x13'),auth[_0x26ec('0xc')](),controller[_0x26ec('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 5147963..398e9d2 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa13a=['exports','STRING','ENUM','csv','pdf','DATE','Loading','scheduled','INTEGER','UNSIGNED','sequelize','moment'];(function(_0x3dec4c,_0x5ec722){var _0xbf2fd=function(_0x7052ff){while(--_0x7052ff){_0x3dec4c['push'](_0x3dec4c['shift']());}};_0xbf2fd(++_0x5ec722);}(_0xa13a,0x1ba));var _0xaa13=function(_0x2bcb1b,_0x73b2d6){_0x2bcb1b=_0x2bcb1b-0x0;var _0x2a7bb4=_0xa13a[_0x2bcb1b];return _0x2a7bb4;};'use strict';var Sequelize=require(_0xaa13('0x0'));var moment=require(_0xaa13('0x1'));module[_0xaa13('0x2')]={'name':{'type':Sequelize[_0xaa13('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xaa13('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xaa13('0x4')](_0xaa13('0x5'),_0xaa13('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0xaa13('0x5')},'savename':{'type':Sequelize[_0xaa13('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xaa13('0x7')]},'endDate':{'type':Sequelize[_0xaa13('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xaa13('0x8')},'type':{'type':Sequelize[_0xaa13('0x4')]('manual',_0xaa13('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xaa13('0xa')](0xb)[_0xaa13('0xb')]},'reportType':{'type':Sequelize[_0xaa13('0x3')]}}; \ No newline at end of file +var _0x47c9=['scheduled','INTEGER','sequelize','moment','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual'];(function(_0x453bc4,_0x1a31a0){var _0x55476c=function(_0x52e2b3){while(--_0x52e2b3){_0x453bc4['push'](_0x453bc4['shift']());}};_0x55476c(++_0x1a31a0);}(_0x47c9,0xb6));var _0x947c=function(_0x392e0a,_0x55432d){_0x392e0a=_0x392e0a-0x0;var _0x5eb15a=_0x47c9[_0x392e0a];return _0x5eb15a;};'use strict';var Sequelize=require(_0x947c('0x0'));var moment=require(_0x947c('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x947c('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x947c('0x3')](_0x947c('0x4'),_0x947c('0x5'),_0x947c('0x6')),'allowNull':![],'defaultValue':_0x947c('0x4')},'savename':{'type':Sequelize[_0x947c('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x947c('0x7')]},'endDate':{'type':Sequelize[_0x947c('0x7')]},'status':{'type':Sequelize[_0x947c('0x2')],'defaultValue':_0x947c('0x8')},'type':{'type':Sequelize[_0x947c('0x3')](_0x947c('0x9'),_0x947c('0xa')),'allowNull':![],'defaultValue':_0x947c('0x9')},'reportId':{'type':Sequelize[_0x947c('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x947c('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 37824b1..ce77fdb 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0cd2=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','body','download','basename','savename','output','existsSync','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','ExtractedReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','show','params','keys','catch','create','user'];(function(_0xdbd0c8,_0x35da4c){var _0x2f23cf=function(_0x352ecb){while(--_0x352ecb){_0xdbd0c8['push'](_0xdbd0c8['shift']());}};_0x2f23cf(++_0x35da4c);}(_0x0cd2,0x78));var _0x20cd=function(_0x3959fc,_0x32b4f8){_0x3959fc=_0x3959fc-0x0;var _0x4e438e=_0x0cd2[_0x3959fc];return _0x4e438e;};'use strict';var emlformat=require(_0x20cd('0x0'));var rimraf=require(_0x20cd('0x1'));var zipdir=require(_0x20cd('0x2'));var jsonpatch=require(_0x20cd('0x3'));var rp=require(_0x20cd('0x4'));var moment=require(_0x20cd('0x5'));var BPromise=require(_0x20cd('0x6'));var Mustache=require(_0x20cd('0x7'));var util=require('util');var path=require(_0x20cd('0x8'));var sox=require(_0x20cd('0x9'));var csv=require('to-csv');var ejs=require(_0x20cd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x20cd('0xb'));var crypto=require(_0x20cd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x20cd('0xd'));var toCsv=require(_0x20cd('0xe'));var querystring=require(_0x20cd('0xf'));var Papa=require(_0x20cd('0x10'));var Redis=require(_0x20cd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x20cd('0x12'));var as=require(_0x20cd('0x13'));var hardwareService=require(_0x20cd('0x14'));var logger=require(_0x20cd('0x15'))('api');var utils=require(_0x20cd('0x16'));var config=require(_0x20cd('0x17'));var licenseUtil=require(_0x20cd('0x18'));var db=require(_0x20cd('0x19'))['db'];function respondWithStatusCode(_0x236aaa,_0x4e05c1){_0x4e05c1=_0x4e05c1||0xcc;return function(_0x54793d){if(_0x54793d){return _0x236aaa[_0x20cd('0x1a')](_0x4e05c1);}return _0x236aaa[_0x20cd('0x1b')](_0x4e05c1)[_0x20cd('0x1c')]();};}function respondWithResult(_0x4a9c61,_0x648885){_0x648885=_0x648885||0xc8;return function(_0x4017c3){if(_0x4017c3){return _0x4a9c61[_0x20cd('0x1b')](_0x648885)[_0x20cd('0x1d')](_0x4017c3);}};}function respondWithFilteredResult(_0x5eecb8,_0x2eac98){return function(_0x35016d){if(_0x35016d){var _0x3269af=typeof _0x2eac98[_0x20cd('0x1e')]===_0x20cd('0x1f')&&typeof _0x2eac98[_0x20cd('0x20')]===_0x20cd('0x1f');var _0x2bdabf=_0x35016d[_0x20cd('0x21')];var _0x87aafa=_0x3269af?0x0:_0x2eac98[_0x20cd('0x1e')];var _0x50666e=_0x3269af?_0x35016d[_0x20cd('0x21')]:_0x2eac98[_0x20cd('0x1e')]+_0x2eac98[_0x20cd('0x20')];var _0x14d4f1;if(_0x50666e>=_0x2bdabf){_0x50666e=_0x2bdabf;_0x14d4f1=0xc8;}else{_0x14d4f1=0xce;}_0x5eecb8[_0x20cd('0x1b')](_0x14d4f1);return _0x5eecb8[_0x20cd('0x22')](_0x20cd('0x23'),_0x87aafa+'-'+_0x50666e+'/'+_0x2bdabf)[_0x20cd('0x1d')](_0x35016d);}return null;};}function patchUpdates(_0xafa0b7){return function(_0x4db5f4){try{jsonpatch[_0x20cd('0x24')](_0x4db5f4,_0xafa0b7,!![]);}catch(_0x521218){return BPromise['reject'](_0x521218);}return _0x4db5f4[_0x20cd('0x25')]();};}function saveUpdates(_0x27238d,_0x5511a4){return function(_0x3328f5){if(_0x3328f5){return _0x3328f5[_0x20cd('0x26')](_0x27238d)[_0x20cd('0x27')](function(_0x587e53){return _0x587e53;});}return null;};}function removeEntity(_0x2f5a89,_0x5e0a22){return function(_0x1d6e1){if(_0x1d6e1){return _0x1d6e1['destroy']()[_0x20cd('0x27')](function(){var _0x4cdeed=_0x1d6e1['get']({'plain':!![]});var _0x3672c6=_0x20cd('0x28');return db[_0x20cd('0x29')][_0x20cd('0x2a')]({'where':{'type':_0x3672c6,'resourceId':_0x4cdeed['id']}})['then'](function(){return _0x1d6e1;});})[_0x20cd('0x27')](function(){_0x2f5a89[_0x20cd('0x1b')](0xcc)[_0x20cd('0x1c')]();});}};}function handleEntityNotFound(_0x5397fa,_0x48b83f){return function(_0x4d097f){if(!_0x4d097f){_0x5397fa[_0x20cd('0x1a')](0x194);}return _0x4d097f;};}function handleError(_0x50a5d3,_0x17220d){_0x17220d=_0x17220d||0x1f4;return function(_0x40b41f){logger[_0x20cd('0x2b')](_0x40b41f[_0x20cd('0x2c')]);if(_0x40b41f[_0x20cd('0x2d')]){delete _0x40b41f['name'];}_0x50a5d3[_0x20cd('0x1b')](_0x17220d)[_0x20cd('0x2e')](_0x40b41f);};}exports[_0x20cd('0x2f')]=function(_0x559521,_0xf66613){var _0x2fa96d={},_0x112bec={},_0x20fa63={'count':0x0,'rows':[]};var _0x3f552c=_[_0x20cd('0x30')](db[_0x20cd('0x31')][_0x20cd('0x32')],function(_0x4498d9){return{'name':_0x4498d9[_0x20cd('0x33')],'type':_0x4498d9[_0x20cd('0x34')][_0x20cd('0x35')]};});_0x112bec[_0x20cd('0x36')]=_[_0x20cd('0x30')](_0x3f552c,_0x20cd('0x2d'));_0x112bec['query']=_['keys'](_0x559521[_0x20cd('0x37')]);_0x112bec[_0x20cd('0x38')]=_[_0x20cd('0x39')](_0x112bec[_0x20cd('0x36')],_0x112bec['query']);_0x2fa96d[_0x20cd('0x3a')]=_[_0x20cd('0x39')](_0x112bec[_0x20cd('0x36')],qs[_0x20cd('0x3b')](_0x559521[_0x20cd('0x37')][_0x20cd('0x3b')]));_0x2fa96d['attributes']=_0x2fa96d[_0x20cd('0x3a')][_0x20cd('0x3c')]?_0x2fa96d[_0x20cd('0x3a')]:_0x112bec[_0x20cd('0x36')];if(!_0x559521[_0x20cd('0x37')][_0x20cd('0x3d')](_0x20cd('0x3e'))){_0x2fa96d[_0x20cd('0x20')]=qs[_0x20cd('0x20')](_0x559521[_0x20cd('0x37')]['limit']);_0x2fa96d[_0x20cd('0x1e')]=qs[_0x20cd('0x1e')](_0x559521[_0x20cd('0x37')][_0x20cd('0x1e')]);}_0x2fa96d[_0x20cd('0x3f')]=qs[_0x20cd('0x40')](_0x559521['query'][_0x20cd('0x40')]);_0x2fa96d[_0x20cd('0x41')]=qs[_0x20cd('0x38')](_[_0x20cd('0x42')](_0x559521[_0x20cd('0x37')],_0x112bec[_0x20cd('0x38')]),_0x3f552c);if(_0x559521[_0x20cd('0x37')][_0x20cd('0x43')]){_0x2fa96d[_0x20cd('0x41')]=_[_0x20cd('0x44')](_0x2fa96d[_0x20cd('0x41')],{'$or':_[_0x20cd('0x30')](_0x3f552c,function(_0x1de35e){if(_0x1de35e[_0x20cd('0x34')]!==_0x20cd('0x45')){var _0x4019b2={};_0x4019b2[_0x1de35e[_0x20cd('0x2d')]]={'$like':'%'+_0x559521[_0x20cd('0x37')][_0x20cd('0x43')]+'%'};return _0x4019b2;}})});}_0x2fa96d=_[_0x20cd('0x44')]({},_0x2fa96d,_0x559521['options']);var _0x144260={'where':_0x2fa96d[_0x20cd('0x41')]};return db[_0x20cd('0x31')][_0x20cd('0x21')](_0x144260)[_0x20cd('0x27')](function(_0x13ac3b){_0x20fa63[_0x20cd('0x21')]=_0x13ac3b;if(_0x559521[_0x20cd('0x37')][_0x20cd('0x46')]){_0x2fa96d[_0x20cd('0x47')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x2fa96d);})[_0x20cd('0x27')](function(_0x2a8a90){_0x20fa63['rows']=_0x2a8a90;return _0x20fa63;})[_0x20cd('0x27')](respondWithFilteredResult(_0xf66613,_0x2fa96d))['catch'](handleError(_0xf66613,null));};exports[_0x20cd('0x48')]=function(_0x14a9d5,_0x2b91d8){var _0x4371a9={'raw':!![],'where':{'id':_0x14a9d5[_0x20cd('0x49')]['id']}},_0x44bf52={};_0x44bf52[_0x20cd('0x36')]=_[_0x20cd('0x4a')](db[_0x20cd('0x31')]['rawAttributes']);_0x44bf52['query']=_[_0x20cd('0x4a')](_0x14a9d5['query']);_0x44bf52[_0x20cd('0x38')]=_[_0x20cd('0x39')](_0x44bf52[_0x20cd('0x36')],_0x44bf52[_0x20cd('0x37')]);_0x4371a9['attributes']=_[_0x20cd('0x39')](_0x44bf52[_0x20cd('0x36')],qs['fields'](_0x14a9d5[_0x20cd('0x37')][_0x20cd('0x3b')]));_0x4371a9[_0x20cd('0x3a')]=_0x4371a9['attributes'][_0x20cd('0x3c')]?_0x4371a9[_0x20cd('0x3a')]:_0x44bf52[_0x20cd('0x36')];if(_0x14a9d5[_0x20cd('0x37')][_0x20cd('0x46')]){_0x4371a9['include']=[{'all':!![]}];}_0x4371a9=_[_0x20cd('0x44')]({},_0x4371a9,_0x14a9d5['options']);return db[_0x20cd('0x31')]['find'](_0x4371a9)['then'](handleEntityNotFound(_0x2b91d8,null))[_0x20cd('0x27')](respondWithResult(_0x2b91d8,null))[_0x20cd('0x4b')](handleError(_0x2b91d8,null));};exports['create']=function(_0x28eaeb,_0x4ffb22){return db[_0x20cd('0x31')][_0x20cd('0x4c')](_0x28eaeb['body'],{})[_0x20cd('0x27')](function(_0x4e934c){var _0x63830a=_0x28eaeb[_0x20cd('0x4d')][_0x20cd('0x4e')]({'plain':!![]});if(!_0x63830a)throw new Error(_0x20cd('0x4f'));if(_0x63830a[_0x20cd('0x50')]===_0x20cd('0x4d')){var _0xe35381=_0x4e934c['get']({'plain':!![]});var _0x7ad8cb=_0x20cd('0x28');return db[_0x20cd('0x51')][_0x20cd('0x52')]({'where':{'name':_0x7ad8cb,'userProfileId':_0x63830a[_0x20cd('0x53')]},'raw':!![]})[_0x20cd('0x27')](function(_0x46e44c){if(_0x46e44c&&_0x46e44c[_0x20cd('0x54')]===0x0){return db[_0x20cd('0x29')][_0x20cd('0x4c')]({'name':_0xe35381['name'],'resourceId':_0xe35381['id'],'type':_0x46e44c[_0x20cd('0x2d')],'sectionId':_0x46e44c['id']},{})[_0x20cd('0x27')](function(){return _0x4e934c;});}else{return _0x4e934c;}})[_0x20cd('0x4b')](function(_0x34df8d){logger[_0x20cd('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34df8d);throw _0x34df8d;});}return _0x4e934c;})['then'](respondWithResult(_0x4ffb22,0xc9))[_0x20cd('0x4b')](handleError(_0x4ffb22,null));};exports['update']=function(_0x57fa01,_0x46964f){if(_0x57fa01[_0x20cd('0x55')]['id']){delete _0x57fa01['body']['id'];}return db[_0x20cd('0x31')][_0x20cd('0x52')]({'where':{'id':_0x57fa01[_0x20cd('0x49')]['id']}})[_0x20cd('0x27')](handleEntityNotFound(_0x46964f,null))[_0x20cd('0x27')](saveUpdates(_0x57fa01[_0x20cd('0x55')],null))[_0x20cd('0x27')](respondWithResult(_0x46964f,null))['catch'](handleError(_0x46964f,null));};exports[_0x20cd('0x2a')]=function(_0x1eacf9,_0x245073){return db[_0x20cd('0x31')]['find']({'where':{'id':_0x1eacf9['params']['id']}})['then'](handleEntityNotFound(_0x245073,null))['then'](removeEntity(_0x245073,null))[_0x20cd('0x4b')](handleError(_0x245073,null));};exports[_0x20cd('0x56')]=function(_0x424bd9,_0x2b1288,_0x1c3dbb){return db[_0x20cd('0x31')][_0x20cd('0x52')]({'where':{'id':_0x424bd9['params']['id']},'attributes':['name',_0x20cd('0x57'),_0x20cd('0x58'),_0x20cd('0x59')],'raw':!![]})[_0x20cd('0x27')](handleEntityNotFound(_0x2b1288,null))['then'](function(_0x3b8f62){if(_0x3b8f62){if(!fs[_0x20cd('0x5a')](path['join'](config['root'],_0x20cd('0x5b'),_0x3b8f62[_0x20cd('0x58')]))){throw new db[(_0x20cd('0x5c'))]['ValidationError'](_0x20cd('0x5d'));}if(_0x424bd9[_0x20cd('0x37')][_0x20cd('0x5e')]){return _0x2b1288['sendStatus'](0xc8);}return _0x2b1288['download'](path['join'](config[_0x20cd('0x5f')],_0x20cd('0x5b'),_0x3b8f62[_0x20cd('0x58')]),util[_0x20cd('0x60')](_0x20cd('0x61'),_0x3b8f62[_0x20cd('0x57')]||_0x3b8f62[_0x20cd('0x2d')],_0x3b8f62[_0x20cd('0x59')][_0x20cd('0x62')]()));}})[_0x20cd('0x4b')](handleError(_0x2b1288,null));}; \ No newline at end of file +var _0x3275=['rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','then','destroy','get','ExtractedReports','UserProfileResource','end','stack','name','send','index','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','map','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format'];(function(_0x182fa4,_0x936799){var _0x6366ad=function(_0x336daf){while(--_0x336daf){_0x182fa4['push'](_0x182fa4['shift']());}};_0x6366ad(++_0x936799);}(_0x3275,0x173));var _0x5327=function(_0x5513b7,_0x4e3656){_0x5513b7=_0x5513b7-0x0;var _0x565a85=_0x3275[_0x5513b7];return _0x565a85;};'use strict';var emlformat=require(_0x5327('0x0'));var rimraf=require(_0x5327('0x1'));var zipdir=require(_0x5327('0x2'));var jsonpatch=require(_0x5327('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5327('0x4'));var Mustache=require(_0x5327('0x5'));var util=require(_0x5327('0x6'));var path=require('path');var sox=require(_0x5327('0x7'));var csv=require(_0x5327('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5327('0x9'));var _=require(_0x5327('0xa'));var squel=require(_0x5327('0xb'));var crypto=require(_0x5327('0xc'));var jsforce=require(_0x5327('0xd'));var deskjs=require(_0x5327('0xe'));var toCsv=require(_0x5327('0x8'));var querystring=require(_0x5327('0xf'));var Papa=require(_0x5327('0x10'));var Redis=require(_0x5327('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5327('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5327('0x13'));var logger=require(_0x5327('0x14'))(_0x5327('0x15'));var utils=require(_0x5327('0x16'));var config=require(_0x5327('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x551812,_0x54e36f){_0x54e36f=_0x54e36f||0xcc;return function(_0x57b778){if(_0x57b778){return _0x551812[_0x5327('0x18')](_0x54e36f);}return _0x551812['status'](_0x54e36f)['end']();};}function respondWithResult(_0x48274d,_0x6d11e5){_0x6d11e5=_0x6d11e5||0xc8;return function(_0x325ac1){if(_0x325ac1){return _0x48274d[_0x5327('0x19')](_0x6d11e5)[_0x5327('0x1a')](_0x325ac1);}};}function respondWithFilteredResult(_0x2d1709,_0x22ea54){return function(_0x51d634){if(_0x51d634){var _0x37823b=typeof _0x22ea54[_0x5327('0x1b')]===_0x5327('0x1c')&&typeof _0x22ea54['limit']===_0x5327('0x1c');var _0x5343ea=_0x51d634['count'];var _0x87929=_0x37823b?0x0:_0x22ea54[_0x5327('0x1b')];var _0x5223c7=_0x37823b?_0x51d634[_0x5327('0x1d')]:_0x22ea54[_0x5327('0x1b')]+_0x22ea54[_0x5327('0x1e')];var _0x5df6ff;if(_0x5223c7>=_0x5343ea){_0x5223c7=_0x5343ea;_0x5df6ff=0xc8;}else{_0x5df6ff=0xce;}_0x2d1709['status'](_0x5df6ff);return _0x2d1709[_0x5327('0x1f')](_0x5327('0x20'),_0x87929+'-'+_0x5223c7+'/'+_0x5343ea)['json'](_0x51d634);}return null;};}function patchUpdates(_0x4fc380){return function(_0x417226){try{jsonpatch['apply'](_0x417226,_0x4fc380,!![]);}catch(_0x157d76){return BPromise[_0x5327('0x21')](_0x157d76);}return _0x417226['save']();};}function saveUpdates(_0x5ad4d3,_0x522fb7){return function(_0x511824){if(_0x511824){return _0x511824['update'](_0x5ad4d3)[_0x5327('0x22')](function(_0x1e5d9c){return _0x1e5d9c;});}return null;};}function removeEntity(_0x18ecf2,_0xd01e4e){return function(_0x2b5edc){if(_0x2b5edc){return _0x2b5edc[_0x5327('0x23')]()[_0x5327('0x22')](function(){var _0x50d2e2=_0x2b5edc[_0x5327('0x24')]({'plain':!![]});var _0x42fe78=_0x5327('0x25');return db[_0x5327('0x26')][_0x5327('0x23')]({'where':{'type':_0x42fe78,'resourceId':_0x50d2e2['id']}})['then'](function(){return _0x2b5edc;});})['then'](function(){_0x18ecf2[_0x5327('0x19')](0xcc)[_0x5327('0x27')]();});}};}function handleEntityNotFound(_0x3928e0,_0x4b5fef){return function(_0x3b0783){if(!_0x3b0783){_0x3928e0[_0x5327('0x18')](0x194);}return _0x3b0783;};}function handleError(_0xef749c,_0x19193f){_0x19193f=_0x19193f||0x1f4;return function(_0x39e4c1){logger['error'](_0x39e4c1[_0x5327('0x28')]);if(_0x39e4c1[_0x5327('0x29')]){delete _0x39e4c1[_0x5327('0x29')];}_0xef749c[_0x5327('0x19')](_0x19193f)[_0x5327('0x2a')](_0x39e4c1);};}exports[_0x5327('0x2b')]=function(_0x587f24,_0xb2b50f){var _0x2c5cb6={},_0x4faaf7={},_0x5e916b={'count':0x0,'rows':[]};var _0x23d60b=_['map'](db[_0x5327('0x2c')]['rawAttributes'],function(_0x5cc805){return{'name':_0x5cc805[_0x5327('0x2d')],'type':_0x5cc805[_0x5327('0x2e')][_0x5327('0x2f')]};});_0x4faaf7[_0x5327('0x30')]=_['map'](_0x23d60b,'name');_0x4faaf7[_0x5327('0x31')]=_[_0x5327('0x32')](_0x587f24[_0x5327('0x31')]);_0x4faaf7[_0x5327('0x33')]=_['intersection'](_0x4faaf7['model'],_0x4faaf7[_0x5327('0x31')]);_0x2c5cb6['attributes']=_[_0x5327('0x34')](_0x4faaf7[_0x5327('0x30')],qs[_0x5327('0x35')](_0x587f24[_0x5327('0x31')][_0x5327('0x35')]));_0x2c5cb6[_0x5327('0x36')]=_0x2c5cb6[_0x5327('0x36')][_0x5327('0x37')]?_0x2c5cb6[_0x5327('0x36')]:_0x4faaf7['model'];if(!_0x587f24[_0x5327('0x31')]['hasOwnProperty'](_0x5327('0x38'))){_0x2c5cb6[_0x5327('0x1e')]=qs[_0x5327('0x1e')](_0x587f24['query'][_0x5327('0x1e')]);_0x2c5cb6['offset']=qs[_0x5327('0x1b')](_0x587f24[_0x5327('0x31')][_0x5327('0x1b')]);}_0x2c5cb6[_0x5327('0x39')]=qs[_0x5327('0x3a')](_0x587f24['query'][_0x5327('0x3a')]);_0x2c5cb6[_0x5327('0x3b')]=qs[_0x5327('0x33')](_[_0x5327('0x3c')](_0x587f24[_0x5327('0x31')],_0x4faaf7[_0x5327('0x33')]),_0x23d60b);if(_0x587f24[_0x5327('0x31')][_0x5327('0x3d')]){_0x2c5cb6[_0x5327('0x3b')]=_['merge'](_0x2c5cb6[_0x5327('0x3b')],{'$or':_[_0x5327('0x3e')](_0x23d60b,function(_0x3fbc6b){if(_0x3fbc6b['type']!==_0x5327('0x3f')){var _0xf683c1={};_0xf683c1[_0x3fbc6b[_0x5327('0x29')]]={'$like':'%'+_0x587f24['query'][_0x5327('0x3d')]+'%'};return _0xf683c1;}})});}_0x2c5cb6=_['merge']({},_0x2c5cb6,_0x587f24[_0x5327('0x40')]);var _0x4a9c02={'where':_0x2c5cb6[_0x5327('0x3b')]};return db[_0x5327('0x2c')][_0x5327('0x1d')](_0x4a9c02)[_0x5327('0x22')](function(_0x331de1){_0x5e916b['count']=_0x331de1;if(_0x587f24[_0x5327('0x31')][_0x5327('0x41')]){_0x2c5cb6[_0x5327('0x42')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x2c5cb6);})[_0x5327('0x22')](function(_0x3364c8){_0x5e916b['rows']=_0x3364c8;return _0x5e916b;})[_0x5327('0x22')](respondWithFilteredResult(_0xb2b50f,_0x2c5cb6))[_0x5327('0x43')](handleError(_0xb2b50f,null));};exports[_0x5327('0x44')]=function(_0x13a0d3,_0x1b0a6e){var _0x3ea097={'raw':!![],'where':{'id':_0x13a0d3[_0x5327('0x45')]['id']}},_0x5a5420={};_0x5a5420[_0x5327('0x30')]=_[_0x5327('0x32')](db[_0x5327('0x2c')][_0x5327('0x46')]);_0x5a5420[_0x5327('0x31')]=_[_0x5327('0x32')](_0x13a0d3[_0x5327('0x31')]);_0x5a5420[_0x5327('0x33')]=_['intersection'](_0x5a5420[_0x5327('0x30')],_0x5a5420['query']);_0x3ea097[_0x5327('0x36')]=_[_0x5327('0x34')](_0x5a5420[_0x5327('0x30')],qs[_0x5327('0x35')](_0x13a0d3[_0x5327('0x31')][_0x5327('0x35')]));_0x3ea097[_0x5327('0x36')]=_0x3ea097['attributes']['length']?_0x3ea097[_0x5327('0x36')]:_0x5a5420[_0x5327('0x30')];if(_0x13a0d3[_0x5327('0x31')][_0x5327('0x41')]){_0x3ea097[_0x5327('0x42')]=[{'all':!![]}];}_0x3ea097=_[_0x5327('0x47')]({},_0x3ea097,_0x13a0d3[_0x5327('0x40')]);return db[_0x5327('0x2c')][_0x5327('0x48')](_0x3ea097)[_0x5327('0x22')](handleEntityNotFound(_0x1b0a6e,null))['then'](respondWithResult(_0x1b0a6e,null))[_0x5327('0x43')](handleError(_0x1b0a6e,null));};exports[_0x5327('0x49')]=function(_0x3b0148,_0x4ab7c6){return db[_0x5327('0x2c')][_0x5327('0x49')](_0x3b0148[_0x5327('0x4a')],{})[_0x5327('0x22')](function(_0x203eee){var _0x54ebf4=_0x3b0148[_0x5327('0x4b')][_0x5327('0x24')]({'plain':!![]});if(!_0x54ebf4)throw new Error(_0x5327('0x4c'));if(_0x54ebf4['role']==='user'){var _0x3e2635=_0x203eee[_0x5327('0x24')]({'plain':!![]});var _0xedc3b9=_0x5327('0x25');return db[_0x5327('0x4d')][_0x5327('0x48')]({'where':{'name':_0xedc3b9,'userProfileId':_0x54ebf4['userProfileId']},'raw':!![]})['then'](function(_0x5eb8a1){if(_0x5eb8a1&&_0x5eb8a1['autoAssociation']===0x0){return db[_0x5327('0x26')][_0x5327('0x49')]({'name':_0x3e2635[_0x5327('0x29')],'resourceId':_0x3e2635['id'],'type':_0x5eb8a1['name'],'sectionId':_0x5eb8a1['id']},{})['then'](function(){return _0x203eee;});}else{return _0x203eee;}})['catch'](function(_0x730754){logger[_0x5327('0x4e')](_0x5327('0x4f'),_0x730754);throw _0x730754;});}return _0x203eee;})[_0x5327('0x22')](respondWithResult(_0x4ab7c6,0xc9))[_0x5327('0x43')](handleError(_0x4ab7c6,null));};exports[_0x5327('0x50')]=function(_0x2026a2,_0x4942dc){if(_0x2026a2[_0x5327('0x4a')]['id']){delete _0x2026a2['body']['id'];}return db[_0x5327('0x2c')][_0x5327('0x48')]({'where':{'id':_0x2026a2[_0x5327('0x45')]['id']}})[_0x5327('0x22')](handleEntityNotFound(_0x4942dc,null))[_0x5327('0x22')](saveUpdates(_0x2026a2[_0x5327('0x4a')],null))[_0x5327('0x22')](respondWithResult(_0x4942dc,null))[_0x5327('0x43')](handleError(_0x4942dc,null));};exports[_0x5327('0x23')]=function(_0x4b4c59,_0x69b4bd){return db[_0x5327('0x2c')]['find']({'where':{'id':_0x4b4c59[_0x5327('0x45')]['id']}})[_0x5327('0x22')](handleEntityNotFound(_0x69b4bd,null))[_0x5327('0x22')](removeEntity(_0x69b4bd,null))[_0x5327('0x43')](handleError(_0x69b4bd,null));};exports[_0x5327('0x51')]=function(_0x2744ed,_0x4e9f0c,_0x6a9b65){return db[_0x5327('0x2c')][_0x5327('0x48')]({'where':{'id':_0x2744ed['params']['id']},'attributes':['name',_0x5327('0x52'),_0x5327('0x53'),_0x5327('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x4e9f0c,null))[_0x5327('0x22')](function(_0x18991a){if(_0x18991a){if(!fs['existsSync'](path['join'](config[_0x5327('0x55')],_0x5327('0x56'),_0x18991a[_0x5327('0x53')]))){throw new db[(_0x5327('0x57'))]['ValidationError'](_0x5327('0x58'));}if(_0x2744ed[_0x5327('0x31')][_0x5327('0x59')]){return _0x4e9f0c[_0x5327('0x18')](0xc8);}return _0x4e9f0c[_0x5327('0x51')](path['join'](config[_0x5327('0x55')],_0x5327('0x56'),_0x18991a[_0x5327('0x53')]),util[_0x5327('0x5a')](_0x5327('0x5b'),_0x18991a[_0x5327('0x52')]||_0x18991a[_0x5327('0x29')],_0x18991a[_0x5327('0x54')][_0x5327('0x5c')]()));}})[_0x5327('0x43')](handleError(_0x4e9f0c,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index d95a476..3d7b6d7 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.model.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bbc=['bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','api','moment'];(function(_0x36ed63,_0x1decdf){var _0x1fc9f6=function(_0x19b252){while(--_0x19b252){_0x36ed63['push'](_0x36ed63['shift']());}};_0x1fc9f6(++_0x1decdf);}(_0x7bbc,0x69));var _0xc7bb=function(_0x495552,_0x4da737){_0x495552=_0x495552-0x0;var _0x511110=_0x7bbc[_0x495552];return _0x511110;};'use strict';var _=require(_0xc7bb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc7bb('0x1'));var moment=require(_0xc7bb('0x2'));var BPromise=require(_0xc7bb('0x3'));var rp=require(_0xc7bb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc7bb('0x5'));var config=require(_0xc7bb('0x6'));var attributes=require(_0xc7bb('0x7'));module[_0xc7bb('0x8')]=function(_0x3c66a9,_0x2c22b2){return _0x3c66a9[_0xc7bb('0x9')](_0xc7bb('0xa'),attributes,{'tableName':_0xc7bb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49b9=['define','AnalyticExtractedReport','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0x49b9,0x119));var _0x949b=function(_0x503647,_0x83b0de){_0x503647=_0x503647-0x0;var _0x4a1e48=_0x49b9[_0x503647];return _0x4a1e48;};'use strict';var _=require('lodash');var util=require(_0x949b('0x0'));var logger=require(_0x949b('0x1'))(_0x949b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x949b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x949b('0x4'));var config=require(_0x949b('0x5'));var attributes=require(_0x949b('0x6'));module['exports']=function(_0x1da7f2,_0x5ebffd){return _0x1da7f2[_0x949b('0x7')](_0x949b('0x8'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index c619d68..94bee6f 100644 --- a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js +++ b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x78b0=['http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4ed05b,_0x36148d){var _0x2cd2a3=function(_0x1939d0){while(--_0x1939d0){_0x4ed05b['push'](_0x4ed05b['shift']());}};_0x2cd2a3(++_0x36148d);}(_0x78b0,0x173));var _0x078b=function(_0x236cc0,_0xc76be8){_0x236cc0=_0x236cc0-0x0;var _0x509cc7=_0x78b0[_0x236cc0];return _0x509cc7;};'use strict';var _=require(_0x078b('0x0'));var util=require(_0x078b('0x1'));var moment=require('moment');var BPromise=require(_0x078b('0x2'));var rs=require(_0x078b('0x3'));var fs=require('fs');var Redis=require(_0x078b('0x4'));var db=require(_0x078b('0x5'))['db'];var utils=require(_0x078b('0x6'));var logger=require(_0x078b('0x7'))(_0x078b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x078b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fa46e,_0x160f91,_0x3c3f1c){return new BPromise(function(_0xbed569,_0x3a9648){return client[_0x078b('0xa')](_0x3fa46e,_0x3c3f1c)[_0x078b('0xb')](function(_0x47948b){logger[_0x078b('0xc')](_0x078b('0xd'),_0x160f91,_0x078b('0xe'));logger['debug'](_0x078b('0xf'),_0x160f91,_0x078b('0xe'),JSON[_0x078b('0x10')](_0x47948b));if(_0x47948b[_0x078b('0x11')]){if(_0x47948b[_0x078b('0x11')]['code']===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x160f91,_0x47948b['error']['message']);return _0x3a9648(_0x47948b[_0x078b('0x11')][_0x078b('0x12')]);}logger[_0x078b('0x11')](_0x078b('0xd'),_0x160f91,_0x47948b[_0x078b('0x11')]['message']);return _0xbed569(_0x47948b[_0x078b('0x11')][_0x078b('0x12')]);}else{logger[_0x078b('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x160f91,_0x078b('0xe'));_0xbed569(_0x47948b['result'][_0x078b('0x12')]);}})[_0x078b('0x13')](function(_0x3f4c68){logger[_0x078b('0x11')](_0x078b('0xd'),_0x160f91,_0x3f4c68);_0x3a9648(_0x3f4c68);});});} \ No newline at end of file +var _0xef74=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x4cec21,_0x3d6fb4){var _0x30f1ef=function(_0x544e28){while(--_0x544e28){_0x4cec21['push'](_0x4cec21['shift']());}};_0x30f1ef(++_0x3d6fb4);}(_0xef74,0x8d));var _0x4ef7=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0xef74[_0x40a825];return _0x273a54;};'use strict';var _=require(_0x4ef7('0x0'));var util=require(_0x4ef7('0x1'));var moment=require(_0x4ef7('0x2'));var BPromise=require(_0x4ef7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ef7('0x4'));var db=require(_0x4ef7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4ef7('0x6'));var config=require(_0x4ef7('0x7'));var jayson=require(_0x4ef7('0x8'));var client=jayson[_0x4ef7('0x9')][_0x4ef7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbebde,_0x15626f,_0x39cdff){return new BPromise(function(_0x30a89a,_0x26dd95){return client['request'](_0xbebde,_0x39cdff)[_0x4ef7('0xb')](function(_0x3e1941){logger[_0x4ef7('0xc')](_0x4ef7('0xd'),_0x15626f,_0x4ef7('0xe'));logger[_0x4ef7('0xf')](_0x4ef7('0x10'),_0x15626f,'request\x20sent',JSON[_0x4ef7('0x11')](_0x3e1941));if(_0x3e1941[_0x4ef7('0x12')]){if(_0x3e1941[_0x4ef7('0x12')]['code']===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x15626f,_0x3e1941[_0x4ef7('0x12')][_0x4ef7('0x13')]);return _0x26dd95(_0x3e1941['error'][_0x4ef7('0x13')]);}logger[_0x4ef7('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x15626f,_0x3e1941[_0x4ef7('0x12')][_0x4ef7('0x13')]);return _0x30a89a(_0x3e1941['error']['message']);}else{logger[_0x4ef7('0xc')](_0x4ef7('0xd'),_0x15626f,_0x4ef7('0xe'));_0x30a89a(_0x3e1941[_0x4ef7('0x14')][_0x4ef7('0x13')]);}})[_0x4ef7('0x15')](function(_0x1f87f3){logger[_0x4ef7('0x12')](_0x4ef7('0xd'),_0x15626f,_0x1f87f3);_0x26dd95(_0x1f87f3);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 0c18e10..fb976fa 100644 --- a/server/api/analyticExtractedReport/index.js +++ b/server/api/analyticExtractedReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f41=['show','/:id/download','download','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticExtractedReport.controller','get','/:id','isAuthenticated'];(function(_0x28394f,_0x5ebdd2){var _0x2618d2=function(_0x2ffed6){while(--_0x2ffed6){_0x28394f['push'](_0x28394f['shift']());}};_0x2618d2(++_0x5ebdd2);}(_0x4f41,0x184));var _0x14f4=function(_0x52cde3,_0x28d007){_0x52cde3=_0x52cde3-0x0;var _0x106ff1=_0x4f41[_0x52cde3];return _0x106ff1;};'use strict';var multer=require('multer');var util=require(_0x14f4('0x0'));var path=require(_0x14f4('0x1'));var timeout=require(_0x14f4('0x2'));var express=require(_0x14f4('0x3'));var router=express[_0x14f4('0x4')]();var fs_extra=require(_0x14f4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x14f4('0x6'));var config=require('../../config/environment');var controller=require(_0x14f4('0x7'));router[_0x14f4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x14f4('0x8')](_0x14f4('0x9'),auth[_0x14f4('0xa')](),controller[_0x14f4('0xb')]);router[_0x14f4('0x8')](_0x14f4('0xc'),auth['isAuthenticated'](),controller[_0x14f4('0xd')]);router[_0x14f4('0xe')]('/',auth[_0x14f4('0xa')](),controller[_0x14f4('0xf')]);router[_0x14f4('0x10')](_0x14f4('0x9'),auth[_0x14f4('0xa')](),controller[_0x14f4('0x11')]);router[_0x14f4('0x12')]('/:id',auth[_0x14f4('0xa')](),controller[_0x14f4('0x13')]);module[_0x14f4('0x14')]=router; \ No newline at end of file +var _0xef8d=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','/:id','get','/:id/download','download','post'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xef8d,0xcc));var _0xdef8=function(_0x11b3f4,_0x371c17){_0x11b3f4=_0x11b3f4-0x0;var _0x47af1d=_0xef8d[_0x11b3f4];return _0x47af1d;};'use strict';var multer=require('multer');var util=require(_0xdef8('0x0'));var path=require(_0xdef8('0x1'));var timeout=require(_0xdef8('0x2'));var express=require(_0xdef8('0x3'));var router=express[_0xdef8('0x4')]();var fs_extra=require(_0xdef8('0x5'));var auth=require(_0xdef8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdef8('0x7'));var controller=require(_0xdef8('0x8'));router['get']('/',auth[_0xdef8('0x9')](),controller[_0xdef8('0xa')]);router['get'](_0xdef8('0xb'),auth[_0xdef8('0x9')](),controller['show']);router[_0xdef8('0xc')](_0xdef8('0xd'),auth['isAuthenticated'](),controller[_0xdef8('0xe')]);router[_0xdef8('0xf')]('/',auth[_0xdef8('0x9')](),controller[_0xdef8('0x10')]);router[_0xdef8('0x11')](_0xdef8('0xb'),auth[_0xdef8('0x9')](),controller[_0xdef8('0x12')]);router[_0xdef8('0x13')](_0xdef8('0xb'),auth[_0xdef8('0x9')](),controller[_0xdef8('0x14')]);module[_0xdef8('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 9f862fb..6d8a3b6 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.attributes.js +++ b/server/api/analyticFieldReport/analyticFieldReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8188=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x4986a3,_0x42fe88){var _0x4c8723=function(_0x31abb6){while(--_0x31abb6){_0x4986a3['push'](_0x4986a3['shift']());}};_0x4c8723(++_0x42fe88);}(_0x8188,0x16c));var _0x8818=function(_0x1a9e3d,_0x39c8e2){_0x1a9e3d=_0x1a9e3d-0x0;var _0x2b1cea=_0x8188[_0x1a9e3d];return _0x2b1cea;};'use strict';var Sequelize=require(_0x8818('0x0'));module[_0x8818('0x1')]={'field':{'type':Sequelize[_0x8818('0x2')]},'alias':{'type':Sequelize[_0x8818('0x3')]},'function':{'type':Sequelize[_0x8818('0x3')]},'format':{'type':Sequelize[_0x8818('0x3')]},'groupBy':{'type':Sequelize[_0x8818('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8818('0x3')]},'custom':{'type':Sequelize[_0x8818('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xe2f5=['BOOLEAN','exports','TEXT','STRING'];(function(_0x5292de,_0x5c03ef){var _0x52574f=function(_0x57d962){while(--_0x57d962){_0x5292de['push'](_0x5292de['shift']());}};_0x52574f(++_0x5c03ef);}(_0xe2f5,0x16d));var _0x5e2f=function(_0x14eb4e,_0x294202){_0x14eb4e=_0x14eb4e-0x0;var _0x142ad8=_0xe2f5[_0x14eb4e];return _0x142ad8;};'use strict';var Sequelize=require('sequelize');module[_0x5e2f('0x0')]={'field':{'type':Sequelize[_0x5e2f('0x1')]},'alias':{'type':Sequelize[_0x5e2f('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x5e2f('0x2')]},'groupBy':{'type':Sequelize[_0x5e2f('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x5e2f('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 24b3b5a..4462cdc 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.controller.js +++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf350=['pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','bulkCreate','body','find','destroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x29de5a,_0x34201f){var _0x11339a=function(_0x4e6ce9){while(--_0x4e6ce9){_0x29de5a['push'](_0x29de5a['shift']());}};_0x11339a(++_0x34201f);}(_0xf350,0x105));var _0x0f35=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf350[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x0f35('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0f35('0x1'));var rp=require(_0x0f35('0x2'));var moment=require(_0x0f35('0x3'));var BPromise=require(_0x0f35('0x4'));var Mustache=require(_0x0f35('0x5'));var util=require(_0x0f35('0x6'));var path=require(_0x0f35('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f35('0x8'));var _=require(_0x0f35('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0f35('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0f35('0xb'));var querystring=require('querystring');var Papa=require(_0x0f35('0xc'));var Redis=require(_0x0f35('0xd'));var authService=require(_0x0f35('0xe'));var qs=require(_0x0f35('0xf'));var as=require(_0x0f35('0x10'));var hardwareService=require(_0x0f35('0x11'));var logger=require(_0x0f35('0x12'))(_0x0f35('0x13'));var utils=require(_0x0f35('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0f35('0x15'));var db=require(_0x0f35('0x16'))['db'];function respondWithStatusCode(_0x515954,_0x21698e){_0x21698e=_0x21698e||0xcc;return function(_0x579b38){if(_0x579b38){return _0x515954[_0x0f35('0x17')](_0x21698e);}return _0x515954['status'](_0x21698e)['end']();};}function respondWithResult(_0x1a2f7c,_0x20cfb8){_0x20cfb8=_0x20cfb8||0xc8;return function(_0x322ed3){if(_0x322ed3){return _0x1a2f7c['status'](_0x20cfb8)[_0x0f35('0x18')](_0x322ed3);}};}function respondWithFilteredResult(_0x4011ab,_0x25e86d){return function(_0x38d9de){if(_0x38d9de){var _0xa07e54=typeof _0x25e86d[_0x0f35('0x19')]===_0x0f35('0x1a')&&typeof _0x25e86d[_0x0f35('0x1b')]===_0x0f35('0x1a');var _0x34b759=_0x38d9de[_0x0f35('0x1c')];var _0x1bcf51=_0xa07e54?0x0:_0x25e86d[_0x0f35('0x19')];var _0x496ff9=_0xa07e54?_0x38d9de[_0x0f35('0x1c')]:_0x25e86d[_0x0f35('0x19')]+_0x25e86d[_0x0f35('0x1b')];var _0x190ee7;if(_0x496ff9>=_0x34b759){_0x496ff9=_0x34b759;_0x190ee7=0xc8;}else{_0x190ee7=0xce;}_0x4011ab[_0x0f35('0x1d')](_0x190ee7);return _0x4011ab[_0x0f35('0x1e')](_0x0f35('0x1f'),_0x1bcf51+'-'+_0x496ff9+'/'+_0x34b759)[_0x0f35('0x18')](_0x38d9de);}return null;};}function patchUpdates(_0x2edf27){return function(_0x19dacb){try{jsonpatch[_0x0f35('0x20')](_0x19dacb,_0x2edf27,!![]);}catch(_0x1ecc64){return BPromise[_0x0f35('0x21')](_0x1ecc64);}return _0x19dacb[_0x0f35('0x22')]();};}function saveUpdates(_0x152e01,_0x42aaa0){return function(_0x4c7b08){if(_0x4c7b08){return _0x4c7b08[_0x0f35('0x23')](_0x152e01)[_0x0f35('0x24')](function(_0x43cf26){return _0x43cf26;});}return null;};}function removeEntity(_0x47d9ee,_0x4a71ed){return function(_0x252515){if(_0x252515){return _0x252515['destroy']()[_0x0f35('0x24')](function(){_0x47d9ee[_0x0f35('0x1d')](0xcc)[_0x0f35('0x25')]();});}};}function handleEntityNotFound(_0x494140,_0x1aed0a){return function(_0x3ce83d){if(!_0x3ce83d){_0x494140[_0x0f35('0x17')](0x194);}return _0x3ce83d;};}function handleError(_0x4a43c7,_0x4863f9){_0x4863f9=_0x4863f9||0x1f4;return function(_0x9091f0){logger[_0x0f35('0x26')](_0x9091f0['stack']);if(_0x9091f0[_0x0f35('0x27')]){delete _0x9091f0[_0x0f35('0x27')];}_0x4a43c7[_0x0f35('0x1d')](_0x4863f9)[_0x0f35('0x28')](_0x9091f0);};}exports[_0x0f35('0x29')]=function(_0x100301,_0x81ec3f){var _0x5d93f2={},_0x4021aa={},_0x3081f8={'count':0x0,'rows':[]};var _0x5cdf8=_['map'](db[_0x0f35('0x2a')][_0x0f35('0x2b')],function(_0x3d4a2d){return{'name':_0x3d4a2d[_0x0f35('0x2c')],'type':_0x3d4a2d[_0x0f35('0x2d')][_0x0f35('0x2e')]};});_0x4021aa['model']=_[_0x0f35('0x2f')](_0x5cdf8,_0x0f35('0x27'));_0x4021aa[_0x0f35('0x30')]=_['keys'](_0x100301[_0x0f35('0x30')]);_0x4021aa[_0x0f35('0x31')]=_[_0x0f35('0x32')](_0x4021aa['model'],_0x4021aa[_0x0f35('0x30')]);_0x5d93f2[_0x0f35('0x33')]=_[_0x0f35('0x32')](_0x4021aa[_0x0f35('0x34')],qs['fields'](_0x100301[_0x0f35('0x30')][_0x0f35('0x35')]));_0x5d93f2[_0x0f35('0x33')]=_0x5d93f2[_0x0f35('0x33')][_0x0f35('0x36')]?_0x5d93f2[_0x0f35('0x33')]:_0x4021aa[_0x0f35('0x34')];if(!_0x100301[_0x0f35('0x30')][_0x0f35('0x37')](_0x0f35('0x38'))){_0x5d93f2[_0x0f35('0x1b')]=qs[_0x0f35('0x1b')](_0x100301[_0x0f35('0x30')]['limit']);_0x5d93f2['offset']=qs[_0x0f35('0x19')](_0x100301[_0x0f35('0x30')]['offset']);}_0x5d93f2['order']=qs[_0x0f35('0x39')](_0x100301[_0x0f35('0x30')]['sort']);_0x5d93f2[_0x0f35('0x3a')]=qs['filters'](_[_0x0f35('0x3b')](_0x100301[_0x0f35('0x30')],_0x4021aa[_0x0f35('0x31')]),_0x5cdf8);if(_0x100301['query'][_0x0f35('0x3c')]){_0x5d93f2['where']=_[_0x0f35('0x3d')](_0x5d93f2[_0x0f35('0x3a')],{'$or':_[_0x0f35('0x2f')](_0x5cdf8,function(_0x1d58df){if(_0x1d58df[_0x0f35('0x2d')]!==_0x0f35('0x3e')){var _0x42e795={};_0x42e795[_0x1d58df[_0x0f35('0x27')]]={'$like':'%'+_0x100301[_0x0f35('0x30')][_0x0f35('0x3c')]+'%'};return _0x42e795;}})});}_0x5d93f2=_[_0x0f35('0x3d')]({},_0x5d93f2,_0x100301[_0x0f35('0x3f')]);var _0x640ce8={'where':_0x5d93f2['where']};return db['AnalyticFieldReport']['count'](_0x640ce8)[_0x0f35('0x24')](function(_0x5059af){_0x3081f8[_0x0f35('0x1c')]=_0x5059af;if(_0x100301[_0x0f35('0x30')][_0x0f35('0x40')]){_0x5d93f2[_0x0f35('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x0f35('0x42')](_0x5d93f2);})[_0x0f35('0x24')](function(_0x49c115){_0x3081f8[_0x0f35('0x43')]=_0x49c115;return _0x3081f8;})[_0x0f35('0x24')](respondWithFilteredResult(_0x81ec3f,_0x5d93f2))[_0x0f35('0x44')](handleError(_0x81ec3f,null));};exports['show']=function(_0x35bf7f,_0x531dac){var _0x1eb325={'raw':![],'where':{'id':_0x35bf7f[_0x0f35('0x45')]['id']}},_0x3e880a={};_0x3e880a[_0x0f35('0x34')]=_[_0x0f35('0x46')](db[_0x0f35('0x2a')]['rawAttributes']);_0x3e880a['query']=_[_0x0f35('0x46')](_0x35bf7f[_0x0f35('0x30')]);_0x3e880a[_0x0f35('0x31')]=_['intersection'](_0x3e880a[_0x0f35('0x34')],_0x3e880a[_0x0f35('0x30')]);_0x1eb325['attributes']=_[_0x0f35('0x32')](_0x3e880a[_0x0f35('0x34')],qs[_0x0f35('0x35')](_0x35bf7f['query']['fields']));_0x1eb325[_0x0f35('0x33')]=_0x1eb325[_0x0f35('0x33')][_0x0f35('0x36')]?_0x1eb325[_0x0f35('0x33')]:_0x3e880a['model'];if(_0x35bf7f['query']['includeAll']){_0x1eb325[_0x0f35('0x41')]=[{'all':!![]}];}_0x1eb325=_[_0x0f35('0x3d')]({},_0x1eb325,_0x35bf7f[_0x0f35('0x3f')]);return db[_0x0f35('0x2a')]['find'](_0x1eb325)[_0x0f35('0x24')](handleEntityNotFound(_0x531dac,null))[_0x0f35('0x24')](respondWithResult(_0x531dac,null))[_0x0f35('0x44')](handleError(_0x531dac,null));};exports['create']=function(_0x2c18ae,_0x6eafce){return db[_0x0f35('0x2a')]['create'](_0x2c18ae['body'],{})[_0x0f35('0x24')](respondWithResult(_0x6eafce,0xc9))['catch'](handleError(_0x6eafce,null));};exports[_0x0f35('0x47')]=function(_0x1af57d,_0x28bc42){return db[_0x0f35('0x2a')]['bulkCreate'](_0x1af57d[_0x0f35('0x48')],{'raw':![],'individualHooks':!![]})[_0x0f35('0x24')](respondWithResult(_0x28bc42,0xc9))[_0x0f35('0x44')](handleError(_0x28bc42,null));};exports[_0x0f35('0x23')]=function(_0x219469,_0x4cac98){if(_0x219469[_0x0f35('0x48')]['id']){delete _0x219469[_0x0f35('0x48')]['id'];}return db[_0x0f35('0x2a')][_0x0f35('0x49')]({'where':{'id':_0x219469[_0x0f35('0x45')]['id']}})[_0x0f35('0x24')](handleEntityNotFound(_0x4cac98,null))[_0x0f35('0x24')](saveUpdates(_0x219469[_0x0f35('0x48')],null))['then'](respondWithResult(_0x4cac98,null))['catch'](handleError(_0x4cac98,null));};exports[_0x0f35('0x4a')]=function(_0xf9ad33,_0x235ce6){return db['AnalyticFieldReport']['find']({'where':{'id':_0xf9ad33[_0x0f35('0x45')]['id']}})['then'](handleEntityNotFound(_0x235ce6,null))[_0x0f35('0x24')](removeEntity(_0x235ce6,null))[_0x0f35('0x44')](handleError(_0x235ce6,null));};exports['bulkDestroy']=function(_0x5311ba,_0x28d29b){return db[_0x0f35('0x2a')]['destroy']({'where':{'id':_0x5311ba[_0x0f35('0x30')][_0x0f35('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x0f35('0x24')](respondWithResult(_0x28d29b,0xcc))[_0x0f35('0x44')](handleError(_0x28d29b,null));};exports[_0x0f35('0x4c')]=function(_0x29669a,_0x409a08,_0x281abd){return db[_0x0f35('0x4d')][_0x0f35('0x4e')]({'where':{'id':_0x29669a[_0x0f35('0x45')]['id']}})['then'](handleEntityNotFound(_0x409a08,null))[_0x0f35('0x24')](function(_0x1246cf){if(_0x1246cf){return db[_0x0f35('0x4f')]['transaction'](function(_0x1d803e){return db[_0x0f35('0x2a')][_0x0f35('0x4a')]({'where':{'CustomReportId':_0x29669a['params']['id']},'transaction':_0x1d803e})[_0x0f35('0x24')](function(_0x43e3ec){var _0x249072=_['map'](_0x29669a[_0x0f35('0x48')],function(_0x3ae1b2){delete _0x3ae1b2['id'];_0x3ae1b2['CustomReportId']=_0x29669a[_0x0f35('0x45')]['id'];return _0x3ae1b2;});return db['AnalyticFieldReport'][_0x0f35('0x47')](_0x249072,{'transaction':_0x1d803e});});})[_0x0f35('0x24')](function(){return db[_0x0f35('0x2a')][_0x0f35('0x42')]({'where':{'CustomReportId':_0x29669a[_0x0f35('0x45')]['id']}});});}})[_0x0f35('0x24')](respondWithResult(_0x409a08,null))[_0x0f35('0x44')](handleError(_0x409a08,null));}; \ No newline at end of file +var _0xa6c5=['keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','VIRTUAL','filter','AnalyticFieldReport','includeAll','include','rows','catch','show','merge','options','find','create','body','bulkCreate','update','params','bulkDestroy','ids','addFields','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x37bf7b,_0x857bca){var _0x4db72f=function(_0x7e56b){while(--_0x7e56b){_0x37bf7b['push'](_0x37bf7b['shift']());}};_0x4db72f(++_0x857bca);}(_0xa6c5,0x7a));var _0x5a6c=function(_0x5bdc0f,_0xd2ca59){_0x5bdc0f=_0x5bdc0f-0x0;var _0x318e07=_0xa6c5[_0x5bdc0f];return _0x318e07;};'use strict';var emlformat=require(_0x5a6c('0x0'));var rimraf=require(_0x5a6c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a6c('0x2'));var rp=require(_0x5a6c('0x3'));var moment=require(_0x5a6c('0x4'));var BPromise=require(_0x5a6c('0x5'));var Mustache=require(_0x5a6c('0x6'));var util=require(_0x5a6c('0x7'));var path=require(_0x5a6c('0x8'));var sox=require(_0x5a6c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5a6c('0xa'));var _=require('lodash');var squel=require(_0x5a6c('0xb'));var crypto=require(_0x5a6c('0xc'));var jsforce=require(_0x5a6c('0xd'));var deskjs=require(_0x5a6c('0xe'));var toCsv=require(_0x5a6c('0xf'));var querystring=require(_0x5a6c('0x10'));var Papa=require(_0x5a6c('0x11'));var Redis=require('ioredis');var authService=require(_0x5a6c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5a6c('0x13'));var hardwareService=require(_0x5a6c('0x14'));var logger=require(_0x5a6c('0x15'))('api');var utils=require(_0x5a6c('0x16'));var config=require(_0x5a6c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a6c('0x18'))['db'];function respondWithStatusCode(_0x38b4bd,_0x3315c6){_0x3315c6=_0x3315c6||0xcc;return function(_0x420fe4){if(_0x420fe4){return _0x38b4bd[_0x5a6c('0x19')](_0x3315c6);}return _0x38b4bd[_0x5a6c('0x1a')](_0x3315c6)[_0x5a6c('0x1b')]();};}function respondWithResult(_0x1c7346,_0x9baab){_0x9baab=_0x9baab||0xc8;return function(_0x227a11){if(_0x227a11){return _0x1c7346[_0x5a6c('0x1a')](_0x9baab)[_0x5a6c('0x1c')](_0x227a11);}};}function respondWithFilteredResult(_0x1bc710,_0x244c30){return function(_0x1305d4){if(_0x1305d4){var _0xfbb06c=typeof _0x244c30[_0x5a6c('0x1d')]==='undefined'&&typeof _0x244c30[_0x5a6c('0x1e')]==='undefined';var _0x8231fd=_0x1305d4[_0x5a6c('0x1f')];var _0xf82d73=_0xfbb06c?0x0:_0x244c30[_0x5a6c('0x1d')];var _0xa874f1=_0xfbb06c?_0x1305d4[_0x5a6c('0x1f')]:_0x244c30['offset']+_0x244c30['limit'];var _0x29840f;if(_0xa874f1>=_0x8231fd){_0xa874f1=_0x8231fd;_0x29840f=0xc8;}else{_0x29840f=0xce;}_0x1bc710[_0x5a6c('0x1a')](_0x29840f);return _0x1bc710[_0x5a6c('0x20')]('Content-Range',_0xf82d73+'-'+_0xa874f1+'/'+_0x8231fd)[_0x5a6c('0x1c')](_0x1305d4);}return null;};}function patchUpdates(_0x2a507a){return function(_0x40cdaa){try{jsonpatch[_0x5a6c('0x21')](_0x40cdaa,_0x2a507a,!![]);}catch(_0x46d974){return BPromise[_0x5a6c('0x22')](_0x46d974);}return _0x40cdaa['save']();};}function saveUpdates(_0x2f1dba,_0x59a70b){return function(_0x2040ea){if(_0x2040ea){return _0x2040ea['update'](_0x2f1dba)[_0x5a6c('0x23')](function(_0x4c84c5){return _0x4c84c5;});}return null;};}function removeEntity(_0x387b09,_0x595d63){return function(_0x564a2f){if(_0x564a2f){return _0x564a2f[_0x5a6c('0x24')]()['then'](function(){_0x387b09[_0x5a6c('0x1a')](0xcc)[_0x5a6c('0x1b')]();});}};}function handleEntityNotFound(_0x47fa2f,_0x35613a){return function(_0x379509){if(!_0x379509){_0x47fa2f[_0x5a6c('0x19')](0x194);}return _0x379509;};}function handleError(_0x390272,_0x33229c){_0x33229c=_0x33229c||0x1f4;return function(_0xbf1520){logger[_0x5a6c('0x25')](_0xbf1520['stack']);if(_0xbf1520['name']){delete _0xbf1520[_0x5a6c('0x26')];}_0x390272[_0x5a6c('0x1a')](_0x33229c)[_0x5a6c('0x27')](_0xbf1520);};}exports[_0x5a6c('0x28')]=function(_0x1347d4,_0x142c8e){var _0x4098b8={},_0x660e34={},_0x2fdf14={'count':0x0,'rows':[]};var _0x195dae=_[_0x5a6c('0x29')](db['AnalyticFieldReport'][_0x5a6c('0x2a')],function(_0x5c931e){return{'name':_0x5c931e[_0x5a6c('0x2b')],'type':_0x5c931e[_0x5a6c('0x2c')][_0x5a6c('0x2d')]};});_0x660e34['model']=_[_0x5a6c('0x29')](_0x195dae,_0x5a6c('0x26'));_0x660e34['query']=_[_0x5a6c('0x2e')](_0x1347d4[_0x5a6c('0x2f')]);_0x660e34['filters']=_[_0x5a6c('0x30')](_0x660e34[_0x5a6c('0x31')],_0x660e34[_0x5a6c('0x2f')]);_0x4098b8[_0x5a6c('0x32')]=_[_0x5a6c('0x30')](_0x660e34[_0x5a6c('0x31')],qs[_0x5a6c('0x33')](_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x33')]));_0x4098b8['attributes']=_0x4098b8[_0x5a6c('0x32')][_0x5a6c('0x34')]?_0x4098b8[_0x5a6c('0x32')]:_0x660e34[_0x5a6c('0x31')];if(!_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x35')](_0x5a6c('0x36'))){_0x4098b8[_0x5a6c('0x1e')]=qs[_0x5a6c('0x1e')](_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x1e')]);_0x4098b8[_0x5a6c('0x1d')]=qs[_0x5a6c('0x1d')](_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x1d')]);}_0x4098b8[_0x5a6c('0x37')]=qs[_0x5a6c('0x38')](_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x38')]);_0x4098b8[_0x5a6c('0x39')]=qs['filters'](_[_0x5a6c('0x3a')](_0x1347d4['query'],_0x660e34[_0x5a6c('0x3b')]),_0x195dae);if(_0x1347d4[_0x5a6c('0x2f')]['filter']){_0x4098b8[_0x5a6c('0x39')]=_['merge'](_0x4098b8[_0x5a6c('0x39')],{'$or':_[_0x5a6c('0x29')](_0x195dae,function(_0xbebc5c){if(_0xbebc5c['type']!==_0x5a6c('0x3c')){var _0x20017b={};_0x20017b[_0xbebc5c['name']]={'$like':'%'+_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x3d')]+'%'};return _0x20017b;}})});}_0x4098b8=_['merge']({},_0x4098b8,_0x1347d4['options']);var _0x596c5a={'where':_0x4098b8[_0x5a6c('0x39')]};return db[_0x5a6c('0x3e')]['count'](_0x596c5a)[_0x5a6c('0x23')](function(_0x3e7467){_0x2fdf14[_0x5a6c('0x1f')]=_0x3e7467;if(_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x3f')]){_0x4098b8[_0x5a6c('0x40')]=[{'all':!![]}];}return db[_0x5a6c('0x3e')]['findAll'](_0x4098b8);})['then'](function(_0x1bbf3a){_0x2fdf14[_0x5a6c('0x41')]=_0x1bbf3a;return _0x2fdf14;})['then'](respondWithFilteredResult(_0x142c8e,_0x4098b8))[_0x5a6c('0x42')](handleError(_0x142c8e,null));};exports[_0x5a6c('0x43')]=function(_0xb8a6a7,_0x4334eb){var _0x4cd59a={'raw':![],'where':{'id':_0xb8a6a7['params']['id']}},_0x414bde={};_0x414bde[_0x5a6c('0x31')]=_['keys'](db[_0x5a6c('0x3e')]['rawAttributes']);_0x414bde['query']=_['keys'](_0xb8a6a7['query']);_0x414bde[_0x5a6c('0x3b')]=_[_0x5a6c('0x30')](_0x414bde['model'],_0x414bde['query']);_0x4cd59a[_0x5a6c('0x32')]=_[_0x5a6c('0x30')](_0x414bde[_0x5a6c('0x31')],qs[_0x5a6c('0x33')](_0xb8a6a7[_0x5a6c('0x2f')][_0x5a6c('0x33')]));_0x4cd59a[_0x5a6c('0x32')]=_0x4cd59a[_0x5a6c('0x32')][_0x5a6c('0x34')]?_0x4cd59a[_0x5a6c('0x32')]:_0x414bde[_0x5a6c('0x31')];if(_0xb8a6a7[_0x5a6c('0x2f')][_0x5a6c('0x3f')]){_0x4cd59a[_0x5a6c('0x40')]=[{'all':!![]}];}_0x4cd59a=_[_0x5a6c('0x44')]({},_0x4cd59a,_0xb8a6a7[_0x5a6c('0x45')]);return db[_0x5a6c('0x3e')][_0x5a6c('0x46')](_0x4cd59a)[_0x5a6c('0x23')](handleEntityNotFound(_0x4334eb,null))[_0x5a6c('0x23')](respondWithResult(_0x4334eb,null))[_0x5a6c('0x42')](handleError(_0x4334eb,null));};exports[_0x5a6c('0x47')]=function(_0x781aa2,_0x496911){return db[_0x5a6c('0x3e')][_0x5a6c('0x47')](_0x781aa2[_0x5a6c('0x48')],{})['then'](respondWithResult(_0x496911,0xc9))['catch'](handleError(_0x496911,null));};exports[_0x5a6c('0x49')]=function(_0x44d64a,_0x3d0ccc){return db[_0x5a6c('0x3e')]['bulkCreate'](_0x44d64a[_0x5a6c('0x48')],{'raw':![],'individualHooks':!![]})[_0x5a6c('0x23')](respondWithResult(_0x3d0ccc,0xc9))[_0x5a6c('0x42')](handleError(_0x3d0ccc,null));};exports[_0x5a6c('0x4a')]=function(_0x18fe25,_0x320eb4){if(_0x18fe25[_0x5a6c('0x48')]['id']){delete _0x18fe25['body']['id'];}return db[_0x5a6c('0x3e')][_0x5a6c('0x46')]({'where':{'id':_0x18fe25[_0x5a6c('0x4b')]['id']}})[_0x5a6c('0x23')](handleEntityNotFound(_0x320eb4,null))[_0x5a6c('0x23')](saveUpdates(_0x18fe25[_0x5a6c('0x48')],null))[_0x5a6c('0x23')](respondWithResult(_0x320eb4,null))['catch'](handleError(_0x320eb4,null));};exports[_0x5a6c('0x24')]=function(_0x48054e,_0x50e6ad){return db[_0x5a6c('0x3e')]['find']({'where':{'id':_0x48054e['params']['id']}})[_0x5a6c('0x23')](handleEntityNotFound(_0x50e6ad,null))[_0x5a6c('0x23')](removeEntity(_0x50e6ad,null))[_0x5a6c('0x42')](handleError(_0x50e6ad,null));};exports[_0x5a6c('0x4c')]=function(_0x1ef635,_0xc652d8){return db['AnalyticFieldReport'][_0x5a6c('0x24')]({'where':{'id':_0x1ef635[_0x5a6c('0x2f')][_0x5a6c('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x5a6c('0x23')](respondWithResult(_0xc652d8,0xcc))['catch'](handleError(_0xc652d8,null));};exports[_0x5a6c('0x4e')]=function(_0x5eb248,_0x9fffce,_0xbb9f41){return db['AnalyticCustomReport'][_0x5a6c('0x4f')]({'where':{'id':_0x5eb248[_0x5a6c('0x4b')]['id']}})[_0x5a6c('0x23')](handleEntityNotFound(_0x9fffce,null))[_0x5a6c('0x23')](function(_0x1e5965){if(_0x1e5965){return db[_0x5a6c('0x50')][_0x5a6c('0x51')](function(_0x1c1cf4){return db[_0x5a6c('0x3e')][_0x5a6c('0x24')]({'where':{'CustomReportId':_0x5eb248[_0x5a6c('0x4b')]['id']},'transaction':_0x1c1cf4})[_0x5a6c('0x23')](function(_0x1355b4){var _0x3234bb=_[_0x5a6c('0x29')](_0x5eb248[_0x5a6c('0x48')],function(_0x2af1a1){delete _0x2af1a1['id'];_0x2af1a1[_0x5a6c('0x52')]=_0x5eb248[_0x5a6c('0x4b')]['id'];return _0x2af1a1;});return db[_0x5a6c('0x3e')][_0x5a6c('0x49')](_0x3234bb,{'transaction':_0x1c1cf4});});})[_0x5a6c('0x23')](function(){return db['AnalyticFieldReport'][_0x5a6c('0x53')]({'where':{'CustomReportId':_0x5eb248[_0x5a6c('0x4b')]['id']}});});}})[_0x5a6c('0x23')](respondWithResult(_0x9fffce,null))[_0x5a6c('0x42')](handleError(_0x9fffce,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 2265a9f..167ec6f 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.model.js +++ b/server/api/analyticFieldReport/analyticFieldReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdc1=['path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','moment'];(function(_0x258b00,_0x28e9b0){var _0x3ca676=function(_0xff2a4e){while(--_0xff2a4e){_0x258b00['push'](_0x258b00['shift']());}};_0x3ca676(++_0x28e9b0);}(_0xbdc1,0x13d));var _0x1bdc=function(_0x37745c,_0x4d4e32){_0x37745c=_0x37745c-0x0;var _0x508313=_0xbdc1[_0x37745c];return _0x508313;};'use strict';var _=require('lodash');var util=require(_0x1bdc('0x0'));var logger=require(_0x1bdc('0x1'))('api');var moment=require(_0x1bdc('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1bdc('0x3'));var rimraf=require(_0x1bdc('0x4'));var config=require('../../config/environment');var attributes=require(_0x1bdc('0x5'));module[_0x1bdc('0x6')]=function(_0x1f4aaf,_0x17160a){return _0x1f4aaf[_0x1bdc('0x7')](_0x1bdc('0x8'),attributes,{'tableName':_0x1bdc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe935=['./analyticFieldReport.attributes','exports','define','analytics_report_fields','util','moment','bluebird','path'];(function(_0x12e52b,_0x9fc7e7){var _0x414019=function(_0x388ecd){while(--_0x388ecd){_0x12e52b['push'](_0x12e52b['shift']());}};_0x414019(++_0x9fc7e7);}(_0xe935,0x1ec));var _0x5e93=function(_0x32b817,_0x31ebbe){_0x32b817=_0x32b817-0x0;var _0x3b624a=_0xe935[_0x32b817];return _0x3b624a;};'use strict';var _=require('lodash');var util=require(_0x5e93('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5e93('0x1'));var BPromise=require(_0x5e93('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e93('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5e93('0x4'));module[_0x5e93('0x5')]=function(_0x17ac6a,_0x37f60c){return _0x17ac6a[_0x5e93('0x6')]('AnalyticFieldReport',attributes,{'tableName':_0x5e93('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index b4bd38e..0d6bb45 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.rpc.js +++ b/server/api/analyticFieldReport/analyticFieldReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x791a=['then','request\x20sent','debug','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request'];(function(_0x1b5f76,_0x3943e2){var _0x167979=function(_0xa7c0d3){while(--_0xa7c0d3){_0x1b5f76['push'](_0x1b5f76['shift']());}};_0x167979(++_0x3943e2);}(_0x791a,0xc8));var _0xa791=function(_0x4ddc7a,_0x2ba072){_0x4ddc7a=_0x4ddc7a-0x0;var _0x4ba854=_0x791a[_0x4ddc7a];return _0x4ba854;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa791('0x0'));var BPromise=require(_0xa791('0x1'));var rs=require(_0xa791('0x2'));var fs=require('fs');var Redis=require(_0xa791('0x3'));var db=require(_0xa791('0x4'))['db'];var utils=require(_0xa791('0x5'));var logger=require(_0xa791('0x6'))(_0xa791('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa791('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x501933,_0x2b0882,_0x5182ec){return new BPromise(function(_0x5ab75d,_0x14a216){return client[_0xa791('0x9')](_0x501933,_0x5182ec)[_0xa791('0xa')](function(_0x332aae){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x2b0882,_0xa791('0xb'));logger[_0xa791('0xc')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x2b0882,_0xa791('0xb'),JSON[_0xa791('0xd')](_0x332aae));if(_0x332aae[_0xa791('0xe')]){if(_0x332aae[_0xa791('0xe')][_0xa791('0xf')]===0x1f4){logger[_0xa791('0xe')](_0xa791('0x10'),_0x2b0882,_0x332aae['error'][_0xa791('0x11')]);return _0x14a216(_0x332aae[_0xa791('0xe')]['message']);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x2b0882,_0x332aae[_0xa791('0xe')][_0xa791('0x11')]);return _0x5ab75d(_0x332aae['error'][_0xa791('0x11')]);}else{logger[_0xa791('0x12')](_0xa791('0x10'),_0x2b0882,'request\x20sent');_0x5ab75d(_0x332aae[_0xa791('0x13')][_0xa791('0x11')]);}})[_0xa791('0x14')](function(_0x5ba565){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x2b0882,_0x5ba565);_0x14a216(_0x5ba565);});});} \ No newline at end of file +var _0x8db1=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x63fe28,_0x15c142){var _0x555070=function(_0x415f8e){while(--_0x415f8e){_0x63fe28['push'](_0x63fe28['shift']());}};_0x555070(++_0x15c142);}(_0x8db1,0x122));var _0x18db=function(_0x1f3681,_0x43cf48){_0x1f3681=_0x1f3681-0x0;var _0x4911fd=_0x8db1[_0x1f3681];return _0x4911fd;};'use strict';var _=require(_0x18db('0x0'));var util=require(_0x18db('0x1'));var moment=require(_0x18db('0x2'));var BPromise=require(_0x18db('0x3'));var rs=require(_0x18db('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x18db('0x5'))['db'];var utils=require(_0x18db('0x6'));var logger=require(_0x18db('0x7'))('rpc');var config=require(_0x18db('0x8'));var jayson=require(_0x18db('0x9'));var client=jayson['client'][_0x18db('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f433e,_0x279074,_0xd25524){return new BPromise(function(_0x2aca61,_0x2f9821){return client[_0x18db('0xb')](_0x5f433e,_0xd25524)[_0x18db('0xc')](function(_0x1d9117){logger[_0x18db('0xd')](_0x18db('0xe'),_0x279074,_0x18db('0xf'));logger['debug'](_0x18db('0x10'),_0x279074,'request\x20sent',JSON[_0x18db('0x11')](_0x1d9117));if(_0x1d9117[_0x18db('0x12')]){if(_0x1d9117['error'][_0x18db('0x13')]===0x1f4){logger[_0x18db('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x279074,_0x1d9117[_0x18db('0x12')][_0x18db('0x14')]);return _0x2f9821(_0x1d9117[_0x18db('0x12')][_0x18db('0x14')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x279074,_0x1d9117[_0x18db('0x12')][_0x18db('0x14')]);return _0x2aca61(_0x1d9117[_0x18db('0x12')][_0x18db('0x14')]);}else{logger[_0x18db('0xd')](_0x18db('0xe'),_0x279074,_0x18db('0xf'));_0x2aca61(_0x1d9117['result'][_0x18db('0x14')]);}})[_0x18db('0x15')](function(_0x2bfabe){logger[_0x18db('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x279074,_0x2bfabe);_0x2f9821(_0x2bfabe);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index aa54cbf..7e3df2f 100644 --- a/server/api/analyticFieldReport/index.js +++ b/server/api/analyticFieldReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x114bb6,_0x196e2f){var _0x2696f7=function(_0x755373){while(--_0x755373){_0x114bb6['push'](_0x114bb6['shift']());}};_0x2696f7(++_0x196e2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0xfdc000,_0x678841){var _0x15a615=function(_0x4a49c7){while(--_0x4a49c7){_0xfdc000['push'](_0xfdc000['shift']());}};_0x15a615(++_0x678841);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 998f167..82a9375 100644 --- a/server/api/analyticMetric/analyticMetric.attributes.js +++ b/server/api/analyticMetric/analyticMetric.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x85cf=['name','TEXT','exports','STRING'];(function(_0x4e7a7b,_0x2b2e3d){var _0x3488d3=function(_0x584c30){while(--_0x584c30){_0x4e7a7b['push'](_0x4e7a7b['shift']());}};_0x3488d3(++_0x2b2e3d);}(_0x85cf,0x76));var _0xf85c=function(_0x193685,_0x5f134a){_0x193685=_0x193685-0x0;var _0x4ae8f8=_0x85cf[_0x193685];return _0x4ae8f8;};'use strict';var Sequelize=require('sequelize');module[_0xf85c('0x0')]={'name':{'type':Sequelize[_0xf85c('0x1')],'allowNull':![],'unique':_0xf85c('0x2')},'table':{'type':Sequelize[_0xf85c('0x1')]},'metric':{'type':Sequelize[_0xf85c('0x3')]},'description':{'type':Sequelize[_0xf85c('0x1')]}}; \ No newline at end of file +var _0x9086=['STRING','TEXT','sequelize','exports','name'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9086,0x10b));var _0x6908=function(_0x5b51d2,_0xd3846c){_0x5b51d2=_0x5b51d2-0x0;var _0x1ecc32=_0x9086[_0x5b51d2];return _0x1ecc32;};'use strict';var Sequelize=require(_0x6908('0x0'));module[_0x6908('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6908('0x2')},'table':{'type':Sequelize[_0x6908('0x3')]},'metric':{'type':Sequelize[_0x6908('0x4')]},'description':{'type':Sequelize[_0x6908('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 8a48c4d..898b1ce 100644 --- a/server/api/analyticMetric/analyticMetric.controller.js +++ b/server/api/analyticMetric/analyticMetric.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x16effd,_0x4e6f8c){var _0x36b4c3=function(_0xef9c56){while(--_0xef9c56){_0x16effd['push'](_0x16effd['shift']());}};_0x36b4c3(++_0x4e6f8c);}(_0x98a8,0x12c));var _0x898a=function(_0xfb77d,_0x4d0694){_0xfb77d=_0xfb77d-0x0;var _0x1d1296=_0x98a8[_0xfb77d];return _0x1d1296;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));}; \ No newline at end of file +var _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1e1f74,_0x190226){var _0x54139e=function(_0x19bea8){while(--_0x19bea8){_0x1e1f74['push'](_0x1e1f74['shift']());}};_0x54139e(++_0x190226);}(_0x55ca,0x126));var _0xa55c=function(_0x17cb63,_0x4c0e90){_0x17cb63=_0x17cb63-0x0;var _0x4340bc=_0x55ca[_0x17cb63];return _0x4340bc;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 533345e..37f88d9 100644 --- a/server/api/analyticMetric/analyticMetric.model.js +++ b/server/api/analyticMetric/analyticMetric.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ad5=['rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8ad5,0xf1));var _0x58ad=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x8ad5[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x58ad('0x0'));var util=require(_0x58ad('0x1'));var logger=require(_0x58ad('0x2'))(_0x58ad('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x58ad('0x4'));var fs=require('fs');var path=require(_0x58ad('0x5'));var rimraf=require(_0x58ad('0x6'));var config=require(_0x58ad('0x7'));var attributes=require(_0x58ad('0x8'));module[_0x58ad('0x9')]=function(_0x51d560,_0x5888f7){return _0x51d560[_0x58ad('0xa')](_0x58ad('0xb'),attributes,{'tableName':_0x58ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2f5=['../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics','lodash','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x54da67,_0x283c96){var _0x3aed24=function(_0x52a97f){while(--_0x52a97f){_0x54da67['push'](_0x54da67['shift']());}};_0x3aed24(++_0x283c96);}(_0xd2f5,0x144));var _0x5d2f=function(_0x236aff,_0x3ba6cb){_0x236aff=_0x236aff-0x0;var _0xb7459a=_0xd2f5[_0x236aff];return _0xb7459a;};'use strict';var _=require(_0x5d2f('0x0'));var util=require('util');var logger=require(_0x5d2f('0x1'))('api');var moment=require(_0x5d2f('0x2'));var BPromise=require('bluebird');var rp=require(_0x5d2f('0x3'));var fs=require('fs');var path=require(_0x5d2f('0x4'));var rimraf=require(_0x5d2f('0x5'));var config=require(_0x5d2f('0x6'));var attributes=require(_0x5d2f('0x7'));module[_0x5d2f('0x8')]=function(_0x2392df,_0x16e9fa){return _0x2392df['define'](_0x5d2f('0x9'),attributes,{'tableName':_0x5d2f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 2d04b61..3c14241 100644 --- a/server/api/analyticMetric/analyticMetric.rpc.js +++ b/server/api/analyticMetric/analyticMetric.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd7e=['error','AnalyticMetric,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x381375,_0x1557df){var _0x2cfe1c=function(_0x2a2281){while(--_0x2a2281){_0x381375['push'](_0x381375['shift']());}};_0x2cfe1c(++_0x1557df);}(_0xdd7e,0x17d));var _0xedd7=function(_0x6fea4a,_0x20fa86){_0x6fea4a=_0x6fea4a-0x0;var _0x138fe3=_0xdd7e[_0x6fea4a];return _0x138fe3;};'use strict';var _=require(_0xedd7('0x0'));var util=require(_0xedd7('0x1'));var moment=require(_0xedd7('0x2'));var BPromise=require('bluebird');var rs=require(_0xedd7('0x3'));var fs=require('fs');var Redis=require(_0xedd7('0x4'));var db=require(_0xedd7('0x5'))['db'];var utils=require(_0xedd7('0x6'));var logger=require(_0xedd7('0x7'))(_0xedd7('0x8'));var config=require(_0xedd7('0x9'));var jayson=require(_0xedd7('0xa'));var client=jayson[_0xedd7('0xb')][_0xedd7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x178df4,_0x59d1cc,_0x1441be){return new BPromise(function(_0x2c0fb1,_0x4fa5b3){return client[_0xedd7('0xd')](_0x178df4,_0x1441be)[_0xedd7('0xe')](function(_0x54ed2b){logger[_0xedd7('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x59d1cc,'request\x20sent');logger[_0xedd7('0x10')](_0xedd7('0x11'),_0x59d1cc,'request\x20sent',JSON[_0xedd7('0x12')](_0x54ed2b));if(_0x54ed2b[_0xedd7('0x13')]){if(_0x54ed2b[_0xedd7('0x13')]['code']===0x1f4){logger[_0xedd7('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x59d1cc,_0x54ed2b[_0xedd7('0x13')]['message']);return _0x4fa5b3(_0x54ed2b[_0xedd7('0x13')]['message']);}logger['error'](_0xedd7('0x14'),_0x59d1cc,_0x54ed2b[_0xedd7('0x13')][_0xedd7('0x15')]);return _0x2c0fb1(_0x54ed2b[_0xedd7('0x13')]['message']);}else{logger[_0xedd7('0xf')](_0xedd7('0x14'),_0x59d1cc,_0xedd7('0x16'));_0x2c0fb1(_0x54ed2b[_0xedd7('0x17')][_0xedd7('0x15')]);}})[_0xedd7('0x18')](function(_0xdc598d){logger['error'](_0xedd7('0x14'),_0x59d1cc,_0xdc598d);_0x4fa5b3(_0xdc598d);});});} \ No newline at end of file +var _0xd8ec=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x552cf8,_0x493a58){var _0x5b0eca=function(_0xbc6b6d){while(--_0xbc6b6d){_0x552cf8['push'](_0x552cf8['shift']());}};_0x5b0eca(++_0x493a58);}(_0xd8ec,0xe9));var _0xcd8e=function(_0x1aa59b,_0x26612c){_0x1aa59b=_0x1aa59b-0x0;var _0x33011c=_0xd8ec[_0x1aa59b];return _0x33011c;};'use strict';var _=require(_0xcd8e('0x0'));var util=require('util');var moment=require(_0xcd8e('0x1'));var BPromise=require(_0xcd8e('0x2'));var rs=require(_0xcd8e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd8e('0x4'))['db'];var utils=require(_0xcd8e('0x5'));var logger=require(_0xcd8e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xcd8e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x58f571,_0x3202bc,_0x355a9e){return new BPromise(function(_0x2d0c66,_0x237bbf){return client[_0xcd8e('0x8')](_0x58f571,_0x355a9e)[_0xcd8e('0x9')](function(_0x57632e){logger[_0xcd8e('0xa')](_0xcd8e('0xb'),_0x3202bc,_0xcd8e('0xc'));logger[_0xcd8e('0xd')](_0xcd8e('0xe'),_0x3202bc,_0xcd8e('0xc'),JSON[_0xcd8e('0xf')](_0x57632e));if(_0x57632e[_0xcd8e('0x10')]){if(_0x57632e[_0xcd8e('0x10')][_0xcd8e('0x11')]===0x1f4){logger[_0xcd8e('0x10')](_0xcd8e('0xb'),_0x3202bc,_0x57632e[_0xcd8e('0x10')]['message']);return _0x237bbf(_0x57632e[_0xcd8e('0x10')][_0xcd8e('0x12')]);}logger[_0xcd8e('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x3202bc,_0x57632e[_0xcd8e('0x10')][_0xcd8e('0x12')]);return _0x2d0c66(_0x57632e['error']['message']);}else{logger['info'](_0xcd8e('0xb'),_0x3202bc,'request\x20sent');_0x2d0c66(_0x57632e[_0xcd8e('0x13')][_0xcd8e('0x12')]);}})[_0xcd8e('0x14')](function(_0xacf780){logger[_0xcd8e('0x10')](_0xcd8e('0xb'),_0x3202bc,_0xacf780);_0x237bbf(_0xacf780);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 07510a4..ac38e59 100644 --- a/server/api/analyticMetric/index.js +++ b/server/api/analyticMetric/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5447=['/:id','show','create','put','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index'];(function(_0x54917,_0x50f577){var _0x52f18a=function(_0x382f0c){while(--_0x382f0c){_0x54917['push'](_0x54917['shift']());}};_0x52f18a(++_0x50f577);}(_0x5447,0xf1));var _0x7544=function(_0x4ddacb,_0x780c1c){_0x4ddacb=_0x4ddacb-0x0;var _0xaa8333=_0x5447[_0x4ddacb];return _0xaa8333;};'use strict';var multer=require(_0x7544('0x0'));var util=require('util');var path=require(_0x7544('0x1'));var timeout=require(_0x7544('0x2'));var express=require('express');var router=express[_0x7544('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7544('0x4'));var interaction=require(_0x7544('0x5'));var config=require(_0x7544('0x6'));var controller=require(_0x7544('0x7'));router[_0x7544('0x8')]('/',auth[_0x7544('0x9')](),controller[_0x7544('0xa')]);router[_0x7544('0x8')](_0x7544('0xb'),auth[_0x7544('0x9')](),controller[_0x7544('0xc')]);router['post']('/',auth[_0x7544('0x9')](),controller[_0x7544('0xd')]);router[_0x7544('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7544('0xf')](_0x7544('0xb'),auth[_0x7544('0x9')](),controller[_0x7544('0x10')]);module[_0x7544('0x11')]=router; \ No newline at end of file +var _0x0f4d=['./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2233eb,_0x25615a){var _0x4d3d6a=function(_0x5bb90e){while(--_0x5bb90e){_0x2233eb['push'](_0x2233eb['shift']());}};_0x4d3d6a(++_0x25615a);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x20fdad,_0x1c32de){_0x20fdad=_0x20fdad-0x0;var _0x3233ff=_0x0f4d[_0x20fdad];return _0x3233ff;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd0f4('0x0'));var express=require('express');var router=express[_0xd0f4('0x1')]();var fs_extra=require(_0xd0f4('0x2'));var auth=require(_0xd0f4('0x3'));var interaction=require(_0xd0f4('0x4'));var config=require(_0xd0f4('0x5'));var controller=require(_0xd0f4('0x6'));router[_0xd0f4('0x7')]('/',auth[_0xd0f4('0x8')](),controller['index']);router[_0xd0f4('0x7')](_0xd0f4('0x9'),auth['isAuthenticated'](),controller[_0xd0f4('0xa')]);router[_0xd0f4('0xb')]('/',auth['isAuthenticated'](),controller[_0xd0f4('0xc')]);router[_0xd0f4('0xd')]('/:id',auth[_0xd0f4('0x8')](),controller[_0xd0f4('0xe')]);router[_0xd0f4('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xd0f4('0x10')]);module[_0xd0f4('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 80b40c6..ead6a20 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js +++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa65e=['TEXT','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa65e,0xd1));var _0xea65=function(_0x46d14b,_0x147907){_0x46d14b=_0x46d14b-0x0;var _0x367dfd=_0xa65e[_0x46d14b];return _0x367dfd;};'use strict';var Sequelize=require('sequelize');module[_0xea65('0x0')]={'tree':{'type':Sequelize[_0xea65('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x64de=['sequelize'];(function(_0x2c32de,_0x316008){var _0x1b7a6d=function(_0x5d63f9){while(--_0x5d63f9){_0x2c32de['push'](_0x2c32de['shift']());}};_0x1b7a6d(++_0x316008);}(_0x64de,0x10f));var _0xe64d=function(_0x11b6b8,_0x276037){_0x11b6b8=_0x11b6b8-0x0;var _0x27a952=_0x64de[_0x11b6b8];return _0x27a952;};'use strict';var Sequelize=require(_0xe64d('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 053b30c..cb5abee 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.controller.js +++ b/server/api/analyticTreeReport/analyticTreeReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa818=['error','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','end'];(function(_0x448f8,_0x2aa1d7){var _0xa73126=function(_0x1fcafa){while(--_0x1fcafa){_0x448f8['push'](_0x448f8['shift']());}};_0xa73126(++_0x2aa1d7);}(_0xa818,0x1d1));var _0x8a81=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xa818[_0x3e2fcf];return _0x497db7;};'use strict';var emlformat=require(_0x8a81('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a81('0x1'));var jsonpatch=require(_0x8a81('0x2'));var rp=require(_0x8a81('0x3'));var moment=require(_0x8a81('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8a81('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8a81('0x6'));var ejs=require(_0x8a81('0x7'));var fs=require('fs');var fs_extra=require(_0x8a81('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8a81('0x9'));var deskjs=require(_0x8a81('0xa'));var toCsv=require(_0x8a81('0x6'));var querystring=require(_0x8a81('0xb'));var Papa=require(_0x8a81('0xc'));var Redis=require('ioredis');var authService=require(_0x8a81('0xd'));var qs=require(_0x8a81('0xe'));var as=require(_0x8a81('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a81('0x10'))(_0x8a81('0x11'));var utils=require('../../config/utils');var config=require(_0x8a81('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x153d0c,_0x1598a8){_0x1598a8=_0x1598a8||0xcc;return function(_0x4fd8e7){if(_0x4fd8e7){return _0x153d0c[_0x8a81('0x13')](_0x1598a8);}return _0x153d0c[_0x8a81('0x14')](_0x1598a8)['end']();};}function respondWithResult(_0xfaa27e,_0x5087e8){_0x5087e8=_0x5087e8||0xc8;return function(_0x490a6e){if(_0x490a6e){return _0xfaa27e[_0x8a81('0x14')](_0x5087e8)[_0x8a81('0x15')](_0x490a6e);}};}function respondWithFilteredResult(_0x10591e,_0x56697d){return function(_0x1b3e11){if(_0x1b3e11){var _0x47eebe=typeof _0x56697d[_0x8a81('0x16')]==='undefined'&&typeof _0x56697d[_0x8a81('0x17')]==='undefined';var _0x35ad54=_0x1b3e11[_0x8a81('0x18')];var _0x3420e9=_0x47eebe?0x0:_0x56697d['offset'];var _0x417aa4=_0x47eebe?_0x1b3e11[_0x8a81('0x18')]:_0x56697d[_0x8a81('0x16')]+_0x56697d['limit'];var _0x5eda26;if(_0x417aa4>=_0x35ad54){_0x417aa4=_0x35ad54;_0x5eda26=0xc8;}else{_0x5eda26=0xce;}_0x10591e['status'](_0x5eda26);return _0x10591e[_0x8a81('0x19')](_0x8a81('0x1a'),_0x3420e9+'-'+_0x417aa4+'/'+_0x35ad54)[_0x8a81('0x15')](_0x1b3e11);}return null;};}function patchUpdates(_0x345148){return function(_0x3be610){try{jsonpatch['apply'](_0x3be610,_0x345148,!![]);}catch(_0x2aff7b){return BPromise[_0x8a81('0x1b')](_0x2aff7b);}return _0x3be610[_0x8a81('0x1c')]();};}function saveUpdates(_0x1def2a,_0x38e2b5){return function(_0x1569b2){if(_0x1569b2){return _0x1569b2[_0x8a81('0x1d')](_0x1def2a)[_0x8a81('0x1e')](function(_0x46cb3a){return _0x46cb3a;});}return null;};}function removeEntity(_0x5a1e61,_0x2515f4){return function(_0xf7bc7c){if(_0xf7bc7c){return _0xf7bc7c['destroy']()[_0x8a81('0x1e')](function(){_0x5a1e61[_0x8a81('0x14')](0xcc)[_0x8a81('0x1f')]();});}};}function handleEntityNotFound(_0x1568dc,_0x2cd7f7){return function(_0x38e801){if(!_0x38e801){_0x1568dc[_0x8a81('0x13')](0x194);}return _0x38e801;};}function handleError(_0xbc6979,_0x3255cc){_0x3255cc=_0x3255cc||0x1f4;return function(_0x17b2d0){logger[_0x8a81('0x20')](_0x17b2d0[_0x8a81('0x21')]);if(_0x17b2d0[_0x8a81('0x22')]){delete _0x17b2d0[_0x8a81('0x22')];}_0xbc6979[_0x8a81('0x14')](_0x3255cc)[_0x8a81('0x23')](_0x17b2d0);};}exports[_0x8a81('0x24')]=function(_0x18ee84,_0x1112a5){var _0x56c0bb={},_0x59aee5={},_0x134f45={'count':0x0,'rows':[]};var _0x2199da=_[_0x8a81('0x25')](db[_0x8a81('0x26')]['rawAttributes'],function(_0x4d72aa){return{'name':_0x4d72aa[_0x8a81('0x27')],'type':_0x4d72aa[_0x8a81('0x28')][_0x8a81('0x29')]};});_0x59aee5[_0x8a81('0x2a')]=_[_0x8a81('0x25')](_0x2199da,'name');_0x59aee5[_0x8a81('0x2b')]=_['keys'](_0x18ee84[_0x8a81('0x2b')]);_0x59aee5[_0x8a81('0x2c')]=_[_0x8a81('0x2d')](_0x59aee5['model'],_0x59aee5[_0x8a81('0x2b')]);_0x56c0bb['attributes']=_[_0x8a81('0x2d')](_0x59aee5[_0x8a81('0x2a')],qs['fields'](_0x18ee84[_0x8a81('0x2b')][_0x8a81('0x2e')]));_0x56c0bb[_0x8a81('0x2f')]=_0x56c0bb['attributes'][_0x8a81('0x30')]?_0x56c0bb['attributes']:_0x59aee5[_0x8a81('0x2a')];if(!_0x18ee84['query']['hasOwnProperty'](_0x8a81('0x31'))){_0x56c0bb['limit']=qs[_0x8a81('0x17')](_0x18ee84[_0x8a81('0x2b')][_0x8a81('0x17')]);_0x56c0bb['offset']=qs['offset'](_0x18ee84['query'][_0x8a81('0x16')]);}_0x56c0bb[_0x8a81('0x32')]=qs[_0x8a81('0x33')](_0x18ee84['query']['sort']);_0x56c0bb['where']=qs[_0x8a81('0x2c')](_[_0x8a81('0x34')](_0x18ee84[_0x8a81('0x2b')],_0x59aee5[_0x8a81('0x2c')]),_0x2199da);if(_0x18ee84['query'][_0x8a81('0x35')]){_0x56c0bb['where']=_[_0x8a81('0x36')](_0x56c0bb[_0x8a81('0x37')],{'$or':_['map'](_0x2199da,function(_0xbedea1){if(_0xbedea1[_0x8a81('0x28')]!==_0x8a81('0x38')){var _0x5644fa={};_0x5644fa[_0xbedea1[_0x8a81('0x22')]]={'$like':'%'+_0x18ee84['query']['filter']+'%'};return _0x5644fa;}})});}_0x56c0bb=_['merge']({},_0x56c0bb,_0x18ee84[_0x8a81('0x39')]);var _0x1b468e={'where':_0x56c0bb['where']};return db[_0x8a81('0x26')]['count'](_0x1b468e)[_0x8a81('0x1e')](function(_0x1bef5d){_0x134f45[_0x8a81('0x18')]=_0x1bef5d;if(_0x18ee84[_0x8a81('0x2b')][_0x8a81('0x3a')]){_0x56c0bb[_0x8a81('0x3b')]=[{'all':!![]}];}return db[_0x8a81('0x26')][_0x8a81('0x3c')](_0x56c0bb);})['then'](function(_0x2b0cb0){_0x134f45[_0x8a81('0x3d')]=_0x2b0cb0;return _0x134f45;})[_0x8a81('0x1e')](respondWithFilteredResult(_0x1112a5,_0x56c0bb))[_0x8a81('0x3e')](handleError(_0x1112a5,null));};exports[_0x8a81('0x3f')]=function(_0x3a7889,_0x5beb19){var _0x3648a8={'raw':!![],'where':{'id':_0x3a7889[_0x8a81('0x40')]['id']}},_0xda607={};_0xda607['model']=_[_0x8a81('0x41')](db[_0x8a81('0x26')][_0x8a81('0x42')]);_0xda607[_0x8a81('0x2b')]=_[_0x8a81('0x41')](_0x3a7889[_0x8a81('0x2b')]);_0xda607[_0x8a81('0x2c')]=_[_0x8a81('0x2d')](_0xda607[_0x8a81('0x2a')],_0xda607[_0x8a81('0x2b')]);_0x3648a8[_0x8a81('0x2f')]=_[_0x8a81('0x2d')](_0xda607['model'],qs[_0x8a81('0x2e')](_0x3a7889['query'][_0x8a81('0x2e')]));_0x3648a8[_0x8a81('0x2f')]=_0x3648a8[_0x8a81('0x2f')][_0x8a81('0x30')]?_0x3648a8[_0x8a81('0x2f')]:_0xda607[_0x8a81('0x2a')];if(_0x3a7889[_0x8a81('0x2b')]['includeAll']){_0x3648a8[_0x8a81('0x3b')]=[{'all':!![]}];}_0x3648a8=_['merge']({},_0x3648a8,_0x3a7889[_0x8a81('0x39')]);return db[_0x8a81('0x26')][_0x8a81('0x43')](_0x3648a8)[_0x8a81('0x1e')](handleEntityNotFound(_0x5beb19,null))['then'](respondWithResult(_0x5beb19,null))[_0x8a81('0x3e')](handleError(_0x5beb19,null));};exports[_0x8a81('0x44')]=function(_0x438e96,_0x20004e){return db[_0x8a81('0x26')][_0x8a81('0x44')](_0x438e96['body'],{})[_0x8a81('0x1e')](respondWithResult(_0x20004e,0xc9))[_0x8a81('0x3e')](handleError(_0x20004e,null));};exports[_0x8a81('0x1d')]=function(_0x2eefd0,_0x597256){if(_0x2eefd0['body']['id']){delete _0x2eefd0[_0x8a81('0x45')]['id'];}return db[_0x8a81('0x26')][_0x8a81('0x43')]({'where':{'id':_0x2eefd0['params']['id']}})[_0x8a81('0x1e')](handleEntityNotFound(_0x597256,null))[_0x8a81('0x1e')](saveUpdates(_0x2eefd0[_0x8a81('0x45')],null))[_0x8a81('0x1e')](respondWithResult(_0x597256,null))[_0x8a81('0x3e')](handleError(_0x597256,null));};exports[_0x8a81('0x46')]=function(_0x256f69,_0xdbd13c){return db['AnalyticTreeReport'][_0x8a81('0x43')]({'where':{'id':_0x256f69[_0x8a81('0x40')]['id']}})[_0x8a81('0x1e')](handleEntityNotFound(_0xdbd13c,null))['then'](removeEntity(_0xdbd13c,null))[_0x8a81('0x3e')](handleError(_0xdbd13c,null));}; \ No newline at end of file +var _0x3797=['../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','Content-Range','apply','reject','update','then','error','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch'];(function(_0x842858,_0x3a3ca0){var _0x46c2a2=function(_0x47f795){while(--_0x47f795){_0x842858['push'](_0x842858['shift']());}};_0x46c2a2(++_0x3a3ca0);}(_0x3797,0x7c));var _0x7379=function(_0x4a7a41,_0x48821c){_0x4a7a41=_0x4a7a41-0x0;var _0x356dfa=_0x3797[_0x4a7a41];return _0x356dfa;};'use strict';var emlformat=require(_0x7379('0x0'));var rimraf=require(_0x7379('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7379('0x2'));var rp=require(_0x7379('0x3'));var moment=require(_0x7379('0x4'));var BPromise=require(_0x7379('0x5'));var Mustache=require(_0x7379('0x6'));var util=require(_0x7379('0x7'));var path=require(_0x7379('0x8'));var sox=require(_0x7379('0x9'));var csv=require(_0x7379('0xa'));var ejs=require(_0x7379('0xb'));var fs=require('fs');var fs_extra=require(_0x7379('0xc'));var _=require('lodash');var squel=require(_0x7379('0xd'));var crypto=require(_0x7379('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7379('0xf'));var toCsv=require(_0x7379('0xa'));var querystring=require(_0x7379('0x10'));var Papa=require(_0x7379('0x11'));var Redis=require(_0x7379('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7379('0x13'));var hardwareService=require(_0x7379('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x7379('0x15'));var config=require(_0x7379('0x16'));var licenseUtil=require(_0x7379('0x17'));var db=require(_0x7379('0x18'))['db'];function respondWithStatusCode(_0x2cf0a4,_0xe92620){_0xe92620=_0xe92620||0xcc;return function(_0x1c4223){if(_0x1c4223){return _0x2cf0a4[_0x7379('0x19')](_0xe92620);}return _0x2cf0a4[_0x7379('0x1a')](_0xe92620)[_0x7379('0x1b')]();};}function respondWithResult(_0x47b43f,_0xb378c4){_0xb378c4=_0xb378c4||0xc8;return function(_0x223c06){if(_0x223c06){return _0x47b43f[_0x7379('0x1a')](_0xb378c4)[_0x7379('0x1c')](_0x223c06);}};}function respondWithFilteredResult(_0x1c4676,_0x339533){return function(_0x24eff1){if(_0x24eff1){var _0x5299bf=typeof _0x339533['offset']==='undefined'&&typeof _0x339533[_0x7379('0x1d')]===_0x7379('0x1e');var _0x9f1756=_0x24eff1[_0x7379('0x1f')];var _0x532a47=_0x5299bf?0x0:_0x339533['offset'];var _0x2d372c=_0x5299bf?_0x24eff1[_0x7379('0x1f')]:_0x339533['offset']+_0x339533[_0x7379('0x1d')];var _0x71e53f;if(_0x2d372c>=_0x9f1756){_0x2d372c=_0x9f1756;_0x71e53f=0xc8;}else{_0x71e53f=0xce;}_0x1c4676[_0x7379('0x1a')](_0x71e53f);return _0x1c4676['set'](_0x7379('0x20'),_0x532a47+'-'+_0x2d372c+'/'+_0x9f1756)['json'](_0x24eff1);}return null;};}function patchUpdates(_0xb5a555){return function(_0x3303a3){try{jsonpatch[_0x7379('0x21')](_0x3303a3,_0xb5a555,!![]);}catch(_0x339790){return BPromise[_0x7379('0x22')](_0x339790);}return _0x3303a3['save']();};}function saveUpdates(_0x46d429,_0x12f9c4){return function(_0x1a59e8){if(_0x1a59e8){return _0x1a59e8[_0x7379('0x23')](_0x46d429)[_0x7379('0x24')](function(_0x508517){return _0x508517;});}return null;};}function removeEntity(_0x3db25e,_0x46b607){return function(_0x240569){if(_0x240569){return _0x240569['destroy']()['then'](function(){_0x3db25e[_0x7379('0x1a')](0xcc)[_0x7379('0x1b')]();});}};}function handleEntityNotFound(_0x14811b,_0x33a2f3){return function(_0x1cde16){if(!_0x1cde16){_0x14811b[_0x7379('0x19')](0x194);}return _0x1cde16;};}function handleError(_0x24e428,_0xdcf699){_0xdcf699=_0xdcf699||0x1f4;return function(_0xe50644){logger[_0x7379('0x25')](_0xe50644['stack']);if(_0xe50644[_0x7379('0x26')]){delete _0xe50644[_0x7379('0x26')];}_0x24e428[_0x7379('0x1a')](_0xdcf699)['send'](_0xe50644);};}exports[_0x7379('0x27')]=function(_0x102d46,_0x2f0677){var _0x104827={},_0x37bd63={},_0x2cb9c5={'count':0x0,'rows':[]};var _0x813106=_[_0x7379('0x28')](db[_0x7379('0x29')][_0x7379('0x2a')],function(_0xd11f67){return{'name':_0xd11f67[_0x7379('0x2b')],'type':_0xd11f67[_0x7379('0x2c')][_0x7379('0x2d')]};});_0x37bd63[_0x7379('0x2e')]=_[_0x7379('0x28')](_0x813106,_0x7379('0x26'));_0x37bd63[_0x7379('0x2f')]=_[_0x7379('0x30')](_0x102d46['query']);_0x37bd63['filters']=_[_0x7379('0x31')](_0x37bd63[_0x7379('0x2e')],_0x37bd63[_0x7379('0x2f')]);_0x104827[_0x7379('0x32')]=_[_0x7379('0x31')](_0x37bd63[_0x7379('0x2e')],qs[_0x7379('0x33')](_0x102d46[_0x7379('0x2f')][_0x7379('0x33')]));_0x104827['attributes']=_0x104827[_0x7379('0x32')]['length']?_0x104827[_0x7379('0x32')]:_0x37bd63[_0x7379('0x2e')];if(!_0x102d46[_0x7379('0x2f')][_0x7379('0x34')](_0x7379('0x35'))){_0x104827[_0x7379('0x1d')]=qs[_0x7379('0x1d')](_0x102d46[_0x7379('0x2f')]['limit']);_0x104827[_0x7379('0x36')]=qs['offset'](_0x102d46[_0x7379('0x2f')][_0x7379('0x36')]);}_0x104827['order']=qs[_0x7379('0x37')](_0x102d46[_0x7379('0x2f')][_0x7379('0x37')]);_0x104827[_0x7379('0x38')]=qs[_0x7379('0x39')](_[_0x7379('0x3a')](_0x102d46[_0x7379('0x2f')],_0x37bd63['filters']),_0x813106);if(_0x102d46[_0x7379('0x2f')][_0x7379('0x3b')]){_0x104827[_0x7379('0x38')]=_[_0x7379('0x3c')](_0x104827[_0x7379('0x38')],{'$or':_[_0x7379('0x28')](_0x813106,function(_0x5e8622){if(_0x5e8622[_0x7379('0x2c')]!=='VIRTUAL'){var _0x427708={};_0x427708[_0x5e8622[_0x7379('0x26')]]={'$like':'%'+_0x102d46[_0x7379('0x2f')][_0x7379('0x3b')]+'%'};return _0x427708;}})});}_0x104827=_[_0x7379('0x3c')]({},_0x104827,_0x102d46[_0x7379('0x3d')]);var _0x27d8c3={'where':_0x104827[_0x7379('0x38')]};return db[_0x7379('0x29')][_0x7379('0x1f')](_0x27d8c3)[_0x7379('0x24')](function(_0x66b925){_0x2cb9c5['count']=_0x66b925;if(_0x102d46[_0x7379('0x2f')][_0x7379('0x3e')]){_0x104827[_0x7379('0x3f')]=[{'all':!![]}];}return db[_0x7379('0x29')]['findAll'](_0x104827);})['then'](function(_0x13d0fb){_0x2cb9c5[_0x7379('0x40')]=_0x13d0fb;return _0x2cb9c5;})[_0x7379('0x24')](respondWithFilteredResult(_0x2f0677,_0x104827))[_0x7379('0x41')](handleError(_0x2f0677,null));};exports[_0x7379('0x42')]=function(_0x1ca664,_0x5e4f5d){var _0x2eac16={'raw':!![],'where':{'id':_0x1ca664[_0x7379('0x43')]['id']}},_0x2868ba={};_0x2868ba[_0x7379('0x2e')]=_[_0x7379('0x30')](db[_0x7379('0x29')]['rawAttributes']);_0x2868ba[_0x7379('0x2f')]=_[_0x7379('0x30')](_0x1ca664[_0x7379('0x2f')]);_0x2868ba['filters']=_['intersection'](_0x2868ba[_0x7379('0x2e')],_0x2868ba[_0x7379('0x2f')]);_0x2eac16['attributes']=_['intersection'](_0x2868ba[_0x7379('0x2e')],qs[_0x7379('0x33')](_0x1ca664[_0x7379('0x2f')][_0x7379('0x33')]));_0x2eac16['attributes']=_0x2eac16[_0x7379('0x32')]['length']?_0x2eac16['attributes']:_0x2868ba[_0x7379('0x2e')];if(_0x1ca664[_0x7379('0x2f')][_0x7379('0x3e')]){_0x2eac16[_0x7379('0x3f')]=[{'all':!![]}];}_0x2eac16=_[_0x7379('0x3c')]({},_0x2eac16,_0x1ca664[_0x7379('0x3d')]);return db[_0x7379('0x29')][_0x7379('0x44')](_0x2eac16)[_0x7379('0x24')](handleEntityNotFound(_0x5e4f5d,null))[_0x7379('0x24')](respondWithResult(_0x5e4f5d,null))['catch'](handleError(_0x5e4f5d,null));};exports['create']=function(_0x4b39a9,_0x421815){return db[_0x7379('0x29')][_0x7379('0x45')](_0x4b39a9[_0x7379('0x46')],{})['then'](respondWithResult(_0x421815,0xc9))[_0x7379('0x41')](handleError(_0x421815,null));};exports[_0x7379('0x23')]=function(_0x57db9d,_0x3501de){if(_0x57db9d[_0x7379('0x46')]['id']){delete _0x57db9d[_0x7379('0x46')]['id'];}return db[_0x7379('0x29')]['find']({'where':{'id':_0x57db9d[_0x7379('0x43')]['id']}})['then'](handleEntityNotFound(_0x3501de,null))[_0x7379('0x24')](saveUpdates(_0x57db9d[_0x7379('0x46')],null))[_0x7379('0x24')](respondWithResult(_0x3501de,null))['catch'](handleError(_0x3501de,null));};exports[_0x7379('0x47')]=function(_0x2f86b6,_0x81b0d7){return db[_0x7379('0x29')]['find']({'where':{'id':_0x2f86b6[_0x7379('0x43')]['id']}})[_0x7379('0x24')](handleEntityNotFound(_0x81b0d7,null))[_0x7379('0x24')](removeEntity(_0x81b0d7,null))[_0x7379('0x41')](handleError(_0x81b0d7,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index f186fff..45ae9b7 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.model.js +++ b/server/api/analyticTreeReport/analyticTreeReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5414=['request-promise','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger'];(function(_0x40e54c,_0x50e09f){var _0x4700c7=function(_0x40d83f){while(--_0x40d83f){_0x40e54c['push'](_0x40e54c['shift']());}};_0x4700c7(++_0x50e09f);}(_0x5414,0xdf));var _0x4541=function(_0x2cf8a0,_0x5c2f9b){_0x2cf8a0=_0x2cf8a0-0x0;var _0x16d353=_0x5414[_0x2cf8a0];return _0x16d353;};'use strict';var _=require(_0x4541('0x0'));var util=require('util');var logger=require(_0x4541('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4541('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4541('0x3'));var attributes=require(_0x4541('0x4'));module[_0x4541('0x5')]=function(_0x5ef65b,_0x921780){return _0x5ef65b[_0x4541('0x6')](_0x4541('0x7'),attributes,{'tableName':_0x4541('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f0c=['analytics_report_trees','lodash','util','api','moment','bluebird','request-promise','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x32fa25,_0xce5f04){var _0x4d1f05=function(_0x9d9179){while(--_0x9d9179){_0x32fa25['push'](_0x32fa25['shift']());}};_0x4d1f05(++_0xce5f04);}(_0x1f0c,0x175));var _0xc1f0=function(_0x4107b5,_0x5ee5ce){_0x4107b5=_0x4107b5-0x0;var _0x1af40b=_0x1f0c[_0x4107b5];return _0x1af40b;};'use strict';var _=require(_0xc1f0('0x0'));var util=require(_0xc1f0('0x1'));var logger=require('../../config/logger')(_0xc1f0('0x2'));var moment=require(_0xc1f0('0x3'));var BPromise=require(_0xc1f0('0x4'));var rp=require(_0xc1f0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc1f0('0x6'));var config=require('../../config/environment');var attributes=require(_0xc1f0('0x7'));module[_0xc1f0('0x8')]=function(_0x4aaf35,_0x1521b3){return _0x4aaf35[_0xc1f0('0x9')](_0xc1f0('0xa'),attributes,{'tableName':_0xc1f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 66ed3f1..557c1eb 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x2733e5,_0x1613af){var _0x556620=function(_0x2f99de){while(--_0x2f99de){_0x2733e5['push'](_0x2733e5['shift']());}};_0x556620(++_0x1613af);}(_0x5f66,0x1a0));var _0x65f6=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5f66[_0x36eaaa];return _0x461349;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x100c05,_0x12458c){_0x100c05=_0x100c05-0x0;var _0x29543a=_0x7a54[_0x100c05];return _0x29543a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index cc715d7..8bc3e9f 100644 --- a/server/api/analyticTreeReport/index.js +++ b/server/api/analyticTreeReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b51=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','show','put','destroy','exports','multer'];(function(_0x2ff30a,_0x35ac08){var _0x590831=function(_0x2117d1){while(--_0x2117d1){_0x2ff30a['push'](_0x2ff30a['shift']());}};_0x590831(++_0x35ac08);}(_0x5b51,0x1ca));var _0x15b5=function(_0x582d0b,_0x28f609){_0x582d0b=_0x582d0b-0x0;var _0x2e93e1=_0x5b51[_0x582d0b];return _0x2e93e1;};'use strict';var multer=require(_0x15b5('0x0'));var util=require(_0x15b5('0x1'));var path=require(_0x15b5('0x2'));var timeout=require('connect-timeout');var express=require(_0x15b5('0x3'));var router=express['Router']();var fs_extra=require(_0x15b5('0x4'));var auth=require(_0x15b5('0x5'));var interaction=require(_0x15b5('0x6'));var config=require(_0x15b5('0x7'));var controller=require(_0x15b5('0x8'));router[_0x15b5('0x9')]('/',auth['isAuthenticated'](),controller[_0x15b5('0xa')]);router['get'](_0x15b5('0xb'),auth[_0x15b5('0xc')](),controller[_0x15b5('0xd')]);router['post']('/',auth[_0x15b5('0xc')](),controller['create']);router[_0x15b5('0xe')]('/:id',auth[_0x15b5('0xc')](),controller['update']);router['delete'](_0x15b5('0xb'),auth[_0x15b5('0xc')](),controller[_0x15b5('0xf')]);module[_0x15b5('0x10')]=router; \ No newline at end of file +var _0x7e8a=['get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x43736d,_0x13e29d){var _0x9cee86=function(_0x1e1096){while(--_0x1e1096){_0x43736d['push'](_0x43736d['shift']());}};_0x9cee86(++_0x13e29d);}(_0x7e8a,0xbf));var _0xa7e8=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x7e8a[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require('multer');var util=require(_0xa7e8('0x0'));var path=require(_0xa7e8('0x1'));var timeout=require(_0xa7e8('0x2'));var express=require(_0xa7e8('0x3'));var router=express[_0xa7e8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa7e8('0x5'));var interaction=require(_0xa7e8('0x6'));var config=require(_0xa7e8('0x7'));var controller=require(_0xa7e8('0x8'));router[_0xa7e8('0x9')]('/',auth[_0xa7e8('0xa')](),controller[_0xa7e8('0xb')]);router['get'](_0xa7e8('0xc'),auth[_0xa7e8('0xa')](),controller[_0xa7e8('0xd')]);router['post']('/',auth[_0xa7e8('0xa')](),controller[_0xa7e8('0xe')]);router[_0xa7e8('0xf')](_0xa7e8('0xc'),auth['isAuthenticated'](),controller[_0xa7e8('0x10')]);router[_0xa7e8('0x11')](_0xa7e8('0xc'),auth[_0xa7e8('0xa')](),controller[_0xa7e8('0x12')]);module[_0xa7e8('0x13')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 85a3479..d56c9db 100644 --- a/server/api/attachment/attachment.attributes.js +++ b/server/api/attachment/attachment.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c4a=['STRING','exports'];(function(_0x328c42,_0x3c17e4){var _0x345c20=function(_0x4eb03f){while(--_0x4eb03f){_0x328c42['push'](_0x328c42['shift']());}};_0x345c20(++_0x3c17e4);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x414678,_0x928bf6){_0x414678=_0x414678-0x0;var _0x1c1ee2=_0x5c4a[_0x414678];return _0x1c1ee2;};'use strict';var Sequelize=require('sequelize');module[_0xa5c4('0x0')]={'name':{'type':Sequelize[_0xa5c4('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa5c4('0x1')]}}; \ No newline at end of file +var _0xbe22=['exports','STRING','sequelize'];(function(_0x3f740c,_0x33bcdc){var _0x2e7944=function(_0x2fcf38){while(--_0x2fcf38){_0x3f740c['push'](_0x3f740c['shift']());}};_0x2e7944(++_0x33bcdc);}(_0xbe22,0x1c1));var _0x2be2=function(_0x565391,_0x18aa06){_0x565391=_0x565391-0x0;var _0x45584f=_0xbe22[_0x565391];return _0x45584f;};'use strict';var Sequelize=require(_0x2be2('0x0'));module[_0x2be2('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2be2('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index b5240ee..cd601c6 100644 --- a/server/api/attachment/attachment.controller.js +++ b/server/api/attachment/attachment.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa2b2=['filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','clone','get','omit','createdAt','updatedAt','body','create','file','filename','mimetype','download','findOne','ChatOfflineMessageId','root','join','basename','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','update','then','destroy','error','stack','name','send','index','Attachment','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL'];(function(_0x14a1b0,_0x93f367){var _0x5252d4=function(_0x463800){while(--_0x463800){_0x14a1b0['push'](_0x14a1b0['shift']());}};_0x5252d4(++_0x93f367);}(_0xa2b2,0x1f2));var _0x2a2b=function(_0x94156,_0x2d1dab){_0x94156=_0x94156-0x0;var _0x68b485=_0xa2b2[_0x94156];return _0x68b485;};'use strict';var emlformat=require(_0x2a2b('0x0'));var rimraf=require(_0x2a2b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2a2b('0x2'));var rp=require(_0x2a2b('0x3'));var moment=require(_0x2a2b('0x4'));var BPromise=require(_0x2a2b('0x5'));var Mustache=require(_0x2a2b('0x6'));var util=require(_0x2a2b('0x7'));var path=require(_0x2a2b('0x8'));var sox=require(_0x2a2b('0x9'));var csv=require('to-csv');var ejs=require(_0x2a2b('0xa'));var fs=require('fs');var fs_extra=require(_0x2a2b('0xb'));var _=require(_0x2a2b('0xc'));var squel=require(_0x2a2b('0xd'));var crypto=require(_0x2a2b('0xe'));var jsforce=require(_0x2a2b('0xf'));var deskjs=require(_0x2a2b('0x10'));var toCsv=require(_0x2a2b('0x11'));var querystring=require(_0x2a2b('0x12'));var Papa=require('papaparse');var Redis=require(_0x2a2b('0x13'));var authService=require(_0x2a2b('0x14'));var qs=require(_0x2a2b('0x15'));var as=require(_0x2a2b('0x16'));var hardwareService=require(_0x2a2b('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x2a2b('0x18'));var config=require(_0x2a2b('0x19'));var licenseUtil=require(_0x2a2b('0x1a'));var db=require(_0x2a2b('0x1b'))['db'];function respondWithStatusCode(_0x622668,_0x4d75dd){_0x4d75dd=_0x4d75dd||0xcc;return function(_0x4b7e0d){if(_0x4b7e0d){return _0x622668[_0x2a2b('0x1c')](_0x4d75dd);}return _0x622668[_0x2a2b('0x1d')](_0x4d75dd)[_0x2a2b('0x1e')]();};}function respondWithResult(_0x3dbf1c,_0x108505){_0x108505=_0x108505||0xc8;return function(_0x342c25){if(_0x342c25){return _0x3dbf1c[_0x2a2b('0x1d')](_0x108505)[_0x2a2b('0x1f')](_0x342c25);}};}function respondWithFilteredResult(_0x8cc51e,_0x257631){return function(_0x5d770f){if(_0x5d770f){var _0x2e0757=typeof _0x257631[_0x2a2b('0x20')]===_0x2a2b('0x21')&&typeof _0x257631['limit']===_0x2a2b('0x21');var _0x4d79f6=_0x5d770f['count'];var _0x1c2d2a=_0x2e0757?0x0:_0x257631[_0x2a2b('0x20')];var _0x313cb1=_0x2e0757?_0x5d770f['count']:_0x257631[_0x2a2b('0x20')]+_0x257631[_0x2a2b('0x22')];var _0x327f19;if(_0x313cb1>=_0x4d79f6){_0x313cb1=_0x4d79f6;_0x327f19=0xc8;}else{_0x327f19=0xce;}_0x8cc51e[_0x2a2b('0x1d')](_0x327f19);return _0x8cc51e[_0x2a2b('0x23')]('Content-Range',_0x1c2d2a+'-'+_0x313cb1+'/'+_0x4d79f6)['json'](_0x5d770f);}return null;};}function patchUpdates(_0x49d162){return function(_0x444960){try{jsonpatch[_0x2a2b('0x24')](_0x444960,_0x49d162,!![]);}catch(_0x523a47){return BPromise[_0x2a2b('0x25')](_0x523a47);}return _0x444960['save']();};}function saveUpdates(_0x4e0370,_0x2b3f0a){return function(_0x177e27){if(_0x177e27){return _0x177e27[_0x2a2b('0x26')](_0x4e0370)[_0x2a2b('0x27')](function(_0x2b7f83){return _0x2b7f83;});}return null;};}function removeEntity(_0x4ac6f9,_0x55044c){return function(_0x5998eb){if(_0x5998eb){return _0x5998eb[_0x2a2b('0x28')]()[_0x2a2b('0x27')](function(){_0x4ac6f9['status'](0xcc)[_0x2a2b('0x1e')]();});}};}function handleEntityNotFound(_0x1b79e7,_0x3e493e){return function(_0x2ea85){if(!_0x2ea85){_0x1b79e7[_0x2a2b('0x1c')](0x194);}return _0x2ea85;};}function handleError(_0x5d7d5e,_0x375065){_0x375065=_0x375065||0x1f4;return function(_0x502fc1){logger[_0x2a2b('0x29')](_0x502fc1[_0x2a2b('0x2a')]);if(_0x502fc1[_0x2a2b('0x2b')]){delete _0x502fc1['name'];}_0x5d7d5e[_0x2a2b('0x1d')](_0x375065)[_0x2a2b('0x2c')](_0x502fc1);};}exports[_0x2a2b('0x2d')]=function(_0x475ec1,_0x5e681d){var _0x47ea3c={},_0xc4c450={},_0x523f6e={'count':0x0,'rows':[]};var _0x3a1443=_['map'](db[_0x2a2b('0x2e')][_0x2a2b('0x2f')],function(_0x141bad){return{'name':_0x141bad[_0x2a2b('0x30')],'type':_0x141bad['type'][_0x2a2b('0x31')]};});_0xc4c450[_0x2a2b('0x32')]=_[_0x2a2b('0x33')](_0x3a1443,_0x2a2b('0x2b'));_0xc4c450[_0x2a2b('0x34')]=_[_0x2a2b('0x35')](_0x475ec1['query']);_0xc4c450[_0x2a2b('0x36')]=_[_0x2a2b('0x37')](_0xc4c450['model'],_0xc4c450[_0x2a2b('0x34')]);_0x47ea3c['attributes']=_[_0x2a2b('0x37')](_0xc4c450[_0x2a2b('0x32')],qs['fields'](_0x475ec1[_0x2a2b('0x34')][_0x2a2b('0x38')]));_0x47ea3c[_0x2a2b('0x39')]=_0x47ea3c['attributes'][_0x2a2b('0x3a')]?_0x47ea3c[_0x2a2b('0x39')]:_0xc4c450[_0x2a2b('0x32')];if(!_0x475ec1[_0x2a2b('0x34')][_0x2a2b('0x3b')](_0x2a2b('0x3c'))){_0x47ea3c[_0x2a2b('0x22')]=qs[_0x2a2b('0x22')](_0x475ec1[_0x2a2b('0x34')][_0x2a2b('0x22')]);_0x47ea3c[_0x2a2b('0x20')]=qs[_0x2a2b('0x20')](_0x475ec1[_0x2a2b('0x34')]['offset']);}_0x47ea3c['order']=qs['sort'](_0x475ec1[_0x2a2b('0x34')][_0x2a2b('0x3d')]);_0x47ea3c[_0x2a2b('0x3e')]=qs[_0x2a2b('0x36')](_[_0x2a2b('0x3f')](_0x475ec1[_0x2a2b('0x34')],_0xc4c450[_0x2a2b('0x36')]),_0x3a1443);if(_0x475ec1['query']['filter']){_0x47ea3c['where']=_['merge'](_0x47ea3c[_0x2a2b('0x3e')],{'$or':_[_0x2a2b('0x33')](_0x3a1443,function(_0x3fa88a){if(_0x3fa88a[_0x2a2b('0x40')]!==_0x2a2b('0x41')){var _0x186b6e={};_0x186b6e[_0x3fa88a['name']]={'$like':'%'+_0x475ec1[_0x2a2b('0x34')][_0x2a2b('0x42')]+'%'};return _0x186b6e;}})});}_0x47ea3c=_[_0x2a2b('0x43')]({},_0x47ea3c,_0x475ec1[_0x2a2b('0x44')]);var _0x22d095={'where':_0x47ea3c[_0x2a2b('0x3e')]};return db[_0x2a2b('0x2e')][_0x2a2b('0x45')](_0x22d095)['then'](function(_0x56d24){_0x523f6e[_0x2a2b('0x45')]=_0x56d24;if(_0x475ec1['query'][_0x2a2b('0x46')]){_0x47ea3c[_0x2a2b('0x47')]=[{'all':!![]}];}return db[_0x2a2b('0x2e')][_0x2a2b('0x48')](_0x47ea3c);})['then'](function(_0x264b9b){_0x523f6e[_0x2a2b('0x49')]=_0x264b9b;return _0x523f6e;})[_0x2a2b('0x27')](respondWithFilteredResult(_0x5e681d,_0x47ea3c))[_0x2a2b('0x4a')](handleError(_0x5e681d,null));};exports[_0x2a2b('0x4b')]=function(_0x21e842,_0x2baa88){var _0x14d667={'raw':!![],'where':{'id':_0x21e842[_0x2a2b('0x4c')]['id']}},_0x1bf4c4={};_0x1bf4c4[_0x2a2b('0x32')]=_[_0x2a2b('0x35')](db[_0x2a2b('0x2e')][_0x2a2b('0x2f')]);_0x1bf4c4['query']=_['keys'](_0x21e842[_0x2a2b('0x34')]);_0x1bf4c4['filters']=_[_0x2a2b('0x37')](_0x1bf4c4['model'],_0x1bf4c4['query']);_0x14d667[_0x2a2b('0x39')]=_[_0x2a2b('0x37')](_0x1bf4c4['model'],qs[_0x2a2b('0x38')](_0x21e842['query'][_0x2a2b('0x38')]));_0x14d667[_0x2a2b('0x39')]=_0x14d667['attributes'][_0x2a2b('0x3a')]?_0x14d667[_0x2a2b('0x39')]:_0x1bf4c4[_0x2a2b('0x32')];if(_0x21e842[_0x2a2b('0x34')][_0x2a2b('0x46')]){_0x14d667[_0x2a2b('0x47')]=[{'all':!![]}];}_0x14d667=_[_0x2a2b('0x43')]({},_0x14d667,_0x21e842[_0x2a2b('0x44')]);return db[_0x2a2b('0x2e')][_0x2a2b('0x4d')](_0x14d667)[_0x2a2b('0x27')](handleEntityNotFound(_0x2baa88,null))[_0x2a2b('0x27')](respondWithResult(_0x2baa88,null))[_0x2a2b('0x4a')](handleError(_0x2baa88,null));};exports[_0x2a2b('0x4e')]=function(_0x311b32,_0x170d14){var _0x3cca7e={'where':{'id':_0x311b32[_0x2a2b('0x4c')]['id']}},_0x4d994e={};_0x4d994e[_0x2a2b('0x32')]=_['keys'](db['Attachment'][_0x2a2b('0x2f')]);_0x3cca7e[_0x2a2b('0x39')]=_[_0x2a2b('0x37')](_0x4d994e[_0x2a2b('0x32')],qs['fields'](_0x311b32[_0x2a2b('0x34')][_0x2a2b('0x38')]));_0x3cca7e['attributes']=_0x3cca7e[_0x2a2b('0x39')][_0x2a2b('0x3a')]?_0x3cca7e[_0x2a2b('0x39')]:_0x4d994e[_0x2a2b('0x32')];if(_0x311b32[_0x2a2b('0x34')][_0x2a2b('0x46')]){_0x3cca7e[_0x2a2b('0x47')]=[{'all':!![]}];}_0x3cca7e=_[_0x2a2b('0x43')]({},_0x3cca7e,_0x311b32[_0x2a2b('0x44')]);return db['Attachment'][_0x2a2b('0x4d')](_0x3cca7e)[_0x2a2b('0x27')](handleEntityNotFound(_0x170d14,null))[_0x2a2b('0x27')](function(_0x301afd){if(_0x301afd){var _0x351234=_0x301afd[_0x2a2b('0x4f')]({'plain':!![]});_0x351234=qs[_0x2a2b('0x50')](_0x351234,['id',_0x2a2b('0x51'),_0x2a2b('0x52')]);_0x311b32[_0x2a2b('0x53')]=_['omit'](_0x311b32['body'],['id','createdAt',_0x2a2b('0x52')]);return db[_0x2a2b('0x2e')][_0x2a2b('0x54')](_['merge'](_0x351234,_0x311b32['body']),{'include':_0x311b32[_0x2a2b('0x34')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x2a2b('0x27')](respondWithResult(_0x170d14,0xc9))[_0x2a2b('0x4a')](handleError(_0x170d14,null));};exports[_0x2a2b('0x26')]=function(_0x46d0f1,_0x29076d){if(_0x46d0f1[_0x2a2b('0x53')]['id']){delete _0x46d0f1['body']['id'];}return db[_0x2a2b('0x2e')][_0x2a2b('0x4d')]({'where':{'id':_0x46d0f1[_0x2a2b('0x4c')]['id']}})[_0x2a2b('0x27')](handleEntityNotFound(_0x29076d,null))[_0x2a2b('0x27')](saveUpdates(_0x46d0f1['body'],null))[_0x2a2b('0x27')](respondWithResult(_0x29076d,null))['catch'](handleError(_0x29076d,null));};exports[_0x2a2b('0x28')]=function(_0x2550b6,_0x327449){return db[_0x2a2b('0x2e')][_0x2a2b('0x4d')]({'where':{'id':_0x2550b6[_0x2a2b('0x4c')]['id']}})[_0x2a2b('0x27')](handleEntityNotFound(_0x327449,null))['then'](removeEntity(_0x327449,null))[_0x2a2b('0x4a')](handleError(_0x327449,null));};exports[_0x2a2b('0x54')]=function(_0x24167a,_0x4434ee,_0x357edb){_0x24167a[_0x2a2b('0x53')][_0x2a2b('0x2b')]=_0x24167a['file']['originalname'];_0x24167a[_0x2a2b('0x53')]['basename']=_0x24167a[_0x2a2b('0x55')][_0x2a2b('0x56')];_0x24167a['body']['type']=_0x24167a[_0x2a2b('0x55')][_0x2a2b('0x57')];return db['Attachment']['create'](_0x24167a['body'])[_0x2a2b('0x27')](respondWithResult(_0x4434ee,0xc9))['catch'](handleError(_0x4434ee,null));};exports[_0x2a2b('0x58')]=function(_0x5254cf,_0x402eb1,_0x29d0c1){return db['Attachment'][_0x2a2b('0x59')]({'where':{'id':_0x5254cf[_0x2a2b('0x4c')]['id']},'raw':!![]})[_0x2a2b('0x27')](handleEntityNotFound(_0x402eb1,null))[_0x2a2b('0x27')](function(_0x19b83d){if(_0x19b83d){var _0x35391a=_0x19b83d[_0x2a2b('0x5a')]!==null;var _0x508d31=path['join'](config[_0x2a2b('0x5b')],'server/files/attachments/');if(_0x35391a){_0x508d31=path[_0x2a2b('0x5c')](_0x508d31,'offline-chat/');}var _0x155f70=path[_0x2a2b('0x5c')](_0x508d31,_0x19b83d[_0x2a2b('0x5d')]);return _0x402eb1[_0x2a2b('0x58')](_0x155f70);}})[_0x2a2b('0x4a')](handleError(_0x402eb1,null));}; \ No newline at end of file +var _0x3508=['params','fields','includeAll','options','find','clone','get','omit','updatedAt','body','create','update','destroy','file','originalname','basename','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','then','stack','name','index','Attachment','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','show'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x3508,0x173));var _0x8350=function(_0x55599e,_0x196bab){_0x55599e=_0x55599e-0x0;var _0x3c8e06=_0x3508[_0x55599e];return _0x3c8e06;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8350('0x0'));var rp=require(_0x8350('0x1'));var moment=require('moment');var BPromise=require(_0x8350('0x2'));var Mustache=require(_0x8350('0x3'));var util=require(_0x8350('0x4'));var path=require(_0x8350('0x5'));var sox=require(_0x8350('0x6'));var csv=require(_0x8350('0x7'));var ejs=require(_0x8350('0x8'));var fs=require('fs');var fs_extra=require(_0x8350('0x9'));var _=require(_0x8350('0xa'));var squel=require(_0x8350('0xb'));var crypto=require(_0x8350('0xc'));var jsforce=require(_0x8350('0xd'));var deskjs=require(_0x8350('0xe'));var toCsv=require(_0x8350('0x7'));var querystring=require(_0x8350('0xf'));var Papa=require(_0x8350('0x10'));var Redis=require('ioredis');var authService=require(_0x8350('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8350('0x12'));var hardwareService=require(_0x8350('0x13'));var logger=require(_0x8350('0x14'))(_0x8350('0x15'));var utils=require(_0x8350('0x16'));var config=require(_0x8350('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x188240,_0x2f6acc){_0x2f6acc=_0x2f6acc||0xcc;return function(_0x42f22a){if(_0x42f22a){return _0x188240[_0x8350('0x18')](_0x2f6acc);}return _0x188240['status'](_0x2f6acc)[_0x8350('0x19')]();};}function respondWithResult(_0x4b1216,_0x3ed2cf){_0x3ed2cf=_0x3ed2cf||0xc8;return function(_0x27293c){if(_0x27293c){return _0x4b1216[_0x8350('0x1a')](_0x3ed2cf)[_0x8350('0x1b')](_0x27293c);}};}function respondWithFilteredResult(_0x10e78c,_0xf89c11){return function(_0xaed5d4){if(_0xaed5d4){var _0x2070af=typeof _0xf89c11[_0x8350('0x1c')]===_0x8350('0x1d')&&typeof _0xf89c11['limit']==='undefined';var _0x3b276e=_0xaed5d4['count'];var _0x1fe6ee=_0x2070af?0x0:_0xf89c11[_0x8350('0x1c')];var _0x133a62=_0x2070af?_0xaed5d4[_0x8350('0x1e')]:_0xf89c11[_0x8350('0x1c')]+_0xf89c11[_0x8350('0x1f')];var _0x5354af;if(_0x133a62>=_0x3b276e){_0x133a62=_0x3b276e;_0x5354af=0xc8;}else{_0x5354af=0xce;}_0x10e78c['status'](_0x5354af);return _0x10e78c['set'](_0x8350('0x20'),_0x1fe6ee+'-'+_0x133a62+'/'+_0x3b276e)[_0x8350('0x1b')](_0xaed5d4);}return null;};}function patchUpdates(_0x2b4f98){return function(_0x26482a){try{jsonpatch[_0x8350('0x21')](_0x26482a,_0x2b4f98,!![]);}catch(_0x3b38df){return BPromise[_0x8350('0x22')](_0x3b38df);}return _0x26482a['save']();};}function saveUpdates(_0x144dd2,_0x428f38){return function(_0x4d1ef3){if(_0x4d1ef3){return _0x4d1ef3['update'](_0x144dd2)[_0x8350('0x23')](function(_0x2b7429){return _0x2b7429;});}return null;};}function removeEntity(_0x446fae,_0x48adb1){return function(_0x24ee5f){if(_0x24ee5f){return _0x24ee5f['destroy']()[_0x8350('0x23')](function(){_0x446fae[_0x8350('0x1a')](0xcc)[_0x8350('0x19')]();});}};}function handleEntityNotFound(_0x26726e,_0x14224c){return function(_0x433aec){if(!_0x433aec){_0x26726e['sendStatus'](0x194);}return _0x433aec;};}function handleError(_0xeca555,_0x1e7391){_0x1e7391=_0x1e7391||0x1f4;return function(_0x3631f3){logger['error'](_0x3631f3[_0x8350('0x24')]);if(_0x3631f3[_0x8350('0x25')]){delete _0x3631f3[_0x8350('0x25')];}_0xeca555[_0x8350('0x1a')](_0x1e7391)['send'](_0x3631f3);};}exports[_0x8350('0x26')]=function(_0x25f5fc,_0x2c6468){var _0x3ab6a8={},_0x2f6317={},_0x165d2c={'count':0x0,'rows':[]};var _0x1c3f96=_['map'](db[_0x8350('0x27')]['rawAttributes'],function(_0xb42dc9){return{'name':_0xb42dc9[_0x8350('0x28')],'type':_0xb42dc9[_0x8350('0x29')][_0x8350('0x2a')]};});_0x2f6317[_0x8350('0x2b')]=_[_0x8350('0x2c')](_0x1c3f96,_0x8350('0x25'));_0x2f6317['query']=_[_0x8350('0x2d')](_0x25f5fc[_0x8350('0x2e')]);_0x2f6317[_0x8350('0x2f')]=_[_0x8350('0x30')](_0x2f6317[_0x8350('0x2b')],_0x2f6317[_0x8350('0x2e')]);_0x3ab6a8[_0x8350('0x31')]=_[_0x8350('0x30')](_0x2f6317[_0x8350('0x2b')],qs['fields'](_0x25f5fc[_0x8350('0x2e')]['fields']));_0x3ab6a8[_0x8350('0x31')]=_0x3ab6a8[_0x8350('0x31')][_0x8350('0x32')]?_0x3ab6a8[_0x8350('0x31')]:_0x2f6317[_0x8350('0x2b')];if(!_0x25f5fc[_0x8350('0x2e')][_0x8350('0x33')](_0x8350('0x34'))){_0x3ab6a8[_0x8350('0x1f')]=qs[_0x8350('0x1f')](_0x25f5fc[_0x8350('0x2e')]['limit']);_0x3ab6a8['offset']=qs[_0x8350('0x1c')](_0x25f5fc[_0x8350('0x2e')][_0x8350('0x1c')]);}_0x3ab6a8[_0x8350('0x35')]=qs[_0x8350('0x36')](_0x25f5fc[_0x8350('0x2e')]['sort']);_0x3ab6a8[_0x8350('0x37')]=qs[_0x8350('0x2f')](_['pick'](_0x25f5fc['query'],_0x2f6317[_0x8350('0x2f')]),_0x1c3f96);if(_0x25f5fc[_0x8350('0x2e')][_0x8350('0x38')]){_0x3ab6a8[_0x8350('0x37')]=_[_0x8350('0x39')](_0x3ab6a8['where'],{'$or':_[_0x8350('0x2c')](_0x1c3f96,function(_0x3ac616){if(_0x3ac616['type']!==_0x8350('0x3a')){var _0x57430e={};_0x57430e[_0x3ac616['name']]={'$like':'%'+_0x25f5fc['query'][_0x8350('0x38')]+'%'};return _0x57430e;}})});}_0x3ab6a8=_[_0x8350('0x39')]({},_0x3ab6a8,_0x25f5fc['options']);var _0x4e2a34={'where':_0x3ab6a8['where']};return db[_0x8350('0x27')][_0x8350('0x1e')](_0x4e2a34)[_0x8350('0x23')](function(_0xc085e3){_0x165d2c['count']=_0xc085e3;if(_0x25f5fc[_0x8350('0x2e')]['includeAll']){_0x3ab6a8[_0x8350('0x3b')]=[{'all':!![]}];}return db[_0x8350('0x27')][_0x8350('0x3c')](_0x3ab6a8);})[_0x8350('0x23')](function(_0x5e44fa){_0x165d2c[_0x8350('0x3d')]=_0x5e44fa;return _0x165d2c;})[_0x8350('0x23')](respondWithFilteredResult(_0x2c6468,_0x3ab6a8))[_0x8350('0x3e')](handleError(_0x2c6468,null));};exports[_0x8350('0x3f')]=function(_0x1b3397,_0x5acd3f){var _0xd67eb8={'raw':!![],'where':{'id':_0x1b3397[_0x8350('0x40')]['id']}},_0x46da1b={};_0x46da1b[_0x8350('0x2b')]=_[_0x8350('0x2d')](db[_0x8350('0x27')]['rawAttributes']);_0x46da1b[_0x8350('0x2e')]=_[_0x8350('0x2d')](_0x1b3397[_0x8350('0x2e')]);_0x46da1b[_0x8350('0x2f')]=_[_0x8350('0x30')](_0x46da1b[_0x8350('0x2b')],_0x46da1b[_0x8350('0x2e')]);_0xd67eb8[_0x8350('0x31')]=_[_0x8350('0x30')](_0x46da1b[_0x8350('0x2b')],qs['fields'](_0x1b3397[_0x8350('0x2e')][_0x8350('0x41')]));_0xd67eb8[_0x8350('0x31')]=_0xd67eb8[_0x8350('0x31')][_0x8350('0x32')]?_0xd67eb8[_0x8350('0x31')]:_0x46da1b[_0x8350('0x2b')];if(_0x1b3397[_0x8350('0x2e')][_0x8350('0x42')]){_0xd67eb8[_0x8350('0x3b')]=[{'all':!![]}];}_0xd67eb8=_['merge']({},_0xd67eb8,_0x1b3397[_0x8350('0x43')]);return db[_0x8350('0x27')][_0x8350('0x44')](_0xd67eb8)[_0x8350('0x23')](handleEntityNotFound(_0x5acd3f,null))[_0x8350('0x23')](respondWithResult(_0x5acd3f,null))[_0x8350('0x3e')](handleError(_0x5acd3f,null));};exports[_0x8350('0x45')]=function(_0x5c8b90,_0x4d9593){var _0x31ceb5={'where':{'id':_0x5c8b90[_0x8350('0x40')]['id']}},_0x1657a0={};_0x1657a0[_0x8350('0x2b')]=_['keys'](db[_0x8350('0x27')]['rawAttributes']);_0x31ceb5[_0x8350('0x31')]=_[_0x8350('0x30')](_0x1657a0['model'],qs[_0x8350('0x41')](_0x5c8b90[_0x8350('0x2e')][_0x8350('0x41')]));_0x31ceb5['attributes']=_0x31ceb5[_0x8350('0x31')][_0x8350('0x32')]?_0x31ceb5['attributes']:_0x1657a0[_0x8350('0x2b')];if(_0x5c8b90[_0x8350('0x2e')][_0x8350('0x42')]){_0x31ceb5[_0x8350('0x3b')]=[{'all':!![]}];}_0x31ceb5=_['merge']({},_0x31ceb5,_0x5c8b90[_0x8350('0x43')]);return db['Attachment'][_0x8350('0x44')](_0x31ceb5)['then'](handleEntityNotFound(_0x4d9593,null))[_0x8350('0x23')](function(_0x4bf461){if(_0x4bf461){var _0x18fc8b=_0x4bf461[_0x8350('0x46')]({'plain':!![]});_0x18fc8b=qs[_0x8350('0x47')](_0x18fc8b,['id','createdAt',_0x8350('0x48')]);_0x5c8b90[_0x8350('0x49')]=_['omit'](_0x5c8b90['body'],['id','createdAt','updatedAt']);return db[_0x8350('0x27')][_0x8350('0x4a')](_[_0x8350('0x39')](_0x18fc8b,_0x5c8b90[_0x8350('0x49')]),{'include':_0x5c8b90['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x8350('0x23')](respondWithResult(_0x4d9593,0xc9))['catch'](handleError(_0x4d9593,null));};exports[_0x8350('0x4b')]=function(_0x39c534,_0x1bf07d){if(_0x39c534[_0x8350('0x49')]['id']){delete _0x39c534['body']['id'];}return db['Attachment']['find']({'where':{'id':_0x39c534['params']['id']}})[_0x8350('0x23')](handleEntityNotFound(_0x1bf07d,null))[_0x8350('0x23')](saveUpdates(_0x39c534[_0x8350('0x49')],null))[_0x8350('0x23')](respondWithResult(_0x1bf07d,null))[_0x8350('0x3e')](handleError(_0x1bf07d,null));};exports[_0x8350('0x4c')]=function(_0x3c4816,_0x3c8670){return db[_0x8350('0x27')]['find']({'where':{'id':_0x3c4816['params']['id']}})['then'](handleEntityNotFound(_0x3c8670,null))[_0x8350('0x23')](removeEntity(_0x3c8670,null))['catch'](handleError(_0x3c8670,null));};exports['create']=function(_0x37ec06,_0x4ee9d5,_0x16bf4c){_0x37ec06[_0x8350('0x49')]['name']=_0x37ec06[_0x8350('0x4d')][_0x8350('0x4e')];_0x37ec06[_0x8350('0x49')][_0x8350('0x4f')]=_0x37ec06[_0x8350('0x4d')]['filename'];_0x37ec06[_0x8350('0x49')][_0x8350('0x29')]=_0x37ec06[_0x8350('0x4d')]['mimetype'];return db[_0x8350('0x27')][_0x8350('0x4a')](_0x37ec06[_0x8350('0x49')])[_0x8350('0x23')](respondWithResult(_0x4ee9d5,0xc9))[_0x8350('0x3e')](handleError(_0x4ee9d5,null));};exports[_0x8350('0x50')]=function(_0x13b69c,_0x2c79ea,_0x2a5472){return db[_0x8350('0x27')][_0x8350('0x51')]({'where':{'id':_0x13b69c[_0x8350('0x40')]['id']},'raw':!![]})[_0x8350('0x23')](handleEntityNotFound(_0x2c79ea,null))['then'](function(_0x686099){if(_0x686099){var _0x3c0683=_0x686099[_0x8350('0x52')]!==null;var _0x567fa9=path[_0x8350('0x53')](config[_0x8350('0x54')],_0x8350('0x55'));if(_0x3c0683){_0x567fa9=path['join'](_0x567fa9,_0x8350('0x56'));}var _0x4a124d=path[_0x8350('0x53')](_0x567fa9,_0x686099[_0x8350('0x4f')]);return _0x2c79ea[_0x8350('0x50')](_0x4a124d);}})[_0x8350('0x3e')](handleError(_0x2c79ea,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 8512de8..1b1f831 100644 --- a/server/api/attachment/attachment.model.js +++ b/server/api/attachment/attachment.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x43cc=['exports','define','Attachment','attachments','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x54e735,_0x38d658){var _0xffef0f=function(_0x40f175){while(--_0x40f175){_0x54e735['push'](_0x54e735['shift']());}};_0xffef0f(++_0x38d658);}(_0x43cc,0xac));var _0xc43c=function(_0x7abd7,_0x1ca3f9){_0x7abd7=_0x7abd7-0x0;var _0x3a2577=_0x43cc[_0x7abd7];return _0x3a2577;};'use strict';var _=require('lodash');var util=require(_0xc43c('0x0'));var logger=require(_0xc43c('0x1'))(_0xc43c('0x2'));var moment=require(_0xc43c('0x3'));var BPromise=require(_0xc43c('0x4'));var rp=require(_0xc43c('0x5'));var fs=require('fs');var path=require(_0xc43c('0x6'));var rimraf=require(_0xc43c('0x7'));var config=require(_0xc43c('0x8'));var attributes=require(_0xc43c('0x9'));module[_0xc43c('0xa')]=function(_0x5a50a7,_0x5d6e06){return _0x5a50a7[_0xc43c('0xb')](_0xc43c('0xc'),attributes,{'tableName':_0xc43c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b44=['api','moment','request-promise','path','../../config/environment','./attachment.attributes','define','Attachment','lodash','util'];(function(_0x1ba2cf,_0x57b0f2){var _0x4ef5b5=function(_0x4c5dcc){while(--_0x4c5dcc){_0x1ba2cf['push'](_0x1ba2cf['shift']());}};_0x4ef5b5(++_0x57b0f2);}(_0x6b44,0xf8));var _0x46b4=function(_0x2181fc,_0x7283aa){_0x2181fc=_0x2181fc-0x0;var _0x315da1=_0x6b44[_0x2181fc];return _0x315da1;};'use strict';var _=require(_0x46b4('0x0'));var util=require(_0x46b4('0x1'));var logger=require('../../config/logger')(_0x46b4('0x2'));var moment=require(_0x46b4('0x3'));var BPromise=require('bluebird');var rp=require(_0x46b4('0x4'));var fs=require('fs');var path=require(_0x46b4('0x5'));var rimraf=require('rimraf');var config=require(_0x46b4('0x6'));var attributes=require(_0x46b4('0x7'));module['exports']=function(_0x48bc16,_0x2cdbac){return _0x48bc16[_0x46b4('0x8')](_0x46b4('0x9'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 4cbc34e..e5c5947 100644 --- a/server/api/attachment/attachment.rpc.js +++ b/server/api/attachment/attachment.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f94=['rpc','jayson/promise','client','http','Attachment,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x18890a,_0x8efbc){var _0xc6044d=function(_0xb848bc){while(--_0xb848bc){_0x18890a['push'](_0x18890a['shift']());}};_0xc6044d(++_0x8efbc);}(_0x9f94,0x1e7));var _0x49f9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9f94[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var moment=require(_0x49f9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49f9('0x3'));var db=require(_0x49f9('0x4'))['db'];var utils=require(_0x49f9('0x5'));var logger=require(_0x49f9('0x6'))(_0x49f9('0x7'));var config=require('../../config/environment');var jayson=require(_0x49f9('0x8'));var client=jayson[_0x49f9('0x9')][_0x49f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fdbf1,_0x10ada8,_0x2e0928){return new BPromise(function(_0x355683,_0x2eddd1){return client['request'](_0x2fdbf1,_0x2e0928)['then'](function(_0x1628bb){logger['info'](_0x49f9('0xb'),_0x10ada8,_0x49f9('0xc'));logger[_0x49f9('0xd')]('Attachment,\x20%s,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'),JSON['stringify'](_0x1628bb));if(_0x1628bb[_0x49f9('0xe')]){if(_0x1628bb[_0x49f9('0xe')][_0x49f9('0xf')]===0x1f4){logger[_0x49f9('0xe')]('Attachment,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error'][_0x49f9('0x10')]);return _0x2eddd1(_0x1628bb[_0x49f9('0xe')][_0x49f9('0x10')]);}logger[_0x49f9('0xe')]('Attachment,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error']['message']);return _0x355683(_0x1628bb[_0x49f9('0xe')]['message']);}else{logger[_0x49f9('0x11')]('Attachment,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'));_0x355683(_0x1628bb[_0x49f9('0x12')]['message']);}})[_0x49f9('0x13')](function(_0x1a2026){logger[_0x49f9('0xe')](_0x49f9('0xb'),_0x10ada8,_0x1a2026);_0x2eddd1(_0x1a2026);});});}exports[_0x49f9('0x14')]=function(_0x509610){var _0x3cc45e=this;return new Promise(function(_0x359d48,_0x32568b){return db[_0x49f9('0x15')][_0x49f9('0x16')](_0x509610[_0x49f9('0x17')],{'raw':_0x509610[_0x49f9('0x18')]?_0x509610[_0x49f9('0x18')][_0x49f9('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x4f0bc9){logger[_0x49f9('0x11')]('CreateAttachment',_0x509610);logger[_0x49f9('0xd')]('CreateAttachment',_0x509610,JSON['stringify'](_0x4f0bc9));_0x359d48(_0x4f0bc9);})[_0x49f9('0x13')](function(_0xde1383){logger['error'](_0x49f9('0x14'),_0xde1383['message'],_0x509610);_0x32568b(_0x3cc45e['error'](0x1f4,_0xde1383[_0x49f9('0x10')]));});});}; \ No newline at end of file +var _0xe739=['code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','error'];(function(_0x180b9c,_0x663206){var _0x51baad=function(_0x3fe54a){while(--_0x3fe54a){_0x180b9c['push'](_0x180b9c['shift']());}};_0x51baad(++_0x663206);}(_0xe739,0x105));var _0x9e73=function(_0x3a8f21,_0x45d901){_0x3a8f21=_0x3a8f21-0x0;var _0x383baf=_0xe739[_0x3a8f21];return _0x383baf;};'use strict';var _=require(_0x9e73('0x0'));var util=require('util');var moment=require(_0x9e73('0x1'));var BPromise=require(_0x9e73('0x2'));var rs=require(_0x9e73('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9e73('0x4'))(_0x9e73('0x5'));var config=require(_0x9e73('0x6'));var jayson=require(_0x9e73('0x7'));var client=jayson['client'][_0x9e73('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26cb5b,_0xb37872,_0x5e46e7){return new BPromise(function(_0xa49f86,_0x1ee042){return client[_0x9e73('0x9')](_0x26cb5b,_0x5e46e7)[_0x9e73('0xa')](function(_0x14de8a){logger[_0x9e73('0xb')]('Attachment,\x20%s,\x20%s',_0xb37872,_0x9e73('0xc'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0xb37872,_0x9e73('0xc'),JSON['stringify'](_0x14de8a));if(_0x14de8a[_0x9e73('0xd')]){if(_0x14de8a[_0x9e73('0xd')][_0x9e73('0xe')]===0x1f4){logger['error'](_0x9e73('0xf'),_0xb37872,_0x14de8a[_0x9e73('0xd')][_0x9e73('0x10')]);return _0x1ee042(_0x14de8a[_0x9e73('0xd')]['message']);}logger[_0x9e73('0xd')](_0x9e73('0xf'),_0xb37872,_0x14de8a[_0x9e73('0xd')]['message']);return _0xa49f86(_0x14de8a[_0x9e73('0xd')][_0x9e73('0x10')]);}else{logger['info'](_0x9e73('0xf'),_0xb37872,_0x9e73('0xc'));_0xa49f86(_0x14de8a[_0x9e73('0x11')]['message']);}})[_0x9e73('0x12')](function(_0x51968a){logger[_0x9e73('0xd')]('Attachment,\x20%s,\x20%s',_0xb37872,_0x51968a);_0x1ee042(_0x51968a);});});}exports[_0x9e73('0x13')]=function(_0x48b1db){var _0x4dabb2=this;return new Promise(function(_0x419c5b,_0x3944fc){return db[_0x9e73('0x14')][_0x9e73('0x15')](_0x48b1db[_0x9e73('0x16')],{'raw':_0x48b1db[_0x9e73('0x17')]?_0x48b1db[_0x9e73('0x17')][_0x9e73('0x18')]===undefined?!![]:![]:!![]})[_0x9e73('0xa')](function(_0x3f56bf){logger['info'](_0x9e73('0x13'),_0x48b1db);logger['debug'](_0x9e73('0x13'),_0x48b1db,JSON['stringify'](_0x3f56bf));_0x419c5b(_0x3f56bf);})[_0x9e73('0x12')](function(_0x589a5d){logger[_0x9e73('0xd')](_0x9e73('0x13'),_0x589a5d['message'],_0x48b1db);_0x3944fc(_0x4dabb2['error'](0x1f4,_0x589a5d[_0x9e73('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 6d6c2d5..9d5084b 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x3fdc3e,_0x4b9c08){_0x3fdc3e=_0x3fdc3e-0x0;var _0x377696=_0xdb28[_0x3fdc3e];return _0x377696;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file +var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x28bdf0,_0x17b8c3){var _0x5d9fbf=function(_0x57cedb){while(--_0x57cedb){_0x28bdf0['push'](_0x28bdf0['shift']());}};_0x5d9fbf(++_0x17b8c3);}(_0x2032,0xd9));var _0x2203=function(_0x51f3c3,_0x3249e1){_0x51f3c3=_0x51f3c3-0x0;var _0x1b8e56=_0x2032[_0x51f3c3];return _0x1b8e56;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 1441b7c..c6c427f 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9f6=['disabled','blocked','blockedAt','online','admin','user','agent','then','blockDuration','minutes','getLicense','catch','status','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','passport','Strategy','moment','activedirectory2','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','url','domain','authenticate','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role'];(function(_0x27c4fe,_0x526312){var _0x3ba97d=function(_0x536243){while(--_0x536243){_0x27c4fe['push'](_0x27c4fe['shift']());}};_0x3ba97d(++_0x526312);}(_0xa9f6,0x14e));var _0x6a9f=function(_0x55a422,_0x1b09fc){_0x55a422=_0x55a422-0x0;var _0xce15c8=_0xa9f6[_0x55a422];return _0xce15c8;};'use strict';var passport=require(_0x6a9f('0x0'));var LocalStrategy=require('passport-local')[_0x6a9f('0x1')];var moment=require(_0x6a9f('0x2'));var ActiveDirectory=require(_0x6a9f('0x3'));var BPromise=require('bluebird');var util=require(_0x6a9f('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x6a9f('0x5'));var utils=require(_0x6a9f('0x6'));var config=require(_0x6a9f('0x7'));var logger=require(_0x6a9f('0x8'))('api');function isActiveDirectoryConfigured(_0x26a6ab){var _0x3e52d7=![];if(typeof _0x26a6ab[_0x6a9f('0x9')]!==_0x6a9f('0xa')){_0x3e52d7=_0x26a6ab[_0x6a9f('0x9')][_0x6a9f('0xb')]&&_0x26a6ab['activedirectory'][_0x6a9f('0xc')]&&_0x26a6ab['activedirectory'][_0x6a9f('0xd')];}return _0x3e52d7;}function adAuthenticate(_0x518002,_0x2d48f6,_0x2a9658){return new BPromise(function(_0x20cbf0,_0x3c10c4){try{var _0x556e79=new ActiveDirectory(_0x518002);_0x556e79[_0x6a9f('0xe')](_0x2d48f6,_0x2a9658,function(_0x5fbcf2,_0x2ac853){if(_0x5fbcf2){logger[_0x6a9f('0xf')]('Error\x20authenticate\x20%s:\x20%s',_0x2d48f6,util['inspect'](_0x5fbcf2,{'showHidden':![],'depth':null}));_0x3c10c4(_0x6a9f('0x10'));}else if(!_0x2ac853){logger[_0x6a9f('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x2d48f6);_0x3c10c4(_0x6a9f('0x10'));}else{_0x20cbf0(_0x2ac853);}});}catch(_0x5c0ca1){_0x3c10c4(_0x5c0ca1);}});}function ActiveDirectoryAuthenticate(_0x2c3ebe,_0x1bf75e,_0x4f3eae,_0x4701c7){var _0x5cad6b,_0x3599c9;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x6a9f('0x11'),_0x1bf75e);return _0x4701c7(null,![],{'message':_0x6a9f('0x10')});}return db[_0x6a9f('0x12')][_0x6a9f('0x13')]({'where':{'id':0x1},'attributes':[_0x6a9f('0x14'),'blockDuration'],'raw':!![]})['then'](function(_0x5e4d29){_0x5cad6b=_0x5e4d29;if(!_0x5cad6b['adSsoEnabled']){logger[_0x6a9f('0xf')](_0x6a9f('0x15'),_0x1bf75e);throw new Error(_0x6a9f('0x10'));}return _0x2c3ebe[_0x6a9f('0x13')]({'attributes':['id',_0x6a9f('0x16'),_0x6a9f('0x17'),_0x6a9f('0x18'),_0x6a9f('0x19'),_0x6a9f('0x1a'),_0x6a9f('0x1b'),_0x6a9f('0x1c'),_0x6a9f('0x1d')],'where':{'name':_0x1bf75e,'role':{'$or':[_0x6a9f('0x1e'),_0x6a9f('0x1f'),_0x6a9f('0x20')]},'adSsoEnabled':!![]}});})['then'](function(_0x5b6d34){if(!_0x5b6d34||_0x5b6d34&&_0x5b6d34[_0x6a9f('0x16')]!==_0x1bf75e){throw new Error(_0x6a9f('0x10'));}_0x3599c9=_0x5b6d34;var _0x1812b0=_0x3599c9[_0x6a9f('0x16')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config['activedirectory'],_0x1812b0,_0x4f3eae);})[_0x6a9f('0x21')](function(_0x151322){if(_0x3599c9[_0x6a9f('0x1a')]){throw new Error(_0x6a9f('0x10'));}if(_0x5cad6b['blockDuration']>0x0){if(_0x3599c9[_0x6a9f('0x1b')]){if(moment(_0x3599c9[_0x6a9f('0x1c')])['add'](_0x5cad6b[_0x6a9f('0x22')],_0x6a9f('0x23'))>moment()){throw new Error(_0x6a9f('0x10'));}return utils['clearBlockUser'](_0x3599c9,0x0,![],null)[_0x6a9f('0x21')](function(){return utils[_0x6a9f('0x24')](_0x3599c9);})['then'](function(){return _0x4701c7(null,_0x3599c9);});}else{return utils[_0x6a9f('0x24')](_0x3599c9)[_0x6a9f('0x21')](function(){return _0x4701c7(null,_0x3599c9);});}}else{return utils[_0x6a9f('0x24')](_0x3599c9)['then'](function(){return _0x4701c7(null,_0x3599c9);});}})[_0x6a9f('0x25')](function(_0x2cf7e0){return _0x4701c7(null,![],_0x2cf7e0);});}function handleError(_0x23e6d7,_0x2ec519,_0x54e2be){return _0x23e6d7[_0x6a9f('0x26')](_0x2ec519||0x1f4)[_0x6a9f('0x27')]({'message':_0x54e2be?_0x54e2be[_0x6a9f('0x28')]||_0x54e2be:''});}exports['login']=function(_0x445749,_0x14bf92,_0x669a34){passport['authenticate'](_0x6a9f('0x29'),function(_0x20a7e3,_0x21c558,_0x17d799){var _0x876269=_0x20a7e3||_0x17d799;if(_0x876269){return handleError(_0x14bf92,0x191,_0x876269);}if(!_0x21c558){return handleError(_0x14bf92,0x194,{'message':_0x6a9f('0x2a')});}else{var _0x4b7e11={'payload':{'id':_0x21c558['id'],'role':_0x21c558[_0x6a9f('0x19')]},'options':{'expiresIn':0x15180}};return authService[_0x6a9f('0x2b')](_0x4b7e11)['then'](function(_0x257266){_0x14bf92[_0x6a9f('0x2c')]({'id':_0x21c558['id'],'token':_0x257266,'statusCall':'','isAlreadyLogged':_0x21c558[_0x6a9f('0x1d')]});});}})(_0x445749,_0x14bf92,_0x669a34);};passport['use'](_0x6a9f('0x29'),new LocalStrategy({'usernameField':_0x6a9f('0x16'),'passwordField':_0x6a9f('0x17')},function(_0x23e62b,_0x3b0f5d,_0x204cc9){return ActiveDirectoryAuthenticate(db['User'],_0x23e62b,_0x3b0f5d,_0x204cc9);})); \ No newline at end of file +var _0x0379=['online','admin','user','agent','blockDuration','add','minutes','clearBlockUser','then','getLicense','catch','status','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','undefined','baseDN','url','activedirectory','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled','blocked','blockedAt'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x0379,0xe8));var _0x9037=function(_0x34b3b7,_0x50676a){_0x34b3b7=_0x34b3b7-0x0;var _0x3a3bc0=_0x0379[_0x34b3b7];return _0x3a3bc0;};'use strict';var passport=require(_0x9037('0x0'));var LocalStrategy=require(_0x9037('0x1'))['Strategy'];var moment=require(_0x9037('0x2'));var ActiveDirectory=require(_0x9037('0x3'));var BPromise=require('bluebird');var util=require(_0x9037('0x4'));var db=require(_0x9037('0x5'))['db'];var authService=require(_0x9037('0x6'));var utils=require(_0x9037('0x7'));var config=require(_0x9037('0x8'));var logger=require(_0x9037('0x9'))(_0x9037('0xa'));function isActiveDirectoryConfigured(_0x242bf7){var _0x584432=![];if(typeof _0x242bf7['activedirectory']!==_0x9037('0xb')){_0x584432=_0x242bf7['activedirectory'][_0x9037('0xc')]&&_0x242bf7['activedirectory'][_0x9037('0xd')]&&_0x242bf7[_0x9037('0xe')][_0x9037('0xf')];}return _0x584432;}function adAuthenticate(_0x287c43,_0x3d9379,_0x37c8ae){return new BPromise(function(_0x1956c3,_0x14182f){try{var _0x5e37f7=new ActiveDirectory(_0x287c43);_0x5e37f7[_0x9037('0x10')](_0x3d9379,_0x37c8ae,function(_0x3a01f1,_0x1e5b4e){if(_0x3a01f1){logger[_0x9037('0x11')](_0x9037('0x12'),_0x3d9379,util[_0x9037('0x13')](_0x3a01f1,{'showHidden':![],'depth':null}));_0x14182f(_0x9037('0x14'));}else if(!_0x1e5b4e){logger[_0x9037('0x11')](_0x9037('0x15'),_0x3d9379);_0x14182f(_0x9037('0x14'));}else{_0x1956c3(_0x1e5b4e);}});}catch(_0x33592e){_0x14182f(_0x33592e);}});}function ActiveDirectoryAuthenticate(_0x5ab5fc,_0x3994c0,_0x2be652,_0x47ac90){var _0x4684dc,_0x3f778e;if(!isActiveDirectoryConfigured(config)){logger[_0x9037('0x11')](_0x9037('0x16'),_0x3994c0);return _0x47ac90(null,![],{'message':_0x9037('0x14')});}return db[_0x9037('0x17')][_0x9037('0x18')]({'where':{'id':0x1},'attributes':[_0x9037('0x19'),'blockDuration'],'raw':!![]})['then'](function(_0x269d0c){_0x4684dc=_0x269d0c;if(!_0x4684dc[_0x9037('0x19')]){logger['error'](_0x9037('0x1a'),_0x3994c0);throw new Error(_0x9037('0x14'));}return _0x5ab5fc[_0x9037('0x18')]({'attributes':['id',_0x9037('0x1b'),_0x9037('0x1c'),'salt',_0x9037('0x1d'),_0x9037('0x1e'),_0x9037('0x1f'),_0x9037('0x20'),_0x9037('0x21')],'where':{'name':_0x3994c0,'role':{'$or':[_0x9037('0x22'),_0x9037('0x23'),_0x9037('0x24')]},'adSsoEnabled':!![]}});})['then'](function(_0x13a871){if(!_0x13a871||_0x13a871&&_0x13a871[_0x9037('0x1b')]!==_0x3994c0){throw new Error(_0x9037('0x14'));}_0x3f778e=_0x13a871;var _0x3931a3=_0x3f778e[_0x9037('0x1b')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config['activedirectory'],_0x3931a3,_0x2be652);})['then'](function(_0x3bc1e2){if(_0x3f778e['disabled']){throw new Error(_0x9037('0x14'));}if(_0x4684dc[_0x9037('0x25')]>0x0){if(_0x3f778e[_0x9037('0x1f')]){if(moment(_0x3f778e[_0x9037('0x20')])[_0x9037('0x26')](_0x4684dc[_0x9037('0x25')],_0x9037('0x27'))>moment()){throw new Error(_0x9037('0x14'));}return utils[_0x9037('0x28')](_0x3f778e,0x0,![],null)[_0x9037('0x29')](function(){return utils[_0x9037('0x2a')](_0x3f778e);})[_0x9037('0x29')](function(){return _0x47ac90(null,_0x3f778e);});}else{return utils[_0x9037('0x2a')](_0x3f778e)['then'](function(){return _0x47ac90(null,_0x3f778e);});}}else{return utils['getLicense'](_0x3f778e)['then'](function(){return _0x47ac90(null,_0x3f778e);});}})[_0x9037('0x2b')](function(_0x3209fe){return _0x47ac90(null,![],_0x3209fe);});}function handleError(_0x4c9f40,_0x3933bc,_0x481d52){return _0x4c9f40[_0x9037('0x2c')](_0x3933bc||0x1f4)[_0x9037('0x2d')]({'message':_0x481d52?_0x481d52[_0x9037('0x2e')]||_0x481d52:''});}exports['login']=function(_0x186ac4,_0x23bb11,_0x5db9d2){passport[_0x9037('0x10')](_0x9037('0x2f'),function(_0x3e308a,_0x172e26,_0x4c1632){var _0x312e5d=_0x3e308a||_0x4c1632;if(_0x312e5d){return handleError(_0x23bb11,0x191,_0x312e5d);}if(!_0x172e26){return handleError(_0x23bb11,0x194,{'message':_0x9037('0x30')});}else{var _0x5e42d0={'payload':{'id':_0x172e26['id'],'role':_0x172e26[_0x9037('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x9037('0x31')](_0x5e42d0)[_0x9037('0x29')](function(_0x27072c){_0x23bb11[_0x9037('0x32')]({'id':_0x172e26['id'],'token':_0x27072c,'statusCall':'','isAlreadyLogged':_0x172e26[_0x9037('0x21')]});});}})(_0x186ac4,_0x23bb11,_0x5db9d2);};passport[_0x9037('0x33')](_0x9037('0x2f'),new LocalStrategy({'usernameField':_0x9037('0x1b'),'passwordField':_0x9037('0x1c')},function(_0x120fc3,_0x1bed20,_0x17a299){return ActiveDirectoryAuthenticate(db[_0x9037('0x34')],_0x120fc3,_0x1bed20,_0x17a299);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index bb0817d..5d30086 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb89=['exports','Router','login'];(function(_0x4fbb86,_0x374ed0){var _0xb141fe=function(_0x382195){while(--_0x382195){_0x4fbb86['push'](_0x4fbb86['shift']());}};_0xb141fe(++_0x374ed0);}(_0xcb89,0x7f));var _0x9cb8=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xcb89[_0x4a747d];return _0x3a5b5c;};'use strict';var express=require('express');var router=express[_0x9cb8('0x0')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0x9cb8('0x1')]);module[_0x9cb8('0x2')]=router; \ No newline at end of file +var _0xe3bf=['post','exports','Router'];(function(_0xd84e6b,_0x5cc379){var _0x361b16=function(_0x582b6a){while(--_0x582b6a){_0xd84e6b['push'](_0xd84e6b['shift']());}};_0x361b16(++_0x5cc379);}(_0xe3bf,0x1c4));var _0xfe3b=function(_0x15142f,_0x4f5528){_0x15142f=_0x15142f-0x0;var _0x5b83de=_0xe3bf[_0x15142f];return _0x5b83de;};'use strict';var express=require('express');var router=express[_0xfe3b('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0xfe3b('0x1')]('/',controller['login']);module[_0xfe3b('0x2')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 4556987..0f24108 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x7a54,0x106));var _0x47a5=function(_0x27a521,_0x345ca4){_0x27a521=_0x27a521-0x0;var _0x15097a=_0x7a54[_0x27a521];return _0x15097a;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x7a54,0x106));var _0x47a5=function(_0x3f0a1b,_0x1b3cb4){_0x3f0a1b=_0x3f0a1b-0x0;var _0x1d2feb=_0x7a54[_0x3f0a1b];return _0x1d2feb;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 35b8d11..14f0b09 100644 --- a/server/api/authGoogle/index.js +++ b/server/api/authGoogle/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58d9=['callback','login','setTokenCookie','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback'];(function(_0x1895a9,_0x596414){var _0x1c1a43=function(_0x3eaef4){while(--_0x3eaef4){_0x1895a9['push'](_0x1895a9['shift']());}};_0x1c1a43(++_0x596414);}(_0x58d9,0xcb));var _0x958d=function(_0x224630,_0x3794f0){_0x224630=_0x224630-0x0;var _0x542038=_0x58d9[_0x224630];return _0x542038;};'use strict';var express=require(_0x958d('0x0'));var passport=require(_0x958d('0x1'));var router=express['Router']();var controller=require(_0x958d('0x2'));var userController=require(_0x958d('0x3'));var authService=require(_0x958d('0x4'));router[_0x958d('0x5')]('/',controller['login']);router[_0x958d('0x5')](_0x958d('0x6'),controller[_0x958d('0x7')],authService['isMiddleware'],userController[_0x958d('0x8')],authService[_0x958d('0x9')]);module['exports']=router; \ No newline at end of file +var _0x1eb0=['./authGoogle.controller','get','/callback','callback','isMiddleware','login','setTokenCookie','exports','express','passport','Router'];(function(_0x17de24,_0x3c6c3c){var _0x4a7763=function(_0x56abe0){while(--_0x56abe0){_0x17de24['push'](_0x17de24['shift']());}};_0x4a7763(++_0x3c6c3c);}(_0x1eb0,0x13c));var _0x01eb=function(_0x5b3aef,_0x942b2c){_0x5b3aef=_0x5b3aef-0x0;var _0x2667b2=_0x1eb0[_0x5b3aef];return _0x2667b2;};'use strict';var express=require(_0x01eb('0x0'));var passport=require(_0x01eb('0x1'));var router=express[_0x01eb('0x2')]();var controller=require(_0x01eb('0x3'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x01eb('0x4')]('/',controller['login']);router[_0x01eb('0x4')](_0x01eb('0x5'),controller[_0x01eb('0x6')],authService[_0x01eb('0x7')],userController[_0x01eb('0x8')],authService[_0x01eb('0x9')]);module[_0x01eb('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 3811640..049cff7 100644 --- a/server/api/authLocal/authLocal.controller.js +++ b/server/api/authLocal/authLocal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2093=['SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','forgot','body','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','previousPasswords','resetPasswordToken','use','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','blocked','blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','disabled','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request'];(function(_0xa6f511,_0x3076df){var _0x30b918=function(_0x41f02c){while(--_0x41f02c){_0xa6f511['push'](_0xa6f511['shift']());}};_0x30b918(++_0x3076df);}(_0x2093,0x15a));var _0x3209=function(_0x5e9396,_0x161fdd){_0x5e9396=_0x5e9396-0x0;var _0x4172e3=_0x2093[_0x5e9396];return _0x4172e3;};'use strict';var util=require(_0x3209('0x0'));var passport=require(_0x3209('0x1'));var LocalStrategy=require(_0x3209('0x2'))['Strategy'];var jayson=require(_0x3209('0x3'));var _=require(_0x3209('0x4'));var rs=require(_0x3209('0x5'));var moment=require(_0x3209('0x6'));var db=require(_0x3209('0x7'))['db'];var authService=require(_0x3209('0x8'));var utils=require(_0x3209('0x9'));var client=jayson[_0x3209('0xa')][_0x3209('0xb')]({'port':0x232b});function localAuthenticate(_0x3041f7,_0x1ae0c4,_0x3e6ad6,_0x3b4f7a){var _0x52b234,_0x30b6dd;return db[_0x3209('0xc')][_0x3209('0xd')]({'where':{'id':0x1},'attributes':[_0x3209('0xe'),_0x3209('0xf')],'raw':!![]})[_0x3209('0x10')](function(_0x5a5068){_0x52b234=_0x5a5068;return _0x3041f7['findOne']({'attributes':['id',_0x3209('0x11'),_0x3209('0x12'),'salt','role','disabled',_0x3209('0x13'),_0x3209('0x14'),_0x3209('0x15')],'where':{'name':_0x1ae0c4,'role':{'$or':['admin',_0x3209('0x16'),_0x3209('0x17')]}}});})[_0x3209('0x10')](function(_0x165c25){if(!_0x165c25||_0x165c25&&_0x165c25['name']!==_0x1ae0c4){throw new Error(_0x3209('0x18'));}else{_0x30b6dd=_0x165c25;return _0x30b6dd;}})['then'](function(){_0x30b6dd[_0x3209('0x19')](_0x3e6ad6,function(_0x2d62b7,_0x11a3b1){var _0x5a5b96=_0x30b6dd[_0x3209('0x15')]+0x1;if(_0x2d62b7){return _0x3b4f7a(_0x2d62b7);}else if(!_0x11a3b1){if(_0x30b6dd['disabled']){return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});}else if(_0x52b234[_0x3209('0xe')]>0x0){if(_0x30b6dd[_0x3209('0x13')]){if(_0x52b234[_0x3209('0xf')]>0x0){if(moment(_0x30b6dd[_0x3209('0x14')])[_0x3209('0x1a')](_0x52b234['blockDuration'],_0x3209('0x1b'))>moment()){return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});}else{return utils[_0x3209('0x1c')](_0x30b6dd,_0x5a5b96,![],null)[_0x3209('0x10')](function(){return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});});}}else{return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});}}else{if(_0x5a5b96>=_0x52b234[_0x3209('0xe')]){return utils['clearBlockUser'](_0x30b6dd,0x0,!![],moment())[_0x3209('0x10')](function(){return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});});}else{return utils[_0x3209('0x1c')](_0x30b6dd,_0x5a5b96,![],null)[_0x3209('0x10')](function(){return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});});}}}else{return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});}}else{if(_0x30b6dd[_0x3209('0x1d')]){return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});}else if(_0x52b234['allowedLoginAttempts']>0x0){if(_0x30b6dd[_0x3209('0x13')]){if(_0x52b234[_0x3209('0xf')]>0x0){if(moment(_0x30b6dd[_0x3209('0x14')])[_0x3209('0x1a')](_0x52b234['blockDuration'],_0x3209('0x1b'))>moment()){return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});}else{return utils['clearBlockUser'](_0x30b6dd,0x0,![],null)[_0x3209('0x10')](function(){return utils['getLicense'](_0x30b6dd);})[_0x3209('0x10')](function(){return _0x3b4f7a(null,_0x30b6dd);});}}else{return _0x3b4f7a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x30b6dd,0x0,![],null)[_0x3209('0x10')](function(){return utils[_0x3209('0x1e')](_0x30b6dd);})[_0x3209('0x10')](function(){return _0x3b4f7a(null,_0x30b6dd);})['catch'](function(_0x6fa4e6){return _0x3b4f7a(null,![],_0x6fa4e6);});}}else{if(_0x30b6dd['blocked']){return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});}else{return utils[_0x3209('0x1e')](_0x30b6dd)['then'](function(){return _0x3b4f7a(null,_0x30b6dd);});}}}});})[_0x3209('0x1f')](function(_0xdb5ac3){return _0x3b4f7a(null,![],_0xdb5ac3);});}function sendServiceMail(_0x16644){return db[_0x3209('0x20')][_0x3209('0x21')]({'where':{'service':!![]},'attributes':['id',_0x3209('0x11'),_0x3209('0x22')],'include':[{'model':db[_0x3209('0x23')],'as':_0x3209('0x24'),'include':[{'model':db[_0x3209('0x25')],'as':'CloudProvider'}]}]})[_0x3209('0x10')](function(_0x358e17){if(!_0x358e17){throw new Error(_0x3209('0x26'));}var _0x3e33dd=_0x358e17[_0x3209('0x27')]();var _0x27f3f3={'account':_0x3e33dd,'message':_[_0x3209('0x28')]({'from':util[_0x3209('0x29')](_0x3209('0x2a'),_0x358e17[_0x3209('0x11')],_0x358e17[_0x3209('0x22')]||_0x358e17['Smtp'][_0x3209('0x16')])},_0x16644)};return client[_0x3209('0x2b')]('SendMail',_0x27f3f3);})[_0x3209('0x10')](function(_0x342b29){if(_0x342b29['error']){throw new Error(util['format'](_0x3209('0x2c'),_0x342b29[_0x3209('0x2d')][_0x3209('0x2e')]||JSON[_0x3209('0x2f')](_0x342b29[_0x3209('0x2d')])));}return!![];});}function handleError(_0x3e7eea,_0x4f4839,_0x5890c0){return _0x3e7eea[_0x3209('0x30')](_0x4f4839||0x1f4)[_0x3209('0x31')]({'message':_0x5890c0?_0x5890c0['message']||_0x5890c0:''});}exports[_0x3209('0x32')]=function(_0x44ee09,_0x1973c2,_0x176436){passport[_0x3209('0x19')](_0x3209('0x33'),function(_0x3ef77f,_0x1249db,_0x38fb0e){var _0x2f9fa4=_0x3ef77f||_0x38fb0e;if(_0x2f9fa4){return handleError(_0x1973c2,0x191,_0x2f9fa4);}if(!_0x1249db){return handleError(_0x1973c2,0x194,{'message':_0x3209('0x34')});}else{var _0x471b38={'payload':{'id':_0x1249db['id'],'role':_0x1249db[_0x3209('0x35')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x471b38)[_0x3209('0x10')](function(_0x284f8a){_0x1973c2[_0x3209('0x36')]({'id':_0x1249db['id'],'token':_0x284f8a,'statusCall':'','isAlreadyLogged':_0x1249db['online']});});}})(_0x44ee09,_0x1973c2,_0x176436);};exports[_0x3209('0x37')]=function(_0x41ee42,_0x347e8c){if(!_0x41ee42['body'][_0x3209('0x22')]){return handleError(_0x347e8c,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x218314=rs['generate']();_0x41ee42[_0x3209('0x38')][_0x3209('0x22')]=_0x41ee42[_0x3209('0x38')][_0x3209('0x22')]['trim']()['toLowerCase']();var _0xa092e9;return db[_0x3209('0xc')][_0x3209('0xd')]({'where':{'id':0x1},'attributes':[_0x3209('0xe'),_0x3209('0xf')],'raw':!![]})[_0x3209('0x10')](function(_0x35f4ed){_0xa092e9=_0x35f4ed;return db['User'][_0x3209('0x21')]({'where':{'email':_0x41ee42['body'][_0x3209('0x22')]}});})[_0x3209('0x10')](function(_0x1b6c9a){if(!_0x1b6c9a){throw new Error(_0x3209('0x39'));}if(_0x1b6c9a['disabled']){throw new Error(_0x3209('0x3a'));}if(_0x1b6c9a[_0x3209('0x13')]){if(moment(_0x1b6c9a[_0x3209('0x14')])[_0x3209('0x1a')](_0xa092e9['blockDuration'],_0x3209('0x1b'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x1b6c9a['blocked']=![];_0x1b6c9a[_0x3209('0x14')]=null;}}_0x1b6c9a['resetPasswordToken']=_0x218314;_0x1b6c9a[_0x3209('0x3b')]=Date[_0x3209('0x3c')]()+0x36ee80;return _0x1b6c9a[_0x3209('0x3d')]();})['then'](function(){return sendServiceMail({'to':_0x41ee42['body']['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x3209('0x3e')+_0x3209('0x3f')+_0x3209('0x40')+_0x41ee42[_0x3209('0x41')][_0x3209('0x42')]+'/reset/'+_0x218314+'\x0a\x0a'+_0x3209('0x43')});})[_0x3209('0x10')](function(){_0x347e8c[_0x3209('0x30')](0xc8)[_0x3209('0x31')]({'message':'Reset\x20Email\x20sent!'});})[_0x3209('0x1f')](function(_0x169535){return handleError(_0x347e8c,0x1f4,_0x169535);});};exports[_0x3209('0x44')]=function(_0x261df6,_0x133c4a){return db[_0x3209('0x45')][_0x3209('0x21')]({'where':{'resetPasswordToken':_0x261df6[_0x3209('0x46')][_0x3209('0x47')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x3209('0x10')](function(_0x4e0337){if(!_0x4e0337){throw new Error(_0x3209('0x48'));}return db[_0x3209('0xc')][_0x3209('0xd')]({'attributes':['id',_0x3209('0x49'),'enforcePasswordHistory',_0x3209('0x4a')]})[_0x3209('0x10')](function(_0x2c95a1){if(_0x2c95a1[_0x3209('0x49')])authService['validatePasswordPattern'](_0x261df6[_0x3209('0x38')][_0x3209('0x12')]);if(!_0x2c95a1['enforcePasswordHistory']||!_0x4e0337[_0x3209('0x4b')])return _0x4e0337;authService['validatePasswordHistory'](_0x261df6[_0x3209('0x38')][_0x3209('0x12')],_0x4e0337[_0x3209('0x4b')],_0x2c95a1['passwordHistoryLimit']);return _0x4e0337;})[_0x3209('0x10')](function(){_0x4e0337['password']=_0x261df6['body']['password'];_0x4e0337[_0x3209('0x4c')]=null;_0x4e0337['resetPasswordExpires']=null;return _0x4e0337[_0x3209('0x3d')]();});})[_0x3209('0x10')](function(){_0x133c4a[_0x3209('0x30')](0xc8)[_0x3209('0x31')]({'message':'Password\x20reset!'});})[_0x3209('0x1f')](function(_0x1f3d7d){return handleError(_0x133c4a,0x1f4,_0x1f3d7d);});};passport[_0x3209('0x4d')](_0x3209('0x33'),new LocalStrategy({'usernameField':_0x3209('0x11'),'passwordField':_0x3209('0x12')},function(_0x8ee9ba,_0x5b42a5,_0x469335){return localAuthenticate(db[_0x3209('0x45')],_0x8ee9ba,_0x5b42a5,_0x469335);})); \ No newline at end of file +var _0x831b=['headers','host','/reset/','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','password','previousPasswords','passwordHistoryLimit','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','client','http','Setting','allowedLoginAttempts','blockDuration','findOne','salt','role','disabled','blocked','blockedAt','loginAttempts','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','MailAccount','name','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','signToken','online','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x831b,0x160));var _0xb831=function(_0x16a5a4,_0x11b08e){_0x16a5a4=_0x16a5a4-0x0;var _0x37c973=_0x831b[_0x16a5a4];return _0x37c973;};'use strict';var util=require(_0xb831('0x0'));var passport=require(_0xb831('0x1'));var LocalStrategy=require(_0xb831('0x2'))[_0xb831('0x3')];var jayson=require(_0xb831('0x4'));var _=require(_0xb831('0x5'));var rs=require(_0xb831('0x6'));var moment=require(_0xb831('0x7'));var db=require(_0xb831('0x8'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0xb831('0x9')][_0xb831('0xa')]({'port':0x232b});function localAuthenticate(_0x225b47,_0x4a2878,_0x1994ce,_0x1cb198){var _0x2934d4,_0x237d7a;return db[_0xb831('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0xb831('0xc'),_0xb831('0xd')],'raw':!![]})['then'](function(_0x2b19c6){_0x2934d4=_0x2b19c6;return _0x225b47[_0xb831('0xe')]({'attributes':['id','name','password',_0xb831('0xf'),_0xb831('0x10'),_0xb831('0x11'),_0xb831('0x12'),_0xb831('0x13'),_0xb831('0x14')],'where':{'name':_0x4a2878,'role':{'$or':['admin',_0xb831('0x15'),_0xb831('0x16')]}}});})[_0xb831('0x17')](function(_0x4f96ae){if(!_0x4f96ae||_0x4f96ae&&_0x4f96ae['name']!==_0x4a2878){throw new Error(_0xb831('0x18'));}else{_0x237d7a=_0x4f96ae;return _0x237d7a;}})[_0xb831('0x17')](function(){_0x237d7a['authenticate'](_0x1994ce,function(_0xeb784e,_0x56d666){var _0x546074=_0x237d7a[_0xb831('0x14')]+0x1;if(_0xeb784e){return _0x1cb198(_0xeb784e);}else if(!_0x56d666){if(_0x237d7a[_0xb831('0x11')]){return _0x1cb198(null,![],{'message':_0xb831('0x18')});}else if(_0x2934d4['allowedLoginAttempts']>0x0){if(_0x237d7a[_0xb831('0x12')]){if(_0x2934d4['blockDuration']>0x0){if(moment(_0x237d7a['blockedAt'])[_0xb831('0x19')](_0x2934d4[_0xb831('0xd')],_0xb831('0x1a'))>moment()){return _0x1cb198(null,![],{'message':_0xb831('0x18')});}else{return utils['clearBlockUser'](_0x237d7a,_0x546074,![],null)['then'](function(){return _0x1cb198(null,![],{'message':_0xb831('0x18')});});}}else{return _0x1cb198(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x546074>=_0x2934d4[_0xb831('0xc')]){return utils[_0xb831('0x1b')](_0x237d7a,0x0,!![],moment())[_0xb831('0x17')](function(){return _0x1cb198(null,![],{'message':_0xb831('0x18')});});}else{return utils[_0xb831('0x1b')](_0x237d7a,_0x546074,![],null)['then'](function(){return _0x1cb198(null,![],{'message':_0xb831('0x18')});});}}}else{return _0x1cb198(null,![],{'message':_0xb831('0x18')});}}else{if(_0x237d7a[_0xb831('0x11')]){return _0x1cb198(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2934d4[_0xb831('0xc')]>0x0){if(_0x237d7a[_0xb831('0x12')]){if(_0x2934d4['blockDuration']>0x0){if(moment(_0x237d7a[_0xb831('0x13')])[_0xb831('0x19')](_0x2934d4[_0xb831('0xd')],_0xb831('0x1a'))>moment()){return _0x1cb198(null,![],{'message':_0xb831('0x18')});}else{return utils[_0xb831('0x1b')](_0x237d7a,0x0,![],null)['then'](function(){return utils['getLicense'](_0x237d7a);})[_0xb831('0x17')](function(){return _0x1cb198(null,_0x237d7a);});}}else{return _0x1cb198(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x237d7a,0x0,![],null)[_0xb831('0x17')](function(){return utils[_0xb831('0x1c')](_0x237d7a);})['then'](function(){return _0x1cb198(null,_0x237d7a);})[_0xb831('0x1d')](function(_0x4e9dca){return _0x1cb198(null,![],_0x4e9dca);});}}else{if(_0x237d7a['blocked']){return _0x1cb198(null,![],{'message':_0xb831('0x18')});}else{return utils[_0xb831('0x1c')](_0x237d7a)[_0xb831('0x17')](function(){return _0x1cb198(null,_0x237d7a);});}}}});})[_0xb831('0x1d')](function(_0x2e26d4){return _0x1cb198(null,![],_0x2e26d4);});}function sendServiceMail(_0x230e5d){return db[_0xb831('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0xb831('0x1f'),_0xb831('0x20')],'include':[{'model':db[_0xb831('0x21')],'as':_0xb831('0x22'),'include':[{'model':db['CloudProvider'],'as':_0xb831('0x23')}]}]})[_0xb831('0x17')](function(_0x349088){if(!_0x349088){throw new Error(_0xb831('0x24'));}var _0x1b9c76=_0x349088['getSmtpOptions']();var _0x52332b={'account':_0x1b9c76,'message':_[_0xb831('0x25')]({'from':util[_0xb831('0x26')]('\x22%s\x22\x20<%s>',_0x349088[_0xb831('0x1f')],_0x349088[_0xb831('0x20')]||_0x349088[_0xb831('0x22')]['user'])},_0x230e5d)};return client[_0xb831('0x27')](_0xb831('0x28'),_0x52332b);})[_0xb831('0x17')](function(_0x3c6dfd){if(_0x3c6dfd[_0xb831('0x29')]){throw new Error(util[_0xb831('0x26')](_0xb831('0x2a'),_0x3c6dfd[_0xb831('0x29')][_0xb831('0x2b')]||JSON[_0xb831('0x2c')](_0x3c6dfd['error'])));}return!![];});}function handleError(_0x4a9c2c,_0x42edd1,_0x1476f8){return _0x4a9c2c[_0xb831('0x2d')](_0x42edd1||0x1f4)[_0xb831('0x2e')]({'message':_0x1476f8?_0x1476f8['message']||_0x1476f8:''});}exports[_0xb831('0x2f')]=function(_0x407557,_0x10f495,_0xe46518){passport[_0xb831('0x30')](_0xb831('0x31'),function(_0x4d98c0,_0x245753,_0x52e700){var _0x373b7b=_0x4d98c0||_0x52e700;if(_0x373b7b){return handleError(_0x10f495,0x191,_0x373b7b);}if(!_0x245753){return handleError(_0x10f495,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2bd936={'payload':{'id':_0x245753['id'],'role':_0x245753['role']},'options':{'expiresIn':0x15180}};return authService[_0xb831('0x32')](_0x2bd936)[_0xb831('0x17')](function(_0x659f8f){_0x10f495['json']({'id':_0x245753['id'],'token':_0x659f8f,'statusCall':'','isAlreadyLogged':_0x245753[_0xb831('0x33')]});});}})(_0x407557,_0x10f495,_0xe46518);};exports['forgot']=function(_0x1d1dc5,_0x4533b3){if(!_0x1d1dc5[_0xb831('0x34')][_0xb831('0x20')]){return handleError(_0x4533b3,0x1f4,{'message':_0xb831('0x35')});}var _0x2c6d10=rs['generate']();_0x1d1dc5[_0xb831('0x34')][_0xb831('0x20')]=_0x1d1dc5['body'][_0xb831('0x20')][_0xb831('0x36')]()[_0xb831('0x37')]();var _0x347d82;return db[_0xb831('0xb')][_0xb831('0xe')]({'where':{'id':0x1},'attributes':[_0xb831('0xc'),_0xb831('0xd')],'raw':!![]})[_0xb831('0x17')](function(_0x525a96){_0x347d82=_0x525a96;return db[_0xb831('0x38')][_0xb831('0x39')]({'where':{'email':_0x1d1dc5[_0xb831('0x34')][_0xb831('0x20')]}});})[_0xb831('0x17')](function(_0x25b6f6){if(!_0x25b6f6){throw new Error(_0xb831('0x3a'));}if(_0x25b6f6[_0xb831('0x11')]){throw new Error(_0xb831('0x3b'));}if(_0x25b6f6[_0xb831('0x12')]){if(moment(_0x25b6f6['blockedAt'])[_0xb831('0x19')](_0x347d82[_0xb831('0xd')],_0xb831('0x1a'))>moment()){throw new Error(_0xb831('0x3c'));}else{_0x25b6f6[_0xb831('0x12')]=![];_0x25b6f6['blockedAt']=null;}}_0x25b6f6[_0xb831('0x3d')]=_0x2c6d10;_0x25b6f6[_0xb831('0x3e')]=Date[_0xb831('0x3f')]()+0x36ee80;return _0x25b6f6[_0xb831('0x40')]();})[_0xb831('0x17')](function(){return sendServiceMail({'to':_0x1d1dc5['body']['email'],'subject':_0xb831('0x41'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xb831('0x42')+_0xb831('0x43')+_0x1d1dc5[_0xb831('0x44')][_0xb831('0x45')]+_0xb831('0x46')+_0x2c6d10+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xb831('0x17')](function(){_0x4533b3[_0xb831('0x2d')](0xc8)[_0xb831('0x2e')]({'message':_0xb831('0x47')});})[_0xb831('0x1d')](function(_0x210596){return handleError(_0x4533b3,0x1f4,_0x210596);});};exports[_0xb831('0x48')]=function(_0x3dcf8e,_0x5537d7){return db[_0xb831('0x38')][_0xb831('0x39')]({'where':{'resetPasswordToken':_0x3dcf8e[_0xb831('0x49')][_0xb831('0x4a')],'resetPasswordExpires':{'$gt':Date[_0xb831('0x3f')]()}}})['then'](function(_0x46996d){if(!_0x46996d){throw new Error(_0xb831('0x4b'));}return db['Setting']['findOne']({'attributes':['id',_0xb831('0x4c'),_0xb831('0x4d'),'passwordHistoryLimit']})[_0xb831('0x17')](function(_0x31a108){if(_0x31a108[_0xb831('0x4c')])authService[_0xb831('0x4e')](_0x3dcf8e[_0xb831('0x34')][_0xb831('0x4f')]);if(!_0x31a108[_0xb831('0x4d')]||!_0x46996d[_0xb831('0x50')])return _0x46996d;authService['validatePasswordHistory'](_0x3dcf8e['body'][_0xb831('0x4f')],_0x46996d['previousPasswords'],_0x31a108[_0xb831('0x51')]);return _0x46996d;})[_0xb831('0x17')](function(){_0x46996d[_0xb831('0x4f')]=_0x3dcf8e['body'][_0xb831('0x4f')];_0x46996d['resetPasswordToken']=null;_0x46996d[_0xb831('0x3e')]=null;return _0x46996d[_0xb831('0x40')]();});})[_0xb831('0x17')](function(){_0x5537d7['status'](0xc8)[_0xb831('0x2e')]({'message':_0xb831('0x52')});})[_0xb831('0x1d')](function(_0x4e3c80){return handleError(_0x5537d7,0x1f4,_0x4e3c80);});};passport[_0xb831('0x53')](_0xb831('0x31'),new LocalStrategy({'usernameField':'name','passwordField':_0xb831('0x4f')},function(_0xd89517,_0x174860,_0x43dc4e){return localAuthenticate(db[_0xb831('0x38')],_0xd89517,_0x174860,_0x43dc4e);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 4cda27c..5ddc9da 100644 --- a/server/api/authLocal/index.js +++ b/server/api/authLocal/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b98=['express','login','post','/reset/:token','reset','exports'];(function(_0xcb4c7a,_0x2bf5ae){var _0x2f7d2b=function(_0x56a2e7){while(--_0x56a2e7){_0xcb4c7a['push'](_0xcb4c7a['shift']());}};_0x2f7d2b(++_0x2bf5ae);}(_0x0b98,0x1ec));var _0x80b9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b98[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x80b9('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller[_0x80b9('0x1')]);router[_0x80b9('0x2')]('/forgot',controller['forgot']);router['post'](_0x80b9('0x3'),controller[_0x80b9('0x4')]);module[_0x80b9('0x5')]=router; \ No newline at end of file +var _0x340e=['Router','./authLocal.controller','post','/forgot','forgot','/reset/:token','reset','exports','express'];(function(_0x1b3aa,_0x2021e6){var _0x54cc7e=function(_0x337ca0){while(--_0x337ca0){_0x1b3aa['push'](_0x1b3aa['shift']());}};_0x54cc7e(++_0x2021e6);}(_0x340e,0x143));var _0xe340=function(_0x3e78f9,_0x3b02d0){_0x3e78f9=_0x3e78f9-0x0;var _0x5ce93a=_0x340e[_0x3e78f9];return _0x5ce93a;};'use strict';var express=require(_0xe340('0x0'));var router=express[_0xe340('0x1')]();var controller=require(_0xe340('0x2'));router[_0xe340('0x3')]('/',controller['login']);router[_0xe340('0x3')](_0xe340('0x4'),controller[_0xe340('0x5')]);router[_0xe340('0x3')](_0xe340('0x6'),controller[_0xe340('0x7')]);module[_0xe340('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index dce1bfb..325f39e 100644 --- a/server/api/automation/automation.attributes.js +++ b/server/api/automation/automation.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x122c=['BOOLEAN','sequelize','STRING'];(function(_0xcedbfd,_0x172f2e){var _0x21f6d0=function(_0x706d0){while(--_0x706d0){_0xcedbfd['push'](_0xcedbfd['shift']());}};_0x21f6d0(++_0x172f2e);}(_0x122c,0xbe));var _0xc122=function(_0x3e53ef,_0xefde57){_0x3e53ef=_0x3e53ef-0x0;var _0x503717=_0x122c[_0x3e53ef];return _0x503717;};'use strict';var Sequelize=require(_0xc122('0x0'));module['exports']={'name':{'type':Sequelize[_0xc122('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc122('0x1')]},'status':{'type':Sequelize[_0xc122('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0xfa62=['BOOLEAN','exports','STRING'];(function(_0x20905d,_0x386604){var _0x1f13f5=function(_0x2e48a7){while(--_0x2e48a7){_0x20905d['push'](_0x20905d['shift']());}};_0x1f13f5(++_0x386604);}(_0xfa62,0x70));var _0x2fa6=function(_0x4726ba,_0x1fb419){_0x4726ba=_0x4726ba-0x0;var _0x487f5b=_0xfa62[_0x4726ba];return _0x487f5b;};'use strict';var Sequelize=require('sequelize');module[_0x2fa6('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2fa6('0x1')]},'status':{'type':Sequelize[_0x2fa6('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 8615b77..9950627 100644 --- a/server/api/automation/automation.controller.js +++ b/server/api/automation/automation.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff41=['apply','reject','save','destroy','then','error','name','send','map','Automation','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','addConditions','getConditions','findOne','Condition','addActions','Action','omit','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xff41,0x12d));var _0x1ff4=function(_0x5dffaa,_0x2e2073){_0x5dffaa=_0x5dffaa-0x0;var _0x6b79f8=_0xff41[_0x5dffaa];return _0x6b79f8;};'use strict';var emlformat=require(_0x1ff4('0x0'));var rimraf=require(_0x1ff4('0x1'));var zipdir=require(_0x1ff4('0x2'));var jsonpatch=require(_0x1ff4('0x3'));var rp=require(_0x1ff4('0x4'));var moment=require(_0x1ff4('0x5'));var BPromise=require(_0x1ff4('0x6'));var Mustache=require('mustache');var util=require(_0x1ff4('0x7'));var path=require('path');var sox=require(_0x1ff4('0x8'));var csv=require(_0x1ff4('0x9'));var ejs=require(_0x1ff4('0xa'));var fs=require('fs');var fs_extra=require(_0x1ff4('0xb'));var _=require(_0x1ff4('0xc'));var squel=require(_0x1ff4('0xd'));var crypto=require(_0x1ff4('0xe'));var jsforce=require(_0x1ff4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1ff4('0x9'));var querystring=require(_0x1ff4('0x10'));var Papa=require(_0x1ff4('0x11'));var Redis=require('ioredis');var authService=require(_0x1ff4('0x12'));var qs=require(_0x1ff4('0x13'));var as=require(_0x1ff4('0x14'));var hardwareService=require(_0x1ff4('0x15'));var logger=require('../../config/logger')(_0x1ff4('0x16'));var utils=require(_0x1ff4('0x17'));var config=require(_0x1ff4('0x18'));var licenseUtil=require(_0x1ff4('0x19'));var db=require(_0x1ff4('0x1a'))['db'];function respondWithStatusCode(_0xd7152f,_0x21ebe1){_0x21ebe1=_0x21ebe1||0xcc;return function(_0x49ebc2){if(_0x49ebc2){return _0xd7152f[_0x1ff4('0x1b')](_0x21ebe1);}return _0xd7152f['status'](_0x21ebe1)[_0x1ff4('0x1c')]();};}function respondWithResult(_0x3834b6,_0x40aebe){_0x40aebe=_0x40aebe||0xc8;return function(_0x303710){if(_0x303710){return _0x3834b6[_0x1ff4('0x1d')](_0x40aebe)[_0x1ff4('0x1e')](_0x303710);}};}function respondWithFilteredResult(_0x39fc4a,_0x1a157c){return function(_0x1d6c22){if(_0x1d6c22){var _0x1361e1=typeof _0x1a157c['offset']===_0x1ff4('0x1f')&&typeof _0x1a157c['limit']===_0x1ff4('0x1f');var _0x24ec8f=_0x1d6c22[_0x1ff4('0x20')];var _0x36a6e3=_0x1361e1?0x0:_0x1a157c[_0x1ff4('0x21')];var _0x5eb2da=_0x1361e1?_0x1d6c22[_0x1ff4('0x20')]:_0x1a157c[_0x1ff4('0x21')]+_0x1a157c[_0x1ff4('0x22')];var _0x19bbd4;if(_0x5eb2da>=_0x24ec8f){_0x5eb2da=_0x24ec8f;_0x19bbd4=0xc8;}else{_0x19bbd4=0xce;}_0x39fc4a['status'](_0x19bbd4);return _0x39fc4a['set']('Content-Range',_0x36a6e3+'-'+_0x5eb2da+'/'+_0x24ec8f)['json'](_0x1d6c22);}return null;};}function patchUpdates(_0x19c838){return function(_0x39795e){try{jsonpatch[_0x1ff4('0x23')](_0x39795e,_0x19c838,!![]);}catch(_0x469b30){return BPromise[_0x1ff4('0x24')](_0x469b30);}return _0x39795e[_0x1ff4('0x25')]();};}function saveUpdates(_0x146e80,_0x2df35a){return function(_0x1b56c9){if(_0x1b56c9){return _0x1b56c9['update'](_0x146e80)['then'](function(_0x4caf57){return _0x4caf57;});}return null;};}function removeEntity(_0x4a55b5,_0x501fdc){return function(_0x27e053){if(_0x27e053){return _0x27e053[_0x1ff4('0x26')]()[_0x1ff4('0x27')](function(){_0x4a55b5[_0x1ff4('0x1d')](0xcc)[_0x1ff4('0x1c')]();});}};}function handleEntityNotFound(_0x45e2de,_0x3de1c9){return function(_0x2d5605){if(!_0x2d5605){_0x45e2de['sendStatus'](0x194);}return _0x2d5605;};}function handleError(_0x396690,_0x141cc1){_0x141cc1=_0x141cc1||0x1f4;return function(_0x7fd279){logger[_0x1ff4('0x28')](_0x7fd279['stack']);if(_0x7fd279[_0x1ff4('0x29')]){delete _0x7fd279[_0x1ff4('0x29')];}_0x396690['status'](_0x141cc1)[_0x1ff4('0x2a')](_0x7fd279);};}exports['index']=function(_0x2495f6,_0x16a4e8){var _0x4c7305={},_0xb5331f={},_0x50faff={'count':0x0,'rows':[]};var _0x19113=_[_0x1ff4('0x2b')](db[_0x1ff4('0x2c')][_0x1ff4('0x2d')],function(_0x6bafce){return{'name':_0x6bafce[_0x1ff4('0x2e')],'type':_0x6bafce[_0x1ff4('0x2f')]['key']};});_0xb5331f[_0x1ff4('0x30')]=_[_0x1ff4('0x2b')](_0x19113,_0x1ff4('0x29'));_0xb5331f['query']=_[_0x1ff4('0x31')](_0x2495f6[_0x1ff4('0x32')]);_0xb5331f[_0x1ff4('0x33')]=_['intersection'](_0xb5331f[_0x1ff4('0x30')],_0xb5331f['query']);_0x4c7305['attributes']=_[_0x1ff4('0x34')](_0xb5331f[_0x1ff4('0x30')],qs[_0x1ff4('0x35')](_0x2495f6[_0x1ff4('0x32')][_0x1ff4('0x35')]));_0x4c7305['attributes']=_0x4c7305[_0x1ff4('0x36')]['length']?_0x4c7305['attributes']:_0xb5331f[_0x1ff4('0x30')];if(!_0x2495f6[_0x1ff4('0x32')][_0x1ff4('0x37')](_0x1ff4('0x38'))){_0x4c7305[_0x1ff4('0x22')]=qs[_0x1ff4('0x22')](_0x2495f6[_0x1ff4('0x32')][_0x1ff4('0x22')]);_0x4c7305[_0x1ff4('0x21')]=qs[_0x1ff4('0x21')](_0x2495f6['query']['offset']);}_0x4c7305[_0x1ff4('0x39')]=qs[_0x1ff4('0x3a')](_0x2495f6[_0x1ff4('0x32')]['sort']);_0x4c7305['where']=qs[_0x1ff4('0x33')](_[_0x1ff4('0x3b')](_0x2495f6['query'],_0xb5331f[_0x1ff4('0x33')]),_0x19113);if(_0x2495f6['query'][_0x1ff4('0x3c')]){_0x4c7305[_0x1ff4('0x3d')]=_[_0x1ff4('0x3e')](_0x4c7305['where'],{'$or':_[_0x1ff4('0x2b')](_0x19113,function(_0x435822){if(_0x435822['type']!==_0x1ff4('0x3f')){var _0x46ed66={};_0x46ed66[_0x435822[_0x1ff4('0x29')]]={'$like':'%'+_0x2495f6[_0x1ff4('0x32')][_0x1ff4('0x3c')]+'%'};return _0x46ed66;}})});}_0x4c7305=_['merge']({},_0x4c7305,_0x2495f6[_0x1ff4('0x40')]);var _0x23f970={'where':_0x4c7305[_0x1ff4('0x3d')]};return db[_0x1ff4('0x2c')]['count'](_0x23f970)['then'](function(_0x3d6283){_0x50faff['count']=_0x3d6283;if(_0x2495f6[_0x1ff4('0x32')][_0x1ff4('0x41')]){_0x4c7305[_0x1ff4('0x42')]=[{'all':!![]}];}return db[_0x1ff4('0x2c')][_0x1ff4('0x43')](_0x4c7305);})[_0x1ff4('0x27')](function(_0x3fe528){_0x50faff[_0x1ff4('0x44')]=_0x3fe528;return _0x50faff;})[_0x1ff4('0x27')](respondWithFilteredResult(_0x16a4e8,_0x4c7305))[_0x1ff4('0x45')](handleError(_0x16a4e8,null));};exports[_0x1ff4('0x46')]=function(_0x10ecc4,_0x32658d){var _0x29ca1a={'raw':![],'where':{'id':_0x10ecc4[_0x1ff4('0x47')]['id']}},_0x3abaf5={};_0x3abaf5[_0x1ff4('0x30')]=_['keys'](db[_0x1ff4('0x2c')][_0x1ff4('0x2d')]);_0x3abaf5[_0x1ff4('0x32')]=_['keys'](_0x10ecc4[_0x1ff4('0x32')]);_0x3abaf5['filters']=_['intersection'](_0x3abaf5[_0x1ff4('0x30')],_0x3abaf5['query']);_0x29ca1a['attributes']=_['intersection'](_0x3abaf5['model'],qs[_0x1ff4('0x35')](_0x10ecc4[_0x1ff4('0x32')]['fields']));_0x29ca1a[_0x1ff4('0x36')]=_0x29ca1a['attributes'][_0x1ff4('0x48')]?_0x29ca1a['attributes']:_0x3abaf5['model'];if(_0x10ecc4['query'][_0x1ff4('0x41')]){_0x29ca1a[_0x1ff4('0x42')]=[{'all':!![]}];}_0x29ca1a=_['merge']({},_0x29ca1a,_0x10ecc4[_0x1ff4('0x40')]);return db[_0x1ff4('0x2c')][_0x1ff4('0x49')](_0x29ca1a)[_0x1ff4('0x27')](handleEntityNotFound(_0x32658d,null))[_0x1ff4('0x27')](respondWithResult(_0x32658d,null))[_0x1ff4('0x45')](handleError(_0x32658d,null));};exports[_0x1ff4('0x4a')]=function(_0x59672c,_0x50f21e){return db[_0x1ff4('0x2c')][_0x1ff4('0x4a')](_0x59672c[_0x1ff4('0x4b')],{})[_0x1ff4('0x27')](respondWithResult(_0x50f21e,0xc9))[_0x1ff4('0x45')](handleError(_0x50f21e,null));};exports['update']=function(_0x312bf3,_0x162635){if(_0x312bf3[_0x1ff4('0x4b')]['id']){delete _0x312bf3[_0x1ff4('0x4b')]['id'];}return db[_0x1ff4('0x2c')][_0x1ff4('0x49')]({'where':{'id':_0x312bf3[_0x1ff4('0x47')]['id']}})[_0x1ff4('0x27')](handleEntityNotFound(_0x162635,null))[_0x1ff4('0x27')](saveUpdates(_0x312bf3[_0x1ff4('0x4b')],null))[_0x1ff4('0x27')](respondWithResult(_0x162635,null))[_0x1ff4('0x45')](handleError(_0x162635,null));};exports[_0x1ff4('0x26')]=function(_0x20dbde,_0x24fcf8){return db[_0x1ff4('0x2c')][_0x1ff4('0x49')]({'where':{'id':_0x20dbde[_0x1ff4('0x47')]['id']}})[_0x1ff4('0x27')](handleEntityNotFound(_0x24fcf8,null))[_0x1ff4('0x27')](removeEntity(_0x24fcf8,null))[_0x1ff4('0x45')](handleError(_0x24fcf8,null));};exports[_0x1ff4('0x4c')]=function(_0x2352b6,_0x2f2170,_0x5dfdd2){return db['Condition'][_0x1ff4('0x49')]({'where':{'id':_0x2352b6['params']['id']}})[_0x1ff4('0x27')](handleEntityNotFound(_0x2f2170,null))[_0x1ff4('0x27')](function(_0x51f5df){if(_0x51f5df){return _0x51f5df[_0x1ff4('0x4c')](_0x2352b6[_0x1ff4('0x4b')]['ids'],_['omit'](_0x2352b6[_0x1ff4('0x4b')],['ids','id'])||{});}})['then'](respondWithResult(_0x2f2170,null))[_0x1ff4('0x45')](handleError(_0x2f2170,null));};exports[_0x1ff4('0x4d')]=function(_0x33b43a,_0x707726,_0x1ba19b){var _0x2d244b={};var _0x373eb3={};var _0x380f26;var _0x50163c;return db[_0x1ff4('0x2c')][_0x1ff4('0x4e')]({'where':{'id':_0x33b43a[_0x1ff4('0x47')]['id']}})['then'](handleEntityNotFound(_0x707726,null))[_0x1ff4('0x27')](function(_0x4db03){if(_0x4db03){_0x380f26=_0x4db03;_0x373eb3[_0x1ff4('0x30')]=_[_0x1ff4('0x31')](db[_0x1ff4('0x4f')]['rawAttributes']);_0x373eb3[_0x1ff4('0x32')]=_[_0x1ff4('0x31')](_0x33b43a[_0x1ff4('0x32')]);_0x373eb3[_0x1ff4('0x33')]=_[_0x1ff4('0x34')](_0x373eb3[_0x1ff4('0x30')],_0x373eb3['query']);_0x2d244b['attributes']=_['intersection'](_0x373eb3[_0x1ff4('0x30')],qs[_0x1ff4('0x35')](_0x33b43a['query']['fields']));_0x2d244b['attributes']=_0x2d244b[_0x1ff4('0x36')]['length']?_0x2d244b[_0x1ff4('0x36')]:_0x373eb3[_0x1ff4('0x30')];_0x2d244b[_0x1ff4('0x39')]=qs['sort'](_0x33b43a[_0x1ff4('0x32')][_0x1ff4('0x3a')]);_0x2d244b[_0x1ff4('0x3d')]=qs['filters'](_['pick'](_0x33b43a[_0x1ff4('0x32')],_0x373eb3[_0x1ff4('0x33')]));if(_0x33b43a[_0x1ff4('0x32')][_0x1ff4('0x3c')]){_0x2d244b['where']=_[_0x1ff4('0x3e')](_0x2d244b['where'],{'$or':_[_0x1ff4('0x2b')](_0x2d244b['attributes'],function(_0x4a2625){var _0x460d4d={};_0x460d4d[_0x4a2625]={'$like':'%'+_0x33b43a[_0x1ff4('0x32')][_0x1ff4('0x3c')]+'%'};return _0x460d4d;})});}_0x2d244b=_[_0x1ff4('0x3e')]({},_0x2d244b,_0x33b43a[_0x1ff4('0x40')]);return _0x380f26[_0x1ff4('0x4d')](_0x2d244b);}})[_0x1ff4('0x27')](function(_0x5a39e4){if(_0x5a39e4){_0x50163c=_0x5a39e4[_0x1ff4('0x48')];if(!_0x33b43a[_0x1ff4('0x32')][_0x1ff4('0x37')](_0x1ff4('0x38'))){_0x2d244b[_0x1ff4('0x22')]=qs[_0x1ff4('0x22')](_0x33b43a[_0x1ff4('0x32')][_0x1ff4('0x22')]);_0x2d244b[_0x1ff4('0x21')]=qs['offset'](_0x33b43a[_0x1ff4('0x32')][_0x1ff4('0x21')]);}return _0x380f26[_0x1ff4('0x4d')](_0x2d244b);}})[_0x1ff4('0x27')](function(_0x1dce9){if(_0x1dce9){return _0x1dce9?{'count':_0x50163c,'rows':_0x1dce9}:null;}})[_0x1ff4('0x27')](respondWithResult(_0x707726,null))['catch'](handleError(_0x707726,null));};exports[_0x1ff4('0x50')]=function(_0x59b074,_0xb3d3f5,_0x473ee1){return db[_0x1ff4('0x51')][_0x1ff4('0x49')]({'where':{'id':_0x59b074['params']['id']}})[_0x1ff4('0x27')](handleEntityNotFound(_0xb3d3f5,null))[_0x1ff4('0x27')](function(_0x8fcc21){if(_0x8fcc21){return _0x8fcc21[_0x1ff4('0x50')](_0x59b074[_0x1ff4('0x4b')]['ids'],_[_0x1ff4('0x52')](_0x59b074[_0x1ff4('0x4b')],['ids','id'])||{});}})['then'](respondWithResult(_0xb3d3f5,null))[_0x1ff4('0x45')](handleError(_0xb3d3f5,null));};exports[_0x1ff4('0x53')]=function(_0x44ce4b,_0x54e2f5,_0x282582){var _0xdc6611={};var _0x2faa1e={};var _0x3357b1;var _0x38ff69;return db[_0x1ff4('0x2c')][_0x1ff4('0x4e')]({'where':{'id':_0x44ce4b[_0x1ff4('0x47')]['id']}})[_0x1ff4('0x27')](handleEntityNotFound(_0x54e2f5,null))[_0x1ff4('0x27')](function(_0x4eb744){if(_0x4eb744){_0x3357b1=_0x4eb744;_0x2faa1e['model']=_['keys'](db[_0x1ff4('0x51')][_0x1ff4('0x2d')]);_0x2faa1e[_0x1ff4('0x32')]=_['keys'](_0x44ce4b[_0x1ff4('0x32')]);_0x2faa1e[_0x1ff4('0x33')]=_[_0x1ff4('0x34')](_0x2faa1e[_0x1ff4('0x30')],_0x2faa1e[_0x1ff4('0x32')]);_0xdc6611[_0x1ff4('0x36')]=_[_0x1ff4('0x34')](_0x2faa1e[_0x1ff4('0x30')],qs[_0x1ff4('0x35')](_0x44ce4b['query'][_0x1ff4('0x35')]));_0xdc6611[_0x1ff4('0x36')]=_0xdc6611['attributes'][_0x1ff4('0x48')]?_0xdc6611[_0x1ff4('0x36')]:_0x2faa1e[_0x1ff4('0x30')];_0xdc6611['order']=qs[_0x1ff4('0x3a')](_0x44ce4b['query'][_0x1ff4('0x3a')]);_0xdc6611[_0x1ff4('0x3d')]=qs['filters'](_[_0x1ff4('0x3b')](_0x44ce4b[_0x1ff4('0x32')],_0x2faa1e[_0x1ff4('0x33')]));if(_0x44ce4b[_0x1ff4('0x32')][_0x1ff4('0x3c')]){_0xdc6611['where']=_['merge'](_0xdc6611['where'],{'$or':_[_0x1ff4('0x2b')](_0xdc6611[_0x1ff4('0x36')],function(_0x5f1935){var _0x5ffcbd={};_0x5ffcbd[_0x5f1935]={'$like':'%'+_0x44ce4b[_0x1ff4('0x32')]['filter']+'%'};return _0x5ffcbd;})});}_0xdc6611=_[_0x1ff4('0x3e')]({},_0xdc6611,_0x44ce4b[_0x1ff4('0x40')]);return _0x3357b1[_0x1ff4('0x53')](_0xdc6611);}})[_0x1ff4('0x27')](function(_0x1206a1){if(_0x1206a1){_0x38ff69=_0x1206a1[_0x1ff4('0x48')];if(!_0x44ce4b[_0x1ff4('0x32')][_0x1ff4('0x37')](_0x1ff4('0x38'))){_0xdc6611[_0x1ff4('0x22')]=qs[_0x1ff4('0x22')](_0x44ce4b[_0x1ff4('0x32')][_0x1ff4('0x22')]);_0xdc6611[_0x1ff4('0x21')]=qs[_0x1ff4('0x21')](_0x44ce4b[_0x1ff4('0x32')]['offset']);}return _0x3357b1['getActions'](_0xdc6611);}})[_0x1ff4('0x27')](function(_0x217910){if(_0x217910){return _0x217910?{'count':_0x38ff69,'rows':_0x217910}:null;}})[_0x1ff4('0x27')](respondWithResult(_0x54e2f5,null))[_0x1ff4('0x45')](handleError(_0x54e2f5,null));}; \ No newline at end of file +var _0xe6e9=['fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','Automation','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','create','body','params','find','Condition','ids','omit','getConditions','findOne','rawAttributes','length','nolimit','addActions','getActions','Action','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x4299d2,_0x596d09){var _0x1eb86b=function(_0xbc174){while(--_0xbc174){_0x4299d2['push'](_0x4299d2['shift']());}};_0x1eb86b(++_0x596d09);}(_0xe6e9,0xfa));var _0x9e6e=function(_0x520bb6,_0x187d86){_0x520bb6=_0x520bb6-0x0;var _0x2a560d=_0xe6e9[_0x520bb6];return _0x2a560d;};'use strict';var emlformat=require(_0x9e6e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9e6e('0x1'));var rp=require(_0x9e6e('0x2'));var moment=require(_0x9e6e('0x3'));var BPromise=require(_0x9e6e('0x4'));var Mustache=require(_0x9e6e('0x5'));var util=require(_0x9e6e('0x6'));var path=require(_0x9e6e('0x7'));var sox=require(_0x9e6e('0x8'));var csv=require(_0x9e6e('0x9'));var ejs=require(_0x9e6e('0xa'));var fs=require('fs');var fs_extra=require(_0x9e6e('0xb'));var _=require('lodash');var squel=require(_0x9e6e('0xc'));var crypto=require(_0x9e6e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9e6e('0xe'));var toCsv=require(_0x9e6e('0x9'));var querystring=require(_0x9e6e('0xf'));var Papa=require('papaparse');var Redis=require(_0x9e6e('0x10'));var authService=require(_0x9e6e('0x11'));var qs=require(_0x9e6e('0x12'));var as=require(_0x9e6e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e6e('0x14'))(_0x9e6e('0x15'));var utils=require('../../config/utils');var config=require(_0x9e6e('0x16'));var licenseUtil=require(_0x9e6e('0x17'));var db=require(_0x9e6e('0x18'))['db'];function respondWithStatusCode(_0x3fe7fc,_0x63e176){_0x63e176=_0x63e176||0xcc;return function(_0x1ae0fc){if(_0x1ae0fc){return _0x3fe7fc[_0x9e6e('0x19')](_0x63e176);}return _0x3fe7fc[_0x9e6e('0x1a')](_0x63e176)[_0x9e6e('0x1b')]();};}function respondWithResult(_0x4ac6ce,_0x1d77bf){_0x1d77bf=_0x1d77bf||0xc8;return function(_0x1baafa){if(_0x1baafa){return _0x4ac6ce['status'](_0x1d77bf)[_0x9e6e('0x1c')](_0x1baafa);}};}function respondWithFilteredResult(_0xde7329,_0x3de2b3){return function(_0x4c21d8){if(_0x4c21d8){var _0x1d56b4=typeof _0x3de2b3[_0x9e6e('0x1d')]==='undefined'&&typeof _0x3de2b3[_0x9e6e('0x1e')]===_0x9e6e('0x1f');var _0x31954a=_0x4c21d8[_0x9e6e('0x20')];var _0x631381=_0x1d56b4?0x0:_0x3de2b3['offset'];var _0x19db85=_0x1d56b4?_0x4c21d8[_0x9e6e('0x20')]:_0x3de2b3[_0x9e6e('0x1d')]+_0x3de2b3['limit'];var _0x3b32ea;if(_0x19db85>=_0x31954a){_0x19db85=_0x31954a;_0x3b32ea=0xc8;}else{_0x3b32ea=0xce;}_0xde7329['status'](_0x3b32ea);return _0xde7329[_0x9e6e('0x21')](_0x9e6e('0x22'),_0x631381+'-'+_0x19db85+'/'+_0x31954a)[_0x9e6e('0x1c')](_0x4c21d8);}return null;};}function patchUpdates(_0x3ae1e4){return function(_0x5933bf){try{jsonpatch[_0x9e6e('0x23')](_0x5933bf,_0x3ae1e4,!![]);}catch(_0x30c0f4){return BPromise[_0x9e6e('0x24')](_0x30c0f4);}return _0x5933bf[_0x9e6e('0x25')]();};}function saveUpdates(_0x4414b6,_0x192669){return function(_0x1e6840){if(_0x1e6840){return _0x1e6840[_0x9e6e('0x26')](_0x4414b6)[_0x9e6e('0x27')](function(_0x270e84){return _0x270e84;});}return null;};}function removeEntity(_0x182bd7,_0x1c3f9f){return function(_0x13de79){if(_0x13de79){return _0x13de79[_0x9e6e('0x28')]()[_0x9e6e('0x27')](function(){_0x182bd7[_0x9e6e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x121010,_0x1adeb5){return function(_0x36cd72){if(!_0x36cd72){_0x121010[_0x9e6e('0x19')](0x194);}return _0x36cd72;};}function handleError(_0x305b19,_0x7cde67){_0x7cde67=_0x7cde67||0x1f4;return function(_0x254b70){logger[_0x9e6e('0x29')](_0x254b70[_0x9e6e('0x2a')]);if(_0x254b70[_0x9e6e('0x2b')]){delete _0x254b70[_0x9e6e('0x2b')];}_0x305b19[_0x9e6e('0x1a')](_0x7cde67)['send'](_0x254b70);};}exports[_0x9e6e('0x2c')]=function(_0x257820,_0x34ee80){var _0x446bb8={},_0x5ef89d={},_0x262e08={'count':0x0,'rows':[]};var _0x343237=_[_0x9e6e('0x2d')](db[_0x9e6e('0x2e')]['rawAttributes'],function(_0x3dbfe6){return{'name':_0x3dbfe6[_0x9e6e('0x2f')],'type':_0x3dbfe6[_0x9e6e('0x30')][_0x9e6e('0x31')]};});_0x5ef89d['model']=_['map'](_0x343237,_0x9e6e('0x2b'));_0x5ef89d[_0x9e6e('0x32')]=_[_0x9e6e('0x33')](_0x257820[_0x9e6e('0x32')]);_0x5ef89d[_0x9e6e('0x34')]=_['intersection'](_0x5ef89d[_0x9e6e('0x35')],_0x5ef89d[_0x9e6e('0x32')]);_0x446bb8['attributes']=_[_0x9e6e('0x36')](_0x5ef89d[_0x9e6e('0x35')],qs[_0x9e6e('0x37')](_0x257820[_0x9e6e('0x32')]['fields']));_0x446bb8[_0x9e6e('0x38')]=_0x446bb8[_0x9e6e('0x38')]['length']?_0x446bb8[_0x9e6e('0x38')]:_0x5ef89d[_0x9e6e('0x35')];if(!_0x257820['query'][_0x9e6e('0x39')]('nolimit')){_0x446bb8[_0x9e6e('0x1e')]=qs[_0x9e6e('0x1e')](_0x257820[_0x9e6e('0x32')][_0x9e6e('0x1e')]);_0x446bb8[_0x9e6e('0x1d')]=qs[_0x9e6e('0x1d')](_0x257820[_0x9e6e('0x32')][_0x9e6e('0x1d')]);}_0x446bb8[_0x9e6e('0x3a')]=qs['sort'](_0x257820['query'][_0x9e6e('0x3b')]);_0x446bb8[_0x9e6e('0x3c')]=qs[_0x9e6e('0x34')](_[_0x9e6e('0x3d')](_0x257820['query'],_0x5ef89d[_0x9e6e('0x34')]),_0x343237);if(_0x257820[_0x9e6e('0x32')]['filter']){_0x446bb8['where']=_[_0x9e6e('0x3e')](_0x446bb8['where'],{'$or':_[_0x9e6e('0x2d')](_0x343237,function(_0x244a35){if(_0x244a35[_0x9e6e('0x30')]!==_0x9e6e('0x3f')){var _0x2f8e52={};_0x2f8e52[_0x244a35[_0x9e6e('0x2b')]]={'$like':'%'+_0x257820[_0x9e6e('0x32')][_0x9e6e('0x40')]+'%'};return _0x2f8e52;}})});}_0x446bb8=_[_0x9e6e('0x3e')]({},_0x446bb8,_0x257820[_0x9e6e('0x41')]);var _0x55a408={'where':_0x446bb8[_0x9e6e('0x3c')]};return db[_0x9e6e('0x2e')]['count'](_0x55a408)['then'](function(_0x33c6d5){_0x262e08[_0x9e6e('0x20')]=_0x33c6d5;if(_0x257820[_0x9e6e('0x32')][_0x9e6e('0x42')]){_0x446bb8[_0x9e6e('0x43')]=[{'all':!![]}];}return db[_0x9e6e('0x2e')][_0x9e6e('0x44')](_0x446bb8);})[_0x9e6e('0x27')](function(_0x5b6650){_0x262e08[_0x9e6e('0x45')]=_0x5b6650;return _0x262e08;})[_0x9e6e('0x27')](respondWithFilteredResult(_0x34ee80,_0x446bb8))[_0x9e6e('0x46')](handleError(_0x34ee80,null));};exports[_0x9e6e('0x47')]=function(_0x5ea8af,_0x3bb92f){var _0x5936b4={'raw':![],'where':{'id':_0x5ea8af['params']['id']}},_0x51161d={};_0x51161d[_0x9e6e('0x35')]=_[_0x9e6e('0x33')](db['Automation']['rawAttributes']);_0x51161d[_0x9e6e('0x32')]=_['keys'](_0x5ea8af[_0x9e6e('0x32')]);_0x51161d[_0x9e6e('0x34')]=_[_0x9e6e('0x36')](_0x51161d[_0x9e6e('0x35')],_0x51161d[_0x9e6e('0x32')]);_0x5936b4[_0x9e6e('0x38')]=_[_0x9e6e('0x36')](_0x51161d['model'],qs[_0x9e6e('0x37')](_0x5ea8af['query'][_0x9e6e('0x37')]));_0x5936b4[_0x9e6e('0x38')]=_0x5936b4[_0x9e6e('0x38')]['length']?_0x5936b4[_0x9e6e('0x38')]:_0x51161d[_0x9e6e('0x35')];if(_0x5ea8af[_0x9e6e('0x32')]['includeAll']){_0x5936b4[_0x9e6e('0x43')]=[{'all':!![]}];}_0x5936b4=_['merge']({},_0x5936b4,_0x5ea8af[_0x9e6e('0x41')]);return db[_0x9e6e('0x2e')]['find'](_0x5936b4)[_0x9e6e('0x27')](handleEntityNotFound(_0x3bb92f,null))[_0x9e6e('0x27')](respondWithResult(_0x3bb92f,null))[_0x9e6e('0x46')](handleError(_0x3bb92f,null));};exports[_0x9e6e('0x48')]=function(_0x2ff44e,_0x6ea536){return db['Automation'][_0x9e6e('0x48')](_0x2ff44e[_0x9e6e('0x49')],{})[_0x9e6e('0x27')](respondWithResult(_0x6ea536,0xc9))[_0x9e6e('0x46')](handleError(_0x6ea536,null));};exports[_0x9e6e('0x26')]=function(_0x18c3dc,_0x55ca5b){if(_0x18c3dc[_0x9e6e('0x49')]['id']){delete _0x18c3dc[_0x9e6e('0x49')]['id'];}return db[_0x9e6e('0x2e')]['find']({'where':{'id':_0x18c3dc[_0x9e6e('0x4a')]['id']}})[_0x9e6e('0x27')](handleEntityNotFound(_0x55ca5b,null))[_0x9e6e('0x27')](saveUpdates(_0x18c3dc['body'],null))[_0x9e6e('0x27')](respondWithResult(_0x55ca5b,null))['catch'](handleError(_0x55ca5b,null));};exports[_0x9e6e('0x28')]=function(_0x9ef18e,_0x92d34a){return db[_0x9e6e('0x2e')][_0x9e6e('0x4b')]({'where':{'id':_0x9ef18e[_0x9e6e('0x4a')]['id']}})[_0x9e6e('0x27')](handleEntityNotFound(_0x92d34a,null))['then'](removeEntity(_0x92d34a,null))[_0x9e6e('0x46')](handleError(_0x92d34a,null));};exports['addConditions']=function(_0x13c513,_0x5e7bb9,_0xa52645){return db[_0x9e6e('0x4c')][_0x9e6e('0x4b')]({'where':{'id':_0x13c513[_0x9e6e('0x4a')]['id']}})[_0x9e6e('0x27')](handleEntityNotFound(_0x5e7bb9,null))[_0x9e6e('0x27')](function(_0x3823d4){if(_0x3823d4){return _0x3823d4['addConditions'](_0x13c513[_0x9e6e('0x49')][_0x9e6e('0x4d')],_[_0x9e6e('0x4e')](_0x13c513[_0x9e6e('0x49')],[_0x9e6e('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x5e7bb9,null))[_0x9e6e('0x46')](handleError(_0x5e7bb9,null));};exports[_0x9e6e('0x4f')]=function(_0x2d57ff,_0x1be04a,_0x25fe37){var _0x343ce0={};var _0x267be6={};var _0x4992b6;var _0x521936;return db['Automation'][_0x9e6e('0x50')]({'where':{'id':_0x2d57ff[_0x9e6e('0x4a')]['id']}})[_0x9e6e('0x27')](handleEntityNotFound(_0x1be04a,null))[_0x9e6e('0x27')](function(_0x135b93){if(_0x135b93){_0x4992b6=_0x135b93;_0x267be6[_0x9e6e('0x35')]=_[_0x9e6e('0x33')](db['Condition'][_0x9e6e('0x51')]);_0x267be6[_0x9e6e('0x32')]=_[_0x9e6e('0x33')](_0x2d57ff['query']);_0x267be6[_0x9e6e('0x34')]=_[_0x9e6e('0x36')](_0x267be6['model'],_0x267be6[_0x9e6e('0x32')]);_0x343ce0[_0x9e6e('0x38')]=_[_0x9e6e('0x36')](_0x267be6['model'],qs['fields'](_0x2d57ff[_0x9e6e('0x32')][_0x9e6e('0x37')]));_0x343ce0[_0x9e6e('0x38')]=_0x343ce0[_0x9e6e('0x38')][_0x9e6e('0x52')]?_0x343ce0[_0x9e6e('0x38')]:_0x267be6['model'];_0x343ce0[_0x9e6e('0x3a')]=qs['sort'](_0x2d57ff[_0x9e6e('0x32')][_0x9e6e('0x3b')]);_0x343ce0[_0x9e6e('0x3c')]=qs[_0x9e6e('0x34')](_[_0x9e6e('0x3d')](_0x2d57ff[_0x9e6e('0x32')],_0x267be6[_0x9e6e('0x34')]));if(_0x2d57ff[_0x9e6e('0x32')]['filter']){_0x343ce0[_0x9e6e('0x3c')]=_['merge'](_0x343ce0[_0x9e6e('0x3c')],{'$or':_[_0x9e6e('0x2d')](_0x343ce0[_0x9e6e('0x38')],function(_0x181a07){var _0x3a6374={};_0x3a6374[_0x181a07]={'$like':'%'+_0x2d57ff[_0x9e6e('0x32')]['filter']+'%'};return _0x3a6374;})});}_0x343ce0=_[_0x9e6e('0x3e')]({},_0x343ce0,_0x2d57ff[_0x9e6e('0x41')]);return _0x4992b6[_0x9e6e('0x4f')](_0x343ce0);}})['then'](function(_0x2ba472){if(_0x2ba472){_0x521936=_0x2ba472[_0x9e6e('0x52')];if(!_0x2d57ff[_0x9e6e('0x32')][_0x9e6e('0x39')](_0x9e6e('0x53'))){_0x343ce0['limit']=qs[_0x9e6e('0x1e')](_0x2d57ff[_0x9e6e('0x32')][_0x9e6e('0x1e')]);_0x343ce0[_0x9e6e('0x1d')]=qs[_0x9e6e('0x1d')](_0x2d57ff[_0x9e6e('0x32')][_0x9e6e('0x1d')]);}return _0x4992b6['getConditions'](_0x343ce0);}})[_0x9e6e('0x27')](function(_0x2afa12){if(_0x2afa12){return _0x2afa12?{'count':_0x521936,'rows':_0x2afa12}:null;}})['then'](respondWithResult(_0x1be04a,null))['catch'](handleError(_0x1be04a,null));};exports[_0x9e6e('0x54')]=function(_0x11bad4,_0x14d94f,_0x44969b){return db['Action'][_0x9e6e('0x4b')]({'where':{'id':_0x11bad4[_0x9e6e('0x4a')]['id']}})[_0x9e6e('0x27')](handleEntityNotFound(_0x14d94f,null))['then'](function(_0x2cef70){if(_0x2cef70){return _0x2cef70['addActions'](_0x11bad4[_0x9e6e('0x49')][_0x9e6e('0x4d')],_['omit'](_0x11bad4[_0x9e6e('0x49')],['ids','id'])||{});}})[_0x9e6e('0x27')](respondWithResult(_0x14d94f,null))[_0x9e6e('0x46')](handleError(_0x14d94f,null));};exports[_0x9e6e('0x55')]=function(_0x234641,_0x1e9253,_0x3644e0){var _0x488540={};var _0x3f6eda={};var _0x168e10;var _0x3f157e;return db['Automation']['findOne']({'where':{'id':_0x234641['params']['id']}})['then'](handleEntityNotFound(_0x1e9253,null))[_0x9e6e('0x27')](function(_0x5cc148){if(_0x5cc148){_0x168e10=_0x5cc148;_0x3f6eda['model']=_[_0x9e6e('0x33')](db[_0x9e6e('0x56')][_0x9e6e('0x51')]);_0x3f6eda[_0x9e6e('0x32')]=_[_0x9e6e('0x33')](_0x234641[_0x9e6e('0x32')]);_0x3f6eda[_0x9e6e('0x34')]=_[_0x9e6e('0x36')](_0x3f6eda[_0x9e6e('0x35')],_0x3f6eda['query']);_0x488540['attributes']=_[_0x9e6e('0x36')](_0x3f6eda[_0x9e6e('0x35')],qs[_0x9e6e('0x37')](_0x234641[_0x9e6e('0x32')][_0x9e6e('0x37')]));_0x488540[_0x9e6e('0x38')]=_0x488540['attributes'][_0x9e6e('0x52')]?_0x488540[_0x9e6e('0x38')]:_0x3f6eda['model'];_0x488540[_0x9e6e('0x3a')]=qs[_0x9e6e('0x3b')](_0x234641[_0x9e6e('0x32')]['sort']);_0x488540[_0x9e6e('0x3c')]=qs[_0x9e6e('0x34')](_[_0x9e6e('0x3d')](_0x234641['query'],_0x3f6eda[_0x9e6e('0x34')]));if(_0x234641[_0x9e6e('0x32')]['filter']){_0x488540[_0x9e6e('0x3c')]=_['merge'](_0x488540[_0x9e6e('0x3c')],{'$or':_['map'](_0x488540[_0x9e6e('0x38')],function(_0x559654){var _0x1c6091={};_0x1c6091[_0x559654]={'$like':'%'+_0x234641[_0x9e6e('0x32')][_0x9e6e('0x40')]+'%'};return _0x1c6091;})});}_0x488540=_[_0x9e6e('0x3e')]({},_0x488540,_0x234641[_0x9e6e('0x41')]);return _0x168e10['getActions'](_0x488540);}})['then'](function(_0x2b7a17){if(_0x2b7a17){_0x3f157e=_0x2b7a17[_0x9e6e('0x52')];if(!_0x234641[_0x9e6e('0x32')][_0x9e6e('0x39')](_0x9e6e('0x53'))){_0x488540[_0x9e6e('0x1e')]=qs['limit'](_0x234641['query'][_0x9e6e('0x1e')]);_0x488540['offset']=qs[_0x9e6e('0x1d')](_0x234641[_0x9e6e('0x32')][_0x9e6e('0x1d')]);}return _0x168e10['getActions'](_0x488540);}})[_0x9e6e('0x27')](function(_0x5a7b0b){if(_0x5a7b0b){return _0x5a7b0b?{'count':_0x3f157e,'rows':_0x5a7b0b}:null;}})['then'](respondWithResult(_0x1e9253,null))[_0x9e6e('0x46')](handleError(_0x1e9253,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index e70f1f0..66a912d 100644 --- a/server/api/automation/automation.model.js +++ b/server/api/automation/automation.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6575=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./automation.attributes','exports','define','Automation','tools_automations'];(function(_0x3829fa,_0x47644a){var _0x3510c8=function(_0x4be513){while(--_0x4be513){_0x3829fa['push'](_0x3829fa['shift']());}};_0x3510c8(++_0x47644a);}(_0x6575,0xa9));var _0x5657=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x6575[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x5657('0x0'));var util=require(_0x5657('0x1'));var logger=require(_0x5657('0x2'))(_0x5657('0x3'));var moment=require(_0x5657('0x4'));var BPromise=require(_0x5657('0x5'));var rp=require(_0x5657('0x6'));var fs=require('fs');var path=require(_0x5657('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5657('0x8'));module[_0x5657('0x9')]=function(_0x3eedc7,_0x516bc1){return _0x3eedc7[_0x5657('0xa')](_0x5657('0xb'),attributes,{'tableName':_0x5657('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f15=['bluebird','path','rimraf','./automation.attributes','exports','define','Automation','lodash'];(function(_0x1664f9,_0xc1d5f3){var _0x50aee1=function(_0x118215){while(--_0x118215){_0x1664f9['push'](_0x1664f9['shift']());}};_0x50aee1(++_0xc1d5f3);}(_0x2f15,0x1af));var _0x52f1=function(_0x5ddec9,_0x209a36){_0x5ddec9=_0x5ddec9-0x0;var _0x5abb94=_0x2f15[_0x5ddec9];return _0x5abb94;};'use strict';var _=require(_0x52f1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x52f1('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x52f1('0x2'));var rimraf=require(_0x52f1('0x3'));var config=require('../../config/environment');var attributes=require(_0x52f1('0x4'));module[_0x52f1('0x5')]=function(_0x28043b,_0x421e6c){return _0x28043b[_0x52f1('0x6')](_0x52f1('0x7'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index dec6f54..391e7e2 100644 --- a/server/api/automation/automation.rpc.js +++ b/server/api/automation/automation.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf2f=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x2017e7,_0x162b36){var _0xf24239=function(_0x275c3b){while(--_0x275c3b){_0x2017e7['push'](_0x2017e7['shift']());}};_0xf24239(++_0x162b36);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x256fe9,_0x4ed7c3){_0x256fe9=_0x256fe9-0x0;var _0x1769ed=_0xcf2f[_0x256fe9];return _0x1769ed;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var moment=require(_0xfcf2('0x2'));var BPromise=require(_0xfcf2('0x3'));var rs=require(_0xfcf2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcf2('0x5'))['db'];var utils=require(_0xfcf2('0x6'));var logger=require(_0xfcf2('0x7'))(_0xfcf2('0x8'));var config=require(_0xfcf2('0x9'));var jayson=require(_0xfcf2('0xa'));var client=jayson[_0xfcf2('0xb')][_0xfcf2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41d4bd,_0x157f48,_0x16b6b2){return new BPromise(function(_0x34f444,_0xb4c510){return client[_0xfcf2('0xd')](_0x41d4bd,_0x16b6b2)['then'](function(_0x575f33){logger['info'](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));logger['debug'](_0xfcf2('0x10'),_0x157f48,_0xfcf2('0xf'),JSON[_0xfcf2('0x11')](_0x575f33));if(_0x575f33[_0xfcf2('0x12')]){if(_0x575f33['error']['code']===0x1f4){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x575f33[_0xfcf2('0x12')][_0xfcf2('0x13')]);return _0xb4c510(_0x575f33['error'][_0xfcf2('0x13')]);}logger['error']('Automation,\x20%s,\x20%s',_0x157f48,_0x575f33['error'][_0xfcf2('0x13')]);return _0x34f444(_0x575f33['error'][_0xfcf2('0x13')]);}else{logger[_0xfcf2('0x14')](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));_0x34f444(_0x575f33[_0xfcf2('0x15')][_0xfcf2('0x13')]);}})[_0xfcf2('0x16')](function(_0x4d64ce){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x4d64ce);_0xb4c510(_0x4d64ce);});});} \ No newline at end of file +var _0xb5fb=['request','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xb8cfbe,_0x2e81b6){var _0x227d51=function(_0x5cb1ff){while(--_0x5cb1ff){_0xb8cfbe['push'](_0xb8cfbe['shift']());}};_0x227d51(++_0x2e81b6);}(_0xb5fb,0x172));var _0xbb5f=function(_0x4a467d,_0x4712c2){_0x4a467d=_0x4a467d-0x0;var _0x1ef269=_0xb5fb[_0x4a467d];return _0x1ef269;};'use strict';var _=require(_0xbb5f('0x0'));var util=require(_0xbb5f('0x1'));var moment=require(_0xbb5f('0x2'));var BPromise=require(_0xbb5f('0x3'));var rs=require(_0xbb5f('0x4'));var fs=require('fs');var Redis=require(_0xbb5f('0x5'));var db=require(_0xbb5f('0x6'))['db'];var utils=require(_0xbb5f('0x7'));var logger=require(_0xbb5f('0x8'))(_0xbb5f('0x9'));var config=require(_0xbb5f('0xa'));var jayson=require(_0xbb5f('0xb'));var client=jayson[_0xbb5f('0xc')][_0xbb5f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x487a1a,_0x597050,_0x317cd9){return new BPromise(function(_0x5e7943,_0x5b91){return client[_0xbb5f('0xe')](_0x487a1a,_0x317cd9)['then'](function(_0x4f13a9){logger[_0xbb5f('0xf')]('Automation,\x20%s,\x20%s',_0x597050,_0xbb5f('0x10'));logger[_0xbb5f('0x11')](_0xbb5f('0x12'),_0x597050,_0xbb5f('0x10'),JSON[_0xbb5f('0x13')](_0x4f13a9));if(_0x4f13a9[_0xbb5f('0x14')]){if(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x15')]===0x1f4){logger['error'](_0xbb5f('0x16'),_0x597050,_0x4f13a9['error'][_0xbb5f('0x17')]);return _0x5b91(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x17')]);}logger['error'](_0xbb5f('0x16'),_0x597050,_0x4f13a9[_0xbb5f('0x14')]['message']);return _0x5e7943(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x17')]);}else{logger[_0xbb5f('0xf')](_0xbb5f('0x16'),_0x597050,'request\x20sent');_0x5e7943(_0x4f13a9['result'][_0xbb5f('0x17')]);}})['catch'](function(_0xdf4ec8){logger[_0xbb5f('0x14')]('Automation,\x20%s,\x20%s',_0x597050,_0xdf4ec8);_0x5b91(_0xdf4ec8);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 456b570..6177345 100644 --- a/server/api/automation/index.js +++ b/server/api/automation/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x567b=['addActions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','create','addConditions','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x567b,0x6e));var _0xb567=function(_0x2641d5,_0x6b70e1){_0x2641d5=_0x2641d5-0x0;var _0x7f5087=_0x567b[_0x2641d5];return _0x7f5087;};'use strict';var multer=require(_0xb567('0x0'));var util=require('util');var path=require(_0xb567('0x1'));var timeout=require(_0xb567('0x2'));var express=require(_0xb567('0x3'));var router=express[_0xb567('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb567('0x5'));var interaction=require(_0xb567('0x6'));var config=require(_0xb567('0x7'));var controller=require(_0xb567('0x8'));router[_0xb567('0x9')]('/',auth[_0xb567('0xa')](),controller[_0xb567('0xb')]);router['get'](_0xb567('0xc'),auth[_0xb567('0xa')](),controller[_0xb567('0xd')]);router[_0xb567('0x9')](_0xb567('0xe'),auth[_0xb567('0xa')](),controller[_0xb567('0xf')]);router['get'](_0xb567('0x10'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth[_0xb567('0xa')](),controller[_0xb567('0x11')]);router['post'](_0xb567('0xe'),auth[_0xb567('0xa')](),controller[_0xb567('0x12')]);router[_0xb567('0x13')](_0xb567('0x10'),auth[_0xb567('0xa')](),controller[_0xb567('0x14')]);router[_0xb567('0x15')](_0xb567('0xc'),auth[_0xb567('0xa')](),controller[_0xb567('0x16')]);router[_0xb567('0x17')](_0xb567('0xc'),auth[_0xb567('0xa')](),controller[_0xb567('0x18')]);module[_0xb567('0x19')]=router; \ No newline at end of file +var _0x14ac=['/:id/actions','getActions','post','addActions','put','delete','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions'];(function(_0x254ede,_0x3b3d0f){var _0x2e3704=function(_0x1f96a6){while(--_0x1f96a6){_0x254ede['push'](_0x254ede['shift']());}};_0x2e3704(++_0x3b3d0f);}(_0x14ac,0x13b));var _0xc14a=function(_0x48d933,_0x4eaabe){_0x48d933=_0x48d933-0x0;var _0x4caf07=_0x14ac[_0x48d933];return _0x4caf07;};'use strict';var multer=require('multer');var util=require(_0xc14a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc14a('0x1'));var router=express[_0xc14a('0x2')]();var fs_extra=require(_0xc14a('0x3'));var auth=require(_0xc14a('0x4'));var interaction=require(_0xc14a('0x5'));var config=require(_0xc14a('0x6'));var controller=require(_0xc14a('0x7'));router['get']('/',auth[_0xc14a('0x8')](),controller[_0xc14a('0x9')]);router[_0xc14a('0xa')](_0xc14a('0xb'),auth[_0xc14a('0x8')](),controller[_0xc14a('0xc')]);router['get'](_0xc14a('0xd'),auth['isAuthenticated'](),controller[_0xc14a('0xe')]);router['get'](_0xc14a('0xf'),auth['isAuthenticated'](),controller[_0xc14a('0x10')]);router[_0xc14a('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc14a('0x11')](_0xc14a('0xd'),auth[_0xc14a('0x8')](),controller['addConditions']);router[_0xc14a('0x11')](_0xc14a('0xf'),auth[_0xc14a('0x8')](),controller[_0xc14a('0x12')]);router[_0xc14a('0x13')]('/:id',auth[_0xc14a('0x8')](),controller['update']);router[_0xc14a('0x14')](_0xc14a('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xc14a('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 715893a..28c9331 100644 --- a/server/api/campaign/campaign.attributes.js +++ b/server/api/campaign/campaign.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83e7=['Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)'];(function(_0x4f66c2,_0x3c2c60){var _0x1724c7=function(_0x58b02e){while(--_0x58b02e){_0x4f66c2['push'](_0x4f66c2['shift']());}};_0x1724c7(++_0x3c2c60);}(_0x83e7,0x187));var _0x783e=function(_0x37752c,_0x20d239){_0x37752c=_0x37752c-0x0;var _0x41b47f=_0x83e7[_0x37752c];return _0x41b47f;};'use strict';var Sequelize=require('sequelize');module[_0x783e('0x0')]={'name':{'type':Sequelize[_0x783e('0x1')],'unique':_0x783e('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x783e('0x3')](_0x783e('0x4')),'allowNull':![],'defaultValue':_0x783e('0x4')},'description':{'type':Sequelize[_0x783e('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x783e('0x5')](0x4)[_0x783e('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x783e('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x783e('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x783e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x783e('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x783e('0x5')](0x3)[_0x783e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x783e('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x783e('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x783e('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x783e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x783e('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x783e('0x5')](0x5)[_0x783e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x783e('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x783e('0x5')](0x3)[_0x783e('0x6')],'defaultValue':0x3,'comment':_0x783e('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x783e('0x5')](0x5)[_0x783e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x783e('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x783e('0x5')](0x3)[_0x783e('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x783e('0xe')},'dialTimezone':{'type':Sequelize[_0x783e('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x783e('0x1')],'defaultValue':_0x783e('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x783e('0x3')](_0x783e('0x10'),_0x783e('0x11'),_0x783e('0x12')),'defaultValue':_0x783e('0x10')},'dialAMDActive':{'type':Sequelize[_0x783e('0x13')],'defaultValue':0x0,'comment':_0x783e('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x783e('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x783e('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x783e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x783e('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x783e('0x5')](0x9)[_0x783e('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x783e('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x783e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x783e('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x783e('0x5')](0x9)[_0x783e('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x783e('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x783e('0x5')](0x9)[_0x783e('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x783e('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x783e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x783e('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x783e('0x5')](0x5)[_0x783e('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x783e('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x783e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x783e('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x783e('0x3')](_0x783e('0x1e'),_0x783e('0x1f')),'defaultValue':_0x783e('0x1e')},'dialPrefix':{'type':Sequelize[_0x783e('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x783e('0x5')](0x3)[_0x783e('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x783e('0x20')},'dialCutDigit':{'type':Sequelize[_0x783e('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x783e('0x21')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x783e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x783e('0x22')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x783e('0x5')](0x5)[_0x783e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x783e('0x23')},'dialDropMaxRetry':{'type':Sequelize[_0x783e('0x5')](0x3)[_0x783e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x783e('0x24')},'dialDropRetryFrequency':{'type':Sequelize[_0x783e('0x5')](0x5)[_0x783e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x783e('0x25')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x783e('0x5')](0x3)[_0x783e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x783e('0x26')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x783e('0x5')](0x5)[_0x783e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x783e('0x27')},'dialMachineMaxRetry':{'type':Sequelize[_0x783e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x783e('0x5')](0x5)[_0x783e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x783e('0x28')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x783e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x783e('0x29')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x783e('0x5')](0x5)[_0x783e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x783e('0x2a')}}; \ No newline at end of file +var _0xb3f0=['BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr'];(function(_0x24353c,_0x146774){var _0x31422b=function(_0x3341ce){while(--_0x3341ce){_0x24353c['push'](_0x24353c['shift']());}};_0x31422b(++_0x146774);}(_0xb3f0,0x103));var _0x0b3f=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xb3f0[_0x5c3c0b];return _0x52ecd2;};'use strict';var Sequelize=require('sequelize');module[_0x0b3f('0x0')]={'name':{'type':Sequelize[_0x0b3f('0x1')],'unique':_0x0b3f('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0b3f('0x3')](_0x0b3f('0x4')),'allowNull':![],'defaultValue':_0x0b3f('0x4')},'description':{'type':Sequelize[_0x0b3f('0x1')]},'active':{'type':Sequelize[_0x0b3f('0x5')],'defaultValue':0x0,'comment':_0x0b3f('0x6')},'limitCalls':{'type':Sequelize[_0x0b3f('0x7')](0x4)[_0x0b3f('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0b3f('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0b3f('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x0b3f('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b3f('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0b3f('0x7')](0x5)[_0x0b3f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b3f('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b3f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b3f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b3f('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0b3f('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0b3f('0x7')](0x5)[_0x0b3f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b3f('0xc')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x0b3f('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x0b3f('0xd')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0b3f('0xe'),_0x0b3f('0xf'),_0x0b3f('0x10')),'defaultValue':_0x0b3f('0xe')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0b3f('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0b3f('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x0b3f('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0b3f('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0b3f('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0b3f('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0b3f('0x7')](0x9)[_0x0b3f('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b3f('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x0b3f('0x7')](0x9)[_0x0b3f('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0b3f('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0b3f('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x0b3f('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0b3f('0x7')](0x9)[_0x0b3f('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b3f('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0b3f('0x3')](_0x0b3f('0x17'),_0x0b3f('0x18')),'defaultValue':_0x0b3f('0x17')},'dialPrefix':{'type':Sequelize[_0x0b3f('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0b3f('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0b3f('0x19')},'dialCutDigit':{'type':Sequelize[_0x0b3f('0x7')](0x3)[_0x0b3f('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b3f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b3f('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b3f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b3f('0x1b')},'dialDropRetryFrequency':{'type':Sequelize[_0x0b3f('0x7')](0x5)[_0x0b3f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b3f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b3f('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0b3f('0x7')](0x5)[_0x0b3f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b3f('0x1d')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b3f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b3f('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b3f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b3f('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0b3f('0x7')](0x5)[_0x0b3f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b3f('0x20')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 346c5e3..70bfbb6 100644 --- a/server/api/campaign/campaign.controller.js +++ b/server/api/campaign/campaign.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x380a=['sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','createdAt','updatedAt','user','autoAssociation','getHoppers','findOne','CmHopper','CampaignId','findAll','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','ids','dialCheckDuplicateType','insert','scheduledAt','ContactId','ListId','select','field','phone','CmListId','toString','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','from','cm_hopper','onlyIfOpen','into','fromQuery','NOW()','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','spread','push','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','mustache','sox','to-csv','ejs','crypto','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','count','limit','set','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x1f080f,_0x2da97){var _0x16d826=function(_0x20b1ec){while(--_0x20b1ec){_0x1f080f['push'](_0x1f080f['shift']());}};_0x16d826(++_0x2da97);}(_0x380a,0x16c));var _0xa380=function(_0x47c958,_0x3cfe09){_0x47c958=_0x47c958-0x0;var _0x573eab=_0x380a[_0x47c958];return _0x573eab;};'use strict';var emlformat=require(_0xa380('0x0'));var rimraf=require(_0xa380('0x1'));var zipdir=require(_0xa380('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa380('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa380('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa380('0x5'));var csv=require(_0xa380('0x6'));var ejs=require(_0xa380('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa380('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa380('0x6'));var querystring=require(_0xa380('0x9'));var Papa=require(_0xa380('0xa'));var Redis=require(_0xa380('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa380('0xc'));var logger=require(_0xa380('0xd'))('api');var utils=require(_0xa380('0xe'));var config=require(_0xa380('0xf'));var licenseUtil=require(_0xa380('0x10'));var db=require(_0xa380('0x11'))['db'];function respondWithStatusCode(_0x36c941,_0x35256a){_0x35256a=_0x35256a||0xcc;return function(_0x1a0bd2){if(_0x1a0bd2){return _0x36c941['sendStatus'](_0x35256a);}return _0x36c941[_0xa380('0x12')](_0x35256a)[_0xa380('0x13')]();};}function respondWithResult(_0x25c2d9,_0x48df05){_0x48df05=_0x48df05||0xc8;return function(_0x480fe3){if(_0x480fe3){return _0x25c2d9[_0xa380('0x12')](_0x48df05)[_0xa380('0x14')](_0x480fe3);}};}function respondWithFilteredResult(_0x2ad901,_0x4734de){return function(_0x2c085a){if(_0x2c085a){var _0x3a713e=typeof _0x4734de['offset']===_0xa380('0x15')&&typeof _0x4734de['limit']===_0xa380('0x15');var _0x2ab7af=_0x2c085a['count'];var _0x8eaa53=_0x3a713e?0x0:_0x4734de[_0xa380('0x16')];var _0x226613=_0x3a713e?_0x2c085a[_0xa380('0x17')]:_0x4734de['offset']+_0x4734de[_0xa380('0x18')];var _0x3779bc;if(_0x226613>=_0x2ab7af){_0x226613=_0x2ab7af;_0x3779bc=0xc8;}else{_0x3779bc=0xce;}_0x2ad901[_0xa380('0x12')](_0x3779bc);return _0x2ad901[_0xa380('0x19')]('Content-Range',_0x8eaa53+'-'+_0x226613+'/'+_0x2ab7af)['json'](_0x2c085a);}return null;};}function patchUpdates(_0x528650){return function(_0x2c4895){try{jsonpatch[_0xa380('0x1a')](_0x2c4895,_0x528650,!![]);}catch(_0x4a5766){return BPromise[_0xa380('0x1b')](_0x4a5766);}return _0x2c4895[_0xa380('0x1c')]();};}function saveUpdates(_0x9d2294,_0x315e39){return function(_0x250acf){if(_0x250acf){return _0x250acf[_0xa380('0x1d')](_0x9d2294)[_0xa380('0x1e')](function(_0x3c950e){return _0x3c950e;});}return null;};}function removeEntity(_0x3df22b,_0x291695){return function(_0x425ddd){if(_0x425ddd){return _0x425ddd[_0xa380('0x1f')]()[_0xa380('0x1e')](function(){var _0x5cc7f6=_0x425ddd[_0xa380('0x20')]({'plain':!![]});var _0x1d603c=_0xa380('0x21');return db[_0xa380('0x22')][_0xa380('0x1f')]({'where':{'type':_0x1d603c,'resourceId':_0x5cc7f6['id']}})['then'](function(){return _0x425ddd;});})['then'](function(){_0x3df22b[_0xa380('0x12')](0xcc)[_0xa380('0x13')]();});}};}function handleEntityNotFound(_0xa0c142,_0xc80edd){return function(_0x39f423){if(!_0x39f423){_0xa0c142[_0xa380('0x23')](0x194);}return _0x39f423;};}function handleError(_0x4a60d4,_0x3e5879){_0x3e5879=_0x3e5879||0x1f4;return function(_0x1dd99b){logger['error'](_0x1dd99b[_0xa380('0x24')]);if(_0x1dd99b[_0xa380('0x25')]){delete _0x1dd99b[_0xa380('0x25')];}_0x4a60d4[_0xa380('0x12')](_0x3e5879)[_0xa380('0x26')](_0x1dd99b);};}exports[_0xa380('0x27')]=function(_0x1fce2b,_0x3618f7){var _0x35a330={},_0xba971c={},_0x14fa7f={'count':0x0,'rows':[]};var _0x318eb3=_['map'](db[_0xa380('0x28')][_0xa380('0x29')],function(_0x416c21){return{'name':_0x416c21[_0xa380('0x2a')],'type':_0x416c21[_0xa380('0x2b')][_0xa380('0x2c')]};});_0xba971c[_0xa380('0x2d')]=_[_0xa380('0x2e')](_0x318eb3,_0xa380('0x25'));_0xba971c[_0xa380('0x2f')]=_[_0xa380('0x30')](_0x1fce2b[_0xa380('0x2f')]);_0xba971c['filters']=_[_0xa380('0x31')](_0xba971c[_0xa380('0x2d')],_0xba971c[_0xa380('0x2f')]);_0x35a330[_0xa380('0x32')]=_[_0xa380('0x31')](_0xba971c[_0xa380('0x2d')],qs[_0xa380('0x33')](_0x1fce2b[_0xa380('0x2f')]['fields']));_0x35a330[_0xa380('0x32')]=_0x35a330[_0xa380('0x32')][_0xa380('0x34')]?_0x35a330[_0xa380('0x32')]:_0xba971c[_0xa380('0x2d')];if(!_0x1fce2b[_0xa380('0x2f')][_0xa380('0x35')](_0xa380('0x36'))){_0x35a330['limit']=qs[_0xa380('0x18')](_0x1fce2b[_0xa380('0x2f')][_0xa380('0x18')]);_0x35a330[_0xa380('0x16')]=qs[_0xa380('0x16')](_0x1fce2b[_0xa380('0x2f')][_0xa380('0x16')]);}_0x35a330[_0xa380('0x37')]=qs[_0xa380('0x38')](_0x1fce2b[_0xa380('0x2f')][_0xa380('0x38')]);_0x35a330['where']=qs[_0xa380('0x39')](_[_0xa380('0x3a')](_0x1fce2b[_0xa380('0x2f')],_0xba971c[_0xa380('0x39')]),_0x318eb3);if(_0x1fce2b['query'][_0xa380('0x3b')]){_0x35a330[_0xa380('0x3c')]=_['merge'](_0x35a330['where'],{'$or':_['map'](_0x318eb3,function(_0x437538){if(_0x437538[_0xa380('0x2b')]!==_0xa380('0x3d')){var _0x370e46={};_0x370e46[_0x437538[_0xa380('0x25')]]={'$like':'%'+_0x1fce2b['query']['filter']+'%'};return _0x370e46;}})});}_0x35a330=_[_0xa380('0x3e')]({},_0x35a330,_0x1fce2b[_0xa380('0x3f')]);var _0x251b50={'where':_0x35a330[_0xa380('0x3c')]};return db[_0xa380('0x28')][_0xa380('0x17')](_0x251b50)[_0xa380('0x1e')](function(_0x212a20){_0x14fa7f[_0xa380('0x17')]=_0x212a20;if(_0x1fce2b[_0xa380('0x2f')][_0xa380('0x40')]){_0x35a330[_0xa380('0x41')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x35a330);})[_0xa380('0x1e')](function(_0x261563){_0x14fa7f[_0xa380('0x42')]=_0x261563;return _0x14fa7f;})[_0xa380('0x1e')](respondWithFilteredResult(_0x3618f7,_0x35a330))[_0xa380('0x43')](handleError(_0x3618f7,null));};exports[_0xa380('0x44')]=function(_0x36646e,_0x100181){var _0x271e1e={'raw':![],'where':{'id':_0x36646e['params']['id']}},_0xe2f9f1={};_0xe2f9f1[_0xa380('0x2d')]=_[_0xa380('0x30')](db['Campaign'][_0xa380('0x29')]);_0xe2f9f1['query']=_[_0xa380('0x30')](_0x36646e[_0xa380('0x2f')]);_0xe2f9f1[_0xa380('0x39')]=_[_0xa380('0x31')](_0xe2f9f1['model'],_0xe2f9f1[_0xa380('0x2f')]);_0x271e1e['attributes']=_[_0xa380('0x31')](_0xe2f9f1[_0xa380('0x2d')],qs[_0xa380('0x33')](_0x36646e[_0xa380('0x2f')][_0xa380('0x33')]));_0x271e1e[_0xa380('0x32')]=_0x271e1e[_0xa380('0x32')][_0xa380('0x34')]?_0x271e1e[_0xa380('0x32')]:_0xe2f9f1[_0xa380('0x2d')];if(_0x36646e[_0xa380('0x2f')]['includeAll']){_0x271e1e['include']=[{'all':!![]}];}_0x271e1e=_[_0xa380('0x3e')]({},_0x271e1e,_0x36646e[_0xa380('0x3f')]);return db[_0xa380('0x28')]['find'](_0x271e1e)['then'](handleEntityNotFound(_0x100181,null))[_0xa380('0x1e')](respondWithResult(_0x100181,null))[_0xa380('0x43')](handleError(_0x100181,null));};exports[_0xa380('0x45')]=function(_0x1f8fca,_0x1f5820){return db[_0xa380('0x28')][_0xa380('0x45')](_0x1f8fca[_0xa380('0x46')],{})['then'](function(_0xc271c1){var _0x19af6a=_0x1f8fca['user'][_0xa380('0x20')]({'plain':!![]});if(!_0x19af6a)throw new Error(_0xa380('0x47'));if(_0x19af6a[_0xa380('0x48')]==='user'){var _0x29b140=_0xc271c1['get']({'plain':!![]});var _0x4794e=_0xa380('0x21');return db[_0xa380('0x49')][_0xa380('0x4a')]({'where':{'name':_0x4794e,'userProfileId':_0x19af6a[_0xa380('0x4b')]},'raw':!![]})[_0xa380('0x1e')](function(_0x33e25e){if(_0x33e25e&&_0x33e25e['autoAssociation']===0x0){return db[_0xa380('0x22')][_0xa380('0x45')]({'name':_0x29b140['name'],'resourceId':_0x29b140['id'],'type':_0x33e25e['name'],'sectionId':_0x33e25e['id']},{})[_0xa380('0x1e')](function(){return _0xc271c1;});}else{return _0xc271c1;}})['catch'](function(_0x16c479){logger[_0xa380('0x4c')](_0xa380('0x4d'),_0x16c479);throw _0x16c479;});}return _0xc271c1;})['then'](respondWithResult(_0x1f5820,0xc9))['catch'](handleError(_0x1f5820,null));};exports['clone']=function(_0x5bf9f1,_0x43ad25){var _0x281abe={'where':{'id':_0x5bf9f1[_0xa380('0x4e')]['id']}},_0x82fc25={};_0x82fc25[_0xa380('0x2d')]=_['keys'](db[_0xa380('0x28')]['rawAttributes']);_0x281abe[_0xa380('0x32')]=_['intersection'](_0x82fc25[_0xa380('0x2d')],qs[_0xa380('0x33')](_0x5bf9f1[_0xa380('0x2f')][_0xa380('0x33')]));_0x281abe['attributes']=_0x281abe[_0xa380('0x32')][_0xa380('0x34')]?_0x281abe[_0xa380('0x32')]:_0x82fc25[_0xa380('0x2d')];if(_0x5bf9f1['query'][_0xa380('0x40')]){_0x281abe['include']=[{'all':!![]}];}_0x281abe=_[_0xa380('0x3e')]({},_0x281abe,_0x5bf9f1[_0xa380('0x3f')]);return db[_0xa380('0x28')][_0xa380('0x4a')](_0x281abe)[_0xa380('0x1e')](handleEntityNotFound(_0x43ad25,null))[_0xa380('0x1e')](function(_0x519534){if(_0x519534){var _0x3cb89e=_0x519534['get']({'plain':!![]});_0x3cb89e=qs[_0xa380('0x4f')](_0x3cb89e,['id',_0xa380('0x50'),_0xa380('0x51')]);_0x5bf9f1[_0xa380('0x46')]=_[_0xa380('0x4f')](_0x5bf9f1[_0xa380('0x46')],['id',_0xa380('0x50'),_0xa380('0x51')]);return db[_0xa380('0x28')][_0xa380('0x45')](_['merge'](_0x3cb89e,_0x5bf9f1[_0xa380('0x46')]),{'include':_0x5bf9f1[_0xa380('0x2f')][_0xa380('0x40')]?[{'all':!![]}]:undefined})[_0xa380('0x1e')](function(_0x502d68){var _0x4f415f=_0x5bf9f1[_0xa380('0x52')][_0xa380('0x20')]({'plain':!![]});if(!_0x4f415f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f415f['role']==='user'){var _0x2dd487=_0x502d68[_0xa380('0x20')]({'plain':!![]});var _0x2cf982='IvrCampaigns';return db[_0xa380('0x49')]['find']({'where':{'name':_0x2cf982,'userProfileId':_0x4f415f['userProfileId']},'raw':!![]})[_0xa380('0x1e')](function(_0x533937){if(_0x533937&&_0x533937[_0xa380('0x53')]===0x0){return db[_0xa380('0x22')][_0xa380('0x45')]({'name':_0x2dd487[_0xa380('0x25')],'resourceId':_0x2dd487['id'],'type':_0x533937[_0xa380('0x25')],'sectionId':_0x533937['id']},{})[_0xa380('0x1e')](function(){return _0x502d68;});}else{return _0x502d68;}})[_0xa380('0x43')](function(_0x367c4b){logger[_0xa380('0x4c')](_0xa380('0x4d'),_0x367c4b);throw _0x367c4b;});}return _0x502d68;});}})[_0xa380('0x1e')](respondWithResult(_0x43ad25,0xc9))[_0xa380('0x43')](handleError(_0x43ad25,null));};exports['update']=function(_0x5f4df6,_0x18335b){if(_0x5f4df6[_0xa380('0x46')]['id']){delete _0x5f4df6[_0xa380('0x46')]['id'];}return db[_0xa380('0x28')][_0xa380('0x4a')]({'where':{'id':_0x5f4df6[_0xa380('0x4e')]['id']}})['then'](handleEntityNotFound(_0x18335b,null))[_0xa380('0x1e')](saveUpdates(_0x5f4df6[_0xa380('0x46')],null))[_0xa380('0x1e')](respondWithResult(_0x18335b,null))[_0xa380('0x43')](handleError(_0x18335b,null));};exports[_0xa380('0x1f')]=function(_0x250bb7,_0x537953){return db[_0xa380('0x28')]['find']({'where':{'id':_0x250bb7[_0xa380('0x4e')]['id']}})[_0xa380('0x1e')](handleEntityNotFound(_0x537953,null))['then'](removeEntity(_0x537953,null))[_0xa380('0x43')](handleError(_0x537953,null));};exports[_0xa380('0x54')]=function(_0x5325b4,_0x2366cf,_0x5173a1){var _0x5eb552={'raw':!![],'where':{}};var _0x411582={};var _0x32e553={'count':0x0,'rows':[]};return db[_0xa380('0x28')][_0xa380('0x55')]({'where':{'id':_0x5325b4[_0xa380('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2366cf,null))[_0xa380('0x1e')](function(_0x2a2f62){if(_0x2a2f62){_0x411582['model']=_[_0xa380('0x30')](db[_0xa380('0x56')][_0xa380('0x29')]);_0x411582['query']=_[_0xa380('0x30')](_0x5325b4['query']);_0x411582[_0xa380('0x39')]=_[_0xa380('0x31')](_0x411582[_0xa380('0x2d')],_0x411582['query']);_0x5eb552[_0xa380('0x32')]=_[_0xa380('0x31')](_0x411582[_0xa380('0x2d')],qs['fields'](_0x5325b4[_0xa380('0x2f')][_0xa380('0x33')]));_0x5eb552[_0xa380('0x32')]=_0x5eb552[_0xa380('0x32')][_0xa380('0x34')]?_0x5eb552['attributes']:_0x411582['model'];if(!_0x5325b4[_0xa380('0x2f')][_0xa380('0x35')]('nolimit')){_0x5eb552[_0xa380('0x18')]=qs[_0xa380('0x18')](_0x5325b4['query'][_0xa380('0x18')]);_0x5eb552[_0xa380('0x16')]=qs[_0xa380('0x16')](_0x5325b4[_0xa380('0x2f')][_0xa380('0x16')]);}_0x5eb552[_0xa380('0x37')]=qs[_0xa380('0x38')](_0x5325b4[_0xa380('0x2f')]['sort']);_0x5eb552[_0xa380('0x3c')]=qs[_0xa380('0x39')](_[_0xa380('0x3a')](_0x5325b4['query'],_0x411582['filters']));_0x5eb552[_0xa380('0x3c')][_0xa380('0x57')]=_0x2a2f62['id'];if(_0x5325b4[_0xa380('0x2f')][_0xa380('0x3b')]){_0x5eb552[_0xa380('0x3c')]=_['merge'](_0x5eb552['where'],{'$or':_[_0xa380('0x2e')](_0x5eb552['attributes'],function(_0x59f6a8){var _0x1d95c8={};_0x1d95c8[_0x59f6a8]={'$like':'%'+_0x5325b4[_0xa380('0x2f')][_0xa380('0x3b')]+'%'};return _0x1d95c8;})});}_0x5eb552=_[_0xa380('0x3e')]({},_0x5eb552,_0x5325b4[_0xa380('0x3f')]);return db[_0xa380('0x56')][_0xa380('0x17')]({'where':_0x5eb552[_0xa380('0x3c')]})['then'](function(_0x3b178a){_0x32e553[_0xa380('0x17')]=_0x3b178a;if(_0x5325b4[_0xa380('0x2f')][_0xa380('0x40')]){_0x5eb552['include']=[{'all':!![]}];}return db[_0xa380('0x56')][_0xa380('0x58')](_0x5eb552);})[_0xa380('0x1e')](function(_0x3d5a62){_0x32e553[_0xa380('0x42')]=_0x3d5a62;return _0x32e553;});}})[_0xa380('0x1e')](respondWithFilteredResult(_0x2366cf,_0x5eb552))[_0xa380('0x43')](handleError(_0x2366cf,null));};exports['getHopperHistories']=function(_0x3ef209,_0x5638cc,_0x11e968){var _0x1e5486={'raw':!![],'where':{}};var _0x57ca79={};var _0x43872e={'count':0x0,'rows':[]};return db[_0xa380('0x28')][_0xa380('0x55')]({'where':{'id':_0x3ef209[_0xa380('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5638cc,null))[_0xa380('0x1e')](function(_0x3b0b1b){if(_0x3b0b1b){_0x57ca79[_0xa380('0x2d')]=_[_0xa380('0x30')](db[_0xa380('0x59')][_0xa380('0x29')]);_0x57ca79['query']=_[_0xa380('0x30')](_0x3ef209[_0xa380('0x2f')]);_0x57ca79[_0xa380('0x39')]=_[_0xa380('0x31')](_0x57ca79[_0xa380('0x2d')],_0x57ca79['query']);_0x1e5486['attributes']=_[_0xa380('0x31')](_0x57ca79[_0xa380('0x2d')],qs[_0xa380('0x33')](_0x3ef209[_0xa380('0x2f')][_0xa380('0x33')]));_0x1e5486[_0xa380('0x32')]=_0x1e5486[_0xa380('0x32')][_0xa380('0x34')]?_0x1e5486[_0xa380('0x32')]:_0x57ca79[_0xa380('0x2d')];if(!_0x3ef209[_0xa380('0x2f')]['hasOwnProperty'](_0xa380('0x36'))){_0x1e5486[_0xa380('0x18')]=qs[_0xa380('0x18')](_0x3ef209[_0xa380('0x2f')][_0xa380('0x18')]);_0x1e5486['offset']=qs[_0xa380('0x16')](_0x3ef209['query'][_0xa380('0x16')]);}_0x1e5486[_0xa380('0x37')]=qs[_0xa380('0x38')](_0x3ef209[_0xa380('0x2f')]['sort']);_0x1e5486[_0xa380('0x3c')]=qs['filters'](_[_0xa380('0x3a')](_0x3ef209[_0xa380('0x2f')],_0x57ca79[_0xa380('0x39')]));_0x1e5486[_0xa380('0x3c')]['CampaignId']=_0x3b0b1b['id'];if(_0x3ef209[_0xa380('0x2f')][_0xa380('0x3b')]){_0x1e5486['where']=_['merge'](_0x1e5486['where'],{'$or':_[_0xa380('0x2e')](_0x1e5486['attributes'],function(_0x11f39c){var _0x11c2ad={};_0x11c2ad[_0x11f39c]={'$like':'%'+_0x3ef209[_0xa380('0x2f')]['filter']+'%'};return _0x11c2ad;})});}_0x1e5486=_[_0xa380('0x3e')]({},_0x1e5486,_0x3ef209[_0xa380('0x3f')]);return db[_0xa380('0x59')][_0xa380('0x17')]({'where':_0x1e5486[_0xa380('0x3c')]})[_0xa380('0x1e')](function(_0x2a5dd7){_0x43872e[_0xa380('0x17')]=_0x2a5dd7;if(_0x3ef209['query'][_0xa380('0x40')]){_0x1e5486[_0xa380('0x41')]=[{'all':!![]}];}return db[_0xa380('0x59')][_0xa380('0x58')](_0x1e5486);})[_0xa380('0x1e')](function(_0x204e75){_0x43872e['rows']=_0x204e75;return _0x43872e;});}})['then'](respondWithFilteredResult(_0x5638cc,_0x1e5486))[_0xa380('0x43')](handleError(_0x5638cc,null));};exports[_0xa380('0x5a')]=function(_0x4cb583,_0x6b4641,_0x159abd){var _0x1727fc={'raw':!![],'where':{}};var _0x154d8b={};var _0x23fdb7={'count':0x0,'rows':[]};return db[_0xa380('0x28')][_0xa380('0x55')]({'where':{'id':_0x4cb583['params']['id']}})[_0xa380('0x1e')](handleEntityNotFound(_0x6b4641,null))[_0xa380('0x1e')](function(_0x4d14ec){if(_0x4d14ec){_0x154d8b[_0xa380('0x2d')]=_[_0xa380('0x30')](db[_0xa380('0x5b')][_0xa380('0x29')]);_0x154d8b[_0xa380('0x2f')]=_[_0xa380('0x30')](_0x4cb583['query']);_0x154d8b['filters']=_['intersection'](_0x154d8b[_0xa380('0x2d')],_0x154d8b[_0xa380('0x2f')]);_0x1727fc[_0xa380('0x32')]=_[_0xa380('0x31')](_0x154d8b[_0xa380('0x2d')],qs[_0xa380('0x33')](_0x4cb583[_0xa380('0x2f')][_0xa380('0x33')]));_0x1727fc[_0xa380('0x32')]=_0x1727fc[_0xa380('0x32')]['length']?_0x1727fc[_0xa380('0x32')]:_0x154d8b['model'];if(!_0x4cb583[_0xa380('0x2f')][_0xa380('0x35')](_0xa380('0x36'))){_0x1727fc[_0xa380('0x18')]=qs[_0xa380('0x18')](_0x4cb583['query']['limit']);_0x1727fc[_0xa380('0x16')]=qs[_0xa380('0x16')](_0x4cb583['query'][_0xa380('0x16')]);}_0x1727fc[_0xa380('0x37')]=qs[_0xa380('0x38')](_0x4cb583[_0xa380('0x2f')][_0xa380('0x38')]);_0x1727fc[_0xa380('0x3c')]=qs[_0xa380('0x39')](_[_0xa380('0x3a')](_0x4cb583['query'],_0x154d8b[_0xa380('0x39')]));_0x1727fc[_0xa380('0x3c')][_0xa380('0x57')]=_0x4d14ec['id'];if(_0x4cb583[_0xa380('0x2f')][_0xa380('0x3b')]){_0x1727fc['where']=_[_0xa380('0x3e')](_0x1727fc[_0xa380('0x3c')],{'$or':_[_0xa380('0x2e')](_0x1727fc[_0xa380('0x32')],function(_0x45a8df){var _0x5cb2d6={};_0x5cb2d6[_0x45a8df]={'$like':'%'+_0x4cb583[_0xa380('0x2f')][_0xa380('0x3b')]+'%'};return _0x5cb2d6;})});}_0x1727fc=_[_0xa380('0x3e')]({},_0x1727fc,_0x4cb583[_0xa380('0x3f')]);return db[_0xa380('0x5b')][_0xa380('0x17')]({'where':_0x1727fc[_0xa380('0x3c')]})[_0xa380('0x1e')](function(_0x3608e0){_0x23fdb7[_0xa380('0x17')]=_0x3608e0;if(_0x4cb583['query']['includeAll']){_0x1727fc[_0xa380('0x41')]=[{'all':!![]}];}return db[_0xa380('0x5b')][_0xa380('0x58')](_0x1727fc);})[_0xa380('0x1e')](function(_0x9e0edc){_0x23fdb7[_0xa380('0x42')]=_0x9e0edc;return _0x23fdb7;});}})[_0xa380('0x1e')](respondWithFilteredResult(_0x6b4641,_0x1727fc))[_0xa380('0x43')](handleError(_0x6b4641,null));};exports[_0xa380('0x5c')]=function(_0x307a9e,_0x3b6c02,_0x1c2331){var _0x2fba8b={'raw':!![],'where':{}};var _0x7c522c={};var _0x5c0439={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x307a9e[_0xa380('0x4e')]['id']}})[_0xa380('0x1e')](handleEntityNotFound(_0x3b6c02,null))[_0xa380('0x1e')](function(_0xddcc4e){if(_0xddcc4e){_0x7c522c[_0xa380('0x2d')]=_['keys'](db[_0xa380('0x5d')][_0xa380('0x29')]);_0x7c522c[_0xa380('0x2f')]=_['keys'](_0x307a9e[_0xa380('0x2f')]);_0x7c522c['filters']=_['intersection'](_0x7c522c[_0xa380('0x2d')],_0x7c522c['query']);_0x2fba8b[_0xa380('0x32')]=_[_0xa380('0x31')](_0x7c522c[_0xa380('0x2d')],qs['fields'](_0x307a9e[_0xa380('0x2f')][_0xa380('0x33')]));_0x2fba8b[_0xa380('0x32')]=_0x2fba8b['attributes']['length']?_0x2fba8b[_0xa380('0x32')]:_0x7c522c[_0xa380('0x2d')];if(!_0x307a9e[_0xa380('0x2f')][_0xa380('0x35')]('nolimit')){_0x2fba8b[_0xa380('0x18')]=qs[_0xa380('0x18')](_0x307a9e[_0xa380('0x2f')]['limit']);_0x2fba8b[_0xa380('0x16')]=qs[_0xa380('0x16')](_0x307a9e[_0xa380('0x2f')][_0xa380('0x16')]);}_0x2fba8b[_0xa380('0x37')]=qs['sort'](_0x307a9e[_0xa380('0x2f')][_0xa380('0x38')]);_0x2fba8b[_0xa380('0x3c')]=qs[_0xa380('0x39')](_[_0xa380('0x3a')](_0x307a9e[_0xa380('0x2f')],_0x7c522c[_0xa380('0x39')]));_0x2fba8b[_0xa380('0x3c')]['CampaignId']=_0xddcc4e['id'];if(_0x307a9e[_0xa380('0x2f')][_0xa380('0x3b')]){_0x2fba8b['where']=_[_0xa380('0x3e')](_0x2fba8b['where'],{'$or':_[_0xa380('0x2e')](_0x2fba8b[_0xa380('0x32')],function(_0x4feaf7){var _0x45cacc={};_0x45cacc[_0x4feaf7]={'$like':'%'+_0x307a9e[_0xa380('0x2f')][_0xa380('0x3b')]+'%'};return _0x45cacc;})});}_0x2fba8b=_['merge']({},_0x2fba8b,_0x307a9e['options']);return db['CmHopperBlack']['count']({'where':_0x2fba8b[_0xa380('0x3c')]})[_0xa380('0x1e')](function(_0x45d232){_0x5c0439['count']=_0x45d232;if(_0x307a9e['query'][_0xa380('0x40')]){_0x2fba8b[_0xa380('0x41')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x2fba8b);})['then'](function(_0x33b2cb){_0x5c0439['rows']=_0x33b2cb;return _0x5c0439;});}})[_0xa380('0x1e')](respondWithFilteredResult(_0x3b6c02,_0x2fba8b))[_0xa380('0x43')](handleError(_0x3b6c02,null));};exports[_0xa380('0x5e')]=function(_0x19c446,_0xf59c2d,_0x279bd7){var _0x32127e={};var _0x29ee91={};var _0x16d0d2;var _0x22903f;return db[_0xa380('0x28')]['findOne']({'where':{'id':_0x19c446[_0xa380('0x4e')]['id']}})[_0xa380('0x1e')](handleEntityNotFound(_0xf59c2d,null))[_0xa380('0x1e')](function(_0x43d6b0){if(_0x43d6b0){_0x16d0d2=_0x43d6b0;_0x29ee91['model']=_[_0xa380('0x30')](db[_0xa380('0x5f')]['rawAttributes']);_0x29ee91[_0xa380('0x2f')]=_[_0xa380('0x30')](_0x19c446[_0xa380('0x2f')]);_0x29ee91[_0xa380('0x39')]=_[_0xa380('0x31')](_0x29ee91[_0xa380('0x2d')],_0x29ee91[_0xa380('0x2f')]);_0x32127e[_0xa380('0x32')]=_['intersection'](_0x29ee91['model'],qs[_0xa380('0x33')](_0x19c446[_0xa380('0x2f')]['fields']));_0x32127e['attributes']=_0x32127e['attributes'][_0xa380('0x34')]?_0x32127e['attributes']:_0x29ee91[_0xa380('0x2d')];_0x32127e[_0xa380('0x37')]=qs[_0xa380('0x38')](_0x19c446['query'][_0xa380('0x38')]);_0x32127e[_0xa380('0x3c')]=qs[_0xa380('0x39')](_[_0xa380('0x3a')](_0x19c446[_0xa380('0x2f')],_0x29ee91['filters']));if(_0x19c446['query'][_0xa380('0x3b')]){_0x32127e[_0xa380('0x3c')]=_[_0xa380('0x3e')](_0x32127e['where'],{'$or':_[_0xa380('0x2e')](_0x32127e[_0xa380('0x32')],function(_0x3a3710){var _0xe85d05={};_0xe85d05[_0x3a3710]={'$like':'%'+_0x19c446[_0xa380('0x2f')][_0xa380('0x3b')]+'%'};return _0xe85d05;})});}_0x32127e=_[_0xa380('0x3e')]({},_0x32127e,_0x19c446[_0xa380('0x3f')]);return _0x16d0d2[_0xa380('0x5e')](_0x32127e);}})[_0xa380('0x1e')](function(_0x180d2f){if(_0x180d2f){_0x22903f=_0x180d2f['length'];if(!_0x19c446[_0xa380('0x2f')][_0xa380('0x35')](_0xa380('0x36'))){_0x32127e[_0xa380('0x18')]=qs[_0xa380('0x18')](_0x19c446[_0xa380('0x2f')]['limit']);_0x32127e[_0xa380('0x16')]=qs['offset'](_0x19c446[_0xa380('0x2f')][_0xa380('0x16')]);}return _0x16d0d2[_0xa380('0x5e')](_0x32127e);}})['then'](function(_0x22b41f){if(_0x22b41f){return _0x22b41f?{'count':_0x22903f,'rows':_0x22b41f}:null;}})[_0xa380('0x1e')](respondWithResult(_0xf59c2d,null))['catch'](handleError(_0xf59c2d,null));};exports['addLists']=function(_0x7baf7e,_0xab8f31,_0x27ec2e){var _0x3fb79e,_0x1ef73f;var _0x4b7ac2=[];var _0xc69a8e=moment()[_0xa380('0x60')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xa380('0x28')][_0xa380('0x4a')]({'where':{'id':_0x7baf7e[_0xa380('0x4e')]['id']}})[_0xa380('0x1e')](handleEntityNotFound(_0xab8f31,null))[_0xa380('0x1e')](function(_0x25bcde){if(_0x25bcde){_0x1ef73f=_0x25bcde;return _0x25bcde['addLists'](_0x7baf7e[_0xa380('0x46')][_0xa380('0x61')],_[_0xa380('0x4f')](_0x7baf7e[_0xa380('0x46')],[_0xa380('0x61'),'id'])||{});}return null;})['spread'](function(_0xb2a855){var _0x1f8d56;var _0x3a85d4;_0x3fb79e=_0xb2a855||[];var _0x1aaca6=[];if(_0xb2a855){for(var _0x2cfdb8=0x0;_0x2cfdb8<_0xb2a855[_0xa380('0x34')];_0x2cfdb8+=0x1){var _0x126e13=_0xb2a855[_0x2cfdb8][_0xa380('0x20')]({'plain':!![]});_0x1ef73f[_0xa380('0x62')]=_0x7baf7e[_0xa380('0x46')][_0xa380('0x62')]?_0x7baf7e[_0xa380('0x46')][_0xa380('0x62')]:_0x1ef73f[_0xa380('0x62')];switch(_0x1ef73f[_0xa380('0x62')]){case'always':_0x1f8d56=squel[_0xa380('0x63')]()['into']('cm_hopper')['fromQuery'](['phone',_0xa380('0x64'),_0xa380('0x65'),_0xa380('0x66'),_0xa380('0x57'),_0xa380('0x50'),'updatedAt'],squel[_0xa380('0x67')]()[_0xa380('0x68')](_0xa380('0x69'),'phone')[_0xa380('0x68')]('NOW()',_0xa380('0x64'))['field']('id',_0xa380('0x65'))[_0xa380('0x68')](_0x126e13[_0xa380('0x6a')][_0xa380('0x6b')](),_0xa380('0x66'))[_0xa380('0x68')](_0x7baf7e['params']['id'][_0xa380('0x6b')](),_0xa380('0x57'))['field']('\x27'+_0xc69a8e+'\x27',_0xa380('0x50'))[_0xa380('0x68')]('\x27'+_0xc69a8e+'\x27',_0xa380('0x51'))['from'](_0xa380('0x6c'))[_0xa380('0x3c')]('deletedAt\x20IS\x20NULL')[_0xa380('0x3c')](_0xa380('0x6d'),_0x126e13[_0xa380('0x6a')][_0xa380('0x6b')]())[_0xa380('0x3c')](_0xa380('0x6e'))[_0xa380('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa380('0x67')]()['field'](_0xa380('0x6f'))['from'](_0xa380('0x70'))['where'](_0xa380('0x71'),_0x7baf7e[_0xa380('0x4e')]['id'][_0xa380('0x6b')]()))[_0xa380('0x3c')](_0xa380('0x72'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0xa380('0x73')](_0xa380('0x74'))[_0xa380('0x3c')](_0xa380('0x71'),_0x7baf7e[_0xa380('0x4e')]['id'][_0xa380('0x6b')]())))[_0xa380('0x6b')]();break;case _0xa380('0x75'):_0x1f8d56=squel[_0xa380('0x63')]()[_0xa380('0x76')](_0xa380('0x74'))[_0xa380('0x77')](['phone','scheduledAt','ContactId',_0xa380('0x66'),_0xa380('0x57'),_0xa380('0x50'),_0xa380('0x51')],squel[_0xa380('0x67')]()[_0xa380('0x68')](_0xa380('0x69'),_0xa380('0x69'))[_0xa380('0x68')](_0xa380('0x78'),_0xa380('0x64'))[_0xa380('0x68')]('id',_0xa380('0x65'))[_0xa380('0x68')](_0x126e13[_0xa380('0x6a')]['toString'](),_0xa380('0x66'))['field'](_0x7baf7e[_0xa380('0x4e')]['id']['toString'](),'CampaignId')[_0xa380('0x68')]('\x27'+_0xc69a8e+'\x27','createdAt')[_0xa380('0x68')]('\x27'+_0xc69a8e+'\x27',_0xa380('0x51'))[_0xa380('0x73')](_0xa380('0x6c'))[_0xa380('0x3c')](_0xa380('0x79'))[_0xa380('0x3c')](_0xa380('0x6d'),_0x126e13[_0xa380('0x6a')][_0xa380('0x6b')]())['where'](_0xa380('0x6e'))[_0xa380('0x3c')](_0xa380('0x72'),squel[_0xa380('0x67')]()[_0xa380('0x68')]('COALESCE(phone,\x27\x27)')[_0xa380('0x73')](_0xa380('0x74'))['where'](_0xa380('0x71'),_0x7baf7e[_0xa380('0x4e')]['id'][_0xa380('0x6b')]())))[_0xa380('0x6b')]();break;default:_0x1f8d56=squel[_0xa380('0x63')]()[_0xa380('0x76')](_0xa380('0x74'))['fromQuery']([_0xa380('0x69'),_0xa380('0x64'),_0xa380('0x65'),_0xa380('0x66'),_0xa380('0x57'),_0xa380('0x50'),'updatedAt'],squel['select']()[_0xa380('0x68')](_0xa380('0x69'),_0xa380('0x69'))[_0xa380('0x68')](_0xa380('0x78'),'scheduledAt')[_0xa380('0x68')]('id',_0xa380('0x65'))['field'](_0x126e13[_0xa380('0x6a')][_0xa380('0x6b')](),_0xa380('0x66'))[_0xa380('0x68')](_0x7baf7e[_0xa380('0x4e')]['id'][_0xa380('0x6b')](),_0xa380('0x57'))[_0xa380('0x68')]('\x27'+_0xc69a8e+'\x27',_0xa380('0x50'))[_0xa380('0x68')]('\x27'+_0xc69a8e+'\x27',_0xa380('0x51'))[_0xa380('0x73')](_0xa380('0x6c'))[_0xa380('0x3c')](_0xa380('0x79'))[_0xa380('0x3c')](_0xa380('0x6d'),_0x126e13[_0xa380('0x6a')][_0xa380('0x6b')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xa380('0x6b')]();}_0x3a85d4=squel[_0xa380('0x63')]()[_0xa380('0x76')](_0xa380('0x7a'))[_0xa380('0x77')]([_0xa380('0x7b'),_0xa380('0x64'),'phone',_0xa380('0x7c'),_0xa380('0x50'),_0xa380('0x51')],squel[_0xa380('0x67')]()['field']('h.id','id')[_0xa380('0x68')]('NOW()',_0xa380('0x64'))[_0xa380('0x68')](_0xa380('0x7d'),_0xa380('0x69'))[_0xa380('0x68')]('ci.OrderBY',_0xa380('0x7c'))[_0xa380('0x68')]('\x27'+_0xc69a8e+'\x27',_0xa380('0x50'))[_0xa380('0x68')]('\x27'+_0xc69a8e+'\x27',_0xa380('0x51'))[_0xa380('0x73')](_0xa380('0x7e'),'ci')[_0xa380('0x7f')](_0xa380('0x74'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0xa380('0x80'),_0x126e13[_0xa380('0x6a')]['toString']())[_0xa380('0x3c')](_0xa380('0x81'),_0x7baf7e[_0xa380('0x4e')]['id'][_0xa380('0x6b')]())[_0xa380('0x3c')](_0xa380('0x82'),_0xc69a8e))[_0xa380('0x6b')]();_0x1aaca6['push'](db[_0xa380('0x83')][_0xa380('0x2f')](_0x1f8d56));_0x4b7ac2['push'](db[_0xa380('0x83')][_0xa380('0x2f')](_0x3a85d4));}return BPromise[_0xa380('0x84')](_0x1aaca6);}})[_0xa380('0x1e')](function(){return BPromise[_0xa380('0x84')](_0x4b7ac2);})[_0xa380('0x1e')](function(){return _0x3fb79e;})['then'](respondWithResult(_0xab8f31,null))[_0xa380('0x43')](handleError(_0xab8f31,null));};exports[_0xa380('0x85')]=function(_0x7a1c27,_0xc336da,_0x26eeaa){return db[_0xa380('0x28')]['find']({'where':{'id':_0x7a1c27[_0xa380('0x4e')]['id']}})[_0xa380('0x1e')](handleEntityNotFound(_0xc336da,null))[_0xa380('0x1e')](function(_0x271a69){if(_0x271a69){return _0x271a69['removeLists'](_0x7a1c27[_0xa380('0x2f')][_0xa380('0x61')]);}})[_0xa380('0x1e')](function(_0x452b45){if(_0x452b45){return db[_0xa380('0x56')]['destroy']({'where':{'ListId':_0x7a1c27[_0xa380('0x2f')][_0xa380('0x61')],'CampaignId':_0x7a1c27[_0xa380('0x4e')]['id']}})[_0xa380('0x1e')](function(){return _0x452b45;});}})['then'](respondWithStatusCode(_0xc336da,null))['catch'](handleError(_0xc336da,null));};exports[_0xa380('0x86')]=function(_0x568d4f,_0x3ab73f,_0x151742){var _0x18ba86={};var _0x34856d={};var _0x2dfd5b;var _0x3d7f4d;return db[_0xa380('0x28')][_0xa380('0x55')]({'where':{'id':_0x568d4f[_0xa380('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3ab73f,null))[_0xa380('0x1e')](function(_0x257e31){if(_0x257e31){_0x2dfd5b=_0x257e31;_0x34856d[_0xa380('0x2d')]=_[_0xa380('0x30')](db[_0xa380('0x5f')]['rawAttributes']);_0x34856d[_0xa380('0x2f')]=_[_0xa380('0x30')](_0x568d4f[_0xa380('0x2f')]);_0x34856d[_0xa380('0x39')]=_['intersection'](_0x34856d[_0xa380('0x2d')],_0x34856d[_0xa380('0x2f')]);_0x18ba86[_0xa380('0x32')]=_[_0xa380('0x31')](_0x34856d[_0xa380('0x2d')],qs[_0xa380('0x33')](_0x568d4f[_0xa380('0x2f')][_0xa380('0x33')]));_0x18ba86[_0xa380('0x32')]=_0x18ba86[_0xa380('0x32')][_0xa380('0x34')]?_0x18ba86[_0xa380('0x32')]:_0x34856d[_0xa380('0x2d')];_0x18ba86[_0xa380('0x37')]=qs[_0xa380('0x38')](_0x568d4f[_0xa380('0x2f')][_0xa380('0x38')]);_0x18ba86[_0xa380('0x3c')]=qs[_0xa380('0x39')](_[_0xa380('0x3a')](_0x568d4f[_0xa380('0x2f')],_0x34856d['filters']));if(_0x568d4f['query'][_0xa380('0x3b')]){_0x18ba86[_0xa380('0x3c')]=_[_0xa380('0x3e')](_0x18ba86[_0xa380('0x3c')],{'$or':_['map'](_0x18ba86[_0xa380('0x32')],function(_0x47662d){var _0x4b5e6e={};_0x4b5e6e[_0x47662d]={'$like':'%'+_0x568d4f['query']['filter']+'%'};return _0x4b5e6e;})});}_0x18ba86=_[_0xa380('0x3e')]({},_0x18ba86,_0x568d4f[_0xa380('0x3f')]);return _0x2dfd5b[_0xa380('0x86')](_0x18ba86);}})[_0xa380('0x1e')](function(_0x4cd7e9){if(_0x4cd7e9){_0x3d7f4d=_0x4cd7e9[_0xa380('0x34')];if(!_0x568d4f[_0xa380('0x2f')][_0xa380('0x35')](_0xa380('0x36'))){_0x18ba86[_0xa380('0x18')]=qs[_0xa380('0x18')](_0x568d4f[_0xa380('0x2f')]['limit']);_0x18ba86[_0xa380('0x16')]=qs[_0xa380('0x16')](_0x568d4f[_0xa380('0x2f')][_0xa380('0x16')]);}return _0x2dfd5b[_0xa380('0x86')](_0x18ba86);}})['then'](function(_0x13ed9a){if(_0x13ed9a){return _0x13ed9a?{'count':_0x3d7f4d,'rows':_0x13ed9a}:null;}})[_0xa380('0x1e')](respondWithResult(_0x3ab73f,null))[_0xa380('0x43')](handleError(_0x3ab73f,null));};exports[_0xa380('0x87')]=function(_0x17b81d,_0x4d9a3f,_0x542de1){var _0xe45fbd,_0x51bd76;var _0x375e4b=[];var _0x35ec01=moment()['format'](_0xa380('0x88'));return db[_0xa380('0x28')]['find']({'where':{'id':_0x17b81d['params']['id']}})[_0xa380('0x1e')](handleEntityNotFound(_0x4d9a3f,null))[_0xa380('0x1e')](function(_0x43b116){if(_0x43b116){_0x51bd76=_0x43b116;return _0x43b116[_0xa380('0x87')](_0x17b81d[_0xa380('0x46')]['ids'],_['omit'](_0x17b81d['body'],[_0xa380('0x61'),'id'])||{});}return null;})[_0xa380('0x89')](function(_0x5e6237){var _0x38690e;var _0x1a97b0;_0xe45fbd=_0x5e6237||[];var _0x47d253=[];if(_0x5e6237){for(var _0x1fe4ad=0x0;_0x1fe4ad<_0x5e6237[_0xa380('0x34')];_0x1fe4ad+=0x1){var _0x19e04a=_0x5e6237[_0x1fe4ad][_0xa380('0x20')]({'plain':!![]});_0x38690e=squel[_0xa380('0x63')]()[_0xa380('0x76')]('cm_hopper_black')['fromQuery']([_0xa380('0x69'),_0xa380('0x65'),_0xa380('0x66'),_0xa380('0x57'),_0xa380('0x50'),'updatedAt'],squel[_0xa380('0x67')]()[_0xa380('0x68')](_0xa380('0x69'),_0xa380('0x69'))[_0xa380('0x68')]('id','ContactId')['field'](_0x19e04a[_0xa380('0x6a')][_0xa380('0x6b')](),'ListId')[_0xa380('0x68')](_0x17b81d[_0xa380('0x4e')]['id'][_0xa380('0x6b')](),_0xa380('0x57'))[_0xa380('0x68')]('NOW()',_0xa380('0x50'))[_0xa380('0x68')](_0xa380('0x78'),_0xa380('0x51'))[_0xa380('0x73')](_0xa380('0x6c'))[_0xa380('0x3c')](_0xa380('0x79'))[_0xa380('0x3c')](_0xa380('0x6d'),_0x19e04a[_0xa380('0x6a')][_0xa380('0x6b')]())[_0xa380('0x3c')](_0xa380('0x6e')))['toString']();_0x47d253[_0xa380('0x8a')](db[_0xa380('0x83')][_0xa380('0x2f')](_0x38690e));}return BPromise[_0xa380('0x84')](_0x47d253);}})['then'](function(){return _0xe45fbd;})[_0xa380('0x1e')](respondWithResult(_0x4d9a3f,null))[_0xa380('0x43')](handleError(_0x4d9a3f,null));};exports[_0xa380('0x8b')]=function(_0x5a157b,_0x1673c2,_0x43a7da){return db[_0xa380('0x28')][_0xa380('0x4a')]({'where':{'id':_0x5a157b[_0xa380('0x4e')]['id']}})[_0xa380('0x1e')](handleEntityNotFound(_0x1673c2,null))['then'](function(_0x1d6bbb){if(_0x1d6bbb){return _0x1d6bbb[_0xa380('0x8b')](_0x5a157b[_0xa380('0x2f')][_0xa380('0x61')]);}})['then'](function(_0x59f023){if(_0x59f023){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x5a157b[_0xa380('0x2f')]['ids'],'CampaignId':_0x5a157b['params']['id']}})['then'](function(){return _0x59f023;});}})[_0xa380('0x1e')](respondWithStatusCode(_0x1673c2,null))[_0xa380('0x43')](handleError(_0x1673c2,null));}; \ No newline at end of file +var _0x3526=['COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','error','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','IvrCampaigns','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','scheduledAt','select','field','phone','NOW()','ContactId','CmListId','toString','ListId','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?'];(function(_0x50b9b0,_0x427e8b){var _0x37316f=function(_0x290bd1){while(--_0x290bd1){_0x50b9b0['push'](_0x50b9b0['shift']());}};_0x37316f(++_0x427e8b);}(_0x3526,0x1db));var _0x6352=function(_0x614875,_0x289fdf){_0x614875=_0x614875-0x0;var _0x546b39=_0x3526[_0x614875];return _0x546b39;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6352('0x0'));var zipdir=require(_0x6352('0x1'));var jsonpatch=require(_0x6352('0x2'));var rp=require(_0x6352('0x3'));var moment=require(_0x6352('0x4'));var BPromise=require(_0x6352('0x5'));var Mustache=require(_0x6352('0x6'));var util=require(_0x6352('0x7'));var path=require(_0x6352('0x8'));var sox=require(_0x6352('0x9'));var csv=require(_0x6352('0xa'));var ejs=require(_0x6352('0xb'));var fs=require('fs');var fs_extra=require(_0x6352('0xc'));var _=require(_0x6352('0xd'));var squel=require(_0x6352('0xe'));var crypto=require(_0x6352('0xf'));var jsforce=require(_0x6352('0x10'));var deskjs=require(_0x6352('0x11'));var toCsv=require(_0x6352('0xa'));var querystring=require(_0x6352('0x12'));var Papa=require('papaparse');var Redis=require(_0x6352('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6352('0x14'))(_0x6352('0x15'));var utils=require(_0x6352('0x16'));var config=require(_0x6352('0x17'));var licenseUtil=require(_0x6352('0x18'));var db=require(_0x6352('0x19'))['db'];function respondWithStatusCode(_0x4abb00,_0x362122){_0x362122=_0x362122||0xcc;return function(_0x2f43aa){if(_0x2f43aa){return _0x4abb00[_0x6352('0x1a')](_0x362122);}return _0x4abb00[_0x6352('0x1b')](_0x362122)[_0x6352('0x1c')]();};}function respondWithResult(_0x38245f,_0x47aa91){_0x47aa91=_0x47aa91||0xc8;return function(_0x505e23){if(_0x505e23){return _0x38245f[_0x6352('0x1b')](_0x47aa91)[_0x6352('0x1d')](_0x505e23);}};}function respondWithFilteredResult(_0xeb0285,_0x56ad95){return function(_0x44b0dc){if(_0x44b0dc){var _0x3b494e=typeof _0x56ad95[_0x6352('0x1e')]===_0x6352('0x1f')&&typeof _0x56ad95[_0x6352('0x20')]===_0x6352('0x1f');var _0x315a7e=_0x44b0dc[_0x6352('0x21')];var _0x2fcc57=_0x3b494e?0x0:_0x56ad95[_0x6352('0x1e')];var _0x486d35=_0x3b494e?_0x44b0dc[_0x6352('0x21')]:_0x56ad95['offset']+_0x56ad95[_0x6352('0x20')];var _0x5dd1c7;if(_0x486d35>=_0x315a7e){_0x486d35=_0x315a7e;_0x5dd1c7=0xc8;}else{_0x5dd1c7=0xce;}_0xeb0285[_0x6352('0x1b')](_0x5dd1c7);return _0xeb0285[_0x6352('0x22')](_0x6352('0x23'),_0x2fcc57+'-'+_0x486d35+'/'+_0x315a7e)[_0x6352('0x1d')](_0x44b0dc);}return null;};}function patchUpdates(_0xaf2621){return function(_0x3d66d8){try{jsonpatch['apply'](_0x3d66d8,_0xaf2621,!![]);}catch(_0x3b72f7){return BPromise[_0x6352('0x24')](_0x3b72f7);}return _0x3d66d8[_0x6352('0x25')]();};}function saveUpdates(_0x9560eb,_0x105755){return function(_0x4b8ded){if(_0x4b8ded){return _0x4b8ded['update'](_0x9560eb)[_0x6352('0x26')](function(_0x37f842){return _0x37f842;});}return null;};}function removeEntity(_0xfef8fd,_0x3988b4){return function(_0x335cfd){if(_0x335cfd){return _0x335cfd[_0x6352('0x27')]()['then'](function(){var _0x57e927=_0x335cfd[_0x6352('0x28')]({'plain':!![]});var _0x5b5621='IvrCampaigns';return db['UserProfileResource'][_0x6352('0x27')]({'where':{'type':_0x5b5621,'resourceId':_0x57e927['id']}})[_0x6352('0x26')](function(){return _0x335cfd;});})[_0x6352('0x26')](function(){_0xfef8fd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45cfd8,_0x549bb9){return function(_0x17d977){if(!_0x17d977){_0x45cfd8['sendStatus'](0x194);}return _0x17d977;};}function handleError(_0x2dab10,_0x42ec09){_0x42ec09=_0x42ec09||0x1f4;return function(_0x24b356){logger[_0x6352('0x29')](_0x24b356[_0x6352('0x2a')]);if(_0x24b356[_0x6352('0x2b')]){delete _0x24b356[_0x6352('0x2b')];}_0x2dab10[_0x6352('0x1b')](_0x42ec09)[_0x6352('0x2c')](_0x24b356);};}exports[_0x6352('0x2d')]=function(_0x2ed032,_0x1b6b7a){var _0x23971f={},_0x31a95d={},_0x2ff5bd={'count':0x0,'rows':[]};var _0x2c7365=_['map'](db[_0x6352('0x2e')][_0x6352('0x2f')],function(_0x562e46){return{'name':_0x562e46[_0x6352('0x30')],'type':_0x562e46[_0x6352('0x31')][_0x6352('0x32')]};});_0x31a95d[_0x6352('0x33')]=_[_0x6352('0x34')](_0x2c7365,_0x6352('0x2b'));_0x31a95d[_0x6352('0x35')]=_[_0x6352('0x36')](_0x2ed032[_0x6352('0x35')]);_0x31a95d[_0x6352('0x37')]=_[_0x6352('0x38')](_0x31a95d[_0x6352('0x33')],_0x31a95d['query']);_0x23971f[_0x6352('0x39')]=_[_0x6352('0x38')](_0x31a95d[_0x6352('0x33')],qs[_0x6352('0x3a')](_0x2ed032['query'][_0x6352('0x3a')]));_0x23971f[_0x6352('0x39')]=_0x23971f[_0x6352('0x39')][_0x6352('0x3b')]?_0x23971f[_0x6352('0x39')]:_0x31a95d['model'];if(!_0x2ed032['query']['hasOwnProperty'](_0x6352('0x3c'))){_0x23971f[_0x6352('0x20')]=qs['limit'](_0x2ed032[_0x6352('0x35')][_0x6352('0x20')]);_0x23971f[_0x6352('0x1e')]=qs[_0x6352('0x1e')](_0x2ed032[_0x6352('0x35')][_0x6352('0x1e')]);}_0x23971f[_0x6352('0x3d')]=qs[_0x6352('0x3e')](_0x2ed032['query'][_0x6352('0x3e')]);_0x23971f['where']=qs['filters'](_[_0x6352('0x3f')](_0x2ed032['query'],_0x31a95d[_0x6352('0x37')]),_0x2c7365);if(_0x2ed032[_0x6352('0x35')]['filter']){_0x23971f[_0x6352('0x40')]=_['merge'](_0x23971f['where'],{'$or':_[_0x6352('0x34')](_0x2c7365,function(_0x41245c){if(_0x41245c[_0x6352('0x31')]!==_0x6352('0x41')){var _0x240ebc={};_0x240ebc[_0x41245c[_0x6352('0x2b')]]={'$like':'%'+_0x2ed032['query'][_0x6352('0x42')]+'%'};return _0x240ebc;}})});}_0x23971f=_['merge']({},_0x23971f,_0x2ed032[_0x6352('0x43')]);var _0x461f48={'where':_0x23971f[_0x6352('0x40')]};return db['Campaign'][_0x6352('0x21')](_0x461f48)['then'](function(_0x1c6e69){_0x2ff5bd[_0x6352('0x21')]=_0x1c6e69;if(_0x2ed032[_0x6352('0x35')][_0x6352('0x44')]){_0x23971f[_0x6352('0x45')]=[{'all':!![]}];}return db[_0x6352('0x2e')][_0x6352('0x46')](_0x23971f);})[_0x6352('0x26')](function(_0x1e1952){_0x2ff5bd[_0x6352('0x47')]=_0x1e1952;return _0x2ff5bd;})[_0x6352('0x26')](respondWithFilteredResult(_0x1b6b7a,_0x23971f))[_0x6352('0x48')](handleError(_0x1b6b7a,null));};exports[_0x6352('0x49')]=function(_0x4b3233,_0x27fd8a){var _0x4ddbdb={'raw':![],'where':{'id':_0x4b3233[_0x6352('0x4a')]['id']}},_0x177012={};_0x177012['model']=_[_0x6352('0x36')](db[_0x6352('0x2e')]['rawAttributes']);_0x177012['query']=_[_0x6352('0x36')](_0x4b3233[_0x6352('0x35')]);_0x177012[_0x6352('0x37')]=_[_0x6352('0x38')](_0x177012['model'],_0x177012[_0x6352('0x35')]);_0x4ddbdb[_0x6352('0x39')]=_[_0x6352('0x38')](_0x177012['model'],qs['fields'](_0x4b3233['query'][_0x6352('0x3a')]));_0x4ddbdb[_0x6352('0x39')]=_0x4ddbdb[_0x6352('0x39')][_0x6352('0x3b')]?_0x4ddbdb[_0x6352('0x39')]:_0x177012[_0x6352('0x33')];if(_0x4b3233['query'][_0x6352('0x44')]){_0x4ddbdb['include']=[{'all':!![]}];}_0x4ddbdb=_[_0x6352('0x4b')]({},_0x4ddbdb,_0x4b3233[_0x6352('0x43')]);return db['Campaign'][_0x6352('0x4c')](_0x4ddbdb)[_0x6352('0x26')](handleEntityNotFound(_0x27fd8a,null))[_0x6352('0x26')](respondWithResult(_0x27fd8a,null))[_0x6352('0x48')](handleError(_0x27fd8a,null));};exports['create']=function(_0x43f8af,_0x501994){return db[_0x6352('0x2e')][_0x6352('0x4d')](_0x43f8af[_0x6352('0x4e')],{})[_0x6352('0x26')](function(_0x5949bc){var _0x25a772=_0x43f8af[_0x6352('0x4f')][_0x6352('0x28')]({'plain':!![]});if(!_0x25a772)throw new Error(_0x6352('0x50'));if(_0x25a772[_0x6352('0x51')]===_0x6352('0x4f')){var _0x4a0253=_0x5949bc[_0x6352('0x28')]({'plain':!![]});var _0x142c87='IvrCampaigns';return db[_0x6352('0x52')][_0x6352('0x4c')]({'where':{'name':_0x142c87,'userProfileId':_0x25a772[_0x6352('0x53')]},'raw':!![]})[_0x6352('0x26')](function(_0x2ccf73){if(_0x2ccf73&&_0x2ccf73[_0x6352('0x54')]===0x0){return db[_0x6352('0x55')][_0x6352('0x4d')]({'name':_0x4a0253['name'],'resourceId':_0x4a0253['id'],'type':_0x2ccf73[_0x6352('0x2b')],'sectionId':_0x2ccf73['id']},{})[_0x6352('0x26')](function(){return _0x5949bc;});}else{return _0x5949bc;}})[_0x6352('0x48')](function(_0xa0c13d){logger[_0x6352('0x29')](_0x6352('0x56'),_0xa0c13d);throw _0xa0c13d;});}return _0x5949bc;})['then'](respondWithResult(_0x501994,0xc9))['catch'](handleError(_0x501994,null));};exports['clone']=function(_0x315c26,_0x15416a){var _0xd04b9a={'where':{'id':_0x315c26[_0x6352('0x4a')]['id']}},_0x4f3b23={};_0x4f3b23['model']=_[_0x6352('0x36')](db[_0x6352('0x2e')][_0x6352('0x2f')]);_0xd04b9a[_0x6352('0x39')]=_[_0x6352('0x38')](_0x4f3b23[_0x6352('0x33')],qs[_0x6352('0x3a')](_0x315c26['query'][_0x6352('0x3a')]));_0xd04b9a['attributes']=_0xd04b9a[_0x6352('0x39')]['length']?_0xd04b9a[_0x6352('0x39')]:_0x4f3b23[_0x6352('0x33')];if(_0x315c26[_0x6352('0x35')][_0x6352('0x44')]){_0xd04b9a[_0x6352('0x45')]=[{'all':!![]}];}_0xd04b9a=_[_0x6352('0x4b')]({},_0xd04b9a,_0x315c26[_0x6352('0x43')]);return db[_0x6352('0x2e')][_0x6352('0x4c')](_0xd04b9a)['then'](handleEntityNotFound(_0x15416a,null))['then'](function(_0x279a04){if(_0x279a04){var _0x245a76=_0x279a04[_0x6352('0x28')]({'plain':!![]});_0x245a76=qs[_0x6352('0x57')](_0x245a76,['id',_0x6352('0x58'),_0x6352('0x59')]);_0x315c26[_0x6352('0x4e')]=_[_0x6352('0x57')](_0x315c26[_0x6352('0x4e')],['id',_0x6352('0x58'),_0x6352('0x59')]);return db['Campaign'][_0x6352('0x4d')](_[_0x6352('0x4b')](_0x245a76,_0x315c26['body']),{'include':_0x315c26[_0x6352('0x35')][_0x6352('0x44')]?[{'all':!![]}]:undefined})[_0x6352('0x26')](function(_0x3cbd21){var _0x206c19=_0x315c26[_0x6352('0x4f')]['get']({'plain':!![]});if(!_0x206c19)throw new Error(_0x6352('0x50'));if(_0x206c19[_0x6352('0x51')]==='user'){var _0x272fd4=_0x3cbd21[_0x6352('0x28')]({'plain':!![]});var _0x1ea6ae=_0x6352('0x5a');return db['UserProfileSection'][_0x6352('0x4c')]({'where':{'name':_0x1ea6ae,'userProfileId':_0x206c19[_0x6352('0x53')]},'raw':!![]})[_0x6352('0x26')](function(_0x3b06e6){if(_0x3b06e6&&_0x3b06e6[_0x6352('0x54')]===0x0){return db['UserProfileResource'][_0x6352('0x4d')]({'name':_0x272fd4['name'],'resourceId':_0x272fd4['id'],'type':_0x3b06e6[_0x6352('0x2b')],'sectionId':_0x3b06e6['id']},{})[_0x6352('0x26')](function(){return _0x3cbd21;});}else{return _0x3cbd21;}})[_0x6352('0x48')](function(_0x5a0500){logger['error'](_0x6352('0x56'),_0x5a0500);throw _0x5a0500;});}return _0x3cbd21;});}})[_0x6352('0x26')](respondWithResult(_0x15416a,0xc9))[_0x6352('0x48')](handleError(_0x15416a,null));};exports['update']=function(_0x4a190f,_0x5df225){if(_0x4a190f[_0x6352('0x4e')]['id']){delete _0x4a190f[_0x6352('0x4e')]['id'];}return db['Campaign'][_0x6352('0x4c')]({'where':{'id':_0x4a190f[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](handleEntityNotFound(_0x5df225,null))[_0x6352('0x26')](saveUpdates(_0x4a190f[_0x6352('0x4e')],null))[_0x6352('0x26')](respondWithResult(_0x5df225,null))['catch'](handleError(_0x5df225,null));};exports['destroy']=function(_0x4e76df,_0x594b1c){return db[_0x6352('0x2e')]['find']({'where':{'id':_0x4e76df[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](handleEntityNotFound(_0x594b1c,null))[_0x6352('0x26')](removeEntity(_0x594b1c,null))[_0x6352('0x48')](handleError(_0x594b1c,null));};exports[_0x6352('0x5b')]=function(_0xdbd694,_0x8bfce8,_0x129ed1){var _0x2916aa={'raw':!![],'where':{}};var _0x178d56={};var _0x59e049={'count':0x0,'rows':[]};return db[_0x6352('0x2e')][_0x6352('0x5c')]({'where':{'id':_0xdbd694['params']['id']}})[_0x6352('0x26')](handleEntityNotFound(_0x8bfce8,null))[_0x6352('0x26')](function(_0xcf8a5){if(_0xcf8a5){_0x178d56[_0x6352('0x33')]=_[_0x6352('0x36')](db[_0x6352('0x5d')][_0x6352('0x2f')]);_0x178d56[_0x6352('0x35')]=_['keys'](_0xdbd694[_0x6352('0x35')]);_0x178d56['filters']=_[_0x6352('0x38')](_0x178d56[_0x6352('0x33')],_0x178d56[_0x6352('0x35')]);_0x2916aa[_0x6352('0x39')]=_[_0x6352('0x38')](_0x178d56[_0x6352('0x33')],qs[_0x6352('0x3a')](_0xdbd694['query'][_0x6352('0x3a')]));_0x2916aa[_0x6352('0x39')]=_0x2916aa[_0x6352('0x39')][_0x6352('0x3b')]?_0x2916aa[_0x6352('0x39')]:_0x178d56[_0x6352('0x33')];if(!_0xdbd694[_0x6352('0x35')][_0x6352('0x5e')](_0x6352('0x3c'))){_0x2916aa[_0x6352('0x20')]=qs['limit'](_0xdbd694[_0x6352('0x35')][_0x6352('0x20')]);_0x2916aa['offset']=qs['offset'](_0xdbd694[_0x6352('0x35')][_0x6352('0x1e')]);}_0x2916aa['order']=qs[_0x6352('0x3e')](_0xdbd694[_0x6352('0x35')]['sort']);_0x2916aa[_0x6352('0x40')]=qs['filters'](_[_0x6352('0x3f')](_0xdbd694[_0x6352('0x35')],_0x178d56[_0x6352('0x37')]));_0x2916aa['where'][_0x6352('0x5f')]=_0xcf8a5['id'];if(_0xdbd694[_0x6352('0x35')]['filter']){_0x2916aa['where']=_['merge'](_0x2916aa[_0x6352('0x40')],{'$or':_[_0x6352('0x34')](_0x2916aa[_0x6352('0x39')],function(_0x2e189d){var _0xee5e05={};_0xee5e05[_0x2e189d]={'$like':'%'+_0xdbd694['query'][_0x6352('0x42')]+'%'};return _0xee5e05;})});}_0x2916aa=_['merge']({},_0x2916aa,_0xdbd694[_0x6352('0x43')]);return db[_0x6352('0x5d')][_0x6352('0x21')]({'where':_0x2916aa['where']})[_0x6352('0x26')](function(_0x40ea58){_0x59e049[_0x6352('0x21')]=_0x40ea58;if(_0xdbd694[_0x6352('0x35')][_0x6352('0x44')]){_0x2916aa[_0x6352('0x45')]=[{'all':!![]}];}return db[_0x6352('0x5d')][_0x6352('0x46')](_0x2916aa);})[_0x6352('0x26')](function(_0x3ddac3){_0x59e049['rows']=_0x3ddac3;return _0x59e049;});}})[_0x6352('0x26')](respondWithFilteredResult(_0x8bfce8,_0x2916aa))[_0x6352('0x48')](handleError(_0x8bfce8,null));};exports['getHopperHistories']=function(_0xb6353e,_0x5a359c,_0x5e7860){var _0xfdc628={'raw':!![],'where':{}};var _0xdea9b8={};var _0x2c00ae={'count':0x0,'rows':[]};return db['Campaign'][_0x6352('0x5c')]({'where':{'id':_0xb6353e[_0x6352('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5a359c,null))['then'](function(_0x5c159d){if(_0x5c159d){_0xdea9b8[_0x6352('0x33')]=_[_0x6352('0x36')](db['CmHopperHistory'][_0x6352('0x2f')]);_0xdea9b8[_0x6352('0x35')]=_[_0x6352('0x36')](_0xb6353e['query']);_0xdea9b8[_0x6352('0x37')]=_[_0x6352('0x38')](_0xdea9b8[_0x6352('0x33')],_0xdea9b8[_0x6352('0x35')]);_0xfdc628[_0x6352('0x39')]=_[_0x6352('0x38')](_0xdea9b8[_0x6352('0x33')],qs[_0x6352('0x3a')](_0xb6353e['query']['fields']));_0xfdc628[_0x6352('0x39')]=_0xfdc628[_0x6352('0x39')][_0x6352('0x3b')]?_0xfdc628[_0x6352('0x39')]:_0xdea9b8[_0x6352('0x33')];if(!_0xb6353e[_0x6352('0x35')][_0x6352('0x5e')](_0x6352('0x3c'))){_0xfdc628['limit']=qs['limit'](_0xb6353e['query'][_0x6352('0x20')]);_0xfdc628[_0x6352('0x1e')]=qs[_0x6352('0x1e')](_0xb6353e['query'][_0x6352('0x1e')]);}_0xfdc628[_0x6352('0x3d')]=qs[_0x6352('0x3e')](_0xb6353e[_0x6352('0x35')]['sort']);_0xfdc628[_0x6352('0x40')]=qs[_0x6352('0x37')](_[_0x6352('0x3f')](_0xb6353e[_0x6352('0x35')],_0xdea9b8[_0x6352('0x37')]));_0xfdc628[_0x6352('0x40')][_0x6352('0x5f')]=_0x5c159d['id'];if(_0xb6353e[_0x6352('0x35')]['filter']){_0xfdc628[_0x6352('0x40')]=_[_0x6352('0x4b')](_0xfdc628[_0x6352('0x40')],{'$or':_[_0x6352('0x34')](_0xfdc628['attributes'],function(_0x258a7c){var _0x4e4185={};_0x4e4185[_0x258a7c]={'$like':'%'+_0xb6353e[_0x6352('0x35')][_0x6352('0x42')]+'%'};return _0x4e4185;})});}_0xfdc628=_[_0x6352('0x4b')]({},_0xfdc628,_0xb6353e[_0x6352('0x43')]);return db[_0x6352('0x60')][_0x6352('0x21')]({'where':_0xfdc628[_0x6352('0x40')]})[_0x6352('0x26')](function(_0x17a7b6){_0x2c00ae[_0x6352('0x21')]=_0x17a7b6;if(_0xb6353e[_0x6352('0x35')][_0x6352('0x44')]){_0xfdc628[_0x6352('0x45')]=[{'all':!![]}];}return db[_0x6352('0x60')][_0x6352('0x46')](_0xfdc628);})[_0x6352('0x26')](function(_0x246341){_0x2c00ae[_0x6352('0x47')]=_0x246341;return _0x2c00ae;});}})['then'](respondWithFilteredResult(_0x5a359c,_0xfdc628))['catch'](handleError(_0x5a359c,null));};exports[_0x6352('0x61')]=function(_0x2be178,_0x14155a,_0x3075fb){var _0x3f632b={'raw':!![],'where':{}};var _0x1e4d53={};var _0x5c56ec={'count':0x0,'rows':[]};return db['Campaign'][_0x6352('0x5c')]({'where':{'id':_0x2be178[_0x6352('0x4a')]['id']}})['then'](handleEntityNotFound(_0x14155a,null))[_0x6352('0x26')](function(_0x4f4cbf){if(_0x4f4cbf){_0x1e4d53['model']=_[_0x6352('0x36')](db[_0x6352('0x62')][_0x6352('0x2f')]);_0x1e4d53[_0x6352('0x35')]=_['keys'](_0x2be178['query']);_0x1e4d53[_0x6352('0x37')]=_[_0x6352('0x38')](_0x1e4d53[_0x6352('0x33')],_0x1e4d53['query']);_0x3f632b[_0x6352('0x39')]=_['intersection'](_0x1e4d53[_0x6352('0x33')],qs[_0x6352('0x3a')](_0x2be178[_0x6352('0x35')][_0x6352('0x3a')]));_0x3f632b[_0x6352('0x39')]=_0x3f632b[_0x6352('0x39')][_0x6352('0x3b')]?_0x3f632b[_0x6352('0x39')]:_0x1e4d53['model'];if(!_0x2be178['query'][_0x6352('0x5e')]('nolimit')){_0x3f632b[_0x6352('0x20')]=qs[_0x6352('0x20')](_0x2be178[_0x6352('0x35')][_0x6352('0x20')]);_0x3f632b[_0x6352('0x1e')]=qs[_0x6352('0x1e')](_0x2be178[_0x6352('0x35')][_0x6352('0x1e')]);}_0x3f632b['order']=qs[_0x6352('0x3e')](_0x2be178[_0x6352('0x35')][_0x6352('0x3e')]);_0x3f632b[_0x6352('0x40')]=qs[_0x6352('0x37')](_[_0x6352('0x3f')](_0x2be178[_0x6352('0x35')],_0x1e4d53[_0x6352('0x37')]));_0x3f632b['where'][_0x6352('0x5f')]=_0x4f4cbf['id'];if(_0x2be178[_0x6352('0x35')][_0x6352('0x42')]){_0x3f632b[_0x6352('0x40')]=_['merge'](_0x3f632b[_0x6352('0x40')],{'$or':_[_0x6352('0x34')](_0x3f632b[_0x6352('0x39')],function(_0x59475c){var _0xdaa939={};_0xdaa939[_0x59475c]={'$like':'%'+_0x2be178[_0x6352('0x35')][_0x6352('0x42')]+'%'};return _0xdaa939;})});}_0x3f632b=_['merge']({},_0x3f632b,_0x2be178['options']);return db[_0x6352('0x62')][_0x6352('0x21')]({'where':_0x3f632b[_0x6352('0x40')]})[_0x6352('0x26')](function(_0x104b96){_0x5c56ec['count']=_0x104b96;if(_0x2be178[_0x6352('0x35')][_0x6352('0x44')]){_0x3f632b[_0x6352('0x45')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x3f632b);})['then'](function(_0x2089ab){_0x5c56ec[_0x6352('0x47')]=_0x2089ab;return _0x5c56ec;});}})[_0x6352('0x26')](respondWithFilteredResult(_0x14155a,_0x3f632b))[_0x6352('0x48')](handleError(_0x14155a,null));};exports[_0x6352('0x63')]=function(_0x5f210a,_0x290fbd,_0x2af060){var _0x407e16={'raw':!![],'where':{}};var _0x3d91f3={};var _0x224529={'count':0x0,'rows':[]};return db[_0x6352('0x2e')][_0x6352('0x5c')]({'where':{'id':_0x5f210a[_0x6352('0x4a')]['id']}})['then'](handleEntityNotFound(_0x290fbd,null))['then'](function(_0x15c3bf){if(_0x15c3bf){_0x3d91f3[_0x6352('0x33')]=_[_0x6352('0x36')](db['CmHopperBlack']['rawAttributes']);_0x3d91f3['query']=_['keys'](_0x5f210a['query']);_0x3d91f3[_0x6352('0x37')]=_['intersection'](_0x3d91f3[_0x6352('0x33')],_0x3d91f3[_0x6352('0x35')]);_0x407e16[_0x6352('0x39')]=_[_0x6352('0x38')](_0x3d91f3[_0x6352('0x33')],qs['fields'](_0x5f210a[_0x6352('0x35')][_0x6352('0x3a')]));_0x407e16[_0x6352('0x39')]=_0x407e16[_0x6352('0x39')][_0x6352('0x3b')]?_0x407e16[_0x6352('0x39')]:_0x3d91f3['model'];if(!_0x5f210a[_0x6352('0x35')]['hasOwnProperty'](_0x6352('0x3c'))){_0x407e16[_0x6352('0x20')]=qs[_0x6352('0x20')](_0x5f210a['query'][_0x6352('0x20')]);_0x407e16[_0x6352('0x1e')]=qs[_0x6352('0x1e')](_0x5f210a[_0x6352('0x35')]['offset']);}_0x407e16[_0x6352('0x3d')]=qs[_0x6352('0x3e')](_0x5f210a[_0x6352('0x35')][_0x6352('0x3e')]);_0x407e16[_0x6352('0x40')]=qs['filters'](_[_0x6352('0x3f')](_0x5f210a[_0x6352('0x35')],_0x3d91f3[_0x6352('0x37')]));_0x407e16['where'][_0x6352('0x5f')]=_0x15c3bf['id'];if(_0x5f210a[_0x6352('0x35')]['filter']){_0x407e16[_0x6352('0x40')]=_[_0x6352('0x4b')](_0x407e16[_0x6352('0x40')],{'$or':_['map'](_0x407e16['attributes'],function(_0x1f2104){var _0x38360f={};_0x38360f[_0x1f2104]={'$like':'%'+_0x5f210a[_0x6352('0x35')][_0x6352('0x42')]+'%'};return _0x38360f;})});}_0x407e16=_['merge']({},_0x407e16,_0x5f210a[_0x6352('0x43')]);return db[_0x6352('0x64')][_0x6352('0x21')]({'where':_0x407e16[_0x6352('0x40')]})[_0x6352('0x26')](function(_0x161a67){_0x224529[_0x6352('0x21')]=_0x161a67;if(_0x5f210a[_0x6352('0x35')][_0x6352('0x44')]){_0x407e16[_0x6352('0x45')]=[{'all':!![]}];}return db[_0x6352('0x64')]['findAll'](_0x407e16);})[_0x6352('0x26')](function(_0x1a73a8){_0x224529[_0x6352('0x47')]=_0x1a73a8;return _0x224529;});}})['then'](respondWithFilteredResult(_0x290fbd,_0x407e16))[_0x6352('0x48')](handleError(_0x290fbd,null));};exports[_0x6352('0x65')]=function(_0x43e9e1,_0x40cd18,_0x505fff){var _0x4518d3={};var _0x39ccc9={};var _0x29ea85;var _0x546850;return db[_0x6352('0x2e')][_0x6352('0x5c')]({'where':{'id':_0x43e9e1[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](handleEntityNotFound(_0x40cd18,null))[_0x6352('0x26')](function(_0x57550a){if(_0x57550a){_0x29ea85=_0x57550a;_0x39ccc9[_0x6352('0x33')]=_[_0x6352('0x36')](db['CmList'][_0x6352('0x2f')]);_0x39ccc9[_0x6352('0x35')]=_[_0x6352('0x36')](_0x43e9e1[_0x6352('0x35')]);_0x39ccc9[_0x6352('0x37')]=_[_0x6352('0x38')](_0x39ccc9[_0x6352('0x33')],_0x39ccc9[_0x6352('0x35')]);_0x4518d3[_0x6352('0x39')]=_[_0x6352('0x38')](_0x39ccc9[_0x6352('0x33')],qs[_0x6352('0x3a')](_0x43e9e1[_0x6352('0x35')]['fields']));_0x4518d3['attributes']=_0x4518d3[_0x6352('0x39')][_0x6352('0x3b')]?_0x4518d3[_0x6352('0x39')]:_0x39ccc9[_0x6352('0x33')];_0x4518d3['order']=qs[_0x6352('0x3e')](_0x43e9e1[_0x6352('0x35')][_0x6352('0x3e')]);_0x4518d3[_0x6352('0x40')]=qs[_0x6352('0x37')](_[_0x6352('0x3f')](_0x43e9e1[_0x6352('0x35')],_0x39ccc9[_0x6352('0x37')]));if(_0x43e9e1[_0x6352('0x35')][_0x6352('0x42')]){_0x4518d3[_0x6352('0x40')]=_[_0x6352('0x4b')](_0x4518d3['where'],{'$or':_[_0x6352('0x34')](_0x4518d3['attributes'],function(_0x8a4931){var _0x54164c={};_0x54164c[_0x8a4931]={'$like':'%'+_0x43e9e1[_0x6352('0x35')][_0x6352('0x42')]+'%'};return _0x54164c;})});}_0x4518d3=_[_0x6352('0x4b')]({},_0x4518d3,_0x43e9e1[_0x6352('0x43')]);return _0x29ea85[_0x6352('0x65')](_0x4518d3);}})[_0x6352('0x26')](function(_0x920a7f){if(_0x920a7f){_0x546850=_0x920a7f[_0x6352('0x3b')];if(!_0x43e9e1['query'][_0x6352('0x5e')](_0x6352('0x3c'))){_0x4518d3[_0x6352('0x20')]=qs[_0x6352('0x20')](_0x43e9e1[_0x6352('0x35')]['limit']);_0x4518d3['offset']=qs[_0x6352('0x1e')](_0x43e9e1[_0x6352('0x35')][_0x6352('0x1e')]);}return _0x29ea85[_0x6352('0x65')](_0x4518d3);}})['then'](function(_0x2a3eba){if(_0x2a3eba){return _0x2a3eba?{'count':_0x546850,'rows':_0x2a3eba}:null;}})['then'](respondWithResult(_0x40cd18,null))['catch'](handleError(_0x40cd18,null));};exports[_0x6352('0x66')]=function(_0x3e2767,_0x571f2a,_0x5e1b7c){var _0x55ef8b,_0x24304d;var _0x5ca0d3=[];var _0x2352f2=moment()[_0x6352('0x67')](_0x6352('0x68'));return db[_0x6352('0x2e')][_0x6352('0x4c')]({'where':{'id':_0x3e2767[_0x6352('0x4a')]['id']}})['then'](handleEntityNotFound(_0x571f2a,null))['then'](function(_0x267828){if(_0x267828){_0x24304d=_0x267828;return _0x267828['addLists'](_0x3e2767[_0x6352('0x4e')]['ids'],_[_0x6352('0x57')](_0x3e2767[_0x6352('0x4e')],[_0x6352('0x69'),'id'])||{});}return null;})[_0x6352('0x6a')](function(_0x559f09){var _0x2306ad;var _0x3c49eb;_0x55ef8b=_0x559f09||[];var _0x1b61ff=[];if(_0x559f09){for(var _0x1b4351=0x0;_0x1b4351<_0x559f09[_0x6352('0x3b')];_0x1b4351+=0x1){var _0x436b7b=_0x559f09[_0x1b4351][_0x6352('0x28')]({'plain':!![]});_0x24304d[_0x6352('0x6b')]=_0x3e2767['body']['dialCheckDuplicateType']?_0x3e2767[_0x6352('0x4e')][_0x6352('0x6b')]:_0x24304d[_0x6352('0x6b')];switch(_0x24304d[_0x6352('0x6b')]){case'always':_0x2306ad=squel[_0x6352('0x6c')]()[_0x6352('0x6d')](_0x6352('0x6e'))[_0x6352('0x6f')](['phone',_0x6352('0x70'),'ContactId','ListId',_0x6352('0x5f'),'createdAt','updatedAt'],squel[_0x6352('0x71')]()[_0x6352('0x72')](_0x6352('0x73'),_0x6352('0x73'))['field'](_0x6352('0x74'),_0x6352('0x70'))[_0x6352('0x72')]('id',_0x6352('0x75'))[_0x6352('0x72')](_0x436b7b[_0x6352('0x76')][_0x6352('0x77')](),_0x6352('0x78'))[_0x6352('0x72')](_0x3e2767[_0x6352('0x4a')]['id'][_0x6352('0x77')](),'CampaignId')[_0x6352('0x72')]('\x27'+_0x2352f2+'\x27','createdAt')[_0x6352('0x72')]('\x27'+_0x2352f2+'\x27',_0x6352('0x59'))[_0x6352('0x79')](_0x6352('0x7a'))[_0x6352('0x40')]('deletedAt\x20IS\x20NULL')[_0x6352('0x40')](_0x6352('0x7b'),_0x436b7b[_0x6352('0x76')]['toString']())[_0x6352('0x40')](_0x6352('0x7c'))[_0x6352('0x40')](_0x6352('0x7d'),squel[_0x6352('0x71')]()['field'](_0x6352('0x7e'))[_0x6352('0x79')](_0x6352('0x7f'))[_0x6352('0x40')](_0x6352('0x80'),_0x3e2767[_0x6352('0x4a')]['id'][_0x6352('0x77')]()))[_0x6352('0x40')](_0x6352('0x7d'),squel[_0x6352('0x71')]()[_0x6352('0x72')](_0x6352('0x81'))[_0x6352('0x79')]('cm_hopper')[_0x6352('0x40')](_0x6352('0x80'),_0x3e2767[_0x6352('0x4a')]['id'][_0x6352('0x77')]())))['toString']();break;case _0x6352('0x82'):_0x2306ad=squel[_0x6352('0x6c')]()['into'](_0x6352('0x6e'))[_0x6352('0x6f')]([_0x6352('0x73'),_0x6352('0x70'),_0x6352('0x75'),'ListId',_0x6352('0x5f'),_0x6352('0x58'),_0x6352('0x59')],squel['select']()['field'](_0x6352('0x73'),_0x6352('0x73'))[_0x6352('0x72')](_0x6352('0x74'),'scheduledAt')[_0x6352('0x72')]('id',_0x6352('0x75'))[_0x6352('0x72')](_0x436b7b[_0x6352('0x76')][_0x6352('0x77')](),_0x6352('0x78'))[_0x6352('0x72')](_0x3e2767[_0x6352('0x4a')]['id']['toString'](),_0x6352('0x5f'))[_0x6352('0x72')]('\x27'+_0x2352f2+'\x27',_0x6352('0x58'))[_0x6352('0x72')]('\x27'+_0x2352f2+'\x27',_0x6352('0x59'))[_0x6352('0x79')]('cm_contacts')[_0x6352('0x40')](_0x6352('0x83'))['where'](_0x6352('0x7b'),_0x436b7b['CmListId'][_0x6352('0x77')]())[_0x6352('0x40')](_0x6352('0x7c'))[_0x6352('0x40')](_0x6352('0x7d'),squel[_0x6352('0x71')]()['field'](_0x6352('0x81'))[_0x6352('0x79')](_0x6352('0x6e'))['where']('CampaignId\x20=\x20?',_0x3e2767[_0x6352('0x4a')]['id']['toString']())))['toString']();break;default:_0x2306ad=squel[_0x6352('0x6c')]()['into']('cm_hopper')[_0x6352('0x6f')]([_0x6352('0x73'),_0x6352('0x70'),_0x6352('0x75'),_0x6352('0x78'),_0x6352('0x5f'),_0x6352('0x58'),_0x6352('0x59')],squel[_0x6352('0x71')]()['field'](_0x6352('0x73'),'phone')[_0x6352('0x72')]('NOW()',_0x6352('0x70'))['field']('id',_0x6352('0x75'))[_0x6352('0x72')](_0x436b7b[_0x6352('0x76')]['toString'](),_0x6352('0x78'))[_0x6352('0x72')](_0x3e2767[_0x6352('0x4a')]['id'][_0x6352('0x77')](),_0x6352('0x5f'))['field']('\x27'+_0x2352f2+'\x27',_0x6352('0x58'))[_0x6352('0x72')]('\x27'+_0x2352f2+'\x27',_0x6352('0x59'))[_0x6352('0x79')](_0x6352('0x7a'))[_0x6352('0x40')](_0x6352('0x83'))[_0x6352('0x40')](_0x6352('0x7b'),_0x436b7b[_0x6352('0x76')][_0x6352('0x77')]())[_0x6352('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0x6352('0x77')]();}_0x3c49eb=squel[_0x6352('0x6c')]()[_0x6352('0x6d')](_0x6352('0x84'))[_0x6352('0x6f')]([_0x6352('0x85'),_0x6352('0x70'),_0x6352('0x73'),_0x6352('0x86'),_0x6352('0x58'),_0x6352('0x59')],squel[_0x6352('0x71')]()[_0x6352('0x72')](_0x6352('0x87'),'id')[_0x6352('0x72')](_0x6352('0x74'),_0x6352('0x70'))[_0x6352('0x72')](_0x6352('0x88'),_0x6352('0x73'))[_0x6352('0x72')](_0x6352('0x89'),_0x6352('0x86'))[_0x6352('0x72')]('\x27'+_0x2352f2+'\x27','createdAt')[_0x6352('0x72')]('\x27'+_0x2352f2+'\x27','updatedAt')[_0x6352('0x79')](_0x6352('0x8a'),'ci')[_0x6352('0x8b')](_0x6352('0x6e'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x6352('0x40')](_0x6352('0x8c'),_0x436b7b[_0x6352('0x76')][_0x6352('0x77')]())[_0x6352('0x40')](_0x6352('0x8d'),_0x3e2767['params']['id'][_0x6352('0x77')]())[_0x6352('0x40')]('h.createdAt\x20=\x20?',_0x2352f2))[_0x6352('0x77')]();_0x1b61ff[_0x6352('0x8e')](db[_0x6352('0x8f')]['query'](_0x2306ad));_0x5ca0d3[_0x6352('0x8e')](db[_0x6352('0x8f')][_0x6352('0x35')](_0x3c49eb));}return BPromise['all'](_0x1b61ff);}})[_0x6352('0x26')](function(){return BPromise[_0x6352('0x90')](_0x5ca0d3);})['then'](function(){return _0x55ef8b;})[_0x6352('0x26')](respondWithResult(_0x571f2a,null))[_0x6352('0x48')](handleError(_0x571f2a,null));};exports[_0x6352('0x91')]=function(_0x443768,_0x5ed7a8,_0xe7b224){return db[_0x6352('0x2e')][_0x6352('0x4c')]({'where':{'id':_0x443768[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](handleEntityNotFound(_0x5ed7a8,null))[_0x6352('0x26')](function(_0x6f6ec2){if(_0x6f6ec2){return _0x6f6ec2[_0x6352('0x91')](_0x443768[_0x6352('0x35')]['ids']);}})[_0x6352('0x26')](function(_0x51b837){if(_0x51b837){return db[_0x6352('0x5d')][_0x6352('0x27')]({'where':{'ListId':_0x443768[_0x6352('0x35')][_0x6352('0x69')],'CampaignId':_0x443768[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](function(){return _0x51b837;});}})['then'](respondWithStatusCode(_0x5ed7a8,null))['catch'](handleError(_0x5ed7a8,null));};exports[_0x6352('0x92')]=function(_0x31ae8e,_0x3ee3c4,_0x57daa1){var _0x2d8d90={};var _0x221333={};var _0x104ff9;var _0x31ed1d;return db[_0x6352('0x2e')]['findOne']({'where':{'id':_0x31ae8e[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](handleEntityNotFound(_0x3ee3c4,null))[_0x6352('0x26')](function(_0x37d872){if(_0x37d872){_0x104ff9=_0x37d872;_0x221333['model']=_[_0x6352('0x36')](db[_0x6352('0x93')][_0x6352('0x2f')]);_0x221333['query']=_[_0x6352('0x36')](_0x31ae8e[_0x6352('0x35')]);_0x221333[_0x6352('0x37')]=_[_0x6352('0x38')](_0x221333['model'],_0x221333[_0x6352('0x35')]);_0x2d8d90[_0x6352('0x39')]=_[_0x6352('0x38')](_0x221333['model'],qs['fields'](_0x31ae8e['query'][_0x6352('0x3a')]));_0x2d8d90[_0x6352('0x39')]=_0x2d8d90['attributes']['length']?_0x2d8d90[_0x6352('0x39')]:_0x221333[_0x6352('0x33')];_0x2d8d90[_0x6352('0x3d')]=qs[_0x6352('0x3e')](_0x31ae8e['query'][_0x6352('0x3e')]);_0x2d8d90['where']=qs[_0x6352('0x37')](_[_0x6352('0x3f')](_0x31ae8e['query'],_0x221333[_0x6352('0x37')]));if(_0x31ae8e[_0x6352('0x35')][_0x6352('0x42')]){_0x2d8d90[_0x6352('0x40')]=_['merge'](_0x2d8d90[_0x6352('0x40')],{'$or':_[_0x6352('0x34')](_0x2d8d90[_0x6352('0x39')],function(_0x297703){var _0x37f64f={};_0x37f64f[_0x297703]={'$like':'%'+_0x31ae8e[_0x6352('0x35')][_0x6352('0x42')]+'%'};return _0x37f64f;})});}_0x2d8d90=_[_0x6352('0x4b')]({},_0x2d8d90,_0x31ae8e[_0x6352('0x43')]);return _0x104ff9[_0x6352('0x92')](_0x2d8d90);}})[_0x6352('0x26')](function(_0x1ec058){if(_0x1ec058){_0x31ed1d=_0x1ec058[_0x6352('0x3b')];if(!_0x31ae8e[_0x6352('0x35')][_0x6352('0x5e')](_0x6352('0x3c'))){_0x2d8d90[_0x6352('0x20')]=qs[_0x6352('0x20')](_0x31ae8e[_0x6352('0x35')][_0x6352('0x20')]);_0x2d8d90[_0x6352('0x1e')]=qs[_0x6352('0x1e')](_0x31ae8e[_0x6352('0x35')][_0x6352('0x1e')]);}return _0x104ff9[_0x6352('0x92')](_0x2d8d90);}})[_0x6352('0x26')](function(_0xeb8f46){if(_0xeb8f46){return _0xeb8f46?{'count':_0x31ed1d,'rows':_0xeb8f46}:null;}})[_0x6352('0x26')](respondWithResult(_0x3ee3c4,null))[_0x6352('0x48')](handleError(_0x3ee3c4,null));};exports[_0x6352('0x94')]=function(_0x233cc6,_0x572ba5,_0x2e8739){var _0x36f9a7,_0x332b52;var _0x60ccf4=[];var _0x4e5646=moment()[_0x6352('0x67')](_0x6352('0x68'));return db[_0x6352('0x2e')][_0x6352('0x4c')]({'where':{'id':_0x233cc6[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](handleEntityNotFound(_0x572ba5,null))[_0x6352('0x26')](function(_0x67a0f2){if(_0x67a0f2){_0x332b52=_0x67a0f2;return _0x67a0f2[_0x6352('0x94')](_0x233cc6[_0x6352('0x4e')][_0x6352('0x69')],_[_0x6352('0x57')](_0x233cc6[_0x6352('0x4e')],['ids','id'])||{});}return null;})[_0x6352('0x6a')](function(_0x4fb9e5){var _0x1b3390;var _0x2ccfa8;_0x36f9a7=_0x4fb9e5||[];var _0x3d3026=[];if(_0x4fb9e5){for(var _0x4afd17=0x0;_0x4afd17<_0x4fb9e5[_0x6352('0x3b')];_0x4afd17+=0x1){var _0x49c7cf=_0x4fb9e5[_0x4afd17][_0x6352('0x28')]({'plain':!![]});_0x1b3390=squel[_0x6352('0x6c')]()['into'](_0x6352('0x95'))[_0x6352('0x6f')]([_0x6352('0x73'),_0x6352('0x75'),_0x6352('0x78'),_0x6352('0x5f'),_0x6352('0x58'),_0x6352('0x59')],squel[_0x6352('0x71')]()[_0x6352('0x72')](_0x6352('0x73'),_0x6352('0x73'))[_0x6352('0x72')]('id',_0x6352('0x75'))[_0x6352('0x72')](_0x49c7cf[_0x6352('0x76')][_0x6352('0x77')](),_0x6352('0x78'))['field'](_0x233cc6[_0x6352('0x4a')]['id'][_0x6352('0x77')](),_0x6352('0x5f'))[_0x6352('0x72')](_0x6352('0x74'),'createdAt')['field'](_0x6352('0x74'),_0x6352('0x59'))[_0x6352('0x79')](_0x6352('0x7a'))[_0x6352('0x40')](_0x6352('0x83'))['where'](_0x6352('0x7b'),_0x49c7cf['CmListId'][_0x6352('0x77')]())[_0x6352('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0x6352('0x77')]();_0x3d3026[_0x6352('0x8e')](db[_0x6352('0x8f')]['query'](_0x1b3390));}return BPromise[_0x6352('0x90')](_0x3d3026);}})[_0x6352('0x26')](function(){return _0x36f9a7;})[_0x6352('0x26')](respondWithResult(_0x572ba5,null))[_0x6352('0x48')](handleError(_0x572ba5,null));};exports[_0x6352('0x96')]=function(_0x1c3630,_0x3711c8,_0x13cbe8){return db['Campaign'][_0x6352('0x4c')]({'where':{'id':_0x1c3630[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](handleEntityNotFound(_0x3711c8,null))['then'](function(_0x549070){if(_0x549070){return _0x549070[_0x6352('0x96')](_0x1c3630['query'][_0x6352('0x69')]);}})[_0x6352('0x26')](function(_0x504d26){if(_0x504d26){return db[_0x6352('0x64')][_0x6352('0x27')]({'where':{'ListId':_0x1c3630[_0x6352('0x35')][_0x6352('0x69')],'CampaignId':_0x1c3630[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](function(){return _0x504d26;});}})[_0x6352('0x26')](respondWithStatusCode(_0x3711c8,null))[_0x6352('0x48')](handleError(_0x3711c8,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 836448f..d62f56d 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xdbf14f,_0x4bfcc4){var _0x3e58a2=function(_0x389184){while(--_0x389184){_0xdbf14f['push'](_0xdbf14f['shift']());}};_0x3e58a2(++_0x4bfcc4);}(_0x7a54,0x106));var _0x47a5=function(_0xe7a190,_0x3baa7b){_0xe7a190=_0xe7a190-0x0;var _0x793669=_0x7a54[_0xe7a190];return _0x793669;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 652c7b0..0dc7179 100644 --- a/server/api/campaign/campaign.rpc.js +++ b/server/api/campaign/campaign.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6597=['jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/environment'];(function(_0xfc478e,_0x22c938){var _0x2e521f=function(_0x26c801){while(--_0x26c801){_0xfc478e['push'](_0xfc478e['shift']());}};_0x2e521f(++_0x22c938);}(_0x6597,0x16e));var _0x7659=function(_0x389c70,_0x973171){_0x389c70=_0x389c70-0x0;var _0x256e52=_0x6597[_0x389c70];return _0x256e52;};'use strict';var _=require(_0x7659('0x0'));var util=require(_0x7659('0x1'));var moment=require(_0x7659('0x2'));var BPromise=require('bluebird');var rs=require(_0x7659('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7659('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7659('0x5'));var jayson=require(_0x7659('0x6'));var client=jayson[_0x7659('0x7')][_0x7659('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11cb28,_0x5c4e7f,_0x5ae101){return new BPromise(function(_0x3cfb33,_0x361918){return client[_0x7659('0x9')](_0x11cb28,_0x5ae101)[_0x7659('0xa')](function(_0x597553){logger[_0x7659('0xb')](_0x7659('0xc'),_0x5c4e7f,'request\x20sent');logger[_0x7659('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x5c4e7f,_0x7659('0xe'),JSON['stringify'](_0x597553));if(_0x597553[_0x7659('0xf')]){if(_0x597553[_0x7659('0xf')]['code']===0x1f4){logger[_0x7659('0xf')](_0x7659('0xc'),_0x5c4e7f,_0x597553['error'][_0x7659('0x10')]);return _0x361918(_0x597553['error']['message']);}logger[_0x7659('0xf')](_0x7659('0xc'),_0x5c4e7f,_0x597553[_0x7659('0xf')][_0x7659('0x10')]);return _0x3cfb33(_0x597553[_0x7659('0xf')]['message']);}else{logger['info'](_0x7659('0xc'),_0x5c4e7f,_0x7659('0xe'));_0x3cfb33(_0x597553[_0x7659('0x11')][_0x7659('0x10')]);}})[_0x7659('0x12')](function(_0x26a0f0){logger['error'](_0x7659('0xc'),_0x5c4e7f,_0x26a0f0);_0x361918(_0x26a0f0);});});}exports[_0x7659('0x13')]=function(_0x471b17){var _0x2f1e6c=this;return new Promise(function(_0x100953,_0x201fee){return db[_0x7659('0x14')][_0x7659('0x15')]({'raw':_0x471b17[_0x7659('0x16')]?_0x471b17[_0x7659('0x16')][_0x7659('0x17')]===undefined?!![]:![]:!![],'where':_0x471b17[_0x7659('0x16')]?_0x471b17[_0x7659('0x16')][_0x7659('0x18')]||null:null,'attributes':_0x471b17[_0x7659('0x16')]?_0x471b17['options'][_0x7659('0x19')]||null:null,'limit':_0x471b17[_0x7659('0x16')]?_0x471b17[_0x7659('0x16')][_0x7659('0x1a')]||null:null,'include':_0x471b17['options']?_0x471b17['options'][_0x7659('0x1b')]?_[_0x7659('0x1c')](_0x471b17[_0x7659('0x16')]['include'],function(_0x45058f){return{'model':db[_0x45058f[_0x7659('0x1d')]],'as':_0x45058f['as'],'attributes':_0x45058f[_0x7659('0x19')],'include':_0x45058f['include']?_[_0x7659('0x1c')](_0x45058f[_0x7659('0x1b')],function(_0x185fb1){return{'model':db[_0x185fb1[_0x7659('0x1d')]],'as':_0x185fb1['as'],'attributes':_0x185fb1[_0x7659('0x19')],'include':_0x185fb1[_0x7659('0x1b')]?_[_0x7659('0x1c')](_0x185fb1[_0x7659('0x1b')],function(_0x24967b){return{'model':db[_0x24967b['model']],'as':_0x24967b['as'],'attributes':_0x24967b[_0x7659('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7659('0xa')](function(_0x4e450f){logger[_0x7659('0xb')]('GetCampaign',_0x471b17);logger[_0x7659('0xd')](_0x7659('0x13'),_0x471b17,JSON[_0x7659('0x1e')](_0x4e450f));_0x100953(_0x4e450f);})['catch'](function(_0x99da88){logger[_0x7659('0xf')](_0x7659('0x13'),_0x99da88[_0x7659('0x10')],_0x471b17);_0x201fee(_0x2f1e6c[_0x7659('0xf')](0x1f4,_0x99da88[_0x7659('0x10')]));});});}; \ No newline at end of file +var _0x4c6d=['info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','include','map','model','attributes','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x437273,_0x47def1){var _0x5ac54f=function(_0x5df0c4){while(--_0x5df0c4){_0x437273['push'](_0x437273['shift']());}};_0x5ac54f(++_0x47def1);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x217d09,_0x49df9d){_0x217d09=_0x217d09-0x0;var _0x1330f6=_0x4c6d[_0x217d09];return _0x1330f6;};'use strict';var _=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var moment=require(_0xd4c6('0x2'));var BPromise=require(_0xd4c6('0x3'));var rs=require(_0xd4c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4c6('0x5'))['db'];var utils=require(_0xd4c6('0x6'));var logger=require(_0xd4c6('0x7'))('rpc');var config=require(_0xd4c6('0x8'));var jayson=require(_0xd4c6('0x9'));var client=jayson['client'][_0xd4c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x316314,_0x4329e3,_0x5d4fce){return new BPromise(function(_0x440ee3,_0x19ce1c){return client[_0xd4c6('0xb')](_0x316314,_0x5d4fce)['then'](function(_0xe2f90b){logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,'request\x20sent');logger[_0xd4c6('0xe')](_0xd4c6('0xf'),_0x4329e3,_0xd4c6('0x10'),JSON[_0xd4c6('0x11')](_0xe2f90b));if(_0xe2f90b[_0xd4c6('0x12')]){if(_0xe2f90b[_0xd4c6('0x12')]['code']===0x1f4){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b['error'][_0xd4c6('0x13')]);return _0x19ce1c(_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);}logger[_0xd4c6('0x12')](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);return _0x440ee3(_0xe2f90b['error']['message']);}else{logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,_0xd4c6('0x10'));_0x440ee3(_0xe2f90b[_0xd4c6('0x14')][_0xd4c6('0x13')]);}})[_0xd4c6('0x15')](function(_0xe52075){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe52075);_0x19ce1c(_0xe52075);});});}exports[_0xd4c6('0x16')]=function(_0x23a16f){var _0x2c97b=this;return new Promise(function(_0x31f328,_0x54e0a5){return db[_0xd4c6('0x17')][_0xd4c6('0x18')]({'raw':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f['options'][_0xd4c6('0x1a')]===undefined?!![]:![]:!![],'where':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1b')]||null:null,'attributes':_0x23a16f['options']?_0x23a16f[_0xd4c6('0x19')]['attributes']||null:null,'limit':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1c')]||null:null,'include':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1d')]?_[_0xd4c6('0x1e')](_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1d')],function(_0x466330){return{'model':db[_0x466330[_0xd4c6('0x1f')]],'as':_0x466330['as'],'attributes':_0x466330[_0xd4c6('0x20')],'include':_0x466330['include']?_['map'](_0x466330[_0xd4c6('0x1d')],function(_0x2febbf){return{'model':db[_0x2febbf['model']],'as':_0x2febbf['as'],'attributes':_0x2febbf[_0xd4c6('0x20')],'include':_0x2febbf[_0xd4c6('0x1d')]?_[_0xd4c6('0x1e')](_0x2febbf['include'],function(_0x35b50c){return{'model':db[_0x35b50c[_0xd4c6('0x1f')]],'as':_0x35b50c['as'],'attributes':_0x35b50c['attributes']};}):[]};}):[]};}):[]:[]})[_0xd4c6('0x21')](function(_0x8ce066){logger[_0xd4c6('0xc')]('GetCampaign',_0x23a16f);logger[_0xd4c6('0xe')](_0xd4c6('0x16'),_0x23a16f,JSON[_0xd4c6('0x11')](_0x8ce066));_0x31f328(_0x8ce066);})[_0xd4c6('0x15')](function(_0x2e8c34){logger[_0xd4c6('0x12')](_0xd4c6('0x16'),_0x2e8c34[_0xd4c6('0x13')],_0x23a16f);_0x54e0a5(_0x2c97b[_0xd4c6('0x12')](0x1f4,_0x2e8c34[_0xd4c6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 0fdf686..726b589 100644 --- a/server/api/campaign/index.js +++ b/server/api/campaign/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaef=['post','create','addLists','put','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','/:id','isAuthenticated','show','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists'];(function(_0x3890fe,_0x15c983){var _0x180fe4=function(_0xc1597a){while(--_0xc1597a){_0x3890fe['push'](_0x3890fe['shift']());}};_0x180fe4(++_0x15c983);}(_0xbaef,0x1db));var _0xfbae=function(_0x379d7e,_0x31e49b){_0x379d7e=_0x379d7e-0x0;var _0x4c90b1=_0xbaef[_0x379d7e];return _0x4c90b1;};'use strict';var multer=require(_0xfbae('0x0'));var util=require(_0xfbae('0x1'));var path=require(_0xfbae('0x2'));var timeout=require(_0xfbae('0x3'));var express=require('express');var router=express[_0xfbae('0x4')]();var fs_extra=require(_0xfbae('0x5'));var auth=require(_0xfbae('0x6'));var interaction=require(_0xfbae('0x7'));var config=require('../../config/environment');var controller=require(_0xfbae('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xfbae('0x9')](_0xfbae('0xa'),auth[_0xfbae('0xb')](),controller[_0xfbae('0xc')]);router[_0xfbae('0x9')](_0xfbae('0xd'),auth[_0xfbae('0xb')](),controller['getHoppers']);router[_0xfbae('0x9')]('/:id/hopper_histories',auth[_0xfbae('0xb')](),controller[_0xfbae('0xe')]);router[_0xfbae('0x9')](_0xfbae('0xf'),auth['isAuthenticated'](),controller[_0xfbae('0x10')]);router[_0xfbae('0x9')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0xfbae('0x11')]);router['get'](_0xfbae('0x12'),auth[_0xfbae('0xb')](),controller['getLists']);router[_0xfbae('0x9')](_0xfbae('0x13'),auth[_0xfbae('0xb')](),controller[_0xfbae('0x14')]);router[_0xfbae('0x15')]('/',auth[_0xfbae('0xb')](),controller[_0xfbae('0x16')]);router[_0xfbae('0x15')]('/:id/clone',auth[_0xfbae('0xb')](),controller['clone']);router[_0xfbae('0x15')](_0xfbae('0x12'),auth['isAuthenticated'](),controller[_0xfbae('0x17')]);router[_0xfbae('0x15')](_0xfbae('0x13'),auth[_0xfbae('0xb')](),controller['addBlackLists']);router[_0xfbae('0x18')](_0xfbae('0xa'),auth['isAuthenticated'](),controller[_0xfbae('0x19')]);router['delete'](_0xfbae('0xa'),auth[_0xfbae('0xb')](),controller[_0xfbae('0x1a')]);router[_0xfbae('0x1b')](_0xfbae('0x12'),auth[_0xfbae('0xb')](),controller[_0xfbae('0x1c')]);router[_0xfbae('0x1b')](_0xfbae('0x13'),auth[_0xfbae('0xb')](),controller[_0xfbae('0x1d')]);module[_0xfbae('0x1e')]=router; \ No newline at end of file +var _0x5ffd=['/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','post','/:id/clone','clone','/:id/lists','addLists','/:id/blacklists','addBlackLists','update','delete','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers'];(function(_0x26e954,_0x2fd1f8){var _0x528642=function(_0x7ecf6d){while(--_0x7ecf6d){_0x26e954['push'](_0x26e954['shift']());}};_0x528642(++_0x2fd1f8);}(_0x5ffd,0xdd));var _0xd5ff=function(_0x557cba,_0x1095fb){_0x557cba=_0x557cba-0x0;var _0x1f5fd0=_0x5ffd[_0x557cba];return _0x1f5fd0;};'use strict';var multer=require(_0xd5ff('0x0'));var util=require(_0xd5ff('0x1'));var path=require(_0xd5ff('0x2'));var timeout=require(_0xd5ff('0x3'));var express=require(_0xd5ff('0x4'));var router=express[_0xd5ff('0x5')]();var fs_extra=require(_0xd5ff('0x6'));var auth=require(_0xd5ff('0x7'));var interaction=require(_0xd5ff('0x8'));var config=require(_0xd5ff('0x9'));var controller=require(_0xd5ff('0xa'));router[_0xd5ff('0xb')]('/',auth[_0xd5ff('0xc')](),controller[_0xd5ff('0xd')]);router['get'](_0xd5ff('0xe'),auth[_0xd5ff('0xc')](),controller['show']);router[_0xd5ff('0xb')](_0xd5ff('0xf'),auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x10')]);router[_0xd5ff('0xb')](_0xd5ff('0x11'),auth[_0xd5ff('0xc')](),controller['getHopperHistories']);router[_0xd5ff('0xb')](_0xd5ff('0x12'),auth['isAuthenticated'](),controller[_0xd5ff('0x13')]);router[_0xd5ff('0xb')](_0xd5ff('0x14'),auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x15')]);router['get']('/:id/lists',auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x16')]);router[_0xd5ff('0xb')]('/:id/blacklists',auth[_0xd5ff('0xc')](),controller['getBlackLists']);router[_0xd5ff('0x17')]('/',auth[_0xd5ff('0xc')](),controller['create']);router['post'](_0xd5ff('0x18'),auth['isAuthenticated'](),controller[_0xd5ff('0x19')]);router[_0xd5ff('0x17')](_0xd5ff('0x1a'),auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x1b')]);router[_0xd5ff('0x17')](_0xd5ff('0x1c'),auth['isAuthenticated'](),controller[_0xd5ff('0x1d')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd5ff('0x1e')]);router['delete'](_0xd5ff('0xe'),auth[_0xd5ff('0xc')](),controller['destroy']);router[_0xd5ff('0x1f')]('/:id/lists',auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x20')]);router['delete']('/:id/blacklists',auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 336e467..39687da 100644 --- a/server/api/cannedAnswer/cannedAnswer.attributes.js +++ b/server/api/cannedAnswer/cannedAnswer.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa91e=['exports','STRING','TEXT','medium','getDataValue','key','sequelize'];(function(_0x3ad038,_0x3a0a01){var _0x3fa6fc=function(_0x299cd4){while(--_0x299cd4){_0x3ad038['push'](_0x3ad038['shift']());}};_0x3fa6fc(++_0x3a0a01);}(_0xa91e,0x84));var _0xea91=function(_0x6c11ae,_0x366911){_0x6c11ae=_0x6c11ae-0x0;var _0x15273e=_0xa91e[_0x6c11ae];return _0x15273e;};'use strict';var Sequelize=require(_0xea91('0x0'));module[_0xea91('0x1')]={'key':{'type':Sequelize[_0xea91('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xea91('0x3')],'length':_0xea91('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xea91('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xea91('0x5')](_0xea91('0x6'));}}}; \ No newline at end of file +var _0x9b39=['exports','STRING','TEXT','medium','VIRTUAL','getDataValue','key','sequelize'];(function(_0x224782,_0x5e71da){var _0x162508=function(_0x2b84fb){while(--_0x2b84fb){_0x224782['push'](_0x224782['shift']());}};_0x162508(++_0x5e71da);}(_0x9b39,0xaf));var _0x99b3=function(_0x5ec211,_0x2bcfdc){_0x5ec211=_0x5ec211-0x0;var _0x21773f=_0x9b39[_0x5ec211];return _0x21773f;};'use strict';var Sequelize=require(_0x99b3('0x0'));module[_0x99b3('0x1')]={'key':{'type':Sequelize[_0x99b3('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x99b3('0x3')],'length':_0x99b3('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x99b3('0x5')],'get':function(){return this[_0x99b3('0x6')](_0x99b3('0x7'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index fae1608..6bbf01a 100644 --- a/server/api/cannedAnswer/cannedAnswer.controller.js +++ b/server/api/cannedAnswer/cannedAnswer.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bbf=['keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','CannedAnswers','end','error','stack','name','send','index','CannedAnswer','type','key','model','map'];(function(_0x5c2c72,_0x22cf09){var _0x11c44c=function(_0x37bcca){while(--_0x37bcca){_0x5c2c72['push'](_0x5c2c72['shift']());}};_0x11c44c(++_0x22cf09);}(_0x0bbf,0xed));var _0xf0bb=function(_0x5e92fe,_0x3d21df){_0x5e92fe=_0x5e92fe-0x0;var _0x3e7bbc=_0x0bbf[_0x5e92fe];return _0x3e7bbc;};'use strict';var emlformat=require(_0xf0bb('0x0'));var rimraf=require(_0xf0bb('0x1'));var zipdir=require(_0xf0bb('0x2'));var jsonpatch=require(_0xf0bb('0x3'));var rp=require(_0xf0bb('0x4'));var moment=require(_0xf0bb('0x5'));var BPromise=require(_0xf0bb('0x6'));var Mustache=require(_0xf0bb('0x7'));var util=require(_0xf0bb('0x8'));var path=require(_0xf0bb('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf0bb('0xa'));var fs=require('fs');var fs_extra=require(_0xf0bb('0xb'));var _=require(_0xf0bb('0xc'));var squel=require(_0xf0bb('0xd'));var crypto=require(_0xf0bb('0xe'));var jsforce=require(_0xf0bb('0xf'));var deskjs=require(_0xf0bb('0x10'));var toCsv=require(_0xf0bb('0x11'));var querystring=require('querystring');var Papa=require(_0xf0bb('0x12'));var Redis=require('ioredis');var authService=require(_0xf0bb('0x13'));var qs=require(_0xf0bb('0x14'));var as=require(_0xf0bb('0x15'));var hardwareService=require(_0xf0bb('0x16'));var logger=require('../../config/logger')(_0xf0bb('0x17'));var utils=require(_0xf0bb('0x18'));var config=require(_0xf0bb('0x19'));var licenseUtil=require(_0xf0bb('0x1a'));var db=require(_0xf0bb('0x1b'))['db'];function respondWithStatusCode(_0x2ea5ac,_0x383345){_0x383345=_0x383345||0xcc;return function(_0x2e5222){if(_0x2e5222){return _0x2ea5ac[_0xf0bb('0x1c')](_0x383345);}return _0x2ea5ac[_0xf0bb('0x1d')](_0x383345)['end']();};}function respondWithResult(_0x300c71,_0x2d934a){_0x2d934a=_0x2d934a||0xc8;return function(_0x1404c0){if(_0x1404c0){return _0x300c71['status'](_0x2d934a)['json'](_0x1404c0);}};}function respondWithFilteredResult(_0x429a5c,_0x31be8d){return function(_0x3e771a){if(_0x3e771a){var _0x51f425=typeof _0x31be8d['offset']==='undefined'&&typeof _0x31be8d['limit']===_0xf0bb('0x1e');var _0x19ae11=_0x3e771a[_0xf0bb('0x1f')];var _0x32f58b=_0x51f425?0x0:_0x31be8d[_0xf0bb('0x20')];var _0x1eb2fc=_0x51f425?_0x3e771a[_0xf0bb('0x1f')]:_0x31be8d['offset']+_0x31be8d[_0xf0bb('0x21')];var _0x34ae6e;if(_0x1eb2fc>=_0x19ae11){_0x1eb2fc=_0x19ae11;_0x34ae6e=0xc8;}else{_0x34ae6e=0xce;}_0x429a5c[_0xf0bb('0x1d')](_0x34ae6e);return _0x429a5c[_0xf0bb('0x22')](_0xf0bb('0x23'),_0x32f58b+'-'+_0x1eb2fc+'/'+_0x19ae11)[_0xf0bb('0x24')](_0x3e771a);}return null;};}function patchUpdates(_0x4b34db){return function(_0x59f38d){try{jsonpatch[_0xf0bb('0x25')](_0x59f38d,_0x4b34db,!![]);}catch(_0x3f02f3){return BPromise['reject'](_0x3f02f3);}return _0x59f38d[_0xf0bb('0x26')]();};}function saveUpdates(_0x478eab,_0x3d3199){return function(_0x35939f){if(_0x35939f){return _0x35939f[_0xf0bb('0x27')](_0x478eab)[_0xf0bb('0x28')](function(_0x50efd2){return _0x50efd2;});}return null;};}function removeEntity(_0x42f80f,_0x37b0d5){return function(_0x19d3ce){if(_0x19d3ce){return _0x19d3ce[_0xf0bb('0x29')]()['then'](function(){var _0x419030=_0x19d3ce['get']({'plain':!![]});var _0x2495f2=_0xf0bb('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x2495f2,'resourceId':_0x419030['id']}})['then'](function(){return _0x19d3ce;});})[_0xf0bb('0x28')](function(){_0x42f80f['status'](0xcc)[_0xf0bb('0x2b')]();});}};}function handleEntityNotFound(_0x2279ab,_0x517b44){return function(_0x1f34cc){if(!_0x1f34cc){_0x2279ab['sendStatus'](0x194);}return _0x1f34cc;};}function handleError(_0x8842a8,_0x3483fd){_0x3483fd=_0x3483fd||0x1f4;return function(_0x5ed2bd){logger[_0xf0bb('0x2c')](_0x5ed2bd[_0xf0bb('0x2d')]);if(_0x5ed2bd[_0xf0bb('0x2e')]){delete _0x5ed2bd['name'];}_0x8842a8[_0xf0bb('0x1d')](_0x3483fd)[_0xf0bb('0x2f')](_0x5ed2bd);};}exports[_0xf0bb('0x30')]=function(_0x4fdba3,_0x197d2a){var _0x36dc4f={},_0x15a674={},_0x487db3={'count':0x0,'rows':[]};var _0x5b9cca=_['map'](db[_0xf0bb('0x31')]['rawAttributes'],function(_0x3c11df){return{'name':_0x3c11df['fieldName'],'type':_0x3c11df[_0xf0bb('0x32')][_0xf0bb('0x33')]};});_0x15a674[_0xf0bb('0x34')]=_[_0xf0bb('0x35')](_0x5b9cca,_0xf0bb('0x2e'));_0x15a674['query']=_[_0xf0bb('0x36')](_0x4fdba3['query']);_0x15a674[_0xf0bb('0x37')]=_[_0xf0bb('0x38')](_0x15a674[_0xf0bb('0x34')],_0x15a674[_0xf0bb('0x39')]);_0x36dc4f[_0xf0bb('0x3a')]=_[_0xf0bb('0x38')](_0x15a674['model'],qs[_0xf0bb('0x3b')](_0x4fdba3['query']['fields']));_0x36dc4f['attributes']=_0x36dc4f[_0xf0bb('0x3a')][_0xf0bb('0x3c')]?_0x36dc4f[_0xf0bb('0x3a')]:_0x15a674[_0xf0bb('0x34')];if(!_0x4fdba3['query'][_0xf0bb('0x3d')](_0xf0bb('0x3e'))){_0x36dc4f[_0xf0bb('0x21')]=qs[_0xf0bb('0x21')](_0x4fdba3[_0xf0bb('0x39')][_0xf0bb('0x21')]);_0x36dc4f[_0xf0bb('0x20')]=qs[_0xf0bb('0x20')](_0x4fdba3[_0xf0bb('0x39')][_0xf0bb('0x20')]);}_0x36dc4f[_0xf0bb('0x3f')]=qs['sort'](_0x4fdba3[_0xf0bb('0x39')][_0xf0bb('0x40')]);_0x36dc4f['where']=qs['filters'](_[_0xf0bb('0x41')](_0x4fdba3[_0xf0bb('0x39')],_0x15a674[_0xf0bb('0x37')]),_0x5b9cca);if(_0x4fdba3[_0xf0bb('0x39')][_0xf0bb('0x42')]){_0x36dc4f[_0xf0bb('0x43')]=_['merge'](_0x36dc4f[_0xf0bb('0x43')],{'$or':[{'key':{'$like':'%'+_0x4fdba3[_0xf0bb('0x39')][_0xf0bb('0x42')]+'%'}},{'value':{'$like':'%'+_0x4fdba3['query'][_0xf0bb('0x42')]+'%'}}]});}_0x36dc4f=_[_0xf0bb('0x44')]({},_0x36dc4f,_0x4fdba3[_0xf0bb('0x45')]);var _0x52e6f={'where':_0x36dc4f[_0xf0bb('0x43')]};return db[_0xf0bb('0x31')]['count'](_0x52e6f)[_0xf0bb('0x28')](function(_0xc95523){_0x487db3['count']=_0xc95523;if(_0x4fdba3[_0xf0bb('0x39')][_0xf0bb('0x46')]){_0x36dc4f[_0xf0bb('0x47')]=[{'all':!![]}];}return db[_0xf0bb('0x31')][_0xf0bb('0x48')](_0x36dc4f);})[_0xf0bb('0x28')](function(_0x7993fa){_0x487db3[_0xf0bb('0x49')]=_0x7993fa;return _0x487db3;})[_0xf0bb('0x28')](respondWithFilteredResult(_0x197d2a,_0x36dc4f))[_0xf0bb('0x4a')](handleError(_0x197d2a,null));};exports[_0xf0bb('0x4b')]=function(_0x233f46,_0x340146){var _0x307b8d={'raw':!![],'where':{'id':_0x233f46[_0xf0bb('0x4c')]['id']}},_0x282ced={};_0x282ced['model']=_[_0xf0bb('0x36')](db[_0xf0bb('0x31')][_0xf0bb('0x4d')]);_0x282ced['query']=_['keys'](_0x233f46[_0xf0bb('0x39')]);_0x282ced[_0xf0bb('0x37')]=_[_0xf0bb('0x38')](_0x282ced[_0xf0bb('0x34')],_0x282ced['query']);_0x307b8d[_0xf0bb('0x3a')]=_['intersection'](_0x282ced[_0xf0bb('0x34')],qs[_0xf0bb('0x3b')](_0x233f46[_0xf0bb('0x39')]['fields']));_0x307b8d[_0xf0bb('0x3a')]=_0x307b8d['attributes'][_0xf0bb('0x3c')]?_0x307b8d[_0xf0bb('0x3a')]:_0x282ced[_0xf0bb('0x34')];if(_0x233f46[_0xf0bb('0x39')][_0xf0bb('0x46')]){_0x307b8d[_0xf0bb('0x47')]=[{'all':!![]}];}_0x307b8d=_[_0xf0bb('0x44')]({},_0x307b8d,_0x233f46[_0xf0bb('0x45')]);return db[_0xf0bb('0x31')][_0xf0bb('0x4e')](_0x307b8d)[_0xf0bb('0x28')](handleEntityNotFound(_0x340146,null))[_0xf0bb('0x28')](respondWithResult(_0x340146,null))[_0xf0bb('0x4a')](handleError(_0x340146,null));};exports[_0xf0bb('0x27')]=function(_0x221ba7,_0x542d5c){if(_0x221ba7[_0xf0bb('0x4f')]['id']){delete _0x221ba7['body']['id'];}return db[_0xf0bb('0x31')][_0xf0bb('0x4e')]({'where':{'id':_0x221ba7[_0xf0bb('0x4c')]['id']}})[_0xf0bb('0x28')](handleEntityNotFound(_0x542d5c,null))['then'](saveUpdates(_0x221ba7[_0xf0bb('0x4f')],null))[_0xf0bb('0x28')](respondWithResult(_0x542d5c,null))[_0xf0bb('0x4a')](handleError(_0x542d5c,null));};exports[_0xf0bb('0x29')]=function(_0x1b5675,_0x5922ec){return db[_0xf0bb('0x31')][_0xf0bb('0x4e')]({'where':{'id':_0x1b5675['params']['id']}})[_0xf0bb('0x28')](handleEntityNotFound(_0x5922ec,null))[_0xf0bb('0x28')](removeEntity(_0x5922ec,null))['catch'](handleError(_0x5922ec,null));};exports[_0xf0bb('0x50')]=function(_0x484fdf,_0x5a1c83){var _0x233f93={'key':_0x484fdf[_0xf0bb('0x4f')]['key']};if(_0x484fdf['body'][_0xf0bb('0x51')]){_0x233f93[_0xf0bb('0x51')]=_0x484fdf[_0xf0bb('0x4f')][_0xf0bb('0x51')];}else if(_0x484fdf[_0xf0bb('0x4f')]['SmsAccountId']){_0x233f93[_0xf0bb('0x52')]=_0x484fdf[_0xf0bb('0x4f')][_0xf0bb('0x52')];}else if(_0x484fdf[_0xf0bb('0x4f')][_0xf0bb('0x53')]){_0x233f93['OpenchannelAccountId']=_0x484fdf[_0xf0bb('0x4f')]['OpenchannelAccountId'];}else if(_0x484fdf['body']['ChatWebsiteId']){_0x233f93[_0xf0bb('0x54')]=_0x484fdf['body'][_0xf0bb('0x54')];}return db[_0xf0bb('0x31')][_0xf0bb('0x4e')]({'where':_0x233f93})['then'](function(_0x75d98b){if(_0x75d98b){throw new db[(_0xf0bb('0x55'))][(_0xf0bb('0x56'))](_0xf0bb('0x57'));}return db['CannedAnswer'][_0xf0bb('0x50')](_0x484fdf[_0xf0bb('0x4f')]);})[_0xf0bb('0x28')](function(_0x26e1b8){var _0x4e85cd=_0x484fdf[_0xf0bb('0x58')][_0xf0bb('0x59')]({'plain':!![]});if(!_0x4e85cd)throw new Error(_0xf0bb('0x5a'));if(_0x4e85cd[_0xf0bb('0x5b')]===_0xf0bb('0x58')){var _0x33cff8=_0x26e1b8[_0xf0bb('0x59')]({'plain':!![]});return db[_0xf0bb('0x5c')][_0xf0bb('0x4e')]({'where':{'name':_0xf0bb('0x2a'),'userProfileId':_0x4e85cd[_0xf0bb('0x5d')]},'raw':!![]})[_0xf0bb('0x28')](function(_0x2e7cb6){if(_0x2e7cb6&&_0x2e7cb6[_0xf0bb('0x5e')]===0x0){return db[_0xf0bb('0x5f')]['create']({'name':_0x33cff8[_0xf0bb('0x2e')],'resourceId':_0x33cff8['id'],'type':_0x2e7cb6[_0xf0bb('0x2e')],'sectionId':_0x2e7cb6['id']},{})[_0xf0bb('0x28')](function(){return _0x26e1b8;});}else{return _0x26e1b8;}})[_0xf0bb('0x4a')](function(_0x384a7a){logger[_0xf0bb('0x2c')](_0xf0bb('0x60'),_0x384a7a);throw _0x384a7a;});}return _0x26e1b8;})[_0xf0bb('0x28')](respondWithResult(_0x5a1c83,0xc9))[_0xf0bb('0x4a')](handleError(_0x5a1c83,null));}; \ No newline at end of file +var _0x9b99=['findAll','rows','catch','show','keys','length','merge','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send','index','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','options','CannedAnswer','includeAll','include'];(function(_0x5e9dec,_0x3f4684){var _0x338054=function(_0x317dac){while(--_0x317dac){_0x5e9dec['push'](_0x5e9dec['shift']());}};_0x338054(++_0x3f4684);}(_0x9b99,0x17b));var _0x99b9=function(_0x495686,_0x3ce623){_0x495686=_0x495686-0x0;var _0x428c4f=_0x9b99[_0x495686];return _0x428c4f;};'use strict';var emlformat=require(_0x99b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x99b9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x99b9('0x2'));var Mustache=require(_0x99b9('0x3'));var util=require(_0x99b9('0x4'));var path=require(_0x99b9('0x5'));var sox=require(_0x99b9('0x6'));var csv=require(_0x99b9('0x7'));var ejs=require(_0x99b9('0x8'));var fs=require('fs');var fs_extra=require(_0x99b9('0x9'));var _=require(_0x99b9('0xa'));var squel=require(_0x99b9('0xb'));var crypto=require(_0x99b9('0xc'));var jsforce=require(_0x99b9('0xd'));var deskjs=require(_0x99b9('0xe'));var toCsv=require(_0x99b9('0x7'));var querystring=require(_0x99b9('0xf'));var Papa=require(_0x99b9('0x10'));var Redis=require(_0x99b9('0x11'));var authService=require(_0x99b9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x99b9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x99b9('0x14'))(_0x99b9('0x15'));var utils=require(_0x99b9('0x16'));var config=require(_0x99b9('0x17'));var licenseUtil=require(_0x99b9('0x18'));var db=require(_0x99b9('0x19'))['db'];function respondWithStatusCode(_0x56b3a6,_0x598860){_0x598860=_0x598860||0xcc;return function(_0x40803a){if(_0x40803a){return _0x56b3a6['sendStatus'](_0x598860);}return _0x56b3a6[_0x99b9('0x1a')](_0x598860)[_0x99b9('0x1b')]();};}function respondWithResult(_0x117fa8,_0x4b7388){_0x4b7388=_0x4b7388||0xc8;return function(_0x3763c5){if(_0x3763c5){return _0x117fa8['status'](_0x4b7388)[_0x99b9('0x1c')](_0x3763c5);}};}function respondWithFilteredResult(_0x4c03d3,_0xcfa141){return function(_0x186f79){if(_0x186f79){var _0x292715=typeof _0xcfa141[_0x99b9('0x1d')]===_0x99b9('0x1e')&&typeof _0xcfa141[_0x99b9('0x1f')]===_0x99b9('0x1e');var _0x2fe9c0=_0x186f79[_0x99b9('0x20')];var _0xe1fd86=_0x292715?0x0:_0xcfa141[_0x99b9('0x1d')];var _0x8b4614=_0x292715?_0x186f79['count']:_0xcfa141['offset']+_0xcfa141[_0x99b9('0x1f')];var _0x4a6033;if(_0x8b4614>=_0x2fe9c0){_0x8b4614=_0x2fe9c0;_0x4a6033=0xc8;}else{_0x4a6033=0xce;}_0x4c03d3[_0x99b9('0x1a')](_0x4a6033);return _0x4c03d3[_0x99b9('0x21')](_0x99b9('0x22'),_0xe1fd86+'-'+_0x8b4614+'/'+_0x2fe9c0)[_0x99b9('0x1c')](_0x186f79);}return null;};}function patchUpdates(_0x4a2edf){return function(_0x1e4a10){try{jsonpatch[_0x99b9('0x23')](_0x1e4a10,_0x4a2edf,!![]);}catch(_0x2ffa53){return BPromise['reject'](_0x2ffa53);}return _0x1e4a10[_0x99b9('0x24')]();};}function saveUpdates(_0x4d88f3,_0x280993){return function(_0x166425){if(_0x166425){return _0x166425[_0x99b9('0x25')](_0x4d88f3)[_0x99b9('0x26')](function(_0x158939){return _0x158939;});}return null;};}function removeEntity(_0x4bbf2e,_0x4cbfc6){return function(_0x4fe351){if(_0x4fe351){return _0x4fe351[_0x99b9('0x27')]()[_0x99b9('0x26')](function(){var _0x4bb343=_0x4fe351[_0x99b9('0x28')]({'plain':!![]});var _0x341ddf=_0x99b9('0x29');return db[_0x99b9('0x2a')][_0x99b9('0x27')]({'where':{'type':_0x341ddf,'resourceId':_0x4bb343['id']}})[_0x99b9('0x26')](function(){return _0x4fe351;});})[_0x99b9('0x26')](function(){_0x4bbf2e[_0x99b9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c8737,_0x25aa0a){return function(_0x36c61e){if(!_0x36c61e){_0x3c8737['sendStatus'](0x194);}return _0x36c61e;};}function handleError(_0x224d54,_0x5d9b8e){_0x5d9b8e=_0x5d9b8e||0x1f4;return function(_0x242de3){logger['error'](_0x242de3[_0x99b9('0x2b')]);if(_0x242de3[_0x99b9('0x2c')]){delete _0x242de3[_0x99b9('0x2c')];}_0x224d54[_0x99b9('0x1a')](_0x5d9b8e)[_0x99b9('0x2d')](_0x242de3);};}exports[_0x99b9('0x2e')]=function(_0x36de04,_0x390280){var _0x194e8f={},_0x1169a4={},_0x31f86c={'count':0x0,'rows':[]};var _0x985738=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x310b11){return{'name':_0x310b11[_0x99b9('0x2f')],'type':_0x310b11[_0x99b9('0x30')][_0x99b9('0x31')]};});_0x1169a4[_0x99b9('0x32')]=_['map'](_0x985738,_0x99b9('0x2c'));_0x1169a4[_0x99b9('0x33')]=_['keys'](_0x36de04['query']);_0x1169a4[_0x99b9('0x34')]=_[_0x99b9('0x35')](_0x1169a4[_0x99b9('0x32')],_0x1169a4[_0x99b9('0x33')]);_0x194e8f[_0x99b9('0x36')]=_[_0x99b9('0x35')](_0x1169a4[_0x99b9('0x32')],qs[_0x99b9('0x37')](_0x36de04[_0x99b9('0x33')][_0x99b9('0x37')]));_0x194e8f['attributes']=_0x194e8f['attributes']['length']?_0x194e8f['attributes']:_0x1169a4[_0x99b9('0x32')];if(!_0x36de04[_0x99b9('0x33')][_0x99b9('0x38')](_0x99b9('0x39'))){_0x194e8f['limit']=qs['limit'](_0x36de04[_0x99b9('0x33')][_0x99b9('0x1f')]);_0x194e8f['offset']=qs['offset'](_0x36de04['query'][_0x99b9('0x1d')]);}_0x194e8f[_0x99b9('0x3a')]=qs[_0x99b9('0x3b')](_0x36de04[_0x99b9('0x33')][_0x99b9('0x3b')]);_0x194e8f[_0x99b9('0x3c')]=qs[_0x99b9('0x34')](_['pick'](_0x36de04[_0x99b9('0x33')],_0x1169a4['filters']),_0x985738);if(_0x36de04[_0x99b9('0x33')][_0x99b9('0x3d')]){_0x194e8f[_0x99b9('0x3c')]=_['merge'](_0x194e8f[_0x99b9('0x3c')],{'$or':[{'key':{'$like':'%'+_0x36de04[_0x99b9('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0x36de04[_0x99b9('0x33')][_0x99b9('0x3d')]+'%'}}]});}_0x194e8f=_['merge']({},_0x194e8f,_0x36de04[_0x99b9('0x3e')]);var _0x4b0c88={'where':_0x194e8f[_0x99b9('0x3c')]};return db[_0x99b9('0x3f')][_0x99b9('0x20')](_0x4b0c88)[_0x99b9('0x26')](function(_0x21c8a7){_0x31f86c['count']=_0x21c8a7;if(_0x36de04['query'][_0x99b9('0x40')]){_0x194e8f[_0x99b9('0x41')]=[{'all':!![]}];}return db[_0x99b9('0x3f')][_0x99b9('0x42')](_0x194e8f);})[_0x99b9('0x26')](function(_0x43d734){_0x31f86c[_0x99b9('0x43')]=_0x43d734;return _0x31f86c;})[_0x99b9('0x26')](respondWithFilteredResult(_0x390280,_0x194e8f))[_0x99b9('0x44')](handleError(_0x390280,null));};exports[_0x99b9('0x45')]=function(_0x1ac729,_0x228546){var _0xe685bd={'raw':!![],'where':{'id':_0x1ac729['params']['id']}},_0x408a75={};_0x408a75[_0x99b9('0x32')]=_[_0x99b9('0x46')](db[_0x99b9('0x3f')]['rawAttributes']);_0x408a75[_0x99b9('0x33')]=_[_0x99b9('0x46')](_0x1ac729[_0x99b9('0x33')]);_0x408a75[_0x99b9('0x34')]=_['intersection'](_0x408a75[_0x99b9('0x32')],_0x408a75[_0x99b9('0x33')]);_0xe685bd[_0x99b9('0x36')]=_[_0x99b9('0x35')](_0x408a75[_0x99b9('0x32')],qs[_0x99b9('0x37')](_0x1ac729['query'][_0x99b9('0x37')]));_0xe685bd[_0x99b9('0x36')]=_0xe685bd[_0x99b9('0x36')][_0x99b9('0x47')]?_0xe685bd['attributes']:_0x408a75[_0x99b9('0x32')];if(_0x1ac729[_0x99b9('0x33')][_0x99b9('0x40')]){_0xe685bd['include']=[{'all':!![]}];}_0xe685bd=_[_0x99b9('0x48')]({},_0xe685bd,_0x1ac729[_0x99b9('0x3e')]);return db[_0x99b9('0x3f')]['find'](_0xe685bd)[_0x99b9('0x26')](handleEntityNotFound(_0x228546,null))['then'](respondWithResult(_0x228546,null))[_0x99b9('0x44')](handleError(_0x228546,null));};exports[_0x99b9('0x25')]=function(_0x3a29ea,_0x61fb97){if(_0x3a29ea[_0x99b9('0x49')]['id']){delete _0x3a29ea['body']['id'];}return db[_0x99b9('0x3f')][_0x99b9('0x4a')]({'where':{'id':_0x3a29ea[_0x99b9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x61fb97,null))[_0x99b9('0x26')](saveUpdates(_0x3a29ea[_0x99b9('0x49')],null))['then'](respondWithResult(_0x61fb97,null))[_0x99b9('0x44')](handleError(_0x61fb97,null));};exports['destroy']=function(_0x5c3b88,_0x49ed0a){return db[_0x99b9('0x3f')][_0x99b9('0x4a')]({'where':{'id':_0x5c3b88['params']['id']}})[_0x99b9('0x26')](handleEntityNotFound(_0x49ed0a,null))[_0x99b9('0x26')](removeEntity(_0x49ed0a,null))['catch'](handleError(_0x49ed0a,null));};exports[_0x99b9('0x4c')]=function(_0x2dc040,_0x48fe4f){var _0xfc2c6f={'key':_0x2dc040[_0x99b9('0x49')]['key']};if(_0x2dc040['body'][_0x99b9('0x4d')]){_0xfc2c6f[_0x99b9('0x4d')]=_0x2dc040[_0x99b9('0x49')][_0x99b9('0x4d')];}else if(_0x2dc040['body']['SmsAccountId']){_0xfc2c6f[_0x99b9('0x4e')]=_0x2dc040['body'][_0x99b9('0x4e')];}else if(_0x2dc040['body'][_0x99b9('0x4f')]){_0xfc2c6f[_0x99b9('0x4f')]=_0x2dc040[_0x99b9('0x49')][_0x99b9('0x4f')];}else if(_0x2dc040['body']['ChatWebsiteId']){_0xfc2c6f[_0x99b9('0x50')]=_0x2dc040['body'][_0x99b9('0x50')];}return db[_0x99b9('0x3f')]['find']({'where':_0xfc2c6f})[_0x99b9('0x26')](function(_0x1223f6){if(_0x1223f6){throw new db[(_0x99b9('0x51'))][(_0x99b9('0x52'))](_0x99b9('0x53'));}return db[_0x99b9('0x3f')][_0x99b9('0x4c')](_0x2dc040[_0x99b9('0x49')]);})[_0x99b9('0x26')](function(_0x2cbb3c){var _0x422dfe=_0x2dc040['user'][_0x99b9('0x28')]({'plain':!![]});if(!_0x422dfe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x422dfe['role']===_0x99b9('0x54')){var _0x481754=_0x2cbb3c[_0x99b9('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x99b9('0x4a')]({'where':{'name':_0x99b9('0x29'),'userProfileId':_0x422dfe[_0x99b9('0x55')]},'raw':!![]})['then'](function(_0x17b780){if(_0x17b780&&_0x17b780[_0x99b9('0x56')]===0x0){return db[_0x99b9('0x2a')][_0x99b9('0x4c')]({'name':_0x481754[_0x99b9('0x2c')],'resourceId':_0x481754['id'],'type':_0x17b780['name'],'sectionId':_0x17b780['id']},{})[_0x99b9('0x26')](function(){return _0x2cbb3c;});}else{return _0x2cbb3c;}})[_0x99b9('0x44')](function(_0x46e9cc){logger[_0x99b9('0x57')](_0x99b9('0x58'),_0x46e9cc);throw _0x46e9cc;});}return _0x2cbb3c;})['then'](respondWithResult(_0x48fe4f,0xc9))[_0x99b9('0x44')](handleError(_0x48fe4f,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 8f30f16..32118b7 100644 --- a/server/api/cannedAnswer/cannedAnswer.model.js +++ b/server/api/cannedAnswer/cannedAnswer.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe442=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x332687,_0x42f6e7){var _0x5e8eda=function(_0x229c92){while(--_0x229c92){_0x332687['push'](_0x332687['shift']());}};_0x5e8eda(++_0x42f6e7);}(_0xe442,0x11f));var _0x2e44=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xe442[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x2e44('0x0'));var util=require(_0x2e44('0x1'));var logger=require(_0x2e44('0x2'))(_0x2e44('0x3'));var moment=require(_0x2e44('0x4'));var BPromise=require('bluebird');var rp=require(_0x2e44('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e44('0x6'));var config=require(_0x2e44('0x7'));var attributes=require(_0x2e44('0x8'));module[_0x2e44('0x9')]=function(_0x231c0e,_0x1f4da7){return _0x231c0e[_0x2e44('0xa')](_0x2e44('0xb'),attributes,{'tableName':_0x2e44('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2e44('0xd'),'collate':_0x2e44('0xe')});}; \ No newline at end of file +var _0xa9d0=['api','moment','bluebird','request-promise','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x5619c2,_0x4f90f9){var _0x1ff4f5=function(_0xbf9cc7){while(--_0xbf9cc7){_0x5619c2['push'](_0x5619c2['shift']());}};_0x1ff4f5(++_0x4f90f9);}(_0xa9d0,0x1eb));var _0x0a9d=function(_0x49d97d,_0x114b91){_0x49d97d=_0x49d97d-0x0;var _0x5bbfc3=_0xa9d0[_0x49d97d];return _0x5bbfc3;};'use strict';var _=require(_0x0a9d('0x0'));var util=require(_0x0a9d('0x1'));var logger=require(_0x0a9d('0x2'))(_0x0a9d('0x3'));var moment=require(_0x0a9d('0x4'));var BPromise=require(_0x0a9d('0x5'));var rp=require(_0x0a9d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0a9d('0x7'));module[_0x0a9d('0x8')]=function(_0x32aa13,_0x249828){return _0x32aa13[_0x0a9d('0x9')](_0x0a9d('0xa'),attributes,{'tableName':_0x0a9d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9d('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 7e6f7ce..40038bd 100644 --- a/server/api/cannedAnswer/cannedAnswer.rpc.js +++ b/server/api/cannedAnswer/cannedAnswer.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3107a6,_0x323b45){var _0x3c55f0=function(_0x2d0a3c){while(--_0x2d0a3c){_0x3107a6['push'](_0x3107a6['shift']());}};_0x3c55f0(++_0x323b45);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2ee2b3,_0x4fd141){var _0x27add5=function(_0x28c75d){while(--_0x28c75d){_0x2ee2b3['push'](_0x2ee2b3['shift']());}};_0x27add5(++_0x4fd141);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index c5e9dc6..a78d926 100644 --- a/server/api/cannedAnswer/index.js +++ b/server/api/cannedAnswer/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8421=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x292c2b,_0x29e359){var _0x459dc0=function(_0xb38d3b){while(--_0xb38d3b){_0x292c2b['push'](_0x292c2b['shift']());}};_0x459dc0(++_0x29e359);}(_0x8421,0x131));var _0x1842=function(_0x4adfcc,_0x4ef91a){_0x4adfcc=_0x4adfcc-0x0;var _0x566c4e=_0x8421[_0x4adfcc];return _0x566c4e;};'use strict';var multer=require(_0x1842('0x0'));var util=require(_0x1842('0x1'));var path=require(_0x1842('0x2'));var timeout=require(_0x1842('0x3'));var express=require(_0x1842('0x4'));var router=express[_0x1842('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1842('0x6'));var interaction=require(_0x1842('0x7'));var config=require('../../config/environment');var controller=require(_0x1842('0x8'));router[_0x1842('0x9')]('/',auth['isAuthenticated'](),controller[_0x1842('0xa')]);router[_0x1842('0x9')](_0x1842('0xb'),auth[_0x1842('0xc')](),controller[_0x1842('0xd')]);router[_0x1842('0xe')]('/',auth[_0x1842('0xc')](),controller[_0x1842('0xf')]);router[_0x1842('0x10')](_0x1842('0xb'),auth[_0x1842('0xc')](),controller[_0x1842('0x11')]);router['delete'](_0x1842('0xb'),auth[_0x1842('0xc')](),controller[_0x1842('0x12')]);module[_0x1842('0x13')]=router; \ No newline at end of file +var _0x1b77=['delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post','create','put','update'];(function(_0xbeab9,_0x37ec4a){var _0x27650c=function(_0x4042db){while(--_0x4042db){_0xbeab9['push'](_0xbeab9['shift']());}};_0x27650c(++_0x37ec4a);}(_0x1b77,0x75));var _0x71b7=function(_0x33af9f,_0x38734f){_0x33af9f=_0x33af9f-0x0;var _0x1483a1=_0x1b77[_0x33af9f];return _0x1483a1;};'use strict';var multer=require('multer');var util=require(_0x71b7('0x0'));var path=require('path');var timeout=require(_0x71b7('0x1'));var express=require(_0x71b7('0x2'));var router=express['Router']();var fs_extra=require(_0x71b7('0x3'));var auth=require(_0x71b7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x71b7('0x5'));var controller=require(_0x71b7('0x6'));router[_0x71b7('0x7')]('/',auth['isAuthenticated'](),controller[_0x71b7('0x8')]);router[_0x71b7('0x7')](_0x71b7('0x9'),auth[_0x71b7('0xa')](),controller[_0x71b7('0xb')]);router[_0x71b7('0xc')]('/',auth[_0x71b7('0xa')](),controller[_0x71b7('0xd')]);router[_0x71b7('0xe')](_0x71b7('0x9'),auth[_0x71b7('0xa')](),controller[_0x71b7('0xf')]);router[_0x71b7('0x10')](_0x71b7('0x9'),auth['isAuthenticated'](),controller[_0x71b7('0x11')]);module[_0x71b7('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 4a15bf8..49a249c 100644 --- a/server/api/cdr/cdr.attributes.js +++ b/server/api/cdr/cdr.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xceab=['STRING','INTEGER','sequelize','DATE','1970-01-01\x2000:00:01'];(function(_0xcae673,_0x3b0ae5){var _0x14db49=function(_0x94f64e){while(--_0x94f64e){_0xcae673['push'](_0xcae673['shift']());}};_0x14db49(++_0x3b0ae5);}(_0xceab,0x106));var _0xbcea=function(_0x56f57a,_0x5ea452){_0x56f57a=_0x56f57a-0x0;var _0x33c8d6=_0xceab[_0x56f57a];return _0x33c8d6;};'use strict';var Sequelize=require(_0xbcea('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xbcea('0x1')],'allowNull':![],'defaultValue':_0xbcea('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xbcea('0x3')]},'dst':{'type':Sequelize[_0xbcea('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xbcea('0x3')]},'dstchannel':{'type':Sequelize[_0xbcea('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xbcea('0x3')]},'duration':{'type':Sequelize[_0xbcea('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xbcea('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbcea('0x3')]},'amaflags':{'type':Sequelize[_0xbcea('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xbcea('0x3')]},'uniqueid':{'type':Sequelize[_0xbcea('0x3')]},'linkedid':{'type':Sequelize[_0xbcea('0x3')]},'sequence':{'type':Sequelize[_0xbcea('0x3')]},'peeraccount':{'type':Sequelize[_0xbcea('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xbcea('0x3')]}}; \ No newline at end of file +var _0x984b=['INTEGER','1970-01-01\x2000:00:01','STRING'];(function(_0x537c03,_0x2b484b){var _0x142faf=function(_0x108718){while(--_0x108718){_0x537c03['push'](_0x537c03['shift']());}};_0x142faf(++_0x2b484b);}(_0x984b,0xee));var _0xb984=function(_0x3b3147,_0x30e0b1){_0x3b3147=_0x3b3147-0x0;var _0x419021=_0x984b[_0x3b3147];return _0x419021;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xb984('0x0')},'clid':{'type':Sequelize[_0xb984('0x1')]},'src':{'type':Sequelize[_0xb984('0x1')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb984('0x1')]},'dstchannel':{'type':Sequelize[_0xb984('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xb984('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb984('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xb984('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb984('0x1')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb984('0x1')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xb984('0x1')]},'peeraccount':{'type':Sequelize[_0xb984('0x1')]},'type':{'type':Sequelize[_0xb984('0x1')]},'tag':{'type':Sequelize[_0xb984('0x1')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 822560e..a200eb7 100644 --- a/server/api/cdr/cdr.controller.js +++ b/server/api/cdr/cdr.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd20=['map','Cdr','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','options','create','body','find','destroy','describe','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','then','end','error','stack','name','send'];(function(_0x425812,_0x919dec){var _0x5e1138=function(_0x405932){while(--_0x405932){_0x425812['push'](_0x425812['shift']());}};_0x5e1138(++_0x919dec);}(_0xfd20,0x66));var _0x0fd2=function(_0x34f930,_0x597cb0){_0x34f930=_0x34f930-0x0;var _0x55b287=_0xfd20[_0x34f930];return _0x55b287;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fd2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0fd2('0x1'));var moment=require(_0x0fd2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0fd2('0x3'));var util=require('util');var path=require(_0x0fd2('0x4'));var sox=require(_0x0fd2('0x5'));var csv=require(_0x0fd2('0x6'));var ejs=require(_0x0fd2('0x7'));var fs=require('fs');var fs_extra=require(_0x0fd2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0fd2('0x9'));var jsforce=require(_0x0fd2('0xa'));var deskjs=require(_0x0fd2('0xb'));var toCsv=require(_0x0fd2('0x6'));var querystring=require(_0x0fd2('0xc'));var Papa=require(_0x0fd2('0xd'));var Redis=require(_0x0fd2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0fd2('0xf'));var as=require(_0x0fd2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fd2('0x11'))('api');var utils=require(_0x0fd2('0x12'));var config=require(_0x0fd2('0x13'));var licenseUtil=require(_0x0fd2('0x14'));var db=require(_0x0fd2('0x15'))['db'];function respondWithStatusCode(_0xdf592d,_0x3504cf){_0x3504cf=_0x3504cf||0xcc;return function(_0x1f7a6e){if(_0x1f7a6e){return _0xdf592d[_0x0fd2('0x16')](_0x3504cf);}return _0xdf592d['status'](_0x3504cf)['end']();};}function respondWithResult(_0x1a9acb,_0x99de24){_0x99de24=_0x99de24||0xc8;return function(_0x21dcc5){if(_0x21dcc5){return _0x1a9acb[_0x0fd2('0x17')](_0x99de24)['json'](_0x21dcc5);}};}function respondWithFilteredResult(_0x280253,_0x4f074a){return function(_0x50b723){if(_0x50b723){var _0x2b6254=typeof _0x4f074a['offset']===_0x0fd2('0x18')&&typeof _0x4f074a['limit']===_0x0fd2('0x18');var _0x4cd2bf=_0x50b723[_0x0fd2('0x19')];var _0x15c9de=_0x2b6254?0x0:_0x4f074a['offset'];var _0x2b25d2=_0x2b6254?_0x50b723['count']:_0x4f074a[_0x0fd2('0x1a')]+_0x4f074a[_0x0fd2('0x1b')];var _0x3fb07e;if(_0x2b25d2>=_0x4cd2bf){_0x2b25d2=_0x4cd2bf;_0x3fb07e=0xc8;}else{_0x3fb07e=0xce;}_0x280253[_0x0fd2('0x17')](_0x3fb07e);return _0x280253[_0x0fd2('0x1c')](_0x0fd2('0x1d'),_0x15c9de+'-'+_0x2b25d2+'/'+_0x4cd2bf)[_0x0fd2('0x1e')](_0x50b723);}return null;};}function patchUpdates(_0x1a72ca){return function(_0x1b848d){try{jsonpatch[_0x0fd2('0x1f')](_0x1b848d,_0x1a72ca,!![]);}catch(_0x5c50ad){return BPromise['reject'](_0x5c50ad);}return _0x1b848d['save']();};}function saveUpdates(_0x4156d2,_0x36072a){return function(_0x53ab17){if(_0x53ab17){return _0x53ab17['update'](_0x4156d2)[_0x0fd2('0x20')](function(_0x25563c){return _0x25563c;});}return null;};}function removeEntity(_0x6be8d8,_0x29398f){return function(_0x25cdd2){if(_0x25cdd2){return _0x25cdd2['destroy']()[_0x0fd2('0x20')](function(){_0x6be8d8[_0x0fd2('0x17')](0xcc)[_0x0fd2('0x21')]();});}};}function handleEntityNotFound(_0x54cce1,_0x4c77a8){return function(_0x11bb10){if(!_0x11bb10){_0x54cce1[_0x0fd2('0x16')](0x194);}return _0x11bb10;};}function handleError(_0x4d0924,_0x400133){_0x400133=_0x400133||0x1f4;return function(_0x429fef){logger[_0x0fd2('0x22')](_0x429fef[_0x0fd2('0x23')]);if(_0x429fef[_0x0fd2('0x24')]){delete _0x429fef[_0x0fd2('0x24')];}_0x4d0924[_0x0fd2('0x17')](_0x400133)[_0x0fd2('0x25')](_0x429fef);};}exports['index']=function(_0x37d519,_0x434018){var _0x235c90={},_0x1ca259={},_0x33cf1a={'count':0x0,'rows':[]};var _0x564419=_[_0x0fd2('0x26')](db[_0x0fd2('0x27')][_0x0fd2('0x28')],function(_0x1a7a98){return{'name':_0x1a7a98[_0x0fd2('0x29')],'type':_0x1a7a98[_0x0fd2('0x2a')][_0x0fd2('0x2b')]};});_0x1ca259[_0x0fd2('0x2c')]=_['map'](_0x564419,_0x0fd2('0x24'));_0x1ca259['query']=_['keys'](_0x37d519[_0x0fd2('0x2d')]);_0x1ca259['filters']=_[_0x0fd2('0x2e')](_0x1ca259['model'],_0x1ca259[_0x0fd2('0x2d')]);_0x235c90['attributes']=_['intersection'](_0x1ca259[_0x0fd2('0x2c')],qs[_0x0fd2('0x2f')](_0x37d519[_0x0fd2('0x2d')]['fields']));_0x235c90['attributes']=_0x235c90[_0x0fd2('0x30')]['length']?_0x235c90[_0x0fd2('0x30')]:_0x1ca259[_0x0fd2('0x2c')];if(!_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x31')](_0x0fd2('0x32'))){_0x235c90[_0x0fd2('0x1b')]=qs[_0x0fd2('0x1b')](_0x37d519['query'][_0x0fd2('0x1b')]);_0x235c90[_0x0fd2('0x1a')]=qs['offset'](_0x37d519['query'][_0x0fd2('0x1a')]);}_0x235c90['order']=qs['sort'](_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x33')]);_0x235c90[_0x0fd2('0x34')]=qs[_0x0fd2('0x35')](_[_0x0fd2('0x36')](_0x37d519[_0x0fd2('0x2d')],_0x1ca259[_0x0fd2('0x35')]),_0x564419);if(_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x37')]){_0x235c90[_0x0fd2('0x34')]=_[_0x0fd2('0x38')](_0x235c90[_0x0fd2('0x34')],{'$or':_[_0x0fd2('0x26')](_0x564419,function(_0x3a3986){if(_0x3a3986[_0x0fd2('0x2a')]!==_0x0fd2('0x39')){var _0x50643e={};_0x50643e[_0x3a3986[_0x0fd2('0x24')]]={'$like':'%'+_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x37')]+'%'};return _0x50643e;}})});}_0x235c90=_[_0x0fd2('0x38')]({},_0x235c90,_0x37d519['options']);var _0x286543={'where':_0x235c90['where']};return db[_0x0fd2('0x27')][_0x0fd2('0x19')](_0x286543)['then'](function(_0x43e585){_0x33cf1a[_0x0fd2('0x19')]=_0x43e585;if(_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x3a')]){_0x235c90[_0x0fd2('0x3b')]=[{'all':!![]}];}return db[_0x0fd2('0x27')]['findAll'](_0x235c90);})[_0x0fd2('0x20')](function(_0x409321){_0x33cf1a[_0x0fd2('0x3c')]=_0x409321;return _0x33cf1a;})[_0x0fd2('0x20')](respondWithFilteredResult(_0x434018,_0x235c90))[_0x0fd2('0x3d')](handleError(_0x434018,null));};exports['show']=function(_0x258569,_0x2e804d){var _0x554476={'raw':!![],'where':{'id':_0x258569[_0x0fd2('0x3e')]['id']}},_0x252fb1={};_0x252fb1[_0x0fd2('0x2c')]=_[_0x0fd2('0x3f')](db[_0x0fd2('0x27')][_0x0fd2('0x28')]);_0x252fb1[_0x0fd2('0x2d')]=_[_0x0fd2('0x3f')](_0x258569['query']);_0x252fb1['filters']=_[_0x0fd2('0x2e')](_0x252fb1[_0x0fd2('0x2c')],_0x252fb1['query']);_0x554476[_0x0fd2('0x30')]=_['intersection'](_0x252fb1[_0x0fd2('0x2c')],qs[_0x0fd2('0x2f')](_0x258569[_0x0fd2('0x2d')][_0x0fd2('0x2f')]));_0x554476[_0x0fd2('0x30')]=_0x554476[_0x0fd2('0x30')]['length']?_0x554476['attributes']:_0x252fb1[_0x0fd2('0x2c')];if(_0x258569['query'][_0x0fd2('0x3a')]){_0x554476[_0x0fd2('0x3b')]=[{'all':!![]}];}_0x554476=_[_0x0fd2('0x38')]({},_0x554476,_0x258569[_0x0fd2('0x40')]);return db[_0x0fd2('0x27')]['find'](_0x554476)[_0x0fd2('0x20')](handleEntityNotFound(_0x2e804d,null))['then'](respondWithResult(_0x2e804d,null))[_0x0fd2('0x3d')](handleError(_0x2e804d,null));};exports[_0x0fd2('0x41')]=function(_0x5352cc,_0x337daa){return db['Cdr']['create'](_0x5352cc[_0x0fd2('0x42')],{})[_0x0fd2('0x20')](respondWithResult(_0x337daa,0xc9))[_0x0fd2('0x3d')](handleError(_0x337daa,null));};exports['update']=function(_0x30ac02,_0x119e21){if(_0x30ac02[_0x0fd2('0x42')]['id']){delete _0x30ac02[_0x0fd2('0x42')]['id'];}return db['Cdr'][_0x0fd2('0x43')]({'where':{'id':_0x30ac02[_0x0fd2('0x3e')]['id']}})[_0x0fd2('0x20')](handleEntityNotFound(_0x119e21,null))[_0x0fd2('0x20')](saveUpdates(_0x30ac02[_0x0fd2('0x42')],null))[_0x0fd2('0x20')](respondWithResult(_0x119e21,null))[_0x0fd2('0x3d')](handleError(_0x119e21,null));};exports[_0x0fd2('0x44')]=function(_0x2377bd,_0x4322b4){return db[_0x0fd2('0x27')]['find']({'where':{'id':_0x2377bd[_0x0fd2('0x3e')]['id']}})[_0x0fd2('0x20')](handleEntityNotFound(_0x4322b4,null))['then'](removeEntity(_0x4322b4,null))[_0x0fd2('0x3d')](handleError(_0x4322b4,null));};exports['describe']=function(_0x19650c,_0x5193b7){return db[_0x0fd2('0x27')][_0x0fd2('0x45')]()[_0x0fd2('0x20')](respondWithResult(_0x5193b7,null))['catch'](handleError(_0x5193b7,null));}; \ No newline at end of file +var _0xf767=['apply','save','then','error','stack','name','map','Cdr','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','merge','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','undefined','count','limit','status','set','json'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xf767,0x76));var _0x7f76=function(_0x5d4f12,_0x11e67c){_0x5d4f12=_0x5d4f12-0x0;var _0x4eb577=_0xf767[_0x5d4f12];return _0x4eb577;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f76('0x0'));var zipdir=require(_0x7f76('0x1'));var jsonpatch=require(_0x7f76('0x2'));var rp=require(_0x7f76('0x3'));var moment=require(_0x7f76('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7f76('0x5'));var util=require(_0x7f76('0x6'));var path=require(_0x7f76('0x7'));var sox=require(_0x7f76('0x8'));var csv=require('to-csv');var ejs=require(_0x7f76('0x9'));var fs=require('fs');var fs_extra=require(_0x7f76('0xa'));var _=require(_0x7f76('0xb'));var squel=require(_0x7f76('0xc'));var crypto=require(_0x7f76('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f76('0xe'));var toCsv=require(_0x7f76('0xf'));var querystring=require(_0x7f76('0x10'));var Papa=require(_0x7f76('0x11'));var Redis=require('ioredis');var authService=require(_0x7f76('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7f76('0x13'));var hardwareService=require(_0x7f76('0x14'));var logger=require(_0x7f76('0x15'))(_0x7f76('0x16'));var utils=require(_0x7f76('0x17'));var config=require(_0x7f76('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f76('0x19'))['db'];function respondWithStatusCode(_0x2cd1b3,_0x47403b){_0x47403b=_0x47403b||0xcc;return function(_0x32392b){if(_0x32392b){return _0x2cd1b3[_0x7f76('0x1a')](_0x47403b);}return _0x2cd1b3['status'](_0x47403b)[_0x7f76('0x1b')]();};}function respondWithResult(_0x4d8de0,_0x42a9d3){_0x42a9d3=_0x42a9d3||0xc8;return function(_0x256f79){if(_0x256f79){return _0x4d8de0['status'](_0x42a9d3)['json'](_0x256f79);}};}function respondWithFilteredResult(_0x58d2f3,_0xe81aa9){return function(_0x2df2db){if(_0x2df2db){var _0x286e96=typeof _0xe81aa9['offset']===_0x7f76('0x1c')&&typeof _0xe81aa9['limit']===_0x7f76('0x1c');var _0x3ceb6a=_0x2df2db[_0x7f76('0x1d')];var _0x4802ff=_0x286e96?0x0:_0xe81aa9['offset'];var _0x494537=_0x286e96?_0x2df2db['count']:_0xe81aa9['offset']+_0xe81aa9[_0x7f76('0x1e')];var _0xdb1407;if(_0x494537>=_0x3ceb6a){_0x494537=_0x3ceb6a;_0xdb1407=0xc8;}else{_0xdb1407=0xce;}_0x58d2f3[_0x7f76('0x1f')](_0xdb1407);return _0x58d2f3[_0x7f76('0x20')]('Content-Range',_0x4802ff+'-'+_0x494537+'/'+_0x3ceb6a)[_0x7f76('0x21')](_0x2df2db);}return null;};}function patchUpdates(_0x557c0f){return function(_0x38c4d6){try{jsonpatch[_0x7f76('0x22')](_0x38c4d6,_0x557c0f,!![]);}catch(_0x5a28b0){return BPromise['reject'](_0x5a28b0);}return _0x38c4d6[_0x7f76('0x23')]();};}function saveUpdates(_0xb647d8,_0x5efed5){return function(_0x3f2536){if(_0x3f2536){return _0x3f2536['update'](_0xb647d8)[_0x7f76('0x24')](function(_0x333056){return _0x333056;});}return null;};}function removeEntity(_0x31993d,_0x3deb00){return function(_0x3eea75){if(_0x3eea75){return _0x3eea75['destroy']()[_0x7f76('0x24')](function(){_0x31993d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x197519,_0x45f1c9){return function(_0x3492f4){if(!_0x3492f4){_0x197519['sendStatus'](0x194);}return _0x3492f4;};}function handleError(_0xbe6ac1,_0x1347bf){_0x1347bf=_0x1347bf||0x1f4;return function(_0x3e624d){logger[_0x7f76('0x25')](_0x3e624d[_0x7f76('0x26')]);if(_0x3e624d['name']){delete _0x3e624d[_0x7f76('0x27')];}_0xbe6ac1[_0x7f76('0x1f')](_0x1347bf)['send'](_0x3e624d);};}exports['index']=function(_0xe459de,_0x58829a){var _0x1dd664={},_0x3542e3={},_0xd5ba7={'count':0x0,'rows':[]};var _0x393bdd=_[_0x7f76('0x28')](db[_0x7f76('0x29')]['rawAttributes'],function(_0x3570ec){return{'name':_0x3570ec[_0x7f76('0x2a')],'type':_0x3570ec[_0x7f76('0x2b')][_0x7f76('0x2c')]};});_0x3542e3['model']=_[_0x7f76('0x28')](_0x393bdd,_0x7f76('0x27'));_0x3542e3[_0x7f76('0x2d')]=_['keys'](_0xe459de[_0x7f76('0x2d')]);_0x3542e3[_0x7f76('0x2e')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],_0x3542e3[_0x7f76('0x2d')]);_0x1dd664[_0x7f76('0x31')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0xe459de[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x1dd664[_0x7f76('0x31')]=_0x1dd664[_0x7f76('0x31')]['length']?_0x1dd664[_0x7f76('0x31')]:_0x3542e3[_0x7f76('0x30')];if(!_0xe459de[_0x7f76('0x2d')][_0x7f76('0x33')](_0x7f76('0x34'))){_0x1dd664[_0x7f76('0x1e')]=qs[_0x7f76('0x1e')](_0xe459de[_0x7f76('0x2d')]['limit']);_0x1dd664[_0x7f76('0x35')]=qs['offset'](_0xe459de['query'][_0x7f76('0x35')]);}_0x1dd664['order']=qs[_0x7f76('0x36')](_0xe459de[_0x7f76('0x2d')]['sort']);_0x1dd664[_0x7f76('0x37')]=qs['filters'](_['pick'](_0xe459de[_0x7f76('0x2d')],_0x3542e3[_0x7f76('0x2e')]),_0x393bdd);if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]){_0x1dd664[_0x7f76('0x37')]=_['merge'](_0x1dd664[_0x7f76('0x37')],{'$or':_[_0x7f76('0x28')](_0x393bdd,function(_0x4edf74){if(_0x4edf74['type']!==_0x7f76('0x39')){var _0x4ea167={};_0x4ea167[_0x4edf74[_0x7f76('0x27')]]={'$like':'%'+_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]+'%'};return _0x4ea167;}})});}_0x1dd664=_['merge']({},_0x1dd664,_0xe459de[_0x7f76('0x3a')]);var _0x26b537={'where':_0x1dd664[_0x7f76('0x37')]};return db[_0x7f76('0x29')][_0x7f76('0x1d')](_0x26b537)[_0x7f76('0x24')](function(_0x58649f){_0xd5ba7['count']=_0x58649f;if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x1dd664[_0x7f76('0x3c')]=[{'all':!![]}];}return db[_0x7f76('0x29')][_0x7f76('0x3d')](_0x1dd664);})[_0x7f76('0x24')](function(_0x401284){_0xd5ba7[_0x7f76('0x3e')]=_0x401284;return _0xd5ba7;})[_0x7f76('0x24')](respondWithFilteredResult(_0x58829a,_0x1dd664))[_0x7f76('0x3f')](handleError(_0x58829a,null));};exports[_0x7f76('0x40')]=function(_0x313d37,_0x3229b9){var _0x391d04={'raw':!![],'where':{'id':_0x313d37[_0x7f76('0x41')]['id']}},_0x2a43f1={};_0x2a43f1[_0x7f76('0x30')]=_[_0x7f76('0x42')](db['Cdr'][_0x7f76('0x43')]);_0x2a43f1[_0x7f76('0x2d')]=_[_0x7f76('0x42')](_0x313d37['query']);_0x2a43f1['filters']=_[_0x7f76('0x2f')](_0x2a43f1['model'],_0x2a43f1[_0x7f76('0x2d')]);_0x391d04['attributes']=_['intersection'](_0x2a43f1[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0x313d37[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x391d04[_0x7f76('0x31')]=_0x391d04[_0x7f76('0x31')][_0x7f76('0x44')]?_0x391d04[_0x7f76('0x31')]:_0x2a43f1[_0x7f76('0x30')];if(_0x313d37[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x391d04[_0x7f76('0x3c')]=[{'all':!![]}];}_0x391d04=_[_0x7f76('0x45')]({},_0x391d04,_0x313d37[_0x7f76('0x3a')]);return db['Cdr'][_0x7f76('0x46')](_0x391d04)['then'](handleEntityNotFound(_0x3229b9,null))[_0x7f76('0x24')](respondWithResult(_0x3229b9,null))[_0x7f76('0x3f')](handleError(_0x3229b9,null));};exports[_0x7f76('0x47')]=function(_0x39bbef,_0x487b1f){return db[_0x7f76('0x29')][_0x7f76('0x47')](_0x39bbef[_0x7f76('0x48')],{})[_0x7f76('0x24')](respondWithResult(_0x487b1f,0xc9))['catch'](handleError(_0x487b1f,null));};exports[_0x7f76('0x49')]=function(_0xd87fe7,_0x53f77a){if(_0xd87fe7[_0x7f76('0x48')]['id']){delete _0xd87fe7[_0x7f76('0x48')]['id'];}return db[_0x7f76('0x29')]['find']({'where':{'id':_0xd87fe7[_0x7f76('0x41')]['id']}})[_0x7f76('0x24')](handleEntityNotFound(_0x53f77a,null))[_0x7f76('0x24')](saveUpdates(_0xd87fe7[_0x7f76('0x48')],null))[_0x7f76('0x24')](respondWithResult(_0x53f77a,null))[_0x7f76('0x3f')](handleError(_0x53f77a,null));};exports[_0x7f76('0x4a')]=function(_0x42abd9,_0x1a4d3c){return db[_0x7f76('0x29')][_0x7f76('0x46')]({'where':{'id':_0x42abd9[_0x7f76('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a4d3c,null))[_0x7f76('0x24')](removeEntity(_0x1a4d3c,null))['catch'](handleError(_0x1a4d3c,null));};exports[_0x7f76('0x4b')]=function(_0x3bcd59,_0x171c71){return db['Cdr'][_0x7f76('0x4b')]()[_0x7f76('0x24')](respondWithResult(_0x171c71,null))['catch'](handleError(_0x171c71,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index c4c2fda..a6e3adc 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x153b39,_0x1b6dca){var _0x4fa074=function(_0x3ef8ca){while(--_0x3ef8ca){_0x153b39['push'](_0x153b39['shift']());}};_0x4fa074(++_0x1b6dca);}(_0x7a54,0x106));var _0x47a5=function(_0x2cb4fb,_0xedcc51){_0x2cb4fb=_0x2cb4fb-0x0;var _0x28e3c9=_0x7a54[_0x2cb4fb];return _0x28e3c9;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0xa39739,_0x4c1f40){var _0x536c81=function(_0x5a70e4){while(--_0x5a70e4){_0xa39739['push'](_0xa39739['shift']());}};_0x536c81(++_0x4c1f40);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 5cb6bc9..aec5702 100644 --- a/server/api/cdr/cdr.rpc.js +++ b/server/api/cdr/cdr.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb22=['error','code','Cdr,\x20%s,\x20%s','message','catch','lodash','util','moment','../../mysqldb','../../config/logger','jayson/promise','client','http','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x42bc57,_0x1fb466){var _0x14bce7=function(_0x1a5039){while(--_0x1a5039){_0x42bc57['push'](_0x42bc57['shift']());}};_0x14bce7(++_0x1fb466);}(_0xcb22,0xb9));var _0x2cb2=function(_0x30f802,_0x4a6499){_0x30f802=_0x30f802-0x0;var _0x20f213=_0xcb22[_0x30f802];return _0x20f213;};'use strict';var _=require(_0x2cb2('0x0'));var util=require(_0x2cb2('0x1'));var moment=require(_0x2cb2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2cb2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cb2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2cb2('0x5'));var client=jayson[_0x2cb2('0x6')][_0x2cb2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x44ad98,_0x323660,_0x43bb69){return new BPromise(function(_0x6df832,_0x967daa){return client['request'](_0x44ad98,_0x43bb69)[_0x2cb2('0x8')](function(_0x5a4e68){logger[_0x2cb2('0x9')]('Cdr,\x20%s,\x20%s',_0x323660,_0x2cb2('0xa'));logger['debug'](_0x2cb2('0xb'),_0x323660,_0x2cb2('0xa'),JSON[_0x2cb2('0xc')](_0x5a4e68));if(_0x5a4e68[_0x2cb2('0xd')]){if(_0x5a4e68['error'][_0x2cb2('0xe')]===0x1f4){logger[_0x2cb2('0xd')](_0x2cb2('0xf'),_0x323660,_0x5a4e68[_0x2cb2('0xd')]['message']);return _0x967daa(_0x5a4e68['error'][_0x2cb2('0x10')]);}logger['error'](_0x2cb2('0xf'),_0x323660,_0x5a4e68[_0x2cb2('0xd')][_0x2cb2('0x10')]);return _0x6df832(_0x5a4e68[_0x2cb2('0xd')][_0x2cb2('0x10')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x323660,_0x2cb2('0xa'));_0x6df832(_0x5a4e68['result'][_0x2cb2('0x10')]);}})[_0x2cb2('0x11')](function(_0x5cf4a8){logger['error']('Cdr,\x20%s,\x20%s',_0x323660,_0x5cf4a8);_0x967daa(_0x5cf4a8);});});} \ No newline at end of file +var _0xdb21=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0x206592,_0x581d8b){var _0x419419=function(_0x159084){while(--_0x159084){_0x206592['push'](_0x206592['shift']());}};_0x419419(++_0x581d8b);}(_0xdb21,0x1e5));var _0x1db2=function(_0x4d18c2,_0x9b85d0){_0x4d18c2=_0x4d18c2-0x0;var _0x1cadf9=_0xdb21[_0x4d18c2];return _0x1cadf9;};'use strict';var _=require(_0x1db2('0x0'));var util=require(_0x1db2('0x1'));var moment=require(_0x1db2('0x2'));var BPromise=require(_0x1db2('0x3'));var rs=require(_0x1db2('0x4'));var fs=require('fs');var Redis=require(_0x1db2('0x5'));var db=require(_0x1db2('0x6'))['db'];var utils=require(_0x1db2('0x7'));var logger=require(_0x1db2('0x8'))(_0x1db2('0x9'));var config=require(_0x1db2('0xa'));var jayson=require(_0x1db2('0xb'));var client=jayson['client'][_0x1db2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c5da7,_0x4ccb28,_0x49d790){return new BPromise(function(_0x2d568c,_0x25a4a0){return client[_0x1db2('0xd')](_0x5c5da7,_0x49d790)['then'](function(_0xdeb4eb){logger[_0x1db2('0xe')](_0x1db2('0xf'),_0x4ccb28,_0x1db2('0x10'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x4ccb28,_0x1db2('0x10'),JSON[_0x1db2('0x11')](_0xdeb4eb));if(_0xdeb4eb['error']){if(_0xdeb4eb['error'][_0x1db2('0x12')]===0x1f4){logger[_0x1db2('0x13')](_0x1db2('0xf'),_0x4ccb28,_0xdeb4eb[_0x1db2('0x13')][_0x1db2('0x14')]);return _0x25a4a0(_0xdeb4eb[_0x1db2('0x13')][_0x1db2('0x14')]);}logger['error'](_0x1db2('0xf'),_0x4ccb28,_0xdeb4eb[_0x1db2('0x13')]['message']);return _0x2d568c(_0xdeb4eb[_0x1db2('0x13')]['message']);}else{logger[_0x1db2('0xe')](_0x1db2('0xf'),_0x4ccb28,_0x1db2('0x10'));_0x2d568c(_0xdeb4eb[_0x1db2('0x15')][_0x1db2('0x14')]);}})['catch'](function(_0x37b523){logger[_0x1db2('0x13')](_0x1db2('0xf'),_0x4ccb28,_0x37b523);_0x25a4a0(_0x37b523);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index e395ba8..c38a688 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x27a9cc,_0x1b1b55){var _0x412f06=function(_0x6edd42){while(--_0x6edd42){_0x27a9cc['push'](_0x27a9cc['shift']());}};_0x412f06(++_0x1b1b55);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 7470c72..7f8a761 100644 --- a/server/api/chatApplication/chatApplication.attributes.js +++ b/server/api/chatApplication/chatApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5366=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x3ec74e,_0x2f6536){var _0x5a53f9=function(_0x461459){while(--_0x461459){_0x3ec74e['push'](_0x3ec74e['shift']());}};_0x5a53f9(++_0x2f6536);}(_0x5366,0x101));var _0x6536=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x5366[_0x5e36d1];return _0x950b9e;};'use strict';var Sequelize=require(_0x6536('0x0'));module[_0x6536('0x1')]={'priority':{'type':Sequelize[_0x6536('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6536('0x3')],'allowNull':![],'defaultValue':_0x6536('0x4')},'appdata':{'type':Sequelize[_0x6536('0x5')]()},'description':{'type':Sequelize[_0x6536('0x3')]},'interval':{'type':Sequelize[_0x6536('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x9492=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0x9492,0x153));var _0x2949=function(_0x83eb3b,_0x3c7335){_0x83eb3b=_0x83eb3b-0x0;var _0x45b45a=_0x9492[_0x83eb3b];return _0x45b45a;};'use strict';var Sequelize=require(_0x2949('0x0'));module[_0x2949('0x1')]={'priority':{'type':Sequelize[_0x2949('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2949('0x3')],'allowNull':![],'defaultValue':_0x2949('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2949('0x3')],'defaultValue':_0x2949('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index afb72c7..76d7125 100644 --- a/server/api/chatApplication/chatApplication.controller.js +++ b/server/api/chatApplication/chatApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87ae=['undefined','count','set','Content-Range','json','apply','reject','update','then','status','error','name','send','params','ChatApplication','keys','query','filters','intersection','model','attributes','fields','length','includeAll','include','find','catch','body','destroy','zip-dir','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit'];(function(_0x63f02b,_0x1288d5){var _0x4eb570=function(_0x13ee75){while(--_0x13ee75){_0x63f02b['push'](_0x63f02b['shift']());}};_0x4eb570(++_0x1288d5);}(_0x87ae,0xf5));var _0xe87a=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x87ae[_0x3a7634];return _0x23bbe9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe87a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe87a('0x1'));var BPromise=require(_0xe87a('0x2'));var Mustache=require(_0xe87a('0x3'));var util=require('util');var path=require(_0xe87a('0x4'));var sox=require(_0xe87a('0x5'));var csv=require(_0xe87a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe87a('0x7'));var squel=require(_0xe87a('0x8'));var crypto=require('crypto');var jsforce=require(_0xe87a('0x9'));var deskjs=require(_0xe87a('0xa'));var toCsv=require('to-csv');var querystring=require(_0xe87a('0xb'));var Papa=require(_0xe87a('0xc'));var Redis=require('ioredis');var authService=require(_0xe87a('0xd'));var qs=require(_0xe87a('0xe'));var as=require(_0xe87a('0xf'));var hardwareService=require(_0xe87a('0x10'));var logger=require(_0xe87a('0x11'))(_0xe87a('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe87a('0x13'));var db=require(_0xe87a('0x14'))['db'];function respondWithStatusCode(_0x3e990c,_0x4db185){_0x4db185=_0x4db185||0xcc;return function(_0x1a725a){if(_0x1a725a){return _0x3e990c[_0xe87a('0x15')](_0x4db185);}return _0x3e990c['status'](_0x4db185)[_0xe87a('0x16')]();};}function respondWithResult(_0x353c52,_0x136340){_0x136340=_0x136340||0xc8;return function(_0x5032c5){if(_0x5032c5){return _0x353c52['status'](_0x136340)['json'](_0x5032c5);}};}function respondWithFilteredResult(_0x53a4f7,_0x44474f){return function(_0x1fa2cd){if(_0x1fa2cd){var _0xd2ca53=typeof _0x44474f[_0xe87a('0x17')]==='undefined'&&typeof _0x44474f[_0xe87a('0x18')]===_0xe87a('0x19');var _0x527c58=_0x1fa2cd['count'];var _0x4160e2=_0xd2ca53?0x0:_0x44474f['offset'];var _0x182e6f=_0xd2ca53?_0x1fa2cd[_0xe87a('0x1a')]:_0x44474f[_0xe87a('0x17')]+_0x44474f['limit'];var _0x444eeb;if(_0x182e6f>=_0x527c58){_0x182e6f=_0x527c58;_0x444eeb=0xc8;}else{_0x444eeb=0xce;}_0x53a4f7['status'](_0x444eeb);return _0x53a4f7[_0xe87a('0x1b')](_0xe87a('0x1c'),_0x4160e2+'-'+_0x182e6f+'/'+_0x527c58)[_0xe87a('0x1d')](_0x1fa2cd);}return null;};}function patchUpdates(_0x4059e1){return function(_0x104f67){try{jsonpatch[_0xe87a('0x1e')](_0x104f67,_0x4059e1,!![]);}catch(_0x1e37aa){return BPromise[_0xe87a('0x1f')](_0x1e37aa);}return _0x104f67['save']();};}function saveUpdates(_0x59c17c,_0x42ba03){return function(_0x363c6a){if(_0x363c6a){return _0x363c6a[_0xe87a('0x20')](_0x59c17c)[_0xe87a('0x21')](function(_0x15ced2){return _0x15ced2;});}return null;};}function removeEntity(_0x46731f,_0x56eba0){return function(_0x59d9f7){if(_0x59d9f7){return _0x59d9f7['destroy']()['then'](function(){_0x46731f[_0xe87a('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1108d0,_0x59dc1a){return function(_0x19f21e){if(!_0x19f21e){_0x1108d0[_0xe87a('0x15')](0x194);}return _0x19f21e;};}function handleError(_0x13e0a8,_0x16ee69){_0x16ee69=_0x16ee69||0x1f4;return function(_0x294d8b){logger[_0xe87a('0x23')](_0x294d8b['stack']);if(_0x294d8b[_0xe87a('0x24')]){delete _0x294d8b['name'];}_0x13e0a8['status'](_0x16ee69)[_0xe87a('0x25')](_0x294d8b);};}exports['show']=function(_0x537b52,_0x58a2b8){var _0x17c895={'raw':!![],'where':{'id':_0x537b52[_0xe87a('0x26')]['id']}},_0x6feaf6={};_0x6feaf6['model']=_['keys'](db[_0xe87a('0x27')]['rawAttributes']);_0x6feaf6['query']=_[_0xe87a('0x28')](_0x537b52[_0xe87a('0x29')]);_0x6feaf6[_0xe87a('0x2a')]=_[_0xe87a('0x2b')](_0x6feaf6[_0xe87a('0x2c')],_0x6feaf6['query']);_0x17c895[_0xe87a('0x2d')]=_['intersection'](_0x6feaf6[_0xe87a('0x2c')],qs['fields'](_0x537b52[_0xe87a('0x29')][_0xe87a('0x2e')]));_0x17c895[_0xe87a('0x2d')]=_0x17c895[_0xe87a('0x2d')][_0xe87a('0x2f')]?_0x17c895[_0xe87a('0x2d')]:_0x6feaf6[_0xe87a('0x2c')];if(_0x537b52[_0xe87a('0x29')][_0xe87a('0x30')]){_0x17c895[_0xe87a('0x31')]=[{'all':!![]}];}_0x17c895=_['merge']({},_0x17c895,_0x537b52['options']);return db['ChatApplication'][_0xe87a('0x32')](_0x17c895)['then'](handleEntityNotFound(_0x58a2b8,null))[_0xe87a('0x21')](respondWithResult(_0x58a2b8,null))[_0xe87a('0x33')](handleError(_0x58a2b8,null));};exports['update']=function(_0x15cb90,_0x5687bf){if(_0x15cb90['body']['id']){delete _0x15cb90[_0xe87a('0x34')]['id'];}return db[_0xe87a('0x27')][_0xe87a('0x32')]({'where':{'id':_0x15cb90[_0xe87a('0x26')]['id']}})['then'](handleEntityNotFound(_0x5687bf,null))[_0xe87a('0x21')](saveUpdates(_0x15cb90[_0xe87a('0x34')],null))['then'](respondWithResult(_0x5687bf,null))[_0xe87a('0x33')](handleError(_0x5687bf,null));};exports[_0xe87a('0x35')]=function(_0x596b28,_0x3a7575){return db[_0xe87a('0x27')][_0xe87a('0x32')]({'where':{'id':_0x596b28[_0xe87a('0x26')]['id']}})[_0xe87a('0x21')](handleEntityNotFound(_0x3a7575,null))['then'](removeEntity(_0x3a7575,null))[_0xe87a('0x33')](handleError(_0x3a7575,null));}; \ No newline at end of file +var _0x1d5b=['keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','options','find','catch','update','body','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','show','params','model'];(function(_0x2f4e7a,_0x4c3f4e){var _0x3299a0=function(_0x422bd1){while(--_0x422bd1){_0x2f4e7a['push'](_0x2f4e7a['shift']());}};_0x3299a0(++_0x4c3f4e);}(_0x1d5b,0x13c));var _0xb1d5=function(_0x3f05fe,_0x3341d8){_0x3f05fe=_0x3f05fe-0x0;var _0x1c06be=_0x1d5b[_0x3f05fe];return _0x1c06be;};'use strict';var emlformat=require(_0xb1d5('0x0'));var rimraf=require(_0xb1d5('0x1'));var zipdir=require(_0xb1d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb1d5('0x3'));var moment=require('moment');var BPromise=require(_0xb1d5('0x4'));var Mustache=require(_0xb1d5('0x5'));var util=require(_0xb1d5('0x6'));var path=require(_0xb1d5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb1d5('0x8'));var fs=require('fs');var fs_extra=require(_0xb1d5('0x9'));var _=require(_0xb1d5('0xa'));var squel=require(_0xb1d5('0xb'));var crypto=require(_0xb1d5('0xc'));var jsforce=require(_0xb1d5('0xd'));var deskjs=require(_0xb1d5('0xe'));var toCsv=require(_0xb1d5('0xf'));var querystring=require('querystring');var Papa=require(_0xb1d5('0x10'));var Redis=require(_0xb1d5('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb1d5('0x12'));var hardwareService=require(_0xb1d5('0x13'));var logger=require(_0xb1d5('0x14'))('api');var utils=require(_0xb1d5('0x15'));var config=require(_0xb1d5('0x16'));var licenseUtil=require(_0xb1d5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x90e8f9,_0x9d4e4){_0x9d4e4=_0x9d4e4||0xcc;return function(_0x2fd99c){if(_0x2fd99c){return _0x90e8f9[_0xb1d5('0x18')](_0x9d4e4);}return _0x90e8f9['status'](_0x9d4e4)[_0xb1d5('0x19')]();};}function respondWithResult(_0x31a2b6,_0x2c16e2){_0x2c16e2=_0x2c16e2||0xc8;return function(_0x53e1b3){if(_0x53e1b3){return _0x31a2b6[_0xb1d5('0x1a')](_0x2c16e2)[_0xb1d5('0x1b')](_0x53e1b3);}};}function respondWithFilteredResult(_0x18f0b8,_0x3fc6a0){return function(_0x5f6066){if(_0x5f6066){var _0x16a6d0=typeof _0x3fc6a0['offset']===_0xb1d5('0x1c')&&typeof _0x3fc6a0['limit']===_0xb1d5('0x1c');var _0x43aae9=_0x5f6066['count'];var _0x1870c2=_0x16a6d0?0x0:_0x3fc6a0[_0xb1d5('0x1d')];var _0xe3d99=_0x16a6d0?_0x5f6066['count']:_0x3fc6a0[_0xb1d5('0x1d')]+_0x3fc6a0[_0xb1d5('0x1e')];var _0x5a9c6f;if(_0xe3d99>=_0x43aae9){_0xe3d99=_0x43aae9;_0x5a9c6f=0xc8;}else{_0x5a9c6f=0xce;}_0x18f0b8[_0xb1d5('0x1a')](_0x5a9c6f);return _0x18f0b8[_0xb1d5('0x1f')](_0xb1d5('0x20'),_0x1870c2+'-'+_0xe3d99+'/'+_0x43aae9)[_0xb1d5('0x1b')](_0x5f6066);}return null;};}function patchUpdates(_0x2fa863){return function(_0x4dde74){try{jsonpatch[_0xb1d5('0x21')](_0x4dde74,_0x2fa863,!![]);}catch(_0x46fd1e){return BPromise[_0xb1d5('0x22')](_0x46fd1e);}return _0x4dde74[_0xb1d5('0x23')]();};}function saveUpdates(_0x34df7d,_0x50e15f){return function(_0xd979d){if(_0xd979d){return _0xd979d['update'](_0x34df7d)[_0xb1d5('0x24')](function(_0x4ca9b0){return _0x4ca9b0;});}return null;};}function removeEntity(_0x18e259,_0x3dde08){return function(_0x4178f0){if(_0x4178f0){return _0x4178f0['destroy']()['then'](function(){_0x18e259[_0xb1d5('0x1a')](0xcc)[_0xb1d5('0x19')]();});}};}function handleEntityNotFound(_0x30c4d0,_0xef6d33){return function(_0x58a814){if(!_0x58a814){_0x30c4d0[_0xb1d5('0x18')](0x194);}return _0x58a814;};}function handleError(_0x232b67,_0x238798){_0x238798=_0x238798||0x1f4;return function(_0x3e6a66){logger[_0xb1d5('0x25')](_0x3e6a66[_0xb1d5('0x26')]);if(_0x3e6a66[_0xb1d5('0x27')]){delete _0x3e6a66[_0xb1d5('0x27')];}_0x232b67['status'](_0x238798)[_0xb1d5('0x28')](_0x3e6a66);};}exports[_0xb1d5('0x29')]=function(_0x1f7b72,_0x3ab5d6){var _0x4e36bf={'raw':!![],'where':{'id':_0x1f7b72[_0xb1d5('0x2a')]['id']}},_0x38d16b={};_0x38d16b[_0xb1d5('0x2b')]=_[_0xb1d5('0x2c')](db[_0xb1d5('0x2d')][_0xb1d5('0x2e')]);_0x38d16b['query']=_[_0xb1d5('0x2c')](_0x1f7b72[_0xb1d5('0x2f')]);_0x38d16b[_0xb1d5('0x30')]=_[_0xb1d5('0x31')](_0x38d16b[_0xb1d5('0x2b')],_0x38d16b['query']);_0x4e36bf['attributes']=_[_0xb1d5('0x31')](_0x38d16b[_0xb1d5('0x2b')],qs[_0xb1d5('0x32')](_0x1f7b72[_0xb1d5('0x2f')][_0xb1d5('0x32')]));_0x4e36bf[_0xb1d5('0x33')]=_0x4e36bf[_0xb1d5('0x33')][_0xb1d5('0x34')]?_0x4e36bf['attributes']:_0x38d16b[_0xb1d5('0x2b')];if(_0x1f7b72[_0xb1d5('0x2f')][_0xb1d5('0x35')]){_0x4e36bf['include']=[{'all':!![]}];}_0x4e36bf=_['merge']({},_0x4e36bf,_0x1f7b72[_0xb1d5('0x36')]);return db[_0xb1d5('0x2d')][_0xb1d5('0x37')](_0x4e36bf)[_0xb1d5('0x24')](handleEntityNotFound(_0x3ab5d6,null))[_0xb1d5('0x24')](respondWithResult(_0x3ab5d6,null))[_0xb1d5('0x38')](handleError(_0x3ab5d6,null));};exports[_0xb1d5('0x39')]=function(_0x2dd299,_0x43dfeb){if(_0x2dd299[_0xb1d5('0x3a')]['id']){delete _0x2dd299[_0xb1d5('0x3a')]['id'];}return db[_0xb1d5('0x2d')]['find']({'where':{'id':_0x2dd299['params']['id']}})[_0xb1d5('0x24')](handleEntityNotFound(_0x43dfeb,null))[_0xb1d5('0x24')](saveUpdates(_0x2dd299[_0xb1d5('0x3a')],null))[_0xb1d5('0x24')](respondWithResult(_0x43dfeb,null))[_0xb1d5('0x38')](handleError(_0x43dfeb,null));};exports[_0xb1d5('0x3b')]=function(_0x208449,_0x534bae){return db[_0xb1d5('0x2d')][_0xb1d5('0x37')]({'where':{'id':_0x208449['params']['id']}})[_0xb1d5('0x24')](handleEntityNotFound(_0x534bae,null))[_0xb1d5('0x24')](removeEntity(_0x534bae,null))[_0xb1d5('0x38')](handleError(_0x534bae,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 7cbb4ed..1c017cc 100644 --- a/server/api/chatApplication/chatApplication.model.js +++ b/server/api/chatApplication/chatApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14de=['moment','request-promise','path','rimraf','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x1aed80,_0x3ca6f6){var _0x43961e=function(_0x43bf2b){while(--_0x43bf2b){_0x1aed80['push'](_0x1aed80['shift']());}};_0x43961e(++_0x3ca6f6);}(_0x14de,0x1ea));var _0xe14d=function(_0x554c4c,_0x1ceb88){_0x554c4c=_0x554c4c-0x0;var _0x25fe6c=_0x14de[_0x554c4c];return _0x25fe6c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe14d('0x0'))(_0xe14d('0x1'));var moment=require(_0xe14d('0x2'));var BPromise=require('bluebird');var rp=require(_0xe14d('0x3'));var fs=require('fs');var path=require(_0xe14d('0x4'));var rimraf=require(_0xe14d('0x5'));var config=require('../../config/environment');var attributes=require(_0xe14d('0x6'));module[_0xe14d('0x7')]=function(_0x1e04de,_0x561c4a){return _0x1e04de[_0xe14d('0x8')](_0xe14d('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe14d('0xa'),'collate':_0xe14d('0xb')});}; \ No newline at end of file +var _0x130d=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','lodash'];(function(_0x517b59,_0x2a4790){var _0x3cfb43=function(_0x53f82c){while(--_0x53f82c){_0x517b59['push'](_0x517b59['shift']());}};_0x3cfb43(++_0x2a4790);}(_0x130d,0x125));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd130('0x0'));var util=require('util');var logger=require(_0xd130('0x1'))('api');var moment=require(_0xd130('0x2'));var BPromise=require(_0xd130('0x3'));var rp=require(_0xd130('0x4'));var fs=require('fs');var path=require(_0xd130('0x5'));var rimraf=require(_0xd130('0x6'));var config=require(_0xd130('0x7'));var attributes=require(_0xd130('0x8'));module[_0xd130('0x9')]=function(_0x287e61,_0x4689a8){return _0x287e61[_0xd130('0xa')](_0xd130('0xb'),attributes,{'tableName':_0xd130('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd130('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 2e86cb5..c4b6ef8 100644 --- a/server/api/chatApplication/chatApplication.rpc.js +++ b/server/api/chatApplication/chatApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd85=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','bluebird'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdd85,0x19d));var _0x5dd8=function(_0x16fc02,_0x454d54){_0x16fc02=_0x16fc02-0x0;var _0x11f48d=_0xdd85[_0x16fc02];return _0x11f48d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5dd8('0x0'));var rs=require(_0x5dd8('0x1'));var fs=require('fs');var Redis=require(_0x5dd8('0x2'));var db=require(_0x5dd8('0x3'))['db'];var utils=require(_0x5dd8('0x4'));var logger=require(_0x5dd8('0x5'))(_0x5dd8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5dd8('0x7')][_0x5dd8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5892fd,_0x23b24c,_0x130754){return new BPromise(function(_0x5a6874,_0x33bd4a){return client['request'](_0x5892fd,_0x130754)[_0x5dd8('0x9')](function(_0x1967ca){logger[_0x5dd8('0xa')](_0x5dd8('0xb'),_0x23b24c,'request\x20sent');logger[_0x5dd8('0xc')](_0x5dd8('0xd'),_0x23b24c,_0x5dd8('0xe'),JSON[_0x5dd8('0xf')](_0x1967ca));if(_0x1967ca[_0x5dd8('0x10')]){if(_0x1967ca[_0x5dd8('0x10')]['code']===0x1f4){logger[_0x5dd8('0x10')](_0x5dd8('0xb'),_0x23b24c,_0x1967ca[_0x5dd8('0x10')][_0x5dd8('0x11')]);return _0x33bd4a(_0x1967ca[_0x5dd8('0x10')]['message']);}logger[_0x5dd8('0x10')](_0x5dd8('0xb'),_0x23b24c,_0x1967ca['error'][_0x5dd8('0x11')]);return _0x5a6874(_0x1967ca[_0x5dd8('0x10')][_0x5dd8('0x11')]);}else{logger[_0x5dd8('0xa')]('ChatApplication,\x20%s,\x20%s',_0x23b24c,_0x5dd8('0xe'));_0x5a6874(_0x1967ca['result']['message']);}})['catch'](function(_0x54466d){logger[_0x5dd8('0x10')](_0x5dd8('0xb'),_0x23b24c,_0x54466d);_0x33bd4a(_0x54466d);});});} \ No newline at end of file +var _0x4694=['../../config/logger','rpc','jayson/promise','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1eaa4c,_0x367d3f){var _0x2b4e60=function(_0x13fb6b){while(--_0x13fb6b){_0x1eaa4c['push'](_0x1eaa4c['shift']());}};_0x2b4e60(++_0x367d3f);}(_0x4694,0x80));var _0x4469=function(_0x9c8b4a,_0x2387ff){_0x9c8b4a=_0x9c8b4a-0x0;var _0x198bef=_0x4694[_0x9c8b4a];return _0x198bef;};'use strict';var _=require('lodash');var util=require(_0x4469('0x0'));var moment=require('moment');var BPromise=require(_0x4469('0x1'));var rs=require(_0x4469('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4469('0x3'))['db'];var utils=require(_0x4469('0x4'));var logger=require(_0x4469('0x5'))(_0x4469('0x6'));var config=require('../../config/environment');var jayson=require(_0x4469('0x7'));var client=jayson['client'][_0x4469('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x388729,_0x4ddf46,_0x449bd4){return new BPromise(function(_0x59ddcb,_0x216949){return client['request'](_0x388729,_0x449bd4)['then'](function(_0x4226d4){logger[_0x4469('0x9')](_0x4469('0xa'),_0x4ddf46,_0x4469('0xb'));logger[_0x4469('0xc')](_0x4469('0xd'),_0x4ddf46,_0x4469('0xb'),JSON['stringify'](_0x4226d4));if(_0x4226d4[_0x4469('0xe')]){if(_0x4226d4['error'][_0x4469('0xf')]===0x1f4){logger[_0x4469('0xe')](_0x4469('0xa'),_0x4ddf46,_0x4226d4[_0x4469('0xe')]['message']);return _0x216949(_0x4226d4['error']['message']);}logger[_0x4469('0xe')](_0x4469('0xa'),_0x4ddf46,_0x4226d4[_0x4469('0xe')]['message']);return _0x59ddcb(_0x4226d4[_0x4469('0xe')][_0x4469('0x10')]);}else{logger[_0x4469('0x9')](_0x4469('0xa'),_0x4ddf46,_0x4469('0xb'));_0x59ddcb(_0x4226d4[_0x4469('0x11')][_0x4469('0x10')]);}})[_0x4469('0x12')](function(_0x539450){logger[_0x4469('0xe')](_0x4469('0xa'),_0x4ddf46,_0x539450);_0x216949(_0x539450);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 4499f7b..e340002 100644 --- a/server/api/chatApplication/index.js +++ b/server/api/chatApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c72=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','/:id','show','delete','destroy','exports'];(function(_0x4d674b,_0x176474){var _0x535a1f=function(_0xac7726){while(--_0xac7726){_0x4d674b['push'](_0x4d674b['shift']());}};_0x535a1f(++_0x176474);}(_0x6c72,0x144));var _0x26c7=function(_0x3a698f,_0x4a82fc){_0x3a698f=_0x3a698f-0x0;var _0x1b7cf3=_0x6c72[_0x3a698f];return _0x1b7cf3;};'use strict';var multer=require(_0x26c7('0x0'));var util=require(_0x26c7('0x1'));var path=require(_0x26c7('0x2'));var timeout=require(_0x26c7('0x3'));var express=require('express');var router=express[_0x26c7('0x4')]();var fs_extra=require(_0x26c7('0x5'));var auth=require(_0x26c7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatApplication.controller');router['get'](_0x26c7('0x7'),auth['isAuthenticated'](),controller[_0x26c7('0x8')]);router['put'](_0x26c7('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x26c7('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x26c7('0xa')]);module[_0x26c7('0xb')]=router; \ No newline at end of file +var _0xf661=['show','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','isAuthenticated'];(function(_0x99167b,_0x4bb003){var _0x417386=function(_0x334ec3){while(--_0x334ec3){_0x99167b['push'](_0x99167b['shift']());}};_0x417386(++_0x4bb003);}(_0xf661,0x8e));var _0x1f66=function(_0x4e2897,_0x33a468){_0x4e2897=_0x4e2897-0x0;var _0x3a21c8=_0xf661[_0x4e2897];return _0x3a21c8;};'use strict';var multer=require('multer');var util=require(_0x1f66('0x0'));var path=require(_0x1f66('0x1'));var timeout=require(_0x1f66('0x2'));var express=require(_0x1f66('0x3'));var router=express[_0x1f66('0x4')]();var fs_extra=require(_0x1f66('0x5'));var auth=require(_0x1f66('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1f66('0x7'));var controller=require(_0x1f66('0x8'));router[_0x1f66('0x9')]('/:id',auth[_0x1f66('0xa')](),controller[_0x1f66('0xb')]);router[_0x1f66('0xc')](_0x1f66('0xd'),auth[_0x1f66('0xa')](),controller[_0x1f66('0xe')]);router[_0x1f66('0xf')](_0x1f66('0xd'),auth[_0x1f66('0xa')](),controller['destroy']);module[_0x1f66('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 454d802..8a36902 100644 --- a/server/api/chatGroup/chatGroup.attributes.js +++ b/server/api/chatGroup/chatGroup.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb012=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3a07f5,_0x357c50){var _0x1ae6b9=function(_0x18579e){while(--_0x18579e){_0x3a07f5['push'](_0x3a07f5['shift']());}};_0x1ae6b9(++_0x357c50);}(_0xb012,0x92));var _0x2b01=function(_0x29b5f4,_0x453c8d){_0x29b5f4=_0x29b5f4-0x0;var _0x56c947=_0xb012[_0x29b5f4];return _0x56c947;};'use strict';var Sequelize=require(_0x2b01('0x0'));module[_0x2b01('0x1')]={'name':{'type':Sequelize[_0x2b01('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2b01('0x2')]},'write':{'type':Sequelize[_0x2b01('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xcba8=['sequelize','exports','STRING','BOOLEAN'];(function(_0x555b41,_0x19abf3){var _0x526d1f=function(_0x11f2c7){while(--_0x11f2c7){_0x555b41['push'](_0x555b41['shift']());}};_0x526d1f(++_0x19abf3);}(_0xcba8,0x1f0));var _0x8cba=function(_0x5c2c3d,_0x570a6d){_0x5c2c3d=_0x5c2c3d-0x0;var _0x1a926d=_0xcba8[_0x5c2c3d];return _0x1a926d;};'use strict';var Sequelize=require(_0x8cba('0x0'));module[_0x8cba('0x1')]={'name':{'type':Sequelize[_0x8cba('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8cba('0x2')]},'write':{'type':Sequelize[_0x8cba('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index e7ad7b9..c483478 100644 --- a/server/api/chatGroup/chatGroup.controller.js +++ b/server/api/chatGroup/chatGroup.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0025=['./chatGroup.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','ChatGroup','rows','catch','rawAttributes','create','body','find','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','pick','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x109e92,_0xf03bcb){var _0x246ad4=function(_0x5cf1ed){while(--_0x5cf1ed){_0x109e92['push'](_0x109e92['shift']());}};_0x246ad4(++_0xf03bcb);}(_0x0025,0xa9));var _0x5002=function(_0x183d0a,_0x2ceffc){_0x183d0a=_0x183d0a-0x0;var _0x236d8f=_0x0025[_0x183d0a];return _0x236d8f;};'use strict';var emlformat=require(_0x5002('0x0'));var rimraf=require(_0x5002('0x1'));var zipdir=require(_0x5002('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5002('0x3'));var moment=require(_0x5002('0x4'));var BPromise=require(_0x5002('0x5'));var Mustache=require(_0x5002('0x6'));var util=require(_0x5002('0x7'));var path=require(_0x5002('0x8'));var sox=require(_0x5002('0x9'));var csv=require(_0x5002('0xa'));var ejs=require(_0x5002('0xb'));var fs=require('fs');var fs_extra=require(_0x5002('0xc'));var _=require(_0x5002('0xd'));var squel=require(_0x5002('0xe'));var crypto=require(_0x5002('0xf'));var jsforce=require(_0x5002('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5002('0x11'));var Papa=require(_0x5002('0x12'));var Redis=require(_0x5002('0x13'));var authService=require(_0x5002('0x14'));var qs=require(_0x5002('0x15'));var as=require(_0x5002('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5002('0x17'))(_0x5002('0x18'));var utils=require('../../config/utils');var config=require(_0x5002('0x19'));var licenseUtil=require(_0x5002('0x1a'));var db=require(_0x5002('0x1b'))['db'];config[_0x5002('0x1c')]=_[_0x5002('0x1d')](config[_0x5002('0x1c')],{'host':_0x5002('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5002('0x1c')]));require(_0x5002('0x1f'))[_0x5002('0x20')](socket);function respondWithStatusCode(_0x1da697,_0x8d4461){_0x8d4461=_0x8d4461||0xcc;return function(_0xc5f876){if(_0xc5f876){return _0x1da697[_0x5002('0x21')](_0x8d4461);}return _0x1da697[_0x5002('0x22')](_0x8d4461)[_0x5002('0x23')]();};}function respondWithResult(_0x4dde64,_0x3dad37){_0x3dad37=_0x3dad37||0xc8;return function(_0x28589d){if(_0x28589d){return _0x4dde64['status'](_0x3dad37)[_0x5002('0x24')](_0x28589d);}};}function respondWithFilteredResult(_0x59596e,_0x93236a){return function(_0x4627ee){if(_0x4627ee){var _0x50dd1d=typeof _0x93236a[_0x5002('0x25')]==='undefined'&&typeof _0x93236a[_0x5002('0x26')]===_0x5002('0x27');var _0x23b4c5=_0x4627ee[_0x5002('0x28')];var _0x30f3fa=_0x50dd1d?0x0:_0x93236a[_0x5002('0x25')];var _0x2621e6=_0x50dd1d?_0x4627ee[_0x5002('0x28')]:_0x93236a['offset']+_0x93236a[_0x5002('0x26')];var _0x5e3b1f;if(_0x2621e6>=_0x23b4c5){_0x2621e6=_0x23b4c5;_0x5e3b1f=0xc8;}else{_0x5e3b1f=0xce;}_0x59596e[_0x5002('0x22')](_0x5e3b1f);return _0x59596e[_0x5002('0x29')](_0x5002('0x2a'),_0x30f3fa+'-'+_0x2621e6+'/'+_0x23b4c5)['json'](_0x4627ee);}return null;};}function patchUpdates(_0x1b1499){return function(_0x3ab1e8){try{jsonpatch[_0x5002('0x2b')](_0x3ab1e8,_0x1b1499,!![]);}catch(_0x5e53ca){return BPromise[_0x5002('0x2c')](_0x5e53ca);}return _0x3ab1e8[_0x5002('0x2d')]();};}function saveUpdates(_0xddb361,_0x214664){return function(_0x58e977){if(_0x58e977){return _0x58e977[_0x5002('0x2e')](_0xddb361)['then'](function(_0x10bbfa){return _0x10bbfa;});}return null;};}function removeEntity(_0x350687,_0x466563){return function(_0x4a6e27){if(_0x4a6e27){return _0x4a6e27[_0x5002('0x2f')]()[_0x5002('0x30')](function(){_0x350687['status'](0xcc)[_0x5002('0x23')]();});}};}function handleEntityNotFound(_0x3b9fa6,_0x25a26c){return function(_0x491660){if(!_0x491660){_0x3b9fa6[_0x5002('0x21')](0x194);}return _0x491660;};}function handleError(_0x319f65,_0x550e85){_0x550e85=_0x550e85||0x1f4;return function(_0x57fc56){logger['error'](_0x57fc56[_0x5002('0x31')]);if(_0x57fc56[_0x5002('0x32')]){delete _0x57fc56[_0x5002('0x32')];}_0x319f65[_0x5002('0x22')](_0x550e85)[_0x5002('0x33')](_0x57fc56);};}exports['index']=function(_0x5e3274,_0x5bfd52){var _0x22ac42={},_0x55f412={},_0x4c64fe={'count':0x0,'rows':[]};var _0x363843=_[_0x5002('0x34')](db['ChatGroup']['rawAttributes'],function(_0x2ba5a6){return{'name':_0x2ba5a6['fieldName'],'type':_0x2ba5a6[_0x5002('0x35')][_0x5002('0x36')]};});_0x55f412[_0x5002('0x37')]=_['map'](_0x363843,_0x5002('0x32'));_0x55f412[_0x5002('0x38')]=_[_0x5002('0x39')](_0x5e3274['query']);_0x55f412[_0x5002('0x3a')]=_[_0x5002('0x3b')](_0x55f412['model'],_0x55f412[_0x5002('0x38')]);_0x22ac42[_0x5002('0x3c')]=_[_0x5002('0x3b')](_0x55f412[_0x5002('0x37')],qs[_0x5002('0x3d')](_0x5e3274[_0x5002('0x38')]['fields']));_0x22ac42[_0x5002('0x3c')]=_0x22ac42['attributes'][_0x5002('0x3e')]?_0x22ac42['attributes']:_0x55f412[_0x5002('0x37')];if(!_0x5e3274[_0x5002('0x38')][_0x5002('0x3f')](_0x5002('0x40'))){_0x22ac42[_0x5002('0x26')]=qs['limit'](_0x5e3274[_0x5002('0x38')][_0x5002('0x26')]);_0x22ac42['offset']=qs[_0x5002('0x25')](_0x5e3274[_0x5002('0x38')][_0x5002('0x25')]);}_0x22ac42[_0x5002('0x41')]=qs['sort'](_0x5e3274[_0x5002('0x38')][_0x5002('0x42')]);_0x22ac42[_0x5002('0x43')]=qs['filters'](_['pick'](_0x5e3274[_0x5002('0x38')],_0x55f412['filters']),_0x363843);if(_0x5e3274[_0x5002('0x38')][_0x5002('0x44')]){_0x22ac42[_0x5002('0x43')]=_[_0x5002('0x45')](_0x22ac42[_0x5002('0x43')],{'$or':_[_0x5002('0x34')](_0x363843,function(_0x5dd4bb){if(_0x5dd4bb[_0x5002('0x35')]!=='VIRTUAL'){var _0x31fc8b={};_0x31fc8b[_0x5dd4bb[_0x5002('0x32')]]={'$like':'%'+_0x5e3274['query'][_0x5002('0x44')]+'%'};return _0x31fc8b;}})});}_0x22ac42=_[_0x5002('0x45')]({},_0x22ac42,_0x5e3274[_0x5002('0x46')]);var _0x6fe909={'where':_0x22ac42[_0x5002('0x43')]};return db['ChatGroup'][_0x5002('0x28')](_0x6fe909)[_0x5002('0x30')](function(_0x222426){_0x4c64fe[_0x5002('0x28')]=_0x222426;if(_0x5e3274[_0x5002('0x38')][_0x5002('0x47')]){_0x22ac42[_0x5002('0x48')]=[{'all':!![]}];}return db[_0x5002('0x49')]['findAll'](_0x22ac42);})[_0x5002('0x30')](function(_0x2f3ce7){_0x4c64fe[_0x5002('0x4a')]=_0x2f3ce7;return _0x4c64fe;})[_0x5002('0x30')](respondWithFilteredResult(_0x5bfd52,_0x22ac42))[_0x5002('0x4b')](handleError(_0x5bfd52,null));};exports['show']=function(_0x3071b6,_0x2ea9d2){var _0x2da6c2={'raw':!![],'where':{'id':_0x3071b6['params']['id']}},_0x3f543e={};_0x3f543e[_0x5002('0x37')]=_[_0x5002('0x39')](db[_0x5002('0x49')][_0x5002('0x4c')]);_0x3f543e[_0x5002('0x38')]=_['keys'](_0x3071b6[_0x5002('0x38')]);_0x3f543e[_0x5002('0x3a')]=_[_0x5002('0x3b')](_0x3f543e[_0x5002('0x37')],_0x3f543e['query']);_0x2da6c2[_0x5002('0x3c')]=_['intersection'](_0x3f543e[_0x5002('0x37')],qs['fields'](_0x3071b6[_0x5002('0x38')][_0x5002('0x3d')]));_0x2da6c2['attributes']=_0x2da6c2[_0x5002('0x3c')][_0x5002('0x3e')]?_0x2da6c2[_0x5002('0x3c')]:_0x3f543e[_0x5002('0x37')];if(_0x3071b6[_0x5002('0x38')][_0x5002('0x47')]){_0x2da6c2['include']=[{'all':!![]}];}_0x2da6c2=_[_0x5002('0x45')]({},_0x2da6c2,_0x3071b6[_0x5002('0x46')]);return db[_0x5002('0x49')]['find'](_0x2da6c2)[_0x5002('0x30')](handleEntityNotFound(_0x2ea9d2,null))[_0x5002('0x30')](respondWithResult(_0x2ea9d2,null))[_0x5002('0x4b')](handleError(_0x2ea9d2,null));};exports[_0x5002('0x4d')]=function(_0x390099,_0xd3fd8b){return db['ChatGroup']['create'](_0x390099[_0x5002('0x4e')],{})[_0x5002('0x30')](respondWithResult(_0xd3fd8b,0xc9))[_0x5002('0x4b')](handleError(_0xd3fd8b,null));};exports['update']=function(_0x4a8ee3,_0x23f07a){if(_0x4a8ee3['body']['id']){delete _0x4a8ee3[_0x5002('0x4e')]['id'];}return db[_0x5002('0x49')][_0x5002('0x4f')]({'where':{'id':_0x4a8ee3[_0x5002('0x50')]['id']}})[_0x5002('0x30')](handleEntityNotFound(_0x23f07a,null))[_0x5002('0x30')](saveUpdates(_0x4a8ee3['body'],null))[_0x5002('0x30')](respondWithResult(_0x23f07a,null))[_0x5002('0x4b')](handleError(_0x23f07a,null));};exports[_0x5002('0x2f')]=function(_0x54deae,_0x165d1a){return db[_0x5002('0x49')][_0x5002('0x4f')]({'where':{'id':_0x54deae['params']['id']}})[_0x5002('0x30')](handleEntityNotFound(_0x165d1a,null))[_0x5002('0x30')](removeEntity(_0x165d1a,null))[_0x5002('0x4b')](handleError(_0x165d1a,null));};exports['describe']=function(_0x430132,_0x1472ae){return db[_0x5002('0x49')][_0x5002('0x51')]()[_0x5002('0x30')](respondWithResult(_0x1472ae,null))[_0x5002('0x4b')](handleError(_0x1472ae,null));};exports[_0x5002('0x52')]=function(_0x41d91a,_0xcc677d,_0x56c731){return db[_0x5002('0x53')]['count']({'where':{'ChatGroupId':_0x41d91a['params']['id'],'ToId':_0x41d91a[_0x5002('0x54')]['id'],'read':![]}})[_0x5002('0x30')](function(_0x438d05){return{'id':_[_0x5002('0x55')](_0x41d91a[_0x5002('0x50')]['id']),'count':_0x438d05};})[_0x5002('0x30')](respondWithResult(_0xcc677d,null))[_0x5002('0x4b')](handleError(_0xcc677d,null));};exports[_0x5002('0x56')]=function(_0x2ab415,_0x4c7ab5,_0x1e3275){return db[_0x5002('0x49')][_0x5002('0x4f')]({'where':{'id':_0x2ab415['params']['id']}})[_0x5002('0x30')](handleEntityNotFound(_0x4c7ab5,null))[_0x5002('0x30')](function(_0x2b7311){if(_0x2b7311){return _0x2b7311[_0x5002('0x56')](_0x2ab415[_0x5002('0x4e')][_0x5002('0x57')],_[_0x5002('0x58')](_0x2ab415[_0x5002('0x4e')],[_0x5002('0x57'),'id'])||{});}})[_0x5002('0x30')](respondWithResult(_0x4c7ab5,null))[_0x5002('0x4b')](handleError(_0x4c7ab5,null));};exports[_0x5002('0x59')]=function(_0x519ec3,_0x1e2658,_0x350c0c){var _0x57a7e9={};var _0xbba2cf={};var _0x4470ed;var _0x1d65b6;return db[_0x5002('0x49')][_0x5002('0x5a')]({'where':{'id':_0x519ec3[_0x5002('0x50')]['id']}})[_0x5002('0x30')](handleEntityNotFound(_0x1e2658,null))[_0x5002('0x30')](function(_0x3e3ef7){if(_0x3e3ef7){_0x4470ed=_0x3e3ef7;_0xbba2cf[_0x5002('0x37')]=_[_0x5002('0x39')](db[_0x5002('0x5b')]['rawAttributes']);_0xbba2cf[_0x5002('0x38')]=_[_0x5002('0x39')](_0x519ec3['query']);_0xbba2cf[_0x5002('0x3a')]=_[_0x5002('0x3b')](_0xbba2cf[_0x5002('0x37')],_0xbba2cf[_0x5002('0x38')]);_0x57a7e9[_0x5002('0x3c')]=_[_0x5002('0x3b')](_0xbba2cf[_0x5002('0x37')],qs['fields'](_0x519ec3[_0x5002('0x38')]['fields']));_0x57a7e9[_0x5002('0x3c')]=_0x57a7e9[_0x5002('0x3c')][_0x5002('0x3e')]?_0x57a7e9[_0x5002('0x3c')]:_0xbba2cf[_0x5002('0x37')];_0x57a7e9[_0x5002('0x41')]=qs[_0x5002('0x42')](_0x519ec3[_0x5002('0x38')][_0x5002('0x42')]);_0x57a7e9[_0x5002('0x43')]=qs[_0x5002('0x3a')](_[_0x5002('0x5c')](_0x519ec3[_0x5002('0x38')],_0xbba2cf[_0x5002('0x3a')]));if(_0x519ec3[_0x5002('0x38')][_0x5002('0x44')]){_0x57a7e9['where']=_[_0x5002('0x45')](_0x57a7e9[_0x5002('0x43')],{'$or':_[_0x5002('0x34')](_0x57a7e9[_0x5002('0x3c')],function(_0xee49d6){var _0x319746={};_0x319746[_0xee49d6]={'$like':'%'+_0x519ec3[_0x5002('0x38')][_0x5002('0x44')]+'%'};return _0x319746;})});}_0x57a7e9=_[_0x5002('0x45')]({},_0x57a7e9,_0x519ec3[_0x5002('0x46')]);return _0x4470ed[_0x5002('0x59')](_0x57a7e9);}})['then'](function(_0x1778d1){if(_0x1778d1){_0x1d65b6=_0x1778d1[_0x5002('0x3e')];if(!_0x519ec3[_0x5002('0x38')]['hasOwnProperty'](_0x5002('0x40'))){_0x57a7e9[_0x5002('0x26')]=qs[_0x5002('0x26')](_0x519ec3['query'][_0x5002('0x26')]);_0x57a7e9[_0x5002('0x25')]=qs[_0x5002('0x25')](_0x519ec3[_0x5002('0x38')]['offset']);}return _0x4470ed[_0x5002('0x59')](_0x57a7e9);}})['then'](function(_0x1cd0c5){if(_0x1cd0c5){return _0x1cd0c5?{'count':_0x1d65b6,'rows':_0x1cd0c5}:null;}})['then'](respondWithResult(_0x1e2658,null))[_0x5002('0x4b')](handleError(_0x1e2658,null));};exports[_0x5002('0x5d')]=function(_0x1bf9bb,_0x248a3b,_0x5bae28){return db[_0x5002('0x49')][_0x5002('0x4f')]({'where':{'id':_0x1bf9bb[_0x5002('0x50')]['id']}})[_0x5002('0x30')](handleEntityNotFound(_0x248a3b,null))[_0x5002('0x30')](function(_0xe8414c){if(_0xe8414c){return _0xe8414c[_0x5002('0x5d')](_0x1bf9bb[_0x5002('0x38')][_0x5002('0x57')]);}})[_0x5002('0x30')](respondWithStatusCode(_0x248a3b,null))[_0x5002('0x4b')](handleError(_0x248a3b,null));};exports[_0x5002('0x5e')]=function(_0xf27c82,_0xba7494,_0x2c6a86){if(_0xf27c82['body']['id']){delete _0xf27c82[_0x5002('0x4e')]['id'];}return db[_0x5002('0x49')][_0x5002('0x4f')]({'where':{'id':_0xf27c82[_0x5002('0x50')]['id']}})[_0x5002('0x30')](handleEntityNotFound(_0xba7494,null))[_0x5002('0x30')](function(_0x27f6ee){if(_0x27f6ee){_0xf27c82[_0x5002('0x4e')][_0x5002('0x5f')]=_0x27f6ee['id'];return db[_0x5002('0x53')]['create'](_0xf27c82[_0x5002('0x4e')]);}})[_0x5002('0x30')](respondWithResult(_0xba7494,null))[_0x5002('0x4b')](handleError(_0xba7494,null));};exports[_0x5002('0x60')]=function(_0x32fdec,_0x4f01c9,_0x1991d0){var _0x5ab4b7={};var _0x11a9d9={};var _0x278b64;var _0x34b7b4;return db['ChatGroup'][_0x5002('0x5a')]({'where':{'id':_0x32fdec[_0x5002('0x50')]['id']}})['then'](handleEntityNotFound(_0x4f01c9,null))['then'](function(_0x12d738){if(_0x12d738){_0x278b64=_0x12d738;_0x11a9d9[_0x5002('0x37')]=_['keys'](db[_0x5002('0x53')]['rawAttributes']);_0x11a9d9['query']=_['keys'](_0x32fdec[_0x5002('0x38')]);_0x11a9d9[_0x5002('0x3a')]=_['intersection'](_0x11a9d9[_0x5002('0x37')],_0x11a9d9[_0x5002('0x38')]);_0x5ab4b7[_0x5002('0x3c')]=_[_0x5002('0x3b')](_0x11a9d9[_0x5002('0x37')],qs[_0x5002('0x3d')](_0x32fdec['query'][_0x5002('0x3d')]));_0x5ab4b7['attributes']=_0x5ab4b7[_0x5002('0x3c')][_0x5002('0x3e')]?_0x5ab4b7[_0x5002('0x3c')]:_0x11a9d9[_0x5002('0x37')];_0x5ab4b7['order']=qs['sort'](_0x32fdec['query']['sort']);_0x5ab4b7[_0x5002('0x43')]=qs[_0x5002('0x3a')](_[_0x5002('0x5c')](_0x32fdec[_0x5002('0x38')],_0x11a9d9['filters']));if(_0x32fdec[_0x5002('0x38')]['filter']){_0x5ab4b7[_0x5002('0x43')]=_[_0x5002('0x45')](_0x5ab4b7[_0x5002('0x43')],{'$or':_['map'](_0x5ab4b7[_0x5002('0x3c')],function(_0x826c64){var _0x34a179={};_0x34a179[_0x826c64]={'$like':'%'+_0x32fdec[_0x5002('0x38')][_0x5002('0x44')]+'%'};return _0x34a179;})});}if(_0x32fdec[_0x5002('0x38')][_0x5002('0x61')]){var _0x20e0cf=_0x32fdec[_0x5002('0x38')][_0x5002('0x61')][_0x5002('0x62')](',');var _0x5e7b3d={};_0x5e7b3d[_0x20e0cf[0x0]]={'$gte':moment(_0x20e0cf[0x1])['format'](_0x5002('0x63'))};_0x5ab4b7[_0x5002('0x43')]=_[_0x5002('0x45')](_0x5ab4b7[_0x5002('0x43')],_0x5e7b3d);}_0x5ab4b7=_[_0x5002('0x45')]({},_0x5ab4b7,_0x32fdec['options']);return _0x278b64[_0x5002('0x60')](_0x5ab4b7);}})[_0x5002('0x30')](function(_0x5dd197){if(_0x5dd197){_0x34b7b4=_0x5dd197[_0x5002('0x3e')];if(!_0x32fdec[_0x5002('0x38')][_0x5002('0x3f')](_0x5002('0x40'))){_0x5ab4b7[_0x5002('0x26')]=qs['limit'](_0x32fdec['query'][_0x5002('0x26')]);_0x5ab4b7[_0x5002('0x25')]=qs[_0x5002('0x25')](_0x32fdec[_0x5002('0x38')][_0x5002('0x25')]);}return _0x278b64[_0x5002('0x60')](_0x5ab4b7);}})[_0x5002('0x30')](function(_0x5b710c){if(_0x5b710c){return _0x5b710c?{'count':_0x34b7b4,'rows':_0x5b710c}:null;}})[_0x5002('0x30')](respondWithResult(_0x4f01c9,null))[_0x5002('0x4b')](handleError(_0x4f01c9,null));}; \ No newline at end of file +var _0xfbbb=['json','offset','limit','undefined','count','set','apply','reject','then','destroy','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','create','body','update','catch','describe','getUnread','user','toInteger','ids','omit','getMembers','findOne','length','removeMembers','ChatGroupId','getMessages','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./chatGroup.socket','register','sendStatus','status','end'];(function(_0x5a3c52,_0x371f4f){var _0x365b22=function(_0x15670c){while(--_0x15670c){_0x5a3c52['push'](_0x5a3c52['shift']());}};_0x365b22(++_0x371f4f);}(_0xfbbb,0xfc));var _0xbfbb=function(_0x1c8284,_0x546198){_0x1c8284=_0x1c8284-0x0;var _0x103f51=_0xfbbb[_0x1c8284];return _0x103f51;};'use strict';var emlformat=require(_0xbfbb('0x0'));var rimraf=require(_0xbfbb('0x1'));var zipdir=require(_0xbfbb('0x2'));var jsonpatch=require(_0xbfbb('0x3'));var rp=require(_0xbfbb('0x4'));var moment=require('moment');var BPromise=require(_0xbfbb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbfbb('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbfbb('0x7'));var squel=require(_0xbfbb('0x8'));var crypto=require(_0xbfbb('0x9'));var jsforce=require(_0xbfbb('0xa'));var deskjs=require(_0xbfbb('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbfbb('0xc'));var Papa=require(_0xbfbb('0xd'));var Redis=require('ioredis');var authService=require(_0xbfbb('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbfbb('0xf'));var hardwareService=require(_0xbfbb('0x10'));var logger=require(_0xbfbb('0x11'))(_0xbfbb('0x12'));var utils=require(_0xbfbb('0x13'));var config=require(_0xbfbb('0x14'));var licenseUtil=require(_0xbfbb('0x15'));var db=require(_0xbfbb('0x16'))['db'];config['redis']=_[_0xbfbb('0x17')](config[_0xbfbb('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbfbb('0x18')]));require(_0xbfbb('0x19'))[_0xbfbb('0x1a')](socket);function respondWithStatusCode(_0x2f2e37,_0x27fff8){_0x27fff8=_0x27fff8||0xcc;return function(_0x181dd8){if(_0x181dd8){return _0x2f2e37[_0xbfbb('0x1b')](_0x27fff8);}return _0x2f2e37[_0xbfbb('0x1c')](_0x27fff8)[_0xbfbb('0x1d')]();};}function respondWithResult(_0x14e00b,_0x2d139e){_0x2d139e=_0x2d139e||0xc8;return function(_0x5bfe3c){if(_0x5bfe3c){return _0x14e00b[_0xbfbb('0x1c')](_0x2d139e)[_0xbfbb('0x1e')](_0x5bfe3c);}};}function respondWithFilteredResult(_0x42bf40,_0x1765d5){return function(_0x1068e5){if(_0x1068e5){var _0x569fa7=typeof _0x1765d5[_0xbfbb('0x1f')]==='undefined'&&typeof _0x1765d5[_0xbfbb('0x20')]===_0xbfbb('0x21');var _0x5af45c=_0x1068e5['count'];var _0x3c2a34=_0x569fa7?0x0:_0x1765d5[_0xbfbb('0x1f')];var _0x4d3a74=_0x569fa7?_0x1068e5[_0xbfbb('0x22')]:_0x1765d5[_0xbfbb('0x1f')]+_0x1765d5[_0xbfbb('0x20')];var _0x351fa0;if(_0x4d3a74>=_0x5af45c){_0x4d3a74=_0x5af45c;_0x351fa0=0xc8;}else{_0x351fa0=0xce;}_0x42bf40[_0xbfbb('0x1c')](_0x351fa0);return _0x42bf40[_0xbfbb('0x23')]('Content-Range',_0x3c2a34+'-'+_0x4d3a74+'/'+_0x5af45c)[_0xbfbb('0x1e')](_0x1068e5);}return null;};}function patchUpdates(_0x2c4025){return function(_0x533fca){try{jsonpatch[_0xbfbb('0x24')](_0x533fca,_0x2c4025,!![]);}catch(_0x341c30){return BPromise[_0xbfbb('0x25')](_0x341c30);}return _0x533fca['save']();};}function saveUpdates(_0x4a549e,_0x8f00cf){return function(_0x598e12){if(_0x598e12){return _0x598e12['update'](_0x4a549e)[_0xbfbb('0x26')](function(_0x437df7){return _0x437df7;});}return null;};}function removeEntity(_0x2a87cb,_0x6adc89){return function(_0x4a4d45){if(_0x4a4d45){return _0x4a4d45[_0xbfbb('0x27')]()[_0xbfbb('0x26')](function(){_0x2a87cb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x58ad3d,_0x1bbb75){return function(_0x5e838a){if(!_0x5e838a){_0x58ad3d['sendStatus'](0x194);}return _0x5e838a;};}function handleError(_0x4d83dd,_0x20f6fe){_0x20f6fe=_0x20f6fe||0x1f4;return function(_0x493ca7){logger['error'](_0x493ca7[_0xbfbb('0x28')]);if(_0x493ca7[_0xbfbb('0x29')]){delete _0x493ca7['name'];}_0x4d83dd['status'](_0x20f6fe)[_0xbfbb('0x2a')](_0x493ca7);};}exports[_0xbfbb('0x2b')]=function(_0xfbdfba,_0x20b578){var _0x3c24d4={},_0x3e9246={},_0x5c69c0={'count':0x0,'rows':[]};var _0x4396a4=_[_0xbfbb('0x2c')](db[_0xbfbb('0x2d')][_0xbfbb('0x2e')],function(_0x12c9d0){return{'name':_0x12c9d0[_0xbfbb('0x2f')],'type':_0x12c9d0[_0xbfbb('0x30')][_0xbfbb('0x31')]};});_0x3e9246['model']=_[_0xbfbb('0x2c')](_0x4396a4,'name');_0x3e9246[_0xbfbb('0x32')]=_[_0xbfbb('0x33')](_0xfbdfba[_0xbfbb('0x32')]);_0x3e9246[_0xbfbb('0x34')]=_['intersection'](_0x3e9246['model'],_0x3e9246[_0xbfbb('0x32')]);_0x3c24d4[_0xbfbb('0x35')]=_[_0xbfbb('0x36')](_0x3e9246[_0xbfbb('0x37')],qs[_0xbfbb('0x38')](_0xfbdfba[_0xbfbb('0x32')][_0xbfbb('0x38')]));_0x3c24d4[_0xbfbb('0x35')]=_0x3c24d4[_0xbfbb('0x35')]['length']?_0x3c24d4[_0xbfbb('0x35')]:_0x3e9246[_0xbfbb('0x37')];if(!_0xfbdfba['query'][_0xbfbb('0x39')](_0xbfbb('0x3a'))){_0x3c24d4[_0xbfbb('0x20')]=qs[_0xbfbb('0x20')](_0xfbdfba[_0xbfbb('0x32')]['limit']);_0x3c24d4[_0xbfbb('0x1f')]=qs[_0xbfbb('0x1f')](_0xfbdfba[_0xbfbb('0x32')][_0xbfbb('0x1f')]);}_0x3c24d4[_0xbfbb('0x3b')]=qs[_0xbfbb('0x3c')](_0xfbdfba[_0xbfbb('0x32')]['sort']);_0x3c24d4[_0xbfbb('0x3d')]=qs['filters'](_[_0xbfbb('0x3e')](_0xfbdfba[_0xbfbb('0x32')],_0x3e9246[_0xbfbb('0x34')]),_0x4396a4);if(_0xfbdfba['query'][_0xbfbb('0x3f')]){_0x3c24d4[_0xbfbb('0x3d')]=_[_0xbfbb('0x40')](_0x3c24d4['where'],{'$or':_['map'](_0x4396a4,function(_0x33f60b){if(_0x33f60b[_0xbfbb('0x30')]!==_0xbfbb('0x41')){var _0x58590b={};_0x58590b[_0x33f60b[_0xbfbb('0x29')]]={'$like':'%'+_0xfbdfba[_0xbfbb('0x32')]['filter']+'%'};return _0x58590b;}})});}_0x3c24d4=_[_0xbfbb('0x40')]({},_0x3c24d4,_0xfbdfba[_0xbfbb('0x42')]);var _0x76bbf7={'where':_0x3c24d4[_0xbfbb('0x3d')]};return db['ChatGroup'][_0xbfbb('0x22')](_0x76bbf7)[_0xbfbb('0x26')](function(_0xc872ef){_0x5c69c0[_0xbfbb('0x22')]=_0xc872ef;if(_0xfbdfba[_0xbfbb('0x32')][_0xbfbb('0x43')]){_0x3c24d4[_0xbfbb('0x44')]=[{'all':!![]}];}return db[_0xbfbb('0x2d')]['findAll'](_0x3c24d4);})[_0xbfbb('0x26')](function(_0xc5b3a8){_0x5c69c0[_0xbfbb('0x45')]=_0xc5b3a8;return _0x5c69c0;})[_0xbfbb('0x26')](respondWithFilteredResult(_0x20b578,_0x3c24d4))['catch'](handleError(_0x20b578,null));};exports[_0xbfbb('0x46')]=function(_0x56dcb3,_0x300397){var _0x1c6fcb={'raw':!![],'where':{'id':_0x56dcb3[_0xbfbb('0x47')]['id']}},_0x3e7d94={};_0x3e7d94[_0xbfbb('0x37')]=_[_0xbfbb('0x33')](db[_0xbfbb('0x2d')][_0xbfbb('0x2e')]);_0x3e7d94['query']=_[_0xbfbb('0x33')](_0x56dcb3[_0xbfbb('0x32')]);_0x3e7d94[_0xbfbb('0x34')]=_['intersection'](_0x3e7d94[_0xbfbb('0x37')],_0x3e7d94[_0xbfbb('0x32')]);_0x1c6fcb[_0xbfbb('0x35')]=_[_0xbfbb('0x36')](_0x3e7d94[_0xbfbb('0x37')],qs['fields'](_0x56dcb3[_0xbfbb('0x32')]['fields']));_0x1c6fcb[_0xbfbb('0x35')]=_0x1c6fcb[_0xbfbb('0x35')]['length']?_0x1c6fcb[_0xbfbb('0x35')]:_0x3e7d94['model'];if(_0x56dcb3[_0xbfbb('0x32')]['includeAll']){_0x1c6fcb['include']=[{'all':!![]}];}_0x1c6fcb=_['merge']({},_0x1c6fcb,_0x56dcb3[_0xbfbb('0x42')]);return db['ChatGroup'][_0xbfbb('0x48')](_0x1c6fcb)[_0xbfbb('0x26')](handleEntityNotFound(_0x300397,null))['then'](respondWithResult(_0x300397,null))['catch'](handleError(_0x300397,null));};exports[_0xbfbb('0x49')]=function(_0x4f57d9,_0x27596d){return db[_0xbfbb('0x2d')][_0xbfbb('0x49')](_0x4f57d9[_0xbfbb('0x4a')],{})[_0xbfbb('0x26')](respondWithResult(_0x27596d,0xc9))['catch'](handleError(_0x27596d,null));};exports[_0xbfbb('0x4b')]=function(_0x1e7b7a,_0xd3e5ae){if(_0x1e7b7a[_0xbfbb('0x4a')]['id']){delete _0x1e7b7a[_0xbfbb('0x4a')]['id'];}return db[_0xbfbb('0x2d')][_0xbfbb('0x48')]({'where':{'id':_0x1e7b7a[_0xbfbb('0x47')]['id']}})[_0xbfbb('0x26')](handleEntityNotFound(_0xd3e5ae,null))[_0xbfbb('0x26')](saveUpdates(_0x1e7b7a[_0xbfbb('0x4a')],null))[_0xbfbb('0x26')](respondWithResult(_0xd3e5ae,null))[_0xbfbb('0x4c')](handleError(_0xd3e5ae,null));};exports[_0xbfbb('0x27')]=function(_0x25d423,_0x3ae00e){return db[_0xbfbb('0x2d')][_0xbfbb('0x48')]({'where':{'id':_0x25d423[_0xbfbb('0x47')]['id']}})[_0xbfbb('0x26')](handleEntityNotFound(_0x3ae00e,null))[_0xbfbb('0x26')](removeEntity(_0x3ae00e,null))[_0xbfbb('0x4c')](handleError(_0x3ae00e,null));};exports['describe']=function(_0x16b929,_0x4f1647){return db[_0xbfbb('0x2d')][_0xbfbb('0x4d')]()[_0xbfbb('0x26')](respondWithResult(_0x4f1647,null))['catch'](handleError(_0x4f1647,null));};exports[_0xbfbb('0x4e')]=function(_0x1ef7d6,_0x3cdaea,_0x8bf778){return db['ChatInternalMessage'][_0xbfbb('0x22')]({'where':{'ChatGroupId':_0x1ef7d6[_0xbfbb('0x47')]['id'],'ToId':_0x1ef7d6[_0xbfbb('0x4f')]['id'],'read':![]}})[_0xbfbb('0x26')](function(_0x2cc513){return{'id':_[_0xbfbb('0x50')](_0x1ef7d6['params']['id']),'count':_0x2cc513};})[_0xbfbb('0x26')](respondWithResult(_0x3cdaea,null))[_0xbfbb('0x4c')](handleError(_0x3cdaea,null));};exports['addMembers']=function(_0x569f1a,_0x30ba64,_0x460a1e){return db[_0xbfbb('0x2d')]['find']({'where':{'id':_0x569f1a[_0xbfbb('0x47')]['id']}})[_0xbfbb('0x26')](handleEntityNotFound(_0x30ba64,null))[_0xbfbb('0x26')](function(_0x2a08c3){if(_0x2a08c3){return _0x2a08c3['addMembers'](_0x569f1a[_0xbfbb('0x4a')][_0xbfbb('0x51')],_[_0xbfbb('0x52')](_0x569f1a[_0xbfbb('0x4a')],[_0xbfbb('0x51'),'id'])||{});}})[_0xbfbb('0x26')](respondWithResult(_0x30ba64,null))[_0xbfbb('0x4c')](handleError(_0x30ba64,null));};exports[_0xbfbb('0x53')]=function(_0x4a3ced,_0x131cbf,_0x2e822c){var _0x5f383c={};var _0x37814e={};var _0x1c9fc2;var _0x40545f;return db[_0xbfbb('0x2d')][_0xbfbb('0x54')]({'where':{'id':_0x4a3ced['params']['id']}})[_0xbfbb('0x26')](handleEntityNotFound(_0x131cbf,null))[_0xbfbb('0x26')](function(_0xe399f7){if(_0xe399f7){_0x1c9fc2=_0xe399f7;_0x37814e[_0xbfbb('0x37')]=_['keys'](db['User'][_0xbfbb('0x2e')]);_0x37814e['query']=_[_0xbfbb('0x33')](_0x4a3ced[_0xbfbb('0x32')]);_0x37814e[_0xbfbb('0x34')]=_['intersection'](_0x37814e[_0xbfbb('0x37')],_0x37814e[_0xbfbb('0x32')]);_0x5f383c[_0xbfbb('0x35')]=_[_0xbfbb('0x36')](_0x37814e['model'],qs[_0xbfbb('0x38')](_0x4a3ced[_0xbfbb('0x32')]['fields']));_0x5f383c[_0xbfbb('0x35')]=_0x5f383c[_0xbfbb('0x35')][_0xbfbb('0x55')]?_0x5f383c['attributes']:_0x37814e['model'];_0x5f383c[_0xbfbb('0x3b')]=qs[_0xbfbb('0x3c')](_0x4a3ced['query'][_0xbfbb('0x3c')]);_0x5f383c['where']=qs[_0xbfbb('0x34')](_[_0xbfbb('0x3e')](_0x4a3ced[_0xbfbb('0x32')],_0x37814e['filters']));if(_0x4a3ced[_0xbfbb('0x32')]['filter']){_0x5f383c[_0xbfbb('0x3d')]=_[_0xbfbb('0x40')](_0x5f383c[_0xbfbb('0x3d')],{'$or':_[_0xbfbb('0x2c')](_0x5f383c[_0xbfbb('0x35')],function(_0x5b1001){var _0x43774b={};_0x43774b[_0x5b1001]={'$like':'%'+_0x4a3ced['query'][_0xbfbb('0x3f')]+'%'};return _0x43774b;})});}_0x5f383c=_[_0xbfbb('0x40')]({},_0x5f383c,_0x4a3ced[_0xbfbb('0x42')]);return _0x1c9fc2['getMembers'](_0x5f383c);}})[_0xbfbb('0x26')](function(_0xfaccc){if(_0xfaccc){_0x40545f=_0xfaccc[_0xbfbb('0x55')];if(!_0x4a3ced[_0xbfbb('0x32')]['hasOwnProperty']('nolimit')){_0x5f383c[_0xbfbb('0x20')]=qs[_0xbfbb('0x20')](_0x4a3ced[_0xbfbb('0x32')][_0xbfbb('0x20')]);_0x5f383c[_0xbfbb('0x1f')]=qs['offset'](_0x4a3ced[_0xbfbb('0x32')][_0xbfbb('0x1f')]);}return _0x1c9fc2['getMembers'](_0x5f383c);}})['then'](function(_0x21e69c){if(_0x21e69c){return _0x21e69c?{'count':_0x40545f,'rows':_0x21e69c}:null;}})['then'](respondWithResult(_0x131cbf,null))[_0xbfbb('0x4c')](handleError(_0x131cbf,null));};exports[_0xbfbb('0x56')]=function(_0x27d82c,_0x14dc3e,_0x449217){return db[_0xbfbb('0x2d')][_0xbfbb('0x48')]({'where':{'id':_0x27d82c[_0xbfbb('0x47')]['id']}})['then'](handleEntityNotFound(_0x14dc3e,null))[_0xbfbb('0x26')](function(_0x553fa2){if(_0x553fa2){return _0x553fa2[_0xbfbb('0x56')](_0x27d82c[_0xbfbb('0x32')][_0xbfbb('0x51')]);}})['then'](respondWithStatusCode(_0x14dc3e,null))[_0xbfbb('0x4c')](handleError(_0x14dc3e,null));};exports['addMessage']=function(_0x5aaff2,_0x1846b7,_0x1920e1){if(_0x5aaff2[_0xbfbb('0x4a')]['id']){delete _0x5aaff2['body']['id'];}return db[_0xbfbb('0x2d')][_0xbfbb('0x48')]({'where':{'id':_0x5aaff2[_0xbfbb('0x47')]['id']}})['then'](handleEntityNotFound(_0x1846b7,null))['then'](function(_0x9e646d){if(_0x9e646d){_0x5aaff2[_0xbfbb('0x4a')][_0xbfbb('0x57')]=_0x9e646d['id'];return db['ChatInternalMessage'][_0xbfbb('0x49')](_0x5aaff2[_0xbfbb('0x4a')]);}})['then'](respondWithResult(_0x1846b7,null))[_0xbfbb('0x4c')](handleError(_0x1846b7,null));};exports[_0xbfbb('0x58')]=function(_0x1c02b7,_0x5421a1,_0xdf59eb){var _0x4e0567={};var _0x15be5d={};var _0xaf1224;var _0x614f93;return db[_0xbfbb('0x2d')][_0xbfbb('0x54')]({'where':{'id':_0x1c02b7['params']['id']}})[_0xbfbb('0x26')](handleEntityNotFound(_0x5421a1,null))[_0xbfbb('0x26')](function(_0x41b371){if(_0x41b371){_0xaf1224=_0x41b371;_0x15be5d[_0xbfbb('0x37')]=_[_0xbfbb('0x33')](db[_0xbfbb('0x59')][_0xbfbb('0x2e')]);_0x15be5d[_0xbfbb('0x32')]=_[_0xbfbb('0x33')](_0x1c02b7[_0xbfbb('0x32')]);_0x15be5d[_0xbfbb('0x34')]=_[_0xbfbb('0x36')](_0x15be5d['model'],_0x15be5d[_0xbfbb('0x32')]);_0x4e0567['attributes']=_[_0xbfbb('0x36')](_0x15be5d[_0xbfbb('0x37')],qs['fields'](_0x1c02b7[_0xbfbb('0x32')]['fields']));_0x4e0567[_0xbfbb('0x35')]=_0x4e0567[_0xbfbb('0x35')][_0xbfbb('0x55')]?_0x4e0567[_0xbfbb('0x35')]:_0x15be5d[_0xbfbb('0x37')];_0x4e0567[_0xbfbb('0x3b')]=qs[_0xbfbb('0x3c')](_0x1c02b7['query'][_0xbfbb('0x3c')]);_0x4e0567[_0xbfbb('0x3d')]=qs['filters'](_[_0xbfbb('0x3e')](_0x1c02b7[_0xbfbb('0x32')],_0x15be5d[_0xbfbb('0x34')]));if(_0x1c02b7[_0xbfbb('0x32')][_0xbfbb('0x3f')]){_0x4e0567[_0xbfbb('0x3d')]=_[_0xbfbb('0x40')](_0x4e0567[_0xbfbb('0x3d')],{'$or':_[_0xbfbb('0x2c')](_0x4e0567[_0xbfbb('0x35')],function(_0x222c23){var _0xaf9e11={};_0xaf9e11[_0x222c23]={'$like':'%'+_0x1c02b7[_0xbfbb('0x32')]['filter']+'%'};return _0xaf9e11;})});}if(_0x1c02b7[_0xbfbb('0x32')][_0xbfbb('0x5a')]){var _0x55fb0b=_0x1c02b7['query']['$gte'][_0xbfbb('0x5b')](',');var _0x5c339e={};_0x5c339e[_0x55fb0b[0x0]]={'$gte':moment(_0x55fb0b[0x1])[_0xbfbb('0x5c')](_0xbfbb('0x5d'))};_0x4e0567[_0xbfbb('0x3d')]=_[_0xbfbb('0x40')](_0x4e0567[_0xbfbb('0x3d')],_0x5c339e);}_0x4e0567=_[_0xbfbb('0x40')]({},_0x4e0567,_0x1c02b7[_0xbfbb('0x42')]);return _0xaf1224[_0xbfbb('0x58')](_0x4e0567);}})[_0xbfbb('0x26')](function(_0x25e321){if(_0x25e321){_0x614f93=_0x25e321[_0xbfbb('0x55')];if(!_0x1c02b7[_0xbfbb('0x32')][_0xbfbb('0x39')](_0xbfbb('0x3a'))){_0x4e0567[_0xbfbb('0x20')]=qs[_0xbfbb('0x20')](_0x1c02b7['query'][_0xbfbb('0x20')]);_0x4e0567['offset']=qs[_0xbfbb('0x1f')](_0x1c02b7[_0xbfbb('0x32')][_0xbfbb('0x1f')]);}return _0xaf1224['getMessages'](_0x4e0567);}})['then'](function(_0x134885){if(_0x134885){return _0x134885?{'count':_0x614f93,'rows':_0x134885}:null;}})[_0xbfbb('0x26')](respondWithResult(_0x5421a1,null))[_0xbfbb('0x4c')](handleError(_0x5421a1,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 6d06a80..adabce5 100644 --- a/server/api/chatGroup/chatGroup.events.js +++ b/server/api/chatGroup/chatGroup.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x287e=['setMaxListeners','save','update','remove','emit','hook','events','../../mysqldb','ChatGroup'];(function(_0x3d34f0,_0x4a5dc0){var _0x135ecd=function(_0x9a81d5){while(--_0x9a81d5){_0x3d34f0['push'](_0x3d34f0['shift']());}};_0x135ecd(++_0x4a5dc0);}(_0x287e,0x1e3));var _0xe287=function(_0x565bdf,_0x1dc64b){_0x565bdf=_0x565bdf-0x0;var _0x5f1f61=_0x287e[_0x565bdf];return _0x5f1f61;};'use strict';var EventEmitter=require(_0xe287('0x0'));var ChatGroup=require(_0xe287('0x1'))['db'][_0xe287('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xe287('0x3')](0x0);var events={'afterCreate':_0xe287('0x4'),'afterUpdate':_0xe287('0x5'),'afterDestroy':_0xe287('0x6')};function emitEvent(_0x3ce68e){return function(_0x16d2d7,_0x5f34d6,_0x113035){ChatGroupEvents[_0xe287('0x7')](_0x3ce68e+':'+_0x16d2d7['id'],_0x16d2d7);ChatGroupEvents['emit'](_0x3ce68e,_0x16d2d7);_0x113035(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xe287('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0xb2b0=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x729992,_0x45d9ce){var _0x27826f=function(_0x38b955){while(--_0x38b955){_0x729992['push'](_0x729992['shift']());}};_0x27826f(++_0x45d9ce);}(_0xb2b0,0x72));var _0x0b2b=function(_0x3166a6,_0x4e7127){_0x3166a6=_0x3166a6-0x0;var _0x36f73d=_0xb2b0[_0x3166a6];return _0x36f73d;};'use strict';var EventEmitter=require(_0x0b2b('0x0'));var ChatGroup=require(_0x0b2b('0x1'))['db'][_0x0b2b('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0b2b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0b2b('0x4')};function emitEvent(_0x21fc00){return function(_0x2b241c,_0x51a18e,_0x96538a){ChatGroupEvents[_0x0b2b('0x5')](_0x21fc00+':'+_0x2b241c['id'],_0x2b241c);ChatGroupEvents[_0x0b2b('0x5')](_0x21fc00,_0x2b241c);_0x96538a(null);};}for(var e in events){if(events[_0x0b2b('0x6')](e)){var event=events[e];ChatGroup[_0x0b2b('0x7')](e,emitEvent(event));}}module[_0x0b2b('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index bd27352..4113de1 100644 --- a/server/api/chatGroup/chatGroup.model.js +++ b/server/api/chatGroup/chatGroup.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d60=['rimraf','../../config/environment','exports','ChatGroup','lodash','util','moment','bluebird','request-promise','path'];(function(_0x20dba9,_0x477048){var _0x1ad894=function(_0x96dfc2){while(--_0x96dfc2){_0x20dba9['push'](_0x20dba9['shift']());}};_0x1ad894(++_0x477048);}(_0x0d60,0x90));var _0x00d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0d60[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x00d6('0x0'));var util=require(_0x00d6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x00d6('0x2'));var BPromise=require(_0x00d6('0x3'));var rp=require(_0x00d6('0x4'));var fs=require('fs');var path=require(_0x00d6('0x5'));var rimraf=require(_0x00d6('0x6'));var config=require(_0x00d6('0x7'));var attributes=require('./chatGroup.attributes');module[_0x00d6('0x8')]=function(_0x2a3210,_0x290f84){return _0x2a3210['define'](_0x00d6('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3aa5=['define','ChatGroup','chat_groups','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','exports'];(function(_0x5e34a4,_0x2e63ed){var _0x8d41d7=function(_0x45c61b){while(--_0x45c61b){_0x5e34a4['push'](_0x5e34a4['shift']());}};_0x8d41d7(++_0x2e63ed);}(_0x3aa5,0x121));var _0x53aa=function(_0x592a66,_0x16192e){_0x592a66=_0x592a66-0x0;var _0xa26208=_0x3aa5[_0x592a66];return _0xa26208;};'use strict';var _=require(_0x53aa('0x0'));var util=require(_0x53aa('0x1'));var logger=require(_0x53aa('0x2'))('api');var moment=require(_0x53aa('0x3'));var BPromise=require(_0x53aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53aa('0x5'));var rimraf=require(_0x53aa('0x6'));var config=require(_0x53aa('0x7'));var attributes=require(_0x53aa('0x8'));module[_0x53aa('0x9')]=function(_0x38007b,_0x483331){return _0x38007b[_0x53aa('0xa')](_0x53aa('0xb'),attributes,{'tableName':_0x53aa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 952827a..381a87d 100644 --- a/server/api/chatGroup/chatGroup.rpc.js +++ b/server/api/chatGroup/chatGroup.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f17=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatGroup.socket','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x553a87,_0x1d621f){var _0x12d1e6=function(_0x41ae48){while(--_0x41ae48){_0x553a87['push'](_0x553a87['shift']());}};_0x12d1e6(++_0x1d621f);}(_0x0f17,0x8b));var _0x70f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f17[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x70f1('0x0'));var util=require(_0x70f1('0x1'));var moment=require(_0x70f1('0x2'));var BPromise=require(_0x70f1('0x3'));var rs=require(_0x70f1('0x4'));var fs=require('fs');var Redis=require(_0x70f1('0x5'));var db=require(_0x70f1('0x6'))['db'];var utils=require(_0x70f1('0x7'));var logger=require(_0x70f1('0x8'))(_0x70f1('0x9'));var config=require(_0x70f1('0xa'));var jayson=require(_0x70f1('0xb'));var client=jayson[_0x70f1('0xc')][_0x70f1('0xd')]({'port':0x232a});config[_0x70f1('0xe')]=_[_0x70f1('0xf')](config['redis'],{'host':_0x70f1('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x70f1('0xe')]));require(_0x70f1('0x11'))['register'](socket);function respondWithRpcPromise(_0x261425,_0x7c8ac5,_0x3ecfbf){return new BPromise(function(_0x50cd72,_0x4274e9){return client[_0x70f1('0x12')](_0x261425,_0x3ecfbf)['then'](function(_0x23fe2c){logger[_0x70f1('0x13')](_0x70f1('0x14'),_0x7c8ac5,_0x70f1('0x15'));logger[_0x70f1('0x16')](_0x70f1('0x17'),_0x7c8ac5,_0x70f1('0x15'),JSON[_0x70f1('0x18')](_0x23fe2c));if(_0x23fe2c['error']){if(_0x23fe2c[_0x70f1('0x19')]['code']===0x1f4){logger[_0x70f1('0x19')]('ChatGroup,\x20%s,\x20%s',_0x7c8ac5,_0x23fe2c[_0x70f1('0x19')][_0x70f1('0x1a')]);return _0x4274e9(_0x23fe2c[_0x70f1('0x19')][_0x70f1('0x1a')]);}logger[_0x70f1('0x19')](_0x70f1('0x14'),_0x7c8ac5,_0x23fe2c[_0x70f1('0x19')]['message']);return _0x50cd72(_0x23fe2c[_0x70f1('0x19')]['message']);}else{logger[_0x70f1('0x13')](_0x70f1('0x14'),_0x7c8ac5,_0x70f1('0x15'));_0x50cd72(_0x23fe2c[_0x70f1('0x1b')][_0x70f1('0x1a')]);}})['catch'](function(_0x48e81a){logger[_0x70f1('0x19')](_0x70f1('0x14'),_0x7c8ac5,_0x48e81a);_0x4274e9(_0x48e81a);});});} \ No newline at end of file +var _0xb3c2=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch'];(function(_0x30c151,_0x39df85){var _0x5806ad=function(_0x35e563){while(--_0x35e563){_0x30c151['push'](_0x30c151['shift']());}};_0x5806ad(++_0x39df85);}(_0xb3c2,0x152));var _0x2b3c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb3c2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2b3c('0x0'));var util=require(_0x2b3c('0x1'));var moment=require('moment');var BPromise=require(_0x2b3c('0x2'));var rs=require(_0x2b3c('0x3'));var fs=require('fs');var Redis=require(_0x2b3c('0x4'));var db=require(_0x2b3c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b3c('0x6'))(_0x2b3c('0x7'));var config=require(_0x2b3c('0x8'));var jayson=require(_0x2b3c('0x9'));var client=jayson[_0x2b3c('0xa')]['http']({'port':0x232a});config[_0x2b3c('0xb')]=_[_0x2b3c('0xc')](config[_0x2b3c('0xb')],{'host':_0x2b3c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2b3c('0xe'))[_0x2b3c('0xf')](socket);function respondWithRpcPromise(_0x3fea73,_0x535546,_0x149a3a){return new BPromise(function(_0x1a8e9d,_0x32209a){return client[_0x2b3c('0x10')](_0x3fea73,_0x149a3a)[_0x2b3c('0x11')](function(_0x14c977){logger[_0x2b3c('0x12')](_0x2b3c('0x13'),_0x535546,_0x2b3c('0x14'));logger[_0x2b3c('0x15')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x535546,_0x2b3c('0x14'),JSON['stringify'](_0x14c977));if(_0x14c977[_0x2b3c('0x16')]){if(_0x14c977[_0x2b3c('0x16')]['code']===0x1f4){logger[_0x2b3c('0x16')](_0x2b3c('0x13'),_0x535546,_0x14c977[_0x2b3c('0x16')]['message']);return _0x32209a(_0x14c977[_0x2b3c('0x16')][_0x2b3c('0x17')]);}logger[_0x2b3c('0x16')](_0x2b3c('0x13'),_0x535546,_0x14c977['error'][_0x2b3c('0x17')]);return _0x1a8e9d(_0x14c977[_0x2b3c('0x16')][_0x2b3c('0x17')]);}else{logger[_0x2b3c('0x12')](_0x2b3c('0x13'),_0x535546,_0x2b3c('0x14'));_0x1a8e9d(_0x14c977[_0x2b3c('0x18')][_0x2b3c('0x17')]);}})[_0x2b3c('0x19')](function(_0x285f7c){logger['error'](_0x2b3c('0x13'),_0x535546,_0x285f7c);_0x32209a(_0x285f7c);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index a3b7b0a..93dfbb8 100644 --- a/server/api/chatGroup/chatGroup.socket.js +++ b/server/api/chatGroup/chatGroup.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4177=['remove','update','emit','length','chatGroup:','./chatGroup.events','save'];(function(_0x177e34,_0x4d0a79){var _0x3776fc=function(_0x314261){while(--_0x314261){_0x177e34['push'](_0x177e34['shift']());}};_0x3776fc(++_0x4d0a79);}(_0x4177,0x15c));var _0x7417=function(_0x401505,_0x54c9d8){_0x401505=_0x401505-0x0;var _0x23f363=_0x4177[_0x401505];return _0x23f363;};'use strict';var ChatGroupEvents=require(_0x7417('0x0'));var events=[_0x7417('0x1'),_0x7417('0x2'),_0x7417('0x3')];function createListener(_0x2b4bac,_0x451677){return function(_0x3be39c){_0x451677[_0x7417('0x4')](_0x2b4bac,_0x3be39c);};}function removeListener(_0x1ec35e,_0x46ba76){return function(){ChatGroupEvents['removeListener'](_0x1ec35e,_0x46ba76);};}exports['register']=function(_0xdfcdc2){for(var _0x36f435=0x0,_0x1de982=events[_0x7417('0x5')];_0x36f435<_0x1de982;_0x36f435++){var _0x4e0ccc=events[_0x36f435];var _0x3a7205=createListener(_0x7417('0x6')+_0x4e0ccc,_0xdfcdc2);ChatGroupEvents['on'](_0x4e0ccc,_0x3a7205);}}; \ No newline at end of file +var _0x77cc=['removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x77cc,0x15a));var _0xc77c=function(_0x191917,_0x552ff4){_0x191917=_0x191917-0x0;var _0x52a7ec=_0x77cc[_0x191917];return _0x52a7ec;};'use strict';var ChatGroupEvents=require(_0xc77c('0x0'));var events=[_0xc77c('0x1'),_0xc77c('0x2'),_0xc77c('0x3')];function createListener(_0x5ca990,_0x59ef97){return function(_0x474f9d){_0x59ef97[_0xc77c('0x4')](_0x5ca990,_0x474f9d);};}function removeListener(_0x3992d7,_0x2afb3c){return function(){ChatGroupEvents[_0xc77c('0x5')](_0x3992d7,_0x2afb3c);};}exports[_0xc77c('0x6')]=function(_0x2232f8){for(var _0x54bec2=0x0,_0x16ddb2=events[_0xc77c('0x7')];_0x54bec2<_0x16ddb2;_0x54bec2++){var _0x1f114d=events[_0x54bec2];var _0x4ed399=createListener(_0xc77c('0x8')+_0x1f114d,_0x2232f8);ChatGroupEvents['on'](_0x1f114d,_0x4ed399);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 243b68e..6bbc09d 100644 --- a/server/api/chatGroup/index.js +++ b/server/api/chatGroup/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ed0=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','getMembers','getMessages','post','/:id/members','addMembers','/:id/messages','addMessage','put','update','delete','destroy','removeMembers','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller'];(function(_0x1b6807,_0x3ef980){var _0x281d96=function(_0x4fe4f4){while(--_0x4fe4f4){_0x1b6807['push'](_0x1b6807['shift']());}};_0x281d96(++_0x3ef980);}(_0x0ed0,0x19c));var _0x00ed=function(_0x4efcf3,_0x3ccdbd){_0x4efcf3=_0x4efcf3-0x0;var _0x51b972=_0x0ed0[_0x4efcf3];return _0x51b972;};'use strict';var multer=require(_0x00ed('0x0'));var util=require('util');var path=require(_0x00ed('0x1'));var timeout=require(_0x00ed('0x2'));var express=require('express');var router=express[_0x00ed('0x3')]();var fs_extra=require(_0x00ed('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x00ed('0x5'));var config=require(_0x00ed('0x6'));var controller=require(_0x00ed('0x7'));router[_0x00ed('0x8')]('/',auth[_0x00ed('0x9')](),controller[_0x00ed('0xa')]);router[_0x00ed('0x8')](_0x00ed('0xb'),auth['isAuthenticated'](),controller[_0x00ed('0xc')]);router[_0x00ed('0x8')](_0x00ed('0xd'),auth[_0x00ed('0x9')](),controller[_0x00ed('0xe')]);router[_0x00ed('0x8')](_0x00ed('0xf'),auth[_0x00ed('0x9')](),controller[_0x00ed('0x10')]);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0x00ed('0x11')]);router['get']('/:id/messages',auth[_0x00ed('0x9')](),controller[_0x00ed('0x12')]);router[_0x00ed('0x13')]('/',auth[_0x00ed('0x9')](),controller['create']);router['post'](_0x00ed('0x14'),auth[_0x00ed('0x9')](),controller[_0x00ed('0x15')]);router[_0x00ed('0x13')](_0x00ed('0x16'),auth[_0x00ed('0x9')](),controller[_0x00ed('0x17')]);router[_0x00ed('0x18')](_0x00ed('0xd'),auth[_0x00ed('0x9')](),controller[_0x00ed('0x19')]);router[_0x00ed('0x1a')]('/:id',auth[_0x00ed('0x9')](),controller[_0x00ed('0x1b')]);router[_0x00ed('0x1a')](_0x00ed('0x14'),auth[_0x00ed('0x9')](),controller[_0x00ed('0x1c')]);module[_0x00ed('0x1d')]=router; \ No newline at end of file +var _0xcaa3=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','describe','/:id','show','get','/:id/unread','getUnread','getMembers','/:id/messages','post','create','/:id/members','addMembers','addMessage','update','delete','removeMembers'];(function(_0x5b8310,_0x77ea6f){var _0xd3ebc1=function(_0x9dfb29){while(--_0x9dfb29){_0x5b8310['push'](_0x5b8310['shift']());}};_0xd3ebc1(++_0x77ea6f);}(_0xcaa3,0x1a5));var _0x3caa=function(_0x8abd64,_0x539570){_0x8abd64=_0x8abd64-0x0;var _0xd2511e=_0xcaa3[_0x8abd64];return _0xd2511e;};'use strict';var multer=require(_0x3caa('0x0'));var util=require(_0x3caa('0x1'));var path=require(_0x3caa('0x2'));var timeout=require(_0x3caa('0x3'));var express=require('express');var router=express[_0x3caa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3caa('0x5'));var interaction=require(_0x3caa('0x6'));var config=require(_0x3caa('0x7'));var controller=require(_0x3caa('0x8'));router['get']('/',auth[_0x3caa('0x9')](),controller[_0x3caa('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x3caa('0xb')]);router['get'](_0x3caa('0xc'),auth[_0x3caa('0x9')](),controller[_0x3caa('0xd')]);router[_0x3caa('0xe')](_0x3caa('0xf'),auth[_0x3caa('0x9')](),controller[_0x3caa('0x10')]);router[_0x3caa('0xe')]('/:id/members',auth[_0x3caa('0x9')](),controller[_0x3caa('0x11')]);router[_0x3caa('0xe')](_0x3caa('0x12'),auth[_0x3caa('0x9')](),controller['getMessages']);router[_0x3caa('0x13')]('/',auth[_0x3caa('0x9')](),controller[_0x3caa('0x14')]);router[_0x3caa('0x13')](_0x3caa('0x15'),auth[_0x3caa('0x9')](),controller[_0x3caa('0x16')]);router[_0x3caa('0x13')]('/:id/messages',auth[_0x3caa('0x9')](),controller[_0x3caa('0x17')]);router['put'](_0x3caa('0xc'),auth[_0x3caa('0x9')](),controller[_0x3caa('0x18')]);router['delete'](_0x3caa('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x3caa('0x19')](_0x3caa('0x15'),auth[_0x3caa('0x9')](),controller[_0x3caa('0x1a')]);module[_0x3caa('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 120efb0..9513fc4 100644 --- a/server/api/chatInteraction/chatInteraction.attributes.js +++ b/server/api/chatInteraction/chatInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7848=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','sequelize','exports','BOOLEAN'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0x7848,0x194));var _0x8784=function(_0x2f3b14,_0x554f94){_0x2f3b14=_0x2f3b14-0x0;var _0x20e924=_0x7848[_0x2f3b14];return _0x20e924;};'use strict';var Sequelize=require(_0x8784('0x0'));module[_0x8784('0x1')]={'closed':{'type':Sequelize[_0x8784('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8784('0x3')]},'ratingType':{'type':Sequelize[_0x8784('0x4')](_0x8784('0x5'),_0x8784('0x6')),'defaultValue':_0x8784('0x5')},'ratingMessage':{'type':Sequelize[_0x8784('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x8784('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8784('0x9')]},'disposition':{'type':Sequelize[_0x8784('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8784('0x8')]},'browserName':{'type':Sequelize[_0x8784('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x8784('0x8')]},'osVersion':{'type':Sequelize[_0x8784('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x8784('0x8')]},'deviceType':{'type':Sequelize[_0x8784('0x8')]},'referer':{'type':Sequelize[_0x8784('0x7')]},'customerIp':{'type':Sequelize[_0x8784('0x8')]},'formData':{'type':Sequelize[_0x8784('0x7')](_0x8784('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x8784('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x8784('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8784('0x8')]},'customerPort':{'type':Sequelize[_0x8784('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x8784('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x8784('0x3')]}}; \ No newline at end of file +var _0xbcbe=['thumb','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','star'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xbcbe,0xcc));var _0xebcb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcbe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xebcb('0x0'));module[_0xebcb('0x1')]={'closed':{'type':Sequelize[_0xebcb('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xebcb('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xebcb('0x4'),_0xebcb('0x5')),'defaultValue':_0xebcb('0x4')},'ratingMessage':{'type':Sequelize[_0xebcb('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xebcb('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xebcb('0x8')]},'disposition':{'type':Sequelize[_0xebcb('0x7')]},'secondDisposition':{'type':Sequelize[_0xebcb('0x7')]},'thirdDisposition':{'type':Sequelize[_0xebcb('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xebcb('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xebcb('0x7')]},'osVersion':{'type':Sequelize[_0xebcb('0x7')]},'deviceModel':{'type':Sequelize[_0xebcb('0x7')]},'deviceVendor':{'type':Sequelize[_0xebcb('0x7')]},'deviceType':{'type':Sequelize[_0xebcb('0x7')]},'referer':{'type':Sequelize[_0xebcb('0x6')]},'customerIp':{'type':Sequelize[_0xebcb('0x7')]},'formData':{'type':Sequelize[_0xebcb('0x6')](_0xebcb('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xebcb('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xebcb('0x7')]},'customerPort':{'type':Sequelize[_0xebcb('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xebcb('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xebcb('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xebcb('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index d8f1f6e..9147f62 100644 --- a/server/api/chatInteraction/chatInteraction.controller.js +++ b/server/api/chatInteraction/chatInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d4a=['pick','where','ChatInteractionId','filter','$gte','split','getMyMessages','nolimit','order','include','includeAgent','push','rows','addTags','setTags','omit','spread','color','emit','chatInteractionTags:save','removeTags','toString','server','transcript-%d-%s.zip','firstName','lastName','attachments','read','Owner','get','mkdirSync','Chat','Account','N.A.','createdAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','YYYY-MM-DD\x20HH:mm:ss','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','moment','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','offset','undefined','limit','count','set','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','map','ChatInteraction','fieldName','type','key','getOptions','findAll','chat','query','user','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','options','find','create','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','originalname','basename','file','mimetype','attachmentDownload','json','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','pathTranscript','Messages','User','ChatWebsite','ChatWebsiteId','UserId','%s%d','agentAlias','System','customer','website_alias','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','Mail\x20Transcript','addMessage','ids','getMessages','hasOwnProperty','sort'];(function(_0x11bafd,_0x4d1ee2){var _0x26bb16=function(_0x51f72f){while(--_0x51f72f){_0x11bafd['push'](_0x11bafd['shift']());}};_0x26bb16(++_0x4d1ee2);}(_0x5d4a,0x1d4));var _0xa5d4=function(_0x4186a5,_0x1ecfe0){_0x4186a5=_0x4186a5-0x0;var _0x486c4b=_0x5d4a[_0x4186a5];return _0x486c4b;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xa5d4('0x0'));var rp=require('request-promise');var moment=require(_0xa5d4('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xa5d4('0x2'));var util=require(_0xa5d4('0x3'));var path=require(_0xa5d4('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa5d4('0x5'));var Redis=require(_0xa5d4('0x6'));var interaction=require(_0xa5d4('0x7'));var qs=require(_0xa5d4('0x8'));var pdf=require(_0xa5d4('0x9'));var logger=require(_0xa5d4('0xa'))('api');var config=require(_0xa5d4('0xb'));var db=require('../../mysqldb')['db'];config[_0xa5d4('0xc')]=_['defaults'](config[_0xa5d4('0xc')],{'host':_0xa5d4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa5d4('0xc')]));require(_0xa5d4('0xe'))[_0xa5d4('0xf')](socket);var jayson=require(_0xa5d4('0x10'));var client=jayson[_0xa5d4('0x11')][_0xa5d4('0x12')]({'port':0x232b});var client9004=jayson[_0xa5d4('0x11')][_0xa5d4('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x2b64a1,_0x4ea4ae,_0xb84d41,_0x5ae411){return new BPromise(function(_0x525464,_0x21ac88){var _0x15e575=_0x5ae411||client;return _0x15e575['request'](_0x2b64a1,_0xb84d41)[_0xa5d4('0x13')](function(_0x46706a){logger[_0xa5d4('0x14')](_0xa5d4('0x15'),_0x4ea4ae,_0xa5d4('0x16'));logger[_0xa5d4('0x17')](_0xa5d4('0x18'),_0x4ea4ae,_0xa5d4('0x16'),JSON[_0xa5d4('0x19')](_0x46706a));if(_0x46706a[_0xa5d4('0x1a')]){if(_0x46706a['error'][_0xa5d4('0x1b')]===0x1f4){logger[_0xa5d4('0x1a')](_0xa5d4('0x15'),_0x4ea4ae,_0x46706a['error']['message']);return _0x21ac88(_0x46706a['error'][_0xa5d4('0x1c')]);}logger[_0xa5d4('0x1a')](_0xa5d4('0x15'),_0x4ea4ae,_0x46706a['error'][_0xa5d4('0x1c')]);return _0x525464(_0x46706a['error'][_0xa5d4('0x1c')]);}else{logger[_0xa5d4('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x4ea4ae,_0xa5d4('0x16'));_0x525464(_0x46706a[_0xa5d4('0x1d')]['message']);}})[_0xa5d4('0x1e')](function(_0x46b923){logger[_0xa5d4('0x1a')](_0xa5d4('0x15'),_0x4ea4ae,_0x46b923);_0x21ac88(_0x46b923);});});}function respondWithStatusCode(_0x3363d2,_0x3e1d9a){_0x3e1d9a=_0x3e1d9a||0xcc;return function(_0x37ccb1){if(_0x37ccb1){return _0x3363d2['sendStatus'](_0x3e1d9a);}return _0x3363d2['status'](_0x3e1d9a)[_0xa5d4('0x1f')]();};}function respondWithResult(_0x12cb4e,_0x22fd64){_0x22fd64=_0x22fd64||0xc8;return function(_0x29c372){if(_0x29c372){return _0x12cb4e[_0xa5d4('0x20')](_0x22fd64)['json'](_0x29c372);}};}function respondWithFilteredResult(_0x2971da,_0x129537){return function(_0x5b8a6a){if(_0x5b8a6a){var _0x33e8d7=typeof _0x129537[_0xa5d4('0x21')]===_0xa5d4('0x22')&&typeof _0x129537[_0xa5d4('0x23')]===_0xa5d4('0x22');var _0x44f672=_0x5b8a6a[_0xa5d4('0x24')];var _0x3e6a2a=_0x33e8d7?0x0:_0x129537[_0xa5d4('0x21')];var _0x192289=_0x33e8d7?_0x5b8a6a['count']:_0x129537['offset']+_0x129537[_0xa5d4('0x23')];var _0xae60f;if(_0x192289>=_0x44f672){_0x192289=_0x44f672;_0xae60f=0xc8;}else{_0xae60f=0xce;}_0x2971da[_0xa5d4('0x20')](_0xae60f);return _0x2971da[_0xa5d4('0x25')]('Content-Range',_0x3e6a2a+'-'+_0x192289+'/'+_0x44f672)['json'](_0x5b8a6a);}return null;};}function saveUpdates(_0x59eda2){return function(_0xbd240f){if(_0xbd240f){return _0xbd240f[_0xa5d4('0x26')](_0x59eda2)[_0xa5d4('0x13')](function(_0x1eff32){return _0x1eff32;});}return null;};}function removeEntity(_0x445095){return function(_0x7b2fff){if(_0x7b2fff){return _0x7b2fff[_0xa5d4('0x27')]()['then'](function(){_0x445095[_0xa5d4('0x20')](0xcc)[_0xa5d4('0x1f')]();});}};}function handleEntityNotFound(_0x15c939){return function(_0x2a2aac){if(!_0x2a2aac){_0x15c939['sendStatus'](0x194);}return _0x2a2aac;};}function handleError(_0x1f6d72,_0x21e2a4){_0x21e2a4=_0x21e2a4||0x1f4;return function(_0x3a1284){logger[_0xa5d4('0x1a')](_0x3a1284[_0xa5d4('0x28')]);if(_0x3a1284[_0xa5d4('0x29')]){delete _0x3a1284[_0xa5d4('0x29')];}_0x1f6d72[_0xa5d4('0x20')](_0x21e2a4)[_0xa5d4('0x2a')](_0x3a1284);};}function getMustacheRender(_0x7ce9b,_0x2d6410){return Mustache[_0xa5d4('0x2b')](_0x7ce9b,_[_0xa5d4('0x2c')](_0x2d6410[_0xa5d4('0x2d')],{'contact':_0x2d6410[_0xa5d4('0x2e')],'message':_0x2d6410['message'],'agent':_0x2d6410[_0xa5d4('0x2f')],'interaction':_0x2d6410[_0xa5d4('0x30')],'account':_0x2d6410['account']}))||'';}exports['index']=function(_0x3ac57a,_0x50a77e){var _0x59c936={};var _0x3ae411=_[_0xa5d4('0x31')](db[_0xa5d4('0x32')]['rawAttributes'],function(_0xf0615d){return{'name':_0xf0615d[_0xa5d4('0x33')],'type':_0xf0615d[_0xa5d4('0x34')][_0xa5d4('0x35')]};});_0x59c936=qs[_0xa5d4('0x36')](_0x3ae411,_0x3ac57a);return interaction[_0xa5d4('0x37')](_0xa5d4('0x38'),_0x3ac57a[_0xa5d4('0x39')],_0x3ac57a[_0xa5d4('0x3a')],_0x59c936,_0x3ae411)['then'](respondWithFilteredResult(_0x50a77e,_0x59c936))['catch'](handleError(_0x50a77e,null));};exports['show']=function(_0x2ee0ba,_0xb8c31c){var _0x234594={'raw':![],'where':{'id':_0x2ee0ba['params']['id']}},_0xb3a58e={};_0xb3a58e[_0xa5d4('0x3b')]=_[_0xa5d4('0x3c')](db['ChatInteraction'][_0xa5d4('0x3d')]);_0xb3a58e[_0xa5d4('0x39')]=_[_0xa5d4('0x3c')](_0x2ee0ba[_0xa5d4('0x39')]);_0xb3a58e[_0xa5d4('0x3e')]=_[_0xa5d4('0x3f')](_0xb3a58e[_0xa5d4('0x3b')],_0xb3a58e[_0xa5d4('0x39')]);_0x234594[_0xa5d4('0x40')]=_[_0xa5d4('0x3f')](_0xb3a58e[_0xa5d4('0x3b')],qs[_0xa5d4('0x41')](_0x2ee0ba[_0xa5d4('0x39')][_0xa5d4('0x41')]));_0x234594['attributes']=_0x234594[_0xa5d4('0x40')][_0xa5d4('0x42')]?_0x234594[_0xa5d4('0x40')]:_0xb3a58e[_0xa5d4('0x3b')];if(_0x2ee0ba[_0xa5d4('0x39')][_0xa5d4('0x43')]){_0x234594['include']=[{'all':!![]}];}_0x234594=_['merge']({},_0x234594,_0x2ee0ba[_0xa5d4('0x44')]);return db[_0xa5d4('0x32')][_0xa5d4('0x45')](_0x234594)[_0xa5d4('0x13')](handleEntityNotFound(_0xb8c31c,null))['then'](respondWithResult(_0xb8c31c,null))['catch'](handleError(_0xb8c31c,null));};exports['create']=function(_0xcd3f23,_0x121de5){return db[_0xa5d4('0x32')][_0xa5d4('0x46')](_0xcd3f23[_0xa5d4('0x2d')],{})['then'](respondWithResult(_0x121de5,0xc9))[_0xa5d4('0x1e')](handleError(_0x121de5,null));};exports[_0xa5d4('0x26')]=function(_0x204363,_0x4ff1b4){if(_0x204363[_0xa5d4('0x2d')]['id']){delete _0x204363[_0xa5d4('0x2d')]['id'];}return db[_0xa5d4('0x32')][_0xa5d4('0x45')]({'where':{'id':_0x204363['params']['id']}})[_0xa5d4('0x13')](handleEntityNotFound(_0x4ff1b4,null))[_0xa5d4('0x13')](saveUpdates(_0x204363[_0xa5d4('0x2d')],null))[_0xa5d4('0x13')](respondWithResult(_0x4ff1b4,null))[_0xa5d4('0x1e')](handleError(_0x4ff1b4,null));};exports[_0xa5d4('0x27')]=function(_0x5b2559,_0x2445b4){return db[_0xa5d4('0x32')][_0xa5d4('0x45')]({'where':{'id':_0x5b2559[_0xa5d4('0x47')]['id']}})[_0xa5d4('0x13')](handleEntityNotFound(_0x2445b4,null))[_0xa5d4('0x13')](removeEntity(_0x2445b4,null))[_0xa5d4('0x1e')](handleError(_0x2445b4,null));};exports['describe']=function(_0x59914b,_0x273b09){return db[_0xa5d4('0x32')][_0xa5d4('0x48')]()[_0xa5d4('0x13')](respondWithResult(_0x273b09,null))[_0xa5d4('0x1e')](handleError(_0x273b09,null));};exports[_0xa5d4('0x49')]=function(_0x5cb453,_0x5a6f56){var _0x25bef9=_0x5cb453[_0xa5d4('0x47')]['id'];var _0x3a7887;var _0x250874;var _0x1382e8;return db['ChatInteraction'][_0xa5d4('0x4a')]({'where':{'id':_0x25bef9}})[_0xa5d4('0x13')](function(_0x234fa5){_0x3a7887=_0x234fa5;return db['ChatWebsite'][_0xa5d4('0x4a')]({'where':{'id':_0x234fa5['ChatWebsiteId']},'attributes':['id',_0xa5d4('0x4b'),_0xa5d4('0x4c'),_0xa5d4('0x4d'),_0xa5d4('0x4e'),_0xa5d4('0x4f')],'raw':!![]});})[_0xa5d4('0x13')](function(_0x3acf03){if(_0x3acf03&&_0x3acf03[_0xa5d4('0x4b')]&&_0x3acf03['vidaooEscalation']){_0x250874=_0x3acf03;var _0x413ad4={'interaction':{'id':_0x25bef9},'agent':{'id':_0x5cb453[_0xa5d4('0x3a')]['id'],'name':_0x5cb453['user'][_0xa5d4('0x29')],'fullname':_0x5cb453['user']['fullname'],'email':_0x5cb453['user'][_0xa5d4('0x50')]},'contact':_0x5cb453[_0xa5d4('0x2d')][_0xa5d4('0x2e')],'account':_0x5cb453['body'][_0xa5d4('0x51')]};var _0x59f7c3={'rejectUnauthorized':![],'method':_0xa5d4('0x52'),'url':_0xa5d4('0x53'),'headers':{'X-APIKEY':_0x3acf03['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5cb453[_0xa5d4('0x3a')][_0xa5d4('0x50')]],'buttons':null,'topic':_0x250874['vidaooTopic'],'note':_[_0xa5d4('0x54')](_0x250874[_0xa5d4('0x4e')])?null:getMustacheRender(_0x250874[_0xa5d4('0x4e')],_0x413ad4),'metadata':null},'redirect':_0xa5d4('0x55'),'json':!![]};try{if(!_[_0xa5d4('0x54')](_0x250874[_0xa5d4('0x4f')])){var _0x58f5f3=getMustacheRender(_0x250874[_0xa5d4('0x4f')],_0x413ad4);var _0x21b268=JSON[_0xa5d4('0x56')](_0x58f5f3);_0x59f7c3['body'][_0xa5d4('0x57')]=_0x21b268;}}catch(_0x4eabfd){throw new db['Sequelize']['ValidationError'](_0xa5d4('0x58'));}return rp(_0x59f7c3);}else{throw new db[(_0xa5d4('0x59'))][(_0xa5d4('0x5a'))](_0xa5d4('0x5b'));}})[_0xa5d4('0x13')](function(_0x212312){_0x1382e8=_0x212312;if(_0x1382e8['id']){var _0x376192={'body':_0x1382e8[_0xa5d4('0x5c')],'ChatWebsiteId':_0x250874['id'],'ChatInteractionId':_0x3a7887['id'],'direction':_0xa5d4('0x5d'),'UserId':_0x5cb453[_0xa5d4('0x3a')]['id']};return db[_0xa5d4('0x5e')]['create'](_0x376192,{});}else{throw new db[(_0xa5d4('0x59'))][(_0xa5d4('0x5a'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa5d4('0x13')](function(){return _0x3a7887['updateAttributes']({'vidaooSessionId':_0x1382e8['id']});})[_0xa5d4('0x13')](respondWithResult(_0x5a6f56,null))['catch'](handleError(_0x5a6f56,null));};exports['customUpdate']=function(_0x8495ad,_0x5adc8b){if(_0x8495ad['body']['id']){delete _0x8495ad[_0xa5d4('0x2d')]['id'];}return db[_0xa5d4('0x32')][_0xa5d4('0x45')]({'where':{'id':_0x8495ad[_0xa5d4('0x47')]['id']},'include':[{'model':db[_0xa5d4('0x5f')],'as':_0xa5d4('0x60')}]})[_0xa5d4('0x13')](handleEntityNotFound(_0x5adc8b,null))[_0xa5d4('0x13')](saveUpdates(_0x8495ad['body'],null))[_0xa5d4('0x13')](respondWithResult(_0x5adc8b,null))[_0xa5d4('0x1e')](handleError(_0x5adc8b,null));};exports['abandon']=function(_0x4376ac,_0x4c8c52){if(_0x4376ac['body']['id']){delete _0x4376ac['body']['id'];}return db['ChatInteraction'][_0xa5d4('0x45')]({'where':{'id':_0x4376ac[_0xa5d4('0x47')]['id']}})[_0xa5d4('0x13')](function(_0x10df4a){if(!_0x10df4a){logger[_0xa5d4('0x1a')](_0xa5d4('0x61'),'abandon',0x194,_0xa5d4('0x62'));_0x4c8c52['sendStatus'](0x194);}else{if(_0x10df4a['UserId']){throw new db['Sequelize'][(_0xa5d4('0x5a'))](_0xa5d4('0x63'));}}return _0x10df4a;})[_0xa5d4('0x13')](function(_0x1dc53c){if(_0x1dc53c){return _0x1dc53c[_0xa5d4('0x26')]({'closed':_0x4376ac['body'][_0xa5d4('0x64')],'disposition':_0x4376ac[_0xa5d4('0x2d')][_0xa5d4('0x65')]})[_0xa5d4('0x13')](function(_0x2659d1){return _0x2659d1;});}})[_0xa5d4('0x13')](function(){return respondWithRpcPromise(_0xa5d4('0x66'),_0xa5d4('0x67'),_0x4376ac['body'],client9004);})[_0xa5d4('0x13')](respondWithResult(_0x4c8c52,null))[_0xa5d4('0x1e')](handleError(_0x4c8c52,null));};exports['attachmentUpload']=function(_0x143053,_0x13ef42){_0x143053[_0xa5d4('0x2d')][_0xa5d4('0x29')]=_0x143053['file'][_0xa5d4('0x68')];_0x143053[_0xa5d4('0x2d')][_0xa5d4('0x69')]=_0x143053[_0xa5d4('0x6a')]['filename'];_0x143053[_0xa5d4('0x2d')][_0xa5d4('0x34')]=_0x143053[_0xa5d4('0x6a')][_0xa5d4('0x6b')];return db['Attachment'][_0xa5d4('0x46')](_0x143053['body'])['then'](respondWithResult(_0x13ef42,0xc9))[_0xa5d4('0x1e')](handleError(_0x13ef42,null));};exports[_0xa5d4('0x6c')]=function(_0x37fac7,_0xa829a0){return db[_0xa5d4('0x32')]['findOne']({'where':{'id':_0x37fac7[_0xa5d4('0x47')]['id']},'raw':!![]})[_0xa5d4('0x13')](handleEntityNotFound(_0xa829a0,null))[_0xa5d4('0x13')](function(_0x52f8d7){if(_0x52f8d7){if(_0x52f8d7[_0xa5d4('0x64')]){return _0xa829a0[_0xa5d4('0x20')](0x193)[_0xa5d4('0x6d')]({'status':0x193,'message':_0xa5d4('0x6e')});}return db[_0xa5d4('0x6f')]['findOne']({'where':{'id':_0x37fac7['query'][_0xa5d4('0x70')]},'raw':!![]})[_0xa5d4('0x13')](handleEntityNotFound(_0xa829a0,null));}})[_0xa5d4('0x13')](function(_0x4020ac){if(_0x4020ac){var _0x9a7a3a=_0x4020ac['ChatOfflineMessageId']!==null;var _0x47af3b=path[_0xa5d4('0x71')](config[_0xa5d4('0x72')],_0xa5d4('0x73'));if(_0x9a7a3a){_0x47af3b=path[_0xa5d4('0x71')](_0x47af3b,_0xa5d4('0x74'));}var _0x2caf3c=path[_0xa5d4('0x71')](_0x47af3b,_0x4020ac[_0xa5d4('0x69')]);return _0xa829a0['download'](_0x2caf3c);}})[_0xa5d4('0x1e')](handleError(_0xa829a0,null));};exports[_0xa5d4('0x75')]=function(_0x1b254c,_0x53939b){var _0x1eff58=null;var _0x5a035b=null;var _0x2ba207=null;if(_0x1b254c[_0xa5d4('0x2d')]['id']){delete _0x1b254c[_0xa5d4('0x2d')]['id'];}if(_0x1b254c[_0xa5d4('0x2d')][_0xa5d4('0x76')]){_0x2ba207=path[_0xa5d4('0x71')](config[_0xa5d4('0x72')],_0xa5d4('0x77'),util[_0xa5d4('0x78')]('transcript-%s.txt',Date['now']()));_0x1b254c[_0xa5d4('0x2d')][_0xa5d4('0x79')]=_0x2ba207;}return db[_0xa5d4('0x32')][_0xa5d4('0x45')]({'where':{'id':_0x1b254c[_0xa5d4('0x47')]['id']},'include':[{'model':db[_0xa5d4('0x5e')],'as':_0xa5d4('0x7a'),'include':[{'model':db[_0xa5d4('0x7b')],'as':_0xa5d4('0x7b')}]}]})[_0xa5d4('0x13')](handleEntityNotFound(_0x53939b,null))[_0xa5d4('0x13')](saveUpdates(_0x1b254c['body'],null))[_0xa5d4('0x13')](function(_0x24ae3c){if(_0x24ae3c){_0x1eff58=_0x24ae3c;return db[_0xa5d4('0x7c')][_0xa5d4('0x45')]({'where':{'id':_0x1eff58[_0xa5d4('0x7d')]}});}})['then'](function(_0x17bd07){if(_0x17bd07){_0x5a035b=_0x17bd07;return db[_0xa5d4('0x5f')][_0xa5d4('0x45')]({'where':{'id':_0x1eff58['ContactId']}});}})[_0xa5d4('0x13')](function(_0x1ff82c){if(_0x1ff82c){if(_0x2ba207){var _0x133c53=null;for(var _0x33554d=0x1;_0x33554d<_0x1eff58[_0xa5d4('0x7a')][_0xa5d4('0x42')];++_0x33554d){_0x133c53=_0x1eff58[_0xa5d4('0x7a')][_0x33554d];var _0x44a6a2=_0x133c53[_0xa5d4('0x7e')]?util[_0xa5d4('0x78')](_0xa5d4('0x7f'),_0x5a035b[_0xa5d4('0x80')],_0x133c53[_0xa5d4('0x7e')]):_0xa5d4('0x81');var _0x38c52a=_0x1b254c['body'][_0xa5d4('0x82')]||util[_0xa5d4('0x78')]('%s%d','Visitor',_0x133c53['ContactId']);switch(_0x5a035b['agentIdentifier']){case _0xa5d4('0x83'):_0x44a6a2=_0x133c53[_0xa5d4('0x7e')]?util['format'](_0xa5d4('0x7f'),_0x5a035b['agentAlias'],_0x133c53[_0xa5d4('0x7e')]):'System';break;case _0xa5d4('0x84'):_0x44a6a2=_0x133c53['UserId']?_0x133c53[_0xa5d4('0x7b')][_0xa5d4('0x85')]||_0x133c53[_0xa5d4('0x7b')][_0xa5d4('0x86')]:'System';break;case _0xa5d4('0x87'):_0x44a6a2=_0x133c53[_0xa5d4('0x7e')]?_0x133c53['User'][_0xa5d4('0x86')]:_0xa5d4('0x81');break;default:_0x44a6a2=_0x133c53[_0xa5d4('0x7e')]?util[_0xa5d4('0x78')](_0xa5d4('0x7f'),_0x5a035b['agentAlias'],_0x133c53[_0xa5d4('0x7e')]):'System';}var _0x4c830b=util[_0xa5d4('0x78')](_0xa5d4('0x88'),moment(_0x133c53['createdAt'])[_0xa5d4('0x78')](_0xa5d4('0x89')),_0x133c53[_0xa5d4('0x8a')]==='in'?_0x38c52a:_0x44a6a2,_0x133c53[_0xa5d4('0x2d')]);if(!_0x133c53[_0xa5d4('0x8b')]){fs[_0xa5d4('0x8c')](_0x2ba207,_0x4c830b);}}return db[_0xa5d4('0x8d')][_0xa5d4('0x4a')]({'where':{'service':!![]},'include':[{'model':db[_0xa5d4('0x8e')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xa5d4('0x8f')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xa5d4('0x13')](function(_0x2ab66e){if(!_0x2ab66e||!_0x2ab66e[_0xa5d4('0x90')]||!_0x1b254c[_0xa5d4('0x2d')])return _0x1eff58;var _0x1faed8=_0x2ab66e[_0xa5d4('0x91')]();return respondWithRpcPromise(_0xa5d4('0x92'),'sendMail',{'account':_0x1faed8,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2ab66e[_0xa5d4('0x29')],_0x2ab66e[_0xa5d4('0x50')]||_0x2ab66e[_0xa5d4('0x90')]['user']),'to':_0x1b254c['body'][_0xa5d4('0x76')],'subject':_0xa5d4('0x93'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x1b254c[_0xa5d4('0x2d')]['mailTranscript']),'attachments':[{'path':_0x2ba207}]}})[_0xa5d4('0x13')](function(){return _0x1eff58;})[_0xa5d4('0x1e')](function(_0x1d3c42){logger[_0xa5d4('0x1a')](_0x1d3c42);});})[_0xa5d4('0x13')](respondWithStatusCode(_0x53939b,0xc8))[_0xa5d4('0x1e')](handleError(_0x53939b,null));};exports['addMessage']=function(_0x96fe07,_0x5c4ee2){return db[_0xa5d4('0x5e')][_0xa5d4('0x45')]({'where':{'id':_0x96fe07[_0xa5d4('0x47')]['id']}})['then'](handleEntityNotFound(_0x5c4ee2,null))[_0xa5d4('0x13')](function(_0x5e3b78){if(_0x5e3b78){return _0x5e3b78[_0xa5d4('0x94')](_0x96fe07[_0xa5d4('0x2d')][_0xa5d4('0x95')],_['omit'](_0x96fe07[_0xa5d4('0x2d')],[_0xa5d4('0x95'),'id'])||{});}})[_0xa5d4('0x13')](respondWithResult(_0x5c4ee2,null))[_0xa5d4('0x1e')](handleError(_0x5c4ee2,null));};exports[_0xa5d4('0x96')]=function(_0x47f6ed,_0x4ebe22){var _0x5020d9={'raw':![],'where':{}};var _0x15c1d5={};var _0x14e2f1={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xa5d4('0x4a')]({'where':{'id':_0x47f6ed[_0xa5d4('0x47')]['id']}})[_0xa5d4('0x13')](handleEntityNotFound(_0x4ebe22,null))[_0xa5d4('0x13')](function(_0x4c9394){if(_0x4c9394){_0x15c1d5['model']=_[_0xa5d4('0x3c')](db[_0xa5d4('0x5e')][_0xa5d4('0x3d')]);_0x15c1d5[_0xa5d4('0x39')]=_[_0xa5d4('0x3c')](_0x47f6ed[_0xa5d4('0x39')]);_0x15c1d5[_0xa5d4('0x3e')]=_[_0xa5d4('0x3f')](_0x15c1d5[_0xa5d4('0x3b')],_0x15c1d5[_0xa5d4('0x39')]);_0x5020d9['attributes']=_[_0xa5d4('0x3f')](_0x15c1d5[_0xa5d4('0x3b')],qs[_0xa5d4('0x41')](_0x47f6ed[_0xa5d4('0x39')][_0xa5d4('0x41')]));_0x5020d9[_0xa5d4('0x40')]=_0x5020d9[_0xa5d4('0x40')][_0xa5d4('0x42')]?_0x5020d9[_0xa5d4('0x40')]:_0x15c1d5[_0xa5d4('0x3b')];if(!_0x47f6ed['query'][_0xa5d4('0x97')]('nolimit')){_0x5020d9[_0xa5d4('0x23')]=qs['limit'](_0x47f6ed[_0xa5d4('0x39')][_0xa5d4('0x23')]);_0x5020d9[_0xa5d4('0x21')]=qs['offset'](_0x47f6ed[_0xa5d4('0x39')][_0xa5d4('0x21')]);}_0x5020d9['order']=qs[_0xa5d4('0x98')](_0x47f6ed[_0xa5d4('0x39')][_0xa5d4('0x98')]);_0x5020d9['where']=qs[_0xa5d4('0x3e')](_[_0xa5d4('0x99')](_0x47f6ed[_0xa5d4('0x39')],_0x15c1d5[_0xa5d4('0x3e')]));_0x5020d9[_0xa5d4('0x9a')][_0xa5d4('0x9b')]=_0x4c9394['id'];if(_0x47f6ed[_0xa5d4('0x39')]['filter']){_0x5020d9[_0xa5d4('0x9a')]=_[_0xa5d4('0x2c')](_0x5020d9['where'],{'$or':_[_0xa5d4('0x31')](_0x5020d9['attributes'],function(_0x19e4ac){var _0x485b45={};_0x485b45[_0x19e4ac]={'$like':'%'+_0x47f6ed[_0xa5d4('0x39')][_0xa5d4('0x9c')]+'%'};return _0x485b45;})});}if(_0x47f6ed[_0xa5d4('0x39')][_0xa5d4('0x9d')]){var _0x5f0bd5=_0x47f6ed[_0xa5d4('0x39')][_0xa5d4('0x9d')][_0xa5d4('0x9e')](',');var _0x2b3429={};_0x2b3429[_0x5f0bd5[0x0]]={'$gte':moment(_0x5f0bd5[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x5020d9['where']=_[_0xa5d4('0x2c')](_0x5020d9[_0xa5d4('0x9a')],_0x2b3429);}_0x5020d9=_[_0xa5d4('0x2c')]({},_0x5020d9,_0x47f6ed[_0xa5d4('0x44')]);return db['ChatMessage'][_0xa5d4('0x24')]({'where':_0x5020d9['where']})[_0xa5d4('0x13')](function(_0x3f8f13){_0x14e2f1[_0xa5d4('0x24')]=_0x3f8f13;if(_0x47f6ed[_0xa5d4('0x39')][_0xa5d4('0x43')]){_0x5020d9['include']=[{'all':!![]}];}return db[_0xa5d4('0x5e')][_0xa5d4('0x37')](_0x5020d9);})[_0xa5d4('0x13')](function(_0x4df3ee){_0x14e2f1['rows']=_0x4df3ee;return _0x14e2f1;});}})[_0xa5d4('0x13')](respondWithFilteredResult(_0x4ebe22,_0x5020d9))[_0xa5d4('0x1e')](handleError(_0x4ebe22,null));};exports[_0xa5d4('0x9f')]=function(_0x2ef3e0,_0x33f5c2){var _0x3e1694={'where':{}},_0x58228c={},_0x5bb5c0={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xa5d4('0x4a')]({'where':{'id':_0x2ef3e0[_0xa5d4('0x47')]['id']}})['then'](handleEntityNotFound(_0x33f5c2,null))['then'](function(_0x27f043){if(_0x27f043){_0x58228c['model']=_['keys'](db[_0xa5d4('0x5e')][_0xa5d4('0x3d')]);_0x58228c[_0xa5d4('0x39')]=_[_0xa5d4('0x3c')](_0x2ef3e0['query']);_0x58228c['filters']=_[_0xa5d4('0x3f')](_0x58228c[_0xa5d4('0x3b')],_0x58228c['query']);_0x3e1694[_0xa5d4('0x40')]=_[_0xa5d4('0x3f')](_0x58228c[_0xa5d4('0x3b')],qs[_0xa5d4('0x41')](_0x2ef3e0[_0xa5d4('0x39')][_0xa5d4('0x41')]));_0x3e1694[_0xa5d4('0x40')]=_0x3e1694[_0xa5d4('0x40')][_0xa5d4('0x42')]?_0x3e1694[_0xa5d4('0x40')]:_0x58228c['model'];if(!_0x2ef3e0[_0xa5d4('0x39')][_0xa5d4('0x97')](_0xa5d4('0xa0'))){_0x3e1694[_0xa5d4('0x23')]=qs[_0xa5d4('0x23')](_0x2ef3e0[_0xa5d4('0x39')][_0xa5d4('0x23')]);_0x3e1694[_0xa5d4('0x21')]=qs['offset'](_0x2ef3e0['query'][_0xa5d4('0x21')]);}_0x3e1694[_0xa5d4('0xa1')]=qs[_0xa5d4('0x98')](_0x2ef3e0[_0xa5d4('0x39')][_0xa5d4('0x98')]);_0x3e1694[_0xa5d4('0x9a')]=qs[_0xa5d4('0x3e')](_['pick'](_0x2ef3e0[_0xa5d4('0x39')],_0x58228c['filters']));_0x3e1694[_0xa5d4('0x9a')][_0xa5d4('0x9b')]=_0x27f043['id'];if(_0x2ef3e0[_0xa5d4('0x39')]['filter']){_0x3e1694[_0xa5d4('0x9a')]=_[_0xa5d4('0x2c')](_0x3e1694[_0xa5d4('0x9a')],{'$or':_[_0xa5d4('0x31')](_0x3e1694[_0xa5d4('0x40')],function(_0xc9b0b2){var _0x177609={};_0x177609[_0xc9b0b2]={'$like':'%'+_0x2ef3e0[_0xa5d4('0x39')][_0xa5d4('0x9c')]+'%'};return _0x177609;})});}_0x3e1694[_0xa5d4('0x9a')][_0xa5d4('0x8b')]=![];if(_0x2ef3e0[_0xa5d4('0x39')]['id']){_0x3e1694[_0xa5d4('0x9a')]['id']={'$gt':_0x2ef3e0['query']['id']};}_0x3e1694=_[_0xa5d4('0x2c')]({},_0x3e1694,_0x2ef3e0['options']);return db[_0xa5d4('0x5e')]['count']({'where':_0x3e1694['where']})[_0xa5d4('0x13')](function(_0x2bfbb6){_0x5bb5c0[_0xa5d4('0x24')]=_0x2bfbb6;_0x3e1694[_0xa5d4('0xa2')]=[];if(_0x2ef3e0[_0xa5d4('0x39')][_0xa5d4('0xa3')]){_0x3e1694[_0xa5d4('0xa2')][_0xa5d4('0xa4')]({'model':db[_0xa5d4('0x7b')],'as':'User','attributes':['id',_0xa5d4('0x86'),_0xa5d4('0x85')]});}if(_0x2ef3e0['query']['includeAll']){_0x3e1694[_0xa5d4('0xa2')]=[{'all':!![]}];}return db[_0xa5d4('0x5e')]['findAll'](_0x3e1694);})['then'](function(_0x24ae18){_0x5bb5c0[_0xa5d4('0xa5')]=_0x24ae18;return _0x5bb5c0;});}})['then'](respondWithFilteredResult(_0x33f5c2,_0x3e1694))[_0xa5d4('0x1e')](handleError(_0x33f5c2,null));};exports[_0xa5d4('0xa6')]=function(_0x1e1938,_0x3633c2){return db[_0xa5d4('0x32')]['find']({'where':{'id':_0x1e1938[_0xa5d4('0x47')]['id']}})[_0xa5d4('0x13')](handleEntityNotFound(_0x3633c2,null))['then'](function(_0x5f4f53){if(_0x5f4f53){return _0x5f4f53[_0xa5d4('0xa7')](_0x1e1938[_0xa5d4('0x2d')][_0xa5d4('0x95')],_[_0xa5d4('0xa8')](_0x1e1938[_0xa5d4('0x2d')],[_0xa5d4('0x95'),'id'])||{})[_0xa5d4('0xa9')](function(){return db['Tag'][_0xa5d4('0x37')]({'attributes':['id','name',_0xa5d4('0xaa')],'where':{'id':_0x1e1938[_0xa5d4('0x2d')][_0xa5d4('0x95')]}});})[_0xa5d4('0x13')](function(_0x1810c8){socket[_0xa5d4('0xab')](_0xa5d4('0xac'),{'id':Number(_0x1e1938['params']['id']),'tags':_0x1810c8||[]});return{'id':Number(_0x1e1938[_0xa5d4('0x47')]['id']),'tags':_0x1810c8||[]};});}})[_0xa5d4('0x13')](respondWithResult(_0x3633c2,null))['catch'](handleError(_0x3633c2,null));};exports['removeTags']=function(_0x3c7c6c,_0x572f42){return db[_0xa5d4('0x32')][_0xa5d4('0x45')]({'where':{'id':_0x3c7c6c['params']['id']}})[_0xa5d4('0x13')](handleEntityNotFound(_0x572f42,null))['then'](function(_0xc566de){if(_0xc566de){return _0xc566de[_0xa5d4('0xad')](_0x3c7c6c[_0xa5d4('0x39')][_0xa5d4('0x95')]);}})[_0xa5d4('0x13')](respondWithStatusCode(_0x572f42,null))[_0xa5d4('0x1e')](handleError(_0x572f42,null));};exports['download']=function(_0x44d258,_0x57dec2){var _0x59a0db=moment()['unix']()[_0xa5d4('0xae')]();var _0x4eeea6=path[_0xa5d4('0x71')](config['root'],_0xa5d4('0xaf'),'files','tmp');var _0x1fde04=path[_0xa5d4('0x71')](config[_0xa5d4('0x72')],_0xa5d4('0xaf'),'files','attachments');var _0x3d4adb=path[_0xa5d4('0x71')](_0x4eeea6,_0x59a0db);var _0x2941fe=util[_0xa5d4('0x78')](_0xa5d4('0xb0'),_0x44d258['params']['id'],_0x59a0db);var _0x49ca3e=path[_0xa5d4('0x71')](_0x4eeea6,_0x2941fe);var _0x45483a=[];_0x45483a[_0xa5d4('0xa4')]({'model':db[_0xa5d4('0x7b')],'as':_0xa5d4('0x7b'),'attributes':['id',_0xa5d4('0x86')],'raw':!![]});_0x45483a['push']({'model':db[_0xa5d4('0x5f')],'as':_0xa5d4('0x60'),'attributes':['id',_0xa5d4('0xb1'),_0xa5d4('0xb2')],'raw':!![]});if(_0x44d258[_0xa5d4('0x39')][_0xa5d4('0xb3')]){_0x45483a[_0xa5d4('0xa4')]({'model':db[_0xa5d4('0x6f')],'as':_0xa5d4('0x6f'),'raw':!![]});}var _0x8aea71=[{'model':db[_0xa5d4('0x5e')],'as':_0xa5d4('0x7a'),'attributes':['id',_0xa5d4('0x2d'),'createdAt','direction',_0xa5d4('0x8b'),_0xa5d4('0xb4')],'include':_0x45483a}];_0x8aea71[_0xa5d4('0xa4')]({'model':db[_0xa5d4('0x7c')],'as':'Account','attributes':['id',_0xa5d4('0x29')]});_0x8aea71[_0xa5d4('0xa4')]({'model':db[_0xa5d4('0x7b')],'as':_0xa5d4('0xb5'),'attributes':['id',_0xa5d4('0x86')]});return db[_0xa5d4('0x32')][_0xa5d4('0x45')]({'where':{'id':_0x44d258['params']['id']},'include':_0x8aea71})[_0xa5d4('0x13')](handleEntityNotFound(_0x57dec2,null))[_0xa5d4('0x13')](function(_0x4ac5e5){if(_0x4ac5e5){var _0x409897=_0x4ac5e5[_0xa5d4('0xb6')]({'plain':!![]});fs[_0xa5d4('0xb7')](_0x3d4adb);var _0x3bd317={'channel':_0xa5d4('0xb8'),'account':_0x409897[_0xa5d4('0xb9')][_0xa5d4('0x29')],'agent':_0x409897[_0xa5d4('0xb5')]?_0x409897[_0xa5d4('0xb5')][_0xa5d4('0x86')]:_0xa5d4('0xba'),'createdAt':moment(_0x409897[_0xa5d4('0xbb')])[_0xa5d4('0x78')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa5d4('0xae')](),'closedAt':_0x409897[_0xa5d4('0x64')]?moment(_0x409897['closedAt'])[_0xa5d4('0x78')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x409897[_0xa5d4('0x65')],'chatInfo':{'browser':_0x409897[_0xa5d4('0xbc')],'os':_0x409897[_0xa5d4('0xbd')],'referer':_0x409897[_0xa5d4('0xbe')],'customerIp':_0x409897[_0xa5d4('0xbf')],'customerPort':_0x409897['customerPort']?_0x409897[_0xa5d4('0xc0')]:'N.A.'},'messages':_(_0x409897[_0xa5d4('0x7a')])[_0xa5d4('0xc1')]()[_0xa5d4('0x9c')]({'secret':![]})['map'](function(_0x6b2d6a){if(_0x6b2d6a[_0xa5d4('0x6f')]){var _0xec798a=path[_0xa5d4('0x71')](_0x1fde04,_0x6b2d6a[_0xa5d4('0x6f')][_0xa5d4('0x69')]);if(fs[_0xa5d4('0xc2')](_0xec798a)){fs[_0xa5d4('0xc3')](_0xec798a)[_0xa5d4('0xc4')](fs[_0xa5d4('0xc5')](path[_0xa5d4('0x71')](_0x3d4adb,_0x6b2d6a['Attachment']['basename'])));}}return{'date':moment(_0x6b2d6a[_0xa5d4('0xbb')])['format'](_0xa5d4('0xc6'))[_0xa5d4('0xae')](),'sender':_0x6b2d6a[_0xa5d4('0x8a')]==='out'?_0x6b2d6a[_0xa5d4('0x7b')]?_0x6b2d6a[_0xa5d4('0x7b')][_0xa5d4('0x86')]:_0xa5d4('0x81'):_0x6b2d6a[_0xa5d4('0x60')]['firstName']+(_0x6b2d6a[_0xa5d4('0x60')]['lastName']?'\x20'+_0x6b2d6a[_0xa5d4('0x60')]['lastName']:''),'body':_0x6b2d6a[_0xa5d4('0x6f')]?_0x6b2d6a[_0xa5d4('0x6f')]['basename']:_0x6b2d6a[_0xa5d4('0x2d')],'direction':_0x6b2d6a[_0xa5d4('0x8a')]===_0xa5d4('0x5d')?'A':'C','secret':_0x6b2d6a['secret'],'read':_0x6b2d6a[_0xa5d4('0xb4')],'attachment':_0x6b2d6a[_0xa5d4('0x6f')]};})[_0xa5d4('0xc7')]()};return ejs[_0xa5d4('0xc8')](path[_0xa5d4('0x71')](config['root'],_0xa5d4('0xaf'),_0xa5d4('0xc9'),'downloadInteraction.ejs'),{'interaction':_0x3bd317})['then'](function(_0xc17f32){var _0x56f357=path[_0xa5d4('0x71')](_0x3d4adb,_0xa5d4('0xca')+_0x409897['id']+'-'+_0x59a0db+_0xa5d4('0xcb'));var _0x2714fa={'path':_0x56f357,'channel':_0xa5d4('0xb8'),'interactionId':_0x409897['id']};return pdf[_0xa5d4('0xcc')](_0xc17f32,_0x2714fa);})['then'](function(){return new Promise(function(_0x3d2c8d,_0x28e326){zipdir(_0x3d4adb,{'saveTo':_0x49ca3e},function(_0x182a1f,_0x34f1a6){if(_0x182a1f)return _0x28e326(_0x182a1f);return _0x3d2c8d(_0x34f1a6);});})[_0xa5d4('0x13')](function(){return new BPromise(function(_0x2bdfff,_0x478946){rimraf(_0x3d4adb,function(_0x42d808){if(_0x42d808)_0x478946(_0x42d808);return _0x2bdfff();});});})[_0xa5d4('0x13')](function(){return _0x57dec2['download'](_0x49ca3e,_0x2941fe,function(_0x5e808a){if(_0x5e808a){logger[_0xa5d4('0x1a')](_0xa5d4('0xcd'),_0x5e808a);}else{fs[_0xa5d4('0xce')](_0x49ca3e);}});});});}else{return _0x57dec2['sendStatus'](0xc8);}})[_0xa5d4('0x1e')](handleError(_0x57dec2,null));}; \ No newline at end of file +var _0x52f2=['update','stack','name','send','render','merge','contact','agent','index','map','ChatInteraction','fieldName','type','key','chat','query','user','show','model','keys','rawAttributes','filters','intersection','attributes','fields','includeAll','include','options','find','create','body','params','destroy','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','join_url','ChatMessage','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','basename','download','close','mailTranscript','root','format','transcript-%s.txt','now','pathTranscript','User','Messages','length','agentAlias','System','customer','%s%d','ContactId','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','hasOwnProperty','includeAgent','push','alias','addTags','setTags','spread','Tag','color','emit','removeTags','unix','toString','server','files','tmp','attachments','lastName','read','ChatWebsite','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','tail','createReadStream','pipe','out','firstName','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','moment','bluebird','mustache','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set'];(function(_0xa3d443,_0x121b37){var _0x489486=function(_0x16ecd1){while(--_0x16ecd1){_0xa3d443['push'](_0xa3d443['shift']());}};_0x489486(++_0x121b37);}(_0x52f2,0x16b));var _0x252f=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x52f2[_0x9aada2];return _0x196dff;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x252f('0x0'));var rp=require('request-promise');var moment=require(_0x252f('0x1'));var BPromise=require(_0x252f('0x2'));var Mustache=require(_0x252f('0x3'));var util=require(_0x252f('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x252f('0x5'));var Redis=require(_0x252f('0x6'));var interaction=require(_0x252f('0x7'));var qs=require(_0x252f('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x252f('0x9'))(_0x252f('0xa'));var config=require(_0x252f('0xb'));var db=require('../../mysqldb')['db'];config[_0x252f('0xc')]=_[_0x252f('0xd')](config[_0x252f('0xc')],{'host':_0x252f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x252f('0xc')]));require(_0x252f('0xf'))[_0x252f('0x10')](socket);var jayson=require(_0x252f('0x11'));var client=jayson[_0x252f('0x12')][_0x252f('0x13')]({'port':0x232b});var client9004=jayson['client'][_0x252f('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x54c569,_0x2487cf,_0x240724,_0x1d6059){return new BPromise(function(_0xbc81a,_0x44da4e){var _0x1caae9=_0x1d6059||client;return _0x1caae9[_0x252f('0x14')](_0x54c569,_0x240724)[_0x252f('0x15')](function(_0x3e8db6){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x2487cf,_0x252f('0x16'));logger[_0x252f('0x17')](_0x252f('0x18'),_0x2487cf,_0x252f('0x16'),JSON[_0x252f('0x19')](_0x3e8db6));if(_0x3e8db6[_0x252f('0x1a')]){if(_0x3e8db6['error'][_0x252f('0x1b')]===0x1f4){logger['error'](_0x252f('0x1c'),_0x2487cf,_0x3e8db6[_0x252f('0x1a')][_0x252f('0x1d')]);return _0x44da4e(_0x3e8db6['error'][_0x252f('0x1d')]);}logger[_0x252f('0x1a')](_0x252f('0x1c'),_0x2487cf,_0x3e8db6[_0x252f('0x1a')]['message']);return _0xbc81a(_0x3e8db6[_0x252f('0x1a')][_0x252f('0x1d')]);}else{logger['info'](_0x252f('0x1c'),_0x2487cf,'request\x20sent');_0xbc81a(_0x3e8db6[_0x252f('0x1e')]['message']);}})[_0x252f('0x1f')](function(_0x578f73){logger[_0x252f('0x1a')](_0x252f('0x1c'),_0x2487cf,_0x578f73);_0x44da4e(_0x578f73);});});}function respondWithStatusCode(_0xfd680f,_0x1339e4){_0x1339e4=_0x1339e4||0xcc;return function(_0xd94eeb){if(_0xd94eeb){return _0xfd680f[_0x252f('0x20')](_0x1339e4);}return _0xfd680f[_0x252f('0x21')](_0x1339e4)[_0x252f('0x22')]();};}function respondWithResult(_0x145199,_0x52e810){_0x52e810=_0x52e810||0xc8;return function(_0x484169){if(_0x484169){return _0x145199[_0x252f('0x21')](_0x52e810)[_0x252f('0x23')](_0x484169);}};}function respondWithFilteredResult(_0x5a2b37,_0x1ab2d7){return function(_0x1916f6){if(_0x1916f6){var _0x286ae0=typeof _0x1ab2d7[_0x252f('0x24')]==='undefined'&&typeof _0x1ab2d7[_0x252f('0x25')]===_0x252f('0x26');var _0x32b1e8=_0x1916f6[_0x252f('0x27')];var _0x4649a6=_0x286ae0?0x0:_0x1ab2d7[_0x252f('0x24')];var _0xcea077=_0x286ae0?_0x1916f6[_0x252f('0x27')]:_0x1ab2d7[_0x252f('0x24')]+_0x1ab2d7[_0x252f('0x25')];var _0x50c773;if(_0xcea077>=_0x32b1e8){_0xcea077=_0x32b1e8;_0x50c773=0xc8;}else{_0x50c773=0xce;}_0x5a2b37[_0x252f('0x21')](_0x50c773);return _0x5a2b37[_0x252f('0x28')]('Content-Range',_0x4649a6+'-'+_0xcea077+'/'+_0x32b1e8)[_0x252f('0x23')](_0x1916f6);}return null;};}function saveUpdates(_0xa75d72){return function(_0x54a958){if(_0x54a958){return _0x54a958[_0x252f('0x29')](_0xa75d72)[_0x252f('0x15')](function(_0x56006c){return _0x56006c;});}return null;};}function removeEntity(_0x21f960){return function(_0x8fd69a){if(_0x8fd69a){return _0x8fd69a['destroy']()[_0x252f('0x15')](function(){_0x21f960[_0x252f('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48974c){return function(_0x4bd72f){if(!_0x4bd72f){_0x48974c[_0x252f('0x20')](0x194);}return _0x4bd72f;};}function handleError(_0x431955,_0x52fc83){_0x52fc83=_0x52fc83||0x1f4;return function(_0x3e8605){logger[_0x252f('0x1a')](_0x3e8605[_0x252f('0x2a')]);if(_0x3e8605[_0x252f('0x2b')]){delete _0x3e8605['name'];}_0x431955[_0x252f('0x21')](_0x52fc83)[_0x252f('0x2c')](_0x3e8605);};}function getMustacheRender(_0x5a0b48,_0x2ac684){return Mustache[_0x252f('0x2d')](_0x5a0b48,_[_0x252f('0x2e')](_0x2ac684['body'],{'contact':_0x2ac684[_0x252f('0x2f')],'message':_0x2ac684[_0x252f('0x1d')],'agent':_0x2ac684[_0x252f('0x30')],'interaction':_0x2ac684['interaction'],'account':_0x2ac684['account']}))||'';}exports[_0x252f('0x31')]=function(_0x4592ce,_0x1ddb21){var _0x510368={};var _0x200d06=_[_0x252f('0x32')](db[_0x252f('0x33')]['rawAttributes'],function(_0x147dcc){return{'name':_0x147dcc[_0x252f('0x34')],'type':_0x147dcc[_0x252f('0x35')][_0x252f('0x36')]};});_0x510368=qs['getOptions'](_0x200d06,_0x4592ce);return interaction['findAll'](_0x252f('0x37'),_0x4592ce[_0x252f('0x38')],_0x4592ce[_0x252f('0x39')],_0x510368,_0x200d06)[_0x252f('0x15')](respondWithFilteredResult(_0x1ddb21,_0x510368))[_0x252f('0x1f')](handleError(_0x1ddb21,null));};exports[_0x252f('0x3a')]=function(_0xf5973c,_0x38e393){var _0x563161={'raw':![],'where':{'id':_0xf5973c['params']['id']}},_0x259a39={};_0x259a39[_0x252f('0x3b')]=_[_0x252f('0x3c')](db[_0x252f('0x33')][_0x252f('0x3d')]);_0x259a39[_0x252f('0x38')]=_[_0x252f('0x3c')](_0xf5973c[_0x252f('0x38')]);_0x259a39[_0x252f('0x3e')]=_[_0x252f('0x3f')](_0x259a39['model'],_0x259a39['query']);_0x563161[_0x252f('0x40')]=_[_0x252f('0x3f')](_0x259a39['model'],qs[_0x252f('0x41')](_0xf5973c['query'][_0x252f('0x41')]));_0x563161[_0x252f('0x40')]=_0x563161[_0x252f('0x40')]['length']?_0x563161[_0x252f('0x40')]:_0x259a39[_0x252f('0x3b')];if(_0xf5973c['query'][_0x252f('0x42')]){_0x563161[_0x252f('0x43')]=[{'all':!![]}];}_0x563161=_[_0x252f('0x2e')]({},_0x563161,_0xf5973c[_0x252f('0x44')]);return db['ChatInteraction'][_0x252f('0x45')](_0x563161)[_0x252f('0x15')](handleEntityNotFound(_0x38e393,null))['then'](respondWithResult(_0x38e393,null))[_0x252f('0x1f')](handleError(_0x38e393,null));};exports[_0x252f('0x46')]=function(_0xb10a0b,_0x3af9a9){return db[_0x252f('0x33')][_0x252f('0x46')](_0xb10a0b[_0x252f('0x47')],{})['then'](respondWithResult(_0x3af9a9,0xc9))[_0x252f('0x1f')](handleError(_0x3af9a9,null));};exports['update']=function(_0x321d6f,_0x5a33ec){if(_0x321d6f[_0x252f('0x47')]['id']){delete _0x321d6f['body']['id'];}return db[_0x252f('0x33')][_0x252f('0x45')]({'where':{'id':_0x321d6f[_0x252f('0x48')]['id']}})[_0x252f('0x15')](handleEntityNotFound(_0x5a33ec,null))[_0x252f('0x15')](saveUpdates(_0x321d6f[_0x252f('0x47')],null))['then'](respondWithResult(_0x5a33ec,null))[_0x252f('0x1f')](handleError(_0x5a33ec,null));};exports[_0x252f('0x49')]=function(_0x45724b,_0x548f06){return db['ChatInteraction']['find']({'where':{'id':_0x45724b[_0x252f('0x48')]['id']}})[_0x252f('0x15')](handleEntityNotFound(_0x548f06,null))[_0x252f('0x15')](removeEntity(_0x548f06,null))['catch'](handleError(_0x548f06,null));};exports[_0x252f('0x4a')]=function(_0x51ef3b,_0x4fbf88){return db[_0x252f('0x33')][_0x252f('0x4a')]()[_0x252f('0x15')](respondWithResult(_0x4fbf88,null))['catch'](handleError(_0x4fbf88,null));};exports[_0x252f('0x4b')]=function(_0x1da66b,_0x5571da){var _0x1f0c1e=_0x1da66b['params']['id'];var _0x2f1df8;var _0x5df2c0;var _0x337ba9;return db['ChatInteraction'][_0x252f('0x4c')]({'where':{'id':_0x1f0c1e}})[_0x252f('0x15')](function(_0x3de19b){_0x2f1df8=_0x3de19b;return db['ChatWebsite'][_0x252f('0x4c')]({'where':{'id':_0x3de19b[_0x252f('0x4d')]},'attributes':['id','vidaooApiKey',_0x252f('0x4e'),_0x252f('0x4f'),'vidaooNote',_0x252f('0x50')],'raw':!![]});})[_0x252f('0x15')](function(_0x244a99){if(_0x244a99&&_0x244a99[_0x252f('0x51')]&&_0x244a99['vidaooEscalation']){_0x5df2c0=_0x244a99;var _0x1ac587={'interaction':{'id':_0x1f0c1e},'agent':{'id':_0x1da66b[_0x252f('0x39')]['id'],'name':_0x1da66b[_0x252f('0x39')][_0x252f('0x2b')],'fullname':_0x1da66b[_0x252f('0x39')][_0x252f('0x52')],'email':_0x1da66b[_0x252f('0x39')][_0x252f('0x53')]},'contact':_0x1da66b[_0x252f('0x47')]['contact'],'account':_0x1da66b[_0x252f('0x47')]['account']};var _0x5e24bb={'rejectUnauthorized':![],'method':'POST','url':_0x252f('0x54'),'headers':{'X-APIKEY':_0x244a99[_0x252f('0x51')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1da66b['user']['email']],'buttons':null,'topic':_0x5df2c0[_0x252f('0x4f')],'note':_[_0x252f('0x55')](_0x5df2c0[_0x252f('0x56')])?null:getMustacheRender(_0x5df2c0[_0x252f('0x56')],_0x1ac587),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x5df2c0['vidaooMetadata'])){var _0x40b15d=getMustacheRender(_0x5df2c0[_0x252f('0x50')],_0x1ac587);var _0x1e520e=JSON[_0x252f('0x57')](_0x40b15d);_0x5e24bb[_0x252f('0x47')][_0x252f('0x58')]=_0x1e520e;}}catch(_0x13a5b0){throw new db[(_0x252f('0x59'))]['ValidationError'](_0x252f('0x5a'));}return rp(_0x5e24bb);}else{throw new db['Sequelize'][(_0x252f('0x5b'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x252f('0x15')](function(_0x44d7a2){_0x337ba9=_0x44d7a2;if(_0x337ba9['id']){var _0x543e51={'body':_0x337ba9[_0x252f('0x5c')],'ChatWebsiteId':_0x5df2c0['id'],'ChatInteractionId':_0x2f1df8['id'],'direction':'out','UserId':_0x1da66b[_0x252f('0x39')]['id']};return db[_0x252f('0x5d')][_0x252f('0x46')](_0x543e51,{});}else{throw new db[(_0x252f('0x59'))][(_0x252f('0x5b'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x252f('0x15')](function(){return _0x2f1df8['updateAttributes']({'vidaooSessionId':_0x337ba9['id']});})['then'](respondWithResult(_0x5571da,null))[_0x252f('0x1f')](handleError(_0x5571da,null));};exports['customUpdate']=function(_0x3d1f6a,_0x20fa60){if(_0x3d1f6a['body']['id']){delete _0x3d1f6a[_0x252f('0x47')]['id'];}return db[_0x252f('0x33')][_0x252f('0x45')]({'where':{'id':_0x3d1f6a[_0x252f('0x48')]['id']},'include':[{'model':db[_0x252f('0x5e')],'as':_0x252f('0x5f')}]})[_0x252f('0x15')](handleEntityNotFound(_0x20fa60,null))[_0x252f('0x15')](saveUpdates(_0x3d1f6a[_0x252f('0x47')],null))[_0x252f('0x15')](respondWithResult(_0x20fa60,null))[_0x252f('0x1f')](handleError(_0x20fa60,null));};exports[_0x252f('0x60')]=function(_0x293723,_0x29d904){if(_0x293723[_0x252f('0x47')]['id']){delete _0x293723['body']['id'];}return db[_0x252f('0x33')][_0x252f('0x45')]({'where':{'id':_0x293723['params']['id']}})[_0x252f('0x15')](function(_0x22e4dc){if(!_0x22e4dc){logger[_0x252f('0x1a')](_0x252f('0x61'),_0x252f('0x60'),0x194,_0x252f('0x62'));_0x29d904[_0x252f('0x20')](0x194);}else{if(_0x22e4dc[_0x252f('0x63')]){throw new db[(_0x252f('0x59'))][(_0x252f('0x5b'))](_0x252f('0x64'));}}return _0x22e4dc;})[_0x252f('0x15')](function(_0x4e8f0e){if(_0x4e8f0e){return _0x4e8f0e[_0x252f('0x29')]({'closed':_0x293723['body'][_0x252f('0x65')],'disposition':_0x293723[_0x252f('0x47')]['disposition']})[_0x252f('0x15')](function(_0x3b6362){return _0x3b6362;});}})[_0x252f('0x15')](function(){return respondWithRpcPromise('AbandonInteraction',_0x252f('0x60'),_0x293723[_0x252f('0x47')],client9004);})['then'](respondWithResult(_0x29d904,null))[_0x252f('0x1f')](handleError(_0x29d904,null));};exports['attachmentUpload']=function(_0x842418,_0x515d5d){_0x842418[_0x252f('0x47')][_0x252f('0x2b')]=_0x842418[_0x252f('0x66')]['originalname'];_0x842418[_0x252f('0x47')]['basename']=_0x842418[_0x252f('0x66')][_0x252f('0x67')];_0x842418['body'][_0x252f('0x35')]=_0x842418[_0x252f('0x66')][_0x252f('0x68')];return db[_0x252f('0x69')][_0x252f('0x46')](_0x842418[_0x252f('0x47')])['then'](respondWithResult(_0x515d5d,0xc9))[_0x252f('0x1f')](handleError(_0x515d5d,null));};exports[_0x252f('0x6a')]=function(_0x32ff64,_0x7efec0){return db[_0x252f('0x33')][_0x252f('0x4c')]({'where':{'id':_0x32ff64['params']['id']},'raw':!![]})[_0x252f('0x15')](handleEntityNotFound(_0x7efec0,null))['then'](function(_0x2e559b){if(_0x2e559b){if(_0x2e559b[_0x252f('0x65')]){return _0x7efec0[_0x252f('0x21')](0x193)['json']({'status':0x193,'message':_0x252f('0x6b')});}return db[_0x252f('0x69')]['findOne']({'where':{'id':_0x32ff64[_0x252f('0x38')][_0x252f('0x6c')]},'raw':!![]})[_0x252f('0x15')](handleEntityNotFound(_0x7efec0,null));}})[_0x252f('0x15')](function(_0xd05024){if(_0xd05024){var _0x4ac8ed=_0xd05024[_0x252f('0x6d')]!==null;var _0x4aed6a=path[_0x252f('0x6e')](config['root'],'server/files/attachments/');if(_0x4ac8ed){_0x4aed6a=path[_0x252f('0x6e')](_0x4aed6a,'offline-chat/');}var _0x1a29df=path[_0x252f('0x6e')](_0x4aed6a,_0xd05024[_0x252f('0x6f')]);return _0x7efec0[_0x252f('0x70')](_0x1a29df);}})['catch'](handleError(_0x7efec0,null));};exports[_0x252f('0x71')]=function(_0xa2d280,_0x20376c){var _0x5ec61f=null;var _0x4a815f=null;var _0xe7431b=null;if(_0xa2d280[_0x252f('0x47')]['id']){delete _0xa2d280[_0x252f('0x47')]['id'];}if(_0xa2d280[_0x252f('0x47')][_0x252f('0x72')]){_0xe7431b=path[_0x252f('0x6e')](config[_0x252f('0x73')],'server/files/chat/upload/',util[_0x252f('0x74')](_0x252f('0x75'),Date[_0x252f('0x76')]()));_0xa2d280['body'][_0x252f('0x77')]=_0xe7431b;}return db['ChatInteraction']['find']({'where':{'id':_0xa2d280[_0x252f('0x48')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x252f('0x78')],'as':_0x252f('0x78')}]}]})[_0x252f('0x15')](handleEntityNotFound(_0x20376c,null))[_0x252f('0x15')](saveUpdates(_0xa2d280['body'],null))[_0x252f('0x15')](function(_0x2a16b0){if(_0x2a16b0){_0x5ec61f=_0x2a16b0;return db['ChatWebsite'][_0x252f('0x45')]({'where':{'id':_0x5ec61f['ChatWebsiteId']}});}})[_0x252f('0x15')](function(_0x2291fe){if(_0x2291fe){_0x4a815f=_0x2291fe;return db[_0x252f('0x5e')][_0x252f('0x45')]({'where':{'id':_0x5ec61f['ContactId']}});}})[_0x252f('0x15')](function(_0x2fd6f0){if(_0x2fd6f0){if(_0xe7431b){var _0x1e022f=null;for(var _0x18aa9c=0x1;_0x18aa9c<_0x5ec61f[_0x252f('0x79')][_0x252f('0x7a')];++_0x18aa9c){_0x1e022f=_0x5ec61f[_0x252f('0x79')][_0x18aa9c];var _0x33c37c=_0x1e022f[_0x252f('0x63')]?util[_0x252f('0x74')]('%s%d',_0x4a815f[_0x252f('0x7b')],_0x1e022f[_0x252f('0x63')]):_0x252f('0x7c');var _0x2741b9=_0xa2d280[_0x252f('0x47')][_0x252f('0x7d')]||util['format'](_0x252f('0x7e'),'Visitor',_0x1e022f[_0x252f('0x7f')]);switch(_0x4a815f['agentIdentifier']){case'website_alias':_0x33c37c=_0x1e022f[_0x252f('0x63')]?util[_0x252f('0x74')](_0x252f('0x7e'),_0x4a815f['agentAlias'],_0x1e022f[_0x252f('0x63')]):_0x252f('0x7c');break;case'agent_alias':_0x33c37c=_0x1e022f[_0x252f('0x63')]?_0x1e022f['User']['alias']||_0x1e022f[_0x252f('0x78')][_0x252f('0x52')]:_0x252f('0x7c');break;case _0x252f('0x80'):_0x33c37c=_0x1e022f[_0x252f('0x63')]?_0x1e022f['User'][_0x252f('0x52')]:_0x252f('0x7c');break;default:_0x33c37c=_0x1e022f['UserId']?util[_0x252f('0x74')](_0x252f('0x7e'),_0x4a815f['agentAlias'],_0x1e022f[_0x252f('0x63')]):_0x252f('0x7c');}var _0x3a207e=util[_0x252f('0x74')](_0x252f('0x81'),moment(_0x1e022f[_0x252f('0x82')])[_0x252f('0x74')]('MM/DD/YYYY\x20HH:mm:ss'),_0x1e022f[_0x252f('0x83')]==='in'?_0x2741b9:_0x33c37c,_0x1e022f[_0x252f('0x47')]);if(!_0x1e022f[_0x252f('0x84')]){fs[_0x252f('0x85')](_0xe7431b,_0x3a207e);}}return db[_0x252f('0x86')][_0x252f('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0x252f('0x87')],'as':_0x252f('0x88'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x252f('0x15')](function(_0xe42d5){if(!_0xe42d5||!_0xe42d5['Smtp']||!_0xa2d280[_0x252f('0x47')])return _0x5ec61f;var _0x55d4b7=_0xe42d5[_0x252f('0x89')]();return respondWithRpcPromise('SendMail',_0x252f('0x8a'),{'account':_0x55d4b7,'message':{'from':util['format'](_0x252f('0x8b'),_0xe42d5[_0x252f('0x2b')],_0xe42d5[_0x252f('0x53')]||_0xe42d5[_0x252f('0x88')][_0x252f('0x39')]),'to':_0xa2d280[_0x252f('0x47')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0xa2d280[_0x252f('0x47')]['mailTranscript']),'attachments':[{'path':_0xe7431b}]}})[_0x252f('0x15')](function(){return _0x5ec61f;})[_0x252f('0x1f')](function(_0x4178b7){logger[_0x252f('0x1a')](_0x4178b7);});})[_0x252f('0x15')](respondWithStatusCode(_0x20376c,0xc8))['catch'](handleError(_0x20376c,null));};exports['addMessage']=function(_0x112c9a,_0x5109af){return db[_0x252f('0x5d')][_0x252f('0x45')]({'where':{'id':_0x112c9a[_0x252f('0x48')]['id']}})[_0x252f('0x15')](handleEntityNotFound(_0x5109af,null))[_0x252f('0x15')](function(_0x3b7fbf){if(_0x3b7fbf){return _0x3b7fbf[_0x252f('0x8c')](_0x112c9a[_0x252f('0x47')][_0x252f('0x8d')],_[_0x252f('0x8e')](_0x112c9a[_0x252f('0x47')],[_0x252f('0x8d'),'id'])||{});}})[_0x252f('0x15')](respondWithResult(_0x5109af,null))[_0x252f('0x1f')](handleError(_0x5109af,null));};exports['getMessages']=function(_0x58de24,_0x8b464a){var _0x28644b={'raw':![],'where':{}};var _0x1cc4fa={};var _0x245faa={'count':0x0,'rows':[]};return db[_0x252f('0x33')][_0x252f('0x4c')]({'where':{'id':_0x58de24[_0x252f('0x48')]['id']}})[_0x252f('0x15')](handleEntityNotFound(_0x8b464a,null))[_0x252f('0x15')](function(_0x328dbd){if(_0x328dbd){_0x1cc4fa[_0x252f('0x3b')]=_[_0x252f('0x3c')](db['ChatMessage'][_0x252f('0x3d')]);_0x1cc4fa[_0x252f('0x38')]=_['keys'](_0x58de24[_0x252f('0x38')]);_0x1cc4fa[_0x252f('0x3e')]=_['intersection'](_0x1cc4fa[_0x252f('0x3b')],_0x1cc4fa[_0x252f('0x38')]);_0x28644b[_0x252f('0x40')]=_[_0x252f('0x3f')](_0x1cc4fa[_0x252f('0x3b')],qs['fields'](_0x58de24[_0x252f('0x38')][_0x252f('0x41')]));_0x28644b[_0x252f('0x40')]=_0x28644b[_0x252f('0x40')][_0x252f('0x7a')]?_0x28644b[_0x252f('0x40')]:_0x1cc4fa[_0x252f('0x3b')];if(!_0x58de24[_0x252f('0x38')]['hasOwnProperty'](_0x252f('0x8f'))){_0x28644b[_0x252f('0x25')]=qs[_0x252f('0x25')](_0x58de24[_0x252f('0x38')][_0x252f('0x25')]);_0x28644b['offset']=qs[_0x252f('0x24')](_0x58de24['query'][_0x252f('0x24')]);}_0x28644b[_0x252f('0x90')]=qs['sort'](_0x58de24[_0x252f('0x38')][_0x252f('0x91')]);_0x28644b[_0x252f('0x92')]=qs[_0x252f('0x3e')](_[_0x252f('0x93')](_0x58de24['query'],_0x1cc4fa[_0x252f('0x3e')]));_0x28644b[_0x252f('0x92')][_0x252f('0x94')]=_0x328dbd['id'];if(_0x58de24[_0x252f('0x38')][_0x252f('0x95')]){_0x28644b[_0x252f('0x92')]=_[_0x252f('0x2e')](_0x28644b[_0x252f('0x92')],{'$or':_[_0x252f('0x32')](_0x28644b[_0x252f('0x40')],function(_0x5405dd){var _0x4441a2={};_0x4441a2[_0x5405dd]={'$like':'%'+_0x58de24[_0x252f('0x38')]['filter']+'%'};return _0x4441a2;})});}if(_0x58de24[_0x252f('0x38')][_0x252f('0x96')]){var _0x3f56ac=_0x58de24[_0x252f('0x38')][_0x252f('0x96')][_0x252f('0x97')](',');var _0x19ed10={};_0x19ed10[_0x3f56ac[0x0]]={'$gte':moment(_0x3f56ac[0x1])['format'](_0x252f('0x98'))};_0x28644b['where']=_[_0x252f('0x2e')](_0x28644b[_0x252f('0x92')],_0x19ed10);}_0x28644b=_['merge']({},_0x28644b,_0x58de24[_0x252f('0x44')]);return db[_0x252f('0x5d')][_0x252f('0x27')]({'where':_0x28644b['where']})[_0x252f('0x15')](function(_0x327441){_0x245faa['count']=_0x327441;if(_0x58de24['query']['includeAll']){_0x28644b['include']=[{'all':!![]}];}return db['ChatMessage'][_0x252f('0x99')](_0x28644b);})[_0x252f('0x15')](function(_0x186815){_0x245faa[_0x252f('0x9a')]=_0x186815;return _0x245faa;});}})[_0x252f('0x15')](respondWithFilteredResult(_0x8b464a,_0x28644b))[_0x252f('0x1f')](handleError(_0x8b464a,null));};exports[_0x252f('0x9b')]=function(_0x21cac0,_0x2e6e08){var _0x2f228c={'where':{}},_0x5c454b={},_0x10cbc4={'count':0x0,'rows':[]};return db[_0x252f('0x33')][_0x252f('0x4c')]({'where':{'id':_0x21cac0[_0x252f('0x48')]['id']}})[_0x252f('0x15')](handleEntityNotFound(_0x2e6e08,null))[_0x252f('0x15')](function(_0x477eb3){if(_0x477eb3){_0x5c454b['model']=_[_0x252f('0x3c')](db[_0x252f('0x5d')][_0x252f('0x3d')]);_0x5c454b[_0x252f('0x38')]=_[_0x252f('0x3c')](_0x21cac0['query']);_0x5c454b['filters']=_[_0x252f('0x3f')](_0x5c454b[_0x252f('0x3b')],_0x5c454b[_0x252f('0x38')]);_0x2f228c[_0x252f('0x40')]=_[_0x252f('0x3f')](_0x5c454b[_0x252f('0x3b')],qs[_0x252f('0x41')](_0x21cac0['query']['fields']));_0x2f228c[_0x252f('0x40')]=_0x2f228c[_0x252f('0x40')][_0x252f('0x7a')]?_0x2f228c[_0x252f('0x40')]:_0x5c454b[_0x252f('0x3b')];if(!_0x21cac0['query'][_0x252f('0x9c')](_0x252f('0x8f'))){_0x2f228c['limit']=qs[_0x252f('0x25')](_0x21cac0[_0x252f('0x38')][_0x252f('0x25')]);_0x2f228c[_0x252f('0x24')]=qs[_0x252f('0x24')](_0x21cac0['query'][_0x252f('0x24')]);}_0x2f228c[_0x252f('0x90')]=qs[_0x252f('0x91')](_0x21cac0['query'][_0x252f('0x91')]);_0x2f228c[_0x252f('0x92')]=qs[_0x252f('0x3e')](_[_0x252f('0x93')](_0x21cac0['query'],_0x5c454b[_0x252f('0x3e')]));_0x2f228c[_0x252f('0x92')][_0x252f('0x94')]=_0x477eb3['id'];if(_0x21cac0[_0x252f('0x38')][_0x252f('0x95')]){_0x2f228c[_0x252f('0x92')]=_[_0x252f('0x2e')](_0x2f228c['where'],{'$or':_[_0x252f('0x32')](_0x2f228c[_0x252f('0x40')],function(_0x47ed1b){var _0x1b5e17={};_0x1b5e17[_0x47ed1b]={'$like':'%'+_0x21cac0[_0x252f('0x38')][_0x252f('0x95')]+'%'};return _0x1b5e17;})});}_0x2f228c['where'][_0x252f('0x84')]=![];if(_0x21cac0['query']['id']){_0x2f228c['where']['id']={'$gt':_0x21cac0[_0x252f('0x38')]['id']};}_0x2f228c=_[_0x252f('0x2e')]({},_0x2f228c,_0x21cac0[_0x252f('0x44')]);return db[_0x252f('0x5d')]['count']({'where':_0x2f228c['where']})[_0x252f('0x15')](function(_0x5978ba){_0x10cbc4[_0x252f('0x27')]=_0x5978ba;_0x2f228c['include']=[];if(_0x21cac0[_0x252f('0x38')][_0x252f('0x9d')]){_0x2f228c['include'][_0x252f('0x9e')]({'model':db[_0x252f('0x78')],'as':_0x252f('0x78'),'attributes':['id',_0x252f('0x52'),_0x252f('0x9f')]});}if(_0x21cac0[_0x252f('0x38')][_0x252f('0x42')]){_0x2f228c[_0x252f('0x43')]=[{'all':!![]}];}return db['ChatMessage'][_0x252f('0x99')](_0x2f228c);})[_0x252f('0x15')](function(_0x50171c){_0x10cbc4['rows']=_0x50171c;return _0x10cbc4;});}})['then'](respondWithFilteredResult(_0x2e6e08,_0x2f228c))[_0x252f('0x1f')](handleError(_0x2e6e08,null));};exports[_0x252f('0xa0')]=function(_0x392b5f,_0xc9ab90){return db[_0x252f('0x33')]['find']({'where':{'id':_0x392b5f[_0x252f('0x48')]['id']}})[_0x252f('0x15')](handleEntityNotFound(_0xc9ab90,null))[_0x252f('0x15')](function(_0x202ab3){if(_0x202ab3){return _0x202ab3[_0x252f('0xa1')](_0x392b5f[_0x252f('0x47')][_0x252f('0x8d')],_['omit'](_0x392b5f[_0x252f('0x47')],[_0x252f('0x8d'),'id'])||{})[_0x252f('0xa2')](function(){return db[_0x252f('0xa3')]['findAll']({'attributes':['id',_0x252f('0x2b'),_0x252f('0xa4')],'where':{'id':_0x392b5f['body']['ids']}});})['then'](function(_0x50284d){socket[_0x252f('0xa5')]('chatInteractionTags:save',{'id':Number(_0x392b5f['params']['id']),'tags':_0x50284d||[]});return{'id':Number(_0x392b5f[_0x252f('0x48')]['id']),'tags':_0x50284d||[]};});}})[_0x252f('0x15')](respondWithResult(_0xc9ab90,null))['catch'](handleError(_0xc9ab90,null));};exports[_0x252f('0xa6')]=function(_0x32d409,_0x457d78){return db['ChatInteraction'][_0x252f('0x45')]({'where':{'id':_0x32d409['params']['id']}})['then'](handleEntityNotFound(_0x457d78,null))['then'](function(_0x438cf0){if(_0x438cf0){return _0x438cf0[_0x252f('0xa6')](_0x32d409['query'][_0x252f('0x8d')]);}})[_0x252f('0x15')](respondWithStatusCode(_0x457d78,null))['catch'](handleError(_0x457d78,null));};exports[_0x252f('0x70')]=function(_0x501524,_0x19481d){var _0x1419a9=moment()[_0x252f('0xa7')]()[_0x252f('0xa8')]();var _0x5a4827=path[_0x252f('0x6e')](config[_0x252f('0x73')],_0x252f('0xa9'),_0x252f('0xaa'),_0x252f('0xab'));var _0x29de57=path[_0x252f('0x6e')](config['root'],_0x252f('0xa9'),'files',_0x252f('0xac'));var _0x192d2f=path[_0x252f('0x6e')](_0x5a4827,_0x1419a9);var _0x1d0baa=util['format']('transcript-%d-%s.zip',_0x501524[_0x252f('0x48')]['id'],_0x1419a9);var _0x3fdc34=path['join'](_0x5a4827,_0x1d0baa);var _0xdae8dd=[];_0xdae8dd[_0x252f('0x9e')]({'model':db[_0x252f('0x78')],'as':_0x252f('0x78'),'attributes':['id',_0x252f('0x52')],'raw':!![]});_0xdae8dd[_0x252f('0x9e')]({'model':db[_0x252f('0x5e')],'as':_0x252f('0x5f'),'attributes':['id','firstName',_0x252f('0xad')],'raw':!![]});if(_0x501524[_0x252f('0x38')][_0x252f('0xac')]){_0xdae8dd[_0x252f('0x9e')]({'model':db[_0x252f('0x69')],'as':_0x252f('0x69'),'raw':!![]});}var _0x1ed94c=[{'model':db[_0x252f('0x5d')],'as':_0x252f('0x79'),'attributes':['id',_0x252f('0x47'),'createdAt',_0x252f('0x83'),_0x252f('0x84'),_0x252f('0xae')],'include':_0xdae8dd}];_0x1ed94c[_0x252f('0x9e')]({'model':db[_0x252f('0xaf')],'as':_0x252f('0xb0'),'attributes':['id','name']});_0x1ed94c[_0x252f('0x9e')]({'model':db[_0x252f('0x78')],'as':_0x252f('0xb1'),'attributes':['id',_0x252f('0x52')]});return db[_0x252f('0x33')][_0x252f('0x45')]({'where':{'id':_0x501524[_0x252f('0x48')]['id']},'include':_0x1ed94c})[_0x252f('0x15')](handleEntityNotFound(_0x19481d,null))[_0x252f('0x15')](function(_0x11e1cb){if(_0x11e1cb){var _0x32d13f=_0x11e1cb[_0x252f('0xb2')]({'plain':!![]});fs[_0x252f('0xb3')](_0x192d2f);var _0x4272e0={'channel':_0x252f('0xb4'),'account':_0x32d13f[_0x252f('0xb0')][_0x252f('0x2b')],'agent':_0x32d13f[_0x252f('0xb1')]?_0x32d13f['Owner'][_0x252f('0x52')]:_0x252f('0xb5'),'createdAt':moment(_0x32d13f[_0x252f('0x82')])[_0x252f('0x74')](_0x252f('0x98'))[_0x252f('0xa8')](),'closedAt':_0x32d13f[_0x252f('0x65')]?moment(_0x32d13f[_0x252f('0xb6')])[_0x252f('0x74')]('YYYY-MM-DD\x20HH:mm:ss')[_0x252f('0xa8')]():'','disposition':_0x32d13f[_0x252f('0xb7')],'chatInfo':{'browser':_0x32d13f[_0x252f('0xb8')],'os':_0x32d13f[_0x252f('0xb9')],'referer':_0x32d13f[_0x252f('0xba')],'customerIp':_0x32d13f[_0x252f('0xbb')],'customerPort':_0x32d13f[_0x252f('0xbc')]?_0x32d13f[_0x252f('0xbc')]:_0x252f('0xb5')},'messages':_(_0x32d13f[_0x252f('0x79')])[_0x252f('0xbd')]()['filter']({'secret':![]})['map'](function(_0x3a0478){if(_0x3a0478[_0x252f('0x69')]){var _0x19e895=path[_0x252f('0x6e')](_0x29de57,_0x3a0478[_0x252f('0x69')][_0x252f('0x6f')]);if(fs['existsSync'](_0x19e895)){fs[_0x252f('0xbe')](_0x19e895)[_0x252f('0xbf')](fs['createWriteStream'](path[_0x252f('0x6e')](_0x192d2f,_0x3a0478['Attachment'][_0x252f('0x6f')])));}}return{'date':moment(_0x3a0478[_0x252f('0x82')])[_0x252f('0x74')](_0x252f('0x98'))[_0x252f('0xa8')](),'sender':_0x3a0478[_0x252f('0x83')]===_0x252f('0xc0')?_0x3a0478[_0x252f('0x78')]?_0x3a0478[_0x252f('0x78')][_0x252f('0x52')]:_0x252f('0x7c'):_0x3a0478[_0x252f('0x5f')][_0x252f('0xc1')]+(_0x3a0478[_0x252f('0x5f')][_0x252f('0xad')]?'\x20'+_0x3a0478[_0x252f('0x5f')][_0x252f('0xad')]:''),'body':_0x3a0478[_0x252f('0x69')]?_0x3a0478[_0x252f('0x69')][_0x252f('0x6f')]:_0x3a0478[_0x252f('0x47')],'direction':_0x3a0478[_0x252f('0x83')]===_0x252f('0xc0')?'A':'C','secret':_0x3a0478[_0x252f('0x84')],'read':_0x3a0478[_0x252f('0xae')],'attachment':_0x3a0478[_0x252f('0x69')]};})[_0x252f('0xc2')]()};return ejs['renderFile'](path[_0x252f('0x6e')](config[_0x252f('0x73')],_0x252f('0xa9'),_0x252f('0xc3'),_0x252f('0xc4')),{'interaction':_0x4272e0})[_0x252f('0x15')](function(_0x328d7a){var _0x59858b=path[_0x252f('0x6e')](_0x192d2f,_0x252f('0xc5')+_0x32d13f['id']+'-'+_0x1419a9+_0x252f('0xc6'));var _0x4c9daf={'path':_0x59858b,'channel':_0x252f('0xb4'),'interactionId':_0x32d13f['id']};return pdf[_0x252f('0xc7')](_0x328d7a,_0x4c9daf);})[_0x252f('0x15')](function(){return new Promise(function(_0x58d465,_0xf4423a){zipdir(_0x192d2f,{'saveTo':_0x3fdc34},function(_0x4b9e5c,_0x12fbe7){if(_0x4b9e5c)return _0xf4423a(_0x4b9e5c);return _0x58d465(_0x12fbe7);});})['then'](function(){return new BPromise(function(_0x2867f7,_0x13ba73){rimraf(_0x192d2f,function(_0xeb9fb4){if(_0xeb9fb4)_0x13ba73(_0xeb9fb4);return _0x2867f7();});});})[_0x252f('0x15')](function(){return _0x19481d[_0x252f('0x70')](_0x3fdc34,_0x1d0baa,function(_0x4ed3ab){if(_0x4ed3ab){logger[_0x252f('0x1a')](_0x252f('0xc8'),_0x4ed3ab);}else{fs[_0x252f('0xc9')](_0x3fdc34);}});});});}else{return _0x19481d[_0x252f('0x20')](0xc8);}})[_0x252f('0x1f')](handleError(_0x19481d,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index e91ab4c..f3e0d7d 100644 --- a/server/api/chatInteraction/chatInteraction.events.js +++ b/server/api/chatInteraction/chatInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9390=['length','emit','catch','hasOwnProperty','hook','exports','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x9390,0x1ce));var _0x0939=function(_0x3040e0,_0x179258){_0x3040e0=_0x3040e0-0x0;var _0x885cd=_0x9390[_0x3040e0];return _0x885cd;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x0939('0x0')];var ChatMessage=require(_0x0939('0x1'))['db'][_0x0939('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0939('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0939('0x4'),'afterDestroy':_0x0939('0x5')};function emitEvent(_0x19241e){return function(_0x32920e,_0x1809b8,_0x42454d){_0x32920e[_0x0939('0x6')]({'attributes':['id'],'raw':!![]})[_0x0939('0x7')](function(_0x59d1a9){_0x32920e[_0x0939('0x8')](_0x0939('0x9'),_0x59d1a9[_0x0939('0xa')](function(_0x7e9ba4){return{'id':_0x7e9ba4['id']};}));return ChatMessage[_0x0939('0xb')]({'where':{'ChatInteractionId':_0x32920e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0939('0x7')](function(_0x47210a){_0x32920e[_0x0939('0x8')](_0x0939('0xc'),_0x47210a[_0x0939('0xd')]);ChatInteractionEvents[_0x0939('0xe')](_0x19241e+':'+_0x32920e['id'],_0x32920e);ChatInteractionEvents[_0x0939('0xe')](_0x19241e,_0x32920e);_0x42454d(null);})[_0x0939('0xf')](_0x42454d(null));};}for(var e in events){if(events[_0x0939('0x10')](e)){var event=events[e];ChatInteraction[_0x0939('0x11')](e,emitEvent(event));}}module[_0x0939('0x12')]=ChatInteractionEvents; \ No newline at end of file +var _0x33f0=['setDataValue','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','then'];(function(_0x2f87cd,_0xcaf299){var _0x5d7eda=function(_0x37ffb0){while(--_0x37ffb0){_0x2f87cd['push'](_0x2f87cd['shift']());}};_0x5d7eda(++_0xcaf299);}(_0x33f0,0x6f));var _0x033f=function(_0x647d4c,_0x45a2b8){_0x647d4c=_0x647d4c-0x0;var _0xf88e1c=_0x33f0[_0x647d4c];return _0xf88e1c;};'use strict';var EventEmitter=require(_0x033f('0x0'));var ChatInteraction=require(_0x033f('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x033f('0x1'))['db'][_0x033f('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x033f('0x3')](0x0);var events={'afterCreate':_0x033f('0x4'),'afterUpdate':_0x033f('0x5'),'afterDestroy':_0x033f('0x6')};function emitEvent(_0x2d2513){return function(_0x1952b4,_0x1f7fb8,_0x2d4656){_0x1952b4['getUsers']({'attributes':['id'],'raw':!![]})[_0x033f('0x7')](function(_0x45f22b){_0x1952b4[_0x033f('0x8')]('Users',_0x45f22b[_0x033f('0x9')](function(_0x53e6f3){return{'id':_0x53e6f3['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x1952b4['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x9258f2){_0x1952b4[_0x033f('0x8')](_0x033f('0xa'),_0x9258f2[_0x033f('0xb')]);ChatInteractionEvents[_0x033f('0xc')](_0x2d2513+':'+_0x1952b4['id'],_0x1952b4);ChatInteractionEvents[_0x033f('0xc')](_0x2d2513,_0x1952b4);_0x2d4656(null);})[_0x033f('0xd')](_0x2d4656(null));};}for(var e in events){if(events[_0x033f('0xe')](e)){var event=events[e];ChatInteraction[_0x033f('0xf')](e,emitEvent(event));}}module[_0x033f('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index c62be35..8327994 100644 --- a/server/api/chatInteraction/chatInteraction.model.js +++ b/server/api/chatInteraction/chatInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d75=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','define','ChatInteraction','chat_interactions'];(function(_0x18710b,_0x34ea23){var _0x38d1de=function(_0x48dbae){while(--_0x48dbae){_0x18710b['push'](_0x18710b['shift']());}};_0x38d1de(++_0x34ea23);}(_0x6d75,0x116));var _0x56d7=function(_0x4c2b96,_0x17ab0d){_0x4c2b96=_0x4c2b96-0x0;var _0x2a62bf=_0x6d75[_0x4c2b96];return _0x2a62bf;};'use strict';var _=require(_0x56d7('0x0'));var util=require(_0x56d7('0x1'));var logger=require(_0x56d7('0x2'))(_0x56d7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x56d7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x56d7('0x5'));var config=require(_0x56d7('0x6'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x432387,_0x5c002d){return _0x432387[_0x56d7('0x7')](_0x56d7('0x8'),attributes,{'tableName':_0x56d7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5b06e2,_0x4d8164,_0x1964b1){if(_0x5b06e2[_0x56d7('0xa')](_0x56d7('0xb'))){_0x5b06e2[_0x56d7('0xc')]=moment()['format'](_0x56d7('0xd'));}_0x1964b1(null,_0x5b06e2);}},'charset':_0x56d7('0xe'),'collate':_0x56d7('0xf')});}; \ No newline at end of file +var _0x0f28=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','path','../../config/environment','exports','define','chat_interactions','closedAt'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0f28,0x170));var _0x80f2=function(_0x52980f,_0x47b3b0){_0x52980f=_0x52980f-0x0;var _0x1f52a1=_0x0f28[_0x52980f];return _0x1f52a1;};'use strict';var _=require(_0x80f2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x80f2('0x1'));var moment=require(_0x80f2('0x2'));var BPromise=require(_0x80f2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x80f2('0x4'));var rimraf=require('rimraf');var config=require(_0x80f2('0x5'));var attributes=require('./chatInteraction.attributes');module[_0x80f2('0x6')]=function(_0x279862,_0x4a47e3){return _0x279862[_0x80f2('0x7')]('ChatInteraction',attributes,{'tableName':_0x80f2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4a299c,_0x236dc5,_0x22cf2c){if(_0x4a299c['changed']('closed')){_0x4a299c[_0x80f2('0x9')]=moment()[_0x80f2('0xa')](_0x80f2('0xb'));}_0x22cf2c(null,_0x4a299c);}},'charset':_0x80f2('0xc'),'collate':_0x80f2('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 518fca1..4d0ce83 100644 --- a/server/api/chatInteraction/chatInteraction.rpc.js +++ b/server/api/chatInteraction/chatInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ce0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','defaults','localhost','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','UpdateChatInteraction','update','body','options','raw','attributes','limit','AddTagsToChatInteraction','ChatInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring'];(function(_0x2c3528,_0x3511de){var _0x93502d=function(_0x5905e){while(--_0x5905e){_0x2c3528['push'](_0x2c3528['shift']());}};_0x93502d(++_0x3511de);}(_0x1ce0,0x134));var _0x01ce=function(_0x510cd9,_0x551300){_0x510cd9=_0x510cd9-0x0;var _0x2b1f61=_0x1ce0[_0x510cd9];return _0x2b1f61;};'use strict';var _=require('lodash');var util=require(_0x01ce('0x0'));var moment=require(_0x01ce('0x1'));var BPromise=require(_0x01ce('0x2'));var rs=require(_0x01ce('0x3'));var fs=require('fs');var Redis=require(_0x01ce('0x4'));var db=require(_0x01ce('0x5'))['db'];var utils=require(_0x01ce('0x6'));var logger=require(_0x01ce('0x7'))(_0x01ce('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x01ce('0x9')]=_[_0x01ce('0xa')](config[_0x01ce('0x9')],{'host':_0x01ce('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x4f74f2,_0x260f3e,_0x3ff41f){return new BPromise(function(_0x54d72f,_0x58445b){return client[_0x01ce('0xc')](_0x4f74f2,_0x3ff41f)[_0x01ce('0xd')](function(_0x1e2cad){logger[_0x01ce('0xe')](_0x01ce('0xf'),_0x260f3e,'request\x20sent');logger[_0x01ce('0x10')](_0x01ce('0x11'),_0x260f3e,'request\x20sent',JSON[_0x01ce('0x12')](_0x1e2cad));if(_0x1e2cad['error']){if(_0x1e2cad[_0x01ce('0x13')][_0x01ce('0x14')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x260f3e,_0x1e2cad[_0x01ce('0x13')][_0x01ce('0x15')]);return _0x58445b(_0x1e2cad['error']['message']);}logger[_0x01ce('0x13')](_0x01ce('0xf'),_0x260f3e,_0x1e2cad[_0x01ce('0x13')][_0x01ce('0x15')]);return _0x54d72f(_0x1e2cad['error'][_0x01ce('0x15')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x260f3e,_0x01ce('0x16'));_0x54d72f(_0x1e2cad['result'][_0x01ce('0x15')]);}})[_0x01ce('0x17')](function(_0x1657df){logger[_0x01ce('0x13')](_0x01ce('0xf'),_0x260f3e,_0x1657df);_0x58445b(_0x1657df);});});}exports[_0x01ce('0x18')]=function(_0x5aaa9d){var _0x2b02d1=this;return new Promise(function(_0x6d2c15,_0x2ed194){return db['ChatInteraction'][_0x01ce('0x19')](_0x5aaa9d[_0x01ce('0x1a')],{'raw':_0x5aaa9d[_0x01ce('0x1b')]?_0x5aaa9d['options'][_0x01ce('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5aaa9d[_0x01ce('0x1b')]?_0x5aaa9d[_0x01ce('0x1b')]['where']||null:null,'attributes':_0x5aaa9d[_0x01ce('0x1b')]?_0x5aaa9d[_0x01ce('0x1b')][_0x01ce('0x1d')]||null:null,'limit':_0x5aaa9d[_0x01ce('0x1b')]?_0x5aaa9d[_0x01ce('0x1b')][_0x01ce('0x1e')]||null:null})['then'](function(_0x34170b){logger[_0x01ce('0xe')](_0x01ce('0x18'),_0x5aaa9d);logger[_0x01ce('0x10')](_0x01ce('0x18'),_0x5aaa9d,JSON['stringify'](_0x34170b));_0x6d2c15(_0x34170b);})['catch'](function(_0x322c04){logger[_0x01ce('0x13')](_0x01ce('0x18'),_0x322c04[_0x01ce('0x15')],_0x5aaa9d);_0x2ed194(_0x2b02d1['error'](0x1f4,_0x322c04[_0x01ce('0x15')]));});});};exports[_0x01ce('0x1f')]=function(_0x15cc71){return new Promise(function(_0x4520a1,_0x3463bf){return db[_0x01ce('0x20')][_0x01ce('0x21')]({'where':_0x15cc71[_0x01ce('0x1b')]?_0x15cc71[_0x01ce('0x1b')]['where']||null:null})[_0x01ce('0xd')](function(_0x260cf6){if(_0x260cf6){return _0x260cf6[_0x01ce('0x22')](_0x15cc71[_0x01ce('0x1a')][_0x01ce('0x23')],_[_0x01ce('0x24')](_0x15cc71[_0x01ce('0x1a')],[_0x01ce('0x23'),'id'])||{});}})[_0x01ce('0x25')](function(_0x5c25e9){logger[_0x01ce('0xe')]('AddTags',_0x15cc71);logger[_0x01ce('0x10')](_0x01ce('0x26'),_0x15cc71,JSON[_0x01ce('0x12')](_0x5c25e9));_0x4520a1(_0x5c25e9);})[_0x01ce('0x17')](function(_0x2a4cbf){logger[_0x01ce('0x13')](_0x01ce('0x26'),_0x2a4cbf[_0x01ce('0x15')],_0x15cc71);_0x3463bf(_this[_0x01ce('0x13')](0x1f4,_0x2a4cbf[_0x01ce('0x15')]));});});}; \ No newline at end of file +var _0xd9df=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','limit','find','body','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x30510e,_0x40f4b7){var _0x3497=function(_0x1c4097){while(--_0x1c4097){_0x30510e['push'](_0x30510e['shift']());}};_0x3497(++_0x40f4b7);}(_0xd9df,0x1c6));var _0xfd9d=function(_0xb4fa21,_0x56e470){_0xb4fa21=_0xb4fa21-0x0;var _0x456fcf=_0xd9df[_0xb4fa21];return _0x456fcf;};'use strict';var _=require(_0xfd9d('0x0'));var util=require(_0xfd9d('0x1'));var moment=require('moment');var BPromise=require(_0xfd9d('0x2'));var rs=require(_0xfd9d('0x3'));var fs=require('fs');var Redis=require(_0xfd9d('0x4'));var db=require(_0xfd9d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd9d('0x6'))(_0xfd9d('0x7'));var config=require(_0xfd9d('0x8'));var jayson=require(_0xfd9d('0x9'));var client=jayson[_0xfd9d('0xa')][_0xfd9d('0xb')]({'port':0x232a});config[_0xfd9d('0xc')]=_[_0xfd9d('0xd')](config[_0xfd9d('0xc')],{'host':_0xfd9d('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd9d('0xc')]));require('./chatInteraction.socket')[_0xfd9d('0xf')](socket);function respondWithRpcPromise(_0x581447,_0x1d65c1,_0x14110a){return new BPromise(function(_0x37fd28,_0x4afa27){return client[_0xfd9d('0x10')](_0x581447,_0x14110a)[_0xfd9d('0x11')](function(_0x45be73){logger[_0xfd9d('0x12')](_0xfd9d('0x13'),_0x1d65c1,_0xfd9d('0x14'));logger[_0xfd9d('0x15')](_0xfd9d('0x16'),_0x1d65c1,_0xfd9d('0x14'),JSON[_0xfd9d('0x17')](_0x45be73));if(_0x45be73[_0xfd9d('0x18')]){if(_0x45be73[_0xfd9d('0x18')][_0xfd9d('0x19')]===0x1f4){logger[_0xfd9d('0x18')](_0xfd9d('0x13'),_0x1d65c1,_0x45be73[_0xfd9d('0x18')][_0xfd9d('0x1a')]);return _0x4afa27(_0x45be73['error'][_0xfd9d('0x1a')]);}logger[_0xfd9d('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x1d65c1,_0x45be73[_0xfd9d('0x18')][_0xfd9d('0x1a')]);return _0x37fd28(_0x45be73['error']['message']);}else{logger[_0xfd9d('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x1d65c1,_0xfd9d('0x14'));_0x37fd28(_0x45be73[_0xfd9d('0x1b')][_0xfd9d('0x1a')]);}})[_0xfd9d('0x1c')](function(_0xa626b0){logger[_0xfd9d('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x1d65c1,_0xa626b0);_0x4afa27(_0xa626b0);});});}exports[_0xfd9d('0x1d')]=function(_0x509cf3){var _0x6bb7ac=this;return new Promise(function(_0x386c6e,_0x185a3f){return db[_0xfd9d('0x1e')][_0xfd9d('0x1f')](_0x509cf3['body'],{'raw':_0x509cf3[_0xfd9d('0x20')]?_0x509cf3[_0xfd9d('0x20')][_0xfd9d('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x509cf3[_0xfd9d('0x20')]?_0x509cf3[_0xfd9d('0x20')][_0xfd9d('0x22')]||null:null,'attributes':_0x509cf3[_0xfd9d('0x20')]?_0x509cf3[_0xfd9d('0x20')][_0xfd9d('0x23')]||null:null,'limit':_0x509cf3[_0xfd9d('0x20')]?_0x509cf3[_0xfd9d('0x20')][_0xfd9d('0x24')]||null:null})[_0xfd9d('0x11')](function(_0x4719eb){logger['info']('UpdateChatInteraction',_0x509cf3);logger[_0xfd9d('0x15')](_0xfd9d('0x1d'),_0x509cf3,JSON[_0xfd9d('0x17')](_0x4719eb));_0x386c6e(_0x4719eb);})['catch'](function(_0x545700){logger[_0xfd9d('0x18')](_0xfd9d('0x1d'),_0x545700[_0xfd9d('0x1a')],_0x509cf3);_0x185a3f(_0x6bb7ac[_0xfd9d('0x18')](0x1f4,_0x545700[_0xfd9d('0x1a')]));});});};exports['AddTagsToChatInteraction']=function(_0x2f71c2){return new Promise(function(_0x538bf7,_0x343373){return db['ChatInteraction'][_0xfd9d('0x25')]({'where':_0x2f71c2[_0xfd9d('0x20')]?_0x2f71c2['options']['where']||null:null})['then'](function(_0x13acaa){if(_0x13acaa){return _0x13acaa['addTags'](_0x2f71c2[_0xfd9d('0x26')][_0xfd9d('0x27')],_[_0xfd9d('0x28')](_0x2f71c2['body'],[_0xfd9d('0x27'),'id'])||{});}})['spread'](function(_0x4f958f){logger[_0xfd9d('0x12')](_0xfd9d('0x29'),_0x2f71c2);logger['debug'](_0xfd9d('0x29'),_0x2f71c2,JSON[_0xfd9d('0x17')](_0x4f958f));_0x538bf7(_0x4f958f);})[_0xfd9d('0x1c')](function(_0x2ac080){logger[_0xfd9d('0x18')](_0xfd9d('0x29'),_0x2ac080[_0xfd9d('0x1a')],_0x2f71c2);_0x343373(_this[_0xfd9d('0x18')](0x1f4,_0x2ac080[_0xfd9d('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index c6a7cae..555542f 100644 --- a/server/api/chatInteraction/chatInteraction.socket.js +++ b/server/api/chatInteraction/chatInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b7e=['update','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6b7e,0xa5));var _0xe6b7=function(_0x2495da,_0x11a291){_0x2495da=_0x2495da-0x0;var _0x15575c=_0x6b7e[_0x2495da];return _0x15575c;};'use strict';var ChatInteractionEvents=require(_0xe6b7('0x0'));var events=[_0xe6b7('0x1'),_0xe6b7('0x2'),_0xe6b7('0x3')];function createListener(_0x31568f,_0x427090){return function(_0x5bf9a5){_0x427090['emit'](_0x31568f,_0x5bf9a5);};}function removeListener(_0x44ddff,_0x19d78a){return function(){ChatInteractionEvents[_0xe6b7('0x4')](_0x44ddff,_0x19d78a);};}exports[_0xe6b7('0x5')]=function(_0xb23513){for(var _0x2b0c3f=0x0,_0xb95ee1=events[_0xe6b7('0x6')];_0x2b0c3f<_0xb95ee1;_0x2b0c3f++){var _0x3d1901=events[_0x2b0c3f];var _0x4e0698=createListener(_0xe6b7('0x7')+_0x3d1901,_0xb23513);ChatInteractionEvents['on'](_0x3d1901,_0x4e0698);}}; \ No newline at end of file +var _0xda3c=['./chatInteraction.events','save','remove','update','emit','removeListener','register','length','chatInteraction:'];(function(_0x3f993e,_0x2d5757){var _0x39c135=function(_0x39e00b){while(--_0x39e00b){_0x3f993e['push'](_0x3f993e['shift']());}};_0x39c135(++_0x2d5757);}(_0xda3c,0x1b9));var _0xcda3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xda3c[_0x40a045];return _0x1a687c;};'use strict';var ChatInteractionEvents=require(_0xcda3('0x0'));var events=[_0xcda3('0x1'),_0xcda3('0x2'),_0xcda3('0x3')];function createListener(_0x4ab139,_0x503200){return function(_0x5f0c7f){_0x503200[_0xcda3('0x4')](_0x4ab139,_0x5f0c7f);};}function removeListener(_0x387dc1,_0x2626ae){return function(){ChatInteractionEvents[_0xcda3('0x5')](_0x387dc1,_0x2626ae);};}exports[_0xcda3('0x6')]=function(_0x1f3de6){for(var _0x2fe7c4=0x0,_0x5d600f=events[_0xcda3('0x7')];_0x2fe7c4<_0x5d600f;_0x2fe7c4++){var _0x39ebe6=events[_0x2fe7c4];var _0x3ab5a2=createListener(_0xcda3('0x8')+_0x39ebe6,_0x1f3de6);ChatInteractionEvents['on'](_0x39ebe6,_0x3ab5a2);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index e00f745..3580014 100644 --- a/server/api/chatInteraction/index.js +++ b/server/api/chatInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0d2=['addTags','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','destroy','removeTags','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','getMessages','/:id/my_messages','/:id/download','download','create','post','/:id/vidaoo','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf0d2,0x130));var _0x2f0d=function(_0x1d4f2a,_0x13a26c){_0x1d4f2a=_0x1d4f2a-0x0;var _0x526d8b=_0xf0d2[_0x1d4f2a];return _0x526d8b;};'use strict';var multer=require('multer');var util=require(_0x2f0d('0x0'));var path=require(_0x2f0d('0x1'));var timeout=require(_0x2f0d('0x2'));var express=require(_0x2f0d('0x3'));var router=express[_0x2f0d('0x4')]();var fs_extra=require(_0x2f0d('0x5'));var auth=require(_0x2f0d('0x6'));var interaction=require(_0x2f0d('0x7'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x2f0d('0x8')]('/',auth[_0x2f0d('0x9')](),controller[_0x2f0d('0xa')]);router[_0x2f0d('0x8')](_0x2f0d('0xb'),auth[_0x2f0d('0x9')](),controller['describe']);router[_0x2f0d('0x8')](_0x2f0d('0xc'),auth[_0x2f0d('0xd')](),controller[_0x2f0d('0xe')]);router[_0x2f0d('0x8')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x2f0d('0xf')]);router[_0x2f0d('0x8')]('/:id/messages',auth[_0x2f0d('0x9')](),controller[_0x2f0d('0x10')]);router['get'](_0x2f0d('0x11'),auth[_0x2f0d('0xd')](),controller['getMyMessages']);router[_0x2f0d('0x8')](_0x2f0d('0x12'),auth[_0x2f0d('0x9')](),controller[_0x2f0d('0x13')]);router['post']('/',auth[_0x2f0d('0x9')](),controller[_0x2f0d('0x14')]);router[_0x2f0d('0x15')](_0x2f0d('0x16'),auth[_0x2f0d('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3948a7,_0x43c695,_0x388cc5){_0x388cc5(null,path[_0x2f0d('0x17')](config[_0x2f0d('0x18')],_0x2f0d('0x19')));},'filename':function(_0x502f11,_0x3bb1be,_0x12611b){_0x12611b(null,util[_0x2f0d('0x1a')]('%s-%s',Date[_0x2f0d('0x1b')](),_0x3bb1be[_0x2f0d('0x1c')][_0x2f0d('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2f0d('0x15')](_0x2f0d('0x1e'),upload[_0x2f0d('0x1f')](_0x2f0d('0x20')),controller[_0x2f0d('0x21')]);router['post']('/:id/messages',auth[_0x2f0d('0xd')](),controller[_0x2f0d('0x22')]);router[_0x2f0d('0x15')](_0x2f0d('0x23'),auth['isAuthenticated'](),interaction[_0x2f0d('0x24')](_0x2f0d('0x25'),_0x2f0d('0x26')),controller[_0x2f0d('0x27')]);router['put'](_0x2f0d('0xc'),auth['isAuthenticated'](),interaction[_0x2f0d('0x24')](_0x2f0d('0x25'),'chatinteraction:update'),controller['update']);router[_0x2f0d('0x28')](_0x2f0d('0x29'),controller[_0x2f0d('0x2a')]);router[_0x2f0d('0x28')](_0x2f0d('0x2b'),auth[_0x2f0d('0xd')](),controller[_0x2f0d('0x2c')]);router[_0x2f0d('0x28')](_0x2f0d('0x2d'),controller[_0x2f0d('0x2e')]);router['delete'](_0x2f0d('0xc'),auth[_0x2f0d('0x9')](),interaction[_0x2f0d('0x24')](_0x2f0d('0x25'),'chatinteraction:destroy'),controller[_0x2f0d('0x2f')]);router['delete'](_0x2f0d('0x23'),auth['isAuthenticated'](),controller[_0x2f0d('0x30')]);module['exports']=router; \ No newline at end of file +var _0x0358=['format','%s-%s','originalname','replace','/:id/attachment_upload','single','file','/:id/messages','addMessage','/:id/tags','put','tracked','chatinteraction:update','update','abandon','chat','chatinteraction:destroy','removeTags','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','/:id','isChatInteractionAuthorized','attachmentDownload','isAuthenticated','getMessages','getMyMessages','/:id/download','create','post','/:id/vidaoo','root','server/files/attachments/'];(function(_0x53d0f2,_0x461fff){var _0x4039fe=function(_0x1da59f){while(--_0x1da59f){_0x53d0f2['push'](_0x53d0f2['shift']());}};_0x4039fe(++_0x461fff);}(_0x0358,0x8a));var _0x8035=function(_0x47d68f,_0x767023){_0x47d68f=_0x47d68f-0x0;var _0x4ddfaa=_0x0358[_0x47d68f];return _0x4ddfaa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8035('0x0'));var timeout=require(_0x8035('0x1'));var express=require('express');var router=express[_0x8035('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8035('0x3'));var interaction=require(_0x8035('0x4'));var config=require(_0x8035('0x5'));var controller=require(_0x8035('0x6'));router[_0x8035('0x7')]('/',auth['isAuthenticated'](),controller[_0x8035('0x8')]);router[_0x8035('0x7')](_0x8035('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x8035('0x7')](_0x8035('0xa'),auth[_0x8035('0xb')](),controller['show']);router[_0x8035('0x7')]('/:id/attachment_download',auth[_0x8035('0xb')](),controller[_0x8035('0xc')]);router['get']('/:id/messages',auth[_0x8035('0xd')](),controller[_0x8035('0xe')]);router['get']('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0x8035('0xf')]);router[_0x8035('0x7')](_0x8035('0x10'),auth[_0x8035('0xd')](),controller['download']);router['post']('/',auth[_0x8035('0xd')](),controller[_0x8035('0x11')]);router[_0x8035('0x12')](_0x8035('0x13'),auth[_0x8035('0xd')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xa56158,_0x479171,_0x4b5a4a){_0x4b5a4a(null,path['join'](config[_0x8035('0x14')],_0x8035('0x15')));},'filename':function(_0xaf5a68,_0x18423f,_0x458481){_0x458481(null,util[_0x8035('0x16')](_0x8035('0x17'),Date['now'](),_0x18423f[_0x8035('0x18')][_0x8035('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8035('0x12')](_0x8035('0x1a'),upload[_0x8035('0x1b')](_0x8035('0x1c')),controller['attachmentUpload']);router[_0x8035('0x12')](_0x8035('0x1d'),auth[_0x8035('0xb')](),controller[_0x8035('0x1e')]);router[_0x8035('0x12')](_0x8035('0x1f'),auth[_0x8035('0xd')](),interaction['tracked']('chat','chatinteraction:addtags'),controller['addTags']);router[_0x8035('0x20')]('/:id',auth[_0x8035('0xd')](),interaction[_0x8035('0x21')]('chat',_0x8035('0x22')),controller[_0x8035('0x23')]);router['put']('/:id/custom_update',controller['customUpdate']);router['put']('/:id/abandon',auth[_0x8035('0xb')](),controller[_0x8035('0x24')]);router['put']('/:id/close',controller['close']);router['delete'](_0x8035('0xa'),auth['isAuthenticated'](),interaction[_0x8035('0x21')](_0x8035('0x25'),_0x8035('0x26')),controller['destroy']);router['delete'](_0x8035('0x1f'),auth['isAuthenticated'](),controller[_0x8035('0x27')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 1ad6c9a..31fc503 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js +++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22f5=['exports','medium','BOOLEAN','INTEGER'];(function(_0xb499da,_0x2e8849){var _0x482dd6=function(_0x2b86ca){while(--_0x2b86ca){_0xb499da['push'](_0xb499da['shift']());}};_0x482dd6(++_0x2e8849);}(_0x22f5,0x70));var _0x522f=function(_0x797af1,_0x23abb1){_0x797af1=_0x797af1-0x0;var _0x4cef9c=_0x22f5[_0x797af1];return _0x4cef9c;};'use strict';var Sequelize=require('sequelize');module[_0x522f('0x0')]={'body':{'type':Sequelize['TEXT'](_0x522f('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x522f('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x522f('0x3')]}}; \ No newline at end of file +var _0x07ed=['exports','medium','INTEGER','sequelize'];(function(_0x55f8fa,_0x616528){var _0x20a9a9=function(_0x337bb5){while(--_0x337bb5){_0x55f8fa['push'](_0x55f8fa['shift']());}};_0x20a9a9(++_0x616528);}(_0x07ed,0x6f));var _0xd07e=function(_0x2ab8f4,_0x192abd){_0x2ab8f4=_0x2ab8f4-0x0;var _0xf1bee6=_0x07ed[_0x2ab8f4];return _0xf1bee6;};'use strict';var Sequelize=require(_0xd07e('0x0'));module[_0xd07e('0x1')]={'body':{'type':Sequelize['TEXT'](_0xd07e('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd07e('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 0a28ba2..1f25bf8 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.controller.js +++ b/server/api/chatInternalMessage/chatInternalMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac84=['describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','user','fullname','userpic','internal','online','lastLoginAt','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','-createdAt','all','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','sort','where','pick','merge','filter','options','include','rows','show','keys','includeAll','find','catch','body','params'];(function(_0x4811ee,_0x1d5ce9){var _0x354c84=function(_0x5184e3){while(--_0x5184e3){_0x4811ee['push'](_0x4811ee['shift']());}};_0x354c84(++_0x1d5ce9);}(_0xac84,0x15a));var _0x4ac8=function(_0x2494f5,_0x1f1d3c){_0x2494f5=_0x2494f5-0x0;var _0x5c60a4=_0xac84[_0x2494f5];return _0x5c60a4;};'use strict';var emlformat=require(_0x4ac8('0x0'));var rimraf=require(_0x4ac8('0x1'));var zipdir=require(_0x4ac8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4ac8('0x3'));var BPromise=require(_0x4ac8('0x4'));var Mustache=require(_0x4ac8('0x5'));var util=require(_0x4ac8('0x6'));var path=require(_0x4ac8('0x7'));var sox=require(_0x4ac8('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4ac8('0x9'));var _=require('lodash');var squel=require(_0x4ac8('0xa'));var crypto=require(_0x4ac8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4ac8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4ac8('0xd'));var Papa=require('papaparse');var Redis=require(_0x4ac8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4ac8('0xf'));var as=require(_0x4ac8('0x10'));var hardwareService=require(_0x4ac8('0x11'));var logger=require(_0x4ac8('0x12'))(_0x4ac8('0x13'));var utils=require(_0x4ac8('0x14'));var config=require(_0x4ac8('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4ac8('0x16')]=_[_0x4ac8('0x17')](config[_0x4ac8('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4ac8('0x16')]));require(_0x4ac8('0x18'))[_0x4ac8('0x19')](socket);function respondWithStatusCode(_0x118e4f,_0x561850){_0x561850=_0x561850||0xcc;return function(_0x25bc1e){if(_0x25bc1e){return _0x118e4f[_0x4ac8('0x1a')](_0x561850);}return _0x118e4f[_0x4ac8('0x1b')](_0x561850)[_0x4ac8('0x1c')]();};}function respondWithResult(_0x1378c1,_0x1c3889){_0x1c3889=_0x1c3889||0xc8;return function(_0x1f086d){if(_0x1f086d){return _0x1378c1[_0x4ac8('0x1b')](_0x1c3889)[_0x4ac8('0x1d')](_0x1f086d);}};}function respondWithFilteredResult(_0x28dad6,_0x5d7a6e){return function(_0x2713f6){if(_0x2713f6){var _0x4b7a7e=typeof _0x5d7a6e['offset']===_0x4ac8('0x1e')&&typeof _0x5d7a6e[_0x4ac8('0x1f')]===_0x4ac8('0x1e');var _0x2d7e2a=_0x2713f6[_0x4ac8('0x20')];var _0x505553=_0x4b7a7e?0x0:_0x5d7a6e[_0x4ac8('0x21')];var _0x4ada6a=_0x4b7a7e?_0x2713f6[_0x4ac8('0x20')]:_0x5d7a6e[_0x4ac8('0x21')]+_0x5d7a6e[_0x4ac8('0x1f')];var _0x4adc7a;if(_0x4ada6a>=_0x2d7e2a){_0x4ada6a=_0x2d7e2a;_0x4adc7a=0xc8;}else{_0x4adc7a=0xce;}_0x28dad6[_0x4ac8('0x1b')](_0x4adc7a);return _0x28dad6[_0x4ac8('0x22')](_0x4ac8('0x23'),_0x505553+'-'+_0x4ada6a+'/'+_0x2d7e2a)[_0x4ac8('0x1d')](_0x2713f6);}return null;};}function patchUpdates(_0x3ea875){return function(_0x116d5f){try{jsonpatch[_0x4ac8('0x24')](_0x116d5f,_0x3ea875,!![]);}catch(_0x51a575){return BPromise[_0x4ac8('0x25')](_0x51a575);}return _0x116d5f[_0x4ac8('0x26')]();};}function saveUpdates(_0x5e39a6,_0x24a0a1){return function(_0x4f0069){if(_0x4f0069){return _0x4f0069[_0x4ac8('0x27')](_0x5e39a6)[_0x4ac8('0x28')](function(_0x419907){return _0x419907;});}return null;};}function removeEntity(_0x5fca00,_0x206faf){return function(_0x30a0fb){if(_0x30a0fb){return _0x30a0fb[_0x4ac8('0x29')]()[_0x4ac8('0x28')](function(){_0x5fca00[_0x4ac8('0x1b')](0xcc)[_0x4ac8('0x1c')]();});}};}function handleEntityNotFound(_0x5738e4,_0x13730d){return function(_0x1e15a7){if(!_0x1e15a7){_0x5738e4[_0x4ac8('0x1a')](0x194);}return _0x1e15a7;};}function handleError(_0x3c05fd,_0x465a95){_0x465a95=_0x465a95||0x1f4;return function(_0x46a41e){logger['error'](_0x46a41e[_0x4ac8('0x2a')]);if(_0x46a41e[_0x4ac8('0x2b')]){delete _0x46a41e[_0x4ac8('0x2b')];}_0x3c05fd['status'](_0x465a95)[_0x4ac8('0x2c')](_0x46a41e);};}exports[_0x4ac8('0x2d')]=function(_0x448b60,_0x5048af){var _0x1f6d5e={},_0x1daf4a={},_0x11cfaf={'count':0x0,'rows':[]};var _0x13b078=_[_0x4ac8('0x2e')](db[_0x4ac8('0x2f')][_0x4ac8('0x30')],function(_0x53fd0f){return{'name':_0x53fd0f[_0x4ac8('0x31')],'type':_0x53fd0f[_0x4ac8('0x32')][_0x4ac8('0x33')]};});_0x1daf4a[_0x4ac8('0x34')]=_[_0x4ac8('0x2e')](_0x13b078,_0x4ac8('0x2b'));_0x1daf4a[_0x4ac8('0x35')]=_['keys'](_0x448b60[_0x4ac8('0x35')]);_0x1daf4a[_0x4ac8('0x36')]=_[_0x4ac8('0x37')](_0x1daf4a[_0x4ac8('0x34')],_0x1daf4a[_0x4ac8('0x35')]);_0x1f6d5e['attributes']=_['intersection'](_0x1daf4a[_0x4ac8('0x34')],qs[_0x4ac8('0x38')](_0x448b60[_0x4ac8('0x35')][_0x4ac8('0x38')]));_0x1f6d5e[_0x4ac8('0x39')]=_0x1f6d5e[_0x4ac8('0x39')][_0x4ac8('0x3a')]?_0x1f6d5e[_0x4ac8('0x39')]:_0x1daf4a[_0x4ac8('0x34')];if(!_0x448b60[_0x4ac8('0x35')]['hasOwnProperty']('nolimit')){_0x1f6d5e[_0x4ac8('0x1f')]=qs['limit'](_0x448b60[_0x4ac8('0x35')][_0x4ac8('0x1f')]);_0x1f6d5e[_0x4ac8('0x21')]=qs[_0x4ac8('0x21')](_0x448b60['query'][_0x4ac8('0x21')]);}_0x1f6d5e['order']=qs[_0x4ac8('0x3b')](_0x448b60[_0x4ac8('0x35')][_0x4ac8('0x3b')]);_0x1f6d5e[_0x4ac8('0x3c')]=qs['filters'](_[_0x4ac8('0x3d')](_0x448b60[_0x4ac8('0x35')],_0x1daf4a[_0x4ac8('0x36')]),_0x13b078);if(_0x448b60['query']['filter']){_0x1f6d5e[_0x4ac8('0x3c')]=_[_0x4ac8('0x3e')](_0x1f6d5e[_0x4ac8('0x3c')],{'$or':_[_0x4ac8('0x2e')](_0x13b078,function(_0x1b7587){if(_0x1b7587[_0x4ac8('0x32')]!=='VIRTUAL'){var _0x26527a={};_0x26527a[_0x1b7587[_0x4ac8('0x2b')]]={'$like':'%'+_0x448b60[_0x4ac8('0x35')][_0x4ac8('0x3f')]+'%'};return _0x26527a;}})});}_0x1f6d5e=_[_0x4ac8('0x3e')]({},_0x1f6d5e,_0x448b60[_0x4ac8('0x40')]);var _0x5567c3={'where':_0x1f6d5e['where']};return db[_0x4ac8('0x2f')]['count'](_0x5567c3)[_0x4ac8('0x28')](function(_0x17c333){_0x11cfaf[_0x4ac8('0x20')]=_0x17c333;if(_0x448b60[_0x4ac8('0x35')]['includeAll']){_0x1f6d5e[_0x4ac8('0x41')]=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x1f6d5e);})[_0x4ac8('0x28')](function(_0x5b51f2){_0x11cfaf[_0x4ac8('0x42')]=_0x5b51f2;return _0x11cfaf;})[_0x4ac8('0x28')](respondWithFilteredResult(_0x5048af,_0x1f6d5e))['catch'](handleError(_0x5048af,null));};exports[_0x4ac8('0x43')]=function(_0x4f704c,_0x445384){var _0x24c225={'raw':!![],'where':{'id':_0x4f704c['params']['id']}},_0xf0b157={};_0xf0b157['model']=_[_0x4ac8('0x44')](db[_0x4ac8('0x2f')][_0x4ac8('0x30')]);_0xf0b157[_0x4ac8('0x35')]=_['keys'](_0x4f704c[_0x4ac8('0x35')]);_0xf0b157[_0x4ac8('0x36')]=_[_0x4ac8('0x37')](_0xf0b157[_0x4ac8('0x34')],_0xf0b157[_0x4ac8('0x35')]);_0x24c225[_0x4ac8('0x39')]=_['intersection'](_0xf0b157[_0x4ac8('0x34')],qs[_0x4ac8('0x38')](_0x4f704c[_0x4ac8('0x35')][_0x4ac8('0x38')]));_0x24c225[_0x4ac8('0x39')]=_0x24c225[_0x4ac8('0x39')]['length']?_0x24c225[_0x4ac8('0x39')]:_0xf0b157[_0x4ac8('0x34')];if(_0x4f704c[_0x4ac8('0x35')][_0x4ac8('0x45')]){_0x24c225[_0x4ac8('0x41')]=[{'all':!![]}];}_0x24c225=_['merge']({},_0x24c225,_0x4f704c[_0x4ac8('0x40')]);return db['ChatInternalMessage'][_0x4ac8('0x46')](_0x24c225)['then'](handleEntityNotFound(_0x445384,null))['then'](respondWithResult(_0x445384,null))[_0x4ac8('0x47')](handleError(_0x445384,null));};exports['create']=function(_0x1404ff,_0x3402e4){return db[_0x4ac8('0x2f')]['create'](_0x1404ff[_0x4ac8('0x48')],{})[_0x4ac8('0x28')](respondWithResult(_0x3402e4,0xc9))['catch'](handleError(_0x3402e4,null));};exports['update']=function(_0x5e0e16,_0x96ca89){if(_0x5e0e16[_0x4ac8('0x48')]['id']){delete _0x5e0e16[_0x4ac8('0x48')]['id'];}return db['ChatInternalMessage'][_0x4ac8('0x46')]({'where':{'id':_0x5e0e16[_0x4ac8('0x49')]['id']}})[_0x4ac8('0x28')](handleEntityNotFound(_0x96ca89,null))[_0x4ac8('0x28')](saveUpdates(_0x5e0e16['body'],null))[_0x4ac8('0x28')](respondWithResult(_0x96ca89,null))[_0x4ac8('0x47')](handleError(_0x96ca89,null));};exports[_0x4ac8('0x29')]=function(_0x825a42,_0x530d29){return db[_0x4ac8('0x2f')][_0x4ac8('0x46')]({'where':{'id':_0x825a42[_0x4ac8('0x49')]['id']}})[_0x4ac8('0x28')](handleEntityNotFound(_0x530d29,null))[_0x4ac8('0x28')](removeEntity(_0x530d29,null))[_0x4ac8('0x47')](handleError(_0x530d29,null));};exports[_0x4ac8('0x4a')]=function(_0x363bbe,_0x15eca2){return db['ChatInternalMessage']['describe']()['then'](respondWithResult(_0x15eca2,null))[_0x4ac8('0x47')](handleError(_0x15eca2,null));};function wrapUser(_0x3dccb1){return function(_0x258f80){var _0x1042bf=_0x3dccb1[_0x4ac8('0x4b')]({'plain':!![]});_0x1042bf[_0x4ac8('0x4c')]=[];if(_0x258f80){_0x1042bf[_0x4ac8('0x4d')]=_0x258f80[_0x4ac8('0x4e')];_0x1042bf[_0x4ac8('0x4f')]=_0x258f80;}else{_0x1042bf[_0x4ac8('0x4d')]=moment(0x0)['format'](_0x4ac8('0x50'));_0x1042bf[_0x4ac8('0x4f')]={};}return _0x1042bf;};}exports[_0x4ac8('0x51')]=function(_0x35b61,_0x3cc5d3,_0x255b1f){var _0x3c4efc=[];return db[_0x4ac8('0x52')][_0x4ac8('0x53')]({'where':{'role':[_0x4ac8('0x54'),_0x4ac8('0x55'),_0x4ac8('0x56')]},'attributes':['id',_0x4ac8('0x57'),_0x4ac8('0x2b'),'role',_0x4ac8('0x58'),_0x4ac8('0x59'),_0x4ac8('0x5a'),_0x4ac8('0x5b'),'allowmessenger','showWebBar'],'order':qs[_0x4ac8('0x3b')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x4ac8('0x5c'),'attributes':['id',_0x4ac8('0x2b'),_0x4ac8('0x32')],'through':{'attributes':[]}}]})['then'](function(_0x47af1d){if(_0x47af1d){var _0x49f852=_0x35b61[_0x4ac8('0x56')][_0x4ac8('0x4b')]({'plain':!![]});if(!_0x49f852)throw new Error(_0x4ac8('0x5d'));if(_0x49f852[_0x4ac8('0x5e')]==='user'){return db[_0x4ac8('0x5f')][_0x4ac8('0x46')]({'where':{'name':_0x4ac8('0x60'),'userProfileId':_0x49f852[_0x4ac8('0x61')]},'raw':!![]})['then'](function(_0x4812c6){if(_0x4812c6){if(_0x4812c6[_0x4ac8('0x62')]===0x0){return db[_0x4ac8('0x63')][_0x4ac8('0x53')]({'where':{'sectionId':_0x4812c6['id']},'raw':!![]})[_0x4ac8('0x28')](function(_0x103c6e){var _0x38802b=[];if(_[_0x4ac8('0x64')](_0x103c6e)){_0x38802b=_[_0x4ac8('0x3f')](_0x47af1d,function(_0x372f4b){if(_0x372f4b['role']!==_0x4ac8('0x54')){return _0x372f4b;}});return _0x38802b;}else{for(var _0x59766d=0x0;_0x59766d<_0x47af1d[_0x4ac8('0x3a')];_0x59766d++){var _0x33f426=_0x47af1d[_0x59766d];if(_0x33f426[_0x4ac8('0x5e')]==='agent'){var _0x1c438f=_[_0x4ac8('0x46')](_0x103c6e,function(_0x5c60ba){return _0x5c60ba[_0x4ac8('0x65')]===_0x33f426['id'];});if(_0x1c438f)_0x38802b[_0x4ac8('0x66')](_0x33f426);}else{_0x38802b[_0x4ac8('0x66')](_0x33f426);}}return _0x38802b;}});}else{return _0x47af1d;}}else{var _0x4899b7=_[_0x4ac8('0x3f')](_0x47af1d,function(_0x495b32){if(_0x495b32[_0x4ac8('0x5e')]!==_0x4ac8('0x54')){return _0x495b32;}});return _0x4899b7;}});}else{return _0x47af1d;}}})['then'](function(_0x5515d2){var _0x428dc1=[];if(_0x5515d2){_0x3c4efc=_0x5515d2;for(var _0x12f6f6=0x0;_0x12f6f6<_0x5515d2[_0x4ac8('0x3a')];_0x12f6f6+=0x1){_0x3c4efc[_0x12f6f6][_0x4ac8('0x4c')]=[];_0x428dc1[_0x4ac8('0x66')](db[_0x4ac8('0x2f')][_0x4ac8('0x46')]({'where':{'FromId':[_0x35b61[_0x4ac8('0x56')]['id'],_0x5515d2[_0x12f6f6]['id']],'ToId':[_0x35b61['user']['id'],_0x5515d2[_0x12f6f6]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId','ToId','read',_0x4ac8('0x48')],'order':qs[_0x4ac8('0x3b')](_0x4ac8('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4ac8('0x28')](wrapUser(_0x5515d2[_0x12f6f6])));}return BPromise[_0x4ac8('0x68')](_0x428dc1);}return[];})[_0x4ac8('0x28')](function(_0x4a9c01){return{'rows':_0x4a9c01,'count':_0x4a9c01[_0x4ac8('0x3a')]};})[_0x4ac8('0x28')](respondWithResult(_0x3cc5d3,null))[_0x4ac8('0x47')](handleError(_0x3cc5d3,null));}; \ No newline at end of file +var _0x19ee=['-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','catch','show','params','find','create','update','body','describe','get','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','role','userpic','internal','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','messages','push','FromId','ToId'];(function(_0x557507,_0x197b78){var _0x4c07d6=function(_0x524f78){while(--_0x524f78){_0x557507['push'](_0x557507['shift']());}};_0x4c07d6(++_0x197b78);}(_0x19ee,0x1c2));var _0xe19e=function(_0x543c51,_0xff0084){_0x543c51=_0x543c51-0x0;var _0x360555=_0x19ee[_0x543c51];return _0x360555;};'use strict';var emlformat=require(_0xe19e('0x0'));var rimraf=require(_0xe19e('0x1'));var zipdir=require(_0xe19e('0x2'));var jsonpatch=require(_0xe19e('0x3'));var rp=require(_0xe19e('0x4'));var moment=require(_0xe19e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe19e('0x6'));var path=require(_0xe19e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe19e('0x8'));var _=require('lodash');var squel=require(_0xe19e('0x9'));var crypto=require(_0xe19e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe19e('0xb'));var toCsv=require(_0xe19e('0xc'));var querystring=require(_0xe19e('0xd'));var Papa=require(_0xe19e('0xe'));var Redis=require(_0xe19e('0xf'));var authService=require(_0xe19e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe19e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe19e('0x12'))(_0xe19e('0x13'));var utils=require(_0xe19e('0x14'));var config=require(_0xe19e('0x15'));var licenseUtil=require(_0xe19e('0x16'));var db=require('../../mysqldb')['db'];config[_0xe19e('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe19e('0x18'))(new Redis(config[_0xe19e('0x17')]));require('./chatInternalMessage.socket')[_0xe19e('0x19')](socket);function respondWithStatusCode(_0x3b66f7,_0x17987b){_0x17987b=_0x17987b||0xcc;return function(_0x2cd82c){if(_0x2cd82c){return _0x3b66f7[_0xe19e('0x1a')](_0x17987b);}return _0x3b66f7[_0xe19e('0x1b')](_0x17987b)[_0xe19e('0x1c')]();};}function respondWithResult(_0x4a1e43,_0x4bfe6e){_0x4bfe6e=_0x4bfe6e||0xc8;return function(_0x2e3840){if(_0x2e3840){return _0x4a1e43['status'](_0x4bfe6e)['json'](_0x2e3840);}};}function respondWithFilteredResult(_0x192a48,_0x498ea4){return function(_0x29bb1a){if(_0x29bb1a){var _0x337e45=typeof _0x498ea4[_0xe19e('0x1d')]===_0xe19e('0x1e')&&typeof _0x498ea4[_0xe19e('0x1f')]===_0xe19e('0x1e');var _0x31e334=_0x29bb1a[_0xe19e('0x20')];var _0x49ec9f=_0x337e45?0x0:_0x498ea4[_0xe19e('0x1d')];var _0xe707d0=_0x337e45?_0x29bb1a[_0xe19e('0x20')]:_0x498ea4[_0xe19e('0x1d')]+_0x498ea4[_0xe19e('0x1f')];var _0x3c49dd;if(_0xe707d0>=_0x31e334){_0xe707d0=_0x31e334;_0x3c49dd=0xc8;}else{_0x3c49dd=0xce;}_0x192a48['status'](_0x3c49dd);return _0x192a48[_0xe19e('0x21')](_0xe19e('0x22'),_0x49ec9f+'-'+_0xe707d0+'/'+_0x31e334)[_0xe19e('0x23')](_0x29bb1a);}return null;};}function patchUpdates(_0x43fe95){return function(_0x4d8e67){try{jsonpatch[_0xe19e('0x24')](_0x4d8e67,_0x43fe95,!![]);}catch(_0x1b808e){return BPromise[_0xe19e('0x25')](_0x1b808e);}return _0x4d8e67[_0xe19e('0x26')]();};}function saveUpdates(_0x4c7d58,_0x18e890){return function(_0x2a1981){if(_0x2a1981){return _0x2a1981['update'](_0x4c7d58)['then'](function(_0x55ddec){return _0x55ddec;});}return null;};}function removeEntity(_0x3560f2,_0x93841d){return function(_0x1534f7){if(_0x1534f7){return _0x1534f7[_0xe19e('0x27')]()[_0xe19e('0x28')](function(){_0x3560f2[_0xe19e('0x1b')](0xcc)[_0xe19e('0x1c')]();});}};}function handleEntityNotFound(_0x2c3539,_0x50c17d){return function(_0x2fb703){if(!_0x2fb703){_0x2c3539[_0xe19e('0x1a')](0x194);}return _0x2fb703;};}function handleError(_0x5e7247,_0x213ab1){_0x213ab1=_0x213ab1||0x1f4;return function(_0xf3c4f3){logger[_0xe19e('0x29')](_0xf3c4f3[_0xe19e('0x2a')]);if(_0xf3c4f3['name']){delete _0xf3c4f3[_0xe19e('0x2b')];}_0x5e7247['status'](_0x213ab1)[_0xe19e('0x2c')](_0xf3c4f3);};}exports[_0xe19e('0x2d')]=function(_0x1320e3,_0x4fc526){var _0x2dd192={},_0x5153f7={},_0x1b0cb1={'count':0x0,'rows':[]};var _0x5101a8=_[_0xe19e('0x2e')](db['ChatInternalMessage'][_0xe19e('0x2f')],function(_0x2ac646){return{'name':_0x2ac646[_0xe19e('0x30')],'type':_0x2ac646['type'][_0xe19e('0x31')]};});_0x5153f7[_0xe19e('0x32')]=_[_0xe19e('0x2e')](_0x5101a8,_0xe19e('0x2b'));_0x5153f7[_0xe19e('0x33')]=_[_0xe19e('0x34')](_0x1320e3[_0xe19e('0x33')]);_0x5153f7[_0xe19e('0x35')]=_[_0xe19e('0x36')](_0x5153f7[_0xe19e('0x32')],_0x5153f7['query']);_0x2dd192[_0xe19e('0x37')]=_[_0xe19e('0x36')](_0x5153f7[_0xe19e('0x32')],qs[_0xe19e('0x38')](_0x1320e3[_0xe19e('0x33')]['fields']));_0x2dd192[_0xe19e('0x37')]=_0x2dd192[_0xe19e('0x37')][_0xe19e('0x39')]?_0x2dd192[_0xe19e('0x37')]:_0x5153f7[_0xe19e('0x32')];if(!_0x1320e3[_0xe19e('0x33')][_0xe19e('0x3a')](_0xe19e('0x3b'))){_0x2dd192[_0xe19e('0x1f')]=qs['limit'](_0x1320e3[_0xe19e('0x33')][_0xe19e('0x1f')]);_0x2dd192[_0xe19e('0x1d')]=qs[_0xe19e('0x1d')](_0x1320e3[_0xe19e('0x33')][_0xe19e('0x1d')]);}_0x2dd192[_0xe19e('0x3c')]=qs[_0xe19e('0x3d')](_0x1320e3[_0xe19e('0x33')][_0xe19e('0x3d')]);_0x2dd192[_0xe19e('0x3e')]=qs[_0xe19e('0x35')](_[_0xe19e('0x3f')](_0x1320e3[_0xe19e('0x33')],_0x5153f7['filters']),_0x5101a8);if(_0x1320e3[_0xe19e('0x33')][_0xe19e('0x40')]){_0x2dd192[_0xe19e('0x3e')]=_[_0xe19e('0x41')](_0x2dd192[_0xe19e('0x3e')],{'$or':_[_0xe19e('0x2e')](_0x5101a8,function(_0xae93c8){if(_0xae93c8[_0xe19e('0x42')]!==_0xe19e('0x43')){var _0x255b9c={};_0x255b9c[_0xae93c8[_0xe19e('0x2b')]]={'$like':'%'+_0x1320e3[_0xe19e('0x33')][_0xe19e('0x40')]+'%'};return _0x255b9c;}})});}_0x2dd192=_[_0xe19e('0x41')]({},_0x2dd192,_0x1320e3[_0xe19e('0x44')]);var _0x1e1512={'where':_0x2dd192['where']};return db[_0xe19e('0x45')][_0xe19e('0x20')](_0x1e1512)[_0xe19e('0x28')](function(_0x408957){_0x1b0cb1['count']=_0x408957;if(_0x1320e3[_0xe19e('0x33')][_0xe19e('0x46')]){_0x2dd192[_0xe19e('0x47')]=[{'all':!![]}];}return db[_0xe19e('0x45')][_0xe19e('0x48')](_0x2dd192);})[_0xe19e('0x28')](function(_0x4c1060){_0x1b0cb1['rows']=_0x4c1060;return _0x1b0cb1;})[_0xe19e('0x28')](respondWithFilteredResult(_0x4fc526,_0x2dd192))[_0xe19e('0x49')](handleError(_0x4fc526,null));};exports[_0xe19e('0x4a')]=function(_0x4c4340,_0x35c15b){var _0x5b80b7={'raw':!![],'where':{'id':_0x4c4340[_0xe19e('0x4b')]['id']}},_0x3c8c00={};_0x3c8c00[_0xe19e('0x32')]=_['keys'](db[_0xe19e('0x45')][_0xe19e('0x2f')]);_0x3c8c00[_0xe19e('0x33')]=_['keys'](_0x4c4340[_0xe19e('0x33')]);_0x3c8c00['filters']=_[_0xe19e('0x36')](_0x3c8c00[_0xe19e('0x32')],_0x3c8c00['query']);_0x5b80b7['attributes']=_[_0xe19e('0x36')](_0x3c8c00['model'],qs[_0xe19e('0x38')](_0x4c4340[_0xe19e('0x33')][_0xe19e('0x38')]));_0x5b80b7[_0xe19e('0x37')]=_0x5b80b7[_0xe19e('0x37')][_0xe19e('0x39')]?_0x5b80b7[_0xe19e('0x37')]:_0x3c8c00[_0xe19e('0x32')];if(_0x4c4340[_0xe19e('0x33')]['includeAll']){_0x5b80b7[_0xe19e('0x47')]=[{'all':!![]}];}_0x5b80b7=_['merge']({},_0x5b80b7,_0x4c4340[_0xe19e('0x44')]);return db[_0xe19e('0x45')][_0xe19e('0x4c')](_0x5b80b7)['then'](handleEntityNotFound(_0x35c15b,null))[_0xe19e('0x28')](respondWithResult(_0x35c15b,null))[_0xe19e('0x49')](handleError(_0x35c15b,null));};exports[_0xe19e('0x4d')]=function(_0x548bc3,_0x3dd774){return db[_0xe19e('0x45')][_0xe19e('0x4d')](_0x548bc3['body'],{})[_0xe19e('0x28')](respondWithResult(_0x3dd774,0xc9))['catch'](handleError(_0x3dd774,null));};exports[_0xe19e('0x4e')]=function(_0x28d440,_0x569bd9){if(_0x28d440[_0xe19e('0x4f')]['id']){delete _0x28d440[_0xe19e('0x4f')]['id'];}return db[_0xe19e('0x45')]['find']({'where':{'id':_0x28d440[_0xe19e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x569bd9,null))[_0xe19e('0x28')](saveUpdates(_0x28d440[_0xe19e('0x4f')],null))[_0xe19e('0x28')](respondWithResult(_0x569bd9,null))[_0xe19e('0x49')](handleError(_0x569bd9,null));};exports['destroy']=function(_0x47ca51,_0x27a178){return db[_0xe19e('0x45')]['find']({'where':{'id':_0x47ca51[_0xe19e('0x4b')]['id']}})[_0xe19e('0x28')](handleEntityNotFound(_0x27a178,null))['then'](removeEntity(_0x27a178,null))[_0xe19e('0x49')](handleError(_0x27a178,null));};exports['describe']=function(_0x43daed,_0x53b6f5){return db[_0xe19e('0x45')][_0xe19e('0x50')]()['then'](respondWithResult(_0x53b6f5,null))[_0xe19e('0x49')](handleError(_0x53b6f5,null));};function wrapUser(_0x5b96cc){return function(_0x253802){var _0x951bee=_0x5b96cc[_0xe19e('0x51')]({'plain':!![]});_0x951bee['messages']=[];if(_0x253802){_0x951bee[_0xe19e('0x52')]=_0x253802[_0xe19e('0x53')];_0x951bee[_0xe19e('0x54')]=_0x253802;}else{_0x951bee['lastMessageAt']=moment(0x0)['format'](_0xe19e('0x55'));_0x951bee[_0xe19e('0x54')]={};}return _0x951bee;};}exports[_0xe19e('0x56')]=function(_0x418df4,_0x51022c,_0x1a0bfe){var _0x405339=[];return db[_0xe19e('0x57')][_0xe19e('0x48')]({'where':{'role':['agent',_0xe19e('0x58'),_0xe19e('0x59')]},'attributes':['id',_0xe19e('0x5a'),_0xe19e('0x2b'),_0xe19e('0x5b'),_0xe19e('0x5c'),_0xe19e('0x5d'),'online','lastLoginAt',_0xe19e('0x5e'),_0xe19e('0x5f')],'order':qs[_0xe19e('0x3d')](_0xe19e('0x60')),'include':[{'model':db[_0xe19e('0x61')],'as':_0xe19e('0x62'),'attributes':['id',_0xe19e('0x2b'),_0xe19e('0x42')],'through':{'attributes':[]}}]})[_0xe19e('0x28')](function(_0x56a7ca){if(_0x56a7ca){var _0x304412=_0x418df4[_0xe19e('0x59')][_0xe19e('0x51')]({'plain':!![]});if(!_0x304412)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x304412[_0xe19e('0x5b')]===_0xe19e('0x59')){return db[_0xe19e('0x63')]['find']({'where':{'name':_0xe19e('0x64'),'userProfileId':_0x304412['userProfileId']},'raw':!![]})[_0xe19e('0x28')](function(_0x523e40){if(_0x523e40){if(_0x523e40[_0xe19e('0x65')]===0x0){return db[_0xe19e('0x66')][_0xe19e('0x48')]({'where':{'sectionId':_0x523e40['id']},'raw':!![]})[_0xe19e('0x28')](function(_0x669f01){var _0x41a609=[];if(_[_0xe19e('0x67')](_0x669f01)){_0x41a609=_[_0xe19e('0x40')](_0x56a7ca,function(_0x441c41){if(_0x441c41['role']!==_0xe19e('0x68')){return _0x441c41;}});return _0x41a609;}else{for(var _0x357394=0x0;_0x357394<_0x56a7ca[_0xe19e('0x39')];_0x357394++){var _0x16a1c5=_0x56a7ca[_0x357394];if(_0x16a1c5[_0xe19e('0x5b')]===_0xe19e('0x68')){var _0x2d40d7=_['find'](_0x669f01,function(_0x449e66){return _0x449e66[_0xe19e('0x69')]===_0x16a1c5['id'];});if(_0x2d40d7)_0x41a609['push'](_0x16a1c5);}else{_0x41a609['push'](_0x16a1c5);}}return _0x41a609;}});}else{return _0x56a7ca;}}else{var _0x2691c0=_[_0xe19e('0x40')](_0x56a7ca,function(_0x2b3789){if(_0x2b3789['role']!=='agent'){return _0x2b3789;}});return _0x2691c0;}});}else{return _0x56a7ca;}}})[_0xe19e('0x28')](function(_0x3b1a9f){var _0x3f8281=[];if(_0x3b1a9f){_0x405339=_0x3b1a9f;for(var _0x5d477f=0x0;_0x5d477f<_0x3b1a9f[_0xe19e('0x39')];_0x5d477f+=0x1){_0x405339[_0x5d477f][_0xe19e('0x6a')]=[];_0x3f8281[_0xe19e('0x6b')](db['ChatInternalMessage'][_0xe19e('0x4c')]({'where':{'FromId':[_0x418df4['user']['id'],_0x3b1a9f[_0x5d477f]['id']],'ToId':[_0x418df4[_0xe19e('0x59')]['id'],_0x3b1a9f[_0x5d477f]['id']],'ChatGroupId':null},'attributes':['id',_0xe19e('0x53'),_0xe19e('0x6c'),_0xe19e('0x6d'),'read',_0xe19e('0x4f')],'order':qs['sort'](_0xe19e('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe19e('0x28')](wrapUser(_0x3b1a9f[_0x5d477f])));}return BPromise[_0xe19e('0x6f')](_0x3f8281);}return[];})[_0xe19e('0x28')](function(_0x4dfdc3){return{'rows':_0x4dfdc3,'count':_0x4dfdc3[_0xe19e('0x39')]};})[_0xe19e('0x28')](respondWithResult(_0x51022c,null))[_0xe19e('0x49')](handleError(_0x51022c,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 6b619e7..ff1c73f 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.events.js +++ b/server/api/chatInternalMessage/chatInternalMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea21=['hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x3b76f7,_0x566c53){var _0x43984e=function(_0x164f77){while(--_0x164f77){_0x3b76f7['push'](_0x3b76f7['shift']());}};_0x43984e(++_0x566c53);}(_0xea21,0xf4));var _0x1ea2=function(_0x3e1b94,_0x3c4e42){_0x3e1b94=_0x3e1b94-0x0;var _0x8cac39=_0xea21[_0x3e1b94];return _0x8cac39;};'use strict';var EventEmitter=require(_0x1ea2('0x0'));var ChatInternalMessage=require(_0x1ea2('0x1'))['db'][_0x1ea2('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1ea2('0x3')](0x0);var events={'afterCreate':_0x1ea2('0x4'),'afterUpdate':_0x1ea2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1e01aa){return function(_0x4e9772,_0x47f2d2,_0x39dffc){ChatInternalMessageEvents[_0x1ea2('0x6')](_0x1e01aa+':'+_0x4e9772['id'],_0x4e9772);ChatInternalMessageEvents[_0x1ea2('0x6')](_0x1e01aa,_0x4e9772);_0x39dffc(null);};}for(var e in events){if(events[_0x1ea2('0x7')](e)){var event=events[e];ChatInternalMessage[_0x1ea2('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xb10b=['hasOwnProperty','hook','events','ChatInternalMessage','setMaxListeners','save','remove','emit'];(function(_0x4ef8a0,_0x324b65){var _0x433802=function(_0x789516){while(--_0x789516){_0x4ef8a0['push'](_0x4ef8a0['shift']());}};_0x433802(++_0x324b65);}(_0xb10b,0x12a));var _0xbb10=function(_0x3f9aa0,_0x478ec3){_0x3f9aa0=_0x3f9aa0-0x0;var _0x4a82c0=_0xb10b[_0x3f9aa0];return _0x4a82c0;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatInternalMessageEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatInternalMessageEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatInternalMessage[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index dc4fe11..85fb2c5 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.model.js +++ b/server/api/chatInternalMessage/chatInternalMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61ab=['path','rimraf','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x5f47ba,_0x2ccdd8){var _0x3f43d9=function(_0x5ca696){while(--_0x5ca696){_0x5f47ba['push'](_0x5f47ba['shift']());}};_0x3f43d9(++_0x2ccdd8);}(_0x61ab,0x150));var _0xb61a=function(_0x275c74,_0x544e35){_0x275c74=_0x275c74-0x0;var _0x2097e6=_0x61ab[_0x275c74];return _0x2097e6;};'use strict';var _=require(_0xb61a('0x0'));var util=require(_0xb61a('0x1'));var logger=require(_0xb61a('0x2'))('api');var moment=require(_0xb61a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb61a('0x4'));var rimraf=require(_0xb61a('0x5'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x1150e7,_0x592c18){return _0x1150e7['define'](_0xb61a('0x6'),attributes,{'tableName':_0xb61a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb61a('0x8'),'collate':_0xb61a('0x9')});}; \ No newline at end of file +var _0xad0b=['moment','bluebird','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x50c389,_0x5da318){var _0x5ed2c8=function(_0x1984ab){while(--_0x1984ab){_0x50c389['push'](_0x50c389['shift']());}};_0x5ed2c8(++_0x5da318);}(_0xad0b,0x9a));var _0xbad0=function(_0x49ecd3,_0xf2f661){_0x49ecd3=_0x49ecd3-0x0;var _0x503006=_0xad0b[_0x49ecd3];return _0x503006;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbad0('0x0'))(_0xbad0('0x1'));var moment=require(_0xbad0('0x2'));var BPromise=require(_0xbad0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbad0('0x4'));var rimraf=require('rimraf');var config=require(_0xbad0('0x5'));var attributes=require(_0xbad0('0x6'));module[_0xbad0('0x7')]=function(_0x5c1c66,_0x2806df){return _0x5c1c66[_0xbad0('0x8')](_0xbad0('0x9'),attributes,{'tableName':_0xbad0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbad0('0xb'),'collate':_0xbad0('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 19e87b6..f803c86 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.rpc.js +++ b/server/api/chatInternalMessage/chatInternalMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81a9=['redis','defaults','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http'];(function(_0x5a9666,_0x30bc94){var _0x28601f=function(_0x52e447){while(--_0x52e447){_0x5a9666['push'](_0x5a9666['shift']());}};_0x28601f(++_0x30bc94);}(_0x81a9,0x81));var _0x981a=function(_0x4ed865,_0x2f18d){_0x4ed865=_0x4ed865-0x0;var _0xc4e344=_0x81a9[_0x4ed865];return _0xc4e344;};'use strict';var _=require(_0x981a('0x0'));var util=require('util');var moment=require(_0x981a('0x1'));var BPromise=require(_0x981a('0x2'));var rs=require(_0x981a('0x3'));var fs=require('fs');var Redis=require(_0x981a('0x4'));var db=require(_0x981a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x981a('0x6'));var jayson=require(_0x981a('0x7'));var client=jayson['client'][_0x981a('0x8')]({'port':0x232a});config[_0x981a('0x9')]=_[_0x981a('0xa')](config[_0x981a('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x981a('0x9')]));require(_0x981a('0xb'))[_0x981a('0xc')](socket);function respondWithRpcPromise(_0x32f8d9,_0x381c86,_0x2d1b70){return new BPromise(function(_0x41854f,_0x5ab43b){return client[_0x981a('0xd')](_0x32f8d9,_0x2d1b70)['then'](function(_0x5076f9){logger[_0x981a('0xe')](_0x981a('0xf'),_0x381c86,_0x981a('0x10'));logger[_0x981a('0x11')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x381c86,'request\x20sent',JSON[_0x981a('0x12')](_0x5076f9));if(_0x5076f9[_0x981a('0x13')]){if(_0x5076f9['error'][_0x981a('0x14')]===0x1f4){logger[_0x981a('0x13')](_0x981a('0xf'),_0x381c86,_0x5076f9[_0x981a('0x13')][_0x981a('0x15')]);return _0x5ab43b(_0x5076f9[_0x981a('0x13')]['message']);}logger[_0x981a('0x13')](_0x981a('0xf'),_0x381c86,_0x5076f9[_0x981a('0x13')][_0x981a('0x15')]);return _0x41854f(_0x5076f9['error']['message']);}else{logger['info'](_0x981a('0xf'),_0x381c86,_0x981a('0x10'));_0x41854f(_0x5076f9['result'][_0x981a('0x15')]);}})[_0x981a('0x16')](function(_0x2968f8){logger[_0x981a('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x381c86,_0x2968f8);_0x5ab43b(_0x2968f8);});});} \ No newline at end of file +var _0x314a=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x5a3881,_0x13d038){var _0x2ef78b=function(_0x323906){while(--_0x323906){_0x5a3881['push'](_0x5a3881['shift']());}};_0x2ef78b(++_0x13d038);}(_0x314a,0xf9));var _0xa314=function(_0x45b29d,_0x44ce43){_0x45b29d=_0x45b29d-0x0;var _0x32d74=_0x314a[_0x45b29d];return _0x32d74;};'use strict';var _=require(_0xa314('0x0'));var util=require(_0xa314('0x1'));var moment=require(_0xa314('0x2'));var BPromise=require(_0xa314('0x3'));var rs=require(_0xa314('0x4'));var fs=require('fs');var Redis=require(_0xa314('0x5'));var db=require(_0xa314('0x6'))['db'];var utils=require(_0xa314('0x7'));var logger=require(_0xa314('0x8'))(_0xa314('0x9'));var config=require(_0xa314('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa314('0xb')][_0xa314('0xc')]({'port':0x232a});config[_0xa314('0xd')]=_[_0xa314('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa314('0xd')]));require(_0xa314('0xf'))[_0xa314('0x10')](socket);function respondWithRpcPromise(_0x43e382,_0x15d82f,_0x54d4d5){return new BPromise(function(_0x346b42,_0x1cff35){return client['request'](_0x43e382,_0x54d4d5)[_0xa314('0x11')](function(_0x45a536){logger[_0xa314('0x12')](_0xa314('0x13'),_0x15d82f,_0xa314('0x14'));logger['debug'](_0xa314('0x15'),_0x15d82f,'request\x20sent',JSON[_0xa314('0x16')](_0x45a536));if(_0x45a536['error']){if(_0x45a536[_0xa314('0x17')][_0xa314('0x18')]===0x1f4){logger['error'](_0xa314('0x13'),_0x15d82f,_0x45a536[_0xa314('0x17')][_0xa314('0x19')]);return _0x1cff35(_0x45a536['error']['message']);}logger[_0xa314('0x17')](_0xa314('0x13'),_0x15d82f,_0x45a536['error'][_0xa314('0x19')]);return _0x346b42(_0x45a536['error'][_0xa314('0x19')]);}else{logger[_0xa314('0x12')](_0xa314('0x13'),_0x15d82f,_0xa314('0x14'));_0x346b42(_0x45a536[_0xa314('0x1a')][_0xa314('0x19')]);}})['catch'](function(_0x190fcc){logger[_0xa314('0x17')](_0xa314('0x13'),_0x15d82f,_0x190fcc);_0x1cff35(_0x190fcc);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index a9d52b6..7334978 100644 --- a/server/api/chatInternalMessage/chatInternalMessage.socket.js +++ b/server/api/chatInternalMessage/chatInternalMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6fc=['emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','remove','update'];(function(_0x1c2d2a,_0x2dd149){var _0x71febb=function(_0x45568c){while(--_0x45568c){_0x1c2d2a['push'](_0x1c2d2a['shift']());}};_0x71febb(++_0x2dd149);}(_0xc6fc,0xa5));var _0xcc6f=function(_0x10b1bb,_0x2a5815){_0x10b1bb=_0x10b1bb-0x0;var _0x2d4e05=_0xc6fc[_0x10b1bb];return _0x2d4e05;};'use strict';var ChatInternalMessageEvents=require(_0xcc6f('0x0'));var events=['save',_0xcc6f('0x1'),_0xcc6f('0x2')];function createListener(_0x43829a,_0x16d05a){return function(_0x195f4e){_0x16d05a[_0xcc6f('0x3')](_0x43829a,_0x195f4e);};}function removeListener(_0xfa2545,_0x3b0a12){return function(){ChatInternalMessageEvents[_0xcc6f('0x4')](_0xfa2545,_0x3b0a12);};}exports[_0xcc6f('0x5')]=function(_0x413e5d){for(var _0x18281d=0x0,_0xd11a1c=events['length'];_0x18281d<_0xd11a1c;_0x18281d++){var _0x565532=events[_0x18281d];var _0x1aa042=createListener(_0xcc6f('0x6')+_0x565532,_0x413e5d);ChatInternalMessageEvents['on'](_0x565532,_0x1aa042);}}; \ No newline at end of file +var _0x32d2=['removeListener','register','length','save','remove','update'];(function(_0x593acf,_0x2172be){var _0x247d38=function(_0x177d7e){while(--_0x177d7e){_0x593acf['push'](_0x593acf['shift']());}};_0x247d38(++_0x2172be);}(_0x32d2,0x87));var _0x232d=function(_0x20caed,_0x2ab574){_0x20caed=_0x20caed-0x0;var _0x61714a=_0x32d2[_0x20caed];return _0x61714a;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x232d('0x0'),_0x232d('0x1'),_0x232d('0x2')];function createListener(_0x5d4e39,_0x295f48){return function(_0x23cb17){_0x295f48['emit'](_0x5d4e39,_0x23cb17);};}function removeListener(_0x458fe4,_0x280fd6){return function(){ChatInternalMessageEvents[_0x232d('0x3')](_0x458fe4,_0x280fd6);};}exports[_0x232d('0x4')]=function(_0x1385da){for(var _0x337834=0x0,_0x2f2a7d=events[_0x232d('0x5')];_0x337834<_0x2f2a7d;_0x337834++){var _0x509028=events[_0x337834];var _0x516750=createListener('chatInternalMessage:'+_0x509028,_0x1385da);ChatInternalMessageEvents['on'](_0x509028,_0x516750);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index a72fbc4..d152a56 100644 --- a/server/api/chatInternalMessage/index.js +++ b/server/api/chatInternalMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x034a=['put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','getUsers','/:id','post','create'];(function(_0x332ad6,_0x38c82b){var _0x34011e=function(_0x8de51d){while(--_0x8de51d){_0x332ad6['push'](_0x332ad6['shift']());}};_0x34011e(++_0x38c82b);}(_0x034a,0xd6));var _0xa034=function(_0x5721a3,_0x400204){_0x5721a3=_0x5721a3-0x0;var _0x11b5e9=_0x034a[_0x5721a3];return _0x11b5e9;};'use strict';var multer=require(_0xa034('0x0'));var util=require(_0xa034('0x1'));var path=require(_0xa034('0x2'));var timeout=require('connect-timeout');var express=require(_0xa034('0x3'));var router=express[_0xa034('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa034('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa034('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xa034('0x7')]('/',auth[_0xa034('0x8')](),controller['index']);router['get'](_0xa034('0x9'),auth[_0xa034('0x8')](),controller['describe']);router['get']('/users',auth[_0xa034('0x8')](),controller[_0xa034('0xa')]);router['get'](_0xa034('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa034('0xc')]('/',auth['isAuthenticated'](),controller[_0xa034('0xd')]);router[_0xa034('0xe')]('/:id',controller[_0xa034('0xf')]);router[_0xa034('0x10')](_0xa034('0xb'),auth[_0xa034('0x8')](),controller[_0xa034('0x11')]);module[_0xa034('0x12')]=router; \ No newline at end of file +var _0xebbd=['index','/describe','describe','/users','getUsers','/:id','post','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0xcb9f9b,_0x376855){var _0x1cc14c=function(_0x3ddf39){while(--_0x3ddf39){_0xcb9f9b['push'](_0xcb9f9b['shift']());}};_0x1cc14c(++_0x376855);}(_0xebbd,0x196));var _0xdebb=function(_0x175697,_0x8c0f37){_0x175697=_0x175697-0x0;var _0x14493c=_0xebbd[_0x175697];return _0x14493c;};'use strict';var multer=require('multer');var util=require(_0xdebb('0x0'));var path=require(_0xdebb('0x1'));var timeout=require(_0xdebb('0x2'));var express=require(_0xdebb('0x3'));var router=express[_0xdebb('0x4')]();var fs_extra=require(_0xdebb('0x5'));var auth=require(_0xdebb('0x6'));var interaction=require(_0xdebb('0x7'));var config=require(_0xdebb('0x8'));var controller=require(_0xdebb('0x9'));router[_0xdebb('0xa')]('/',auth[_0xdebb('0xb')](),controller[_0xdebb('0xc')]);router[_0xdebb('0xa')](_0xdebb('0xd'),auth[_0xdebb('0xb')](),controller[_0xdebb('0xe')]);router[_0xdebb('0xa')](_0xdebb('0xf'),auth[_0xdebb('0xb')](),controller[_0xdebb('0x10')]);router['get'](_0xdebb('0x11'),auth[_0xdebb('0xb')](),controller['show']);router[_0xdebb('0x12')]('/',auth[_0xdebb('0xb')](),controller[_0xdebb('0x13')]);router['put'](_0xdebb('0x11'),controller['update']);router[_0xdebb('0x14')]('/:id',auth[_0xdebb('0xb')](),controller[_0xdebb('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 1c55bbe..4eb4513 100644 --- a/server/api/chatMessage/chatMessage.attributes.js +++ b/server/api/chatMessage/chatMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc06d=['BOOLEAN','ENUM','DATE','sequelize','exports','TEXT','medium'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xc06d,0x15a));var _0xdc06=function(_0x5573cf,_0x45f321){_0x5573cf=_0x5573cf-0x0;var _0x52ecf3=_0xc06d[_0x5573cf];return _0x52ecf3;};'use strict';var Sequelize=require(_0xdc06('0x0'));module[_0xdc06('0x1')]={'body':{'type':Sequelize[_0xdc06('0x2')](_0xdc06('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xdc06('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdc06('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xdc06('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xdc06('0x2')]}}; \ No newline at end of file +var _0x39c4=['exports','BOOLEAN','out','DATE','STRING','TEXT'];(function(_0x3aad90,_0x5f5121){var _0x198c37=function(_0x58e07f){while(--_0x58e07f){_0x3aad90['push'](_0x3aad90['shift']());}};_0x198c37(++_0x5f5121);}(_0x39c4,0x174));var _0x439c=function(_0x52c214,_0x18ebcb){_0x52c214=_0x52c214-0x0;var _0x314e39=_0x39c4[_0x52c214];return _0x314e39;};'use strict';var Sequelize=require('sequelize');module[_0x439c('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x439c('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x439c('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x439c('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0x439c('0x3')]},'providerName':{'type':Sequelize[_0x439c('0x4')]},'providerResponse':{'type':Sequelize[_0x439c('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 5a4a80d..9cbea74 100644 --- a/server/api/chatMessage/chatMessage.controller.js +++ b/server/api/chatMessage/chatMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8fc5=['status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','update','body','describe','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','channel','motionChannel','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','ContactId','interface','event','rejectmessage','parse','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','sendStatus'];(function(_0xe786c2,_0x360b22){var _0x4a1d36=function(_0x4210c5){while(--_0x4210c5){_0xe786c2['push'](_0xe786c2['shift']());}};_0x4a1d36(++_0x360b22);}(_0x8fc5,0xe4));var _0x58fc=function(_0x410be1,_0x468d62){_0x410be1=_0x410be1-0x0;var _0x4406b1=_0x8fc5[_0x410be1];return _0x4406b1;};'use strict';var emlformat=require(_0x58fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x58fc('0x1'));var jsonpatch=require(_0x58fc('0x2'));var rp=require(_0x58fc('0x3'));var moment=require(_0x58fc('0x4'));var BPromise=require(_0x58fc('0x5'));var Mustache=require('mustache');var util=require(_0x58fc('0x6'));var path=require(_0x58fc('0x7'));var sox=require(_0x58fc('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x58fc('0x9'));var _=require(_0x58fc('0xa'));var squel=require(_0x58fc('0xb'));var crypto=require('crypto');var jsforce=require(_0x58fc('0xc'));var deskjs=require(_0x58fc('0xd'));var toCsv=require(_0x58fc('0xe'));var querystring=require(_0x58fc('0xf'));var Papa=require('papaparse');var Redis=require(_0x58fc('0x10'));var authService=require(_0x58fc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x58fc('0x12'));var hardwareService=require(_0x58fc('0x13'));var logger=require(_0x58fc('0x14'))(_0x58fc('0x15'));var utils=require(_0x58fc('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x58fc('0x17'));var db=require(_0x58fc('0x18'))['db'];config[_0x58fc('0x19')]=_['defaults'](config[_0x58fc('0x19')],{'host':_0x58fc('0x1a'),'port':0x18eb});var socket=require(_0x58fc('0x1b'))(new Redis(config[_0x58fc('0x19')]));require(_0x58fc('0x1c'))[_0x58fc('0x1d')](socket);var jayson=require(_0x58fc('0x1e'));var client=jayson['client'][_0x58fc('0x1f')]({'port':0x232c});var client9002=jayson[_0x58fc('0x20')][_0x58fc('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x139e0c,_0x88bb3d,_0x2b020b,_0x44900f){return new BPromise(function(_0xa7598f,_0x3e6765){var _0xbf133e=_0x44900f||client;return _0xbf133e['request'](_0x139e0c,_0x2b020b)[_0x58fc('0x21')](function(_0x390f84){logger['info'](_0x58fc('0x22'),_0x88bb3d,_0x58fc('0x23'));logger[_0x58fc('0x24')](_0x58fc('0x25'),_0x88bb3d,_0x58fc('0x23'),JSON['stringify'](_0x390f84));if(_0x390f84[_0x58fc('0x26')]){if(_0x390f84[_0x58fc('0x26')]['code']===0x1f4){logger[_0x58fc('0x26')](_0x58fc('0x22'),_0x88bb3d,_0x390f84[_0x58fc('0x26')][_0x58fc('0x27')]);return _0x3e6765(_0x390f84[_0x58fc('0x26')][_0x58fc('0x27')]);}logger[_0x58fc('0x26')]('ChatMessage,\x20%s,\x20%s',_0x88bb3d,_0x390f84[_0x58fc('0x26')][_0x58fc('0x27')]);return _0xa7598f(_0x390f84['error'][_0x58fc('0x27')]);}else{logger[_0x58fc('0x28')](_0x58fc('0x22'),_0x88bb3d,_0x58fc('0x23'));_0xa7598f(_0x390f84[_0x58fc('0x29')][_0x58fc('0x27')]);}})[_0x58fc('0x2a')](function(_0x1e6a51){logger[_0x58fc('0x26')](_0x58fc('0x22'),_0x88bb3d,_0x1e6a51);_0x3e6765(_0x1e6a51);});});}function respondWithStatusCode(_0xc334fc,_0x54d6db){_0x54d6db=_0x54d6db||0xcc;return function(_0x36220f){if(_0x36220f){return _0xc334fc[_0x58fc('0x2b')](_0x54d6db);}return _0xc334fc[_0x58fc('0x2c')](_0x54d6db)[_0x58fc('0x2d')]();};}function respondWithResult(_0x1b1117,_0x4f0ed3){_0x4f0ed3=_0x4f0ed3||0xc8;return function(_0x3d170c){if(_0x3d170c){return _0x1b1117[_0x58fc('0x2c')](_0x4f0ed3)[_0x58fc('0x2e')](_0x3d170c);}};}function respondWithFilteredResult(_0x4e5772,_0x411839){return function(_0x27702f){if(_0x27702f){var _0x37cdc1=typeof _0x411839['offset']===_0x58fc('0x2f')&&typeof _0x411839['limit']===_0x58fc('0x2f');var _0x40a16b=_0x27702f[_0x58fc('0x30')];var _0x578ee2=_0x37cdc1?0x0:_0x411839[_0x58fc('0x31')];var _0x3db4e4=_0x37cdc1?_0x27702f['count']:_0x411839[_0x58fc('0x31')]+_0x411839[_0x58fc('0x32')];var _0x5d24d7;if(_0x3db4e4>=_0x40a16b){_0x3db4e4=_0x40a16b;_0x5d24d7=0xc8;}else{_0x5d24d7=0xce;}_0x4e5772[_0x58fc('0x2c')](_0x5d24d7);return _0x4e5772[_0x58fc('0x33')](_0x58fc('0x34'),_0x578ee2+'-'+_0x3db4e4+'/'+_0x40a16b)[_0x58fc('0x2e')](_0x27702f);}return null;};}function patchUpdates(_0x341603){return function(_0x1d5104){try{jsonpatch[_0x58fc('0x35')](_0x1d5104,_0x341603,!![]);}catch(_0x161943){return BPromise[_0x58fc('0x36')](_0x161943);}return _0x1d5104[_0x58fc('0x37')]();};}function saveUpdates(_0x377d41,_0x592abe){return function(_0x23f2a3){if(_0x23f2a3){return _0x23f2a3['update'](_0x377d41)['then'](function(_0x388dc3){return _0x388dc3;});}return null;};}function removeEntity(_0x1c5095,_0x489539){return function(_0x3111f8){if(_0x3111f8){return _0x3111f8[_0x58fc('0x38')]()[_0x58fc('0x21')](function(){_0x1c5095[_0x58fc('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fbcde,_0x1f155e){return function(_0x1f623c){if(!_0x1f623c){_0x2fbcde['sendStatus'](0x194);}return _0x1f623c;};}function handleError(_0x488201,_0x1bce27){_0x1bce27=_0x1bce27||0x1f4;return function(_0x4590a9){logger[_0x58fc('0x26')](_0x4590a9[_0x58fc('0x39')]);if(_0x4590a9[_0x58fc('0x3a')]){delete _0x4590a9[_0x58fc('0x3a')];}_0x488201[_0x58fc('0x2c')](_0x1bce27)[_0x58fc('0x3b')](_0x4590a9);};}exports[_0x58fc('0x3c')]=function(_0x4780dc,_0x397e7e){var _0x3292d4={},_0x3a4932={},_0x44f708={'count':0x0,'rows':[]};var _0x48dacb=_[_0x58fc('0x3d')](db[_0x58fc('0x3e')][_0x58fc('0x3f')],function(_0x4f4af9){return{'name':_0x4f4af9['fieldName'],'type':_0x4f4af9['type']['key']};});_0x3a4932[_0x58fc('0x40')]=_['map'](_0x48dacb,_0x58fc('0x3a'));_0x3a4932[_0x58fc('0x41')]=_[_0x58fc('0x42')](_0x4780dc[_0x58fc('0x41')]);_0x3a4932[_0x58fc('0x43')]=_[_0x58fc('0x44')](_0x3a4932['model'],_0x3a4932[_0x58fc('0x41')]);_0x3292d4[_0x58fc('0x45')]=_[_0x58fc('0x44')](_0x3a4932[_0x58fc('0x40')],qs[_0x58fc('0x46')](_0x4780dc[_0x58fc('0x41')][_0x58fc('0x46')]));_0x3292d4[_0x58fc('0x45')]=_0x3292d4[_0x58fc('0x45')][_0x58fc('0x47')]?_0x3292d4[_0x58fc('0x45')]:_0x3a4932[_0x58fc('0x40')];if(!_0x4780dc[_0x58fc('0x41')][_0x58fc('0x48')](_0x58fc('0x49'))){_0x3292d4[_0x58fc('0x32')]=qs[_0x58fc('0x32')](_0x4780dc[_0x58fc('0x41')][_0x58fc('0x32')]);_0x3292d4[_0x58fc('0x31')]=qs[_0x58fc('0x31')](_0x4780dc['query'][_0x58fc('0x31')]);}_0x3292d4[_0x58fc('0x4a')]=qs[_0x58fc('0x4b')](_0x4780dc['query'][_0x58fc('0x4b')]);_0x3292d4['where']=qs[_0x58fc('0x43')](_[_0x58fc('0x4c')](_0x4780dc[_0x58fc('0x41')],_0x3a4932[_0x58fc('0x43')]),_0x48dacb);if(_0x4780dc['query'][_0x58fc('0x4d')]){_0x3292d4['where']=_[_0x58fc('0x4e')](_0x3292d4[_0x58fc('0x4f')],{'$or':_[_0x58fc('0x3d')](_0x48dacb,function(_0x57deff){if(_0x57deff[_0x58fc('0x50')]!==_0x58fc('0x51')){var _0x54b093={};_0x54b093[_0x57deff['name']]={'$like':'%'+_0x4780dc[_0x58fc('0x41')][_0x58fc('0x4d')]+'%'};return _0x54b093;}})});}_0x3292d4=_[_0x58fc('0x4e')]({},_0x3292d4,_0x4780dc[_0x58fc('0x52')]);var _0x5986a5={'where':_0x3292d4[_0x58fc('0x4f')]};return db[_0x58fc('0x3e')][_0x58fc('0x30')](_0x5986a5)['then'](function(_0x8dd09d){_0x44f708[_0x58fc('0x30')]=_0x8dd09d;if(_0x4780dc[_0x58fc('0x41')][_0x58fc('0x53')]){_0x3292d4[_0x58fc('0x54')]=[{'all':!![]}];}return db[_0x58fc('0x3e')][_0x58fc('0x55')](_0x3292d4);})[_0x58fc('0x21')](function(_0x28733b){_0x44f708[_0x58fc('0x56')]=_0x28733b;return _0x44f708;})[_0x58fc('0x21')](respondWithFilteredResult(_0x397e7e,_0x3292d4))['catch'](handleError(_0x397e7e,null));};exports[_0x58fc('0x57')]=function(_0x5da06d,_0x3cbddf){var _0x897f90={'raw':!![],'where':{'id':_0x5da06d[_0x58fc('0x58')]['id']}},_0x56b50c={};_0x56b50c['model']=_[_0x58fc('0x42')](db[_0x58fc('0x3e')][_0x58fc('0x3f')]);_0x56b50c['query']=_[_0x58fc('0x42')](_0x5da06d[_0x58fc('0x41')]);_0x56b50c[_0x58fc('0x43')]=_[_0x58fc('0x44')](_0x56b50c[_0x58fc('0x40')],_0x56b50c[_0x58fc('0x41')]);_0x897f90[_0x58fc('0x45')]=_[_0x58fc('0x44')](_0x56b50c['model'],qs[_0x58fc('0x46')](_0x5da06d['query'][_0x58fc('0x46')]));_0x897f90[_0x58fc('0x45')]=_0x897f90[_0x58fc('0x45')][_0x58fc('0x47')]?_0x897f90[_0x58fc('0x45')]:_0x56b50c[_0x58fc('0x40')];if(_0x5da06d[_0x58fc('0x41')][_0x58fc('0x53')]){_0x897f90[_0x58fc('0x54')]=[{'all':!![]}];}_0x897f90=_['merge']({},_0x897f90,_0x5da06d[_0x58fc('0x52')]);return db[_0x58fc('0x3e')][_0x58fc('0x59')](_0x897f90)['then'](handleEntityNotFound(_0x3cbddf,null))[_0x58fc('0x21')](respondWithResult(_0x3cbddf,null))[_0x58fc('0x2a')](handleError(_0x3cbddf,null));};exports[_0x58fc('0x5a')]=function(_0x182114,_0x56fa06){return db['ChatMessage'][_0x58fc('0x5a')](_0x182114['body'],{})[_0x58fc('0x21')](respondWithResult(_0x56fa06,0xc9))['catch'](handleError(_0x56fa06,null));};exports[_0x58fc('0x5b')]=function(_0x4da317,_0x15b092){if(_0x4da317[_0x58fc('0x5c')]['id']){delete _0x4da317[_0x58fc('0x5c')]['id'];}return db[_0x58fc('0x3e')]['find']({'where':{'id':_0x4da317['params']['id']}})[_0x58fc('0x21')](handleEntityNotFound(_0x15b092,null))[_0x58fc('0x21')](saveUpdates(_0x4da317[_0x58fc('0x5c')],null))[_0x58fc('0x21')](respondWithResult(_0x15b092,null))[_0x58fc('0x2a')](handleError(_0x15b092,null));};exports['destroy']=function(_0x5cd6c6,_0xb477c){return db[_0x58fc('0x3e')][_0x58fc('0x59')]({'where':{'id':_0x5cd6c6['params']['id']}})[_0x58fc('0x21')](handleEntityNotFound(_0xb477c,null))[_0x58fc('0x21')](removeEntity(_0xb477c,null))[_0x58fc('0x2a')](handleError(_0xb477c,null));};exports[_0x58fc('0x5d')]=function(_0x16b1a1,_0x3280dc){return db[_0x58fc('0x3e')][_0x58fc('0x5d')]()[_0x58fc('0x21')](respondWithResult(_0x3280dc,null))[_0x58fc('0x2a')](handleError(_0x3280dc,null));};var interaction_log=require(_0x58fc('0x14'))(_0x58fc('0x5e'));exports[_0x58fc('0x5f')]=function(_0x1ccd86,_0x1d32be,_0x380775){var _0x3956e4={'agent':{},'channel':_0x58fc('0x60')};if(_0x1ccd86[_0x58fc('0x5c')]['id']){delete _0x1ccd86['body']['id'];}_0x1ccd86['body']['read']=!![];_0x1ccd86['body'][_0x58fc('0x61')]=moment()[_0x58fc('0x62')](_0x58fc('0x63'));_0x1ccd86['body'][_0x58fc('0x64')]=_0x1ccd86[_0x58fc('0x5c')][_0x58fc('0x64')]||_0x1ccd86[_0x58fc('0x65')]['id'];_0x3956e4[_0x58fc('0x66')]['id']=_0x1ccd86['body'][_0x58fc('0x64')];return db[_0x58fc('0x3e')][_0x58fc('0x59')]({'where':{'id':_0x1ccd86[_0x58fc('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1d32be,null))['then'](saveUpdates(_0x1ccd86[_0x58fc('0x5c')],null))[_0x58fc('0x21')](function(_0x540b30){if(_0x540b30){_0x3956e4[_0x58fc('0x27')]=_0x540b30[_0x58fc('0x67')]({'plain':!![]});return db['ChatInteraction'][_0x58fc('0x59')]({'where':{'id':_0x540b30[_0x58fc('0x68')]}});}return null;})[_0x58fc('0x21')](handleEntityNotFound(_0x1d32be,null))[_0x58fc('0x21')](function(_0x232ff7){if(_0x232ff7){return _0x232ff7[_0x58fc('0x5b')]({'UserId':_0x1ccd86['body'][_0x58fc('0x64')],'read1stAt':_[_0x58fc('0x69')](_0x232ff7[_0x58fc('0x6a')])?moment()[_0x58fc('0x62')](_0x58fc('0x63')):undefined});}return null;})[_0x58fc('0x21')](function(_0x442f69){if(_0x442f69){_0x3956e4[_0x58fc('0x6b')]=_0x442f69[_0x58fc('0x67')]({'plain':!![]});interaction_log[_0x58fc('0x28')](_0x58fc('0x6c'),_0x1ccd86[_0x58fc('0x65')]['id'],_0x1ccd86[_0x58fc('0x65')][_0x58fc('0x3a')],_0x1ccd86[_0x58fc('0x65')][_0x58fc('0x6d')],_0x3956e4['interaction']['id'],_0x1ccd86[_0x58fc('0x5c')]?JSON['stringify'](_0x1ccd86['body']):_0x58fc('0x6e'));return respondWithRpcPromise(_0x58fc('0x6f'),_0x58fc('0x70'),_0x3956e4);}return null;})[_0x58fc('0x21')](function(_0xc62c7a){var _0x5071e8=_0x58fc('0x71')+_0xc62c7a['message']['ContactId'];return db[_0x58fc('0x72')][_0x58fc('0x41')](_0x5071e8,{'type':db[_0x58fc('0x73')][_0x58fc('0x74')][_0x58fc('0x75')],'raw':!![]})[_0x58fc('0x21')](function(_0x21d239){return _0x21d239;});})[_0x58fc('0x21')](function(_0x5f2e72){if(_0x5f2e72){_0x3956e4[_0x58fc('0x27')]['contact']=_0x5f2e72[0x0];if(!_0x1ccd86[_0x58fc('0x5c')][_0x58fc('0x64')])return;return db[_0x58fc('0x76')][_0x58fc('0x59')]({'where':{'id':_0x1ccd86[_0x58fc('0x5c')][_0x58fc('0x64')],'role':_0x58fc('0x66')},'attributes':['id',_0x58fc('0x3a'),_0x58fc('0x77'),_0x58fc('0x78'),_0x58fc('0x79')],'raw':!![]});}return null;})[_0x58fc('0x21')](function(_0x363bf5){if(!_0x363bf5)return null;_0x3956e4[_0x58fc('0x27')][_0x58fc('0x66')]=_0x363bf5;return _0x3956e4;})[_0x58fc('0x21')](function(_0x4ce671){if(_0x4ce671){if(_0x1ccd86['body']['manual']){_0x3956e4[_0x58fc('0x27')]['interface']=util['format']('SIP/%s',_0x1ccd86[_0x58fc('0x65')][_0x58fc('0x3a')]);_0x3956e4['message'][_0x58fc('0x7a')]=_0x3956e4[_0x58fc('0x7a')];_0x3956e4[_0x58fc('0x27')][_0x58fc('0x7b')]=_0x3956e4['channel'];_0x3956e4[_0x58fc('0x27')]['event']=_0x58fc('0x5f');return respondWithRpcPromise(_0x58fc('0x7c'),_0x58fc('0x7c'),{'event':_0x58fc('0x7d'),'message':_[_0x58fc('0x4e')](_0x3956e4['message'],JSON['parse'](_0x3956e4[_0x58fc('0x6b')][_0x58fc('0x7e')]))},client9002)[_0x58fc('0x21')](function(){return _0x3956e4;});}return _0x3956e4;}return null;})[_0x58fc('0x21')](respondWithResult(_0x1d32be,null))[_0x58fc('0x2a')](handleError(_0x1d32be,null));};var interaction_log=require('../../config/logger')(_0x58fc('0x5e'));exports[_0x58fc('0x36')]=function(_0xf5ba7d,_0x266812,_0x35ec1c){var _0x330943={'agent':{},'channel':_0x58fc('0x60')};if(_0xf5ba7d[_0x58fc('0x5c')]['id']){delete _0xf5ba7d[_0x58fc('0x5c')]['id'];}_0xf5ba7d[_0x58fc('0x5c')][_0x58fc('0x64')]=_0xf5ba7d['body'][_0x58fc('0x64')]||_0xf5ba7d[_0x58fc('0x65')]['id'];_0x330943['agent']['id']=_0xf5ba7d[_0x58fc('0x5c')][_0x58fc('0x64')];return db[_0x58fc('0x3e')][_0x58fc('0x59')]({'where':{'id':_0xf5ba7d[_0x58fc('0x58')]['id'],'UserId':null}})[_0x58fc('0x21')](handleEntityNotFound(_0x266812,null))[_0x58fc('0x21')](function(_0xe4633a){if(_0xe4633a){_0x330943[_0x58fc('0x27')]=_0xe4633a[_0x58fc('0x67')]({'plain':!![]});return db['ChatInteraction'][_0x58fc('0x59')]({'where':{'id':_0xe4633a['ChatInteractionId']}});}return null;})[_0x58fc('0x21')](handleEntityNotFound(_0x266812,null))[_0x58fc('0x21')](function(_0xe65984){if(_0xe65984){_0x330943['interaction']=_0xe65984[_0x58fc('0x67')]({'plain':!![]});interaction_log[_0x58fc('0x28')](_0x58fc('0x7f'),_0xf5ba7d[_0x58fc('0x65')]['id'],_0xf5ba7d['user'][_0x58fc('0x3a')],_0xf5ba7d[_0x58fc('0x65')][_0x58fc('0x6d')],_0x330943[_0x58fc('0x6b')]['id'],_0xf5ba7d[_0x58fc('0x5c')]?JSON[_0x58fc('0x80')](_0xf5ba7d[_0x58fc('0x5c')]):'null');return respondWithRpcPromise(_0x58fc('0x81'),_0x58fc('0x82'),_0x330943);}return null;})[_0x58fc('0x21')](function(_0x20e930){var _0x1ccb9b=_0x58fc('0x71')+_0x20e930[_0x58fc('0x27')][_0x58fc('0x83')];return db['sequelize'][_0x58fc('0x41')](_0x1ccb9b,{'type':db[_0x58fc('0x73')]['QueryTypes'][_0x58fc('0x75')],'raw':!![]})['then'](function(_0x3547d2){return _0x3547d2;});})[_0x58fc('0x21')](function(_0x51cc66){if(_0x51cc66){_0x330943[_0x58fc('0x27')]['contact']=_0x51cc66[0x0];if(!_0xf5ba7d[_0x58fc('0x5c')][_0x58fc('0x64')])return;return db[_0x58fc('0x76')]['find']({'where':{'id':_0xf5ba7d[_0x58fc('0x5c')][_0x58fc('0x64')],'role':'agent'},'attributes':['id','name',_0x58fc('0x77'),_0x58fc('0x78'),_0x58fc('0x79')],'raw':!![]});}return null;})['then'](function(_0x504cee){if(!_0x504cee)return null;_0x330943[_0x58fc('0x27')][_0x58fc('0x66')]=_0x504cee;return _0x330943;})[_0x58fc('0x21')](function(_0x595f6b){if(_0x595f6b){_0x595f6b[_0x58fc('0x27')][_0x58fc('0x84')]=util[_0x58fc('0x62')]('SIP/%s',_0xf5ba7d['user'][_0x58fc('0x3a')]);_0x595f6b[_0x58fc('0x27')][_0x58fc('0x7a')]=_0x330943['channel'];_0x595f6b[_0x58fc('0x27')]['motionChannel']=_0x330943[_0x58fc('0x7a')];_0x595f6b[_0x58fc('0x27')][_0x58fc('0x85')]=_0x58fc('0x36');respondWithRpcPromise(_0x58fc('0x7c'),_0x58fc('0x7c'),{'event':_0x58fc('0x86'),'message':_[_0x58fc('0x4e')](_0x330943['message'],JSON[_0x58fc('0x87')](_0x330943['interaction'][_0x58fc('0x7e')]))},client9002);return _0x330943;}return null;})['then'](respondWithResult(_0x266812,null))[_0x58fc('0x2a')](handleError(_0x266812,null));}; \ No newline at end of file +var _0xdddc=['info','ChatMessage,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','save','destroy','then','name','send','index','ChatMessage','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','includeAll','include','findAll','rows','find','create','body','update','params','describe','../../config/logger','chat-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','interaction','null','acceptMessage','ContactId','sequelize','Sequelize','contact','User','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','formData','reject','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','interface','rejectmessage','parse','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','defaults','redis','localhost','./chatMessage.socket','register','jayson/promise','http','client','request'];(function(_0x3c6616,_0x1721d6){var _0x49e614=function(_0x25f209){while(--_0x25f209){_0x3c6616['push'](_0x3c6616['shift']());}};_0x49e614(++_0x1721d6);}(_0xdddc,0x1d8));var _0xcddd=function(_0x5b8dbe,_0x4b420d){_0x5b8dbe=_0x5b8dbe-0x0;var _0x3f5bff=_0xdddc[_0x5b8dbe];return _0x3f5bff;};'use strict';var emlformat=require(_0xcddd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcddd('0x1'));var jsonpatch=require(_0xcddd('0x2'));var rp=require(_0xcddd('0x3'));var moment=require('moment');var BPromise=require(_0xcddd('0x4'));var Mustache=require(_0xcddd('0x5'));var util=require('util');var path=require(_0xcddd('0x6'));var sox=require('sox');var csv=require(_0xcddd('0x7'));var ejs=require(_0xcddd('0x8'));var fs=require('fs');var fs_extra=require(_0xcddd('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcddd('0xa'));var deskjs=require(_0xcddd('0xb'));var toCsv=require(_0xcddd('0x7'));var querystring=require(_0xcddd('0xc'));var Papa=require('papaparse');var Redis=require(_0xcddd('0xd'));var authService=require(_0xcddd('0xe'));var qs=require(_0xcddd('0xf'));var as=require(_0xcddd('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcddd('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcddd('0x12'))['db'];config['redis']=_[_0xcddd('0x13')](config[_0xcddd('0x14')],{'host':_0xcddd('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcddd('0x14')]));require(_0xcddd('0x16'))[_0xcddd('0x17')](socket);var jayson=require(_0xcddd('0x18'));var client=jayson['client'][_0xcddd('0x19')]({'port':0x232c});var client9002=jayson[_0xcddd('0x1a')][_0xcddd('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x4bf27b,_0x4b09ca,_0x1a1ac8,_0x516248){return new BPromise(function(_0x519bdc,_0x1566ec){var _0x42fb45=_0x516248||client;return _0x42fb45[_0xcddd('0x1b')](_0x4bf27b,_0x1a1ac8)['then'](function(_0x44e5f2){logger[_0xcddd('0x1c')](_0xcddd('0x1d'),_0x4b09ca,'request\x20sent');logger[_0xcddd('0x1e')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4b09ca,'request\x20sent',JSON[_0xcddd('0x1f')](_0x44e5f2));if(_0x44e5f2['error']){if(_0x44e5f2[_0xcddd('0x20')]['code']===0x1f4){logger[_0xcddd('0x20')](_0xcddd('0x1d'),_0x4b09ca,_0x44e5f2['error'][_0xcddd('0x21')]);return _0x1566ec(_0x44e5f2[_0xcddd('0x20')][_0xcddd('0x21')]);}logger[_0xcddd('0x20')](_0xcddd('0x1d'),_0x4b09ca,_0x44e5f2[_0xcddd('0x20')][_0xcddd('0x21')]);return _0x519bdc(_0x44e5f2[_0xcddd('0x20')]['message']);}else{logger[_0xcddd('0x1c')]('ChatMessage,\x20%s,\x20%s',_0x4b09ca,_0xcddd('0x22'));_0x519bdc(_0x44e5f2[_0xcddd('0x23')][_0xcddd('0x21')]);}})[_0xcddd('0x24')](function(_0x57fd89){logger[_0xcddd('0x20')]('ChatMessage,\x20%s,\x20%s',_0x4b09ca,_0x57fd89);_0x1566ec(_0x57fd89);});});}function respondWithStatusCode(_0x21d537,_0x478af9){_0x478af9=_0x478af9||0xcc;return function(_0x2dcd76){if(_0x2dcd76){return _0x21d537[_0xcddd('0x25')](_0x478af9);}return _0x21d537['status'](_0x478af9)[_0xcddd('0x26')]();};}function respondWithResult(_0x4ef4fb,_0x208b86){_0x208b86=_0x208b86||0xc8;return function(_0x1f873b){if(_0x1f873b){return _0x4ef4fb[_0xcddd('0x27')](_0x208b86)['json'](_0x1f873b);}};}function respondWithFilteredResult(_0x351849,_0x36c5f6){return function(_0x5db917){if(_0x5db917){var _0x15ab28=typeof _0x36c5f6[_0xcddd('0x28')]===_0xcddd('0x29')&&typeof _0x36c5f6['limit']===_0xcddd('0x29');var _0x40adcd=_0x5db917[_0xcddd('0x2a')];var _0x4ff467=_0x15ab28?0x0:_0x36c5f6[_0xcddd('0x28')];var _0x53352d=_0x15ab28?_0x5db917[_0xcddd('0x2a')]:_0x36c5f6[_0xcddd('0x28')]+_0x36c5f6[_0xcddd('0x2b')];var _0x4675d9;if(_0x53352d>=_0x40adcd){_0x53352d=_0x40adcd;_0x4675d9=0xc8;}else{_0x4675d9=0xce;}_0x351849[_0xcddd('0x27')](_0x4675d9);return _0x351849[_0xcddd('0x2c')](_0xcddd('0x2d'),_0x4ff467+'-'+_0x53352d+'/'+_0x40adcd)[_0xcddd('0x2e')](_0x5db917);}return null;};}function patchUpdates(_0x4b386d){return function(_0x190309){try{jsonpatch['apply'](_0x190309,_0x4b386d,!![]);}catch(_0x3f0392){return BPromise['reject'](_0x3f0392);}return _0x190309[_0xcddd('0x2f')]();};}function saveUpdates(_0x1755fa,_0x169a8c){return function(_0x498ebc){if(_0x498ebc){return _0x498ebc['update'](_0x1755fa)['then'](function(_0x43189d){return _0x43189d;});}return null;};}function removeEntity(_0x256b78,_0x3edc77){return function(_0x474fa7){if(_0x474fa7){return _0x474fa7[_0xcddd('0x30')]()[_0xcddd('0x31')](function(){_0x256b78[_0xcddd('0x27')](0xcc)[_0xcddd('0x26')]();});}};}function handleEntityNotFound(_0x5ec2a7,_0x32402f){return function(_0x1cc740){if(!_0x1cc740){_0x5ec2a7[_0xcddd('0x25')](0x194);}return _0x1cc740;};}function handleError(_0x588b6f,_0x2c514e){_0x2c514e=_0x2c514e||0x1f4;return function(_0x3318ff){logger[_0xcddd('0x20')](_0x3318ff['stack']);if(_0x3318ff[_0xcddd('0x32')]){delete _0x3318ff['name'];}_0x588b6f['status'](_0x2c514e)[_0xcddd('0x33')](_0x3318ff);};}exports[_0xcddd('0x34')]=function(_0x6b9896,_0x290a88){var _0x367e7b={},_0x50884c={},_0x185e45={'count':0x0,'rows':[]};var _0x113502=_['map'](db[_0xcddd('0x35')][_0xcddd('0x36')],function(_0x21c0c7){return{'name':_0x21c0c7[_0xcddd('0x37')],'type':_0x21c0c7['type'][_0xcddd('0x38')]};});_0x50884c[_0xcddd('0x39')]=_[_0xcddd('0x3a')](_0x113502,_0xcddd('0x32'));_0x50884c['query']=_[_0xcddd('0x3b')](_0x6b9896[_0xcddd('0x3c')]);_0x50884c[_0xcddd('0x3d')]=_[_0xcddd('0x3e')](_0x50884c[_0xcddd('0x39')],_0x50884c[_0xcddd('0x3c')]);_0x367e7b[_0xcddd('0x3f')]=_[_0xcddd('0x3e')](_0x50884c['model'],qs[_0xcddd('0x40')](_0x6b9896[_0xcddd('0x3c')][_0xcddd('0x40')]));_0x367e7b[_0xcddd('0x3f')]=_0x367e7b[_0xcddd('0x3f')][_0xcddd('0x41')]?_0x367e7b[_0xcddd('0x3f')]:_0x50884c[_0xcddd('0x39')];if(!_0x6b9896[_0xcddd('0x3c')][_0xcddd('0x42')](_0xcddd('0x43'))){_0x367e7b[_0xcddd('0x2b')]=qs[_0xcddd('0x2b')](_0x6b9896['query'][_0xcddd('0x2b')]);_0x367e7b[_0xcddd('0x28')]=qs[_0xcddd('0x28')](_0x6b9896[_0xcddd('0x3c')][_0xcddd('0x28')]);}_0x367e7b[_0xcddd('0x44')]=qs['sort'](_0x6b9896['query'][_0xcddd('0x45')]);_0x367e7b['where']=qs[_0xcddd('0x3d')](_[_0xcddd('0x46')](_0x6b9896[_0xcddd('0x3c')],_0x50884c[_0xcddd('0x3d')]),_0x113502);if(_0x6b9896[_0xcddd('0x3c')]['filter']){_0x367e7b[_0xcddd('0x47')]=_[_0xcddd('0x48')](_0x367e7b[_0xcddd('0x47')],{'$or':_[_0xcddd('0x3a')](_0x113502,function(_0x3e0b9a){if(_0x3e0b9a['type']!=='VIRTUAL'){var _0x12763f={};_0x12763f[_0x3e0b9a[_0xcddd('0x32')]]={'$like':'%'+_0x6b9896['query']['filter']+'%'};return _0x12763f;}})});}_0x367e7b=_[_0xcddd('0x48')]({},_0x367e7b,_0x6b9896[_0xcddd('0x49')]);var _0x38f70a={'where':_0x367e7b[_0xcddd('0x47')]};return db['ChatMessage'][_0xcddd('0x2a')](_0x38f70a)['then'](function(_0x5931c5){_0x185e45[_0xcddd('0x2a')]=_0x5931c5;if(_0x6b9896['query'][_0xcddd('0x4a')]){_0x367e7b[_0xcddd('0x4b')]=[{'all':!![]}];}return db['ChatMessage'][_0xcddd('0x4c')](_0x367e7b);})[_0xcddd('0x31')](function(_0x15c0e1){_0x185e45[_0xcddd('0x4d')]=_0x15c0e1;return _0x185e45;})[_0xcddd('0x31')](respondWithFilteredResult(_0x290a88,_0x367e7b))[_0xcddd('0x24')](handleError(_0x290a88,null));};exports['show']=function(_0x5f3501,_0x53424e){var _0x17c051={'raw':!![],'where':{'id':_0x5f3501['params']['id']}},_0x769ec7={};_0x769ec7[_0xcddd('0x39')]=_[_0xcddd('0x3b')](db['ChatMessage'][_0xcddd('0x36')]);_0x769ec7[_0xcddd('0x3c')]=_['keys'](_0x5f3501['query']);_0x769ec7[_0xcddd('0x3d')]=_['intersection'](_0x769ec7[_0xcddd('0x39')],_0x769ec7['query']);_0x17c051['attributes']=_[_0xcddd('0x3e')](_0x769ec7[_0xcddd('0x39')],qs[_0xcddd('0x40')](_0x5f3501['query'][_0xcddd('0x40')]));_0x17c051[_0xcddd('0x3f')]=_0x17c051[_0xcddd('0x3f')][_0xcddd('0x41')]?_0x17c051[_0xcddd('0x3f')]:_0x769ec7[_0xcddd('0x39')];if(_0x5f3501[_0xcddd('0x3c')][_0xcddd('0x4a')]){_0x17c051[_0xcddd('0x4b')]=[{'all':!![]}];}_0x17c051=_[_0xcddd('0x48')]({},_0x17c051,_0x5f3501[_0xcddd('0x49')]);return db[_0xcddd('0x35')][_0xcddd('0x4e')](_0x17c051)['then'](handleEntityNotFound(_0x53424e,null))['then'](respondWithResult(_0x53424e,null))[_0xcddd('0x24')](handleError(_0x53424e,null));};exports['create']=function(_0x37f539,_0x295302){return db[_0xcddd('0x35')][_0xcddd('0x4f')](_0x37f539[_0xcddd('0x50')],{})[_0xcddd('0x31')](respondWithResult(_0x295302,0xc9))['catch'](handleError(_0x295302,null));};exports[_0xcddd('0x51')]=function(_0x4b9a6e,_0x6e1fcb){if(_0x4b9a6e[_0xcddd('0x50')]['id']){delete _0x4b9a6e[_0xcddd('0x50')]['id'];}return db['ChatMessage'][_0xcddd('0x4e')]({'where':{'id':_0x4b9a6e[_0xcddd('0x52')]['id']}})['then'](handleEntityNotFound(_0x6e1fcb,null))['then'](saveUpdates(_0x4b9a6e[_0xcddd('0x50')],null))['then'](respondWithResult(_0x6e1fcb,null))['catch'](handleError(_0x6e1fcb,null));};exports[_0xcddd('0x30')]=function(_0x14b7f3,_0x4f8bf6){return db['ChatMessage']['find']({'where':{'id':_0x14b7f3[_0xcddd('0x52')]['id']}})[_0xcddd('0x31')](handleEntityNotFound(_0x4f8bf6,null))[_0xcddd('0x31')](removeEntity(_0x4f8bf6,null))[_0xcddd('0x24')](handleError(_0x4f8bf6,null));};exports['describe']=function(_0x1f43b0,_0xc3c6fa){return db[_0xcddd('0x35')][_0xcddd('0x53')]()[_0xcddd('0x31')](respondWithResult(_0xc3c6fa,null))['catch'](handleError(_0xc3c6fa,null));};var interaction_log=require(_0xcddd('0x54'))(_0xcddd('0x55'));exports[_0xcddd('0x56')]=function(_0x2f714a,_0x1b5782,_0x28a155){var _0x1995a5={'agent':{},'channel':'chat'};if(_0x2f714a['body']['id']){delete _0x2f714a[_0xcddd('0x50')]['id'];}_0x2f714a[_0xcddd('0x50')]['read']=!![];_0x2f714a[_0xcddd('0x50')][_0xcddd('0x57')]=moment()['format'](_0xcddd('0x58'));_0x2f714a['body'][_0xcddd('0x59')]=_0x2f714a[_0xcddd('0x50')][_0xcddd('0x59')]||_0x2f714a[_0xcddd('0x5a')]['id'];_0x1995a5[_0xcddd('0x5b')]['id']=_0x2f714a[_0xcddd('0x50')][_0xcddd('0x59')];return db[_0xcddd('0x35')]['find']({'where':{'id':_0x2f714a[_0xcddd('0x52')]['id'],'UserId':null}})[_0xcddd('0x31')](handleEntityNotFound(_0x1b5782,null))[_0xcddd('0x31')](saveUpdates(_0x2f714a[_0xcddd('0x50')],null))[_0xcddd('0x31')](function(_0x194aaf){if(_0x194aaf){_0x1995a5['message']=_0x194aaf[_0xcddd('0x5c')]({'plain':!![]});return db[_0xcddd('0x5d')][_0xcddd('0x4e')]({'where':{'id':_0x194aaf[_0xcddd('0x5e')]}});}return null;})[_0xcddd('0x31')](handleEntityNotFound(_0x1b5782,null))[_0xcddd('0x31')](function(_0x4cee37){if(_0x4cee37){return _0x4cee37['update']({'UserId':_0x2f714a['body'][_0xcddd('0x59')],'read1stAt':_[_0xcddd('0x5f')](_0x4cee37[_0xcddd('0x60')])?moment()[_0xcddd('0x61')](_0xcddd('0x58')):undefined});}return null;})['then'](function(_0x3fbefd){if(_0x3fbefd){_0x1995a5[_0xcddd('0x62')]=_0x3fbefd[_0xcddd('0x5c')]({'plain':!![]});interaction_log[_0xcddd('0x1c')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2f714a[_0xcddd('0x5a')]['id'],_0x2f714a[_0xcddd('0x5a')][_0xcddd('0x32')],_0x2f714a[_0xcddd('0x5a')]['role'],_0x1995a5[_0xcddd('0x62')]['id'],_0x2f714a[_0xcddd('0x50')]?JSON[_0xcddd('0x1f')](_0x2f714a['body']):_0xcddd('0x63'));return respondWithRpcPromise('AcceptMessage',_0xcddd('0x64'),_0x1995a5);}return null;})['then'](function(_0x3f6953){var _0x41b9cd='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3f6953[_0xcddd('0x21')][_0xcddd('0x65')];return db[_0xcddd('0x66')][_0xcddd('0x3c')](_0x41b9cd,{'type':db[_0xcddd('0x67')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x280fd1){return _0x280fd1;});})[_0xcddd('0x31')](function(_0x5ab38f){if(_0x5ab38f){_0x1995a5[_0xcddd('0x21')][_0xcddd('0x68')]=_0x5ab38f[0x0];if(!_0x2f714a[_0xcddd('0x50')][_0xcddd('0x59')])return;return db[_0xcddd('0x69')][_0xcddd('0x4e')]({'where':{'id':_0x2f714a['body'][_0xcddd('0x59')],'role':_0xcddd('0x5b')},'attributes':['id',_0xcddd('0x32'),_0xcddd('0x6a'),_0xcddd('0x6b'),_0xcddd('0x6c')],'raw':!![]});}return null;})[_0xcddd('0x31')](function(_0x1ee350){if(!_0x1ee350)return null;_0x1995a5['message'][_0xcddd('0x5b')]=_0x1ee350;return _0x1995a5;})[_0xcddd('0x31')](function(_0x4d134f){if(_0x4d134f){if(_0x2f714a[_0xcddd('0x50')]['manual']){_0x1995a5[_0xcddd('0x21')]['interface']=util['format'](_0xcddd('0x6d'),_0x2f714a[_0xcddd('0x5a')][_0xcddd('0x32')]);_0x1995a5[_0xcddd('0x21')][_0xcddd('0x6e')]=_0x1995a5['channel'];_0x1995a5[_0xcddd('0x21')][_0xcddd('0x6f')]=_0x1995a5['channel'];_0x1995a5[_0xcddd('0x21')][_0xcddd('0x70')]=_0xcddd('0x56');return respondWithRpcPromise(_0xcddd('0x71'),'EventManager',{'event':'acceptmessage','message':_[_0xcddd('0x48')](_0x1995a5[_0xcddd('0x21')],JSON['parse'](_0x1995a5[_0xcddd('0x62')][_0xcddd('0x72')]))},client9002)[_0xcddd('0x31')](function(){return _0x1995a5;});}return _0x1995a5;}return null;})[_0xcddd('0x31')](respondWithResult(_0x1b5782,null))[_0xcddd('0x24')](handleError(_0x1b5782,null));};var interaction_log=require(_0xcddd('0x54'))('chat-interactions');exports[_0xcddd('0x73')]=function(_0x3e5edb,_0x5e8194,_0x56753a){var _0x4b9e02={'agent':{},'channel':_0xcddd('0x74')};if(_0x3e5edb[_0xcddd('0x50')]['id']){delete _0x3e5edb[_0xcddd('0x50')]['id'];}_0x3e5edb[_0xcddd('0x50')][_0xcddd('0x59')]=_0x3e5edb[_0xcddd('0x50')][_0xcddd('0x59')]||_0x3e5edb[_0xcddd('0x5a')]['id'];_0x4b9e02[_0xcddd('0x5b')]['id']=_0x3e5edb[_0xcddd('0x50')]['UserId'];return db[_0xcddd('0x35')][_0xcddd('0x4e')]({'where':{'id':_0x3e5edb[_0xcddd('0x52')]['id'],'UserId':null}})[_0xcddd('0x31')](handleEntityNotFound(_0x5e8194,null))[_0xcddd('0x31')](function(_0x4ffb9a){if(_0x4ffb9a){_0x4b9e02['message']=_0x4ffb9a[_0xcddd('0x5c')]({'plain':!![]});return db[_0xcddd('0x5d')][_0xcddd('0x4e')]({'where':{'id':_0x4ffb9a[_0xcddd('0x5e')]}});}return null;})['then'](handleEntityNotFound(_0x5e8194,null))[_0xcddd('0x31')](function(_0x3e6e32){if(_0x3e6e32){_0x4b9e02[_0xcddd('0x62')]=_0x3e6e32['get']({'plain':!![]});interaction_log[_0xcddd('0x1c')](_0xcddd('0x75'),_0x3e5edb[_0xcddd('0x5a')]['id'],_0x3e5edb[_0xcddd('0x5a')]['name'],_0x3e5edb['user']['role'],_0x4b9e02[_0xcddd('0x62')]['id'],_0x3e5edb[_0xcddd('0x50')]?JSON[_0xcddd('0x1f')](_0x3e5edb[_0xcddd('0x50')]):_0xcddd('0x63'));return respondWithRpcPromise('RejectMessage',_0xcddd('0x76'),_0x4b9e02);}return null;})[_0xcddd('0x31')](function(_0x458a1c){var _0xec134e=_0xcddd('0x77')+_0x458a1c[_0xcddd('0x21')][_0xcddd('0x65')];return db[_0xcddd('0x66')][_0xcddd('0x3c')](_0xec134e,{'type':db[_0xcddd('0x67')][_0xcddd('0x78')][_0xcddd('0x79')],'raw':!![]})[_0xcddd('0x31')](function(_0x3c4403){return _0x3c4403;});})['then'](function(_0x1c2e79){if(_0x1c2e79){_0x4b9e02[_0xcddd('0x21')][_0xcddd('0x68')]=_0x1c2e79[0x0];if(!_0x3e5edb[_0xcddd('0x50')][_0xcddd('0x59')])return;return db[_0xcddd('0x69')][_0xcddd('0x4e')]({'where':{'id':_0x3e5edb[_0xcddd('0x50')][_0xcddd('0x59')],'role':_0xcddd('0x5b')},'attributes':['id',_0xcddd('0x32'),_0xcddd('0x6a'),_0xcddd('0x6b'),_0xcddd('0x6c')],'raw':!![]});}return null;})[_0xcddd('0x31')](function(_0x3a677b){if(!_0x3a677b)return null;_0x4b9e02[_0xcddd('0x21')][_0xcddd('0x5b')]=_0x3a677b;return _0x4b9e02;})[_0xcddd('0x31')](function(_0x3178ea){if(_0x3178ea){_0x3178ea[_0xcddd('0x21')][_0xcddd('0x7a')]=util[_0xcddd('0x61')]('SIP/%s',_0x3e5edb[_0xcddd('0x5a')][_0xcddd('0x32')]);_0x3178ea[_0xcddd('0x21')][_0xcddd('0x6e')]=_0x4b9e02[_0xcddd('0x6e')];_0x3178ea['message'][_0xcddd('0x6f')]=_0x4b9e02[_0xcddd('0x6e')];_0x3178ea[_0xcddd('0x21')][_0xcddd('0x70')]=_0xcddd('0x73');respondWithRpcPromise(_0xcddd('0x71'),_0xcddd('0x71'),{'event':_0xcddd('0x7b'),'message':_[_0xcddd('0x48')](_0x4b9e02['message'],JSON[_0xcddd('0x7c')](_0x4b9e02['interaction']['formData']))},client9002);return _0x4b9e02;}return null;})[_0xcddd('0x31')](respondWithResult(_0x5e8194,null))[_0xcddd('0x24')](handleError(_0x5e8194,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 692c5d4..ccaf037 100644 --- a/server/api/chatMessage/chatMessage.events.js +++ b/server/api/chatMessage/chatMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a2d=['save','remove','emit','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x5a4d23,_0x45281){var _0x5108eb=function(_0x5ea989){while(--_0x5ea989){_0x5a4d23['push'](_0x5a4d23['shift']());}};_0x5108eb(++_0x45281);}(_0x5a2d,0x17f));var _0xd5a2=function(_0x4e4519,_0x392ae){_0x4e4519=_0x4e4519-0x0;var _0x340044=_0x5a2d[_0x4e4519];return _0x340044;};'use strict';var EventEmitter=require(_0xd5a2('0x0'));var ChatMessage=require(_0xd5a2('0x1'))['db'][_0xd5a2('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd5a2('0x3')](0x0);var events={'afterCreate':_0xd5a2('0x4'),'afterUpdate':'update','afterDestroy':_0xd5a2('0x5')};function emitEvent(_0x4008a3){return function(_0x427b21,_0x5e388b,_0x2845da){ChatMessageEvents['emit'](_0x4008a3+':'+_0x427b21['id'],_0x427b21);ChatMessageEvents[_0xd5a2('0x6')](_0x4008a3,_0x427b21);_0x2845da(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xd5a2('0x7')](e,emitEvent(event));}}module[_0xd5a2('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x6d5b=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x246484,_0x339979){var _0x508019=function(_0x2317e8){while(--_0x2317e8){_0x246484['push'](_0x246484['shift']());}};_0x508019(++_0x339979);}(_0x6d5b,0x19e));var _0xb6d5=function(_0x893cd2,_0x504808){_0x893cd2=_0x893cd2-0x0;var _0x5a36b5=_0x6d5b[_0x893cd2];return _0x5a36b5;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xb6d5('0x0'))['db'][_0xb6d5('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb6d5('0x2')](0x0);var events={'afterCreate':_0xb6d5('0x3'),'afterUpdate':_0xb6d5('0x4'),'afterDestroy':_0xb6d5('0x5')};function emitEvent(_0x28e98a){return function(_0xa52db1,_0x1f3ea4,_0x2fae09){ChatMessageEvents['emit'](_0x28e98a+':'+_0xa52db1['id'],_0xa52db1);ChatMessageEvents[_0xb6d5('0x6')](_0x28e98a,_0xa52db1);_0x2fae09(null);};}for(var e in events){if(events[_0xb6d5('0x7')](e)){var event=events[e];ChatMessage[_0xb6d5('0x8')](e,emitEvent(event));}}module[_0xb6d5('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index fc13a8e..e391a87 100644 --- a/server/api/chatMessage/chatMessage.model.js +++ b/server/api/chatMessage/chatMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2913=['models','get','direction','secret','isNil','findOne','then','update','createdAt','toLowerCase','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT'];(function(_0x184115,_0x1fe4ad){var _0x1a810d=function(_0x176d62){while(--_0x176d62){_0x184115['push'](_0x184115['shift']());}};_0x1a810d(++_0x1fe4ad);}(_0x2913,0x1c7));var _0x3291=function(_0xec4fa9,_0x5e70b4){_0xec4fa9=_0xec4fa9-0x0;var _0x242dd2=_0x2913[_0xec4fa9];return _0x242dd2;};'use strict';var _=require(_0x3291('0x0'));var util=require(_0x3291('0x1'));var logger=require(_0x3291('0x2'))(_0x3291('0x3'));var moment=require(_0x3291('0x4'));var BPromise=require(_0x3291('0x5'));var rp=require(_0x3291('0x6'));var fs=require('fs');var path=require(_0x3291('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module['exports']=function(_0x1d0abd,_0x5b915c){return _0x1d0abd[_0x3291('0x8')](_0x3291('0x9'),attributes,{'tableName':_0x3291('0xa'),'paranoid':![],'indexes':[{'name':_0x3291('0xb'),'fields':['body'],'type':_0x3291('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f94ba,_0x1d5bb7,_0x27c936){var _0x15aa15=_0x1d0abd[_0x3291('0xd')];var _0x3c12dc=_0x3f94ba[_0x3291('0xe')]({'plain':!![]});if(_0x3c12dc[_0x3291('0xf')]['toLowerCase']()==='in'||_0x3c12dc[_0x3291('0xf')]['toLowerCase']()==='out'&&!_0x3c12dc[_0x3291('0x10')]&&!_[_0x3291('0x11')](_0x3c12dc['UserId'])){_0x15aa15['ChatInteraction'][_0x3291('0x12')]({'where':{'id':_0x3c12dc['ChatInteractionId']}})[_0x3291('0x13')](function(_0x57ac78){if(_0x57ac78){_0x57ac78[_0x3291('0x14')]({'lastMsgAt':_0x3c12dc[_0x3291('0x15')],'lastMsgDirection':_0x3c12dc[_0x3291('0xf')][_0x3291('0x16')]()});}})[_0x3291('0x17')](function(_0x35a286){console[_0x3291('0x18')](_0x35a286);});}_0x27c936();}},'charset':_0x3291('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xcc08=['request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','toLowerCase','direction','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','lodash','../../config/logger','api','moment','bluebird'];(function(_0x34a2aa,_0x51846f){var _0x4ea6ec=function(_0x1e0865){while(--_0x1e0865){_0x34a2aa['push'](_0x34a2aa['shift']());}};_0x4ea6ec(++_0x51846f);}(_0xcc08,0xe3));var _0x8cc0=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xcc08[_0x2fc012];return _0x2891f9;};'use strict';var _=require(_0x8cc0('0x0'));var util=require('util');var logger=require(_0x8cc0('0x1'))(_0x8cc0('0x2'));var moment=require(_0x8cc0('0x3'));var BPromise=require(_0x8cc0('0x4'));var rp=require(_0x8cc0('0x5'));var fs=require('fs');var path=require(_0x8cc0('0x6'));var rimraf=require(_0x8cc0('0x7'));var config=require(_0x8cc0('0x8'));var attributes=require(_0x8cc0('0x9'));module[_0x8cc0('0xa')]=function(_0x14bf1c,_0x842217){return _0x14bf1c[_0x8cc0('0xb')](_0x8cc0('0xc'),attributes,{'tableName':_0x8cc0('0xd'),'paranoid':![],'indexes':[{'name':_0x8cc0('0xe'),'fields':[_0x8cc0('0xf')],'type':_0x8cc0('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xb0af7f,_0x504906,_0x57030a){var _0x514dbd=_0x14bf1c[_0x8cc0('0x11')];var _0x158802=_0xb0af7f['get']({'plain':!![]});if(_0x158802['direction'][_0x8cc0('0x12')]()==='in'||_0x158802[_0x8cc0('0x13')][_0x8cc0('0x12')]()==='out'&&!_0x158802['secret']&&!_['isNil'](_0x158802[_0x8cc0('0x14')])){_0x514dbd[_0x8cc0('0x15')][_0x8cc0('0x16')]({'where':{'id':_0x158802[_0x8cc0('0x17')]}})[_0x8cc0('0x18')](function(_0x570145){if(_0x570145){_0x570145[_0x8cc0('0x19')]({'lastMsgAt':_0x158802[_0x8cc0('0x1a')],'lastMsgDirection':_0x158802[_0x8cc0('0x13')]['toLowerCase']()});}})[_0x8cc0('0x1b')](function(_0x5d9efd){console[_0x8cc0('0x1c')](_0x5d9efd);});}_0x57030a();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index fed4aea..8e1beba 100644 --- a/server/api/chatMessage/chatMessage.rpc.js +++ b/server/api/chatMessage/chatMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeba9=['request\x20sent','stringify','code','error','message','ChatMessage','create','options','raw','CreateChatMessage','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x57e6e2,_0x225f52){var _0x2734d6=function(_0x53791d){while(--_0x53791d){_0x57e6e2['push'](_0x57e6e2['shift']());}};_0x2734d6(++_0x225f52);}(_0xeba9,0xeb));var _0x9eba=function(_0xce1079,_0x59a87f){_0xce1079=_0xce1079-0x0;var _0x118ac4=_0xeba9[_0xce1079];return _0x118ac4;};'use strict';var _=require(_0x9eba('0x0'));var util=require('util');var moment=require(_0x9eba('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9eba('0x2'));var db=require(_0x9eba('0x3'))['db'];var utils=require(_0x9eba('0x4'));var logger=require(_0x9eba('0x5'))('rpc');var config=require(_0x9eba('0x6'));var jayson=require(_0x9eba('0x7'));var client=jayson[_0x9eba('0x8')][_0x9eba('0x9')]({'port':0x232a});config[_0x9eba('0xa')]=_[_0x9eba('0xb')](config[_0x9eba('0xa')],{'host':_0x9eba('0xc'),'port':0x18eb});var socket=require(_0x9eba('0xd'))(new Redis(config[_0x9eba('0xa')]));require(_0x9eba('0xe'))['register'](socket);function respondWithRpcPromise(_0x3b22e4,_0x3646bc,_0x102080){return new BPromise(function(_0x71a6f3,_0x424d61){return client[_0x9eba('0xf')](_0x3b22e4,_0x102080)[_0x9eba('0x10')](function(_0x3b7924){logger[_0x9eba('0x11')](_0x9eba('0x12'),_0x3646bc,'request\x20sent');logger[_0x9eba('0x13')](_0x9eba('0x14'),_0x3646bc,_0x9eba('0x15'),JSON[_0x9eba('0x16')](_0x3b7924));if(_0x3b7924['error']){if(_0x3b7924['error'][_0x9eba('0x17')]===0x1f4){logger[_0x9eba('0x18')](_0x9eba('0x12'),_0x3646bc,_0x3b7924[_0x9eba('0x18')]['message']);return _0x424d61(_0x3b7924[_0x9eba('0x18')]['message']);}logger[_0x9eba('0x18')](_0x9eba('0x12'),_0x3646bc,_0x3b7924[_0x9eba('0x18')]['message']);return _0x71a6f3(_0x3b7924['error'][_0x9eba('0x19')]);}else{logger[_0x9eba('0x11')](_0x9eba('0x12'),_0x3646bc,_0x9eba('0x15'));_0x71a6f3(_0x3b7924['result'][_0x9eba('0x19')]);}})['catch'](function(_0x328b44){logger[_0x9eba('0x18')](_0x9eba('0x12'),_0x3646bc,_0x328b44);_0x424d61(_0x328b44);});});}exports['CreateChatMessage']=function(_0x3ab7bb){var _0xf3fbb7=this;return new Promise(function(_0x484846,_0x33e6e8){return db[_0x9eba('0x1a')][_0x9eba('0x1b')](_0x3ab7bb['body'],{'raw':_0x3ab7bb[_0x9eba('0x1c')]?_0x3ab7bb[_0x9eba('0x1c')][_0x9eba('0x1d')]===undefined?!![]:![]:!![]})[_0x9eba('0x10')](function(_0xf1d972){logger[_0x9eba('0x11')]('CreateChatMessage',_0x3ab7bb);logger[_0x9eba('0x13')](_0x9eba('0x1e'),_0x3ab7bb,JSON[_0x9eba('0x16')](_0xf1d972));_0x484846(_0xf1d972);})[_0x9eba('0x1f')](function(_0x54cb21){logger[_0x9eba('0x18')]('CreateChatMessage',_0x54cb21[_0x9eba('0x19')],_0x3ab7bb);_0x33e6e8(_0xf3fbb7['error'](0x1f4,_0x54cb21['message']));});});}; \ No newline at end of file +var _0xc39e=['message','result','CreateChatMessage','ChatMessage','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xc39e,0x1b9));var _0xec39=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0xc39e[_0x104e21];return _0x605b37;};'use strict';var _=require('lodash');var util=require(_0xec39('0x0'));var moment=require(_0xec39('0x1'));var BPromise=require(_0xec39('0x2'));var rs=require(_0xec39('0x3'));var fs=require('fs');var Redis=require(_0xec39('0x4'));var db=require(_0xec39('0x5'))['db'];var utils=require(_0xec39('0x6'));var logger=require(_0xec39('0x7'))('rpc');var config=require(_0xec39('0x8'));var jayson=require(_0xec39('0x9'));var client=jayson['client'][_0xec39('0xa')]({'port':0x232a});config[_0xec39('0xb')]=_[_0xec39('0xc')](config[_0xec39('0xb')],{'host':_0xec39('0xd'),'port':0x18eb});var socket=require(_0xec39('0xe'))(new Redis(config['redis']));require(_0xec39('0xf'))[_0xec39('0x10')](socket);function respondWithRpcPromise(_0x4e7d0e,_0x7b7a36,_0x3511e1){return new BPromise(function(_0x475573,_0x4e20d6){return client[_0xec39('0x11')](_0x4e7d0e,_0x3511e1)['then'](function(_0x251d44){logger[_0xec39('0x12')](_0xec39('0x13'),_0x7b7a36,_0xec39('0x14'));logger[_0xec39('0x15')](_0xec39('0x16'),_0x7b7a36,_0xec39('0x14'),JSON['stringify'](_0x251d44));if(_0x251d44['error']){if(_0x251d44[_0xec39('0x17')]['code']===0x1f4){logger[_0xec39('0x17')](_0xec39('0x13'),_0x7b7a36,_0x251d44[_0xec39('0x17')][_0xec39('0x18')]);return _0x4e20d6(_0x251d44['error'][_0xec39('0x18')]);}logger[_0xec39('0x17')]('ChatMessage,\x20%s,\x20%s',_0x7b7a36,_0x251d44[_0xec39('0x17')]['message']);return _0x475573(_0x251d44[_0xec39('0x17')][_0xec39('0x18')]);}else{logger[_0xec39('0x12')](_0xec39('0x13'),_0x7b7a36,_0xec39('0x14'));_0x475573(_0x251d44[_0xec39('0x19')][_0xec39('0x18')]);}})['catch'](function(_0xfb231b){logger['error'](_0xec39('0x13'),_0x7b7a36,_0xfb231b);_0x4e20d6(_0xfb231b);});});}exports[_0xec39('0x1a')]=function(_0x65ee0b){var _0x5703c2=this;return new Promise(function(_0x4421b2,_0x2d0498){return db[_0xec39('0x1b')]['create'](_0x65ee0b['body'],{'raw':_0x65ee0b[_0xec39('0x1c')]?_0x65ee0b[_0xec39('0x1c')][_0xec39('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2f847f){logger[_0xec39('0x12')](_0xec39('0x1a'),_0x65ee0b);logger[_0xec39('0x15')](_0xec39('0x1a'),_0x65ee0b,JSON['stringify'](_0x2f847f));_0x4421b2(_0x2f847f);})[_0xec39('0x1e')](function(_0x5a8d31){logger[_0xec39('0x17')](_0xec39('0x1a'),_0x5a8d31[_0xec39('0x18')],_0x65ee0b);_0x2d0498(_0x5703c2['error'](0x1f4,_0x5a8d31[_0xec39('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index f82e34b..eb4c1bd 100644 --- a/server/api/chatMessage/chatMessage.socket.js +++ b/server/api/chatMessage/chatMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5455=['remove','update','emit','removeListener','register','length','chatMessage:','save'];(function(_0x2bbf97,_0x54d5e6){var _0x7a938=function(_0x37262b){while(--_0x37262b){_0x2bbf97['push'](_0x2bbf97['shift']());}};_0x7a938(++_0x54d5e6);}(_0x5455,0x197));var _0x5545=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5455[_0x19950b];return _0x3c6b41;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5545('0x0'),_0x5545('0x1'),_0x5545('0x2')];function createListener(_0x414d1c,_0xba68b3){return function(_0x38b608){_0xba68b3[_0x5545('0x3')](_0x414d1c,_0x38b608);};}function removeListener(_0x4cd466,_0x48fce5){return function(){ChatMessageEvents[_0x5545('0x4')](_0x4cd466,_0x48fce5);};}exports[_0x5545('0x5')]=function(_0x5c22f1){for(var _0x5a6ac7=0x0,_0x2ea57f=events[_0x5545('0x6')];_0x5a6ac7<_0x2ea57f;_0x5a6ac7++){var _0x5c2476=events[_0x5a6ac7];var _0x9cbb0d=createListener(_0x5545('0x7')+_0x5c2476,_0x5c22f1);ChatMessageEvents['on'](_0x5c2476,_0x9cbb0d);}}; \ No newline at end of file +var _0xf873=['register','length','chatMessage:','save','remove','update','emit'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xf873,0xb2));var _0x3f87=function(_0x38790e,_0x3f9bc2){_0x38790e=_0x38790e-0x0;var _0x1a1d22=_0xf873[_0x38790e];return _0x1a1d22;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x3f87('0x0'),_0x3f87('0x1'),_0x3f87('0x2')];function createListener(_0x3ef688,_0x1c56a3){return function(_0xd4592c){_0x1c56a3[_0x3f87('0x3')](_0x3ef688,_0xd4592c);};}function removeListener(_0x1d68dd,_0x3c80d6){return function(){ChatMessageEvents['removeListener'](_0x1d68dd,_0x3c80d6);};}exports[_0x3f87('0x4')]=function(_0x43c8e4){for(var _0x27c03e=0x0,_0x5a5e37=events[_0x3f87('0x5')];_0x27c03e<_0x5a5e37;_0x27c03e++){var _0x2c7ccc=events[_0x27c03e];var _0x3b8e92=createListener(_0x3f87('0x6')+_0x2c7ccc,_0x43c8e4);ChatMessageEvents['on'](_0x2c7ccc,_0x3b8e92);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 6929514..413690d 100644 --- a/server/api/chatMessage/index.js +++ b/server/api/chatMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24b4=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','destroy','exports','util'];(function(_0x5209ef,_0x3a4592){var _0x63f75f=function(_0x2591e1){while(--_0x2591e1){_0x5209ef['push'](_0x5209ef['shift']());}};_0x63f75f(++_0x3a4592);}(_0x24b4,0x167));var _0x424b=function(_0x5a7725,_0x352098){_0x5a7725=_0x5a7725-0x0;var _0x36f933=_0x24b4[_0x5a7725];return _0x36f933;};'use strict';var multer=require('multer');var util=require(_0x424b('0x0'));var path=require(_0x424b('0x1'));var timeout=require(_0x424b('0x2'));var express=require(_0x424b('0x3'));var router=express[_0x424b('0x4')]();var fs_extra=require(_0x424b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x424b('0x6'));var config=require(_0x424b('0x7'));var controller=require(_0x424b('0x8'));router[_0x424b('0x9')]('/',auth[_0x424b('0xa')](),controller['index']);router[_0x424b('0x9')](_0x424b('0xb'),auth[_0x424b('0xa')](),controller[_0x424b('0xc')]);router[_0x424b('0x9')](_0x424b('0xd'),auth[_0x424b('0xa')](),controller[_0x424b('0xe')]);router[_0x424b('0xf')]('/',auth[_0x424b('0xa')](),interaction[_0x424b('0x10')](_0x424b('0x11'),_0x424b('0x12')),controller[_0x424b('0x13')]);router[_0x424b('0x14')](_0x424b('0xd'),controller[_0x424b('0x15')]);router[_0x424b('0x14')]('/:id/accept',auth[_0x424b('0xa')](),controller['accept']);router[_0x424b('0x14')]('/:id/reject',auth[_0x424b('0xa')](),controller['reject']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x424b('0x16')]);module[_0x424b('0x17')]=router; \ No newline at end of file +var _0x78b0=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/describe','describe','get','/:id','show','post','tracked','chat','chatmessage:create','/:id/accept','put','/:id/reject','reject','delete'];(function(_0x5bf485,_0x339edb){var _0x57cd1a=function(_0x590b34){while(--_0x590b34){_0x5bf485['push'](_0x5bf485['shift']());}};_0x57cd1a(++_0x339edb);}(_0x78b0,0x1dd));var _0x078b=function(_0x25e211,_0x2778fd){_0x25e211=_0x25e211-0x0;var _0x4e3f93=_0x78b0[_0x25e211];return _0x4e3f93;};'use strict';var multer=require(_0x078b('0x0'));var util=require('util');var path=require(_0x078b('0x1'));var timeout=require(_0x078b('0x2'));var express=require('express');var router=express[_0x078b('0x3')]();var fs_extra=require(_0x078b('0x4'));var auth=require(_0x078b('0x5'));var interaction=require(_0x078b('0x6'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router['get']('/',auth[_0x078b('0x7')](),controller[_0x078b('0x8')]);router['get'](_0x078b('0x9'),auth[_0x078b('0x7')](),controller[_0x078b('0xa')]);router[_0x078b('0xb')](_0x078b('0xc'),auth[_0x078b('0x7')](),controller[_0x078b('0xd')]);router[_0x078b('0xe')]('/',auth[_0x078b('0x7')](),interaction[_0x078b('0xf')](_0x078b('0x10'),_0x078b('0x11')),controller['create']);router['put'](_0x078b('0xc'),controller['update']);router['put'](_0x078b('0x12'),auth[_0x078b('0x7')](),controller['accept']);router[_0x078b('0x13')](_0x078b('0x14'),auth['isAuthenticated'](),controller[_0x078b('0x15')]);router[_0x078b('0x16')](_0x078b('0xc'),auth['isAuthenticated'](),controller[_0x078b('0x17')]);module[_0x078b('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index f3d7151..6c95288 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x12877b,_0x8650cf){_0x12877b=_0x12877b-0x0;var _0x3549ff=_0x0b0e[_0x12877b];return _0x3549ff;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xb10b=['medium','sequelize','TEXT'];(function(_0x1de1be,_0x52d59f){var _0x3eb24b=function(_0x18c190){while(--_0x18c190){_0x1de1be['push'](_0x1de1be['shift']());}};_0x3eb24b(++_0x52d59f);}(_0xb10b,0x12a));var _0xbb10=function(_0x315861,_0x735b4){_0x315861=_0x315861-0x0;var _0x3e2b76=_0xb10b[_0x315861];return _0x3e2b76;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 8802736..30c4f38 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x7a54,0x106));var _0x47a5=function(_0xd561ce,_0x5efbd2){_0xd561ce=_0xd561ce-0x0;var _0x1e7118=_0x7a54[_0xd561ce];return _0x1e7118;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x7a54,0x106));var _0x47a5=function(_0x311dfa,_0x1096f){_0x311dfa=_0x311dfa-0x0;var _0x3184b6=_0x7a54[_0x311dfa];return _0x3184b6;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 82f3d26..d841b67 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d43=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','hasOwnProperty','exports'];(function(_0x164ddb,_0x460d50){var _0x467142=function(_0x543562){while(--_0x543562){_0x164ddb['push'](_0x164ddb['shift']());}};_0x467142(++_0x460d50);}(_0x6d43,0xe8));var _0x36d4=function(_0x5acaa4,_0xe42e0){_0x5acaa4=_0x5acaa4-0x0;var _0x1205fd=_0x6d43[_0x5acaa4];return _0x1205fd;};'use strict';var EventEmitter=require(_0x36d4('0x0'));var ChatOfflineMessage=require(_0x36d4('0x1'))['db'][_0x36d4('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x36d4('0x3')](0x0);var events={'afterCreate':_0x36d4('0x4'),'afterUpdate':_0x36d4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x63a7d9){return function(_0x17c6bf,_0x23c865,_0xc122f7){ChatOfflineMessageEvents['emit'](_0x63a7d9+':'+_0x17c6bf['id'],_0x17c6bf);ChatOfflineMessageEvents['emit'](_0x63a7d9,_0x17c6bf);_0xc122f7(null);};}for(var e in events){if(events[_0x36d4('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x36d4('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xdd33=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','remove'];(function(_0x1a0dc5,_0x21afef){var _0x55a5e4=function(_0x5c8165){while(--_0x5c8165){_0x1a0dc5['push'](_0x1a0dc5['shift']());}};_0x55a5e4(++_0x21afef);}(_0xdd33,0x1c6));var _0x3dd3=function(_0x12b05f,_0x50eb4c){_0x12b05f=_0x12b05f-0x0;var _0x15b135=_0xdd33[_0x12b05f];return _0x15b135;};'use strict';var EventEmitter=require(_0x3dd3('0x0'));var ChatOfflineMessage=require(_0x3dd3('0x1'))['db'][_0x3dd3('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x3dd3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3dd3('0x4')};function emitEvent(_0x34930f){return function(_0xaac443,_0x9f29dd,_0x12823f){ChatOfflineMessageEvents[_0x3dd3('0x5')](_0x34930f+':'+_0xaac443['id'],_0xaac443);ChatOfflineMessageEvents['emit'](_0x34930f,_0xaac443);_0x12823f(null);};}for(var e in events){if(events[_0x3dd3('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x3dd3('0x7')](e,emitEvent(event));}}module[_0x3dd3('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 7b23e0a..4459f4f 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.model.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02c7=['define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports'];(function(_0x504ff0,_0x1dcb50){var _0x9ca9b8=function(_0x540450){while(--_0x540450){_0x504ff0['push'](_0x504ff0['shift']());}};_0x9ca9b8(++_0x1dcb50);}(_0x02c7,0x1c1));var _0x702c=function(_0x4c742c,_0x3c1c46){_0x4c742c=_0x4c742c-0x0;var _0x5a0551=_0x02c7[_0x4c742c];return _0x5a0551;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x702c('0x0')]=function(_0x51adb4){return _0x51adb4[_0x702c('0x1')]('ChatOfflineMessage',attributes,{'tableName':_0x702c('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x702c('0x3'),'collate':_0x702c('0x4')});}; \ No newline at end of file +var _0xa09f=['utf8mb4_unicode_ci','define','ChatOfflineMessage','utf8mb4'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa09f,0x145));var _0xfa09=function(_0x4b3f00,_0xae36f2){_0x4b3f00=_0x4b3f00-0x0;var _0x471448=_0xa09f[_0x4b3f00];return _0x471448;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x315e49){return _0x315e49[_0xfa09('0x0')](_0xfa09('0x1'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfa09('0x2'),'collate':_0xfa09('0x3')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 23fd28c..4e0856d 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d4f=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5572b7,_0x244036){var _0x1bc232=function(_0x338cc0){while(--_0x338cc0){_0x5572b7['push'](_0x5572b7['shift']());}};_0x1bc232(++_0x244036);}(_0x3d4f,0x9f));var _0xf3d4=function(_0x353abb,_0x194c80){_0x353abb=_0x353abb-0x0;var _0x43c9c5=_0x3d4f[_0x353abb];return _0x43c9c5;};'use strict';var _=require(_0xf3d4('0x0'));var util=require(_0xf3d4('0x1'));var moment=require(_0xf3d4('0x2'));var BPromise=require(_0xf3d4('0x3'));var rs=require(_0xf3d4('0x4'));var fs=require('fs');var Redis=require(_0xf3d4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3d4('0x6'));var logger=require('../../config/logger')(_0xf3d4('0x7'));var config=require(_0xf3d4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf3d4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b85a5,_0xc01d91,_0x344d29){return new BPromise(function(_0x362423,_0x591671){return client[_0xf3d4('0xa')](_0x1b85a5,_0x344d29)[_0xf3d4('0xb')](function(_0x4e4c22){logger['info'](_0xf3d4('0xc'),_0xc01d91,'request\x20sent');logger[_0xf3d4('0xd')](_0xf3d4('0xe'),_0xc01d91,_0xf3d4('0xf'),JSON[_0xf3d4('0x10')](_0x4e4c22));if(_0x4e4c22[_0xf3d4('0x11')]){if(_0x4e4c22[_0xf3d4('0x11')][_0xf3d4('0x12')]===0x1f4){logger[_0xf3d4('0x11')](_0xf3d4('0xc'),_0xc01d91,_0x4e4c22[_0xf3d4('0x11')][_0xf3d4('0x13')]);return _0x591671(_0x4e4c22[_0xf3d4('0x11')][_0xf3d4('0x13')]);}logger[_0xf3d4('0x11')](_0xf3d4('0xc'),_0xc01d91,_0x4e4c22[_0xf3d4('0x11')][_0xf3d4('0x13')]);return _0x362423(_0x4e4c22['error']['message']);}else{logger['info'](_0xf3d4('0xc'),_0xc01d91,_0xf3d4('0xf'));_0x362423(_0x4e4c22[_0xf3d4('0x14')][_0xf3d4('0x13')]);}})[_0xf3d4('0x15')](function(_0xa24879){logger[_0xf3d4('0x11')](_0xf3d4('0xc'),_0xc01d91,_0xa24879);_0x591671(_0xa24879);});});} \ No newline at end of file +var _0x95bb=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment'];(function(_0x678774,_0x4e110d){var _0x56c83a=function(_0xcedc08){while(--_0xcedc08){_0x678774['push'](_0x678774['shift']());}};_0x56c83a(++_0x4e110d);}(_0x95bb,0xed));var _0xb95b=function(_0x4d04d4,_0x4d449e){_0x4d04d4=_0x4d04d4-0x0;var _0x2537aa=_0x95bb[_0x4d04d4];return _0x2537aa;};'use strict';var _=require(_0xb95b('0x0'));var util=require(_0xb95b('0x1'));var moment=require(_0xb95b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb95b('0x3'));var fs=require('fs');var Redis=require(_0xb95b('0x4'));var db=require(_0xb95b('0x5'))['db'];var utils=require(_0xb95b('0x6'));var logger=require('../../config/logger')(_0xb95b('0x7'));var config=require(_0xb95b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb95b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17a603,_0x13a670,_0x5169bf){return new BPromise(function(_0x2a53ec,_0xa3e4){return client['request'](_0x17a603,_0x5169bf)[_0xb95b('0xa')](function(_0x286a87){logger['info'](_0xb95b('0xb'),_0x13a670,_0xb95b('0xc'));logger[_0xb95b('0xd')](_0xb95b('0xe'),_0x13a670,_0xb95b('0xc'),JSON['stringify'](_0x286a87));if(_0x286a87[_0xb95b('0xf')]){if(_0x286a87[_0xb95b('0xf')][_0xb95b('0x10')]===0x1f4){logger[_0xb95b('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x13a670,_0x286a87[_0xb95b('0xf')]['message']);return _0xa3e4(_0x286a87[_0xb95b('0xf')][_0xb95b('0x11')]);}logger[_0xb95b('0xf')](_0xb95b('0xb'),_0x13a670,_0x286a87[_0xb95b('0xf')]['message']);return _0x2a53ec(_0x286a87[_0xb95b('0xf')][_0xb95b('0x11')]);}else{logger[_0xb95b('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x13a670,_0xb95b('0xc'));_0x2a53ec(_0x286a87['result']['message']);}})[_0xb95b('0x13')](function(_0x2b3fee){logger[_0xb95b('0xf')](_0xb95b('0xb'),_0x13a670,_0x2b3fee);_0xa3e4(_0x2b3fee);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index e29b91c..31867c7 100644 --- a/server/api/chatOfflineMessage/index.js +++ b/server/api/chatOfflineMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4aa6=['put','/:id','update','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','show','post','create'];(function(_0x3c9eb2,_0x161a8a){var _0x2333ca=function(_0x42fc68){while(--_0x42fc68){_0x3c9eb2['push'](_0x3c9eb2['shift']());}};_0x2333ca(++_0x161a8a);}(_0x4aa6,0x12f));var _0x64aa=function(_0xbac4c1,_0x2c36e1){_0xbac4c1=_0xbac4c1-0x0;var _0x3415e2=_0x4aa6[_0xbac4c1];return _0x3415e2;};'use strict';var multer=require(_0x64aa('0x0'));var util=require(_0x64aa('0x1'));var path=require(_0x64aa('0x2'));var timeout=require('connect-timeout');var express=require(_0x64aa('0x3'));var router=express[_0x64aa('0x4')]();var fs_extra=require(_0x64aa('0x5'));var auth=require(_0x64aa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x64aa('0x7'));var controller=require(_0x64aa('0x8'));router[_0x64aa('0x9')]('/',auth['isAuthenticated'](),controller[_0x64aa('0xa')]);router['get'](_0x64aa('0xb'),auth[_0x64aa('0xc')](),controller[_0x64aa('0xd')]);router['get']('/:id',auth[_0x64aa('0xc')](),controller[_0x64aa('0xe')]);router[_0x64aa('0xf')]('/',auth[_0x64aa('0xc')](),controller[_0x64aa('0x10')]);router[_0x64aa('0x11')](_0x64aa('0x12'),auth[_0x64aa('0xc')](),controller[_0x64aa('0x13')]);router['delete'](_0x64aa('0x12'),auth[_0x64aa('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x455b=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x455b,0xd9));var _0xb455=function(_0x10aca9,_0x3be855){_0x10aca9=_0x10aca9-0x0;var _0x2dfec2=_0x455b[_0x10aca9];return _0x2dfec2;};'use strict';var multer=require('multer');var util=require(_0xb455('0x0'));var path=require(_0xb455('0x1'));var timeout=require(_0xb455('0x2'));var express=require(_0xb455('0x3'));var router=express[_0xb455('0x4')]();var fs_extra=require(_0xb455('0x5'));var auth=require(_0xb455('0x6'));var interaction=require(_0xb455('0x7'));var config=require(_0xb455('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0xb455('0x9')]('/',auth[_0xb455('0xa')](),controller[_0xb455('0xb')]);router[_0xb455('0x9')](_0xb455('0xc'),auth[_0xb455('0xa')](),controller[_0xb455('0xd')]);router['get'](_0xb455('0xe'),auth[_0xb455('0xa')](),controller[_0xb455('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb455('0x10')]);router[_0xb455('0x11')](_0xb455('0xe'),auth[_0xb455('0xa')](),controller[_0xb455('0x12')]);router[_0xb455('0x13')](_0xb455('0xe'),auth['isAuthenticated'](),controller[_0xb455('0x14')]);module[_0xb455('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index ce9978b..459b0be 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.attributes.js +++ b/server/api/chatProactiveAction/chatProactiveAction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc149=['mouseOver','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x41ffa2,_0x84a9fd){var _0x2e1894=function(_0x10a3a5){while(--_0x10a3a5){_0x41ffa2['push'](_0x41ffa2['shift']());}};_0x2e1894(++_0x84a9fd);}(_0xc149,0x1ca));var _0x9c14=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xc149[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x9c14('0x0'));module[_0x9c14('0x1')]={'name':{'type':Sequelize[_0x9c14('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9c14('0x3')](_0x9c14('0x4'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x9c14('0x2')]},'timeout':{'type':Sequelize[_0x9c14('0x5')]}}; \ No newline at end of file +var _0x376a=['sequelize','exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0xe10c3e,_0x336f40){var _0x5608e1=function(_0x3e8e27){while(--_0x3e8e27){_0xe10c3e['push'](_0xe10c3e['shift']());}};_0x5608e1(++_0x336f40);}(_0x376a,0x85));var _0xa376=function(_0x420048,_0x2c2393){_0x420048=_0x420048-0x0;var _0x4d4c73=_0x376a[_0x420048];return _0x4d4c73;};'use strict';var Sequelize=require(_0xa376('0x0'));module[_0xa376('0x1')]={'name':{'type':Sequelize[_0xa376('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa376('0x3')](_0xa376('0x4'),_0xa376('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xa376('0x2')]},'timeout':{'type':Sequelize[_0xa376('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 92aef66..156ce80 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.controller.js +++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20d7=['limit','undefined','count','Content-Range','json','reject','update','error','stack','name','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','then','create','body','catch','destroy','zip-dir','fast-json-patch','request-promise','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x20d7,0x146));var _0x720d=function(_0x17dc1c,_0x5d5de6){_0x17dc1c=_0x17dc1c-0x0;var _0xcd4c47=_0x20d7[_0x17dc1c];return _0xcd4c47;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x720d('0x0'));var jsonpatch=require(_0x720d('0x1'));var rp=require(_0x720d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x720d('0x3'));var path=require(_0x720d('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x720d('0x5'));var _=require('lodash');var squel=require(_0x720d('0x6'));var crypto=require(_0x720d('0x7'));var jsforce=require(_0x720d('0x8'));var deskjs=require(_0x720d('0x9'));var toCsv=require(_0x720d('0xa'));var querystring=require(_0x720d('0xb'));var Papa=require(_0x720d('0xc'));var Redis=require(_0x720d('0xd'));var authService=require(_0x720d('0xe'));var qs=require(_0x720d('0xf'));var as=require(_0x720d('0x10'));var hardwareService=require(_0x720d('0x11'));var logger=require(_0x720d('0x12'))(_0x720d('0x13'));var utils=require(_0x720d('0x14'));var config=require(_0x720d('0x15'));var licenseUtil=require(_0x720d('0x16'));var db=require(_0x720d('0x17'))['db'];function respondWithStatusCode(_0x1abbf9,_0x555f4f){_0x555f4f=_0x555f4f||0xcc;return function(_0x28daea){if(_0x28daea){return _0x1abbf9[_0x720d('0x18')](_0x555f4f);}return _0x1abbf9[_0x720d('0x19')](_0x555f4f)[_0x720d('0x1a')]();};}function respondWithResult(_0x2c3c4e,_0x3eb77b){_0x3eb77b=_0x3eb77b||0xc8;return function(_0x2e0ecd){if(_0x2e0ecd){return _0x2c3c4e[_0x720d('0x19')](_0x3eb77b)['json'](_0x2e0ecd);}};}function respondWithFilteredResult(_0x408dff,_0x561445){return function(_0x48c460){if(_0x48c460){var _0x5af38e=typeof _0x561445[_0x720d('0x1b')]==='undefined'&&typeof _0x561445[_0x720d('0x1c')]===_0x720d('0x1d');var _0x443443=_0x48c460[_0x720d('0x1e')];var _0x302562=_0x5af38e?0x0:_0x561445[_0x720d('0x1b')];var _0x134394=_0x5af38e?_0x48c460['count']:_0x561445[_0x720d('0x1b')]+_0x561445[_0x720d('0x1c')];var _0x243dce;if(_0x134394>=_0x443443){_0x134394=_0x443443;_0x243dce=0xc8;}else{_0x243dce=0xce;}_0x408dff[_0x720d('0x19')](_0x243dce);return _0x408dff['set'](_0x720d('0x1f'),_0x302562+'-'+_0x134394+'/'+_0x443443)[_0x720d('0x20')](_0x48c460);}return null;};}function patchUpdates(_0x3c09c2){return function(_0x3237c2){try{jsonpatch['apply'](_0x3237c2,_0x3c09c2,!![]);}catch(_0x26b78f){return BPromise[_0x720d('0x21')](_0x26b78f);}return _0x3237c2['save']();};}function saveUpdates(_0x318c23,_0x28690b){return function(_0x1cbe26){if(_0x1cbe26){return _0x1cbe26[_0x720d('0x22')](_0x318c23)['then'](function(_0x3be62e){return _0x3be62e;});}return null;};}function removeEntity(_0x5d27ea,_0x341bcc){return function(_0x466b1d){if(_0x466b1d){return _0x466b1d['destroy']()['then'](function(){_0x5d27ea[_0x720d('0x19')](0xcc)[_0x720d('0x1a')]();});}};}function handleEntityNotFound(_0x5d31ac,_0x2f6d4f){return function(_0x3acb8b){if(!_0x3acb8b){_0x5d31ac[_0x720d('0x18')](0x194);}return _0x3acb8b;};}function handleError(_0x4f44e3,_0xa400f8){_0xa400f8=_0xa400f8||0x1f4;return function(_0x2b7ed4){logger[_0x720d('0x23')](_0x2b7ed4[_0x720d('0x24')]);if(_0x2b7ed4[_0x720d('0x25')]){delete _0x2b7ed4['name'];}_0x4f44e3[_0x720d('0x19')](_0xa400f8)['send'](_0x2b7ed4);};}exports['show']=function(_0x260820,_0x22c161){var _0x4d9778={'raw':!![],'where':{'id':_0x260820[_0x720d('0x26')]['id']}},_0x4b76bd={};_0x4b76bd[_0x720d('0x27')]=_[_0x720d('0x28')](db[_0x720d('0x29')][_0x720d('0x2a')]);_0x4b76bd[_0x720d('0x2b')]=_['keys'](_0x260820[_0x720d('0x2b')]);_0x4b76bd[_0x720d('0x2c')]=_[_0x720d('0x2d')](_0x4b76bd[_0x720d('0x27')],_0x4b76bd['query']);_0x4d9778[_0x720d('0x2e')]=_[_0x720d('0x2d')](_0x4b76bd[_0x720d('0x27')],qs[_0x720d('0x2f')](_0x260820[_0x720d('0x2b')][_0x720d('0x2f')]));_0x4d9778['attributes']=_0x4d9778[_0x720d('0x2e')][_0x720d('0x30')]?_0x4d9778[_0x720d('0x2e')]:_0x4b76bd['model'];if(_0x260820[_0x720d('0x2b')][_0x720d('0x31')]){_0x4d9778[_0x720d('0x32')]=[{'all':!![]}];}_0x4d9778=_[_0x720d('0x33')]({},_0x4d9778,_0x260820[_0x720d('0x34')]);return db[_0x720d('0x29')][_0x720d('0x35')](_0x4d9778)[_0x720d('0x36')](handleEntityNotFound(_0x22c161,null))[_0x720d('0x36')](respondWithResult(_0x22c161,null))['catch'](handleError(_0x22c161,null));};exports[_0x720d('0x37')]=function(_0x41325b,_0x3ede58){return db['ChatProactiveAction'][_0x720d('0x37')](_0x41325b[_0x720d('0x38')],{})[_0x720d('0x36')](respondWithResult(_0x3ede58,0xc9))['catch'](handleError(_0x3ede58,null));};exports[_0x720d('0x22')]=function(_0x3ac007,_0x5be2a8){if(_0x3ac007[_0x720d('0x38')]['id']){delete _0x3ac007[_0x720d('0x38')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x3ac007['params']['id']}})['then'](handleEntityNotFound(_0x5be2a8,null))[_0x720d('0x36')](saveUpdates(_0x3ac007[_0x720d('0x38')],null))[_0x720d('0x36')](respondWithResult(_0x5be2a8,null))[_0x720d('0x39')](handleError(_0x5be2a8,null));};exports[_0x720d('0x3a')]=function(_0x1b401f,_0x306f63){return db[_0x720d('0x29')][_0x720d('0x35')]({'where':{'id':_0x1b401f[_0x720d('0x26')]['id']}})['then'](handleEntityNotFound(_0x306f63,null))['then'](removeEntity(_0x306f63,null))[_0x720d('0x39')](handleError(_0x306f63,null));}; \ No newline at end of file +var _0x979e=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','update','then','destroy','error','name','send','show','params','model','ChatProactiveAction','rawAttributes','query','keys','intersection','attributes','fields','includeAll','merge','options','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x56d28a,_0x1b3c56){var _0x33c2db=function(_0x2d3d71){while(--_0x2d3d71){_0x56d28a['push'](_0x56d28a['shift']());}};_0x33c2db(++_0x1b3c56);}(_0x979e,0x195));var _0xe979=function(_0x52531f,_0x10748c){_0x52531f=_0x52531f-0x0;var _0x2fe25f=_0x979e[_0x52531f];return _0x2fe25f;};'use strict';var emlformat=require(_0xe979('0x0'));var rimraf=require(_0xe979('0x1'));var zipdir=require(_0xe979('0x2'));var jsonpatch=require(_0xe979('0x3'));var rp=require('request-promise');var moment=require(_0xe979('0x4'));var BPromise=require(_0xe979('0x5'));var Mustache=require(_0xe979('0x6'));var util=require(_0xe979('0x7'));var path=require(_0xe979('0x8'));var sox=require('sox');var csv=require(_0xe979('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe979('0xa'));var _=require(_0xe979('0xb'));var squel=require(_0xe979('0xc'));var crypto=require(_0xe979('0xd'));var jsforce=require(_0xe979('0xe'));var deskjs=require(_0xe979('0xf'));var toCsv=require(_0xe979('0x9'));var querystring=require(_0xe979('0x10'));var Papa=require(_0xe979('0x11'));var Redis=require(_0xe979('0x12'));var authService=require(_0xe979('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe979('0x14'));var hardwareService=require(_0xe979('0x15'));var logger=require(_0xe979('0x16'))('api');var utils=require(_0xe979('0x17'));var config=require(_0xe979('0x18'));var licenseUtil=require(_0xe979('0x19'));var db=require(_0xe979('0x1a'))['db'];function respondWithStatusCode(_0x2f76cb,_0x1170c6){_0x1170c6=_0x1170c6||0xcc;return function(_0x76e6e5){if(_0x76e6e5){return _0x2f76cb[_0xe979('0x1b')](_0x1170c6);}return _0x2f76cb['status'](_0x1170c6)[_0xe979('0x1c')]();};}function respondWithResult(_0x3b2b92,_0x1f7a6d){_0x1f7a6d=_0x1f7a6d||0xc8;return function(_0x4c56eb){if(_0x4c56eb){return _0x3b2b92['status'](_0x1f7a6d)[_0xe979('0x1d')](_0x4c56eb);}};}function respondWithFilteredResult(_0x265080,_0x1ae6a2){return function(_0x218ce0){if(_0x218ce0){var _0x49de62=typeof _0x1ae6a2[_0xe979('0x1e')]===_0xe979('0x1f')&&typeof _0x1ae6a2[_0xe979('0x20')]===_0xe979('0x1f');var _0x20d50a=_0x218ce0[_0xe979('0x21')];var _0x104a7b=_0x49de62?0x0:_0x1ae6a2['offset'];var _0x25e06d=_0x49de62?_0x218ce0['count']:_0x1ae6a2['offset']+_0x1ae6a2[_0xe979('0x20')];var _0x2a8ffd;if(_0x25e06d>=_0x20d50a){_0x25e06d=_0x20d50a;_0x2a8ffd=0xc8;}else{_0x2a8ffd=0xce;}_0x265080[_0xe979('0x22')](_0x2a8ffd);return _0x265080[_0xe979('0x23')]('Content-Range',_0x104a7b+'-'+_0x25e06d+'/'+_0x20d50a)[_0xe979('0x1d')](_0x218ce0);}return null;};}function patchUpdates(_0x480fbd){return function(_0x43207c){try{jsonpatch[_0xe979('0x24')](_0x43207c,_0x480fbd,!![]);}catch(_0x27c6fb){return BPromise[_0xe979('0x25')](_0x27c6fb);}return _0x43207c['save']();};}function saveUpdates(_0x19e171,_0x4a2d84){return function(_0x37b1d4){if(_0x37b1d4){return _0x37b1d4[_0xe979('0x26')](_0x19e171)[_0xe979('0x27')](function(_0x52b564){return _0x52b564;});}return null;};}function removeEntity(_0x1b49a1,_0x58f9ac){return function(_0x51e0a0){if(_0x51e0a0){return _0x51e0a0[_0xe979('0x28')]()[_0xe979('0x27')](function(){_0x1b49a1['status'](0xcc)[_0xe979('0x1c')]();});}};}function handleEntityNotFound(_0x5bbfea,_0x45dd65){return function(_0x4bfb4b){if(!_0x4bfb4b){_0x5bbfea[_0xe979('0x1b')](0x194);}return _0x4bfb4b;};}function handleError(_0x3afdab,_0x111fbb){_0x111fbb=_0x111fbb||0x1f4;return function(_0x1a01a9){logger[_0xe979('0x29')](_0x1a01a9['stack']);if(_0x1a01a9[_0xe979('0x2a')]){delete _0x1a01a9[_0xe979('0x2a')];}_0x3afdab[_0xe979('0x22')](_0x111fbb)[_0xe979('0x2b')](_0x1a01a9);};}exports[_0xe979('0x2c')]=function(_0x53ada7,_0x1d8dc7){var _0x413c46={'raw':!![],'where':{'id':_0x53ada7[_0xe979('0x2d')]['id']}},_0x53ba87={};_0x53ba87[_0xe979('0x2e')]=_['keys'](db[_0xe979('0x2f')][_0xe979('0x30')]);_0x53ba87[_0xe979('0x31')]=_[_0xe979('0x32')](_0x53ada7[_0xe979('0x31')]);_0x53ba87['filters']=_[_0xe979('0x33')](_0x53ba87[_0xe979('0x2e')],_0x53ba87['query']);_0x413c46[_0xe979('0x34')]=_['intersection'](_0x53ba87[_0xe979('0x2e')],qs[_0xe979('0x35')](_0x53ada7[_0xe979('0x31')][_0xe979('0x35')]));_0x413c46[_0xe979('0x34')]=_0x413c46['attributes']['length']?_0x413c46['attributes']:_0x53ba87[_0xe979('0x2e')];if(_0x53ada7[_0xe979('0x31')][_0xe979('0x36')]){_0x413c46['include']=[{'all':!![]}];}_0x413c46=_[_0xe979('0x37')]({},_0x413c46,_0x53ada7[_0xe979('0x38')]);return db[_0xe979('0x2f')]['find'](_0x413c46)[_0xe979('0x27')](handleEntityNotFound(_0x1d8dc7,null))[_0xe979('0x27')](respondWithResult(_0x1d8dc7,null))[_0xe979('0x39')](handleError(_0x1d8dc7,null));};exports[_0xe979('0x3a')]=function(_0x14de6b,_0x1e1959){return db[_0xe979('0x2f')][_0xe979('0x3a')](_0x14de6b[_0xe979('0x3b')],{})[_0xe979('0x27')](respondWithResult(_0x1e1959,0xc9))[_0xe979('0x39')](handleError(_0x1e1959,null));};exports[_0xe979('0x26')]=function(_0x50ca2f,_0x4398a9){if(_0x50ca2f[_0xe979('0x3b')]['id']){delete _0x50ca2f[_0xe979('0x3b')]['id'];}return db[_0xe979('0x2f')]['find']({'where':{'id':_0x50ca2f[_0xe979('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4398a9,null))[_0xe979('0x27')](saveUpdates(_0x50ca2f[_0xe979('0x3b')],null))['then'](respondWithResult(_0x4398a9,null))[_0xe979('0x39')](handleError(_0x4398a9,null));};exports['destroy']=function(_0x568118,_0x4fb547){return db[_0xe979('0x2f')]['find']({'where':{'id':_0x568118[_0xe979('0x2d')]['id']}})[_0xe979('0x27')](handleEntityNotFound(_0x4fb547,null))[_0xe979('0x27')](removeEntity(_0x4fb547,null))[_0xe979('0x39')](handleError(_0x4fb547,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 76b2870..2033573 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.model.js +++ b/server/api/chatProactiveAction/chatProactiveAction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd5f=['exports','define','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x2205b3,_0x3a32f7){var _0x378980=function(_0x299b16){while(--_0x299b16){_0x2205b3['push'](_0x2205b3['shift']());}};_0x378980(++_0x3a32f7);}(_0xfd5f,0x1d8));var _0xffd5=function(_0x2ef245,_0x1faf9f){_0x2ef245=_0x2ef245-0x0;var _0x5e1694=_0xfd5f[_0x2ef245];return _0x5e1694;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xffd5('0x0'));var moment=require(_0xffd5('0x1'));var BPromise=require(_0xffd5('0x2'));var rp=require(_0xffd5('0x3'));var fs=require('fs');var path=require(_0xffd5('0x4'));var rimraf=require(_0xffd5('0x5'));var config=require(_0xffd5('0x6'));var attributes=require(_0xffd5('0x7'));module[_0xffd5('0x8')]=function(_0x3ab691,_0x5ea78a){return _0x3ab691[_0xffd5('0x9')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fd6=['path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','chat_proactive_actions','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x9b9c46,_0x3997a8){var _0x47ee52=function(_0x1b382f){while(--_0x1b382f){_0x9b9c46['push'](_0x9b9c46['shift']());}};_0x47ee52(++_0x3997a8);}(_0x6fd6,0xf8));var _0x66fd=function(_0x440f90,_0x10ef7c){_0x440f90=_0x440f90-0x0;var _0x125b5c=_0x6fd6[_0x440f90];return _0x125b5c;};'use strict';var _=require(_0x66fd('0x0'));var util=require(_0x66fd('0x1'));var logger=require(_0x66fd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x66fd('0x3'));var rp=require(_0x66fd('0x4'));var fs=require('fs');var path=require(_0x66fd('0x5'));var rimraf=require(_0x66fd('0x6'));var config=require(_0x66fd('0x7'));var attributes=require(_0x66fd('0x8'));module['exports']=function(_0x32468d,_0x3f7f05){return _0x32468d[_0x66fd('0x9')]('ChatProactiveAction',attributes,{'tableName':_0x66fd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 4c25f8d..da36268 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js +++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2247=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0x2247,0xb5));var _0x7224=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x2247[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require('lodash');var util=require(_0x7224('0x0'));var moment=require(_0x7224('0x1'));var BPromise=require(_0x7224('0x2'));var rs=require(_0x7224('0x3'));var fs=require('fs');var Redis=require(_0x7224('0x4'));var db=require(_0x7224('0x5'))['db'];var utils=require(_0x7224('0x6'));var logger=require(_0x7224('0x7'))(_0x7224('0x8'));var config=require('../../config/environment');var jayson=require(_0x7224('0x9'));var client=jayson[_0x7224('0xa')][_0x7224('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32cab2,_0x198469,_0xd64120){return new BPromise(function(_0x27ab44,_0xd9f00f){return client['request'](_0x32cab2,_0xd64120)[_0x7224('0xc')](function(_0x1c75ff){logger[_0x7224('0xd')](_0x7224('0xe'),_0x198469,_0x7224('0xf'));logger[_0x7224('0x10')](_0x7224('0x11'),_0x198469,_0x7224('0xf'),JSON[_0x7224('0x12')](_0x1c75ff));if(_0x1c75ff[_0x7224('0x13')]){if(_0x1c75ff['error'][_0x7224('0x14')]===0x1f4){logger['error'](_0x7224('0xe'),_0x198469,_0x1c75ff[_0x7224('0x13')][_0x7224('0x15')]);return _0xd9f00f(_0x1c75ff[_0x7224('0x13')]['message']);}logger[_0x7224('0x13')](_0x7224('0xe'),_0x198469,_0x1c75ff[_0x7224('0x13')][_0x7224('0x15')]);return _0x27ab44(_0x1c75ff[_0x7224('0x13')][_0x7224('0x15')]);}else{logger['info'](_0x7224('0xe'),_0x198469,_0x7224('0xf'));_0x27ab44(_0x1c75ff['result'][_0x7224('0x15')]);}})[_0x7224('0x16')](function(_0x3593a1){logger['error'](_0x7224('0xe'),_0x198469,_0x3593a1);_0xd9f00f(_0x3593a1);});});} \ No newline at end of file +var _0x017e=['then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0x017e,0xdd));var _0xe017=function(_0x10b7de,_0x51cf9d){_0x10b7de=_0x10b7de-0x0;var _0xd51c81=_0x017e[_0x10b7de];return _0xd51c81;};'use strict';var _=require(_0xe017('0x0'));var util=require(_0xe017('0x1'));var moment=require('moment');var BPromise=require(_0xe017('0x2'));var rs=require(_0xe017('0x3'));var fs=require('fs');var Redis=require(_0xe017('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe017('0x5'))(_0xe017('0x6'));var config=require(_0xe017('0x7'));var jayson=require(_0xe017('0x8'));var client=jayson[_0xe017('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x101d41,_0x50d26f,_0x2e0420){return new BPromise(function(_0x57b19c,_0x37ed9f){return client['request'](_0x101d41,_0x2e0420)[_0xe017('0xa')](function(_0x97a35a){logger[_0xe017('0xb')](_0xe017('0xc'),_0x50d26f,_0xe017('0xd'));logger[_0xe017('0xe')](_0xe017('0xf'),_0x50d26f,'request\x20sent',JSON[_0xe017('0x10')](_0x97a35a));if(_0x97a35a[_0xe017('0x11')]){if(_0x97a35a[_0xe017('0x11')][_0xe017('0x12')]===0x1f4){logger[_0xe017('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x50d26f,_0x97a35a[_0xe017('0x11')][_0xe017('0x13')]);return _0x37ed9f(_0x97a35a[_0xe017('0x11')][_0xe017('0x13')]);}logger['error'](_0xe017('0xc'),_0x50d26f,_0x97a35a[_0xe017('0x11')][_0xe017('0x13')]);return _0x57b19c(_0x97a35a[_0xe017('0x11')][_0xe017('0x13')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x50d26f,_0xe017('0xd'));_0x57b19c(_0x97a35a[_0xe017('0x14')][_0xe017('0x13')]);}})['catch'](function(_0x332810){logger[_0xe017('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x50d26f,_0x332810);_0x37ed9f(_0x332810);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 4960d22..28a24f8 100644 --- a/server/api/chatProactiveAction/index.js +++ b/server/api/chatProactiveAction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda19=['post','create','update','destroy','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x5c5736,_0x200c1a){var _0x41d2a8=function(_0x51b024){while(--_0x51b024){_0x5c5736['push'](_0x5c5736['shift']());}};_0x41d2a8(++_0x200c1a);}(_0xda19,0xd5));var _0x9da1=function(_0x224dd1,_0x18a4a4){_0x224dd1=_0x224dd1-0x0;var _0x5d5b0b=_0xda19[_0x224dd1];return _0x5d5b0b;};'use strict';var multer=require('multer');var util=require(_0x9da1('0x0'));var path=require(_0x9da1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9da1('0x2'));var router=express['Router']();var fs_extra=require(_0x9da1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var controller=require(_0x9da1('0x6'));router[_0x9da1('0x7')](_0x9da1('0x8'),auth[_0x9da1('0x9')](),controller[_0x9da1('0xa')]);router[_0x9da1('0xb')]('/',auth[_0x9da1('0x9')](),controller[_0x9da1('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9da1('0xd')]);router['delete'](_0x9da1('0x8'),auth[_0x9da1('0x9')](),controller[_0x9da1('0xe')]);module[_0x9da1('0xf')]=router; \ No newline at end of file +var _0x326f=['../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5d10e1,_0x30c50b){var _0x5b44fd=function(_0x4d343b){while(--_0x4d343b){_0x5d10e1['push'](_0x5d10e1['shift']());}};_0x5b44fd(++_0x30c50b);}(_0x326f,0xd1));var _0xf326=function(_0x7da4aa,_0x419b5e){_0x7da4aa=_0x7da4aa-0x0;var _0xf7d15c=_0x326f[_0x7da4aa];return _0xf7d15c;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')](_0xf326('0xa'),auth['isAuthenticated'](),controller[_0xf326('0xb')]);router[_0xf326('0xc')]('/',auth[_0xf326('0xd')](),controller[_0xf326('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xf')]);router[_0xf326('0x10')](_0xf326('0xa'),auth[_0xf326('0xd')](),controller[_0xf326('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 98ae8cb..a302bd9 100644 --- a/server/api/chatQueue/chatQueue.attributes.js +++ b/server/api/chatQueue/chatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e85=['name','ENUM','exports'];(function(_0x42ac2c,_0x1a0103){var _0x2dfbb4=function(_0x375c1d){while(--_0x375c1d){_0x42ac2c['push'](_0x42ac2c['shift']());}};_0x2dfbb4(++_0x1a0103);}(_0x2e85,0x71));var _0x52e8=function(_0x1d305a,_0x397380){_0x1d305a=_0x1d305a-0x0;var _0x7d247c=_0x2e85[_0x1d305a];return _0x7d247c;};'use strict';var Sequelize=require('sequelize');module[_0x52e8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x52e8('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x52e8('0x2')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file +var _0x09f2=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x5d57fc,_0x49f7d6){var _0x2729c9=function(_0xb5463e){while(--_0xb5463e){_0x5d57fc['push'](_0x5d57fc['shift']());}};_0x2729c9(++_0x49f7d6);}(_0x09f2,0x165));var _0x209f=function(_0x1d3f82,_0x32c2c3){_0x1d3f82=_0x1d3f82-0x0;var _0x554853=_0x09f2[_0x1d3f82];return _0x554853;};'use strict';var Sequelize=require(_0x209f('0x0'));module[_0x209f('0x1')]={'name':{'type':Sequelize[_0x209f('0x2')],'unique':_0x209f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x209f('0x2')]},'timeout':{'type':Sequelize[_0x209f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x209f('0x5')](_0x209f('0x6'),_0x209f('0x7'),_0x209f('0x8'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 47d28bc..d416082 100644 --- a/server/api/chatQueue/chatQueue.controller.js +++ b/server/api/chatQueue/chatQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ae5=['addTeams','findOrCreate','forEach','emit','removeTeams','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','transaction','isEmpty','removeAgents','addAgents','omit','spread','userChatQueue:save','userChatQueue:remove','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set','then','destroy','get','ChatQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','getOptions','ChatQueue','include','query','findAll','rows','catch','params','model','keys','attributes','intersection','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserChatQueue','filters','hasOwnProperty','nolimit','order','where','pick','ChatQueueId','filter','User','agent','chatPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','findOne','Team','sort','ids','online','voicePause','interface','flatMap','Agents','sequelize'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0x6ae5,0x192));var _0x56ae=function(_0xea0909,_0x50b5f9){_0xea0909=_0xea0909-0x0;var _0x468855=_0x6ae5[_0xea0909];return _0x468855;};'use strict';var BPromise=require(_0x56ae('0x0'));var util=require(_0x56ae('0x1'));var _=require(_0x56ae('0x2'));var squel=require(_0x56ae('0x3'));var Redis=require('ioredis');var qs=require(_0x56ae('0x4'));var logger=require(_0x56ae('0x5'))(_0x56ae('0x6'));var config=require(_0x56ae('0x7'));var db=require(_0x56ae('0x8'))['db'];config['redis']=_[_0x56ae('0x9')](config[_0x56ae('0xa')],{'host':_0x56ae('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x56ae('0xc'))['register'](socket);function respondWithStatusCode(_0x17bd31,_0x35080a){_0x35080a=_0x35080a||0xcc;return function(_0x1a965e){if(_0x1a965e){return _0x17bd31[_0x56ae('0xd')](_0x35080a);}return _0x17bd31[_0x56ae('0xe')](_0x35080a)['end']();};}function respondWithResult(_0x407064,_0x3032e7){_0x3032e7=_0x3032e7||0xc8;return function(_0x44e59e){if(_0x44e59e){return _0x407064[_0x56ae('0xe')](_0x3032e7)[_0x56ae('0xf')](_0x44e59e);}};}function respondWithFilteredResult(_0x3b8015,_0x36c46b){return function(_0x1da7f2){if(_0x1da7f2){var _0x1b2d67=typeof _0x36c46b[_0x56ae('0x10')]===_0x56ae('0x11')&&typeof _0x36c46b[_0x56ae('0x12')]===_0x56ae('0x11');var _0x15074e=_0x1da7f2[_0x56ae('0x13')];var _0x11287f=_0x1b2d67?0x0:_0x36c46b[_0x56ae('0x10')];var _0x5ed57b=_0x1b2d67?_0x1da7f2[_0x56ae('0x13')]:_0x36c46b[_0x56ae('0x10')]+_0x36c46b[_0x56ae('0x12')];var _0x2a3f27;if(_0x5ed57b>=_0x15074e){_0x5ed57b=_0x15074e;_0x2a3f27=0xc8;}else{_0x2a3f27=0xce;}_0x3b8015[_0x56ae('0xe')](_0x2a3f27);return _0x3b8015[_0x56ae('0x14')]('Content-Range',_0x11287f+'-'+_0x5ed57b+'/'+_0x15074e)['json'](_0x1da7f2);}return null;};}function saveUpdates(_0x4e87de){return function(_0x315867){if(_0x315867){return _0x315867['update'](_0x4e87de)[_0x56ae('0x15')](function(_0x262c8c){return _0x262c8c;});}return null;};}function removeEntity(_0x556b05){return function(_0x508c32){if(_0x508c32){return _0x508c32[_0x56ae('0x16')]()[_0x56ae('0x15')](function(){var _0x4c33d0=_0x508c32[_0x56ae('0x17')]({'plain':!![]});var _0x6bd387=_0x56ae('0x18');return db[_0x56ae('0x19')][_0x56ae('0x16')]({'where':{'type':_0x6bd387,'resourceId':_0x4c33d0['id']}})[_0x56ae('0x15')](function(){return _0x508c32;});})['then'](function(){_0x556b05[_0x56ae('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0xce8c32){return function(_0x24f0ac){if(!_0x24f0ac){_0xce8c32[_0x56ae('0xd')](0x194);}return _0x24f0ac;};}function handleError(_0x104923,_0x3c4771){_0x3c4771=_0x3c4771||0x1f4;return function(_0x4d7000){logger[_0x56ae('0x1a')](_0x4d7000['stack']);if(_0x4d7000[_0x56ae('0x1b')]){delete _0x4d7000[_0x56ae('0x1b')];}_0x104923[_0x56ae('0xe')](_0x3c4771)[_0x56ae('0x1c')](_0x4d7000);};}exports[_0x56ae('0x1d')]=function(_0x258ff4,_0x4918a1){var _0x31acc6={};var _0x492e49={'count':0x0,'rows':[]};var _0x4311fe=_[_0x56ae('0x1e')](db['ChatQueue'][_0x56ae('0x1f')],function(_0x149674){return{'name':_0x149674[_0x56ae('0x20')],'type':_0x149674[_0x56ae('0x21')]['key']};});_0x31acc6=qs[_0x56ae('0x22')](_0x4311fe,_0x258ff4);var _0x5e83f0={'where':_0x31acc6['where']};return db[_0x56ae('0x23')][_0x56ae('0x13')](_0x5e83f0)[_0x56ae('0x15')](function(_0x479001){_0x492e49[_0x56ae('0x13')]=_0x479001;_0x31acc6[_0x56ae('0x24')]=qs[_0x56ae('0x24')](_0x258ff4[_0x56ae('0x25')]);return db['ChatQueue'][_0x56ae('0x26')](_0x31acc6);})[_0x56ae('0x15')](function(_0x17184c){_0x492e49[_0x56ae('0x27')]=_0x17184c;return _0x492e49;})[_0x56ae('0x15')](respondWithFilteredResult(_0x4918a1,_0x31acc6))[_0x56ae('0x28')](handleError(_0x4918a1,null));};exports['show']=function(_0x10796a,_0x30893a){var _0xecb789={'raw':!![],'where':{'id':_0x10796a[_0x56ae('0x29')]['id']}},_0x3db311={};_0x3db311[_0x56ae('0x2a')]=_[_0x56ae('0x2b')](db[_0x56ae('0x23')][_0x56ae('0x1f')]);_0x3db311['query']=_['keys'](_0x10796a[_0x56ae('0x25')]);_0x3db311['filters']=_['intersection'](_0x3db311[_0x56ae('0x2a')],_0x3db311[_0x56ae('0x25')]);_0xecb789[_0x56ae('0x2c')]=_[_0x56ae('0x2d')](_0x3db311[_0x56ae('0x2a')],qs[_0x56ae('0x2e')](_0x10796a['query'][_0x56ae('0x2e')]));_0xecb789[_0x56ae('0x2c')]=_0xecb789[_0x56ae('0x2c')][_0x56ae('0x2f')]?_0xecb789[_0x56ae('0x2c')]:_0x3db311[_0x56ae('0x2a')];if(_0x10796a[_0x56ae('0x25')][_0x56ae('0x30')]){_0xecb789[_0x56ae('0x24')]=[{'all':!![]}];}_0xecb789=_[_0x56ae('0x31')]({},_0xecb789,_0x10796a[_0x56ae('0x32')]);return db['ChatQueue'][_0x56ae('0x33')](_0xecb789)[_0x56ae('0x15')](handleEntityNotFound(_0x30893a,null))[_0x56ae('0x15')](respondWithResult(_0x30893a,null))[_0x56ae('0x28')](handleError(_0x30893a,null));};exports[_0x56ae('0x34')]=function(_0x303ddf,_0x56f863){return db[_0x56ae('0x23')][_0x56ae('0x34')](_0x303ddf[_0x56ae('0x35')],{})[_0x56ae('0x15')](function(_0x2fa3c7){var _0x871a7c=_0x303ddf[_0x56ae('0x36')]['get']({'plain':!![]});if(!_0x871a7c)throw new Error(_0x56ae('0x37'));if(_0x871a7c[_0x56ae('0x38')]===_0x56ae('0x36')){var _0x41f7e2=_0x2fa3c7[_0x56ae('0x17')]({'plain':!![]});var _0x4b4b2c=_0x56ae('0x18');return db[_0x56ae('0x39')]['find']({'where':{'name':_0x4b4b2c,'userProfileId':_0x871a7c[_0x56ae('0x3a')]},'raw':!![]})[_0x56ae('0x15')](function(_0x24d434){if(_0x24d434&&_0x24d434[_0x56ae('0x3b')]===0x0){return db[_0x56ae('0x19')][_0x56ae('0x34')]({'name':_0x41f7e2[_0x56ae('0x1b')],'resourceId':_0x41f7e2['id'],'type':_0x24d434['name'],'sectionId':_0x24d434['id']},{})[_0x56ae('0x15')](function(){return _0x2fa3c7;});}else{return _0x2fa3c7;}})['catch'](function(_0x56f2f2){logger[_0x56ae('0x1a')](_0x56ae('0x3c'),_0x56f2f2);throw _0x56f2f2;});}return _0x2fa3c7;})['then'](respondWithResult(_0x56f863,0xc9))['catch'](handleError(_0x56f863,null));};exports['update']=function(_0x464851,_0xa57627){if(_0x464851['body']['id']){delete _0x464851[_0x56ae('0x35')]['id'];}return db[_0x56ae('0x23')][_0x56ae('0x33')]({'where':{'id':_0x464851['params']['id']}})[_0x56ae('0x15')](handleEntityNotFound(_0xa57627,null))[_0x56ae('0x15')](saveUpdates(_0x464851[_0x56ae('0x35')],null))['then'](respondWithResult(_0xa57627,null))[_0x56ae('0x28')](handleError(_0xa57627,null));};exports['destroy']=function(_0x4d94a7,_0x4c962e){return db['ChatQueue'][_0x56ae('0x33')]({'where':{'id':_0x4d94a7[_0x56ae('0x29')]['id']}})[_0x56ae('0x15')](handleEntityNotFound(_0x4c962e,null))[_0x56ae('0x15')](removeEntity(_0x4c962e,null))[_0x56ae('0x28')](handleError(_0x4c962e,null));};exports[_0x56ae('0x3d')]=function(_0x120e63,_0x398db8){return db[_0x56ae('0x23')][_0x56ae('0x3d')]()[_0x56ae('0x15')](respondWithResult(_0x398db8,null))[_0x56ae('0x28')](handleError(_0x398db8,null));};exports['getMembers']=function(_0xd228e0,_0x18e1ed){var _0x330690={'raw':!![],'where':{}},_0x48f02d={},_0x480541;return db['ChatQueue']['findOne']({'where':{'id':_0xd228e0['params']['id']}})[_0x56ae('0x15')](handleEntityNotFound(_0x18e1ed,null))['then'](function(_0xa5fd90){if(_0xa5fd90){_0x480541=_0xa5fd90[_0x56ae('0x17')]({'plain':!![]});_0x48f02d[_0x56ae('0x2a')]=_[_0x56ae('0x2b')](db[_0x56ae('0x3e')][_0x56ae('0x1f')]);_0x48f02d[_0x56ae('0x25')]=_[_0x56ae('0x2b')](_0xd228e0['query']);_0x48f02d[_0x56ae('0x3f')]=_[_0x56ae('0x2d')](_0x48f02d[_0x56ae('0x2a')],_0x48f02d['query']);_0x330690[_0x56ae('0x2c')]=_[_0x56ae('0x2d')](_0x48f02d[_0x56ae('0x2a')],qs[_0x56ae('0x2e')](_0xd228e0['query'][_0x56ae('0x2e')]));_0x330690[_0x56ae('0x2c')]=_0x330690[_0x56ae('0x2c')]['length']?_0x330690['attributes']:_0x48f02d['model'];if(!_0xd228e0['query'][_0x56ae('0x40')](_0x56ae('0x41'))){_0x330690['limit']=qs[_0x56ae('0x12')](_0xd228e0[_0x56ae('0x25')][_0x56ae('0x12')]);_0x330690[_0x56ae('0x10')]=qs[_0x56ae('0x10')](_0xd228e0[_0x56ae('0x25')][_0x56ae('0x10')]);}_0x330690[_0x56ae('0x42')]=qs['sort'](_0xd228e0[_0x56ae('0x25')]['sort']);_0x330690[_0x56ae('0x43')]=qs[_0x56ae('0x3f')](_[_0x56ae('0x44')](_0xd228e0[_0x56ae('0x25')],_0x48f02d[_0x56ae('0x3f')]));_0x330690[_0x56ae('0x43')][_0x56ae('0x45')]=_0xa5fd90['id'];if(_0xd228e0[_0x56ae('0x25')][_0x56ae('0x46')]){_0x330690['where']=_[_0x56ae('0x31')](_0x330690[_0x56ae('0x43')],{'$or':_[_0x56ae('0x1e')](_0x330690['attributes'],function(_0x9809c9){var _0xbb02a7={};_0xbb02a7[_0x9809c9]={'$like':'%'+_0xd228e0['query'][_0x56ae('0x46')]+'%'};return _0xbb02a7;})});}_0x330690=_[_0x56ae('0x31')]({},_0x330690,_0xd228e0[_0x56ae('0x32')]);return db['UserChatQueue']['findAll'](_0x330690);}})[_0x56ae('0x15')](function(_0x57bf6e){if(_0x57bf6e){return db[_0x56ae('0x47')]['findAndCountAll']({'where':{'id':_[_0x56ae('0x1e')](_0x57bf6e,'UserId'),'role':_0x56ae('0x48')},'attributes':['id',_0x56ae('0x1b'),_0x56ae('0x49'),_0x56ae('0x4a'),'createdAt']});}})[_0x56ae('0x15')](function(_0x1ce359){if(_0x1ce359){return{'count':_0x1ce359['count'],'rows':_[_0x56ae('0x1e')](_0x1ce359[_0x56ae('0x27')],function(_0x32117f){return{'membername':_0x32117f[_0x56ae('0x1b')],'UserId':_0x32117f['id'],'queue_name':_0x480541[_0x56ae('0x1b')],'ChatQueueId':_0x480541['id'],'interface':util[_0x56ae('0x4b')](_0x56ae('0x4c'),_0x56ae('0x4d'),_0x32117f[_0x56ae('0x1b')]),'penalty':0x0,'paused':_0x32117f[_0x56ae('0x49')],'createdAt':_0x32117f[_0x56ae('0x4e')],'updatedAt':_0x32117f[_0x56ae('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x56ae('0x15')](respondWithFilteredResult(_0x18e1ed,_0x330690))[_0x56ae('0x28')](handleError(_0x18e1ed,null));};exports[_0x56ae('0x4f')]=function(_0x26c6b7,_0x5b277f){var _0x4d274a={};var _0x177bdd={};var _0xc2f008;var _0x589a90;return db[_0x56ae('0x23')][_0x56ae('0x50')]({'where':{'id':_0x26c6b7[_0x56ae('0x29')]['id']}})[_0x56ae('0x15')](handleEntityNotFound(_0x5b277f,null))[_0x56ae('0x15')](function(_0x12c9bd){if(_0x12c9bd){_0xc2f008=_0x12c9bd;_0x177bdd[_0x56ae('0x2a')]=_[_0x56ae('0x2b')](db[_0x56ae('0x51')]['rawAttributes']);_0x177bdd['query']=_[_0x56ae('0x2b')](_0x26c6b7[_0x56ae('0x25')]);_0x177bdd[_0x56ae('0x3f')]=_[_0x56ae('0x2d')](_0x177bdd['model'],_0x177bdd['query']);_0x4d274a[_0x56ae('0x2c')]=_[_0x56ae('0x2d')](_0x177bdd[_0x56ae('0x2a')],qs[_0x56ae('0x2e')](_0x26c6b7[_0x56ae('0x25')][_0x56ae('0x2e')]));_0x4d274a[_0x56ae('0x2c')]=_0x4d274a[_0x56ae('0x2c')][_0x56ae('0x2f')]?_0x4d274a[_0x56ae('0x2c')]:_0x177bdd[_0x56ae('0x2a')];_0x4d274a['order']=qs['sort'](_0x26c6b7[_0x56ae('0x25')][_0x56ae('0x52')]);_0x4d274a[_0x56ae('0x43')]=qs[_0x56ae('0x3f')](_['pick'](_0x26c6b7[_0x56ae('0x25')],_0x177bdd['filters']));if(_0x26c6b7['query'][_0x56ae('0x46')]){_0x4d274a[_0x56ae('0x43')]=_[_0x56ae('0x31')](_0x4d274a[_0x56ae('0x43')],{'$or':_['map'](_0x4d274a[_0x56ae('0x2c')],function(_0x34a0a7){var _0x57e07d={};_0x57e07d[_0x34a0a7]={'$like':'%'+_0x26c6b7['query']['filter']+'%'};return _0x57e07d;})});}_0x4d274a=_[_0x56ae('0x31')]({},_0x4d274a,_0x26c6b7['options']);return _0xc2f008[_0x56ae('0x4f')](_0x4d274a);}})[_0x56ae('0x15')](function(_0x43058f){if(_0x43058f){_0x589a90=_0x43058f[_0x56ae('0x2f')];if(!_0x26c6b7[_0x56ae('0x25')]['hasOwnProperty'](_0x56ae('0x41'))){_0x4d274a['limit']=qs[_0x56ae('0x12')](_0x26c6b7['query'][_0x56ae('0x12')]);_0x4d274a[_0x56ae('0x10')]=qs[_0x56ae('0x10')](_0x26c6b7[_0x56ae('0x25')][_0x56ae('0x10')]);}return _0xc2f008[_0x56ae('0x4f')](_0x4d274a);}})[_0x56ae('0x15')](function(_0x5786d0){if(_0x5786d0){return _0x5786d0?{'count':_0x589a90,'rows':_0x5786d0}:null;}})[_0x56ae('0x15')](respondWithResult(_0x5b277f,null))[_0x56ae('0x28')](handleError(_0x5b277f,null));};exports['addTeams']=function(_0x1ff8ab,_0x4dc4cc){var _0x51b9a4=_0x1ff8ab[_0x56ae('0x35')][_0x56ae('0x53')];return db[_0x56ae('0x51')][_0x56ae('0x26')]({'where':{'id':_0x51b9a4},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x56ae('0x1b'),_0x56ae('0x54'),_0x56ae('0x55'),_0x56ae('0x56')],'raw':!![]}]})['then'](function(_0x4de2f5){if(_0x4de2f5){var _0x3191a1=_[_0x56ae('0x57')](_0x4de2f5,function(_0x479376){var _0x3209e8=_0x479376[_0x56ae('0x17')]({'plain':!![]});return _0x3209e8[_0x56ae('0x58')];});return db[_0x56ae('0x23')][_0x56ae('0x33')]({'where':{'id':_0x1ff8ab[_0x56ae('0x29')]['id']}})[_0x56ae('0x15')](function(_0x3ae451){return db[_0x56ae('0x59')]['transaction'](function(_0x4d69f3){return _0x3ae451[_0x56ae('0x5a')](_0x51b9a4,{'transaction':_0x4d69f3})[_0x56ae('0x15')](function(){return BPromise['each'](_0x3191a1,function(_0x556532){return db[_0x56ae('0x3e')][_0x56ae('0x5b')]({'where':{'UserId':_0x556532['id'],'ChatQueueId':_0x1ff8ab[_0x56ae('0x29')]['id']},'transaction':_0x4d69f3});});})[_0x56ae('0x15')](function(){_0x3191a1[_0x56ae('0x5c')](function(_0x5025d6){socket[_0x56ae('0x5d')]('userChatQueue:save',{'UserId':_0x5025d6['id'],'ChatQueueId':_0x3ae451['id']});});});});});}})[_0x56ae('0x15')](respondWithStatusCode(_0x4dc4cc,null))['catch'](handleError(_0x4dc4cc,null));};exports[_0x56ae('0x5e')]=function(_0xa5d1f2,_0x362f49){return db[_0x56ae('0x51')][_0x56ae('0x26')]({'where':{'id':_0xa5d1f2[_0x56ae('0x25')][_0x56ae('0x53')]},'attributes':['id'],'include':[{'model':db[_0x56ae('0x47')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x56ae('0x15')](handleEntityNotFound(_0x362f49,null))[_0x56ae('0x15')](function(_0xe9953c){var _0x2fc61b=_['map'](_0xe9953c,'id');var _0x1f430e=[];var _0x5767f2=[];var _0x4dc824=squel['select']();_0x4dc824[_0x56ae('0x5f')]('tq.TeamId')[_0x56ae('0x60')](_0x56ae('0x61'),'tq')[_0x56ae('0x62')](_0x56ae('0x63'),'ut',_0x56ae('0x64'))[_0x56ae('0x43')](_0x56ae('0x65'),_0xa5d1f2[_0x56ae('0x29')]['id']);for(var _0x7147ef=0x0;_0x7147ef<_0xe9953c[_0x56ae('0x2f')];_0x7147ef+=0x1){let _0x225c55=_0xe9953c[_0x7147ef];for(var _0x3a6d6b=0x0;_0x3a6d6b<_0x225c55[_0x56ae('0x58')][_0x56ae('0x2f')];_0x3a6d6b+=0x1){let _0x205474=_0x225c55[_0x56ae('0x58')][_0x3a6d6b];var _0x5814dd=_0x4dc824[_0x56ae('0x66')]();_0x5814dd[_0x56ae('0x43')](_0x56ae('0x67'),_0x205474['id']);_0x5767f2[_0x56ae('0x68')](db['sequelize'][_0x56ae('0x25')](_0x5814dd[_0x56ae('0x69')](),{'type':db['sequelize'][_0x56ae('0x6a')][_0x56ae('0x6b')]})[_0x56ae('0x15')](function(_0x4053ee){if(_0x4053ee[_0x56ae('0x2f')]===0x1){return _0x205474['id'];}else{var _0x2e8498=_[_0x56ae('0x6c')](_['map'](_0x4053ee,_0x56ae('0x6d')),function(_0x4c1fb1){return _[_0x56ae('0x6e')](_0x2fc61b,_0x4c1fb1);});if(_0x2e8498){return _0x205474['id'];}}}));}}return BPromise[_0x56ae('0x6f')](_0x5767f2)[_0x56ae('0x15')](function(_0x491525){_0x1f430e=_(_0x1f430e)['union'](_0x491525)[_0x56ae('0x70')]()[_0x56ae('0x71')]();return db[_0x56ae('0x23')][_0x56ae('0x33')]({'where':{'id':_0xa5d1f2[_0x56ae('0x29')]['id']}})[_0x56ae('0x15')](function(_0x278d58){return db['sequelize'][_0x56ae('0x72')](function(_0x36bde1){return _0x278d58[_0x56ae('0x5e')](_0xa5d1f2['query']['ids'],{'transaction':_0x36bde1})['then'](function(){if(!_[_0x56ae('0x73')](_0x1f430e)){return _0x278d58[_0x56ae('0x74')](_0x1f430e,{'transaction':_0x36bde1});}})['then'](function(){_0x1f430e['forEach'](function(_0x3f2bae){socket[_0x56ae('0x5d')]('userChatQueue:remove',{'UserId':_0x3f2bae,'ChatQueueId':_0x278d58['id']});});});});});});})[_0x56ae('0x15')](respondWithStatusCode(_0x362f49,null))[_0x56ae('0x28')](handleError(_0x362f49,null));};exports['addAgents']=function(_0x342444,_0xdcffb3){return db[_0x56ae('0x23')][_0x56ae('0x33')]({'where':{'id':_0x342444['params']['id']}})[_0x56ae('0x15')](handleEntityNotFound(_0xdcffb3,null))['then'](function(_0x11321b){if(_0x11321b){return _0x11321b[_0x56ae('0x75')](_0x342444[_0x56ae('0x35')][_0x56ae('0x53')],_[_0x56ae('0x76')](_0x342444[_0x56ae('0x35')],[_0x56ae('0x53'),'id'])||{})[_0x56ae('0x77')](function(_0xc595c4){for(var _0x189398=0x0;_0x189398<_0x342444['body'][_0x56ae('0x53')][_0x56ae('0x2f')];_0x189398+=0x1){socket[_0x56ae('0x5d')](_0x56ae('0x78'),{'UserId':Number(_0x342444[_0x56ae('0x35')][_0x56ae('0x53')][_0x189398]),'ChatQueueId':Number(_0x342444[_0x56ae('0x29')]['id'])});}return _0xc595c4;});}})['then'](respondWithResult(_0xdcffb3,null))[_0x56ae('0x28')](handleError(_0xdcffb3,null));};exports[_0x56ae('0x74')]=function(_0x94a57d,_0x3fcdcc){return db[_0x56ae('0x23')]['find']({'where':{'id':_0x94a57d[_0x56ae('0x29')]['id']}})[_0x56ae('0x15')](handleEntityNotFound(_0x3fcdcc,null))[_0x56ae('0x15')](function(_0x34dcdb){if(_0x34dcdb){return _0x34dcdb[_0x56ae('0x74')](_0x94a57d['query'][_0x56ae('0x53')])[_0x56ae('0x15')](function(){if(_['isArray'](_0x94a57d[_0x56ae('0x25')][_0x56ae('0x53')])){for(var _0x3ffdd9=0x0;_0x3ffdd9<_0x94a57d[_0x56ae('0x25')]['ids'][_0x56ae('0x2f')];_0x3ffdd9+=0x1){socket[_0x56ae('0x5d')](_0x56ae('0x79'),{'UserId':Number(_0x94a57d[_0x56ae('0x25')][_0x56ae('0x53')][_0x3ffdd9]),'ChatQueueId':Number(_0x94a57d[_0x56ae('0x29')]['id'])});}}else{socket['emit'](_0x56ae('0x79'),{'UserId':Number(_0x94a57d[_0x56ae('0x25')][_0x56ae('0x53')]),'ChatQueueId':Number(_0x94a57d[_0x56ae('0x29')]['id'])});}});}})[_0x56ae('0x15')](respondWithStatusCode(_0x3fcdcc,null))[_0x56ae('0x28')](handleError(_0x3fcdcc,null));};exports[_0x56ae('0x7a')]=function(_0x435e58,_0x2a1926){var _0x12288f={};var _0x5deaa9={};var _0x415125;var _0x1d5ec1;return db[_0x56ae('0x23')]['findOne']({'where':{'id':_0x435e58[_0x56ae('0x29')]['id']}})[_0x56ae('0x15')](handleEntityNotFound(_0x2a1926,null))[_0x56ae('0x15')](function(_0x4efcb8){if(_0x4efcb8){_0x415125=_0x4efcb8;_0x5deaa9[_0x56ae('0x2a')]=_[_0x56ae('0x2b')](db[_0x56ae('0x47')][_0x56ae('0x1f')]);_0x5deaa9['query']=_[_0x56ae('0x2b')](_0x435e58['query']);_0x5deaa9[_0x56ae('0x3f')]=_[_0x56ae('0x2d')](_0x5deaa9['model'],_0x5deaa9[_0x56ae('0x25')]);_0x12288f['attributes']=_['intersection'](_0x5deaa9[_0x56ae('0x2a')],qs[_0x56ae('0x2e')](_0x435e58[_0x56ae('0x25')]['fields']));_0x12288f[_0x56ae('0x2c')]=_0x12288f[_0x56ae('0x2c')][_0x56ae('0x2f')]?_0x12288f['attributes']:_0x5deaa9['model'];_0x12288f[_0x56ae('0x42')]=qs[_0x56ae('0x52')](_0x435e58[_0x56ae('0x25')]['sort']);_0x12288f[_0x56ae('0x43')]=qs[_0x56ae('0x3f')](_[_0x56ae('0x44')](_0x435e58[_0x56ae('0x25')],_0x5deaa9['filters']));if(_0x435e58['query']['filter']){_0x12288f[_0x56ae('0x43')]=_[_0x56ae('0x31')](_0x12288f[_0x56ae('0x43')],{'$or':_[_0x56ae('0x1e')](_0x12288f['attributes'],function(_0x1fd21c){var _0x5f42f0={};_0x5f42f0[_0x1fd21c]={'$like':'%'+_0x435e58['query']['filter']+'%'};return _0x5f42f0;})});}_0x12288f=_[_0x56ae('0x31')]({},_0x12288f,_0x435e58['options']);return _0x415125[_0x56ae('0x7a')](_0x12288f);}})[_0x56ae('0x15')](function(_0x3d21a3){if(_0x3d21a3){_0x1d5ec1=_0x3d21a3['length'];if(!_0x435e58[_0x56ae('0x25')][_0x56ae('0x40')]('nolimit')){_0x12288f[_0x56ae('0x12')]=qs[_0x56ae('0x12')](_0x435e58[_0x56ae('0x25')][_0x56ae('0x12')]);_0x12288f[_0x56ae('0x10')]=qs[_0x56ae('0x10')](_0x435e58[_0x56ae('0x25')][_0x56ae('0x10')]);}return _0x415125[_0x56ae('0x7a')](_0x12288f);}})[_0x56ae('0x15')](function(_0x5bb9e7){if(_0x5bb9e7){return _0x5bb9e7?{'count':_0x1d5ec1,'rows':_0x5bb9e7}:null;}})[_0x56ae('0x15')](respondWithResult(_0x2a1926,null))['catch'](handleError(_0x2a1926,null));}; \ No newline at end of file +var _0xee48=['status','end','json','offset','undefined','count','set','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','error','name','send','index','fieldName','type','key','getOptions','ChatQueue','include','query','findAll','catch','show','params','model','keys','rawAttributes','filters','attributes','fields','length','includeAll','options','create','body','user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','intersection','hasOwnProperty','nolimit','limit','order','sort','where','pick','ChatQueueId','filter','merge','map','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','Team','addTeams','ids','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','from','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','includes','all','union','compact','isEmpty','userChatQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','bluebird','util','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatQueue.socket','sendStatus'];(function(_0x58258c,_0x34e72f){var _0x174c02=function(_0x79838e){while(--_0x79838e){_0x58258c['push'](_0x58258c['shift']());}};_0x174c02(++_0x34e72f);}(_0xee48,0x15c));var _0x8ee4=function(_0x1b91c7,_0x539acd){_0x1b91c7=_0x1b91c7-0x0;var _0xbbe014=_0xee48[_0x1b91c7];return _0xbbe014;};'use strict';var BPromise=require(_0x8ee4('0x0'));var util=require(_0x8ee4('0x1'));var _=require(_0x8ee4('0x2'));var squel=require('squel');var Redis=require('ioredis');var qs=require(_0x8ee4('0x3'));var logger=require(_0x8ee4('0x4'))('api');var config=require(_0x8ee4('0x5'));var db=require(_0x8ee4('0x6'))['db'];config['redis']=_[_0x8ee4('0x7')](config[_0x8ee4('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ee4('0x9'))(new Redis(config[_0x8ee4('0x8')]));require(_0x8ee4('0xa'))['register'](socket);function respondWithStatusCode(_0x83dfe2,_0x4c6681){_0x4c6681=_0x4c6681||0xcc;return function(_0x2547ab){if(_0x2547ab){return _0x83dfe2[_0x8ee4('0xb')](_0x4c6681);}return _0x83dfe2[_0x8ee4('0xc')](_0x4c6681)[_0x8ee4('0xd')]();};}function respondWithResult(_0xfe67f7,_0x822f0){_0x822f0=_0x822f0||0xc8;return function(_0x19ce74){if(_0x19ce74){return _0xfe67f7['status'](_0x822f0)[_0x8ee4('0xe')](_0x19ce74);}};}function respondWithFilteredResult(_0x1b4979,_0x3632e6){return function(_0x13a638){if(_0x13a638){var _0x1baebf=typeof _0x3632e6[_0x8ee4('0xf')]===_0x8ee4('0x10')&&typeof _0x3632e6['limit']===_0x8ee4('0x10');var _0x271103=_0x13a638[_0x8ee4('0x11')];var _0x1a955a=_0x1baebf?0x0:_0x3632e6[_0x8ee4('0xf')];var _0x58e7b9=_0x1baebf?_0x13a638[_0x8ee4('0x11')]:_0x3632e6['offset']+_0x3632e6['limit'];var _0x234fd6;if(_0x58e7b9>=_0x271103){_0x58e7b9=_0x271103;_0x234fd6=0xc8;}else{_0x234fd6=0xce;}_0x1b4979[_0x8ee4('0xc')](_0x234fd6);return _0x1b4979[_0x8ee4('0x12')](_0x8ee4('0x13'),_0x1a955a+'-'+_0x58e7b9+'/'+_0x271103)[_0x8ee4('0xe')](_0x13a638);}return null;};}function saveUpdates(_0x763dbd){return function(_0x531b6c){if(_0x531b6c){return _0x531b6c[_0x8ee4('0x14')](_0x763dbd)[_0x8ee4('0x15')](function(_0x3081cb){return _0x3081cb;});}return null;};}function removeEntity(_0x4c3115){return function(_0x20f0b6){if(_0x20f0b6){return _0x20f0b6[_0x8ee4('0x16')]()[_0x8ee4('0x15')](function(){var _0x3f5931=_0x20f0b6[_0x8ee4('0x17')]({'plain':!![]});var _0x5f1948=_0x8ee4('0x18');return db[_0x8ee4('0x19')][_0x8ee4('0x16')]({'where':{'type':_0x5f1948,'resourceId':_0x3f5931['id']}})[_0x8ee4('0x15')](function(){return _0x20f0b6;});})[_0x8ee4('0x15')](function(){_0x4c3115[_0x8ee4('0xc')](0xcc)[_0x8ee4('0xd')]();});}};}function handleEntityNotFound(_0x644247){return function(_0x1c9d09){if(!_0x1c9d09){_0x644247[_0x8ee4('0xb')](0x194);}return _0x1c9d09;};}function handleError(_0x2dbdba,_0x1a78bd){_0x1a78bd=_0x1a78bd||0x1f4;return function(_0x4b7a73){logger[_0x8ee4('0x1a')](_0x4b7a73['stack']);if(_0x4b7a73[_0x8ee4('0x1b')]){delete _0x4b7a73['name'];}_0x2dbdba[_0x8ee4('0xc')](_0x1a78bd)[_0x8ee4('0x1c')](_0x4b7a73);};}exports[_0x8ee4('0x1d')]=function(_0x91b89,_0x3d6006){var _0x21635b={};var _0x5765c4={'count':0x0,'rows':[]};var _0x351fbb=_['map'](db['ChatQueue']['rawAttributes'],function(_0x189240){return{'name':_0x189240[_0x8ee4('0x1e')],'type':_0x189240[_0x8ee4('0x1f')][_0x8ee4('0x20')]};});_0x21635b=qs[_0x8ee4('0x21')](_0x351fbb,_0x91b89);var _0xfc7539={'where':_0x21635b['where']};return db[_0x8ee4('0x22')][_0x8ee4('0x11')](_0xfc7539)['then'](function(_0x2dc3ca){_0x5765c4[_0x8ee4('0x11')]=_0x2dc3ca;_0x21635b['include']=qs[_0x8ee4('0x23')](_0x91b89[_0x8ee4('0x24')]);return db[_0x8ee4('0x22')][_0x8ee4('0x25')](_0x21635b);})['then'](function(_0x3f52c1){_0x5765c4['rows']=_0x3f52c1;return _0x5765c4;})[_0x8ee4('0x15')](respondWithFilteredResult(_0x3d6006,_0x21635b))[_0x8ee4('0x26')](handleError(_0x3d6006,null));};exports[_0x8ee4('0x27')]=function(_0x433ecd,_0x412ff2){var _0x5746cd={'raw':!![],'where':{'id':_0x433ecd[_0x8ee4('0x28')]['id']}},_0x39487e={};_0x39487e[_0x8ee4('0x29')]=_[_0x8ee4('0x2a')](db[_0x8ee4('0x22')][_0x8ee4('0x2b')]);_0x39487e['query']=_['keys'](_0x433ecd['query']);_0x39487e[_0x8ee4('0x2c')]=_['intersection'](_0x39487e[_0x8ee4('0x29')],_0x39487e[_0x8ee4('0x24')]);_0x5746cd[_0x8ee4('0x2d')]=_['intersection'](_0x39487e[_0x8ee4('0x29')],qs[_0x8ee4('0x2e')](_0x433ecd[_0x8ee4('0x24')][_0x8ee4('0x2e')]));_0x5746cd[_0x8ee4('0x2d')]=_0x5746cd[_0x8ee4('0x2d')][_0x8ee4('0x2f')]?_0x5746cd[_0x8ee4('0x2d')]:_0x39487e[_0x8ee4('0x29')];if(_0x433ecd[_0x8ee4('0x24')][_0x8ee4('0x30')]){_0x5746cd[_0x8ee4('0x23')]=[{'all':!![]}];}_0x5746cd=_['merge']({},_0x5746cd,_0x433ecd[_0x8ee4('0x31')]);return db[_0x8ee4('0x22')]['find'](_0x5746cd)[_0x8ee4('0x15')](handleEntityNotFound(_0x412ff2,null))[_0x8ee4('0x15')](respondWithResult(_0x412ff2,null))[_0x8ee4('0x26')](handleError(_0x412ff2,null));};exports[_0x8ee4('0x32')]=function(_0x2c93ad,_0xbe2fed){return db[_0x8ee4('0x22')][_0x8ee4('0x32')](_0x2c93ad[_0x8ee4('0x33')],{})[_0x8ee4('0x15')](function(_0x4fa218){var _0x1c3228=_0x2c93ad[_0x8ee4('0x34')][_0x8ee4('0x17')]({'plain':!![]});if(!_0x1c3228)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c3228[_0x8ee4('0x35')]===_0x8ee4('0x34')){var _0x188d12=_0x4fa218['get']({'plain':!![]});var _0x303f78='ChatQueues';return db['UserProfileSection'][_0x8ee4('0x36')]({'where':{'name':_0x303f78,'userProfileId':_0x1c3228['userProfileId']},'raw':!![]})[_0x8ee4('0x15')](function(_0x4235a0){if(_0x4235a0&&_0x4235a0[_0x8ee4('0x37')]===0x0){return db[_0x8ee4('0x19')][_0x8ee4('0x32')]({'name':_0x188d12[_0x8ee4('0x1b')],'resourceId':_0x188d12['id'],'type':_0x4235a0[_0x8ee4('0x1b')],'sectionId':_0x4235a0['id']},{})['then'](function(){return _0x4fa218;});}else{return _0x4fa218;}})[_0x8ee4('0x26')](function(_0x1f4214){logger[_0x8ee4('0x1a')](_0x8ee4('0x38'),_0x1f4214);throw _0x1f4214;});}return _0x4fa218;})[_0x8ee4('0x15')](respondWithResult(_0xbe2fed,0xc9))[_0x8ee4('0x26')](handleError(_0xbe2fed,null));};exports[_0x8ee4('0x14')]=function(_0x14e89a,_0x250910){if(_0x14e89a[_0x8ee4('0x33')]['id']){delete _0x14e89a[_0x8ee4('0x33')]['id'];}return db[_0x8ee4('0x22')][_0x8ee4('0x36')]({'where':{'id':_0x14e89a[_0x8ee4('0x28')]['id']}})[_0x8ee4('0x15')](handleEntityNotFound(_0x250910,null))[_0x8ee4('0x15')](saveUpdates(_0x14e89a[_0x8ee4('0x33')],null))['then'](respondWithResult(_0x250910,null))[_0x8ee4('0x26')](handleError(_0x250910,null));};exports[_0x8ee4('0x16')]=function(_0x5a0c1c,_0x17d85c){return db[_0x8ee4('0x22')][_0x8ee4('0x36')]({'where':{'id':_0x5a0c1c[_0x8ee4('0x28')]['id']}})[_0x8ee4('0x15')](handleEntityNotFound(_0x17d85c,null))[_0x8ee4('0x15')](removeEntity(_0x17d85c,null))[_0x8ee4('0x26')](handleError(_0x17d85c,null));};exports[_0x8ee4('0x39')]=function(_0x102dbe,_0x5b2ec){return db[_0x8ee4('0x22')][_0x8ee4('0x39')]()[_0x8ee4('0x15')](respondWithResult(_0x5b2ec,null))[_0x8ee4('0x26')](handleError(_0x5b2ec,null));};exports[_0x8ee4('0x3a')]=function(_0x46fcb6,_0x25c115){var _0x1e2695={'raw':!![],'where':{}},_0x4eafd7={},_0x8f5754;return db[_0x8ee4('0x22')][_0x8ee4('0x3b')]({'where':{'id':_0x46fcb6[_0x8ee4('0x28')]['id']}})[_0x8ee4('0x15')](handleEntityNotFound(_0x25c115,null))[_0x8ee4('0x15')](function(_0x3a6ff9){if(_0x3a6ff9){_0x8f5754=_0x3a6ff9[_0x8ee4('0x17')]({'plain':!![]});_0x4eafd7[_0x8ee4('0x29')]=_[_0x8ee4('0x2a')](db[_0x8ee4('0x3c')][_0x8ee4('0x2b')]);_0x4eafd7['query']=_[_0x8ee4('0x2a')](_0x46fcb6['query']);_0x4eafd7[_0x8ee4('0x2c')]=_[_0x8ee4('0x3d')](_0x4eafd7[_0x8ee4('0x29')],_0x4eafd7['query']);_0x1e2695[_0x8ee4('0x2d')]=_[_0x8ee4('0x3d')](_0x4eafd7[_0x8ee4('0x29')],qs['fields'](_0x46fcb6[_0x8ee4('0x24')][_0x8ee4('0x2e')]));_0x1e2695['attributes']=_0x1e2695['attributes'][_0x8ee4('0x2f')]?_0x1e2695['attributes']:_0x4eafd7[_0x8ee4('0x29')];if(!_0x46fcb6[_0x8ee4('0x24')][_0x8ee4('0x3e')](_0x8ee4('0x3f'))){_0x1e2695[_0x8ee4('0x40')]=qs[_0x8ee4('0x40')](_0x46fcb6[_0x8ee4('0x24')][_0x8ee4('0x40')]);_0x1e2695['offset']=qs[_0x8ee4('0xf')](_0x46fcb6[_0x8ee4('0x24')][_0x8ee4('0xf')]);}_0x1e2695[_0x8ee4('0x41')]=qs[_0x8ee4('0x42')](_0x46fcb6[_0x8ee4('0x24')][_0x8ee4('0x42')]);_0x1e2695[_0x8ee4('0x43')]=qs[_0x8ee4('0x2c')](_[_0x8ee4('0x44')](_0x46fcb6['query'],_0x4eafd7['filters']));_0x1e2695[_0x8ee4('0x43')][_0x8ee4('0x45')]=_0x3a6ff9['id'];if(_0x46fcb6[_0x8ee4('0x24')][_0x8ee4('0x46')]){_0x1e2695[_0x8ee4('0x43')]=_[_0x8ee4('0x47')](_0x1e2695['where'],{'$or':_[_0x8ee4('0x48')](_0x1e2695['attributes'],function(_0xb5bb19){var _0x3b19b1={};_0x3b19b1[_0xb5bb19]={'$like':'%'+_0x46fcb6[_0x8ee4('0x24')][_0x8ee4('0x46')]+'%'};return _0x3b19b1;})});}_0x1e2695=_[_0x8ee4('0x47')]({},_0x1e2695,_0x46fcb6[_0x8ee4('0x31')]);return db[_0x8ee4('0x3c')][_0x8ee4('0x25')](_0x1e2695);}})[_0x8ee4('0x15')](function(_0x2318b9){if(_0x2318b9){return db[_0x8ee4('0x49')][_0x8ee4('0x4a')]({'where':{'id':_['map'](_0x2318b9,_0x8ee4('0x4b')),'role':'agent'},'attributes':['id',_0x8ee4('0x1b'),_0x8ee4('0x4c'),_0x8ee4('0x4d'),_0x8ee4('0x4e')]});}})['then'](function(_0x5a700c){if(_0x5a700c){return{'count':_0x5a700c[_0x8ee4('0x11')],'rows':_[_0x8ee4('0x48')](_0x5a700c[_0x8ee4('0x4f')],function(_0x369c27){return{'membername':_0x369c27[_0x8ee4('0x1b')],'UserId':_0x369c27['id'],'queue_name':_0x8f5754[_0x8ee4('0x1b')],'ChatQueueId':_0x8f5754['id'],'interface':util['format'](_0x8ee4('0x50'),_0x8ee4('0x51'),_0x369c27['name']),'penalty':0x0,'paused':_0x369c27[_0x8ee4('0x4c')],'createdAt':_0x369c27['createdAt'],'updatedAt':_0x369c27[_0x8ee4('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8ee4('0x15')](respondWithFilteredResult(_0x25c115,_0x1e2695))[_0x8ee4('0x26')](handleError(_0x25c115,null));};exports[_0x8ee4('0x52')]=function(_0x43f74d,_0x27d395){var _0x134f3d={};var _0x42d94f={};var _0x5c364a;var _0xbeafa;return db[_0x8ee4('0x22')][_0x8ee4('0x3b')]({'where':{'id':_0x43f74d[_0x8ee4('0x28')]['id']}})[_0x8ee4('0x15')](handleEntityNotFound(_0x27d395,null))[_0x8ee4('0x15')](function(_0x12ccb8){if(_0x12ccb8){_0x5c364a=_0x12ccb8;_0x42d94f[_0x8ee4('0x29')]=_[_0x8ee4('0x2a')](db[_0x8ee4('0x53')][_0x8ee4('0x2b')]);_0x42d94f[_0x8ee4('0x24')]=_[_0x8ee4('0x2a')](_0x43f74d[_0x8ee4('0x24')]);_0x42d94f[_0x8ee4('0x2c')]=_[_0x8ee4('0x3d')](_0x42d94f[_0x8ee4('0x29')],_0x42d94f[_0x8ee4('0x24')]);_0x134f3d[_0x8ee4('0x2d')]=_[_0x8ee4('0x3d')](_0x42d94f['model'],qs[_0x8ee4('0x2e')](_0x43f74d[_0x8ee4('0x24')][_0x8ee4('0x2e')]));_0x134f3d[_0x8ee4('0x2d')]=_0x134f3d[_0x8ee4('0x2d')][_0x8ee4('0x2f')]?_0x134f3d[_0x8ee4('0x2d')]:_0x42d94f[_0x8ee4('0x29')];_0x134f3d[_0x8ee4('0x41')]=qs[_0x8ee4('0x42')](_0x43f74d['query'][_0x8ee4('0x42')]);_0x134f3d[_0x8ee4('0x43')]=qs['filters'](_[_0x8ee4('0x44')](_0x43f74d[_0x8ee4('0x24')],_0x42d94f['filters']));if(_0x43f74d['query']['filter']){_0x134f3d['where']=_[_0x8ee4('0x47')](_0x134f3d['where'],{'$or':_[_0x8ee4('0x48')](_0x134f3d['attributes'],function(_0x9b6e21){var _0x55dbd0={};_0x55dbd0[_0x9b6e21]={'$like':'%'+_0x43f74d[_0x8ee4('0x24')]['filter']+'%'};return _0x55dbd0;})});}_0x134f3d=_[_0x8ee4('0x47')]({},_0x134f3d,_0x43f74d[_0x8ee4('0x31')]);return _0x5c364a[_0x8ee4('0x52')](_0x134f3d);}})[_0x8ee4('0x15')](function(_0x2f1bff){if(_0x2f1bff){_0xbeafa=_0x2f1bff[_0x8ee4('0x2f')];if(!_0x43f74d[_0x8ee4('0x24')][_0x8ee4('0x3e')](_0x8ee4('0x3f'))){_0x134f3d[_0x8ee4('0x40')]=qs[_0x8ee4('0x40')](_0x43f74d['query'][_0x8ee4('0x40')]);_0x134f3d[_0x8ee4('0xf')]=qs[_0x8ee4('0xf')](_0x43f74d[_0x8ee4('0x24')]['offset']);}return _0x5c364a['getTeams'](_0x134f3d);}})[_0x8ee4('0x15')](function(_0x339c67){if(_0x339c67){return _0x339c67?{'count':_0xbeafa,'rows':_0x339c67}:null;}})['then'](respondWithResult(_0x27d395,null))[_0x8ee4('0x26')](handleError(_0x27d395,null));};exports[_0x8ee4('0x54')]=function(_0x5cb433,_0x59798e){var _0x2fb2f6=_0x5cb433['body'][_0x8ee4('0x55')];return db[_0x8ee4('0x53')][_0x8ee4('0x25')]({'where':{'id':_0x2fb2f6},'attributes':['id'],'include':[{'model':db[_0x8ee4('0x49')],'as':'Agents','attributes':['id','name','online',_0x8ee4('0x56'),_0x8ee4('0x57')],'raw':!![]}]})[_0x8ee4('0x15')](function(_0x11939a){if(_0x11939a){var _0x3877f1=_[_0x8ee4('0x58')](_0x11939a,function(_0x59d288){var _0x533496=_0x59d288['get']({'plain':!![]});return _0x533496[_0x8ee4('0x59')];});return db[_0x8ee4('0x22')]['find']({'where':{'id':_0x5cb433['params']['id']}})[_0x8ee4('0x15')](function(_0x467515){return db['sequelize'][_0x8ee4('0x5a')](function(_0x3be986){return _0x467515[_0x8ee4('0x54')](_0x2fb2f6,{'transaction':_0x3be986})[_0x8ee4('0x15')](function(){return BPromise[_0x8ee4('0x5b')](_0x3877f1,function(_0x20398a){return db[_0x8ee4('0x3c')][_0x8ee4('0x5c')]({'where':{'UserId':_0x20398a['id'],'ChatQueueId':_0x5cb433[_0x8ee4('0x28')]['id']},'transaction':_0x3be986});});})['then'](function(){_0x3877f1[_0x8ee4('0x5d')](function(_0x430b45){socket[_0x8ee4('0x5e')](_0x8ee4('0x5f'),{'UserId':_0x430b45['id'],'ChatQueueId':_0x467515['id']});});});});});}})[_0x8ee4('0x15')](respondWithStatusCode(_0x59798e,null))[_0x8ee4('0x26')](handleError(_0x59798e,null));};exports[_0x8ee4('0x60')]=function(_0x1ba07e,_0x4fa86d){return db[_0x8ee4('0x53')][_0x8ee4('0x25')]({'where':{'id':_0x1ba07e[_0x8ee4('0x24')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8ee4('0x49')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8ee4('0x15')](handleEntityNotFound(_0x4fa86d,null))[_0x8ee4('0x15')](function(_0x236f7d){var _0x32d17d=_[_0x8ee4('0x48')](_0x236f7d,'id');var _0x45ef4d=[];var _0x3fcaeb=[];var _0x47caed=squel[_0x8ee4('0x61')]();_0x47caed[_0x8ee4('0x62')]('tq.TeamId')[_0x8ee4('0x63')]('team_has_chat_queues','tq')[_0x8ee4('0x64')]('user_has_teams','ut',_0x8ee4('0x65'))[_0x8ee4('0x43')](_0x8ee4('0x66'),_0x1ba07e[_0x8ee4('0x28')]['id']);for(var _0xffdf56=0x0;_0xffdf56<_0x236f7d[_0x8ee4('0x2f')];_0xffdf56+=0x1){let _0x239741=_0x236f7d[_0xffdf56];for(var _0x1bc51e=0x0;_0x1bc51e<_0x239741['Agents'][_0x8ee4('0x2f')];_0x1bc51e+=0x1){let _0x9555ae=_0x239741[_0x8ee4('0x59')][_0x1bc51e];var _0x3e0405=_0x47caed[_0x8ee4('0x67')]();_0x3e0405[_0x8ee4('0x43')](_0x8ee4('0x68'),_0x9555ae['id']);_0x3fcaeb[_0x8ee4('0x69')](db[_0x8ee4('0x6a')]['query'](_0x3e0405['toString'](),{'type':db[_0x8ee4('0x6a')][_0x8ee4('0x6b')][_0x8ee4('0x6c')]})[_0x8ee4('0x15')](function(_0x4a3440){if(_0x4a3440[_0x8ee4('0x2f')]===0x1){return _0x9555ae['id'];}else{var _0x5ab59d=_['every'](_[_0x8ee4('0x48')](_0x4a3440,'TeamId'),function(_0x56e39a){return _[_0x8ee4('0x6d')](_0x32d17d,_0x56e39a);});if(_0x5ab59d){return _0x9555ae['id'];}}}));}}return BPromise[_0x8ee4('0x6e')](_0x3fcaeb)['then'](function(_0x28649e){_0x45ef4d=_(_0x45ef4d)[_0x8ee4('0x6f')](_0x28649e)[_0x8ee4('0x70')]()['value']();return db[_0x8ee4('0x22')][_0x8ee4('0x36')]({'where':{'id':_0x1ba07e['params']['id']}})[_0x8ee4('0x15')](function(_0x4433d0){return db[_0x8ee4('0x6a')][_0x8ee4('0x5a')](function(_0xa7aace){return _0x4433d0[_0x8ee4('0x60')](_0x1ba07e[_0x8ee4('0x24')][_0x8ee4('0x55')],{'transaction':_0xa7aace})[_0x8ee4('0x15')](function(){if(!_[_0x8ee4('0x71')](_0x45ef4d)){return _0x4433d0['removeAgents'](_0x45ef4d,{'transaction':_0xa7aace});}})[_0x8ee4('0x15')](function(){_0x45ef4d[_0x8ee4('0x5d')](function(_0x205bf8){socket[_0x8ee4('0x5e')](_0x8ee4('0x72'),{'UserId':_0x205bf8,'ChatQueueId':_0x4433d0['id']});});});});});});})['then'](respondWithStatusCode(_0x4fa86d,null))[_0x8ee4('0x26')](handleError(_0x4fa86d,null));};exports['addAgents']=function(_0x2fd895,_0x403d5f){return db[_0x8ee4('0x22')][_0x8ee4('0x36')]({'where':{'id':_0x2fd895[_0x8ee4('0x28')]['id']}})['then'](handleEntityNotFound(_0x403d5f,null))[_0x8ee4('0x15')](function(_0xe00cd5){if(_0xe00cd5){return _0xe00cd5[_0x8ee4('0x73')](_0x2fd895[_0x8ee4('0x33')][_0x8ee4('0x55')],_['omit'](_0x2fd895[_0x8ee4('0x33')],['ids','id'])||{})[_0x8ee4('0x74')](function(_0x45c8a0){for(var _0x2865cd=0x0;_0x2865cd<_0x2fd895[_0x8ee4('0x33')][_0x8ee4('0x55')][_0x8ee4('0x2f')];_0x2865cd+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x2fd895['body'][_0x8ee4('0x55')][_0x2865cd]),'ChatQueueId':Number(_0x2fd895[_0x8ee4('0x28')]['id'])});}return _0x45c8a0;});}})['then'](respondWithResult(_0x403d5f,null))[_0x8ee4('0x26')](handleError(_0x403d5f,null));};exports[_0x8ee4('0x75')]=function(_0x166ac0,_0xd8c685){return db[_0x8ee4('0x22')][_0x8ee4('0x36')]({'where':{'id':_0x166ac0['params']['id']}})[_0x8ee4('0x15')](handleEntityNotFound(_0xd8c685,null))['then'](function(_0x56bec3){if(_0x56bec3){return _0x56bec3[_0x8ee4('0x75')](_0x166ac0[_0x8ee4('0x24')][_0x8ee4('0x55')])['then'](function(){if(_[_0x8ee4('0x76')](_0x166ac0['query'][_0x8ee4('0x55')])){for(var _0x57fb4b=0x0;_0x57fb4b<_0x166ac0[_0x8ee4('0x24')][_0x8ee4('0x55')][_0x8ee4('0x2f')];_0x57fb4b+=0x1){socket[_0x8ee4('0x5e')](_0x8ee4('0x72'),{'UserId':Number(_0x166ac0[_0x8ee4('0x24')][_0x8ee4('0x55')][_0x57fb4b]),'ChatQueueId':Number(_0x166ac0[_0x8ee4('0x28')]['id'])});}}else{socket[_0x8ee4('0x5e')](_0x8ee4('0x72'),{'UserId':Number(_0x166ac0[_0x8ee4('0x24')][_0x8ee4('0x55')]),'ChatQueueId':Number(_0x166ac0[_0x8ee4('0x28')]['id'])});}});}})[_0x8ee4('0x15')](respondWithStatusCode(_0xd8c685,null))['catch'](handleError(_0xd8c685,null));};exports[_0x8ee4('0x77')]=function(_0x1c6a75,_0x3cbbb4){var _0x115f1e={};var _0x2f5ba2={};var _0x3874fa;var _0x2f39a6;return db[_0x8ee4('0x22')][_0x8ee4('0x3b')]({'where':{'id':_0x1c6a75[_0x8ee4('0x28')]['id']}})[_0x8ee4('0x15')](handleEntityNotFound(_0x3cbbb4,null))['then'](function(_0x47a37c){if(_0x47a37c){_0x3874fa=_0x47a37c;_0x2f5ba2['model']=_[_0x8ee4('0x2a')](db[_0x8ee4('0x49')][_0x8ee4('0x2b')]);_0x2f5ba2[_0x8ee4('0x24')]=_['keys'](_0x1c6a75[_0x8ee4('0x24')]);_0x2f5ba2[_0x8ee4('0x2c')]=_['intersection'](_0x2f5ba2[_0x8ee4('0x29')],_0x2f5ba2[_0x8ee4('0x24')]);_0x115f1e[_0x8ee4('0x2d')]=_['intersection'](_0x2f5ba2[_0x8ee4('0x29')],qs[_0x8ee4('0x2e')](_0x1c6a75['query'][_0x8ee4('0x2e')]));_0x115f1e[_0x8ee4('0x2d')]=_0x115f1e[_0x8ee4('0x2d')][_0x8ee4('0x2f')]?_0x115f1e[_0x8ee4('0x2d')]:_0x2f5ba2[_0x8ee4('0x29')];_0x115f1e[_0x8ee4('0x41')]=qs[_0x8ee4('0x42')](_0x1c6a75[_0x8ee4('0x24')][_0x8ee4('0x42')]);_0x115f1e[_0x8ee4('0x43')]=qs['filters'](_[_0x8ee4('0x44')](_0x1c6a75[_0x8ee4('0x24')],_0x2f5ba2[_0x8ee4('0x2c')]));if(_0x1c6a75[_0x8ee4('0x24')]['filter']){_0x115f1e[_0x8ee4('0x43')]=_['merge'](_0x115f1e[_0x8ee4('0x43')],{'$or':_[_0x8ee4('0x48')](_0x115f1e[_0x8ee4('0x2d')],function(_0x25dd67){var _0x48304e={};_0x48304e[_0x25dd67]={'$like':'%'+_0x1c6a75['query'][_0x8ee4('0x46')]+'%'};return _0x48304e;})});}_0x115f1e=_['merge']({},_0x115f1e,_0x1c6a75[_0x8ee4('0x31')]);return _0x3874fa['getAgents'](_0x115f1e);}})[_0x8ee4('0x15')](function(_0x3ca996){if(_0x3ca996){_0x2f39a6=_0x3ca996[_0x8ee4('0x2f')];if(!_0x1c6a75[_0x8ee4('0x24')][_0x8ee4('0x3e')](_0x8ee4('0x3f'))){_0x115f1e[_0x8ee4('0x40')]=qs[_0x8ee4('0x40')](_0x1c6a75[_0x8ee4('0x24')]['limit']);_0x115f1e[_0x8ee4('0xf')]=qs['offset'](_0x1c6a75[_0x8ee4('0x24')][_0x8ee4('0xf')]);}return _0x3874fa[_0x8ee4('0x77')](_0x115f1e);}})[_0x8ee4('0x15')](function(_0x9fd9e5){if(_0x9fd9e5){return _0x9fd9e5?{'count':_0x2f39a6,'rows':_0x9fd9e5}:null;}})[_0x8ee4('0x15')](respondWithResult(_0x3cbbb4,null))[_0x8ee4('0x26')](handleError(_0x3cbbb4,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 8bf3b40..d9a7e9b 100644 --- a/server/api/chatQueue/chatQueue.events.js +++ b/server/api/chatQueue/chatQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x075e=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x5a8b7f,_0x1d00e7){var _0x5ac4ba=function(_0x4ad317){while(--_0x4ad317){_0x5a8b7f['push'](_0x5a8b7f['shift']());}};_0x5ac4ba(++_0x1d00e7);}(_0x075e,0x92));var _0xe075=function(_0xa82fd8,_0x32d148){_0xa82fd8=_0xa82fd8-0x0;var _0x326265=_0x075e[_0xa82fd8];return _0x326265;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xe075('0x0'))['db'][_0xe075('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe075('0x2')](0x0);var events={'afterCreate':_0xe075('0x3'),'afterUpdate':_0xe075('0x4'),'afterDestroy':_0xe075('0x5')};function emitEvent(_0x15bef2){return function(_0x422c3a,_0x5eddf4,_0xc28e9d){ChatQueueEvents[_0xe075('0x6')](_0x15bef2+':'+_0x422c3a['id'],_0x422c3a);ChatQueueEvents['emit'](_0x15bef2,_0x422c3a);_0xc28e9d(null);};}for(var e in events){if(events[_0xe075('0x7')](e)){var event=events[e];ChatQueue[_0xe075('0x8')](e,emitEvent(event));}}module[_0xe075('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0x0d1a=['events','../../mysqldb','ChatQueue','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x9cf723,_0x4fd2d4){var _0x58ed46=function(_0xb2ff39){while(--_0xb2ff39){_0x9cf723['push'](_0x9cf723['shift']());}};_0x58ed46(++_0x4fd2d4);}(_0x0d1a,0x1e6));var _0xa0d1=function(_0x1ea259,_0x4a177){_0x1ea259=_0x1ea259-0x0;var _0x5d13d1=_0x0d1a[_0x1ea259];return _0x5d13d1;};'use strict';var EventEmitter=require(_0xa0d1('0x0'));var ChatQueue=require(_0xa0d1('0x1'))['db'][_0xa0d1('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa0d1('0x3'),'afterUpdate':'update','afterDestroy':_0xa0d1('0x4')};function emitEvent(_0x153ab5){return function(_0xaa0c3e,_0x1c0966,_0x466865){ChatQueueEvents['emit'](_0x153ab5+':'+_0xaa0c3e['id'],_0xaa0c3e);ChatQueueEvents[_0xa0d1('0x5')](_0x153ab5,_0xaa0c3e);_0x466865(null);};}for(var e in events){if(events[_0xa0d1('0x6')](e)){var event=events[e];ChatQueue[_0xa0d1('0x7')](e,emitEvent(event));}}module[_0xa0d1('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index ac006db..36256a1 100644 --- a/server/api/chatQueue/chatQueue.model.js +++ b/server/api/chatQueue/chatQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6329=['rimraf','./chatQueue.attributes','exports','ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird','path'];(function(_0x36e4de,_0x36e0d6){var _0x3642cf=function(_0x2c4a91){while(--_0x2c4a91){_0x36e4de['push'](_0x36e4de['shift']());}};_0x3642cf(++_0x36e0d6);}(_0x6329,0xc0));var _0x9632=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6329[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x9632('0x0'));var logger=require(_0x9632('0x1'))(_0x9632('0x2'));var moment=require(_0x9632('0x3'));var BPromise=require(_0x9632('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9632('0x5'));var rimraf=require(_0x9632('0x6'));var config=require('../../config/environment');var attributes=require(_0x9632('0x7'));module[_0x9632('0x8')]=function(_0x4d3478,_0x3a9860){return _0x4d3478['define'](_0x9632('0x9'),attributes,{'tableName':_0x9632('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7ac=['request-promise','path','../../config/environment','./chatQueue.attributes','exports','define','lodash','../../config/logger','api','bluebird'];(function(_0x5900b5,_0x2a190b){var _0x3da078=function(_0x42b551){while(--_0x42b551){_0x5900b5['push'](_0x5900b5['shift']());}};_0x3da078(++_0x2a190b);}(_0xa7ac,0xba));var _0xca7a=function(_0x3eddfa,_0x45950e){_0x3eddfa=_0x3eddfa-0x0;var _0x21a5fe=_0xa7ac[_0x3eddfa];return _0x21a5fe;};'use strict';var _=require(_0xca7a('0x0'));var util=require('util');var logger=require(_0xca7a('0x1'))(_0xca7a('0x2'));var moment=require('moment');var BPromise=require(_0xca7a('0x3'));var rp=require(_0xca7a('0x4'));var fs=require('fs');var path=require(_0xca7a('0x5'));var rimraf=require('rimraf');var config=require(_0xca7a('0x6'));var attributes=require(_0xca7a('0x7'));module[_0xca7a('0x8')]=function(_0x2c35bb,_0xb2a120){return _0x2c35bb[_0xca7a('0x9')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 03597a7..8ae7330 100644 --- a/server/api/chatQueue/chatQueue.rpc.js +++ b/server/api/chatQueue/chatQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17bb=['ChatQueue','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetChatQueue','findAll','options','where','attributes','limit','include','map','model','debug','ShowChatQueue'];(function(_0x5167a4,_0x4ac437){var _0xba0081=function(_0xad262a){while(--_0xad262a){_0x5167a4['push'](_0x5167a4['shift']());}};_0xba0081(++_0x4ac437);}(_0x17bb,0x188));var _0xb17b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x17bb[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xb17b('0x0'));var util=require(_0xb17b('0x1'));var moment=require(_0xb17b('0x2'));var BPromise=require(_0xb17b('0x3'));var rs=require(_0xb17b('0x4'));var fs=require('fs');var Redis=require(_0xb17b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb17b('0x6'));var logger=require(_0xb17b('0x7'))(_0xb17b('0x8'));var config=require(_0xb17b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb17b('0xa')]['http']({'port':0x232a});config[_0xb17b('0xb')]=_[_0xb17b('0xc')](config[_0xb17b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xb17b('0xd'))(new Redis(config[_0xb17b('0xb')]));require(_0xb17b('0xe'))[_0xb17b('0xf')](socket);function respondWithRpcPromise(_0x420689,_0x32a3ab,_0x4141c9){return new BPromise(function(_0x7d398e,_0x2b8972){return client['request'](_0x420689,_0x4141c9)[_0xb17b('0x10')](function(_0x4bb871){logger[_0xb17b('0x11')](_0xb17b('0x12'),_0x32a3ab,_0xb17b('0x13'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x32a3ab,_0xb17b('0x13'),JSON[_0xb17b('0x14')](_0x4bb871));if(_0x4bb871[_0xb17b('0x15')]){if(_0x4bb871[_0xb17b('0x15')][_0xb17b('0x16')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x32a3ab,_0x4bb871['error']['message']);return _0x2b8972(_0x4bb871['error'][_0xb17b('0x17')]);}logger['error'](_0xb17b('0x12'),_0x32a3ab,_0x4bb871['error'][_0xb17b('0x17')]);return _0x7d398e(_0x4bb871[_0xb17b('0x15')][_0xb17b('0x17')]);}else{logger[_0xb17b('0x11')]('ChatQueue,\x20%s,\x20%s',_0x32a3ab,_0xb17b('0x13'));_0x7d398e(_0x4bb871[_0xb17b('0x18')][_0xb17b('0x17')]);}})[_0xb17b('0x19')](function(_0x8c7b17){logger[_0xb17b('0x15')](_0xb17b('0x12'),_0x32a3ab,_0x8c7b17);_0x2b8972(_0x8c7b17);});});}exports[_0xb17b('0x1a')]=function(_0x1d3134){var _0xcb3d3a=this;return new Promise(function(_0x268e9f,_0x852753){return db['ChatQueue'][_0xb17b('0x1b')]({'raw':_0x1d3134['options']?_0x1d3134[_0xb17b('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1d3134[_0xb17b('0x1c')]?_0x1d3134[_0xb17b('0x1c')][_0xb17b('0x1d')]||null:null,'attributes':_0x1d3134[_0xb17b('0x1c')]?_0x1d3134['options'][_0xb17b('0x1e')]||null:null,'limit':_0x1d3134[_0xb17b('0x1c')]?_0x1d3134[_0xb17b('0x1c')][_0xb17b('0x1f')]||null:null,'include':_0x1d3134[_0xb17b('0x1c')]?_0x1d3134[_0xb17b('0x1c')][_0xb17b('0x20')]?_[_0xb17b('0x21')](_0x1d3134[_0xb17b('0x1c')][_0xb17b('0x20')],function(_0x1f6124){return{'model':db[_0x1f6124['model']],'as':_0x1f6124['as'],'attributes':_0x1f6124[_0xb17b('0x1e')],'include':_0x1f6124[_0xb17b('0x20')]?_['map'](_0x1f6124[_0xb17b('0x20')],function(_0x45b15a){return{'model':db[_0x45b15a['model']],'as':_0x45b15a['as'],'attributes':_0x45b15a[_0xb17b('0x1e')],'include':_0x45b15a['include']?_[_0xb17b('0x21')](_0x45b15a['include'],function(_0x425fb4){return{'model':db[_0x425fb4[_0xb17b('0x22')]],'as':_0x425fb4['as'],'attributes':_0x425fb4['attributes']};}):[]};}):[]};}):[]:[]})[_0xb17b('0x10')](function(_0x53ac71){logger[_0xb17b('0x11')](_0xb17b('0x1a'),_0x1d3134);logger[_0xb17b('0x23')](_0xb17b('0x1a'),_0x1d3134,JSON[_0xb17b('0x14')](_0x53ac71));_0x268e9f(_0x53ac71);})[_0xb17b('0x19')](function(_0x3c5a72){logger[_0xb17b('0x15')](_0xb17b('0x1a'),_0x3c5a72['message'],_0x1d3134);_0x852753(_0xcb3d3a[_0xb17b('0x15')](0x1f4,_0x3c5a72['message']));});});};exports[_0xb17b('0x24')]=function(_0x4b3fa4){var _0x276601=this;return new Promise(function(_0x221bbf,_0x88c4f1){return db[_0xb17b('0x25')]['find']({'raw':_0x4b3fa4['options']?_0x4b3fa4[_0xb17b('0x1c')][_0xb17b('0x26')]===undefined?!![]:![]:!![],'where':_0x4b3fa4['options']?_0x4b3fa4[_0xb17b('0x1c')][_0xb17b('0x1d')]||null:null,'attributes':_0x4b3fa4[_0xb17b('0x1c')]?_0x4b3fa4[_0xb17b('0x1c')][_0xb17b('0x1e')]||null:null,'include':_0x4b3fa4[_0xb17b('0x1c')]?_0x4b3fa4['options']['include']?_[_0xb17b('0x21')](_0x4b3fa4[_0xb17b('0x1c')]['include'],function(_0x469ab5){return{'model':db[_0x469ab5['model']],'as':_0x469ab5['as'],'attributes':_0x469ab5[_0xb17b('0x1e')],'include':_0x469ab5[_0xb17b('0x20')]?_['map'](_0x469ab5[_0xb17b('0x20')],function(_0x4b8934){return{'model':db[_0x4b8934[_0xb17b('0x22')]],'as':_0x4b8934['as'],'attributes':_0x4b8934[_0xb17b('0x1e')],'include':_0x4b8934[_0xb17b('0x20')]?_['map'](_0x4b8934['include'],function(_0x247a5d){return{'model':db[_0x247a5d[_0xb17b('0x22')]],'as':_0x247a5d['as'],'attributes':_0x247a5d[_0xb17b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb17b('0x10')](function(_0x3eaa43){logger['info'](_0xb17b('0x24'),_0x4b3fa4);logger[_0xb17b('0x23')](_0xb17b('0x24'),_0x4b3fa4,JSON[_0xb17b('0x14')](_0x3eaa43));_0x221bbf(_0x3eaa43);})['catch'](function(_0x6b2091){logger[_0xb17b('0x15')]('ShowChatQueue',_0x6b2091['message'],_0x4b3fa4);_0x88c4f1(_0x276601['error'](0x1f4,_0x6b2091[_0xb17b('0x17')]));});});}; \ No newline at end of file +var _0x56a4=['where','map','include','model','attributes','then','catch','find','raw','ShowChatQueue','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetChatQueue','options'];(function(_0x49ca6b,_0x3ba842){var _0x1d957f=function(_0x12ef94){while(--_0x12ef94){_0x49ca6b['push'](_0x49ca6b['shift']());}};_0x1d957f(++_0x3ba842);}(_0x56a4,0x73));var _0x456a=function(_0x474a72,_0x439f5a){_0x474a72=_0x474a72-0x0;var _0x304966=_0x56a4[_0x474a72];return _0x304966;};'use strict';var _=require('lodash');var util=require(_0x456a('0x0'));var moment=require(_0x456a('0x1'));var BPromise=require(_0x456a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x456a('0x3'))['db'];var utils=require(_0x456a('0x4'));var logger=require(_0x456a('0x5'))(_0x456a('0x6'));var config=require(_0x456a('0x7'));var jayson=require(_0x456a('0x8'));var client=jayson[_0x456a('0x9')][_0x456a('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x456a('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x456a('0xb')]));require('./chatQueue.socket')[_0x456a('0xc')](socket);function respondWithRpcPromise(_0x86bcda,_0x177988,_0x2e5f10){return new BPromise(function(_0x12f945,_0x56f14c){return client[_0x456a('0xd')](_0x86bcda,_0x2e5f10)['then'](function(_0x59f11c){logger[_0x456a('0xe')](_0x456a('0xf'),_0x177988,_0x456a('0x10'));logger[_0x456a('0x11')](_0x456a('0x12'),_0x177988,_0x456a('0x10'),JSON[_0x456a('0x13')](_0x59f11c));if(_0x59f11c['error']){if(_0x59f11c[_0x456a('0x14')]['code']===0x1f4){logger[_0x456a('0x14')]('ChatQueue,\x20%s,\x20%s',_0x177988,_0x59f11c[_0x456a('0x14')]['message']);return _0x56f14c(_0x59f11c[_0x456a('0x14')]['message']);}logger[_0x456a('0x14')]('ChatQueue,\x20%s,\x20%s',_0x177988,_0x59f11c[_0x456a('0x14')][_0x456a('0x15')]);return _0x12f945(_0x59f11c[_0x456a('0x14')][_0x456a('0x15')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x177988,_0x456a('0x10'));_0x12f945(_0x59f11c[_0x456a('0x16')][_0x456a('0x15')]);}})['catch'](function(_0x5aaf40){logger[_0x456a('0x14')](_0x456a('0xf'),_0x177988,_0x5aaf40);_0x56f14c(_0x5aaf40);});});}exports[_0x456a('0x17')]=function(_0x5aff8b){var _0x202877=this;return new Promise(function(_0x2db147,_0x1378ae){return db['ChatQueue']['findAll']({'raw':_0x5aff8b['options']?_0x5aff8b[_0x456a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5aff8b[_0x456a('0x18')]?_0x5aff8b['options'][_0x456a('0x19')]||null:null,'attributes':_0x5aff8b[_0x456a('0x18')]?_0x5aff8b[_0x456a('0x18')]['attributes']||null:null,'limit':_0x5aff8b['options']?_0x5aff8b[_0x456a('0x18')]['limit']||null:null,'include':_0x5aff8b[_0x456a('0x18')]?_0x5aff8b[_0x456a('0x18')]['include']?_[_0x456a('0x1a')](_0x5aff8b[_0x456a('0x18')][_0x456a('0x1b')],function(_0x3f8967){return{'model':db[_0x3f8967[_0x456a('0x1c')]],'as':_0x3f8967['as'],'attributes':_0x3f8967[_0x456a('0x1d')],'include':_0x3f8967['include']?_[_0x456a('0x1a')](_0x3f8967['include'],function(_0x2f7e93){return{'model':db[_0x2f7e93[_0x456a('0x1c')]],'as':_0x2f7e93['as'],'attributes':_0x2f7e93['attributes'],'include':_0x2f7e93[_0x456a('0x1b')]?_['map'](_0x2f7e93[_0x456a('0x1b')],function(_0x3097fb){return{'model':db[_0x3097fb[_0x456a('0x1c')]],'as':_0x3097fb['as'],'attributes':_0x3097fb['attributes']};}):[]};}):[]};}):[]:[]})[_0x456a('0x1e')](function(_0x25287a){logger[_0x456a('0xe')](_0x456a('0x17'),_0x5aff8b);logger[_0x456a('0x11')](_0x456a('0x17'),_0x5aff8b,JSON[_0x456a('0x13')](_0x25287a));_0x2db147(_0x25287a);})[_0x456a('0x1f')](function(_0x1b9af6){logger[_0x456a('0x14')]('GetChatQueue',_0x1b9af6[_0x456a('0x15')],_0x5aff8b);_0x1378ae(_0x202877[_0x456a('0x14')](0x1f4,_0x1b9af6[_0x456a('0x15')]));});});};exports['ShowChatQueue']=function(_0x1ef547){var _0x6d6e3c=this;return new Promise(function(_0x40445d,_0x21f232){return db['ChatQueue'][_0x456a('0x20')]({'raw':_0x1ef547[_0x456a('0x18')]?_0x1ef547[_0x456a('0x18')][_0x456a('0x21')]===undefined?!![]:![]:!![],'where':_0x1ef547['options']?_0x1ef547[_0x456a('0x18')]['where']||null:null,'attributes':_0x1ef547[_0x456a('0x18')]?_0x1ef547[_0x456a('0x18')][_0x456a('0x1d')]||null:null,'include':_0x1ef547['options']?_0x1ef547['options'][_0x456a('0x1b')]?_[_0x456a('0x1a')](_0x1ef547['options']['include'],function(_0x3c308b){return{'model':db[_0x3c308b['model']],'as':_0x3c308b['as'],'attributes':_0x3c308b[_0x456a('0x1d')],'include':_0x3c308b['include']?_[_0x456a('0x1a')](_0x3c308b[_0x456a('0x1b')],function(_0x1b234d){return{'model':db[_0x1b234d[_0x456a('0x1c')]],'as':_0x1b234d['as'],'attributes':_0x1b234d[_0x456a('0x1d')],'include':_0x1b234d[_0x456a('0x1b')]?_[_0x456a('0x1a')](_0x1b234d[_0x456a('0x1b')],function(_0x307440){return{'model':db[_0x307440['model']],'as':_0x307440['as'],'attributes':_0x307440['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5886ed){logger['info'](_0x456a('0x22'),_0x1ef547);logger[_0x456a('0x11')](_0x456a('0x22'),_0x1ef547,JSON[_0x456a('0x13')](_0x5886ed));_0x40445d(_0x5886ed);})[_0x456a('0x1f')](function(_0x2a8527){logger[_0x456a('0x14')](_0x456a('0x22'),_0x2a8527['message'],_0x1ef547);_0x21f232(_0x6d6e3c[_0x456a('0x14')](0x1f4,_0x2a8527[_0x456a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 8a974ee..53fa1d5 100644 --- a/server/api/chatQueue/chatQueue.socket.js +++ b/server/api/chatQueue/chatQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2123=['./chatQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3d117d,_0x2aeca4){var _0x123029=function(_0xc93527){while(--_0xc93527){_0x3d117d['push'](_0x3d117d['shift']());}};_0x123029(++_0x2aeca4);}(_0x2123,0x190));var _0x3212=function(_0x49b4bb,_0x527d37){_0x49b4bb=_0x49b4bb-0x0;var _0x522ba3=_0x2123[_0x49b4bb];return _0x522ba3;};'use strict';var ChatQueueEvents=require(_0x3212('0x0'));var events=[_0x3212('0x1'),_0x3212('0x2'),_0x3212('0x3')];function createListener(_0x7158b8,_0x2ff863){return function(_0x8c047){_0x2ff863[_0x3212('0x4')](_0x7158b8,_0x8c047);};}function removeListener(_0x304f80,_0x6ca653){return function(){ChatQueueEvents[_0x3212('0x5')](_0x304f80,_0x6ca653);};}exports[_0x3212('0x6')]=function(_0x5d9d36){for(var _0x3859e4=0x0,_0x2b1302=events[_0x3212('0x7')];_0x3859e4<_0x2b1302;_0x3859e4++){var _0x4b35e9=events[_0x3859e4];var _0x3e17a3=createListener('chatQueue:'+_0x4b35e9,_0x5d9d36);ChatQueueEvents['on'](_0x4b35e9,_0x3e17a3);}}; \ No newline at end of file +var _0x5089=['length','chatQueue:','./chatQueue.events','save','update','emit','register'];(function(_0xc095d6,_0x1cd2ed){var _0x230abe=function(_0x33e8d0){while(--_0x33e8d0){_0xc095d6['push'](_0xc095d6['shift']());}};_0x230abe(++_0x1cd2ed);}(_0x5089,0x1bb));var _0x9508=function(_0x15cbce,_0xda8402){_0x15cbce=_0x15cbce-0x0;var _0x257f29=_0x5089[_0x15cbce];return _0x257f29;};'use strict';var ChatQueueEvents=require(_0x9508('0x0'));var events=[_0x9508('0x1'),'remove',_0x9508('0x2')];function createListener(_0x35878a,_0x7dd13d){return function(_0x100d7e){_0x7dd13d[_0x9508('0x3')](_0x35878a,_0x100d7e);};}function removeListener(_0x59d3ee,_0x86540d){return function(){ChatQueueEvents['removeListener'](_0x59d3ee,_0x86540d);};}exports[_0x9508('0x4')]=function(_0x4538dd){for(var _0x257318=0x0,_0x4ab3c6=events[_0x9508('0x5')];_0x257318<_0x4ab3c6;_0x257318++){var _0x42d13a=events[_0x257318];var _0x55a5de=createListener(_0x9508('0x6')+_0x42d13a,_0x4538dd);ChatQueueEvents['on'](_0x42d13a,_0x55a5de);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 94ac1df..49aa78d 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3e74,0x175));var _0x43e7=function(_0xbf230e,_0x5eed50){_0xbf230e=_0xbf230e-0x0;var _0x2ab844=_0x3e74[_0xbf230e];return _0x2ab844;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file +var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x227dd9,_0x53f317){var _0x1e18dd=function(_0x38a46e){while(--_0x38a46e){_0x227dd9['push'](_0x227dd9['shift']());}};_0x1e18dd(++_0x53f317);}(_0x55ca,0x126));var _0xa55c=function(_0x437560,_0xc5d67f){_0x437560=_0x437560-0x0;var _0x278361=_0x55ca[_0x437560];return _0x278361;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index e9a1f97..afa653d 100644 --- a/server/api/chatQueueReport/chatQueueReport.attributes.js +++ b/server/api/chatQueueReport/chatQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a25=['DATE','moment','sequelize','exports','STRING'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x0a25,0x15f));var _0x50a2=function(_0xb30a60,_0x19580f){_0xb30a60=_0xb30a60-0x0;var _0x381a7b=_0x0a25[_0xb30a60];return _0x381a7b;};'use strict';var moment=require(_0x50a2('0x0'));var Sequelize=require(_0x50a2('0x1'));module[_0x50a2('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x50a2('0x3')]},'joinAt':{'type':Sequelize[_0x50a2('0x4')]},'leaveAt':{'type':Sequelize[_0x50a2('0x4')]},'acceptAt':{'type':Sequelize[_0x50a2('0x4')]},'exitAt':{'type':Sequelize[_0x50a2('0x4')]},'reason':{'type':Sequelize[_0x50a2('0x3')]}}; \ No newline at end of file +var _0x00fc=['exports','STRING','DATE','moment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x00fc,0x143));var _0xc00f=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x00fc[_0x3e5086];return _0xfeb102;};'use strict';var moment=require(_0xc00f('0x0'));var Sequelize=require('sequelize');module[_0xc00f('0x1')]={'uniqueid':{'type':Sequelize[_0xc00f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc00f('0x2')]},'joinAt':{'type':Sequelize[_0xc00f('0x3')]},'leaveAt':{'type':Sequelize[_0xc00f('0x3')]},'acceptAt':{'type':Sequelize[_0xc00f('0x3')]},'exitAt':{'type':Sequelize[_0xc00f('0x3')]},'reason':{'type':Sequelize[_0xc00f('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index f0968b2..2238ef8 100644 --- a/server/api/chatQueueReport/chatQueueReport.controller.js +++ b/server/api/chatQueueReport/chatQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21cd=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','ChatQueueReport','findAll','rows','show','params','rawAttributes','include','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','fieldName','type','key','model','map','query','keys'];(function(_0x444a7d,_0x5620ea){var _0x54e7f2=function(_0xddffca){while(--_0xddffca){_0x444a7d['push'](_0x444a7d['shift']());}};_0x54e7f2(++_0x5620ea);}(_0x21cd,0x6a));var _0xd21c=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x21cd[_0x20589d];return _0x422de9;};'use strict';var emlformat=require(_0xd21c('0x0'));var rimraf=require(_0xd21c('0x1'));var zipdir=require(_0xd21c('0x2'));var jsonpatch=require(_0xd21c('0x3'));var rp=require(_0xd21c('0x4'));var moment=require(_0xd21c('0x5'));var BPromise=require(_0xd21c('0x6'));var Mustache=require(_0xd21c('0x7'));var util=require(_0xd21c('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xd21c('0x9'));var ejs=require(_0xd21c('0xa'));var fs=require('fs');var fs_extra=require(_0xd21c('0xb'));var _=require(_0xd21c('0xc'));var squel=require(_0xd21c('0xd'));var crypto=require('crypto');var jsforce=require(_0xd21c('0xe'));var deskjs=require(_0xd21c('0xf'));var toCsv=require(_0xd21c('0x9'));var querystring=require(_0xd21c('0x10'));var Papa=require(_0xd21c('0x11'));var Redis=require('ioredis');var authService=require(_0xd21c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd21c('0x13'));var hardwareService=require(_0xd21c('0x14'));var logger=require(_0xd21c('0x15'))(_0xd21c('0x16'));var utils=require(_0xd21c('0x17'));var config=require(_0xd21c('0x18'));var licenseUtil=require(_0xd21c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x357c01,_0x620b37){_0x620b37=_0x620b37||0xcc;return function(_0x2da30c){if(_0x2da30c){return _0x357c01[_0xd21c('0x1a')](_0x620b37);}return _0x357c01[_0xd21c('0x1b')](_0x620b37)[_0xd21c('0x1c')]();};}function respondWithResult(_0x14d82e,_0x2a9362){_0x2a9362=_0x2a9362||0xc8;return function(_0x206aff){if(_0x206aff){return _0x14d82e[_0xd21c('0x1b')](_0x2a9362)[_0xd21c('0x1d')](_0x206aff);}};}function respondWithFilteredResult(_0xaecd8f,_0x5dcc9e){return function(_0x9f8774){if(_0x9f8774){var _0x2066bb=typeof _0x5dcc9e[_0xd21c('0x1e')]===_0xd21c('0x1f')&&typeof _0x5dcc9e[_0xd21c('0x20')]==='undefined';var _0x1df93f=_0x9f8774[_0xd21c('0x21')];var _0x1f60d1=_0x2066bb?0x0:_0x5dcc9e['offset'];var _0x9c294c=_0x2066bb?_0x9f8774[_0xd21c('0x21')]:_0x5dcc9e['offset']+_0x5dcc9e[_0xd21c('0x20')];var _0xa96896;if(_0x9c294c>=_0x1df93f){_0x9c294c=_0x1df93f;_0xa96896=0xc8;}else{_0xa96896=0xce;}_0xaecd8f['status'](_0xa96896);return _0xaecd8f[_0xd21c('0x22')]('Content-Range',_0x1f60d1+'-'+_0x9c294c+'/'+_0x1df93f)[_0xd21c('0x1d')](_0x9f8774);}return null;};}function patchUpdates(_0x21a175){return function(_0x1f00db){try{jsonpatch[_0xd21c('0x23')](_0x1f00db,_0x21a175,!![]);}catch(_0x52665c){return BPromise[_0xd21c('0x24')](_0x52665c);}return _0x1f00db['save']();};}function saveUpdates(_0x5cad51,_0x26e381){return function(_0x75bd03){if(_0x75bd03){return _0x75bd03[_0xd21c('0x25')](_0x5cad51)[_0xd21c('0x26')](function(_0x29ee5e){return _0x29ee5e;});}return null;};}function removeEntity(_0x1b05fa,_0xa04dd3){return function(_0x399a0a){if(_0x399a0a){return _0x399a0a[_0xd21c('0x27')]()[_0xd21c('0x26')](function(){_0x1b05fa[_0xd21c('0x1b')](0xcc)[_0xd21c('0x1c')]();});}};}function handleEntityNotFound(_0x537ca9,_0x44086e){return function(_0x5382bf){if(!_0x5382bf){_0x537ca9[_0xd21c('0x1a')](0x194);}return _0x5382bf;};}function handleError(_0x492cf7,_0xd95c7f){_0xd95c7f=_0xd95c7f||0x1f4;return function(_0x37d2ad){logger[_0xd21c('0x28')](_0x37d2ad[_0xd21c('0x29')]);if(_0x37d2ad[_0xd21c('0x2a')]){delete _0x37d2ad[_0xd21c('0x2a')];}_0x492cf7[_0xd21c('0x1b')](_0xd95c7f)[_0xd21c('0x2b')](_0x37d2ad);};}exports[_0xd21c('0x2c')]=function(_0x14cc32,_0x4e861b){var _0x416cca={},_0x2c09b3={},_0x5c0e39={'count':0x0,'rows':[]};var _0x9eff15=_['map'](db['ChatQueueReport']['rawAttributes'],function(_0x2a45c0){return{'name':_0x2a45c0[_0xd21c('0x2d')],'type':_0x2a45c0[_0xd21c('0x2e')][_0xd21c('0x2f')]};});_0x2c09b3[_0xd21c('0x30')]=_[_0xd21c('0x31')](_0x9eff15,'name');_0x2c09b3[_0xd21c('0x32')]=_[_0xd21c('0x33')](_0x14cc32[_0xd21c('0x32')]);_0x2c09b3[_0xd21c('0x34')]=_[_0xd21c('0x35')](_0x2c09b3['model'],_0x2c09b3[_0xd21c('0x32')]);_0x416cca[_0xd21c('0x36')]=_['intersection'](_0x2c09b3['model'],qs[_0xd21c('0x37')](_0x14cc32['query'][_0xd21c('0x37')]));_0x416cca[_0xd21c('0x36')]=_0x416cca['attributes'][_0xd21c('0x38')]?_0x416cca['attributes']:_0x2c09b3[_0xd21c('0x30')];if(!_0x14cc32['query'][_0xd21c('0x39')](_0xd21c('0x3a'))){_0x416cca[_0xd21c('0x20')]=qs[_0xd21c('0x20')](_0x14cc32[_0xd21c('0x32')][_0xd21c('0x20')]);_0x416cca[_0xd21c('0x1e')]=qs[_0xd21c('0x1e')](_0x14cc32[_0xd21c('0x32')][_0xd21c('0x1e')]);}_0x416cca[_0xd21c('0x3b')]=qs['sort'](_0x14cc32[_0xd21c('0x32')][_0xd21c('0x3c')]);_0x416cca[_0xd21c('0x3d')]=qs[_0xd21c('0x34')](_[_0xd21c('0x3e')](_0x14cc32[_0xd21c('0x32')],_0x2c09b3[_0xd21c('0x34')]),_0x9eff15);if(_0x14cc32[_0xd21c('0x32')][_0xd21c('0x3f')]){_0x416cca[_0xd21c('0x3d')]=_['merge'](_0x416cca[_0xd21c('0x3d')],{'$or':_[_0xd21c('0x31')](_0x9eff15,function(_0x210e5f){if(_0x210e5f[_0xd21c('0x2e')]!==_0xd21c('0x40')){var _0x4b8ee8={};_0x4b8ee8[_0x210e5f[_0xd21c('0x2a')]]={'$like':'%'+_0x14cc32[_0xd21c('0x32')]['filter']+'%'};return _0x4b8ee8;}})});}_0x416cca=_[_0xd21c('0x41')]({},_0x416cca,_0x14cc32[_0xd21c('0x42')]);var _0x57b4b7={'where':_0x416cca[_0xd21c('0x3d')]};return db[_0xd21c('0x43')][_0xd21c('0x21')](_0x57b4b7)[_0xd21c('0x26')](function(_0x2bffe1){_0x5c0e39[_0xd21c('0x21')]=_0x2bffe1;if(_0x14cc32[_0xd21c('0x32')]['includeAll']){_0x416cca['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0xd21c('0x44')](_0x416cca);})[_0xd21c('0x26')](function(_0x26432f){_0x5c0e39[_0xd21c('0x45')]=_0x26432f;return _0x5c0e39;})[_0xd21c('0x26')](respondWithFilteredResult(_0x4e861b,_0x416cca))['catch'](handleError(_0x4e861b,null));};exports[_0xd21c('0x46')]=function(_0x37bf8e,_0x108ca2){var _0x2e7300={'raw':!![],'where':{'id':_0x37bf8e[_0xd21c('0x47')]['id']}},_0x9ca6f1={};_0x9ca6f1[_0xd21c('0x30')]=_[_0xd21c('0x33')](db['ChatQueueReport'][_0xd21c('0x48')]);_0x9ca6f1[_0xd21c('0x32')]=_[_0xd21c('0x33')](_0x37bf8e['query']);_0x9ca6f1[_0xd21c('0x34')]=_[_0xd21c('0x35')](_0x9ca6f1[_0xd21c('0x30')],_0x9ca6f1[_0xd21c('0x32')]);_0x2e7300['attributes']=_[_0xd21c('0x35')](_0x9ca6f1[_0xd21c('0x30')],qs['fields'](_0x37bf8e[_0xd21c('0x32')][_0xd21c('0x37')]));_0x2e7300[_0xd21c('0x36')]=_0x2e7300['attributes'][_0xd21c('0x38')]?_0x2e7300['attributes']:_0x9ca6f1[_0xd21c('0x30')];if(_0x37bf8e['query']['includeAll']){_0x2e7300[_0xd21c('0x49')]=[{'all':!![]}];}_0x2e7300=_[_0xd21c('0x41')]({},_0x2e7300,_0x37bf8e[_0xd21c('0x42')]);return db[_0xd21c('0x43')][_0xd21c('0x4a')](_0x2e7300)[_0xd21c('0x26')](handleEntityNotFound(_0x108ca2,null))[_0xd21c('0x26')](respondWithResult(_0x108ca2,null))['catch'](handleError(_0x108ca2,null));};exports['create']=function(_0x46bca9,_0x434c61){return db[_0xd21c('0x43')][_0xd21c('0x4b')](_0x46bca9[_0xd21c('0x4c')],{})['then'](respondWithResult(_0x434c61,0xc9))['catch'](handleError(_0x434c61,null));};exports[_0xd21c('0x25')]=function(_0x29c774,_0x572a75){if(_0x29c774[_0xd21c('0x4c')]['id']){delete _0x29c774['body']['id'];}return db['ChatQueueReport'][_0xd21c('0x4a')]({'where':{'id':_0x29c774['params']['id']}})['then'](handleEntityNotFound(_0x572a75,null))[_0xd21c('0x26')](saveUpdates(_0x29c774[_0xd21c('0x4c')],null))[_0xd21c('0x26')](respondWithResult(_0x572a75,null))[_0xd21c('0x4d')](handleError(_0x572a75,null));};exports['destroy']=function(_0x4ec106,_0xc33936){return db['ChatQueueReport'][_0xd21c('0x4a')]({'where':{'id':_0x4ec106[_0xd21c('0x47')]['id']}})[_0xd21c('0x26')](handleEntityNotFound(_0xc33936,null))['then'](removeEntity(_0xc33936,null))[_0xd21c('0x4d')](handleError(_0xc33936,null));};exports[_0xd21c('0x4e')]=function(_0x2f59ce,_0x5c765b){return db['ChatQueueReport'][_0xd21c('0x4e')]()['then'](respondWithResult(_0x5c765b,null))[_0xd21c('0x4d')](handleError(_0x5c765b,null));}; \ No newline at end of file +var _0x11c1=['body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','include','findAll','catch','show','params','includeAll','create'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0x11c1,0x1cb));var _0x111c=function(_0x2deca1,_0x2f3e4e){_0x2deca1=_0x2deca1-0x0;var _0x35ce36=_0x11c1[_0x2deca1];return _0x35ce36;};'use strict';var emlformat=require(_0x111c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x111c('0x1'));var jsonpatch=require(_0x111c('0x2'));var rp=require(_0x111c('0x3'));var moment=require(_0x111c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x111c('0x5'));var util=require(_0x111c('0x6'));var path=require(_0x111c('0x7'));var sox=require(_0x111c('0x8'));var csv=require(_0x111c('0x9'));var ejs=require(_0x111c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x111c('0xb'));var squel=require(_0x111c('0xc'));var crypto=require(_0x111c('0xd'));var jsforce=require(_0x111c('0xe'));var deskjs=require(_0x111c('0xf'));var toCsv=require(_0x111c('0x9'));var querystring=require(_0x111c('0x10'));var Papa=require(_0x111c('0x11'));var Redis=require(_0x111c('0x12'));var authService=require(_0x111c('0x13'));var qs=require(_0x111c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x111c('0x15'));var config=require(_0x111c('0x16'));var licenseUtil=require(_0x111c('0x17'));var db=require(_0x111c('0x18'))['db'];function respondWithStatusCode(_0x161df9,_0x18f728){_0x18f728=_0x18f728||0xcc;return function(_0x37deee){if(_0x37deee){return _0x161df9[_0x111c('0x19')](_0x18f728);}return _0x161df9[_0x111c('0x1a')](_0x18f728)[_0x111c('0x1b')]();};}function respondWithResult(_0x1b0dd5,_0x37a4bd){_0x37a4bd=_0x37a4bd||0xc8;return function(_0x3ad856){if(_0x3ad856){return _0x1b0dd5[_0x111c('0x1a')](_0x37a4bd)[_0x111c('0x1c')](_0x3ad856);}};}function respondWithFilteredResult(_0x412f7e,_0x2d2adb){return function(_0x9e7a7c){if(_0x9e7a7c){var _0x3babf6=typeof _0x2d2adb['offset']==='undefined'&&typeof _0x2d2adb['limit']===_0x111c('0x1d');var _0x4bd3d8=_0x9e7a7c['count'];var _0x198249=_0x3babf6?0x0:_0x2d2adb[_0x111c('0x1e')];var _0x2d54e6=_0x3babf6?_0x9e7a7c[_0x111c('0x1f')]:_0x2d2adb[_0x111c('0x1e')]+_0x2d2adb[_0x111c('0x20')];var _0x5b9171;if(_0x2d54e6>=_0x4bd3d8){_0x2d54e6=_0x4bd3d8;_0x5b9171=0xc8;}else{_0x5b9171=0xce;}_0x412f7e[_0x111c('0x1a')](_0x5b9171);return _0x412f7e[_0x111c('0x21')]('Content-Range',_0x198249+'-'+_0x2d54e6+'/'+_0x4bd3d8)[_0x111c('0x1c')](_0x9e7a7c);}return null;};}function patchUpdates(_0x211de8){return function(_0x1df840){try{jsonpatch['apply'](_0x1df840,_0x211de8,!![]);}catch(_0x39ebe3){return BPromise[_0x111c('0x22')](_0x39ebe3);}return _0x1df840[_0x111c('0x23')]();};}function saveUpdates(_0x54a586,_0x31b236){return function(_0x17d02b){if(_0x17d02b){return _0x17d02b[_0x111c('0x24')](_0x54a586)[_0x111c('0x25')](function(_0x2c4c6b){return _0x2c4c6b;});}return null;};}function removeEntity(_0x3da021,_0xe5b252){return function(_0x3694b5){if(_0x3694b5){return _0x3694b5[_0x111c('0x26')]()['then'](function(){_0x3da021[_0x111c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26b3b8,_0x2576b8){return function(_0x5764b9){if(!_0x5764b9){_0x26b3b8[_0x111c('0x19')](0x194);}return _0x5764b9;};}function handleError(_0x17a9cd,_0x55e7d0){_0x55e7d0=_0x55e7d0||0x1f4;return function(_0x33040d){logger[_0x111c('0x27')](_0x33040d[_0x111c('0x28')]);if(_0x33040d[_0x111c('0x29')]){delete _0x33040d[_0x111c('0x29')];}_0x17a9cd[_0x111c('0x1a')](_0x55e7d0)[_0x111c('0x2a')](_0x33040d);};}exports[_0x111c('0x2b')]=function(_0x46e407,_0x70592b){var _0x5e3047={},_0x40d992={},_0x45bd8c={'count':0x0,'rows':[]};var _0x4c9c67=_[_0x111c('0x2c')](db[_0x111c('0x2d')]['rawAttributes'],function(_0x401138){return{'name':_0x401138[_0x111c('0x2e')],'type':_0x401138['type'][_0x111c('0x2f')]};});_0x40d992['model']=_['map'](_0x4c9c67,_0x111c('0x29'));_0x40d992[_0x111c('0x30')]=_[_0x111c('0x31')](_0x46e407[_0x111c('0x30')]);_0x40d992[_0x111c('0x32')]=_[_0x111c('0x33')](_0x40d992[_0x111c('0x34')],_0x40d992[_0x111c('0x30')]);_0x5e3047[_0x111c('0x35')]=_[_0x111c('0x33')](_0x40d992[_0x111c('0x34')],qs[_0x111c('0x36')](_0x46e407[_0x111c('0x30')]['fields']));_0x5e3047[_0x111c('0x35')]=_0x5e3047[_0x111c('0x35')][_0x111c('0x37')]?_0x5e3047['attributes']:_0x40d992[_0x111c('0x34')];if(!_0x46e407[_0x111c('0x30')][_0x111c('0x38')](_0x111c('0x39'))){_0x5e3047[_0x111c('0x20')]=qs[_0x111c('0x20')](_0x46e407[_0x111c('0x30')]['limit']);_0x5e3047[_0x111c('0x1e')]=qs['offset'](_0x46e407[_0x111c('0x30')][_0x111c('0x1e')]);}_0x5e3047[_0x111c('0x3a')]=qs[_0x111c('0x3b')](_0x46e407['query'][_0x111c('0x3b')]);_0x5e3047['where']=qs[_0x111c('0x32')](_['pick'](_0x46e407[_0x111c('0x30')],_0x40d992[_0x111c('0x32')]),_0x4c9c67);if(_0x46e407[_0x111c('0x30')][_0x111c('0x3c')]){_0x5e3047[_0x111c('0x3d')]=_[_0x111c('0x3e')](_0x5e3047[_0x111c('0x3d')],{'$or':_[_0x111c('0x2c')](_0x4c9c67,function(_0x56fb83){if(_0x56fb83[_0x111c('0x3f')]!==_0x111c('0x40')){var _0x591fe1={};_0x591fe1[_0x56fb83['name']]={'$like':'%'+_0x46e407[_0x111c('0x30')]['filter']+'%'};return _0x591fe1;}})});}_0x5e3047=_['merge']({},_0x5e3047,_0x46e407[_0x111c('0x41')]);var _0x5ffb09={'where':_0x5e3047[_0x111c('0x3d')]};return db[_0x111c('0x2d')][_0x111c('0x1f')](_0x5ffb09)[_0x111c('0x25')](function(_0x167b00){_0x45bd8c[_0x111c('0x1f')]=_0x167b00;if(_0x46e407[_0x111c('0x30')]['includeAll']){_0x5e3047[_0x111c('0x42')]=[{'all':!![]}];}return db[_0x111c('0x2d')][_0x111c('0x43')](_0x5e3047);})['then'](function(_0x354dca){_0x45bd8c['rows']=_0x354dca;return _0x45bd8c;})['then'](respondWithFilteredResult(_0x70592b,_0x5e3047))[_0x111c('0x44')](handleError(_0x70592b,null));};exports[_0x111c('0x45')]=function(_0x10f4f7,_0x22e95b){var _0x38d7a0={'raw':!![],'where':{'id':_0x10f4f7[_0x111c('0x46')]['id']}},_0x1b4e4f={};_0x1b4e4f[_0x111c('0x34')]=_['keys'](db[_0x111c('0x2d')]['rawAttributes']);_0x1b4e4f[_0x111c('0x30')]=_[_0x111c('0x31')](_0x10f4f7[_0x111c('0x30')]);_0x1b4e4f[_0x111c('0x32')]=_[_0x111c('0x33')](_0x1b4e4f['model'],_0x1b4e4f['query']);_0x38d7a0[_0x111c('0x35')]=_[_0x111c('0x33')](_0x1b4e4f[_0x111c('0x34')],qs['fields'](_0x10f4f7['query']['fields']));_0x38d7a0['attributes']=_0x38d7a0[_0x111c('0x35')]['length']?_0x38d7a0['attributes']:_0x1b4e4f['model'];if(_0x10f4f7[_0x111c('0x30')][_0x111c('0x47')]){_0x38d7a0['include']=[{'all':!![]}];}_0x38d7a0=_['merge']({},_0x38d7a0,_0x10f4f7['options']);return db[_0x111c('0x2d')]['find'](_0x38d7a0)[_0x111c('0x25')](handleEntityNotFound(_0x22e95b,null))[_0x111c('0x25')](respondWithResult(_0x22e95b,null))[_0x111c('0x44')](handleError(_0x22e95b,null));};exports[_0x111c('0x48')]=function(_0x2849b6,_0x137ee5){return db['ChatQueueReport'][_0x111c('0x48')](_0x2849b6[_0x111c('0x49')],{})['then'](respondWithResult(_0x137ee5,0xc9))[_0x111c('0x44')](handleError(_0x137ee5,null));};exports[_0x111c('0x24')]=function(_0x8cad9c,_0x24731d){if(_0x8cad9c[_0x111c('0x49')]['id']){delete _0x8cad9c[_0x111c('0x49')]['id'];}return db[_0x111c('0x2d')][_0x111c('0x4a')]({'where':{'id':_0x8cad9c[_0x111c('0x46')]['id']}})[_0x111c('0x25')](handleEntityNotFound(_0x24731d,null))['then'](saveUpdates(_0x8cad9c['body'],null))[_0x111c('0x25')](respondWithResult(_0x24731d,null))[_0x111c('0x44')](handleError(_0x24731d,null));};exports[_0x111c('0x26')]=function(_0x4288ab,_0x584c6f){return db['ChatQueueReport'][_0x111c('0x4a')]({'where':{'id':_0x4288ab[_0x111c('0x46')]['id']}})[_0x111c('0x25')](handleEntityNotFound(_0x584c6f,null))[_0x111c('0x25')](removeEntity(_0x584c6f,null))['catch'](handleError(_0x584c6f,null));};exports[_0x111c('0x4b')]=function(_0x288c34,_0x107c61){return db[_0x111c('0x2d')]['describe']()[_0x111c('0x25')](respondWithResult(_0x107c61,null))[_0x111c('0x44')](handleError(_0x107c61,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 19169f5..6b6f85e 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x557e47,_0x3cf865){var _0x14d4f0=function(_0x2ebdb4){while(--_0x2ebdb4){_0x557e47['push'](_0x557e47['shift']());}};_0x14d4f0(++_0x3cf865);}(_0x757a,0xde));var _0xa757=function(_0x2531ff,_0x352b1c){_0x2531ff=_0x2531ff-0x0;var _0x57167e=_0x757a[_0x2531ff];return _0x57167e;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x516c9b,_0x32dd27){var _0x4adea3=function(_0x4e9167){while(--_0x4e9167){_0x516c9b['push'](_0x516c9b['shift']());}};_0x4adea3(++_0x32dd27);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xb7e7[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index f3b3c8c..be771f3 100644 --- a/server/api/chatQueueReport/chatQueueReport.rpc.js +++ b/server/api/chatQueueReport/chatQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x86bb=['request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','ChatQueueReport,\x20%s,\x20%s'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0x86bb,0xfb));var _0xb86b=function(_0x588370,_0x4563b9){_0x588370=_0x588370-0x0;var _0x1b0dc1=_0x86bb[_0x588370];return _0x1b0dc1;};'use strict';var _=require('lodash');var util=require(_0xb86b('0x0'));var moment=require(_0xb86b('0x1'));var BPromise=require(_0xb86b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb86b('0x3'));var db=require(_0xb86b('0x4'))['db'];var utils=require(_0xb86b('0x5'));var logger=require(_0xb86b('0x6'))(_0xb86b('0x7'));var config=require('../../config/environment');var jayson=require(_0xb86b('0x8'));var client=jayson[_0xb86b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b1c4b,_0x3be905,_0x4d11a0){return new BPromise(function(_0x32a8a0,_0x5f398a){return client['request'](_0x2b1c4b,_0x4d11a0)[_0xb86b('0xa')](function(_0x5ab8b5){logger[_0xb86b('0xb')](_0xb86b('0xc'),_0x3be905,_0xb86b('0xd'));logger[_0xb86b('0xe')](_0xb86b('0xf'),_0x3be905,_0xb86b('0xd'),JSON[_0xb86b('0x10')](_0x5ab8b5));if(_0x5ab8b5['error']){if(_0x5ab8b5[_0xb86b('0x11')][_0xb86b('0x12')]===0x1f4){logger[_0xb86b('0x11')](_0xb86b('0xc'),_0x3be905,_0x5ab8b5[_0xb86b('0x11')]['message']);return _0x5f398a(_0x5ab8b5[_0xb86b('0x11')][_0xb86b('0x13')]);}logger[_0xb86b('0x11')](_0xb86b('0xc'),_0x3be905,_0x5ab8b5[_0xb86b('0x11')][_0xb86b('0x13')]);return _0x32a8a0(_0x5ab8b5[_0xb86b('0x11')]['message']);}else{logger['info'](_0xb86b('0xc'),_0x3be905,_0xb86b('0xd'));_0x32a8a0(_0x5ab8b5[_0xb86b('0x14')]['message']);}})[_0xb86b('0x15')](function(_0x54fc8c){logger[_0xb86b('0x11')](_0xb86b('0xc'),_0x3be905,_0x54fc8c);_0x5f398a(_0x54fc8c);});});}exports[_0xb86b('0x16')]=function(_0x16abc9){var _0x33163d=this;return new Promise(function(_0xf9cab6,_0x3d158a){return db[_0xb86b('0x17')][_0xb86b('0x18')](_0x16abc9[_0xb86b('0x19')],{'raw':_0x16abc9[_0xb86b('0x1a')]?_0x16abc9[_0xb86b('0x1a')][_0xb86b('0x1b')]===undefined?!![]:![]:!![]})[_0xb86b('0xa')](function(_0x1d3a95){logger[_0xb86b('0xb')](_0xb86b('0x16'),_0x16abc9);logger[_0xb86b('0xe')](_0xb86b('0x16'),_0x16abc9,JSON[_0xb86b('0x10')](_0x1d3a95));_0xf9cab6(_0x1d3a95);})[_0xb86b('0x15')](function(_0x128414){logger[_0xb86b('0x11')](_0xb86b('0x16'),_0x128414[_0xb86b('0x13')],_0x16abc9);_0x3d158a(_0x33163d['error'](0x1f4,_0x128414[_0xb86b('0x13')]));});});};exports[_0xb86b('0x1c')]=function(_0x4e66d4){var _0xdeb0dc=this;return new Promise(function(_0x3f5ce4,_0x2cab87){return db[_0xb86b('0x17')][_0xb86b('0x1d')](_0x4e66d4[_0xb86b('0x19')],{'raw':_0x4e66d4[_0xb86b('0x1a')]?_0x4e66d4['options'][_0xb86b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e66d4['options']?_0x4e66d4['options'][_0xb86b('0x1e')]||null:null,'attributes':_0x4e66d4[_0xb86b('0x1a')]?_0x4e66d4[_0xb86b('0x1a')][_0xb86b('0x1f')]||null:null,'limit':_0x4e66d4[_0xb86b('0x1a')]?_0x4e66d4[_0xb86b('0x1a')][_0xb86b('0x20')]||null:null})[_0xb86b('0xa')](function(_0x30e685){logger[_0xb86b('0xb')](_0xb86b('0x1c'),_0x4e66d4);logger['debug'](_0xb86b('0x1c'),_0x4e66d4,JSON[_0xb86b('0x10')](_0x30e685));_0x3f5ce4(_0x30e685);})[_0xb86b('0x15')](function(_0x32eb4d){logger[_0xb86b('0x11')](_0xb86b('0x1c'),_0x32eb4d[_0xb86b('0x13')],_0x4e66d4);_0x2cab87(_0xdeb0dc[_0xb86b('0x11')](0x1f4,_0x32eb4d['message']));});});}; \ No newline at end of file +var _0x5b9e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','catch','where','UpdateChatQueueReport','lodash','util','moment'];(function(_0x26c8d6,_0x480d94){var _0x590fbd=function(_0x503b87){while(--_0x503b87){_0x26c8d6['push'](_0x26c8d6['shift']());}};_0x590fbd(++_0x480d94);}(_0x5b9e,0xe4));var _0xe5b9=function(_0x46b449,_0x37b7fa){_0x46b449=_0x46b449-0x0;var _0x486d66=_0x5b9e[_0x46b449];return _0x486d66;};'use strict';var _=require(_0xe5b9('0x0'));var util=require(_0xe5b9('0x1'));var moment=require(_0xe5b9('0x2'));var BPromise=require(_0xe5b9('0x3'));var rs=require(_0xe5b9('0x4'));var fs=require('fs');var Redis=require(_0xe5b9('0x5'));var db=require(_0xe5b9('0x6'))['db'];var utils=require(_0xe5b9('0x7'));var logger=require(_0xe5b9('0x8'))('rpc');var config=require(_0xe5b9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe5b9('0xa')][_0xe5b9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x464d91,_0x1a5498,_0x139c45){return new BPromise(function(_0x3f3b90,_0x2167c7){return client[_0xe5b9('0xc')](_0x464d91,_0x139c45)[_0xe5b9('0xd')](function(_0x10c91a){logger['info'](_0xe5b9('0xe'),_0x1a5498,_0xe5b9('0xf'));logger['debug'](_0xe5b9('0x10'),_0x1a5498,_0xe5b9('0xf'),JSON[_0xe5b9('0x11')](_0x10c91a));if(_0x10c91a[_0xe5b9('0x12')]){if(_0x10c91a[_0xe5b9('0x12')][_0xe5b9('0x13')]===0x1f4){logger['error'](_0xe5b9('0xe'),_0x1a5498,_0x10c91a['error'][_0xe5b9('0x14')]);return _0x2167c7(_0x10c91a[_0xe5b9('0x12')][_0xe5b9('0x14')]);}logger[_0xe5b9('0x12')](_0xe5b9('0xe'),_0x1a5498,_0x10c91a[_0xe5b9('0x12')][_0xe5b9('0x14')]);return _0x3f3b90(_0x10c91a[_0xe5b9('0x12')][_0xe5b9('0x14')]);}else{logger[_0xe5b9('0x15')](_0xe5b9('0xe'),_0x1a5498,_0xe5b9('0xf'));_0x3f3b90(_0x10c91a[_0xe5b9('0x16')][_0xe5b9('0x14')]);}})['catch'](function(_0x2f1239){logger[_0xe5b9('0x12')](_0xe5b9('0xe'),_0x1a5498,_0x2f1239);_0x2167c7(_0x2f1239);});});}exports[_0xe5b9('0x17')]=function(_0x421407){var _0x4ad623=this;return new Promise(function(_0x5477b8,_0x27eea6){return db[_0xe5b9('0x18')][_0xe5b9('0x19')](_0x421407[_0xe5b9('0x1a')],{'raw':_0x421407[_0xe5b9('0x1b')]?_0x421407[_0xe5b9('0x1b')][_0xe5b9('0x1c')]===undefined?!![]:![]:!![]})[_0xe5b9('0xd')](function(_0x10c9d1){logger[_0xe5b9('0x15')](_0xe5b9('0x17'),_0x421407);logger[_0xe5b9('0x1d')](_0xe5b9('0x17'),_0x421407,JSON[_0xe5b9('0x11')](_0x10c9d1));_0x5477b8(_0x10c9d1);})[_0xe5b9('0x1e')](function(_0x4760ce){logger[_0xe5b9('0x12')]('CreateChatQueueReport',_0x4760ce[_0xe5b9('0x14')],_0x421407);_0x27eea6(_0x4ad623[_0xe5b9('0x12')](0x1f4,_0x4760ce[_0xe5b9('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x3b628e){var _0x2cf33b=this;return new Promise(function(_0x46583b,_0x5bd531){return db[_0xe5b9('0x18')]['update'](_0x3b628e['body'],{'raw':_0x3b628e[_0xe5b9('0x1b')]?_0x3b628e[_0xe5b9('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b628e['options']?_0x3b628e[_0xe5b9('0x1b')][_0xe5b9('0x1f')]||null:null,'attributes':_0x3b628e[_0xe5b9('0x1b')]?_0x3b628e[_0xe5b9('0x1b')]['attributes']||null:null,'limit':_0x3b628e[_0xe5b9('0x1b')]?_0x3b628e[_0xe5b9('0x1b')]['limit']||null:null})[_0xe5b9('0xd')](function(_0x5bb79e){logger[_0xe5b9('0x15')](_0xe5b9('0x20'),_0x3b628e);logger[_0xe5b9('0x1d')](_0xe5b9('0x20'),_0x3b628e,JSON[_0xe5b9('0x11')](_0x5bb79e));_0x46583b(_0x5bb79e);})[_0xe5b9('0x1e')](function(_0x1bc4c6){logger[_0xe5b9('0x12')](_0xe5b9('0x20'),_0x1bc4c6[_0xe5b9('0x14')],_0x3b628e);_0x5bd531(_0x2cf33b[_0xe5b9('0x12')](0x1f4,_0x1bc4c6[_0xe5b9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 4e1bfc8..3ae6358 100644 --- a/server/api/chatQueueReport/index.js +++ b/server/api/chatQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d60=['create','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x5d60,0x1ba));var _0x05d6=function(_0x169a65,_0x2c8a7a){_0x169a65=_0x169a65-0x0;var _0xde27c9=_0x5d60[_0x169a65];return _0xde27c9;};'use strict';var multer=require('multer');var util=require(_0x05d6('0x0'));var path=require('path');var timeout=require(_0x05d6('0x1'));var express=require('express');var router=express[_0x05d6('0x2')]();var fs_extra=require(_0x05d6('0x3'));var auth=require(_0x05d6('0x4'));var interaction=require(_0x05d6('0x5'));var config=require('../../config/environment');var controller=require(_0x05d6('0x6'));router[_0x05d6('0x7')]('/',auth[_0x05d6('0x8')](),controller['index']);router['get'](_0x05d6('0x9'),auth['isAuthenticated'](),controller[_0x05d6('0xa')]);router[_0x05d6('0x7')](_0x05d6('0xb'),auth[_0x05d6('0x8')](),controller[_0x05d6('0xc')]);router[_0x05d6('0xd')]('/',auth[_0x05d6('0x8')](),controller[_0x05d6('0xe')]);router['put']('/:id',auth[_0x05d6('0x8')](),controller[_0x05d6('0xf')]);router[_0x05d6('0x10')](_0x05d6('0xb'),auth['isAuthenticated'](),controller[_0x05d6('0x11')]);module[_0x05d6('0x12')]=router; \ No newline at end of file +var _0x503a=['post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x2f92e7,_0x572d0b){var _0x554de2=function(_0x1f33c4){while(--_0x1f33c4){_0x2f92e7['push'](_0x2f92e7['shift']());}};_0x554de2(++_0x572d0b);}(_0x503a,0xd6));var _0xa503=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x503a[_0x44b3bd];return _0x1efc4a;};'use strict';var multer=require(_0xa503('0x0'));var util=require(_0xa503('0x1'));var path=require(_0xa503('0x2'));var timeout=require(_0xa503('0x3'));var express=require(_0xa503('0x4'));var router=express[_0xa503('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa503('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa503('0x7'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0xa503('0x8')](),controller[_0xa503('0x9')]);router['get'](_0xa503('0xa'),auth[_0xa503('0x8')](),controller[_0xa503('0xb')]);router['get'](_0xa503('0xc'),auth[_0xa503('0x8')](),controller[_0xa503('0xd')]);router[_0xa503('0xe')]('/',auth[_0xa503('0x8')](),controller[_0xa503('0xf')]);router[_0xa503('0x10')](_0xa503('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xa503('0xc'),auth[_0xa503('0x8')](),controller[_0xa503('0x11')]);module[_0xa503('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 9abbd83..64f0d7b 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5850e0,_0x2c3e9a){var _0x3d0697=function(_0xfef92){while(--_0xfef92){_0x5850e0['push'](_0x5850e0['shift']());}};_0x3d0697(++_0x2c3e9a);}(_0x008c,0x188));var _0xc008=function(_0x4631eb,_0x55649e){_0x4631eb=_0x4631eb-0x0;var _0x562eca=_0x008c[_0x4631eb];return _0x562eca;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x20b1ca,_0xcaa99b){var _0x13a457=function(_0x49b381){while(--_0x49b381){_0x20b1ca['push'](_0x20b1ca['shift']());}};_0x13a457(++_0xcaa99b);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 2e3e0c4..bc378fe 100644 --- a/server/api/chatTransferReport/chatTransferReport.controller.js +++ b/server/api/chatTransferReport/chatTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ff8=['order','sort','where','filters','pick','merge','type','filter','options','ChatTransferReport','rows','catch','show','fields','length','includeAll','include','create','body','find','params','describe','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','hasOwnProperty','nolimit'];(function(_0x46e3ff,_0x50ca39){var _0x4bf847=function(_0x3fa9b9){while(--_0x3fa9b9){_0x46e3ff['push'](_0x46e3ff['shift']());}};_0x4bf847(++_0x50ca39);}(_0x2ff8,0xa4));var _0x82ff=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x2ff8[_0xa6cc5c];return _0x44803d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82ff('0x0'));var zipdir=require(_0x82ff('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x82ff('0x2'));var moment=require(_0x82ff('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x82ff('0x4'));var sox=require(_0x82ff('0x5'));var csv=require(_0x82ff('0x6'));var ejs=require(_0x82ff('0x7'));var fs=require('fs');var fs_extra=require(_0x82ff('0x8'));var _=require(_0x82ff('0x9'));var squel=require(_0x82ff('0xa'));var crypto=require('crypto');var jsforce=require(_0x82ff('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x82ff('0x6'));var querystring=require(_0x82ff('0xc'));var Papa=require(_0x82ff('0xd'));var Redis=require(_0x82ff('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x82ff('0xf'));var hardwareService=require(_0x82ff('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x82ff('0x11'));var config=require(_0x82ff('0x12'));var licenseUtil=require(_0x82ff('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x228b0e,_0x2ced18){_0x2ced18=_0x2ced18||0xcc;return function(_0x1d15e9){if(_0x1d15e9){return _0x228b0e[_0x82ff('0x14')](_0x2ced18);}return _0x228b0e[_0x82ff('0x15')](_0x2ced18)[_0x82ff('0x16')]();};}function respondWithResult(_0x23c524,_0x5446bb){_0x5446bb=_0x5446bb||0xc8;return function(_0xc3411a){if(_0xc3411a){return _0x23c524[_0x82ff('0x15')](_0x5446bb)[_0x82ff('0x17')](_0xc3411a);}};}function respondWithFilteredResult(_0x1fb8df,_0x253d48){return function(_0xc6b0db){if(_0xc6b0db){var _0x4a1e57=typeof _0x253d48['offset']===_0x82ff('0x18')&&typeof _0x253d48[_0x82ff('0x19')]===_0x82ff('0x18');var _0x9bb9c=_0xc6b0db[_0x82ff('0x1a')];var _0x42eb82=_0x4a1e57?0x0:_0x253d48[_0x82ff('0x1b')];var _0x3c19f5=_0x4a1e57?_0xc6b0db['count']:_0x253d48[_0x82ff('0x1b')]+_0x253d48[_0x82ff('0x19')];var _0x36d2e1;if(_0x3c19f5>=_0x9bb9c){_0x3c19f5=_0x9bb9c;_0x36d2e1=0xc8;}else{_0x36d2e1=0xce;}_0x1fb8df['status'](_0x36d2e1);return _0x1fb8df['set']('Content-Range',_0x42eb82+'-'+_0x3c19f5+'/'+_0x9bb9c)[_0x82ff('0x17')](_0xc6b0db);}return null;};}function patchUpdates(_0x10fb2a){return function(_0x5e52f6){try{jsonpatch['apply'](_0x5e52f6,_0x10fb2a,!![]);}catch(_0x3d0550){return BPromise[_0x82ff('0x1c')](_0x3d0550);}return _0x5e52f6[_0x82ff('0x1d')]();};}function saveUpdates(_0x2af402,_0xc3e3a8){return function(_0x3c3388){if(_0x3c3388){return _0x3c3388[_0x82ff('0x1e')](_0x2af402)[_0x82ff('0x1f')](function(_0x54c9eb){return _0x54c9eb;});}return null;};}function removeEntity(_0x1fa70c,_0x332991){return function(_0x26fb94){if(_0x26fb94){return _0x26fb94[_0x82ff('0x20')]()[_0x82ff('0x1f')](function(){_0x1fa70c['status'](0xcc)[_0x82ff('0x16')]();});}};}function handleEntityNotFound(_0x556610,_0x8487f0){return function(_0x48cfb9){if(!_0x48cfb9){_0x556610[_0x82ff('0x14')](0x194);}return _0x48cfb9;};}function handleError(_0x450490,_0x5d7241){_0x5d7241=_0x5d7241||0x1f4;return function(_0x76cb1f){logger[_0x82ff('0x21')](_0x76cb1f[_0x82ff('0x22')]);if(_0x76cb1f[_0x82ff('0x23')]){delete _0x76cb1f[_0x82ff('0x23')];}_0x450490[_0x82ff('0x15')](_0x5d7241)[_0x82ff('0x24')](_0x76cb1f);};}exports[_0x82ff('0x25')]=function(_0x9bb8ed,_0x2f459f){var _0x4c38cb={},_0x291ed2={},_0x5c3875={'count':0x0,'rows':[]};var _0x3b28a7=_[_0x82ff('0x26')](db['ChatTransferReport'][_0x82ff('0x27')],function(_0x269abe){return{'name':_0x269abe[_0x82ff('0x28')],'type':_0x269abe['type'][_0x82ff('0x29')]};});_0x291ed2['model']=_['map'](_0x3b28a7,_0x82ff('0x23'));_0x291ed2['query']=_[_0x82ff('0x2a')](_0x9bb8ed[_0x82ff('0x2b')]);_0x291ed2['filters']=_[_0x82ff('0x2c')](_0x291ed2[_0x82ff('0x2d')],_0x291ed2['query']);_0x4c38cb[_0x82ff('0x2e')]=_[_0x82ff('0x2c')](_0x291ed2[_0x82ff('0x2d')],qs['fields'](_0x9bb8ed[_0x82ff('0x2b')]['fields']));_0x4c38cb[_0x82ff('0x2e')]=_0x4c38cb[_0x82ff('0x2e')]['length']?_0x4c38cb[_0x82ff('0x2e')]:_0x291ed2[_0x82ff('0x2d')];if(!_0x9bb8ed[_0x82ff('0x2b')][_0x82ff('0x2f')](_0x82ff('0x30'))){_0x4c38cb[_0x82ff('0x19')]=qs[_0x82ff('0x19')](_0x9bb8ed[_0x82ff('0x2b')][_0x82ff('0x19')]);_0x4c38cb[_0x82ff('0x1b')]=qs[_0x82ff('0x1b')](_0x9bb8ed[_0x82ff('0x2b')]['offset']);}_0x4c38cb[_0x82ff('0x31')]=qs[_0x82ff('0x32')](_0x9bb8ed[_0x82ff('0x2b')][_0x82ff('0x32')]);_0x4c38cb[_0x82ff('0x33')]=qs[_0x82ff('0x34')](_[_0x82ff('0x35')](_0x9bb8ed['query'],_0x291ed2[_0x82ff('0x34')]),_0x3b28a7);if(_0x9bb8ed[_0x82ff('0x2b')]['filter']){_0x4c38cb[_0x82ff('0x33')]=_[_0x82ff('0x36')](_0x4c38cb[_0x82ff('0x33')],{'$or':_['map'](_0x3b28a7,function(_0xe721d9){if(_0xe721d9[_0x82ff('0x37')]!=='VIRTUAL'){var _0x3cf9d1={};_0x3cf9d1[_0xe721d9[_0x82ff('0x23')]]={'$like':'%'+_0x9bb8ed[_0x82ff('0x2b')][_0x82ff('0x38')]+'%'};return _0x3cf9d1;}})});}_0x4c38cb=_[_0x82ff('0x36')]({},_0x4c38cb,_0x9bb8ed[_0x82ff('0x39')]);var _0x52b9b9={'where':_0x4c38cb[_0x82ff('0x33')]};return db[_0x82ff('0x3a')][_0x82ff('0x1a')](_0x52b9b9)[_0x82ff('0x1f')](function(_0x3f5082){_0x5c3875[_0x82ff('0x1a')]=_0x3f5082;if(_0x9bb8ed[_0x82ff('0x2b')]['includeAll']){_0x4c38cb['include']=[{'all':!![]}];}return db[_0x82ff('0x3a')]['findAll'](_0x4c38cb);})[_0x82ff('0x1f')](function(_0xfd799f){_0x5c3875[_0x82ff('0x3b')]=_0xfd799f;return _0x5c3875;})[_0x82ff('0x1f')](respondWithFilteredResult(_0x2f459f,_0x4c38cb))[_0x82ff('0x3c')](handleError(_0x2f459f,null));};exports[_0x82ff('0x3d')]=function(_0x409792,_0x199eeb){var _0x5d8cfa={'raw':!![],'where':{'id':_0x409792['params']['id']}},_0x397c5a={};_0x397c5a[_0x82ff('0x2d')]=_[_0x82ff('0x2a')](db[_0x82ff('0x3a')][_0x82ff('0x27')]);_0x397c5a[_0x82ff('0x2b')]=_[_0x82ff('0x2a')](_0x409792['query']);_0x397c5a[_0x82ff('0x34')]=_['intersection'](_0x397c5a[_0x82ff('0x2d')],_0x397c5a['query']);_0x5d8cfa[_0x82ff('0x2e')]=_[_0x82ff('0x2c')](_0x397c5a['model'],qs[_0x82ff('0x3e')](_0x409792[_0x82ff('0x2b')]['fields']));_0x5d8cfa[_0x82ff('0x2e')]=_0x5d8cfa[_0x82ff('0x2e')][_0x82ff('0x3f')]?_0x5d8cfa[_0x82ff('0x2e')]:_0x397c5a[_0x82ff('0x2d')];if(_0x409792[_0x82ff('0x2b')][_0x82ff('0x40')]){_0x5d8cfa[_0x82ff('0x41')]=[{'all':!![]}];}_0x5d8cfa=_[_0x82ff('0x36')]({},_0x5d8cfa,_0x409792[_0x82ff('0x39')]);return db[_0x82ff('0x3a')]['find'](_0x5d8cfa)['then'](handleEntityNotFound(_0x199eeb,null))[_0x82ff('0x1f')](respondWithResult(_0x199eeb,null))[_0x82ff('0x3c')](handleError(_0x199eeb,null));};exports[_0x82ff('0x42')]=function(_0x56a47f,_0x260d95){return db[_0x82ff('0x3a')]['create'](_0x56a47f['body'],{})[_0x82ff('0x1f')](respondWithResult(_0x260d95,0xc9))[_0x82ff('0x3c')](handleError(_0x260d95,null));};exports[_0x82ff('0x1e')]=function(_0xe4f8ed,_0x5c6292){if(_0xe4f8ed[_0x82ff('0x43')]['id']){delete _0xe4f8ed[_0x82ff('0x43')]['id'];}return db[_0x82ff('0x3a')][_0x82ff('0x44')]({'where':{'id':_0xe4f8ed[_0x82ff('0x45')]['id']}})[_0x82ff('0x1f')](handleEntityNotFound(_0x5c6292,null))[_0x82ff('0x1f')](saveUpdates(_0xe4f8ed[_0x82ff('0x43')],null))['then'](respondWithResult(_0x5c6292,null))[_0x82ff('0x3c')](handleError(_0x5c6292,null));};exports[_0x82ff('0x20')]=function(_0x4acb08,_0x455863){return db['ChatTransferReport'][_0x82ff('0x44')]({'where':{'id':_0x4acb08['params']['id']}})[_0x82ff('0x1f')](handleEntityNotFound(_0x455863,null))[_0x82ff('0x1f')](removeEntity(_0x455863,null))[_0x82ff('0x3c')](handleError(_0x455863,null));};exports['describe']=function(_0x240280,_0x411975){return db[_0x82ff('0x3a')][_0x82ff('0x46')]()[_0x82ff('0x1f')](respondWithResult(_0x411975,null))[_0x82ff('0x3c')](handleError(_0x411975,null));}; \ No newline at end of file +var _0x7af3=['status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x557b44,_0x12aba8){var _0x311a77=function(_0x329c2d){while(--_0x329c2d){_0x557b44['push'](_0x557b44['shift']());}};_0x311a77(++_0x12aba8);}(_0x7af3,0x1c0));var _0x37af=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x7af3[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x37af('0x0'));var zipdir=require(_0x37af('0x1'));var jsonpatch=require(_0x37af('0x2'));var rp=require('request-promise');var moment=require(_0x37af('0x3'));var BPromise=require(_0x37af('0x4'));var Mustache=require(_0x37af('0x5'));var util=require(_0x37af('0x6'));var path=require(_0x37af('0x7'));var sox=require('sox');var csv=require(_0x37af('0x8'));var ejs=require(_0x37af('0x9'));var fs=require('fs');var fs_extra=require(_0x37af('0xa'));var _=require('lodash');var squel=require(_0x37af('0xb'));var crypto=require(_0x37af('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x37af('0xd'));var toCsv=require(_0x37af('0x8'));var querystring=require('querystring');var Papa=require(_0x37af('0xe'));var Redis=require('ioredis');var authService=require(_0x37af('0xf'));var qs=require(_0x37af('0x10'));var as=require(_0x37af('0x11'));var hardwareService=require(_0x37af('0x12'));var logger=require(_0x37af('0x13'))(_0x37af('0x14'));var utils=require(_0x37af('0x15'));var config=require(_0x37af('0x16'));var licenseUtil=require(_0x37af('0x17'));var db=require(_0x37af('0x18'))['db'];function respondWithStatusCode(_0x53f45c,_0x2b6f3c){_0x2b6f3c=_0x2b6f3c||0xcc;return function(_0x3f3e87){if(_0x3f3e87){return _0x53f45c[_0x37af('0x19')](_0x2b6f3c);}return _0x53f45c[_0x37af('0x1a')](_0x2b6f3c)['end']();};}function respondWithResult(_0x551323,_0x4894d4){_0x4894d4=_0x4894d4||0xc8;return function(_0x338ca9){if(_0x338ca9){return _0x551323[_0x37af('0x1a')](_0x4894d4)[_0x37af('0x1b')](_0x338ca9);}};}function respondWithFilteredResult(_0x13bd26,_0x387c68){return function(_0x1c195d){if(_0x1c195d){var _0x2523f0=typeof _0x387c68[_0x37af('0x1c')]==='undefined'&&typeof _0x387c68['limit']===_0x37af('0x1d');var _0x988316=_0x1c195d[_0x37af('0x1e')];var _0x3ec1d0=_0x2523f0?0x0:_0x387c68['offset'];var _0x54573f=_0x2523f0?_0x1c195d[_0x37af('0x1e')]:_0x387c68[_0x37af('0x1c')]+_0x387c68[_0x37af('0x1f')];var _0x4b4a45;if(_0x54573f>=_0x988316){_0x54573f=_0x988316;_0x4b4a45=0xc8;}else{_0x4b4a45=0xce;}_0x13bd26['status'](_0x4b4a45);return _0x13bd26[_0x37af('0x20')](_0x37af('0x21'),_0x3ec1d0+'-'+_0x54573f+'/'+_0x988316)[_0x37af('0x1b')](_0x1c195d);}return null;};}function patchUpdates(_0x54e430){return function(_0xdf9df6){try{jsonpatch[_0x37af('0x22')](_0xdf9df6,_0x54e430,!![]);}catch(_0x3c9d4c){return BPromise[_0x37af('0x23')](_0x3c9d4c);}return _0xdf9df6[_0x37af('0x24')]();};}function saveUpdates(_0x2548c0,_0x42a952){return function(_0x4b1517){if(_0x4b1517){return _0x4b1517[_0x37af('0x25')](_0x2548c0)[_0x37af('0x26')](function(_0x1bdb64){return _0x1bdb64;});}return null;};}function removeEntity(_0x40c1b0,_0x492a9e){return function(_0x111419){if(_0x111419){return _0x111419['destroy']()['then'](function(){_0x40c1b0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x116e8a,_0x1cf5bf){return function(_0x4b4aa6){if(!_0x4b4aa6){_0x116e8a[_0x37af('0x19')](0x194);}return _0x4b4aa6;};}function handleError(_0x2f5dcb,_0x4b69e4){_0x4b69e4=_0x4b69e4||0x1f4;return function(_0x4a9c36){logger['error'](_0x4a9c36[_0x37af('0x27')]);if(_0x4a9c36[_0x37af('0x28')]){delete _0x4a9c36['name'];}_0x2f5dcb['status'](_0x4b69e4)[_0x37af('0x29')](_0x4a9c36);};}exports[_0x37af('0x2a')]=function(_0x5a3529,_0x498d96){var _0xa3fa70={},_0x495ac2={},_0x48fbab={'count':0x0,'rows':[]};var _0x414eca=_['map'](db[_0x37af('0x2b')][_0x37af('0x2c')],function(_0x3884ef){return{'name':_0x3884ef[_0x37af('0x2d')],'type':_0x3884ef[_0x37af('0x2e')][_0x37af('0x2f')]};});_0x495ac2[_0x37af('0x30')]=_[_0x37af('0x31')](_0x414eca,_0x37af('0x28'));_0x495ac2[_0x37af('0x32')]=_[_0x37af('0x33')](_0x5a3529[_0x37af('0x32')]);_0x495ac2[_0x37af('0x34')]=_[_0x37af('0x35')](_0x495ac2[_0x37af('0x30')],_0x495ac2[_0x37af('0x32')]);_0xa3fa70['attributes']=_[_0x37af('0x35')](_0x495ac2[_0x37af('0x30')],qs[_0x37af('0x36')](_0x5a3529[_0x37af('0x32')][_0x37af('0x36')]));_0xa3fa70['attributes']=_0xa3fa70[_0x37af('0x37')]['length']?_0xa3fa70[_0x37af('0x37')]:_0x495ac2[_0x37af('0x30')];if(!_0x5a3529[_0x37af('0x32')][_0x37af('0x38')](_0x37af('0x39'))){_0xa3fa70[_0x37af('0x1f')]=qs[_0x37af('0x1f')](_0x5a3529[_0x37af('0x32')][_0x37af('0x1f')]);_0xa3fa70[_0x37af('0x1c')]=qs[_0x37af('0x1c')](_0x5a3529[_0x37af('0x32')]['offset']);}_0xa3fa70[_0x37af('0x3a')]=qs[_0x37af('0x3b')](_0x5a3529[_0x37af('0x32')][_0x37af('0x3b')]);_0xa3fa70[_0x37af('0x3c')]=qs[_0x37af('0x34')](_[_0x37af('0x3d')](_0x5a3529[_0x37af('0x32')],_0x495ac2['filters']),_0x414eca);if(_0x5a3529[_0x37af('0x32')][_0x37af('0x3e')]){_0xa3fa70[_0x37af('0x3c')]=_[_0x37af('0x3f')](_0xa3fa70['where'],{'$or':_[_0x37af('0x31')](_0x414eca,function(_0x5f019c){if(_0x5f019c['type']!==_0x37af('0x40')){var _0xf88016={};_0xf88016[_0x5f019c[_0x37af('0x28')]]={'$like':'%'+_0x5a3529[_0x37af('0x32')][_0x37af('0x3e')]+'%'};return _0xf88016;}})});}_0xa3fa70=_[_0x37af('0x3f')]({},_0xa3fa70,_0x5a3529[_0x37af('0x41')]);var _0x44180d={'where':_0xa3fa70[_0x37af('0x3c')]};return db[_0x37af('0x2b')][_0x37af('0x1e')](_0x44180d)['then'](function(_0x112c6b){_0x48fbab[_0x37af('0x1e')]=_0x112c6b;if(_0x5a3529['query'][_0x37af('0x42')]){_0xa3fa70[_0x37af('0x43')]=[{'all':!![]}];}return db[_0x37af('0x2b')][_0x37af('0x44')](_0xa3fa70);})[_0x37af('0x26')](function(_0x3b3ad7){_0x48fbab[_0x37af('0x45')]=_0x3b3ad7;return _0x48fbab;})['then'](respondWithFilteredResult(_0x498d96,_0xa3fa70))[_0x37af('0x46')](handleError(_0x498d96,null));};exports[_0x37af('0x47')]=function(_0x564ddc,_0x4d051d){var _0x507dba={'raw':!![],'where':{'id':_0x564ddc[_0x37af('0x48')]['id']}},_0x35caea={};_0x35caea[_0x37af('0x30')]=_['keys'](db[_0x37af('0x2b')][_0x37af('0x2c')]);_0x35caea[_0x37af('0x32')]=_[_0x37af('0x33')](_0x564ddc[_0x37af('0x32')]);_0x35caea[_0x37af('0x34')]=_['intersection'](_0x35caea[_0x37af('0x30')],_0x35caea['query']);_0x507dba['attributes']=_[_0x37af('0x35')](_0x35caea[_0x37af('0x30')],qs[_0x37af('0x36')](_0x564ddc[_0x37af('0x32')]['fields']));_0x507dba[_0x37af('0x37')]=_0x507dba[_0x37af('0x37')][_0x37af('0x49')]?_0x507dba[_0x37af('0x37')]:_0x35caea[_0x37af('0x30')];if(_0x564ddc[_0x37af('0x32')]['includeAll']){_0x507dba[_0x37af('0x43')]=[{'all':!![]}];}_0x507dba=_['merge']({},_0x507dba,_0x564ddc[_0x37af('0x41')]);return db[_0x37af('0x2b')]['find'](_0x507dba)[_0x37af('0x26')](handleEntityNotFound(_0x4d051d,null))['then'](respondWithResult(_0x4d051d,null))[_0x37af('0x46')](handleError(_0x4d051d,null));};exports[_0x37af('0x4a')]=function(_0x229107,_0x55d359){return db[_0x37af('0x2b')]['create'](_0x229107[_0x37af('0x4b')],{})[_0x37af('0x26')](respondWithResult(_0x55d359,0xc9))[_0x37af('0x46')](handleError(_0x55d359,null));};exports[_0x37af('0x25')]=function(_0x45306e,_0x5a913f){if(_0x45306e[_0x37af('0x4b')]['id']){delete _0x45306e[_0x37af('0x4b')]['id'];}return db['ChatTransferReport'][_0x37af('0x4c')]({'where':{'id':_0x45306e[_0x37af('0x48')]['id']}})[_0x37af('0x26')](handleEntityNotFound(_0x5a913f,null))[_0x37af('0x26')](saveUpdates(_0x45306e[_0x37af('0x4b')],null))[_0x37af('0x26')](respondWithResult(_0x5a913f,null))[_0x37af('0x46')](handleError(_0x5a913f,null));};exports[_0x37af('0x4d')]=function(_0x5df5ef,_0x85c0e){return db['ChatTransferReport'][_0x37af('0x4c')]({'where':{'id':_0x5df5ef[_0x37af('0x48')]['id']}})['then'](handleEntityNotFound(_0x85c0e,null))[_0x37af('0x26')](removeEntity(_0x85c0e,null))[_0x37af('0x46')](handleError(_0x85c0e,null));};exports[_0x37af('0x4e')]=function(_0x768acc,_0x3de6b2){return db[_0x37af('0x2b')][_0x37af('0x4e')]()[_0x37af('0x26')](respondWithResult(_0x3de6b2,null))[_0x37af('0x46')](handleError(_0x3de6b2,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 4a98b4f..a7d98c0 100644 --- a/server/api/chatTransferReport/chatTransferReport.model.js +++ b/server/api/chatTransferReport/chatTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x173f=['request-promise','path','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','uniqueid','lodash','util','api','moment','bluebird'];(function(_0xbbf92e,_0x4d5070){var _0x50bf0d=function(_0x3438df){while(--_0x3438df){_0xbbf92e['push'](_0xbbf92e['shift']());}};_0x50bf0d(++_0x4d5070);}(_0x173f,0x133));var _0xf173=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x173f[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xf173('0x0'));var util=require(_0xf173('0x1'));var logger=require('../../config/logger')(_0xf173('0x2'));var moment=require(_0xf173('0x3'));var BPromise=require(_0xf173('0x4'));var rp=require(_0xf173('0x5'));var fs=require('fs');var path=require(_0xf173('0x6'));var rimraf=require('rimraf');var config=require(_0xf173('0x7'));var attributes=require(_0xf173('0x8'));module['exports']=function(_0x45bbec,_0x4756e6){return _0x45bbec[_0xf173('0x9')](_0xf173('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf173('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9639=['request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x154b2d,_0x56251f){var _0x334119=function(_0x5919cf){while(--_0x5919cf){_0x154b2d['push'](_0x154b2d['shift']());}};_0x334119(++_0x56251f);}(_0x9639,0x1e9));var _0x9963=function(_0x350119,_0x3db5eb){_0x350119=_0x350119-0x0;var _0x297b6e=_0x9639[_0x350119];return _0x297b6e;};'use strict';var _=require(_0x9963('0x0'));var util=require(_0x9963('0x1'));var logger=require(_0x9963('0x2'))(_0x9963('0x3'));var moment=require(_0x9963('0x4'));var BPromise=require(_0x9963('0x5'));var rp=require(_0x9963('0x6'));var fs=require('fs');var path=require(_0x9963('0x7'));var rimraf=require(_0x9963('0x8'));var config=require(_0x9963('0x9'));var attributes=require(_0x9963('0xa'));module[_0x9963('0xb')]=function(_0x2cd21f,_0x4c7d88){return _0x2cd21f[_0x9963('0xc')](_0x9963('0xd'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9963('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 11b6e73..d4b953c 100644 --- a/server/api/chatTransferReport/chatTransferReport.rpc.js +++ b/server/api/chatTransferReport/chatTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2cea=['ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x2cea,0xa9));var _0xa2ce=function(_0x40e854,_0x42f1f6){_0x40e854=_0x40e854-0x0;var _0x1463b3=_0x2cea[_0x40e854];return _0x1463b3;};'use strict';var _=require('lodash');var util=require(_0xa2ce('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa2ce('0x1'));var fs=require('fs');var Redis=require(_0xa2ce('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa2ce('0x3'));var logger=require(_0xa2ce('0x4'))('rpc');var config=require(_0xa2ce('0x5'));var jayson=require(_0xa2ce('0x6'));var client=jayson[_0xa2ce('0x7')][_0xa2ce('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x176ab6,_0xf418f3,_0x443170){return new BPromise(function(_0x2dcaa1,_0x310cab){return client[_0xa2ce('0x9')](_0x176ab6,_0x443170)[_0xa2ce('0xa')](function(_0x12ba50){logger['info'](_0xa2ce('0xb'),_0xf418f3,'request\x20sent');logger['debug'](_0xa2ce('0xc'),_0xf418f3,_0xa2ce('0xd'),JSON[_0xa2ce('0xe')](_0x12ba50));if(_0x12ba50[_0xa2ce('0xf')]){if(_0x12ba50[_0xa2ce('0xf')][_0xa2ce('0x10')]===0x1f4){logger[_0xa2ce('0xf')](_0xa2ce('0xb'),_0xf418f3,_0x12ba50[_0xa2ce('0xf')]['message']);return _0x310cab(_0x12ba50[_0xa2ce('0xf')][_0xa2ce('0x11')]);}logger[_0xa2ce('0xf')](_0xa2ce('0xb'),_0xf418f3,_0x12ba50['error'][_0xa2ce('0x11')]);return _0x2dcaa1(_0x12ba50['error'][_0xa2ce('0x11')]);}else{logger[_0xa2ce('0x12')](_0xa2ce('0xb'),_0xf418f3,_0xa2ce('0xd'));_0x2dcaa1(_0x12ba50[_0xa2ce('0x13')][_0xa2ce('0x11')]);}})['catch'](function(_0xbc043a){logger[_0xa2ce('0xf')](_0xa2ce('0xb'),_0xf418f3,_0xbc043a);_0x310cab(_0xbc043a);});});} \ No newline at end of file +var _0x5b1d=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatTransferReport,\x20%s,\x20%s','catch','lodash'];(function(_0xf34109,_0x380779){var _0x570bfc=function(_0x1ad086){while(--_0x1ad086){_0xf34109['push'](_0xf34109['shift']());}};_0x570bfc(++_0x380779);}(_0x5b1d,0x1e3));var _0xd5b1=function(_0x1a9a5a,_0x47409e){_0x1a9a5a=_0x1a9a5a-0x0;var _0x4efa84=_0x5b1d[_0x1a9a5a];return _0x4efa84;};'use strict';var _=require(_0xd5b1('0x0'));var util=require(_0xd5b1('0x1'));var moment=require(_0xd5b1('0x2'));var BPromise=require(_0xd5b1('0x3'));var rs=require(_0xd5b1('0x4'));var fs=require('fs');var Redis=require(_0xd5b1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd5b1('0x6'));var logger=require(_0xd5b1('0x7'))('rpc');var config=require(_0xd5b1('0x8'));var jayson=require(_0xd5b1('0x9'));var client=jayson['client'][_0xd5b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e8db4,_0x121e92,_0x548e08){return new BPromise(function(_0x41ed94,_0x15c457){return client['request'](_0x3e8db4,_0x548e08)[_0xd5b1('0xb')](function(_0xac6441){logger[_0xd5b1('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x121e92,'request\x20sent');logger[_0xd5b1('0xd')](_0xd5b1('0xe'),_0x121e92,_0xd5b1('0xf'),JSON[_0xd5b1('0x10')](_0xac6441));if(_0xac6441['error']){if(_0xac6441[_0xd5b1('0x11')][_0xd5b1('0x12')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x121e92,_0xac6441[_0xd5b1('0x11')][_0xd5b1('0x13')]);return _0x15c457(_0xac6441['error'][_0xd5b1('0x13')]);}logger['error'](_0xd5b1('0x14'),_0x121e92,_0xac6441[_0xd5b1('0x11')]['message']);return _0x41ed94(_0xac6441[_0xd5b1('0x11')]['message']);}else{logger[_0xd5b1('0xc')](_0xd5b1('0x14'),_0x121e92,_0xd5b1('0xf'));_0x41ed94(_0xac6441['result']['message']);}})[_0xd5b1('0x15')](function(_0x4f008a){logger[_0xd5b1('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x121e92,_0x4f008a);_0x15c457(_0x4f008a);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 6e4fee7..6396bd2 100644 --- a/server/api/chatTransferReport/index.js +++ b/server/api/chatTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf4c=['show','post','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x216662,_0x211684){var _0xf6b3e=function(_0x1ee356){while(--_0x1ee356){_0x216662['push'](_0x216662['shift']());}};_0xf6b3e(++_0x211684);}(_0xcf4c,0x13b));var _0xccf4=function(_0x174cfc,_0x2b9617){_0x174cfc=_0x174cfc-0x0;var _0x81b2db=_0xcf4c[_0x174cfc];return _0x81b2db;};'use strict';var multer=require(_0xccf4('0x0'));var util=require(_0xccf4('0x1'));var path=require(_0xccf4('0x2'));var timeout=require(_0xccf4('0x3'));var express=require('express');var router=express[_0xccf4('0x4')]();var fs_extra=require(_0xccf4('0x5'));var auth=require(_0xccf4('0x6'));var interaction=require(_0xccf4('0x7'));var config=require(_0xccf4('0x8'));var controller=require(_0xccf4('0x9'));router[_0xccf4('0xa')]('/',auth[_0xccf4('0xb')](),controller[_0xccf4('0xc')]);router[_0xccf4('0xa')](_0xccf4('0xd'),auth[_0xccf4('0xb')](),controller[_0xccf4('0xe')]);router[_0xccf4('0xa')]('/:id',auth[_0xccf4('0xb')](),controller[_0xccf4('0xf')]);router[_0xccf4('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xccf4('0x11')](_0xccf4('0x12'),auth['isAuthenticated'](),controller[_0xccf4('0x13')]);router['delete'](_0xccf4('0x12'),auth['isAuthenticated'](),controller[_0xccf4('0x14')]);module[_0xccf4('0x15')]=router; \ No newline at end of file +var _0xea25=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','util'];(function(_0xd2e2ab,_0x2440cf){var _0x1703a2=function(_0x23deba){while(--_0x23deba){_0xd2e2ab['push'](_0xd2e2ab['shift']());}};_0x1703a2(++_0x2440cf);}(_0xea25,0xc7));var _0x5ea2=function(_0x40bab2,_0x179993){_0x40bab2=_0x40bab2-0x0;var _0x101246=_0xea25[_0x40bab2];return _0x101246;};'use strict';var multer=require('multer');var util=require(_0x5ea2('0x0'));var path=require(_0x5ea2('0x1'));var timeout=require(_0x5ea2('0x2'));var express=require(_0x5ea2('0x3'));var router=express[_0x5ea2('0x4')]();var fs_extra=require(_0x5ea2('0x5'));var auth=require(_0x5ea2('0x6'));var interaction=require(_0x5ea2('0x7'));var config=require('../../config/environment');var controller=require(_0x5ea2('0x8'));router[_0x5ea2('0x9')]('/',auth[_0x5ea2('0xa')](),controller[_0x5ea2('0xb')]);router[_0x5ea2('0x9')](_0x5ea2('0xc'),auth[_0x5ea2('0xa')](),controller[_0x5ea2('0xd')]);router[_0x5ea2('0x9')](_0x5ea2('0xe'),auth['isAuthenticated'](),controller[_0x5ea2('0xf')]);router['post']('/',auth[_0x5ea2('0xa')](),controller['create']);router[_0x5ea2('0x10')](_0x5ea2('0xe'),auth[_0x5ea2('0xa')](),controller[_0x5ea2('0x11')]);router[_0x5ea2('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x5ea2('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 7c40263..3fbf244 100644 --- a/server/api/chatWebsite/chatWebsite.attributes.js +++ b/server/api/chatWebsite/chatWebsite.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a73=['mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Type\x20a\x20message','Skip','Feedback','star','thumb','stringify','input','name','text','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x5a73,0x1f3));var _0x35a7=function(_0x20b555,_0x17905c){_0x20b555=_0x20b555-0x0;var _0x313e74=_0x5a73[_0x20b555];return _0x313e74;};'use strict';var Sequelize=require(_0x35a7('0x0'));var rs=require(_0x35a7('0x1'));module[_0x35a7('0x2')]={'name':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![],'unique':_0x35a7('0x4')},'description':{'type':Sequelize[_0x35a7('0x3')]},'mapKey':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0x5')},'key':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x6')},'customerAlias':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![],'defaultValue':_0x35a7('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![],'defaultValue':_0x35a7('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x35a7('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x35a7('0x9')]('rounded','squared'),'defaultValue':_0x35a7('0xa')},'header_online':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0xb')},'start_chat_button':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0xc')},'offline_chat_button':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x35a7('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x13')},'placeholderMessage':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x14')},'closingMessage':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0x15')},'conditionAgreement':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x16')},'ratingType':{'type':Sequelize[_0x35a7('0x9')](_0x35a7('0x17'),_0x35a7('0x18')),'defaultValue':_0x35a7('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x35a7('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x35a7('0x19')]({'items':[{'type':_0x35a7('0x1a'),'variable':null,'config':{'placeholder':_0x35a7('0x1b'),'type':_0x35a7('0x1c'),'required':!![]},'props':{'title':_0x35a7('0x1b'),'helpText':''}},{'type':_0x35a7('0x1a'),'props':{'title':_0x35a7('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x35a7('0x5'),'type':_0x35a7('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x35a7('0x1d'))?JSON[_0x35a7('0x1e')](this[_0x35a7('0x1f')]('onlineForm')):{};},'set':function(_0x19ebc4){return this[_0x35a7('0x20')]('onlineForm',JSON[_0x35a7('0x19')](_0x19ebc4));}},'offlineForm':{'type':Sequelize[_0x35a7('0x11')],'defaultValue':function(){return JSON[_0x35a7('0x19')]({'items':[{'type':'input','props':{'title':_0x35a7('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x35a7('0x5'),'type':_0x35a7('0x5')},'variable':null},{'type':_0x35a7('0x21'),'config':{'placeholder':_0x35a7('0x22')},'props':{'title':'Comments','helpText':_0x35a7('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x35a7('0x1f')](_0x35a7('0x24'))?JSON[_0x35a7('0x1e')](this['getDataValue'](_0x35a7('0x24'))):{};},'set':function(_0x1a57b5){return this[_0x35a7('0x20')](_0x35a7('0x24'),JSON['stringify'](_0x1a57b5));}},'token':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x35a7('0x3')]},'forwardOffline':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x35a7('0x3')]},'waitingTitle':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x27')},'offlineMessageBody':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x29')},'skipUnmanaged':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x35a7('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x35a7('0x11')],'defaultValue':function(){return _0x35a7('0x2a');}},'notificationSound':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x35a7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x35a7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x2c')},'verticalAlignment':{'type':Sequelize[_0x35a7('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0x2e')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x35a7('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x35a7('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![],'defaultValue':_0x35a7('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x35a7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x35a7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0x30')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x35a7('0x8')],'comment':_0x35a7('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![],'comment':_0x35a7('0x32'),'set':function(_0x504c67){if(!_0x504c67)this[_0x35a7('0x20')](_0x35a7('0x33'),null);this[_0x35a7('0x20')](_0x35a7('0x34'),_0x504c67);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x35a7('0x3')]},'vidaooTopic':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![],'defaultValue':_0x35a7('0x35')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x35a7('0x36');}},'vidaooMetadata':{'type':Sequelize[_0x35a7('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xd5c3=['Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Skip','website_alias','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','TEXT','input','name','text','onlineForm','parse','getDataValue','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'];(function(_0x37cd83,_0x5563b6){var _0x5cd952=function(_0x1ad615){while(--_0x1ad615){_0x37cd83['push'](_0x37cd83['shift']());}};_0x5cd952(++_0x5563b6);}(_0xd5c3,0xa7));var _0x3d5c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd5c3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3d5c('0x0'));var rs=require(_0x3d5c('0x1'));module['exports']={'name':{'type':Sequelize[_0x3d5c('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3d5c('0x3')},'description':{'type':Sequelize[_0x3d5c('0x2')]},'mapKey':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x4')},'mapKeyOffline':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x5')},'customerAlias':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3d5c('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3d5c('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x3d5c('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x3d5c('0x2')],'allowNull':![],'defaultValue':_0x3d5c('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3d5c('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3d5c('0x2')]},'animation':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3d5c('0xa')](_0x3d5c('0xb'),_0x3d5c('0xc')),'defaultValue':_0x3d5c('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0xd')},'offline_chat_button':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x3d5c('0xf')},'download_transcript':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3d5c('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x12')},'noteTitle':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3d5c('0x13')},'closingMessage':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x14')},'closingMessageButton':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0xe')},'skipMessageButton':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x15')},'ratingType':{'type':Sequelize[_0x3d5c('0xa')](_0x3d5c('0x16'),'thumb'),'defaultValue':_0x3d5c('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x3d5c('0x17')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x3d5c('0x18'),'variable':null,'config':{'placeholder':_0x3d5c('0x19'),'type':_0x3d5c('0x1a'),'required':!![]},'props':{'title':_0x3d5c('0x19'),'helpText':''}},{'type':_0x3d5c('0x18'),'props':{'title':_0x3d5c('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x3d5c('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x3d5c('0x1b'))?JSON[_0x3d5c('0x1c')](this[_0x3d5c('0x1d')](_0x3d5c('0x1b'))):{};},'set':function(_0x51428f){return this[_0x3d5c('0x1e')]('onlineForm',JSON['stringify'](_0x51428f));}},'offlineForm':{'type':Sequelize[_0x3d5c('0x17')],'defaultValue':function(){return JSON[_0x3d5c('0x1f')]({'items':[{'type':_0x3d5c('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x3d5c('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x3d5c('0x20')},'props':{'title':'Comments','helpText':_0x3d5c('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x3d5c('0x1d')](_0x3d5c('0x22'))?JSON['parse'](this[_0x3d5c('0x1d')](_0x3d5c('0x22'))):{};},'set':function(_0x55a3cb){return this[_0x3d5c('0x1e')]('offlineForm',JSON[_0x3d5c('0x1f')](_0x55a3cb));}},'token':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':function(){return rs[_0x3d5c('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3d5c('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x3d5c('0x24')},'waitingMessage':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x3d5c('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x3d5c('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x28')},'sendUnmanaged':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3d5c('0x17')]},'showAgentAvatar':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3d5c('0x2')]},'notificationTemplate':{'type':Sequelize[_0x3d5c('0x17')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3d5c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x3d5c('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x3d5c('0x2b')},'messagesAlignment':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x2c')},'defaultTitle':{'type':Sequelize[_0x3d5c('0x2')]},'customerAvatar':{'type':Sequelize[_0x3d5c('0x17')]},'showCustomerAvatar':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3d5c('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3d5c('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3d5c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3d5c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x3d5c('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3d5c('0x8')],'comment':_0x3d5c('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![],'comment':_0x3d5c('0x2f'),'set':function(_0x36d1a3){if(!_0x36d1a3)this['setDataValue'](_0x3d5c('0x30'),null);this['setDataValue']('mandatoryDisposition',_0x36d1a3);}},'vidaooEscalation':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3d5c('0x2')]},'vidaooTopic':{'type':Sequelize[_0x3d5c('0x2')],'allowNull':![],'defaultValue':_0x3d5c('0x31')},'vidaooNote':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':function(){return _0x3d5c('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x3d5c('0x17')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 9174e2b..b9ed79d 100644 --- a/server/api/chatWebsite/chatWebsite.controller.js +++ b/server/api/chatWebsite/chatWebsite.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f18=['Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','asc','list','List','contact','headers','threadId','closed','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','ChatInteraction','messageId','created','autoclose','close','unmanaged','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','queueId','queue','waitForTheAssignedQueue','startRouting','EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','ChatOfflineMessage','fromString','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','CloudProvider','Smtp','forwardOffline','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','originalname','subjectOffline','toPairsIn','mapValues','email','Chat','MailAccountId','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','ifTime','server/files/chat/iframe.ejs','origin','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','labelText','textColor','backgroundColor','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','../../components/parsers/qs','api','../../errors/api','APIBadRequestError','APINotFoundError','handleError','APIConflictError','url','URL','../../mysqldb','defaults','redis','socket.io-emitter','./chatWebsite.socket','register','client','http','then','request\x20sent','debug','error','code','ChatWebsite,\x20%s,\x20%s','message','info','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','update','destroy','get','UserProfileResource','sendStatus','stack','name','setUA','user-agent','getResult','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','model','vendor','type','stringify','index','Pause','mandatoryDispositionPause','map','ChatWebsite','key','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','rows','show','params','rawAttributes','length','find','create','testWildcardValidity','body','address','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','getDispositions','findOne','Disposition','options','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','pick','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','notify','from','From\x20is\x20mandatory','mapKey','isEmpty','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','updatedAt','createdAt','CompanyId','ListId','includes','Contacts','DESC','ChatApplication','Applications','Intervals','interval'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0x8f18,0x1bf));var _0x88f1=function(_0x396b7d,_0x2470d2){_0x396b7d=_0x396b7d-0x0;var _0x339b7e=_0x8f18[_0x396b7d];return _0x339b7e;};'use strict';var Mustache=require('mustache');var util=require('util');var path=require(_0x88f1('0x0'));var ejs=require(_0x88f1('0x1'));var fs=require('fs');var fs_extra=require(_0x88f1('0x2'));var _=require(_0x88f1('0x3'));var querystring=require(_0x88f1('0x4'));var htmlToText=require('html-to-text');var Redis=require(_0x88f1('0x5'));var jayson=require(_0x88f1('0x6'));var qs=require(_0x88f1('0x7'));var logger=require('../../config/logger')(_0x88f1('0x8'));var config=require('../../config/environment');var APIBadRequestError=require(_0x88f1('0x9'))[_0x88f1('0xa')];var APINotFoundError=require(_0x88f1('0x9'))[_0x88f1('0xb')];var APIOutOfIntervalError=require(_0x88f1('0x9'))['APIOutOfIntervalError'];var APIHandleError=require(_0x88f1('0x9'))[_0x88f1('0xc')];var APIConflictError=require('../../errors/api')[_0x88f1('0xd')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require(_0x88f1('0xe'))[_0x88f1('0xf')];var db=require(_0x88f1('0x10'))['db'];config['redis']=_[_0x88f1('0x11')](config[_0x88f1('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0x88f1('0x13'))(new Redis(config[_0x88f1('0x12')]));require(_0x88f1('0x14'))[_0x88f1('0x15')](socket);var client=jayson[_0x88f1('0x16')][_0x88f1('0x17')]({'port':0x232c});var client9002=jayson[_0x88f1('0x16')][_0x88f1('0x17')]({'port':0x232a});var client9003=jayson[_0x88f1('0x16')]['http']({'port':0x232b});var client9001=jayson['client'][_0x88f1('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x2e4844,_0x4ef270,_0x2a88fa,_0x439503){return new Promise(function(_0x30620b,_0x2585cb){var _0x2b77b1=_0x439503||client;return _0x2b77b1['request'](_0x2e4844,_0x2a88fa)[_0x88f1('0x18')](function(_0x2998e0){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4ef270,_0x88f1('0x19'));logger[_0x88f1('0x1a')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4ef270,_0x88f1('0x19'),JSON['stringify'](_0x2998e0));if(_0x2998e0['error']){if(_0x2998e0[_0x88f1('0x1b')][_0x88f1('0x1c')]===0x1f4){logger[_0x88f1('0x1b')](_0x88f1('0x1d'),_0x4ef270,_0x2998e0[_0x88f1('0x1b')]['message']);return _0x2585cb(_0x2998e0['error'][_0x88f1('0x1e')]);}logger[_0x88f1('0x1b')](_0x88f1('0x1d'),_0x4ef270,_0x2998e0[_0x88f1('0x1b')][_0x88f1('0x1e')]);return _0x30620b(_0x2998e0[_0x88f1('0x1b')][_0x88f1('0x1e')]);}else{logger[_0x88f1('0x1f')](_0x88f1('0x1d'),_0x4ef270,_0x88f1('0x19'));_0x30620b(_0x2998e0['result'][_0x88f1('0x1e')]);}})[_0x88f1('0x20')](function(_0xe39fa2){logger['error'](_0x88f1('0x1d'),_0x4ef270,_0xe39fa2);_0x2585cb(_0xe39fa2);});});}function respondWithStatusCode(_0x108c36,_0x29d8cf){_0x29d8cf=_0x29d8cf||0xcc;return function(_0x410053){if(_0x410053){return _0x108c36['sendStatus'](_0x29d8cf);}return _0x108c36[_0x88f1('0x21')](_0x29d8cf)[_0x88f1('0x22')]();};}function respondWithResult(_0x34c301,_0x4fef23){_0x4fef23=_0x4fef23||0xc8;return function(_0xb57853){if(_0xb57853){return _0x34c301[_0x88f1('0x21')](_0x4fef23)[_0x88f1('0x23')](_0xb57853);}};}function respondWithFilteredResult(_0x4f4588,_0x255164){return function(_0x1becc5){if(_0x1becc5){var _0x4104af=typeof _0x255164['offset']===_0x88f1('0x24')&&typeof _0x255164[_0x88f1('0x25')]===_0x88f1('0x24');var _0x48826f=_0x1becc5['count'];var _0x4a7788=_0x4104af?0x0:_0x255164['offset'];var _0x468e58=_0x4104af?_0x1becc5[_0x88f1('0x26')]:_0x255164[_0x88f1('0x27')]+_0x255164[_0x88f1('0x25')];var _0x508364;if(_0x468e58>=_0x48826f){_0x468e58=_0x48826f;_0x508364=0xc8;}else{_0x508364=0xce;}_0x4f4588[_0x88f1('0x21')](_0x508364);return _0x4f4588[_0x88f1('0x28')](_0x88f1('0x29'),_0x4a7788+'-'+_0x468e58+'/'+_0x48826f)[_0x88f1('0x23')](_0x1becc5);}return null;};}function saveUpdates(_0x201d9c){return function(_0x174095){if(_0x174095){return _0x174095[_0x88f1('0x2a')](_0x201d9c)[_0x88f1('0x18')](function(_0x50d6d3){return _0x50d6d3;});}return null;};}function removeEntity(_0x1da391){return function(_0x518fcd){if(_0x518fcd){return _0x518fcd[_0x88f1('0x2b')]()[_0x88f1('0x18')](function(){var _0x834ffb=_0x518fcd[_0x88f1('0x2c')]({'plain':!![]});var _0x12a486='ChatWebsites';return db[_0x88f1('0x2d')]['destroy']({'where':{'type':_0x12a486,'resourceId':_0x834ffb['id']}})[_0x88f1('0x18')](function(){return _0x518fcd;});})[_0x88f1('0x18')](function(){_0x1da391[_0x88f1('0x21')](0xcc)[_0x88f1('0x22')]();});}};}function handleEntityNotFound(_0x8be1ed){return function(_0x314fda){if(!_0x314fda){_0x8be1ed[_0x88f1('0x2e')](0x194);}return _0x314fda;};}function handleError(_0x37ac45,_0x415c7d){_0x415c7d=_0x415c7d||0x1f4;return function(_0x2204f0){logger[_0x88f1('0x1b')](_0x2204f0[_0x88f1('0x2f')]);if(_0x2204f0[_0x88f1('0x30')]){delete _0x2204f0[_0x88f1('0x30')];}_0x37ac45[_0x88f1('0x21')](_0x415c7d)['send'](_0x2204f0);};}function createInteractionObject(_0x333d20,_0x35f449,_0x2f9756,_0x5e7fbf){var _0x477781=require('user-agent-parser');var _0x15ec85=new _0x477781();var _0x29838a=_0x15ec85[_0x88f1('0x31')](_0x2f9756[_0x88f1('0x32')])[_0x88f1('0x33')]();var _0x437510=_0x35f449[_0x88f1('0x34')];if(_0x2f9756[_0x88f1('0x35')]){_0x437510=_0x2f9756['cf-connecting-ip'];}else if(_0x2f9756['x-forwarded-for']){_0x437510=_[_0x88f1('0x36')](_0x2f9756[_0x88f1('0x37')][_0x88f1('0x38')](','));}return{'ContactId':_0x5e7fbf['id'],'ChatWebsiteId':_0x333d20,'from':(_0x5e7fbf[_0x88f1('0x39')]||'')+'\x20'+(_0x5e7fbf[_0x88f1('0x3a')]||''),'customerIp':_0x437510,'customerPort':_0x2f9756[_0x88f1('0x3b')]?_0x2f9756[_0x88f1('0x3b')]:null,'referer':_0x35f449[_0x88f1('0x3c')],'browserName':_0x29838a['browser'][_0x88f1('0x30')]&&_0x29838a[_0x88f1('0x3d')][_0x88f1('0x3e')]?util[_0x88f1('0x3f')](_0x88f1('0x40'),_0x29838a[_0x88f1('0x3d')][_0x88f1('0x30')],_0x29838a[_0x88f1('0x3d')][_0x88f1('0x3e')]):'unknown','browserVersion':_0x29838a[_0x88f1('0x3d')]['version']||_0x88f1('0x41'),'osName':util[_0x88f1('0x3f')](_0x88f1('0x40'),_0x29838a['os'][_0x88f1('0x30')],_0x29838a['os']['version']),'osVersion':_0x29838a['os'][_0x88f1('0x3e')],'deviceModel':_0x29838a[_0x88f1('0x42')][_0x88f1('0x43')]&&_0x29838a['device'][_0x88f1('0x44')]?util['format']('%s\x20%s\x20%s',_0x29838a[_0x88f1('0x42')][_0x88f1('0x43')],_0x29838a['device'][_0x88f1('0x44')],_0x29838a[_0x88f1('0x42')][_0x88f1('0x45')]):null,'deviceVendor':_0x29838a[_0x88f1('0x42')][_0x88f1('0x44')],'deviceType':_0x29838a[_0x88f1('0x42')]['type'],'formData':JSON[_0x88f1('0x46')](_0x35f449)};}exports[_0x88f1('0x47')]=function(_0xd94f9b,_0x539816){var _0x2603fa={'include':[{'model':db[_0x88f1('0x48')],'as':_0x88f1('0x49')}]},_0x51d0c5={},_0x3919ff={'count':0x0,'rows':[]};var _0x1c6a6a=_[_0x88f1('0x4a')](db[_0x88f1('0x4b')]['rawAttributes'],function(_0x2b4c73){return{'name':_0x2b4c73['fieldName'],'type':_0x2b4c73[_0x88f1('0x45')][_0x88f1('0x4c')]};});_0x51d0c5[_0x88f1('0x43')]=_[_0x88f1('0x4a')](_0x1c6a6a,_0x88f1('0x30'));_0x51d0c5[_0x88f1('0x4d')]=_[_0x88f1('0x4e')](_0xd94f9b[_0x88f1('0x4d')]);_0x51d0c5[_0x88f1('0x4f')]=_['intersection'](_0x51d0c5[_0x88f1('0x43')],_0x51d0c5['query']);_0x2603fa['attributes']=_[_0x88f1('0x50')](_0x51d0c5[_0x88f1('0x43')],qs[_0x88f1('0x51')](_0xd94f9b[_0x88f1('0x4d')][_0x88f1('0x51')]));_0x2603fa[_0x88f1('0x52')]=_0x2603fa[_0x88f1('0x52')]['length']?_0x2603fa[_0x88f1('0x52')]:_0x51d0c5[_0x88f1('0x43')];if(!_0xd94f9b[_0x88f1('0x4d')]['hasOwnProperty'](_0x88f1('0x53'))){_0x2603fa[_0x88f1('0x25')]=qs[_0x88f1('0x25')](_0xd94f9b[_0x88f1('0x4d')]['limit']);_0x2603fa[_0x88f1('0x27')]=qs[_0x88f1('0x27')](_0xd94f9b['query'][_0x88f1('0x27')]);}_0x2603fa[_0x88f1('0x54')]=qs[_0x88f1('0x55')](_0xd94f9b[_0x88f1('0x4d')][_0x88f1('0x55')]);_0x2603fa[_0x88f1('0x56')]=qs[_0x88f1('0x4f')](_['pick'](_0xd94f9b[_0x88f1('0x4d')],_0x51d0c5[_0x88f1('0x4f')]),_0x1c6a6a);if(_0xd94f9b['query']['filter']){_0x2603fa[_0x88f1('0x56')]=_[_0x88f1('0x57')](_0x2603fa[_0x88f1('0x56')],{'$or':_['map'](_0x1c6a6a,function(_0x1ae935){if(_0x1ae935[_0x88f1('0x45')]!==_0x88f1('0x58')){var _0x424ed1={};_0x424ed1[_0x1ae935[_0x88f1('0x30')]]={'$like':'%'+_0xd94f9b[_0x88f1('0x4d')][_0x88f1('0x59')]+'%'};return _0x424ed1;}})});}_0x2603fa=_[_0x88f1('0x57')]({},_0x2603fa,_0xd94f9b['options']);var _0x4394e6={'where':_0x2603fa[_0x88f1('0x56')]};return db[_0x88f1('0x4b')][_0x88f1('0x26')](_0x4394e6)[_0x88f1('0x18')](function(_0x324c07){_0x3919ff['count']=_0x324c07;if(_0xd94f9b[_0x88f1('0x4d')][_0x88f1('0x5a')]){_0x2603fa[_0x88f1('0x5b')]=[{'all':!![]}];}return db[_0x88f1('0x4b')]['findAll'](_0x2603fa);})[_0x88f1('0x18')](function(_0x1e924b){_0x3919ff[_0x88f1('0x5c')]=_0x1e924b;return _0x3919ff;})['then'](respondWithFilteredResult(_0x539816,_0x2603fa))['catch'](handleError(_0x539816,null));};exports[_0x88f1('0x5d')]=function(_0x149854,_0x3968ab){var _0x407087={'raw':![],'where':{'id':_0x149854[_0x88f1('0x5e')]['id']},'include':[{'model':db[_0x88f1('0x48')],'as':_0x88f1('0x49')}]},_0x5810ec={};_0x5810ec[_0x88f1('0x43')]=_[_0x88f1('0x4e')](db[_0x88f1('0x4b')][_0x88f1('0x5f')]);_0x5810ec[_0x88f1('0x4d')]=_['keys'](_0x149854[_0x88f1('0x4d')]);_0x5810ec[_0x88f1('0x4f')]=_[_0x88f1('0x50')](_0x5810ec['model'],_0x5810ec['query']);_0x407087[_0x88f1('0x52')]=_[_0x88f1('0x50')](_0x5810ec[_0x88f1('0x43')],qs[_0x88f1('0x51')](_0x149854['query'][_0x88f1('0x51')]));_0x407087['attributes']=_0x407087[_0x88f1('0x52')][_0x88f1('0x60')]?_0x407087['attributes']:_0x5810ec[_0x88f1('0x43')];if(_0x149854[_0x88f1('0x4d')][_0x88f1('0x5a')]){_0x407087['include']=[{'all':!![]}];}_0x407087=_[_0x88f1('0x57')]({},_0x407087,_0x149854['options']);return db[_0x88f1('0x4b')][_0x88f1('0x61')](_0x407087)[_0x88f1('0x18')](handleEntityNotFound(_0x3968ab,null))[_0x88f1('0x18')](respondWithResult(_0x3968ab,null))[_0x88f1('0x20')](handleError(_0x3968ab,null));};exports[_0x88f1('0x62')]=function(_0x3b43c8,_0x2d0266){if(!wildcardUtils[_0x88f1('0x63')](_0x3b43c8[_0x88f1('0x64')]['address'])){return handleError(_0x2d0266,null)(new APIBadRequestError('\x22'+_0x3b43c8['body'][_0x88f1('0x65')]+_0x88f1('0x66')));}return db[_0x88f1('0x4b')][_0x88f1('0x62')](_0x3b43c8[_0x88f1('0x64')],{})[_0x88f1('0x18')](function(_0x506fc9){var _0x25a516=_0x3b43c8['user'][_0x88f1('0x2c')]({'plain':!![]});if(!_0x25a516)throw new Error(_0x88f1('0x67'));if(_0x25a516[_0x88f1('0x68')]===_0x88f1('0x69')){var _0x41a608=_0x506fc9[_0x88f1('0x2c')]({'plain':!![]});var _0x58eccf='ChatWebsites';return db[_0x88f1('0x6a')][_0x88f1('0x61')]({'where':{'name':_0x58eccf,'userProfileId':_0x25a516[_0x88f1('0x6b')]},'raw':!![]})['then'](function(_0x6e38f4){if(_0x6e38f4&&_0x6e38f4['autoAssociation']===0x0){return db[_0x88f1('0x2d')][_0x88f1('0x62')]({'name':_0x41a608[_0x88f1('0x30')],'resourceId':_0x41a608['id'],'type':_0x6e38f4[_0x88f1('0x30')],'sectionId':_0x6e38f4['id']},{})[_0x88f1('0x18')](function(){return _0x506fc9;});}else{return _0x506fc9;}})[_0x88f1('0x20')](function(_0x42fe43){logger['error'](_0x88f1('0x6c'),_0x42fe43);throw _0x42fe43;});}return _0x506fc9;})[_0x88f1('0x18')](respondWithResult(_0x2d0266,0xc9))[_0x88f1('0x20')](handleError(_0x2d0266,null));};exports['update']=function(_0x3543f9,_0x57f7d9){if(!wildcardUtils[_0x88f1('0x63')](_0x3543f9[_0x88f1('0x64')]['address'])){return handleError(_0x57f7d9,null)(new APIBadRequestError('\x22'+_0x3543f9['body'][_0x88f1('0x65')]+_0x88f1('0x66')));}if(_0x3543f9[_0x88f1('0x64')]['id']){delete _0x3543f9[_0x88f1('0x64')]['id'];}return db[_0x88f1('0x4b')][_0x88f1('0x61')]({'where':{'id':_0x3543f9[_0x88f1('0x5e')]['id']},'include':[{'model':db['Pause'],'as':_0x88f1('0x49')}]})[_0x88f1('0x18')](handleEntityNotFound(_0x57f7d9,null))[_0x88f1('0x18')](saveUpdates(_0x3543f9[_0x88f1('0x64')],null))[_0x88f1('0x18')](respondWithResult(_0x57f7d9,null))['catch'](handleError(_0x57f7d9,null));};exports[_0x88f1('0x2b')]=function(_0x368881,_0x52ceed){return db[_0x88f1('0x4b')]['find']({'where':{'id':_0x368881[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x52ceed,null))['then'](removeEntity(_0x52ceed,null))[_0x88f1('0x20')](handleError(_0x52ceed,null));};exports[_0x88f1('0x6d')]=function(_0x490b27,_0x5a637d){return db[_0x88f1('0x4b')][_0x88f1('0x6d')]()[_0x88f1('0x18')](respondWithResult(_0x5a637d,null))[_0x88f1('0x20')](handleError(_0x5a637d,null));};exports['addDisposition']=function(_0x4a0afb,_0x2184ac){if(_0x4a0afb[_0x88f1('0x64')]['id']){delete _0x4a0afb[_0x88f1('0x64')]['id'];}return db[_0x88f1('0x4b')]['find']({'where':{'id':_0x4a0afb[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x2184ac,null))[_0x88f1('0x18')](function(_0x3395fa){if(_0x3395fa){_0x4a0afb[_0x88f1('0x64')][_0x88f1('0x6e')]=_0x3395fa['id'];return db['Disposition']['create'](_0x4a0afb['body']);}})[_0x88f1('0x18')](respondWithResult(_0x2184ac,null))[_0x88f1('0x20')](handleError(_0x2184ac,null));};exports[_0x88f1('0x6f')]=function(_0x4afc43,_0x140495){var _0x3007b5={'raw':![],'where':{}};var _0x12420a={};var _0x171225={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x88f1('0x70')]({'where':{'id':_0x4afc43[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x140495,null))[_0x88f1('0x18')](function(_0x1be68c){if(_0x1be68c){_0x12420a[_0x88f1('0x43')]=_['keys'](db[_0x88f1('0x71')][_0x88f1('0x5f')]);_0x12420a[_0x88f1('0x4d')]=_[_0x88f1('0x4e')](_0x4afc43[_0x88f1('0x4d')]);_0x12420a[_0x88f1('0x4f')]=_[_0x88f1('0x50')](_0x12420a[_0x88f1('0x43')],_0x12420a[_0x88f1('0x4d')]);_0x3007b5[_0x88f1('0x52')]=_[_0x88f1('0x50')](_0x12420a['model'],qs[_0x88f1('0x51')](_0x4afc43[_0x88f1('0x4d')]['fields']));_0x3007b5[_0x88f1('0x52')]=_0x3007b5['attributes']['length']?_0x3007b5[_0x88f1('0x52')]:_0x12420a[_0x88f1('0x43')];if(!_0x4afc43[_0x88f1('0x4d')]['hasOwnProperty'](_0x88f1('0x53'))){_0x3007b5[_0x88f1('0x25')]=qs['limit'](_0x4afc43[_0x88f1('0x4d')][_0x88f1('0x25')]);_0x3007b5[_0x88f1('0x27')]=qs[_0x88f1('0x27')](_0x4afc43[_0x88f1('0x4d')][_0x88f1('0x27')]);}_0x3007b5[_0x88f1('0x54')]=qs[_0x88f1('0x55')](_0x4afc43[_0x88f1('0x4d')][_0x88f1('0x55')]);_0x3007b5['where']=qs[_0x88f1('0x4f')](_['pick'](_0x4afc43[_0x88f1('0x4d')],_0x12420a[_0x88f1('0x4f')]));_0x3007b5[_0x88f1('0x56')]['ChatWebsiteId']=_0x1be68c['id'];if(_0x4afc43['query']['filter']){_0x3007b5[_0x88f1('0x56')]=_[_0x88f1('0x57')](_0x3007b5[_0x88f1('0x56')],{'$or':_[_0x88f1('0x4a')](_0x3007b5['attributes'],function(_0xee075){var _0x4223f9={};_0x4223f9[_0xee075]={'$like':'%'+_0x4afc43[_0x88f1('0x4d')][_0x88f1('0x59')]+'%'};return _0x4223f9;})});}_0x3007b5=_[_0x88f1('0x57')]({},_0x3007b5,_0x4afc43[_0x88f1('0x72')]);return db[_0x88f1('0x71')][_0x88f1('0x26')]({'where':_0x3007b5[_0x88f1('0x56')]})['then'](function(_0x535a5e){_0x171225[_0x88f1('0x26')]=_0x535a5e;if(_0x4afc43[_0x88f1('0x4d')][_0x88f1('0x5a')]){_0x3007b5[_0x88f1('0x5b')]=[{'all':!![]}];}return db['Disposition'][_0x88f1('0x73')](_0x3007b5);})['then'](function(_0x84e180){_0x171225[_0x88f1('0x5c')]=_0x84e180;return _0x171225;});}})[_0x88f1('0x18')](respondWithFilteredResult(_0x140495,_0x3007b5))[_0x88f1('0x20')](handleError(_0x140495,null));};exports[_0x88f1('0x74')]=function(_0x1ffa9b,_0x14a855){return db[_0x88f1('0x4b')][_0x88f1('0x61')]({'where':{'id':_0x1ffa9b[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x14a855,null))[_0x88f1('0x18')](function(_0x3c83dd){if(_0x3c83dd){return _0x3c83dd[_0x88f1('0x74')](_0x1ffa9b[_0x88f1('0x4d')][_0x88f1('0x75')]);}})[_0x88f1('0x18')](respondWithStatusCode(_0x14a855,null))[_0x88f1('0x20')](handleError(_0x14a855,null));};exports[_0x88f1('0x76')]=function(_0x384341,_0x5e62e6){if(_0x384341[_0x88f1('0x64')]['id']){delete _0x384341[_0x88f1('0x64')]['id'];}return db[_0x88f1('0x4b')][_0x88f1('0x61')]({'where':{'id':_0x384341[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x5e62e6,null))[_0x88f1('0x18')](function(_0x3e37f4){if(_0x3e37f4){_0x384341['body'][_0x88f1('0x6e')]=_0x3e37f4['id'];return db[_0x88f1('0x77')]['create'](_0x384341[_0x88f1('0x64')]);}})[_0x88f1('0x18')](respondWithResult(_0x5e62e6,null))[_0x88f1('0x20')](handleError(_0x5e62e6,null));};exports[_0x88f1('0x78')]=function(_0x416eb5,_0x156105){var _0x4b420c={'raw':![],'where':{}};var _0x83c679={};var _0x3d21ed={'count':0x0,'rows':[]};return db[_0x88f1('0x4b')][_0x88f1('0x70')]({'where':{'id':_0x416eb5[_0x88f1('0x5e')]['id']}})['then'](handleEntityNotFound(_0x156105,null))['then'](function(_0x37fdec){if(_0x37fdec){_0x83c679[_0x88f1('0x43')]=_[_0x88f1('0x4e')](db[_0x88f1('0x77')][_0x88f1('0x5f')]);_0x83c679['query']=_[_0x88f1('0x4e')](_0x416eb5['query']);_0x83c679[_0x88f1('0x4f')]=_[_0x88f1('0x50')](_0x83c679[_0x88f1('0x43')],_0x83c679[_0x88f1('0x4d')]);_0x4b420c[_0x88f1('0x52')]=_['intersection'](_0x83c679[_0x88f1('0x43')],qs[_0x88f1('0x51')](_0x416eb5[_0x88f1('0x4d')]['fields']));_0x4b420c[_0x88f1('0x52')]=_0x4b420c[_0x88f1('0x52')]['length']?_0x4b420c[_0x88f1('0x52')]:_0x83c679['model'];if(!_0x416eb5[_0x88f1('0x4d')][_0x88f1('0x79')](_0x88f1('0x53'))){_0x4b420c[_0x88f1('0x25')]=qs[_0x88f1('0x25')](_0x416eb5[_0x88f1('0x4d')][_0x88f1('0x25')]);_0x4b420c[_0x88f1('0x27')]=qs[_0x88f1('0x27')](_0x416eb5[_0x88f1('0x4d')]['offset']);}_0x4b420c[_0x88f1('0x54')]=qs['sort'](_0x416eb5[_0x88f1('0x4d')][_0x88f1('0x55')]);_0x4b420c[_0x88f1('0x56')]=qs['filters'](_[_0x88f1('0x7a')](_0x416eb5[_0x88f1('0x4d')],_0x83c679[_0x88f1('0x4f')]));_0x4b420c['where']['ChatWebsiteId']=_0x37fdec['id'];if(_0x416eb5[_0x88f1('0x4d')][_0x88f1('0x59')]){_0x4b420c[_0x88f1('0x56')]=_[_0x88f1('0x57')](_0x4b420c['where'],{'$or':_[_0x88f1('0x4a')](_0x4b420c[_0x88f1('0x52')],function(_0x541045){var _0x39b36d={};_0x39b36d[_0x541045]={'$like':'%'+_0x416eb5['query']['filter']+'%'};return _0x39b36d;})});}_0x4b420c=_['merge']({},_0x4b420c,_0x416eb5[_0x88f1('0x72')]);return db['CannedAnswer'][_0x88f1('0x26')]({'where':_0x4b420c[_0x88f1('0x56')]})[_0x88f1('0x18')](function(_0x208305){_0x3d21ed['count']=_0x208305;if(_0x416eb5[_0x88f1('0x4d')]['includeAll']){_0x4b420c[_0x88f1('0x5b')]=[{'all':!![]}];}return db[_0x88f1('0x77')][_0x88f1('0x73')](_0x4b420c);})[_0x88f1('0x18')](function(_0x59b4cb){_0x3d21ed[_0x88f1('0x5c')]=_0x59b4cb;return _0x3d21ed;});}})[_0x88f1('0x18')](respondWithFilteredResult(_0x156105,_0x4b420c))[_0x88f1('0x20')](handleError(_0x156105,null));};exports[_0x88f1('0x7b')]=function(_0xc23b5f,_0x4c0f24){return db[_0x88f1('0x4b')][_0x88f1('0x61')]({'where':{'id':_0xc23b5f['params']['id']}})['then'](handleEntityNotFound(_0x4c0f24,null))[_0x88f1('0x18')](function(_0x833c08){if(_0x833c08){return _0x833c08[_0x88f1('0x7b')](_0xc23b5f[_0x88f1('0x4d')]['ids']);}})[_0x88f1('0x18')](respondWithStatusCode(_0x4c0f24,null))[_0x88f1('0x20')](handleError(_0x4c0f24,null));};exports['addLogo']=function(_0x152342,_0x187896){_0x152342[_0x88f1('0x64')][_0x88f1('0x7c')]=_0x152342[_0x88f1('0x7d')][_0x88f1('0x7e')];return db['ChatWebsite'][_0x88f1('0x61')]({'where':{'id':_0x152342[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x187896,null))[_0x88f1('0x18')](saveUpdates(_0x152342['body'],null))[_0x88f1('0x18')](respondWithResult(_0x187896,null))['catch'](handleError(_0x187896,null));};exports[_0x88f1('0x7f')]=function(_0x4c3e68,_0x19fedb){_0x4c3e68[_0x88f1('0x64')][_0x88f1('0x80')]=_0x4c3e68[_0x88f1('0x7d')][_0x88f1('0x7e')];return db[_0x88f1('0x4b')]['find']({'where':{'id':_0x4c3e68['params']['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x19fedb,null))[_0x88f1('0x18')](saveUpdates(_0x4c3e68[_0x88f1('0x64')],null))['then'](respondWithResult(_0x19fedb,null))[_0x88f1('0x20')](handleError(_0x19fedb,null));};exports[_0x88f1('0x81')]=function(_0x216e40,_0x33ebfb){_0x216e40['body'][_0x88f1('0x82')]=_0x216e40[_0x88f1('0x7d')][_0x88f1('0x7e')];return db[_0x88f1('0x4b')]['find']({'where':{'id':_0x216e40['params']['id']}})['then'](handleEntityNotFound(_0x33ebfb,null))[_0x88f1('0x18')](saveUpdates(_0x216e40[_0x88f1('0x64')],null))['then'](respondWithResult(_0x33ebfb,null))[_0x88f1('0x20')](handleError(_0x33ebfb,null));};exports[_0x88f1('0x83')]=function(_0x2d2e63,_0x11fc50){_0x2d2e63[_0x88f1('0x64')][_0x88f1('0x84')]=_0x2d2e63[_0x88f1('0x7d')][_0x88f1('0x7e')];return db[_0x88f1('0x4b')]['find']({'where':{'id':_0x2d2e63[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x11fc50,null))['then'](saveUpdates(_0x2d2e63[_0x88f1('0x64')],null))[_0x88f1('0x18')](respondWithResult(_0x11fc50,null))[_0x88f1('0x20')](handleError(_0x11fc50,null));};exports[_0x88f1('0x85')]=function(_0xc93dc6,_0x38ce71){var _0x51fc75=path[_0x88f1('0x86')](config[_0x88f1('0x87')],_0x88f1('0x88'));var _0x37bcf9={'where':{'id':_0xc93dc6[_0x88f1('0x5e')]['id']},'attributes':['id',_0x88f1('0x7c')],'raw':!![]};var _0x1fc680=![];return require(_0x88f1('0x89'))[_0x88f1('0x8a')]()[_0x88f1('0x18')](function(_0x51bab9){if(_0x51bab9){_0x1fc680=_0x51bab9['custom'];}})[_0x88f1('0x18')](function(){return db['ChatWebsite'][_0x88f1('0x61')](_0x37bcf9);})['then'](handleEntityNotFound(_0x38ce71,null))['then'](function(_0x3ede12){if(_0x3ede12){if(!_[_0x88f1('0x8b')](_0x3ede12[_0x88f1('0x7c')])){if(fs['existsSync'](path[_0x88f1('0x86')](config['root'],_0x88f1('0x8c'),_0x3ede12[_0x88f1('0x7c')]))&&_0x1fc680){_0x51fc75=path[_0x88f1('0x86')](config['root'],_0x88f1('0x8c'),_0x3ede12[_0x88f1('0x7c')]);}}return _0x38ce71[_0x88f1('0x8d')](_0x51fc75);}})[_0x88f1('0x20')](handleError(_0x38ce71,null));};exports['getAvatar']=function(_0xf89d80,_0x88e3f9){var _0x134d80=path[_0x88f1('0x86')](config['root'],_0x88f1('0x8e'));var _0x5bc0a4={'where':{'id':_0xf89d80['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x88f1('0x4b')][_0x88f1('0x61')](_0x5bc0a4)['then'](handleEntityNotFound(_0x88e3f9,null))[_0x88f1('0x18')](function(_0x5c526d){if(_0x5c526d){if(!_[_0x88f1('0x8b')](_0x5c526d[_0x88f1('0x80')])){if(fs[_0x88f1('0x8f')](path[_0x88f1('0x86')](config[_0x88f1('0x87')],'server/files/images/avatars/',_0x5c526d[_0x88f1('0x80')]))){_0x134d80=path['join'](config[_0x88f1('0x87')],_0x88f1('0x90'),_0x5c526d['agentAvatar']);}}return _0x88e3f9[_0x88f1('0x8d')](_0x134d80);}})[_0x88f1('0x20')](handleError(_0x88e3f9,null));};exports[_0x88f1('0x91')]=function(_0x3bb392,_0x51dccd){var _0x3f15db=path['join'](config['root'],_0x88f1('0x92'));var _0x476df9={'where':{'id':_0x3bb392[_0x88f1('0x5e')]['id']},'attributes':['id','customerAvatar',_0x88f1('0x93')],'raw':!![]};return db[_0x88f1('0x4b')]['find'](_0x476df9)[_0x88f1('0x18')](handleEntityNotFound(_0x51dccd,null))[_0x88f1('0x18')](function(_0x52b198){if(_0x52b198){if(!_[_0x88f1('0x8b')](_0x52b198[_0x88f1('0x82')])){if(fs[_0x88f1('0x8f')](path[_0x88f1('0x86')](config[_0x88f1('0x87')],'server/files/images/avatars/',_0x52b198['customerAvatar']))&&_0x52b198[_0x88f1('0x93')]){_0x3f15db=path['join'](config['root'],_0x88f1('0x90'),_0x52b198[_0x88f1('0x82')]);}}return _0x51dccd['download'](_0x3f15db);}})['catch'](handleError(_0x51dccd,null));};exports['getSystemAvatar']=function(_0x4ef1b4,_0x56cfe3){var _0x589f3d=path['join'](config[_0x88f1('0x87')],_0x88f1('0x94'));var _0x7626e7={'where':{'id':_0x4ef1b4[_0x88f1('0x5e')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x88f1('0x4b')][_0x88f1('0x61')](_0x7626e7)[_0x88f1('0x18')](handleEntityNotFound(_0x56cfe3,null))['then'](function(_0x17d603){if(_0x17d603){if(!_['isNil'](_0x17d603[_0x88f1('0x84')])){if(fs['existsSync'](path[_0x88f1('0x86')](config[_0x88f1('0x87')],_0x88f1('0x90'),_0x17d603[_0x88f1('0x84')]))){_0x589f3d=path[_0x88f1('0x86')](config['root'],_0x88f1('0x90'),_0x17d603[_0x88f1('0x84')]);}}return _0x56cfe3['download'](_0x589f3d);}})[_0x88f1('0x20')](handleError(_0x56cfe3,null));};function checkWebsiteInterval(_0x3bbd63){var _0x25bd6a=_0x3bbd63[_0x88f1('0x95')];if(!_0x25bd6a){return Promise[_0x88f1('0x96')](_0x3bbd63);}var _0x126951=_0x3bbd63[_0x88f1('0x97')]||undefined;return _0x25bd6a['ifTime'](_0x126951)['then'](function(_0x54e927){if(!_0x54e927){throw new APIOutOfIntervalError();}return _0x3bbd63;});}exports[_0x88f1('0x98')]=function(_0x5c623c,_0x2f050b){var _0x2c63fe={'body':_0x5c623c[_0x88f1('0x64')],'channel':'chat'};var _0x2d695b=[];var _0x2c2454=[];var _0x37a626={};var _0x11b0b1=![];if(_0x5c623c[_0x88f1('0x64')]['id']){delete _0x5c623c[_0x88f1('0x64')]['id'];}if(_[_0x88f1('0x8b')](_0x5c623c[_0x88f1('0x64')][_0x88f1('0x99')])){throw new APIBadRequestError(_0x88f1('0x9a'));}if(_[_0x88f1('0x8b')](_0x5c623c[_0x88f1('0x64')][_0x88f1('0x9b')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0x88f1('0x9c')](_0x5c623c[_0x88f1('0x64')][_0x88f1('0x64')])){throw new APIBadRequestError(_0x88f1('0x9d'));}var _0x399009=_0x5c623c[_0x88f1('0x64')]['customerIp']&&_0x5c623c[_0x88f1('0x64')][_0x88f1('0x3c')];return db[_0x88f1('0x9e')][_0x88f1('0x6d')]()[_0x88f1('0x18')](function(_0x31881f){if(!_0x31881f){throw new Error(_0x88f1('0x9f'));}_0x2d695b=Object[_0x88f1('0x4e')](_0x31881f)[_0x88f1('0x59')](function(_0x1c9278){return!['createdAt',_0x88f1('0xa0')]['includes'](_0x1c9278);});_0x2c2454=Object[_0x88f1('0x4e')](_0x31881f)[_0x88f1('0x59')](function(_0x193b29){return![_0x88f1('0xa1'),_0x88f1('0xa0'),_0x88f1('0xa2'),_0x88f1('0xa3')][_0x88f1('0xa4')](_0x193b29);});if(!_[_0x88f1('0xa4')](_0x2c2454,_0x5c623c[_0x88f1('0x64')][_0x88f1('0x9b')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x2c2454[_0x88f1('0x86')](',\x20'));}_0x37a626[_0x5c623c[_0x88f1('0x64')][_0x88f1('0x9b')]]=_0x5c623c[_0x88f1('0x64')][_0x88f1('0x99')];})[_0x88f1('0x18')](function(){return db[_0x88f1('0x4b')]['find']({'where':{'id':_0x5c623c['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x88f1('0x9e')],'as':_0x88f1('0xa5'),'where':_0x37a626,'limit':0x1,'order':[[_0x88f1('0xa0'),_0x88f1('0xa6')]]}]},{'model':db[_0x88f1('0xa7')],'as':_0x88f1('0xa8')},{'model':db[_0x88f1('0x95')],'as':_0x88f1('0x95'),'include':[{'model':db[_0x88f1('0x95')],'as':_0x88f1('0xa9'),'attributes':['id',_0x88f1('0xaa')],'raw':!![]}]}]});})[_0x88f1('0x18')](function(_0x1fe534){if(!_0x1fe534){throw new APINotFoundError(util['format'](_0x88f1('0xab'),_0x5c623c['params']['id']));}if(_0x399009){return checkWebsiteInterval(_0x1fe534);}return _0x1fe534;})[_0x88f1('0x18')](function(_0x11d7b9){_0x2c63fe[_0x88f1('0xac')]=_0x11d7b9;_0x2c63fe[_0x88f1('0xad')]=_[_0x88f1('0xae')](_0x11d7b9[_0x88f1('0xa8')],['priority'],[_0x88f1('0xaf')]);if(_0x2c63fe[_0x88f1('0xac')][_0x88f1('0xa8')]){delete _0x2c63fe['account'][_0x88f1('0xa8')];}_0x2c63fe[_0x88f1('0xb0')]=_0x11d7b9[_0x88f1('0xb1')]||{'id':_0x11d7b9['ListId']};if(_0x2c63fe[_0x88f1('0xb0')]&&_0x2c63fe[_0x88f1('0xb0')]['Contacts'][_0x88f1('0x60')]){return _0x2c63fe[_0x88f1('0xb0')]['Contacts'][0x0];}var _0x36c2f6=_[_0x88f1('0x11')](_0x5c623c['body'],{'firstName':_0x5c623c[_0x88f1('0x64')]['from'],'ListId':_0x11d7b9['ListId']});_0x36c2f6[_0x5c623c[_0x88f1('0x64')][_0x88f1('0x9b')]]=_0x5c623c[_0x88f1('0x64')][_0x88f1('0x99')];return db[_0x88f1('0x9e')][_0x88f1('0x62')](_0x36c2f6,{'fields':_0x2d695b,'raw':!![]});})[_0x88f1('0x18')](function(_0x350c6a){_0x2c63fe[_0x88f1('0xb2')]=_0x350c6a;var _0xc425fa=createInteractionObject(_0x5c623c[_0x88f1('0x5e')]['id'],_0x5c623c['body'],_0x5c623c[_0x88f1('0xb3')],_0x350c6a);var _0x4da6a5={'ChatWebsiteId':_0x5c623c[_0x88f1('0x5e')]['id']};if(_0x5c623c[_0x88f1('0x64')][_0x88f1('0xb4')]){_0x4da6a5[_0x88f1('0xb4')]=_0x5c623c['body'][_0x88f1('0xb4')];_0x4da6a5[_0x88f1('0xb5')]=![];return db['ChatInteraction'][_0x88f1('0x61')]({'where':_0x4da6a5})[_0x88f1('0x18')](function(_0x1e1ae0){var _0x40de2f=_0x5c623c[_0x88f1('0x64')][_0x88f1('0x34')]&&_0x5c623c[_0x88f1('0x64')]['referer'];if(_0x1e1ae0){_0x11b0b1=!![];return _0x1e1ae0;}else if(!_0x40de2f&&_0x1e1ae0&&_0x1e1ae0[_0x88f1('0xb5')]){throw new APIConflictError(_0x88f1('0xb6'));}_0xc425fa[_0x88f1('0xb4')]=_0x5c623c['body'][_0x88f1('0xb4')];_0xc425fa[_0x88f1('0xb7')]=_0x5c623c[_0x88f1('0x64')]['externalUrl'];return db['ChatInteraction']['create'](_0xc425fa);});}_0x4da6a5[_0x88f1('0xb8')]=_0x350c6a['id'];if(_0x5c623c[_0x88f1('0x64')][_0x88f1('0xb9')]&&_0x5c623c[_0x88f1('0x64')]['interaction']['id']){_0x4da6a5['id']=_0x5c623c['body'][_0x88f1('0xb9')]['id'];return db[_0x88f1('0xba')][_0x88f1('0x61')]({'where':_0x4da6a5})[_0x88f1('0x18')](function(_0x3a80d6){var _0x217508=_0x5c623c[_0x88f1('0x64')]['customerIp']&&_0x5c623c['body'][_0x88f1('0x3c')];if(!_0x217508&&_0x3a80d6&&_0x3a80d6['closed']){throw new APIConflictError(_0x88f1('0xb6'));}else if(_0x3a80d6){_0x11b0b1=!![];return _0x3a80d6;}else{return db[_0x88f1('0xba')][_0x88f1('0x62')](_0xc425fa);}});}return db['ChatInteraction'][_0x88f1('0x62')](_0xc425fa);})[_0x88f1('0x18')](function(_0x5a4958){if(!_0x11b0b1){return _0x5a4958;}var _0x54cced={'from':(_0x2c63fe[_0x88f1('0xb2')][_0x88f1('0x39')]||'')+'\x20'+(_0x2c63fe['contact'][_0x88f1('0x3a')]||'')};if(_0x5c623c[_0x88f1('0x64')][_0x88f1('0xb4')]&&_0x5c623c[_0x88f1('0x64')][_0x88f1('0xbb')]&&_0x5c623c['body'][_0x88f1('0xb4')]!=_0x5c623c[_0x88f1('0x64')][_0x88f1('0xbb')]){_0x54cced['threadId']=_0x5c623c[_0x88f1('0x64')][_0x88f1('0xbb')];}return _0x5a4958[_0x88f1('0x2a')](_0x54cced);})['then'](function(_0x5d0f0f){_0x2c63fe[_0x88f1('0xb9')]=_0x5d0f0f[_0x88f1('0x2c')]({'plain':!![]});_0x2c63fe[_0x88f1('0xb9')][_0x88f1('0xbc')]=!_0x11b0b1;if(_0x2c63fe[_0x88f1('0xb9')][_0x88f1('0xbc')]){if(_0x2c63fe[_0x88f1('0xac')][_0x88f1('0xbd')]){_0x2c63fe[_0x88f1('0xad')]['push']({'id':0x0,'priority':_0x2c63fe[_0x88f1('0xad')][_0x88f1('0x60')]+0x1,'app':_0x88f1('0xbe'),'appdata':_0x88f1('0xbf'),'interval':'*,*,*,*'});}}return db[_0x88f1('0xc0')][_0x88f1('0x62')]({'body':_0x5c623c[_0x88f1('0x64')][_0x88f1('0x64')],'ChatWebsiteId':_0x5c623c[_0x88f1('0x5e')]['id'],'ChatInteractionId':_0x5d0f0f['id'],'direction':'in','ContactId':_0x2c63fe[_0x88f1('0xb2')]['id'],'AttachmentId':_0x5c623c[_0x88f1('0x64')][_0x88f1('0xc1')]});})[_0x88f1('0x18')](function(_0x4a86a8){_0x2c63fe[_0x88f1('0x1e')]=_0x4a86a8;if(!_0x2c63fe[_0x88f1('0xb9')][_0x88f1('0xc2')]){return;}return db['User'][_0x88f1('0x61')]({'attributes':['id',_0x88f1('0x30')],'where':{'id':_0x2c63fe[_0x88f1('0xb9')][_0x88f1('0xc2')]}});})[_0x88f1('0x18')](function(_0x38cc73){if(_0x38cc73){_0x2c63fe[_0x88f1('0xad')][_0x88f1('0xc3')]({'id':0x0,'priority':0x0,'app':_0x88f1('0xc4'),'appdata':_0x38cc73[_0x88f1('0x30')]+','+(_0x2c63fe[_0x88f1('0xac')][_0x88f1('0xc5')]||0xa),'interval':_0x88f1('0xc6')});_0x2c63fe[_0x88f1('0xc7')]=!![];}if(!_0x2c63fe[_0x88f1('0xb9')][_0x88f1('0xc8')]){return;}return db['ChatQueue']['find']({'attributes':['id',_0x88f1('0x30')],'where':{'id':_0x2c63fe[_0x88f1('0xb9')][_0x88f1('0xc8')]}});})[_0x88f1('0x18')](function(_0x5acdbe){if(_0x5acdbe){_0x2c63fe[_0x88f1('0xad')][_0x88f1('0xc3')]({'id':0x0,'priority':0x1,'app':_0x88f1('0xc9'),'appdata':_0x5acdbe['name']+','+(_0x2c63fe[_0x88f1('0xac')][_0x88f1('0xca')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x88f1('0xcb'),_0x2c63fe);})[_0x88f1('0x18')](function(_0x3a7391){respondWithRpcPromise('EventManager',_0x88f1('0xcc'),{'event':_0x88f1('0x98'),'message':_0x3a7391},client9002);return _0x3a7391;})[_0x88f1('0x18')](respondWithResult(_0x2f050b,null))['catch'](APIHandleError(_0x2f050b));};exports[_0x88f1('0xcd')]=function(_0x31a00d,_0x159afc){var _0x4a20e7,_0x4442b3,_0x3be769;var _0x92f83f=[];var _0x126ef3={};var _0x16d55f=_0x31a00d[_0x88f1('0xce')]||[];var _0x401f93=[];var _0x14c171;return db[_0x88f1('0x9e')][_0x88f1('0x6d')]()['then'](function(_0x15d214){if(!_0x15d214){throw new db[(_0x88f1('0xcf'))][(_0x88f1('0xd0'))](_0x88f1('0xd1'));}_0x92f83f=_[_0x88f1('0xd2')](_[_0x88f1('0x4e')](_0x15d214),['createdAt',_0x88f1('0xa0'),'CompanyId',_0x88f1('0xa3')]);if(_0x31a00d[_0x88f1('0x64')]['id']){delete _0x31a00d['body']['id'];}if(_[_0x88f1('0x8b')](_0x31a00d[_0x88f1('0x64')][_0x88f1('0x99')])){throw _0x159afc[_0x88f1('0x21')](0x1f4)[_0x88f1('0xd3')](new db[(_0x88f1('0xcf'))][(_0x88f1('0xd0'))](_0x88f1('0xd4')));}if(_[_0x88f1('0x8b')](_0x31a00d[_0x88f1('0x64')][_0x88f1('0x64')])||_0x31a00d[_0x88f1('0x64')]['body']===''){throw _0x159afc['status'](0x1f4)[_0x88f1('0xd3')](new db[(_0x88f1('0xcf'))][(_0x88f1('0xd0'))](_0x88f1('0xd5')));}if(_[_0x88f1('0x8b')](_0x31a00d[_0x88f1('0x64')]['mapKeyOffline'])){throw _0x159afc[_0x88f1('0x21')](0x1f4)[_0x88f1('0xd3')](new db['Sequelize'][(_0x88f1('0xd0'))](_0x88f1('0xd6')+_0x92f83f));}if(!_[_0x88f1('0xa4')](_0x92f83f,_0x31a00d[_0x88f1('0x64')][_0x88f1('0xd7')])){throw _0x159afc[_0x88f1('0x21')](0x1f4)[_0x88f1('0xd3')](new db[(_0x88f1('0xcf'))][(_0x88f1('0xd0'))](_0x88f1('0xd8')+_0x92f83f));}_0x126ef3[_0x31a00d[_0x88f1('0x64')][_0x88f1('0xd7')]]=_0x31a00d[_0x88f1('0x64')][_0x88f1('0x99')];})['then'](function(){return db[_0x88f1('0x4b')][_0x88f1('0x61')]({'where':{'id':_0x31a00d['params']['id']},'include':[{'model':db[_0x88f1('0xd9')],'as':'List'},{'model':db[_0x88f1('0xda')],'as':_0x88f1('0xda')}]});})[_0x88f1('0x18')](handleEntityNotFound(_0x159afc,null))[_0x88f1('0x18')](function(_0x1e68c8){if(_0x1e68c8&&_0x1e68c8[_0x88f1('0xb1')]){_0x4442b3=_0x1e68c8;var _0x170707=_[_0x88f1('0x11')](_0x31a00d['body'],{'firstName':_0x31a00d['body'][_0x88f1('0x99')],'phone':_0x31a00d[_0x88f1('0x64')][_0x88f1('0x99')],'ListId':_0x1e68c8['ListId']});_0x170707[_0x31a00d[_0x88f1('0x64')][_0x88f1('0xd7')]]=_0x31a00d[_0x88f1('0x64')]['from'];return db[_0x88f1('0x9e')][_0x88f1('0xdb')]({'where':_0x126ef3,'defaults':_0x170707});}})[_0x88f1('0xdc')](function(_0x1c4d33){if(_0x1c4d33){_0x3be769=_0x1c4d33;var _0x5c8f40=fs[_0x88f1('0xdd')](path[_0x88f1('0x86')](config[_0x88f1('0x87')],_0x88f1('0xde')),_0x88f1('0xdf'));var _0x1f2160=ejs[_0x88f1('0xe0')](_0x5c8f40,{'body':_['toPairs'](_0x31a00d[_0x88f1('0x64')][_0x88f1('0x64')]),'bodyTitle':_0x4442b3['offlineMessageBody']});return db[_0x88f1('0xe1')][_0x88f1('0x62')]({'body':_0x1f2160,'plainBody':htmlToText[_0x88f1('0xe2')](_0x1f2160),'ContactId':_0x1c4d33['id'],'ChatWebsiteId':_0x4442b3['id']});}})[_0x88f1('0x18')](function(_0x13e8a0){_0x14c171=_0x13e8a0;if(_0x16d55f[_0x88f1('0x60')]){var _0x20bbdd=_0x16d55f[_0x88f1('0x4a')](function(_0x5707e7){return{'name':_0x5707e7['originalname'],'basename':_0x5707e7[_0x88f1('0x7e')],'type':_0x5707e7[_0x88f1('0xe3')],'ChatOfflineMessageId':_0x13e8a0['id']};});_0x401f93=_0x20bbdd[_0x88f1('0x4a')](_0x40a5a1=>{var _0x5c3f9e={'filename':_0x40a5a1[_0x88f1('0x30')],'path':path['join'](config[_0x88f1('0x87')],_0x88f1('0xe4'),_0x88f1('0xce'),_0x88f1('0xe5'),_0x88f1('0xe6'),_0x40a5a1['basename'])};return _0x5c3f9e;});if(!_0x4442b3[_0x88f1('0xe7')]){return db[_0x88f1('0xe8')][_0x88f1('0xe9')](function(_0x48a873){return db[_0x88f1('0xea')]['bulkCreate'](_0x20bbdd,{'transaction':_0x48a873});});}}})[_0x88f1('0x18')](function(){if(_0x14c171){_0x4a20e7=_0x14c171;return db[_0x88f1('0xda')][_0x88f1('0x70')]({'where':{'service':!![]},'include':[{'model':db[_0x88f1('0xeb')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x88f1('0xec'),'raw':!![]}]}]});}})['then'](function(_0x5eff5f){if(_0x5eff5f&&_0x5eff5f[_0x88f1('0xed')]&&_0x4442b3[_0x88f1('0xee')]&&_0x4442b3['forwardOfflineAddress']){var _0x1a6ceb=_0x5eff5f[_0x88f1('0xef')]();return respondWithRpcPromise('SendMail',_0x88f1('0xf0'),{'account':_0x1a6ceb,'message':{'from':util['format'](_0x88f1('0xf1'),_0x5eff5f['name'],_0x5eff5f['email']||_0x5eff5f[_0x88f1('0xed')][_0x88f1('0x69')]),'to':_0x4442b3['forwardOfflineAddress'],'subject':_0x4442b3['offlineMessageSubject'],'html':_0x4a20e7[_0x88f1('0x64')],'attachments':_0x401f93}},client9003)[_0x88f1('0x18')](function(){return _0x4a20e7;})[_0x88f1('0x20')](function(_0x22bbea){logger[_0x88f1('0x1b')](_0x22bbea);});}})[_0x88f1('0x18')](function(){if(_0x4442b3&&_0x4442b3[_0x88f1('0xe7')]&&_0x4442b3['MailAccountId']){var _0xb99085=[];if(_0x16d55f['length']){_0xb99085=_0x16d55f[_0x88f1('0x4a')](function(_0x2effa9){return{'name':_0x2effa9[_0x88f1('0xf2')],'basename':_0x2effa9[_0x88f1('0x7e')],'type':_0x2effa9[_0x88f1('0xe3')],'ChatOfflineMessageId':_0x14c171['id']};});}var _0x595b3e;if(!_[_0x88f1('0x8b')](_0x4442b3[_0x88f1('0xf3')])){var _0x11df81=_[_0x88f1('0x4a')](_0x31a00d[_0x88f1('0x64')],function(_0x33baf1){return _0x33baf1;});var _0x5ccfb0=_[_0x88f1('0xf4')](_0x11df81)[0x0];var _0x44665e=_[_0x88f1('0xf5')](_0x5ccfb0,function(_0x3d5d43){return _0x3d5d43;});_0x595b3e=_0x44665e[0x1][_0x4442b3[_0x88f1('0xf3')]];}var _0x568e09={'from':_0x3be769['email'],'firstName':_0x3be769[_0x88f1('0x39')],'lastName':_0x3be769[_0x88f1('0x3a')],'mapKey':_0x88f1('0xf6'),'message':{'from':_0x3be769[_0x88f1('0xf6')],'to':_0x4442b3[_0x88f1('0xda')][_0x88f1('0xf6')],'cc':'','subject':_[_0x88f1('0x8b')](_0x595b3e)?_0x4442b3['offlineMessageSubject']:_0x595b3e,'messageId':'','sentAt':new Date(),'attach':_0xb99085['length'],'attachments':_0xb99085,'originChannel':_0x88f1('0xf7'),'ChatWebsiteId':_0x4442b3['id'],'ChatOfflineMessageId':_0x4a20e7['id'],'originTo':_0x4442b3['MailAccount'][_0x88f1('0xf6')]},'body':_0x4a20e7[_0x88f1('0x64')]};var _0x2436b1={'account':{'id':_0x4442b3[_0x88f1('0xf8')]},'body':_0x568e09,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x88f1('0xf9'),'notifyMail',_0x2436b1,client9001)[_0x88f1('0x18')](function(){return _0x4a20e7;})['catch'](function(_0xf06bd1){logger[_0x88f1('0x1b')](_0xf06bd1);});}return;})[_0x88f1('0x18')](function(){if(_0x4a20e7){return _0x4a20e7;}})[_0x88f1('0x18')](respondWithResult(_0x159afc,null))[_0x88f1('0x20')](function(){for(var _0x4dbe94 of _0x16d55f){var _0x285f32=path[_0x88f1('0x86')](config['root'],'server',_0x88f1('0xce'),_0x88f1('0xe5'),_0x88f1('0xe6'),_0x4dbe94[_0x88f1('0x7e')]);fs_extra[_0x88f1('0xfa')](_0x285f32)[_0x88f1('0x20')](function(_0x5d0db9){logger[_0x88f1('0x1b')](_0x88f1('0xfb'),_0x285f32,_0x5d0db9);});}});};exports['addInteraction']=function(_0x3a87e4,_0x5ee78e){return db[_0x88f1('0xba')][_0x88f1('0x61')]({'where':{'id':_0x3a87e4[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x5ee78e,null))[_0x88f1('0x18')](function(_0x16744f){if(_0x16744f){return _0x16744f[_0x88f1('0xfc')](_0x3a87e4[_0x88f1('0x64')]['ids'],_[_0x88f1('0xfd')](_0x3a87e4['body'],[_0x88f1('0x75'),'id'])||{});}})[_0x88f1('0x18')](respondWithResult(_0x5ee78e,null))[_0x88f1('0x20')](handleError(_0x5ee78e,null));};exports[_0x88f1('0xfe')]=function(_0x34b907,_0xa872ca){var _0x1bd933={'raw':![],'where':{}};var _0x40ed14={};var _0x257da4={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x88f1('0x70')]({'where':{'id':_0x34b907['params']['id']}})['then'](handleEntityNotFound(_0xa872ca,null))['then'](function(_0xac0fe7){if(_0xac0fe7){_0x40ed14[_0x88f1('0x43')]=_[_0x88f1('0x4e')](db[_0x88f1('0xba')][_0x88f1('0x5f')]);_0x40ed14[_0x88f1('0x4d')]=_[_0x88f1('0x4e')](_0x34b907['query']);_0x40ed14[_0x88f1('0x4f')]=_[_0x88f1('0x50')](_0x40ed14['model'],_0x40ed14['query']);_0x1bd933['attributes']=_[_0x88f1('0x50')](_0x40ed14[_0x88f1('0x43')],qs['fields'](_0x34b907[_0x88f1('0x4d')]['fields']));_0x1bd933[_0x88f1('0x52')]=_0x1bd933[_0x88f1('0x52')][_0x88f1('0x60')]?_0x1bd933[_0x88f1('0x52')]:_0x40ed14['model'];if(!_0x34b907[_0x88f1('0x4d')][_0x88f1('0x79')](_0x88f1('0x53'))){_0x1bd933[_0x88f1('0x25')]=qs[_0x88f1('0x25')](_0x34b907[_0x88f1('0x4d')][_0x88f1('0x25')]);_0x1bd933[_0x88f1('0x27')]=qs[_0x88f1('0x27')](_0x34b907[_0x88f1('0x4d')][_0x88f1('0x27')]);}_0x1bd933['order']=qs[_0x88f1('0x55')](_0x34b907[_0x88f1('0x4d')][_0x88f1('0x55')]);_0x1bd933[_0x88f1('0x56')]=qs['filters'](_[_0x88f1('0x7a')](_0x34b907[_0x88f1('0x4d')],_0x40ed14[_0x88f1('0x4f')]));_0x1bd933[_0x88f1('0x56')][_0x88f1('0x6e')]=_0xac0fe7['id'];if(_0x34b907[_0x88f1('0x4d')]['filter']){_0x1bd933['where']=_[_0x88f1('0x57')](_0x1bd933[_0x88f1('0x56')],{'$or':_['map'](_0x1bd933[_0x88f1('0x52')],function(_0x39075a){var _0x2475e5={};_0x2475e5[_0x39075a]={'$like':'%'+_0x34b907['query'][_0x88f1('0x59')]+'%'};return _0x2475e5;})});}_0x1bd933=_['merge']({},_0x1bd933,_0x34b907[_0x88f1('0x72')]);return db['ChatInteraction'][_0x88f1('0x26')]({'where':_0x1bd933[_0x88f1('0x56')]})[_0x88f1('0x18')](function(_0x470bab){_0x257da4[_0x88f1('0x26')]=_0x470bab;if(_0x34b907[_0x88f1('0x4d')][_0x88f1('0x5a')]){_0x1bd933['include']=[{'model':db[_0x88f1('0x9e')],'as':_0x88f1('0xff'),'required':![]},{'model':db[_0x88f1('0x100')],'as':_0x88f1('0x101'),'attributes':[_0x88f1('0x30'),_0x88f1('0x102'),_0x88f1('0x103')],'required':![]},{'model':db[_0x88f1('0x104')],'as':_0x88f1('0x105'),'attributes':['id',_0x88f1('0x30'),_0x88f1('0x106')],'where':_0x34b907['query']['tag']?{'id':_0x34b907['query'][_0x88f1('0x107')]}:undefined,'required':_0x34b907[_0x88f1('0x4d')][_0x88f1('0x107')]?!![]:![]}];}return db[_0x88f1('0xba')][_0x88f1('0x73')](_0x1bd933);})['then'](function(_0x55f65f){_0x257da4[_0x88f1('0x5c')]=_0x55f65f;return _0x257da4;});}})[_0x88f1('0x18')](respondWithFilteredResult(_0xa872ca,_0x1bd933))[_0x88f1('0x20')](handleError(_0xa872ca,null));};exports['getSnippet']=function(_0x3413c6,_0x486082){var _0x25241b=0x0;var _0x10e9dc=0x0;var _0x325134=![];var _0x18f7b3;var _0x5163ff;return db[_0x88f1('0x4b')][_0x88f1('0x61')]({'where':{'id':_0x3413c6[_0x88f1('0x5e')]['id']},'include':[{'model':db[_0x88f1('0x95')],'as':_0x88f1('0x95'),'include':[{'model':db[_0x88f1('0x95')],'as':_0x88f1('0xa9'),'attributes':['id','interval']}]}]})[_0x88f1('0x18')](handleEntityNotFound(_0x486082,null))[_0x88f1('0x18')](function(_0x243b2c){if(_0x243b2c){_0x18f7b3=_0x243b2c;return _0x243b2c[_0x88f1('0x108')]({'raw':!![]});}})[_0x88f1('0x18')](function(_0x3d4d4f){if(_0x18f7b3){if(_0x3d4d4f){_0x5163ff=_0x3d4d4f;}}return require('../../config/license/util')['getLicense']();})[_0x88f1('0x18')](function(_0x297967){if(_0x297967){_0x10e9dc=_0x297967[_0x88f1('0x109')];_0x325134=_0x297967[_0x88f1('0x10a')];}})[_0x88f1('0x18')](function(){return db[_0x88f1('0xba')]['count']({'where':{'closed':![]}});})['then'](function(_0x1cc900){_0x25241b=_0x1cc900;if(_0x10e9dc&&_0x1cc900>_0x10e9dc){return db[_0x88f1('0x10b')]['findOne']({'where':{'id':0x1}})['then'](function(_0x1c8638){if(_0x1c8638){_0x1c8638[_0x88f1('0x10c')](_0x88f1('0x10d'));}});}})[_0x88f1('0x18')](function(){var _0xa0bcf1=_0x18f7b3['Interval'];var _0xc61771=_0x18f7b3[_0x88f1('0x97')]||undefined;return _0xa0bcf1?_0xa0bcf1[_0x88f1('0x10e')](_0xc61771):!![];})[_0x88f1('0x18')](function(_0x65f75d){var _0x7f535e=fs[_0x88f1('0xdd')](path[_0x88f1('0x86')](config['root'],_0x88f1('0x10f')),'utf8');var _0x2c9c08='3.9.0';var _0x4832cf=![];try{const _0x15069c=new URL(_0x18f7b3[_0x88f1('0x65')]);_0x18f7b3[_0x88f1('0x65')]=_0x15069c[_0x88f1('0x110')];}catch(_0x134183){}var _0x59b40e;if(_0x3413c6[_0x88f1('0xb3')][_0x88f1('0x3c')]){_0x3413c6[_0x88f1('0xb3')][_0x88f1('0x3c')]=_0x3413c6['headers'][_0x88f1('0x3c')]['replace'](/\/$/,'');_0x59b40e=wildcardUtils[_0x88f1('0x111')](_0x18f7b3[_0x88f1('0x65')],_0x3413c6['headers'][_0x88f1('0x3c')]);}else{_0x3413c6['headers'][_0x88f1('0x3c')]=_0x18f7b3[_0x88f1('0x65')];_0x59b40e=!![];}var _0x11ea93={'chatVersion':_0x2c9c08,'chatWebsiteAddressOrigin':_0x59b40e?_0x3413c6['headers']['referer']:_0x18f7b3[_0x88f1('0x65')],'remote':_0x18f7b3[_0x88f1('0x112')],'query':querystring[_0x88f1('0x46')](_[_0x88f1('0x57')](_0x18f7b3[_0x88f1('0x2c')]({'plain':!![]}),{'customerIp':_0x3413c6[_0x88f1('0xb3')][_0x88f1('0x37')]||_0x3413c6[_0x88f1('0xb3')][_0x88f1('0x113')]||_0x3413c6[_0x88f1('0x114')][_0x88f1('0x115')]||_0x3413c6['ip'],'referer':_0x3413c6[_0x88f1('0xb3')]['referer'],'openedInteractions':_0x25241b,'maxInteractions':_0x10e9dc,'virtual':_0x325134['virtual'],'online':_0x65f75d,'custom':_0x325134,'address':_0x59b40e?_0x3413c6[_0x88f1('0xb3')][_0x88f1('0x3c')]:null}))['replace'](/'/g,'\x5c\x27')};_0x486082[_0x88f1('0xd3')](ejs['render'](Mustache['render'](_0x7f535e,_0x11ea93),{'proactiveActions':_0x5163ff,'alignment':_0x18f7b3[_0x88f1('0x116')],'verticalAlignment':_0x18f7b3[_0x88f1('0x117')],'div_color':_0x18f7b3[_0x88f1('0x106')],'labelText':_0x18f7b3[_0x88f1('0x118')],'text_color':_0x18f7b3[_0x88f1('0x119')],'text_button_color':_0x18f7b3['textButtonColor'],'button_color':_0x18f7b3['color_button'],'background_color':_0x18f7b3[_0x88f1('0x11a')],'hideWhenOffline':_0x18f7b3['hideWhenOffline'],'intervalId':_0x18f7b3[_0x88f1('0x11b')],'isDevelopment':_0x4832cf,'chatVersion':_0x2c9c08}));})['catch'](handleError(_0x486082,null));};exports[_0x88f1('0x11c')]=function(_0x276c5e,_0x596f1f){var _0x327ee2=_0x276c5e[_0x88f1('0x5e')]['id'];var _0x2465c4=_0x276c5e[_0x88f1('0x64')];var _0x415daf=0xc8;var _0x3a873c=null;return db[_0x88f1('0xe8')][_0x88f1('0xe9')]({'isolationLevel':db[_0x88f1('0xe8')][_0x88f1('0x11d')][_0x88f1('0x11e')][_0x88f1('0x11f')]},function(_0x3c0b75){return db['ChatWebsite'][_0x88f1('0x70')]({'where':{'id':_0x327ee2},'transaction':_0x3c0b75})[_0x88f1('0x18')](function(_0x2bb75a){if(_0x2bb75a){return db[_0x88f1('0xa7')]['destroy']({'where':{'ChatWebsiteId':_0x327ee2},'transaction':_0x3c0b75})['then'](function(){var _0x775ca7=_['map'](_0x2465c4,function(_0x5447e2){_0x5447e2[_0x88f1('0x6e')]=_0x327ee2;return _0x5447e2;});return db[_0x88f1('0xa7')][_0x88f1('0x120')](_0x775ca7,{'transaction':_0x3c0b75});});}else{_0x415daf=0x194;_0x3a873c=[];}});})[_0x88f1('0x18')](function(){if(_0x415daf!==0x194){return db[_0x88f1('0xa7')][_0x88f1('0x121')]({'where':{'ChatWebsiteId':_0x327ee2},'order':_0x88f1('0x122')})[_0x88f1('0x18')](function(_0x4c8b0b){_0x3a873c=_0x4c8b0b;});}})['catch'](function(_0x3afecd){_0x415daf=0x1f4;logger[_0x88f1('0x1b')](_0x3afecd[_0x88f1('0x2f')]);if(_0x3afecd['name']){delete _0x3afecd[_0x88f1('0x30')];}_0x3a873c=_0x3afecd;})[_0x88f1('0x123')](function(){if(_0x3a873c===null){_0x596f1f[_0x88f1('0x2e')](_0x415daf);}else{if(_0x415daf===0x1f4){_0x596f1f[_0x88f1('0x21')](_0x415daf)[_0x88f1('0xd3')](_0x3a873c);}else{_0x596f1f[_0x88f1('0x21')](_0x415daf)[_0x88f1('0x23')](_0x3a873c);}}});};exports['getApplications']=function(_0x4cea83,_0x1d1b61){var _0x5d9d08={};var _0x5cfbfb={};var _0x54bd4e;var _0xb72908;return db[_0x88f1('0x4b')][_0x88f1('0x70')]({'where':{'id':_0x4cea83['params']['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x1d1b61,null))[_0x88f1('0x18')](function(_0x211915){if(_0x211915){_0x54bd4e=_0x211915;_0x5cfbfb[_0x88f1('0x43')]=_['keys'](db[_0x88f1('0xa7')][_0x88f1('0x5f')]);_0x5cfbfb[_0x88f1('0x4d')]=_[_0x88f1('0x4e')](_0x4cea83['query']);_0x5cfbfb[_0x88f1('0x4f')]=_[_0x88f1('0x50')](_0x5cfbfb[_0x88f1('0x43')],_0x5cfbfb['query']);_0x5d9d08[_0x88f1('0x52')]=_['intersection'](_0x5cfbfb['model'],qs[_0x88f1('0x51')](_0x4cea83[_0x88f1('0x4d')][_0x88f1('0x51')]));_0x5d9d08['attributes']=_0x5d9d08[_0x88f1('0x52')][_0x88f1('0x60')]?_0x5d9d08[_0x88f1('0x52')]:_0x5cfbfb[_0x88f1('0x43')];_0x5d9d08[_0x88f1('0x54')]=qs[_0x88f1('0x55')](_0x4cea83[_0x88f1('0x4d')][_0x88f1('0x55')]);_0x5d9d08[_0x88f1('0x56')]=qs[_0x88f1('0x4f')](_[_0x88f1('0x7a')](_0x4cea83[_0x88f1('0x4d')],_0x5cfbfb[_0x88f1('0x4f')]));if(_0x4cea83[_0x88f1('0x4d')][_0x88f1('0x59')]){_0x5d9d08[_0x88f1('0x56')]=_[_0x88f1('0x57')](_0x5d9d08[_0x88f1('0x56')],{'$or':_[_0x88f1('0x4a')](_0x5d9d08[_0x88f1('0x52')],function(_0x17a906){var _0x4f3ae1={};_0x4f3ae1[_0x17a906]={'$like':'%'+_0x4cea83[_0x88f1('0x4d')]['filter']+'%'};return _0x4f3ae1;})});}_0x5d9d08=_[_0x88f1('0x57')]({},_0x5d9d08,_0x4cea83[_0x88f1('0x72')]);return _0x54bd4e[_0x88f1('0x124')](_0x5d9d08);}})[_0x88f1('0x18')](function(_0x2817bd){if(_0x2817bd){_0xb72908=_0x2817bd[_0x88f1('0x60')];if(!_0x4cea83['query']['hasOwnProperty']('nolimit')){_0x5d9d08[_0x88f1('0x25')]=qs[_0x88f1('0x25')](_0x4cea83['query'][_0x88f1('0x25')]);_0x5d9d08['offset']=qs[_0x88f1('0x27')](_0x4cea83['query'][_0x88f1('0x27')]);}return _0x54bd4e[_0x88f1('0x124')](_0x5d9d08);}})[_0x88f1('0x18')](function(_0x2c0129){if(_0x2c0129){return _0x2c0129?{'count':_0xb72908,'rows':_0x2c0129}:null;}})[_0x88f1('0x18')](respondWithResult(_0x1d1b61,null))[_0x88f1('0x20')](handleError(_0x1d1b61,null));};exports['addProactiveActions']=function(_0x7e8650,_0x519f7f){return db[_0x88f1('0x125')]['find']({'where':{'id':_0x7e8650[_0x88f1('0x5e')]['id']}})['then'](handleEntityNotFound(_0x519f7f,null))[_0x88f1('0x18')](function(_0x5133be){if(_0x5133be){return _0x5133be[_0x88f1('0x126')](_0x7e8650[_0x88f1('0x64')]['ids'],_[_0x88f1('0xfd')](_0x7e8650[_0x88f1('0x64')],['ids','id'])||{});}})[_0x88f1('0x18')](respondWithResult(_0x519f7f,null))[_0x88f1('0x20')](handleError(_0x519f7f,null));};exports[_0x88f1('0x108')]=function(_0xc294f6,_0x2f25cc){var _0x2c885e={};var _0xd70b87={};var _0x5d68b4;var _0xf5f532;return db[_0x88f1('0x4b')][_0x88f1('0x70')]({'where':{'id':_0xc294f6[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x2f25cc,null))[_0x88f1('0x18')](function(_0x413322){if(_0x413322){_0x5d68b4=_0x413322;_0xd70b87[_0x88f1('0x43')]=_[_0x88f1('0x4e')](db[_0x88f1('0x127')][_0x88f1('0x5f')]);_0xd70b87['query']=_[_0x88f1('0x4e')](_0xc294f6[_0x88f1('0x4d')]);_0xd70b87[_0x88f1('0x4f')]=_[_0x88f1('0x50')](_0xd70b87[_0x88f1('0x43')],_0xd70b87[_0x88f1('0x4d')]);_0x2c885e[_0x88f1('0x52')]=_['intersection'](_0xd70b87[_0x88f1('0x43')],qs[_0x88f1('0x51')](_0xc294f6[_0x88f1('0x4d')][_0x88f1('0x51')]));_0x2c885e[_0x88f1('0x52')]=_0x2c885e[_0x88f1('0x52')][_0x88f1('0x60')]?_0x2c885e[_0x88f1('0x52')]:_0xd70b87[_0x88f1('0x43')];_0x2c885e[_0x88f1('0x54')]=qs[_0x88f1('0x55')](_0xc294f6['query'][_0x88f1('0x55')]);_0x2c885e[_0x88f1('0x56')]=qs[_0x88f1('0x4f')](_['pick'](_0xc294f6[_0x88f1('0x4d')],_0xd70b87[_0x88f1('0x4f')]));if(_0xc294f6[_0x88f1('0x4d')][_0x88f1('0x59')]){_0x2c885e['where']=_[_0x88f1('0x57')](_0x2c885e[_0x88f1('0x56')],{'$or':_[_0x88f1('0x4a')](_0x2c885e[_0x88f1('0x52')],function(_0x3b4e2d){var _0x56b4ac={};_0x56b4ac[_0x3b4e2d]={'$like':'%'+_0xc294f6[_0x88f1('0x4d')][_0x88f1('0x59')]+'%'};return _0x56b4ac;})});}_0x2c885e=_[_0x88f1('0x57')]({},_0x2c885e,_0xc294f6[_0x88f1('0x72')]);return _0x5d68b4[_0x88f1('0x108')](_0x2c885e);}})[_0x88f1('0x18')](function(_0x58370a){if(_0x58370a){_0xf5f532=_0x58370a[_0x88f1('0x60')];if(!_0xc294f6[_0x88f1('0x4d')]['hasOwnProperty'](_0x88f1('0x53'))){_0x2c885e[_0x88f1('0x25')]=qs['limit'](_0xc294f6[_0x88f1('0x4d')][_0x88f1('0x25')]);_0x2c885e[_0x88f1('0x27')]=qs[_0x88f1('0x27')](_0xc294f6['query'][_0x88f1('0x27')]);}return _0x5d68b4[_0x88f1('0x108')](_0x2c885e);}})[_0x88f1('0x18')](function(_0x56954f){if(_0x56954f){return _0x56954f?{'count':_0xf5f532,'rows':_0x56954f}:null;}})[_0x88f1('0x18')](respondWithResult(_0x2f25cc,null))['catch'](handleError(_0x2f25cc,null));};exports[_0x88f1('0x128')]=function(_0x2f482b,_0x2f98c9){var _0x145a72=_0x2f482b[_0x88f1('0x4d')]['online']===_0x88f1('0x129')?'offlineForm':_0x88f1('0x12a');return db[_0x88f1('0x4b')][_0x88f1('0x61')]({'attributes':['id',_0x145a72],'where':{'id':_0x2f482b[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x2f98c9,null))[_0x88f1('0x18')](function(_0x2dc831){if(_0x2dc831){var _0xa3b891=_0x2dc831[_0x145a72];var _0x1f0085=_0xa3b891&&_0xa3b891[_0x88f1('0x12b')]?_0xa3b891[_0x88f1('0x12b')]:[];_0x2f98c9[_0x88f1('0xd3')]({'fromKey':_['isNil'](_0xa3b891[_0x88f1('0x12c')])?undefined:_0xa3b891['fromKey'],'count':_0x1f0085[_0x88f1('0x60')],'rows':_0x1f0085});}})[_0x88f1('0x20')](handleError(_0x2f98c9,null));};exports[_0x88f1('0x12d')]=function(_0x5eb043,_0xe6f462){var _0x336d44={'raw':![],'where':{}};var _0x3cad62={};var _0x4abc8d={'count':0x0,'rows':[]};return db[_0x88f1('0x4b')][_0x88f1('0x70')]({'where':{'id':_0x5eb043[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0xe6f462,null))['then'](function(_0x1600a1){if(_0x1600a1){_0x3cad62[_0x88f1('0x43')]=_['keys'](db[_0x88f1('0xe1')][_0x88f1('0x5f')]);_0x3cad62[_0x88f1('0x4d')]=_[_0x88f1('0x4e')](_0x5eb043[_0x88f1('0x4d')]);_0x3cad62[_0x88f1('0x4f')]=_[_0x88f1('0x50')](_0x3cad62[_0x88f1('0x43')],_0x3cad62['query']);_0x336d44[_0x88f1('0x52')]=_[_0x88f1('0x50')](_0x3cad62[_0x88f1('0x43')],qs[_0x88f1('0x51')](_0x5eb043[_0x88f1('0x4d')]['fields']));_0x336d44['attributes']=_0x336d44[_0x88f1('0x52')]['length']?_0x336d44[_0x88f1('0x52')]:_0x3cad62['model'];if(!_0x5eb043[_0x88f1('0x4d')]['hasOwnProperty'](_0x88f1('0x53'))){_0x336d44['limit']=qs[_0x88f1('0x25')](_0x5eb043['query']['limit']);_0x336d44[_0x88f1('0x27')]=qs[_0x88f1('0x27')](_0x5eb043[_0x88f1('0x4d')]['offset']);}_0x336d44[_0x88f1('0x54')]=qs[_0x88f1('0x55')](_0x5eb043['query'][_0x88f1('0x55')]);_0x336d44[_0x88f1('0x56')]=qs[_0x88f1('0x4f')](_[_0x88f1('0x7a')](_0x5eb043['query'],_0x3cad62[_0x88f1('0x4f')]));_0x336d44[_0x88f1('0x56')][_0x88f1('0x6e')]=_0x1600a1['id'];if(_0x5eb043[_0x88f1('0x4d')][_0x88f1('0x59')]){_0x336d44[_0x88f1('0x56')]=_[_0x88f1('0x57')](_0x336d44[_0x88f1('0x56')],{'$or':_[_0x88f1('0x4a')](_0x336d44['attributes'],function(_0x33a024){var _0x4ec371={};_0x4ec371[_0x33a024]={'$like':'%'+_0x5eb043['query']['filter']+'%'};return _0x4ec371;})});}_0x336d44=_[_0x88f1('0x57')]({},_0x336d44,_0x5eb043[_0x88f1('0x72')]);return db[_0x88f1('0xe1')][_0x88f1('0x26')]({'where':_0x336d44[_0x88f1('0x56')]})['then'](function(_0x283a03){_0x4abc8d['count']=_0x283a03;if(_0x5eb043['query'][_0x88f1('0x5a')]){_0x336d44[_0x88f1('0x5b')]=[{'all':!![]}];}else{_0x336d44[_0x88f1('0x5b')]=[{'model':db[_0x88f1('0x9e')],'as':_0x88f1('0xff'),'required':![]},{'model':db['Attachment'],'as':_0x88f1('0x12e'),'required':![]}];}return db[_0x88f1('0xe1')]['findAll'](_0x336d44);})['then'](function(_0x214833){_0x4abc8d[_0x88f1('0x5c')]=_0x214833;return _0x4abc8d;});}})['then'](respondWithFilteredResult(_0xe6f462,_0x336d44))[_0x88f1('0x20')](handleError(_0xe6f462,null));};exports[_0x88f1('0x12f')]=function(_0x3a5507,_0x3abb1b){return db[_0x88f1('0x4b')][_0x88f1('0x61')]({'where':{'id':_0x3a5507[_0x88f1('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3abb1b,null))[_0x88f1('0x18')](function(_0x165a57){if(_0x165a57){return _0x165a57['addAgents'](_0x3a5507[_0x88f1('0x64')][_0x88f1('0x75')],_['omit'](_0x3a5507[_0x88f1('0x64')],['ids','id'])||{})[_0x88f1('0xdc')](function(_0x3b898d){for(var _0x18ada9=0x0;_0x18ada9<_0x3a5507['body'][_0x88f1('0x75')][_0x88f1('0x60')];_0x18ada9+=0x1){socket[_0x88f1('0x130')]('userChatWebsite:save',{'UserId':Number(_0x3a5507[_0x88f1('0x64')][_0x88f1('0x75')][_0x18ada9]),'ChatWebsiteId':Number(_0x3a5507['params']['id'])});}return _0x3b898d;});}})['then'](respondWithResult(_0x3abb1b,null))['catch'](handleError(_0x3abb1b,null));};exports[_0x88f1('0x131')]=function(_0x269656,_0x4dfbaf){return db[_0x88f1('0x4b')]['find']({'where':{'id':_0x269656[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x4dfbaf,null))[_0x88f1('0x18')](function(_0x4d096b){if(_0x4d096b){return _0x4d096b[_0x88f1('0x131')](_0x269656[_0x88f1('0x4d')][_0x88f1('0x75')])[_0x88f1('0x18')](function(){if(_[_0x88f1('0x132')](_0x269656['query']['ids'])){for(var _0x4a5026=0x0;_0x4a5026<_0x269656[_0x88f1('0x4d')][_0x88f1('0x75')]['length'];_0x4a5026+=0x1){socket[_0x88f1('0x130')](_0x88f1('0x133'),{'UserId':Number(_0x269656['query'][_0x88f1('0x75')][_0x4a5026]),'ChatWebsiteId':Number(_0x269656[_0x88f1('0x5e')]['id'])});}}else{socket[_0x88f1('0x130')](_0x88f1('0x133'),{'UserId':Number(_0x269656[_0x88f1('0x4d')][_0x88f1('0x75')]),'ChatWebsiteId':Number(_0x269656[_0x88f1('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0x4dfbaf,null))[_0x88f1('0x20')](handleError(_0x4dfbaf,null));};exports[_0x88f1('0x134')]=function(_0x4c8b37,_0x5032df){var _0x35fe29={};var _0x391773={};var _0x5d3e76;var _0x1fce16;return db[_0x88f1('0x4b')]['findOne']({'where':{'id':_0x4c8b37['params']['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x5032df,null))[_0x88f1('0x18')](function(_0x28c69d){if(_0x28c69d){_0x5d3e76=_0x28c69d;_0x391773[_0x88f1('0x43')]=_[_0x88f1('0x4e')](db[_0x88f1('0x100')]['rawAttributes']);_0x391773[_0x88f1('0x4d')]=_[_0x88f1('0x4e')](_0x4c8b37[_0x88f1('0x4d')]);_0x391773[_0x88f1('0x4f')]=_[_0x88f1('0x50')](_0x391773[_0x88f1('0x43')],_0x391773['query']);_0x35fe29[_0x88f1('0x52')]=_[_0x88f1('0x50')](_0x391773['model'],qs[_0x88f1('0x51')](_0x4c8b37['query']['fields']));_0x35fe29[_0x88f1('0x52')]=_0x35fe29['attributes'][_0x88f1('0x60')]?_0x35fe29['attributes']:_0x391773['model'];_0x35fe29['order']=qs['sort'](_0x4c8b37[_0x88f1('0x4d')][_0x88f1('0x55')]);_0x35fe29[_0x88f1('0x56')]=qs[_0x88f1('0x4f')](_['pick'](_0x4c8b37[_0x88f1('0x4d')],_0x391773[_0x88f1('0x4f')]));if(_0x4c8b37[_0x88f1('0x4d')][_0x88f1('0x59')]){_0x35fe29[_0x88f1('0x56')]=_[_0x88f1('0x57')](_0x35fe29[_0x88f1('0x56')],{'$or':_[_0x88f1('0x4a')](_0x35fe29[_0x88f1('0x52')],function(_0x33fbea){var _0x57d4d3={};_0x57d4d3[_0x33fbea]={'$like':'%'+_0x4c8b37[_0x88f1('0x4d')][_0x88f1('0x59')]+'%'};return _0x57d4d3;})});}_0x35fe29=_['merge']({},_0x35fe29,_0x4c8b37['options']);return _0x5d3e76['getAgents'](_0x35fe29);}})[_0x88f1('0x18')](function(_0x1aaa83){if(_0x1aaa83){_0x1fce16=_0x1aaa83[_0x88f1('0x60')];if(!_0x4c8b37['query'][_0x88f1('0x79')]('nolimit')){_0x35fe29[_0x88f1('0x25')]=qs[_0x88f1('0x25')](_0x4c8b37['query']['limit']);_0x35fe29['offset']=qs['offset'](_0x4c8b37['query']['offset']);}return _0x5d3e76[_0x88f1('0x134')](_0x35fe29);}})[_0x88f1('0x18')](function(_0xeac71c){if(_0xeac71c){return _0xeac71c?{'count':_0x1fce16,'rows':_0xeac71c}:null;}})[_0x88f1('0x18')](respondWithResult(_0x5032df,null))[_0x88f1('0x20')](handleError(_0x5032df,null));}; \ No newline at end of file +var _0xee46=['first','split','firstName','lastName','x-real-port','version','format','%s\x20%s','browser','unknown','device','model','vendor','%s\x20%s\x20%s','type','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','keys','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','address','body','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','describe','addDisposition','ChatWebsiteId','Disposition','hasOwnProperty','removeDispositions','ids','CannedAnswer','findOne','nolimit','removeAnswers','addLogo','sitepic','filename','addAvatar','file','addCustomerAvatar','systemAvatar','getLogo','join','root','../../config/license/util','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','timezone','ifTime','notify','chat','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','referer','CmContact','No\x20available\x20attributes','includes','createdAt','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','Contacts','updatedAt','DESC','ChatApplication','Applications','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','applications','priority','list','contact','headers','threadId','closed','externalUrl','ChatInteraction','ContactId','interaction','messageId','created','account','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','waitForTheAssignedQueue','Start','startRouting','EventManager','files','Sequelize','ValidationError','no\x20available\x20attributes','CompanyId','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','fromString','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','addInteraction','fullname','internal','Tags','tag','getSnippet','getProactiveActions','getLicense','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.9.0','origin','replace','testWebsiteWithWildcard','x-real-ip','connection','alignment','color','labelText','textColor','textButtonColor','backgroundColor','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','omit','getFields','online','false','offlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','util','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/environment','APIBadRequestError','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','URL','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','update','destroy','ChatWebsites','UserProfileResource','name','user-agent-parser','setUA','user-agent','customerIp','x-forwarded-for'];(function(_0x4fe5b5,_0x41efab){var _0x221fbe=function(_0x35fd94){while(--_0x35fd94){_0x4fe5b5['push'](_0x4fe5b5['shift']());}};_0x221fbe(++_0x41efab);}(_0xee46,0xf2));var _0x6ee4=function(_0x246251,_0x5974c0){_0x246251=_0x246251-0x0;var _0x58d5ee=_0xee46[_0x246251];return _0x58d5ee;};'use strict';var Mustache=require('mustache');var util=require(_0x6ee4('0x0'));var path=require(_0x6ee4('0x1'));var ejs=require(_0x6ee4('0x2'));var fs=require('fs');var fs_extra=require(_0x6ee4('0x3'));var _=require(_0x6ee4('0x4'));var querystring=require(_0x6ee4('0x5'));var htmlToText=require('html-to-text');var Redis=require(_0x6ee4('0x6'));var jayson=require(_0x6ee4('0x7'));var qs=require(_0x6ee4('0x8'));var logger=require(_0x6ee4('0x9'))(_0x6ee4('0xa'));var config=require(_0x6ee4('0xb'));var APIBadRequestError=require('../../errors/api')[_0x6ee4('0xc')];var APINotFoundError=require(_0x6ee4('0xd'))[_0x6ee4('0xe')];var APIOutOfIntervalError=require(_0x6ee4('0xd'))[_0x6ee4('0xf')];var APIHandleError=require(_0x6ee4('0xd'))[_0x6ee4('0x10')];var APIConflictError=require(_0x6ee4('0xd'))[_0x6ee4('0x11')];var wildcardUtils=require(_0x6ee4('0x12'));var URL=require('url')[_0x6ee4('0x13')];var db=require('../../mysqldb')['db'];config[_0x6ee4('0x14')]=_[_0x6ee4('0x15')](config['redis'],{'host':_0x6ee4('0x16'),'port':0x18eb});var socket=require(_0x6ee4('0x17'))(new Redis(config['redis']));require(_0x6ee4('0x18'))[_0x6ee4('0x19')](socket);var client=jayson[_0x6ee4('0x1a')]['http']({'port':0x232c});var client9002=jayson['client'][_0x6ee4('0x1b')]({'port':0x232a});var client9003=jayson[_0x6ee4('0x1a')][_0x6ee4('0x1b')]({'port':0x232b});var client9001=jayson[_0x6ee4('0x1a')][_0x6ee4('0x1b')]({'port':0x2329});function respondWithRpcPromise(_0x2eca80,_0x4af711,_0x2af5f8,_0x4ba6dc){return new Promise(function(_0x2886c2,_0x4c1192){var _0x9d4ae8=_0x4ba6dc||client;return _0x9d4ae8['request'](_0x2eca80,_0x2af5f8)[_0x6ee4('0x1c')](function(_0x3cdcae){logger[_0x6ee4('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x4af711,_0x6ee4('0x1e'));logger[_0x6ee4('0x1f')](_0x6ee4('0x20'),_0x4af711,'request\x20sent',JSON[_0x6ee4('0x21')](_0x3cdcae));if(_0x3cdcae[_0x6ee4('0x22')]){if(_0x3cdcae[_0x6ee4('0x22')][_0x6ee4('0x23')]===0x1f4){logger[_0x6ee4('0x22')](_0x6ee4('0x24'),_0x4af711,_0x3cdcae[_0x6ee4('0x22')][_0x6ee4('0x25')]);return _0x4c1192(_0x3cdcae[_0x6ee4('0x22')]['message']);}logger[_0x6ee4('0x22')](_0x6ee4('0x24'),_0x4af711,_0x3cdcae[_0x6ee4('0x22')][_0x6ee4('0x25')]);return _0x2886c2(_0x3cdcae[_0x6ee4('0x22')]['message']);}else{logger[_0x6ee4('0x1d')](_0x6ee4('0x24'),_0x4af711,_0x6ee4('0x1e'));_0x2886c2(_0x3cdcae[_0x6ee4('0x26')]['message']);}})[_0x6ee4('0x27')](function(_0x293d0b){logger[_0x6ee4('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x4af711,_0x293d0b);_0x4c1192(_0x293d0b);});});}function respondWithStatusCode(_0x5639e5,_0x520dd2){_0x520dd2=_0x520dd2||0xcc;return function(_0x18efa3){if(_0x18efa3){return _0x5639e5[_0x6ee4('0x28')](_0x520dd2);}return _0x5639e5[_0x6ee4('0x29')](_0x520dd2)[_0x6ee4('0x2a')]();};}function respondWithResult(_0xf76d23,_0x22a43e){_0x22a43e=_0x22a43e||0xc8;return function(_0x5784a0){if(_0x5784a0){return _0xf76d23[_0x6ee4('0x29')](_0x22a43e)[_0x6ee4('0x2b')](_0x5784a0);}};}function respondWithFilteredResult(_0x2eab8a,_0x2fcb80){return function(_0x48b762){if(_0x48b762){var _0x2193b1=typeof _0x2fcb80['offset']==='undefined'&&typeof _0x2fcb80[_0x6ee4('0x2c')]===_0x6ee4('0x2d');var _0x11fafb=_0x48b762[_0x6ee4('0x2e')];var _0x4f1481=_0x2193b1?0x0:_0x2fcb80[_0x6ee4('0x2f')];var _0x1e53f9=_0x2193b1?_0x48b762[_0x6ee4('0x2e')]:_0x2fcb80[_0x6ee4('0x2f')]+_0x2fcb80[_0x6ee4('0x2c')];var _0x4da82d;if(_0x1e53f9>=_0x11fafb){_0x1e53f9=_0x11fafb;_0x4da82d=0xc8;}else{_0x4da82d=0xce;}_0x2eab8a['status'](_0x4da82d);return _0x2eab8a['set'](_0x6ee4('0x30'),_0x4f1481+'-'+_0x1e53f9+'/'+_0x11fafb)[_0x6ee4('0x2b')](_0x48b762);}return null;};}function saveUpdates(_0x33bcb0){return function(_0x132291){if(_0x132291){return _0x132291[_0x6ee4('0x31')](_0x33bcb0)[_0x6ee4('0x1c')](function(_0x19ed72){return _0x19ed72;});}return null;};}function removeEntity(_0x54b88c){return function(_0x5273bc){if(_0x5273bc){return _0x5273bc[_0x6ee4('0x32')]()[_0x6ee4('0x1c')](function(){var _0x2a6d38=_0x5273bc['get']({'plain':!![]});var _0x15d653=_0x6ee4('0x33');return db[_0x6ee4('0x34')][_0x6ee4('0x32')]({'where':{'type':_0x15d653,'resourceId':_0x2a6d38['id']}})[_0x6ee4('0x1c')](function(){return _0x5273bc;});})[_0x6ee4('0x1c')](function(){_0x54b88c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x258e0f){return function(_0x2ec82f){if(!_0x2ec82f){_0x258e0f[_0x6ee4('0x28')](0x194);}return _0x2ec82f;};}function handleError(_0x5a6e44,_0x1de2b4){_0x1de2b4=_0x1de2b4||0x1f4;return function(_0x26abb0){logger[_0x6ee4('0x22')](_0x26abb0['stack']);if(_0x26abb0[_0x6ee4('0x35')]){delete _0x26abb0[_0x6ee4('0x35')];}_0x5a6e44[_0x6ee4('0x29')](_0x1de2b4)['send'](_0x26abb0);};}function createInteractionObject(_0x1215e5,_0x26e5cb,_0x42399c,_0x5eb568){var _0x5f0e3f=require(_0x6ee4('0x36'));var _0x45b871=new _0x5f0e3f();var _0x575e97=_0x45b871[_0x6ee4('0x37')](_0x42399c[_0x6ee4('0x38')])['getResult']();var _0x3b48e3=_0x26e5cb[_0x6ee4('0x39')];if(_0x42399c['cf-connecting-ip']){_0x3b48e3=_0x42399c['cf-connecting-ip'];}else if(_0x42399c[_0x6ee4('0x3a')]){_0x3b48e3=_[_0x6ee4('0x3b')](_0x42399c['x-forwarded-for'][_0x6ee4('0x3c')](','));}return{'ContactId':_0x5eb568['id'],'ChatWebsiteId':_0x1215e5,'from':(_0x5eb568[_0x6ee4('0x3d')]||'')+'\x20'+(_0x5eb568[_0x6ee4('0x3e')]||''),'customerIp':_0x3b48e3,'customerPort':_0x42399c[_0x6ee4('0x3f')]?_0x42399c[_0x6ee4('0x3f')]:null,'referer':_0x26e5cb['referer'],'browserName':_0x575e97['browser'][_0x6ee4('0x35')]&&_0x575e97['browser'][_0x6ee4('0x40')]?util[_0x6ee4('0x41')](_0x6ee4('0x42'),_0x575e97[_0x6ee4('0x43')][_0x6ee4('0x35')],_0x575e97[_0x6ee4('0x43')][_0x6ee4('0x40')]):_0x6ee4('0x44'),'browserVersion':_0x575e97[_0x6ee4('0x43')]['version']||'unknown','osName':util[_0x6ee4('0x41')](_0x6ee4('0x42'),_0x575e97['os'][_0x6ee4('0x35')],_0x575e97['os'][_0x6ee4('0x40')]),'osVersion':_0x575e97['os'][_0x6ee4('0x40')],'deviceModel':_0x575e97[_0x6ee4('0x45')][_0x6ee4('0x46')]&&_0x575e97[_0x6ee4('0x45')][_0x6ee4('0x47')]?util[_0x6ee4('0x41')](_0x6ee4('0x48'),_0x575e97[_0x6ee4('0x45')][_0x6ee4('0x46')],_0x575e97['device'][_0x6ee4('0x47')],_0x575e97['device'][_0x6ee4('0x49')]):null,'deviceVendor':_0x575e97[_0x6ee4('0x45')][_0x6ee4('0x47')],'deviceType':_0x575e97[_0x6ee4('0x45')][_0x6ee4('0x49')],'formData':JSON[_0x6ee4('0x21')](_0x26e5cb)};}exports['index']=function(_0x115a29,_0x19443c){var _0x314963={'include':[{'model':db[_0x6ee4('0x4a')],'as':_0x6ee4('0x4b')}]},_0x303510={},_0x5c4880={'count':0x0,'rows':[]};var _0xa5771a=_[_0x6ee4('0x4c')](db[_0x6ee4('0x4d')][_0x6ee4('0x4e')],function(_0x43b31d){return{'name':_0x43b31d[_0x6ee4('0x4f')],'type':_0x43b31d[_0x6ee4('0x49')]['key']};});_0x303510[_0x6ee4('0x46')]=_[_0x6ee4('0x4c')](_0xa5771a,_0x6ee4('0x35'));_0x303510['query']=_[_0x6ee4('0x50')](_0x115a29[_0x6ee4('0x51')]);_0x303510['filters']=_[_0x6ee4('0x52')](_0x303510[_0x6ee4('0x46')],_0x303510[_0x6ee4('0x51')]);_0x314963[_0x6ee4('0x53')]=_[_0x6ee4('0x52')](_0x303510[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x115a29[_0x6ee4('0x51')][_0x6ee4('0x54')]));_0x314963[_0x6ee4('0x53')]=_0x314963['attributes'][_0x6ee4('0x55')]?_0x314963['attributes']:_0x303510[_0x6ee4('0x46')];if(!_0x115a29[_0x6ee4('0x51')]['hasOwnProperty']('nolimit')){_0x314963[_0x6ee4('0x2c')]=qs['limit'](_0x115a29[_0x6ee4('0x51')][_0x6ee4('0x2c')]);_0x314963['offset']=qs['offset'](_0x115a29[_0x6ee4('0x51')]['offset']);}_0x314963[_0x6ee4('0x56')]=qs[_0x6ee4('0x57')](_0x115a29[_0x6ee4('0x51')]['sort']);_0x314963[_0x6ee4('0x58')]=qs[_0x6ee4('0x59')](_[_0x6ee4('0x5a')](_0x115a29['query'],_0x303510['filters']),_0xa5771a);if(_0x115a29[_0x6ee4('0x51')][_0x6ee4('0x5b')]){_0x314963[_0x6ee4('0x58')]=_[_0x6ee4('0x5c')](_0x314963[_0x6ee4('0x58')],{'$or':_[_0x6ee4('0x4c')](_0xa5771a,function(_0x51623b){if(_0x51623b[_0x6ee4('0x49')]!==_0x6ee4('0x5d')){var _0x1dfc51={};_0x1dfc51[_0x51623b[_0x6ee4('0x35')]]={'$like':'%'+_0x115a29[_0x6ee4('0x51')][_0x6ee4('0x5b')]+'%'};return _0x1dfc51;}})});}_0x314963=_[_0x6ee4('0x5c')]({},_0x314963,_0x115a29[_0x6ee4('0x5e')]);var _0x2dfbbe={'where':_0x314963[_0x6ee4('0x58')]};return db[_0x6ee4('0x4d')][_0x6ee4('0x2e')](_0x2dfbbe)[_0x6ee4('0x1c')](function(_0x37deb3){_0x5c4880[_0x6ee4('0x2e')]=_0x37deb3;if(_0x115a29[_0x6ee4('0x51')][_0x6ee4('0x5f')]){_0x314963[_0x6ee4('0x60')]=[{'all':!![]}];}return db['ChatWebsite'][_0x6ee4('0x61')](_0x314963);})['then'](function(_0x413aa2){_0x5c4880[_0x6ee4('0x62')]=_0x413aa2;return _0x5c4880;})[_0x6ee4('0x1c')](respondWithFilteredResult(_0x19443c,_0x314963))[_0x6ee4('0x27')](handleError(_0x19443c,null));};exports[_0x6ee4('0x63')]=function(_0x3f3480,_0x2683f1){var _0x3e6d47={'raw':![],'where':{'id':_0x3f3480[_0x6ee4('0x64')]['id']},'include':[{'model':db[_0x6ee4('0x4a')],'as':'mandatoryDispositionPause'}]},_0x3f209c={};_0x3f209c[_0x6ee4('0x46')]=_[_0x6ee4('0x50')](db[_0x6ee4('0x4d')]['rawAttributes']);_0x3f209c[_0x6ee4('0x51')]=_[_0x6ee4('0x50')](_0x3f3480[_0x6ee4('0x51')]);_0x3f209c[_0x6ee4('0x59')]=_[_0x6ee4('0x52')](_0x3f209c[_0x6ee4('0x46')],_0x3f209c[_0x6ee4('0x51')]);_0x3e6d47[_0x6ee4('0x53')]=_[_0x6ee4('0x52')](_0x3f209c[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x3f3480[_0x6ee4('0x51')][_0x6ee4('0x54')]));_0x3e6d47['attributes']=_0x3e6d47[_0x6ee4('0x53')][_0x6ee4('0x55')]?_0x3e6d47[_0x6ee4('0x53')]:_0x3f209c[_0x6ee4('0x46')];if(_0x3f3480[_0x6ee4('0x51')][_0x6ee4('0x5f')]){_0x3e6d47[_0x6ee4('0x60')]=[{'all':!![]}];}_0x3e6d47=_[_0x6ee4('0x5c')]({},_0x3e6d47,_0x3f3480[_0x6ee4('0x5e')]);return db['ChatWebsite'][_0x6ee4('0x65')](_0x3e6d47)[_0x6ee4('0x1c')](handleEntityNotFound(_0x2683f1,null))[_0x6ee4('0x1c')](respondWithResult(_0x2683f1,null))[_0x6ee4('0x27')](handleError(_0x2683f1,null));};exports[_0x6ee4('0x66')]=function(_0x569bab,_0x16d65c){if(!wildcardUtils['testWildcardValidity'](_0x569bab['body'][_0x6ee4('0x67')])){return handleError(_0x16d65c,null)(new APIBadRequestError('\x22'+_0x569bab[_0x6ee4('0x68')][_0x6ee4('0x67')]+_0x6ee4('0x69')));}return db[_0x6ee4('0x4d')][_0x6ee4('0x66')](_0x569bab['body'],{})[_0x6ee4('0x1c')](function(_0x16dae9){var _0x18fa52=_0x569bab[_0x6ee4('0x6a')][_0x6ee4('0x6b')]({'plain':!![]});if(!_0x18fa52)throw new Error(_0x6ee4('0x6c'));if(_0x18fa52['role']===_0x6ee4('0x6a')){var _0x34d4a7=_0x16dae9[_0x6ee4('0x6b')]({'plain':!![]});var _0x106156='ChatWebsites';return db[_0x6ee4('0x6d')][_0x6ee4('0x65')]({'where':{'name':_0x106156,'userProfileId':_0x18fa52[_0x6ee4('0x6e')]},'raw':!![]})[_0x6ee4('0x1c')](function(_0x3dcb65){if(_0x3dcb65&&_0x3dcb65['autoAssociation']===0x0){return db[_0x6ee4('0x34')][_0x6ee4('0x66')]({'name':_0x34d4a7[_0x6ee4('0x35')],'resourceId':_0x34d4a7['id'],'type':_0x3dcb65[_0x6ee4('0x35')],'sectionId':_0x3dcb65['id']},{})[_0x6ee4('0x1c')](function(){return _0x16dae9;});}else{return _0x16dae9;}})[_0x6ee4('0x27')](function(_0x49498f){logger[_0x6ee4('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49498f);throw _0x49498f;});}return _0x16dae9;})[_0x6ee4('0x1c')](respondWithResult(_0x16d65c,0xc9))[_0x6ee4('0x27')](handleError(_0x16d65c,null));};exports[_0x6ee4('0x31')]=function(_0x372986,_0x5a70ba){if(!wildcardUtils['testWildcardValidity'](_0x372986['body'][_0x6ee4('0x67')])){return handleError(_0x5a70ba,null)(new APIBadRequestError('\x22'+_0x372986[_0x6ee4('0x68')]['address']+'\x22\x20is\x20not\x20a\x20valid\x20website\x20domain'));}if(_0x372986['body']['id']){delete _0x372986[_0x6ee4('0x68')]['id'];}return db[_0x6ee4('0x4d')]['find']({'where':{'id':_0x372986[_0x6ee4('0x64')]['id']},'include':[{'model':db['Pause'],'as':_0x6ee4('0x4b')}]})['then'](handleEntityNotFound(_0x5a70ba,null))['then'](saveUpdates(_0x372986[_0x6ee4('0x68')],null))['then'](respondWithResult(_0x5a70ba,null))['catch'](handleError(_0x5a70ba,null));};exports[_0x6ee4('0x32')]=function(_0x2d8684,_0x10cae9){return db[_0x6ee4('0x4d')][_0x6ee4('0x65')]({'where':{'id':_0x2d8684[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x10cae9,null))[_0x6ee4('0x1c')](removeEntity(_0x10cae9,null))[_0x6ee4('0x27')](handleError(_0x10cae9,null));};exports[_0x6ee4('0x6f')]=function(_0x102d59,_0x323292){return db[_0x6ee4('0x4d')][_0x6ee4('0x6f')]()[_0x6ee4('0x1c')](respondWithResult(_0x323292,null))[_0x6ee4('0x27')](handleError(_0x323292,null));};exports[_0x6ee4('0x70')]=function(_0x7a3961,_0x5d7b71){if(_0x7a3961[_0x6ee4('0x68')]['id']){delete _0x7a3961['body']['id'];}return db[_0x6ee4('0x4d')][_0x6ee4('0x65')]({'where':{'id':_0x7a3961['params']['id']}})['then'](handleEntityNotFound(_0x5d7b71,null))['then'](function(_0x723769){if(_0x723769){_0x7a3961['body'][_0x6ee4('0x71')]=_0x723769['id'];return db[_0x6ee4('0x72')][_0x6ee4('0x66')](_0x7a3961[_0x6ee4('0x68')]);}})['then'](respondWithResult(_0x5d7b71,null))[_0x6ee4('0x27')](handleError(_0x5d7b71,null));};exports['getDispositions']=function(_0x58ac9e,_0x5ab1e5){var _0x48ee5f={'raw':![],'where':{}};var _0x12c941={};var _0x257a2a={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x58ac9e[_0x6ee4('0x64')]['id']}})['then'](handleEntityNotFound(_0x5ab1e5,null))[_0x6ee4('0x1c')](function(_0x5c6143){if(_0x5c6143){_0x12c941[_0x6ee4('0x46')]=_[_0x6ee4('0x50')](db[_0x6ee4('0x72')][_0x6ee4('0x4e')]);_0x12c941[_0x6ee4('0x51')]=_[_0x6ee4('0x50')](_0x58ac9e[_0x6ee4('0x51')]);_0x12c941['filters']=_[_0x6ee4('0x52')](_0x12c941[_0x6ee4('0x46')],_0x12c941[_0x6ee4('0x51')]);_0x48ee5f[_0x6ee4('0x53')]=_[_0x6ee4('0x52')](_0x12c941[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x58ac9e['query'][_0x6ee4('0x54')]));_0x48ee5f[_0x6ee4('0x53')]=_0x48ee5f['attributes'][_0x6ee4('0x55')]?_0x48ee5f['attributes']:_0x12c941['model'];if(!_0x58ac9e['query'][_0x6ee4('0x73')]('nolimit')){_0x48ee5f[_0x6ee4('0x2c')]=qs[_0x6ee4('0x2c')](_0x58ac9e[_0x6ee4('0x51')][_0x6ee4('0x2c')]);_0x48ee5f['offset']=qs['offset'](_0x58ac9e['query'][_0x6ee4('0x2f')]);}_0x48ee5f[_0x6ee4('0x56')]=qs['sort'](_0x58ac9e[_0x6ee4('0x51')][_0x6ee4('0x57')]);_0x48ee5f[_0x6ee4('0x58')]=qs['filters'](_['pick'](_0x58ac9e[_0x6ee4('0x51')],_0x12c941[_0x6ee4('0x59')]));_0x48ee5f[_0x6ee4('0x58')][_0x6ee4('0x71')]=_0x5c6143['id'];if(_0x58ac9e[_0x6ee4('0x51')][_0x6ee4('0x5b')]){_0x48ee5f[_0x6ee4('0x58')]=_[_0x6ee4('0x5c')](_0x48ee5f[_0x6ee4('0x58')],{'$or':_['map'](_0x48ee5f[_0x6ee4('0x53')],function(_0x56ff80){var _0x332e43={};_0x332e43[_0x56ff80]={'$like':'%'+_0x58ac9e[_0x6ee4('0x51')]['filter']+'%'};return _0x332e43;})});}_0x48ee5f=_[_0x6ee4('0x5c')]({},_0x48ee5f,_0x58ac9e[_0x6ee4('0x5e')]);return db[_0x6ee4('0x72')][_0x6ee4('0x2e')]({'where':_0x48ee5f['where']})[_0x6ee4('0x1c')](function(_0xcb434d){_0x257a2a[_0x6ee4('0x2e')]=_0xcb434d;if(_0x58ac9e['query'][_0x6ee4('0x5f')]){_0x48ee5f[_0x6ee4('0x60')]=[{'all':!![]}];}return db[_0x6ee4('0x72')]['findAll'](_0x48ee5f);})[_0x6ee4('0x1c')](function(_0x1e9a22){_0x257a2a[_0x6ee4('0x62')]=_0x1e9a22;return _0x257a2a;});}})[_0x6ee4('0x1c')](respondWithFilteredResult(_0x5ab1e5,_0x48ee5f))[_0x6ee4('0x27')](handleError(_0x5ab1e5,null));};exports[_0x6ee4('0x74')]=function(_0x5c4995,_0x386a3e){return db[_0x6ee4('0x4d')][_0x6ee4('0x65')]({'where':{'id':_0x5c4995['params']['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x386a3e,null))[_0x6ee4('0x1c')](function(_0x277498){if(_0x277498){return _0x277498[_0x6ee4('0x74')](_0x5c4995['query'][_0x6ee4('0x75')]);}})[_0x6ee4('0x1c')](respondWithStatusCode(_0x386a3e,null))[_0x6ee4('0x27')](handleError(_0x386a3e,null));};exports['addAnswer']=function(_0x44d112,_0x846410){if(_0x44d112[_0x6ee4('0x68')]['id']){delete _0x44d112['body']['id'];}return db[_0x6ee4('0x4d')][_0x6ee4('0x65')]({'where':{'id':_0x44d112[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x846410,null))['then'](function(_0x4f3531){if(_0x4f3531){_0x44d112['body']['ChatWebsiteId']=_0x4f3531['id'];return db[_0x6ee4('0x76')][_0x6ee4('0x66')](_0x44d112[_0x6ee4('0x68')]);}})['then'](respondWithResult(_0x846410,null))[_0x6ee4('0x27')](handleError(_0x846410,null));};exports['getAnswers']=function(_0x3afdd7,_0x16c52a){var _0x472665={'raw':![],'where':{}};var _0x1435ba={};var _0x5daf9c={'count':0x0,'rows':[]};return db[_0x6ee4('0x4d')][_0x6ee4('0x77')]({'where':{'id':_0x3afdd7[_0x6ee4('0x64')]['id']}})['then'](handleEntityNotFound(_0x16c52a,null))[_0x6ee4('0x1c')](function(_0x2b15cb){if(_0x2b15cb){_0x1435ba[_0x6ee4('0x46')]=_['keys'](db[_0x6ee4('0x76')][_0x6ee4('0x4e')]);_0x1435ba[_0x6ee4('0x51')]=_['keys'](_0x3afdd7[_0x6ee4('0x51')]);_0x1435ba[_0x6ee4('0x59')]=_[_0x6ee4('0x52')](_0x1435ba['model'],_0x1435ba[_0x6ee4('0x51')]);_0x472665[_0x6ee4('0x53')]=_[_0x6ee4('0x52')](_0x1435ba[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x3afdd7[_0x6ee4('0x51')][_0x6ee4('0x54')]));_0x472665[_0x6ee4('0x53')]=_0x472665[_0x6ee4('0x53')][_0x6ee4('0x55')]?_0x472665[_0x6ee4('0x53')]:_0x1435ba[_0x6ee4('0x46')];if(!_0x3afdd7[_0x6ee4('0x51')]['hasOwnProperty'](_0x6ee4('0x78'))){_0x472665['limit']=qs[_0x6ee4('0x2c')](_0x3afdd7['query'][_0x6ee4('0x2c')]);_0x472665['offset']=qs['offset'](_0x3afdd7[_0x6ee4('0x51')]['offset']);}_0x472665['order']=qs['sort'](_0x3afdd7[_0x6ee4('0x51')][_0x6ee4('0x57')]);_0x472665[_0x6ee4('0x58')]=qs[_0x6ee4('0x59')](_[_0x6ee4('0x5a')](_0x3afdd7[_0x6ee4('0x51')],_0x1435ba[_0x6ee4('0x59')]));_0x472665[_0x6ee4('0x58')]['ChatWebsiteId']=_0x2b15cb['id'];if(_0x3afdd7[_0x6ee4('0x51')]['filter']){_0x472665[_0x6ee4('0x58')]=_[_0x6ee4('0x5c')](_0x472665[_0x6ee4('0x58')],{'$or':_['map'](_0x472665[_0x6ee4('0x53')],function(_0xf66acb){var _0x5218fc={};_0x5218fc[_0xf66acb]={'$like':'%'+_0x3afdd7[_0x6ee4('0x51')][_0x6ee4('0x5b')]+'%'};return _0x5218fc;})});}_0x472665=_[_0x6ee4('0x5c')]({},_0x472665,_0x3afdd7[_0x6ee4('0x5e')]);return db[_0x6ee4('0x76')]['count']({'where':_0x472665[_0x6ee4('0x58')]})[_0x6ee4('0x1c')](function(_0x263fa3){_0x5daf9c[_0x6ee4('0x2e')]=_0x263fa3;if(_0x3afdd7[_0x6ee4('0x51')][_0x6ee4('0x5f')]){_0x472665[_0x6ee4('0x60')]=[{'all':!![]}];}return db[_0x6ee4('0x76')][_0x6ee4('0x61')](_0x472665);})[_0x6ee4('0x1c')](function(_0x32b797){_0x5daf9c['rows']=_0x32b797;return _0x5daf9c;});}})['then'](respondWithFilteredResult(_0x16c52a,_0x472665))[_0x6ee4('0x27')](handleError(_0x16c52a,null));};exports[_0x6ee4('0x79')]=function(_0xe4fc98,_0x4328ef){return db['ChatWebsite'][_0x6ee4('0x65')]({'where':{'id':_0xe4fc98[_0x6ee4('0x64')]['id']}})['then'](handleEntityNotFound(_0x4328ef,null))['then'](function(_0x34b30b){if(_0x34b30b){return _0x34b30b[_0x6ee4('0x79')](_0xe4fc98[_0x6ee4('0x51')]['ids']);}})[_0x6ee4('0x1c')](respondWithStatusCode(_0x4328ef,null))[_0x6ee4('0x27')](handleError(_0x4328ef,null));};exports[_0x6ee4('0x7a')]=function(_0x4c284e,_0x427c09){_0x4c284e[_0x6ee4('0x68')][_0x6ee4('0x7b')]=_0x4c284e['file'][_0x6ee4('0x7c')];return db['ChatWebsite'][_0x6ee4('0x65')]({'where':{'id':_0x4c284e[_0x6ee4('0x64')]['id']}})['then'](handleEntityNotFound(_0x427c09,null))[_0x6ee4('0x1c')](saveUpdates(_0x4c284e[_0x6ee4('0x68')],null))[_0x6ee4('0x1c')](respondWithResult(_0x427c09,null))[_0x6ee4('0x27')](handleError(_0x427c09,null));};exports[_0x6ee4('0x7d')]=function(_0x33b36b,_0x3e71d4){_0x33b36b[_0x6ee4('0x68')]['agentAvatar']=_0x33b36b[_0x6ee4('0x7e')]['filename'];return db[_0x6ee4('0x4d')]['find']({'where':{'id':_0x33b36b[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x3e71d4,null))[_0x6ee4('0x1c')](saveUpdates(_0x33b36b[_0x6ee4('0x68')],null))[_0x6ee4('0x1c')](respondWithResult(_0x3e71d4,null))[_0x6ee4('0x27')](handleError(_0x3e71d4,null));};exports[_0x6ee4('0x7f')]=function(_0x1f8542,_0x5401bd){_0x1f8542[_0x6ee4('0x68')]['customerAvatar']=_0x1f8542[_0x6ee4('0x7e')]['filename'];return db[_0x6ee4('0x4d')]['find']({'where':{'id':_0x1f8542['params']['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x5401bd,null))[_0x6ee4('0x1c')](saveUpdates(_0x1f8542[_0x6ee4('0x68')],null))['then'](respondWithResult(_0x5401bd,null))['catch'](handleError(_0x5401bd,null));};exports['addSystemAvatar']=function(_0x44f74b,_0x2d2d47){_0x44f74b[_0x6ee4('0x68')][_0x6ee4('0x80')]=_0x44f74b[_0x6ee4('0x7e')][_0x6ee4('0x7c')];return db[_0x6ee4('0x4d')]['find']({'where':{'id':_0x44f74b[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x2d2d47,null))[_0x6ee4('0x1c')](saveUpdates(_0x44f74b[_0x6ee4('0x68')],null))['then'](respondWithResult(_0x2d2d47,null))['catch'](handleError(_0x2d2d47,null));};exports[_0x6ee4('0x81')]=function(_0x2c366f,_0x52509d){var _0x2b57da=path[_0x6ee4('0x82')](config[_0x6ee4('0x83')],'server/files/images/logos/default_logo.svg');var _0x2b54b8={'where':{'id':_0x2c366f[_0x6ee4('0x64')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x48ac0b=![];return require(_0x6ee4('0x84'))['getLicense']()[_0x6ee4('0x1c')](function(_0x47725e){if(_0x47725e){_0x48ac0b=_0x47725e[_0x6ee4('0x85')];}})[_0x6ee4('0x1c')](function(){return db[_0x6ee4('0x4d')][_0x6ee4('0x65')](_0x2b54b8);})['then'](handleEntityNotFound(_0x52509d,null))[_0x6ee4('0x1c')](function(_0x2e0cda){if(_0x2e0cda){if(!_[_0x6ee4('0x86')](_0x2e0cda[_0x6ee4('0x7b')])){if(fs['existsSync'](path[_0x6ee4('0x82')](config[_0x6ee4('0x83')],_0x6ee4('0x87'),_0x2e0cda[_0x6ee4('0x7b')]))&&_0x48ac0b){_0x2b57da=path[_0x6ee4('0x82')](config[_0x6ee4('0x83')],_0x6ee4('0x87'),_0x2e0cda['sitepic']);}}return _0x52509d[_0x6ee4('0x88')](_0x2b57da);}})[_0x6ee4('0x27')](handleError(_0x52509d,null));};exports['getAvatar']=function(_0x4390c7,_0x37c866){var _0x434dab=path[_0x6ee4('0x82')](config[_0x6ee4('0x83')],_0x6ee4('0x89'));var _0x341b73={'where':{'id':_0x4390c7[_0x6ee4('0x64')]['id']},'attributes':['id',_0x6ee4('0x8a')],'raw':!![]};return db[_0x6ee4('0x4d')]['find'](_0x341b73)[_0x6ee4('0x1c')](handleEntityNotFound(_0x37c866,null))['then'](function(_0x5a5852){if(_0x5a5852){if(!_[_0x6ee4('0x86')](_0x5a5852[_0x6ee4('0x8a')])){if(fs[_0x6ee4('0x8b')](path[_0x6ee4('0x82')](config['root'],'server/files/images/avatars/',_0x5a5852[_0x6ee4('0x8a')]))){_0x434dab=path['join'](config[_0x6ee4('0x83')],_0x6ee4('0x8c'),_0x5a5852[_0x6ee4('0x8a')]);}}return _0x37c866[_0x6ee4('0x88')](_0x434dab);}})[_0x6ee4('0x27')](handleError(_0x37c866,null));};exports[_0x6ee4('0x8d')]=function(_0x3a02fa,_0x47c5ec){var _0x42f9f1=path['join'](config[_0x6ee4('0x83')],_0x6ee4('0x8e'));var _0x1bbd7c={'where':{'id':_0x3a02fa[_0x6ee4('0x64')]['id']},'attributes':['id',_0x6ee4('0x8f'),_0x6ee4('0x90')],'raw':!![]};return db[_0x6ee4('0x4d')][_0x6ee4('0x65')](_0x1bbd7c)[_0x6ee4('0x1c')](handleEntityNotFound(_0x47c5ec,null))[_0x6ee4('0x1c')](function(_0xee57a5){if(_0xee57a5){if(!_[_0x6ee4('0x86')](_0xee57a5['customerAvatar'])){if(fs[_0x6ee4('0x8b')](path[_0x6ee4('0x82')](config['root'],'server/files/images/avatars/',_0xee57a5['customerAvatar']))&&_0xee57a5[_0x6ee4('0x90')]){_0x42f9f1=path[_0x6ee4('0x82')](config[_0x6ee4('0x83')],_0x6ee4('0x8c'),_0xee57a5[_0x6ee4('0x8f')]);}}return _0x47c5ec[_0x6ee4('0x88')](_0x42f9f1);}})[_0x6ee4('0x27')](handleError(_0x47c5ec,null));};exports[_0x6ee4('0x91')]=function(_0x111c35,_0x5eaa62){var _0x4135d9=path[_0x6ee4('0x82')](config['root'],_0x6ee4('0x92'));var _0x1e4fbf={'where':{'id':_0x111c35[_0x6ee4('0x64')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0x6ee4('0x65')](_0x1e4fbf)[_0x6ee4('0x1c')](handleEntityNotFound(_0x5eaa62,null))[_0x6ee4('0x1c')](function(_0x400c11){if(_0x400c11){if(!_['isNil'](_0x400c11[_0x6ee4('0x80')])){if(fs[_0x6ee4('0x8b')](path['join'](config[_0x6ee4('0x83')],'server/files/images/avatars/',_0x400c11[_0x6ee4('0x80')]))){_0x4135d9=path['join'](config[_0x6ee4('0x83')],'server/files/images/avatars/',_0x400c11[_0x6ee4('0x80')]);}}return _0x5eaa62[_0x6ee4('0x88')](_0x4135d9);}})['catch'](handleError(_0x5eaa62,null));};function checkWebsiteInterval(_0x3acc94){var _0x87f63b=_0x3acc94[_0x6ee4('0x93')];if(!_0x87f63b){return Promise['resolve'](_0x3acc94);}var _0x4c3d02=_0x3acc94[_0x6ee4('0x94')]||undefined;return _0x87f63b[_0x6ee4('0x95')](_0x4c3d02)[_0x6ee4('0x1c')](function(_0x1b65f8){if(!_0x1b65f8){throw new APIOutOfIntervalError();}return _0x3acc94;});}exports[_0x6ee4('0x96')]=function(_0x4e858a,_0x451975){var _0x1dbf0e={'body':_0x4e858a[_0x6ee4('0x68')],'channel':_0x6ee4('0x97')};var _0x2e377c=[];var _0x57a6c4=[];var _0x48df37={};var _0x433eed=![];if(_0x4e858a[_0x6ee4('0x68')]['id']){delete _0x4e858a[_0x6ee4('0x68')]['id'];}if(_[_0x6ee4('0x86')](_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x98')])){throw new APIBadRequestError(_0x6ee4('0x99'));}if(_[_0x6ee4('0x86')](_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x9a')])){throw new APIBadRequestError(_0x6ee4('0x9b'));}if(_[_0x6ee4('0x9c')](_0x4e858a['body']['body'])){throw new APIBadRequestError(_0x6ee4('0x9d'));}var _0x102a15=_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x39')]&&_0x4e858a['body'][_0x6ee4('0x9e')];return db[_0x6ee4('0x9f')]['describe']()['then'](function(_0x5abd81){if(!_0x5abd81){throw new Error(_0x6ee4('0xa0'));}_0x2e377c=Object['keys'](_0x5abd81)[_0x6ee4('0x5b')](function(_0x4d4b90){return!['createdAt','updatedAt'][_0x6ee4('0xa1')](_0x4d4b90);});_0x57a6c4=Object[_0x6ee4('0x50')](_0x5abd81)['filter'](function(_0x587b72){return![_0x6ee4('0xa2'),'updatedAt','CompanyId',_0x6ee4('0xa3')][_0x6ee4('0xa1')](_0x587b72);});if(!_[_0x6ee4('0xa1')](_0x57a6c4,_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x9a')])){throw new APIBadRequestError(_0x6ee4('0xa4')+_0x57a6c4[_0x6ee4('0x82')](',\x20'));}_0x48df37[_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x9a')]]=_0x4e858a[_0x6ee4('0x68')]['from'];})['then'](function(){return db[_0x6ee4('0x4d')][_0x6ee4('0x65')]({'where':{'id':_0x4e858a[_0x6ee4('0x64')]['id']},'include':[{'model':db[_0x6ee4('0xa5')],'as':_0x6ee4('0xa6'),'include':[{'model':db['CmContact'],'as':_0x6ee4('0xa7'),'where':_0x48df37,'limit':0x1,'order':[[_0x6ee4('0xa8'),_0x6ee4('0xa9')]]}]},{'model':db[_0x6ee4('0xaa')],'as':_0x6ee4('0xab')},{'model':db[_0x6ee4('0x93')],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x6ee4('0xac')],'raw':!![]}]}]});})[_0x6ee4('0x1c')](function(_0x197ba5){if(!_0x197ba5){throw new APINotFoundError(util[_0x6ee4('0x41')](_0x6ee4('0xad'),_0x4e858a['params']['id']));}if(_0x102a15){return checkWebsiteInterval(_0x197ba5);}return _0x197ba5;})[_0x6ee4('0x1c')](function(_0xe860e6){_0x1dbf0e['account']=_0xe860e6;_0x1dbf0e[_0x6ee4('0xae')]=_['orderBy'](_0xe860e6[_0x6ee4('0xab')],[_0x6ee4('0xaf')],['asc']);if(_0x1dbf0e['account'][_0x6ee4('0xab')]){delete _0x1dbf0e['account'][_0x6ee4('0xab')];}_0x1dbf0e['list']=_0xe860e6['List']||{'id':_0xe860e6[_0x6ee4('0xa3')]};if(_0x1dbf0e[_0x6ee4('0xb0')]&&_0x1dbf0e[_0x6ee4('0xb0')][_0x6ee4('0xa7')][_0x6ee4('0x55')]){return _0x1dbf0e['list'][_0x6ee4('0xa7')][0x0];}var _0x230535=_[_0x6ee4('0x15')](_0x4e858a[_0x6ee4('0x68')],{'firstName':_0x4e858a['body'][_0x6ee4('0x98')],'ListId':_0xe860e6[_0x6ee4('0xa3')]});_0x230535[_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x9a')]]=_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x98')];return db[_0x6ee4('0x9f')]['create'](_0x230535,{'fields':_0x2e377c,'raw':!![]});})['then'](function(_0x110c18){_0x1dbf0e[_0x6ee4('0xb1')]=_0x110c18;var _0x40e45f=createInteractionObject(_0x4e858a[_0x6ee4('0x64')]['id'],_0x4e858a['body'],_0x4e858a[_0x6ee4('0xb2')],_0x110c18);var _0x698ed8={'ChatWebsiteId':_0x4e858a[_0x6ee4('0x64')]['id']};if(_0x4e858a['body'][_0x6ee4('0xb3')]){_0x698ed8['threadId']=_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0xb3')];_0x698ed8[_0x6ee4('0xb4')]=![];return db['ChatInteraction'][_0x6ee4('0x65')]({'where':_0x698ed8})['then'](function(_0x19d48e){var _0x38d053=_0x4e858a[_0x6ee4('0x68')]['customerIp']&&_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x9e')];if(_0x19d48e){_0x433eed=!![];return _0x19d48e;}else if(!_0x38d053&&_0x19d48e&&_0x19d48e[_0x6ee4('0xb4')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x40e45f[_0x6ee4('0xb3')]=_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0xb3')];_0x40e45f['externalUrl']=_0x4e858a['body'][_0x6ee4('0xb5')];return db[_0x6ee4('0xb6')]['create'](_0x40e45f);});}_0x698ed8[_0x6ee4('0xb7')]=_0x110c18['id'];if(_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0xb8')]&&_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0xb8')]['id']){_0x698ed8['id']=_0x4e858a[_0x6ee4('0x68')]['interaction']['id'];return db[_0x6ee4('0xb6')][_0x6ee4('0x65')]({'where':_0x698ed8})[_0x6ee4('0x1c')](function(_0x545ea5){var _0x3bd78c=_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x39')]&&_0x4e858a['body'][_0x6ee4('0x9e')];if(!_0x3bd78c&&_0x545ea5&&_0x545ea5[_0x6ee4('0xb4')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x545ea5){_0x433eed=!![];return _0x545ea5;}else{return db[_0x6ee4('0xb6')][_0x6ee4('0x66')](_0x40e45f);}});}return db['ChatInteraction'][_0x6ee4('0x66')](_0x40e45f);})[_0x6ee4('0x1c')](function(_0x5844cd){if(!_0x433eed){return _0x5844cd;}var _0x13a5d9={'from':(_0x1dbf0e['contact'][_0x6ee4('0x3d')]||'')+'\x20'+(_0x1dbf0e[_0x6ee4('0xb1')]['lastName']||'')};if(_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0xb3')]&&_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0xb9')]&&_0x4e858a['body']['threadId']!=_0x4e858a['body'][_0x6ee4('0xb9')]){_0x13a5d9[_0x6ee4('0xb3')]=_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0xb9')];}return _0x5844cd[_0x6ee4('0x31')](_0x13a5d9);})[_0x6ee4('0x1c')](function(_0x30d491){_0x1dbf0e['interaction']=_0x30d491[_0x6ee4('0x6b')]({'plain':!![]});_0x1dbf0e[_0x6ee4('0xb8')][_0x6ee4('0xba')]=!_0x433eed;if(_0x1dbf0e['interaction'][_0x6ee4('0xba')]){if(_0x1dbf0e[_0x6ee4('0xbb')][_0x6ee4('0xbc')]){_0x1dbf0e[_0x6ee4('0xae')][_0x6ee4('0xbd')]({'id':0x0,'priority':_0x1dbf0e[_0x6ee4('0xae')][_0x6ee4('0x55')]+0x1,'app':_0x6ee4('0xbe'),'appdata':_0x6ee4('0xbf'),'interval':_0x6ee4('0xc0')});}}return db[_0x6ee4('0xc1')][_0x6ee4('0x66')]({'body':_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x68')],'ChatWebsiteId':_0x4e858a[_0x6ee4('0x64')]['id'],'ChatInteractionId':_0x30d491['id'],'direction':'in','ContactId':_0x1dbf0e[_0x6ee4('0xb1')]['id'],'AttachmentId':_0x4e858a[_0x6ee4('0x68')]['AttachmentId']});})[_0x6ee4('0x1c')](function(_0x1afa76){_0x1dbf0e['message']=_0x1afa76;if(!_0x1dbf0e[_0x6ee4('0xb8')][_0x6ee4('0xc2')]){return;}return db[_0x6ee4('0xc3')][_0x6ee4('0x65')]({'attributes':['id',_0x6ee4('0x35')],'where':{'id':_0x1dbf0e[_0x6ee4('0xb8')][_0x6ee4('0xc2')]}});})[_0x6ee4('0x1c')](function(_0x1bfe88){if(_0x1bfe88){_0x1dbf0e[_0x6ee4('0xae')][_0x6ee4('0xc4')]({'id':0x0,'priority':0x0,'app':_0x6ee4('0xc5'),'appdata':_0x1bfe88[_0x6ee4('0x35')]+','+(_0x1dbf0e[_0x6ee4('0xbb')][_0x6ee4('0xc6')]||0xa),'interval':'*,*,*,*'});_0x1dbf0e[_0x6ee4('0xc7')]=!![];}if(!_0x1dbf0e[_0x6ee4('0xb8')][_0x6ee4('0xc8')]){return;}return db['ChatQueue'][_0x6ee4('0x65')]({'attributes':['id',_0x6ee4('0x35')],'where':{'id':_0x1dbf0e[_0x6ee4('0xb8')][_0x6ee4('0xc8')]}});})[_0x6ee4('0x1c')](function(_0x5da74e){if(_0x5da74e){_0x1dbf0e[_0x6ee4('0xae')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x5da74e[_0x6ee4('0x35')]+','+(_0x1dbf0e['account'][_0x6ee4('0xc9')]||0x12c),'interval':_0x6ee4('0xc0')});}return respondWithRpcPromise(_0x6ee4('0xca'),_0x6ee4('0xcb'),_0x1dbf0e);})[_0x6ee4('0x1c')](function(_0x5c40e1){respondWithRpcPromise(_0x6ee4('0xcc'),_0x6ee4('0xcc'),{'event':_0x6ee4('0x96'),'message':_0x5c40e1},client9002);return _0x5c40e1;})['then'](respondWithResult(_0x451975,null))[_0x6ee4('0x27')](APIHandleError(_0x451975));};exports['offline']=function(_0x1b1097,_0x49c69e){var _0x5b7182,_0x545a2c,_0x51e539;var _0x18a528=[];var _0xe34109={};var _0x588f32=_0x1b1097[_0x6ee4('0xcd')]||[];var _0x55d681=[];var _0x15d330;return db[_0x6ee4('0x9f')][_0x6ee4('0x6f')]()[_0x6ee4('0x1c')](function(_0x151773){if(!_0x151773){throw new db[(_0x6ee4('0xce'))][(_0x6ee4('0xcf'))](_0x6ee4('0xd0'));}_0x18a528=_['difference'](_[_0x6ee4('0x50')](_0x151773),[_0x6ee4('0xa2'),_0x6ee4('0xa8'),_0x6ee4('0xd1'),_0x6ee4('0xa3')]);if(_0x1b1097['body']['id']){delete _0x1b1097[_0x6ee4('0x68')]['id'];}if(_[_0x6ee4('0x86')](_0x1b1097['body'][_0x6ee4('0x98')])){throw _0x49c69e['status'](0x1f4)[_0x6ee4('0xd2')](new db[(_0x6ee4('0xce'))][(_0x6ee4('0xcf'))](_0x6ee4('0xd3')));}if(_[_0x6ee4('0x86')](_0x1b1097[_0x6ee4('0x68')]['body'])||_0x1b1097[_0x6ee4('0x68')][_0x6ee4('0x68')]===''){throw _0x49c69e['status'](0x1f4)['send'](new db[(_0x6ee4('0xce'))][(_0x6ee4('0xcf'))](_0x6ee4('0xd4')));}if(_[_0x6ee4('0x86')](_0x1b1097['body'][_0x6ee4('0xd5')])){throw _0x49c69e[_0x6ee4('0x29')](0x1f4)[_0x6ee4('0xd2')](new db[(_0x6ee4('0xce'))][(_0x6ee4('0xcf'))](_0x6ee4('0xd6')+_0x18a528));}if(!_['includes'](_0x18a528,_0x1b1097[_0x6ee4('0x68')][_0x6ee4('0xd5')])){throw _0x49c69e[_0x6ee4('0x29')](0x1f4)[_0x6ee4('0xd2')](new db[(_0x6ee4('0xce'))][(_0x6ee4('0xcf'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x18a528));}_0xe34109[_0x1b1097['body'][_0x6ee4('0xd5')]]=_0x1b1097[_0x6ee4('0x68')]['from'];})[_0x6ee4('0x1c')](function(){return db[_0x6ee4('0x4d')][_0x6ee4('0x65')]({'where':{'id':_0x1b1097[_0x6ee4('0x64')]['id']},'include':[{'model':db[_0x6ee4('0xa5')],'as':_0x6ee4('0xa6')},{'model':db[_0x6ee4('0xd7')],'as':_0x6ee4('0xd7')}]});})[_0x6ee4('0x1c')](handleEntityNotFound(_0x49c69e,null))['then'](function(_0x1d06e3){if(_0x1d06e3&&_0x1d06e3['List']){_0x545a2c=_0x1d06e3;var _0x265a0c=_[_0x6ee4('0x15')](_0x1b1097[_0x6ee4('0x68')],{'firstName':_0x1b1097[_0x6ee4('0x68')][_0x6ee4('0x98')],'phone':_0x1b1097['body']['from'],'ListId':_0x1d06e3[_0x6ee4('0xa3')]});_0x265a0c[_0x1b1097['body'][_0x6ee4('0xd5')]]=_0x1b1097[_0x6ee4('0x68')][_0x6ee4('0x98')];return db[_0x6ee4('0x9f')]['findOrCreate']({'where':_0xe34109,'defaults':_0x265a0c});}})[_0x6ee4('0xd8')](function(_0x521c4b){if(_0x521c4b){_0x51e539=_0x521c4b;var _0x3eef07=fs[_0x6ee4('0xd9')](path['join'](config[_0x6ee4('0x83')],_0x6ee4('0xda')),'utf8');var _0x5d3c6d=ejs[_0x6ee4('0xdb')](_0x3eef07,{'body':_[_0x6ee4('0xdc')](_0x1b1097[_0x6ee4('0x68')][_0x6ee4('0x68')]),'bodyTitle':_0x545a2c[_0x6ee4('0xdd')]});return db['ChatOfflineMessage'][_0x6ee4('0x66')]({'body':_0x5d3c6d,'plainBody':htmlToText[_0x6ee4('0xde')](_0x5d3c6d),'ContactId':_0x521c4b['id'],'ChatWebsiteId':_0x545a2c['id']});}})[_0x6ee4('0x1c')](function(_0x1ac102){_0x15d330=_0x1ac102;if(_0x588f32['length']){var _0x4bafe4=_0x588f32[_0x6ee4('0x4c')](function(_0x517722){return{'name':_0x517722[_0x6ee4('0xdf')],'basename':_0x517722[_0x6ee4('0x7c')],'type':_0x517722[_0x6ee4('0xe0')],'ChatOfflineMessageId':_0x1ac102['id']};});_0x55d681=_0x4bafe4[_0x6ee4('0x4c')](_0x133982=>{var _0xcbcaa7={'filename':_0x133982[_0x6ee4('0x35')],'path':path[_0x6ee4('0x82')](config[_0x6ee4('0x83')],'server',_0x6ee4('0xcd'),_0x6ee4('0xe1'),_0x6ee4('0xe2'),_0x133982[_0x6ee4('0xe3')])};return _0xcbcaa7;});if(!_0x545a2c[_0x6ee4('0xe4')]){return db['sequelize'][_0x6ee4('0xe5')](function(_0x31b6c6){return db[_0x6ee4('0xe6')][_0x6ee4('0xe7')](_0x4bafe4,{'transaction':_0x31b6c6});});}}})[_0x6ee4('0x1c')](function(){if(_0x15d330){_0x5b7182=_0x15d330;return db[_0x6ee4('0xd7')][_0x6ee4('0x77')]({'where':{'service':!![]},'include':[{'model':db[_0x6ee4('0xe8')],'as':_0x6ee4('0xe9'),'raw':!![],'include':[{'model':db[_0x6ee4('0xea')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x566f57){if(_0x566f57&&_0x566f57['Smtp']&&_0x545a2c[_0x6ee4('0xeb')]&&_0x545a2c[_0x6ee4('0xec')]){var _0x59f2cd=_0x566f57[_0x6ee4('0xed')]();return respondWithRpcPromise(_0x6ee4('0xee'),_0x6ee4('0xef'),{'account':_0x59f2cd,'message':{'from':util['format'](_0x6ee4('0xf0'),_0x566f57[_0x6ee4('0x35')],_0x566f57[_0x6ee4('0xf1')]||_0x566f57[_0x6ee4('0xe9')]['user']),'to':_0x545a2c[_0x6ee4('0xec')],'subject':_0x545a2c[_0x6ee4('0xf2')],'html':_0x5b7182[_0x6ee4('0x68')],'attachments':_0x55d681}},client9003)[_0x6ee4('0x1c')](function(){return _0x5b7182;})['catch'](function(_0x100a5b){logger[_0x6ee4('0x22')](_0x100a5b);});}})[_0x6ee4('0x1c')](function(){if(_0x545a2c&&_0x545a2c[_0x6ee4('0xe4')]&&_0x545a2c['MailAccountId']){var _0x4f5c9e=[];if(_0x588f32['length']){_0x4f5c9e=_0x588f32[_0x6ee4('0x4c')](function(_0x43b99f){return{'name':_0x43b99f[_0x6ee4('0xdf')],'basename':_0x43b99f[_0x6ee4('0x7c')],'type':_0x43b99f[_0x6ee4('0xe0')],'ChatOfflineMessageId':_0x15d330['id']};});}var _0x37137e;if(!_[_0x6ee4('0x86')](_0x545a2c[_0x6ee4('0xf3')])){var _0x18cc73=_[_0x6ee4('0x4c')](_0x1b1097[_0x6ee4('0x68')],function(_0x54aec7){return _0x54aec7;});var _0x4580cd=_[_0x6ee4('0xf4')](_0x18cc73)[0x0];var _0x2c5aba=_[_0x6ee4('0xf5')](_0x4580cd,function(_0xbcc979){return _0xbcc979;});_0x37137e=_0x2c5aba[0x1][_0x545a2c[_0x6ee4('0xf3')]];}var _0x19ef93={'from':_0x51e539[_0x6ee4('0xf1')],'firstName':_0x51e539[_0x6ee4('0x3d')],'lastName':_0x51e539['lastName'],'mapKey':_0x6ee4('0xf1'),'message':{'from':_0x51e539['email'],'to':_0x545a2c[_0x6ee4('0xd7')][_0x6ee4('0xf1')],'cc':'','subject':_[_0x6ee4('0x86')](_0x37137e)?_0x545a2c[_0x6ee4('0xf2')]:_0x37137e,'messageId':'','sentAt':new Date(),'attach':_0x4f5c9e[_0x6ee4('0x55')],'attachments':_0x4f5c9e,'originChannel':_0x6ee4('0xf6'),'ChatWebsiteId':_0x545a2c['id'],'ChatOfflineMessageId':_0x5b7182['id'],'originTo':_0x545a2c[_0x6ee4('0xd7')]['email']},'body':_0x5b7182[_0x6ee4('0x68')]};var _0xc8a872={'account':{'id':_0x545a2c[_0x6ee4('0xf7')]},'body':_0x19ef93,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x6ee4('0xf8'),_0x6ee4('0xf9'),_0xc8a872,client9001)[_0x6ee4('0x1c')](function(){return _0x5b7182;})[_0x6ee4('0x27')](function(_0x321d72){logger[_0x6ee4('0x22')](_0x321d72);});}return;})[_0x6ee4('0x1c')](function(){if(_0x5b7182){return _0x5b7182;}})[_0x6ee4('0x1c')](respondWithResult(_0x49c69e,null))[_0x6ee4('0x27')](function(){for(var _0x4d1406 of _0x588f32){var _0x3cdc9e=path[_0x6ee4('0x82')](config[_0x6ee4('0x83')],'server','files',_0x6ee4('0xe1'),_0x6ee4('0xe2'),_0x4d1406['filename']);fs_extra['remove'](_0x3cdc9e)['catch'](function(_0x4af932){logger[_0x6ee4('0x22')]('Could\x20not\x20remove\x20attachment\x20file',_0x3cdc9e,_0x4af932);});}});};exports[_0x6ee4('0xfa')]=function(_0x1561e8,_0x1200f8){return db[_0x6ee4('0xb6')][_0x6ee4('0x65')]({'where':{'id':_0x1561e8['params']['id']}})['then'](handleEntityNotFound(_0x1200f8,null))[_0x6ee4('0x1c')](function(_0x3d7a6a){if(_0x3d7a6a){return _0x3d7a6a[_0x6ee4('0xfa')](_0x1561e8[_0x6ee4('0x68')][_0x6ee4('0x75')],_['omit'](_0x1561e8[_0x6ee4('0x68')],[_0x6ee4('0x75'),'id'])||{});}})[_0x6ee4('0x1c')](respondWithResult(_0x1200f8,null))[_0x6ee4('0x27')](handleError(_0x1200f8,null));};exports['getInteractions']=function(_0x1ad77b,_0x17f2df){var _0x432ec7={'raw':![],'where':{}};var _0x547298={};var _0x21e7be={'count':0x0,'rows':[]};return db[_0x6ee4('0x4d')]['findOne']({'where':{'id':_0x1ad77b[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x17f2df,null))[_0x6ee4('0x1c')](function(_0x141220){if(_0x141220){_0x547298['model']=_[_0x6ee4('0x50')](db[_0x6ee4('0xb6')][_0x6ee4('0x4e')]);_0x547298[_0x6ee4('0x51')]=_[_0x6ee4('0x50')](_0x1ad77b[_0x6ee4('0x51')]);_0x547298['filters']=_[_0x6ee4('0x52')](_0x547298[_0x6ee4('0x46')],_0x547298[_0x6ee4('0x51')]);_0x432ec7[_0x6ee4('0x53')]=_['intersection'](_0x547298[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0x54')]));_0x432ec7[_0x6ee4('0x53')]=_0x432ec7[_0x6ee4('0x53')]['length']?_0x432ec7[_0x6ee4('0x53')]:_0x547298[_0x6ee4('0x46')];if(!_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0x73')](_0x6ee4('0x78'))){_0x432ec7[_0x6ee4('0x2c')]=qs[_0x6ee4('0x2c')](_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0x2c')]);_0x432ec7[_0x6ee4('0x2f')]=qs['offset'](_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0x2f')]);}_0x432ec7['order']=qs[_0x6ee4('0x57')](_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0x57')]);_0x432ec7[_0x6ee4('0x58')]=qs[_0x6ee4('0x59')](_['pick'](_0x1ad77b[_0x6ee4('0x51')],_0x547298[_0x6ee4('0x59')]));_0x432ec7[_0x6ee4('0x58')][_0x6ee4('0x71')]=_0x141220['id'];if(_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0x5b')]){_0x432ec7[_0x6ee4('0x58')]=_['merge'](_0x432ec7[_0x6ee4('0x58')],{'$or':_[_0x6ee4('0x4c')](_0x432ec7[_0x6ee4('0x53')],function(_0x142d8f){var _0x39ddb6={};_0x39ddb6[_0x142d8f]={'$like':'%'+_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0x5b')]+'%'};return _0x39ddb6;})});}_0x432ec7=_[_0x6ee4('0x5c')]({},_0x432ec7,_0x1ad77b[_0x6ee4('0x5e')]);return db[_0x6ee4('0xb6')]['count']({'where':_0x432ec7['where']})[_0x6ee4('0x1c')](function(_0x3fc60e){_0x21e7be[_0x6ee4('0x2e')]=_0x3fc60e;if(_0x1ad77b[_0x6ee4('0x51')]['includeAll']){_0x432ec7[_0x6ee4('0x60')]=[{'model':db[_0x6ee4('0x9f')],'as':'Contact','required':![]},{'model':db[_0x6ee4('0xc3')],'as':'Owner','attributes':[_0x6ee4('0x35'),_0x6ee4('0xfb'),_0x6ee4('0xfc')],'required':![]},{'model':db['Tag'],'as':_0x6ee4('0xfd'),'attributes':['id',_0x6ee4('0x35'),'color'],'where':_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0xfe')]?{'id':_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0xfe')]}:undefined,'required':_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0xfe')]?!![]:![]}];}return db[_0x6ee4('0xb6')][_0x6ee4('0x61')](_0x432ec7);})[_0x6ee4('0x1c')](function(_0x17d405){_0x21e7be[_0x6ee4('0x62')]=_0x17d405;return _0x21e7be;});}})[_0x6ee4('0x1c')](respondWithFilteredResult(_0x17f2df,_0x432ec7))['catch'](handleError(_0x17f2df,null));};exports[_0x6ee4('0xff')]=function(_0x588fb3,_0x45d4f0){var _0x415189=0x0;var _0xfce68e=0x0;var _0x4f6186=![];var _0xd20adc;var _0x1b6033;return db['ChatWebsite'][_0x6ee4('0x65')]({'where':{'id':_0x588fb3['params']['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x6ee4('0x93')],'as':'Intervals','attributes':['id',_0x6ee4('0xac')]}]}]})[_0x6ee4('0x1c')](handleEntityNotFound(_0x45d4f0,null))['then'](function(_0x58a21b){if(_0x58a21b){_0xd20adc=_0x58a21b;return _0x58a21b[_0x6ee4('0x100')]({'raw':!![]});}})['then'](function(_0x453fdb){if(_0xd20adc){if(_0x453fdb){_0x1b6033=_0x453fdb;}}return require(_0x6ee4('0x84'))[_0x6ee4('0x101')]();})[_0x6ee4('0x1c')](function(_0x55d59a){if(_0x55d59a){_0xfce68e=_0x55d59a[_0x6ee4('0x102')];_0x4f6186=_0x55d59a['custom'];}})[_0x6ee4('0x1c')](function(){return db[_0x6ee4('0xb6')]['count']({'where':{'closed':![]}});})['then'](function(_0x23a8ab){_0x415189=_0x23a8ab;if(_0xfce68e&&_0x23a8ab>_0xfce68e){return db[_0x6ee4('0x103')]['findOne']({'where':{'id':0x1}})['then'](function(_0x4267c4){if(_0x4267c4){_0x4267c4[_0x6ee4('0x104')](_0x6ee4('0x105'));}});}})[_0x6ee4('0x1c')](function(){var _0x5a5a66=_0xd20adc['Interval'];var _0x16bd8e=_0xd20adc[_0x6ee4('0x94')]||undefined;return _0x5a5a66?_0x5a5a66[_0x6ee4('0x95')](_0x16bd8e):!![];})[_0x6ee4('0x1c')](function(_0x45a2be){var _0x37f43f=fs[_0x6ee4('0xd9')](path[_0x6ee4('0x82')](config['root'],_0x6ee4('0x106')),'utf8');var _0x2b3189=_0x6ee4('0x107');var _0x58b943=![];try{const _0x32ac65=new URL(_0xd20adc['address']);_0xd20adc[_0x6ee4('0x67')]=_0x32ac65[_0x6ee4('0x108')];}catch(_0x40e571){}var _0x2b8971;if(_0x588fb3[_0x6ee4('0xb2')][_0x6ee4('0x9e')]){_0x588fb3[_0x6ee4('0xb2')][_0x6ee4('0x9e')]=_0x588fb3[_0x6ee4('0xb2')][_0x6ee4('0x9e')][_0x6ee4('0x109')](/\/$/,'');_0x2b8971=wildcardUtils[_0x6ee4('0x10a')](_0xd20adc[_0x6ee4('0x67')],_0x588fb3['headers'][_0x6ee4('0x9e')]);}else{_0x588fb3['headers'][_0x6ee4('0x9e')]=_0xd20adc['address'];_0x2b8971=!![];}var _0x1a1523={'chatVersion':_0x2b3189,'chatWebsiteAddressOrigin':_0x2b8971?_0x588fb3[_0x6ee4('0xb2')][_0x6ee4('0x9e')]:_0xd20adc['address'],'remote':_0xd20adc['remote'],'query':querystring[_0x6ee4('0x21')](_[_0x6ee4('0x5c')](_0xd20adc['get']({'plain':!![]}),{'customerIp':_0x588fb3[_0x6ee4('0xb2')][_0x6ee4('0x3a')]||_0x588fb3[_0x6ee4('0xb2')][_0x6ee4('0x10b')]||_0x588fb3[_0x6ee4('0x10c')]['remoteAddress']||_0x588fb3['ip'],'referer':_0x588fb3['headers'][_0x6ee4('0x9e')],'openedInteractions':_0x415189,'maxInteractions':_0xfce68e,'virtual':_0x4f6186['virtual'],'online':_0x45a2be,'custom':_0x4f6186,'address':_0x2b8971?_0x588fb3['headers'][_0x6ee4('0x9e')]:null}))[_0x6ee4('0x109')](/'/g,'\x5c\x27')};_0x45d4f0[_0x6ee4('0xd2')](ejs['render'](Mustache[_0x6ee4('0xdb')](_0x37f43f,_0x1a1523),{'proactiveActions':_0x1b6033,'alignment':_0xd20adc[_0x6ee4('0x10d')],'verticalAlignment':_0xd20adc['verticalAlignment'],'div_color':_0xd20adc[_0x6ee4('0x10e')],'labelText':_0xd20adc[_0x6ee4('0x10f')],'text_color':_0xd20adc[_0x6ee4('0x110')],'text_button_color':_0xd20adc[_0x6ee4('0x111')],'button_color':_0xd20adc['color_button'],'background_color':_0xd20adc[_0x6ee4('0x112')],'hideWhenOffline':_0xd20adc['hideWhenOffline'],'intervalId':_0xd20adc['IntervalId'],'isDevelopment':_0x58b943,'chatVersion':_0x2b3189}));})[_0x6ee4('0x27')](handleError(_0x45d4f0,null));};exports[_0x6ee4('0x113')]=function(_0x2c4419,_0x2857e3){var _0x4eb1a2=_0x2c4419[_0x6ee4('0x64')]['id'];var _0x44be61=_0x2c4419['body'];var _0x384df0=0xc8;var _0x22e51b=null;return db[_0x6ee4('0x114')][_0x6ee4('0xe5')]({'isolationLevel':db[_0x6ee4('0x114')]['Transaction'][_0x6ee4('0x115')][_0x6ee4('0x116')]},function(_0x481021){return db[_0x6ee4('0x4d')]['findOne']({'where':{'id':_0x4eb1a2},'transaction':_0x481021})[_0x6ee4('0x1c')](function(_0x439277){if(_0x439277){return db[_0x6ee4('0xaa')][_0x6ee4('0x32')]({'where':{'ChatWebsiteId':_0x4eb1a2},'transaction':_0x481021})[_0x6ee4('0x1c')](function(){var _0x386398=_['map'](_0x44be61,function(_0x8fdaa3){_0x8fdaa3[_0x6ee4('0x71')]=_0x4eb1a2;return _0x8fdaa3;});return db[_0x6ee4('0xaa')]['bulkCreate'](_0x386398,{'transaction':_0x481021});});}else{_0x384df0=0x194;_0x22e51b=[];}});})[_0x6ee4('0x1c')](function(){if(_0x384df0!==0x194){return db[_0x6ee4('0xaa')][_0x6ee4('0x117')]({'where':{'ChatWebsiteId':_0x4eb1a2},'order':_0x6ee4('0xaf')})[_0x6ee4('0x1c')](function(_0x355c45){_0x22e51b=_0x355c45;});}})[_0x6ee4('0x27')](function(_0x24f4e0){_0x384df0=0x1f4;logger[_0x6ee4('0x22')](_0x24f4e0[_0x6ee4('0x118')]);if(_0x24f4e0[_0x6ee4('0x35')]){delete _0x24f4e0[_0x6ee4('0x35')];}_0x22e51b=_0x24f4e0;})[_0x6ee4('0x119')](function(){if(_0x22e51b===null){_0x2857e3[_0x6ee4('0x28')](_0x384df0);}else{if(_0x384df0===0x1f4){_0x2857e3['status'](_0x384df0)[_0x6ee4('0xd2')](_0x22e51b);}else{_0x2857e3[_0x6ee4('0x29')](_0x384df0)['json'](_0x22e51b);}}});};exports[_0x6ee4('0x11a')]=function(_0x2d1dfa,_0x29b280){var _0x3c029f={};var _0x2a4beb={};var _0x308981;var _0x999e20;return db[_0x6ee4('0x4d')][_0x6ee4('0x77')]({'where':{'id':_0x2d1dfa[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x29b280,null))[_0x6ee4('0x1c')](function(_0x379cb1){if(_0x379cb1){_0x308981=_0x379cb1;_0x2a4beb['model']=_[_0x6ee4('0x50')](db[_0x6ee4('0xaa')]['rawAttributes']);_0x2a4beb['query']=_['keys'](_0x2d1dfa[_0x6ee4('0x51')]);_0x2a4beb[_0x6ee4('0x59')]=_['intersection'](_0x2a4beb[_0x6ee4('0x46')],_0x2a4beb[_0x6ee4('0x51')]);_0x3c029f[_0x6ee4('0x53')]=_[_0x6ee4('0x52')](_0x2a4beb[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x2d1dfa[_0x6ee4('0x51')][_0x6ee4('0x54')]));_0x3c029f[_0x6ee4('0x53')]=_0x3c029f[_0x6ee4('0x53')][_0x6ee4('0x55')]?_0x3c029f[_0x6ee4('0x53')]:_0x2a4beb['model'];_0x3c029f['order']=qs[_0x6ee4('0x57')](_0x2d1dfa[_0x6ee4('0x51')][_0x6ee4('0x57')]);_0x3c029f[_0x6ee4('0x58')]=qs[_0x6ee4('0x59')](_[_0x6ee4('0x5a')](_0x2d1dfa['query'],_0x2a4beb['filters']));if(_0x2d1dfa[_0x6ee4('0x51')][_0x6ee4('0x5b')]){_0x3c029f['where']=_[_0x6ee4('0x5c')](_0x3c029f[_0x6ee4('0x58')],{'$or':_[_0x6ee4('0x4c')](_0x3c029f[_0x6ee4('0x53')],function(_0x4e3df0){var _0x5417c3={};_0x5417c3[_0x4e3df0]={'$like':'%'+_0x2d1dfa[_0x6ee4('0x51')][_0x6ee4('0x5b')]+'%'};return _0x5417c3;})});}_0x3c029f=_[_0x6ee4('0x5c')]({},_0x3c029f,_0x2d1dfa['options']);return _0x308981['getApplications'](_0x3c029f);}})[_0x6ee4('0x1c')](function(_0x386c43){if(_0x386c43){_0x999e20=_0x386c43[_0x6ee4('0x55')];if(!_0x2d1dfa[_0x6ee4('0x51')][_0x6ee4('0x73')](_0x6ee4('0x78'))){_0x3c029f[_0x6ee4('0x2c')]=qs[_0x6ee4('0x2c')](_0x2d1dfa[_0x6ee4('0x51')][_0x6ee4('0x2c')]);_0x3c029f[_0x6ee4('0x2f')]=qs[_0x6ee4('0x2f')](_0x2d1dfa[_0x6ee4('0x51')][_0x6ee4('0x2f')]);}return _0x308981[_0x6ee4('0x11a')](_0x3c029f);}})[_0x6ee4('0x1c')](function(_0x59fa6a){if(_0x59fa6a){return _0x59fa6a?{'count':_0x999e20,'rows':_0x59fa6a}:null;}})[_0x6ee4('0x1c')](respondWithResult(_0x29b280,null))[_0x6ee4('0x27')](handleError(_0x29b280,null));};exports[_0x6ee4('0x11b')]=function(_0x5b2f95,_0x470cfc){return db[_0x6ee4('0x11c')][_0x6ee4('0x65')]({'where':{'id':_0x5b2f95[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x470cfc,null))[_0x6ee4('0x1c')](function(_0x5bac39){if(_0x5bac39){return _0x5bac39[_0x6ee4('0x11b')](_0x5b2f95[_0x6ee4('0x68')][_0x6ee4('0x75')],_[_0x6ee4('0x11d')](_0x5b2f95['body'],[_0x6ee4('0x75'),'id'])||{});}})[_0x6ee4('0x1c')](respondWithResult(_0x470cfc,null))[_0x6ee4('0x27')](handleError(_0x470cfc,null));};exports[_0x6ee4('0x100')]=function(_0x49528d,_0x482582){var _0x36d87f={};var _0x36b2d={};var _0x4f4455;var _0x337c0f;return db['ChatWebsite'][_0x6ee4('0x77')]({'where':{'id':_0x49528d[_0x6ee4('0x64')]['id']}})['then'](handleEntityNotFound(_0x482582,null))[_0x6ee4('0x1c')](function(_0x51ed20){if(_0x51ed20){_0x4f4455=_0x51ed20;_0x36b2d['model']=_[_0x6ee4('0x50')](db['ChatProactiveAction'][_0x6ee4('0x4e')]);_0x36b2d[_0x6ee4('0x51')]=_[_0x6ee4('0x50')](_0x49528d[_0x6ee4('0x51')]);_0x36b2d['filters']=_['intersection'](_0x36b2d[_0x6ee4('0x46')],_0x36b2d[_0x6ee4('0x51')]);_0x36d87f[_0x6ee4('0x53')]=_[_0x6ee4('0x52')](_0x36b2d[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x49528d[_0x6ee4('0x51')][_0x6ee4('0x54')]));_0x36d87f[_0x6ee4('0x53')]=_0x36d87f[_0x6ee4('0x53')][_0x6ee4('0x55')]?_0x36d87f[_0x6ee4('0x53')]:_0x36b2d['model'];_0x36d87f['order']=qs['sort'](_0x49528d[_0x6ee4('0x51')][_0x6ee4('0x57')]);_0x36d87f['where']=qs[_0x6ee4('0x59')](_['pick'](_0x49528d[_0x6ee4('0x51')],_0x36b2d['filters']));if(_0x49528d[_0x6ee4('0x51')][_0x6ee4('0x5b')]){_0x36d87f['where']=_['merge'](_0x36d87f[_0x6ee4('0x58')],{'$or':_[_0x6ee4('0x4c')](_0x36d87f[_0x6ee4('0x53')],function(_0x2ad2ef){var _0x5111ac={};_0x5111ac[_0x2ad2ef]={'$like':'%'+_0x49528d[_0x6ee4('0x51')][_0x6ee4('0x5b')]+'%'};return _0x5111ac;})});}_0x36d87f=_[_0x6ee4('0x5c')]({},_0x36d87f,_0x49528d[_0x6ee4('0x5e')]);return _0x4f4455[_0x6ee4('0x100')](_0x36d87f);}})['then'](function(_0x1e80d1){if(_0x1e80d1){_0x337c0f=_0x1e80d1[_0x6ee4('0x55')];if(!_0x49528d[_0x6ee4('0x51')][_0x6ee4('0x73')](_0x6ee4('0x78'))){_0x36d87f[_0x6ee4('0x2c')]=qs[_0x6ee4('0x2c')](_0x49528d[_0x6ee4('0x51')]['limit']);_0x36d87f[_0x6ee4('0x2f')]=qs[_0x6ee4('0x2f')](_0x49528d['query'][_0x6ee4('0x2f')]);}return _0x4f4455[_0x6ee4('0x100')](_0x36d87f);}})['then'](function(_0x31683d){if(_0x31683d){return _0x31683d?{'count':_0x337c0f,'rows':_0x31683d}:null;}})[_0x6ee4('0x1c')](respondWithResult(_0x482582,null))[_0x6ee4('0x27')](handleError(_0x482582,null));};exports[_0x6ee4('0x11e')]=function(_0x14d9dd,_0x2e6160){var _0x4338d2=_0x14d9dd['query'][_0x6ee4('0x11f')]===_0x6ee4('0x120')?_0x6ee4('0x121'):'onlineForm';return db['ChatWebsite'][_0x6ee4('0x65')]({'attributes':['id',_0x4338d2],'where':{'id':_0x14d9dd[_0x6ee4('0x64')]['id']}})['then'](handleEntityNotFound(_0x2e6160,null))[_0x6ee4('0x1c')](function(_0x8083c7){if(_0x8083c7){var _0x2fe4bb=_0x8083c7[_0x4338d2];var _0x1504da=_0x2fe4bb&&_0x2fe4bb[_0x6ee4('0x122')]?_0x2fe4bb['items']:[];_0x2e6160['send']({'fromKey':_[_0x6ee4('0x86')](_0x2fe4bb[_0x6ee4('0x123')])?undefined:_0x2fe4bb[_0x6ee4('0x123')],'count':_0x1504da[_0x6ee4('0x55')],'rows':_0x1504da});}})[_0x6ee4('0x27')](handleError(_0x2e6160,null));};exports['getOfflineMessages']=function(_0x2a75b3,_0x16c23b){var _0x4ca942={'raw':![],'where':{}};var _0x2e4e99={};var _0x709458={'count':0x0,'rows':[]};return db[_0x6ee4('0x4d')]['findOne']({'where':{'id':_0x2a75b3[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x16c23b,null))[_0x6ee4('0x1c')](function(_0x26a59c){if(_0x26a59c){_0x2e4e99[_0x6ee4('0x46')]=_[_0x6ee4('0x50')](db[_0x6ee4('0x124')][_0x6ee4('0x4e')]);_0x2e4e99[_0x6ee4('0x51')]=_[_0x6ee4('0x50')](_0x2a75b3[_0x6ee4('0x51')]);_0x2e4e99['filters']=_[_0x6ee4('0x52')](_0x2e4e99[_0x6ee4('0x46')],_0x2e4e99[_0x6ee4('0x51')]);_0x4ca942[_0x6ee4('0x53')]=_[_0x6ee4('0x52')](_0x2e4e99[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x2a75b3[_0x6ee4('0x51')][_0x6ee4('0x54')]));_0x4ca942['attributes']=_0x4ca942[_0x6ee4('0x53')]['length']?_0x4ca942[_0x6ee4('0x53')]:_0x2e4e99[_0x6ee4('0x46')];if(!_0x2a75b3[_0x6ee4('0x51')][_0x6ee4('0x73')](_0x6ee4('0x78'))){_0x4ca942[_0x6ee4('0x2c')]=qs[_0x6ee4('0x2c')](_0x2a75b3['query'][_0x6ee4('0x2c')]);_0x4ca942[_0x6ee4('0x2f')]=qs['offset'](_0x2a75b3['query']['offset']);}_0x4ca942[_0x6ee4('0x56')]=qs[_0x6ee4('0x57')](_0x2a75b3[_0x6ee4('0x51')][_0x6ee4('0x57')]);_0x4ca942[_0x6ee4('0x58')]=qs[_0x6ee4('0x59')](_[_0x6ee4('0x5a')](_0x2a75b3[_0x6ee4('0x51')],_0x2e4e99[_0x6ee4('0x59')]));_0x4ca942['where']['ChatWebsiteId']=_0x26a59c['id'];if(_0x2a75b3[_0x6ee4('0x51')][_0x6ee4('0x5b')]){_0x4ca942[_0x6ee4('0x58')]=_[_0x6ee4('0x5c')](_0x4ca942[_0x6ee4('0x58')],{'$or':_[_0x6ee4('0x4c')](_0x4ca942['attributes'],function(_0x2067ad){var _0x369057={};_0x369057[_0x2067ad]={'$like':'%'+_0x2a75b3[_0x6ee4('0x51')][_0x6ee4('0x5b')]+'%'};return _0x369057;})});}_0x4ca942=_[_0x6ee4('0x5c')]({},_0x4ca942,_0x2a75b3['options']);return db[_0x6ee4('0x124')]['count']({'where':_0x4ca942[_0x6ee4('0x58')]})['then'](function(_0x338963){_0x709458['count']=_0x338963;if(_0x2a75b3['query']['includeAll']){_0x4ca942[_0x6ee4('0x60')]=[{'all':!![]}];}else{_0x4ca942[_0x6ee4('0x60')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x6ee4('0xe6')],'as':_0x6ee4('0x125'),'required':![]}];}return db[_0x6ee4('0x124')][_0x6ee4('0x61')](_0x4ca942);})[_0x6ee4('0x1c')](function(_0x23e500){_0x709458[_0x6ee4('0x62')]=_0x23e500;return _0x709458;});}})['then'](respondWithFilteredResult(_0x16c23b,_0x4ca942))[_0x6ee4('0x27')](handleError(_0x16c23b,null));};exports[_0x6ee4('0x126')]=function(_0x5002fe,_0x488e31){return db[_0x6ee4('0x4d')][_0x6ee4('0x65')]({'where':{'id':_0x5002fe[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x488e31,null))[_0x6ee4('0x1c')](function(_0xed8a33){if(_0xed8a33){return _0xed8a33[_0x6ee4('0x126')](_0x5002fe[_0x6ee4('0x68')][_0x6ee4('0x75')],_['omit'](_0x5002fe['body'],[_0x6ee4('0x75'),'id'])||{})[_0x6ee4('0xd8')](function(_0x3d250d){for(var _0xdf9e70=0x0;_0xdf9e70<_0x5002fe[_0x6ee4('0x68')][_0x6ee4('0x75')]['length'];_0xdf9e70+=0x1){socket[_0x6ee4('0x127')](_0x6ee4('0x128'),{'UserId':Number(_0x5002fe['body'][_0x6ee4('0x75')][_0xdf9e70]),'ChatWebsiteId':Number(_0x5002fe[_0x6ee4('0x64')]['id'])});}return _0x3d250d;});}})[_0x6ee4('0x1c')](respondWithResult(_0x488e31,null))['catch'](handleError(_0x488e31,null));};exports[_0x6ee4('0x129')]=function(_0x199807,_0x1bb4a2){return db[_0x6ee4('0x4d')]['find']({'where':{'id':_0x199807[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x1bb4a2,null))[_0x6ee4('0x1c')](function(_0x3fe511){if(_0x3fe511){return _0x3fe511[_0x6ee4('0x129')](_0x199807['query']['ids'])[_0x6ee4('0x1c')](function(){if(_[_0x6ee4('0x12a')](_0x199807[_0x6ee4('0x51')][_0x6ee4('0x75')])){for(var _0x2a01ed=0x0;_0x2a01ed<_0x199807[_0x6ee4('0x51')]['ids'][_0x6ee4('0x55')];_0x2a01ed+=0x1){socket[_0x6ee4('0x127')](_0x6ee4('0x12b'),{'UserId':Number(_0x199807[_0x6ee4('0x51')]['ids'][_0x2a01ed]),'ChatWebsiteId':Number(_0x199807[_0x6ee4('0x64')]['id'])});}}else{socket[_0x6ee4('0x127')](_0x6ee4('0x12b'),{'UserId':Number(_0x199807[_0x6ee4('0x51')][_0x6ee4('0x75')]),'ChatWebsiteId':Number(_0x199807[_0x6ee4('0x64')]['id'])});}});}})[_0x6ee4('0x1c')](respondWithStatusCode(_0x1bb4a2,null))[_0x6ee4('0x27')](handleError(_0x1bb4a2,null));};exports[_0x6ee4('0x12c')]=function(_0x31dfe6,_0x4bce61){var _0x3952e7={};var _0x5012f6={};var _0x2eed44;var _0x5eada9;return db[_0x6ee4('0x4d')][_0x6ee4('0x77')]({'where':{'id':_0x31dfe6[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x4bce61,null))[_0x6ee4('0x1c')](function(_0x3a75b1){if(_0x3a75b1){_0x2eed44=_0x3a75b1;_0x5012f6[_0x6ee4('0x46')]=_['keys'](db[_0x6ee4('0xc3')][_0x6ee4('0x4e')]);_0x5012f6[_0x6ee4('0x51')]=_[_0x6ee4('0x50')](_0x31dfe6[_0x6ee4('0x51')]);_0x5012f6['filters']=_[_0x6ee4('0x52')](_0x5012f6[_0x6ee4('0x46')],_0x5012f6[_0x6ee4('0x51')]);_0x3952e7[_0x6ee4('0x53')]=_[_0x6ee4('0x52')](_0x5012f6[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x31dfe6[_0x6ee4('0x51')][_0x6ee4('0x54')]));_0x3952e7[_0x6ee4('0x53')]=_0x3952e7[_0x6ee4('0x53')]['length']?_0x3952e7['attributes']:_0x5012f6['model'];_0x3952e7[_0x6ee4('0x56')]=qs['sort'](_0x31dfe6[_0x6ee4('0x51')][_0x6ee4('0x57')]);_0x3952e7[_0x6ee4('0x58')]=qs['filters'](_[_0x6ee4('0x5a')](_0x31dfe6[_0x6ee4('0x51')],_0x5012f6[_0x6ee4('0x59')]));if(_0x31dfe6[_0x6ee4('0x51')]['filter']){_0x3952e7['where']=_[_0x6ee4('0x5c')](_0x3952e7[_0x6ee4('0x58')],{'$or':_[_0x6ee4('0x4c')](_0x3952e7[_0x6ee4('0x53')],function(_0x288f14){var _0x3309af={};_0x3309af[_0x288f14]={'$like':'%'+_0x31dfe6[_0x6ee4('0x51')][_0x6ee4('0x5b')]+'%'};return _0x3309af;})});}_0x3952e7=_[_0x6ee4('0x5c')]({},_0x3952e7,_0x31dfe6[_0x6ee4('0x5e')]);return _0x2eed44['getAgents'](_0x3952e7);}})[_0x6ee4('0x1c')](function(_0x15250f){if(_0x15250f){_0x5eada9=_0x15250f[_0x6ee4('0x55')];if(!_0x31dfe6[_0x6ee4('0x51')][_0x6ee4('0x73')](_0x6ee4('0x78'))){_0x3952e7['limit']=qs[_0x6ee4('0x2c')](_0x31dfe6[_0x6ee4('0x51')][_0x6ee4('0x2c')]);_0x3952e7[_0x6ee4('0x2f')]=qs['offset'](_0x31dfe6['query']['offset']);}return _0x2eed44[_0x6ee4('0x12c')](_0x3952e7);}})[_0x6ee4('0x1c')](function(_0x4d839e){if(_0x4d839e){return _0x4d839e?{'count':_0x5eada9,'rows':_0x4d839e}:null;}})[_0x6ee4('0x1c')](respondWithResult(_0x4bce61,null))[_0x6ee4('0x27')](handleError(_0x4bce61,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 0ce68f1..96f5dd7 100644 --- a/server/api/chatWebsite/chatWebsite.events.js +++ b/server/api/chatWebsite/chatWebsite.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad36=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0xe19540,_0x322387){var _0xee5410=function(_0x1a0099){while(--_0x1a0099){_0xe19540['push'](_0xe19540['shift']());}};_0xee5410(++_0x322387);}(_0xad36,0x11c));var _0x6ad3=function(_0x5f09fc,_0x2beba0){_0x5f09fc=_0x5f09fc-0x0;var _0x5537af=_0xad36[_0x5f09fc];return _0x5537af;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x6ad3('0x0'))['db'][_0x6ad3('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x6ad3('0x2')](0x0);var events={'afterCreate':_0x6ad3('0x3'),'afterUpdate':_0x6ad3('0x4'),'afterDestroy':_0x6ad3('0x5')};function emitEvent(_0xef54ab){return function(_0x17a9b2,_0x3d8fee,_0x4bc79b){ChatWebsiteEvents[_0x6ad3('0x6')](_0xef54ab+':'+_0x17a9b2['id'],_0x17a9b2);ChatWebsiteEvents[_0x6ad3('0x6')](_0xef54ab,_0x17a9b2);_0x4bc79b(null);};}for(var e in events){if(events[_0x6ad3('0x7')](e)){var event=events[e];ChatWebsite[_0x6ad3('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0xdbd0=['events','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x4bdbbe,_0x29c144){var _0x340998=function(_0x32d56c){while(--_0x32d56c){_0x4bdbbe['push'](_0x4bdbbe['shift']());}};_0x340998(++_0x29c144);}(_0xdbd0,0x88));var _0x0dbd=function(_0x38a9c7,_0x28d3ef){_0x38a9c7=_0x38a9c7-0x0;var _0x2ab87=_0xdbd0[_0x38a9c7];return _0x2ab87;};'use strict';var EventEmitter=require(_0x0dbd('0x0'));var ChatWebsite=require(_0x0dbd('0x1'))['db'][_0x0dbd('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0dbd('0x3')](0x0);var events={'afterCreate':_0x0dbd('0x4'),'afterUpdate':'update','afterDestroy':_0x0dbd('0x5')};function emitEvent(_0x190897){return function(_0x1aeffb,_0x5ec8d7,_0x333815){ChatWebsiteEvents[_0x0dbd('0x6')](_0x190897+':'+_0x1aeffb['id'],_0x1aeffb);ChatWebsiteEvents[_0x0dbd('0x6')](_0x190897,_0x1aeffb);_0x333815(null);};}for(var e in events){if(events[_0x0dbd('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 37f3046..9c9e659 100644 --- a/server/api/chatWebsite/chatWebsite.model.js +++ b/server/api/chatWebsite/chatWebsite.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb760=['../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','rimraf'];(function(_0x40dc7e,_0x322488){var _0x31f6d4=function(_0x2db5e2){while(--_0x2db5e2){_0x40dc7e['push'](_0x40dc7e['shift']());}};_0x31f6d4(++_0x322488);}(_0xb760,0xb9));var _0x0b76=function(_0x41502b,_0x577b3a){_0x41502b=_0x41502b-0x0;var _0x109f0f=_0xb760[_0x41502b];return _0x109f0f;};'use strict';var _=require(_0x0b76('0x0'));var util=require(_0x0b76('0x1'));var logger=require(_0x0b76('0x2'))(_0x0b76('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0b76('0x4'));var config=require(_0x0b76('0x5'));var attributes=require(_0x0b76('0x6'));module[_0x0b76('0x7')]=function(_0x244c20,_0x50cf57){return _0x244c20['define'](_0x0b76('0x8'),attributes,{'tableName':_0x0b76('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x862d=['api','moment','bluebird','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger'];(function(_0x32e1fb,_0x59b069){var _0xc106ee=function(_0x5f0d01){while(--_0x5f0d01){_0x32e1fb['push'](_0x32e1fb['shift']());}};_0xc106ee(++_0x59b069);}(_0x862d,0x1d2));var _0xd862=function(_0x18d278,_0x23925a){_0x18d278=_0x18d278-0x0;var _0x51bf38=_0x862d[_0x18d278];return _0x51bf38;};'use strict';var _=require(_0xd862('0x0'));var util=require('util');var logger=require(_0xd862('0x1'))(_0xd862('0x2'));var moment=require(_0xd862('0x3'));var BPromise=require(_0xd862('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd862('0x5'));var rimraf=require(_0xd862('0x6'));var config=require('../../config/environment');var attributes=require(_0xd862('0x7'));module[_0xd862('0x8')]=function(_0x1b2d24,_0x248a48){return _0x1b2d24[_0xd862('0x9')](_0xd862('0xa'),attributes,{'tableName':_0xd862('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 4aaea24..a967312 100644 --- a/server/api/chatWebsite/chatWebsite.rpc.js +++ b/server/api/chatWebsite/chatWebsite.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfaaf=['socket.io-emitter','./chatWebsite.socket','register','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost'];(function(_0x39fbbc,_0x9d36ab){var _0x1c171d=function(_0x2d00e7){while(--_0x2d00e7){_0x39fbbc['push'](_0x39fbbc['shift']());}};_0x1c171d(++_0x9d36ab);}(_0xfaaf,0x139));var _0xffaa=function(_0x109371,_0x441c8e){_0x109371=_0x109371-0x0;var _0x4fd858=_0xfaaf[_0x109371];return _0x4fd858;};'use strict';var _=require(_0xffaa('0x0'));var util=require('util');var moment=require(_0xffaa('0x1'));var BPromise=require(_0xffaa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xffaa('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xffaa('0x4'));var logger=require(_0xffaa('0x5'))(_0xffaa('0x6'));var config=require('../../config/environment');var jayson=require(_0xffaa('0x7'));var client=jayson[_0xffaa('0x8')][_0xffaa('0x9')]({'port':0x232a});config['redis']=_[_0xffaa('0xa')](config['redis'],{'host':_0xffaa('0xb'),'port':0x18eb});var socket=require(_0xffaa('0xc'))(new Redis(config['redis']));require(_0xffaa('0xd'))[_0xffaa('0xe')](socket);function respondWithRpcPromise(_0x3493ba,_0x62302d,_0x11a6a6){return new BPromise(function(_0x5de6c8,_0x35e4ff){return client['request'](_0x3493ba,_0x11a6a6)['then'](function(_0x1bb066){logger['info'](_0xffaa('0xf'),_0x62302d,'request\x20sent');logger[_0xffaa('0x10')](_0xffaa('0x11'),_0x62302d,_0xffaa('0x12'),JSON[_0xffaa('0x13')](_0x1bb066));if(_0x1bb066[_0xffaa('0x14')]){if(_0x1bb066['error'][_0xffaa('0x15')]===0x1f4){logger['error'](_0xffaa('0xf'),_0x62302d,_0x1bb066[_0xffaa('0x14')][_0xffaa('0x16')]);return _0x35e4ff(_0x1bb066[_0xffaa('0x14')]['message']);}logger[_0xffaa('0x14')](_0xffaa('0xf'),_0x62302d,_0x1bb066[_0xffaa('0x14')][_0xffaa('0x16')]);return _0x5de6c8(_0x1bb066[_0xffaa('0x14')][_0xffaa('0x16')]);}else{logger[_0xffaa('0x17')](_0xffaa('0xf'),_0x62302d,_0xffaa('0x12'));_0x5de6c8(_0x1bb066[_0xffaa('0x18')][_0xffaa('0x16')]);}})['catch'](function(_0x42ebf3){logger[_0xffaa('0x14')](_0xffaa('0xf'),_0x62302d,_0x42ebf3);_0x35e4ff(_0x42ebf3);});});} \ No newline at end of file +var _0x1037=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result'];(function(_0x117792,_0x32582c){var _0x305c60=function(_0x4a6202){while(--_0x4a6202){_0x117792['push'](_0x117792['shift']());}};_0x305c60(++_0x32582c);}(_0x1037,0x153));var _0x7103=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x1037[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0x7103('0x0'));var util=require('util');var moment=require(_0x7103('0x1'));var BPromise=require('bluebird');var rs=require(_0x7103('0x2'));var fs=require('fs');var Redis=require(_0x7103('0x3'));var db=require(_0x7103('0x4'))['db'];var utils=require(_0x7103('0x5'));var logger=require(_0x7103('0x6'))(_0x7103('0x7'));var config=require(_0x7103('0x8'));var jayson=require(_0x7103('0x9'));var client=jayson['client'][_0x7103('0xa')]({'port':0x232a});config[_0x7103('0xb')]=_[_0x7103('0xc')](config[_0x7103('0xb')],{'host':_0x7103('0xd'),'port':0x18eb});var socket=require(_0x7103('0xe'))(new Redis(config[_0x7103('0xb')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x2a0fee,_0x3a6258,_0x51db87){return new BPromise(function(_0x15773c,_0x3ad160){return client[_0x7103('0xf')](_0x2a0fee,_0x51db87)[_0x7103('0x10')](function(_0x10c2ae){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x3a6258,_0x7103('0x11'));logger[_0x7103('0x12')](_0x7103('0x13'),_0x3a6258,_0x7103('0x11'),JSON[_0x7103('0x14')](_0x10c2ae));if(_0x10c2ae[_0x7103('0x15')]){if(_0x10c2ae['error']['code']===0x1f4){logger[_0x7103('0x15')](_0x7103('0x16'),_0x3a6258,_0x10c2ae[_0x7103('0x15')]['message']);return _0x3ad160(_0x10c2ae[_0x7103('0x15')][_0x7103('0x17')]);}logger[_0x7103('0x15')](_0x7103('0x16'),_0x3a6258,_0x10c2ae['error'][_0x7103('0x17')]);return _0x15773c(_0x10c2ae[_0x7103('0x15')][_0x7103('0x17')]);}else{logger['info'](_0x7103('0x16'),_0x3a6258,_0x7103('0x11'));_0x15773c(_0x10c2ae[_0x7103('0x18')]['message']);}})[_0x7103('0x19')](function(_0x7b683e){logger[_0x7103('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x3a6258,_0x7b683e);_0x3ad160(_0x7b683e);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 8d61396..5e3f255 100644 --- a/server/api/chatWebsite/chatWebsite.socket.js +++ b/server/api/chatWebsite/chatWebsite.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2de1=['removeListener','register','chatWebsite:','save','remove','update'];(function(_0x5e3ba8,_0x330069){var _0x442f6c=function(_0xb3a7f){while(--_0xb3a7f){_0x5e3ba8['push'](_0x5e3ba8['shift']());}};_0x442f6c(++_0x330069);}(_0x2de1,0x6f));var _0x12de=function(_0x3ff6fb,_0x4f56f4){_0x3ff6fb=_0x3ff6fb-0x0;var _0x15f6e3=_0x2de1[_0x3ff6fb];return _0x15f6e3;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x12de('0x0'),_0x12de('0x1'),_0x12de('0x2')];function createListener(_0x4914c8,_0x49ee78){return function(_0x13b620){_0x49ee78['emit'](_0x4914c8,_0x13b620);};}function removeListener(_0x1fe4ec,_0x236644){return function(){ChatWebsiteEvents[_0x12de('0x3')](_0x1fe4ec,_0x236644);};}exports[_0x12de('0x4')]=function(_0x2e6cf4){for(var _0xe4946d=0x0,_0x47e5a0=events['length'];_0xe4946d<_0x47e5a0;_0xe4946d++){var _0x1c11cc=events[_0xe4946d];var _0x10d8ff=createListener(_0x12de('0x5')+_0x1c11cc,_0x2e6cf4);ChatWebsiteEvents['on'](_0x1c11cc,_0x10d8ff);}}; \ No newline at end of file +var _0x433e=['removeListener','register','chatWebsite:','./chatWebsite.events','save','remove','emit'];(function(_0x364390,_0x46b408){var _0x3cf60d=function(_0x551d05){while(--_0x551d05){_0x364390['push'](_0x364390['shift']());}};_0x3cf60d(++_0x46b408);}(_0x433e,0xf8));var _0xe433=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x433e[_0x20a584];return _0x4b41a8;};'use strict';var ChatWebsiteEvents=require(_0xe433('0x0'));var events=[_0xe433('0x1'),_0xe433('0x2'),'update'];function createListener(_0x38472e,_0x394fc1){return function(_0x166975){_0x394fc1[_0xe433('0x3')](_0x38472e,_0x166975);};}function removeListener(_0x2e996a,_0x4792af){return function(){ChatWebsiteEvents[_0xe433('0x4')](_0x2e996a,_0x4792af);};}exports[_0xe433('0x5')]=function(_0x2fadd8){for(var _0x2ab33a=0x0,_0x5e953a=events['length'];_0x2ab33a<_0x5e953a;_0x2ab33a++){var _0x49b7e2=events[_0x2ab33a];var _0x488088=createListener(_0xe433('0x6')+_0x49b7e2,_0x2fadd8);ChatWebsiteEvents['on'](_0x49b7e2,_0x488088);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js index c66f900..c1927eb 100644 --- a/server/api/chatWebsite/helpers/wildcard-expressions.js +++ b/server/api/chatWebsite/helpers/wildcard-expressions.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6170=['([\x5cw]+)','test','exports','../../../utils/misc','escapeRegExp','url','URL','replace','localhost'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6170,0x17d));var _0x0617=function(_0x2eb0d6,_0x3d73db){_0x2eb0d6=_0x2eb0d6-0x0;var _0x8b4f8=_0x6170[_0x2eb0d6];return _0x8b4f8;};var escapeRegExp=require(_0x0617('0x0'))[_0x0617('0x1')];var URL=require(_0x0617('0x2'))[_0x0617('0x3')];function testWildcardValidity(_0x532d4e){let _0x1b262d=!![];try{new URL(_0x532d4e[_0x0617('0x4')]('*',_0x0617('0x5')));}catch(_0x4f4584){_0x1b262d=![];}return _0x1b262d&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)['test'](_0x532d4e);}function testWebsiteWithWildcard(_0x533a29,_0xf7b877){let _0x4cb118;const _0x3bffba=escapeRegExp(_0x533a29)[_0x0617('0x4')]('\x5c*',_0x0617('0x6'));try{new URL(_0x533a29[_0x0617('0x4')]('\x5c*',_0x0617('0x5')));_0x4cb118=new RegExp(_0x3bffba)[_0x0617('0x7')](_0xf7b877);}catch(_0x8de8b3){_0x4cb118=![];}return _0x4cb118;}module[_0x0617('0x8')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file +var _0x0624=['exports','replace','localhost','test','([\x5cw]+)'];(function(_0x4e3ac5,_0x18d402){var _0x3b408f=function(_0xd0214a){while(--_0xd0214a){_0x4e3ac5['push'](_0x4e3ac5['shift']());}};_0x3b408f(++_0x18d402);}(_0x0624,0x132));var _0x4062=function(_0x50b8dc,_0x1a6352){_0x50b8dc=_0x50b8dc-0x0;var _0x439b2a=_0x0624[_0x50b8dc];return _0x439b2a;};var escapeRegExp=require('../../../utils/misc')['escapeRegExp'];var URL=require('url')['URL'];function testWildcardValidity(_0x2d6840){let _0x144406=!![];try{new URL(_0x2d6840[_0x4062('0x0')]('*',_0x4062('0x1')));}catch(_0x29add8){_0x144406=![];}return _0x144406&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x4062('0x2')](_0x2d6840);}function testWebsiteWithWildcard(_0x4bb157,_0x553d08){let _0x353a85;const _0x2ec6dd=escapeRegExp(_0x4bb157)[_0x4062('0x0')]('\x5c*',_0x4062('0x3'));try{new URL(_0x4bb157[_0x4062('0x0')]('\x5c*','localhost'));_0x353a85=new RegExp(_0x2ec6dd)[_0x4062('0x2')](_0x553d08);}catch(_0x4b36f6){_0x353a85=![];}return _0x353a85;}module[_0x4062('0x4')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 71c6601..70b2d9a 100644 --- a/server/api/chatWebsite/index.js +++ b/server/api/chatWebsite/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ce5=['/:id/users','getAgents','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','single','file','server/files/images/avatars/','addAvatar','originalname','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','server/files','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','/:id','destroy','removeAnswers','removeAgents','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getOfflineMessages'];(function(_0xfb9aa7,_0x1bfc34){var _0xe996d7=function(_0x175c01){while(--_0x175c01){_0xfb9aa7['push'](_0xfb9aa7['shift']());}};_0xe996d7(++_0x1bfc34);}(_0x6ce5,0xaf));var _0x56ce=function(_0x588a94,_0x18540b){_0x588a94=_0x588a94-0x0;var _0x2bb5fc=_0x6ce5[_0x588a94];return _0x2bb5fc;};'use strict';var multer=require(_0x56ce('0x0'));var util=require(_0x56ce('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x56ce('0x2'));var router=express['Router']();var fs_extra=require(_0x56ce('0x3'));var auth=require(_0x56ce('0x4'));var interaction=require(_0x56ce('0x5'));var config=require(_0x56ce('0x6'));var controller=require(_0x56ce('0x7'));router[_0x56ce('0x8')]('/',auth['isAuthenticated'](),controller[_0x56ce('0x9')]);router[_0x56ce('0x8')](_0x56ce('0xa'),auth[_0x56ce('0xb')](),controller[_0x56ce('0xc')]);router[_0x56ce('0x8')]('/:id',auth[_0x56ce('0xb')](),controller['show']);router[_0x56ce('0x8')](_0x56ce('0xd'),auth[_0x56ce('0xb')](),controller[_0x56ce('0xe')]);router[_0x56ce('0x8')](_0x56ce('0xf'),auth[_0x56ce('0xb')](),controller[_0x56ce('0x10')]);router['get'](_0x56ce('0x11'),controller['getLogo']);router['get'](_0x56ce('0x12'),controller[_0x56ce('0x13')]);router[_0x56ce('0x8')]('/:id/customer_avatar',controller[_0x56ce('0x14')]);router[_0x56ce('0x8')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0x56ce('0x8')](_0x56ce('0x15'),auth[_0x56ce('0xb')](),controller['getInteractions']);router[_0x56ce('0x8')](_0x56ce('0x16'),controller[_0x56ce('0x17')]);router[_0x56ce('0x8')](_0x56ce('0x18'),auth[_0x56ce('0xb')](),controller[_0x56ce('0x19')]);router[_0x56ce('0x8')](_0x56ce('0x1a'),auth['isAuthenticated'](),controller[_0x56ce('0x1b')]);router['get']('/:id/fields',controller['getFields']);router[_0x56ce('0x8')]('/:id/offline_messages',auth[_0x56ce('0xb')](),controller[_0x56ce('0x1c')]);router['get'](_0x56ce('0x1d'),auth[_0x56ce('0xb')](),controller[_0x56ce('0x1e')]);router[_0x56ce('0x1f')]('/',auth[_0x56ce('0xb')](),controller[_0x56ce('0x20')]);router[_0x56ce('0x1f')](_0x56ce('0xd'),auth[_0x56ce('0xb')](),controller['addDisposition']);router['post'](_0x56ce('0xf'),auth[_0x56ce('0xb')](),controller[_0x56ce('0x21')]);var upload=multer({'storage':multer[_0x56ce('0x22')]({'destination':function(_0x5ebdda,_0x37b29c,_0x5de222){_0x5de222(null,path[_0x56ce('0x23')](config[_0x56ce('0x24')],_0x56ce('0x25')));},'filename':function(_0x349328,_0x58b4e3,_0x555cc1){_0x555cc1(null,util[_0x56ce('0x26')](_0x56ce('0x27'),Date[_0x56ce('0x28')](),_0x58b4e3['originalname']));}})});router[_0x56ce('0x1f')](_0x56ce('0x11'),upload[_0x56ce('0x29')](_0x56ce('0x2a')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4f9cff,_0x11954d,_0x98fbcd){_0x98fbcd(null,path[_0x56ce('0x23')](config[_0x56ce('0x24')],_0x56ce('0x2b')));},'filename':function(_0x1409f6,_0x9753ab,_0x29bcfc){_0x29bcfc(null,util[_0x56ce('0x26')]('%s-%s',Date[_0x56ce('0x28')](),_0x9753ab['originalname']));}})});router[_0x56ce('0x1f')](_0x56ce('0x12'),upload['single'](_0x56ce('0x2a')),controller[_0x56ce('0x2c')]);var upload=multer({'storage':multer[_0x56ce('0x22')]({'destination':function(_0x5c457e,_0xdf8498,_0x15a17e){_0x15a17e(null,path[_0x56ce('0x23')](config[_0x56ce('0x24')],_0x56ce('0x2b')));},'filename':function(_0x4b4385,_0x464928,_0x5c6238){_0x5c6238(null,util[_0x56ce('0x26')](_0x56ce('0x27'),Date['now'](),_0x464928[_0x56ce('0x2d')]));}})});router[_0x56ce('0x1f')](_0x56ce('0x2e'),upload[_0x56ce('0x29')](_0x56ce('0x2a')),controller[_0x56ce('0x2f')]);var upload=multer({'storage':multer[_0x56ce('0x22')]({'destination':function(_0x3ed0c5,_0xf15233,_0x21b04a){_0x21b04a(null,path[_0x56ce('0x23')](config[_0x56ce('0x24')],_0x56ce('0x2b')));},'filename':function(_0x2f2e74,_0x531171,_0x910c52){_0x910c52(null,util[_0x56ce('0x26')](_0x56ce('0x27'),Date[_0x56ce('0x28')](),_0x531171[_0x56ce('0x2d')]));}})});router[_0x56ce('0x1f')](_0x56ce('0x30'),upload[_0x56ce('0x29')](_0x56ce('0x2a')),controller[_0x56ce('0x31')]);router[_0x56ce('0x1f')](_0x56ce('0x32'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x25f513,_0x43f810,_0x4e522e){const _0x33fa1e=path[_0x56ce('0x23')](config[_0x56ce('0x24')],_0x56ce('0x33'),'attachments','offline-chat');fs_extra['ensureDir'](_0x33fa1e,function(){_0x4e522e(null,_0x33fa1e);});},'filename':function(_0x5d2dd9,_0x23535b,_0x4bafc9){const _0x3d542b=_0x23535b[_0x56ce('0x2d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4dd5f2=path[_0x56ce('0x34')](_0x3d542b);const _0x5beb36=Date['now']()+'-'+_0x3d542b['replace'](_0x4dd5f2,'')+_0x4dd5f2;_0x4bafc9(null,_0x5beb36);}})});router[_0x56ce('0x1f')](_0x56ce('0x35'),offlineUploadMulter[_0x56ce('0x36')](),controller[_0x56ce('0x37')]);router[_0x56ce('0x1f')](_0x56ce('0x15'),auth[_0x56ce('0xb')](),controller[_0x56ce('0x38')]);router[_0x56ce('0x1f')](_0x56ce('0x18'),auth[_0x56ce('0xb')](),controller[_0x56ce('0x39')]);router['post'](_0x56ce('0x1a'),auth['isAuthenticated'](),controller[_0x56ce('0x3a')]);router[_0x56ce('0x1f')](_0x56ce('0x1d'),auth['isAuthenticated'](),controller[_0x56ce('0x3b')]);router[_0x56ce('0x3c')]('/:id',auth[_0x56ce('0xb')](),controller[_0x56ce('0x3d')]);router[_0x56ce('0x3e')](_0x56ce('0x3f'),auth['isAuthenticated'](),controller[_0x56ce('0x40')]);router[_0x56ce('0x3e')](_0x56ce('0xd'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x56ce('0x3e')]('/:id/canned_answers',auth[_0x56ce('0xb')](),controller[_0x56ce('0x41')]);router['delete'](_0x56ce('0x1d'),auth[_0x56ce('0xb')](),controller[_0x56ce('0x42')]);module[_0x56ce('0x43')]=router; \ No newline at end of file +var _0x0bc4=['getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','addDisposition','addAnswer','join','root','server/files/images/logos/','format','now','originalname','/:id/logo','file','addLogo','%s-%s','addAvatar','diskStorage','single','addCustomerAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','any','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions'];(function(_0x380dcc,_0x3648aa){var _0x1b5915=function(_0x5ea9ef){while(--_0x5ea9ef){_0x380dcc['push'](_0x380dcc['shift']());}};_0x1b5915(++_0x3648aa);}(_0x0bc4,0x1a5));var _0x40bc=function(_0x40753a,_0x4f8ec6){_0x40753a=_0x40753a-0x0;var _0x516d00=_0x0bc4[_0x40753a];return _0x516d00;};'use strict';var multer=require(_0x40bc('0x0'));var util=require(_0x40bc('0x1'));var path=require(_0x40bc('0x2'));var timeout=require(_0x40bc('0x3'));var express=require(_0x40bc('0x4'));var router=express[_0x40bc('0x5')]();var fs_extra=require(_0x40bc('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x40bc('0x7'));var config=require(_0x40bc('0x8'));var controller=require('./chatWebsite.controller');router[_0x40bc('0x9')]('/',auth[_0x40bc('0xa')](),controller[_0x40bc('0xb')]);router[_0x40bc('0x9')](_0x40bc('0xc'),auth[_0x40bc('0xa')](),controller['describe']);router[_0x40bc('0x9')](_0x40bc('0xd'),auth[_0x40bc('0xa')](),controller[_0x40bc('0xe')]);router[_0x40bc('0x9')](_0x40bc('0xf'),auth[_0x40bc('0xa')](),controller['getDispositions']);router['get'](_0x40bc('0x10'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x11')]);router[_0x40bc('0x9')]('/:id/logo',controller[_0x40bc('0x12')]);router['get'](_0x40bc('0x13'),controller['getAvatar']);router[_0x40bc('0x9')](_0x40bc('0x14'),controller[_0x40bc('0x15')]);router[_0x40bc('0x9')](_0x40bc('0x16'),controller['getSystemAvatar']);router[_0x40bc('0x9')]('/:id/interactions',auth[_0x40bc('0xa')](),controller[_0x40bc('0x17')]);router[_0x40bc('0x9')](_0x40bc('0x18'),controller[_0x40bc('0x19')]);router[_0x40bc('0x9')](_0x40bc('0x1a'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x1b')]);router[_0x40bc('0x9')](_0x40bc('0x1c'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x1d')]);router['get'](_0x40bc('0x1e'),controller[_0x40bc('0x1f')]);router[_0x40bc('0x9')](_0x40bc('0x20'),auth['isAuthenticated'](),controller[_0x40bc('0x21')]);router['get'](_0x40bc('0x22'),auth[_0x40bc('0xa')](),controller['getAgents']);router[_0x40bc('0x23')]('/',auth[_0x40bc('0xa')](),controller['create']);router[_0x40bc('0x23')]('/:id/dispositions',auth[_0x40bc('0xa')](),controller[_0x40bc('0x24')]);router[_0x40bc('0x23')]('/:id/canned_answers',auth[_0x40bc('0xa')](),controller[_0x40bc('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x533a8b,_0x431ecd,_0x3b10bd){_0x3b10bd(null,path[_0x40bc('0x26')](config[_0x40bc('0x27')],_0x40bc('0x28')));},'filename':function(_0x105755,_0x4e12c6,_0x1eb66e){_0x1eb66e(null,util[_0x40bc('0x29')]('%s-%s',Date[_0x40bc('0x2a')](),_0x4e12c6[_0x40bc('0x2b')]));}})});router[_0x40bc('0x23')](_0x40bc('0x2c'),upload['single'](_0x40bc('0x2d')),controller[_0x40bc('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1dd976,_0x504826,_0x59d0af){_0x59d0af(null,path[_0x40bc('0x26')](config[_0x40bc('0x27')],'server/files/images/avatars/'));},'filename':function(_0x3eae0b,_0x5598c1,_0x35013e){_0x35013e(null,util['format'](_0x40bc('0x2f'),Date[_0x40bc('0x2a')](),_0x5598c1[_0x40bc('0x2b')]));}})});router[_0x40bc('0x23')]('/:id/avatar',upload['single']('file'),controller[_0x40bc('0x30')]);var upload=multer({'storage':multer[_0x40bc('0x31')]({'destination':function(_0x32ba43,_0x493677,_0x235e41){_0x235e41(null,path[_0x40bc('0x26')](config['root'],'server/files/images/avatars/'));},'filename':function(_0xea153b,_0x3ad4f8,_0x238366){_0x238366(null,util[_0x40bc('0x29')](_0x40bc('0x2f'),Date[_0x40bc('0x2a')](),_0x3ad4f8['originalname']));}})});router[_0x40bc('0x23')]('/:id/customer_avatar',upload[_0x40bc('0x32')](_0x40bc('0x2d')),controller[_0x40bc('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2fa0ec,_0x1f9f8a,_0x14c4fb){_0x14c4fb(null,path[_0x40bc('0x26')](config[_0x40bc('0x27')],_0x40bc('0x34')));},'filename':function(_0x649c15,_0x186aee,_0x39405d){_0x39405d(null,util[_0x40bc('0x29')](_0x40bc('0x2f'),Date[_0x40bc('0x2a')](),_0x186aee['originalname']));}})});router['post'](_0x40bc('0x16'),upload['single'](_0x40bc('0x2d')),controller[_0x40bc('0x35')]);router[_0x40bc('0x23')](_0x40bc('0x36'),controller[_0x40bc('0x37')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x3b3767,_0x34b3e2,_0x153863){const _0x2ec81f=path[_0x40bc('0x26')](config['root'],_0x40bc('0x38'),_0x40bc('0x39'),'offline-chat');fs_extra[_0x40bc('0x3a')](_0x2ec81f,function(){_0x153863(null,_0x2ec81f);});},'filename':function(_0x36a20c,_0xacce26,_0x1421bc){const _0x583e46=_0xacce26['originalname'][_0x40bc('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5c8017=path[_0x40bc('0x3c')](_0x583e46);const _0x1b307a=Date[_0x40bc('0x2a')]()+'-'+_0x583e46[_0x40bc('0x3b')](_0x5c8017,'')+_0x5c8017;_0x1421bc(null,_0x1b307a);}})});router['post']('/:id/offline',offlineUploadMulter[_0x40bc('0x3d')](),controller[_0x40bc('0x3e')]);router[_0x40bc('0x23')](_0x40bc('0x3f'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x40')]);router['post'](_0x40bc('0x1a'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x41')]);router['post'](_0x40bc('0x1c'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x42')]);router[_0x40bc('0x23')](_0x40bc('0x22'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x43')]);router[_0x40bc('0x44')](_0x40bc('0xd'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x45')]);router['delete'](_0x40bc('0xd'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x46')]);router[_0x40bc('0x47')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x40bc('0x48')]);router[_0x40bc('0x47')](_0x40bc('0x10'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x49')]);router[_0x40bc('0x47')](_0x40bc('0x22'),auth['isAuthenticated'](),controller[_0x40bc('0x4a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 86adbaa..4e54fd3 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc0f9=['production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','isAuthenticated','exports','beaver-logger/server','express','../config/environment','Router','env'];(function(_0x1d2ca4,_0x469af6){var _0x35398a=function(_0x3638f6){while(--_0x3638f6){_0x1d2ca4['push'](_0x1d2ca4['shift']());}};_0x35398a(++_0x469af6);}(_0xc0f9,0xa4));var _0x9c0f=function(_0xc3aae7,_0x3bfa91){_0xc3aae7=_0xc3aae7-0x0;var _0x1f365a=_0xc0f9[_0xc3aae7];return _0x1f365a;};var beaverLogger=require(_0x9c0f('0x0'));var express=require(_0x9c0f('0x1'));var auth=require('../components/auth/service');var config=require(_0x9c0f('0x2'));var router=express[_0x9c0f('0x3')]();var isProduction=config[_0x9c0f('0x4')]===_0x9c0f('0x5')||![];function clientSideLogs(_0x2f42e8,_0x802b80,_0x3d160d){var _0xf96a2e=_0x2f42e8[_0x9c0f('0x6')][_0x9c0f('0x7')](_0x9c0f('0x8'));if(!_0xf96a2e){throw new Error(_0x9c0f('0x9'));}return beaverLogger[_0x9c0f('0xa')]({'uri':'/client-logs','logger':_0xf96a2e,'enableCors':!isProduction})(_0x2f42e8,_0x802b80,_0x3d160d);}router['use'](auth[_0x9c0f('0xb')](),clientSideLogs);module[_0x9c0f('0xc')]=router; \ No newline at end of file +var _0x1649=['Client-Side\x20logger\x20not\x20found!','/client-logs','isAuthenticated','beaver-logger/server','express','../config/environment','env','production','app','get','client-side-logger'];(function(_0x337408,_0x49418b){var _0x88e674=function(_0x306620){while(--_0x306620){_0x337408['push'](_0x337408['shift']());}};_0x88e674(++_0x49418b);}(_0x1649,0xbe));var _0x9164=function(_0x38afa6,_0x1ae790){_0x38afa6=_0x38afa6-0x0;var _0x7707ea=_0x1649[_0x38afa6];return _0x7707ea;};var beaverLogger=require(_0x9164('0x0'));var express=require(_0x9164('0x1'));var auth=require('../components/auth/service');var config=require(_0x9164('0x2'));var router=express['Router']();var isProduction=config[_0x9164('0x3')]===_0x9164('0x4')||![];function clientSideLogs(_0x297f4e,_0x5d980f,_0x473255){var _0x4b9ef8=_0x297f4e[_0x9164('0x5')][_0x9164('0x6')](_0x9164('0x7'));if(!_0x4b9ef8){throw new Error(_0x9164('0x8'));}return beaverLogger['expressEndpoint']({'uri':_0x9164('0x9'),'logger':_0x4b9ef8,'enableCors':!isProduction})(_0x297f4e,_0x5d980f,_0x473255);}router['use'](auth[_0x9164('0xa')](),clientSideLogs);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index aec33a9..ebdf2c6 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea51=['MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','ENUM','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x3686a8,_0x4e3062){var _0x4e8136=function(_0x516487){while(--_0x516487){_0x3686a8['push'](_0x3686a8['shift']());}};_0x4e8136(++_0x4e3062);}(_0xea51,0x114));var _0x1ea5=function(_0x68e69a,_0x3a44b8){_0x68e69a=_0x68e69a-0x0;var _0x2eb629=_0xea51[_0x68e69a];return _0x2eb629;};'use strict';var Sequelize=require(_0x1ea5('0x0'));module[_0x1ea5('0x1')]={'name':{'type':Sequelize[_0x1ea5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x1ea5('0x3')]('AmazonAWS','Google',_0x1ea5('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x1ea5('0x3')]('Outlook365',_0x1ea5('0x5'))},'data1':{'type':Sequelize[_0x1ea5('0x2')],'comment':_0x1ea5('0x6')},'data2':{'type':Sequelize[_0x1ea5('0x2')],'comment':_0x1ea5('0x7')},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x1ea5('0x2')],'comment':_0x1ea5('0x8')},'data5':{'type':Sequelize[_0x1ea5('0x9')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize['TEXT'],'comment':_0x1ea5('0xa')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0xfd63=['ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','sequelize','exports','STRING'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xfd63,0xef));var _0x3fd6=function(_0x3910e7,_0x46aa99){_0x3910e7=_0x3910e7-0x0;var _0x3b2a91=_0xfd63[_0x3910e7];return _0x3b2a91;};'use strict';var Sequelize=require(_0x3fd6('0x0'));module[_0x3fd6('0x1')]={'name':{'type':Sequelize[_0x3fd6('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3fd6('0x3')](_0x3fd6('0x4'),'Google',_0x3fd6('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x3fd6('0x6'),_0x3fd6('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x3fd6('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x3fd6('0x2')],'comment':_0x3fd6('0x8')},'data5':{'type':Sequelize[_0x3fd6('0x9')],'comment':_0x3fd6('0xa')},'data6':{'type':Sequelize[_0x3fd6('0x9')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index ce3c394..4aceb87 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcdee=['get','state','Invalid\x20state\x20parameter','parse','from','base64','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','refresh_token','data6','startRefreshInterval','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','socket.io-emitter','status','end','json','undefined','count','offset','limit','set','update','then','sendStatus','error','stack','name','send','padEnd','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','CloudProvider','includeAll','include','service','MicrosoftAzure','decryptString','data3','catch','show','params','options','find','body','Name\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback'];(function(_0x4fe726,_0x277e39){var _0x132568=function(_0x527eb4){while(--_0x527eb4){_0x4fe726['push'](_0x4fe726['shift']());}};_0x132568(++_0x277e39);}(_0xcdee,0xd5));var _0xecde=function(_0x10e39f,_0x15d428){_0x10e39f=_0x10e39f-0x0;var _0x4a364e=_0xcdee[_0x10e39f];return _0x4a364e;};'use strict';var _=require(_0xecde('0x0'));var Redis=require(_0xecde('0x1'));var qs=require(_0xecde('0x2'));var encryptor=require(_0xecde('0x3'));var config=require(_0xecde('0x4'));var logger=require('../../config/logger')(_0xecde('0x5'));var db=require(_0xecde('0x6'))['db'];var oauth=require(_0xecde('0x7'));config['redis']=_[_0xecde('0x8')](config[_0xecde('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xecde('0xa'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x16c171,_0x2b2cb6){_0x2b2cb6=_0x2b2cb6||0xcc;return function(_0x218ff0){if(_0x218ff0){return _0x16c171['sendStatus'](_0x2b2cb6);}return _0x16c171[_0xecde('0xb')](_0x2b2cb6)[_0xecde('0xc')]();};}function respondWithResult(_0xa2541,_0x5811f9){_0x5811f9=_0x5811f9||0xc8;return function(_0x344057){if(_0x344057){return _0xa2541[_0xecde('0xb')](_0x5811f9)[_0xecde('0xd')](_0x344057);}};}function respondWithFilteredResult(_0x20bf35,_0x900506){return function(_0x45700e){if(_0x45700e){var _0x20057d=typeof _0x900506['offset']===_0xecde('0xe')&&typeof _0x900506['limit']===_0xecde('0xe');var _0x523e1c=_0x45700e[_0xecde('0xf')];var _0x31e63b=_0x20057d?0x0:_0x900506[_0xecde('0x10')];var _0x59df6c=_0x20057d?_0x45700e['count']:_0x900506[_0xecde('0x10')]+_0x900506[_0xecde('0x11')];var _0x24d051;if(_0x59df6c>=_0x523e1c){_0x59df6c=_0x523e1c;_0x24d051=0xc8;}else{_0x24d051=0xce;}_0x20bf35[_0xecde('0xb')](_0x24d051);return _0x20bf35[_0xecde('0x12')]('Content-Range',_0x31e63b+'-'+_0x59df6c+'/'+_0x523e1c)[_0xecde('0xd')](_0x45700e);}return null;};}function saveUpdates(_0x20c118){return function(_0x251bc1){if(_0x251bc1){return _0x251bc1[_0xecde('0x13')](_0x20c118)[_0xecde('0x14')](function(_0x42f309){return _0x42f309;});}return null;};}function removeEntity(_0xdc1f61){return function(_0x57ff49){if(_0x57ff49){return _0x57ff49['destroy']()['then'](function(){_0xdc1f61[_0xecde('0xb')](0xcc)[_0xecde('0xc')]();});}};}function handleEntityNotFound(_0x16d84d){return function(_0x50aaf8){if(!_0x50aaf8){_0x16d84d[_0xecde('0x15')](0x194);}return _0x50aaf8;};}function handleError(_0x3043c0,_0x5b6474){_0x5b6474=_0x5b6474||0x1f4;return function(_0x32115d){logger[_0xecde('0x16')](_0x32115d[_0xecde('0x17')]);if(_0x32115d[_0xecde('0x18')]){delete _0x32115d[_0xecde('0x18')];}_0x3043c0[_0xecde('0xb')](_0x5b6474)[_0xecde('0x19')](_0x32115d);};}function maskClientSecret(_0x459112){return _[_0xecde('0x1a')](_0x459112['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x1bbae0,_0x43f2cc){var _0xce5303={},_0xaf0a51={},_0x3bee49={'count':0x0,'rows':[]};var _0x1e5073=_[_0xecde('0x1b')](db['CloudProvider'][_0xecde('0x1c')],function(_0x10c8a0){return{'name':_0x10c8a0[_0xecde('0x1d')],'type':_0x10c8a0[_0xecde('0x1e')]['key']};});_0xaf0a51[_0xecde('0x1f')]=_[_0xecde('0x1b')](_0x1e5073,_0xecde('0x18'));_0xaf0a51[_0xecde('0x20')]=_[_0xecde('0x21')](_0x1bbae0[_0xecde('0x20')]);_0xaf0a51[_0xecde('0x22')]=_[_0xecde('0x23')](_0xaf0a51[_0xecde('0x1f')],_0xaf0a51[_0xecde('0x20')]);_0xce5303[_0xecde('0x24')]=_[_0xecde('0x23')](_0xaf0a51[_0xecde('0x1f')],qs[_0xecde('0x25')](_0x1bbae0[_0xecde('0x20')][_0xecde('0x25')]));_0xce5303[_0xecde('0x24')]=_0xce5303[_0xecde('0x24')][_0xecde('0x26')]?_0xce5303[_0xecde('0x24')]:_0xaf0a51[_0xecde('0x1f')];if(!_0x1bbae0[_0xecde('0x20')][_0xecde('0x27')](_0xecde('0x28'))){_0xce5303[_0xecde('0x11')]=qs[_0xecde('0x11')](_0x1bbae0[_0xecde('0x20')][_0xecde('0x11')]);_0xce5303[_0xecde('0x10')]=qs[_0xecde('0x10')](_0x1bbae0[_0xecde('0x20')][_0xecde('0x10')]);}_0xce5303[_0xecde('0x29')]=qs['sort'](_0x1bbae0[_0xecde('0x20')]['sort']);_0xce5303[_0xecde('0x2a')]=qs[_0xecde('0x22')](_[_0xecde('0x2b')](_0x1bbae0[_0xecde('0x20')],_0xaf0a51['filters']),_0x1e5073);if(_0x1bbae0[_0xecde('0x20')][_0xecde('0x2c')]){_0xce5303[_0xecde('0x2a')]=_['merge'](_0xce5303['where'],{'$or':_['map'](_0x1e5073,function(_0x29115a){if(_0x29115a['type']!=='VIRTUAL'){var _0x502a2b={};_0x502a2b[_0x29115a[_0xecde('0x18')]]={'$like':'%'+_0x1bbae0[_0xecde('0x20')][_0xecde('0x2c')]+'%'};return _0x502a2b;}})});}_0xce5303=_[_0xecde('0x2d')]({},_0xce5303,_0x1bbae0['options']);var _0x3fd488={'where':_0xce5303[_0xecde('0x2a')]};return db[_0xecde('0x2e')][_0xecde('0xf')](_0x3fd488)[_0xecde('0x14')](function(_0x450d9b){_0x3bee49['count']=_0x450d9b;if(_0x1bbae0[_0xecde('0x20')][_0xecde('0x2f')]){_0xce5303[_0xecde('0x30')]=[{'all':!![]}];}return db[_0xecde('0x2e')]['findAll'](_0xce5303);})[_0xecde('0x14')](function(_0x58ae40){_0x3bee49['rows']=_['map'](_0x58ae40,function(_0xaaba4f){if(_0xaaba4f[_0xecde('0x31')]===_0xecde('0x32')){var _0x48876a=encryptor[_0xecde('0x33')](_0xaaba4f[_0xecde('0x34')]);_0xaaba4f[_0xecde('0x34')]=maskClientSecret(_0x48876a);}return _0xaaba4f;});return _0x3bee49;})[_0xecde('0x14')](respondWithFilteredResult(_0x43f2cc,_0xce5303))[_0xecde('0x35')](handleError(_0x43f2cc,null));};exports[_0xecde('0x36')]=function(_0x4ef8ca,_0x3cd4c4){var _0x971e30={'raw':!![],'where':{'id':_0x4ef8ca[_0xecde('0x37')]['id']}},_0x525c84={};_0x525c84[_0xecde('0x1f')]=_[_0xecde('0x21')](db[_0xecde('0x2e')][_0xecde('0x1c')]);_0x525c84[_0xecde('0x20')]=_[_0xecde('0x21')](_0x4ef8ca[_0xecde('0x20')]);_0x525c84[_0xecde('0x22')]=_[_0xecde('0x23')](_0x525c84[_0xecde('0x1f')],_0x525c84[_0xecde('0x20')]);_0x971e30[_0xecde('0x24')]=_[_0xecde('0x23')](_0x525c84[_0xecde('0x1f')],qs[_0xecde('0x25')](_0x4ef8ca[_0xecde('0x20')][_0xecde('0x25')]));_0x971e30[_0xecde('0x24')]=_0x971e30[_0xecde('0x24')][_0xecde('0x26')]?_0x971e30[_0xecde('0x24')]:_0x525c84[_0xecde('0x1f')];if(_0x4ef8ca[_0xecde('0x20')]['includeAll']){_0x971e30[_0xecde('0x30')]=[{'all':!![]}];}_0x971e30=_[_0xecde('0x2d')]({},_0x971e30,_0x4ef8ca[_0xecde('0x38')]);return db[_0xecde('0x2e')][_0xecde('0x39')](_0x971e30)[_0xecde('0x14')](handleEntityNotFound(_0x3cd4c4,null))[_0xecde('0x14')](function(_0x2f5441){if(_0x2f5441[_0xecde('0x31')]===_0xecde('0x32')){var _0x2fb39e=encryptor['decryptString'](_0x2f5441[_0xecde('0x34')]);_0x2f5441[_0xecde('0x34')]=maskClientSecret(_0x2fb39e);}return _0x2f5441;})[_0xecde('0x14')](respondWithResult(_0x3cd4c4,null))['catch'](handleError(_0x3cd4c4,null));};exports['create']=function(_0x40575f,_0x44e4e4){if(!_0x40575f[_0xecde('0x3a')][_0xecde('0x18')])throw new Error(_0xecde('0x3b'));if(!_0x40575f[_0xecde('0x3a')][_0xecde('0x31')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x344497=db['CloudProvider'][_0xecde('0x1c')]['service'][_0xecde('0x3c')];if(!_0x344497[_0xecde('0x3d')](_0x40575f[_0xecde('0x3a')][_0xecde('0x31')]))throw new Error(_0xecde('0x3e')+_0x344497[_0xecde('0x3f')](',\x20'));if(_0x40575f[_0xecde('0x3a')][_0xecde('0x31')]===_0xecde('0x32')&&_0x40575f[_0xecde('0x3a')][_0xecde('0x34')]){_0x40575f['body'][_0xecde('0x34')]=encryptor[_0xecde('0x40')](_0x40575f[_0xecde('0x3a')][_0xecde('0x34')]);}return db[_0xecde('0x2e')][_0xecde('0x41')](_0x40575f[_0xecde('0x3a')],{})['then'](respondWithResult(_0x44e4e4,0xc9))['catch'](handleError(_0x44e4e4,null));};exports['update']=function(_0x36f5fc,_0x65bb7b){if(_0x36f5fc[_0xecde('0x3a')]['id']){delete _0x36f5fc[_0xecde('0x3a')]['id'];}return db[_0xecde('0x2e')][_0xecde('0x39')]({'where':{'id':_0x36f5fc['params']['id']}})[_0xecde('0x14')](handleEntityNotFound(_0x65bb7b,null))['then'](function(_0x4f3b70){if(_0x4f3b70['service']===_0xecde('0x32')&&_0x36f5fc[_0xecde('0x3a')][_0xecde('0x34')]){_0x36f5fc[_0xecde('0x3a')][_0xecde('0x34')]=encryptor[_0xecde('0x40')](_0x36f5fc[_0xecde('0x3a')]['data3']);}return _0x4f3b70;})['then'](saveUpdates(_0x36f5fc['body'],null))[_0xecde('0x14')](respondWithResult(_0x65bb7b,null))[_0xecde('0x35')](handleError(_0x65bb7b,null));};exports[_0xecde('0x42')]=function(_0x5e2fd6,_0x9ee1e){return db[_0xecde('0x2e')]['find']({'where':{'id':_0x5e2fd6[_0xecde('0x37')]['id']}})[_0xecde('0x14')](handleEntityNotFound(_0x9ee1e,null))[_0xecde('0x14')](removeEntity(_0x9ee1e,null))['catch'](handleError(_0x9ee1e,null));};exports[_0xecde('0x43')]=function(_0x12674d,_0x36e6bb){return db[_0xecde('0x2e')][_0xecde('0x44')]({'where':{'id':_0x12674d['params']['id']},'raw':!![]})['then'](function(_0x580f3c){if(!_0x580f3c)return _0x36e6bb[_0xecde('0x15')](0x194);return{'url':oauth[_0xecde('0x45')](_0x580f3c,_0x12674d[_0xecde('0x46')]['id'])};})[_0xecde('0x14')](respondWithResult(_0x36e6bb,null))['catch'](handleError(_0x36e6bb,null));};exports[_0xecde('0x47')]=function(_0x5e9768,_0x586dbe){var _0x4755bc=_0x5e9768[_0xecde('0x3a')];var _0x2e0aa4;var _0x4d6565;if(_0x4755bc[_0xecde('0x16')])throw _0x4755bc;redis[_0xecde('0x48')](_0x4755bc[_0xecde('0x49')])['then'](function(_0x3937ff){if(!_0x3937ff)throw new Error(_0xecde('0x4a'));_0x2e0aa4=JSON[_0xecde('0x4b')](_0x3937ff);var _0xd1bbb2=Buffer[_0xecde('0x4c')](_0x4755bc[_0xecde('0x49')],_0xecde('0x4d'))['toString'](_0xecde('0x4e'));_0x4d6565=JSON[_0xecde('0x4b')](_0xd1bbb2);if(!oauth[_0xecde('0x4f')](_0x4755bc['id_token'],_0x2e0aa4[_0xecde('0x50')]))throw new Error(_0xecde('0x51'));redis[_0xecde('0x52')](_0x4755bc[_0xecde('0x49')]);return oauth['getOauth2MicrosoftAccessToken'](_0x4755bc[_0xecde('0x53')],_0x2e0aa4);})['then'](function(_0x698a95){_0x2e0aa4[_0xecde('0x54')]=_0x698a95[_0xecde('0x55')];_0x2e0aa4['data6']=_0x698a95[_0xecde('0x56')];return db[_0xecde('0x2e')]['update']({'data5':_0x2e0aa4[_0xecde('0x54')],'data6':_0x2e0aa4[_0xecde('0x57')]},{'where':{'id':_0x2e0aa4['id']}});})[_0xecde('0x14')](function(){oauth[_0xecde('0x58')](_0x2e0aa4);socket['emit'](_0xecde('0x59'),{'id':_0x4d6565['id']});return;})[_0xecde('0x14')](respondWithStatusCode(_0x586dbe,null))[_0xecde('0x35')](function(_0x4d0d3d){if(_0x4d6565){socket['emit'](_0xecde('0x5a'),{'id':_0x4d6565['id']});}if(!_0x2e0aa4){logger['error'](_0xecde('0x5b'),_0x4d0d3d);return _0x586dbe[_0xecde('0xb')](0x1f4)[_0xecde('0x19')](_0x4d0d3d[_0xecde('0x5c')]);}logger['error'](_0xecde('0x5d'),_0x2e0aa4['id'],JSON[_0xecde('0x5e')](_0x4d0d3d));});}; \ No newline at end of file +var _0x69a7=['base64','toString','isValidIdToken','id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','../../config/environment','../../config/logger','api','./cloudProvider.oauth','defaults','redis','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','name','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','options','find','service','create','body','Name\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','state','parse','from'];(function(_0x21bf1f,_0x451580){var _0x2d2020=function(_0x46370f){while(--_0x46370f){_0x21bf1f['push'](_0x21bf1f['shift']());}};_0x2d2020(++_0x451580);}(_0x69a7,0x67));var _0x769a=function(_0x45aa72,_0x8af642){_0x45aa72=_0x45aa72-0x0;var _0x75adaa=_0x69a7[_0x45aa72];return _0x75adaa;};'use strict';var _=require(_0x769a('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0x769a('0x1'));var logger=require(_0x769a('0x2'))(_0x769a('0x3'));var db=require('../../mysqldb')['db'];var oauth=require(_0x769a('0x4'));config['redis']=_[_0x769a('0x5')](config[_0x769a('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0x769a('0x6')]);function respondWithStatusCode(_0x462d2b,_0x303930){_0x303930=_0x303930||0xcc;return function(_0x86760d){if(_0x86760d){return _0x462d2b[_0x769a('0x7')](_0x303930);}return _0x462d2b[_0x769a('0x8')](_0x303930)[_0x769a('0x9')]();};}function respondWithResult(_0x21df77,_0x12530f){_0x12530f=_0x12530f||0xc8;return function(_0x2c8744){if(_0x2c8744){return _0x21df77['status'](_0x12530f)[_0x769a('0xa')](_0x2c8744);}};}function respondWithFilteredResult(_0x118297,_0x4e7223){return function(_0x449feb){if(_0x449feb){var _0x1f5444=typeof _0x4e7223[_0x769a('0xb')]===_0x769a('0xc')&&typeof _0x4e7223[_0x769a('0xd')]===_0x769a('0xc');var _0x4c8b90=_0x449feb[_0x769a('0xe')];var _0x31287d=_0x1f5444?0x0:_0x4e7223['offset'];var _0x475483=_0x1f5444?_0x449feb[_0x769a('0xe')]:_0x4e7223[_0x769a('0xb')]+_0x4e7223[_0x769a('0xd')];var _0x34dab5;if(_0x475483>=_0x4c8b90){_0x475483=_0x4c8b90;_0x34dab5=0xc8;}else{_0x34dab5=0xce;}_0x118297[_0x769a('0x8')](_0x34dab5);return _0x118297[_0x769a('0xf')](_0x769a('0x10'),_0x31287d+'-'+_0x475483+'/'+_0x4c8b90)[_0x769a('0xa')](_0x449feb);}return null;};}function saveUpdates(_0x5e924b){return function(_0x549d15){if(_0x549d15){return _0x549d15[_0x769a('0x11')](_0x5e924b)[_0x769a('0x12')](function(_0x15bc1c){return _0x15bc1c;});}return null;};}function removeEntity(_0x528b09){return function(_0x13c319){if(_0x13c319){return _0x13c319[_0x769a('0x13')]()[_0x769a('0x12')](function(){_0x528b09['status'](0xcc)[_0x769a('0x9')]();});}};}function handleEntityNotFound(_0x54a2b0){return function(_0x5a291c){if(!_0x5a291c){_0x54a2b0[_0x769a('0x7')](0x194);}return _0x5a291c;};}function handleError(_0x3619a7,_0x5348f5){_0x5348f5=_0x5348f5||0x1f4;return function(_0x3fe62c){logger['error'](_0x3fe62c['stack']);if(_0x3fe62c[_0x769a('0x14')]){delete _0x3fe62c[_0x769a('0x14')];}_0x3619a7['status'](_0x5348f5)['send'](_0x3fe62c);};}function maskClientSecret(_0x3534b5){return _[_0x769a('0x15')](_0x3534b5[_0x769a('0x16')](0x0,0x3),0x14,'*');}exports[_0x769a('0x17')]=function(_0x29812e,_0x530ed7){var _0x324f18={},_0x74a5c1={},_0x27f5cf={'count':0x0,'rows':[]};var _0x228b7f=_[_0x769a('0x18')](db[_0x769a('0x19')][_0x769a('0x1a')],function(_0x24856c){return{'name':_0x24856c[_0x769a('0x1b')],'type':_0x24856c[_0x769a('0x1c')]['key']};});_0x74a5c1[_0x769a('0x1d')]=_[_0x769a('0x18')](_0x228b7f,_0x769a('0x14'));_0x74a5c1['query']=_[_0x769a('0x1e')](_0x29812e[_0x769a('0x1f')]);_0x74a5c1[_0x769a('0x20')]=_[_0x769a('0x21')](_0x74a5c1['model'],_0x74a5c1['query']);_0x324f18[_0x769a('0x22')]=_[_0x769a('0x21')](_0x74a5c1[_0x769a('0x1d')],qs[_0x769a('0x23')](_0x29812e['query'][_0x769a('0x23')]));_0x324f18[_0x769a('0x22')]=_0x324f18[_0x769a('0x22')][_0x769a('0x24')]?_0x324f18[_0x769a('0x22')]:_0x74a5c1[_0x769a('0x1d')];if(!_0x29812e[_0x769a('0x1f')][_0x769a('0x25')]('nolimit')){_0x324f18[_0x769a('0xd')]=qs['limit'](_0x29812e[_0x769a('0x1f')][_0x769a('0xd')]);_0x324f18[_0x769a('0xb')]=qs[_0x769a('0xb')](_0x29812e['query'][_0x769a('0xb')]);}_0x324f18[_0x769a('0x26')]=qs['sort'](_0x29812e[_0x769a('0x1f')]['sort']);_0x324f18[_0x769a('0x27')]=qs[_0x769a('0x20')](_[_0x769a('0x28')](_0x29812e['query'],_0x74a5c1[_0x769a('0x20')]),_0x228b7f);if(_0x29812e['query']['filter']){_0x324f18['where']=_[_0x769a('0x29')](_0x324f18[_0x769a('0x27')],{'$or':_[_0x769a('0x18')](_0x228b7f,function(_0x457dec){if(_0x457dec[_0x769a('0x1c')]!==_0x769a('0x2a')){var _0x154c3a={};_0x154c3a[_0x457dec[_0x769a('0x14')]]={'$like':'%'+_0x29812e[_0x769a('0x1f')][_0x769a('0x2b')]+'%'};return _0x154c3a;}})});}_0x324f18=_[_0x769a('0x29')]({},_0x324f18,_0x29812e['options']);var _0x400465={'where':_0x324f18[_0x769a('0x27')]};return db[_0x769a('0x19')][_0x769a('0xe')](_0x400465)[_0x769a('0x12')](function(_0x2cf8de){_0x27f5cf['count']=_0x2cf8de;if(_0x29812e[_0x769a('0x1f')]['includeAll']){_0x324f18['include']=[{'all':!![]}];}return db[_0x769a('0x19')][_0x769a('0x2c')](_0x324f18);})['then'](function(_0xc59096){_0x27f5cf[_0x769a('0x2d')]=_[_0x769a('0x18')](_0xc59096,function(_0x791b56){if(_0x791b56['service']===_0x769a('0x2e')){var _0x534bf5=encryptor[_0x769a('0x2f')](_0x791b56[_0x769a('0x30')]);_0x791b56['data3']=maskClientSecret(_0x534bf5);}return _0x791b56;});return _0x27f5cf;})['then'](respondWithFilteredResult(_0x530ed7,_0x324f18))[_0x769a('0x31')](handleError(_0x530ed7,null));};exports[_0x769a('0x32')]=function(_0x461d96,_0x302730){var _0x28c9e4={'raw':!![],'where':{'id':_0x461d96[_0x769a('0x33')]['id']}},_0x2eb57a={};_0x2eb57a[_0x769a('0x1d')]=_['keys'](db[_0x769a('0x19')][_0x769a('0x1a')]);_0x2eb57a[_0x769a('0x1f')]=_[_0x769a('0x1e')](_0x461d96[_0x769a('0x1f')]);_0x2eb57a['filters']=_['intersection'](_0x2eb57a[_0x769a('0x1d')],_0x2eb57a[_0x769a('0x1f')]);_0x28c9e4[_0x769a('0x22')]=_[_0x769a('0x21')](_0x2eb57a['model'],qs['fields'](_0x461d96[_0x769a('0x1f')][_0x769a('0x23')]));_0x28c9e4['attributes']=_0x28c9e4[_0x769a('0x22')][_0x769a('0x24')]?_0x28c9e4[_0x769a('0x22')]:_0x2eb57a[_0x769a('0x1d')];if(_0x461d96[_0x769a('0x1f')]['includeAll']){_0x28c9e4['include']=[{'all':!![]}];}_0x28c9e4=_[_0x769a('0x29')]({},_0x28c9e4,_0x461d96[_0x769a('0x34')]);return db['CloudProvider'][_0x769a('0x35')](_0x28c9e4)[_0x769a('0x12')](handleEntityNotFound(_0x302730,null))[_0x769a('0x12')](function(_0x310b71){if(_0x310b71[_0x769a('0x36')]==='MicrosoftAzure'){var _0x54d012=encryptor[_0x769a('0x2f')](_0x310b71[_0x769a('0x30')]);_0x310b71[_0x769a('0x30')]=maskClientSecret(_0x54d012);}return _0x310b71;})[_0x769a('0x12')](respondWithResult(_0x302730,null))['catch'](handleError(_0x302730,null));};exports[_0x769a('0x37')]=function(_0x447efe,_0x288685){if(!_0x447efe[_0x769a('0x38')][_0x769a('0x14')])throw new Error(_0x769a('0x39'));if(!_0x447efe[_0x769a('0x38')][_0x769a('0x36')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x543d17=db['CloudProvider'][_0x769a('0x1a')][_0x769a('0x36')]['values'];if(!_0x543d17[_0x769a('0x3a')](_0x447efe['body'][_0x769a('0x36')]))throw new Error(_0x769a('0x3b')+_0x543d17[_0x769a('0x3c')](',\x20'));if(_0x447efe[_0x769a('0x38')]['service']===_0x769a('0x2e')&&_0x447efe[_0x769a('0x38')][_0x769a('0x30')]){_0x447efe[_0x769a('0x38')][_0x769a('0x30')]=encryptor[_0x769a('0x3d')](_0x447efe[_0x769a('0x38')][_0x769a('0x30')]);}return db[_0x769a('0x19')][_0x769a('0x37')](_0x447efe[_0x769a('0x38')],{})[_0x769a('0x12')](respondWithResult(_0x288685,0xc9))['catch'](handleError(_0x288685,null));};exports[_0x769a('0x11')]=function(_0xe2b731,_0x2437db){if(_0xe2b731['body']['id']){delete _0xe2b731['body']['id'];}return db[_0x769a('0x19')][_0x769a('0x35')]({'where':{'id':_0xe2b731[_0x769a('0x33')]['id']}})['then'](handleEntityNotFound(_0x2437db,null))[_0x769a('0x12')](function(_0x3c929d){if(_0x3c929d[_0x769a('0x36')]===_0x769a('0x2e')&&_0xe2b731[_0x769a('0x38')][_0x769a('0x30')]){_0xe2b731[_0x769a('0x38')][_0x769a('0x30')]=encryptor[_0x769a('0x3d')](_0xe2b731[_0x769a('0x38')][_0x769a('0x30')]);}return _0x3c929d;})[_0x769a('0x12')](saveUpdates(_0xe2b731[_0x769a('0x38')],null))[_0x769a('0x12')](respondWithResult(_0x2437db,null))[_0x769a('0x31')](handleError(_0x2437db,null));};exports[_0x769a('0x13')]=function(_0xf6be0d,_0x1670b9){return db['CloudProvider'][_0x769a('0x35')]({'where':{'id':_0xf6be0d[_0x769a('0x33')]['id']}})[_0x769a('0x12')](handleEntityNotFound(_0x1670b9,null))[_0x769a('0x12')](removeEntity(_0x1670b9,null))[_0x769a('0x31')](handleError(_0x1670b9,null));};exports[_0x769a('0x3e')]=function(_0x1575c3,_0x4e6949){return db[_0x769a('0x19')][_0x769a('0x3f')]({'where':{'id':_0x1575c3[_0x769a('0x33')]['id']},'raw':!![]})['then'](function(_0x574f15){if(!_0x574f15)return _0x4e6949[_0x769a('0x7')](0x194);return{'url':oauth[_0x769a('0x40')](_0x574f15,_0x1575c3[_0x769a('0x41')]['id'])};})[_0x769a('0x12')](respondWithResult(_0x4e6949,null))['catch'](handleError(_0x4e6949,null));};exports[_0x769a('0x42')]=function(_0x4711ef,_0x728717){var _0x197e8f=_0x4711ef[_0x769a('0x38')];var _0x54779f;var _0x2fa765;if(_0x197e8f[_0x769a('0x43')])throw _0x197e8f;redis['get'](_0x197e8f[_0x769a('0x44')])[_0x769a('0x12')](function(_0xf7aae9){if(!_0xf7aae9)throw new Error('Invalid\x20state\x20parameter');_0x54779f=JSON[_0x769a('0x45')](_0xf7aae9);var _0x217de5=Buffer[_0x769a('0x46')](_0x197e8f['state'],_0x769a('0x47'))[_0x769a('0x48')]('ascii');_0x2fa765=JSON[_0x769a('0x45')](_0x217de5);if(!oauth[_0x769a('0x49')](_0x197e8f[_0x769a('0x4a')],_0x54779f['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x769a('0x4b')](_0x197e8f[_0x769a('0x44')]);return oauth[_0x769a('0x4c')](_0x197e8f['code'],_0x54779f);})[_0x769a('0x12')](function(_0x2a5445){_0x54779f[_0x769a('0x4d')]=_0x2a5445[_0x769a('0x4e')];_0x54779f[_0x769a('0x4f')]=_0x2a5445[_0x769a('0x50')];return db[_0x769a('0x19')]['update']({'data5':_0x54779f[_0x769a('0x4d')],'data6':_0x54779f['data6']},{'where':{'id':_0x54779f['id']}});})['then'](function(){oauth[_0x769a('0x51')](_0x54779f);socket[_0x769a('0x52')](_0x769a('0x53'),{'id':_0x2fa765['id']});return;})[_0x769a('0x12')](respondWithStatusCode(_0x728717,null))[_0x769a('0x31')](function(_0xabd27f){if(_0x2fa765){socket[_0x769a('0x52')]('microsoftAuthorization:error',{'id':_0x2fa765['id']});}if(!_0x54779f){logger[_0x769a('0x43')]('Invalid\x20authentication\x20state\x20parameter',_0xabd27f);return _0x728717[_0x769a('0x8')](0x1f4)[_0x769a('0x54')](_0xabd27f[_0x769a('0x55')]);}logger[_0x769a('0x43')](_0x769a('0x56'),_0x54779f['id'],JSON['stringify'](_0xabd27f));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 497840a..eb27c94 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7722=['./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','moment','bluebird'];(function(_0x775ff4,_0x14d00f){var _0x2e6abe=function(_0x5ad039){while(--_0x5ad039){_0x775ff4['push'](_0x775ff4['shift']());}};_0x2e6abe(++_0x14d00f);}(_0x7722,0x148));var _0x2772=function(_0x367903,_0x18ab26){_0x367903=_0x367903-0x0;var _0x4ffbb6=_0x7722[_0x367903];return _0x4ffbb6;};'use strict';var _=require(_0x2772('0x0'));var util=require(_0x2772('0x1'));var logger=require(_0x2772('0x2'))('api');var moment=require(_0x2772('0x3'));var BPromise=require(_0x2772('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2772('0x5'));module['exports']=function(_0x50c454,_0x2b18ef){return _0x50c454[_0x2772('0x6')](_0x2772('0x7'),attributes,{'tableName':_0x2772('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08b4=['bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','util','../../config/logger','api','moment'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x08b4,0x164));var _0x408b=function(_0x22ee0f,_0x22e6d2){_0x22ee0f=_0x22ee0f-0x0;var _0x204696=_0x08b4[_0x22ee0f];return _0x204696;};'use strict';var _=require('lodash');var util=require(_0x408b('0x0'));var logger=require(_0x408b('0x1'))(_0x408b('0x2'));var moment=require(_0x408b('0x3'));var BPromise=require(_0x408b('0x4'));var rp=require(_0x408b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x408b('0x6'));var config=require(_0x408b('0x7'));var attributes=require(_0x408b('0x8'));module[_0x408b('0x9')]=function(_0x3440de,_0xe9752d){return _0x3440de[_0x408b('0xa')](_0x408b('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 44e99fa..f2973d2 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x617b=['https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','map','type','Dynamics365','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','scope','state','nonce','login','key','oauth2Claims','oauth2/','set','payload','issuer','aud','audience','isAfter','unix','exp','resolve','CloudProvider','findOne','then','refresh_token','decryptString','data3','POST','data5','access_token','data6','update','catch','error','authorization_code','intervals','bind','findAll','all','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','localhost','redis'];(function(_0x23ba0a,_0x56a52d){var _0xb6e43c=function(_0x219f92){while(--_0x219f92){_0x23ba0a['push'](_0x23ba0a['shift']());}};_0xb6e43c(++_0x56a52d);}(_0x617b,0xe3));var _0xb617=function(_0xeb027e,_0xf4aaf4){_0xeb027e=_0xeb027e-0x0;var _0x652cac=_0x617b[_0xeb027e];return _0x652cac;};'use strict';var _=require(_0xb617('0x0'));var crypto=require(_0xb617('0x1'));var jwt=require(_0xb617('0x2'));var moment=require(_0xb617('0x3'));var Redis=require(_0xb617('0x4'));var rp=require(_0xb617('0x5'));var util=require(_0xb617('0x6'));var encryptor=require(_0xb617('0x7'));var config=require(_0xb617('0x8'));var logger=require(_0xb617('0x9'))(_0xb617('0xa'));var schedule=require(_0xb617('0xb'));var db=require(_0xb617('0xc'))['db'];config['redis']=_[_0xb617('0xd')](config['redis'],{'host':_0xb617('0xe'),'port':0x18eb});var redis=new Redis(config[_0xb617('0xf')]);var MICROSOFT_AUTH_URL=_0xb617('0x10');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xb617('0x11'),_0xb617('0x12'),_0xb617('0x13'),_0xb617('0x14'),_0xb617('0x15'),_0xb617('0x16')],'Dynamics365':[_0xb617('0x17'),_0xb617('0x13')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x34def2){var _0x5a9582=_[_0xb617('0x18')](AZURE_AUTH_SCOPES[_0x34def2[_0xb617('0x19')]]);if(_0x34def2['type']===_0xb617('0x1a'))_0x5a9582['push'](_0x34def2[_0xb617('0x1b')]+_0xb617('0x1c'));return _0x5a9582[_0xb617('0x1d')]('\x20');}function getAccessTokenScope(_0x540bce){if(_0x540bce[_0xb617('0x19')]===_0xb617('0x1e'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x540bce['type']===_0xb617('0x1a'))return _0x540bce[_0xb617('0x1b')]+_0xb617('0x1c');}function generateMicrosoftAuthorizationUrl(_0x25621b,_0x2263b1){var _0x2a8b9f=MICROSOFT_AUTH_URL[_0xb617('0x1f')](_0xb617('0x20'),_0x25621b[_0xb617('0x21')]);var _0x42f9cc=[_0xb617('0x22'),_0xb617('0x23')];var _0x3ac964=Buffer[_0xb617('0x24')](JSON[_0xb617('0x25')]({'id':_0x2263b1}))['toString']('base64');var _0x37f9ef=crypto[_0xb617('0x26')](0x10)['toString'](_0xb617('0x27'));var _0x46a4f0=getAuthorizationScopes(_0x25621b);var _0x402749=[{'key':_0xb617('0x28'),'value':_0x25621b[_0xb617('0x29')]},{'key':_0xb617('0x2a'),'value':encodeURIComponent(_0x42f9cc[_0xb617('0x1d')]('\x20'))},{'key':_0xb617('0x2b'),'value':_0x25621b[_0xb617('0x2c')]},{'key':_0xb617('0x2d'),'value':'form_post'},{'key':_0xb617('0x2e'),'value':encodeURIComponent(_0x46a4f0)},{'key':_0xb617('0x2f'),'value':_0x3ac964},{'key':_0xb617('0x30'),'value':_0x37f9ef},{'key':'prompt','value':_0xb617('0x31')}];var _0xd8637b=_0x2a8b9f+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xb617('0x18')](_0x402749,function(_0x45ea7e){return _0x45ea7e[_0xb617('0x32')]+'='+_0x45ea7e['value'];})[_0xb617('0x1d')]('&');_0x25621b[_0xb617('0x33')]={'issuer':_0x2a8b9f[_0xb617('0x1f')](_0xb617('0x34'),''),'audience':_0x25621b[_0xb617('0x29')],'state':_0x3ac964,'nonce':_0x37f9ef};redis[_0xb617('0x35')](_0x3ac964,JSON[_0xb617('0x25')](_0x25621b));return _0xd8637b;}function isValidIdToken(_0x469361,_0x52a8fa){try{var _0x1241dd=jwt['decode'](_0x469361,{'complete':!![]});var _0x31db75=_0x1241dd[_0xb617('0x36')];if(_0x31db75['iss']!==_0x52a8fa[_0xb617('0x37')])return![];if(_0x31db75[_0xb617('0x38')]!==_0x52a8fa[_0xb617('0x39')])return![];if(_0x31db75[_0xb617('0x30')]!==_0x52a8fa[_0xb617('0x30')])return![];if(moment()[_0xb617('0x3a')](moment[_0xb617('0x3b')](_0x31db75[_0xb617('0x3c')])))return![];return!![];}catch(_0x59c6cc){throw _0x59c6cc;}}function refreshOauth2MicrosoftAccessToken(_0x27a8b2){return Promise[_0xb617('0x3d')]()['then'](function(){if(_0x27a8b2['data3'])return _0x27a8b2;return db[_0xb617('0x3e')][_0xb617('0x3f')]({'where':{'id':_0x27a8b2['id']},'raw':!![]});})[_0xb617('0x40')](function(_0x126166){var _0x4b9558={'grant_type':_0xb617('0x41'),'refresh_token':_0x126166['data6'],'scope':getAccessTokenScope(_0x126166),'redirect_uri':_0x126166[_0xb617('0x2c')],'client_id':_0x126166['data1'],'client_secret':encryptor[_0xb617('0x42')](_0x126166[_0xb617('0x43')])};var _0x49095e={'method':_0xb617('0x44'),'uri':MICROSOFT_AUTH_URL[_0xb617('0x1f')](_0xb617('0x20'),_0x126166[_0xb617('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4b9558,'json':!![]};return rp(_0x49095e);})[_0xb617('0x40')](function(_0x2f146f){_0x27a8b2[_0xb617('0x45')]=_0x2f146f[_0xb617('0x46')];_0x27a8b2[_0xb617('0x47')]=_0x2f146f[_0xb617('0x41')];return db['CloudProvider'][_0xb617('0x48')]({'data5':_0x27a8b2[_0xb617('0x45')],'data6':_0x27a8b2[_0xb617('0x47')]},{'where':{'id':_0x27a8b2['id']}});})['then'](function(){return _0x27a8b2;})[_0xb617('0x49')](function(_0x375aef){logger[_0xb617('0x4a')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x27a8b2['id'],_0x375aef);});}function getOauth2MicrosoftAccessToken(_0x43904d,_0x2e28e7){var _0x135dba={'grant_type':_0xb617('0x4b'),'code':_0x43904d,'scope':getAccessTokenScope(_0x2e28e7),'redirect_uri':_0x2e28e7['data4'],'client_id':_0x2e28e7[_0xb617('0x29')],'client_secret':encryptor['decryptString'](_0x2e28e7[_0xb617('0x43')])};var _0x5653b5={'method':_0xb617('0x44'),'uri':MICROSOFT_AUTH_URL[_0xb617('0x1f')]('{TENANT_ID}',_0x2e28e7[_0xb617('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x135dba,'json':!![]};return rp(_0x5653b5);}function startRefreshInterval(_0x4b7b5e){var _0x3d967b=schedule[_0xb617('0x4c')];if(_0x3d967b[_0x4b7b5e['id']])clearInterval(_0x3d967b[_0x4b7b5e['id']]);_0x3d967b[_0x4b7b5e['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xb617('0x4d')](this,{'id':_0x4b7b5e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xb617('0x4c')]=_0x3d967b;}function startAllRefreshIntervals(){return db[_0xb617('0x3e')][_0xb617('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xb617('0x40')](function(_0x5e1e8e){var _0x569946=_0x5e1e8e['map'](function(_0x56f5eb){return refreshOauth2MicrosoftAccessToken(_0x56f5eb)[_0xb617('0x40')](function(_0x21d049){startRefreshInterval(_0x21d049);});});return Promise[_0xb617('0x4f')](_0x569946);})[_0xb617('0x49')](function(_0x32ee04){var _0x148ef8=_0x32ee04?util['inspect'](_0x32ee04,{'showHidden':![],'depth':null}):'';logger[_0xb617('0x4a')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x148ef8);});}module[_0xb617('0x50')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x9e23=['set','stringify','decode','payload','iss','aud','audience','isAfter','exp','then','CloudProvider','refresh_token','decryptString','POST','{TENANT_ID}','data5','access_token','data6','update','catch','authorization_code','data3','bind','intervals','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','data7','/.default','join','Outlook365','replace','data2','id_token','from','toString','base64','randomBytes','hex','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','nonce','prompt','login','key','value','oauth2Claims'];(function(_0x563e7e,_0x4f9e06){var _0x80868a=function(_0x255620){while(--_0x255620){_0x563e7e['push'](_0x563e7e['shift']());}};_0x80868a(++_0x4f9e06);}(_0x9e23,0x15a));var _0x39e2=function(_0x31a4b1,_0x1656bb){_0x31a4b1=_0x31a4b1-0x0;var _0x444b04=_0x9e23[_0x31a4b1];return _0x444b04;};'use strict';var _=require('lodash');var crypto=require(_0x39e2('0x0'));var jwt=require(_0x39e2('0x1'));var moment=require(_0x39e2('0x2'));var Redis=require('ioredis');var rp=require(_0x39e2('0x3'));var util=require(_0x39e2('0x4'));var encryptor=require(_0x39e2('0x5'));var config=require(_0x39e2('0x6'));var logger=require(_0x39e2('0x7'))('api');var schedule=require(_0x39e2('0x8'));var db=require(_0x39e2('0x9'))['db'];config[_0x39e2('0xa')]=_[_0x39e2('0xb')](config[_0x39e2('0xa')],{'host':_0x39e2('0xc'),'port':0x18eb});var redis=new Redis(config[_0x39e2('0xa')]);var MICROSOFT_AUTH_URL=_0x39e2('0xd');var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile',_0x39e2('0xe'),_0x39e2('0xf'),_0x39e2('0x10'),_0x39e2('0x11'),_0x39e2('0x12')],'Dynamics365':['openid',_0x39e2('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x39e2('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x39e2('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x56b010){var _0x549626=_[_0x39e2('0x15')](AZURE_AUTH_SCOPES[_0x56b010[_0x39e2('0x16')]]);if(_0x56b010[_0x39e2('0x16')]===_0x39e2('0x17'))_0x549626['push'](_0x56b010[_0x39e2('0x18')]+_0x39e2('0x19'));return _0x549626[_0x39e2('0x1a')]('\x20');}function getAccessTokenScope(_0x297418){if(_0x297418[_0x39e2('0x16')]===_0x39e2('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x297418[_0x39e2('0x16')]===_0x39e2('0x17'))return _0x297418['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0xde6505,_0x39480a){var _0x3c8a4d=MICROSOFT_AUTH_URL[_0x39e2('0x1c')]('{TENANT_ID}',_0xde6505[_0x39e2('0x1d')]);var _0x4dea1a=['code',_0x39e2('0x1e')];var _0x3347ba=Buffer[_0x39e2('0x1f')](JSON['stringify']({'id':_0x39480a}))[_0x39e2('0x20')](_0x39e2('0x21'));var _0x2b229d=crypto[_0x39e2('0x22')](0x10)['toString'](_0x39e2('0x23'));var _0xe0fc03=getAuthorizationScopes(_0xde6505);var _0x1231bc=[{'key':'client_id','value':_0xde6505[_0x39e2('0x24')]},{'key':_0x39e2('0x25'),'value':encodeURIComponent(_0x4dea1a[_0x39e2('0x1a')]('\x20'))},{'key':_0x39e2('0x26'),'value':_0xde6505[_0x39e2('0x27')]},{'key':_0x39e2('0x28'),'value':_0x39e2('0x29')},{'key':_0x39e2('0x2a'),'value':encodeURIComponent(_0xe0fc03)},{'key':'state','value':_0x3347ba},{'key':_0x39e2('0x2b'),'value':_0x2b229d},{'key':_0x39e2('0x2c'),'value':_0x39e2('0x2d')}];var _0x3ab13e=_0x3c8a4d+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x39e2('0x15')](_0x1231bc,function(_0x185e05){return _0x185e05[_0x39e2('0x2e')]+'='+_0x185e05[_0x39e2('0x2f')];})['join']('&');_0xde6505[_0x39e2('0x30')]={'issuer':_0x3c8a4d['replace']('oauth2/',''),'audience':_0xde6505['data1'],'state':_0x3347ba,'nonce':_0x2b229d};redis[_0x39e2('0x31')](_0x3347ba,JSON[_0x39e2('0x32')](_0xde6505));return _0x3ab13e;}function isValidIdToken(_0x41209c,_0x4e46d1){try{var _0x3b0d7f=jwt[_0x39e2('0x33')](_0x41209c,{'complete':!![]});var _0x2ede89=_0x3b0d7f[_0x39e2('0x34')];if(_0x2ede89[_0x39e2('0x35')]!==_0x4e46d1['issuer'])return![];if(_0x2ede89[_0x39e2('0x36')]!==_0x4e46d1[_0x39e2('0x37')])return![];if(_0x2ede89[_0x39e2('0x2b')]!==_0x4e46d1[_0x39e2('0x2b')])return![];if(moment()[_0x39e2('0x38')](moment['unix'](_0x2ede89[_0x39e2('0x39')])))return![];return!![];}catch(_0x3962bb){throw _0x3962bb;}}function refreshOauth2MicrosoftAccessToken(_0x12f2a3){return Promise['resolve']()[_0x39e2('0x3a')](function(){if(_0x12f2a3['data3'])return _0x12f2a3;return db[_0x39e2('0x3b')]['findOne']({'where':{'id':_0x12f2a3['id']},'raw':!![]});})[_0x39e2('0x3a')](function(_0x266941){var _0x28d018={'grant_type':_0x39e2('0x3c'),'refresh_token':_0x266941['data6'],'scope':getAccessTokenScope(_0x266941),'redirect_uri':_0x266941['data4'],'client_id':_0x266941[_0x39e2('0x24')],'client_secret':encryptor[_0x39e2('0x3d')](_0x266941['data3'])};var _0x4b1b33={'method':_0x39e2('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x39e2('0x1c')](_0x39e2('0x3f'),_0x266941[_0x39e2('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x28d018,'json':!![]};return rp(_0x4b1b33);})[_0x39e2('0x3a')](function(_0x434607){_0x12f2a3[_0x39e2('0x40')]=_0x434607[_0x39e2('0x41')];_0x12f2a3[_0x39e2('0x42')]=_0x434607[_0x39e2('0x3c')];return db[_0x39e2('0x3b')][_0x39e2('0x43')]({'data5':_0x12f2a3[_0x39e2('0x40')],'data6':_0x12f2a3[_0x39e2('0x42')]},{'where':{'id':_0x12f2a3['id']}});})[_0x39e2('0x3a')](function(){return _0x12f2a3;})[_0x39e2('0x44')](function(_0x11f02a){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x12f2a3['id'],_0x11f02a);});}function getOauth2MicrosoftAccessToken(_0x1976e3,_0x3b7166){var _0x3708f7={'grant_type':_0x39e2('0x45'),'code':_0x1976e3,'scope':getAccessTokenScope(_0x3b7166),'redirect_uri':_0x3b7166['data4'],'client_id':_0x3b7166[_0x39e2('0x24')],'client_secret':encryptor[_0x39e2('0x3d')](_0x3b7166[_0x39e2('0x46')])};var _0x11cf93={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x39e2('0x1c')](_0x39e2('0x3f'),_0x3b7166['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3708f7,'json':!![]};return rp(_0x11cf93);}function startRefreshInterval(_0x294f77){var _0x30ac05=schedule['intervals'];if(_0x30ac05[_0x294f77['id']])clearInterval(_0x30ac05[_0x294f77['id']]);_0x30ac05[_0x294f77['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x39e2('0x47')](this,{'id':_0x294f77['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x39e2('0x48')]=_0x30ac05;}function startAllRefreshIntervals(){return db[_0x39e2('0x3b')][_0x39e2('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x39e2('0x3a')](function(_0x5141df){var _0x5c7dac=_0x5141df[_0x39e2('0x15')](function(_0xcb2805){return refreshOauth2MicrosoftAccessToken(_0xcb2805)[_0x39e2('0x3a')](function(_0x4bed98){startRefreshInterval(_0x4bed98);});});return Promise[_0x39e2('0x4a')](_0x5c7dac);})[_0x39e2('0x44')](function(_0x58725a){var _0x11a43f=_0x58725a?util[_0x39e2('0x4b')](_0x58725a,{'showHidden':![],'depth':null}):'';logger[_0x39e2('0x4c')](_0x39e2('0x4d'),_0x11a43f);});}module[_0x39e2('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index e4cc104..02f45f2 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa24d=['http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2e6a65,_0x5027c8){var _0xf0a1aa=function(_0x554bb4){while(--_0x554bb4){_0x2e6a65['push'](_0x2e6a65['shift']());}};_0xf0a1aa(++_0x5027c8);}(_0xa24d,0x1c1));var _0xda24=function(_0x4dade6,_0x16b01d){_0x4dade6=_0x4dade6-0x0;var _0x513270=_0xa24d[_0x4dade6];return _0x513270;};'use strict';var _=require(_0xda24('0x0'));var util=require(_0xda24('0x1'));var moment=require(_0xda24('0x2'));var BPromise=require(_0xda24('0x3'));var rs=require(_0xda24('0x4'));var fs=require('fs');var Redis=require(_0xda24('0x5'));var db=require(_0xda24('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xda24('0x7'))(_0xda24('0x8'));var config=require(_0xda24('0x9'));var jayson=require(_0xda24('0xa'));var client=jayson['client'][_0xda24('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdba54e,_0x5868af,_0x3d0ec5){return new BPromise(function(_0x48117a,_0x446e2e){return client[_0xda24('0xc')](_0xdba54e,_0x3d0ec5)[_0xda24('0xd')](function(_0x1dccb2){logger['info'](_0xda24('0xe'),_0x5868af,_0xda24('0xf'));logger[_0xda24('0x10')](_0xda24('0x11'),_0x5868af,_0xda24('0xf'),JSON['stringify'](_0x1dccb2));if(_0x1dccb2[_0xda24('0x12')]){if(_0x1dccb2['error'][_0xda24('0x13')]===0x1f4){logger[_0xda24('0x12')]('CloudProvider,\x20%s,\x20%s',_0x5868af,_0x1dccb2['error'][_0xda24('0x14')]);return _0x446e2e(_0x1dccb2[_0xda24('0x12')][_0xda24('0x14')]);}logger[_0xda24('0x12')]('CloudProvider,\x20%s,\x20%s',_0x5868af,_0x1dccb2[_0xda24('0x12')]['message']);return _0x48117a(_0x1dccb2[_0xda24('0x12')][_0xda24('0x14')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x5868af,_0xda24('0xf'));_0x48117a(_0x1dccb2[_0xda24('0x15')][_0xda24('0x14')]);}})[_0xda24('0x16')](function(_0x3348e0){logger[_0xda24('0x12')](_0xda24('0xe'),_0x5868af,_0x3348e0);_0x446e2e(_0x3348e0);});});} \ No newline at end of file +var _0x97ce=['jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x928c11,_0xe40543){var _0x238a4c=function(_0x1ba59a){while(--_0x1ba59a){_0x928c11['push'](_0x928c11['shift']());}};_0x238a4c(++_0xe40543);}(_0x97ce,0x151));var _0xe97c=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x97ce[_0x24f31b];return _0x488401;};'use strict';var _=require(_0xe97c('0x0'));var util=require(_0xe97c('0x1'));var moment=require(_0xe97c('0x2'));var BPromise=require(_0xe97c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe97c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe97c('0x5'));var logger=require('../../config/logger')(_0xe97c('0x6'));var config=require(_0xe97c('0x7'));var jayson=require(_0xe97c('0x8'));var client=jayson[_0xe97c('0x9')][_0xe97c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6603e0,_0x522f0a,_0x3bf4ef){return new BPromise(function(_0x9c1b00,_0x9ce6d){return client['request'](_0x6603e0,_0x3bf4ef)[_0xe97c('0xb')](function(_0x5717fb){logger[_0xe97c('0xc')](_0xe97c('0xd'),_0x522f0a,_0xe97c('0xe'));logger[_0xe97c('0xf')](_0xe97c('0x10'),_0x522f0a,_0xe97c('0xe'),JSON[_0xe97c('0x11')](_0x5717fb));if(_0x5717fb['error']){if(_0x5717fb[_0xe97c('0x12')][_0xe97c('0x13')]===0x1f4){logger[_0xe97c('0x12')](_0xe97c('0xd'),_0x522f0a,_0x5717fb[_0xe97c('0x12')][_0xe97c('0x14')]);return _0x9ce6d(_0x5717fb[_0xe97c('0x12')][_0xe97c('0x14')]);}logger[_0xe97c('0x12')]('CloudProvider,\x20%s,\x20%s',_0x522f0a,_0x5717fb['error'][_0xe97c('0x14')]);return _0x9c1b00(_0x5717fb['error'][_0xe97c('0x14')]);}else{logger[_0xe97c('0xc')]('CloudProvider,\x20%s,\x20%s',_0x522f0a,'request\x20sent');_0x9c1b00(_0x5717fb[_0xe97c('0x15')][_0xe97c('0x14')]);}})[_0xe97c('0x16')](function(_0x2e026d){logger['error']('CloudProvider,\x20%s,\x20%s',_0x522f0a,_0x2e026d);_0x9ce6d(_0x2e026d);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 460bc4f..2f40822 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x22cd70,_0x53a8e4){var _0x294433=function(_0x5915a8){while(--_0x5915a8){_0x22cd70['push'](_0x22cd70['shift']());}};_0x294433(++_0x53a8e4);}(_0xdb28,0x106));var _0x8db2=function(_0x4e54cc,_0x3f961){_0x4e54cc=_0x4e54cc-0x0;var _0x666e=_0xdb28[_0x4e54cc];return _0x666e;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router; \ No newline at end of file +var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x2a0350,_0x249319){var _0x425220=function(_0x1d5f78){while(--_0x1d5f78){_0x2a0350['push'](_0x2a0350['shift']());}};_0x425220(++_0x249319);}(_0x1261,0x144));var _0x1126=function(_0x4b9c29,_0x46c107){_0x4b9c29=_0x4b9c29-0x0;var _0xfacb34=_0x1261[_0x4b9c29];return _0xfacb34;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index d10772b..b6ab592 100644 --- a/server/api/cmCompany/cmCompany.attributes.js +++ b/server/api/cmCompany/cmCompany.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3fe3=['sequelize','exports','STRING'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x3fe3,0x1aa));var _0x33fe=function(_0x4e2070,_0x5b96b6){_0x4e2070=_0x4e2070-0x0;var _0x562301=_0x3fe3[_0x4e2070];return _0x562301;};'use strict';var Sequelize=require(_0x33fe('0x0'));module[_0x33fe('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x33fe('0x2')]},'companyId':{'type':Sequelize[_0x33fe('0x2')]},'website':{'type':Sequelize[_0x33fe('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x33fe('0x2')]},'type':{'type':Sequelize[_0x33fe('0x2')]},'street':{'type':Sequelize[_0x33fe('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x33fe('0x2')]},'country':{'type':Sequelize[_0x33fe('0x2')]},'email':{'type':Sequelize[_0x33fe('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x33fe('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x44c5=['STRING','name','sequelize','exports'];(function(_0x5eb081,_0xdd0b42){var _0x21db0b=function(_0x21095a){while(--_0x21095a){_0x5eb081['push'](_0x5eb081['shift']());}};_0x21db0b(++_0xdd0b42);}(_0x44c5,0x76));var _0x544c=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0x44c5[_0xaa6a4];return _0xdc31a4;};'use strict';var Sequelize=require(_0x544c('0x0'));module[_0x544c('0x1')]={'name':{'type':Sequelize[_0x544c('0x2')],'unique':_0x544c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x544c('0x2')]},'website':{'type':Sequelize[_0x544c('0x2')]},'phone':{'type':Sequelize[_0x544c('0x2')]},'fax':{'type':Sequelize[_0x544c('0x2')]},'type':{'type':Sequelize[_0x544c('0x2')]},'street':{'type':Sequelize[_0x544c('0x2')]},'postalCode':{'type':Sequelize[_0x544c('0x2')]},'city':{'type':Sequelize[_0x544c('0x2')]},'country':{'type':Sequelize[_0x544c('0x2')]},'email':{'type':Sequelize[_0x544c('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x544c('0x2')]},'sStreet':{'type':Sequelize[_0x544c('0x2')]},'sPostalCode':{'type':Sequelize[_0x544c('0x2')]},'sCity':{'type':Sequelize[_0x544c('0x2')]},'sCountry':{'type':Sequelize[_0x544c('0x2')]},'description':{'type':Sequelize[_0x544c('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 06e63e4..99e3e0a 100644 --- a/server/api/cmCompany/cmCompany.controller.js +++ b/server/api/cmCompany/cmCompany.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdefc=['reject','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','error','stack','name','send','index','describe','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','filter','options','CmCompany','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','findOne','merge','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x3411fa,_0x57f41d){var _0x5f20d1=function(_0x3a40ba){while(--_0x3a40ba){_0x3411fa['push'](_0x3411fa['shift']());}};_0x5f20d1(++_0x57f41d);}(_0xdefc,0x197));var _0xcdef=function(_0x330141,_0x1dd290){_0x330141=_0x330141-0x0;var _0x1b68a2=_0xdefc[_0x330141];return _0x1b68a2;};'use strict';var emlformat=require(_0xcdef('0x0'));var rimraf=require(_0xcdef('0x1'));var zipdir=require(_0xcdef('0x2'));var jsonpatch=require(_0xcdef('0x3'));var rp=require(_0xcdef('0x4'));var moment=require(_0xcdef('0x5'));var BPromise=require(_0xcdef('0x6'));var Mustache=require('mustache');var util=require(_0xcdef('0x7'));var path=require('path');var sox=require(_0xcdef('0x8'));var csv=require(_0xcdef('0x9'));var ejs=require(_0xcdef('0xa'));var fs=require('fs');var fs_extra=require(_0xcdef('0xb'));var _=require('lodash');var squel=require(_0xcdef('0xc'));var crypto=require(_0xcdef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xcdef('0xe'));var toCsv=require(_0xcdef('0x9'));var querystring=require('querystring');var Papa=require(_0xcdef('0xf'));var Redis=require(_0xcdef('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcdef('0x11'));var as=require(_0xcdef('0x12'));var hardwareService=require(_0xcdef('0x13'));var logger=require(_0xcdef('0x14'))(_0xcdef('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcdef('0x16'));var db=require(_0xcdef('0x17'))['db'];function respondWithStatusCode(_0xb4eff0,_0x346d9f){_0x346d9f=_0x346d9f||0xcc;return function(_0x4b82b3){if(_0x4b82b3){return _0xb4eff0['sendStatus'](_0x346d9f);}return _0xb4eff0[_0xcdef('0x18')](_0x346d9f)[_0xcdef('0x19')]();};}function respondWithResult(_0x301922,_0x4fccdb){_0x4fccdb=_0x4fccdb||0xc8;return function(_0x27e24c){if(_0x27e24c){return _0x301922['status'](_0x4fccdb)[_0xcdef('0x1a')](_0x27e24c);}};}function respondWithFilteredResult(_0x24def0,_0x2acbf5){return function(_0xbba4aa){if(_0xbba4aa){var _0x51c3d7=typeof _0x2acbf5['offset']===_0xcdef('0x1b')&&typeof _0x2acbf5[_0xcdef('0x1c')]===_0xcdef('0x1b');var _0x3c2418=_0xbba4aa[_0xcdef('0x1d')];var _0x41f85e=_0x51c3d7?0x0:_0x2acbf5[_0xcdef('0x1e')];var _0x13d0dd=_0x51c3d7?_0xbba4aa[_0xcdef('0x1d')]:_0x2acbf5['offset']+_0x2acbf5[_0xcdef('0x1c')];var _0x4713fa;if(_0x13d0dd>=_0x3c2418){_0x13d0dd=_0x3c2418;_0x4713fa=0xc8;}else{_0x4713fa=0xce;}_0x24def0[_0xcdef('0x18')](_0x4713fa);return _0x24def0[_0xcdef('0x1f')](_0xcdef('0x20'),_0x41f85e+'-'+_0x13d0dd+'/'+_0x3c2418)[_0xcdef('0x1a')](_0xbba4aa);}return null;};}function patchUpdates(_0x455624){return function(_0x5834c7){try{jsonpatch['apply'](_0x5834c7,_0x455624,!![]);}catch(_0x1c127b){return BPromise[_0xcdef('0x21')](_0x1c127b);}return _0x5834c7[_0xcdef('0x22')]();};}function saveUpdates(_0x46d4ca,_0x46ba21){return function(_0x2f6c3c){if(_0x2f6c3c){return _0x2f6c3c[_0xcdef('0x23')](_0x46d4ca)[_0xcdef('0x24')](function(_0x389b3a){return _0x389b3a;});}return null;};}function removeEntity(_0xa938b7,_0x5330eb){return function(_0x4d1bde){if(_0x4d1bde){return _0x4d1bde[_0xcdef('0x25')]()[_0xcdef('0x24')](function(){var _0x3daeae=_0x4d1bde[_0xcdef('0x26')]({'plain':!![]});var _0x45721a=_0xcdef('0x27');return db[_0xcdef('0x28')][_0xcdef('0x25')]({'where':{'type':_0x45721a,'resourceId':_0x3daeae['id']}})[_0xcdef('0x24')](function(){return _0x4d1bde;});})[_0xcdef('0x24')](function(){_0xa938b7['status'](0xcc)[_0xcdef('0x19')]();});}};}function handleEntityNotFound(_0x5a8f0c,_0x16d3c7){return function(_0x4834b6){if(!_0x4834b6){_0x5a8f0c[_0xcdef('0x29')](0x194);}return _0x4834b6;};}function handleError(_0x16c2d7,_0x12d008){_0x12d008=_0x12d008||0x1f4;return function(_0x1798bf){logger[_0xcdef('0x2a')](_0x1798bf[_0xcdef('0x2b')]);if(_0x1798bf[_0xcdef('0x2c')]){delete _0x1798bf[_0xcdef('0x2c')];}_0x16c2d7['status'](_0x12d008)[_0xcdef('0x2d')](_0x1798bf);};}exports[_0xcdef('0x2e')]=function(_0x192b10,_0x9769f6){var _0x5a9bba={},_0x2f3abd={},_0x189965={'count':0x0,'rows':[]};return db['CmCompany'][_0xcdef('0x2f')]()[_0xcdef('0x24')](function(_0x5dacc8){_0x2f3abd[_0xcdef('0x30')]=_['keys'](_0x5dacc8);_0x2f3abd[_0xcdef('0x31')]=_[_0xcdef('0x32')](_0x192b10['query']);_0x2f3abd[_0xcdef('0x33')]=_[_0xcdef('0x34')](_0x2f3abd[_0xcdef('0x30')],_0x2f3abd['query']);_0x5a9bba[_0xcdef('0x35')]=_['intersection'](_0x2f3abd[_0xcdef('0x30')],qs[_0xcdef('0x36')](_0x192b10[_0xcdef('0x31')][_0xcdef('0x36')]));_0x5a9bba['attributes']=_0x5a9bba[_0xcdef('0x35')][_0xcdef('0x37')]?_0x5a9bba[_0xcdef('0x35')]:_0x2f3abd[_0xcdef('0x30')];if(!_0x192b10['query'][_0xcdef('0x38')](_0xcdef('0x39'))){_0x5a9bba[_0xcdef('0x1c')]=qs[_0xcdef('0x1c')](_0x192b10[_0xcdef('0x31')][_0xcdef('0x1c')]);_0x5a9bba[_0xcdef('0x1e')]=qs[_0xcdef('0x1e')](_0x192b10[_0xcdef('0x31')][_0xcdef('0x1e')]);}_0x5a9bba[_0xcdef('0x3a')]=qs[_0xcdef('0x3b')](_0x192b10[_0xcdef('0x31')][_0xcdef('0x3b')]);_0x5a9bba[_0xcdef('0x3c')]=qs[_0xcdef('0x33')](_[_0xcdef('0x3d')](_0x192b10[_0xcdef('0x31')],_0x2f3abd[_0xcdef('0x33')]),_0x5dacc8);if(_0x192b10[_0xcdef('0x31')]['filter']){_0x5a9bba['where']=_['merge'](_0x5a9bba['where'],{'$or':_[_0xcdef('0x3e')](_0x5a9bba[_0xcdef('0x35')],function(_0xe9ea62){var _0x7c5a0a={};_0x7c5a0a[_0xe9ea62]={'$like':'%'+_0x192b10['query'][_0xcdef('0x3f')]+'%'};return _0x7c5a0a;})});}_0x5a9bba=_['merge']({},_0x5a9bba,_0x192b10[_0xcdef('0x40')]);var _0x5bda55={'where':_0x5a9bba[_0xcdef('0x3c')]};return db[_0xcdef('0x41')][_0xcdef('0x1d')](_0x5bda55)[_0xcdef('0x24')](function(_0x46236e){_0x189965[_0xcdef('0x1d')]=_0x46236e;if(_0x192b10[_0xcdef('0x31')][_0xcdef('0x42')]){_0x5a9bba[_0xcdef('0x43')]=[{'all':!![]}];}return db['CmCompany'][_0xcdef('0x44')](_0x5a9bba);})[_0xcdef('0x24')](function(_0x4b252e){_0x189965[_0xcdef('0x45')]=_0x4b252e;return _0x189965;})[_0xcdef('0x24')](respondWithFilteredResult(_0x9769f6,_0x5a9bba))[_0xcdef('0x46')](handleError(_0x9769f6,null));})[_0xcdef('0x46')](handleError(_0x9769f6,null));};exports[_0xcdef('0x47')]=function(_0x15dd5c,_0x374b60){var _0xfa9d5e={'raw':![],'where':{'id':_0x15dd5c['params']['id']}},_0x3d8a91={};_0x3d8a91['model']=_['keys'](db[_0xcdef('0x41')][_0xcdef('0x48')]);_0x3d8a91[_0xcdef('0x31')]=_[_0xcdef('0x32')](_0x15dd5c[_0xcdef('0x31')]);_0x3d8a91['filters']=_['intersection'](_0x3d8a91[_0xcdef('0x30')],_0x3d8a91[_0xcdef('0x31')]);_0xfa9d5e[_0xcdef('0x35')]=_[_0xcdef('0x34')](_0x3d8a91['model'],qs['fields'](_0x15dd5c[_0xcdef('0x31')][_0xcdef('0x36')]));_0xfa9d5e[_0xcdef('0x35')]=_0xfa9d5e[_0xcdef('0x35')][_0xcdef('0x37')]?_0xfa9d5e['attributes']:_0x3d8a91['model'];if(_0x15dd5c[_0xcdef('0x31')]['includeAll']){_0xfa9d5e[_0xcdef('0x43')]=[{'all':!![]}];}_0xfa9d5e=_['merge']({},_0xfa9d5e,_0x15dd5c[_0xcdef('0x40')]);return db[_0xcdef('0x41')]['find'](_0xfa9d5e)[_0xcdef('0x24')](handleEntityNotFound(_0x374b60,null))[_0xcdef('0x24')](respondWithResult(_0x374b60,null))[_0xcdef('0x46')](handleError(_0x374b60,null));};exports[_0xcdef('0x49')]=function(_0x102174,_0x56a5a7){return db[_0xcdef('0x41')]['create'](_0x102174[_0xcdef('0x4a')],{})[_0xcdef('0x24')](function(_0x494fb1){var _0x2da6fd=_0x102174[_0xcdef('0x4b')][_0xcdef('0x26')]({'plain':!![]});if(!_0x2da6fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2da6fd['role']===_0xcdef('0x4b')){var _0x317952=_0x494fb1['get']({'plain':!![]});var _0x36e26b='Companies';return db['UserProfileSection'][_0xcdef('0x4c')]({'where':{'name':_0x36e26b,'userProfileId':_0x2da6fd[_0xcdef('0x4d')]},'raw':!![]})['then'](function(_0x1f685b){if(_0x1f685b&&_0x1f685b[_0xcdef('0x4e')]===0x0){return db['UserProfileResource'][_0xcdef('0x49')]({'name':_0x317952[_0xcdef('0x2c')],'resourceId':_0x317952['id'],'type':_0x1f685b[_0xcdef('0x2c')],'sectionId':_0x1f685b['id']},{})[_0xcdef('0x24')](function(){return _0x494fb1;});}else{return _0x494fb1;}})[_0xcdef('0x46')](function(_0x48c355){logger[_0xcdef('0x2a')](_0xcdef('0x4f'),_0x48c355);throw _0x48c355;});}return _0x494fb1;})[_0xcdef('0x24')](respondWithResult(_0x56a5a7,0xc9))['catch'](handleError(_0x56a5a7,null));};exports[_0xcdef('0x23')]=function(_0x5678e8,_0x1ed5bf){if(_0x5678e8[_0xcdef('0x4a')]['id']){delete _0x5678e8[_0xcdef('0x4a')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x5678e8['params']['id']}})[_0xcdef('0x24')](handleEntityNotFound(_0x1ed5bf,null))[_0xcdef('0x24')](saveUpdates(_0x5678e8[_0xcdef('0x4a')],null))['then'](respondWithResult(_0x1ed5bf,null))[_0xcdef('0x46')](handleError(_0x1ed5bf,null));};exports[_0xcdef('0x25')]=function(_0xab49f3,_0x11c691){return db[_0xcdef('0x41')]['find']({'where':{'id':_0xab49f3[_0xcdef('0x50')]['id']}})[_0xcdef('0x24')](handleEntityNotFound(_0x11c691,null))[_0xcdef('0x24')](removeEntity(_0x11c691,null))[_0xcdef('0x46')](handleError(_0x11c691,null));};exports[_0xcdef('0x2f')]=function(_0x2d5010,_0x299f89){return db[_0xcdef('0x41')][_0xcdef('0x2f')]()[_0xcdef('0x24')](respondWithResult(_0x299f89,null))[_0xcdef('0x46')](handleError(_0x299f89,null));};exports[_0xcdef('0x51')]=function(_0x56e4f1,_0x423cef,_0x448545){return db[_0xcdef('0x52')][_0xcdef('0x4c')]({'where':{'id':_0x56e4f1[_0xcdef('0x50')]['id']}})[_0xcdef('0x24')](handleEntityNotFound(_0x423cef,null))['then'](function(_0x29b2c8){if(_0x29b2c8){return _0x29b2c8[_0xcdef('0x51')](_0x56e4f1[_0xcdef('0x4a')][_0xcdef('0x53')],_[_0xcdef('0x54')](_0x56e4f1[_0xcdef('0x4a')],[_0xcdef('0x53'),'id'])||{});}})[_0xcdef('0x24')](respondWithResult(_0x423cef,null))['catch'](handleError(_0x423cef,null));};exports[_0xcdef('0x55')]=function(_0x215f29,_0x5a3b97,_0x246671){var _0x54a947={};var _0x49fc94={};var _0x5ceefc;var _0x299397;return db[_0xcdef('0x41')][_0xcdef('0x56')]({'where':{'id':_0x215f29[_0xcdef('0x50')]['id']}})[_0xcdef('0x24')](handleEntityNotFound(_0x5a3b97,null))[_0xcdef('0x24')](function(_0x547449){if(_0x547449){_0x5ceefc=_0x547449;_0x49fc94[_0xcdef('0x30')]=_[_0xcdef('0x32')](db[_0xcdef('0x52')][_0xcdef('0x48')]);_0x49fc94[_0xcdef('0x31')]=_['keys'](_0x215f29[_0xcdef('0x31')]);_0x49fc94[_0xcdef('0x33')]=_['intersection'](_0x49fc94[_0xcdef('0x30')],_0x49fc94[_0xcdef('0x31')]);_0x54a947[_0xcdef('0x35')]=_[_0xcdef('0x34')](_0x49fc94[_0xcdef('0x30')],qs['fields'](_0x215f29['query']['fields']));_0x54a947[_0xcdef('0x35')]=_0x54a947[_0xcdef('0x35')][_0xcdef('0x37')]?_0x54a947[_0xcdef('0x35')]:_0x49fc94[_0xcdef('0x30')];_0x54a947[_0xcdef('0x3a')]=qs[_0xcdef('0x3b')](_0x215f29['query'][_0xcdef('0x3b')]);_0x54a947[_0xcdef('0x3c')]=qs['filters'](_[_0xcdef('0x3d')](_0x215f29[_0xcdef('0x31')],_0x49fc94[_0xcdef('0x33')]));if(_0x215f29[_0xcdef('0x31')][_0xcdef('0x3f')]){_0x54a947[_0xcdef('0x3c')]=_['merge'](_0x54a947['where'],{'$or':_[_0xcdef('0x3e')](_0x54a947['attributes'],function(_0xc8258e){var _0x54e0a0={};_0x54e0a0[_0xc8258e]={'$like':'%'+_0x215f29[_0xcdef('0x31')][_0xcdef('0x3f')]+'%'};return _0x54e0a0;})});}_0x54a947=_[_0xcdef('0x57')]({},_0x54a947,_0x215f29[_0xcdef('0x40')]);return _0x5ceefc[_0xcdef('0x55')](_0x54a947);}})[_0xcdef('0x24')](function(_0x4a5892){if(_0x4a5892){_0x299397=_0x4a5892['length'];if(!_0x215f29['query'][_0xcdef('0x38')](_0xcdef('0x39'))){_0x54a947[_0xcdef('0x1c')]=qs[_0xcdef('0x1c')](_0x215f29[_0xcdef('0x31')][_0xcdef('0x1c')]);_0x54a947['offset']=qs['offset'](_0x215f29['query'][_0xcdef('0x1e')]);}return _0x5ceefc[_0xcdef('0x55')](_0x54a947);}})[_0xcdef('0x24')](function(_0x116e38){if(_0x116e38){return _0x116e38?{'count':_0x299397,'rows':_0x116e38}:null;}})[_0xcdef('0x24')](respondWithResult(_0x5a3b97,null))[_0xcdef('0x46')](handleError(_0x5a3b97,null));}; \ No newline at end of file +var _0x76b4=['ejs','fs-extra','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','save','then','destroy','Companies','UserProfileResource','stack','name','index','CmCompany','describe','keys','query','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','include','rows','catch','show','params','fields','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','omit','findOne','rawAttributes','filter','map','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0x76b4,0x18f));var _0x476b=function(_0x4228e7,_0x31f8b3){_0x4228e7=_0x4228e7-0x0;var _0x4fb2df=_0x76b4[_0x4228e7];return _0x4fb2df;};'use strict';var emlformat=require(_0x476b('0x0'));var rimraf=require(_0x476b('0x1'));var zipdir=require(_0x476b('0x2'));var jsonpatch=require(_0x476b('0x3'));var rp=require(_0x476b('0x4'));var moment=require('moment');var BPromise=require(_0x476b('0x5'));var Mustache=require(_0x476b('0x6'));var util=require(_0x476b('0x7'));var path=require(_0x476b('0x8'));var sox=require(_0x476b('0x9'));var csv=require(_0x476b('0xa'));var ejs=require(_0x476b('0xb'));var fs=require('fs');var fs_extra=require(_0x476b('0xc'));var _=require('lodash');var squel=require(_0x476b('0xd'));var crypto=require(_0x476b('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x476b('0xa'));var querystring=require('querystring');var Papa=require(_0x476b('0xf'));var Redis=require('ioredis');var authService=require(_0x476b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x476b('0x11'));var hardwareService=require(_0x476b('0x12'));var logger=require(_0x476b('0x13'))('api');var utils=require(_0x476b('0x14'));var config=require(_0x476b('0x15'));var licenseUtil=require(_0x476b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29d29b,_0x584933){_0x584933=_0x584933||0xcc;return function(_0x306adf){if(_0x306adf){return _0x29d29b['sendStatus'](_0x584933);}return _0x29d29b[_0x476b('0x17')](_0x584933)[_0x476b('0x18')]();};}function respondWithResult(_0x26ef22,_0x624393){_0x624393=_0x624393||0xc8;return function(_0x49e471){if(_0x49e471){return _0x26ef22[_0x476b('0x17')](_0x624393)[_0x476b('0x19')](_0x49e471);}};}function respondWithFilteredResult(_0x3d095f,_0x4ae6f4){return function(_0x354584){if(_0x354584){var _0x4a9947=typeof _0x4ae6f4[_0x476b('0x1a')]===_0x476b('0x1b')&&typeof _0x4ae6f4[_0x476b('0x1c')]===_0x476b('0x1b');var _0x2c3b89=_0x354584[_0x476b('0x1d')];var _0x5ea21c=_0x4a9947?0x0:_0x4ae6f4[_0x476b('0x1a')];var _0x5a30a6=_0x4a9947?_0x354584[_0x476b('0x1d')]:_0x4ae6f4[_0x476b('0x1a')]+_0x4ae6f4[_0x476b('0x1c')];var _0x5dd385;if(_0x5a30a6>=_0x2c3b89){_0x5a30a6=_0x2c3b89;_0x5dd385=0xc8;}else{_0x5dd385=0xce;}_0x3d095f[_0x476b('0x17')](_0x5dd385);return _0x3d095f[_0x476b('0x1e')]('Content-Range',_0x5ea21c+'-'+_0x5a30a6+'/'+_0x2c3b89)[_0x476b('0x19')](_0x354584);}return null;};}function patchUpdates(_0x4b281b){return function(_0x7fd81e){try{jsonpatch['apply'](_0x7fd81e,_0x4b281b,!![]);}catch(_0x1fc7f0){return BPromise['reject'](_0x1fc7f0);}return _0x7fd81e[_0x476b('0x1f')]();};}function saveUpdates(_0x190c7f,_0x2a59af){return function(_0x490fc3){if(_0x490fc3){return _0x490fc3['update'](_0x190c7f)[_0x476b('0x20')](function(_0x4d80ad){return _0x4d80ad;});}return null;};}function removeEntity(_0x405023,_0x5c5c6d){return function(_0x494b7f){if(_0x494b7f){return _0x494b7f[_0x476b('0x21')]()[_0x476b('0x20')](function(){var _0x4de7c0=_0x494b7f['get']({'plain':!![]});var _0x479209=_0x476b('0x22');return db[_0x476b('0x23')][_0x476b('0x21')]({'where':{'type':_0x479209,'resourceId':_0x4de7c0['id']}})[_0x476b('0x20')](function(){return _0x494b7f;});})[_0x476b('0x20')](function(){_0x405023[_0x476b('0x17')](0xcc)[_0x476b('0x18')]();});}};}function handleEntityNotFound(_0x3d9b61,_0x4c0b45){return function(_0x4ccf46){if(!_0x4ccf46){_0x3d9b61['sendStatus'](0x194);}return _0x4ccf46;};}function handleError(_0x39aa47,_0x75421d){_0x75421d=_0x75421d||0x1f4;return function(_0x2064d8){logger['error'](_0x2064d8[_0x476b('0x24')]);if(_0x2064d8[_0x476b('0x25')]){delete _0x2064d8[_0x476b('0x25')];}_0x39aa47[_0x476b('0x17')](_0x75421d)['send'](_0x2064d8);};}exports[_0x476b('0x26')]=function(_0x12e9a7,_0x59808e){var _0x49855d={},_0x3381c7={},_0x46b9a8={'count':0x0,'rows':[]};return db[_0x476b('0x27')][_0x476b('0x28')]()[_0x476b('0x20')](function(_0x5161b3){_0x3381c7['model']=_[_0x476b('0x29')](_0x5161b3);_0x3381c7[_0x476b('0x2a')]=_[_0x476b('0x29')](_0x12e9a7[_0x476b('0x2a')]);_0x3381c7[_0x476b('0x2b')]=_[_0x476b('0x2c')](_0x3381c7['model'],_0x3381c7[_0x476b('0x2a')]);_0x49855d[_0x476b('0x2d')]=_['intersection'](_0x3381c7[_0x476b('0x2e')],qs['fields'](_0x12e9a7[_0x476b('0x2a')]['fields']));_0x49855d[_0x476b('0x2d')]=_0x49855d[_0x476b('0x2d')][_0x476b('0x2f')]?_0x49855d[_0x476b('0x2d')]:_0x3381c7['model'];if(!_0x12e9a7[_0x476b('0x2a')][_0x476b('0x30')](_0x476b('0x31'))){_0x49855d['limit']=qs[_0x476b('0x1c')](_0x12e9a7[_0x476b('0x2a')]['limit']);_0x49855d[_0x476b('0x1a')]=qs[_0x476b('0x1a')](_0x12e9a7[_0x476b('0x2a')][_0x476b('0x1a')]);}_0x49855d[_0x476b('0x32')]=qs[_0x476b('0x33')](_0x12e9a7[_0x476b('0x2a')][_0x476b('0x33')]);_0x49855d[_0x476b('0x34')]=qs[_0x476b('0x2b')](_[_0x476b('0x35')](_0x12e9a7[_0x476b('0x2a')],_0x3381c7[_0x476b('0x2b')]),_0x5161b3);if(_0x12e9a7[_0x476b('0x2a')]['filter']){_0x49855d['where']=_['merge'](_0x49855d['where'],{'$or':_['map'](_0x49855d[_0x476b('0x2d')],function(_0x11400f){var _0x2d0caf={};_0x2d0caf[_0x11400f]={'$like':'%'+_0x12e9a7[_0x476b('0x2a')]['filter']+'%'};return _0x2d0caf;})});}_0x49855d=_[_0x476b('0x36')]({},_0x49855d,_0x12e9a7['options']);var _0x2050d3={'where':_0x49855d[_0x476b('0x34')]};return db['CmCompany'][_0x476b('0x1d')](_0x2050d3)[_0x476b('0x20')](function(_0x17a195){_0x46b9a8[_0x476b('0x1d')]=_0x17a195;if(_0x12e9a7[_0x476b('0x2a')]['includeAll']){_0x49855d[_0x476b('0x37')]=[{'all':!![]}];}return db[_0x476b('0x27')]['findAll'](_0x49855d);})[_0x476b('0x20')](function(_0x34790c){_0x46b9a8[_0x476b('0x38')]=_0x34790c;return _0x46b9a8;})[_0x476b('0x20')](respondWithFilteredResult(_0x59808e,_0x49855d))['catch'](handleError(_0x59808e,null));})[_0x476b('0x39')](handleError(_0x59808e,null));};exports[_0x476b('0x3a')]=function(_0x392b8a,_0x1cec07){var _0x17d5b2={'raw':![],'where':{'id':_0x392b8a[_0x476b('0x3b')]['id']}},_0x51de94={};_0x51de94[_0x476b('0x2e')]=_[_0x476b('0x29')](db[_0x476b('0x27')]['rawAttributes']);_0x51de94[_0x476b('0x2a')]=_[_0x476b('0x29')](_0x392b8a[_0x476b('0x2a')]);_0x51de94[_0x476b('0x2b')]=_['intersection'](_0x51de94[_0x476b('0x2e')],_0x51de94['query']);_0x17d5b2[_0x476b('0x2d')]=_[_0x476b('0x2c')](_0x51de94[_0x476b('0x2e')],qs[_0x476b('0x3c')](_0x392b8a[_0x476b('0x2a')][_0x476b('0x3c')]));_0x17d5b2[_0x476b('0x2d')]=_0x17d5b2['attributes']['length']?_0x17d5b2[_0x476b('0x2d')]:_0x51de94[_0x476b('0x2e')];if(_0x392b8a['query'][_0x476b('0x3d')]){_0x17d5b2[_0x476b('0x37')]=[{'all':!![]}];}_0x17d5b2=_['merge']({},_0x17d5b2,_0x392b8a['options']);return db[_0x476b('0x27')][_0x476b('0x3e')](_0x17d5b2)[_0x476b('0x20')](handleEntityNotFound(_0x1cec07,null))['then'](respondWithResult(_0x1cec07,null))[_0x476b('0x39')](handleError(_0x1cec07,null));};exports[_0x476b('0x3f')]=function(_0x66a418,_0x53edb3){return db['CmCompany']['create'](_0x66a418[_0x476b('0x40')],{})[_0x476b('0x20')](function(_0x3ab3ef){var _0x54dcb5=_0x66a418[_0x476b('0x41')][_0x476b('0x42')]({'plain':!![]});if(!_0x54dcb5)throw new Error(_0x476b('0x43'));if(_0x54dcb5[_0x476b('0x44')]===_0x476b('0x41')){var _0x485ace=_0x3ab3ef[_0x476b('0x42')]({'plain':!![]});var _0x556905='Companies';return db['UserProfileSection'][_0x476b('0x3e')]({'where':{'name':_0x556905,'userProfileId':_0x54dcb5['userProfileId']},'raw':!![]})['then'](function(_0x54c15e){if(_0x54c15e&&_0x54c15e[_0x476b('0x45')]===0x0){return db[_0x476b('0x23')][_0x476b('0x3f')]({'name':_0x485ace[_0x476b('0x25')],'resourceId':_0x485ace['id'],'type':_0x54c15e['name'],'sectionId':_0x54c15e['id']},{})[_0x476b('0x20')](function(){return _0x3ab3ef;});}else{return _0x3ab3ef;}})[_0x476b('0x39')](function(_0x45b3e5){logger[_0x476b('0x46')](_0x476b('0x47'),_0x45b3e5);throw _0x45b3e5;});}return _0x3ab3ef;})[_0x476b('0x20')](respondWithResult(_0x53edb3,0xc9))['catch'](handleError(_0x53edb3,null));};exports[_0x476b('0x48')]=function(_0x3de89b,_0x4e4d9c){if(_0x3de89b['body']['id']){delete _0x3de89b[_0x476b('0x40')]['id'];}return db['CmCompany'][_0x476b('0x3e')]({'where':{'id':_0x3de89b[_0x476b('0x3b')]['id']}})[_0x476b('0x20')](handleEntityNotFound(_0x4e4d9c,null))[_0x476b('0x20')](saveUpdates(_0x3de89b[_0x476b('0x40')],null))[_0x476b('0x20')](respondWithResult(_0x4e4d9c,null))[_0x476b('0x39')](handleError(_0x4e4d9c,null));};exports[_0x476b('0x21')]=function(_0x4b914f,_0x2550c1){return db[_0x476b('0x27')][_0x476b('0x3e')]({'where':{'id':_0x4b914f['params']['id']}})['then'](handleEntityNotFound(_0x2550c1,null))[_0x476b('0x20')](removeEntity(_0x2550c1,null))['catch'](handleError(_0x2550c1,null));};exports[_0x476b('0x28')]=function(_0x17a32c,_0x4a63f2){return db['CmCompany']['describe']()[_0x476b('0x20')](respondWithResult(_0x4a63f2,null))['catch'](handleError(_0x4a63f2,null));};exports[_0x476b('0x49')]=function(_0x1ac042,_0x307343,_0x568269){return db[_0x476b('0x4a')][_0x476b('0x3e')]({'where':{'id':_0x1ac042[_0x476b('0x3b')]['id']}})['then'](handleEntityNotFound(_0x307343,null))['then'](function(_0x8de5cb){if(_0x8de5cb){return _0x8de5cb['addContacts'](_0x1ac042[_0x476b('0x40')][_0x476b('0x4b')],_[_0x476b('0x4c')](_0x1ac042['body'],[_0x476b('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x307343,null))['catch'](handleError(_0x307343,null));};exports['getContacts']=function(_0x277fc5,_0x965e62,_0x5d40db){var _0xf2889f={};var _0x31530b={};var _0x77378d;var _0x122bb1;return db[_0x476b('0x27')][_0x476b('0x4d')]({'where':{'id':_0x277fc5[_0x476b('0x3b')]['id']}})['then'](handleEntityNotFound(_0x965e62,null))[_0x476b('0x20')](function(_0xc93b20){if(_0xc93b20){_0x77378d=_0xc93b20;_0x31530b[_0x476b('0x2e')]=_[_0x476b('0x29')](db[_0x476b('0x4a')][_0x476b('0x4e')]);_0x31530b[_0x476b('0x2a')]=_[_0x476b('0x29')](_0x277fc5['query']);_0x31530b[_0x476b('0x2b')]=_[_0x476b('0x2c')](_0x31530b['model'],_0x31530b[_0x476b('0x2a')]);_0xf2889f[_0x476b('0x2d')]=_[_0x476b('0x2c')](_0x31530b['model'],qs[_0x476b('0x3c')](_0x277fc5['query'][_0x476b('0x3c')]));_0xf2889f[_0x476b('0x2d')]=_0xf2889f[_0x476b('0x2d')][_0x476b('0x2f')]?_0xf2889f[_0x476b('0x2d')]:_0x31530b['model'];_0xf2889f[_0x476b('0x32')]=qs[_0x476b('0x33')](_0x277fc5[_0x476b('0x2a')]['sort']);_0xf2889f[_0x476b('0x34')]=qs[_0x476b('0x2b')](_['pick'](_0x277fc5['query'],_0x31530b['filters']));if(_0x277fc5['query'][_0x476b('0x4f')]){_0xf2889f[_0x476b('0x34')]=_[_0x476b('0x36')](_0xf2889f[_0x476b('0x34')],{'$or':_[_0x476b('0x50')](_0xf2889f[_0x476b('0x2d')],function(_0x119a4d){var _0x432388={};_0x432388[_0x119a4d]={'$like':'%'+_0x277fc5[_0x476b('0x2a')][_0x476b('0x4f')]+'%'};return _0x432388;})});}_0xf2889f=_[_0x476b('0x36')]({},_0xf2889f,_0x277fc5['options']);return _0x77378d[_0x476b('0x51')](_0xf2889f);}})['then'](function(_0x7b044f){if(_0x7b044f){_0x122bb1=_0x7b044f['length'];if(!_0x277fc5[_0x476b('0x2a')][_0x476b('0x30')](_0x476b('0x31'))){_0xf2889f[_0x476b('0x1c')]=qs[_0x476b('0x1c')](_0x277fc5['query']['limit']);_0xf2889f[_0x476b('0x1a')]=qs[_0x476b('0x1a')](_0x277fc5['query'][_0x476b('0x1a')]);}return _0x77378d[_0x476b('0x51')](_0xf2889f);}})[_0x476b('0x20')](function(_0x352f6b){if(_0x352f6b){return _0x352f6b?{'count':_0x122bb1,'rows':_0x352f6b}:null;}})[_0x476b('0x20')](respondWithResult(_0x965e62,null))[_0x476b('0x39')](handleError(_0x965e62,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 722dbba..df6479a 100644 --- a/server/api/cmCompany/cmCompany.model.js +++ b/server/api/cmCompany/cmCompany.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ef9=['bluebird','path','../../config/environment','define','CmCompany','lodash','../../config/logger','api','moment'];(function(_0x460103,_0x5397b7){var _0x44499c=function(_0x1da241){while(--_0x1da241){_0x460103['push'](_0x460103['shift']());}};_0x44499c(++_0x5397b7);}(_0x1ef9,0x1be));var _0x91ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ef9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x91ef('0x0'));var util=require('util');var logger=require(_0x91ef('0x1'))(_0x91ef('0x2'));var moment=require(_0x91ef('0x3'));var BPromise=require(_0x91ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91ef('0x5'));var rimraf=require('rimraf');var config=require(_0x91ef('0x6'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x4efe10,_0x5d8750){return _0x4efe10[_0x91ef('0x7')](_0x91ef('0x8'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe03e=['../../config/environment','./cmCompany.attributes','exports','cm_companies','api','moment','bluebird','request-promise','rimraf'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe03e,0x1e1));var _0xee03=function(_0x5db38a,_0x3750d3){_0x5db38a=_0x5db38a-0x0;var _0x79eb3f=_0xe03e[_0x5db38a];return _0x79eb3f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xee03('0x0'));var moment=require(_0xee03('0x1'));var BPromise=require(_0xee03('0x2'));var rp=require(_0xee03('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xee03('0x4'));var config=require(_0xee03('0x5'));var attributes=require(_0xee03('0x6'));module[_0xee03('0x7')]=function(_0xdb8d90,_0x531db8){return _0xdb8d90['define']('CmCompany',attributes,{'tableName':_0xee03('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 04f7b5e..030b03c 100644 --- a/server/api/cmCompany/cmCompany.rpc.js +++ b/server/api/cmCompany/cmCompany.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc217=['rpc','../../config/environment','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0xc217,0x68));var _0x7c21=function(_0x158f01,_0x12af3e){_0x158f01=_0x158f01-0x0;var _0x5ef74e=_0xc217[_0x158f01];return _0x5ef74e;};'use strict';var _=require(_0x7c21('0x0'));var util=require(_0x7c21('0x1'));var moment=require('moment');var BPromise=require(_0x7c21('0x2'));var rs=require(_0x7c21('0x3'));var fs=require('fs');var Redis=require(_0x7c21('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c21('0x5'));var logger=require('../../config/logger')(_0x7c21('0x6'));var config=require(_0x7c21('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7c21('0x8')][_0x7c21('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32de9e,_0xb50afe,_0xdcd342){return new BPromise(function(_0x4faa55,_0x2f9b53){return client['request'](_0x32de9e,_0xdcd342)[_0x7c21('0xa')](function(_0x835270){logger[_0x7c21('0xb')](_0x7c21('0xc'),_0xb50afe,_0x7c21('0xd'));logger[_0x7c21('0xe')](_0x7c21('0xf'),_0xb50afe,'request\x20sent',JSON[_0x7c21('0x10')](_0x835270));if(_0x835270[_0x7c21('0x11')]){if(_0x835270['error'][_0x7c21('0x12')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0xb50afe,_0x835270['error'][_0x7c21('0x13')]);return _0x2f9b53(_0x835270[_0x7c21('0x11')][_0x7c21('0x13')]);}logger[_0x7c21('0x11')](_0x7c21('0xc'),_0xb50afe,_0x835270[_0x7c21('0x11')][_0x7c21('0x13')]);return _0x4faa55(_0x835270[_0x7c21('0x11')]['message']);}else{logger[_0x7c21('0xb')](_0x7c21('0xc'),_0xb50afe,_0x7c21('0xd'));_0x4faa55(_0x835270[_0x7c21('0x14')]['message']);}})[_0x7c21('0x15')](function(_0x308ce2){logger[_0x7c21('0x11')](_0x7c21('0xc'),_0xb50afe,_0x308ce2);_0x2f9b53(_0x308ce2);});});} \ No newline at end of file +var _0x6a7f=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash'];(function(_0x5ee8ef,_0x411b49){var _0x286dc4=function(_0x5df061){while(--_0x5df061){_0x5ee8ef['push'](_0x5ee8ef['shift']());}};_0x286dc4(++_0x411b49);}(_0x6a7f,0x72));var _0xf6a7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6a7f[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xf6a7('0x0'));var util=require(_0xf6a7('0x1'));var moment=require(_0xf6a7('0x2'));var BPromise=require(_0xf6a7('0x3'));var rs=require(_0xf6a7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6a7('0x5'))['db'];var utils=require(_0xf6a7('0x6'));var logger=require('../../config/logger')(_0xf6a7('0x7'));var config=require(_0xf6a7('0x8'));var jayson=require(_0xf6a7('0x9'));var client=jayson[_0xf6a7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c83d3,_0xb2177b,_0x10f204){return new BPromise(function(_0x1c697f,_0x956862){return client['request'](_0x4c83d3,_0x10f204)[_0xf6a7('0xb')](function(_0x26c852){logger['info'](_0xf6a7('0xc'),_0xb2177b,'request\x20sent');logger[_0xf6a7('0xd')](_0xf6a7('0xe'),_0xb2177b,'request\x20sent',JSON[_0xf6a7('0xf')](_0x26c852));if(_0x26c852[_0xf6a7('0x10')]){if(_0x26c852['error'][_0xf6a7('0x11')]===0x1f4){logger['error'](_0xf6a7('0xc'),_0xb2177b,_0x26c852[_0xf6a7('0x10')][_0xf6a7('0x12')]);return _0x956862(_0x26c852[_0xf6a7('0x10')][_0xf6a7('0x12')]);}logger[_0xf6a7('0x10')](_0xf6a7('0xc'),_0xb2177b,_0x26c852[_0xf6a7('0x10')]['message']);return _0x1c697f(_0x26c852[_0xf6a7('0x10')][_0xf6a7('0x12')]);}else{logger[_0xf6a7('0x13')]('CmCompany,\x20%s,\x20%s',_0xb2177b,_0xf6a7('0x14'));_0x1c697f(_0x26c852[_0xf6a7('0x15')][_0xf6a7('0x12')]);}})[_0xf6a7('0x16')](function(_0x138af0){logger['error']('CmCompany,\x20%s,\x20%s',_0xb2177b,_0x138af0);_0x956862(_0x138af0);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 4684b53..5ef19a0 100644 --- a/server/api/cmCompany/index.js +++ b/server/api/cmCompany/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9900=['Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/contacts','post','create','addContacts','put','update','delete','destroy','exports','connect-timeout','express'];(function(_0x2e068a,_0x29903b){var _0x4c6aae=function(_0x1bc648){while(--_0x1bc648){_0x2e068a['push'](_0x2e068a['shift']());}};_0x4c6aae(++_0x29903b);}(_0x9900,0x16e));var _0x0990=function(_0x3f7edf,_0x2c96ce){_0x3f7edf=_0x3f7edf-0x0;var _0xa8d31c=_0x9900[_0x3f7edf];return _0xa8d31c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0990('0x0'));var express=require(_0x0990('0x1'));var router=express[_0x0990('0x2')]();var fs_extra=require(_0x0990('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0990('0x4'));var config=require(_0x0990('0x5'));var controller=require(_0x0990('0x6'));router['get']('/',auth[_0x0990('0x7')](),controller[_0x0990('0x8')]);router[_0x0990('0x9')](_0x0990('0xa'),auth[_0x0990('0x7')](),controller[_0x0990('0xb')]);router['get'](_0x0990('0xc'),auth['isAuthenticated'](),controller[_0x0990('0xd')]);router['get'](_0x0990('0xe'),auth[_0x0990('0x7')](),controller['getContacts']);router[_0x0990('0xf')]('/',auth[_0x0990('0x7')](),controller[_0x0990('0x10')]);router[_0x0990('0xf')](_0x0990('0xe'),auth['isAuthenticated'](),controller[_0x0990('0x11')]);router[_0x0990('0x12')](_0x0990('0xc'),auth[_0x0990('0x7')](),controller[_0x0990('0x13')]);router[_0x0990('0x14')](_0x0990('0xc'),auth[_0x0990('0x7')](),controller[_0x0990('0x15')]);module[_0x0990('0x16')]=router; \ No newline at end of file +var _0x3867=['describe','/:id','show','/:id/contacts','getContacts','addContacts','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated'];(function(_0x4b0c90,_0x265ec3){var _0x22ca66=function(_0x5aac20){while(--_0x5aac20){_0x4b0c90['push'](_0x4b0c90['shift']());}};_0x22ca66(++_0x265ec3);}(_0x3867,0x15f));var _0x7386=function(_0x432664,_0x4edf2e){_0x432664=_0x432664-0x0;var _0x3338b3=_0x3867[_0x432664];return _0x3338b3;};'use strict';var multer=require('multer');var util=require(_0x7386('0x0'));var path=require(_0x7386('0x1'));var timeout=require(_0x7386('0x2'));var express=require('express');var router=express[_0x7386('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7386('0x4'));var interaction=require(_0x7386('0x5'));var config=require(_0x7386('0x6'));var controller=require('./cmCompany.controller');router[_0x7386('0x7')]('/',auth['isAuthenticated'](),controller[_0x7386('0x8')]);router['get']('/describe',auth[_0x7386('0x9')](),controller[_0x7386('0xa')]);router[_0x7386('0x7')](_0x7386('0xb'),auth[_0x7386('0x9')](),controller[_0x7386('0xc')]);router[_0x7386('0x7')](_0x7386('0xd'),auth[_0x7386('0x9')](),controller[_0x7386('0xe')]);router['post']('/',auth[_0x7386('0x9')](),controller['create']);router['post'](_0x7386('0xd'),auth[_0x7386('0x9')](),controller[_0x7386('0xf')]);router['put']('/:id',auth[_0x7386('0x9')](),controller[_0x7386('0x10')]);router[_0x7386('0x11')](_0x7386('0xb'),auth[_0x7386('0x9')](),controller['destroy']);module[_0x7386('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index e5a2411..f68ee90 100644 --- a/server/api/cmContact/cmContact.attributes.js +++ b/server/api/cmContact/cmContact.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e37=['TEXT','UNSIGNED','INTEGER','lodash','sequelize','exports','STRING'];(function(_0x445587,_0x20453a){var _0x3d795c=function(_0x5a2f5d){while(--_0x5a2f5d){_0x445587['push'](_0x445587['shift']());}};_0x3d795c(++_0x20453a);}(_0x1e37,0xff));var _0x71e3=function(_0x935271,_0x3c166c){_0x935271=_0x935271-0x0;var _0xa79e5e=_0x1e37[_0x935271];return _0xa79e5e;};'use strict';var _=require(_0x71e3('0x0'));var Sequelize=require(_0x71e3('0x1'));module[_0x71e3('0x2')]={'firstName':{'type':Sequelize[_0x71e3('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x71e3('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x71e3('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x71e3('0x3')]},'description':{'type':Sequelize[_0x71e3('0x4')]},'phone':{'type':Sequelize[_0x71e3('0x3')]},'mobile':{'type':Sequelize[_0x71e3('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x71e3('0x3')]},'url':{'type':Sequelize[_0x71e3('0x3')]},'facebook':{'type':Sequelize[_0x71e3('0x3')]},'fb_data':{'type':Sequelize[_0x71e3('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x71e3('0x3')]},'teams':{'type':Sequelize[_0x71e3('0x3')]},'viber':{'type':Sequelize[_0x71e3('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x71e3('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x71e3('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x71e3('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x71e3('0x3')]},'utcOffset':{'type':Sequelize[_0x71e3('0x6')]}}; \ No newline at end of file +var _0xf068=['exports','STRING','INTEGER','UNSIGNED','NOW','lodash'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xf068,0xa7));var _0x8f06=function(_0x2a59b0,_0x481f45){_0x2a59b0=_0x2a59b0-0x0;var _0x2f5b70=_0xf068[_0x2a59b0];return _0x2f5b70;};'use strict';var _=require(_0x8f06('0x0'));var Sequelize=require('sequelize');module[_0x8f06('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x8f06('0x2')]},'street':{'type':Sequelize[_0x8f06('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x8f06('0x2')]},'country':{'type':Sequelize[_0x8f06('0x2')]},'dateOfBirth':{'type':Sequelize[_0x8f06('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x8f06('0x2')]},'mobile':{'type':Sequelize[_0x8f06('0x2')]},'fax':{'type':Sequelize[_0x8f06('0x2')]},'email':{'type':Sequelize[_0x8f06('0x2')]},'url':{'type':Sequelize[_0x8f06('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x8f06('0x2')]},'twitter':{'type':Sequelize[_0x8f06('0x2')]},'skype':{'type':Sequelize[_0x8f06('0x2')]},'teams':{'type':Sequelize[_0x8f06('0x2')]},'viber':{'type':Sequelize[_0x8f06('0x2')]},'line':{'type':Sequelize[_0x8f06('0x2')]},'wechat':{'type':Sequelize[_0x8f06('0x2')]},'telegram':{'type':Sequelize[_0x8f06('0x2')]},'UserId':{'type':Sequelize[_0x8f06('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x8f06('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8f06('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8f06('0x5')]},'dialTimezone':{'type':Sequelize[_0x8f06('0x2')]},'utcOffset':{'type':Sequelize[_0x8f06('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 5140576..8f60593 100644 --- a/server/api/cmContact/cmContact.controller.js +++ b/server/api/cmContact/cmContact.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9797=['$and','omit','map','format','cf_%d','pickBy','isEmpty','cm_contacts','setFields','id\x20=\x20?','toParam','phone','getTags','model','Tag','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','options','nolimit','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','PHONE','literal','`ItemType`.OrderBy','ItemType.OrderBy','fromContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','findOne','ContactId','includeAll','include','rows','getHopperFinals','CmHopperFinal','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','join','root','server/files/tmp','file','filename','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','meta','User','agent','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','../../components/import/cm/csv2','stringify','message','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','openchannel','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','destination','callerid','starttime','duration','createdAt','userDisposition','UserId','fullname','DESC','startCase','Website','Account','closed','closedAt','thirdDisposition','key','Owner','Tags','browserName','customerIp','customerPort','deviceModel','osName','ratingType','ratingValue','referer','substatus','externalUrl','threadId','Interaction','flatten','sortBy','reverse','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','defaults','register','status','undefined','count','offset','limit','set','json','update','then','destroy','end','sendStatus','error','stack','name','index','describe','findAll','query','user','CmContact','find','params','catch','tags','keys','length','startsWith','columnName','analytics','CmCustomField','cf_','displayName','alias','custom','type','values','info','forEach','merge','body','from','get','mergeWith','isArray','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','WhatsappMessage','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','hasOwnProperty','contact','all','show','tag','Phones','ContactItemType','ItemType','sequelize','Phones.OrderBy'];(function(_0x20e295,_0x308599){var _0x33ffbe=function(_0x2eeb46){while(--_0x2eeb46){_0x20e295['push'](_0x20e295['shift']());}};_0x33ffbe(++_0x308599);}(_0x9797,0x185));var _0x7979=function(_0x37ef22,_0x348c92){_0x37ef22=_0x37ef22-0x0;var _0x49eeb3=_0x9797[_0x37ef22];return _0x49eeb3;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x7979('0x0'));var path=require(_0x7979('0x1'));var fs=require('fs');var _=require(_0x7979('0x2'));var squel=require(_0x7979('0x3'));var Papa=require(_0x7979('0x4'));var Redis=require(_0x7979('0x5'));var contacts=require(_0x7979('0x6'));var qs=require(_0x7979('0x7'));var logger=require(_0x7979('0x8'))(_0x7979('0x9'));var config=require('../../config/environment');var shared=require(_0x7979('0xa'));var db=require(_0x7979('0xb'))['db'];config[_0x7979('0xc')]=_[_0x7979('0xd')](config[_0x7979('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7979('0xc')]));require('./cmContact.socket')[_0x7979('0xe')](socket);function respondWithResult(_0x40c911,_0x3e6c7f){_0x3e6c7f=_0x3e6c7f||0xc8;return function(_0x36f764){if(_0x36f764){return _0x40c911[_0x7979('0xf')](_0x3e6c7f)['json'](_0x36f764);}};}function respondWithFilteredResult(_0xb5af4b,_0x1986e6){return function(_0x29692d){if(_0x29692d){var _0x182fd2=typeof _0x1986e6['offset']===_0x7979('0x10')&&typeof _0x1986e6['limit']===_0x7979('0x10');var _0x17429a=_0x29692d[_0x7979('0x11')];var _0x509583=_0x182fd2?0x0:_0x1986e6[_0x7979('0x12')];var _0x1cfb9a=_0x182fd2?_0x29692d[_0x7979('0x11')]:_0x1986e6[_0x7979('0x12')]+_0x1986e6[_0x7979('0x13')];var _0x336f28;if(_0x1cfb9a>=_0x17429a){_0x1cfb9a=_0x17429a;_0x336f28=0xc8;}else{_0x336f28=0xce;}_0xb5af4b[_0x7979('0xf')](_0x336f28);return _0xb5af4b[_0x7979('0x14')]('Content-Range',_0x509583+'-'+_0x1cfb9a+'/'+_0x17429a)[_0x7979('0x15')](_0x29692d);}return null;};}function saveUpdates(_0x36b718){return function(_0x33832a){if(_0x33832a){return _0x33832a[_0x7979('0x16')](_0x36b718)[_0x7979('0x17')](function(_0x2c760c){return _0x2c760c;});}return null;};}function removeEntity(_0x2d313f){return function(_0x2aecdd){if(_0x2aecdd){return _0x2aecdd[_0x7979('0x18')]()['then'](function(){_0x2d313f[_0x7979('0xf')](0xcc)[_0x7979('0x19')]();});}};}function handleEntityNotFound(_0x503bea){return function(_0x559a18){if(!_0x559a18){_0x503bea[_0x7979('0x1a')](0x194);}return _0x559a18;};}function handleError(_0x5a4ed2,_0x2d8d5d){_0x2d8d5d=_0x2d8d5d||0x1f4;return function(_0x26f3b9){logger[_0x7979('0x1b')](_0x26f3b9[_0x7979('0x1c')]);if(_0x26f3b9[_0x7979('0x1d')]){delete _0x26f3b9['name'];}_0x5a4ed2[_0x7979('0xf')](_0x2d8d5d)['send'](_0x26f3b9);};}exports[_0x7979('0x1e')]=function(_0x592aba,_0x1cc86f){var _0x2509b5={};return contacts[_0x7979('0x1f')]()[_0x7979('0x17')](function(_0x5c62eb){_0x2509b5=qs['getOptions'](_0x5c62eb,_0x592aba);return contacts[_0x7979('0x20')](_0x592aba[_0x7979('0x21')],_0x592aba[_0x7979('0x22')],_0x2509b5,_0x5c62eb);})['then'](respondWithFilteredResult(_0x1cc86f,_0x2509b5))['catch'](handleError(_0x1cc86f,null));};exports[_0x7979('0x18')]=function(_0x47a768,_0x4f6d07){return db[_0x7979('0x23')][_0x7979('0x24')]({'where':{'id':_0x47a768[_0x7979('0x25')]['id']}})[_0x7979('0x17')](handleEntityNotFound(_0x4f6d07,null))[_0x7979('0x17')](removeEntity(_0x4f6d07,null))[_0x7979('0x26')](handleError(_0x4f6d07,null));};exports[_0x7979('0x1f')]=function(_0x4070cb,_0x53dec0){return db[_0x7979('0x23')][_0x7979('0x1f')]()[_0x7979('0x17')](function(_0x537117){delete _0x537117[_0x7979('0x27')];for(var _0x58197d=0x0;_0x58197d0x0){return new Promise(function(_0x797128){var _0x3d6a2e=[];for(var _0x3fafe7=0x0;_0x3fafe7<_0x51ef88[_0x7979('0x29')];_0x3fafe7++){_0x3d6a2e[_0x7979('0x5a')](insertAdditionalPhones(_0x51ef88[_0x3fafe7][_0x7979('0x5e')],_0x51ef88[_0x3fafe7][_0x7979('0x54')]));}Promise[_0x7979('0x5f')](_0x3d6a2e)[_0x7979('0x17')](function(){_0x797128(0x1);});})[_0x7979('0x17')](function(){return{'success':_0x481228,'failure':_0x553e26,'duplicates':_0x5e02fb};});}else{return{'success':_0x481228,'failure':_0x553e26,'duplicates':_0x5e02fb};}}})[_0x7979('0x17')](respondWithResult(_0x5a4aa4,0xc9))[_0x7979('0x26')](handleError(_0x5a4aa4,null));};exports[_0x7979('0x60')]=function(_0x15f6bf,_0x715551){var _0x16fd75;return db[_0x7979('0x23')]['describe']()['then'](function(_0x5c4491){return db[_0x7979('0x23')][_0x7979('0x24')]({'where':{'id':_0x15f6bf[_0x7979('0x25')]['id']},'include':[{'model':db['Tag'],'as':'Tags','attributes':['id','name','color'],'required':_0x15f6bf['query'][_0x7979('0x61')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x7979('0x62'),'where':{'CmContactId':_0x15f6bf[_0x7979('0x25')]['id']},'required':![],'include':[{'model':db[_0x7979('0x63')],'as':_0x7979('0x64')}]}],'order':[db[_0x7979('0x65')]['literal'](_0x7979('0x66'))],'attributes':_[_0x7979('0x28')](_0x5c4491)});})[_0x7979('0x17')](function(_0x49862c){if(!_[_0x7979('0x50')](_0x49862c)){_0x16fd75=_0x49862c['get']({'plain':!![]});var _0x304799={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x49862c&&_0x49862c[_0x7979('0x5b')]){if(_0x49862c[_0x7979('0x5b')]){_0x304799[_0x7979('0x58')][_0x7979('0x67')]['push']({'ListId':{'$ne':_0x49862c[_0x7979('0x5b')]}});}}return db[_0x7979('0x2d')][_0x7979('0x20')](_0x304799);}})[_0x7979('0x17')](function(_0x49c2a7){if(!_['isNil'](_0x49c2a7)){return _[_0x7979('0x68')](_0x16fd75,_[_0x7979('0x69')](_0x49c2a7,function(_0x1c14a2){return util[_0x7979('0x6a')](_0x7979('0x6b'),_0x1c14a2['id']);}));}})[_0x7979('0x17')](handleEntityNotFound(_0x715551,null))[_0x7979('0x17')](respondWithResult(_0x715551,null))['catch'](handleError(_0x715551,null));};exports[_0x7979('0x16')]=function(_0x167c72,_0x62ac84){var _0x14af22;if(_0x167c72[_0x7979('0x37')]['id']){delete _0x167c72[_0x7979('0x37')]['id'];}if(!_['isNil'](_0x167c72['body'][_0x7979('0x51')])){var _0x87974f=_0x167c72[_0x7979('0x37')][_0x7979('0x51')];if(!_[_0x7979('0x50')](shared['timezones'][_0x87974f]))_0x167c72[_0x7979('0x37')][_0x7979('0x53')]=shared['timezones'][_0x87974f]['utcOffset'];}return db['CmContact'][_0x7979('0x24')]({'where':{'id':_0x167c72[_0x7979('0x25')]['id']}})[_0x7979('0x17')](handleEntityNotFound(_0x62ac84,null))[_0x7979('0x17')](saveUpdates(_0x167c72['body'],null))[_0x7979('0x17')](function(_0x31fd45){_0x14af22=_0x31fd45;var _0x533e72={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x31fd45&&_0x31fd45[_0x7979('0x5b')]){if(_0x31fd45['ListId']){_0x533e72[_0x7979('0x58')][_0x7979('0x67')]['push']({'ListId':{'$ne':_0x31fd45[_0x7979('0x5b')]}});}}return db['CmCustomField']['findAll'](_0x533e72);})[_0x7979('0x17')](function(_0x5ebb18){if(_0x5ebb18){return _[_0x7979('0x68')](_[_0x7979('0x6c')](_0x167c72[_0x7979('0x37')],function(_0x21ec75,_0x3a135b){return _['startsWith'](_0x3a135b,_0x7979('0x2e'));}),_[_0x7979('0x69')](_0x5ebb18,function(_0x21e0d0){return util[_0x7979('0x6a')](_0x7979('0x6b'),_0x21e0d0['id']);}));}})[_0x7979('0x17')](function(_0x2a78f9){if(_0x2a78f9&&!_[_0x7979('0x6d')](_0x2a78f9)){var _0x1a4a96=squel['update']()['table'](_0x7979('0x6e'))[_0x7979('0x6f')](_0x2a78f9)[_0x7979('0x58')](_0x7979('0x70'),_0x167c72['params']['id'])[_0x7979('0x71')]();return db[_0x7979('0x65')]['query'](_0x1a4a96['text'],{'replacements':_0x1a4a96['values']});}})[_0x7979('0x17')](function(){if(_0x167c72[_0x7979('0x37')]['phone']&&_0x14af22){return db[_0x7979('0x3d')][_0x7979('0x16')]({'phone':_0x167c72['body'][_0x7979('0x72')],'OrderBy':0x0},{'where':{'ContactId':_0x14af22['id']}});}})[_0x7979('0x17')](function(){return _0x14af22;})[_0x7979('0x17')](respondWithResult(_0x62ac84,null))[_0x7979('0x26')](handleError(_0x62ac84,null));};exports[_0x7979('0x73')]=function(_0x31f42e,_0x3847a2){var _0x5076eb={};var _0x245405={};var _0xdecd8a;var _0x1608dc;return db[_0x7979('0x23')]['findOne']({'where':{'id':_0x31f42e['params']['id']}})[_0x7979('0x17')](handleEntityNotFound(_0x3847a2,null))['then'](function(_0x1a59bb){if(_0x1a59bb){_0xdecd8a=_0x1a59bb;_0x245405[_0x7979('0x74')]=_[_0x7979('0x28')](db[_0x7979('0x75')][_0x7979('0x76')]);_0x245405['query']=_[_0x7979('0x28')](_0x31f42e[_0x7979('0x21')]);_0x245405[_0x7979('0x77')]=_[_0x7979('0x78')](_0x245405[_0x7979('0x74')],_0x245405[_0x7979('0x21')]);_0x5076eb[_0x7979('0x79')]=_['intersection'](_0x245405[_0x7979('0x74')],qs[_0x7979('0x7a')](_0x31f42e['query'][_0x7979('0x7a')]));_0x5076eb[_0x7979('0x79')]=_0x5076eb['attributes'][_0x7979('0x29')]?_0x5076eb['attributes']:_0x245405[_0x7979('0x74')];_0x5076eb[_0x7979('0x7b')]=qs[_0x7979('0x7c')](_0x31f42e[_0x7979('0x21')][_0x7979('0x7c')]);_0x5076eb[_0x7979('0x58')]=qs['filters'](_[_0x7979('0x7d')](_0x31f42e[_0x7979('0x21')],_0x245405[_0x7979('0x77')]));if(_0x31f42e[_0x7979('0x21')][_0x7979('0x7e')]){_0x5076eb[_0x7979('0x58')]=_[_0x7979('0x36')](_0x5076eb[_0x7979('0x58')],{'$or':_[_0x7979('0x69')](_0x5076eb[_0x7979('0x79')],function(_0x2f1c42){var _0x37b9e1={};_0x37b9e1[_0x2f1c42]={'$like':'%'+_0x31f42e['query']['filter']+'%'};return _0x37b9e1;})});}_0x5076eb=_[_0x7979('0x36')]({},_0x5076eb,_0x31f42e[_0x7979('0x7f')]);return _0xdecd8a[_0x7979('0x73')](_0x5076eb);}})[_0x7979('0x17')](function(_0x402ec8){if(_0x402ec8){_0x1608dc=_0x402ec8[_0x7979('0x29')];if(!_0x31f42e[_0x7979('0x21')][_0x7979('0x5d')](_0x7979('0x80'))){_0x5076eb[_0x7979('0x13')]=qs[_0x7979('0x13')](_0x31f42e['query'][_0x7979('0x13')]);_0x5076eb[_0x7979('0x12')]=qs[_0x7979('0x12')](_0x31f42e['query'][_0x7979('0x12')]);}return _0xdecd8a['getTags'](_0x5076eb);}})[_0x7979('0x17')](function(_0x4f8d6b){if(_0x4f8d6b){return _0x4f8d6b?{'count':_0x1608dc,'rows':_0x4f8d6b}:null;}})[_0x7979('0x17')](respondWithResult(_0x3847a2,null))[_0x7979('0x26')](handleError(_0x3847a2,null));};exports[_0x7979('0x81')]=function(_0x5e330c,_0x66b0a6){if(_0x5e330c['body']['id']){delete _0x5e330c['body']['id'];}return db[_0x7979('0x23')]['findOne']({'where':{'id':_0x5e330c[_0x7979('0x25')]['id']}})[_0x7979('0x17')](handleEntityNotFound(_0x66b0a6,null))['then'](function(_0x2b0e9a){if(_0x2b0e9a){return _0x2b0e9a[_0x7979('0x81')](_0x5e330c['body'][_0x7979('0x82')]||[]);}return null;})[_0x7979('0x17')](respondWithResult(_0x66b0a6,null))[_0x7979('0x26')](handleError(_0x66b0a6,null));};exports[_0x7979('0x83')]=function(_0x4cd1be,_0x54da6c){var _0x5742c7=[];_0x5742c7['push'](addAdditionalPhones(_0x4cd1be[_0x7979('0x37')]));Promise['all'](_0x5742c7)['then'](function(){_0x5742c7=[];_0x5742c7[_0x7979('0x5a')](deleteCmHopperPhones(_0x4cd1be[_0x7979('0x37')]['id']));_0x5742c7[_0x7979('0x5a')](addCmHopperPhones(_0x4cd1be['body']['id']));Promise[_0x7979('0x5f')](_0x5742c7)[_0x7979('0x17')](function(){return[0x1];})[_0x7979('0x17')](respondWithResult(_0x54da6c,null));});};function addAdditionalPhones(_0x420f02){var _0x34d1b0;return new Promise(function(_0x3fd00d){return db['CmContactHasItem'][_0x7979('0x18')]({'where':{'CmContactId':_0x420f02['id']}})[_0x7979('0x17')](function(){db[_0x7979('0x63')]['findAll']({'raw':!![],'attributes':['id',_0x7979('0x84')]})['then'](function(_0x412d9d){var _0x4447a5=[];for(var _0x39d48e=0x0;_0x39d48e<_0x420f02[_0x7979('0x85')][_0x7979('0x29')];_0x39d48e++){var _0x303c68=_0x420f02['item_types']?_[_0x7979('0x50')](_0x420f02[_0x7979('0x86')][_0x39d48e])?'':_0x420f02[_0x7979('0x86')][_0x39d48e]:_0x420f02['items'][_0x39d48e][_0x7979('0x87')]?_0x420f02[_0x7979('0x85')][_0x39d48e][_0x7979('0x87')]:'';var _0x450fc9=_[_0x7979('0x50')](_0x420f02[_0x7979('0x85')][_0x39d48e]['description'])?'':_0x420f02[_0x7979('0x85')][_0x39d48e][_0x7979('0x88')];var _0xaa7cb2=_0x303c68+':'+_0x420f02[_0x7979('0x85')][_0x39d48e][_0x7979('0x72')]+'§'+_0x450fc9;if(_[_0x7979('0x50')](_0x34d1b0))_0x34d1b0=_0xaa7cb2;else _0x34d1b0+=';'+_0xaa7cb2;var _0x2c03e9=null;var _0x4f2f8f=null;if(_0x420f02[_0x7979('0x86')]){if(!_[_0x7979('0x50')](_0x420f02[_0x7979('0x86')][_0x39d48e])){_0x4f2f8f=_[_0x7979('0x24')](_0x412d9d,function(_0x15a104){return _0x15a104['id']===_0x420f02[_0x7979('0x86')][_0x39d48e];});if(!_[_0x7979('0x50')](_0x4f2f8f)){_0x2c03e9=_0x4f2f8f[_0x7979('0x84')];}}}else{if(!_['isNil'](_0x420f02[_0x7979('0x85')][_0x39d48e])){_0x4f2f8f=_[_0x7979('0x24')](_0x412d9d,function(_0x31f226){return _0x31f226['id']===_0x420f02[_0x7979('0x85')][_0x39d48e][_0x7979('0x87')];});if(!_['isNil'](_0x4f2f8f)){_0x2c03e9=_0x39d48e;}}}if(_[_0x7979('0x50')](_0x2c03e9)){_0x2c03e9=0x64;}_0x4447a5[_0x7979('0x5a')](addAdditionalPhone(_0x420f02['id'],_0x420f02['items'][_0x39d48e]['phone'],_0x420f02[_0x7979('0x86')]?_[_0x7979('0x50')](_0x420f02[_0x7979('0x86')][_0x39d48e])?null:_0x420f02[_0x7979('0x86')][_0x39d48e]:_0x420f02[_0x7979('0x85')][_0x39d48e]['ItemTypeId']?_0x420f02['items'][_0x39d48e][_0x7979('0x87')]:null,_0x2c03e9,_0x450fc9));}Promise[_0x7979('0x5f')](_0x4447a5)['then'](function(){db['CmContact'][_0x7979('0x16')]({'AdditionalPhones':_0x34d1b0},{'where':{'id':_0x420f02['id']}})['then'](function(){_0x3fd00d(0x1);});});});});});}function addAdditionalPhone(_0x519784,_0x356722,_0x444f3e,_0x506c07,_0x294f45){return db[_0x7979('0x49')][_0x7979('0x24')]({'where':{'CmContactId':_0x519784,'item':_0x356722}})['then'](function(_0x37398e){if(_0x37398e)logger[_0x7979('0x34')](_0x7979('0x89'),_0x37398e);else{db[_0x7979('0x49')][_0x7979('0x3f')]({'CmContactId':_0x519784,'item':_0x356722,'ItemTypeId':_0x444f3e,'OrderBy':_0x506c07,'ItemClass':'PHONE','description':_0x294f45});}});}function deleteCmHopperPhones(_0x48009a){return new Promise(function(_0x396ca8){return db[_0x7979('0x3d')][_0x7979('0x20')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x48009a}})[_0x7979('0x17')](function(_0x54bd2f){db[_0x7979('0x8a')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x7979('0x69')](_0x54bd2f,'id')}}});})[_0x7979('0x17')](function(){_0x396ca8(0x1);});});}function addCmHopperPhones(_0x133835){return new Promise(function(_0x2e92d7){return db[_0x7979('0x3d')][_0x7979('0x20')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x133835}})['then'](function(_0xc3367e){var _0x452a62=[];_[_0x7979('0x69')](_0xc3367e,function(_0x4d7697){_0x452a62['push'](createCmHopperPhone(_0x133835,_0x4d7697['id']));});Promise[_0x7979('0x5f')](_0x452a62)[_0x7979('0x17')](function(){_0x2e92d7(0x1);});});});}function createCmHopperPhone(_0x482ccc,_0xa5427d){return new Promise(function(_0x841fcb){db[_0x7979('0x49')][_0x7979('0x20')]({'raw':!![],'attributes':['item',_0x7979('0x84')],'where':{'CmContactId':_0x482ccc,'ItemClass':_0x7979('0x8b')},'include':[{'model':db[_0x7979('0x63')],'attributes':[_0x7979('0x84')],'as':'ItemType'}],'order':[_0x7979('0x84'),db[_0x7979('0x65')][_0x7979('0x8c')](_0x7979('0x8d'))]})[_0x7979('0x17')](function(_0x511874){var _0xacefe4=0x1;var _0x249334=_[_0x7979('0x69')](_0x511874,function(_0xf4f04b){_0xf4f04b['CmHopperId']=_0xa5427d;_0xf4f04b[_0x7979('0x72')]=_0xf4f04b['item'];_0xf4f04b['OrderBy']=_0xacefe4;delete _0xf4f04b[_0x7979('0x8e')];_0xacefe4=_0xacefe4+0x1;return _0xf4f04b;});return db['CmHopperAdditionalPhone'][_0x7979('0x55')](_0x249334,{});})[_0x7979('0x17')](function(){_0x841fcb(0x1);});});}function insertAdditionalPhones(_0x62a14d,_0x4f8439){return new Promise(function(_0x523d8){var _0x3ae23a=[];for(var _0x113d11=0x0;_0x113d11<_0x4f8439[_0x7979('0x29')];_0x113d11++){var _0x413946=_0x4f8439[_0x113d11];_0x3ae23a['push'](parseContactItemType(_0x413946));}Promise[_0x7979('0x5f')](_0x3ae23a)[_0x7979('0x17')](function(){var _0x17a276={'id':_0x62a14d['id'],'items':_0x4f8439};return addAdditionalPhones(_0x17a276)[_0x7979('0x17')](function(){return addCmHopperPhones(_0x62a14d['id']);});})['then'](function(){_0x523d8(_0x62a14d);});});}function parseContactItemType(_0x54b133){return new Promise(function(_0x2d91d7){if(_0x54b133[_0x7979('0x5d')](_0x7979('0x87'))){_0x2d91d7(_0x54b133);}else{return db[_0x7979('0x63')][_0x7979('0x24')]({'where':{'name':_0x54b133[_0x7979('0x64')]}})['then'](function(_0x1233f6){if(_['isNil'](_0x1233f6))_0x54b133[_0x7979('0x87')]=null;else _0x54b133[_0x7979('0x87')]=_0x1233f6['id'];_0x2d91d7(_0x54b133);});}});}exports['getAdditionalPhones']=function(_0x9320f5,_0x30c550){return db['CmContactHasItem']['findAll']({'raw':!![],'where':{'CmContactId':_0x9320f5[_0x7979('0x25')]['id'],'ItemClass':_0x7979('0x8b')},'include':[{'model':db[_0x7979('0x63')],'as':_0x7979('0x64')}],'order':[[_0x7979('0x84')],[db['sequelize']['literal']('`ItemType`.OrderBy')]]})['then'](function(_0x4da11e){return _0x4da11e;})['then'](respondWithResult(_0x30c550,null))[_0x7979('0x26')](handleError(_0x30c550,null));};exports['duplicateAdditionalPhones']=function(_0x20c293,_0x2d76ce){return db[_0x7979('0x49')][_0x7979('0x20')]({'raw':!![],'where':{'CmContactId':_0x20c293[_0x7979('0x37')][_0x7979('0x8f')]}})[_0x7979('0x17')](function(_0x3bf676){var _0x54a234=_[_0x7979('0x69')](_0x3bf676,function(_0x2fe721){_0x2fe721['CmContactId']=_0x20c293[_0x7979('0x37')][_0x7979('0x90')];return _0x2fe721;});return db[_0x7979('0x49')][_0x7979('0x55')](_0x54a234,{});})[_0x7979('0x17')](function(){return addCmHopperPhones(_0x20c293[_0x7979('0x37')]['toContactId']);})[_0x7979('0x17')](function(){return['ok'];})[_0x7979('0x17')](respondWithResult(_0x2d76ce,null))[_0x7979('0x26')](handleError(_0x2d76ce,null));};exports[_0x7979('0x91')]=function(_0x3f66d9,_0x70058e){var _0x622c6e=[];_0x622c6e[_0x7979('0x5a')](createCmHopperPhone(_0x3f66d9['body']['id'],_0x3f66d9['body'][_0x7979('0x92')]));Promise[_0x7979('0x5f')](_0x622c6e)[_0x7979('0x17')](function(){return[0x1];})['then'](respondWithResult(_0x70058e,null));};exports[_0x7979('0x93')]=function(_0xb64850,_0x299a3c){var _0x4855ee={'raw':![],'where':{}};var _0x550ce7={};var _0x5b7ee0={'count':0x0,'rows':[]};return db[_0x7979('0x23')][_0x7979('0x94')]({'where':{'id':_0xb64850[_0x7979('0x25')]['id']}})[_0x7979('0x17')](handleEntityNotFound(_0x299a3c,null))[_0x7979('0x17')](function(_0x2d7dac){if(_0x2d7dac){_0x550ce7[_0x7979('0x74')]=_[_0x7979('0x28')](db[_0x7979('0x3d')][_0x7979('0x76')]);_0x550ce7[_0x7979('0x21')]=_[_0x7979('0x28')](_0xb64850[_0x7979('0x21')]);_0x550ce7[_0x7979('0x77')]=_[_0x7979('0x78')](_0x550ce7[_0x7979('0x74')],_0x550ce7[_0x7979('0x21')]);_0x4855ee[_0x7979('0x79')]=_[_0x7979('0x78')](_0x550ce7[_0x7979('0x74')],qs[_0x7979('0x7a')](_0xb64850[_0x7979('0x21')][_0x7979('0x7a')]));_0x4855ee[_0x7979('0x79')]=_0x4855ee[_0x7979('0x79')]['length']?_0x4855ee[_0x7979('0x79')]:_0x550ce7[_0x7979('0x74')];if(!_0xb64850['query'][_0x7979('0x5d')]('nolimit')){_0x4855ee[_0x7979('0x13')]=qs[_0x7979('0x13')](_0xb64850[_0x7979('0x21')]['limit']);_0x4855ee[_0x7979('0x12')]=qs[_0x7979('0x12')](_0xb64850[_0x7979('0x21')][_0x7979('0x12')]);}_0x4855ee[_0x7979('0x7b')]=qs[_0x7979('0x7c')](_0xb64850[_0x7979('0x21')][_0x7979('0x7c')]);_0x4855ee[_0x7979('0x58')]=qs[_0x7979('0x77')](_[_0x7979('0x7d')](_0xb64850[_0x7979('0x21')],_0x550ce7[_0x7979('0x77')]));_0x4855ee['where'][_0x7979('0x95')]=_0x2d7dac['id'];if(_0xb64850['query'][_0x7979('0x7e')]){_0x4855ee[_0x7979('0x58')]=_[_0x7979('0x36')](_0x4855ee[_0x7979('0x58')],{'$or':_[_0x7979('0x69')](_0x4855ee[_0x7979('0x79')],function(_0x5af2f6){var _0x36f955={};_0x36f955[_0x5af2f6]={'$like':'%'+_0xb64850[_0x7979('0x21')][_0x7979('0x7e')]+'%'};return _0x36f955;})});}_0x4855ee=_[_0x7979('0x36')]({},_0x4855ee,_0xb64850[_0x7979('0x7f')]);return db['CmHopper'][_0x7979('0x11')]({'where':_0x4855ee[_0x7979('0x58')]})[_0x7979('0x17')](function(_0x4be6b4){_0x5b7ee0[_0x7979('0x11')]=_0x4be6b4;if(_0xb64850[_0x7979('0x21')][_0x7979('0x96')]){_0x4855ee[_0x7979('0x97')]=[{'all':!![]}];}return db['CmHopper'][_0x7979('0x20')](_0x4855ee);})[_0x7979('0x17')](function(_0x32c989){_0x5b7ee0[_0x7979('0x98')]=_0x32c989;return _0x5b7ee0;});}})[_0x7979('0x17')](respondWithFilteredResult(_0x299a3c,_0x4855ee))['catch'](handleError(_0x299a3c,null));};exports['getHopperHistories']=function(_0x4c664f,_0x37239c){var _0x5da429={'raw':!![],'where':{}};var _0x34b41e={};var _0x767827={'count':0x0,'rows':[]};return db['CmContact'][_0x7979('0x94')]({'where':{'id':_0x4c664f[_0x7979('0x25')]['id']}})[_0x7979('0x17')](handleEntityNotFound(_0x37239c,null))[_0x7979('0x17')](function(_0x3e3351){if(_0x3e3351){_0x34b41e[_0x7979('0x74')]=_['keys'](db[_0x7979('0x4a')][_0x7979('0x76')]);_0x34b41e[_0x7979('0x21')]=_[_0x7979('0x28')](_0x4c664f[_0x7979('0x21')]);_0x34b41e[_0x7979('0x77')]=_[_0x7979('0x78')](_0x34b41e[_0x7979('0x74')],_0x34b41e[_0x7979('0x21')]);_0x5da429[_0x7979('0x79')]=_[_0x7979('0x78')](_0x34b41e[_0x7979('0x74')],qs[_0x7979('0x7a')](_0x4c664f['query'][_0x7979('0x7a')]));_0x5da429[_0x7979('0x79')]=_0x5da429[_0x7979('0x79')][_0x7979('0x29')]?_0x5da429[_0x7979('0x79')]:_0x34b41e[_0x7979('0x74')];if(!_0x4c664f[_0x7979('0x21')]['hasOwnProperty'](_0x7979('0x80'))){_0x5da429[_0x7979('0x13')]=qs[_0x7979('0x13')](_0x4c664f[_0x7979('0x21')][_0x7979('0x13')]);_0x5da429['offset']=qs[_0x7979('0x12')](_0x4c664f[_0x7979('0x21')]['offset']);}_0x5da429['order']=qs[_0x7979('0x7c')](_0x4c664f[_0x7979('0x21')][_0x7979('0x7c')]);_0x5da429[_0x7979('0x58')]=qs['filters'](_[_0x7979('0x7d')](_0x4c664f[_0x7979('0x21')],_0x34b41e[_0x7979('0x77')]));_0x5da429[_0x7979('0x58')][_0x7979('0x95')]=_0x3e3351['id'];if(_0x4c664f['query'][_0x7979('0x7e')]){_0x5da429['where']=_[_0x7979('0x36')](_0x5da429[_0x7979('0x58')],{'$or':_[_0x7979('0x69')](_0x5da429[_0x7979('0x79')],function(_0x22fdc8){var _0x3a49f4={};_0x3a49f4[_0x22fdc8]={'$like':'%'+_0x4c664f['query'][_0x7979('0x7e')]+'%'};return _0x3a49f4;})});}_0x5da429=_['merge']({},_0x5da429,_0x4c664f[_0x7979('0x7f')]);return db['CmHopperHistory']['count']({'where':_0x5da429[_0x7979('0x58')]})['then'](function(_0x4d29c3){_0x767827[_0x7979('0x11')]=_0x4d29c3;if(_0x4c664f[_0x7979('0x21')]['includeAll']){_0x5da429[_0x7979('0x97')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x7979('0x20')](_0x5da429);})[_0x7979('0x17')](function(_0x2d2e9e){_0x767827[_0x7979('0x98')]=_0x2d2e9e;return _0x767827;});}})[_0x7979('0x17')](respondWithFilteredResult(_0x37239c,_0x5da429))[_0x7979('0x26')](handleError(_0x37239c,null));};exports[_0x7979('0x99')]=function(_0x24c6e4,_0x4f52f4){var _0x24fa4c={'raw':!![],'where':{}};var _0x7da9e1={};var _0x5ee79a={'count':0x0,'rows':[]};return db[_0x7979('0x23')][_0x7979('0x94')]({'where':{'id':_0x24c6e4[_0x7979('0x25')]['id']}})['then'](handleEntityNotFound(_0x4f52f4,null))[_0x7979('0x17')](function(_0x15faca){if(_0x15faca){_0x7da9e1[_0x7979('0x74')]=_[_0x7979('0x28')](db['CmHopperFinal']['rawAttributes']);_0x7da9e1[_0x7979('0x21')]=_[_0x7979('0x28')](_0x24c6e4[_0x7979('0x21')]);_0x7da9e1[_0x7979('0x77')]=_[_0x7979('0x78')](_0x7da9e1['model'],_0x7da9e1[_0x7979('0x21')]);_0x24fa4c[_0x7979('0x79')]=_[_0x7979('0x78')](_0x7da9e1[_0x7979('0x74')],qs['fields'](_0x24c6e4[_0x7979('0x21')]['fields']));_0x24fa4c[_0x7979('0x79')]=_0x24fa4c['attributes'][_0x7979('0x29')]?_0x24fa4c['attributes']:_0x7da9e1[_0x7979('0x74')];if(!_0x24c6e4[_0x7979('0x21')][_0x7979('0x5d')](_0x7979('0x80'))){_0x24fa4c[_0x7979('0x13')]=qs[_0x7979('0x13')](_0x24c6e4[_0x7979('0x21')][_0x7979('0x13')]);_0x24fa4c[_0x7979('0x12')]=qs[_0x7979('0x12')](_0x24c6e4[_0x7979('0x21')][_0x7979('0x12')]);}_0x24fa4c[_0x7979('0x7b')]=qs[_0x7979('0x7c')](_0x24c6e4[_0x7979('0x21')][_0x7979('0x7c')]);_0x24fa4c[_0x7979('0x58')]=qs[_0x7979('0x77')](_[_0x7979('0x7d')](_0x24c6e4[_0x7979('0x21')],_0x7da9e1[_0x7979('0x77')]));_0x24fa4c['where']['ContactId']=_0x15faca['id'];if(_0x24c6e4[_0x7979('0x21')]['filter']){_0x24fa4c[_0x7979('0x58')]=_[_0x7979('0x36')](_0x24fa4c[_0x7979('0x58')],{'$or':_[_0x7979('0x69')](_0x24fa4c['attributes'],function(_0x3558a5){var _0x4b04fc={};_0x4b04fc[_0x3558a5]={'$like':'%'+_0x24c6e4[_0x7979('0x21')][_0x7979('0x7e')]+'%'};return _0x4b04fc;})});}_0x24fa4c=_[_0x7979('0x36')]({},_0x24fa4c,_0x24c6e4[_0x7979('0x7f')]);return db[_0x7979('0x9a')][_0x7979('0x11')]({'where':_0x24fa4c['where']})[_0x7979('0x17')](function(_0x4d0ac7){_0x5ee79a[_0x7979('0x11')]=_0x4d0ac7;if(_0x24c6e4[_0x7979('0x21')][_0x7979('0x96')]){_0x24fa4c['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x7979('0x20')](_0x24fa4c);})[_0x7979('0x17')](function(_0x303c1f){_0x5ee79a[_0x7979('0x98')]=_0x303c1f;return _0x5ee79a;});}})[_0x7979('0x17')](respondWithFilteredResult(_0x4f52f4,_0x24fa4c))[_0x7979('0x26')](handleError(_0x4f52f4,null));};exports[_0x7979('0x9b')]=function(_0x18bde3,_0x5e9277){var _0x418935={'raw':!![],'where':{}};var _0x489a17={};var _0x128e19={'count':0x0,'rows':[]};return db[_0x7979('0x23')]['findOne']({'where':{'id':_0x18bde3[_0x7979('0x25')]['id']}})[_0x7979('0x17')](handleEntityNotFound(_0x5e9277,null))[_0x7979('0x17')](function(_0x1733d0){if(_0x1733d0){_0x489a17[_0x7979('0x74')]=_[_0x7979('0x28')](db['JscriptySessionReport'][_0x7979('0x76')]);_0x489a17[_0x7979('0x21')]=_[_0x7979('0x28')](_0x18bde3[_0x7979('0x21')]);_0x489a17[_0x7979('0x77')]=_[_0x7979('0x78')](_0x489a17['model'],_0x489a17[_0x7979('0x21')]);_0x418935['attributes']=_['intersection'](_0x489a17[_0x7979('0x74')],qs[_0x7979('0x7a')](_0x18bde3[_0x7979('0x21')][_0x7979('0x7a')]));_0x418935[_0x7979('0x79')]=_0x418935[_0x7979('0x79')]['length']?_0x418935[_0x7979('0x79')]:_0x489a17[_0x7979('0x74')];if(!_0x18bde3[_0x7979('0x21')][_0x7979('0x5d')](_0x7979('0x80'))){_0x418935[_0x7979('0x13')]=qs[_0x7979('0x13')](_0x18bde3[_0x7979('0x21')][_0x7979('0x13')]);_0x418935[_0x7979('0x12')]=qs[_0x7979('0x12')](_0x18bde3[_0x7979('0x21')][_0x7979('0x12')]);}_0x418935[_0x7979('0x7b')]=qs['sort'](_0x18bde3[_0x7979('0x21')][_0x7979('0x7c')]);_0x418935[_0x7979('0x58')]=qs[_0x7979('0x77')](_[_0x7979('0x7d')](_0x18bde3[_0x7979('0x21')],_0x489a17[_0x7979('0x77')]));_0x418935[_0x7979('0x58')][_0x7979('0x95')]=_0x1733d0['id'];if(_0x18bde3[_0x7979('0x21')][_0x7979('0x7e')]){_0x418935[_0x7979('0x58')]=_['merge'](_0x418935[_0x7979('0x58')],{'$or':_[_0x7979('0x69')](_0x418935[_0x7979('0x79')],function(_0x4b612a){var _0x14bdfb={};_0x14bdfb[_0x4b612a]={'$like':'%'+_0x18bde3['query'][_0x7979('0x7e')]+'%'};return _0x14bdfb;})});}_0x418935=_[_0x7979('0x36')]({},_0x418935,_0x18bde3['options']);return db[_0x7979('0x9c')][_0x7979('0x11')]({'where':_0x418935['where']})[_0x7979('0x17')](function(_0x2f4292){_0x128e19[_0x7979('0x11')]=_0x2f4292;if(_0x18bde3[_0x7979('0x21')][_0x7979('0x96')]){_0x418935[_0x7979('0x97')]=[{'all':!![]}];}return db[_0x7979('0x9c')][_0x7979('0x20')](_0x418935);})['then'](function(_0x15553c){_0x128e19[_0x7979('0x98')]=_0x15553c;return _0x128e19;});}})[_0x7979('0x17')](respondWithFilteredResult(_0x5e9277,_0x418935))[_0x7979('0x26')](handleError(_0x5e9277,null));};exports[_0x7979('0x9d')]=function(_0x574d74,_0x456f50){try{if(!_0x574d74[_0x7979('0x37')][_0x7979('0x5b')]){throw new Error(_0x7979('0x9e'));}if(!_0x574d74[_0x7979('0x37')][_0x7979('0x9f')]){throw new Error(_0x7979('0xa0'));}if(!_0x574d74[_0x7979('0x37')][_0x7979('0xa1')]){throw new Error(_0x7979('0xa2'));}if(!_0x574d74[_0x7979('0x37')][_0x7979('0xa3')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x278c16=_0x574d74['body'][_0x7979('0x9f')][_0x7979('0xa4')](',');var _0x1449bb=_0x574d74['body'][_0x7979('0xa1')]['split'](',');if(!_0x278c16[_0x7979('0x29')]||!_0x1449bb[_0x7979('0x29')]||_0x278c16[_0x7979('0x29')]!==_0x1449bb['length']){throw new Error(_0x7979('0xa5'));}_0x574d74[_0x7979('0x37')]['fields']=_[_0x7979('0xa6')](_0x278c16,_0x1449bb);if(!_0x574d74['body'][_0x7979('0x7a')]['phone']){throw new Error(_0x7979('0xa7'));}if(!_0x574d74[_0x7979('0x37')]['fields'][_0x7979('0xa8')]){throw new Error(_0x7979('0xa9'));}var _0x4e8c59=path[_0x7979('0xaa')](config[_0x7979('0xab')],_0x7979('0xac'),_0x574d74[_0x7979('0xad')][_0x7979('0xae')]);fs['chmodSync'](_0x4e8c59,parseInt('0777',0x8));var _0x3a58e6=require('child_process')[_0x7979('0xaf')](path[_0x7979('0xaa')](__dirname,_0x7979('0xb0')),[_0x4e8c59,_0x574d74[_0x7979('0x37')]['binding_keys'],_0x574d74[_0x7979('0x37')][_0x7979('0xa1')],_0x574d74[_0x7979('0x37')][_0x7979('0x5b')],_0x574d74['body'][_0x7979('0xb1')],_0x574d74[_0x7979('0x37')][_0x7979('0x57')],_0x574d74[_0x7979('0x37')]['socket_timestamp']]);return _0x456f50[_0x7979('0xf')](0xc8)[_0x7979('0x15')]({'message':_0x7979('0xb2'),'pid':_0x3a58e6[_0x7979('0xb3')]});}catch(_0x1e72d0){return _0x456f50['status'](0x1f4)['send'](_0x1e72d0);}};exports[_0x7979('0xb4')]=function(_0x2f4d00,_0xad7b8e){var _0xc73f06=fs['createReadStream'](_0x2f4d00['file'][_0x7979('0x1')]);Papa['parse'](_0xc73f06,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x1da280){return _0xad7b8e[_0x7979('0xf')](0xc8)[_0x7979('0x15')]({'file':_0x2f4d00[_0x7979('0xad')],'fields':_0x1da280[_0x7979('0xb5')][_0x7979('0x7a')]});}});};exports['import']=function(_0x5fe1d3,_0x112270){return db[_0x7979('0xb6')][_0x7979('0x20')]({'raw':!![],'attributes':['id'],'where':{'role':_0x7979('0xb7')}})[_0x7979('0x17')](function(_0x5880cf){var _0x38d420=![];if(!_0x5fe1d3[_0x7979('0x37')][_0x7979('0x5b')]){throw new Error(_0x7979('0x9e'));}if(!_0x5fe1d3['body'][_0x7979('0xb8')][_0x7979('0x72')]){throw new Error(_0x7979('0xa7'));}if(!_0x5fe1d3[_0x7979('0x37')][_0x7979('0xb8')]['firstName']){throw new Error(_0x7979('0xa9'));}if(!_0x5fe1d3[_0x7979('0x37')][_0x7979('0xa3')]){throw new Error(_0x7979('0xb9'));}var _0x1e52d8=require(_0x7979('0xba'))[_0x7979('0xaf')](path[_0x7979('0xaa')](__dirname,_0x7979('0xbb')),[_0x5fe1d3[_0x7979('0x25')]['id'],JSON[_0x7979('0xbc')](_0x5fe1d3[_0x7979('0x37')]),JSON[_0x7979('0xbc')](_0x5880cf)]);_0x1e52d8['on'](_0x7979('0xbd'),function(){_0x38d420=!![];return _0x112270['status'](0xc8)[_0x7979('0x15')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x1e52d8['pid']});});_0x1e52d8['on'](_0x7979('0xbe'),function(_0x41d985){if(_0x41d985&&!_0x38d420){return _0x112270[_0x7979('0xf')](0x1f4)[_0x7979('0x15')]({'message':_0x7979('0xbf'),'pid':_0x1e52d8[_0x7979('0xb3')]});}});})[_0x7979('0x26')](handleError(_0x112270,null));};exports['importUpdates']=function(_0x47a120,_0x21a5b4){return db[_0x7979('0xb6')][_0x7979('0x20')]({'raw':!![],'attributes':['id'],'where':{'role':_0x7979('0xb7')}})[_0x7979('0x17')](function(_0x2eb792){var _0x178af6=![];if(!_0x47a120[_0x7979('0x37')][_0x7979('0x5b')]){throw new Error(_0x7979('0x9e'));}if(!_0x47a120['body']['binding']['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x47a120[_0x7979('0x37')][_0x7979('0xb8')]['firstName']){throw new Error(_0x7979('0xa9'));}if(!_0x47a120[_0x7979('0x37')]['socket_timestamp']){throw new Error(_0x7979('0xb9'));}var _0x814710=require(_0x7979('0xba'))['fork'](path[_0x7979('0xaa')](__dirname,_0x7979('0xc0')),[_0x47a120['params']['id'],JSON[_0x7979('0xbc')](_0x47a120[_0x7979('0x37')]),JSON['stringify'](_0x2eb792)]);_0x814710['on'](_0x7979('0xbd'),function(){_0x178af6=!![];return _0x21a5b4[_0x7979('0xf')](0xc8)[_0x7979('0x15')]({'message':_0x7979('0xc1'),'pid':_0x814710[_0x7979('0xb3')]});});_0x814710['on'](_0x7979('0xbe'),function(_0x167083){if(_0x167083&&!_0x178af6){return _0x21a5b4['status'](0x1f4)[_0x7979('0x15')]({'message':_0x7979('0xbf'),'pid':_0x814710[_0x7979('0xb3')]});}});})[_0x7979('0x26')](handleError(_0x21a5b4,null));};exports[_0x7979('0xc2')]=function(_0x4dd373,_0x5269f6){var _0x4868a5=[_0x7979('0xc3'),_0x7979('0xc4'),_0x7979('0xc5'),_0x7979('0xc6'),'fax','whatsapp','voice'];var _0xb20d7b={'offset':0x0,'order':qs['sort'](_0x7979('0xc7'))},_0x2a8b9a={'count':0x0,'rows':[]};Promise[_0x7979('0xc8')]()[_0x7979('0x17')](function(){if(_0x4dd373[_0x7979('0x21')][_0x7979('0xc9')]){if(!_[_0x7979('0xca')](_0x4868a5,_0x4dd373[_0x7979('0x21')][_0x7979('0xc9')][_0x7979('0xcb')]())){throw new Error(_0x7979('0xcc'));}_0x4868a5=[_0x4dd373[_0x7979('0x21')][_0x7979('0xc9')]['toLowerCase']()];}if(_0x4dd373[_0x7979('0x21')][_0x7979('0xcd')]){try{var _0x1687c0=JSON[_0x7979('0xce')](_0x4dd373[_0x7979('0x21')][_0x7979('0xcd')]);if(!moment(_0x1687c0['from'])[_0x7979('0xcf')]()){throw new Error(_0x7979('0xd0'));}if(!moment(_0x1687c0['to'])[_0x7979('0xcf')]()){throw new Error(_0x7979('0xd1'));}}catch(_0x9e9fa8){throw new Error(_0x7979('0xd2'));}}if(!_0x4dd373[_0x7979('0x21')][_0x7979('0x5d')](_0x7979('0x80'))){_0xb20d7b[_0x7979('0x13')]=qs[_0x7979('0x13')](_0x4dd373['query']['limit']||0xa);_0xb20d7b[_0x7979('0x12')]=qs[_0x7979('0x12')](_0x4dd373[_0x7979('0x21')]['offset']);}var _0x1809cb=_0x4868a5['map'](function(_0xea4c88){if(_0xea4c88===_0x7979('0xd3')){var _0x4d6685={'attributes':['id',_0x7979('0xd4'),'type','source',_0x7979('0xd5'),_0x7979('0xd6'),_0x7979('0xd7'),'endtime',_0x7979('0xd8'),'note',_0x7979('0xd9'),_0x7979('0xda'),'userSecondDisposition','userThirdDisposition',_0x7979('0xdb')],'where':{'ContactId':_0x4dd373[_0x7979('0x25')]['id']},'include':[{'model':db[_0x7979('0xb6')],'as':_0x7979('0xb6'),'attributes':['id',_0x7979('0x1d'),_0x7979('0xdc'),_0x7979('0x30')]}],'order':[[_0x7979('0xd9'),_0x7979('0xdd')]]};if(_0x4dd373[_0x7979('0x21')]['range']){_0x4d6685[_0x7979('0x58')][_0x7979('0xd9')]={'$gte':_0x1687c0[_0x7979('0x38')],'$lte':_0x1687c0['to']};}return db[_0x7979('0x4c')]['findAndCountAll'](_0x4d6685)[_0x7979('0x17')](function(_0x285fd3){_0x2a8b9a[_0x7979('0x11')]+=_0x285fd3[_0x7979('0x11')];return _[_0x7979('0x69')](_0x285fd3[_0x7979('0x98')],function(_0x48a7ad){var _0xcd9c62=_0x48a7ad[_0x7979('0x39')]({'plain':!![]});_0xcd9c62[_0x7979('0xc9')]=_0xea4c88;if(_0xcd9c62[_0x7979('0xb6')]){_0xcd9c62[_0x7979('0xb6')]={'id':_0xcd9c62['User']['id'],'name':_0xcd9c62[_0x7979('0xb6')][_0x7979('0x1d')],'fullname':_0xcd9c62[_0x7979('0xb6')][_0x7979('0xdc')],'alias':_0xcd9c62['User'][_0x7979('0x30')]};}return _0xcd9c62;});});}else{var _0x26b5c8=_[_0x7979('0xde')](_0xea4c88)+(_0xea4c88===_0x7979('0xc4')?_0x7979('0xdf'):_0x7979('0xe0'));var _0x1b6912={'attributes':['id',_0x7979('0xe1'),_0x7979('0xe2'),_0x7979('0xd9'),'note','disposition','secondDisposition',_0x7979('0xe3'),_0x7979('0xdb'),_0x26b5c8+'Id'],'where':{'ContactId':_0x4dd373[_0x7979('0x25')]['id']},'include':[{'model':db[_0x26b5c8],'as':'Account','attributes':['id',_0x7979('0x1d'),_0x7979('0xe4')]},{'model':db[_0x7979('0xb6')],'as':_0x7979('0xe5'),'attributes':['id',_0x7979('0x1d'),_0x7979('0xdc')]},{'model':db[_0x7979('0x75')],'as':_0x7979('0xe6'),'attributes':['id','name','color'],'through':{'attributes':[]}}],'order':[[_0x7979('0xd9'),_0x7979('0xdd')]]};if(_0x4dd373['query'][_0x7979('0xcd')]){_0x1b6912[_0x7979('0x58')]['createdAt']={'$gte':_0x1687c0[_0x7979('0x38')],'$lte':_0x1687c0['to']};}switch(_0xea4c88){case _0x7979('0xc4'):_0x1b6912[_0x7979('0x79')]['push'](_0x7979('0xe7'),_0x7979('0xe8'),_0x7979('0xe9'),_0x7979('0xea'),_0x7979('0xeb'),'ratingMessage',_0x7979('0xec'),_0x7979('0xed'),_0x7979('0xee'));break;case _0x7979('0xc3'):_0x1b6912[_0x7979('0x79')][_0x7979('0x5a')]('subject',_0x7979('0xef'));break;case _0x7979('0xc6'):_0x1b6912[_0x7979('0x79')][_0x7979('0x5a')](_0x7979('0xf0'),_0x7979('0xf1'));break;}return db[_[_0x7979('0xde')](_0xea4c88)+_0x7979('0xf2')]['findAndCountAll'](_0x1b6912)['then'](function(_0x753a4c){_0x2a8b9a[_0x7979('0x11')]+=_0x753a4c[_0x7979('0x11')];return _[_0x7979('0x69')](_0x753a4c['rows'],function(_0x3bea3f){var _0x51f391=_0x3bea3f[_0x7979('0x39')]({'plain':!![]});_0x51f391[_0x7979('0xc9')]=_0xea4c88;if(_0x51f391['Owner']){_0x51f391[_0x7979('0xe5')]={'id':_0x51f391[_0x7979('0xe5')]['id'],'name':_0x51f391['Owner']['name'],'fullname':_0x51f391['Owner'][_0x7979('0xdc')]};}return _0x51f391;});});}});return Promise[_0x7979('0x5f')](_0x1809cb);})[_0x7979('0x17')](function(_0x11dee6){return _(_0x11dee6)[_0x7979('0xf3')]()[_0x7979('0xf4')](_0x7979('0xd9'))[_0x7979('0xf5')]()['value']();})['then'](function(_0x5704dc){_0x2a8b9a[_0x7979('0x98')]=_0xb20d7b[_0x7979('0x13')]?_0x5704dc['slice'](_0xb20d7b[_0x7979('0x12')],_0xb20d7b[_0x7979('0x12')]+_0xb20d7b[_0x7979('0x13')]):_0x5704dc;return _0x2a8b9a;})[_0x7979('0x17')](respondWithFilteredResult(_0x5269f6,_0xb20d7b))[_0x7979('0x26')](handleError(_0x5269f6,null));}; \ No newline at end of file +var _0xeadc=['query','user','find','catch','CmContact','tags','keys','length','cf_','displayName','analytics','CmCustomField','findAll','columnName','alias','custom','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','get','mergeWith','isArray','join','from','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','each','duplicates','$or','ListId','hasOwnProperty','push','show','params','Tag','Tags','color','tag','Phones','ItemType','sequelize','literal','Phones.OrderBy','where','omit','map','format','cf_%d','$and','pickBy','startsWith','isEmpty','table','cm_contacts','setFields','toParam','text','phone','CmHopper','getTags','findOne','rawAttributes','filters','intersection','model','fields','attributes','order','sort','pick','filter','nolimit','setTags','setAdditionalPhones','all','ContactItemType','OrderBy','item_types','items','ItemTypeId','CmHopperAdditionalPhone','PHONE','`ItemType`.OrderBy','CmHopperId','item','ItemType.OrderBy','bulkCreate','getAdditionalPhones','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','ContactId','options','include','rows','getHopperHistories','includeAll','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','import','User','agent','binding','../../components/import/cm/csv2','stringify','message','exit','importUpdates','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','mail','sms','openchannel','fax','whatsapp','-createdAt','resolve','channel','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','type','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','VoiceCallReport','findAndCountAll','chat','Website','Account','closed','closedAt','disposition','thirdDisposition','key','browserName','customerIp','deviceModel','osName','ratingMessage','ratingType','subject','substatus','externalUrl','threadId','startCase','Interaction','Owner','flatten','value','slice','moment','bluebird','util','path','lodash','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','offset','limit','undefined','count','Content-Range','update','then','destroy','end','error','stack','name','send','describe'];(function(_0x2fae15,_0x23322c){var _0x30bfb8=function(_0x451e0e){while(--_0x451e0e){_0x2fae15['push'](_0x2fae15['shift']());}};_0x30bfb8(++_0x23322c);}(_0xeadc,0x1e6));var _0xcead=function(_0xa706e0,_0x2021d2){_0xa706e0=_0xa706e0-0x0;var _0x2e7580=_0xeadc[_0xa706e0];return _0x2e7580;};'use strict';var moment=require(_0xcead('0x0'));var BPromise=require(_0xcead('0x1'));var util=require(_0xcead('0x2'));var path=require(_0xcead('0x3'));var fs=require('fs');var _=require(_0xcead('0x4'));var squel=require('squel');var Papa=require(_0xcead('0x5'));var Redis=require(_0xcead('0x6'));var contacts=require(_0xcead('0x7'));var qs=require(_0xcead('0x8'));var logger=require('../../config/logger')(_0xcead('0x9'));var config=require(_0xcead('0xa'));var shared=require(_0xcead('0xb'));var db=require(_0xcead('0xc'))['db'];config[_0xcead('0xd')]=_[_0xcead('0xe')](config[_0xcead('0xd')],{'host':_0xcead('0xf'),'port':0x18eb});var socket=require(_0xcead('0x10'))(new Redis(config[_0xcead('0xd')]));require('./cmContact.socket')[_0xcead('0x11')](socket);function respondWithResult(_0x448b28,_0x468b78){_0x468b78=_0x468b78||0xc8;return function(_0xea5c48){if(_0xea5c48){return _0x448b28[_0xcead('0x12')](_0x468b78)[_0xcead('0x13')](_0xea5c48);}};}function respondWithFilteredResult(_0x11c444,_0x5643dc){return function(_0x444e54){if(_0x444e54){var _0x4eb2c8=typeof _0x5643dc[_0xcead('0x14')]==='undefined'&&typeof _0x5643dc[_0xcead('0x15')]===_0xcead('0x16');var _0xe99980=_0x444e54['count'];var _0x1a45a7=_0x4eb2c8?0x0:_0x5643dc[_0xcead('0x14')];var _0x1a6088=_0x4eb2c8?_0x444e54[_0xcead('0x17')]:_0x5643dc[_0xcead('0x14')]+_0x5643dc[_0xcead('0x15')];var _0x31a522;if(_0x1a6088>=_0xe99980){_0x1a6088=_0xe99980;_0x31a522=0xc8;}else{_0x31a522=0xce;}_0x11c444[_0xcead('0x12')](_0x31a522);return _0x11c444['set'](_0xcead('0x18'),_0x1a45a7+'-'+_0x1a6088+'/'+_0xe99980)[_0xcead('0x13')](_0x444e54);}return null;};}function saveUpdates(_0x50aee3){return function(_0x2ae0db){if(_0x2ae0db){return _0x2ae0db[_0xcead('0x19')](_0x50aee3)[_0xcead('0x1a')](function(_0x11bd8b){return _0x11bd8b;});}return null;};}function removeEntity(_0x21fb37){return function(_0x234cb2){if(_0x234cb2){return _0x234cb2[_0xcead('0x1b')]()[_0xcead('0x1a')](function(){_0x21fb37['status'](0xcc)[_0xcead('0x1c')]();});}};}function handleEntityNotFound(_0x5f50af){return function(_0x8c2841){if(!_0x8c2841){_0x5f50af['sendStatus'](0x194);}return _0x8c2841;};}function handleError(_0x57cdd3,_0x283825){_0x283825=_0x283825||0x1f4;return function(_0x3a6ae4){logger[_0xcead('0x1d')](_0x3a6ae4[_0xcead('0x1e')]);if(_0x3a6ae4[_0xcead('0x1f')]){delete _0x3a6ae4[_0xcead('0x1f')];}_0x57cdd3[_0xcead('0x12')](_0x283825)[_0xcead('0x20')](_0x3a6ae4);};}exports['index']=function(_0x2e573c,_0x20e782){var _0x279b66={};return contacts[_0xcead('0x21')]()[_0xcead('0x1a')](function(_0x535085){_0x279b66=qs['getOptions'](_0x535085,_0x2e573c);return contacts['findAll'](_0x2e573c[_0xcead('0x22')],_0x2e573c[_0xcead('0x23')],_0x279b66,_0x535085);})[_0xcead('0x1a')](respondWithFilteredResult(_0x20e782,_0x279b66))['catch'](handleError(_0x20e782,null));};exports[_0xcead('0x1b')]=function(_0x5853e9,_0x2cea52){return db['CmContact'][_0xcead('0x24')]({'where':{'id':_0x5853e9['params']['id']}})[_0xcead('0x1a')](handleEntityNotFound(_0x2cea52,null))[_0xcead('0x1a')](removeEntity(_0x2cea52,null))[_0xcead('0x25')](handleError(_0x2cea52,null));};exports[_0xcead('0x21')]=function(_0x593d87,_0x1768a0){return db[_0xcead('0x26')]['describe']()[_0xcead('0x1a')](function(_0x19a802){delete _0x19a802[_0xcead('0x27')];for(var _0x48a30c=0x0;_0x48a30c0x0){return new Promise(function(_0x3b5128){var _0x8d6556=[];for(var _0x1bd7a0=0x0;_0x1bd7a0<_0x550470[_0xcead('0x29')];_0x1bd7a0++){_0x8d6556['push'](insertAdditionalPhones(_0x550470[_0x1bd7a0]['contact'],_0x550470[_0x1bd7a0][_0xcead('0x57')]));}Promise['all'](_0x8d6556)[_0xcead('0x1a')](function(){_0x3b5128(0x1);});})[_0xcead('0x1a')](function(){return{'success':_0x3ac961,'failure':_0x4518ee,'duplicates':_0x6707de};});}else{return{'success':_0x3ac961,'failure':_0x4518ee,'duplicates':_0x6707de};}}})[_0xcead('0x1a')](respondWithResult(_0x232df,0xc9))['catch'](handleError(_0x232df,null));};exports[_0xcead('0x5e')]=function(_0x527e81,_0x4144a5){var _0x2811ee;return db['CmContact'][_0xcead('0x21')]()[_0xcead('0x1a')](function(_0x514e78){return db[_0xcead('0x26')]['find']({'where':{'id':_0x527e81[_0xcead('0x5f')]['id']},'include':[{'model':db[_0xcead('0x60')],'as':_0xcead('0x61'),'attributes':['id',_0xcead('0x1f'),_0xcead('0x62')],'required':_0x527e81[_0xcead('0x22')][_0xcead('0x63')]?!![]:![]},{'model':db[_0xcead('0x49')],'as':_0xcead('0x64'),'where':{'CmContactId':_0x527e81[_0xcead('0x5f')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0xcead('0x65')}]}],'order':[db[_0xcead('0x66')][_0xcead('0x67')](_0xcead('0x68'))],'attributes':_[_0xcead('0x28')](_0x514e78)});})['then'](function(_0x5afb95){if(!_[_0xcead('0x53')](_0x5afb95)){_0x2811ee=_0x5afb95[_0xcead('0x38')]({'plain':!![]});var _0x330655={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x5afb95&&_0x5afb95[_0xcead('0x5b')]){if(_0x5afb95[_0xcead('0x5b')]){_0x330655[_0xcead('0x69')]['$and'][_0xcead('0x5d')]({'ListId':{'$ne':_0x5afb95['ListId']}});}}return db[_0xcead('0x2d')][_0xcead('0x2e')](_0x330655);}})[_0xcead('0x1a')](function(_0x30642c){if(!_[_0xcead('0x53')](_0x30642c)){return _[_0xcead('0x6a')](_0x2811ee,_[_0xcead('0x6b')](_0x30642c,function(_0x52e0e4){return util[_0xcead('0x6c')](_0xcead('0x6d'),_0x52e0e4['id']);}));}})[_0xcead('0x1a')](handleEntityNotFound(_0x4144a5,null))[_0xcead('0x1a')](respondWithResult(_0x4144a5,null))['catch'](handleError(_0x4144a5,null));};exports[_0xcead('0x19')]=function(_0x3d3754,_0x170235){var _0x37608e;if(_0x3d3754[_0xcead('0x37')]['id']){delete _0x3d3754[_0xcead('0x37')]['id'];}if(!_[_0xcead('0x53')](_0x3d3754['body'][_0xcead('0x54')])){var _0x4811c7=_0x3d3754['body'][_0xcead('0x54')];if(!_[_0xcead('0x53')](shared[_0xcead('0x55')][_0x4811c7]))_0x3d3754[_0xcead('0x37')]['utcOffset']=shared[_0xcead('0x55')][_0x4811c7][_0xcead('0x56')];}return db['CmContact'][_0xcead('0x24')]({'where':{'id':_0x3d3754['params']['id']}})[_0xcead('0x1a')](handleEntityNotFound(_0x170235,null))[_0xcead('0x1a')](saveUpdates(_0x3d3754['body'],null))[_0xcead('0x1a')](function(_0x1527fd){_0x37608e=_0x1527fd;var _0x1c8fb8={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x1527fd&&_0x1527fd[_0xcead('0x5b')]){if(_0x1527fd[_0xcead('0x5b')]){_0x1c8fb8['where'][_0xcead('0x6e')][_0xcead('0x5d')]({'ListId':{'$ne':_0x1527fd[_0xcead('0x5b')]}});}}return db['CmCustomField'][_0xcead('0x2e')](_0x1c8fb8);})[_0xcead('0x1a')](function(_0x1e76bb){if(_0x1e76bb){return _['omit'](_[_0xcead('0x6f')](_0x3d3754['body'],function(_0x26fd12,_0x2b5471){return _[_0xcead('0x70')](_0x2b5471,_0xcead('0x2a'));}),_[_0xcead('0x6b')](_0x1e76bb,function(_0x3c02f1){return util['format'](_0xcead('0x6d'),_0x3c02f1['id']);}));}})[_0xcead('0x1a')](function(_0x4b6e65){if(_0x4b6e65&&!_[_0xcead('0x71')](_0x4b6e65)){var _0x5a90e8=squel['update']()[_0xcead('0x72')](_0xcead('0x73'))[_0xcead('0x74')](_0x4b6e65)[_0xcead('0x69')]('id\x20=\x20?',_0x3d3754[_0xcead('0x5f')]['id'])[_0xcead('0x75')]();return db[_0xcead('0x66')]['query'](_0x5a90e8[_0xcead('0x76')],{'replacements':_0x5a90e8[_0xcead('0x32')]});}})[_0xcead('0x1a')](function(){if(_0x3d3754[_0xcead('0x37')][_0xcead('0x77')]&&_0x37608e){return db[_0xcead('0x78')][_0xcead('0x19')]({'phone':_0x3d3754[_0xcead('0x37')][_0xcead('0x77')],'OrderBy':0x0},{'where':{'ContactId':_0x37608e['id']}});}})[_0xcead('0x1a')](function(){return _0x37608e;})[_0xcead('0x1a')](respondWithResult(_0x170235,null))['catch'](handleError(_0x170235,null));};exports[_0xcead('0x79')]=function(_0x7e80cd,_0x4770b6){var _0x32e7ce={};var _0x2e40e9={};var _0x2477cf;var _0x69eb53;return db['CmContact'][_0xcead('0x7a')]({'where':{'id':_0x7e80cd[_0xcead('0x5f')]['id']}})[_0xcead('0x1a')](handleEntityNotFound(_0x4770b6,null))[_0xcead('0x1a')](function(_0x20a022){if(_0x20a022){_0x2477cf=_0x20a022;_0x2e40e9['model']=_[_0xcead('0x28')](db['Tag'][_0xcead('0x7b')]);_0x2e40e9[_0xcead('0x22')]=_[_0xcead('0x28')](_0x7e80cd['query']);_0x2e40e9[_0xcead('0x7c')]=_[_0xcead('0x7d')](_0x2e40e9[_0xcead('0x7e')],_0x2e40e9[_0xcead('0x22')]);_0x32e7ce['attributes']=_[_0xcead('0x7d')](_0x2e40e9[_0xcead('0x7e')],qs['fields'](_0x7e80cd['query'][_0xcead('0x7f')]));_0x32e7ce[_0xcead('0x80')]=_0x32e7ce[_0xcead('0x80')][_0xcead('0x29')]?_0x32e7ce['attributes']:_0x2e40e9['model'];_0x32e7ce[_0xcead('0x81')]=qs[_0xcead('0x82')](_0x7e80cd[_0xcead('0x22')][_0xcead('0x82')]);_0x32e7ce[_0xcead('0x69')]=qs[_0xcead('0x7c')](_[_0xcead('0x83')](_0x7e80cd[_0xcead('0x22')],_0x2e40e9[_0xcead('0x7c')]));if(_0x7e80cd[_0xcead('0x22')]['filter']){_0x32e7ce[_0xcead('0x69')]=_['merge'](_0x32e7ce['where'],{'$or':_[_0xcead('0x6b')](_0x32e7ce[_0xcead('0x80')],function(_0x527cc6){var _0x1c38e0={};_0x1c38e0[_0x527cc6]={'$like':'%'+_0x7e80cd[_0xcead('0x22')][_0xcead('0x84')]+'%'};return _0x1c38e0;})});}_0x32e7ce=_[_0xcead('0x36')]({},_0x32e7ce,_0x7e80cd['options']);return _0x2477cf[_0xcead('0x79')](_0x32e7ce);}})[_0xcead('0x1a')](function(_0x2ebd9e){if(_0x2ebd9e){_0x69eb53=_0x2ebd9e[_0xcead('0x29')];if(!_0x7e80cd[_0xcead('0x22')]['hasOwnProperty'](_0xcead('0x85'))){_0x32e7ce[_0xcead('0x15')]=qs['limit'](_0x7e80cd['query']['limit']);_0x32e7ce[_0xcead('0x14')]=qs['offset'](_0x7e80cd[_0xcead('0x22')][_0xcead('0x14')]);}return _0x2477cf['getTags'](_0x32e7ce);}})[_0xcead('0x1a')](function(_0x549cde){if(_0x549cde){return _0x549cde?{'count':_0x69eb53,'rows':_0x549cde}:null;}})[_0xcead('0x1a')](respondWithResult(_0x4770b6,null))['catch'](handleError(_0x4770b6,null));};exports[_0xcead('0x86')]=function(_0x2cdab4,_0x5c4899){if(_0x2cdab4['body']['id']){delete _0x2cdab4['body']['id'];}return db['CmContact'][_0xcead('0x7a')]({'where':{'id':_0x2cdab4['params']['id']}})['then'](handleEntityNotFound(_0x5c4899,null))['then'](function(_0x1ffc42){if(_0x1ffc42){return _0x1ffc42[_0xcead('0x86')](_0x2cdab4[_0xcead('0x37')]['ids']||[]);}return null;})[_0xcead('0x1a')](respondWithResult(_0x5c4899,null))[_0xcead('0x25')](handleError(_0x5c4899,null));};exports[_0xcead('0x87')]=function(_0x223b29,_0x2bf877){var _0x259f9c=[];_0x259f9c[_0xcead('0x5d')](addAdditionalPhones(_0x223b29[_0xcead('0x37')]));Promise[_0xcead('0x88')](_0x259f9c)['then'](function(){_0x259f9c=[];_0x259f9c[_0xcead('0x5d')](deleteCmHopperPhones(_0x223b29[_0xcead('0x37')]['id']));_0x259f9c[_0xcead('0x5d')](addCmHopperPhones(_0x223b29[_0xcead('0x37')]['id']));Promise[_0xcead('0x88')](_0x259f9c)[_0xcead('0x1a')](function(){return[0x1];})[_0xcead('0x1a')](respondWithResult(_0x2bf877,null));});};function addAdditionalPhones(_0x5e6f28){var _0x1b4cc5;return new Promise(function(_0x507cfc){return db['CmContactHasItem'][_0xcead('0x1b')]({'where':{'CmContactId':_0x5e6f28['id']}})[_0xcead('0x1a')](function(){db[_0xcead('0x89')]['findAll']({'raw':!![],'attributes':['id',_0xcead('0x8a')]})['then'](function(_0x3dab88){var _0x375ec5=[];for(var _0x28a0ff=0x0;_0x28a0ff<_0x5e6f28['items'][_0xcead('0x29')];_0x28a0ff++){var _0x457876=_0x5e6f28[_0xcead('0x8b')]?_[_0xcead('0x53')](_0x5e6f28[_0xcead('0x8b')][_0x28a0ff])?'':_0x5e6f28[_0xcead('0x8b')][_0x28a0ff]:_0x5e6f28[_0xcead('0x8c')][_0x28a0ff][_0xcead('0x8d')]?_0x5e6f28[_0xcead('0x8c')][_0x28a0ff][_0xcead('0x8d')]:'';var _0x3ddffe=_[_0xcead('0x53')](_0x5e6f28[_0xcead('0x8c')][_0x28a0ff]['description'])?'':_0x5e6f28[_0xcead('0x8c')][_0x28a0ff]['description'];var _0x32445c=_0x457876+':'+_0x5e6f28['items'][_0x28a0ff][_0xcead('0x77')]+'§'+_0x3ddffe;if(_['isNil'](_0x1b4cc5))_0x1b4cc5=_0x32445c;else _0x1b4cc5+=';'+_0x32445c;var _0x289b6e=null;var _0x153fbd=null;if(_0x5e6f28[_0xcead('0x8b')]){if(!_[_0xcead('0x53')](_0x5e6f28['item_types'][_0x28a0ff])){_0x153fbd=_[_0xcead('0x24')](_0x3dab88,function(_0x21e707){return _0x21e707['id']===_0x5e6f28[_0xcead('0x8b')][_0x28a0ff];});if(!_[_0xcead('0x53')](_0x153fbd)){_0x289b6e=_0x153fbd['OrderBy'];}}}else{if(!_['isNil'](_0x5e6f28[_0xcead('0x8c')][_0x28a0ff])){_0x153fbd=_[_0xcead('0x24')](_0x3dab88,function(_0x6d71c2){return _0x6d71c2['id']===_0x5e6f28[_0xcead('0x8c')][_0x28a0ff][_0xcead('0x8d')];});if(!_[_0xcead('0x53')](_0x153fbd)){_0x289b6e=_0x28a0ff;}}}if(_[_0xcead('0x53')](_0x289b6e)){_0x289b6e=0x64;}_0x375ec5[_0xcead('0x5d')](addAdditionalPhone(_0x5e6f28['id'],_0x5e6f28[_0xcead('0x8c')][_0x28a0ff][_0xcead('0x77')],_0x5e6f28['item_types']?_[_0xcead('0x53')](_0x5e6f28[_0xcead('0x8b')][_0x28a0ff])?null:_0x5e6f28['item_types'][_0x28a0ff]:_0x5e6f28[_0xcead('0x8c')][_0x28a0ff][_0xcead('0x8d')]?_0x5e6f28[_0xcead('0x8c')][_0x28a0ff][_0xcead('0x8d')]:null,_0x289b6e,_0x3ddffe));}Promise['all'](_0x375ec5)[_0xcead('0x1a')](function(){db[_0xcead('0x26')]['update']({'AdditionalPhones':_0x1b4cc5},{'where':{'id':_0x5e6f28['id']}})[_0xcead('0x1a')](function(){_0x507cfc(0x1);});});});});});}function addAdditionalPhone(_0x5d3057,_0x5c4152,_0x4bd41d,_0x43ce64,_0x1b36b3){return db[_0xcead('0x49')][_0xcead('0x24')]({'where':{'CmContactId':_0x5d3057,'item':_0x5c4152}})['then'](function(_0x4fb1e5){if(_0x4fb1e5)logger[_0xcead('0x33')]('contact\x20phone\x20exists',_0x4fb1e5);else{db[_0xcead('0x49')]['create']({'CmContactId':_0x5d3057,'item':_0x5c4152,'ItemTypeId':_0x4bd41d,'OrderBy':_0x43ce64,'ItemClass':'PHONE','description':_0x1b36b3});}});}function deleteCmHopperPhones(_0x205b3a){return new Promise(function(_0x5cce1d){return db[_0xcead('0x78')][_0xcead('0x2e')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x205b3a}})[_0xcead('0x1a')](function(_0x30bc57){db[_0xcead('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0xcead('0x6b')](_0x30bc57,'id')}}});})['then'](function(){_0x5cce1d(0x1);});});}function addCmHopperPhones(_0x68e82e){return new Promise(function(_0x4deeda){return db[_0xcead('0x78')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x68e82e}})[_0xcead('0x1a')](function(_0x363ae7){var _0xa9614d=[];_['map'](_0x363ae7,function(_0x1d82c1){_0xa9614d[_0xcead('0x5d')](createCmHopperPhone(_0x68e82e,_0x1d82c1['id']));});Promise[_0xcead('0x88')](_0xa9614d)[_0xcead('0x1a')](function(){_0x4deeda(0x1);});});});}function createCmHopperPhone(_0x47e428,_0x1adee0){return new Promise(function(_0x5ddaec){db[_0xcead('0x49')]['findAll']({'raw':!![],'attributes':['item','OrderBy'],'where':{'CmContactId':_0x47e428,'ItemClass':_0xcead('0x8f')},'include':[{'model':db['ContactItemType'],'attributes':[_0xcead('0x8a')],'as':_0xcead('0x65')}],'order':[_0xcead('0x8a'),db[_0xcead('0x66')][_0xcead('0x67')](_0xcead('0x90'))]})[_0xcead('0x1a')](function(_0x53ee4e){var _0x44928c=0x1;var _0x443e2d=_[_0xcead('0x6b')](_0x53ee4e,function(_0x2ce341){_0x2ce341[_0xcead('0x91')]=_0x1adee0;_0x2ce341[_0xcead('0x77')]=_0x2ce341[_0xcead('0x92')];_0x2ce341['OrderBy']=_0x44928c;delete _0x2ce341[_0xcead('0x93')];_0x44928c=_0x44928c+0x1;return _0x2ce341;});return db[_0xcead('0x8e')][_0xcead('0x94')](_0x443e2d,{});})[_0xcead('0x1a')](function(){_0x5ddaec(0x1);});});}function insertAdditionalPhones(_0x4f979f,_0x12db4d){return new Promise(function(_0x561bfe){var _0x272eed=[];for(var _0x1d563b=0x0;_0x1d563b<_0x12db4d[_0xcead('0x29')];_0x1d563b++){var _0x5daa04=_0x12db4d[_0x1d563b];_0x272eed[_0xcead('0x5d')](parseContactItemType(_0x5daa04));}Promise[_0xcead('0x88')](_0x272eed)[_0xcead('0x1a')](function(){var _0x222c89={'id':_0x4f979f['id'],'items':_0x12db4d};return addAdditionalPhones(_0x222c89)[_0xcead('0x1a')](function(){return addCmHopperPhones(_0x4f979f['id']);});})[_0xcead('0x1a')](function(){_0x561bfe(_0x4f979f);});});}function parseContactItemType(_0x259ff8){return new Promise(function(_0xef008c){if(_0x259ff8['hasOwnProperty'](_0xcead('0x8d'))){_0xef008c(_0x259ff8);}else{return db['ContactItemType'][_0xcead('0x24')]({'where':{'name':_0x259ff8[_0xcead('0x65')]}})['then'](function(_0x339049){if(_[_0xcead('0x53')](_0x339049))_0x259ff8[_0xcead('0x8d')]=null;else _0x259ff8[_0xcead('0x8d')]=_0x339049['id'];_0xef008c(_0x259ff8);});}});}exports[_0xcead('0x95')]=function(_0x4f99ed,_0x44c2fa){return db['CmContactHasItem'][_0xcead('0x2e')]({'raw':!![],'where':{'CmContactId':_0x4f99ed['params']['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0xcead('0x89')],'as':_0xcead('0x65')}],'order':[[_0xcead('0x8a')],[db[_0xcead('0x66')]['literal']('`ItemType`.OrderBy')]]})[_0xcead('0x1a')](function(_0x4615b1){return _0x4615b1;})[_0xcead('0x1a')](respondWithResult(_0x44c2fa,null))[_0xcead('0x25')](handleError(_0x44c2fa,null));};exports[_0xcead('0x96')]=function(_0x1ff137,_0x120d70){return db[_0xcead('0x49')][_0xcead('0x2e')]({'raw':!![],'where':{'CmContactId':_0x1ff137['body']['fromContactId']}})[_0xcead('0x1a')](function(_0x44d99d){var _0x1a06ea=_['map'](_0x44d99d,function(_0x50a499){_0x50a499[_0xcead('0x97')]=_0x1ff137[_0xcead('0x37')][_0xcead('0x98')];return _0x50a499;});return db[_0xcead('0x49')][_0xcead('0x94')](_0x1a06ea,{});})[_0xcead('0x1a')](function(){return addCmHopperPhones(_0x1ff137[_0xcead('0x37')][_0xcead('0x98')]);})['then'](function(){return['ok'];})[_0xcead('0x1a')](respondWithResult(_0x120d70,null))[_0xcead('0x25')](handleError(_0x120d70,null));};exports[_0xcead('0x99')]=function(_0x588837,_0x561062){var _0x4a4ac3=[];_0x4a4ac3[_0xcead('0x5d')](createCmHopperPhone(_0x588837[_0xcead('0x37')]['id'],_0x588837[_0xcead('0x37')]['hopperId']));Promise[_0xcead('0x88')](_0x4a4ac3)[_0xcead('0x1a')](function(){return[0x1];})[_0xcead('0x1a')](respondWithResult(_0x561062,null));};exports[_0xcead('0x9a')]=function(_0x405b3e,_0x408734){var _0x260702={'raw':![],'where':{}};var _0x9a0280={};var _0x518555={'count':0x0,'rows':[]};return db[_0xcead('0x26')][_0xcead('0x7a')]({'where':{'id':_0x405b3e['params']['id']}})[_0xcead('0x1a')](handleEntityNotFound(_0x408734,null))[_0xcead('0x1a')](function(_0x32d499){if(_0x32d499){_0x9a0280[_0xcead('0x7e')]=_['keys'](db[_0xcead('0x78')][_0xcead('0x7b')]);_0x9a0280['query']=_[_0xcead('0x28')](_0x405b3e['query']);_0x9a0280[_0xcead('0x7c')]=_[_0xcead('0x7d')](_0x9a0280[_0xcead('0x7e')],_0x9a0280[_0xcead('0x22')]);_0x260702['attributes']=_['intersection'](_0x9a0280[_0xcead('0x7e')],qs[_0xcead('0x7f')](_0x405b3e[_0xcead('0x22')][_0xcead('0x7f')]));_0x260702['attributes']=_0x260702['attributes'][_0xcead('0x29')]?_0x260702[_0xcead('0x80')]:_0x9a0280['model'];if(!_0x405b3e[_0xcead('0x22')][_0xcead('0x5c')](_0xcead('0x85'))){_0x260702[_0xcead('0x15')]=qs[_0xcead('0x15')](_0x405b3e[_0xcead('0x22')][_0xcead('0x15')]);_0x260702[_0xcead('0x14')]=qs['offset'](_0x405b3e[_0xcead('0x22')][_0xcead('0x14')]);}_0x260702[_0xcead('0x81')]=qs[_0xcead('0x82')](_0x405b3e[_0xcead('0x22')]['sort']);_0x260702[_0xcead('0x69')]=qs[_0xcead('0x7c')](_[_0xcead('0x83')](_0x405b3e[_0xcead('0x22')],_0x9a0280['filters']));_0x260702['where'][_0xcead('0x9b')]=_0x32d499['id'];if(_0x405b3e['query'][_0xcead('0x84')]){_0x260702[_0xcead('0x69')]=_[_0xcead('0x36')](_0x260702[_0xcead('0x69')],{'$or':_[_0xcead('0x6b')](_0x260702['attributes'],function(_0x5377c1){var _0x100729={};_0x100729[_0x5377c1]={'$like':'%'+_0x405b3e[_0xcead('0x22')][_0xcead('0x84')]+'%'};return _0x100729;})});}_0x260702=_[_0xcead('0x36')]({},_0x260702,_0x405b3e[_0xcead('0x9c')]);return db[_0xcead('0x78')][_0xcead('0x17')]({'where':_0x260702['where']})[_0xcead('0x1a')](function(_0x3c152e){_0x518555['count']=_0x3c152e;if(_0x405b3e['query']['includeAll']){_0x260702[_0xcead('0x9d')]=[{'all':!![]}];}return db[_0xcead('0x78')][_0xcead('0x2e')](_0x260702);})['then'](function(_0x26f69e){_0x518555[_0xcead('0x9e')]=_0x26f69e;return _0x518555;});}})['then'](respondWithFilteredResult(_0x408734,_0x260702))[_0xcead('0x25')](handleError(_0x408734,null));};exports[_0xcead('0x9f')]=function(_0x191971,_0x5388ae){var _0x3f236b={'raw':!![],'where':{}};var _0x4f71a2={};var _0x3b0a0f={'count':0x0,'rows':[]};return db[_0xcead('0x26')][_0xcead('0x7a')]({'where':{'id':_0x191971['params']['id']}})[_0xcead('0x1a')](handleEntityNotFound(_0x5388ae,null))[_0xcead('0x1a')](function(_0x2ab61f){if(_0x2ab61f){_0x4f71a2[_0xcead('0x7e')]=_['keys'](db[_0xcead('0x4a')][_0xcead('0x7b')]);_0x4f71a2[_0xcead('0x22')]=_[_0xcead('0x28')](_0x191971[_0xcead('0x22')]);_0x4f71a2[_0xcead('0x7c')]=_['intersection'](_0x4f71a2[_0xcead('0x7e')],_0x4f71a2[_0xcead('0x22')]);_0x3f236b[_0xcead('0x80')]=_[_0xcead('0x7d')](_0x4f71a2[_0xcead('0x7e')],qs[_0xcead('0x7f')](_0x191971[_0xcead('0x22')][_0xcead('0x7f')]));_0x3f236b[_0xcead('0x80')]=_0x3f236b[_0xcead('0x80')][_0xcead('0x29')]?_0x3f236b[_0xcead('0x80')]:_0x4f71a2[_0xcead('0x7e')];if(!_0x191971[_0xcead('0x22')]['hasOwnProperty']('nolimit')){_0x3f236b[_0xcead('0x15')]=qs['limit'](_0x191971[_0xcead('0x22')][_0xcead('0x15')]);_0x3f236b[_0xcead('0x14')]=qs[_0xcead('0x14')](_0x191971['query'][_0xcead('0x14')]);}_0x3f236b['order']=qs[_0xcead('0x82')](_0x191971['query'][_0xcead('0x82')]);_0x3f236b[_0xcead('0x69')]=qs[_0xcead('0x7c')](_[_0xcead('0x83')](_0x191971[_0xcead('0x22')],_0x4f71a2['filters']));_0x3f236b[_0xcead('0x69')][_0xcead('0x9b')]=_0x2ab61f['id'];if(_0x191971[_0xcead('0x22')][_0xcead('0x84')]){_0x3f236b['where']=_[_0xcead('0x36')](_0x3f236b[_0xcead('0x69')],{'$or':_[_0xcead('0x6b')](_0x3f236b['attributes'],function(_0x419efd){var _0x3ec1d7={};_0x3ec1d7[_0x419efd]={'$like':'%'+_0x191971[_0xcead('0x22')][_0xcead('0x84')]+'%'};return _0x3ec1d7;})});}_0x3f236b=_[_0xcead('0x36')]({},_0x3f236b,_0x191971[_0xcead('0x9c')]);return db[_0xcead('0x4a')][_0xcead('0x17')]({'where':_0x3f236b[_0xcead('0x69')]})[_0xcead('0x1a')](function(_0x7670ac){_0x3b0a0f[_0xcead('0x17')]=_0x7670ac;if(_0x191971[_0xcead('0x22')][_0xcead('0xa0')]){_0x3f236b[_0xcead('0x9d')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3f236b);})[_0xcead('0x1a')](function(_0xe96ecf){_0x3b0a0f[_0xcead('0x9e')]=_0xe96ecf;return _0x3b0a0f;});}})[_0xcead('0x1a')](respondWithFilteredResult(_0x5388ae,_0x3f236b))[_0xcead('0x25')](handleError(_0x5388ae,null));};exports[_0xcead('0xa1')]=function(_0x3b5270,_0x17cb77){var _0x3e628e={'raw':!![],'where':{}};var _0x189281={};var _0x383884={'count':0x0,'rows':[]};return db['CmContact'][_0xcead('0x7a')]({'where':{'id':_0x3b5270['params']['id']}})[_0xcead('0x1a')](handleEntityNotFound(_0x17cb77,null))['then'](function(_0x524586){if(_0x524586){_0x189281[_0xcead('0x7e')]=_[_0xcead('0x28')](db['CmHopperFinal'][_0xcead('0x7b')]);_0x189281[_0xcead('0x22')]=_['keys'](_0x3b5270[_0xcead('0x22')]);_0x189281[_0xcead('0x7c')]=_['intersection'](_0x189281[_0xcead('0x7e')],_0x189281[_0xcead('0x22')]);_0x3e628e[_0xcead('0x80')]=_[_0xcead('0x7d')](_0x189281[_0xcead('0x7e')],qs[_0xcead('0x7f')](_0x3b5270[_0xcead('0x22')]['fields']));_0x3e628e['attributes']=_0x3e628e[_0xcead('0x80')][_0xcead('0x29')]?_0x3e628e[_0xcead('0x80')]:_0x189281[_0xcead('0x7e')];if(!_0x3b5270[_0xcead('0x22')][_0xcead('0x5c')](_0xcead('0x85'))){_0x3e628e['limit']=qs[_0xcead('0x15')](_0x3b5270['query'][_0xcead('0x15')]);_0x3e628e[_0xcead('0x14')]=qs[_0xcead('0x14')](_0x3b5270[_0xcead('0x22')][_0xcead('0x14')]);}_0x3e628e[_0xcead('0x81')]=qs[_0xcead('0x82')](_0x3b5270[_0xcead('0x22')]['sort']);_0x3e628e[_0xcead('0x69')]=qs[_0xcead('0x7c')](_[_0xcead('0x83')](_0x3b5270[_0xcead('0x22')],_0x189281[_0xcead('0x7c')]));_0x3e628e['where'][_0xcead('0x9b')]=_0x524586['id'];if(_0x3b5270[_0xcead('0x22')]['filter']){_0x3e628e[_0xcead('0x69')]=_[_0xcead('0x36')](_0x3e628e[_0xcead('0x69')],{'$or':_['map'](_0x3e628e['attributes'],function(_0x270dda){var _0x31864a={};_0x31864a[_0x270dda]={'$like':'%'+_0x3b5270[_0xcead('0x22')][_0xcead('0x84')]+'%'};return _0x31864a;})});}_0x3e628e=_['merge']({},_0x3e628e,_0x3b5270[_0xcead('0x9c')]);return db[_0xcead('0xa2')][_0xcead('0x17')]({'where':_0x3e628e[_0xcead('0x69')]})[_0xcead('0x1a')](function(_0x3988e6){_0x383884[_0xcead('0x17')]=_0x3988e6;if(_0x3b5270[_0xcead('0x22')]['includeAll']){_0x3e628e[_0xcead('0x9d')]=[{'all':!![]}];}return db[_0xcead('0xa2')][_0xcead('0x2e')](_0x3e628e);})['then'](function(_0x2d92f5){_0x383884[_0xcead('0x9e')]=_0x2d92f5;return _0x383884;});}})['then'](respondWithFilteredResult(_0x17cb77,_0x3e628e))[_0xcead('0x25')](handleError(_0x17cb77,null));};exports[_0xcead('0xa3')]=function(_0x2ed13b,_0x3e7323){var _0x2e17f7={'raw':!![],'where':{}};var _0x254cc0={};var _0x5b2d78={'count':0x0,'rows':[]};return db[_0xcead('0x26')]['findOne']({'where':{'id':_0x2ed13b['params']['id']}})[_0xcead('0x1a')](handleEntityNotFound(_0x3e7323,null))[_0xcead('0x1a')](function(_0x20df44){if(_0x20df44){_0x254cc0[_0xcead('0x7e')]=_[_0xcead('0x28')](db[_0xcead('0x50')][_0xcead('0x7b')]);_0x254cc0[_0xcead('0x22')]=_[_0xcead('0x28')](_0x2ed13b[_0xcead('0x22')]);_0x254cc0['filters']=_[_0xcead('0x7d')](_0x254cc0[_0xcead('0x7e')],_0x254cc0[_0xcead('0x22')]);_0x2e17f7[_0xcead('0x80')]=_[_0xcead('0x7d')](_0x254cc0[_0xcead('0x7e')],qs['fields'](_0x2ed13b[_0xcead('0x22')][_0xcead('0x7f')]));_0x2e17f7[_0xcead('0x80')]=_0x2e17f7['attributes'][_0xcead('0x29')]?_0x2e17f7['attributes']:_0x254cc0[_0xcead('0x7e')];if(!_0x2ed13b[_0xcead('0x22')][_0xcead('0x5c')](_0xcead('0x85'))){_0x2e17f7[_0xcead('0x15')]=qs[_0xcead('0x15')](_0x2ed13b[_0xcead('0x22')][_0xcead('0x15')]);_0x2e17f7[_0xcead('0x14')]=qs[_0xcead('0x14')](_0x2ed13b[_0xcead('0x22')]['offset']);}_0x2e17f7[_0xcead('0x81')]=qs[_0xcead('0x82')](_0x2ed13b[_0xcead('0x22')]['sort']);_0x2e17f7[_0xcead('0x69')]=qs[_0xcead('0x7c')](_[_0xcead('0x83')](_0x2ed13b[_0xcead('0x22')],_0x254cc0[_0xcead('0x7c')]));_0x2e17f7['where']['ContactId']=_0x20df44['id'];if(_0x2ed13b['query']['filter']){_0x2e17f7[_0xcead('0x69')]=_[_0xcead('0x36')](_0x2e17f7['where'],{'$or':_[_0xcead('0x6b')](_0x2e17f7['attributes'],function(_0x668d37){var _0x30a3c9={};_0x30a3c9[_0x668d37]={'$like':'%'+_0x2ed13b['query'][_0xcead('0x84')]+'%'};return _0x30a3c9;})});}_0x2e17f7=_[_0xcead('0x36')]({},_0x2e17f7,_0x2ed13b['options']);return db[_0xcead('0x50')][_0xcead('0x17')]({'where':_0x2e17f7[_0xcead('0x69')]})[_0xcead('0x1a')](function(_0xfd2367){_0x5b2d78['count']=_0xfd2367;if(_0x2ed13b[_0xcead('0x22')][_0xcead('0xa0')]){_0x2e17f7['include']=[{'all':!![]}];}return db[_0xcead('0x50')][_0xcead('0x2e')](_0x2e17f7);})['then'](function(_0xd533b0){_0x5b2d78[_0xcead('0x9e')]=_0xd533b0;return _0x5b2d78;});}})[_0xcead('0x1a')](respondWithFilteredResult(_0x3e7323,_0x2e17f7))[_0xcead('0x25')](handleError(_0x3e7323,null));};exports[_0xcead('0xa4')]=function(_0x2779a2,_0x47b329){try{if(!_0x2779a2[_0xcead('0x37')][_0xcead('0x5b')]){throw new Error(_0xcead('0xa5'));}if(!_0x2779a2[_0xcead('0x37')][_0xcead('0xa6')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x2779a2[_0xcead('0x37')][_0xcead('0xa7')]){throw new Error(_0xcead('0xa8'));}if(!_0x2779a2[_0xcead('0x37')][_0xcead('0xa9')]){throw new Error(_0xcead('0xaa'));}var _0x47eafb=_0x2779a2['body'][_0xcead('0xa6')][_0xcead('0xab')](',');var _0x5db194=_0x2779a2['body'][_0xcead('0xa7')][_0xcead('0xab')](',');if(!_0x47eafb['length']||!_0x5db194['length']||_0x47eafb[_0xcead('0x29')]!==_0x5db194[_0xcead('0x29')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x2779a2[_0xcead('0x37')][_0xcead('0x7f')]=_[_0xcead('0xac')](_0x47eafb,_0x5db194);if(!_0x2779a2[_0xcead('0x37')][_0xcead('0x7f')]['phone']){throw new Error(_0xcead('0xad'));}if(!_0x2779a2[_0xcead('0x37')][_0xcead('0x7f')][_0xcead('0xae')]){throw new Error(_0xcead('0xaf'));}var _0x34707c=path[_0xcead('0x3b')](config[_0xcead('0xb0')],'server/files/tmp',_0x2779a2[_0xcead('0xb1')][_0xcead('0xb2')]);fs[_0xcead('0xb3')](_0x34707c,parseInt(_0xcead('0xb4'),0x8));var _0x3a90b1=require(_0xcead('0xb5'))[_0xcead('0xb6')](path['join'](__dirname,_0xcead('0xb7')),[_0x34707c,_0x2779a2[_0xcead('0x37')]['binding_keys'],_0x2779a2[_0xcead('0x37')][_0xcead('0xa7')],_0x2779a2[_0xcead('0x37')][_0xcead('0x5b')],_0x2779a2['body'][_0xcead('0xb8')],_0x2779a2[_0xcead('0x37')][_0xcead('0x59')],_0x2779a2['body']['socket_timestamp']]);return _0x47b329[_0xcead('0x12')](0xc8)[_0xcead('0x13')]({'message':_0xcead('0xb9'),'pid':_0x3a90b1[_0xcead('0xba')]});}catch(_0x4eeebf){return _0x47b329[_0xcead('0x12')](0x1f4)[_0xcead('0x20')](_0x4eeebf);}};exports[_0xcead('0xbb')]=function(_0x25cc0c,_0x1ecb5e){var _0x4463d7=fs[_0xcead('0xbc')](_0x25cc0c[_0xcead('0xb1')][_0xcead('0x3')]);Papa[_0xcead('0xbd')](_0x4463d7,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x16de08){return _0x1ecb5e[_0xcead('0x12')](0xc8)[_0xcead('0x13')]({'file':_0x25cc0c[_0xcead('0xb1')],'fields':_0x16de08['meta'][_0xcead('0x7f')]});}});};exports[_0xcead('0xbe')]=function(_0x2364da,_0x5e0fdb){return db[_0xcead('0xbf')][_0xcead('0x2e')]({'raw':!![],'attributes':['id'],'where':{'role':_0xcead('0xc0')}})[_0xcead('0x1a')](function(_0x456727){var _0x148cbb=![];if(!_0x2364da['body'][_0xcead('0x5b')]){throw new Error('No\x20ListId\x20specified');}if(!_0x2364da[_0xcead('0x37')][_0xcead('0xc1')][_0xcead('0x77')]){throw new Error(_0xcead('0xad'));}if(!_0x2364da[_0xcead('0x37')][_0xcead('0xc1')][_0xcead('0xae')]){throw new Error(_0xcead('0xaf'));}if(!_0x2364da[_0xcead('0x37')][_0xcead('0xa9')]){throw new Error(_0xcead('0xaa'));}var _0x243824=require('child_process')[_0xcead('0xb6')](path[_0xcead('0x3b')](__dirname,_0xcead('0xc2')),[_0x2364da[_0xcead('0x5f')]['id'],JSON['stringify'](_0x2364da[_0xcead('0x37')]),JSON[_0xcead('0xc3')](_0x456727)]);_0x243824['on'](_0xcead('0xc4'),function(){_0x148cbb=!![];return _0x5e0fdb[_0xcead('0x12')](0xc8)[_0xcead('0x13')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x243824[_0xcead('0xba')]});});_0x243824['on'](_0xcead('0xc5'),function(_0x138b45){if(_0x138b45&&!_0x148cbb){return _0x5e0fdb[_0xcead('0x12')](0x1f4)[_0xcead('0x13')]({'message':'error\x20child\x20process','pid':_0x243824[_0xcead('0xba')]});}});})[_0xcead('0x25')](handleError(_0x5e0fdb,null));};exports[_0xcead('0xc6')]=function(_0x4282fd,_0x4c74f5){return db[_0xcead('0xbf')][_0xcead('0x2e')]({'raw':!![],'attributes':['id'],'where':{'role':_0xcead('0xc0')}})[_0xcead('0x1a')](function(_0x310265){var _0x2af65d=![];if(!_0x4282fd[_0xcead('0x37')][_0xcead('0x5b')]){throw new Error(_0xcead('0xa5'));}if(!_0x4282fd[_0xcead('0x37')]['binding']['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x4282fd[_0xcead('0x37')][_0xcead('0xc1')][_0xcead('0xae')]){throw new Error(_0xcead('0xaf'));}if(!_0x4282fd[_0xcead('0x37')]['socket_timestamp']){throw new Error(_0xcead('0xaa'));}var _0x3e61e0=require('child_process')['fork'](path[_0xcead('0x3b')](__dirname,_0xcead('0xc7')),[_0x4282fd[_0xcead('0x5f')]['id'],JSON[_0xcead('0xc3')](_0x4282fd['body']),JSON['stringify'](_0x310265)]);_0x3e61e0['on'](_0xcead('0xc4'),function(){_0x2af65d=!![];return _0x4c74f5[_0xcead('0x12')](0xc8)[_0xcead('0x13')]({'message':_0xcead('0xc8'),'pid':_0x3e61e0['pid']});});_0x3e61e0['on'](_0xcead('0xc5'),function(_0x31aada){if(_0x31aada&&!_0x2af65d){return _0x4c74f5[_0xcead('0x12')](0x1f4)[_0xcead('0x13')]({'message':_0xcead('0xc9'),'pid':_0x3e61e0['pid']});}});})[_0xcead('0x25')](handleError(_0x4c74f5,null));};exports[_0xcead('0xca')]=function(_0x51719b,_0x1c90fc){var _0x4b95c0=[_0xcead('0xcb'),'chat',_0xcead('0xcc'),_0xcead('0xcd'),_0xcead('0xce'),_0xcead('0xcf'),'voice'];var _0x2e41e4={'offset':0x0,'order':qs[_0xcead('0x82')](_0xcead('0xd0'))},_0x1ae9d7={'count':0x0,'rows':[]};Promise[_0xcead('0xd1')]()['then'](function(){if(_0x51719b[_0xcead('0x22')][_0xcead('0xd2')]){if(!_['includes'](_0x4b95c0,_0x51719b['query'][_0xcead('0xd2')]['toLowerCase']())){throw new Error(_0xcead('0xd3'));}_0x4b95c0=[_0x51719b[_0xcead('0x22')][_0xcead('0xd2')][_0xcead('0xd4')]()];}if(_0x51719b[_0xcead('0x22')][_0xcead('0xd5')]){try{var _0x2571df=JSON['parse'](_0x51719b['query'][_0xcead('0xd5')]);if(!moment(_0x2571df[_0xcead('0x3c')])[_0xcead('0xd6')]()){throw new Error(_0xcead('0xd7'));}if(!moment(_0x2571df['to'])[_0xcead('0xd6')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x4562c9){throw new Error(_0xcead('0xd8'));}}if(!_0x51719b[_0xcead('0x22')][_0xcead('0x5c')]('nolimit')){_0x2e41e4[_0xcead('0x15')]=qs[_0xcead('0x15')](_0x51719b[_0xcead('0x22')][_0xcead('0x15')]||0xa);_0x2e41e4['offset']=qs[_0xcead('0x14')](_0x51719b[_0xcead('0x22')][_0xcead('0x14')]);}var _0x271267=_0x4b95c0[_0xcead('0x6b')](function(_0x818ca4){if(_0x818ca4===_0xcead('0xd9')){var _0x198b60={'attributes':['id',_0xcead('0xda'),_0xcead('0xdb'),_0xcead('0xdc'),_0xcead('0xdd'),_0xcead('0xde'),_0xcead('0xdf'),_0xcead('0xe0'),_0xcead('0xe1'),_0xcead('0xe2'),_0xcead('0xe3'),_0xcead('0xe4'),_0xcead('0xe5'),_0xcead('0xe6'),_0xcead('0xe7')],'where':{'ContactId':_0x51719b['params']['id']},'include':[{'model':db[_0xcead('0xbf')],'as':_0xcead('0xbf'),'attributes':['id',_0xcead('0x1f'),_0xcead('0xe8'),_0xcead('0x30')]}],'order':[[_0xcead('0xe3'),_0xcead('0xe9')]]};if(_0x51719b[_0xcead('0x22')][_0xcead('0xd5')]){_0x198b60['where'][_0xcead('0xe3')]={'$gte':_0x2571df[_0xcead('0x3c')],'$lte':_0x2571df['to']};}return db[_0xcead('0xea')][_0xcead('0xeb')](_0x198b60)[_0xcead('0x1a')](function(_0x425eaa){_0x1ae9d7[_0xcead('0x17')]+=_0x425eaa[_0xcead('0x17')];return _[_0xcead('0x6b')](_0x425eaa[_0xcead('0x9e')],function(_0xa704fc){var _0x6ef208=_0xa704fc['get']({'plain':!![]});_0x6ef208[_0xcead('0xd2')]=_0x818ca4;if(_0x6ef208[_0xcead('0xbf')]){_0x6ef208[_0xcead('0xbf')]={'id':_0x6ef208['User']['id'],'name':_0x6ef208[_0xcead('0xbf')][_0xcead('0x1f')],'fullname':_0x6ef208[_0xcead('0xbf')][_0xcead('0xe8')],'alias':_0x6ef208[_0xcead('0xbf')]['alias']};}return _0x6ef208;});});}else{var _0x552cf9=_['startCase'](_0x818ca4)+(_0x818ca4===_0xcead('0xec')?_0xcead('0xed'):_0xcead('0xee'));var _0x2cb3eb={'attributes':['id',_0xcead('0xef'),_0xcead('0xf0'),_0xcead('0xe3'),_0xcead('0xe2'),_0xcead('0xf1'),'secondDisposition',_0xcead('0xf2'),_0xcead('0xe7'),_0x552cf9+'Id'],'where':{'ContactId':_0x51719b[_0xcead('0x5f')]['id']},'include':[{'model':db[_0x552cf9],'as':_0xcead('0xee'),'attributes':['id',_0xcead('0x1f'),_0xcead('0xf3')]},{'model':db[_0xcead('0xbf')],'as':'Owner','attributes':['id',_0xcead('0x1f'),_0xcead('0xe8')]},{'model':db[_0xcead('0x60')],'as':'Tags','attributes':['id',_0xcead('0x1f'),_0xcead('0x62')],'through':{'attributes':[]}}],'order':[[_0xcead('0xe3'),'DESC']]};if(_0x51719b[_0xcead('0x22')][_0xcead('0xd5')]){_0x2cb3eb[_0xcead('0x69')]['createdAt']={'$gte':_0x2571df['from'],'$lte':_0x2571df['to']};}switch(_0x818ca4){case _0xcead('0xec'):_0x2cb3eb['attributes']['push'](_0xcead('0xf4'),_0xcead('0xf5'),'customerPort',_0xcead('0xf6'),_0xcead('0xf7'),_0xcead('0xf8'),_0xcead('0xf9'),'ratingValue','referer');break;case _0xcead('0xcb'):_0x2cb3eb['attributes'][_0xcead('0x5d')](_0xcead('0xfa'),_0xcead('0xfb'));break;case _0xcead('0xcd'):_0x2cb3eb['attributes'][_0xcead('0x5d')](_0xcead('0xfc'),_0xcead('0xfd'));break;}return db[_[_0xcead('0xfe')](_0x818ca4)+_0xcead('0xff')][_0xcead('0xeb')](_0x2cb3eb)['then'](function(_0x49a7c6){_0x1ae9d7[_0xcead('0x17')]+=_0x49a7c6['count'];return _['map'](_0x49a7c6['rows'],function(_0x3b549d){var _0x36c752=_0x3b549d['get']({'plain':!![]});_0x36c752[_0xcead('0xd2')]=_0x818ca4;if(_0x36c752[_0xcead('0x100')]){_0x36c752[_0xcead('0x100')]={'id':_0x36c752[_0xcead('0x100')]['id'],'name':_0x36c752[_0xcead('0x100')][_0xcead('0x1f')],'fullname':_0x36c752[_0xcead('0x100')][_0xcead('0xe8')]};}return _0x36c752;});});}});return Promise[_0xcead('0x88')](_0x271267);})[_0xcead('0x1a')](function(_0xc3a6e6){return _(_0xc3a6e6)[_0xcead('0x101')]()['sortBy'](_0xcead('0xe3'))['reverse']()[_0xcead('0x102')]();})[_0xcead('0x1a')](function(_0x1b5d7d){_0x1ae9d7[_0xcead('0x9e')]=_0x2e41e4[_0xcead('0x15')]?_0x1b5d7d[_0xcead('0x103')](_0x2e41e4['offset'],_0x2e41e4[_0xcead('0x14')]+_0x2e41e4[_0xcead('0x15')]):_0x1b5d7d;return _0x1ae9d7;})[_0xcead('0x1a')](respondWithFilteredResult(_0x1c90fc,_0x2e41e4))[_0xcead('0x25')](handleError(_0x1c90fc,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 814ef37..dfd6c20 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4d0=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x4ee71d,_0x13986f){var _0x1885e2=function(_0x328025){while(--_0x328025){_0x4ee71d['push'](_0x4ee71d['shift']());}};_0x1885e2(++_0x13986f);}(_0xe4d0,0xe6));var _0x0e4d=function(_0x5cbd7b,_0x207439){_0x5cbd7b=_0x5cbd7b-0x0;var _0x3fdfb8=_0xe4d0[_0x5cbd7b];return _0x3fdfb8;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x0e4d('0x0'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x0e4d('0x1')](0x0);var events={'afterCreate':_0x0e4d('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5a760c){return function(_0x5999a3,_0x225024,_0x1f3436){CmContactEvents['emit'](_0x5a760c+':'+_0x5999a3['id'],_0x5999a3);CmContactEvents[_0x0e4d('0x3')](_0x5a760c,_0x5999a3);_0x1f3436(null);};}for(var e in events){if(events[_0x0e4d('0x4')](e)){var event=events[e];CmContact[_0x0e4d('0x5')](e,emitEvent(event));}}module[_0x0e4d('0x6')]=CmContactEvents; \ No newline at end of file +var _0x9807=['../../mysqldb','CmContact','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x334fea,_0x1f1e18){var _0x3c5829=function(_0x4fd6ac){while(--_0x4fd6ac){_0x334fea['push'](_0x334fea['shift']());}};_0x3c5829(++_0x1f1e18);}(_0x9807,0xe9));var _0x7980=function(_0x45b146,_0x72e8a3){_0x45b146=_0x45b146-0x0;var _0x5a627f=_0x9807[_0x45b146];return _0x5a627f;};'use strict';var EventEmitter=require(_0x7980('0x0'));var CmContact=require(_0x7980('0x1'))['db'][_0x7980('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x7980('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7980('0x4'),'afterDestroy':'remove'};function emitEvent(_0x58d6fe){return function(_0x45481f,_0x42aa6e,_0x244880){CmContactEvents[_0x7980('0x5')](_0x58d6fe+':'+_0x45481f['id'],_0x45481f);CmContactEvents[_0x7980('0x5')](_0x58d6fe,_0x45481f);_0x244880(null);};}for(var e in events){if(events[_0x7980('0x6')](e)){var event=events[e];CmContact[_0x7980('0x7')](e,emitEvent(event));}}module[_0x7980('0x8')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 7873584..9d514be 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5540=['outbound','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','CmHopperBlack','cmContact,\x20%s,\x20%s','afterCreate','message','BlackLists','models','destroy','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','../../config/logger','api','moment','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4_unicode_ci','get','error','scheduledat','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','VoiceQueue','then','isNil','timezones','utcOffset','minutes','ret','CmHopper','findOne','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','format','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','cmContact','inspect','Campaign','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll'];(function(_0x5e2cb6,_0x3e8ec5){var _0x4b42e0=function(_0x5de3d2){while(--_0x5de3d2){_0x5e2cb6['push'](_0x5e2cb6['shift']());}};_0x4b42e0(++_0x3e8ec5);}(_0x5540,0x145));var _0x0554=function(_0x48b48c,_0x35ea8f){_0x48b48c=_0x48b48c-0x0;var _0x3aaf67=_0x5540[_0x48b48c];return _0x3aaf67;};'use strict';var _=require('lodash');var util=require(_0x0554('0x0'));var logger=require(_0x0554('0x1'))(_0x0554('0x2'));var moment=require(_0x0554('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0554('0x4'));var rimraf=require(_0x0554('0x5'));var config=require(_0x0554('0x6'));var shared=require(_0x0554('0x7'));var attributes=require(_0x0554('0x8'));module[_0x0554('0x9')]=function(_0x3177cc,_0x254c05){return _0x3177cc[_0x0554('0xa')](_0x0554('0xb'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x0554('0xc'),'fields':['phone']},{'name':_0x0554('0xd'),'fields':[_0x0554('0xe'),_0x0554('0xf'),_0x0554('0xc'),_0x0554('0x10'),_0x0554('0x11'),_0x0554('0x12')],'type':_0x0554('0x13')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x0554('0x14'),'hooks':{'afterCreate':function(_0x3a87c2,_0xc38469,_0x230ad3){var _0x3f137a=_0x3177cc['models'];var _0x190c47=_0x3a87c2[_0x0554('0x15')]({'plain':!![]});function _0x13150f(){return function(_0xe86dc8){logger[_0x0554('0x16')]('cmContact','afterCreate',util['inspect'](_0xe86dc8,{'showHidden':![],'depth':null}));};}function _0x274b02(_0x269afd,_0xaadae8){var _0x23cb59=_0xaadae8[_0x0554('0x17')]?_0xaadae8[_0x0554('0x17')]:moment()['format'](_0x0554('0x18'));return new BPromise(function(_0xeb5ab3,_0x4c77d6){if(_['isNil'](_0xaadae8[_0x0554('0x19')])){_0xeb5ab3({'ret':_0x23cb59});}else{_0x3f137a[_0x0554('0x1a')]['findOne']({'where':{'id':_0x269afd['id']}})[_0x0554('0x1b')](function(_0x5c61b7){if(!_[_0x0554('0x1c')](_0x5c61b7)){var _0x5ab21f=_0x5c61b7[_0x0554('0x19')];if(!_[_0x0554('0x1c')](_0x5ab21f)){var _0x1ddc14=shared[_0x0554('0x1d')];var _0x18acb2=_0x1ddc14[_0x5ab21f];var _0x55a04b=_0x1ddc14[_0xaadae8[_0x0554('0x19')]];if(!_[_0x0554('0x1c')](_0x18acb2)&&!_[_0x0554('0x1c')](_0x55a04b)){var _0x9806ca=_0x18acb2[_0x0554('0x1e')]-_0x55a04b[_0x0554('0x1e')];_0x23cb59=_0xaadae8['scheduledat']?_0xaadae8[_0x0554('0x17')]:moment();var _0x5ba40a=moment(_0x23cb59)['add'](_0x9806ca,_0x0554('0x1f'));_0xeb5ab3({'ret':_0x5ba40a['format'](_0x0554('0x18'))});}else _0xeb5ab3({'ret':_0x23cb59});}else _0xeb5ab3({'ret':_0x23cb59});}else{_0xeb5ab3({'ret':_0x23cb59});}});}});return 0xa;}var _0x4f7dfa=function(_0x1a023c){return new BPromise(function(_0x14ca31,_0x2152ee){_0x274b02(_0x1a023c,_0x190c47)[_0x0554('0x1b')](function(_0x5ddddf){_0x190c47['scheduledat']=_0x5ddddf[_0x0554('0x20')];_0x3f137a[_0x0554('0x21')][_0x0554('0x22')]({'where':{'phone':_0x190c47['phone'],'VoiceQueueId':_0x1a023c['id']}})['then'](function(_0x3dbbf6){if(!_[_0x0554('0x1c')](_0x3dbbf6)){throw new Error('cmContact,\x20afterCreate\x20'+_0x190c47[_0x0554('0xc')]+_0x0554('0x23')+_0x1a023c['id']);}return _0x3f137a['CmHopper'][_0x0554('0x24')]({'phone':_0x190c47['phone'],'ContactId':_0x190c47['id'],'ListId':_0x190c47[_0x0554('0x25')],'priority':_0x190c47[_0x0554('0x26')]?_0x190c47['priority']:0x2,'scheduledat':_0x190c47[_0x0554('0x17')]?_0x190c47[_0x0554('0x17')]:moment()[_0x0554('0x27')](_0x0554('0x18')),'callback':_0x190c47['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x190c47[_0x0554('0x28')]?_0x190c47['callbackUniqueid']:undefined,'callbackat':_0x190c47[_0x0554('0x28')]?moment()[_0x0554('0x27')](_0x0554('0x18')):undefined,'VoiceQueueId':_0x1a023c['id']});})[_0x0554('0x29')](function(_0x3cdbe8){_0x2152ee(_0x3cdbe8);});});});};var _0x15fbbe=function(_0xb75f87){return new BPromise(function(_0x8bd0a,_0x18aad9){_0x274b02(_0xb75f87,_0x190c47)['then'](function(_0x13a552){_0x190c47['scheduledat']=_0x13a552[_0x0554('0x20')];_0x3f137a['CmHopper'][_0x0554('0x22')]({'where':{'phone':_0x190c47[_0x0554('0xc')],'VoiceQueueId':_0xb75f87['id']}})[_0x0554('0x1b')](function(_0x25ed94){if(!_[_0x0554('0x1c')](_0x25ed94)){throw new Error(_0x0554('0x2a')+_0x190c47[_0x0554('0xc')]+_0x0554('0x2b')+_0xb75f87['id']);}return _0x3f137a['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x190c47[_0x0554('0xc')],'VoiceQueueId':_0xb75f87['id']}});})[_0x0554('0x1b')](function(_0x15161e){if(!_['isNil'](_0x15161e)){throw new Error(_0x0554('0x2c')+_0x190c47[_0x0554('0xc')]+_0x0554('0x2d')+_0xb75f87['id']);}return _0x3f137a[_0x0554('0x21')]['create']({'phone':_0x190c47['phone'],'ContactId':_0x190c47['id'],'ListId':_0x190c47[_0x0554('0x25')],'priority':_0x190c47[_0x0554('0x26')]?_0x190c47[_0x0554('0x26')]:0x2,'scheduledat':_0x190c47['scheduledat']?_0x190c47[_0x0554('0x17')]:moment()['format'](_0x0554('0x18')),'callback':_0x190c47[_0x0554('0x28')]?!![]:![],'callbackuniqueid':_0x190c47['callbackUniqueid']?_0x190c47[_0x0554('0x28')]:undefined,'callbackat':_0x190c47['callbackUniqueid']?moment()['format'](_0x0554('0x18')):undefined,'VoiceQueueId':_0xb75f87['id']});})[_0x0554('0x29')](function(_0x4d08c2){_0x18aad9(_0x4d08c2);});});});};function _0x560eb8(){return function(_0x44b411){logger['error'](_0x0554('0x2e'),'afterCreate',util[_0x0554('0x2f')](_0x44b411,{'showHidden':![],'depth':null}));};}function _0x46a712(_0x58cf20,_0x3863aa){var _0x1a7938=_0x3863aa[_0x0554('0x17')]?_0x3863aa[_0x0554('0x17')]:moment()[_0x0554('0x27')](_0x0554('0x18'));return new BPromise(function(_0x39b8b3,_0x1a0094){if(_[_0x0554('0x1c')](_0x3863aa['dialTimezone'])){_0x39b8b3({'ret':_0x1a7938});}else{_0x3f137a[_0x0554('0x30')][_0x0554('0x22')]({'where':{'id':_0x58cf20['id']}})[_0x0554('0x1b')](function(_0x1691ed){if(!_[_0x0554('0x1c')](_0x1691ed)){var _0x20d522=_0x1691ed['dialTimezone'];if(!_[_0x0554('0x1c')](_0x20d522)){var _0xba5e6d=shared[_0x0554('0x1d')];var _0x50e9f1=_0xba5e6d[_0x20d522];var _0x2821a4=_0xba5e6d[_0x3863aa['dialTimezone']];if(!_['isNil'](_0x50e9f1)&&!_[_0x0554('0x1c')](_0x2821a4)){var _0x461ab3=_0x50e9f1['utcOffset']-_0x2821a4[_0x0554('0x1e')];_0x1a7938=_0x3863aa[_0x0554('0x17')]?_0x3863aa['scheduledat']:moment();var _0x3781d7=moment(_0x1a7938)[_0x0554('0x31')](_0x461ab3,_0x0554('0x1f'));_0x39b8b3({'ret':_0x3781d7['format'](_0x0554('0x18'))});}else _0x39b8b3({'ret':_0x1a7938});}else _0x39b8b3({'ret':_0x1a7938});}else{_0x39b8b3({'ret':_0x1a7938});}});}});return 0xa;}var _0xa0b542=function(_0x399582){return new BPromise(function(_0x4f2f81,_0x541e14){_0x46a712(_0x399582,_0x190c47)[_0x0554('0x1b')](function(_0x157e67){_0x190c47[_0x0554('0x17')]=_0x157e67[_0x0554('0x20')];_0x3f137a[_0x0554('0x21')]['findOne']({'where':{'phone':_0x190c47[_0x0554('0xc')],'CampaignId':_0x399582['id']}})['then'](function(_0x2e37e5){if(!_[_0x0554('0x1c')](_0x2e37e5)){throw new Error('cmContact,\x20afterCreate\x20'+_0x190c47[_0x0554('0xc')]+_0x0554('0x32')+_0x399582['id']);}return _0x3f137a[_0x0554('0x21')][_0x0554('0x24')]({'phone':_0x190c47[_0x0554('0xc')],'ContactId':_0x190c47['id'],'ListId':_0x190c47['ListId'],'priority':_0x190c47[_0x0554('0x26')]?_0x190c47[_0x0554('0x26')]:0x2,'scheduledat':_0x190c47[_0x0554('0x17')]?_0x190c47[_0x0554('0x17')]:moment()[_0x0554('0x27')](_0x0554('0x18')),'callback':_0x190c47['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x190c47[_0x0554('0x28')]?_0x190c47[_0x0554('0x28')]:undefined,'callbackat':_0x190c47['callbackUniqueid']?moment()[_0x0554('0x27')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x399582['id']});})['catch'](function(_0x4e6c3e){_0x541e14(_0x4e6c3e);});});});};var _0xf38492=function(_0x21766c){return new BPromise(function(_0x18dc32,_0x5f493b){_0x46a712(_0x21766c,_0x190c47)[_0x0554('0x1b')](function(_0x281ae5){_0x190c47[_0x0554('0x17')]=_0x281ae5[_0x0554('0x20')];_0x3f137a[_0x0554('0x21')]['findOne']({'where':{'phone':_0x190c47[_0x0554('0xc')],'CampaignId':_0x21766c['id']}})[_0x0554('0x1b')](function(_0x3a859e){if(!_['isNil'](_0x3a859e)){throw new Error(_0x0554('0x2a')+_0x190c47[_0x0554('0xc')]+_0x0554('0x33')+_0x21766c['id']);}return _0x3f137a[_0x0554('0x34')][_0x0554('0x22')]({'where':{'calleridnum':_0x190c47[_0x0554('0xc')],'CampaignId':_0x21766c['id']}});})[_0x0554('0x1b')](function(_0x2d067a){if(!_[_0x0554('0x1c')](_0x2d067a)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x190c47[_0x0554('0xc')]+_0x0554('0x35')+_0x21766c['id']);}return _0x3f137a['CmHopper'][_0x0554('0x24')]({'phone':_0x190c47[_0x0554('0xc')],'ContactId':_0x190c47['id'],'ListId':_0x190c47['ListId'],'priority':_0x190c47[_0x0554('0x26')]?_0x190c47[_0x0554('0x26')]:0x2,'scheduledat':_0x190c47[_0x0554('0x17')]?_0x190c47[_0x0554('0x17')]:moment()[_0x0554('0x27')](_0x0554('0x18')),'callback':_0x190c47['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x190c47[_0x0554('0x28')]?_0x190c47['callbackUniqueid']:undefined,'callbackat':_0x190c47[_0x0554('0x28')]?moment()[_0x0554('0x27')](_0x0554('0x18')):undefined,'CampaignId':_0x21766c['id']});})[_0x0554('0x29')](function(_0x3ce031){_0x5f493b(_0x3ce031);});});});};if(_0x190c47[_0x0554('0x25')]){_0x3f137a['VoiceQueue'][_0x0554('0x36')]({'where':{'type':_0x0554('0x37')},'attributes':['id',_0x0554('0x38'),'dialTimezone'],'include':[{'model':_0x3f137a[_0x0554('0x39')],'as':_0x0554('0x3a'),'where':{'id':_0x190c47['ListId']}}]})[_0x0554('0x1b')](function(_0x4c5a4d){if(_0x4c5a4d){var _0x3dd5d7=[];for(var _0x70098d=0x0,_0x5cf4ba;_0x70098d<_0x4c5a4d[_0x0554('0x3b')];_0x70098d+=0x1){_0x5cf4ba=_0x4c5a4d[_0x70098d]['get']({'plain':!![]});switch(_0x5cf4ba['dialCheckDuplicateType']){case _0x0554('0x3c'):_0x15fbbe(_0x5cf4ba)[_0x0554('0x29')](_0x13150f());break;case _0x0554('0x3d'):_0x4f7dfa(_0x5cf4ba)[_0x0554('0x29')](_0x13150f());break;default:_0x46a712(_0x5cf4ba,_0x190c47)['then'](function(_0x45be6f){_0x190c47[_0x0554('0x17')]=_0x45be6f[_0x0554('0x20')];_0x3f137a[_0x0554('0x21')][_0x0554('0x24')]({'phone':_0x190c47['phone'],'ContactId':_0x190c47['id'],'ListId':_0x190c47['ListId'],'scheduledat':_0x190c47[_0x0554('0x17')]?_0x190c47['scheduledat']:moment()[_0x0554('0x27')](_0x0554('0x18')),'priority':_0x190c47[_0x0554('0x26')]?_0x190c47[_0x0554('0x26')]:0x2,'callback':_0x190c47[_0x0554('0x28')]?!![]:![],'callbackuniqueid':_0x190c47['callbackUniqueid']?_0x190c47[_0x0554('0x28')]:undefined,'callbackat':_0x190c47[_0x0554('0x28')]?moment()[_0x0554('0x27')](_0x0554('0x18')):undefined,'VoiceQueueId':_0x5cf4ba['id']})[_0x0554('0x29')](_0x13150f());});}}}})['then'](function(){return _0x3f137a[_0x0554('0x1a')][_0x0554('0x36')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x3f137a['CmList'],'as':'BlackLists','where':{'id':_0x190c47['ListId']}}]})['then'](function(_0x475279){if(_0x475279){var _0x259848=[];for(var _0x372636=0x0,_0x59b311;_0x372636<_0x475279[_0x0554('0x3b')];_0x372636+=0x1){_0x59b311=_0x475279[_0x372636]['get']({'plain':!![]});_0x3f137a[_0x0554('0x3e')][_0x0554('0x24')]({'phone':_0x190c47[_0x0554('0xc')],'ContactId':_0x190c47['id'],'ListId':_0x190c47[_0x0554('0x25')],'VoiceQueueId':_0x59b311['id']})[_0x0554('0x29')](function(_0x458ad9){logger[_0x0554('0x16')](_0x0554('0x3f'),_0x0554('0x40'),_0x458ad9[_0x0554('0x41')]);});}}});})[_0x0554('0x1b')](function(){return _0x3f137a[_0x0554('0x30')][_0x0554('0x36')]({'attributes':['id',_0x0554('0x38'),'dialTimezone'],'include':[{'model':_0x3f137a[_0x0554('0x39')],'as':'Lists','where':{'id':_0x190c47['ListId']}}]})[_0x0554('0x1b')](function(_0x4defd7){if(_0x4defd7){var _0x35c8c5=[];for(var _0x1730a1=0x0,_0x5ecc7e;_0x1730a1<_0x4defd7[_0x0554('0x3b')];_0x1730a1+=0x1){_0x5ecc7e=_0x4defd7[_0x1730a1][_0x0554('0x15')]({'plain':!![]});switch(_0x5ecc7e[_0x0554('0x38')]){case _0x0554('0x3c'):_0xf38492(_0x5ecc7e)['catch'](_0x560eb8());break;case _0x0554('0x3d'):_0xa0b542(_0x5ecc7e)['catch'](_0x560eb8());break;default:_0x3f137a['CmHopper'][_0x0554('0x24')]({'phone':_0x190c47[_0x0554('0xc')],'ContactId':_0x190c47['id'],'ListId':_0x190c47['ListId'],'scheduledat':_0x190c47['scheduledat']?_0x190c47[_0x0554('0x17')]:moment()['format'](_0x0554('0x18')),'priority':_0x190c47['priority']?_0x190c47[_0x0554('0x26')]:0x2,'callback':_0x190c47['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x190c47['callbackUniqueid']?_0x190c47[_0x0554('0x28')]:undefined,'callbackat':_0x190c47[_0x0554('0x28')]?moment()[_0x0554('0x27')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x5ecc7e['id']})[_0x0554('0x29')](_0x560eb8());}}}});})[_0x0554('0x1b')](function(){return _0x3f137a[_0x0554('0x30')]['findAll']({'attributes':['id'],'include':[{'model':_0x3f137a['CmList'],'as':_0x0554('0x42'),'where':{'id':_0x190c47['ListId']}}]})[_0x0554('0x1b')](function(_0x131971){if(_0x131971){var _0x36e445=[];for(var _0x53eccf=0x0,_0x4a80cb;_0x53eccf<_0x131971['length'];_0x53eccf+=0x1){_0x4a80cb=_0x131971[_0x53eccf][_0x0554('0x15')]({'plain':!![]});_0x3f137a['CmHopperBlack']['create']({'phone':_0x190c47[_0x0554('0xc')],'ContactId':_0x190c47['id'],'ListId':_0x190c47[_0x0554('0x25')],'CampaignId':_0x4a80cb['id']})[_0x0554('0x29')](function(_0x5243a3){logger[_0x0554('0x16')]('cmContact,\x20%s,\x20%s',_0x0554('0x40'),_0x5243a3[_0x0554('0x41')]);});}}});})[_0x0554('0x1b')](function(){_0x230ad3();})[_0x0554('0x29')](function(_0x527328){logger[_0x0554('0x16')](_0x0554('0x3f'),_0x0554('0x40'),_0x527328['message']);_0x230ad3(_0x527328);});}else{_0x230ad3(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x2f35d3,_0x2ad4c3,_0x3b8821){var _0x5581bd=_0x3177cc[_0x0554('0x43')];var _0x3c92bb=_0x2f35d3[_0x0554('0x15')]({'plain':!![]});return _0x5581bd[_0x0554('0x21')][_0x0554('0x36')]({'raw':!![],'where':{'ListId':_0x3c92bb[_0x0554('0x25')],'ContactId':_0x3c92bb['id']}})[_0x0554('0x1b')](function(_0x366803){if(!_['isEmpty'](_0x366803)){var _0x44c707=[];for(var _0xc8c1a=0x0;_0xc8c1a<_0x366803[_0x0554('0x3b')];_0xc8c1a+=0x1){var _0x4ae1fe=_0x5581bd[_0x0554('0x21')][_0x0554('0x44')]({'where':{'ListId':_0x366803[_0xc8c1a][_0x0554('0x25')],'ContactId':_0x366803[_0xc8c1a]['ContactId'],'VoiceQueueId':_0x366803[_0xc8c1a][_0x0554('0x45')],'CampaignId':_0x366803[_0xc8c1a][_0x0554('0x46')]}});_0x44c707[_0x0554('0x47')](_0x4ae1fe);}return BPromise[_0x0554('0x48')](_0x44c707);}})[_0x0554('0x1b')](function(_0xdd3b78){logger[_0x0554('0x49')](_0x0554('0x4a'),util['inspect'](_0xdd3b78,{'showHidden':![],'depth':null}));_0x3b8821();})[_0x0554('0x29')](function(_0xa27562){logger['error'](_0x0554('0x4b'),util[_0x0554('0x2f')](_0xa27562,{'showHidden':![],'depth':null}));_0x3b8821(_0xa27562);});}}});}; \ No newline at end of file +var _0x72c7=['fax','FULLTEXT','utf8mb4','models','get','cmContact','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','utcOffset','add','minutes','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','error','afterCreate','Campaign','timezones','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','dialCheckDuplicateType','CmList','Lists','length','always','outbound','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','findAll','onlyIfOpen','List\x20not\x20found','ContactId','CampaignId','push','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','firstName','lastName','phone','mobile'];(function(_0x16aaef,_0x410651){var _0x1c82ef=function(_0x3d802b){while(--_0x3d802b){_0x16aaef['push'](_0x16aaef['shift']());}};_0x1c82ef(++_0x410651);}(_0x72c7,0x109));var _0x772c=function(_0x3fc9f1,_0x39e46f){_0x3fc9f1=_0x3fc9f1-0x0;var _0x5b7c86=_0x72c7[_0x3fc9f1];return _0x5b7c86;};'use strict';var _=require('lodash');var util=require(_0x772c('0x0'));var logger=require(_0x772c('0x1'))(_0x772c('0x2'));var moment=require(_0x772c('0x3'));var BPromise=require('bluebird');var rp=require(_0x772c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x772c('0x5'));var config=require('../../config/environment');var shared=require(_0x772c('0x6'));var attributes=require(_0x772c('0x7'));module[_0x772c('0x8')]=function(_0x1c65e8,_0xf4ae6a){return _0x1c65e8[_0x772c('0x9')](_0x772c('0xa'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':'fti_cm_contacts','fields':[_0x772c('0xb'),_0x772c('0xc'),_0x772c('0xd'),_0x772c('0xe'),_0x772c('0xf'),'email'],'type':_0x772c('0x10')}],'timestamps':!![],'charset':_0x772c('0x11'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x4f0e39,_0x5a025b,_0xde6eee){var _0x424d43=_0x1c65e8[_0x772c('0x12')];var _0x1b820d=_0x4f0e39[_0x772c('0x13')]({'plain':!![]});function _0x70d224(){return function(_0x58be90){logger['error'](_0x772c('0x14'),'afterCreate',util[_0x772c('0x15')](_0x58be90,{'showHidden':![],'depth':null}));};}function _0x2e5e4e(_0x3751ee,_0x1e022b){var _0x4cc01d=_0x1e022b[_0x772c('0x16')]?_0x1e022b['scheduledat']:moment()[_0x772c('0x17')](_0x772c('0x18'));return new BPromise(function(_0x430b8c,_0x46ec01){if(_[_0x772c('0x19')](_0x1e022b[_0x772c('0x1a')])){_0x430b8c({'ret':_0x4cc01d});}else{_0x424d43[_0x772c('0x1b')][_0x772c('0x1c')]({'where':{'id':_0x3751ee['id']}})[_0x772c('0x1d')](function(_0x70da8f){if(!_[_0x772c('0x19')](_0x70da8f)){var _0x5d4820=_0x70da8f[_0x772c('0x1a')];if(!_[_0x772c('0x19')](_0x5d4820)){var _0x394264=shared['timezones'];var _0x1c1107=_0x394264[_0x5d4820];var _0x95d23e=_0x394264[_0x1e022b['dialTimezone']];if(!_[_0x772c('0x19')](_0x1c1107)&&!_[_0x772c('0x19')](_0x95d23e)){var _0x49e7d5=_0x1c1107[_0x772c('0x1e')]-_0x95d23e[_0x772c('0x1e')];_0x4cc01d=_0x1e022b[_0x772c('0x16')]?_0x1e022b[_0x772c('0x16')]:moment();var _0x459fcb=moment(_0x4cc01d)[_0x772c('0x1f')](_0x49e7d5,_0x772c('0x20'));_0x430b8c({'ret':_0x459fcb['format'](_0x772c('0x18'))});}else _0x430b8c({'ret':_0x4cc01d});}else _0x430b8c({'ret':_0x4cc01d});}else{_0x430b8c({'ret':_0x4cc01d});}});}});return 0xa;}var _0x4919c1=function(_0x14e634){return new BPromise(function(_0x17f54e,_0x4551d9){_0x2e5e4e(_0x14e634,_0x1b820d)[_0x772c('0x1d')](function(_0x4ed412){_0x1b820d[_0x772c('0x16')]=_0x4ed412['ret'];_0x424d43[_0x772c('0x21')][_0x772c('0x1c')]({'where':{'phone':_0x1b820d[_0x772c('0xd')],'VoiceQueueId':_0x14e634['id']}})[_0x772c('0x1d')](function(_0x15e6f2){if(!_[_0x772c('0x19')](_0x15e6f2)){throw new Error(_0x772c('0x22')+_0x1b820d[_0x772c('0xd')]+_0x772c('0x23')+_0x14e634['id']);}return _0x424d43[_0x772c('0x21')][_0x772c('0x24')]({'phone':_0x1b820d[_0x772c('0xd')],'ContactId':_0x1b820d['id'],'ListId':_0x1b820d[_0x772c('0x25')],'priority':_0x1b820d[_0x772c('0x26')]?_0x1b820d[_0x772c('0x26')]:0x2,'scheduledat':_0x1b820d['scheduledat']?_0x1b820d[_0x772c('0x16')]:moment()['format'](_0x772c('0x18')),'callback':_0x1b820d[_0x772c('0x27')]?!![]:![],'callbackuniqueid':_0x1b820d['callbackUniqueid']?_0x1b820d[_0x772c('0x27')]:undefined,'callbackat':_0x1b820d[_0x772c('0x27')]?moment()[_0x772c('0x17')](_0x772c('0x18')):undefined,'VoiceQueueId':_0x14e634['id']});})[_0x772c('0x28')](function(_0x288a0a){_0x4551d9(_0x288a0a);});});});};var _0x360a00=function(_0x5990f8){return new BPromise(function(_0x5b3750,_0x5674db){_0x2e5e4e(_0x5990f8,_0x1b820d)['then'](function(_0x540c56){_0x1b820d[_0x772c('0x16')]=_0x540c56['ret'];_0x424d43[_0x772c('0x21')][_0x772c('0x1c')]({'where':{'phone':_0x1b820d['phone'],'VoiceQueueId':_0x5990f8['id']}})[_0x772c('0x1d')](function(_0x4d4127){if(!_['isNil'](_0x4d4127)){throw new Error(_0x772c('0x22')+_0x1b820d[_0x772c('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x5990f8['id']);}return _0x424d43[_0x772c('0x29')][_0x772c('0x1c')]({'where':{'calleridnum':_0x1b820d[_0x772c('0xd')],'VoiceQueueId':_0x5990f8['id']}});})[_0x772c('0x1d')](function(_0x3b76db){if(!_[_0x772c('0x19')](_0x3b76db)){throw new Error(_0x772c('0x2a')+_0x1b820d[_0x772c('0xd')]+_0x772c('0x2b')+_0x5990f8['id']);}return _0x424d43['CmHopper']['create']({'phone':_0x1b820d[_0x772c('0xd')],'ContactId':_0x1b820d['id'],'ListId':_0x1b820d[_0x772c('0x25')],'priority':_0x1b820d['priority']?_0x1b820d[_0x772c('0x26')]:0x2,'scheduledat':_0x1b820d['scheduledat']?_0x1b820d['scheduledat']:moment()[_0x772c('0x17')](_0x772c('0x18')),'callback':_0x1b820d[_0x772c('0x27')]?!![]:![],'callbackuniqueid':_0x1b820d[_0x772c('0x27')]?_0x1b820d[_0x772c('0x27')]:undefined,'callbackat':_0x1b820d['callbackUniqueid']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x5990f8['id']});})['catch'](function(_0x426783){_0x5674db(_0x426783);});});});};function _0x30bd6f(){return function(_0x4a8465){logger[_0x772c('0x2c')](_0x772c('0x14'),_0x772c('0x2d'),util[_0x772c('0x15')](_0x4a8465,{'showHidden':![],'depth':null}));};}function _0x304a00(_0x12fe99,_0x130410){var _0x5a370b=_0x130410[_0x772c('0x16')]?_0x130410['scheduledat']:moment()[_0x772c('0x17')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0xe550d4,_0x444584){if(_[_0x772c('0x19')](_0x130410[_0x772c('0x1a')])){_0xe550d4({'ret':_0x5a370b});}else{_0x424d43[_0x772c('0x2e')]['findOne']({'where':{'id':_0x12fe99['id']}})['then'](function(_0x53166f){if(!_[_0x772c('0x19')](_0x53166f)){var _0x17eb8f=_0x53166f[_0x772c('0x1a')];if(!_['isNil'](_0x17eb8f)){var _0x562454=shared[_0x772c('0x2f')];var _0x2619ae=_0x562454[_0x17eb8f];var _0x12223f=_0x562454[_0x130410[_0x772c('0x1a')]];if(!_['isNil'](_0x2619ae)&&!_['isNil'](_0x12223f)){var _0x463e1e=_0x2619ae[_0x772c('0x1e')]-_0x12223f[_0x772c('0x1e')];_0x5a370b=_0x130410['scheduledat']?_0x130410['scheduledat']:moment();var _0x2317ca=moment(_0x5a370b)['add'](_0x463e1e,_0x772c('0x20'));_0xe550d4({'ret':_0x2317ca['format'](_0x772c('0x18'))});}else _0xe550d4({'ret':_0x5a370b});}else _0xe550d4({'ret':_0x5a370b});}else{_0xe550d4({'ret':_0x5a370b});}});}});return 0xa;}var _0xd8aadd=function(_0x3c21b5){return new BPromise(function(_0xff8f6a,_0x1a3a9b){_0x304a00(_0x3c21b5,_0x1b820d)[_0x772c('0x1d')](function(_0x17d4d4){_0x1b820d['scheduledat']=_0x17d4d4[_0x772c('0x30')];_0x424d43['CmHopper'][_0x772c('0x1c')]({'where':{'phone':_0x1b820d[_0x772c('0xd')],'CampaignId':_0x3c21b5['id']}})[_0x772c('0x1d')](function(_0x3adc9e){if(!_['isNil'](_0x3adc9e)){throw new Error(_0x772c('0x22')+_0x1b820d[_0x772c('0xd')]+_0x772c('0x31')+_0x3c21b5['id']);}return _0x424d43[_0x772c('0x21')]['create']({'phone':_0x1b820d[_0x772c('0xd')],'ContactId':_0x1b820d['id'],'ListId':_0x1b820d[_0x772c('0x25')],'priority':_0x1b820d['priority']?_0x1b820d[_0x772c('0x26')]:0x2,'scheduledat':_0x1b820d['scheduledat']?_0x1b820d[_0x772c('0x16')]:moment()[_0x772c('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1b820d[_0x772c('0x27')]?!![]:![],'callbackuniqueid':_0x1b820d['callbackUniqueid']?_0x1b820d[_0x772c('0x27')]:undefined,'callbackat':_0x1b820d[_0x772c('0x27')]?moment()[_0x772c('0x17')](_0x772c('0x18')):undefined,'CampaignId':_0x3c21b5['id']});})[_0x772c('0x28')](function(_0x4627e2){_0x1a3a9b(_0x4627e2);});});});};var _0xc0ae99=function(_0x430d6b){return new BPromise(function(_0x3db064,_0x5c92e6){_0x304a00(_0x430d6b,_0x1b820d)[_0x772c('0x1d')](function(_0xff0955){_0x1b820d['scheduledat']=_0xff0955['ret'];_0x424d43['CmHopper'][_0x772c('0x1c')]({'where':{'phone':_0x1b820d['phone'],'CampaignId':_0x430d6b['id']}})[_0x772c('0x1d')](function(_0x9b4230){if(!_['isNil'](_0x9b4230)){throw new Error(_0x772c('0x22')+_0x1b820d[_0x772c('0xd')]+_0x772c('0x32')+_0x430d6b['id']);}return _0x424d43[_0x772c('0x29')][_0x772c('0x1c')]({'where':{'calleridnum':_0x1b820d[_0x772c('0xd')],'CampaignId':_0x430d6b['id']}});})[_0x772c('0x1d')](function(_0x16811e){if(!_[_0x772c('0x19')](_0x16811e)){throw new Error(_0x772c('0x2a')+_0x1b820d[_0x772c('0xd')]+_0x772c('0x33')+_0x430d6b['id']);}return _0x424d43['CmHopper']['create']({'phone':_0x1b820d[_0x772c('0xd')],'ContactId':_0x1b820d['id'],'ListId':_0x1b820d[_0x772c('0x25')],'priority':_0x1b820d[_0x772c('0x26')]?_0x1b820d[_0x772c('0x26')]:0x2,'scheduledat':_0x1b820d['scheduledat']?_0x1b820d[_0x772c('0x16')]:moment()[_0x772c('0x17')](_0x772c('0x18')),'callback':_0x1b820d[_0x772c('0x27')]?!![]:![],'callbackuniqueid':_0x1b820d[_0x772c('0x27')]?_0x1b820d[_0x772c('0x27')]:undefined,'callbackat':_0x1b820d[_0x772c('0x27')]?moment()[_0x772c('0x17')](_0x772c('0x18')):undefined,'CampaignId':_0x430d6b['id']});})[_0x772c('0x28')](function(_0x224301){_0x5c92e6(_0x224301);});});});};if(_0x1b820d[_0x772c('0x25')]){_0x424d43['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x772c('0x34'),_0x772c('0x1a')],'include':[{'model':_0x424d43[_0x772c('0x35')],'as':_0x772c('0x36'),'where':{'id':_0x1b820d[_0x772c('0x25')]}}]})[_0x772c('0x1d')](function(_0x2021d1){if(_0x2021d1){var _0x11e49a=[];for(var _0x1f8bc6=0x0,_0x192dad;_0x1f8bc6<_0x2021d1[_0x772c('0x37')];_0x1f8bc6+=0x1){_0x192dad=_0x2021d1[_0x1f8bc6][_0x772c('0x13')]({'plain':!![]});switch(_0x192dad[_0x772c('0x34')]){case _0x772c('0x38'):_0x360a00(_0x192dad)[_0x772c('0x28')](_0x70d224());break;case'onlyIfOpen':_0x4919c1(_0x192dad)['catch'](_0x70d224());break;default:_0x304a00(_0x192dad,_0x1b820d)[_0x772c('0x1d')](function(_0x5c2983){_0x1b820d['scheduledat']=_0x5c2983[_0x772c('0x30')];_0x424d43[_0x772c('0x21')][_0x772c('0x24')]({'phone':_0x1b820d[_0x772c('0xd')],'ContactId':_0x1b820d['id'],'ListId':_0x1b820d[_0x772c('0x25')],'scheduledat':_0x1b820d[_0x772c('0x16')]?_0x1b820d[_0x772c('0x16')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x1b820d[_0x772c('0x26')]?_0x1b820d[_0x772c('0x26')]:0x2,'callback':_0x1b820d[_0x772c('0x27')]?!![]:![],'callbackuniqueid':_0x1b820d[_0x772c('0x27')]?_0x1b820d[_0x772c('0x27')]:undefined,'callbackat':_0x1b820d[_0x772c('0x27')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x192dad['id']})[_0x772c('0x28')](_0x70d224());});}}}})[_0x772c('0x1d')](function(){return _0x424d43[_0x772c('0x1b')]['findAll']({'where':{'type':_0x772c('0x39')},'attributes':['id'],'include':[{'model':_0x424d43[_0x772c('0x35')],'as':_0x772c('0x3a'),'where':{'id':_0x1b820d[_0x772c('0x25')]}}]})['then'](function(_0x359664){if(_0x359664){var _0x4f1528=[];for(var _0x2b5971=0x0,_0x24a1a0;_0x2b5971<_0x359664[_0x772c('0x37')];_0x2b5971+=0x1){_0x24a1a0=_0x359664[_0x2b5971]['get']({'plain':!![]});_0x424d43[_0x772c('0x3b')]['create']({'phone':_0x1b820d[_0x772c('0xd')],'ContactId':_0x1b820d['id'],'ListId':_0x1b820d[_0x772c('0x25')],'VoiceQueueId':_0x24a1a0['id']})['catch'](function(_0x5df53f){logger[_0x772c('0x2c')](_0x772c('0x3c'),'afterCreate',_0x5df53f[_0x772c('0x3d')]);});}}});})[_0x772c('0x1d')](function(){return _0x424d43[_0x772c('0x2e')][_0x772c('0x3e')]({'attributes':['id','dialCheckDuplicateType',_0x772c('0x1a')],'include':[{'model':_0x424d43[_0x772c('0x35')],'as':_0x772c('0x36'),'where':{'id':_0x1b820d[_0x772c('0x25')]}}]})[_0x772c('0x1d')](function(_0x38eced){if(_0x38eced){var _0x1c940d=[];for(var _0x210244=0x0,_0x10561a;_0x210244<_0x38eced[_0x772c('0x37')];_0x210244+=0x1){_0x10561a=_0x38eced[_0x210244][_0x772c('0x13')]({'plain':!![]});switch(_0x10561a[_0x772c('0x34')]){case'always':_0xc0ae99(_0x10561a)['catch'](_0x30bd6f());break;case _0x772c('0x3f'):_0xd8aadd(_0x10561a)[_0x772c('0x28')](_0x30bd6f());break;default:_0x424d43[_0x772c('0x21')][_0x772c('0x24')]({'phone':_0x1b820d[_0x772c('0xd')],'ContactId':_0x1b820d['id'],'ListId':_0x1b820d[_0x772c('0x25')],'scheduledat':_0x1b820d[_0x772c('0x16')]?_0x1b820d['scheduledat']:moment()[_0x772c('0x17')](_0x772c('0x18')),'priority':_0x1b820d[_0x772c('0x26')]?_0x1b820d[_0x772c('0x26')]:0x2,'callback':_0x1b820d[_0x772c('0x27')]?!![]:![],'callbackuniqueid':_0x1b820d[_0x772c('0x27')]?_0x1b820d[_0x772c('0x27')]:undefined,'callbackat':_0x1b820d[_0x772c('0x27')]?moment()[_0x772c('0x17')](_0x772c('0x18')):undefined,'CampaignId':_0x10561a['id']})['catch'](_0x30bd6f());}}}});})['then'](function(){return _0x424d43['Campaign']['findAll']({'attributes':['id'],'include':[{'model':_0x424d43[_0x772c('0x35')],'as':_0x772c('0x3a'),'where':{'id':_0x1b820d[_0x772c('0x25')]}}]})[_0x772c('0x1d')](function(_0x3e98d8){if(_0x3e98d8){var _0x4661dc=[];for(var _0x53f981=0x0,_0x1b36ef;_0x53f981<_0x3e98d8[_0x772c('0x37')];_0x53f981+=0x1){_0x1b36ef=_0x3e98d8[_0x53f981][_0x772c('0x13')]({'plain':!![]});_0x424d43[_0x772c('0x3b')][_0x772c('0x24')]({'phone':_0x1b820d[_0x772c('0xd')],'ContactId':_0x1b820d['id'],'ListId':_0x1b820d[_0x772c('0x25')],'CampaignId':_0x1b36ef['id']})['catch'](function(_0x1abe85){logger['error'](_0x772c('0x3c'),_0x772c('0x2d'),_0x1abe85[_0x772c('0x3d')]);});}}});})[_0x772c('0x1d')](function(){_0xde6eee();})[_0x772c('0x28')](function(_0xcaef78){logger[_0x772c('0x2c')](_0x772c('0x3c'),_0x772c('0x2d'),_0xcaef78['message']);_0xde6eee(_0xcaef78);});}else{_0xde6eee(new Error(_0x772c('0x40')));}},'afterDestroy':function(_0x13161f,_0x2ece24,_0x501f85){var _0x489c1b=_0x1c65e8[_0x772c('0x12')];var _0x179d19=_0x13161f['get']({'plain':!![]});return _0x489c1b[_0x772c('0x21')][_0x772c('0x3e')]({'raw':!![],'where':{'ListId':_0x179d19[_0x772c('0x25')],'ContactId':_0x179d19['id']}})[_0x772c('0x1d')](function(_0x1cc5fc){if(!_['isEmpty'](_0x1cc5fc)){var _0x55ca89=[];for(var _0x135e14=0x0;_0x135e14<_0x1cc5fc['length'];_0x135e14+=0x1){var _0x4bc630=_0x489c1b['CmHopper']['destroy']({'where':{'ListId':_0x1cc5fc[_0x135e14][_0x772c('0x25')],'ContactId':_0x1cc5fc[_0x135e14][_0x772c('0x41')],'VoiceQueueId':_0x1cc5fc[_0x135e14]['VoiceQueueId'],'CampaignId':_0x1cc5fc[_0x135e14][_0x772c('0x42')]}});_0x55ca89[_0x772c('0x43')](_0x4bc630);}return BPromise['all'](_0x55ca89);}})[_0x772c('0x1d')](function(_0x3c8f93){logger['info'](_0x772c('0x44'),util[_0x772c('0x15')](_0x3c8f93,{'showHidden':![],'depth':null}));_0x501f85();})['catch'](function(_0xf66709){logger[_0x772c('0x2c')](_0x772c('0x45'),util['inspect'](_0xf66709,{'showHidden':![],'depth':null}));_0x501f85(_0xf66709);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index afdd455..0a88663 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x1237c3,_0x55223b){var _0x3f8ab7=function(_0x128fb3){while(--_0x128fb3){_0x1237c3['push'](_0x1237c3['shift']());}};_0x3f8ab7(++_0x55223b);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x5adc21,_0x35442a){var _0x2f7739=function(_0x520188){while(--_0x520188){_0x5adc21['push'](_0x5adc21['shift']());}};_0x2f7739(++_0x35442a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index ce0d3d8..760afd4 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32c0=['exports','STRING','INTEGER','PHONE','sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x32c0,0x1f3));var _0x032c=function(_0x241cb2,_0x2cdb1c){_0x241cb2=_0x241cb2-0x0;var _0x4be3db=_0x32c0[_0x241cb2];return _0x4be3db;};'use strict';var Sequelize=require(_0x032c('0x0'));module[_0x032c('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x032c('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x032c('0x3')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x032c('0x4')},'OrderBy':{'type':Sequelize[_0x032c('0x3')],'defaultValue':null},'description':{'type':Sequelize[_0x032c('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0xac55=['PHONE','sequelize','exports','INTEGER','STRING'];(function(_0x1d7aaa,_0x7ad93e){var _0x1cd0c1=function(_0x2756b2){while(--_0x2756b2){_0x1d7aaa['push'](_0x1d7aaa['shift']());}};_0x1cd0c1(++_0x7ad93e);}(_0xac55,0x1c8));var _0x5ac5=function(_0x1de6e6,_0x23eb96){_0x1de6e6=_0x1de6e6-0x0;var _0x372855=_0xac55[_0x1de6e6];return _0x372855;};'use strict';var Sequelize=require(_0x5ac5('0x0'));module[_0x5ac5('0x1')]={'CmContactId':{'type':Sequelize[_0x5ac5('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x5ac5('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x5ac5('0x3')],'defaultValue':_0x5ac5('0x4')},'OrderBy':{'type':Sequelize[_0x5ac5('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x5ac5('0x3')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 01ada71..b377278 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44cc=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','apply','reject','update','then','destroy','get','CmContactHasItems','error','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','keys','catch','create','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x44cc,0x188));var _0xc44c=function(_0x1922dc,_0x2f2cdb){_0x1922dc=_0x1922dc-0x0;var _0x3d2695=_0x44cc[_0x1922dc];return _0x3d2695;};'use strict';var emlformat=require(_0xc44c('0x0'));var rimraf=require(_0xc44c('0x1'));var zipdir=require(_0xc44c('0x2'));var jsonpatch=require(_0xc44c('0x3'));var rp=require(_0xc44c('0x4'));var moment=require(_0xc44c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc44c('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc44c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc44c('0x8'));var squel=require(_0xc44c('0x9'));var crypto=require(_0xc44c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc44c('0xb'));var toCsv=require(_0xc44c('0xc'));var querystring=require(_0xc44c('0xd'));var Papa=require(_0xc44c('0xe'));var Redis=require(_0xc44c('0xf'));var authService=require(_0xc44c('0x10'));var qs=require(_0xc44c('0x11'));var as=require(_0xc44c('0x12'));var hardwareService=require(_0xc44c('0x13'));var logger=require(_0xc44c('0x14'))('api');var utils=require(_0xc44c('0x15'));var config=require(_0xc44c('0x16'));var licenseUtil=require(_0xc44c('0x17'));var db=require(_0xc44c('0x18'))['db'];function respondWithStatusCode(_0x2090d8,_0x1c62bc){_0x1c62bc=_0x1c62bc||0xcc;return function(_0x360a9f){if(_0x360a9f){return _0x2090d8['sendStatus'](_0x1c62bc);}return _0x2090d8[_0xc44c('0x19')](_0x1c62bc)[_0xc44c('0x1a')]();};}function respondWithResult(_0x2545af,_0x41284c){_0x41284c=_0x41284c||0xc8;return function(_0x3945a5){if(_0x3945a5){return _0x2545af[_0xc44c('0x19')](_0x41284c)['json'](_0x3945a5);}};}function respondWithFilteredResult(_0x36f721,_0x4fe47f){return function(_0x40ee1d){if(_0x40ee1d){var _0x137b35=typeof _0x4fe47f[_0xc44c('0x1b')]===_0xc44c('0x1c')&&typeof _0x4fe47f['limit']===_0xc44c('0x1c');var _0x3264a2=_0x40ee1d[_0xc44c('0x1d')];var _0x46bac9=_0x137b35?0x0:_0x4fe47f[_0xc44c('0x1b')];var _0x303f21=_0x137b35?_0x40ee1d[_0xc44c('0x1d')]:_0x4fe47f[_0xc44c('0x1b')]+_0x4fe47f[_0xc44c('0x1e')];var _0x2627ce;if(_0x303f21>=_0x3264a2){_0x303f21=_0x3264a2;_0x2627ce=0xc8;}else{_0x2627ce=0xce;}_0x36f721['status'](_0x2627ce);return _0x36f721[_0xc44c('0x1f')]('Content-Range',_0x46bac9+'-'+_0x303f21+'/'+_0x3264a2)['json'](_0x40ee1d);}return null;};}function patchUpdates(_0xf05f8e){return function(_0x3ae050){try{jsonpatch[_0xc44c('0x20')](_0x3ae050,_0xf05f8e,!![]);}catch(_0x56e1a5){return BPromise[_0xc44c('0x21')](_0x56e1a5);}return _0x3ae050['save']();};}function saveUpdates(_0x477abf,_0x76c0ca){return function(_0x2a8f82){if(_0x2a8f82){return _0x2a8f82[_0xc44c('0x22')](_0x477abf)[_0xc44c('0x23')](function(_0x1a68e8){return _0x1a68e8;});}return null;};}function removeEntity(_0x559c95,_0x14f0b7){return function(_0x4fa564){if(_0x4fa564){return _0x4fa564[_0xc44c('0x24')]()[_0xc44c('0x23')](function(){var _0x4009e7=_0x4fa564[_0xc44c('0x25')]({'plain':!![]});var _0x447203=_0xc44c('0x26');return db['UserProfileResource'][_0xc44c('0x24')]({'where':{'type':_0x447203,'resourceId':_0x4009e7['id']}})[_0xc44c('0x23')](function(){return _0x4fa564;});})['then'](function(){_0x559c95[_0xc44c('0x19')](0xcc)[_0xc44c('0x1a')]();});}};}function handleEntityNotFound(_0xe9cdd4,_0x3ae3ef){return function(_0xc87b81){if(!_0xc87b81){_0xe9cdd4['sendStatus'](0x194);}return _0xc87b81;};}function handleError(_0x1f1dee,_0x3a369c){_0x3a369c=_0x3a369c||0x1f4;return function(_0x2edf04){logger[_0xc44c('0x27')](_0x2edf04['stack']);if(_0x2edf04[_0xc44c('0x28')]){delete _0x2edf04[_0xc44c('0x28')];}_0x1f1dee[_0xc44c('0x19')](_0x3a369c)[_0xc44c('0x29')](_0x2edf04);};}exports[_0xc44c('0x2a')]=function(_0x1c81b0,_0x2deee9){var _0x19bf7d={},_0x444ddb={},_0x5c8294={'count':0x0,'rows':[]};var _0xd821a5=_[_0xc44c('0x2b')](db[_0xc44c('0x2c')][_0xc44c('0x2d')],function(_0x2f49cc){return{'name':_0x2f49cc[_0xc44c('0x2e')],'type':_0x2f49cc['type'][_0xc44c('0x2f')]};});_0x444ddb[_0xc44c('0x30')]=_[_0xc44c('0x2b')](_0xd821a5,_0xc44c('0x28'));_0x444ddb[_0xc44c('0x31')]=_['keys'](_0x1c81b0[_0xc44c('0x31')]);_0x444ddb[_0xc44c('0x32')]=_[_0xc44c('0x33')](_0x444ddb[_0xc44c('0x30')],_0x444ddb[_0xc44c('0x31')]);_0x19bf7d['attributes']=_[_0xc44c('0x33')](_0x444ddb[_0xc44c('0x30')],qs[_0xc44c('0x34')](_0x1c81b0['query'][_0xc44c('0x34')]));_0x19bf7d['attributes']=_0x19bf7d[_0xc44c('0x35')][_0xc44c('0x36')]?_0x19bf7d[_0xc44c('0x35')]:_0x444ddb['model'];if(!_0x1c81b0[_0xc44c('0x31')][_0xc44c('0x37')](_0xc44c('0x38'))){_0x19bf7d[_0xc44c('0x1e')]=qs[_0xc44c('0x1e')](_0x1c81b0[_0xc44c('0x31')][_0xc44c('0x1e')]);_0x19bf7d[_0xc44c('0x1b')]=qs[_0xc44c('0x1b')](_0x1c81b0[_0xc44c('0x31')]['offset']);}_0x19bf7d['order']=qs[_0xc44c('0x39')](_0x1c81b0['query'][_0xc44c('0x39')]);_0x19bf7d[_0xc44c('0x3a')]=qs[_0xc44c('0x32')](_[_0xc44c('0x3b')](_0x1c81b0[_0xc44c('0x31')],_0x444ddb[_0xc44c('0x32')]),_0xd821a5);if(_0x1c81b0['query']['filter']){_0x19bf7d[_0xc44c('0x3a')]=_[_0xc44c('0x3c')](_0x19bf7d[_0xc44c('0x3a')],{'$or':_[_0xc44c('0x2b')](_0xd821a5,function(_0x13a6ea){if(_0x13a6ea[_0xc44c('0x3d')]!==_0xc44c('0x3e')){var _0x4262f8={};_0x4262f8[_0x13a6ea[_0xc44c('0x28')]]={'$like':'%'+_0x1c81b0[_0xc44c('0x31')][_0xc44c('0x3f')]+'%'};return _0x4262f8;}})});}_0x19bf7d=_[_0xc44c('0x3c')]({},_0x19bf7d,_0x1c81b0[_0xc44c('0x40')]);var _0x219d2b={'where':_0x19bf7d[_0xc44c('0x3a')]};return db[_0xc44c('0x2c')][_0xc44c('0x1d')](_0x219d2b)[_0xc44c('0x23')](function(_0x212b5e){_0x5c8294['count']=_0x212b5e;if(_0x1c81b0[_0xc44c('0x31')][_0xc44c('0x41')]){_0x19bf7d[_0xc44c('0x42')]=[{'all':!![]}];}return db[_0xc44c('0x2c')][_0xc44c('0x43')](_0x19bf7d);})[_0xc44c('0x23')](function(_0x468e13){_0x5c8294[_0xc44c('0x44')]=_0x468e13;return _0x5c8294;})[_0xc44c('0x23')](respondWithFilteredResult(_0x2deee9,_0x19bf7d))['catch'](handleError(_0x2deee9,null));};exports[_0xc44c('0x45')]=function(_0x2764d0,_0x2a3025){var _0x24c2d3={'raw':!![],'where':{'id':_0x2764d0['params']['id']}},_0x1564e6={};_0x1564e6[_0xc44c('0x30')]=_['keys'](db['CmContactHasItem']['rawAttributes']);_0x1564e6[_0xc44c('0x31')]=_[_0xc44c('0x46')](_0x2764d0[_0xc44c('0x31')]);_0x1564e6[_0xc44c('0x32')]=_['intersection'](_0x1564e6[_0xc44c('0x30')],_0x1564e6['query']);_0x24c2d3['attributes']=_[_0xc44c('0x33')](_0x1564e6[_0xc44c('0x30')],qs[_0xc44c('0x34')](_0x2764d0['query'][_0xc44c('0x34')]));_0x24c2d3['attributes']=_0x24c2d3[_0xc44c('0x35')][_0xc44c('0x36')]?_0x24c2d3[_0xc44c('0x35')]:_0x1564e6[_0xc44c('0x30')];if(_0x2764d0[_0xc44c('0x31')][_0xc44c('0x41')]){_0x24c2d3['include']=[{'all':!![]}];}_0x24c2d3=_['merge']({},_0x24c2d3,_0x2764d0[_0xc44c('0x40')]);return db[_0xc44c('0x2c')]['find'](_0x24c2d3)[_0xc44c('0x23')](handleEntityNotFound(_0x2a3025,null))[_0xc44c('0x23')](respondWithResult(_0x2a3025,null))[_0xc44c('0x47')](handleError(_0x2a3025,null));};exports[_0xc44c('0x48')]=function(_0x5cf252,_0xa3f971){return db[_0xc44c('0x2c')][_0xc44c('0x48')](_0x5cf252['body'],{})[_0xc44c('0x23')](function(_0x167ff0){var _0x51d1c9=_0x5cf252[_0xc44c('0x49')][_0xc44c('0x25')]({'plain':!![]});if(!_0x51d1c9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51d1c9['role']===_0xc44c('0x49')){var _0x37d0a8=_0x167ff0[_0xc44c('0x25')]({'plain':!![]});var _0x1fc50a=_0xc44c('0x26');return db[_0xc44c('0x4a')][_0xc44c('0x4b')]({'where':{'name':_0x1fc50a,'userProfileId':_0x51d1c9[_0xc44c('0x4c')]},'raw':!![]})[_0xc44c('0x23')](function(_0x2b9ba0){if(_0x2b9ba0&&_0x2b9ba0[_0xc44c('0x4d')]===0x0){return db[_0xc44c('0x4e')][_0xc44c('0x48')]({'name':_0x37d0a8[_0xc44c('0x28')],'resourceId':_0x37d0a8['id'],'type':_0x2b9ba0['name'],'sectionId':_0x2b9ba0['id']},{})[_0xc44c('0x23')](function(){return _0x167ff0;});}else{return _0x167ff0;}})[_0xc44c('0x47')](function(_0x5ba6cf){logger[_0xc44c('0x27')](_0xc44c('0x4f'),_0x5ba6cf);throw _0x5ba6cf;});}return _0x167ff0;})['then'](respondWithResult(_0xa3f971,0xc9))[_0xc44c('0x47')](handleError(_0xa3f971,null));};exports[_0xc44c('0x22')]=function(_0x3bbb9f,_0xb965d2){if(_0x3bbb9f['body']['id']){delete _0x3bbb9f[_0xc44c('0x50')]['id'];}return db['CmContactHasItem']['find']({'where':{'id':_0x3bbb9f['params']['id']}})[_0xc44c('0x23')](handleEntityNotFound(_0xb965d2,null))['then'](saveUpdates(_0x3bbb9f[_0xc44c('0x50')],null))[_0xc44c('0x23')](respondWithResult(_0xb965d2,null))['catch'](handleError(_0xb965d2,null));};exports[_0xc44c('0x24')]=function(_0x16f0b0,_0x467604){return db[_0xc44c('0x2c')][_0xc44c('0x4b')]({'where':{'id':_0x16f0b0[_0xc44c('0x51')]['id']}})['then'](handleEntityNotFound(_0x467604,null))[_0xc44c('0x23')](removeEntity(_0x467604,null))['catch'](handleError(_0x467604,null));}; \ No newline at end of file +var _0xaa5e=['fieldName','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','CmContactHasItems','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','apply','reject','update','then','destroy','get','sendStatus','stack','name','send','index','map','CmContactHasItem','rawAttributes'];(function(_0x2b88e1,_0x12b3d2){var _0x49b799=function(_0x3ed21a){while(--_0x3ed21a){_0x2b88e1['push'](_0x2b88e1['shift']());}};_0x49b799(++_0x12b3d2);}(_0xaa5e,0x168));var _0xeaa5=function(_0x173a13,_0x4d7a1d){_0x173a13=_0x173a13-0x0;var _0x289ac2=_0xaa5e[_0x173a13];return _0x289ac2;};'use strict';var emlformat=require(_0xeaa5('0x0'));var rimraf=require(_0xeaa5('0x1'));var zipdir=require(_0xeaa5('0x2'));var jsonpatch=require(_0xeaa5('0x3'));var rp=require('request-promise');var moment=require(_0xeaa5('0x4'));var BPromise=require(_0xeaa5('0x5'));var Mustache=require('mustache');var util=require(_0xeaa5('0x6'));var path=require('path');var sox=require(_0xeaa5('0x7'));var csv=require(_0xeaa5('0x8'));var ejs=require(_0xeaa5('0x9'));var fs=require('fs');var fs_extra=require(_0xeaa5('0xa'));var _=require(_0xeaa5('0xb'));var squel=require('squel');var crypto=require(_0xeaa5('0xc'));var jsforce=require(_0xeaa5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xeaa5('0x8'));var querystring=require('querystring');var Papa=require(_0xeaa5('0xe'));var Redis=require(_0xeaa5('0xf'));var authService=require(_0xeaa5('0x10'));var qs=require(_0xeaa5('0x11'));var as=require(_0xeaa5('0x12'));var hardwareService=require(_0xeaa5('0x13'));var logger=require(_0xeaa5('0x14'))(_0xeaa5('0x15'));var utils=require(_0xeaa5('0x16'));var config=require(_0xeaa5('0x17'));var licenseUtil=require(_0xeaa5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dc2d,_0x743a2b){_0x743a2b=_0x743a2b||0xcc;return function(_0x122243){if(_0x122243){return _0x5dc2d['sendStatus'](_0x743a2b);}return _0x5dc2d[_0xeaa5('0x19')](_0x743a2b)[_0xeaa5('0x1a')]();};}function respondWithResult(_0x2d489b,_0x1bd0ed){_0x1bd0ed=_0x1bd0ed||0xc8;return function(_0x40cfbb){if(_0x40cfbb){return _0x2d489b[_0xeaa5('0x19')](_0x1bd0ed)['json'](_0x40cfbb);}};}function respondWithFilteredResult(_0x2333a4,_0x13fffd){return function(_0x42a1c8){if(_0x42a1c8){var _0x100e7a=typeof _0x13fffd[_0xeaa5('0x1b')]===_0xeaa5('0x1c')&&typeof _0x13fffd[_0xeaa5('0x1d')]===_0xeaa5('0x1c');var _0x3708e1=_0x42a1c8[_0xeaa5('0x1e')];var _0x555030=_0x100e7a?0x0:_0x13fffd['offset'];var _0x38e2af=_0x100e7a?_0x42a1c8[_0xeaa5('0x1e')]:_0x13fffd[_0xeaa5('0x1b')]+_0x13fffd[_0xeaa5('0x1d')];var _0x18d6f2;if(_0x38e2af>=_0x3708e1){_0x38e2af=_0x3708e1;_0x18d6f2=0xc8;}else{_0x18d6f2=0xce;}_0x2333a4[_0xeaa5('0x19')](_0x18d6f2);return _0x2333a4['set']('Content-Range',_0x555030+'-'+_0x38e2af+'/'+_0x3708e1)['json'](_0x42a1c8);}return null;};}function patchUpdates(_0x3aa8f8){return function(_0x5c86a9){try{jsonpatch[_0xeaa5('0x1f')](_0x5c86a9,_0x3aa8f8,!![]);}catch(_0x3a9c84){return BPromise[_0xeaa5('0x20')](_0x3a9c84);}return _0x5c86a9['save']();};}function saveUpdates(_0x4b02aa,_0x29c52a){return function(_0x6f86fb){if(_0x6f86fb){return _0x6f86fb[_0xeaa5('0x21')](_0x4b02aa)[_0xeaa5('0x22')](function(_0x4e65f5){return _0x4e65f5;});}return null;};}function removeEntity(_0x34a798,_0x5a89db){return function(_0x239413){if(_0x239413){return _0x239413[_0xeaa5('0x23')]()['then'](function(){var _0x196aaa=_0x239413[_0xeaa5('0x24')]({'plain':!![]});var _0x5500f8='CmContactHasItems';return db['UserProfileResource'][_0xeaa5('0x23')]({'where':{'type':_0x5500f8,'resourceId':_0x196aaa['id']}})[_0xeaa5('0x22')](function(){return _0x239413;});})[_0xeaa5('0x22')](function(){_0x34a798[_0xeaa5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af189,_0xfd98e5){return function(_0x5c031f){if(!_0x5c031f){_0x4af189[_0xeaa5('0x25')](0x194);}return _0x5c031f;};}function handleError(_0xa0a514,_0x1853b5){_0x1853b5=_0x1853b5||0x1f4;return function(_0x70a71a){logger['error'](_0x70a71a[_0xeaa5('0x26')]);if(_0x70a71a['name']){delete _0x70a71a[_0xeaa5('0x27')];}_0xa0a514[_0xeaa5('0x19')](_0x1853b5)[_0xeaa5('0x28')](_0x70a71a);};}exports[_0xeaa5('0x29')]=function(_0x46657e,_0x13d961){var _0x42c3df={},_0x200eb7={},_0x59d98e={'count':0x0,'rows':[]};var _0x5c5ea0=_[_0xeaa5('0x2a')](db[_0xeaa5('0x2b')][_0xeaa5('0x2c')],function(_0x3fcd1e){return{'name':_0x3fcd1e[_0xeaa5('0x2d')],'type':_0x3fcd1e['type']['key']};});_0x200eb7['model']=_[_0xeaa5('0x2a')](_0x5c5ea0,'name');_0x200eb7[_0xeaa5('0x2e')]=_[_0xeaa5('0x2f')](_0x46657e[_0xeaa5('0x2e')]);_0x200eb7['filters']=_[_0xeaa5('0x30')](_0x200eb7[_0xeaa5('0x31')],_0x200eb7['query']);_0x42c3df[_0xeaa5('0x32')]=_[_0xeaa5('0x30')](_0x200eb7[_0xeaa5('0x31')],qs[_0xeaa5('0x33')](_0x46657e[_0xeaa5('0x2e')]['fields']));_0x42c3df[_0xeaa5('0x32')]=_0x42c3df[_0xeaa5('0x32')][_0xeaa5('0x34')]?_0x42c3df[_0xeaa5('0x32')]:_0x200eb7[_0xeaa5('0x31')];if(!_0x46657e[_0xeaa5('0x2e')][_0xeaa5('0x35')](_0xeaa5('0x36'))){_0x42c3df[_0xeaa5('0x1d')]=qs[_0xeaa5('0x1d')](_0x46657e['query'][_0xeaa5('0x1d')]);_0x42c3df['offset']=qs[_0xeaa5('0x1b')](_0x46657e[_0xeaa5('0x2e')]['offset']);}_0x42c3df['order']=qs['sort'](_0x46657e[_0xeaa5('0x2e')][_0xeaa5('0x37')]);_0x42c3df[_0xeaa5('0x38')]=qs['filters'](_[_0xeaa5('0x39')](_0x46657e[_0xeaa5('0x2e')],_0x200eb7[_0xeaa5('0x3a')]),_0x5c5ea0);if(_0x46657e[_0xeaa5('0x2e')][_0xeaa5('0x3b')]){_0x42c3df[_0xeaa5('0x38')]=_[_0xeaa5('0x3c')](_0x42c3df[_0xeaa5('0x38')],{'$or':_['map'](_0x5c5ea0,function(_0x53b1e4){if(_0x53b1e4['type']!==_0xeaa5('0x3d')){var _0x3833bb={};_0x3833bb[_0x53b1e4[_0xeaa5('0x27')]]={'$like':'%'+_0x46657e[_0xeaa5('0x2e')][_0xeaa5('0x3b')]+'%'};return _0x3833bb;}})});}_0x42c3df=_['merge']({},_0x42c3df,_0x46657e[_0xeaa5('0x3e')]);var _0x3ede08={'where':_0x42c3df['where']};return db['CmContactHasItem'][_0xeaa5('0x1e')](_0x3ede08)['then'](function(_0x434911){_0x59d98e['count']=_0x434911;if(_0x46657e[_0xeaa5('0x2e')][_0xeaa5('0x3f')]){_0x42c3df[_0xeaa5('0x40')]=[{'all':!![]}];}return db['CmContactHasItem'][_0xeaa5('0x41')](_0x42c3df);})[_0xeaa5('0x22')](function(_0x29fec1){_0x59d98e[_0xeaa5('0x42')]=_0x29fec1;return _0x59d98e;})[_0xeaa5('0x22')](respondWithFilteredResult(_0x13d961,_0x42c3df))[_0xeaa5('0x43')](handleError(_0x13d961,null));};exports[_0xeaa5('0x44')]=function(_0x1f5143,_0x1b7d46){var _0x329288={'raw':!![],'where':{'id':_0x1f5143[_0xeaa5('0x45')]['id']}},_0xbdf509={};_0xbdf509[_0xeaa5('0x31')]=_['keys'](db[_0xeaa5('0x2b')][_0xeaa5('0x2c')]);_0xbdf509['query']=_[_0xeaa5('0x2f')](_0x1f5143[_0xeaa5('0x2e')]);_0xbdf509[_0xeaa5('0x3a')]=_[_0xeaa5('0x30')](_0xbdf509[_0xeaa5('0x31')],_0xbdf509[_0xeaa5('0x2e')]);_0x329288[_0xeaa5('0x32')]=_['intersection'](_0xbdf509[_0xeaa5('0x31')],qs['fields'](_0x1f5143[_0xeaa5('0x2e')]['fields']));_0x329288[_0xeaa5('0x32')]=_0x329288[_0xeaa5('0x32')][_0xeaa5('0x34')]?_0x329288[_0xeaa5('0x32')]:_0xbdf509[_0xeaa5('0x31')];if(_0x1f5143[_0xeaa5('0x2e')][_0xeaa5('0x3f')]){_0x329288[_0xeaa5('0x40')]=[{'all':!![]}];}_0x329288=_['merge']({},_0x329288,_0x1f5143['options']);return db['CmContactHasItem'][_0xeaa5('0x46')](_0x329288)['then'](handleEntityNotFound(_0x1b7d46,null))[_0xeaa5('0x22')](respondWithResult(_0x1b7d46,null))[_0xeaa5('0x43')](handleError(_0x1b7d46,null));};exports[_0xeaa5('0x47')]=function(_0x464319,_0x2971e){return db['CmContactHasItem']['create'](_0x464319[_0xeaa5('0x48')],{})[_0xeaa5('0x22')](function(_0x2f6846){var _0x2ceed0=_0x464319['user'][_0xeaa5('0x24')]({'plain':!![]});if(!_0x2ceed0)throw new Error(_0xeaa5('0x49'));if(_0x2ceed0['role']===_0xeaa5('0x4a')){var _0x4c7fba=_0x2f6846[_0xeaa5('0x24')]({'plain':!![]});var _0x5c8b7d=_0xeaa5('0x4b');return db['UserProfileSection'][_0xeaa5('0x46')]({'where':{'name':_0x5c8b7d,'userProfileId':_0x2ceed0[_0xeaa5('0x4c')]},'raw':!![]})[_0xeaa5('0x22')](function(_0x351c13){if(_0x351c13&&_0x351c13[_0xeaa5('0x4d')]===0x0){return db[_0xeaa5('0x4e')][_0xeaa5('0x47')]({'name':_0x4c7fba[_0xeaa5('0x27')],'resourceId':_0x4c7fba['id'],'type':_0x351c13[_0xeaa5('0x27')],'sectionId':_0x351c13['id']},{})['then'](function(){return _0x2f6846;});}else{return _0x2f6846;}})[_0xeaa5('0x43')](function(_0x4b9be7){logger[_0xeaa5('0x4f')](_0xeaa5('0x50'),_0x4b9be7);throw _0x4b9be7;});}return _0x2f6846;})[_0xeaa5('0x22')](respondWithResult(_0x2971e,0xc9))[_0xeaa5('0x43')](handleError(_0x2971e,null));};exports['update']=function(_0x3a95fa,_0x3b5625){if(_0x3a95fa[_0xeaa5('0x48')]['id']){delete _0x3a95fa[_0xeaa5('0x48')]['id'];}return db[_0xeaa5('0x2b')][_0xeaa5('0x46')]({'where':{'id':_0x3a95fa['params']['id']}})['then'](handleEntityNotFound(_0x3b5625,null))[_0xeaa5('0x22')](saveUpdates(_0x3a95fa[_0xeaa5('0x48')],null))[_0xeaa5('0x22')](respondWithResult(_0x3b5625,null))[_0xeaa5('0x43')](handleError(_0x3b5625,null));};exports[_0xeaa5('0x23')]=function(_0x35bcda,_0x35ce01){return db[_0xeaa5('0x2b')][_0xeaa5('0x46')]({'where':{'id':_0x35bcda[_0xeaa5('0x45')]['id']}})[_0xeaa5('0x22')](handleEntityNotFound(_0x35ce01,null))['then'](removeEntity(_0x35ce01,null))['catch'](handleError(_0x35ce01,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 314fc70..348c4d1 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x502a=['bluebird','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','moment'];(function(_0x33519a,_0x4f7d3a){var _0x551e54=function(_0x3d1c83){while(--_0x3d1c83){_0x33519a['push'](_0x33519a['shift']());}};_0x551e54(++_0x4f7d3a);}(_0x502a,0xbf));var _0xa502=function(_0x1383e1,_0xc41417){_0x1383e1=_0x1383e1-0x0;var _0x50d5eb=_0x502a[_0x1383e1];return _0x50d5eb;};'use strict';var _=require(_0xa502('0x0'));var util=require(_0xa502('0x1'));var logger=require(_0xa502('0x2'))(_0xa502('0x3'));var moment=require(_0xa502('0x4'));var BPromise=require(_0xa502('0x5'));var rp=require(_0xa502('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa502('0x7'));var config=require(_0xa502('0x8'));var attributes=require(_0xa502('0x9'));module[_0xa502('0xa')]=function(_0x122e6d,_0x202234){return _0x122e6d[_0xa502('0xb')](_0xa502('0xc'),attributes,{'tableName':_0xa502('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e23=['define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./cmContactHasItem.attributes','exports'];(function(_0x527a53,_0x3265d6){var _0x2332f5=function(_0x3b2d90){while(--_0x3b2d90){_0x527a53['push'](_0x527a53['shift']());}};_0x2332f5(++_0x3265d6);}(_0x4e23,0x93));var _0x34e2=function(_0x4ea9f4,_0x57a270){_0x4ea9f4=_0x4ea9f4-0x0;var _0x3ad434=_0x4e23[_0x4ea9f4];return _0x3ad434;};'use strict';var _=require(_0x34e2('0x0'));var util=require(_0x34e2('0x1'));var logger=require(_0x34e2('0x2'))('api');var moment=require(_0x34e2('0x3'));var BPromise=require(_0x34e2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34e2('0x5'));var rimraf=require(_0x34e2('0x6'));var config=require('../../config/environment');var attributes=require(_0x34e2('0x7'));module[_0x34e2('0x8')]=function(_0x183222,_0x5073fa){return _0x183222[_0x34e2('0x9')](_0x34e2('0xa'),attributes,{'tableName':_0x34e2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 471d1ee..1b68916 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xceaa=['http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client'];(function(_0x15a634,_0x4feb86){var _0xf4f7a0=function(_0x31d9fe){while(--_0x31d9fe){_0x15a634['push'](_0x15a634['shift']());}};_0xf4f7a0(++_0x4feb86);}(_0xceaa,0x19b));var _0xacea=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xceaa[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xacea('0x0'));var util=require('util');var moment=require(_0xacea('0x1'));var BPromise=require(_0xacea('0x2'));var rs=require(_0xacea('0x3'));var fs=require('fs');var Redis=require(_0xacea('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xacea('0x5'))(_0xacea('0x6'));var config=require(_0xacea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xacea('0x8')][_0xacea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1579bb,_0x13dd63,_0xb3dd48){return new BPromise(function(_0x513917,_0x4a7eb2){return client[_0xacea('0xa')](_0x1579bb,_0xb3dd48)[_0xacea('0xb')](function(_0x415ea9){logger[_0xacea('0xc')](_0xacea('0xd'),_0x13dd63,_0xacea('0xe'));logger[_0xacea('0xf')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x13dd63,'request\x20sent',JSON[_0xacea('0x10')](_0x415ea9));if(_0x415ea9[_0xacea('0x11')]){if(_0x415ea9['error']['code']===0x1f4){logger['error'](_0xacea('0xd'),_0x13dd63,_0x415ea9[_0xacea('0x11')][_0xacea('0x12')]);return _0x4a7eb2(_0x415ea9[_0xacea('0x11')][_0xacea('0x12')]);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x13dd63,_0x415ea9[_0xacea('0x11')][_0xacea('0x12')]);return _0x513917(_0x415ea9[_0xacea('0x11')][_0xacea('0x12')]);}else{logger[_0xacea('0xc')](_0xacea('0xd'),_0x13dd63,_0xacea('0xe'));_0x513917(_0x415ea9[_0xacea('0x13')][_0xacea('0x12')]);}})['catch'](function(_0xd1efeb){logger[_0xacea('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x13dd63,_0xd1efeb);_0x4a7eb2(_0xd1efeb);});});} \ No newline at end of file +var _0x56cf=['../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x133319,_0x251e31){var _0x43c3c2=function(_0x1b96a7){while(--_0x1b96a7){_0x133319['push'](_0x133319['shift']());}};_0x43c3c2(++_0x251e31);}(_0x56cf,0x18a));var _0xf56c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56cf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf56c('0x0'));var util=require(_0xf56c('0x1'));var moment=require(_0xf56c('0x2'));var BPromise=require(_0xf56c('0x3'));var rs=require(_0xf56c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf56c('0x5'));var logger=require('../../config/logger')(_0xf56c('0x6'));var config=require(_0xf56c('0x7'));var jayson=require(_0xf56c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ceb15,_0x3c3142,_0x51df3a){return new BPromise(function(_0x51c212,_0x4d85e2){return client[_0xf56c('0x9')](_0x1ceb15,_0x51df3a)[_0xf56c('0xa')](function(_0x5d2958){logger[_0xf56c('0xb')](_0xf56c('0xc'),_0x3c3142,_0xf56c('0xd'));logger[_0xf56c('0xe')](_0xf56c('0xf'),_0x3c3142,_0xf56c('0xd'),JSON['stringify'](_0x5d2958));if(_0x5d2958[_0xf56c('0x10')]){if(_0x5d2958[_0xf56c('0x10')][_0xf56c('0x11')]===0x1f4){logger[_0xf56c('0x10')](_0xf56c('0xc'),_0x3c3142,_0x5d2958[_0xf56c('0x10')]['message']);return _0x4d85e2(_0x5d2958[_0xf56c('0x10')][_0xf56c('0x12')]);}logger[_0xf56c('0x10')](_0xf56c('0xc'),_0x3c3142,_0x5d2958[_0xf56c('0x10')][_0xf56c('0x12')]);return _0x51c212(_0x5d2958['error']['message']);}else{logger['info'](_0xf56c('0xc'),_0x3c3142,'request\x20sent');_0x51c212(_0x5d2958[_0xf56c('0x13')][_0xf56c('0x12')]);}})[_0xf56c('0x14')](function(_0x4b6139){logger[_0xf56c('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x3c3142,_0x4b6139);_0x4d85e2(_0x4b6139);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 125306b..1ce6ccb 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd20=['update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','get','isAuthenticated','create','put','/:id'];(function(_0x4b9978,_0x58eb71){var _0x42f0e5=function(_0x4ff5dc){while(--_0x4ff5dc){_0x4b9978['push'](_0x4b9978['shift']());}};_0x42f0e5(++_0x58eb71);}(_0xfd20,0x154));var _0x0fd2=function(_0x4e33c0,_0x555fda){_0x4e33c0=_0x4e33c0-0x0;var _0x1f7aa3=_0xfd20[_0x4e33c0];return _0x1f7aa3;};'use strict';var multer=require('multer');var util=require(_0x0fd2('0x0'));var path=require('path');var timeout=require(_0x0fd2('0x1'));var express=require(_0x0fd2('0x2'));var router=express[_0x0fd2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0fd2('0x4'));var interaction=require(_0x0fd2('0x5'));var config=require('../../config/environment');var controller=require(_0x0fd2('0x6'));router[_0x0fd2('0x7')]('/',auth[_0x0fd2('0x8')](),controller['index']);router[_0x0fd2('0x7')]('/:id',auth[_0x0fd2('0x8')](),controller['show']);router['post']('/',auth[_0x0fd2('0x8')](),controller[_0x0fd2('0x9')]);router[_0x0fd2('0xa')](_0x0fd2('0xb'),auth[_0x0fd2('0x8')](),controller[_0x0fd2('0xc')]);router[_0x0fd2('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x0fd2('0xe')]);module[_0x0fd2('0xf')]=router; \ No newline at end of file +var _0x13e6=['../../config/environment','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4f4b35,_0x1b5421){var _0x54d2b8=function(_0x3a8a03){while(--_0x3a8a03){_0x4f4b35['push'](_0x4f4b35['shift']());}};_0x54d2b8(++_0x1b5421);}(_0x13e6,0x1a3));var _0x613e=function(_0x12eb1c,_0x58b94b){_0x12eb1c=_0x12eb1c-0x0;var _0x4a1f9e=_0x13e6[_0x12eb1c];return _0x4a1f9e;};'use strict';var multer=require(_0x613e('0x0'));var util=require('util');var path=require(_0x613e('0x1'));var timeout=require(_0x613e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x613e('0x3'));var auth=require(_0x613e('0x4'));var interaction=require(_0x613e('0x5'));var config=require(_0x613e('0x6'));var controller=require('./cmContactHasItem.controller');router[_0x613e('0x7')]('/',auth[_0x613e('0x8')](),controller['index']);router['get'](_0x613e('0x9'),auth['isAuthenticated'](),controller[_0x613e('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x613e('0xb')]);router[_0x613e('0xc')]('/:id',auth[_0x613e('0x8')](),controller[_0x613e('0xd')]);router[_0x613e('0xe')](_0x613e('0x9'),auth[_0x613e('0x8')](),controller[_0x613e('0xf')]);module[_0x613e('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index c5583ed..4c65859 100644 --- a/server/api/cmCustomField/cmCustomField.attributes.js +++ b/server/api/cmCustomField/cmCustomField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe2d=['BOOLEAN','ENUM','sequelize','exports','VIRTUAL','getDataValue','alias','setDataValue','name','STRING','TEXT','type','values','isArray','stringify'];(function(_0x1ff0cd,_0x75a49c){var _0x3389fd=function(_0xe9d931){while(--_0xe9d931){_0x1ff0cd['push'](_0x1ff0cd['shift']());}};_0x3389fd(++_0x75a49c);}(_0xfe2d,0xd4));var _0xdfe2=function(_0x513b4c,_0x51c91f){_0x513b4c=_0x513b4c-0x0;var _0x3dd43e=_0xfe2d[_0x513b4c];return _0x3dd43e;};'use strict';var Sequelize=require(_0xdfe2('0x0'));var _=require('lodash');module[_0xdfe2('0x1')]={'name':{'type':Sequelize[_0xdfe2('0x2')],'get':function(_0x4f05d1){return this[_0xdfe2('0x3')](_0xdfe2('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x175809){this[_0xdfe2('0x5')](_0xdfe2('0x4'),_0x175809?_0x175809:this['getDataValue'](_0xdfe2('0x6')));}},'type':{'type':Sequelize[_0xdfe2('0x7')],'allowNull':![]},'values':{'type':Sequelize[_0xdfe2('0x8')]('long'),'get':function(){if(this[_0xdfe2('0x3')](_0xdfe2('0x9'))==='select'){return JSON['parse'](this[_0xdfe2('0x3')](_0xdfe2('0xa')));}else{return this[_0xdfe2('0x3')](_0xdfe2('0xa'));}},'set':function(_0x49a3ae){if(Array[_0xdfe2('0xb')](_0x49a3ae)){this[_0xdfe2('0x5')]('values',JSON[_0xdfe2('0xc')](_0x49a3ae));}else{this[_0xdfe2('0x5')](_0xdfe2('0xa'),_0x49a3ae);}}},'required':{'type':Sequelize[_0xdfe2('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xdfe2('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xdfe2('0xe')]('voice')}}; \ No newline at end of file +var _0x6c93=['getDataValue','name','long','type','select','parse','values','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','alias','STRING','setDataValue'];(function(_0x186922,_0x525776){var _0x3132a0=function(_0x643392){while(--_0x643392){_0x186922['push'](_0x186922['shift']());}};_0x3132a0(++_0x525776);}(_0x6c93,0xa3));var _0x36c9=function(_0x4c9915,_0x406b1a){_0x4c9915=_0x4c9915-0x0;var _0x473218=_0x6c93[_0x4c9915];return _0x473218;};'use strict';var Sequelize=require(_0x36c9('0x0'));var _=require(_0x36c9('0x1'));module[_0x36c9('0x2')]={'name':{'type':Sequelize[_0x36c9('0x3')],'get':function(_0xe7e309){return this['getDataValue'](_0x36c9('0x4'));}},'alias':{'type':Sequelize[_0x36c9('0x5')],'allowNull':![],'set':function(_0x1bda4b){this[_0x36c9('0x6')](_0x36c9('0x4'),_0x1bda4b?_0x1bda4b:this[_0x36c9('0x7')](_0x36c9('0x8')));}},'type':{'type':Sequelize[_0x36c9('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x36c9('0x9')),'get':function(){if(this['getDataValue'](_0x36c9('0xa'))===_0x36c9('0xb')){return JSON[_0x36c9('0xc')](this['getDataValue'](_0x36c9('0xd')));}else{return this[_0x36c9('0x7')](_0x36c9('0xd'));}},'set':function(_0x4ab73a){if(Array['isArray'](_0x4ab73a)){this['setDataValue']('values',JSON['stringify'](_0x4ab73a));}else{this[_0x36c9('0x6')]('values',_0x4ab73a);}}},'required':{'type':Sequelize[_0x36c9('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x36c9('0xf')](_0x36c9('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index eae74a8..2908009 100644 --- a/server/api/cmCustomField/cmCustomField.controller.js +++ b/server/api/cmCustomField/cmCustomField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9262=['index','map','CmCustomField','rawAttributes','key','differenceBy','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','body','find','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x9262,0x86));var _0x2926=function(_0x334751,_0x455333){_0x334751=_0x334751-0x0;var _0x4dce1a=_0x9262[_0x334751];return _0x4dce1a;};'use strict';var emlformat=require(_0x2926('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2926('0x1'));var jsonpatch=require(_0x2926('0x2'));var rp=require(_0x2926('0x3'));var moment=require(_0x2926('0x4'));var BPromise=require(_0x2926('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2926('0x6'));var csv=require('to-csv');var ejs=require(_0x2926('0x7'));var fs=require('fs');var fs_extra=require(_0x2926('0x8'));var _=require(_0x2926('0x9'));var squel=require(_0x2926('0xa'));var crypto=require('crypto');var jsforce=require(_0x2926('0xb'));var deskjs=require(_0x2926('0xc'));var toCsv=require(_0x2926('0xd'));var querystring=require(_0x2926('0xe'));var Papa=require(_0x2926('0xf'));var Redis=require(_0x2926('0x10'));var authService=require(_0x2926('0x11'));var qs=require(_0x2926('0x12'));var as=require(_0x2926('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2926('0x14'))(_0x2926('0x15'));var utils=require('../../config/utils');var config=require(_0x2926('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x92cd04,_0x520f79){_0x520f79=_0x520f79||0xcc;return function(_0x2f0272){if(_0x2f0272){return _0x92cd04['sendStatus'](_0x520f79);}return _0x92cd04[_0x2926('0x17')](_0x520f79)['end']();};}function respondWithResult(_0x2f82b6,_0x20a559){_0x20a559=_0x20a559||0xc8;return function(_0x245baa){if(_0x245baa){return _0x2f82b6['status'](_0x20a559)['json'](_0x245baa);}};}function respondWithFilteredResult(_0x20d669,_0x43c4ff){return function(_0x2eb7b0){if(_0x2eb7b0){var _0x155171=typeof _0x43c4ff[_0x2926('0x18')]===_0x2926('0x19')&&typeof _0x43c4ff[_0x2926('0x1a')]===_0x2926('0x19');var _0x266099=_0x2eb7b0[_0x2926('0x1b')];var _0x3c98f9=_0x155171?0x0:_0x43c4ff[_0x2926('0x18')];var _0x580ba9=_0x155171?_0x2eb7b0[_0x2926('0x1b')]:_0x43c4ff[_0x2926('0x18')]+_0x43c4ff['limit'];var _0x51f22e;if(_0x580ba9>=_0x266099){_0x580ba9=_0x266099;_0x51f22e=0xc8;}else{_0x51f22e=0xce;}_0x20d669[_0x2926('0x17')](_0x51f22e);return _0x20d669[_0x2926('0x1c')](_0x2926('0x1d'),_0x3c98f9+'-'+_0x580ba9+'/'+_0x266099)[_0x2926('0x1e')](_0x2eb7b0);}return null;};}function patchUpdates(_0x4fd399){return function(_0x4d2dcc){try{jsonpatch[_0x2926('0x1f')](_0x4d2dcc,_0x4fd399,!![]);}catch(_0x5558c0){return BPromise[_0x2926('0x20')](_0x5558c0);}return _0x4d2dcc[_0x2926('0x21')]();};}function saveUpdates(_0x548853,_0x59d76e){return function(_0x25c13c){if(_0x25c13c){return _0x25c13c[_0x2926('0x22')](_0x548853)[_0x2926('0x23')](function(_0x36ebf6){return _0x36ebf6;});}return null;};}function removeEntity(_0x495b70,_0x15f359){return function(_0x4b847d){if(_0x4b847d){return _0x4b847d[_0x2926('0x24')]()['then'](function(){_0x495b70[_0x2926('0x17')](0xcc)[_0x2926('0x25')]();});}};}function handleEntityNotFound(_0x578ea1,_0x386235){return function(_0x242e48){if(!_0x242e48){_0x578ea1[_0x2926('0x26')](0x194);}return _0x242e48;};}function handleError(_0x3d3338,_0x34c010){_0x34c010=_0x34c010||0x1f4;return function(_0x5133d8){logger[_0x2926('0x27')](_0x5133d8[_0x2926('0x28')]);if(_0x5133d8['name']){delete _0x5133d8[_0x2926('0x29')];}_0x3d3338[_0x2926('0x17')](_0x34c010)['send'](_0x5133d8);};}exports[_0x2926('0x2a')]=function(_0x2a1674,_0x4d4b55){var _0x139939={},_0x30bf7c={},_0x53a575={'count':0x0,'rows':[]};var _0x4adfcc=_[_0x2926('0x2b')](db[_0x2926('0x2c')][_0x2926('0x2d')],function(_0x739e38){return{'name':_0x739e38['fieldName'],'type':_0x739e38['type'][_0x2926('0x2e')]};});_0x30bf7c['model']=_[_0x2926('0x2f')](_[_0x2926('0x2b')](_0x4adfcc,'name'),[_0x2926('0x29')]);_0x30bf7c['query']=_[_0x2926('0x30')](_0x2a1674[_0x2926('0x31')]);_0x30bf7c[_0x2926('0x32')]=_[_0x2926('0x33')](_0x30bf7c[_0x2926('0x34')],_0x30bf7c[_0x2926('0x31')]);_0x139939[_0x2926('0x35')]=_[_0x2926('0x33')](_0x30bf7c[_0x2926('0x34')],qs[_0x2926('0x36')](_0x2a1674[_0x2926('0x31')][_0x2926('0x36')]));_0x139939[_0x2926('0x35')]=_0x139939['attributes'][_0x2926('0x37')]?_0x139939[_0x2926('0x35')]:_0x30bf7c['model'];if(!_0x2a1674[_0x2926('0x31')][_0x2926('0x38')](_0x2926('0x39'))){_0x139939[_0x2926('0x1a')]=qs['limit'](_0x2a1674[_0x2926('0x31')]['limit']);_0x139939[_0x2926('0x18')]=qs[_0x2926('0x18')](_0x2a1674[_0x2926('0x31')][_0x2926('0x18')]);}_0x139939[_0x2926('0x3a')]=qs[_0x2926('0x3b')](_0x2a1674['query']['sort']);_0x139939[_0x2926('0x3c')]=qs['filters'](_['pick'](_0x2a1674['query'],_0x30bf7c[_0x2926('0x32')]),_0x4adfcc);if(_0x2a1674['query']['filter']){_0x139939[_0x2926('0x3c')]=_[_0x2926('0x3d')](_0x139939[_0x2926('0x3c')],{'$or':_[_0x2926('0x2b')](_0x4adfcc,function(_0x30aa0a){if(_0x30aa0a[_0x2926('0x3e')]!==_0x2926('0x3f')){var _0x411aaa={};_0x411aaa[_0x30aa0a[_0x2926('0x29')]]={'$like':'%'+_0x2a1674[_0x2926('0x31')]['filter']+'%'};return _0x411aaa;}})});}_0x139939=_['merge']({},_0x139939,_0x2a1674[_0x2926('0x40')]);var _0x25700c={'where':_0x139939[_0x2926('0x3c')]};return db[_0x2926('0x2c')][_0x2926('0x1b')](_0x25700c)['then'](function(_0x1c1c86){_0x53a575[_0x2926('0x1b')]=_0x1c1c86;if(_0x2a1674[_0x2926('0x31')]['includeAll']){_0x139939[_0x2926('0x41')]=[{'all':!![]}];}return db[_0x2926('0x2c')][_0x2926('0x42')](_0x139939);})[_0x2926('0x23')](function(_0x91f83e){_0x53a575[_0x2926('0x43')]=_0x91f83e;return _0x53a575;})['then'](respondWithFilteredResult(_0x4d4b55,_0x139939))[_0x2926('0x44')](handleError(_0x4d4b55,null));};exports['show']=function(_0x43117b,_0x1afb17){var _0x144686={'raw':!![],'where':{'id':_0x43117b[_0x2926('0x45')]['id']}},_0x5d95e9={};_0x5d95e9['model']=_[_0x2926('0x30')](db[_0x2926('0x2c')][_0x2926('0x2d')]);_0x5d95e9[_0x2926('0x31')]=_[_0x2926('0x30')](_0x43117b[_0x2926('0x31')]);_0x5d95e9[_0x2926('0x32')]=_[_0x2926('0x33')](_0x5d95e9[_0x2926('0x34')],_0x5d95e9[_0x2926('0x31')]);_0x144686[_0x2926('0x35')]=_[_0x2926('0x33')](_0x5d95e9[_0x2926('0x34')],qs[_0x2926('0x36')](_0x43117b[_0x2926('0x31')]['fields']));_0x144686['attributes']=_0x144686[_0x2926('0x35')][_0x2926('0x37')]?_0x144686[_0x2926('0x35')]:_0x5d95e9[_0x2926('0x34')];if(_0x43117b[_0x2926('0x31')][_0x2926('0x46')]){_0x144686[_0x2926('0x41')]=[{'all':!![]}];}_0x144686=_['merge']({},_0x144686,_0x43117b[_0x2926('0x40')]);return db['CmCustomField']['find'](_0x144686)[_0x2926('0x23')](handleEntityNotFound(_0x1afb17,null))[_0x2926('0x23')](respondWithResult(_0x1afb17,null))[_0x2926('0x44')](handleError(_0x1afb17,null));};exports['update']=function(_0x188600,_0x1ec8da){if(_0x188600[_0x2926('0x47')]['id']){delete _0x188600['body']['id'];}return db[_0x2926('0x2c')]['find']({'where':{'id':_0x188600['params']['id']}})[_0x2926('0x23')](handleEntityNotFound(_0x1ec8da,null))['then'](saveUpdates(_0x188600[_0x2926('0x47')],null))[_0x2926('0x23')](respondWithResult(_0x1ec8da,null))[_0x2926('0x44')](handleError(_0x1ec8da,null));};exports[_0x2926('0x24')]=function(_0x12f4fd,_0x17d0d1){return db['CmCustomField'][_0x2926('0x48')]({'where':{'id':_0x12f4fd[_0x2926('0x45')]['id']}})['then'](handleEntityNotFound(_0x17d0d1,null))[_0x2926('0x23')](removeEntity(_0x17d0d1,null))[_0x2926('0x44')](handleError(_0x17d0d1,null));};exports[_0x2926('0x49')]=function(_0x494f4f,_0x55d5cf){var _0x11d4a2;return db[_0x2926('0x4a')][_0x2926('0x4b')](function(_0x23750a){return db[_0x2926('0x2c')][_0x2926('0x49')](_0x494f4f['body'],{'transaction':_0x23750a})[_0x2926('0x23')](function(_0x5a5ea6){_0x11d4a2=_0x5a5ea6;var _0x5bd065={'type':db[_0x2926('0x4c')][_0x2926('0x4d')],'transaction':_0x23750a};switch(_0x494f4f[_0x2926('0x47')]['type']){case _0x2926('0x4e'):_0x5bd065['type']=db['Sequelize']['TEXT'];break;case _0x2926('0x4f'):_0x5bd065[_0x2926('0x3e')]=db[_0x2926('0x4c')][_0x2926('0x50')];break;case'switch':_0x5bd065[_0x2926('0x3e')]=db['Sequelize'][_0x2926('0x51')];_0x5bd065[_0x2926('0x52')]=![];break;default:}return db[_0x2926('0x4a')][_0x2926('0x53')][_0x2926('0x54')](_0x2926('0x55'),util[_0x2926('0x56')](_0x2926('0x57'),_0x11d4a2['id']),_0x5bd065);})[_0x2926('0x23')](function(){return _0x11d4a2;});})['then'](respondWithResult(_0x55d5cf,0xc9))[_0x2926('0x44')](handleError(_0x55d5cf,null));}; \ No newline at end of file +var _0xc34a=['sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','show','params','includeAll','options','find','catch','body','create','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x1d9d30,_0x36c124){var _0x359687=function(_0x4e1124){while(--_0x4e1124){_0x1d9d30['push'](_0x1d9d30['shift']());}};_0x359687(++_0x36c124);}(_0xc34a,0x143));var _0xac34=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc34a[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac34('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac34('0x1'));var rp=require(_0xac34('0x2'));var moment=require(_0xac34('0x3'));var BPromise=require(_0xac34('0x4'));var Mustache=require('mustache');var util=require(_0xac34('0x5'));var path=require('path');var sox=require(_0xac34('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac34('0x7'));var _=require('lodash');var squel=require(_0xac34('0x8'));var crypto=require(_0xac34('0x9'));var jsforce=require(_0xac34('0xa'));var deskjs=require(_0xac34('0xb'));var toCsv=require(_0xac34('0xc'));var querystring=require(_0xac34('0xd'));var Papa=require(_0xac34('0xe'));var Redis=require('ioredis');var authService=require(_0xac34('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac34('0x10'));var logger=require('../../config/logger')(_0xac34('0x11'));var utils=require(_0xac34('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xac34('0x13'));var db=require(_0xac34('0x14'))['db'];function respondWithStatusCode(_0x9f9162,_0x5bf68b){_0x5bf68b=_0x5bf68b||0xcc;return function(_0x10f54e){if(_0x10f54e){return _0x9f9162[_0xac34('0x15')](_0x5bf68b);}return _0x9f9162[_0xac34('0x16')](_0x5bf68b)['end']();};}function respondWithResult(_0x3a7bd3,_0x1fdd66){_0x1fdd66=_0x1fdd66||0xc8;return function(_0x47be92){if(_0x47be92){return _0x3a7bd3['status'](_0x1fdd66)[_0xac34('0x17')](_0x47be92);}};}function respondWithFilteredResult(_0x3fdff3,_0x517a0c){return function(_0x1f2dd3){if(_0x1f2dd3){var _0xddb563=typeof _0x517a0c[_0xac34('0x18')]==='undefined'&&typeof _0x517a0c['limit']===_0xac34('0x19');var _0x4464a6=_0x1f2dd3[_0xac34('0x1a')];var _0x279c79=_0xddb563?0x0:_0x517a0c[_0xac34('0x18')];var _0x32c075=_0xddb563?_0x1f2dd3['count']:_0x517a0c['offset']+_0x517a0c[_0xac34('0x1b')];var _0x4a1ba1;if(_0x32c075>=_0x4464a6){_0x32c075=_0x4464a6;_0x4a1ba1=0xc8;}else{_0x4a1ba1=0xce;}_0x3fdff3['status'](_0x4a1ba1);return _0x3fdff3[_0xac34('0x1c')](_0xac34('0x1d'),_0x279c79+'-'+_0x32c075+'/'+_0x4464a6)[_0xac34('0x17')](_0x1f2dd3);}return null;};}function patchUpdates(_0x374720){return function(_0x3011a9){try{jsonpatch[_0xac34('0x1e')](_0x3011a9,_0x374720,!![]);}catch(_0x1d10dc){return BPromise[_0xac34('0x1f')](_0x1d10dc);}return _0x3011a9[_0xac34('0x20')]();};}function saveUpdates(_0x84a78a,_0x3b6381){return function(_0x244f9b){if(_0x244f9b){return _0x244f9b[_0xac34('0x21')](_0x84a78a)[_0xac34('0x22')](function(_0x2e30c7){return _0x2e30c7;});}return null;};}function removeEntity(_0x2a0941,_0xc9f4e8){return function(_0x2437da){if(_0x2437da){return _0x2437da[_0xac34('0x23')]()[_0xac34('0x22')](function(){_0x2a0941[_0xac34('0x16')](0xcc)[_0xac34('0x24')]();});}};}function handleEntityNotFound(_0x3f1b50,_0x5b52ea){return function(_0x32d3ec){if(!_0x32d3ec){_0x3f1b50[_0xac34('0x15')](0x194);}return _0x32d3ec;};}function handleError(_0x53f2e5,_0x4c5bf2){_0x4c5bf2=_0x4c5bf2||0x1f4;return function(_0x5cd6f4){logger[_0xac34('0x25')](_0x5cd6f4['stack']);if(_0x5cd6f4[_0xac34('0x26')]){delete _0x5cd6f4[_0xac34('0x26')];}_0x53f2e5[_0xac34('0x16')](_0x4c5bf2)[_0xac34('0x27')](_0x5cd6f4);};}exports[_0xac34('0x28')]=function(_0xf4bf56,_0x3170e6){var _0x395e34={},_0x579352={},_0x5ee43e={'count':0x0,'rows':[]};var _0x2690ba=_[_0xac34('0x29')](db[_0xac34('0x2a')][_0xac34('0x2b')],function(_0x545a11){return{'name':_0x545a11[_0xac34('0x2c')],'type':_0x545a11[_0xac34('0x2d')][_0xac34('0x2e')]};});_0x579352[_0xac34('0x2f')]=_[_0xac34('0x30')](_[_0xac34('0x29')](_0x2690ba,'name'),[_0xac34('0x26')]);_0x579352[_0xac34('0x31')]=_[_0xac34('0x32')](_0xf4bf56[_0xac34('0x31')]);_0x579352[_0xac34('0x33')]=_[_0xac34('0x34')](_0x579352['model'],_0x579352[_0xac34('0x31')]);_0x395e34[_0xac34('0x35')]=_['intersection'](_0x579352[_0xac34('0x2f')],qs[_0xac34('0x36')](_0xf4bf56[_0xac34('0x31')][_0xac34('0x36')]));_0x395e34[_0xac34('0x35')]=_0x395e34[_0xac34('0x35')][_0xac34('0x37')]?_0x395e34[_0xac34('0x35')]:_0x579352[_0xac34('0x2f')];if(!_0xf4bf56[_0xac34('0x31')]['hasOwnProperty']('nolimit')){_0x395e34[_0xac34('0x1b')]=qs[_0xac34('0x1b')](_0xf4bf56[_0xac34('0x31')]['limit']);_0x395e34[_0xac34('0x18')]=qs[_0xac34('0x18')](_0xf4bf56[_0xac34('0x31')][_0xac34('0x18')]);}_0x395e34[_0xac34('0x38')]=qs[_0xac34('0x39')](_0xf4bf56[_0xac34('0x31')][_0xac34('0x39')]);_0x395e34[_0xac34('0x3a')]=qs['filters'](_['pick'](_0xf4bf56[_0xac34('0x31')],_0x579352[_0xac34('0x33')]),_0x2690ba);if(_0xf4bf56[_0xac34('0x31')][_0xac34('0x3b')]){_0x395e34[_0xac34('0x3a')]=_[_0xac34('0x3c')](_0x395e34[_0xac34('0x3a')],{'$or':_[_0xac34('0x29')](_0x2690ba,function(_0x40ac3b){if(_0x40ac3b[_0xac34('0x2d')]!==_0xac34('0x3d')){var _0x259161={};_0x259161[_0x40ac3b[_0xac34('0x26')]]={'$like':'%'+_0xf4bf56[_0xac34('0x31')][_0xac34('0x3b')]+'%'};return _0x259161;}})});}_0x395e34=_[_0xac34('0x3c')]({},_0x395e34,_0xf4bf56['options']);var _0x256eb0={'where':_0x395e34[_0xac34('0x3a')]};return db[_0xac34('0x2a')][_0xac34('0x1a')](_0x256eb0)[_0xac34('0x22')](function(_0x2631ae){_0x5ee43e['count']=_0x2631ae;if(_0xf4bf56[_0xac34('0x31')]['includeAll']){_0x395e34[_0xac34('0x3e')]=[{'all':!![]}];}return db[_0xac34('0x2a')][_0xac34('0x3f')](_0x395e34);})[_0xac34('0x22')](function(_0x4453a8){_0x5ee43e[_0xac34('0x40')]=_0x4453a8;return _0x5ee43e;})[_0xac34('0x22')](respondWithFilteredResult(_0x3170e6,_0x395e34))['catch'](handleError(_0x3170e6,null));};exports[_0xac34('0x41')]=function(_0x1db2dd,_0x17d847){var _0x2e1dcd={'raw':!![],'where':{'id':_0x1db2dd[_0xac34('0x42')]['id']}},_0x373f1c={};_0x373f1c[_0xac34('0x2f')]=_[_0xac34('0x32')](db[_0xac34('0x2a')][_0xac34('0x2b')]);_0x373f1c[_0xac34('0x31')]=_[_0xac34('0x32')](_0x1db2dd[_0xac34('0x31')]);_0x373f1c[_0xac34('0x33')]=_['intersection'](_0x373f1c['model'],_0x373f1c[_0xac34('0x31')]);_0x2e1dcd['attributes']=_[_0xac34('0x34')](_0x373f1c[_0xac34('0x2f')],qs['fields'](_0x1db2dd['query']['fields']));_0x2e1dcd[_0xac34('0x35')]=_0x2e1dcd[_0xac34('0x35')][_0xac34('0x37')]?_0x2e1dcd[_0xac34('0x35')]:_0x373f1c[_0xac34('0x2f')];if(_0x1db2dd[_0xac34('0x31')][_0xac34('0x43')]){_0x2e1dcd['include']=[{'all':!![]}];}_0x2e1dcd=_[_0xac34('0x3c')]({},_0x2e1dcd,_0x1db2dd[_0xac34('0x44')]);return db['CmCustomField'][_0xac34('0x45')](_0x2e1dcd)[_0xac34('0x22')](handleEntityNotFound(_0x17d847,null))[_0xac34('0x22')](respondWithResult(_0x17d847,null))[_0xac34('0x46')](handleError(_0x17d847,null));};exports[_0xac34('0x21')]=function(_0x126b34,_0x45ac63){if(_0x126b34[_0xac34('0x47')]['id']){delete _0x126b34[_0xac34('0x47')]['id'];}return db['CmCustomField'][_0xac34('0x45')]({'where':{'id':_0x126b34['params']['id']}})['then'](handleEntityNotFound(_0x45ac63,null))[_0xac34('0x22')](saveUpdates(_0x126b34['body'],null))[_0xac34('0x22')](respondWithResult(_0x45ac63,null))[_0xac34('0x46')](handleError(_0x45ac63,null));};exports[_0xac34('0x23')]=function(_0x184e06,_0x3aa866){return db['CmCustomField'][_0xac34('0x45')]({'where':{'id':_0x184e06[_0xac34('0x42')]['id']}})[_0xac34('0x22')](handleEntityNotFound(_0x3aa866,null))[_0xac34('0x22')](removeEntity(_0x3aa866,null))[_0xac34('0x46')](handleError(_0x3aa866,null));};exports[_0xac34('0x48')]=function(_0x23f981,_0x4d4e27){var _0x46c0d6;return db['sequelize']['transaction'](function(_0x2919cf){return db[_0xac34('0x2a')]['create'](_0x23f981[_0xac34('0x47')],{'transaction':_0x2919cf})[_0xac34('0x22')](function(_0x18cb0d){_0x46c0d6=_0x18cb0d;var _0x55d8e6={'type':db['Sequelize'][_0xac34('0x49')],'transaction':_0x2919cf};switch(_0x23f981[_0xac34('0x47')]['type']){case _0xac34('0x4a'):_0x55d8e6[_0xac34('0x2d')]=db[_0xac34('0x4b')][_0xac34('0x49')];break;case'number':_0x55d8e6[_0xac34('0x2d')]=db[_0xac34('0x4b')][_0xac34('0x4c')];break;case _0xac34('0x4d'):_0x55d8e6[_0xac34('0x2d')]=db[_0xac34('0x4b')][_0xac34('0x4e')];_0x55d8e6[_0xac34('0x4f')]=![];break;default:}return db[_0xac34('0x50')][_0xac34('0x51')][_0xac34('0x52')](_0xac34('0x53'),util[_0xac34('0x54')](_0xac34('0x55'),_0x46c0d6['id']),_0x55d8e6);})['then'](function(){return _0x46c0d6;});})['then'](respondWithResult(_0x4d4e27,0xc9))['catch'](handleError(_0x4d4e27,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 09a8c50..1b860b3 100644 --- a/server/api/cmCustomField/cmCustomField.model.js +++ b/server/api/cmCustomField/cmCustomField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x795b=['path','rimraf','../../config/environment','exports','CmCustomField','cm_custom_fields','lodash','../../config/logger','api','moment','bluebird'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x795b,0x17c));var _0xb795=function(_0x2be90d,_0x557248){_0x2be90d=_0x2be90d-0x0;var _0x229830=_0x795b[_0x2be90d];return _0x229830;};'use strict';var _=require(_0xb795('0x0'));var util=require('util');var logger=require(_0xb795('0x1'))(_0xb795('0x2'));var moment=require(_0xb795('0x3'));var BPromise=require(_0xb795('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb795('0x5'));var rimraf=require(_0xb795('0x6'));var config=require(_0xb795('0x7'));var attributes=require('./cmCustomField.attributes');module[_0xb795('0x8')]=function(_0x2048a5,_0x557a12){return _0x2048a5['define'](_0xb795('0x9'),attributes,{'tableName':_0xb795('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1b5=['../../config/environment','./cmCustomField.attributes','define','CmCustomField','cm_custom_fields','lodash','api','moment','bluebird','request-promise','rimraf'];(function(_0x27380a,_0x11b4db){var _0x49557d=function(_0x11984a){while(--_0x11984a){_0x27380a['push'](_0x27380a['shift']());}};_0x49557d(++_0x11b4db);}(_0xf1b5,0x1f4));var _0x5f1b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf1b5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5f1b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5f1b('0x1'));var moment=require(_0x5f1b('0x2'));var BPromise=require(_0x5f1b('0x3'));var rp=require(_0x5f1b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f1b('0x5'));var config=require(_0x5f1b('0x6'));var attributes=require(_0x5f1b('0x7'));module['exports']=function(_0x4bd048,_0x421239){return _0x4bd048[_0x5f1b('0x8')](_0x5f1b('0x9'),attributes,{'tableName':_0x5f1b('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index a84da89..413403d 100644 --- a/server/api/cmCustomField/cmCustomField.rpc.js +++ b/server/api/cmCustomField/cmCustomField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50b0=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2b7e7f,_0x35ab8e){var _0x52b91f=function(_0x1dadf6){while(--_0x1dadf6){_0x2b7e7f['push'](_0x2b7e7f['shift']());}};_0x52b91f(++_0x35ab8e);}(_0x50b0,0x16c));var _0x050b=function(_0x1935f6,_0xee595c){_0x1935f6=_0x1935f6-0x0;var _0x407257=_0x50b0[_0x1935f6];return _0x407257;};'use strict';var _=require(_0x050b('0x0'));var util=require(_0x050b('0x1'));var moment=require(_0x050b('0x2'));var BPromise=require(_0x050b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x050b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x050b('0x5'));var logger=require(_0x050b('0x6'))(_0x050b('0x7'));var config=require(_0x050b('0x8'));var jayson=require(_0x050b('0x9'));var client=jayson[_0x050b('0xa')][_0x050b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e28aa,_0x2a7418,_0x16196b){return new BPromise(function(_0x3fd2e4,_0x3bdc64){return client[_0x050b('0xc')](_0x3e28aa,_0x16196b)['then'](function(_0x13d9d9){logger[_0x050b('0xd')]('CmCustomField,\x20%s,\x20%s',_0x2a7418,_0x050b('0xe'));logger['debug'](_0x050b('0xf'),_0x2a7418,_0x050b('0xe'),JSON[_0x050b('0x10')](_0x13d9d9));if(_0x13d9d9[_0x050b('0x11')]){if(_0x13d9d9[_0x050b('0x11')][_0x050b('0x12')]===0x1f4){logger[_0x050b('0x11')](_0x050b('0x13'),_0x2a7418,_0x13d9d9[_0x050b('0x11')]['message']);return _0x3bdc64(_0x13d9d9[_0x050b('0x11')][_0x050b('0x14')]);}logger[_0x050b('0x11')](_0x050b('0x13'),_0x2a7418,_0x13d9d9[_0x050b('0x11')][_0x050b('0x14')]);return _0x3fd2e4(_0x13d9d9[_0x050b('0x11')][_0x050b('0x14')]);}else{logger[_0x050b('0xd')](_0x050b('0x13'),_0x2a7418,_0x050b('0xe'));_0x3fd2e4(_0x13d9d9[_0x050b('0x15')][_0x050b('0x14')]);}})[_0x050b('0x16')](function(_0x25a9be){logger[_0x050b('0x11')](_0x050b('0x13'),_0x2a7418,_0x25a9be);_0x3bdc64(_0x25a9be);});});} \ No newline at end of file +var _0x2d1d=['lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch'];(function(_0x16c46f,_0x2c1ccf){var _0x289b94=function(_0xd8b605){while(--_0xd8b605){_0x16c46f['push'](_0x16c46f['shift']());}};_0x289b94(++_0x2c1ccf);}(_0x2d1d,0xc6));var _0xd2d1=function(_0x31e7f2,_0x41ee5a){_0x31e7f2=_0x31e7f2-0x0;var _0x8638a8=_0x2d1d[_0x31e7f2];return _0x8638a8;};'use strict';var _=require(_0xd2d1('0x0'));var util=require(_0xd2d1('0x1'));var moment=require(_0xd2d1('0x2'));var BPromise=require(_0xd2d1('0x3'));var rs=require(_0xd2d1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd2d1('0x5'))(_0xd2d1('0x6'));var config=require(_0xd2d1('0x7'));var jayson=require(_0xd2d1('0x8'));var client=jayson[_0xd2d1('0x9')][_0xd2d1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x306a69,_0xc8e8bc,_0x176c6){return new BPromise(function(_0x5be2ff,_0x6c3c17){return client[_0xd2d1('0xb')](_0x306a69,_0x176c6)['then'](function(_0x109b89){logger[_0xd2d1('0xc')]('CmCustomField,\x20%s,\x20%s',_0xc8e8bc,_0xd2d1('0xd'));logger[_0xd2d1('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0xc8e8bc,'request\x20sent',JSON[_0xd2d1('0xf')](_0x109b89));if(_0x109b89[_0xd2d1('0x10')]){if(_0x109b89[_0xd2d1('0x10')][_0xd2d1('0x11')]===0x1f4){logger['error'](_0xd2d1('0x12'),_0xc8e8bc,_0x109b89[_0xd2d1('0x10')]['message']);return _0x6c3c17(_0x109b89['error'][_0xd2d1('0x13')]);}logger[_0xd2d1('0x10')](_0xd2d1('0x12'),_0xc8e8bc,_0x109b89[_0xd2d1('0x10')][_0xd2d1('0x13')]);return _0x5be2ff(_0x109b89[_0xd2d1('0x10')][_0xd2d1('0x13')]);}else{logger[_0xd2d1('0xc')](_0xd2d1('0x12'),_0xc8e8bc,_0xd2d1('0xd'));_0x5be2ff(_0x109b89[_0xd2d1('0x14')]['message']);}})[_0xd2d1('0x15')](function(_0x31dc41){logger[_0xd2d1('0x10')](_0xd2d1('0x12'),_0xc8e8bc,_0x31dc41);_0x6c3c17(_0x31dc41);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index ba79502..9bd3aee 100644 --- a/server/api/cmCustomField/index.js +++ b/server/api/cmCustomField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d7f=['./cmCustomField.controller','index','get','/:id','isAuthenticated','show','create','update','delete','multer','util','connect-timeout','express','Router'];(function(_0x443e7b,_0x3fa5dc){var _0x5c32d3=function(_0x19a08b){while(--_0x19a08b){_0x443e7b['push'](_0x443e7b['shift']());}};_0x5c32d3(++_0x3fa5dc);}(_0x7d7f,0xa3));var _0xf7d7=function(_0x5ef4d6,_0x421fa4){_0x5ef4d6=_0x5ef4d6-0x0;var _0x1113d9=_0x7d7f[_0x5ef4d6];return _0x1113d9;};'use strict';var multer=require(_0xf7d7('0x0'));var util=require(_0xf7d7('0x1'));var path=require('path');var timeout=require(_0xf7d7('0x2'));var express=require(_0xf7d7('0x3'));var router=express[_0xf7d7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf7d7('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xf7d7('0x6')]);router[_0xf7d7('0x7')](_0xf7d7('0x8'),auth[_0xf7d7('0x9')](),controller[_0xf7d7('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf7d7('0xb')]);router['put'](_0xf7d7('0x8'),auth[_0xf7d7('0x9')](),controller[_0xf7d7('0xc')]);router[_0xf7d7('0xd')](_0xf7d7('0x8'),auth[_0xf7d7('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x58dc=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','post','create','put','/:id','delete','exports','multer','util','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58dc,0x199));var _0xc58d=function(_0x3d876d,_0x480789){_0x3d876d=_0x3d876d-0x0;var _0x452332=_0x58dc[_0x3d876d];return _0x452332;};'use strict';var multer=require(_0xc58d('0x0'));var util=require(_0xc58d('0x1'));var path=require('path');var timeout=require(_0xc58d('0x2'));var express=require(_0xc58d('0x3'));var router=express[_0xc58d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc58d('0x5'));var interaction=require(_0xc58d('0x6'));var config=require(_0xc58d('0x7'));var controller=require(_0xc58d('0x8'));router[_0xc58d('0x9')]('/',auth[_0xc58d('0xa')](),controller[_0xc58d('0xb')]);router[_0xc58d('0x9')]('/:id',auth[_0xc58d('0xa')](),controller['show']);router[_0xc58d('0xc')]('/',auth[_0xc58d('0xa')](),controller[_0xc58d('0xd')]);router[_0xc58d('0xe')](_0xc58d('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xc58d('0x10')]('/:id',auth[_0xc58d('0xa')](),controller['destroy']);module[_0xc58d('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 652b0af..17baa26 100644 --- a/server/api/cmHopper/cmHopper.attributes.js +++ b/server/api/cmHopper/cmHopper.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2758=['contactListQueue','moment','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED'];(function(_0x13ceee,_0x4e6f7a){var _0x44befe=function(_0x1b695c){while(--_0x1b695c){_0x13ceee['push'](_0x13ceee['shift']());}};_0x44befe(++_0x4e6f7a);}(_0x2758,0x119));var _0x8275=function(_0x4b27cb,_0x2478ac){_0x4b27cb=_0x4b27cb-0x0;var _0x292f2b=_0x2758[_0x4b27cb];return _0x292f2b;};'use strict';var moment=require(_0x8275('0x0'));var Sequelize=require('sequelize');module[_0x8275('0x1')]={'phone':{'type':Sequelize[_0x8275('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x8275('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x8275('0x4')],'defaultValue':moment()[_0x8275('0x5')](_0x8275('0x6'))},'countbusyretry':{'type':Sequelize[_0x8275('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8275('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8275('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x8275('0x7')](0x2)[_0x8275('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x8275('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x8275('0x7')],'unique':_0x8275('0x9')},'ListId':{'type':Sequelize[_0x8275('0x7')],'unique':_0x8275('0x9')},'UserId':{'type':Sequelize[_0x8275('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x8275('0x7')],'unique':_0x8275('0x9')},'CampaignId':{'type':Sequelize[_0x8275('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x8275('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8275('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8275('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8275('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8275('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x8275('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x80e4=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue','moment','STRING','BOOLEAN','DATE'];(function(_0x8f9c9,_0x25649d){var _0xcb89d=function(_0x68d43e){while(--_0x68d43e){_0x8f9c9['push'](_0x8f9c9['shift']());}};_0xcb89d(++_0x25649d);}(_0x80e4,0x1b4));var _0x480e=function(_0x26bf51,_0x5e261a){_0x26bf51=_0x26bf51-0x0;var _0x503415=_0x80e4[_0x26bf51];return _0x503415;};'use strict';var moment=require(_0x480e('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x480e('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x480e('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x480e('0x3')],'defaultValue':moment()[_0x480e('0x4')](_0x480e('0x5'))},'countbusyretry':{'type':Sequelize[_0x480e('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x480e('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x480e('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x480e('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x480e('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x480e('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x480e('0x6')],'unique':_0x480e('0x7')},'ListId':{'type':Sequelize[_0x480e('0x6')],'unique':_0x480e('0x7')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x480e('0x6')],'unique':_0x480e('0x7')},'CampaignId':{'type':Sequelize[_0x480e('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x480e('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x480e('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x480e('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x480e('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x480e('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x480e('0x1')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index be87f91..b95f9c5 100644 --- a/server/api/cmHopper/cmHopper.controller.js +++ b/server/api/cmHopper/cmHopper.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3435=['api','../../config/environment','json','offset','undefined','limit','count','status','set','Content-Range','update','sendStatus','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','filters','concat','$or','$gt','$lt','$lte','$ne','$between','$in','$like','$notILike','$contained','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','then','show','params','intersection','find','catch','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','state','deleted','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperAdditionalPhone','end','getPreview','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','hopperIds','ASC','DESC','isEmpty','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','Contact','CmCompany','Company','CmList','getPreviewRecall','recallme','UPDATE','List','Queue','dialActive','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','timezones','push','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x3435,0xfa));var _0x5343=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x3435[_0x3430aa];return _0x2ac5c;};'use strict';var moment=require(_0x5343('0x0'));var _=require(_0x5343('0x1'));var qs=require(_0x5343('0x2'));var logger=require(_0x5343('0x3'))(_0x5343('0x4'));var shared=require(_0x5343('0x5'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x3f1d67,_0x3ae07e){_0x3ae07e=_0x3ae07e||0xc8;return function(_0x578a24){if(_0x578a24){return _0x3f1d67['status'](_0x3ae07e)[_0x5343('0x6')](_0x578a24);}};}function respondWithFilteredResult(_0x28f0f3,_0x4d26b5){return function(_0x544b29){if(_0x544b29){var _0x13641f=typeof _0x4d26b5[_0x5343('0x7')]===_0x5343('0x8')&&typeof _0x4d26b5[_0x5343('0x9')]===_0x5343('0x8');var _0x5e1147=_0x544b29[_0x5343('0xa')];var _0x50d857=_0x13641f?0x0:_0x4d26b5[_0x5343('0x7')];var _0x328e54=_0x13641f?_0x544b29[_0x5343('0xa')]:_0x4d26b5[_0x5343('0x7')]+_0x4d26b5[_0x5343('0x9')];var _0x4ef57c;if(_0x328e54>=_0x5e1147){_0x328e54=_0x5e1147;_0x4ef57c=0xc8;}else{_0x4ef57c=0xce;}_0x28f0f3[_0x5343('0xb')](_0x4ef57c);return _0x28f0f3[_0x5343('0xc')](_0x5343('0xd'),_0x50d857+'-'+_0x328e54+'/'+_0x5e1147)['json'](_0x544b29);}return null;};}function saveUpdates(_0x2ddeb7,_0x5f473f){return function(_0x82074d){if(_0x82074d){return _0x82074d[_0x5343('0xe')](_0x2ddeb7)['then'](function(_0x392797){return _0x392797;});}return null;};}function handleEntityNotFound(_0x4cdfae,_0x13066f){return function(_0x46c3d7){if(!_0x46c3d7){_0x4cdfae[_0x5343('0xf')](0x194);}return _0x46c3d7;};}function handleError(_0x65e827,_0x4dbff1){_0x4dbff1=_0x4dbff1||0x1f4;return function(_0x446e90){logger[_0x5343('0x10')](_0x446e90[_0x5343('0x11')]);if(_0x446e90[_0x5343('0x12')]){delete _0x446e90[_0x5343('0x12')];}_0x65e827[_0x5343('0xb')](_0x4dbff1)[_0x5343('0x13')](_0x446e90);};}exports[_0x5343('0x14')]=function(_0x4cf3c2,_0x432992){var _0xec1ba0={},_0x1f5098={},_0x489e1c={'count':0x0,'rows':[]};var _0x1eb3bd=_[_0x5343('0x15')](db[_0x5343('0x16')][_0x5343('0x17')],function(_0x35e68c){return{'name':_0x35e68c[_0x5343('0x18')],'type':_0x35e68c[_0x5343('0x19')][_0x5343('0x1a')]};});_0x1f5098[_0x5343('0x1b')]=_['map'](_0x1eb3bd,_0x5343('0x12'));_0x1f5098[_0x5343('0x1c')]=_[_0x5343('0x1d')](_0x4cf3c2[_0x5343('0x1c')]);_0x1f5098[_0x5343('0x1e')]=_['intersection'](_0x1f5098[_0x5343('0x1b')],_0x1f5098[_0x5343('0x1c')]);_0x1f5098[_0x5343('0x1e')]=_[_0x5343('0x1f')](_0x1f5098[_0x5343('0x1e')],['$and',_0x5343('0x20'),_0x5343('0x21'),'$gte',_0x5343('0x22'),_0x5343('0x23'),_0x5343('0x24'),'$eq','$not',_0x5343('0x25'),'$notBetween',_0x5343('0x26'),'$notIn',_0x5343('0x27'),'$notLike','$iLike',_0x5343('0x28'),_0x5343('0x27'),'$overlap','$contains',_0x5343('0x29'),'$any']);_0xec1ba0[_0x5343('0x2a')]=_['intersection'](_0x1f5098['model'],qs[_0x5343('0x2b')](_0x4cf3c2['query']['fields']));_0xec1ba0[_0x5343('0x2a')]=_0xec1ba0[_0x5343('0x2a')][_0x5343('0x2c')]?_0xec1ba0[_0x5343('0x2a')]:_0x1f5098['model'];if(!_0x4cf3c2['query'][_0x5343('0x2d')](_0x5343('0x2e'))){_0xec1ba0[_0x5343('0x9')]=qs[_0x5343('0x9')](_0x4cf3c2[_0x5343('0x1c')][_0x5343('0x9')]);_0xec1ba0[_0x5343('0x7')]=qs[_0x5343('0x7')](_0x4cf3c2[_0x5343('0x1c')][_0x5343('0x7')]);}_0xec1ba0[_0x5343('0x2f')]=qs[_0x5343('0x30')](_0x4cf3c2['query']['sort']);_0xec1ba0[_0x5343('0x31')]=qs[_0x5343('0x1e')](_['pick'](_0x4cf3c2[_0x5343('0x1c')],_0x1f5098['filters']),_0x1eb3bd);if(_0x4cf3c2[_0x5343('0x1c')][_0x5343('0x32')]){_0xec1ba0[_0x5343('0x31')]=_[_0x5343('0x33')](_0xec1ba0['where'],{'$or':_['map'](_0x1eb3bd,function(_0x3d7e4c){if(_0x3d7e4c['type']!==_0x5343('0x34')){var _0x11954b={};_0x11954b[_0x3d7e4c['name']]={'$like':'%'+_0x4cf3c2[_0x5343('0x1c')]['filter']+'%'};return _0x11954b;}})});}_0xec1ba0=_['merge']({},_0xec1ba0,_0x4cf3c2[_0x5343('0x35')]);var _0x16383f={'where':_0xec1ba0[_0x5343('0x31')]};return db[_0x5343('0x16')]['count'](_0x16383f)['then'](function(_0x5a0663){_0x489e1c['count']=_0x5a0663;if(_0x4cf3c2[_0x5343('0x1c')][_0x5343('0x36')]){_0xec1ba0[_0x5343('0x37')]=[{'all':!![]}];}return db[_0x5343('0x16')][_0x5343('0x38')](_0xec1ba0);})[_0x5343('0x39')](function(_0x3c112a){_0x489e1c['rows']=_0x3c112a;return _0x489e1c;})[_0x5343('0x39')](respondWithFilteredResult(_0x432992,_0xec1ba0))['catch'](handleError(_0x432992,null));};exports[_0x5343('0x3a')]=function(_0x3c6d7b,_0x35511b){var _0x2f004a={'raw':!![],'where':{'id':_0x3c6d7b[_0x5343('0x3b')]['id']}},_0x849368={};_0x849368[_0x5343('0x1b')]=_['keys'](db[_0x5343('0x16')]['rawAttributes']);_0x849368[_0x5343('0x1c')]=_[_0x5343('0x1d')](_0x3c6d7b[_0x5343('0x1c')]);_0x849368[_0x5343('0x1e')]=_[_0x5343('0x3c')](_0x849368[_0x5343('0x1b')],_0x849368[_0x5343('0x1c')]);_0x2f004a['attributes']=_[_0x5343('0x3c')](_0x849368[_0x5343('0x1b')],qs['fields'](_0x3c6d7b[_0x5343('0x1c')][_0x5343('0x2b')]));_0x2f004a['attributes']=_0x2f004a['attributes'][_0x5343('0x2c')]?_0x2f004a[_0x5343('0x2a')]:_0x849368[_0x5343('0x1b')];if(_0x3c6d7b['query'][_0x5343('0x36')]){_0x2f004a[_0x5343('0x37')]=[{'all':!![]}];}_0x2f004a=_[_0x5343('0x33')]({},_0x2f004a,_0x3c6d7b[_0x5343('0x35')]);return db[_0x5343('0x16')][_0x5343('0x3d')](_0x2f004a)[_0x5343('0x39')](handleEntityNotFound(_0x35511b,null))['then'](respondWithResult(_0x35511b,null))[_0x5343('0x3e')](handleError(_0x35511b,null));};exports[_0x5343('0x3f')]=function(_0x111c10,_0x117671){return db[_0x5343('0x16')][_0x5343('0x3f')](_0x111c10[_0x5343('0x40')],{})[_0x5343('0x39')](respondWithResult(_0x117671,0xc9))[_0x5343('0x3e')](handleError(_0x117671,null));};exports[_0x5343('0xe')]=function(_0xd4e75,_0x15cca4){if(_0xd4e75[_0x5343('0x40')]['id']){delete _0xd4e75[_0x5343('0x40')]['id'];}return db[_0x5343('0x16')]['find']({'where':{'id':_0xd4e75[_0x5343('0x3b')]['id']}})[_0x5343('0x39')](handleEntityNotFound(_0x15cca4,null))['then'](saveUpdates(_0xd4e75[_0x5343('0x40')],null))[_0x5343('0x39')](respondWithResult(_0x15cca4,null))[_0x5343('0x3e')](handleError(_0x15cca4,null));};exports[_0x5343('0x41')]=function(_0x194316,_0x5bf69c){return db[_0x5343('0x16')]['describe']()['then'](respondWithResult(_0x5bf69c,null))[_0x5343('0x3e')](handleError(_0x5bf69c,null));};exports[_0x5343('0x42')]=function(_0x10329c,_0x1cd4ed){var _0x4bc427;var _0x15c77b=_0x10329c[_0x5343('0x3b')]['id'];return db[_0x5343('0x16')][_0x5343('0x3d')]({'where':{'id':_0x10329c[_0x5343('0x3b')]['id']}})[_0x5343('0x39')](handleEntityNotFound(_0x1cd4ed,null))[_0x5343('0x39')](function(_0x39aee1){if(_0x39aee1){return _0x39aee1[_0x5343('0x42')]()[_0x5343('0x39')](function(_0x566d71){return _0x566d71;});}})[_0x5343('0x39')](function(_0x2184e9){_0x4bc427=_0x2184e9;if(_0x2184e9){if(_0x2184e9[_0x5343('0x43')]||_0x2184e9[_0x5343('0x44')]){return db[_0x2184e9[_0x5343('0x43')]?_0x5343('0x45'):_0x5343('0x46')][_0x5343('0x3d')]({'where':{'id':_0x2184e9[_0x5343('0x43')]?_0x2184e9[_0x5343('0x43')]:_0x2184e9['CampaignId']},'attributes':['id',_0x5343('0x12')],'raw':!![]});}}})['then'](function(_0x50cd81){var _0x32f2bf={};if(_0x50cd81){_[_0x5343('0x33')](_0x32f2bf,_[_0x5343('0x47')](_0x4bc427[_0x5343('0x48')],[_0x5343('0x49'),'updatedAt','id']));_0x32f2bf[_0x5343('0x4a')]=0x15;_0x32f2bf['statedesc']=_0x5343('0x4b');_0x32f2bf['campaign']=_0x50cd81[_0x5343('0x12')];_0x32f2bf['membername']=_0x10329c[_0x5343('0x4c')][_0x5343('0x12')];_0x32f2bf[_0x5343('0x4d')]=_0x10329c[_0x5343('0x4c')]['id'];_0x32f2bf[_0x5343('0x4b')]=!![];_0x32f2bf['deletedat']=moment()[_0x5343('0x4e')](_0x5343('0x4f'));_0x32f2bf[_0x5343('0x50')]=_0x4bc427[_0x5343('0x51')];_0x32f2bf[_0x5343('0x52')]=_0x4bc427['VoiceQueueId']?'queue':_0x5343('0x53');return db['CmContact'][_0x5343('0x3d')]({'where':{'id':_0x32f2bf[_0x5343('0x54')]},'attributes':[_0x5343('0x55'),_0x5343('0x56')]})[_0x5343('0x39')](function(_0x434867){if(!_[_0x5343('0x57')](_0x1cd4ed)&&!_['isNil'](_0x434867[_0x5343('0x55')])){_0x32f2bf[_0x5343('0x58')]=_0x434867['firstName'];if(!_[_0x5343('0x57')](_0x434867['lastName'])){_0x32f2bf[_0x5343('0x58')]+='\x20'+_0x434867['lastName'];}}})[_0x5343('0x59')](function(){return db['CmHopperFinal'][_0x5343('0x3f')](_0x32f2bf);});}})[_0x5343('0x39')](function(_0x44d173){return db[_0x5343('0x5a')][_0x5343('0x42')]({'where':{'CmHopperId':_0x15c77b}});})[_0x5343('0x39')](function(){return _0x1cd4ed['status'](0xcc)[_0x5343('0x5b')]();})[_0x5343('0x3e')](handleError(_0x1cd4ed,null));};exports[_0x5343('0x5c')]=function(_0x201f20,_0x59ea40){var _0xd0ce1d=[];return db[_0x5343('0x5d')]['describe']()[_0x5343('0x39')](function(_0x25635d){_0xd0ce1d=_[_0x5343('0x1d')](_0x25635d);return _0x201f20['user'][_0x5343('0x5e')]({'where':{'type':_0x5343('0x5f'),'dialActive':!![],'dialMethod':_0x5343('0x60')},'attributes':['id',_0x5343('0x61'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x5343('0x39')](function(_0x60fffb){if(_0x60fffb&&_0x60fffb[_0x5343('0x2c')]){return db[_0x5343('0x62')][_0x5343('0x63')](function(_0x49b347){var _0x52c679={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5343('0x4e')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x60fffb,'id')},'$or':[{'UserId':null},{'UserId':_0x201f20[_0x5343('0x4c')]['id']}]};var _0x368201={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x60fffb)[_0x5343('0x32')](['dialPreviewAutoRecallMe',0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x201f20[_0x5343('0x4c')]['id']}]};var _0x1a2096={'$or':[_0x52c679,_0x368201]};var _0x1c8bae=[];if(_0x201f20[_0x5343('0x40')][_0x5343('0x64')]&&_0x201f20[_0x5343('0x40')][_0x5343('0x64')]===_0x5343('0x65')){if(!_['isEmpty'](_0x201f20['body']['hopperIds'])){_0x1a2096['id']={'$in':_0x201f20[_0x5343('0x40')][_0x5343('0x66')]};}_0x1c8bae=[['priority',_0x5343('0x67')],['scheduledAt',_0x60fffb[0x0][_0x5343('0x61')]===_0x5343('0x67')?_0x5343('0x68'):_0x5343('0x67')],db[_0x5343('0x62')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x5343('0x69')](_0x201f20[_0x5343('0x40')][_0x5343('0x66')])){_0x1a2096['id']={'$notIn':_0x201f20[_0x5343('0x40')][_0x5343('0x66')]};}_0x1c8bae=[['priority',_0x5343('0x68')],['scheduledAt',_0x60fffb[0x0]['dialOrderByScheduledAt']],db[_0x5343('0x62')][_0x5343('0x6a')](_0x5343('0x6b')),['id',_0x5343('0x67')]];}return db[_0x5343('0x16')][_0x5343('0x6c')]({'attributes':['id',_0x5343('0x6d'),_0x5343('0x51'),'recallme'],'where':_0x1a2096,'order':_0x1c8bae,'transaction':_0x49b347,'lock':_0x49b347[_0x5343('0x6e')]['UPDATE'],'include':[{'model':db[_0x5343('0x5d')],'as':_0x5343('0x6f'),'attributes':_0xd0ce1d,'include':[{'model':db[_0x5343('0x70')],'as':_0x5343('0x71'),'attributes':['id',_0x5343('0x12')]}]},{'model':db[_0x5343('0x72')],'as':'List','attributes':['id','name']},{'model':db[_0x5343('0x45')],'as':'Queue','attributes':['id','name','dialActive']}]})['then'](function(_0x35af3b){if(_0x35af3b){return _0x35af3b[_0x5343('0xe')]({'UserId':_0x201f20[_0x5343('0x4c')]['id']},{'transaction':_0x49b347});}});});}})[_0x5343('0x39')](handleEntityNotFound(_0x59ea40,null))[_0x5343('0x39')](respondWithResult(_0x59ea40,null))[_0x5343('0x3e')](handleError(_0x59ea40,null));};exports[_0x5343('0x73')]=function(_0x16c13e,_0x1f86a0,_0x2c5f5f){var _0x5a450a=[];var _0x5f55ae=_0x16c13e[_0x5343('0x3b')]['id'];var _0x3b8ed1=_0x16c13e[_0x5343('0x4c')]['id'];return db['CmContact'][_0x5343('0x41')]()['then'](function(_0xcda1d1){_0x5a450a=_[_0x5343('0x1d')](_0xcda1d1);return db['sequelize']['transaction'](function(_0x1fa24e){const _0x57ffb2={'id':_0x5f55ae};return db['CmHopper']['findOne']({'attributes':['id',_0x5343('0x6d'),_0x5343('0x74')],'where':_0x57ffb2,'transaction':_0x1fa24e,'lock':_0x1fa24e[_0x5343('0x6e')][_0x5343('0x75')],'include':[{'model':db[_0x5343('0x5d')],'as':'Contact','attributes':_0x5a450a,'include':[{'model':db['CmCompany'],'as':_0x5343('0x71'),'attributes':['id',_0x5343('0x12')]}]},{'model':db[_0x5343('0x72')],'as':_0x5343('0x76'),'attributes':['id',_0x5343('0x12')]},{'model':db[_0x5343('0x45')],'as':_0x5343('0x77'),'attributes':['id',_0x5343('0x12'),_0x5343('0x78')]}]})[_0x5343('0x39')](function(_0x4c4ff7){if(_0x4c4ff7){return _0x4c4ff7[_0x5343('0xe')]({'UserId':_0x3b8ed1},{'transaction':_0x1fa24e});}});});})[_0x5343('0x39')](handleEntityNotFound(_0x1f86a0,null))[_0x5343('0x39')](respondWithResult(_0x1f86a0,null))[_0x5343('0x3e')](handleError(_0x1f86a0,null));};exports[_0x5343('0x79')]=function(_0x268de3,_0x1785da){return _0x268de3[_0x5343('0x4c')][_0x5343('0x5e')]({'where':{'type':_0x5343('0x5f'),'dialActive':!![],'dialMethod':_0x5343('0x60')},'attributes':['id'],'raw':!![]})[_0x5343('0x39')](function(_0x58ec51){if(_0x58ec51&&_0x58ec51[_0x5343('0x2c')]){return db[_0x5343('0x16')][_0x5343('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x5343('0x15')](_0x58ec51,'id')},'$or':[{'UserId':null},{'UserId':_0x268de3['user']['id']}]}});}return 0x0;})[_0x5343('0x39')](function(_0xfe492a){if(!_[_0x5343('0x57')](_0xfe492a)&&_['isNumber'](_0xfe492a)){return _0x1785da[_0x5343('0xb')](0xc8)['json']({'contacts':_0xfe492a});}else{logger[_0x5343('0x10')](_0x5343('0x7a'),_0x5343('0x79'),0x194,'entity\x20not\x20found');_0x1785da[_0x5343('0xf')](0x194);}})['catch'](handleError(_0x1785da,null));};exports['getTimezones']=function(_0x182455,_0x136138){var _0x4f339d=shared[_0x5343('0x7b')];var _0x579f84=[];_['map'](_0x4f339d,function(_0x553b9a){_0x579f84[_0x5343('0x7c')]({'id':_0x553b9a[_0x5343('0x12')],'name':_0x553b9a[_0x5343('0x12')],'utcOffset':_0x553b9a[_0x5343('0x7d')]});});return _0x136138[_0x5343('0xb')](0xc8)[_0x5343('0x6')]({'tz':_0x579f84});};exports[_0x5343('0x7e')]=function(_0x37d128,_0x36d9b8){var _0x36ac0b=shared[_0x5343('0x7b')];var _0xd287d2={};if(!_[_0x5343('0x57')](_0x36ac0b[_0x37d128['body']['id']]))_0xd287d2=_0x36ac0b[_0x37d128['body']['id']];return _0x36d9b8[_0x5343('0xb')](0xc8)[_0x5343('0x6')](_0xd287d2);}; \ No newline at end of file +var _0xe5b3=['value','direction','prev','hopperIds','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','dialOrderByScheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','UPDATE','CmContact','Contact','CmCompany','Company','List','dialActive','getPreviewRecall','findOne','Queue','getOpenContacts','preview','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','push','utcOffset','getTimezone','timezones','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','update','sendStatus','error','name','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','filters','concat','$and','$gt','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$notILike','$overlap','$contains','$contained','$any','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','params','options','find','then','catch','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','statedesc','user','UserId','calleridnum','phone','campaigntype','queue','ContactId','firstName','lastName','calleridname','isNil','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','dialPreviewAutoRecallMe','sequelize','transaction','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x26f075,_0x35cdbe){var _0x50b848=function(_0x52f7c2){while(--_0x52f7c2){_0x26f075['push'](_0x26f075['shift']());}};_0x50b848(++_0x35cdbe);}(_0xe5b3,0x133));var _0x3e5b=function(_0x253ed4,_0x342aca){_0x253ed4=_0x253ed4-0x0;var _0x22df23=_0xe5b3[_0x253ed4];return _0x22df23;};'use strict';var moment=require('moment');var _=require(_0x3e5b('0x0'));var qs=require(_0x3e5b('0x1'));var logger=require(_0x3e5b('0x2'))(_0x3e5b('0x3'));var shared=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];function respondWithResult(_0x7f1cc0,_0x1e58ed){_0x1e58ed=_0x1e58ed||0xc8;return function(_0x320b1e){if(_0x320b1e){return _0x7f1cc0[_0x3e5b('0x6')](_0x1e58ed)[_0x3e5b('0x7')](_0x320b1e);}};}function respondWithFilteredResult(_0x54e1fb,_0x174923){return function(_0x5dcf55){if(_0x5dcf55){var _0x534e7d=typeof _0x174923[_0x3e5b('0x8')]===_0x3e5b('0x9')&&typeof _0x174923[_0x3e5b('0xa')]===_0x3e5b('0x9');var _0x5282fd=_0x5dcf55['count'];var _0x1fef54=_0x534e7d?0x0:_0x174923[_0x3e5b('0x8')];var _0x22fc1a=_0x534e7d?_0x5dcf55[_0x3e5b('0xb')]:_0x174923[_0x3e5b('0x8')]+_0x174923['limit'];var _0x3be027;if(_0x22fc1a>=_0x5282fd){_0x22fc1a=_0x5282fd;_0x3be027=0xc8;}else{_0x3be027=0xce;}_0x54e1fb['status'](_0x3be027);return _0x54e1fb[_0x3e5b('0xc')](_0x3e5b('0xd'),_0x1fef54+'-'+_0x22fc1a+'/'+_0x5282fd)[_0x3e5b('0x7')](_0x5dcf55);}return null;};}function saveUpdates(_0x374068,_0x20b97b){return function(_0x3c4eb1){if(_0x3c4eb1){return _0x3c4eb1[_0x3e5b('0xe')](_0x374068)['then'](function(_0x39a2a1){return _0x39a2a1;});}return null;};}function handleEntityNotFound(_0x5f2f9c,_0x51a188){return function(_0x4d71a3){if(!_0x4d71a3){_0x5f2f9c[_0x3e5b('0xf')](0x194);}return _0x4d71a3;};}function handleError(_0x3f5368,_0x17aaa3){_0x17aaa3=_0x17aaa3||0x1f4;return function(_0x4fb471){logger[_0x3e5b('0x10')](_0x4fb471['stack']);if(_0x4fb471['name']){delete _0x4fb471[_0x3e5b('0x11')];}_0x3f5368[_0x3e5b('0x6')](_0x17aaa3)['send'](_0x4fb471);};}exports[_0x3e5b('0x12')]=function(_0x143040,_0x555002){var _0xc56a2a={},_0x3365dd={},_0x52696c={'count':0x0,'rows':[]};var _0x4b189d=_[_0x3e5b('0x13')](db[_0x3e5b('0x14')][_0x3e5b('0x15')],function(_0xff4aba){return{'name':_0xff4aba[_0x3e5b('0x16')],'type':_0xff4aba[_0x3e5b('0x17')][_0x3e5b('0x18')]};});_0x3365dd[_0x3e5b('0x19')]=_[_0x3e5b('0x13')](_0x4b189d,_0x3e5b('0x11'));_0x3365dd[_0x3e5b('0x1a')]=_[_0x3e5b('0x1b')](_0x143040[_0x3e5b('0x1a')]);_0x3365dd[_0x3e5b('0x1c')]=_['intersection'](_0x3365dd[_0x3e5b('0x19')],_0x3365dd[_0x3e5b('0x1a')]);_0x3365dd[_0x3e5b('0x1c')]=_[_0x3e5b('0x1d')](_0x3365dd['filters'],[_0x3e5b('0x1e'),'$or',_0x3e5b('0x1f'),_0x3e5b('0x20'),'$lt',_0x3e5b('0x21'),_0x3e5b('0x22'),_0x3e5b('0x23'),_0x3e5b('0x24'),_0x3e5b('0x25'),_0x3e5b('0x26'),_0x3e5b('0x27'),_0x3e5b('0x28'),'$like',_0x3e5b('0x29'),'$iLike',_0x3e5b('0x2a'),'$like',_0x3e5b('0x2b'),_0x3e5b('0x2c'),_0x3e5b('0x2d'),_0x3e5b('0x2e')]);_0xc56a2a[_0x3e5b('0x2f')]=_[_0x3e5b('0x30')](_0x3365dd[_0x3e5b('0x19')],qs[_0x3e5b('0x31')](_0x143040[_0x3e5b('0x1a')][_0x3e5b('0x31')]));_0xc56a2a[_0x3e5b('0x2f')]=_0xc56a2a['attributes'][_0x3e5b('0x32')]?_0xc56a2a[_0x3e5b('0x2f')]:_0x3365dd[_0x3e5b('0x19')];if(!_0x143040[_0x3e5b('0x1a')][_0x3e5b('0x33')](_0x3e5b('0x34'))){_0xc56a2a[_0x3e5b('0xa')]=qs['limit'](_0x143040[_0x3e5b('0x1a')]['limit']);_0xc56a2a['offset']=qs[_0x3e5b('0x8')](_0x143040[_0x3e5b('0x1a')]['offset']);}_0xc56a2a[_0x3e5b('0x35')]=qs[_0x3e5b('0x36')](_0x143040[_0x3e5b('0x1a')][_0x3e5b('0x36')]);_0xc56a2a[_0x3e5b('0x37')]=qs[_0x3e5b('0x1c')](_[_0x3e5b('0x38')](_0x143040[_0x3e5b('0x1a')],_0x3365dd[_0x3e5b('0x1c')]),_0x4b189d);if(_0x143040[_0x3e5b('0x1a')][_0x3e5b('0x39')]){_0xc56a2a[_0x3e5b('0x37')]=_['merge'](_0xc56a2a[_0x3e5b('0x37')],{'$or':_[_0x3e5b('0x13')](_0x4b189d,function(_0x53caa2){if(_0x53caa2['type']!==_0x3e5b('0x3a')){var _0x56d7ef={};_0x56d7ef[_0x53caa2[_0x3e5b('0x11')]]={'$like':'%'+_0x143040[_0x3e5b('0x1a')][_0x3e5b('0x39')]+'%'};return _0x56d7ef;}})});}_0xc56a2a=_[_0x3e5b('0x3b')]({},_0xc56a2a,_0x143040['options']);var _0x18b07f={'where':_0xc56a2a['where']};return db[_0x3e5b('0x14')]['count'](_0x18b07f)['then'](function(_0x48f414){_0x52696c[_0x3e5b('0xb')]=_0x48f414;if(_0x143040[_0x3e5b('0x1a')][_0x3e5b('0x3c')]){_0xc56a2a[_0x3e5b('0x3d')]=[{'all':!![]}];}return db[_0x3e5b('0x14')][_0x3e5b('0x3e')](_0xc56a2a);})['then'](function(_0x5d0c59){_0x52696c['rows']=_0x5d0c59;return _0x52696c;})['then'](respondWithFilteredResult(_0x555002,_0xc56a2a))['catch'](handleError(_0x555002,null));};exports['show']=function(_0x5aad1d,_0x182bc4){var _0x349de0={'raw':!![],'where':{'id':_0x5aad1d[_0x3e5b('0x3f')]['id']}},_0x13a48d={};_0x13a48d[_0x3e5b('0x19')]=_[_0x3e5b('0x1b')](db[_0x3e5b('0x14')][_0x3e5b('0x15')]);_0x13a48d[_0x3e5b('0x1a')]=_[_0x3e5b('0x1b')](_0x5aad1d[_0x3e5b('0x1a')]);_0x13a48d['filters']=_[_0x3e5b('0x30')](_0x13a48d[_0x3e5b('0x19')],_0x13a48d[_0x3e5b('0x1a')]);_0x349de0[_0x3e5b('0x2f')]=_[_0x3e5b('0x30')](_0x13a48d[_0x3e5b('0x19')],qs[_0x3e5b('0x31')](_0x5aad1d[_0x3e5b('0x1a')][_0x3e5b('0x31')]));_0x349de0[_0x3e5b('0x2f')]=_0x349de0[_0x3e5b('0x2f')]['length']?_0x349de0['attributes']:_0x13a48d['model'];if(_0x5aad1d['query'][_0x3e5b('0x3c')]){_0x349de0[_0x3e5b('0x3d')]=[{'all':!![]}];}_0x349de0=_[_0x3e5b('0x3b')]({},_0x349de0,_0x5aad1d[_0x3e5b('0x40')]);return db[_0x3e5b('0x14')][_0x3e5b('0x41')](_0x349de0)[_0x3e5b('0x42')](handleEntityNotFound(_0x182bc4,null))[_0x3e5b('0x42')](respondWithResult(_0x182bc4,null))[_0x3e5b('0x43')](handleError(_0x182bc4,null));};exports[_0x3e5b('0x44')]=function(_0x5d318a,_0x1392f8){return db[_0x3e5b('0x14')][_0x3e5b('0x44')](_0x5d318a[_0x3e5b('0x45')],{})[_0x3e5b('0x42')](respondWithResult(_0x1392f8,0xc9))['catch'](handleError(_0x1392f8,null));};exports['update']=function(_0x495217,_0x1fbd87){if(_0x495217[_0x3e5b('0x45')]['id']){delete _0x495217[_0x3e5b('0x45')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x495217[_0x3e5b('0x3f')]['id']}})[_0x3e5b('0x42')](handleEntityNotFound(_0x1fbd87,null))[_0x3e5b('0x42')](saveUpdates(_0x495217['body'],null))['then'](respondWithResult(_0x1fbd87,null))[_0x3e5b('0x43')](handleError(_0x1fbd87,null));};exports['describe']=function(_0x14b62a,_0x3379a1){return db[_0x3e5b('0x14')][_0x3e5b('0x46')]()[_0x3e5b('0x42')](respondWithResult(_0x3379a1,null))[_0x3e5b('0x43')](handleError(_0x3379a1,null));};exports[_0x3e5b('0x47')]=function(_0x3ea5aa,_0x339852){var _0x4a2ae1;var _0x223185=_0x3ea5aa['params']['id'];return db[_0x3e5b('0x14')][_0x3e5b('0x41')]({'where':{'id':_0x3ea5aa[_0x3e5b('0x3f')]['id']}})[_0x3e5b('0x42')](handleEntityNotFound(_0x339852,null))[_0x3e5b('0x42')](function(_0x3a4f26){if(_0x3a4f26){return _0x3a4f26[_0x3e5b('0x47')]()[_0x3e5b('0x42')](function(_0x2b5d3d){return _0x2b5d3d;});}})[_0x3e5b('0x42')](function(_0xf6ca5b){_0x4a2ae1=_0xf6ca5b;if(_0xf6ca5b){if(_0xf6ca5b[_0x3e5b('0x48')]||_0xf6ca5b[_0x3e5b('0x49')]){return db[_0xf6ca5b['VoiceQueueId']?_0x3e5b('0x4a'):_0x3e5b('0x4b')][_0x3e5b('0x41')]({'where':{'id':_0xf6ca5b[_0x3e5b('0x48')]?_0xf6ca5b[_0x3e5b('0x48')]:_0xf6ca5b[_0x3e5b('0x49')]},'attributes':['id','name'],'raw':!![]});}}})[_0x3e5b('0x42')](function(_0x1cbdf7){var _0x25b166={};if(_0x1cbdf7){_[_0x3e5b('0x3b')](_0x25b166,_[_0x3e5b('0x4c')](_0x4a2ae1[_0x3e5b('0x4d')],[_0x3e5b('0x4e'),_0x3e5b('0x4f'),'id']));_0x25b166['state']=0x15;_0x25b166[_0x3e5b('0x50')]='deleted';_0x25b166['campaign']=_0x1cbdf7[_0x3e5b('0x11')];_0x25b166['membername']=_0x3ea5aa[_0x3e5b('0x51')][_0x3e5b('0x11')];_0x25b166[_0x3e5b('0x52')]=_0x3ea5aa[_0x3e5b('0x51')]['id'];_0x25b166['deleted']=!![];_0x25b166['deletedat']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x25b166[_0x3e5b('0x53')]=_0x4a2ae1[_0x3e5b('0x54')];_0x25b166[_0x3e5b('0x55')]=_0x4a2ae1[_0x3e5b('0x48')]?_0x3e5b('0x56'):'ivr';return db['CmContact'][_0x3e5b('0x41')]({'where':{'id':_0x25b166[_0x3e5b('0x57')]},'attributes':[_0x3e5b('0x58'),_0x3e5b('0x59')]})[_0x3e5b('0x42')](function(_0x51efbd){if(!_['isNil'](_0x339852)&&!_['isNil'](_0x51efbd['firstName'])){_0x25b166[_0x3e5b('0x5a')]=_0x51efbd[_0x3e5b('0x58')];if(!_[_0x3e5b('0x5b')](_0x51efbd[_0x3e5b('0x59')])){_0x25b166[_0x3e5b('0x5a')]+='\x20'+_0x51efbd[_0x3e5b('0x59')];}}})[_0x3e5b('0x5c')](function(){return db[_0x3e5b('0x5d')]['create'](_0x25b166);});}})[_0x3e5b('0x42')](function(_0x29897b){return db[_0x3e5b('0x5e')][_0x3e5b('0x47')]({'where':{'CmHopperId':_0x223185}});})[_0x3e5b('0x42')](function(){return _0x339852['status'](0xcc)[_0x3e5b('0x5f')]();})['catch'](handleError(_0x339852,null));};exports[_0x3e5b('0x60')]=function(_0x1fd40c,_0x58c41e){var _0x4a7d8e=[];return db['CmContact'][_0x3e5b('0x46')]()['then'](function(_0x1ab942){_0x4a7d8e=_[_0x3e5b('0x1b')](_0x1ab942);return _0x1fd40c[_0x3e5b('0x51')][_0x3e5b('0x61')]({'where':{'type':_0x3e5b('0x62'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt',_0x3e5b('0x63')],'raw':!![]});})[_0x3e5b('0x42')](function(_0x3f7f71){if(_0x3f7f71&&_0x3f7f71['length']){return db[_0x3e5b('0x64')][_0x3e5b('0x65')](function(_0x32a42f){var _0x1c9526={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3e5b('0x66')](_0x3e5b('0x67'))},'VoiceQueueId':{'$in':_[_0x3e5b('0x13')](_0x3f7f71,'id')},'$or':[{'UserId':null},{'UserId':_0x1fd40c[_0x3e5b('0x51')]['id']}]};var _0x3a11a8={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3f7f71)[_0x3e5b('0x39')]([_0x3e5b('0x63'),0x0])[_0x3e5b('0x13')]('id')[_0x3e5b('0x68')]()},'$or':[{'UserId':null},{'UserId':_0x1fd40c[_0x3e5b('0x51')]['id']}]};var _0x13204a={'$or':[_0x1c9526,_0x3a11a8]};var _0x2411c3=[];if(_0x1fd40c[_0x3e5b('0x45')][_0x3e5b('0x69')]&&_0x1fd40c['body'][_0x3e5b('0x69')]===_0x3e5b('0x6a')){if(!_['isEmpty'](_0x1fd40c[_0x3e5b('0x45')][_0x3e5b('0x6b')])){_0x13204a['id']={'$in':_0x1fd40c['body']['hopperIds']};}_0x2411c3=[['priority',_0x3e5b('0x6c')],[_0x3e5b('0x6d'),_0x3f7f71[0x0]['dialOrderByScheduledAt']===_0x3e5b('0x6c')?_0x3e5b('0x6e'):'ASC'],db[_0x3e5b('0x64')][_0x3e5b('0x6f')](_0x3e5b('0x70')),['id',_0x3e5b('0x6e')]];}else{if(!_[_0x3e5b('0x71')](_0x1fd40c[_0x3e5b('0x45')][_0x3e5b('0x6b')])){_0x13204a['id']={'$notIn':_0x1fd40c[_0x3e5b('0x45')][_0x3e5b('0x6b')]};}_0x2411c3=[['priority',_0x3e5b('0x6e')],[_0x3e5b('0x6d'),_0x3f7f71[0x0][_0x3e5b('0x72')]],db[_0x3e5b('0x64')][_0x3e5b('0x6f')](_0x3e5b('0x73')),['id',_0x3e5b('0x6c')]];}return db['CmHopper']['findOne']({'attributes':['id',_0x3e5b('0x74'),_0x3e5b('0x54'),'recallme'],'where':_0x13204a,'order':_0x2411c3,'transaction':_0x32a42f,'lock':_0x32a42f[_0x3e5b('0x75')][_0x3e5b('0x76')],'include':[{'model':db[_0x3e5b('0x77')],'as':_0x3e5b('0x78'),'attributes':_0x4a7d8e,'include':[{'model':db[_0x3e5b('0x79')],'as':_0x3e5b('0x7a'),'attributes':['id',_0x3e5b('0x11')]}]},{'model':db['CmList'],'as':_0x3e5b('0x7b'),'attributes':['id',_0x3e5b('0x11')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name',_0x3e5b('0x7c')]}]})[_0x3e5b('0x42')](function(_0x144738){if(_0x144738){return _0x144738[_0x3e5b('0xe')]({'UserId':_0x1fd40c[_0x3e5b('0x51')]['id']},{'transaction':_0x32a42f});}});});}})[_0x3e5b('0x42')](handleEntityNotFound(_0x58c41e,null))['then'](respondWithResult(_0x58c41e,null))[_0x3e5b('0x43')](handleError(_0x58c41e,null));};exports[_0x3e5b('0x7d')]=function(_0x4ff747,_0x34098c,_0x4da39d){var _0x4f62fb=[];var _0x211e73=_0x4ff747[_0x3e5b('0x3f')]['id'];var _0x487caf=_0x4ff747[_0x3e5b('0x51')]['id'];return db[_0x3e5b('0x77')]['describe']()[_0x3e5b('0x42')](function(_0x185640){_0x4f62fb=_[_0x3e5b('0x1b')](_0x185640);return db[_0x3e5b('0x64')][_0x3e5b('0x65')](function(_0x1541ec){const _0x5df4b1={'id':_0x211e73};return db['CmHopper'][_0x3e5b('0x7e')]({'attributes':['id','scheduledat','recallme'],'where':_0x5df4b1,'transaction':_0x1541ec,'lock':_0x1541ec[_0x3e5b('0x75')][_0x3e5b('0x76')],'include':[{'model':db[_0x3e5b('0x77')],'as':'Contact','attributes':_0x4f62fb,'include':[{'model':db[_0x3e5b('0x79')],'as':'Company','attributes':['id',_0x3e5b('0x11')]}]},{'model':db['CmList'],'as':_0x3e5b('0x7b'),'attributes':['id',_0x3e5b('0x11')]},{'model':db[_0x3e5b('0x4a')],'as':_0x3e5b('0x7f'),'attributes':['id','name',_0x3e5b('0x7c')]}]})['then'](function(_0x2cbf55){if(_0x2cbf55){return _0x2cbf55[_0x3e5b('0xe')]({'UserId':_0x487caf},{'transaction':_0x1541ec});}});});})['then'](handleEntityNotFound(_0x34098c,null))[_0x3e5b('0x42')](respondWithResult(_0x34098c,null))[_0x3e5b('0x43')](handleError(_0x34098c,null));};exports[_0x3e5b('0x80')]=function(_0x5ad011,_0x2d55eb){return _0x5ad011[_0x3e5b('0x51')][_0x3e5b('0x61')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x3e5b('0x81')},'attributes':['id'],'raw':!![]})[_0x3e5b('0x42')](function(_0x4b9774){if(_0x4b9774&&_0x4b9774[_0x3e5b('0x32')]){return db[_0x3e5b('0x14')][_0x3e5b('0xb')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x3e5b('0x67'))},'VoiceQueueId':{'$in':_[_0x3e5b('0x13')](_0x4b9774,'id')},'$or':[{'UserId':null},{'UserId':_0x5ad011[_0x3e5b('0x51')]['id']}]}});}return 0x0;})[_0x3e5b('0x42')](function(_0x4bf039){if(!_[_0x3e5b('0x5b')](_0x4bf039)&&_['isNumber'](_0x4bf039)){return _0x2d55eb[_0x3e5b('0x6')](0xc8)['json']({'contacts':_0x4bf039});}else{logger[_0x3e5b('0x10')](_0x3e5b('0x82'),'getOpenContacts',0x194,_0x3e5b('0x83'));_0x2d55eb[_0x3e5b('0xf')](0x194);}})['catch'](handleError(_0x2d55eb,null));};exports[_0x3e5b('0x84')]=function(_0x271930,_0x2907dd){var _0x46ce2b=shared['timezones'];var _0x53328b=[];_[_0x3e5b('0x13')](_0x46ce2b,function(_0x37c2ff){_0x53328b[_0x3e5b('0x85')]({'id':_0x37c2ff[_0x3e5b('0x11')],'name':_0x37c2ff[_0x3e5b('0x11')],'utcOffset':_0x37c2ff[_0x3e5b('0x86')]});});return _0x2907dd['status'](0xc8)['json']({'tz':_0x53328b});};exports[_0x3e5b('0x87')]=function(_0x203279,_0x902bb8){var _0x25dec7=shared[_0x3e5b('0x88')];var _0x3f1a82={};if(!_[_0x3e5b('0x5b')](_0x25dec7[_0x203279[_0x3e5b('0x45')]['id']]))_0x3f1a82=_0x25dec7[_0x203279['body']['id']];return _0x902bb8['status'](0xc8)[_0x3e5b('0x7')](_0x3f1a82);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 3d7205c..cea1efa 100644 --- a/server/api/cmHopper/cmHopper.model.js +++ b/server/api/cmHopper/cmHopper.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xacf4=['define','CmHopper','cm_hopper','scheduledat','phone','priority','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopper.attributes','exports'];(function(_0xa1f6e8,_0xbf3f9c){var _0x40705d=function(_0x2327cb){while(--_0x2327cb){_0xa1f6e8['push'](_0xa1f6e8['shift']());}};_0x40705d(++_0xbf3f9c);}(_0xacf4,0xe7));var _0x4acf=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0xacf4[_0x4063a4];return _0x17908d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('0xb'),'paranoid':![],'indexes':[{'name':_0x4acf('0xc'),'fields':['scheduledat']},{'name':'phone','fields':[_0x4acf('0xd')]},{'name':'priority','fields':[_0x4acf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xafc4=['priority','lodash','../../config/logger','moment','bluebird','request-promise','path','exports','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x1b7f41,_0x551f5e){var _0x6de980=function(_0x346022){while(--_0x346022){_0x1b7f41['push'](_0x1b7f41['shift']());}};_0x6de980(++_0x551f5e);}(_0xafc4,0x69));var _0x4afc=function(_0x323d86,_0x2f9bce){_0x323d86=_0x323d86-0x0;var _0x12a644=_0xafc4[_0x323d86];return _0x12a644;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x4afc('0xa')]},{'name':_0x4afc('0xb'),'fields':[_0x4afc('0xb')]},{'name':_0x4afc('0xc'),'fields':[_0x4afc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 8e0554f..856cab0 100644 --- a/server/api/cmHopper/cmHopper.rpc.js +++ b/server/api/cmHopper/cmHopper.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07aa=['CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','GetCmHopperPreview','keys','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','name','voicePause','CmList','lodash','util','moment','bluebird','../../mysqldb','rpc','CmHopper','findAll','options','where','attributes','limit','include','map','model','then','info','GetCmHopper','debug','stringify','error','message','ShowCmHopper','find','CreateCmHopper','create','body','catch','UpdateCmHopper','update','raw','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','User','Agent','length','UserId','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active'];(function(_0x1e8b1e,_0x407bbd){var _0x4a0fde=function(_0x4fd2be){while(--_0x4fd2be){_0x1e8b1e['push'](_0x1e8b1e['shift']());}};_0x4a0fde(++_0x407bbd);}(_0x07aa,0xb7));var _0xa07a=function(_0x1d0ff2,_0x5469bd){_0x1d0ff2=_0x1d0ff2-0x0;var _0x352ae1=_0x07aa[_0x1d0ff2];return _0x352ae1;};'use strict';var _=require(_0xa07a('0x0'));var util=require(_0xa07a('0x1'));var moment=require(_0xa07a('0x2'));var BPromise=require(_0xa07a('0x3'));var db=require(_0xa07a('0x4'))['db'];var logger=require('../../config/logger')(_0xa07a('0x5'));exports['GetCmHopper']=function(_0x3d84ba){var _0x311484=this;return new Promise(function(_0x29d011,_0x4b9219){return db[_0xa07a('0x6')][_0xa07a('0x7')]({'raw':_0x3d84ba['options']?_0x3d84ba[_0xa07a('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x3d84ba[_0xa07a('0x8')]?_0x3d84ba[_0xa07a('0x8')][_0xa07a('0x9')]||null:null,'attributes':_0x3d84ba['options']?_0x3d84ba[_0xa07a('0x8')][_0xa07a('0xa')]||null:null,'limit':_0x3d84ba['options']?_0x3d84ba[_0xa07a('0x8')][_0xa07a('0xb')]||null:null,'include':_0x3d84ba[_0xa07a('0x8')]?_0x3d84ba[_0xa07a('0x8')][_0xa07a('0xc')]?_[_0xa07a('0xd')](_0x3d84ba[_0xa07a('0x8')][_0xa07a('0xc')],function(_0x496717){return{'model':db[_0x496717['model']],'as':_0x496717['as'],'attributes':_0x496717[_0xa07a('0xa')],'include':_0x496717['include']?_[_0xa07a('0xd')](_0x496717[_0xa07a('0xc')],function(_0x23f27a){return{'model':db[_0x23f27a[_0xa07a('0xe')]],'as':_0x23f27a['as'],'attributes':_0x23f27a[_0xa07a('0xa')],'include':_0x23f27a['include']?_[_0xa07a('0xd')](_0x23f27a['include'],function(_0x5ebdba){return{'model':db[_0x5ebdba['model']],'as':_0x5ebdba['as'],'attributes':_0x5ebdba['attributes']};}):[]};}):[]};}):[]:[]})[_0xa07a('0xf')](function(_0x4cea1b){logger[_0xa07a('0x10')](_0xa07a('0x11'),_0x3d84ba);logger[_0xa07a('0x12')]('GetCmHopper',_0x3d84ba,JSON[_0xa07a('0x13')](_0x4cea1b));_0x29d011(_0x4cea1b);})['catch'](function(_0x502a59){logger['error'](_0xa07a('0x11'),_0x502a59['message'],_0x3d84ba);_0x4b9219(_0x311484[_0xa07a('0x14')](0x1f4,_0x502a59[_0xa07a('0x15')]));});});};exports[_0xa07a('0x16')]=function(_0x71c69d){var _0x4dfcba=this;return new Promise(function(_0x48368e,_0xf19188){return db['CmHopper'][_0xa07a('0x17')]({'raw':_0x71c69d[_0xa07a('0x8')]?_0x71c69d[_0xa07a('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x71c69d['options']?_0x71c69d[_0xa07a('0x8')][_0xa07a('0x9')]||null:null,'attributes':_0x71c69d[_0xa07a('0x8')]?_0x71c69d[_0xa07a('0x8')][_0xa07a('0xa')]||null:null,'include':_0x71c69d[_0xa07a('0x8')]?_0x71c69d['options'][_0xa07a('0xc')]?_[_0xa07a('0xd')](_0x71c69d[_0xa07a('0x8')]['include'],function(_0x244534){return{'model':db[_0x244534[_0xa07a('0xe')]],'as':_0x244534['as'],'attributes':_0x244534['attributes'],'include':_0x244534[_0xa07a('0xc')]?_[_0xa07a('0xd')](_0x244534[_0xa07a('0xc')],function(_0x2eb986){return{'model':db[_0x2eb986[_0xa07a('0xe')]],'as':_0x2eb986['as'],'attributes':_0x2eb986[_0xa07a('0xa')],'include':_0x2eb986[_0xa07a('0xc')]?_[_0xa07a('0xd')](_0x2eb986[_0xa07a('0xc')],function(_0x3bf057){return{'model':db[_0x3bf057[_0xa07a('0xe')]],'as':_0x3bf057['as'],'attributes':_0x3bf057[_0xa07a('0xa')]};}):[]};}):[]};}):[]:[]})[_0xa07a('0xf')](function(_0x24d9bd){logger[_0xa07a('0x10')](_0xa07a('0x16'),_0x71c69d);logger['debug'](_0xa07a('0x16'),_0x71c69d,JSON[_0xa07a('0x13')](_0x24d9bd));_0x48368e(_0x24d9bd);})['catch'](function(_0x405de0){logger['error'](_0xa07a('0x16'),_0x405de0['message'],_0x71c69d);_0xf19188(_0x4dfcba[_0xa07a('0x14')](0x1f4,_0x405de0['message']));});});};exports[_0xa07a('0x18')]=function(_0x26b4f7){var _0x2d1606=this;return new Promise(function(_0x3e1ff4,_0x4319f5){return db[_0xa07a('0x6')][_0xa07a('0x19')](_0x26b4f7[_0xa07a('0x1a')],{'raw':_0x26b4f7[_0xa07a('0x8')]?_0x26b4f7[_0xa07a('0x8')]['raw']===undefined?!![]:![]:!![]})[_0xa07a('0xf')](function(_0x52f967){logger[_0xa07a('0x10')](_0xa07a('0x18'),_0x26b4f7);logger[_0xa07a('0x12')](_0xa07a('0x18'),_0x26b4f7,JSON[_0xa07a('0x13')](_0x52f967));_0x3e1ff4(_0x52f967);})[_0xa07a('0x1b')](function(_0x51314c){logger[_0xa07a('0x14')](_0xa07a('0x18'),_0x51314c['message'],_0x26b4f7);_0x4319f5(_0x2d1606[_0xa07a('0x14')](0x1f4,_0x51314c[_0xa07a('0x15')]));});});};exports[_0xa07a('0x1c')]=function(_0x2f63ec){var _0x4cc690=this;return new Promise(function(_0x3779fe,_0x3bdfab){return db['CmHopper'][_0xa07a('0x1d')](_0x2f63ec[_0xa07a('0x1a')],{'raw':_0x2f63ec[_0xa07a('0x8')]?_0x2f63ec[_0xa07a('0x8')][_0xa07a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f63ec['options']?_0x2f63ec[_0xa07a('0x8')][_0xa07a('0x9')]||null:null,'attributes':_0x2f63ec[_0xa07a('0x8')]?_0x2f63ec[_0xa07a('0x8')]['attributes']||null:null,'limit':_0x2f63ec[_0xa07a('0x8')]?_0x2f63ec[_0xa07a('0x8')][_0xa07a('0xb')]||null:null})['then'](function(_0x530b84){logger[_0xa07a('0x10')](_0xa07a('0x1c'),_0x2f63ec);logger[_0xa07a('0x10')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xa07a('0x13')](_0x2f63ec['options'][_0xa07a('0x9')]),_0x2f63ec['body']['active']);logger[_0xa07a('0x12')](_0xa07a('0x1c'),_0x2f63ec,JSON['stringify'](_0x530b84));_0x3779fe(_0x530b84);})[_0xa07a('0x1b')](function(_0x197244){logger[_0xa07a('0x14')](_0xa07a('0x1c'),_0x197244[_0xa07a('0x15')],_0x2f63ec);_0x3bdfab(_0x4cc690[_0xa07a('0x14')](0x1f4,_0x197244[_0xa07a('0x15')]));});});};exports[_0xa07a('0x1f')]=function(_0x46425f){var _0xd9e0e3=this;return new Promise(function(_0x178f07,_0x5977ec){return db['CmHopper'][_0xa07a('0x20')]({'where':_0x46425f[_0xa07a('0x8')]?_0x46425f[_0xa07a('0x8')]['where']||null:null})['then'](function(_0x5f0622){logger[_0xa07a('0x10')](_0xa07a('0x1f'),_0x46425f);logger[_0xa07a('0x12')](_0xa07a('0x1f'),_0x46425f,JSON['stringify'](_0x5f0622));_0x178f07(_0x5f0622);})[_0xa07a('0x1b')](function(_0x282bfd){logger[_0xa07a('0x14')](_0xa07a('0x1f'),_0x282bfd['message'],_0x46425f);_0x5977ec(_0xd9e0e3['error'](0x1f4,_0x282bfd[_0xa07a('0x15')]));});});};exports[_0xa07a('0x21')]=function(_0xde153c){var _0x5165cc=this;return new Promise(function(_0x2d8982,_0x315c3c){return db[_0xa07a('0x22')][_0xa07a('0x23')]()[_0xa07a('0xf')](function(_0x32f687){return db[_0xa07a('0x24')][_0xa07a('0x25')](function(_0x3d4cb0){return db['CmHopper'][_0xa07a('0x7')]({'where':_0xde153c[_0xa07a('0x8')]?_0xde153c[_0xa07a('0x8')][_0xa07a('0x9')]||null:null,'attributes':_0xde153c[_0xa07a('0x8')]?_0xde153c[_0xa07a('0x8')][_0xa07a('0xa')]||null:null,'limit':_0xde153c[_0xa07a('0x8')]?_0xde153c['options'][_0xa07a('0xb')]||null:null,'order':_0xde153c[_0xa07a('0x8')]?_0xde153c['options'][_0xa07a('0x26')]||null:null,'transaction':_0x3d4cb0,'lock':_0x3d4cb0[_0xa07a('0x27')][_0xa07a('0x28')],'include':[{'model':db['CmContact'],'as':_0xa07a('0x29'),'attributes':_['keys'](_0x32f687)},{'model':db[_0xa07a('0x2a')],'as':_0xa07a('0x2b'),'attributes':['id','name','voicePause']}]})[_0xa07a('0xf')](function(_0x2c2f37){var _0x1c1422=[];var _0x5640e5=[];for(var _0x2fc12e=0x0;_0x2fc12e<_0x2c2f37[_0xa07a('0x2c')];_0x2fc12e+=0x1){var _0x58710e=_0x2c2f37[_0x2fc12e][_0xa07a('0x2d')];if(_0x58710e===null){_0x1c1422[_0xa07a('0x2e')](_0x2c2f37[_0x2fc12e]['update'](_0xde153c['body'],{'transaction':_0x3d4cb0}));}else if(!_0x5640e5['includes'](_0x58710e)){_0x5640e5[_0xa07a('0x2e')](_0x58710e);_0x1c1422[_0xa07a('0x2e')](_0x2c2f37[_0x2fc12e][_0xa07a('0x1d')](_0xde153c[_0xa07a('0x1a')],{'transaction':_0x3d4cb0}));}}return BPromise[_0xa07a('0x2f')](_0x1c1422);});})['then'](function(_0x33340b){logger[_0xa07a('0x10')]('GetContactDialer',_0xde153c);if(_0x33340b[_0xa07a('0x2c')]>0x0){logger[_0xa07a('0x10')](_0xa07a('0x30'),_0x33340b[0x0][_0xa07a('0x31')]['id'],_0x33340b[0x0]['dataValues'][_0xa07a('0x32')],_0x33340b[0x0][_0xa07a('0x31')]['active']);}logger[_0xa07a('0x12')](_0xa07a('0x21'),_0xde153c,JSON['stringify'](_0x33340b));_0x2d8982(_0x33340b);})['catch'](function(_0x3badff){logger['error'](_0xa07a('0x21'),_0x3badff[_0xa07a('0x15')],_0xde153c);_0x315c3c(_0x5165cc[_0xa07a('0x14')](0x1f4,_0x3badff[_0xa07a('0x15')]));});});});};exports[_0xa07a('0x33')]=function(_0x506dff){var _0x48f2aa=this;return new Promise(function(_0x38b4bd,_0x492878){return db[_0xa07a('0x24')]['transaction'](function(_0x26cf8d){return db['CmHopperFinal']['create'](_0x506dff[_0xa07a('0x1a')],{'raw':_0x506dff[_0xa07a('0x8')]?_0x506dff[_0xa07a('0x8')][_0xa07a('0x1e')]===undefined?!![]:![]:!![],'transaction':_0x26cf8d})['then'](function(){logger['info'](_0xa07a('0x34'),JSON['stringify'](_0x506dff[_0xa07a('0x8')][_0xa07a('0x9')]),_0x506dff['options'][_0xa07a('0x9')][_0xa07a('0x35')]);return db['CmHopper'][_0xa07a('0x20')]({'where':_0x506dff[_0xa07a('0x8')]?_0x506dff['options']['where']||null:null,'transaction':_0x26cf8d});});})[_0xa07a('0xf')](function(_0x1d8901){logger[_0xa07a('0x10')]('MoveContactManagedDialer',_0x506dff);logger[_0xa07a('0x12')](_0xa07a('0x33'),_0x506dff,JSON[_0xa07a('0x13')](_0x1d8901));_0x38b4bd(_0x1d8901);})['catch'](function(_0x5e1771){logger['error']('MoveContactManagedDialer',_0x5e1771[_0xa07a('0x15')],_0x506dff);_0x492878(_0x48f2aa[_0xa07a('0x14')](0x1f4,_0x5e1771[_0xa07a('0x15')]));});});};exports[_0xa07a('0x36')]=function(_0x394d52){var _0x4730ba=this;return new Promise(function(_0x13a731,_0x393978){return db[_0xa07a('0x6')][_0xa07a('0x7')]({'raw':_0x394d52[_0xa07a('0x8')]?_0x394d52[_0xa07a('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x394d52[_0xa07a('0x8')]?_0x394d52[_0xa07a('0x8')][_0xa07a('0x9')]||null:null,'attributes':[[db['sequelize']['fn'](_0xa07a('0x37'),db[_0xa07a('0x24')]['fn']('IF',db[_0xa07a('0x24')][_0xa07a('0x38')](_0xa07a('0x39')+util['format']('\x22%s\x22',moment()[_0xa07a('0x3a')](_0xa07a('0x3b')))+_0xa07a('0x3c')))),'contactsRescheduled']]})[_0xa07a('0xf')](function(_0x1930e0){logger[_0xa07a('0x10')](_0xa07a('0x36'),_0x394d52);logger[_0xa07a('0x12')](_0xa07a('0x36'),_0x394d52,JSON[_0xa07a('0x13')](_0x1930e0));_0x13a731(_0x1930e0);})['catch'](function(_0x1f7609){logger[_0xa07a('0x14')](_0xa07a('0x36'),_0x1f7609[_0xa07a('0x15')],_0x394d52);_0x393978(_0x4730ba[_0xa07a('0x14')](0x1f4,_0x1f7609['message']));});});};exports[_0xa07a('0x3d')]=function(_0x5c7ec6){var _0x646f1a=this;return new Promise(function(_0xa138cd,_0x3763e8){return db[_0xa07a('0x22')][_0xa07a('0x23')]()[_0xa07a('0xf')](function(){return db[_0xa07a('0x24')][_0xa07a('0x25')](function(_0x19751d){return db['CmHopper'][_0xa07a('0x7')]({'where':_0x5c7ec6[_0xa07a('0x8')]?_0x5c7ec6[_0xa07a('0x8')][_0xa07a('0x9')]||null:null,'attributes':_0x5c7ec6[_0xa07a('0x8')]?_0x5c7ec6[_0xa07a('0x8')][_0xa07a('0xa')]||null:null,'limit':0x1,'order':_0x5c7ec6['options']?_0x5c7ec6[_0xa07a('0x8')][_0xa07a('0x26')]||null:null,'group':db[_0xa07a('0x6')][_0xa07a('0x2d')],'transaction':_0x19751d,'lock':_0x19751d['LOCK'][_0xa07a('0x28')],'include':_0x5c7ec6[_0xa07a('0x8')]?_0x5c7ec6[_0xa07a('0x8')][_0xa07a('0xc')]?_[_0xa07a('0xd')](_0x5c7ec6[_0xa07a('0x8')][_0xa07a('0xc')],function(_0x5e9aeb){return{'model':db[_0x5e9aeb[_0xa07a('0xe')]],'as':_0x5e9aeb['as'],'attributes':_0x5e9aeb[_0xa07a('0xa')],'include':_0x5e9aeb['include']?_[_0xa07a('0xd')](_0x5e9aeb[_0xa07a('0xc')],function(_0x34ca52){return{'model':db[_0x34ca52[_0xa07a('0xe')]],'as':_0x34ca52['as'],'attributes':_0x34ca52[_0xa07a('0xa')],'include':_0x34ca52[_0xa07a('0xc')]?_[_0xa07a('0xd')](_0x34ca52[_0xa07a('0xc')],function(_0x489cb4){return{'model':db[_0x489cb4[_0xa07a('0xe')]],'as':_0x489cb4['as'],'attributes':_0x489cb4[_0xa07a('0xa')]};}):[]};}):[]};}):[]:[]})[_0xa07a('0xf')](function(_0x22382c){var _0xb019a=[];for(var _0x4d3361=0x0;_0x4d3361<_0x22382c[_0xa07a('0x2c')];_0x4d3361+=0x1){_0xb019a['push'](_0x22382c[_0x4d3361][_0xa07a('0x1d')](_0x5c7ec6[_0xa07a('0x1a')],{'transaction':_0x19751d}));}return BPromise[_0xa07a('0x2f')](_0xb019a);});})[_0xa07a('0xf')](function(_0x39a4ed){logger['info'](_0xa07a('0x3d'),_0x5c7ec6);logger[_0xa07a('0x12')](_0xa07a('0x3d'),_0x5c7ec6,JSON[_0xa07a('0x13')](_0x39a4ed));_0xa138cd(_0x39a4ed);})[_0xa07a('0x1b')](function(_0x5d3143){logger[_0xa07a('0x14')](_0xa07a('0x3d'),_0x5d3143[_0xa07a('0x15')],_0x5c7ec6);_0x3763e8(_0x646f1a['error'](0x1f4,_0x5d3143['message']));});});});};exports[_0xa07a('0x3e')]=function(_0x223550){var _0x3d15dc=this;return new Promise(function(_0x5e7d4d,_0x2868b3){db[_0xa07a('0x22')]['describe']()[_0xa07a('0xf')](function(_0x3e1907){return db['CmHopper']['findAll']({'raw':_0x223550[_0xa07a('0x8')]?_0x223550[_0xa07a('0x8')][_0xa07a('0x1e')]===undefined?!![]:![]:!![],'where':_0x223550[_0xa07a('0x8')]?_0x223550[_0xa07a('0x8')][_0xa07a('0x9')]||null:null,'attributes':_0x223550[_0xa07a('0x8')]?_0x223550[_0xa07a('0x8')][_0xa07a('0xa')]||null:null,'limit':_0x223550['options']?_0x223550[_0xa07a('0x8')][_0xa07a('0xb')]||null:null,'include':_0x223550[_0xa07a('0x8')]?_0x223550['options'][_0xa07a('0xc')]?_['map'](_0x223550[_0xa07a('0x8')][_0xa07a('0xc')],function(_0x3e33e8){return{'model':db[_0x3e33e8[_0xa07a('0xe')]],'as':_0x3e33e8['as'],'attributes':_0x3e33e8['as']==='Contact'?_[_0xa07a('0x3f')](_0x3e1907):_0x3e33e8[_0xa07a('0xa')],'include':_0x3e33e8[_0xa07a('0xc')]?_[_0xa07a('0xd')](_0x3e33e8[_0xa07a('0xc')],function(_0x2fb12f){return{'model':db[_0x2fb12f[_0xa07a('0xe')]],'as':_0x2fb12f['as'],'attributes':_0x2fb12f[_0xa07a('0xa')],'include':_0x2fb12f['include']?_['map'](_0x2fb12f[_0xa07a('0xc')],function(_0x120ba0){return{'model':db[_0x120ba0['model']],'as':_0x120ba0['as'],'attributes':_0x120ba0[_0xa07a('0xa')]};}):[]};}):[]};}):[]:[]})[_0xa07a('0xf')](function(_0x47df9d){logger['info'](_0xa07a('0x11'),_0x223550);logger[_0xa07a('0x12')](_0xa07a('0x11'),_0x223550,JSON['stringify'](_0x47df9d));_0x5e7d4d(_0x47df9d);})[_0xa07a('0x1b')](function(_0x5931ea){logger[_0xa07a('0x14')](_0xa07a('0x11'),_0x5931ea[_0xa07a('0x15')],_0x223550);_0x2868b3(_0x3d15dc['error'](0x1f4,_0x5931ea[_0xa07a('0x15')]));});});});};exports[_0xa07a('0x40')]=function(_0x245dd4){var _0x338f95=this;return new Promise(function(_0x2049d6,_0x348a41){return db[_0xa07a('0x22')][_0xa07a('0x41')]({'raw':!![],'where':{'phone':_0x245dd4[_0xa07a('0x8')][_0xa07a('0x9')]['phone']},'attributes':['id',_0xa07a('0x42')],'order':[['id',_0xa07a('0x43')]]})['then'](function(_0x36f680){logger[_0xa07a('0x10')](_0xa07a('0x44'),_0x245dd4);logger[_0xa07a('0x12')](_0xa07a('0x44'),_0x245dd4,JSON[_0xa07a('0x13')](_0x36f680));_0x2049d6(_0x36f680);})[_0xa07a('0x1b')](function(_0x37fe5a){logger['error'](_0xa07a('0x44'),_0x37fe5a[_0xa07a('0x15')],_0x245dd4);_0x348a41(_0x338f95[_0xa07a('0x14')](0x1f4,_0x37fe5a[_0xa07a('0x15')]));});});};exports[_0xa07a('0x45')]=function(_0x1d897b){var _0x445b20=this;return new Promise(function(_0x3ad348,_0x54bfc0){return db[_0xa07a('0x24')][_0xa07a('0x25')](function(_0x587e01){var _0x518446=_0x1d897b[_0xa07a('0x8')]&&_0x1d897b[_0xa07a('0x8')][_0xa07a('0x9')]?_0x1d897b[_0xa07a('0x8')]['where']:{};return db['CmHopper'][_0xa07a('0x1d')](_0x1d897b['body'],{'where':_0x518446,'transaction':_0x587e01})[_0xa07a('0xf')](function(_0x22a5b5){logger['info'](_0xa07a('0x45'),_0x1d897b);logger['debug'](_0xa07a('0x45'),_0x1d897b,JSON[_0xa07a('0x13')](_0x22a5b5));_0x3ad348(_0x22a5b5);})[_0xa07a('0x1b')](function(_0x162e70){logger[_0xa07a('0x14')]('ResetActiveCalls',_0x162e70[_0xa07a('0x15')],_0x1d897b);_0x54bfc0(_0x445b20[_0xa07a('0x14')](0x1f4,_0x162e70['message']));});});});};exports[_0xa07a('0x46')]=function(_0x2898f0){var _0x3f77fe=this;var _0x528309=_0x2898f0[_0xa07a('0x1a')]['where']['voiceQueueIds'];var _0x5279d6=_0x2898f0[_0xa07a('0x1a')][_0xa07a('0x9')][_0xa07a('0x47')];var _0x2e6198=_0x2898f0[_0xa07a('0x1a')][_0xa07a('0x9')][_0xa07a('0x48')];return new Promise(function(_0x339d37,_0x9d5c13){return db[_0xa07a('0x6')][_0xa07a('0x7')]({'where':{'voiceQueueId':{'$in':_0x528309},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xa07a('0x24')][_0xa07a('0x38')](_0xa07a('0x49')+_0x5279d6+_0xa07a('0x4a')),'$gt':db[_0xa07a('0x24')][_0xa07a('0x38')](_0xa07a('0x4b'))}},'UserId':{'$in':_0x2e6198}},'include':[{'model':db[_0xa07a('0x22')],'as':'Contact'},{'model':db[_0xa07a('0x2a')],'as':'Agent','attributes':['id',_0xa07a('0x4c'),_0xa07a('0x4d')]},{'model':db[_0xa07a('0x4e')],'as':'List'}]})[_0xa07a('0xf')](function(_0x29d61b){if(_0x29d61b[_0xa07a('0x2c')]>0x0){return db[_0xa07a('0x24')][_0xa07a('0x25')](function(_0x6c6a51){return db[_0xa07a('0x6')][_0xa07a('0x1d')]({'recallmeNotifiedDate':db[_0xa07a('0x24')][_0xa07a('0x38')](_0xa07a('0x4b'))},{'where':{'id':{'$in':_['map'](_0x29d61b,'id')}},'transaction':_0x6c6a51})[_0xa07a('0xf')](function(){_0x339d37(_0x29d61b);})[_0xa07a('0x1b')](function(_0x22bf86){logger[_0xa07a('0x14')](_0xa07a('0x46'),_0x22bf86[_0xa07a('0x15')],_0x2898f0);_0x9d5c13(_0x3f77fe['error'](0x1f4,_0x22bf86[_0xa07a('0x15')]));});})[_0xa07a('0x1b')](function(_0x5da056){logger['error'](_0xa07a('0x46'),_0x5da056[_0xa07a('0x15')],_0x2898f0);_0x9d5c13(_0x3f77fe[_0xa07a('0x14')](0x1f4,_0x5da056[_0xa07a('0x15')]));});}else{_0x339d37(_0x29d61b);}});});}; \ No newline at end of file +var _0xb665=['model','then','info','stringify','catch','error','message','find','raw','ShowCmHopper','debug','create','CreateCmHopper','UpdateCmHopper','update','body','where','active','DestroyCmHopper','GetContactDialer','describe','sequelize','transaction','findAll','LOCK','CmContact','Contact','User','Agent','name','length','UserId','push','includes','all','dataValues','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','UPDATE','keys','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','voicePause','util','moment','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','options','attributes','limit','include','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb665,0x128));var _0x5b66=function(_0x2b0283,_0x58f0ff){_0x2b0283=_0x2b0283-0x0;var _0x1eff96=_0xb665[_0x2b0283];return _0x1eff96;};'use strict';var _=require('lodash');var util=require(_0x5b66('0x0'));var moment=require(_0x5b66('0x1'));var BPromise=require('bluebird');var db=require(_0x5b66('0x2'))['db'];var logger=require(_0x5b66('0x3'))(_0x5b66('0x4'));exports[_0x5b66('0x5')]=function(_0x245874){var _0x441f81=this;return new Promise(function(_0x12ef4e,_0x281e6b){return db[_0x5b66('0x6')]['findAll']({'raw':_0x245874[_0x5b66('0x7')]?_0x245874['options']['raw']===undefined?!![]:![]:!![],'where':_0x245874['options']?_0x245874[_0x5b66('0x7')]['where']||null:null,'attributes':_0x245874[_0x5b66('0x7')]?_0x245874[_0x5b66('0x7')][_0x5b66('0x8')]||null:null,'limit':_0x245874[_0x5b66('0x7')]?_0x245874[_0x5b66('0x7')][_0x5b66('0x9')]||null:null,'include':_0x245874['options']?_0x245874['options'][_0x5b66('0xa')]?_['map'](_0x245874[_0x5b66('0x7')][_0x5b66('0xa')],function(_0x1c56e7){return{'model':db[_0x1c56e7['model']],'as':_0x1c56e7['as'],'attributes':_0x1c56e7['attributes'],'include':_0x1c56e7['include']?_[_0x5b66('0xb')](_0x1c56e7[_0x5b66('0xa')],function(_0x3cecd8){return{'model':db[_0x3cecd8[_0x5b66('0xc')]],'as':_0x3cecd8['as'],'attributes':_0x3cecd8[_0x5b66('0x8')],'include':_0x3cecd8[_0x5b66('0xa')]?_[_0x5b66('0xb')](_0x3cecd8[_0x5b66('0xa')],function(_0x48dfdf){return{'model':db[_0x48dfdf[_0x5b66('0xc')]],'as':_0x48dfdf['as'],'attributes':_0x48dfdf[_0x5b66('0x8')]};}):[]};}):[]};}):[]:[]})[_0x5b66('0xd')](function(_0x489894){logger[_0x5b66('0xe')]('GetCmHopper',_0x245874);logger['debug'](_0x5b66('0x5'),_0x245874,JSON[_0x5b66('0xf')](_0x489894));_0x12ef4e(_0x489894);})[_0x5b66('0x10')](function(_0x51bf46){logger[_0x5b66('0x11')](_0x5b66('0x5'),_0x51bf46[_0x5b66('0x12')],_0x245874);_0x281e6b(_0x441f81[_0x5b66('0x11')](0x1f4,_0x51bf46[_0x5b66('0x12')]));});});};exports['ShowCmHopper']=function(_0x168837){var _0x30f874=this;return new Promise(function(_0x235aaa,_0x3dbe8){return db[_0x5b66('0x6')][_0x5b66('0x13')]({'raw':_0x168837[_0x5b66('0x7')]?_0x168837[_0x5b66('0x7')][_0x5b66('0x14')]===undefined?!![]:![]:!![],'where':_0x168837[_0x5b66('0x7')]?_0x168837[_0x5b66('0x7')]['where']||null:null,'attributes':_0x168837[_0x5b66('0x7')]?_0x168837['options'][_0x5b66('0x8')]||null:null,'include':_0x168837['options']?_0x168837[_0x5b66('0x7')][_0x5b66('0xa')]?_[_0x5b66('0xb')](_0x168837[_0x5b66('0x7')][_0x5b66('0xa')],function(_0x1297fd){return{'model':db[_0x1297fd['model']],'as':_0x1297fd['as'],'attributes':_0x1297fd[_0x5b66('0x8')],'include':_0x1297fd['include']?_[_0x5b66('0xb')](_0x1297fd[_0x5b66('0xa')],function(_0x8edc9f){return{'model':db[_0x8edc9f[_0x5b66('0xc')]],'as':_0x8edc9f['as'],'attributes':_0x8edc9f[_0x5b66('0x8')],'include':_0x8edc9f[_0x5b66('0xa')]?_[_0x5b66('0xb')](_0x8edc9f[_0x5b66('0xa')],function(_0x1aa21c){return{'model':db[_0x1aa21c['model']],'as':_0x1aa21c['as'],'attributes':_0x1aa21c[_0x5b66('0x8')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c8b4f){logger['info'](_0x5b66('0x15'),_0x168837);logger[_0x5b66('0x16')]('ShowCmHopper',_0x168837,JSON[_0x5b66('0xf')](_0x1c8b4f));_0x235aaa(_0x1c8b4f);})['catch'](function(_0x9feaae){logger['error'](_0x5b66('0x15'),_0x9feaae[_0x5b66('0x12')],_0x168837);_0x3dbe8(_0x30f874[_0x5b66('0x11')](0x1f4,_0x9feaae['message']));});});};exports['CreateCmHopper']=function(_0x2e6dc7){var _0xfb1b2d=this;return new Promise(function(_0x4e3a0b,_0x4dbfe0){return db[_0x5b66('0x6')][_0x5b66('0x17')](_0x2e6dc7['body'],{'raw':_0x2e6dc7[_0x5b66('0x7')]?_0x2e6dc7[_0x5b66('0x7')]['raw']===undefined?!![]:![]:!![]})[_0x5b66('0xd')](function(_0x4cf708){logger[_0x5b66('0xe')](_0x5b66('0x18'),_0x2e6dc7);logger['debug']('CreateCmHopper',_0x2e6dc7,JSON['stringify'](_0x4cf708));_0x4e3a0b(_0x4cf708);})[_0x5b66('0x10')](function(_0xd9a076){logger['error'](_0x5b66('0x18'),_0xd9a076[_0x5b66('0x12')],_0x2e6dc7);_0x4dbfe0(_0xfb1b2d[_0x5b66('0x11')](0x1f4,_0xd9a076[_0x5b66('0x12')]));});});};exports[_0x5b66('0x19')]=function(_0x2ede55){var _0x3eafad=this;return new Promise(function(_0x3adc39,_0x259c8b){return db[_0x5b66('0x6')][_0x5b66('0x1a')](_0x2ede55[_0x5b66('0x1b')],{'raw':_0x2ede55['options']?_0x2ede55[_0x5b66('0x7')][_0x5b66('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ede55[_0x5b66('0x7')]?_0x2ede55[_0x5b66('0x7')][_0x5b66('0x1c')]||null:null,'attributes':_0x2ede55[_0x5b66('0x7')]?_0x2ede55[_0x5b66('0x7')]['attributes']||null:null,'limit':_0x2ede55[_0x5b66('0x7')]?_0x2ede55['options'][_0x5b66('0x9')]||null:null})[_0x5b66('0xd')](function(_0x40bfba){logger[_0x5b66('0xe')](_0x5b66('0x19'),_0x2ede55);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x5b66('0xf')](_0x2ede55[_0x5b66('0x7')][_0x5b66('0x1c')]),_0x2ede55[_0x5b66('0x1b')][_0x5b66('0x1d')]);logger[_0x5b66('0x16')](_0x5b66('0x19'),_0x2ede55,JSON[_0x5b66('0xf')](_0x40bfba));_0x3adc39(_0x40bfba);})[_0x5b66('0x10')](function(_0x5e01bd){logger[_0x5b66('0x11')](_0x5b66('0x19'),_0x5e01bd[_0x5b66('0x12')],_0x2ede55);_0x259c8b(_0x3eafad[_0x5b66('0x11')](0x1f4,_0x5e01bd[_0x5b66('0x12')]));});});};exports[_0x5b66('0x1e')]=function(_0x50912a){var _0x29be71=this;return new Promise(function(_0x4d227b,_0x1986f0){return db[_0x5b66('0x6')]['destroy']({'where':_0x50912a[_0x5b66('0x7')]?_0x50912a[_0x5b66('0x7')]['where']||null:null})['then'](function(_0x5e201e){logger[_0x5b66('0xe')](_0x5b66('0x1e'),_0x50912a);logger['debug'](_0x5b66('0x1e'),_0x50912a,JSON[_0x5b66('0xf')](_0x5e201e));_0x4d227b(_0x5e201e);})[_0x5b66('0x10')](function(_0x17b236){logger['error']('DestroyCmHopper',_0x17b236['message'],_0x50912a);_0x1986f0(_0x29be71[_0x5b66('0x11')](0x1f4,_0x17b236[_0x5b66('0x12')]));});});};exports[_0x5b66('0x1f')]=function(_0x54b685){var _0x7210cf=this;return new Promise(function(_0x31f4df,_0x57b42b){return db['CmContact'][_0x5b66('0x20')]()[_0x5b66('0xd')](function(_0x239b40){return db[_0x5b66('0x21')][_0x5b66('0x22')](function(_0xa0b906){return db[_0x5b66('0x6')][_0x5b66('0x23')]({'where':_0x54b685[_0x5b66('0x7')]?_0x54b685[_0x5b66('0x7')][_0x5b66('0x1c')]||null:null,'attributes':_0x54b685[_0x5b66('0x7')]?_0x54b685['options'][_0x5b66('0x8')]||null:null,'limit':_0x54b685[_0x5b66('0x7')]?_0x54b685[_0x5b66('0x7')][_0x5b66('0x9')]||null:null,'order':_0x54b685[_0x5b66('0x7')]?_0x54b685['options']['order']||null:null,'transaction':_0xa0b906,'lock':_0xa0b906[_0x5b66('0x24')]['UPDATE'],'include':[{'model':db[_0x5b66('0x25')],'as':_0x5b66('0x26'),'attributes':_['keys'](_0x239b40)},{'model':db[_0x5b66('0x27')],'as':_0x5b66('0x28'),'attributes':['id',_0x5b66('0x29'),'voicePause']}]})[_0x5b66('0xd')](function(_0x32eb00){var _0x54a0a7=[];var _0x4a9980=[];for(var _0x204e80=0x0;_0x204e80<_0x32eb00[_0x5b66('0x2a')];_0x204e80+=0x1){var _0x429a42=_0x32eb00[_0x204e80][_0x5b66('0x2b')];if(_0x429a42===null){_0x54a0a7[_0x5b66('0x2c')](_0x32eb00[_0x204e80][_0x5b66('0x1a')](_0x54b685[_0x5b66('0x1b')],{'transaction':_0xa0b906}));}else if(!_0x4a9980[_0x5b66('0x2d')](_0x429a42)){_0x4a9980['push'](_0x429a42);_0x54a0a7['push'](_0x32eb00[_0x204e80]['update'](_0x54b685[_0x5b66('0x1b')],{'transaction':_0xa0b906}));}}return BPromise[_0x5b66('0x2e')](_0x54a0a7);});})['then'](function(_0x3dc6bf){logger[_0x5b66('0xe')](_0x5b66('0x1f'),_0x54b685);if(_0x3dc6bf['length']>0x0){logger[_0x5b66('0xe')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x3dc6bf[0x0][_0x5b66('0x2f')]['id'],_0x3dc6bf[0x0][_0x5b66('0x2f')]['ContactId'],_0x3dc6bf[0x0][_0x5b66('0x2f')]['active']);}logger[_0x5b66('0x16')]('GetContactDialer',_0x54b685,JSON['stringify'](_0x3dc6bf));_0x31f4df(_0x3dc6bf);})['catch'](function(_0x4eb25b){logger[_0x5b66('0x11')]('GetContactDialer',_0x4eb25b['message'],_0x54b685);_0x57b42b(_0x7210cf['error'](0x1f4,_0x4eb25b[_0x5b66('0x12')]));});});});};exports[_0x5b66('0x30')]=function(_0x59f408){var _0xbb5edf=this;return new Promise(function(_0x5c43f2,_0x42000a){return db[_0x5b66('0x21')][_0x5b66('0x22')](function(_0x57708b){return db[_0x5b66('0x31')][_0x5b66('0x17')](_0x59f408['body'],{'raw':_0x59f408[_0x5b66('0x7')]?_0x59f408[_0x5b66('0x7')]['raw']===undefined?!![]:![]:!![],'transaction':_0x57708b})[_0x5b66('0xd')](function(){logger[_0x5b66('0xe')](_0x5b66('0x32'),JSON[_0x5b66('0xf')](_0x59f408['options']['where']),_0x59f408[_0x5b66('0x7')][_0x5b66('0x1c')][_0x5b66('0x1d')]);return db[_0x5b66('0x6')][_0x5b66('0x33')]({'where':_0x59f408[_0x5b66('0x7')]?_0x59f408['options'][_0x5b66('0x1c')]||null:null,'transaction':_0x57708b});});})[_0x5b66('0xd')](function(_0x2c68f2){logger['info'](_0x5b66('0x30'),_0x59f408);logger[_0x5b66('0x16')]('MoveContactManagedDialer',_0x59f408,JSON['stringify'](_0x2c68f2));_0x5c43f2(_0x2c68f2);})[_0x5b66('0x10')](function(_0x2ed169){logger[_0x5b66('0x11')]('MoveContactManagedDialer',_0x2ed169[_0x5b66('0x12')],_0x59f408);_0x42000a(_0xbb5edf[_0x5b66('0x11')](0x1f4,_0x2ed169[_0x5b66('0x12')]));});});};exports[_0x5b66('0x34')]=function(_0x15a742){var _0x1e05d9=this;return new Promise(function(_0x580a6a,_0x447d0a){return db['CmHopper']['findAll']({'raw':_0x15a742['options']?_0x15a742[_0x5b66('0x7')][_0x5b66('0x14')]===undefined?!![]:![]:!![],'where':_0x15a742[_0x5b66('0x7')]?_0x15a742[_0x5b66('0x7')][_0x5b66('0x1c')]||null:null,'attributes':[[db[_0x5b66('0x21')]['fn'](_0x5b66('0x35'),db[_0x5b66('0x21')]['fn']('IF',db[_0x5b66('0x21')][_0x5b66('0x36')](_0x5b66('0x37')+util[_0x5b66('0x38')](_0x5b66('0x39'),moment()[_0x5b66('0x38')](_0x5b66('0x3a')))+_0x5b66('0x3b')))),_0x5b66('0x3c')]]})[_0x5b66('0xd')](function(_0x35ed3b){logger[_0x5b66('0xe')](_0x5b66('0x34'),_0x15a742);logger['debug']('CountReScheduled',_0x15a742,JSON['stringify'](_0x35ed3b));_0x580a6a(_0x35ed3b);})['catch'](function(_0x1f8e2c){logger[_0x5b66('0x11')](_0x5b66('0x34'),_0x1f8e2c[_0x5b66('0x12')],_0x15a742);_0x447d0a(_0x1e05d9[_0x5b66('0x11')](0x1f4,_0x1f8e2c['message']));});});};exports[_0x5b66('0x3d')]=function(_0x59f55a){var _0x38e631=this;return new Promise(function(_0x54e7b2,_0x4cadd7){return db[_0x5b66('0x25')]['describe']()['then'](function(){return db[_0x5b66('0x21')]['transaction'](function(_0x51a6e7){return db[_0x5b66('0x6')][_0x5b66('0x23')]({'where':_0x59f55a['options']?_0x59f55a[_0x5b66('0x7')][_0x5b66('0x1c')]||null:null,'attributes':_0x59f55a['options']?_0x59f55a[_0x5b66('0x7')]['attributes']||null:null,'limit':0x1,'order':_0x59f55a[_0x5b66('0x7')]?_0x59f55a[_0x5b66('0x7')][_0x5b66('0x3e')]||null:null,'group':db[_0x5b66('0x6')][_0x5b66('0x2b')],'transaction':_0x51a6e7,'lock':_0x51a6e7['LOCK'][_0x5b66('0x3f')],'include':_0x59f55a[_0x5b66('0x7')]?_0x59f55a['options'][_0x5b66('0xa')]?_[_0x5b66('0xb')](_0x59f55a[_0x5b66('0x7')][_0x5b66('0xa')],function(_0x196aa3){return{'model':db[_0x196aa3[_0x5b66('0xc')]],'as':_0x196aa3['as'],'attributes':_0x196aa3[_0x5b66('0x8')],'include':_0x196aa3[_0x5b66('0xa')]?_[_0x5b66('0xb')](_0x196aa3[_0x5b66('0xa')],function(_0x11578f){return{'model':db[_0x11578f[_0x5b66('0xc')]],'as':_0x11578f['as'],'attributes':_0x11578f[_0x5b66('0x8')],'include':_0x11578f[_0x5b66('0xa')]?_[_0x5b66('0xb')](_0x11578f[_0x5b66('0xa')],function(_0x2eb013){return{'model':db[_0x2eb013[_0x5b66('0xc')]],'as':_0x2eb013['as'],'attributes':_0x2eb013[_0x5b66('0x8')]};}):[]};}):[]};}):[]:[]})[_0x5b66('0xd')](function(_0x3942a3){var _0x4fa7f6=[];for(var _0x5e03be=0x0;_0x5e03be<_0x3942a3[_0x5b66('0x2a')];_0x5e03be+=0x1){_0x4fa7f6[_0x5b66('0x2c')](_0x3942a3[_0x5e03be][_0x5b66('0x1a')](_0x59f55a[_0x5b66('0x1b')],{'transaction':_0x51a6e7}));}return BPromise[_0x5b66('0x2e')](_0x4fa7f6);});})[_0x5b66('0xd')](function(_0x19e866){logger[_0x5b66('0xe')](_0x5b66('0x3d'),_0x59f55a);logger[_0x5b66('0x16')](_0x5b66('0x3d'),_0x59f55a,JSON['stringify'](_0x19e866));_0x54e7b2(_0x19e866);})[_0x5b66('0x10')](function(_0x1586fb){logger['error'](_0x5b66('0x3d'),_0x1586fb['message'],_0x59f55a);_0x4cadd7(_0x38e631[_0x5b66('0x11')](0x1f4,_0x1586fb['message']));});});});};exports['GetCmHopperPreview']=function(_0x437bc9){var _0x306be2=this;return new Promise(function(_0x1a953e,_0x5933ee){db[_0x5b66('0x25')][_0x5b66('0x20')]()['then'](function(_0x299142){return db['CmHopper'][_0x5b66('0x23')]({'raw':_0x437bc9['options']?_0x437bc9['options'][_0x5b66('0x14')]===undefined?!![]:![]:!![],'where':_0x437bc9[_0x5b66('0x7')]?_0x437bc9['options'][_0x5b66('0x1c')]||null:null,'attributes':_0x437bc9[_0x5b66('0x7')]?_0x437bc9['options']['attributes']||null:null,'limit':_0x437bc9['options']?_0x437bc9[_0x5b66('0x7')][_0x5b66('0x9')]||null:null,'include':_0x437bc9[_0x5b66('0x7')]?_0x437bc9[_0x5b66('0x7')][_0x5b66('0xa')]?_['map'](_0x437bc9[_0x5b66('0x7')][_0x5b66('0xa')],function(_0x710fa9){return{'model':db[_0x710fa9[_0x5b66('0xc')]],'as':_0x710fa9['as'],'attributes':_0x710fa9['as']==='Contact'?_[_0x5b66('0x40')](_0x299142):_0x710fa9[_0x5b66('0x8')],'include':_0x710fa9[_0x5b66('0xa')]?_[_0x5b66('0xb')](_0x710fa9[_0x5b66('0xa')],function(_0x195c64){return{'model':db[_0x195c64[_0x5b66('0xc')]],'as':_0x195c64['as'],'attributes':_0x195c64[_0x5b66('0x8')],'include':_0x195c64['include']?_[_0x5b66('0xb')](_0x195c64[_0x5b66('0xa')],function(_0x3e4eac){return{'model':db[_0x3e4eac[_0x5b66('0xc')]],'as':_0x3e4eac['as'],'attributes':_0x3e4eac['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b66('0xd')](function(_0x3aece8){logger[_0x5b66('0xe')]('GetCmHopper',_0x437bc9);logger[_0x5b66('0x16')]('GetCmHopper',_0x437bc9,JSON[_0x5b66('0xf')](_0x3aece8));_0x1a953e(_0x3aece8);})['catch'](function(_0xa14fc){logger[_0x5b66('0x11')](_0x5b66('0x5'),_0xa14fc[_0x5b66('0x12')],_0x437bc9);_0x5933ee(_0x306be2['error'](0x1f4,_0xa14fc[_0x5b66('0x12')]));});});});};exports[_0x5b66('0x41')]=function(_0x3173a3){var _0x50a723=this;return new Promise(function(_0x3abcad,_0x51a0ff){return db[_0x5b66('0x25')][_0x5b66('0x42')]({'raw':!![],'where':{'phone':_0x3173a3[_0x5b66('0x7')][_0x5b66('0x1c')][_0x5b66('0x43')]},'attributes':['id',_0x5b66('0x44')],'order':[['id',_0x5b66('0x45')]]})[_0x5b66('0xd')](function(_0x5be94d){logger[_0x5b66('0xe')](_0x5b66('0x46'),_0x3173a3);logger[_0x5b66('0x16')](_0x5b66('0x46'),_0x3173a3,JSON[_0x5b66('0xf')](_0x5be94d));_0x3abcad(_0x5be94d);})[_0x5b66('0x10')](function(_0x2c4b37){logger[_0x5b66('0x11')](_0x5b66('0x46'),_0x2c4b37[_0x5b66('0x12')],_0x3173a3);_0x51a0ff(_0x50a723['error'](0x1f4,_0x2c4b37['message']));});});};exports[_0x5b66('0x47')]=function(_0x4c00b8){var _0x23a69c=this;return new Promise(function(_0x4a55e7,_0x47913b){return db[_0x5b66('0x21')]['transaction'](function(_0x2617c0){var _0x1ef49f=_0x4c00b8[_0x5b66('0x7')]&&_0x4c00b8[_0x5b66('0x7')][_0x5b66('0x1c')]?_0x4c00b8[_0x5b66('0x7')][_0x5b66('0x1c')]:{};return db['CmHopper'][_0x5b66('0x1a')](_0x4c00b8['body'],{'where':_0x1ef49f,'transaction':_0x2617c0})['then'](function(_0x51ec6f){logger[_0x5b66('0xe')](_0x5b66('0x47'),_0x4c00b8);logger[_0x5b66('0x16')](_0x5b66('0x47'),_0x4c00b8,JSON[_0x5b66('0xf')](_0x51ec6f));_0x4a55e7(_0x51ec6f);})[_0x5b66('0x10')](function(_0x2b2529){logger[_0x5b66('0x11')]('ResetActiveCalls',_0x2b2529[_0x5b66('0x12')],_0x4c00b8);_0x47913b(_0x23a69c[_0x5b66('0x11')](0x1f4,_0x2b2529[_0x5b66('0x12')]));});});});};exports[_0x5b66('0x48')]=function(_0x15e00f){var _0x47f68f=this;var _0x3f64c0=_0x15e00f['body'][_0x5b66('0x1c')]['voiceQueueIds'];var _0x4dfe36=_0x15e00f['body']['where']['interval'];var _0x59fa47=_0x15e00f[_0x5b66('0x1b')][_0x5b66('0x1c')]['availableAgentsIds'];return new Promise(function(_0x4b5340,_0x15c3f5){return db[_0x5b66('0x6')]['findAll']({'where':{'voiceQueueId':{'$in':_0x3f64c0},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x5b66('0x21')][_0x5b66('0x36')](_0x5b66('0x49')+_0x4dfe36+_0x5b66('0x4a')),'$gt':db[_0x5b66('0x21')]['literal'](_0x5b66('0x4b'))}},'UserId':{'$in':_0x59fa47}},'include':[{'model':db[_0x5b66('0x25')],'as':_0x5b66('0x26')},{'model':db[_0x5b66('0x27')],'as':_0x5b66('0x28'),'attributes':['id',_0x5b66('0x29'),_0x5b66('0x4c')]},{'model':db['CmList'],'as':'List'}]})[_0x5b66('0xd')](function(_0xc59227){if(_0xc59227[_0x5b66('0x2a')]>0x0){return db[_0x5b66('0x21')][_0x5b66('0x22')](function(_0x41a3a2){return db[_0x5b66('0x6')]['update']({'recallmeNotifiedDate':db[_0x5b66('0x21')][_0x5b66('0x36')](_0x5b66('0x4b'))},{'where':{'id':{'$in':_[_0x5b66('0xb')](_0xc59227,'id')}},'transaction':_0x41a3a2})[_0x5b66('0xd')](function(){_0x4b5340(_0xc59227);})['catch'](function(_0x3f4395){logger[_0x5b66('0x11')](_0x5b66('0x48'),_0x3f4395[_0x5b66('0x12')],_0x15e00f);_0x15c3f5(_0x47f68f[_0x5b66('0x11')](0x1f4,_0x3f4395[_0x5b66('0x12')]));});})[_0x5b66('0x10')](function(_0x50c097){logger[_0x5b66('0x11')]('CmHopperHandlePreviewRecallNotifications',_0x50c097[_0x5b66('0x12')],_0x15e00f);_0x15c3f5(_0x47f68f[_0x5b66('0x11')](0x1f4,_0x50c097[_0x5b66('0x12')]));});}else{_0x4b5340(_0xc59227);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index d531f23..7541fa9 100644 --- a/server/api/cmHopper/index.js +++ b/server/api/cmHopper/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb769=['describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','/:id/previewrecall','post','create','/preview','getPreview','/timezone','getTimezone','put','update','delete','destroy','Router','./cmHopper.controller','get','index','/describe','isAuthenticated'];(function(_0x25d525,_0x22a10e){var _0x276084=function(_0x2f559b){while(--_0x2f559b){_0x25d525['push'](_0x25d525['shift']());}};_0x276084(++_0x22a10e);}(_0xb769,0x6d));var _0x9b76=function(_0xa0732d,_0x2ad0f9){_0xa0732d=_0xa0732d-0x0;var _0x252245=_0xb769[_0xa0732d];return _0x252245;};'use strict';var express=require('express');var router=express[_0x9b76('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x9b76('0x1'));router[_0x9b76('0x2')]('/',auth['isAuthenticated'](),controller[_0x9b76('0x3')]);router[_0x9b76('0x2')](_0x9b76('0x4'),auth[_0x9b76('0x5')](),controller[_0x9b76('0x6')]);router[_0x9b76('0x2')](_0x9b76('0x7'),auth[_0x9b76('0x5')](),controller[_0x9b76('0x8')]);router[_0x9b76('0x2')](_0x9b76('0x9'),auth[_0x9b76('0x5')](),controller[_0x9b76('0xa')]);router[_0x9b76('0x2')](_0x9b76('0xb'),auth[_0x9b76('0x5')](),controller['show']);router[_0x9b76('0x2')](_0x9b76('0xc'),auth[_0x9b76('0x5')](),controller['getPreviewRecall']);router[_0x9b76('0xd')]('/',auth[_0x9b76('0x5')](),controller[_0x9b76('0xe')]);router[_0x9b76('0xd')](_0x9b76('0xf'),auth[_0x9b76('0x5')](),controller[_0x9b76('0x10')]);router[_0x9b76('0xd')](_0x9b76('0x11'),auth[_0x9b76('0x5')](),controller[_0x9b76('0x12')]);router[_0x9b76('0x13')]('/:id',auth[_0x9b76('0x5')](),controller[_0x9b76('0x14')]);router[_0x9b76('0x15')]('/:id',auth[_0x9b76('0x5')](),controller[_0x9b76('0x16')]);module['exports']=router; \ No newline at end of file +var _0x1701=['post','create','/preview','getPreview','getTimezone','put','update','delete','exports','express','../../components/auth/service','./cmHopper.controller','isAuthenticated','index','/describe','describe','getOpenContacts','/timezones','get','/:id','show','/:id/previewrecall'];(function(_0x3319fb,_0x5ca452){var _0x114104=function(_0x10bfec){while(--_0x10bfec){_0x3319fb['push'](_0x3319fb['shift']());}};_0x114104(++_0x5ca452);}(_0x1701,0x1ab));var _0x1170=function(_0x185e6f,_0x1d58b9){_0x185e6f=_0x185e6f-0x0;var _0x3d5f3a=_0x1701[_0x185e6f];return _0x3d5f3a;};'use strict';var express=require(_0x1170('0x0'));var router=express['Router']();var auth=require(_0x1170('0x1'));var controller=require(_0x1170('0x2'));router['get']('/',auth[_0x1170('0x3')](),controller[_0x1170('0x4')]);router['get'](_0x1170('0x5'),auth[_0x1170('0x3')](),controller[_0x1170('0x6')]);router['get']('/opencontacts',auth[_0x1170('0x3')](),controller[_0x1170('0x7')]);router['get'](_0x1170('0x8'),auth[_0x1170('0x3')](),controller['getTimezones']);router[_0x1170('0x9')](_0x1170('0xa'),auth[_0x1170('0x3')](),controller[_0x1170('0xb')]);router[_0x1170('0x9')](_0x1170('0xc'),auth[_0x1170('0x3')](),controller['getPreviewRecall']);router[_0x1170('0xd')]('/',auth[_0x1170('0x3')](),controller[_0x1170('0xe')]);router[_0x1170('0xd')](_0x1170('0xf'),auth['isAuthenticated'](),controller[_0x1170('0x10')]);router['post']('/timezone',auth['isAuthenticated'](),controller[_0x1170('0x11')]);router[_0x1170('0x12')](_0x1170('0xa'),auth[_0x1170('0x3')](),controller[_0x1170('0x13')]);router[_0x1170('0x14')](_0x1170('0xa'),auth[_0x1170('0x3')](),controller['destroy']);module[_0x1170('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 6d379e9..d0502c1 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda15=['INTEGER','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x2bd443,_0x3b968c){var _0x23d7da=function(_0x225677){while(--_0x225677){_0x2bd443['push'](_0x2bd443['shift']());}};_0x23d7da(++_0x3b968c);}(_0xda15,0xb8));var _0x5da1=function(_0x12cc7e,_0x27a987){_0x12cc7e=_0x12cc7e-0x0;var _0x4e8889=_0xda15[_0x12cc7e];return _0x4e8889;};'use strict';var moment=require(_0x5da1('0x0'));var Sequelize=require('sequelize');module['exports']={'CmHopperId':{'type':Sequelize[_0x5da1('0x1')]},'phone':{'type':Sequelize[_0x5da1('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x5da1('0x1')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x5da1('0x3')],'defaultValue':moment()['format'](_0x5da1('0x4'))},'countbusyretry':{'type':Sequelize[_0x5da1('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5da1('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5da1('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf0f1=['exports','INTEGER','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x55d58f,_0x2bea83){var _0x1ad6e6=function(_0x31447e){while(--_0x31447e){_0x55d58f['push'](_0x55d58f['shift']());}};_0x1ad6e6(++_0x2bea83);}(_0xf0f1,0x82));var _0x1f0f=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xf0f1[_0x2112d4];return _0x434972;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1f0f('0x0')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x1f0f('0x1')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x1f0f('0x2')],'defaultValue':moment()[_0x1f0f('0x3')](_0x1f0f('0x4'))},'countbusyretry':{'type':Sequelize[_0x1f0f('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1f0f('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1f0f('0x1')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x1f0f('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1f0f('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1f0f('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1f0f('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1f0f('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 44e8197..bb31f76 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ff6=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','get','CmHopperAdditionalPhones','error','name','send','index','CmHopperAdditionalPhone','fieldName','type','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','include','catch','show','params','rawAttributes','fields','includeAll','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse'];(function(_0xa1e3ca,_0x559022){var _0x5005ab=function(_0x12f90e){while(--_0x12f90e){_0xa1e3ca['push'](_0xa1e3ca['shift']());}};_0x5005ab(++_0x559022);}(_0x6ff6,0xdd));var _0x66ff=function(_0x2a3f2b,_0x2113a8){_0x2a3f2b=_0x2a3f2b-0x0;var _0x40675e=_0x6ff6[_0x2a3f2b];return _0x40675e;};'use strict';var emlformat=require(_0x66ff('0x0'));var rimraf=require(_0x66ff('0x1'));var zipdir=require(_0x66ff('0x2'));var jsonpatch=require(_0x66ff('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x66ff('0x4'));var Mustache=require(_0x66ff('0x5'));var util=require(_0x66ff('0x6'));var path=require(_0x66ff('0x7'));var sox=require('sox');var csv=require(_0x66ff('0x8'));var ejs=require(_0x66ff('0x9'));var fs=require('fs');var fs_extra=require(_0x66ff('0xa'));var _=require(_0x66ff('0xb'));var squel=require(_0x66ff('0xc'));var crypto=require(_0x66ff('0xd'));var jsforce=require(_0x66ff('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x66ff('0x8'));var querystring=require('querystring');var Papa=require(_0x66ff('0xf'));var Redis=require(_0x66ff('0x10'));var authService=require(_0x66ff('0x11'));var qs=require(_0x66ff('0x12'));var as=require(_0x66ff('0x13'));var hardwareService=require(_0x66ff('0x14'));var logger=require(_0x66ff('0x15'))('api');var utils=require(_0x66ff('0x16'));var config=require(_0x66ff('0x17'));var licenseUtil=require(_0x66ff('0x18'));var db=require(_0x66ff('0x19'))['db'];function respondWithStatusCode(_0xf616eb,_0x2ba441){_0x2ba441=_0x2ba441||0xcc;return function(_0x10c99d){if(_0x10c99d){return _0xf616eb['sendStatus'](_0x2ba441);}return _0xf616eb[_0x66ff('0x1a')](_0x2ba441)[_0x66ff('0x1b')]();};}function respondWithResult(_0x247375,_0x561a06){_0x561a06=_0x561a06||0xc8;return function(_0x450e6a){if(_0x450e6a){return _0x247375['status'](_0x561a06)[_0x66ff('0x1c')](_0x450e6a);}};}function respondWithFilteredResult(_0x2b1ead,_0x35295a){return function(_0x4523b7){if(_0x4523b7){var _0x4d03ab=typeof _0x35295a[_0x66ff('0x1d')]===_0x66ff('0x1e')&&typeof _0x35295a[_0x66ff('0x1f')]==='undefined';var _0x5da13e=_0x4523b7['count'];var _0x57ad21=_0x4d03ab?0x0:_0x35295a[_0x66ff('0x1d')];var _0x1c77b3=_0x4d03ab?_0x4523b7[_0x66ff('0x20')]:_0x35295a[_0x66ff('0x1d')]+_0x35295a[_0x66ff('0x1f')];var _0x376523;if(_0x1c77b3>=_0x5da13e){_0x1c77b3=_0x5da13e;_0x376523=0xc8;}else{_0x376523=0xce;}_0x2b1ead[_0x66ff('0x1a')](_0x376523);return _0x2b1ead['set']('Content-Range',_0x57ad21+'-'+_0x1c77b3+'/'+_0x5da13e)[_0x66ff('0x1c')](_0x4523b7);}return null;};}function patchUpdates(_0x1257a0){return function(_0x3e7823){try{jsonpatch[_0x66ff('0x21')](_0x3e7823,_0x1257a0,!![]);}catch(_0x460eef){return BPromise[_0x66ff('0x22')](_0x460eef);}return _0x3e7823['save']();};}function saveUpdates(_0x47dc14,_0x5bc1b9){return function(_0x56c288){if(_0x56c288){return _0x56c288[_0x66ff('0x23')](_0x47dc14)[_0x66ff('0x24')](function(_0x1118bd){return _0x1118bd;});}return null;};}function removeEntity(_0x29a002,_0x2566a6){return function(_0x7d2d2f){if(_0x7d2d2f){return _0x7d2d2f[_0x66ff('0x25')]()[_0x66ff('0x24')](function(){var _0x40c360=_0x7d2d2f[_0x66ff('0x26')]({'plain':!![]});var _0x17d519=_0x66ff('0x27');return db['UserProfileResource'][_0x66ff('0x25')]({'where':{'type':_0x17d519,'resourceId':_0x40c360['id']}})[_0x66ff('0x24')](function(){return _0x7d2d2f;});})['then'](function(){_0x29a002[_0x66ff('0x1a')](0xcc)[_0x66ff('0x1b')]();});}};}function handleEntityNotFound(_0x43a0e9,_0x546ee0){return function(_0x37b7ff){if(!_0x37b7ff){_0x43a0e9['sendStatus'](0x194);}return _0x37b7ff;};}function handleError(_0x1aad72,_0x3bed0d){_0x3bed0d=_0x3bed0d||0x1f4;return function(_0x4fa394){logger[_0x66ff('0x28')](_0x4fa394['stack']);if(_0x4fa394[_0x66ff('0x29')]){delete _0x4fa394['name'];}_0x1aad72['status'](_0x3bed0d)[_0x66ff('0x2a')](_0x4fa394);};}exports[_0x66ff('0x2b')]=function(_0x219e08,_0x581dd9){var _0x824249={},_0x4b2645={},_0x55e9a2={'count':0x0,'rows':[]};var _0x4c8f63=_['map'](db[_0x66ff('0x2c')]['rawAttributes'],function(_0x554c1e){return{'name':_0x554c1e[_0x66ff('0x2d')],'type':_0x554c1e[_0x66ff('0x2e')]['key']};});_0x4b2645[_0x66ff('0x2f')]=_[_0x66ff('0x30')](_0x4c8f63,_0x66ff('0x29'));_0x4b2645[_0x66ff('0x31')]=_[_0x66ff('0x32')](_0x219e08['query']);_0x4b2645[_0x66ff('0x33')]=_[_0x66ff('0x34')](_0x4b2645[_0x66ff('0x2f')],_0x4b2645[_0x66ff('0x31')]);_0x824249[_0x66ff('0x35')]=_[_0x66ff('0x34')](_0x4b2645[_0x66ff('0x2f')],qs['fields'](_0x219e08[_0x66ff('0x31')]['fields']));_0x824249['attributes']=_0x824249[_0x66ff('0x35')][_0x66ff('0x36')]?_0x824249[_0x66ff('0x35')]:_0x4b2645[_0x66ff('0x2f')];if(!_0x219e08[_0x66ff('0x31')][_0x66ff('0x37')](_0x66ff('0x38'))){_0x824249[_0x66ff('0x1f')]=qs[_0x66ff('0x1f')](_0x219e08[_0x66ff('0x31')][_0x66ff('0x1f')]);_0x824249[_0x66ff('0x1d')]=qs['offset'](_0x219e08[_0x66ff('0x31')][_0x66ff('0x1d')]);}_0x824249['order']=qs['sort'](_0x219e08['query'][_0x66ff('0x39')]);_0x824249[_0x66ff('0x3a')]=qs['filters'](_[_0x66ff('0x3b')](_0x219e08['query'],_0x4b2645['filters']),_0x4c8f63);if(_0x219e08[_0x66ff('0x31')]['filter']){_0x824249[_0x66ff('0x3a')]=_[_0x66ff('0x3c')](_0x824249[_0x66ff('0x3a')],{'$or':_[_0x66ff('0x30')](_0x4c8f63,function(_0x32ce8c){if(_0x32ce8c[_0x66ff('0x2e')]!=='VIRTUAL'){var _0x2d798a={};_0x2d798a[_0x32ce8c[_0x66ff('0x29')]]={'$like':'%'+_0x219e08[_0x66ff('0x31')][_0x66ff('0x3d')]+'%'};return _0x2d798a;}})});}_0x824249=_[_0x66ff('0x3c')]({},_0x824249,_0x219e08['options']);var _0x16236c={'where':_0x824249[_0x66ff('0x3a')]};return db['CmHopperAdditionalPhone']['count'](_0x16236c)[_0x66ff('0x24')](function(_0x3bf0c2){_0x55e9a2[_0x66ff('0x20')]=_0x3bf0c2;if(_0x219e08[_0x66ff('0x31')]['includeAll']){_0x824249[_0x66ff('0x3e')]=[{'all':!![]}];}return db[_0x66ff('0x2c')]['findAll'](_0x824249);})[_0x66ff('0x24')](function(_0x43454a){_0x55e9a2['rows']=_0x43454a;return _0x55e9a2;})['then'](respondWithFilteredResult(_0x581dd9,_0x824249))[_0x66ff('0x3f')](handleError(_0x581dd9,null));};exports[_0x66ff('0x40')]=function(_0x18c26d,_0x3f8737){var _0x3660c8={'raw':!![],'where':{'id':_0x18c26d[_0x66ff('0x41')]['id']}},_0x2105c4={};_0x2105c4['model']=_[_0x66ff('0x32')](db[_0x66ff('0x2c')][_0x66ff('0x42')]);_0x2105c4['query']=_[_0x66ff('0x32')](_0x18c26d[_0x66ff('0x31')]);_0x2105c4[_0x66ff('0x33')]=_[_0x66ff('0x34')](_0x2105c4['model'],_0x2105c4[_0x66ff('0x31')]);_0x3660c8['attributes']=_[_0x66ff('0x34')](_0x2105c4[_0x66ff('0x2f')],qs[_0x66ff('0x43')](_0x18c26d[_0x66ff('0x31')]['fields']));_0x3660c8[_0x66ff('0x35')]=_0x3660c8[_0x66ff('0x35')]['length']?_0x3660c8[_0x66ff('0x35')]:_0x2105c4[_0x66ff('0x2f')];if(_0x18c26d[_0x66ff('0x31')][_0x66ff('0x44')]){_0x3660c8[_0x66ff('0x3e')]=[{'all':!![]}];}_0x3660c8=_[_0x66ff('0x3c')]({},_0x3660c8,_0x18c26d[_0x66ff('0x45')]);return db['CmHopperAdditionalPhone'][_0x66ff('0x46')](_0x3660c8)['then'](handleEntityNotFound(_0x3f8737,null))[_0x66ff('0x24')](respondWithResult(_0x3f8737,null))[_0x66ff('0x3f')](handleError(_0x3f8737,null));};exports[_0x66ff('0x47')]=function(_0x2e2aef,_0x4813e2){return db['CmHopperAdditionalPhone']['create'](_0x2e2aef[_0x66ff('0x48')],{})['then'](function(_0x1e2dfb){var _0x369d7c=_0x2e2aef[_0x66ff('0x49')][_0x66ff('0x26')]({'plain':!![]});if(!_0x369d7c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x369d7c[_0x66ff('0x4a')]===_0x66ff('0x49')){var _0xab5e4a=_0x1e2dfb[_0x66ff('0x26')]({'plain':!![]});var _0x5469e1=_0x66ff('0x27');return db[_0x66ff('0x4b')][_0x66ff('0x46')]({'where':{'name':_0x5469e1,'userProfileId':_0x369d7c[_0x66ff('0x4c')]},'raw':!![]})[_0x66ff('0x24')](function(_0x4aa9df){if(_0x4aa9df&&_0x4aa9df[_0x66ff('0x4d')]===0x0){return db[_0x66ff('0x4e')]['create']({'name':_0xab5e4a[_0x66ff('0x29')],'resourceId':_0xab5e4a['id'],'type':_0x4aa9df[_0x66ff('0x29')],'sectionId':_0x4aa9df['id']},{})[_0x66ff('0x24')](function(){return _0x1e2dfb;});}else{return _0x1e2dfb;}})[_0x66ff('0x3f')](function(_0x3982d4){logger[_0x66ff('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3982d4);throw _0x3982d4;});}return _0x1e2dfb;})[_0x66ff('0x24')](respondWithResult(_0x4813e2,0xc9))[_0x66ff('0x3f')](handleError(_0x4813e2,null));};exports[_0x66ff('0x23')]=function(_0x62b45d,_0x2f7cec){if(_0x62b45d[_0x66ff('0x48')]['id']){delete _0x62b45d[_0x66ff('0x48')]['id'];}return db[_0x66ff('0x2c')][_0x66ff('0x46')]({'where':{'id':_0x62b45d[_0x66ff('0x41')]['id']}})[_0x66ff('0x24')](handleEntityNotFound(_0x2f7cec,null))['then'](saveUpdates(_0x62b45d[_0x66ff('0x48')],null))[_0x66ff('0x24')](respondWithResult(_0x2f7cec,null))[_0x66ff('0x3f')](handleError(_0x2f7cec,null));};exports[_0x66ff('0x25')]=function(_0x1222e0,_0x54f7cc){return db[_0x66ff('0x2c')]['find']({'where':{'id':_0x1222e0['params']['id']}})[_0x66ff('0x24')](handleEntityNotFound(_0x54f7cc,null))[_0x66ff('0x24')](removeEntity(_0x54f7cc,null))['catch'](handleError(_0x54f7cc,null));}; \ No newline at end of file +var _0x881e=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','name','send','index','map','rawAttributes','fieldName','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','CmHopperAdditionalPhone','includeAll','findAll','rows','catch','params','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmHopperAdditionalPhones','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','eml-format','rimraf'];(function(_0x4776ba,_0x250658){var _0x354c17=function(_0x42b420){while(--_0x42b420){_0x4776ba['push'](_0x4776ba['shift']());}};_0x354c17(++_0x250658);}(_0x881e,0xfa));var _0xe881=function(_0x571148,_0x522bad){_0x571148=_0x571148-0x0;var _0x572ac1=_0x881e[_0x571148];return _0x572ac1;};'use strict';var emlformat=require(_0xe881('0x0'));var rimraf=require(_0xe881('0x1'));var zipdir=require(_0xe881('0x2'));var jsonpatch=require(_0xe881('0x3'));var rp=require(_0xe881('0x4'));var moment=require(_0xe881('0x5'));var BPromise=require(_0xe881('0x6'));var Mustache=require(_0xe881('0x7'));var util=require('util');var path=require(_0xe881('0x8'));var sox=require(_0xe881('0x9'));var csv=require(_0xe881('0xa'));var ejs=require(_0xe881('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe881('0xc'));var squel=require(_0xe881('0xd'));var crypto=require('crypto');var jsforce=require(_0xe881('0xe'));var deskjs=require(_0xe881('0xf'));var toCsv=require(_0xe881('0xa'));var querystring=require(_0xe881('0x10'));var Papa=require(_0xe881('0x11'));var Redis=require(_0xe881('0x12'));var authService=require(_0xe881('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe881('0x14'));var hardwareService=require(_0xe881('0x15'));var logger=require(_0xe881('0x16'))(_0xe881('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe881('0x18'));var db=require(_0xe881('0x19'))['db'];function respondWithStatusCode(_0x1c7b30,_0x56b03a){_0x56b03a=_0x56b03a||0xcc;return function(_0x3f0207){if(_0x3f0207){return _0x1c7b30[_0xe881('0x1a')](_0x56b03a);}return _0x1c7b30[_0xe881('0x1b')](_0x56b03a)['end']();};}function respondWithResult(_0x52b4e8,_0x57418d){_0x57418d=_0x57418d||0xc8;return function(_0x12a776){if(_0x12a776){return _0x52b4e8[_0xe881('0x1b')](_0x57418d)[_0xe881('0x1c')](_0x12a776);}};}function respondWithFilteredResult(_0xc061b9,_0x3005d2){return function(_0x133a0f){if(_0x133a0f){var _0x45adc5=typeof _0x3005d2['offset']===_0xe881('0x1d')&&typeof _0x3005d2['limit']===_0xe881('0x1d');var _0x5b6973=_0x133a0f[_0xe881('0x1e')];var _0x11ee42=_0x45adc5?0x0:_0x3005d2['offset'];var _0x25b004=_0x45adc5?_0x133a0f['count']:_0x3005d2[_0xe881('0x1f')]+_0x3005d2['limit'];var _0x5b1848;if(_0x25b004>=_0x5b6973){_0x25b004=_0x5b6973;_0x5b1848=0xc8;}else{_0x5b1848=0xce;}_0xc061b9[_0xe881('0x1b')](_0x5b1848);return _0xc061b9[_0xe881('0x20')](_0xe881('0x21'),_0x11ee42+'-'+_0x25b004+'/'+_0x5b6973)['json'](_0x133a0f);}return null;};}function patchUpdates(_0xf96826){return function(_0x49b57a){try{jsonpatch[_0xe881('0x22')](_0x49b57a,_0xf96826,!![]);}catch(_0x5e3922){return BPromise[_0xe881('0x23')](_0x5e3922);}return _0x49b57a[_0xe881('0x24')]();};}function saveUpdates(_0x2c77a0,_0x5924e6){return function(_0x2e3c62){if(_0x2e3c62){return _0x2e3c62['update'](_0x2c77a0)[_0xe881('0x25')](function(_0x6c400a){return _0x6c400a;});}return null;};}function removeEntity(_0x1d7496,_0x39a710){return function(_0xdb6923){if(_0xdb6923){return _0xdb6923[_0xe881('0x26')]()[_0xe881('0x25')](function(){var _0x11a305=_0xdb6923[_0xe881('0x27')]({'plain':!![]});var _0x76c71b='CmHopperAdditionalPhones';return db[_0xe881('0x28')]['destroy']({'where':{'type':_0x76c71b,'resourceId':_0x11a305['id']}})[_0xe881('0x25')](function(){return _0xdb6923;});})[_0xe881('0x25')](function(){_0x1d7496[_0xe881('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45ca12,_0x1a6064){return function(_0x486747){if(!_0x486747){_0x45ca12[_0xe881('0x1a')](0x194);}return _0x486747;};}function handleError(_0x31a944,_0x2bbfff){_0x2bbfff=_0x2bbfff||0x1f4;return function(_0x4feb50){logger['error'](_0x4feb50['stack']);if(_0x4feb50[_0xe881('0x29')]){delete _0x4feb50['name'];}_0x31a944[_0xe881('0x1b')](_0x2bbfff)[_0xe881('0x2a')](_0x4feb50);};}exports[_0xe881('0x2b')]=function(_0x7d637a,_0xf14cc){var _0xa45325={},_0x55ad0f={},_0x86d629={'count':0x0,'rows':[]};var _0x57f914=_[_0xe881('0x2c')](db['CmHopperAdditionalPhone'][_0xe881('0x2d')],function(_0x2194d7){return{'name':_0x2194d7[_0xe881('0x2e')],'type':_0x2194d7['type'][_0xe881('0x2f')]};});_0x55ad0f[_0xe881('0x30')]=_['map'](_0x57f914,_0xe881('0x29'));_0x55ad0f['query']=_[_0xe881('0x31')](_0x7d637a['query']);_0x55ad0f[_0xe881('0x32')]=_[_0xe881('0x33')](_0x55ad0f[_0xe881('0x30')],_0x55ad0f[_0xe881('0x34')]);_0xa45325['attributes']=_[_0xe881('0x33')](_0x55ad0f[_0xe881('0x30')],qs[_0xe881('0x35')](_0x7d637a['query'][_0xe881('0x35')]));_0xa45325[_0xe881('0x36')]=_0xa45325[_0xe881('0x36')]['length']?_0xa45325[_0xe881('0x36')]:_0x55ad0f[_0xe881('0x30')];if(!_0x7d637a[_0xe881('0x34')][_0xe881('0x37')](_0xe881('0x38'))){_0xa45325[_0xe881('0x39')]=qs[_0xe881('0x39')](_0x7d637a[_0xe881('0x34')]['limit']);_0xa45325['offset']=qs[_0xe881('0x1f')](_0x7d637a[_0xe881('0x34')][_0xe881('0x1f')]);}_0xa45325['order']=qs[_0xe881('0x3a')](_0x7d637a[_0xe881('0x34')][_0xe881('0x3a')]);_0xa45325[_0xe881('0x3b')]=qs[_0xe881('0x32')](_[_0xe881('0x3c')](_0x7d637a[_0xe881('0x34')],_0x55ad0f[_0xe881('0x32')]),_0x57f914);if(_0x7d637a[_0xe881('0x34')][_0xe881('0x3d')]){_0xa45325[_0xe881('0x3b')]=_[_0xe881('0x3e')](_0xa45325[_0xe881('0x3b')],{'$or':_[_0xe881('0x2c')](_0x57f914,function(_0x99b75f){if(_0x99b75f[_0xe881('0x3f')]!==_0xe881('0x40')){var _0x59add9={};_0x59add9[_0x99b75f[_0xe881('0x29')]]={'$like':'%'+_0x7d637a[_0xe881('0x34')][_0xe881('0x3d')]+'%'};return _0x59add9;}})});}_0xa45325=_[_0xe881('0x3e')]({},_0xa45325,_0x7d637a[_0xe881('0x41')]);var _0x282a8e={'where':_0xa45325[_0xe881('0x3b')]};return db[_0xe881('0x42')][_0xe881('0x1e')](_0x282a8e)[_0xe881('0x25')](function(_0x43d3f4){_0x86d629[_0xe881('0x1e')]=_0x43d3f4;if(_0x7d637a[_0xe881('0x34')][_0xe881('0x43')]){_0xa45325['include']=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0xe881('0x44')](_0xa45325);})['then'](function(_0x5cb54d){_0x86d629[_0xe881('0x45')]=_0x5cb54d;return _0x86d629;})[_0xe881('0x25')](respondWithFilteredResult(_0xf14cc,_0xa45325))[_0xe881('0x46')](handleError(_0xf14cc,null));};exports['show']=function(_0x2064bc,_0x20be7e){var _0x10b5ec={'raw':!![],'where':{'id':_0x2064bc[_0xe881('0x47')]['id']}},_0xa835f7={};_0xa835f7['model']=_[_0xe881('0x31')](db[_0xe881('0x42')]['rawAttributes']);_0xa835f7['query']=_[_0xe881('0x31')](_0x2064bc[_0xe881('0x34')]);_0xa835f7[_0xe881('0x32')]=_[_0xe881('0x33')](_0xa835f7['model'],_0xa835f7['query']);_0x10b5ec[_0xe881('0x36')]=_['intersection'](_0xa835f7[_0xe881('0x30')],qs[_0xe881('0x35')](_0x2064bc[_0xe881('0x34')][_0xe881('0x35')]));_0x10b5ec[_0xe881('0x36')]=_0x10b5ec['attributes'][_0xe881('0x48')]?_0x10b5ec[_0xe881('0x36')]:_0xa835f7[_0xe881('0x30')];if(_0x2064bc[_0xe881('0x34')][_0xe881('0x43')]){_0x10b5ec[_0xe881('0x49')]=[{'all':!![]}];}_0x10b5ec=_[_0xe881('0x3e')]({},_0x10b5ec,_0x2064bc[_0xe881('0x41')]);return db[_0xe881('0x42')]['find'](_0x10b5ec)['then'](handleEntityNotFound(_0x20be7e,null))[_0xe881('0x25')](respondWithResult(_0x20be7e,null))[_0xe881('0x46')](handleError(_0x20be7e,null));};exports[_0xe881('0x4a')]=function(_0x377cee,_0x1154e0){return db['CmHopperAdditionalPhone'][_0xe881('0x4a')](_0x377cee[_0xe881('0x4b')],{})[_0xe881('0x25')](function(_0x29a9db){var _0x2b03a5=_0x377cee[_0xe881('0x4c')][_0xe881('0x27')]({'plain':!![]});if(!_0x2b03a5)throw new Error(_0xe881('0x4d'));if(_0x2b03a5['role']==='user'){var _0x52bdf2=_0x29a9db[_0xe881('0x27')]({'plain':!![]});var _0x1e4dd3=_0xe881('0x4e');return db['UserProfileSection']['find']({'where':{'name':_0x1e4dd3,'userProfileId':_0x2b03a5['userProfileId']},'raw':!![]})[_0xe881('0x25')](function(_0x38abc5){if(_0x38abc5&&_0x38abc5[_0xe881('0x4f')]===0x0){return db[_0xe881('0x28')][_0xe881('0x4a')]({'name':_0x52bdf2[_0xe881('0x29')],'resourceId':_0x52bdf2['id'],'type':_0x38abc5[_0xe881('0x29')],'sectionId':_0x38abc5['id']},{})[_0xe881('0x25')](function(){return _0x29a9db;});}else{return _0x29a9db;}})['catch'](function(_0x18d0ab){logger[_0xe881('0x50')](_0xe881('0x51'),_0x18d0ab);throw _0x18d0ab;});}return _0x29a9db;})[_0xe881('0x25')](respondWithResult(_0x1154e0,0xc9))[_0xe881('0x46')](handleError(_0x1154e0,null));};exports[_0xe881('0x52')]=function(_0x470233,_0xcd7d86){if(_0x470233[_0xe881('0x4b')]['id']){delete _0x470233[_0xe881('0x4b')]['id'];}return db[_0xe881('0x42')]['find']({'where':{'id':_0x470233[_0xe881('0x47')]['id']}})[_0xe881('0x25')](handleEntityNotFound(_0xcd7d86,null))[_0xe881('0x25')](saveUpdates(_0x470233[_0xe881('0x4b')],null))['then'](respondWithResult(_0xcd7d86,null))[_0xe881('0x46')](handleError(_0xcd7d86,null));};exports[_0xe881('0x26')]=function(_0x1d16a4,_0x5a71ed){return db[_0xe881('0x42')][_0xe881('0x53')]({'where':{'id':_0x1d16a4[_0xe881('0x47')]['id']}})['then'](handleEntityNotFound(_0x5a71ed,null))['then'](removeEntity(_0x5a71ed,null))[_0xe881('0x46')](handleError(_0x5a71ed,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 846fcb4..057b041 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x30dc=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','lodash','util','../../config/logger'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x30dc,0x173));var _0xc30d=function(_0x22ee1e,_0x3eff80){_0x22ee1e=_0x22ee1e-0x0;var _0x49a5c9=_0x30dc[_0x22ee1e];return _0x49a5c9;};'use strict';var _=require(_0xc30d('0x0'));var util=require(_0xc30d('0x1'));var logger=require(_0xc30d('0x2'))(_0xc30d('0x3'));var moment=require(_0xc30d('0x4'));var BPromise=require(_0xc30d('0x5'));var rp=require(_0xc30d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc30d('0x7'));var config=require(_0xc30d('0x8'));var attributes=require(_0xc30d('0x9'));module[_0xc30d('0xa')]=function(_0x375f07,_0xdd4ed2){return _0x375f07['define']('CmHopperAdditionalPhone',attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b51=['moment','bluebird','path','../../config/environment','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','util','api'];(function(_0x4f3bdc,_0x1e3d0f){var _0x1fced0=function(_0x266fdb){while(--_0x266fdb){_0x4f3bdc['push'](_0x4f3bdc['shift']());}};_0x1fced0(++_0x1e3d0f);}(_0x6b51,0x94));var _0x16b5=function(_0x348512,_0x364d72){_0x348512=_0x348512-0x0;var _0x3b5ea7=_0x6b51[_0x348512];return _0x3b5ea7;};'use strict';var _=require('lodash');var util=require(_0x16b5('0x0'));var logger=require('../../config/logger')(_0x16b5('0x1'));var moment=require(_0x16b5('0x2'));var BPromise=require(_0x16b5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x16b5('0x4'));var rimraf=require('rimraf');var config=require(_0x16b5('0x5'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x16b5('0x6')]=function(_0x37ca26,_0x2ca1b6){return _0x37ca26[_0x16b5('0x7')](_0x16b5('0x8'),attributes,{'tableName':_0x16b5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 9438d6a..bf330f1 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1150=['message','catch','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','ASC','countdropretry','VerifyAdditionalPhones','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','countagentrejectretry','sequelize','transaction','update','activateAdditionalPhone','field','IncrementPreviewCounters','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperAdditionalPhone,\x20%s,\x20%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1150,0x14f));var _0x0115=function(_0xf3120,_0x80a54c){_0xf3120=_0xf3120-0x0;var _0x5aa549=_0x1150[_0xf3120];return _0x5aa549;};'use strict';var _=require(_0x0115('0x0'));var util=require(_0x0115('0x1'));var moment=require(_0x0115('0x2'));var BPromise=require(_0x0115('0x3'));var rs=require(_0x0115('0x4'));var fs=require('fs');var Redis=require(_0x0115('0x5'));var db=require(_0x0115('0x6'))['db'];var utils=require(_0x0115('0x7'));var logger=require(_0x0115('0x8'))('rpc');var config=require(_0x0115('0x9'));var jayson=require(_0x0115('0xa'));var client=jayson['client'][_0x0115('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c4ed2,_0x2d34cb,_0xe3a497){return new BPromise(function(_0x235403,_0x3cd134){return client['request'](_0x4c4ed2,_0xe3a497)['then'](function(_0x135a1e){logger[_0x0115('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2d34cb,_0x0115('0xd'));logger[_0x0115('0xe')](_0x0115('0xf'),_0x2d34cb,_0x0115('0xd'),JSON[_0x0115('0x10')](_0x135a1e));if(_0x135a1e[_0x0115('0x11')]){if(_0x135a1e[_0x0115('0x11')]['code']===0x1f4){logger['error'](_0x0115('0x12'),_0x2d34cb,_0x135a1e[_0x0115('0x11')]['message']);return _0x3cd134(_0x135a1e[_0x0115('0x11')][_0x0115('0x13')]);}logger[_0x0115('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2d34cb,_0x135a1e['error']['message']);return _0x235403(_0x135a1e['error'][_0x0115('0x13')]);}else{logger[_0x0115('0xc')](_0x0115('0x12'),_0x2d34cb,_0x0115('0xd'));_0x235403(_0x135a1e['result'][_0x0115('0x13')]);}})[_0x0115('0x14')](function(_0x44a01a){logger[_0x0115('0x11')](_0x0115('0x12'),_0x2d34cb,_0x44a01a);_0x3cd134(_0x44a01a);});});}exports['VerifyAdditionalPhones']=function(_0x5ab623){var _0x510ff0=this;return new Promise(function(_0x253f31,_0x2299aa){return db[_0x0115('0x15')][_0x0115('0x16')]({'raw':!![],'where':{'ContactId':_0x5ab623[_0x0115('0x17')][_0x0115('0x18')],'ListId':_0x5ab623['body'][_0x0115('0x19')],'VoiceQueueId':_0x5ab623[_0x0115('0x17')][_0x0115('0x1a')]===undefined?null:_0x5ab623[_0x0115('0x17')][_0x0115('0x1a')],'CampaignId':_0x5ab623[_0x0115('0x17')][_0x0115('0x1b')]===undefined?null:_0x5ab623[_0x0115('0x17')]['CampaignId']}})[_0x0115('0x1c')](function(_0x6d8a6e){if(_0x6d8a6e!=null){return db[_0x0115('0x1d')][_0x0115('0x16')]({'raw':!![],'where':{'CmHopperId':_0x6d8a6e['id'],'OrderBy':{'$gt':_0x6d8a6e[_0x0115('0x1e')]}},'order':[[_0x0115('0x1e'),'ASC']]})[_0x0115('0x1c')](function(_0x451822){var _0x4e4430=0x0;if(_0x451822){if(_0x451822[_0x0115('0x1f')]+_0x451822[_0x0115('0x20')]+_0x451822[_0x0115('0x21')]+_0x451822[_0x0115('0x22')]+_0x451822['countdropretry']+_0x451822[_0x0115('0x23')]+_0x451822[_0x0115('0x24')]+_0x451822['countagentrejectretry']<_0x5ab623[_0x0115('0x25')][_0x0115('0x26')])_0x4e4430=0x1;_0x253f31({'additional':_0x4e4430});}else{return db[_0x0115('0x1d')][_0x0115('0x16')]({'raw':!![],'where':{'CmHopperId':_0x6d8a6e['id']},'order':[['OrderBy',_0x0115('0x27')]]})[_0x0115('0x1c')](function(_0x434898){var _0x1fd7cc=0x0;if(_0x434898){if(_0x434898['countbusyretry']+_0x434898[_0x0115('0x20')]+_0x434898[_0x0115('0x21')]+_0x434898[_0x0115('0x22')]+_0x434898[_0x0115('0x28')]+_0x434898[_0x0115('0x23')]+_0x434898[_0x0115('0x24')]+_0x434898['countagentrejectretry']<_0x5ab623[_0x0115('0x25')][_0x0115('0x26')])_0x1fd7cc=0x1;_0x253f31({'additional':_0x1fd7cc});}else{_0x253f31({'additional':0x0});}})[_0x0115('0x14')](function(_0x35ee67){logger['error'](_0x0115('0x29'),_0x35ee67['message']);_0x2299aa(_0x510ff0[_0x0115('0x11')](0x1f4,_0x35ee67['message']));});}})[_0x0115('0x14')](function(_0x359c0f){logger[_0x0115('0x11')](_0x0115('0x29'),_0x359c0f[_0x0115('0x13')]);_0x2299aa(_0x510ff0['error'](0x1f4,_0x359c0f[_0x0115('0x13')]));});}else _0x253f31({'additional':0x0});});});};exports[_0x0115('0x2a')]=function(_0x206b82){var _0x23a9b7=this;return new Promise(function(_0x388cd9,_0x2282fc){return db[_0x0115('0x15')][_0x0115('0x16')]({'raw':!![],'where':{'ContactId':_0x206b82[_0x0115('0x17')][_0x0115('0x18')],'ListId':_0x206b82[_0x0115('0x17')][_0x0115('0x19')],'VoiceQueueId':_0x206b82['body'][_0x0115('0x1a')]===undefined?null:_0x206b82[_0x0115('0x17')]['VoiceQueueId'],'CampaignId':_0x206b82[_0x0115('0x17')]['CampaignId']===undefined?null:_0x206b82[_0x0115('0x17')][_0x0115('0x1b')]}})[_0x0115('0x1c')](function(_0x253145){if(_0x253145!=null){return db[_0x0115('0x1d')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x253145['id'],'OrderBy':{'$gte':_0x253145[_0x0115('0x1e')]}},'order':[[_0x0115('0x1e'),'ASC']]})[_0x0115('0x1c')](function(_0x5711a2){if(_0x5711a2)return activateAdditionalPhone(_0x253145,_0x206b82[_0x0115('0x17')],_0x5711a2,_0x206b82[_0x0115('0x2b')],_0x206b82[_0x0115('0x2c')])[_0x0115('0x1c')](function(_0x2b5b06){_0x388cd9(_0x2b5b06);});else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x253145['id']},'order':[[_0x0115('0x1e'),'ASC']]})[_0x0115('0x1c')](function(_0xeaa922){if(_0xeaa922)return activateAdditionalPhone(_0x253145,_0x206b82['body'],_0xeaa922,_0x206b82[_0x0115('0x2b')],_0x206b82[_0x0115('0x2c')])['then'](function(_0x39bf39){_0x388cd9(_0x39bf39);});else{_0x388cd9({'id':_0x253145['id'],'phone':''});}})[_0x0115('0x14')](function(_0x2eb77b){logger[_0x0115('0x11')]('VerifyAdditionalPhones',_0x2eb77b[_0x0115('0x13')]);_0x2282fc(_0x23a9b7[_0x0115('0x11')](0x1f4,_0x2eb77b['message']));});}})[_0x0115('0x14')](function(_0x405546){logger[_0x0115('0x11')](_0x0115('0x29'),_0x405546[_0x0115('0x13')]);_0x2282fc(_0x23a9b7[_0x0115('0x11')](0x1f4,_0x405546[_0x0115('0x13')]));});}else _0x388cd9(0x1);});});};function activateAdditionalPhone(_0xf9d8ea,_0x4fc55c,_0x412040,_0x41eb1d,_0xeca450){return new Promise(function(_0x1dcb7a,_0xb375d9){var _0x16501f;if(_[_0x0115('0x2d')](_0x412040[_0x0115('0x2e')])){_0x412040[_0x0115('0x2e')]=moment();}if(moment()>moment(_0x412040['scheduledat'])){_0x16501f=moment()[_0x0115('0x2f')](_0xeca450||0x3,_0x0115('0x30'));}else{if(_0x412040['OrderBy']==0x0){_0x16501f=moment(_0x412040[_0x0115('0x2e')]);}else{_0x16501f=moment()[_0x0115('0x2f')](_0xeca450||0x3,_0x0115('0x30'));}}if(_[_0x0115('0x2d')](_0x16501f)){_0x16501f=moment()['add'](_0xeca450||0x3,_0x0115('0x30'));}var _0x45f012={'phone':_0xf9d8ea[_0x0115('0x31')],'active':0x0,'OrderBy':_[_0x0115('0x2d')](_0xf9d8ea['OrderBy'])?0x0:_0xf9d8ea[_0x0115('0x1e')],'scheduledat':moment()[_0x0115('0x2f')](_0x41eb1d||0x1,_0x0115('0x30')),'countbusyretry':_0x4fc55c['countbusyretry'],'countcongestionretry':_0x4fc55c['countcongestionretry'],'countnoanswerretry':_0x4fc55c[_0x0115('0x21')],'countnosuchnumberretry':_0x4fc55c[_0x0115('0x22')],'countdropretry':_0x4fc55c[_0x0115('0x28')],'countabandonedretry':_0x4fc55c[_0x0115('0x23')],'countmachineretry':_0x4fc55c['countmachineretry'],'countagentrejectretry':_0x4fc55c['countagentrejectretry'],'createdAt':_0x4fc55c[_0x0115('0x32')],'updatedAt':_0x4fc55c[_0x0115('0x33')]};var _0x47a285={'CmHopperId':_0xf9d8ea['id'],'phone':_0x412040['phone'],'active':0x0,'OrderBy':_[_0x0115('0x2d')](_0x412040['OrderBy'])?0x0:_0x412040[_0x0115('0x1e')],'scheduledat':_0x16501f,'countbusyretry':_0x412040['countbusyretry'],'countcongestionretry':_0x412040['countcongestionretry'],'countnoanswerretry':_0x412040[_0x0115('0x21')],'countnosuchnumberretry':_0x412040[_0x0115('0x22')],'countdropretry':_0x412040['countdropretry'],'countabandonedretry':_0x412040[_0x0115('0x23')],'countmachineretry':_0x412040[_0x0115('0x24')],'countagentrejectretry':_0x412040[_0x0115('0x34')],'createdAt':_0x412040[_0x0115('0x32')],'updatedAt':_0x412040[_0x0115('0x33')]};return db[_0x0115('0x35')][_0x0115('0x36')](function(_0x26d4e8){return db[_0x0115('0x1d')][_0x0115('0x37')](_0x45f012,{'where':{'id':_0x412040['id']}},{'transaction':_0x26d4e8})[_0x0115('0x1c')](function(){return db[_0x0115('0x15')][_0x0115('0x37')](_0x47a285,{'where':{'id':_0xf9d8ea['id']}},{'transaction':_0x26d4e8});});})[_0x0115('0x1c')](function(_0x1f4caa){_0x1dcb7a({'id':_0xf9d8ea['id'],'phone':_0x412040[_0x0115('0x31')]});})['catch'](function(_0x2eda78){logger[_0x0115('0x11')](_0x0115('0x38'),_0x2eda78[_0x0115('0x13')]);_0xb375d9({'error':_0x2eda78['message']});});});}exports['IncrementPreviewCounters']=function(_0x2ebf5f){var _0xa449ad=this;return new Promise(function(_0x287d03,_0x4519c5){return db[_0x0115('0x15')][_0x0115('0x37')](_0x2ebf5f['body'][_0x0115('0x39')],{'where':{'id':_0x2ebf5f[_0x0115('0x17')]['id']}})['then'](function(_0xbd68a0){_0x287d03(_0xbd68a0);})[_0x0115('0x14')](function(_0x3ab068){logger[_0x0115('0x11')](_0x0115('0x3a'),_0x3ab068[_0x0115('0x13')]);_0x4519c5(_0xa449ad[_0x0115('0x11')](0x1f4,_0x3ab068[_0x0115('0x13')]));});});}; \ No newline at end of file +var _0x500b=['CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','OrderBy','ASC','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countabandonedretry','SwapAdditionalPhones','duration','waitTime','scheduledat','add','minutes','isNil','phone','countbusyretry','createdAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x21141c,_0xed9815){var _0x2addaf=function(_0x53dcd6){while(--_0x53dcd6){_0x21141c['push'](_0x21141c['shift']());}};_0x2addaf(++_0xed9815);}(_0x500b,0xa2));var _0xb500=function(_0x21cc4e,_0x24a7ac){_0x21cc4e=_0x21cc4e-0x0;var _0x3b7125=_0x500b[_0x21cc4e];return _0x3b7125;};'use strict';var _=require('lodash');var util=require(_0xb500('0x0'));var moment=require(_0xb500('0x1'));var BPromise=require(_0xb500('0x2'));var rs=require(_0xb500('0x3'));var fs=require('fs');var Redis=require(_0xb500('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb500('0x5'));var logger=require(_0xb500('0x6'))(_0xb500('0x7'));var config=require(_0xb500('0x8'));var jayson=require(_0xb500('0x9'));var client=jayson[_0xb500('0xa')][_0xb500('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa03a1a,_0x5b445c,_0x7652e){return new BPromise(function(_0x3b877c,_0x109ad6){return client[_0xb500('0xc')](_0xa03a1a,_0x7652e)[_0xb500('0xd')](function(_0x1c1e67){logger[_0xb500('0xe')](_0xb500('0xf'),_0x5b445c,_0xb500('0x10'));logger[_0xb500('0x11')](_0xb500('0x12'),_0x5b445c,_0xb500('0x10'),JSON[_0xb500('0x13')](_0x1c1e67));if(_0x1c1e67['error']){if(_0x1c1e67[_0xb500('0x14')][_0xb500('0x15')]===0x1f4){logger[_0xb500('0x14')](_0xb500('0xf'),_0x5b445c,_0x1c1e67['error'][_0xb500('0x16')]);return _0x109ad6(_0x1c1e67[_0xb500('0x14')][_0xb500('0x16')]);}logger[_0xb500('0x14')](_0xb500('0xf'),_0x5b445c,_0x1c1e67[_0xb500('0x14')][_0xb500('0x16')]);return _0x3b877c(_0x1c1e67['error'][_0xb500('0x16')]);}else{logger[_0xb500('0xe')](_0xb500('0xf'),_0x5b445c,_0xb500('0x10'));_0x3b877c(_0x1c1e67[_0xb500('0x17')][_0xb500('0x16')]);}})[_0xb500('0x18')](function(_0x37bf34){logger[_0xb500('0x14')](_0xb500('0xf'),_0x5b445c,_0x37bf34);_0x109ad6(_0x37bf34);});});}exports[_0xb500('0x19')]=function(_0x3871b2){var _0x358086=this;return new Promise(function(_0x37b1d9,_0x1cc04f){return db[_0xb500('0x1a')][_0xb500('0x1b')]({'raw':!![],'where':{'ContactId':_0x3871b2[_0xb500('0x1c')][_0xb500('0x1d')],'ListId':_0x3871b2[_0xb500('0x1c')][_0xb500('0x1e')],'VoiceQueueId':_0x3871b2['body']['VoiceQueueId']===undefined?null:_0x3871b2[_0xb500('0x1c')][_0xb500('0x1f')],'CampaignId':_0x3871b2[_0xb500('0x1c')][_0xb500('0x20')]===undefined?null:_0x3871b2[_0xb500('0x1c')][_0xb500('0x20')]}})[_0xb500('0xd')](function(_0x44e496){if(_0x44e496!=null){return db['CmHopperAdditionalPhone'][_0xb500('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x44e496['id'],'OrderBy':{'$gt':_0x44e496['OrderBy']}},'order':[[_0xb500('0x21'),_0xb500('0x22')]]})['then'](function(_0xdefc2){var _0x3360f4=0x0;if(_0xdefc2){if(_0xdefc2['countbusyretry']+_0xdefc2[_0xb500('0x23')]+_0xdefc2[_0xb500('0x24')]+_0xdefc2[_0xb500('0x25')]+_0xdefc2[_0xb500('0x26')]+_0xdefc2['countabandonedretry']+_0xdefc2[_0xb500('0x27')]+_0xdefc2[_0xb500('0x28')]<_0x3871b2[_0xb500('0x29')][_0xb500('0x2a')])_0x3360f4=0x1;_0x37b1d9({'additional':_0x3360f4});}else{return db[_0xb500('0x2b')][_0xb500('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x44e496['id']},'order':[[_0xb500('0x21'),_0xb500('0x22')]]})[_0xb500('0xd')](function(_0x49bc13){var _0x1c4023=0x0;if(_0x49bc13){if(_0x49bc13['countbusyretry']+_0x49bc13['countcongestionretry']+_0x49bc13[_0xb500('0x24')]+_0x49bc13[_0xb500('0x25')]+_0x49bc13[_0xb500('0x26')]+_0x49bc13[_0xb500('0x2c')]+_0x49bc13[_0xb500('0x27')]+_0x49bc13[_0xb500('0x28')]<_0x3871b2[_0xb500('0x29')]['dialGlobalMaxRetry'])_0x1c4023=0x1;_0x37b1d9({'additional':_0x1c4023});}else{_0x37b1d9({'additional':0x0});}})['catch'](function(_0x36a2f0){logger['error'](_0xb500('0x19'),_0x36a2f0['message']);_0x1cc04f(_0x358086[_0xb500('0x14')](0x1f4,_0x36a2f0[_0xb500('0x16')]));});}})[_0xb500('0x18')](function(_0x238ec6){logger[_0xb500('0x14')](_0xb500('0x19'),_0x238ec6[_0xb500('0x16')]);_0x1cc04f(_0x358086['error'](0x1f4,_0x238ec6[_0xb500('0x16')]));});}else _0x37b1d9({'additional':0x0});});});};exports[_0xb500('0x2d')]=function(_0x37b661){var _0x560611=this;return new Promise(function(_0x2d7a91,_0x4549e5){return db[_0xb500('0x1a')][_0xb500('0x1b')]({'raw':!![],'where':{'ContactId':_0x37b661[_0xb500('0x1c')]['ContactId'],'ListId':_0x37b661['body'][_0xb500('0x1e')],'VoiceQueueId':_0x37b661[_0xb500('0x1c')][_0xb500('0x1f')]===undefined?null:_0x37b661['body']['VoiceQueueId'],'CampaignId':_0x37b661[_0xb500('0x1c')]['CampaignId']===undefined?null:_0x37b661[_0xb500('0x1c')][_0xb500('0x20')]}})[_0xb500('0xd')](function(_0x36459b){if(_0x36459b!=null){return db[_0xb500('0x2b')][_0xb500('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x36459b['id'],'OrderBy':{'$gte':_0x36459b[_0xb500('0x21')]}},'order':[[_0xb500('0x21'),_0xb500('0x22')]]})['then'](function(_0x46dac4){if(_0x46dac4)return activateAdditionalPhone(_0x36459b,_0x37b661[_0xb500('0x1c')],_0x46dac4,_0x37b661[_0xb500('0x2e')],_0x37b661[_0xb500('0x2f')])[_0xb500('0xd')](function(_0x554e38){_0x2d7a91(_0x554e38);});else{return db[_0xb500('0x2b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x36459b['id']},'order':[[_0xb500('0x21'),_0xb500('0x22')]]})['then'](function(_0x638183){if(_0x638183)return activateAdditionalPhone(_0x36459b,_0x37b661['body'],_0x638183,_0x37b661['duration'],_0x37b661['waitTime'])[_0xb500('0xd')](function(_0x29b1f6){_0x2d7a91(_0x29b1f6);});else{_0x2d7a91({'id':_0x36459b['id'],'phone':''});}})['catch'](function(_0x3402a9){logger[_0xb500('0x14')]('VerifyAdditionalPhones',_0x3402a9['message']);_0x4549e5(_0x560611[_0xb500('0x14')](0x1f4,_0x3402a9[_0xb500('0x16')]));});}})[_0xb500('0x18')](function(_0x548987){logger[_0xb500('0x14')]('VerifyAdditionalPhones',_0x548987['message']);_0x4549e5(_0x560611[_0xb500('0x14')](0x1f4,_0x548987['message']));});}else _0x2d7a91(0x1);});});};function activateAdditionalPhone(_0x8b61ea,_0x4e99f1,_0x16bb2d,_0xe0b54a,_0x106603){return new Promise(function(_0xc54737,_0x306b3e){var _0x6155e6;if(_['isNil'](_0x16bb2d[_0xb500('0x30')])){_0x16bb2d[_0xb500('0x30')]=moment();}if(moment()>moment(_0x16bb2d['scheduledat'])){_0x6155e6=moment()[_0xb500('0x31')](_0x106603||0x3,'minutes');}else{if(_0x16bb2d['OrderBy']==0x0){_0x6155e6=moment(_0x16bb2d['scheduledat']);}else{_0x6155e6=moment()['add'](_0x106603||0x3,_0xb500('0x32'));}}if(_[_0xb500('0x33')](_0x6155e6)){_0x6155e6=moment()[_0xb500('0x31')](_0x106603||0x3,_0xb500('0x32'));}var _0x50c5c4={'phone':_0x8b61ea[_0xb500('0x34')],'active':0x0,'OrderBy':_[_0xb500('0x33')](_0x8b61ea[_0xb500('0x21')])?0x0:_0x8b61ea[_0xb500('0x21')],'scheduledat':moment()[_0xb500('0x31')](_0xe0b54a||0x1,'minutes'),'countbusyretry':_0x4e99f1[_0xb500('0x35')],'countcongestionretry':_0x4e99f1[_0xb500('0x23')],'countnoanswerretry':_0x4e99f1[_0xb500('0x24')],'countnosuchnumberretry':_0x4e99f1[_0xb500('0x25')],'countdropretry':_0x4e99f1['countdropretry'],'countabandonedretry':_0x4e99f1[_0xb500('0x2c')],'countmachineretry':_0x4e99f1[_0xb500('0x27')],'countagentrejectretry':_0x4e99f1['countagentrejectretry'],'createdAt':_0x4e99f1[_0xb500('0x36')],'updatedAt':_0x4e99f1['updatedAt']};var _0x1c5cbf={'CmHopperId':_0x8b61ea['id'],'phone':_0x16bb2d[_0xb500('0x34')],'active':0x0,'OrderBy':_[_0xb500('0x33')](_0x16bb2d[_0xb500('0x21')])?0x0:_0x16bb2d[_0xb500('0x21')],'scheduledat':_0x6155e6,'countbusyretry':_0x16bb2d[_0xb500('0x35')],'countcongestionretry':_0x16bb2d['countcongestionretry'],'countnoanswerretry':_0x16bb2d[_0xb500('0x24')],'countnosuchnumberretry':_0x16bb2d[_0xb500('0x25')],'countdropretry':_0x16bb2d[_0xb500('0x26')],'countabandonedretry':_0x16bb2d[_0xb500('0x2c')],'countmachineretry':_0x16bb2d['countmachineretry'],'countagentrejectretry':_0x16bb2d['countagentrejectretry'],'createdAt':_0x16bb2d[_0xb500('0x36')],'updatedAt':_0x16bb2d['updatedAt']};return db[_0xb500('0x37')][_0xb500('0x38')](function(_0x5388c7){return db[_0xb500('0x2b')][_0xb500('0x39')](_0x50c5c4,{'where':{'id':_0x16bb2d['id']}},{'transaction':_0x5388c7})['then'](function(){return db[_0xb500('0x1a')]['update'](_0x1c5cbf,{'where':{'id':_0x8b61ea['id']}},{'transaction':_0x5388c7});});})[_0xb500('0xd')](function(_0x229b1b){_0xc54737({'id':_0x8b61ea['id'],'phone':_0x16bb2d[_0xb500('0x34')]});})[_0xb500('0x18')](function(_0x4fcf31){logger[_0xb500('0x14')](_0xb500('0x3a'),_0x4fcf31[_0xb500('0x16')]);_0x306b3e({'error':_0x4fcf31['message']});});});}exports[_0xb500('0x3b')]=function(_0x2fa92a){var _0x165ad6=this;return new Promise(function(_0x526a90,_0x1ba48a){return db[_0xb500('0x1a')][_0xb500('0x39')](_0x2fa92a[_0xb500('0x1c')]['field'],{'where':{'id':_0x2fa92a[_0xb500('0x1c')]['id']}})[_0xb500('0xd')](function(_0x48ade0){_0x526a90(_0x48ade0);})[_0xb500('0x18')](function(_0xf644eb){logger['error'](_0xb500('0x3b'),_0xf644eb['message']);_0x1ba48a(_0x165ad6[_0xb500('0x14')](0x1f4,_0xf644eb[_0xb500('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 7a0d116..a36ebc7 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf83=['index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated'];(function(_0x463255,_0x579491){var _0x4cb0a7=function(_0x4fd385){while(--_0x4fd385){_0x463255['push'](_0x463255['shift']());}};_0x4cb0a7(++_0x579491);}(_0xbf83,0xf9));var _0x3bf8=function(_0x4dc5e2,_0x9c0c53){_0x4dc5e2=_0x4dc5e2-0x0;var _0x18089e=_0xbf83[_0x4dc5e2];return _0x18089e;};'use strict';var multer=require(_0x3bf8('0x0'));var util=require(_0x3bf8('0x1'));var path=require(_0x3bf8('0x2'));var timeout=require(_0x3bf8('0x3'));var express=require('express');var router=express[_0x3bf8('0x4')]();var fs_extra=require(_0x3bf8('0x5'));var auth=require(_0x3bf8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3bf8('0x7'));var controller=require(_0x3bf8('0x8'));router[_0x3bf8('0x9')]('/',auth[_0x3bf8('0xa')](),controller[_0x3bf8('0xb')]);router[_0x3bf8('0x9')](_0x3bf8('0xc'),auth[_0x3bf8('0xa')](),controller[_0x3bf8('0xd')]);router[_0x3bf8('0xe')]('/',auth[_0x3bf8('0xa')](),controller[_0x3bf8('0xf')]);router['put'](_0x3bf8('0xc'),auth[_0x3bf8('0xa')](),controller[_0x3bf8('0x10')]);router[_0x3bf8('0x11')]('/:id',auth[_0x3bf8('0xa')](),controller[_0x3bf8('0x12')]);module[_0x3bf8('0x13')]=router; \ No newline at end of file +var _0x0c78=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x38782c,_0x5c9fef){var _0x3708bf=function(_0x595e13){while(--_0x595e13){_0x38782c['push'](_0x38782c['shift']());}};_0x3708bf(++_0x5c9fef);}(_0x0c78,0x1ea));var _0x80c7=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x0c78[_0x166d93];return _0xba708;};'use strict';var multer=require(_0x80c7('0x0'));var util=require(_0x80c7('0x1'));var path=require(_0x80c7('0x2'));var timeout=require(_0x80c7('0x3'));var express=require('express');var router=express[_0x80c7('0x4')]();var fs_extra=require(_0x80c7('0x5'));var auth=require(_0x80c7('0x6'));var interaction=require(_0x80c7('0x7'));var config=require(_0x80c7('0x8'));var controller=require(_0x80c7('0x9'));router[_0x80c7('0xa')]('/',auth['isAuthenticated'](),controller[_0x80c7('0xb')]);router[_0x80c7('0xa')](_0x80c7('0xc'),auth[_0x80c7('0xd')](),controller[_0x80c7('0xe')]);router[_0x80c7('0xf')]('/',auth[_0x80c7('0xd')](),controller[_0x80c7('0x10')]);router[_0x80c7('0x11')](_0x80c7('0xc'),auth[_0x80c7('0xd')](),controller[_0x80c7('0x12')]);router[_0x80c7('0x13')](_0x80c7('0xc'),auth[_0x80c7('0xd')](),controller[_0x80c7('0x14')]);module[_0x80c7('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 27f9a2b..344e455 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.attributes.js +++ b/server/api/cmHopperBlack/cmHopperBlack.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e17=['exports','STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x533fa3,_0x5ee171){var _0x23a4de=function(_0x563981){while(--_0x563981){_0x533fa3['push'](_0x533fa3['shift']());}};_0x23a4de(++_0x5ee171);}(_0x0e17,0xd6));var _0x70e1=function(_0x500bbc,_0x557453){_0x500bbc=_0x500bbc-0x0;var _0x34f2b7=_0x0e17[_0x500bbc];return _0x34f2b7;};'use strict';var moment=require(_0x70e1('0x0'));var Sequelize=require(_0x70e1('0x1'));module[_0x70e1('0x2')]={'phone':{'type':Sequelize[_0x70e1('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x70e1('0x4')],'unique':_0x70e1('0x5')},'ListId':{'type':Sequelize[_0x70e1('0x4')],'unique':_0x70e1('0x5')},'VoiceQueueId':{'type':Sequelize[_0x70e1('0x4')],'unique':_0x70e1('0x5')}}; \ No newline at end of file +var _0xe5e0=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x391414,_0x4b4a82){var _0x70433b=function(_0x5a505c){while(--_0x5a505c){_0x391414['push'](_0x391414['shift']());}};_0x70433b(++_0x4b4a82);}(_0xe5e0,0x1be));var _0x0e5e=function(_0x2df85d,_0x19f6e0){_0x2df85d=_0x2df85d-0x0;var _0x387fdc=_0xe5e0[_0x2df85d];return _0x387fdc;};'use strict';var moment=require(_0x0e5e('0x0'));var Sequelize=require(_0x0e5e('0x1'));module[_0x0e5e('0x2')]={'phone':{'type':Sequelize[_0x0e5e('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x0e5e('0x4')],'unique':_0x0e5e('0x5')},'ListId':{'type':Sequelize[_0x0e5e('0x4')],'unique':_0x0e5e('0x5')},'VoiceQueueId':{'type':Sequelize[_0x0e5e('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 24ccafb..77c6ab4 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.controller.js +++ b/server/api/cmHopperBlack/cmHopperBlack.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a9a=['merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','body','destroy','describe','rimraf','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','count','limit','set','apply','reject','update','then','sendStatus','error','name','send','map','CmHopperBlack','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','sort','filters','filter','where'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0x4a9a,0x123));var _0xa4a9=function(_0xf4cba2,_0x372e6c){_0xf4cba2=_0xf4cba2-0x0;var _0x454be4=_0x4a9a[_0xf4cba2];return _0x454be4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa4a9('0x0'));var zipdir=require(_0xa4a9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa4a9('0x2'));var moment=require(_0xa4a9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa4a9('0x4'));var util=require(_0xa4a9('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xa4a9('0x6'));var ejs=require(_0xa4a9('0x7'));var fs=require('fs');var fs_extra=require(_0xa4a9('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa4a9('0x9'));var deskjs=require(_0xa4a9('0xa'));var toCsv=require('to-csv');var querystring=require(_0xa4a9('0xb'));var Papa=require('papaparse');var Redis=require(_0xa4a9('0xc'));var authService=require(_0xa4a9('0xd'));var qs=require(_0xa4a9('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4a9('0xf'));var logger=require('../../config/logger')(_0xa4a9('0x10'));var utils=require(_0xa4a9('0x11'));var config=require(_0xa4a9('0x12'));var licenseUtil=require(_0xa4a9('0x13'));var db=require(_0xa4a9('0x14'))['db'];function respondWithStatusCode(_0x400596,_0x317a5){_0x317a5=_0x317a5||0xcc;return function(_0x38b3f3){if(_0x38b3f3){return _0x400596['sendStatus'](_0x317a5);}return _0x400596[_0xa4a9('0x15')](_0x317a5)[_0xa4a9('0x16')]();};}function respondWithResult(_0x6887c3,_0x46239f){_0x46239f=_0x46239f||0xc8;return function(_0x12ba62){if(_0x12ba62){return _0x6887c3[_0xa4a9('0x15')](_0x46239f)[_0xa4a9('0x17')](_0x12ba62);}};}function respondWithFilteredResult(_0x37f83d,_0x5edd22){return function(_0x49bce3){if(_0x49bce3){var _0x5f270e=typeof _0x5edd22['offset']===_0xa4a9('0x18')&&typeof _0x5edd22['limit']===_0xa4a9('0x18');var _0xb0a525=_0x49bce3['count'];var _0x44b3f9=_0x5f270e?0x0:_0x5edd22[_0xa4a9('0x19')];var _0xae43a=_0x5f270e?_0x49bce3[_0xa4a9('0x1a')]:_0x5edd22[_0xa4a9('0x19')]+_0x5edd22[_0xa4a9('0x1b')];var _0x7d0481;if(_0xae43a>=_0xb0a525){_0xae43a=_0xb0a525;_0x7d0481=0xc8;}else{_0x7d0481=0xce;}_0x37f83d[_0xa4a9('0x15')](_0x7d0481);return _0x37f83d[_0xa4a9('0x1c')]('Content-Range',_0x44b3f9+'-'+_0xae43a+'/'+_0xb0a525)[_0xa4a9('0x17')](_0x49bce3);}return null;};}function patchUpdates(_0x2be3df){return function(_0x402adf){try{jsonpatch[_0xa4a9('0x1d')](_0x402adf,_0x2be3df,!![]);}catch(_0x28eece){return BPromise[_0xa4a9('0x1e')](_0x28eece);}return _0x402adf['save']();};}function saveUpdates(_0x3c58ac,_0xc6647d){return function(_0x30b0d9){if(_0x30b0d9){return _0x30b0d9[_0xa4a9('0x1f')](_0x3c58ac)['then'](function(_0x1241d2){return _0x1241d2;});}return null;};}function removeEntity(_0x28aefb,_0x29252a){return function(_0x4039e6){if(_0x4039e6){return _0x4039e6['destroy']()[_0xa4a9('0x20')](function(){_0x28aefb[_0xa4a9('0x15')](0xcc)[_0xa4a9('0x16')]();});}};}function handleEntityNotFound(_0x4d9d66,_0x289d33){return function(_0x1a3445){if(!_0x1a3445){_0x4d9d66[_0xa4a9('0x21')](0x194);}return _0x1a3445;};}function handleError(_0x4e899b,_0xf9902e){_0xf9902e=_0xf9902e||0x1f4;return function(_0x34ba93){logger[_0xa4a9('0x22')](_0x34ba93['stack']);if(_0x34ba93[_0xa4a9('0x23')]){delete _0x34ba93['name'];}_0x4e899b[_0xa4a9('0x15')](_0xf9902e)[_0xa4a9('0x24')](_0x34ba93);};}exports['index']=function(_0x32f2e5,_0x353a41){var _0x3af70c={},_0x1a7b54={},_0x15b62d={'count':0x0,'rows':[]};var _0xf6b7c3=_[_0xa4a9('0x25')](db[_0xa4a9('0x26')][_0xa4a9('0x27')],function(_0x2c5ba2){return{'name':_0x2c5ba2[_0xa4a9('0x28')],'type':_0x2c5ba2[_0xa4a9('0x29')][_0xa4a9('0x2a')]};});_0x1a7b54['model']=_[_0xa4a9('0x25')](_0xf6b7c3,_0xa4a9('0x23'));_0x1a7b54['query']=_[_0xa4a9('0x2b')](_0x32f2e5[_0xa4a9('0x2c')]);_0x1a7b54['filters']=_[_0xa4a9('0x2d')](_0x1a7b54[_0xa4a9('0x2e')],_0x1a7b54[_0xa4a9('0x2c')]);_0x3af70c[_0xa4a9('0x2f')]=_[_0xa4a9('0x2d')](_0x1a7b54[_0xa4a9('0x2e')],qs['fields'](_0x32f2e5[_0xa4a9('0x2c')][_0xa4a9('0x30')]));_0x3af70c[_0xa4a9('0x2f')]=_0x3af70c['attributes']['length']?_0x3af70c[_0xa4a9('0x2f')]:_0x1a7b54['model'];if(!_0x32f2e5[_0xa4a9('0x2c')][_0xa4a9('0x31')]('nolimit')){_0x3af70c[_0xa4a9('0x1b')]=qs[_0xa4a9('0x1b')](_0x32f2e5[_0xa4a9('0x2c')][_0xa4a9('0x1b')]);_0x3af70c[_0xa4a9('0x19')]=qs[_0xa4a9('0x19')](_0x32f2e5[_0xa4a9('0x2c')][_0xa4a9('0x19')]);}_0x3af70c['order']=qs['sort'](_0x32f2e5[_0xa4a9('0x2c')][_0xa4a9('0x32')]);_0x3af70c['where']=qs['filters'](_['pick'](_0x32f2e5['query'],_0x1a7b54[_0xa4a9('0x33')]),_0xf6b7c3);if(_0x32f2e5[_0xa4a9('0x2c')][_0xa4a9('0x34')]){_0x3af70c[_0xa4a9('0x35')]=_[_0xa4a9('0x36')](_0x3af70c[_0xa4a9('0x35')],{'$or':_['map'](_0xf6b7c3,function(_0x257b0d){if(_0x257b0d[_0xa4a9('0x29')]!==_0xa4a9('0x37')){var _0x36778f={};_0x36778f[_0x257b0d[_0xa4a9('0x23')]]={'$like':'%'+_0x32f2e5[_0xa4a9('0x2c')][_0xa4a9('0x34')]+'%'};return _0x36778f;}})});}_0x3af70c=_[_0xa4a9('0x36')]({},_0x3af70c,_0x32f2e5['options']);var _0x584d1b={'where':_0x3af70c[_0xa4a9('0x35')]};return db['CmHopperBlack'][_0xa4a9('0x1a')](_0x584d1b)[_0xa4a9('0x20')](function(_0x537de1){_0x15b62d[_0xa4a9('0x1a')]=_0x537de1;if(_0x32f2e5['query'][_0xa4a9('0x38')]){_0x3af70c[_0xa4a9('0x39')]=[{'all':!![]}];}return db[_0xa4a9('0x26')][_0xa4a9('0x3a')](_0x3af70c);})['then'](function(_0x129b17){_0x15b62d[_0xa4a9('0x3b')]=_0x129b17;return _0x15b62d;})['then'](respondWithFilteredResult(_0x353a41,_0x3af70c))[_0xa4a9('0x3c')](handleError(_0x353a41,null));};exports[_0xa4a9('0x3d')]=function(_0x212e08,_0x32f4f0){var _0x1e5907={'raw':!![],'where':{'id':_0x212e08[_0xa4a9('0x3e')]['id']}},_0x380ade={};_0x380ade[_0xa4a9('0x2e')]=_['keys'](db[_0xa4a9('0x26')][_0xa4a9('0x27')]);_0x380ade[_0xa4a9('0x2c')]=_['keys'](_0x212e08[_0xa4a9('0x2c')]);_0x380ade[_0xa4a9('0x33')]=_[_0xa4a9('0x2d')](_0x380ade[_0xa4a9('0x2e')],_0x380ade[_0xa4a9('0x2c')]);_0x1e5907[_0xa4a9('0x2f')]=_[_0xa4a9('0x2d')](_0x380ade[_0xa4a9('0x2e')],qs[_0xa4a9('0x30')](_0x212e08['query']['fields']));_0x1e5907[_0xa4a9('0x2f')]=_0x1e5907[_0xa4a9('0x2f')][_0xa4a9('0x3f')]?_0x1e5907[_0xa4a9('0x2f')]:_0x380ade[_0xa4a9('0x2e')];if(_0x212e08[_0xa4a9('0x2c')][_0xa4a9('0x38')]){_0x1e5907[_0xa4a9('0x39')]=[{'all':!![]}];}_0x1e5907=_[_0xa4a9('0x36')]({},_0x1e5907,_0x212e08[_0xa4a9('0x40')]);return db['CmHopperBlack'][_0xa4a9('0x41')](_0x1e5907)[_0xa4a9('0x20')](handleEntityNotFound(_0x32f4f0,null))[_0xa4a9('0x20')](respondWithResult(_0x32f4f0,null))[_0xa4a9('0x3c')](handleError(_0x32f4f0,null));};exports[_0xa4a9('0x1f')]=function(_0x36df97,_0x14d931){if(_0x36df97[_0xa4a9('0x42')]['id']){delete _0x36df97[_0xa4a9('0x42')]['id'];}return db[_0xa4a9('0x26')][_0xa4a9('0x41')]({'where':{'id':_0x36df97[_0xa4a9('0x3e')]['id']}})[_0xa4a9('0x20')](handleEntityNotFound(_0x14d931,null))[_0xa4a9('0x20')](saveUpdates(_0x36df97['body'],null))['then'](respondWithResult(_0x14d931,null))[_0xa4a9('0x3c')](handleError(_0x14d931,null));};exports[_0xa4a9('0x43')]=function(_0x125211,_0x212910){return db[_0xa4a9('0x26')][_0xa4a9('0x41')]({'where':{'id':_0x125211[_0xa4a9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x212910,null))[_0xa4a9('0x20')](removeEntity(_0x212910,null))[_0xa4a9('0x3c')](handleError(_0x212910,null));};exports[_0xa4a9('0x44')]=function(_0x4e3fd0,_0x36309){return db[_0xa4a9('0x26')][_0xa4a9('0x44')]()['then'](respondWithResult(_0x36309,null))[_0xa4a9('0x3c')](handleError(_0x36309,null));}; \ No newline at end of file +var _0xf71f=['fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','save','then','destroy','error','stack','name','send','index','map','CmHopperBlack','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','update','body','catch','describe','eml-format','bluebird','mustache','sox','to-csv','ejs'];(function(_0x4bb12f,_0x358cfe){var _0x1bc623=function(_0x114623){while(--_0x114623){_0x4bb12f['push'](_0x4bb12f['shift']());}};_0x1bc623(++_0x358cfe);}(_0xf71f,0x112));var _0xff71=function(_0x2dfb97,_0x14d8e0){_0x2dfb97=_0x2dfb97-0x0;var _0x29cef6=_0xf71f[_0x2dfb97];return _0x29cef6;};'use strict';var emlformat=require(_0xff71('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xff71('0x1'));var Mustache=require(_0xff71('0x2'));var util=require('util');var path=require('path');var sox=require(_0xff71('0x3'));var csv=require(_0xff71('0x4'));var ejs=require(_0xff71('0x5'));var fs=require('fs');var fs_extra=require(_0xff71('0x6'));var _=require(_0xff71('0x7'));var squel=require('squel');var crypto=require(_0xff71('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xff71('0x9'));var toCsv=require(_0xff71('0x4'));var querystring=require(_0xff71('0xa'));var Papa=require(_0xff71('0xb'));var Redis=require(_0xff71('0xc'));var authService=require(_0xff71('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xff71('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xff71('0xf'));var utils=require(_0xff71('0x10'));var config=require(_0xff71('0x11'));var licenseUtil=require(_0xff71('0x12'));var db=require(_0xff71('0x13'))['db'];function respondWithStatusCode(_0x3cb7e0,_0x2980da){_0x2980da=_0x2980da||0xcc;return function(_0x32cacb){if(_0x32cacb){return _0x3cb7e0[_0xff71('0x14')](_0x2980da);}return _0x3cb7e0[_0xff71('0x15')](_0x2980da)['end']();};}function respondWithResult(_0x1d1860,_0x3b66d6){_0x3b66d6=_0x3b66d6||0xc8;return function(_0x572dff){if(_0x572dff){return _0x1d1860[_0xff71('0x15')](_0x3b66d6)[_0xff71('0x16')](_0x572dff);}};}function respondWithFilteredResult(_0x7ec93d,_0x5f2e3a){return function(_0x4350f7){if(_0x4350f7){var _0x8885f1=typeof _0x5f2e3a[_0xff71('0x17')]===_0xff71('0x18')&&typeof _0x5f2e3a[_0xff71('0x19')]===_0xff71('0x18');var _0x525dec=_0x4350f7[_0xff71('0x1a')];var _0x10bc87=_0x8885f1?0x0:_0x5f2e3a[_0xff71('0x17')];var _0x11ab2d=_0x8885f1?_0x4350f7[_0xff71('0x1a')]:_0x5f2e3a[_0xff71('0x17')]+_0x5f2e3a[_0xff71('0x19')];var _0x2d1276;if(_0x11ab2d>=_0x525dec){_0x11ab2d=_0x525dec;_0x2d1276=0xc8;}else{_0x2d1276=0xce;}_0x7ec93d['status'](_0x2d1276);return _0x7ec93d[_0xff71('0x1b')]('Content-Range',_0x10bc87+'-'+_0x11ab2d+'/'+_0x525dec)[_0xff71('0x16')](_0x4350f7);}return null;};}function patchUpdates(_0x2d6ee7){return function(_0x23a5de){try{jsonpatch['apply'](_0x23a5de,_0x2d6ee7,!![]);}catch(_0x4fbde4){return BPromise['reject'](_0x4fbde4);}return _0x23a5de[_0xff71('0x1c')]();};}function saveUpdates(_0x24b867,_0x4c7f32){return function(_0x4f665d){if(_0x4f665d){return _0x4f665d['update'](_0x24b867)[_0xff71('0x1d')](function(_0x40c7c7){return _0x40c7c7;});}return null;};}function removeEntity(_0x3ac5b6,_0x1a6a8f){return function(_0x401be3){if(_0x401be3){return _0x401be3[_0xff71('0x1e')]()['then'](function(){_0x3ac5b6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ea253,_0x230970){return function(_0x52b023){if(!_0x52b023){_0x2ea253['sendStatus'](0x194);}return _0x52b023;};}function handleError(_0x501fd1,_0x149633){_0x149633=_0x149633||0x1f4;return function(_0x1e0cb8){logger[_0xff71('0x1f')](_0x1e0cb8[_0xff71('0x20')]);if(_0x1e0cb8[_0xff71('0x21')]){delete _0x1e0cb8[_0xff71('0x21')];}_0x501fd1[_0xff71('0x15')](_0x149633)[_0xff71('0x22')](_0x1e0cb8);};}exports[_0xff71('0x23')]=function(_0x268306,_0x433a41){var _0x1e7ce2={},_0xac7214={},_0x2bc1f0={'count':0x0,'rows':[]};var _0x5a4869=_[_0xff71('0x24')](db[_0xff71('0x25')]['rawAttributes'],function(_0x935dc2){return{'name':_0x935dc2[_0xff71('0x26')],'type':_0x935dc2[_0xff71('0x27')][_0xff71('0x28')]};});_0xac7214[_0xff71('0x29')]=_[_0xff71('0x24')](_0x5a4869,_0xff71('0x21'));_0xac7214[_0xff71('0x2a')]=_[_0xff71('0x2b')](_0x268306[_0xff71('0x2a')]);_0xac7214[_0xff71('0x2c')]=_['intersection'](_0xac7214[_0xff71('0x29')],_0xac7214['query']);_0x1e7ce2['attributes']=_[_0xff71('0x2d')](_0xac7214[_0xff71('0x29')],qs[_0xff71('0x2e')](_0x268306[_0xff71('0x2a')][_0xff71('0x2e')]));_0x1e7ce2['attributes']=_0x1e7ce2[_0xff71('0x2f')][_0xff71('0x30')]?_0x1e7ce2[_0xff71('0x2f')]:_0xac7214[_0xff71('0x29')];if(!_0x268306['query']['hasOwnProperty'](_0xff71('0x31'))){_0x1e7ce2[_0xff71('0x19')]=qs[_0xff71('0x19')](_0x268306['query'][_0xff71('0x19')]);_0x1e7ce2[_0xff71('0x17')]=qs[_0xff71('0x17')](_0x268306['query'][_0xff71('0x17')]);}_0x1e7ce2[_0xff71('0x32')]=qs['sort'](_0x268306[_0xff71('0x2a')][_0xff71('0x33')]);_0x1e7ce2[_0xff71('0x34')]=qs['filters'](_[_0xff71('0x35')](_0x268306[_0xff71('0x2a')],_0xac7214[_0xff71('0x2c')]),_0x5a4869);if(_0x268306['query'][_0xff71('0x36')]){_0x1e7ce2[_0xff71('0x34')]=_[_0xff71('0x37')](_0x1e7ce2[_0xff71('0x34')],{'$or':_[_0xff71('0x24')](_0x5a4869,function(_0x18eb4c){if(_0x18eb4c['type']!==_0xff71('0x38')){var _0x18b93b={};_0x18b93b[_0x18eb4c[_0xff71('0x21')]]={'$like':'%'+_0x268306[_0xff71('0x2a')][_0xff71('0x36')]+'%'};return _0x18b93b;}})});}_0x1e7ce2=_['merge']({},_0x1e7ce2,_0x268306['options']);var _0x3c9b4a={'where':_0x1e7ce2['where']};return db[_0xff71('0x25')]['count'](_0x3c9b4a)[_0xff71('0x1d')](function(_0x17b44b){_0x2bc1f0[_0xff71('0x1a')]=_0x17b44b;if(_0x268306[_0xff71('0x2a')][_0xff71('0x39')]){_0x1e7ce2[_0xff71('0x3a')]=[{'all':!![]}];}return db[_0xff71('0x25')][_0xff71('0x3b')](_0x1e7ce2);})['then'](function(_0x2247cb){_0x2bc1f0[_0xff71('0x3c')]=_0x2247cb;return _0x2bc1f0;})[_0xff71('0x1d')](respondWithFilteredResult(_0x433a41,_0x1e7ce2))['catch'](handleError(_0x433a41,null));};exports[_0xff71('0x3d')]=function(_0x2756d7,_0x4931a8){var _0x2e2e04={'raw':!![],'where':{'id':_0x2756d7[_0xff71('0x3e')]['id']}},_0x353045={};_0x353045[_0xff71('0x29')]=_[_0xff71('0x2b')](db[_0xff71('0x25')][_0xff71('0x3f')]);_0x353045['query']=_[_0xff71('0x2b')](_0x2756d7['query']);_0x353045[_0xff71('0x2c')]=_['intersection'](_0x353045[_0xff71('0x29')],_0x353045[_0xff71('0x2a')]);_0x2e2e04[_0xff71('0x2f')]=_[_0xff71('0x2d')](_0x353045[_0xff71('0x29')],qs[_0xff71('0x2e')](_0x2756d7['query'][_0xff71('0x2e')]));_0x2e2e04['attributes']=_0x2e2e04['attributes'][_0xff71('0x30')]?_0x2e2e04[_0xff71('0x2f')]:_0x353045[_0xff71('0x29')];if(_0x2756d7[_0xff71('0x2a')][_0xff71('0x39')]){_0x2e2e04[_0xff71('0x3a')]=[{'all':!![]}];}_0x2e2e04=_['merge']({},_0x2e2e04,_0x2756d7[_0xff71('0x40')]);return db[_0xff71('0x25')][_0xff71('0x41')](_0x2e2e04)['then'](handleEntityNotFound(_0x4931a8,null))[_0xff71('0x1d')](respondWithResult(_0x4931a8,null))['catch'](handleError(_0x4931a8,null));};exports[_0xff71('0x42')]=function(_0x3c4607,_0x5e1e30){if(_0x3c4607[_0xff71('0x43')]['id']){delete _0x3c4607['body']['id'];}return db[_0xff71('0x25')][_0xff71('0x41')]({'where':{'id':_0x3c4607[_0xff71('0x3e')]['id']}})[_0xff71('0x1d')](handleEntityNotFound(_0x5e1e30,null))['then'](saveUpdates(_0x3c4607[_0xff71('0x43')],null))[_0xff71('0x1d')](respondWithResult(_0x5e1e30,null))[_0xff71('0x44')](handleError(_0x5e1e30,null));};exports['destroy']=function(_0x445671,_0x2f3365){return db[_0xff71('0x25')][_0xff71('0x41')]({'where':{'id':_0x445671[_0xff71('0x3e')]['id']}})[_0xff71('0x1d')](handleEntityNotFound(_0x2f3365,null))[_0xff71('0x1d')](removeEntity(_0x2f3365,null))[_0xff71('0x44')](handleError(_0x2f3365,null));};exports[_0xff71('0x45')]=function(_0x58b984,_0x418bdf){return db[_0xff71('0x25')]['describe']()[_0xff71('0x1d')](respondWithResult(_0x418bdf,null))['catch'](handleError(_0x418bdf,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index b62be34..de7181b 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.model.js +++ b/server/api/cmHopperBlack/cmHopperBlack.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6713=['rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x40aaca,_0x4803f4){var _0x1252f7=function(_0x5a169a){while(--_0x5a169a){_0x40aaca['push'](_0x40aaca['shift']());}};_0x1252f7(++_0x4803f4);}(_0x6713,0xf6));var _0x3671=function(_0x58175c,_0x2d9373){_0x58175c=_0x58175c-0x0;var _0x55b88f=_0x6713[_0x58175c];return _0x55b88f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3671('0x0'))(_0x3671('0x1'));var moment=require(_0x3671('0x2'));var BPromise=require(_0x3671('0x3'));var rp=require(_0x3671('0x4'));var fs=require('fs');var path=require(_0x3671('0x5'));var rimraf=require(_0x3671('0x6'));var config=require(_0x3671('0x7'));var attributes=require(_0x3671('0x8'));module[_0x3671('0x9')]=function(_0x32a217,_0x289bc6){return _0x32a217['define'](_0x3671('0xa'),attributes,{'tableName':_0x3671('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0c2=['request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','cm_hopper_black','lodash','util','../../config/logger','moment','bluebird'];(function(_0x555ebb,_0x4b1b68){var _0x3c0a4a=function(_0x312e2f){while(--_0x312e2f){_0x555ebb['push'](_0x555ebb['shift']());}};_0x3c0a4a(++_0x4b1b68);}(_0xa0c2,0xe5));var _0x2a0c=function(_0xfc04de,_0x2bea0b){_0xfc04de=_0xfc04de-0x0;var _0x171d0b=_0xa0c2[_0xfc04de];return _0x171d0b;};'use strict';var _=require(_0x2a0c('0x0'));var util=require(_0x2a0c('0x1'));var logger=require(_0x2a0c('0x2'))('api');var moment=require(_0x2a0c('0x3'));var BPromise=require(_0x2a0c('0x4'));var rp=require(_0x2a0c('0x5'));var fs=require('fs');var path=require(_0x2a0c('0x6'));var rimraf=require(_0x2a0c('0x7'));var config=require(_0x2a0c('0x8'));var attributes=require(_0x2a0c('0x9'));module[_0x2a0c('0xa')]=function(_0x27ea33,_0x19d97e){return _0x27ea33[_0x2a0c('0xb')]('CmHopperBlack',attributes,{'tableName':_0x2a0c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 0da32d3..a615558 100644 --- a/server/api/cmHopperBlack/cmHopperBlack.rpc.js +++ b/server/api/cmHopperBlack/cmHopperBlack.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ebb=['destroy','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','attributes','limit','map','include','model','update','body','raw','UpdateCmHopperBlack','DestroyCmHopperBlack'];(function(_0x358db6,_0x12291e){var _0x3a945e=function(_0x57a947){while(--_0x57a947){_0x358db6['push'](_0x358db6['shift']());}};_0x3a945e(++_0x12291e);}(_0x9ebb,0x73));var _0xb9eb=function(_0x508716,_0x4909ba){_0x508716=_0x508716-0x0;var _0x2c771e=_0x9ebb[_0x508716];return _0x2c771e;};'use strict';var _=require(_0xb9eb('0x0'));var util=require(_0xb9eb('0x1'));var moment=require(_0xb9eb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9eb('0x3'))['db'];var utils=require(_0xb9eb('0x4'));var logger=require('../../config/logger')(_0xb9eb('0x5'));var config=require(_0xb9eb('0x6'));var jayson=require(_0xb9eb('0x7'));var client=jayson[_0xb9eb('0x8')][_0xb9eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14e5ab,_0x4f3eaa,_0xa2a94b){return new BPromise(function(_0x389a82,_0x5bd8d3){return client[_0xb9eb('0xa')](_0x14e5ab,_0xa2a94b)[_0xb9eb('0xb')](function(_0x2816dc){logger[_0xb9eb('0xc')](_0xb9eb('0xd'),_0x4f3eaa,_0xb9eb('0xe'));logger[_0xb9eb('0xf')](_0xb9eb('0x10'),_0x4f3eaa,_0xb9eb('0xe'),JSON[_0xb9eb('0x11')](_0x2816dc));if(_0x2816dc[_0xb9eb('0x12')]){if(_0x2816dc['error'][_0xb9eb('0x13')]===0x1f4){logger[_0xb9eb('0x12')](_0xb9eb('0xd'),_0x4f3eaa,_0x2816dc['error'][_0xb9eb('0x14')]);return _0x5bd8d3(_0x2816dc['error'][_0xb9eb('0x14')]);}logger['error'](_0xb9eb('0xd'),_0x4f3eaa,_0x2816dc[_0xb9eb('0x12')][_0xb9eb('0x14')]);return _0x389a82(_0x2816dc['error'][_0xb9eb('0x14')]);}else{logger['info'](_0xb9eb('0xd'),_0x4f3eaa,'request\x20sent');_0x389a82(_0x2816dc[_0xb9eb('0x15')][_0xb9eb('0x14')]);}})[_0xb9eb('0x16')](function(_0x2f813c){logger[_0xb9eb('0x12')](_0xb9eb('0xd'),_0x4f3eaa,_0x2f813c);_0x5bd8d3(_0x2f813c);});});}exports[_0xb9eb('0x17')]=function(_0x13ec94){var _0xe401c5=this;return new Promise(function(_0x4f96bb,_0x3891d9){return db[_0xb9eb('0x18')][_0xb9eb('0x19')]({'raw':_0x13ec94[_0xb9eb('0x1a')]?_0x13ec94[_0xb9eb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x13ec94[_0xb9eb('0x1a')]?_0x13ec94[_0xb9eb('0x1a')]['where']||null:null,'attributes':_0x13ec94[_0xb9eb('0x1a')]?_0x13ec94['options'][_0xb9eb('0x1b')]||null:null,'limit':_0x13ec94[_0xb9eb('0x1a')]?_0x13ec94[_0xb9eb('0x1a')][_0xb9eb('0x1c')]||null:null,'include':_0x13ec94[_0xb9eb('0x1a')]?_0x13ec94[_0xb9eb('0x1a')]['include']?_[_0xb9eb('0x1d')](_0x13ec94[_0xb9eb('0x1a')][_0xb9eb('0x1e')],function(_0x13a1ea){return{'model':db[_0x13a1ea[_0xb9eb('0x1f')]],'as':_0x13a1ea['as'],'attributes':_0x13a1ea[_0xb9eb('0x1b')],'include':_0x13a1ea[_0xb9eb('0x1e')]?_['map'](_0x13a1ea[_0xb9eb('0x1e')],function(_0x34d60d){return{'model':db[_0x34d60d[_0xb9eb('0x1f')]],'as':_0x34d60d['as'],'attributes':_0x34d60d[_0xb9eb('0x1b')],'include':_0x34d60d[_0xb9eb('0x1e')]?_[_0xb9eb('0x1d')](_0x34d60d[_0xb9eb('0x1e')],function(_0x30870a){return{'model':db[_0x30870a[_0xb9eb('0x1f')]],'as':_0x30870a['as'],'attributes':_0x30870a['attributes']};}):[]};}):[]};}):[]:[]})[_0xb9eb('0xb')](function(_0x1c457e){logger['info'](_0xb9eb('0x17'),_0x13ec94);logger[_0xb9eb('0xf')](_0xb9eb('0x17'),_0x13ec94,JSON['stringify'](_0x1c457e));_0x4f96bb(_0x1c457e);})[_0xb9eb('0x16')](function(_0x5dca47){logger[_0xb9eb('0x12')]('GetCmHopperBlack',_0x5dca47[_0xb9eb('0x14')],_0x13ec94);_0x3891d9(_0xe401c5['error'](0x1f4,_0x5dca47[_0xb9eb('0x14')]));});});};exports['UpdateCmHopperBlack']=function(_0x2cb47a){var _0x31832c=this;return new Promise(function(_0x38efd4,_0x333155){return db[_0xb9eb('0x18')][_0xb9eb('0x20')](_0x2cb47a[_0xb9eb('0x21')],{'raw':_0x2cb47a['options']?_0x2cb47a[_0xb9eb('0x1a')][_0xb9eb('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cb47a[_0xb9eb('0x1a')]?_0x2cb47a['options']['where']||null:null,'attributes':_0x2cb47a['options']?_0x2cb47a[_0xb9eb('0x1a')][_0xb9eb('0x1b')]||null:null,'limit':_0x2cb47a['options']?_0x2cb47a[_0xb9eb('0x1a')][_0xb9eb('0x1c')]||null:null})[_0xb9eb('0xb')](function(_0x31a11b){logger[_0xb9eb('0xc')](_0xb9eb('0x23'),_0x2cb47a);logger[_0xb9eb('0xf')](_0xb9eb('0x23'),_0x2cb47a,JSON[_0xb9eb('0x11')](_0x31a11b));_0x38efd4(_0x31a11b);})['catch'](function(_0x82d284){logger[_0xb9eb('0x12')](_0xb9eb('0x23'),_0x82d284[_0xb9eb('0x14')],_0x2cb47a);_0x333155(_0x31832c[_0xb9eb('0x12')](0x1f4,_0x82d284[_0xb9eb('0x14')]));});});};exports[_0xb9eb('0x24')]=function(_0x57fdc1){var _0x311464=this;return new Promise(function(_0x533735,_0x559986){return db[_0xb9eb('0x18')][_0xb9eb('0x25')]({'where':_0x57fdc1[_0xb9eb('0x1a')]?_0x57fdc1[_0xb9eb('0x1a')]['where']||null:null})[_0xb9eb('0xb')](function(_0x168328){logger[_0xb9eb('0xc')]('DestroyCmHopperBlack',_0x57fdc1);logger['debug'](_0xb9eb('0x24'),_0x57fdc1,JSON['stringify'](_0x168328));_0x533735(_0x168328);})['catch'](function(_0x3fdbfe){logger[_0xb9eb('0x12')]('DestroyCmHopperBlack',_0x3fdbfe['message'],_0x57fdc1);_0x559986(_0x311464[_0xb9eb('0x12')](0x1f4,_0x3fdbfe[_0xb9eb('0x14')]));});});}; \ No newline at end of file +var _0x0613=['GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','map','model','UpdateCmHopperBlack','update','catch','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','request\x20sent','result'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0613,0x1e3));var _0x3061=function(_0x2472a6,_0x5f2d82){_0x2472a6=_0x2472a6-0x0;var _0x5c04b9=_0x0613[_0x2472a6];return _0x5c04b9;};'use strict';var _=require('lodash');var util=require(_0x3061('0x0'));var moment=require(_0x3061('0x1'));var BPromise=require(_0x3061('0x2'));var rs=require(_0x3061('0x3'));var fs=require('fs');var Redis=require(_0x3061('0x4'));var db=require(_0x3061('0x5'))['db'];var utils=require(_0x3061('0x6'));var logger=require(_0x3061('0x7'))(_0x3061('0x8'));var config=require(_0x3061('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3061('0xa')][_0x3061('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x531495,_0x152ad3,_0x556789){return new BPromise(function(_0x1a9cf0,_0x38c860){return client[_0x3061('0xc')](_0x531495,_0x556789)[_0x3061('0xd')](function(_0x31c2f1){logger[_0x3061('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x152ad3,'request\x20sent');logger[_0x3061('0xf')](_0x3061('0x10'),_0x152ad3,'request\x20sent',JSON[_0x3061('0x11')](_0x31c2f1));if(_0x31c2f1['error']){if(_0x31c2f1[_0x3061('0x12')][_0x3061('0x13')]===0x1f4){logger[_0x3061('0x12')](_0x3061('0x14'),_0x152ad3,_0x31c2f1[_0x3061('0x12')][_0x3061('0x15')]);return _0x38c860(_0x31c2f1['error'][_0x3061('0x15')]);}logger[_0x3061('0x12')](_0x3061('0x14'),_0x152ad3,_0x31c2f1['error'][_0x3061('0x15')]);return _0x1a9cf0(_0x31c2f1['error'][_0x3061('0x15')]);}else{logger['info'](_0x3061('0x14'),_0x152ad3,_0x3061('0x16'));_0x1a9cf0(_0x31c2f1[_0x3061('0x17')][_0x3061('0x15')]);}})['catch'](function(_0x1b441b){logger[_0x3061('0x12')](_0x3061('0x14'),_0x152ad3,_0x1b441b);_0x38c860(_0x1b441b);});});}exports[_0x3061('0x18')]=function(_0x296144){var _0x28dc57=this;return new Promise(function(_0x253333,_0x45372e){return db[_0x3061('0x19')]['findAll']({'raw':_0x296144[_0x3061('0x1a')]?_0x296144[_0x3061('0x1a')][_0x3061('0x1b')]===undefined?!![]:![]:!![],'where':_0x296144[_0x3061('0x1a')]?_0x296144[_0x3061('0x1a')][_0x3061('0x1c')]||null:null,'attributes':_0x296144[_0x3061('0x1a')]?_0x296144[_0x3061('0x1a')][_0x3061('0x1d')]||null:null,'limit':_0x296144['options']?_0x296144[_0x3061('0x1a')][_0x3061('0x1e')]||null:null,'include':_0x296144['options']?_0x296144['options'][_0x3061('0x1f')]?_[_0x3061('0x20')](_0x296144[_0x3061('0x1a')][_0x3061('0x1f')],function(_0x55aad2){return{'model':db[_0x55aad2[_0x3061('0x21')]],'as':_0x55aad2['as'],'attributes':_0x55aad2['attributes'],'include':_0x55aad2[_0x3061('0x1f')]?_['map'](_0x55aad2[_0x3061('0x1f')],function(_0x19c36c){return{'model':db[_0x19c36c[_0x3061('0x21')]],'as':_0x19c36c['as'],'attributes':_0x19c36c[_0x3061('0x1d')],'include':_0x19c36c[_0x3061('0x1f')]?_[_0x3061('0x20')](_0x19c36c[_0x3061('0x1f')],function(_0x217862){return{'model':db[_0x217862['model']],'as':_0x217862['as'],'attributes':_0x217862[_0x3061('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3061('0xd')](function(_0x5f5244){logger[_0x3061('0xe')](_0x3061('0x18'),_0x296144);logger[_0x3061('0xf')](_0x3061('0x18'),_0x296144,JSON['stringify'](_0x5f5244));_0x253333(_0x5f5244);})['catch'](function(_0x4be645){logger[_0x3061('0x12')](_0x3061('0x18'),_0x4be645[_0x3061('0x15')],_0x296144);_0x45372e(_0x28dc57[_0x3061('0x12')](0x1f4,_0x4be645[_0x3061('0x15')]));});});};exports[_0x3061('0x22')]=function(_0x17f5bf){var _0x4f9059=this;return new Promise(function(_0x11c48d,_0x4dcd4e){return db[_0x3061('0x19')][_0x3061('0x23')](_0x17f5bf['body'],{'raw':_0x17f5bf[_0x3061('0x1a')]?_0x17f5bf[_0x3061('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17f5bf[_0x3061('0x1a')]?_0x17f5bf[_0x3061('0x1a')][_0x3061('0x1c')]||null:null,'attributes':_0x17f5bf[_0x3061('0x1a')]?_0x17f5bf[_0x3061('0x1a')][_0x3061('0x1d')]||null:null,'limit':_0x17f5bf[_0x3061('0x1a')]?_0x17f5bf[_0x3061('0x1a')]['limit']||null:null})['then'](function(_0x1a1f8f){logger[_0x3061('0xe')](_0x3061('0x22'),_0x17f5bf);logger[_0x3061('0xf')](_0x3061('0x22'),_0x17f5bf,JSON[_0x3061('0x11')](_0x1a1f8f));_0x11c48d(_0x1a1f8f);})[_0x3061('0x24')](function(_0x315c05){logger[_0x3061('0x12')](_0x3061('0x22'),_0x315c05[_0x3061('0x15')],_0x17f5bf);_0x4dcd4e(_0x4f9059['error'](0x1f4,_0x315c05[_0x3061('0x15')]));});});};exports[_0x3061('0x25')]=function(_0x159958){var _0x5d721e=this;return new Promise(function(_0x3e918e,_0x3d97ad){return db[_0x3061('0x19')][_0x3061('0x26')]({'where':_0x159958['options']?_0x159958[_0x3061('0x1a')][_0x3061('0x1c')]||null:null})[_0x3061('0xd')](function(_0x34c75e){logger[_0x3061('0xe')]('DestroyCmHopperBlack',_0x159958);logger[_0x3061('0xf')](_0x3061('0x25'),_0x159958,JSON[_0x3061('0x11')](_0x34c75e));_0x3e918e(_0x34c75e);})[_0x3061('0x24')](function(_0x3534d9){logger['error'](_0x3061('0x25'),_0x3534d9[_0x3061('0x15')],_0x159958);_0x3d97ad(_0x5d721e['error'](0x1f4,_0x3534d9[_0x3061('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 9e959aa..e6cdfd7 100644 --- a/server/api/cmHopperBlack/index.js +++ b/server/api/cmHopperBlack/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7278=['../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4843f9,_0x4af459){var _0x193c6a=function(_0x51eca9){while(--_0x51eca9){_0x4843f9['push'](_0x4843f9['shift']());}};_0x193c6a(++_0x4af459);}(_0x7278,0x161));var _0x8727=function(_0xd5c9ff,_0x504656){_0xd5c9ff=_0xd5c9ff-0x0;var _0x2bf5d4=_0x7278[_0xd5c9ff];return _0x2bf5d4;};'use strict';var multer=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var path=require(_0x8727('0x2'));var timeout=require(_0x8727('0x3'));var express=require(_0x8727('0x4'));var router=express['Router']();var fs_extra=require(_0x8727('0x5'));var auth=require(_0x8727('0x6'));var interaction=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var controller=require(_0x8727('0x9'));router[_0x8727('0xa')]('/',auth[_0x8727('0xb')](),controller['index']);router[_0x8727('0xa')](_0x8727('0xc'),auth[_0x8727('0xb')](),controller[_0x8727('0xd')]);router[_0x8727('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8727('0xe')](_0x8727('0xf'),auth[_0x8727('0xb')](),controller[_0x8727('0x10')]);router[_0x8727('0x11')](_0x8727('0xf'),auth[_0x8727('0xb')](),controller[_0x8727('0x12')]);module['exports']=router; \ No newline at end of file +var _0x741c=['get','isAuthenticated','index','/describe','/:id','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./cmHopperBlack.controller'];(function(_0x44271e,_0x90f730){var _0x36b216=function(_0x1d0d9f){while(--_0x1d0d9f){_0x44271e['push'](_0x44271e['shift']());}};_0x36b216(++_0x90f730);}(_0x741c,0x196));var _0xc741=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x741c[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xc741('0x0'));var util=require(_0xc741('0x1'));var path=require(_0xc741('0x2'));var timeout=require(_0xc741('0x3'));var express=require(_0xc741('0x4'));var router=express[_0xc741('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc741('0x6'));var config=require('../../config/environment');var controller=require(_0xc741('0x7'));router[_0xc741('0x8')]('/',auth[_0xc741('0x9')](),controller[_0xc741('0xa')]);router[_0xc741('0x8')](_0xc741('0xb'),auth[_0xc741('0x9')](),controller['describe']);router[_0xc741('0x8')](_0xc741('0xc'),auth['isAuthenticated'](),controller[_0xc741('0xd')]);router['put']('/:id',auth[_0xc741('0x9')](),controller[_0xc741('0xe')]);router[_0xc741('0xf')](_0xc741('0xc'),auth[_0xc741('0x9')](),controller[_0xc741('0x10')]);module[_0xc741('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 596a488..0248a72 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.attributes.js +++ b/server/api/cmHopperFinal/cmHopperFinal.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa299=['BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','diff','seconds'];(function(_0x4b291e,_0x1d6dee){var _0x15db21=function(_0x1ee2d1){while(--_0x1ee2d1){_0x4b291e['push'](_0x4b291e['shift']());}};_0x15db21(++_0x1d6dee);}(_0xa299,0x12d));var _0x9a29=function(_0x3c0992,_0x8c1c3){_0x3c0992=_0x3c0992-0x0;var _0x65d126=_0xa299[_0x3c0992];return _0x65d126;};'use strict';var Sequelize=require(_0x9a29('0x0'));var moment=require(_0x9a29('0x1'));module[_0x9a29('0x2')]={'state':{'type':Sequelize[_0x9a29('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x9a29('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9a29('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9a29('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9a29('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9a29('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x9a29('0x4')]},'originatecalleridname':{'type':Sequelize[_0x9a29('0x4')]},'calleridnum':{'type':Sequelize[_0x9a29('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x9a29('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x9a29('0x5')]},'endtime':{'type':Sequelize[_0x9a29('0x5')]},'ringtime':{'type':Sequelize[_0x9a29('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9a29('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x9a29('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9a29('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9a29('0x4')]},'campaign':{'type':Sequelize[_0x9a29('0x4')]},'campaigntype':{'type':Sequelize[_0x9a29('0x4')]},'membername':{'type':Sequelize[_0x9a29('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x9a29('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9a29('0x4')]},'dispositionat':{'type':Sequelize[_0x9a29('0x5')],'set':function(_0x26fe58){var _0x1ed38c=this[_0x9a29('0x6')](_0x9a29('0x7'));if(_0x1ed38c&&_0x26fe58){this[_0x9a29('0x8')]('followuptime',moment(_0x26fe58)[_0x9a29('0x9')](moment(_0x1ed38c),_0x9a29('0xa')));}}},'amd':{'type':Sequelize[_0x9a29('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9a29('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x9a29('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9a29('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9a29('0x5')]},'deleted':{'type':Sequelize[_0x9a29('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x9a29('0x5')]},'recallme':{'type':Sequelize[_0x9a29('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x9a29('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9a29('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9a29('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9a29('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe038=['setDataValue','followuptime','diff','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe038,0x10c));var _0x8e03=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xe038[_0x32f7d7];return _0x133d09;};'use strict';var Sequelize=require(_0x8e03('0x0'));var moment=require(_0x8e03('0x1'));module[_0x8e03('0x2')]={'state':{'type':Sequelize[_0x8e03('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x8e03('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x8e03('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8e03('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8e03('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8e03('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x8e03('0x4')]},'originatecalleridname':{'type':Sequelize[_0x8e03('0x4')]},'calleridnum':{'type':Sequelize[_0x8e03('0x4')]},'calleridname':{'type':Sequelize[_0x8e03('0x4')]},'starttime':{'type':Sequelize[_0x8e03('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x8e03('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x8e03('0x5')]},'ringtime':{'type':Sequelize[_0x8e03('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8e03('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8e03('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8e03('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8e03('0x4')]},'campaign':{'type':Sequelize[_0x8e03('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x8e03('0x4')]},'disposition':{'type':Sequelize[_0x8e03('0x4')]},'secondDisposition':{'type':Sequelize[_0x8e03('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x8e03('0x5')],'set':function(_0x5e3760){var _0x101d51=this[_0x8e03('0x6')](_0x8e03('0x7'));if(_0x101d51&&_0x5e3760){this[_0x8e03('0x8')](_0x8e03('0x9'),moment(_0x5e3760)[_0x8e03('0xa')](moment(_0x101d51),'seconds'));}}},'amd':{'type':Sequelize[_0x8e03('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8e03('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x8e03('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x8e03('0x5')]},'callback':{'type':Sequelize[_0x8e03('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8e03('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8e03('0x5')]},'deleted':{'type':Sequelize[_0x8e03('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x8e03('0x5')]},'recallme':{'type':Sequelize[_0x8e03('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x8e03('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8e03('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8e03('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8e03('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8e03('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index f86ba8a..766a9d4 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.controller.js +++ b/server/api/cmHopperFinal/cmHopperFinal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1967=['sendStatus','end','json','offset','undefined','limit','count','set','apply','save','update','then','status','error','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','CmHopperFinal','includeAll','include','findAll','rows','show','params','fields','options','find','catch','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','into','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','cm_hopper_final','CampaignId\x20=\x20?','state','calleridnum','group','checkContactHopper','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x28b513,_0x59a230){var _0x1b54a9=function(_0x57d56c){while(--_0x57d56c){_0x28b513['push'](_0x28b513['shift']());}};_0x1b54a9(++_0x59a230);}(_0x1967,0x173));var _0x7196=function(_0xee3cad,_0x12bbc0){_0xee3cad=_0xee3cad-0x0;var _0x61b6b1=_0x1967[_0xee3cad];return _0x61b6b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];function respondWithStatusCode(_0x325641,_0x24f1c3){_0x24f1c3=_0x24f1c3||0xcc;return function(_0xba707b){if(_0xba707b){return _0x325641[_0x7196('0x1c')](_0x24f1c3);}return _0x325641['status'](_0x24f1c3)[_0x7196('0x1d')]();};}function respondWithResult(_0x3feccd,_0x3545aa){_0x3545aa=_0x3545aa||0xc8;return function(_0xf098c1){if(_0xf098c1){return _0x3feccd['status'](_0x3545aa)[_0x7196('0x1e')](_0xf098c1);}};}function respondWithFilteredResult(_0x539414,_0xe32933){return function(_0x2590a6){if(_0x2590a6){var _0xf7e97=typeof _0xe32933[_0x7196('0x1f')]===_0x7196('0x20')&&typeof _0xe32933[_0x7196('0x21')]===_0x7196('0x20');var _0x1ed296=_0x2590a6[_0x7196('0x22')];var _0x32fe2b=_0xf7e97?0x0:_0xe32933[_0x7196('0x1f')];var _0x5b716a=_0xf7e97?_0x2590a6['count']:_0xe32933[_0x7196('0x1f')]+_0xe32933[_0x7196('0x21')];var _0x40418d;if(_0x5b716a>=_0x1ed296){_0x5b716a=_0x1ed296;_0x40418d=0xc8;}else{_0x40418d=0xce;}_0x539414['status'](_0x40418d);return _0x539414[_0x7196('0x23')]('Content-Range',_0x32fe2b+'-'+_0x5b716a+'/'+_0x1ed296)['json'](_0x2590a6);}return null;};}function patchUpdates(_0x296e07){return function(_0x627223){try{jsonpatch[_0x7196('0x24')](_0x627223,_0x296e07,!![]);}catch(_0x4ddf78){return BPromise['reject'](_0x4ddf78);}return _0x627223[_0x7196('0x25')]();};}function saveUpdates(_0x3cd8ff,_0x598a26){return function(_0x18649b){if(_0x18649b){return _0x18649b[_0x7196('0x26')](_0x3cd8ff)[_0x7196('0x27')](function(_0x18d389){return _0x18d389;});}return null;};}function removeEntity(_0x38b3d6,_0x549f34){return function(_0x3f8178){if(_0x3f8178){return _0x3f8178['destroy']()[_0x7196('0x27')](function(){_0x38b3d6[_0x7196('0x28')](0xcc)[_0x7196('0x1d')]();});}};}function handleEntityNotFound(_0xa69810,_0x70aa65){return function(_0x43f6a2){if(!_0x43f6a2){_0xa69810['sendStatus'](0x194);}return _0x43f6a2;};}function handleError(_0x57c404,_0x1482e5){_0x1482e5=_0x1482e5||0x1f4;return function(_0x2d284f){logger[_0x7196('0x29')](_0x2d284f['stack']);if(_0x2d284f['name']){delete _0x2d284f[_0x7196('0x2a')];}_0x57c404[_0x7196('0x28')](_0x1482e5)[_0x7196('0x2b')](_0x2d284f);};}exports['index']=function(_0x35eef9,_0x4ecea1){var _0x4fd339={},_0x59d79d={},_0x30151f={'count':0x0,'rows':[]};var _0x985727=_[_0x7196('0x2c')](db['CmHopperFinal'][_0x7196('0x2d')],function(_0x45d567){return{'name':_0x45d567[_0x7196('0x2e')],'type':_0x45d567[_0x7196('0x2f')]['key']};});_0x59d79d[_0x7196('0x30')]=_[_0x7196('0x2c')](_0x985727,_0x7196('0x2a'));_0x59d79d[_0x7196('0x31')]=_[_0x7196('0x32')](_0x35eef9[_0x7196('0x31')]);_0x59d79d[_0x7196('0x33')]=_[_0x7196('0x34')](_0x59d79d[_0x7196('0x30')],_0x59d79d[_0x7196('0x31')]);_0x4fd339[_0x7196('0x35')]=_['intersection'](_0x59d79d[_0x7196('0x30')],qs['fields'](_0x35eef9[_0x7196('0x31')]['fields']));_0x4fd339[_0x7196('0x35')]=_0x4fd339[_0x7196('0x35')]['length']?_0x4fd339[_0x7196('0x35')]:_0x59d79d[_0x7196('0x30')];if(!_0x35eef9[_0x7196('0x31')][_0x7196('0x36')](_0x7196('0x37'))){_0x4fd339['limit']=qs[_0x7196('0x21')](_0x35eef9[_0x7196('0x31')][_0x7196('0x21')]);_0x4fd339[_0x7196('0x1f')]=qs[_0x7196('0x1f')](_0x35eef9[_0x7196('0x31')]['offset']);}_0x4fd339[_0x7196('0x38')]=qs[_0x7196('0x39')](_0x35eef9[_0x7196('0x31')]['sort']);_0x4fd339[_0x7196('0x3a')]=qs[_0x7196('0x33')](_[_0x7196('0x3b')](_0x35eef9[_0x7196('0x31')],_0x59d79d[_0x7196('0x33')]),_0x985727);if(_0x35eef9[_0x7196('0x31')][_0x7196('0x3c')]){_0x4fd339[_0x7196('0x3a')]=_[_0x7196('0x3d')](_0x4fd339[_0x7196('0x3a')],{'$or':_['map'](_0x985727,function(_0x257754){if(_0x257754[_0x7196('0x2f')]!=='VIRTUAL'){var _0x186efe={};_0x186efe[_0x257754['name']]={'$like':'%'+_0x35eef9['query'][_0x7196('0x3c')]+'%'};return _0x186efe;}})});}_0x4fd339=_[_0x7196('0x3d')]({},_0x4fd339,_0x35eef9['options']);var _0x587f6f={'where':_0x4fd339[_0x7196('0x3a')]};return db[_0x7196('0x3e')][_0x7196('0x22')](_0x587f6f)['then'](function(_0x36a990){_0x30151f[_0x7196('0x22')]=_0x36a990;if(_0x35eef9[_0x7196('0x31')][_0x7196('0x3f')]){_0x4fd339[_0x7196('0x40')]=[{'all':!![]}];}return db[_0x7196('0x3e')][_0x7196('0x41')](_0x4fd339);})[_0x7196('0x27')](function(_0x5cd903){_0x30151f[_0x7196('0x42')]=_0x5cd903;return _0x30151f;})[_0x7196('0x27')](respondWithFilteredResult(_0x4ecea1,_0x4fd339))['catch'](handleError(_0x4ecea1,null));};exports[_0x7196('0x43')]=function(_0x43d4c0,_0x48178f){var _0x471915={'raw':!![],'where':{'id':_0x43d4c0[_0x7196('0x44')]['id']}},_0x471bb2={};_0x471bb2['model']=_[_0x7196('0x32')](db[_0x7196('0x3e')]['rawAttributes']);_0x471bb2[_0x7196('0x31')]=_[_0x7196('0x32')](_0x43d4c0['query']);_0x471bb2[_0x7196('0x33')]=_['intersection'](_0x471bb2['model'],_0x471bb2['query']);_0x471915['attributes']=_['intersection'](_0x471bb2[_0x7196('0x30')],qs['fields'](_0x43d4c0[_0x7196('0x31')][_0x7196('0x45')]));_0x471915[_0x7196('0x35')]=_0x471915[_0x7196('0x35')]['length']?_0x471915[_0x7196('0x35')]:_0x471bb2['model'];if(_0x43d4c0[_0x7196('0x31')][_0x7196('0x3f')]){_0x471915[_0x7196('0x40')]=[{'all':!![]}];}_0x471915=_['merge']({},_0x471915,_0x43d4c0[_0x7196('0x46')]);return db[_0x7196('0x3e')][_0x7196('0x47')](_0x471915)['then'](handleEntityNotFound(_0x48178f,null))['then'](respondWithResult(_0x48178f,null))[_0x7196('0x48')](handleError(_0x48178f,null));};exports['describe']=function(_0x29c7e8,_0x582884){return db['CmHopperFinal'][_0x7196('0x49')]()['then'](respondWithResult(_0x582884,null))['catch'](handleError(_0x582884,null));};exports['update']=function(_0x2299e2,_0x5052ee){if(_0x2299e2['body'][_0x7196('0x4a')]){delete _0x2299e2[_0x7196('0x4b')][_0x7196('0x4a')];}return db[_0x7196('0x3e')]['find']({'where':{'uniqueid':_0x2299e2[_0x7196('0x44')]['id']}})['then'](handleEntityNotFound(_0x5052ee,null))[_0x7196('0x27')](saveUpdates(_0x2299e2[_0x7196('0x4b')],null))['then'](respondWithResult(_0x5052ee,null))[_0x7196('0x48')](handleError(_0x5052ee,null));};exports[_0x7196('0x4c')]=function(_0x3fe092,_0x4fa18f,_0x317ab6){return db['CmHopperFinal'][_0x7196('0x41')]({'raw':![],'where':{'VoiceQueueId':_0x3fe092[_0x7196('0x44')]['id']},'attributes':[[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x50')))),'noSuchContacts'],[db['sequelize']['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')]('`state`\x20=\x203,\x201,\x20null'))),_0x7196('0x51')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x52')))),_0x7196('0x53')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db['sequelize'][_0x7196('0x4f')](_0x7196('0x54')))),_0x7196('0x55')],[db['sequelize']['fn'](_0x7196('0x4e'),db['sequelize']['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x56')))),_0x7196('0x57')],[db[_0x7196('0x4d')]['fn']('COUNT',db[_0x7196('0x4d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x7196('0x58')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x59')))),'reCallContacts'],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x7196('0x27')](handleEntityNotFound(_0x4fa18f,null))[_0x7196('0x27')](respondWithResult(_0x4fa18f,null))[_0x7196('0x48')](handleError(_0x4fa18f,null));};exports[_0x7196('0x5a')]=function(_0x14cb38,_0x43b9ac,_0xe3fb61){return db[_0x7196('0x3e')][_0x7196('0x41')]({'raw':![],'where':{'CampaignId':_0x14cb38[_0x7196('0x44')]['id']},'attributes':[[db[_0x7196('0x4d')]['fn']('COUNT',db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x50')))),'noSuchContacts'],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x5b')))),_0x7196('0x51')],[db['sequelize']['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')]('`state`\x20=\x205,\x201,\x20null'))),_0x7196('0x53')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x54')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0x7196('0x4d')]['fn']('IF',db['sequelize'][_0x7196('0x4f')](_0x7196('0x56')))),_0x7196('0x57')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x5c')))),'abandonedContacts'],[db['sequelize']['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x59')))),_0x7196('0x5d')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0x7196('0x4f')]('`state`\x20=\x2019,\x201,\x20null'))),_0x7196('0x5e')]]})['then'](handleEntityNotFound(_0x43b9ac,null))[_0x7196('0x27')](respondWithResult(_0x43b9ac,null))[_0x7196('0x48')](handleError(_0x43b9ac,null));};exports[_0x7196('0x5f')]=function(_0x267903,_0x5ab6ae,_0x5a786a){return db[_0x7196('0x60')]['find']({'where':{'id':_0x267903[_0x7196('0x44')]['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x5ab6ae,null))[_0x7196('0x27')](function(_0x38c1b3){var _0xd4c784;if(_0x38c1b3){_0xd4c784=squel[_0x7196('0x61')]()['into'](_0x7196('0x62'))[_0x7196('0x63')]([_0x7196('0x64'),_0x7196('0x65'),_0x7196('0x66'),_0x7196('0x67'),_0x7196('0x68'),_0x7196('0x69'),_0x7196('0x6a')],squel[_0x7196('0x6b')]()[_0x7196('0x6c')](_0x7196('0x6d'),'phone')[_0x7196('0x6c')](_0x7196('0x6e'),'scheduledAt')['field'](_0x7196('0x6f'),_0x7196('0x66'))[_0x7196('0x6c')]('ANY_VALUE(ListId)',_0x7196('0x67'))['field'](_0x7196('0x70'),_0x7196('0x68'))['field'](_0x7196('0x6e'),'createdAt')['field'](_0x7196('0x6e'),_0x7196('0x6a'))[_0x7196('0x71')]('cm_hopper_final')[_0x7196('0x3a')]('VoiceQueueId\x20=\x20?',_0x267903[_0x7196('0x44')]['id'][_0x7196('0x72')]())[_0x7196('0x3a')](_0x7196('0x73'),_0x267903[_0x7196('0x4b')]['state'][_0x7196('0x72')]())[_0x7196('0x3a')](_0x7196('0x74'))[_0x7196('0x3a')](_0x7196('0x75'),squel[_0x7196('0x6b')]()[_0x7196('0x6c')](_0x7196('0x64'))['from'](_0x7196('0x62'))[_0x7196('0x3a')](_0x7196('0x76'),_0x267903[_0x7196('0x44')]['id']['toString']()))[_0x7196('0x3a')](_0x7196('0x75'),squel['select']()[_0x7196('0x6c')]('calleridnum')[_0x7196('0x71')]('cm_hopper_final')[_0x7196('0x3a')](_0x7196('0x76'),_0x267903['params']['id'][_0x7196('0x72')]())[_0x7196('0x3a')](_0x7196('0x77')))['group']('ContactId'))[_0x7196('0x72')]();return db['sequelize']['query'](_0xd4c784);}return[];})[_0x7196('0x27')](respondWithResult(_0x5ab6ae,null))[_0x7196('0x48')](handleError(_0x5ab6ae,null));};exports[_0x7196('0x78')]=function(_0x509c4a,_0x35c5b3,_0x59370b){return db[_0x7196('0x79')][_0x7196('0x47')]({'where':{'id':_0x509c4a[_0x7196('0x44')]['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x35c5b3,null))[_0x7196('0x27')](function(_0x8673e){var _0x32ba47;if(_0x8673e){_0x32ba47=squel[_0x7196('0x61')]()[_0x7196('0x7a')]('cm_hopper')['fromQuery']([_0x7196('0x64'),'scheduledAt','ContactId',_0x7196('0x67'),_0x7196('0x7b'),_0x7196('0x69'),_0x7196('0x6a')],squel['select']()['field'](_0x7196('0x6d'),_0x7196('0x64'))[_0x7196('0x6c')](_0x7196('0x6e'),'scheduledAt')[_0x7196('0x6c')]('ANY_VALUE(ContactId)','ContactId')[_0x7196('0x6c')](_0x7196('0x7c'),_0x7196('0x67'))['field'](_0x7196('0x7d'),_0x7196('0x7b'))[_0x7196('0x6c')](_0x7196('0x6e'),_0x7196('0x69'))[_0x7196('0x6c')](_0x7196('0x6e'),_0x7196('0x6a'))['from'](_0x7196('0x7e'))[_0x7196('0x3a')](_0x7196('0x7f'),_0x509c4a[_0x7196('0x44')]['id'][_0x7196('0x72')]())['where'](_0x7196('0x73'),_0x509c4a[_0x7196('0x4b')][_0x7196('0x80')]['toString']())[_0x7196('0x3a')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x7196('0x75'),squel[_0x7196('0x6b')]()['field'](_0x7196('0x64'))[_0x7196('0x71')]('cm_hopper')[_0x7196('0x3a')](_0x7196('0x7f'),_0x509c4a[_0x7196('0x44')]['id'][_0x7196('0x72')]()))[_0x7196('0x3a')](_0x7196('0x75'),squel['select']()[_0x7196('0x6c')](_0x7196('0x81'))[_0x7196('0x71')]('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x509c4a[_0x7196('0x44')]['id'][_0x7196('0x72')]())[_0x7196('0x3a')]('state\x20=\x204'))[_0x7196('0x82')]('ContactId'))[_0x7196('0x72')]();return db['sequelize'][_0x7196('0x31')](_0x32ba47);}return[];})[_0x7196('0x27')](respondWithResult(_0x35c5b3,null))[_0x7196('0x48')](handleError(_0x35c5b3,null));};exports[_0x7196('0x83')]=function(_0x37290e,_0x10b628,_0x43e7d5){return db['CmHopper'][_0x7196('0x84')]({'where':{'VoiceQueueId':_0x37290e['body']['VoiceQueueId'],'CampaignId':_0x37290e['body']['CampaignId'],'ContactId':_0x37290e['body'][_0x7196('0x66')]}})[_0x7196('0x27')](handleEntityNotFound(_0x10b628,null))[_0x7196('0x27')](function(_0x5bab25){if(_0x5bab25){return _0x5bab25;}return null;})[_0x7196('0x27')](respondWithResult(_0x10b628,null))['catch'](handleError(_0x10b628,null));}; \ No newline at end of file +var _0x524e=['destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperFinal','then','includeAll','include','findAll','rows','catch','show','length','find','describe','body','uniqueid','params','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','group','Campaign','ContactId','ANY_VALUE(calleridnum)','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum','CmHopper','findOne','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x524e,0x15e));var _0xe524=function(_0x31365b,_0xe2cc4){_0x31365b=_0x31365b-0x0;var _0x32d73a=_0x524e[_0x31365b];return _0x32d73a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['CmHopperFinal'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':!![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['describe']()[_0xe524('0x3f')](respondWithResult(_0x33b1c8,null))['catch'](handleError(_0x33b1c8,null));};exports['update']=function(_0x24f313,_0x59fe6b){if(_0x24f313[_0xe524('0x49')][_0xe524('0x4a')]){delete _0x24f313['body'][_0xe524('0x4a')];}return db['CmHopperFinal']['find']({'where':{'uniqueid':_0x24f313[_0xe524('0x4b')]['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x59fe6b,null))[_0xe524('0x3f')](saveUpdates(_0x24f313['body'],null))['then'](respondWithResult(_0x59fe6b,null))['catch'](handleError(_0x59fe6b,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x4f7a64,_0x5477ca,_0x45f504){return db[_0xe524('0x3e')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x4f7a64[_0xe524('0x4b')]['id']},'attributes':[[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x4e')))),_0xe524('0x4f')],[db[_0xe524('0x4c')]['fn']('COUNT',db[_0xe524('0x4c')]['fn']('IF',db['sequelize'][_0xe524('0x50')](_0xe524('0x51')))),_0xe524('0x52')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x53')))),_0xe524('0x54')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xe524('0x55')))),_0xe524('0x56')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x57')))),_0xe524('0x58')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn']('COUNT',db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x59')))),'reCallContacts'],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xe524('0x3f')](handleEntityNotFound(_0x5477ca,null))['then'](respondWithResult(_0x5477ca,null))[_0xe524('0x44')](handleError(_0x5477ca,null));};exports[_0xe524('0x5a')]=function(_0x3f4201,_0x287ab8,_0x2b2a0e){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x3f4201[_0xe524('0x4b')]['id']},'attributes':[[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')]('`state`\x20=\x200,\x201,\x20null'))),_0xe524('0x4f')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x51')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x53')))),'busyContacts'],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x55')))),_0xe524('0x56')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x57')))),_0xe524('0x58')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db['sequelize'][_0xe524('0x50')](_0xe524('0x5b')))),_0xe524('0x5c')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x59')))),_0xe524('0x5d')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x5e')))),_0xe524('0x5f')]]})[_0xe524('0x3f')](handleEntityNotFound(_0x287ab8,null))['then'](respondWithResult(_0x287ab8,null))[_0xe524('0x44')](handleError(_0x287ab8,null));};exports[_0xe524('0x60')]=function(_0x43d125,_0x13905f,_0x4514d4){return db['VoiceQueue'][_0xe524('0x47')]({'where':{'id':_0x43d125[_0xe524('0x4b')]['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x13905f,null))[_0xe524('0x3f')](function(_0x109da1){var _0x57b6bb;if(_0x109da1){_0x57b6bb=squel[_0xe524('0x61')]()[_0xe524('0x62')](_0xe524('0x63'))[_0xe524('0x64')]([_0xe524('0x65'),_0xe524('0x66'),'ContactId',_0xe524('0x67'),_0xe524('0x68'),_0xe524('0x69'),'updatedAt'],squel[_0xe524('0x6a')]()[_0xe524('0x6b')]('ANY_VALUE(calleridnum)',_0xe524('0x65'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x66'))[_0xe524('0x6b')](_0xe524('0x6d'),'ContactId')[_0xe524('0x6b')](_0xe524('0x6e'),_0xe524('0x67'))[_0xe524('0x6b')](_0xe524('0x6f'),_0xe524('0x68'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x69'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x70'))[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')]('VoiceQueueId\x20=\x20?',_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]())[_0xe524('0x38')]('state\x20=\x20?',_0x43d125[_0xe524('0x49')][_0xe524('0x74')]['toString']())['where'](_0xe524('0x75'))['where'](_0xe524('0x76'),squel['select']()[_0xe524('0x6b')](_0xe524('0x65'))[_0xe524('0x71')](_0xe524('0x63'))['where']('VoiceQueueId\x20=\x20?',_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]()))['where'](_0xe524('0x76'),squel[_0xe524('0x6a')]()[_0xe524('0x6b')]('calleridnum')[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')](_0xe524('0x77'),_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]())['where']('state\x20=\x204'))[_0xe524('0x78')]('ContactId'))[_0xe524('0x73')]();return db[_0xe524('0x4c')][_0xe524('0x35')](_0x57b6bb);}return[];})['then'](respondWithResult(_0x13905f,null))[_0xe524('0x44')](handleError(_0x13905f,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1681c5,_0x41e693,_0xfc62e5){return db[_0xe524('0x79')][_0xe524('0x47')]({'where':{'id':_0x1681c5[_0xe524('0x4b')]['id']}})['then'](handleEntityNotFound(_0x41e693,null))[_0xe524('0x3f')](function(_0x35d0f4){var _0xa8334;if(_0x35d0f4){_0xa8334=squel['insert']()[_0xe524('0x62')](_0xe524('0x63'))['fromQuery']([_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x7a'),_0xe524('0x67'),'CampaignId',_0xe524('0x69'),_0xe524('0x70')],squel[_0xe524('0x6a')]()['field'](_0xe524('0x7b'),'phone')[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x66'))['field'](_0xe524('0x6d'),_0xe524('0x7a'))[_0xe524('0x6b')]('ANY_VALUE(ListId)','ListId')[_0xe524('0x6b')]('ANY_VALUE(CampaignId)',_0xe524('0x7c'))['field'](_0xe524('0x6c'),_0xe524('0x69'))['field'](_0xe524('0x6c'),_0xe524('0x70'))['from']('cm_hopper_final')[_0xe524('0x38')](_0xe524('0x7d'),_0x1681c5[_0xe524('0x4b')]['id']['toString']())[_0xe524('0x38')](_0xe524('0x7e'),_0x1681c5[_0xe524('0x49')][_0xe524('0x74')][_0xe524('0x73')]())[_0xe524('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xe524('0x38')](_0xe524('0x76'),squel['select']()['field'](_0xe524('0x65'))[_0xe524('0x71')](_0xe524('0x63'))[_0xe524('0x38')]('CampaignId\x20=\x20?',_0x1681c5[_0xe524('0x4b')]['id'][_0xe524('0x73')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xe524('0x6a')]()[_0xe524('0x6b')](_0xe524('0x7f'))[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')]('CampaignId\x20=\x20?',_0x1681c5['params']['id'][_0xe524('0x73')]())[_0xe524('0x38')]('state\x20=\x204'))['group'](_0xe524('0x7a')))[_0xe524('0x73')]();return db[_0xe524('0x4c')][_0xe524('0x35')](_0xa8334);}return[];})[_0xe524('0x3f')](respondWithResult(_0x41e693,null))[_0xe524('0x44')](handleError(_0x41e693,null));};exports['checkContactHopper']=function(_0x555801,_0x3e8668,_0x390093){return db[_0xe524('0x80')][_0xe524('0x81')]({'where':{'VoiceQueueId':_0x555801[_0xe524('0x49')][_0xe524('0x68')],'CampaignId':_0x555801[_0xe524('0x49')][_0xe524('0x7c')],'ContactId':_0x555801['body'][_0xe524('0x7a')]}})[_0xe524('0x3f')](handleEntityNotFound(_0x3e8668,null))[_0xe524('0x3f')](function(_0x5242b7){if(_0x5242b7){return _0x5242b7;}return null;})['then'](respondWithResult(_0x3e8668,null))[_0xe524('0x44')](handleError(_0x3e8668,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 030f7c8..ad22eba 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.model.js +++ b/server/api/cmHopperFinal/cmHopperFinal.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c06=['exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cmHopperFinal.attributes'];(function(_0xd1bbe,_0x2243d2){var _0x191081=function(_0x28594e){while(--_0x28594e){_0xd1bbe['push'](_0xd1bbe['shift']());}};_0x191081(++_0x2243d2);}(_0x8c06,0xc9));var _0x68c0=function(_0xfa2a1f,_0x522d52){_0xfa2a1f=_0xfa2a1f-0x0;var _0x5a6382=_0x8c06[_0xfa2a1f];return _0x5a6382;};'use strict';var _=require(_0x68c0('0x0'));var util=require(_0x68c0('0x1'));var logger=require(_0x68c0('0x2'))(_0x68c0('0x3'));var moment=require(_0x68c0('0x4'));var BPromise=require(_0x68c0('0x5'));var rp=require(_0x68c0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x68c0('0x7'));var attributes=require(_0x68c0('0x8'));module[_0x68c0('0x9')]=function(_0x33ab29,_0x18f146){return _0x33ab29[_0x68c0('0xa')](_0x68c0('0xb'),attributes,{'tableName':_0x68c0('0xc'),'paranoid':![],'indexes':[{'name':_0x68c0('0xd'),'fields':[_0x68c0('0xd')]},{'name':_0x68c0('0xe'),'fields':[_0x68c0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x23ba=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util'];(function(_0x3a012d,_0x118275){var _0x6ac53b=function(_0x4d0a9a){while(--_0x4d0a9a){_0x3a012d['push'](_0x3a012d['shift']());}};_0x6ac53b(++_0x118275);}(_0x23ba,0x1a2));var _0xa23b=function(_0x82ea14,_0x7b3d2b){_0x82ea14=_0x82ea14-0x0;var _0xf9d84=_0x23ba[_0x82ea14];return _0xf9d84;};'use strict';var _=require(_0xa23b('0x0'));var util=require(_0xa23b('0x1'));var logger=require(_0xa23b('0x2'))(_0xa23b('0x3'));var moment=require(_0xa23b('0x4'));var BPromise=require(_0xa23b('0x5'));var rp=require(_0xa23b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa23b('0x7'));var config=require(_0xa23b('0x8'));var attributes=require('./cmHopperFinal.attributes');module[_0xa23b('0x9')]=function(_0xf30211,_0x3be870){return _0xf30211[_0xa23b('0xa')](_0xa23b('0xb'),attributes,{'tableName':_0xa23b('0xc'),'paranoid':![],'indexes':[{'name':_0xa23b('0xd'),'fields':[_0xa23b('0xd')]},{'name':_0xa23b('0xe'),'fields':[_0xa23b('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index f28e461..574846f 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0xd83488,_0x1e2e9f){var _0x36c5a7=function(_0x5e117e){while(--_0x5e117e){_0xd83488['push'](_0xd83488['shift']());}};_0x36c5a7(++_0x1e2e9f);}(_0xb10b,0x12a));var _0xbb10=function(_0x160e80,_0x52a4f3){_0x160e80=_0x160e80-0x0;var _0x328e25=_0xb10b[_0x160e80];return _0x328e25;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x53db31,_0x21df02){var _0x1c31ac=function(_0xe908f7){while(--_0xe908f7){_0x53db31['push'](_0x53db31['shift']());}};_0x1c31ac(++_0x21df02);}(_0x7a54,0x106));var _0x47a5=function(_0x58884b,_0x3a2d65){_0x58884b=_0x58884b-0x0;var _0x147fbf=_0x7a54[_0x58884b];return _0x147fbf;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 1559daf..9ffc386 100644 --- a/server/api/cmHopperFinal/index.js +++ b/server/api/cmHopperFinal/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f01=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','update','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','show','post'];(function(_0x40f039,_0x50bf9e){var _0x4a3a0f=function(_0x2221cf){while(--_0x2221cf){_0x40f039['push'](_0x40f039['shift']());}};_0x4a3a0f(++_0x50bf9e);}(_0x8f01,0x1d7));var _0x18f0=function(_0x48999d,_0x1e02cb){_0x48999d=_0x48999d-0x0;var _0x1ad0d1=_0x8f01[_0x48999d];return _0x1ad0d1;};'use strict';var multer=require(_0x18f0('0x0'));var util=require(_0x18f0('0x1'));var path=require('path');var timeout=require(_0x18f0('0x2'));var express=require('express');var router=express[_0x18f0('0x3')]();var fs_extra=require(_0x18f0('0x4'));var auth=require(_0x18f0('0x5'));var interaction=require(_0x18f0('0x6'));var config=require(_0x18f0('0x7'));var controller=require('./cmHopperFinal.controller');router[_0x18f0('0x8')]('/',auth[_0x18f0('0x9')](),controller['index']);router[_0x18f0('0x8')](_0x18f0('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x18f0('0x8')]('/:id',auth[_0x18f0('0x9')](),controller[_0x18f0('0xb')]);router[_0x18f0('0x8')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router[_0x18f0('0x8')]('/campaign/countAttributes/:id',auth[_0x18f0('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x18f0('0xc')](_0x18f0('0xd'),auth[_0x18f0('0x9')](),controller[_0x18f0('0xe')]);router[_0x18f0('0xc')]('/voice/campaign/moveContacts/:id',auth[_0x18f0('0x9')](),controller[_0x18f0('0xf')]);router[_0x18f0('0xc')](_0x18f0('0x10'),auth[_0x18f0('0x9')](),controller[_0x18f0('0x11')]);router[_0x18f0('0x12')](_0x18f0('0x13'),auth['isAuthenticated'](),controller[_0x18f0('0x14')]);module[_0x18f0('0x15')]=router; \ No newline at end of file +var _0xcbda=['post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','put','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xcbda,0x10e));var _0xacbd=function(_0x1bebe8,_0x156046){_0x1bebe8=_0x1bebe8-0x0;var _0x207c81=_0xcbda[_0x1bebe8];return _0x207c81;};'use strict';var multer=require(_0xacbd('0x0'));var util=require(_0xacbd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xacbd('0x2'));var router=express[_0xacbd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xacbd('0x4'));var interaction=require(_0xacbd('0x5'));var config=require(_0xacbd('0x6'));var controller=require('./cmHopperFinal.controller');router[_0xacbd('0x7')]('/',auth[_0xacbd('0x8')](),controller[_0xacbd('0x9')]);router[_0xacbd('0x7')](_0xacbd('0xa'),auth[_0xacbd('0x8')](),controller['describe']);router['get'](_0xacbd('0xb'),auth[_0xacbd('0x8')](),controller[_0xacbd('0xc')]);router[_0xacbd('0x7')](_0xacbd('0xd'),auth['isAuthenticated'](),controller[_0xacbd('0xe')]);router['get'](_0xacbd('0xf'),auth[_0xacbd('0x8')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xacbd('0x10')](_0xacbd('0x11'),auth[_0xacbd('0x8')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xacbd('0x10')](_0xacbd('0x12'),auth[_0xacbd('0x8')](),controller[_0xacbd('0x13')]);router[_0xacbd('0x10')]('/checkContactHopper',auth['isAuthenticated'](),controller['checkContactHopper']);router[_0xacbd('0x14')](_0xacbd('0xb'),auth['isAuthenticated'](),controller['update']);module[_0xacbd('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 9ab1801..0052eb8 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.attributes.js +++ b/server/api/cmHopperHistory/cmHopperHistory.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38b2=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0x38b2,0xf6));var _0x238b=function(_0x2f81e4,_0x454a3b){_0x2f81e4=_0x2f81e4-0x0;var _0x5303bc=_0x38b2[_0x2f81e4];return _0x5303bc;};'use strict';var Sequelize=require(_0x238b('0x0'));module[_0x238b('0x1')]={'state':{'type':Sequelize[_0x238b('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x238b('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x238b('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x238b('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x238b('0x3')]},'originatecalleridname':{'type':Sequelize[_0x238b('0x3')]},'calleridnum':{'type':Sequelize[_0x238b('0x3')]},'calleridname':{'type':Sequelize[_0x238b('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x238b('0x4')]},'answertime':{'type':Sequelize[_0x238b('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x238b('0x4')]},'ringtime':{'type':Sequelize[_0x238b('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x238b('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x238b('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x238b('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x238b('0x3')]},'campaign':{'type':Sequelize[_0x238b('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x238b('0x3')]},'reason':{'type':Sequelize[_0x238b('0x3')]},'amd':{'type':Sequelize[_0x238b('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x238b('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x238b('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x238b('0x4')]},'recallme':{'type':Sequelize[_0x238b('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x238b('0x4')]},'edited':{'type':Sequelize[_0x238b('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x238b('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x238b('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x238b('0x3')]}}; \ No newline at end of file +var _0xd1bb=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x5f2368,_0x29c539){var _0x11d9a3=function(_0x2c5363){while(--_0x2c5363){_0x5f2368['push'](_0x5f2368['shift']());}};_0x11d9a3(++_0x29c539);}(_0xd1bb,0x141));var _0xbd1b=function(_0x22ce21,_0x1d5fb3){_0x22ce21=_0x22ce21-0x0;var _0x5e3f98=_0xd1bb[_0x22ce21];return _0x5e3f98;};'use strict';var Sequelize=require(_0xbd1b('0x0'));module[_0xbd1b('0x1')]={'state':{'type':Sequelize[_0xbd1b('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xbd1b('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xbd1b('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xbd1b('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xbd1b('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xbd1b('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xbd1b('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xbd1b('0x3')]},'originatecalleridname':{'type':Sequelize[_0xbd1b('0x3')]},'calleridnum':{'type':Sequelize[_0xbd1b('0x3')]},'calleridname':{'type':Sequelize[_0xbd1b('0x3')]},'starttime':{'type':Sequelize[_0xbd1b('0x4')]},'responsetime':{'type':Sequelize[_0xbd1b('0x4')]},'answertime':{'type':Sequelize[_0xbd1b('0x4')]},'droptime':{'type':Sequelize[_0xbd1b('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xbd1b('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xbd1b('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xbd1b('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xbd1b('0x3')]},'campaign':{'type':Sequelize[_0xbd1b('0x3')]},'campaigntype':{'type':Sequelize[_0xbd1b('0x3')]},'membername':{'type':Sequelize[_0xbd1b('0x3')]},'reason':{'type':Sequelize[_0xbd1b('0x3')]},'amd':{'type':Sequelize[_0xbd1b('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xbd1b('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xbd1b('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xbd1b('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbd1b('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xbd1b('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xbd1b('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xbd1b('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xbd1b('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xbd1b('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xbd1b('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xbd1b('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index f066f67..51b0641 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.controller.js +++ b/server/api/cmHopperHistory/cmHopperHistory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33e9=['../../mysqldb','status','end','offset','undefined','limit','count','json','apply','then','destroy','sendStatus','error','stack','name','send','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','show','params','length','includeAll','options','find','create','body','catch','describe','update','uniqueid','eml-format','rimraf','zip-dir','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x9eda33,_0x511546){var _0x5eaa18=function(_0x52dc77){while(--_0x52dc77){_0x9eda33['push'](_0x9eda33['shift']());}};_0x5eaa18(++_0x511546);}(_0x33e9,0xca));var _0x933e=function(_0x1752bf,_0x11374d){_0x1752bf=_0x1752bf-0x0;var _0x3435b8=_0x33e9[_0x1752bf];return _0x3435b8;};'use strict';var emlformat=require(_0x933e('0x0'));var rimraf=require(_0x933e('0x1'));var zipdir=require(_0x933e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x933e('0x3'));var util=require(_0x933e('0x4'));var path=require(_0x933e('0x5'));var sox=require('sox');var csv=require(_0x933e('0x6'));var ejs=require(_0x933e('0x7'));var fs=require('fs');var fs_extra=require(_0x933e('0x8'));var _=require(_0x933e('0x9'));var squel=require(_0x933e('0xa'));var crypto=require(_0x933e('0xb'));var jsforce=require(_0x933e('0xc'));var deskjs=require(_0x933e('0xd'));var toCsv=require(_0x933e('0x6'));var querystring=require(_0x933e('0xe'));var Papa=require(_0x933e('0xf'));var Redis=require(_0x933e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x933e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x933e('0x12'));var logger=require(_0x933e('0x13'))(_0x933e('0x14'));var utils=require('../../config/utils');var config=require(_0x933e('0x15'));var licenseUtil=require(_0x933e('0x16'));var db=require(_0x933e('0x17'))['db'];function respondWithStatusCode(_0x4627a1,_0x2f90c2){_0x2f90c2=_0x2f90c2||0xcc;return function(_0x296414){if(_0x296414){return _0x4627a1['sendStatus'](_0x2f90c2);}return _0x4627a1[_0x933e('0x18')](_0x2f90c2)[_0x933e('0x19')]();};}function respondWithResult(_0x140b4a,_0x42e2e0){_0x42e2e0=_0x42e2e0||0xc8;return function(_0x5c69e8){if(_0x5c69e8){return _0x140b4a[_0x933e('0x18')](_0x42e2e0)['json'](_0x5c69e8);}};}function respondWithFilteredResult(_0x5cd88e,_0x37144f){return function(_0x53d2dd){if(_0x53d2dd){var _0x3b6ff3=typeof _0x37144f[_0x933e('0x1a')]===_0x933e('0x1b')&&typeof _0x37144f[_0x933e('0x1c')]===_0x933e('0x1b');var _0x3d8478=_0x53d2dd['count'];var _0x1788d0=_0x3b6ff3?0x0:_0x37144f[_0x933e('0x1a')];var _0x52ad2b=_0x3b6ff3?_0x53d2dd[_0x933e('0x1d')]:_0x37144f['offset']+_0x37144f['limit'];var _0x2c3c34;if(_0x52ad2b>=_0x3d8478){_0x52ad2b=_0x3d8478;_0x2c3c34=0xc8;}else{_0x2c3c34=0xce;}_0x5cd88e[_0x933e('0x18')](_0x2c3c34);return _0x5cd88e['set']('Content-Range',_0x1788d0+'-'+_0x52ad2b+'/'+_0x3d8478)[_0x933e('0x1e')](_0x53d2dd);}return null;};}function patchUpdates(_0x50ec02){return function(_0x3dde13){try{jsonpatch[_0x933e('0x1f')](_0x3dde13,_0x50ec02,!![]);}catch(_0x1cf865){return BPromise['reject'](_0x1cf865);}return _0x3dde13['save']();};}function saveUpdates(_0x5c0ecb,_0x2b5e0e){return function(_0x22b90d){if(_0x22b90d){return _0x22b90d['update'](_0x5c0ecb)[_0x933e('0x20')](function(_0x437a14){return _0x437a14;});}return null;};}function removeEntity(_0x56fadf,_0x126846){return function(_0x455c4a){if(_0x455c4a){return _0x455c4a[_0x933e('0x21')]()['then'](function(){_0x56fadf['status'](0xcc)[_0x933e('0x19')]();});}};}function handleEntityNotFound(_0x1cb38a,_0x1e5a37){return function(_0xc1b39c){if(!_0xc1b39c){_0x1cb38a[_0x933e('0x22')](0x194);}return _0xc1b39c;};}function handleError(_0x41df6d,_0x16b0ee){_0x16b0ee=_0x16b0ee||0x1f4;return function(_0x42e8e4){logger[_0x933e('0x23')](_0x42e8e4[_0x933e('0x24')]);if(_0x42e8e4['name']){delete _0x42e8e4[_0x933e('0x25')];}_0x41df6d[_0x933e('0x18')](_0x16b0ee)[_0x933e('0x26')](_0x42e8e4);};}exports['index']=function(_0x1e1419,_0x35b8e3){var _0x39eb67={},_0x5b5c07={},_0x22a2ab={'count':0x0,'rows':[]};var _0x28b036=_[_0x933e('0x27')](db[_0x933e('0x28')][_0x933e('0x29')],function(_0x1e39f2){return{'name':_0x1e39f2[_0x933e('0x2a')],'type':_0x1e39f2[_0x933e('0x2b')][_0x933e('0x2c')]};});_0x5b5c07[_0x933e('0x2d')]=_['map'](_0x28b036,_0x933e('0x25'));_0x5b5c07[_0x933e('0x2e')]=_[_0x933e('0x2f')](_0x1e1419['query']);_0x5b5c07['filters']=_[_0x933e('0x30')](_0x5b5c07['model'],_0x5b5c07[_0x933e('0x2e')]);_0x39eb67[_0x933e('0x31')]=_[_0x933e('0x30')](_0x5b5c07[_0x933e('0x2d')],qs[_0x933e('0x32')](_0x1e1419[_0x933e('0x2e')]['fields']));_0x39eb67[_0x933e('0x31')]=_0x39eb67[_0x933e('0x31')]['length']?_0x39eb67['attributes']:_0x5b5c07[_0x933e('0x2d')];if(!_0x1e1419['query'][_0x933e('0x33')](_0x933e('0x34'))){_0x39eb67[_0x933e('0x1c')]=qs[_0x933e('0x1c')](_0x1e1419[_0x933e('0x2e')][_0x933e('0x1c')]);_0x39eb67['offset']=qs[_0x933e('0x1a')](_0x1e1419[_0x933e('0x2e')]['offset']);}_0x39eb67[_0x933e('0x35')]=qs[_0x933e('0x36')](_0x1e1419['query'][_0x933e('0x36')]);_0x39eb67[_0x933e('0x37')]=qs[_0x933e('0x38')](_[_0x933e('0x39')](_0x1e1419[_0x933e('0x2e')],_0x5b5c07['filters']),_0x28b036);if(_0x1e1419['query'][_0x933e('0x3a')]){_0x39eb67['where']=_[_0x933e('0x3b')](_0x39eb67['where'],{'$or':_[_0x933e('0x27')](_0x28b036,function(_0x40ef86){if(_0x40ef86[_0x933e('0x2b')]!==_0x933e('0x3c')){var _0xa87d47={};_0xa87d47[_0x40ef86[_0x933e('0x25')]]={'$like':'%'+_0x1e1419['query'][_0x933e('0x3a')]+'%'};return _0xa87d47;}})});}_0x39eb67=_[_0x933e('0x3b')]({},_0x39eb67,_0x1e1419['options']);var _0x1028c1={'where':_0x39eb67[_0x933e('0x37')]};return db[_0x933e('0x28')][_0x933e('0x1d')](_0x1028c1)[_0x933e('0x20')](function(_0x52f874){_0x22a2ab[_0x933e('0x1d')]=_0x52f874;if(_0x1e1419[_0x933e('0x2e')]['includeAll']){_0x39eb67[_0x933e('0x3d')]=[{'all':!![]}];}return db[_0x933e('0x28')][_0x933e('0x3e')](_0x39eb67);})['then'](function(_0x3f1b8a){_0x22a2ab['rows']=_0x3f1b8a;return _0x22a2ab;})['then'](respondWithFilteredResult(_0x35b8e3,_0x39eb67))['catch'](handleError(_0x35b8e3,null));};exports[_0x933e('0x3f')]=function(_0x21939d,_0x5532a7){var _0x3c83c4={'raw':!![],'where':{'id':_0x21939d[_0x933e('0x40')]['id']}},_0x1d5333={};_0x1d5333[_0x933e('0x2d')]=_[_0x933e('0x2f')](db['CmHopperHistory'][_0x933e('0x29')]);_0x1d5333[_0x933e('0x2e')]=_[_0x933e('0x2f')](_0x21939d[_0x933e('0x2e')]);_0x1d5333[_0x933e('0x38')]=_[_0x933e('0x30')](_0x1d5333[_0x933e('0x2d')],_0x1d5333[_0x933e('0x2e')]);_0x3c83c4[_0x933e('0x31')]=_[_0x933e('0x30')](_0x1d5333['model'],qs['fields'](_0x21939d['query'][_0x933e('0x32')]));_0x3c83c4[_0x933e('0x31')]=_0x3c83c4[_0x933e('0x31')][_0x933e('0x41')]?_0x3c83c4['attributes']:_0x1d5333[_0x933e('0x2d')];if(_0x21939d[_0x933e('0x2e')][_0x933e('0x42')]){_0x3c83c4[_0x933e('0x3d')]=[{'all':!![]}];}_0x3c83c4=_[_0x933e('0x3b')]({},_0x3c83c4,_0x21939d[_0x933e('0x43')]);return db['CmHopperHistory'][_0x933e('0x44')](_0x3c83c4)[_0x933e('0x20')](handleEntityNotFound(_0x5532a7,null))[_0x933e('0x20')](respondWithResult(_0x5532a7,null))['catch'](handleError(_0x5532a7,null));};exports[_0x933e('0x45')]=function(_0x9f50c,_0x29012e){return db[_0x933e('0x28')][_0x933e('0x45')](_0x9f50c[_0x933e('0x46')],{})[_0x933e('0x20')](respondWithResult(_0x29012e,0xc9))[_0x933e('0x47')](handleError(_0x29012e,null));};exports['describe']=function(_0x5c534f,_0x1b1e8a){return db[_0x933e('0x28')][_0x933e('0x48')]()[_0x933e('0x20')](respondWithResult(_0x1b1e8a,null))[_0x933e('0x47')](handleError(_0x1b1e8a,null));};exports[_0x933e('0x49')]=function(_0x2deac1,_0x41a69c){if(_0x2deac1[_0x933e('0x46')][_0x933e('0x4a')]){delete _0x2deac1['body'][_0x933e('0x4a')];}return db['CmHopperHistory'][_0x933e('0x44')]({'where':{'uniqueid':_0x2deac1[_0x933e('0x40')]['id']}})[_0x933e('0x20')](handleEntityNotFound(_0x41a69c,null))[_0x933e('0x20')](saveUpdates(_0x2deac1[_0x933e('0x46')],null))['then'](respondWithResult(_0x41a69c,null))[_0x933e('0x47')](handleError(_0x41a69c,null));}; \ No newline at end of file +var _0xc415=['limit','count','set','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','CmHopperHistory','intersection','find','create','body','describe','uniqueid','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x352d26,_0x4018e1){var _0x510584=function(_0x59d79b){while(--_0x59d79b){_0x352d26['push'](_0x352d26['shift']());}};_0x510584(++_0x4018e1);}(_0xc415,0x114));var _0x5c41=function(_0x57e574,_0x1f3866){_0x57e574=_0x57e574-0x0;var _0x40fe9e=_0xc415[_0x57e574];return _0x40fe9e;};'use strict';var emlformat=require(_0x5c41('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5c41('0x1'));var rp=require(_0x5c41('0x2'));var moment=require(_0x5c41('0x3'));var BPromise=require(_0x5c41('0x4'));var Mustache=require(_0x5c41('0x5'));var util=require(_0x5c41('0x6'));var path=require(_0x5c41('0x7'));var sox=require(_0x5c41('0x8'));var csv=require('to-csv');var ejs=require(_0x5c41('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c41('0xa'));var squel=require(_0x5c41('0xb'));var crypto=require(_0x5c41('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5c41('0xd'));var Papa=require(_0x5c41('0xe'));var Redis=require(_0x5c41('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5c41('0x10'));var as=require(_0x5c41('0x11'));var hardwareService=require(_0x5c41('0x12'));var logger=require('../../config/logger')(_0x5c41('0x13'));var utils=require(_0x5c41('0x14'));var config=require(_0x5c41('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c41('0x16'))['db'];function respondWithStatusCode(_0x4bc118,_0x5f24bb){_0x5f24bb=_0x5f24bb||0xcc;return function(_0x5b30fb){if(_0x5b30fb){return _0x4bc118[_0x5c41('0x17')](_0x5f24bb);}return _0x4bc118[_0x5c41('0x18')](_0x5f24bb)[_0x5c41('0x19')]();};}function respondWithResult(_0xfa4941,_0x27a0dd){_0x27a0dd=_0x27a0dd||0xc8;return function(_0x51ecb6){if(_0x51ecb6){return _0xfa4941[_0x5c41('0x18')](_0x27a0dd)[_0x5c41('0x1a')](_0x51ecb6);}};}function respondWithFilteredResult(_0x46de8a,_0x22de94){return function(_0x166639){if(_0x166639){var _0x257ab7=typeof _0x22de94[_0x5c41('0x1b')]==='undefined'&&typeof _0x22de94[_0x5c41('0x1c')]==='undefined';var _0x200e97=_0x166639['count'];var _0x490404=_0x257ab7?0x0:_0x22de94[_0x5c41('0x1b')];var _0xce8fe8=_0x257ab7?_0x166639[_0x5c41('0x1d')]:_0x22de94['offset']+_0x22de94[_0x5c41('0x1c')];var _0x3d94d7;if(_0xce8fe8>=_0x200e97){_0xce8fe8=_0x200e97;_0x3d94d7=0xc8;}else{_0x3d94d7=0xce;}_0x46de8a['status'](_0x3d94d7);return _0x46de8a[_0x5c41('0x1e')]('Content-Range',_0x490404+'-'+_0xce8fe8+'/'+_0x200e97)[_0x5c41('0x1a')](_0x166639);}return null;};}function patchUpdates(_0x1278d3){return function(_0xf09286){try{jsonpatch[_0x5c41('0x1f')](_0xf09286,_0x1278d3,!![]);}catch(_0x43d8d5){return BPromise['reject'](_0x43d8d5);}return _0xf09286[_0x5c41('0x20')]();};}function saveUpdates(_0x31f29,_0xd0f593){return function(_0x1f1b25){if(_0x1f1b25){return _0x1f1b25[_0x5c41('0x21')](_0x31f29)[_0x5c41('0x22')](function(_0x2af57e){return _0x2af57e;});}return null;};}function removeEntity(_0x451925,_0x35e188){return function(_0x2b990c){if(_0x2b990c){return _0x2b990c[_0x5c41('0x23')]()[_0x5c41('0x22')](function(){_0x451925['status'](0xcc)[_0x5c41('0x19')]();});}};}function handleEntityNotFound(_0xb915d1,_0x18f623){return function(_0x2e4608){if(!_0x2e4608){_0xb915d1[_0x5c41('0x17')](0x194);}return _0x2e4608;};}function handleError(_0xc0136b,_0x454853){_0x454853=_0x454853||0x1f4;return function(_0x3a4e6f){logger[_0x5c41('0x24')](_0x3a4e6f[_0x5c41('0x25')]);if(_0x3a4e6f['name']){delete _0x3a4e6f[_0x5c41('0x26')];}_0xc0136b['status'](_0x454853)[_0x5c41('0x27')](_0x3a4e6f);};}exports[_0x5c41('0x28')]=function(_0x148659,_0x43c4a1){var _0x5bd53c={},_0x82d45f={},_0x453a8e={'count':0x0,'rows':[]};var _0x52f99a=_[_0x5c41('0x29')](db['CmHopperHistory'][_0x5c41('0x2a')],function(_0x475ea8){return{'name':_0x475ea8[_0x5c41('0x2b')],'type':_0x475ea8['type'][_0x5c41('0x2c')]};});_0x82d45f['model']=_[_0x5c41('0x29')](_0x52f99a,_0x5c41('0x26'));_0x82d45f[_0x5c41('0x2d')]=_['keys'](_0x148659[_0x5c41('0x2d')]);_0x82d45f[_0x5c41('0x2e')]=_['intersection'](_0x82d45f[_0x5c41('0x2f')],_0x82d45f[_0x5c41('0x2d')]);_0x5bd53c['attributes']=_['intersection'](_0x82d45f[_0x5c41('0x2f')],qs[_0x5c41('0x30')](_0x148659['query'][_0x5c41('0x30')]));_0x5bd53c[_0x5c41('0x31')]=_0x5bd53c[_0x5c41('0x31')][_0x5c41('0x32')]?_0x5bd53c[_0x5c41('0x31')]:_0x82d45f[_0x5c41('0x2f')];if(!_0x148659[_0x5c41('0x2d')][_0x5c41('0x33')](_0x5c41('0x34'))){_0x5bd53c[_0x5c41('0x1c')]=qs[_0x5c41('0x1c')](_0x148659[_0x5c41('0x2d')][_0x5c41('0x1c')]);_0x5bd53c[_0x5c41('0x1b')]=qs['offset'](_0x148659[_0x5c41('0x2d')][_0x5c41('0x1b')]);}_0x5bd53c[_0x5c41('0x35')]=qs[_0x5c41('0x36')](_0x148659[_0x5c41('0x2d')][_0x5c41('0x36')]);_0x5bd53c['where']=qs[_0x5c41('0x2e')](_[_0x5c41('0x37')](_0x148659['query'],_0x82d45f[_0x5c41('0x2e')]),_0x52f99a);if(_0x148659[_0x5c41('0x2d')][_0x5c41('0x38')]){_0x5bd53c[_0x5c41('0x39')]=_[_0x5c41('0x3a')](_0x5bd53c[_0x5c41('0x39')],{'$or':_[_0x5c41('0x29')](_0x52f99a,function(_0x52d833){if(_0x52d833[_0x5c41('0x3b')]!==_0x5c41('0x3c')){var _0x48defa={};_0x48defa[_0x52d833[_0x5c41('0x26')]]={'$like':'%'+_0x148659[_0x5c41('0x2d')][_0x5c41('0x38')]+'%'};return _0x48defa;}})});}_0x5bd53c=_[_0x5c41('0x3a')]({},_0x5bd53c,_0x148659[_0x5c41('0x3d')]);var _0x1c2906={'where':_0x5bd53c[_0x5c41('0x39')]};return db['CmHopperHistory'][_0x5c41('0x1d')](_0x1c2906)[_0x5c41('0x22')](function(_0x271646){_0x453a8e[_0x5c41('0x1d')]=_0x271646;if(_0x148659[_0x5c41('0x2d')][_0x5c41('0x3e')]){_0x5bd53c['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x5c41('0x3f')](_0x5bd53c);})[_0x5c41('0x22')](function(_0x3c0a9c){_0x453a8e[_0x5c41('0x40')]=_0x3c0a9c;return _0x453a8e;})[_0x5c41('0x22')](respondWithFilteredResult(_0x43c4a1,_0x5bd53c))[_0x5c41('0x41')](handleError(_0x43c4a1,null));};exports[_0x5c41('0x42')]=function(_0x2751a3,_0x4f1678){var _0xc575e9={'raw':!![],'where':{'id':_0x2751a3[_0x5c41('0x43')]['id']}},_0x3a36ec={};_0x3a36ec[_0x5c41('0x2f')]=_[_0x5c41('0x44')](db[_0x5c41('0x45')][_0x5c41('0x2a')]);_0x3a36ec[_0x5c41('0x2d')]=_[_0x5c41('0x44')](_0x2751a3['query']);_0x3a36ec['filters']=_[_0x5c41('0x46')](_0x3a36ec[_0x5c41('0x2f')],_0x3a36ec[_0x5c41('0x2d')]);_0xc575e9['attributes']=_[_0x5c41('0x46')](_0x3a36ec[_0x5c41('0x2f')],qs['fields'](_0x2751a3[_0x5c41('0x2d')][_0x5c41('0x30')]));_0xc575e9[_0x5c41('0x31')]=_0xc575e9[_0x5c41('0x31')][_0x5c41('0x32')]?_0xc575e9[_0x5c41('0x31')]:_0x3a36ec[_0x5c41('0x2f')];if(_0x2751a3[_0x5c41('0x2d')][_0x5c41('0x3e')]){_0xc575e9['include']=[{'all':!![]}];}_0xc575e9=_[_0x5c41('0x3a')]({},_0xc575e9,_0x2751a3[_0x5c41('0x3d')]);return db[_0x5c41('0x45')][_0x5c41('0x47')](_0xc575e9)[_0x5c41('0x22')](handleEntityNotFound(_0x4f1678,null))['then'](respondWithResult(_0x4f1678,null))[_0x5c41('0x41')](handleError(_0x4f1678,null));};exports[_0x5c41('0x48')]=function(_0x2efdd2,_0x41f199){return db[_0x5c41('0x45')][_0x5c41('0x48')](_0x2efdd2[_0x5c41('0x49')],{})[_0x5c41('0x22')](respondWithResult(_0x41f199,0xc9))[_0x5c41('0x41')](handleError(_0x41f199,null));};exports[_0x5c41('0x4a')]=function(_0x505c6d,_0x19383c){return db[_0x5c41('0x45')][_0x5c41('0x4a')]()['then'](respondWithResult(_0x19383c,null))[_0x5c41('0x41')](handleError(_0x19383c,null));};exports[_0x5c41('0x21')]=function(_0x37d5c8,_0x152d59){if(_0x37d5c8['body'][_0x5c41('0x4b')]){delete _0x37d5c8[_0x5c41('0x49')][_0x5c41('0x4b')];}return db[_0x5c41('0x45')]['find']({'where':{'uniqueid':_0x37d5c8[_0x5c41('0x43')]['id']}})[_0x5c41('0x22')](handleEntityNotFound(_0x152d59,null))[_0x5c41('0x22')](saveUpdates(_0x37d5c8[_0x5c41('0x49')],null))[_0x5c41('0x22')](respondWithResult(_0x152d59,null))[_0x5c41('0x41')](handleError(_0x152d59,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 3ea64e9..9b29ea3 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.model.js +++ b/server/api/cmHopperHistory/cmHopperHistory.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf08c=['util','../../config/logger','moment','bluebird','request-promise','path','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','uniqueid','lodash'];(function(_0x590cd0,_0x11bfd4){var _0x208eb0=function(_0x19d96f){while(--_0x19d96f){_0x590cd0['push'](_0x590cd0['shift']());}};_0x208eb0(++_0x11bfd4);}(_0xf08c,0xb5));var _0xcf08=function(_0x236d75,_0x385938){_0x236d75=_0x236d75-0x0;var _0x3d283f=_0xf08c[_0x236d75];return _0x3d283f;};'use strict';var _=require(_0xcf08('0x0'));var util=require(_0xcf08('0x1'));var logger=require(_0xcf08('0x2'))('api');var moment=require(_0xcf08('0x3'));var BPromise=require(_0xcf08('0x4'));var rp=require(_0xcf08('0x5'));var fs=require('fs');var path=require(_0xcf08('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcf08('0x7'));module[_0xcf08('0x8')]=function(_0x5f1020,_0x346b93){return _0x5f1020[_0xcf08('0x9')](_0xcf08('0xa'),attributes,{'tableName':_0xcf08('0xb'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0xcf08('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcdd2=['exports','define','CmHopperHistory','cm_hopper_history','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmHopperHistory.attributes'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0xcdd2,0x83));var _0x2cdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdd2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2cdd('0x0'));var util=require(_0x2cdd('0x1'));var logger=require(_0x2cdd('0x2'))(_0x2cdd('0x3'));var moment=require('moment');var BPromise=require(_0x2cdd('0x4'));var rp=require(_0x2cdd('0x5'));var fs=require('fs');var path=require(_0x2cdd('0x6'));var rimraf=require(_0x2cdd('0x7'));var config=require('../../config/environment');var attributes=require(_0x2cdd('0x8'));module[_0x2cdd('0x9')]=function(_0x5f3b53,_0x1cc1ac){return _0x5f3b53[_0x2cdd('0xa')](_0x2cdd('0xb'),attributes,{'tableName':_0x2cdd('0xc'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':'uniqueid','fields':[_0x2cdd('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 957d45e..dac993f 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.rpc.js +++ b/server/api/cmHopperHistory/cmHopperHistory.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3ee=['outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','ivrTotalCallsDays','moment','bluebird','../../mysqldb','rpc','jayson/promise','client','http','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CmHopperHistory','body','options','raw','CreateCmHopperHistory','debug','findAll','where','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','COUNT','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null'];(function(_0x347d28,_0x52b1d7){var _0x548d40=function(_0x5a602b){while(--_0x5a602b){_0x347d28['push'](_0x347d28['shift']());}};_0x548d40(++_0x52b1d7);}(_0xe3ee,0x116));var _0xee3e=function(_0x21c7c2,_0xd7aab2){_0x21c7c2=_0x21c7c2-0x0;var _0x1bde73=_0xe3ee[_0x21c7c2];return _0x1bde73;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xee3e('0x0'));var BPromise=require(_0xee3e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee3e('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xee3e('0x3'));var config=require('../../config/environment');var jayson=require(_0xee3e('0x4'));var client=jayson[_0xee3e('0x5')][_0xee3e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xd893ca,_0x42d135,_0x39a770){return new BPromise(function(_0x43ab67,_0x17fba1){return client['request'](_0xd893ca,_0x39a770)[_0xee3e('0x7')](function(_0x2f6153){logger['info'](_0xee3e('0x8'),_0x42d135,_0xee3e('0x9'));logger['debug'](_0xee3e('0xa'),_0x42d135,_0xee3e('0x9'),JSON[_0xee3e('0xb')](_0x2f6153));if(_0x2f6153[_0xee3e('0xc')]){if(_0x2f6153[_0xee3e('0xc')][_0xee3e('0xd')]===0x1f4){logger[_0xee3e('0xc')](_0xee3e('0x8'),_0x42d135,_0x2f6153['error']['message']);return _0x17fba1(_0x2f6153[_0xee3e('0xc')][_0xee3e('0xe')]);}logger['error'](_0xee3e('0x8'),_0x42d135,_0x2f6153[_0xee3e('0xc')][_0xee3e('0xe')]);return _0x43ab67(_0x2f6153['error'][_0xee3e('0xe')]);}else{logger[_0xee3e('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x42d135,'request\x20sent');_0x43ab67(_0x2f6153[_0xee3e('0x10')][_0xee3e('0xe')]);}})[_0xee3e('0x11')](function(_0x512609){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x42d135,_0x512609);_0x17fba1(_0x512609);});});}exports['CreateCmHopperHistory']=function(_0x2589c0){var _0x23cd1f=this;return new Promise(function(_0x372605,_0x253530){return db[_0xee3e('0x12')]['create'](_0x2589c0[_0xee3e('0x13')],{'raw':_0x2589c0[_0xee3e('0x14')]?_0x2589c0[_0xee3e('0x14')][_0xee3e('0x15')]===undefined?!![]:![]:!![]})[_0xee3e('0x7')](function(_0x3b6d40){logger['info'](_0xee3e('0x16'),_0x2589c0);logger[_0xee3e('0x17')](_0xee3e('0x16'),_0x2589c0,JSON[_0xee3e('0xb')](_0x3b6d40));_0x372605(_0x3b6d40);})[_0xee3e('0x11')](function(_0xfbf279){logger[_0xee3e('0xc')](_0xee3e('0x16'),_0xfbf279[_0xee3e('0xe')],_0x2589c0);_0x253530(_0x23cd1f[_0xee3e('0xc')](0x1f4,_0xfbf279['message']));});});};exports['AvgHandleTime']=function(_0x4b0d94){var _0x4aaf22=this;return new Promise(function(_0x24891a,_0xc1a5af){return db['CmHopperHistory'][_0xee3e('0x18')]({'raw':_0x4b0d94[_0xee3e('0x14')]?_0x4b0d94[_0xee3e('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x4b0d94[_0xee3e('0x14')]?_0x4b0d94[_0xee3e('0x14')][_0xee3e('0x19')]||null:null,'attributes':[[db[_0xee3e('0x1a')]['fn']('COUNT',db['sequelize'][_0xee3e('0x1b')]('id')),_0xee3e('0x1c')],[db[_0xee3e('0x1a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xee3e('0x1a')][_0xee3e('0x1d')](_0xee3e('0x1e')))),_0xee3e('0x1f')],[db[_0xee3e('0x1a')]['fn'](_0xee3e('0x20'),db[_0xee3e('0x1a')]['fn']('IF',db['sequelize']['literal'](_0xee3e('0x21')))),_0xee3e('0x22')],[db['sequelize']['fn'](_0xee3e('0x20'),db['sequelize']['fn']('IF',db[_0xee3e('0x1a')][_0xee3e('0x1d')](_0xee3e('0x23')))),_0xee3e('0x24')],[db['sequelize']['fn'](_0xee3e('0x25'),db[_0xee3e('0x1a')]['fn']('IF',db[_0xee3e('0x1a')][_0xee3e('0x1d')](_0xee3e('0x26')))),_0xee3e('0x27')],[db[_0xee3e('0x1a')]['fn'](_0xee3e('0x25'),db[_0xee3e('0x1a')]['fn']('IF',db['sequelize'][_0xee3e('0x1d')](_0xee3e('0x28')))),_0xee3e('0x29')]]})[_0xee3e('0x7')](function(_0x2f710f){logger[_0xee3e('0xf')](_0xee3e('0x2a'),_0x4b0d94);logger[_0xee3e('0x17')](_0xee3e('0x2a'),_0x4b0d94,JSON[_0xee3e('0xb')](_0x2f710f));_0x24891a(_0x2f710f);})[_0xee3e('0x11')](function(_0x47fc95){logger[_0xee3e('0xc')](_0xee3e('0x2a'),_0x47fc95['message'],_0x4b0d94);_0xc1a5af(_0x4aaf22[_0xee3e('0xc')](0x1f4,_0x47fc95[_0xee3e('0xe')]));});});};exports[_0xee3e('0x2b')]=function(_0x214d7b){var _0x488b6c=this;return new Promise(function(_0x3e2b0a,_0xc77b){return db[_0xee3e('0x12')][_0xee3e('0x18')]({'raw':_0x214d7b[_0xee3e('0x14')]?_0x214d7b[_0xee3e('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x214d7b[_0xee3e('0x14')]?_0x214d7b['options'][_0xee3e('0x19')]||null:null,'attributes':[[_0xee3e('0x2c'),'name'],[db['sequelize']['fn'](_0xee3e('0x20'),db[_0xee3e('0x1a')]['fn']('IF',db[_0xee3e('0x1a')]['literal'](_0xee3e('0x2d')))),'outboundNoSuchCallsDay'],[db[_0xee3e('0x1a')]['fn'](_0xee3e('0x20'),db['sequelize']['fn']('IF',db[_0xee3e('0x1a')][_0xee3e('0x1d')](_0xee3e('0x2e')))),'outboundNoAnswerCallsDay'],[db[_0xee3e('0x1a')]['fn'](_0xee3e('0x20'),db['sequelize']['fn']('IF',db[_0xee3e('0x1a')][_0xee3e('0x1d')](_0xee3e('0x1e')))),_0xee3e('0x2f')],[db[_0xee3e('0x1a')]['fn'](_0xee3e('0x20'),db[_0xee3e('0x1a')]['fn']('IF',db['sequelize'][_0xee3e('0x1d')](_0xee3e('0x30')))),_0xee3e('0x31')],[db['sequelize']['fn'](_0xee3e('0x20'),db[_0xee3e('0x1a')]['fn']('IF',db[_0xee3e('0x1a')][_0xee3e('0x1d')](_0xee3e('0x32')))),_0xee3e('0x33')],[db['sequelize']['fn'](_0xee3e('0x20'),db['sequelize']['fn']('IF',db[_0xee3e('0x1a')][_0xee3e('0x1d')](_0xee3e('0x34')))),_0xee3e('0x35')],[db[_0xee3e('0x1a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xee3e('0x1d')](_0xee3e('0x36')))),_0xee3e('0x37')],[db[_0xee3e('0x1a')]['fn']('COUNT',db[_0xee3e('0x1a')]['fn']('IF',db['sequelize'][_0xee3e('0x1d')](_0xee3e('0x38')))),_0xee3e('0x39')],[db[_0xee3e('0x1a')]['fn'](_0xee3e('0x20'),db[_0xee3e('0x1a')]['fn']('IF',db[_0xee3e('0x1a')]['literal'](_0xee3e('0x3a')))),_0xee3e('0x3b')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xee3e('0x1d')]('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db[_0xee3e('0x1a')]['fn'](_0xee3e('0x20'),db[_0xee3e('0x1a')]['fn']('IF',db[_0xee3e('0x1a')][_0xee3e('0x1d')](_0xee3e('0x3c')))),'outboundRejectCallsDay'],[db[_0xee3e('0x1a')]['fn'](_0xee3e('0x20'),db[_0xee3e('0x1a')]['fn']('IF',db[_0xee3e('0x1a')][_0xee3e('0x1d')]('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db[_0xee3e('0x1a')]['fn'](_0xee3e('0x20'),db[_0xee3e('0x1a')]['fn']('IF',db[_0xee3e('0x1a')][_0xee3e('0x1d')](_0xee3e('0x3d')))),_0xee3e('0x3e')],[db[_0xee3e('0x1a')]['fn'](_0xee3e('0x20'),db[_0xee3e('0x1a')]['fn']('IF',db[_0xee3e('0x1a')]['literal'](_0xee3e('0x3f')))),_0xee3e('0x40')]],'group':[_0xee3e('0x2c')]})['then'](function(_0x2f1602){logger[_0xee3e('0xf')](_0xee3e('0x2b'),_0x214d7b);logger[_0xee3e('0x17')](_0xee3e('0x2b'),_0x214d7b,JSON[_0xee3e('0xb')](_0x2f1602));_0x3e2b0a(_0x2f1602);})[_0xee3e('0x11')](function(_0x11827d){logger[_0xee3e('0xc')](_0xee3e('0x2b'),_0x11827d[_0xee3e('0xe')],_0x214d7b);_0xc77b(_0x488b6c[_0xee3e('0xc')](0x1f4,_0x11827d[_0xee3e('0xe')]));});});};exports[_0xee3e('0x41')]=function(_0x53e8ee){var _0x56b41e=this;return new Promise(function(_0x4c4cd0,_0x7b1520){return db[_0xee3e('0x12')]['findAll']({'raw':_0x53e8ee['options']?_0x53e8ee[_0xee3e('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x53e8ee[_0xee3e('0x14')]?_0x53e8ee[_0xee3e('0x14')][_0xee3e('0x19')]||null:null,'attributes':[['campaign',_0xee3e('0x42')],[db[_0xee3e('0x1a')]['fn'](_0xee3e('0x20'),db['sequelize']['col']('id')),_0xee3e('0x43')],[db[_0xee3e('0x1a')]['fn'](_0xee3e('0x20'),db[_0xee3e('0x1a')]['fn']('IF',db[_0xee3e('0x1a')][_0xee3e('0x1d')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0xee3e('0x2c')]})['then'](function(_0xfb06e1){logger['info']('GetCampaignHopperHistory',_0x53e8ee);logger[_0xee3e('0x17')]('GetCampaignHopperHistory',_0x53e8ee,JSON['stringify'](_0xfb06e1));_0x4c4cd0(_0xfb06e1);})['catch'](function(_0x209798){logger[_0xee3e('0xc')](_0xee3e('0x41'),_0x209798[_0xee3e('0xe')],_0x53e8ee);_0x7b1520(_0x56b41e[_0xee3e('0xc')](0x1f4,_0x209798[_0xee3e('0xe')]));});});}; \ No newline at end of file +var _0x6324=['client','http','then','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','info','result','catch','CreateCmHopperHistory','body','options','raw','AvgHandleTime','CmHopperHistory','findAll','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','col','ivrTotalCallsDays','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6324,0x142));var _0x4632=function(_0xa9430,_0x14f536){_0xa9430=_0xa9430-0x0;var _0x220b68=_0x6324[_0xa9430];return _0x220b68;};'use strict';var _=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var moment=require(_0x4632('0x2'));var BPromise=require(_0x4632('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4632('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4632('0x5'));var logger=require('../../config/logger')(_0x4632('0x6'));var config=require('../../config/environment');var jayson=require(_0x4632('0x7'));var client=jayson[_0x4632('0x8')][_0x4632('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x126e9a,_0x4a15b2,_0x17e860){return new BPromise(function(_0x44dd6d,_0x390a46){return client['request'](_0x126e9a,_0x17e860)[_0x4632('0xa')](function(_0x47824c){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x4a15b2,_0x4632('0xb'));logger[_0x4632('0xc')](_0x4632('0xd'),_0x4a15b2,_0x4632('0xb'),JSON[_0x4632('0xe')](_0x47824c));if(_0x47824c[_0x4632('0xf')]){if(_0x47824c[_0x4632('0xf')][_0x4632('0x10')]===0x1f4){logger['error'](_0x4632('0x11'),_0x4a15b2,_0x47824c['error'][_0x4632('0x12')]);return _0x390a46(_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);}logger[_0x4632('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x4a15b2,_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);return _0x44dd6d(_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);}else{logger[_0x4632('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x4a15b2,'request\x20sent');_0x44dd6d(_0x47824c[_0x4632('0x14')][_0x4632('0x12')]);}})[_0x4632('0x15')](function(_0x125eb9){logger['error'](_0x4632('0x11'),_0x4a15b2,_0x125eb9);_0x390a46(_0x125eb9);});});}exports[_0x4632('0x16')]=function(_0x1a94c0){var _0x5b28b7=this;return new Promise(function(_0x3cddfa,_0x1894bb){return db['CmHopperHistory']['create'](_0x1a94c0[_0x4632('0x17')],{'raw':_0x1a94c0[_0x4632('0x18')]?_0x1a94c0[_0x4632('0x18')][_0x4632('0x19')]===undefined?!![]:![]:!![]})[_0x4632('0xa')](function(_0x3d2d23){logger[_0x4632('0x13')](_0x4632('0x16'),_0x1a94c0);logger[_0x4632('0xc')](_0x4632('0x16'),_0x1a94c0,JSON[_0x4632('0xe')](_0x3d2d23));_0x3cddfa(_0x3d2d23);})[_0x4632('0x15')](function(_0x2ca6a5){logger[_0x4632('0xf')](_0x4632('0x16'),_0x2ca6a5[_0x4632('0x12')],_0x1a94c0);_0x1894bb(_0x5b28b7[_0x4632('0xf')](0x1f4,_0x2ca6a5[_0x4632('0x12')]));});});};exports[_0x4632('0x1a')]=function(_0x1e1b86){var _0x38cbbc=this;return new Promise(function(_0x4455ef,_0x3b0823){return db[_0x4632('0x1b')][_0x4632('0x1c')]({'raw':_0x1e1b86[_0x4632('0x18')]?_0x1e1b86[_0x4632('0x18')][_0x4632('0x19')]===undefined?!![]:![]:!![],'where':_0x1e1b86[_0x4632('0x18')]?_0x1e1b86[_0x4632('0x18')][_0x4632('0x1d')]||null:null,'attributes':[[db[_0x4632('0x1e')]['fn'](_0x4632('0x1f'),db['sequelize']['col']('id')),_0x4632('0x20')],[db[_0x4632('0x1e')]['fn'](_0x4632('0x1f'),db[_0x4632('0x1e')]['fn']('IF',db[_0x4632('0x1e')][_0x4632('0x21')](_0x4632('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0x4632('0x1e')]['fn'](_0x4632('0x1f'),db['sequelize']['fn']('IF',db[_0x4632('0x1e')]['literal'](_0x4632('0x23')))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0x4632('0x1f'),db[_0x4632('0x1e')]['fn']('IF',db[_0x4632('0x1e')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0x4632('0x24')],[db[_0x4632('0x1e')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x4632('0x1e')][_0x4632('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x4632('0x25')],[db[_0x4632('0x1e')]['fn'](_0x4632('0x26'),db[_0x4632('0x1e')]['fn']('IF',db[_0x4632('0x1e')]['literal'](_0x4632('0x27')))),_0x4632('0x28')]]})['then'](function(_0x5f4f24){logger[_0x4632('0x13')]('AvgHandleTime',_0x1e1b86);logger['debug'](_0x4632('0x1a'),_0x1e1b86,JSON['stringify'](_0x5f4f24));_0x4455ef(_0x5f4f24);})[_0x4632('0x15')](function(_0x468735){logger[_0x4632('0xf')]('AvgHandleTime',_0x468735[_0x4632('0x12')],_0x1e1b86);_0x3b0823(_0x38cbbc[_0x4632('0xf')](0x1f4,_0x468735[_0x4632('0x12')]));});});};exports[_0x4632('0x29')]=function(_0x37c4d0){var _0x5d20f9=this;return new Promise(function(_0x486f6c,_0x3114c4){return db[_0x4632('0x1b')][_0x4632('0x1c')]({'raw':_0x37c4d0['options']?_0x37c4d0['options']['raw']===undefined?!![]:![]:!![],'where':_0x37c4d0[_0x4632('0x18')]?_0x37c4d0[_0x4632('0x18')]['where']||null:null,'attributes':[[_0x4632('0x2a'),_0x4632('0x2b')],[db[_0x4632('0x1e')]['fn'](_0x4632('0x1f'),db[_0x4632('0x1e')]['fn']('IF',db[_0x4632('0x1e')][_0x4632('0x21')](_0x4632('0x2c')))),_0x4632('0x2d')],[db[_0x4632('0x1e')]['fn'](_0x4632('0x1f'),db[_0x4632('0x1e')]['fn']('IF',db['sequelize'][_0x4632('0x21')](_0x4632('0x2e')))),'outboundNoAnswerCallsDay'],[db[_0x4632('0x1e')]['fn'](_0x4632('0x1f'),db['sequelize']['fn']('IF',db[_0x4632('0x1e')]['literal'](_0x4632('0x22')))),_0x4632('0x2f')],[db[_0x4632('0x1e')]['fn'](_0x4632('0x1f'),db['sequelize']['fn']('IF',db[_0x4632('0x1e')][_0x4632('0x21')](_0x4632('0x30')))),_0x4632('0x31')],[db['sequelize']['fn']('COUNT',db[_0x4632('0x1e')]['fn']('IF',db[_0x4632('0x1e')][_0x4632('0x21')]('`state`\x20=\x208,\x201,\x20null'))),_0x4632('0x32')],[db[_0x4632('0x1e')]['fn'](_0x4632('0x1f'),db[_0x4632('0x1e')]['fn']('IF',db[_0x4632('0x1e')][_0x4632('0x21')](_0x4632('0x33')))),'outboundDropCallsDayTimeout'],[db[_0x4632('0x1e')]['fn'](_0x4632('0x1f'),db[_0x4632('0x1e')]['fn']('IF',db[_0x4632('0x1e')][_0x4632('0x21')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0x4632('0x1e')]['fn'](_0x4632('0x1f'),db[_0x4632('0x1e')]['fn']('IF',db[_0x4632('0x1e')]['literal'](_0x4632('0x34')))),_0x4632('0x35')],[db[_0x4632('0x1e')]['fn'](_0x4632('0x1f'),db[_0x4632('0x1e')]['fn']('IF',db['sequelize'][_0x4632('0x21')](_0x4632('0x36')))),_0x4632('0x37')],[db[_0x4632('0x1e')]['fn'](_0x4632('0x1f'),db[_0x4632('0x1e')]['fn']('IF',db[_0x4632('0x1e')][_0x4632('0x21')](_0x4632('0x38')))),_0x4632('0x39')],[db[_0x4632('0x1e')]['fn']('COUNT',db[_0x4632('0x1e')]['fn']('IF',db[_0x4632('0x1e')][_0x4632('0x21')]('`state`\x20=\x2018,\x201,\x20null'))),_0x4632('0x3a')],[db[_0x4632('0x1e')]['fn'](_0x4632('0x1f'),db[_0x4632('0x1e')]['fn']('IF',db[_0x4632('0x1e')][_0x4632('0x21')](_0x4632('0x3b')))),_0x4632('0x3c')],[db[_0x4632('0x1e')]['fn'](_0x4632('0x1f'),db['sequelize']['fn']('IF',db[_0x4632('0x1e')][_0x4632('0x21')]('`state`\x20=\x2020,\x201,\x20null'))),_0x4632('0x3a')],[db[_0x4632('0x1e')]['fn'](_0x4632('0x1f'),db[_0x4632('0x1e')]['fn']('IF',db[_0x4632('0x1e')][_0x4632('0x21')](_0x4632('0x3d')))),_0x4632('0x3e')]],'group':[_0x4632('0x2a')]})[_0x4632('0xa')](function(_0x3e66d8){logger[_0x4632('0x13')](_0x4632('0x29'),_0x37c4d0);logger[_0x4632('0xc')](_0x4632('0x29'),_0x37c4d0,JSON[_0x4632('0xe')](_0x3e66d8));_0x486f6c(_0x3e66d8);})[_0x4632('0x15')](function(_0x6c2864){logger[_0x4632('0xf')](_0x4632('0x29'),_0x6c2864['message'],_0x37c4d0);_0x3114c4(_0x5d20f9[_0x4632('0xf')](0x1f4,_0x6c2864[_0x4632('0x12')]));});});};exports[_0x4632('0x3f')]=function(_0x150bfa){var _0x2e2353=this;return new Promise(function(_0x33ad25,_0x5d2cbb){return db[_0x4632('0x1b')][_0x4632('0x1c')]({'raw':_0x150bfa[_0x4632('0x18')]?_0x150bfa['options'][_0x4632('0x19')]===undefined?!![]:![]:!![],'where':_0x150bfa[_0x4632('0x18')]?_0x150bfa['options'][_0x4632('0x1d')]||null:null,'attributes':[[_0x4632('0x2a'),_0x4632('0x2b')],[db['sequelize']['fn'](_0x4632('0x1f'),db[_0x4632('0x1e')][_0x4632('0x40')]('id')),_0x4632('0x41')],[db[_0x4632('0x1e')]['fn'](_0x4632('0x1f'),db[_0x4632('0x1e')]['fn']('IF',db[_0x4632('0x1e')][_0x4632('0x21')](_0x4632('0x22')))),'ivrAnswerCallsDay']],'group':[_0x4632('0x2a')]})[_0x4632('0xa')](function(_0x556bec){logger[_0x4632('0x13')]('GetCampaignHopperHistory',_0x150bfa);logger['debug'](_0x4632('0x3f'),_0x150bfa,JSON[_0x4632('0xe')](_0x556bec));_0x33ad25(_0x556bec);})[_0x4632('0x15')](function(_0xd89124){logger[_0x4632('0xf')](_0x4632('0x3f'),_0xd89124[_0x4632('0x12')],_0x150bfa);_0x5d2cbb(_0x2e2353[_0x4632('0xf')](0x1f4,_0xd89124[_0x4632('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index c1d97cd..e1edfd8 100644 --- a/server/api/cmHopperHistory/index.js +++ b/server/api/cmHopperHistory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab07=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','index','get','/describe','describe','/:id','isAuthenticated','show','post','create','put','exports','multer','util','path'];(function(_0x466247,_0x5d69e3){var _0x4b352e=function(_0x58c71b){while(--_0x58c71b){_0x466247['push'](_0x466247['shift']());}};_0x4b352e(++_0x5d69e3);}(_0xab07,0xed));var _0x7ab0=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0xab07[_0x37b7b6];return _0x10c4c3;};'use strict';var multer=require(_0x7ab0('0x0'));var util=require(_0x7ab0('0x1'));var path=require(_0x7ab0('0x2'));var timeout=require(_0x7ab0('0x3'));var express=require(_0x7ab0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7ab0('0x5'));var interaction=require(_0x7ab0('0x6'));var config=require(_0x7ab0('0x7'));var controller=require(_0x7ab0('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7ab0('0x9')]);router[_0x7ab0('0xa')](_0x7ab0('0xb'),auth['isAuthenticated'](),controller[_0x7ab0('0xc')]);router[_0x7ab0('0xa')](_0x7ab0('0xd'),auth[_0x7ab0('0xe')](),controller[_0x7ab0('0xf')]);router[_0x7ab0('0x10')]('/',auth['isAuthenticated'](),controller[_0x7ab0('0x11')]);router[_0x7ab0('0x12')](_0x7ab0('0xd'),auth[_0x7ab0('0xe')](),controller['update']);module[_0x7ab0('0x13')]=router; \ No newline at end of file +var _0xcf29=['exports','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','show','post','create','/:id','update'];(function(_0x59472a,_0x53356c){var _0x3d060f=function(_0x3e6283){while(--_0x3e6283){_0x59472a['push'](_0x59472a['shift']());}};_0x3d060f(++_0x53356c);}(_0xcf29,0xb5));var _0x9cf2=function(_0x3457b4,_0x4cd8f9){_0x3457b4=_0x3457b4-0x0;var _0xaa8fa9=_0xcf29[_0x3457b4];return _0xaa8fa9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9cf2('0x0'));var express=require(_0x9cf2('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9cf2('0x2'));var config=require(_0x9cf2('0x3'));var controller=require(_0x9cf2('0x4'));router['get']('/',auth[_0x9cf2('0x5')](),controller[_0x9cf2('0x6')]);router[_0x9cf2('0x7')](_0x9cf2('0x8'),auth[_0x9cf2('0x5')](),controller['describe']);router[_0x9cf2('0x7')]('/:id',auth[_0x9cf2('0x5')](),controller[_0x9cf2('0x9')]);router[_0x9cf2('0xa')]('/',auth[_0x9cf2('0x5')](),controller[_0x9cf2('0xb')]);router['put'](_0x9cf2('0xc'),auth['isAuthenticated'](),controller[_0x9cf2('0xd')]);module[_0x9cf2('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index b3b469d..b198585 100644 --- a/server/api/cmList/cmList.attributes.js +++ b/server/api/cmList/cmList.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc02d=['exports','STRING','name'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xc02d,0x1aa));var _0xdc02=function(_0x3c5f88,_0xa4304f){_0x3c5f88=_0x3c5f88-0x0;var _0x4f412d=_0xc02d[_0x3c5f88];return _0x4f412d;};'use strict';var Sequelize=require('sequelize');module[_0xdc02('0x0')]={'name':{'type':Sequelize[_0xdc02('0x1')],'unique':_0xdc02('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdc02('0x1')]},'dialPrefix':{'type':Sequelize[_0xdc02('0x1')]}}; \ No newline at end of file +var _0x80d9=['sequelize','STRING','name'];(function(_0x53c644,_0x57539f){var _0x4f9e8f=function(_0x104479){while(--_0x104479){_0x53c644['push'](_0x53c644['shift']());}};_0x4f9e8f(++_0x57539f);}(_0x80d9,0x15c));var _0x980d=function(_0x44a60d,_0x522f3b){_0x44a60d=_0x44a60d-0x0;var _0xb05616=_0x80d9[_0x44a60d];return _0xb05616;};'use strict';var Sequelize=require(_0x980d('0x0'));module['exports']={'name':{'type':Sequelize[_0x980d('0x1')],'unique':_0x980d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x980d('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 4e9ca57..66d68d9 100644 --- a/server/api/cmList/cmList.controller.js +++ b/server/api/cmList/cmList.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5834=['INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./cmList.socket','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','Lists','UserProfileResource','end','error','stack','name','index','map','CmList','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','length','find','catch','create','body','role','user','userProfileId','params','describe','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','CmContact','tags','isArray','join','ListId','push','each','omit','success','dataValues','errors','message','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','select','from','c.deletedAt\x20is\x20null','field','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','description','description_additionalPhone_','toString','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','TEXT','text','number'];(function(_0x48141e,_0x5130be){var _0x2c06bd=function(_0x46f61c){while(--_0x46f61c){_0x48141e['push'](_0x48141e['shift']());}};_0x2c06bd(++_0x5130be);}(_0x5834,0x157));var _0x4583=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5834[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x4583('0x0'));var rimraf=require(_0x4583('0x1'));var zipdir=require(_0x4583('0x2'));var jsonpatch=require(_0x4583('0x3'));var rp=require(_0x4583('0x4'));var moment=require(_0x4583('0x5'));var BPromise=require(_0x4583('0x6'));var Mustache=require('mustache');var util=require(_0x4583('0x7'));var path=require(_0x4583('0x8'));var sox=require(_0x4583('0x9'));var csv=require(_0x4583('0xa'));var ejs=require(_0x4583('0xb'));var fs=require('fs');var fs_extra=require(_0x4583('0xc'));var _=require(_0x4583('0xd'));var squel=require(_0x4583('0xe'));var crypto=require(_0x4583('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4583('0xa'));var querystring=require(_0x4583('0x10'));var Papa=require(_0x4583('0x11'));var Redis=require(_0x4583('0x12'));var authService=require(_0x4583('0x13'));var qs=require(_0x4583('0x14'));var as=require(_0x4583('0x15'));var hardwareService=require(_0x4583('0x16'));var logger=require(_0x4583('0x17'))('api');var utils=require(_0x4583('0x18'));var config=require(_0x4583('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x4583('0x1a'))['db'];var csv_results;config['redis']=_['defaults'](config[_0x4583('0x1b')],{'host':_0x4583('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4583('0x1b')]));require(_0x4583('0x1d'))[_0x4583('0x1e')](socket);function respondWithStatusCode(_0x33f134,_0x24a8c3){_0x24a8c3=_0x24a8c3||0xcc;return function(_0x3ea024){if(_0x3ea024){return _0x33f134[_0x4583('0x1f')](_0x24a8c3);}return _0x33f134[_0x4583('0x20')](_0x24a8c3)['end']();};}function respondWithResult(_0x4f1630,_0x33e646){_0x33e646=_0x33e646||0xc8;return function(_0x1268fb){if(_0x1268fb){return _0x4f1630[_0x4583('0x20')](_0x33e646)[_0x4583('0x21')](_0x1268fb);}};}function respondWithFilteredResult(_0x51c6c0,_0x5897a7){return function(_0x22cae4){if(_0x22cae4){var _0x5e8cf1=typeof _0x5897a7['offset']==='undefined'&&typeof _0x5897a7['limit']===_0x4583('0x22');var _0x58d35c=_0x22cae4[_0x4583('0x23')];var _0x49ceff=_0x5e8cf1?0x0:_0x5897a7[_0x4583('0x24')];var _0xa7cac9=_0x5e8cf1?_0x22cae4['count']:_0x5897a7[_0x4583('0x24')]+_0x5897a7[_0x4583('0x25')];var _0x469313;if(_0xa7cac9>=_0x58d35c){_0xa7cac9=_0x58d35c;_0x469313=0xc8;}else{_0x469313=0xce;}_0x51c6c0['status'](_0x469313);return _0x51c6c0[_0x4583('0x26')](_0x4583('0x27'),_0x49ceff+'-'+_0xa7cac9+'/'+_0x58d35c)['json'](_0x22cae4);}return null;};}function patchUpdates(_0x44060b){return function(_0x4e5db1){try{jsonpatch[_0x4583('0x28')](_0x4e5db1,_0x44060b,!![]);}catch(_0x48a469){return BPromise[_0x4583('0x29')](_0x48a469);}return _0x4e5db1['save']();};}function saveUpdates(_0x41a993,_0x530cc1){return function(_0x10aaad){if(_0x10aaad){return _0x10aaad[_0x4583('0x2a')](_0x41a993)['then'](function(_0x557f84){return _0x557f84;});}return null;};}function removeEntity(_0x5c0339,_0x201619){return function(_0x5c09e5){if(_0x5c09e5){return _0x5c09e5[_0x4583('0x2b')]()[_0x4583('0x2c')](function(){var _0x36dcf2=_0x5c09e5[_0x4583('0x2d')]({'plain':!![]});var _0x21abf8=_0x4583('0x2e');return db[_0x4583('0x2f')][_0x4583('0x2b')]({'where':{'type':_0x21abf8,'resourceId':_0x36dcf2['id']}})[_0x4583('0x2c')](function(){return _0x5c09e5;});})['then'](function(){_0x5c0339[_0x4583('0x20')](0xcc)[_0x4583('0x30')]();});}};}function handleEntityNotFound(_0x323158,_0x231693){return function(_0x5cd95c){if(!_0x5cd95c){_0x323158[_0x4583('0x1f')](0x194);}return _0x5cd95c;};}function handleError(_0x536c22,_0x2f6db3){_0x2f6db3=_0x2f6db3||0x1f4;return function(_0xece8d9){logger[_0x4583('0x31')](_0xece8d9[_0x4583('0x32')]);if(_0xece8d9[_0x4583('0x33')]){delete _0xece8d9[_0x4583('0x33')];}_0x536c22[_0x4583('0x20')](_0x2f6db3)['send'](_0xece8d9);};}exports[_0x4583('0x34')]=function(_0x3c399b,_0x3da12d){var _0x12f26e={},_0x3a558f={},_0x5ba7e4={'count':0x0,'rows':[]};var _0x2daf96=_[_0x4583('0x35')](db[_0x4583('0x36')][_0x4583('0x37')],function(_0x11a3cb){return{'name':_0x11a3cb[_0x4583('0x38')],'type':_0x11a3cb[_0x4583('0x39')]['key']};});_0x3a558f[_0x4583('0x3a')]=_[_0x4583('0x35')](_0x2daf96,'name');_0x3a558f[_0x4583('0x3b')]=_[_0x4583('0x3c')](_0x3c399b[_0x4583('0x3b')]);_0x3a558f[_0x4583('0x3d')]=_['intersection'](_0x3a558f['model'],_0x3a558f[_0x4583('0x3b')]);_0x12f26e[_0x4583('0x3e')]=_[_0x4583('0x3f')](_0x3a558f[_0x4583('0x3a')],qs[_0x4583('0x40')](_0x3c399b[_0x4583('0x3b')][_0x4583('0x40')]));_0x12f26e[_0x4583('0x3e')]=_0x12f26e[_0x4583('0x3e')]['length']?_0x12f26e[_0x4583('0x3e')]:_0x3a558f[_0x4583('0x3a')];if(!_0x3c399b[_0x4583('0x3b')]['hasOwnProperty'](_0x4583('0x41'))){_0x12f26e['limit']=qs[_0x4583('0x25')](_0x3c399b['query'][_0x4583('0x25')]);_0x12f26e['offset']=qs[_0x4583('0x24')](_0x3c399b[_0x4583('0x3b')]['offset']);}_0x12f26e[_0x4583('0x42')]=qs[_0x4583('0x43')](_0x3c399b[_0x4583('0x3b')][_0x4583('0x43')]);_0x12f26e['where']=qs[_0x4583('0x3d')](_[_0x4583('0x44')](_0x3c399b[_0x4583('0x3b')],_0x3a558f[_0x4583('0x3d')]),_0x2daf96);if(_0x3c399b[_0x4583('0x3b')]['filter']){_0x12f26e[_0x4583('0x45')]=_[_0x4583('0x46')](_0x12f26e[_0x4583('0x45')],{'$or':_['map'](_0x2daf96,function(_0x3331f2){if(_0x3331f2['type']!==_0x4583('0x47')){var _0x1deda7={};_0x1deda7[_0x3331f2[_0x4583('0x33')]]={'$like':'%'+_0x3c399b[_0x4583('0x3b')][_0x4583('0x48')]+'%'};return _0x1deda7;}})});}_0x12f26e=_[_0x4583('0x46')]({},_0x12f26e,_0x3c399b[_0x4583('0x49')]);var _0x3dfb7f={'where':_0x12f26e['where']};return db[_0x4583('0x36')][_0x4583('0x23')](_0x3dfb7f)[_0x4583('0x2c')](function(_0x25ed15){_0x5ba7e4[_0x4583('0x23')]=_0x25ed15;if(_0x3c399b[_0x4583('0x3b')][_0x4583('0x4a')]){_0x12f26e[_0x4583('0x4b')]=[{'all':!![]}];}return db[_0x4583('0x36')][_0x4583('0x4c')](_0x12f26e);})[_0x4583('0x2c')](function(_0x5e95d8){_0x5ba7e4[_0x4583('0x4d')]=_0x5e95d8;return _0x5ba7e4;})['then'](respondWithFilteredResult(_0x3da12d,_0x12f26e))['catch'](handleError(_0x3da12d,null));};exports[_0x4583('0x4e')]=function(_0x54d776,_0x2b03f0){var _0x2f1bc3={'raw':![],'where':{'id':_0x54d776['params']['id']}},_0x2cab35={};_0x2cab35['model']=_['keys'](db[_0x4583('0x36')][_0x4583('0x37')]);_0x2cab35['query']=_[_0x4583('0x3c')](_0x54d776['query']);_0x2cab35[_0x4583('0x3d')]=_['intersection'](_0x2cab35[_0x4583('0x3a')],_0x2cab35[_0x4583('0x3b')]);_0x2f1bc3[_0x4583('0x3e')]=_[_0x4583('0x3f')](_0x2cab35['model'],qs[_0x4583('0x40')](_0x54d776[_0x4583('0x3b')][_0x4583('0x40')]));_0x2f1bc3[_0x4583('0x3e')]=_0x2f1bc3[_0x4583('0x3e')][_0x4583('0x4f')]?_0x2f1bc3['attributes']:_0x2cab35[_0x4583('0x3a')];if(_0x54d776['query']['includeAll']){_0x2f1bc3[_0x4583('0x4b')]=[{'all':!![]}];}_0x2f1bc3=_[_0x4583('0x46')]({},_0x2f1bc3,_0x54d776[_0x4583('0x49')]);return db['CmList'][_0x4583('0x50')](_0x2f1bc3)['then'](handleEntityNotFound(_0x2b03f0,null))[_0x4583('0x2c')](respondWithResult(_0x2b03f0,null))[_0x4583('0x51')](handleError(_0x2b03f0,null));};exports[_0x4583('0x52')]=function(_0x10cbea,_0x1dbe5e){return db[_0x4583('0x36')][_0x4583('0x52')](_0x10cbea[_0x4583('0x53')],{})[_0x4583('0x2c')](function(_0x1043a9){var _0x4b85b4=_0x10cbea['user']['get']({'plain':!![]});if(!_0x4b85b4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b85b4[_0x4583('0x54')]===_0x4583('0x55')){var _0x29f76e=_0x1043a9[_0x4583('0x2d')]({'plain':!![]});var _0x59f2e6=_0x4583('0x2e');return db['UserProfileSection'][_0x4583('0x50')]({'where':{'name':_0x59f2e6,'userProfileId':_0x4b85b4[_0x4583('0x56')]},'raw':!![]})['then'](function(_0x3f9f90){if(_0x3f9f90&&_0x3f9f90['autoAssociation']===0x0){return db[_0x4583('0x2f')][_0x4583('0x52')]({'name':_0x29f76e[_0x4583('0x33')],'resourceId':_0x29f76e['id'],'type':_0x3f9f90[_0x4583('0x33')],'sectionId':_0x3f9f90['id']},{})[_0x4583('0x2c')](function(){return _0x1043a9;});}else{return _0x1043a9;}})[_0x4583('0x51')](function(_0x108257){logger[_0x4583('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x108257);throw _0x108257;});}return _0x1043a9;})[_0x4583('0x2c')](respondWithResult(_0x1dbe5e,0xc9))['catch'](handleError(_0x1dbe5e,null));};exports['update']=function(_0xc4c377,_0x4c6f63){if(_0xc4c377[_0x4583('0x53')]['id']){delete _0xc4c377[_0x4583('0x53')]['id'];}return db['CmList'][_0x4583('0x50')]({'where':{'id':_0xc4c377[_0x4583('0x57')]['id']}})[_0x4583('0x2c')](handleEntityNotFound(_0x4c6f63,null))[_0x4583('0x2c')](saveUpdates(_0xc4c377[_0x4583('0x53')],null))[_0x4583('0x2c')](respondWithResult(_0x4c6f63,null))[_0x4583('0x51')](handleError(_0x4c6f63,null));};exports[_0x4583('0x2b')]=function(_0x291434,_0xe78d49){return db['CmList'][_0x4583('0x50')]({'where':{'id':_0x291434[_0x4583('0x57')]['id']}})[_0x4583('0x2c')](handleEntityNotFound(_0xe78d49,null))['then'](removeEntity(_0xe78d49,null))[_0x4583('0x51')](handleError(_0xe78d49,null));};exports['describe']=function(_0x18496c,_0x7ff062){return db[_0x4583('0x36')][_0x4583('0x58')]()[_0x4583('0x2c')](respondWithResult(_0x7ff062,null))[_0x4583('0x51')](handleError(_0x7ff062,null));};exports['addDisposition']=function(_0x57dbb8,_0x4d7041,_0x14d24e){if(_0x57dbb8[_0x4583('0x53')]['id']){delete _0x57dbb8['body']['id'];}return db[_0x4583('0x36')][_0x4583('0x50')]({'where':{'id':_0x57dbb8['params']['id']}})[_0x4583('0x2c')](handleEntityNotFound(_0x4d7041,null))[_0x4583('0x2c')](function(_0x204afd){if(_0x204afd){_0x57dbb8[_0x4583('0x53')]['ListId']=_0x204afd['id'];return db[_0x4583('0x59')]['create'](_0x57dbb8[_0x4583('0x53')]);}})[_0x4583('0x2c')](respondWithResult(_0x4d7041,null))[_0x4583('0x51')](handleError(_0x4d7041,null));};exports[_0x4583('0x5a')]=function(_0xe3d736,_0x5ee8b4,_0x185a78){var _0x48e203={'raw':![],'where':{}};var _0x72289b={};var _0x2bb6b0={'count':0x0,'rows':[]};return db[_0x4583('0x36')][_0x4583('0x5b')]({'where':{'id':_0xe3d736[_0x4583('0x57')]['id']}})[_0x4583('0x2c')](handleEntityNotFound(_0x5ee8b4,null))[_0x4583('0x2c')](function(_0x5ab22a){if(_0x5ab22a){_0x72289b[_0x4583('0x3a')]=_[_0x4583('0x3c')](db[_0x4583('0x59')][_0x4583('0x37')]);_0x72289b['query']=_[_0x4583('0x3c')](_0xe3d736[_0x4583('0x3b')]);_0x72289b[_0x4583('0x3d')]=_[_0x4583('0x3f')](_0x72289b[_0x4583('0x3a')],_0x72289b[_0x4583('0x3b')]);_0x48e203[_0x4583('0x3e')]=_[_0x4583('0x3f')](_0x72289b[_0x4583('0x3a')],qs[_0x4583('0x40')](_0xe3d736[_0x4583('0x3b')][_0x4583('0x40')]));_0x48e203[_0x4583('0x3e')]=_0x48e203[_0x4583('0x3e')][_0x4583('0x4f')]?_0x48e203[_0x4583('0x3e')]:_0x72289b[_0x4583('0x3a')];if(!_0xe3d736[_0x4583('0x3b')][_0x4583('0x5c')]('nolimit')){_0x48e203[_0x4583('0x25')]=qs[_0x4583('0x25')](_0xe3d736['query'][_0x4583('0x25')]);_0x48e203[_0x4583('0x24')]=qs[_0x4583('0x24')](_0xe3d736[_0x4583('0x3b')][_0x4583('0x24')]);}_0x48e203['order']=qs[_0x4583('0x43')](_0xe3d736[_0x4583('0x3b')][_0x4583('0x43')]);_0x48e203['where']=qs[_0x4583('0x3d')](_[_0x4583('0x44')](_0xe3d736['query'],_0x72289b[_0x4583('0x3d')]));_0x48e203['where']['ListId']=_0x5ab22a['id'];if(_0xe3d736[_0x4583('0x3b')][_0x4583('0x48')]){_0x48e203[_0x4583('0x45')]=_[_0x4583('0x46')](_0x48e203[_0x4583('0x45')],{'$or':_['map'](_0x48e203['attributes'],function(_0xe3bfb8){var _0x374afb={};_0x374afb[_0xe3bfb8]={'$like':'%'+_0xe3d736[_0x4583('0x3b')]['filter']+'%'};return _0x374afb;})});}_0x48e203=_['merge']({},_0x48e203,_0xe3d736[_0x4583('0x49')]);return db[_0x4583('0x59')][_0x4583('0x23')]({'where':_0x48e203[_0x4583('0x45')]})[_0x4583('0x2c')](function(_0x36ea35){_0x2bb6b0[_0x4583('0x23')]=_0x36ea35;if(_0xe3d736['query'][_0x4583('0x4a')]){_0x48e203[_0x4583('0x4b')]=[{'all':!![]}];}return db[_0x4583('0x59')][_0x4583('0x4c')](_0x48e203);})[_0x4583('0x2c')](function(_0x234799){_0x2bb6b0[_0x4583('0x4d')]=_0x234799;return _0x2bb6b0;});}})[_0x4583('0x2c')](respondWithFilteredResult(_0x5ee8b4,_0x48e203))[_0x4583('0x51')](handleError(_0x5ee8b4,null));};exports[_0x4583('0x5d')]=function(_0x3bf1bf,_0x5b998f,_0x11b581){return db['CmList'][_0x4583('0x50')]({'where':{'id':_0x3bf1bf['params']['id']}})[_0x4583('0x2c')](handleEntityNotFound(_0x5b998f,null))[_0x4583('0x2c')](function(_0x506584){if(_0x506584){return _0x506584[_0x4583('0x5d')](_0x3bf1bf[_0x4583('0x3b')][_0x4583('0x5e')]);}})[_0x4583('0x2c')](respondWithStatusCode(_0x5b998f,null))[_0x4583('0x51')](handleError(_0x5b998f,null));};exports['addContacts']=function(_0x4c6f45,_0x5de801,_0xd06ed2){return db[_0x4583('0x36')][_0x4583('0x50')]({'where':{'id':_0x4c6f45['params']['id']}})[_0x4583('0x2c')](handleEntityNotFound(_0x5de801,null))[_0x4583('0x2c')](function(_0xd1fc54){if(_0xd1fc54){var _0x1a069d=[];var _0xc7e81={'success':[],'errors':[]};return db[_0x4583('0x5f')][_0x4583('0x58')]()['then'](function(_0x1aa6e7){if(_0x4c6f45['body'][_0x4583('0x60')]&&_[_0x4583('0x61')](_0x4c6f45['body'][_0x4583('0x60')])){if(_0x4c6f45['body'][_0x4583('0x60')][_0x4583('0x4f')]){_0x4c6f45[_0x4583('0x53')][_0x4583('0x60')]=_0x4c6f45[_0x4583('0x53')][_0x4583('0x60')][_0x4583('0x62')](';')+';';}else{_0x4c6f45[_0x4583('0x53')][_0x4583('0x60')]=null;}}else{_0x4c6f45[_0x4583('0x53')]['tags']=null;}if(_0x4c6f45[_0x4583('0x53')]&&_['isArray'](_0x4c6f45[_0x4583('0x53')])){for(var _0x43f6bb=0x0;_0x43f6bb<_0x4c6f45[_0x4583('0x53')][_0x4583('0x4f')];_0x43f6bb+=0x1){_0x4c6f45[_0x4583('0x53')][_0x43f6bb][_0x4583('0x63')]=_0x4c6f45[_0x4583('0x57')]['id'];_0x1a069d[_0x4583('0x64')](_0x4c6f45[_0x4583('0x53')][_0x43f6bb]);}return BPromise[_0x4583('0x65')](_0x1a069d,function(_0x127611){return db[_0x4583('0x5f')][_0x4583('0x52')](_[_0x4583('0x66')](_0x127611,[_0x4583('0x5e'),'id'])||{},{'fields':_[_0x4583('0x3c')](_0x1aa6e7),'raw':!![]})['then'](function(_0x506270){_0xc7e81[_0x4583('0x67')][_0x4583('0x64')](_0x506270[_0x4583('0x68')]);})[_0x4583('0x51')](function(_0x1d902b){_0xc7e81[_0x4583('0x69')][_0x4583('0x64')]({'data':_0x127611,'error':_0x1d902b[_0x4583('0x6a')]});});})[_0x4583('0x2c')](function(_0x36e8f0){return _0xc7e81;})[_0x4583('0x51')](function(_0xd9c5f4){return _0xd9c5f4;});}else{_0x5de801[_0x4583('0x20')](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})[_0x4583('0x2c')](respondWithResult(_0x5de801,null))['catch'](handleError(_0x5de801,null));};exports[_0x4583('0x6b')]=function(_0x17621b,_0x2f9791,_0x47c0ee){var _0x3d1a40;return db[_0x4583('0x36')][_0x4583('0x50')]({'where':{'id':_0x17621b[_0x4583('0x57')]['id']},'include':[{'model':db[_0x4583('0x6c')],'as':_0x4583('0x6d')}]})[_0x4583('0x2c')](handleEntityNotFound(_0x2f9791,null))[_0x4583('0x2c')](function(_0x3ef25c){if(_0x3ef25c){_0x3d1a40=_0x3ef25c;return db[_0x4583('0x5f')][_0x4583('0x37')];}})[_0x4583('0x2c')](function(_0x28afb2){if(_0x28afb2){var _0x333a63={};var _0x5eee63={};_0x5eee63[_0x4583('0x3a')]=_[_0x4583('0x6e')](_[_0x4583('0x3c')](_0x28afb2),_[_0x4583('0x35')](_0x3d1a40[_0x4583('0x6d')],function(_0x360be8){return util[_0x4583('0x6f')](_0x4583('0x70'),_0x360be8['id']);}));_0x5eee63[_0x4583('0x3b')]=_[_0x4583('0x3c')](_0x17621b[_0x4583('0x3b')]);_0x5eee63[_0x4583('0x3d')]=_[_0x4583('0x3f')](_0x5eee63[_0x4583('0x3a')],_0x5eee63[_0x4583('0x3b')]);_0x333a63['attributes']=_[_0x4583('0x3f')](_0x5eee63[_0x4583('0x3a')],qs[_0x4583('0x40')](_0x17621b['query'][_0x4583('0x40')]));_0x333a63['attributes']=_0x333a63[_0x4583('0x3e')][_0x4583('0x4f')]?_0x333a63[_0x4583('0x3e')]:_0x5eee63[_0x4583('0x3a')];if(!_0x17621b[_0x4583('0x3b')][_0x4583('0x5c')](_0x4583('0x41'))){_0x333a63[_0x4583('0x25')]=qs[_0x4583('0x25')](_0x17621b[_0x4583('0x3b')][_0x4583('0x25')]);_0x333a63['offset']=qs[_0x4583('0x24')](_0x17621b[_0x4583('0x3b')]['offset']);}_0x333a63[_0x4583('0x42')]=qs[_0x4583('0x43')](_0x17621b[_0x4583('0x3b')]['sort']);_0x333a63['where']=qs[_0x4583('0x3d')](_[_0x4583('0x44')](_0x17621b['query'],_0x5eee63[_0x4583('0x3d')]));_0x333a63[_0x4583('0x71')]=!![];if(_0x17621b[_0x4583('0x3b')][_0x4583('0x48')]){_0x333a63[_0x4583('0x45')]=_[_0x4583('0x46')](_0x333a63[_0x4583('0x45')],{'$or':_['map'](_0x333a63['attributes'],function(_0x4b60b9){var _0x3404f7={};_0x3404f7[_0x4b60b9]={'$like':'%'+_0x17621b['query'][_0x4583('0x48')]+'%'};return _0x3404f7;})});}_0x333a63=_[_0x4583('0x46')]({},_0x333a63,_0x17621b[_0x4583('0x49')]);return _0x3d1a40[_0x4583('0x6b')](_0x333a63);}})[_0x4583('0x2c')](respondWithResult(_0x2f9791,null))[_0x4583('0x51')](handleError(_0x2f9791,null));};exports[_0x4583('0x72')]=function(_0x183b9b,_0x6b24f4,_0x353cbf){var _0x2e90d7;var _0x2aa00f;var _0x5518ea;var _0x289610=_0x183b9b['params']['id'];csv_results=[];return db[_0x4583('0x73')]['findAll']({'attributes':['id',_0x4583('0x33')],'raw':!![],'order':[_0x4583('0x74')]})[_0x4583('0x2c')](function(_0x2d0f30){_0x2e90d7=_0x2d0f30;var _0xa9252c=_['keys'](db[_0x4583('0x5f')][_0x4583('0x37')]);return db[_0x4583('0x6c')][_0x4583('0x4c')]({'raw':!![],'attributes':['id','alias']})['then'](function(_0x2465f2){_0x2aa00f=_0x2465f2;var _0x514810=squel[_0x4583('0x75')]()[_0x4583('0x40')](_0xa9252c)[_0x4583('0x76')]('cm_contacts','c')[_0x4583('0x45')]('c.ListId\x20=\x20?',_0x289610)['where'](_0x4583('0x77'))['distinct']();for(var _0x1aa8d4=0x0;_0x1aa8d4<_0x2aa00f[_0x4583('0x4f')];_0x1aa8d4++){_0x514810[_0x4583('0x78')]('c.cf_'+_0x2aa00f[_0x1aa8d4]['id'],'customField_'+_0x2aa00f[_0x1aa8d4]['alias']);}for(var _0x1aa8d4=0x0;_0x1aa8d4<_0x2e90d7[_0x4583('0x4f')];_0x1aa8d4++){_0x514810[_0x4583('0x78')](squel[_0x4583('0x75')]()[_0x4583('0x78')]('item')['from'](_0x4583('0x79'))[_0x4583('0x45')](_0x4583('0x7a'),_0x2e90d7[_0x1aa8d4]['id'])[_0x4583('0x45')](_0x4583('0x7b')),'additionalPhone_'+_0x2e90d7[_0x1aa8d4][_0x4583('0x33')]);_0x514810[_0x4583('0x78')](squel[_0x4583('0x75')]()[_0x4583('0x78')](_0x4583('0x7c'))[_0x4583('0x76')](_0x4583('0x79'))[_0x4583('0x45')](_0x4583('0x7a'),_0x2e90d7[_0x1aa8d4]['id'])[_0x4583('0x45')](_0x4583('0x7b')),_0x4583('0x7d')+_0x2e90d7[_0x1aa8d4][_0x4583('0x33')]);}var _0x39d05d=[];_0x39d05d['push'](_0x514810[_0x4583('0x7e')]());BPromise['each'](_0x39d05d,handleQuery)[_0x4583('0x2c')](function(_0x3c0176){handleQuery(_0x514810[_0x4583('0x7e')]());var _0x6e94b7=csv_results[0x0];if(!_[_0x4583('0x7f')](_0x6e94b7)){var _0x1ff1f5=toCsv(_0x6e94b7);var _0x23e74f=Date[_0x4583('0x80')]();fs['writeFileSync'](util[_0x4583('0x6f')](_0x4583('0x81'),_0x289610,_0x23e74f),_0x1ff1f5);_0x6b24f4[_0x4583('0x82')](_0x4583('0x83'),_0x4583('0x84')+util[_0x4583('0x6f')](_0x4583('0x85'),_0x289610,_0x23e74f));_0x6b24f4[_0x4583('0x82')](_0x4583('0x86'),_0x4583('0x87'));return _0x6b24f4[_0x4583('0x88')](util['format'](_0x4583('0x81'),_0x289610,_0x23e74f));}else{return _0x6b24f4[_0x4583('0x1f')](0xcc);}});});});};exports[_0x4583('0x89')]=function(_0x41afed,_0x27359d,_0x18cdd2){var _0x4498d0;delete _0x41afed['body']['id'];return db[_0x4583('0x36')][_0x4583('0x5b')]({'where':{'id':_0x41afed['params']['id']}})['then'](handleEntityNotFound(_0x27359d,null))['then'](function(_0x4d53f8){if(_0x4d53f8){return db['sequelize'][_0x4583('0x8a')](function(_0x337ebf){return db[_0x4583('0x6c')][_0x4583('0x52')](_0x41afed[_0x4583('0x53')],{'transaction':_0x337ebf})[_0x4583('0x2c')](function(_0xda246c){_0x4498d0=_0xda246c;return _0x4d53f8[_0x4583('0x8b')](_0xda246c,{'transaction':_0x337ebf});})[_0x4583('0x2c')](function(){var _0x4a69f8={'type':db['Sequelize'][_0x4583('0x8c')],'transaction':_0x337ebf};switch(_0x41afed[_0x4583('0x53')][_0x4583('0x39')]){case _0x4583('0x8d'):_0x4a69f8[_0x4583('0x39')]=db['Sequelize'][_0x4583('0x8c')];break;case _0x4583('0x8e'):_0x4a69f8[_0x4583('0x39')]=db['Sequelize'][_0x4583('0x8f')];break;case _0x4583('0x90'):_0x4a69f8[_0x4583('0x39')]=db['Sequelize'][_0x4583('0x91')];_0x4a69f8[_0x4583('0x92')]=![];break;default:}return db[_0x4583('0x93')][_0x4583('0x94')][_0x4583('0x95')](_0x4583('0x96'),util['format'](_0x4583('0x97'),_0x4498d0['id']),_0x4a69f8);})[_0x4583('0x2c')](function(){return _0x4498d0;});});}})['then'](respondWithResult(_0x27359d,null))['catch'](handleError(_0x27359d,null));};exports[_0x4583('0x98')]=function(_0x2a51c1,_0x8d1091,_0x462ef6){var _0x5c3f18={};var _0x6731c={};var _0x24f633;var _0x3d2a84;return db['CmList']['findOne']({'where':{'id':_0x2a51c1[_0x4583('0x57')]['id']}})[_0x4583('0x2c')](handleEntityNotFound(_0x8d1091,null))[_0x4583('0x2c')](function(_0x4bcc27){if(_0x4bcc27){_0x24f633=_0x4bcc27;_0x6731c[_0x4583('0x3a')]=_['keys'](db[_0x4583('0x6c')][_0x4583('0x37')]);_0x6731c[_0x4583('0x3b')]=_['keys'](_0x2a51c1[_0x4583('0x3b')]);_0x6731c[_0x4583('0x3d')]=_['intersection'](_0x6731c[_0x4583('0x3a')],_0x6731c[_0x4583('0x3b')]);_0x5c3f18[_0x4583('0x3e')]=_[_0x4583('0x3f')](_0x6731c[_0x4583('0x3a')],qs[_0x4583('0x40')](_0x2a51c1[_0x4583('0x3b')]['fields']));_0x5c3f18[_0x4583('0x3e')]=_0x5c3f18[_0x4583('0x3e')][_0x4583('0x4f')]?_0x5c3f18['attributes']:_0x6731c[_0x4583('0x3a')];_0x5c3f18['order']=qs[_0x4583('0x43')](_0x2a51c1[_0x4583('0x3b')][_0x4583('0x43')]);_0x5c3f18[_0x4583('0x45')]=qs[_0x4583('0x3d')](_['pick'](_0x2a51c1[_0x4583('0x3b')],_0x6731c['filters']));_0x5c3f18['where']=_[_0x4583('0x46')](_0x5c3f18[_0x4583('0x45')],{'$or':[{'ListId':_0x4bcc27['id']},{'ListId':null}]});if(_0x2a51c1[_0x4583('0x3b')][_0x4583('0x48')]){_0x5c3f18[_0x4583('0x45')]=_[_0x4583('0x46')](_0x5c3f18[_0x4583('0x45')],{'$or':_[_0x4583('0x35')](_0x5c3f18[_0x4583('0x3e')],function(_0x268f8e){var _0x5db23d={};_0x5db23d[_0x268f8e]={'$like':'%'+_0x2a51c1['query'][_0x4583('0x48')]+'%'};return _0x5db23d;})});}_0x5c3f18=_['merge']({},_0x5c3f18,_0x2a51c1['options']);return db['CmCustomField'][_0x4583('0x99')](_0x5c3f18);}})['then'](respondWithResult(_0x8d1091,null))[_0x4583('0x51')](handleError(_0x8d1091,null));};exports[_0x4583('0x9a')]=function(_0x521778,_0x161124){return db[_0x4583('0x6c')][_0x4583('0x99')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x161124,null))[_0x4583('0x2c')](function(_0x42ad8b){return _0x42ad8b;})['then'](respondWithResult(_0x161124,null))['catch'](handleError(_0x161124,null));};exports[_0x4583('0x9b')]=function(_0x2a2c6d,_0x15de78,_0x22503a){return db[_0x4583('0x36')]['find']({'where':{'id':_0x2a2c6d[_0x4583('0x57')]['id']}})['then'](handleEntityNotFound(_0x15de78,null))[_0x4583('0x2c')](function(_0x47a718){if(_0x47a718){return _0x47a718[_0x4583('0x9b')](_0x2a2c6d[_0x4583('0x53')][_0x4583('0x5e')],_[_0x4583('0x66')](_0x2a2c6d['body'],['ids','id'])||{})[_0x4583('0x9c')](function(_0x4cf0d5){for(var _0x42a73f=0x0;_0x42a73f<_0x2a2c6d[_0x4583('0x53')][_0x4583('0x5e')]['length'];_0x42a73f+=0x1){socket[_0x4583('0x9d')](_0x4583('0x9e'),{'UserId':Number(_0x2a2c6d[_0x4583('0x53')][_0x4583('0x5e')][_0x42a73f]),'CmListId':Number(_0x2a2c6d[_0x4583('0x57')]['id'])});}return _0x4cf0d5;});}})[_0x4583('0x2c')](respondWithResult(_0x15de78,null))[_0x4583('0x51')](handleError(_0x15de78,null));};exports['removeAgents']=function(_0x18d889,_0x1038e6,_0x5d047d){return db['CmList']['find']({'where':{'id':_0x18d889[_0x4583('0x57')]['id']}})[_0x4583('0x2c')](handleEntityNotFound(_0x1038e6,null))[_0x4583('0x2c')](function(_0x4c9a7e){if(_0x4c9a7e){return _0x4c9a7e[_0x4583('0x9f')](_0x18d889[_0x4583('0x3b')][_0x4583('0x5e')])[_0x4583('0x2c')](function(){if(_[_0x4583('0x61')](_0x18d889[_0x4583('0x3b')][_0x4583('0x5e')])){for(var _0x12346e=0x0;_0x12346e<_0x18d889[_0x4583('0x3b')][_0x4583('0x5e')][_0x4583('0x4f')];_0x12346e+=0x1){socket['emit'](_0x4583('0xa0'),{'UserId':Number(_0x18d889[_0x4583('0x3b')][_0x4583('0x5e')][_0x12346e]),'CmListId':Number(_0x18d889[_0x4583('0x57')]['id'])});}}else{socket[_0x4583('0x9d')](_0x4583('0xa0'),{'UserId':Number(_0x18d889[_0x4583('0x3b')][_0x4583('0x5e')]),'CmListId':Number(_0x18d889['params']['id'])});}});}})[_0x4583('0x2c')](respondWithStatusCode(_0x1038e6,null))[_0x4583('0x51')](handleError(_0x1038e6,null));};exports[_0x4583('0xa1')]=function(_0x201585,_0x424c70,_0x26ce7f){var _0x58564d={};var _0x524dfd={};var _0x29d53b;var _0x52de8e;return db[_0x4583('0x36')][_0x4583('0x5b')]({'where':{'id':_0x201585[_0x4583('0x57')]['id']}})['then'](handleEntityNotFound(_0x424c70,null))[_0x4583('0x2c')](function(_0xb9f37b){if(_0xb9f37b){_0x29d53b=_0xb9f37b;_0x524dfd[_0x4583('0x3a')]=_[_0x4583('0x3c')](db['User'][_0x4583('0x37')]);_0x524dfd['query']=_[_0x4583('0x3c')](_0x201585['query']);_0x524dfd['filters']=_['intersection'](_0x524dfd['model'],_0x524dfd[_0x4583('0x3b')]);_0x58564d['attributes']=_[_0x4583('0x3f')](_0x524dfd[_0x4583('0x3a')],qs[_0x4583('0x40')](_0x201585[_0x4583('0x3b')][_0x4583('0x40')]));_0x58564d[_0x4583('0x3e')]=_0x58564d[_0x4583('0x3e')][_0x4583('0x4f')]?_0x58564d[_0x4583('0x3e')]:_0x524dfd[_0x4583('0x3a')];_0x58564d[_0x4583('0x42')]=qs['sort'](_0x201585[_0x4583('0x3b')]['sort']);_0x58564d[_0x4583('0x45')]=qs[_0x4583('0x3d')](_[_0x4583('0x44')](_0x201585['query'],_0x524dfd[_0x4583('0x3d')]));if(_0x201585[_0x4583('0x3b')][_0x4583('0x48')]){_0x58564d['where']=_[_0x4583('0x46')](_0x58564d[_0x4583('0x45')],{'$or':_[_0x4583('0x35')](_0x58564d[_0x4583('0x3e')],function(_0x5427a0){var _0x9ef296={};_0x9ef296[_0x5427a0]={'$like':'%'+_0x201585[_0x4583('0x3b')][_0x4583('0x48')]+'%'};return _0x9ef296;})});}_0x58564d=_[_0x4583('0x46')]({},_0x58564d,_0x201585['options']);return _0x29d53b[_0x4583('0xa1')](_0x58564d);}})['then'](function(_0x5dd236){if(_0x5dd236){_0x52de8e=_0x5dd236['length'];if(!_0x201585[_0x4583('0x3b')][_0x4583('0x5c')](_0x4583('0x41'))){_0x58564d['limit']=qs[_0x4583('0x25')](_0x201585[_0x4583('0x3b')]['limit']);_0x58564d['offset']=qs['offset'](_0x201585[_0x4583('0x3b')][_0x4583('0x24')]);}return _0x29d53b[_0x4583('0xa1')](_0x58564d);}})[_0x4583('0x2c')](function(_0x38e0b3){if(_0x38e0b3){return _0x38e0b3?{'count':_0x52de8e,'rows':_0x38e0b3}:null;}})['then'](respondWithResult(_0x424c70,null))['catch'](handleError(_0x424c70,null));};function handleQuery(_0x1398ab){logger['info'](_0x1398ab);return db['sequelize'][_0x4583('0x3b')](_0x1398ab)[_0x4583('0x9c')](function(_0x45cd5c){csv_results[_0x4583('0x64')](_0x45cd5c);})['catch'](function(_0x3fc482){logger[_0x4583('0x31')](_0x3fc482[_0x4583('0x6a')]);});} \ No newline at end of file +var _0xe54b=['download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','info','message','eml-format','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','show','params','include','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','ListId','findAll','rows','removeDispositions','ids','addContacts','tags','isArray','push','each','CmContact','omit','dataValues','errors','CmCustomField','CustomFields','concat','cf_%d','raw','getContacts','getContactsCsv','ContactItemType','OrderBy','alias','select','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','field','c.cf_','customField_','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','toString','now','setHeader','Content-disposition','attachment;\x20filename=','format','list_%d_%s.csv','Content-type','text/csv'];(function(_0x551189,_0xfa580c){var _0x9517da=function(_0x36141c){while(--_0x36141c){_0x551189['push'](_0x551189['shift']());}};_0x9517da(++_0xfa580c);}(_0xe54b,0x167));var _0xbe54=function(_0x281ded,_0x4c3a7c){_0x281ded=_0x281ded-0x0;var _0x1ed025=_0xe54b[_0x281ded];return _0x1ed025;};'use strict';var emlformat=require(_0xbe54('0x0'));var rimraf=require(_0xbe54('0x1'));var zipdir=require(_0xbe54('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbe54('0x3'));var Mustache=require('mustache');var util=require(_0xbe54('0x4'));var path=require(_0xbe54('0x5'));var sox=require(_0xbe54('0x6'));var csv=require(_0xbe54('0x7'));var ejs=require(_0xbe54('0x8'));var fs=require('fs');var fs_extra=require(_0xbe54('0x9'));var _=require(_0xbe54('0xa'));var squel=require(_0xbe54('0xb'));var crypto=require(_0xbe54('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbe54('0xd'));var toCsv=require(_0xbe54('0x7'));var querystring=require('querystring');var Papa=require(_0xbe54('0xe'));var Redis=require(_0xbe54('0xf'));var authService=require(_0xbe54('0x10'));var qs=require(_0xbe54('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe54('0x12'));var logger=require(_0xbe54('0x13'))(_0xbe54('0x14'));var utils=require(_0xbe54('0x15'));var config=require(_0xbe54('0x16'));var licenseUtil=require(_0xbe54('0x17'));var db=require(_0xbe54('0x18'))['db'];var csv_results;config['redis']=_['defaults'](config['redis'],{'host':_0xbe54('0x19'),'port':0x18eb});var socket=require(_0xbe54('0x1a'))(new Redis(config[_0xbe54('0x1b')]));require('./cmList.socket')[_0xbe54('0x1c')](socket);function respondWithStatusCode(_0x19b75,_0x334be3){_0x334be3=_0x334be3||0xcc;return function(_0x2b5a99){if(_0x2b5a99){return _0x19b75[_0xbe54('0x1d')](_0x334be3);}return _0x19b75[_0xbe54('0x1e')](_0x334be3)[_0xbe54('0x1f')]();};}function respondWithResult(_0x2bb253,_0x579b64){_0x579b64=_0x579b64||0xc8;return function(_0x2e911f){if(_0x2e911f){return _0x2bb253[_0xbe54('0x1e')](_0x579b64)[_0xbe54('0x20')](_0x2e911f);}};}function respondWithFilteredResult(_0x396049,_0x355298){return function(_0x4ac1b5){if(_0x4ac1b5){var _0x5bfe27=typeof _0x355298['offset']==='undefined'&&typeof _0x355298[_0xbe54('0x21')]===_0xbe54('0x22');var _0x213c0b=_0x4ac1b5[_0xbe54('0x23')];var _0x294289=_0x5bfe27?0x0:_0x355298[_0xbe54('0x24')];var _0x54becc=_0x5bfe27?_0x4ac1b5[_0xbe54('0x23')]:_0x355298[_0xbe54('0x24')]+_0x355298['limit'];var _0x201a77;if(_0x54becc>=_0x213c0b){_0x54becc=_0x213c0b;_0x201a77=0xc8;}else{_0x201a77=0xce;}_0x396049[_0xbe54('0x1e')](_0x201a77);return _0x396049['set'](_0xbe54('0x25'),_0x294289+'-'+_0x54becc+'/'+_0x213c0b)[_0xbe54('0x20')](_0x4ac1b5);}return null;};}function patchUpdates(_0x54e9b9){return function(_0x54274c){try{jsonpatch[_0xbe54('0x26')](_0x54274c,_0x54e9b9,!![]);}catch(_0x46d42b){return BPromise[_0xbe54('0x27')](_0x46d42b);}return _0x54274c[_0xbe54('0x28')]();};}function saveUpdates(_0x2d3ea1,_0x4906a9){return function(_0x2ed0c7){if(_0x2ed0c7){return _0x2ed0c7[_0xbe54('0x29')](_0x2d3ea1)[_0xbe54('0x2a')](function(_0x56b765){return _0x56b765;});}return null;};}function removeEntity(_0x1b2d33,_0x3d1c94){return function(_0x14e576){if(_0x14e576){return _0x14e576[_0xbe54('0x2b')]()['then'](function(){var _0x108230=_0x14e576[_0xbe54('0x2c')]({'plain':!![]});var _0x4f71e7='Lists';return db[_0xbe54('0x2d')][_0xbe54('0x2b')]({'where':{'type':_0x4f71e7,'resourceId':_0x108230['id']}})[_0xbe54('0x2a')](function(){return _0x14e576;});})[_0xbe54('0x2a')](function(){_0x1b2d33[_0xbe54('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x224f0d,_0x4cabe3){return function(_0xaf606a){if(!_0xaf606a){_0x224f0d[_0xbe54('0x1d')](0x194);}return _0xaf606a;};}function handleError(_0x16116b,_0x5d70c5){_0x5d70c5=_0x5d70c5||0x1f4;return function(_0x218d33){logger[_0xbe54('0x2e')](_0x218d33[_0xbe54('0x2f')]);if(_0x218d33['name']){delete _0x218d33[_0xbe54('0x30')];}_0x16116b['status'](_0x5d70c5)[_0xbe54('0x31')](_0x218d33);};}exports[_0xbe54('0x32')]=function(_0x3d1c45,_0x49541f){var _0x4eccba={},_0x51ea28={},_0x14f508={'count':0x0,'rows':[]};var _0x28504b=_[_0xbe54('0x33')](db[_0xbe54('0x34')][_0xbe54('0x35')],function(_0x3cae6b){return{'name':_0x3cae6b[_0xbe54('0x36')],'type':_0x3cae6b[_0xbe54('0x37')]['key']};});_0x51ea28[_0xbe54('0x38')]=_[_0xbe54('0x33')](_0x28504b,_0xbe54('0x30'));_0x51ea28['query']=_[_0xbe54('0x39')](_0x3d1c45['query']);_0x51ea28[_0xbe54('0x3a')]=_[_0xbe54('0x3b')](_0x51ea28[_0xbe54('0x38')],_0x51ea28[_0xbe54('0x3c')]);_0x4eccba[_0xbe54('0x3d')]=_[_0xbe54('0x3b')](_0x51ea28[_0xbe54('0x38')],qs[_0xbe54('0x3e')](_0x3d1c45[_0xbe54('0x3c')][_0xbe54('0x3e')]));_0x4eccba['attributes']=_0x4eccba[_0xbe54('0x3d')][_0xbe54('0x3f')]?_0x4eccba[_0xbe54('0x3d')]:_0x51ea28[_0xbe54('0x38')];if(!_0x3d1c45[_0xbe54('0x3c')][_0xbe54('0x40')](_0xbe54('0x41'))){_0x4eccba['limit']=qs['limit'](_0x3d1c45[_0xbe54('0x3c')][_0xbe54('0x21')]);_0x4eccba['offset']=qs[_0xbe54('0x24')](_0x3d1c45[_0xbe54('0x3c')][_0xbe54('0x24')]);}_0x4eccba[_0xbe54('0x42')]=qs[_0xbe54('0x43')](_0x3d1c45[_0xbe54('0x3c')][_0xbe54('0x43')]);_0x4eccba['where']=qs[_0xbe54('0x3a')](_[_0xbe54('0x44')](_0x3d1c45[_0xbe54('0x3c')],_0x51ea28[_0xbe54('0x3a')]),_0x28504b);if(_0x3d1c45[_0xbe54('0x3c')][_0xbe54('0x45')]){_0x4eccba[_0xbe54('0x46')]=_[_0xbe54('0x47')](_0x4eccba[_0xbe54('0x46')],{'$or':_[_0xbe54('0x33')](_0x28504b,function(_0x23d006){if(_0x23d006[_0xbe54('0x37')]!==_0xbe54('0x48')){var _0x419ddb={};_0x419ddb[_0x23d006[_0xbe54('0x30')]]={'$like':'%'+_0x3d1c45[_0xbe54('0x3c')]['filter']+'%'};return _0x419ddb;}})});}_0x4eccba=_[_0xbe54('0x47')]({},_0x4eccba,_0x3d1c45['options']);var _0x2692a4={'where':_0x4eccba[_0xbe54('0x46')]};return db['CmList'][_0xbe54('0x23')](_0x2692a4)[_0xbe54('0x2a')](function(_0x110655){_0x14f508['count']=_0x110655;if(_0x3d1c45[_0xbe54('0x3c')][_0xbe54('0x49')]){_0x4eccba['include']=[{'all':!![]}];}return db[_0xbe54('0x34')]['findAll'](_0x4eccba);})[_0xbe54('0x2a')](function(_0x5725c4){_0x14f508['rows']=_0x5725c4;return _0x14f508;})[_0xbe54('0x2a')](respondWithFilteredResult(_0x49541f,_0x4eccba))['catch'](handleError(_0x49541f,null));};exports[_0xbe54('0x4a')]=function(_0x1fdcd9,_0x54950d){var _0x4a7bd0={'raw':![],'where':{'id':_0x1fdcd9[_0xbe54('0x4b')]['id']}},_0x3cbacd={};_0x3cbacd[_0xbe54('0x38')]=_[_0xbe54('0x39')](db[_0xbe54('0x34')][_0xbe54('0x35')]);_0x3cbacd['query']=_[_0xbe54('0x39')](_0x1fdcd9['query']);_0x3cbacd[_0xbe54('0x3a')]=_['intersection'](_0x3cbacd['model'],_0x3cbacd['query']);_0x4a7bd0[_0xbe54('0x3d')]=_[_0xbe54('0x3b')](_0x3cbacd[_0xbe54('0x38')],qs[_0xbe54('0x3e')](_0x1fdcd9[_0xbe54('0x3c')][_0xbe54('0x3e')]));_0x4a7bd0['attributes']=_0x4a7bd0['attributes'][_0xbe54('0x3f')]?_0x4a7bd0[_0xbe54('0x3d')]:_0x3cbacd[_0xbe54('0x38')];if(_0x1fdcd9[_0xbe54('0x3c')]['includeAll']){_0x4a7bd0[_0xbe54('0x4c')]=[{'all':!![]}];}_0x4a7bd0=_[_0xbe54('0x47')]({},_0x4a7bd0,_0x1fdcd9[_0xbe54('0x4d')]);return db[_0xbe54('0x34')][_0xbe54('0x4e')](_0x4a7bd0)[_0xbe54('0x2a')](handleEntityNotFound(_0x54950d,null))[_0xbe54('0x2a')](respondWithResult(_0x54950d,null))[_0xbe54('0x4f')](handleError(_0x54950d,null));};exports[_0xbe54('0x50')]=function(_0x3caa2b,_0xd161bd){return db['CmList'][_0xbe54('0x50')](_0x3caa2b[_0xbe54('0x51')],{})['then'](function(_0x38045a){var _0x230bde=_0x3caa2b[_0xbe54('0x52')]['get']({'plain':!![]});if(!_0x230bde)throw new Error(_0xbe54('0x53'));if(_0x230bde[_0xbe54('0x54')]===_0xbe54('0x52')){var _0xc43493=_0x38045a[_0xbe54('0x2c')]({'plain':!![]});var _0x169e99=_0xbe54('0x55');return db[_0xbe54('0x56')][_0xbe54('0x4e')]({'where':{'name':_0x169e99,'userProfileId':_0x230bde[_0xbe54('0x57')]},'raw':!![]})[_0xbe54('0x2a')](function(_0xe227ea){if(_0xe227ea&&_0xe227ea[_0xbe54('0x58')]===0x0){return db[_0xbe54('0x2d')][_0xbe54('0x50')]({'name':_0xc43493['name'],'resourceId':_0xc43493['id'],'type':_0xe227ea[_0xbe54('0x30')],'sectionId':_0xe227ea['id']},{})['then'](function(){return _0x38045a;});}else{return _0x38045a;}})[_0xbe54('0x4f')](function(_0x403440){logger[_0xbe54('0x2e')](_0xbe54('0x59'),_0x403440);throw _0x403440;});}return _0x38045a;})[_0xbe54('0x2a')](respondWithResult(_0xd161bd,0xc9))[_0xbe54('0x4f')](handleError(_0xd161bd,null));};exports[_0xbe54('0x29')]=function(_0x231070,_0x533ca5){if(_0x231070[_0xbe54('0x51')]['id']){delete _0x231070[_0xbe54('0x51')]['id'];}return db['CmList'][_0xbe54('0x4e')]({'where':{'id':_0x231070['params']['id']}})[_0xbe54('0x2a')](handleEntityNotFound(_0x533ca5,null))[_0xbe54('0x2a')](saveUpdates(_0x231070['body'],null))['then'](respondWithResult(_0x533ca5,null))['catch'](handleError(_0x533ca5,null));};exports[_0xbe54('0x2b')]=function(_0x5e6008,_0x37f959){return db[_0xbe54('0x34')]['find']({'where':{'id':_0x5e6008['params']['id']}})['then'](handleEntityNotFound(_0x37f959,null))[_0xbe54('0x2a')](removeEntity(_0x37f959,null))['catch'](handleError(_0x37f959,null));};exports[_0xbe54('0x5a')]=function(_0x130a92,_0x246424){return db[_0xbe54('0x34')][_0xbe54('0x5a')]()[_0xbe54('0x2a')](respondWithResult(_0x246424,null))['catch'](handleError(_0x246424,null));};exports[_0xbe54('0x5b')]=function(_0x3476ba,_0x52ae55,_0x40eb92){if(_0x3476ba[_0xbe54('0x51')]['id']){delete _0x3476ba['body']['id'];}return db['CmList'][_0xbe54('0x4e')]({'where':{'id':_0x3476ba['params']['id']}})[_0xbe54('0x2a')](handleEntityNotFound(_0x52ae55,null))['then'](function(_0x48cd3f){if(_0x48cd3f){_0x3476ba['body']['ListId']=_0x48cd3f['id'];return db[_0xbe54('0x5c')][_0xbe54('0x50')](_0x3476ba[_0xbe54('0x51')]);}})['then'](respondWithResult(_0x52ae55,null))['catch'](handleError(_0x52ae55,null));};exports[_0xbe54('0x5d')]=function(_0x2e7c4f,_0x9829db,_0x51c70a){var _0x81d29={'raw':![],'where':{}};var _0x18db9d={};var _0x44467b={'count':0x0,'rows':[]};return db['CmList'][_0xbe54('0x5e')]({'where':{'id':_0x2e7c4f['params']['id']}})[_0xbe54('0x2a')](handleEntityNotFound(_0x9829db,null))[_0xbe54('0x2a')](function(_0x3de0ca){if(_0x3de0ca){_0x18db9d[_0xbe54('0x38')]=_[_0xbe54('0x39')](db[_0xbe54('0x5c')][_0xbe54('0x35')]);_0x18db9d[_0xbe54('0x3c')]=_[_0xbe54('0x39')](_0x2e7c4f[_0xbe54('0x3c')]);_0x18db9d['filters']=_[_0xbe54('0x3b')](_0x18db9d[_0xbe54('0x38')],_0x18db9d[_0xbe54('0x3c')]);_0x81d29[_0xbe54('0x3d')]=_[_0xbe54('0x3b')](_0x18db9d[_0xbe54('0x38')],qs[_0xbe54('0x3e')](_0x2e7c4f['query'][_0xbe54('0x3e')]));_0x81d29[_0xbe54('0x3d')]=_0x81d29[_0xbe54('0x3d')][_0xbe54('0x3f')]?_0x81d29[_0xbe54('0x3d')]:_0x18db9d[_0xbe54('0x38')];if(!_0x2e7c4f[_0xbe54('0x3c')][_0xbe54('0x40')](_0xbe54('0x41'))){_0x81d29['limit']=qs[_0xbe54('0x21')](_0x2e7c4f[_0xbe54('0x3c')][_0xbe54('0x21')]);_0x81d29[_0xbe54('0x24')]=qs[_0xbe54('0x24')](_0x2e7c4f['query'][_0xbe54('0x24')]);}_0x81d29[_0xbe54('0x42')]=qs[_0xbe54('0x43')](_0x2e7c4f[_0xbe54('0x3c')][_0xbe54('0x43')]);_0x81d29[_0xbe54('0x46')]=qs[_0xbe54('0x3a')](_['pick'](_0x2e7c4f[_0xbe54('0x3c')],_0x18db9d[_0xbe54('0x3a')]));_0x81d29[_0xbe54('0x46')][_0xbe54('0x5f')]=_0x3de0ca['id'];if(_0x2e7c4f[_0xbe54('0x3c')]['filter']){_0x81d29[_0xbe54('0x46')]=_[_0xbe54('0x47')](_0x81d29['where'],{'$or':_[_0xbe54('0x33')](_0x81d29[_0xbe54('0x3d')],function(_0x407975){var _0x5118ed={};_0x5118ed[_0x407975]={'$like':'%'+_0x2e7c4f[_0xbe54('0x3c')][_0xbe54('0x45')]+'%'};return _0x5118ed;})});}_0x81d29=_['merge']({},_0x81d29,_0x2e7c4f[_0xbe54('0x4d')]);return db[_0xbe54('0x5c')][_0xbe54('0x23')]({'where':_0x81d29[_0xbe54('0x46')]})[_0xbe54('0x2a')](function(_0x213a5a){_0x44467b[_0xbe54('0x23')]=_0x213a5a;if(_0x2e7c4f[_0xbe54('0x3c')][_0xbe54('0x49')]){_0x81d29['include']=[{'all':!![]}];}return db['Disposition'][_0xbe54('0x60')](_0x81d29);})[_0xbe54('0x2a')](function(_0x11f20d){_0x44467b[_0xbe54('0x61')]=_0x11f20d;return _0x44467b;});}})[_0xbe54('0x2a')](respondWithFilteredResult(_0x9829db,_0x81d29))[_0xbe54('0x4f')](handleError(_0x9829db,null));};exports[_0xbe54('0x62')]=function(_0x160944,_0x2ea080,_0x292555){return db[_0xbe54('0x34')]['find']({'where':{'id':_0x160944[_0xbe54('0x4b')]['id']}})[_0xbe54('0x2a')](handleEntityNotFound(_0x2ea080,null))['then'](function(_0x38bc49){if(_0x38bc49){return _0x38bc49[_0xbe54('0x62')](_0x160944[_0xbe54('0x3c')][_0xbe54('0x63')]);}})[_0xbe54('0x2a')](respondWithStatusCode(_0x2ea080,null))[_0xbe54('0x4f')](handleError(_0x2ea080,null));};exports[_0xbe54('0x64')]=function(_0x3404eb,_0x4a521c,_0x43cd9a){return db[_0xbe54('0x34')][_0xbe54('0x4e')]({'where':{'id':_0x3404eb['params']['id']}})[_0xbe54('0x2a')](handleEntityNotFound(_0x4a521c,null))[_0xbe54('0x2a')](function(_0x1f4e41){if(_0x1f4e41){var _0x461843=[];var _0x1f8ffb={'success':[],'errors':[]};return db['CmContact'][_0xbe54('0x5a')]()[_0xbe54('0x2a')](function(_0x11a06f){if(_0x3404eb[_0xbe54('0x51')][_0xbe54('0x65')]&&_['isArray'](_0x3404eb[_0xbe54('0x51')][_0xbe54('0x65')])){if(_0x3404eb['body'][_0xbe54('0x65')]['length']){_0x3404eb[_0xbe54('0x51')][_0xbe54('0x65')]=_0x3404eb[_0xbe54('0x51')][_0xbe54('0x65')]['join'](';')+';';}else{_0x3404eb[_0xbe54('0x51')]['tags']=null;}}else{_0x3404eb['body'][_0xbe54('0x65')]=null;}if(_0x3404eb[_0xbe54('0x51')]&&_[_0xbe54('0x66')](_0x3404eb[_0xbe54('0x51')])){for(var _0x285f2f=0x0;_0x285f2f<_0x3404eb[_0xbe54('0x51')][_0xbe54('0x3f')];_0x285f2f+=0x1){_0x3404eb[_0xbe54('0x51')][_0x285f2f]['ListId']=_0x3404eb[_0xbe54('0x4b')]['id'];_0x461843[_0xbe54('0x67')](_0x3404eb[_0xbe54('0x51')][_0x285f2f]);}return BPromise[_0xbe54('0x68')](_0x461843,function(_0x9707cb){return db[_0xbe54('0x69')][_0xbe54('0x50')](_[_0xbe54('0x6a')](_0x9707cb,[_0xbe54('0x63'),'id'])||{},{'fields':_['keys'](_0x11a06f),'raw':!![]})['then'](function(_0xf5c245){_0x1f8ffb['success'][_0xbe54('0x67')](_0xf5c245[_0xbe54('0x6b')]);})['catch'](function(_0x5a2aad){_0x1f8ffb[_0xbe54('0x6c')][_0xbe54('0x67')]({'data':_0x9707cb,'error':_0x5a2aad['message']});});})[_0xbe54('0x2a')](function(_0x47ab85){return _0x1f8ffb;})['catch'](function(_0x43f0ac){return _0x43f0ac;});}else{_0x4a521c[_0xbe54('0x1e')](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})[_0xbe54('0x2a')](respondWithResult(_0x4a521c,null))[_0xbe54('0x4f')](handleError(_0x4a521c,null));};exports['getContacts']=function(_0x5ca75d,_0x7746b0,_0x67c73b){var _0x5c40d4;return db[_0xbe54('0x34')][_0xbe54('0x4e')]({'where':{'id':_0x5ca75d[_0xbe54('0x4b')]['id']},'include':[{'model':db[_0xbe54('0x6d')],'as':_0xbe54('0x6e')}]})[_0xbe54('0x2a')](handleEntityNotFound(_0x7746b0,null))[_0xbe54('0x2a')](function(_0x189ba6){if(_0x189ba6){_0x5c40d4=_0x189ba6;return db[_0xbe54('0x69')][_0xbe54('0x35')];}})[_0xbe54('0x2a')](function(_0x4592e6){if(_0x4592e6){var _0x357794={};var _0x554221={};_0x554221[_0xbe54('0x38')]=_[_0xbe54('0x6f')](_[_0xbe54('0x39')](_0x4592e6),_[_0xbe54('0x33')](_0x5c40d4[_0xbe54('0x6e')],function(_0x56dce9){return util['format'](_0xbe54('0x70'),_0x56dce9['id']);}));_0x554221[_0xbe54('0x3c')]=_[_0xbe54('0x39')](_0x5ca75d[_0xbe54('0x3c')]);_0x554221[_0xbe54('0x3a')]=_[_0xbe54('0x3b')](_0x554221[_0xbe54('0x38')],_0x554221[_0xbe54('0x3c')]);_0x357794[_0xbe54('0x3d')]=_[_0xbe54('0x3b')](_0x554221[_0xbe54('0x38')],qs[_0xbe54('0x3e')](_0x5ca75d[_0xbe54('0x3c')]['fields']));_0x357794[_0xbe54('0x3d')]=_0x357794[_0xbe54('0x3d')][_0xbe54('0x3f')]?_0x357794['attributes']:_0x554221[_0xbe54('0x38')];if(!_0x5ca75d[_0xbe54('0x3c')]['hasOwnProperty'](_0xbe54('0x41'))){_0x357794[_0xbe54('0x21')]=qs['limit'](_0x5ca75d[_0xbe54('0x3c')][_0xbe54('0x21')]);_0x357794[_0xbe54('0x24')]=qs[_0xbe54('0x24')](_0x5ca75d[_0xbe54('0x3c')][_0xbe54('0x24')]);}_0x357794[_0xbe54('0x42')]=qs[_0xbe54('0x43')](_0x5ca75d[_0xbe54('0x3c')][_0xbe54('0x43')]);_0x357794[_0xbe54('0x46')]=qs[_0xbe54('0x3a')](_[_0xbe54('0x44')](_0x5ca75d['query'],_0x554221[_0xbe54('0x3a')]));_0x357794[_0xbe54('0x71')]=!![];if(_0x5ca75d[_0xbe54('0x3c')]['filter']){_0x357794[_0xbe54('0x46')]=_['merge'](_0x357794['where'],{'$or':_['map'](_0x357794[_0xbe54('0x3d')],function(_0x5b176f){var _0x257733={};_0x257733[_0x5b176f]={'$like':'%'+_0x5ca75d[_0xbe54('0x3c')][_0xbe54('0x45')]+'%'};return _0x257733;})});}_0x357794=_[_0xbe54('0x47')]({},_0x357794,_0x5ca75d[_0xbe54('0x4d')]);return _0x5c40d4[_0xbe54('0x72')](_0x357794);}})[_0xbe54('0x2a')](respondWithResult(_0x7746b0,null))[_0xbe54('0x4f')](handleError(_0x7746b0,null));};exports[_0xbe54('0x73')]=function(_0xee62a3,_0x5dd74c,_0xb947bf){var _0x40b2b6;var _0x50a9dc;var _0x2fde88;var _0x84f04f=_0xee62a3['params']['id'];csv_results=[];return db[_0xbe54('0x74')]['findAll']({'attributes':['id',_0xbe54('0x30')],'raw':!![],'order':[_0xbe54('0x75')]})['then'](function(_0x5cdf26){_0x40b2b6=_0x5cdf26;var _0x3d0722=_['keys'](db[_0xbe54('0x69')][_0xbe54('0x35')]);return db[_0xbe54('0x6d')]['findAll']({'raw':!![],'attributes':['id',_0xbe54('0x76')]})[_0xbe54('0x2a')](function(_0x53bf04){_0x50a9dc=_0x53bf04;var _0x2fb238=squel[_0xbe54('0x77')]()[_0xbe54('0x3e')](_0x3d0722)[_0xbe54('0x78')]('cm_contacts','c')[_0xbe54('0x46')](_0xbe54('0x79'),_0x84f04f)[_0xbe54('0x46')](_0xbe54('0x7a'))['distinct']();for(var _0x545626=0x0;_0x545626<_0x50a9dc[_0xbe54('0x3f')];_0x545626++){_0x2fb238[_0xbe54('0x7b')](_0xbe54('0x7c')+_0x50a9dc[_0x545626]['id'],_0xbe54('0x7d')+_0x50a9dc[_0x545626][_0xbe54('0x76')]);}for(var _0x545626=0x0;_0x545626<_0x40b2b6['length'];_0x545626++){_0x2fb238['field'](squel[_0xbe54('0x77')]()[_0xbe54('0x7b')]('item')[_0xbe54('0x78')](_0xbe54('0x7e'))[_0xbe54('0x46')]('ItemTypeId\x20=\x20?',_0x40b2b6[_0x545626]['id'])['where'](_0xbe54('0x7f')),_0xbe54('0x80')+_0x40b2b6[_0x545626][_0xbe54('0x30')]);_0x2fb238['field'](squel[_0xbe54('0x77')]()[_0xbe54('0x7b')](_0xbe54('0x81'))['from'](_0xbe54('0x7e'))[_0xbe54('0x46')]('ItemTypeId\x20=\x20?',_0x40b2b6[_0x545626]['id'])['where'](_0xbe54('0x7f')),'description_additionalPhone_'+_0x40b2b6[_0x545626][_0xbe54('0x30')]);}var _0x1aa00d=[];_0x1aa00d[_0xbe54('0x67')](_0x2fb238[_0xbe54('0x82')]());BPromise[_0xbe54('0x68')](_0x1aa00d,handleQuery)['then'](function(_0xf767a1){handleQuery(_0x2fb238[_0xbe54('0x82')]());var _0x564f8b=csv_results[0x0];if(!_['isEmpty'](_0x564f8b)){var _0x3a538c=toCsv(_0x564f8b);var _0x227097=Date[_0xbe54('0x83')]();fs['writeFileSync'](util['format']('/tmp/list_%d_%s.csv',_0x84f04f,_0x227097),_0x3a538c);_0x5dd74c[_0xbe54('0x84')](_0xbe54('0x85'),_0xbe54('0x86')+util[_0xbe54('0x87')](_0xbe54('0x88'),_0x84f04f,_0x227097));_0x5dd74c[_0xbe54('0x84')](_0xbe54('0x89'),_0xbe54('0x8a'));return _0x5dd74c[_0xbe54('0x8b')](util[_0xbe54('0x87')](_0xbe54('0x8c'),_0x84f04f,_0x227097));}else{return _0x5dd74c[_0xbe54('0x1d')](0xcc);}});});});};exports[_0xbe54('0x8d')]=function(_0x2d55b5,_0x50d3ad,_0x4b7637){var _0x1bb2da;delete _0x2d55b5[_0xbe54('0x51')]['id'];return db[_0xbe54('0x34')]['findOne']({'where':{'id':_0x2d55b5['params']['id']}})['then'](handleEntityNotFound(_0x50d3ad,null))[_0xbe54('0x2a')](function(_0x1dc459){if(_0x1dc459){return db[_0xbe54('0x8e')][_0xbe54('0x8f')](function(_0x1104b6){return db[_0xbe54('0x6d')][_0xbe54('0x50')](_0x2d55b5[_0xbe54('0x51')],{'transaction':_0x1104b6})[_0xbe54('0x2a')](function(_0x597716){_0x1bb2da=_0x597716;return _0x1dc459[_0xbe54('0x90')](_0x597716,{'transaction':_0x1104b6});})[_0xbe54('0x2a')](function(){var _0x2234af={'type':db[_0xbe54('0x91')][_0xbe54('0x92')],'transaction':_0x1104b6};switch(_0x2d55b5['body'][_0xbe54('0x37')]){case'text':_0x2234af[_0xbe54('0x37')]=db['Sequelize'][_0xbe54('0x92')];break;case _0xbe54('0x93'):_0x2234af[_0xbe54('0x37')]=db[_0xbe54('0x91')][_0xbe54('0x94')];break;case _0xbe54('0x95'):_0x2234af[_0xbe54('0x37')]=db['Sequelize'][_0xbe54('0x96')];_0x2234af[_0xbe54('0x97')]=![];break;default:}return db[_0xbe54('0x8e')]['queryInterface'][_0xbe54('0x98')](_0xbe54('0x99'),util[_0xbe54('0x87')](_0xbe54('0x9a'),_0x1bb2da['id']),_0x2234af);})[_0xbe54('0x2a')](function(){return _0x1bb2da;});});}})[_0xbe54('0x2a')](respondWithResult(_0x50d3ad,null))[_0xbe54('0x4f')](handleError(_0x50d3ad,null));};exports[_0xbe54('0x9b')]=function(_0x329605,_0x467280,_0x2b8a8c){var _0x4bae7a={};var _0x351bad={};var _0x3a9118;var _0x2b800e;return db[_0xbe54('0x34')][_0xbe54('0x5e')]({'where':{'id':_0x329605['params']['id']}})[_0xbe54('0x2a')](handleEntityNotFound(_0x467280,null))[_0xbe54('0x2a')](function(_0x467872){if(_0x467872){_0x3a9118=_0x467872;_0x351bad['model']=_[_0xbe54('0x39')](db[_0xbe54('0x6d')][_0xbe54('0x35')]);_0x351bad['query']=_[_0xbe54('0x39')](_0x329605[_0xbe54('0x3c')]);_0x351bad[_0xbe54('0x3a')]=_[_0xbe54('0x3b')](_0x351bad[_0xbe54('0x38')],_0x351bad[_0xbe54('0x3c')]);_0x4bae7a[_0xbe54('0x3d')]=_['intersection'](_0x351bad[_0xbe54('0x38')],qs['fields'](_0x329605[_0xbe54('0x3c')][_0xbe54('0x3e')]));_0x4bae7a['attributes']=_0x4bae7a[_0xbe54('0x3d')][_0xbe54('0x3f')]?_0x4bae7a[_0xbe54('0x3d')]:_0x351bad[_0xbe54('0x38')];_0x4bae7a[_0xbe54('0x42')]=qs[_0xbe54('0x43')](_0x329605[_0xbe54('0x3c')][_0xbe54('0x43')]);_0x4bae7a[_0xbe54('0x46')]=qs[_0xbe54('0x3a')](_[_0xbe54('0x44')](_0x329605[_0xbe54('0x3c')],_0x351bad[_0xbe54('0x3a')]));_0x4bae7a[_0xbe54('0x46')]=_[_0xbe54('0x47')](_0x4bae7a[_0xbe54('0x46')],{'$or':[{'ListId':_0x467872['id']},{'ListId':null}]});if(_0x329605['query']['filter']){_0x4bae7a[_0xbe54('0x46')]=_[_0xbe54('0x47')](_0x4bae7a[_0xbe54('0x46')],{'$or':_['map'](_0x4bae7a[_0xbe54('0x3d')],function(_0x1ba319){var _0x3092bd={};_0x3092bd[_0x1ba319]={'$like':'%'+_0x329605['query'][_0xbe54('0x45')]+'%'};return _0x3092bd;})});}_0x4bae7a=_[_0xbe54('0x47')]({},_0x4bae7a,_0x329605[_0xbe54('0x4d')]);return db[_0xbe54('0x6d')][_0xbe54('0x9c')](_0x4bae7a);}})['then'](respondWithResult(_0x467280,null))[_0xbe54('0x4f')](handleError(_0x467280,null));};exports[_0xbe54('0x9d')]=function(_0x3ee1d2,_0x13c834){return db['CmCustomField'][_0xbe54('0x9c')]({'where':{'ListId':null}})[_0xbe54('0x2a')](handleEntityNotFound(_0x13c834,null))[_0xbe54('0x2a')](function(_0x5ccef7){return _0x5ccef7;})[_0xbe54('0x2a')](respondWithResult(_0x13c834,null))[_0xbe54('0x4f')](handleError(_0x13c834,null));};exports[_0xbe54('0x9e')]=function(_0x4f13c1,_0xecfe5a,_0x143af2){return db[_0xbe54('0x34')][_0xbe54('0x4e')]({'where':{'id':_0x4f13c1[_0xbe54('0x4b')]['id']}})[_0xbe54('0x2a')](handleEntityNotFound(_0xecfe5a,null))['then'](function(_0x467130){if(_0x467130){return _0x467130[_0xbe54('0x9e')](_0x4f13c1[_0xbe54('0x51')][_0xbe54('0x63')],_[_0xbe54('0x6a')](_0x4f13c1['body'],[_0xbe54('0x63'),'id'])||{})[_0xbe54('0x9f')](function(_0x338277){for(var _0x34cab4=0x0;_0x34cab4<_0x4f13c1[_0xbe54('0x51')][_0xbe54('0x63')][_0xbe54('0x3f')];_0x34cab4+=0x1){socket[_0xbe54('0xa0')]('userCmList:save',{'UserId':Number(_0x4f13c1[_0xbe54('0x51')]['ids'][_0x34cab4]),'CmListId':Number(_0x4f13c1['params']['id'])});}return _0x338277;});}})[_0xbe54('0x2a')](respondWithResult(_0xecfe5a,null))['catch'](handleError(_0xecfe5a,null));};exports['removeAgents']=function(_0x4b4910,_0xb046aa,_0x181981){return db[_0xbe54('0x34')][_0xbe54('0x4e')]({'where':{'id':_0x4b4910[_0xbe54('0x4b')]['id']}})['then'](handleEntityNotFound(_0xb046aa,null))[_0xbe54('0x2a')](function(_0x91f13){if(_0x91f13){return _0x91f13[_0xbe54('0xa1')](_0x4b4910['query'][_0xbe54('0x63')])[_0xbe54('0x2a')](function(){if(_[_0xbe54('0x66')](_0x4b4910[_0xbe54('0x3c')]['ids'])){for(var _0xe29ea9=0x0;_0xe29ea9<_0x4b4910[_0xbe54('0x3c')][_0xbe54('0x63')][_0xbe54('0x3f')];_0xe29ea9+=0x1){socket[_0xbe54('0xa0')](_0xbe54('0xa2'),{'UserId':Number(_0x4b4910[_0xbe54('0x3c')]['ids'][_0xe29ea9]),'CmListId':Number(_0x4b4910[_0xbe54('0x4b')]['id'])});}}else{socket[_0xbe54('0xa0')]('userCmList:remove',{'UserId':Number(_0x4b4910[_0xbe54('0x3c')][_0xbe54('0x63')]),'CmListId':Number(_0x4b4910[_0xbe54('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0xb046aa,null))[_0xbe54('0x4f')](handleError(_0xb046aa,null));};exports[_0xbe54('0xa3')]=function(_0x54d333,_0x5d7b42,_0x40de5e){var _0x3203ea={};var _0x4eefba={};var _0x1146d6;var _0x5c105c;return db[_0xbe54('0x34')]['findOne']({'where':{'id':_0x54d333[_0xbe54('0x4b')]['id']}})[_0xbe54('0x2a')](handleEntityNotFound(_0x5d7b42,null))[_0xbe54('0x2a')](function(_0x1e9d8b){if(_0x1e9d8b){_0x1146d6=_0x1e9d8b;_0x4eefba[_0xbe54('0x38')]=_['keys'](db['User'][_0xbe54('0x35')]);_0x4eefba['query']=_['keys'](_0x54d333[_0xbe54('0x3c')]);_0x4eefba[_0xbe54('0x3a')]=_[_0xbe54('0x3b')](_0x4eefba['model'],_0x4eefba[_0xbe54('0x3c')]);_0x3203ea[_0xbe54('0x3d')]=_[_0xbe54('0x3b')](_0x4eefba[_0xbe54('0x38')],qs[_0xbe54('0x3e')](_0x54d333[_0xbe54('0x3c')]['fields']));_0x3203ea[_0xbe54('0x3d')]=_0x3203ea[_0xbe54('0x3d')][_0xbe54('0x3f')]?_0x3203ea[_0xbe54('0x3d')]:_0x4eefba[_0xbe54('0x38')];_0x3203ea[_0xbe54('0x42')]=qs[_0xbe54('0x43')](_0x54d333[_0xbe54('0x3c')][_0xbe54('0x43')]);_0x3203ea[_0xbe54('0x46')]=qs[_0xbe54('0x3a')](_['pick'](_0x54d333['query'],_0x4eefba['filters']));if(_0x54d333['query']['filter']){_0x3203ea[_0xbe54('0x46')]=_[_0xbe54('0x47')](_0x3203ea[_0xbe54('0x46')],{'$or':_[_0xbe54('0x33')](_0x3203ea[_0xbe54('0x3d')],function(_0x57d05a){var _0x798f55={};_0x798f55[_0x57d05a]={'$like':'%'+_0x54d333[_0xbe54('0x3c')][_0xbe54('0x45')]+'%'};return _0x798f55;})});}_0x3203ea=_[_0xbe54('0x47')]({},_0x3203ea,_0x54d333[_0xbe54('0x4d')]);return _0x1146d6[_0xbe54('0xa3')](_0x3203ea);}})[_0xbe54('0x2a')](function(_0x2a6a85){if(_0x2a6a85){_0x5c105c=_0x2a6a85[_0xbe54('0x3f')];if(!_0x54d333[_0xbe54('0x3c')][_0xbe54('0x40')](_0xbe54('0x41'))){_0x3203ea['limit']=qs[_0xbe54('0x21')](_0x54d333['query'][_0xbe54('0x21')]);_0x3203ea['offset']=qs[_0xbe54('0x24')](_0x54d333[_0xbe54('0x3c')]['offset']);}return _0x1146d6['getAgents'](_0x3203ea);}})['then'](function(_0x36dfba){if(_0x36dfba){return _0x36dfba?{'count':_0x5c105c,'rows':_0x36dfba}:null;}})[_0xbe54('0x2a')](respondWithResult(_0x5d7b42,null))['catch'](handleError(_0x5d7b42,null));};function handleQuery(_0x42586e){logger[_0xbe54('0xa4')](_0x42586e);return db['sequelize'][_0xbe54('0x3c')](_0x42586e)['spread'](function(_0x2d0a2b){csv_results[_0xbe54('0x67')](_0x2d0a2b);})[_0xbe54('0x4f')](function(_0x429e3a){logger[_0xbe54('0x2e')](_0x429e3a[_0xbe54('0xa5')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 3b70f2b..f26b3c5 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe14b,0x93));var _0xbe14=function(_0x444700,_0x522fa1){_0x444700=_0x444700-0x0;var _0x5d1317=_0xe14b[_0x444700];return _0x5d1317;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x458775,_0x523411){var _0x48eb06=function(_0x98a4ac){while(--_0x98a4ac){_0x458775['push'](_0x458775['shift']());}};_0x48eb06(++_0x523411);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index d7ee6cf..5af586f 100644 --- a/server/api/cmList/cmList.model.js +++ b/server/api/cmList/cmList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd28=['rimraf','./cmList.attributes','exports','define','util','../../config/logger','moment','request-promise','path'];(function(_0x3e5c2d,_0x230035){var _0xe40ca5=function(_0x527a02){while(--_0x527a02){_0x3e5c2d['push'](_0x3e5c2d['shift']());}};_0xe40ca5(++_0x230035);}(_0xfd28,0x148));var _0x8fd2=function(_0x35fabd,_0x825452){_0x35fabd=_0x35fabd-0x0;var _0x61a8ee=_0xfd28[_0x35fabd];return _0x61a8ee;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var logger=require(_0x8fd2('0x1'))('api');var moment=require(_0x8fd2('0x2'));var BPromise=require('bluebird');var rp=require(_0x8fd2('0x3'));var fs=require('fs');var path=require(_0x8fd2('0x4'));var rimraf=require(_0x8fd2('0x5'));var config=require('../../config/environment');var attributes=require(_0x8fd2('0x6'));module[_0x8fd2('0x7')]=function(_0x2ee87e,_0x36178a){return _0x2ee87e[_0x8fd2('0x8')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f0d=['./cmList.attributes','define','CmList','cm_lists','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x199b5e,_0x3acd0d){_0x199b5e=_0x199b5e-0x0;var _0x7370d0=_0x6f0d[_0x199b5e];return _0x7370d0;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var fs=require('fs');var path=require(_0xd6f0('0x5'));var rimraf=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var attributes=require(_0xd6f0('0x8'));module['exports']=function(_0x2d2ce6,_0x4a8b0c){return _0x2d2ce6[_0xd6f0('0x9')](_0xd6f0('0xa'),attributes,{'tableName':_0xd6f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index a0b1b67..5bdb713 100644 --- a/server/api/cmList/cmList.rpc.js +++ b/server/api/cmList/cmList.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb5f=['CmList,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2c4bb3,_0x1e2c8e){var _0x6d826e=function(_0x3269aa){while(--_0x3269aa){_0x2c4bb3['push'](_0x2c4bb3['shift']());}};_0x6d826e(++_0x1e2c8e);}(_0xfb5f,0x8f));var _0xffb5=function(_0x22e29e,_0x156ed3){_0x22e29e=_0x22e29e-0x0;var _0x3064ac=_0xfb5f[_0x22e29e];return _0x3064ac;};'use strict';var _=require(_0xffb5('0x0'));var util=require('util');var moment=require(_0xffb5('0x1'));var BPromise=require(_0xffb5('0x2'));var rs=require(_0xffb5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffb5('0x4'))['db'];var utils=require(_0xffb5('0x5'));var logger=require(_0xffb5('0x6'))(_0xffb5('0x7'));var config=require(_0xffb5('0x8'));var jayson=require(_0xffb5('0x9'));var client=jayson[_0xffb5('0xa')][_0xffb5('0xb')]({'port':0x232a});config[_0xffb5('0xc')]=_[_0xffb5('0xd')](config[_0xffb5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xffb5('0xe'))(new Redis(config['redis']));require(_0xffb5('0xf'))[_0xffb5('0x10')](socket);function respondWithRpcPromise(_0x49e42a,_0x5dac95,_0x19cb8e){return new BPromise(function(_0x24c89c,_0x38ad7d){return client[_0xffb5('0x11')](_0x49e42a,_0x19cb8e)['then'](function(_0x58ca6a){logger[_0xffb5('0x12')]('CmList,\x20%s,\x20%s',_0x5dac95,_0xffb5('0x13'));logger[_0xffb5('0x14')](_0xffb5('0x15'),_0x5dac95,_0xffb5('0x13'),JSON['stringify'](_0x58ca6a));if(_0x58ca6a[_0xffb5('0x16')]){if(_0x58ca6a[_0xffb5('0x16')][_0xffb5('0x17')]===0x1f4){logger[_0xffb5('0x16')]('CmList,\x20%s,\x20%s',_0x5dac95,_0x58ca6a[_0xffb5('0x16')]['message']);return _0x38ad7d(_0x58ca6a['error'][_0xffb5('0x18')]);}logger[_0xffb5('0x16')](_0xffb5('0x19'),_0x5dac95,_0x58ca6a[_0xffb5('0x16')][_0xffb5('0x18')]);return _0x24c89c(_0x58ca6a['error'][_0xffb5('0x18')]);}else{logger[_0xffb5('0x12')](_0xffb5('0x19'),_0x5dac95,'request\x20sent');_0x24c89c(_0x58ca6a[_0xffb5('0x1a')]['message']);}})[_0xffb5('0x1b')](function(_0x26fd02){logger[_0xffb5('0x16')](_0xffb5('0x19'),_0x5dac95,_0x26fd02);_0x38ad7d(_0x26fd02);});});} \ No newline at end of file +var _0x5ec4=['message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmList,\x20%s,\x20%s'];(function(_0xacabb,_0x1fbcd9){var _0x2b4a14=function(_0x3a2353){while(--_0x3a2353){_0xacabb['push'](_0xacabb['shift']());}};_0x2b4a14(++_0x1fbcd9);}(_0x5ec4,0x142));var _0x45ec=function(_0x293fbc,_0x5c8873){_0x293fbc=_0x293fbc-0x0;var _0x9dd1ea=_0x5ec4[_0x293fbc];return _0x9dd1ea;};'use strict';var _=require(_0x45ec('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x45ec('0x1'));var rs=require(_0x45ec('0x2'));var fs=require('fs');var Redis=require(_0x45ec('0x3'));var db=require(_0x45ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x45ec('0x5'))(_0x45ec('0x6'));var config=require(_0x45ec('0x7'));var jayson=require(_0x45ec('0x8'));var client=jayson[_0x45ec('0x9')][_0x45ec('0xa')]({'port':0x232a});config[_0x45ec('0xb')]=_[_0x45ec('0xc')](config['redis'],{'host':_0x45ec('0xd'),'port':0x18eb});var socket=require(_0x45ec('0xe'))(new Redis(config[_0x45ec('0xb')]));require(_0x45ec('0xf'))[_0x45ec('0x10')](socket);function respondWithRpcPromise(_0x57e8e2,_0x441c41,_0x4840ac){return new BPromise(function(_0x36d5be,_0x548606){return client[_0x45ec('0x11')](_0x57e8e2,_0x4840ac)[_0x45ec('0x12')](function(_0x71ddb2){logger['info']('CmList,\x20%s,\x20%s',_0x441c41,'request\x20sent');logger[_0x45ec('0x13')](_0x45ec('0x14'),_0x441c41,_0x45ec('0x15'),JSON[_0x45ec('0x16')](_0x71ddb2));if(_0x71ddb2['error']){if(_0x71ddb2[_0x45ec('0x17')][_0x45ec('0x18')]===0x1f4){logger[_0x45ec('0x17')](_0x45ec('0x19'),_0x441c41,_0x71ddb2[_0x45ec('0x17')][_0x45ec('0x1a')]);return _0x548606(_0x71ddb2[_0x45ec('0x17')][_0x45ec('0x1a')]);}logger[_0x45ec('0x17')]('CmList,\x20%s,\x20%s',_0x441c41,_0x71ddb2['error'][_0x45ec('0x1a')]);return _0x36d5be(_0x71ddb2[_0x45ec('0x17')][_0x45ec('0x1a')]);}else{logger[_0x45ec('0x1b')](_0x45ec('0x19'),_0x441c41,_0x45ec('0x15'));_0x36d5be(_0x71ddb2['result']['message']);}})[_0x45ec('0x1c')](function(_0x6e2bbf){logger[_0x45ec('0x17')](_0x45ec('0x19'),_0x441c41,_0x6e2bbf);_0x548606(_0x6e2bbf);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 1a3e302..bcb48fa 100644 --- a/server/api/cmList/cmList.socket.js +++ b/server/api/cmList/cmList.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1413=['update','removeListener','register','length','cmList:','./cmList.events','save','remove'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1413,0x145));var _0x3141=function(_0x5454f3,_0x25585e){_0x5454f3=_0x5454f3-0x0;var _0x402fc1=_0x1413[_0x5454f3];return _0x402fc1;};'use strict';var CmListEvents=require(_0x3141('0x0'));var events=[_0x3141('0x1'),_0x3141('0x2'),_0x3141('0x3')];function createListener(_0x2a2bf6,_0x4f973){return function(_0x3c067c){_0x4f973['emit'](_0x2a2bf6,_0x3c067c);};}function removeListener(_0x2b3277,_0x4e9a61){return function(){CmListEvents[_0x3141('0x4')](_0x2b3277,_0x4e9a61);};}exports[_0x3141('0x5')]=function(_0x53b555){for(var _0x31ea05=0x0,_0x4b8161=events[_0x3141('0x6')];_0x31ea05<_0x4b8161;_0x31ea05++){var _0x2aac97=events[_0x31ea05];var _0x4cd48c=createListener(_0x3141('0x7')+_0x2aac97,_0x53b555);CmListEvents['on'](_0x2aac97,_0x4cd48c);}}; \ No newline at end of file +var _0x2882=['./cmList.events','remove','update','register','cmList:'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x2882,0x1ea));var _0x2288=function(_0x562a3e,_0x291dbd){_0x562a3e=_0x562a3e-0x0;var _0x278ee8=_0x2882[_0x562a3e];return _0x278ee8;};'use strict';var CmListEvents=require(_0x2288('0x0'));var events=['save',_0x2288('0x1'),_0x2288('0x2')];function createListener(_0x6b5549,_0x1ff1cb){return function(_0xa70bd4){_0x1ff1cb['emit'](_0x6b5549,_0xa70bd4);};}function removeListener(_0x473694,_0x3cebab){return function(){CmListEvents['removeListener'](_0x473694,_0x3cebab);};}exports[_0x2288('0x3')]=function(_0x17f200){for(var _0x11be35=0x0,_0x5358b3=events['length'];_0x11be35<_0x5358b3;_0x11be35++){var _0x2c2667=events[_0x11be35];var _0x66661e=createListener(_0x2288('0x4')+_0x2c2667,_0x17f200);CmListEvents['on'](_0x2c2667,_0x66661e);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 8434563..0b0f14a 100644 --- a/server/api/cmList/index.js +++ b/server/api/cmList/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15ab=['get','index','/describe','isAuthenticated','/global_fields','getGlobalCustomFields','/:id','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller'];(function(_0x2d0ef5,_0x5621a4){var _0x550979=function(_0x23d4c7){while(--_0x23d4c7){_0x2d0ef5['push'](_0x2d0ef5['shift']());}};_0x550979(++_0x5621a4);}(_0x15ab,0xda));var _0xb15a=function(_0x3c7044,_0x5d7f80){_0x3c7044=_0x3c7044-0x0;var _0x34333b=_0x15ab[_0x3c7044];return _0x34333b;};'use strict';var multer=require(_0xb15a('0x0'));var util=require(_0xb15a('0x1'));var path=require(_0xb15a('0x2'));var timeout=require(_0xb15a('0x3'));var express=require(_0xb15a('0x4'));var router=express[_0xb15a('0x5')]();var fs_extra=require(_0xb15a('0x6'));var auth=require(_0xb15a('0x7'));var interaction=require(_0xb15a('0x8'));var config=require('../../config/environment');var controller=require(_0xb15a('0x9'));router[_0xb15a('0xa')]('/',auth['isAuthenticated'](),controller[_0xb15a('0xb')]);router['get'](_0xb15a('0xc'),auth[_0xb15a('0xd')](),controller['describe']);router[_0xb15a('0xa')](_0xb15a('0xe'),auth[_0xb15a('0xd')](),controller[_0xb15a('0xf')]);router[_0xb15a('0xa')](_0xb15a('0x10'),auth[_0xb15a('0xd')](),controller['show']);router[_0xb15a('0xa')](_0xb15a('0x11'),auth[_0xb15a('0xd')](),controller[_0xb15a('0x12')]);router[_0xb15a('0xa')](_0xb15a('0x13'),auth['isAuthenticated'](),controller['getContacts']);router['get'](_0xb15a('0x14'),auth[_0xb15a('0xd')](),controller[_0xb15a('0x15')]);router[_0xb15a('0xa')](_0xb15a('0x16'),auth['isAuthenticated'](),controller[_0xb15a('0x17')]);router[_0xb15a('0xa')](_0xb15a('0x18'),auth[_0xb15a('0xd')](),controller[_0xb15a('0x19')]);router[_0xb15a('0x1a')]('/',auth[_0xb15a('0xd')](),controller[_0xb15a('0x1b')]);router[_0xb15a('0x1a')](_0xb15a('0x11'),auth[_0xb15a('0xd')](),controller[_0xb15a('0x1c')]);router[_0xb15a('0x1a')](_0xb15a('0x13'),auth[_0xb15a('0xd')](),controller[_0xb15a('0x1d')]);router[_0xb15a('0x1a')](_0xb15a('0x16'),auth['isAuthenticated'](),controller[_0xb15a('0x1e')]);router[_0xb15a('0x1a')]('/:id/users',auth[_0xb15a('0xd')](),controller[_0xb15a('0x1f')]);router[_0xb15a('0x20')](_0xb15a('0x10'),auth[_0xb15a('0xd')](),controller[_0xb15a('0x21')]);router[_0xb15a('0x22')](_0xb15a('0x10'),auth[_0xb15a('0xd')](),controller[_0xb15a('0x23')]);router['delete'](_0xb15a('0x11'),auth[_0xb15a('0xd')](),controller[_0xb15a('0x24')]);router[_0xb15a('0x22')]('/:id/users',auth[_0xb15a('0xd')](),controller['removeAgents']);module[_0xb15a('0x25')]=router; \ No newline at end of file +var _0x929a=['getDispositions','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','create','post','/:id/dispositions','addDisposition','/:id/contacts','addCustomField','/:id/users','addAgents','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/global_fields','getGlobalCustomFields'];(function(_0x46dc29,_0x18c45a){var _0x4bbb8d=function(_0x2bc823){while(--_0x2bc823){_0x46dc29['push'](_0x46dc29['shift']());}};_0x4bbb8d(++_0x18c45a);}(_0x929a,0x10a));var _0xa929=function(_0x294f24,_0x2e423b){_0x294f24=_0x294f24-0x0;var _0x3b7342=_0x929a[_0x294f24];return _0x3b7342;};'use strict';var multer=require(_0xa929('0x0'));var util=require(_0xa929('0x1'));var path=require(_0xa929('0x2'));var timeout=require(_0xa929('0x3'));var express=require(_0xa929('0x4'));var router=express[_0xa929('0x5')]();var fs_extra=require(_0xa929('0x6'));var auth=require(_0xa929('0x7'));var interaction=require(_0xa929('0x8'));var config=require(_0xa929('0x9'));var controller=require('./cmList.controller');router[_0xa929('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa929('0xa')]('/describe',auth[_0xa929('0xb')](),controller['describe']);router['get'](_0xa929('0xc'),auth[_0xa929('0xb')](),controller[_0xa929('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa929('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xa929('0xe')]);router[_0xa929('0xa')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0xa929('0xa')](_0xa929('0xf'),auth[_0xa929('0xb')](),controller[_0xa929('0x10')]);router[_0xa929('0xa')](_0xa929('0x11'),auth['isAuthenticated'](),controller[_0xa929('0x12')]);router[_0xa929('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0xa929('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa929('0x14')]);router[_0xa929('0x15')](_0xa929('0x16'),auth[_0xa929('0xb')](),controller[_0xa929('0x17')]);router[_0xa929('0x15')](_0xa929('0x18'),auth[_0xa929('0xb')](),controller['addContacts']);router[_0xa929('0x15')](_0xa929('0x11'),auth[_0xa929('0xb')](),controller[_0xa929('0x19')]);router[_0xa929('0x15')](_0xa929('0x1a'),auth[_0xa929('0xb')](),controller[_0xa929('0x1b')]);router['put'](_0xa929('0x1c'),auth[_0xa929('0xb')](),controller[_0xa929('0x1d')]);router[_0xa929('0x1e')](_0xa929('0x1c'),auth[_0xa929('0xb')](),controller[_0xa929('0x1f')]);router[_0xa929('0x1e')]('/:id/dispositions',auth[_0xa929('0xb')](),controller[_0xa929('0x20')]);router['delete'](_0xa929('0x1a'),auth[_0xa929('0xb')](),controller[_0xa929('0x21')]);module[_0xa929('0x22')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 0549d96..d42bb68 100644 --- a/server/api/condition/condition.attributes.js +++ b/server/api/condition/condition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a2b=['field','STRING','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x31bb79,_0x48154b){var _0x29c4b7=function(_0x337a84){while(--_0x337a84){_0x31bb79['push'](_0x31bb79['shift']());}};_0x29c4b7(++_0x48154b);}(_0x8a2b,0x1ac));var _0xb8a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a2b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb8a2('0x0'));module[_0xb8a2('0x1')]={'name':{'type':Sequelize[_0xb8a2('0x2')],'get':function(_0x42e152){return this[_0xb8a2('0x3')](_0xb8a2('0x4'));}},'field':{'type':Sequelize[_0xb8a2('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0xb8a2('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xcaa8=['field','STRING','sequelize','exports','getDataValue'];(function(_0x12172e,_0x3c9875){var _0x162921=function(_0x12f0bd){while(--_0x12f0bd){_0x12172e['push'](_0x12172e['shift']());}};_0x162921(++_0x3c9875);}(_0xcaa8,0x1bf));var _0x8caa=function(_0x1afabd,_0x574f5f){_0x1afabd=_0x1afabd-0x0;var _0x19ece1=_0xcaa8[_0x1afabd];return _0x19ece1;};'use strict';var Sequelize=require(_0x8caa('0x0'));module[_0x8caa('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x409356){return this[_0x8caa('0x2')](_0x8caa('0x3'));}},'field':{'type':Sequelize[_0x8caa('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x8caa('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 26c3f82..3ebd158 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x25f966,_0xd7b92a){var _0x3e0ff7=function(_0x435ffa){while(--_0x435ffa){_0x25f966['push'](_0x25f966['shift']());}};_0x3e0ff7(++_0xd7b92a);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x205b78,_0x4e91c0){var _0x48b645=function(_0x5018c9){while(--_0x5018c9){_0x205b78['push'](_0x205b78['shift']());}};_0x48b645(++_0x4e91c0);}(_0x7a54,0x106));var _0x47a5=function(_0x6e9d0e,_0x165ee1){_0x6e9d0e=_0x6e9d0e-0x0;var _0x5b8d48=_0x7a54[_0x6e9d0e];return _0x5b8d48;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 21e9b9c..876d87e 100644 --- a/server/api/condition/condition.model.js +++ b/server/api/condition/condition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff2d=['define','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./condition.attributes','exports'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0xff2d,0x84));var _0xdff2=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xff2d[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0xdff2('0x0'));var util=require(_0xdff2('0x1'));var logger=require(_0xdff2('0x2'))(_0xdff2('0x3'));var moment=require(_0xdff2('0x4'));var BPromise=require(_0xdff2('0x5'));var rp=require(_0xdff2('0x6'));var fs=require('fs');var path=require(_0xdff2('0x7'));var rimraf=require('rimraf');var config=require(_0xdff2('0x8'));var attributes=require(_0xdff2('0x9'));module[_0xdff2('0xa')]=function(_0x1f4233,_0x51e4b0){return _0x1f4233[_0xdff2('0xb')]('Condition',attributes,{'tableName':_0xdff2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb47=['define','Condition','util','api','bluebird','request-promise','rimraf','./condition.attributes'];(function(_0xe59443,_0x1c7fbc){var _0x155142=function(_0x147ab1){while(--_0x147ab1){_0xe59443['push'](_0xe59443['shift']());}};_0x155142(++_0x1c7fbc);}(_0xdb47,0xd2));var _0x7db4=function(_0x3228ee,_0x36e61e){_0x3228ee=_0x3228ee-0x0;var _0x237456=_0xdb47[_0x3228ee];return _0x237456;};'use strict';var _=require('lodash');var util=require(_0x7db4('0x0'));var logger=require('../../config/logger')(_0x7db4('0x1'));var moment=require('moment');var BPromise=require(_0x7db4('0x2'));var rp=require(_0x7db4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7db4('0x4'));var config=require('../../config/environment');var attributes=require(_0x7db4('0x5'));module['exports']=function(_0x2de4ab,_0x139a27){return _0x2de4ab[_0x7db4('0x6')](_0x7db4('0x7'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 127de05..4d7585a 100644 --- a/server/api/condition/condition.rpc.js +++ b/server/api/condition/condition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x765f=['message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x2e2992,_0x44c1a9){var _0x53cdf4=function(_0x3099b8){while(--_0x3099b8){_0x2e2992['push'](_0x2e2992['shift']());}};_0x53cdf4(++_0x44c1a9);}(_0x765f,0x1a5));var _0xf765=function(_0x5eec9b,_0x48c63b){_0x5eec9b=_0x5eec9b-0x0;var _0x2ddac2=_0x765f[_0x5eec9b];return _0x2ddac2;};'use strict';var _=require(_0xf765('0x0'));var util=require(_0xf765('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf765('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf765('0x3'))['db'];var utils=require(_0xf765('0x4'));var logger=require(_0xf765('0x5'))('rpc');var config=require(_0xf765('0x6'));var jayson=require(_0xf765('0x7'));var client=jayson[_0xf765('0x8')][_0xf765('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e71c3,_0x2d8d74,_0x334f5b){return new BPromise(function(_0x4d0bf8,_0x4934a1){return client[_0xf765('0xa')](_0x2e71c3,_0x334f5b)[_0xf765('0xb')](function(_0x1f13b2){logger[_0xf765('0xc')](_0xf765('0xd'),_0x2d8d74,'request\x20sent');logger[_0xf765('0xe')](_0xf765('0xf'),_0x2d8d74,_0xf765('0x10'),JSON['stringify'](_0x1f13b2));if(_0x1f13b2[_0xf765('0x11')]){if(_0x1f13b2['error'][_0xf765('0x12')]===0x1f4){logger[_0xf765('0x11')](_0xf765('0xd'),_0x2d8d74,_0x1f13b2[_0xf765('0x11')]['message']);return _0x4934a1(_0x1f13b2['error'][_0xf765('0x13')]);}logger[_0xf765('0x11')]('Condition,\x20%s,\x20%s',_0x2d8d74,_0x1f13b2[_0xf765('0x11')]['message']);return _0x4d0bf8(_0x1f13b2['error']['message']);}else{logger['info'](_0xf765('0xd'),_0x2d8d74,_0xf765('0x10'));_0x4d0bf8(_0x1f13b2[_0xf765('0x14')][_0xf765('0x13')]);}})[_0xf765('0x15')](function(_0x332109){logger['error'](_0xf765('0xd'),_0x2d8d74,_0x332109);_0x4934a1(_0x332109);});});} \ No newline at end of file +var _0x2c98=['code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Condition,\x20%s,\x20%s','debug','request\x20sent','error'];(function(_0x19691f,_0x159737){var _0x5677b6=function(_0x41a9b2){while(--_0x41a9b2){_0x19691f['push'](_0x19691f['shift']());}};_0x5677b6(++_0x159737);}(_0x2c98,0xa4));var _0x82c9=function(_0x3a3154,_0x538387){_0x3a3154=_0x3a3154-0x0;var _0x2f328c=_0x2c98[_0x3a3154];return _0x2f328c;};'use strict';var _=require(_0x82c9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x82c9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x82c9('0x2'));var db=require(_0x82c9('0x3'))['db'];var utils=require(_0x82c9('0x4'));var logger=require(_0x82c9('0x5'))(_0x82c9('0x6'));var config=require(_0x82c9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x82c9('0x8')][_0x82c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4004e2,_0x23cd6b,_0x1c6562){return new BPromise(function(_0x320176,_0x2b8f6c){return client[_0x82c9('0xa')](_0x4004e2,_0x1c6562)['then'](function(_0x5e8287){logger[_0x82c9('0xb')](_0x82c9('0xc'),_0x23cd6b,'request\x20sent');logger[_0x82c9('0xd')]('Condition,\x20%s,\x20%s,\x20%s',_0x23cd6b,_0x82c9('0xe'),JSON['stringify'](_0x5e8287));if(_0x5e8287['error']){if(_0x5e8287[_0x82c9('0xf')][_0x82c9('0x10')]===0x1f4){logger['error'](_0x82c9('0xc'),_0x23cd6b,_0x5e8287[_0x82c9('0xf')][_0x82c9('0x11')]);return _0x2b8f6c(_0x5e8287[_0x82c9('0xf')][_0x82c9('0x11')]);}logger[_0x82c9('0xf')](_0x82c9('0xc'),_0x23cd6b,_0x5e8287[_0x82c9('0xf')][_0x82c9('0x11')]);return _0x320176(_0x5e8287['error'][_0x82c9('0x11')]);}else{logger['info'](_0x82c9('0xc'),_0x23cd6b,_0x82c9('0xe'));_0x320176(_0x5e8287[_0x82c9('0x12')][_0x82c9('0x11')]);}})[_0x82c9('0x13')](function(_0x20d631){logger[_0x82c9('0xf')](_0x82c9('0xc'),_0x23cd6b,_0x20d631);_0x2b8f6c(_0x20d631);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 51d965f..b537519 100644 --- a/server/api/condition/index.js +++ b/server/api/condition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2738=['fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','delete','/:id','exports','multer','util','path','express','Router'];(function(_0x3c5d9b,_0x16f3f1){var _0x557a6e=function(_0x28276c){while(--_0x28276c){_0x3c5d9b['push'](_0x3c5d9b['shift']());}};_0x557a6e(++_0x16f3f1);}(_0x2738,0xbf));var _0x8273=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x2738[_0x5a776b];return _0xbbef59;};'use strict';var multer=require(_0x8273('0x0'));var util=require(_0x8273('0x1'));var path=require(_0x8273('0x2'));var timeout=require('connect-timeout');var express=require(_0x8273('0x3'));var router=express[_0x8273('0x4')]();var fs_extra=require(_0x8273('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8273('0x6'));var config=require(_0x8273('0x7'));var controller=require(_0x8273('0x8'));router[_0x8273('0x9')]('/:id',auth[_0x8273('0xa')](),controller['update']);router[_0x8273('0xb')](_0x8273('0xc'),auth[_0x8273('0xa')](),controller['destroy']);module[_0x8273('0xd')]=router; \ No newline at end of file +var _0xace6=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0xace6,0x7b));var _0x6ace=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xace6[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x6ace('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ace('0x1'));var express=require(_0x6ace('0x2'));var router=express[_0x6ace('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ace('0x4'));var interaction=require(_0x6ace('0x5'));var config=require(_0x6ace('0x6'));var controller=require(_0x6ace('0x7'));router['put'](_0x6ace('0x8'),auth[_0x6ace('0x9')](),controller[_0x6ace('0xa')]);router[_0x6ace('0xb')](_0x6ace('0x8'),auth[_0x6ace('0x9')](),controller[_0x6ace('0xc')]);module[_0x6ace('0xd')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 4bc0082..750dbcd 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb235=['exports','name','INTEGER','STRING','sequelize'];(function(_0x473aa1,_0x23936d){var _0x16475d=function(_0x47c7f3){while(--_0x47c7f3){_0x473aa1['push'](_0x473aa1['shift']());}};_0x16475d(++_0x23936d);}(_0xb235,0x1c1));var _0x5b23=function(_0x50b57f,_0x2f01e9){_0x50b57f=_0x50b57f-0x0;var _0x4386fd=_0xb235[_0x50b57f];return _0x4386fd;};'use strict';var Sequelize=require(_0x5b23('0x0'));module[_0x5b23('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5b23('0x2')},'OrderBy':{'type':Sequelize[_0x5b23('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x5b23('0x4')],'allowNull':!![]}}; \ No newline at end of file +var _0xee25=['sequelize','exports','STRING','name','INTEGER'];(function(_0x48c7d0,_0xfe90e5){var _0x29a11e=function(_0x2f22df){while(--_0x2f22df){_0x48c7d0['push'](_0x48c7d0['shift']());}};_0x29a11e(++_0xfe90e5);}(_0xee25,0x1ea));var _0x5ee2=function(_0x1b6566,_0x13fd8a){_0x1b6566=_0x1b6566-0x0;var _0x2aa69e=_0xee25[_0x1b6566];return _0x2aa69e;};'use strict';var Sequelize=require(_0x5ee2('0x0'));module[_0x5ee2('0x1')]={'name':{'type':Sequelize[_0x5ee2('0x2')],'allowNull':![],'unique':_0x5ee2('0x3')},'OrderBy':{'type':Sequelize[_0x5ee2('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x5ee2('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 7534067..65e2d35 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x955f=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','get','ContactItemTypes','UserProfileResource','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','create','user','catch'];(function(_0x32f26d,_0x2c0b5d){var _0x5d9ddc=function(_0x1f0e26){while(--_0x1f0e26){_0x32f26d['push'](_0x32f26d['shift']());}};_0x5d9ddc(++_0x2c0b5d);}(_0x955f,0x1eb));var _0xf955=function(_0x5c72f2,_0x4f24d6){_0x5c72f2=_0x5c72f2-0x0;var _0x2b0e0d=_0x955f[_0x5c72f2];return _0x2b0e0d;};'use strict';var emlformat=require(_0xf955('0x0'));var rimraf=require(_0xf955('0x1'));var zipdir=require(_0xf955('0x2'));var jsonpatch=require(_0xf955('0x3'));var rp=require(_0xf955('0x4'));var moment=require('moment');var BPromise=require(_0xf955('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf955('0x6'));var sox=require('sox');var csv=require(_0xf955('0x7'));var ejs=require(_0xf955('0x8'));var fs=require('fs');var fs_extra=require(_0xf955('0x9'));var _=require('lodash');var squel=require(_0xf955('0xa'));var crypto=require(_0xf955('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf955('0xc'));var toCsv=require(_0xf955('0x7'));var querystring=require(_0xf955('0xd'));var Papa=require(_0xf955('0xe'));var Redis=require(_0xf955('0xf'));var authService=require(_0xf955('0x10'));var qs=require(_0xf955('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf955('0x12'));var logger=require('../../config/logger')(_0xf955('0x13'));var utils=require(_0xf955('0x14'));var config=require(_0xf955('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf955('0x16'))['db'];function respondWithStatusCode(_0x542347,_0x23e0c6){_0x23e0c6=_0x23e0c6||0xcc;return function(_0x50d9a9){if(_0x50d9a9){return _0x542347[_0xf955('0x17')](_0x23e0c6);}return _0x542347[_0xf955('0x18')](_0x23e0c6)[_0xf955('0x19')]();};}function respondWithResult(_0x109bc5,_0x2080c4){_0x2080c4=_0x2080c4||0xc8;return function(_0x341b8c){if(_0x341b8c){return _0x109bc5[_0xf955('0x18')](_0x2080c4)[_0xf955('0x1a')](_0x341b8c);}};}function respondWithFilteredResult(_0x3c6af7,_0x24e75c){return function(_0x5350e4){if(_0x5350e4){var _0xc29b35=typeof _0x24e75c['offset']===_0xf955('0x1b')&&typeof _0x24e75c[_0xf955('0x1c')]===_0xf955('0x1b');var _0x15c07c=_0x5350e4['count'];var _0x5ac6cb=_0xc29b35?0x0:_0x24e75c[_0xf955('0x1d')];var _0xe6de5c=_0xc29b35?_0x5350e4[_0xf955('0x1e')]:_0x24e75c['offset']+_0x24e75c[_0xf955('0x1c')];var _0x3576fa;if(_0xe6de5c>=_0x15c07c){_0xe6de5c=_0x15c07c;_0x3576fa=0xc8;}else{_0x3576fa=0xce;}_0x3c6af7[_0xf955('0x18')](_0x3576fa);return _0x3c6af7[_0xf955('0x1f')](_0xf955('0x20'),_0x5ac6cb+'-'+_0xe6de5c+'/'+_0x15c07c)['json'](_0x5350e4);}return null;};}function patchUpdates(_0x17d86a){return function(_0x3dbbe8){try{jsonpatch[_0xf955('0x21')](_0x3dbbe8,_0x17d86a,!![]);}catch(_0x488d04){return BPromise[_0xf955('0x22')](_0x488d04);}return _0x3dbbe8['save']();};}function saveUpdates(_0x21ae24,_0x43b078){return function(_0x37143d){if(_0x37143d){return _0x37143d[_0xf955('0x23')](_0x21ae24)[_0xf955('0x24')](function(_0x565641){return _0x565641;});}return null;};}function removeEntity(_0x25f4f2,_0x5fab1c){return function(_0x3585c7){if(_0x3585c7){return _0x3585c7[_0xf955('0x25')]()[_0xf955('0x24')](function(){var _0x102e36=_0x3585c7[_0xf955('0x26')]({'plain':!![]});var _0x552cf3=_0xf955('0x27');return db[_0xf955('0x28')][_0xf955('0x25')]({'where':{'type':_0x552cf3,'resourceId':_0x102e36['id']}})[_0xf955('0x24')](function(){return _0x3585c7;});})[_0xf955('0x24')](function(){_0x25f4f2[_0xf955('0x18')](0xcc)[_0xf955('0x19')]();});}};}function handleEntityNotFound(_0x51f3ab,_0x3caea6){return function(_0x145098){if(!_0x145098){_0x51f3ab[_0xf955('0x17')](0x194);}return _0x145098;};}function handleError(_0xbd0b74,_0x28fa9c){_0x28fa9c=_0x28fa9c||0x1f4;return function(_0x264f6d){logger['error'](_0x264f6d[_0xf955('0x29')]);if(_0x264f6d[_0xf955('0x2a')]){delete _0x264f6d['name'];}_0xbd0b74[_0xf955('0x18')](_0x28fa9c)[_0xf955('0x2b')](_0x264f6d);};}exports[_0xf955('0x2c')]=function(_0x1ef794,_0x59bfb5){var _0x3a951c={},_0x518fb3={},_0x227104={'count':0x0,'rows':[]};var _0x2c222a=_[_0xf955('0x2d')](db[_0xf955('0x2e')][_0xf955('0x2f')],function(_0x32121b){return{'name':_0x32121b[_0xf955('0x30')],'type':_0x32121b[_0xf955('0x31')]['key']};});_0x518fb3[_0xf955('0x32')]=_[_0xf955('0x2d')](_0x2c222a,_0xf955('0x2a'));_0x518fb3[_0xf955('0x33')]=_['keys'](_0x1ef794[_0xf955('0x33')]);_0x518fb3[_0xf955('0x34')]=_[_0xf955('0x35')](_0x518fb3[_0xf955('0x32')],_0x518fb3[_0xf955('0x33')]);_0x3a951c['attributes']=_['intersection'](_0x518fb3['model'],qs[_0xf955('0x36')](_0x1ef794[_0xf955('0x33')][_0xf955('0x36')]));_0x3a951c[_0xf955('0x37')]=_0x3a951c[_0xf955('0x37')][_0xf955('0x38')]?_0x3a951c['attributes']:_0x518fb3[_0xf955('0x32')];if(!_0x1ef794['query'][_0xf955('0x39')](_0xf955('0x3a'))){_0x3a951c[_0xf955('0x1c')]=qs['limit'](_0x1ef794[_0xf955('0x33')]['limit']);_0x3a951c[_0xf955('0x1d')]=qs[_0xf955('0x1d')](_0x1ef794[_0xf955('0x33')][_0xf955('0x1d')]);}_0x3a951c['order']=qs[_0xf955('0x3b')](_0x1ef794[_0xf955('0x33')]['sort']);_0x3a951c[_0xf955('0x3c')]=qs[_0xf955('0x34')](_[_0xf955('0x3d')](_0x1ef794['query'],_0x518fb3[_0xf955('0x34')]),_0x2c222a);if(_0x1ef794[_0xf955('0x33')][_0xf955('0x3e')]){_0x3a951c['where']=_[_0xf955('0x3f')](_0x3a951c[_0xf955('0x3c')],{'$or':_[_0xf955('0x2d')](_0x2c222a,function(_0x2069f3){if(_0x2069f3[_0xf955('0x31')]!==_0xf955('0x40')){var _0x2b614d={};_0x2b614d[_0x2069f3[_0xf955('0x2a')]]={'$like':'%'+_0x1ef794['query'][_0xf955('0x3e')]+'%'};return _0x2b614d;}})});}_0x3a951c=_[_0xf955('0x3f')]({},_0x3a951c,_0x1ef794[_0xf955('0x41')]);var _0xe633fa={'where':_0x3a951c[_0xf955('0x3c')]};return db[_0xf955('0x2e')][_0xf955('0x1e')](_0xe633fa)[_0xf955('0x24')](function(_0x47651b){_0x227104[_0xf955('0x1e')]=_0x47651b;if(_0x1ef794[_0xf955('0x33')][_0xf955('0x42')]){_0x3a951c[_0xf955('0x43')]=[{'all':!![]}];}return db[_0xf955('0x2e')][_0xf955('0x44')](_0x3a951c);})[_0xf955('0x24')](function(_0x356ec2){_0x227104[_0xf955('0x45')]=_0x356ec2;return _0x227104;})[_0xf955('0x24')](respondWithFilteredResult(_0x59bfb5,_0x3a951c))['catch'](handleError(_0x59bfb5,null));};exports[_0xf955('0x46')]=function(_0x25d809,_0x2db18d){var _0x5f0ef9={'raw':!![],'where':{'id':_0x25d809['params']['id']}},_0x16fc1a={};_0x16fc1a[_0xf955('0x32')]=_['keys'](db[_0xf955('0x2e')][_0xf955('0x2f')]);_0x16fc1a[_0xf955('0x33')]=_[_0xf955('0x47')](_0x25d809['query']);_0x16fc1a[_0xf955('0x34')]=_[_0xf955('0x35')](_0x16fc1a[_0xf955('0x32')],_0x16fc1a['query']);_0x5f0ef9['attributes']=_[_0xf955('0x35')](_0x16fc1a[_0xf955('0x32')],qs[_0xf955('0x36')](_0x25d809[_0xf955('0x33')]['fields']));_0x5f0ef9[_0xf955('0x37')]=_0x5f0ef9[_0xf955('0x37')][_0xf955('0x38')]?_0x5f0ef9['attributes']:_0x16fc1a[_0xf955('0x32')];if(_0x25d809['query'][_0xf955('0x42')]){_0x5f0ef9[_0xf955('0x43')]=[{'all':!![]}];}_0x5f0ef9=_[_0xf955('0x3f')]({},_0x5f0ef9,_0x25d809['options']);return db[_0xf955('0x2e')][_0xf955('0x48')](_0x5f0ef9)[_0xf955('0x24')](handleEntityNotFound(_0x2db18d,null))[_0xf955('0x24')](respondWithResult(_0x2db18d,null))['catch'](handleError(_0x2db18d,null));};exports[_0xf955('0x49')]=function(_0x4ff0f1,_0x1c6d76){return db[_0xf955('0x2e')][_0xf955('0x49')](_0x4ff0f1['body'],{})[_0xf955('0x24')](function(_0x4e7269){var _0x35c23c=_0x4ff0f1['user'][_0xf955('0x26')]({'plain':!![]});if(!_0x35c23c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35c23c['role']===_0xf955('0x4a')){var _0x45c7fe=_0x4e7269['get']({'plain':!![]});var _0x142e8f='ContactItemTypes';return db['UserProfileSection']['find']({'where':{'name':_0x142e8f,'userProfileId':_0x35c23c['userProfileId']},'raw':!![]})[_0xf955('0x24')](function(_0x1abe1c){if(_0x1abe1c&&_0x1abe1c['autoAssociation']===0x0){return db['UserProfileResource'][_0xf955('0x49')]({'name':_0x45c7fe[_0xf955('0x2a')],'resourceId':_0x45c7fe['id'],'type':_0x1abe1c[_0xf955('0x2a')],'sectionId':_0x1abe1c['id']},{})[_0xf955('0x24')](function(){return _0x4e7269;});}else{return _0x4e7269;}})[_0xf955('0x4b')](function(_0xa56483){logger[_0xf955('0x4c')](_0xf955('0x4d'),_0xa56483);throw _0xa56483;});}return _0x4e7269;})[_0xf955('0x24')](respondWithResult(_0x1c6d76,0xc9))[_0xf955('0x4b')](handleError(_0x1c6d76,null));};exports[_0xf955('0x23')]=function(_0x350873,_0x47a3a6){if(_0x350873[_0xf955('0x4e')]['id']){delete _0x350873[_0xf955('0x4e')]['id'];}return db[_0xf955('0x2e')][_0xf955('0x48')]({'where':{'id':_0x350873[_0xf955('0x4f')]['id']}})['then'](handleEntityNotFound(_0x47a3a6,null))[_0xf955('0x24')](saveUpdates(_0x350873[_0xf955('0x4e')],null))[_0xf955('0x24')](respondWithResult(_0x47a3a6,null))[_0xf955('0x4b')](handleError(_0x47a3a6,null));};exports[_0xf955('0x25')]=function(_0x9057df,_0x228d59){return db[_0xf955('0x2e')][_0xf955('0x48')]({'where':{'id':_0x9057df[_0xf955('0x4f')]['id']}})['then'](handleEntityNotFound(_0x228d59,null))[_0xf955('0x24')](db[_0xf955('0x50')][_0xf955('0x23')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x9057df[_0xf955('0x4f')]['id']}}))[_0xf955('0x24')](removeEntity(_0x228d59,null))[_0xf955('0x4b')](handleError(_0x228d59,null));}; \ No newline at end of file +var _0xda2d=['sort','where','filter','map','options','includeAll','rows','catch','rawAttributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','stack','name','send','index','ContactItemType','type','model','keys','query','filters','intersection','attributes','fields','length','order'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xda2d,0x102));var _0xdda2=function(_0x19d90a,_0x63190){_0x19d90a=_0x19d90a-0x0;var _0x227560=_0xda2d[_0x19d90a];return _0x227560;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdda2('0x0'));var zipdir=require(_0xdda2('0x1'));var jsonpatch=require(_0xdda2('0x2'));var rp=require(_0xdda2('0x3'));var moment=require(_0xdda2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdda2('0x5'));var sox=require(_0xdda2('0x6'));var csv=require(_0xdda2('0x7'));var ejs=require(_0xdda2('0x8'));var fs=require('fs');var fs_extra=require(_0xdda2('0x9'));var _=require(_0xdda2('0xa'));var squel=require(_0xdda2('0xb'));var crypto=require(_0xdda2('0xc'));var jsforce=require(_0xdda2('0xd'));var deskjs=require(_0xdda2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdda2('0xf'));var Papa=require(_0xdda2('0x10'));var Redis=require('ioredis');var authService=require(_0xdda2('0x11'));var qs=require(_0xdda2('0x12'));var as=require(_0xdda2('0x13'));var hardwareService=require(_0xdda2('0x14'));var logger=require(_0xdda2('0x15'))(_0xdda2('0x16'));var utils=require(_0xdda2('0x17'));var config=require(_0xdda2('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56d25d,_0xa6446b){_0xa6446b=_0xa6446b||0xcc;return function(_0x320f73){if(_0x320f73){return _0x56d25d[_0xdda2('0x19')](_0xa6446b);}return _0x56d25d[_0xdda2('0x1a')](_0xa6446b)[_0xdda2('0x1b')]();};}function respondWithResult(_0x475222,_0x3490f1){_0x3490f1=_0x3490f1||0xc8;return function(_0x4df902){if(_0x4df902){return _0x475222[_0xdda2('0x1a')](_0x3490f1)['json'](_0x4df902);}};}function respondWithFilteredResult(_0xbef148,_0xb6b01e){return function(_0x3553d5){if(_0x3553d5){var _0x457764=typeof _0xb6b01e[_0xdda2('0x1c')]==='undefined'&&typeof _0xb6b01e['limit']===_0xdda2('0x1d');var _0x518c6d=_0x3553d5[_0xdda2('0x1e')];var _0x1a3b35=_0x457764?0x0:_0xb6b01e[_0xdda2('0x1c')];var _0x2b6ee8=_0x457764?_0x3553d5[_0xdda2('0x1e')]:_0xb6b01e[_0xdda2('0x1c')]+_0xb6b01e[_0xdda2('0x1f')];var _0x351151;if(_0x2b6ee8>=_0x518c6d){_0x2b6ee8=_0x518c6d;_0x351151=0xc8;}else{_0x351151=0xce;}_0xbef148[_0xdda2('0x1a')](_0x351151);return _0xbef148[_0xdda2('0x20')](_0xdda2('0x21'),_0x1a3b35+'-'+_0x2b6ee8+'/'+_0x518c6d)[_0xdda2('0x22')](_0x3553d5);}return null;};}function patchUpdates(_0x4eed30){return function(_0x41fe7d){try{jsonpatch['apply'](_0x41fe7d,_0x4eed30,!![]);}catch(_0xc4567c){return BPromise[_0xdda2('0x23')](_0xc4567c);}return _0x41fe7d[_0xdda2('0x24')]();};}function saveUpdates(_0x4c5226,_0x347ee6){return function(_0x5a9bb8){if(_0x5a9bb8){return _0x5a9bb8[_0xdda2('0x25')](_0x4c5226)[_0xdda2('0x26')](function(_0x4ac3eb){return _0x4ac3eb;});}return null;};}function removeEntity(_0x144f1e,_0xfda248){return function(_0x2528d7){if(_0x2528d7){return _0x2528d7[_0xdda2('0x27')]()[_0xdda2('0x26')](function(){var _0x5739ad=_0x2528d7[_0xdda2('0x28')]({'plain':!![]});var _0x4be5ea=_0xdda2('0x29');return db[_0xdda2('0x2a')]['destroy']({'where':{'type':_0x4be5ea,'resourceId':_0x5739ad['id']}})['then'](function(){return _0x2528d7;});})[_0xdda2('0x26')](function(){_0x144f1e[_0xdda2('0x1a')](0xcc)[_0xdda2('0x1b')]();});}};}function handleEntityNotFound(_0x5e9e74,_0x90d919){return function(_0x5d26ae){if(!_0x5d26ae){_0x5e9e74[_0xdda2('0x19')](0x194);}return _0x5d26ae;};}function handleError(_0xe53dee,_0xe16ec7){_0xe16ec7=_0xe16ec7||0x1f4;return function(_0x91b41a){logger['error'](_0x91b41a[_0xdda2('0x2b')]);if(_0x91b41a[_0xdda2('0x2c')]){delete _0x91b41a['name'];}_0xe53dee[_0xdda2('0x1a')](_0xe16ec7)[_0xdda2('0x2d')](_0x91b41a);};}exports[_0xdda2('0x2e')]=function(_0x15e511,_0x5540e5){var _0x129eba={},_0x5e107f={},_0x4b19b7={'count':0x0,'rows':[]};var _0x1ca9f3=_['map'](db[_0xdda2('0x2f')]['rawAttributes'],function(_0x53ff76){return{'name':_0x53ff76['fieldName'],'type':_0x53ff76[_0xdda2('0x30')]['key']};});_0x5e107f[_0xdda2('0x31')]=_['map'](_0x1ca9f3,'name');_0x5e107f['query']=_[_0xdda2('0x32')](_0x15e511[_0xdda2('0x33')]);_0x5e107f[_0xdda2('0x34')]=_[_0xdda2('0x35')](_0x5e107f[_0xdda2('0x31')],_0x5e107f[_0xdda2('0x33')]);_0x129eba[_0xdda2('0x36')]=_[_0xdda2('0x35')](_0x5e107f[_0xdda2('0x31')],qs[_0xdda2('0x37')](_0x15e511['query'][_0xdda2('0x37')]));_0x129eba[_0xdda2('0x36')]=_0x129eba[_0xdda2('0x36')][_0xdda2('0x38')]?_0x129eba[_0xdda2('0x36')]:_0x5e107f[_0xdda2('0x31')];if(!_0x15e511[_0xdda2('0x33')]['hasOwnProperty']('nolimit')){_0x129eba[_0xdda2('0x1f')]=qs[_0xdda2('0x1f')](_0x15e511[_0xdda2('0x33')]['limit']);_0x129eba['offset']=qs[_0xdda2('0x1c')](_0x15e511[_0xdda2('0x33')][_0xdda2('0x1c')]);}_0x129eba[_0xdda2('0x39')]=qs[_0xdda2('0x3a')](_0x15e511['query'][_0xdda2('0x3a')]);_0x129eba[_0xdda2('0x3b')]=qs['filters'](_['pick'](_0x15e511[_0xdda2('0x33')],_0x5e107f[_0xdda2('0x34')]),_0x1ca9f3);if(_0x15e511[_0xdda2('0x33')][_0xdda2('0x3c')]){_0x129eba[_0xdda2('0x3b')]=_['merge'](_0x129eba[_0xdda2('0x3b')],{'$or':_[_0xdda2('0x3d')](_0x1ca9f3,function(_0x7dac2c){if(_0x7dac2c[_0xdda2('0x30')]!=='VIRTUAL'){var _0x4dc38f={};_0x4dc38f[_0x7dac2c[_0xdda2('0x2c')]]={'$like':'%'+_0x15e511[_0xdda2('0x33')][_0xdda2('0x3c')]+'%'};return _0x4dc38f;}})});}_0x129eba=_['merge']({},_0x129eba,_0x15e511[_0xdda2('0x3e')]);var _0x542ceb={'where':_0x129eba[_0xdda2('0x3b')]};return db['ContactItemType'][_0xdda2('0x1e')](_0x542ceb)[_0xdda2('0x26')](function(_0x1db762){_0x4b19b7[_0xdda2('0x1e')]=_0x1db762;if(_0x15e511['query'][_0xdda2('0x3f')]){_0x129eba['include']=[{'all':!![]}];}return db[_0xdda2('0x2f')]['findAll'](_0x129eba);})[_0xdda2('0x26')](function(_0x12589b){_0x4b19b7[_0xdda2('0x40')]=_0x12589b;return _0x4b19b7;})[_0xdda2('0x26')](respondWithFilteredResult(_0x5540e5,_0x129eba))[_0xdda2('0x41')](handleError(_0x5540e5,null));};exports['show']=function(_0x1e29dc,_0x15a616){var _0x54735b={'raw':!![],'where':{'id':_0x1e29dc['params']['id']}},_0x2caced={};_0x2caced[_0xdda2('0x31')]=_[_0xdda2('0x32')](db[_0xdda2('0x2f')][_0xdda2('0x42')]);_0x2caced[_0xdda2('0x33')]=_[_0xdda2('0x32')](_0x1e29dc[_0xdda2('0x33')]);_0x2caced[_0xdda2('0x34')]=_[_0xdda2('0x35')](_0x2caced[_0xdda2('0x31')],_0x2caced[_0xdda2('0x33')]);_0x54735b[_0xdda2('0x36')]=_[_0xdda2('0x35')](_0x2caced['model'],qs['fields'](_0x1e29dc['query'][_0xdda2('0x37')]));_0x54735b[_0xdda2('0x36')]=_0x54735b['attributes'][_0xdda2('0x38')]?_0x54735b[_0xdda2('0x36')]:_0x2caced[_0xdda2('0x31')];if(_0x1e29dc['query'][_0xdda2('0x3f')]){_0x54735b[_0xdda2('0x43')]=[{'all':!![]}];}_0x54735b=_['merge']({},_0x54735b,_0x1e29dc['options']);return db[_0xdda2('0x2f')]['find'](_0x54735b)[_0xdda2('0x26')](handleEntityNotFound(_0x15a616,null))['then'](respondWithResult(_0x15a616,null))[_0xdda2('0x41')](handleError(_0x15a616,null));};exports[_0xdda2('0x44')]=function(_0x50bd88,_0x585665){return db[_0xdda2('0x2f')][_0xdda2('0x44')](_0x50bd88[_0xdda2('0x45')],{})[_0xdda2('0x26')](function(_0x578a6c){var _0x1edbc6=_0x50bd88[_0xdda2('0x46')][_0xdda2('0x28')]({'plain':!![]});if(!_0x1edbc6)throw new Error(_0xdda2('0x47'));if(_0x1edbc6[_0xdda2('0x48')]==='user'){var _0x1a56cc=_0x578a6c[_0xdda2('0x28')]({'plain':!![]});var _0x51f2b6=_0xdda2('0x29');return db[_0xdda2('0x49')][_0xdda2('0x4a')]({'where':{'name':_0x51f2b6,'userProfileId':_0x1edbc6[_0xdda2('0x4b')]},'raw':!![]})[_0xdda2('0x26')](function(_0x265169){if(_0x265169&&_0x265169['autoAssociation']===0x0){return db[_0xdda2('0x2a')]['create']({'name':_0x1a56cc[_0xdda2('0x2c')],'resourceId':_0x1a56cc['id'],'type':_0x265169['name'],'sectionId':_0x265169['id']},{})[_0xdda2('0x26')](function(){return _0x578a6c;});}else{return _0x578a6c;}})['catch'](function(_0x3b5bbf){logger[_0xdda2('0x4c')](_0xdda2('0x4d'),_0x3b5bbf);throw _0x3b5bbf;});}return _0x578a6c;})[_0xdda2('0x26')](respondWithResult(_0x585665,0xc9))[_0xdda2('0x41')](handleError(_0x585665,null));};exports[_0xdda2('0x25')]=function(_0x471b86,_0x40655d){if(_0x471b86['body']['id']){delete _0x471b86[_0xdda2('0x45')]['id'];}return db[_0xdda2('0x2f')][_0xdda2('0x4a')]({'where':{'id':_0x471b86['params']['id']}})[_0xdda2('0x26')](handleEntityNotFound(_0x40655d,null))[_0xdda2('0x26')](saveUpdates(_0x471b86['body'],null))[_0xdda2('0x26')](respondWithResult(_0x40655d,null))['catch'](handleError(_0x40655d,null));};exports[_0xdda2('0x27')]=function(_0x10fbac,_0x378704){return db[_0xdda2('0x2f')][_0xdda2('0x4a')]({'where':{'id':_0x10fbac['params']['id']}})['then'](handleEntityNotFound(_0x378704,null))['then'](db[_0xdda2('0x4e')][_0xdda2('0x25')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x10fbac['params']['id']}}))[_0xdda2('0x26')](removeEntity(_0x378704,null))[_0xdda2('0x41')](handleError(_0x378704,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 119c50c..34fa694 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc64d=['api','moment','bluebird','request-promise','path','../../config/environment','exports','lodash','util','../../config/logger'];(function(_0x48ccad,_0x57216f){var _0xcc1ebb=function(_0x2c5b1d){while(--_0x2c5b1d){_0x48ccad['push'](_0x48ccad['shift']());}};_0xcc1ebb(++_0x57216f);}(_0xc64d,0x18d));var _0xdc64=function(_0x4cbd8b,_0x5307aa){_0x4cbd8b=_0x4cbd8b-0x0;var _0x5d8c7e=_0xc64d[_0x4cbd8b];return _0x5d8c7e;};'use strict';var _=require(_0xdc64('0x0'));var util=require(_0xdc64('0x1'));var logger=require(_0xdc64('0x2'))(_0xdc64('0x3'));var moment=require(_0xdc64('0x4'));var BPromise=require(_0xdc64('0x5'));var rp=require(_0xdc64('0x6'));var fs=require('fs');var path=require(_0xdc64('0x7'));var rimraf=require('rimraf');var config=require(_0xdc64('0x8'));var attributes=require('./contactItemType.attributes');module[_0xdc64('0x9')]=function(_0x21e197,_0x3f5add){return _0x21e197['define']('ContactItemType',attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95b4=['bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','util','api','moment'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0x95b4,0x1bc));var _0x495b=function(_0x3ff393,_0x2bea42){_0x3ff393=_0x3ff393-0x0;var _0x19111d=_0x95b4[_0x3ff393];return _0x19111d;};'use strict';var _=require(_0x495b('0x0'));var util=require(_0x495b('0x1'));var logger=require('../../config/logger')(_0x495b('0x2'));var moment=require(_0x495b('0x3'));var BPromise=require(_0x495b('0x4'));var rp=require(_0x495b('0x5'));var fs=require('fs');var path=require(_0x495b('0x6'));var rimraf=require(_0x495b('0x7'));var config=require(_0x495b('0x8'));var attributes=require(_0x495b('0x9'));module[_0x495b('0xa')]=function(_0x28b4a0,_0x8ebabc){return _0x28b4a0[_0x495b('0xb')](_0x495b('0xc'),attributes,{'tableName':_0x495b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 678333f..b61dd3b 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e58=['result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','debug','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ContactItemType,\x20%s,\x20%s','message'];(function(_0x5ef7b8,_0x15cc07){var _0x2c7148=function(_0x398519){while(--_0x398519){_0x5ef7b8['push'](_0x5ef7b8['shift']());}};_0x2c7148(++_0x15cc07);}(_0x9e58,0x80));var _0x89e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9e58[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x89e5('0x0'));var moment=require('moment');var BPromise=require(_0x89e5('0x1'));var rs=require(_0x89e5('0x2'));var fs=require('fs');var Redis=require(_0x89e5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x89e5('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x89e5('0x5'));var jayson=require(_0x89e5('0x6'));var client=jayson['client'][_0x89e5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x241b0f,_0x47eda0,_0x58b055){return new BPromise(function(_0x271405,_0x471880){return client[_0x89e5('0x8')](_0x241b0f,_0x58b055)[_0x89e5('0x9')](function(_0x2a58bf){logger[_0x89e5('0xa')]('ContactItemType,\x20%s,\x20%s',_0x47eda0,'request\x20sent');logger[_0x89e5('0xb')](_0x89e5('0xc'),_0x47eda0,_0x89e5('0xd'),JSON[_0x89e5('0xe')](_0x2a58bf));if(_0x2a58bf[_0x89e5('0xf')]){if(_0x2a58bf[_0x89e5('0xf')][_0x89e5('0x10')]===0x1f4){logger[_0x89e5('0xf')](_0x89e5('0x11'),_0x47eda0,_0x2a58bf['error'][_0x89e5('0x12')]);return _0x471880(_0x2a58bf[_0x89e5('0xf')][_0x89e5('0x12')]);}logger['error'](_0x89e5('0x11'),_0x47eda0,_0x2a58bf[_0x89e5('0xf')][_0x89e5('0x12')]);return _0x271405(_0x2a58bf[_0x89e5('0xf')][_0x89e5('0x12')]);}else{logger[_0x89e5('0xa')]('ContactItemType,\x20%s,\x20%s',_0x47eda0,_0x89e5('0xd'));_0x271405(_0x2a58bf[_0x89e5('0x13')][_0x89e5('0x12')]);}})[_0x89e5('0x14')](function(_0xc3007b){logger[_0x89e5('0xf')](_0x89e5('0x11'),_0x47eda0,_0xc3007b);_0x471880(_0xc3007b);});});} \ No newline at end of file +var _0xbee9=['ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent'];(function(_0x27134f,_0x16014b){var _0x22bcef=function(_0x6d710e){while(--_0x6d710e){_0x27134f['push'](_0x27134f['shift']());}};_0x22bcef(++_0x16014b);}(_0xbee9,0x75));var _0x9bee=function(_0x17e3d5,_0x961afe){_0x17e3d5=_0x17e3d5-0x0;var _0x1e7127=_0xbee9[_0x17e3d5];return _0x1e7127;};'use strict';var _=require(_0x9bee('0x0'));var util=require(_0x9bee('0x1'));var moment=require('moment');var BPromise=require(_0x9bee('0x2'));var rs=require(_0x9bee('0x3'));var fs=require('fs');var Redis=require(_0x9bee('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9bee('0x5'))(_0x9bee('0x6'));var config=require(_0x9bee('0x7'));var jayson=require(_0x9bee('0x8'));var client=jayson[_0x9bee('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f9aeb,_0x23136e,_0x25d066){return new BPromise(function(_0x2daced,_0x3980fa){return client[_0x9bee('0xa')](_0x3f9aeb,_0x25d066)[_0x9bee('0xb')](function(_0x139dbf){logger[_0x9bee('0xc')](_0x9bee('0xd'),_0x23136e,_0x9bee('0xe'));logger['debug'](_0x9bee('0xf'),_0x23136e,_0x9bee('0xe'),JSON[_0x9bee('0x10')](_0x139dbf));if(_0x139dbf['error']){if(_0x139dbf[_0x9bee('0x11')][_0x9bee('0x12')]===0x1f4){logger[_0x9bee('0x11')](_0x9bee('0xd'),_0x23136e,_0x139dbf['error']['message']);return _0x3980fa(_0x139dbf[_0x9bee('0x11')][_0x9bee('0x13')]);}logger[_0x9bee('0x11')](_0x9bee('0xd'),_0x23136e,_0x139dbf[_0x9bee('0x11')][_0x9bee('0x13')]);return _0x2daced(_0x139dbf['error'][_0x9bee('0x13')]);}else{logger[_0x9bee('0xc')](_0x9bee('0xd'),_0x23136e,_0x9bee('0xe'));_0x2daced(_0x139dbf[_0x9bee('0x14')][_0x9bee('0x13')]);}})[_0x9bee('0x15')](function(_0x24d53e){logger[_0x9bee('0x11')]('ContactItemType,\x20%s,\x20%s',_0x23136e,_0x24d53e);_0x3980fa(_0x24d53e);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 8754aec..6dad0f7 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00aa=['show','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index'];(function(_0x29f9f7,_0x1d8609){var _0x5032da=function(_0x407fb3){while(--_0x407fb3){_0x29f9f7['push'](_0x29f9f7['shift']());}};_0x5032da(++_0x1d8609);}(_0x00aa,0x182));var _0xa00a=function(_0x1f6f84,_0x2bab55){_0x1f6f84=_0x1f6f84-0x0;var _0x177f40=_0x00aa[_0x1f6f84];return _0x177f40;};'use strict';var multer=require(_0xa00a('0x0'));var util=require(_0xa00a('0x1'));var path=require('path');var timeout=require(_0xa00a('0x2'));var express=require(_0xa00a('0x3'));var router=express[_0xa00a('0x4')]();var fs_extra=require(_0xa00a('0x5'));var auth=require(_0xa00a('0x6'));var interaction=require(_0xa00a('0x7'));var config=require(_0xa00a('0x8'));var controller=require(_0xa00a('0x9'));router[_0xa00a('0xa')]('/',auth[_0xa00a('0xb')](),controller[_0xa00a('0xc')]);router[_0xa00a('0xa')]('/:id',auth[_0xa00a('0xb')](),controller[_0xa00a('0xd')]);router[_0xa00a('0xe')]('/',auth[_0xa00a('0xb')](),controller[_0xa00a('0xf')]);router[_0xa00a('0x10')](_0xa00a('0x11'),auth['isAuthenticated'](),controller[_0xa00a('0x12')]);router['delete'](_0xa00a('0x11'),auth[_0xa00a('0xb')](),controller[_0xa00a('0x13')]);module[_0xa00a('0x14')]=router; \ No newline at end of file +var _0xc813=['../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x5da2bf,_0x3481f8){var _0x4ce9e5=function(_0x2fc433){while(--_0x2fc433){_0x5da2bf['push'](_0x5da2bf['shift']());}};_0x4ce9e5(++_0x3481f8);}(_0xc813,0xd8));var _0x3c81=function(_0x31c133,_0x3075f7){_0x31c133=_0x31c133-0x0;var _0x596121=_0xc813[_0x31c133];return _0x596121;};'use strict';var multer=require('multer');var util=require(_0x3c81('0x0'));var path=require(_0x3c81('0x1'));var timeout=require(_0x3c81('0x2'));var express=require('express');var router=express[_0x3c81('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3c81('0x4'));var interaction=require(_0x3c81('0x5'));var config=require(_0x3c81('0x6'));var controller=require(_0x3c81('0x7'));router[_0x3c81('0x8')]('/',auth[_0x3c81('0x9')](),controller[_0x3c81('0xa')]);router[_0x3c81('0x8')](_0x3c81('0xb'),auth['isAuthenticated'](),controller[_0x3c81('0xc')]);router[_0x3c81('0xd')]('/',auth[_0x3c81('0x9')](),controller[_0x3c81('0xe')]);router[_0x3c81('0xf')](_0x3c81('0xb'),auth[_0x3c81('0x9')](),controller[_0x3c81('0x10')]);router[_0x3c81('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3c81('0x12')]);module[_0x3c81('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 23a2019..afc03d6 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x114252,_0x51ae2d){var _0x3749a7=function(_0x4836cc){while(--_0x4836cc){_0x114252['push'](_0x114252['shift']());}};_0x3749a7(++_0x51ae2d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0xf6e75d,_0xc70967){var _0x27514d=function(_0xc2c6dd){while(--_0xc2c6dd){_0xf6e75d['push'](_0xf6e75d['shift']());}};_0x27514d(++_0xc70967);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 46af5f0..167833f 100644 --- a/server/api/dashboard/dashboard.controller.js +++ b/server/api/dashboard/dashboard.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e05=['limit','count','set','save','update','then','destroy','UserProfileResource','sendStatus','error','stack','name','send','map','Dashboard','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','role','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrMetric','attrVoiceQueues','attrFontSize','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','findOne','getItems','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','status','end','json','offset'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5e05,0xdf));var _0x55e0=function(_0x4e6f4c,_0x518584){_0x4e6f4c=_0x4e6f4c-0x0;var _0x4c9ad7=_0x5e05[_0x4e6f4c];return _0x4c9ad7;};'use strict';var emlformat=require(_0x55e0('0x0'));var rimraf=require(_0x55e0('0x1'));var zipdir=require(_0x55e0('0x2'));var jsonpatch=require(_0x55e0('0x3'));var rp=require(_0x55e0('0x4'));var moment=require(_0x55e0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x55e0('0x6'));var util=require('util');var path=require(_0x55e0('0x7'));var sox=require(_0x55e0('0x8'));var csv=require(_0x55e0('0x9'));var ejs=require(_0x55e0('0xa'));var fs=require('fs');var fs_extra=require(_0x55e0('0xb'));var _=require(_0x55e0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x55e0('0xd'));var deskjs=require(_0x55e0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x55e0('0xf'));var Redis=require(_0x55e0('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x55e0('0x11'));var logger=require('../../config/logger')(_0x55e0('0x12'));var utils=require(_0x55e0('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x55e0('0x14'));var db=require(_0x55e0('0x15'))['db'];config[_0x55e0('0x16')]=_['defaults'](config['redis'],{'host':_0x55e0('0x17'),'port':0x18eb});var socket=require(_0x55e0('0x18'))(new Redis(config[_0x55e0('0x16')]));require(_0x55e0('0x19'))[_0x55e0('0x1a')](socket);function respondWithStatusCode(_0x406af4,_0x16c1c2){_0x16c1c2=_0x16c1c2||0xcc;return function(_0x35abf0){if(_0x35abf0){return _0x406af4['sendStatus'](_0x16c1c2);}return _0x406af4[_0x55e0('0x1b')](_0x16c1c2)[_0x55e0('0x1c')]();};}function respondWithResult(_0xa4a31e,_0x5a6063){_0x5a6063=_0x5a6063||0xc8;return function(_0x45ca49){if(_0x45ca49){return _0xa4a31e[_0x55e0('0x1b')](_0x5a6063)[_0x55e0('0x1d')](_0x45ca49);}};}function respondWithFilteredResult(_0x52e799,_0x37384a){return function(_0x31a2a3){if(_0x31a2a3){var _0x1482ca=typeof _0x37384a[_0x55e0('0x1e')]==='undefined'&&typeof _0x37384a[_0x55e0('0x1f')]==='undefined';var _0x5bc58b=_0x31a2a3[_0x55e0('0x20')];var _0x206807=_0x1482ca?0x0:_0x37384a[_0x55e0('0x1e')];var _0x1fc39a=_0x1482ca?_0x31a2a3[_0x55e0('0x20')]:_0x37384a[_0x55e0('0x1e')]+_0x37384a[_0x55e0('0x1f')];var _0x2c5633;if(_0x1fc39a>=_0x5bc58b){_0x1fc39a=_0x5bc58b;_0x2c5633=0xc8;}else{_0x2c5633=0xce;}_0x52e799['status'](_0x2c5633);return _0x52e799[_0x55e0('0x21')]('Content-Range',_0x206807+'-'+_0x1fc39a+'/'+_0x5bc58b)['json'](_0x31a2a3);}return null;};}function patchUpdates(_0x9dc33f){return function(_0x349d5a){try{jsonpatch['apply'](_0x349d5a,_0x9dc33f,!![]);}catch(_0x2464ce){return BPromise['reject'](_0x2464ce);}return _0x349d5a[_0x55e0('0x22')]();};}function saveUpdates(_0x628146,_0x3773fb){return function(_0x1be934){if(_0x1be934){return _0x1be934[_0x55e0('0x23')](_0x628146)[_0x55e0('0x24')](function(_0x6c416){return _0x6c416;});}return null;};}function removeEntity(_0x5839cc,_0x8f9878){return function(_0x33ccc5){if(_0x33ccc5){return _0x33ccc5[_0x55e0('0x25')]()[_0x55e0('0x24')](function(){var _0x1aea21=_0x33ccc5['get']({'plain':!![]});var _0x4c9da7='CustomDashboards';return db[_0x55e0('0x26')][_0x55e0('0x25')]({'where':{'type':_0x4c9da7,'resourceId':_0x1aea21['id']}})[_0x55e0('0x24')](function(){return _0x33ccc5;});})[_0x55e0('0x24')](function(){_0x5839cc[_0x55e0('0x1b')](0xcc)[_0x55e0('0x1c')]();});}};}function handleEntityNotFound(_0x3accbd,_0x29e97d){return function(_0x448f3c){if(!_0x448f3c){_0x3accbd[_0x55e0('0x27')](0x194);}return _0x448f3c;};}function handleError(_0x4490b1,_0x2cef0d){_0x2cef0d=_0x2cef0d||0x1f4;return function(_0x5e095b){logger[_0x55e0('0x28')](_0x5e095b[_0x55e0('0x29')]);if(_0x5e095b[_0x55e0('0x2a')]){delete _0x5e095b[_0x55e0('0x2a')];}_0x4490b1[_0x55e0('0x1b')](_0x2cef0d)[_0x55e0('0x2b')](_0x5e095b);};}exports['index']=function(_0x479b3d,_0x313ae5){var _0x4be7a2={},_0x4911ba={},_0x5210c6={'count':0x0,'rows':[]};var _0x3899a4=_[_0x55e0('0x2c')](db[_0x55e0('0x2d')][_0x55e0('0x2e')],function(_0x4d01b5){return{'name':_0x4d01b5[_0x55e0('0x2f')],'type':_0x4d01b5[_0x55e0('0x30')][_0x55e0('0x31')]};});_0x4911ba['model']=_[_0x55e0('0x2c')](_0x3899a4,_0x55e0('0x2a'));_0x4911ba[_0x55e0('0x32')]=_[_0x55e0('0x33')](_0x479b3d[_0x55e0('0x32')]);_0x4911ba[_0x55e0('0x34')]=_[_0x55e0('0x35')](_0x4911ba[_0x55e0('0x36')],_0x4911ba['query']);_0x4be7a2[_0x55e0('0x37')]=_['intersection'](_0x4911ba[_0x55e0('0x36')],qs[_0x55e0('0x38')](_0x479b3d[_0x55e0('0x32')]['fields']));_0x4be7a2[_0x55e0('0x37')]=_0x4be7a2[_0x55e0('0x37')][_0x55e0('0x39')]?_0x4be7a2[_0x55e0('0x37')]:_0x4911ba[_0x55e0('0x36')];if(!_0x479b3d[_0x55e0('0x32')][_0x55e0('0x3a')](_0x55e0('0x3b'))){_0x4be7a2[_0x55e0('0x1f')]=qs[_0x55e0('0x1f')](_0x479b3d['query']['limit']);_0x4be7a2['offset']=qs[_0x55e0('0x1e')](_0x479b3d[_0x55e0('0x32')]['offset']);}_0x4be7a2[_0x55e0('0x3c')]=qs[_0x55e0('0x3d')](_0x479b3d[_0x55e0('0x32')][_0x55e0('0x3d')]);_0x4be7a2[_0x55e0('0x3e')]=qs[_0x55e0('0x34')](_[_0x55e0('0x3f')](_0x479b3d[_0x55e0('0x32')],_0x4911ba[_0x55e0('0x34')]),_0x3899a4);if(_0x479b3d[_0x55e0('0x32')][_0x55e0('0x40')]){_0x4be7a2[_0x55e0('0x3e')]=_[_0x55e0('0x41')](_0x4be7a2['where'],{'$or':_[_0x55e0('0x2c')](_0x3899a4,function(_0x581910){if(_0x581910[_0x55e0('0x30')]!==_0x55e0('0x42')){var _0x1e34ac={};_0x1e34ac[_0x581910[_0x55e0('0x2a')]]={'$like':'%'+_0x479b3d['query'][_0x55e0('0x40')]+'%'};return _0x1e34ac;}})});}_0x4be7a2=_['merge']({},_0x4be7a2,_0x479b3d['options']);var _0xd563d7={'where':_0x4be7a2[_0x55e0('0x3e')]};return db[_0x55e0('0x2d')][_0x55e0('0x20')](_0xd563d7)[_0x55e0('0x24')](function(_0x41df6e){_0x5210c6[_0x55e0('0x20')]=_0x41df6e;if(_0x479b3d[_0x55e0('0x32')][_0x55e0('0x43')]){_0x4be7a2[_0x55e0('0x44')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x4be7a2);})[_0x55e0('0x24')](function(_0x382e00){_0x5210c6[_0x55e0('0x45')]=_0x382e00;return _0x5210c6;})['then'](respondWithFilteredResult(_0x313ae5,_0x4be7a2))[_0x55e0('0x46')](handleError(_0x313ae5,null));};exports[_0x55e0('0x47')]=function(_0x45a67e,_0x22b382){var _0x4d14dd={'raw':![],'where':{'id':_0x45a67e['params']['id']}},_0xab547a={};_0xab547a['model']=_[_0x55e0('0x33')](db[_0x55e0('0x2d')]['rawAttributes']);_0xab547a[_0x55e0('0x32')]=_[_0x55e0('0x33')](_0x45a67e[_0x55e0('0x32')]);_0xab547a[_0x55e0('0x34')]=_[_0x55e0('0x35')](_0xab547a[_0x55e0('0x36')],_0xab547a[_0x55e0('0x32')]);_0x4d14dd[_0x55e0('0x37')]=_[_0x55e0('0x35')](_0xab547a[_0x55e0('0x36')],qs[_0x55e0('0x38')](_0x45a67e['query'][_0x55e0('0x38')]));_0x4d14dd[_0x55e0('0x37')]=_0x4d14dd['attributes']['length']?_0x4d14dd[_0x55e0('0x37')]:_0xab547a[_0x55e0('0x36')];if(_0x45a67e['query'][_0x55e0('0x43')]){_0x4d14dd[_0x55e0('0x44')]=[{'all':!![]}];}_0x4d14dd=_[_0x55e0('0x41')]({},_0x4d14dd,_0x45a67e[_0x55e0('0x48')]);return db['Dashboard'][_0x55e0('0x49')](_0x4d14dd)[_0x55e0('0x24')](handleEntityNotFound(_0x22b382,null))[_0x55e0('0x24')](respondWithResult(_0x22b382,null))[_0x55e0('0x46')](handleError(_0x22b382,null));};exports[_0x55e0('0x4a')]=function(_0x477d9c,_0x35205e){return db[_0x55e0('0x2d')]['create'](_0x477d9c[_0x55e0('0x4b')],{})[_0x55e0('0x24')](function(_0x3c8fa8){var _0x374f59=_0x477d9c[_0x55e0('0x4c')][_0x55e0('0x4d')]({'plain':!![]});if(!_0x374f59)throw new Error(_0x55e0('0x4e'));if(_0x374f59['role']===_0x55e0('0x4c')){var _0x26c2c2=_0x3c8fa8[_0x55e0('0x4d')]({'plain':!![]});var _0x167906=_0x55e0('0x4f');return db[_0x55e0('0x50')][_0x55e0('0x49')]({'where':{'name':_0x167906,'userProfileId':_0x374f59[_0x55e0('0x51')]},'raw':!![]})[_0x55e0('0x24')](function(_0xe1c5c7){if(_0xe1c5c7&&_0xe1c5c7[_0x55e0('0x52')]===0x0){return db[_0x55e0('0x26')][_0x55e0('0x4a')]({'name':_0x26c2c2[_0x55e0('0x2a')],'resourceId':_0x26c2c2['id'],'type':_0xe1c5c7[_0x55e0('0x2a')],'sectionId':_0xe1c5c7['id']},{})[_0x55e0('0x24')](function(){return _0x3c8fa8;});}else{return _0x3c8fa8;}})['catch'](function(_0x573601){logger['error'](_0x55e0('0x53'),_0x573601);throw _0x573601;});}return _0x3c8fa8;})['then'](respondWithResult(_0x35205e,0xc9))[_0x55e0('0x46')](handleError(_0x35205e,null));};exports[_0x55e0('0x54')]=function(_0x4c9cc3,_0x59e72a){var _0x49d3d2={'where':{'id':_0x4c9cc3[_0x55e0('0x55')]['id']}},_0x18f526={};_0x18f526['model']=_[_0x55e0('0x33')](db['Dashboard'][_0x55e0('0x2e')]);_0x49d3d2['attributes']=_[_0x55e0('0x35')](_0x18f526[_0x55e0('0x36')],qs[_0x55e0('0x38')](_0x4c9cc3[_0x55e0('0x32')]['fields']));_0x49d3d2['attributes']=_0x49d3d2[_0x55e0('0x37')][_0x55e0('0x39')]?_0x49d3d2[_0x55e0('0x37')]:_0x18f526['model'];if(_0x4c9cc3[_0x55e0('0x32')][_0x55e0('0x43')]){_0x49d3d2['include']=[{'all':!![]}];}_0x49d3d2=_[_0x55e0('0x41')]({},_0x49d3d2,_0x4c9cc3[_0x55e0('0x48')]);return db[_0x55e0('0x2d')]['find'](_0x49d3d2)[_0x55e0('0x24')](handleEntityNotFound(_0x59e72a,null))['then'](function(_0x5d9293){if(_0x5d9293){var _0xa5e20a=_0x5d9293['get']({'plain':!![]});_0xa5e20a=qs[_0x55e0('0x56')](_0xa5e20a,['id',_0x55e0('0x57'),_0x55e0('0x58')]);_0x4c9cc3[_0x55e0('0x4b')]=_['omit'](_0x4c9cc3[_0x55e0('0x4b')],['id','createdAt',_0x55e0('0x58')]);return db[_0x55e0('0x2d')][_0x55e0('0x4a')](_['merge'](_0xa5e20a,_0x4c9cc3[_0x55e0('0x4b')]),{'include':_0x4c9cc3[_0x55e0('0x32')][_0x55e0('0x43')]?[{'all':!![]}]:undefined})[_0x55e0('0x24')](function(_0x2a9e55){var _0x3152e3=_0x4c9cc3['user'][_0x55e0('0x4d')]({'plain':!![]});if(!_0x3152e3)throw new Error(_0x55e0('0x4e'));if(_0x3152e3[_0x55e0('0x59')]===_0x55e0('0x4c')){var _0x196f72=_0x2a9e55[_0x55e0('0x4d')]({'plain':!![]});var _0x3be7cc='CustomDashboards';return db[_0x55e0('0x50')][_0x55e0('0x49')]({'where':{'name':_0x3be7cc,'userProfileId':_0x3152e3[_0x55e0('0x51')]},'raw':!![]})[_0x55e0('0x24')](function(_0x1a883d){if(_0x1a883d&&_0x1a883d[_0x55e0('0x52')]===0x0){return db[_0x55e0('0x26')]['create']({'name':_0x196f72[_0x55e0('0x2a')],'resourceId':_0x196f72['id'],'type':_0x1a883d[_0x55e0('0x2a')],'sectionId':_0x1a883d['id']},{})[_0x55e0('0x24')](function(){return _0x2a9e55;});}else{return _0x2a9e55;}})[_0x55e0('0x46')](function(_0x419ef7){logger[_0x55e0('0x28')](_0x55e0('0x53'),_0x419ef7);throw _0x419ef7;});}return _0x2a9e55;});}})['then'](respondWithResult(_0x59e72a,0xc9))[_0x55e0('0x46')](handleError(_0x59e72a,null));};exports['update']=function(_0x35c531,_0x380412){if(_0x35c531[_0x55e0('0x4b')]['id']){delete _0x35c531[_0x55e0('0x4b')]['id'];}return db['Dashboard'][_0x55e0('0x49')]({'where':{'id':_0x35c531['params']['id']}})[_0x55e0('0x24')](handleEntityNotFound(_0x380412,null))[_0x55e0('0x24')](saveUpdates(_0x35c531[_0x55e0('0x4b')],null))[_0x55e0('0x24')](respondWithResult(_0x380412,null))[_0x55e0('0x46')](handleError(_0x380412,null));};exports['destroy']=function(_0x534974,_0x3fb764){return db[_0x55e0('0x2d')][_0x55e0('0x49')]({'where':{'id':_0x534974[_0x55e0('0x55')]['id']}})['then'](handleEntityNotFound(_0x3fb764,null))[_0x55e0('0x24')](removeEntity(_0x3fb764,null))[_0x55e0('0x46')](handleError(_0x3fb764,null));};function widgetAttributes(_0x48a187){try{switch(_0x48a187[_0x55e0('0x30')]){case _0x55e0('0x5a'):return[{'name':'attrUrl','value':_0x48a187[_0x55e0('0x5b')]||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187[_0x55e0('0x5c')][0x0]?_0x48a187['attrs'][0x0]['value']:undefined)||_0x55e0('0x5d')}];case _0x55e0('0x5e'):return[{'name':_0x55e0('0x5f'),'value':_0x48a187[_0x55e0('0x5f')]||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187[_0x55e0('0x5c')][0x0]?_0x48a187['attrs'][0x0][_0x55e0('0x60')]:undefined)||''}];case _0x55e0('0x61'):return[{'name':_0x55e0('0x62'),'value':_0x48a187[_0x55e0('0x62')]||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187['attrs'][0x0]?_0x48a187[_0x55e0('0x5c')][0x0]['value']:undefined)||_0x55e0('0x63')},{'name':_0x55e0('0x64'),'value':_0x48a187[_0x55e0('0x64')]||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187[_0x55e0('0x5c')][0x1]?_0x48a187[_0x55e0('0x5c')][0x1]['value']:undefined)||_0x55e0('0x65')},{'name':'attrFontSize','value':_0x48a187['attrFontSize']||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187['attrs'][0x2]?_0x48a187[_0x55e0('0x5c')][0x2][_0x55e0('0x60')]:undefined)||0xc}];case'counter':return[{'name':_0x55e0('0x66'),'value':_0x48a187[_0x55e0('0x66')]||(_0x48a187['attrs']&&_0x48a187['attrs'][0x0]?_0x48a187['attrs'][0x0][_0x55e0('0x60')]:undefined)||'total'},{'name':_0x55e0('0x67'),'value':_0x48a187[_0x55e0('0x67')]||(_0x48a187['attrs']&&_0x48a187[_0x55e0('0x5c')][0x1]?_0x48a187[_0x55e0('0x5c')][0x1][_0x55e0('0x60')]:undefined)||[]},{'name':_0x55e0('0x68'),'value':_0x48a187[_0x55e0('0x68')]||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187[_0x55e0('0x5c')][0x2]?_0x48a187[_0x55e0('0x5c')][0x2][_0x55e0('0x60')]:undefined)||0x14},{'name':'attrChannel','value':_0x48a187[_0x55e0('0x69')]||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187[_0x55e0('0x5c')][0x3]?_0x48a187[_0x55e0('0x5c')][0x3][_0x55e0('0x60')]:undefined)||_0x55e0('0x6a')},{'name':'attrEmailAccounts','value':_0x48a187[_0x55e0('0x6b')]||(_0x48a187['attrs']&&_0x48a187[_0x55e0('0x5c')][0x4]?_0x48a187['attrs'][0x4][_0x55e0('0x60')]:undefined)||''},{'name':_0x55e0('0x6c'),'value':_0x48a187[_0x55e0('0x6c')]||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187[_0x55e0('0x5c')][0x5]?_0x48a187[_0x55e0('0x5c')][0x5][_0x55e0('0x60')]:undefined)||''},{'name':_0x55e0('0x6d'),'value':_0x48a187['attrSmsAccounts']||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187[_0x55e0('0x5c')][0x6]?_0x48a187[_0x55e0('0x5c')][0x6][_0x55e0('0x60')]:undefined)||''},{'name':_0x55e0('0x6e'),'value':_0x48a187[_0x55e0('0x6e')]||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187['attrs'][0x7]?_0x48a187['attrs'][0x7]['value']:undefined)||''},{'name':_0x55e0('0x6f'),'value':_0x48a187[_0x55e0('0x6f')]||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187['attrs'][0x8]?_0x48a187[_0x55e0('0x5c')][0x8]['value']:undefined)||''},{'name':_0x55e0('0x70'),'value':_0x48a187[_0x55e0('0x70')]||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187[_0x55e0('0x5c')][0x9]?_0x48a187['attrs'][0x9][_0x55e0('0x60')]:undefined)||''}];case'multibar-chart':case _0x55e0('0x71'):return[{'name':_0x55e0('0x72'),'value':_0x48a187[_0x55e0('0x72')]||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187['attrs'][0x0]?_0x48a187[_0x55e0('0x5c')][0x0][_0x55e0('0x60')]:undefined)||_0x55e0('0x73')},{'name':'attrSerie2','value':_0x48a187[_0x55e0('0x74')]||(_0x48a187['attrs']&&_0x48a187[_0x55e0('0x5c')][0x1]?_0x48a187['attrs'][0x1][_0x55e0('0x60')]:undefined)||null},{'name':_0x55e0('0x75'),'value':_0x48a187[_0x55e0('0x75')]||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187['attrs'][0x2]?_0x48a187['attrs'][0x2][_0x55e0('0x60')]:undefined)||null},{'name':_0x55e0('0x67'),'value':_0x48a187[_0x55e0('0x67')]||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187[_0x55e0('0x5c')][0x3]?_0x48a187[_0x55e0('0x5c')][0x3]['value']:undefined)||[]},{'name':_0x55e0('0x69'),'value':_0x48a187[_0x55e0('0x69')]||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187[_0x55e0('0x5c')][0x4]?_0x48a187[_0x55e0('0x5c')][0x4][_0x55e0('0x60')]:undefined)||'voice'},{'name':_0x55e0('0x6b'),'value':_0x48a187[_0x55e0('0x6b')]||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187[_0x55e0('0x5c')][0x5]?_0x48a187['attrs'][0x5][_0x55e0('0x60')]:undefined)||''},{'name':_0x55e0('0x6c'),'value':_0x48a187[_0x55e0('0x6c')]||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187[_0x55e0('0x5c')][0x6]?_0x48a187[_0x55e0('0x5c')][0x6][_0x55e0('0x60')]:undefined)||''},{'name':_0x55e0('0x6d'),'value':_0x48a187['attrSmsAccounts']||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187['attrs'][0x7]?_0x48a187[_0x55e0('0x5c')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x48a187['attrOpenchannelAccounts']||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187[_0x55e0('0x5c')][0x8]?_0x48a187[_0x55e0('0x5c')][0x8][_0x55e0('0x60')]:undefined)||''},{'name':_0x55e0('0x6f'),'value':_0x48a187['attrWhatsappAccounts']||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187[_0x55e0('0x5c')][0x9]?_0x48a187[_0x55e0('0x5c')][0x9][_0x55e0('0x60')]:undefined)||''},{'name':_0x55e0('0x70'),'value':_0x48a187['attrChatWebsites']||(_0x48a187['attrs']&&_0x48a187['attrs'][0xa]?_0x48a187[_0x55e0('0x5c')][0xa]['value']:undefined)||''}];case _0x55e0('0x76'):return[{'name':'attrReport','type':_0x48a187['reportType']||(_0x48a187['attrs']&&_0x48a187[_0x55e0('0x5c')][0x0]?_0x48a187[_0x55e0('0x5c')][0x0][_0x55e0('0x30')]:undefined)||null,'value':_0x48a187[_0x55e0('0x77')]||(_0x48a187['attrs']&&_0x48a187[_0x55e0('0x5c')][0x0]?_0x48a187[_0x55e0('0x5c')][0x0][_0x55e0('0x60')]:undefined)||null},{'name':_0x55e0('0x78'),'value':_0x48a187['attrRefresh']||(_0x48a187[_0x55e0('0x5c')]&&_0x48a187[_0x55e0('0x5c')][0x1]?_0x48a187['attrs'][0x1][_0x55e0('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x159c9f){logger[_0x55e0('0x28')](_0x55e0('0x79'),JSON[_0x55e0('0x7a')](_0x159c9f));return[];}}exports[_0x55e0('0x7b')]=function(_0x1e80e1,_0x7aa732,_0x599624){if(_0x1e80e1[_0x55e0('0x4b')]['id']){delete _0x1e80e1[_0x55e0('0x4b')]['id'];}return db[_0x55e0('0x2d')][_0x55e0('0x49')]({'where':{'id':_0x1e80e1['params']['id']}})['then'](handleEntityNotFound(_0x7aa732,null))[_0x55e0('0x24')](function(_0x25be40){if(_0x25be40){_0x1e80e1['body']['DashboardId']=_0x25be40['id'];_0x1e80e1[_0x55e0('0x4b')][_0x55e0('0x5c')]=widgetAttributes(_0x1e80e1['body']);return db[_0x55e0('0x7c')][_0x55e0('0x4a')](_0x1e80e1['body']);}})['then'](respondWithResult(_0x7aa732,null))['catch'](handleError(_0x7aa732,null));};exports['getItems']=function(_0x33def6,_0x5c0047,_0x5758b0){var _0xc229bc={};var _0x5d1bf3={};var _0x52054c;var _0x35e5b3;return db[_0x55e0('0x2d')][_0x55e0('0x7d')]({'where':{'id':_0x33def6[_0x55e0('0x55')]['id']}})[_0x55e0('0x24')](handleEntityNotFound(_0x5c0047,null))[_0x55e0('0x24')](function(_0x35d053){if(_0x35d053){_0x52054c=_0x35d053;_0x5d1bf3['model']=_[_0x55e0('0x33')](db[_0x55e0('0x7c')][_0x55e0('0x2e')]);_0x5d1bf3[_0x55e0('0x32')]=_[_0x55e0('0x33')](_0x33def6[_0x55e0('0x32')]);_0x5d1bf3[_0x55e0('0x34')]=_[_0x55e0('0x35')](_0x5d1bf3['model'],_0x5d1bf3[_0x55e0('0x32')]);_0xc229bc[_0x55e0('0x37')]=_[_0x55e0('0x35')](_0x5d1bf3[_0x55e0('0x36')],qs['fields'](_0x33def6[_0x55e0('0x32')][_0x55e0('0x38')]));_0xc229bc[_0x55e0('0x37')]=_0xc229bc[_0x55e0('0x37')][_0x55e0('0x39')]?_0xc229bc[_0x55e0('0x37')]:_0x5d1bf3['model'];_0xc229bc[_0x55e0('0x3c')]=qs[_0x55e0('0x3d')](_0x33def6['query'][_0x55e0('0x3d')]);_0xc229bc[_0x55e0('0x3e')]=qs[_0x55e0('0x34')](_[_0x55e0('0x3f')](_0x33def6['query'],_0x5d1bf3[_0x55e0('0x34')]));if(_0x33def6[_0x55e0('0x32')][_0x55e0('0x40')]){_0xc229bc['where']=_[_0x55e0('0x41')](_0xc229bc[_0x55e0('0x3e')],{'$or':_['map'](_0xc229bc[_0x55e0('0x37')],function(_0x621e01){var _0x568355={};_0x568355[_0x621e01]={'$like':'%'+_0x33def6[_0x55e0('0x32')][_0x55e0('0x40')]+'%'};return _0x568355;})});}_0xc229bc=_[_0x55e0('0x41')]({},_0xc229bc,_0x33def6['options']);return _0x52054c[_0x55e0('0x7e')](_0xc229bc);}})[_0x55e0('0x24')](function(_0x643b2f){if(_0x643b2f){_0x35e5b3=_0x643b2f['length'];if(!_0x33def6[_0x55e0('0x32')]['hasOwnProperty'](_0x55e0('0x3b'))){_0xc229bc[_0x55e0('0x1f')]=qs[_0x55e0('0x1f')](_0x33def6[_0x55e0('0x32')][_0x55e0('0x1f')]);_0xc229bc[_0x55e0('0x1e')]=qs['offset'](_0x33def6['query'][_0x55e0('0x1e')]);}return _0x52054c['getItems'](_0xc229bc);}})['then'](function(_0x2ff04e){if(_0x2ff04e){return _0x2ff04e?{'count':_0x35e5b3,'rows':_0x2ff04e}:null;}})[_0x55e0('0x24')](respondWithResult(_0x5c0047,null))[_0x55e0('0x46')](handleError(_0x5c0047,null));}; \ No newline at end of file +var _0x28bd=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','autoAssociation','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','DashboardId','DashboardItem','getItems','findOne','filter','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x5f5282,_0x225bfe){var _0xd5e782=function(_0x5603fd){while(--_0x5603fd){_0x5f5282['push'](_0x5f5282['shift']());}};_0xd5e782(++_0x225bfe);}(_0x28bd,0x108));var _0xd28b=function(_0x5a4825,_0x27644a){_0x5a4825=_0x5a4825-0x0;var _0x9f2654=_0x28bd[_0x5a4825];return _0x9f2654;};'use strict';var emlformat=require(_0xd28b('0x0'));var rimraf=require(_0xd28b('0x1'));var zipdir=require(_0xd28b('0x2'));var jsonpatch=require(_0xd28b('0x3'));var rp=require(_0xd28b('0x4'));var moment=require(_0xd28b('0x5'));var BPromise=require(_0xd28b('0x6'));var Mustache=require(_0xd28b('0x7'));var util=require(_0xd28b('0x8'));var path=require(_0xd28b('0x9'));var sox=require(_0xd28b('0xa'));var csv=require(_0xd28b('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd28b('0xc'));var _=require(_0xd28b('0xd'));var squel=require(_0xd28b('0xe'));var crypto=require(_0xd28b('0xf'));var jsforce=require(_0xd28b('0x10'));var deskjs=require(_0xd28b('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd28b('0x12'));var Papa=require(_0xd28b('0x13'));var Redis=require(_0xd28b('0x14'));var authService=require(_0xd28b('0x15'));var qs=require(_0xd28b('0x16'));var as=require(_0xd28b('0x17'));var hardwareService=require(_0xd28b('0x18'));var logger=require('../../config/logger')(_0xd28b('0x19'));var utils=require(_0xd28b('0x1a'));var config=require(_0xd28b('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xd28b('0x1c'))['db'];config['redis']=_[_0xd28b('0x1d')](config['redis'],{'host':_0xd28b('0x1e'),'port':0x18eb});var socket=require(_0xd28b('0x1f'))(new Redis(config['redis']));require(_0xd28b('0x20'))[_0xd28b('0x21')](socket);function respondWithStatusCode(_0x2a2cce,_0x12ab4d){_0x12ab4d=_0x12ab4d||0xcc;return function(_0x38762b){if(_0x38762b){return _0x2a2cce[_0xd28b('0x22')](_0x12ab4d);}return _0x2a2cce[_0xd28b('0x23')](_0x12ab4d)[_0xd28b('0x24')]();};}function respondWithResult(_0x92e9e6,_0x210e83){_0x210e83=_0x210e83||0xc8;return function(_0x45db22){if(_0x45db22){return _0x92e9e6['status'](_0x210e83)[_0xd28b('0x25')](_0x45db22);}};}function respondWithFilteredResult(_0x2a0d77,_0x229979){return function(_0x3cddad){if(_0x3cddad){var _0x407e03=typeof _0x229979['offset']===_0xd28b('0x26')&&typeof _0x229979[_0xd28b('0x27')]===_0xd28b('0x26');var _0x290c27=_0x3cddad[_0xd28b('0x28')];var _0x38273d=_0x407e03?0x0:_0x229979[_0xd28b('0x29')];var _0x161351=_0x407e03?_0x3cddad[_0xd28b('0x28')]:_0x229979[_0xd28b('0x29')]+_0x229979[_0xd28b('0x27')];var _0x408dc1;if(_0x161351>=_0x290c27){_0x161351=_0x290c27;_0x408dc1=0xc8;}else{_0x408dc1=0xce;}_0x2a0d77[_0xd28b('0x23')](_0x408dc1);return _0x2a0d77[_0xd28b('0x2a')](_0xd28b('0x2b'),_0x38273d+'-'+_0x161351+'/'+_0x290c27)[_0xd28b('0x25')](_0x3cddad);}return null;};}function patchUpdates(_0x52e703){return function(_0x40d424){try{jsonpatch[_0xd28b('0x2c')](_0x40d424,_0x52e703,!![]);}catch(_0x2b91c0){return BPromise[_0xd28b('0x2d')](_0x2b91c0);}return _0x40d424[_0xd28b('0x2e')]();};}function saveUpdates(_0xbb5b67,_0x46ffdf){return function(_0xfc8602){if(_0xfc8602){return _0xfc8602[_0xd28b('0x2f')](_0xbb5b67)[_0xd28b('0x30')](function(_0x57949d){return _0x57949d;});}return null;};}function removeEntity(_0x2aee89,_0x1a5b5a){return function(_0x5eca36){if(_0x5eca36){return _0x5eca36[_0xd28b('0x31')]()[_0xd28b('0x30')](function(){var _0x3864d2=_0x5eca36[_0xd28b('0x32')]({'plain':!![]});var _0x5bb112=_0xd28b('0x33');return db[_0xd28b('0x34')][_0xd28b('0x31')]({'where':{'type':_0x5bb112,'resourceId':_0x3864d2['id']}})['then'](function(){return _0x5eca36;});})['then'](function(){_0x2aee89[_0xd28b('0x23')](0xcc)[_0xd28b('0x24')]();});}};}function handleEntityNotFound(_0x479a0e,_0x407b06){return function(_0x264eaf){if(!_0x264eaf){_0x479a0e['sendStatus'](0x194);}return _0x264eaf;};}function handleError(_0x4dc20c,_0x30a981){_0x30a981=_0x30a981||0x1f4;return function(_0x4cfbf1){logger['error'](_0x4cfbf1['stack']);if(_0x4cfbf1[_0xd28b('0x35')]){delete _0x4cfbf1[_0xd28b('0x35')];}_0x4dc20c[_0xd28b('0x23')](_0x30a981)[_0xd28b('0x36')](_0x4cfbf1);};}exports[_0xd28b('0x37')]=function(_0x22c169,_0x368808){var _0x3d5614={},_0x126468={},_0x64f27d={'count':0x0,'rows':[]};var _0x546dcf=_[_0xd28b('0x38')](db[_0xd28b('0x39')][_0xd28b('0x3a')],function(_0x16dd4c){return{'name':_0x16dd4c[_0xd28b('0x3b')],'type':_0x16dd4c[_0xd28b('0x3c')][_0xd28b('0x3d')]};});_0x126468[_0xd28b('0x3e')]=_[_0xd28b('0x38')](_0x546dcf,_0xd28b('0x35'));_0x126468['query']=_[_0xd28b('0x3f')](_0x22c169[_0xd28b('0x40')]);_0x126468[_0xd28b('0x41')]=_['intersection'](_0x126468[_0xd28b('0x3e')],_0x126468[_0xd28b('0x40')]);_0x3d5614[_0xd28b('0x42')]=_[_0xd28b('0x43')](_0x126468[_0xd28b('0x3e')],qs[_0xd28b('0x44')](_0x22c169[_0xd28b('0x40')][_0xd28b('0x44')]));_0x3d5614[_0xd28b('0x42')]=_0x3d5614['attributes']['length']?_0x3d5614['attributes']:_0x126468[_0xd28b('0x3e')];if(!_0x22c169[_0xd28b('0x40')]['hasOwnProperty'](_0xd28b('0x45'))){_0x3d5614[_0xd28b('0x27')]=qs[_0xd28b('0x27')](_0x22c169[_0xd28b('0x40')][_0xd28b('0x27')]);_0x3d5614['offset']=qs[_0xd28b('0x29')](_0x22c169[_0xd28b('0x40')]['offset']);}_0x3d5614[_0xd28b('0x46')]=qs[_0xd28b('0x47')](_0x22c169['query']['sort']);_0x3d5614[_0xd28b('0x48')]=qs[_0xd28b('0x41')](_[_0xd28b('0x49')](_0x22c169[_0xd28b('0x40')],_0x126468[_0xd28b('0x41')]),_0x546dcf);if(_0x22c169[_0xd28b('0x40')]['filter']){_0x3d5614['where']=_[_0xd28b('0x4a')](_0x3d5614[_0xd28b('0x48')],{'$or':_[_0xd28b('0x38')](_0x546dcf,function(_0x51b6a7){if(_0x51b6a7[_0xd28b('0x3c')]!==_0xd28b('0x4b')){var _0x39e393={};_0x39e393[_0x51b6a7['name']]={'$like':'%'+_0x22c169['query']['filter']+'%'};return _0x39e393;}})});}_0x3d5614=_[_0xd28b('0x4a')]({},_0x3d5614,_0x22c169[_0xd28b('0x4c')]);var _0x38b36a={'where':_0x3d5614[_0xd28b('0x48')]};return db[_0xd28b('0x39')][_0xd28b('0x28')](_0x38b36a)[_0xd28b('0x30')](function(_0xfa32d1){_0x64f27d[_0xd28b('0x28')]=_0xfa32d1;if(_0x22c169[_0xd28b('0x40')][_0xd28b('0x4d')]){_0x3d5614['include']=[{'all':!![]}];}return db[_0xd28b('0x39')][_0xd28b('0x4e')](_0x3d5614);})[_0xd28b('0x30')](function(_0xe4f219){_0x64f27d['rows']=_0xe4f219;return _0x64f27d;})[_0xd28b('0x30')](respondWithFilteredResult(_0x368808,_0x3d5614))[_0xd28b('0x4f')](handleError(_0x368808,null));};exports[_0xd28b('0x50')]=function(_0x42bc2c,_0x201fb5){var _0x744ccb={'raw':![],'where':{'id':_0x42bc2c[_0xd28b('0x51')]['id']}},_0x58b008={};_0x58b008['model']=_[_0xd28b('0x3f')](db['Dashboard'][_0xd28b('0x3a')]);_0x58b008[_0xd28b('0x40')]=_[_0xd28b('0x3f')](_0x42bc2c[_0xd28b('0x40')]);_0x58b008[_0xd28b('0x41')]=_['intersection'](_0x58b008['model'],_0x58b008[_0xd28b('0x40')]);_0x744ccb['attributes']=_[_0xd28b('0x43')](_0x58b008['model'],qs[_0xd28b('0x44')](_0x42bc2c[_0xd28b('0x40')][_0xd28b('0x44')]));_0x744ccb[_0xd28b('0x42')]=_0x744ccb['attributes'][_0xd28b('0x52')]?_0x744ccb['attributes']:_0x58b008[_0xd28b('0x3e')];if(_0x42bc2c[_0xd28b('0x40')][_0xd28b('0x4d')]){_0x744ccb[_0xd28b('0x53')]=[{'all':!![]}];}_0x744ccb=_[_0xd28b('0x4a')]({},_0x744ccb,_0x42bc2c['options']);return db['Dashboard'][_0xd28b('0x54')](_0x744ccb)[_0xd28b('0x30')](handleEntityNotFound(_0x201fb5,null))[_0xd28b('0x30')](respondWithResult(_0x201fb5,null))[_0xd28b('0x4f')](handleError(_0x201fb5,null));};exports['create']=function(_0xd018b6,_0x5693b8){return db[_0xd28b('0x39')][_0xd28b('0x55')](_0xd018b6[_0xd28b('0x56')],{})['then'](function(_0x37cf05){var _0x19c77d=_0xd018b6[_0xd28b('0x57')][_0xd28b('0x32')]({'plain':!![]});if(!_0x19c77d)throw new Error(_0xd28b('0x58'));if(_0x19c77d[_0xd28b('0x59')]===_0xd28b('0x57')){var _0x2a95b8=_0x37cf05[_0xd28b('0x32')]({'plain':!![]});var _0x19abaa=_0xd28b('0x33');return db[_0xd28b('0x5a')][_0xd28b('0x54')]({'where':{'name':_0x19abaa,'userProfileId':_0x19c77d[_0xd28b('0x5b')]},'raw':!![]})['then'](function(_0x5a73f0){if(_0x5a73f0&&_0x5a73f0['autoAssociation']===0x0){return db[_0xd28b('0x34')]['create']({'name':_0x2a95b8['name'],'resourceId':_0x2a95b8['id'],'type':_0x5a73f0[_0xd28b('0x35')],'sectionId':_0x5a73f0['id']},{})[_0xd28b('0x30')](function(){return _0x37cf05;});}else{return _0x37cf05;}})[_0xd28b('0x4f')](function(_0x3a3d8d){logger[_0xd28b('0x5c')](_0xd28b('0x5d'),_0x3a3d8d);throw _0x3a3d8d;});}return _0x37cf05;})[_0xd28b('0x30')](respondWithResult(_0x5693b8,0xc9))[_0xd28b('0x4f')](handleError(_0x5693b8,null));};exports[_0xd28b('0x5e')]=function(_0x67fab,_0xddc5fb){var _0xdf7ff0={'where':{'id':_0x67fab['params']['id']}},_0x54c4e7={};_0x54c4e7[_0xd28b('0x3e')]=_[_0xd28b('0x3f')](db[_0xd28b('0x39')][_0xd28b('0x3a')]);_0xdf7ff0[_0xd28b('0x42')]=_[_0xd28b('0x43')](_0x54c4e7['model'],qs[_0xd28b('0x44')](_0x67fab[_0xd28b('0x40')][_0xd28b('0x44')]));_0xdf7ff0[_0xd28b('0x42')]=_0xdf7ff0[_0xd28b('0x42')][_0xd28b('0x52')]?_0xdf7ff0[_0xd28b('0x42')]:_0x54c4e7['model'];if(_0x67fab[_0xd28b('0x40')][_0xd28b('0x4d')]){_0xdf7ff0[_0xd28b('0x53')]=[{'all':!![]}];}_0xdf7ff0=_[_0xd28b('0x4a')]({},_0xdf7ff0,_0x67fab[_0xd28b('0x4c')]);return db[_0xd28b('0x39')][_0xd28b('0x54')](_0xdf7ff0)[_0xd28b('0x30')](handleEntityNotFound(_0xddc5fb,null))['then'](function(_0x581f05){if(_0x581f05){var _0x5b7535=_0x581f05['get']({'plain':!![]});_0x5b7535=qs['omit'](_0x5b7535,['id',_0xd28b('0x5f'),'updatedAt']);_0x67fab[_0xd28b('0x56')]=_[_0xd28b('0x60')](_0x67fab['body'],['id',_0xd28b('0x5f'),'updatedAt']);return db[_0xd28b('0x39')][_0xd28b('0x55')](_[_0xd28b('0x4a')](_0x5b7535,_0x67fab[_0xd28b('0x56')]),{'include':_0x67fab[_0xd28b('0x40')][_0xd28b('0x4d')]?[{'all':!![]}]:undefined})[_0xd28b('0x30')](function(_0x1ffd0c){var _0x365334=_0x67fab[_0xd28b('0x57')][_0xd28b('0x32')]({'plain':!![]});if(!_0x365334)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x365334[_0xd28b('0x59')]===_0xd28b('0x57')){var _0x4c0862=_0x1ffd0c[_0xd28b('0x32')]({'plain':!![]});var _0x45862f=_0xd28b('0x33');return db[_0xd28b('0x5a')][_0xd28b('0x54')]({'where':{'name':_0x45862f,'userProfileId':_0x365334['userProfileId']},'raw':!![]})[_0xd28b('0x30')](function(_0x5dbfba){if(_0x5dbfba&&_0x5dbfba[_0xd28b('0x61')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c0862['name'],'resourceId':_0x4c0862['id'],'type':_0x5dbfba[_0xd28b('0x35')],'sectionId':_0x5dbfba['id']},{})[_0xd28b('0x30')](function(){return _0x1ffd0c;});}else{return _0x1ffd0c;}})['catch'](function(_0x17bb8b){logger[_0xd28b('0x5c')](_0xd28b('0x5d'),_0x17bb8b);throw _0x17bb8b;});}return _0x1ffd0c;});}})[_0xd28b('0x30')](respondWithResult(_0xddc5fb,0xc9))[_0xd28b('0x4f')](handleError(_0xddc5fb,null));};exports[_0xd28b('0x2f')]=function(_0x4124b6,_0x304c94){if(_0x4124b6[_0xd28b('0x56')]['id']){delete _0x4124b6[_0xd28b('0x56')]['id'];}return db['Dashboard'][_0xd28b('0x54')]({'where':{'id':_0x4124b6[_0xd28b('0x51')]['id']}})[_0xd28b('0x30')](handleEntityNotFound(_0x304c94,null))[_0xd28b('0x30')](saveUpdates(_0x4124b6['body'],null))[_0xd28b('0x30')](respondWithResult(_0x304c94,null))[_0xd28b('0x4f')](handleError(_0x304c94,null));};exports[_0xd28b('0x31')]=function(_0x57d7e3,_0x5852a7){return db[_0xd28b('0x39')]['find']({'where':{'id':_0x57d7e3['params']['id']}})[_0xd28b('0x30')](handleEntityNotFound(_0x5852a7,null))[_0xd28b('0x30')](removeEntity(_0x5852a7,null))['catch'](handleError(_0x5852a7,null));};function widgetAttributes(_0x2558f1){try{switch(_0x2558f1[_0xd28b('0x3c')]){case _0xd28b('0x62'):return[{'name':_0xd28b('0x63'),'value':_0x2558f1[_0xd28b('0x63')]||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x0]?_0x2558f1[_0xd28b('0x64')][0x0][_0xd28b('0x65')]:undefined)||_0xd28b('0x66')}];case _0xd28b('0x67'):return[{'name':_0xd28b('0x68'),'value':_0x2558f1['attrPath']||(_0x2558f1['attrs']&&_0x2558f1['attrs'][0x0]?_0x2558f1[_0xd28b('0x64')][0x0]['value']:undefined)||''}];case _0xd28b('0x69'):return[{'name':_0xd28b('0x6a'),'value':_0x2558f1[_0xd28b('0x6a')]||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x0]?_0x2558f1[_0xd28b('0x64')][0x0][_0xd28b('0x65')]:undefined)||'HH:mm:ss'},{'name':_0xd28b('0x6b'),'value':_0x2558f1['attrTimezone']||(_0x2558f1['attrs']&&_0x2558f1['attrs'][0x1]?_0x2558f1[_0xd28b('0x64')][0x1][_0xd28b('0x65')]:undefined)||_0xd28b('0x6c')},{'name':_0xd28b('0x6d'),'value':_0x2558f1[_0xd28b('0x6d')]||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x2]?_0x2558f1['attrs'][0x2][_0xd28b('0x65')]:undefined)||0xc}];case _0xd28b('0x6e'):return[{'name':_0xd28b('0x6f'),'value':_0x2558f1[_0xd28b('0x6f')]||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x0]?_0x2558f1[_0xd28b('0x64')][0x0][_0xd28b('0x65')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x2558f1[_0xd28b('0x70')]||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x1]?_0x2558f1[_0xd28b('0x64')][0x1][_0xd28b('0x65')]:undefined)||[]},{'name':_0xd28b('0x6d'),'value':_0x2558f1[_0xd28b('0x6d')]||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x2]?_0x2558f1[_0xd28b('0x64')][0x2][_0xd28b('0x65')]:undefined)||0x14},{'name':_0xd28b('0x71'),'value':_0x2558f1[_0xd28b('0x71')]||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x3]?_0x2558f1[_0xd28b('0x64')][0x3]['value']:undefined)||_0xd28b('0x72')},{'name':'attrEmailAccounts','value':_0x2558f1[_0xd28b('0x73')]||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x4]?_0x2558f1[_0xd28b('0x64')][0x4][_0xd28b('0x65')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x2558f1[_0xd28b('0x74')]||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x5]?_0x2558f1['attrs'][0x5][_0xd28b('0x65')]:undefined)||''},{'name':_0xd28b('0x75'),'value':_0x2558f1['attrSmsAccounts']||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x6]?_0x2558f1[_0xd28b('0x64')][0x6][_0xd28b('0x65')]:undefined)||''},{'name':_0xd28b('0x76'),'value':_0x2558f1['attrOpenchannelAccounts']||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x7]?_0x2558f1[_0xd28b('0x64')][0x7]['value']:undefined)||''},{'name':_0xd28b('0x77'),'value':_0x2558f1['attrWhatsappAccounts']||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x8]?_0x2558f1[_0xd28b('0x64')][0x8][_0xd28b('0x65')]:undefined)||''},{'name':_0xd28b('0x78'),'value':_0x2558f1['attrChatWebsites']||(_0x2558f1['attrs']&&_0x2558f1[_0xd28b('0x64')][0x9]?_0x2558f1[_0xd28b('0x64')][0x9][_0xd28b('0x65')]:undefined)||''}];case _0xd28b('0x79'):case'pie-chart':return[{'name':_0xd28b('0x7a'),'value':_0x2558f1[_0xd28b('0x7a')]||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x0]?_0x2558f1['attrs'][0x0]['value']:undefined)||_0xd28b('0x7b')},{'name':_0xd28b('0x7c'),'value':_0x2558f1[_0xd28b('0x7c')]||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x1]?_0x2558f1[_0xd28b('0x64')][0x1]['value']:undefined)||null},{'name':_0xd28b('0x7d'),'value':_0x2558f1[_0xd28b('0x7d')]||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1['attrs'][0x2]?_0x2558f1['attrs'][0x2][_0xd28b('0x65')]:undefined)||null},{'name':_0xd28b('0x70'),'value':_0x2558f1[_0xd28b('0x70')]||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x3]?_0x2558f1['attrs'][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x2558f1['attrChannel']||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x4]?_0x2558f1[_0xd28b('0x64')][0x4]['value']:undefined)||'voice'},{'name':_0xd28b('0x73'),'value':_0x2558f1['attrEmailAccounts']||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1['attrs'][0x5]?_0x2558f1[_0xd28b('0x64')][0x5][_0xd28b('0x65')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x2558f1[_0xd28b('0x74')]||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x6]?_0x2558f1[_0xd28b('0x64')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x2558f1['attrSmsAccounts']||(_0x2558f1['attrs']&&_0x2558f1['attrs'][0x7]?_0x2558f1['attrs'][0x7][_0xd28b('0x65')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2558f1[_0xd28b('0x76')]||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x8]?_0x2558f1[_0xd28b('0x64')][0x8]['value']:undefined)||''},{'name':_0xd28b('0x77'),'value':_0x2558f1['attrWhatsappAccounts']||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x9]?_0x2558f1[_0xd28b('0x64')][0x9]['value']:undefined)||''},{'name':_0xd28b('0x78'),'value':_0x2558f1['attrChatWebsites']||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0xa]?_0x2558f1[_0xd28b('0x64')][0xa][_0xd28b('0x65')]:undefined)||''}];case _0xd28b('0x7e'):return[{'name':_0xd28b('0x7f'),'type':_0x2558f1[_0xd28b('0x80')]||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x0]?_0x2558f1['attrs'][0x0]['type']:undefined)||null,'value':_0x2558f1[_0xd28b('0x7f')]||(_0x2558f1['attrs']&&_0x2558f1[_0xd28b('0x64')][0x0]?_0x2558f1[_0xd28b('0x64')][0x0][_0xd28b('0x65')]:undefined)||null},{'name':_0xd28b('0x81'),'value':_0x2558f1[_0xd28b('0x81')]||(_0x2558f1[_0xd28b('0x64')]&&_0x2558f1[_0xd28b('0x64')][0x1]?_0x2558f1[_0xd28b('0x64')][0x1][_0xd28b('0x65')]:undefined)||0x0}];default:return[];}}catch(_0x660185){logger['error'](_0xd28b('0x82'),JSON['stringify'](_0x660185));return[];}}exports['addItem']=function(_0x11d73d,_0x53e343,_0x27a9f2){if(_0x11d73d[_0xd28b('0x56')]['id']){delete _0x11d73d['body']['id'];}return db[_0xd28b('0x39')][_0xd28b('0x54')]({'where':{'id':_0x11d73d[_0xd28b('0x51')]['id']}})[_0xd28b('0x30')](handleEntityNotFound(_0x53e343,null))[_0xd28b('0x30')](function(_0x4b749d){if(_0x4b749d){_0x11d73d[_0xd28b('0x56')][_0xd28b('0x83')]=_0x4b749d['id'];_0x11d73d[_0xd28b('0x56')][_0xd28b('0x64')]=widgetAttributes(_0x11d73d[_0xd28b('0x56')]);return db[_0xd28b('0x84')]['create'](_0x11d73d[_0xd28b('0x56')]);}})['then'](respondWithResult(_0x53e343,null))[_0xd28b('0x4f')](handleError(_0x53e343,null));};exports[_0xd28b('0x85')]=function(_0x583a41,_0x35501c,_0x3a1ea0){var _0x5c6acf={};var _0x52304a={};var _0x11b74e;var _0x29ce7b;return db[_0xd28b('0x39')][_0xd28b('0x86')]({'where':{'id':_0x583a41[_0xd28b('0x51')]['id']}})[_0xd28b('0x30')](handleEntityNotFound(_0x35501c,null))[_0xd28b('0x30')](function(_0x436320){if(_0x436320){_0x11b74e=_0x436320;_0x52304a[_0xd28b('0x3e')]=_[_0xd28b('0x3f')](db[_0xd28b('0x84')][_0xd28b('0x3a')]);_0x52304a[_0xd28b('0x40')]=_[_0xd28b('0x3f')](_0x583a41['query']);_0x52304a[_0xd28b('0x41')]=_['intersection'](_0x52304a[_0xd28b('0x3e')],_0x52304a['query']);_0x5c6acf[_0xd28b('0x42')]=_[_0xd28b('0x43')](_0x52304a[_0xd28b('0x3e')],qs[_0xd28b('0x44')](_0x583a41['query'][_0xd28b('0x44')]));_0x5c6acf[_0xd28b('0x42')]=_0x5c6acf[_0xd28b('0x42')][_0xd28b('0x52')]?_0x5c6acf['attributes']:_0x52304a[_0xd28b('0x3e')];_0x5c6acf[_0xd28b('0x46')]=qs[_0xd28b('0x47')](_0x583a41['query']['sort']);_0x5c6acf['where']=qs[_0xd28b('0x41')](_[_0xd28b('0x49')](_0x583a41['query'],_0x52304a[_0xd28b('0x41')]));if(_0x583a41[_0xd28b('0x40')][_0xd28b('0x87')]){_0x5c6acf[_0xd28b('0x48')]=_['merge'](_0x5c6acf[_0xd28b('0x48')],{'$or':_[_0xd28b('0x38')](_0x5c6acf['attributes'],function(_0x15eef){var _0x346bde={};_0x346bde[_0x15eef]={'$like':'%'+_0x583a41[_0xd28b('0x40')][_0xd28b('0x87')]+'%'};return _0x346bde;})});}_0x5c6acf=_[_0xd28b('0x4a')]({},_0x5c6acf,_0x583a41[_0xd28b('0x4c')]);return _0x11b74e[_0xd28b('0x85')](_0x5c6acf);}})[_0xd28b('0x30')](function(_0x5d4330){if(_0x5d4330){_0x29ce7b=_0x5d4330[_0xd28b('0x52')];if(!_0x583a41[_0xd28b('0x40')][_0xd28b('0x88')]('nolimit')){_0x5c6acf[_0xd28b('0x27')]=qs[_0xd28b('0x27')](_0x583a41[_0xd28b('0x40')][_0xd28b('0x27')]);_0x5c6acf[_0xd28b('0x29')]=qs[_0xd28b('0x29')](_0x583a41[_0xd28b('0x40')][_0xd28b('0x29')]);}return _0x11b74e[_0xd28b('0x85')](_0x5c6acf);}})[_0xd28b('0x30')](function(_0x320fa8){if(_0x320fa8){return _0x320fa8?{'count':_0x29ce7b,'rows':_0x320fa8}:null;}})['then'](respondWithResult(_0x35501c,null))[_0xd28b('0x4f')](handleError(_0x35501c,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index dae9846..460f8d1 100644 --- a/server/api/dashboard/dashboard.events.js +++ b/server/api/dashboard/dashboard.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2db=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','Dashboard','setMaxListeners'];(function(_0x351796,_0x26998d){var _0x1b172d=function(_0x2a744b){while(--_0x2a744b){_0x351796['push'](_0x351796['shift']());}};_0x1b172d(++_0x26998d);}(_0xe2db,0x149));var _0xbe2d=function(_0x10284b,_0x247deb){_0x10284b=_0x10284b-0x0;var _0x298279=_0xe2db[_0x10284b];return _0x298279;};'use strict';var EventEmitter=require(_0xbe2d('0x0'));var Dashboard=require(_0xbe2d('0x1'))['db'][_0xbe2d('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xbe2d('0x3')](0x0);var events={'afterCreate':_0xbe2d('0x4'),'afterUpdate':_0xbe2d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4b4d5a){return function(_0xd92237,_0x5bd958,_0x36ee5f){DashboardEvents[_0xbe2d('0x6')](_0x4b4d5a+':'+_0xd92237['id'],_0xd92237);DashboardEvents[_0xbe2d('0x6')](_0x4b4d5a,_0xd92237);_0x36ee5f(null);};}for(var e in events){if(events[_0xbe2d('0x7')](e)){var event=events[e];Dashboard[_0xbe2d('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0xa188=['setMaxListeners','save','update','emit','hook','exports','../../mysqldb'];(function(_0x3a8bf3,_0x1c61fa){var _0x435e05=function(_0x4e4962){while(--_0x4e4962){_0x3a8bf3['push'](_0x3a8bf3['shift']());}};_0x435e05(++_0x1c61fa);}(_0xa188,0x133));var _0x8a18=function(_0x4e408c,_0x62e70b){_0x4e408c=_0x4e408c-0x0;var _0x407d4e=_0xa188[_0x4e408c];return _0x407d4e;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x8a18('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8a18('0x1')](0x0);var events={'afterCreate':_0x8a18('0x2'),'afterUpdate':_0x8a18('0x3'),'afterDestroy':'remove'};function emitEvent(_0x123102){return function(_0x452f2f,_0x21cca0,_0x446cc1){DashboardEvents[_0x8a18('0x4')](_0x123102+':'+_0x452f2f['id'],_0x452f2f);DashboardEvents[_0x8a18('0x4')](_0x123102,_0x452f2f);_0x446cc1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x8a18('0x5')](e,emitEvent(event));}}module[_0x8a18('0x6')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 10d5e2c..0ec4e48 100644 --- a/server/api/dashboard/dashboard.model.js +++ b/server/api/dashboard/dashboard.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e6c=['Dashboard','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x0e6c,0x64));var _0xc0e6=function(_0x722ce5,_0x127550){_0x722ce5=_0x722ce5-0x0;var _0x2338cd=_0x0e6c[_0x722ce5];return _0x2338cd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc0e6('0x0'))(_0xc0e6('0x1'));var moment=require(_0xc0e6('0x2'));var BPromise=require(_0xc0e6('0x3'));var rp=require(_0xc0e6('0x4'));var fs=require('fs');var path=require(_0xc0e6('0x5'));var rimraf=require(_0xc0e6('0x6'));var config=require(_0xc0e6('0x7'));var attributes=require('./dashboard.attributes');module[_0xc0e6('0x8')]=function(_0x5e7759,_0x3f8f68){return _0x5e7759[_0xc0e6('0x9')](_0xc0e6('0xa'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc8d=['rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','util','../../config/logger','bluebird','request-promise','path'];(function(_0x5c5dae,_0x5ed03e){var _0x4b87a1=function(_0x59a7de){while(--_0x59a7de){_0x5c5dae['push'](_0x5c5dae['shift']());}};_0x4b87a1(++_0x5ed03e);}(_0xcc8d,0xbb));var _0xdcc8=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0xcc8d[_0x310504];return _0x5b36d0;};'use strict';var _=require('lodash');var util=require(_0xdcc8('0x0'));var logger=require(_0xdcc8('0x1'))('api');var moment=require('moment');var BPromise=require(_0xdcc8('0x2'));var rp=require(_0xdcc8('0x3'));var fs=require('fs');var path=require(_0xdcc8('0x4'));var rimraf=require(_0xdcc8('0x5'));var config=require(_0xdcc8('0x6'));var attributes=require(_0xdcc8('0x7'));module[_0xdcc8('0x8')]=function(_0x47b30e,_0x44e0b0){return _0x47b30e[_0xdcc8('0x9')](_0xdcc8('0xa'),attributes,{'tableName':_0xdcc8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 50a6c14..84d4109 100644 --- a/server/api/dashboard/dashboard.rpc.js +++ b/server/api/dashboard/dashboard.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x521a=['request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','request','then','info'];(function(_0x4d68ed,_0x211450){var _0x3a8ff4=function(_0x4ca658){while(--_0x4ca658){_0x4d68ed['push'](_0x4d68ed['shift']());}};_0x3a8ff4(++_0x211450);}(_0x521a,0x95));var _0xa521=function(_0x4d35c7,_0xb930e0){_0x4d35c7=_0x4d35c7-0x0;var _0x595121=_0x521a[_0x4d35c7];return _0x595121;};'use strict';var _=require(_0xa521('0x0'));var util=require(_0xa521('0x1'));var moment=require(_0xa521('0x2'));var BPromise=require(_0xa521('0x3'));var rs=require(_0xa521('0x4'));var fs=require('fs');var Redis=require(_0xa521('0x5'));var db=require(_0xa521('0x6'))['db'];var utils=require(_0xa521('0x7'));var logger=require(_0xa521('0x8'))(_0xa521('0x9'));var config=require(_0xa521('0xa'));var jayson=require(_0xa521('0xb'));var client=jayson[_0xa521('0xc')][_0xa521('0xd')]({'port':0x232a});config[_0xa521('0xe')]=_['defaults'](config[_0xa521('0xe')],{'host':_0xa521('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa521('0xe')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x2cd9c3,_0x362ce7,_0x528810){return new BPromise(function(_0x23b2c3,_0x48b883){return client[_0xa521('0x10')](_0x2cd9c3,_0x528810)[_0xa521('0x11')](function(_0x3b7b46){logger[_0xa521('0x12')]('Dashboard,\x20%s,\x20%s',_0x362ce7,_0xa521('0x13'));logger[_0xa521('0x14')](_0xa521('0x15'),_0x362ce7,_0xa521('0x13'),JSON[_0xa521('0x16')](_0x3b7b46));if(_0x3b7b46[_0xa521('0x17')]){if(_0x3b7b46[_0xa521('0x17')][_0xa521('0x18')]===0x1f4){logger[_0xa521('0x17')](_0xa521('0x19'),_0x362ce7,_0x3b7b46['error'][_0xa521('0x1a')]);return _0x48b883(_0x3b7b46['error'][_0xa521('0x1a')]);}logger[_0xa521('0x17')]('Dashboard,\x20%s,\x20%s',_0x362ce7,_0x3b7b46[_0xa521('0x17')][_0xa521('0x1a')]);return _0x23b2c3(_0x3b7b46[_0xa521('0x17')][_0xa521('0x1a')]);}else{logger['info'](_0xa521('0x19'),_0x362ce7,'request\x20sent');_0x23b2c3(_0x3b7b46[_0xa521('0x1b')]['message']);}})['catch'](function(_0x445a76){logger[_0xa521('0x17')](_0xa521('0x19'),_0x362ce7,_0x445a76);_0x48b883(_0x445a76);});});} \ No newline at end of file +var _0x2abf=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./dashboard.socket','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x2abf,0xd3));var _0xf2ab=function(_0x56ce24,_0x3daec8){_0x56ce24=_0x56ce24-0x0;var _0x2a5eb4=_0x2abf[_0x56ce24];return _0x2a5eb4;};'use strict';var _=require(_0xf2ab('0x0'));var util=require(_0xf2ab('0x1'));var moment=require(_0xf2ab('0x2'));var BPromise=require(_0xf2ab('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2ab('0x4'));var db=require(_0xf2ab('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf2ab('0x6'))(_0xf2ab('0x7'));var config=require(_0xf2ab('0x8'));var jayson=require(_0xf2ab('0x9'));var client=jayson['client'][_0xf2ab('0xa')]({'port':0x232a});config['redis']=_[_0xf2ab('0xb')](config[_0xf2ab('0xc')],{'host':_0xf2ab('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf2ab('0xc')]));require(_0xf2ab('0xe'))['register'](socket);function respondWithRpcPromise(_0xb30532,_0x14f180,_0xfa9034){return new BPromise(function(_0x2a145f,_0x38adc1){return client['request'](_0xb30532,_0xfa9034)[_0xf2ab('0xf')](function(_0x30ad07){logger[_0xf2ab('0x10')](_0xf2ab('0x11'),_0x14f180,'request\x20sent');logger[_0xf2ab('0x12')](_0xf2ab('0x13'),_0x14f180,_0xf2ab('0x14'),JSON[_0xf2ab('0x15')](_0x30ad07));if(_0x30ad07['error']){if(_0x30ad07[_0xf2ab('0x16')][_0xf2ab('0x17')]===0x1f4){logger[_0xf2ab('0x16')](_0xf2ab('0x11'),_0x14f180,_0x30ad07[_0xf2ab('0x16')][_0xf2ab('0x18')]);return _0x38adc1(_0x30ad07['error'][_0xf2ab('0x18')]);}logger['error'](_0xf2ab('0x11'),_0x14f180,_0x30ad07[_0xf2ab('0x16')]['message']);return _0x2a145f(_0x30ad07[_0xf2ab('0x16')]['message']);}else{logger[_0xf2ab('0x10')]('Dashboard,\x20%s,\x20%s',_0x14f180,'request\x20sent');_0x2a145f(_0x30ad07[_0xf2ab('0x19')][_0xf2ab('0x18')]);}})[_0xf2ab('0x1a')](function(_0x2dade3){logger['error']('Dashboard,\x20%s,\x20%s',_0x14f180,_0x2dade3);_0x38adc1(_0x2dade3);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 6f44557..b881532 100644 --- a/server/api/dashboard/dashboard.socket.js +++ b/server/api/dashboard/dashboard.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a70=['length','dashboard:','./dashboard.events','save','remove','update','emit','register'];(function(_0x3d6536,_0xbe9fb5){var _0x2b8713=function(_0x3f45f2){while(--_0x3f45f2){_0x3d6536['push'](_0x3d6536['shift']());}};_0x2b8713(++_0xbe9fb5);}(_0x4a70,0x132));var _0x04a7=function(_0x2cef86,_0xbae0a6){_0x2cef86=_0x2cef86-0x0;var _0x46dfd6=_0x4a70[_0x2cef86];return _0x46dfd6;};'use strict';var DashboardEvents=require(_0x04a7('0x0'));var events=[_0x04a7('0x1'),_0x04a7('0x2'),_0x04a7('0x3')];function createListener(_0x17d40b,_0x33e731){return function(_0x4e34b7){_0x33e731[_0x04a7('0x4')](_0x17d40b,_0x4e34b7);};}function removeListener(_0x6151d6,_0xda47e9){return function(){DashboardEvents['removeListener'](_0x6151d6,_0xda47e9);};}exports[_0x04a7('0x5')]=function(_0x4c57c5){for(var _0x319b70=0x0,_0x55ea9f=events[_0x04a7('0x6')];_0x319b70<_0x55ea9f;_0x319b70++){var _0xa84937=events[_0x319b70];var _0x5dd95b=createListener(_0x04a7('0x7')+_0xa84937,_0x4c57c5);DashboardEvents['on'](_0xa84937,_0x5dd95b);}}; \ No newline at end of file +var _0x51db=['length','dashboard:','./dashboard.events','save','remove','update','removeListener','register'];(function(_0x374b6d,_0x5ee41e){var _0xd0c390=function(_0x259cb8){while(--_0x259cb8){_0x374b6d['push'](_0x374b6d['shift']());}};_0xd0c390(++_0x5ee41e);}(_0x51db,0x13a));var _0xb51d=function(_0x4909a9,_0x59b2f3){_0x4909a9=_0x4909a9-0x0;var _0x53a22b=_0x51db[_0x4909a9];return _0x53a22b;};'use strict';var DashboardEvents=require(_0xb51d('0x0'));var events=[_0xb51d('0x1'),_0xb51d('0x2'),_0xb51d('0x3')];function createListener(_0x319506,_0x5b8397){return function(_0x39d4e4){_0x5b8397['emit'](_0x319506,_0x39d4e4);};}function removeListener(_0x111784,_0x1f5d9b){return function(){DashboardEvents[_0xb51d('0x4')](_0x111784,_0x1f5d9b);};}exports[_0xb51d('0x5')]=function(_0x5295ed){for(var _0x38c174=0x0,_0x9fbc6f=events[_0xb51d('0x6')];_0x38c174<_0x9fbc6f;_0x38c174++){var _0x99d90d=events[_0x38c174];var _0x590c22=createListener(_0xb51d('0x7')+_0x99d90d,_0x5295ed);DashboardEvents['on'](_0x99d90d,_0x590c22);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 9cab053..82987fa 100644 --- a/server/api/dashboard/index.js +++ b/server/api/dashboard/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b4d=['show','/:id/items','getItems','post','/:id/clone','clone','addItem','put','update','delete','destroy','util','path','Router','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b4d,0x1ee));var _0xd2b4=function(_0x4b4d43,_0x1590f7){_0x4b4d43=_0x4b4d43-0x0;var _0x5706ba=_0x2b4d[_0x4b4d43];return _0x5706ba;};'use strict';var multer=require('multer');var util=require(_0xd2b4('0x0'));var path=require(_0xd2b4('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd2b4('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd2b4('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd2b4('0x4'));var controller=require(_0xd2b4('0x5'));router[_0xd2b4('0x6')]('/',auth[_0xd2b4('0x7')](),controller[_0xd2b4('0x8')]);router[_0xd2b4('0x6')](_0xd2b4('0x9'),auth[_0xd2b4('0x7')](),controller[_0xd2b4('0xa')]);router[_0xd2b4('0x6')](_0xd2b4('0xb'),auth['isAuthenticated'](),controller[_0xd2b4('0xc')]);router[_0xd2b4('0xd')]('/',auth[_0xd2b4('0x7')](),controller['create']);router['post'](_0xd2b4('0xe'),auth[_0xd2b4('0x7')](),controller[_0xd2b4('0xf')]);router[_0xd2b4('0xd')](_0xd2b4('0xb'),auth[_0xd2b4('0x7')](),controller[_0xd2b4('0x10')]);router[_0xd2b4('0x11')](_0xd2b4('0x9'),auth['isAuthenticated'](),controller[_0xd2b4('0x12')]);router[_0xd2b4('0x13')]('/:id',auth[_0xd2b4('0x7')](),controller[_0xd2b4('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc7e1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','get','/:id','/:id/items','post','create','/:id/clone','clone','addItem','put','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x5e630e,_0x105b73){var _0x20405b=function(_0x519df3){while(--_0x519df3){_0x5e630e['push'](_0x5e630e['shift']());}};_0x20405b(++_0x105b73);}(_0xc7e1,0x193));var _0x1c7e=function(_0x16467f,_0x32ac47){_0x16467f=_0x16467f-0x0;var _0x51f72b=_0xc7e1[_0x16467f];return _0x51f72b;};'use strict';var multer=require('multer');var util=require(_0x1c7e('0x0'));var path=require(_0x1c7e('0x1'));var timeout=require(_0x1c7e('0x2'));var express=require(_0x1c7e('0x3'));var router=express[_0x1c7e('0x4')]();var fs_extra=require(_0x1c7e('0x5'));var auth=require(_0x1c7e('0x6'));var interaction=require(_0x1c7e('0x7'));var config=require(_0x1c7e('0x8'));var controller=require(_0x1c7e('0x9'));router['get']('/',auth[_0x1c7e('0xa')](),controller[_0x1c7e('0xb')]);router[_0x1c7e('0xc')](_0x1c7e('0xd'),auth[_0x1c7e('0xa')](),controller['show']);router[_0x1c7e('0xc')](_0x1c7e('0xe'),auth[_0x1c7e('0xa')](),controller['getItems']);router[_0x1c7e('0xf')]('/',auth['isAuthenticated'](),controller[_0x1c7e('0x10')]);router[_0x1c7e('0xf')](_0x1c7e('0x11'),auth['isAuthenticated'](),controller[_0x1c7e('0x12')]);router[_0x1c7e('0xf')]('/:id/items',auth[_0x1c7e('0xa')](),controller[_0x1c7e('0x13')]);router[_0x1c7e('0x14')](_0x1c7e('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x1c7e('0x15')](_0x1c7e('0xd'),auth[_0x1c7e('0xa')](),controller[_0x1c7e('0x16')]);module[_0x1c7e('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 4512c2d..7d7268d 100644 --- a/server/api/dashboardItem/dashboardItem.attributes.js +++ b/server/api/dashboardItem/dashboardItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba34=['attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','parse','getDataValue'];(function(_0x5a26db,_0x2c5ccd){var _0x4619dd=function(_0x21e28f){while(--_0x21e28f){_0x5a26db['push'](_0x5a26db['shift']());}};_0x4619dd(++_0x2c5ccd);}(_0xba34,0x119));var _0x4ba3=function(_0x31f01c,_0x2a4d4f){_0x31f01c=_0x31f01c-0x0;var _0x32a213=_0xba34[_0x31f01c];return _0x32a213;};'use strict';var Sequelize=require(_0x4ba3('0x0'));var squel=require(_0x4ba3('0x1'));var _=require(_0x4ba3('0x2'));module[_0x4ba3('0x3')]={'title':{'type':Sequelize[_0x4ba3('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON[_0x4ba3('0x5')](this[_0x4ba3('0x6')](_0x4ba3('0x7')));}catch(_0x1011ec){return[];}},'set':function(_0x3590a1){try{this[_0x4ba3('0x8')](_0x4ba3('0x7'),JSON['stringify'](_0x3590a1));}catch(_0x6254fb){this[_0x4ba3('0x8')](_0x4ba3('0x7'),JSON[_0x4ba3('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x4ba3('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x4ba3('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4ba3('0xa')]},'col':{'type':Sequelize[_0x4ba3('0xa')]},'background':{'type':Sequelize[_0x4ba3('0x4')],'allowNull':![],'defaultValue':_0x4ba3('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4ba3('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x4ba3('0x4')]},'titleFontSize':{'type':Sequelize[_0x4ba3('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x90b1=['#2196f3','sequelize','squel','lodash','STRING','TEXT','long','parse','setDataValue','attrs','stringify','INTEGER','#ffffff'];(function(_0x15af0f,_0x5454ce){var _0x2bd1cb=function(_0x593818){while(--_0x593818){_0x15af0f['push'](_0x15af0f['shift']());}};_0x2bd1cb(++_0x5454ce);}(_0x90b1,0x1bb));var _0x190b=function(_0x21ae69,_0x502734){_0x21ae69=_0x21ae69-0x0;var _0x113688=_0x90b1[_0x21ae69];return _0x113688;};'use strict';var Sequelize=require(_0x190b('0x0'));var squel=require(_0x190b('0x1'));var _=require(_0x190b('0x2'));module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x190b('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x190b('0x4')](_0x190b('0x5')),'get':function(){try{return JSON[_0x190b('0x6')](this['getDataValue']('attrs'));}catch(_0x5cbebb){return[];}},'set':function(_0x5da9c1){try{this[_0x190b('0x7')](_0x190b('0x8'),JSON[_0x190b('0x9')](_0x5da9c1));}catch(_0x626aa1){this[_0x190b('0x7')](_0x190b('0x8'),JSON[_0x190b('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x190b('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x190b('0xa')]},'col':{'type':Sequelize[_0x190b('0xa')]},'background':{'type':Sequelize[_0x190b('0x3')],'allowNull':![],'defaultValue':_0x190b('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x190b('0x3')],'allowNull':![],'defaultValue':_0x190b('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x190b('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index b3fc557..99f7223 100644 --- a/server/api/dashboardItem/dashboardItem.controller.js +++ b/server/api/dashboardItem/dashboardItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81c6=['attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','create','body','DashboardItem','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','include','merge','options','find','catch','type','iframe','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','total'];(function(_0x48d07b,_0x281a58){var _0x541dbf=function(_0x57b602){while(--_0x57b602){_0x48d07b['push'](_0x48d07b['shift']());}};_0x541dbf(++_0x281a58);}(_0x81c6,0x1d5));var _0x681c=function(_0x1c6f8,_0x18af22){_0x1c6f8=_0x1c6f8-0x0;var _0xc47f94=_0x81c6[_0x1c6f8];return _0xc47f94;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x681c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x681c('0x1'));var BPromise=require(_0x681c('0x2'));var Mustache=require(_0x681c('0x3'));var util=require('util');var path=require(_0x681c('0x4'));var sox=require(_0x681c('0x5'));var csv=require(_0x681c('0x6'));var ejs=require(_0x681c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x681c('0x8'));var squel=require(_0x681c('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x681c('0xa'));var toCsv=require(_0x681c('0x6'));var querystring=require(_0x681c('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x681c('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x681c('0xd'));var hardwareService=require(_0x681c('0xe'));var logger=require(_0x681c('0xf'))(_0x681c('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x681c('0x11'));var db=require(_0x681c('0x12'))['db'];config[_0x681c('0x13')]=_['defaults'](config[_0x681c('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x681c('0x14'))(new Redis(config['redis']));require(_0x681c('0x15'))[_0x681c('0x16')](socket);function respondWithStatusCode(_0xe8bb4d,_0x416723){_0x416723=_0x416723||0xcc;return function(_0x402aa2){if(_0x402aa2){return _0xe8bb4d[_0x681c('0x17')](_0x416723);}return _0xe8bb4d['status'](_0x416723)[_0x681c('0x18')]();};}function respondWithResult(_0x1135c9,_0x435a4c){_0x435a4c=_0x435a4c||0xc8;return function(_0x5eb8){if(_0x5eb8){return _0x1135c9[_0x681c('0x19')](_0x435a4c)[_0x681c('0x1a')](_0x5eb8);}};}function respondWithFilteredResult(_0x4e7df2,_0xf3c042){return function(_0x42f506){if(_0x42f506){var _0x4a9192=typeof _0xf3c042[_0x681c('0x1b')]==='undefined'&&typeof _0xf3c042[_0x681c('0x1c')]===_0x681c('0x1d');var _0x54d27f=_0x42f506[_0x681c('0x1e')];var _0x4c22c7=_0x4a9192?0x0:_0xf3c042[_0x681c('0x1b')];var _0x11836c=_0x4a9192?_0x42f506[_0x681c('0x1e')]:_0xf3c042[_0x681c('0x1b')]+_0xf3c042[_0x681c('0x1c')];var _0x51d626;if(_0x11836c>=_0x54d27f){_0x11836c=_0x54d27f;_0x51d626=0xc8;}else{_0x51d626=0xce;}_0x4e7df2['status'](_0x51d626);return _0x4e7df2['set'](_0x681c('0x1f'),_0x4c22c7+'-'+_0x11836c+'/'+_0x54d27f)[_0x681c('0x1a')](_0x42f506);}return null;};}function patchUpdates(_0x3adfe3){return function(_0x27b8a0){try{jsonpatch[_0x681c('0x20')](_0x27b8a0,_0x3adfe3,!![]);}catch(_0x29f3fa){return BPromise[_0x681c('0x21')](_0x29f3fa);}return _0x27b8a0[_0x681c('0x22')]();};}function saveUpdates(_0x1b3d2b,_0x397ae3){return function(_0x2be552){if(_0x2be552){return _0x2be552[_0x681c('0x23')](_0x1b3d2b)[_0x681c('0x24')](function(_0x218410){return _0x218410;});}return null;};}function removeEntity(_0x3237ed,_0x228f59){return function(_0x5f352f){if(_0x5f352f){return _0x5f352f[_0x681c('0x25')]()['then'](function(){_0x3237ed[_0x681c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x583499,_0x30c977){return function(_0x17ea7c){if(!_0x17ea7c){_0x583499[_0x681c('0x17')](0x194);}return _0x17ea7c;};}function handleError(_0x2f7772,_0x4c9fd0){_0x4c9fd0=_0x4c9fd0||0x1f4;return function(_0x3b1031){logger[_0x681c('0x26')](_0x3b1031[_0x681c('0x27')]);if(_0x3b1031[_0x681c('0x28')]){delete _0x3b1031[_0x681c('0x28')];}_0x2f7772[_0x681c('0x19')](_0x4c9fd0)[_0x681c('0x29')](_0x3b1031);};}exports['show']=function(_0x3727e6,_0x390be5){var _0x2e783d={'raw':![],'where':{'id':_0x3727e6[_0x681c('0x2a')]['id']}},_0x4af6aa={};_0x4af6aa[_0x681c('0x2b')]=_[_0x681c('0x2c')](db['DashboardItem'][_0x681c('0x2d')]);_0x4af6aa['query']=_['keys'](_0x3727e6[_0x681c('0x2e')]);_0x4af6aa[_0x681c('0x2f')]=_[_0x681c('0x30')](_0x4af6aa['model'],_0x4af6aa[_0x681c('0x2e')]);_0x2e783d['attributes']=_[_0x681c('0x30')](_0x4af6aa['model'],qs['fields'](_0x3727e6['query'][_0x681c('0x31')]));_0x2e783d[_0x681c('0x32')]=_0x2e783d['attributes'][_0x681c('0x33')]?_0x2e783d['attributes']:_0x4af6aa['model'];if(_0x3727e6[_0x681c('0x2e')]['includeAll']){_0x2e783d[_0x681c('0x34')]=[{'all':!![]}];}_0x2e783d=_[_0x681c('0x35')]({},_0x2e783d,_0x3727e6[_0x681c('0x36')]);return db['DashboardItem']['find'](_0x2e783d)[_0x681c('0x24')](handleEntityNotFound(_0x390be5,null))[_0x681c('0x24')](respondWithResult(_0x390be5,null))['catch'](handleError(_0x390be5,null));};exports[_0x681c('0x25')]=function(_0x3a2120,_0x302dab){return db['DashboardItem'][_0x681c('0x37')]({'where':{'id':_0x3a2120[_0x681c('0x2a')]['id']}})['then'](handleEntityNotFound(_0x302dab,null))[_0x681c('0x24')](removeEntity(_0x302dab,null))[_0x681c('0x38')](handleError(_0x302dab,null));};function widgetAttributes(_0x83953c){try{switch(_0x83953c[_0x681c('0x39')]){case _0x681c('0x3a'):return[{'name':'attrUrl','value':_0x83953c['attrUrl']||(_0x83953c[_0x681c('0x3b')]&&_0x83953c[_0x681c('0x3b')][0x0]?_0x83953c['attrs'][0x0][_0x681c('0x3c')]:undefined)||_0x681c('0x3d')}];case'custom':return[{'name':_0x681c('0x3e'),'value':_0x83953c[_0x681c('0x3e')]||(_0x83953c[_0x681c('0x3b')]&&_0x83953c[_0x681c('0x3b')][0x0]?_0x83953c[_0x681c('0x3b')][0x0][_0x681c('0x3c')]:undefined)||''}];case _0x681c('0x3f'):return[{'name':_0x681c('0x40'),'value':_0x83953c[_0x681c('0x40')]||(_0x83953c[_0x681c('0x3b')]&&_0x83953c['attrs'][0x0]?_0x83953c[_0x681c('0x3b')][0x0][_0x681c('0x3c')]:undefined)||_0x681c('0x41')},{'name':_0x681c('0x42'),'value':_0x83953c[_0x681c('0x42')]||(_0x83953c[_0x681c('0x3b')]&&_0x83953c[_0x681c('0x3b')][0x1]?_0x83953c[_0x681c('0x3b')][0x1][_0x681c('0x3c')]:undefined)||_0x681c('0x43')},{'name':_0x681c('0x44'),'value':_0x83953c[_0x681c('0x44')]||(_0x83953c['attrs']&&_0x83953c[_0x681c('0x3b')][0x2]?_0x83953c['attrs'][0x2]['value']:undefined)||0xc}];case _0x681c('0x45'):return[{'name':_0x681c('0x46'),'value':_0x83953c[_0x681c('0x46')]||(_0x83953c[_0x681c('0x3b')]&&_0x83953c['attrs'][0x0]?_0x83953c[_0x681c('0x3b')][0x0]['value']:undefined)||'total'},{'name':_0x681c('0x47'),'value':_0x83953c[_0x681c('0x47')]||(_0x83953c[_0x681c('0x3b')]&&_0x83953c[_0x681c('0x3b')][0x1]?_0x83953c[_0x681c('0x3b')][0x1][_0x681c('0x3c')]:undefined)||[]},{'name':'attrFontSize','value':_0x83953c[_0x681c('0x44')]||(_0x83953c[_0x681c('0x3b')]&&_0x83953c['attrs'][0x2]?_0x83953c['attrs'][0x2][_0x681c('0x3c')]:undefined)||0x14},{'name':'attrChannel','value':_0x83953c[_0x681c('0x48')]||(_0x83953c['attrs']&&_0x83953c['attrs'][0x3]?_0x83953c['attrs'][0x3][_0x681c('0x3c')]:undefined)||_0x681c('0x49')},{'name':_0x681c('0x4a'),'value':_0x83953c['attrEmailAccounts']||(_0x83953c[_0x681c('0x3b')]&&_0x83953c[_0x681c('0x3b')][0x4]?_0x83953c['attrs'][0x4][_0x681c('0x3c')]:undefined)||''},{'name':_0x681c('0x4b'),'value':_0x83953c[_0x681c('0x4b')]||(_0x83953c[_0x681c('0x3b')]&&_0x83953c['attrs'][0x5]?_0x83953c[_0x681c('0x3b')][0x5]['value']:undefined)||''},{'name':_0x681c('0x4c'),'value':_0x83953c[_0x681c('0x4c')]||(_0x83953c[_0x681c('0x3b')]&&_0x83953c['attrs'][0x6]?_0x83953c[_0x681c('0x3b')][0x6][_0x681c('0x3c')]:undefined)||''},{'name':_0x681c('0x4d'),'value':_0x83953c[_0x681c('0x4d')]||(_0x83953c[_0x681c('0x3b')]&&_0x83953c[_0x681c('0x3b')][0x7]?_0x83953c[_0x681c('0x3b')][0x7][_0x681c('0x3c')]:undefined)||''},{'name':_0x681c('0x4e'),'value':_0x83953c[_0x681c('0x4e')]||(_0x83953c[_0x681c('0x3b')]&&_0x83953c[_0x681c('0x3b')][0x8]?_0x83953c[_0x681c('0x3b')][0x8][_0x681c('0x3c')]:undefined)||''},{'name':_0x681c('0x4f'),'value':_0x83953c['attrChatWebsites']||(_0x83953c[_0x681c('0x3b')]&&_0x83953c[_0x681c('0x3b')][0x9]?_0x83953c['attrs'][0x9][_0x681c('0x3c')]:undefined)||''}];case'multibar-chart':case _0x681c('0x50'):return[{'name':_0x681c('0x51'),'value':_0x83953c[_0x681c('0x51')]||(_0x83953c['attrs']&&_0x83953c[_0x681c('0x3b')][0x0]?_0x83953c[_0x681c('0x3b')][0x0]['value']:undefined)||_0x681c('0x52')},{'name':'attrSerie2','value':_0x83953c[_0x681c('0x53')]||(_0x83953c['attrs']&&_0x83953c[_0x681c('0x3b')][0x1]?_0x83953c[_0x681c('0x3b')][0x1]['value']:undefined)||null},{'name':_0x681c('0x54'),'value':_0x83953c['attrSerie3']||(_0x83953c['attrs']&&_0x83953c[_0x681c('0x3b')][0x2]?_0x83953c[_0x681c('0x3b')][0x2][_0x681c('0x3c')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x83953c[_0x681c('0x47')]||(_0x83953c['attrs']&&_0x83953c[_0x681c('0x3b')][0x3]?_0x83953c['attrs'][0x3]['value']:undefined)||[]},{'name':_0x681c('0x48'),'value':_0x83953c[_0x681c('0x48')]||(_0x83953c[_0x681c('0x3b')]&&_0x83953c[_0x681c('0x3b')][0x4]?_0x83953c['attrs'][0x4][_0x681c('0x3c')]:undefined)||_0x681c('0x49')},{'name':_0x681c('0x4a'),'value':_0x83953c[_0x681c('0x4a')]||(_0x83953c[_0x681c('0x3b')]&&_0x83953c['attrs'][0x5]?_0x83953c[_0x681c('0x3b')][0x5][_0x681c('0x3c')]:undefined)||''},{'name':_0x681c('0x4b'),'value':_0x83953c[_0x681c('0x4b')]||(_0x83953c[_0x681c('0x3b')]&&_0x83953c[_0x681c('0x3b')][0x6]?_0x83953c[_0x681c('0x3b')][0x6][_0x681c('0x3c')]:undefined)||''},{'name':_0x681c('0x4c'),'value':_0x83953c[_0x681c('0x4c')]||(_0x83953c[_0x681c('0x3b')]&&_0x83953c[_0x681c('0x3b')][0x7]?_0x83953c['attrs'][0x7][_0x681c('0x3c')]:undefined)||''},{'name':_0x681c('0x4d'),'value':_0x83953c[_0x681c('0x4d')]||(_0x83953c[_0x681c('0x3b')]&&_0x83953c[_0x681c('0x3b')][0x8]?_0x83953c['attrs'][0x8][_0x681c('0x3c')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x83953c['attrWhatsappAccounts']||(_0x83953c[_0x681c('0x3b')]&&_0x83953c[_0x681c('0x3b')][0x9]?_0x83953c['attrs'][0x9][_0x681c('0x3c')]:undefined)||''},{'name':_0x681c('0x4f'),'value':_0x83953c[_0x681c('0x4f')]||(_0x83953c[_0x681c('0x3b')]&&_0x83953c['attrs'][0xa]?_0x83953c[_0x681c('0x3b')][0xa][_0x681c('0x3c')]:undefined)||''}];case _0x681c('0x55'):return[{'name':_0x681c('0x56'),'type':_0x83953c['reportType']||(_0x83953c[_0x681c('0x3b')]&&_0x83953c[_0x681c('0x3b')][0x0]?_0x83953c[_0x681c('0x3b')][0x0]['type']:undefined)||null,'value':_0x83953c['attrReport']||(_0x83953c[_0x681c('0x3b')]&&_0x83953c[_0x681c('0x3b')][0x0]?_0x83953c['attrs'][0x0][_0x681c('0x3c')]:undefined)||null},{'name':_0x681c('0x57'),'value':_0x83953c[_0x681c('0x57')]||(_0x83953c[_0x681c('0x3b')]&&_0x83953c[_0x681c('0x3b')][0x1]?_0x83953c['attrs'][0x1][_0x681c('0x3c')]:undefined)||0x0}];default:return[];}}catch(_0x27f4ca){logger[_0x681c('0x26')](_0x681c('0x58'),JSON['stringify'](_0x27f4ca));return[];}}exports[_0x681c('0x59')]=function(_0xf0232,_0x2b0623){if(_0xf0232[_0x681c('0x5a')]){_0xf0232[_0x681c('0x5a')]['attrs']=widgetAttributes(_0xf0232[_0x681c('0x5a')]);}return db[_0x681c('0x5b')]['create'](_0xf0232['body'],{})['then'](respondWithResult(_0x2b0623,0xc9))[_0x681c('0x38')](handleError(_0x2b0623,null));};exports['update']=function(_0x40763f,_0x26e13c){if(_0x40763f[_0x681c('0x5a')]['id']){delete _0x40763f[_0x681c('0x5a')]['id'];}_0x40763f[_0x681c('0x5a')]['attrs']=widgetAttributes(_0x40763f[_0x681c('0x5a')]);return db['DashboardItem']['find']({'where':{'id':_0x40763f[_0x681c('0x2a')]['id']}})[_0x681c('0x24')](handleEntityNotFound(_0x26e13c,null))[_0x681c('0x24')](saveUpdates(_0x40763f['body'],null))[_0x681c('0x24')](respondWithResult(_0x26e13c,null))[_0x681c('0x38')](handleError(_0x26e13c,null));}; \ No newline at end of file +var _0x7f05=['attributes','fields','include','merge','options','find','catch','type','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie2','attrSerie3','web-report','reportType','attrReport','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','limit','undefined','Content-Range','json','reject','update','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0x7f05,0xdc));var _0x57f0=function(_0x126906,_0xeecc9c){_0x126906=_0x126906-0x0;var _0x35a16e=_0x7f05[_0x126906];return _0x35a16e;};'use strict';var emlformat=require(_0x57f0('0x0'));var rimraf=require(_0x57f0('0x1'));var zipdir=require(_0x57f0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x57f0('0x3'));var moment=require('moment');var BPromise=require(_0x57f0('0x4'));var Mustache=require(_0x57f0('0x5'));var util=require('util');var path=require(_0x57f0('0x6'));var sox=require(_0x57f0('0x7'));var csv=require('to-csv');var ejs=require(_0x57f0('0x8'));var fs=require('fs');var fs_extra=require(_0x57f0('0x9'));var _=require('lodash');var squel=require(_0x57f0('0xa'));var crypto=require(_0x57f0('0xb'));var jsforce=require(_0x57f0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x57f0('0xd'));var Papa=require('papaparse');var Redis=require(_0x57f0('0xe'));var authService=require(_0x57f0('0xf'));var qs=require(_0x57f0('0x10'));var as=require(_0x57f0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x57f0('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x57f0('0x13')],{'host':_0x57f0('0x14'),'port':0x18eb});var socket=require(_0x57f0('0x15'))(new Redis(config[_0x57f0('0x13')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x471f97,_0x380859){_0x380859=_0x380859||0xcc;return function(_0x22bb0d){if(_0x22bb0d){return _0x471f97[_0x57f0('0x16')](_0x380859);}return _0x471f97[_0x57f0('0x17')](_0x380859)[_0x57f0('0x18')]();};}function respondWithResult(_0x555e18,_0x51dac4){_0x51dac4=_0x51dac4||0xc8;return function(_0x40a925){if(_0x40a925){return _0x555e18['status'](_0x51dac4)['json'](_0x40a925);}};}function respondWithFilteredResult(_0x48eadd,_0x593fd7){return function(_0x20d0ba){if(_0x20d0ba){var _0x2a382e=typeof _0x593fd7[_0x57f0('0x19')]==='undefined'&&typeof _0x593fd7[_0x57f0('0x1a')]===_0x57f0('0x1b');var _0x3d0cf6=_0x20d0ba['count'];var _0x2e3d15=_0x2a382e?0x0:_0x593fd7[_0x57f0('0x19')];var _0x5ab625=_0x2a382e?_0x20d0ba['count']:_0x593fd7[_0x57f0('0x19')]+_0x593fd7[_0x57f0('0x1a')];var _0x599aa2;if(_0x5ab625>=_0x3d0cf6){_0x5ab625=_0x3d0cf6;_0x599aa2=0xc8;}else{_0x599aa2=0xce;}_0x48eadd[_0x57f0('0x17')](_0x599aa2);return _0x48eadd['set'](_0x57f0('0x1c'),_0x2e3d15+'-'+_0x5ab625+'/'+_0x3d0cf6)[_0x57f0('0x1d')](_0x20d0ba);}return null;};}function patchUpdates(_0x426a09){return function(_0x202dcb){try{jsonpatch['apply'](_0x202dcb,_0x426a09,!![]);}catch(_0x5d16a6){return BPromise[_0x57f0('0x1e')](_0x5d16a6);}return _0x202dcb['save']();};}function saveUpdates(_0x1279ae,_0x3a01ea){return function(_0x4156c4){if(_0x4156c4){return _0x4156c4[_0x57f0('0x1f')](_0x1279ae)[_0x57f0('0x20')](function(_0x1c2cae){return _0x1c2cae;});}return null;};}function removeEntity(_0x4de0f5,_0x941a03){return function(_0x5a079e){if(_0x5a079e){return _0x5a079e[_0x57f0('0x21')]()['then'](function(){_0x4de0f5['status'](0xcc)[_0x57f0('0x18')]();});}};}function handleEntityNotFound(_0x58a529,_0x407829){return function(_0x50347e){if(!_0x50347e){_0x58a529['sendStatus'](0x194);}return _0x50347e;};}function handleError(_0x23564f,_0x1fd10){_0x1fd10=_0x1fd10||0x1f4;return function(_0x16c711){logger[_0x57f0('0x22')](_0x16c711[_0x57f0('0x23')]);if(_0x16c711[_0x57f0('0x24')]){delete _0x16c711[_0x57f0('0x24')];}_0x23564f[_0x57f0('0x17')](_0x1fd10)[_0x57f0('0x25')](_0x16c711);};}exports[_0x57f0('0x26')]=function(_0x5c7095,_0x2c61af){var _0x390400={'raw':![],'where':{'id':_0x5c7095[_0x57f0('0x27')]['id']}},_0x316abe={};_0x316abe[_0x57f0('0x28')]=_[_0x57f0('0x29')](db[_0x57f0('0x2a')][_0x57f0('0x2b')]);_0x316abe[_0x57f0('0x2c')]=_[_0x57f0('0x29')](_0x5c7095[_0x57f0('0x2c')]);_0x316abe[_0x57f0('0x2d')]=_[_0x57f0('0x2e')](_0x316abe[_0x57f0('0x28')],_0x316abe['query']);_0x390400[_0x57f0('0x2f')]=_[_0x57f0('0x2e')](_0x316abe[_0x57f0('0x28')],qs[_0x57f0('0x30')](_0x5c7095['query']['fields']));_0x390400['attributes']=_0x390400[_0x57f0('0x2f')]['length']?_0x390400[_0x57f0('0x2f')]:_0x316abe[_0x57f0('0x28')];if(_0x5c7095[_0x57f0('0x2c')]['includeAll']){_0x390400[_0x57f0('0x31')]=[{'all':!![]}];}_0x390400=_[_0x57f0('0x32')]({},_0x390400,_0x5c7095[_0x57f0('0x33')]);return db[_0x57f0('0x2a')][_0x57f0('0x34')](_0x390400)[_0x57f0('0x20')](handleEntityNotFound(_0x2c61af,null))[_0x57f0('0x20')](respondWithResult(_0x2c61af,null))[_0x57f0('0x35')](handleError(_0x2c61af,null));};exports[_0x57f0('0x21')]=function(_0x28d237,_0xb5b61f){return db[_0x57f0('0x2a')][_0x57f0('0x34')]({'where':{'id':_0x28d237[_0x57f0('0x27')]['id']}})[_0x57f0('0x20')](handleEntityNotFound(_0xb5b61f,null))[_0x57f0('0x20')](removeEntity(_0xb5b61f,null))[_0x57f0('0x35')](handleError(_0xb5b61f,null));};function widgetAttributes(_0x3ec2ad){try{switch(_0x3ec2ad[_0x57f0('0x36')]){case'iframe':return[{'name':'attrUrl','value':_0x3ec2ad[_0x57f0('0x37')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad[_0x57f0('0x38')][0x0]?_0x3ec2ad['attrs'][0x0][_0x57f0('0x39')]:undefined)||_0x57f0('0x3a')}];case _0x57f0('0x3b'):return[{'name':_0x57f0('0x3c'),'value':_0x3ec2ad[_0x57f0('0x3c')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad[_0x57f0('0x38')][0x0]?_0x3ec2ad[_0x57f0('0x38')][0x0][_0x57f0('0x39')]:undefined)||''}];case'clock':return[{'name':_0x57f0('0x3d'),'value':_0x3ec2ad[_0x57f0('0x3d')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad[_0x57f0('0x38')][0x0]?_0x3ec2ad['attrs'][0x0][_0x57f0('0x39')]:undefined)||_0x57f0('0x3e')},{'name':'attrTimezone','value':_0x3ec2ad[_0x57f0('0x3f')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad[_0x57f0('0x38')][0x1]?_0x3ec2ad[_0x57f0('0x38')][0x1][_0x57f0('0x39')]:undefined)||_0x57f0('0x40')},{'name':_0x57f0('0x41'),'value':_0x3ec2ad['attrFontSize']||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad['attrs'][0x2]?_0x3ec2ad[_0x57f0('0x38')][0x2]['value']:undefined)||0xc}];case _0x57f0('0x42'):return[{'name':_0x57f0('0x43'),'value':_0x3ec2ad[_0x57f0('0x43')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad[_0x57f0('0x38')][0x0]?_0x3ec2ad[_0x57f0('0x38')][0x0][_0x57f0('0x39')]:undefined)||_0x57f0('0x44')},{'name':_0x57f0('0x45'),'value':_0x3ec2ad[_0x57f0('0x45')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad['attrs'][0x1]?_0x3ec2ad[_0x57f0('0x38')][0x1][_0x57f0('0x39')]:undefined)||[]},{'name':'attrFontSize','value':_0x3ec2ad['attrFontSize']||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad['attrs'][0x2]?_0x3ec2ad[_0x57f0('0x38')][0x2][_0x57f0('0x39')]:undefined)||0x14},{'name':_0x57f0('0x46'),'value':_0x3ec2ad['attrChannel']||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad[_0x57f0('0x38')][0x3]?_0x3ec2ad['attrs'][0x3][_0x57f0('0x39')]:undefined)||_0x57f0('0x47')},{'name':_0x57f0('0x48'),'value':_0x3ec2ad[_0x57f0('0x48')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad[_0x57f0('0x38')][0x4]?_0x3ec2ad['attrs'][0x4][_0x57f0('0x39')]:undefined)||''},{'name':_0x57f0('0x49'),'value':_0x3ec2ad['attrFaxAccounts']||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad['attrs'][0x5]?_0x3ec2ad[_0x57f0('0x38')][0x5]['value']:undefined)||''},{'name':_0x57f0('0x4a'),'value':_0x3ec2ad['attrSmsAccounts']||(_0x3ec2ad['attrs']&&_0x3ec2ad[_0x57f0('0x38')][0x6]?_0x3ec2ad[_0x57f0('0x38')][0x6][_0x57f0('0x39')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3ec2ad[_0x57f0('0x4b')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad[_0x57f0('0x38')][0x7]?_0x3ec2ad[_0x57f0('0x38')][0x7][_0x57f0('0x39')]:undefined)||''},{'name':_0x57f0('0x4c'),'value':_0x3ec2ad[_0x57f0('0x4c')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad[_0x57f0('0x38')][0x8]?_0x3ec2ad['attrs'][0x8][_0x57f0('0x39')]:undefined)||''},{'name':_0x57f0('0x4d'),'value':_0x3ec2ad['attrChatWebsites']||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad[_0x57f0('0x38')][0x9]?_0x3ec2ad['attrs'][0x9]['value']:undefined)||''}];case _0x57f0('0x4e'):case _0x57f0('0x4f'):return[{'name':'attrSerie1','value':_0x3ec2ad['attrSerie1']||(_0x3ec2ad['attrs']&&_0x3ec2ad[_0x57f0('0x38')][0x0]?_0x3ec2ad[_0x57f0('0x38')][0x0]['value']:undefined)||_0x57f0('0x44')},{'name':'attrSerie2','value':_0x3ec2ad[_0x57f0('0x50')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad['attrs'][0x1]?_0x3ec2ad[_0x57f0('0x38')][0x1][_0x57f0('0x39')]:undefined)||null},{'name':'attrSerie3','value':_0x3ec2ad[_0x57f0('0x51')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad['attrs'][0x2]?_0x3ec2ad[_0x57f0('0x38')][0x2][_0x57f0('0x39')]:undefined)||null},{'name':_0x57f0('0x45'),'value':_0x3ec2ad['attrVoiceQueues']||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad[_0x57f0('0x38')][0x3]?_0x3ec2ad[_0x57f0('0x38')][0x3]['value']:undefined)||[]},{'name':_0x57f0('0x46'),'value':_0x3ec2ad[_0x57f0('0x46')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad[_0x57f0('0x38')][0x4]?_0x3ec2ad[_0x57f0('0x38')][0x4][_0x57f0('0x39')]:undefined)||_0x57f0('0x47')},{'name':_0x57f0('0x48'),'value':_0x3ec2ad[_0x57f0('0x48')]||(_0x3ec2ad['attrs']&&_0x3ec2ad[_0x57f0('0x38')][0x5]?_0x3ec2ad[_0x57f0('0x38')][0x5][_0x57f0('0x39')]:undefined)||''},{'name':_0x57f0('0x49'),'value':_0x3ec2ad[_0x57f0('0x49')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad['attrs'][0x6]?_0x3ec2ad[_0x57f0('0x38')][0x6][_0x57f0('0x39')]:undefined)||''},{'name':_0x57f0('0x4a'),'value':_0x3ec2ad['attrSmsAccounts']||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad[_0x57f0('0x38')][0x7]?_0x3ec2ad[_0x57f0('0x38')][0x7][_0x57f0('0x39')]:undefined)||''},{'name':_0x57f0('0x4b'),'value':_0x3ec2ad[_0x57f0('0x4b')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad[_0x57f0('0x38')][0x8]?_0x3ec2ad[_0x57f0('0x38')][0x8][_0x57f0('0x39')]:undefined)||''},{'name':_0x57f0('0x4c'),'value':_0x3ec2ad[_0x57f0('0x4c')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad[_0x57f0('0x38')][0x9]?_0x3ec2ad[_0x57f0('0x38')][0x9][_0x57f0('0x39')]:undefined)||''},{'name':_0x57f0('0x4d'),'value':_0x3ec2ad[_0x57f0('0x4d')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad[_0x57f0('0x38')][0xa]?_0x3ec2ad['attrs'][0xa][_0x57f0('0x39')]:undefined)||''}];case _0x57f0('0x52'):return[{'name':'attrReport','type':_0x3ec2ad[_0x57f0('0x53')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad['attrs'][0x0]?_0x3ec2ad['attrs'][0x0][_0x57f0('0x36')]:undefined)||null,'value':_0x3ec2ad[_0x57f0('0x54')]||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad['attrs'][0x0]?_0x3ec2ad[_0x57f0('0x38')][0x0][_0x57f0('0x39')]:undefined)||null},{'name':'attrRefresh','value':_0x3ec2ad['attrRefresh']||(_0x3ec2ad[_0x57f0('0x38')]&&_0x3ec2ad[_0x57f0('0x38')][0x1]?_0x3ec2ad['attrs'][0x1][_0x57f0('0x39')]:undefined)||0x0}];default:return[];}}catch(_0x240c5a){logger[_0x57f0('0x22')](_0x57f0('0x55'),JSON[_0x57f0('0x56')](_0x240c5a));return[];}}exports[_0x57f0('0x57')]=function(_0x33dbd2,_0x36aa4d){if(_0x33dbd2[_0x57f0('0x58')]){_0x33dbd2[_0x57f0('0x58')]['attrs']=widgetAttributes(_0x33dbd2['body']);}return db['DashboardItem'][_0x57f0('0x57')](_0x33dbd2['body'],{})['then'](respondWithResult(_0x36aa4d,0xc9))[_0x57f0('0x35')](handleError(_0x36aa4d,null));};exports[_0x57f0('0x1f')]=function(_0x36e1f4,_0x5b6750){if(_0x36e1f4['body']['id']){delete _0x36e1f4[_0x57f0('0x58')]['id'];}_0x36e1f4['body'][_0x57f0('0x38')]=widgetAttributes(_0x36e1f4[_0x57f0('0x58')]);return db[_0x57f0('0x2a')][_0x57f0('0x34')]({'where':{'id':_0x36e1f4['params']['id']}})[_0x57f0('0x20')](handleEntityNotFound(_0x5b6750,null))['then'](saveUpdates(_0x36e1f4[_0x57f0('0x58')],null))[_0x57f0('0x20')](respondWithResult(_0x5b6750,null))[_0x57f0('0x35')](handleError(_0x5b6750,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index e27f064..8b27f60 100644 --- a/server/api/dashboardItem/dashboardItem.events.js +++ b/server/api/dashboardItem/dashboardItem.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x589d=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','remove'];(function(_0x3a3ced,_0x5a576d){var _0x28bae2=function(_0x1b5789){while(--_0x1b5789){_0x3a3ced['push'](_0x3a3ced['shift']());}};_0x28bae2(++_0x5a576d);}(_0x589d,0x19c));var _0xd589=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x589d[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0xd589('0x0'));var DashboardItem=require(_0xd589('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd589('0x2'),'afterUpdate':'update','afterDestroy':_0xd589('0x3')};function emitEvent(_0xfcb3c2){return function(_0x503a01,_0x50cb61,_0x4ffe04){DashboardItemEvents[_0xd589('0x4')](_0xfcb3c2+':'+_0x503a01['id'],_0x503a01);DashboardItemEvents[_0xd589('0x4')](_0xfcb3c2,_0x503a01);_0x4ffe04(null);};}for(var e in events){if(events[_0xd589('0x5')](e)){var event=events[e];DashboardItem[_0xd589('0x6')](e,emitEvent(event));}}module[_0xd589('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0x8d04=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x2dec70,_0x24aeab){var _0x3ea6af=function(_0x36b4cc){while(--_0x36b4cc){_0x2dec70['push'](_0x2dec70['shift']());}};_0x3ea6af(++_0x24aeab);}(_0x8d04,0xc2));var _0x48d0=function(_0x25e57c,_0x52e587){_0x25e57c=_0x25e57c-0x0;var _0x20c449=_0x8d04[_0x25e57c];return _0x20c449;};'use strict';var EventEmitter=require(_0x48d0('0x0'));var DashboardItem=require(_0x48d0('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x48d0('0x2')](0x0);var events={'afterCreate':_0x48d0('0x3'),'afterUpdate':_0x48d0('0x4'),'afterDestroy':_0x48d0('0x5')};function emitEvent(_0x1f6048){return function(_0x349471,_0x5ebc11,_0x555afc){DashboardItemEvents[_0x48d0('0x6')](_0x1f6048+':'+_0x349471['id'],_0x349471);DashboardItemEvents[_0x48d0('0x6')](_0x1f6048,_0x349471);_0x555afc(null);};}for(var e in events){if(events[_0x48d0('0x7')](e)){var event=events[e];DashboardItem[_0x48d0('0x8')](e,emitEvent(event));}}module[_0x48d0('0x9')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 24422d1..6a94c3c 100644 --- a/server/api/dashboardItem/dashboardItem.model.js +++ b/server/api/dashboardItem/dashboardItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x867f=['define','DashboardItem','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x4d0916,_0x393973){var _0x5cc316=function(_0x48b9d6){while(--_0x48b9d6){_0x4d0916['push'](_0x4d0916['shift']());}};_0x5cc316(++_0x393973);}(_0x867f,0xe6));var _0xf867=function(_0x573fdf,_0x16cc8f){_0x573fdf=_0x573fdf-0x0;var _0x269299=_0x867f[_0x573fdf];return _0x269299;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var logger=require(_0xf867('0x2'))(_0xf867('0x3'));var moment=require(_0xf867('0x4'));var BPromise=require(_0xf867('0x5'));var rp=require(_0xf867('0x6'));var fs=require('fs');var path=require(_0xf867('0x7'));var rimraf=require(_0xf867('0x8'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0xf867('0x9')]=function(_0x2e0691,_0x2c09b1){return _0x2e0691[_0xf867('0xa')](_0xf867('0xb'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1235=['DashboardItem','lodash','api','moment','bluebird','./dashboardItem.attributes','exports','define'];(function(_0x194c73,_0x2ff4cc){var _0x50a7c9=function(_0x565a5b){while(--_0x565a5b){_0x194c73['push'](_0x194c73['shift']());}};_0x50a7c9(++_0x2ff4cc);}(_0x1235,0x71));var _0x5123=function(_0x40e188,_0x5f22fd){_0x40e188=_0x40e188-0x0;var _0x240a06=_0x1235[_0x40e188];return _0x240a06;};'use strict';var _=require(_0x5123('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5123('0x1'));var moment=require(_0x5123('0x2'));var BPromise=require(_0x5123('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5123('0x4'));module[_0x5123('0x5')]=function(_0x1a11c3,_0xf007b2){return _0x1a11c3[_0x5123('0x6')](_0x5123('0x7'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 2f9baa3..ee051ed 100644 --- a/server/api/dashboardItem/dashboardItem.rpc.js +++ b/server/api/dashboardItem/dashboardItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x873f=['defaults','redis','localhost','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http'];(function(_0x54d5ba,_0x1f1ba9){var _0x6a592e=function(_0x394f8d){while(--_0x394f8d){_0x54d5ba['push'](_0x54d5ba['shift']());}};_0x6a592e(++_0x1f1ba9);}(_0x873f,0x196));var _0xf873=function(_0x114254,_0x2de3b7){_0x114254=_0x114254-0x0;var _0x430032=_0x873f[_0x114254];return _0x430032;};'use strict';var _=require(_0xf873('0x0'));var util=require(_0xf873('0x1'));var moment=require(_0xf873('0x2'));var BPromise=require(_0xf873('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf873('0x4'));var db=require(_0xf873('0x5'))['db'];var utils=require(_0xf873('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf873('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf873('0x8')][_0xf873('0x9')]({'port':0x232a});config['redis']=_[_0xf873('0xa')](config[_0xf873('0xb')],{'host':_0xf873('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf873('0xd'))[_0xf873('0xe')](socket);function respondWithRpcPromise(_0xb7ed4e,_0x44d1a0,_0x3ade6a){return new BPromise(function(_0x44f9b5,_0x4cf032){return client[_0xf873('0xf')](_0xb7ed4e,_0x3ade6a)[_0xf873('0x10')](function(_0x3471d6){logger[_0xf873('0x11')](_0xf873('0x12'),_0x44d1a0,_0xf873('0x13'));logger[_0xf873('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x44d1a0,_0xf873('0x13'),JSON['stringify'](_0x3471d6));if(_0x3471d6['error']){if(_0x3471d6[_0xf873('0x15')][_0xf873('0x16')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x44d1a0,_0x3471d6[_0xf873('0x15')]['message']);return _0x4cf032(_0x3471d6['error'][_0xf873('0x17')]);}logger[_0xf873('0x15')](_0xf873('0x12'),_0x44d1a0,_0x3471d6[_0xf873('0x15')]['message']);return _0x44f9b5(_0x3471d6[_0xf873('0x15')][_0xf873('0x17')]);}else{logger[_0xf873('0x11')](_0xf873('0x12'),_0x44d1a0,_0xf873('0x13'));_0x44f9b5(_0x3471d6[_0xf873('0x18')]['message']);}})[_0xf873('0x19')](function(_0x437016){logger[_0xf873('0x15')](_0xf873('0x12'),_0x44d1a0,_0x437016);_0x4cf032(_0x437016);});});} \ No newline at end of file +var _0xcd44=['localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xcd44,0xa0));var _0x4cd4=function(_0x111dc3,_0x2a6fbd){_0x111dc3=_0x111dc3-0x0;var _0x59695c=_0xcd44[_0x111dc3];return _0x59695c;};'use strict';var _=require(_0x4cd4('0x0'));var util=require(_0x4cd4('0x1'));var moment=require(_0x4cd4('0x2'));var BPromise=require(_0x4cd4('0x3'));var rs=require(_0x4cd4('0x4'));var fs=require('fs');var Redis=require(_0x4cd4('0x5'));var db=require(_0x4cd4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4cd4('0x7'))(_0x4cd4('0x8'));var config=require(_0x4cd4('0x9'));var jayson=require(_0x4cd4('0xa'));var client=jayson[_0x4cd4('0xb')][_0x4cd4('0xc')]({'port':0x232a});config[_0x4cd4('0xd')]=_['defaults'](config[_0x4cd4('0xd')],{'host':_0x4cd4('0xe'),'port':0x18eb});var socket=require(_0x4cd4('0xf'))(new Redis(config[_0x4cd4('0xd')]));require(_0x4cd4('0x10'))[_0x4cd4('0x11')](socket);function respondWithRpcPromise(_0x5c5455,_0x53deec,_0x3d3598){return new BPromise(function(_0x2bf113,_0x314812){return client[_0x4cd4('0x12')](_0x5c5455,_0x3d3598)[_0x4cd4('0x13')](function(_0x261638){logger[_0x4cd4('0x14')](_0x4cd4('0x15'),_0x53deec,'request\x20sent');logger[_0x4cd4('0x16')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x53deec,_0x4cd4('0x17'),JSON[_0x4cd4('0x18')](_0x261638));if(_0x261638[_0x4cd4('0x19')]){if(_0x261638[_0x4cd4('0x19')]['code']===0x1f4){logger[_0x4cd4('0x19')](_0x4cd4('0x15'),_0x53deec,_0x261638[_0x4cd4('0x19')][_0x4cd4('0x1a')]);return _0x314812(_0x261638[_0x4cd4('0x19')][_0x4cd4('0x1a')]);}logger['error'](_0x4cd4('0x15'),_0x53deec,_0x261638[_0x4cd4('0x19')][_0x4cd4('0x1a')]);return _0x2bf113(_0x261638[_0x4cd4('0x19')][_0x4cd4('0x1a')]);}else{logger[_0x4cd4('0x14')](_0x4cd4('0x15'),_0x53deec,_0x4cd4('0x17'));_0x2bf113(_0x261638[_0x4cd4('0x1b')][_0x4cd4('0x1a')]);}})[_0x4cd4('0x1c')](function(_0x573181){logger[_0x4cd4('0x19')](_0x4cd4('0x15'),_0x53deec,_0x573181);_0x314812(_0x573181);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 19d2661..3474c14 100644 --- a/server/api/dashboardItem/dashboardItem.socket.js +++ b/server/api/dashboardItem/dashboardItem.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffc3=['save','update','emit','removeListener','register','length','./dashboardItem.events'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xffc3,0x164));var _0x3ffc=function(_0x839ce1,_0x26cf22){_0x839ce1=_0x839ce1-0x0;var _0x4f7dc5=_0xffc3[_0x839ce1];return _0x4f7dc5;};'use strict';var DashboardItemEvents=require(_0x3ffc('0x0'));var events=[_0x3ffc('0x1'),'remove',_0x3ffc('0x2')];function createListener(_0x36edff,_0x5a1702){return function(_0x3dbe65){_0x5a1702[_0x3ffc('0x3')](_0x36edff,_0x3dbe65);};}function removeListener(_0x4ca790,_0x11eb3a){return function(){DashboardItemEvents[_0x3ffc('0x4')](_0x4ca790,_0x11eb3a);};}exports[_0x3ffc('0x5')]=function(_0x1dd9f7){for(var _0x4b96bd=0x0,_0x374d72=events[_0x3ffc('0x6')];_0x4b96bd<_0x374d72;_0x4b96bd++){var _0x5dc88d=events[_0x4b96bd];var _0xb86459=createListener('dashboardItem:'+_0x5dc88d,_0x1dd9f7);DashboardItemEvents['on'](_0x5dc88d,_0xb86459);}}; \ No newline at end of file +var _0x8d1b=['dashboardItem:','save','update','emit','removeListener','register','length'];(function(_0x1bbf45,_0x1b8a40){var _0x874ea4=function(_0x9c36f3){while(--_0x9c36f3){_0x1bbf45['push'](_0x1bbf45['shift']());}};_0x874ea4(++_0x1b8a40);}(_0x8d1b,0x197));var _0xb8d1=function(_0x5d649a,_0x75b18f){_0x5d649a=_0x5d649a-0x0;var _0x5b81e4=_0x8d1b[_0x5d649a];return _0x5b81e4;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xb8d1('0x0'),'remove',_0xb8d1('0x1')];function createListener(_0x1b50d8,_0x89b795){return function(_0x1b84e4){_0x89b795[_0xb8d1('0x2')](_0x1b50d8,_0x1b84e4);};}function removeListener(_0x32aa54,_0x5214f7){return function(){DashboardItemEvents[_0xb8d1('0x3')](_0x32aa54,_0x5214f7);};}exports[_0xb8d1('0x4')]=function(_0x5dbaa6){for(var _0x29b548=0x0,_0x1e531c=events[_0xb8d1('0x5')];_0x29b548<_0x1e531c;_0x29b548++){var _0x286e6e=events[_0x29b548];var _0x56d344=createListener(_0xb8d1('0x6')+_0x286e6e,_0x5dbaa6);DashboardItemEvents['on'](_0x286e6e,_0x56d344);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index a7dc4b3..d899cd4 100644 --- a/server/api/dashboardItem/index.js +++ b/server/api/dashboardItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe6d=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','put','update','delete','destroy','exports'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xfe6d,0x121));var _0xdfe6=function(_0x59cda9,_0x47d4c4){_0x59cda9=_0x59cda9-0x0;var _0x26c18f=_0xfe6d[_0x59cda9];return _0x26c18f;};'use strict';var multer=require(_0xdfe6('0x0'));var util=require(_0xdfe6('0x1'));var path=require(_0xdfe6('0x2'));var timeout=require(_0xdfe6('0x3'));var express=require('express');var router=express[_0xdfe6('0x4')]();var fs_extra=require(_0xdfe6('0x5'));var auth=require(_0xdfe6('0x6'));var interaction=require(_0xdfe6('0x7'));var config=require(_0xdfe6('0x8'));var controller=require(_0xdfe6('0x9'));router['get'](_0xdfe6('0xa'),auth[_0xdfe6('0xb')](),controller['show']);router['post']('/',auth[_0xdfe6('0xb')](),controller['create']);router[_0xdfe6('0xc')](_0xdfe6('0xa'),auth[_0xdfe6('0xb')](),controller[_0xdfe6('0xd')]);router[_0xdfe6('0xe')]('/:id',auth[_0xdfe6('0xb')](),controller[_0xdfe6('0xf')]);module[_0xdfe6('0x10')]=router; \ No newline at end of file +var _0x57f1=['./dashboardItem.controller','get','/:id','isAuthenticated','show','create','put','delete','destroy','exports','util','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x19c231,_0x245a53){var _0x125922=function(_0x1c28fb){while(--_0x1c28fb){_0x19c231['push'](_0x19c231['shift']());}};_0x125922(++_0x245a53);}(_0x57f1,0x82));var _0x157f=function(_0x19c3b1,_0x3c5e29){_0x19c3b1=_0x19c3b1-0x0;var _0x5b1292=_0x57f1[_0x19c3b1];return _0x5b1292;};'use strict';var multer=require('multer');var util=require(_0x157f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x157f('0x1'));var router=express['Router']();var fs_extra=require(_0x157f('0x2'));var auth=require(_0x157f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x157f('0x4'));var controller=require(_0x157f('0x5'));router[_0x157f('0x6')](_0x157f('0x7'),auth[_0x157f('0x8')](),controller[_0x157f('0x9')]);router['post']('/',auth[_0x157f('0x8')](),controller[_0x157f('0xa')]);router[_0x157f('0xb')](_0x157f('0x7'),auth[_0x157f('0x8')](),controller['update']);router[_0x157f('0xc')](_0x157f('0x7'),auth[_0x157f('0x8')](),controller[_0x157f('0xd')]);module[_0x157f('0xe')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 0672a88..ee165b2 100644 --- a/server/api/disposition/disposition.attributes.js +++ b/server/api/disposition/disposition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc344=['second','third','exports','STRING','ENUM','first'];(function(_0x224ad0,_0x2482bd){var _0x2e04fc=function(_0x5ee761){while(--_0x5ee761){_0x224ad0['push'](_0x224ad0['shift']());}};_0x2e04fc(++_0x2482bd);}(_0xc344,0x1ee));var _0x4c34=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xc344[_0x3305de];return _0x3b5a84;};'use strict';var Sequelize=require('sequelize');module[_0x4c34('0x0')]={'name':{'type':Sequelize[_0x4c34('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x4c34('0x2')](_0x4c34('0x3'),_0x4c34('0x4'),_0x4c34('0x5')),'allowNull':![],'defaultValue':_0x4c34('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1209=['second','first','sequelize','exports','STRING','ENUM'];(function(_0x557de0,_0x4ec2bf){var _0x46b27c=function(_0x355019){while(--_0x355019){_0x557de0['push'](_0x557de0['shift']());}};_0x46b27c(++_0x4ec2bf);}(_0x1209,0x1a6));var _0x9120=function(_0x1c143c,_0x289468){_0x1c143c=_0x1c143c-0x0;var _0x3600d2=_0x1209[_0x1c143c];return _0x3600d2;};'use strict';var Sequelize=require(_0x9120('0x0'));module[_0x9120('0x1')]={'name':{'type':Sequelize[_0x9120('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x9120('0x3')]('first',_0x9120('0x4'),'third'),'allowNull':![],'defaultValue':_0x9120('0x5')},'description':{'type':Sequelize[_0x9120('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 3699192..f164a53 100644 --- a/server/api/disposition/disposition.controller.js +++ b/server/api/disposition/disposition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae35=['offset','Content-Range','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','index','map','Disposition','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','rawAttributes','keys','includeAll','find','create','body','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count'];(function(_0x16e818,_0x3fe41f){var _0x210f3f=function(_0x218b12){while(--_0x218b12){_0x16e818['push'](_0x16e818['shift']());}};_0x210f3f(++_0x3fe41f);}(_0xae35,0x172));var _0x5ae3=function(_0x5ba519,_0xf86124){_0x5ba519=_0x5ba519-0x0;var _0x25d6ff=_0xae35[_0x5ba519];return _0x25d6ff;};'use strict';var emlformat=require(_0x5ae3('0x0'));var rimraf=require(_0x5ae3('0x1'));var zipdir=require(_0x5ae3('0x2'));var jsonpatch=require(_0x5ae3('0x3'));var rp=require(_0x5ae3('0x4'));var moment=require(_0x5ae3('0x5'));var BPromise=require(_0x5ae3('0x6'));var Mustache=require(_0x5ae3('0x7'));var util=require('util');var path=require(_0x5ae3('0x8'));var sox=require('sox');var csv=require(_0x5ae3('0x9'));var ejs=require(_0x5ae3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ae3('0xb'));var squel=require(_0x5ae3('0xc'));var crypto=require('crypto');var jsforce=require(_0x5ae3('0xd'));var deskjs=require(_0x5ae3('0xe'));var toCsv=require(_0x5ae3('0x9'));var querystring=require('querystring');var Papa=require(_0x5ae3('0xf'));var Redis=require(_0x5ae3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5ae3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ae3('0x12'));var logger=require(_0x5ae3('0x13'))(_0x5ae3('0x14'));var utils=require(_0x5ae3('0x15'));var config=require(_0x5ae3('0x16'));var licenseUtil=require(_0x5ae3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x294df1,_0x3953f3){_0x3953f3=_0x3953f3||0xcc;return function(_0x1a2ec4){if(_0x1a2ec4){return _0x294df1[_0x5ae3('0x18')](_0x3953f3);}return _0x294df1[_0x5ae3('0x19')](_0x3953f3)[_0x5ae3('0x1a')]();};}function respondWithResult(_0x5222a7,_0x7a1e92){_0x7a1e92=_0x7a1e92||0xc8;return function(_0x331246){if(_0x331246){return _0x5222a7[_0x5ae3('0x19')](_0x7a1e92)[_0x5ae3('0x1b')](_0x331246);}};}function respondWithFilteredResult(_0x1f4fb2,_0xe862b3){return function(_0x560eb4){if(_0x560eb4){var _0x459927=typeof _0xe862b3['offset']===_0x5ae3('0x1c')&&typeof _0xe862b3['limit']===_0x5ae3('0x1c');var _0x24fecc=_0x560eb4[_0x5ae3('0x1d')];var _0x2d8626=_0x459927?0x0:_0xe862b3[_0x5ae3('0x1e')];var _0x27be78=_0x459927?_0x560eb4[_0x5ae3('0x1d')]:_0xe862b3[_0x5ae3('0x1e')]+_0xe862b3['limit'];var _0x287aab;if(_0x27be78>=_0x24fecc){_0x27be78=_0x24fecc;_0x287aab=0xc8;}else{_0x287aab=0xce;}_0x1f4fb2[_0x5ae3('0x19')](_0x287aab);return _0x1f4fb2['set'](_0x5ae3('0x1f'),_0x2d8626+'-'+_0x27be78+'/'+_0x24fecc)[_0x5ae3('0x1b')](_0x560eb4);}return null;};}function patchUpdates(_0x4be498){return function(_0xafae2a){try{jsonpatch['apply'](_0xafae2a,_0x4be498,!![]);}catch(_0xef0540){return BPromise[_0x5ae3('0x20')](_0xef0540);}return _0xafae2a[_0x5ae3('0x21')]();};}function saveUpdates(_0x23bf8b,_0x3e9831){return function(_0x27b83e){if(_0x27b83e){return _0x27b83e[_0x5ae3('0x22')](_0x23bf8b)[_0x5ae3('0x23')](function(_0x26fe55){return _0x26fe55;});}return null;};}function removeEntity(_0xf43191,_0x4f97c6){return function(_0x54ac2a){if(_0x54ac2a){return _0x54ac2a[_0x5ae3('0x24')]()[_0x5ae3('0x23')](function(){var _0x5d9cb2=_0x54ac2a[_0x5ae3('0x25')]({'plain':!![]});var _0x49ec7b=_0x5ae3('0x26');return db[_0x5ae3('0x27')][_0x5ae3('0x24')]({'where':{'type':_0x49ec7b,'resourceId':_0x5d9cb2['id']}})[_0x5ae3('0x23')](function(){return _0x54ac2a;});})['then'](function(){_0xf43191[_0x5ae3('0x19')](0xcc)[_0x5ae3('0x1a')]();});}};}function handleEntityNotFound(_0x48c258,_0x8ee010){return function(_0x4dbe22){if(!_0x4dbe22){_0x48c258['sendStatus'](0x194);}return _0x4dbe22;};}function handleError(_0xca3e5e,_0x1abd5d){_0x1abd5d=_0x1abd5d||0x1f4;return function(_0x4f6bd7){logger[_0x5ae3('0x28')](_0x4f6bd7[_0x5ae3('0x29')]);if(_0x4f6bd7['name']){delete _0x4f6bd7[_0x5ae3('0x2a')];}_0xca3e5e[_0x5ae3('0x19')](_0x1abd5d)['send'](_0x4f6bd7);};}exports[_0x5ae3('0x2b')]=function(_0x87574d,_0x58f17f){var _0x37d206={},_0xf0bb19={},_0xabe28a={'count':0x0,'rows':[]};var _0x2217a8=_[_0x5ae3('0x2c')](db[_0x5ae3('0x2d')]['rawAttributes'],function(_0x32f73d){return{'name':_0x32f73d[_0x5ae3('0x2e')],'type':_0x32f73d[_0x5ae3('0x2f')][_0x5ae3('0x30')]};});_0xf0bb19[_0x5ae3('0x31')]=_['map'](_0x2217a8,_0x5ae3('0x2a'));_0xf0bb19['query']=_['keys'](_0x87574d[_0x5ae3('0x32')]);_0xf0bb19[_0x5ae3('0x33')]=_[_0x5ae3('0x34')](_0xf0bb19[_0x5ae3('0x31')],_0xf0bb19[_0x5ae3('0x32')]);_0x37d206['attributes']=_[_0x5ae3('0x34')](_0xf0bb19[_0x5ae3('0x31')],qs[_0x5ae3('0x35')](_0x87574d[_0x5ae3('0x32')][_0x5ae3('0x35')]));_0x37d206[_0x5ae3('0x36')]=_0x37d206['attributes']['length']?_0x37d206[_0x5ae3('0x36')]:_0xf0bb19[_0x5ae3('0x31')];if(!_0x87574d[_0x5ae3('0x32')][_0x5ae3('0x37')]('nolimit')){_0x37d206[_0x5ae3('0x38')]=qs[_0x5ae3('0x38')](_0x87574d[_0x5ae3('0x32')][_0x5ae3('0x38')]);_0x37d206['offset']=qs[_0x5ae3('0x1e')](_0x87574d['query']['offset']);}_0x37d206[_0x5ae3('0x39')]=qs[_0x5ae3('0x3a')](_0x87574d[_0x5ae3('0x32')][_0x5ae3('0x3a')]);_0x37d206[_0x5ae3('0x3b')]=qs['filters'](_[_0x5ae3('0x3c')](_0x87574d['query'],_0xf0bb19['filters']),_0x2217a8);if(_0x87574d['query'][_0x5ae3('0x3d')]){_0x37d206[_0x5ae3('0x3b')]=_[_0x5ae3('0x3e')](_0x37d206[_0x5ae3('0x3b')],{'$or':_['map'](_0x2217a8,function(_0xce2e95){if(_0xce2e95['type']!=='VIRTUAL'){var _0x206340={};_0x206340[_0xce2e95[_0x5ae3('0x2a')]]={'$like':'%'+_0x87574d['query'][_0x5ae3('0x3d')]+'%'};return _0x206340;}})});}_0x37d206=_['merge']({},_0x37d206,_0x87574d[_0x5ae3('0x3f')]);var _0x287f08={'where':_0x37d206[_0x5ae3('0x3b')]};return db[_0x5ae3('0x2d')][_0x5ae3('0x1d')](_0x287f08)[_0x5ae3('0x23')](function(_0x1c8aa9){_0xabe28a[_0x5ae3('0x1d')]=_0x1c8aa9;if(_0x87574d['query']['includeAll']){_0x37d206[_0x5ae3('0x40')]=[{'all':!![]}];}return db[_0x5ae3('0x2d')][_0x5ae3('0x41')](_0x37d206);})['then'](function(_0x4f54dd){_0xabe28a['rows']=_0x4f54dd;return _0xabe28a;})[_0x5ae3('0x23')](respondWithFilteredResult(_0x58f17f,_0x37d206))[_0x5ae3('0x42')](handleError(_0x58f17f,null));};exports[_0x5ae3('0x43')]=function(_0x149fd5,_0x29bbbe){var _0x5b777a={'raw':!![],'where':{'id':_0x149fd5[_0x5ae3('0x44')]['id']}},_0x4b93f0={};_0x4b93f0[_0x5ae3('0x31')]=_['keys'](db[_0x5ae3('0x2d')][_0x5ae3('0x45')]);_0x4b93f0[_0x5ae3('0x32')]=_[_0x5ae3('0x46')](_0x149fd5[_0x5ae3('0x32')]);_0x4b93f0[_0x5ae3('0x33')]=_[_0x5ae3('0x34')](_0x4b93f0[_0x5ae3('0x31')],_0x4b93f0[_0x5ae3('0x32')]);_0x5b777a[_0x5ae3('0x36')]=_[_0x5ae3('0x34')](_0x4b93f0['model'],qs[_0x5ae3('0x35')](_0x149fd5[_0x5ae3('0x32')]['fields']));_0x5b777a[_0x5ae3('0x36')]=_0x5b777a['attributes']['length']?_0x5b777a[_0x5ae3('0x36')]:_0x4b93f0[_0x5ae3('0x31')];if(_0x149fd5[_0x5ae3('0x32')][_0x5ae3('0x47')]){_0x5b777a[_0x5ae3('0x40')]=[{'all':!![]}];}_0x5b777a=_[_0x5ae3('0x3e')]({},_0x5b777a,_0x149fd5[_0x5ae3('0x3f')]);return db[_0x5ae3('0x2d')][_0x5ae3('0x48')](_0x5b777a)['then'](handleEntityNotFound(_0x29bbbe,null))[_0x5ae3('0x23')](respondWithResult(_0x29bbbe,null))['catch'](handleError(_0x29bbbe,null));};exports[_0x5ae3('0x49')]=function(_0x523604,_0x42aa5f){return db['Disposition'][_0x5ae3('0x49')](_0x523604[_0x5ae3('0x4a')],{})[_0x5ae3('0x23')](function(_0x5c6a14){var _0x6c9366=_0x523604['user'][_0x5ae3('0x25')]({'plain':!![]});if(!_0x6c9366)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6c9366[_0x5ae3('0x4b')]===_0x5ae3('0x4c')){var _0x9ef546=_0x5c6a14[_0x5ae3('0x25')]({'plain':!![]});var _0x5d9cd1=_0x5ae3('0x26');return db[_0x5ae3('0x4d')][_0x5ae3('0x48')]({'where':{'name':_0x5d9cd1,'userProfileId':_0x6c9366[_0x5ae3('0x4e')]},'raw':!![]})[_0x5ae3('0x23')](function(_0x23d251){if(_0x23d251&&_0x23d251['autoAssociation']===0x0){return db[_0x5ae3('0x27')][_0x5ae3('0x49')]({'name':_0x9ef546['name'],'resourceId':_0x9ef546['id'],'type':_0x23d251[_0x5ae3('0x2a')],'sectionId':_0x23d251['id']},{})['then'](function(){return _0x5c6a14;});}else{return _0x5c6a14;}})[_0x5ae3('0x42')](function(_0x4ab443){logger[_0x5ae3('0x28')](_0x5ae3('0x4f'),_0x4ab443);throw _0x4ab443;});}return _0x5c6a14;})[_0x5ae3('0x23')](respondWithResult(_0x42aa5f,0xc9))['catch'](handleError(_0x42aa5f,null));};exports['update']=function(_0x4dbb2b,_0xe591e6){if(_0x4dbb2b[_0x5ae3('0x4a')]['id']){delete _0x4dbb2b[_0x5ae3('0x4a')]['id'];}return db[_0x5ae3('0x2d')][_0x5ae3('0x48')]({'where':{'id':_0x4dbb2b[_0x5ae3('0x44')]['id']}})[_0x5ae3('0x23')](handleEntityNotFound(_0xe591e6,null))['then'](saveUpdates(_0x4dbb2b[_0x5ae3('0x4a')],null))[_0x5ae3('0x23')](respondWithResult(_0xe591e6,null))['catch'](handleError(_0xe591e6,null));};exports[_0x5ae3('0x24')]=function(_0x135e77,_0x194204){return db[_0x5ae3('0x2d')][_0x5ae3('0x48')]({'where':{'id':_0x135e77['params']['id']}})[_0x5ae3('0x23')](handleEntityNotFound(_0x194204,null))[_0x5ae3('0x23')](removeEntity(_0x194204,null))[_0x5ae3('0x42')](handleError(_0x194204,null));}; \ No newline at end of file +var _0x88c6=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','get','Dispositions','UserProfileResource','end','error','stack','name','index','map','Disposition','type','key','model','query','keys','filters','intersection','fields'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x88c6,0x163));var _0x688c=function(_0x185656,_0x36b620){_0x185656=_0x185656-0x0;var _0x24a077=_0x88c6[_0x185656];return _0x24a077;};'use strict';var emlformat=require(_0x688c('0x0'));var rimraf=require(_0x688c('0x1'));var zipdir=require(_0x688c('0x2'));var jsonpatch=require(_0x688c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x688c('0x4'));var Mustache=require(_0x688c('0x5'));var util=require(_0x688c('0x6'));var path=require('path');var sox=require(_0x688c('0x7'));var csv=require(_0x688c('0x8'));var ejs=require(_0x688c('0x9'));var fs=require('fs');var fs_extra=require(_0x688c('0xa'));var _=require(_0x688c('0xb'));var squel=require(_0x688c('0xc'));var crypto=require('crypto');var jsforce=require(_0x688c('0xd'));var deskjs=require(_0x688c('0xe'));var toCsv=require(_0x688c('0x8'));var querystring=require('querystring');var Papa=require(_0x688c('0xf'));var Redis=require(_0x688c('0x10'));var authService=require(_0x688c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x688c('0x12'));var hardwareService=require(_0x688c('0x13'));var logger=require('../../config/logger')(_0x688c('0x14'));var utils=require(_0x688c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x688c('0x16'));var db=require(_0x688c('0x17'))['db'];function respondWithStatusCode(_0x1b4b75,_0x4b7429){_0x4b7429=_0x4b7429||0xcc;return function(_0x5769e8){if(_0x5769e8){return _0x1b4b75[_0x688c('0x18')](_0x4b7429);}return _0x1b4b75['status'](_0x4b7429)['end']();};}function respondWithResult(_0x2cc54f,_0x567290){_0x567290=_0x567290||0xc8;return function(_0x4b66d3){if(_0x4b66d3){return _0x2cc54f[_0x688c('0x19')](_0x567290)[_0x688c('0x1a')](_0x4b66d3);}};}function respondWithFilteredResult(_0x11933d,_0x197922){return function(_0x485b10){if(_0x485b10){var _0x557ead=typeof _0x197922[_0x688c('0x1b')]===_0x688c('0x1c')&&typeof _0x197922[_0x688c('0x1d')]==='undefined';var _0x268a97=_0x485b10[_0x688c('0x1e')];var _0x3dbfed=_0x557ead?0x0:_0x197922[_0x688c('0x1b')];var _0xb7b5ec=_0x557ead?_0x485b10[_0x688c('0x1e')]:_0x197922[_0x688c('0x1b')]+_0x197922[_0x688c('0x1d')];var _0x250a92;if(_0xb7b5ec>=_0x268a97){_0xb7b5ec=_0x268a97;_0x250a92=0xc8;}else{_0x250a92=0xce;}_0x11933d[_0x688c('0x19')](_0x250a92);return _0x11933d['set'](_0x688c('0x1f'),_0x3dbfed+'-'+_0xb7b5ec+'/'+_0x268a97)[_0x688c('0x1a')](_0x485b10);}return null;};}function patchUpdates(_0x331ee3){return function(_0x2834d4){try{jsonpatch[_0x688c('0x20')](_0x2834d4,_0x331ee3,!![]);}catch(_0x42ad8e){return BPromise[_0x688c('0x21')](_0x42ad8e);}return _0x2834d4[_0x688c('0x22')]();};}function saveUpdates(_0x44180a,_0x4fec56){return function(_0x43a30a){if(_0x43a30a){return _0x43a30a['update'](_0x44180a)['then'](function(_0x13f99e){return _0x13f99e;});}return null;};}function removeEntity(_0x578d09,_0x1a2c97){return function(_0x2150f8){if(_0x2150f8){return _0x2150f8[_0x688c('0x23')]()[_0x688c('0x24')](function(){var _0x11a0dd=_0x2150f8[_0x688c('0x25')]({'plain':!![]});var _0x2b3a11=_0x688c('0x26');return db[_0x688c('0x27')][_0x688c('0x23')]({'where':{'type':_0x2b3a11,'resourceId':_0x11a0dd['id']}})[_0x688c('0x24')](function(){return _0x2150f8;});})[_0x688c('0x24')](function(){_0x578d09[_0x688c('0x19')](0xcc)[_0x688c('0x28')]();});}};}function handleEntityNotFound(_0x305c90,_0x2d2660){return function(_0x5af07a){if(!_0x5af07a){_0x305c90[_0x688c('0x18')](0x194);}return _0x5af07a;};}function handleError(_0x2a8515,_0xf71ff2){_0xf71ff2=_0xf71ff2||0x1f4;return function(_0x3ed7bb){logger[_0x688c('0x29')](_0x3ed7bb[_0x688c('0x2a')]);if(_0x3ed7bb[_0x688c('0x2b')]){delete _0x3ed7bb['name'];}_0x2a8515[_0x688c('0x19')](_0xf71ff2)['send'](_0x3ed7bb);};}exports[_0x688c('0x2c')]=function(_0x16a55d,_0x2b2659){var _0x5c6d7d={},_0x6815f3={},_0x452665={'count':0x0,'rows':[]};var _0x3eaadb=_[_0x688c('0x2d')](db[_0x688c('0x2e')]['rawAttributes'],function(_0x28de00){return{'name':_0x28de00['fieldName'],'type':_0x28de00[_0x688c('0x2f')][_0x688c('0x30')]};});_0x6815f3[_0x688c('0x31')]=_[_0x688c('0x2d')](_0x3eaadb,'name');_0x6815f3[_0x688c('0x32')]=_[_0x688c('0x33')](_0x16a55d['query']);_0x6815f3[_0x688c('0x34')]=_['intersection'](_0x6815f3[_0x688c('0x31')],_0x6815f3[_0x688c('0x32')]);_0x5c6d7d['attributes']=_[_0x688c('0x35')](_0x6815f3['model'],qs[_0x688c('0x36')](_0x16a55d['query'][_0x688c('0x36')]));_0x5c6d7d[_0x688c('0x37')]=_0x5c6d7d[_0x688c('0x37')][_0x688c('0x38')]?_0x5c6d7d[_0x688c('0x37')]:_0x6815f3[_0x688c('0x31')];if(!_0x16a55d['query'][_0x688c('0x39')](_0x688c('0x3a'))){_0x5c6d7d['limit']=qs[_0x688c('0x1d')](_0x16a55d[_0x688c('0x32')][_0x688c('0x1d')]);_0x5c6d7d[_0x688c('0x1b')]=qs['offset'](_0x16a55d['query'][_0x688c('0x1b')]);}_0x5c6d7d[_0x688c('0x3b')]=qs[_0x688c('0x3c')](_0x16a55d[_0x688c('0x32')][_0x688c('0x3c')]);_0x5c6d7d[_0x688c('0x3d')]=qs[_0x688c('0x34')](_[_0x688c('0x3e')](_0x16a55d[_0x688c('0x32')],_0x6815f3[_0x688c('0x34')]),_0x3eaadb);if(_0x16a55d[_0x688c('0x32')][_0x688c('0x3f')]){_0x5c6d7d['where']=_[_0x688c('0x40')](_0x5c6d7d[_0x688c('0x3d')],{'$or':_[_0x688c('0x2d')](_0x3eaadb,function(_0x5ee65f){if(_0x5ee65f[_0x688c('0x2f')]!=='VIRTUAL'){var _0x58eb40={};_0x58eb40[_0x5ee65f[_0x688c('0x2b')]]={'$like':'%'+_0x16a55d[_0x688c('0x32')][_0x688c('0x3f')]+'%'};return _0x58eb40;}})});}_0x5c6d7d=_['merge']({},_0x5c6d7d,_0x16a55d['options']);var _0x1cb691={'where':_0x5c6d7d[_0x688c('0x3d')]};return db[_0x688c('0x2e')]['count'](_0x1cb691)['then'](function(_0x1d072d){_0x452665['count']=_0x1d072d;if(_0x16a55d[_0x688c('0x32')][_0x688c('0x41')]){_0x5c6d7d[_0x688c('0x42')]=[{'all':!![]}];}return db[_0x688c('0x2e')]['findAll'](_0x5c6d7d);})['then'](function(_0x12b2eb){_0x452665[_0x688c('0x43')]=_0x12b2eb;return _0x452665;})[_0x688c('0x24')](respondWithFilteredResult(_0x2b2659,_0x5c6d7d))[_0x688c('0x44')](handleError(_0x2b2659,null));};exports[_0x688c('0x45')]=function(_0x240628,_0x35b552){var _0x2a9416={'raw':!![],'where':{'id':_0x240628[_0x688c('0x46')]['id']}},_0x5b40b5={};_0x5b40b5['model']=_[_0x688c('0x33')](db['Disposition']['rawAttributes']);_0x5b40b5['query']=_[_0x688c('0x33')](_0x240628[_0x688c('0x32')]);_0x5b40b5[_0x688c('0x34')]=_[_0x688c('0x35')](_0x5b40b5[_0x688c('0x31')],_0x5b40b5[_0x688c('0x32')]);_0x2a9416[_0x688c('0x37')]=_['intersection'](_0x5b40b5[_0x688c('0x31')],qs[_0x688c('0x36')](_0x240628[_0x688c('0x32')][_0x688c('0x36')]));_0x2a9416[_0x688c('0x37')]=_0x2a9416[_0x688c('0x37')][_0x688c('0x38')]?_0x2a9416['attributes']:_0x5b40b5[_0x688c('0x31')];if(_0x240628[_0x688c('0x32')]['includeAll']){_0x2a9416[_0x688c('0x42')]=[{'all':!![]}];}_0x2a9416=_[_0x688c('0x40')]({},_0x2a9416,_0x240628[_0x688c('0x47')]);return db['Disposition'][_0x688c('0x48')](_0x2a9416)[_0x688c('0x24')](handleEntityNotFound(_0x35b552,null))[_0x688c('0x24')](respondWithResult(_0x35b552,null))[_0x688c('0x44')](handleError(_0x35b552,null));};exports[_0x688c('0x49')]=function(_0x213938,_0x2a068b){return db[_0x688c('0x2e')][_0x688c('0x49')](_0x213938['body'],{})[_0x688c('0x24')](function(_0x463868){var _0x5ea316=_0x213938[_0x688c('0x4a')][_0x688c('0x25')]({'plain':!![]});if(!_0x5ea316)throw new Error(_0x688c('0x4b'));if(_0x5ea316[_0x688c('0x4c')]==='user'){var _0x1dfb58=_0x463868[_0x688c('0x25')]({'plain':!![]});var _0x471aca=_0x688c('0x26');return db[_0x688c('0x4d')][_0x688c('0x48')]({'where':{'name':_0x471aca,'userProfileId':_0x5ea316[_0x688c('0x4e')]},'raw':!![]})[_0x688c('0x24')](function(_0x3395cd){if(_0x3395cd&&_0x3395cd['autoAssociation']===0x0){return db[_0x688c('0x27')][_0x688c('0x49')]({'name':_0x1dfb58[_0x688c('0x2b')],'resourceId':_0x1dfb58['id'],'type':_0x3395cd['name'],'sectionId':_0x3395cd['id']},{})[_0x688c('0x24')](function(){return _0x463868;});}else{return _0x463868;}})[_0x688c('0x44')](function(_0x31eba3){logger[_0x688c('0x29')](_0x688c('0x4f'),_0x31eba3);throw _0x31eba3;});}return _0x463868;})['then'](respondWithResult(_0x2a068b,0xc9))[_0x688c('0x44')](handleError(_0x2a068b,null));};exports[_0x688c('0x50')]=function(_0x10a082,_0x2166d9){if(_0x10a082[_0x688c('0x51')]['id']){delete _0x10a082[_0x688c('0x51')]['id'];}return db[_0x688c('0x2e')][_0x688c('0x48')]({'where':{'id':_0x10a082[_0x688c('0x46')]['id']}})['then'](handleEntityNotFound(_0x2166d9,null))[_0x688c('0x24')](saveUpdates(_0x10a082[_0x688c('0x51')],null))[_0x688c('0x24')](respondWithResult(_0x2166d9,null))[_0x688c('0x44')](handleError(_0x2166d9,null));};exports[_0x688c('0x23')]=function(_0xa28a3,_0x4b6b4c){return db['Disposition'][_0x688c('0x48')]({'where':{'id':_0xa28a3['params']['id']}})[_0x688c('0x24')](handleEntityNotFound(_0x4b6b4c,null))[_0x688c('0x24')](removeEntity(_0x4b6b4c,null))[_0x688c('0x44')](handleError(_0x4b6b4c,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index c3ae404..b2be7da 100644 --- a/server/api/disposition/disposition.model.js +++ b/server/api/disposition/disposition.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2caa=['request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','api','moment'];(function(_0x3d8b06,_0xf77adb){var _0x1bfaea=function(_0x260238){while(--_0x260238){_0x3d8b06['push'](_0x3d8b06['shift']());}};_0x1bfaea(++_0xf77adb);}(_0x2caa,0x11c));var _0xa2ca=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0x2caa[_0xdd2bfa];return _0x55397e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa2ca('0x0'));var moment=require(_0xa2ca('0x1'));var BPromise=require('bluebird');var rp=require(_0xa2ca('0x2'));var fs=require('fs');var path=require(_0xa2ca('0x3'));var rimraf=require(_0xa2ca('0x4'));var config=require(_0xa2ca('0x5'));var attributes=require(_0xa2ca('0x6'));module[_0xa2ca('0x7')]=function(_0x106259,_0x9cac3f){return _0x106259[_0xa2ca('0x8')](_0xa2ca('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0xa2ca('0xa'),_0xa2ca('0xb')]},{'unique':!![],'name':_0xa2ca('0xc'),'fields':[_0xa2ca('0xa'),_0xa2ca('0xd')]},{'unique':!![],'name':_0xa2ca('0xe'),'fields':['name',_0xa2ca('0xf')]},{'unique':!![],'name':_0xa2ca('0x10'),'fields':[_0xa2ca('0xa'),_0xa2ca('0x11')]},{'unique':!![],'name':_0xa2ca('0x12'),'fields':[_0xa2ca('0xa'),'FaxAccountId']},{'unique':!![],'name':_0xa2ca('0x13'),'fields':['name',_0xa2ca('0x14')]},{'unique':!![],'name':_0xa2ca('0x15'),'fields':[_0xa2ca('0xa'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5bf8=['request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','tools_dispositions','name','ListId','name_chat','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5bf8,0xce));var _0x85bf=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x5bf8[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0x85bf('0x0'));var util=require(_0x85bf('0x1'));var logger=require(_0x85bf('0x2'))('api');var moment=require('moment');var BPromise=require(_0x85bf('0x3'));var rp=require(_0x85bf('0x4'));var fs=require('fs');var path=require(_0x85bf('0x5'));var rimraf=require(_0x85bf('0x6'));var config=require(_0x85bf('0x7'));var attributes=require(_0x85bf('0x8'));module[_0x85bf('0x9')]=function(_0x559e23,_0x978a78){return _0x559e23['define']('Disposition',attributes,{'tableName':_0x85bf('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x85bf('0xb'),_0x85bf('0xc')]},{'unique':!![],'name':_0x85bf('0xd'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':_0x85bf('0xe'),'fields':[_0x85bf('0xb'),_0x85bf('0xf')]},{'unique':!![],'name':_0x85bf('0x10'),'fields':[_0x85bf('0xb'),_0x85bf('0x11')]},{'unique':!![],'name':'name_fax','fields':[_0x85bf('0xb'),_0x85bf('0x12')]},{'unique':!![],'name':'name_openchannel','fields':[_0x85bf('0xb'),_0x85bf('0x13')]},{'unique':!![],'name':_0x85bf('0x14'),'fields':[_0x85bf('0xb'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 2f10cc5..5c8241c 100644 --- a/server/api/disposition/disposition.rpc.js +++ b/server/api/disposition/disposition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x226434,_0x5e7e2d){var _0xa07903=function(_0x38413e){while(--_0x38413e){_0x226434['push'](_0x226434['shift']());}};_0xa07903(++_0x5e7e2d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1e9a4b,_0x3a4cd1){var _0x3e758a=function(_0x1bc92e){while(--_0x1bc92e){_0x1e9a4b['push'](_0x1e9a4b['shift']());}};_0x3e758a(++_0x3a4cd1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 734a197..160f8a8 100644 --- a/server/api/disposition/index.js +++ b/server/api/disposition/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d8c=['./disposition.controller','index','get','isAuthenticated','show','post','put','update','delete','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x33618c,_0x3accd5){var _0x10ca13=function(_0x2c9d6){while(--_0x2c9d6){_0x33618c['push'](_0x33618c['shift']());}};_0x10ca13(++_0x3accd5);}(_0x2d8c,0x14b));var _0xc2d8=function(_0x2f71f6,_0x3a1f4d){_0x2f71f6=_0x2f71f6-0x0;var _0x2b23ea=_0x2d8c[_0x2f71f6];return _0x2b23ea;};'use strict';var multer=require(_0xc2d8('0x0'));var util=require(_0xc2d8('0x1'));var path=require(_0xc2d8('0x2'));var timeout=require(_0xc2d8('0x3'));var express=require('express');var router=express[_0xc2d8('0x4')]();var fs_extra=require(_0xc2d8('0x5'));var auth=require(_0xc2d8('0x6'));var interaction=require(_0xc2d8('0x7'));var config=require(_0xc2d8('0x8'));var controller=require(_0xc2d8('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xc2d8('0xa')]);router[_0xc2d8('0xb')]('/:id',auth[_0xc2d8('0xc')](),controller[_0xc2d8('0xd')]);router[_0xc2d8('0xe')]('/',auth[_0xc2d8('0xc')](),controller['create']);router[_0xc2d8('0xf')]('/:id',auth[_0xc2d8('0xc')](),controller[_0xc2d8('0x10')]);router[_0xc2d8('0x11')](_0xc2d8('0x12'),auth[_0xc2d8('0xc')](),controller['destroy']);module[_0xc2d8('0x13')]=router; \ No newline at end of file +var _0x04f9=['Router','fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3a1696,_0x448ff1){var _0x46a5fe=function(_0x4a0983){while(--_0x4a0983){_0x3a1696['push'](_0x3a1696['shift']());}};_0x46a5fe(++_0x448ff1);}(_0x04f9,0x127));var _0x904f=function(_0x5c102a,_0x400658){_0x5c102a=_0x5c102a-0x0;var _0x449c2d=_0x04f9[_0x5c102a];return _0x449c2d;};'use strict';var multer=require(_0x904f('0x0'));var util=require(_0x904f('0x1'));var path=require(_0x904f('0x2'));var timeout=require(_0x904f('0x3'));var express=require(_0x904f('0x4'));var router=express[_0x904f('0x5')]();var fs_extra=require(_0x904f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x904f('0x7'));var config=require(_0x904f('0x8'));var controller=require(_0x904f('0x9'));router[_0x904f('0xa')]('/',auth[_0x904f('0xb')](),controller[_0x904f('0xc')]);router['get'](_0x904f('0xd'),auth[_0x904f('0xb')](),controller[_0x904f('0xe')]);router['post']('/',auth[_0x904f('0xb')](),controller[_0x904f('0xf')]);router['put']('/:id',auth[_0x904f('0xb')](),controller[_0x904f('0x10')]);router[_0x904f('0x11')](_0x904f('0xd'),auth[_0x904f('0xb')](),controller[_0x904f('0x12')]);module[_0x904f('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index fd7c3f1..daa7b66 100644 --- a/server/api/faxAccount/faxAccount.attributes.js +++ b/server/api/faxAccount/faxAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fab=['12000','14400','4800','v17,v27,v29','INTEGER','IAX','DADHI','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','9600'];(function(_0x148aa9,_0x421ae3){var _0x530a22=function(_0x458499){while(--_0x458499){_0x148aa9['push'](_0x148aa9['shift']());}};_0x530a22(++_0x421ae3);}(_0x5fab,0x177));var _0xb5fa=function(_0x508167,_0x2a24ec){_0x508167=_0x508167-0x0;var _0x5e7a78=_0x5fab[_0x508167];return _0x5e7a78;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb5fa('0x2')]},'ecm':{'type':Sequelize[_0xb5fa('0x3')](_0xb5fa('0x4'),'no'),'defaultValue':_0xb5fa('0x4')},'headerinfo':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':_0xb5fa('0x5')},'localstationid':{'type':Sequelize[_0xb5fa('0x2')],'unique':_0xb5fa('0x6')},'minrate':{'type':Sequelize[_0xb5fa('0x3')](_0xb5fa('0x7'),'4800','7200',_0xb5fa('0x8'),_0xb5fa('0x9'),_0xb5fa('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xb5fa('0x3')](_0xb5fa('0x7'),_0xb5fa('0xb'),'7200','9600',_0xb5fa('0x9'),_0xb5fa('0xa')),'defaultValue':_0xb5fa('0xa')},'modem':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':_0xb5fa('0xc')},'gateway':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xb5fa('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xb5fa('0x3')]('SIP',_0xb5fa('0xe'),_0xb5fa('0xf'),'KHOMP'),'defaultValue':_0xb5fa('0x10')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb5fa('0x11')],'defaultValue':function(){return _0xb5fa('0x12');}},'notificationSound':{'type':Sequelize[_0xb5fa('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb5fa('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb5fa('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb5fa('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb5fa('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb5fa('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb5fa('0xd')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb5fa('0x14'),'set':function(_0x1f7f05){if(!_0x1f7f05)this[_0xb5fa('0x15')](_0xb5fa('0x16'),null);this[_0xb5fa('0x15')](_0xb5fa('0x17'),_0x1f7f05);}}}; \ No newline at end of file +var _0x444e=['mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','9600','14400','12000','SIP','DADHI','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x434d10,_0x1ae59d){var _0x54015b=function(_0x1977b9){while(--_0x1977b9){_0x434d10['push'](_0x434d10['shift']());}};_0x54015b(++_0x1ae59d);}(_0x444e,0xe8));var _0xe444=function(_0x1a5220,_0x329db5){_0x1a5220=_0x1a5220-0x0;var _0x1a1a1a=_0x444e[_0x1a5220];return _0x1a1a1a;};'use strict';var Sequelize=require(_0xe444('0x0'));module['exports']={'name':{'type':Sequelize[_0xe444('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0xe444('0x2')]('yes','no'),'defaultValue':_0xe444('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0xe444('0x4')},'localstationid':{'type':Sequelize[_0xe444('0x1')],'unique':_0xe444('0x5')},'minrate':{'type':Sequelize[_0xe444('0x2')](_0xe444('0x6'),_0xe444('0x7'),'7200',_0xe444('0x8'),'12000',_0xe444('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xe444('0x2')](_0xe444('0x6'),_0xe444('0x7'),'7200','9600',_0xe444('0xa'),_0xe444('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xe444('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xe444('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xe444('0x2')](_0xe444('0xb'),'IAX',_0xe444('0xc'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xe444('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xe444('0xd')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xe444('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe444('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xe444('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe444('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe444('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe444('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe444('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe444('0xf')],'allowNull':!![],'defaultValue':null,'comment':_0xe444('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xe444('0xe')],'defaultValue':![],'comment':_0xe444('0x11'),'set':function(_0x236bc4){if(!_0x236bc4)this[_0xe444('0x12')](_0xe444('0x13'),null);this['setDataValue'](_0xe444('0x14'),_0x236bc4);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index e9f42e6..8cb86ea 100644 --- a/server/api/faxAccount/faxAccount.controller.js +++ b/server/api/faxAccount/faxAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70ed=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','status','end','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','includeAll','include','params','options','find','create','body','user','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','FaxAccountId','findOne','Disposition','pick','findAll','rows','removeDispositions','ids','getAnswers','CannedAnswer','order','merge','removeAnswers','addInteraction','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','priority','sendStatus','json','getApplications','context','app','description','Fax\x20Extension','appdata','push','Set','ecm','gateway','headerinfo','maxrate','modem','t38timeout','Wait','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','omit','tech','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','List','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','defaults','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x328bd3,_0x9cf5a5){var _0x458149=function(_0x3f60d9){while(--_0x3f60d9){_0x328bd3['push'](_0x328bd3['shift']());}};_0x458149(++_0x9cf5a5);}(_0x70ed,0xbb));var _0xd70e=function(_0x58175c,_0x2d9373){_0x58175c=_0x58175c-0x0;var _0x55b88f=_0x70ed[_0x58175c];return _0x55b88f;};'use strict';var emlformat=require(_0xd70e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd70e('0x1'));var jsonpatch=require(_0xd70e('0x2'));var rp=require(_0xd70e('0x3'));var moment=require(_0xd70e('0x4'));var BPromise=require(_0xd70e('0x5'));var Mustache=require(_0xd70e('0x6'));var util=require(_0xd70e('0x7'));var path=require(_0xd70e('0x8'));var sox=require(_0xd70e('0x9'));var csv=require(_0xd70e('0xa'));var ejs=require(_0xd70e('0xb'));var fs=require('fs');var fs_extra=require(_0xd70e('0xc'));var _=require(_0xd70e('0xd'));var squel=require('squel');var crypto=require(_0xd70e('0xe'));var jsforce=require(_0xd70e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd70e('0xa'));var querystring=require(_0xd70e('0x10'));var Papa=require(_0xd70e('0x11'));var Redis=require(_0xd70e('0x12'));var authService=require(_0xd70e('0x13'));var qs=require(_0xd70e('0x14'));var as=require(_0xd70e('0x15'));var hardwareService=require(_0xd70e('0x16'));var logger=require(_0xd70e('0x17'))(_0xd70e('0x18'));var utils=require(_0xd70e('0x19'));var config=require(_0xd70e('0x1a'));var licenseUtil=require(_0xd70e('0x1b'));var db=require(_0xd70e('0x1c'))['db'];config['redis']=_['defaults'](config[_0xd70e('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0xd70e('0x1e'))(new Redis(config[_0xd70e('0x1d')]));require(_0xd70e('0x1f'))[_0xd70e('0x20')](socket);var jayson=require(_0xd70e('0x21'));var client=jayson[_0xd70e('0x22')]['http']({'port':0x232c});var client9002=jayson['client'][_0xd70e('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x14cdcd,_0x465bba,_0x3b9e62,_0xa48890){return new BPromise(function(_0x32802b,_0x416841){var _0x1eb3de=_0xa48890||client;return _0x1eb3de[_0xd70e('0x24')](_0x14cdcd,_0x3b9e62)['then'](function(_0x12957c){logger[_0xd70e('0x25')](_0xd70e('0x26'),_0x465bba,'request\x20sent');logger[_0xd70e('0x27')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x465bba,_0xd70e('0x28'),JSON['stringify'](_0x12957c));if(_0x12957c[_0xd70e('0x29')]){if(_0x12957c[_0xd70e('0x29')]['code']===0x1f4){logger[_0xd70e('0x29')](_0xd70e('0x26'),_0x465bba,_0x12957c['error'][_0xd70e('0x2a')]);return _0x416841(_0x12957c[_0xd70e('0x29')][_0xd70e('0x2a')]);}logger[_0xd70e('0x29')](_0xd70e('0x26'),_0x465bba,_0x12957c['error'][_0xd70e('0x2a')]);return _0x32802b(_0x12957c['error']['message']);}else{logger[_0xd70e('0x25')](_0xd70e('0x26'),_0x465bba,_0xd70e('0x28'));_0x32802b(_0x12957c[_0xd70e('0x2b')][_0xd70e('0x2a')]);}})[_0xd70e('0x2c')](function(_0xe43e80){logger['error']('FaxAccount,\x20%s,\x20%s',_0x465bba,_0xe43e80);_0x416841(_0xe43e80);});});}function respondWithStatusCode(_0x59ae5e,_0x2d36ed){_0x2d36ed=_0x2d36ed||0xcc;return function(_0x21a68b){if(_0x21a68b){return _0x59ae5e['sendStatus'](_0x2d36ed);}return _0x59ae5e[_0xd70e('0x2d')](_0x2d36ed)[_0xd70e('0x2e')]();};}function respondWithResult(_0x380a49,_0x323b94){_0x323b94=_0x323b94||0xc8;return function(_0x490664){if(_0x490664){return _0x380a49[_0xd70e('0x2d')](_0x323b94)['json'](_0x490664);}};}function respondWithFilteredResult(_0x584957,_0x282c3f){return function(_0x593cfa){if(_0x593cfa){var _0x4f7be4=typeof _0x282c3f[_0xd70e('0x2f')]===_0xd70e('0x30')&&typeof _0x282c3f[_0xd70e('0x31')]===_0xd70e('0x30');var _0x2d63a5=_0x593cfa[_0xd70e('0x32')];var _0x79ded0=_0x4f7be4?0x0:_0x282c3f[_0xd70e('0x2f')];var _0x25f983=_0x4f7be4?_0x593cfa[_0xd70e('0x32')]:_0x282c3f[_0xd70e('0x2f')]+_0x282c3f[_0xd70e('0x31')];var _0x83d045;if(_0x25f983>=_0x2d63a5){_0x25f983=_0x2d63a5;_0x83d045=0xc8;}else{_0x83d045=0xce;}_0x584957[_0xd70e('0x2d')](_0x83d045);return _0x584957['set'](_0xd70e('0x33'),_0x79ded0+'-'+_0x25f983+'/'+_0x2d63a5)['json'](_0x593cfa);}return null;};}function patchUpdates(_0x153b53){return function(_0x47165b){try{jsonpatch[_0xd70e('0x34')](_0x47165b,_0x153b53,!![]);}catch(_0x14638e){return BPromise['reject'](_0x14638e);}return _0x47165b[_0xd70e('0x35')]();};}function saveUpdates(_0x42ca67,_0x315985){return function(_0x5eeb79){if(_0x5eeb79){return _0x5eeb79[_0xd70e('0x36')](_0x42ca67)[_0xd70e('0x37')](function(_0x4d8564){return _0x4d8564;});}return null;};}function removeEntity(_0x13f982,_0x5c341a){return function(_0x1e3a4c){if(_0x1e3a4c){return _0x1e3a4c['destroy']()[_0xd70e('0x37')](function(){var _0x3a227f=_0x1e3a4c[_0xd70e('0x38')]({'plain':!![]});var _0x41ff17='FaxAccounts';return db['UserProfileResource'][_0xd70e('0x39')]({'where':{'type':_0x41ff17,'resourceId':_0x3a227f['id']}})[_0xd70e('0x37')](function(){return _0x1e3a4c;});})[_0xd70e('0x37')](function(){_0x13f982[_0xd70e('0x2d')](0xcc)[_0xd70e('0x2e')]();});}};}function handleEntityNotFound(_0x4d8bcf,_0x353ba6){return function(_0xc36205){if(!_0xc36205){_0x4d8bcf['sendStatus'](0x194);}return _0xc36205;};}function handleError(_0x20e1ec,_0x2e9d6f){_0x2e9d6f=_0x2e9d6f||0x1f4;return function(_0x51533f){logger[_0xd70e('0x29')](_0x51533f[_0xd70e('0x3a')]);if(_0x51533f[_0xd70e('0x3b')]){delete _0x51533f[_0xd70e('0x3b')];}_0x20e1ec['status'](_0x2e9d6f)[_0xd70e('0x3c')](_0x51533f);};}exports[_0xd70e('0x3d')]=function(_0x4b492,_0x9bf8a7){var _0x3edb89={'include':[{'model':db[_0xd70e('0x3e')],'as':_0xd70e('0x3f')}]},_0x45ca2e={},_0x566948={'count':0x0,'rows':[]};var _0x560b08=_[_0xd70e('0x40')](db[_0xd70e('0x41')][_0xd70e('0x42')],function(_0x3f5174){return{'name':_0x3f5174[_0xd70e('0x43')],'type':_0x3f5174[_0xd70e('0x44')][_0xd70e('0x45')]};});_0x45ca2e['model']=_['map'](_0x560b08,_0xd70e('0x3b'));_0x45ca2e[_0xd70e('0x46')]=_[_0xd70e('0x47')](_0x4b492[_0xd70e('0x46')]);_0x45ca2e[_0xd70e('0x48')]=_[_0xd70e('0x49')](_0x45ca2e['model'],_0x45ca2e['query']);_0x3edb89['attributes']=_['intersection'](_0x45ca2e[_0xd70e('0x4a')],qs['fields'](_0x4b492['query'][_0xd70e('0x4b')]));_0x3edb89[_0xd70e('0x4c')]=_0x3edb89[_0xd70e('0x4c')][_0xd70e('0x4d')]?_0x3edb89[_0xd70e('0x4c')]:_0x45ca2e[_0xd70e('0x4a')];if(!_0x4b492[_0xd70e('0x46')][_0xd70e('0x4e')](_0xd70e('0x4f'))){_0x3edb89[_0xd70e('0x31')]=qs[_0xd70e('0x31')](_0x4b492[_0xd70e('0x46')][_0xd70e('0x31')]);_0x3edb89[_0xd70e('0x2f')]=qs[_0xd70e('0x2f')](_0x4b492[_0xd70e('0x46')][_0xd70e('0x2f')]);}_0x3edb89['order']=qs[_0xd70e('0x50')](_0x4b492[_0xd70e('0x46')][_0xd70e('0x50')]);_0x3edb89['where']=qs[_0xd70e('0x48')](_['pick'](_0x4b492['query'],_0x45ca2e[_0xd70e('0x48')]),_0x560b08);if(_0x4b492[_0xd70e('0x46')]['filter']){_0x3edb89[_0xd70e('0x51')]=_['merge'](_0x3edb89[_0xd70e('0x51')],{'$or':_[_0xd70e('0x40')](_0x560b08,function(_0x39f671){if(_0x39f671['type']!=='VIRTUAL'){var _0x4d00b0={};_0x4d00b0[_0x39f671[_0xd70e('0x3b')]]={'$like':'%'+_0x4b492[_0xd70e('0x46')][_0xd70e('0x52')]+'%'};return _0x4d00b0;}})});}_0x3edb89=_['merge']({},_0x3edb89,_0x4b492['options']);var _0x204459={'where':_0x3edb89[_0xd70e('0x51')]};return db[_0xd70e('0x41')][_0xd70e('0x32')](_0x204459)['then'](function(_0x3ff2b5){_0x566948[_0xd70e('0x32')]=_0x3ff2b5;if(_0x4b492['query'][_0xd70e('0x53')]){_0x3edb89[_0xd70e('0x54')]=[{'all':!![]}];}return db[_0xd70e('0x41')]['findAll'](_0x3edb89);})['then'](function(_0x3043d7){_0x566948['rows']=_0x3043d7;return _0x566948;})['then'](respondWithFilteredResult(_0x9bf8a7,_0x3edb89))[_0xd70e('0x2c')](handleError(_0x9bf8a7,null));};exports['show']=function(_0xf49084,_0x3a6672){var _0xc36c87={'raw':![],'where':{'id':_0xf49084[_0xd70e('0x55')]['id']},'include':[{'model':db[_0xd70e('0x3e')],'as':'mandatoryDispositionPause'}]},_0x2ccce7={};_0x2ccce7[_0xd70e('0x4a')]=_[_0xd70e('0x47')](db['FaxAccount'][_0xd70e('0x42')]);_0x2ccce7[_0xd70e('0x46')]=_[_0xd70e('0x47')](_0xf49084[_0xd70e('0x46')]);_0x2ccce7[_0xd70e('0x48')]=_[_0xd70e('0x49')](_0x2ccce7[_0xd70e('0x4a')],_0x2ccce7['query']);_0xc36c87[_0xd70e('0x4c')]=_[_0xd70e('0x49')](_0x2ccce7['model'],qs[_0xd70e('0x4b')](_0xf49084[_0xd70e('0x46')]['fields']));_0xc36c87[_0xd70e('0x4c')]=_0xc36c87[_0xd70e('0x4c')]['length']?_0xc36c87['attributes']:_0x2ccce7[_0xd70e('0x4a')];if(_0xf49084[_0xd70e('0x46')][_0xd70e('0x53')]){_0xc36c87['include']=[{'all':!![]}];}_0xc36c87=_['merge']({},_0xc36c87,_0xf49084[_0xd70e('0x56')]);return db[_0xd70e('0x41')][_0xd70e('0x57')](_0xc36c87)[_0xd70e('0x37')](handleEntityNotFound(_0x3a6672,null))[_0xd70e('0x37')](respondWithResult(_0x3a6672,null))[_0xd70e('0x2c')](handleError(_0x3a6672,null));};exports[_0xd70e('0x58')]=function(_0x521d7b,_0x16ae4c){return db[_0xd70e('0x41')][_0xd70e('0x58')](_0x521d7b[_0xd70e('0x59')],{})[_0xd70e('0x37')](function(_0x41dc93){var _0x119855=_0x521d7b[_0xd70e('0x5a')][_0xd70e('0x38')]({'plain':!![]});if(!_0x119855)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x119855['role']===_0xd70e('0x5a')){var _0x4e0e43=_0x41dc93[_0xd70e('0x38')]({'plain':!![]});var _0x25a873=_0xd70e('0x5b');return db[_0xd70e('0x5c')][_0xd70e('0x57')]({'where':{'name':_0x25a873,'userProfileId':_0x119855[_0xd70e('0x5d')]},'raw':!![]})[_0xd70e('0x37')](function(_0x36294d){if(_0x36294d&&_0x36294d[_0xd70e('0x5e')]===0x0){return db[_0xd70e('0x5f')]['create']({'name':_0x4e0e43[_0xd70e('0x3b')],'resourceId':_0x4e0e43['id'],'type':_0x36294d['name'],'sectionId':_0x36294d['id']},{})[_0xd70e('0x37')](function(){return _0x41dc93;});}else{return _0x41dc93;}})['catch'](function(_0x1e58d3){logger['error'](_0xd70e('0x60'),_0x1e58d3);throw _0x1e58d3;});}return _0x41dc93;})[_0xd70e('0x37')](respondWithResult(_0x16ae4c,0xc9))['catch'](handleError(_0x16ae4c,null));};exports[_0xd70e('0x36')]=function(_0x503c1c,_0x5d0e30){if(_0x503c1c[_0xd70e('0x59')]['id']){delete _0x503c1c['body']['id'];}return db[_0xd70e('0x41')][_0xd70e('0x57')]({'where':{'id':_0x503c1c[_0xd70e('0x55')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xd70e('0x37')](handleEntityNotFound(_0x5d0e30,null))[_0xd70e('0x37')](saveUpdates(_0x503c1c[_0xd70e('0x59')],null))[_0xd70e('0x37')](respondWithResult(_0x5d0e30,null))['catch'](handleError(_0x5d0e30,null));};exports['destroy']=function(_0xdb2453,_0x11c80c){return db['FaxAccount'][_0xd70e('0x57')]({'where':{'id':_0xdb2453[_0xd70e('0x55')]['id']}})[_0xd70e('0x37')](handleEntityNotFound(_0x11c80c,null))[_0xd70e('0x37')](removeEntity(_0x11c80c,null))['catch'](handleError(_0x11c80c,null));};exports[_0xd70e('0x61')]=function(_0x18cca4,_0x19ee38){return db[_0xd70e('0x41')][_0xd70e('0x61')]()['then'](respondWithResult(_0x19ee38,null))[_0xd70e('0x2c')](handleError(_0x19ee38,null));};exports['addDisposition']=function(_0x198a07,_0x265ee2,_0x4973c3){if(_0x198a07[_0xd70e('0x59')]['id']){delete _0x198a07[_0xd70e('0x59')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x198a07[_0xd70e('0x55')]['id']}})[_0xd70e('0x37')](handleEntityNotFound(_0x265ee2,null))[_0xd70e('0x37')](function(_0x560d65){if(_0x560d65){_0x198a07[_0xd70e('0x59')][_0xd70e('0x62')]=_0x560d65['id'];return db['Disposition']['create'](_0x198a07[_0xd70e('0x59')]);}})[_0xd70e('0x37')](respondWithResult(_0x265ee2,null))[_0xd70e('0x2c')](handleError(_0x265ee2,null));};exports['getDispositions']=function(_0xe94384,_0x5938ff,_0x3c1fe0){var _0x541900={'raw':![],'where':{}};var _0x4a71d6={};var _0x2cf906={'count':0x0,'rows':[]};return db['FaxAccount'][_0xd70e('0x63')]({'where':{'id':_0xe94384[_0xd70e('0x55')]['id']}})[_0xd70e('0x37')](handleEntityNotFound(_0x5938ff,null))[_0xd70e('0x37')](function(_0x50f37a){if(_0x50f37a){_0x4a71d6[_0xd70e('0x4a')]=_['keys'](db[_0xd70e('0x64')][_0xd70e('0x42')]);_0x4a71d6[_0xd70e('0x46')]=_[_0xd70e('0x47')](_0xe94384['query']);_0x4a71d6[_0xd70e('0x48')]=_[_0xd70e('0x49')](_0x4a71d6[_0xd70e('0x4a')],_0x4a71d6[_0xd70e('0x46')]);_0x541900['attributes']=_[_0xd70e('0x49')](_0x4a71d6[_0xd70e('0x4a')],qs['fields'](_0xe94384['query'][_0xd70e('0x4b')]));_0x541900[_0xd70e('0x4c')]=_0x541900['attributes'][_0xd70e('0x4d')]?_0x541900[_0xd70e('0x4c')]:_0x4a71d6[_0xd70e('0x4a')];if(!_0xe94384[_0xd70e('0x46')][_0xd70e('0x4e')](_0xd70e('0x4f'))){_0x541900['limit']=qs[_0xd70e('0x31')](_0xe94384[_0xd70e('0x46')][_0xd70e('0x31')]);_0x541900[_0xd70e('0x2f')]=qs[_0xd70e('0x2f')](_0xe94384[_0xd70e('0x46')][_0xd70e('0x2f')]);}_0x541900['order']=qs[_0xd70e('0x50')](_0xe94384['query'][_0xd70e('0x50')]);_0x541900[_0xd70e('0x51')]=qs[_0xd70e('0x48')](_[_0xd70e('0x65')](_0xe94384[_0xd70e('0x46')],_0x4a71d6['filters']));_0x541900[_0xd70e('0x51')][_0xd70e('0x62')]=_0x50f37a['id'];if(_0xe94384[_0xd70e('0x46')][_0xd70e('0x52')]){_0x541900[_0xd70e('0x51')]=_['merge'](_0x541900['where'],{'$or':_[_0xd70e('0x40')](_0x541900['attributes'],function(_0x44e337){var _0x5cdb7d={};_0x5cdb7d[_0x44e337]={'$like':'%'+_0xe94384[_0xd70e('0x46')][_0xd70e('0x52')]+'%'};return _0x5cdb7d;})});}_0x541900=_['merge']({},_0x541900,_0xe94384['options']);return db[_0xd70e('0x64')]['count']({'where':_0x541900[_0xd70e('0x51')]})[_0xd70e('0x37')](function(_0x38477d){_0x2cf906[_0xd70e('0x32')]=_0x38477d;if(_0xe94384[_0xd70e('0x46')][_0xd70e('0x53')]){_0x541900[_0xd70e('0x54')]=[{'all':!![]}];}return db[_0xd70e('0x64')][_0xd70e('0x66')](_0x541900);})[_0xd70e('0x37')](function(_0x1efe15){_0x2cf906[_0xd70e('0x67')]=_0x1efe15;return _0x2cf906;});}})[_0xd70e('0x37')](respondWithFilteredResult(_0x5938ff,_0x541900))['catch'](handleError(_0x5938ff,null));};exports[_0xd70e('0x68')]=function(_0x4e790a,_0x1fc8e7,_0x4dd932){return db[_0xd70e('0x41')][_0xd70e('0x57')]({'where':{'id':_0x4e790a[_0xd70e('0x55')]['id']}})[_0xd70e('0x37')](handleEntityNotFound(_0x1fc8e7,null))[_0xd70e('0x37')](function(_0x9d6649){if(_0x9d6649){return _0x9d6649['removeDispositions'](_0x4e790a[_0xd70e('0x46')][_0xd70e('0x69')]);}})['then'](respondWithStatusCode(_0x1fc8e7,null))[_0xd70e('0x2c')](handleError(_0x1fc8e7,null));};exports['addAnswer']=function(_0x5d382e,_0x5878be,_0x3c0886){if(_0x5d382e['body']['id']){delete _0x5d382e[_0xd70e('0x59')]['id'];}return db['FaxAccount'][_0xd70e('0x57')]({'where':{'id':_0x5d382e[_0xd70e('0x55')]['id']}})[_0xd70e('0x37')](handleEntityNotFound(_0x5878be,null))[_0xd70e('0x37')](function(_0xc175f9){if(_0xc175f9){_0x5d382e[_0xd70e('0x59')]['FaxAccountId']=_0xc175f9['id'];return db['CannedAnswer'][_0xd70e('0x58')](_0x5d382e[_0xd70e('0x59')]);}})[_0xd70e('0x37')](respondWithResult(_0x5878be,null))[_0xd70e('0x2c')](handleError(_0x5878be,null));};exports[_0xd70e('0x6a')]=function(_0x501747,_0x36c3fd,_0x1a4167){var _0x418c06={'raw':![],'where':{}};var _0x390c76={};var _0xd69d71={'count':0x0,'rows':[]};return db[_0xd70e('0x41')][_0xd70e('0x63')]({'where':{'id':_0x501747['params']['id']}})[_0xd70e('0x37')](handleEntityNotFound(_0x36c3fd,null))[_0xd70e('0x37')](function(_0x4298b0){if(_0x4298b0){_0x390c76[_0xd70e('0x4a')]=_[_0xd70e('0x47')](db[_0xd70e('0x6b')][_0xd70e('0x42')]);_0x390c76[_0xd70e('0x46')]=_[_0xd70e('0x47')](_0x501747['query']);_0x390c76[_0xd70e('0x48')]=_[_0xd70e('0x49')](_0x390c76['model'],_0x390c76['query']);_0x418c06[_0xd70e('0x4c')]=_[_0xd70e('0x49')](_0x390c76[_0xd70e('0x4a')],qs['fields'](_0x501747[_0xd70e('0x46')][_0xd70e('0x4b')]));_0x418c06[_0xd70e('0x4c')]=_0x418c06[_0xd70e('0x4c')][_0xd70e('0x4d')]?_0x418c06['attributes']:_0x390c76[_0xd70e('0x4a')];if(!_0x501747['query']['hasOwnProperty'](_0xd70e('0x4f'))){_0x418c06[_0xd70e('0x31')]=qs['limit'](_0x501747[_0xd70e('0x46')][_0xd70e('0x31')]);_0x418c06[_0xd70e('0x2f')]=qs['offset'](_0x501747['query'][_0xd70e('0x2f')]);}_0x418c06[_0xd70e('0x6c')]=qs['sort'](_0x501747['query'][_0xd70e('0x50')]);_0x418c06[_0xd70e('0x51')]=qs[_0xd70e('0x48')](_['pick'](_0x501747[_0xd70e('0x46')],_0x390c76[_0xd70e('0x48')]));_0x418c06[_0xd70e('0x51')][_0xd70e('0x62')]=_0x4298b0['id'];if(_0x501747[_0xd70e('0x46')][_0xd70e('0x52')]){_0x418c06['where']=_[_0xd70e('0x6d')](_0x418c06[_0xd70e('0x51')],{'$or':_['map'](_0x418c06['attributes'],function(_0x3880c1){var _0x3e528c={};_0x3e528c[_0x3880c1]={'$like':'%'+_0x501747[_0xd70e('0x46')][_0xd70e('0x52')]+'%'};return _0x3e528c;})});}_0x418c06=_[_0xd70e('0x6d')]({},_0x418c06,_0x501747[_0xd70e('0x56')]);return db['CannedAnswer'][_0xd70e('0x32')]({'where':_0x418c06[_0xd70e('0x51')]})['then'](function(_0x29b9cd){_0xd69d71['count']=_0x29b9cd;if(_0x501747[_0xd70e('0x46')]['includeAll']){_0x418c06[_0xd70e('0x54')]=[{'all':!![]}];}return db[_0xd70e('0x6b')][_0xd70e('0x66')](_0x418c06);})[_0xd70e('0x37')](function(_0x1f0cb2){_0xd69d71['rows']=_0x1f0cb2;return _0xd69d71;});}})[_0xd70e('0x37')](respondWithFilteredResult(_0x36c3fd,_0x418c06))[_0xd70e('0x2c')](handleError(_0x36c3fd,null));};exports[_0xd70e('0x6e')]=function(_0x56432a,_0x22ff68,_0x1fa5bf){return db[_0xd70e('0x41')][_0xd70e('0x57')]({'where':{'id':_0x56432a[_0xd70e('0x55')]['id']}})[_0xd70e('0x37')](handleEntityNotFound(_0x22ff68,null))[_0xd70e('0x37')](function(_0x16b4e9){if(_0x16b4e9){return _0x16b4e9['removeAnswers'](_0x56432a[_0xd70e('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x22ff68,null))[_0xd70e('0x2c')](handleError(_0x22ff68,null));};exports['addInteraction']=function(_0x46b68f,_0x2b6346,_0x56c6c6){return db['FaxInteraction'][_0xd70e('0x57')]({'where':{'id':_0x46b68f[_0xd70e('0x55')]['id']}})[_0xd70e('0x37')](handleEntityNotFound(_0x2b6346,null))[_0xd70e('0x37')](function(_0x5dbb98){if(_0x5dbb98){return _0x5dbb98[_0xd70e('0x6f')](_0x46b68f['body']['ids'],_['omit'](_0x46b68f[_0xd70e('0x59')],[_0xd70e('0x69'),'id'])||{});}})['then'](respondWithResult(_0x2b6346,null))['catch'](handleError(_0x2b6346,null));};exports[_0xd70e('0x70')]=function(_0x4b01de,_0x128724,_0x2d8624){var _0x581be1={'raw':![],'where':{}};var _0x1df59f={};var _0x46ad1f={'count':0x0,'rows':[]};return db[_0xd70e('0x41')][_0xd70e('0x63')]({'where':{'id':_0x4b01de[_0xd70e('0x55')]['id']}})[_0xd70e('0x37')](handleEntityNotFound(_0x128724,null))[_0xd70e('0x37')](function(_0x44b9b9){if(_0x44b9b9){_0x1df59f[_0xd70e('0x4a')]=_[_0xd70e('0x47')](db[_0xd70e('0x71')][_0xd70e('0x42')]);_0x1df59f[_0xd70e('0x46')]=_['keys'](_0x4b01de[_0xd70e('0x46')]);_0x1df59f[_0xd70e('0x48')]=_['intersection'](_0x1df59f['model'],_0x1df59f[_0xd70e('0x46')]);_0x581be1['attributes']=_[_0xd70e('0x49')](_0x1df59f['model'],qs['fields'](_0x4b01de[_0xd70e('0x46')]['fields']));_0x581be1[_0xd70e('0x4c')]=_0x581be1[_0xd70e('0x4c')][_0xd70e('0x4d')]?_0x581be1[_0xd70e('0x4c')]:_0x1df59f[_0xd70e('0x4a')];if(!_0x4b01de['query']['hasOwnProperty'](_0xd70e('0x4f'))){_0x581be1[_0xd70e('0x31')]=qs[_0xd70e('0x31')](_0x4b01de[_0xd70e('0x46')]['limit']);_0x581be1[_0xd70e('0x2f')]=qs[_0xd70e('0x2f')](_0x4b01de[_0xd70e('0x46')]['offset']);}_0x581be1[_0xd70e('0x6c')]=qs[_0xd70e('0x50')](_0x4b01de[_0xd70e('0x46')][_0xd70e('0x50')]);_0x581be1[_0xd70e('0x51')]=qs['filters'](_[_0xd70e('0x65')](_0x4b01de['query'],_0x1df59f['filters']));_0x581be1[_0xd70e('0x51')][_0xd70e('0x62')]=_0x44b9b9['id'];if(_0x4b01de[_0xd70e('0x46')][_0xd70e('0x52')]){_0x581be1['where']=_[_0xd70e('0x6d')](_0x581be1[_0xd70e('0x51')],{'$or':_[_0xd70e('0x40')](_0x581be1[_0xd70e('0x4c')],function(_0x573a20){var _0x269139={};_0x269139[_0x573a20]={'$like':'%'+_0x4b01de['query'][_0xd70e('0x52')]+'%'};return _0x269139;})});}_0x581be1=_['merge']({},_0x581be1,_0x4b01de['options']);return db['FaxInteraction']['count']({'where':_0x581be1[_0xd70e('0x51')]})[_0xd70e('0x37')](function(_0xd08e51){_0x46ad1f[_0xd70e('0x32')]=_0xd08e51;if(_0x4b01de[_0xd70e('0x46')]['includeAll']){_0x581be1['include']=[{'model':db[_0xd70e('0x72')],'as':_0xd70e('0x73'),'required':![]},{'model':db[_0xd70e('0x74')],'as':_0xd70e('0x75'),'attributes':[_0xd70e('0x3b'),_0xd70e('0x76'),_0xd70e('0x77')],'required':![]},{'model':db[_0xd70e('0x78')],'as':_0xd70e('0x79'),'attributes':['id',_0xd70e('0x3b'),_0xd70e('0x7a')],'where':_0x4b01de[_0xd70e('0x46')][_0xd70e('0x7b')]?{'id':_0x4b01de['query'][_0xd70e('0x7b')]}:undefined,'required':_0x4b01de[_0xd70e('0x46')]['tag']?!![]:![]}];}return db[_0xd70e('0x71')]['findAll'](_0x581be1);})[_0xd70e('0x37')](function(_0x5330d5){_0x46ad1f['rows']=_0x5330d5;return _0x46ad1f;});}})['then'](respondWithFilteredResult(_0x128724,_0x581be1))[_0xd70e('0x2c')](handleError(_0x128724,null));};exports[_0xd70e('0x7c')]=function(_0x1fffd3,_0x278aa5){var _0x3914a1=_0x1fffd3[_0xd70e('0x55')]['id'];var _0x10f8c2=_0x1fffd3[_0xd70e('0x59')];var _0x4cfef6=0xc8;var _0x38c03f=null;return db[_0xd70e('0x7d')][_0xd70e('0x7e')]({'isolationLevel':db[_0xd70e('0x7d')]['Transaction'][_0xd70e('0x7f')][_0xd70e('0x80')]},function(_0x340cb2){return db[_0xd70e('0x41')][_0xd70e('0x63')]({'where':{'id':_0x3914a1},'transaction':_0x340cb2})['then'](function(_0x2d6861){if(_0x2d6861){return db[_0xd70e('0x81')][_0xd70e('0x39')]({'where':{'FaxAccountId':_0x3914a1},'transaction':_0x340cb2})[_0xd70e('0x37')](function(){var _0xea9451=_[_0xd70e('0x40')](_0x10f8c2,function(_0x109c61){_0x109c61[_0xd70e('0x62')]=_0x3914a1;return _0x109c61;});return db['FaxApplication'][_0xd70e('0x82')](_0xea9451,{'transaction':_0x340cb2});});}else{_0x4cfef6=0x194;_0x38c03f=[];}});})['then'](function(){if(_0x4cfef6!==0x194){return db[_0xd70e('0x81')]['findAndCountAll']({'where':{'FaxAccountId':_0x3914a1},'order':_0xd70e('0x83')})[_0xd70e('0x37')](function(_0x6d395e){_0x38c03f=_0x6d395e;});}})[_0xd70e('0x2c')](function(_0x412c2d){_0x4cfef6=0x1f4;logger[_0xd70e('0x29')](_0x412c2d['stack']);if(_0x412c2d['name']){delete _0x412c2d[_0xd70e('0x3b')];}_0x38c03f=_0x412c2d;})['finally'](function(){if(_0x38c03f===null){_0x278aa5[_0xd70e('0x84')](_0x4cfef6);}else{if(_0x4cfef6===0x1f4){_0x278aa5['status'](_0x4cfef6)[_0xd70e('0x3c')](_0x38c03f);}else{_0x278aa5[_0xd70e('0x2d')](_0x4cfef6)[_0xd70e('0x85')](_0x38c03f);}}});};exports[_0xd70e('0x86')]=function(_0x23869c,_0x3db1ac,_0x117ffa){var _0x4d6fb2={};var _0x451d25={};var _0x423eef;var _0x5462a1;return db[_0xd70e('0x41')][_0xd70e('0x63')]({'where':{'id':_0x23869c['params']['id']}})[_0xd70e('0x37')](handleEntityNotFound(_0x3db1ac,null))[_0xd70e('0x37')](function(_0x337f88){if(_0x337f88){_0x423eef=_0x337f88;_0x451d25[_0xd70e('0x4a')]=_[_0xd70e('0x47')](db[_0xd70e('0x81')][_0xd70e('0x42')]);_0x451d25['query']=_['keys'](_0x23869c['query']);_0x451d25[_0xd70e('0x48')]=_['intersection'](_0x451d25[_0xd70e('0x4a')],_0x451d25['query']);_0x4d6fb2[_0xd70e('0x4c')]=_[_0xd70e('0x49')](_0x451d25[_0xd70e('0x4a')],qs[_0xd70e('0x4b')](_0x23869c[_0xd70e('0x46')][_0xd70e('0x4b')]));_0x4d6fb2['attributes']=_0x4d6fb2[_0xd70e('0x4c')][_0xd70e('0x4d')]?_0x4d6fb2[_0xd70e('0x4c')]:_0x451d25[_0xd70e('0x4a')];_0x4d6fb2[_0xd70e('0x6c')]=qs['sort'](_0x23869c[_0xd70e('0x46')][_0xd70e('0x50')]);_0x4d6fb2[_0xd70e('0x51')]=qs[_0xd70e('0x48')](_[_0xd70e('0x65')](_0x23869c['query'],_0x451d25[_0xd70e('0x48')]));if(_0x23869c[_0xd70e('0x46')][_0xd70e('0x52')]){_0x4d6fb2['where']=_[_0xd70e('0x6d')](_0x4d6fb2['where'],{'$or':_[_0xd70e('0x40')](_0x4d6fb2[_0xd70e('0x4c')],function(_0x51d061){var _0x33847e={};_0x33847e[_0x51d061]={'$like':'%'+_0x23869c[_0xd70e('0x46')][_0xd70e('0x52')]+'%'};return _0x33847e;})});}_0x4d6fb2=_[_0xd70e('0x6d')]({},_0x4d6fb2,_0x23869c[_0xd70e('0x56')]);return _0x423eef[_0xd70e('0x86')](_0x4d6fb2);}})['then'](function(_0x37046b){if(_0x37046b){_0x5462a1=_0x37046b[_0xd70e('0x4d')];if(!_0x23869c[_0xd70e('0x46')][_0xd70e('0x4e')](_0xd70e('0x4f'))){_0x4d6fb2['limit']=qs[_0xd70e('0x31')](_0x23869c['query'][_0xd70e('0x31')]);_0x4d6fb2[_0xd70e('0x2f')]=qs[_0xd70e('0x2f')](_0x23869c[_0xd70e('0x46')][_0xd70e('0x2f')]);}return _0x423eef[_0xd70e('0x86')](_0x4d6fb2);}})[_0xd70e('0x37')](function(_0x2a131a){if(_0x2a131a){return _0x2a131a?{'count':_0x5462a1,'rows':_0x2a131a}:null;}})[_0xd70e('0x37')](respondWithResult(_0x3db1ac,null))[_0xd70e('0x2c')](handleError(_0x3db1ac,null));};function Extension(_0x1ceaf7,_0x4e6ac6,_0x1191e1,_0x3caf3d){this[_0xd70e('0x87')]='from-voip-provider';this['exten']=_0x1ceaf7['localstationid'];this[_0xd70e('0x88')]=_0x3caf3d;this[_0xd70e('0x44')]='system';this[_0xd70e('0x89')]=_0xd70e('0x8a');this[_0xd70e('0x62')]=_0x1ceaf7['id'];this['priority']=_0x4e6ac6;this[_0xd70e('0x8b')]=_0x1191e1;}function createExtensionsReciveFax(_0x297ccb){var _0x130682=0x1;var _0x2f4e51=[];_0x2f4e51[_0xd70e('0x8c')](new Extension(_0x297ccb,_0x130682,'','Answer'));_0x130682+=0x1;_0x2f4e51[_0xd70e('0x8c')](new Extension(_0x297ccb,_0x130682,'CDR(type)=inbound-fax',_0xd70e('0x8d')));_0x130682+=0x1;for(var _0x1d71f8 in _0x297ccb){if(_0x297ccb['hasOwnProperty'](_0x1d71f8)&&(_0x1d71f8===_0xd70e('0x8e')||_0x1d71f8==='localstationid'||_0x1d71f8===_0xd70e('0x8f')||_0x1d71f8==='faxdetect'||_0x1d71f8===_0xd70e('0x90')||_0x1d71f8===_0xd70e('0x91')||_0x1d71f8==='minrate'||_0x1d71f8===_0xd70e('0x92')||_0x1d71f8===_0xd70e('0x93'))){_0x2f4e51['push'](new Extension(_0x297ccb,_0x130682,'FAXOPT('+_0x1d71f8+')='+_0x297ccb[_0x1d71f8],_0xd70e('0x8d')));_0x130682+=0x1;}}_0x2f4e51[_0xd70e('0x8c')](new Extension(_0x297ccb,_0x130682,'6',_0xd70e('0x94')));_0x130682+=0x1;_0x2f4e51['push'](new Extension(_0x297ccb,_0x130682,'/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d',_0xd70e('0x95')));_0x130682=0x0;return _0x2f4e51;}exports[_0xd70e('0x96')]=function(_0x3bfff7,_0x47a212,_0x20324c){var _0x289485;return db['sequelize']['transaction'](function(_0x1b3693){return db[_0xd70e('0x41')][_0xd70e('0x58')](_0x3bfff7[_0xd70e('0x59')],{'transaction':_0x1b3693})[_0xd70e('0x37')](function(_0x111b55){_0x289485=_0x111b55[_0xd70e('0x38')]({'plain':!![]});return db[_0xd70e('0x97')][_0xd70e('0x82')](createExtensionsReciveFax(_0x289485),{'transaction':_0x1b3693});});})[_0xd70e('0x37')](function(){return _0x289485;})[_0xd70e('0x37')](respondWithResult(_0x47a212,null))[_0xd70e('0x2c')](handleError(_0x47a212,null));};exports[_0xd70e('0x98')]=function(_0x561b8f,_0x3d5756,_0x11b184){var _0x148ec2;return db['sequelize']['transaction'](function(_0x1c1479){return db[_0xd70e('0x41')][_0xd70e('0x36')](_0x561b8f[_0xd70e('0x59')],{'where':{'id':_0x561b8f['body']['id']},'transaction':_0x1c1479})['then'](function(_0x3a5826){return db[_0xd70e('0x97')][_0xd70e('0x39')]({'where':{'FaxAccountId':_0x561b8f[_0xd70e('0x59')]['id']},'transaction':_0x1c1479})['then'](function(_0x3a05ec){return db[_0xd70e('0x97')]['bulkCreate'](createExtensionsReciveFax(_[_0xd70e('0x99')](_0x561b8f[_0xd70e('0x59')],[_0xd70e('0x9a'),_0xd70e('0x45'),_0xd70e('0x9b'),_0xd70e('0x9c'),_0xd70e('0x9d'),'ListId'])),{'transaction':_0x1c1479});});});})[_0xd70e('0x37')](function(){return db[_0xd70e('0x41')][_0xd70e('0x9e')](_0x561b8f['body']['id']);})[_0xd70e('0x37')](respondWithResult(_0x3d5756,null))[_0xd70e('0x2c')](handleError(_0x3d5756,null));};exports[_0xd70e('0x9f')]=function(_0x410d15,_0x22373a,_0x6af7d0){var _0xae3bae={'raw':!![],'where':{}};var _0x290eb2={};var _0x67c11c={'count':0x0,'rows':[]};return db[_0xd70e('0x41')][_0xd70e('0x63')]({'where':{'id':_0x410d15[_0xd70e('0x55')]['id']}})['then'](handleEntityNotFound(_0x22373a,null))['then'](function(_0xbcf36){if(_0xbcf36){_0x290eb2['model']=_['keys'](db[_0xd70e('0xa0')][_0xd70e('0x42')]);_0x290eb2[_0xd70e('0x46')]=_['keys'](_0x410d15[_0xd70e('0x46')]);_0x290eb2['filters']=_[_0xd70e('0x49')](_0x290eb2[_0xd70e('0x4a')],_0x290eb2[_0xd70e('0x46')]);_0xae3bae[_0xd70e('0x4c')]=_['intersection'](_0x290eb2[_0xd70e('0x4a')],qs['fields'](_0x410d15[_0xd70e('0x46')][_0xd70e('0x4b')]));_0xae3bae[_0xd70e('0x4c')]=_0xae3bae[_0xd70e('0x4c')][_0xd70e('0x4d')]?_0xae3bae[_0xd70e('0x4c')]:_0x290eb2[_0xd70e('0x4a')];if(!_0x410d15[_0xd70e('0x46')]['hasOwnProperty']('nolimit')){_0xae3bae[_0xd70e('0x31')]=qs[_0xd70e('0x31')](_0x410d15['query'][_0xd70e('0x31')]);_0xae3bae[_0xd70e('0x2f')]=qs['offset'](_0x410d15['query'][_0xd70e('0x2f')]);}_0xae3bae[_0xd70e('0x6c')]=qs[_0xd70e('0x50')](_0x410d15[_0xd70e('0x46')]['sort']);_0xae3bae[_0xd70e('0x51')]=qs[_0xd70e('0x48')](_[_0xd70e('0x65')](_0x410d15[_0xd70e('0x46')],_0x290eb2[_0xd70e('0x48')]));_0xae3bae[_0xd70e('0x51')][_0xd70e('0x62')]=_0xbcf36['id'];if(_0x410d15[_0xd70e('0x46')][_0xd70e('0x52')]){_0xae3bae[_0xd70e('0x51')]=_[_0xd70e('0x6d')](_0xae3bae[_0xd70e('0x51')],{'$or':_[_0xd70e('0x40')](_0xae3bae[_0xd70e('0x4c')],function(_0x2df597){var _0x3f8f6b={};_0x3f8f6b[_0x2df597]={'$like':'%'+_0x410d15[_0xd70e('0x46')][_0xd70e('0x52')]+'%'};return _0x3f8f6b;})});}if(_0x410d15[_0xd70e('0x46')][_0xd70e('0xa1')]){var _0x37d001=_0x410d15[_0xd70e('0x46')][_0xd70e('0xa1')][_0xd70e('0xa2')](',');var _0xccb656={};_0xccb656[_0x37d001[0x0]]={'$gte':moment(_0x37d001[0x1])[_0xd70e('0xa3')]('YYYY-MM-DD\x20HH:mm:ss')};_0xae3bae['where']=_[_0xd70e('0x6d')](_0xae3bae[_0xd70e('0x51')],_0xccb656);}_0xae3bae=_['merge']({},_0xae3bae,_0x410d15[_0xd70e('0x56')]);return db[_0xd70e('0xa0')]['count']({'where':_0xae3bae[_0xd70e('0x51')]})['then'](function(_0x7a6f6d){_0x67c11c['count']=_0x7a6f6d;if(_0x410d15[_0xd70e('0x46')][_0xd70e('0x53')]){_0xae3bae[_0xd70e('0x54')]=[{'all':!![]}];}return db[_0xd70e('0xa0')]['findAll'](_0xae3bae);})[_0xd70e('0x37')](function(_0x2537bf){_0x67c11c[_0xd70e('0x67')]=_0x2537bf;return _0x67c11c;});}})[_0xd70e('0x37')](respondWithFilteredResult(_0x22373a,_0xae3bae))['catch'](handleError(_0x22373a,null));};exports[_0xd70e('0x3c')]=function(_0x234a62,_0x13f2da,_0x5b5e5f){var _0x15a7f4,_0x20f948={},_0x42f67f;if(_0x234a62[_0xd70e('0x59')]['to']){_0x42f67f=_0x234a62['body']['to'][0x0];}return db[_0xd70e('0x41')][_0xd70e('0x57')]({'where':{'id':_0x234a62[_0xd70e('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0xd70e('0xa4'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x42f67f},'limit':0x1,'order':[['updatedAt',_0xd70e('0xa5')]]}]}]})[_0xd70e('0x37')](handleEntityNotFound(_0x13f2da,null))[_0xd70e('0x37')](function(_0x2ecb13){_0x15a7f4=_0x2ecb13;if(_0x234a62[_0xd70e('0x59')][_0xd70e('0xa6')]&&_0x234a62[_0xd70e('0x59')][_0xd70e('0xa6')]['length']){for(var _0x446eea=0x0;_0x446eea<_0x234a62[_0xd70e('0x59')][_0xd70e('0xa6')][_0xd70e('0x4d')];_0x446eea+=0x1){_0x234a62[_0xd70e('0x59')][_0xd70e('0xa6')][_0x446eea]={'filename':_0x234a62[_0xd70e('0x59')][_0xd70e('0xa6')][_0x446eea][_0xd70e('0x3b')],'id':_0x234a62['body'][_0xd70e('0xa6')][_0x446eea]['id'],'path':path[_0xd70e('0xa7')](config[_0xd70e('0xa8')],_0xd70e('0xa9'),_0x234a62['body'][_0xd70e('0xa6')][_0x446eea]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0xd70e('0xaa'),{'FaxAccountId':_['isNil'](_0x234a62[_0xd70e('0x55')]['id'])?undefined:_0x234a62[_0xd70e('0x55')]['id'],'path':_[_0xd70e('0xab')](_0x234a62[_0xd70e('0x59')]['attachments'][0x0][_0xd70e('0x8')])?undefined:_0x234a62[_0xd70e('0x59')][_0xd70e('0xa6')][0x0][_0xd70e('0x8')],'fax':_[_0xd70e('0xab')](_0x234a62[_0xd70e('0x59')]['to'][0x0])?undefined:_0x234a62[_0xd70e('0x59')]['to'][0x0]},client9002);})[_0xd70e('0x37')](function(){if(_0x15a7f4){if(_['isNil'](_0x234a62[_0xd70e('0x59')][_0xd70e('0xac')])){_0x234a62[_0xd70e('0x59')][_0xd70e('0xac')]=util[_0xd70e('0xa3')](_0xd70e('0xad'),_0x15a7f4['name'],_0x15a7f4[_0xd70e('0xae')]);}if(_0x15a7f4[_0xd70e('0xa4')]){if(_0x15a7f4['List'][_0xd70e('0xaf')][_0xd70e('0x4d')]){return _0x15a7f4['List'][_0xd70e('0xaf')][0x0];}else{return db['CmContact'][_0xd70e('0x58')](_[_0xd70e('0xb0')](_0x234a62[_0xd70e('0x59')],{'firstName':_0x234a62[_0xd70e('0x59')]['to'][0x0],'phone':_0x234a62[_0xd70e('0x59')]['to'][0x0],'fax':_0x234a62[_0xd70e('0x59')]['to'][0x0],'ListId':_0x15a7f4[_0xd70e('0xb1')]}));}}else{throw new Error(_0xd70e('0xb2'));}}else{throw new Error(_0xd70e('0xb3'));}})[_0xd70e('0x37')](function(_0x12c5fe){if(_0x12c5fe){return db['FaxInteraction'][_0xd70e('0x57')]({'where':{'ContactId':_0x12c5fe['id'],'closed':![],'FaxAccountId':_0x15a7f4['id']}})[_0xd70e('0x37')](function(_0x5e3ac7){if(_0x5e3ac7){return[_0x5e3ac7,![]];}return db[_0xd70e('0x71')]['create']({'UserId':_0x234a62[_0xd70e('0x5a')]['id'],'ContactId':_0x12c5fe['id'],'FaxAccountId':_0x15a7f4['id'],'fax':_0x234a62[_0xd70e('0x59')]['to'][0x0],'firstMsgDirection':_0xd70e('0xb4'),'Messages':[_[_0xd70e('0x6d')](_0x234a62[_0xd70e('0x59')],{'read':![],'body':_0x234a62['body']['attachments'][0x0]['filename'],'FaxAccountId':_0x15a7f4['id'],'UserId':_0x234a62['user']['id'],'ContactId':_0x12c5fe['id'],'AttachmentId':_0x234a62[_0xd70e('0x59')][_0xd70e('0xa6')][0x0]['id']})]},{'include':[{'model':db[_0xd70e('0xa0')],'as':_0xd70e('0xb5')}]})['then'](function(_0x3f57c2){return[_0x3f57c2,!![]];});});}else{throw new Error(_0xd70e('0xb6'));}})[_0xd70e('0xb7')](function(_0x55ee10,_0x43a0d8){if(_0x43a0d8){return _0x55ee10;}return db[_0xd70e('0xa0')][_0xd70e('0x58')]({'direction':_0xd70e('0xb4'),'read':![],'body':_0x234a62[_0xd70e('0x59')]['attachments'][0x0][_0xd70e('0xb8')],'FaxAccountId':_0x15a7f4['id'],'FaxInteractionId':_0x55ee10['id'],'UserId':_0x234a62[_0xd70e('0x5a')]['id'],'ContactId':_0x55ee10[_0xd70e('0xb9')],'AttachmentId':_0x234a62['body'][_0xd70e('0xa6')][0x0]['id']})['then'](function(_0x189ebd){_0x55ee10['dataValues'][_0xd70e('0xb5')]=[];_0x55ee10['dataValues']['Messages'][_0xd70e('0x8c')](_0x189ebd[_0xd70e('0xba')]);return _0x55ee10;});})[_0xd70e('0x37')](function(_0x19e5d7){respondWithRpcPromise('SendFax',_0xd70e('0xbb'),{'FaxAccountId':_[_0xd70e('0xab')](_0x234a62[_0xd70e('0x55')]['id'])?undefined:_0x234a62[_0xd70e('0x55')]['id'],'path':_['isNil'](_0x234a62[_0xd70e('0x59')]['attachments'][0x0][_0xd70e('0x8')])?undefined:_0x234a62[_0xd70e('0x59')][_0xd70e('0xa6')][0x0]['path'],'fax':_[_0xd70e('0xab')](_0x234a62[_0xd70e('0x59')]['to'][0x0])?undefined:_0x234a62[_0xd70e('0x59')]['to'][0x0],'AttachmentId':_0x234a62['body'][_0xd70e('0xa6')][0x0]['id']},client9002)[_0xd70e('0x37')](function(_0x4b87a6){logger[_0xd70e('0x25')]('SendFaxRpc,\x20%s',_0x4b87a6);})[_0xd70e('0x2c')](function(_0x43b72f){logger[_0xd70e('0x25')](_0xd70e('0xbc'),_0x43b72f);});return _0x19e5d7;})[_0xd70e('0x37')](respondWithResult(_0x13f2da,null))[_0xd70e('0x2c')](handleError(_0x13f2da,null));};exports[_0xd70e('0xbd')]=function(_0x3b5b02,_0x44edb7,_0xf150a1){return db[_0xd70e('0x41')]['find']({'where':{'id':_0x3b5b02['params']['id']}})[_0xd70e('0x37')](handleEntityNotFound(_0x44edb7,null))[_0xd70e('0x37')](function(_0x30d300){if(_0x30d300){return _0x30d300['addAgents'](_0x3b5b02[_0xd70e('0x59')][_0xd70e('0x69')],_[_0xd70e('0x99')](_0x3b5b02['body'],[_0xd70e('0x69'),'id'])||{})[_0xd70e('0xb7')](function(_0x3cc3ba){for(var _0x304941=0x0;_0x304941<_0x3b5b02[_0xd70e('0x59')][_0xd70e('0x69')][_0xd70e('0x4d')];_0x304941+=0x1){socket[_0xd70e('0xbe')]('userFaxAccount:save',{'UserId':Number(_0x3b5b02[_0xd70e('0x59')][_0xd70e('0x69')][_0x304941]),'FaxAccountId':Number(_0x3b5b02[_0xd70e('0x55')]['id'])});}return _0x3cc3ba;});}})[_0xd70e('0x37')](respondWithResult(_0x44edb7,null))[_0xd70e('0x2c')](handleError(_0x44edb7,null));};exports['removeAgents']=function(_0x5e2bc3,_0x1375f7,_0x372cdb){return db[_0xd70e('0x41')][_0xd70e('0x57')]({'where':{'id':_0x5e2bc3[_0xd70e('0x55')]['id']}})[_0xd70e('0x37')](handleEntityNotFound(_0x1375f7,null))[_0xd70e('0x37')](function(_0x57df05){if(_0x57df05){return _0x57df05[_0xd70e('0xbf')](_0x5e2bc3[_0xd70e('0x46')][_0xd70e('0x69')])[_0xd70e('0x37')](function(){if(_[_0xd70e('0xc0')](_0x5e2bc3[_0xd70e('0x46')][_0xd70e('0x69')])){for(var _0x50f3c8=0x0;_0x50f3c8<_0x5e2bc3['query'][_0xd70e('0x69')][_0xd70e('0x4d')];_0x50f3c8+=0x1){socket[_0xd70e('0xbe')]('userFaxAccount:remove',{'UserId':Number(_0x5e2bc3[_0xd70e('0x46')][_0xd70e('0x69')][_0x50f3c8]),'FaxAccountId':Number(_0x5e2bc3[_0xd70e('0x55')]['id'])});}}else{socket[_0xd70e('0xbe')](_0xd70e('0xc1'),{'UserId':Number(_0x5e2bc3['query'][_0xd70e('0x69')]),'FaxAccountId':Number(_0x5e2bc3[_0xd70e('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x1375f7,null))[_0xd70e('0x2c')](handleError(_0x1375f7,null));};exports['getAgents']=function(_0xc65070,_0x1e4bf5,_0x5662eb){var _0x2e9a15={};var _0x255976={};var _0x598ea1;var _0x3cb890;return db[_0xd70e('0x41')][_0xd70e('0x63')]({'where':{'id':_0xc65070[_0xd70e('0x55')]['id']}})[_0xd70e('0x37')](handleEntityNotFound(_0x1e4bf5,null))[_0xd70e('0x37')](function(_0x3c9907){if(_0x3c9907){_0x598ea1=_0x3c9907;_0x255976[_0xd70e('0x4a')]=_[_0xd70e('0x47')](db['User'][_0xd70e('0x42')]);_0x255976[_0xd70e('0x46')]=_[_0xd70e('0x47')](_0xc65070[_0xd70e('0x46')]);_0x255976[_0xd70e('0x48')]=_[_0xd70e('0x49')](_0x255976[_0xd70e('0x4a')],_0x255976[_0xd70e('0x46')]);_0x2e9a15[_0xd70e('0x4c')]=_[_0xd70e('0x49')](_0x255976[_0xd70e('0x4a')],qs[_0xd70e('0x4b')](_0xc65070['query'][_0xd70e('0x4b')]));_0x2e9a15[_0xd70e('0x4c')]=_0x2e9a15['attributes'][_0xd70e('0x4d')]?_0x2e9a15[_0xd70e('0x4c')]:_0x255976['model'];_0x2e9a15[_0xd70e('0x6c')]=qs[_0xd70e('0x50')](_0xc65070[_0xd70e('0x46')][_0xd70e('0x50')]);_0x2e9a15[_0xd70e('0x51')]=qs[_0xd70e('0x48')](_[_0xd70e('0x65')](_0xc65070['query'],_0x255976[_0xd70e('0x48')]));if(_0xc65070['query'][_0xd70e('0x52')]){_0x2e9a15[_0xd70e('0x51')]=_['merge'](_0x2e9a15[_0xd70e('0x51')],{'$or':_[_0xd70e('0x40')](_0x2e9a15[_0xd70e('0x4c')],function(_0x3ca7e2){var _0x463a19={};_0x463a19[_0x3ca7e2]={'$like':'%'+_0xc65070[_0xd70e('0x46')][_0xd70e('0x52')]+'%'};return _0x463a19;})});}_0x2e9a15=_[_0xd70e('0x6d')]({},_0x2e9a15,_0xc65070[_0xd70e('0x56')]);return _0x598ea1[_0xd70e('0xc2')](_0x2e9a15);}})[_0xd70e('0x37')](function(_0x226e8d){if(_0x226e8d){_0x3cb890=_0x226e8d[_0xd70e('0x4d')];if(!_0xc65070[_0xd70e('0x46')][_0xd70e('0x4e')](_0xd70e('0x4f'))){_0x2e9a15[_0xd70e('0x31')]=qs['limit'](_0xc65070[_0xd70e('0x46')]['limit']);_0x2e9a15[_0xd70e('0x2f')]=qs['offset'](_0xc65070[_0xd70e('0x46')]['offset']);}return _0x598ea1[_0xd70e('0xc2')](_0x2e9a15);}})[_0xd70e('0x37')](function(_0x44e7e2){if(_0x44e7e2){return _0x44e7e2?{'count':_0x3cb890,'rows':_0x44e7e2}:null;}})['then'](respondWithResult(_0x1e4bf5,null))[_0xd70e('0x2c')](handleError(_0x1e4bf5,null));}; \ No newline at end of file +var _0x5818=['filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','rawAttributes','hasOwnProperty','removeDispositions','ids','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','Contact','User','Owner','fullname','internal','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','priority','stack','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','Answer','CDR(type)=inbound-fax','ecm','headerinfo','maxrate','minrate','modem','t38timeout','push','FAXOPT(','Set','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','ListId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmContact','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','List','Send\x20Fax\x20failed','out','Messages','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','info','addAgents','emit','userFaxAccount:save','isArray','userFaxAccount:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','sendStatus','status','json','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','end','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','nolimit','offset','order','sort'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x5818,0x136));var _0x8581=function(_0x43da63,_0x32f75c){_0x43da63=_0x43da63-0x0;var _0x11f377=_0x5818[_0x43da63];return _0x11f377;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8581('0x0'));var jsonpatch=require(_0x8581('0x1'));var rp=require(_0x8581('0x2'));var moment=require(_0x8581('0x3'));var BPromise=require(_0x8581('0x4'));var Mustache=require(_0x8581('0x5'));var util=require(_0x8581('0x6'));var path=require(_0x8581('0x7'));var sox=require(_0x8581('0x8'));var csv=require('to-csv');var ejs=require(_0x8581('0x9'));var fs=require('fs');var fs_extra=require(_0x8581('0xa'));var _=require(_0x8581('0xb'));var squel=require(_0x8581('0xc'));var crypto=require('crypto');var jsforce=require(_0x8581('0xd'));var deskjs=require(_0x8581('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8581('0xf'));var Papa=require(_0x8581('0x10'));var Redis=require(_0x8581('0x11'));var authService=require(_0x8581('0x12'));var qs=require(_0x8581('0x13'));var as=require(_0x8581('0x14'));var hardwareService=require(_0x8581('0x15'));var logger=require(_0x8581('0x16'))(_0x8581('0x17'));var utils=require(_0x8581('0x18'));var config=require(_0x8581('0x19'));var licenseUtil=require(_0x8581('0x1a'));var db=require(_0x8581('0x1b'))['db'];config[_0x8581('0x1c')]=_[_0x8581('0x1d')](config['redis'],{'host':_0x8581('0x1e'),'port':0x18eb});var socket=require(_0x8581('0x1f'))(new Redis(config[_0x8581('0x1c')]));require(_0x8581('0x20'))[_0x8581('0x21')](socket);var jayson=require(_0x8581('0x22'));var client=jayson[_0x8581('0x23')][_0x8581('0x24')]({'port':0x232c});var client9002=jayson[_0x8581('0x23')][_0x8581('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x3e5344,_0x276ea2,_0x642344,_0x17d02c){return new BPromise(function(_0x45b6ff,_0x630943){var _0x2ff94a=_0x17d02c||client;return _0x2ff94a[_0x8581('0x25')](_0x3e5344,_0x642344)[_0x8581('0x26')](function(_0x1aa901){logger['info'](_0x8581('0x27'),_0x276ea2,_0x8581('0x28'));logger[_0x8581('0x29')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x276ea2,'request\x20sent',JSON[_0x8581('0x2a')](_0x1aa901));if(_0x1aa901[_0x8581('0x2b')]){if(_0x1aa901[_0x8581('0x2b')]['code']===0x1f4){logger[_0x8581('0x2b')]('FaxAccount,\x20%s,\x20%s',_0x276ea2,_0x1aa901[_0x8581('0x2b')][_0x8581('0x2c')]);return _0x630943(_0x1aa901[_0x8581('0x2b')][_0x8581('0x2c')]);}logger[_0x8581('0x2b')](_0x8581('0x27'),_0x276ea2,_0x1aa901[_0x8581('0x2b')][_0x8581('0x2c')]);return _0x45b6ff(_0x1aa901[_0x8581('0x2b')][_0x8581('0x2c')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x276ea2,_0x8581('0x28'));_0x45b6ff(_0x1aa901['result'][_0x8581('0x2c')]);}})[_0x8581('0x2d')](function(_0x4e2ab6){logger[_0x8581('0x2b')]('FaxAccount,\x20%s,\x20%s',_0x276ea2,_0x4e2ab6);_0x630943(_0x4e2ab6);});});}function respondWithStatusCode(_0xb13d20,_0x14681d){_0x14681d=_0x14681d||0xcc;return function(_0x5c81e1){if(_0x5c81e1){return _0xb13d20[_0x8581('0x2e')](_0x14681d);}return _0xb13d20[_0x8581('0x2f')](_0x14681d)['end']();};}function respondWithResult(_0x5766d8,_0x327310){_0x327310=_0x327310||0xc8;return function(_0x1ebc92){if(_0x1ebc92){return _0x5766d8[_0x8581('0x2f')](_0x327310)[_0x8581('0x30')](_0x1ebc92);}};}function respondWithFilteredResult(_0xeb4688,_0x5aa2c4){return function(_0x22ac57){if(_0x22ac57){var _0x7bac51=typeof _0x5aa2c4['offset']==='undefined'&&typeof _0x5aa2c4[_0x8581('0x31')]===_0x8581('0x32');var _0x966401=_0x22ac57[_0x8581('0x33')];var _0x2127f7=_0x7bac51?0x0:_0x5aa2c4['offset'];var _0x5ebad0=_0x7bac51?_0x22ac57[_0x8581('0x33')]:_0x5aa2c4['offset']+_0x5aa2c4[_0x8581('0x31')];var _0x116807;if(_0x5ebad0>=_0x966401){_0x5ebad0=_0x966401;_0x116807=0xc8;}else{_0x116807=0xce;}_0xeb4688[_0x8581('0x2f')](_0x116807);return _0xeb4688[_0x8581('0x34')](_0x8581('0x35'),_0x2127f7+'-'+_0x5ebad0+'/'+_0x966401)[_0x8581('0x30')](_0x22ac57);}return null;};}function patchUpdates(_0x16f378){return function(_0x2a16a1){try{jsonpatch[_0x8581('0x36')](_0x2a16a1,_0x16f378,!![]);}catch(_0x14e716){return BPromise[_0x8581('0x37')](_0x14e716);}return _0x2a16a1[_0x8581('0x38')]();};}function saveUpdates(_0x8740c,_0x4ee2ac){return function(_0x52ae81){if(_0x52ae81){return _0x52ae81[_0x8581('0x39')](_0x8740c)['then'](function(_0x3799ed){return _0x3799ed;});}return null;};}function removeEntity(_0x48b2f2,_0x1107d7){return function(_0x5b2381){if(_0x5b2381){return _0x5b2381[_0x8581('0x3a')]()[_0x8581('0x26')](function(){var _0x3b8fe7=_0x5b2381[_0x8581('0x3b')]({'plain':!![]});var _0x52a406=_0x8581('0x3c');return db[_0x8581('0x3d')][_0x8581('0x3a')]({'where':{'type':_0x52a406,'resourceId':_0x3b8fe7['id']}})['then'](function(){return _0x5b2381;});})[_0x8581('0x26')](function(){_0x48b2f2[_0x8581('0x2f')](0xcc)[_0x8581('0x3e')]();});}};}function handleEntityNotFound(_0x13918f,_0x37f654){return function(_0x5376a2){if(!_0x5376a2){_0x13918f[_0x8581('0x2e')](0x194);}return _0x5376a2;};}function handleError(_0x2987fa,_0x1bbff6){_0x1bbff6=_0x1bbff6||0x1f4;return function(_0xc17268){logger[_0x8581('0x2b')](_0xc17268['stack']);if(_0xc17268[_0x8581('0x3f')]){delete _0xc17268[_0x8581('0x3f')];}_0x2987fa['status'](_0x1bbff6)[_0x8581('0x40')](_0xc17268);};}exports[_0x8581('0x41')]=function(_0xfbe445,_0x418b00){var _0x161d34={'include':[{'model':db[_0x8581('0x42')],'as':_0x8581('0x43')}]},_0x583a75={},_0x7c8f26={'count':0x0,'rows':[]};var _0xef705f=_[_0x8581('0x44')](db[_0x8581('0x45')]['rawAttributes'],function(_0x5a8a00){return{'name':_0x5a8a00[_0x8581('0x46')],'type':_0x5a8a00[_0x8581('0x47')][_0x8581('0x48')]};});_0x583a75['model']=_[_0x8581('0x44')](_0xef705f,_0x8581('0x3f'));_0x583a75[_0x8581('0x49')]=_[_0x8581('0x4a')](_0xfbe445[_0x8581('0x49')]);_0x583a75['filters']=_[_0x8581('0x4b')](_0x583a75['model'],_0x583a75[_0x8581('0x49')]);_0x161d34[_0x8581('0x4c')]=_['intersection'](_0x583a75[_0x8581('0x4d')],qs[_0x8581('0x4e')](_0xfbe445[_0x8581('0x49')][_0x8581('0x4e')]));_0x161d34[_0x8581('0x4c')]=_0x161d34['attributes'][_0x8581('0x4f')]?_0x161d34['attributes']:_0x583a75['model'];if(!_0xfbe445[_0x8581('0x49')]['hasOwnProperty'](_0x8581('0x50'))){_0x161d34['limit']=qs[_0x8581('0x31')](_0xfbe445[_0x8581('0x49')][_0x8581('0x31')]);_0x161d34[_0x8581('0x51')]=qs[_0x8581('0x51')](_0xfbe445[_0x8581('0x49')][_0x8581('0x51')]);}_0x161d34[_0x8581('0x52')]=qs[_0x8581('0x53')](_0xfbe445[_0x8581('0x49')][_0x8581('0x53')]);_0x161d34['where']=qs[_0x8581('0x54')](_[_0x8581('0x55')](_0xfbe445[_0x8581('0x49')],_0x583a75[_0x8581('0x54')]),_0xef705f);if(_0xfbe445[_0x8581('0x49')][_0x8581('0x56')]){_0x161d34[_0x8581('0x57')]=_[_0x8581('0x58')](_0x161d34[_0x8581('0x57')],{'$or':_[_0x8581('0x44')](_0xef705f,function(_0x5595f5){if(_0x5595f5[_0x8581('0x47')]!==_0x8581('0x59')){var _0xeb9cb7={};_0xeb9cb7[_0x5595f5['name']]={'$like':'%'+_0xfbe445['query'][_0x8581('0x56')]+'%'};return _0xeb9cb7;}})});}_0x161d34=_[_0x8581('0x58')]({},_0x161d34,_0xfbe445[_0x8581('0x5a')]);var _0x419190={'where':_0x161d34['where']};return db[_0x8581('0x45')][_0x8581('0x33')](_0x419190)[_0x8581('0x26')](function(_0x734fa){_0x7c8f26[_0x8581('0x33')]=_0x734fa;if(_0xfbe445[_0x8581('0x49')][_0x8581('0x5b')]){_0x161d34[_0x8581('0x5c')]=[{'all':!![]}];}return db['FaxAccount'][_0x8581('0x5d')](_0x161d34);})[_0x8581('0x26')](function(_0x43b8f3){_0x7c8f26[_0x8581('0x5e')]=_0x43b8f3;return _0x7c8f26;})['then'](respondWithFilteredResult(_0x418b00,_0x161d34))[_0x8581('0x2d')](handleError(_0x418b00,null));};exports[_0x8581('0x5f')]=function(_0x18b0f6,_0x5c3ee5){var _0x1ab762={'raw':![],'where':{'id':_0x18b0f6['params']['id']},'include':[{'model':db[_0x8581('0x42')],'as':_0x8581('0x43')}]},_0x90e425={};_0x90e425[_0x8581('0x4d')]=_[_0x8581('0x4a')](db['FaxAccount']['rawAttributes']);_0x90e425[_0x8581('0x49')]=_[_0x8581('0x4a')](_0x18b0f6['query']);_0x90e425[_0x8581('0x54')]=_['intersection'](_0x90e425[_0x8581('0x4d')],_0x90e425[_0x8581('0x49')]);_0x1ab762[_0x8581('0x4c')]=_['intersection'](_0x90e425[_0x8581('0x4d')],qs[_0x8581('0x4e')](_0x18b0f6['query'][_0x8581('0x4e')]));_0x1ab762[_0x8581('0x4c')]=_0x1ab762[_0x8581('0x4c')][_0x8581('0x4f')]?_0x1ab762['attributes']:_0x90e425[_0x8581('0x4d')];if(_0x18b0f6[_0x8581('0x49')][_0x8581('0x5b')]){_0x1ab762[_0x8581('0x5c')]=[{'all':!![]}];}_0x1ab762=_[_0x8581('0x58')]({},_0x1ab762,_0x18b0f6[_0x8581('0x5a')]);return db[_0x8581('0x45')]['find'](_0x1ab762)[_0x8581('0x26')](handleEntityNotFound(_0x5c3ee5,null))[_0x8581('0x26')](respondWithResult(_0x5c3ee5,null))[_0x8581('0x2d')](handleError(_0x5c3ee5,null));};exports['create']=function(_0x2ec848,_0x259ece){return db[_0x8581('0x45')][_0x8581('0x60')](_0x2ec848[_0x8581('0x61')],{})['then'](function(_0xa0e866){var _0xbf278b=_0x2ec848['user'][_0x8581('0x3b')]({'plain':!![]});if(!_0xbf278b)throw new Error(_0x8581('0x62'));if(_0xbf278b['role']===_0x8581('0x63')){var _0x319f3e=_0xa0e866[_0x8581('0x3b')]({'plain':!![]});var _0x363fdb=_0x8581('0x3c');return db['UserProfileSection'][_0x8581('0x64')]({'where':{'name':_0x363fdb,'userProfileId':_0xbf278b['userProfileId']},'raw':!![]})['then'](function(_0x3156a9){if(_0x3156a9&&_0x3156a9['autoAssociation']===0x0){return db[_0x8581('0x3d')][_0x8581('0x60')]({'name':_0x319f3e['name'],'resourceId':_0x319f3e['id'],'type':_0x3156a9[_0x8581('0x3f')],'sectionId':_0x3156a9['id']},{})[_0x8581('0x26')](function(){return _0xa0e866;});}else{return _0xa0e866;}})[_0x8581('0x2d')](function(_0x498f2d){logger[_0x8581('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x498f2d);throw _0x498f2d;});}return _0xa0e866;})['then'](respondWithResult(_0x259ece,0xc9))[_0x8581('0x2d')](handleError(_0x259ece,null));};exports[_0x8581('0x39')]=function(_0xd9672a,_0x35b237){if(_0xd9672a['body']['id']){delete _0xd9672a['body']['id'];}return db[_0x8581('0x45')]['find']({'where':{'id':_0xd9672a[_0x8581('0x65')]['id']},'include':[{'model':db['Pause'],'as':_0x8581('0x43')}]})['then'](handleEntityNotFound(_0x35b237,null))[_0x8581('0x26')](saveUpdates(_0xd9672a[_0x8581('0x61')],null))[_0x8581('0x26')](respondWithResult(_0x35b237,null))[_0x8581('0x2d')](handleError(_0x35b237,null));};exports[_0x8581('0x3a')]=function(_0x1fa22a,_0x335cf8){return db[_0x8581('0x45')][_0x8581('0x64')]({'where':{'id':_0x1fa22a[_0x8581('0x65')]['id']}})['then'](handleEntityNotFound(_0x335cf8,null))[_0x8581('0x26')](removeEntity(_0x335cf8,null))[_0x8581('0x2d')](handleError(_0x335cf8,null));};exports[_0x8581('0x66')]=function(_0x4a496,_0x3b866c){return db['FaxAccount'][_0x8581('0x66')]()[_0x8581('0x26')](respondWithResult(_0x3b866c,null))[_0x8581('0x2d')](handleError(_0x3b866c,null));};exports[_0x8581('0x67')]=function(_0x1bf179,_0x5c679e,_0x5be4bd){if(_0x1bf179[_0x8581('0x61')]['id']){delete _0x1bf179['body']['id'];}return db[_0x8581('0x45')]['find']({'where':{'id':_0x1bf179[_0x8581('0x65')]['id']}})['then'](handleEntityNotFound(_0x5c679e,null))[_0x8581('0x26')](function(_0x157ea1){if(_0x157ea1){_0x1bf179[_0x8581('0x61')][_0x8581('0x68')]=_0x157ea1['id'];return db[_0x8581('0x69')][_0x8581('0x60')](_0x1bf179[_0x8581('0x61')]);}})[_0x8581('0x26')](respondWithResult(_0x5c679e,null))[_0x8581('0x2d')](handleError(_0x5c679e,null));};exports[_0x8581('0x6a')]=function(_0x2f3697,_0x1f9177,_0x5b5bdc){var _0x516cb8={'raw':![],'where':{}};var _0x879906={};var _0x475a63={'count':0x0,'rows':[]};return db['FaxAccount'][_0x8581('0x6b')]({'where':{'id':_0x2f3697['params']['id']}})[_0x8581('0x26')](handleEntityNotFound(_0x1f9177,null))[_0x8581('0x26')](function(_0x46fbb9){if(_0x46fbb9){_0x879906['model']=_[_0x8581('0x4a')](db['Disposition'][_0x8581('0x6c')]);_0x879906['query']=_[_0x8581('0x4a')](_0x2f3697[_0x8581('0x49')]);_0x879906[_0x8581('0x54')]=_[_0x8581('0x4b')](_0x879906[_0x8581('0x4d')],_0x879906['query']);_0x516cb8[_0x8581('0x4c')]=_['intersection'](_0x879906['model'],qs[_0x8581('0x4e')](_0x2f3697['query'][_0x8581('0x4e')]));_0x516cb8['attributes']=_0x516cb8[_0x8581('0x4c')][_0x8581('0x4f')]?_0x516cb8[_0x8581('0x4c')]:_0x879906['model'];if(!_0x2f3697['query'][_0x8581('0x6d')](_0x8581('0x50'))){_0x516cb8[_0x8581('0x31')]=qs[_0x8581('0x31')](_0x2f3697['query'][_0x8581('0x31')]);_0x516cb8['offset']=qs[_0x8581('0x51')](_0x2f3697[_0x8581('0x49')][_0x8581('0x51')]);}_0x516cb8[_0x8581('0x52')]=qs[_0x8581('0x53')](_0x2f3697[_0x8581('0x49')][_0x8581('0x53')]);_0x516cb8[_0x8581('0x57')]=qs[_0x8581('0x54')](_['pick'](_0x2f3697[_0x8581('0x49')],_0x879906[_0x8581('0x54')]));_0x516cb8[_0x8581('0x57')][_0x8581('0x68')]=_0x46fbb9['id'];if(_0x2f3697[_0x8581('0x49')][_0x8581('0x56')]){_0x516cb8[_0x8581('0x57')]=_[_0x8581('0x58')](_0x516cb8[_0x8581('0x57')],{'$or':_['map'](_0x516cb8[_0x8581('0x4c')],function(_0x797abf){var _0x533c69={};_0x533c69[_0x797abf]={'$like':'%'+_0x2f3697[_0x8581('0x49')][_0x8581('0x56')]+'%'};return _0x533c69;})});}_0x516cb8=_[_0x8581('0x58')]({},_0x516cb8,_0x2f3697['options']);return db[_0x8581('0x69')][_0x8581('0x33')]({'where':_0x516cb8['where']})['then'](function(_0xf9221b){_0x475a63[_0x8581('0x33')]=_0xf9221b;if(_0x2f3697['query']['includeAll']){_0x516cb8[_0x8581('0x5c')]=[{'all':!![]}];}return db[_0x8581('0x69')]['findAll'](_0x516cb8);})[_0x8581('0x26')](function(_0xc313d){_0x475a63[_0x8581('0x5e')]=_0xc313d;return _0x475a63;});}})[_0x8581('0x26')](respondWithFilteredResult(_0x1f9177,_0x516cb8))['catch'](handleError(_0x1f9177,null));};exports['removeDispositions']=function(_0x4cf5d1,_0x18556f,_0x2986a7){return db[_0x8581('0x45')]['find']({'where':{'id':_0x4cf5d1[_0x8581('0x65')]['id']}})['then'](handleEntityNotFound(_0x18556f,null))[_0x8581('0x26')](function(_0x509df4){if(_0x509df4){return _0x509df4[_0x8581('0x6e')](_0x4cf5d1[_0x8581('0x49')][_0x8581('0x6f')]);}})[_0x8581('0x26')](respondWithStatusCode(_0x18556f,null))['catch'](handleError(_0x18556f,null));};exports['addAnswer']=function(_0x42f555,_0x12e629,_0x148b09){if(_0x42f555['body']['id']){delete _0x42f555[_0x8581('0x61')]['id'];}return db[_0x8581('0x45')][_0x8581('0x64')]({'where':{'id':_0x42f555[_0x8581('0x65')]['id']}})['then'](handleEntityNotFound(_0x12e629,null))[_0x8581('0x26')](function(_0x1d6734){if(_0x1d6734){_0x42f555[_0x8581('0x61')][_0x8581('0x68')]=_0x1d6734['id'];return db[_0x8581('0x70')][_0x8581('0x60')](_0x42f555[_0x8581('0x61')]);}})[_0x8581('0x26')](respondWithResult(_0x12e629,null))['catch'](handleError(_0x12e629,null));};exports['getAnswers']=function(_0x2dd220,_0x2998d6,_0x16a247){var _0x440a3f={'raw':![],'where':{}};var _0x445eb0={};var _0x3b222c={'count':0x0,'rows':[]};return db['FaxAccount'][_0x8581('0x6b')]({'where':{'id':_0x2dd220['params']['id']}})['then'](handleEntityNotFound(_0x2998d6,null))[_0x8581('0x26')](function(_0x51cd13){if(_0x51cd13){_0x445eb0[_0x8581('0x4d')]=_[_0x8581('0x4a')](db[_0x8581('0x70')][_0x8581('0x6c')]);_0x445eb0[_0x8581('0x49')]=_['keys'](_0x2dd220[_0x8581('0x49')]);_0x445eb0['filters']=_[_0x8581('0x4b')](_0x445eb0[_0x8581('0x4d')],_0x445eb0[_0x8581('0x49')]);_0x440a3f[_0x8581('0x4c')]=_[_0x8581('0x4b')](_0x445eb0[_0x8581('0x4d')],qs[_0x8581('0x4e')](_0x2dd220[_0x8581('0x49')][_0x8581('0x4e')]));_0x440a3f['attributes']=_0x440a3f[_0x8581('0x4c')][_0x8581('0x4f')]?_0x440a3f[_0x8581('0x4c')]:_0x445eb0['model'];if(!_0x2dd220['query'][_0x8581('0x6d')]('nolimit')){_0x440a3f[_0x8581('0x31')]=qs[_0x8581('0x31')](_0x2dd220[_0x8581('0x49')][_0x8581('0x31')]);_0x440a3f[_0x8581('0x51')]=qs[_0x8581('0x51')](_0x2dd220[_0x8581('0x49')][_0x8581('0x51')]);}_0x440a3f[_0x8581('0x52')]=qs[_0x8581('0x53')](_0x2dd220[_0x8581('0x49')][_0x8581('0x53')]);_0x440a3f['where']=qs['filters'](_[_0x8581('0x55')](_0x2dd220[_0x8581('0x49')],_0x445eb0[_0x8581('0x54')]));_0x440a3f['where'][_0x8581('0x68')]=_0x51cd13['id'];if(_0x2dd220[_0x8581('0x49')]['filter']){_0x440a3f[_0x8581('0x57')]=_[_0x8581('0x58')](_0x440a3f[_0x8581('0x57')],{'$or':_[_0x8581('0x44')](_0x440a3f[_0x8581('0x4c')],function(_0x9b5bf9){var _0x3cae48={};_0x3cae48[_0x9b5bf9]={'$like':'%'+_0x2dd220[_0x8581('0x49')][_0x8581('0x56')]+'%'};return _0x3cae48;})});}_0x440a3f=_[_0x8581('0x58')]({},_0x440a3f,_0x2dd220[_0x8581('0x5a')]);return db[_0x8581('0x70')]['count']({'where':_0x440a3f[_0x8581('0x57')]})[_0x8581('0x26')](function(_0x42f383){_0x3b222c[_0x8581('0x33')]=_0x42f383;if(_0x2dd220[_0x8581('0x49')][_0x8581('0x5b')]){_0x440a3f[_0x8581('0x5c')]=[{'all':!![]}];}return db[_0x8581('0x70')][_0x8581('0x5d')](_0x440a3f);})[_0x8581('0x26')](function(_0x1ee431){_0x3b222c[_0x8581('0x5e')]=_0x1ee431;return _0x3b222c;});}})[_0x8581('0x26')](respondWithFilteredResult(_0x2998d6,_0x440a3f))[_0x8581('0x2d')](handleError(_0x2998d6,null));};exports[_0x8581('0x71')]=function(_0x2e4385,_0xa72783,_0x5e78c0){return db[_0x8581('0x45')]['find']({'where':{'id':_0x2e4385['params']['id']}})[_0x8581('0x26')](handleEntityNotFound(_0xa72783,null))[_0x8581('0x26')](function(_0x39d682){if(_0x39d682){return _0x39d682[_0x8581('0x71')](_0x2e4385[_0x8581('0x49')]['ids']);}})[_0x8581('0x26')](respondWithStatusCode(_0xa72783,null))[_0x8581('0x2d')](handleError(_0xa72783,null));};exports[_0x8581('0x72')]=function(_0x5633b3,_0x3aa415,_0x287b8c){return db[_0x8581('0x73')]['find']({'where':{'id':_0x5633b3['params']['id']}})[_0x8581('0x26')](handleEntityNotFound(_0x3aa415,null))[_0x8581('0x26')](function(_0x531a90){if(_0x531a90){return _0x531a90[_0x8581('0x72')](_0x5633b3['body'][_0x8581('0x6f')],_[_0x8581('0x74')](_0x5633b3['body'],[_0x8581('0x6f'),'id'])||{});}})[_0x8581('0x26')](respondWithResult(_0x3aa415,null))[_0x8581('0x2d')](handleError(_0x3aa415,null));};exports['getInteractions']=function(_0x33d8dd,_0x313c70,_0x2fac80){var _0x36e588={'raw':![],'where':{}};var _0x30ef53={};var _0xb0d363={'count':0x0,'rows':[]};return db[_0x8581('0x45')]['findOne']({'where':{'id':_0x33d8dd[_0x8581('0x65')]['id']}})[_0x8581('0x26')](handleEntityNotFound(_0x313c70,null))[_0x8581('0x26')](function(_0x3a4abb){if(_0x3a4abb){_0x30ef53['model']=_[_0x8581('0x4a')](db[_0x8581('0x73')][_0x8581('0x6c')]);_0x30ef53['query']=_[_0x8581('0x4a')](_0x33d8dd[_0x8581('0x49')]);_0x30ef53['filters']=_['intersection'](_0x30ef53['model'],_0x30ef53[_0x8581('0x49')]);_0x36e588[_0x8581('0x4c')]=_[_0x8581('0x4b')](_0x30ef53[_0x8581('0x4d')],qs['fields'](_0x33d8dd[_0x8581('0x49')][_0x8581('0x4e')]));_0x36e588[_0x8581('0x4c')]=_0x36e588[_0x8581('0x4c')][_0x8581('0x4f')]?_0x36e588[_0x8581('0x4c')]:_0x30ef53[_0x8581('0x4d')];if(!_0x33d8dd['query']['hasOwnProperty'](_0x8581('0x50'))){_0x36e588['limit']=qs[_0x8581('0x31')](_0x33d8dd[_0x8581('0x49')][_0x8581('0x31')]);_0x36e588[_0x8581('0x51')]=qs[_0x8581('0x51')](_0x33d8dd[_0x8581('0x49')][_0x8581('0x51')]);}_0x36e588['order']=qs['sort'](_0x33d8dd[_0x8581('0x49')][_0x8581('0x53')]);_0x36e588[_0x8581('0x57')]=qs[_0x8581('0x54')](_[_0x8581('0x55')](_0x33d8dd['query'],_0x30ef53[_0x8581('0x54')]));_0x36e588['where'][_0x8581('0x68')]=_0x3a4abb['id'];if(_0x33d8dd[_0x8581('0x49')][_0x8581('0x56')]){_0x36e588[_0x8581('0x57')]=_[_0x8581('0x58')](_0x36e588[_0x8581('0x57')],{'$or':_[_0x8581('0x44')](_0x36e588['attributes'],function(_0x232e39){var _0x1c930b={};_0x1c930b[_0x232e39]={'$like':'%'+_0x33d8dd['query'][_0x8581('0x56')]+'%'};return _0x1c930b;})});}_0x36e588=_[_0x8581('0x58')]({},_0x36e588,_0x33d8dd[_0x8581('0x5a')]);return db[_0x8581('0x73')][_0x8581('0x33')]({'where':_0x36e588['where']})[_0x8581('0x26')](function(_0x2a1897){_0xb0d363[_0x8581('0x33')]=_0x2a1897;if(_0x33d8dd[_0x8581('0x49')][_0x8581('0x5b')]){_0x36e588[_0x8581('0x5c')]=[{'model':db['CmContact'],'as':_0x8581('0x75'),'required':![]},{'model':db[_0x8581('0x76')],'as':_0x8581('0x77'),'attributes':[_0x8581('0x3f'),_0x8581('0x78'),_0x8581('0x79')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x8581('0x3f'),'color'],'where':_0x33d8dd[_0x8581('0x49')]['tag']?{'id':_0x33d8dd[_0x8581('0x49')][_0x8581('0x7a')]}:undefined,'required':_0x33d8dd[_0x8581('0x49')]['tag']?!![]:![]}];}return db[_0x8581('0x73')][_0x8581('0x5d')](_0x36e588);})['then'](function(_0x3a765c){_0xb0d363[_0x8581('0x5e')]=_0x3a765c;return _0xb0d363;});}})['then'](respondWithFilteredResult(_0x313c70,_0x36e588))[_0x8581('0x2d')](handleError(_0x313c70,null));};exports[_0x8581('0x7b')]=function(_0x50652f,_0x6554c7){var _0x9190f0=_0x50652f['params']['id'];var _0x14f1a0=_0x50652f[_0x8581('0x61')];var _0x106ec0=0xc8;var _0x2c381f=null;return db[_0x8581('0x7c')][_0x8581('0x7d')]({'isolationLevel':db['sequelize'][_0x8581('0x7e')][_0x8581('0x7f')]['READ_COMMITTED']},function(_0x18de65){return db[_0x8581('0x45')]['findOne']({'where':{'id':_0x9190f0},'transaction':_0x18de65})[_0x8581('0x26')](function(_0x2bf221){if(_0x2bf221){return db[_0x8581('0x80')][_0x8581('0x3a')]({'where':{'FaxAccountId':_0x9190f0},'transaction':_0x18de65})[_0x8581('0x26')](function(){var _0x29eea9=_['map'](_0x14f1a0,function(_0x5d3775){_0x5d3775[_0x8581('0x68')]=_0x9190f0;return _0x5d3775;});return db[_0x8581('0x80')][_0x8581('0x81')](_0x29eea9,{'transaction':_0x18de65});});}else{_0x106ec0=0x194;_0x2c381f=[];}});})['then'](function(){if(_0x106ec0!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x9190f0},'order':_0x8581('0x82')})['then'](function(_0x33b082){_0x2c381f=_0x33b082;});}})[_0x8581('0x2d')](function(_0x271323){_0x106ec0=0x1f4;logger[_0x8581('0x2b')](_0x271323[_0x8581('0x83')]);if(_0x271323['name']){delete _0x271323[_0x8581('0x3f')];}_0x2c381f=_0x271323;})[_0x8581('0x84')](function(){if(_0x2c381f===null){_0x6554c7[_0x8581('0x2e')](_0x106ec0);}else{if(_0x106ec0===0x1f4){_0x6554c7[_0x8581('0x2f')](_0x106ec0)['send'](_0x2c381f);}else{_0x6554c7[_0x8581('0x2f')](_0x106ec0)[_0x8581('0x30')](_0x2c381f);}}});};exports['getApplications']=function(_0x5700cf,_0x1f353e,_0x97ef24){var _0x48ba24={};var _0x41d3ea={};var _0xb4ee03;var _0x18dde7;return db[_0x8581('0x45')]['findOne']({'where':{'id':_0x5700cf[_0x8581('0x65')]['id']}})['then'](handleEntityNotFound(_0x1f353e,null))[_0x8581('0x26')](function(_0x576956){if(_0x576956){_0xb4ee03=_0x576956;_0x41d3ea[_0x8581('0x4d')]=_[_0x8581('0x4a')](db[_0x8581('0x80')][_0x8581('0x6c')]);_0x41d3ea[_0x8581('0x49')]=_[_0x8581('0x4a')](_0x5700cf['query']);_0x41d3ea['filters']=_[_0x8581('0x4b')](_0x41d3ea[_0x8581('0x4d')],_0x41d3ea[_0x8581('0x49')]);_0x48ba24[_0x8581('0x4c')]=_[_0x8581('0x4b')](_0x41d3ea[_0x8581('0x4d')],qs[_0x8581('0x4e')](_0x5700cf['query'][_0x8581('0x4e')]));_0x48ba24[_0x8581('0x4c')]=_0x48ba24[_0x8581('0x4c')][_0x8581('0x4f')]?_0x48ba24[_0x8581('0x4c')]:_0x41d3ea[_0x8581('0x4d')];_0x48ba24[_0x8581('0x52')]=qs[_0x8581('0x53')](_0x5700cf['query'][_0x8581('0x53')]);_0x48ba24['where']=qs[_0x8581('0x54')](_[_0x8581('0x55')](_0x5700cf[_0x8581('0x49')],_0x41d3ea['filters']));if(_0x5700cf[_0x8581('0x49')]['filter']){_0x48ba24[_0x8581('0x57')]=_[_0x8581('0x58')](_0x48ba24['where'],{'$or':_['map'](_0x48ba24[_0x8581('0x4c')],function(_0x401897){var _0x2a75a5={};_0x2a75a5[_0x401897]={'$like':'%'+_0x5700cf[_0x8581('0x49')][_0x8581('0x56')]+'%'};return _0x2a75a5;})});}_0x48ba24=_[_0x8581('0x58')]({},_0x48ba24,_0x5700cf[_0x8581('0x5a')]);return _0xb4ee03[_0x8581('0x85')](_0x48ba24);}})[_0x8581('0x26')](function(_0x38a5fe){if(_0x38a5fe){_0x18dde7=_0x38a5fe[_0x8581('0x4f')];if(!_0x5700cf[_0x8581('0x49')]['hasOwnProperty']('nolimit')){_0x48ba24[_0x8581('0x31')]=qs[_0x8581('0x31')](_0x5700cf[_0x8581('0x49')][_0x8581('0x31')]);_0x48ba24['offset']=qs[_0x8581('0x51')](_0x5700cf[_0x8581('0x49')][_0x8581('0x51')]);}return _0xb4ee03['getApplications'](_0x48ba24);}})[_0x8581('0x26')](function(_0x496c81){if(_0x496c81){return _0x496c81?{'count':_0x18dde7,'rows':_0x496c81}:null;}})['then'](respondWithResult(_0x1f353e,null))[_0x8581('0x2d')](handleError(_0x1f353e,null));};function Extension(_0x4ee958,_0x43a2a7,_0x5804b8,_0x30b133){this[_0x8581('0x86')]=_0x8581('0x87');this[_0x8581('0x88')]=_0x4ee958[_0x8581('0x89')];this[_0x8581('0x8a')]=_0x30b133;this[_0x8581('0x47')]=_0x8581('0x8b');this[_0x8581('0x8c')]=_0x8581('0x8d');this[_0x8581('0x68')]=_0x4ee958['id'];this[_0x8581('0x82')]=_0x43a2a7;this[_0x8581('0x8e')]=_0x5804b8;}function createExtensionsReciveFax(_0x1c9518){var _0x5c0842=0x1;var _0x3f382d=[];_0x3f382d['push'](new Extension(_0x1c9518,_0x5c0842,'',_0x8581('0x8f')));_0x5c0842+=0x1;_0x3f382d['push'](new Extension(_0x1c9518,_0x5c0842,_0x8581('0x90'),'Set'));_0x5c0842+=0x1;for(var _0x3785e9 in _0x1c9518){if(_0x1c9518[_0x8581('0x6d')](_0x3785e9)&&(_0x3785e9===_0x8581('0x91')||_0x3785e9===_0x8581('0x89')||_0x3785e9==='gateway'||_0x3785e9==='faxdetect'||_0x3785e9===_0x8581('0x92')||_0x3785e9===_0x8581('0x93')||_0x3785e9===_0x8581('0x94')||_0x3785e9===_0x8581('0x95')||_0x3785e9===_0x8581('0x96'))){_0x3f382d[_0x8581('0x97')](new Extension(_0x1c9518,_0x5c0842,_0x8581('0x98')+_0x3785e9+')='+_0x1c9518[_0x3785e9],_0x8581('0x99')));_0x5c0842+=0x1;}}_0x3f382d[_0x8581('0x97')](new Extension(_0x1c9518,_0x5c0842,'6','Wait'));_0x5c0842+=0x1;_0x3f382d[_0x8581('0x97')](new Extension(_0x1c9518,_0x5c0842,_0x8581('0x9a'),_0x8581('0x9b')));_0x5c0842=0x0;return _0x3f382d;}exports['addAccountApplications']=function(_0x6c6769,_0x308e65,_0xac2809){var _0x55d07b;return db[_0x8581('0x7c')]['transaction'](function(_0x280c98){return db[_0x8581('0x45')][_0x8581('0x60')](_0x6c6769[_0x8581('0x61')],{'transaction':_0x280c98})[_0x8581('0x26')](function(_0x4441ee){_0x55d07b=_0x4441ee[_0x8581('0x3b')]({'plain':!![]});return db[_0x8581('0x9c')][_0x8581('0x81')](createExtensionsReciveFax(_0x55d07b),{'transaction':_0x280c98});});})[_0x8581('0x26')](function(){return _0x55d07b;})[_0x8581('0x26')](respondWithResult(_0x308e65,null))[_0x8581('0x2d')](handleError(_0x308e65,null));};exports[_0x8581('0x9d')]=function(_0x411ab0,_0x225b57,_0x3daf15){var _0x5a0031;return db['sequelize'][_0x8581('0x7d')](function(_0x5a7ee9){return db['FaxAccount']['update'](_0x411ab0['body'],{'where':{'id':_0x411ab0['body']['id']},'transaction':_0x5a7ee9})[_0x8581('0x26')](function(_0x241f1b){return db[_0x8581('0x9c')][_0x8581('0x3a')]({'where':{'FaxAccountId':_0x411ab0[_0x8581('0x61')]['id']},'transaction':_0x5a7ee9})[_0x8581('0x26')](function(_0xd8b074){return db[_0x8581('0x9c')][_0x8581('0x81')](createExtensionsReciveFax(_[_0x8581('0x74')](_0x411ab0[_0x8581('0x61')],[_0x8581('0x9e'),'key',_0x8581('0x9f'),_0x8581('0xa0'),'TrunkId',_0x8581('0xa1')])),{'transaction':_0x5a7ee9});});});})[_0x8581('0x26')](function(){return db[_0x8581('0x45')][_0x8581('0xa2')](_0x411ab0[_0x8581('0x61')]['id']);})[_0x8581('0x26')](respondWithResult(_0x225b57,null))['catch'](handleError(_0x225b57,null));};exports[_0x8581('0xa3')]=function(_0x24847f,_0x469b8d,_0xf44a04){var _0x5ab161={'raw':!![],'where':{}};var _0x1fa904={};var _0x435eca={'count':0x0,'rows':[]};return db[_0x8581('0x45')][_0x8581('0x6b')]({'where':{'id':_0x24847f['params']['id']}})[_0x8581('0x26')](handleEntityNotFound(_0x469b8d,null))[_0x8581('0x26')](function(_0x2d0576){if(_0x2d0576){_0x1fa904[_0x8581('0x4d')]=_[_0x8581('0x4a')](db['FaxMessage'][_0x8581('0x6c')]);_0x1fa904[_0x8581('0x49')]=_[_0x8581('0x4a')](_0x24847f[_0x8581('0x49')]);_0x1fa904['filters']=_[_0x8581('0x4b')](_0x1fa904['model'],_0x1fa904[_0x8581('0x49')]);_0x5ab161['attributes']=_[_0x8581('0x4b')](_0x1fa904[_0x8581('0x4d')],qs[_0x8581('0x4e')](_0x24847f[_0x8581('0x49')][_0x8581('0x4e')]));_0x5ab161[_0x8581('0x4c')]=_0x5ab161['attributes'][_0x8581('0x4f')]?_0x5ab161['attributes']:_0x1fa904[_0x8581('0x4d')];if(!_0x24847f[_0x8581('0x49')]['hasOwnProperty'](_0x8581('0x50'))){_0x5ab161['limit']=qs[_0x8581('0x31')](_0x24847f[_0x8581('0x49')][_0x8581('0x31')]);_0x5ab161[_0x8581('0x51')]=qs['offset'](_0x24847f[_0x8581('0x49')][_0x8581('0x51')]);}_0x5ab161['order']=qs[_0x8581('0x53')](_0x24847f[_0x8581('0x49')][_0x8581('0x53')]);_0x5ab161['where']=qs[_0x8581('0x54')](_['pick'](_0x24847f[_0x8581('0x49')],_0x1fa904[_0x8581('0x54')]));_0x5ab161[_0x8581('0x57')]['FaxAccountId']=_0x2d0576['id'];if(_0x24847f[_0x8581('0x49')][_0x8581('0x56')]){_0x5ab161[_0x8581('0x57')]=_[_0x8581('0x58')](_0x5ab161[_0x8581('0x57')],{'$or':_[_0x8581('0x44')](_0x5ab161['attributes'],function(_0x38933e){var _0x268850={};_0x268850[_0x38933e]={'$like':'%'+_0x24847f['query'][_0x8581('0x56')]+'%'};return _0x268850;})});}if(_0x24847f[_0x8581('0x49')][_0x8581('0xa4')]){var _0x452afa=_0x24847f[_0x8581('0x49')][_0x8581('0xa4')][_0x8581('0xa5')](',');var _0x540a68={};_0x540a68[_0x452afa[0x0]]={'$gte':moment(_0x452afa[0x1])[_0x8581('0xa6')](_0x8581('0xa7'))};_0x5ab161[_0x8581('0x57')]=_[_0x8581('0x58')](_0x5ab161[_0x8581('0x57')],_0x540a68);}_0x5ab161=_['merge']({},_0x5ab161,_0x24847f[_0x8581('0x5a')]);return db[_0x8581('0xa8')][_0x8581('0x33')]({'where':_0x5ab161[_0x8581('0x57')]})[_0x8581('0x26')](function(_0x5270e3){_0x435eca['count']=_0x5270e3;if(_0x24847f[_0x8581('0x49')]['includeAll']){_0x5ab161[_0x8581('0x5c')]=[{'all':!![]}];}return db[_0x8581('0xa8')][_0x8581('0x5d')](_0x5ab161);})[_0x8581('0x26')](function(_0x53d68e){_0x435eca[_0x8581('0x5e')]=_0x53d68e;return _0x435eca;});}})[_0x8581('0x26')](respondWithFilteredResult(_0x469b8d,_0x5ab161))[_0x8581('0x2d')](handleError(_0x469b8d,null));};exports['send']=function(_0x57195c,_0x148905,_0xd58e0e){var _0x3433b3,_0x941549={},_0x4d972a;if(_0x57195c[_0x8581('0x61')]['to']){_0x4d972a=_0x57195c[_0x8581('0x61')]['to'][0x0];}return db['FaxAccount'][_0x8581('0x64')]({'where':{'id':_0x57195c['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x8581('0xa9')],'as':_0x8581('0xaa'),'where':{'fax':_0x4d972a},'limit':0x1,'order':[[_0x8581('0xa0'),_0x8581('0xab')]]}]}]})['then'](handleEntityNotFound(_0x148905,null))[_0x8581('0x26')](function(_0x12ead7){_0x3433b3=_0x12ead7;if(_0x57195c[_0x8581('0x61')][_0x8581('0xac')]&&_0x57195c[_0x8581('0x61')][_0x8581('0xac')][_0x8581('0x4f')]){for(var _0x3c939b=0x0;_0x3c939b<_0x57195c['body'][_0x8581('0xac')]['length'];_0x3c939b+=0x1){_0x57195c[_0x8581('0x61')][_0x8581('0xac')][_0x3c939b]={'filename':_0x57195c['body']['attachments'][_0x3c939b][_0x8581('0x3f')],'id':_0x57195c[_0x8581('0x61')][_0x8581('0xac')][_0x3c939b]['id'],'path':path[_0x8581('0xad')](config[_0x8581('0xae')],_0x8581('0xaf'),_0x57195c['body']['attachments'][_0x3c939b][_0x8581('0xb0')])};}}return respondWithRpcPromise(_0x8581('0xb1'),_0x8581('0xb1'),{'FaxAccountId':_[_0x8581('0xb2')](_0x57195c[_0x8581('0x65')]['id'])?undefined:_0x57195c[_0x8581('0x65')]['id'],'path':_[_0x8581('0xb2')](_0x57195c[_0x8581('0x61')][_0x8581('0xac')][0x0]['path'])?undefined:_0x57195c[_0x8581('0x61')][_0x8581('0xac')][0x0][_0x8581('0x7')],'fax':_['isNil'](_0x57195c[_0x8581('0x61')]['to'][0x0])?undefined:_0x57195c[_0x8581('0x61')]['to'][0x0]},client9002);})[_0x8581('0x26')](function(){if(_0x3433b3){if(_[_0x8581('0xb2')](_0x57195c[_0x8581('0x61')]['from'])){_0x57195c[_0x8581('0x61')][_0x8581('0xb3')]=util['format']('\x22%s\x22\x20<%s>',_0x3433b3['name'],_0x3433b3['fax']);}if(_0x3433b3[_0x8581('0xb4')]){if(_0x3433b3[_0x8581('0xb4')][_0x8581('0xaa')][_0x8581('0x4f')]){return _0x3433b3['List']['Contacts'][0x0];}else{return db['CmContact']['create'](_[_0x8581('0x1d')](_0x57195c[_0x8581('0x61')],{'firstName':_0x57195c[_0x8581('0x61')]['to'][0x0],'phone':_0x57195c[_0x8581('0x61')]['to'][0x0],'fax':_0x57195c[_0x8581('0x61')]['to'][0x0],'ListId':_0x3433b3['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x8581('0xb5'));}})[_0x8581('0x26')](function(_0x4115d8){if(_0x4115d8){return db['FaxInteraction'][_0x8581('0x64')]({'where':{'ContactId':_0x4115d8['id'],'closed':![],'FaxAccountId':_0x3433b3['id']}})[_0x8581('0x26')](function(_0x39e201){if(_0x39e201){return[_0x39e201,![]];}return db[_0x8581('0x73')][_0x8581('0x60')]({'UserId':_0x57195c[_0x8581('0x63')]['id'],'ContactId':_0x4115d8['id'],'FaxAccountId':_0x3433b3['id'],'fax':_0x57195c[_0x8581('0x61')]['to'][0x0],'firstMsgDirection':_0x8581('0xb6'),'Messages':[_[_0x8581('0x58')](_0x57195c[_0x8581('0x61')],{'read':![],'body':_0x57195c[_0x8581('0x61')][_0x8581('0xac')][0x0]['filename'],'FaxAccountId':_0x3433b3['id'],'UserId':_0x57195c[_0x8581('0x63')]['id'],'ContactId':_0x4115d8['id'],'AttachmentId':_0x57195c[_0x8581('0x61')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x8581('0xa8')],'as':_0x8581('0xb7')}]})[_0x8581('0x26')](function(_0x40213c){return[_0x40213c,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x8581('0xb8')](function(_0x254d1c,_0x4847a5){if(_0x4847a5){return _0x254d1c;}return db[_0x8581('0xa8')][_0x8581('0x60')]({'direction':'out','read':![],'body':_0x57195c[_0x8581('0x61')][_0x8581('0xac')][0x0][_0x8581('0xb9')],'FaxAccountId':_0x3433b3['id'],'FaxInteractionId':_0x254d1c['id'],'UserId':_0x57195c[_0x8581('0x63')]['id'],'ContactId':_0x254d1c[_0x8581('0xba')],'AttachmentId':_0x57195c[_0x8581('0x61')][_0x8581('0xac')][0x0]['id']})[_0x8581('0x26')](function(_0x1f40f2){_0x254d1c[_0x8581('0xbb')][_0x8581('0xb7')]=[];_0x254d1c[_0x8581('0xbb')][_0x8581('0xb7')]['push'](_0x1f40f2[_0x8581('0xbb')]);return _0x254d1c;});})[_0x8581('0x26')](function(_0x1f2ece){respondWithRpcPromise(_0x8581('0xbc'),_0x8581('0xbc'),{'FaxAccountId':_[_0x8581('0xb2')](_0x57195c[_0x8581('0x65')]['id'])?undefined:_0x57195c['params']['id'],'path':_[_0x8581('0xb2')](_0x57195c[_0x8581('0x61')][_0x8581('0xac')][0x0][_0x8581('0x7')])?undefined:_0x57195c[_0x8581('0x61')]['attachments'][0x0]['path'],'fax':_[_0x8581('0xb2')](_0x57195c[_0x8581('0x61')]['to'][0x0])?undefined:_0x57195c[_0x8581('0x61')]['to'][0x0],'AttachmentId':_0x57195c[_0x8581('0x61')][_0x8581('0xac')][0x0]['id']},client9002)[_0x8581('0x26')](function(_0x37d020){logger['info'](_0x8581('0xbd'),_0x37d020);})[_0x8581('0x2d')](function(_0x5acdfc){logger[_0x8581('0xbe')]('SendFaxRpc,\x20%s',_0x5acdfc);});return _0x1f2ece;})[_0x8581('0x26')](respondWithResult(_0x148905,null))['catch'](handleError(_0x148905,null));};exports[_0x8581('0xbf')]=function(_0x29dbcb,_0x177ec7,_0x257a32){return db[_0x8581('0x45')][_0x8581('0x64')]({'where':{'id':_0x29dbcb[_0x8581('0x65')]['id']}})[_0x8581('0x26')](handleEntityNotFound(_0x177ec7,null))[_0x8581('0x26')](function(_0x2c4b94){if(_0x2c4b94){return _0x2c4b94['addAgents'](_0x29dbcb[_0x8581('0x61')][_0x8581('0x6f')],_[_0x8581('0x74')](_0x29dbcb[_0x8581('0x61')],[_0x8581('0x6f'),'id'])||{})[_0x8581('0xb8')](function(_0xd408ed){for(var _0x1e2a2c=0x0;_0x1e2a2c<_0x29dbcb[_0x8581('0x61')][_0x8581('0x6f')][_0x8581('0x4f')];_0x1e2a2c+=0x1){socket[_0x8581('0xc0')](_0x8581('0xc1'),{'UserId':Number(_0x29dbcb[_0x8581('0x61')]['ids'][_0x1e2a2c]),'FaxAccountId':Number(_0x29dbcb[_0x8581('0x65')]['id'])});}return _0xd408ed;});}})[_0x8581('0x26')](respondWithResult(_0x177ec7,null))['catch'](handleError(_0x177ec7,null));};exports['removeAgents']=function(_0x4d4e3a,_0x3f930d,_0x12a818){return db[_0x8581('0x45')][_0x8581('0x64')]({'where':{'id':_0x4d4e3a['params']['id']}})[_0x8581('0x26')](handleEntityNotFound(_0x3f930d,null))[_0x8581('0x26')](function(_0x4d89e8){if(_0x4d89e8){return _0x4d89e8['removeAgents'](_0x4d4e3a['query']['ids'])['then'](function(){if(_[_0x8581('0xc2')](_0x4d4e3a[_0x8581('0x49')][_0x8581('0x6f')])){for(var _0x56e0c2=0x0;_0x56e0c2<_0x4d4e3a[_0x8581('0x49')][_0x8581('0x6f')][_0x8581('0x4f')];_0x56e0c2+=0x1){socket['emit'](_0x8581('0xc3'),{'UserId':Number(_0x4d4e3a[_0x8581('0x49')][_0x8581('0x6f')][_0x56e0c2]),'FaxAccountId':Number(_0x4d4e3a[_0x8581('0x65')]['id'])});}}else{socket[_0x8581('0xc0')](_0x8581('0xc3'),{'UserId':Number(_0x4d4e3a[_0x8581('0x49')][_0x8581('0x6f')]),'FaxAccountId':Number(_0x4d4e3a[_0x8581('0x65')]['id'])});}});}})[_0x8581('0x26')](respondWithStatusCode(_0x3f930d,null))[_0x8581('0x2d')](handleError(_0x3f930d,null));};exports['getAgents']=function(_0x42c14a,_0x29f965,_0x41ad17){var _0x55031a={};var _0x249b89={};var _0xc66cb8;var _0x5e6537;return db[_0x8581('0x45')][_0x8581('0x6b')]({'where':{'id':_0x42c14a[_0x8581('0x65')]['id']}})[_0x8581('0x26')](handleEntityNotFound(_0x29f965,null))[_0x8581('0x26')](function(_0x14cb06){if(_0x14cb06){_0xc66cb8=_0x14cb06;_0x249b89[_0x8581('0x4d')]=_[_0x8581('0x4a')](db[_0x8581('0x76')][_0x8581('0x6c')]);_0x249b89[_0x8581('0x49')]=_[_0x8581('0x4a')](_0x42c14a[_0x8581('0x49')]);_0x249b89[_0x8581('0x54')]=_[_0x8581('0x4b')](_0x249b89[_0x8581('0x4d')],_0x249b89['query']);_0x55031a[_0x8581('0x4c')]=_[_0x8581('0x4b')](_0x249b89[_0x8581('0x4d')],qs[_0x8581('0x4e')](_0x42c14a[_0x8581('0x49')][_0x8581('0x4e')]));_0x55031a['attributes']=_0x55031a[_0x8581('0x4c')][_0x8581('0x4f')]?_0x55031a[_0x8581('0x4c')]:_0x249b89['model'];_0x55031a[_0x8581('0x52')]=qs[_0x8581('0x53')](_0x42c14a[_0x8581('0x49')]['sort']);_0x55031a['where']=qs['filters'](_[_0x8581('0x55')](_0x42c14a[_0x8581('0x49')],_0x249b89[_0x8581('0x54')]));if(_0x42c14a[_0x8581('0x49')]['filter']){_0x55031a[_0x8581('0x57')]=_[_0x8581('0x58')](_0x55031a['where'],{'$or':_[_0x8581('0x44')](_0x55031a[_0x8581('0x4c')],function(_0x557984){var _0x15317b={};_0x15317b[_0x557984]={'$like':'%'+_0x42c14a[_0x8581('0x49')]['filter']+'%'};return _0x15317b;})});}_0x55031a=_[_0x8581('0x58')]({},_0x55031a,_0x42c14a[_0x8581('0x5a')]);return _0xc66cb8[_0x8581('0xc4')](_0x55031a);}})[_0x8581('0x26')](function(_0x46d24e){if(_0x46d24e){_0x5e6537=_0x46d24e[_0x8581('0x4f')];if(!_0x42c14a[_0x8581('0x49')][_0x8581('0x6d')](_0x8581('0x50'))){_0x55031a[_0x8581('0x31')]=qs['limit'](_0x42c14a[_0x8581('0x49')][_0x8581('0x31')]);_0x55031a['offset']=qs['offset'](_0x42c14a[_0x8581('0x49')]['offset']);}return _0xc66cb8[_0x8581('0xc4')](_0x55031a);}})[_0x8581('0x26')](function(_0x40be50){if(_0x40be50){return _0x40be50?{'count':_0x5e6537,'rows':_0x40be50}:null;}})[_0x8581('0x26')](respondWithResult(_0x29f965,null))[_0x8581('0x2d')](handleError(_0x29f965,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index a5b8791..7e5ad68 100644 --- a/server/api/faxAccount/faxAccount.events.js +++ b/server/api/faxAccount/faxAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x562c=['save','update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x88cf1c,_0x2fb663){var _0x202467=function(_0x3a0c27){while(--_0x3a0c27){_0x88cf1c['push'](_0x88cf1c['shift']());}};_0x202467(++_0x2fb663);}(_0x562c,0x15c));var _0xc562=function(_0x570de8,_0x9e6280){_0x570de8=_0x570de8-0x0;var _0x3947da=_0x562c[_0x570de8];return _0x3947da;};'use strict';var EventEmitter=require(_0xc562('0x0'));var FaxAccount=require(_0xc562('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xc562('0x2')](0x0);var events={'afterCreate':_0xc562('0x3'),'afterUpdate':_0xc562('0x4'),'afterDestroy':_0xc562('0x5')};function emitEvent(_0x2d26ef){return function(_0x2c604e,_0x511fa2,_0x14a7e9){FaxAccountEvents[_0xc562('0x6')](_0x2d26ef+':'+_0x2c604e['id'],_0x2c604e);FaxAccountEvents['emit'](_0x2d26ef,_0x2c604e);_0x14a7e9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xc562('0x7')](e,emitEvent(event));}}module[_0xc562('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0xd30a=['update','remove','emit','hook','exports','events','FaxAccount','setMaxListeners'];(function(_0xe24d7b,_0x5b27cc){var _0x3e3cff=function(_0x541989){while(--_0x541989){_0xe24d7b['push'](_0xe24d7b['shift']());}};_0x3e3cff(++_0x5b27cc);}(_0xd30a,0x19d));var _0xad30=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xd30a[_0x5783f4];return _0x28e380;};'use strict';var EventEmitter=require(_0xad30('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xad30('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xad30('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xad30('0x3'),'afterDestroy':_0xad30('0x4')};function emitEvent(_0xd50b07){return function(_0x2d33da,_0x21c67b,_0x1cd806){FaxAccountEvents[_0xad30('0x5')](_0xd50b07+':'+_0x2d33da['id'],_0x2d33da);FaxAccountEvents[_0xad30('0x5')](_0xd50b07,_0x2d33da);_0x1cd806(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xad30('0x6')](e,emitEvent(event));}}module[_0xad30('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index bddbd79..9ca4fde 100644 --- a/server/api/faxAccount/faxAccount.model.js +++ b/server/api/faxAccount/faxAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c5a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount','fax_accounts'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x7c5a,0x114));var _0xa7c5=function(_0x176b34,_0x1b66cd){_0x176b34=_0x176b34-0x0;var _0xee1f0f=_0x7c5a[_0x176b34];return _0xee1f0f;};'use strict';var _=require('lodash');var util=require(_0xa7c5('0x0'));var logger=require(_0xa7c5('0x1'))(_0xa7c5('0x2'));var moment=require(_0xa7c5('0x3'));var BPromise=require('bluebird');var rp=require(_0xa7c5('0x4'));var fs=require('fs');var path=require(_0xa7c5('0x5'));var rimraf=require(_0xa7c5('0x6'));var config=require(_0xa7c5('0x7'));var attributes=require(_0xa7c5('0x8'));module[_0xa7c5('0x9')]=function(_0x421216,_0x4ecac9){return _0x421216['define'](_0xa7c5('0xa'),attributes,{'tableName':_0xa7c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb2e=['./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x2d5933,_0x1e8fa3){var _0x3c20ee=function(_0x2fef9b){while(--_0x2fef9b){_0x2d5933['push'](_0x2d5933['shift']());}};_0x3c20ee(++_0x1e8fa3);}(_0xfb2e,0x1f4));var _0xefb2=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xfb2e[_0x5783f4];return _0x28e380;};'use strict';var _=require('lodash');var util=require(_0xefb2('0x0'));var logger=require(_0xefb2('0x1'))(_0xefb2('0x2'));var moment=require(_0xefb2('0x3'));var BPromise=require('bluebird');var rp=require(_0xefb2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xefb2('0x5'));var config=require('../../config/environment');var attributes=require(_0xefb2('0x6'));module[_0xefb2('0x7')]=function(_0x254b3b,_0x5d664c){return _0x254b3b[_0xefb2('0x8')](_0xefb2('0x9'),attributes,{'tableName':_0xefb2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index b528f86..ea7285a 100644 --- a/server/api/faxAccount/faxAccount.rpc.js +++ b/server/api/faxAccount/faxAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca99=['code','message','info','result','catch','GetFaxAccount','options','raw','where','limit','include','map','attributes','model','then','NotifyFaxAccount','body','fax','CmContact','Sequelize','no\x20available\x20attributes','keys','updatedAt','createdAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','ValidationError','mapKey','FaxAccount','find','account','CmList','List','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','Contacts','length','FaxInteraction','create','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','UserId','agent','name','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','client','http','redis','defaults','localhost','./faxAccount.socket','register','request','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x434ae5,_0x4a7010){var _0x297d10=function(_0x594cbc){while(--_0x594cbc){_0x434ae5['push'](_0x434ae5['shift']());}};_0x297d10(++_0x4a7010);}(_0xca99,0x150));var _0x9ca9=function(_0x2edec6,_0x2449bf){_0x2edec6=_0x2edec6-0x0;var _0x2fa6ab=_0xca99[_0x2edec6];return _0x2fa6ab;};'use strict';var _=require(_0x9ca9('0x0'));var util=require(_0x9ca9('0x1'));var moment=require(_0x9ca9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ca9('0x3'));var db=require(_0x9ca9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ca9('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9ca9('0x6')][_0x9ca9('0x7')]({'port':0x232c});config[_0x9ca9('0x8')]=_[_0x9ca9('0x9')](config[_0x9ca9('0x8')],{'host':_0x9ca9('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9ca9('0x8')]));require(_0x9ca9('0xb'))[_0x9ca9('0xc')](socket);function respondWithRpcPromise(_0xec9219,_0x7f952e,_0xd8dabe){return new BPromise(function(_0x40140c,_0x983d05){return client[_0x9ca9('0xd')](_0xec9219,_0xd8dabe)['then'](function(_0x51d890){logger['info'](_0x9ca9('0xe'),_0x7f952e,'request\x20sent');logger[_0x9ca9('0xf')](_0x9ca9('0x10'),_0x7f952e,_0x9ca9('0x11'),JSON[_0x9ca9('0x12')](_0x51d890));if(_0x51d890[_0x9ca9('0x13')]){if(_0x51d890[_0x9ca9('0x13')][_0x9ca9('0x14')]===0x1f4){logger[_0x9ca9('0x13')](_0x9ca9('0xe'),_0x7f952e,_0x51d890[_0x9ca9('0x13')]['message']);return _0x983d05(_0x51d890[_0x9ca9('0x13')]['message']);}logger[_0x9ca9('0x13')](_0x9ca9('0xe'),_0x7f952e,_0x51d890[_0x9ca9('0x13')][_0x9ca9('0x15')]);return _0x40140c(_0x51d890[_0x9ca9('0x13')]['message']);}else{logger[_0x9ca9('0x16')](_0x9ca9('0xe'),_0x7f952e,_0x9ca9('0x11'));_0x40140c(_0x51d890[_0x9ca9('0x17')]['message']);}})[_0x9ca9('0x18')](function(_0x3e7800){logger[_0x9ca9('0x13')]('FaxAccount,\x20%s,\x20%s',_0x7f952e,_0x3e7800);_0x983d05(_0x3e7800);});});}exports[_0x9ca9('0x19')]=function(_0x2770b1){var _0x583e14=this;return new Promise(function(_0x3e7d2a,_0xd9b212){return db['FaxAccount']['findAll']({'raw':_0x2770b1[_0x9ca9('0x1a')]?_0x2770b1['options'][_0x9ca9('0x1b')]===undefined?!![]:![]:!![],'where':_0x2770b1[_0x9ca9('0x1a')]?_0x2770b1[_0x9ca9('0x1a')][_0x9ca9('0x1c')]||null:null,'attributes':_0x2770b1['options']?_0x2770b1[_0x9ca9('0x1a')]['attributes']||null:null,'limit':_0x2770b1['options']?_0x2770b1[_0x9ca9('0x1a')][_0x9ca9('0x1d')]||null:null,'include':_0x2770b1[_0x9ca9('0x1a')]?_0x2770b1[_0x9ca9('0x1a')][_0x9ca9('0x1e')]?_[_0x9ca9('0x1f')](_0x2770b1[_0x9ca9('0x1a')][_0x9ca9('0x1e')],function(_0x551a93){return{'model':db[_0x551a93['model']],'as':_0x551a93['as'],'attributes':_0x551a93[_0x9ca9('0x20')],'include':_0x551a93[_0x9ca9('0x1e')]?_[_0x9ca9('0x1f')](_0x551a93[_0x9ca9('0x1e')],function(_0x29db55){return{'model':db[_0x29db55[_0x9ca9('0x21')]],'as':_0x29db55['as'],'attributes':_0x29db55['attributes'],'include':_0x29db55[_0x9ca9('0x1e')]?_['map'](_0x29db55[_0x9ca9('0x1e')],function(_0x2662dc){return{'model':db[_0x2662dc['model']],'as':_0x2662dc['as'],'attributes':_0x2662dc[_0x9ca9('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9ca9('0x22')](function(_0x570a2b){logger[_0x9ca9('0x16')](_0x9ca9('0x19'),_0x2770b1);logger['debug'](_0x9ca9('0x19'),_0x2770b1,JSON['stringify'](_0x570a2b));_0x3e7d2a(_0x570a2b);})['catch'](function(_0x2051c6){logger[_0x9ca9('0x13')](_0x9ca9('0x19'),_0x2051c6[_0x9ca9('0x15')],_0x2770b1);_0xd9b212(_0x583e14[_0x9ca9('0x13')](0x1f4,_0x2051c6['message']));});});};exports[_0x9ca9('0x23')]=function(_0x2cf1af,_0x1a628f,_0x4c35bf){var _0x17b5a8=this;return new Promise(function(_0x580f6,_0x5b1bed){var _0x3695ee={'body':_0x2cf1af[_0x9ca9('0x24')],'channel':_0x9ca9('0x25')};var _0x5a60bb=[];var _0x5468c2=[];var _0x3b20fa={};return db[_0x9ca9('0x26')]['describe']()[_0x9ca9('0x22')](function(_0x582406){if(!_0x582406){throw new db[(_0x9ca9('0x27'))]['ValidationError'](_0x9ca9('0x28'));}_0x5a60bb=_['difference'](_[_0x9ca9('0x29')](_0x582406),['createdAt',_0x9ca9('0x2a')]);_0x5468c2=_['difference'](_[_0x9ca9('0x29')](_0x582406),[_0x9ca9('0x2b'),_0x9ca9('0x2a'),_0x9ca9('0x2c'),_0x9ca9('0x2d')]);if(_0x2cf1af['body']['id']){delete _0x2cf1af[_0x9ca9('0x24')]['id'];}if(_[_0x9ca9('0x2e')](_0x2cf1af[_0x9ca9('0x24')][_0x9ca9('0x2f')])){throw new db[(_0x9ca9('0x27'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x9ca9('0x2e')](_0x2cf1af['body'][_0x9ca9('0x24')])||_0x2cf1af[_0x9ca9('0x24')][_0x9ca9('0x24')]===''){throw new db['Sequelize']['ValidationError'](_0x9ca9('0x30'));}if(_['isNil'](_0x2cf1af[_0x9ca9('0x24')]['mapKey'])){throw new db[(_0x9ca9('0x27'))]['ValidationError'](_0x9ca9('0x31')+_0x5468c2);}if(!_[_0x9ca9('0x32')](_0x5468c2,_0x2cf1af['body']['mapKey'])){throw new db[(_0x9ca9('0x27'))][(_0x9ca9('0x33'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5468c2);}_0x3b20fa[_0x2cf1af['body'][_0x9ca9('0x34')]]=_0x2cf1af[_0x9ca9('0x24')][_0x9ca9('0x2f')];})[_0x9ca9('0x22')](function(){return db[_0x9ca9('0x35')][_0x9ca9('0x36')]({'where':{'id':_0x2cf1af[_0x9ca9('0x37')]['id']},'include':[{'model':db[_0x9ca9('0x38')],'as':_0x9ca9('0x39'),'include':[{'model':db[_0x9ca9('0x26')],'as':'Contacts','where':_0x3b20fa,'limit':0x1,'order':[[_0x9ca9('0x2a'),_0x9ca9('0x3a')]]}]},{'model':db[_0x9ca9('0x3b')],'as':_0x9ca9('0x3c')}]});})[_0x9ca9('0x22')](function(_0x4d9f20){if(_0x4d9f20&&_0x4d9f20[_0x9ca9('0x39')]){var _0x2c7083=_0x4d9f20[_0x9ca9('0x3d')]({'plain':!![]});_0x3695ee[_0x9ca9('0x37')]=_0x2c7083;_0x3695ee[_0x9ca9('0x3e')]=_0x2c7083['Applications'];_0x3695ee[_0x9ca9('0x3f')]=_0x2c7083[_0x9ca9('0x39')];_0x3695ee[_0x9ca9('0x3e')]=_[_0x9ca9('0x40')](_0x3695ee[_0x9ca9('0x3e')],[_0x9ca9('0x41')],[_0x9ca9('0x42')]);if(_0x3695ee[_0x9ca9('0x37')]['Applications']){delete _0x3695ee[_0x9ca9('0x37')][_0x9ca9('0x3c')];}if(_0x3695ee[_0x9ca9('0x37')][_0x9ca9('0x39')]&&_0x3695ee[_0x9ca9('0x37')]['List'][_0x9ca9('0x43')][_0x9ca9('0x44')]){return _0x3695ee[_0x9ca9('0x37')][_0x9ca9('0x39')][_0x9ca9('0x43')][0x0];}var _0x18a515=_['defaults'](_0x2cf1af['body'],{'firstName':_0x2cf1af[_0x9ca9('0x24')][_0x9ca9('0x2f')],'ListId':_0x2c7083[_0x9ca9('0x2d')]});_0x18a515[_0x2cf1af[_0x9ca9('0x24')]['mapKey']]=_0x2cf1af[_0x9ca9('0x24')]['from'];return db[_0x9ca9('0x26')]['create'](_0x18a515,{'fields':_0x5a60bb,'raw':!![]});}})['then'](function(_0x3d2212){_0x3695ee['contact']=_0x3d2212;if(_0x3d2212){var _0x3ac615={'ContactId':_0x3d2212['id'],'FaxAccountId':_0x2cf1af[_0x9ca9('0x37')]['id'],'fax':_0x3d2212['fax']};return db['FaxInteraction'][_0x9ca9('0x36')]({'where':{'ContactId':_0x3d2212['id'],'closed':![],'FaxAccountId':_0x2cf1af['account']['id']}})[_0x9ca9('0x22')](function(_0x5297e1){if(_0x5297e1){return[_0x5297e1,![]];}return db[_0x9ca9('0x45')][_0x9ca9('0x46')](_0x3ac615)[_0x9ca9('0x22')](function(_0x32bd41){return[_0x32bd41,!![]];});});}else{throw new Error(_0x9ca9('0x47'));}})[_0x9ca9('0x48')](function(_0x33dcb2,_0x35a994){var _0x420f10=_0x33dcb2['get']({'plain':!![]});if(_0x35a994){if(_0x3695ee[_0x9ca9('0x37')]['autoclose']){_0x3695ee[_0x9ca9('0x3e')][_0x9ca9('0x49')]({'id':0x0,'priority':_0x3695ee[_0x9ca9('0x3e')][_0x9ca9('0x44')]+0x1,'app':_0x9ca9('0x4a'),'appdata':_0x9ca9('0x4b'),'interval':_0x9ca9('0x4c')});}_0x420f10[_0x9ca9('0x4d')]=!![];}else{_0x420f10['created']=![];}_0x3695ee[_0x9ca9('0x4e')]=_0x420f10;return db[_0x9ca9('0x4f')][_0x9ca9('0x46')]({'body':_0x2cf1af[_0x9ca9('0x24')][_0x9ca9('0x24')],'FaxAccountId':_0x2cf1af[_0x9ca9('0x37')]['id'],'FaxInteractionId':_0x33dcb2['id'],'direction':'in','ContactId':_0x33dcb2['ContactId'],'AttachmentId':_0x2cf1af['body']['AttachmentId']});})[_0x9ca9('0x22')](function(_0x1791e5){_0x3695ee[_0x9ca9('0x15')]=_0x1791e5;if(!_0x3695ee[_0x9ca9('0x4e')][_0x9ca9('0x50')])return;return db['User'][_0x9ca9('0x36')]({'attributes':['id','name'],'where':{'id':_0x3695ee[_0x9ca9('0x4e')][_0x9ca9('0x50')]}});})['then'](function(_0x28b475){if(_0x28b475){_0x3695ee[_0x9ca9('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9ca9('0x51'),'appdata':_0x28b475[_0x9ca9('0x52')]+','+(_0x3695ee['account'][_0x9ca9('0x53')]||0xa),'interval':_0x9ca9('0x4c')});}if(!_0x3695ee['interaction'][_0x9ca9('0x54')])return;return db['FaxQueue']['find']({'attributes':['id',_0x9ca9('0x52')],'where':{'id':_0x3695ee[_0x9ca9('0x4e')]['queueId']}});})[_0x9ca9('0x22')](function(_0x195f7b){if(_0x195f7b){_0x3695ee[_0x9ca9('0x3e')]['unshift']({'id':0x0,'priority':0x1,'app':_0x9ca9('0x55'),'appdata':_0x195f7b[_0x9ca9('0x52')]+','+(_0x3695ee[_0x9ca9('0x37')][_0x9ca9('0x56')]||0x12c),'interval':_0x9ca9('0x4c')});}return respondWithRpcPromise(_0x9ca9('0x57'),_0x9ca9('0x58'),_0x3695ee);})[_0x9ca9('0x22')](function(_0x3399ee){_0x580f6(_0x3399ee);})[_0x9ca9('0x18')](function(_0x398e1a){_0x5b1bed(_0x17b5a8['error'](0x1f4,_0x398e1a[_0x9ca9('0x15')]));});});}; \ No newline at end of file +var _0x08b7=['mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','list','applications','orderBy','priority','asc','length','create','FaxInteraction','find','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','UserId','User','name','unshift','waitForTheAssignedAgent','FaxQueue','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','FaxAccount','findAll','options','raw','where','limit','map','include','attributes','model','GetFaxAccount','body','fax','describe','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x08b7,0x195));var _0x708b=function(_0x19b18f,_0x2f0a0c){_0x19b18f=_0x19b18f-0x0;var _0x9c3c37=_0x08b7[_0x19b18f];return _0x9c3c37;};'use strict';var _=require(_0x708b('0x0'));var util=require(_0x708b('0x1'));var moment=require(_0x708b('0x2'));var BPromise=require('bluebird');var rs=require(_0x708b('0x3'));var fs=require('fs');var Redis=require(_0x708b('0x4'));var db=require(_0x708b('0x5'))['db'];var utils=require(_0x708b('0x6'));var logger=require('../../config/logger')(_0x708b('0x7'));var config=require(_0x708b('0x8'));var jayson=require(_0x708b('0x9'));var client=jayson['client']['http']({'port':0x232c});config[_0x708b('0xa')]=_[_0x708b('0xb')](config['redis'],{'host':_0x708b('0xc'),'port':0x18eb});var socket=require(_0x708b('0xd'))(new Redis(config[_0x708b('0xa')]));require(_0x708b('0xe'))[_0x708b('0xf')](socket);function respondWithRpcPromise(_0xc94fc,_0x4517c2,_0x1354e3){return new BPromise(function(_0x31daea,_0x226e34){return client[_0x708b('0x10')](_0xc94fc,_0x1354e3)[_0x708b('0x11')](function(_0x342935){logger[_0x708b('0x12')](_0x708b('0x13'),_0x4517c2,'request\x20sent');logger[_0x708b('0x14')](_0x708b('0x15'),_0x4517c2,_0x708b('0x16'),JSON['stringify'](_0x342935));if(_0x342935[_0x708b('0x17')]){if(_0x342935[_0x708b('0x17')][_0x708b('0x18')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x4517c2,_0x342935['error'][_0x708b('0x19')]);return _0x226e34(_0x342935[_0x708b('0x17')][_0x708b('0x19')]);}logger[_0x708b('0x17')](_0x708b('0x13'),_0x4517c2,_0x342935[_0x708b('0x17')]['message']);return _0x31daea(_0x342935['error'][_0x708b('0x19')]);}else{logger['info'](_0x708b('0x13'),_0x4517c2,_0x708b('0x16'));_0x31daea(_0x342935[_0x708b('0x1a')][_0x708b('0x19')]);}})[_0x708b('0x1b')](function(_0x4b1520){logger[_0x708b('0x17')](_0x708b('0x13'),_0x4517c2,_0x4b1520);_0x226e34(_0x4b1520);});});}exports['GetFaxAccount']=function(_0x18873e){var _0x335119=this;return new Promise(function(_0x1da57a,_0x47bcc5){return db[_0x708b('0x1c')][_0x708b('0x1d')]({'raw':_0x18873e[_0x708b('0x1e')]?_0x18873e[_0x708b('0x1e')][_0x708b('0x1f')]===undefined?!![]:![]:!![],'where':_0x18873e[_0x708b('0x1e')]?_0x18873e[_0x708b('0x1e')][_0x708b('0x20')]||null:null,'attributes':_0x18873e[_0x708b('0x1e')]?_0x18873e[_0x708b('0x1e')]['attributes']||null:null,'limit':_0x18873e[_0x708b('0x1e')]?_0x18873e[_0x708b('0x1e')][_0x708b('0x21')]||null:null,'include':_0x18873e[_0x708b('0x1e')]?_0x18873e[_0x708b('0x1e')]['include']?_[_0x708b('0x22')](_0x18873e[_0x708b('0x1e')][_0x708b('0x23')],function(_0x5b5f32){return{'model':db[_0x5b5f32['model']],'as':_0x5b5f32['as'],'attributes':_0x5b5f32[_0x708b('0x24')],'include':_0x5b5f32['include']?_[_0x708b('0x22')](_0x5b5f32[_0x708b('0x23')],function(_0x159bb3){return{'model':db[_0x159bb3['model']],'as':_0x159bb3['as'],'attributes':_0x159bb3[_0x708b('0x24')],'include':_0x159bb3[_0x708b('0x23')]?_[_0x708b('0x22')](_0x159bb3[_0x708b('0x23')],function(_0x23a84a){return{'model':db[_0x23a84a[_0x708b('0x25')]],'as':_0x23a84a['as'],'attributes':_0x23a84a[_0x708b('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9aa773){logger['info'](_0x708b('0x26'),_0x18873e);logger[_0x708b('0x14')](_0x708b('0x26'),_0x18873e,JSON['stringify'](_0x9aa773));_0x1da57a(_0x9aa773);})[_0x708b('0x1b')](function(_0x34e854){logger[_0x708b('0x17')](_0x708b('0x26'),_0x34e854[_0x708b('0x19')],_0x18873e);_0x47bcc5(_0x335119[_0x708b('0x17')](0x1f4,_0x34e854[_0x708b('0x19')]));});});};exports['NotifyFaxAccount']=function(_0x23ad87,_0x41adf0,_0x5c5cb3){var _0x56c313=this;return new Promise(function(_0x2f27eb,_0x2fedf3){var _0x43b9e8={'body':_0x23ad87[_0x708b('0x27')],'channel':_0x708b('0x28')};var _0x54e8b0=[];var _0xb474dd=[];var _0x3a2f82={};return db['CmContact'][_0x708b('0x29')]()[_0x708b('0x11')](function(_0x39da0f){if(!_0x39da0f){throw new db['Sequelize'][(_0x708b('0x2a'))]('no\x20available\x20attributes');}_0x54e8b0=_[_0x708b('0x2b')](_[_0x708b('0x2c')](_0x39da0f),[_0x708b('0x2d'),'updatedAt']);_0xb474dd=_[_0x708b('0x2b')](_[_0x708b('0x2c')](_0x39da0f),[_0x708b('0x2d'),_0x708b('0x2e'),_0x708b('0x2f'),_0x708b('0x30')]);if(_0x23ad87['body']['id']){delete _0x23ad87[_0x708b('0x27')]['id'];}if(_[_0x708b('0x31')](_0x23ad87[_0x708b('0x27')][_0x708b('0x32')])){throw new db[(_0x708b('0x33'))][(_0x708b('0x2a'))](_0x708b('0x34'));}if(_[_0x708b('0x31')](_0x23ad87[_0x708b('0x27')][_0x708b('0x27')])||_0x23ad87[_0x708b('0x27')][_0x708b('0x27')]===''){throw new db[(_0x708b('0x33'))][(_0x708b('0x2a'))](_0x708b('0x35'));}if(_['isNil'](_0x23ad87['body'][_0x708b('0x36')])){throw new db['Sequelize'][(_0x708b('0x2a'))](_0x708b('0x37')+_0xb474dd);}if(!_['includes'](_0xb474dd,_0x23ad87[_0x708b('0x27')]['mapKey'])){throw new db[(_0x708b('0x33'))]['ValidationError'](_0x708b('0x38')+_0xb474dd);}_0x3a2f82[_0x23ad87[_0x708b('0x27')]['mapKey']]=_0x23ad87[_0x708b('0x27')][_0x708b('0x32')];})[_0x708b('0x11')](function(){return db[_0x708b('0x1c')]['find']({'where':{'id':_0x23ad87[_0x708b('0x39')]['id']},'include':[{'model':db[_0x708b('0x3a')],'as':_0x708b('0x3b'),'include':[{'model':db['CmContact'],'as':_0x708b('0x3c'),'where':_0x3a2f82,'limit':0x1,'order':[[_0x708b('0x2e'),_0x708b('0x3d')]]}]},{'model':db[_0x708b('0x3e')],'as':_0x708b('0x3f')}]});})[_0x708b('0x11')](function(_0xcd3072){if(_0xcd3072&&_0xcd3072[_0x708b('0x3b')]){var _0x3f7532=_0xcd3072[_0x708b('0x40')]({'plain':!![]});_0x43b9e8[_0x708b('0x39')]=_0x3f7532;_0x43b9e8['applications']=_0x3f7532['Applications'];_0x43b9e8[_0x708b('0x41')]=_0x3f7532[_0x708b('0x3b')];_0x43b9e8[_0x708b('0x42')]=_[_0x708b('0x43')](_0x43b9e8['applications'],[_0x708b('0x44')],[_0x708b('0x45')]);if(_0x43b9e8[_0x708b('0x39')][_0x708b('0x3f')]){delete _0x43b9e8[_0x708b('0x39')][_0x708b('0x3f')];}if(_0x43b9e8[_0x708b('0x39')][_0x708b('0x3b')]&&_0x43b9e8[_0x708b('0x39')][_0x708b('0x3b')][_0x708b('0x3c')][_0x708b('0x46')]){return _0x43b9e8[_0x708b('0x39')][_0x708b('0x3b')][_0x708b('0x3c')][0x0];}var _0x6eb3a3=_[_0x708b('0xb')](_0x23ad87[_0x708b('0x27')],{'firstName':_0x23ad87[_0x708b('0x27')][_0x708b('0x32')],'ListId':_0x3f7532[_0x708b('0x30')]});_0x6eb3a3[_0x23ad87[_0x708b('0x27')][_0x708b('0x36')]]=_0x23ad87[_0x708b('0x27')][_0x708b('0x32')];return db['CmContact'][_0x708b('0x47')](_0x6eb3a3,{'fields':_0x54e8b0,'raw':!![]});}})[_0x708b('0x11')](function(_0x2418f4){_0x43b9e8['contact']=_0x2418f4;if(_0x2418f4){var _0x5c6b8f={'ContactId':_0x2418f4['id'],'FaxAccountId':_0x23ad87['account']['id'],'fax':_0x2418f4[_0x708b('0x28')]};return db[_0x708b('0x48')][_0x708b('0x49')]({'where':{'ContactId':_0x2418f4['id'],'closed':![],'FaxAccountId':_0x23ad87[_0x708b('0x39')]['id']}})['then'](function(_0x450a00){if(_0x450a00){return[_0x450a00,![]];}return db[_0x708b('0x48')][_0x708b('0x47')](_0x5c6b8f)[_0x708b('0x11')](function(_0x3c07a7){return[_0x3c07a7,!![]];});});}else{throw new Error(_0x708b('0x4a'));}})[_0x708b('0x4b')](function(_0x3b6d0b,_0x5dc774){var _0xdebad0=_0x3b6d0b[_0x708b('0x40')]({'plain':!![]});if(_0x5dc774){if(_0x43b9e8[_0x708b('0x39')]['autoclose']){_0x43b9e8['applications'][_0x708b('0x4c')]({'id':0x0,'priority':_0x43b9e8[_0x708b('0x42')][_0x708b('0x46')]+0x1,'app':_0x708b('0x4d'),'appdata':_0x708b('0x4e'),'interval':_0x708b('0x4f')});}_0xdebad0[_0x708b('0x50')]=!![];}else{_0xdebad0[_0x708b('0x50')]=![];}_0x43b9e8[_0x708b('0x51')]=_0xdebad0;return db['FaxMessage']['create']({'body':_0x23ad87['body'][_0x708b('0x27')],'FaxAccountId':_0x23ad87[_0x708b('0x39')]['id'],'FaxInteractionId':_0x3b6d0b['id'],'direction':'in','ContactId':_0x3b6d0b[_0x708b('0x52')],'AttachmentId':_0x23ad87[_0x708b('0x27')][_0x708b('0x53')]});})['then'](function(_0x46d383){_0x43b9e8['message']=_0x46d383;if(!_0x43b9e8[_0x708b('0x51')][_0x708b('0x54')])return;return db[_0x708b('0x55')][_0x708b('0x49')]({'attributes':['id',_0x708b('0x56')],'where':{'id':_0x43b9e8[_0x708b('0x51')][_0x708b('0x54')]}});})['then'](function(_0x26f41d){if(_0x26f41d){_0x43b9e8[_0x708b('0x42')][_0x708b('0x57')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x26f41d[_0x708b('0x56')]+','+(_0x43b9e8[_0x708b('0x39')][_0x708b('0x58')]||0xa),'interval':_0x708b('0x4f')});}if(!_0x43b9e8[_0x708b('0x51')]['queueId'])return;return db[_0x708b('0x59')]['find']({'attributes':['id',_0x708b('0x56')],'where':{'id':_0x43b9e8[_0x708b('0x51')]['queueId']}});})[_0x708b('0x11')](function(_0x48bbe5){if(_0x48bbe5){_0x43b9e8[_0x708b('0x42')][_0x708b('0x57')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x48bbe5[_0x708b('0x56')]+','+(_0x43b9e8[_0x708b('0x39')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x708b('0x5a'),_0x708b('0x5b'),_0x43b9e8);})[_0x708b('0x11')](function(_0x1e0b5f){_0x2f27eb(_0x1e0b5f);})[_0x708b('0x1b')](function(_0x15b9d1){_0x2fedf3(_0x56c313[_0x708b('0x17')](0x1f4,_0x15b9d1[_0x708b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 155720c..fdd1ac5 100644 --- a/server/api/faxAccount/faxAccount.socket.js +++ b/server/api/faxAccount/faxAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1bf0=['remove','update','emit','register','length','faxAccount:','./faxAccount.events'];(function(_0x5f0e63,_0x3d7dd6){var _0x1e4574=function(_0x2df20d){while(--_0x2df20d){_0x5f0e63['push'](_0x5f0e63['shift']());}};_0x1e4574(++_0x3d7dd6);}(_0x1bf0,0x1bf));var _0x01bf=function(_0x827fa8,_0x2537d0){_0x827fa8=_0x827fa8-0x0;var _0x2a3e4f=_0x1bf0[_0x827fa8];return _0x2a3e4f;};'use strict';var FaxAccountEvents=require(_0x01bf('0x0'));var events=['save',_0x01bf('0x1'),_0x01bf('0x2')];function createListener(_0x41fd78,_0x2aa7e2){return function(_0x3cbdbe){_0x2aa7e2[_0x01bf('0x3')](_0x41fd78,_0x3cbdbe);};}function removeListener(_0x2e71f5,_0xe1dcf2){return function(){FaxAccountEvents['removeListener'](_0x2e71f5,_0xe1dcf2);};}exports[_0x01bf('0x4')]=function(_0x19b8d9){for(var _0x1ed9cb=0x0,_0x3cedd9=events[_0x01bf('0x5')];_0x1ed9cb<_0x3cedd9;_0x1ed9cb++){var _0x5c4a86=events[_0x1ed9cb];var _0x1f6a66=createListener(_0x01bf('0x6')+_0x5c4a86,_0x19b8d9);FaxAccountEvents['on'](_0x5c4a86,_0x1f6a66);}}; \ No newline at end of file +var _0xab46=['faxAccount:','remove','update','register'];(function(_0x385b14,_0xa8f59b){var _0x2233c6=function(_0x47c104){while(--_0x47c104){_0x385b14['push'](_0x385b14['shift']());}};_0x2233c6(++_0xa8f59b);}(_0xab46,0x191));var _0x6ab4=function(_0x4b3e49,_0x9e566c){_0x4b3e49=_0x4b3e49-0x0;var _0x57e339=_0xab46[_0x4b3e49];return _0x57e339;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save',_0x6ab4('0x0'),_0x6ab4('0x1')];function createListener(_0x522551,_0x30653a){return function(_0x3b6e5a){_0x30653a['emit'](_0x522551,_0x3b6e5a);};}function removeListener(_0x5845e1,_0x140d6e){return function(){FaxAccountEvents['removeListener'](_0x5845e1,_0x140d6e);};}exports[_0x6ab4('0x2')]=function(_0x37ac00){for(var _0x4b4a33=0x0,_0x1187c7=events['length'];_0x4b4a33<_0x1187c7;_0x4b4a33++){var _0x205553=events[_0x4b4a33];var _0x16325c=createListener(_0x6ab4('0x3')+_0x205553,_0x37ac00);FaxAccountEvents['on'](_0x205553,_0x16325c);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 37f8038..b28dd0c 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd3da=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/applications','/:id/messages','getAgents','create','post','addDisposition','addAnswer','/:id/interactions','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','/:id/users','put','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x259b52,_0xc98b34){var _0x3699a5=function(_0x6b052b){while(--_0x6b052b){_0x259b52['push'](_0x259b52['shift']());}};_0x3699a5(++_0xc98b34);}(_0xd3da,0x7c));var _0xad3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3da[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xad3d('0x0'));var util=require(_0xad3d('0x1'));var path=require(_0xad3d('0x2'));var timeout=require(_0xad3d('0x3'));var express=require(_0xad3d('0x4'));var router=express['Router']();var fs_extra=require(_0xad3d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xad3d('0x6'));var config=require(_0xad3d('0x7'));var controller=require(_0xad3d('0x8'));router[_0xad3d('0x9')]('/',auth[_0xad3d('0xa')](),controller[_0xad3d('0xb')]);router['get']('/describe',auth[_0xad3d('0xa')](),controller[_0xad3d('0xc')]);router['get'](_0xad3d('0xd'),auth[_0xad3d('0xa')](),controller[_0xad3d('0xe')]);router[_0xad3d('0x9')](_0xad3d('0xf'),auth[_0xad3d('0xa')](),controller[_0xad3d('0x10')]);router['get'](_0xad3d('0x11'),auth[_0xad3d('0xa')](),controller[_0xad3d('0x12')]);router[_0xad3d('0x9')]('/:id/interactions',auth[_0xad3d('0xa')](),controller[_0xad3d('0x13')]);router[_0xad3d('0x9')](_0xad3d('0x14'),auth['isAuthenticated'](),controller['getApplications']);router[_0xad3d('0x9')](_0xad3d('0x15'),auth[_0xad3d('0xa')](),controller['getMessages']);router[_0xad3d('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xad3d('0x16')]);router['post']('/',auth[_0xad3d('0xa')](),controller[_0xad3d('0x17')]);router[_0xad3d('0x18')](_0xad3d('0xf'),auth[_0xad3d('0xa')](),controller[_0xad3d('0x19')]);router['post'](_0xad3d('0x11'),auth[_0xad3d('0xa')](),controller[_0xad3d('0x1a')]);router[_0xad3d('0x18')](_0xad3d('0x1b'),auth[_0xad3d('0xa')](),controller['addInteraction']);router[_0xad3d('0x18')](_0xad3d('0x14'),auth[_0xad3d('0xa')](),controller[_0xad3d('0x1c')]);router['post'](_0xad3d('0x1d'),auth[_0xad3d('0xa')](),controller[_0xad3d('0x1e')]);router[_0xad3d('0x18')](_0xad3d('0x1f'),auth[_0xad3d('0xa')](),controller[_0xad3d('0x20')]);router[_0xad3d('0x18')](_0xad3d('0x21'),auth[_0xad3d('0xa')](),controller[_0xad3d('0x22')]);router[_0xad3d('0x18')](_0xad3d('0x23'),auth['isAuthenticated'](),controller['addAgents']);router[_0xad3d('0x24')](_0xad3d('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xad3d('0x25')](_0xad3d('0xd'),auth[_0xad3d('0xa')](),controller['destroy']);router[_0xad3d('0x25')](_0xad3d('0xf'),auth[_0xad3d('0xa')](),controller[_0xad3d('0x26')]);router[_0xad3d('0x25')](_0xad3d('0x11'),auth[_0xad3d('0xa')](),controller[_0xad3d('0x27')]);router['delete'](_0xad3d('0x23'),auth[_0xad3d('0xa')](),controller[_0xad3d('0x28')]);module[_0xad3d('0x29')]=router; \ No newline at end of file +var _0xe095=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getInteractions','getApplications','/:id/messages','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/interactions','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','put','update','destroy','delete','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0xfc2644,_0x4a3b13){var _0x4873b7=function(_0x4a99ac){while(--_0x4a99ac){_0xfc2644['push'](_0xfc2644['shift']());}};_0x4873b7(++_0x4a3b13);}(_0xe095,0x71));var _0x5e09=function(_0x3ebb67,_0x1c00c0){_0x3ebb67=_0x3ebb67-0x0;var _0x300af1=_0xe095[_0x3ebb67];return _0x300af1;};'use strict';var multer=require(_0x5e09('0x0'));var util=require(_0x5e09('0x1'));var path=require('path');var timeout=require(_0x5e09('0x2'));var express=require(_0x5e09('0x3'));var router=express[_0x5e09('0x4')]();var fs_extra=require(_0x5e09('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5e09('0x6'));var controller=require('./faxAccount.controller');router[_0x5e09('0x7')]('/',auth[_0x5e09('0x8')](),controller[_0x5e09('0x9')]);router[_0x5e09('0x7')](_0x5e09('0xa'),auth[_0x5e09('0x8')](),controller[_0x5e09('0xb')]);router[_0x5e09('0x7')](_0x5e09('0xc'),auth[_0x5e09('0x8')](),controller[_0x5e09('0xd')]);router[_0x5e09('0x7')](_0x5e09('0xe'),auth[_0x5e09('0x8')](),controller[_0x5e09('0xf')]);router[_0x5e09('0x7')](_0x5e09('0x10'),auth[_0x5e09('0x8')](),controller['getAnswers']);router[_0x5e09('0x7')]('/:id/interactions',auth[_0x5e09('0x8')](),controller[_0x5e09('0x11')]);router[_0x5e09('0x7')]('/:id/applications',auth['isAuthenticated'](),controller[_0x5e09('0x12')]);router[_0x5e09('0x7')](_0x5e09('0x13'),auth[_0x5e09('0x8')](),controller['getMessages']);router[_0x5e09('0x7')](_0x5e09('0x14'),auth[_0x5e09('0x8')](),controller[_0x5e09('0x15')]);router[_0x5e09('0x16')]('/',auth['isAuthenticated'](),controller[_0x5e09('0x17')]);router[_0x5e09('0x16')](_0x5e09('0xe'),auth[_0x5e09('0x8')](),controller[_0x5e09('0x18')]);router[_0x5e09('0x16')](_0x5e09('0x10'),auth[_0x5e09('0x8')](),controller[_0x5e09('0x19')]);router[_0x5e09('0x16')](_0x5e09('0x1a'),auth[_0x5e09('0x8')](),controller['addInteraction']);router[_0x5e09('0x16')]('/:id/applications',auth[_0x5e09('0x8')](),controller[_0x5e09('0x1b')]);router['post'](_0x5e09('0x1c'),auth[_0x5e09('0x8')](),controller[_0x5e09('0x1d')]);router['post'](_0x5e09('0x1e'),auth[_0x5e09('0x8')](),controller[_0x5e09('0x1f')]);router[_0x5e09('0x16')](_0x5e09('0x20'),auth['isAuthenticated'](),controller[_0x5e09('0x21')]);router[_0x5e09('0x16')](_0x5e09('0x14'),auth['isAuthenticated'](),controller[_0x5e09('0x22')]);router[_0x5e09('0x23')](_0x5e09('0xc'),auth[_0x5e09('0x8')](),controller[_0x5e09('0x24')]);router['delete'](_0x5e09('0xc'),auth[_0x5e09('0x8')](),controller[_0x5e09('0x25')]);router[_0x5e09('0x26')](_0x5e09('0xe'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x5e09('0x26')]('/:id/canned_answers',auth[_0x5e09('0x8')](),controller['removeAnswers']);router[_0x5e09('0x26')](_0x5e09('0x14'),auth['isAuthenticated'](),controller[_0x5e09('0x27')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index d34f891..51dddd2 100644 --- a/server/api/faxApplication/faxApplication.attributes.js +++ b/server/api/faxApplication/faxApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa785=['STRING','noop','*,*,*,*','exports'];(function(_0x245738,_0x5c8659){var _0x174f74=function(_0xbb25a0){while(--_0xbb25a0){_0x245738['push'](_0x245738['shift']());}};_0x174f74(++_0x5c8659);}(_0xa785,0xa7));var _0x5a78=function(_0xbec8e6,_0x2841b5){_0xbec8e6=_0xbec8e6-0x0;var _0x4aa6f2=_0xa785[_0xbec8e6];return _0x4aa6f2;};'use strict';var Sequelize=require('sequelize');module[_0x5a78('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5a78('0x1')],'allowNull':![],'defaultValue':_0x5a78('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x5a78('0x1')]},'interval':{'type':Sequelize[_0x5a78('0x1')],'defaultValue':_0x5a78('0x3')}}; \ No newline at end of file +var _0x6311=['STRING','exports'];(function(_0x250547,_0x744b26){var _0x298ee3=function(_0x516824){while(--_0x516824){_0x250547['push'](_0x250547['shift']());}};_0x298ee3(++_0x744b26);}(_0x6311,0x69));var _0x1631=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x6311[_0x2aa0e7];return _0x1472c0;};'use strict';var Sequelize=require('sequelize');module[_0x1631('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1631('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index a2f9947..9aec103 100644 --- a/server/api/faxApplication/faxApplication.controller.js +++ b/server/api/faxApplication/faxApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbcb=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','apply','reject','save','destroy','error','name','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','options','FaxApplication','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','update','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x3e55f7,_0x232df0){var _0x48db30=function(_0x58220c){while(--_0x58220c){_0x3e55f7['push'](_0x3e55f7['shift']());}};_0x48db30(++_0x232df0);}(_0xfbcb,0x12c));var _0xbfbc=function(_0x398545,_0x3dfca4){_0x398545=_0x398545-0x0;var _0x214189=_0xfbcb[_0x398545];return _0x214189;};'use strict';var emlformat=require(_0xbfbc('0x0'));var rimraf=require(_0xbfbc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbfbc('0x2'));var rp=require(_0xbfbc('0x3'));var moment=require(_0xbfbc('0x4'));var BPromise=require(_0xbfbc('0x5'));var Mustache=require('mustache');var util=require(_0xbfbc('0x6'));var path=require(_0xbfbc('0x7'));var sox=require(_0xbfbc('0x8'));var csv=require(_0xbfbc('0x9'));var ejs=require(_0xbfbc('0xa'));var fs=require('fs');var fs_extra=require(_0xbfbc('0xb'));var _=require(_0xbfbc('0xc'));var squel=require(_0xbfbc('0xd'));var crypto=require(_0xbfbc('0xe'));var jsforce=require(_0xbfbc('0xf'));var deskjs=require(_0xbfbc('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbfbc('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbfbc('0x12'));var qs=require(_0xbfbc('0x13'));var as=require(_0xbfbc('0x14'));var hardwareService=require(_0xbfbc('0x15'));var logger=require(_0xbfbc('0x16'))(_0xbfbc('0x17'));var utils=require(_0xbfbc('0x18'));var config=require(_0xbfbc('0x19'));var licenseUtil=require(_0xbfbc('0x1a'));var db=require(_0xbfbc('0x1b'))['db'];function respondWithStatusCode(_0x4de160,_0x10c1a9){_0x10c1a9=_0x10c1a9||0xcc;return function(_0x5e5a92){if(_0x5e5a92){return _0x4de160[_0xbfbc('0x1c')](_0x10c1a9);}return _0x4de160['status'](_0x10c1a9)[_0xbfbc('0x1d')]();};}function respondWithResult(_0x1f5eb3,_0x5f1765){_0x5f1765=_0x5f1765||0xc8;return function(_0x2838b8){if(_0x2838b8){return _0x1f5eb3[_0xbfbc('0x1e')](_0x5f1765)[_0xbfbc('0x1f')](_0x2838b8);}};}function respondWithFilteredResult(_0xe5848c,_0x4c3d8d){return function(_0x3720a8){if(_0x3720a8){var _0x329f18=typeof _0x4c3d8d[_0xbfbc('0x20')]===_0xbfbc('0x21')&&typeof _0x4c3d8d['limit']===_0xbfbc('0x21');var _0x23341e=_0x3720a8['count'];var _0x591def=_0x329f18?0x0:_0x4c3d8d[_0xbfbc('0x20')];var _0x3f55e1=_0x329f18?_0x3720a8[_0xbfbc('0x22')]:_0x4c3d8d[_0xbfbc('0x20')]+_0x4c3d8d['limit'];var _0x4c8192;if(_0x3f55e1>=_0x23341e){_0x3f55e1=_0x23341e;_0x4c8192=0xc8;}else{_0x4c8192=0xce;}_0xe5848c[_0xbfbc('0x1e')](_0x4c8192);return _0xe5848c[_0xbfbc('0x23')]('Content-Range',_0x591def+'-'+_0x3f55e1+'/'+_0x23341e)[_0xbfbc('0x1f')](_0x3720a8);}return null;};}function patchUpdates(_0x214a14){return function(_0x4d5737){try{jsonpatch[_0xbfbc('0x24')](_0x4d5737,_0x214a14,!![]);}catch(_0x1e62b9){return BPromise[_0xbfbc('0x25')](_0x1e62b9);}return _0x4d5737[_0xbfbc('0x26')]();};}function saveUpdates(_0x561512,_0x459bdb){return function(_0x3fb012){if(_0x3fb012){return _0x3fb012['update'](_0x561512)['then'](function(_0x52c681){return _0x52c681;});}return null;};}function removeEntity(_0x148b7d,_0x4cc15b){return function(_0x2f893b){if(_0x2f893b){return _0x2f893b[_0xbfbc('0x27')]()['then'](function(){_0x148b7d[_0xbfbc('0x1e')](0xcc)[_0xbfbc('0x1d')]();});}};}function handleEntityNotFound(_0x349384,_0x47686d){return function(_0x33d825){if(!_0x33d825){_0x349384[_0xbfbc('0x1c')](0x194);}return _0x33d825;};}function handleError(_0x3577b0,_0x284b9e){_0x284b9e=_0x284b9e||0x1f4;return function(_0x1332f0){logger[_0xbfbc('0x28')](_0x1332f0['stack']);if(_0x1332f0[_0xbfbc('0x29')]){delete _0x1332f0[_0xbfbc('0x29')];}_0x3577b0[_0xbfbc('0x1e')](_0x284b9e)['send'](_0x1332f0);};}exports['index']=function(_0x207ae0,_0x16abe5){var _0xbfa43c={},_0x1f0d60={},_0x9d7991={'count':0x0,'rows':[]};var _0x41699e=_[_0xbfbc('0x2a')](db['FaxApplication']['rawAttributes'],function(_0x1c4929){return{'name':_0x1c4929[_0xbfbc('0x2b')],'type':_0x1c4929[_0xbfbc('0x2c')][_0xbfbc('0x2d')]};});_0x1f0d60['model']=_[_0xbfbc('0x2a')](_0x41699e,_0xbfbc('0x29'));_0x1f0d60[_0xbfbc('0x2e')]=_[_0xbfbc('0x2f')](_0x207ae0[_0xbfbc('0x2e')]);_0x1f0d60[_0xbfbc('0x30')]=_[_0xbfbc('0x31')](_0x1f0d60[_0xbfbc('0x32')],_0x1f0d60[_0xbfbc('0x2e')]);_0xbfa43c[_0xbfbc('0x33')]=_[_0xbfbc('0x31')](_0x1f0d60['model'],qs[_0xbfbc('0x34')](_0x207ae0['query'][_0xbfbc('0x34')]));_0xbfa43c[_0xbfbc('0x33')]=_0xbfa43c[_0xbfbc('0x33')][_0xbfbc('0x35')]?_0xbfa43c[_0xbfbc('0x33')]:_0x1f0d60[_0xbfbc('0x32')];if(!_0x207ae0[_0xbfbc('0x2e')][_0xbfbc('0x36')]('nolimit')){_0xbfa43c[_0xbfbc('0x37')]=qs[_0xbfbc('0x37')](_0x207ae0[_0xbfbc('0x2e')][_0xbfbc('0x37')]);_0xbfa43c['offset']=qs[_0xbfbc('0x20')](_0x207ae0[_0xbfbc('0x2e')]['offset']);}_0xbfa43c[_0xbfbc('0x38')]=qs['sort'](_0x207ae0[_0xbfbc('0x2e')][_0xbfbc('0x39')]);_0xbfa43c['where']=qs[_0xbfbc('0x30')](_[_0xbfbc('0x3a')](_0x207ae0[_0xbfbc('0x2e')],_0x1f0d60[_0xbfbc('0x30')]),_0x41699e);if(_0x207ae0['query'][_0xbfbc('0x3b')]){_0xbfa43c[_0xbfbc('0x3c')]=_[_0xbfbc('0x3d')](_0xbfa43c['where'],{'$or':_[_0xbfbc('0x2a')](_0x41699e,function(_0x30bd9a){if(_0x30bd9a[_0xbfbc('0x2c')]!=='VIRTUAL'){var _0x28736f={};_0x28736f[_0x30bd9a[_0xbfbc('0x29')]]={'$like':'%'+_0x207ae0[_0xbfbc('0x2e')][_0xbfbc('0x3b')]+'%'};return _0x28736f;}})});}_0xbfa43c=_[_0xbfbc('0x3d')]({},_0xbfa43c,_0x207ae0[_0xbfbc('0x3e')]);var _0x430cff={'where':_0xbfa43c['where']};return db[_0xbfbc('0x3f')]['count'](_0x430cff)[_0xbfbc('0x40')](function(_0x2f5f4e){_0x9d7991['count']=_0x2f5f4e;if(_0x207ae0[_0xbfbc('0x2e')][_0xbfbc('0x41')]){_0xbfa43c[_0xbfbc('0x42')]=[{'all':!![]}];}return db[_0xbfbc('0x3f')][_0xbfbc('0x43')](_0xbfa43c);})[_0xbfbc('0x40')](function(_0x51c561){_0x9d7991[_0xbfbc('0x44')]=_0x51c561;return _0x9d7991;})[_0xbfbc('0x40')](respondWithFilteredResult(_0x16abe5,_0xbfa43c))[_0xbfbc('0x45')](handleError(_0x16abe5,null));};exports[_0xbfbc('0x46')]=function(_0x164305,_0x2a681b){var _0x18e7d6={'raw':!![],'where':{'id':_0x164305[_0xbfbc('0x47')]['id']}},_0x169bd7={};_0x169bd7[_0xbfbc('0x32')]=_[_0xbfbc('0x2f')](db[_0xbfbc('0x3f')][_0xbfbc('0x48')]);_0x169bd7[_0xbfbc('0x2e')]=_[_0xbfbc('0x2f')](_0x164305[_0xbfbc('0x2e')]);_0x169bd7[_0xbfbc('0x30')]=_[_0xbfbc('0x31')](_0x169bd7[_0xbfbc('0x32')],_0x169bd7[_0xbfbc('0x2e')]);_0x18e7d6[_0xbfbc('0x33')]=_[_0xbfbc('0x31')](_0x169bd7[_0xbfbc('0x32')],qs[_0xbfbc('0x34')](_0x164305[_0xbfbc('0x2e')][_0xbfbc('0x34')]));_0x18e7d6[_0xbfbc('0x33')]=_0x18e7d6[_0xbfbc('0x33')][_0xbfbc('0x35')]?_0x18e7d6[_0xbfbc('0x33')]:_0x169bd7[_0xbfbc('0x32')];if(_0x164305[_0xbfbc('0x2e')]['includeAll']){_0x18e7d6['include']=[{'all':!![]}];}_0x18e7d6=_[_0xbfbc('0x3d')]({},_0x18e7d6,_0x164305['options']);return db[_0xbfbc('0x3f')]['find'](_0x18e7d6)[_0xbfbc('0x40')](handleEntityNotFound(_0x2a681b,null))['then'](respondWithResult(_0x2a681b,null))[_0xbfbc('0x45')](handleError(_0x2a681b,null));};exports[_0xbfbc('0x49')]=function(_0x309ba4,_0x407208){return db[_0xbfbc('0x3f')][_0xbfbc('0x49')](_0x309ba4[_0xbfbc('0x4a')],{})[_0xbfbc('0x40')](respondWithResult(_0x407208,0xc9))[_0xbfbc('0x45')](handleError(_0x407208,null));};exports[_0xbfbc('0x4b')]=function(_0x16b091,_0x41d89f){if(_0x16b091[_0xbfbc('0x4a')]['id']){delete _0x16b091[_0xbfbc('0x4a')]['id'];}return db[_0xbfbc('0x3f')]['find']({'where':{'id':_0x16b091['params']['id']}})[_0xbfbc('0x40')](handleEntityNotFound(_0x41d89f,null))[_0xbfbc('0x40')](saveUpdates(_0x16b091['body'],null))[_0xbfbc('0x40')](respondWithResult(_0x41d89f,null))[_0xbfbc('0x45')](handleError(_0x41d89f,null));};exports[_0xbfbc('0x27')]=function(_0x1467eb,_0x307fc3){return db[_0xbfbc('0x3f')][_0xbfbc('0x4c')]({'where':{'id':_0x1467eb[_0xbfbc('0x47')]['id']}})[_0xbfbc('0x40')](handleEntityNotFound(_0x307fc3,null))[_0xbfbc('0x40')](removeEntity(_0x307fc3,null))['catch'](handleError(_0x307fc3,null));}; \ No newline at end of file +var _0x280d=['squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','FaxApplication','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','eml-format','rimraf','zip-dir','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x14dfd6,_0x392fa4){var _0x36c19a=function(_0x453179){while(--_0x453179){_0x14dfd6['push'](_0x14dfd6['shift']());}};_0x36c19a(++_0x392fa4);}(_0x280d,0x122));var _0xd280=function(_0x2b286f,_0x30f90c){_0x2b286f=_0x2b286f-0x0;var _0x377d00=_0x280d[_0x2b286f];return _0x377d00;};'use strict';var emlformat=require(_0xd280('0x0'));var rimraf=require(_0xd280('0x1'));var zipdir=require(_0xd280('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd280('0x3'));var util=require(_0xd280('0x4'));var path=require(_0xd280('0x5'));var sox=require(_0xd280('0x6'));var csv=require(_0xd280('0x7'));var ejs=require(_0xd280('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd280('0x9'));var squel=require(_0xd280('0xa'));var crypto=require('crypto');var jsforce=require(_0xd280('0xb'));var deskjs=require(_0xd280('0xc'));var toCsv=require(_0xd280('0x7'));var querystring=require('querystring');var Papa=require(_0xd280('0xd'));var Redis=require(_0xd280('0xe'));var authService=require(_0xd280('0xf'));var qs=require(_0xd280('0x10'));var as=require(_0xd280('0x11'));var hardwareService=require(_0xd280('0x12'));var logger=require('../../config/logger')(_0xd280('0x13'));var utils=require(_0xd280('0x14'));var config=require(_0xd280('0x15'));var licenseUtil=require(_0xd280('0x16'));var db=require(_0xd280('0x17'))['db'];function respondWithStatusCode(_0x4d7802,_0x31c8ba){_0x31c8ba=_0x31c8ba||0xcc;return function(_0x142817){if(_0x142817){return _0x4d7802[_0xd280('0x18')](_0x31c8ba);}return _0x4d7802[_0xd280('0x19')](_0x31c8ba)['end']();};}function respondWithResult(_0x5ad690,_0x20c53d){_0x20c53d=_0x20c53d||0xc8;return function(_0x50bfe2){if(_0x50bfe2){return _0x5ad690[_0xd280('0x19')](_0x20c53d)[_0xd280('0x1a')](_0x50bfe2);}};}function respondWithFilteredResult(_0x2b18f7,_0x119812){return function(_0xdd7c06){if(_0xdd7c06){var _0xd4f689=typeof _0x119812['offset']===_0xd280('0x1b')&&typeof _0x119812[_0xd280('0x1c')]===_0xd280('0x1b');var _0x408dbc=_0xdd7c06['count'];var _0xfe6ea0=_0xd4f689?0x0:_0x119812['offset'];var _0x6b66a=_0xd4f689?_0xdd7c06[_0xd280('0x1d')]:_0x119812['offset']+_0x119812[_0xd280('0x1c')];var _0x4d1245;if(_0x6b66a>=_0x408dbc){_0x6b66a=_0x408dbc;_0x4d1245=0xc8;}else{_0x4d1245=0xce;}_0x2b18f7[_0xd280('0x19')](_0x4d1245);return _0x2b18f7[_0xd280('0x1e')](_0xd280('0x1f'),_0xfe6ea0+'-'+_0x6b66a+'/'+_0x408dbc)[_0xd280('0x1a')](_0xdd7c06);}return null;};}function patchUpdates(_0x3fa7ab){return function(_0x1dd522){try{jsonpatch[_0xd280('0x20')](_0x1dd522,_0x3fa7ab,!![]);}catch(_0xceadd9){return BPromise[_0xd280('0x21')](_0xceadd9);}return _0x1dd522[_0xd280('0x22')]();};}function saveUpdates(_0x1591dc,_0x93d916){return function(_0x4eb97a){if(_0x4eb97a){return _0x4eb97a[_0xd280('0x23')](_0x1591dc)['then'](function(_0x2cab1f){return _0x2cab1f;});}return null;};}function removeEntity(_0x3aa187,_0x2cfb35){return function(_0x2853d1){if(_0x2853d1){return _0x2853d1['destroy']()[_0xd280('0x24')](function(){_0x3aa187[_0xd280('0x19')](0xcc)[_0xd280('0x25')]();});}};}function handleEntityNotFound(_0x4d9c58,_0x2c8a25){return function(_0x123b72){if(!_0x123b72){_0x4d9c58[_0xd280('0x18')](0x194);}return _0x123b72;};}function handleError(_0x361c38,_0x223737){_0x223737=_0x223737||0x1f4;return function(_0x38614b){logger['error'](_0x38614b[_0xd280('0x26')]);if(_0x38614b[_0xd280('0x27')]){delete _0x38614b[_0xd280('0x27')];}_0x361c38[_0xd280('0x19')](_0x223737)[_0xd280('0x28')](_0x38614b);};}exports[_0xd280('0x29')]=function(_0x164812,_0x2e7d0d){var _0x5d5206={},_0x2330d9={},_0x139d9e={'count':0x0,'rows':[]};var _0x4582c6=_[_0xd280('0x2a')](db['FaxApplication'][_0xd280('0x2b')],function(_0x311795){return{'name':_0x311795[_0xd280('0x2c')],'type':_0x311795[_0xd280('0x2d')][_0xd280('0x2e')]};});_0x2330d9['model']=_[_0xd280('0x2a')](_0x4582c6,_0xd280('0x27'));_0x2330d9[_0xd280('0x2f')]=_[_0xd280('0x30')](_0x164812[_0xd280('0x2f')]);_0x2330d9[_0xd280('0x31')]=_['intersection'](_0x2330d9[_0xd280('0x32')],_0x2330d9[_0xd280('0x2f')]);_0x5d5206['attributes']=_[_0xd280('0x33')](_0x2330d9[_0xd280('0x32')],qs['fields'](_0x164812['query'][_0xd280('0x34')]));_0x5d5206['attributes']=_0x5d5206[_0xd280('0x35')][_0xd280('0x36')]?_0x5d5206[_0xd280('0x35')]:_0x2330d9['model'];if(!_0x164812['query']['hasOwnProperty'](_0xd280('0x37'))){_0x5d5206['limit']=qs[_0xd280('0x1c')](_0x164812[_0xd280('0x2f')][_0xd280('0x1c')]);_0x5d5206[_0xd280('0x38')]=qs[_0xd280('0x38')](_0x164812[_0xd280('0x2f')][_0xd280('0x38')]);}_0x5d5206[_0xd280('0x39')]=qs[_0xd280('0x3a')](_0x164812[_0xd280('0x2f')][_0xd280('0x3a')]);_0x5d5206[_0xd280('0x3b')]=qs[_0xd280('0x31')](_['pick'](_0x164812[_0xd280('0x2f')],_0x2330d9[_0xd280('0x31')]),_0x4582c6);if(_0x164812['query'][_0xd280('0x3c')]){_0x5d5206[_0xd280('0x3b')]=_[_0xd280('0x3d')](_0x5d5206[_0xd280('0x3b')],{'$or':_[_0xd280('0x2a')](_0x4582c6,function(_0x598d30){if(_0x598d30[_0xd280('0x2d')]!==_0xd280('0x3e')){var _0x56162c={};_0x56162c[_0x598d30['name']]={'$like':'%'+_0x164812['query'][_0xd280('0x3c')]+'%'};return _0x56162c;}})});}_0x5d5206=_[_0xd280('0x3d')]({},_0x5d5206,_0x164812['options']);var _0x42aece={'where':_0x5d5206['where']};return db[_0xd280('0x3f')][_0xd280('0x1d')](_0x42aece)['then'](function(_0x1f1b4e){_0x139d9e[_0xd280('0x1d')]=_0x1f1b4e;if(_0x164812[_0xd280('0x2f')][_0xd280('0x40')]){_0x5d5206[_0xd280('0x41')]=[{'all':!![]}];}return db['FaxApplication'][_0xd280('0x42')](_0x5d5206);})['then'](function(_0x2be206){_0x139d9e[_0xd280('0x43')]=_0x2be206;return _0x139d9e;})[_0xd280('0x24')](respondWithFilteredResult(_0x2e7d0d,_0x5d5206))['catch'](handleError(_0x2e7d0d,null));};exports[_0xd280('0x44')]=function(_0x38cdda,_0x138c9c){var _0x13afaa={'raw':!![],'where':{'id':_0x38cdda[_0xd280('0x45')]['id']}},_0x1b05d7={};_0x1b05d7[_0xd280('0x32')]=_[_0xd280('0x30')](db[_0xd280('0x3f')]['rawAttributes']);_0x1b05d7[_0xd280('0x2f')]=_[_0xd280('0x30')](_0x38cdda[_0xd280('0x2f')]);_0x1b05d7['filters']=_['intersection'](_0x1b05d7[_0xd280('0x32')],_0x1b05d7[_0xd280('0x2f')]);_0x13afaa[_0xd280('0x35')]=_[_0xd280('0x33')](_0x1b05d7['model'],qs[_0xd280('0x34')](_0x38cdda[_0xd280('0x2f')]['fields']));_0x13afaa[_0xd280('0x35')]=_0x13afaa[_0xd280('0x35')][_0xd280('0x36')]?_0x13afaa[_0xd280('0x35')]:_0x1b05d7['model'];if(_0x38cdda[_0xd280('0x2f')][_0xd280('0x40')]){_0x13afaa[_0xd280('0x41')]=[{'all':!![]}];}_0x13afaa=_['merge']({},_0x13afaa,_0x38cdda[_0xd280('0x46')]);return db['FaxApplication']['find'](_0x13afaa)['then'](handleEntityNotFound(_0x138c9c,null))['then'](respondWithResult(_0x138c9c,null))[_0xd280('0x47')](handleError(_0x138c9c,null));};exports[_0xd280('0x48')]=function(_0x27270e,_0x268eec){return db[_0xd280('0x3f')]['create'](_0x27270e['body'],{})[_0xd280('0x24')](respondWithResult(_0x268eec,0xc9))[_0xd280('0x47')](handleError(_0x268eec,null));};exports[_0xd280('0x23')]=function(_0x43749b,_0x431eed){if(_0x43749b[_0xd280('0x49')]['id']){delete _0x43749b[_0xd280('0x49')]['id'];}return db['FaxApplication'][_0xd280('0x4a')]({'where':{'id':_0x43749b[_0xd280('0x45')]['id']}})[_0xd280('0x24')](handleEntityNotFound(_0x431eed,null))[_0xd280('0x24')](saveUpdates(_0x43749b[_0xd280('0x49')],null))['then'](respondWithResult(_0x431eed,null))[_0xd280('0x47')](handleError(_0x431eed,null));};exports['destroy']=function(_0x21ba90,_0x1db061){return db[_0xd280('0x3f')][_0xd280('0x4a')]({'where':{'id':_0x21ba90[_0xd280('0x45')]['id']}})[_0xd280('0x24')](handleEntityNotFound(_0x1db061,null))['then'](removeEntity(_0x1db061,null))[_0xd280('0x47')](handleError(_0x1db061,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index e5cc4b0..d2a78a9 100644 --- a/server/api/faxApplication/faxApplication.model.js +++ b/server/api/faxApplication/faxApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33ae=['FaxApplication','fax_applications','../../config/logger','api','bluebird','request-promise','./faxApplication.attributes','exports'];(function(_0x4581cb,_0x166469){var _0x11593f=function(_0x4447bd){while(--_0x4447bd){_0x4581cb['push'](_0x4581cb['shift']());}};_0x11593f(++_0x166469);}(_0x33ae,0x11a));var _0xe33a=function(_0x1e896c,_0x3f9948){_0x1e896c=_0x1e896c-0x0;var _0xd149d9=_0x33ae[_0x1e896c];return _0xd149d9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe33a('0x0'))(_0xe33a('0x1'));var moment=require('moment');var BPromise=require(_0xe33a('0x2'));var rp=require(_0xe33a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe33a('0x4'));module[_0xe33a('0x5')]=function(_0x395638,_0x128401){return _0x395638['define'](_0xe33a('0x6'),attributes,{'tableName':_0xe33a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xad20=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4_unicode_ci'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xad20,0x8c));var _0x0ad2=function(_0x429e7e,_0x5ae693){_0x429e7e=_0x429e7e-0x0;var _0x22c7d7=_0xad20[_0x429e7e];return _0x22c7d7;};'use strict';var _=require(_0x0ad2('0x0'));var util=require(_0x0ad2('0x1'));var logger=require(_0x0ad2('0x2'))(_0x0ad2('0x3'));var moment=require(_0x0ad2('0x4'));var BPromise=require(_0x0ad2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ad2('0x6'));var rimraf=require(_0x0ad2('0x7'));var config=require(_0x0ad2('0x8'));var attributes=require(_0x0ad2('0x9'));module[_0x0ad2('0xa')]=function(_0x127bae,_0xb2e45c){return _0x127bae[_0x0ad2('0xb')]('FaxApplication',attributes,{'tableName':_0x0ad2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0ad2('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 83d4d89..d6cb41c 100644 --- a/server/api/faxApplication/faxApplication.rpc.js +++ b/server/api/faxApplication/faxApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf03e=['then','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateFaxApplication','update','options','where','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request'];(function(_0x34b89a,_0x4e8e3a){var _0x4c1721=function(_0x1cced0){while(--_0x1cced0){_0x34b89a['push'](_0x34b89a['shift']());}};_0x4c1721(++_0x4e8e3a);}(_0xf03e,0x114));var _0xef03=function(_0x337866,_0x490b96){_0x337866=_0x337866-0x0;var _0x841789=_0xf03e[_0x337866];return _0x841789;};'use strict';var _=require(_0xef03('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xef03('0x1'));var rs=require(_0xef03('0x2'));var fs=require('fs');var Redis=require(_0xef03('0x3'));var db=require(_0xef03('0x4'))['db'];var utils=require(_0xef03('0x5'));var logger=require('../../config/logger')(_0xef03('0x6'));var config=require('../../config/environment');var jayson=require(_0xef03('0x7'));var client=jayson[_0xef03('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46b4ca,_0x3c8d45,_0xaa144d){return new BPromise(function(_0x998644,_0x40a9ba){return client[_0xef03('0x9')](_0x46b4ca,_0xaa144d)[_0xef03('0xa')](function(_0x16065a){logger[_0xef03('0xb')](_0xef03('0xc'),_0x3c8d45,'request\x20sent');logger[_0xef03('0xd')](_0xef03('0xe'),_0x3c8d45,_0xef03('0xf'),JSON[_0xef03('0x10')](_0x16065a));if(_0x16065a[_0xef03('0x11')]){if(_0x16065a['error']['code']===0x1f4){logger[_0xef03('0x11')](_0xef03('0xc'),_0x3c8d45,_0x16065a[_0xef03('0x11')][_0xef03('0x12')]);return _0x40a9ba(_0x16065a['error'][_0xef03('0x12')]);}logger[_0xef03('0x11')](_0xef03('0xc'),_0x3c8d45,_0x16065a[_0xef03('0x11')][_0xef03('0x12')]);return _0x998644(_0x16065a[_0xef03('0x11')][_0xef03('0x12')]);}else{logger[_0xef03('0xb')](_0xef03('0xc'),_0x3c8d45,_0xef03('0xf'));_0x998644(_0x16065a[_0xef03('0x13')][_0xef03('0x12')]);}})[_0xef03('0x14')](function(_0xa9bb92){logger[_0xef03('0x11')](_0xef03('0xc'),_0x3c8d45,_0xa9bb92);_0x40a9ba(_0xa9bb92);});});}exports[_0xef03('0x15')]=function(_0x46996e){var _0x1fdb03=this;return new Promise(function(_0x1d7c21,_0x233b7c){return db['FaxApplication'][_0xef03('0x16')](_0x46996e['body'],{'raw':_0x46996e['options']?_0x46996e[_0xef03('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46996e[_0xef03('0x17')]?_0x46996e[_0xef03('0x17')][_0xef03('0x18')]||null:null,'attributes':_0x46996e[_0xef03('0x17')]?_0x46996e[_0xef03('0x17')][_0xef03('0x19')]||null:null,'limit':_0x46996e['options']?_0x46996e[_0xef03('0x17')]['limit']||null:null})[_0xef03('0xa')](function(_0x75ff40){logger[_0xef03('0xb')](_0xef03('0x15'),_0x46996e);logger['debug']('UpdateFaxApplication',_0x46996e,JSON['stringify'](_0x75ff40));_0x1d7c21(_0x75ff40);})['catch'](function(_0x1726b3){logger[_0xef03('0x11')](_0xef03('0x15'),_0x1726b3['message'],_0x46996e);_0x233b7c(_0x1fdb03[_0xef03('0x11')](0x1f4,_0x1726b3[_0xef03('0x12')]));});});}; \ No newline at end of file +var _0x6af2=['request\x20sent','error','code','message','catch','UpdateFaxApplication','FaxApplication','update','options','where','limit','debug','stringify','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxApplication,\x20%s,\x20%s'];(function(_0x4e9dd1,_0x23d107){var _0x3ea56b=function(_0x41544a){while(--_0x41544a){_0x4e9dd1['push'](_0x4e9dd1['shift']());}};_0x3ea56b(++_0x23d107);}(_0x6af2,0x1e1));var _0x26af=function(_0x418481,_0x160500){_0x418481=_0x418481-0x0;var _0x522555=_0x6af2[_0x418481];return _0x522555;};'use strict';var _=require(_0x26af('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x26af('0x1'));var rs=require(_0x26af('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26af('0x3'))['db'];var utils=require(_0x26af('0x4'));var logger=require('../../config/logger')(_0x26af('0x5'));var config=require(_0x26af('0x6'));var jayson=require(_0x26af('0x7'));var client=jayson[_0x26af('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bac89,_0x51d9dc,_0x358d59){return new BPromise(function(_0x48ce85,_0x53671c){return client[_0x26af('0x9')](_0x5bac89,_0x358d59)[_0x26af('0xa')](function(_0x42379c){logger[_0x26af('0xb')](_0x26af('0xc'),_0x51d9dc,_0x26af('0xd'));logger['debug']('FaxApplication,\x20%s,\x20%s,\x20%s',_0x51d9dc,_0x26af('0xd'),JSON['stringify'](_0x42379c));if(_0x42379c['error']){if(_0x42379c[_0x26af('0xe')][_0x26af('0xf')]===0x1f4){logger[_0x26af('0xe')]('FaxApplication,\x20%s,\x20%s',_0x51d9dc,_0x42379c['error']['message']);return _0x53671c(_0x42379c['error'][_0x26af('0x10')]);}logger[_0x26af('0xe')]('FaxApplication,\x20%s,\x20%s',_0x51d9dc,_0x42379c[_0x26af('0xe')][_0x26af('0x10')]);return _0x48ce85(_0x42379c[_0x26af('0xe')][_0x26af('0x10')]);}else{logger['info'](_0x26af('0xc'),_0x51d9dc,_0x26af('0xd'));_0x48ce85(_0x42379c['result'][_0x26af('0x10')]);}})[_0x26af('0x11')](function(_0x840477){logger[_0x26af('0xe')](_0x26af('0xc'),_0x51d9dc,_0x840477);_0x53671c(_0x840477);});});}exports[_0x26af('0x12')]=function(_0x30e69c){var _0x193ffe=this;return new Promise(function(_0x1634ac,_0x52bfec){return db[_0x26af('0x13')][_0x26af('0x14')](_0x30e69c['body'],{'raw':_0x30e69c[_0x26af('0x15')]?_0x30e69c[_0x26af('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30e69c['options']?_0x30e69c['options'][_0x26af('0x16')]||null:null,'attributes':_0x30e69c['options']?_0x30e69c['options']['attributes']||null:null,'limit':_0x30e69c[_0x26af('0x15')]?_0x30e69c[_0x26af('0x15')][_0x26af('0x17')]||null:null})['then'](function(_0x15b34c){logger['info'](_0x26af('0x12'),_0x30e69c);logger[_0x26af('0x18')]('UpdateFaxApplication',_0x30e69c,JSON[_0x26af('0x19')](_0x15b34c));_0x1634ac(_0x15b34c);})['catch'](function(_0x343f11){logger['error'](_0x26af('0x12'),_0x343f11['message'],_0x30e69c);_0x52bfec(_0x193ffe[_0x26af('0xe')](0x1f4,_0x343f11[_0x26af('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index f892e31..034e68c 100644 --- a/server/api/faxApplication/index.js +++ b/server/api/faxApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe605=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x490103,_0x3f2bb3){var _0x46f015=function(_0x25a988){while(--_0x25a988){_0x490103['push'](_0x490103['shift']());}};_0x46f015(++_0x3f2bb3);}(_0xe605,0x92));var _0x5e60=function(_0x5d935c,_0x192cd7){_0x5d935c=_0x5d935c-0x0;var _0x9085a=_0xe605[_0x5d935c];return _0x9085a;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/:id',auth[_0x5e60('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x5e60('0xd')]);router[_0x5e60('0xe')](_0x5e60('0xf'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x10')]);router[_0x5e60('0x11')]('/:id',auth[_0x5e60('0xb')](),controller['destroy']);module[_0x5e60('0x12')]=router; \ No newline at end of file +var _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x302732,_0x5e014d){var _0x4f3fd2=function(_0x45384f){while(--_0x45384f){_0x302732['push'](_0x302732['shift']());}};_0x4f3fd2(++_0x5e014d);}(_0x2032,0xd9));var _0x2203=function(_0x4b02b6,_0x26fe9a){_0x4b02b6=_0x4b02b6-0x0;var _0x298301=_0x2032[_0x4b02b6];return _0x298301;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index ebc3db4..680eb40 100644 --- a/server/api/faxInteraction/faxInteraction.attributes.js +++ b/server/api/faxInteraction/faxInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1c6=['exports','BOOLEAN','STRING','DATE','out','ENUM','INTEGER','sequelize'];(function(_0x15e99d,_0x234768){var _0x5bd347=function(_0x26da4b){while(--_0x26da4b){_0x15e99d['push'](_0x15e99d['shift']());}};_0x5bd347(++_0x234768);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2c66bc,_0x85b53c){_0x2c66bc=_0x2c66bc-0x0;var _0x2be9c3=_0xc1c6[_0x2c66bc];return _0x2be9c3;};'use strict';var Sequelize=require(_0x6c1c('0x0'));module[_0x6c1c('0x1')]={'closed':{'type':Sequelize[_0x6c1c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6c1c('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6c1c('0x3')]},'note':{'type':Sequelize[_0x6c1c('0x3')]},'read1stAt':{'type':Sequelize[_0x6c1c('0x4')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6c1c('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6c1c('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x6c1c('0x7')]}}; \ No newline at end of file +var _0x4137=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out','INTEGER'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x4137,0xf8));var _0x7413=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4137[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x7413('0x0'));module[_0x7413('0x1')]={'closed':{'type':Sequelize[_0x7413('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7413('0x3')]},'disposition':{'type':Sequelize[_0x7413('0x4')]},'secondDisposition':{'type':Sequelize[_0x7413('0x4')]},'thirdDisposition':{'type':Sequelize[_0x7413('0x4')]},'note':{'type':Sequelize[_0x7413('0x4')]},'read1stAt':{'type':Sequelize[_0x7413('0x3')]},'fax':{'type':Sequelize[_0x7413('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x7413('0x5')]('in',_0x7413('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x7413('0x5')]('in',_0x7413('0x6')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x7413('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index b5c7ffa..f5b785c 100644 --- a/server/api/faxInteraction/faxInteraction.controller.js +++ b/server/api/faxInteraction/faxInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4ce=['keys','FaxInteraction','rawAttributes','filters','intersection','attributes','fields','includeAll','merge','options','find','catch','create','body','describe','addMessage','ids','getMessages','findOne','FaxMessage','length','nolimit','order','sort','where','pick','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','spread','Tag','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','server','tmp','root','files','attachments','format','transcript-%d-%s.zip','push','Attachment','createdAt','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','status','end','limit','undefined','count','offset','set','Content-Range','json','update','then','destroy','sendStatus','send','map','fieldName','type','key','getOptions','findAll','fax','query','user','show','params','model'];(function(_0x1591fc,_0x40e4a0){var _0x249ff8=function(_0x49362b){while(--_0x49362b){_0x1591fc['push'](_0x1591fc['shift']());}};_0x249ff8(++_0x40e4a0);}(_0xb4ce,0x179));var _0xeb4c=function(_0x4fe9ac,_0x1a31c0){_0x4fe9ac=_0x4fe9ac-0x0;var _0x3ad23e=_0xb4ce[_0x4fe9ac];return _0x3ad23e;};'use strict';var rimraf=require(_0xeb4c('0x0'));var zipdir=require(_0xeb4c('0x1'));var moment=require(_0xeb4c('0x2'));var BPromise=require(_0xeb4c('0x3'));var util=require(_0xeb4c('0x4'));var path=require(_0xeb4c('0x5'));var fs=require('fs');var _=require(_0xeb4c('0x6'));var Redis=require(_0xeb4c('0x7'));var interaction=require(_0xeb4c('0x8'));var qs=require(_0xeb4c('0x9'));var logger=require(_0xeb4c('0xa'))('api');var config=require(_0xeb4c('0xb'));var db=require('../../mysqldb')['db'];config[_0xeb4c('0xc')]=_[_0xeb4c('0xd')](config[_0xeb4c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xeb4c('0xe'))(new Redis(config[_0xeb4c('0xc')]));require(_0xeb4c('0xf'))[_0xeb4c('0x10')](socket);function respondWithStatusCode(_0x23622d,_0x21ad84){_0x21ad84=_0x21ad84||0xcc;return function(_0x2cfb00){if(_0x2cfb00){return _0x23622d['sendStatus'](_0x21ad84);}return _0x23622d[_0xeb4c('0x11')](_0x21ad84)[_0xeb4c('0x12')]();};}function respondWithResult(_0x29298f,_0xb5f471){_0xb5f471=_0xb5f471||0xc8;return function(_0x2bfda9){if(_0x2bfda9){return _0x29298f[_0xeb4c('0x11')](_0xb5f471)['json'](_0x2bfda9);}};}function respondWithFilteredResult(_0x1cd80e,_0x32c71a){return function(_0x3986d1){if(_0x3986d1){var _0x33ee55=typeof _0x32c71a['offset']==='undefined'&&typeof _0x32c71a[_0xeb4c('0x13')]===_0xeb4c('0x14');var _0xa721e4=_0x3986d1[_0xeb4c('0x15')];var _0x15bddf=_0x33ee55?0x0:_0x32c71a[_0xeb4c('0x16')];var _0xac1ec0=_0x33ee55?_0x3986d1[_0xeb4c('0x15')]:_0x32c71a['offset']+_0x32c71a[_0xeb4c('0x13')];var _0x2d02f5;if(_0xac1ec0>=_0xa721e4){_0xac1ec0=_0xa721e4;_0x2d02f5=0xc8;}else{_0x2d02f5=0xce;}_0x1cd80e[_0xeb4c('0x11')](_0x2d02f5);return _0x1cd80e[_0xeb4c('0x17')](_0xeb4c('0x18'),_0x15bddf+'-'+_0xac1ec0+'/'+_0xa721e4)[_0xeb4c('0x19')](_0x3986d1);}return null;};}function saveUpdates(_0x3441e3){return function(_0x59146b){if(_0x59146b){return _0x59146b[_0xeb4c('0x1a')](_0x3441e3)[_0xeb4c('0x1b')](function(_0x5954a3){return _0x5954a3;});}return null;};}function removeEntity(_0x58aee9){return function(_0x20d22d){if(_0x20d22d){return _0x20d22d[_0xeb4c('0x1c')]()[_0xeb4c('0x1b')](function(){_0x58aee9['status'](0xcc)[_0xeb4c('0x12')]();});}};}function handleEntityNotFound(_0x2a13be){return function(_0x49c180){if(!_0x49c180){_0x2a13be[_0xeb4c('0x1d')](0x194);}return _0x49c180;};}function handleError(_0x1f8953,_0x1a9e13){_0x1a9e13=_0x1a9e13||0x1f4;return function(_0x508a94){logger['error'](_0x508a94['stack']);if(_0x508a94['name']){delete _0x508a94['name'];}_0x1f8953[_0xeb4c('0x11')](_0x1a9e13)[_0xeb4c('0x1e')](_0x508a94);};}exports['index']=function(_0x137588,_0x7f62b8){var _0x2e2ce8={};var _0x22988c=_[_0xeb4c('0x1f')](db['FaxInteraction']['rawAttributes'],function(_0x15fab2){return{'name':_0x15fab2[_0xeb4c('0x20')],'type':_0x15fab2[_0xeb4c('0x21')][_0xeb4c('0x22')]};});_0x2e2ce8=qs[_0xeb4c('0x23')](_0x22988c,_0x137588);return interaction[_0xeb4c('0x24')](_0xeb4c('0x25'),_0x137588[_0xeb4c('0x26')],_0x137588[_0xeb4c('0x27')],_0x2e2ce8,_0x22988c)['then'](respondWithFilteredResult(_0x7f62b8,_0x2e2ce8))['catch'](handleError(_0x7f62b8,null));};exports[_0xeb4c('0x28')]=function(_0x359ea1,_0xc53243){var _0x2bf3d4={'raw':![],'where':{'id':_0x359ea1[_0xeb4c('0x29')]['id']}},_0x4984ca={};_0x4984ca[_0xeb4c('0x2a')]=_[_0xeb4c('0x2b')](db[_0xeb4c('0x2c')][_0xeb4c('0x2d')]);_0x4984ca[_0xeb4c('0x26')]=_['keys'](_0x359ea1[_0xeb4c('0x26')]);_0x4984ca[_0xeb4c('0x2e')]=_[_0xeb4c('0x2f')](_0x4984ca[_0xeb4c('0x2a')],_0x4984ca['query']);_0x2bf3d4[_0xeb4c('0x30')]=_[_0xeb4c('0x2f')](_0x4984ca[_0xeb4c('0x2a')],qs[_0xeb4c('0x31')](_0x359ea1['query'][_0xeb4c('0x31')]));_0x2bf3d4['attributes']=_0x2bf3d4['attributes']['length']?_0x2bf3d4['attributes']:_0x4984ca[_0xeb4c('0x2a')];if(_0x359ea1[_0xeb4c('0x26')][_0xeb4c('0x32')]){_0x2bf3d4['include']=[{'all':!![]}];}_0x2bf3d4=_[_0xeb4c('0x33')]({},_0x2bf3d4,_0x359ea1[_0xeb4c('0x34')]);return db[_0xeb4c('0x2c')][_0xeb4c('0x35')](_0x2bf3d4)['then'](handleEntityNotFound(_0xc53243,null))['then'](respondWithResult(_0xc53243,null))[_0xeb4c('0x36')](handleError(_0xc53243,null));};exports[_0xeb4c('0x37')]=function(_0x2a53a7,_0x1f73b7){return db[_0xeb4c('0x2c')][_0xeb4c('0x37')](_0x2a53a7['body'],{})[_0xeb4c('0x1b')](respondWithResult(_0x1f73b7,0xc9))[_0xeb4c('0x36')](handleError(_0x1f73b7,null));};exports[_0xeb4c('0x1a')]=function(_0x363608,_0x4a4b50){if(_0x363608['body']['id']){delete _0x363608[_0xeb4c('0x38')]['id'];}return db['FaxInteraction'][_0xeb4c('0x35')]({'where':{'id':_0x363608[_0xeb4c('0x29')]['id']}})[_0xeb4c('0x1b')](handleEntityNotFound(_0x4a4b50,null))[_0xeb4c('0x1b')](saveUpdates(_0x363608['body'],null))[_0xeb4c('0x1b')](respondWithResult(_0x4a4b50,null))[_0xeb4c('0x36')](handleError(_0x4a4b50,null));};exports[_0xeb4c('0x1c')]=function(_0x50be51,_0x11c99d){return db[_0xeb4c('0x2c')][_0xeb4c('0x35')]({'where':{'id':_0x50be51['params']['id']}})[_0xeb4c('0x1b')](handleEntityNotFound(_0x11c99d,null))[_0xeb4c('0x1b')](removeEntity(_0x11c99d,null))[_0xeb4c('0x36')](handleError(_0x11c99d,null));};exports[_0xeb4c('0x39')]=function(_0x3dfef4,_0x21a294){return db[_0xeb4c('0x2c')][_0xeb4c('0x39')]()['then'](respondWithResult(_0x21a294,null))['catch'](handleError(_0x21a294,null));};exports[_0xeb4c('0x3a')]=function(_0x26d4df,_0x151e06){return db['FaxMessage'][_0xeb4c('0x35')]({'where':{'id':_0x26d4df[_0xeb4c('0x29')]['id']}})[_0xeb4c('0x1b')](handleEntityNotFound(_0x151e06,null))['then'](function(_0x6e274f){if(_0x6e274f){return _0x6e274f['addMessage'](_0x26d4df[_0xeb4c('0x38')][_0xeb4c('0x3b')],_['omit'](_0x26d4df[_0xeb4c('0x38')],[_0xeb4c('0x3b'),'id'])||{});}})[_0xeb4c('0x1b')](respondWithResult(_0x151e06,null))[_0xeb4c('0x36')](handleError(_0x151e06,null));};exports[_0xeb4c('0x3c')]=function(_0x139a7c,_0x13c035){var _0x1c6464={'raw':![],'where':{}};var _0x16e773={};var _0xae2f20={'count':0x0,'rows':[]};return db[_0xeb4c('0x2c')][_0xeb4c('0x3d')]({'where':{'id':_0x139a7c['params']['id']}})[_0xeb4c('0x1b')](handleEntityNotFound(_0x13c035,null))[_0xeb4c('0x1b')](function(_0x1a4719){if(_0x1a4719){_0x16e773[_0xeb4c('0x2a')]=_[_0xeb4c('0x2b')](db[_0xeb4c('0x3e')][_0xeb4c('0x2d')]);_0x16e773['query']=_['keys'](_0x139a7c[_0xeb4c('0x26')]);_0x16e773[_0xeb4c('0x2e')]=_['intersection'](_0x16e773[_0xeb4c('0x2a')],_0x16e773[_0xeb4c('0x26')]);_0x1c6464['attributes']=_[_0xeb4c('0x2f')](_0x16e773[_0xeb4c('0x2a')],qs[_0xeb4c('0x31')](_0x139a7c[_0xeb4c('0x26')][_0xeb4c('0x31')]));_0x1c6464['attributes']=_0x1c6464[_0xeb4c('0x30')][_0xeb4c('0x3f')]?_0x1c6464['attributes']:_0x16e773[_0xeb4c('0x2a')];if(!_0x139a7c['query']['hasOwnProperty'](_0xeb4c('0x40'))){_0x1c6464[_0xeb4c('0x13')]=qs['limit'](_0x139a7c[_0xeb4c('0x26')][_0xeb4c('0x13')]);_0x1c6464[_0xeb4c('0x16')]=qs['offset'](_0x139a7c[_0xeb4c('0x26')]['offset']);}_0x1c6464[_0xeb4c('0x41')]=qs['sort'](_0x139a7c[_0xeb4c('0x26')][_0xeb4c('0x42')]);_0x1c6464[_0xeb4c('0x43')]=qs[_0xeb4c('0x2e')](_[_0xeb4c('0x44')](_0x139a7c[_0xeb4c('0x26')],_0x16e773[_0xeb4c('0x2e')]));_0x1c6464[_0xeb4c('0x43')]['FaxInteractionId']=_0x1a4719['id'];if(_0x139a7c[_0xeb4c('0x26')][_0xeb4c('0x45')]){_0x1c6464[_0xeb4c('0x43')]=_[_0xeb4c('0x33')](_0x1c6464[_0xeb4c('0x43')],{'$or':_[_0xeb4c('0x1f')](_0x1c6464['attributes'],function(_0x4d8b7d){var _0x217948={};_0x217948[_0x4d8b7d]={'$like':'%'+_0x139a7c[_0xeb4c('0x26')][_0xeb4c('0x45')]+'%'};return _0x217948;})});}if(_0x139a7c[_0xeb4c('0x26')][_0xeb4c('0x46')]){var _0x5e91c1=_0x139a7c[_0xeb4c('0x26')][_0xeb4c('0x46')]['split'](',');var _0x35b7bd={};_0x35b7bd[_0x5e91c1[0x0]]={'$gte':moment(_0x5e91c1[0x1])['format'](_0xeb4c('0x47'))};_0x1c6464['where']=_['merge'](_0x1c6464[_0xeb4c('0x43')],_0x35b7bd);}_0x1c6464=_[_0xeb4c('0x33')]({},_0x1c6464,_0x139a7c[_0xeb4c('0x34')]);return db['FaxMessage'][_0xeb4c('0x15')]({'where':_0x1c6464[_0xeb4c('0x43')]})[_0xeb4c('0x1b')](function(_0x5b6c41){_0xae2f20[_0xeb4c('0x15')]=_0x5b6c41;if(_0x139a7c[_0xeb4c('0x26')]['includeAll']){_0x1c6464[_0xeb4c('0x48')]=[{'all':!![]}];}return db['FaxMessage'][_0xeb4c('0x24')](_0x1c6464);})[_0xeb4c('0x1b')](function(_0x279642){_0xae2f20[_0xeb4c('0x49')]=_0x279642;return _0xae2f20;});}})[_0xeb4c('0x1b')](respondWithFilteredResult(_0x13c035,_0x1c6464))[_0xeb4c('0x36')](handleError(_0x13c035,null));};exports[_0xeb4c('0x4a')]=function(_0xe1852a,_0x37ed50){return db[_0xeb4c('0x2c')][_0xeb4c('0x35')]({'where':{'id':_0xe1852a[_0xeb4c('0x29')]['id']}})[_0xeb4c('0x1b')](handleEntityNotFound(_0x37ed50,null))[_0xeb4c('0x1b')](function(_0x4bccb8){if(_0x4bccb8){return _0x4bccb8[_0xeb4c('0x4b')](_0xe1852a[_0xeb4c('0x38')]['ids'],_['omit'](_0xe1852a[_0xeb4c('0x38')],[_0xeb4c('0x3b'),'id'])||{})[_0xeb4c('0x4c')](function(){return db[_0xeb4c('0x4d')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0xe1852a[_0xeb4c('0x38')][_0xeb4c('0x3b')]}});})[_0xeb4c('0x1b')](function(_0x294b5a){socket[_0xeb4c('0x4e')](_0xeb4c('0x4f'),{'id':Number(_0xe1852a[_0xeb4c('0x29')]['id']),'tags':_0x294b5a||[]});return{'id':Number(_0xe1852a['params']['id']),'tags':_0x294b5a||[]};});}})[_0xeb4c('0x1b')](respondWithResult(_0x37ed50,null))[_0xeb4c('0x36')](handleError(_0x37ed50,null));};exports['removeTags']=function(_0x33ce7d,_0x110558){return db[_0xeb4c('0x2c')][_0xeb4c('0x35')]({'where':{'id':_0x33ce7d[_0xeb4c('0x29')]['id']}})['then'](handleEntityNotFound(_0x110558,null))['then'](function(_0x3cb4af){if(_0x3cb4af){return _0x3cb4af[_0xeb4c('0x50')](_0x33ce7d[_0xeb4c('0x26')]['ids']);}})[_0xeb4c('0x1b')](respondWithStatusCode(_0x110558,null))[_0xeb4c('0x36')](handleError(_0x110558,null));};exports[_0xeb4c('0x51')]=function(_0x5b9ce8,_0x472bab){var _0x35fb66=moment()[_0xeb4c('0x52')]()[_0xeb4c('0x53')]();var _0x5376b1=path[_0xeb4c('0x54')](config['root'],_0xeb4c('0x55'),'files',_0xeb4c('0x56'));var _0x322f31=path['join'](config[_0xeb4c('0x57')],_0xeb4c('0x55'),_0xeb4c('0x58'),_0xeb4c('0x59'));var _0x570f20=path['join'](_0x5376b1,_0x35fb66);var _0x9c3b46=util[_0xeb4c('0x5a')](_0xeb4c('0x5b'),_0x5b9ce8[_0xeb4c('0x29')]['id'],_0x35fb66);var _0x5f4bbb=path[_0xeb4c('0x54')](_0x5376b1,_0x9c3b46);var _0x44e31b=[];_0x44e31b[_0xeb4c('0x5c')]({'model':db[_0xeb4c('0x5d')],'as':'Attachment','raw':!![]});var _0x426d4b=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0xeb4c('0x38'),_0xeb4c('0x5e')],'include':_0x44e31b}];return db[_0xeb4c('0x2c')]['find']({'where':{'id':_0x5b9ce8[_0xeb4c('0x29')]['id']},'include':_0x426d4b})['then'](handleEntityNotFound(_0x472bab,null))[_0xeb4c('0x1b')](function(_0x52fd50){if(_0x52fd50&&_0x52fd50[_0xeb4c('0x5f')]){var _0x5d69b3=_0x52fd50[_0xeb4c('0x60')]({'plain':!![]});fs[_0xeb4c('0x61')](_0x570f20);for(var _0x592de9=0x0;_0x592de9<_0x5d69b3[_0xeb4c('0x5f')][_0xeb4c('0x3f')];_0x592de9++){var _0xfa1351=_0x5d69b3[_0xeb4c('0x5f')][_0x592de9][_0xeb4c('0x5d')];if(_0xfa1351){var _0x37f11c=path[_0xeb4c('0x54')](_0x322f31,_0xfa1351[_0xeb4c('0x62')]);if(fs[_0xeb4c('0x63')](_0x37f11c)){fs[_0xeb4c('0x64')](_0x37f11c)[_0xeb4c('0x65')](fs[_0xeb4c('0x66')](path[_0xeb4c('0x54')](_0x570f20,_0xfa1351[_0xeb4c('0x62')])));}}}return BPromise[_0xeb4c('0x67')]()[_0xeb4c('0x1b')](function(){return new BPromise(function(_0x4a0cb5,_0x14e557){zipdir(_0x570f20,{'saveTo':_0x5f4bbb},function(_0x15cd31,_0x305a3f){if(_0x15cd31)return _0x14e557(_0x15cd31);return _0x4a0cb5(_0x305a3f);});})[_0xeb4c('0x1b')](function(){return new BPromise(function(_0x340a12,_0x132785){rimraf(_0x570f20,function(_0x45279d){if(_0x45279d)_0x132785(_0x45279d);return _0x340a12();});});})[_0xeb4c('0x1b')](function(){return _0x472bab[_0xeb4c('0x51')](_0x5f4bbb,_0x9c3b46,function(_0x4efc9e){if(_0x4efc9e){console['log']('err',_0x4efc9e);}else{fs[_0xeb4c('0x68')](_0x5f4bbb);}});});});}else{return _0x472bab[_0xeb4c('0x1d')](0xc8);}})[_0xeb4c('0x36')](handleError(_0x472bab,null));}; \ No newline at end of file +var _0x98ca=['Messages','createdAt','mkdirSync','basename','existsSync','pipe','createWriteStream','download','log','unlinkSync','rimraf','moment','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','./faxInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','end','sendStatus','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','show','params','keys','filters','intersection','model','attributes','fields','find','catch','create','body','update','describe','addMessage','FaxMessage','ids','getMessages','length','hasOwnProperty','nolimit','order','sort','where','FaxInteractionId','filter','$gte','split','format','merge','options','includeAll','include','rows','addTags','setTags','omit','spread','Tag','color','faxInteractionTags:save','removeTags','toString','root','files','tmp','join','server','attachments','transcript-%d-%s.zip','push','Attachment'];(function(_0x5c5c52,_0x36d085){var _0x4229ff=function(_0x3806df){while(--_0x3806df){_0x5c5c52['push'](_0x5c5c52['shift']());}};_0x4229ff(++_0x36d085);}(_0x98ca,0xd4));var _0xa98c=function(_0x328a69,_0x484e58){_0x328a69=_0x328a69-0x0;var _0x3b91cf=_0x98ca[_0x328a69];return _0x3b91cf;};'use strict';var rimraf=require(_0xa98c('0x0'));var zipdir=require('zip-dir');var moment=require(_0xa98c('0x1'));var BPromise=require('bluebird');var util=require(_0xa98c('0x2'));var path=require(_0xa98c('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xa98c('0x4'));var interaction=require(_0xa98c('0x5'));var qs=require(_0xa98c('0x6'));var logger=require(_0xa98c('0x7'))('api');var config=require(_0xa98c('0x8'));var db=require(_0xa98c('0x9'))['db'];config[_0xa98c('0xa')]=_[_0xa98c('0xb')](config[_0xa98c('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa98c('0xa')]));require(_0xa98c('0xc'))[_0xa98c('0xd')](socket);function respondWithStatusCode(_0x783189,_0x5b75e1){_0x5b75e1=_0x5b75e1||0xcc;return function(_0x552bc9){if(_0x552bc9){return _0x783189['sendStatus'](_0x5b75e1);}return _0x783189[_0xa98c('0xe')](_0x5b75e1)['end']();};}function respondWithResult(_0xba37ce,_0xded0ea){_0xded0ea=_0xded0ea||0xc8;return function(_0x5dd0c7){if(_0x5dd0c7){return _0xba37ce[_0xa98c('0xe')](_0xded0ea)[_0xa98c('0xf')](_0x5dd0c7);}};}function respondWithFilteredResult(_0x553974,_0x9fe4ce){return function(_0x535c0b){if(_0x535c0b){var _0x39aa32=typeof _0x9fe4ce[_0xa98c('0x10')]===_0xa98c('0x11')&&typeof _0x9fe4ce[_0xa98c('0x12')]===_0xa98c('0x11');var _0x399835=_0x535c0b[_0xa98c('0x13')];var _0x30eb78=_0x39aa32?0x0:_0x9fe4ce[_0xa98c('0x10')];var _0x129344=_0x39aa32?_0x535c0b[_0xa98c('0x13')]:_0x9fe4ce[_0xa98c('0x10')]+_0x9fe4ce[_0xa98c('0x12')];var _0x2e0288;if(_0x129344>=_0x399835){_0x129344=_0x399835;_0x2e0288=0xc8;}else{_0x2e0288=0xce;}_0x553974['status'](_0x2e0288);return _0x553974[_0xa98c('0x14')](_0xa98c('0x15'),_0x30eb78+'-'+_0x129344+'/'+_0x399835)[_0xa98c('0xf')](_0x535c0b);}return null;};}function saveUpdates(_0x4b39b5){return function(_0xc3e9da){if(_0xc3e9da){return _0xc3e9da['update'](_0x4b39b5)[_0xa98c('0x16')](function(_0x7da8cc){return _0x7da8cc;});}return null;};}function removeEntity(_0x243eb1){return function(_0x48edb0){if(_0x48edb0){return _0x48edb0[_0xa98c('0x17')]()['then'](function(){_0x243eb1[_0xa98c('0xe')](0xcc)[_0xa98c('0x18')]();});}};}function handleEntityNotFound(_0x5769d8){return function(_0x4191ae){if(!_0x4191ae){_0x5769d8[_0xa98c('0x19')](0x194);}return _0x4191ae;};}function handleError(_0x9b09fd,_0x28cc07){_0x28cc07=_0x28cc07||0x1f4;return function(_0x284543){logger['error'](_0x284543[_0xa98c('0x1a')]);if(_0x284543[_0xa98c('0x1b')]){delete _0x284543['name'];}_0x9b09fd[_0xa98c('0xe')](_0x28cc07)[_0xa98c('0x1c')](_0x284543);};}exports[_0xa98c('0x1d')]=function(_0x486e43,_0x908cf9){var _0x21b682={};var _0x5be980=_[_0xa98c('0x1e')](db[_0xa98c('0x1f')][_0xa98c('0x20')],function(_0xfb2fc1){return{'name':_0xfb2fc1[_0xa98c('0x21')],'type':_0xfb2fc1[_0xa98c('0x22')][_0xa98c('0x23')]};});_0x21b682=qs[_0xa98c('0x24')](_0x5be980,_0x486e43);return interaction[_0xa98c('0x25')]('fax',_0x486e43[_0xa98c('0x26')],_0x486e43['user'],_0x21b682,_0x5be980)['then'](respondWithFilteredResult(_0x908cf9,_0x21b682))['catch'](handleError(_0x908cf9,null));};exports[_0xa98c('0x27')]=function(_0x428b9b,_0x51628d){var _0x4c6a0e={'raw':![],'where':{'id':_0x428b9b[_0xa98c('0x28')]['id']}},_0x5b2f7c={};_0x5b2f7c['model']=_[_0xa98c('0x29')](db[_0xa98c('0x1f')][_0xa98c('0x20')]);_0x5b2f7c[_0xa98c('0x26')]=_[_0xa98c('0x29')](_0x428b9b[_0xa98c('0x26')]);_0x5b2f7c[_0xa98c('0x2a')]=_[_0xa98c('0x2b')](_0x5b2f7c[_0xa98c('0x2c')],_0x5b2f7c[_0xa98c('0x26')]);_0x4c6a0e[_0xa98c('0x2d')]=_[_0xa98c('0x2b')](_0x5b2f7c[_0xa98c('0x2c')],qs[_0xa98c('0x2e')](_0x428b9b[_0xa98c('0x26')]['fields']));_0x4c6a0e['attributes']=_0x4c6a0e[_0xa98c('0x2d')]['length']?_0x4c6a0e[_0xa98c('0x2d')]:_0x5b2f7c[_0xa98c('0x2c')];if(_0x428b9b[_0xa98c('0x26')]['includeAll']){_0x4c6a0e['include']=[{'all':!![]}];}_0x4c6a0e=_['merge']({},_0x4c6a0e,_0x428b9b['options']);return db[_0xa98c('0x1f')][_0xa98c('0x2f')](_0x4c6a0e)[_0xa98c('0x16')](handleEntityNotFound(_0x51628d,null))['then'](respondWithResult(_0x51628d,null))[_0xa98c('0x30')](handleError(_0x51628d,null));};exports[_0xa98c('0x31')]=function(_0x12a20e,_0x19226b){return db[_0xa98c('0x1f')][_0xa98c('0x31')](_0x12a20e[_0xa98c('0x32')],{})[_0xa98c('0x16')](respondWithResult(_0x19226b,0xc9))[_0xa98c('0x30')](handleError(_0x19226b,null));};exports[_0xa98c('0x33')]=function(_0x51a90c,_0x150185){if(_0x51a90c[_0xa98c('0x32')]['id']){delete _0x51a90c[_0xa98c('0x32')]['id'];}return db[_0xa98c('0x1f')]['find']({'where':{'id':_0x51a90c['params']['id']}})[_0xa98c('0x16')](handleEntityNotFound(_0x150185,null))['then'](saveUpdates(_0x51a90c[_0xa98c('0x32')],null))[_0xa98c('0x16')](respondWithResult(_0x150185,null))[_0xa98c('0x30')](handleError(_0x150185,null));};exports[_0xa98c('0x17')]=function(_0x57aa51,_0xd2521e){return db[_0xa98c('0x1f')][_0xa98c('0x2f')]({'where':{'id':_0x57aa51['params']['id']}})[_0xa98c('0x16')](handleEntityNotFound(_0xd2521e,null))[_0xa98c('0x16')](removeEntity(_0xd2521e,null))[_0xa98c('0x30')](handleError(_0xd2521e,null));};exports[_0xa98c('0x34')]=function(_0x3ffb87,_0x52ebfb){return db[_0xa98c('0x1f')][_0xa98c('0x34')]()[_0xa98c('0x16')](respondWithResult(_0x52ebfb,null))[_0xa98c('0x30')](handleError(_0x52ebfb,null));};exports[_0xa98c('0x35')]=function(_0x208109,_0x182c84){return db[_0xa98c('0x36')][_0xa98c('0x2f')]({'where':{'id':_0x208109[_0xa98c('0x28')]['id']}})[_0xa98c('0x16')](handleEntityNotFound(_0x182c84,null))[_0xa98c('0x16')](function(_0x92fe1a){if(_0x92fe1a){return _0x92fe1a[_0xa98c('0x35')](_0x208109[_0xa98c('0x32')]['ids'],_['omit'](_0x208109[_0xa98c('0x32')],[_0xa98c('0x37'),'id'])||{});}})[_0xa98c('0x16')](respondWithResult(_0x182c84,null))['catch'](handleError(_0x182c84,null));};exports[_0xa98c('0x38')]=function(_0x5b4fc6,_0x42c642){var _0x28be04={'raw':![],'where':{}};var _0x155c31={};var _0x38274b={'count':0x0,'rows':[]};return db[_0xa98c('0x1f')]['findOne']({'where':{'id':_0x5b4fc6['params']['id']}})[_0xa98c('0x16')](handleEntityNotFound(_0x42c642,null))['then'](function(_0x47f42a){if(_0x47f42a){_0x155c31[_0xa98c('0x2c')]=_['keys'](db[_0xa98c('0x36')]['rawAttributes']);_0x155c31[_0xa98c('0x26')]=_[_0xa98c('0x29')](_0x5b4fc6['query']);_0x155c31[_0xa98c('0x2a')]=_[_0xa98c('0x2b')](_0x155c31[_0xa98c('0x2c')],_0x155c31[_0xa98c('0x26')]);_0x28be04[_0xa98c('0x2d')]=_[_0xa98c('0x2b')](_0x155c31[_0xa98c('0x2c')],qs['fields'](_0x5b4fc6[_0xa98c('0x26')][_0xa98c('0x2e')]));_0x28be04['attributes']=_0x28be04[_0xa98c('0x2d')][_0xa98c('0x39')]?_0x28be04[_0xa98c('0x2d')]:_0x155c31[_0xa98c('0x2c')];if(!_0x5b4fc6[_0xa98c('0x26')][_0xa98c('0x3a')](_0xa98c('0x3b'))){_0x28be04[_0xa98c('0x12')]=qs['limit'](_0x5b4fc6[_0xa98c('0x26')]['limit']);_0x28be04[_0xa98c('0x10')]=qs[_0xa98c('0x10')](_0x5b4fc6[_0xa98c('0x26')][_0xa98c('0x10')]);}_0x28be04[_0xa98c('0x3c')]=qs[_0xa98c('0x3d')](_0x5b4fc6[_0xa98c('0x26')]['sort']);_0x28be04[_0xa98c('0x3e')]=qs['filters'](_['pick'](_0x5b4fc6['query'],_0x155c31[_0xa98c('0x2a')]));_0x28be04[_0xa98c('0x3e')][_0xa98c('0x3f')]=_0x47f42a['id'];if(_0x5b4fc6['query'][_0xa98c('0x40')]){_0x28be04['where']=_['merge'](_0x28be04[_0xa98c('0x3e')],{'$or':_[_0xa98c('0x1e')](_0x28be04[_0xa98c('0x2d')],function(_0x30becc){var _0x27c2b7={};_0x27c2b7[_0x30becc]={'$like':'%'+_0x5b4fc6[_0xa98c('0x26')][_0xa98c('0x40')]+'%'};return _0x27c2b7;})});}if(_0x5b4fc6[_0xa98c('0x26')][_0xa98c('0x41')]){var _0x2019dd=_0x5b4fc6[_0xa98c('0x26')]['$gte'][_0xa98c('0x42')](',');var _0x5c7d10={};_0x5c7d10[_0x2019dd[0x0]]={'$gte':moment(_0x2019dd[0x1])[_0xa98c('0x43')]('YYYY-MM-DD\x20HH:mm:ss')};_0x28be04[_0xa98c('0x3e')]=_[_0xa98c('0x44')](_0x28be04[_0xa98c('0x3e')],_0x5c7d10);}_0x28be04=_[_0xa98c('0x44')]({},_0x28be04,_0x5b4fc6[_0xa98c('0x45')]);return db[_0xa98c('0x36')][_0xa98c('0x13')]({'where':_0x28be04[_0xa98c('0x3e')]})[_0xa98c('0x16')](function(_0x43e392){_0x38274b['count']=_0x43e392;if(_0x5b4fc6['query'][_0xa98c('0x46')]){_0x28be04[_0xa98c('0x47')]=[{'all':!![]}];}return db[_0xa98c('0x36')][_0xa98c('0x25')](_0x28be04);})['then'](function(_0x5ad175){_0x38274b[_0xa98c('0x48')]=_0x5ad175;return _0x38274b;});}})[_0xa98c('0x16')](respondWithFilteredResult(_0x42c642,_0x28be04))[_0xa98c('0x30')](handleError(_0x42c642,null));};exports[_0xa98c('0x49')]=function(_0x441436,_0x304c34){return db[_0xa98c('0x1f')][_0xa98c('0x2f')]({'where':{'id':_0x441436[_0xa98c('0x28')]['id']}})[_0xa98c('0x16')](handleEntityNotFound(_0x304c34,null))['then'](function(_0x49a3e6){if(_0x49a3e6){return _0x49a3e6[_0xa98c('0x4a')](_0x441436[_0xa98c('0x32')]['ids'],_[_0xa98c('0x4b')](_0x441436[_0xa98c('0x32')],[_0xa98c('0x37'),'id'])||{})[_0xa98c('0x4c')](function(){return db[_0xa98c('0x4d')][_0xa98c('0x25')]({'attributes':['id','name',_0xa98c('0x4e')],'where':{'id':_0x441436['body'][_0xa98c('0x37')]}});})['then'](function(_0x22c223){socket['emit'](_0xa98c('0x4f'),{'id':Number(_0x441436[_0xa98c('0x28')]['id']),'tags':_0x22c223||[]});return{'id':Number(_0x441436[_0xa98c('0x28')]['id']),'tags':_0x22c223||[]};});}})[_0xa98c('0x16')](respondWithResult(_0x304c34,null))[_0xa98c('0x30')](handleError(_0x304c34,null));};exports[_0xa98c('0x50')]=function(_0x4e8c2d,_0x305929){return db[_0xa98c('0x1f')][_0xa98c('0x2f')]({'where':{'id':_0x4e8c2d[_0xa98c('0x28')]['id']}})[_0xa98c('0x16')](handleEntityNotFound(_0x305929,null))[_0xa98c('0x16')](function(_0x4b923b){if(_0x4b923b){return _0x4b923b[_0xa98c('0x50')](_0x4e8c2d[_0xa98c('0x26')][_0xa98c('0x37')]);}})[_0xa98c('0x16')](respondWithStatusCode(_0x305929,null))[_0xa98c('0x30')](handleError(_0x305929,null));};exports['download']=function(_0xb813d8,_0x4d9762){var _0x4bd8fe=moment()['unix']()[_0xa98c('0x51')]();var _0x87c76f=path['join'](config[_0xa98c('0x52')],'server',_0xa98c('0x53'),_0xa98c('0x54'));var _0x51d1ba=path[_0xa98c('0x55')](config[_0xa98c('0x52')],_0xa98c('0x56'),_0xa98c('0x53'),_0xa98c('0x57'));var _0x32959a=path['join'](_0x87c76f,_0x4bd8fe);var _0xd2eb97=util['format'](_0xa98c('0x58'),_0xb813d8['params']['id'],_0x4bd8fe);var _0x5e7a81=path['join'](_0x87c76f,_0xd2eb97);var _0x411dfb=[];_0x411dfb[_0xa98c('0x59')]({'model':db[_0xa98c('0x5a')],'as':_0xa98c('0x5a'),'raw':!![]});var _0x56cd47=[{'model':db['FaxMessage'],'as':_0xa98c('0x5b'),'attributes':['id',_0xa98c('0x32'),_0xa98c('0x5c')],'include':_0x411dfb}];return db[_0xa98c('0x1f')][_0xa98c('0x2f')]({'where':{'id':_0xb813d8['params']['id']},'include':_0x56cd47})['then'](handleEntityNotFound(_0x4d9762,null))[_0xa98c('0x16')](function(_0x3bcdbf){if(_0x3bcdbf&&_0x3bcdbf[_0xa98c('0x5b')]){var _0x2336b6=_0x3bcdbf['get']({'plain':!![]});fs[_0xa98c('0x5d')](_0x32959a);for(var _0x356973=0x0;_0x356973<_0x2336b6[_0xa98c('0x5b')][_0xa98c('0x39')];_0x356973++){var _0x214406=_0x2336b6[_0xa98c('0x5b')][_0x356973][_0xa98c('0x5a')];if(_0x214406){var _0x8de024=path[_0xa98c('0x55')](_0x51d1ba,_0x214406[_0xa98c('0x5e')]);if(fs[_0xa98c('0x5f')](_0x8de024)){fs['createReadStream'](_0x8de024)[_0xa98c('0x60')](fs[_0xa98c('0x61')](path[_0xa98c('0x55')](_0x32959a,_0x214406['basename'])));}}}return BPromise['resolve']()[_0xa98c('0x16')](function(){return new BPromise(function(_0x111ada,_0x424cbf){zipdir(_0x32959a,{'saveTo':_0x5e7a81},function(_0x54c9da,_0x190605){if(_0x54c9da)return _0x424cbf(_0x54c9da);return _0x111ada(_0x190605);});})['then'](function(){return new BPromise(function(_0x4945ce,_0x2403aa){rimraf(_0x32959a,function(_0x480928){if(_0x480928)_0x2403aa(_0x480928);return _0x4945ce();});});})['then'](function(){return _0x4d9762[_0xa98c('0x62')](_0x5e7a81,_0xd2eb97,function(_0x555af0){if(_0x555af0){console[_0xa98c('0x63')]('err',_0x555af0);}else{fs[_0xa98c('0x64')](_0x5e7a81);}});});});}else{return _0x4d9762[_0xa98c('0x19')](0xc8);}})[_0xa98c('0x30')](handleError(_0x4d9762,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 1f74ad8..a7fa717 100644 --- a/server/api/faxInteraction/faxInteraction.events.js +++ b/server/api/faxInteraction/faxInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x174b=['findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction','setMaxListeners','update','remove','getUsers','then','setDataValue','map'];(function(_0x2d1bea,_0xc06ab9){var _0x29060d=function(_0x23a8df){while(--_0x23a8df){_0x2d1bea['push'](_0x2d1bea['shift']());}};_0x29060d(++_0xc06ab9);}(_0x174b,0xa7));var _0xb174=function(_0x5d0fa8,_0x1931b4){_0x5d0fa8=_0x5d0fa8-0x0;var _0x3c9292=_0x174b[_0x5d0fa8];return _0x3c9292;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xb174('0x0'))['db'][_0xb174('0x1')];var FaxMessage=require(_0xb174('0x0'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xb174('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb174('0x3'),'afterDestroy':_0xb174('0x4')};function emitEvent(_0x3f1e6c){return function(_0x4b2040,_0x474334,_0x31af2c){_0x4b2040[_0xb174('0x5')]({'attributes':['id'],'raw':!![]})[_0xb174('0x6')](function(_0x5b01ef){_0x4b2040[_0xb174('0x7')]('Users',_0x5b01ef[_0xb174('0x8')](function(_0x19d1e9){return{'id':_0x19d1e9['id']};}));return FaxMessage[_0xb174('0x9')]({'where':{'FaxInteractionId':_0x4b2040['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb174('0x6')](function(_0x21da46){_0x4b2040[_0xb174('0x7')](_0xb174('0xa'),_0x21da46['length']);FaxInteractionEvents[_0xb174('0xb')](_0x3f1e6c+':'+_0x4b2040['id'],_0x4b2040);FaxInteractionEvents['emit'](_0x3f1e6c,_0x4b2040);_0x31af2c(null);})[_0xb174('0xc')](_0x31af2c(null));};}for(var e in events){if(events[_0xb174('0xd')](e)){var event=events[e];FaxInteraction[_0xb174('0xe')](e,emitEvent(event));}}module[_0xb174('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x22fe=['FaxMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction'];(function(_0x335bd7,_0x4ac64b){var _0x291faa=function(_0x7ee182){while(--_0x7ee182){_0x335bd7['push'](_0x335bd7['shift']());}};_0x291faa(++_0x4ac64b);}(_0x22fe,0x177));var _0xe22f=function(_0x5bc84c,_0x38d001){_0x5bc84c=_0x5bc84c-0x0;var _0x612a54=_0x22fe[_0x5bc84c];return _0x612a54;};'use strict';var EventEmitter=require(_0xe22f('0x0'));var FaxInteraction=require(_0xe22f('0x1'))['db'][_0xe22f('0x2')];var FaxMessage=require(_0xe22f('0x1'))['db'][_0xe22f('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xe22f('0x4')](0x0);var events={'afterCreate':_0xe22f('0x5'),'afterUpdate':_0xe22f('0x6'),'afterDestroy':'remove'};function emitEvent(_0x45554a){return function(_0x38c42b,_0x180e42,_0x1f5f3d){_0x38c42b[_0xe22f('0x7')]({'attributes':['id'],'raw':!![]})[_0xe22f('0x8')](function(_0x55db9c){_0x38c42b[_0xe22f('0x9')](_0xe22f('0xa'),_0x55db9c['map'](function(_0x482b9b){return{'id':_0x482b9b['id']};}));return FaxMessage[_0xe22f('0xb')]({'where':{'FaxInteractionId':_0x38c42b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe22f('0x8')](function(_0x22c2a6){_0x38c42b[_0xe22f('0x9')](_0xe22f('0xc'),_0x22c2a6[_0xe22f('0xd')]);FaxInteractionEvents['emit'](_0x45554a+':'+_0x38c42b['id'],_0x38c42b);FaxInteractionEvents[_0xe22f('0xe')](_0x45554a,_0x38c42b);_0x1f5f3d(null);})[_0xe22f('0xf')](_0x1f5f3d(null));};}for(var e in events){if(events[_0xe22f('0x10')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xe22f('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 235b284..250b84b 100644 --- a/server/api/faxInteraction/faxInteraction.model.js +++ b/server/api/faxInteraction/faxInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3d8=['bluebird','path','rimraf','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0xf3d8,0x175));var _0x8f3d=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0xf3d8[_0x547456];return _0xc1fd7b;};'use strict';var _=require(_0x8f3d('0x0'));var util=require(_0x8f3d('0x1'));var logger=require(_0x8f3d('0x2'))(_0x8f3d('0x3'));var moment=require('moment');var BPromise=require(_0x8f3d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f3d('0x5'));var rimraf=require(_0x8f3d('0x6'));var config=require('../../config/environment');var attributes=require(_0x8f3d('0x7'));module['exports']=function(_0x3ffc46,_0x53613e){return _0x3ffc46[_0x8f3d('0x8')](_0x8f3d('0x9'),attributes,{'tableName':_0x8f3d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x324108,_0x22e5f3,_0x3c6698){if(_0x324108['changed'](_0x8f3d('0xb'))){_0x324108['closedAt']=moment()['format'](_0x8f3d('0xc'));}_0x3c6698(null,_0x324108);}}});}; \ No newline at end of file +var _0x8c06=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed'];(function(_0x759871,_0x17ceaa){var _0xc7f186=function(_0x57a5c6){while(--_0x57a5c6){_0x759871['push'](_0x759871['shift']());}};_0xc7f186(++_0x17ceaa);}(_0x8c06,0x158));var _0x68c0=function(_0x2ac44a,_0x1701b6){_0x2ac44a=_0x2ac44a-0x0;var _0x2f2b2f=_0x8c06[_0x2ac44a];return _0x2f2b2f;};'use strict';var _=require(_0x68c0('0x0'));var util=require(_0x68c0('0x1'));var logger=require('../../config/logger')(_0x68c0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x68c0('0x3'));var fs=require('fs');var path=require(_0x68c0('0x4'));var rimraf=require(_0x68c0('0x5'));var config=require(_0x68c0('0x6'));var attributes=require(_0x68c0('0x7'));module[_0x68c0('0x8')]=function(_0x5a71c1,_0x239d2a){return _0x5a71c1[_0x68c0('0x9')](_0x68c0('0xa'),attributes,{'tableName':_0x68c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x336e54,_0x525b6b,_0x158cff){if(_0x336e54[_0x68c0('0xc')](_0x68c0('0xd'))){_0x336e54[_0x68c0('0xe')]=moment()[_0x68c0('0xf')](_0x68c0('0x10'));}_0x158cff(null,_0x336e54);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 8991fc6..a15c1b4 100644 --- a/server/api/faxInteraction/faxInteraction.rpc.js +++ b/server/api/faxInteraction/faxInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xddbc=['FaxInteraction','update','body','options','raw','where','attributes','info','UpdateFaxInteraction','AddTagsToFaxInteraction','find','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2dea8d,_0x5f28ab){var _0x4d39b4=function(_0x4de3ad){while(--_0x4de3ad){_0x2dea8d['push'](_0x2dea8d['shift']());}};_0x4d39b4(++_0x5f28ab);}(_0xddbc,0x166));var _0xcddb=function(_0x71ebbe,_0x5acff0){_0x71ebbe=_0x71ebbe-0x0;var _0x41ad41=_0xddbc[_0x71ebbe];return _0x41ad41;};'use strict';var _=require(_0xcddb('0x0'));var util=require(_0xcddb('0x1'));var moment=require(_0xcddb('0x2'));var BPromise=require(_0xcddb('0x3'));var rs=require(_0xcddb('0x4'));var fs=require('fs');var Redis=require(_0xcddb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcddb('0x6'));var logger=require(_0xcddb('0x7'))('rpc');var config=require(_0xcddb('0x8'));var jayson=require(_0xcddb('0x9'));var client=jayson[_0xcddb('0xa')][_0xcddb('0xb')]({'port':0x232a});config[_0xcddb('0xc')]=_[_0xcddb('0xd')](config['redis'],{'host':_0xcddb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcddb('0xc')]));require(_0xcddb('0xf'))[_0xcddb('0x10')](socket);function respondWithRpcPromise(_0x1fc8f9,_0x47dd31,_0x379f80){return new BPromise(function(_0x2074a8,_0x19de6c){return client[_0xcddb('0x11')](_0x1fc8f9,_0x379f80)[_0xcddb('0x12')](function(_0x6d3334){logger['info'](_0xcddb('0x13'),_0x47dd31,_0xcddb('0x14'));logger[_0xcddb('0x15')](_0xcddb('0x16'),_0x47dd31,_0xcddb('0x14'),JSON[_0xcddb('0x17')](_0x6d3334));if(_0x6d3334[_0xcddb('0x18')]){if(_0x6d3334[_0xcddb('0x18')][_0xcddb('0x19')]===0x1f4){logger[_0xcddb('0x18')](_0xcddb('0x13'),_0x47dd31,_0x6d3334[_0xcddb('0x18')][_0xcddb('0x1a')]);return _0x19de6c(_0x6d3334['error'][_0xcddb('0x1a')]);}logger['error'](_0xcddb('0x13'),_0x47dd31,_0x6d3334[_0xcddb('0x18')][_0xcddb('0x1a')]);return _0x2074a8(_0x6d3334[_0xcddb('0x18')][_0xcddb('0x1a')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x47dd31,'request\x20sent');_0x2074a8(_0x6d3334[_0xcddb('0x1b')]['message']);}})[_0xcddb('0x1c')](function(_0x5c993e){logger[_0xcddb('0x18')](_0xcddb('0x13'),_0x47dd31,_0x5c993e);_0x19de6c(_0x5c993e);});});}exports['UpdateFaxInteraction']=function(_0x1f03ac){var _0x48c8ea=this;return new Promise(function(_0x4e9ffc,_0x6aafd7){return db[_0xcddb('0x1d')][_0xcddb('0x1e')](_0x1f03ac[_0xcddb('0x1f')],{'raw':_0x1f03ac['options']?_0x1f03ac[_0xcddb('0x20')][_0xcddb('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f03ac[_0xcddb('0x20')]?_0x1f03ac[_0xcddb('0x20')][_0xcddb('0x22')]||null:null,'attributes':_0x1f03ac['options']?_0x1f03ac[_0xcddb('0x20')][_0xcddb('0x23')]||null:null,'limit':_0x1f03ac[_0xcddb('0x20')]?_0x1f03ac[_0xcddb('0x20')]['limit']||null:null})['then'](function(_0x29078c){logger[_0xcddb('0x24')](_0xcddb('0x25'),_0x1f03ac);logger[_0xcddb('0x15')]('UpdateFaxInteraction',_0x1f03ac,JSON[_0xcddb('0x17')](_0x29078c));_0x4e9ffc(_0x29078c);})[_0xcddb('0x1c')](function(_0x4bc72c){logger[_0xcddb('0x18')]('UpdateFaxInteraction',_0x4bc72c['message'],_0x1f03ac);_0x6aafd7(_0x48c8ea[_0xcddb('0x18')](0x1f4,_0x4bc72c[_0xcddb('0x1a')]));});});};exports[_0xcddb('0x26')]=function(_0x2b3238){return new Promise(function(_0x2b9474,_0x20c6e6){return db[_0xcddb('0x1d')][_0xcddb('0x27')]({'where':_0x2b3238[_0xcddb('0x20')]?_0x2b3238[_0xcddb('0x20')][_0xcddb('0x22')]||null:null})[_0xcddb('0x12')](function(_0x164010){if(_0x164010){return _0x164010['addTags'](_0x2b3238[_0xcddb('0x1f')]['ids'],_['omit'](_0x2b3238[_0xcddb('0x1f')],[_0xcddb('0x28'),'id'])||{});}})[_0xcddb('0x29')](function(_0x4e1a35){logger['info']('AddTags',_0x2b3238);logger[_0xcddb('0x15')](_0xcddb('0x2a'),_0x2b3238,JSON[_0xcddb('0x17')](_0x4e1a35));_0x2b9474(_0x4e1a35);})[_0xcddb('0x1c')](function(_0x4c0185){logger[_0xcddb('0x18')](_0xcddb('0x2a'),_0x4c0185[_0xcddb('0x1a')],_0x2b3238);_0x20c6e6(_this[_0xcddb('0x18')](0x1f4,_0x4c0185['message']));});});}; \ No newline at end of file +var _0xcea3=['defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateFaxInteraction','body','options','raw','where','attributes','limit','stringify','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x2bfe32,_0x5b43df){var _0x19b1d5=function(_0x2b1ae2){while(--_0x2b1ae2){_0x2bfe32['push'](_0x2bfe32['shift']());}};_0x19b1d5(++_0x5b43df);}(_0xcea3,0x120));var _0x3cea=function(_0x2d2b3f,_0x3f730e){_0x2d2b3f=_0x2d2b3f-0x0;var _0x48427d=_0xcea3[_0x2d2b3f];return _0x48427d;};'use strict';var _=require('lodash');var util=require(_0x3cea('0x0'));var moment=require(_0x3cea('0x1'));var BPromise=require(_0x3cea('0x2'));var rs=require(_0x3cea('0x3'));var fs=require('fs');var Redis=require(_0x3cea('0x4'));var db=require(_0x3cea('0x5'))['db'];var utils=require(_0x3cea('0x6'));var logger=require(_0x3cea('0x7'))(_0x3cea('0x8'));var config=require(_0x3cea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3cea('0xa')][_0x3cea('0xb')]({'port':0x232a});config[_0x3cea('0xc')]=_[_0x3cea('0xd')](config[_0x3cea('0xc')],{'host':_0x3cea('0xe'),'port':0x18eb});var socket=require(_0x3cea('0xf'))(new Redis(config[_0x3cea('0xc')]));require(_0x3cea('0x10'))['register'](socket);function respondWithRpcPromise(_0x3057fd,_0x2c619f,_0x1581c6){return new BPromise(function(_0x3923ee,_0x3675be){return client[_0x3cea('0x11')](_0x3057fd,_0x1581c6)[_0x3cea('0x12')](function(_0x1041f5){logger[_0x3cea('0x13')](_0x3cea('0x14'),_0x2c619f,_0x3cea('0x15'));logger[_0x3cea('0x16')](_0x3cea('0x17'),_0x2c619f,_0x3cea('0x15'),JSON['stringify'](_0x1041f5));if(_0x1041f5[_0x3cea('0x18')]){if(_0x1041f5[_0x3cea('0x18')]['code']===0x1f4){logger[_0x3cea('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x2c619f,_0x1041f5[_0x3cea('0x18')]['message']);return _0x3675be(_0x1041f5[_0x3cea('0x18')][_0x3cea('0x19')]);}logger[_0x3cea('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x2c619f,_0x1041f5[_0x3cea('0x18')]['message']);return _0x3923ee(_0x1041f5[_0x3cea('0x18')][_0x3cea('0x19')]);}else{logger[_0x3cea('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x2c619f,'request\x20sent');_0x3923ee(_0x1041f5[_0x3cea('0x1a')]['message']);}})[_0x3cea('0x1b')](function(_0x262c33){logger[_0x3cea('0x18')](_0x3cea('0x14'),_0x2c619f,_0x262c33);_0x3675be(_0x262c33);});});}exports[_0x3cea('0x1c')]=function(_0x31a9fa){var _0x503043=this;return new Promise(function(_0x372882,_0xb57f5b){return db['FaxInteraction']['update'](_0x31a9fa[_0x3cea('0x1d')],{'raw':_0x31a9fa[_0x3cea('0x1e')]?_0x31a9fa[_0x3cea('0x1e')][_0x3cea('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31a9fa['options']?_0x31a9fa[_0x3cea('0x1e')][_0x3cea('0x20')]||null:null,'attributes':_0x31a9fa[_0x3cea('0x1e')]?_0x31a9fa['options'][_0x3cea('0x21')]||null:null,'limit':_0x31a9fa[_0x3cea('0x1e')]?_0x31a9fa[_0x3cea('0x1e')][_0x3cea('0x22')]||null:null})[_0x3cea('0x12')](function(_0x34d699){logger[_0x3cea('0x13')](_0x3cea('0x1c'),_0x31a9fa);logger[_0x3cea('0x16')](_0x3cea('0x1c'),_0x31a9fa,JSON[_0x3cea('0x23')](_0x34d699));_0x372882(_0x34d699);})['catch'](function(_0x5145b5){logger[_0x3cea('0x18')](_0x3cea('0x1c'),_0x5145b5[_0x3cea('0x19')],_0x31a9fa);_0xb57f5b(_0x503043[_0x3cea('0x18')](0x1f4,_0x5145b5[_0x3cea('0x19')]));});});};exports[_0x3cea('0x24')]=function(_0x47615a){return new Promise(function(_0x1762bb,_0x585ac3){return db[_0x3cea('0x25')][_0x3cea('0x26')]({'where':_0x47615a[_0x3cea('0x1e')]?_0x47615a['options']['where']||null:null})[_0x3cea('0x12')](function(_0x2d9deb){if(_0x2d9deb){return _0x2d9deb[_0x3cea('0x27')](_0x47615a[_0x3cea('0x1d')][_0x3cea('0x28')],_['omit'](_0x47615a['body'],[_0x3cea('0x28'),'id'])||{});}})[_0x3cea('0x29')](function(_0x2abe00){logger[_0x3cea('0x13')]('AddTags',_0x47615a);logger['debug'](_0x3cea('0x2a'),_0x47615a,JSON[_0x3cea('0x23')](_0x2abe00));_0x1762bb(_0x2abe00);})[_0x3cea('0x1b')](function(_0x19e5bc){logger[_0x3cea('0x18')](_0x3cea('0x2a'),_0x19e5bc['message'],_0x47615a);_0x585ac3(_this[_0x3cea('0x18')](0x1f4,_0x19e5bc[_0x3cea('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 09bb8dd..64d9e65 100644 --- a/server/api/faxInteraction/faxInteraction.socket.js +++ b/server/api/faxInteraction/faxInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6392=['removeListener','register','length','./faxInteraction.events','save','remove','update','emit'];(function(_0x533132,_0xf5b6fa){var _0x1a7447=function(_0x44d580){while(--_0x44d580){_0x533132['push'](_0x533132['shift']());}};_0x1a7447(++_0xf5b6fa);}(_0x6392,0xc3));var _0x2639=function(_0x1ff0cd,_0x75a49c){_0x1ff0cd=_0x1ff0cd-0x0;var _0x3389fd=_0x6392[_0x1ff0cd];return _0x3389fd;};'use strict';var FaxInteractionEvents=require(_0x2639('0x0'));var events=[_0x2639('0x1'),_0x2639('0x2'),_0x2639('0x3')];function createListener(_0x5b1514,_0x58bf27){return function(_0x2d091f){_0x58bf27[_0x2639('0x4')](_0x5b1514,_0x2d091f);};}function removeListener(_0x46b939,_0x460d1d){return function(){FaxInteractionEvents[_0x2639('0x5')](_0x46b939,_0x460d1d);};}exports[_0x2639('0x6')]=function(_0x3450dc){for(var _0x2e4b6c=0x0,_0x176f79=events[_0x2639('0x7')];_0x2e4b6c<_0x176f79;_0x2e4b6c++){var _0x37105d=events[_0x2e4b6c];var _0x43a7e3=createListener('faxInteraction:'+_0x37105d,_0x3450dc);FaxInteractionEvents['on'](_0x37105d,_0x43a7e3);}}; \ No newline at end of file +var _0xa088=['length','faxInteraction:','save','remove','removeListener','register'];(function(_0xd69818,_0x2ad5de){var _0x3544a0=function(_0x44acd1){while(--_0x44acd1){_0xd69818['push'](_0xd69818['shift']());}};_0x3544a0(++_0x2ad5de);}(_0xa088,0x140));var _0x8a08=function(_0x328d2c,_0x43d4cb){_0x328d2c=_0x328d2c-0x0;var _0x2f884b=_0xa088[_0x328d2c];return _0x2f884b;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x8a08('0x0'),_0x8a08('0x1'),'update'];function createListener(_0x42e7d2,_0x38b5aa){return function(_0x2ac816){_0x38b5aa['emit'](_0x42e7d2,_0x2ac816);};}function removeListener(_0x307985,_0x10ee6c){return function(){FaxInteractionEvents[_0x8a08('0x2')](_0x307985,_0x10ee6c);};}exports[_0x8a08('0x3')]=function(_0x9048d5){for(var _0x1c67f4=0x0,_0x3ad344=events[_0x8a08('0x4')];_0x1c67f4<_0x3ad344;_0x1c67f4++){var _0x4cfc31=events[_0x1c67f4];var _0x205dbc=createListener(_0x8a08('0x5')+_0x4cfc31,_0x9048d5);FaxInteractionEvents['on'](_0x4cfc31,_0x205dbc);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 4dceed5..5396a3b 100644 --- a/server/api/faxInteraction/index.js +++ b/server/api/faxInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb016=['fax','faxinteraction:addtags','addTags','update','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','/:id/download','download','post','create','/:id/tags','tracked'];(function(_0x5c2db4,_0x580ff7){var _0x5b624d=function(_0x22d273){while(--_0x22d273){_0x5c2db4['push'](_0x5c2db4['shift']());}};_0x5b624d(++_0x580ff7);}(_0xb016,0x129));var _0x6b01=function(_0x22a666,_0x43dc8a){_0x22a666=_0x22a666-0x0;var _0x15bbf1=_0xb016[_0x22a666];return _0x15bbf1;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require(_0x6b01('0x2'));var timeout=require(_0x6b01('0x3'));var express=require(_0x6b01('0x4'));var router=express[_0x6b01('0x5')]();var fs_extra=require(_0x6b01('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6b01('0x7'));var config=require(_0x6b01('0x8'));var controller=require(_0x6b01('0x9'));router[_0x6b01('0xa')]('/',auth[_0x6b01('0xb')](),controller[_0x6b01('0xc')]);router[_0x6b01('0xa')]('/describe',auth[_0x6b01('0xb')](),controller[_0x6b01('0xd')]);router['get'](_0x6b01('0xe'),auth[_0x6b01('0xb')](),controller['show']);router['get'](_0x6b01('0xf'),auth[_0x6b01('0xb')](),controller['getMessages']);router[_0x6b01('0xa')](_0x6b01('0x10'),auth[_0x6b01('0xb')](),controller[_0x6b01('0x11')]);router[_0x6b01('0x12')]('/',auth[_0x6b01('0xb')](),controller[_0x6b01('0x13')]);router[_0x6b01('0x12')](_0x6b01('0xf'),auth['isAuthenticated'](),controller['addMessage']);router[_0x6b01('0x12')](_0x6b01('0x14'),auth[_0x6b01('0xb')](),interaction[_0x6b01('0x15')](_0x6b01('0x16'),_0x6b01('0x17')),controller[_0x6b01('0x18')]);router['put'](_0x6b01('0xe'),auth[_0x6b01('0xb')](),interaction[_0x6b01('0x15')](_0x6b01('0x16'),'faxinteraction:update'),controller[_0x6b01('0x19')]);router[_0x6b01('0x1a')](_0x6b01('0xe'),auth[_0x6b01('0xb')](),interaction[_0x6b01('0x15')](_0x6b01('0x16'),'faxinteraction:destroy'),controller['destroy']);router[_0x6b01('0x1a')](_0x6b01('0x14'),auth[_0x6b01('0xb')](),controller[_0x6b01('0x1b')]);module[_0x6b01('0x1c')]=router; \ No newline at end of file +var _0xfe6c=['../../components/auth/service','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','addTags','put','tracked','faxinteraction:update','delete','fax','faxinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','fs-extra'];(function(_0x5a28a2,_0x14a164){var _0x160064=function(_0x1c8302){while(--_0x1c8302){_0x5a28a2['push'](_0x5a28a2['shift']());}};_0x160064(++_0x14a164);}(_0xfe6c,0x1eb));var _0xcfe6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe6c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcfe6('0x0'));var util=require('util');var path=require(_0xcfe6('0x1'));var timeout=require(_0xcfe6('0x2'));var express=require(_0xcfe6('0x3'));var router=express['Router']();var fs_extra=require(_0xcfe6('0x4'));var auth=require(_0xcfe6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcfe6('0x6'));router[_0xcfe6('0x7')]('/',auth[_0xcfe6('0x8')](),controller[_0xcfe6('0x9')]);router[_0xcfe6('0x7')]('/describe',auth[_0xcfe6('0x8')](),controller[_0xcfe6('0xa')]);router[_0xcfe6('0x7')](_0xcfe6('0xb'),auth[_0xcfe6('0x8')](),controller[_0xcfe6('0xc')]);router[_0xcfe6('0x7')](_0xcfe6('0xd'),auth[_0xcfe6('0x8')](),controller[_0xcfe6('0xe')]);router[_0xcfe6('0x7')](_0xcfe6('0xf'),auth[_0xcfe6('0x8')](),controller[_0xcfe6('0x10')]);router[_0xcfe6('0x11')]('/',auth[_0xcfe6('0x8')](),controller[_0xcfe6('0x12')]);router[_0xcfe6('0x11')]('/:id/messages',auth[_0xcfe6('0x8')](),controller[_0xcfe6('0x13')]);router['post'](_0xcfe6('0x14'),auth[_0xcfe6('0x8')](),interaction['tracked']('fax','faxinteraction:addtags'),controller[_0xcfe6('0x15')]);router[_0xcfe6('0x16')](_0xcfe6('0xb'),auth['isAuthenticated'](),interaction[_0xcfe6('0x17')]('fax',_0xcfe6('0x18')),controller['update']);router[_0xcfe6('0x19')](_0xcfe6('0xb'),auth[_0xcfe6('0x8')](),interaction[_0xcfe6('0x17')](_0xcfe6('0x1a'),_0xcfe6('0x1b')),controller[_0xcfe6('0x1c')]);router[_0xcfe6('0x19')]('/:id/tags',auth[_0xcfe6('0x8')](),controller[_0xcfe6('0x1d')]);module[_0xcfe6('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index f07a591..63e3155 100644 --- a/server/api/faxMessage/faxMessage.attributes.js +++ b/server/api/faxMessage/faxMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c6d=['out','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x1f03ff,_0x27a7fa){var _0xa72717=function(_0x6b751c){while(--_0x6b751c){_0x1f03ff['push'](_0x1f03ff['shift']());}};_0xa72717(++_0x27a7fa);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x389273,_0x92a0c6){_0x389273=_0x389273-0x0;var _0xee6a5d=_0x0c6d[_0x389273];return _0xee6a5d;};'use strict';var Sequelize=require('sequelize');module[_0xd0c6('0x0')]={'body':{'type':Sequelize[_0xd0c6('0x1')](_0xd0c6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd0c6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd0c6('0x4')]('in',_0xd0c6('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xd0c6('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x7119=['exports','medium','ENUM','out','TEXT'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7119,0x1c7));var _0x9711=function(_0x1a9e78,_0x180720){_0x1a9e78=_0x1a9e78-0x0;var _0x113e06=_0x7119[_0x1a9e78];return _0x113e06;};'use strict';var Sequelize=require('sequelize');module[_0x9711('0x0')]={'body':{'type':Sequelize['TEXT'](_0x9711('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9711('0x2')]('in',_0x9711('0x3')),'defaultValue':_0x9711('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x9711('0x4')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 50b90a6..c053ce4 100644 --- a/server/api/faxMessage/faxMessage.controller.js +++ b/server/api/faxMessage/faxMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ef4=['null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','motionChannel','channel','event','accept','EventManager','acceptmessage','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','Sequelize','SIP/%s','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','client','http','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','undefined','limit','count','offset','reject','save','update','then','destroy','end','name','send','map','FaxMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','findAll','rows','show','params','includeAll','include','options','find','body','describe','fax-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteractionId','isNil','read1stAt','format','interaction','get','role'];(function(_0x2badfd,_0x287de3){var _0xae167d=function(_0x46b9c2){while(--_0x46b9c2){_0x2badfd['push'](_0x2badfd['shift']());}};_0xae167d(++_0x287de3);}(_0x7ef4,0x145));var _0x47ef=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7ef4[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x47ef('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x47ef('0x1'));var rp=require('request-promise');var moment=require(_0x47ef('0x2'));var BPromise=require(_0x47ef('0x3'));var Mustache=require(_0x47ef('0x4'));var util=require(_0x47ef('0x5'));var path=require('path');var sox=require(_0x47ef('0x6'));var csv=require(_0x47ef('0x7'));var ejs=require(_0x47ef('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x47ef('0x9'));var squel=require(_0x47ef('0xa'));var crypto=require('crypto');var jsforce=require(_0x47ef('0xb'));var deskjs=require(_0x47ef('0xc'));var toCsv=require(_0x47ef('0x7'));var querystring=require(_0x47ef('0xd'));var Papa=require(_0x47ef('0xe'));var Redis=require(_0x47ef('0xf'));var authService=require(_0x47ef('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x47ef('0x11'));var hardwareService=require(_0x47ef('0x12'));var logger=require(_0x47ef('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x47ef('0x14'));var licenseUtil=require(_0x47ef('0x15'));var db=require('../../mysqldb')['db'];config[_0x47ef('0x16')]=_[_0x47ef('0x17')](config[_0x47ef('0x16')],{'host':_0x47ef('0x18'),'port':0x18eb});var socket=require(_0x47ef('0x19'))(new Redis(config[_0x47ef('0x16')]));require('./faxMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x47ef('0x1a')][_0x47ef('0x1b')]({'port':0x232c});var client9002=jayson[_0x47ef('0x1a')][_0x47ef('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x25dc8e,_0x1cb706,_0x22c25c,_0x231860){return new BPromise(function(_0x53ebab,_0x6ff28f){var _0x5e7ee8=_0x231860||client;return _0x5e7ee8['request'](_0x25dc8e,_0x22c25c)['then'](function(_0x5e4371){logger['info'](_0x47ef('0x1c'),_0x1cb706,'request\x20sent');logger[_0x47ef('0x1d')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x1cb706,_0x47ef('0x1e'),JSON[_0x47ef('0x1f')](_0x5e4371));if(_0x5e4371[_0x47ef('0x20')]){if(_0x5e4371[_0x47ef('0x20')]['code']===0x1f4){logger[_0x47ef('0x20')]('FaxMessage,\x20%s,\x20%s',_0x1cb706,_0x5e4371[_0x47ef('0x20')][_0x47ef('0x21')]);return _0x6ff28f(_0x5e4371[_0x47ef('0x20')][_0x47ef('0x21')]);}logger[_0x47ef('0x20')](_0x47ef('0x1c'),_0x1cb706,_0x5e4371['error'][_0x47ef('0x21')]);return _0x53ebab(_0x5e4371[_0x47ef('0x20')]['message']);}else{logger[_0x47ef('0x22')](_0x47ef('0x1c'),_0x1cb706,'request\x20sent');_0x53ebab(_0x5e4371[_0x47ef('0x23')][_0x47ef('0x21')]);}})[_0x47ef('0x24')](function(_0x4df640){logger[_0x47ef('0x20')](_0x47ef('0x1c'),_0x1cb706,_0x4df640);_0x6ff28f(_0x4df640);});});}function respondWithStatusCode(_0x17da48,_0x227944){_0x227944=_0x227944||0xcc;return function(_0x57e407){if(_0x57e407){return _0x17da48[_0x47ef('0x25')](_0x227944);}return _0x17da48[_0x47ef('0x26')](_0x227944)['end']();};}function respondWithResult(_0x3a341d,_0x19664b){_0x19664b=_0x19664b||0xc8;return function(_0x24e943){if(_0x24e943){return _0x3a341d[_0x47ef('0x26')](_0x19664b)['json'](_0x24e943);}};}function respondWithFilteredResult(_0x2222d3,_0x41195f){return function(_0x389274){if(_0x389274){var _0x333916=typeof _0x41195f['offset']===_0x47ef('0x27')&&typeof _0x41195f[_0x47ef('0x28')]===_0x47ef('0x27');var _0x41a2af=_0x389274[_0x47ef('0x29')];var _0x3c5770=_0x333916?0x0:_0x41195f['offset'];var _0x349cda=_0x333916?_0x389274['count']:_0x41195f[_0x47ef('0x2a')]+_0x41195f['limit'];var _0x1e49da;if(_0x349cda>=_0x41a2af){_0x349cda=_0x41a2af;_0x1e49da=0xc8;}else{_0x1e49da=0xce;}_0x2222d3[_0x47ef('0x26')](_0x1e49da);return _0x2222d3['set']('Content-Range',_0x3c5770+'-'+_0x349cda+'/'+_0x41a2af)['json'](_0x389274);}return null;};}function patchUpdates(_0xd0efca){return function(_0x35fb81){try{jsonpatch['apply'](_0x35fb81,_0xd0efca,!![]);}catch(_0x8f3485){return BPromise[_0x47ef('0x2b')](_0x8f3485);}return _0x35fb81[_0x47ef('0x2c')]();};}function saveUpdates(_0x9dbd3f,_0x5565fc){return function(_0x147279){if(_0x147279){return _0x147279[_0x47ef('0x2d')](_0x9dbd3f)[_0x47ef('0x2e')](function(_0x824bde){return _0x824bde;});}return null;};}function removeEntity(_0x4132d8,_0x2b4104){return function(_0x179363){if(_0x179363){return _0x179363[_0x47ef('0x2f')]()[_0x47ef('0x2e')](function(){_0x4132d8[_0x47ef('0x26')](0xcc)[_0x47ef('0x30')]();});}};}function handleEntityNotFound(_0x4b2634,_0x384871){return function(_0x55f2d4){if(!_0x55f2d4){_0x4b2634[_0x47ef('0x25')](0x194);}return _0x55f2d4;};}function handleError(_0x2fa270,_0x1e8b43){_0x1e8b43=_0x1e8b43||0x1f4;return function(_0x7239ec){logger[_0x47ef('0x20')](_0x7239ec['stack']);if(_0x7239ec[_0x47ef('0x31')]){delete _0x7239ec[_0x47ef('0x31')];}_0x2fa270[_0x47ef('0x26')](_0x1e8b43)[_0x47ef('0x32')](_0x7239ec);};}exports['index']=function(_0x1abf23,_0x478139){var _0x4ab117={},_0x399efc={},_0x3368fc={'count':0x0,'rows':[]};var _0x142abe=_[_0x47ef('0x33')](db[_0x47ef('0x34')][_0x47ef('0x35')],function(_0x3a86de){return{'name':_0x3a86de[_0x47ef('0x36')],'type':_0x3a86de[_0x47ef('0x37')][_0x47ef('0x38')]};});_0x399efc['model']=_[_0x47ef('0x33')](_0x142abe,_0x47ef('0x31'));_0x399efc[_0x47ef('0x39')]=_[_0x47ef('0x3a')](_0x1abf23[_0x47ef('0x39')]);_0x399efc['filters']=_[_0x47ef('0x3b')](_0x399efc[_0x47ef('0x3c')],_0x399efc[_0x47ef('0x39')]);_0x4ab117[_0x47ef('0x3d')]=_[_0x47ef('0x3b')](_0x399efc[_0x47ef('0x3c')],qs[_0x47ef('0x3e')](_0x1abf23[_0x47ef('0x39')][_0x47ef('0x3e')]));_0x4ab117[_0x47ef('0x3d')]=_0x4ab117['attributes'][_0x47ef('0x3f')]?_0x4ab117['attributes']:_0x399efc[_0x47ef('0x3c')];if(!_0x1abf23[_0x47ef('0x39')][_0x47ef('0x40')](_0x47ef('0x41'))){_0x4ab117['limit']=qs[_0x47ef('0x28')](_0x1abf23[_0x47ef('0x39')][_0x47ef('0x28')]);_0x4ab117[_0x47ef('0x2a')]=qs[_0x47ef('0x2a')](_0x1abf23[_0x47ef('0x39')][_0x47ef('0x2a')]);}_0x4ab117[_0x47ef('0x42')]=qs[_0x47ef('0x43')](_0x1abf23[_0x47ef('0x39')][_0x47ef('0x43')]);_0x4ab117['where']=qs[_0x47ef('0x44')](_[_0x47ef('0x45')](_0x1abf23[_0x47ef('0x39')],_0x399efc[_0x47ef('0x44')]),_0x142abe);if(_0x1abf23[_0x47ef('0x39')][_0x47ef('0x46')]){_0x4ab117[_0x47ef('0x47')]=_[_0x47ef('0x48')](_0x4ab117[_0x47ef('0x47')],{'$or':_[_0x47ef('0x33')](_0x142abe,function(_0x22674a){if(_0x22674a['type']!==_0x47ef('0x49')){var _0x13b58a={};_0x13b58a[_0x22674a[_0x47ef('0x31')]]={'$like':'%'+_0x1abf23['query']['filter']+'%'};return _0x13b58a;}})});}_0x4ab117=_[_0x47ef('0x48')]({},_0x4ab117,_0x1abf23['options']);var _0x446445={'where':_0x4ab117[_0x47ef('0x47')]};return db[_0x47ef('0x34')][_0x47ef('0x29')](_0x446445)['then'](function(_0x17fb97){_0x3368fc['count']=_0x17fb97;if(_0x1abf23['query']['includeAll']){_0x4ab117['include']=[{'all':!![]}];}return db[_0x47ef('0x34')][_0x47ef('0x4a')](_0x4ab117);})[_0x47ef('0x2e')](function(_0x25fbb2){_0x3368fc[_0x47ef('0x4b')]=_0x25fbb2;return _0x3368fc;})[_0x47ef('0x2e')](respondWithFilteredResult(_0x478139,_0x4ab117))[_0x47ef('0x24')](handleError(_0x478139,null));};exports[_0x47ef('0x4c')]=function(_0x5a7e51,_0x58ab16){var _0x883f81={'raw':!![],'where':{'id':_0x5a7e51[_0x47ef('0x4d')]['id']}},_0x2c0912={};_0x2c0912[_0x47ef('0x3c')]=_[_0x47ef('0x3a')](db[_0x47ef('0x34')][_0x47ef('0x35')]);_0x2c0912[_0x47ef('0x39')]=_[_0x47ef('0x3a')](_0x5a7e51[_0x47ef('0x39')]);_0x2c0912[_0x47ef('0x44')]=_[_0x47ef('0x3b')](_0x2c0912[_0x47ef('0x3c')],_0x2c0912['query']);_0x883f81[_0x47ef('0x3d')]=_[_0x47ef('0x3b')](_0x2c0912[_0x47ef('0x3c')],qs[_0x47ef('0x3e')](_0x5a7e51[_0x47ef('0x39')][_0x47ef('0x3e')]));_0x883f81[_0x47ef('0x3d')]=_0x883f81['attributes'][_0x47ef('0x3f')]?_0x883f81[_0x47ef('0x3d')]:_0x2c0912[_0x47ef('0x3c')];if(_0x5a7e51[_0x47ef('0x39')][_0x47ef('0x4e')]){_0x883f81[_0x47ef('0x4f')]=[{'all':!![]}];}_0x883f81=_[_0x47ef('0x48')]({},_0x883f81,_0x5a7e51[_0x47ef('0x50')]);return db[_0x47ef('0x34')][_0x47ef('0x51')](_0x883f81)[_0x47ef('0x2e')](handleEntityNotFound(_0x58ab16,null))[_0x47ef('0x2e')](respondWithResult(_0x58ab16,null))['catch'](handleError(_0x58ab16,null));};exports['update']=function(_0x3d04e7,_0x192752){if(_0x3d04e7[_0x47ef('0x52')]['id']){delete _0x3d04e7['body']['id'];}return db[_0x47ef('0x34')][_0x47ef('0x51')]({'where':{'id':_0x3d04e7[_0x47ef('0x4d')]['id']}})[_0x47ef('0x2e')](handleEntityNotFound(_0x192752,null))['then'](saveUpdates(_0x3d04e7[_0x47ef('0x52')],null))['then'](respondWithResult(_0x192752,null))[_0x47ef('0x24')](handleError(_0x192752,null));};exports[_0x47ef('0x2f')]=function(_0x25d782,_0x31da92){return db[_0x47ef('0x34')][_0x47ef('0x51')]({'where':{'id':_0x25d782[_0x47ef('0x4d')]['id']}})[_0x47ef('0x2e')](handleEntityNotFound(_0x31da92,null))['then'](removeEntity(_0x31da92,null))['catch'](handleError(_0x31da92,null));};exports[_0x47ef('0x53')]=function(_0x4c6fbf,_0x4c8beb){return db[_0x47ef('0x34')][_0x47ef('0x53')]()['then'](respondWithResult(_0x4c8beb,null))['catch'](handleError(_0x4c8beb,null));};var interaction_log=require(_0x47ef('0x13'))(_0x47ef('0x54'));exports['accept']=function(_0x132689,_0x3e44af,_0x4e6b37){var _0x8f3771={'agent':{},'channel':'fax'};if(_0x132689['body']['id']){delete _0x132689[_0x47ef('0x52')]['id'];}_0x132689[_0x47ef('0x52')][_0x47ef('0x55')]=!![];_0x132689[_0x47ef('0x52')][_0x47ef('0x56')]=moment()['format'](_0x47ef('0x57'));_0x132689['body'][_0x47ef('0x58')]=_0x132689['body'][_0x47ef('0x58')]||_0x132689[_0x47ef('0x59')]['id'];_0x8f3771[_0x47ef('0x5a')]['id']=_0x132689[_0x47ef('0x52')]['UserId'];return db['FaxMessage'][_0x47ef('0x51')]({'where':{'id':_0x132689[_0x47ef('0x4d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3e44af,null))[_0x47ef('0x2e')](saveUpdates(_0x132689['body'],null))[_0x47ef('0x2e')](function(_0x38cb7f){if(_0x38cb7f){_0x8f3771[_0x47ef('0x21')]=_0x38cb7f['get']({'plain':!![]});return db['FaxInteraction'][_0x47ef('0x51')]({'where':{'id':_0x38cb7f[_0x47ef('0x5b')]}});}return null;})[_0x47ef('0x2e')](handleEntityNotFound(_0x3e44af,null))[_0x47ef('0x2e')](function(_0x534051){if(_0x534051){return _0x534051[_0x47ef('0x2d')]({'UserId':_0x132689['body'][_0x47ef('0x58')],'read1stAt':_[_0x47ef('0x5c')](_0x534051[_0x47ef('0x5d')])?moment()[_0x47ef('0x5e')](_0x47ef('0x57')):undefined});}return null;})[_0x47ef('0x2e')](function(_0x5a5f2a){if(_0x5a5f2a){_0x8f3771[_0x47ef('0x5f')]=_0x5a5f2a[_0x47ef('0x60')]({'plain':!![]});interaction_log[_0x47ef('0x22')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x132689[_0x47ef('0x59')]['id'],_0x132689['user']['name'],_0x132689['user'][_0x47ef('0x61')],_0x8f3771['interaction']['id'],_0x132689[_0x47ef('0x52')]?JSON[_0x47ef('0x1f')](_0x132689[_0x47ef('0x52')]):_0x47ef('0x62'));return respondWithRpcPromise(_0x47ef('0x63'),_0x47ef('0x64'),_0x8f3771);}return null;})[_0x47ef('0x2e')](function(_0x986e91){var _0x1387b5=_0x47ef('0x65')+_0x986e91['message']['ContactId'];return db[_0x47ef('0x66')][_0x47ef('0x39')](_0x1387b5,{'type':db['Sequelize'][_0x47ef('0x67')][_0x47ef('0x68')],'raw':!![]})[_0x47ef('0x2e')](function(_0x5099f5){return _0x5099f5;});})[_0x47ef('0x2e')](function(_0x2f947a){if(_0x2f947a){_0x8f3771[_0x47ef('0x21')][_0x47ef('0x69')]=_0x2f947a[0x0];if(!_0x132689['body'][_0x47ef('0x58')])return;return db[_0x47ef('0x6a')][_0x47ef('0x51')]({'where':{'id':_0x132689[_0x47ef('0x52')][_0x47ef('0x58')],'role':_0x47ef('0x5a')},'attributes':['id',_0x47ef('0x31'),_0x47ef('0x6b'),_0x47ef('0x6c'),_0x47ef('0x6d')],'raw':!![]});}return null;})['then'](function(_0x4ca974){if(!_0x4ca974)return null;_0x8f3771[_0x47ef('0x21')][_0x47ef('0x5a')]=_0x4ca974;return _0x8f3771;})[_0x47ef('0x2e')](function(_0x5a55de){if(_0x5a55de){if(_0x132689[_0x47ef('0x52')][_0x47ef('0x6e')]){_0x8f3771[_0x47ef('0x21')][_0x47ef('0x6f')]=util[_0x47ef('0x5e')]('SIP/%s',_0x132689[_0x47ef('0x59')]['name']);_0x8f3771['message']['channel']=_0x8f3771['channel'];_0x8f3771[_0x47ef('0x21')][_0x47ef('0x70')]=_0x8f3771[_0x47ef('0x71')];_0x8f3771[_0x47ef('0x21')][_0x47ef('0x72')]=_0x47ef('0x73');return respondWithRpcPromise('EventManager',_0x47ef('0x74'),{'event':_0x47ef('0x75'),'message':_0x8f3771['message']},client9002)[_0x47ef('0x2e')](function(){return _0x8f3771;});}return _0x8f3771;}return null;})[_0x47ef('0x2e')](respondWithResult(_0x3e44af,null))['catch'](handleError(_0x3e44af,null));};var interaction_log=require('../../config/logger')(_0x47ef('0x54'));exports[_0x47ef('0x2b')]=function(_0x769985,_0x3fa8fe,_0x215fc4){var _0x3f7dc4={'agent':{},'channel':_0x47ef('0x76')};if(_0x769985[_0x47ef('0x52')]['id']){delete _0x769985[_0x47ef('0x52')]['id'];}_0x769985[_0x47ef('0x52')]['UserId']=_0x769985[_0x47ef('0x52')][_0x47ef('0x58')]||_0x769985[_0x47ef('0x59')]['id'];_0x3f7dc4[_0x47ef('0x5a')]['id']=_0x769985[_0x47ef('0x52')][_0x47ef('0x58')];return db[_0x47ef('0x34')]['find']({'where':{'id':_0x769985['params']['id'],'UserId':null}})[_0x47ef('0x2e')](handleEntityNotFound(_0x3fa8fe,null))[_0x47ef('0x2e')](function(_0x429d35){if(_0x429d35){_0x3f7dc4[_0x47ef('0x21')]=_0x429d35[_0x47ef('0x60')]({'plain':!![]});return db['FaxInteraction'][_0x47ef('0x51')]({'where':{'id':_0x429d35[_0x47ef('0x5b')]}});}return null;})[_0x47ef('0x2e')](handleEntityNotFound(_0x3fa8fe,null))['then'](function(_0x70d6e6){if(_0x70d6e6){_0x3f7dc4['interaction']=_0x70d6e6[_0x47ef('0x60')]({'plain':!![]});interaction_log[_0x47ef('0x22')](_0x47ef('0x77'),_0x769985['user']['id'],_0x769985[_0x47ef('0x59')][_0x47ef('0x31')],_0x769985[_0x47ef('0x59')]['role'],_0x3f7dc4[_0x47ef('0x5f')]['id'],_0x769985[_0x47ef('0x52')]?JSON[_0x47ef('0x1f')](_0x769985[_0x47ef('0x52')]):'null');return respondWithRpcPromise(_0x47ef('0x78'),_0x47ef('0x79'),_0x3f7dc4);}return null;})['then'](function(_0x3fec44){var _0x5cbc72='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3fec44[_0x47ef('0x21')][_0x47ef('0x7a')];return db[_0x47ef('0x66')][_0x47ef('0x39')](_0x5cbc72,{'type':db[_0x47ef('0x7b')][_0x47ef('0x67')][_0x47ef('0x68')],'raw':!![]})[_0x47ef('0x2e')](function(_0x94eda7){return _0x94eda7;});})[_0x47ef('0x2e')](function(_0x2d2ab5){if(_0x2d2ab5){_0x3f7dc4['message'][_0x47ef('0x69')]=_0x2d2ab5[0x0];if(!_0x769985[_0x47ef('0x52')][_0x47ef('0x58')])return;return db[_0x47ef('0x6a')][_0x47ef('0x51')]({'where':{'id':_0x769985[_0x47ef('0x52')][_0x47ef('0x58')],'role':_0x47ef('0x5a')},'attributes':['id',_0x47ef('0x31'),_0x47ef('0x6b'),_0x47ef('0x6c'),_0x47ef('0x6d')],'raw':!![]});}return null;})[_0x47ef('0x2e')](function(_0x2790a3){if(!_0x2790a3)return null;_0x3f7dc4[_0x47ef('0x21')][_0x47ef('0x5a')]=_0x2790a3;return _0x3f7dc4;})[_0x47ef('0x2e')](function(_0x4ea6ff){if(_0x4ea6ff){_0x4ea6ff[_0x47ef('0x21')][_0x47ef('0x6f')]=util['format'](_0x47ef('0x7c'),_0x769985[_0x47ef('0x59')][_0x47ef('0x31')]);_0x4ea6ff[_0x47ef('0x21')][_0x47ef('0x71')]=_0x3f7dc4[_0x47ef('0x71')];_0x4ea6ff[_0x47ef('0x21')]['motionChannel']=_0x3f7dc4[_0x47ef('0x71')];_0x4ea6ff[_0x47ef('0x21')][_0x47ef('0x72')]='reject';respondWithRpcPromise('EventManager',_0x47ef('0x74'),{'event':_0x47ef('0x7d'),'message':_0x4ea6ff[_0x47ef('0x21')]},client9002);return _0x3f7dc4;}return null;})[_0x47ef('0x2e')](respondWithResult(_0x3fa8fe,null))['catch'](handleError(_0x3fa8fe,null));};exports[_0x47ef('0x7e')]=function(_0x27dc2c,_0x4e0425){var _0x54efe9;return db[_0x47ef('0x34')][_0x47ef('0x7e')](_0x27dc2c[_0x47ef('0x52')],{})[_0x47ef('0x2e')](function(_0xb3c5a5){_0x54efe9=_0xb3c5a5;return db[_0x47ef('0x7f')][_0x47ef('0x80')]({'where':{'id':_0x54efe9[_0x47ef('0x7a')]}});})[_0x47ef('0x2e')](function(_0x3dc0ed){if(_[_0x47ef('0x5c')](_0x3dc0ed)){return;}else{_0x54efe9[_0x47ef('0x76')]=_0x3dc0ed[_0x47ef('0x76')];return db[_0x47ef('0x81')][_0x47ef('0x80')]({'where':{'id':_0x54efe9[_0x47ef('0x82')]}});}})[_0x47ef('0x2e')](function(_0xca5a9d){return respondWithRpcPromise('SendFax',_0x47ef('0x83'),{'FaxAccountId':_[_0x47ef('0x5c')](_0x27dc2c[_0x47ef('0x52')])?undefined:_0x27dc2c[_0x47ef('0x52')][_0x47ef('0x84')],'path':_[_0x47ef('0x5c')](_0xca5a9d)?undefined:util[_0x47ef('0x5e')](_0x47ef('0x85'),_0xca5a9d[_0x47ef('0x86')]),'fax':_[_0x47ef('0x5c')](_0x54efe9['fax'])?undefined:_0x54efe9[_0x47ef('0x76')],'AttachmentId':_0x54efe9['AttachmentId']},client9002);})[_0x47ef('0x2e')](respondWithResult(_0x4e0425,0xc9))['catch'](handleError(_0x4e0425,null));};exports[_0x47ef('0x87')]=function(_0x116c04,_0x219d08){var _0x38785a=path[_0x47ef('0x88')](config[_0x47ef('0x89')],_0x47ef('0x8a'),_0x47ef('0x8b'),_0x47ef('0x8c'));return db[_0x47ef('0x34')]['find']({'where':{'id':_0x116c04[_0x47ef('0x4d')]['id']},'include':[{'model':db[_0x47ef('0x81')],'as':'Attachment'}]})[_0x47ef('0x2e')](handleEntityNotFound(_0x219d08,null))[_0x47ef('0x2e')](function(_0x5b15dc){if(_0x5b15dc){return _0x219d08['download'](path[_0x47ef('0x88')](_0x38785a,_0x5b15dc['Attachment'][_0x47ef('0x86')]));}})[_0x47ef('0x24')](handleError(_0x219d08,null));}; \ No newline at end of file +var _0x1270=['SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','fax','RejectMessage','rejectMessage','ContactId','internal','rejectmessage','create','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','root','server','files','attachments','Attachment','join','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','send','map','FaxMessage','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','VIRTUAL','filter','options','includeAll','rows','show','params','rawAttributes','merge','find','body','describe','fax-interactions','accept','readAt','format','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes'];(function(_0x4c17c,_0x57d67f){var _0xb4a102=function(_0x178761){while(--_0x178761){_0x4c17c['push'](_0x4c17c['shift']());}};_0xb4a102(++_0x57d67f);}(_0x1270,0x1c4));var _0x0127=function(_0x403bd4,_0x49241f){_0x403bd4=_0x403bd4-0x0;var _0xac94e6=_0x1270[_0x403bd4];return _0xac94e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0127('0x0'));var zipdir=require(_0x0127('0x1'));var jsonpatch=require(_0x0127('0x2'));var rp=require(_0x0127('0x3'));var moment=require('moment');var BPromise=require(_0x0127('0x4'));var Mustache=require(_0x0127('0x5'));var util=require(_0x0127('0x6'));var path=require(_0x0127('0x7'));var sox=require(_0x0127('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0127('0x9'));var squel=require(_0x0127('0xa'));var crypto=require(_0x0127('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0127('0xc'));var querystring=require(_0x0127('0xd'));var Papa=require(_0x0127('0xe'));var Redis=require(_0x0127('0xf'));var authService=require(_0x0127('0x10'));var qs=require(_0x0127('0x11'));var as=require(_0x0127('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0127('0x13'))('api');var utils=require(_0x0127('0x14'));var config=require(_0x0127('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0127('0x16'))['db'];config['redis']=_[_0x0127('0x17')](config[_0x0127('0x18')],{'host':_0x0127('0x19'),'port':0x18eb});var socket=require(_0x0127('0x1a'))(new Redis(config['redis']));require('./faxMessage.socket')[_0x0127('0x1b')](socket);var jayson=require(_0x0127('0x1c'));var client=jayson['client'][_0x0127('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23cb86,_0x437944,_0x119a19,_0x29dc77){return new BPromise(function(_0xf85558,_0x481991){var _0x3a4f06=_0x29dc77||client;return _0x3a4f06[_0x0127('0x1e')](_0x23cb86,_0x119a19)[_0x0127('0x1f')](function(_0x2bab78){logger['info'](_0x0127('0x20'),_0x437944,_0x0127('0x21'));logger['debug'](_0x0127('0x22'),_0x437944,_0x0127('0x21'),JSON['stringify'](_0x2bab78));if(_0x2bab78[_0x0127('0x23')]){if(_0x2bab78[_0x0127('0x23')][_0x0127('0x24')]===0x1f4){logger[_0x0127('0x23')]('FaxMessage,\x20%s,\x20%s',_0x437944,_0x2bab78[_0x0127('0x23')]['message']);return _0x481991(_0x2bab78[_0x0127('0x23')][_0x0127('0x25')]);}logger['error'](_0x0127('0x20'),_0x437944,_0x2bab78['error']['message']);return _0xf85558(_0x2bab78[_0x0127('0x23')][_0x0127('0x25')]);}else{logger[_0x0127('0x26')]('FaxMessage,\x20%s,\x20%s',_0x437944,_0x0127('0x21'));_0xf85558(_0x2bab78[_0x0127('0x27')][_0x0127('0x25')]);}})[_0x0127('0x28')](function(_0x339a25){logger[_0x0127('0x23')](_0x0127('0x20'),_0x437944,_0x339a25);_0x481991(_0x339a25);});});}function respondWithStatusCode(_0x48e394,_0xa6585a){_0xa6585a=_0xa6585a||0xcc;return function(_0x49c881){if(_0x49c881){return _0x48e394['sendStatus'](_0xa6585a);}return _0x48e394['status'](_0xa6585a)['end']();};}function respondWithResult(_0x327501,_0x3cc380){_0x3cc380=_0x3cc380||0xc8;return function(_0x28b56c){if(_0x28b56c){return _0x327501[_0x0127('0x29')](_0x3cc380)[_0x0127('0x2a')](_0x28b56c);}};}function respondWithFilteredResult(_0x98e119,_0x389f91){return function(_0xc087a6){if(_0xc087a6){var _0x1564ed=typeof _0x389f91[_0x0127('0x2b')]===_0x0127('0x2c')&&typeof _0x389f91[_0x0127('0x2d')]==='undefined';var _0x3de507=_0xc087a6[_0x0127('0x2e')];var _0x2c86a2=_0x1564ed?0x0:_0x389f91[_0x0127('0x2b')];var _0x1bed4b=_0x1564ed?_0xc087a6[_0x0127('0x2e')]:_0x389f91[_0x0127('0x2b')]+_0x389f91[_0x0127('0x2d')];var _0x2d77c7;if(_0x1bed4b>=_0x3de507){_0x1bed4b=_0x3de507;_0x2d77c7=0xc8;}else{_0x2d77c7=0xce;}_0x98e119[_0x0127('0x29')](_0x2d77c7);return _0x98e119[_0x0127('0x2f')](_0x0127('0x30'),_0x2c86a2+'-'+_0x1bed4b+'/'+_0x3de507)[_0x0127('0x2a')](_0xc087a6);}return null;};}function patchUpdates(_0x24197f){return function(_0x10505e){try{jsonpatch['apply'](_0x10505e,_0x24197f,!![]);}catch(_0x360fa8){return BPromise[_0x0127('0x31')](_0x360fa8);}return _0x10505e[_0x0127('0x32')]();};}function saveUpdates(_0x361ab3,_0x355303){return function(_0x223a42){if(_0x223a42){return _0x223a42[_0x0127('0x33')](_0x361ab3)[_0x0127('0x1f')](function(_0x499e4c){return _0x499e4c;});}return null;};}function removeEntity(_0x44397f,_0x233924){return function(_0x329150){if(_0x329150){return _0x329150[_0x0127('0x34')]()[_0x0127('0x1f')](function(){_0x44397f[_0x0127('0x29')](0xcc)[_0x0127('0x35')]();});}};}function handleEntityNotFound(_0x28f1eb,_0x57d13f){return function(_0x49c961){if(!_0x49c961){_0x28f1eb[_0x0127('0x36')](0x194);}return _0x49c961;};}function handleError(_0x427878,_0x4d8468){_0x4d8468=_0x4d8468||0x1f4;return function(_0x51ccfa){logger['error'](_0x51ccfa[_0x0127('0x37')]);if(_0x51ccfa[_0x0127('0x38')]){delete _0x51ccfa['name'];}_0x427878[_0x0127('0x29')](_0x4d8468)[_0x0127('0x39')](_0x51ccfa);};}exports['index']=function(_0xc74033,_0x3eafc9){var _0x26c98e={},_0x1cf1e2={},_0x269474={'count':0x0,'rows':[]};var _0x3e963b=_[_0x0127('0x3a')](db[_0x0127('0x3b')]['rawAttributes'],function(_0x54a6c5){return{'name':_0x54a6c5[_0x0127('0x3c')],'type':_0x54a6c5[_0x0127('0x3d')][_0x0127('0x3e')]};});_0x1cf1e2[_0x0127('0x3f')]=_[_0x0127('0x3a')](_0x3e963b,_0x0127('0x38'));_0x1cf1e2[_0x0127('0x40')]=_[_0x0127('0x41')](_0xc74033[_0x0127('0x40')]);_0x1cf1e2[_0x0127('0x42')]=_[_0x0127('0x43')](_0x1cf1e2['model'],_0x1cf1e2[_0x0127('0x40')]);_0x26c98e['attributes']=_[_0x0127('0x43')](_0x1cf1e2[_0x0127('0x3f')],qs['fields'](_0xc74033[_0x0127('0x40')][_0x0127('0x44')]));_0x26c98e[_0x0127('0x45')]=_0x26c98e[_0x0127('0x45')][_0x0127('0x46')]?_0x26c98e[_0x0127('0x45')]:_0x1cf1e2[_0x0127('0x3f')];if(!_0xc74033[_0x0127('0x40')]['hasOwnProperty'](_0x0127('0x47'))){_0x26c98e[_0x0127('0x2d')]=qs[_0x0127('0x2d')](_0xc74033['query']['limit']);_0x26c98e[_0x0127('0x2b')]=qs[_0x0127('0x2b')](_0xc74033[_0x0127('0x40')][_0x0127('0x2b')]);}_0x26c98e[_0x0127('0x48')]=qs[_0x0127('0x49')](_0xc74033[_0x0127('0x40')]['sort']);_0x26c98e[_0x0127('0x4a')]=qs['filters'](_['pick'](_0xc74033[_0x0127('0x40')],_0x1cf1e2[_0x0127('0x42')]),_0x3e963b);if(_0xc74033[_0x0127('0x40')]['filter']){_0x26c98e[_0x0127('0x4a')]=_['merge'](_0x26c98e['where'],{'$or':_[_0x0127('0x3a')](_0x3e963b,function(_0x1e965c){if(_0x1e965c[_0x0127('0x3d')]!==_0x0127('0x4b')){var _0x1725f5={};_0x1725f5[_0x1e965c[_0x0127('0x38')]]={'$like':'%'+_0xc74033[_0x0127('0x40')][_0x0127('0x4c')]+'%'};return _0x1725f5;}})});}_0x26c98e=_['merge']({},_0x26c98e,_0xc74033[_0x0127('0x4d')]);var _0x51eb07={'where':_0x26c98e['where']};return db[_0x0127('0x3b')]['count'](_0x51eb07)[_0x0127('0x1f')](function(_0x418b2e){_0x269474[_0x0127('0x2e')]=_0x418b2e;if(_0xc74033[_0x0127('0x40')][_0x0127('0x4e')]){_0x26c98e['include']=[{'all':!![]}];}return db[_0x0127('0x3b')]['findAll'](_0x26c98e);})[_0x0127('0x1f')](function(_0x3d2ecf){_0x269474[_0x0127('0x4f')]=_0x3d2ecf;return _0x269474;})[_0x0127('0x1f')](respondWithFilteredResult(_0x3eafc9,_0x26c98e))[_0x0127('0x28')](handleError(_0x3eafc9,null));};exports[_0x0127('0x50')]=function(_0x51cd77,_0x510760){var _0x12c6bf={'raw':!![],'where':{'id':_0x51cd77[_0x0127('0x51')]['id']}},_0x339414={};_0x339414['model']=_['keys'](db[_0x0127('0x3b')][_0x0127('0x52')]);_0x339414[_0x0127('0x40')]=_[_0x0127('0x41')](_0x51cd77['query']);_0x339414[_0x0127('0x42')]=_['intersection'](_0x339414[_0x0127('0x3f')],_0x339414[_0x0127('0x40')]);_0x12c6bf[_0x0127('0x45')]=_['intersection'](_0x339414[_0x0127('0x3f')],qs[_0x0127('0x44')](_0x51cd77[_0x0127('0x40')]['fields']));_0x12c6bf[_0x0127('0x45')]=_0x12c6bf[_0x0127('0x45')][_0x0127('0x46')]?_0x12c6bf[_0x0127('0x45')]:_0x339414[_0x0127('0x3f')];if(_0x51cd77[_0x0127('0x40')][_0x0127('0x4e')]){_0x12c6bf['include']=[{'all':!![]}];}_0x12c6bf=_[_0x0127('0x53')]({},_0x12c6bf,_0x51cd77[_0x0127('0x4d')]);return db[_0x0127('0x3b')][_0x0127('0x54')](_0x12c6bf)[_0x0127('0x1f')](handleEntityNotFound(_0x510760,null))[_0x0127('0x1f')](respondWithResult(_0x510760,null))[_0x0127('0x28')](handleError(_0x510760,null));};exports['update']=function(_0x3cc8f1,_0x1ddfff){if(_0x3cc8f1[_0x0127('0x55')]['id']){delete _0x3cc8f1['body']['id'];}return db['FaxMessage']['find']({'where':{'id':_0x3cc8f1['params']['id']}})['then'](handleEntityNotFound(_0x1ddfff,null))['then'](saveUpdates(_0x3cc8f1[_0x0127('0x55')],null))[_0x0127('0x1f')](respondWithResult(_0x1ddfff,null))[_0x0127('0x28')](handleError(_0x1ddfff,null));};exports[_0x0127('0x34')]=function(_0x39c964,_0x485eaa){return db[_0x0127('0x3b')]['find']({'where':{'id':_0x39c964[_0x0127('0x51')]['id']}})[_0x0127('0x1f')](handleEntityNotFound(_0x485eaa,null))['then'](removeEntity(_0x485eaa,null))[_0x0127('0x28')](handleError(_0x485eaa,null));};exports[_0x0127('0x56')]=function(_0x4c6203,_0x3f5702){return db[_0x0127('0x3b')][_0x0127('0x56')]()['then'](respondWithResult(_0x3f5702,null))['catch'](handleError(_0x3f5702,null));};var interaction_log=require(_0x0127('0x13'))(_0x0127('0x57'));exports[_0x0127('0x58')]=function(_0x56c182,_0x346fe8,_0x41db0c){var _0x1ef07b={'agent':{},'channel':'fax'};if(_0x56c182[_0x0127('0x55')]['id']){delete _0x56c182[_0x0127('0x55')]['id'];}_0x56c182[_0x0127('0x55')]['read']=!![];_0x56c182['body'][_0x0127('0x59')]=moment()[_0x0127('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x56c182[_0x0127('0x55')][_0x0127('0x5b')]=_0x56c182[_0x0127('0x55')][_0x0127('0x5b')]||_0x56c182[_0x0127('0x5c')]['id'];_0x1ef07b[_0x0127('0x5d')]['id']=_0x56c182[_0x0127('0x55')][_0x0127('0x5b')];return db[_0x0127('0x3b')][_0x0127('0x54')]({'where':{'id':_0x56c182[_0x0127('0x51')]['id'],'UserId':null}})[_0x0127('0x1f')](handleEntityNotFound(_0x346fe8,null))[_0x0127('0x1f')](saveUpdates(_0x56c182[_0x0127('0x55')],null))['then'](function(_0x17b3fc){if(_0x17b3fc){_0x1ef07b[_0x0127('0x25')]=_0x17b3fc[_0x0127('0x5e')]({'plain':!![]});return db[_0x0127('0x5f')][_0x0127('0x54')]({'where':{'id':_0x17b3fc[_0x0127('0x60')]}});}return null;})[_0x0127('0x1f')](handleEntityNotFound(_0x346fe8,null))['then'](function(_0x236a62){if(_0x236a62){return _0x236a62[_0x0127('0x33')]({'UserId':_0x56c182[_0x0127('0x55')][_0x0127('0x5b')],'read1stAt':_[_0x0127('0x61')](_0x236a62[_0x0127('0x62')])?moment()[_0x0127('0x5a')](_0x0127('0x63')):undefined});}return null;})[_0x0127('0x1f')](function(_0x58cf8b){if(_0x58cf8b){_0x1ef07b[_0x0127('0x64')]=_0x58cf8b['get']({'plain':!![]});interaction_log[_0x0127('0x26')](_0x0127('0x65'),_0x56c182[_0x0127('0x5c')]['id'],_0x56c182[_0x0127('0x5c')][_0x0127('0x38')],_0x56c182[_0x0127('0x5c')][_0x0127('0x66')],_0x1ef07b[_0x0127('0x64')]['id'],_0x56c182[_0x0127('0x55')]?JSON[_0x0127('0x67')](_0x56c182[_0x0127('0x55')]):_0x0127('0x68'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x1ef07b);}return null;})[_0x0127('0x1f')](function(_0x2891bf){var _0x391e54=_0x0127('0x69')+_0x2891bf[_0x0127('0x25')]['ContactId'];return db['sequelize'][_0x0127('0x40')](_0x391e54,{'type':db[_0x0127('0x6a')][_0x0127('0x6b')][_0x0127('0x6c')],'raw':!![]})[_0x0127('0x1f')](function(_0x17a018){return _0x17a018;});})[_0x0127('0x1f')](function(_0x4265c7){if(_0x4265c7){_0x1ef07b[_0x0127('0x25')][_0x0127('0x6d')]=_0x4265c7[0x0];if(!_0x56c182['body']['UserId'])return;return db[_0x0127('0x6e')][_0x0127('0x54')]({'where':{'id':_0x56c182[_0x0127('0x55')]['UserId'],'role':_0x0127('0x5d')},'attributes':['id',_0x0127('0x38'),_0x0127('0x6f'),_0x0127('0x70'),'internal'],'raw':!![]});}return null;})[_0x0127('0x1f')](function(_0x405c00){if(!_0x405c00)return null;_0x1ef07b[_0x0127('0x25')][_0x0127('0x5d')]=_0x405c00;return _0x1ef07b;})['then'](function(_0x1bdf2c){if(_0x1bdf2c){if(_0x56c182[_0x0127('0x55')][_0x0127('0x71')]){_0x1ef07b[_0x0127('0x25')][_0x0127('0x72')]=util['format'](_0x0127('0x73'),_0x56c182[_0x0127('0x5c')]['name']);_0x1ef07b[_0x0127('0x25')][_0x0127('0x74')]=_0x1ef07b[_0x0127('0x74')];_0x1ef07b['message'][_0x0127('0x75')]=_0x1ef07b[_0x0127('0x74')];_0x1ef07b[_0x0127('0x25')][_0x0127('0x76')]=_0x0127('0x58');return respondWithRpcPromise('EventManager',_0x0127('0x77'),{'event':_0x0127('0x78'),'message':_0x1ef07b[_0x0127('0x25')]},client9002)[_0x0127('0x1f')](function(){return _0x1ef07b;});}return _0x1ef07b;}return null;})[_0x0127('0x1f')](respondWithResult(_0x346fe8,null))[_0x0127('0x28')](handleError(_0x346fe8,null));};var interaction_log=require(_0x0127('0x13'))(_0x0127('0x57'));exports['reject']=function(_0x401f0f,_0xfaa06f,_0xe127b9){var _0x14d5d7={'agent':{},'channel':_0x0127('0x79')};if(_0x401f0f[_0x0127('0x55')]['id']){delete _0x401f0f[_0x0127('0x55')]['id'];}_0x401f0f['body'][_0x0127('0x5b')]=_0x401f0f['body'][_0x0127('0x5b')]||_0x401f0f[_0x0127('0x5c')]['id'];_0x14d5d7[_0x0127('0x5d')]['id']=_0x401f0f[_0x0127('0x55')][_0x0127('0x5b')];return db[_0x0127('0x3b')][_0x0127('0x54')]({'where':{'id':_0x401f0f[_0x0127('0x51')]['id'],'UserId':null}})[_0x0127('0x1f')](handleEntityNotFound(_0xfaa06f,null))[_0x0127('0x1f')](function(_0x5205ae){if(_0x5205ae){_0x14d5d7[_0x0127('0x25')]=_0x5205ae[_0x0127('0x5e')]({'plain':!![]});return db[_0x0127('0x5f')]['find']({'where':{'id':_0x5205ae[_0x0127('0x60')]}});}return null;})[_0x0127('0x1f')](handleEntityNotFound(_0xfaa06f,null))[_0x0127('0x1f')](function(_0x393a09){if(_0x393a09){_0x14d5d7[_0x0127('0x64')]=_0x393a09['get']({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x401f0f[_0x0127('0x5c')]['id'],_0x401f0f[_0x0127('0x5c')]['name'],_0x401f0f[_0x0127('0x5c')]['role'],_0x14d5d7[_0x0127('0x64')]['id'],_0x401f0f[_0x0127('0x55')]?JSON['stringify'](_0x401f0f[_0x0127('0x55')]):_0x0127('0x68'));return respondWithRpcPromise(_0x0127('0x7a'),_0x0127('0x7b'),_0x14d5d7);}return null;})[_0x0127('0x1f')](function(_0x3cbfcc){var _0x122c04=_0x0127('0x69')+_0x3cbfcc[_0x0127('0x25')][_0x0127('0x7c')];return db['sequelize'][_0x0127('0x40')](_0x122c04,{'type':db[_0x0127('0x6a')][_0x0127('0x6b')]['SELECT'],'raw':!![]})['then'](function(_0x21fb1f){return _0x21fb1f;});})[_0x0127('0x1f')](function(_0x3bb09a){if(_0x3bb09a){_0x14d5d7[_0x0127('0x25')]['contact']=_0x3bb09a[0x0];if(!_0x401f0f['body'][_0x0127('0x5b')])return;return db[_0x0127('0x6e')][_0x0127('0x54')]({'where':{'id':_0x401f0f[_0x0127('0x55')]['UserId'],'role':'agent'},'attributes':['id',_0x0127('0x38'),_0x0127('0x6f'),_0x0127('0x70'),_0x0127('0x7d')],'raw':!![]});}return null;})[_0x0127('0x1f')](function(_0x19ed44){if(!_0x19ed44)return null;_0x14d5d7['message'][_0x0127('0x5d')]=_0x19ed44;return _0x14d5d7;})[_0x0127('0x1f')](function(_0x28c9ae){if(_0x28c9ae){_0x28c9ae[_0x0127('0x25')][_0x0127('0x72')]=util[_0x0127('0x5a')](_0x0127('0x73'),_0x401f0f['user'][_0x0127('0x38')]);_0x28c9ae[_0x0127('0x25')][_0x0127('0x74')]=_0x14d5d7['channel'];_0x28c9ae[_0x0127('0x25')][_0x0127('0x75')]=_0x14d5d7[_0x0127('0x74')];_0x28c9ae[_0x0127('0x25')][_0x0127('0x76')]=_0x0127('0x31');respondWithRpcPromise(_0x0127('0x77'),_0x0127('0x77'),{'event':_0x0127('0x7e'),'message':_0x28c9ae[_0x0127('0x25')]},client9002);return _0x14d5d7;}return null;})[_0x0127('0x1f')](respondWithResult(_0xfaa06f,null))['catch'](handleError(_0xfaa06f,null));};exports[_0x0127('0x7f')]=function(_0x20899d,_0x9b2a5){var _0x5559cc;return db[_0x0127('0x3b')]['create'](_0x20899d[_0x0127('0x55')],{})['then'](function(_0x55fcaf){_0x5559cc=_0x55fcaf;return db['CmContact']['findOne']({'where':{'id':_0x5559cc['ContactId']}});})[_0x0127('0x1f')](function(_0x4a4f4c){if(_[_0x0127('0x61')](_0x4a4f4c)){return;}else{_0x5559cc['fax']=_0x4a4f4c[_0x0127('0x79')];return db['Attachment']['findOne']({'where':{'id':_0x5559cc[_0x0127('0x80')]}});}})['then'](function(_0x34c2ad){return respondWithRpcPromise(_0x0127('0x81'),_0x0127('0x81'),{'FaxAccountId':_[_0x0127('0x61')](_0x20899d[_0x0127('0x55')])?undefined:_0x20899d[_0x0127('0x55')][_0x0127('0x82')],'path':_[_0x0127('0x61')](_0x34c2ad)?undefined:util[_0x0127('0x5a')](_0x0127('0x83'),_0x34c2ad[_0x0127('0x84')]),'fax':_[_0x0127('0x61')](_0x5559cc[_0x0127('0x79')])?undefined:_0x5559cc[_0x0127('0x79')],'AttachmentId':_0x5559cc['AttachmentId']},client9002);})['then'](respondWithResult(_0x9b2a5,0xc9))[_0x0127('0x28')](handleError(_0x9b2a5,null));};exports[_0x0127('0x85')]=function(_0xb716b5,_0x59cbd4){var _0x593420=path['join'](config[_0x0127('0x86')],_0x0127('0x87'),_0x0127('0x88'),_0x0127('0x89'));return db[_0x0127('0x3b')][_0x0127('0x54')]({'where':{'id':_0xb716b5[_0x0127('0x51')]['id']},'include':[{'model':db[_0x0127('0x8a')],'as':'Attachment'}]})[_0x0127('0x1f')](handleEntityNotFound(_0x59cbd4,null))[_0x0127('0x1f')](function(_0x271097){if(_0x271097){return _0x59cbd4[_0x0127('0x85')](path[_0x0127('0x8b')](_0x593420,_0x271097[_0x0127('0x8a')]['basename']));}})[_0x0127('0x28')](handleError(_0x59cbd4,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 64698e6..3818330 100644 --- a/server/api/faxMessage/faxMessage.events.js +++ b/server/api/faxMessage/faxMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fd6=['FaxMessage','setMaxListeners','save','update','remove','hook','exports','events'];(function(_0x2a4b15,_0x3570ab){var _0xf4b56=function(_0x79bac3){while(--_0x79bac3){_0x2a4b15['push'](_0x2a4b15['shift']());}};_0xf4b56(++_0x3570ab);}(_0x7fd6,0x157));var _0x67fd=function(_0xc2e28,_0x2ffa5b){_0xc2e28=_0xc2e28-0x0;var _0x4b3925=_0x7fd6[_0xc2e28];return _0x4b3925;};'use strict';var EventEmitter=require(_0x67fd('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x67fd('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x67fd('0x2')](0x0);var events={'afterCreate':_0x67fd('0x3'),'afterUpdate':_0x67fd('0x4'),'afterDestroy':_0x67fd('0x5')};function emitEvent(_0xbdd0c0){return function(_0x4f52bc,_0x187f3e,_0x50238d){FaxMessageEvents['emit'](_0xbdd0c0+':'+_0x4f52bc['id'],_0x4f52bc);FaxMessageEvents['emit'](_0xbdd0c0,_0x4f52bc);_0x50238d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x67fd('0x6')](e,emitEvent(event));}}module[_0x67fd('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0x980e=['hook','exports','events','setMaxListeners','update','emit'];(function(_0x34f2ca,_0x3d7730){var _0x35d9fe=function(_0x3f4a90){while(--_0x3f4a90){_0x34f2ca['push'](_0x34f2ca['shift']());}};_0x35d9fe(++_0x3d7730);}(_0x980e,0x1a6));var _0xe980=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x980e[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xe980('0x0'));var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xe980('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe980('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2e82ea){return function(_0x274b04,_0x599c53,_0x4eb599){FaxMessageEvents[_0xe980('0x3')](_0x2e82ea+':'+_0x274b04['id'],_0x274b04);FaxMessageEvents['emit'](_0x2e82ea,_0x274b04);_0x4eb599(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xe980('0x4')](e,emitEvent(event));}}module[_0xe980('0x5')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 553b0c2..25c2405 100644 --- a/server/api/faxMessage/faxMessage.model.js +++ b/server/api/faxMessage/faxMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2638=['then','createdAt','toLowerCase','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','define','FaxMessage','fti_fax_messages','body','FULLTEXT','get','direction','out','secret','isNil','UserId','FaxInteractionId'];(function(_0xc47422,_0x4d1274){var _0x4fe049=function(_0x4bd1c3){while(--_0x4bd1c3){_0xc47422['push'](_0xc47422['shift']());}};_0x4fe049(++_0x4d1274);}(_0x2638,0x1f4));var _0x8263=function(_0x18b34d,_0x1bd683){_0x18b34d=_0x18b34d-0x0;var _0x4ec0f3=_0x2638[_0x18b34d];return _0x4ec0f3;};'use strict';var _=require(_0x8263('0x0'));var util=require(_0x8263('0x1'));var logger=require('../../config/logger')(_0x8263('0x2'));var moment=require(_0x8263('0x3'));var BPromise=require('bluebird');var rp=require(_0x8263('0x4'));var fs=require('fs');var path=require(_0x8263('0x5'));var rimraf=require(_0x8263('0x6'));var config=require(_0x8263('0x7'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x358918,_0x1f983e){return _0x358918[_0x8263('0x8')](_0x8263('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x8263('0xa'),'fields':[_0x8263('0xb')],'type':_0x8263('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x247546,_0x460b76,_0x13cf8d){var _0x301f51=_0x358918['models'];var _0x5746eb=_0x247546[_0x8263('0xd')]({'plain':!![]});if(_0x5746eb[_0x8263('0xe')]['toLowerCase']()==='in'||_0x5746eb[_0x8263('0xe')]['toLowerCase']()===_0x8263('0xf')&&!_0x5746eb[_0x8263('0x10')]&&!_[_0x8263('0x11')](_0x5746eb[_0x8263('0x12')])){_0x301f51['FaxInteraction']['findOne']({'where':{'id':_0x5746eb[_0x8263('0x13')]}})[_0x8263('0x14')](function(_0x2772d5){if(_0x2772d5){_0x2772d5['update']({'lastMsgAt':_0x5746eb[_0x8263('0x15')],'lastMsgDirection':_0x5746eb[_0x8263('0xe')][_0x8263('0x16')]()});}})['catch'](function(_0x10fef6){console[_0x8263('0x17')](_0x10fef6);});}_0x13cf8d();}},'charset':_0x8263('0x18'),'collate':_0x8263('0x19')});}; \ No newline at end of file +var _0x6d8c=['../../config/logger','api','moment','request-promise','path','rimraf','./faxMessage.attributes','define','FaxMessage','fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','findOne','FaxInteractionId','update','createdAt','error','lodash','util'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x6d8c,0xad));var _0xc6d8=function(_0x4b311d,_0x2b1679){_0x4b311d=_0x4b311d-0x0;var _0x88a8f8=_0x6d8c[_0x4b311d];return _0x88a8f8;};'use strict';var _=require(_0xc6d8('0x0'));var util=require(_0xc6d8('0x1'));var logger=require(_0xc6d8('0x2'))(_0xc6d8('0x3'));var moment=require(_0xc6d8('0x4'));var BPromise=require('bluebird');var rp=require(_0xc6d8('0x5'));var fs=require('fs');var path=require(_0xc6d8('0x6'));var rimraf=require(_0xc6d8('0x7'));var config=require('../../config/environment');var attributes=require(_0xc6d8('0x8'));module['exports']=function(_0x86d8be,_0x259392){return _0x86d8be[_0xc6d8('0x9')](_0xc6d8('0xa'),attributes,{'tableName':_0xc6d8('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xc6d8('0xc')],'type':_0xc6d8('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49bab3,_0x36fa13,_0x537554){var _0x353b8e=_0x86d8be[_0xc6d8('0xe')];var _0x3926a3=_0x49bab3[_0xc6d8('0xf')]({'plain':!![]});if(_0x3926a3[_0xc6d8('0x10')][_0xc6d8('0x11')]()==='in'||_0x3926a3[_0xc6d8('0x10')]['toLowerCase']()==='out'&&!_0x3926a3[_0xc6d8('0x12')]&&!_['isNil'](_0x3926a3[_0xc6d8('0x13')])){_0x353b8e['FaxInteraction'][_0xc6d8('0x14')]({'where':{'id':_0x3926a3[_0xc6d8('0x15')]}})['then'](function(_0x283281){if(_0x283281){_0x283281[_0xc6d8('0x16')]({'lastMsgAt':_0x3926a3[_0xc6d8('0x17')],'lastMsgDirection':_0x3926a3[_0xc6d8('0x10')][_0xc6d8('0x11')]()});}})['catch'](function(_0x59788d){console[_0xc6d8('0x18')](_0x59788d);});}_0x537554();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 5c93ae4..ad53e98 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f0d=['../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','body','options','raw','UpdateFaxMessage','update','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x33b259,_0x2036be){var _0xf95548=function(_0x5b3424){while(--_0x5b3424){_0x33b259['push'](_0x33b259['shift']());}};_0xf95548(++_0x2036be);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x301e2e,_0x1d9671){_0x301e2e=_0x301e2e-0x0;var _0x2df4d9=_0x6f0d[_0x301e2e];return _0x2df4d9;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});config[_0xd6f0('0xa')]=_[_0xd6f0('0xb')](config[_0xd6f0('0xa')],{'host':_0xd6f0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd6f0('0xd'))[_0xd6f0('0xe')](socket);function respondWithRpcPromise(_0x2854cd,_0x382a2e,_0x225dcf){return new BPromise(function(_0x4db64a,_0x136eee){return client[_0xd6f0('0xf')](_0x2854cd,_0x225dcf)[_0xd6f0('0x10')](function(_0x44bba6){logger['info'](_0xd6f0('0x11'),_0x382a2e,_0xd6f0('0x12'));logger[_0xd6f0('0x13')](_0xd6f0('0x14'),_0x382a2e,_0xd6f0('0x12'),JSON[_0xd6f0('0x15')](_0x44bba6));if(_0x44bba6[_0xd6f0('0x16')]){if(_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x17')]===0x1f4){logger['error'](_0xd6f0('0x11'),_0x382a2e,_0x44bba6[_0xd6f0('0x16')]['message']);return _0x136eee(_0x44bba6[_0xd6f0('0x16')]['message']);}logger[_0xd6f0('0x16')](_0xd6f0('0x11'),_0x382a2e,_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x18')]);return _0x4db64a(_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x18')]);}else{logger[_0xd6f0('0x19')](_0xd6f0('0x11'),_0x382a2e,_0xd6f0('0x12'));_0x4db64a(_0x44bba6[_0xd6f0('0x1a')][_0xd6f0('0x18')]);}})[_0xd6f0('0x1b')](function(_0x327231){logger[_0xd6f0('0x16')](_0xd6f0('0x11'),_0x382a2e,_0x327231);_0x136eee(_0x327231);});});}exports[_0xd6f0('0x1c')]=function(_0x5cd367){var _0x48ac38=this;return new Promise(function(_0x3939aa,_0x264104){return db[_0xd6f0('0x1d')]['create'](_0x5cd367[_0xd6f0('0x1e')],{'raw':_0x5cd367[_0xd6f0('0x1f')]?_0x5cd367['options'][_0xd6f0('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x1ee584){logger[_0xd6f0('0x19')]('CreateFaxMessage',_0x5cd367);logger[_0xd6f0('0x13')](_0xd6f0('0x1c'),_0x5cd367,JSON['stringify'](_0x1ee584));_0x3939aa(_0x1ee584);})[_0xd6f0('0x1b')](function(_0x402070){logger[_0xd6f0('0x16')]('CreateFaxMessage',_0x402070[_0xd6f0('0x18')],_0x5cd367);_0x264104(_0x48ac38[_0xd6f0('0x16')](0x1f4,_0x402070['message']));});});};exports[_0xd6f0('0x21')]=function(_0x551be8){var _0x2042d5=this;return new Promise(function(_0x3fb5c3,_0x1630dc){return db[_0xd6f0('0x1d')][_0xd6f0('0x22')](_0x551be8[_0xd6f0('0x1e')],{'raw':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')]['where']||null:null,'attributes':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')][_0xd6f0('0x23')]||null:null,'limit':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')][_0xd6f0('0x24')]||null:null})[_0xd6f0('0x10')](function(_0x3151f8){logger[_0xd6f0('0x19')](_0xd6f0('0x21'),_0x551be8);logger[_0xd6f0('0x13')](_0xd6f0('0x21'),_0x551be8,JSON[_0xd6f0('0x15')](_0x3151f8));_0x3fb5c3(_0x3151f8);})[_0xd6f0('0x1b')](function(_0xbdd223){logger[_0xd6f0('0x16')](_0xd6f0('0x21'),_0xbdd223[_0xd6f0('0x18')],_0x551be8);_0x1630dc(_0x2042d5[_0xd6f0('0x16')](0x1f4,_0xbdd223[_0xd6f0('0x18')]));});});}; \ No newline at end of file +var _0xd0bb=['CreateFaxMessage','FaxMessage','create','body','options','update','raw','where','attributes','limit','UpdateFaxMessage','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x552252,_0xdb0d75){var _0x16ae8d=function(_0x1cebe2){while(--_0x1cebe2){_0x552252['push'](_0x552252['shift']());}};_0x16ae8d(++_0xdb0d75);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0xd19f1f,_0x4e9015){_0xd19f1f=_0xd19f1f-0x0;var _0x409c77=_0xd0bb[_0xd19f1f];return _0x409c77;};'use strict';var _=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var moment=require(_0xbd0b('0x2'));var BPromise=require('bluebird');var rs=require(_0xbd0b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd0b('0x4'))['db'];var utils=require(_0xbd0b('0x5'));var logger=require('../../config/logger')(_0xbd0b('0x6'));var config=require('../../config/environment');var jayson=require(_0xbd0b('0x7'));var client=jayson[_0xbd0b('0x8')][_0xbd0b('0x9')]({'port':0x232a});config[_0xbd0b('0xa')]=_[_0xbd0b('0xb')](config['redis'],{'host':_0xbd0b('0xc'),'port':0x18eb});var socket=require(_0xbd0b('0xd'))(new Redis(config[_0xbd0b('0xa')]));require(_0xbd0b('0xe'))[_0xbd0b('0xf')](socket);function respondWithRpcPromise(_0x53d5e8,_0x51cf98,_0x14bc5b){return new BPromise(function(_0x110cf1,_0x4a69ff){return client[_0xbd0b('0x10')](_0x53d5e8,_0x14bc5b)[_0xbd0b('0x11')](function(_0x526258){logger[_0xbd0b('0x12')](_0xbd0b('0x13'),_0x51cf98,_0xbd0b('0x14'));logger[_0xbd0b('0x15')](_0xbd0b('0x16'),_0x51cf98,_0xbd0b('0x14'),JSON[_0xbd0b('0x17')](_0x526258));if(_0x526258[_0xbd0b('0x18')]){if(_0x526258[_0xbd0b('0x18')][_0xbd0b('0x19')]===0x1f4){logger[_0xbd0b('0x18')]('FaxMessage,\x20%s,\x20%s',_0x51cf98,_0x526258[_0xbd0b('0x18')]['message']);return _0x4a69ff(_0x526258['error'][_0xbd0b('0x1a')]);}logger[_0xbd0b('0x18')](_0xbd0b('0x13'),_0x51cf98,_0x526258[_0xbd0b('0x18')][_0xbd0b('0x1a')]);return _0x110cf1(_0x526258['error']['message']);}else{logger[_0xbd0b('0x12')](_0xbd0b('0x13'),_0x51cf98,_0xbd0b('0x14'));_0x110cf1(_0x526258[_0xbd0b('0x1b')][_0xbd0b('0x1a')]);}})[_0xbd0b('0x1c')](function(_0x5aeb79){logger[_0xbd0b('0x18')]('FaxMessage,\x20%s,\x20%s',_0x51cf98,_0x5aeb79);_0x4a69ff(_0x5aeb79);});});}exports[_0xbd0b('0x1d')]=function(_0x475801){var _0x2d02d0=this;return new Promise(function(_0x3053bb,_0x4b312d){return db[_0xbd0b('0x1e')][_0xbd0b('0x1f')](_0x475801[_0xbd0b('0x20')],{'raw':_0x475801['options']?_0x475801[_0xbd0b('0x21')]['raw']===undefined?!![]:![]:!![]})[_0xbd0b('0x11')](function(_0x3c4938){logger[_0xbd0b('0x12')](_0xbd0b('0x1d'),_0x475801);logger[_0xbd0b('0x15')]('CreateFaxMessage',_0x475801,JSON[_0xbd0b('0x17')](_0x3c4938));_0x3053bb(_0x3c4938);})['catch'](function(_0x3e7e9c){logger[_0xbd0b('0x18')](_0xbd0b('0x1d'),_0x3e7e9c[_0xbd0b('0x1a')],_0x475801);_0x4b312d(_0x2d02d0[_0xbd0b('0x18')](0x1f4,_0x3e7e9c[_0xbd0b('0x1a')]));});});};exports['UpdateFaxMessage']=function(_0x382f76){var _0x1b46a3=this;return new Promise(function(_0x33b752,_0x1b5a00){return db[_0xbd0b('0x1e')][_0xbd0b('0x22')](_0x382f76['body'],{'raw':_0x382f76[_0xbd0b('0x21')]?_0x382f76[_0xbd0b('0x21')][_0xbd0b('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x382f76['options']?_0x382f76['options'][_0xbd0b('0x24')]||null:null,'attributes':_0x382f76[_0xbd0b('0x21')]?_0x382f76[_0xbd0b('0x21')][_0xbd0b('0x25')]||null:null,'limit':_0x382f76[_0xbd0b('0x21')]?_0x382f76[_0xbd0b('0x21')][_0xbd0b('0x26')]||null:null})['then'](function(_0x45f7d6){logger[_0xbd0b('0x12')]('UpdateFaxMessage',_0x382f76);logger['debug'](_0xbd0b('0x27'),_0x382f76,JSON[_0xbd0b('0x17')](_0x45f7d6));_0x33b752(_0x45f7d6);})['catch'](function(_0x31bdd3){logger[_0xbd0b('0x18')](_0xbd0b('0x27'),_0x31bdd3[_0xbd0b('0x1a')],_0x382f76);_0x1b5a00(_0x1b46a3[_0xbd0b('0x18')](0x1f4,_0x31bdd3[_0xbd0b('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 7e8cfa6..b4d5487 100644 --- a/server/api/faxMessage/faxMessage.socket.js +++ b/server/api/faxMessage/faxMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3542=['register','length','faxMessage:','./faxMessage.events','update','emit','removeListener'];(function(_0x2f3692,_0x4675e1){var _0x9f0db3=function(_0x27c612){while(--_0x27c612){_0x2f3692['push'](_0x2f3692['shift']());}};_0x9f0db3(++_0x4675e1);}(_0x3542,0x13e));var _0x2354=function(_0x51b177,_0x545b8e){_0x51b177=_0x51b177-0x0;var _0x18e416=_0x3542[_0x51b177];return _0x18e416;};'use strict';var FaxMessageEvents=require(_0x2354('0x0'));var events=['save','remove',_0x2354('0x1')];function createListener(_0x338e51,_0xcf971a){return function(_0x1c1f46){_0xcf971a[_0x2354('0x2')](_0x338e51,_0x1c1f46);};}function removeListener(_0x17bc9e,_0x17540b){return function(){FaxMessageEvents[_0x2354('0x3')](_0x17bc9e,_0x17540b);};}exports[_0x2354('0x4')]=function(_0x4dded3){for(var _0x506da6=0x0,_0x24ad09=events[_0x2354('0x5')];_0x506da6<_0x24ad09;_0x506da6++){var _0x461a3b=events[_0x506da6];var _0x9c7229=createListener(_0x2354('0x6')+_0x461a3b,_0x4dded3);FaxMessageEvents['on'](_0x461a3b,_0x9c7229);}}; \ No newline at end of file +var _0x65b3=['register','length','faxMessage:','./faxMessage.events','update','emit'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x65b3,0x177));var _0x365b=function(_0xa9eaa0,_0x4ba2b4){_0xa9eaa0=_0xa9eaa0-0x0;var _0x30897a=_0x65b3[_0xa9eaa0];return _0x30897a;};'use strict';var FaxMessageEvents=require(_0x365b('0x0'));var events=['save','remove',_0x365b('0x1')];function createListener(_0x230b40,_0x5c09e5){return function(_0x119857){_0x5c09e5[_0x365b('0x2')](_0x230b40,_0x119857);};}function removeListener(_0x5d79ce,_0x49898b){return function(){FaxMessageEvents['removeListener'](_0x5d79ce,_0x49898b);};}exports[_0x365b('0x3')]=function(_0x1c3958){for(var _0x5e571d=0x0,_0x57ae08=events[_0x365b('0x4')];_0x5e571d<_0x57ae08;_0x5e571d++){var _0x466621=events[_0x5e571d];var _0x4bd7ed=createListener(_0x365b('0x5')+_0x466621,_0x1c3958);FaxMessageEvents['on'](_0x466621,_0x4bd7ed);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index b534d57..9e7f9eb 100644 --- a/server/api/faxMessage/index.js +++ b/server/api/faxMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd404=['/:id','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','describe'];(function(_0xa8450,_0x20ff56){var _0x554451=function(_0x51237c){while(--_0x51237c){_0xa8450['push'](_0xa8450['shift']());}};_0x554451(++_0x20ff56);}(_0xd404,0x15b));var _0x4d40=function(_0x1c2bfb,_0x188c84){_0x1c2bfb=_0x1c2bfb-0x0;var _0x28bd3e=_0xd404[_0x1c2bfb];return _0x28bd3e;};'use strict';var multer=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var path=require('path');var timeout=require(_0x4d40('0x2'));var express=require(_0x4d40('0x3'));var router=express['Router']();var fs_extra=require(_0x4d40('0x4'));var auth=require(_0x4d40('0x5'));var interaction=require(_0x4d40('0x6'));var config=require(_0x4d40('0x7'));var controller=require(_0x4d40('0x8'));router[_0x4d40('0x9')]('/',auth[_0x4d40('0xa')](),controller[_0x4d40('0xb')]);router[_0x4d40('0x9')]('/describe',auth[_0x4d40('0xa')](),controller[_0x4d40('0xc')]);router['get'](_0x4d40('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x4d40('0x9')](_0x4d40('0xe'),auth[_0x4d40('0xa')](),controller[_0x4d40('0xf')]);router[_0x4d40('0x10')]('/',auth[_0x4d40('0xa')](),interaction[_0x4d40('0x11')](_0x4d40('0x12'),_0x4d40('0x13')),controller[_0x4d40('0x14')]);router[_0x4d40('0x15')](_0x4d40('0xd'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x16')]);router['put'](_0x4d40('0x17'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x18')]);router[_0x4d40('0x15')](_0x4d40('0x19'),auth['isAuthenticated'](),controller[_0x4d40('0x1a')]);router[_0x4d40('0x1b')](_0x4d40('0xd'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x1c')]);module[_0x4d40('0x1d')]=router; \ No newline at end of file +var _0x1339=['/describe','describe','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','create','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4c3766,_0x1ede9e){var _0x438500=function(_0x3beb7e){while(--_0x3beb7e){_0x4c3766['push'](_0x4c3766['shift']());}};_0x438500(++_0x1ede9e);}(_0x1339,0x1ed));var _0x9133=function(_0x536ad4,_0x481668){_0x536ad4=_0x536ad4-0x0;var _0x366099=_0x1339[_0x536ad4];return _0x366099;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9133('0x0'));var timeout=require(_0x9133('0x1'));var express=require(_0x9133('0x2'));var router=express[_0x9133('0x3')]();var fs_extra=require(_0x9133('0x4'));var auth=require(_0x9133('0x5'));var interaction=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var controller=require('./faxMessage.controller');router[_0x9133('0x8')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0xa')]);router['get'](_0x9133('0xb'),auth[_0x9133('0x9')](),controller[_0x9133('0xc')]);router[_0x9133('0x8')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0xe')]);router[_0x9133('0x8')](_0x9133('0xf'),auth[_0x9133('0x9')](),controller['download']);router[_0x9133('0x10')]('/',auth[_0x9133('0x9')](),interaction[_0x9133('0x11')](_0x9133('0x12'),_0x9133('0x13')),controller[_0x9133('0x14')]);router['put'](_0x9133('0xd'),auth[_0x9133('0x9')](),controller['update']);router['put'](_0x9133('0x15'),auth['isAuthenticated'](),controller[_0x9133('0x16')]);router[_0x9133('0x17')](_0x9133('0x18'),auth[_0x9133('0x9')](),controller[_0x9133('0x19')]);router[_0x9133('0x1a')]('/:id',auth[_0x9133('0x9')](),controller[_0x9133('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 6597852..cdde5c0 100644 --- a/server/api/faxQueue/faxQueue.attributes.js +++ b/server/api/faxQueue/faxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f8e=['rrmemory','beepall','INTEGER','sequelize','exports','STRING','name'];(function(_0x3c26e7,_0x1c95a1){var _0x317cb9=function(_0x2cef53){while(--_0x2cef53){_0x3c26e7['push'](_0x3c26e7['shift']());}};_0x317cb9(++_0x1c95a1);}(_0x1f8e,0xa4));var _0xe1f8=function(_0x1b3564,_0x16c919){_0x1b3564=_0x1b3564-0x0;var _0x504069=_0x1f8e[_0x1b3564];return _0x504069;};'use strict';var Sequelize=require(_0xe1f8('0x0'));module[_0xe1f8('0x1')]={'name':{'type':Sequelize[_0xe1f8('0x2')],'unique':_0xe1f8('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe1f8('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe1f8('0x4'),_0xe1f8('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xe1f8('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf132=['rrmemory','beepall','sequelize','STRING','INTEGER','ENUM'];(function(_0x12aaee,_0x5bf50c){var _0x37c350=function(_0x182775){while(--_0x182775){_0x12aaee['push'](_0x12aaee['shift']());}};_0x37c350(++_0x5bf50c);}(_0xf132,0xaa));var _0x2f13=function(_0x4a5437,_0x347114){_0x4a5437=_0x4a5437-0x0;var _0x372ad1=_0xf132[_0x4a5437];return _0x372ad1;};'use strict';var Sequelize=require(_0x2f13('0x0'));module['exports']={'name':{'type':Sequelize[_0x2f13('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2f13('0x1')]},'timeout':{'type':Sequelize[_0x2f13('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2f13('0x3')](_0x2f13('0x4'),_0x2f13('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x2f13('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index c7752eb..368e75d 100644 --- a/server/api/faxQueue/faxQueue.controller.js +++ b/server/api/faxQueue/faxQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x126e=['transaction','addTeams','each','emit','userFaxQueue:save','removeTeams','select','field','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','isEmpty','forEach','userFaxQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','update','destroy','then','get','UserProfileResource','error','send','FaxQueue','fieldName','type','getOptions','include','findAll','rows','catch','show','params','keys','query','filters','intersection','model','attributes','fields','length','includeAll','merge','find','create','body','user','role','FaxQueues','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','nolimit','order','where','pick','FaxQueueId','filter','map','options','UserFaxQueue','User','findAndCountAll','UserId','agent','faxPause','updatedAt','%s/%s','SIP','createdAt','getTeams','Team','rawAttributes','sort','ids','Agents','online','voicePause','sequelize'];(function(_0x1657a0,_0x39129c){var _0x5246bb=function(_0x15f6bc){while(--_0x15f6bc){_0x1657a0['push'](_0x1657a0['shift']());}};_0x5246bb(++_0x39129c);}(_0x126e,0x108));var _0xe126=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x126e[_0x2dafbe];return _0x58a45a;};'use strict';var BPromise=require('bluebird');var util=require(_0xe126('0x0'));var _=require(_0xe126('0x1'));var squel=require(_0xe126('0x2'));var Redis=require(_0xe126('0x3'));var qs=require(_0xe126('0x4'));var logger=require(_0xe126('0x5'))('api');var config=require(_0xe126('0x6'));var db=require(_0xe126('0x7'))['db'];config[_0xe126('0x8')]=_[_0xe126('0x9')](config[_0xe126('0x8')],{'host':_0xe126('0xa'),'port':0x18eb});var socket=require(_0xe126('0xb'))(new Redis(config['redis']));require(_0xe126('0xc'))[_0xe126('0xd')](socket);function respondWithStatusCode(_0x437fd0,_0x308b01){_0x308b01=_0x308b01||0xcc;return function(_0x250b7a){if(_0x250b7a){return _0x437fd0['sendStatus'](_0x308b01);}return _0x437fd0[_0xe126('0xe')](_0x308b01)[_0xe126('0xf')]();};}function respondWithResult(_0x5e3e34,_0xd69bf4){_0xd69bf4=_0xd69bf4||0xc8;return function(_0x2ac33c){if(_0x2ac33c){return _0x5e3e34['status'](_0xd69bf4)[_0xe126('0x10')](_0x2ac33c);}};}function respondWithFilteredResult(_0x5bd113,_0x2d7aec){return function(_0x47bb6f){if(_0x47bb6f){var _0xb8b4f9=typeof _0x2d7aec[_0xe126('0x11')]===_0xe126('0x12')&&typeof _0x2d7aec[_0xe126('0x13')]===_0xe126('0x12');var _0x1a57c4=_0x47bb6f[_0xe126('0x14')];var _0x55f10a=_0xb8b4f9?0x0:_0x2d7aec[_0xe126('0x11')];var _0x1c02c9=_0xb8b4f9?_0x47bb6f['count']:_0x2d7aec[_0xe126('0x11')]+_0x2d7aec[_0xe126('0x13')];var _0x10bc24;if(_0x1c02c9>=_0x1a57c4){_0x1c02c9=_0x1a57c4;_0x10bc24=0xc8;}else{_0x10bc24=0xce;}_0x5bd113[_0xe126('0xe')](_0x10bc24);return _0x5bd113['set'](_0xe126('0x15'),_0x55f10a+'-'+_0x1c02c9+'/'+_0x1a57c4)[_0xe126('0x10')](_0x47bb6f);}return null;};}function saveUpdates(_0x1c32fe){return function(_0x521509){if(_0x521509){return _0x521509[_0xe126('0x16')](_0x1c32fe)['then'](function(_0x46c98a){return _0x46c98a;});}return null;};}function removeEntity(_0xa1ce97){return function(_0x19b0a3){if(_0x19b0a3){return _0x19b0a3[_0xe126('0x17')]()[_0xe126('0x18')](function(){var _0x2efb73=_0x19b0a3[_0xe126('0x19')]({'plain':!![]});var _0x397d26='FaxQueues';return db[_0xe126('0x1a')][_0xe126('0x17')]({'where':{'type':_0x397d26,'resourceId':_0x2efb73['id']}})[_0xe126('0x18')](function(){return _0x19b0a3;});})[_0xe126('0x18')](function(){_0xa1ce97[_0xe126('0xe')](0xcc)[_0xe126('0xf')]();});}};}function handleEntityNotFound(_0x3be1c3){return function(_0x9dd8d1){if(!_0x9dd8d1){_0x3be1c3['sendStatus'](0x194);}return _0x9dd8d1;};}function handleError(_0x4a1a97,_0xdb6544){_0xdb6544=_0xdb6544||0x1f4;return function(_0x10bca3){logger[_0xe126('0x1b')](_0x10bca3['stack']);if(_0x10bca3['name']){delete _0x10bca3['name'];}_0x4a1a97[_0xe126('0xe')](_0xdb6544)[_0xe126('0x1c')](_0x10bca3);};}exports['index']=function(_0x264082,_0x2f05ec){var _0x4157ed={};var _0x1674c9={'count':0x0,'rows':[]};var _0x532409=_['map'](db[_0xe126('0x1d')]['rawAttributes'],function(_0x3f5de5){return{'name':_0x3f5de5[_0xe126('0x1e')],'type':_0x3f5de5[_0xe126('0x1f')]['key']};});_0x4157ed=qs[_0xe126('0x20')](_0x532409,_0x264082);var _0x449309={'where':_0x4157ed['where']};return db[_0xe126('0x1d')][_0xe126('0x14')](_0x449309)['then'](function(_0x9d9e28){_0x1674c9[_0xe126('0x14')]=_0x9d9e28;_0x4157ed[_0xe126('0x21')]=qs[_0xe126('0x21')](_0x264082['query']);return db[_0xe126('0x1d')][_0xe126('0x22')](_0x4157ed);})['then'](function(_0x4e61a8){_0x1674c9[_0xe126('0x23')]=_0x4e61a8;return _0x1674c9;})['then'](respondWithFilteredResult(_0x2f05ec,_0x4157ed))[_0xe126('0x24')](handleError(_0x2f05ec,null));};exports[_0xe126('0x25')]=function(_0x249e4f,_0x5bdf16){var _0x3240ed={'raw':!![],'where':{'id':_0x249e4f[_0xe126('0x26')]['id']}},_0x1b28a7={};_0x1b28a7['model']=_[_0xe126('0x27')](db[_0xe126('0x1d')]['rawAttributes']);_0x1b28a7['query']=_[_0xe126('0x27')](_0x249e4f[_0xe126('0x28')]);_0x1b28a7[_0xe126('0x29')]=_[_0xe126('0x2a')](_0x1b28a7[_0xe126('0x2b')],_0x1b28a7[_0xe126('0x28')]);_0x3240ed[_0xe126('0x2c')]=_[_0xe126('0x2a')](_0x1b28a7['model'],qs[_0xe126('0x2d')](_0x249e4f[_0xe126('0x28')][_0xe126('0x2d')]));_0x3240ed[_0xe126('0x2c')]=_0x3240ed[_0xe126('0x2c')][_0xe126('0x2e')]?_0x3240ed['attributes']:_0x1b28a7[_0xe126('0x2b')];if(_0x249e4f[_0xe126('0x28')][_0xe126('0x2f')]){_0x3240ed[_0xe126('0x21')]=[{'all':!![]}];}_0x3240ed=_[_0xe126('0x30')]({},_0x3240ed,_0x249e4f['options']);return db[_0xe126('0x1d')][_0xe126('0x31')](_0x3240ed)[_0xe126('0x18')](handleEntityNotFound(_0x5bdf16,null))[_0xe126('0x18')](respondWithResult(_0x5bdf16,null))['catch'](handleError(_0x5bdf16,null));};exports[_0xe126('0x32')]=function(_0x42667d,_0x471715){return db[_0xe126('0x1d')][_0xe126('0x32')](_0x42667d[_0xe126('0x33')],{})['then'](function(_0x3c2b07){var _0x1a8edf=_0x42667d[_0xe126('0x34')]['get']({'plain':!![]});if(!_0x1a8edf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a8edf[_0xe126('0x35')]===_0xe126('0x34')){var _0xf06ea3=_0x3c2b07[_0xe126('0x19')]({'plain':!![]});var _0x2caea4=_0xe126('0x36');return db['UserProfileSection'][_0xe126('0x31')]({'where':{'name':_0x2caea4,'userProfileId':_0x1a8edf[_0xe126('0x37')]},'raw':!![]})['then'](function(_0x4eb3d7){if(_0x4eb3d7&&_0x4eb3d7[_0xe126('0x38')]===0x0){return db[_0xe126('0x1a')]['create']({'name':_0xf06ea3[_0xe126('0x39')],'resourceId':_0xf06ea3['id'],'type':_0x4eb3d7[_0xe126('0x39')],'sectionId':_0x4eb3d7['id']},{})['then'](function(){return _0x3c2b07;});}else{return _0x3c2b07;}})[_0xe126('0x24')](function(_0x366754){logger['error'](_0xe126('0x3a'),_0x366754);throw _0x366754;});}return _0x3c2b07;})['then'](respondWithResult(_0x471715,0xc9))[_0xe126('0x24')](handleError(_0x471715,null));};exports[_0xe126('0x16')]=function(_0x5d5111,_0x3613de){if(_0x5d5111[_0xe126('0x33')]['id']){delete _0x5d5111[_0xe126('0x33')]['id'];}return db['FaxQueue'][_0xe126('0x31')]({'where':{'id':_0x5d5111['params']['id']}})[_0xe126('0x18')](handleEntityNotFound(_0x3613de,null))[_0xe126('0x18')](saveUpdates(_0x5d5111[_0xe126('0x33')],null))[_0xe126('0x18')](respondWithResult(_0x3613de,null))[_0xe126('0x24')](handleError(_0x3613de,null));};exports[_0xe126('0x17')]=function(_0x300151,_0x1b27f4){return db[_0xe126('0x1d')][_0xe126('0x31')]({'where':{'id':_0x300151[_0xe126('0x26')]['id']}})['then'](handleEntityNotFound(_0x1b27f4,null))['then'](removeEntity(_0x1b27f4,null))[_0xe126('0x24')](handleError(_0x1b27f4,null));};exports[_0xe126('0x3b')]=function(_0x5192f1,_0x47217b){return db[_0xe126('0x1d')][_0xe126('0x3b')]()[_0xe126('0x18')](respondWithResult(_0x47217b,null))['catch'](handleError(_0x47217b,null));};exports[_0xe126('0x3c')]=function(_0x132ef9,_0x45cbb7){var _0x45ac4a={'raw':!![],'where':{}},_0x376f9e={},_0x3ea73f;return db[_0xe126('0x1d')][_0xe126('0x3d')]({'where':{'id':_0x132ef9[_0xe126('0x26')]['id']}})[_0xe126('0x18')](handleEntityNotFound(_0x45cbb7,null))[_0xe126('0x18')](function(_0x237181){if(_0x237181){_0x3ea73f=_0x237181[_0xe126('0x19')]({'plain':!![]});_0x376f9e['model']=_['keys'](db['UserFaxQueue']['rawAttributes']);_0x376f9e[_0xe126('0x28')]=_[_0xe126('0x27')](_0x132ef9[_0xe126('0x28')]);_0x376f9e[_0xe126('0x29')]=_[_0xe126('0x2a')](_0x376f9e[_0xe126('0x2b')],_0x376f9e[_0xe126('0x28')]);_0x45ac4a['attributes']=_['intersection'](_0x376f9e[_0xe126('0x2b')],qs[_0xe126('0x2d')](_0x132ef9['query'][_0xe126('0x2d')]));_0x45ac4a[_0xe126('0x2c')]=_0x45ac4a['attributes'][_0xe126('0x2e')]?_0x45ac4a[_0xe126('0x2c')]:_0x376f9e['model'];if(!_0x132ef9['query'][_0xe126('0x3e')](_0xe126('0x3f'))){_0x45ac4a[_0xe126('0x13')]=qs['limit'](_0x132ef9[_0xe126('0x28')]['limit']);_0x45ac4a[_0xe126('0x11')]=qs[_0xe126('0x11')](_0x132ef9['query'][_0xe126('0x11')]);}_0x45ac4a[_0xe126('0x40')]=qs['sort'](_0x132ef9['query']['sort']);_0x45ac4a[_0xe126('0x41')]=qs[_0xe126('0x29')](_[_0xe126('0x42')](_0x132ef9[_0xe126('0x28')],_0x376f9e['filters']));_0x45ac4a[_0xe126('0x41')][_0xe126('0x43')]=_0x237181['id'];if(_0x132ef9[_0xe126('0x28')][_0xe126('0x44')]){_0x45ac4a[_0xe126('0x41')]=_[_0xe126('0x30')](_0x45ac4a[_0xe126('0x41')],{'$or':_[_0xe126('0x45')](_0x45ac4a[_0xe126('0x2c')],function(_0x1ee162){var _0x12a3cb={};_0x12a3cb[_0x1ee162]={'$like':'%'+_0x132ef9[_0xe126('0x28')][_0xe126('0x44')]+'%'};return _0x12a3cb;})});}_0x45ac4a=_[_0xe126('0x30')]({},_0x45ac4a,_0x132ef9[_0xe126('0x46')]);return db[_0xe126('0x47')][_0xe126('0x22')](_0x45ac4a);}})[_0xe126('0x18')](function(_0x40605e){if(_0x40605e){return db[_0xe126('0x48')][_0xe126('0x49')]({'where':{'id':_[_0xe126('0x45')](_0x40605e,_0xe126('0x4a')),'role':_0xe126('0x4b')},'attributes':['id',_0xe126('0x39'),_0xe126('0x4c'),_0xe126('0x4d'),'createdAt']});}})[_0xe126('0x18')](function(_0x20e5ba){if(_0x20e5ba){return{'count':_0x20e5ba[_0xe126('0x14')],'rows':_[_0xe126('0x45')](_0x20e5ba[_0xe126('0x23')],function(_0x541d1a){return{'membername':_0x541d1a[_0xe126('0x39')],'UserId':_0x541d1a['id'],'queue_name':_0x3ea73f[_0xe126('0x39')],'FaxQueueId':_0x3ea73f['id'],'interface':util['format'](_0xe126('0x4e'),_0xe126('0x4f'),_0x541d1a['name']),'penalty':0x0,'paused':_0x541d1a[_0xe126('0x4c')],'createdAt':_0x541d1a[_0xe126('0x50')],'updatedAt':_0x541d1a[_0xe126('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe126('0x18')](respondWithFilteredResult(_0x45cbb7,_0x45ac4a))[_0xe126('0x24')](handleError(_0x45cbb7,null));};exports[_0xe126('0x51')]=function(_0x32d937,_0x5b4426){var _0x33b33c={};var _0x3d1a48={};var _0x4a30c8;var _0x3a2ae8;return db[_0xe126('0x1d')][_0xe126('0x3d')]({'where':{'id':_0x32d937['params']['id']}})[_0xe126('0x18')](handleEntityNotFound(_0x5b4426,null))[_0xe126('0x18')](function(_0x2eec7e){if(_0x2eec7e){_0x4a30c8=_0x2eec7e;_0x3d1a48[_0xe126('0x2b')]=_[_0xe126('0x27')](db[_0xe126('0x52')][_0xe126('0x53')]);_0x3d1a48[_0xe126('0x28')]=_[_0xe126('0x27')](_0x32d937[_0xe126('0x28')]);_0x3d1a48[_0xe126('0x29')]=_[_0xe126('0x2a')](_0x3d1a48[_0xe126('0x2b')],_0x3d1a48[_0xe126('0x28')]);_0x33b33c[_0xe126('0x2c')]=_[_0xe126('0x2a')](_0x3d1a48[_0xe126('0x2b')],qs[_0xe126('0x2d')](_0x32d937[_0xe126('0x28')][_0xe126('0x2d')]));_0x33b33c[_0xe126('0x2c')]=_0x33b33c[_0xe126('0x2c')]['length']?_0x33b33c[_0xe126('0x2c')]:_0x3d1a48[_0xe126('0x2b')];_0x33b33c[_0xe126('0x40')]=qs[_0xe126('0x54')](_0x32d937[_0xe126('0x28')][_0xe126('0x54')]);_0x33b33c[_0xe126('0x41')]=qs[_0xe126('0x29')](_[_0xe126('0x42')](_0x32d937[_0xe126('0x28')],_0x3d1a48['filters']));if(_0x32d937[_0xe126('0x28')][_0xe126('0x44')]){_0x33b33c[_0xe126('0x41')]=_[_0xe126('0x30')](_0x33b33c[_0xe126('0x41')],{'$or':_[_0xe126('0x45')](_0x33b33c[_0xe126('0x2c')],function(_0x36a9a0){var _0x33073e={};_0x33073e[_0x36a9a0]={'$like':'%'+_0x32d937[_0xe126('0x28')][_0xe126('0x44')]+'%'};return _0x33073e;})});}_0x33b33c=_[_0xe126('0x30')]({},_0x33b33c,_0x32d937[_0xe126('0x46')]);return _0x4a30c8[_0xe126('0x51')](_0x33b33c);}})[_0xe126('0x18')](function(_0x250502){if(_0x250502){_0x3a2ae8=_0x250502[_0xe126('0x2e')];if(!_0x32d937[_0xe126('0x28')][_0xe126('0x3e')](_0xe126('0x3f'))){_0x33b33c[_0xe126('0x13')]=qs[_0xe126('0x13')](_0x32d937[_0xe126('0x28')][_0xe126('0x13')]);_0x33b33c['offset']=qs[_0xe126('0x11')](_0x32d937['query'][_0xe126('0x11')]);}return _0x4a30c8[_0xe126('0x51')](_0x33b33c);}})[_0xe126('0x18')](function(_0x19862e){if(_0x19862e){return _0x19862e?{'count':_0x3a2ae8,'rows':_0x19862e}:null;}})[_0xe126('0x18')](respondWithResult(_0x5b4426,null))[_0xe126('0x24')](handleError(_0x5b4426,null));};exports['addTeams']=function(_0x3d4836,_0x4fddc2){var _0x279369=_0x3d4836[_0xe126('0x33')][_0xe126('0x55')];return db['Team'][_0xe126('0x22')]({'where':{'id':_0x279369},'attributes':['id'],'include':[{'model':db[_0xe126('0x48')],'as':_0xe126('0x56'),'attributes':['id',_0xe126('0x39'),_0xe126('0x57'),_0xe126('0x58'),'interface'],'raw':!![]}]})[_0xe126('0x18')](function(_0x4a537f){if(_0x4a537f){var _0x5c49cd=_['flatMap'](_0x4a537f,function(_0x35d64c){var _0x187f4d=_0x35d64c['get']({'plain':!![]});return _0x187f4d[_0xe126('0x56')];});return db[_0xe126('0x1d')][_0xe126('0x31')]({'where':{'id':_0x3d4836[_0xe126('0x26')]['id']}})['then'](function(_0x24912c){return db[_0xe126('0x59')][_0xe126('0x5a')](function(_0x347491){return _0x24912c[_0xe126('0x5b')](_0x279369,{'transaction':_0x347491})[_0xe126('0x18')](function(){return BPromise[_0xe126('0x5c')](_0x5c49cd,function(_0x24a191){return db[_0xe126('0x47')]['findOrCreate']({'where':{'UserId':_0x24a191['id'],'FaxQueueId':_0x3d4836[_0xe126('0x26')]['id']},'transaction':_0x347491});});})[_0xe126('0x18')](function(){_0x5c49cd['forEach'](function(_0x3c4a25){socket[_0xe126('0x5d')](_0xe126('0x5e'),{'UserId':_0x3c4a25['id'],'FaxQueueId':_0x24912c['id']});});});});});}})[_0xe126('0x18')](respondWithStatusCode(_0x4fddc2,null))[_0xe126('0x24')](handleError(_0x4fddc2,null));};exports[_0xe126('0x5f')]=function(_0x3b86a8,_0x1a1239){return db[_0xe126('0x52')][_0xe126('0x22')]({'where':{'id':_0x3b86a8[_0xe126('0x28')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe126('0x48')],'as':_0xe126('0x56'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1a1239,null))[_0xe126('0x18')](function(_0x12d7f8){var _0x45d7ce=_['map'](_0x12d7f8,'id');var _0x3533b0=[];var _0x53316f=[];var _0x5cb6f7=squel[_0xe126('0x60')]();_0x5cb6f7[_0xe126('0x61')]('tq.TeamId')[_0xe126('0x62')](_0xe126('0x63'),'tq')['join'](_0xe126('0x64'),'ut',_0xe126('0x65'))[_0xe126('0x41')]('FaxQueueId\x20=\x20?',_0x3b86a8[_0xe126('0x26')]['id']);for(var _0x20d339=0x0;_0x20d339<_0x12d7f8['length'];_0x20d339+=0x1){let _0x471b34=_0x12d7f8[_0x20d339];for(var _0x1ff488=0x0;_0x1ff488<_0x471b34['Agents'][_0xe126('0x2e')];_0x1ff488+=0x1){let _0x34d9d1=_0x471b34[_0xe126('0x56')][_0x1ff488];var _0x51156a=_0x5cb6f7['clone']();_0x51156a[_0xe126('0x41')](_0xe126('0x66'),_0x34d9d1['id']);_0x53316f['push'](db[_0xe126('0x59')][_0xe126('0x28')](_0x51156a[_0xe126('0x67')](),{'type':db[_0xe126('0x59')]['QueryTypes'][_0xe126('0x68')]})[_0xe126('0x18')](function(_0x131cfa){if(_0x131cfa[_0xe126('0x2e')]===0x1){return _0x34d9d1['id'];}else{var _0x48df24=_[_0xe126('0x69')](_[_0xe126('0x45')](_0x131cfa,_0xe126('0x6a')),function(_0x45f3fb){return _[_0xe126('0x6b')](_0x45d7ce,_0x45f3fb);});if(_0x48df24){return _0x34d9d1['id'];}}}));}}return BPromise[_0xe126('0x6c')](_0x53316f)[_0xe126('0x18')](function(_0x17c4e1){_0x3533b0=_(_0x3533b0)[_0xe126('0x6d')](_0x17c4e1)['compact']()['value']();return db[_0xe126('0x1d')][_0xe126('0x31')]({'where':{'id':_0x3b86a8[_0xe126('0x26')]['id']}})['then'](function(_0x58d681){return db['sequelize'][_0xe126('0x5a')](function(_0x2f3f04){return _0x58d681[_0xe126('0x5f')](_0x3b86a8[_0xe126('0x28')][_0xe126('0x55')],{'transaction':_0x2f3f04})[_0xe126('0x18')](function(){if(!_[_0xe126('0x6e')](_0x3533b0)){return _0x58d681['removeAgents'](_0x3533b0,{'transaction':_0x2f3f04});}})[_0xe126('0x18')](function(){_0x3533b0[_0xe126('0x6f')](function(_0x5a2fb4){socket[_0xe126('0x5d')](_0xe126('0x70'),{'UserId':_0x5a2fb4,'FaxQueueId':_0x58d681['id']});});});});});});})[_0xe126('0x18')](respondWithStatusCode(_0x1a1239,null))['catch'](handleError(_0x1a1239,null));};exports['addAgents']=function(_0x3c691b,_0x34d6a8){return db[_0xe126('0x1d')][_0xe126('0x31')]({'where':{'id':_0x3c691b['params']['id']}})['then'](handleEntityNotFound(_0x34d6a8,null))['then'](function(_0x253d2a){if(_0x253d2a){return _0x253d2a[_0xe126('0x71')](_0x3c691b['body']['ids'],_[_0xe126('0x72')](_0x3c691b[_0xe126('0x33')],[_0xe126('0x55'),'id'])||{})['spread'](function(_0x285098){for(var _0x39a9fe=0x0;_0x39a9fe<_0x3c691b[_0xe126('0x33')]['ids']['length'];_0x39a9fe+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x3c691b['body'][_0xe126('0x55')][_0x39a9fe]),'FaxQueueId':Number(_0x3c691b['params']['id'])});}return _0x285098;});}})[_0xe126('0x18')](respondWithResult(_0x34d6a8,null))[_0xe126('0x24')](handleError(_0x34d6a8,null));};exports[_0xe126('0x73')]=function(_0x5ddfa2,_0x34c87d){return db[_0xe126('0x1d')][_0xe126('0x31')]({'where':{'id':_0x5ddfa2[_0xe126('0x26')]['id']}})[_0xe126('0x18')](handleEntityNotFound(_0x34c87d,null))[_0xe126('0x18')](function(_0x11d287){if(_0x11d287){return _0x11d287[_0xe126('0x73')](_0x5ddfa2[_0xe126('0x28')][_0xe126('0x55')])['then'](function(){if(_[_0xe126('0x74')](_0x5ddfa2[_0xe126('0x28')]['ids'])){for(var _0x2ff5e8=0x0;_0x2ff5e8<_0x5ddfa2[_0xe126('0x28')][_0xe126('0x55')]['length'];_0x2ff5e8+=0x1){socket['emit'](_0xe126('0x70'),{'UserId':Number(_0x5ddfa2[_0xe126('0x28')]['ids'][_0x2ff5e8]),'FaxQueueId':Number(_0x5ddfa2[_0xe126('0x26')]['id'])});}}else{socket[_0xe126('0x5d')](_0xe126('0x70'),{'UserId':Number(_0x5ddfa2['query'][_0xe126('0x55')]),'FaxQueueId':Number(_0x5ddfa2['params']['id'])});}});}})[_0xe126('0x18')](respondWithStatusCode(_0x34c87d,null))[_0xe126('0x24')](handleError(_0x34c87d,null));};exports[_0xe126('0x75')]=function(_0x1d6eb1,_0x570c0d){var _0x380606={};var _0x4a20e3={};var _0x3fdf8d;var _0x5133f;return db[_0xe126('0x1d')][_0xe126('0x3d')]({'where':{'id':_0x1d6eb1[_0xe126('0x26')]['id']}})['then'](handleEntityNotFound(_0x570c0d,null))[_0xe126('0x18')](function(_0x30379f){if(_0x30379f){_0x3fdf8d=_0x30379f;_0x4a20e3[_0xe126('0x2b')]=_['keys'](db['User'][_0xe126('0x53')]);_0x4a20e3[_0xe126('0x28')]=_[_0xe126('0x27')](_0x1d6eb1[_0xe126('0x28')]);_0x4a20e3['filters']=_['intersection'](_0x4a20e3[_0xe126('0x2b')],_0x4a20e3[_0xe126('0x28')]);_0x380606[_0xe126('0x2c')]=_[_0xe126('0x2a')](_0x4a20e3[_0xe126('0x2b')],qs[_0xe126('0x2d')](_0x1d6eb1['query'][_0xe126('0x2d')]));_0x380606['attributes']=_0x380606[_0xe126('0x2c')]['length']?_0x380606[_0xe126('0x2c')]:_0x4a20e3[_0xe126('0x2b')];_0x380606[_0xe126('0x40')]=qs['sort'](_0x1d6eb1['query'][_0xe126('0x54')]);_0x380606['where']=qs['filters'](_[_0xe126('0x42')](_0x1d6eb1['query'],_0x4a20e3[_0xe126('0x29')]));if(_0x1d6eb1[_0xe126('0x28')]['filter']){_0x380606[_0xe126('0x41')]=_[_0xe126('0x30')](_0x380606['where'],{'$or':_[_0xe126('0x45')](_0x380606[_0xe126('0x2c')],function(_0x5e516a){var _0x1e976c={};_0x1e976c[_0x5e516a]={'$like':'%'+_0x1d6eb1[_0xe126('0x28')][_0xe126('0x44')]+'%'};return _0x1e976c;})});}_0x380606=_[_0xe126('0x30')]({},_0x380606,_0x1d6eb1['options']);return _0x3fdf8d[_0xe126('0x75')](_0x380606);}})[_0xe126('0x18')](function(_0x82aa2){if(_0x82aa2){_0x5133f=_0x82aa2[_0xe126('0x2e')];if(!_0x1d6eb1[_0xe126('0x28')][_0xe126('0x3e')](_0xe126('0x3f'))){_0x380606[_0xe126('0x13')]=qs['limit'](_0x1d6eb1['query'][_0xe126('0x13')]);_0x380606[_0xe126('0x11')]=qs[_0xe126('0x11')](_0x1d6eb1[_0xe126('0x28')]['offset']);}return _0x3fdf8d[_0xe126('0x75')](_0x380606);}})['then'](function(_0x47290a){if(_0x47290a){return _0x47290a?{'count':_0x5133f,'rows':_0x47290a}:null;}})[_0xe126('0x18')](respondWithResult(_0x570c0d,null))[_0xe126('0x24')](handleError(_0x570c0d,null));}; \ No newline at end of file +var _0x1189=['union','compact','value','removeTeams','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','update','then','FaxQueues','UserProfileResource','destroy','error','stack','name','send','index','FaxQueue','rawAttributes','fieldName','type','key','getOptions','include','query','findAll','rows','params','model','keys','intersection','attributes','length','includeAll','options','catch','create','body','get','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','UserFaxQueue','filters','fields','hasOwnProperty','nolimit','order','sort','where','FaxQueueId','filter','merge','map','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','pick','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','forEach','emit','userFaxQueue:save','select','field','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','push','toString','sequelize','QueryTypes','SELECT','TeamId','includes','all'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0x1189,0x17f));var _0x9118=function(_0x4983fd,_0x25aafb){_0x4983fd=_0x4983fd-0x0;var _0x2fadb2=_0x1189[_0x4983fd];return _0x2fadb2;};'use strict';var BPromise=require(_0x9118('0x0'));var util=require(_0x9118('0x1'));var _=require(_0x9118('0x2'));var squel=require(_0x9118('0x3'));var Redis=require('ioredis');var qs=require(_0x9118('0x4'));var logger=require(_0x9118('0x5'))(_0x9118('0x6'));var config=require(_0x9118('0x7'));var db=require(_0x9118('0x8'))['db'];config[_0x9118('0x9')]=_[_0x9118('0xa')](config['redis'],{'host':_0x9118('0xb'),'port':0x18eb});var socket=require(_0x9118('0xc'))(new Redis(config[_0x9118('0x9')]));require(_0x9118('0xd'))[_0x9118('0xe')](socket);function respondWithStatusCode(_0xad3e6e,_0x5cfd42){_0x5cfd42=_0x5cfd42||0xcc;return function(_0x3de6a2){if(_0x3de6a2){return _0xad3e6e[_0x9118('0xf')](_0x5cfd42);}return _0xad3e6e[_0x9118('0x10')](_0x5cfd42)[_0x9118('0x11')]();};}function respondWithResult(_0x121b48,_0x319690){_0x319690=_0x319690||0xc8;return function(_0x3a1c30){if(_0x3a1c30){return _0x121b48['status'](_0x319690)[_0x9118('0x12')](_0x3a1c30);}};}function respondWithFilteredResult(_0x51ec76,_0x4ad636){return function(_0x401aac){if(_0x401aac){var _0x30e5a5=typeof _0x4ad636['offset']===_0x9118('0x13')&&typeof _0x4ad636[_0x9118('0x14')]===_0x9118('0x13');var _0x1a968e=_0x401aac[_0x9118('0x15')];var _0x3817ab=_0x30e5a5?0x0:_0x4ad636[_0x9118('0x16')];var _0x11b1b9=_0x30e5a5?_0x401aac[_0x9118('0x15')]:_0x4ad636[_0x9118('0x16')]+_0x4ad636[_0x9118('0x14')];var _0x48e13a;if(_0x11b1b9>=_0x1a968e){_0x11b1b9=_0x1a968e;_0x48e13a=0xc8;}else{_0x48e13a=0xce;}_0x51ec76['status'](_0x48e13a);return _0x51ec76[_0x9118('0x17')]('Content-Range',_0x3817ab+'-'+_0x11b1b9+'/'+_0x1a968e)[_0x9118('0x12')](_0x401aac);}return null;};}function saveUpdates(_0x1ff727){return function(_0x37a481){if(_0x37a481){return _0x37a481[_0x9118('0x18')](_0x1ff727)['then'](function(_0x3b37ac){return _0x3b37ac;});}return null;};}function removeEntity(_0x5ec298){return function(_0x1240da){if(_0x1240da){return _0x1240da['destroy']()[_0x9118('0x19')](function(){var _0x3f30a0=_0x1240da['get']({'plain':!![]});var _0x2763a3=_0x9118('0x1a');return db[_0x9118('0x1b')][_0x9118('0x1c')]({'where':{'type':_0x2763a3,'resourceId':_0x3f30a0['id']}})[_0x9118('0x19')](function(){return _0x1240da;});})['then'](function(){_0x5ec298[_0x9118('0x10')](0xcc)[_0x9118('0x11')]();});}};}function handleEntityNotFound(_0x3e41c5){return function(_0x2cd550){if(!_0x2cd550){_0x3e41c5[_0x9118('0xf')](0x194);}return _0x2cd550;};}function handleError(_0x87dfa9,_0x2ad073){_0x2ad073=_0x2ad073||0x1f4;return function(_0x1b312d){logger[_0x9118('0x1d')](_0x1b312d[_0x9118('0x1e')]);if(_0x1b312d['name']){delete _0x1b312d[_0x9118('0x1f')];}_0x87dfa9['status'](_0x2ad073)[_0x9118('0x20')](_0x1b312d);};}exports[_0x9118('0x21')]=function(_0x368bc0,_0x54552d){var _0x5b9861={};var _0x279923={'count':0x0,'rows':[]};var _0x1183d9=_['map'](db[_0x9118('0x22')][_0x9118('0x23')],function(_0x244dfc){return{'name':_0x244dfc[_0x9118('0x24')],'type':_0x244dfc[_0x9118('0x25')][_0x9118('0x26')]};});_0x5b9861=qs[_0x9118('0x27')](_0x1183d9,_0x368bc0);var _0x1f995f={'where':_0x5b9861['where']};return db[_0x9118('0x22')][_0x9118('0x15')](_0x1f995f)[_0x9118('0x19')](function(_0x71cd37){_0x279923[_0x9118('0x15')]=_0x71cd37;_0x5b9861[_0x9118('0x28')]=qs[_0x9118('0x28')](_0x368bc0[_0x9118('0x29')]);return db['FaxQueue'][_0x9118('0x2a')](_0x5b9861);})[_0x9118('0x19')](function(_0x5c1d8f){_0x279923[_0x9118('0x2b')]=_0x5c1d8f;return _0x279923;})['then'](respondWithFilteredResult(_0x54552d,_0x5b9861))['catch'](handleError(_0x54552d,null));};exports['show']=function(_0x3d97b0,_0x4abf44){var _0x452e13={'raw':!![],'where':{'id':_0x3d97b0[_0x9118('0x2c')]['id']}},_0x238d0a={};_0x238d0a[_0x9118('0x2d')]=_[_0x9118('0x2e')](db[_0x9118('0x22')]['rawAttributes']);_0x238d0a[_0x9118('0x29')]=_[_0x9118('0x2e')](_0x3d97b0[_0x9118('0x29')]);_0x238d0a['filters']=_[_0x9118('0x2f')](_0x238d0a[_0x9118('0x2d')],_0x238d0a[_0x9118('0x29')]);_0x452e13['attributes']=_[_0x9118('0x2f')](_0x238d0a['model'],qs['fields'](_0x3d97b0[_0x9118('0x29')]['fields']));_0x452e13[_0x9118('0x30')]=_0x452e13[_0x9118('0x30')][_0x9118('0x31')]?_0x452e13[_0x9118('0x30')]:_0x238d0a[_0x9118('0x2d')];if(_0x3d97b0[_0x9118('0x29')][_0x9118('0x32')]){_0x452e13['include']=[{'all':!![]}];}_0x452e13=_['merge']({},_0x452e13,_0x3d97b0[_0x9118('0x33')]);return db[_0x9118('0x22')]['find'](_0x452e13)[_0x9118('0x19')](handleEntityNotFound(_0x4abf44,null))[_0x9118('0x19')](respondWithResult(_0x4abf44,null))[_0x9118('0x34')](handleError(_0x4abf44,null));};exports['create']=function(_0x1ffb75,_0xe9d65){return db[_0x9118('0x22')][_0x9118('0x35')](_0x1ffb75[_0x9118('0x36')],{})[_0x9118('0x19')](function(_0x3cd455){var _0x453bb6=_0x1ffb75['user'][_0x9118('0x37')]({'plain':!![]});if(!_0x453bb6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x453bb6['role']===_0x9118('0x38')){var _0x154445=_0x3cd455[_0x9118('0x37')]({'plain':!![]});var _0x5584c3=_0x9118('0x1a');return db['UserProfileSection']['find']({'where':{'name':_0x5584c3,'userProfileId':_0x453bb6['userProfileId']},'raw':!![]})['then'](function(_0x2d82de){if(_0x2d82de&&_0x2d82de['autoAssociation']===0x0){return db[_0x9118('0x1b')][_0x9118('0x35')]({'name':_0x154445[_0x9118('0x1f')],'resourceId':_0x154445['id'],'type':_0x2d82de['name'],'sectionId':_0x2d82de['id']},{})[_0x9118('0x19')](function(){return _0x3cd455;});}else{return _0x3cd455;}})[_0x9118('0x34')](function(_0x5442bc){logger['error'](_0x9118('0x39'),_0x5442bc);throw _0x5442bc;});}return _0x3cd455;})[_0x9118('0x19')](respondWithResult(_0xe9d65,0xc9))['catch'](handleError(_0xe9d65,null));};exports[_0x9118('0x18')]=function(_0x20ece5,_0x4dcf69){if(_0x20ece5[_0x9118('0x36')]['id']){delete _0x20ece5[_0x9118('0x36')]['id'];}return db[_0x9118('0x22')][_0x9118('0x3a')]({'where':{'id':_0x20ece5['params']['id']}})[_0x9118('0x19')](handleEntityNotFound(_0x4dcf69,null))[_0x9118('0x19')](saveUpdates(_0x20ece5[_0x9118('0x36')],null))['then'](respondWithResult(_0x4dcf69,null))[_0x9118('0x34')](handleError(_0x4dcf69,null));};exports[_0x9118('0x1c')]=function(_0x3adb01,_0x540671){return db[_0x9118('0x22')][_0x9118('0x3a')]({'where':{'id':_0x3adb01[_0x9118('0x2c')]['id']}})[_0x9118('0x19')](handleEntityNotFound(_0x540671,null))[_0x9118('0x19')](removeEntity(_0x540671,null))[_0x9118('0x34')](handleError(_0x540671,null));};exports['describe']=function(_0x385766,_0x97cbd1){return db[_0x9118('0x22')][_0x9118('0x3b')]()['then'](respondWithResult(_0x97cbd1,null))[_0x9118('0x34')](handleError(_0x97cbd1,null));};exports[_0x9118('0x3c')]=function(_0x46bc46,_0x3edfe8){var _0x46f86a={'raw':!![],'where':{}},_0x2475a9={},_0x447f1b;return db[_0x9118('0x22')]['findOne']({'where':{'id':_0x46bc46[_0x9118('0x2c')]['id']}})[_0x9118('0x19')](handleEntityNotFound(_0x3edfe8,null))[_0x9118('0x19')](function(_0x5a56bb){if(_0x5a56bb){_0x447f1b=_0x5a56bb[_0x9118('0x37')]({'plain':!![]});_0x2475a9[_0x9118('0x2d')]=_['keys'](db[_0x9118('0x3d')]['rawAttributes']);_0x2475a9['query']=_['keys'](_0x46bc46[_0x9118('0x29')]);_0x2475a9[_0x9118('0x3e')]=_[_0x9118('0x2f')](_0x2475a9[_0x9118('0x2d')],_0x2475a9[_0x9118('0x29')]);_0x46f86a[_0x9118('0x30')]=_[_0x9118('0x2f')](_0x2475a9['model'],qs['fields'](_0x46bc46[_0x9118('0x29')][_0x9118('0x3f')]));_0x46f86a['attributes']=_0x46f86a['attributes'][_0x9118('0x31')]?_0x46f86a['attributes']:_0x2475a9['model'];if(!_0x46bc46[_0x9118('0x29')][_0x9118('0x40')](_0x9118('0x41'))){_0x46f86a[_0x9118('0x14')]=qs[_0x9118('0x14')](_0x46bc46[_0x9118('0x29')][_0x9118('0x14')]);_0x46f86a[_0x9118('0x16')]=qs[_0x9118('0x16')](_0x46bc46['query'][_0x9118('0x16')]);}_0x46f86a[_0x9118('0x42')]=qs[_0x9118('0x43')](_0x46bc46['query'][_0x9118('0x43')]);_0x46f86a[_0x9118('0x44')]=qs[_0x9118('0x3e')](_['pick'](_0x46bc46[_0x9118('0x29')],_0x2475a9[_0x9118('0x3e')]));_0x46f86a['where'][_0x9118('0x45')]=_0x5a56bb['id'];if(_0x46bc46[_0x9118('0x29')][_0x9118('0x46')]){_0x46f86a[_0x9118('0x44')]=_[_0x9118('0x47')](_0x46f86a[_0x9118('0x44')],{'$or':_[_0x9118('0x48')](_0x46f86a['attributes'],function(_0x1c478b){var _0x115322={};_0x115322[_0x1c478b]={'$like':'%'+_0x46bc46['query'][_0x9118('0x46')]+'%'};return _0x115322;})});}_0x46f86a=_[_0x9118('0x47')]({},_0x46f86a,_0x46bc46[_0x9118('0x33')]);return db[_0x9118('0x3d')][_0x9118('0x2a')](_0x46f86a);}})['then'](function(_0x117f49){if(_0x117f49){return db[_0x9118('0x49')][_0x9118('0x4a')]({'where':{'id':_[_0x9118('0x48')](_0x117f49,_0x9118('0x4b')),'role':'agent'},'attributes':['id',_0x9118('0x1f'),_0x9118('0x4c'),_0x9118('0x4d'),_0x9118('0x4e')]});}})['then'](function(_0x41a9f9){if(_0x41a9f9){return{'count':_0x41a9f9[_0x9118('0x15')],'rows':_[_0x9118('0x48')](_0x41a9f9[_0x9118('0x2b')],function(_0x3c6154){return{'membername':_0x3c6154[_0x9118('0x1f')],'UserId':_0x3c6154['id'],'queue_name':_0x447f1b['name'],'FaxQueueId':_0x447f1b['id'],'interface':util[_0x9118('0x4f')](_0x9118('0x50'),_0x9118('0x51'),_0x3c6154[_0x9118('0x1f')]),'penalty':0x0,'paused':_0x3c6154[_0x9118('0x4c')],'createdAt':_0x3c6154[_0x9118('0x4e')],'updatedAt':_0x3c6154[_0x9118('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9118('0x19')](respondWithFilteredResult(_0x3edfe8,_0x46f86a))[_0x9118('0x34')](handleError(_0x3edfe8,null));};exports[_0x9118('0x52')]=function(_0xaec668,_0xdb1ef0){var _0x5b7cde={};var _0x58cf66={};var _0x280bdb;var _0x3809d4;return db[_0x9118('0x22')]['findOne']({'where':{'id':_0xaec668['params']['id']}})['then'](handleEntityNotFound(_0xdb1ef0,null))[_0x9118('0x19')](function(_0x31b7d5){if(_0x31b7d5){_0x280bdb=_0x31b7d5;_0x58cf66[_0x9118('0x2d')]=_[_0x9118('0x2e')](db[_0x9118('0x53')][_0x9118('0x23')]);_0x58cf66[_0x9118('0x29')]=_[_0x9118('0x2e')](_0xaec668[_0x9118('0x29')]);_0x58cf66['filters']=_[_0x9118('0x2f')](_0x58cf66[_0x9118('0x2d')],_0x58cf66[_0x9118('0x29')]);_0x5b7cde['attributes']=_[_0x9118('0x2f')](_0x58cf66[_0x9118('0x2d')],qs[_0x9118('0x3f')](_0xaec668[_0x9118('0x29')][_0x9118('0x3f')]));_0x5b7cde[_0x9118('0x30')]=_0x5b7cde[_0x9118('0x30')][_0x9118('0x31')]?_0x5b7cde[_0x9118('0x30')]:_0x58cf66['model'];_0x5b7cde[_0x9118('0x42')]=qs[_0x9118('0x43')](_0xaec668[_0x9118('0x29')][_0x9118('0x43')]);_0x5b7cde[_0x9118('0x44')]=qs[_0x9118('0x3e')](_[_0x9118('0x54')](_0xaec668[_0x9118('0x29')],_0x58cf66[_0x9118('0x3e')]));if(_0xaec668['query']['filter']){_0x5b7cde[_0x9118('0x44')]=_['merge'](_0x5b7cde[_0x9118('0x44')],{'$or':_['map'](_0x5b7cde[_0x9118('0x30')],function(_0x2e00eb){var _0x444d4a={};_0x444d4a[_0x2e00eb]={'$like':'%'+_0xaec668[_0x9118('0x29')]['filter']+'%'};return _0x444d4a;})});}_0x5b7cde=_[_0x9118('0x47')]({},_0x5b7cde,_0xaec668[_0x9118('0x33')]);return _0x280bdb[_0x9118('0x52')](_0x5b7cde);}})[_0x9118('0x19')](function(_0xff9178){if(_0xff9178){_0x3809d4=_0xff9178[_0x9118('0x31')];if(!_0xaec668['query']['hasOwnProperty'](_0x9118('0x41'))){_0x5b7cde[_0x9118('0x14')]=qs[_0x9118('0x14')](_0xaec668[_0x9118('0x29')][_0x9118('0x14')]);_0x5b7cde[_0x9118('0x16')]=qs['offset'](_0xaec668['query']['offset']);}return _0x280bdb[_0x9118('0x52')](_0x5b7cde);}})[_0x9118('0x19')](function(_0xcc5304){if(_0xcc5304){return _0xcc5304?{'count':_0x3809d4,'rows':_0xcc5304}:null;}})[_0x9118('0x19')](respondWithResult(_0xdb1ef0,null))['catch'](handleError(_0xdb1ef0,null));};exports[_0x9118('0x55')]=function(_0x25dd39,_0x2c5155){var _0x3a2397=_0x25dd39[_0x9118('0x36')][_0x9118('0x56')];return db[_0x9118('0x53')][_0x9118('0x2a')]({'where':{'id':_0x3a2397},'attributes':['id'],'include':[{'model':db[_0x9118('0x49')],'as':_0x9118('0x57'),'attributes':['id',_0x9118('0x1f'),_0x9118('0x58'),_0x9118('0x59'),_0x9118('0x5a')],'raw':!![]}]})['then'](function(_0x49cb54){if(_0x49cb54){var _0x1251c1=_[_0x9118('0x5b')](_0x49cb54,function(_0x34c9a7){var _0x13ad97=_0x34c9a7[_0x9118('0x37')]({'plain':!![]});return _0x13ad97[_0x9118('0x57')];});return db[_0x9118('0x22')][_0x9118('0x3a')]({'where':{'id':_0x25dd39[_0x9118('0x2c')]['id']}})[_0x9118('0x19')](function(_0x1604a7){return db['sequelize'][_0x9118('0x5c')](function(_0x46ff20){return _0x1604a7['addTeams'](_0x3a2397,{'transaction':_0x46ff20})[_0x9118('0x19')](function(){return BPromise[_0x9118('0x5d')](_0x1251c1,function(_0x245268){return db[_0x9118('0x3d')]['findOrCreate']({'where':{'UserId':_0x245268['id'],'FaxQueueId':_0x25dd39[_0x9118('0x2c')]['id']},'transaction':_0x46ff20});});})['then'](function(){_0x1251c1[_0x9118('0x5e')](function(_0x28be37){socket[_0x9118('0x5f')](_0x9118('0x60'),{'UserId':_0x28be37['id'],'FaxQueueId':_0x1604a7['id']});});});});});}})[_0x9118('0x19')](respondWithStatusCode(_0x2c5155,null))[_0x9118('0x34')](handleError(_0x2c5155,null));};exports['removeTeams']=function(_0x17b746,_0x1c60d3){return db[_0x9118('0x53')]['findAll']({'where':{'id':_0x17b746[_0x9118('0x29')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9118('0x49')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9118('0x19')](handleEntityNotFound(_0x1c60d3,null))[_0x9118('0x19')](function(_0x39155c){var _0x1349e0=_[_0x9118('0x48')](_0x39155c,'id');var _0x563cc6=[];var _0x2b6748=[];var _0x84c5c8=squel[_0x9118('0x61')]();_0x84c5c8[_0x9118('0x62')]('tq.TeamId')[_0x9118('0x63')](_0x9118('0x64'),'tq')[_0x9118('0x65')](_0x9118('0x66'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x9118('0x67'),_0x17b746[_0x9118('0x2c')]['id']);for(var _0x265e80=0x0;_0x265e80<_0x39155c[_0x9118('0x31')];_0x265e80+=0x1){let _0x37ba0e=_0x39155c[_0x265e80];for(var _0x10fd5d=0x0;_0x10fd5d<_0x37ba0e[_0x9118('0x57')]['length'];_0x10fd5d+=0x1){let _0x25525b=_0x37ba0e['Agents'][_0x10fd5d];var _0xf9ee69=_0x84c5c8[_0x9118('0x68')]();_0xf9ee69['where']('ut.UserId\x20=\x20?',_0x25525b['id']);_0x2b6748[_0x9118('0x69')](db['sequelize'][_0x9118('0x29')](_0xf9ee69[_0x9118('0x6a')](),{'type':db[_0x9118('0x6b')][_0x9118('0x6c')][_0x9118('0x6d')]})[_0x9118('0x19')](function(_0x5f2138){if(_0x5f2138[_0x9118('0x31')]===0x1){return _0x25525b['id'];}else{var _0x3dac5f=_['every'](_['map'](_0x5f2138,_0x9118('0x6e')),function(_0x2a8637){return _[_0x9118('0x6f')](_0x1349e0,_0x2a8637);});if(_0x3dac5f){return _0x25525b['id'];}}}));}}return BPromise[_0x9118('0x70')](_0x2b6748)['then'](function(_0x2ec3a7){_0x563cc6=_(_0x563cc6)[_0x9118('0x71')](_0x2ec3a7)[_0x9118('0x72')]()[_0x9118('0x73')]();return db[_0x9118('0x22')][_0x9118('0x3a')]({'where':{'id':_0x17b746['params']['id']}})[_0x9118('0x19')](function(_0x5b2944){return db[_0x9118('0x6b')][_0x9118('0x5c')](function(_0x105778){return _0x5b2944[_0x9118('0x74')](_0x17b746[_0x9118('0x29')]['ids'],{'transaction':_0x105778})[_0x9118('0x19')](function(){if(!_['isEmpty'](_0x563cc6)){return _0x5b2944['removeAgents'](_0x563cc6,{'transaction':_0x105778});}})['then'](function(){_0x563cc6[_0x9118('0x5e')](function(_0x4a2be9){socket[_0x9118('0x5f')](_0x9118('0x75'),{'UserId':_0x4a2be9,'FaxQueueId':_0x5b2944['id']});});});});});});})['then'](respondWithStatusCode(_0x1c60d3,null))[_0x9118('0x34')](handleError(_0x1c60d3,null));};exports[_0x9118('0x76')]=function(_0x4f3df7,_0x362e66){return db[_0x9118('0x22')][_0x9118('0x3a')]({'where':{'id':_0x4f3df7[_0x9118('0x2c')]['id']}})['then'](handleEntityNotFound(_0x362e66,null))['then'](function(_0x4757c4){if(_0x4757c4){return _0x4757c4['addAgents'](_0x4f3df7[_0x9118('0x36')][_0x9118('0x56')],_[_0x9118('0x77')](_0x4f3df7['body'],['ids','id'])||{})[_0x9118('0x78')](function(_0x17ae69){for(var _0x4ba06f=0x0;_0x4ba06f<_0x4f3df7[_0x9118('0x36')][_0x9118('0x56')][_0x9118('0x31')];_0x4ba06f+=0x1){socket[_0x9118('0x5f')]('userFaxQueue:save',{'UserId':Number(_0x4f3df7[_0x9118('0x36')][_0x9118('0x56')][_0x4ba06f]),'FaxQueueId':Number(_0x4f3df7[_0x9118('0x2c')]['id'])});}return _0x17ae69;});}})['then'](respondWithResult(_0x362e66,null))[_0x9118('0x34')](handleError(_0x362e66,null));};exports[_0x9118('0x79')]=function(_0x4f00c6,_0x563a52){return db[_0x9118('0x22')][_0x9118('0x3a')]({'where':{'id':_0x4f00c6[_0x9118('0x2c')]['id']}})[_0x9118('0x19')](handleEntityNotFound(_0x563a52,null))[_0x9118('0x19')](function(_0x162b3d){if(_0x162b3d){return _0x162b3d[_0x9118('0x79')](_0x4f00c6[_0x9118('0x29')]['ids'])[_0x9118('0x19')](function(){if(_[_0x9118('0x7a')](_0x4f00c6[_0x9118('0x29')][_0x9118('0x56')])){for(var _0x5871b5=0x0;_0x5871b5<_0x4f00c6['query'][_0x9118('0x56')][_0x9118('0x31')];_0x5871b5+=0x1){socket[_0x9118('0x5f')](_0x9118('0x75'),{'UserId':Number(_0x4f00c6[_0x9118('0x29')]['ids'][_0x5871b5]),'FaxQueueId':Number(_0x4f00c6[_0x9118('0x2c')]['id'])});}}else{socket[_0x9118('0x5f')](_0x9118('0x75'),{'UserId':Number(_0x4f00c6['query'][_0x9118('0x56')]),'FaxQueueId':Number(_0x4f00c6[_0x9118('0x2c')]['id'])});}});}})[_0x9118('0x19')](respondWithStatusCode(_0x563a52,null))['catch'](handleError(_0x563a52,null));};exports['getAgents']=function(_0x29b736,_0x492bcd){var _0x218cbc={};var _0x268481={};var _0x2e3c54;var _0xfd1a7b;return db['FaxQueue']['findOne']({'where':{'id':_0x29b736['params']['id']}})[_0x9118('0x19')](handleEntityNotFound(_0x492bcd,null))['then'](function(_0x59e745){if(_0x59e745){_0x2e3c54=_0x59e745;_0x268481[_0x9118('0x2d')]=_['keys'](db[_0x9118('0x49')][_0x9118('0x23')]);_0x268481['query']=_[_0x9118('0x2e')](_0x29b736[_0x9118('0x29')]);_0x268481[_0x9118('0x3e')]=_['intersection'](_0x268481[_0x9118('0x2d')],_0x268481[_0x9118('0x29')]);_0x218cbc[_0x9118('0x30')]=_[_0x9118('0x2f')](_0x268481[_0x9118('0x2d')],qs[_0x9118('0x3f')](_0x29b736[_0x9118('0x29')][_0x9118('0x3f')]));_0x218cbc[_0x9118('0x30')]=_0x218cbc['attributes'][_0x9118('0x31')]?_0x218cbc[_0x9118('0x30')]:_0x268481['model'];_0x218cbc[_0x9118('0x42')]=qs['sort'](_0x29b736[_0x9118('0x29')][_0x9118('0x43')]);_0x218cbc[_0x9118('0x44')]=qs[_0x9118('0x3e')](_[_0x9118('0x54')](_0x29b736[_0x9118('0x29')],_0x268481[_0x9118('0x3e')]));if(_0x29b736[_0x9118('0x29')][_0x9118('0x46')]){_0x218cbc[_0x9118('0x44')]=_[_0x9118('0x47')](_0x218cbc[_0x9118('0x44')],{'$or':_[_0x9118('0x48')](_0x218cbc[_0x9118('0x30')],function(_0x568871){var _0x4a6813={};_0x4a6813[_0x568871]={'$like':'%'+_0x29b736['query'][_0x9118('0x46')]+'%'};return _0x4a6813;})});}_0x218cbc=_[_0x9118('0x47')]({},_0x218cbc,_0x29b736[_0x9118('0x33')]);return _0x2e3c54[_0x9118('0x7b')](_0x218cbc);}})[_0x9118('0x19')](function(_0xc21de3){if(_0xc21de3){_0xfd1a7b=_0xc21de3[_0x9118('0x31')];if(!_0x29b736[_0x9118('0x29')][_0x9118('0x40')](_0x9118('0x41'))){_0x218cbc[_0x9118('0x14')]=qs[_0x9118('0x14')](_0x29b736[_0x9118('0x29')]['limit']);_0x218cbc[_0x9118('0x16')]=qs['offset'](_0x29b736[_0x9118('0x29')][_0x9118('0x16')]);}return _0x2e3c54[_0x9118('0x7b')](_0x218cbc);}})[_0x9118('0x19')](function(_0x29c50a){if(_0x29c50a){return _0x29c50a?{'count':_0xfd1a7b,'rows':_0x29c50a}:null;}})['then'](respondWithResult(_0x492bcd,null))[_0x9118('0x34')](handleError(_0x492bcd,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 74dc811..9836041 100644 --- a/server/api/faxQueue/faxQueue.events.js +++ b/server/api/faxQueue/faxQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc53a=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x565f31,_0x18cc83){var _0x502cfa=function(_0x278921){while(--_0x278921){_0x565f31['push'](_0x565f31['shift']());}};_0x502cfa(++_0x18cc83);}(_0xc53a,0xfc));var _0xac53=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc53a[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0xac53('0x0'));var FaxQueue=require(_0xac53('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xac53('0x2')](0x0);var events={'afterCreate':_0xac53('0x3'),'afterUpdate':'update','afterDestroy':_0xac53('0x4')};function emitEvent(_0x37a66c){return function(_0x294570,_0x4ba940,_0x1a8462){FaxQueueEvents[_0xac53('0x5')](_0x37a66c+':'+_0x294570['id'],_0x294570);FaxQueueEvents['emit'](_0x37a66c,_0x294570);_0x1a8462(null);};}for(var e in events){if(events[_0xac53('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xac53('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x111a=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x395f6c,_0x53a5e0){var _0x1ca604=function(_0x37ee9e){while(--_0x37ee9e){_0x395f6c['push'](_0x395f6c['shift']());}};_0x1ca604(++_0x53a5e0);}(_0x111a,0x101));var _0xa111=function(_0x138bae,_0xa44713){_0x138bae=_0x138bae-0x0;var _0x4a13e2=_0x111a[_0x138bae];return _0x4a13e2;};'use strict';var EventEmitter=require(_0xa111('0x0'));var FaxQueue=require(_0xa111('0x1'))['db'][_0xa111('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xa111('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa111('0x4')};function emitEvent(_0x18e7ac){return function(_0x39d10e,_0xfed0b6,_0x4ce1de){FaxQueueEvents[_0xa111('0x5')](_0x18e7ac+':'+_0x39d10e['id'],_0x39d10e);FaxQueueEvents[_0xa111('0x5')](_0x18e7ac,_0x39d10e);_0x4ce1de(null);};}for(var e in events){if(events[_0xa111('0x6')](e)){var event=events[e];FaxQueue[_0xa111('0x7')](e,emitEvent(event));}}module[_0xa111('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 16f7183..c971e59 100644 --- a/server/api/faxQueue/faxQueue.model.js +++ b/server/api/faxQueue/faxQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9fbb=['exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./faxQueue.attributes'];(function(_0x848f5d,_0xccf307){var _0x542d82=function(_0xc7c07b){while(--_0xc7c07b){_0x848f5d['push'](_0x848f5d['shift']());}};_0x542d82(++_0xccf307);}(_0x9fbb,0xc7));var _0xb9fb=function(_0x202e44,_0x3516e7){_0x202e44=_0x202e44-0x0;var _0x11d6b3=_0x9fbb[_0x202e44];return _0x11d6b3;};'use strict';var _=require(_0xb9fb('0x0'));var util=require(_0xb9fb('0x1'));var logger=require(_0xb9fb('0x2'))(_0xb9fb('0x3'));var moment=require('moment');var BPromise=require(_0xb9fb('0x4'));var rp=require(_0xb9fb('0x5'));var fs=require('fs');var path=require(_0xb9fb('0x6'));var rimraf=require('rimraf');var config=require(_0xb9fb('0x7'));var attributes=require(_0xb9fb('0x8'));module[_0xb9fb('0x9')]=function(_0x1a9902,_0x4b0cb3){return _0x1a9902[_0xb9fb('0xa')](_0xb9fb('0xb'),attributes,{'tableName':_0xb9fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1154=['rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','moment','request-promise','path'];(function(_0x206711,_0x4125b4){var _0x4fe02b=function(_0x27dc45){while(--_0x27dc45){_0x206711['push'](_0x206711['shift']());}};_0x4fe02b(++_0x4125b4);}(_0x1154,0x73));var _0x4115=function(_0x5b3760,_0x7b43b1){_0x5b3760=_0x5b3760-0x0;var _0x38b52c=_0x1154[_0x5b3760];return _0x38b52c;};'use strict';var _=require(_0x4115('0x0'));var util=require(_0x4115('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4115('0x2'));var BPromise=require('bluebird');var rp=require(_0x4115('0x3'));var fs=require('fs');var path=require(_0x4115('0x4'));var rimraf=require(_0x4115('0x5'));var config=require(_0x4115('0x6'));var attributes=require(_0x4115('0x7'));module[_0x4115('0x8')]=function(_0x47b446,_0x5c1fce){return _0x47b446[_0x4115('0x9')](_0x4115('0xa'),attributes,{'tableName':_0x4115('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 70968da..ba17363 100644 --- a/server/api/faxQueue/faxQueue.rpc.js +++ b/server/api/faxQueue/faxQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc336=['message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','info','GetFaxQueue','debug','ShowFaxQueue','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','socket.io-emitter','./faxQueue.socket','register','request','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3688d5,_0x51d2b7){var _0x3013c4=function(_0x5b3b4c){while(--_0x5b3b4c){_0x3688d5['push'](_0x3688d5['shift']());}};_0x3013c4(++_0x51d2b7);}(_0xc336,0x86));var _0x6c33=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0xc336[_0x3da832];return _0xe602f2;};'use strict';var _=require(_0x6c33('0x0'));var util=require(_0x6c33('0x1'));var moment=require(_0x6c33('0x2'));var BPromise=require(_0x6c33('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c33('0x4'));var db=require(_0x6c33('0x5'))['db'];var utils=require(_0x6c33('0x6'));var logger=require('../../config/logger')(_0x6c33('0x7'));var config=require('../../config/environment');var jayson=require(_0x6c33('0x8'));var client=jayson[_0x6c33('0x9')][_0x6c33('0xa')]({'port':0x232a});config[_0x6c33('0xb')]=_['defaults'](config[_0x6c33('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6c33('0xc'))(new Redis(config[_0x6c33('0xb')]));require(_0x6c33('0xd'))[_0x6c33('0xe')](socket);function respondWithRpcPromise(_0x5cfcb4,_0x1df6a6,_0x17c759){return new BPromise(function(_0x65bda1,_0x4f22cd){return client[_0x6c33('0xf')](_0x5cfcb4,_0x17c759)['then'](function(_0xeceb09){logger['info'](_0x6c33('0x10'),_0x1df6a6,_0x6c33('0x11'));logger['debug'](_0x6c33('0x12'),_0x1df6a6,_0x6c33('0x11'),JSON[_0x6c33('0x13')](_0xeceb09));if(_0xeceb09[_0x6c33('0x14')]){if(_0xeceb09[_0x6c33('0x14')][_0x6c33('0x15')]===0x1f4){logger[_0x6c33('0x14')](_0x6c33('0x10'),_0x1df6a6,_0xeceb09[_0x6c33('0x14')][_0x6c33('0x16')]);return _0x4f22cd(_0xeceb09[_0x6c33('0x14')]['message']);}logger['error'](_0x6c33('0x10'),_0x1df6a6,_0xeceb09[_0x6c33('0x14')][_0x6c33('0x16')]);return _0x65bda1(_0xeceb09[_0x6c33('0x14')][_0x6c33('0x16')]);}else{logger['info'](_0x6c33('0x10'),_0x1df6a6,_0x6c33('0x11'));_0x65bda1(_0xeceb09[_0x6c33('0x17')]['message']);}})[_0x6c33('0x18')](function(_0x45c785){logger['error'](_0x6c33('0x10'),_0x1df6a6,_0x45c785);_0x4f22cd(_0x45c785);});});}exports['GetFaxQueue']=function(_0x57b9b0){var _0x32ad31=this;return new Promise(function(_0x37737e,_0x3afec4){return db['FaxQueue'][_0x6c33('0x19')]({'raw':_0x57b9b0[_0x6c33('0x1a')]?_0x57b9b0[_0x6c33('0x1a')][_0x6c33('0x1b')]===undefined?!![]:![]:!![],'where':_0x57b9b0[_0x6c33('0x1a')]?_0x57b9b0[_0x6c33('0x1a')][_0x6c33('0x1c')]||null:null,'attributes':_0x57b9b0[_0x6c33('0x1a')]?_0x57b9b0['options'][_0x6c33('0x1d')]||null:null,'limit':_0x57b9b0['options']?_0x57b9b0[_0x6c33('0x1a')][_0x6c33('0x1e')]||null:null,'include':_0x57b9b0[_0x6c33('0x1a')]?_0x57b9b0['options'][_0x6c33('0x1f')]?_[_0x6c33('0x20')](_0x57b9b0[_0x6c33('0x1a')][_0x6c33('0x1f')],function(_0x10db88){return{'model':db[_0x10db88[_0x6c33('0x21')]],'as':_0x10db88['as'],'attributes':_0x10db88[_0x6c33('0x1d')],'include':_0x10db88[_0x6c33('0x1f')]?_[_0x6c33('0x20')](_0x10db88['include'],function(_0x8fba53){return{'model':db[_0x8fba53[_0x6c33('0x21')]],'as':_0x8fba53['as'],'attributes':_0x8fba53['attributes'],'include':_0x8fba53[_0x6c33('0x1f')]?_['map'](_0x8fba53[_0x6c33('0x1f')],function(_0x5e8d6b){return{'model':db[_0x5e8d6b['model']],'as':_0x5e8d6b['as'],'attributes':_0x5e8d6b[_0x6c33('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19abc0){logger[_0x6c33('0x22')](_0x6c33('0x23'),_0x57b9b0);logger[_0x6c33('0x24')](_0x6c33('0x23'),_0x57b9b0,JSON['stringify'](_0x19abc0));_0x37737e(_0x19abc0);})[_0x6c33('0x18')](function(_0x1240fc){logger[_0x6c33('0x14')](_0x6c33('0x23'),_0x1240fc[_0x6c33('0x16')],_0x57b9b0);_0x3afec4(_0x32ad31[_0x6c33('0x14')](0x1f4,_0x1240fc[_0x6c33('0x16')]));});});};exports[_0x6c33('0x25')]=function(_0xc994e4){var _0x3b03e7=this;return new Promise(function(_0x5c10d7,_0x4156eb){return db['FaxQueue']['find']({'raw':_0xc994e4['options']?_0xc994e4[_0x6c33('0x1a')][_0x6c33('0x1b')]===undefined?!![]:![]:!![],'where':_0xc994e4['options']?_0xc994e4[_0x6c33('0x1a')][_0x6c33('0x1c')]||null:null,'attributes':_0xc994e4[_0x6c33('0x1a')]?_0xc994e4['options']['attributes']||null:null,'include':_0xc994e4[_0x6c33('0x1a')]?_0xc994e4[_0x6c33('0x1a')]['include']?_['map'](_0xc994e4[_0x6c33('0x1a')][_0x6c33('0x1f')],function(_0x18bd29){return{'model':db[_0x18bd29[_0x6c33('0x21')]],'as':_0x18bd29['as'],'attributes':_0x18bd29['attributes'],'include':_0x18bd29[_0x6c33('0x1f')]?_[_0x6c33('0x20')](_0x18bd29[_0x6c33('0x1f')],function(_0x4049e2){return{'model':db[_0x4049e2[_0x6c33('0x21')]],'as':_0x4049e2['as'],'attributes':_0x4049e2[_0x6c33('0x1d')],'include':_0x4049e2[_0x6c33('0x1f')]?_['map'](_0x4049e2['include'],function(_0x38313c){return{'model':db[_0x38313c['model']],'as':_0x38313c['as'],'attributes':_0x38313c[_0x6c33('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6c33('0x26')](function(_0x4dff47){logger[_0x6c33('0x22')](_0x6c33('0x25'),_0xc994e4);logger[_0x6c33('0x24')](_0x6c33('0x25'),_0xc994e4,JSON['stringify'](_0x4dff47));_0x5c10d7(_0x4dff47);})[_0x6c33('0x18')](function(_0x33ded2){logger[_0x6c33('0x14')]('ShowFaxQueue',_0x33ded2[_0x6c33('0x16')],_0xc994e4);_0x4156eb(_0x3b03e7[_0x6c33('0x14')](0x1f4,_0x33ded2[_0x6c33('0x16')]));});});}; \ No newline at end of file +var _0x9a05=['./faxQueue.socket','register','request','then','info','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','limit','map','include','model','debug','stringify','ShowFaxQueue','find','raw','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9a05,0xbb));var _0x59a0=function(_0x3d47ae,_0x131b67){_0x3d47ae=_0x3d47ae-0x0;var _0x1c11bd=_0x9a05[_0x3d47ae];return _0x1c11bd;};'use strict';var _=require('lodash');var util=require(_0x59a0('0x0'));var moment=require(_0x59a0('0x1'));var BPromise=require(_0x59a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x59a0('0x3'));var db=require(_0x59a0('0x4'))['db'];var utils=require(_0x59a0('0x5'));var logger=require(_0x59a0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x59a0('0x7')][_0x59a0('0x8')]({'port':0x232a});config[_0x59a0('0x9')]=_[_0x59a0('0xa')](config[_0x59a0('0x9')],{'host':_0x59a0('0xb'),'port':0x18eb});var socket=require(_0x59a0('0xc'))(new Redis(config['redis']));require(_0x59a0('0xd'))[_0x59a0('0xe')](socket);function respondWithRpcPromise(_0x478d1e,_0x6f37cb,_0x5d7639){return new BPromise(function(_0x22cd5b,_0x51bdc4){return client[_0x59a0('0xf')](_0x478d1e,_0x5d7639)[_0x59a0('0x10')](function(_0x2597a4){logger[_0x59a0('0x11')]('FaxQueue,\x20%s,\x20%s',_0x6f37cb,_0x59a0('0x12'));logger['debug'](_0x59a0('0x13'),_0x6f37cb,_0x59a0('0x12'),JSON['stringify'](_0x2597a4));if(_0x2597a4['error']){if(_0x2597a4[_0x59a0('0x14')]['code']===0x1f4){logger[_0x59a0('0x14')](_0x59a0('0x15'),_0x6f37cb,_0x2597a4['error'][_0x59a0('0x16')]);return _0x51bdc4(_0x2597a4['error'][_0x59a0('0x16')]);}logger[_0x59a0('0x14')](_0x59a0('0x15'),_0x6f37cb,_0x2597a4[_0x59a0('0x14')][_0x59a0('0x16')]);return _0x22cd5b(_0x2597a4[_0x59a0('0x14')][_0x59a0('0x16')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x6f37cb,_0x59a0('0x12'));_0x22cd5b(_0x2597a4[_0x59a0('0x17')][_0x59a0('0x16')]);}})[_0x59a0('0x18')](function(_0x5c0abc){logger[_0x59a0('0x14')](_0x59a0('0x15'),_0x6f37cb,_0x5c0abc);_0x51bdc4(_0x5c0abc);});});}exports[_0x59a0('0x19')]=function(_0x287612){var _0x5480f6=this;return new Promise(function(_0x1ddd06,_0xfb1b5c){return db[_0x59a0('0x1a')][_0x59a0('0x1b')]({'raw':_0x287612[_0x59a0('0x1c')]?_0x287612[_0x59a0('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x287612[_0x59a0('0x1c')]?_0x287612[_0x59a0('0x1c')][_0x59a0('0x1d')]||null:null,'attributes':_0x287612[_0x59a0('0x1c')]?_0x287612[_0x59a0('0x1c')][_0x59a0('0x1e')]||null:null,'limit':_0x287612[_0x59a0('0x1c')]?_0x287612['options'][_0x59a0('0x1f')]||null:null,'include':_0x287612[_0x59a0('0x1c')]?_0x287612[_0x59a0('0x1c')]['include']?_[_0x59a0('0x20')](_0x287612[_0x59a0('0x1c')][_0x59a0('0x21')],function(_0x464e85){return{'model':db[_0x464e85['model']],'as':_0x464e85['as'],'attributes':_0x464e85[_0x59a0('0x1e')],'include':_0x464e85[_0x59a0('0x21')]?_[_0x59a0('0x20')](_0x464e85[_0x59a0('0x21')],function(_0x3cdb14){return{'model':db[_0x3cdb14[_0x59a0('0x22')]],'as':_0x3cdb14['as'],'attributes':_0x3cdb14['attributes'],'include':_0x3cdb14[_0x59a0('0x21')]?_[_0x59a0('0x20')](_0x3cdb14['include'],function(_0xed8b1e){return{'model':db[_0xed8b1e['model']],'as':_0xed8b1e['as'],'attributes':_0xed8b1e[_0x59a0('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4af497){logger[_0x59a0('0x11')]('GetFaxQueue',_0x287612);logger[_0x59a0('0x23')](_0x59a0('0x19'),_0x287612,JSON[_0x59a0('0x24')](_0x4af497));_0x1ddd06(_0x4af497);})[_0x59a0('0x18')](function(_0x3eb376){logger[_0x59a0('0x14')](_0x59a0('0x19'),_0x3eb376['message'],_0x287612);_0xfb1b5c(_0x5480f6[_0x59a0('0x14')](0x1f4,_0x3eb376[_0x59a0('0x16')]));});});};exports[_0x59a0('0x25')]=function(_0x1c3dca){var _0xf9372a=this;return new Promise(function(_0xb3d131,_0x5cae31){return db[_0x59a0('0x1a')][_0x59a0('0x26')]({'raw':_0x1c3dca[_0x59a0('0x1c')]?_0x1c3dca[_0x59a0('0x1c')][_0x59a0('0x27')]===undefined?!![]:![]:!![],'where':_0x1c3dca['options']?_0x1c3dca[_0x59a0('0x1c')]['where']||null:null,'attributes':_0x1c3dca['options']?_0x1c3dca[_0x59a0('0x1c')][_0x59a0('0x1e')]||null:null,'include':_0x1c3dca[_0x59a0('0x1c')]?_0x1c3dca[_0x59a0('0x1c')][_0x59a0('0x21')]?_['map'](_0x1c3dca[_0x59a0('0x1c')][_0x59a0('0x21')],function(_0x1d89df){return{'model':db[_0x1d89df[_0x59a0('0x22')]],'as':_0x1d89df['as'],'attributes':_0x1d89df[_0x59a0('0x1e')],'include':_0x1d89df[_0x59a0('0x21')]?_[_0x59a0('0x20')](_0x1d89df[_0x59a0('0x21')],function(_0x4a917b){return{'model':db[_0x4a917b['model']],'as':_0x4a917b['as'],'attributes':_0x4a917b['attributes'],'include':_0x4a917b[_0x59a0('0x21')]?_['map'](_0x4a917b[_0x59a0('0x21')],function(_0x36e069){return{'model':db[_0x36e069[_0x59a0('0x22')]],'as':_0x36e069['as'],'attributes':_0x36e069[_0x59a0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x59a0('0x10')](function(_0x473d4c){logger[_0x59a0('0x11')](_0x59a0('0x25'),_0x1c3dca);logger[_0x59a0('0x23')](_0x59a0('0x25'),_0x1c3dca,JSON[_0x59a0('0x24')](_0x473d4c));_0xb3d131(_0x473d4c);})['catch'](function(_0x4fd4ea){logger['error'](_0x59a0('0x25'),_0x4fd4ea[_0x59a0('0x16')],_0x1c3dca);_0x5cae31(_0xf9372a[_0x59a0('0x14')](0x1f4,_0x4fd4ea['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index d3900be..9198ad3 100644 --- a/server/api/faxQueue/faxQueue.socket.js +++ b/server/api/faxQueue/faxQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3783=['register','length','faxQueue:','save','remove','update'];(function(_0x27a900,_0x1cc305){var _0xea9b1f=function(_0xaddd55){while(--_0xaddd55){_0x27a900['push'](_0x27a900['shift']());}};_0xea9b1f(++_0x1cc305);}(_0x3783,0x1dd));var _0x3378=function(_0x6f346a,_0x4246bd){_0x6f346a=_0x6f346a-0x0;var _0x133f05=_0x3783[_0x6f346a];return _0x133f05;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x3378('0x0'),_0x3378('0x1'),_0x3378('0x2')];function createListener(_0x354c24,_0x384a24){return function(_0x2959e4){_0x384a24['emit'](_0x354c24,_0x2959e4);};}function removeListener(_0x370f94,_0x16377b){return function(){FaxQueueEvents['removeListener'](_0x370f94,_0x16377b);};}exports[_0x3378('0x3')]=function(_0x23958d){for(var _0x82f9fd=0x0,_0x1572fd=events[_0x3378('0x4')];_0x82f9fd<_0x1572fd;_0x82f9fd++){var _0x431102=events[_0x82f9fd];var _0x4aab30=createListener(_0x3378('0x5')+_0x431102,_0x23958d);FaxQueueEvents['on'](_0x431102,_0x4aab30);}}; \ No newline at end of file +var _0xf69d=['removeListener','register','length','faxQueue:','./faxQueue.events','save','remove','update','emit'];(function(_0x186222,_0x3bdfb0){var _0x226a38=function(_0x3b071f){while(--_0x3b071f){_0x186222['push'](_0x186222['shift']());}};_0x226a38(++_0x3bdfb0);}(_0xf69d,0xd3));var _0xdf69=function(_0x598088,_0x10eaa6){_0x598088=_0x598088-0x0;var _0x2653eb=_0xf69d[_0x598088];return _0x2653eb;};'use strict';var FaxQueueEvents=require(_0xdf69('0x0'));var events=[_0xdf69('0x1'),_0xdf69('0x2'),_0xdf69('0x3')];function createListener(_0xf89475,_0x4e4bdd){return function(_0x3013e5){_0x4e4bdd[_0xdf69('0x4')](_0xf89475,_0x3013e5);};}function removeListener(_0x5b5eec,_0x13ecb6){return function(){FaxQueueEvents[_0xdf69('0x5')](_0x5b5eec,_0x13ecb6);};}exports[_0xdf69('0x6')]=function(_0x2d456f){for(var _0x465b1b=0x0,_0x1d2501=events[_0xdf69('0x7')];_0x465b1b<_0x1d2501;_0x465b1b++){var _0x18a08e=events[_0x465b1b];var _0xc1b77e=createListener(_0xdf69('0x8')+_0x18a08e,_0x2d456f);FaxQueueEvents['on'](_0x18a08e,_0xc1b77e);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 4f08f58..260a168 100644 --- a/server/api/faxQueue/index.js +++ b/server/api/faxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8aad=['removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','isAuthenticated','index','get','describe','/:id','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','/:id/teams','removeTeams'];(function(_0x4f614a,_0x2f1acc){var _0x516c61=function(_0x354c89){while(--_0x354c89){_0x4f614a['push'](_0x4f614a['shift']());}};_0x516c61(++_0x2f1acc);}(_0x8aad,0x146));var _0xd8aa=function(_0x348dad,_0x3e299b){_0x348dad=_0x348dad-0x0;var _0x36ef3f=_0x8aad[_0x348dad];return _0x36ef3f;};'use strict';var multer=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var path=require('path');var timeout=require(_0xd8aa('0x2'));var express=require('express');var router=express[_0xd8aa('0x3')]();var fs_extra=require(_0xd8aa('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd8aa('0x5'));var controller=require('./faxQueue.controller');router['get']('/',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x7')]);router[_0xd8aa('0x8')]('/describe',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x9')]);router[_0xd8aa('0x8')](_0xd8aa('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd8aa('0x8')](_0xd8aa('0xb'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0xc')]);router[_0xd8aa('0x8')]('/:id/teams',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0xd')]);router[_0xd8aa('0x8')](_0xd8aa('0xe'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0xf')]);router[_0xd8aa('0x10')]('/',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x11')]);router[_0xd8aa('0x10')]('/:id/teams',auth['isAuthenticated'](),controller[_0xd8aa('0x12')]);router[_0xd8aa('0x10')](_0xd8aa('0xe'),auth['isAuthenticated'](),controller[_0xd8aa('0x13')]);router[_0xd8aa('0x14')](_0xd8aa('0xa'),auth[_0xd8aa('0x6')](),controller['update']);router[_0xd8aa('0x15')](_0xd8aa('0xa'),auth['isAuthenticated'](),controller[_0xd8aa('0x16')]);router[_0xd8aa('0x15')](_0xd8aa('0x17'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x18')]);router['delete'](_0xd8aa('0xe'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x19')]);module[_0xd8aa('0x1a')]=router; \ No newline at end of file +var _0xdeb3=['exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','isAuthenticated','get','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','put','update','delete','removeTeams','removeAgents'];(function(_0x410e63,_0x5cfb30){var _0x211782=function(_0x2e229c){while(--_0x2e229c){_0x410e63['push'](_0x410e63['shift']());}};_0x211782(++_0x5cfb30);}(_0xdeb3,0xb7));var _0x3deb=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xdeb3[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require(_0x3deb('0x0'));var path=require(_0x3deb('0x1'));var timeout=require(_0x3deb('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3deb('0x3'));var auth=require(_0x3deb('0x4'));var interaction=require(_0x3deb('0x5'));var config=require(_0x3deb('0x6'));var controller=require(_0x3deb('0x7'));router['get']('/',auth[_0x3deb('0x8')](),controller['index']);router[_0x3deb('0x9')]('/describe',auth[_0x3deb('0x8')](),controller[_0x3deb('0xa')]);router[_0x3deb('0x9')](_0x3deb('0xb'),auth[_0x3deb('0x8')](),controller[_0x3deb('0xc')]);router[_0x3deb('0x9')](_0x3deb('0xd'),auth[_0x3deb('0x8')](),controller['getMembers']);router['get'](_0x3deb('0xe'),auth[_0x3deb('0x8')](),controller[_0x3deb('0xf')]);router['get'](_0x3deb('0x10'),auth[_0x3deb('0x8')](),controller[_0x3deb('0x11')]);router[_0x3deb('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x3deb('0xe'),auth[_0x3deb('0x8')](),controller[_0x3deb('0x13')]);router['post'](_0x3deb('0x10'),auth[_0x3deb('0x8')](),controller['addAgents']);router[_0x3deb('0x14')](_0x3deb('0xb'),auth['isAuthenticated'](),controller[_0x3deb('0x15')]);router['delete'](_0x3deb('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x3deb('0x16')](_0x3deb('0xe'),auth[_0x3deb('0x8')](),controller[_0x3deb('0x17')]);router[_0x3deb('0x16')](_0x3deb('0x10'),auth['isAuthenticated'](),controller[_0x3deb('0x18')]);module[_0x3deb('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 839c5a9..6343616 100644 --- a/server/api/faxQueueReport/faxQueueReport.attributes.js +++ b/server/api/faxQueueReport/faxQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a93=['sequelize','STRING','DATE'];(function(_0x3d86f5,_0x257914){var _0x2d6881=function(_0x2d912e){while(--_0x2d912e){_0x3d86f5['push'](_0x3d86f5['shift']());}};_0x2d6881(++_0x257914);}(_0x5a93,0xf6));var _0x35a9=function(_0x3500c6,_0x4de955){_0x3500c6=_0x3500c6-0x0;var _0x3fccec=_0x5a93[_0x3500c6];return _0x3fccec;};'use strict';var moment=require('moment');var Sequelize=require(_0x35a9('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x35a9('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x35a9('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x35a9('0x2')]},'exitAt':{'type':Sequelize[_0x35a9('0x2')]},'reason':{'type':Sequelize[_0x35a9('0x1')]}}; \ No newline at end of file +var _0x364f=['STRING','DATE','moment','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x364f,0x16e));var _0xf364=function(_0x27ad07,_0x2d3d47){_0x27ad07=_0x27ad07-0x0;var _0x3148b4=_0x364f[_0x27ad07];return _0x3148b4;};'use strict';var moment=require(_0xf364('0x0'));var Sequelize=require('sequelize');module[_0xf364('0x1')]={'uniqueid':{'type':Sequelize[_0xf364('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf364('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf364('0x3')]},'acceptAt':{'type':Sequelize[_0xf364('0x3')]},'exitAt':{'type':Sequelize[_0xf364('0x3')]},'reason':{'type':Sequelize[_0xf364('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index a11a3b2..3b7be68 100644 --- a/server/api/faxQueueReport/faxQueueReport.controller.js +++ b/server/api/faxQueueReport/faxQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1948=['count','offset','apply','save','update','then','destroy','end','error','stack','send','index','rawAttributes','type','model','name','query','keys','filters','attributes','fields','length','order','sort','where','pick','filter','merge','options','include','FaxQueueReport','findAll','catch','show','intersection','includeAll','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit'];(function(_0x3f3ac8,_0x4fa33c){var _0x1ecf8c=function(_0x503629){while(--_0x503629){_0x3f3ac8['push'](_0x3f3ac8['shift']());}};_0x1ecf8c(++_0x4fa33c);}(_0x1948,0x145));var _0x8194=function(_0x1d3146,_0x1fa6d4){_0x1d3146=_0x1d3146-0x0;var _0x555e3f=_0x1948[_0x1d3146];return _0x555e3f;};'use strict';var emlformat=require(_0x8194('0x0'));var rimraf=require(_0x8194('0x1'));var zipdir=require(_0x8194('0x2'));var jsonpatch=require(_0x8194('0x3'));var rp=require(_0x8194('0x4'));var moment=require('moment');var BPromise=require(_0x8194('0x5'));var Mustache=require(_0x8194('0x6'));var util=require(_0x8194('0x7'));var path=require(_0x8194('0x8'));var sox=require(_0x8194('0x9'));var csv=require(_0x8194('0xa'));var ejs=require(_0x8194('0xb'));var fs=require('fs');var fs_extra=require(_0x8194('0xc'));var _=require('lodash');var squel=require(_0x8194('0xd'));var crypto=require(_0x8194('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8194('0xf'));var toCsv=require(_0x8194('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8194('0x10'));var authService=require(_0x8194('0x11'));var qs=require(_0x8194('0x12'));var as=require(_0x8194('0x13'));var hardwareService=require(_0x8194('0x14'));var logger=require('../../config/logger')(_0x8194('0x15'));var utils=require(_0x8194('0x16'));var config=require(_0x8194('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8194('0x18'))['db'];function respondWithStatusCode(_0x3d7aea,_0x1aa698){_0x1aa698=_0x1aa698||0xcc;return function(_0xeba106){if(_0xeba106){return _0x3d7aea[_0x8194('0x19')](_0x1aa698);}return _0x3d7aea[_0x8194('0x1a')](_0x1aa698)['end']();};}function respondWithResult(_0x1ae7ec,_0x215b95){_0x215b95=_0x215b95||0xc8;return function(_0xfd031c){if(_0xfd031c){return _0x1ae7ec[_0x8194('0x1a')](_0x215b95)[_0x8194('0x1b')](_0xfd031c);}};}function respondWithFilteredResult(_0x27adfc,_0x112d44){return function(_0x13e166){if(_0x13e166){var _0x19c23e=typeof _0x112d44['offset']===_0x8194('0x1c')&&typeof _0x112d44[_0x8194('0x1d')]==='undefined';var _0x41a11e=_0x13e166['count'];var _0x55e4c2=_0x19c23e?0x0:_0x112d44['offset'];var _0x37b048=_0x19c23e?_0x13e166[_0x8194('0x1e')]:_0x112d44[_0x8194('0x1f')]+_0x112d44[_0x8194('0x1d')];var _0x956c6a;if(_0x37b048>=_0x41a11e){_0x37b048=_0x41a11e;_0x956c6a=0xc8;}else{_0x956c6a=0xce;}_0x27adfc[_0x8194('0x1a')](_0x956c6a);return _0x27adfc['set']('Content-Range',_0x55e4c2+'-'+_0x37b048+'/'+_0x41a11e)[_0x8194('0x1b')](_0x13e166);}return null;};}function patchUpdates(_0x588cac){return function(_0x43d763){try{jsonpatch[_0x8194('0x20')](_0x43d763,_0x588cac,!![]);}catch(_0x9421f5){return BPromise['reject'](_0x9421f5);}return _0x43d763[_0x8194('0x21')]();};}function saveUpdates(_0x11ce0c,_0x41641d){return function(_0x28df4f){if(_0x28df4f){return _0x28df4f[_0x8194('0x22')](_0x11ce0c)[_0x8194('0x23')](function(_0x2c5061){return _0x2c5061;});}return null;};}function removeEntity(_0xe593e9,_0x269a22){return function(_0x263093){if(_0x263093){return _0x263093[_0x8194('0x24')]()[_0x8194('0x23')](function(){_0xe593e9['status'](0xcc)[_0x8194('0x25')]();});}};}function handleEntityNotFound(_0x1216b1,_0x21e92d){return function(_0x46a242){if(!_0x46a242){_0x1216b1['sendStatus'](0x194);}return _0x46a242;};}function handleError(_0x34c430,_0x381dec){_0x381dec=_0x381dec||0x1f4;return function(_0x425a1d){logger[_0x8194('0x26')](_0x425a1d[_0x8194('0x27')]);if(_0x425a1d['name']){delete _0x425a1d['name'];}_0x34c430[_0x8194('0x1a')](_0x381dec)[_0x8194('0x28')](_0x425a1d);};}exports[_0x8194('0x29')]=function(_0x996c97,_0x181b8e){var _0x56c512={},_0x4af9cc={},_0x5624a0={'count':0x0,'rows':[]};var _0x1ea1f=_['map'](db['FaxQueueReport'][_0x8194('0x2a')],function(_0x4178f4){return{'name':_0x4178f4['fieldName'],'type':_0x4178f4[_0x8194('0x2b')]['key']};});_0x4af9cc[_0x8194('0x2c')]=_['map'](_0x1ea1f,_0x8194('0x2d'));_0x4af9cc[_0x8194('0x2e')]=_[_0x8194('0x2f')](_0x996c97[_0x8194('0x2e')]);_0x4af9cc[_0x8194('0x30')]=_['intersection'](_0x4af9cc[_0x8194('0x2c')],_0x4af9cc['query']);_0x56c512[_0x8194('0x31')]=_['intersection'](_0x4af9cc[_0x8194('0x2c')],qs[_0x8194('0x32')](_0x996c97[_0x8194('0x2e')]['fields']));_0x56c512['attributes']=_0x56c512[_0x8194('0x31')][_0x8194('0x33')]?_0x56c512[_0x8194('0x31')]:_0x4af9cc[_0x8194('0x2c')];if(!_0x996c97['query']['hasOwnProperty']('nolimit')){_0x56c512[_0x8194('0x1d')]=qs[_0x8194('0x1d')](_0x996c97[_0x8194('0x2e')][_0x8194('0x1d')]);_0x56c512[_0x8194('0x1f')]=qs[_0x8194('0x1f')](_0x996c97['query'][_0x8194('0x1f')]);}_0x56c512[_0x8194('0x34')]=qs[_0x8194('0x35')](_0x996c97[_0x8194('0x2e')][_0x8194('0x35')]);_0x56c512[_0x8194('0x36')]=qs[_0x8194('0x30')](_[_0x8194('0x37')](_0x996c97[_0x8194('0x2e')],_0x4af9cc[_0x8194('0x30')]),_0x1ea1f);if(_0x996c97[_0x8194('0x2e')][_0x8194('0x38')]){_0x56c512['where']=_[_0x8194('0x39')](_0x56c512['where'],{'$or':_['map'](_0x1ea1f,function(_0x3026fd){if(_0x3026fd[_0x8194('0x2b')]!=='VIRTUAL'){var _0x5dcd15={};_0x5dcd15[_0x3026fd['name']]={'$like':'%'+_0x996c97['query']['filter']+'%'};return _0x5dcd15;}})});}_0x56c512=_[_0x8194('0x39')]({},_0x56c512,_0x996c97[_0x8194('0x3a')]);var _0x2673b0={'where':_0x56c512['where']};return db['FaxQueueReport']['count'](_0x2673b0)[_0x8194('0x23')](function(_0x4064e0){_0x5624a0[_0x8194('0x1e')]=_0x4064e0;if(_0x996c97[_0x8194('0x2e')]['includeAll']){_0x56c512[_0x8194('0x3b')]=[{'all':!![]}];}return db[_0x8194('0x3c')][_0x8194('0x3d')](_0x56c512);})[_0x8194('0x23')](function(_0x371327){_0x5624a0['rows']=_0x371327;return _0x5624a0;})[_0x8194('0x23')](respondWithFilteredResult(_0x181b8e,_0x56c512))[_0x8194('0x3e')](handleError(_0x181b8e,null));};exports[_0x8194('0x3f')]=function(_0x106a3f,_0x32f215){var _0xb3f9ec={'raw':!![],'where':{'id':_0x106a3f['params']['id']}},_0x36789b={};_0x36789b[_0x8194('0x2c')]=_[_0x8194('0x2f')](db[_0x8194('0x3c')][_0x8194('0x2a')]);_0x36789b['query']=_['keys'](_0x106a3f[_0x8194('0x2e')]);_0x36789b['filters']=_[_0x8194('0x40')](_0x36789b['model'],_0x36789b[_0x8194('0x2e')]);_0xb3f9ec['attributes']=_[_0x8194('0x40')](_0x36789b[_0x8194('0x2c')],qs[_0x8194('0x32')](_0x106a3f[_0x8194('0x2e')]['fields']));_0xb3f9ec[_0x8194('0x31')]=_0xb3f9ec[_0x8194('0x31')][_0x8194('0x33')]?_0xb3f9ec['attributes']:_0x36789b[_0x8194('0x2c')];if(_0x106a3f[_0x8194('0x2e')][_0x8194('0x41')]){_0xb3f9ec[_0x8194('0x3b')]=[{'all':!![]}];}_0xb3f9ec=_[_0x8194('0x39')]({},_0xb3f9ec,_0x106a3f['options']);return db[_0x8194('0x3c')]['find'](_0xb3f9ec)[_0x8194('0x23')](handleEntityNotFound(_0x32f215,null))[_0x8194('0x23')](respondWithResult(_0x32f215,null))[_0x8194('0x3e')](handleError(_0x32f215,null));};exports[_0x8194('0x42')]=function(_0x5b3b3d,_0x32a1cd){return db[_0x8194('0x3c')][_0x8194('0x42')](_0x5b3b3d[_0x8194('0x43')],{})[_0x8194('0x23')](respondWithResult(_0x32a1cd,0xc9))[_0x8194('0x3e')](handleError(_0x32a1cd,null));};exports[_0x8194('0x22')]=function(_0x398579,_0x349e27){if(_0x398579[_0x8194('0x43')]['id']){delete _0x398579[_0x8194('0x43')]['id'];}return db[_0x8194('0x3c')][_0x8194('0x44')]({'where':{'id':_0x398579['params']['id']}})[_0x8194('0x23')](handleEntityNotFound(_0x349e27,null))[_0x8194('0x23')](saveUpdates(_0x398579['body'],null))['then'](respondWithResult(_0x349e27,null))[_0x8194('0x3e')](handleError(_0x349e27,null));};exports[_0x8194('0x24')]=function(_0x2ac683,_0x3029fe){return db[_0x8194('0x3c')][_0x8194('0x44')]({'where':{'id':_0x2ac683[_0x8194('0x45')]['id']}})[_0x8194('0x23')](handleEntityNotFound(_0x3029fe,null))[_0x8194('0x23')](removeEntity(_0x3029fe,null))[_0x8194('0x3e')](handleError(_0x3029fe,null));};exports['describe']=function(_0x49ba9f,_0x510f6d){return db['FaxQueueReport'][_0x8194('0x46')]()[_0x8194('0x23')](respondWithResult(_0x510f6d,null))[_0x8194('0x3e')](handleError(_0x510f6d,null));}; \ No newline at end of file +var _0xa3b9=['reject','save','update','then','error','stack','name','index','map','FaxQueueReport','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','apply'];(function(_0x5bbcbc,_0x5a8317){var _0x55df3d=function(_0x4b08cf){while(--_0x4b08cf){_0x5bbcbc['push'](_0x5bbcbc['shift']());}};_0x55df3d(++_0x5a8317);}(_0xa3b9,0x112));var _0x9a3b=function(_0x2ca2c7,_0x2b403f){_0x2ca2c7=_0x2ca2c7-0x0;var _0x554b5b=_0xa3b9[_0x2ca2c7];return _0x554b5b;};'use strict';var emlformat=require(_0x9a3b('0x0'));var rimraf=require(_0x9a3b('0x1'));var zipdir=require(_0x9a3b('0x2'));var jsonpatch=require(_0x9a3b('0x3'));var rp=require(_0x9a3b('0x4'));var moment=require(_0x9a3b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9a3b('0x6'));var util=require(_0x9a3b('0x7'));var path=require(_0x9a3b('0x8'));var sox=require(_0x9a3b('0x9'));var csv=require(_0x9a3b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a3b('0xb'));var squel=require(_0x9a3b('0xc'));var crypto=require(_0x9a3b('0xd'));var jsforce=require(_0x9a3b('0xe'));var deskjs=require(_0x9a3b('0xf'));var toCsv=require(_0x9a3b('0xa'));var querystring=require(_0x9a3b('0x10'));var Papa=require('papaparse');var Redis=require(_0x9a3b('0x11'));var authService=require(_0x9a3b('0x12'));var qs=require(_0x9a3b('0x13'));var as=require(_0x9a3b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a3b('0x15'))(_0x9a3b('0x16'));var utils=require(_0x9a3b('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9a3b('0x18'))['db'];function respondWithStatusCode(_0x4fa0f7,_0x57fd21){_0x57fd21=_0x57fd21||0xcc;return function(_0x86116e){if(_0x86116e){return _0x4fa0f7[_0x9a3b('0x19')](_0x57fd21);}return _0x4fa0f7['status'](_0x57fd21)[_0x9a3b('0x1a')]();};}function respondWithResult(_0x4ccc2b,_0x1d5aef){_0x1d5aef=_0x1d5aef||0xc8;return function(_0x16ff58){if(_0x16ff58){return _0x4ccc2b[_0x9a3b('0x1b')](_0x1d5aef)['json'](_0x16ff58);}};}function respondWithFilteredResult(_0x4803e5,_0x703e57){return function(_0x594395){if(_0x594395){var _0x2b6474=typeof _0x703e57[_0x9a3b('0x1c')]===_0x9a3b('0x1d')&&typeof _0x703e57[_0x9a3b('0x1e')]===_0x9a3b('0x1d');var _0x5b8f24=_0x594395['count'];var _0xa2975=_0x2b6474?0x0:_0x703e57[_0x9a3b('0x1c')];var _0x5c1af2=_0x2b6474?_0x594395[_0x9a3b('0x1f')]:_0x703e57[_0x9a3b('0x1c')]+_0x703e57[_0x9a3b('0x1e')];var _0x4bd9c6;if(_0x5c1af2>=_0x5b8f24){_0x5c1af2=_0x5b8f24;_0x4bd9c6=0xc8;}else{_0x4bd9c6=0xce;}_0x4803e5['status'](_0x4bd9c6);return _0x4803e5[_0x9a3b('0x20')]('Content-Range',_0xa2975+'-'+_0x5c1af2+'/'+_0x5b8f24)['json'](_0x594395);}return null;};}function patchUpdates(_0x34665e){return function(_0x6bd3af){try{jsonpatch[_0x9a3b('0x21')](_0x6bd3af,_0x34665e,!![]);}catch(_0x1c911e){return BPromise[_0x9a3b('0x22')](_0x1c911e);}return _0x6bd3af[_0x9a3b('0x23')]();};}function saveUpdates(_0x5da539,_0x448324){return function(_0x1cb2c0){if(_0x1cb2c0){return _0x1cb2c0[_0x9a3b('0x24')](_0x5da539)[_0x9a3b('0x25')](function(_0x420e5c){return _0x420e5c;});}return null;};}function removeEntity(_0x2d44b1,_0x3b32d8){return function(_0x375804){if(_0x375804){return _0x375804['destroy']()[_0x9a3b('0x25')](function(){_0x2d44b1[_0x9a3b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58648d,_0x28a01c){return function(_0x23f0e2){if(!_0x23f0e2){_0x58648d[_0x9a3b('0x19')](0x194);}return _0x23f0e2;};}function handleError(_0x17e3e1,_0x4a6876){_0x4a6876=_0x4a6876||0x1f4;return function(_0x895da0){logger[_0x9a3b('0x26')](_0x895da0[_0x9a3b('0x27')]);if(_0x895da0[_0x9a3b('0x28')]){delete _0x895da0[_0x9a3b('0x28')];}_0x17e3e1[_0x9a3b('0x1b')](_0x4a6876)['send'](_0x895da0);};}exports[_0x9a3b('0x29')]=function(_0x4eeb4b,_0x432f23){var _0xcc06f={},_0x31d542={},_0x504b44={'count':0x0,'rows':[]};var _0x1b70e8=_[_0x9a3b('0x2a')](db[_0x9a3b('0x2b')][_0x9a3b('0x2c')],function(_0x3093f1){return{'name':_0x3093f1[_0x9a3b('0x2d')],'type':_0x3093f1['type']['key']};});_0x31d542[_0x9a3b('0x2e')]=_[_0x9a3b('0x2a')](_0x1b70e8,_0x9a3b('0x28'));_0x31d542[_0x9a3b('0x2f')]=_[_0x9a3b('0x30')](_0x4eeb4b['query']);_0x31d542['filters']=_['intersection'](_0x31d542[_0x9a3b('0x2e')],_0x31d542[_0x9a3b('0x2f')]);_0xcc06f['attributes']=_[_0x9a3b('0x31')](_0x31d542[_0x9a3b('0x2e')],qs[_0x9a3b('0x32')](_0x4eeb4b['query']['fields']));_0xcc06f[_0x9a3b('0x33')]=_0xcc06f['attributes'][_0x9a3b('0x34')]?_0xcc06f['attributes']:_0x31d542[_0x9a3b('0x2e')];if(!_0x4eeb4b['query'][_0x9a3b('0x35')](_0x9a3b('0x36'))){_0xcc06f[_0x9a3b('0x1e')]=qs[_0x9a3b('0x1e')](_0x4eeb4b[_0x9a3b('0x2f')]['limit']);_0xcc06f[_0x9a3b('0x1c')]=qs['offset'](_0x4eeb4b[_0x9a3b('0x2f')][_0x9a3b('0x1c')]);}_0xcc06f[_0x9a3b('0x37')]=qs[_0x9a3b('0x38')](_0x4eeb4b[_0x9a3b('0x2f')][_0x9a3b('0x38')]);_0xcc06f['where']=qs['filters'](_[_0x9a3b('0x39')](_0x4eeb4b[_0x9a3b('0x2f')],_0x31d542[_0x9a3b('0x3a')]),_0x1b70e8);if(_0x4eeb4b['query'][_0x9a3b('0x3b')]){_0xcc06f['where']=_[_0x9a3b('0x3c')](_0xcc06f[_0x9a3b('0x3d')],{'$or':_[_0x9a3b('0x2a')](_0x1b70e8,function(_0x4cd476){if(_0x4cd476[_0x9a3b('0x3e')]!==_0x9a3b('0x3f')){var _0x336350={};_0x336350[_0x4cd476[_0x9a3b('0x28')]]={'$like':'%'+_0x4eeb4b[_0x9a3b('0x2f')][_0x9a3b('0x3b')]+'%'};return _0x336350;}})});}_0xcc06f=_['merge']({},_0xcc06f,_0x4eeb4b[_0x9a3b('0x40')]);var _0x33f136={'where':_0xcc06f[_0x9a3b('0x3d')]};return db['FaxQueueReport'][_0x9a3b('0x1f')](_0x33f136)[_0x9a3b('0x25')](function(_0x1df2bf){_0x504b44[_0x9a3b('0x1f')]=_0x1df2bf;if(_0x4eeb4b[_0x9a3b('0x2f')][_0x9a3b('0x41')]){_0xcc06f[_0x9a3b('0x42')]=[{'all':!![]}];}return db[_0x9a3b('0x2b')][_0x9a3b('0x43')](_0xcc06f);})['then'](function(_0xa13292){_0x504b44[_0x9a3b('0x44')]=_0xa13292;return _0x504b44;})[_0x9a3b('0x25')](respondWithFilteredResult(_0x432f23,_0xcc06f))[_0x9a3b('0x45')](handleError(_0x432f23,null));};exports[_0x9a3b('0x46')]=function(_0x2ad2b7,_0x53ee3e){var _0x129bbb={'raw':!![],'where':{'id':_0x2ad2b7[_0x9a3b('0x47')]['id']}},_0x2872b1={};_0x2872b1[_0x9a3b('0x2e')]=_[_0x9a3b('0x30')](db[_0x9a3b('0x2b')][_0x9a3b('0x2c')]);_0x2872b1[_0x9a3b('0x2f')]=_[_0x9a3b('0x30')](_0x2ad2b7[_0x9a3b('0x2f')]);_0x2872b1[_0x9a3b('0x3a')]=_[_0x9a3b('0x31')](_0x2872b1[_0x9a3b('0x2e')],_0x2872b1['query']);_0x129bbb[_0x9a3b('0x33')]=_[_0x9a3b('0x31')](_0x2872b1[_0x9a3b('0x2e')],qs[_0x9a3b('0x32')](_0x2ad2b7[_0x9a3b('0x2f')][_0x9a3b('0x32')]));_0x129bbb[_0x9a3b('0x33')]=_0x129bbb[_0x9a3b('0x33')][_0x9a3b('0x34')]?_0x129bbb[_0x9a3b('0x33')]:_0x2872b1[_0x9a3b('0x2e')];if(_0x2ad2b7[_0x9a3b('0x2f')][_0x9a3b('0x41')]){_0x129bbb['include']=[{'all':!![]}];}_0x129bbb=_[_0x9a3b('0x3c')]({},_0x129bbb,_0x2ad2b7[_0x9a3b('0x40')]);return db[_0x9a3b('0x2b')][_0x9a3b('0x48')](_0x129bbb)[_0x9a3b('0x25')](handleEntityNotFound(_0x53ee3e,null))[_0x9a3b('0x25')](respondWithResult(_0x53ee3e,null))['catch'](handleError(_0x53ee3e,null));};exports['create']=function(_0x2a8233,_0x51a2c7){return db[_0x9a3b('0x2b')][_0x9a3b('0x49')](_0x2a8233[_0x9a3b('0x4a')],{})[_0x9a3b('0x25')](respondWithResult(_0x51a2c7,0xc9))[_0x9a3b('0x45')](handleError(_0x51a2c7,null));};exports[_0x9a3b('0x24')]=function(_0x115f6b,_0x41389e){if(_0x115f6b[_0x9a3b('0x4a')]['id']){delete _0x115f6b[_0x9a3b('0x4a')]['id'];}return db[_0x9a3b('0x2b')][_0x9a3b('0x48')]({'where':{'id':_0x115f6b[_0x9a3b('0x47')]['id']}})[_0x9a3b('0x25')](handleEntityNotFound(_0x41389e,null))[_0x9a3b('0x25')](saveUpdates(_0x115f6b['body'],null))[_0x9a3b('0x25')](respondWithResult(_0x41389e,null))[_0x9a3b('0x45')](handleError(_0x41389e,null));};exports[_0x9a3b('0x4b')]=function(_0x5df82d,_0x20c9f3){return db[_0x9a3b('0x2b')]['find']({'where':{'id':_0x5df82d[_0x9a3b('0x47')]['id']}})[_0x9a3b('0x25')](handleEntityNotFound(_0x20c9f3,null))[_0x9a3b('0x25')](removeEntity(_0x20c9f3,null))[_0x9a3b('0x45')](handleError(_0x20c9f3,null));};exports[_0x9a3b('0x4c')]=function(_0x2953e3,_0xfa2703){return db[_0x9a3b('0x2b')][_0x9a3b('0x4c')]()[_0x9a3b('0x25')](respondWithResult(_0xfa2703,null))[_0x9a3b('0x45')](handleError(_0xfa2703,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index b0a76e5..3494fa2 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0x406032,_0x31c6fe){var _0x5b9117=function(_0x22bf2a){while(--_0x22bf2a){_0x406032['push'](_0x406032['shift']());}};_0x5b9117(++_0x31c6fe);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x49f584,_0x426fee){_0x49f584=_0x49f584-0x0;var _0x5b8269=_0x7fbe[_0x49f584];return _0x5b8269;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x3b8722,_0x1ca8b9){var _0x5c46ed=function(_0x429d22){while(--_0x429d22){_0x3b8722['push'](_0x3b8722['shift']());}};_0x5c46ed(++_0x1ca8b9);}(_0xe14b,0x93));var _0xbe14=function(_0x1fb163,_0x49c296){_0x1fb163=_0x1fb163-0x0;var _0x138ff1=_0xe14b[_0x1fb163];return _0x138ff1;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 9cf3016..ebaa140 100644 --- a/server/api/faxQueueReport/faxQueueReport.rpc.js +++ b/server/api/faxQueueReport/faxQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a84=['http','request','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','create','options','then','CreateFaxQueueReport','catch','UpdateFaxQueueReport','FaxQueueReport','body','where','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x6ec9e0,_0x41bfa2){var _0x2150a7=function(_0x4f9c40){while(--_0x4f9c40){_0x6ec9e0['push'](_0x6ec9e0['shift']());}};_0x2150a7(++_0x41bfa2);}(_0x1a84,0x76));var _0x41a8=function(_0x2b9f7e,_0x2bb345){_0x2b9f7e=_0x2b9f7e-0x0;var _0x27fa80=_0x1a84[_0x2b9f7e];return _0x27fa80;};'use strict';var _=require(_0x41a8('0x0'));var util=require(_0x41a8('0x1'));var moment=require(_0x41a8('0x2'));var BPromise=require('bluebird');var rs=require(_0x41a8('0x3'));var fs=require('fs');var Redis=require(_0x41a8('0x4'));var db=require(_0x41a8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x41a8('0x6'));var config=require(_0x41a8('0x7'));var jayson=require(_0x41a8('0x8'));var client=jayson[_0x41a8('0x9')][_0x41a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cc222,_0x577c95,_0x160760){return new BPromise(function(_0x569f03,_0x1c9f7a){return client[_0x41a8('0xb')](_0x2cc222,_0x160760)['then'](function(_0x5dcd8d){logger[_0x41a8('0xc')](_0x41a8('0xd'),_0x577c95,'request\x20sent');logger[_0x41a8('0xe')](_0x41a8('0xf'),_0x577c95,_0x41a8('0x10'),JSON[_0x41a8('0x11')](_0x5dcd8d));if(_0x5dcd8d[_0x41a8('0x12')]){if(_0x5dcd8d[_0x41a8('0x12')][_0x41a8('0x13')]===0x1f4){logger['error'](_0x41a8('0xd'),_0x577c95,_0x5dcd8d['error']['message']);return _0x1c9f7a(_0x5dcd8d[_0x41a8('0x12')]['message']);}logger['error'](_0x41a8('0xd'),_0x577c95,_0x5dcd8d[_0x41a8('0x12')][_0x41a8('0x14')]);return _0x569f03(_0x5dcd8d[_0x41a8('0x12')]['message']);}else{logger['info'](_0x41a8('0xd'),_0x577c95,'request\x20sent');_0x569f03(_0x5dcd8d[_0x41a8('0x15')][_0x41a8('0x14')]);}})['catch'](function(_0x1dcbe4){logger['error'](_0x41a8('0xd'),_0x577c95,_0x1dcbe4);_0x1c9f7a(_0x1dcbe4);});});}exports['CreateFaxQueueReport']=function(_0x3d03d1){var _0xbc9e4b=this;return new Promise(function(_0x306b8e,_0x1b2d68){return db['FaxQueueReport'][_0x41a8('0x16')](_0x3d03d1['body'],{'raw':_0x3d03d1[_0x41a8('0x17')]?_0x3d03d1['options']['raw']===undefined?!![]:![]:!![]})[_0x41a8('0x18')](function(_0x387add){logger[_0x41a8('0xc')](_0x41a8('0x19'),_0x3d03d1);logger[_0x41a8('0xe')]('CreateFaxQueueReport',_0x3d03d1,JSON[_0x41a8('0x11')](_0x387add));_0x306b8e(_0x387add);})[_0x41a8('0x1a')](function(_0x2b31cb){logger[_0x41a8('0x12')](_0x41a8('0x19'),_0x2b31cb[_0x41a8('0x14')],_0x3d03d1);_0x1b2d68(_0xbc9e4b[_0x41a8('0x12')](0x1f4,_0x2b31cb[_0x41a8('0x14')]));});});};exports[_0x41a8('0x1b')]=function(_0x478ea0){var _0x5eebe6=this;return new Promise(function(_0x5dfe6b,_0x3391c8){return db[_0x41a8('0x1c')]['update'](_0x478ea0[_0x41a8('0x1d')],{'raw':_0x478ea0[_0x41a8('0x17')]?_0x478ea0['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x478ea0[_0x41a8('0x17')]?_0x478ea0[_0x41a8('0x17')][_0x41a8('0x1e')]||null:null,'attributes':_0x478ea0[_0x41a8('0x17')]?_0x478ea0[_0x41a8('0x17')]['attributes']||null:null,'limit':_0x478ea0[_0x41a8('0x17')]?_0x478ea0[_0x41a8('0x17')][_0x41a8('0x1f')]||null:null})[_0x41a8('0x18')](function(_0x28f40b){logger[_0x41a8('0xc')]('UpdateFaxQueueReport',_0x478ea0);logger[_0x41a8('0xe')](_0x41a8('0x1b'),_0x478ea0,JSON[_0x41a8('0x11')](_0x28f40b));_0x5dfe6b(_0x28f40b);})[_0x41a8('0x1a')](function(_0x5aa02f){logger['error'](_0x41a8('0x1b'),_0x5aa02f[_0x41a8('0x14')],_0x478ea0);_0x3391c8(_0x5eebe6[_0x41a8('0x12')](0x1f4,_0x5aa02f[_0x41a8('0x14')]));});});}; \ No newline at end of file +var _0xce64=['attributes','limit','info','UpdateFaxQueueReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FaxQueueReport','body','options','CreateFaxQueueReport','catch','update','raw'];(function(_0x427d22,_0x358ab6){var _0x3217af=function(_0x14ae29){while(--_0x14ae29){_0x427d22['push'](_0x427d22['shift']());}};_0x3217af(++_0x358ab6);}(_0xce64,0xe4));var _0x4ce6=function(_0x443506,_0x553087){_0x443506=_0x443506-0x0;var _0x2ee3c0=_0xce64[_0x443506];return _0x2ee3c0;};'use strict';var _=require('lodash');var util=require(_0x4ce6('0x0'));var moment=require(_0x4ce6('0x1'));var BPromise=require('bluebird');var rs=require(_0x4ce6('0x2'));var fs=require('fs');var Redis=require(_0x4ce6('0x3'));var db=require(_0x4ce6('0x4'))['db'];var utils=require(_0x4ce6('0x5'));var logger=require(_0x4ce6('0x6'))(_0x4ce6('0x7'));var config=require(_0x4ce6('0x8'));var jayson=require(_0x4ce6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x70d9be,_0x135129,_0x583aec){return new BPromise(function(_0xd67c6f,_0x4a1d80){return client[_0x4ce6('0xa')](_0x70d9be,_0x583aec)[_0x4ce6('0xb')](function(_0x5b44ea){logger['info'](_0x4ce6('0xc'),_0x135129,_0x4ce6('0xd'));logger[_0x4ce6('0xe')](_0x4ce6('0xf'),_0x135129,_0x4ce6('0xd'),JSON[_0x4ce6('0x10')](_0x5b44ea));if(_0x5b44ea[_0x4ce6('0x11')]){if(_0x5b44ea[_0x4ce6('0x11')][_0x4ce6('0x12')]===0x1f4){logger[_0x4ce6('0x11')](_0x4ce6('0xc'),_0x135129,_0x5b44ea['error'][_0x4ce6('0x13')]);return _0x4a1d80(_0x5b44ea[_0x4ce6('0x11')]['message']);}logger[_0x4ce6('0x11')](_0x4ce6('0xc'),_0x135129,_0x5b44ea[_0x4ce6('0x11')][_0x4ce6('0x13')]);return _0xd67c6f(_0x5b44ea[_0x4ce6('0x11')][_0x4ce6('0x13')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x135129,'request\x20sent');_0xd67c6f(_0x5b44ea[_0x4ce6('0x14')][_0x4ce6('0x13')]);}})['catch'](function(_0x4e5d2d){logger[_0x4ce6('0x11')](_0x4ce6('0xc'),_0x135129,_0x4e5d2d);_0x4a1d80(_0x4e5d2d);});});}exports['CreateFaxQueueReport']=function(_0x54064a){var _0x40efd0=this;return new Promise(function(_0x1ce688,_0x447563){return db[_0x4ce6('0x15')]['create'](_0x54064a[_0x4ce6('0x16')],{'raw':_0x54064a['options']?_0x54064a[_0x4ce6('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x52af45){logger['info'](_0x4ce6('0x18'),_0x54064a);logger['debug']('CreateFaxQueueReport',_0x54064a,JSON['stringify'](_0x52af45));_0x1ce688(_0x52af45);})[_0x4ce6('0x19')](function(_0x7c71a4){logger[_0x4ce6('0x11')](_0x4ce6('0x18'),_0x7c71a4['message'],_0x54064a);_0x447563(_0x40efd0[_0x4ce6('0x11')](0x1f4,_0x7c71a4[_0x4ce6('0x13')]));});});};exports['UpdateFaxQueueReport']=function(_0x54b100){var _0x3bda2e=this;return new Promise(function(_0x1e6e61,_0x5b5fc2){return db[_0x4ce6('0x15')][_0x4ce6('0x1a')](_0x54b100['body'],{'raw':_0x54b100[_0x4ce6('0x17')]?_0x54b100[_0x4ce6('0x17')][_0x4ce6('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54b100[_0x4ce6('0x17')]?_0x54b100['options']['where']||null:null,'attributes':_0x54b100[_0x4ce6('0x17')]?_0x54b100[_0x4ce6('0x17')][_0x4ce6('0x1c')]||null:null,'limit':_0x54b100['options']?_0x54b100[_0x4ce6('0x17')][_0x4ce6('0x1d')]||null:null})['then'](function(_0x4191df){logger[_0x4ce6('0x1e')](_0x4ce6('0x1f'),_0x54b100);logger[_0x4ce6('0xe')](_0x4ce6('0x1f'),_0x54b100,JSON[_0x4ce6('0x10')](_0x4191df));_0x1e6e61(_0x4191df);})[_0x4ce6('0x19')](function(_0x1feb39){logger[_0x4ce6('0x11')](_0x4ce6('0x1f'),_0x1feb39[_0x4ce6('0x13')],_0x54b100);_0x5b5fc2(_0x3bda2e[_0x4ce6('0x11')](0x1f4,_0x1feb39[_0x4ce6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 8f0e1ad..5522db5 100644 --- a/server/api/faxQueueReport/index.js +++ b/server/api/faxQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c54=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','post','/:id','update','destroy','multer','util'];(function(_0x3072eb,_0x455321){var _0x55db4b=function(_0x333eda){while(--_0x333eda){_0x3072eb['push'](_0x3072eb['shift']());}};_0x55db4b(++_0x455321);}(_0x2c54,0x15e));var _0x42c5=function(_0x377551,_0x31de52){_0x377551=_0x377551-0x0;var _0x21fac1=_0x2c54[_0x377551];return _0x21fac1;};'use strict';var multer=require(_0x42c5('0x0'));var util=require(_0x42c5('0x1'));var path=require(_0x42c5('0x2'));var timeout=require(_0x42c5('0x3'));var express=require(_0x42c5('0x4'));var router=express[_0x42c5('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x42c5('0x6'));var config=require(_0x42c5('0x7'));var controller=require('./faxQueueReport.controller');router[_0x42c5('0x8')]('/',auth[_0x42c5('0x9')](),controller['index']);router['get'](_0x42c5('0xa'),auth[_0x42c5('0x9')](),controller[_0x42c5('0xb')]);router[_0x42c5('0x8')]('/:id',auth[_0x42c5('0x9')](),controller['show']);router[_0x42c5('0xc')]('/',auth[_0x42c5('0x9')](),controller['create']);router['put'](_0x42c5('0xd'),auth[_0x42c5('0x9')](),controller[_0x42c5('0xe')]);router['delete'](_0x42c5('0xd'),auth[_0x42c5('0x9')](),controller[_0x42c5('0xf')]);module['exports']=router; \ No newline at end of file +var _0x607f=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update'];(function(_0x32c1fe,_0x4e3852){var _0x1557ab=function(_0x4d4763){while(--_0x4d4763){_0x32c1fe['push'](_0x32c1fe['shift']());}};_0x1557ab(++_0x4e3852);}(_0x607f,0x1bb));var _0xf607=function(_0x3245af,_0x84fb2c){_0x3245af=_0x3245af-0x0;var _0x29d150=_0x607f[_0x3245af];return _0x29d150;};'use strict';var multer=require(_0xf607('0x0'));var util=require(_0xf607('0x1'));var path=require(_0xf607('0x2'));var timeout=require(_0xf607('0x3'));var express=require(_0xf607('0x4'));var router=express[_0xf607('0x5')]();var fs_extra=require(_0xf607('0x6'));var auth=require(_0xf607('0x7'));var interaction=require(_0xf607('0x8'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0xf607('0x9')]('/',auth[_0xf607('0xa')](),controller[_0xf607('0xb')]);router[_0xf607('0x9')](_0xf607('0xc'),auth['isAuthenticated'](),controller[_0xf607('0xd')]);router[_0xf607('0x9')]('/:id',auth[_0xf607('0xa')](),controller[_0xf607('0xe')]);router[_0xf607('0xf')]('/',auth[_0xf607('0xa')](),controller[_0xf607('0x10')]);router['put'](_0xf607('0x11'),auth[_0xf607('0xa')](),controller[_0xf607('0x12')]);router['delete'](_0xf607('0x11'),auth[_0xf607('0xa')](),controller[_0xf607('0x13')]);module[_0xf607('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 4d96699..5773ecf 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x165da6,_0x334445){var _0xa437e=function(_0x28e3ae){while(--_0x28e3ae){_0x165da6['push'](_0x165da6['shift']());}};_0xa437e(++_0x334445);}(_0xe706,0xa3));var _0x6e70=function(_0x388eea,_0x340518){_0x388eea=_0x388eea-0x0;var _0x4a175b=_0xe706[_0x388eea];return _0x4a175b;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4a56df,_0x4a78be){_0x4a56df=_0x4a56df-0x0;var _0x3a555b=_0xb43b[_0x4a56df];return _0x3a555b;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 55966db..d9e1d6d 100644 --- a/server/api/faxTransferReport/faxTransferReport.controller.js +++ b/server/api/faxTransferReport/faxTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10b8=['count','set','Content-Range','apply','update','then','stack','name','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','FaxTransferReport','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x10b8,0x10d));var _0x810b=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x10b8[_0x26f702];return _0x11417d;};'use strict';var emlformat=require(_0x810b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x810b('0x1'));var jsonpatch=require(_0x810b('0x2'));var rp=require(_0x810b('0x3'));var moment=require(_0x810b('0x4'));var BPromise=require(_0x810b('0x5'));var Mustache=require(_0x810b('0x6'));var util=require(_0x810b('0x7'));var path=require(_0x810b('0x8'));var sox=require(_0x810b('0x9'));var csv=require(_0x810b('0xa'));var ejs=require(_0x810b('0xb'));var fs=require('fs');var fs_extra=require(_0x810b('0xc'));var _=require(_0x810b('0xd'));var squel=require(_0x810b('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x810b('0xf'));var toCsv=require(_0x810b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x810b('0x10'));var qs=require(_0x810b('0x11'));var as=require(_0x810b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x810b('0x13'))(_0x810b('0x14'));var utils=require('../../config/utils');var config=require(_0x810b('0x15'));var licenseUtil=require(_0x810b('0x16'));var db=require(_0x810b('0x17'))['db'];function respondWithStatusCode(_0x1214bc,_0x5ca33f){_0x5ca33f=_0x5ca33f||0xcc;return function(_0x1baa7a){if(_0x1baa7a){return _0x1214bc[_0x810b('0x18')](_0x5ca33f);}return _0x1214bc[_0x810b('0x19')](_0x5ca33f)[_0x810b('0x1a')]();};}function respondWithResult(_0x4c5715,_0x4f6e8f){_0x4f6e8f=_0x4f6e8f||0xc8;return function(_0x3b87fa){if(_0x3b87fa){return _0x4c5715[_0x810b('0x19')](_0x4f6e8f)[_0x810b('0x1b')](_0x3b87fa);}};}function respondWithFilteredResult(_0xac2aab,_0x5ac7ee){return function(_0x34b994){if(_0x34b994){var _0x389cf3=typeof _0x5ac7ee[_0x810b('0x1c')]===_0x810b('0x1d')&&typeof _0x5ac7ee[_0x810b('0x1e')]===_0x810b('0x1d');var _0x3a7015=_0x34b994[_0x810b('0x1f')];var _0xaaa22a=_0x389cf3?0x0:_0x5ac7ee[_0x810b('0x1c')];var _0x2f64de=_0x389cf3?_0x34b994[_0x810b('0x1f')]:_0x5ac7ee[_0x810b('0x1c')]+_0x5ac7ee[_0x810b('0x1e')];var _0xc8e81;if(_0x2f64de>=_0x3a7015){_0x2f64de=_0x3a7015;_0xc8e81=0xc8;}else{_0xc8e81=0xce;}_0xac2aab['status'](_0xc8e81);return _0xac2aab[_0x810b('0x20')](_0x810b('0x21'),_0xaaa22a+'-'+_0x2f64de+'/'+_0x3a7015)[_0x810b('0x1b')](_0x34b994);}return null;};}function patchUpdates(_0x4745f9){return function(_0xa7b1d7){try{jsonpatch[_0x810b('0x22')](_0xa7b1d7,_0x4745f9,!![]);}catch(_0x499ae0){return BPromise['reject'](_0x499ae0);}return _0xa7b1d7['save']();};}function saveUpdates(_0x398ffb,_0x402f0a){return function(_0x2d1e8f){if(_0x2d1e8f){return _0x2d1e8f[_0x810b('0x23')](_0x398ffb)[_0x810b('0x24')](function(_0x7b9fa7){return _0x7b9fa7;});}return null;};}function removeEntity(_0x3093bd,_0x581213){return function(_0x477fc7){if(_0x477fc7){return _0x477fc7['destroy']()[_0x810b('0x24')](function(){_0x3093bd['status'](0xcc)[_0x810b('0x1a')]();});}};}function handleEntityNotFound(_0x4518ba,_0x4783a1){return function(_0x127055){if(!_0x127055){_0x4518ba['sendStatus'](0x194);}return _0x127055;};}function handleError(_0x579e5e,_0x4501b4){_0x4501b4=_0x4501b4||0x1f4;return function(_0x3c3af1){logger['error'](_0x3c3af1[_0x810b('0x25')]);if(_0x3c3af1[_0x810b('0x26')]){delete _0x3c3af1['name'];}_0x579e5e['status'](_0x4501b4)['send'](_0x3c3af1);};}exports['index']=function(_0x1c5bab,_0x557238){var _0x117392={},_0x358409={},_0x5dbf91={'count':0x0,'rows':[]};var _0xe30e5e=_[_0x810b('0x27')](db['FaxTransferReport'][_0x810b('0x28')],function(_0x5ecbd8){return{'name':_0x5ecbd8[_0x810b('0x29')],'type':_0x5ecbd8[_0x810b('0x2a')][_0x810b('0x2b')]};});_0x358409[_0x810b('0x2c')]=_[_0x810b('0x27')](_0xe30e5e,_0x810b('0x26'));_0x358409['query']=_[_0x810b('0x2d')](_0x1c5bab['query']);_0x358409[_0x810b('0x2e')]=_[_0x810b('0x2f')](_0x358409[_0x810b('0x2c')],_0x358409[_0x810b('0x30')]);_0x117392['attributes']=_[_0x810b('0x2f')](_0x358409[_0x810b('0x2c')],qs[_0x810b('0x31')](_0x1c5bab['query'][_0x810b('0x31')]));_0x117392[_0x810b('0x32')]=_0x117392[_0x810b('0x32')]['length']?_0x117392[_0x810b('0x32')]:_0x358409[_0x810b('0x2c')];if(!_0x1c5bab[_0x810b('0x30')][_0x810b('0x33')](_0x810b('0x34'))){_0x117392[_0x810b('0x1e')]=qs[_0x810b('0x1e')](_0x1c5bab[_0x810b('0x30')][_0x810b('0x1e')]);_0x117392[_0x810b('0x1c')]=qs[_0x810b('0x1c')](_0x1c5bab[_0x810b('0x30')][_0x810b('0x1c')]);}_0x117392[_0x810b('0x35')]=qs[_0x810b('0x36')](_0x1c5bab['query'][_0x810b('0x36')]);_0x117392[_0x810b('0x37')]=qs[_0x810b('0x2e')](_[_0x810b('0x38')](_0x1c5bab[_0x810b('0x30')],_0x358409['filters']),_0xe30e5e);if(_0x1c5bab['query']['filter']){_0x117392['where']=_[_0x810b('0x39')](_0x117392[_0x810b('0x37')],{'$or':_['map'](_0xe30e5e,function(_0x4bfb02){if(_0x4bfb02[_0x810b('0x2a')]!==_0x810b('0x3a')){var _0x4b7828={};_0x4b7828[_0x4bfb02['name']]={'$like':'%'+_0x1c5bab[_0x810b('0x30')][_0x810b('0x3b')]+'%'};return _0x4b7828;}})});}_0x117392=_[_0x810b('0x39')]({},_0x117392,_0x1c5bab[_0x810b('0x3c')]);var _0x17e8e6={'where':_0x117392['where']};return db[_0x810b('0x3d')][_0x810b('0x1f')](_0x17e8e6)[_0x810b('0x24')](function(_0x5413c2){_0x5dbf91[_0x810b('0x1f')]=_0x5413c2;if(_0x1c5bab['query']['includeAll']){_0x117392[_0x810b('0x3e')]=[{'all':!![]}];}return db[_0x810b('0x3d')][_0x810b('0x3f')](_0x117392);})[_0x810b('0x24')](function(_0x20a35e){_0x5dbf91[_0x810b('0x40')]=_0x20a35e;return _0x5dbf91;})[_0x810b('0x24')](respondWithFilteredResult(_0x557238,_0x117392))[_0x810b('0x41')](handleError(_0x557238,null));};exports[_0x810b('0x42')]=function(_0x9968ca,_0x1d1bfe){var _0x55d95a={'raw':!![],'where':{'id':_0x9968ca[_0x810b('0x43')]['id']}},_0x13e666={};_0x13e666[_0x810b('0x2c')]=_[_0x810b('0x2d')](db['FaxTransferReport'][_0x810b('0x28')]);_0x13e666[_0x810b('0x30')]=_[_0x810b('0x2d')](_0x9968ca[_0x810b('0x30')]);_0x13e666[_0x810b('0x2e')]=_[_0x810b('0x2f')](_0x13e666[_0x810b('0x2c')],_0x13e666[_0x810b('0x30')]);_0x55d95a['attributes']=_['intersection'](_0x13e666[_0x810b('0x2c')],qs['fields'](_0x9968ca[_0x810b('0x30')]['fields']));_0x55d95a[_0x810b('0x32')]=_0x55d95a[_0x810b('0x32')][_0x810b('0x44')]?_0x55d95a['attributes']:_0x13e666[_0x810b('0x2c')];if(_0x9968ca[_0x810b('0x30')][_0x810b('0x45')]){_0x55d95a[_0x810b('0x3e')]=[{'all':!![]}];}_0x55d95a=_[_0x810b('0x39')]({},_0x55d95a,_0x9968ca[_0x810b('0x3c')]);return db['FaxTransferReport'][_0x810b('0x46')](_0x55d95a)[_0x810b('0x24')](handleEntityNotFound(_0x1d1bfe,null))[_0x810b('0x24')](respondWithResult(_0x1d1bfe,null))[_0x810b('0x41')](handleError(_0x1d1bfe,null));};exports[_0x810b('0x47')]=function(_0x29110c,_0x7604a9){return db[_0x810b('0x3d')]['create'](_0x29110c[_0x810b('0x48')],{})[_0x810b('0x24')](respondWithResult(_0x7604a9,0xc9))['catch'](handleError(_0x7604a9,null));};exports[_0x810b('0x23')]=function(_0x376ba2,_0x3caccb){if(_0x376ba2[_0x810b('0x48')]['id']){delete _0x376ba2[_0x810b('0x48')]['id'];}return db[_0x810b('0x3d')][_0x810b('0x46')]({'where':{'id':_0x376ba2[_0x810b('0x43')]['id']}})['then'](handleEntityNotFound(_0x3caccb,null))['then'](saveUpdates(_0x376ba2[_0x810b('0x48')],null))[_0x810b('0x24')](respondWithResult(_0x3caccb,null))[_0x810b('0x41')](handleError(_0x3caccb,null));};exports[_0x810b('0x49')]=function(_0x1daf92,_0x5b8f4d){return db[_0x810b('0x3d')][_0x810b('0x46')]({'where':{'id':_0x1daf92[_0x810b('0x43')]['id']}})['then'](handleEntityNotFound(_0x5b8f4d,null))[_0x810b('0x24')](removeEntity(_0x5b8f4d,null))[_0x810b('0x41')](handleError(_0x5b8f4d,null));};exports[_0x810b('0x4a')]=function(_0x199cbf,_0x4b8f47){return db[_0x810b('0x3d')][_0x810b('0x4a')]()[_0x810b('0x24')](respondWithResult(_0x4b8f47,null))[_0x810b('0x41')](handleError(_0x4b8f47,null));}; \ No newline at end of file +var _0xe05c=['fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','FaxTransferReport','rawAttributes','fieldName','type','key','keys','query','attributes','intersection','model'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0xe05c,0xb2));var _0xce05=function(_0x171595,_0x46adfa){_0x171595=_0x171595-0x0;var _0x9ae989=_0xe05c[_0x171595];return _0x9ae989;};'use strict';var emlformat=require(_0xce05('0x0'));var rimraf=require(_0xce05('0x1'));var zipdir=require(_0xce05('0x2'));var jsonpatch=require(_0xce05('0x3'));var rp=require(_0xce05('0x4'));var moment=require(_0xce05('0x5'));var BPromise=require(_0xce05('0x6'));var Mustache=require(_0xce05('0x7'));var util=require(_0xce05('0x8'));var path=require(_0xce05('0x9'));var sox=require(_0xce05('0xa'));var csv=require(_0xce05('0xb'));var ejs=require(_0xce05('0xc'));var fs=require('fs');var fs_extra=require(_0xce05('0xd'));var _=require(_0xce05('0xe'));var squel=require('squel');var crypto=require(_0xce05('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xce05('0xb'));var querystring=require(_0xce05('0x10'));var Papa=require('papaparse');var Redis=require(_0xce05('0x11'));var authService=require(_0xce05('0x12'));var qs=require(_0xce05('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xce05('0x14'))(_0xce05('0x15'));var utils=require(_0xce05('0x16'));var config=require(_0xce05('0x17'));var licenseUtil=require(_0xce05('0x18'));var db=require(_0xce05('0x19'))['db'];function respondWithStatusCode(_0x1d1f20,_0x1ac7a4){_0x1ac7a4=_0x1ac7a4||0xcc;return function(_0x55e04e){if(_0x55e04e){return _0x1d1f20[_0xce05('0x1a')](_0x1ac7a4);}return _0x1d1f20[_0xce05('0x1b')](_0x1ac7a4)[_0xce05('0x1c')]();};}function respondWithResult(_0x9540e6,_0x8eaf92){_0x8eaf92=_0x8eaf92||0xc8;return function(_0x4defb6){if(_0x4defb6){return _0x9540e6[_0xce05('0x1b')](_0x8eaf92)[_0xce05('0x1d')](_0x4defb6);}};}function respondWithFilteredResult(_0x32b3c8,_0x321a6c){return function(_0x3ca40c){if(_0x3ca40c){var _0x2c7172=typeof _0x321a6c[_0xce05('0x1e')]===_0xce05('0x1f')&&typeof _0x321a6c['limit']===_0xce05('0x1f');var _0x6b887f=_0x3ca40c[_0xce05('0x20')];var _0x3a2d23=_0x2c7172?0x0:_0x321a6c['offset'];var _0x34bf71=_0x2c7172?_0x3ca40c[_0xce05('0x20')]:_0x321a6c['offset']+_0x321a6c[_0xce05('0x21')];var _0x5bb98b;if(_0x34bf71>=_0x6b887f){_0x34bf71=_0x6b887f;_0x5bb98b=0xc8;}else{_0x5bb98b=0xce;}_0x32b3c8[_0xce05('0x1b')](_0x5bb98b);return _0x32b3c8[_0xce05('0x22')]('Content-Range',_0x3a2d23+'-'+_0x34bf71+'/'+_0x6b887f)['json'](_0x3ca40c);}return null;};}function patchUpdates(_0x32b8ec){return function(_0x349a77){try{jsonpatch[_0xce05('0x23')](_0x349a77,_0x32b8ec,!![]);}catch(_0x513da9){return BPromise[_0xce05('0x24')](_0x513da9);}return _0x349a77[_0xce05('0x25')]();};}function saveUpdates(_0x2d427a,_0x39d504){return function(_0x41dde9){if(_0x41dde9){return _0x41dde9[_0xce05('0x26')](_0x2d427a)[_0xce05('0x27')](function(_0x47f89a){return _0x47f89a;});}return null;};}function removeEntity(_0x41f6f6,_0x217d5c){return function(_0x30e486){if(_0x30e486){return _0x30e486[_0xce05('0x28')]()['then'](function(){_0x41f6f6[_0xce05('0x1b')](0xcc)[_0xce05('0x1c')]();});}};}function handleEntityNotFound(_0x192f9e,_0x545bfc){return function(_0x5152f8){if(!_0x5152f8){_0x192f9e[_0xce05('0x1a')](0x194);}return _0x5152f8;};}function handleError(_0x11285b,_0x4860c4){_0x4860c4=_0x4860c4||0x1f4;return function(_0x55b749){logger[_0xce05('0x29')](_0x55b749[_0xce05('0x2a')]);if(_0x55b749[_0xce05('0x2b')]){delete _0x55b749[_0xce05('0x2b')];}_0x11285b[_0xce05('0x1b')](_0x4860c4)[_0xce05('0x2c')](_0x55b749);};}exports['index']=function(_0x1daf16,_0x5374bf){var _0x34c04e={},_0x1c1531={},_0x3f8aff={'count':0x0,'rows':[]};var _0x376e8f=_[_0xce05('0x2d')](db[_0xce05('0x2e')][_0xce05('0x2f')],function(_0x3734e0){return{'name':_0x3734e0[_0xce05('0x30')],'type':_0x3734e0[_0xce05('0x31')][_0xce05('0x32')]};});_0x1c1531['model']=_[_0xce05('0x2d')](_0x376e8f,_0xce05('0x2b'));_0x1c1531['query']=_[_0xce05('0x33')](_0x1daf16[_0xce05('0x34')]);_0x1c1531['filters']=_['intersection'](_0x1c1531['model'],_0x1c1531[_0xce05('0x34')]);_0x34c04e[_0xce05('0x35')]=_[_0xce05('0x36')](_0x1c1531[_0xce05('0x37')],qs['fields'](_0x1daf16[_0xce05('0x34')][_0xce05('0x38')]));_0x34c04e[_0xce05('0x35')]=_0x34c04e[_0xce05('0x35')][_0xce05('0x39')]?_0x34c04e[_0xce05('0x35')]:_0x1c1531[_0xce05('0x37')];if(!_0x1daf16[_0xce05('0x34')][_0xce05('0x3a')]('nolimit')){_0x34c04e[_0xce05('0x21')]=qs['limit'](_0x1daf16[_0xce05('0x34')]['limit']);_0x34c04e[_0xce05('0x1e')]=qs[_0xce05('0x1e')](_0x1daf16[_0xce05('0x34')][_0xce05('0x1e')]);}_0x34c04e[_0xce05('0x3b')]=qs[_0xce05('0x3c')](_0x1daf16['query'][_0xce05('0x3c')]);_0x34c04e['where']=qs[_0xce05('0x3d')](_[_0xce05('0x3e')](_0x1daf16[_0xce05('0x34')],_0x1c1531['filters']),_0x376e8f);if(_0x1daf16[_0xce05('0x34')][_0xce05('0x3f')]){_0x34c04e[_0xce05('0x40')]=_[_0xce05('0x41')](_0x34c04e[_0xce05('0x40')],{'$or':_[_0xce05('0x2d')](_0x376e8f,function(_0x4771da){if(_0x4771da[_0xce05('0x31')]!=='VIRTUAL'){var _0x3859ae={};_0x3859ae[_0x4771da['name']]={'$like':'%'+_0x1daf16[_0xce05('0x34')][_0xce05('0x3f')]+'%'};return _0x3859ae;}})});}_0x34c04e=_[_0xce05('0x41')]({},_0x34c04e,_0x1daf16[_0xce05('0x42')]);var _0x5ea5ad={'where':_0x34c04e[_0xce05('0x40')]};return db[_0xce05('0x2e')][_0xce05('0x20')](_0x5ea5ad)[_0xce05('0x27')](function(_0x2d0c7a){_0x3f8aff['count']=_0x2d0c7a;if(_0x1daf16[_0xce05('0x34')][_0xce05('0x43')]){_0x34c04e[_0xce05('0x44')]=[{'all':!![]}];}return db[_0xce05('0x2e')][_0xce05('0x45')](_0x34c04e);})['then'](function(_0x2abf88){_0x3f8aff[_0xce05('0x46')]=_0x2abf88;return _0x3f8aff;})[_0xce05('0x27')](respondWithFilteredResult(_0x5374bf,_0x34c04e))[_0xce05('0x47')](handleError(_0x5374bf,null));};exports[_0xce05('0x48')]=function(_0x48ad69,_0x43d148){var _0x64442f={'raw':!![],'where':{'id':_0x48ad69[_0xce05('0x49')]['id']}},_0x150688={};_0x150688[_0xce05('0x37')]=_['keys'](db[_0xce05('0x2e')][_0xce05('0x2f')]);_0x150688['query']=_[_0xce05('0x33')](_0x48ad69[_0xce05('0x34')]);_0x150688[_0xce05('0x3d')]=_[_0xce05('0x36')](_0x150688[_0xce05('0x37')],_0x150688['query']);_0x64442f['attributes']=_[_0xce05('0x36')](_0x150688[_0xce05('0x37')],qs[_0xce05('0x38')](_0x48ad69[_0xce05('0x34')][_0xce05('0x38')]));_0x64442f[_0xce05('0x35')]=_0x64442f[_0xce05('0x35')][_0xce05('0x39')]?_0x64442f[_0xce05('0x35')]:_0x150688[_0xce05('0x37')];if(_0x48ad69[_0xce05('0x34')][_0xce05('0x43')]){_0x64442f[_0xce05('0x44')]=[{'all':!![]}];}_0x64442f=_[_0xce05('0x41')]({},_0x64442f,_0x48ad69['options']);return db[_0xce05('0x2e')][_0xce05('0x4a')](_0x64442f)[_0xce05('0x27')](handleEntityNotFound(_0x43d148,null))[_0xce05('0x27')](respondWithResult(_0x43d148,null))['catch'](handleError(_0x43d148,null));};exports['create']=function(_0x3555fa,_0x6e46ba){return db[_0xce05('0x2e')][_0xce05('0x4b')](_0x3555fa[_0xce05('0x4c')],{})[_0xce05('0x27')](respondWithResult(_0x6e46ba,0xc9))[_0xce05('0x47')](handleError(_0x6e46ba,null));};exports[_0xce05('0x26')]=function(_0x42de2e,_0x414a4f){if(_0x42de2e[_0xce05('0x4c')]['id']){delete _0x42de2e['body']['id'];}return db[_0xce05('0x2e')]['find']({'where':{'id':_0x42de2e[_0xce05('0x49')]['id']}})[_0xce05('0x27')](handleEntityNotFound(_0x414a4f,null))[_0xce05('0x27')](saveUpdates(_0x42de2e[_0xce05('0x4c')],null))[_0xce05('0x27')](respondWithResult(_0x414a4f,null))['catch'](handleError(_0x414a4f,null));};exports[_0xce05('0x28')]=function(_0x44459b,_0x4d82d1){return db[_0xce05('0x2e')][_0xce05('0x4a')]({'where':{'id':_0x44459b[_0xce05('0x49')]['id']}})[_0xce05('0x27')](handleEntityNotFound(_0x4d82d1,null))[_0xce05('0x27')](removeEntity(_0x4d82d1,null))['catch'](handleError(_0x4d82d1,null));};exports[_0xce05('0x4d')]=function(_0x4957cd,_0x3fbc76){return db[_0xce05('0x2e')][_0xce05('0x4d')]()[_0xce05('0x27')](respondWithResult(_0x3fbc76,null))[_0xce05('0x47')](handleError(_0x3fbc76,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 12cbbf5..5235b02 100644 --- a/server/api/faxTransferReport/faxTransferReport.model.js +++ b/server/api/faxTransferReport/faxTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4c0=['request-promise','rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x2640fa,_0xaeaf32){var _0x5aa2cd=function(_0x3a0bf2){while(--_0x3a0bf2){_0x2640fa['push'](_0x2640fa['shift']());}};_0x5aa2cd(++_0xaeaf32);}(_0xe4c0,0x10c));var _0x0e4c=function(_0x2fbcf6,_0x2e7155){_0x2fbcf6=_0x2fbcf6-0x0;var _0x3e7265=_0xe4c0[_0x2fbcf6];return _0x3e7265;};'use strict';var _=require(_0x0e4c('0x0'));var util=require(_0x0e4c('0x1'));var logger=require(_0x0e4c('0x2'))(_0x0e4c('0x3'));var moment=require(_0x0e4c('0x4'));var BPromise=require('bluebird');var rp=require(_0x0e4c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e4c('0x6'));var config=require('../../config/environment');var attributes=require(_0x0e4c('0x7'));module[_0x0e4c('0x8')]=function(_0xb4c166,_0x94230a){return _0xb4c166[_0x0e4c('0x9')](_0x0e4c('0xa'),attributes,{'tableName':_0x0e4c('0xb'),'paranoid':![],'indexes':[{'name':_0x0e4c('0xc'),'fields':[_0x0e4c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xddc5=['moment','bluebird','request-promise','path','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','api'];(function(_0x31591e,_0xe8045f){var _0x20b22e=function(_0x57b35f){while(--_0x57b35f){_0x31591e['push'](_0x31591e['shift']());}};_0x20b22e(++_0xe8045f);}(_0xddc5,0x101));var _0x5ddc=function(_0x4fbc1d,_0x1be40e){_0x4fbc1d=_0x4fbc1d-0x0;var _0x861eea=_0xddc5[_0x4fbc1d];return _0x861eea;};'use strict';var _=require(_0x5ddc('0x0'));var util=require(_0x5ddc('0x1'));var logger=require('../../config/logger')(_0x5ddc('0x2'));var moment=require(_0x5ddc('0x3'));var BPromise=require(_0x5ddc('0x4'));var rp=require(_0x5ddc('0x5'));var fs=require('fs');var path=require(_0x5ddc('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5ddc('0x7'));module[_0x5ddc('0x8')]=function(_0x232918,_0x3b3e83){return _0x232918[_0x5ddc('0x9')](_0x5ddc('0xa'),attributes,{'tableName':_0x5ddc('0xb'),'paranoid':![],'indexes':[{'name':_0x5ddc('0xc'),'fields':[_0x5ddc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 67c153e..0bdacc3 100644 --- a/server/api/faxTransferReport/faxTransferReport.rpc.js +++ b/server/api/faxTransferReport/faxTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17d3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x569177,_0xe9b932){var _0x571b87=function(_0x13ad89){while(--_0x13ad89){_0x569177['push'](_0x569177['shift']());}};_0x571b87(++_0xe9b932);}(_0x17d3,0x74));var _0x317d=function(_0x5e824e,_0x2f8380){_0x5e824e=_0x5e824e-0x0;var _0x15eb12=_0x17d3[_0x5e824e];return _0x15eb12;};'use strict';var _=require(_0x317d('0x0'));var util=require(_0x317d('0x1'));var moment=require(_0x317d('0x2'));var BPromise=require(_0x317d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x317d('0x4'))['db'];var utils=require(_0x317d('0x5'));var logger=require(_0x317d('0x6'))(_0x317d('0x7'));var config=require(_0x317d('0x8'));var jayson=require(_0x317d('0x9'));var client=jayson['client'][_0x317d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25fa29,_0x166bb6,_0x2d22c3){return new BPromise(function(_0x5c065f,_0x1c9a7f){return client[_0x317d('0xb')](_0x25fa29,_0x2d22c3)[_0x317d('0xc')](function(_0x5421c7){logger[_0x317d('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x166bb6,'request\x20sent');logger[_0x317d('0xe')](_0x317d('0xf'),_0x166bb6,_0x317d('0x10'),JSON[_0x317d('0x11')](_0x5421c7));if(_0x5421c7[_0x317d('0x12')]){if(_0x5421c7[_0x317d('0x12')][_0x317d('0x13')]===0x1f4){logger[_0x317d('0x12')](_0x317d('0x14'),_0x166bb6,_0x5421c7['error']['message']);return _0x1c9a7f(_0x5421c7[_0x317d('0x12')][_0x317d('0x15')]);}logger['error'](_0x317d('0x14'),_0x166bb6,_0x5421c7[_0x317d('0x12')][_0x317d('0x15')]);return _0x5c065f(_0x5421c7[_0x317d('0x12')][_0x317d('0x15')]);}else{logger[_0x317d('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x166bb6,'request\x20sent');_0x5c065f(_0x5421c7[_0x317d('0x16')][_0x317d('0x15')]);}})[_0x317d('0x17')](function(_0x5381cf){logger[_0x317d('0x12')](_0x317d('0x14'),_0x166bb6,_0x5381cf);_0x1c9a7f(_0x5381cf);});});} \ No newline at end of file +var _0x76be=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','error','code','message','FaxTransferReport,\x20%s,\x20%s','result','catch','lodash'];(function(_0x5202d3,_0x31df2a){var _0x5b535e=function(_0x2650e6){while(--_0x2650e6){_0x5202d3['push'](_0x5202d3['shift']());}};_0x5b535e(++_0x31df2a);}(_0x76be,0x1b7));var _0xe76b=function(_0x4f0bea,_0x48f18d){_0x4f0bea=_0x4f0bea-0x0;var _0x4d5cd4=_0x76be[_0x4f0bea];return _0x4d5cd4;};'use strict';var _=require(_0xe76b('0x0'));var util=require('util');var moment=require(_0xe76b('0x1'));var BPromise=require(_0xe76b('0x2'));var rs=require(_0xe76b('0x3'));var fs=require('fs');var Redis=require(_0xe76b('0x4'));var db=require(_0xe76b('0x5'))['db'];var utils=require(_0xe76b('0x6'));var logger=require(_0xe76b('0x7'))(_0xe76b('0x8'));var config=require(_0xe76b('0x9'));var jayson=require(_0xe76b('0xa'));var client=jayson[_0xe76b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b0c93,_0x22e602,_0x41cfd4){return new BPromise(function(_0xa58044,_0x563cd5){return client[_0xe76b('0xc')](_0x2b0c93,_0x41cfd4)['then'](function(_0x1fee4c){logger[_0xe76b('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x22e602,_0xe76b('0xe'));logger[_0xe76b('0xf')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x22e602,_0xe76b('0xe'),JSON['stringify'](_0x1fee4c));if(_0x1fee4c[_0xe76b('0x10')]){if(_0x1fee4c['error'][_0xe76b('0x11')]===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x22e602,_0x1fee4c[_0xe76b('0x10')][_0xe76b('0x12')]);return _0x563cd5(_0x1fee4c[_0xe76b('0x10')][_0xe76b('0x12')]);}logger[_0xe76b('0x10')](_0xe76b('0x13'),_0x22e602,_0x1fee4c['error'][_0xe76b('0x12')]);return _0xa58044(_0x1fee4c[_0xe76b('0x10')]['message']);}else{logger['info'](_0xe76b('0x13'),_0x22e602,'request\x20sent');_0xa58044(_0x1fee4c[_0xe76b('0x14')]['message']);}})[_0xe76b('0x15')](function(_0x516fef){logger[_0xe76b('0x10')](_0xe76b('0x13'),_0x22e602,_0x516fef);_0x563cd5(_0x516fef);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 7cb4770..1705780 100644 --- a/server/api/faxTransferReport/index.js +++ b/server/api/faxTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63fb=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x63fb,0x191));var _0xb63f=function(_0x1ffe31,_0x39bb28){_0x1ffe31=_0x1ffe31-0x0;var _0x3ed24b=_0x63fb[_0x1ffe31];return _0x3ed24b;};'use strict';var multer=require(_0xb63f('0x0'));var util=require(_0xb63f('0x1'));var path=require(_0xb63f('0x2'));var timeout=require(_0xb63f('0x3'));var express=require(_0xb63f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb63f('0x5'));var config=require(_0xb63f('0x6'));var controller=require(_0xb63f('0x7'));router['get']('/',auth[_0xb63f('0x8')](),controller[_0xb63f('0x9')]);router[_0xb63f('0xa')](_0xb63f('0xb'),auth[_0xb63f('0x8')](),controller[_0xb63f('0xc')]);router[_0xb63f('0xa')](_0xb63f('0xd'),auth[_0xb63f('0x8')](),controller[_0xb63f('0xe')]);router[_0xb63f('0xf')]('/',auth[_0xb63f('0x8')](),controller[_0xb63f('0x10')]);router[_0xb63f('0x11')](_0xb63f('0xd'),auth[_0xb63f('0x8')](),controller[_0xb63f('0x12')]);router[_0xb63f('0x13')]('/:id',auth[_0xb63f('0x8')](),controller[_0xb63f('0x14')]);module[_0xb63f('0x15')]=router; \ No newline at end of file +var _0x1932=['put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create'];(function(_0x1e9d62,_0x25bb8e){var _0x56c490=function(_0x19f4e7){while(--_0x19f4e7){_0x1e9d62['push'](_0x1e9d62['shift']());}};_0x56c490(++_0x25bb8e);}(_0x1932,0xd6));var _0x2193=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x1932[_0x565c49];return _0x20ca34;};'use strict';var multer=require(_0x2193('0x0'));var util=require('util');var path=require(_0x2193('0x1'));var timeout=require(_0x2193('0x2'));var express=require('express');var router=express[_0x2193('0x3')]();var fs_extra=require(_0x2193('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2193('0x5'));var config=require('../../config/environment');var controller=require(_0x2193('0x6'));router[_0x2193('0x7')]('/',auth[_0x2193('0x8')](),controller['index']);router[_0x2193('0x7')](_0x2193('0x9'),auth[_0x2193('0x8')](),controller[_0x2193('0xa')]);router[_0x2193('0x7')](_0x2193('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x2193('0xc')]('/',auth['isAuthenticated'](),controller[_0x2193('0xd')]);router[_0x2193('0xe')]('/:id',auth[_0x2193('0x8')](),controller[_0x2193('0xf')]);router[_0x2193('0x10')](_0x2193('0xb'),auth['isAuthenticated'](),controller[_0x2193('0x11')]);module[_0x2193('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 95a5a50..e0f5c14 100644 --- a/server/api/intDeskAccount/index.js +++ b/server/api/intDeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c17=['index','get','/:id','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x170628,_0xbb70a9){var _0x597a0f=function(_0x21dc91){while(--_0x21dc91){_0x170628['push'](_0x170628['shift']());}};_0x597a0f(++_0xbb70a9);}(_0x7c17,0x14a));var _0x77c1=function(_0x625420,_0x17a04e){_0x625420=_0x625420-0x0;var _0x4c6b37=_0x7c17[_0x625420];return _0x4c6b37;};'use strict';var multer=require(_0x77c1('0x0'));var util=require('util');var path=require(_0x77c1('0x1'));var timeout=require(_0x77c1('0x2'));var express=require(_0x77c1('0x3'));var router=express[_0x77c1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x77c1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x77c1('0x6')]);router[_0x77c1('0x7')](_0x77c1('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x77c1('0x7')](_0x77c1('0x9'),auth[_0x77c1('0xa')](),controller[_0x77c1('0xb')]);router[_0x77c1('0x7')](_0x77c1('0xc'),auth[_0x77c1('0xa')](),controller[_0x77c1('0xd')]);router[_0x77c1('0xe')]('/',auth[_0x77c1('0xa')](),controller[_0x77c1('0xf')]);router[_0x77c1('0xe')](_0x77c1('0x9'),auth[_0x77c1('0xa')](),controller[_0x77c1('0x10')]);router[_0x77c1('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x77c1('0x12')]);router[_0x77c1('0x13')]('/:id',auth[_0x77c1('0xa')](),controller['destroy']);module[_0x77c1('0x14')]=router; \ No newline at end of file +var _0xef94=['connect-timeout','Router','../../components/auth/service','./intDeskAccount.controller','get','isAuthenticated','index','/:id','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','multer','util','path'];(function(_0x3279a9,_0x3a966c){var _0x48bd4d=function(_0x59b3f6){while(--_0x59b3f6){_0x3279a9['push'](_0x3279a9['shift']());}};_0x48bd4d(++_0x3a966c);}(_0xef94,0x6b));var _0x4ef9=function(_0x6f158f,_0x19f81f){_0x6f158f=_0x6f158f-0x0;var _0x276226=_0xef94[_0x6f158f];return _0x276226;};'use strict';var multer=require(_0x4ef9('0x0'));var util=require(_0x4ef9('0x1'));var path=require(_0x4ef9('0x2'));var timeout=require(_0x4ef9('0x3'));var express=require('express');var router=express[_0x4ef9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4ef9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4ef9('0x6'));router[_0x4ef9('0x7')]('/',auth[_0x4ef9('0x8')](),controller[_0x4ef9('0x9')]);router['get'](_0x4ef9('0xa'),auth[_0x4ef9('0x8')](),controller['show']);router['get']('/:id/configurations',auth[_0x4ef9('0x8')](),controller[_0x4ef9('0xb')]);router['get'](_0x4ef9('0xc'),auth[_0x4ef9('0x8')](),controller[_0x4ef9('0xd')]);router[_0x4ef9('0xe')]('/',auth[_0x4ef9('0x8')](),controller[_0x4ef9('0xf')]);router['post'](_0x4ef9('0x10'),auth[_0x4ef9('0x8')](),controller[_0x4ef9('0x11')]);router[_0x4ef9('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4ef9('0x13')]);router[_0x4ef9('0x14')](_0x4ef9('0xa'),auth[_0x4ef9('0x8')](),controller[_0x4ef9('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index f9196f6..fa3acdf 100644 --- a/server/api/intDeskAccount/intDeskAccount.attributes.js +++ b/server/api/intDeskAccount/intDeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f3d=['basic','ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x2076e6,_0x27898a){var _0x3068a1=function(_0x571d00){while(--_0x571d00){_0x2076e6['push'](_0x2076e6['shift']());}};_0x3068a1(++_0x27898a);}(_0x1f3d,0xeb));var _0xd1f3=function(_0xbdc966,_0x1a9912){_0xbdc966=_0xbdc966-0x0;var _0x426fb3=_0x1f3d[_0xbdc966];return _0x426fb3;};'use strict';var Sequelize=require(_0xd1f3('0x0'));module[_0xd1f3('0x1')]={'name':{'type':Sequelize[_0xd1f3('0x2')]},'description':{'type':Sequelize[_0xd1f3('0x2')]},'username':{'type':Sequelize[_0xd1f3('0x2')]},'remoteUri':{'type':Sequelize[_0xd1f3('0x2')]},'authType':{'type':Sequelize['ENUM'](_0xd1f3('0x3')),'defaultValue':_0xd1f3('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xd1f3('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xd1f3('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xd1f3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd1f3('0x4')](_0xd1f3('0x5'),_0xd1f3('0x6')),'defaultValue':_0xd1f3('0x5')}}; \ No newline at end of file +var _0x4b73=['basic','integrationTab','STRING','ENUM'];(function(_0x38d1bc,_0x35f947){var _0x3532a1=function(_0x4f46d8){while(--_0x4f46d8){_0x38d1bc['push'](_0x38d1bc['shift']());}};_0x3532a1(++_0x35f947);}(_0x4b73,0xa2));var _0x34b7=function(_0x3b632f,_0x453380){_0x3b632f=_0x3b632f-0x0;var _0x10e788=_0x4b73[_0x3b632f];return _0x10e788;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x34b7('0x0')]},'description':{'type':Sequelize[_0x34b7('0x0')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x34b7('0x0')]},'authType':{'type':Sequelize[_0x34b7('0x1')](_0x34b7('0x2')),'defaultValue':_0x34b7('0x2')},'password':{'type':Sequelize[_0x34b7('0x0')]},'consumerKey':{'type':Sequelize[_0x34b7('0x0')]},'consumerSecret':{'type':Sequelize[_0x34b7('0x0')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x34b7('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x34b7('0x1')](_0x34b7('0x3'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index e93d14b..71ed476 100644 --- a/server/api/intDeskAccount/intDeskAccount.controller.js +++ b/server/api/intDeskAccount/intDeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x073e=['map','DeskAccount','fieldName','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','create','body','find','getConfigurations','findOne','DeskConfiguration','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','type','DeskField','priority','remoteUri','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','basic','headers','Authorization','toString','base64','concat','_embedded','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','status','error','stack','name','index'];(function(_0x4c0298,_0x118b86){var _0x2544ea=function(_0x3d23b1){while(--_0x3d23b1){_0x4c0298['push'](_0x4c0298['shift']());}};_0x2544ea(++_0x118b86);}(_0x073e,0xbc));var _0xe073=function(_0x41d5b4,_0x449f98){_0x41d5b4=_0x41d5b4-0x0;var _0x56a933=_0x073e[_0x41d5b4];return _0x56a933;};'use strict';var emlformat=require(_0xe073('0x0'));var rimraf=require(_0xe073('0x1'));var zipdir=require(_0xe073('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe073('0x3'));var moment=require(_0xe073('0x4'));var BPromise=require(_0xe073('0x5'));var Mustache=require(_0xe073('0x6'));var util=require('util');var path=require(_0xe073('0x7'));var sox=require(_0xe073('0x8'));var csv=require(_0xe073('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe073('0xa'));var _=require(_0xe073('0xb'));var squel=require(_0xe073('0xc'));var crypto=require(_0xe073('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe073('0xe'));var toCsv=require(_0xe073('0x9'));var querystring=require(_0xe073('0xf'));var Papa=require(_0xe073('0x10'));var Redis=require(_0xe073('0x11'));var authService=require(_0xe073('0x12'));var qs=require(_0xe073('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe073('0x14'));var logger=require(_0xe073('0x15'))(_0xe073('0x16'));var utils=require('../../config/utils');var config=require(_0xe073('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe073('0x18'))['db'];var integrations=require(_0xe073('0x19'));function respondWithStatusCode(_0x1ed4e5,_0x284ea0){_0x284ea0=_0x284ea0||0xcc;return function(_0x2435dc){if(_0x2435dc){return _0x1ed4e5[_0xe073('0x1a')](_0x284ea0);}return _0x1ed4e5['status'](_0x284ea0)[_0xe073('0x1b')]();};}function respondWithResult(_0x37d7cb,_0xb4c462){_0xb4c462=_0xb4c462||0xc8;return function(_0x396f21){if(_0x396f21){return _0x37d7cb['status'](_0xb4c462)[_0xe073('0x1c')](_0x396f21);}};}function respondWithFilteredResult(_0x3997f5,_0x6450be){return function(_0x50260a){if(_0x50260a){var _0x466ecb=typeof _0x6450be[_0xe073('0x1d')]===_0xe073('0x1e')&&typeof _0x6450be[_0xe073('0x1f')]==='undefined';var _0x466e4b=_0x50260a[_0xe073('0x20')];var _0x502794=_0x466ecb?0x0:_0x6450be['offset'];var _0x4a970f=_0x466ecb?_0x50260a[_0xe073('0x20')]:_0x6450be[_0xe073('0x1d')]+_0x6450be[_0xe073('0x1f')];var _0x21a3e2;if(_0x4a970f>=_0x466e4b){_0x4a970f=_0x466e4b;_0x21a3e2=0xc8;}else{_0x21a3e2=0xce;}_0x3997f5['status'](_0x21a3e2);return _0x3997f5[_0xe073('0x21')](_0xe073('0x22'),_0x502794+'-'+_0x4a970f+'/'+_0x466e4b)['json'](_0x50260a);}return null;};}function patchUpdates(_0x8c54a8){return function(_0x118478){try{jsonpatch[_0xe073('0x23')](_0x118478,_0x8c54a8,!![]);}catch(_0x8cf76d){return BPromise['reject'](_0x8cf76d);}return _0x118478['save']();};}function saveUpdates(_0x5c22b4,_0x20761b){return function(_0x3be595){if(_0x3be595){return _0x3be595[_0xe073('0x24')](_0x5c22b4)['then'](function(_0x19ee1b){return _0x19ee1b;});}return null;};}function removeEntity(_0x9d919f,_0x13af69){return function(_0x1d2b52){if(_0x1d2b52){return _0x1d2b52[_0xe073('0x25')]()[_0xe073('0x26')](function(){_0x9d919f[_0xe073('0x27')](0xcc)[_0xe073('0x1b')]();});}};}function handleEntityNotFound(_0x1350ae,_0x47b2da){return function(_0x4cf714){if(!_0x4cf714){_0x1350ae[_0xe073('0x1a')](0x194);}return _0x4cf714;};}function handleError(_0x49216f,_0x99582f){_0x99582f=_0x99582f||0x1f4;return function(_0x45785a){logger[_0xe073('0x28')](_0x45785a[_0xe073('0x29')]);if(_0x45785a['name']){delete _0x45785a[_0xe073('0x2a')];}_0x49216f[_0xe073('0x27')](_0x99582f)['send'](_0x45785a);};}exports[_0xe073('0x2b')]=function(_0x216fe6,_0x4c2401){var _0x55f3e1={},_0x20de7c={},_0x117b65={'count':0x0,'rows':[]};var _0x343064=_[_0xe073('0x2c')](db[_0xe073('0x2d')]['rawAttributes'],function(_0x4670e2){return{'name':_0x4670e2[_0xe073('0x2e')],'type':_0x4670e2['type']['key']};});_0x20de7c[_0xe073('0x2f')]=_['map'](_0x343064,'name');_0x20de7c['query']=_[_0xe073('0x30')](_0x216fe6[_0xe073('0x31')]);_0x20de7c[_0xe073('0x32')]=_['intersection'](_0x20de7c['model'],_0x20de7c[_0xe073('0x31')]);_0x55f3e1[_0xe073('0x33')]=_[_0xe073('0x34')](_0x20de7c[_0xe073('0x2f')],qs[_0xe073('0x35')](_0x216fe6[_0xe073('0x31')][_0xe073('0x35')]));_0x55f3e1[_0xe073('0x33')]=_0x55f3e1[_0xe073('0x33')]['length']?_0x55f3e1['attributes']:_0x20de7c[_0xe073('0x2f')];if(!_0x216fe6[_0xe073('0x31')][_0xe073('0x36')](_0xe073('0x37'))){_0x55f3e1[_0xe073('0x1f')]=qs[_0xe073('0x1f')](_0x216fe6[_0xe073('0x31')][_0xe073('0x1f')]);_0x55f3e1['offset']=qs[_0xe073('0x1d')](_0x216fe6[_0xe073('0x31')][_0xe073('0x1d')]);}_0x55f3e1[_0xe073('0x38')]=qs[_0xe073('0x39')](_0x216fe6[_0xe073('0x31')][_0xe073('0x39')]);_0x55f3e1[_0xe073('0x3a')]=qs[_0xe073('0x32')](_[_0xe073('0x3b')](_0x216fe6[_0xe073('0x31')],_0x20de7c[_0xe073('0x32')]),_0x343064);if(_0x216fe6[_0xe073('0x31')][_0xe073('0x3c')]){_0x55f3e1[_0xe073('0x3a')]=_[_0xe073('0x3d')](_0x55f3e1[_0xe073('0x3a')],{'$or':_['map'](_0x343064,function(_0x5da462){if(_0x5da462['type']!==_0xe073('0x3e')){var _0x4c12f3={};_0x4c12f3[_0x5da462['name']]={'$like':'%'+_0x216fe6[_0xe073('0x31')][_0xe073('0x3c')]+'%'};return _0x4c12f3;}})});}_0x55f3e1=_[_0xe073('0x3d')]({},_0x55f3e1,_0x216fe6[_0xe073('0x3f')]);var _0x503b4a={'where':_0x55f3e1['where']};return db['DeskAccount'][_0xe073('0x20')](_0x503b4a)[_0xe073('0x26')](function(_0x4a52f9){_0x117b65[_0xe073('0x20')]=_0x4a52f9;if(_0x216fe6[_0xe073('0x31')]['includeAll']){_0x55f3e1['include']=[{'all':!![]}];}return db['DeskAccount'][_0xe073('0x40')](_0x55f3e1);})[_0xe073('0x26')](function(_0x2d2b49){_0x117b65[_0xe073('0x41')]=_0x2d2b49;return _0x117b65;})[_0xe073('0x26')](respondWithFilteredResult(_0x4c2401,_0x55f3e1))[_0xe073('0x42')](handleError(_0x4c2401,null));};exports[_0xe073('0x43')]=function(_0x5bce3f,_0x32b626){var _0x4b5872={'raw':![],'where':{'id':_0x5bce3f[_0xe073('0x44')]['id']}},_0x23acac={};_0x23acac[_0xe073('0x2f')]=_[_0xe073('0x30')](db[_0xe073('0x2d')][_0xe073('0x45')]);_0x23acac[_0xe073('0x31')]=_[_0xe073('0x30')](_0x5bce3f[_0xe073('0x31')]);_0x23acac[_0xe073('0x32')]=_[_0xe073('0x34')](_0x23acac[_0xe073('0x2f')],_0x23acac[_0xe073('0x31')]);_0x4b5872[_0xe073('0x33')]=_[_0xe073('0x34')](_0x23acac[_0xe073('0x2f')],qs[_0xe073('0x35')](_0x5bce3f[_0xe073('0x31')][_0xe073('0x35')]));_0x4b5872[_0xe073('0x33')]=_0x4b5872[_0xe073('0x33')][_0xe073('0x46')]?_0x4b5872[_0xe073('0x33')]:_0x23acac[_0xe073('0x2f')];if(_0x5bce3f[_0xe073('0x31')][_0xe073('0x47')]){_0x4b5872[_0xe073('0x48')]=[{'all':!![]}];}_0x4b5872=_[_0xe073('0x3d')]({},_0x4b5872,_0x5bce3f[_0xe073('0x3f')]);return db['DeskAccount']['find'](_0x4b5872)[_0xe073('0x26')](handleEntityNotFound(_0x32b626,null))[_0xe073('0x26')](respondWithResult(_0x32b626,null))[_0xe073('0x42')](handleError(_0x32b626,null));};exports[_0xe073('0x49')]=function(_0x3360ac,_0x124137){return db[_0xe073('0x2d')][_0xe073('0x49')](_0x3360ac[_0xe073('0x4a')],{})['then'](respondWithResult(_0x124137,0xc9))[_0xe073('0x42')](handleError(_0x124137,null));};exports[_0xe073('0x24')]=function(_0x214704,_0x50622a){if(_0x214704[_0xe073('0x4a')]['id']){delete _0x214704['body']['id'];}return db[_0xe073('0x2d')][_0xe073('0x4b')]({'where':{'id':_0x214704[_0xe073('0x44')]['id']}})[_0xe073('0x26')](handleEntityNotFound(_0x50622a,null))[_0xe073('0x26')](saveUpdates(_0x214704[_0xe073('0x4a')],null))[_0xe073('0x26')](respondWithResult(_0x50622a,null))[_0xe073('0x42')](handleError(_0x50622a,null));};exports[_0xe073('0x25')]=function(_0x55059c,_0x41c4ae){return db['DeskAccount'][_0xe073('0x4b')]({'where':{'id':_0x55059c['params']['id']}})['then'](handleEntityNotFound(_0x41c4ae,null))[_0xe073('0x26')](removeEntity(_0x41c4ae,null))[_0xe073('0x42')](handleError(_0x41c4ae,null));};exports[_0xe073('0x4c')]=function(_0x56fd78,_0x2c521b,_0x4a6814){var _0x5e2d77={};var _0x46c447={};var _0x1674ae;var _0x54c928;return db[_0xe073('0x2d')][_0xe073('0x4d')]({'where':{'id':_0x56fd78[_0xe073('0x44')]['id']}})[_0xe073('0x26')](handleEntityNotFound(_0x2c521b,null))[_0xe073('0x26')](function(_0x2aa6d2){if(_0x2aa6d2){_0x1674ae=_0x2aa6d2;_0x46c447[_0xe073('0x2f')]=_[_0xe073('0x30')](db[_0xe073('0x4e')][_0xe073('0x45')]);_0x46c447[_0xe073('0x31')]=_[_0xe073('0x30')](_0x56fd78[_0xe073('0x31')]);_0x46c447[_0xe073('0x32')]=_['intersection'](_0x46c447[_0xe073('0x2f')],_0x46c447[_0xe073('0x31')]);_0x5e2d77[_0xe073('0x33')]=_[_0xe073('0x34')](_0x46c447['model'],qs[_0xe073('0x35')](_0x56fd78[_0xe073('0x31')][_0xe073('0x35')]));_0x5e2d77[_0xe073('0x33')]=_0x5e2d77['attributes'][_0xe073('0x46')]?_0x5e2d77[_0xe073('0x33')]:_0x46c447['model'];_0x5e2d77[_0xe073('0x38')]=qs['sort'](_0x56fd78[_0xe073('0x31')][_0xe073('0x39')]);_0x5e2d77['where']=qs[_0xe073('0x32')](_[_0xe073('0x3b')](_0x56fd78['query'],_0x46c447[_0xe073('0x32')]));if(_0x56fd78[_0xe073('0x31')][_0xe073('0x3c')]){_0x5e2d77[_0xe073('0x3a')]=_[_0xe073('0x3d')](_0x5e2d77[_0xe073('0x3a')],{'$or':_[_0xe073('0x2c')](_0x5e2d77[_0xe073('0x33')],function(_0x3591ae){var _0x55ab09={};_0x55ab09[_0x3591ae]={'$like':'%'+_0x56fd78['query']['filter']+'%'};return _0x55ab09;})});}_0x5e2d77=_['merge']({},_0x5e2d77,_0x56fd78[_0xe073('0x3f')]);return _0x1674ae[_0xe073('0x4c')](_0x5e2d77);}})[_0xe073('0x26')](function(_0x1dbd20){if(_0x1dbd20){_0x54c928=_0x1dbd20['length'];if(!_0x56fd78[_0xe073('0x31')][_0xe073('0x36')](_0xe073('0x37'))){_0x5e2d77[_0xe073('0x1f')]=qs[_0xe073('0x1f')](_0x56fd78['query'][_0xe073('0x1f')]);_0x5e2d77[_0xe073('0x1d')]=qs[_0xe073('0x1d')](_0x56fd78[_0xe073('0x31')][_0xe073('0x1d')]);}return _0x1674ae[_0xe073('0x4c')](_0x5e2d77);}})[_0xe073('0x26')](function(_0xdfb2fc){if(_0xdfb2fc){return _0xdfb2fc?{'count':_0x54c928,'rows':_0xdfb2fc}:null;}})[_0xe073('0x26')](respondWithResult(_0x2c521b,null))['catch'](handleError(_0x2c521b,null));};exports[_0xe073('0x4f')]=function(_0x2b1ebd,_0x100512,_0x368b93){if(_0x2b1ebd[_0xe073('0x4a')]['id']){delete _0x2b1ebd[_0xe073('0x4a')]['id'];}return db[_0xe073('0x2d')]['findOne']({'where':{'id':_0x2b1ebd['params']['id']}})[_0xe073('0x26')](handleEntityNotFound(_0x100512,null))[_0xe073('0x26')](function(_0x181b75){if(_0x181b75){_0x2b1ebd[_0xe073('0x4a')]['AccountId']=_0x181b75['id'];_0x2b1ebd[_0xe073('0x4a')][_0xe073('0x50')]=integrations[_0xe073('0x51')](_0x2b1ebd['body']['channel'],_0x2b1ebd[_0xe073('0x4a')]['type']);_0x2b1ebd['body'][_0xe073('0x52')]=integrations[_0xe073('0x53')](_0x2b1ebd['body'][_0xe073('0x54')],_0x2b1ebd[_0xe073('0x4a')][_0xe073('0x55')]);return db[_0xe073('0x4e')][_0xe073('0x49')](_0x2b1ebd[_0xe073('0x4a')],{'include':[{'model':db['DeskField'],'as':_0xe073('0x50')},{'model':db[_0xe073('0x56')],'as':'Descriptions'}]});}return null;})[_0xe073('0x26')](respondWithResult(_0x100512,null))[_0xe073('0x42')](handleError(_0x100512,null));};exports['getFields']=function(_0x49c49d,_0x504433,_0x53ec60){var _0x1a1524=[{'name':_0xe073('0x57'),'label':_0xe073('0x57'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1b8039='';return db[_0xe073('0x2d')][_0xe073('0x4d')]({'where':{'id':_0x49c49d[_0xe073('0x44')]['id']},'attributes':['id',_0xe073('0x58'),'authType',_0xe073('0x59'),_0xe073('0x5a'),_0xe073('0x5b'),_0xe073('0x5c'),_0xe073('0x5d'),_0xe073('0x5e')]})[_0xe073('0x26')](handleEntityNotFound(_0x504433,null))[_0xe073('0x26')](function(_0x49fee7){if(_0x49fee7){_0x1b8039=_0x49fee7['remoteUri'];var _0x31fae2=_0x1b8039[_0xe073('0x5f')](-0x1);if(_0x31fae2==='/'){_0x1b8039=_0x1b8039['substring'](0x0,_0x1b8039[_0xe073('0x60')](_0x31fae2));}var _0x2ea4fe={'method':_0xe073('0x61'),'uri':util[_0xe073('0x62')](_0xe073('0x63'),_0x1b8039),'headers':{'Content-Type':_0xe073('0x64'),'Accept':_0xe073('0x64')},'json':!![]};if(_0x49fee7[_0xe073('0x65')]===_0xe073('0x66')){_0x2ea4fe[_0xe073('0x67')][_0xe073('0x68')]=util[_0xe073('0x62')]('Basic\x20%s',new Buffer(util[_0xe073('0x62')]('%s:%s',_0x49fee7[_0xe073('0x59')],_0x49fee7[_0xe073('0x5a')]))[_0xe073('0x69')](_0xe073('0x6a')));}return rp(_0x2ea4fe)[_0xe073('0x26')](function(_0x594fc5){return _0x1a1524[_0xe073('0x6b')](_[_0xe073('0x2c')](_0x594fc5[_0xe073('0x6c')]['entries'],function(_0xefb022){return{'id':_0xefb022[_0xe073('0x2a')],'name':_0xefb022[_0xe073('0x2a')],'type':_0xefb022[_0xe073('0x55')],'active':_0xefb022['active'],'label':_0xefb022[_0xe073('0x6d')],'custom':!![]};}));});}})[_0xe073('0x26')](function(_0x3cc5d3){return{'count':_0x3cc5d3['length'],'rows':_0x3cc5d3};})['then'](respondWithResult(_0x504433,null))[_0xe073('0x42')](function(_0x4b998d){var _0x531376=_0x49c49d[_0xe073('0x31')]['test']?0x1f4:_0x4b998d[_0xe073('0x6e')]||0x1f4;logger[_0xe073('0x28')](_0xe073('0x6f'),_0xe073('0x70'),_0x531376,JSON['stringify'](_0x4b998d));delete _0x4b998d[_0xe073('0x2a')];if(_0x531376===0x191){_0x531376=0x190;}_0x504433[_0xe073('0x27')](_0x531376)[_0xe073('0x71')](_0x49c49d[_0xe073('0x31')][_0xe073('0x72')]?{'message':_0xe073('0x73'),'statusCode':_0x4b998d[_0xe073('0x6e')]}:_0x4b998d);});}; \ No newline at end of file +var _0x8768=['index','DeskAccount','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','destroy','getConfigurations','findOne','DeskConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','token','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','%s:%s','password','toString','base64','concat','_embedded','active','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','apply','reject','then','stack','name'];(function(_0x3e2489,_0x41d9dd){var _0x2254ce=function(_0x227e46){while(--_0x227e46){_0x3e2489['push'](_0x3e2489['shift']());}};_0x2254ce(++_0x41d9dd);}(_0x8768,0x1b2));var _0x8876=function(_0x453f10,_0x3d497b){_0x453f10=_0x453f10-0x0;var _0x38ef3b=_0x8768[_0x453f10];return _0x38ef3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8876('0x0'));var zipdir=require(_0x8876('0x1'));var jsonpatch=require(_0x8876('0x2'));var rp=require(_0x8876('0x3'));var moment=require(_0x8876('0x4'));var BPromise=require(_0x8876('0x5'));var Mustache=require('mustache');var util=require(_0x8876('0x6'));var path=require(_0x8876('0x7'));var sox=require(_0x8876('0x8'));var csv=require(_0x8876('0x9'));var ejs=require(_0x8876('0xa'));var fs=require('fs');var fs_extra=require(_0x8876('0xb'));var _=require(_0x8876('0xc'));var squel=require(_0x8876('0xd'));var crypto=require(_0x8876('0xe'));var jsforce=require(_0x8876('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8876('0x9'));var querystring=require(_0x8876('0x10'));var Papa=require(_0x8876('0x11'));var Redis=require(_0x8876('0x12'));var authService=require(_0x8876('0x13'));var qs=require(_0x8876('0x14'));var as=require(_0x8876('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8876('0x16'))(_0x8876('0x17'));var utils=require(_0x8876('0x18'));var config=require(_0x8876('0x19'));var licenseUtil=require(_0x8876('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8876('0x1b'));function respondWithStatusCode(_0x3fbc06,_0x2417bf){_0x2417bf=_0x2417bf||0xcc;return function(_0x278b0e){if(_0x278b0e){return _0x3fbc06[_0x8876('0x1c')](_0x2417bf);}return _0x3fbc06['status'](_0x2417bf)[_0x8876('0x1d')]();};}function respondWithResult(_0x21f75c,_0x34f367){_0x34f367=_0x34f367||0xc8;return function(_0x34a8c9){if(_0x34a8c9){return _0x21f75c[_0x8876('0x1e')](_0x34f367)[_0x8876('0x1f')](_0x34a8c9);}};}function respondWithFilteredResult(_0x247ec0,_0x1e0d0f){return function(_0x39c4a1){if(_0x39c4a1){var _0x299245=typeof _0x1e0d0f['offset']===_0x8876('0x20')&&typeof _0x1e0d0f['limit']===_0x8876('0x20');var _0x4b57fb=_0x39c4a1[_0x8876('0x21')];var _0x8dc92=_0x299245?0x0:_0x1e0d0f[_0x8876('0x22')];var _0x4fb970=_0x299245?_0x39c4a1[_0x8876('0x21')]:_0x1e0d0f['offset']+_0x1e0d0f[_0x8876('0x23')];var _0x468f7b;if(_0x4fb970>=_0x4b57fb){_0x4fb970=_0x4b57fb;_0x468f7b=0xc8;}else{_0x468f7b=0xce;}_0x247ec0[_0x8876('0x1e')](_0x468f7b);return _0x247ec0['set'](_0x8876('0x24'),_0x8dc92+'-'+_0x4fb970+'/'+_0x4b57fb)[_0x8876('0x1f')](_0x39c4a1);}return null;};}function patchUpdates(_0x4919a0){return function(_0x32af7b){try{jsonpatch[_0x8876('0x25')](_0x32af7b,_0x4919a0,!![]);}catch(_0x40a4e5){return BPromise[_0x8876('0x26')](_0x40a4e5);}return _0x32af7b['save']();};}function saveUpdates(_0x40fdec,_0x37e1d4){return function(_0x30782e){if(_0x30782e){return _0x30782e['update'](_0x40fdec)[_0x8876('0x27')](function(_0x65236e){return _0x65236e;});}return null;};}function removeEntity(_0x1e2629,_0x415dd0){return function(_0x377e8e){if(_0x377e8e){return _0x377e8e['destroy']()[_0x8876('0x27')](function(){_0x1e2629[_0x8876('0x1e')](0xcc)[_0x8876('0x1d')]();});}};}function handleEntityNotFound(_0x45c155,_0x2b24be){return function(_0x56353e){if(!_0x56353e){_0x45c155[_0x8876('0x1c')](0x194);}return _0x56353e;};}function handleError(_0x3e1963,_0x3eeccc){_0x3eeccc=_0x3eeccc||0x1f4;return function(_0x1efd50){logger['error'](_0x1efd50[_0x8876('0x28')]);if(_0x1efd50['name']){delete _0x1efd50[_0x8876('0x29')];}_0x3e1963[_0x8876('0x1e')](_0x3eeccc)['send'](_0x1efd50);};}exports[_0x8876('0x2a')]=function(_0x47b50a,_0x4e4202){var _0x349cad={},_0x2c208e={},_0x4f4d91={'count':0x0,'rows':[]};var _0x2b3dc2=_['map'](db[_0x8876('0x2b')]['rawAttributes'],function(_0x5b0dc7){return{'name':_0x5b0dc7[_0x8876('0x2c')],'type':_0x5b0dc7[_0x8876('0x2d')][_0x8876('0x2e')]};});_0x2c208e[_0x8876('0x2f')]=_[_0x8876('0x30')](_0x2b3dc2,'name');_0x2c208e['query']=_[_0x8876('0x31')](_0x47b50a[_0x8876('0x32')]);_0x2c208e[_0x8876('0x33')]=_['intersection'](_0x2c208e['model'],_0x2c208e[_0x8876('0x32')]);_0x349cad[_0x8876('0x34')]=_[_0x8876('0x35')](_0x2c208e[_0x8876('0x2f')],qs[_0x8876('0x36')](_0x47b50a[_0x8876('0x32')][_0x8876('0x36')]));_0x349cad[_0x8876('0x34')]=_0x349cad['attributes'][_0x8876('0x37')]?_0x349cad[_0x8876('0x34')]:_0x2c208e[_0x8876('0x2f')];if(!_0x47b50a[_0x8876('0x32')][_0x8876('0x38')](_0x8876('0x39'))){_0x349cad[_0x8876('0x23')]=qs[_0x8876('0x23')](_0x47b50a[_0x8876('0x32')][_0x8876('0x23')]);_0x349cad['offset']=qs[_0x8876('0x22')](_0x47b50a[_0x8876('0x32')][_0x8876('0x22')]);}_0x349cad['order']=qs['sort'](_0x47b50a[_0x8876('0x32')][_0x8876('0x3a')]);_0x349cad[_0x8876('0x3b')]=qs[_0x8876('0x33')](_[_0x8876('0x3c')](_0x47b50a['query'],_0x2c208e[_0x8876('0x33')]),_0x2b3dc2);if(_0x47b50a[_0x8876('0x32')][_0x8876('0x3d')]){_0x349cad[_0x8876('0x3b')]=_[_0x8876('0x3e')](_0x349cad[_0x8876('0x3b')],{'$or':_['map'](_0x2b3dc2,function(_0x586778){if(_0x586778[_0x8876('0x2d')]!==_0x8876('0x3f')){var _0x29bad6={};_0x29bad6[_0x586778['name']]={'$like':'%'+_0x47b50a['query'][_0x8876('0x3d')]+'%'};return _0x29bad6;}})});}_0x349cad=_[_0x8876('0x3e')]({},_0x349cad,_0x47b50a[_0x8876('0x40')]);var _0x3736ec={'where':_0x349cad[_0x8876('0x3b')]};return db[_0x8876('0x2b')][_0x8876('0x21')](_0x3736ec)[_0x8876('0x27')](function(_0x261c9b){_0x4f4d91['count']=_0x261c9b;if(_0x47b50a[_0x8876('0x32')]['includeAll']){_0x349cad[_0x8876('0x41')]=[{'all':!![]}];}return db['DeskAccount'][_0x8876('0x42')](_0x349cad);})[_0x8876('0x27')](function(_0x10171a){_0x4f4d91[_0x8876('0x43')]=_0x10171a;return _0x4f4d91;})[_0x8876('0x27')](respondWithFilteredResult(_0x4e4202,_0x349cad))[_0x8876('0x44')](handleError(_0x4e4202,null));};exports[_0x8876('0x45')]=function(_0x406b99,_0x539c28){var _0x47bc74={'raw':![],'where':{'id':_0x406b99[_0x8876('0x46')]['id']}},_0x130a8e={};_0x130a8e[_0x8876('0x2f')]=_[_0x8876('0x31')](db[_0x8876('0x2b')][_0x8876('0x47')]);_0x130a8e['query']=_['keys'](_0x406b99[_0x8876('0x32')]);_0x130a8e[_0x8876('0x33')]=_[_0x8876('0x35')](_0x130a8e[_0x8876('0x2f')],_0x130a8e['query']);_0x47bc74[_0x8876('0x34')]=_[_0x8876('0x35')](_0x130a8e['model'],qs[_0x8876('0x36')](_0x406b99['query'][_0x8876('0x36')]));_0x47bc74[_0x8876('0x34')]=_0x47bc74[_0x8876('0x34')]['length']?_0x47bc74['attributes']:_0x130a8e[_0x8876('0x2f')];if(_0x406b99[_0x8876('0x32')]['includeAll']){_0x47bc74[_0x8876('0x41')]=[{'all':!![]}];}_0x47bc74=_['merge']({},_0x47bc74,_0x406b99[_0x8876('0x40')]);return db[_0x8876('0x2b')][_0x8876('0x48')](_0x47bc74)['then'](handleEntityNotFound(_0x539c28,null))[_0x8876('0x27')](respondWithResult(_0x539c28,null))['catch'](handleError(_0x539c28,null));};exports[_0x8876('0x49')]=function(_0x290217,_0x2cdfe8){return db[_0x8876('0x2b')][_0x8876('0x49')](_0x290217[_0x8876('0x4a')],{})[_0x8876('0x27')](respondWithResult(_0x2cdfe8,0xc9))[_0x8876('0x44')](handleError(_0x2cdfe8,null));};exports[_0x8876('0x4b')]=function(_0x41fb2d,_0x577e04){if(_0x41fb2d[_0x8876('0x4a')]['id']){delete _0x41fb2d[_0x8876('0x4a')]['id'];}return db[_0x8876('0x2b')][_0x8876('0x48')]({'where':{'id':_0x41fb2d[_0x8876('0x46')]['id']}})['then'](handleEntityNotFound(_0x577e04,null))[_0x8876('0x27')](saveUpdates(_0x41fb2d['body'],null))['then'](respondWithResult(_0x577e04,null))['catch'](handleError(_0x577e04,null));};exports[_0x8876('0x4c')]=function(_0x180830,_0x390e17){return db[_0x8876('0x2b')][_0x8876('0x48')]({'where':{'id':_0x180830[_0x8876('0x46')]['id']}})[_0x8876('0x27')](handleEntityNotFound(_0x390e17,null))[_0x8876('0x27')](removeEntity(_0x390e17,null))[_0x8876('0x44')](handleError(_0x390e17,null));};exports[_0x8876('0x4d')]=function(_0x10cb5f,_0x5f0520,_0xdde07c){var _0x2e7497={};var _0x52abfd={};var _0x56f545;var _0x500517;return db['DeskAccount'][_0x8876('0x4e')]({'where':{'id':_0x10cb5f[_0x8876('0x46')]['id']}})[_0x8876('0x27')](handleEntityNotFound(_0x5f0520,null))['then'](function(_0x364a5d){if(_0x364a5d){_0x56f545=_0x364a5d;_0x52abfd['model']=_[_0x8876('0x31')](db[_0x8876('0x4f')][_0x8876('0x47')]);_0x52abfd['query']=_[_0x8876('0x31')](_0x10cb5f[_0x8876('0x32')]);_0x52abfd[_0x8876('0x33')]=_[_0x8876('0x35')](_0x52abfd[_0x8876('0x2f')],_0x52abfd[_0x8876('0x32')]);_0x2e7497[_0x8876('0x34')]=_[_0x8876('0x35')](_0x52abfd['model'],qs[_0x8876('0x36')](_0x10cb5f[_0x8876('0x32')]['fields']));_0x2e7497[_0x8876('0x34')]=_0x2e7497[_0x8876('0x34')][_0x8876('0x37')]?_0x2e7497[_0x8876('0x34')]:_0x52abfd[_0x8876('0x2f')];_0x2e7497[_0x8876('0x50')]=qs['sort'](_0x10cb5f[_0x8876('0x32')][_0x8876('0x3a')]);_0x2e7497[_0x8876('0x3b')]=qs['filters'](_['pick'](_0x10cb5f[_0x8876('0x32')],_0x52abfd[_0x8876('0x33')]));if(_0x10cb5f['query'][_0x8876('0x3d')]){_0x2e7497[_0x8876('0x3b')]=_[_0x8876('0x3e')](_0x2e7497[_0x8876('0x3b')],{'$or':_[_0x8876('0x30')](_0x2e7497[_0x8876('0x34')],function(_0x41c70b){var _0x416a75={};_0x416a75[_0x41c70b]={'$like':'%'+_0x10cb5f[_0x8876('0x32')][_0x8876('0x3d')]+'%'};return _0x416a75;})});}_0x2e7497=_[_0x8876('0x3e')]({},_0x2e7497,_0x10cb5f[_0x8876('0x40')]);return _0x56f545[_0x8876('0x4d')](_0x2e7497);}})['then'](function(_0x30936c){if(_0x30936c){_0x500517=_0x30936c['length'];if(!_0x10cb5f[_0x8876('0x32')][_0x8876('0x38')]('nolimit')){_0x2e7497[_0x8876('0x23')]=qs[_0x8876('0x23')](_0x10cb5f[_0x8876('0x32')][_0x8876('0x23')]);_0x2e7497[_0x8876('0x22')]=qs[_0x8876('0x22')](_0x10cb5f['query']['offset']);}return _0x56f545[_0x8876('0x4d')](_0x2e7497);}})[_0x8876('0x27')](function(_0x159e00){if(_0x159e00){return _0x159e00?{'count':_0x500517,'rows':_0x159e00}:null;}})[_0x8876('0x27')](respondWithResult(_0x5f0520,null))[_0x8876('0x44')](handleError(_0x5f0520,null));};exports[_0x8876('0x51')]=function(_0x50a2e5,_0x584e9b,_0x5865df){if(_0x50a2e5[_0x8876('0x4a')]['id']){delete _0x50a2e5[_0x8876('0x4a')]['id'];}return db[_0x8876('0x2b')][_0x8876('0x4e')]({'where':{'id':_0x50a2e5[_0x8876('0x46')]['id']}})[_0x8876('0x27')](handleEntityNotFound(_0x584e9b,null))[_0x8876('0x27')](function(_0x551035){if(_0x551035){_0x50a2e5[_0x8876('0x4a')][_0x8876('0x52')]=_0x551035['id'];_0x50a2e5[_0x8876('0x4a')][_0x8876('0x53')]=integrations[_0x8876('0x54')](_0x50a2e5[_0x8876('0x4a')][_0x8876('0x55')],_0x50a2e5['body'][_0x8876('0x2d')]);_0x50a2e5[_0x8876('0x4a')][_0x8876('0x56')]=integrations[_0x8876('0x57')](_0x50a2e5[_0x8876('0x4a')]['channel'],_0x50a2e5[_0x8876('0x4a')][_0x8876('0x2d')]);return db[_0x8876('0x4f')][_0x8876('0x49')](_0x50a2e5[_0x8876('0x4a')],{'include':[{'model':db[_0x8876('0x58')],'as':'Subjects'},{'model':db[_0x8876('0x58')],'as':_0x8876('0x56')}]});}return null;})[_0x8876('0x27')](respondWithResult(_0x584e9b,null))[_0x8876('0x44')](handleError(_0x584e9b,null));};exports[_0x8876('0x59')]=function(_0x1cde7f,_0x1a7622,_0x2b6a3a){var _0x13b04b=[{'name':_0x8876('0x5a'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x18eab0='';return db[_0x8876('0x2b')]['findOne']({'where':{'id':_0x1cde7f['params']['id']},'attributes':['id',_0x8876('0x5b'),_0x8876('0x5c'),_0x8876('0x5d'),'password',_0x8876('0x5e'),_0x8876('0x5f'),_0x8876('0x60'),'tokenSecret']})[_0x8876('0x27')](handleEntityNotFound(_0x1a7622,null))['then'](function(_0x4b8660){if(_0x4b8660){_0x18eab0=_0x4b8660['remoteUri'];var _0x4359a8=_0x18eab0[_0x8876('0x61')](-0x1);if(_0x4359a8==='/'){_0x18eab0=_0x18eab0[_0x8876('0x62')](0x0,_0x18eab0[_0x8876('0x63')](_0x4359a8));}var _0x4362aa={'method':_0x8876('0x64'),'uri':util[_0x8876('0x65')](_0x8876('0x66'),_0x18eab0),'headers':{'Content-Type':_0x8876('0x67'),'Accept':'application/json'},'json':!![]};if(_0x4b8660[_0x8876('0x5c')]===_0x8876('0x68')){_0x4362aa['headers'][_0x8876('0x69')]=util[_0x8876('0x65')]('Basic\x20%s',new Buffer(util[_0x8876('0x65')](_0x8876('0x6a'),_0x4b8660[_0x8876('0x5d')],_0x4b8660[_0x8876('0x6b')]))[_0x8876('0x6c')](_0x8876('0x6d')));}return rp(_0x4362aa)[_0x8876('0x27')](function(_0x2ff033){return _0x13b04b[_0x8876('0x6e')](_[_0x8876('0x30')](_0x2ff033[_0x8876('0x6f')]['entries'],function(_0xe4c2b6){return{'id':_0xe4c2b6[_0x8876('0x29')],'name':_0xe4c2b6[_0x8876('0x29')],'type':_0xe4c2b6[_0x8876('0x2d')],'active':_0xe4c2b6[_0x8876('0x70')],'label':_0xe4c2b6[_0x8876('0x71')],'custom':!![]};}));});}})[_0x8876('0x27')](function(_0x11660e){return{'count':_0x11660e[_0x8876('0x37')],'rows':_0x11660e};})[_0x8876('0x27')](respondWithResult(_0x1a7622,null))[_0x8876('0x44')](function(_0x472c86){var _0x34ad10=_0x1cde7f[_0x8876('0x32')][_0x8876('0x72')]?0x1f4:_0x472c86['statusCode']||0x1f4;logger['error'](_0x8876('0x73'),_0x8876('0x59'),_0x34ad10,JSON[_0x8876('0x74')](_0x472c86));delete _0x472c86['name'];if(_0x34ad10===0x191){_0x34ad10=0x190;}_0x1a7622[_0x8876('0x1e')](_0x34ad10)['send'](_0x1cde7f['query']['test']?{'message':_0x8876('0x75'),'statusCode':_0x472c86[_0x8876('0x76')]}:_0x472c86);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 5fb12bc..6d474a3 100644 --- a/server/api/intDeskAccount/intDeskAccount.model.js +++ b/server/api/intDeskAccount/intDeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa1a7=['exports','DeskAccount','lodash','util','moment','bluebird','request-promise','path','./intDeskAccount.attributes','../../components/integrations/configuration'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xa1a7,0xb6));var _0x7a1a=function(_0x38e8b0,_0x5b8cb5){_0x38e8b0=_0x38e8b0-0x0;var _0x139697=_0xa1a7[_0x38e8b0];return _0x139697;};'use strict';var _=require(_0x7a1a('0x0'));var util=require(_0x7a1a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7a1a('0x2'));var BPromise=require(_0x7a1a('0x3'));var rp=require(_0x7a1a('0x4'));var fs=require('fs');var path=require(_0x7a1a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7a1a('0x6'));var integrations=require(_0x7a1a('0x7'));module[_0x7a1a('0x8')]=function(_0x2d2c74,_0x4530ea){return _0x2d2c74['define'](_0x7a1a('0x9'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8207=['../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x8207,0x93));var _0x7820=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8207[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x7820('0x0'));var logger=require(_0x7820('0x1'))(_0x7820('0x2'));var moment=require(_0x7820('0x3'));var BPromise=require('bluebird');var rp=require(_0x7820('0x4'));var fs=require('fs');var path=require(_0x7820('0x5'));var rimraf=require(_0x7820('0x6'));var config=require(_0x7820('0x7'));var attributes=require(_0x7820('0x8'));var integrations=require(_0x7820('0x9'));module['exports']=function(_0x577829,_0x25a6eb){return _0x577829[_0x7820('0xa')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 876201a..2d5398a 100644 --- a/server/api/intDeskAccount/intDeskAccount.rpc.js +++ b/server/api/intDeskAccount/intDeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0eb=['../../config/environment','client','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','where','attributes','limit','include','model','map','ShowDeskAccount','find','raw','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1a62c1,_0x1b7755){var _0x2d0dc0=function(_0x2a4d5e){while(--_0x2a4d5e){_0x1a62c1['push'](_0x1a62c1['shift']());}};_0x2d0dc0(++_0x1b7755);}(_0xe0eb,0x132));var _0xbe0e=function(_0x18bf17,_0x32626e){_0x18bf17=_0x18bf17-0x0;var _0x7c4e02=_0xe0eb[_0x18bf17];return _0x7c4e02;};'use strict';var _=require(_0xbe0e('0x0'));var util=require(_0xbe0e('0x1'));var moment=require(_0xbe0e('0x2'));var BPromise=require(_0xbe0e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe0e('0x4'));var db=require(_0xbe0e('0x5'))['db'];var utils=require(_0xbe0e('0x6'));var logger=require(_0xbe0e('0x7'))(_0xbe0e('0x8'));var config=require(_0xbe0e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbe0e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49887a,_0x2cef11,_0x57352a){return new BPromise(function(_0x2409e5,_0x41135f){return client['request'](_0x49887a,_0x57352a)[_0xbe0e('0xb')](function(_0x2edd82){logger[_0xbe0e('0xc')](_0xbe0e('0xd'),_0x2cef11,'request\x20sent');logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x2cef11,_0xbe0e('0xe'),JSON[_0xbe0e('0xf')](_0x2edd82));if(_0x2edd82[_0xbe0e('0x10')]){if(_0x2edd82[_0xbe0e('0x10')][_0xbe0e('0x11')]===0x1f4){logger[_0xbe0e('0x10')](_0xbe0e('0xd'),_0x2cef11,_0x2edd82['error'][_0xbe0e('0x12')]);return _0x41135f(_0x2edd82[_0xbe0e('0x10')][_0xbe0e('0x12')]);}logger[_0xbe0e('0x10')](_0xbe0e('0xd'),_0x2cef11,_0x2edd82[_0xbe0e('0x10')][_0xbe0e('0x12')]);return _0x2409e5(_0x2edd82[_0xbe0e('0x10')][_0xbe0e('0x12')]);}else{logger['info'](_0xbe0e('0xd'),_0x2cef11,_0xbe0e('0xe'));_0x2409e5(_0x2edd82[_0xbe0e('0x13')][_0xbe0e('0x12')]);}})[_0xbe0e('0x14')](function(_0x1e5a5e){logger[_0xbe0e('0x10')](_0xbe0e('0xd'),_0x2cef11,_0x1e5a5e);_0x41135f(_0x1e5a5e);});});}exports[_0xbe0e('0x15')]=function(_0x25695d){var _0x5d85fd=this;return new Promise(function(_0x4e8162,_0x53f4d8){return db[_0xbe0e('0x16')][_0xbe0e('0x17')]({'raw':_0x25695d['options']?_0x25695d['options']['raw']===undefined?!![]:![]:!![],'where':_0x25695d[_0xbe0e('0x18')]?_0x25695d[_0xbe0e('0x18')][_0xbe0e('0x19')]||null:null,'attributes':_0x25695d[_0xbe0e('0x18')]?_0x25695d[_0xbe0e('0x18')][_0xbe0e('0x1a')]||null:null,'limit':_0x25695d['options']?_0x25695d[_0xbe0e('0x18')][_0xbe0e('0x1b')]||null:null,'include':_0x25695d['options']?_0x25695d[_0xbe0e('0x18')][_0xbe0e('0x1c')]?_['map'](_0x25695d[_0xbe0e('0x18')][_0xbe0e('0x1c')],function(_0x63756c){return{'model':db[_0x63756c[_0xbe0e('0x1d')]],'as':_0x63756c['as'],'attributes':_0x63756c[_0xbe0e('0x1a')],'include':_0x63756c[_0xbe0e('0x1c')]?_[_0xbe0e('0x1e')](_0x63756c['include'],function(_0x15e571){return{'model':db[_0x15e571[_0xbe0e('0x1d')]],'as':_0x15e571['as'],'attributes':_0x15e571[_0xbe0e('0x1a')],'include':_0x15e571[_0xbe0e('0x1c')]?_[_0xbe0e('0x1e')](_0x15e571['include'],function(_0x5358db){return{'model':db[_0x5358db[_0xbe0e('0x1d')]],'as':_0x5358db['as'],'attributes':_0x5358db[_0xbe0e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbe0e('0xb')](function(_0xf7fadd){logger['info'](_0xbe0e('0x15'),_0x25695d);logger['debug'](_0xbe0e('0x15'),_0x25695d,JSON[_0xbe0e('0xf')](_0xf7fadd));_0x4e8162(_0xf7fadd);})[_0xbe0e('0x14')](function(_0x569cb8){logger['error'](_0xbe0e('0x15'),_0x569cb8[_0xbe0e('0x12')],_0x25695d);_0x53f4d8(_0x5d85fd[_0xbe0e('0x10')](0x1f4,_0x569cb8[_0xbe0e('0x12')]));});});};exports[_0xbe0e('0x1f')]=function(_0x5c98de){var _0xe86d6f=this;return new Promise(function(_0xafbe56,_0x4ac290){return db['DeskAccount'][_0xbe0e('0x20')]({'raw':_0x5c98de[_0xbe0e('0x18')]?_0x5c98de[_0xbe0e('0x18')][_0xbe0e('0x21')]===undefined?!![]:![]:!![],'where':_0x5c98de[_0xbe0e('0x18')]?_0x5c98de[_0xbe0e('0x18')][_0xbe0e('0x19')]||null:null,'attributes':_0x5c98de['options']?_0x5c98de[_0xbe0e('0x18')][_0xbe0e('0x1a')]||null:null,'include':_0x5c98de[_0xbe0e('0x18')]?_0x5c98de['options']['include']?_[_0xbe0e('0x1e')](_0x5c98de[_0xbe0e('0x18')][_0xbe0e('0x1c')],function(_0x48a20c){return{'model':db[_0x48a20c[_0xbe0e('0x1d')]],'as':_0x48a20c['as'],'attributes':_0x48a20c[_0xbe0e('0x1a')],'include':_0x48a20c[_0xbe0e('0x1c')]?_[_0xbe0e('0x1e')](_0x48a20c[_0xbe0e('0x1c')],function(_0x5188fe){return{'model':db[_0x5188fe[_0xbe0e('0x1d')]],'as':_0x5188fe['as'],'attributes':_0x5188fe['attributes'],'include':_0x5188fe['include']?_[_0xbe0e('0x1e')](_0x5188fe['include'],function(_0x58ddf2){return{'model':db[_0x58ddf2[_0xbe0e('0x1d')]],'as':_0x58ddf2['as'],'attributes':_0x58ddf2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x180ea4){logger[_0xbe0e('0xc')]('ShowDeskAccount',_0x5c98de);logger[_0xbe0e('0x22')](_0xbe0e('0x1f'),_0x5c98de,JSON[_0xbe0e('0xf')](_0x180ea4));_0xafbe56(_0x180ea4);})[_0xbe0e('0x14')](function(_0x520d86){logger[_0xbe0e('0x10')]('ShowDeskAccount',_0x520d86[_0xbe0e('0x12')],_0x5c98de);_0x4ac290(_0xe86d6f[_0xbe0e('0x10')](0x1f4,_0x520d86['message']));});});}; \ No newline at end of file +var _0xaabf=['DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetDeskAccount','DeskAccount','options','raw','where','attributes','limit','include','map','model','ShowDeskAccount','find','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x4c6373,_0x47cb5d){var _0x8ed848=function(_0x23d513){while(--_0x23d513){_0x4c6373['push'](_0x4c6373['shift']());}};_0x8ed848(++_0x47cb5d);}(_0xaabf,0xc0));var _0xfaab=function(_0x47098,_0x219c5b){_0x47098=_0x47098-0x0;var _0xb1a9f8=_0xaabf[_0x47098];return _0xb1a9f8;};'use strict';var _=require(_0xfaab('0x0'));var util=require(_0xfaab('0x1'));var moment=require(_0xfaab('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfaab('0x3'));var logger=require(_0xfaab('0x4'))(_0xfaab('0x5'));var config=require(_0xfaab('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfaab('0x7')][_0xfaab('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x194783,_0x23e392,_0x1926d6){return new BPromise(function(_0x349e9c,_0x81b0bf){return client[_0xfaab('0x9')](_0x194783,_0x1926d6)[_0xfaab('0xa')](function(_0x2de23f){logger[_0xfaab('0xb')](_0xfaab('0xc'),_0x23e392,_0xfaab('0xd'));logger[_0xfaab('0xe')](_0xfaab('0xf'),_0x23e392,_0xfaab('0xd'),JSON[_0xfaab('0x10')](_0x2de23f));if(_0x2de23f['error']){if(_0x2de23f['error'][_0xfaab('0x11')]===0x1f4){logger['error'](_0xfaab('0xc'),_0x23e392,_0x2de23f[_0xfaab('0x12')]['message']);return _0x81b0bf(_0x2de23f[_0xfaab('0x12')][_0xfaab('0x13')]);}logger['error'](_0xfaab('0xc'),_0x23e392,_0x2de23f[_0xfaab('0x12')][_0xfaab('0x13')]);return _0x349e9c(_0x2de23f['error'][_0xfaab('0x13')]);}else{logger['info'](_0xfaab('0xc'),_0x23e392,_0xfaab('0xd'));_0x349e9c(_0x2de23f[_0xfaab('0x14')][_0xfaab('0x13')]);}})[_0xfaab('0x15')](function(_0xd36863){logger['error'](_0xfaab('0xc'),_0x23e392,_0xd36863);_0x81b0bf(_0xd36863);});});}exports[_0xfaab('0x16')]=function(_0x1048f4){var _0x5feb04=this;return new Promise(function(_0x32f565,_0xf8781e){return db[_0xfaab('0x17')]['findAll']({'raw':_0x1048f4[_0xfaab('0x18')]?_0x1048f4[_0xfaab('0x18')][_0xfaab('0x19')]===undefined?!![]:![]:!![],'where':_0x1048f4[_0xfaab('0x18')]?_0x1048f4[_0xfaab('0x18')][_0xfaab('0x1a')]||null:null,'attributes':_0x1048f4[_0xfaab('0x18')]?_0x1048f4[_0xfaab('0x18')][_0xfaab('0x1b')]||null:null,'limit':_0x1048f4[_0xfaab('0x18')]?_0x1048f4['options'][_0xfaab('0x1c')]||null:null,'include':_0x1048f4[_0xfaab('0x18')]?_0x1048f4[_0xfaab('0x18')][_0xfaab('0x1d')]?_[_0xfaab('0x1e')](_0x1048f4['options'][_0xfaab('0x1d')],function(_0x556600){return{'model':db[_0x556600[_0xfaab('0x1f')]],'as':_0x556600['as'],'attributes':_0x556600[_0xfaab('0x1b')],'include':_0x556600['include']?_[_0xfaab('0x1e')](_0x556600[_0xfaab('0x1d')],function(_0x148401){return{'model':db[_0x148401[_0xfaab('0x1f')]],'as':_0x148401['as'],'attributes':_0x148401[_0xfaab('0x1b')],'include':_0x148401['include']?_[_0xfaab('0x1e')](_0x148401[_0xfaab('0x1d')],function(_0x32cbc2){return{'model':db[_0x32cbc2['model']],'as':_0x32cbc2['as'],'attributes':_0x32cbc2[_0xfaab('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfaab('0xa')](function(_0x2c0827){logger[_0xfaab('0xb')](_0xfaab('0x16'),_0x1048f4);logger[_0xfaab('0xe')](_0xfaab('0x16'),_0x1048f4,JSON[_0xfaab('0x10')](_0x2c0827));_0x32f565(_0x2c0827);})[_0xfaab('0x15')](function(_0x5440f5){logger['error'](_0xfaab('0x16'),_0x5440f5[_0xfaab('0x13')],_0x1048f4);_0xf8781e(_0x5feb04[_0xfaab('0x12')](0x1f4,_0x5440f5[_0xfaab('0x13')]));});});};exports[_0xfaab('0x20')]=function(_0x7e9688){var _0x3ac6eb=this;return new Promise(function(_0x5e49d7,_0xa33175){return db[_0xfaab('0x17')][_0xfaab('0x21')]({'raw':_0x7e9688[_0xfaab('0x18')]?_0x7e9688[_0xfaab('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x7e9688[_0xfaab('0x18')]?_0x7e9688[_0xfaab('0x18')][_0xfaab('0x1a')]||null:null,'attributes':_0x7e9688[_0xfaab('0x18')]?_0x7e9688[_0xfaab('0x18')][_0xfaab('0x1b')]||null:null,'include':_0x7e9688[_0xfaab('0x18')]?_0x7e9688[_0xfaab('0x18')][_0xfaab('0x1d')]?_[_0xfaab('0x1e')](_0x7e9688[_0xfaab('0x18')][_0xfaab('0x1d')],function(_0x3c8d74){return{'model':db[_0x3c8d74['model']],'as':_0x3c8d74['as'],'attributes':_0x3c8d74[_0xfaab('0x1b')],'include':_0x3c8d74[_0xfaab('0x1d')]?_[_0xfaab('0x1e')](_0x3c8d74[_0xfaab('0x1d')],function(_0x3de006){return{'model':db[_0x3de006['model']],'as':_0x3de006['as'],'attributes':_0x3de006[_0xfaab('0x1b')],'include':_0x3de006[_0xfaab('0x1d')]?_[_0xfaab('0x1e')](_0x3de006['include'],function(_0x30d433){return{'model':db[_0x30d433[_0xfaab('0x1f')]],'as':_0x30d433['as'],'attributes':_0x30d433[_0xfaab('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x33e2c7){logger[_0xfaab('0xb')](_0xfaab('0x20'),_0x7e9688);logger[_0xfaab('0xe')]('ShowDeskAccount',_0x7e9688,JSON[_0xfaab('0x10')](_0x33e2c7));_0x5e49d7(_0x33e2c7);})[_0xfaab('0x15')](function(_0x448607){logger[_0xfaab('0x12')]('ShowDeskAccount',_0x448607[_0xfaab('0x13')],_0x7e9688);_0xa33175(_0x3ac6eb[_0xfaab('0x12')](0x1f4,_0x448607[_0xfaab('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 4108259..e3d8ea4 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x499068,_0x59e8ef){var _0x2bae7b=function(_0x1729aa){while(--_0x1729aa){_0x499068['push'](_0x499068['shift']());}};_0x2bae7b(++_0x59e8ef);}(_0x34e8,0x12c));var _0x834e=function(_0x1d9262,_0xb2b3be){_0x1d9262=_0x1d9262-0x0;var _0x53dbf2=_0x34e8[_0x1d9262];return _0x53dbf2;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0x55ca,0x126));var _0xa55c=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0x55ca[_0x16db8b];return _0x5ba017;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 2d8f391..f5f2dba 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb217=['STRING','sequelize','exports'];(function(_0x706091,_0x5e07d9){var _0x4aee6f=function(_0xf8d0f6){while(--_0xf8d0f6){_0x706091['push'](_0x706091['shift']());}};_0x4aee6f(++_0x5e07d9);}(_0xb217,0x76));var _0x7b21=function(_0x5b26c7,_0x4c2dd6){_0x5b26c7=_0x5b26c7-0x0;var _0x48d9b6=_0xb217[_0x5b26c7];return _0x48d9b6;};'use strict';var Sequelize=require(_0x7b21('0x0'));module[_0x7b21('0x1')]={'name':{'type':Sequelize[_0x7b21('0x2')]},'description':{'type':Sequelize[_0x7b21('0x2')]}}; \ No newline at end of file +var _0x62db=['sequelize','exports','STRING'];(function(_0xbde3c2,_0xebb49f){var _0xed1634=function(_0x17c690){while(--_0x17c690){_0xbde3c2['push'](_0xbde3c2['shift']());}};_0xed1634(++_0xebb49f);}(_0x62db,0x123));var _0xb62d=function(_0x56fbfb,_0x21c04c){_0x56fbfb=_0x56fbfb-0x0;var _0x4ccc1b=_0x62db[_0x56fbfb];return _0x4ccc1b;};'use strict';var Sequelize=require(_0xb62d('0x0'));module[_0xb62d('0x1')]={'name':{'type':Sequelize[_0xb62d('0x2')]},'description':{'type':Sequelize[_0xb62d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 44d9171..d2268c3 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c37=['hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','show','params','rawAttributes','include','options','find','catch','create','update','body','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','then','error','stack','name','index','map','DeskConfiguration','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x312be5,_0x149363){var _0x14d204=function(_0x21d24c){while(--_0x21d24c){_0x312be5['push'](_0x312be5['shift']());}};_0x14d204(++_0x149363);}(_0x5c37,0x161));var _0x75c3=function(_0x1fd9e7,_0x24cdbe){_0x1fd9e7=_0x1fd9e7-0x0;var _0x1781f2=_0x5c37[_0x1fd9e7];return _0x1781f2;};'use strict';var emlformat=require(_0x75c3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x75c3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x75c3('0x2'));var BPromise=require(_0x75c3('0x3'));var Mustache=require(_0x75c3('0x4'));var util=require(_0x75c3('0x5'));var path=require(_0x75c3('0x6'));var sox=require(_0x75c3('0x7'));var csv=require(_0x75c3('0x8'));var ejs=require(_0x75c3('0x9'));var fs=require('fs');var fs_extra=require(_0x75c3('0xa'));var _=require(_0x75c3('0xb'));var squel=require(_0x75c3('0xc'));var crypto=require(_0x75c3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x75c3('0xe'));var toCsv=require(_0x75c3('0x8'));var querystring=require(_0x75c3('0xf'));var Papa=require(_0x75c3('0x10'));var Redis=require(_0x75c3('0x11'));var authService=require(_0x75c3('0x12'));var qs=require(_0x75c3('0x13'));var as=require(_0x75c3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x75c3('0x15'))('api');var utils=require(_0x75c3('0x16'));var config=require(_0x75c3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x75c3('0x18'))['db'];function respondWithStatusCode(_0x5eb687,_0x3f7c24){_0x3f7c24=_0x3f7c24||0xcc;return function(_0x40ed05){if(_0x40ed05){return _0x5eb687[_0x75c3('0x19')](_0x3f7c24);}return _0x5eb687[_0x75c3('0x1a')](_0x3f7c24)[_0x75c3('0x1b')]();};}function respondWithResult(_0x73c279,_0x19a7c9){_0x19a7c9=_0x19a7c9||0xc8;return function(_0x164e22){if(_0x164e22){return _0x73c279[_0x75c3('0x1a')](_0x19a7c9)['json'](_0x164e22);}};}function respondWithFilteredResult(_0x17485e,_0x43132c){return function(_0x58c8da){if(_0x58c8da){var _0x37f6cc=typeof _0x43132c['offset']===_0x75c3('0x1c')&&typeof _0x43132c[_0x75c3('0x1d')]===_0x75c3('0x1c');var _0x26ccd1=_0x58c8da[_0x75c3('0x1e')];var _0x407a59=_0x37f6cc?0x0:_0x43132c[_0x75c3('0x1f')];var _0x144c40=_0x37f6cc?_0x58c8da[_0x75c3('0x1e')]:_0x43132c[_0x75c3('0x1f')]+_0x43132c['limit'];var _0x1f1dc5;if(_0x144c40>=_0x26ccd1){_0x144c40=_0x26ccd1;_0x1f1dc5=0xc8;}else{_0x1f1dc5=0xce;}_0x17485e[_0x75c3('0x1a')](_0x1f1dc5);return _0x17485e['set'](_0x75c3('0x20'),_0x407a59+'-'+_0x144c40+'/'+_0x26ccd1)[_0x75c3('0x21')](_0x58c8da);}return null;};}function patchUpdates(_0x1d3b80){return function(_0xfd2637){try{jsonpatch[_0x75c3('0x22')](_0xfd2637,_0x1d3b80,!![]);}catch(_0x3ef28c){return BPromise['reject'](_0x3ef28c);}return _0xfd2637['save']();};}function saveUpdates(_0x2580b3,_0x7f1e1){return function(_0x17e58a){if(_0x17e58a){return _0x17e58a['update'](_0x2580b3)[_0x75c3('0x23')](function(_0x54366c){return _0x54366c;});}return null;};}function removeEntity(_0x597993,_0x14506e){return function(_0x1afd65){if(_0x1afd65){return _0x1afd65['destroy']()[_0x75c3('0x23')](function(){_0x597993[_0x75c3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e9e99,_0x25aeff){return function(_0xa43d4d){if(!_0xa43d4d){_0x5e9e99[_0x75c3('0x19')](0x194);}return _0xa43d4d;};}function handleError(_0x246f17,_0x4da2a2){_0x4da2a2=_0x4da2a2||0x1f4;return function(_0x4d7ce2){logger[_0x75c3('0x24')](_0x4d7ce2[_0x75c3('0x25')]);if(_0x4d7ce2[_0x75c3('0x26')]){delete _0x4d7ce2[_0x75c3('0x26')];}_0x246f17[_0x75c3('0x1a')](_0x4da2a2)['send'](_0x4d7ce2);};}exports[_0x75c3('0x27')]=function(_0x4eddcc,_0x13f486){var _0x1f6538={},_0xab8bd0={},_0xe44053={'count':0x0,'rows':[]};var _0x1f254d=_[_0x75c3('0x28')](db[_0x75c3('0x29')]['rawAttributes'],function(_0x112577){return{'name':_0x112577[_0x75c3('0x2a')],'type':_0x112577[_0x75c3('0x2b')]['key']};});_0xab8bd0[_0x75c3('0x2c')]=_[_0x75c3('0x28')](_0x1f254d,_0x75c3('0x26'));_0xab8bd0[_0x75c3('0x2d')]=_[_0x75c3('0x2e')](_0x4eddcc[_0x75c3('0x2d')]);_0xab8bd0[_0x75c3('0x2f')]=_[_0x75c3('0x30')](_0xab8bd0[_0x75c3('0x2c')],_0xab8bd0[_0x75c3('0x2d')]);_0x1f6538[_0x75c3('0x31')]=_[_0x75c3('0x30')](_0xab8bd0[_0x75c3('0x2c')],qs[_0x75c3('0x32')](_0x4eddcc[_0x75c3('0x2d')][_0x75c3('0x32')]));_0x1f6538[_0x75c3('0x31')]=_0x1f6538[_0x75c3('0x31')][_0x75c3('0x33')]?_0x1f6538[_0x75c3('0x31')]:_0xab8bd0[_0x75c3('0x2c')];if(!_0x4eddcc[_0x75c3('0x2d')][_0x75c3('0x34')](_0x75c3('0x35'))){_0x1f6538[_0x75c3('0x1d')]=qs[_0x75c3('0x1d')](_0x4eddcc[_0x75c3('0x2d')][_0x75c3('0x1d')]);_0x1f6538[_0x75c3('0x1f')]=qs['offset'](_0x4eddcc[_0x75c3('0x2d')][_0x75c3('0x1f')]);}_0x1f6538[_0x75c3('0x36')]=qs['sort'](_0x4eddcc['query'][_0x75c3('0x37')]);_0x1f6538[_0x75c3('0x38')]=qs[_0x75c3('0x2f')](_[_0x75c3('0x39')](_0x4eddcc[_0x75c3('0x2d')],_0xab8bd0[_0x75c3('0x2f')]),_0x1f254d);if(_0x4eddcc[_0x75c3('0x2d')]['filter']){_0x1f6538[_0x75c3('0x38')]=_[_0x75c3('0x3a')](_0x1f6538[_0x75c3('0x38')],{'$or':_[_0x75c3('0x28')](_0x1f254d,function(_0x1bbf8d){if(_0x1bbf8d[_0x75c3('0x2b')]!==_0x75c3('0x3b')){var _0x259f48={};_0x259f48[_0x1bbf8d['name']]={'$like':'%'+_0x4eddcc[_0x75c3('0x2d')][_0x75c3('0x3c')]+'%'};return _0x259f48;}})});}_0x1f6538=_[_0x75c3('0x3a')]({},_0x1f6538,_0x4eddcc['options']);var _0x25cbb6={'where':_0x1f6538[_0x75c3('0x38')]};return db['DeskConfiguration'][_0x75c3('0x1e')](_0x25cbb6)['then'](function(_0x2a44b8){_0xe44053['count']=_0x2a44b8;if(_0x4eddcc[_0x75c3('0x2d')][_0x75c3('0x3d')]){_0x1f6538['include']=[{'all':!![]}];}return db[_0x75c3('0x29')][_0x75c3('0x3e')](_0x1f6538);})['then'](function(_0x3da320){_0xe44053['rows']=_0x3da320;return _0xe44053;})[_0x75c3('0x23')](respondWithFilteredResult(_0x13f486,_0x1f6538))['catch'](handleError(_0x13f486,null));};exports[_0x75c3('0x3f')]=function(_0x503b8b,_0x48cb50){var _0x1b336c={'raw':![],'where':{'id':_0x503b8b[_0x75c3('0x40')]['id']}},_0xb1c90={};_0xb1c90[_0x75c3('0x2c')]=_[_0x75c3('0x2e')](db[_0x75c3('0x29')][_0x75c3('0x41')]);_0xb1c90[_0x75c3('0x2d')]=_['keys'](_0x503b8b[_0x75c3('0x2d')]);_0xb1c90['filters']=_[_0x75c3('0x30')](_0xb1c90['model'],_0xb1c90[_0x75c3('0x2d')]);_0x1b336c[_0x75c3('0x31')]=_[_0x75c3('0x30')](_0xb1c90[_0x75c3('0x2c')],qs[_0x75c3('0x32')](_0x503b8b['query'][_0x75c3('0x32')]));_0x1b336c[_0x75c3('0x31')]=_0x1b336c[_0x75c3('0x31')][_0x75c3('0x33')]?_0x1b336c[_0x75c3('0x31')]:_0xb1c90[_0x75c3('0x2c')];if(_0x503b8b[_0x75c3('0x2d')][_0x75c3('0x3d')]){_0x1b336c[_0x75c3('0x42')]=[{'all':!![]}];}_0x1b336c=_[_0x75c3('0x3a')]({},_0x1b336c,_0x503b8b[_0x75c3('0x43')]);return db[_0x75c3('0x29')][_0x75c3('0x44')](_0x1b336c)[_0x75c3('0x23')](handleEntityNotFound(_0x48cb50,null))[_0x75c3('0x23')](respondWithResult(_0x48cb50,null))[_0x75c3('0x45')](handleError(_0x48cb50,null));};exports['create']=function(_0x214326,_0x28e791){return db['DeskConfiguration'][_0x75c3('0x46')](_0x214326['body'],{})[_0x75c3('0x23')](respondWithResult(_0x28e791,0xc9))[_0x75c3('0x45')](handleError(_0x28e791,null));};exports[_0x75c3('0x47')]=function(_0x8ca480,_0x587939){if(_0x8ca480[_0x75c3('0x48')]['id']){delete _0x8ca480[_0x75c3('0x48')]['id'];}return db['DeskConfiguration'][_0x75c3('0x44')]({'where':{'id':_0x8ca480[_0x75c3('0x40')]['id']}})[_0x75c3('0x23')](handleEntityNotFound(_0x587939,null))[_0x75c3('0x23')](saveUpdates(_0x8ca480[_0x75c3('0x48')],null))[_0x75c3('0x23')](respondWithResult(_0x587939,null))[_0x75c3('0x45')](handleError(_0x587939,null));};exports['destroy']=function(_0x39e59c,_0x40ab3d){return db['DeskConfiguration']['find']({'where':{'id':_0x39e59c['params']['id']}})[_0x75c3('0x23')](handleEntityNotFound(_0x40ab3d,null))[_0x75c3('0x23')](removeEntity(_0x40ab3d,null))[_0x75c3('0x45')](handleError(_0x40ab3d,null));};exports[_0x75c3('0x49')]=function(_0x3c8520,_0x20955a,_0x5b8b3b){var _0x5bbb6a={};var _0x5f43dd={};var _0x35c606;var _0x2aa841;return db['DeskConfiguration'][_0x75c3('0x4a')]({'where':{'id':_0x3c8520[_0x75c3('0x40')]['id']}})[_0x75c3('0x23')](handleEntityNotFound(_0x20955a,null))[_0x75c3('0x23')](function(_0x613960){if(_0x613960){_0x35c606=_0x613960;_0x5f43dd[_0x75c3('0x2c')]=_[_0x75c3('0x2e')](db[_0x75c3('0x4b')][_0x75c3('0x41')]);_0x5f43dd[_0x75c3('0x2d')]=_[_0x75c3('0x2e')](_0x3c8520[_0x75c3('0x2d')]);_0x5f43dd[_0x75c3('0x2f')]=_[_0x75c3('0x30')](_0x5f43dd[_0x75c3('0x2c')],_0x5f43dd['query']);_0x5bbb6a[_0x75c3('0x31')]=_[_0x75c3('0x30')](_0x5f43dd['model'],qs['fields'](_0x3c8520[_0x75c3('0x2d')][_0x75c3('0x32')]));_0x5bbb6a['attributes']=_0x5bbb6a[_0x75c3('0x31')]['length']?_0x5bbb6a[_0x75c3('0x31')]:_0x5f43dd[_0x75c3('0x2c')];_0x5bbb6a[_0x75c3('0x36')]=qs[_0x75c3('0x37')](_0x3c8520[_0x75c3('0x2d')][_0x75c3('0x37')]);_0x5bbb6a[_0x75c3('0x38')]=qs[_0x75c3('0x2f')](_[_0x75c3('0x39')](_0x3c8520[_0x75c3('0x2d')],_0x5f43dd[_0x75c3('0x2f')]));if(_0x3c8520[_0x75c3('0x2d')]['filter']){_0x5bbb6a['where']=_[_0x75c3('0x3a')](_0x5bbb6a[_0x75c3('0x38')],{'$or':_[_0x75c3('0x28')](_0x5bbb6a[_0x75c3('0x31')],function(_0x4a5fdf){var _0xb6f55f={};_0xb6f55f[_0x4a5fdf]={'$like':'%'+_0x3c8520[_0x75c3('0x2d')][_0x75c3('0x3c')]+'%'};return _0xb6f55f;})});}_0x5bbb6a=_['merge']({},_0x5bbb6a,_0x3c8520[_0x75c3('0x43')]);return _0x35c606['getFields'](_0x5bbb6a);}})[_0x75c3('0x23')](function(_0x43a83f){if(_0x43a83f){_0x2aa841=_0x43a83f['length'];if(!_0x3c8520[_0x75c3('0x2d')]['hasOwnProperty']('nolimit')){_0x5bbb6a[_0x75c3('0x1d')]=qs['limit'](_0x3c8520[_0x75c3('0x2d')][_0x75c3('0x1d')]);_0x5bbb6a[_0x75c3('0x1f')]=qs[_0x75c3('0x1f')](_0x3c8520['query'][_0x75c3('0x1f')]);}return _0x35c606[_0x75c3('0x49')](_0x5bbb6a);}})[_0x75c3('0x23')](function(_0x20fc9c){if(_0x20fc9c){return _0x20fc9c?{'count':_0x2aa841,'rows':_0x20fc9c}:null;}})[_0x75c3('0x23')](respondWithResult(_0x20955a,null))[_0x75c3('0x45')](handleError(_0x20955a,null));};exports['getSubjects']=function(_0x58d6c4,_0x5456bc,_0x4f4209){var _0x175428={};var _0x287ae8={};var _0x25cfa2;var _0x2ea52e;return db[_0x75c3('0x29')]['findOne']({'where':{'id':_0x58d6c4['params']['id']}})[_0x75c3('0x23')](handleEntityNotFound(_0x5456bc,null))[_0x75c3('0x23')](function(_0x48d636){if(_0x48d636){_0x25cfa2=_0x48d636;_0x287ae8[_0x75c3('0x2c')]=_[_0x75c3('0x2e')](db['DeskField'][_0x75c3('0x41')]);_0x287ae8[_0x75c3('0x2d')]=_[_0x75c3('0x2e')](_0x58d6c4['query']);_0x287ae8['filters']=_['intersection'](_0x287ae8[_0x75c3('0x2c')],_0x287ae8[_0x75c3('0x2d')]);_0x175428[_0x75c3('0x31')]=_[_0x75c3('0x30')](_0x287ae8[_0x75c3('0x2c')],qs[_0x75c3('0x32')](_0x58d6c4[_0x75c3('0x2d')]['fields']));_0x175428[_0x75c3('0x31')]=_0x175428[_0x75c3('0x31')][_0x75c3('0x33')]?_0x175428[_0x75c3('0x31')]:_0x287ae8[_0x75c3('0x2c')];_0x175428['order']=qs['sort'](_0x58d6c4[_0x75c3('0x2d')]['sort']);_0x175428['where']=qs['filters'](_['pick'](_0x58d6c4[_0x75c3('0x2d')],_0x287ae8[_0x75c3('0x2f')]));if(_0x58d6c4['query'][_0x75c3('0x3c')]){_0x175428[_0x75c3('0x38')]=_[_0x75c3('0x3a')](_0x175428[_0x75c3('0x38')],{'$or':_['map'](_0x175428['attributes'],function(_0x5d2ffe){var _0x504e48={};_0x504e48[_0x5d2ffe]={'$like':'%'+_0x58d6c4[_0x75c3('0x2d')][_0x75c3('0x3c')]+'%'};return _0x504e48;})});}_0x175428=_[_0x75c3('0x3a')]({},_0x175428,_0x58d6c4['options']);return _0x25cfa2[_0x75c3('0x4c')](_0x175428);}})[_0x75c3('0x23')](function(_0x4d2134){if(_0x4d2134){_0x2ea52e=_0x4d2134['length'];if(!_0x58d6c4[_0x75c3('0x2d')][_0x75c3('0x34')]('nolimit')){_0x175428[_0x75c3('0x1d')]=qs[_0x75c3('0x1d')](_0x58d6c4[_0x75c3('0x2d')][_0x75c3('0x1d')]);_0x175428[_0x75c3('0x1f')]=qs[_0x75c3('0x1f')](_0x58d6c4[_0x75c3('0x2d')][_0x75c3('0x1f')]);}return _0x25cfa2['getSubjects'](_0x175428);}})['then'](function(_0x5beaba){if(_0x5beaba){return _0x5beaba?{'count':_0x2ea52e,'rows':_0x5beaba}:null;}})[_0x75c3('0x23')](respondWithResult(_0x5456bc,null))[_0x75c3('0x45')](handleError(_0x5456bc,null));};exports['getDescriptions']=function(_0x271e85,_0x176141,_0x58eb77){var _0x4716e6={};var _0x29cd3e={};var _0x225b46;var _0x978fd3;return db['DeskConfiguration'][_0x75c3('0x4a')]({'where':{'id':_0x271e85['params']['id']}})[_0x75c3('0x23')](handleEntityNotFound(_0x176141,null))[_0x75c3('0x23')](function(_0x5824bd){if(_0x5824bd){_0x225b46=_0x5824bd;_0x29cd3e[_0x75c3('0x2c')]=_[_0x75c3('0x2e')](db[_0x75c3('0x4b')]['rawAttributes']);_0x29cd3e[_0x75c3('0x2d')]=_[_0x75c3('0x2e')](_0x271e85[_0x75c3('0x2d')]);_0x29cd3e[_0x75c3('0x2f')]=_['intersection'](_0x29cd3e[_0x75c3('0x2c')],_0x29cd3e[_0x75c3('0x2d')]);_0x4716e6[_0x75c3('0x31')]=_[_0x75c3('0x30')](_0x29cd3e[_0x75c3('0x2c')],qs[_0x75c3('0x32')](_0x271e85[_0x75c3('0x2d')][_0x75c3('0x32')]));_0x4716e6['attributes']=_0x4716e6['attributes'][_0x75c3('0x33')]?_0x4716e6[_0x75c3('0x31')]:_0x29cd3e[_0x75c3('0x2c')];_0x4716e6[_0x75c3('0x36')]=qs['sort'](_0x271e85[_0x75c3('0x2d')][_0x75c3('0x37')]);_0x4716e6['where']=qs['filters'](_[_0x75c3('0x39')](_0x271e85[_0x75c3('0x2d')],_0x29cd3e[_0x75c3('0x2f')]));if(_0x271e85[_0x75c3('0x2d')]['filter']){_0x4716e6[_0x75c3('0x38')]=_[_0x75c3('0x3a')](_0x4716e6[_0x75c3('0x38')],{'$or':_[_0x75c3('0x28')](_0x4716e6['attributes'],function(_0x5b1ba9){var _0x49a7f2={};_0x49a7f2[_0x5b1ba9]={'$like':'%'+_0x271e85[_0x75c3('0x2d')][_0x75c3('0x3c')]+'%'};return _0x49a7f2;})});}_0x4716e6=_[_0x75c3('0x3a')]({},_0x4716e6,_0x271e85[_0x75c3('0x43')]);return _0x225b46[_0x75c3('0x4d')](_0x4716e6);}})[_0x75c3('0x23')](function(_0x33aee9){if(_0x33aee9){_0x978fd3=_0x33aee9[_0x75c3('0x33')];if(!_0x271e85[_0x75c3('0x2d')][_0x75c3('0x34')](_0x75c3('0x35'))){_0x4716e6[_0x75c3('0x1d')]=qs[_0x75c3('0x1d')](_0x271e85[_0x75c3('0x2d')][_0x75c3('0x1d')]);_0x4716e6[_0x75c3('0x1f')]=qs['offset'](_0x271e85[_0x75c3('0x2d')][_0x75c3('0x1f')]);}return _0x225b46[_0x75c3('0x4d')](_0x4716e6);}})[_0x75c3('0x23')](function(_0x55b92e){if(_0x55b92e){return _0x55b92e?{'count':_0x978fd3,'rows':_0x55b92e}:null;}})[_0x75c3('0x23')](respondWithResult(_0x176141,null))[_0x75c3('0x45')](handleError(_0x176141,null));};exports['getTags']=function(_0x42091b,_0x502529,_0x13ca79){var _0x38ba30={};var _0x204dc3={};var _0x3b2fd7;var _0x3569a0;return db[_0x75c3('0x29')][_0x75c3('0x4a')]({'where':{'id':_0x42091b[_0x75c3('0x40')]['id']}})['then'](handleEntityNotFound(_0x502529,null))['then'](function(_0xd05fa){if(_0xd05fa){_0x3b2fd7=_0xd05fa;_0x204dc3[_0x75c3('0x2c')]=_[_0x75c3('0x2e')](db['Tag'][_0x75c3('0x41')]);_0x204dc3[_0x75c3('0x2d')]=_['keys'](_0x42091b[_0x75c3('0x2d')]);_0x204dc3['filters']=_[_0x75c3('0x30')](_0x204dc3['model'],_0x204dc3[_0x75c3('0x2d')]);_0x38ba30['attributes']=_[_0x75c3('0x30')](_0x204dc3[_0x75c3('0x2c')],qs['fields'](_0x42091b['query'][_0x75c3('0x32')]));_0x38ba30[_0x75c3('0x31')]=_0x38ba30[_0x75c3('0x31')]['length']?_0x38ba30[_0x75c3('0x31')]:_0x204dc3[_0x75c3('0x2c')];_0x38ba30[_0x75c3('0x36')]=qs[_0x75c3('0x37')](_0x42091b[_0x75c3('0x2d')]['sort']);_0x38ba30[_0x75c3('0x38')]=qs[_0x75c3('0x2f')](_[_0x75c3('0x39')](_0x42091b[_0x75c3('0x2d')],_0x204dc3[_0x75c3('0x2f')]));if(_0x42091b[_0x75c3('0x2d')][_0x75c3('0x3c')]){_0x38ba30[_0x75c3('0x38')]=_[_0x75c3('0x3a')](_0x38ba30[_0x75c3('0x38')],{'$or':_['map'](_0x38ba30[_0x75c3('0x31')],function(_0x53c44e){var _0x12ec90={};_0x12ec90[_0x53c44e]={'$like':'%'+_0x42091b[_0x75c3('0x2d')][_0x75c3('0x3c')]+'%'};return _0x12ec90;})});}_0x38ba30=_[_0x75c3('0x3a')]({},_0x38ba30,_0x42091b['options']);return _0x3b2fd7[_0x75c3('0x4e')](_0x38ba30);}})['then'](function(_0x399040){if(_0x399040){_0x3569a0=_0x399040[_0x75c3('0x33')];if(!_0x42091b[_0x75c3('0x2d')][_0x75c3('0x34')]('nolimit')){_0x38ba30['limit']=qs[_0x75c3('0x1d')](_0x42091b[_0x75c3('0x2d')][_0x75c3('0x1d')]);_0x38ba30[_0x75c3('0x1f')]=qs[_0x75c3('0x1f')](_0x42091b[_0x75c3('0x2d')][_0x75c3('0x1f')]);}return _0x3b2fd7[_0x75c3('0x4e')](_0x38ba30);}})['then'](function(_0x25feef){if(_0x25feef){return _0x25feef?{'count':_0x3569a0,'rows':_0x25feef}:null;}})[_0x75c3('0x23')](respondWithResult(_0x502529,null))[_0x75c3('0x45')](handleError(_0x502529,null));};exports['setTags']=function(_0x251957,_0x447127,_0x24671c){if(_0x251957['body']['id']){delete _0x251957['body']['id'];}return db[_0x75c3('0x29')][_0x75c3('0x4a')]({'where':{'id':_0x251957['params']['id']}})[_0x75c3('0x23')](handleEntityNotFound(_0x447127,null))['then'](function(_0x428dc3){if(_0x428dc3){return _0x428dc3[_0x75c3('0x4f')](_0x251957['body'][_0x75c3('0x50')]||[]);}return null;})['then'](respondWithResult(_0x447127,null))[_0x75c3('0x45')](handleError(_0x447127,null));}; \ No newline at end of file +var _0x5a63=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','find','create','catch','update','body','getFields','findOne','DeskField','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','stack','name','send','index','map','DeskConfiguration','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort'];(function(_0x25badc,_0xf437fd){var _0x1eb093=function(_0x57b143){while(--_0x57b143){_0x25badc['push'](_0x25badc['shift']());}};_0x1eb093(++_0xf437fd);}(_0x5a63,0xc2));var _0x35a6=function(_0x55ba48,_0x242900){_0x55ba48=_0x55ba48-0x0;var _0x2daac2=_0x5a63[_0x55ba48];return _0x2daac2;};'use strict';var emlformat=require(_0x35a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x35a6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x35a6('0x2'));var moment=require(_0x35a6('0x3'));var BPromise=require(_0x35a6('0x4'));var Mustache=require(_0x35a6('0x5'));var util=require(_0x35a6('0x6'));var path=require(_0x35a6('0x7'));var sox=require('sox');var csv=require(_0x35a6('0x8'));var ejs=require(_0x35a6('0x9'));var fs=require('fs');var fs_extra=require(_0x35a6('0xa'));var _=require(_0x35a6('0xb'));var squel=require(_0x35a6('0xc'));var crypto=require('crypto');var jsforce=require(_0x35a6('0xd'));var deskjs=require(_0x35a6('0xe'));var toCsv=require(_0x35a6('0x8'));var querystring=require(_0x35a6('0xf'));var Papa=require(_0x35a6('0x10'));var Redis=require('ioredis');var authService=require(_0x35a6('0x11'));var qs=require(_0x35a6('0x12'));var as=require(_0x35a6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x35a6('0x14'));var utils=require(_0x35a6('0x15'));var config=require(_0x35a6('0x16'));var licenseUtil=require(_0x35a6('0x17'));var db=require(_0x35a6('0x18'))['db'];function respondWithStatusCode(_0x3649da,_0x11794c){_0x11794c=_0x11794c||0xcc;return function(_0x4de159){if(_0x4de159){return _0x3649da[_0x35a6('0x19')](_0x11794c);}return _0x3649da[_0x35a6('0x1a')](_0x11794c)[_0x35a6('0x1b')]();};}function respondWithResult(_0x53521d,_0x205e75){_0x205e75=_0x205e75||0xc8;return function(_0xbef8cb){if(_0xbef8cb){return _0x53521d[_0x35a6('0x1a')](_0x205e75)['json'](_0xbef8cb);}};}function respondWithFilteredResult(_0x5c57bd,_0x5e7d19){return function(_0x19a4fa){if(_0x19a4fa){var _0x2da618=typeof _0x5e7d19[_0x35a6('0x1c')]===_0x35a6('0x1d')&&typeof _0x5e7d19[_0x35a6('0x1e')]===_0x35a6('0x1d');var _0x210c46=_0x19a4fa[_0x35a6('0x1f')];var _0x4dc66a=_0x2da618?0x0:_0x5e7d19[_0x35a6('0x1c')];var _0x31588b=_0x2da618?_0x19a4fa[_0x35a6('0x1f')]:_0x5e7d19[_0x35a6('0x1c')]+_0x5e7d19[_0x35a6('0x1e')];var _0x508112;if(_0x31588b>=_0x210c46){_0x31588b=_0x210c46;_0x508112=0xc8;}else{_0x508112=0xce;}_0x5c57bd['status'](_0x508112);return _0x5c57bd[_0x35a6('0x20')](_0x35a6('0x21'),_0x4dc66a+'-'+_0x31588b+'/'+_0x210c46)[_0x35a6('0x22')](_0x19a4fa);}return null;};}function patchUpdates(_0x3eff34){return function(_0x4286d4){try{jsonpatch[_0x35a6('0x23')](_0x4286d4,_0x3eff34,!![]);}catch(_0x5b6c47){return BPromise['reject'](_0x5b6c47);}return _0x4286d4[_0x35a6('0x24')]();};}function saveUpdates(_0x1727c1,_0x109746){return function(_0x4c86c){if(_0x4c86c){return _0x4c86c['update'](_0x1727c1)[_0x35a6('0x25')](function(_0x104176){return _0x104176;});}return null;};}function removeEntity(_0x46806b,_0x5c8090){return function(_0x2c5d3d){if(_0x2c5d3d){return _0x2c5d3d[_0x35a6('0x26')]()[_0x35a6('0x25')](function(){_0x46806b[_0x35a6('0x1a')](0xcc)[_0x35a6('0x1b')]();});}};}function handleEntityNotFound(_0x1673af,_0x1c180f){return function(_0x2e0bd6){if(!_0x2e0bd6){_0x1673af['sendStatus'](0x194);}return _0x2e0bd6;};}function handleError(_0x5ccc91,_0x1ea52e){_0x1ea52e=_0x1ea52e||0x1f4;return function(_0x28de5c){logger['error'](_0x28de5c[_0x35a6('0x27')]);if(_0x28de5c[_0x35a6('0x28')]){delete _0x28de5c[_0x35a6('0x28')];}_0x5ccc91['status'](_0x1ea52e)[_0x35a6('0x29')](_0x28de5c);};}exports[_0x35a6('0x2a')]=function(_0x326316,_0x47df2d){var _0x179734={},_0x8f14b7={},_0x19af46={'count':0x0,'rows':[]};var _0x2f97a2=_[_0x35a6('0x2b')](db[_0x35a6('0x2c')][_0x35a6('0x2d')],function(_0x727328){return{'name':_0x727328['fieldName'],'type':_0x727328[_0x35a6('0x2e')][_0x35a6('0x2f')]};});_0x8f14b7[_0x35a6('0x30')]=_[_0x35a6('0x2b')](_0x2f97a2,_0x35a6('0x28'));_0x8f14b7[_0x35a6('0x31')]=_['keys'](_0x326316[_0x35a6('0x31')]);_0x8f14b7[_0x35a6('0x32')]=_[_0x35a6('0x33')](_0x8f14b7[_0x35a6('0x30')],_0x8f14b7[_0x35a6('0x31')]);_0x179734['attributes']=_[_0x35a6('0x33')](_0x8f14b7[_0x35a6('0x30')],qs[_0x35a6('0x34')](_0x326316[_0x35a6('0x31')][_0x35a6('0x34')]));_0x179734[_0x35a6('0x35')]=_0x179734[_0x35a6('0x35')][_0x35a6('0x36')]?_0x179734[_0x35a6('0x35')]:_0x8f14b7[_0x35a6('0x30')];if(!_0x326316[_0x35a6('0x31')][_0x35a6('0x37')]('nolimit')){_0x179734[_0x35a6('0x1e')]=qs['limit'](_0x326316['query'][_0x35a6('0x1e')]);_0x179734['offset']=qs[_0x35a6('0x1c')](_0x326316[_0x35a6('0x31')]['offset']);}_0x179734[_0x35a6('0x38')]=qs[_0x35a6('0x39')](_0x326316[_0x35a6('0x31')][_0x35a6('0x39')]);_0x179734[_0x35a6('0x3a')]=qs[_0x35a6('0x32')](_[_0x35a6('0x3b')](_0x326316[_0x35a6('0x31')],_0x8f14b7[_0x35a6('0x32')]),_0x2f97a2);if(_0x326316[_0x35a6('0x31')][_0x35a6('0x3c')]){_0x179734[_0x35a6('0x3a')]=_[_0x35a6('0x3d')](_0x179734[_0x35a6('0x3a')],{'$or':_[_0x35a6('0x2b')](_0x2f97a2,function(_0x4f9ac2){if(_0x4f9ac2[_0x35a6('0x2e')]!==_0x35a6('0x3e')){var _0x1bac8e={};_0x1bac8e[_0x4f9ac2[_0x35a6('0x28')]]={'$like':'%'+_0x326316[_0x35a6('0x31')][_0x35a6('0x3c')]+'%'};return _0x1bac8e;}})});}_0x179734=_[_0x35a6('0x3d')]({},_0x179734,_0x326316[_0x35a6('0x3f')]);var _0x21d403={'where':_0x179734['where']};return db[_0x35a6('0x2c')][_0x35a6('0x1f')](_0x21d403)[_0x35a6('0x25')](function(_0x2e22b2){_0x19af46['count']=_0x2e22b2;if(_0x326316[_0x35a6('0x31')][_0x35a6('0x40')]){_0x179734[_0x35a6('0x41')]=[{'all':!![]}];}return db[_0x35a6('0x2c')]['findAll'](_0x179734);})[_0x35a6('0x25')](function(_0x424ed9){_0x19af46[_0x35a6('0x42')]=_0x424ed9;return _0x19af46;})[_0x35a6('0x25')](respondWithFilteredResult(_0x47df2d,_0x179734))['catch'](handleError(_0x47df2d,null));};exports[_0x35a6('0x43')]=function(_0xa2ec56,_0x5cdcc1){var _0x5ee7ad={'raw':![],'where':{'id':_0xa2ec56[_0x35a6('0x44')]['id']}},_0x24d2eb={};_0x24d2eb['model']=_[_0x35a6('0x45')](db[_0x35a6('0x2c')]['rawAttributes']);_0x24d2eb[_0x35a6('0x31')]=_[_0x35a6('0x45')](_0xa2ec56[_0x35a6('0x31')]);_0x24d2eb[_0x35a6('0x32')]=_[_0x35a6('0x33')](_0x24d2eb[_0x35a6('0x30')],_0x24d2eb[_0x35a6('0x31')]);_0x5ee7ad[_0x35a6('0x35')]=_[_0x35a6('0x33')](_0x24d2eb[_0x35a6('0x30')],qs['fields'](_0xa2ec56[_0x35a6('0x31')][_0x35a6('0x34')]));_0x5ee7ad[_0x35a6('0x35')]=_0x5ee7ad[_0x35a6('0x35')][_0x35a6('0x36')]?_0x5ee7ad[_0x35a6('0x35')]:_0x24d2eb[_0x35a6('0x30')];if(_0xa2ec56['query']['includeAll']){_0x5ee7ad['include']=[{'all':!![]}];}_0x5ee7ad=_['merge']({},_0x5ee7ad,_0xa2ec56[_0x35a6('0x3f')]);return db[_0x35a6('0x2c')][_0x35a6('0x46')](_0x5ee7ad)[_0x35a6('0x25')](handleEntityNotFound(_0x5cdcc1,null))[_0x35a6('0x25')](respondWithResult(_0x5cdcc1,null))['catch'](handleError(_0x5cdcc1,null));};exports[_0x35a6('0x47')]=function(_0x168e6b,_0x278254){return db[_0x35a6('0x2c')]['create'](_0x168e6b['body'],{})[_0x35a6('0x25')](respondWithResult(_0x278254,0xc9))[_0x35a6('0x48')](handleError(_0x278254,null));};exports[_0x35a6('0x49')]=function(_0xe5b3fc,_0xe3d6a6){if(_0xe5b3fc['body']['id']){delete _0xe5b3fc['body']['id'];}return db[_0x35a6('0x2c')][_0x35a6('0x46')]({'where':{'id':_0xe5b3fc[_0x35a6('0x44')]['id']}})['then'](handleEntityNotFound(_0xe3d6a6,null))['then'](saveUpdates(_0xe5b3fc[_0x35a6('0x4a')],null))[_0x35a6('0x25')](respondWithResult(_0xe3d6a6,null))[_0x35a6('0x48')](handleError(_0xe3d6a6,null));};exports[_0x35a6('0x26')]=function(_0x2d8f2c,_0x14df0f){return db[_0x35a6('0x2c')][_0x35a6('0x46')]({'where':{'id':_0x2d8f2c[_0x35a6('0x44')]['id']}})[_0x35a6('0x25')](handleEntityNotFound(_0x14df0f,null))[_0x35a6('0x25')](removeEntity(_0x14df0f,null))['catch'](handleError(_0x14df0f,null));};exports[_0x35a6('0x4b')]=function(_0x20e70f,_0xa44af2,_0x5ac664){var _0x46c2a4={};var _0x59f133={};var _0x2d2222;var _0xd3880b;return db['DeskConfiguration'][_0x35a6('0x4c')]({'where':{'id':_0x20e70f[_0x35a6('0x44')]['id']}})[_0x35a6('0x25')](handleEntityNotFound(_0xa44af2,null))[_0x35a6('0x25')](function(_0x5ecd34){if(_0x5ecd34){_0x2d2222=_0x5ecd34;_0x59f133[_0x35a6('0x30')]=_[_0x35a6('0x45')](db[_0x35a6('0x4d')][_0x35a6('0x2d')]);_0x59f133[_0x35a6('0x31')]=_[_0x35a6('0x45')](_0x20e70f[_0x35a6('0x31')]);_0x59f133['filters']=_[_0x35a6('0x33')](_0x59f133['model'],_0x59f133['query']);_0x46c2a4['attributes']=_[_0x35a6('0x33')](_0x59f133[_0x35a6('0x30')],qs[_0x35a6('0x34')](_0x20e70f[_0x35a6('0x31')][_0x35a6('0x34')]));_0x46c2a4[_0x35a6('0x35')]=_0x46c2a4[_0x35a6('0x35')][_0x35a6('0x36')]?_0x46c2a4[_0x35a6('0x35')]:_0x59f133[_0x35a6('0x30')];_0x46c2a4['order']=qs[_0x35a6('0x39')](_0x20e70f[_0x35a6('0x31')][_0x35a6('0x39')]);_0x46c2a4[_0x35a6('0x3a')]=qs['filters'](_[_0x35a6('0x3b')](_0x20e70f[_0x35a6('0x31')],_0x59f133['filters']));if(_0x20e70f[_0x35a6('0x31')]['filter']){_0x46c2a4[_0x35a6('0x3a')]=_[_0x35a6('0x3d')](_0x46c2a4['where'],{'$or':_[_0x35a6('0x2b')](_0x46c2a4[_0x35a6('0x35')],function(_0xeca62d){var _0x14282e={};_0x14282e[_0xeca62d]={'$like':'%'+_0x20e70f['query'][_0x35a6('0x3c')]+'%'};return _0x14282e;})});}_0x46c2a4=_[_0x35a6('0x3d')]({},_0x46c2a4,_0x20e70f['options']);return _0x2d2222[_0x35a6('0x4b')](_0x46c2a4);}})[_0x35a6('0x25')](function(_0x49c4fc){if(_0x49c4fc){_0xd3880b=_0x49c4fc[_0x35a6('0x36')];if(!_0x20e70f[_0x35a6('0x31')][_0x35a6('0x37')](_0x35a6('0x4e'))){_0x46c2a4['limit']=qs[_0x35a6('0x1e')](_0x20e70f[_0x35a6('0x31')][_0x35a6('0x1e')]);_0x46c2a4['offset']=qs[_0x35a6('0x1c')](_0x20e70f['query'][_0x35a6('0x1c')]);}return _0x2d2222[_0x35a6('0x4b')](_0x46c2a4);}})[_0x35a6('0x25')](function(_0x2fbae3){if(_0x2fbae3){return _0x2fbae3?{'count':_0xd3880b,'rows':_0x2fbae3}:null;}})[_0x35a6('0x25')](respondWithResult(_0xa44af2,null))[_0x35a6('0x48')](handleError(_0xa44af2,null));};exports[_0x35a6('0x4f')]=function(_0x206c8d,_0x4f097b,_0x25e10a){var _0x1c4cc6={};var _0x43fef7={};var _0x4cf3c9;var _0x37e5a8;return db[_0x35a6('0x2c')][_0x35a6('0x4c')]({'where':{'id':_0x206c8d[_0x35a6('0x44')]['id']}})['then'](handleEntityNotFound(_0x4f097b,null))['then'](function(_0x5d5a56){if(_0x5d5a56){_0x4cf3c9=_0x5d5a56;_0x43fef7[_0x35a6('0x30')]=_[_0x35a6('0x45')](db[_0x35a6('0x4d')][_0x35a6('0x2d')]);_0x43fef7[_0x35a6('0x31')]=_[_0x35a6('0x45')](_0x206c8d[_0x35a6('0x31')]);_0x43fef7[_0x35a6('0x32')]=_[_0x35a6('0x33')](_0x43fef7[_0x35a6('0x30')],_0x43fef7['query']);_0x1c4cc6['attributes']=_[_0x35a6('0x33')](_0x43fef7['model'],qs[_0x35a6('0x34')](_0x206c8d[_0x35a6('0x31')][_0x35a6('0x34')]));_0x1c4cc6[_0x35a6('0x35')]=_0x1c4cc6[_0x35a6('0x35')]['length']?_0x1c4cc6[_0x35a6('0x35')]:_0x43fef7[_0x35a6('0x30')];_0x1c4cc6[_0x35a6('0x38')]=qs[_0x35a6('0x39')](_0x206c8d[_0x35a6('0x31')]['sort']);_0x1c4cc6[_0x35a6('0x3a')]=qs[_0x35a6('0x32')](_[_0x35a6('0x3b')](_0x206c8d[_0x35a6('0x31')],_0x43fef7[_0x35a6('0x32')]));if(_0x206c8d[_0x35a6('0x31')][_0x35a6('0x3c')]){_0x1c4cc6[_0x35a6('0x3a')]=_[_0x35a6('0x3d')](_0x1c4cc6[_0x35a6('0x3a')],{'$or':_[_0x35a6('0x2b')](_0x1c4cc6[_0x35a6('0x35')],function(_0x4e5ac7){var _0x373ae3={};_0x373ae3[_0x4e5ac7]={'$like':'%'+_0x206c8d[_0x35a6('0x31')][_0x35a6('0x3c')]+'%'};return _0x373ae3;})});}_0x1c4cc6=_['merge']({},_0x1c4cc6,_0x206c8d[_0x35a6('0x3f')]);return _0x4cf3c9['getSubjects'](_0x1c4cc6);}})[_0x35a6('0x25')](function(_0x55bb58){if(_0x55bb58){_0x37e5a8=_0x55bb58[_0x35a6('0x36')];if(!_0x206c8d[_0x35a6('0x31')][_0x35a6('0x37')](_0x35a6('0x4e'))){_0x1c4cc6[_0x35a6('0x1e')]=qs[_0x35a6('0x1e')](_0x206c8d[_0x35a6('0x31')][_0x35a6('0x1e')]);_0x1c4cc6[_0x35a6('0x1c')]=qs[_0x35a6('0x1c')](_0x206c8d[_0x35a6('0x31')][_0x35a6('0x1c')]);}return _0x4cf3c9[_0x35a6('0x4f')](_0x1c4cc6);}})[_0x35a6('0x25')](function(_0x46b9cd){if(_0x46b9cd){return _0x46b9cd?{'count':_0x37e5a8,'rows':_0x46b9cd}:null;}})['then'](respondWithResult(_0x4f097b,null))[_0x35a6('0x48')](handleError(_0x4f097b,null));};exports[_0x35a6('0x50')]=function(_0x411522,_0x5f3004,_0x1206bd){var _0x2b8a7e={};var _0x4b42dc={};var _0x1805d9;var _0x400199;return db[_0x35a6('0x2c')][_0x35a6('0x4c')]({'where':{'id':_0x411522['params']['id']}})[_0x35a6('0x25')](handleEntityNotFound(_0x5f3004,null))[_0x35a6('0x25')](function(_0x15ad20){if(_0x15ad20){_0x1805d9=_0x15ad20;_0x4b42dc['model']=_['keys'](db[_0x35a6('0x4d')][_0x35a6('0x2d')]);_0x4b42dc[_0x35a6('0x31')]=_[_0x35a6('0x45')](_0x411522[_0x35a6('0x31')]);_0x4b42dc['filters']=_[_0x35a6('0x33')](_0x4b42dc[_0x35a6('0x30')],_0x4b42dc[_0x35a6('0x31')]);_0x2b8a7e[_0x35a6('0x35')]=_[_0x35a6('0x33')](_0x4b42dc[_0x35a6('0x30')],qs[_0x35a6('0x34')](_0x411522[_0x35a6('0x31')][_0x35a6('0x34')]));_0x2b8a7e[_0x35a6('0x35')]=_0x2b8a7e['attributes'][_0x35a6('0x36')]?_0x2b8a7e[_0x35a6('0x35')]:_0x4b42dc[_0x35a6('0x30')];_0x2b8a7e[_0x35a6('0x38')]=qs[_0x35a6('0x39')](_0x411522[_0x35a6('0x31')][_0x35a6('0x39')]);_0x2b8a7e[_0x35a6('0x3a')]=qs[_0x35a6('0x32')](_['pick'](_0x411522[_0x35a6('0x31')],_0x4b42dc[_0x35a6('0x32')]));if(_0x411522[_0x35a6('0x31')][_0x35a6('0x3c')]){_0x2b8a7e['where']=_['merge'](_0x2b8a7e[_0x35a6('0x3a')],{'$or':_[_0x35a6('0x2b')](_0x2b8a7e[_0x35a6('0x35')],function(_0x395024){var _0x2318c8={};_0x2318c8[_0x395024]={'$like':'%'+_0x411522[_0x35a6('0x31')][_0x35a6('0x3c')]+'%'};return _0x2318c8;})});}_0x2b8a7e=_[_0x35a6('0x3d')]({},_0x2b8a7e,_0x411522['options']);return _0x1805d9[_0x35a6('0x50')](_0x2b8a7e);}})['then'](function(_0x635f84){if(_0x635f84){_0x400199=_0x635f84[_0x35a6('0x36')];if(!_0x411522[_0x35a6('0x31')][_0x35a6('0x37')](_0x35a6('0x4e'))){_0x2b8a7e[_0x35a6('0x1e')]=qs['limit'](_0x411522[_0x35a6('0x31')]['limit']);_0x2b8a7e[_0x35a6('0x1c')]=qs[_0x35a6('0x1c')](_0x411522[_0x35a6('0x31')][_0x35a6('0x1c')]);}return _0x1805d9['getDescriptions'](_0x2b8a7e);}})['then'](function(_0x2593e0){if(_0x2593e0){return _0x2593e0?{'count':_0x400199,'rows':_0x2593e0}:null;}})[_0x35a6('0x25')](respondWithResult(_0x5f3004,null))[_0x35a6('0x48')](handleError(_0x5f3004,null));};exports[_0x35a6('0x51')]=function(_0x58b562,_0x1152f6,_0x110375){var _0x2c341f={};var _0x3f60f1={};var _0x5c8f26;var _0x4b51f1;return db[_0x35a6('0x2c')][_0x35a6('0x4c')]({'where':{'id':_0x58b562['params']['id']}})[_0x35a6('0x25')](handleEntityNotFound(_0x1152f6,null))[_0x35a6('0x25')](function(_0x1f5a4b){if(_0x1f5a4b){_0x5c8f26=_0x1f5a4b;_0x3f60f1[_0x35a6('0x30')]=_[_0x35a6('0x45')](db[_0x35a6('0x52')][_0x35a6('0x2d')]);_0x3f60f1[_0x35a6('0x31')]=_['keys'](_0x58b562[_0x35a6('0x31')]);_0x3f60f1[_0x35a6('0x32')]=_['intersection'](_0x3f60f1['model'],_0x3f60f1[_0x35a6('0x31')]);_0x2c341f[_0x35a6('0x35')]=_[_0x35a6('0x33')](_0x3f60f1[_0x35a6('0x30')],qs[_0x35a6('0x34')](_0x58b562['query'][_0x35a6('0x34')]));_0x2c341f[_0x35a6('0x35')]=_0x2c341f[_0x35a6('0x35')][_0x35a6('0x36')]?_0x2c341f['attributes']:_0x3f60f1['model'];_0x2c341f['order']=qs[_0x35a6('0x39')](_0x58b562['query'][_0x35a6('0x39')]);_0x2c341f[_0x35a6('0x3a')]=qs[_0x35a6('0x32')](_[_0x35a6('0x3b')](_0x58b562[_0x35a6('0x31')],_0x3f60f1[_0x35a6('0x32')]));if(_0x58b562[_0x35a6('0x31')]['filter']){_0x2c341f[_0x35a6('0x3a')]=_[_0x35a6('0x3d')](_0x2c341f[_0x35a6('0x3a')],{'$or':_[_0x35a6('0x2b')](_0x2c341f[_0x35a6('0x35')],function(_0x3de110){var _0x508f0c={};_0x508f0c[_0x3de110]={'$like':'%'+_0x58b562[_0x35a6('0x31')][_0x35a6('0x3c')]+'%'};return _0x508f0c;})});}_0x2c341f=_[_0x35a6('0x3d')]({},_0x2c341f,_0x58b562['options']);return _0x5c8f26[_0x35a6('0x51')](_0x2c341f);}})[_0x35a6('0x25')](function(_0x1f3a0c){if(_0x1f3a0c){_0x4b51f1=_0x1f3a0c[_0x35a6('0x36')];if(!_0x58b562[_0x35a6('0x31')][_0x35a6('0x37')](_0x35a6('0x4e'))){_0x2c341f[_0x35a6('0x1e')]=qs[_0x35a6('0x1e')](_0x58b562[_0x35a6('0x31')][_0x35a6('0x1e')]);_0x2c341f[_0x35a6('0x1c')]=qs['offset'](_0x58b562['query'][_0x35a6('0x1c')]);}return _0x5c8f26[_0x35a6('0x51')](_0x2c341f);}})[_0x35a6('0x25')](function(_0x29eda7){if(_0x29eda7){return _0x29eda7?{'count':_0x4b51f1,'rows':_0x29eda7}:null;}})[_0x35a6('0x25')](respondWithResult(_0x1152f6,null))[_0x35a6('0x48')](handleError(_0x1152f6,null));};exports[_0x35a6('0x53')]=function(_0xde209,_0x4d532d,_0x5e7dca){if(_0xde209[_0x35a6('0x4a')]['id']){delete _0xde209[_0x35a6('0x4a')]['id'];}return db[_0x35a6('0x2c')][_0x35a6('0x4c')]({'where':{'id':_0xde209[_0x35a6('0x44')]['id']}})[_0x35a6('0x25')](handleEntityNotFound(_0x4d532d,null))[_0x35a6('0x25')](function(_0x502b7b){if(_0x502b7b){return _0x502b7b[_0x35a6('0x53')](_0xde209['body']['ids']||[]);}return null;})[_0x35a6('0x25')](respondWithResult(_0x4d532d,null))[_0x35a6('0x48')](handleError(_0x4d532d,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index e079558..1f17b63 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.model.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x248b=['../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','util','api','bluebird','path'];(function(_0x15c805,_0xce5b6){var _0x23bca8=function(_0x19a1e0){while(--_0x19a1e0){_0x15c805['push'](_0x15c805['shift']());}};_0x23bca8(++_0xce5b6);}(_0x248b,0xef));var _0xb248=function(_0x36d4c8,_0x255a72){_0x36d4c8=_0x36d4c8-0x0;var _0x405168=_0x248b[_0x36d4c8];return _0x405168;};'use strict';var _=require('lodash');var util=require(_0xb248('0x0'));var logger=require('../../config/logger')(_0xb248('0x1'));var moment=require('moment');var BPromise=require(_0xb248('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb248('0x3'));var rimraf=require('rimraf');var config=require(_0xb248('0x4'));var attributes=require(_0xb248('0x5'));module[_0xb248('0x6')]=function(_0x44ad03,_0x23aeb5){return _0x44ad03['define'](_0xb248('0x7'),attributes,{'tableName':_0xb248('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4754=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x4754,0x1d4));var _0x4475=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4754[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4475('0x0'))('api');var moment=require(_0x4475('0x1'));var BPromise=require('bluebird');var rp=require(_0x4475('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4475('0x3'));var config=require(_0x4475('0x4'));var attributes=require(_0x4475('0x5'));module[_0x4475('0x6')]=function(_0x28c3b6,_0x3b5300){return _0x28c3b6['define'](_0x4475('0x7'),attributes,{'tableName':_0x4475('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 6a5b165..7d5b4f5 100644 --- a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js +++ b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe8e8=['lodash','util','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe8e8,0xc6));var _0x8e8e=function(_0x27eb80,_0x11fce3){_0x27eb80=_0x27eb80-0x0;var _0x43e938=_0xe8e8[_0x27eb80];return _0x43e938;};'use strict';var _=require(_0x8e8e('0x0'));var util=require(_0x8e8e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8e8e('0x2'));var fs=require('fs');var Redis=require(_0x8e8e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8e8e('0x4'))('rpc');var config=require(_0x8e8e('0x5'));var jayson=require(_0x8e8e('0x6'));var client=jayson[_0x8e8e('0x7')][_0x8e8e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x559147,_0x2d5ad4,_0x4edd6c){return new BPromise(function(_0x21703a,_0x35e125){return client[_0x8e8e('0x9')](_0x559147,_0x4edd6c)[_0x8e8e('0xa')](function(_0x40be2d){logger[_0x8e8e('0xb')](_0x8e8e('0xc'),_0x2d5ad4,'request\x20sent');logger[_0x8e8e('0xd')](_0x8e8e('0xe'),_0x2d5ad4,_0x8e8e('0xf'),JSON[_0x8e8e('0x10')](_0x40be2d));if(_0x40be2d['error']){if(_0x40be2d[_0x8e8e('0x11')][_0x8e8e('0x12')]===0x1f4){logger[_0x8e8e('0x11')](_0x8e8e('0xc'),_0x2d5ad4,_0x40be2d[_0x8e8e('0x11')][_0x8e8e('0x13')]);return _0x35e125(_0x40be2d[_0x8e8e('0x11')][_0x8e8e('0x13')]);}logger[_0x8e8e('0x11')](_0x8e8e('0xc'),_0x2d5ad4,_0x40be2d['error'][_0x8e8e('0x13')]);return _0x21703a(_0x40be2d[_0x8e8e('0x11')]['message']);}else{logger[_0x8e8e('0xb')](_0x8e8e('0xc'),_0x2d5ad4,'request\x20sent');_0x21703a(_0x40be2d[_0x8e8e('0x14')][_0x8e8e('0x13')]);}})[_0x8e8e('0x15')](function(_0x3b958a){logger[_0x8e8e('0x11')](_0x8e8e('0xc'),_0x2d5ad4,_0x3b958a);_0x35e125(_0x3b958a);});});} \ No newline at end of file +var _0x2b84=['jayson/promise','client','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x3187b0,_0x4cee2a){var _0x12c691=function(_0x25f27c){while(--_0x25f27c){_0x3187b0['push'](_0x3187b0['shift']());}};_0x12c691(++_0x4cee2a);}(_0x2b84,0x1ed));var _0x42b8=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x2b84[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x42b8('0x0'));var util=require(_0x42b8('0x1'));var moment=require('moment');var BPromise=require(_0x42b8('0x2'));var rs=require(_0x42b8('0x3'));var fs=require('fs');var Redis=require(_0x42b8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x42b8('0x5'));var logger=require('../../config/logger')(_0x42b8('0x6'));var config=require('../../config/environment');var jayson=require(_0x42b8('0x7'));var client=jayson[_0x42b8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a040d,_0x399f8e,_0x23459e){return new BPromise(function(_0x1c6323,_0x38de8a){return client[_0x42b8('0x9')](_0x4a040d,_0x23459e)['then'](function(_0x381f1a){logger[_0x42b8('0xa')](_0x42b8('0xb'),_0x399f8e,_0x42b8('0xc'));logger[_0x42b8('0xd')](_0x42b8('0xe'),_0x399f8e,_0x42b8('0xc'),JSON[_0x42b8('0xf')](_0x381f1a));if(_0x381f1a['error']){if(_0x381f1a['error'][_0x42b8('0x10')]===0x1f4){logger[_0x42b8('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x399f8e,_0x381f1a[_0x42b8('0x11')]['message']);return _0x38de8a(_0x381f1a['error'][_0x42b8('0x12')]);}logger[_0x42b8('0x11')](_0x42b8('0xb'),_0x399f8e,_0x381f1a[_0x42b8('0x11')][_0x42b8('0x12')]);return _0x1c6323(_0x381f1a['error'][_0x42b8('0x12')]);}else{logger['info'](_0x42b8('0xb'),_0x399f8e,'request\x20sent');_0x1c6323(_0x381f1a['result'][_0x42b8('0x12')]);}})[_0x42b8('0x13')](function(_0x2d1706){logger[_0x42b8('0x11')](_0x42b8('0xb'),_0x399f8e,_0x2d1706);_0x38de8a(_0x2d1706);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 88090c2..c73fd20 100644 --- a/server/api/intDeskField/index.js +++ b/server/api/intDeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4be=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','/:id','isAuthenticated','create','put','update','delete','destroy'];(function(_0x381777,_0x3ca98c){var _0x262575=function(_0x1adf3e){while(--_0x1adf3e){_0x381777['push'](_0x381777['shift']());}};_0x262575(++_0x3ca98c);}(_0xc4be,0x1bb));var _0xec4b=function(_0x398b23,_0x23f2f6){_0x398b23=_0x398b23-0x0;var _0x498238=_0xc4be[_0x398b23];return _0x498238;};'use strict';var multer=require(_0xec4b('0x0'));var util=require('util');var path=require(_0xec4b('0x1'));var timeout=require(_0xec4b('0x2'));var express=require(_0xec4b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xec4b('0x4'));var interaction=require(_0xec4b('0x5'));var config=require(_0xec4b('0x6'));var controller=require(_0xec4b('0x7'));router[_0xec4b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xec4b('0x8')](_0xec4b('0x9'),auth[_0xec4b('0xa')](),controller['show']);router['post']('/',auth[_0xec4b('0xa')](),controller[_0xec4b('0xb')]);router[_0xec4b('0xc')](_0xec4b('0x9'),auth[_0xec4b('0xa')](),controller[_0xec4b('0xd')]);router[_0xec4b('0xe')]('/:id',auth[_0xec4b('0xa')](),controller[_0xec4b('0xf')]);module[_0xec4b('0x10')]=router; \ No newline at end of file +var _0xd4ad=['show','post','isAuthenticated','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','index','/:id'];(function(_0x15542f,_0x3d79d6){var _0x3f2d03=function(_0x314be6){while(--_0x314be6){_0x15542f['push'](_0x15542f['shift']());}};_0x3f2d03(++_0x3d79d6);}(_0xd4ad,0x1e4));var _0xdd4a=function(_0x5d914f,_0x472649){_0x5d914f=_0x5d914f-0x0;var _0x3f0448=_0xd4ad[_0x5d914f];return _0x3f0448;};'use strict';var multer=require(_0xdd4a('0x0'));var util=require(_0xdd4a('0x1'));var path=require(_0xdd4a('0x2'));var timeout=require(_0xdd4a('0x3'));var express=require(_0xdd4a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdd4a('0x5'));var interaction=require(_0xdd4a('0x6'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xdd4a('0x7')]);router['get'](_0xdd4a('0x8'),auth['isAuthenticated'](),controller[_0xdd4a('0x9')]);router[_0xdd4a('0xa')]('/',auth[_0xdd4a('0xb')](),controller[_0xdd4a('0xc')]);router[_0xdd4a('0xd')](_0xdd4a('0x8'),auth['isAuthenticated'](),controller[_0xdd4a('0xe')]);router[_0xdd4a('0xf')](_0xdd4a('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xdd4a('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 7716bbd..f8671a7 100644 --- a/server/api/intDeskField/intDeskField.attributes.js +++ b/server/api/intDeskField/intDeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a74=['sequelize','exports','variable','customVariable','keyValue','picklist','string','STRING','ENUM','BOOLEAN'];(function(_0x201e5b,_0x282ec7){var _0x15c178=function(_0x4918d3){while(--_0x4918d3){_0x201e5b['push'](_0x201e5b['shift']());}};_0x15c178(++_0x282ec7);}(_0x7a74,0x96));var _0x47a7=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x7a74[_0x24259d];return _0x5a701;};'use strict';var Sequelize=require(_0x47a7('0x0'));module[_0x47a7('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x47a7('0x2'),_0x47a7('0x3'),_0x47a7('0x4'),_0x47a7('0x5')),'defaultValue':_0x47a7('0x6')},'content':{'type':Sequelize[_0x47a7('0x7')]},'key':{'type':Sequelize[_0x47a7('0x7')]},'keyType':{'type':Sequelize[_0x47a7('0x8')](_0x47a7('0x6'),'variable',_0x47a7('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x47a7('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x47a7('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x47a7('0x7')]}}; \ No newline at end of file +var _0x3088=['STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0x3088,0x1b1));var _0x8308=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x3088[_0x45bf86];return _0x1f02b7;};'use strict';var Sequelize=require(_0x8308('0x0'));module[_0x8308('0x1')]={'type':{'type':Sequelize[_0x8308('0x2')](_0x8308('0x3'),_0x8308('0x4'),_0x8308('0x5'),_0x8308('0x6'),'picklist'),'defaultValue':_0x8308('0x3')},'content':{'type':Sequelize[_0x8308('0x7')]},'key':{'type':Sequelize[_0x8308('0x7')]},'keyType':{'type':Sequelize[_0x8308('0x2')](_0x8308('0x3'),_0x8308('0x4'),_0x8308('0x5'))},'keyContent':{'type':Sequelize[_0x8308('0x7')]},'idField':{'type':Sequelize[_0x8308('0x7')]},'nameField':{'type':Sequelize[_0x8308('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8308('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 16fafef..6ed1ebf 100644 --- a/server/api/intDeskField/intDeskField.controller.js +++ b/server/api/intDeskField/intDeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04cc=['status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','DeskField','includeAll','include','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x133f14,_0x53b0d8){var _0x5e2072=function(_0x1efb2d){while(--_0x1efb2d){_0x133f14['push'](_0x133f14['shift']());}};_0x5e2072(++_0x53b0d8);}(_0x04cc,0x11a));var _0xc04c=function(_0x2b2583,_0x2a154b){_0x2b2583=_0x2b2583-0x0;var _0x4cd668=_0x04cc[_0x2b2583];return _0x4cd668;};'use strict';var emlformat=require(_0xc04c('0x0'));var rimraf=require(_0xc04c('0x1'));var zipdir=require(_0xc04c('0x2'));var jsonpatch=require(_0xc04c('0x3'));var rp=require('request-promise');var moment=require(_0xc04c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc04c('0x5'));var path=require(_0xc04c('0x6'));var sox=require(_0xc04c('0x7'));var csv=require(_0xc04c('0x8'));var ejs=require(_0xc04c('0x9'));var fs=require('fs');var fs_extra=require(_0xc04c('0xa'));var _=require(_0xc04c('0xb'));var squel=require('squel');var crypto=require(_0xc04c('0xc'));var jsforce=require(_0xc04c('0xd'));var deskjs=require(_0xc04c('0xe'));var toCsv=require(_0xc04c('0x8'));var querystring=require(_0xc04c('0xf'));var Papa=require(_0xc04c('0x10'));var Redis=require(_0xc04c('0x11'));var authService=require(_0xc04c('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc04c('0x13'));var logger=require(_0xc04c('0x14'))(_0xc04c('0x15'));var utils=require(_0xc04c('0x16'));var config=require(_0xc04c('0x17'));var licenseUtil=require(_0xc04c('0x18'));var db=require(_0xc04c('0x19'))['db'];function respondWithStatusCode(_0x563a5f,_0x510e18){_0x510e18=_0x510e18||0xcc;return function(_0x11a9e4){if(_0x11a9e4){return _0x563a5f['sendStatus'](_0x510e18);}return _0x563a5f[_0xc04c('0x1a')](_0x510e18)[_0xc04c('0x1b')]();};}function respondWithResult(_0x27a3f8,_0x23e500){_0x23e500=_0x23e500||0xc8;return function(_0x4f318d){if(_0x4f318d){return _0x27a3f8[_0xc04c('0x1a')](_0x23e500)[_0xc04c('0x1c')](_0x4f318d);}};}function respondWithFilteredResult(_0x1df6d9,_0x247582){return function(_0x4c1154){if(_0x4c1154){var _0x4e1aea=typeof _0x247582['offset']===_0xc04c('0x1d')&&typeof _0x247582[_0xc04c('0x1e')]==='undefined';var _0x82afdd=_0x4c1154['count'];var _0x170f47=_0x4e1aea?0x0:_0x247582[_0xc04c('0x1f')];var _0x59d405=_0x4e1aea?_0x4c1154[_0xc04c('0x20')]:_0x247582[_0xc04c('0x1f')]+_0x247582[_0xc04c('0x1e')];var _0x1ad3e6;if(_0x59d405>=_0x82afdd){_0x59d405=_0x82afdd;_0x1ad3e6=0xc8;}else{_0x1ad3e6=0xce;}_0x1df6d9[_0xc04c('0x1a')](_0x1ad3e6);return _0x1df6d9[_0xc04c('0x21')](_0xc04c('0x22'),_0x170f47+'-'+_0x59d405+'/'+_0x82afdd)[_0xc04c('0x1c')](_0x4c1154);}return null;};}function patchUpdates(_0x9b1151){return function(_0x4050ae){try{jsonpatch[_0xc04c('0x23')](_0x4050ae,_0x9b1151,!![]);}catch(_0x5d7c0e){return BPromise[_0xc04c('0x24')](_0x5d7c0e);}return _0x4050ae[_0xc04c('0x25')]();};}function saveUpdates(_0x1a3927,_0x1fa984){return function(_0x2422af){if(_0x2422af){return _0x2422af[_0xc04c('0x26')](_0x1a3927)[_0xc04c('0x27')](function(_0x244e80){return _0x244e80;});}return null;};}function removeEntity(_0x204d03,_0x17bc59){return function(_0x47dddc){if(_0x47dddc){return _0x47dddc[_0xc04c('0x28')]()['then'](function(){_0x204d03[_0xc04c('0x1a')](0xcc)[_0xc04c('0x1b')]();});}};}function handleEntityNotFound(_0x446722,_0x40f467){return function(_0x3b2337){if(!_0x3b2337){_0x446722['sendStatus'](0x194);}return _0x3b2337;};}function handleError(_0x175049,_0x158f28){_0x158f28=_0x158f28||0x1f4;return function(_0xae56c9){logger[_0xc04c('0x29')](_0xae56c9[_0xc04c('0x2a')]);if(_0xae56c9['name']){delete _0xae56c9[_0xc04c('0x2b')];}_0x175049[_0xc04c('0x1a')](_0x158f28)[_0xc04c('0x2c')](_0xae56c9);};}exports['index']=function(_0x1c3f29,_0x5f0706){var _0x4082da={},_0x14ba62={},_0x1bc9ab={'count':0x0,'rows':[]};var _0x596b9b=_[_0xc04c('0x2d')](db['DeskField'][_0xc04c('0x2e')],function(_0xc356a2){return{'name':_0xc356a2[_0xc04c('0x2f')],'type':_0xc356a2[_0xc04c('0x30')][_0xc04c('0x31')]};});_0x14ba62['model']=_[_0xc04c('0x2d')](_0x596b9b,'name');_0x14ba62[_0xc04c('0x32')]=_['keys'](_0x1c3f29['query']);_0x14ba62['filters']=_[_0xc04c('0x33')](_0x14ba62[_0xc04c('0x34')],_0x14ba62['query']);_0x4082da['attributes']=_[_0xc04c('0x33')](_0x14ba62[_0xc04c('0x34')],qs[_0xc04c('0x35')](_0x1c3f29[_0xc04c('0x32')]['fields']));_0x4082da[_0xc04c('0x36')]=_0x4082da[_0xc04c('0x36')][_0xc04c('0x37')]?_0x4082da[_0xc04c('0x36')]:_0x14ba62[_0xc04c('0x34')];if(!_0x1c3f29[_0xc04c('0x32')][_0xc04c('0x38')](_0xc04c('0x39'))){_0x4082da[_0xc04c('0x1e')]=qs['limit'](_0x1c3f29[_0xc04c('0x32')][_0xc04c('0x1e')]);_0x4082da[_0xc04c('0x1f')]=qs[_0xc04c('0x1f')](_0x1c3f29[_0xc04c('0x32')][_0xc04c('0x1f')]);}_0x4082da['order']=qs[_0xc04c('0x3a')](_0x1c3f29['query']['sort']);_0x4082da['where']=qs[_0xc04c('0x3b')](_[_0xc04c('0x3c')](_0x1c3f29[_0xc04c('0x32')],_0x14ba62[_0xc04c('0x3b')]),_0x596b9b);if(_0x1c3f29[_0xc04c('0x32')][_0xc04c('0x3d')]){_0x4082da[_0xc04c('0x3e')]=_[_0xc04c('0x3f')](_0x4082da['where'],{'$or':_[_0xc04c('0x2d')](_0x596b9b,function(_0x2ecddd){if(_0x2ecddd['type']!==_0xc04c('0x40')){var _0x2ff7b4={};_0x2ff7b4[_0x2ecddd[_0xc04c('0x2b')]]={'$like':'%'+_0x1c3f29[_0xc04c('0x32')][_0xc04c('0x3d')]+'%'};return _0x2ff7b4;}})});}_0x4082da=_[_0xc04c('0x3f')]({},_0x4082da,_0x1c3f29[_0xc04c('0x41')]);var _0xb4968={'where':_0x4082da['where']};return db[_0xc04c('0x42')]['count'](_0xb4968)[_0xc04c('0x27')](function(_0x1cd5df){_0x1bc9ab[_0xc04c('0x20')]=_0x1cd5df;if(_0x1c3f29[_0xc04c('0x32')][_0xc04c('0x43')]){_0x4082da[_0xc04c('0x44')]=[{'all':!![]}];}return db[_0xc04c('0x42')]['findAll'](_0x4082da);})[_0xc04c('0x27')](function(_0xf6d3ce){_0x1bc9ab[_0xc04c('0x45')]=_0xf6d3ce;return _0x1bc9ab;})[_0xc04c('0x27')](respondWithFilteredResult(_0x5f0706,_0x4082da))[_0xc04c('0x46')](handleError(_0x5f0706,null));};exports[_0xc04c('0x47')]=function(_0x29dd7d,_0x287bbb){var _0x3320be={'raw':!![],'where':{'id':_0x29dd7d[_0xc04c('0x48')]['id']}},_0x4ba324={};_0x4ba324[_0xc04c('0x34')]=_['keys'](db[_0xc04c('0x42')][_0xc04c('0x2e')]);_0x4ba324[_0xc04c('0x32')]=_[_0xc04c('0x49')](_0x29dd7d[_0xc04c('0x32')]);_0x4ba324[_0xc04c('0x3b')]=_[_0xc04c('0x33')](_0x4ba324['model'],_0x4ba324[_0xc04c('0x32')]);_0x3320be[_0xc04c('0x36')]=_['intersection'](_0x4ba324[_0xc04c('0x34')],qs[_0xc04c('0x35')](_0x29dd7d[_0xc04c('0x32')][_0xc04c('0x35')]));_0x3320be['attributes']=_0x3320be['attributes']['length']?_0x3320be['attributes']:_0x4ba324['model'];if(_0x29dd7d[_0xc04c('0x32')][_0xc04c('0x43')]){_0x3320be['include']=[{'all':!![]}];}_0x3320be=_[_0xc04c('0x3f')]({},_0x3320be,_0x29dd7d[_0xc04c('0x41')]);return db[_0xc04c('0x42')][_0xc04c('0x4a')](_0x3320be)[_0xc04c('0x27')](handleEntityNotFound(_0x287bbb,null))['then'](respondWithResult(_0x287bbb,null))['catch'](handleError(_0x287bbb,null));};exports[_0xc04c('0x4b')]=function(_0x196bf4,_0x360f04){return db[_0xc04c('0x42')][_0xc04c('0x4b')](_0x196bf4['body'],{})[_0xc04c('0x27')](respondWithResult(_0x360f04,0xc9))[_0xc04c('0x46')](handleError(_0x360f04,null));};exports[_0xc04c('0x26')]=function(_0x3a93bf,_0x1e2590){if(_0x3a93bf['body']['id']){delete _0x3a93bf[_0xc04c('0x4c')]['id'];}return db['DeskField']['find']({'where':{'id':_0x3a93bf[_0xc04c('0x48')]['id']}})['then'](handleEntityNotFound(_0x1e2590,null))[_0xc04c('0x27')](saveUpdates(_0x3a93bf['body'],null))[_0xc04c('0x27')](respondWithResult(_0x1e2590,null))[_0xc04c('0x46')](handleError(_0x1e2590,null));};exports['destroy']=function(_0x37f794,_0x4d6af4){return db[_0xc04c('0x42')][_0xc04c('0x4a')]({'where':{'id':_0x37f794[_0xc04c('0x48')]['id']}})[_0xc04c('0x27')](handleEntityNotFound(_0x4d6af4,null))[_0xc04c('0x27')](removeEntity(_0x4d6af4,null))[_0xc04c('0x46')](handleError(_0x4d6af4,null));}; \ No newline at end of file +var _0xf130=['name','index','DeskField','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','stack'];(function(_0x2a6b84,_0xadf951){var _0x9ce60=function(_0x5c31f9){while(--_0x5c31f9){_0x2a6b84['push'](_0x2a6b84['shift']());}};_0x9ce60(++_0xadf951);}(_0xf130,0x149));var _0x0f13=function(_0x3cd330,_0x5ca015){_0x3cd330=_0x3cd330-0x0;var _0x6ec1b3=_0xf130[_0x3cd330];return _0x6ec1b3;};'use strict';var emlformat=require(_0x0f13('0x0'));var rimraf=require(_0x0f13('0x1'));var zipdir=require(_0x0f13('0x2'));var jsonpatch=require(_0x0f13('0x3'));var rp=require(_0x0f13('0x4'));var moment=require(_0x0f13('0x5'));var BPromise=require(_0x0f13('0x6'));var Mustache=require(_0x0f13('0x7'));var util=require('util');var path=require(_0x0f13('0x8'));var sox=require(_0x0f13('0x9'));var csv=require(_0x0f13('0xa'));var ejs=require(_0x0f13('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f13('0xc'));var squel=require(_0x0f13('0xd'));var crypto=require(_0x0f13('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0f13('0xf'));var toCsv=require(_0x0f13('0xa'));var querystring=require(_0x0f13('0x10'));var Papa=require(_0x0f13('0x11'));var Redis=require(_0x0f13('0x12'));var authService=require(_0x0f13('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f13('0x14'));var logger=require('../../config/logger')(_0x0f13('0x15'));var utils=require(_0x0f13('0x16'));var config=require(_0x0f13('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0f13('0x18'))['db'];function respondWithStatusCode(_0x216bb7,_0x3e7de8){_0x3e7de8=_0x3e7de8||0xcc;return function(_0x2ad79e){if(_0x2ad79e){return _0x216bb7[_0x0f13('0x19')](_0x3e7de8);}return _0x216bb7[_0x0f13('0x1a')](_0x3e7de8)['end']();};}function respondWithResult(_0x273e5f,_0x404631){_0x404631=_0x404631||0xc8;return function(_0x50f626){if(_0x50f626){return _0x273e5f[_0x0f13('0x1a')](_0x404631)[_0x0f13('0x1b')](_0x50f626);}};}function respondWithFilteredResult(_0x36c09e,_0xe171cd){return function(_0x187568){if(_0x187568){var _0x308893=typeof _0xe171cd[_0x0f13('0x1c')]===_0x0f13('0x1d')&&typeof _0xe171cd['limit']===_0x0f13('0x1d');var _0x2b4f43=_0x187568['count'];var _0x467e84=_0x308893?0x0:_0xe171cd['offset'];var _0xb8cb0f=_0x308893?_0x187568[_0x0f13('0x1e')]:_0xe171cd[_0x0f13('0x1c')]+_0xe171cd[_0x0f13('0x1f')];var _0x4c544e;if(_0xb8cb0f>=_0x2b4f43){_0xb8cb0f=_0x2b4f43;_0x4c544e=0xc8;}else{_0x4c544e=0xce;}_0x36c09e['status'](_0x4c544e);return _0x36c09e[_0x0f13('0x20')](_0x0f13('0x21'),_0x467e84+'-'+_0xb8cb0f+'/'+_0x2b4f43)[_0x0f13('0x1b')](_0x187568);}return null;};}function patchUpdates(_0x1ad99a){return function(_0x446ad4){try{jsonpatch[_0x0f13('0x22')](_0x446ad4,_0x1ad99a,!![]);}catch(_0x14f657){return BPromise[_0x0f13('0x23')](_0x14f657);}return _0x446ad4[_0x0f13('0x24')]();};}function saveUpdates(_0x728b17,_0x5994d0){return function(_0x58dc78){if(_0x58dc78){return _0x58dc78[_0x0f13('0x25')](_0x728b17)[_0x0f13('0x26')](function(_0x860f0c){return _0x860f0c;});}return null;};}function removeEntity(_0x2e71b4,_0x36b170){return function(_0x393f0e){if(_0x393f0e){return _0x393f0e['destroy']()[_0x0f13('0x26')](function(){_0x2e71b4[_0x0f13('0x1a')](0xcc)[_0x0f13('0x27')]();});}};}function handleEntityNotFound(_0x68dffc,_0x5a6aba){return function(_0x1e71b3){if(!_0x1e71b3){_0x68dffc['sendStatus'](0x194);}return _0x1e71b3;};}function handleError(_0x1509d5,_0x4426fa){_0x4426fa=_0x4426fa||0x1f4;return function(_0x1f5c7e){logger['error'](_0x1f5c7e[_0x0f13('0x28')]);if(_0x1f5c7e[_0x0f13('0x29')]){delete _0x1f5c7e[_0x0f13('0x29')];}_0x1509d5[_0x0f13('0x1a')](_0x4426fa)['send'](_0x1f5c7e);};}exports[_0x0f13('0x2a')]=function(_0x57195c,_0x57b9ed){var _0x513eed={},_0x3dfe41={},_0x155a00={'count':0x0,'rows':[]};var _0x2592b0=_['map'](db[_0x0f13('0x2b')][_0x0f13('0x2c')],function(_0x51a83d){return{'name':_0x51a83d['fieldName'],'type':_0x51a83d[_0x0f13('0x2d')][_0x0f13('0x2e')]};});_0x3dfe41['model']=_['map'](_0x2592b0,_0x0f13('0x29'));_0x3dfe41[_0x0f13('0x2f')]=_[_0x0f13('0x30')](_0x57195c[_0x0f13('0x2f')]);_0x3dfe41['filters']=_[_0x0f13('0x31')](_0x3dfe41[_0x0f13('0x32')],_0x3dfe41['query']);_0x513eed[_0x0f13('0x33')]=_[_0x0f13('0x31')](_0x3dfe41[_0x0f13('0x32')],qs[_0x0f13('0x34')](_0x57195c[_0x0f13('0x2f')]['fields']));_0x513eed['attributes']=_0x513eed['attributes'][_0x0f13('0x35')]?_0x513eed['attributes']:_0x3dfe41[_0x0f13('0x32')];if(!_0x57195c[_0x0f13('0x2f')][_0x0f13('0x36')](_0x0f13('0x37'))){_0x513eed['limit']=qs[_0x0f13('0x1f')](_0x57195c[_0x0f13('0x2f')][_0x0f13('0x1f')]);_0x513eed['offset']=qs[_0x0f13('0x1c')](_0x57195c[_0x0f13('0x2f')][_0x0f13('0x1c')]);}_0x513eed[_0x0f13('0x38')]=qs[_0x0f13('0x39')](_0x57195c['query'][_0x0f13('0x39')]);_0x513eed[_0x0f13('0x3a')]=qs['filters'](_['pick'](_0x57195c[_0x0f13('0x2f')],_0x3dfe41[_0x0f13('0x3b')]),_0x2592b0);if(_0x57195c[_0x0f13('0x2f')][_0x0f13('0x3c')]){_0x513eed['where']=_[_0x0f13('0x3d')](_0x513eed['where'],{'$or':_[_0x0f13('0x3e')](_0x2592b0,function(_0x7e19bd){if(_0x7e19bd[_0x0f13('0x2d')]!==_0x0f13('0x3f')){var _0x3eb593={};_0x3eb593[_0x7e19bd[_0x0f13('0x29')]]={'$like':'%'+_0x57195c[_0x0f13('0x2f')]['filter']+'%'};return _0x3eb593;}})});}_0x513eed=_['merge']({},_0x513eed,_0x57195c[_0x0f13('0x40')]);var _0x54b225={'where':_0x513eed[_0x0f13('0x3a')]};return db['DeskField'][_0x0f13('0x1e')](_0x54b225)[_0x0f13('0x26')](function(_0x1f7b0d){_0x155a00[_0x0f13('0x1e')]=_0x1f7b0d;if(_0x57195c['query'][_0x0f13('0x41')]){_0x513eed[_0x0f13('0x42')]=[{'all':!![]}];}return db['DeskField'][_0x0f13('0x43')](_0x513eed);})[_0x0f13('0x26')](function(_0x5d41d6){_0x155a00['rows']=_0x5d41d6;return _0x155a00;})[_0x0f13('0x26')](respondWithFilteredResult(_0x57b9ed,_0x513eed))[_0x0f13('0x44')](handleError(_0x57b9ed,null));};exports[_0x0f13('0x45')]=function(_0x33edc6,_0x31b5ec){var _0x4a9ecf={'raw':!![],'where':{'id':_0x33edc6[_0x0f13('0x46')]['id']}},_0x2d33da={};_0x2d33da['model']=_[_0x0f13('0x30')](db[_0x0f13('0x2b')][_0x0f13('0x2c')]);_0x2d33da[_0x0f13('0x2f')]=_[_0x0f13('0x30')](_0x33edc6['query']);_0x2d33da[_0x0f13('0x3b')]=_[_0x0f13('0x31')](_0x2d33da[_0x0f13('0x32')],_0x2d33da[_0x0f13('0x2f')]);_0x4a9ecf[_0x0f13('0x33')]=_[_0x0f13('0x31')](_0x2d33da[_0x0f13('0x32')],qs[_0x0f13('0x34')](_0x33edc6[_0x0f13('0x2f')][_0x0f13('0x34')]));_0x4a9ecf[_0x0f13('0x33')]=_0x4a9ecf['attributes'][_0x0f13('0x35')]?_0x4a9ecf[_0x0f13('0x33')]:_0x2d33da[_0x0f13('0x32')];if(_0x33edc6[_0x0f13('0x2f')]['includeAll']){_0x4a9ecf[_0x0f13('0x42')]=[{'all':!![]}];}_0x4a9ecf=_[_0x0f13('0x3d')]({},_0x4a9ecf,_0x33edc6[_0x0f13('0x40')]);return db[_0x0f13('0x2b')]['find'](_0x4a9ecf)[_0x0f13('0x26')](handleEntityNotFound(_0x31b5ec,null))[_0x0f13('0x26')](respondWithResult(_0x31b5ec,null))[_0x0f13('0x44')](handleError(_0x31b5ec,null));};exports[_0x0f13('0x47')]=function(_0x54ac44,_0x3d2199){return db[_0x0f13('0x2b')]['create'](_0x54ac44['body'],{})[_0x0f13('0x26')](respondWithResult(_0x3d2199,0xc9))[_0x0f13('0x44')](handleError(_0x3d2199,null));};exports[_0x0f13('0x25')]=function(_0x1f896d,_0x317691){if(_0x1f896d[_0x0f13('0x48')]['id']){delete _0x1f896d[_0x0f13('0x48')]['id'];}return db['DeskField'][_0x0f13('0x49')]({'where':{'id':_0x1f896d[_0x0f13('0x46')]['id']}})[_0x0f13('0x26')](handleEntityNotFound(_0x317691,null))[_0x0f13('0x26')](saveUpdates(_0x1f896d[_0x0f13('0x48')],null))['then'](respondWithResult(_0x317691,null))[_0x0f13('0x44')](handleError(_0x317691,null));};exports['destroy']=function(_0x1b07c6,_0x13d020){return db[_0x0f13('0x2b')][_0x0f13('0x49')]({'where':{'id':_0x1b07c6[_0x0f13('0x46')]['id']}})[_0x0f13('0x26')](handleEntityNotFound(_0x13d020,null))[_0x0f13('0x26')](removeEntity(_0x13d020,null))['catch'](handleError(_0x13d020,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index ab83051..f3fbb2a 100644 --- a/server/api/intDeskField/intDeskField.model.js +++ b/server/api/intDeskField/intDeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98d4=['bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98d4,0x161));var _0x498d=function(_0x37b683,_0x41166c){_0x37b683=_0x37b683-0x0;var _0x5120f1=_0x98d4[_0x37b683];return _0x5120f1;};'use strict';var _=require(_0x498d('0x0'));var util=require(_0x498d('0x1'));var logger=require(_0x498d('0x2'))('api');var moment=require(_0x498d('0x3'));var BPromise=require(_0x498d('0x4'));var rp=require(_0x498d('0x5'));var fs=require('fs');var path=require(_0x498d('0x6'));var rimraf=require(_0x498d('0x7'));var config=require(_0x498d('0x8'));var attributes=require(_0x498d('0x9'));module[_0x498d('0xa')]=function(_0x4d017b,_0x5a05e9){return _0x4d017b[_0x498d('0xb')](_0x498d('0xc'),attributes,{'tableName':_0x498d('0xd'),'paranoid':![],'indexes':[{'name':_0x498d('0xe'),'fields':[_0x498d('0xf'),_0x498d('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2932=['path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','FieldId','util','api','moment','bluebird','request-promise'];(function(_0x3ecb2d,_0x55b849){var _0x33efe2=function(_0x22d4d6){while(--_0x22d4d6){_0x3ecb2d['push'](_0x3ecb2d['shift']());}};_0x33efe2(++_0x55b849);}(_0x2932,0x19f));var _0x2293=function(_0x8d8917,_0x504e20){_0x8d8917=_0x8d8917-0x0;var _0x55bd93=_0x2932[_0x8d8917];return _0x55bd93;};'use strict';var _=require('lodash');var util=require(_0x2293('0x0'));var logger=require('../../config/logger')(_0x2293('0x1'));var moment=require(_0x2293('0x2'));var BPromise=require(_0x2293('0x3'));var rp=require(_0x2293('0x4'));var fs=require('fs');var path=require(_0x2293('0x5'));var rimraf=require(_0x2293('0x6'));var config=require(_0x2293('0x7'));var attributes=require(_0x2293('0x8'));module[_0x2293('0x9')]=function(_0x375e74,_0x547c5a){return _0x375e74[_0x2293('0xa')](_0x2293('0xb'),attributes,{'tableName':_0x2293('0xc'),'paranoid':![],'indexes':[{'name':_0x2293('0xd'),'fields':['idField',_0x2293('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index c55bc65..5a1e3b6 100644 --- a/server/api/intDeskField/intDeskField.rpc.js +++ b/server/api/intDeskField/intDeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9de5=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','DeskField,\x20%s,\x20%s','message','result','catch','util'];(function(_0x33129e,_0x18005c){var _0x393d72=function(_0x13810c){while(--_0x13810c){_0x33129e['push'](_0x33129e['shift']());}};_0x393d72(++_0x18005c);}(_0x9de5,0xc7));var _0x59de=function(_0x1cb1a6,_0x5560e1){_0x1cb1a6=_0x1cb1a6-0x0;var _0x57d65a=_0x9de5[_0x1cb1a6];return _0x57d65a;};'use strict';var _=require('lodash');var util=require(_0x59de('0x0'));var moment=require('moment');var BPromise=require(_0x59de('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x59de('0x2'));var db=require(_0x59de('0x3'))['db'];var utils=require(_0x59de('0x4'));var logger=require(_0x59de('0x5'))(_0x59de('0x6'));var config=require(_0x59de('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x59de('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b2aef,_0x43180d,_0x2ae44d){return new BPromise(function(_0x246de8,_0x4c5edb){return client[_0x59de('0x9')](_0x5b2aef,_0x2ae44d)[_0x59de('0xa')](function(_0x4c8b7e){logger[_0x59de('0xb')]('DeskField,\x20%s,\x20%s',_0x43180d,_0x59de('0xc'));logger[_0x59de('0xd')]('DeskField,\x20%s,\x20%s,\x20%s',_0x43180d,_0x59de('0xc'),JSON[_0x59de('0xe')](_0x4c8b7e));if(_0x4c8b7e[_0x59de('0xf')]){if(_0x4c8b7e[_0x59de('0xf')]['code']===0x1f4){logger[_0x59de('0xf')](_0x59de('0x10'),_0x43180d,_0x4c8b7e[_0x59de('0xf')][_0x59de('0x11')]);return _0x4c5edb(_0x4c8b7e['error'][_0x59de('0x11')]);}logger[_0x59de('0xf')](_0x59de('0x10'),_0x43180d,_0x4c8b7e[_0x59de('0xf')][_0x59de('0x11')]);return _0x246de8(_0x4c8b7e['error']['message']);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x43180d,_0x59de('0xc'));_0x246de8(_0x4c8b7e[_0x59de('0x12')][_0x59de('0x11')]);}})[_0x59de('0x13')](function(_0xcc5b8b){logger['error']('DeskField,\x20%s,\x20%s',_0x43180d,_0xcc5b8b);_0x4c5edb(_0xcc5b8b);});});} \ No newline at end of file +var _0xfcf8=['debug','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','DeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x23c445,_0x38a426){var _0x1eb9cd=function(_0x11f80a){while(--_0x11f80a){_0x23c445['push'](_0x23c445['shift']());}};_0x1eb9cd(++_0x38a426);}(_0xfcf8,0x1aa));var _0x8fcf=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xfcf8[_0x2064e5];return _0x21a233;};'use strict';var _=require('lodash');var util=require(_0x8fcf('0x0'));var moment=require(_0x8fcf('0x1'));var BPromise=require(_0x8fcf('0x2'));var rs=require(_0x8fcf('0x3'));var fs=require('fs');var Redis=require(_0x8fcf('0x4'));var db=require(_0x8fcf('0x5'))['db'];var utils=require(_0x8fcf('0x6'));var logger=require(_0x8fcf('0x7'))(_0x8fcf('0x8'));var config=require(_0x8fcf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8fcf('0xa')][_0x8fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c384e,_0x30634e,_0x4bf8ff){return new BPromise(function(_0x3ebc9c,_0x27a798){return client['request'](_0x5c384e,_0x4bf8ff)['then'](function(_0x37afc3){logger['info'](_0x8fcf('0xc'),_0x30634e,_0x8fcf('0xd'));logger[_0x8fcf('0xe')]('DeskField,\x20%s,\x20%s,\x20%s',_0x30634e,'request\x20sent',JSON[_0x8fcf('0xf')](_0x37afc3));if(_0x37afc3[_0x8fcf('0x10')]){if(_0x37afc3['error'][_0x8fcf('0x11')]===0x1f4){logger['error'](_0x8fcf('0xc'),_0x30634e,_0x37afc3['error'][_0x8fcf('0x12')]);return _0x27a798(_0x37afc3[_0x8fcf('0x10')][_0x8fcf('0x12')]);}logger[_0x8fcf('0x10')](_0x8fcf('0xc'),_0x30634e,_0x37afc3[_0x8fcf('0x10')]['message']);return _0x3ebc9c(_0x37afc3['error']['message']);}else{logger[_0x8fcf('0x13')](_0x8fcf('0xc'),_0x30634e,_0x8fcf('0xd'));_0x3ebc9c(_0x37afc3[_0x8fcf('0x14')][_0x8fcf('0x12')]);}})[_0x8fcf('0x15')](function(_0x4421bd){logger[_0x8fcf('0x10')](_0x8fcf('0xc'),_0x30634e,_0x4421bd);_0x27a798(_0x4421bd);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 6f19a77..fcc2f5c 100644 --- a/server/api/intDynamics365Account/index.js +++ b/server/api/intDynamics365Account/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a16=['../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5d1ca6,_0x1283d8){var _0x5944ef=function(_0x8192f8){while(--_0x8192f8){_0x5d1ca6['push'](_0x5d1ca6['shift']());}};_0x5944ef(++_0x1283d8);}(_0x7a16,0x10d));var _0x67a1=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7a16[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0x67a1('0x0'));var path=require(_0x67a1('0x1'));var timeout=require(_0x67a1('0x2'));var express=require(_0x67a1('0x3'));var router=express[_0x67a1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x67a1('0x5'));var interaction=require(_0x67a1('0x6'));var config=require(_0x67a1('0x7'));var controller=require(_0x67a1('0x8'));router['get']('/',auth[_0x67a1('0x9')](),controller[_0x67a1('0xa')]);router[_0x67a1('0xb')](_0x67a1('0xc'),auth[_0x67a1('0x9')](),controller[_0x67a1('0xd')]);router['get']('/:id/configurations',auth[_0x67a1('0x9')](),controller[_0x67a1('0xe')]);router['get'](_0x67a1('0xf'),auth[_0x67a1('0x9')](),controller[_0x67a1('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x67a1('0x11')](_0x67a1('0x12'),auth[_0x67a1('0x9')](),controller[_0x67a1('0x13')]);router[_0x67a1('0x14')](_0x67a1('0xc'),auth['isAuthenticated'](),controller[_0x67a1('0x15')]);router[_0x67a1('0x16')](_0x67a1('0xc'),auth[_0x67a1('0x9')](),controller[_0x67a1('0x17')]);module[_0x67a1('0x18')]=router; \ No newline at end of file +var _0x3aee=['/:id','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete'];(function(_0x335d89,_0x15c1ad){var _0x93074e=function(_0x2594db){while(--_0x2594db){_0x335d89['push'](_0x335d89['shift']());}};_0x93074e(++_0x15c1ad);}(_0x3aee,0xab));var _0xe3ae=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0x3aee[_0x79b649];return _0x1af9b1;};'use strict';var multer=require(_0xe3ae('0x0'));var util=require('util');var path=require(_0xe3ae('0x1'));var timeout=require(_0xe3ae('0x2'));var express=require('express');var router=express[_0xe3ae('0x3')]();var fs_extra=require(_0xe3ae('0x4'));var auth=require(_0xe3ae('0x5'));var interaction=require(_0xe3ae('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0xe3ae('0x7')]('/',auth[_0xe3ae('0x8')](),controller[_0xe3ae('0x9')]);router[_0xe3ae('0x7')]('/:id',auth[_0xe3ae('0x8')](),controller[_0xe3ae('0xa')]);router[_0xe3ae('0x7')](_0xe3ae('0xb'),auth[_0xe3ae('0x8')](),controller[_0xe3ae('0xc')]);router[_0xe3ae('0x7')](_0xe3ae('0xd'),auth[_0xe3ae('0x8')](),controller[_0xe3ae('0xe')]);router['post']('/',auth[_0xe3ae('0x8')](),controller[_0xe3ae('0xf')]);router[_0xe3ae('0x10')](_0xe3ae('0xb'),auth[_0xe3ae('0x8')](),controller[_0xe3ae('0x11')]);router[_0xe3ae('0x12')]('/:id',auth[_0xe3ae('0x8')](),controller[_0xe3ae('0x13')]);router[_0xe3ae('0x14')](_0xe3ae('0x15'),auth[_0xe3ae('0x8')](),controller[_0xe3ae('0x16')]);module[_0xe3ae('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 60866ea..06ecf7c 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.attributes.js +++ b/server/api/intDynamics365Account/intDynamics365Account.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0dd6=['STRING'];(function(_0x4996d5,_0x123daf){var _0x4793f9=function(_0x30c7ec){while(--_0x30c7ec){_0x4996d5['push'](_0x4996d5['shift']());}};_0x4793f9(++_0x123daf);}(_0x0dd6,0xca));var _0x60dd=function(_0x11b3cb,_0x44b528){_0x11b3cb=_0x11b3cb-0x0;var _0x45d5cf=_0x0dd6[_0x11b3cb];return _0x45d5cf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x60dd('0x0')]},'username':{'type':Sequelize[_0x60dd('0x0')]},'password':{'type':Sequelize[_0x60dd('0x0')]},'remoteUri':{'type':Sequelize[_0x60dd('0x0')]},'tenantId':{'type':Sequelize[_0x60dd('0x0')]},'clientId':{'type':Sequelize[_0x60dd('0x0')]},'clientSecret':{'type':Sequelize[_0x60dd('0x0')]},'serverUrl':{'type':Sequelize[_0x60dd('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x60dd('0x0')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x7958=['sequelize','exports','STRING'];(function(_0x39dbe3,_0x1620f0){var _0x1448f1=function(_0x20bb2f){while(--_0x20bb2f){_0x39dbe3['push'](_0x39dbe3['shift']());}};_0x1448f1(++_0x1620f0);}(_0x7958,0x126));var _0x8795=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7958[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x8795('0x0'));module[_0x8795('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8795('0x2')]},'password':{'type':Sequelize[_0x8795('0x2')]},'remoteUri':{'type':Sequelize[_0x8795('0x2')]},'tenantId':{'type':Sequelize[_0x8795('0x2')]},'clientId':{'type':Sequelize[_0x8795('0x2')]},'clientSecret':{'type':Sequelize[_0x8795('0x2')]},'serverUrl':{'type':Sequelize[_0x8795('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8795('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index eba2123..38a3a0d 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.controller.js +++ b/server/api/intDynamics365Account/intDynamics365Account.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6561=['sort','getConfigurations','addConfiguration','Subjects','channel','getDescriptions','Descriptions','slice','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','Incident','PhoneCall','ownerid','caseorigincode','subject','phonenumber','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridtype','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','socialprofileidname','statecode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientId','modernAuthentication','CloudProvider','data7','access_token','data5','POST','https://login.microsoftonline.com/','/oauth2/token','password','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','remove','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','push','MetadataId','all','BooleanAttributeMetadata','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','error','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','UserLocalizedLabel','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','stack','name','send','index','map','Dynamics365Account','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','includeAll','include','findAll','show','params','options','find','create','body','catch','findOne','Dynamics365Configuration'];(function(_0x3443fd,_0x55531d){var _0x4e075b=function(_0x44ecff){while(--_0x44ecff){_0x3443fd['push'](_0x3443fd['shift']());}};_0x4e075b(++_0x55531d);}(_0x6561,0x1e8));var _0x1656=function(_0x44a9c8,_0x19facb){_0x44a9c8=_0x44a9c8-0x0;var _0x3a3d70=_0x6561[_0x44a9c8];return _0x3a3d70;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x1656('0x0'));var qs=require(_0x1656('0x1'));var logger=require(_0x1656('0x2'))('api');var db=require(_0x1656('0x3'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x3ce717,_0x54c803){_0x54c803=_0x54c803||0xc8;return function(_0x2ce43d){if(_0x2ce43d){return _0x3ce717[_0x1656('0x4')](_0x54c803)[_0x1656('0x5')](_0x2ce43d);}};}function respondWithFilteredResult(_0x45197e,_0x2739c7){return function(_0x371c3f){if(_0x371c3f){var _0x10fa7c=typeof _0x2739c7[_0x1656('0x6')]===_0x1656('0x7')&&typeof _0x2739c7[_0x1656('0x8')]===_0x1656('0x7');var _0x1d6a2d=_0x371c3f[_0x1656('0x9')];var _0x51c710=_0x10fa7c?0x0:_0x2739c7[_0x1656('0x6')];var _0x1d3458=_0x10fa7c?_0x371c3f['count']:_0x2739c7[_0x1656('0x6')]+_0x2739c7[_0x1656('0x8')];var _0x76b08d;if(_0x1d3458>=_0x1d6a2d){_0x1d3458=_0x1d6a2d;_0x76b08d=0xc8;}else{_0x76b08d=0xce;}_0x45197e['status'](_0x76b08d);return _0x45197e[_0x1656('0xa')](_0x1656('0xb'),_0x51c710+'-'+_0x1d3458+'/'+_0x1d6a2d)[_0x1656('0x5')](_0x371c3f);}return null;};}function saveUpdates(_0x3d6c6f){return function(_0x3bc63b){if(_0x3bc63b){return _0x3bc63b[_0x1656('0xc')](_0x3d6c6f)[_0x1656('0xd')](function(_0x1c2a5d){return _0x1c2a5d;});}return null;};}function removeEntity(_0x3e7b9b){return function(_0x2bcbd9){if(_0x2bcbd9){return _0x2bcbd9[_0x1656('0xe')]()[_0x1656('0xd')](function(){_0x3e7b9b[_0x1656('0x4')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8292ff){return function(_0x1a30d4){if(!_0x1a30d4){_0x8292ff[_0x1656('0xf')](0x194);}return _0x1a30d4;};}function handleError(_0x682f2a,_0x521f06){_0x521f06=_0x521f06||0x1f4;return function(_0x4f9ff4){logger['error'](_0x4f9ff4[_0x1656('0x10')]);if(_0x4f9ff4[_0x1656('0x11')]){delete _0x4f9ff4[_0x1656('0x11')];}_0x682f2a[_0x1656('0x4')](_0x521f06)[_0x1656('0x12')](_0x4f9ff4);};}exports[_0x1656('0x13')]=function(_0x26268e,_0x829d4a){var _0x3269b7={},_0x277ac1={},_0x2a74f4={'count':0x0,'rows':[]};var _0x9e04a6=_[_0x1656('0x14')](db[_0x1656('0x15')][_0x1656('0x16')],function(_0x260fbb){return{'name':_0x260fbb['fieldName'],'type':_0x260fbb[_0x1656('0x17')][_0x1656('0x18')]};});_0x277ac1['model']=_[_0x1656('0x14')](_0x9e04a6,_0x1656('0x11'));_0x277ac1[_0x1656('0x19')]=_[_0x1656('0x1a')](_0x26268e['query']);_0x277ac1[_0x1656('0x1b')]=_[_0x1656('0x1c')](_0x277ac1[_0x1656('0x1d')],_0x277ac1[_0x1656('0x19')]);_0x3269b7[_0x1656('0x1e')]=_[_0x1656('0x1c')](_0x277ac1[_0x1656('0x1d')],qs[_0x1656('0x1f')](_0x26268e[_0x1656('0x19')]['fields']));_0x3269b7[_0x1656('0x1e')]=_0x3269b7[_0x1656('0x1e')][_0x1656('0x20')]?_0x3269b7[_0x1656('0x1e')]:_0x277ac1[_0x1656('0x1d')];if(!_0x26268e[_0x1656('0x19')][_0x1656('0x21')](_0x1656('0x22'))){_0x3269b7[_0x1656('0x8')]=qs['limit'](_0x26268e[_0x1656('0x19')][_0x1656('0x8')]);_0x3269b7[_0x1656('0x6')]=qs[_0x1656('0x6')](_0x26268e['query'][_0x1656('0x6')]);}_0x3269b7[_0x1656('0x23')]=qs['sort'](_0x26268e[_0x1656('0x19')]['sort']);_0x3269b7['where']=qs[_0x1656('0x1b')](_[_0x1656('0x24')](_0x26268e[_0x1656('0x19')],_0x277ac1[_0x1656('0x1b')]),_0x9e04a6);if(_0x26268e['query'][_0x1656('0x25')]){_0x3269b7[_0x1656('0x26')]=_[_0x1656('0x27')](_0x3269b7[_0x1656('0x26')],{'$or':_[_0x1656('0x14')](_0x9e04a6,function(_0xff7218){if(_0xff7218[_0x1656('0x17')]!=='VIRTUAL'){var _0x24b9d5={};_0x24b9d5[_0xff7218['name']]={'$like':'%'+_0x26268e[_0x1656('0x19')][_0x1656('0x25')]+'%'};return _0x24b9d5;}})});}_0x3269b7=_[_0x1656('0x27')]({},_0x3269b7,_0x26268e['options']);var _0x1bdd52={'where':_0x3269b7['where']};return db['Dynamics365Account'][_0x1656('0x9')](_0x1bdd52)[_0x1656('0xd')](function(_0xca629c){_0x2a74f4['count']=_0xca629c;if(_0x26268e['query'][_0x1656('0x28')]){_0x3269b7[_0x1656('0x29')]=[{'all':!![]}];}return db[_0x1656('0x15')][_0x1656('0x2a')](_0x3269b7);})[_0x1656('0xd')](function(_0x142884){_0x2a74f4['rows']=_0x142884;return _0x2a74f4;})['then'](respondWithFilteredResult(_0x829d4a,_0x3269b7))['catch'](handleError(_0x829d4a,null));};exports[_0x1656('0x2b')]=function(_0x3bc1e2,_0x1a74be){var _0x17850b={'raw':![],'where':{'id':_0x3bc1e2[_0x1656('0x2c')]['id']}},_0x40c32c={};_0x40c32c['model']=_[_0x1656('0x1a')](db[_0x1656('0x15')][_0x1656('0x16')]);_0x40c32c[_0x1656('0x19')]=_['keys'](_0x3bc1e2[_0x1656('0x19')]);_0x40c32c[_0x1656('0x1b')]=_[_0x1656('0x1c')](_0x40c32c[_0x1656('0x1d')],_0x40c32c[_0x1656('0x19')]);_0x17850b['attributes']=_[_0x1656('0x1c')](_0x40c32c['model'],qs[_0x1656('0x1f')](_0x3bc1e2[_0x1656('0x19')][_0x1656('0x1f')]));_0x17850b[_0x1656('0x1e')]=_0x17850b[_0x1656('0x1e')]['length']?_0x17850b['attributes']:_0x40c32c[_0x1656('0x1d')];if(_0x3bc1e2[_0x1656('0x19')][_0x1656('0x28')]){_0x17850b['include']=[{'all':!![]}];}_0x17850b=_[_0x1656('0x27')]({},_0x17850b,_0x3bc1e2[_0x1656('0x2d')]);return db[_0x1656('0x15')][_0x1656('0x2e')](_0x17850b)[_0x1656('0xd')](handleEntityNotFound(_0x1a74be,null))[_0x1656('0xd')](respondWithResult(_0x1a74be,null))['catch'](handleError(_0x1a74be,null));};exports[_0x1656('0x2f')]=function(_0x3a1fc2,_0x5db26c){return db[_0x1656('0x15')][_0x1656('0x2f')](_0x3a1fc2['body'],{})['then'](respondWithResult(_0x5db26c,0xc9))['catch'](handleError(_0x5db26c,null));};exports[_0x1656('0xc')]=function(_0x5e0109,_0x2979bc){if(_0x5e0109[_0x1656('0x30')]['id']){delete _0x5e0109['body']['id'];}return db[_0x1656('0x15')][_0x1656('0x2e')]({'where':{'id':_0x5e0109['params']['id']}})[_0x1656('0xd')](handleEntityNotFound(_0x2979bc,null))[_0x1656('0xd')](saveUpdates(_0x5e0109[_0x1656('0x30')],null))[_0x1656('0xd')](respondWithResult(_0x2979bc,null))[_0x1656('0x31')](handleError(_0x2979bc,null));};exports[_0x1656('0xe')]=function(_0x5d20db,_0x7b7994){return db[_0x1656('0x15')][_0x1656('0x2e')]({'where':{'id':_0x5d20db[_0x1656('0x2c')]['id']}})[_0x1656('0xd')](handleEntityNotFound(_0x7b7994,null))[_0x1656('0xd')](removeEntity(_0x7b7994,null))[_0x1656('0x31')](handleError(_0x7b7994,null));};exports['getConfigurations']=function(_0x178073,_0x43de8a){var _0x152656={};var _0x1fafad={};var _0xc5602c;var _0x367729;return db['Dynamics365Account'][_0x1656('0x32')]({'where':{'id':_0x178073['params']['id']}})[_0x1656('0xd')](handleEntityNotFound(_0x43de8a,null))[_0x1656('0xd')](function(_0x42e017){if(_0x42e017){_0xc5602c=_0x42e017;_0x1fafad[_0x1656('0x1d')]=_[_0x1656('0x1a')](db[_0x1656('0x33')][_0x1656('0x16')]);_0x1fafad[_0x1656('0x19')]=_['keys'](_0x178073[_0x1656('0x19')]);_0x1fafad['filters']=_['intersection'](_0x1fafad[_0x1656('0x1d')],_0x1fafad[_0x1656('0x19')]);_0x152656[_0x1656('0x1e')]=_[_0x1656('0x1c')](_0x1fafad['model'],qs[_0x1656('0x1f')](_0x178073[_0x1656('0x19')][_0x1656('0x1f')]));_0x152656[_0x1656('0x1e')]=_0x152656['attributes'][_0x1656('0x20')]?_0x152656[_0x1656('0x1e')]:_0x1fafad[_0x1656('0x1d')];_0x152656[_0x1656('0x23')]=qs[_0x1656('0x34')](_0x178073[_0x1656('0x19')][_0x1656('0x34')]);_0x152656[_0x1656('0x26')]=qs['filters'](_[_0x1656('0x24')](_0x178073[_0x1656('0x19')],_0x1fafad[_0x1656('0x1b')]));if(_0x178073[_0x1656('0x19')]['filter']){_0x152656[_0x1656('0x26')]=_['merge'](_0x152656[_0x1656('0x26')],{'$or':_[_0x1656('0x14')](_0x152656[_0x1656('0x1e')],function(_0x1500a4){var _0x345f42={};_0x345f42[_0x1500a4]={'$like':'%'+_0x178073['query'][_0x1656('0x25')]+'%'};return _0x345f42;})});}_0x152656=_[_0x1656('0x27')]({},_0x152656,_0x178073['options']);return _0xc5602c[_0x1656('0x35')](_0x152656);}})[_0x1656('0xd')](function(_0x2c7061){if(_0x2c7061){_0x367729=_0x2c7061[_0x1656('0x20')];if(!_0x178073[_0x1656('0x19')]['hasOwnProperty'](_0x1656('0x22'))){_0x152656[_0x1656('0x8')]=qs[_0x1656('0x8')](_0x178073['query'][_0x1656('0x8')]);_0x152656['offset']=qs[_0x1656('0x6')](_0x178073[_0x1656('0x19')][_0x1656('0x6')]);}return _0xc5602c['getConfigurations'](_0x152656);}})[_0x1656('0xd')](function(_0x247b67){if(_0x247b67){return _0x247b67?{'count':_0x367729,'rows':_0x247b67}:null;}})[_0x1656('0xd')](respondWithResult(_0x43de8a,null))[_0x1656('0x31')](handleError(_0x43de8a,null));};exports[_0x1656('0x36')]=function(_0x585a43,_0x468dbb){if(_0x585a43[_0x1656('0x30')]['id']){delete _0x585a43['body']['id'];}return db[_0x1656('0x15')][_0x1656('0x32')]({'where':{'id':_0x585a43[_0x1656('0x2c')]['id']}})[_0x1656('0xd')](handleEntityNotFound(_0x468dbb,null))['then'](function(_0x3cf20a){if(_0x3cf20a){_0x585a43['body']['AccountId']=_0x3cf20a['id'];_0x585a43[_0x1656('0x30')][_0x1656('0x37')]=integrations['getSubjects'](_0x585a43['body'][_0x1656('0x38')],_0x585a43[_0x1656('0x30')][_0x1656('0x17')]);_0x585a43['body']['Descriptions']=integrations[_0x1656('0x39')](_0x585a43[_0x1656('0x30')][_0x1656('0x38')],_0x585a43[_0x1656('0x30')][_0x1656('0x17')]);return db[_0x1656('0x33')][_0x1656('0x2f')](_0x585a43[_0x1656('0x30')],{'include':[{'model':db['Dynamics365Field'],'as':_0x1656('0x37')},{'model':db['Dynamics365Field'],'as':_0x1656('0x3a')}]});}return null;})[_0x1656('0xd')](respondWithResult(_0x468dbb,null))['catch'](handleError(_0x468dbb,null));};function sanitizeRemoteUri(_0x41c90f){var _0x9a02fb=_0x41c90f[_0x1656('0x3b')](-0x1);if(_0x9a02fb==='/')return _0x41c90f['substring'](0x0,_0x41c90f[_0x1656('0x3c')](_0x9a02fb));return _0x41c90f;}function getWebApiUrl(_0x50c734){return util[_0x1656('0x3d')](_0x1656('0x3e'),_0x50c734);}exports[_0x1656('0x3f')]=function(_0x372416,_0x4e8851){var _0x3bc5f9=_0x372416[_0x1656('0x19')][_0x1656('0x40')];var _0x279313=_0x3bc5f9==='incident'?_0x1656('0x41'):_0x1656('0x42');var _0xcc6ebc='';var _0x2a2efe='';var _0x3244f2='';var _0x58f5fa='';var _0x92c4c2='';var _0x5639d7='';var _0x43c71c='';var _0x5f1bc0='';var _0x4e9a10=['title','description','customerid',_0x1656('0x43'),_0x1656('0x44'),_0x1656('0x45'),_0x1656('0x46'),'regardingobjectid',_0x1656('0x47'),_0x1656('0x48')];var _0x338f1a=[_0x1656('0x49'),_0x1656('0x4a'),_0x1656('0x4b'),_0x1656('0x4c'),_0x1656('0x4d'),'contactidyominame','contractdetailidname',_0x1656('0x4e'),_0x1656('0x4f'),'createdbyexternalpartyyominame',_0x1656('0x50'),_0x1656('0x51'),_0x1656('0x52'),_0x1656('0x53'),'createdonbehalfbyyominame',_0x1656('0x54'),_0x1656('0x55'),_0x1656('0x56'),_0x1656('0x57'),_0x1656('0x58'),_0x1656('0x59'),'entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby',_0x1656('0x5a'),'influencescore',_0x1656('0x5b'),_0x1656('0x5c'),_0x1656('0x5d'),_0x1656('0x5e'),_0x1656('0x5f'),_0x1656('0x60'),_0x1656('0x61'),_0x1656('0x62'),_0x1656('0x63'),_0x1656('0x64'),_0x1656('0x65'),_0x1656('0x66'),_0x1656('0x67'),'onholdtime',_0x1656('0x68'),'owneridname',_0x1656('0x69'),'owneridyominame',_0x1656('0x6a'),'primarycontactidname',_0x1656('0x6b'),_0x1656('0x6c'),_0x1656('0x6d'),_0x1656('0x6e'),'resolveby',_0x1656('0x6f'),'responseby',_0x1656('0x70'),_0x1656('0x71'),_0x1656('0x72'),'slainvokedidname','slaname',_0x1656('0x73'),_0x1656('0x74'),'statuscode',_0x1656('0x75'),_0x1656('0x76'),'timezoneruleversionnumber',_0x1656('0x77'),_0x1656('0x78'),_0x1656('0x79'),_0x1656('0x7a')];var _0x3e1210=_0x4e9a10[_0x1656('0x7b')](_0x338f1a);return db[_0x1656('0x15')][_0x1656('0x32')]({'where':{'id':_0x372416[_0x1656('0x2c')]['id']},'attributes':['id',_0x1656('0x7c'),'password',_0x1656('0x7d'),_0x1656('0x7e'),_0x1656('0x7f'),'clientSecret',_0x1656('0x80')],'include':[{'model':db[_0x1656('0x81')],'as':_0x1656('0x81'),'attributes':['id','data5',_0x1656('0x82')]}]})[_0x1656('0xd')](handleEntityNotFound(_0x4e8851,null))[_0x1656('0xd')](function(_0x584ad4){if(_0x584ad4){if(_0x584ad4[_0x1656('0x80')]){_0x584ad4[_0x1656('0x83')]=_0x584ad4[_0x1656('0x81')][_0x1656('0x84')];_0x5f1bc0=sanitizeRemoteUri(_0x584ad4[_0x1656('0x81')]['data7']);_0x43c71c=getWebApiUrl(_0x5f1bc0);return _0x584ad4;}_0x5f1bc0=sanitizeRemoteUri(_0x584ad4[_0x1656('0x7d')]);_0x43c71c=getWebApiUrl(_0x5f1bc0);var _0x17e140={'method':_0x1656('0x85'),'uri':_0x1656('0x86')+_0x584ad4[_0x1656('0x7e')]+_0x1656('0x87'),'form':{'client_id':_0x584ad4[_0x1656('0x7f')],'resource':_0x5f1bc0,'username':_0x584ad4[_0x1656('0x7c')],'password':_0x584ad4[_0x1656('0x88')],'grant_type':_0x1656('0x88'),'client_secret':_0x584ad4[_0x1656('0x89')]},'json':!![]};return rp(_0x17e140);}})['then'](function(_0xe8c3c5){_0x5639d7=_0xe8c3c5[_0x1656('0x83')];var _0x356132={'method':_0x1656('0x8a'),'uri':encodeURI(_0x43c71c+_0x1656('0x8b')+_0x279313+'\x27'),'headers':{'Authorization':_0x1656('0x8c')+_0x5639d7,'If-None-Match':null,'OData-Version':_0x1656('0x8d')},'json':!![]};return rp(_0x356132);})[_0x1656('0xd')](function(_0x2da770){var _0x84a08e=_0x2da770[_0x1656('0x8e')][0x0];var _0x66d563=_0x84a08e['MetadataId'];var _0x4c489e={'method':_0x1656('0x8a'),'uri':_0x43c71c+'EntityDefinitions('+_0x66d563+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x1656('0x8c')+_0x5639d7,'If-None-Match':null,'OData-Version':_0x1656('0x8d')},'json':!![]};return rp(_0x4c489e);})[_0x1656('0xd')](function(_0x4bb867){_0xcc6ebc=_0x4bb867;_0x2a2efe=_0xcc6ebc['Attributes'];_0x2a2efe=_[_0x1656('0x8f')](_0x2a2efe,function(_0x2554cf){return!_0x3e1210['includes'](_0x2554cf[_0x1656('0x90')]);});var _0x2fa862=[];var _0x58bcad=[];_0x2a2efe[_0x1656('0x91')](function(_0x9b382e){if(_0x9b382e[_0x1656('0x92')]){var _0x273e7a=_0x9b382e['@odata.type'][_0x1656('0x93')](_0x9b382e[_0x1656('0x92')][_0x1656('0x3c')]('.')+0x1);if(_0x273e7a===_0x1656('0x94')){_0x2fa862[_0x1656('0x95')](getSelectList(_0x43c71c,_0x3bc5f9,_0x58bcad,_0xcc6ebc['MetadataId'],_0x9b382e[_0x1656('0x96')],_0x5639d7));}}});return Promise[_0x1656('0x97')](_0x2fa862);})['then'](function(_0x3e821b){_0x3244f2=_0x3e821b[0x0];var _0x43079=[];var _0x1f6fdb=[];_0x2a2efe[_0x1656('0x91')](function(_0x28d8c4){if(!_['isNil'](_0x28d8c4[_0x1656('0x92')])){var _0x1a56f5=_0x28d8c4['@odata.type'][_0x1656('0x93')](_0x28d8c4[_0x1656('0x92')][_0x1656('0x3c')]('.')+0x1);if(_0x1a56f5===_0x1656('0x98')){_0x43079['push'](getBooleanList(_0x43c71c,_0x3bc5f9,_0x1f6fdb,_0xcc6ebc[_0x1656('0x96')],_0x28d8c4[_0x1656('0x96')],_0x5639d7));}}});return Promise[_0x1656('0x97')](_0x43079);})[_0x1656('0xd')](function(_0x41f487){_0x58f5fa=_0x41f487[0x0];var _0x586614=[];var _0x5b65ea=[];_0x2a2efe['forEach'](function(_0xdc6cd4){if(_0xdc6cd4[_0x1656('0x92')]){var _0x33e932=_0xdc6cd4[_0x1656('0x92')]['substring'](_0xdc6cd4[_0x1656('0x92')][_0x1656('0x3c')]('.')+0x1);if(_0x33e932===_0x1656('0x99')||_0x33e932==='DoubleAttributeMetadata'||_0x33e932===_0x1656('0x9a')||_0x33e932===_0x1656('0x9b')||_0x33e932==='MemoAttributeMetadata'||_0x33e932===_0x1656('0x9c')||_0x33e932==='StatusAttributeMetadata'||_0x33e932===_0x1656('0x9d')||_0x33e932===_0x1656('0x9e')||_0x33e932===_0x1656('0x9f')){_0x586614[_0x1656('0x95')](getInputList(_0x43c71c,_0x3bc5f9,_0x33e932,_0x5b65ea,_0xcc6ebc[_0x1656('0x96')],_0xdc6cd4[_0x1656('0x96')],_0x5639d7));}}});return Promise[_0x1656('0x97')](_0x586614);})[_0x1656('0xd')](function(_0x151cd5){_0x92c4c2=_0x151cd5[0x0];var _0x454cb3=_0x3244f2[_0x1656('0x7b')](_0x58f5fa)[_0x1656('0x7b')](_0x92c4c2);var _0x3c316d={'count':_0x454cb3[_0x1656('0x20')],'rows':_0x454cb3};return _0x3c316d;})[_0x1656('0xd')](respondWithResult(_0x4e8851,null))[_0x1656('0x31')](function(_0x1ff1d0){var _0x3262f7=_0x372416[_0x1656('0x19')][_0x1656('0xa0')]?0x1f4:_0x1ff1d0[_0x1656('0xa1')]||0x1f4;logger[_0x1656('0xa2')](_0x1ff1d0['stack']);delete _0x1ff1d0['name'];if(_0x3262f7===0x191){_0x3262f7=0x190;}_0x4e8851[_0x1656('0x4')](_0x3262f7)[_0x1656('0x12')](_0x372416[_0x1656('0x19')][_0x1656('0xa0')]?{'message':_0x1656('0xa3'),'statusCode':_0x1ff1d0[_0x1656('0xa1')]}:_0x1ff1d0);});};function getSelectList(_0x39f3c9,_0x595fa2,_0x49a3b7,_0x2ee586,_0x410e5f,_0x25a972){var _0x55bb92={'method':'GET','uri':_0x39f3c9+_0x1656('0xa4')+_0x2ee586+_0x1656('0xa5')+_0x410e5f+_0x1656('0xa6')+_0x1656('0xa7'),'headers':{'Authorization':_0x1656('0x8c')+_0x25a972,'If-None-Match':null,'OData-Version':_0x1656('0x8d')},'json':!![]};return rp(_0x55bb92)[_0x1656('0xd')](function(_0x29809a){var _0x1abd13=[];var _0x35c1af=_0x29809a[_0x1656('0xa8')]['Options'];_0x35c1af[_0x1656('0x91')](function(_0x57d5c9){_0x1abd13[_0x1656('0x95')]({'name':_0x57d5c9['Label'][_0x1656('0xa9')][_0x1656('0xaa')],'value':String(_0x57d5c9[_0x1656('0xab')])});});var _0x555843={'id':_0x595fa2+'_'+_0x29809a['LogicalName'],'name':_0x29809a[_0x1656('0xac')][_0x1656('0xa9')][_0x1656('0xaa')],'custom':![],'options':_0x1abd13};_0x49a3b7[_0x1656('0x95')](_0x555843);return _0x49a3b7;});}function getBooleanList(_0x3c73d2,_0x32e1ca,_0x4dd9af,_0x373975,_0x379fc9,_0x15a0d0){var _0x272e10={'method':_0x1656('0x8a'),'uri':_0x3c73d2+_0x1656('0xa4')+_0x373975+_0x1656('0xa5')+_0x379fc9+_0x1656('0xad'),'headers':{'Authorization':'Bearer\x20'+_0x15a0d0,'If-None-Match':null,'OData-Version':_0x1656('0x8d')},'json':!![]};return rp(_0x272e10)[_0x1656('0xd')](function(_0xecd416){var _0x5d78ed=[];_0x5d78ed[_0x1656('0x95')]({'name':_0xecd416[_0x1656('0xa8')][_0x1656('0xae')][_0x1656('0xaa')]['UserLocalizedLabel'][_0x1656('0xaa')],'value':_0x1656('0xaf')},{'name':_0xecd416[_0x1656('0xa8')][_0x1656('0xb0')][_0x1656('0xaa')][_0x1656('0xa9')][_0x1656('0xaa')],'value':_0x1656('0xb1')});var _0x5b2224={'id':_0x32e1ca+'_'+_0xecd416[_0x1656('0x90')],'name':_0xecd416[_0x1656('0xac')][_0x1656('0xa9')][_0x1656('0xaa')],'custom':![],'options':_0x5d78ed};_0x4dd9af['push'](_0x5b2224);return _0x4dd9af;});}function getInputList(_0x32f934,_0x437c8c,_0x5ba0e7,_0x2aa6b2,_0x3fac8e,_0x160141,_0xe0b8d4){var _0x2860e4={'method':_0x1656('0x8a'),'uri':_0x32f934+_0x1656('0xa4')+_0x3fac8e+_0x1656('0xa5')+_0x160141+_0x1656('0xb2')+_0x5ba0e7+_0x1656('0xb3'),'headers':{'Authorization':_0x1656('0x8c')+_0xe0b8d4,'If-None-Match':null,'OData-Version':_0x1656('0x8d')},'json':!![]};return rp(_0x2860e4)[_0x1656('0xd')](function(_0x269fb1){var _0x53b349={'id':_0x437c8c+'_'+_0x269fb1['LogicalName'],'name':_0x269fb1[_0x1656('0xac')][_0x1656('0xa9')]?_0x269fb1[_0x1656('0xac')][_0x1656('0xa9')]['Label']:_0x269fb1['LogicalName'],'custom':![],'options':[]};_0x2aa6b2[_0x1656('0x95')](_0x53b349);return _0x2aa6b2;});} \ No newline at end of file +var _0x2d13=['BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','DisplayName','true','FalseOption','false',')/Attributes(','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','status','undefined','limit','count','offset','set','Content-Range','then','destroy','end','error','name','send','map','Dynamics365Account','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','update','getConfigurations','findOne','Dynamics365Configuration','pick','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','PhoneCall','description','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','escalatedon','exchangerate','followupby','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data7','access_token','data5','POST','https://login.microsoftonline.com/','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','Attributes','remove','includes','LogicalName','forEach','@odata.type','substring','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata'];(function(_0x32d54f,_0x419a06){var _0x575f0=function(_0x33867a){while(--_0x33867a){_0x32d54f['push'](_0x32d54f['shift']());}};_0x575f0(++_0x419a06);}(_0x2d13,0xcb));var _0x32d1=function(_0xd1179e,_0x5c65de){_0xd1179e=_0xd1179e-0x0;var _0x1c7c8e=_0x2d13[_0xd1179e];return _0x1c7c8e;};'use strict';var rp=require(_0x32d1('0x0'));var util=require(_0x32d1('0x1'));var _=require(_0x32d1('0x2'));var qs=require(_0x32d1('0x3'));var logger=require(_0x32d1('0x4'))(_0x32d1('0x5'));var db=require('../../mysqldb')['db'];var integrations=require(_0x32d1('0x6'));function respondWithResult(_0x44c4b1,_0x4ca17c){_0x4ca17c=_0x4ca17c||0xc8;return function(_0xa34d74){if(_0xa34d74){return _0x44c4b1[_0x32d1('0x7')](_0x4ca17c)['json'](_0xa34d74);}};}function respondWithFilteredResult(_0x5dcf39,_0x677ab5){return function(_0x3a802e){if(_0x3a802e){var _0x17e36b=typeof _0x677ab5['offset']===_0x32d1('0x8')&&typeof _0x677ab5[_0x32d1('0x9')]==='undefined';var _0x97354c=_0x3a802e[_0x32d1('0xa')];var _0x5d0b81=_0x17e36b?0x0:_0x677ab5[_0x32d1('0xb')];var _0x5e00d2=_0x17e36b?_0x3a802e[_0x32d1('0xa')]:_0x677ab5[_0x32d1('0xb')]+_0x677ab5[_0x32d1('0x9')];var _0x4cf9d4;if(_0x5e00d2>=_0x97354c){_0x5e00d2=_0x97354c;_0x4cf9d4=0xc8;}else{_0x4cf9d4=0xce;}_0x5dcf39[_0x32d1('0x7')](_0x4cf9d4);return _0x5dcf39[_0x32d1('0xc')](_0x32d1('0xd'),_0x5d0b81+'-'+_0x5e00d2+'/'+_0x97354c)['json'](_0x3a802e);}return null;};}function saveUpdates(_0x25bd3f){return function(_0x3eef15){if(_0x3eef15){return _0x3eef15['update'](_0x25bd3f)[_0x32d1('0xe')](function(_0x46914f){return _0x46914f;});}return null;};}function removeEntity(_0x18935a){return function(_0x260094){if(_0x260094){return _0x260094[_0x32d1('0xf')]()[_0x32d1('0xe')](function(){_0x18935a[_0x32d1('0x7')](0xcc)[_0x32d1('0x10')]();});}};}function handleEntityNotFound(_0x153d71){return function(_0x4bcbc7){if(!_0x4bcbc7){_0x153d71['sendStatus'](0x194);}return _0x4bcbc7;};}function handleError(_0x5663d6,_0x1d263f){_0x1d263f=_0x1d263f||0x1f4;return function(_0x3403db){logger[_0x32d1('0x11')](_0x3403db['stack']);if(_0x3403db[_0x32d1('0x12')]){delete _0x3403db[_0x32d1('0x12')];}_0x5663d6['status'](_0x1d263f)[_0x32d1('0x13')](_0x3403db);};}exports['index']=function(_0x2e41ac,_0x20f787){var _0x11c244={},_0x54bacb={},_0x557443={'count':0x0,'rows':[]};var _0xbfc9c3=_[_0x32d1('0x14')](db[_0x32d1('0x15')][_0x32d1('0x16')],function(_0xaa0d5c){return{'name':_0xaa0d5c[_0x32d1('0x17')],'type':_0xaa0d5c['type'][_0x32d1('0x18')]};});_0x54bacb['model']=_[_0x32d1('0x14')](_0xbfc9c3,_0x32d1('0x12'));_0x54bacb[_0x32d1('0x19')]=_[_0x32d1('0x1a')](_0x2e41ac['query']);_0x54bacb[_0x32d1('0x1b')]=_[_0x32d1('0x1c')](_0x54bacb[_0x32d1('0x1d')],_0x54bacb[_0x32d1('0x19')]);_0x11c244[_0x32d1('0x1e')]=_[_0x32d1('0x1c')](_0x54bacb[_0x32d1('0x1d')],qs[_0x32d1('0x1f')](_0x2e41ac[_0x32d1('0x19')][_0x32d1('0x1f')]));_0x11c244[_0x32d1('0x1e')]=_0x11c244[_0x32d1('0x1e')][_0x32d1('0x20')]?_0x11c244[_0x32d1('0x1e')]:_0x54bacb[_0x32d1('0x1d')];if(!_0x2e41ac[_0x32d1('0x19')][_0x32d1('0x21')](_0x32d1('0x22'))){_0x11c244[_0x32d1('0x9')]=qs[_0x32d1('0x9')](_0x2e41ac[_0x32d1('0x19')][_0x32d1('0x9')]);_0x11c244[_0x32d1('0xb')]=qs[_0x32d1('0xb')](_0x2e41ac[_0x32d1('0x19')]['offset']);}_0x11c244[_0x32d1('0x23')]=qs[_0x32d1('0x24')](_0x2e41ac[_0x32d1('0x19')][_0x32d1('0x24')]);_0x11c244['where']=qs[_0x32d1('0x1b')](_['pick'](_0x2e41ac[_0x32d1('0x19')],_0x54bacb[_0x32d1('0x1b')]),_0xbfc9c3);if(_0x2e41ac[_0x32d1('0x19')]['filter']){_0x11c244[_0x32d1('0x25')]=_['merge'](_0x11c244[_0x32d1('0x25')],{'$or':_[_0x32d1('0x14')](_0xbfc9c3,function(_0x216646){if(_0x216646[_0x32d1('0x26')]!==_0x32d1('0x27')){var _0x36b178={};_0x36b178[_0x216646[_0x32d1('0x12')]]={'$like':'%'+_0x2e41ac[_0x32d1('0x19')][_0x32d1('0x28')]+'%'};return _0x36b178;}})});}_0x11c244=_[_0x32d1('0x29')]({},_0x11c244,_0x2e41ac[_0x32d1('0x2a')]);var _0x2cd013={'where':_0x11c244[_0x32d1('0x25')]};return db[_0x32d1('0x15')][_0x32d1('0xa')](_0x2cd013)[_0x32d1('0xe')](function(_0x5e0161){_0x557443[_0x32d1('0xa')]=_0x5e0161;if(_0x2e41ac['query'][_0x32d1('0x2b')]){_0x11c244[_0x32d1('0x2c')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x32d1('0x2d')](_0x11c244);})['then'](function(_0x1f8489){_0x557443['rows']=_0x1f8489;return _0x557443;})[_0x32d1('0xe')](respondWithFilteredResult(_0x20f787,_0x11c244))[_0x32d1('0x2e')](handleError(_0x20f787,null));};exports['show']=function(_0x56e263,_0x1f5245){var _0x512d41={'raw':![],'where':{'id':_0x56e263[_0x32d1('0x2f')]['id']}},_0x42a7e4={};_0x42a7e4[_0x32d1('0x1d')]=_[_0x32d1('0x1a')](db[_0x32d1('0x15')]['rawAttributes']);_0x42a7e4[_0x32d1('0x19')]=_['keys'](_0x56e263[_0x32d1('0x19')]);_0x42a7e4['filters']=_[_0x32d1('0x1c')](_0x42a7e4[_0x32d1('0x1d')],_0x42a7e4[_0x32d1('0x19')]);_0x512d41[_0x32d1('0x1e')]=_[_0x32d1('0x1c')](_0x42a7e4[_0x32d1('0x1d')],qs[_0x32d1('0x1f')](_0x56e263[_0x32d1('0x19')][_0x32d1('0x1f')]));_0x512d41[_0x32d1('0x1e')]=_0x512d41[_0x32d1('0x1e')][_0x32d1('0x20')]?_0x512d41['attributes']:_0x42a7e4[_0x32d1('0x1d')];if(_0x56e263['query'][_0x32d1('0x2b')]){_0x512d41['include']=[{'all':!![]}];}_0x512d41=_[_0x32d1('0x29')]({},_0x512d41,_0x56e263['options']);return db['Dynamics365Account'][_0x32d1('0x30')](_0x512d41)[_0x32d1('0xe')](handleEntityNotFound(_0x1f5245,null))['then'](respondWithResult(_0x1f5245,null))[_0x32d1('0x2e')](handleError(_0x1f5245,null));};exports[_0x32d1('0x31')]=function(_0x4f5b00,_0x40caae){return db[_0x32d1('0x15')]['create'](_0x4f5b00[_0x32d1('0x32')],{})[_0x32d1('0xe')](respondWithResult(_0x40caae,0xc9))[_0x32d1('0x2e')](handleError(_0x40caae,null));};exports[_0x32d1('0x33')]=function(_0x5782d3,_0x405702){if(_0x5782d3['body']['id']){delete _0x5782d3[_0x32d1('0x32')]['id'];}return db[_0x32d1('0x15')][_0x32d1('0x30')]({'where':{'id':_0x5782d3[_0x32d1('0x2f')]['id']}})[_0x32d1('0xe')](handleEntityNotFound(_0x405702,null))[_0x32d1('0xe')](saveUpdates(_0x5782d3[_0x32d1('0x32')],null))[_0x32d1('0xe')](respondWithResult(_0x405702,null))[_0x32d1('0x2e')](handleError(_0x405702,null));};exports[_0x32d1('0xf')]=function(_0x2a3c5e,_0x160b70){return db[_0x32d1('0x15')]['find']({'where':{'id':_0x2a3c5e[_0x32d1('0x2f')]['id']}})[_0x32d1('0xe')](handleEntityNotFound(_0x160b70,null))[_0x32d1('0xe')](removeEntity(_0x160b70,null))[_0x32d1('0x2e')](handleError(_0x160b70,null));};exports[_0x32d1('0x34')]=function(_0x4d1893,_0x4bed5d){var _0x12141c={};var _0x131a32={};var _0x1006d3;var _0x4ca7e7;return db['Dynamics365Account'][_0x32d1('0x35')]({'where':{'id':_0x4d1893[_0x32d1('0x2f')]['id']}})[_0x32d1('0xe')](handleEntityNotFound(_0x4bed5d,null))[_0x32d1('0xe')](function(_0x6ba962){if(_0x6ba962){_0x1006d3=_0x6ba962;_0x131a32['model']=_[_0x32d1('0x1a')](db[_0x32d1('0x36')]['rawAttributes']);_0x131a32[_0x32d1('0x19')]=_['keys'](_0x4d1893[_0x32d1('0x19')]);_0x131a32[_0x32d1('0x1b')]=_['intersection'](_0x131a32[_0x32d1('0x1d')],_0x131a32[_0x32d1('0x19')]);_0x12141c[_0x32d1('0x1e')]=_[_0x32d1('0x1c')](_0x131a32[_0x32d1('0x1d')],qs[_0x32d1('0x1f')](_0x4d1893[_0x32d1('0x19')][_0x32d1('0x1f')]));_0x12141c['attributes']=_0x12141c[_0x32d1('0x1e')][_0x32d1('0x20')]?_0x12141c[_0x32d1('0x1e')]:_0x131a32[_0x32d1('0x1d')];_0x12141c['order']=qs['sort'](_0x4d1893[_0x32d1('0x19')][_0x32d1('0x24')]);_0x12141c[_0x32d1('0x25')]=qs[_0x32d1('0x1b')](_[_0x32d1('0x37')](_0x4d1893[_0x32d1('0x19')],_0x131a32[_0x32d1('0x1b')]));if(_0x4d1893[_0x32d1('0x19')]['filter']){_0x12141c[_0x32d1('0x25')]=_[_0x32d1('0x29')](_0x12141c[_0x32d1('0x25')],{'$or':_[_0x32d1('0x14')](_0x12141c[_0x32d1('0x1e')],function(_0x279465){var _0x5ff63a={};_0x5ff63a[_0x279465]={'$like':'%'+_0x4d1893['query'][_0x32d1('0x28')]+'%'};return _0x5ff63a;})});}_0x12141c=_[_0x32d1('0x29')]({},_0x12141c,_0x4d1893[_0x32d1('0x2a')]);return _0x1006d3['getConfigurations'](_0x12141c);}})[_0x32d1('0xe')](function(_0x46fbdc){if(_0x46fbdc){_0x4ca7e7=_0x46fbdc['length'];if(!_0x4d1893[_0x32d1('0x19')][_0x32d1('0x21')](_0x32d1('0x22'))){_0x12141c[_0x32d1('0x9')]=qs[_0x32d1('0x9')](_0x4d1893[_0x32d1('0x19')][_0x32d1('0x9')]);_0x12141c[_0x32d1('0xb')]=qs[_0x32d1('0xb')](_0x4d1893[_0x32d1('0x19')][_0x32d1('0xb')]);}return _0x1006d3['getConfigurations'](_0x12141c);}})['then'](function(_0x468264){if(_0x468264){return _0x468264?{'count':_0x4ca7e7,'rows':_0x468264}:null;}})[_0x32d1('0xe')](respondWithResult(_0x4bed5d,null))[_0x32d1('0x2e')](handleError(_0x4bed5d,null));};exports['addConfiguration']=function(_0x5357ed,_0x3468aa){if(_0x5357ed[_0x32d1('0x32')]['id']){delete _0x5357ed['body']['id'];}return db['Dynamics365Account'][_0x32d1('0x35')]({'where':{'id':_0x5357ed['params']['id']}})[_0x32d1('0xe')](handleEntityNotFound(_0x3468aa,null))[_0x32d1('0xe')](function(_0x388473){if(_0x388473){_0x5357ed[_0x32d1('0x32')][_0x32d1('0x38')]=_0x388473['id'];_0x5357ed[_0x32d1('0x32')][_0x32d1('0x39')]=integrations[_0x32d1('0x3a')](_0x5357ed[_0x32d1('0x32')][_0x32d1('0x3b')],_0x5357ed[_0x32d1('0x32')]['type']);_0x5357ed[_0x32d1('0x32')][_0x32d1('0x3c')]=integrations[_0x32d1('0x3d')](_0x5357ed[_0x32d1('0x32')][_0x32d1('0x3b')],_0x5357ed[_0x32d1('0x32')][_0x32d1('0x26')]);return db['Dynamics365Configuration'][_0x32d1('0x31')](_0x5357ed[_0x32d1('0x32')],{'include':[{'model':db[_0x32d1('0x3e')],'as':_0x32d1('0x39')},{'model':db[_0x32d1('0x3e')],'as':_0x32d1('0x3c')}]});}return null;})[_0x32d1('0xe')](respondWithResult(_0x3468aa,null))[_0x32d1('0x2e')](handleError(_0x3468aa,null));};function sanitizeRemoteUri(_0x6bd2e9){var _0x237db6=_0x6bd2e9['slice'](-0x1);if(_0x237db6==='/')return _0x6bd2e9['substring'](0x0,_0x6bd2e9[_0x32d1('0x3f')](_0x237db6));return _0x6bd2e9;}function getWebApiUrl(_0x4e28d3){return util[_0x32d1('0x40')](_0x32d1('0x41'),_0x4e28d3);}exports[_0x32d1('0x42')]=function(_0x19cdc3,_0x1c8827){var _0x31954a=_0x19cdc3[_0x32d1('0x19')][_0x32d1('0x43')];var _0x4e228a=_0x31954a===_0x32d1('0x44')?'Incident':_0x32d1('0x45');var _0x4a95c6='';var _0x27647b='';var _0x2d7850='';var _0x55cca2='';var _0x3baaab='';var _0x24007d='';var _0x1a36b4='';var _0xe54d81='';var _0x3c2ffb=['title',_0x32d1('0x46'),'customerid','ownerid',_0x32d1('0x47'),_0x32d1('0x48'),_0x32d1('0x49'),_0x32d1('0x4a'),_0x32d1('0x4b'),_0x32d1('0x4c')];var _0x12bb49=[_0x32d1('0x4d'),_0x32d1('0x4e'),'actualserviceunits',_0x32d1('0x4f'),_0x32d1('0x50'),_0x32d1('0x51'),_0x32d1('0x52'),_0x32d1('0x53'),_0x32d1('0x54'),_0x32d1('0x55'),_0x32d1('0x56'),'createdbyyominame','createdon','createdonbehalfbyname',_0x32d1('0x57'),_0x32d1('0x58'),_0x32d1('0x59'),_0x32d1('0x5a'),'emailaddress',_0x32d1('0x5b'),'entityimage_timestamp','entityimage_url',_0x32d1('0x5c'),_0x32d1('0x5d'),'firstresponsebykpiidname',_0x32d1('0x5e'),'importsequencenumber',_0x32d1('0x5f'),'kbarticleidname',_0x32d1('0x60'),_0x32d1('0x61'),_0x32d1('0x62'),_0x32d1('0x63'),_0x32d1('0x64'),_0x32d1('0x65'),_0x32d1('0x66'),_0x32d1('0x67'),'modifiedonbehalfbyyominame',_0x32d1('0x68'),'msdyn_iotalertname',_0x32d1('0x69'),_0x32d1('0x6a'),_0x32d1('0x6b'),_0x32d1('0x6c'),_0x32d1('0x6d'),_0x32d1('0x6e'),_0x32d1('0x6f'),_0x32d1('0x70'),_0x32d1('0x71'),_0x32d1('0x72'),'productidname',_0x32d1('0x73'),_0x32d1('0x74'),_0x32d1('0x75'),'responseby',_0x32d1('0x76'),_0x32d1('0x77'),'sentimentvalue',_0x32d1('0x78'),_0x32d1('0x79'),_0x32d1('0x7a'),_0x32d1('0x7b'),_0x32d1('0x7c'),_0x32d1('0x7d'),'ticketnumber',_0x32d1('0x7e'),'transactioncurrencyidname','traversedpath',_0x32d1('0x7f'),_0x32d1('0x80')];var _0x2b72ad=_0x3c2ffb[_0x32d1('0x81')](_0x12bb49);return db['Dynamics365Account']['findOne']({'where':{'id':_0x19cdc3['params']['id']},'attributes':['id',_0x32d1('0x82'),_0x32d1('0x83'),_0x32d1('0x84'),_0x32d1('0x85'),_0x32d1('0x86'),_0x32d1('0x87'),_0x32d1('0x88')],'include':[{'model':db[_0x32d1('0x89')],'as':_0x32d1('0x89'),'attributes':['id','data5',_0x32d1('0x8a')]}]})[_0x32d1('0xe')](handleEntityNotFound(_0x1c8827,null))[_0x32d1('0xe')](function(_0x3bd1d2){if(_0x3bd1d2){if(_0x3bd1d2[_0x32d1('0x88')]){_0x3bd1d2[_0x32d1('0x8b')]=_0x3bd1d2[_0x32d1('0x89')][_0x32d1('0x8c')];_0xe54d81=sanitizeRemoteUri(_0x3bd1d2[_0x32d1('0x89')][_0x32d1('0x8a')]);_0x1a36b4=getWebApiUrl(_0xe54d81);return _0x3bd1d2;}_0xe54d81=sanitizeRemoteUri(_0x3bd1d2[_0x32d1('0x84')]);_0x1a36b4=getWebApiUrl(_0xe54d81);var _0x5188c2={'method':_0x32d1('0x8d'),'uri':_0x32d1('0x8e')+_0x3bd1d2['tenantId']+_0x32d1('0x8f'),'form':{'client_id':_0x3bd1d2[_0x32d1('0x86')],'resource':_0xe54d81,'username':_0x3bd1d2[_0x32d1('0x82')],'password':_0x3bd1d2[_0x32d1('0x83')],'grant_type':_0x32d1('0x83'),'client_secret':_0x3bd1d2[_0x32d1('0x87')]},'json':!![]};return rp(_0x5188c2);}})[_0x32d1('0xe')](function(_0xfc038c){_0x24007d=_0xfc038c[_0x32d1('0x8b')];var _0x392f80={'method':_0x32d1('0x90'),'uri':encodeURI(_0x1a36b4+_0x32d1('0x91')+_0x4e228a+'\x27'),'headers':{'Authorization':_0x32d1('0x92')+_0x24007d,'If-None-Match':null,'OData-Version':_0x32d1('0x93')},'json':!![]};return rp(_0x392f80);})[_0x32d1('0xe')](function(_0x503279){var _0x5ca93d=_0x503279[_0x32d1('0x94')][0x0];var _0x12f50f=_0x5ca93d[_0x32d1('0x95')];var _0x27b211={'method':_0x32d1('0x90'),'uri':_0x1a36b4+_0x32d1('0x96')+_0x12f50f+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x32d1('0x92')+_0x24007d,'If-None-Match':null,'OData-Version':_0x32d1('0x93')},'json':!![]};return rp(_0x27b211);})['then'](function(_0x2880b3){_0x4a95c6=_0x2880b3;_0x27647b=_0x4a95c6[_0x32d1('0x97')];_0x27647b=_[_0x32d1('0x98')](_0x27647b,function(_0x5ac249){return!_0x2b72ad[_0x32d1('0x99')](_0x5ac249[_0x32d1('0x9a')]);});var _0x1e76c5=[];var _0xe1cd58=[];_0x27647b[_0x32d1('0x9b')](function(_0x2a6566){if(_0x2a6566['@odata.type']){var _0xa0b738=_0x2a6566[_0x32d1('0x9c')][_0x32d1('0x9d')](_0x2a6566[_0x32d1('0x9c')]['lastIndexOf']('.')+0x1);if(_0xa0b738==='PicklistAttributeMetadata'){_0x1e76c5['push'](getSelectList(_0x1a36b4,_0x31954a,_0xe1cd58,_0x4a95c6[_0x32d1('0x95')],_0x2a6566[_0x32d1('0x95')],_0x24007d));}}});return Promise[_0x32d1('0x9e')](_0x1e76c5);})[_0x32d1('0xe')](function(_0x50a62c){_0x2d7850=_0x50a62c[0x0];var _0x30b02c=[];var _0x483617=[];_0x27647b[_0x32d1('0x9b')](function(_0xde9bc0){if(!_[_0x32d1('0x9f')](_0xde9bc0[_0x32d1('0x9c')])){var _0x3ddce0=_0xde9bc0['@odata.type'][_0x32d1('0x9d')](_0xde9bc0[_0x32d1('0x9c')][_0x32d1('0x3f')]('.')+0x1);if(_0x3ddce0===_0x32d1('0xa0')){_0x30b02c[_0x32d1('0xa1')](getBooleanList(_0x1a36b4,_0x31954a,_0x483617,_0x4a95c6[_0x32d1('0x95')],_0xde9bc0[_0x32d1('0x95')],_0x24007d));}}});return Promise[_0x32d1('0x9e')](_0x30b02c);})[_0x32d1('0xe')](function(_0x4cb833){_0x55cca2=_0x4cb833[0x0];var _0x397e7e=[];var _0x5bd1b0=[];_0x27647b[_0x32d1('0x9b')](function(_0x2ef797){if(_0x2ef797[_0x32d1('0x9c')]){var _0x46596a=_0x2ef797[_0x32d1('0x9c')]['substring'](_0x2ef797[_0x32d1('0x9c')][_0x32d1('0x3f')]('.')+0x1);if(_0x46596a===_0x32d1('0xa2')||_0x46596a==='DoubleAttributeMetadata'||_0x46596a===_0x32d1('0xa3')||_0x46596a===_0x32d1('0xa4')||_0x46596a===_0x32d1('0xa5')||_0x46596a==='DateTimeAttributeMetadata'||_0x46596a===_0x32d1('0xa6')||_0x46596a===_0x32d1('0xa7')||_0x46596a==='StateAttributeMetadata'||_0x46596a===_0x32d1('0xa8')){_0x397e7e['push'](getInputList(_0x1a36b4,_0x31954a,_0x46596a,_0x5bd1b0,_0x4a95c6[_0x32d1('0x95')],_0x2ef797['MetadataId'],_0x24007d));}}});return Promise[_0x32d1('0x9e')](_0x397e7e);})[_0x32d1('0xe')](function(_0x4d45e0){_0x3baaab=_0x4d45e0[0x0];var _0x1ecaac=_0x2d7850[_0x32d1('0x81')](_0x55cca2)[_0x32d1('0x81')](_0x3baaab);var _0x1f603d={'count':_0x1ecaac[_0x32d1('0x20')],'rows':_0x1ecaac};return _0x1f603d;})[_0x32d1('0xe')](respondWithResult(_0x1c8827,null))[_0x32d1('0x2e')](function(_0x16d0ce){var _0x43cf90=_0x19cdc3['query'][_0x32d1('0xa9')]?0x1f4:_0x16d0ce[_0x32d1('0xaa')]||0x1f4;logger['error'](_0x16d0ce['stack']);delete _0x16d0ce[_0x32d1('0x12')];if(_0x43cf90===0x191){_0x43cf90=0x190;}_0x1c8827['status'](_0x43cf90)[_0x32d1('0x13')](_0x19cdc3[_0x32d1('0x19')][_0x32d1('0xa9')]?{'message':_0x32d1('0xab'),'statusCode':_0x16d0ce[_0x32d1('0xaa')]}:_0x16d0ce);});};function getSelectList(_0x323c1a,_0x1b6f88,_0x5b3936,_0x2ee99f,_0x304f29,_0x467d87){var _0x1befd7={'method':_0x32d1('0x90'),'uri':_0x323c1a+_0x32d1('0x96')+_0x2ee99f+')/Attributes('+_0x304f29+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x32d1('0xac'),'headers':{'Authorization':_0x32d1('0x92')+_0x467d87,'If-None-Match':null,'OData-Version':_0x32d1('0x93')},'json':!![]};return rp(_0x1befd7)[_0x32d1('0xe')](function(_0xa072c6){var _0x5aeadd=[];var _0x3e203e=_0xa072c6[_0x32d1('0xad')][_0x32d1('0xae')];_0x3e203e[_0x32d1('0x9b')](function(_0x57d48b){_0x5aeadd[_0x32d1('0xa1')]({'name':_0x57d48b[_0x32d1('0xaf')][_0x32d1('0xb0')][_0x32d1('0xaf')],'value':String(_0x57d48b['Value'])});});var _0x3553db={'id':_0x1b6f88+'_'+_0xa072c6['LogicalName'],'name':_0xa072c6[_0x32d1('0xb1')][_0x32d1('0xb0')][_0x32d1('0xaf')],'custom':![],'options':_0x5aeadd};_0x5b3936['push'](_0x3553db);return _0x5b3936;});}function getBooleanList(_0x4951af,_0x4223b7,_0x1c59f9,_0x341d41,_0x502e57,_0x114663){var _0x3d3402={'method':_0x32d1('0x90'),'uri':_0x4951af+_0x32d1('0x96')+_0x341d41+')/Attributes('+_0x502e57+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x32d1('0x92')+_0x114663,'If-None-Match':null,'OData-Version':_0x32d1('0x93')},'json':!![]};return rp(_0x3d3402)['then'](function(_0x530dd5){var _0x5e7adc=[];_0x5e7adc['push']({'name':_0x530dd5['OptionSet']['TrueOption'][_0x32d1('0xaf')]['UserLocalizedLabel'][_0x32d1('0xaf')],'value':_0x32d1('0xb2')},{'name':_0x530dd5[_0x32d1('0xad')][_0x32d1('0xb3')][_0x32d1('0xaf')][_0x32d1('0xb0')]['Label'],'value':_0x32d1('0xb4')});var _0x246ce1={'id':_0x4223b7+'_'+_0x530dd5[_0x32d1('0x9a')],'name':_0x530dd5['DisplayName'][_0x32d1('0xb0')]['Label'],'custom':![],'options':_0x5e7adc};_0x1c59f9[_0x32d1('0xa1')](_0x246ce1);return _0x1c59f9;});}function getInputList(_0x22bf36,_0x2481ad,_0x5e36b5,_0xdcfd10,_0x235763,_0x455523,_0x1decfe){var _0x8e21a={'method':'GET','uri':_0x22bf36+_0x32d1('0x96')+_0x235763+_0x32d1('0xb5')+_0x455523+')/Microsoft.Dynamics.CRM.'+_0x5e36b5+_0x32d1('0xb6'),'headers':{'Authorization':_0x32d1('0x92')+_0x1decfe,'If-None-Match':null,'OData-Version':_0x32d1('0x93')},'json':!![]};return rp(_0x8e21a)['then'](function(_0x175308){var _0x58917d={'id':_0x2481ad+'_'+_0x175308[_0x32d1('0x9a')],'name':_0x175308[_0x32d1('0xb1')]['UserLocalizedLabel']?_0x175308['DisplayName'][_0x32d1('0xb0')][_0x32d1('0xaf')]:_0x175308['LogicalName'],'custom':![],'options':[]};_0xdcfd10[_0x32d1('0xa1')](_0x58917d);return _0xdcfd10;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 90caa25..634397f 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5af1d2,_0x446d50){var _0x1dd2c5=function(_0x515991){while(--_0x515991){_0x5af1d2['push'](_0x5af1d2['shift']());}};_0x1dd2c5(++_0x446d50);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0xb036f7,_0x538be8){var _0x54895a=function(_0x54290f){while(--_0x54290f){_0xb036f7['push'](_0xb036f7['shift']());}};_0x54895a(++_0x538be8);}(_0xb7e7,0x121));var _0x7b7e=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xb7e7[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index b4c0a77..cb1f2f4 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.rpc.js +++ b/server/api/intDynamics365Account/intDynamics365Account.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c2e=['include','map','model','attributes','GetDynamics365Account','find','raw','ShowDynamics365Account','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Dynamics365Account','findAll','options','where','limit'];(function(_0x1beb1c,_0xb9e72c){var _0x401b20=function(_0x4ad115){while(--_0x4ad115){_0x1beb1c['push'](_0x1beb1c['shift']());}};_0x401b20(++_0xb9e72c);}(_0x0c2e,0x14d));var _0xe0c2=function(_0x545928,_0x28b70f){_0x545928=_0x545928-0x0;var _0x3b3dac=_0x0c2e[_0x545928];return _0x3b3dac;};'use strict';var _=require(_0xe0c2('0x0'));var util=require(_0xe0c2('0x1'));var moment=require(_0xe0c2('0x2'));var BPromise=require(_0xe0c2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0c2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe0c2('0x5'));var logger=require(_0xe0c2('0x6'))('rpc');var config=require(_0xe0c2('0x7'));var jayson=require(_0xe0c2('0x8'));var client=jayson[_0xe0c2('0x9')][_0xe0c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x489dbb,_0x26d88a,_0x440a23){return new BPromise(function(_0x1f8e4a,_0x50a567){return client['request'](_0x489dbb,_0x440a23)[_0xe0c2('0xb')](function(_0x4ef345){logger[_0xe0c2('0xc')](_0xe0c2('0xd'),_0x26d88a,_0xe0c2('0xe'));logger[_0xe0c2('0xf')](_0xe0c2('0x10'),_0x26d88a,'request\x20sent',JSON[_0xe0c2('0x11')](_0x4ef345));if(_0x4ef345[_0xe0c2('0x12')]){if(_0x4ef345[_0xe0c2('0x12')][_0xe0c2('0x13')]===0x1f4){logger[_0xe0c2('0x12')](_0xe0c2('0xd'),_0x26d88a,_0x4ef345['error'][_0xe0c2('0x14')]);return _0x50a567(_0x4ef345[_0xe0c2('0x12')][_0xe0c2('0x14')]);}logger['error'](_0xe0c2('0xd'),_0x26d88a,_0x4ef345['error'][_0xe0c2('0x14')]);return _0x1f8e4a(_0x4ef345[_0xe0c2('0x12')][_0xe0c2('0x14')]);}else{logger[_0xe0c2('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x26d88a,'request\x20sent');_0x1f8e4a(_0x4ef345[_0xe0c2('0x15')][_0xe0c2('0x14')]);}})['catch'](function(_0x51907a){logger[_0xe0c2('0x12')](_0xe0c2('0xd'),_0x26d88a,_0x51907a);_0x50a567(_0x51907a);});});}exports['GetDynamics365Account']=function(_0x4c48d1){var _0x587a70=this;return new Promise(function(_0x583c25,_0x1d54ab){return db[_0xe0c2('0x16')][_0xe0c2('0x17')]({'raw':_0x4c48d1[_0xe0c2('0x18')]?_0x4c48d1[_0xe0c2('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4c48d1[_0xe0c2('0x18')]?_0x4c48d1['options'][_0xe0c2('0x19')]||null:null,'attributes':_0x4c48d1[_0xe0c2('0x18')]?_0x4c48d1['options']['attributes']||null:null,'limit':_0x4c48d1[_0xe0c2('0x18')]?_0x4c48d1['options'][_0xe0c2('0x1a')]||null:null,'include':_0x4c48d1[_0xe0c2('0x18')]?_0x4c48d1[_0xe0c2('0x18')][_0xe0c2('0x1b')]?_[_0xe0c2('0x1c')](_0x4c48d1[_0xe0c2('0x18')][_0xe0c2('0x1b')],function(_0x129712){return{'model':db[_0x129712[_0xe0c2('0x1d')]],'as':_0x129712['as'],'attributes':_0x129712[_0xe0c2('0x1e')],'include':_0x129712[_0xe0c2('0x1b')]?_[_0xe0c2('0x1c')](_0x129712[_0xe0c2('0x1b')],function(_0x3fec12){return{'model':db[_0x3fec12[_0xe0c2('0x1d')]],'as':_0x3fec12['as'],'attributes':_0x3fec12[_0xe0c2('0x1e')],'include':_0x3fec12['include']?_[_0xe0c2('0x1c')](_0x3fec12['include'],function(_0x388eca){return{'model':db[_0x388eca[_0xe0c2('0x1d')]],'as':_0x388eca['as'],'attributes':_0x388eca['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xec24b3){logger[_0xe0c2('0xc')]('GetDynamics365Account',_0x4c48d1);logger['debug'](_0xe0c2('0x1f'),_0x4c48d1,JSON[_0xe0c2('0x11')](_0xec24b3));_0x583c25(_0xec24b3);})['catch'](function(_0x54fb6e){logger['error'](_0xe0c2('0x1f'),_0x54fb6e['message'],_0x4c48d1);_0x1d54ab(_0x587a70['error'](0x1f4,_0x54fb6e[_0xe0c2('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x1711f1){var _0x2119a3=this;return new Promise(function(_0x34845e,_0x53ff78){return db[_0xe0c2('0x16')][_0xe0c2('0x20')]({'raw':_0x1711f1[_0xe0c2('0x18')]?_0x1711f1[_0xe0c2('0x18')][_0xe0c2('0x21')]===undefined?!![]:![]:!![],'where':_0x1711f1[_0xe0c2('0x18')]?_0x1711f1[_0xe0c2('0x18')][_0xe0c2('0x19')]||null:null,'attributes':_0x1711f1[_0xe0c2('0x18')]?_0x1711f1[_0xe0c2('0x18')]['attributes']||null:null,'include':_0x1711f1[_0xe0c2('0x18')]?_0x1711f1[_0xe0c2('0x18')][_0xe0c2('0x1b')]?_[_0xe0c2('0x1c')](_0x1711f1['options'][_0xe0c2('0x1b')],function(_0x14de1b){return{'model':db[_0x14de1b[_0xe0c2('0x1d')]],'as':_0x14de1b['as'],'attributes':_0x14de1b[_0xe0c2('0x1e')],'include':_0x14de1b['include']?_[_0xe0c2('0x1c')](_0x14de1b['include'],function(_0x2c4119){return{'model':db[_0x2c4119[_0xe0c2('0x1d')]],'as':_0x2c4119['as'],'attributes':_0x2c4119[_0xe0c2('0x1e')],'include':_0x2c4119[_0xe0c2('0x1b')]?_[_0xe0c2('0x1c')](_0x2c4119[_0xe0c2('0x1b')],function(_0x294933){return{'model':db[_0x294933[_0xe0c2('0x1d')]],'as':_0x294933['as'],'attributes':_0x294933['attributes']};}):[]};}):[]};}):[]:[]})[_0xe0c2('0xb')](function(_0x205dc4){logger[_0xe0c2('0xc')](_0xe0c2('0x22'),_0x1711f1);logger[_0xe0c2('0xf')](_0xe0c2('0x22'),_0x1711f1,JSON[_0xe0c2('0x11')](_0x205dc4));_0x34845e(_0x205dc4);})[_0xe0c2('0x23')](function(_0x594e02){logger[_0xe0c2('0x12')](_0xe0c2('0x22'),_0x594e02[_0xe0c2('0x14')],_0x1711f1);_0x53ff78(_0x2119a3[_0xe0c2('0x12')](0x1f4,_0x594e02[_0xe0c2('0x14')]));});});}; \ No newline at end of file +var _0x60a4=['raw','where','attributes','limit','include','map','model','stringify','ShowDynamics365Account','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options'];(function(_0x2e0120,_0x3f00ff){var _0x38804d=function(_0x2a1692){while(--_0x2a1692){_0x2e0120['push'](_0x2e0120['shift']());}};_0x38804d(++_0x3f00ff);}(_0x60a4,0x12a));var _0x460a=function(_0x50dbc2,_0x1cc018){_0x50dbc2=_0x50dbc2-0x0;var _0x16f4ab=_0x60a4[_0x50dbc2];return _0x16f4ab;};'use strict';var _=require(_0x460a('0x0'));var util=require(_0x460a('0x1'));var moment=require('moment');var BPromise=require(_0x460a('0x2'));var rs=require(_0x460a('0x3'));var fs=require('fs');var Redis=require(_0x460a('0x4'));var db=require(_0x460a('0x5'))['db'];var utils=require(_0x460a('0x6'));var logger=require(_0x460a('0x7'))(_0x460a('0x8'));var config=require(_0x460a('0x9'));var jayson=require(_0x460a('0xa'));var client=jayson['client'][_0x460a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ad9ec,_0x6219b7,_0x4bf13d){return new BPromise(function(_0x249ad8,_0xed46de){return client['request'](_0x4ad9ec,_0x4bf13d)[_0x460a('0xc')](function(_0x5a04dc){logger['info'](_0x460a('0xd'),_0x6219b7,_0x460a('0xe'));logger[_0x460a('0xf')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x6219b7,_0x460a('0xe'),JSON['stringify'](_0x5a04dc));if(_0x5a04dc[_0x460a('0x10')]){if(_0x5a04dc['error'][_0x460a('0x11')]===0x1f4){logger[_0x460a('0x10')](_0x460a('0xd'),_0x6219b7,_0x5a04dc[_0x460a('0x10')]['message']);return _0xed46de(_0x5a04dc[_0x460a('0x10')][_0x460a('0x12')]);}logger[_0x460a('0x10')](_0x460a('0xd'),_0x6219b7,_0x5a04dc['error'][_0x460a('0x12')]);return _0x249ad8(_0x5a04dc[_0x460a('0x10')]['message']);}else{logger[_0x460a('0x13')](_0x460a('0xd'),_0x6219b7,_0x460a('0xe'));_0x249ad8(_0x5a04dc[_0x460a('0x14')]['message']);}})[_0x460a('0x15')](function(_0x3b36cf){logger[_0x460a('0x10')](_0x460a('0xd'),_0x6219b7,_0x3b36cf);_0xed46de(_0x3b36cf);});});}exports[_0x460a('0x16')]=function(_0x4474e8){var _0x40d78f=this;return new Promise(function(_0x2d266c,_0x332736){return db[_0x460a('0x17')][_0x460a('0x18')]({'raw':_0x4474e8['options']?_0x4474e8[_0x460a('0x19')][_0x460a('0x1a')]===undefined?!![]:![]:!![],'where':_0x4474e8[_0x460a('0x19')]?_0x4474e8[_0x460a('0x19')][_0x460a('0x1b')]||null:null,'attributes':_0x4474e8[_0x460a('0x19')]?_0x4474e8[_0x460a('0x19')][_0x460a('0x1c')]||null:null,'limit':_0x4474e8[_0x460a('0x19')]?_0x4474e8[_0x460a('0x19')][_0x460a('0x1d')]||null:null,'include':_0x4474e8[_0x460a('0x19')]?_0x4474e8[_0x460a('0x19')][_0x460a('0x1e')]?_[_0x460a('0x1f')](_0x4474e8['options'][_0x460a('0x1e')],function(_0x2da713){return{'model':db[_0x2da713[_0x460a('0x20')]],'as':_0x2da713['as'],'attributes':_0x2da713[_0x460a('0x1c')],'include':_0x2da713[_0x460a('0x1e')]?_['map'](_0x2da713['include'],function(_0x2039f8){return{'model':db[_0x2039f8['model']],'as':_0x2039f8['as'],'attributes':_0x2039f8[_0x460a('0x1c')],'include':_0x2039f8[_0x460a('0x1e')]?_[_0x460a('0x1f')](_0x2039f8[_0x460a('0x1e')],function(_0x3a5b6f){return{'model':db[_0x3a5b6f[_0x460a('0x20')]],'as':_0x3a5b6f['as'],'attributes':_0x3a5b6f[_0x460a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x460a('0xc')](function(_0x502da9){logger[_0x460a('0x13')](_0x460a('0x16'),_0x4474e8);logger[_0x460a('0xf')]('GetDynamics365Account',_0x4474e8,JSON[_0x460a('0x21')](_0x502da9));_0x2d266c(_0x502da9);})[_0x460a('0x15')](function(_0x14c320){logger[_0x460a('0x10')]('GetDynamics365Account',_0x14c320['message'],_0x4474e8);_0x332736(_0x40d78f[_0x460a('0x10')](0x1f4,_0x14c320[_0x460a('0x12')]));});});};exports[_0x460a('0x22')]=function(_0x1663a6){var _0x5ae363=this;return new Promise(function(_0x1f54d6,_0x4e17ac){return db['Dynamics365Account'][_0x460a('0x23')]({'raw':_0x1663a6['options']?_0x1663a6[_0x460a('0x19')][_0x460a('0x1a')]===undefined?!![]:![]:!![],'where':_0x1663a6['options']?_0x1663a6[_0x460a('0x19')][_0x460a('0x1b')]||null:null,'attributes':_0x1663a6[_0x460a('0x19')]?_0x1663a6[_0x460a('0x19')][_0x460a('0x1c')]||null:null,'include':_0x1663a6[_0x460a('0x19')]?_0x1663a6['options']['include']?_[_0x460a('0x1f')](_0x1663a6[_0x460a('0x19')]['include'],function(_0x324e7d){return{'model':db[_0x324e7d[_0x460a('0x20')]],'as':_0x324e7d['as'],'attributes':_0x324e7d['attributes'],'include':_0x324e7d[_0x460a('0x1e')]?_[_0x460a('0x1f')](_0x324e7d[_0x460a('0x1e')],function(_0x293371){return{'model':db[_0x293371[_0x460a('0x20')]],'as':_0x293371['as'],'attributes':_0x293371[_0x460a('0x1c')],'include':_0x293371['include']?_[_0x460a('0x1f')](_0x293371[_0x460a('0x1e')],function(_0x5b0f15){return{'model':db[_0x5b0f15[_0x460a('0x20')]],'as':_0x5b0f15['as'],'attributes':_0x5b0f15[_0x460a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x460a('0xc')](function(_0x5da1a4){logger['info'](_0x460a('0x22'),_0x1663a6);logger[_0x460a('0xf')]('ShowDynamics365Account',_0x1663a6,JSON[_0x460a('0x21')](_0x5da1a4));_0x1f54d6(_0x5da1a4);})[_0x460a('0x15')](function(_0xceb9e7){logger['error']('ShowDynamics365Account',_0xceb9e7[_0x460a('0x12')],_0x1663a6);_0x4e17ac(_0x5ae363[_0x460a('0x10')](0x1f4,_0xceb9e7['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 74721d1..e055c11 100644 --- a/server/api/intDynamics365Configuration/index.js +++ b/server/api/intDynamics365Configuration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2baa=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x2ac71a,_0x1d2a02){var _0x3ee904=function(_0x5c902a){while(--_0x5c902a){_0x2ac71a['push'](_0x2ac71a['shift']());}};_0x3ee904(++_0x1d2a02);}(_0x2baa,0xdd));var _0xa2ba=function(_0x4b7420,_0x3001d5){_0x4b7420=_0x4b7420-0x0;var _0x243c21=_0x2baa[_0x4b7420];return _0x243c21;};'use strict';var multer=require(_0xa2ba('0x0'));var util=require(_0xa2ba('0x1'));var path=require(_0xa2ba('0x2'));var timeout=require(_0xa2ba('0x3'));var express=require(_0xa2ba('0x4'));var router=express[_0xa2ba('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa2ba('0x6'));var interaction=require(_0xa2ba('0x7'));var config=require(_0xa2ba('0x8'));var controller=require('./intDynamics365Configuration.controller');router[_0xa2ba('0x9')]('/',auth[_0xa2ba('0xa')](),controller[_0xa2ba('0xb')]);router[_0xa2ba('0x9')]('/:id',auth[_0xa2ba('0xa')](),controller[_0xa2ba('0xc')]);router[_0xa2ba('0x9')](_0xa2ba('0xd'),auth['isAuthenticated'](),controller[_0xa2ba('0xe')]);router[_0xa2ba('0x9')](_0xa2ba('0xf'),auth[_0xa2ba('0xa')](),controller[_0xa2ba('0x10')]);router[_0xa2ba('0x9')](_0xa2ba('0x11'),auth[_0xa2ba('0xa')](),controller[_0xa2ba('0x12')]);router[_0xa2ba('0x13')]('/',auth[_0xa2ba('0xa')](),controller[_0xa2ba('0x14')]);router['put'](_0xa2ba('0x15'),auth['isAuthenticated'](),controller[_0xa2ba('0x16')]);router[_0xa2ba('0x17')](_0xa2ba('0x15'),auth[_0xa2ba('0xa')](),controller[_0xa2ba('0x18')]);module[_0xa2ba('0x19')]=router; \ No newline at end of file +var _0xa49e=['getDescriptions','create','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa49e,0x147));var _0xea49=function(_0x1d5352,_0x4f7974){_0x1d5352=_0x1d5352-0x0;var _0x3395c2=_0xa49e[_0x1d5352];return _0x3395c2;};'use strict';var multer=require(_0xea49('0x0'));var util=require('util');var path=require(_0xea49('0x1'));var timeout=require('connect-timeout');var express=require(_0xea49('0x2'));var router=express[_0xea49('0x3')]();var fs_extra=require(_0xea49('0x4'));var auth=require(_0xea49('0x5'));var interaction=require(_0xea49('0x6'));var config=require(_0xea49('0x7'));var controller=require(_0xea49('0x8'));router[_0xea49('0x9')]('/',auth[_0xea49('0xa')](),controller[_0xea49('0xb')]);router[_0xea49('0x9')](_0xea49('0xc'),auth['isAuthenticated'](),controller[_0xea49('0xd')]);router[_0xea49('0x9')]('/:id/fields',auth[_0xea49('0xa')](),controller[_0xea49('0xe')]);router[_0xea49('0x9')](_0xea49('0xf'),auth['isAuthenticated'](),controller[_0xea49('0x10')]);router[_0xea49('0x9')](_0xea49('0x11'),auth[_0xea49('0xa')](),controller[_0xea49('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xea49('0x13')]);router['put'](_0xea49('0xc'),auth[_0xea49('0xa')](),controller['update']);router[_0xea49('0x14')](_0xea49('0xc'),auth['isAuthenticated'](),controller[_0xea49('0x15')]);module[_0xea49('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index ac9cce2..77ac515 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf9cd=['contact','nothing','BOOLEAN','sequelize','exports','STRING','ENUM','incident','phonecall'];(function(_0x43eaff,_0x5b3aa5){var _0x46fd0a=function(_0x3e0a20){while(--_0x3e0a20){_0x43eaff['push'](_0x43eaff['shift']());}};_0x46fd0a(++_0x5b3aa5);}(_0xf9cd,0x111));var _0xdf9c=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xf9cd[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require(_0xdf9c('0x0'));module[_0xdf9c('0x1')]={'name':{'type':Sequelize[_0xdf9c('0x2')]},'description':{'type':Sequelize[_0xdf9c('0x2')]},'ticketType':{'type':Sequelize[_0xdf9c('0x3')](_0xdf9c('0x4'),_0xdf9c('0x5')),'defaultValue':_0xdf9c('0x4')},'moduleCreate':{'type':Sequelize[_0xdf9c('0x3')](_0xdf9c('0x6'),_0xdf9c('0x7')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xdf9c('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xdf9c('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x45d2=['BOOLEAN','sequelize','STRING','incident','ENUM','contact','nothing'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x45d2,0x174));var _0x245d=function(_0xa643ef,_0x383c1d){_0xa643ef=_0xa643ef-0x0;var _0x19e02a=_0x45d2[_0xa643ef];return _0x19e02a;};'use strict';var Sequelize=require(_0x245d('0x0'));module['exports']={'name':{'type':Sequelize[_0x245d('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x245d('0x2'),'phonecall'),'defaultValue':_0x245d('0x2')},'moduleCreate':{'type':Sequelize[_0x245d('0x3')](_0x245d('0x4'),_0x245d('0x5')),'defaultValue':_0x245d('0x4'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x245d('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index ce3bce8..fe30da6 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ada=['fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','body','catch','Dynamics365Field','getFields','getSubjects','getDescriptions','findOne','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes'];(function(_0xe4bb3d,_0x21e87e){var _0xd9e51=function(_0x1f732b){while(--_0x1f732b){_0xe4bb3d['push'](_0xe4bb3d['shift']());}};_0xd9e51(++_0x21e87e);}(_0x8ada,0x172));var _0xa8ad=function(_0xd4ec0c,_0x2afcd2){_0xd4ec0c=_0xd4ec0c-0x0;var _0x580218=_0x8ada[_0xd4ec0c];return _0x580218;};'use strict';var emlformat=require(_0xa8ad('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa8ad('0x1'));var rp=require(_0xa8ad('0x2'));var moment=require(_0xa8ad('0x3'));var BPromise=require(_0xa8ad('0x4'));var Mustache=require(_0xa8ad('0x5'));var util=require(_0xa8ad('0x6'));var path=require(_0xa8ad('0x7'));var sox=require(_0xa8ad('0x8'));var csv=require(_0xa8ad('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa8ad('0xa'));var squel=require(_0xa8ad('0xb'));var crypto=require(_0xa8ad('0xc'));var jsforce=require(_0xa8ad('0xd'));var deskjs=require(_0xa8ad('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa8ad('0xf'));var Redis=require('ioredis');var authService=require(_0xa8ad('0x10'));var qs=require(_0xa8ad('0x11'));var as=require(_0xa8ad('0x12'));var hardwareService=require(_0xa8ad('0x13'));var logger=require(_0xa8ad('0x14'))(_0xa8ad('0x15'));var utils=require(_0xa8ad('0x16'));var config=require(_0xa8ad('0x17'));var licenseUtil=require(_0xa8ad('0x18'));var db=require(_0xa8ad('0x19'))['db'];function respondWithStatusCode(_0x88c2c8,_0x9de49a){_0x9de49a=_0x9de49a||0xcc;return function(_0x309b7c){if(_0x309b7c){return _0x88c2c8[_0xa8ad('0x1a')](_0x9de49a);}return _0x88c2c8[_0xa8ad('0x1b')](_0x9de49a)[_0xa8ad('0x1c')]();};}function respondWithResult(_0x31f106,_0x2c76da){_0x2c76da=_0x2c76da||0xc8;return function(_0x1b88a3){if(_0x1b88a3){return _0x31f106['status'](_0x2c76da)[_0xa8ad('0x1d')](_0x1b88a3);}};}function respondWithFilteredResult(_0x2d796c,_0x1e03c3){return function(_0x2ab43e){if(_0x2ab43e){var _0x5282c8=typeof _0x1e03c3[_0xa8ad('0x1e')]===_0xa8ad('0x1f')&&typeof _0x1e03c3[_0xa8ad('0x20')]===_0xa8ad('0x1f');var _0x2d21ca=_0x2ab43e['count'];var _0x267424=_0x5282c8?0x0:_0x1e03c3[_0xa8ad('0x1e')];var _0x2c8a2e=_0x5282c8?_0x2ab43e[_0xa8ad('0x21')]:_0x1e03c3[_0xa8ad('0x1e')]+_0x1e03c3['limit'];var _0x50456b;if(_0x2c8a2e>=_0x2d21ca){_0x2c8a2e=_0x2d21ca;_0x50456b=0xc8;}else{_0x50456b=0xce;}_0x2d796c[_0xa8ad('0x1b')](_0x50456b);return _0x2d796c[_0xa8ad('0x22')]('Content-Range',_0x267424+'-'+_0x2c8a2e+'/'+_0x2d21ca)['json'](_0x2ab43e);}return null;};}function patchUpdates(_0x54a848){return function(_0x52eb38){try{jsonpatch[_0xa8ad('0x23')](_0x52eb38,_0x54a848,!![]);}catch(_0x11d0c2){return BPromise[_0xa8ad('0x24')](_0x11d0c2);}return _0x52eb38[_0xa8ad('0x25')]();};}function saveUpdates(_0x5822c8,_0x11ad5c){return function(_0x2b973a){if(_0x2b973a){return _0x2b973a[_0xa8ad('0x26')](_0x5822c8)[_0xa8ad('0x27')](function(_0x771303){return _0x771303;});}return null;};}function removeEntity(_0x5abda5,_0x32d19c){return function(_0x28b8f8){if(_0x28b8f8){return _0x28b8f8[_0xa8ad('0x28')]()[_0xa8ad('0x27')](function(){_0x5abda5[_0xa8ad('0x1b')](0xcc)[_0xa8ad('0x1c')]();});}};}function handleEntityNotFound(_0x2a99f1,_0x45f8ef){return function(_0x5cccd3){if(!_0x5cccd3){_0x2a99f1[_0xa8ad('0x1a')](0x194);}return _0x5cccd3;};}function handleError(_0x2a36dc,_0x1493aa){_0x1493aa=_0x1493aa||0x1f4;return function(_0x2545b3){logger[_0xa8ad('0x29')](_0x2545b3[_0xa8ad('0x2a')]);if(_0x2545b3[_0xa8ad('0x2b')]){delete _0x2545b3[_0xa8ad('0x2b')];}_0x2a36dc[_0xa8ad('0x1b')](_0x1493aa)[_0xa8ad('0x2c')](_0x2545b3);};}exports[_0xa8ad('0x2d')]=function(_0x4d1f45,_0x19ba8f){var _0x2a205a={},_0x1be024={},_0x434ffd={'count':0x0,'rows':[]};var _0x1e98e9=_[_0xa8ad('0x2e')](db['Dynamics365Configuration']['rawAttributes'],function(_0x4facf5){return{'name':_0x4facf5[_0xa8ad('0x2f')],'type':_0x4facf5[_0xa8ad('0x30')][_0xa8ad('0x31')]};});_0x1be024[_0xa8ad('0x32')]=_[_0xa8ad('0x2e')](_0x1e98e9,'name');_0x1be024[_0xa8ad('0x33')]=_['keys'](_0x4d1f45[_0xa8ad('0x33')]);_0x1be024[_0xa8ad('0x34')]=_[_0xa8ad('0x35')](_0x1be024[_0xa8ad('0x32')],_0x1be024[_0xa8ad('0x33')]);_0x2a205a[_0xa8ad('0x36')]=_[_0xa8ad('0x35')](_0x1be024['model'],qs[_0xa8ad('0x37')](_0x4d1f45[_0xa8ad('0x33')]['fields']));_0x2a205a['attributes']=_0x2a205a['attributes'][_0xa8ad('0x38')]?_0x2a205a[_0xa8ad('0x36')]:_0x1be024[_0xa8ad('0x32')];if(!_0x4d1f45[_0xa8ad('0x33')][_0xa8ad('0x39')](_0xa8ad('0x3a'))){_0x2a205a['limit']=qs[_0xa8ad('0x20')](_0x4d1f45[_0xa8ad('0x33')][_0xa8ad('0x20')]);_0x2a205a[_0xa8ad('0x1e')]=qs['offset'](_0x4d1f45[_0xa8ad('0x33')][_0xa8ad('0x1e')]);}_0x2a205a[_0xa8ad('0x3b')]=qs[_0xa8ad('0x3c')](_0x4d1f45[_0xa8ad('0x33')][_0xa8ad('0x3c')]);_0x2a205a['where']=qs['filters'](_[_0xa8ad('0x3d')](_0x4d1f45[_0xa8ad('0x33')],_0x1be024[_0xa8ad('0x34')]),_0x1e98e9);if(_0x4d1f45['query'][_0xa8ad('0x3e')]){_0x2a205a[_0xa8ad('0x3f')]=_[_0xa8ad('0x40')](_0x2a205a[_0xa8ad('0x3f')],{'$or':_[_0xa8ad('0x2e')](_0x1e98e9,function(_0x5af870){if(_0x5af870[_0xa8ad('0x30')]!==_0xa8ad('0x41')){var _0x42e2b5={};_0x42e2b5[_0x5af870[_0xa8ad('0x2b')]]={'$like':'%'+_0x4d1f45['query'][_0xa8ad('0x3e')]+'%'};return _0x42e2b5;}})});}_0x2a205a=_[_0xa8ad('0x40')]({},_0x2a205a,_0x4d1f45[_0xa8ad('0x42')]);var _0x3f88ea={'where':_0x2a205a[_0xa8ad('0x3f')]};return db[_0xa8ad('0x43')]['count'](_0x3f88ea)['then'](function(_0x5b3306){_0x434ffd[_0xa8ad('0x21')]=_0x5b3306;if(_0x4d1f45['query'][_0xa8ad('0x44')]){_0x2a205a[_0xa8ad('0x45')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xa8ad('0x46')](_0x2a205a);})['then'](function(_0x2222c6){_0x434ffd[_0xa8ad('0x47')]=_0x2222c6;return _0x434ffd;})[_0xa8ad('0x27')](respondWithFilteredResult(_0x19ba8f,_0x2a205a))['catch'](handleError(_0x19ba8f,null));};exports[_0xa8ad('0x48')]=function(_0x12f6aa,_0x4e5aa1){var _0x15abcd={'raw':![],'where':{'id':_0x12f6aa[_0xa8ad('0x49')]['id']}},_0x4228ad={};_0x4228ad[_0xa8ad('0x32')]=_[_0xa8ad('0x4a')](db[_0xa8ad('0x43')][_0xa8ad('0x4b')]);_0x4228ad[_0xa8ad('0x33')]=_[_0xa8ad('0x4a')](_0x12f6aa['query']);_0x4228ad[_0xa8ad('0x34')]=_[_0xa8ad('0x35')](_0x4228ad[_0xa8ad('0x32')],_0x4228ad[_0xa8ad('0x33')]);_0x15abcd[_0xa8ad('0x36')]=_[_0xa8ad('0x35')](_0x4228ad[_0xa8ad('0x32')],qs[_0xa8ad('0x37')](_0x12f6aa[_0xa8ad('0x33')]['fields']));_0x15abcd[_0xa8ad('0x36')]=_0x15abcd['attributes'][_0xa8ad('0x38')]?_0x15abcd['attributes']:_0x4228ad[_0xa8ad('0x32')];if(_0x12f6aa[_0xa8ad('0x33')][_0xa8ad('0x44')]){_0x15abcd['include']=[{'all':!![]}];}_0x15abcd=_[_0xa8ad('0x40')]({},_0x15abcd,_0x12f6aa[_0xa8ad('0x42')]);return db[_0xa8ad('0x43')][_0xa8ad('0x4c')](_0x15abcd)[_0xa8ad('0x27')](handleEntityNotFound(_0x4e5aa1,null))[_0xa8ad('0x27')](respondWithResult(_0x4e5aa1,null))['catch'](handleError(_0x4e5aa1,null));};exports[_0xa8ad('0x4d')]=function(_0x5024db,_0x50d33c){return db[_0xa8ad('0x43')][_0xa8ad('0x4d')](_0x5024db[_0xa8ad('0x4e')],{})[_0xa8ad('0x27')](respondWithResult(_0x50d33c,0xc9))[_0xa8ad('0x4f')](handleError(_0x50d33c,null));};exports[_0xa8ad('0x26')]=function(_0x5cc9f5,_0x52a32b){if(_0x5cc9f5['body']['id']){delete _0x5cc9f5[_0xa8ad('0x4e')]['id'];}return db[_0xa8ad('0x43')][_0xa8ad('0x4c')]({'where':{'id':_0x5cc9f5[_0xa8ad('0x49')]['id']}})[_0xa8ad('0x27')](handleEntityNotFound(_0x52a32b,null))['then'](saveUpdates(_0x5cc9f5[_0xa8ad('0x4e')],null))['then'](respondWithResult(_0x52a32b,null))[_0xa8ad('0x4f')](handleError(_0x52a32b,null));};exports['destroy']=function(_0x39a4f0,_0x4ce801){return db[_0xa8ad('0x43')]['find']({'where':{'id':_0x39a4f0['params']['id']}})[_0xa8ad('0x27')](handleEntityNotFound(_0x4ce801,null))[_0xa8ad('0x27')](removeEntity(_0x4ce801,null))[_0xa8ad('0x4f')](handleError(_0x4ce801,null));};exports['getFields']=function(_0x44b6db,_0xae4d83,_0x57baae){var _0xa66233={};var _0x5626e9={};var _0x43b506;var _0xdd1577;return db[_0xa8ad('0x43')]['findOne']({'where':{'id':_0x44b6db[_0xa8ad('0x49')]['id']}})[_0xa8ad('0x27')](handleEntityNotFound(_0xae4d83,null))[_0xa8ad('0x27')](function(_0x1d03bf){if(_0x1d03bf){_0x43b506=_0x1d03bf;_0x5626e9['model']=_['keys'](db[_0xa8ad('0x50')][_0xa8ad('0x4b')]);_0x5626e9[_0xa8ad('0x33')]=_[_0xa8ad('0x4a')](_0x44b6db[_0xa8ad('0x33')]);_0x5626e9['filters']=_[_0xa8ad('0x35')](_0x5626e9[_0xa8ad('0x32')],_0x5626e9[_0xa8ad('0x33')]);_0xa66233[_0xa8ad('0x36')]=_[_0xa8ad('0x35')](_0x5626e9[_0xa8ad('0x32')],qs['fields'](_0x44b6db['query'][_0xa8ad('0x37')]));_0xa66233[_0xa8ad('0x36')]=_0xa66233[_0xa8ad('0x36')][_0xa8ad('0x38')]?_0xa66233['attributes']:_0x5626e9[_0xa8ad('0x32')];_0xa66233['order']=qs[_0xa8ad('0x3c')](_0x44b6db[_0xa8ad('0x33')][_0xa8ad('0x3c')]);_0xa66233['where']=qs[_0xa8ad('0x34')](_[_0xa8ad('0x3d')](_0x44b6db[_0xa8ad('0x33')],_0x5626e9[_0xa8ad('0x34')]));if(_0x44b6db[_0xa8ad('0x33')][_0xa8ad('0x3e')]){_0xa66233[_0xa8ad('0x3f')]=_[_0xa8ad('0x40')](_0xa66233[_0xa8ad('0x3f')],{'$or':_[_0xa8ad('0x2e')](_0xa66233[_0xa8ad('0x36')],function(_0x1f04d9){var _0x37023a={};_0x37023a[_0x1f04d9]={'$like':'%'+_0x44b6db[_0xa8ad('0x33')][_0xa8ad('0x3e')]+'%'};return _0x37023a;})});}_0xa66233=_[_0xa8ad('0x40')]({},_0xa66233,_0x44b6db[_0xa8ad('0x42')]);return _0x43b506[_0xa8ad('0x51')](_0xa66233);}})[_0xa8ad('0x27')](function(_0x33c807){if(_0x33c807){_0xdd1577=_0x33c807['length'];if(!_0x44b6db['query']['hasOwnProperty'](_0xa8ad('0x3a'))){_0xa66233[_0xa8ad('0x20')]=qs[_0xa8ad('0x20')](_0x44b6db[_0xa8ad('0x33')][_0xa8ad('0x20')]);_0xa66233[_0xa8ad('0x1e')]=qs[_0xa8ad('0x1e')](_0x44b6db['query'][_0xa8ad('0x1e')]);}return _0x43b506[_0xa8ad('0x51')](_0xa66233);}})[_0xa8ad('0x27')](function(_0x2f9f2){if(_0x2f9f2){return _0x2f9f2?{'count':_0xdd1577,'rows':_0x2f9f2}:null;}})[_0xa8ad('0x27')](respondWithResult(_0xae4d83,null))['catch'](handleError(_0xae4d83,null));};exports[_0xa8ad('0x52')]=function(_0x313074,_0xaeda5c,_0x21a75b){var _0x474632={};var _0x32f615={};var _0x42ed15;var _0x5856e6;return db[_0xa8ad('0x43')]['findOne']({'where':{'id':_0x313074[_0xa8ad('0x49')]['id']}})[_0xa8ad('0x27')](handleEntityNotFound(_0xaeda5c,null))['then'](function(_0x38920b){if(_0x38920b){_0x42ed15=_0x38920b;_0x32f615[_0xa8ad('0x32')]=_[_0xa8ad('0x4a')](db[_0xa8ad('0x50')][_0xa8ad('0x4b')]);_0x32f615[_0xa8ad('0x33')]=_[_0xa8ad('0x4a')](_0x313074[_0xa8ad('0x33')]);_0x32f615['filters']=_[_0xa8ad('0x35')](_0x32f615[_0xa8ad('0x32')],_0x32f615['query']);_0x474632['attributes']=_[_0xa8ad('0x35')](_0x32f615[_0xa8ad('0x32')],qs[_0xa8ad('0x37')](_0x313074[_0xa8ad('0x33')][_0xa8ad('0x37')]));_0x474632[_0xa8ad('0x36')]=_0x474632[_0xa8ad('0x36')][_0xa8ad('0x38')]?_0x474632['attributes']:_0x32f615[_0xa8ad('0x32')];_0x474632[_0xa8ad('0x3b')]=qs[_0xa8ad('0x3c')](_0x313074[_0xa8ad('0x33')][_0xa8ad('0x3c')]);_0x474632[_0xa8ad('0x3f')]=qs[_0xa8ad('0x34')](_['pick'](_0x313074[_0xa8ad('0x33')],_0x32f615[_0xa8ad('0x34')]));if(_0x313074[_0xa8ad('0x33')][_0xa8ad('0x3e')]){_0x474632[_0xa8ad('0x3f')]=_[_0xa8ad('0x40')](_0x474632[_0xa8ad('0x3f')],{'$or':_['map'](_0x474632[_0xa8ad('0x36')],function(_0x5572ef){var _0x4bbb92={};_0x4bbb92[_0x5572ef]={'$like':'%'+_0x313074[_0xa8ad('0x33')][_0xa8ad('0x3e')]+'%'};return _0x4bbb92;})});}_0x474632=_[_0xa8ad('0x40')]({},_0x474632,_0x313074[_0xa8ad('0x42')]);return _0x42ed15[_0xa8ad('0x52')](_0x474632);}})[_0xa8ad('0x27')](function(_0x51aa19){if(_0x51aa19){_0x5856e6=_0x51aa19['length'];if(!_0x313074[_0xa8ad('0x33')]['hasOwnProperty'](_0xa8ad('0x3a'))){_0x474632['limit']=qs[_0xa8ad('0x20')](_0x313074['query'][_0xa8ad('0x20')]);_0x474632[_0xa8ad('0x1e')]=qs['offset'](_0x313074[_0xa8ad('0x33')][_0xa8ad('0x1e')]);}return _0x42ed15['getSubjects'](_0x474632);}})[_0xa8ad('0x27')](function(_0x164294){if(_0x164294){return _0x164294?{'count':_0x5856e6,'rows':_0x164294}:null;}})[_0xa8ad('0x27')](respondWithResult(_0xaeda5c,null))[_0xa8ad('0x4f')](handleError(_0xaeda5c,null));};exports[_0xa8ad('0x53')]=function(_0x442c3e,_0x187453,_0x3e0a3f){var _0x4382d7={};var _0x24f53a={};var _0x3ba7d9;var _0x54f23e;return db[_0xa8ad('0x43')][_0xa8ad('0x54')]({'where':{'id':_0x442c3e[_0xa8ad('0x49')]['id']}})[_0xa8ad('0x27')](handleEntityNotFound(_0x187453,null))['then'](function(_0x399451){if(_0x399451){_0x3ba7d9=_0x399451;_0x24f53a[_0xa8ad('0x32')]=_[_0xa8ad('0x4a')](db['Dynamics365Field']['rawAttributes']);_0x24f53a[_0xa8ad('0x33')]=_[_0xa8ad('0x4a')](_0x442c3e['query']);_0x24f53a[_0xa8ad('0x34')]=_['intersection'](_0x24f53a['model'],_0x24f53a[_0xa8ad('0x33')]);_0x4382d7['attributes']=_[_0xa8ad('0x35')](_0x24f53a[_0xa8ad('0x32')],qs[_0xa8ad('0x37')](_0x442c3e['query'][_0xa8ad('0x37')]));_0x4382d7['attributes']=_0x4382d7['attributes'][_0xa8ad('0x38')]?_0x4382d7[_0xa8ad('0x36')]:_0x24f53a[_0xa8ad('0x32')];_0x4382d7[_0xa8ad('0x3b')]=qs[_0xa8ad('0x3c')](_0x442c3e[_0xa8ad('0x33')]['sort']);_0x4382d7['where']=qs['filters'](_[_0xa8ad('0x3d')](_0x442c3e[_0xa8ad('0x33')],_0x24f53a['filters']));if(_0x442c3e['query'][_0xa8ad('0x3e')]){_0x4382d7['where']=_[_0xa8ad('0x40')](_0x4382d7[_0xa8ad('0x3f')],{'$or':_[_0xa8ad('0x2e')](_0x4382d7[_0xa8ad('0x36')],function(_0x6c2f45){var _0x4dab09={};_0x4dab09[_0x6c2f45]={'$like':'%'+_0x442c3e[_0xa8ad('0x33')]['filter']+'%'};return _0x4dab09;})});}_0x4382d7=_[_0xa8ad('0x40')]({},_0x4382d7,_0x442c3e['options']);return _0x3ba7d9[_0xa8ad('0x53')](_0x4382d7);}})[_0xa8ad('0x27')](function(_0x1534a6){if(_0x1534a6){_0x54f23e=_0x1534a6['length'];if(!_0x442c3e[_0xa8ad('0x33')]['hasOwnProperty'](_0xa8ad('0x3a'))){_0x4382d7['limit']=qs[_0xa8ad('0x20')](_0x442c3e[_0xa8ad('0x33')][_0xa8ad('0x20')]);_0x4382d7[_0xa8ad('0x1e')]=qs[_0xa8ad('0x1e')](_0x442c3e[_0xa8ad('0x33')]['offset']);}return _0x3ba7d9[_0xa8ad('0x53')](_0x4382d7);}})[_0xa8ad('0x27')](function(_0x2ed3de){if(_0x2ed3de){return _0x2ed3de?{'count':_0x54f23e,'rows':_0x2ed3de}:null;}})[_0xa8ad('0x27')](respondWithResult(_0x187453,null))['catch'](handleError(_0x187453,null));}; \ No newline at end of file +var _0x7ef3=['fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','getFields','findOne','pick','getSubjects','Dynamics365Field','getDescriptions','eml-format','rimraf'];(function(_0x3b7305,_0x2dee39){var _0x1ba615=function(_0x2a4708){while(--_0x2a4708){_0x3b7305['push'](_0x3b7305['shift']());}};_0x1ba615(++_0x2dee39);}(_0x7ef3,0x146));var _0x37ef=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x7ef3[_0x32f7d7];return _0x133d09;};'use strict';var emlformat=require(_0x37ef('0x0'));var rimraf=require(_0x37ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x37ef('0x2'));var rp=require('request-promise');var moment=require(_0x37ef('0x3'));var BPromise=require(_0x37ef('0x4'));var Mustache=require('mustache');var util=require(_0x37ef('0x5'));var path=require(_0x37ef('0x6'));var sox=require(_0x37ef('0x7'));var csv=require(_0x37ef('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x37ef('0x9'));var _=require(_0x37ef('0xa'));var squel=require(_0x37ef('0xb'));var crypto=require(_0x37ef('0xc'));var jsforce=require(_0x37ef('0xd'));var deskjs=require(_0x37ef('0xe'));var toCsv=require(_0x37ef('0x8'));var querystring=require(_0x37ef('0xf'));var Papa=require(_0x37ef('0x10'));var Redis=require(_0x37ef('0x11'));var authService=require(_0x37ef('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x37ef('0x13'));var hardwareService=require(_0x37ef('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x37ef('0x15'));var config=require(_0x37ef('0x16'));var licenseUtil=require(_0x37ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c0ae7,_0x5ce742){_0x5ce742=_0x5ce742||0xcc;return function(_0x583c5d){if(_0x583c5d){return _0x4c0ae7['sendStatus'](_0x5ce742);}return _0x4c0ae7['status'](_0x5ce742)[_0x37ef('0x18')]();};}function respondWithResult(_0x58d122,_0xddd978){_0xddd978=_0xddd978||0xc8;return function(_0x3c1d94){if(_0x3c1d94){return _0x58d122['status'](_0xddd978)['json'](_0x3c1d94);}};}function respondWithFilteredResult(_0x4cd265,_0x141b53){return function(_0x4682a0){if(_0x4682a0){var _0x466613=typeof _0x141b53['offset']===_0x37ef('0x19')&&typeof _0x141b53[_0x37ef('0x1a')]===_0x37ef('0x19');var _0x54e32e=_0x4682a0[_0x37ef('0x1b')];var _0x40ea6a=_0x466613?0x0:_0x141b53[_0x37ef('0x1c')];var _0x3c16e3=_0x466613?_0x4682a0[_0x37ef('0x1b')]:_0x141b53['offset']+_0x141b53[_0x37ef('0x1a')];var _0x21b930;if(_0x3c16e3>=_0x54e32e){_0x3c16e3=_0x54e32e;_0x21b930=0xc8;}else{_0x21b930=0xce;}_0x4cd265[_0x37ef('0x1d')](_0x21b930);return _0x4cd265[_0x37ef('0x1e')](_0x37ef('0x1f'),_0x40ea6a+'-'+_0x3c16e3+'/'+_0x54e32e)[_0x37ef('0x20')](_0x4682a0);}return null;};}function patchUpdates(_0xc507e7){return function(_0x57e33b){try{jsonpatch[_0x37ef('0x21')](_0x57e33b,_0xc507e7,!![]);}catch(_0x5c7230){return BPromise[_0x37ef('0x22')](_0x5c7230);}return _0x57e33b[_0x37ef('0x23')]();};}function saveUpdates(_0x398951,_0x27ff44){return function(_0x475044){if(_0x475044){return _0x475044[_0x37ef('0x24')](_0x398951)[_0x37ef('0x25')](function(_0x252686){return _0x252686;});}return null;};}function removeEntity(_0x5ef87f,_0x36b971){return function(_0x251931){if(_0x251931){return _0x251931[_0x37ef('0x26')]()[_0x37ef('0x25')](function(){_0x5ef87f['status'](0xcc)[_0x37ef('0x18')]();});}};}function handleEntityNotFound(_0x402437,_0x46e215){return function(_0x524bdb){if(!_0x524bdb){_0x402437[_0x37ef('0x27')](0x194);}return _0x524bdb;};}function handleError(_0x970fa2,_0x1e769d){_0x1e769d=_0x1e769d||0x1f4;return function(_0x24d64d){logger[_0x37ef('0x28')](_0x24d64d[_0x37ef('0x29')]);if(_0x24d64d[_0x37ef('0x2a')]){delete _0x24d64d[_0x37ef('0x2a')];}_0x970fa2[_0x37ef('0x1d')](_0x1e769d)[_0x37ef('0x2b')](_0x24d64d);};}exports['index']=function(_0x8d05c0,_0x503906){var _0xe32d75={},_0xf84d88={},_0x12165c={'count':0x0,'rows':[]};var _0x46502d=_[_0x37ef('0x2c')](db[_0x37ef('0x2d')][_0x37ef('0x2e')],function(_0x7cd7c3){return{'name':_0x7cd7c3[_0x37ef('0x2f')],'type':_0x7cd7c3[_0x37ef('0x30')][_0x37ef('0x31')]};});_0xf84d88[_0x37ef('0x32')]=_[_0x37ef('0x2c')](_0x46502d,_0x37ef('0x2a'));_0xf84d88[_0x37ef('0x33')]=_[_0x37ef('0x34')](_0x8d05c0[_0x37ef('0x33')]);_0xf84d88[_0x37ef('0x35')]=_[_0x37ef('0x36')](_0xf84d88['model'],_0xf84d88[_0x37ef('0x33')]);_0xe32d75[_0x37ef('0x37')]=_[_0x37ef('0x36')](_0xf84d88[_0x37ef('0x32')],qs[_0x37ef('0x38')](_0x8d05c0['query']['fields']));_0xe32d75[_0x37ef('0x37')]=_0xe32d75[_0x37ef('0x37')][_0x37ef('0x39')]?_0xe32d75[_0x37ef('0x37')]:_0xf84d88[_0x37ef('0x32')];if(!_0x8d05c0['query'][_0x37ef('0x3a')](_0x37ef('0x3b'))){_0xe32d75[_0x37ef('0x1a')]=qs[_0x37ef('0x1a')](_0x8d05c0[_0x37ef('0x33')]['limit']);_0xe32d75[_0x37ef('0x1c')]=qs[_0x37ef('0x1c')](_0x8d05c0[_0x37ef('0x33')][_0x37ef('0x1c')]);}_0xe32d75[_0x37ef('0x3c')]=qs['sort'](_0x8d05c0['query'][_0x37ef('0x3d')]);_0xe32d75[_0x37ef('0x3e')]=qs[_0x37ef('0x35')](_['pick'](_0x8d05c0[_0x37ef('0x33')],_0xf84d88[_0x37ef('0x35')]),_0x46502d);if(_0x8d05c0[_0x37ef('0x33')][_0x37ef('0x3f')]){_0xe32d75[_0x37ef('0x3e')]=_[_0x37ef('0x40')](_0xe32d75['where'],{'$or':_['map'](_0x46502d,function(_0x71244f){if(_0x71244f['type']!==_0x37ef('0x41')){var _0x48066f={};_0x48066f[_0x71244f[_0x37ef('0x2a')]]={'$like':'%'+_0x8d05c0[_0x37ef('0x33')][_0x37ef('0x3f')]+'%'};return _0x48066f;}})});}_0xe32d75=_[_0x37ef('0x40')]({},_0xe32d75,_0x8d05c0[_0x37ef('0x42')]);var _0x39009d={'where':_0xe32d75[_0x37ef('0x3e')]};return db['Dynamics365Configuration'][_0x37ef('0x1b')](_0x39009d)[_0x37ef('0x25')](function(_0x1978dd){_0x12165c[_0x37ef('0x1b')]=_0x1978dd;if(_0x8d05c0['query'][_0x37ef('0x43')]){_0xe32d75[_0x37ef('0x44')]=[{'all':!![]}];}return db[_0x37ef('0x2d')][_0x37ef('0x45')](_0xe32d75);})[_0x37ef('0x25')](function(_0x4cb6b1){_0x12165c[_0x37ef('0x46')]=_0x4cb6b1;return _0x12165c;})[_0x37ef('0x25')](respondWithFilteredResult(_0x503906,_0xe32d75))['catch'](handleError(_0x503906,null));};exports['show']=function(_0x353abe,_0x441fdd){var _0x39ac5c={'raw':![],'where':{'id':_0x353abe[_0x37ef('0x47')]['id']}},_0x3bb6f4={};_0x3bb6f4[_0x37ef('0x32')]=_['keys'](db['Dynamics365Configuration']['rawAttributes']);_0x3bb6f4[_0x37ef('0x33')]=_[_0x37ef('0x34')](_0x353abe[_0x37ef('0x33')]);_0x3bb6f4['filters']=_[_0x37ef('0x36')](_0x3bb6f4[_0x37ef('0x32')],_0x3bb6f4[_0x37ef('0x33')]);_0x39ac5c[_0x37ef('0x37')]=_['intersection'](_0x3bb6f4[_0x37ef('0x32')],qs[_0x37ef('0x38')](_0x353abe[_0x37ef('0x33')][_0x37ef('0x38')]));_0x39ac5c[_0x37ef('0x37')]=_0x39ac5c[_0x37ef('0x37')]['length']?_0x39ac5c['attributes']:_0x3bb6f4[_0x37ef('0x32')];if(_0x353abe[_0x37ef('0x33')][_0x37ef('0x43')]){_0x39ac5c['include']=[{'all':!![]}];}_0x39ac5c=_[_0x37ef('0x40')]({},_0x39ac5c,_0x353abe[_0x37ef('0x42')]);return db['Dynamics365Configuration'][_0x37ef('0x48')](_0x39ac5c)[_0x37ef('0x25')](handleEntityNotFound(_0x441fdd,null))[_0x37ef('0x25')](respondWithResult(_0x441fdd,null))[_0x37ef('0x49')](handleError(_0x441fdd,null));};exports[_0x37ef('0x4a')]=function(_0x3dd27c,_0x2a77ec){return db['Dynamics365Configuration'][_0x37ef('0x4a')](_0x3dd27c[_0x37ef('0x4b')],{})[_0x37ef('0x25')](respondWithResult(_0x2a77ec,0xc9))['catch'](handleError(_0x2a77ec,null));};exports[_0x37ef('0x24')]=function(_0x355f5d,_0x535999){if(_0x355f5d[_0x37ef('0x4b')]['id']){delete _0x355f5d['body']['id'];}return db[_0x37ef('0x2d')][_0x37ef('0x48')]({'where':{'id':_0x355f5d['params']['id']}})[_0x37ef('0x25')](handleEntityNotFound(_0x535999,null))[_0x37ef('0x25')](saveUpdates(_0x355f5d[_0x37ef('0x4b')],null))[_0x37ef('0x25')](respondWithResult(_0x535999,null))[_0x37ef('0x49')](handleError(_0x535999,null));};exports[_0x37ef('0x26')]=function(_0x3a116c,_0x3e76d3){return db['Dynamics365Configuration']['find']({'where':{'id':_0x3a116c['params']['id']}})['then'](handleEntityNotFound(_0x3e76d3,null))['then'](removeEntity(_0x3e76d3,null))[_0x37ef('0x49')](handleError(_0x3e76d3,null));};exports[_0x37ef('0x4c')]=function(_0x4bec09,_0xddbd3a,_0x3ea3a7){var _0x596e94={};var _0x14eab1={};var _0x4f6115;var _0x479893;return db[_0x37ef('0x2d')][_0x37ef('0x4d')]({'where':{'id':_0x4bec09[_0x37ef('0x47')]['id']}})[_0x37ef('0x25')](handleEntityNotFound(_0xddbd3a,null))[_0x37ef('0x25')](function(_0x5df37e){if(_0x5df37e){_0x4f6115=_0x5df37e;_0x14eab1['model']=_[_0x37ef('0x34')](db['Dynamics365Field'][_0x37ef('0x2e')]);_0x14eab1[_0x37ef('0x33')]=_[_0x37ef('0x34')](_0x4bec09[_0x37ef('0x33')]);_0x14eab1[_0x37ef('0x35')]=_[_0x37ef('0x36')](_0x14eab1[_0x37ef('0x32')],_0x14eab1['query']);_0x596e94[_0x37ef('0x37')]=_[_0x37ef('0x36')](_0x14eab1[_0x37ef('0x32')],qs[_0x37ef('0x38')](_0x4bec09[_0x37ef('0x33')][_0x37ef('0x38')]));_0x596e94[_0x37ef('0x37')]=_0x596e94['attributes'][_0x37ef('0x39')]?_0x596e94[_0x37ef('0x37')]:_0x14eab1[_0x37ef('0x32')];_0x596e94[_0x37ef('0x3c')]=qs['sort'](_0x4bec09[_0x37ef('0x33')][_0x37ef('0x3d')]);_0x596e94[_0x37ef('0x3e')]=qs[_0x37ef('0x35')](_[_0x37ef('0x4e')](_0x4bec09[_0x37ef('0x33')],_0x14eab1[_0x37ef('0x35')]));if(_0x4bec09[_0x37ef('0x33')][_0x37ef('0x3f')]){_0x596e94[_0x37ef('0x3e')]=_['merge'](_0x596e94[_0x37ef('0x3e')],{'$or':_[_0x37ef('0x2c')](_0x596e94[_0x37ef('0x37')],function(_0x85ea44){var _0x1d2ea1={};_0x1d2ea1[_0x85ea44]={'$like':'%'+_0x4bec09[_0x37ef('0x33')][_0x37ef('0x3f')]+'%'};return _0x1d2ea1;})});}_0x596e94=_[_0x37ef('0x40')]({},_0x596e94,_0x4bec09['options']);return _0x4f6115[_0x37ef('0x4c')](_0x596e94);}})[_0x37ef('0x25')](function(_0x49e4eb){if(_0x49e4eb){_0x479893=_0x49e4eb[_0x37ef('0x39')];if(!_0x4bec09[_0x37ef('0x33')][_0x37ef('0x3a')](_0x37ef('0x3b'))){_0x596e94[_0x37ef('0x1a')]=qs['limit'](_0x4bec09[_0x37ef('0x33')]['limit']);_0x596e94['offset']=qs['offset'](_0x4bec09[_0x37ef('0x33')]['offset']);}return _0x4f6115[_0x37ef('0x4c')](_0x596e94);}})[_0x37ef('0x25')](function(_0x181db4){if(_0x181db4){return _0x181db4?{'count':_0x479893,'rows':_0x181db4}:null;}})[_0x37ef('0x25')](respondWithResult(_0xddbd3a,null))['catch'](handleError(_0xddbd3a,null));};exports[_0x37ef('0x4f')]=function(_0x4e5c96,_0x229c42,_0x327512){var _0x123fd1={};var _0x5cbe68={};var _0x580082;var _0x14bfed;return db['Dynamics365Configuration'][_0x37ef('0x4d')]({'where':{'id':_0x4e5c96['params']['id']}})[_0x37ef('0x25')](handleEntityNotFound(_0x229c42,null))[_0x37ef('0x25')](function(_0x3be26d){if(_0x3be26d){_0x580082=_0x3be26d;_0x5cbe68[_0x37ef('0x32')]=_[_0x37ef('0x34')](db[_0x37ef('0x50')][_0x37ef('0x2e')]);_0x5cbe68[_0x37ef('0x33')]=_[_0x37ef('0x34')](_0x4e5c96['query']);_0x5cbe68['filters']=_[_0x37ef('0x36')](_0x5cbe68[_0x37ef('0x32')],_0x5cbe68[_0x37ef('0x33')]);_0x123fd1[_0x37ef('0x37')]=_[_0x37ef('0x36')](_0x5cbe68['model'],qs[_0x37ef('0x38')](_0x4e5c96[_0x37ef('0x33')][_0x37ef('0x38')]));_0x123fd1[_0x37ef('0x37')]=_0x123fd1[_0x37ef('0x37')][_0x37ef('0x39')]?_0x123fd1[_0x37ef('0x37')]:_0x5cbe68['model'];_0x123fd1['order']=qs[_0x37ef('0x3d')](_0x4e5c96[_0x37ef('0x33')][_0x37ef('0x3d')]);_0x123fd1[_0x37ef('0x3e')]=qs[_0x37ef('0x35')](_[_0x37ef('0x4e')](_0x4e5c96[_0x37ef('0x33')],_0x5cbe68[_0x37ef('0x35')]));if(_0x4e5c96['query'][_0x37ef('0x3f')]){_0x123fd1[_0x37ef('0x3e')]=_[_0x37ef('0x40')](_0x123fd1[_0x37ef('0x3e')],{'$or':_[_0x37ef('0x2c')](_0x123fd1['attributes'],function(_0x5baf7d){var _0x569ca6={};_0x569ca6[_0x5baf7d]={'$like':'%'+_0x4e5c96[_0x37ef('0x33')][_0x37ef('0x3f')]+'%'};return _0x569ca6;})});}_0x123fd1=_['merge']({},_0x123fd1,_0x4e5c96[_0x37ef('0x42')]);return _0x580082[_0x37ef('0x4f')](_0x123fd1);}})[_0x37ef('0x25')](function(_0x1eba1f){if(_0x1eba1f){_0x14bfed=_0x1eba1f[_0x37ef('0x39')];if(!_0x4e5c96['query']['hasOwnProperty'](_0x37ef('0x3b'))){_0x123fd1['limit']=qs[_0x37ef('0x1a')](_0x4e5c96[_0x37ef('0x33')]['limit']);_0x123fd1[_0x37ef('0x1c')]=qs[_0x37ef('0x1c')](_0x4e5c96['query'][_0x37ef('0x1c')]);}return _0x580082['getSubjects'](_0x123fd1);}})['then'](function(_0x4d61db){if(_0x4d61db){return _0x4d61db?{'count':_0x14bfed,'rows':_0x4d61db}:null;}})[_0x37ef('0x25')](respondWithResult(_0x229c42,null))['catch'](handleError(_0x229c42,null));};exports[_0x37ef('0x51')]=function(_0x14720c,_0x4c827d,_0x2133cd){var _0x2056cb={};var _0x46488a={};var _0x267ef2;var _0x121b87;return db[_0x37ef('0x2d')][_0x37ef('0x4d')]({'where':{'id':_0x14720c[_0x37ef('0x47')]['id']}})[_0x37ef('0x25')](handleEntityNotFound(_0x4c827d,null))['then'](function(_0x4c99bd){if(_0x4c99bd){_0x267ef2=_0x4c99bd;_0x46488a[_0x37ef('0x32')]=_[_0x37ef('0x34')](db['Dynamics365Field'][_0x37ef('0x2e')]);_0x46488a[_0x37ef('0x33')]=_['keys'](_0x14720c['query']);_0x46488a['filters']=_[_0x37ef('0x36')](_0x46488a[_0x37ef('0x32')],_0x46488a[_0x37ef('0x33')]);_0x2056cb[_0x37ef('0x37')]=_['intersection'](_0x46488a[_0x37ef('0x32')],qs[_0x37ef('0x38')](_0x14720c['query'][_0x37ef('0x38')]));_0x2056cb['attributes']=_0x2056cb['attributes'][_0x37ef('0x39')]?_0x2056cb[_0x37ef('0x37')]:_0x46488a['model'];_0x2056cb['order']=qs[_0x37ef('0x3d')](_0x14720c[_0x37ef('0x33')][_0x37ef('0x3d')]);_0x2056cb[_0x37ef('0x3e')]=qs[_0x37ef('0x35')](_[_0x37ef('0x4e')](_0x14720c[_0x37ef('0x33')],_0x46488a[_0x37ef('0x35')]));if(_0x14720c[_0x37ef('0x33')][_0x37ef('0x3f')]){_0x2056cb[_0x37ef('0x3e')]=_['merge'](_0x2056cb[_0x37ef('0x3e')],{'$or':_[_0x37ef('0x2c')](_0x2056cb[_0x37ef('0x37')],function(_0x61cdab){var _0x46964f={};_0x46964f[_0x61cdab]={'$like':'%'+_0x14720c[_0x37ef('0x33')]['filter']+'%'};return _0x46964f;})});}_0x2056cb=_['merge']({},_0x2056cb,_0x14720c[_0x37ef('0x42')]);return _0x267ef2['getDescriptions'](_0x2056cb);}})['then'](function(_0x53a8d8){if(_0x53a8d8){_0x121b87=_0x53a8d8[_0x37ef('0x39')];if(!_0x14720c[_0x37ef('0x33')][_0x37ef('0x3a')](_0x37ef('0x3b'))){_0x2056cb[_0x37ef('0x1a')]=qs[_0x37ef('0x1a')](_0x14720c[_0x37ef('0x33')][_0x37ef('0x1a')]);_0x2056cb['offset']=qs[_0x37ef('0x1c')](_0x14720c['query'][_0x37ef('0x1c')]);}return _0x267ef2[_0x37ef('0x51')](_0x2056cb);}})[_0x37ef('0x25')](function(_0x35f8f6){if(_0x35f8f6){return _0x35f8f6?{'count':_0x121b87,'rows':_0x35f8f6}:null;}})[_0x37ef('0x25')](respondWithResult(_0x4c827d,null))[_0x37ef('0x49')](handleError(_0x4c827d,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index f04a92a..d126b1b 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['define','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x3b1106,_0x4bd523){var _0x1fbeef=function(_0x2c6889){while(--_0x2c6889){_0x3b1106['push'](_0x3b1106['shift']());}};_0x1fbeef(++_0x4bd523);}(_0x008c,0x188));var _0xc008=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x008c[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54ef=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','lodash','util'];(function(_0x339abd,_0x4e2ee2){var _0x1c3b47=function(_0x56c36c){while(--_0x56c36c){_0x339abd['push'](_0x339abd['shift']());}};_0x1c3b47(++_0x4e2ee2);}(_0x54ef,0x112));var _0xf54e=function(_0x3deb9a,_0x254145){_0x3deb9a=_0x3deb9a-0x0;var _0x30ec92=_0x54ef[_0x3deb9a];return _0x30ec92;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 6168f30..f92087a 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd02c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment'];(function(_0x2b152a,_0x3dd988){var _0x2ad4c7=function(_0x2fa97c){while(--_0x2fa97c){_0x2b152a['push'](_0x2b152a['shift']());}};_0x2ad4c7(++_0x3dd988);}(_0xd02c,0x111));var _0xcd02=function(_0x115610,_0x5bfa9b){_0x115610=_0x115610-0x0;var _0x465985=_0xd02c[_0x115610];return _0x465985;};'use strict';var _=require(_0xcd02('0x0'));var util=require(_0xcd02('0x1'));var moment=require(_0xcd02('0x2'));var BPromise=require(_0xcd02('0x3'));var rs=require(_0xcd02('0x4'));var fs=require('fs');var Redis=require(_0xcd02('0x5'));var db=require(_0xcd02('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd02('0x7'))('rpc');var config=require(_0xcd02('0x8'));var jayson=require(_0xcd02('0x9'));var client=jayson[_0xcd02('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc5051d,_0xe0d69d,_0x1f1138){return new BPromise(function(_0x4c5bb3,_0x556c19){return client[_0xcd02('0xb')](_0xc5051d,_0x1f1138)[_0xcd02('0xc')](function(_0x5a18d9){logger[_0xcd02('0xd')](_0xcd02('0xe'),_0xe0d69d,'request\x20sent');logger[_0xcd02('0xf')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0xe0d69d,'request\x20sent',JSON[_0xcd02('0x10')](_0x5a18d9));if(_0x5a18d9[_0xcd02('0x11')]){if(_0x5a18d9[_0xcd02('0x11')][_0xcd02('0x12')]===0x1f4){logger[_0xcd02('0x11')](_0xcd02('0xe'),_0xe0d69d,_0x5a18d9[_0xcd02('0x11')]['message']);return _0x556c19(_0x5a18d9[_0xcd02('0x11')][_0xcd02('0x13')]);}logger[_0xcd02('0x11')](_0xcd02('0xe'),_0xe0d69d,_0x5a18d9[_0xcd02('0x11')][_0xcd02('0x13')]);return _0x4c5bb3(_0x5a18d9[_0xcd02('0x11')][_0xcd02('0x13')]);}else{logger[_0xcd02('0xd')](_0xcd02('0xe'),_0xe0d69d,_0xcd02('0x14'));_0x4c5bb3(_0x5a18d9[_0xcd02('0x15')]['message']);}})[_0xcd02('0x16')](function(_0x331c27){logger[_0xcd02('0x11')](_0xcd02('0xe'),_0xe0d69d,_0x331c27);_0x556c19(_0x331c27);});});} \ No newline at end of file +var _0x31db=['../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2a4882,_0x4799fa){var _0xd70b74=function(_0x3e92ed){while(--_0x3e92ed){_0x2a4882['push'](_0x2a4882['shift']());}};_0xd70b74(++_0x4799fa);}(_0x31db,0xb7));var _0xb31d=function(_0x4d337e,_0x2f7eed){_0x4d337e=_0x4d337e-0x0;var _0x247963=_0x31db[_0x4d337e];return _0x247963;};'use strict';var _=require(_0xb31d('0x0'));var util=require(_0xb31d('0x1'));var moment=require(_0xb31d('0x2'));var BPromise=require(_0xb31d('0x3'));var rs=require(_0xb31d('0x4'));var fs=require('fs');var Redis=require(_0xb31d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb31d('0x6'));var logger=require(_0xb31d('0x7'))(_0xb31d('0x8'));var config=require(_0xb31d('0x9'));var jayson=require(_0xb31d('0xa'));var client=jayson[_0xb31d('0xb')][_0xb31d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b73b3,_0x5d79fe,_0xe455f3){return new BPromise(function(_0x56f04d,_0x436bbf){return client[_0xb31d('0xd')](_0x3b73b3,_0xe455f3)['then'](function(_0x2a5341){logger[_0xb31d('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5d79fe,_0xb31d('0xf'));logger[_0xb31d('0x10')](_0xb31d('0x11'),_0x5d79fe,_0xb31d('0xf'),JSON[_0xb31d('0x12')](_0x2a5341));if(_0x2a5341[_0xb31d('0x13')]){if(_0x2a5341[_0xb31d('0x13')][_0xb31d('0x14')]===0x1f4){logger[_0xb31d('0x13')](_0xb31d('0x15'),_0x5d79fe,_0x2a5341[_0xb31d('0x13')][_0xb31d('0x16')]);return _0x436bbf(_0x2a5341[_0xb31d('0x13')]['message']);}logger['error'](_0xb31d('0x15'),_0x5d79fe,_0x2a5341[_0xb31d('0x13')][_0xb31d('0x16')]);return _0x56f04d(_0x2a5341[_0xb31d('0x13')][_0xb31d('0x16')]);}else{logger[_0xb31d('0xe')](_0xb31d('0x15'),_0x5d79fe,'request\x20sent');_0x56f04d(_0x2a5341['result'][_0xb31d('0x16')]);}})[_0xb31d('0x17')](function(_0x5ce79f){logger[_0xb31d('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5d79fe,_0x5ce79f);_0x436bbf(_0x5ce79f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 19909a0..fcbc28f 100644 --- a/server/api/intDynamics365Field/index.js +++ b/server/api/intDynamics365Field/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb385=['get','show','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index'];(function(_0x5a5395,_0x5361f6){var _0x4da43d=function(_0x149941){while(--_0x149941){_0x5a5395['push'](_0x5a5395['shift']());}};_0x4da43d(++_0x5361f6);}(_0xb385,0xbd));var _0x5b38=function(_0xc9cf43,_0x36dbd3){_0xc9cf43=_0xc9cf43-0x0;var _0xf14632=_0xb385[_0xc9cf43];return _0xf14632;};'use strict';var multer=require(_0x5b38('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5b38('0x1'));var express=require(_0x5b38('0x2'));var router=express[_0x5b38('0x3')]();var fs_extra=require(_0x5b38('0x4'));var auth=require(_0x5b38('0x5'));var interaction=require(_0x5b38('0x6'));var config=require(_0x5b38('0x7'));var controller=require(_0x5b38('0x8'));router['get']('/',auth[_0x5b38('0x9')](),controller[_0x5b38('0xa')]);router[_0x5b38('0xb')]('/:id',auth[_0x5b38('0x9')](),controller[_0x5b38('0xc')]);router['post']('/',auth[_0x5b38('0x9')](),controller[_0x5b38('0xd')]);router[_0x5b38('0xe')](_0x5b38('0xf'),auth[_0x5b38('0x9')](),controller[_0x5b38('0x10')]);router[_0x5b38('0x11')](_0x5b38('0xf'),auth['isAuthenticated'](),controller[_0x5b38('0x12')]);module[_0x5b38('0x13')]=router; \ No newline at end of file +var _0x9b3c=['create','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','show'];(function(_0x2f5f45,_0xcc19e1){var _0x358883=function(_0x53bd1a){while(--_0x53bd1a){_0x2f5f45['push'](_0x2f5f45['shift']());}};_0x358883(++_0xcc19e1);}(_0x9b3c,0x125));var _0xc9b3=function(_0x59342d,_0xf7e399){_0x59342d=_0x59342d-0x0;var _0x541918=_0x9b3c[_0x59342d];return _0x541918;};'use strict';var multer=require(_0xc9b3('0x0'));var util=require(_0xc9b3('0x1'));var path=require('path');var timeout=require(_0xc9b3('0x2'));var express=require(_0xc9b3('0x3'));var router=express['Router']();var fs_extra=require(_0xc9b3('0x4'));var auth=require(_0xc9b3('0x5'));var interaction=require(_0xc9b3('0x6'));var config=require('../../config/environment');var controller=require(_0xc9b3('0x7'));router['get']('/',auth[_0xc9b3('0x8')](),controller[_0xc9b3('0x9')]);router[_0xc9b3('0xa')](_0xc9b3('0xb'),auth['isAuthenticated'](),controller[_0xc9b3('0xc')]);router['post']('/',auth[_0xc9b3('0x8')](),controller[_0xc9b3('0xd')]);router[_0xc9b3('0xe')](_0xc9b3('0xb'),auth[_0xc9b3('0x8')](),controller['update']);router[_0xc9b3('0xf')](_0xc9b3('0xb'),auth[_0xc9b3('0x8')](),controller[_0xc9b3('0x10')]);module[_0xc9b3('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 59c58ff..a0c7589 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.attributes.js +++ b/server/api/intDynamics365Field/intDynamics365Field.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a79=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN'];(function(_0x132ab2,_0x3920bf){var _0x4d3372=function(_0x64aec1){while(--_0x64aec1){_0x132ab2['push'](_0x132ab2['shift']());}};_0x4d3372(++_0x3920bf);}(_0x1a79,0xf0));var _0x91a7=function(_0x4fd02b,_0x3a2992){_0x4fd02b=_0x4fd02b-0x0;var _0x1b7332=_0x1a79[_0x4fd02b];return _0x1b7332;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x91a7('0x0'),_0x91a7('0x1'),_0x91a7('0x2'),_0x91a7('0x3'),_0x91a7('0x4')),'defaultValue':_0x91a7('0x0')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x91a7('0x5')]},'keyType':{'type':Sequelize[_0x91a7('0x6')]('string',_0x91a7('0x1'),'customVariable')},'keyContent':{'type':Sequelize[_0x91a7('0x5')]},'idField':{'type':Sequelize[_0x91a7('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x91a7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x91a7('0x5')]}}; \ No newline at end of file +var _0x9941=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x34acb2,_0x19ff31){var _0xba48d6=function(_0x3b5395){while(--_0x3b5395){_0x34acb2['push'](_0x34acb2['shift']());}};_0xba48d6(++_0x19ff31);}(_0x9941,0x110));var _0x1994=function(_0x37026f,_0x2df88f){_0x37026f=_0x37026f-0x0;var _0x40cb74=_0x9941[_0x37026f];return _0x40cb74;};'use strict';var Sequelize=require(_0x1994('0x0'));module[_0x1994('0x1')]={'type':{'type':Sequelize[_0x1994('0x2')](_0x1994('0x3'),_0x1994('0x4'),_0x1994('0x5'),_0x1994('0x6'),_0x1994('0x7')),'defaultValue':_0x1994('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1994('0x8')]},'keyType':{'type':Sequelize[_0x1994('0x2')](_0x1994('0x3'),_0x1994('0x4'),_0x1994('0x5'))},'keyContent':{'type':Sequelize[_0x1994('0x8')]},'idField':{'type':Sequelize[_0x1994('0x8')]},'nameField':{'type':Sequelize[_0x1994('0x8')]},'customField':{'type':Sequelize[_0x1994('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1994('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index ffd9d56..4364daa 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.controller.js +++ b/server/api/intDynamics365Field/intDynamics365Field.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d91=['save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','Dynamics365Field','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','squel','crypto','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','apply'];(function(_0x3ed26c,_0xab6b81){var _0x20074a=function(_0xd2a4d5){while(--_0xd2a4d5){_0x3ed26c['push'](_0x3ed26c['shift']());}};_0x20074a(++_0xab6b81);}(_0x9d91,0x75));var _0x19d9=function(_0x1e1610,_0x27f299){_0x1e1610=_0x1e1610-0x0;var _0x4b92de=_0x9d91[_0x1e1610];return _0x4b92de;};'use strict';var emlformat=require(_0x19d9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x19d9('0x1'));var jsonpatch=require(_0x19d9('0x2'));var rp=require(_0x19d9('0x3'));var moment=require(_0x19d9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x19d9('0x5'));var util=require('util');var path=require(_0x19d9('0x6'));var sox=require('sox');var csv=require(_0x19d9('0x7'));var ejs=require(_0x19d9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x19d9('0x9'));var crypto=require(_0x19d9('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x19d9('0x7'));var querystring=require('querystring');var Papa=require(_0x19d9('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x19d9('0xc'));var as=require(_0x19d9('0xd'));var hardwareService=require(_0x19d9('0xe'));var logger=require(_0x19d9('0xf'))(_0x19d9('0x10'));var utils=require(_0x19d9('0x11'));var config=require(_0x19d9('0x12'));var licenseUtil=require(_0x19d9('0x13'));var db=require(_0x19d9('0x14'))['db'];function respondWithStatusCode(_0x16cdac,_0x5cb1f4){_0x5cb1f4=_0x5cb1f4||0xcc;return function(_0x394ac8){if(_0x394ac8){return _0x16cdac[_0x19d9('0x15')](_0x5cb1f4);}return _0x16cdac['status'](_0x5cb1f4)[_0x19d9('0x16')]();};}function respondWithResult(_0x280155,_0x5dd5b4){_0x5dd5b4=_0x5dd5b4||0xc8;return function(_0x29ed1c){if(_0x29ed1c){return _0x280155[_0x19d9('0x17')](_0x5dd5b4)[_0x19d9('0x18')](_0x29ed1c);}};}function respondWithFilteredResult(_0x496e7d,_0x4ee4fc){return function(_0x5ebd54){if(_0x5ebd54){var _0x3ff231=typeof _0x4ee4fc[_0x19d9('0x19')]===_0x19d9('0x1a')&&typeof _0x4ee4fc['limit']==='undefined';var _0x409350=_0x5ebd54[_0x19d9('0x1b')];var _0x18be9b=_0x3ff231?0x0:_0x4ee4fc[_0x19d9('0x19')];var _0x15ad9=_0x3ff231?_0x5ebd54[_0x19d9('0x1b')]:_0x4ee4fc[_0x19d9('0x19')]+_0x4ee4fc['limit'];var _0x1edc44;if(_0x15ad9>=_0x409350){_0x15ad9=_0x409350;_0x1edc44=0xc8;}else{_0x1edc44=0xce;}_0x496e7d['status'](_0x1edc44);return _0x496e7d['set']('Content-Range',_0x18be9b+'-'+_0x15ad9+'/'+_0x409350)[_0x19d9('0x18')](_0x5ebd54);}return null;};}function patchUpdates(_0x25b09c){return function(_0x3f5b42){try{jsonpatch[_0x19d9('0x1c')](_0x3f5b42,_0x25b09c,!![]);}catch(_0x1e5d98){return BPromise['reject'](_0x1e5d98);}return _0x3f5b42[_0x19d9('0x1d')]();};}function saveUpdates(_0x3f1e71,_0x23536c){return function(_0x2d2f37){if(_0x2d2f37){return _0x2d2f37[_0x19d9('0x1e')](_0x3f1e71)[_0x19d9('0x1f')](function(_0x573276){return _0x573276;});}return null;};}function removeEntity(_0x9e9d0a,_0xd4f8b5){return function(_0x562b6c){if(_0x562b6c){return _0x562b6c[_0x19d9('0x20')]()[_0x19d9('0x1f')](function(){_0x9e9d0a[_0x19d9('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c565f,_0x4fe9bd){return function(_0x254c64){if(!_0x254c64){_0x4c565f['sendStatus'](0x194);}return _0x254c64;};}function handleError(_0x214765,_0x26eb55){_0x26eb55=_0x26eb55||0x1f4;return function(_0x4259c6){logger[_0x19d9('0x21')](_0x4259c6[_0x19d9('0x22')]);if(_0x4259c6[_0x19d9('0x23')]){delete _0x4259c6[_0x19d9('0x23')];}_0x214765[_0x19d9('0x17')](_0x26eb55)[_0x19d9('0x24')](_0x4259c6);};}exports[_0x19d9('0x25')]=function(_0x2258d1,_0x234211){var _0x4c0b53={},_0x43c144={},_0x265adf={'count':0x0,'rows':[]};var _0x455df8=_[_0x19d9('0x26')](db['Dynamics365Field'][_0x19d9('0x27')],function(_0x2546f4){return{'name':_0x2546f4[_0x19d9('0x28')],'type':_0x2546f4[_0x19d9('0x29')][_0x19d9('0x2a')]};});_0x43c144['model']=_[_0x19d9('0x26')](_0x455df8,'name');_0x43c144[_0x19d9('0x2b')]=_[_0x19d9('0x2c')](_0x2258d1[_0x19d9('0x2b')]);_0x43c144['filters']=_[_0x19d9('0x2d')](_0x43c144[_0x19d9('0x2e')],_0x43c144[_0x19d9('0x2b')]);_0x4c0b53['attributes']=_[_0x19d9('0x2d')](_0x43c144[_0x19d9('0x2e')],qs['fields'](_0x2258d1[_0x19d9('0x2b')][_0x19d9('0x2f')]));_0x4c0b53[_0x19d9('0x30')]=_0x4c0b53[_0x19d9('0x30')][_0x19d9('0x31')]?_0x4c0b53[_0x19d9('0x30')]:_0x43c144[_0x19d9('0x2e')];if(!_0x2258d1['query'][_0x19d9('0x32')](_0x19d9('0x33'))){_0x4c0b53[_0x19d9('0x34')]=qs[_0x19d9('0x34')](_0x2258d1[_0x19d9('0x2b')][_0x19d9('0x34')]);_0x4c0b53[_0x19d9('0x19')]=qs[_0x19d9('0x19')](_0x2258d1['query'][_0x19d9('0x19')]);}_0x4c0b53[_0x19d9('0x35')]=qs[_0x19d9('0x36')](_0x2258d1[_0x19d9('0x2b')][_0x19d9('0x36')]);_0x4c0b53[_0x19d9('0x37')]=qs[_0x19d9('0x38')](_[_0x19d9('0x39')](_0x2258d1[_0x19d9('0x2b')],_0x43c144[_0x19d9('0x38')]),_0x455df8);if(_0x2258d1[_0x19d9('0x2b')]['filter']){_0x4c0b53[_0x19d9('0x37')]=_['merge'](_0x4c0b53[_0x19d9('0x37')],{'$or':_[_0x19d9('0x26')](_0x455df8,function(_0x338d67){if(_0x338d67[_0x19d9('0x29')]!==_0x19d9('0x3a')){var _0x1dbb86={};_0x1dbb86[_0x338d67['name']]={'$like':'%'+_0x2258d1[_0x19d9('0x2b')][_0x19d9('0x3b')]+'%'};return _0x1dbb86;}})});}_0x4c0b53=_[_0x19d9('0x3c')]({},_0x4c0b53,_0x2258d1[_0x19d9('0x3d')]);var _0x438724={'where':_0x4c0b53[_0x19d9('0x37')]};return db[_0x19d9('0x3e')][_0x19d9('0x1b')](_0x438724)[_0x19d9('0x1f')](function(_0x1b3320){_0x265adf[_0x19d9('0x1b')]=_0x1b3320;if(_0x2258d1[_0x19d9('0x2b')]['includeAll']){_0x4c0b53[_0x19d9('0x3f')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x19d9('0x40')](_0x4c0b53);})[_0x19d9('0x1f')](function(_0xb76123){_0x265adf[_0x19d9('0x41')]=_0xb76123;return _0x265adf;})[_0x19d9('0x1f')](respondWithFilteredResult(_0x234211,_0x4c0b53))[_0x19d9('0x42')](handleError(_0x234211,null));};exports[_0x19d9('0x43')]=function(_0x5c10bf,_0x404dc6){var _0x255d94={'raw':!![],'where':{'id':_0x5c10bf[_0x19d9('0x44')]['id']}},_0x2e81d7={};_0x2e81d7[_0x19d9('0x2e')]=_[_0x19d9('0x2c')](db['Dynamics365Field']['rawAttributes']);_0x2e81d7[_0x19d9('0x2b')]=_[_0x19d9('0x2c')](_0x5c10bf['query']);_0x2e81d7[_0x19d9('0x38')]=_[_0x19d9('0x2d')](_0x2e81d7[_0x19d9('0x2e')],_0x2e81d7[_0x19d9('0x2b')]);_0x255d94[_0x19d9('0x30')]=_[_0x19d9('0x2d')](_0x2e81d7[_0x19d9('0x2e')],qs[_0x19d9('0x2f')](_0x5c10bf[_0x19d9('0x2b')][_0x19d9('0x2f')]));_0x255d94[_0x19d9('0x30')]=_0x255d94[_0x19d9('0x30')][_0x19d9('0x31')]?_0x255d94[_0x19d9('0x30')]:_0x2e81d7[_0x19d9('0x2e')];if(_0x5c10bf[_0x19d9('0x2b')][_0x19d9('0x45')]){_0x255d94['include']=[{'all':!![]}];}_0x255d94=_[_0x19d9('0x3c')]({},_0x255d94,_0x5c10bf[_0x19d9('0x3d')]);return db[_0x19d9('0x3e')][_0x19d9('0x46')](_0x255d94)['then'](handleEntityNotFound(_0x404dc6,null))[_0x19d9('0x1f')](respondWithResult(_0x404dc6,null))[_0x19d9('0x42')](handleError(_0x404dc6,null));};exports[_0x19d9('0x47')]=function(_0x304c23,_0x5100c3){return db['Dynamics365Field'][_0x19d9('0x47')](_0x304c23[_0x19d9('0x48')],{})[_0x19d9('0x1f')](respondWithResult(_0x5100c3,0xc9))[_0x19d9('0x42')](handleError(_0x5100c3,null));};exports['update']=function(_0x3b6781,_0x271a98){if(_0x3b6781[_0x19d9('0x48')]['id']){delete _0x3b6781[_0x19d9('0x48')]['id'];}return db[_0x19d9('0x3e')][_0x19d9('0x46')]({'where':{'id':_0x3b6781[_0x19d9('0x44')]['id']}})['then'](handleEntityNotFound(_0x271a98,null))[_0x19d9('0x1f')](saveUpdates(_0x3b6781[_0x19d9('0x48')],null))[_0x19d9('0x1f')](respondWithResult(_0x271a98,null))['catch'](handleError(_0x271a98,null));};exports[_0x19d9('0x20')]=function(_0x55065d,_0x14e58b){return db[_0x19d9('0x3e')][_0x19d9('0x46')]({'where':{'id':_0x55065d[_0x19d9('0x44')]['id']}})[_0x19d9('0x1f')](handleEntityNotFound(_0x14e58b,null))[_0x19d9('0x1f')](removeEntity(_0x14e58b,null))[_0x19d9('0x42')](handleError(_0x14e58b,null));}; \ No newline at end of file +var _0xcf6d=['params','keys','catch','create','body','update','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','Dynamics365Field','includeAll','include','rows','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcf6d,0x17e));var _0xdcf6=function(_0x5177af,_0x448340){_0x5177af=_0x5177af-0x0;var _0x496084=_0xcf6d[_0x5177af];return _0x496084;};'use strict';var emlformat=require(_0xdcf6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdcf6('0x1'));var jsonpatch=require(_0xdcf6('0x2'));var rp=require(_0xdcf6('0x3'));var moment=require(_0xdcf6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdcf6('0x5'));var util=require(_0xdcf6('0x6'));var path=require(_0xdcf6('0x7'));var sox=require(_0xdcf6('0x8'));var csv=require('to-csv');var ejs=require(_0xdcf6('0x9'));var fs=require('fs');var fs_extra=require(_0xdcf6('0xa'));var _=require(_0xdcf6('0xb'));var squel=require(_0xdcf6('0xc'));var crypto=require(_0xdcf6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdcf6('0xe'));var toCsv=require(_0xdcf6('0xf'));var querystring=require(_0xdcf6('0x10'));var Papa=require(_0xdcf6('0x11'));var Redis=require(_0xdcf6('0x12'));var authService=require(_0xdcf6('0x13'));var qs=require(_0xdcf6('0x14'));var as=require(_0xdcf6('0x15'));var hardwareService=require(_0xdcf6('0x16'));var logger=require(_0xdcf6('0x17'))(_0xdcf6('0x18'));var utils=require(_0xdcf6('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdcf6('0x1a'))['db'];function respondWithStatusCode(_0x5aa528,_0x1e3805){_0x1e3805=_0x1e3805||0xcc;return function(_0x29ce37){if(_0x29ce37){return _0x5aa528[_0xdcf6('0x1b')](_0x1e3805);}return _0x5aa528[_0xdcf6('0x1c')](_0x1e3805)[_0xdcf6('0x1d')]();};}function respondWithResult(_0x4ddd64,_0x27a95a){_0x27a95a=_0x27a95a||0xc8;return function(_0x352ec8){if(_0x352ec8){return _0x4ddd64[_0xdcf6('0x1c')](_0x27a95a)[_0xdcf6('0x1e')](_0x352ec8);}};}function respondWithFilteredResult(_0x115f6d,_0x2bb78a){return function(_0x338301){if(_0x338301){var _0x2df24a=typeof _0x2bb78a[_0xdcf6('0x1f')]==='undefined'&&typeof _0x2bb78a[_0xdcf6('0x20')]===_0xdcf6('0x21');var _0xfcc0f1=_0x338301[_0xdcf6('0x22')];var _0x3f70eb=_0x2df24a?0x0:_0x2bb78a[_0xdcf6('0x1f')];var _0x8d26c4=_0x2df24a?_0x338301[_0xdcf6('0x22')]:_0x2bb78a['offset']+_0x2bb78a[_0xdcf6('0x20')];var _0x42735c;if(_0x8d26c4>=_0xfcc0f1){_0x8d26c4=_0xfcc0f1;_0x42735c=0xc8;}else{_0x42735c=0xce;}_0x115f6d['status'](_0x42735c);return _0x115f6d[_0xdcf6('0x23')](_0xdcf6('0x24'),_0x3f70eb+'-'+_0x8d26c4+'/'+_0xfcc0f1)['json'](_0x338301);}return null;};}function patchUpdates(_0x917744){return function(_0x1d7f96){try{jsonpatch[_0xdcf6('0x25')](_0x1d7f96,_0x917744,!![]);}catch(_0x9b33c1){return BPromise[_0xdcf6('0x26')](_0x9b33c1);}return _0x1d7f96[_0xdcf6('0x27')]();};}function saveUpdates(_0x470e4c,_0x1bd91b){return function(_0x5be9e4){if(_0x5be9e4){return _0x5be9e4['update'](_0x470e4c)[_0xdcf6('0x28')](function(_0x27da11){return _0x27da11;});}return null;};}function removeEntity(_0x268372,_0x1b783a){return function(_0x411125){if(_0x411125){return _0x411125[_0xdcf6('0x29')]()['then'](function(){_0x268372[_0xdcf6('0x1c')](0xcc)[_0xdcf6('0x1d')]();});}};}function handleEntityNotFound(_0x4f8e19,_0x3f405c){return function(_0x3dff2e){if(!_0x3dff2e){_0x4f8e19[_0xdcf6('0x1b')](0x194);}return _0x3dff2e;};}function handleError(_0x5e149a,_0x5fa24d){_0x5fa24d=_0x5fa24d||0x1f4;return function(_0x5725a0){logger[_0xdcf6('0x2a')](_0x5725a0[_0xdcf6('0x2b')]);if(_0x5725a0[_0xdcf6('0x2c')]){delete _0x5725a0[_0xdcf6('0x2c')];}_0x5e149a[_0xdcf6('0x1c')](_0x5fa24d)['send'](_0x5725a0);};}exports[_0xdcf6('0x2d')]=function(_0x5268d2,_0x89dc72){var _0x544210={},_0x3c8882={},_0x294016={'count':0x0,'rows':[]};var _0x5d92af=_[_0xdcf6('0x2e')](db['Dynamics365Field'][_0xdcf6('0x2f')],function(_0x70b62f){return{'name':_0x70b62f['fieldName'],'type':_0x70b62f[_0xdcf6('0x30')][_0xdcf6('0x31')]};});_0x3c8882[_0xdcf6('0x32')]=_[_0xdcf6('0x2e')](_0x5d92af,_0xdcf6('0x2c'));_0x3c8882[_0xdcf6('0x33')]=_['keys'](_0x5268d2[_0xdcf6('0x33')]);_0x3c8882[_0xdcf6('0x34')]=_['intersection'](_0x3c8882[_0xdcf6('0x32')],_0x3c8882['query']);_0x544210[_0xdcf6('0x35')]=_[_0xdcf6('0x36')](_0x3c8882[_0xdcf6('0x32')],qs[_0xdcf6('0x37')](_0x5268d2[_0xdcf6('0x33')]['fields']));_0x544210[_0xdcf6('0x35')]=_0x544210['attributes']['length']?_0x544210['attributes']:_0x3c8882[_0xdcf6('0x32')];if(!_0x5268d2[_0xdcf6('0x33')]['hasOwnProperty'](_0xdcf6('0x38'))){_0x544210[_0xdcf6('0x20')]=qs[_0xdcf6('0x20')](_0x5268d2[_0xdcf6('0x33')]['limit']);_0x544210[_0xdcf6('0x1f')]=qs[_0xdcf6('0x1f')](_0x5268d2['query'][_0xdcf6('0x1f')]);}_0x544210[_0xdcf6('0x39')]=qs[_0xdcf6('0x3a')](_0x5268d2[_0xdcf6('0x33')][_0xdcf6('0x3a')]);_0x544210[_0xdcf6('0x3b')]=qs[_0xdcf6('0x34')](_[_0xdcf6('0x3c')](_0x5268d2['query'],_0x3c8882[_0xdcf6('0x34')]),_0x5d92af);if(_0x5268d2[_0xdcf6('0x33')][_0xdcf6('0x3d')]){_0x544210[_0xdcf6('0x3b')]=_[_0xdcf6('0x3e')](_0x544210[_0xdcf6('0x3b')],{'$or':_[_0xdcf6('0x2e')](_0x5d92af,function(_0x4c835a){if(_0x4c835a[_0xdcf6('0x30')]!=='VIRTUAL'){var _0x20d4f1={};_0x20d4f1[_0x4c835a['name']]={'$like':'%'+_0x5268d2['query'][_0xdcf6('0x3d')]+'%'};return _0x20d4f1;}})});}_0x544210=_[_0xdcf6('0x3e')]({},_0x544210,_0x5268d2['options']);var _0x3d5e36={'where':_0x544210['where']};return db[_0xdcf6('0x3f')][_0xdcf6('0x22')](_0x3d5e36)['then'](function(_0x12a9f7){_0x294016[_0xdcf6('0x22')]=_0x12a9f7;if(_0x5268d2['query'][_0xdcf6('0x40')]){_0x544210[_0xdcf6('0x41')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x544210);})[_0xdcf6('0x28')](function(_0x29430c){_0x294016[_0xdcf6('0x42')]=_0x29430c;return _0x294016;})[_0xdcf6('0x28')](respondWithFilteredResult(_0x89dc72,_0x544210))['catch'](handleError(_0x89dc72,null));};exports[_0xdcf6('0x43')]=function(_0x6b1777,_0x4e3b42){var _0x122213={'raw':!![],'where':{'id':_0x6b1777[_0xdcf6('0x44')]['id']}},_0xc7d222={};_0xc7d222[_0xdcf6('0x32')]=_[_0xdcf6('0x45')](db[_0xdcf6('0x3f')]['rawAttributes']);_0xc7d222[_0xdcf6('0x33')]=_[_0xdcf6('0x45')](_0x6b1777[_0xdcf6('0x33')]);_0xc7d222['filters']=_[_0xdcf6('0x36')](_0xc7d222[_0xdcf6('0x32')],_0xc7d222[_0xdcf6('0x33')]);_0x122213['attributes']=_[_0xdcf6('0x36')](_0xc7d222['model'],qs[_0xdcf6('0x37')](_0x6b1777[_0xdcf6('0x33')][_0xdcf6('0x37')]));_0x122213[_0xdcf6('0x35')]=_0x122213[_0xdcf6('0x35')]['length']?_0x122213[_0xdcf6('0x35')]:_0xc7d222[_0xdcf6('0x32')];if(_0x6b1777[_0xdcf6('0x33')][_0xdcf6('0x40')]){_0x122213['include']=[{'all':!![]}];}_0x122213=_[_0xdcf6('0x3e')]({},_0x122213,_0x6b1777['options']);return db[_0xdcf6('0x3f')]['find'](_0x122213)[_0xdcf6('0x28')](handleEntityNotFound(_0x4e3b42,null))[_0xdcf6('0x28')](respondWithResult(_0x4e3b42,null))[_0xdcf6('0x46')](handleError(_0x4e3b42,null));};exports[_0xdcf6('0x47')]=function(_0x10fa86,_0x3580f7){return db['Dynamics365Field'][_0xdcf6('0x47')](_0x10fa86[_0xdcf6('0x48')],{})['then'](respondWithResult(_0x3580f7,0xc9))[_0xdcf6('0x46')](handleError(_0x3580f7,null));};exports[_0xdcf6('0x49')]=function(_0x1fe899,_0xc42009){if(_0x1fe899[_0xdcf6('0x48')]['id']){delete _0x1fe899['body']['id'];}return db[_0xdcf6('0x3f')][_0xdcf6('0x4a')]({'where':{'id':_0x1fe899['params']['id']}})[_0xdcf6('0x28')](handleEntityNotFound(_0xc42009,null))[_0xdcf6('0x28')](saveUpdates(_0x1fe899[_0xdcf6('0x48')],null))[_0xdcf6('0x28')](respondWithResult(_0xc42009,null))['catch'](handleError(_0xc42009,null));};exports[_0xdcf6('0x29')]=function(_0x2993ce,_0x2b71e5){return db[_0xdcf6('0x3f')][_0xdcf6('0x4a')]({'where':{'id':_0x2993ce[_0xdcf6('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b71e5,null))[_0xdcf6('0x28')](removeEntity(_0x2b71e5,null))[_0xdcf6('0x46')](handleError(_0x2b71e5,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 9ae43bf..5a35406 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.model.js +++ b/server/api/intDynamics365Field/intDynamics365Field.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e93=['dynamics365_unique_index','idField','FieldId','util','../../config/logger','bluebird','path','../../config/environment','Dynamics365Field','int_dynamics365_fields'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x6e93,0x1bb));var _0x36e9=function(_0x8a3bf9,_0x21303b){_0x8a3bf9=_0x8a3bf9-0x0;var _0x53aa20=_0x6e93[_0x8a3bf9];return _0x53aa20;};'use strict';var _=require('lodash');var util=require(_0x36e9('0x0'));var logger=require(_0x36e9('0x1'))('api');var moment=require('moment');var BPromise=require(_0x36e9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x36e9('0x3'));var rimraf=require('rimraf');var config=require(_0x36e9('0x4'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x576036,_0x325a9f){return _0x576036['define'](_0x36e9('0x5'),attributes,{'tableName':_0x36e9('0x6'),'paranoid':![],'indexes':[{'name':_0x36e9('0x7'),'fields':[_0x36e9('0x8'),_0x36e9('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd143=['bluebird','path','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','moment'];(function(_0x1ae3ad,_0x2d7c6a){var _0x33d93e=function(_0x47567c){while(--_0x47567c){_0x1ae3ad['push'](_0x1ae3ad['shift']());}};_0x33d93e(++_0x2d7c6a);}(_0xd143,0xc1));var _0x3d14=function(_0xfc3daa,_0x336f83){_0xfc3daa=_0xfc3daa-0x0;var _0x387eaf=_0xd143[_0xfc3daa];return _0x387eaf;};'use strict';var _=require(_0x3d14('0x0'));var util=require(_0x3d14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3d14('0x2'));var BPromise=require(_0x3d14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d14('0x4'));var rimraf=require('rimraf');var config=require(_0x3d14('0x5'));var attributes=require(_0x3d14('0x6'));module[_0x3d14('0x7')]=function(_0x150e96,_0xf4efa3){return _0x150e96[_0x3d14('0x8')](_0x3d14('0x9'),attributes,{'tableName':_0x3d14('0xa'),'paranoid':![],'indexes':[{'name':_0x3d14('0xb'),'fields':[_0x3d14('0xc'),_0x3d14('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index ddc0ccb..2649be4 100644 --- a/server/api/intDynamics365Field/intDynamics365Field.rpc.js +++ b/server/api/intDynamics365Field/intDynamics365Field.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xacc5=['../../config/logger','jayson/promise','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0xacc5,0x19c));var _0x5acc=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xacc5[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x5acc('0x0'));var util=require(_0x5acc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5acc('0x2'));var fs=require('fs');var Redis=require(_0x5acc('0x3'));var db=require(_0x5acc('0x4'))['db'];var utils=require(_0x5acc('0x5'));var logger=require(_0x5acc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5acc('0x7'));var client=jayson['client'][_0x5acc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x35da74,_0x61f8ed,_0x204a05){return new BPromise(function(_0x58495d,_0x392a83){return client[_0x5acc('0x9')](_0x35da74,_0x204a05)['then'](function(_0x294b35){logger[_0x5acc('0xa')](_0x5acc('0xb'),_0x61f8ed,_0x5acc('0xc'));logger[_0x5acc('0xd')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x61f8ed,'request\x20sent',JSON[_0x5acc('0xe')](_0x294b35));if(_0x294b35['error']){if(_0x294b35[_0x5acc('0xf')]['code']===0x1f4){logger['error'](_0x5acc('0xb'),_0x61f8ed,_0x294b35[_0x5acc('0xf')]['message']);return _0x392a83(_0x294b35[_0x5acc('0xf')]['message']);}logger[_0x5acc('0xf')](_0x5acc('0xb'),_0x61f8ed,_0x294b35[_0x5acc('0xf')][_0x5acc('0x10')]);return _0x58495d(_0x294b35[_0x5acc('0xf')][_0x5acc('0x10')]);}else{logger[_0x5acc('0xa')](_0x5acc('0xb'),_0x61f8ed,_0x5acc('0xc'));_0x58495d(_0x294b35[_0x5acc('0x11')][_0x5acc('0x10')]);}})[_0x5acc('0x12')](function(_0x9c8f1f){logger[_0x5acc('0xf')](_0x5acc('0xb'),_0x61f8ed,_0x9c8f1f);_0x392a83(_0x9c8f1f);});});} \ No newline at end of file +var _0xe277=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x1b903c,_0x3e369c){var _0x41b5ed=function(_0x12ee24){while(--_0x12ee24){_0x1b903c['push'](_0x1b903c['shift']());}};_0x41b5ed(++_0x3e369c);}(_0xe277,0xda));var _0x7e27=function(_0x5c5f86,_0x554359){_0x5c5f86=_0x5c5f86-0x0;var _0x1a4979=_0xe277[_0x5c5f86];return _0x1a4979;};'use strict';var _=require(_0x7e27('0x0'));var util=require(_0x7e27('0x1'));var moment=require(_0x7e27('0x2'));var BPromise=require(_0x7e27('0x3'));var rs=require(_0x7e27('0x4'));var fs=require('fs');var Redis=require(_0x7e27('0x5'));var db=require(_0x7e27('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7e27('0x7'));var config=require(_0x7e27('0x8'));var jayson=require(_0x7e27('0x9'));var client=jayson[_0x7e27('0xa')][_0x7e27('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e5e6e,_0xfb45ee,_0x37513e){return new BPromise(function(_0x5b7bf5,_0x48cdb7){return client[_0x7e27('0xc')](_0x3e5e6e,_0x37513e)['then'](function(_0x197bc4){logger[_0x7e27('0xd')](_0x7e27('0xe'),_0xfb45ee,_0x7e27('0xf'));logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0xfb45ee,_0x7e27('0xf'),JSON[_0x7e27('0x10')](_0x197bc4));if(_0x197bc4['error']){if(_0x197bc4[_0x7e27('0x11')][_0x7e27('0x12')]===0x1f4){logger['error'](_0x7e27('0xe'),_0xfb45ee,_0x197bc4[_0x7e27('0x11')][_0x7e27('0x13')]);return _0x48cdb7(_0x197bc4[_0x7e27('0x11')][_0x7e27('0x13')]);}logger[_0x7e27('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0xfb45ee,_0x197bc4[_0x7e27('0x11')][_0x7e27('0x13')]);return _0x5b7bf5(_0x197bc4[_0x7e27('0x11')]['message']);}else{logger['info'](_0x7e27('0xe'),_0xfb45ee,_0x7e27('0xf'));_0x5b7bf5(_0x197bc4[_0x7e27('0x14')][_0x7e27('0x13')]);}})[_0x7e27('0x15')](function(_0x43cad2){logger[_0x7e27('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0xfb45ee,_0x43cad2);_0x48cdb7(_0x43cad2);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 042115d..7d7fc89 100644 --- a/server/api/intFreshdeskAccount/index.js +++ b/server/api/intFreshdeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ef8=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x48882b,_0x64556){var _0x56ccd6=function(_0x555611){while(--_0x555611){_0x48882b['push'](_0x48882b['shift']());}};_0x56ccd6(++_0x64556);}(_0x5ef8,0x18d));var _0x85ef=function(_0x3c8a35,_0x196fa5){_0x3c8a35=_0x3c8a35-0x0;var _0x1d4bbe=_0x5ef8[_0x3c8a35];return _0x1d4bbe;};'use strict';var multer=require(_0x85ef('0x0'));var util=require(_0x85ef('0x1'));var path=require(_0x85ef('0x2'));var timeout=require(_0x85ef('0x3'));var express=require(_0x85ef('0x4'));var router=express[_0x85ef('0x5')]();var fs_extra=require(_0x85ef('0x6'));var auth=require(_0x85ef('0x7'));var interaction=require(_0x85ef('0x8'));var config=require(_0x85ef('0x9'));var controller=require('./intFreshdeskAccount.controller');router[_0x85ef('0xa')]('/',auth[_0x85ef('0xb')](),controller[_0x85ef('0xc')]);router[_0x85ef('0xa')](_0x85ef('0xd'),auth[_0x85ef('0xb')](),controller[_0x85ef('0xe')]);router[_0x85ef('0xa')](_0x85ef('0xf'),auth['isAuthenticated'](),controller[_0x85ef('0x10')]);router[_0x85ef('0xa')](_0x85ef('0x11'),auth['isAuthenticated'](),controller[_0x85ef('0x12')]);router[_0x85ef('0x13')]('/',auth[_0x85ef('0xb')](),controller[_0x85ef('0x14')]);router[_0x85ef('0x13')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x85ef('0x15')]);router[_0x85ef('0x16')](_0x85ef('0xd'),auth[_0x85ef('0xb')](),controller[_0x85ef('0x17')]);router[_0x85ef('0x18')]('/:id',auth[_0x85ef('0xb')](),controller[_0x85ef('0x19')]);module[_0x85ef('0x1a')]=router; \ No newline at end of file +var _0x492d=['delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','isAuthenticated','index','/:id','get','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','update'];(function(_0x557701,_0x180f95){var _0x4c6d09=function(_0x241b67){while(--_0x241b67){_0x557701['push'](_0x557701['shift']());}};_0x4c6d09(++_0x180f95);}(_0x492d,0x86));var _0xd492=function(_0x1f541c,_0x2c5082){_0x1f541c=_0x1f541c-0x0;var _0xca2018=_0x492d[_0x1f541c];return _0xca2018;};'use strict';var multer=require(_0xd492('0x0'));var util=require(_0xd492('0x1'));var path=require(_0xd492('0x2'));var timeout=require(_0xd492('0x3'));var express=require('express');var router=express[_0xd492('0x4')]();var fs_extra=require(_0xd492('0x5'));var auth=require(_0xd492('0x6'));var interaction=require(_0xd492('0x7'));var config=require('../../config/environment');var controller=require(_0xd492('0x8'));router['get']('/',auth[_0xd492('0x9')](),controller[_0xd492('0xa')]);router['get'](_0xd492('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xd492('0xc')](_0xd492('0xd'),auth[_0xd492('0x9')](),controller[_0xd492('0xe')]);router[_0xd492('0xc')](_0xd492('0xf'),auth['isAuthenticated'](),controller[_0xd492('0x10')]);router['post']('/',auth[_0xd492('0x9')](),controller[_0xd492('0x11')]);router[_0xd492('0x12')]('/:id/configurations',auth[_0xd492('0x9')](),controller['addConfiguration']);router['put'](_0xd492('0xb'),auth[_0xd492('0x9')](),controller[_0xd492('0x13')]);router[_0xd492('0x14')](_0xd492('0xb'),auth[_0xd492('0x9')](),controller[_0xd492('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index d08cb7e..101a786 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1eba=['exports','STRING','remoteUri','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1eba,0x1d7));var _0xa1eb=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x1eba[_0xea8947];return _0x2455e9;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'name':{'type':Sequelize[_0xa1eb('0x2')]},'description':{'type':Sequelize[_0xa1eb('0x2')]},'username':{'type':Sequelize[_0xa1eb('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa1eb('0x2')],'unique':_0xa1eb('0x3')},'serverUrl':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x3de3=['username','remoteUri','sequelize','STRING'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x3de3,0x1ce));var _0x33de=function(_0x558715,_0x1b5439){_0x558715=_0x558715-0x0;var _0x3b050e=_0x3de3[_0x558715];return _0x3b050e;};'use strict';var Sequelize=require(_0x33de('0x0'));module['exports']={'name':{'type':Sequelize[_0x33de('0x1')]},'description':{'type':Sequelize[_0x33de('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x33de('0x2')},'apiKey':{'type':Sequelize[_0x33de('0x1')]},'remoteUri':{'type':Sequelize[_0x33de('0x1')],'unique':_0x33de('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 785870b..bf992a0 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9703=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','pick','merge','where','map','VIRTUAL','filter','options','includeAll','FreshdeskAccount','rows','catch','show','params','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','Basic\x20%s','format','%s:X','toString','base64','subject','priority','group','source','ticket_type','remove','includes','default','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9703,0xdb));var _0x3970=function(_0x1b5727,_0x4c524d){_0x1b5727=_0x1b5727-0x0;var _0x365fce=_0x9703[_0x1b5727];return _0x365fce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3970('0x0'));var jsonpatch=require(_0x3970('0x1'));var rp=require(_0x3970('0x2'));var moment=require('moment');var BPromise=require(_0x3970('0x3'));var Mustache=require('mustache');var util=require(_0x3970('0x4'));var path=require('path');var sox=require(_0x3970('0x5'));var csv=require(_0x3970('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3970('0x7'));var squel=require(_0x3970('0x8'));var crypto=require(_0x3970('0x9'));var jsforce=require(_0x3970('0xa'));var deskjs=require(_0x3970('0xb'));var toCsv=require(_0x3970('0x6'));var querystring=require(_0x3970('0xc'));var Papa=require(_0x3970('0xd'));var Redis=require('ioredis');var authService=require(_0x3970('0xe'));var qs=require(_0x3970('0xf'));var as=require(_0x3970('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3970('0x11'))(_0x3970('0x12'));var utils=require('../../config/utils');var config=require(_0x3970('0x13'));var licenseUtil=require(_0x3970('0x14'));var db=require(_0x3970('0x15'))['db'];var integrations=require(_0x3970('0x16'));function respondWithStatusCode(_0x5920fb,_0x116af8){_0x116af8=_0x116af8||0xcc;return function(_0x41bdee){if(_0x41bdee){return _0x5920fb[_0x3970('0x17')](_0x116af8);}return _0x5920fb[_0x3970('0x18')](_0x116af8)[_0x3970('0x19')]();};}function respondWithResult(_0x1089c0,_0x1dc283){_0x1dc283=_0x1dc283||0xc8;return function(_0x44146a){if(_0x44146a){return _0x1089c0['status'](_0x1dc283)[_0x3970('0x1a')](_0x44146a);}};}function respondWithFilteredResult(_0x176652,_0x4de4ee){return function(_0x21f297){if(_0x21f297){var _0x1340ff=typeof _0x4de4ee['offset']==='undefined'&&typeof _0x4de4ee['limit']===_0x3970('0x1b');var _0x40c731=_0x21f297['count'];var _0x4db273=_0x1340ff?0x0:_0x4de4ee[_0x3970('0x1c')];var _0x476aea=_0x1340ff?_0x21f297[_0x3970('0x1d')]:_0x4de4ee['offset']+_0x4de4ee['limit'];var _0x1c01c9;if(_0x476aea>=_0x40c731){_0x476aea=_0x40c731;_0x1c01c9=0xc8;}else{_0x1c01c9=0xce;}_0x176652[_0x3970('0x18')](_0x1c01c9);return _0x176652[_0x3970('0x1e')](_0x3970('0x1f'),_0x4db273+'-'+_0x476aea+'/'+_0x40c731)[_0x3970('0x1a')](_0x21f297);}return null;};}function patchUpdates(_0x14b28b){return function(_0x4f6e51){try{jsonpatch[_0x3970('0x20')](_0x4f6e51,_0x14b28b,!![]);}catch(_0xe74d8){return BPromise[_0x3970('0x21')](_0xe74d8);}return _0x4f6e51[_0x3970('0x22')]();};}function saveUpdates(_0x2058c5,_0x308370){return function(_0x5435e0){if(_0x5435e0){return _0x5435e0[_0x3970('0x23')](_0x2058c5)['then'](function(_0x20f35b){return _0x20f35b;});}return null;};}function removeEntity(_0x5f3d74,_0xf010ac){return function(_0x4fe9e8){if(_0x4fe9e8){return _0x4fe9e8[_0x3970('0x24')]()[_0x3970('0x25')](function(){_0x5f3d74[_0x3970('0x18')](0xcc)[_0x3970('0x19')]();});}};}function handleEntityNotFound(_0x278042,_0x29a640){return function(_0x47c16c){if(!_0x47c16c){_0x278042[_0x3970('0x17')](0x194);}return _0x47c16c;};}function handleError(_0x3e647f,_0x5a1384){_0x5a1384=_0x5a1384||0x1f4;return function(_0x4c975a){logger[_0x3970('0x26')](_0x4c975a[_0x3970('0x27')]);if(_0x4c975a['name']){delete _0x4c975a[_0x3970('0x28')];}_0x3e647f['status'](_0x5a1384)['send'](_0x4c975a);};}exports['index']=function(_0x2f43b4,_0x25585f){var _0x10792f={},_0x15459f={},_0xe2c34={'count':0x0,'rows':[]};var _0x9d6140=_['map'](db['FreshdeskAccount'][_0x3970('0x29')],function(_0x1a36da){return{'name':_0x1a36da['fieldName'],'type':_0x1a36da[_0x3970('0x2a')][_0x3970('0x2b')]};});_0x15459f[_0x3970('0x2c')]=_['map'](_0x9d6140,'name');_0x15459f['query']=_[_0x3970('0x2d')](_0x2f43b4[_0x3970('0x2e')]);_0x15459f[_0x3970('0x2f')]=_['intersection'](_0x15459f[_0x3970('0x2c')],_0x15459f[_0x3970('0x2e')]);_0x10792f[_0x3970('0x30')]=_[_0x3970('0x31')](_0x15459f[_0x3970('0x2c')],qs[_0x3970('0x32')](_0x2f43b4[_0x3970('0x2e')][_0x3970('0x32')]));_0x10792f[_0x3970('0x30')]=_0x10792f['attributes'][_0x3970('0x33')]?_0x10792f[_0x3970('0x30')]:_0x15459f['model'];if(!_0x2f43b4[_0x3970('0x2e')]['hasOwnProperty'](_0x3970('0x34'))){_0x10792f[_0x3970('0x35')]=qs[_0x3970('0x35')](_0x2f43b4[_0x3970('0x2e')][_0x3970('0x35')]);_0x10792f['offset']=qs[_0x3970('0x1c')](_0x2f43b4[_0x3970('0x2e')]['offset']);}_0x10792f[_0x3970('0x36')]=qs[_0x3970('0x37')](_0x2f43b4[_0x3970('0x2e')][_0x3970('0x37')]);_0x10792f['where']=qs[_0x3970('0x2f')](_[_0x3970('0x38')](_0x2f43b4[_0x3970('0x2e')],_0x15459f[_0x3970('0x2f')]),_0x9d6140);if(_0x2f43b4[_0x3970('0x2e')]['filter']){_0x10792f['where']=_[_0x3970('0x39')](_0x10792f[_0x3970('0x3a')],{'$or':_[_0x3970('0x3b')](_0x9d6140,function(_0x245f8d){if(_0x245f8d['type']!==_0x3970('0x3c')){var _0x3b8d89={};_0x3b8d89[_0x245f8d[_0x3970('0x28')]]={'$like':'%'+_0x2f43b4[_0x3970('0x2e')][_0x3970('0x3d')]+'%'};return _0x3b8d89;}})});}_0x10792f=_[_0x3970('0x39')]({},_0x10792f,_0x2f43b4[_0x3970('0x3e')]);var _0x15f811={'where':_0x10792f['where']};return db['FreshdeskAccount'][_0x3970('0x1d')](_0x15f811)[_0x3970('0x25')](function(_0x487b09){_0xe2c34['count']=_0x487b09;if(_0x2f43b4[_0x3970('0x2e')][_0x3970('0x3f')]){_0x10792f['include']=[{'all':!![]}];}return db[_0x3970('0x40')]['findAll'](_0x10792f);})['then'](function(_0x6c832d){_0xe2c34[_0x3970('0x41')]=_0x6c832d;return _0xe2c34;})[_0x3970('0x25')](respondWithFilteredResult(_0x25585f,_0x10792f))[_0x3970('0x42')](handleError(_0x25585f,null));};exports[_0x3970('0x43')]=function(_0x37352d,_0x2eee6d){var _0x448538={'raw':![],'where':{'id':_0x37352d[_0x3970('0x44')]['id']}},_0xd8cb6f={};_0xd8cb6f[_0x3970('0x2c')]=_['keys'](db['FreshdeskAccount'][_0x3970('0x29')]);_0xd8cb6f[_0x3970('0x2e')]=_[_0x3970('0x2d')](_0x37352d[_0x3970('0x2e')]);_0xd8cb6f['filters']=_[_0x3970('0x31')](_0xd8cb6f['model'],_0xd8cb6f[_0x3970('0x2e')]);_0x448538[_0x3970('0x30')]=_['intersection'](_0xd8cb6f['model'],qs['fields'](_0x37352d['query'][_0x3970('0x32')]));_0x448538[_0x3970('0x30')]=_0x448538['attributes'][_0x3970('0x33')]?_0x448538[_0x3970('0x30')]:_0xd8cb6f['model'];if(_0x37352d[_0x3970('0x2e')][_0x3970('0x3f')]){_0x448538['include']=[{'all':!![]}];}_0x448538=_[_0x3970('0x39')]({},_0x448538,_0x37352d[_0x3970('0x3e')]);return db['FreshdeskAccount'][_0x3970('0x45')](_0x448538)['then'](handleEntityNotFound(_0x2eee6d,null))[_0x3970('0x25')](respondWithResult(_0x2eee6d,null))[_0x3970('0x42')](handleError(_0x2eee6d,null));};exports[_0x3970('0x46')]=function(_0x38f17a,_0x2507b5){return db['FreshdeskAccount']['create'](_0x38f17a['body'],{})[_0x3970('0x25')](respondWithResult(_0x2507b5,0xc9))[_0x3970('0x42')](handleError(_0x2507b5,null));};exports[_0x3970('0x23')]=function(_0x238c4f,_0x16d4e0){if(_0x238c4f[_0x3970('0x47')]['id']){delete _0x238c4f[_0x3970('0x47')]['id'];}return db[_0x3970('0x40')][_0x3970('0x45')]({'where':{'id':_0x238c4f['params']['id']}})[_0x3970('0x25')](handleEntityNotFound(_0x16d4e0,null))[_0x3970('0x25')](saveUpdates(_0x238c4f[_0x3970('0x47')],null))[_0x3970('0x25')](respondWithResult(_0x16d4e0,null))[_0x3970('0x42')](handleError(_0x16d4e0,null));};exports[_0x3970('0x24')]=function(_0x5b2080,_0x5686a4){return db[_0x3970('0x40')][_0x3970('0x45')]({'where':{'id':_0x5b2080[_0x3970('0x44')]['id']}})[_0x3970('0x25')](handleEntityNotFound(_0x5686a4,null))[_0x3970('0x25')](removeEntity(_0x5686a4,null))[_0x3970('0x42')](handleError(_0x5686a4,null));};exports[_0x3970('0x48')]=function(_0x7ac4db,_0x10c640,_0x511b6b){var _0x501881={};var _0x1dd6ba={};var _0x208eff;var _0x1630ec;return db[_0x3970('0x40')][_0x3970('0x49')]({'where':{'id':_0x7ac4db[_0x3970('0x44')]['id']}})[_0x3970('0x25')](handleEntityNotFound(_0x10c640,null))[_0x3970('0x25')](function(_0x5758ff){if(_0x5758ff){_0x208eff=_0x5758ff;_0x1dd6ba[_0x3970('0x2c')]=_['keys'](db[_0x3970('0x4a')][_0x3970('0x29')]);_0x1dd6ba['query']=_[_0x3970('0x2d')](_0x7ac4db['query']);_0x1dd6ba['filters']=_[_0x3970('0x31')](_0x1dd6ba[_0x3970('0x2c')],_0x1dd6ba[_0x3970('0x2e')]);_0x501881[_0x3970('0x30')]=_[_0x3970('0x31')](_0x1dd6ba[_0x3970('0x2c')],qs[_0x3970('0x32')](_0x7ac4db[_0x3970('0x2e')]['fields']));_0x501881['attributes']=_0x501881[_0x3970('0x30')][_0x3970('0x33')]?_0x501881[_0x3970('0x30')]:_0x1dd6ba[_0x3970('0x2c')];_0x501881[_0x3970('0x36')]=qs['sort'](_0x7ac4db[_0x3970('0x2e')][_0x3970('0x37')]);_0x501881['where']=qs[_0x3970('0x2f')](_[_0x3970('0x38')](_0x7ac4db['query'],_0x1dd6ba['filters']));if(_0x7ac4db[_0x3970('0x2e')][_0x3970('0x3d')]){_0x501881[_0x3970('0x3a')]=_[_0x3970('0x39')](_0x501881[_0x3970('0x3a')],{'$or':_[_0x3970('0x3b')](_0x501881[_0x3970('0x30')],function(_0xf94ffa){var _0x4d8cf0={};_0x4d8cf0[_0xf94ffa]={'$like':'%'+_0x7ac4db[_0x3970('0x2e')][_0x3970('0x3d')]+'%'};return _0x4d8cf0;})});}_0x501881=_[_0x3970('0x39')]({},_0x501881,_0x7ac4db['options']);return _0x208eff[_0x3970('0x48')](_0x501881);}})[_0x3970('0x25')](function(_0x5402dc){if(_0x5402dc){_0x1630ec=_0x5402dc[_0x3970('0x33')];if(!_0x7ac4db['query'][_0x3970('0x4b')]('nolimit')){_0x501881[_0x3970('0x35')]=qs[_0x3970('0x35')](_0x7ac4db[_0x3970('0x2e')][_0x3970('0x35')]);_0x501881['offset']=qs[_0x3970('0x1c')](_0x7ac4db[_0x3970('0x2e')][_0x3970('0x1c')]);}return _0x208eff[_0x3970('0x48')](_0x501881);}})[_0x3970('0x25')](function(_0x249764){if(_0x249764){return _0x249764?{'count':_0x1630ec,'rows':_0x249764}:null;}})[_0x3970('0x25')](respondWithResult(_0x10c640,null))[_0x3970('0x42')](handleError(_0x10c640,null));};exports[_0x3970('0x4c')]=function(_0x158e24,_0x21cb6f,_0x25b075){if(_0x158e24[_0x3970('0x47')]['id']){delete _0x158e24[_0x3970('0x47')]['id'];}return db[_0x3970('0x40')]['findOne']({'where':{'id':_0x158e24[_0x3970('0x44')]['id']}})['then'](handleEntityNotFound(_0x21cb6f,null))[_0x3970('0x25')](function(_0x535f69){if(_0x535f69){_0x158e24[_0x3970('0x47')]['AccountId']=_0x535f69['id'];_0x158e24[_0x3970('0x47')][_0x3970('0x4d')]=integrations[_0x3970('0x4e')](_0x158e24[_0x3970('0x47')][_0x3970('0x4f')],_0x158e24[_0x3970('0x47')][_0x3970('0x2a')]);_0x158e24[_0x3970('0x47')][_0x3970('0x50')]=integrations[_0x3970('0x51')](_0x158e24[_0x3970('0x47')][_0x3970('0x4f')],_0x158e24[_0x3970('0x47')][_0x3970('0x2a')]);return db[_0x3970('0x4a')][_0x3970('0x46')](_0x158e24[_0x3970('0x47')],{'include':[{'model':db[_0x3970('0x52')],'as':'Subjects'},{'model':db[_0x3970('0x52')],'as':_0x3970('0x50')}]});}return null;})[_0x3970('0x25')](respondWithResult(_0x21cb6f,null))['catch'](handleError(_0x21cb6f,null));};exports[_0x3970('0x53')]=function(_0x2031cd,_0x4aad39,_0x177bcd){var _0x207708='';return db[_0x3970('0x40')][_0x3970('0x49')]({'where':{'id':_0x2031cd[_0x3970('0x44')]['id']},'attributes':['id',_0x3970('0x54'),_0x3970('0x55')]})[_0x3970('0x25')](handleEntityNotFound(_0x4aad39,null))[_0x3970('0x25')](function(_0x675dce){if(_0x675dce){_0x207708=_0x675dce[_0x3970('0x54')];var _0x42293d=_0x207708[_0x3970('0x56')](-0x1);if(_0x42293d==='/'){_0x207708=_0x207708[_0x3970('0x57')](0x0,_0x207708[_0x3970('0x58')](_0x42293d));}return rp({'method':_0x3970('0x59'),'uri':util['format'](_0x3970('0x5a'),_0x207708,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0x3970('0x5b'),new Buffer(util[_0x3970('0x5c')](_0x3970('0x5d'),_0x675dce['apiKey']))[_0x3970('0x5e')](_0x3970('0x5f')))},'json':!![]});}})[_0x3970('0x25')](function(_0x1f527e){if(_0x1f527e){var _0x127044=['requester',_0x3970('0x60'),'agent','description',_0x3970('0x18'),_0x3970('0x61'),_0x3970('0x62'),_0x3970('0x63'),_0x3970('0x64'),_0x3970('0x62'),'company'];_[_0x3970('0x65')](_0x1f527e,function(_0x2cc6f8){return _0x127044[_0x3970('0x66')](_0x2cc6f8[_0x3970('0x28')])||!_0x2cc6f8[_0x3970('0x67')]&&_0x2cc6f8[_0x3970('0x2a')]!=='custom_text'&&_0x2cc6f8['type']!==_0x3970('0x68');});return{'count':_0x1f527e[_0x3970('0x33')],'rows':_[_0x3970('0x3b')](_0x1f527e,function(_0x31d03d){return{'id':_0x31d03d[_0x3970('0x28')],'name':_0x31d03d[_0x3970('0x69')],'custom':!_0x31d03d[_0x3970('0x67')],'options':_0x31d03d['choices']?_[_0x3970('0x3b')](_0x31d03d[_0x3970('0x6a')],function(_0x3175a3){return{'name':_[_0x3970('0x6b')](_0x3175a3),'value':_0x3175a3};}):[]};})};}})[_0x3970('0x25')](respondWithResult(_0x4aad39,null))['catch'](function(_0x215a48){var _0x3ed52d=_0x2031cd[_0x3970('0x2e')][_0x3970('0x6c')]?0x1f4:_0x215a48[_0x3970('0x6d')]||0x1f4;logger['error'](_0x3970('0x6e'),_0x3970('0x53'),_0x3ed52d,JSON[_0x3970('0x6f')](_0x215a48));delete _0x215a48['name'];if(_0x3ed52d===0x191){_0x3ed52d=0x190;}_0x4aad39[_0x3970('0x18')](_0x3ed52d)['send'](_0x2031cd['query'][_0x3970('0x6c')]?{'message':_0x3970('0x70'),'statusCode':_0x215a48['statusCode']}:_0x215a48);});}; \ No newline at end of file +var _0xe13e=['statusCode','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','catch','params','includeAll','merge','find','create','body','update','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','base64','requester','subject','agent','priority','group','ticket_type','company','remove','includes','default','custom_dropdown','label','choices','test'];(function(_0x3cdf50,_0x3e8eb2){var _0x22d47a=function(_0xdc5336){while(--_0xdc5336){_0x3cdf50['push'](_0x3cdf50['shift']());}};_0x22d47a(++_0x3e8eb2);}(_0xe13e,0xde));var _0xee13=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe13e[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xee13('0x0'));var jsonpatch=require(_0xee13('0x1'));var rp=require(_0xee13('0x2'));var moment=require(_0xee13('0x3'));var BPromise=require(_0xee13('0x4'));var Mustache=require(_0xee13('0x5'));var util=require(_0xee13('0x6'));var path=require(_0xee13('0x7'));var sox=require(_0xee13('0x8'));var csv=require(_0xee13('0x9'));var ejs=require(_0xee13('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee13('0xb'));var squel=require(_0xee13('0xc'));var crypto=require(_0xee13('0xd'));var jsforce=require(_0xee13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xee13('0x9'));var querystring=require(_0xee13('0xf'));var Papa=require(_0xee13('0x10'));var Redis=require(_0xee13('0x11'));var authService=require(_0xee13('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xee13('0x13'));var hardwareService=require(_0xee13('0x14'));var logger=require('../../config/logger')(_0xee13('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee13('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3060d8,_0x43f002){_0x43f002=_0x43f002||0xcc;return function(_0x1bbc15){if(_0x1bbc15){return _0x3060d8[_0xee13('0x17')](_0x43f002);}return _0x3060d8[_0xee13('0x18')](_0x43f002)[_0xee13('0x19')]();};}function respondWithResult(_0x2f7cd3,_0x50fd97){_0x50fd97=_0x50fd97||0xc8;return function(_0x383ca0){if(_0x383ca0){return _0x2f7cd3[_0xee13('0x18')](_0x50fd97)[_0xee13('0x1a')](_0x383ca0);}};}function respondWithFilteredResult(_0x53e5a5,_0x38eb56){return function(_0x6de406){if(_0x6de406){var _0x4cc57c=typeof _0x38eb56[_0xee13('0x1b')]===_0xee13('0x1c')&&typeof _0x38eb56[_0xee13('0x1d')]===_0xee13('0x1c');var _0x2513b2=_0x6de406[_0xee13('0x1e')];var _0xd353d0=_0x4cc57c?0x0:_0x38eb56[_0xee13('0x1b')];var _0x3806b0=_0x4cc57c?_0x6de406[_0xee13('0x1e')]:_0x38eb56['offset']+_0x38eb56[_0xee13('0x1d')];var _0x1ab3f8;if(_0x3806b0>=_0x2513b2){_0x3806b0=_0x2513b2;_0x1ab3f8=0xc8;}else{_0x1ab3f8=0xce;}_0x53e5a5['status'](_0x1ab3f8);return _0x53e5a5[_0xee13('0x1f')]('Content-Range',_0xd353d0+'-'+_0x3806b0+'/'+_0x2513b2)[_0xee13('0x1a')](_0x6de406);}return null;};}function patchUpdates(_0x4a49c0){return function(_0x364769){try{jsonpatch[_0xee13('0x20')](_0x364769,_0x4a49c0,!![]);}catch(_0x51e2d0){return BPromise[_0xee13('0x21')](_0x51e2d0);}return _0x364769[_0xee13('0x22')]();};}function saveUpdates(_0x3f9dfd,_0x3231b0){return function(_0x3d5354){if(_0x3d5354){return _0x3d5354['update'](_0x3f9dfd)[_0xee13('0x23')](function(_0x46bd44){return _0x46bd44;});}return null;};}function removeEntity(_0x4c705c,_0x255ff2){return function(_0x4fe9b8){if(_0x4fe9b8){return _0x4fe9b8[_0xee13('0x24')]()['then'](function(){_0x4c705c['status'](0xcc)[_0xee13('0x19')]();});}};}function handleEntityNotFound(_0x323e1e,_0x49eddd){return function(_0x2b5f64){if(!_0x2b5f64){_0x323e1e[_0xee13('0x17')](0x194);}return _0x2b5f64;};}function handleError(_0x19096f,_0x48b604){_0x48b604=_0x48b604||0x1f4;return function(_0x4aec7a){logger[_0xee13('0x25')](_0x4aec7a[_0xee13('0x26')]);if(_0x4aec7a[_0xee13('0x27')]){delete _0x4aec7a[_0xee13('0x27')];}_0x19096f[_0xee13('0x18')](_0x48b604)[_0xee13('0x28')](_0x4aec7a);};}exports[_0xee13('0x29')]=function(_0x29ddad,_0x28d237){var _0x458e12={},_0x3aeaac={},_0x37f57d={'count':0x0,'rows':[]};var _0x352c4a=_[_0xee13('0x2a')](db[_0xee13('0x2b')][_0xee13('0x2c')],function(_0x4bc1f6){return{'name':_0x4bc1f6['fieldName'],'type':_0x4bc1f6[_0xee13('0x2d')][_0xee13('0x2e')]};});_0x3aeaac[_0xee13('0x2f')]=_[_0xee13('0x2a')](_0x352c4a,'name');_0x3aeaac[_0xee13('0x30')]=_[_0xee13('0x31')](_0x29ddad[_0xee13('0x30')]);_0x3aeaac[_0xee13('0x32')]=_[_0xee13('0x33')](_0x3aeaac[_0xee13('0x2f')],_0x3aeaac[_0xee13('0x30')]);_0x458e12[_0xee13('0x34')]=_[_0xee13('0x33')](_0x3aeaac['model'],qs[_0xee13('0x35')](_0x29ddad['query']['fields']));_0x458e12[_0xee13('0x34')]=_0x458e12['attributes'][_0xee13('0x36')]?_0x458e12['attributes']:_0x3aeaac[_0xee13('0x2f')];if(!_0x29ddad[_0xee13('0x30')][_0xee13('0x37')](_0xee13('0x38'))){_0x458e12[_0xee13('0x1d')]=qs[_0xee13('0x1d')](_0x29ddad[_0xee13('0x30')][_0xee13('0x1d')]);_0x458e12[_0xee13('0x1b')]=qs['offset'](_0x29ddad[_0xee13('0x30')][_0xee13('0x1b')]);}_0x458e12[_0xee13('0x39')]=qs['sort'](_0x29ddad[_0xee13('0x30')][_0xee13('0x3a')]);_0x458e12[_0xee13('0x3b')]=qs[_0xee13('0x32')](_[_0xee13('0x3c')](_0x29ddad[_0xee13('0x30')],_0x3aeaac['filters']),_0x352c4a);if(_0x29ddad[_0xee13('0x30')][_0xee13('0x3d')]){_0x458e12[_0xee13('0x3b')]=_['merge'](_0x458e12[_0xee13('0x3b')],{'$or':_[_0xee13('0x2a')](_0x352c4a,function(_0x54e788){if(_0x54e788[_0xee13('0x2d')]!==_0xee13('0x3e')){var _0x2da61b={};_0x2da61b[_0x54e788[_0xee13('0x27')]]={'$like':'%'+_0x29ddad[_0xee13('0x30')]['filter']+'%'};return _0x2da61b;}})});}_0x458e12=_['merge']({},_0x458e12,_0x29ddad[_0xee13('0x3f')]);var _0x28869e={'where':_0x458e12[_0xee13('0x3b')]};return db[_0xee13('0x2b')][_0xee13('0x1e')](_0x28869e)[_0xee13('0x23')](function(_0x3f5cca){_0x37f57d[_0xee13('0x1e')]=_0x3f5cca;if(_0x29ddad[_0xee13('0x30')]['includeAll']){_0x458e12[_0xee13('0x40')]=[{'all':!![]}];}return db[_0xee13('0x2b')][_0xee13('0x41')](_0x458e12);})[_0xee13('0x23')](function(_0x51ed87){_0x37f57d['rows']=_0x51ed87;return _0x37f57d;})['then'](respondWithFilteredResult(_0x28d237,_0x458e12))[_0xee13('0x42')](handleError(_0x28d237,null));};exports['show']=function(_0x4b5288,_0x16d84a){var _0x4a7ce6={'raw':![],'where':{'id':_0x4b5288[_0xee13('0x43')]['id']}},_0x37cc44={};_0x37cc44[_0xee13('0x2f')]=_['keys'](db[_0xee13('0x2b')][_0xee13('0x2c')]);_0x37cc44['query']=_['keys'](_0x4b5288['query']);_0x37cc44[_0xee13('0x32')]=_['intersection'](_0x37cc44[_0xee13('0x2f')],_0x37cc44[_0xee13('0x30')]);_0x4a7ce6[_0xee13('0x34')]=_[_0xee13('0x33')](_0x37cc44[_0xee13('0x2f')],qs[_0xee13('0x35')](_0x4b5288[_0xee13('0x30')][_0xee13('0x35')]));_0x4a7ce6[_0xee13('0x34')]=_0x4a7ce6[_0xee13('0x34')][_0xee13('0x36')]?_0x4a7ce6[_0xee13('0x34')]:_0x37cc44[_0xee13('0x2f')];if(_0x4b5288[_0xee13('0x30')][_0xee13('0x44')]){_0x4a7ce6[_0xee13('0x40')]=[{'all':!![]}];}_0x4a7ce6=_[_0xee13('0x45')]({},_0x4a7ce6,_0x4b5288[_0xee13('0x3f')]);return db[_0xee13('0x2b')][_0xee13('0x46')](_0x4a7ce6)[_0xee13('0x23')](handleEntityNotFound(_0x16d84a,null))[_0xee13('0x23')](respondWithResult(_0x16d84a,null))[_0xee13('0x42')](handleError(_0x16d84a,null));};exports[_0xee13('0x47')]=function(_0x33676c,_0x313c74){return db['FreshdeskAccount'][_0xee13('0x47')](_0x33676c[_0xee13('0x48')],{})[_0xee13('0x23')](respondWithResult(_0x313c74,0xc9))[_0xee13('0x42')](handleError(_0x313c74,null));};exports[_0xee13('0x49')]=function(_0x587642,_0x599343){if(_0x587642['body']['id']){delete _0x587642[_0xee13('0x48')]['id'];}return db[_0xee13('0x2b')][_0xee13('0x46')]({'where':{'id':_0x587642[_0xee13('0x43')]['id']}})[_0xee13('0x23')](handleEntityNotFound(_0x599343,null))[_0xee13('0x23')](saveUpdates(_0x587642[_0xee13('0x48')],null))['then'](respondWithResult(_0x599343,null))[_0xee13('0x42')](handleError(_0x599343,null));};exports[_0xee13('0x24')]=function(_0x225eda,_0x2d0a07){return db['FreshdeskAccount'][_0xee13('0x46')]({'where':{'id':_0x225eda[_0xee13('0x43')]['id']}})['then'](handleEntityNotFound(_0x2d0a07,null))['then'](removeEntity(_0x2d0a07,null))[_0xee13('0x42')](handleError(_0x2d0a07,null));};exports[_0xee13('0x4a')]=function(_0x37fe13,_0xb1c8d,_0x1d6157){var _0x43d530={};var _0x39bbf1={};var _0x17a8ec;var _0x4b3ea2;return db[_0xee13('0x2b')][_0xee13('0x4b')]({'where':{'id':_0x37fe13[_0xee13('0x43')]['id']}})[_0xee13('0x23')](handleEntityNotFound(_0xb1c8d,null))['then'](function(_0x2d8889){if(_0x2d8889){_0x17a8ec=_0x2d8889;_0x39bbf1['model']=_['keys'](db[_0xee13('0x4c')]['rawAttributes']);_0x39bbf1[_0xee13('0x30')]=_[_0xee13('0x31')](_0x37fe13[_0xee13('0x30')]);_0x39bbf1[_0xee13('0x32')]=_[_0xee13('0x33')](_0x39bbf1['model'],_0x39bbf1[_0xee13('0x30')]);_0x43d530['attributes']=_[_0xee13('0x33')](_0x39bbf1[_0xee13('0x2f')],qs[_0xee13('0x35')](_0x37fe13[_0xee13('0x30')][_0xee13('0x35')]));_0x43d530[_0xee13('0x34')]=_0x43d530[_0xee13('0x34')][_0xee13('0x36')]?_0x43d530['attributes']:_0x39bbf1[_0xee13('0x2f')];_0x43d530[_0xee13('0x39')]=qs['sort'](_0x37fe13[_0xee13('0x30')][_0xee13('0x3a')]);_0x43d530[_0xee13('0x3b')]=qs[_0xee13('0x32')](_['pick'](_0x37fe13[_0xee13('0x30')],_0x39bbf1[_0xee13('0x32')]));if(_0x37fe13[_0xee13('0x30')][_0xee13('0x3d')]){_0x43d530[_0xee13('0x3b')]=_[_0xee13('0x45')](_0x43d530['where'],{'$or':_[_0xee13('0x2a')](_0x43d530['attributes'],function(_0x3409ba){var _0x23ba4b={};_0x23ba4b[_0x3409ba]={'$like':'%'+_0x37fe13['query'][_0xee13('0x3d')]+'%'};return _0x23ba4b;})});}_0x43d530=_[_0xee13('0x45')]({},_0x43d530,_0x37fe13[_0xee13('0x3f')]);return _0x17a8ec['getConfigurations'](_0x43d530);}})[_0xee13('0x23')](function(_0x4ee2e1){if(_0x4ee2e1){_0x4b3ea2=_0x4ee2e1[_0xee13('0x36')];if(!_0x37fe13['query'][_0xee13('0x37')](_0xee13('0x38'))){_0x43d530[_0xee13('0x1d')]=qs[_0xee13('0x1d')](_0x37fe13[_0xee13('0x30')]['limit']);_0x43d530[_0xee13('0x1b')]=qs['offset'](_0x37fe13[_0xee13('0x30')][_0xee13('0x1b')]);}return _0x17a8ec[_0xee13('0x4a')](_0x43d530);}})['then'](function(_0x57e4c8){if(_0x57e4c8){return _0x57e4c8?{'count':_0x4b3ea2,'rows':_0x57e4c8}:null;}})[_0xee13('0x23')](respondWithResult(_0xb1c8d,null))[_0xee13('0x42')](handleError(_0xb1c8d,null));};exports[_0xee13('0x4d')]=function(_0x33eeb1,_0x3453c2,_0x567ab3){if(_0x33eeb1[_0xee13('0x48')]['id']){delete _0x33eeb1['body']['id'];}return db[_0xee13('0x2b')][_0xee13('0x4b')]({'where':{'id':_0x33eeb1[_0xee13('0x43')]['id']}})[_0xee13('0x23')](handleEntityNotFound(_0x3453c2,null))[_0xee13('0x23')](function(_0x25ef35){if(_0x25ef35){_0x33eeb1[_0xee13('0x48')][_0xee13('0x4e')]=_0x25ef35['id'];_0x33eeb1[_0xee13('0x48')][_0xee13('0x4f')]=integrations['getSubjects'](_0x33eeb1[_0xee13('0x48')][_0xee13('0x50')],_0x33eeb1[_0xee13('0x48')][_0xee13('0x2d')]);_0x33eeb1['body'][_0xee13('0x51')]=integrations[_0xee13('0x52')](_0x33eeb1['body']['channel'],_0x33eeb1[_0xee13('0x48')]['type']);return db[_0xee13('0x4c')][_0xee13('0x47')](_0x33eeb1[_0xee13('0x48')],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db[_0xee13('0x53')],'as':_0xee13('0x51')}]});}return null;})[_0xee13('0x23')](respondWithResult(_0x3453c2,null))[_0xee13('0x42')](handleError(_0x3453c2,null));};exports[_0xee13('0x54')]=function(_0x5d0906,_0x16bc95,_0x3f208a){var _0x2cdb7c='';return db[_0xee13('0x2b')][_0xee13('0x4b')]({'where':{'id':_0x5d0906[_0xee13('0x43')]['id']},'attributes':['id',_0xee13('0x55'),_0xee13('0x56')]})[_0xee13('0x23')](handleEntityNotFound(_0x16bc95,null))[_0xee13('0x23')](function(_0x30ae31){if(_0x30ae31){_0x2cdb7c=_0x30ae31['remoteUri'];var _0x576d3c=_0x2cdb7c[_0xee13('0x57')](-0x1);if(_0x576d3c==='/'){_0x2cdb7c=_0x2cdb7c[_0xee13('0x58')](0x0,_0x2cdb7c[_0xee13('0x59')](_0x576d3c));}return rp({'method':'GET','uri':util[_0xee13('0x5a')](_0xee13('0x5b'),_0x2cdb7c,_0xee13('0x5c')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xee13('0x5a')]('%s:X',_0x30ae31[_0xee13('0x56')]))['toString'](_0xee13('0x5d')))},'json':!![]});}})[_0xee13('0x23')](function(_0x534a43){if(_0x534a43){var _0x3dd4c9=[_0xee13('0x5e'),_0xee13('0x5f'),_0xee13('0x60'),'description',_0xee13('0x18'),_0xee13('0x61'),_0xee13('0x62'),'source',_0xee13('0x63'),_0xee13('0x62'),_0xee13('0x64')];_[_0xee13('0x65')](_0x534a43,function(_0x2420d2){return _0x3dd4c9[_0xee13('0x66')](_0x2420d2[_0xee13('0x27')])||!_0x2420d2[_0xee13('0x67')]&&_0x2420d2[_0xee13('0x2d')]!=='custom_text'&&_0x2420d2[_0xee13('0x2d')]!==_0xee13('0x68');});return{'count':_0x534a43[_0xee13('0x36')],'rows':_[_0xee13('0x2a')](_0x534a43,function(_0x5f0200){return{'id':_0x5f0200[_0xee13('0x27')],'name':_0x5f0200[_0xee13('0x69')],'custom':!_0x5f0200[_0xee13('0x67')],'options':_0x5f0200[_0xee13('0x6a')]?_[_0xee13('0x2a')](_0x5f0200['choices'],function(_0x1060e3){return{'name':_['capitalize'](_0x1060e3),'value':_0x1060e3};}):[]};})};}})[_0xee13('0x23')](respondWithResult(_0x16bc95,null))[_0xee13('0x42')](function(_0x828108){var _0x1d7b0e=_0x5d0906['query'][_0xee13('0x6b')]?0x1f4:_0x828108[_0xee13('0x6c')]||0x1f4;logger[_0xee13('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0xee13('0x54'),_0x1d7b0e,JSON['stringify'](_0x828108));delete _0x828108[_0xee13('0x27')];if(_0x1d7b0e===0x191){_0x1d7b0e=0x190;}_0x16bc95[_0xee13('0x18')](_0x1d7b0e)[_0xee13('0x28')](_0x5d0906[_0xee13('0x30')][_0xee13('0x6b')]?{'message':_0xee13('0x6d'),'statusCode':_0x828108[_0xee13('0x6c')]}:_0x828108);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index cabcd56..e637da5 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7043=['./intFreshdeskAccount.attributes','exports','FreshdeskAccount','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x568357,_0x2116db){var _0x57b420=function(_0x38269b){while(--_0x38269b){_0x568357['push'](_0x568357['shift']());}};_0x57b420(++_0x2116db);}(_0x7043,0x153));var _0x3704=function(_0xbfb620,_0xc58de){_0xbfb620=_0xbfb620-0x0;var _0x2a8de9=_0x7043[_0xbfb620];return _0x2a8de9;};'use strict';var _=require(_0x3704('0x0'));var util=require(_0x3704('0x1'));var logger=require(_0x3704('0x2'))(_0x3704('0x3'));var moment=require(_0x3704('0x4'));var BPromise=require('bluebird');var rp=require(_0x3704('0x5'));var fs=require('fs');var path=require(_0x3704('0x6'));var rimraf=require(_0x3704('0x7'));var config=require(_0x3704('0x8'));var attributes=require(_0x3704('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x3704('0xa')]=function(_0x3ed6c8,_0x46cf8a){return _0x3ed6c8['define'](_0x3704('0xb'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc06d=['api','moment','bluebird','request-promise','path','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger'];(function(_0x5005cf,_0x3b726e){var _0x47e44d=function(_0x1521ed){while(--_0x1521ed){_0x5005cf['push'](_0x5005cf['shift']());}};_0x47e44d(++_0x3b726e);}(_0xc06d,0x1d1));var _0xdc06=function(_0x2f9dfc,_0x1b863b){_0x2f9dfc=_0x2f9dfc-0x0;var _0x5dc5f3=_0xc06d[_0x2f9dfc];return _0x5dc5f3;};'use strict';var _=require(_0xdc06('0x0'));var util=require(_0xdc06('0x1'));var logger=require(_0xdc06('0x2'))(_0xdc06('0x3'));var moment=require(_0xdc06('0x4'));var BPromise=require(_0xdc06('0x5'));var rp=require(_0xdc06('0x6'));var fs=require('fs');var path=require(_0xdc06('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xdc06('0x8')]=function(_0x57ccc6,_0xf803c3){return _0x57ccc6[_0xdc06('0x9')](_0xdc06('0xa'),attributes,{'tableName':_0xdc06('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index a8c0072..ef366f4 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedc0=['../../config/logger','../../config/environment','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','attributes','limit','map','include','model','ShowFreshdeskAccount','find','raw','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x43222c,_0xcc1e44){var _0x3dbcfc=function(_0xe9072e){while(--_0xe9072e){_0x43222c['push'](_0x43222c['shift']());}};_0x3dbcfc(++_0xcc1e44);}(_0xedc0,0x12c));var _0x0edc=function(_0x4a2193,_0x312076){_0x4a2193=_0x4a2193-0x0;var _0x634e78=_0xedc0[_0x4a2193];return _0x634e78;};'use strict';var _=require(_0x0edc('0x0'));var util=require('util');var moment=require(_0x0edc('0x1'));var BPromise=require(_0x0edc('0x2'));var rs=require(_0x0edc('0x3'));var fs=require('fs');var Redis=require(_0x0edc('0x4'));var db=require(_0x0edc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0edc('0x6'))('rpc');var config=require(_0x0edc('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0edc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x561102,_0x5f756,_0x27ff01){return new BPromise(function(_0x3f9e3f,_0x21a100){return client[_0x0edc('0x9')](_0x561102,_0x27ff01)[_0x0edc('0xa')](function(_0x587cb1){logger[_0x0edc('0xb')](_0x0edc('0xc'),_0x5f756,_0x0edc('0xd'));logger[_0x0edc('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x5f756,_0x0edc('0xd'),JSON[_0x0edc('0xf')](_0x587cb1));if(_0x587cb1[_0x0edc('0x10')]){if(_0x587cb1[_0x0edc('0x10')][_0x0edc('0x11')]===0x1f4){logger['error'](_0x0edc('0xc'),_0x5f756,_0x587cb1[_0x0edc('0x10')][_0x0edc('0x12')]);return _0x21a100(_0x587cb1['error'][_0x0edc('0x12')]);}logger[_0x0edc('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x5f756,_0x587cb1[_0x0edc('0x10')][_0x0edc('0x12')]);return _0x3f9e3f(_0x587cb1['error']['message']);}else{logger[_0x0edc('0xb')](_0x0edc('0xc'),_0x5f756,_0x0edc('0xd'));_0x3f9e3f(_0x587cb1[_0x0edc('0x13')][_0x0edc('0x12')]);}})[_0x0edc('0x14')](function(_0x27794e){logger[_0x0edc('0x10')](_0x0edc('0xc'),_0x5f756,_0x27794e);_0x21a100(_0x27794e);});});}exports[_0x0edc('0x15')]=function(_0x5446e7){var _0x264c8b=this;return new Promise(function(_0xe232e5,_0xee6a0a){return db[_0x0edc('0x16')][_0x0edc('0x17')]({'raw':_0x5446e7[_0x0edc('0x18')]?_0x5446e7[_0x0edc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5446e7[_0x0edc('0x18')]?_0x5446e7['options']['where']||null:null,'attributes':_0x5446e7[_0x0edc('0x18')]?_0x5446e7['options'][_0x0edc('0x19')]||null:null,'limit':_0x5446e7[_0x0edc('0x18')]?_0x5446e7[_0x0edc('0x18')][_0x0edc('0x1a')]||null:null,'include':_0x5446e7[_0x0edc('0x18')]?_0x5446e7[_0x0edc('0x18')]['include']?_[_0x0edc('0x1b')](_0x5446e7[_0x0edc('0x18')][_0x0edc('0x1c')],function(_0x424ede){return{'model':db[_0x424ede[_0x0edc('0x1d')]],'as':_0x424ede['as'],'attributes':_0x424ede[_0x0edc('0x19')],'include':_0x424ede[_0x0edc('0x1c')]?_[_0x0edc('0x1b')](_0x424ede['include'],function(_0x2708c9){return{'model':db[_0x2708c9[_0x0edc('0x1d')]],'as':_0x2708c9['as'],'attributes':_0x2708c9[_0x0edc('0x19')],'include':_0x2708c9[_0x0edc('0x1c')]?_[_0x0edc('0x1b')](_0x2708c9[_0x0edc('0x1c')],function(_0x24bd32){return{'model':db[_0x24bd32['model']],'as':_0x24bd32['as'],'attributes':_0x24bd32[_0x0edc('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0edc('0xa')](function(_0x2c84bd){logger['info'](_0x0edc('0x15'),_0x5446e7);logger[_0x0edc('0xe')](_0x0edc('0x15'),_0x5446e7,JSON['stringify'](_0x2c84bd));_0xe232e5(_0x2c84bd);})[_0x0edc('0x14')](function(_0x104fb2){logger[_0x0edc('0x10')](_0x0edc('0x15'),_0x104fb2[_0x0edc('0x12')],_0x5446e7);_0xee6a0a(_0x264c8b[_0x0edc('0x10')](0x1f4,_0x104fb2[_0x0edc('0x12')]));});});};exports[_0x0edc('0x1e')]=function(_0x219c7a){var _0x309a5a=this;return new Promise(function(_0x3beef9,_0x2ceb65){return db[_0x0edc('0x16')][_0x0edc('0x1f')]({'raw':_0x219c7a[_0x0edc('0x18')]?_0x219c7a[_0x0edc('0x18')][_0x0edc('0x20')]===undefined?!![]:![]:!![],'where':_0x219c7a[_0x0edc('0x18')]?_0x219c7a[_0x0edc('0x18')][_0x0edc('0x21')]||null:null,'attributes':_0x219c7a[_0x0edc('0x18')]?_0x219c7a[_0x0edc('0x18')][_0x0edc('0x19')]||null:null,'include':_0x219c7a[_0x0edc('0x18')]?_0x219c7a[_0x0edc('0x18')][_0x0edc('0x1c')]?_[_0x0edc('0x1b')](_0x219c7a['options']['include'],function(_0x56c7d3){return{'model':db[_0x56c7d3['model']],'as':_0x56c7d3['as'],'attributes':_0x56c7d3[_0x0edc('0x19')],'include':_0x56c7d3[_0x0edc('0x1c')]?_[_0x0edc('0x1b')](_0x56c7d3[_0x0edc('0x1c')],function(_0x3331c2){return{'model':db[_0x3331c2[_0x0edc('0x1d')]],'as':_0x3331c2['as'],'attributes':_0x3331c2[_0x0edc('0x19')],'include':_0x3331c2[_0x0edc('0x1c')]?_[_0x0edc('0x1b')](_0x3331c2['include'],function(_0x3d7752){return{'model':db[_0x3d7752[_0x0edc('0x1d')]],'as':_0x3d7752['as'],'attributes':_0x3d7752[_0x0edc('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0edc('0xa')](function(_0x18da92){logger[_0x0edc('0xb')](_0x0edc('0x1e'),_0x219c7a);logger[_0x0edc('0xe')](_0x0edc('0x1e'),_0x219c7a,JSON[_0x0edc('0xf')](_0x18da92));_0x3beef9(_0x18da92);})[_0x0edc('0x14')](function(_0x36349b){logger[_0x0edc('0x10')]('ShowFreshdeskAccount',_0x36349b[_0x0edc('0x12')],_0x219c7a);_0x2ceb65(_0x309a5a[_0x0edc('0x10')](0x1f4,_0x36349b[_0x0edc('0x12')]));});});}; \ No newline at end of file +var _0x57f4=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','info','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','limit','include','map','model','ShowFreshdeskAccount','find','raw','util'];(function(_0x2cc388,_0x5caf35){var _0x518aa6=function(_0x4d5090){while(--_0x4d5090){_0x2cc388['push'](_0x2cc388['shift']());}};_0x518aa6(++_0x5caf35);}(_0x57f4,0xcb));var _0x457f=function(_0x1c15ba,_0x241d73){_0x1c15ba=_0x1c15ba-0x0;var _0x5c0e36=_0x57f4[_0x1c15ba];return _0x5c0e36;};'use strict';var _=require('lodash');var util=require(_0x457f('0x0'));var moment=require(_0x457f('0x1'));var BPromise=require(_0x457f('0x2'));var rs=require(_0x457f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x457f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x457f('0x5'))(_0x457f('0x6'));var config=require('../../config/environment');var jayson=require(_0x457f('0x7'));var client=jayson[_0x457f('0x8')][_0x457f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x223501,_0x2521b3,_0x3929e4){return new BPromise(function(_0x3b8300,_0x5f3dce){return client['request'](_0x223501,_0x3929e4)[_0x457f('0xa')](function(_0xb3b688){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x2521b3,_0x457f('0xb'));logger[_0x457f('0xc')](_0x457f('0xd'),_0x2521b3,_0x457f('0xb'),JSON[_0x457f('0xe')](_0xb3b688));if(_0xb3b688[_0x457f('0xf')]){if(_0xb3b688[_0x457f('0xf')][_0x457f('0x10')]===0x1f4){logger[_0x457f('0xf')](_0x457f('0x11'),_0x2521b3,_0xb3b688[_0x457f('0xf')][_0x457f('0x12')]);return _0x5f3dce(_0xb3b688[_0x457f('0xf')][_0x457f('0x12')]);}logger[_0x457f('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x2521b3,_0xb3b688[_0x457f('0xf')][_0x457f('0x12')]);return _0x3b8300(_0xb3b688[_0x457f('0xf')]['message']);}else{logger[_0x457f('0x13')](_0x457f('0x11'),_0x2521b3,'request\x20sent');_0x3b8300(_0xb3b688['result']['message']);}})[_0x457f('0x14')](function(_0x1f4b9b){logger[_0x457f('0xf')](_0x457f('0x11'),_0x2521b3,_0x1f4b9b);_0x5f3dce(_0x1f4b9b);});});}exports[_0x457f('0x15')]=function(_0x1c0320){var _0x433641=this;return new Promise(function(_0x5dd555,_0xac2a2a){return db[_0x457f('0x16')][_0x457f('0x17')]({'raw':_0x1c0320['options']?_0x1c0320[_0x457f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1c0320[_0x457f('0x18')]?_0x1c0320[_0x457f('0x18')][_0x457f('0x19')]||null:null,'attributes':_0x1c0320[_0x457f('0x18')]?_0x1c0320[_0x457f('0x18')][_0x457f('0x1a')]||null:null,'limit':_0x1c0320[_0x457f('0x18')]?_0x1c0320[_0x457f('0x18')][_0x457f('0x1b')]||null:null,'include':_0x1c0320[_0x457f('0x18')]?_0x1c0320['options'][_0x457f('0x1c')]?_[_0x457f('0x1d')](_0x1c0320['options'][_0x457f('0x1c')],function(_0x269f53){return{'model':db[_0x269f53[_0x457f('0x1e')]],'as':_0x269f53['as'],'attributes':_0x269f53[_0x457f('0x1a')],'include':_0x269f53[_0x457f('0x1c')]?_['map'](_0x269f53['include'],function(_0x48b2e4){return{'model':db[_0x48b2e4[_0x457f('0x1e')]],'as':_0x48b2e4['as'],'attributes':_0x48b2e4[_0x457f('0x1a')],'include':_0x48b2e4[_0x457f('0x1c')]?_[_0x457f('0x1d')](_0x48b2e4[_0x457f('0x1c')],function(_0x61959b){return{'model':db[_0x61959b[_0x457f('0x1e')]],'as':_0x61959b['as'],'attributes':_0x61959b[_0x457f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x457f('0xa')](function(_0xf1e867){logger[_0x457f('0x13')](_0x457f('0x15'),_0x1c0320);logger[_0x457f('0xc')](_0x457f('0x15'),_0x1c0320,JSON[_0x457f('0xe')](_0xf1e867));_0x5dd555(_0xf1e867);})[_0x457f('0x14')](function(_0x59836d){logger[_0x457f('0xf')](_0x457f('0x15'),_0x59836d[_0x457f('0x12')],_0x1c0320);_0xac2a2a(_0x433641[_0x457f('0xf')](0x1f4,_0x59836d[_0x457f('0x12')]));});});};exports[_0x457f('0x1f')]=function(_0x1b54ce){var _0x5561aa=this;return new Promise(function(_0x4c1813,_0x21743c){return db[_0x457f('0x16')][_0x457f('0x20')]({'raw':_0x1b54ce[_0x457f('0x18')]?_0x1b54ce[_0x457f('0x18')][_0x457f('0x21')]===undefined?!![]:![]:!![],'where':_0x1b54ce[_0x457f('0x18')]?_0x1b54ce[_0x457f('0x18')]['where']||null:null,'attributes':_0x1b54ce[_0x457f('0x18')]?_0x1b54ce['options'][_0x457f('0x1a')]||null:null,'include':_0x1b54ce[_0x457f('0x18')]?_0x1b54ce[_0x457f('0x18')][_0x457f('0x1c')]?_[_0x457f('0x1d')](_0x1b54ce[_0x457f('0x18')]['include'],function(_0x63fa61){return{'model':db[_0x63fa61['model']],'as':_0x63fa61['as'],'attributes':_0x63fa61[_0x457f('0x1a')],'include':_0x63fa61[_0x457f('0x1c')]?_[_0x457f('0x1d')](_0x63fa61['include'],function(_0x28f63e){return{'model':db[_0x28f63e[_0x457f('0x1e')]],'as':_0x28f63e['as'],'attributes':_0x28f63e[_0x457f('0x1a')],'include':_0x28f63e['include']?_[_0x457f('0x1d')](_0x28f63e['include'],function(_0x55f07e){return{'model':db[_0x55f07e[_0x457f('0x1e')]],'as':_0x55f07e['as'],'attributes':_0x55f07e[_0x457f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x457f('0xa')](function(_0x39183c){logger[_0x457f('0x13')](_0x457f('0x1f'),_0x1b54ce);logger[_0x457f('0xc')](_0x457f('0x1f'),_0x1b54ce,JSON[_0x457f('0xe')](_0x39183c));_0x4c1813(_0x39183c);})['catch'](function(_0x2b7cb6){logger['error']('ShowFreshdeskAccount',_0x2b7cb6[_0x457f('0x12')],_0x1b54ce);_0x21743c(_0x5561aa[_0x457f('0xf')](0x1f4,_0x2b7cb6['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 5d6bacb..d88bf6f 100644 --- a/server/api/intFreshdeskConfiguration/index.js +++ b/server/api/intFreshdeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83be=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/descriptions','getTags','post','create','put'];(function(_0x2d9934,_0x1d52dd){var _0x356d35=function(_0x21584e){while(--_0x21584e){_0x2d9934['push'](_0x2d9934['shift']());}};_0x356d35(++_0x1d52dd);}(_0x83be,0xa5));var _0xe83b=function(_0x5d158b,_0x9431f2){_0x5d158b=_0x5d158b-0x0;var _0x210fbd=_0x83be[_0x5d158b];return _0x210fbd;};'use strict';var multer=require(_0xe83b('0x0'));var util=require('util');var path=require(_0xe83b('0x1'));var timeout=require(_0xe83b('0x2'));var express=require(_0xe83b('0x3'));var router=express[_0xe83b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe83b('0x5'));var config=require(_0xe83b('0x6'));var controller=require(_0xe83b('0x7'));router[_0xe83b('0x8')]('/',auth[_0xe83b('0x9')](),controller[_0xe83b('0xa')]);router[_0xe83b('0x8')](_0xe83b('0xb'),auth[_0xe83b('0x9')](),controller[_0xe83b('0xc')]);router[_0xe83b('0x8')]('/:id/fields',auth[_0xe83b('0x9')](),controller[_0xe83b('0xd')]);router[_0xe83b('0x8')]('/:id/subjects',auth[_0xe83b('0x9')](),controller['getSubjects']);router[_0xe83b('0x8')](_0xe83b('0xe'),auth[_0xe83b('0x9')](),controller['getDescriptions']);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0xe83b('0xf')]);router[_0xe83b('0x10')]('/',auth[_0xe83b('0x9')](),controller[_0xe83b('0x11')]);router[_0xe83b('0x10')]('/:id/tags',auth[_0xe83b('0x9')](),controller['setTags']);router[_0xe83b('0x12')]('/:id',auth[_0xe83b('0x9')](),controller[_0xe83b('0x13')]);router[_0xe83b('0x14')]('/:id',auth[_0xe83b('0x9')](),controller[_0xe83b('0x15')]);module[_0xe83b('0x16')]=router; \ No newline at end of file +var _0xc727=['getDescriptions','/:id/tags','getTags','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects'];(function(_0x18bfbe,_0x2717ae){var _0x158e3c=function(_0x5591e7){while(--_0x5591e7){_0x18bfbe['push'](_0x18bfbe['shift']());}};_0x158e3c(++_0x2717ae);}(_0xc727,0xd2));var _0x7c72=function(_0x34be2d,_0xf863ed){_0x34be2d=_0x34be2d-0x0;var _0x4900e7=_0xc727[_0x34be2d];return _0x4900e7;};'use strict';var multer=require(_0x7c72('0x0'));var util=require(_0x7c72('0x1'));var path=require(_0x7c72('0x2'));var timeout=require(_0x7c72('0x3'));var express=require(_0x7c72('0x4'));var router=express[_0x7c72('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7c72('0x6'));var controller=require(_0x7c72('0x7'));router[_0x7c72('0x8')]('/',auth[_0x7c72('0x9')](),controller[_0x7c72('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7c72('0xb')]);router[_0x7c72('0x8')](_0x7c72('0xc'),auth[_0x7c72('0x9')](),controller['getFields']);router[_0x7c72('0x8')](_0x7c72('0xd'),auth['isAuthenticated'](),controller[_0x7c72('0xe')]);router[_0x7c72('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x7c72('0xf')]);router[_0x7c72('0x8')](_0x7c72('0x10'),auth[_0x7c72('0x9')](),controller[_0x7c72('0x11')]);router[_0x7c72('0x12')]('/',auth[_0x7c72('0x9')](),controller['create']);router[_0x7c72('0x12')](_0x7c72('0x10'),auth['isAuthenticated'](),controller['setTags']);router[_0x7c72('0x13')](_0x7c72('0x14'),auth[_0x7c72('0x9')](),controller[_0x7c72('0x15')]);router[_0x7c72('0x16')](_0x7c72('0x14'),auth[_0x7c72('0x9')](),controller[_0x7c72('0x17')]);module[_0x7c72('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index f4ea821..4b10fb8 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3cf=['sequelize','exports','STRING'];(function(_0x21c601,_0x26f456){var _0xd423f=function(_0x52bc27){while(--_0x52bc27){_0x21c601['push'](_0x21c601['shift']());}};_0xd423f(++_0x26f456);}(_0xc3cf,0x11d));var _0xfc3c=function(_0x2d0dd8,_0xde611e){_0x2d0dd8=_0x2d0dd8-0x0;var _0x543e19=_0xc3cf[_0x2d0dd8];return _0x543e19;};'use strict';var Sequelize=require(_0xfc3c('0x0'));module[_0xfc3c('0x1')]={'name':{'type':Sequelize[_0xfc3c('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4989=['exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4989,0x19e));var _0x9498=function(_0x46cf00,_0x457a43){_0x46cf00=_0x46cf00-0x0;var _0x3974dc=_0x4989[_0x46cf00];return _0x3974dc;};'use strict';var Sequelize=require('sequelize');module[_0x9498('0x0')]={'name':{'type':Sequelize[_0x9498('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 7ebf514..ed891df 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef0b=['request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','findOne','FreshdeskField','getFields','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0xa8d40a,_0x174d0f){var _0x5bd5a6=function(_0x53b363){while(--_0x53b363){_0xa8d40a['push'](_0xa8d40a['shift']());}};_0x5bd5a6(++_0x174d0f);}(_0xef0b,0x107));var _0xbef0=function(_0x2bcdbb,_0x8bcfaf){_0x2bcdbb=_0x2bcdbb-0x0;var _0xcf7bc1=_0xef0b[_0x2bcdbb];return _0xcf7bc1;};'use strict';var emlformat=require(_0xbef0('0x0'));var rimraf=require(_0xbef0('0x1'));var zipdir=require(_0xbef0('0x2'));var jsonpatch=require(_0xbef0('0x3'));var rp=require(_0xbef0('0x4'));var moment=require(_0xbef0('0x5'));var BPromise=require(_0xbef0('0x6'));var Mustache=require(_0xbef0('0x7'));var util=require('util');var path=require(_0xbef0('0x8'));var sox=require(_0xbef0('0x9'));var csv=require(_0xbef0('0xa'));var ejs=require(_0xbef0('0xb'));var fs=require('fs');var fs_extra=require(_0xbef0('0xc'));var _=require(_0xbef0('0xd'));var squel=require(_0xbef0('0xe'));var crypto=require('crypto');var jsforce=require(_0xbef0('0xf'));var deskjs=require(_0xbef0('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbef0('0x11'));var Papa=require(_0xbef0('0x12'));var Redis=require(_0xbef0('0x13'));var authService=require(_0xbef0('0x14'));var qs=require(_0xbef0('0x15'));var as=require(_0xbef0('0x16'));var hardwareService=require(_0xbef0('0x17'));var logger=require(_0xbef0('0x18'))(_0xbef0('0x19'));var utils=require(_0xbef0('0x1a'));var config=require(_0xbef0('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xbef0('0x1c'))['db'];function respondWithStatusCode(_0x15d255,_0x244d54){_0x244d54=_0x244d54||0xcc;return function(_0xe7873e){if(_0xe7873e){return _0x15d255['sendStatus'](_0x244d54);}return _0x15d255[_0xbef0('0x1d')](_0x244d54)[_0xbef0('0x1e')]();};}function respondWithResult(_0x430917,_0x3aeb5e){_0x3aeb5e=_0x3aeb5e||0xc8;return function(_0x18b2c0){if(_0x18b2c0){return _0x430917[_0xbef0('0x1d')](_0x3aeb5e)[_0xbef0('0x1f')](_0x18b2c0);}};}function respondWithFilteredResult(_0x40d0e8,_0x1aedab){return function(_0x52d007){if(_0x52d007){var _0x21252c=typeof _0x1aedab[_0xbef0('0x20')]==='undefined'&&typeof _0x1aedab[_0xbef0('0x21')]===_0xbef0('0x22');var _0x40f5b6=_0x52d007['count'];var _0x24ad33=_0x21252c?0x0:_0x1aedab[_0xbef0('0x20')];var _0x396d57=_0x21252c?_0x52d007[_0xbef0('0x23')]:_0x1aedab[_0xbef0('0x20')]+_0x1aedab['limit'];var _0x5af0de;if(_0x396d57>=_0x40f5b6){_0x396d57=_0x40f5b6;_0x5af0de=0xc8;}else{_0x5af0de=0xce;}_0x40d0e8['status'](_0x5af0de);return _0x40d0e8[_0xbef0('0x24')](_0xbef0('0x25'),_0x24ad33+'-'+_0x396d57+'/'+_0x40f5b6)[_0xbef0('0x1f')](_0x52d007);}return null;};}function patchUpdates(_0x4c3712){return function(_0x3fdcd6){try{jsonpatch['apply'](_0x3fdcd6,_0x4c3712,!![]);}catch(_0x116024){return BPromise[_0xbef0('0x26')](_0x116024);}return _0x3fdcd6[_0xbef0('0x27')]();};}function saveUpdates(_0x332a9a,_0x39ecc0){return function(_0x3ebcb0){if(_0x3ebcb0){return _0x3ebcb0[_0xbef0('0x28')](_0x332a9a)[_0xbef0('0x29')](function(_0x41f8ed){return _0x41f8ed;});}return null;};}function removeEntity(_0x12f8f1,_0x1fc6fc){return function(_0x596108){if(_0x596108){return _0x596108['destroy']()[_0xbef0('0x29')](function(){_0x12f8f1[_0xbef0('0x1d')](0xcc)[_0xbef0('0x1e')]();});}};}function handleEntityNotFound(_0x54b5b5,_0xcfec04){return function(_0x245155){if(!_0x245155){_0x54b5b5['sendStatus'](0x194);}return _0x245155;};}function handleError(_0x5174b5,_0x538bf1){_0x538bf1=_0x538bf1||0x1f4;return function(_0xb1cfa0){logger[_0xbef0('0x2a')](_0xb1cfa0[_0xbef0('0x2b')]);if(_0xb1cfa0[_0xbef0('0x2c')]){delete _0xb1cfa0['name'];}_0x5174b5[_0xbef0('0x1d')](_0x538bf1)[_0xbef0('0x2d')](_0xb1cfa0);};}exports[_0xbef0('0x2e')]=function(_0x519800,_0x3510fa){var _0x34d029={},_0x2fd0d0={},_0x429c39={'count':0x0,'rows':[]};var _0x3166f7=_[_0xbef0('0x2f')](db[_0xbef0('0x30')][_0xbef0('0x31')],function(_0x512955){return{'name':_0x512955[_0xbef0('0x32')],'type':_0x512955[_0xbef0('0x33')][_0xbef0('0x34')]};});_0x2fd0d0[_0xbef0('0x35')]=_[_0xbef0('0x2f')](_0x3166f7,_0xbef0('0x2c'));_0x2fd0d0[_0xbef0('0x36')]=_['keys'](_0x519800[_0xbef0('0x36')]);_0x2fd0d0[_0xbef0('0x37')]=_[_0xbef0('0x38')](_0x2fd0d0[_0xbef0('0x35')],_0x2fd0d0['query']);_0x34d029[_0xbef0('0x39')]=_[_0xbef0('0x38')](_0x2fd0d0['model'],qs[_0xbef0('0x3a')](_0x519800['query']['fields']));_0x34d029['attributes']=_0x34d029[_0xbef0('0x39')][_0xbef0('0x3b')]?_0x34d029[_0xbef0('0x39')]:_0x2fd0d0[_0xbef0('0x35')];if(!_0x519800[_0xbef0('0x36')][_0xbef0('0x3c')]('nolimit')){_0x34d029[_0xbef0('0x21')]=qs[_0xbef0('0x21')](_0x519800[_0xbef0('0x36')][_0xbef0('0x21')]);_0x34d029[_0xbef0('0x20')]=qs['offset'](_0x519800['query'][_0xbef0('0x20')]);}_0x34d029[_0xbef0('0x3d')]=qs[_0xbef0('0x3e')](_0x519800[_0xbef0('0x36')]['sort']);_0x34d029['where']=qs['filters'](_[_0xbef0('0x3f')](_0x519800['query'],_0x2fd0d0['filters']),_0x3166f7);if(_0x519800[_0xbef0('0x36')][_0xbef0('0x40')]){_0x34d029[_0xbef0('0x41')]=_[_0xbef0('0x42')](_0x34d029[_0xbef0('0x41')],{'$or':_['map'](_0x3166f7,function(_0xa2add2){if(_0xa2add2['type']!==_0xbef0('0x43')){var _0x352776={};_0x352776[_0xa2add2[_0xbef0('0x2c')]]={'$like':'%'+_0x519800[_0xbef0('0x36')][_0xbef0('0x40')]+'%'};return _0x352776;}})});}_0x34d029=_[_0xbef0('0x42')]({},_0x34d029,_0x519800[_0xbef0('0x44')]);var _0x57f613={'where':_0x34d029['where']};return db[_0xbef0('0x30')][_0xbef0('0x23')](_0x57f613)[_0xbef0('0x29')](function(_0x254f1f){_0x429c39[_0xbef0('0x23')]=_0x254f1f;if(_0x519800[_0xbef0('0x36')][_0xbef0('0x45')]){_0x34d029[_0xbef0('0x46')]=[{'all':!![]}];}return db[_0xbef0('0x30')][_0xbef0('0x47')](_0x34d029);})[_0xbef0('0x29')](function(_0x2225b9){_0x429c39[_0xbef0('0x48')]=_0x2225b9;return _0x429c39;})[_0xbef0('0x29')](respondWithFilteredResult(_0x3510fa,_0x34d029))[_0xbef0('0x49')](handleError(_0x3510fa,null));};exports[_0xbef0('0x4a')]=function(_0xaa2795,_0x48084c){var _0x556788={'raw':![],'where':{'id':_0xaa2795['params']['id']}},_0x570bf8={};_0x570bf8[_0xbef0('0x35')]=_[_0xbef0('0x4b')](db[_0xbef0('0x30')]['rawAttributes']);_0x570bf8[_0xbef0('0x36')]=_[_0xbef0('0x4b')](_0xaa2795[_0xbef0('0x36')]);_0x570bf8[_0xbef0('0x37')]=_[_0xbef0('0x38')](_0x570bf8[_0xbef0('0x35')],_0x570bf8[_0xbef0('0x36')]);_0x556788[_0xbef0('0x39')]=_[_0xbef0('0x38')](_0x570bf8[_0xbef0('0x35')],qs[_0xbef0('0x3a')](_0xaa2795[_0xbef0('0x36')][_0xbef0('0x3a')]));_0x556788[_0xbef0('0x39')]=_0x556788[_0xbef0('0x39')][_0xbef0('0x3b')]?_0x556788['attributes']:_0x570bf8[_0xbef0('0x35')];if(_0xaa2795[_0xbef0('0x36')][_0xbef0('0x45')]){_0x556788[_0xbef0('0x46')]=[{'all':!![]}];}_0x556788=_['merge']({},_0x556788,_0xaa2795['options']);return db[_0xbef0('0x30')][_0xbef0('0x4c')](_0x556788)[_0xbef0('0x29')](handleEntityNotFound(_0x48084c,null))[_0xbef0('0x29')](respondWithResult(_0x48084c,null))[_0xbef0('0x49')](handleError(_0x48084c,null));};exports[_0xbef0('0x4d')]=function(_0x2458b6,_0x4bd29e){return db[_0xbef0('0x30')][_0xbef0('0x4d')](_0x2458b6['body'],{})[_0xbef0('0x29')](respondWithResult(_0x4bd29e,0xc9))[_0xbef0('0x49')](handleError(_0x4bd29e,null));};exports['update']=function(_0xc9e6ae,_0x44373f){if(_0xc9e6ae['body']['id']){delete _0xc9e6ae[_0xbef0('0x4e')]['id'];}return db['FreshdeskConfiguration'][_0xbef0('0x4c')]({'where':{'id':_0xc9e6ae[_0xbef0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x44373f,null))[_0xbef0('0x29')](saveUpdates(_0xc9e6ae[_0xbef0('0x4e')],null))['then'](respondWithResult(_0x44373f,null))[_0xbef0('0x49')](handleError(_0x44373f,null));};exports['destroy']=function(_0x21ffe2,_0x358d70){return db[_0xbef0('0x30')][_0xbef0('0x4c')]({'where':{'id':_0x21ffe2['params']['id']}})[_0xbef0('0x29')](handleEntityNotFound(_0x358d70,null))['then'](removeEntity(_0x358d70,null))[_0xbef0('0x49')](handleError(_0x358d70,null));};exports['getFields']=function(_0x3289bc,_0x38fba6,_0x13ec18){var _0x4967b6={};var _0x39257f={};var _0x197721;var _0x115232;return db[_0xbef0('0x30')][_0xbef0('0x50')]({'where':{'id':_0x3289bc[_0xbef0('0x4f')]['id']}})[_0xbef0('0x29')](handleEntityNotFound(_0x38fba6,null))['then'](function(_0x1b88cc){if(_0x1b88cc){_0x197721=_0x1b88cc;_0x39257f[_0xbef0('0x35')]=_[_0xbef0('0x4b')](db[_0xbef0('0x51')][_0xbef0('0x31')]);_0x39257f['query']=_[_0xbef0('0x4b')](_0x3289bc['query']);_0x39257f[_0xbef0('0x37')]=_[_0xbef0('0x38')](_0x39257f[_0xbef0('0x35')],_0x39257f[_0xbef0('0x36')]);_0x4967b6[_0xbef0('0x39')]=_[_0xbef0('0x38')](_0x39257f[_0xbef0('0x35')],qs[_0xbef0('0x3a')](_0x3289bc[_0xbef0('0x36')][_0xbef0('0x3a')]));_0x4967b6[_0xbef0('0x39')]=_0x4967b6[_0xbef0('0x39')][_0xbef0('0x3b')]?_0x4967b6[_0xbef0('0x39')]:_0x39257f[_0xbef0('0x35')];_0x4967b6['order']=qs[_0xbef0('0x3e')](_0x3289bc[_0xbef0('0x36')][_0xbef0('0x3e')]);_0x4967b6['where']=qs['filters'](_[_0xbef0('0x3f')](_0x3289bc[_0xbef0('0x36')],_0x39257f['filters']));if(_0x3289bc['query'][_0xbef0('0x40')]){_0x4967b6[_0xbef0('0x41')]=_[_0xbef0('0x42')](_0x4967b6['where'],{'$or':_[_0xbef0('0x2f')](_0x4967b6[_0xbef0('0x39')],function(_0x359d7d){var _0x18f65f={};_0x18f65f[_0x359d7d]={'$like':'%'+_0x3289bc['query']['filter']+'%'};return _0x18f65f;})});}_0x4967b6=_[_0xbef0('0x42')]({},_0x4967b6,_0x3289bc[_0xbef0('0x44')]);return _0x197721[_0xbef0('0x52')](_0x4967b6);}})[_0xbef0('0x29')](function(_0x3be306){if(_0x3be306){_0x115232=_0x3be306[_0xbef0('0x3b')];if(!_0x3289bc[_0xbef0('0x36')][_0xbef0('0x3c')](_0xbef0('0x53'))){_0x4967b6[_0xbef0('0x21')]=qs['limit'](_0x3289bc[_0xbef0('0x36')]['limit']);_0x4967b6[_0xbef0('0x20')]=qs[_0xbef0('0x20')](_0x3289bc[_0xbef0('0x36')][_0xbef0('0x20')]);}return _0x197721[_0xbef0('0x52')](_0x4967b6);}})[_0xbef0('0x29')](function(_0x551710){if(_0x551710){return _0x551710?{'count':_0x115232,'rows':_0x551710}:null;}})[_0xbef0('0x29')](respondWithResult(_0x38fba6,null))[_0xbef0('0x49')](handleError(_0x38fba6,null));};exports[_0xbef0('0x54')]=function(_0x4beb5e,_0x258eed,_0x4094e7){var _0x33d7ef={};var _0x4ebdb0={};var _0x39f5fc;var _0x4a71ae;return db[_0xbef0('0x30')][_0xbef0('0x50')]({'where':{'id':_0x4beb5e[_0xbef0('0x4f')]['id']}})[_0xbef0('0x29')](handleEntityNotFound(_0x258eed,null))['then'](function(_0x607af7){if(_0x607af7){_0x39f5fc=_0x607af7;_0x4ebdb0[_0xbef0('0x35')]=_[_0xbef0('0x4b')](db[_0xbef0('0x51')][_0xbef0('0x31')]);_0x4ebdb0[_0xbef0('0x36')]=_[_0xbef0('0x4b')](_0x4beb5e[_0xbef0('0x36')]);_0x4ebdb0[_0xbef0('0x37')]=_[_0xbef0('0x38')](_0x4ebdb0['model'],_0x4ebdb0[_0xbef0('0x36')]);_0x33d7ef[_0xbef0('0x39')]=_[_0xbef0('0x38')](_0x4ebdb0[_0xbef0('0x35')],qs[_0xbef0('0x3a')](_0x4beb5e[_0xbef0('0x36')]['fields']));_0x33d7ef[_0xbef0('0x39')]=_0x33d7ef[_0xbef0('0x39')][_0xbef0('0x3b')]?_0x33d7ef[_0xbef0('0x39')]:_0x4ebdb0[_0xbef0('0x35')];_0x33d7ef[_0xbef0('0x3d')]=qs[_0xbef0('0x3e')](_0x4beb5e[_0xbef0('0x36')][_0xbef0('0x3e')]);_0x33d7ef[_0xbef0('0x41')]=qs[_0xbef0('0x37')](_[_0xbef0('0x3f')](_0x4beb5e[_0xbef0('0x36')],_0x4ebdb0[_0xbef0('0x37')]));if(_0x4beb5e[_0xbef0('0x36')][_0xbef0('0x40')]){_0x33d7ef[_0xbef0('0x41')]=_[_0xbef0('0x42')](_0x33d7ef[_0xbef0('0x41')],{'$or':_['map'](_0x33d7ef['attributes'],function(_0x45a816){var _0x59e3a9={};_0x59e3a9[_0x45a816]={'$like':'%'+_0x4beb5e[_0xbef0('0x36')]['filter']+'%'};return _0x59e3a9;})});}_0x33d7ef=_['merge']({},_0x33d7ef,_0x4beb5e[_0xbef0('0x44')]);return _0x39f5fc[_0xbef0('0x54')](_0x33d7ef);}})[_0xbef0('0x29')](function(_0x2ff0b7){if(_0x2ff0b7){_0x4a71ae=_0x2ff0b7[_0xbef0('0x3b')];if(!_0x4beb5e[_0xbef0('0x36')][_0xbef0('0x3c')]('nolimit')){_0x33d7ef[_0xbef0('0x21')]=qs['limit'](_0x4beb5e[_0xbef0('0x36')][_0xbef0('0x21')]);_0x33d7ef[_0xbef0('0x20')]=qs['offset'](_0x4beb5e[_0xbef0('0x36')][_0xbef0('0x20')]);}return _0x39f5fc[_0xbef0('0x54')](_0x33d7ef);}})[_0xbef0('0x29')](function(_0x2ffd43){if(_0x2ffd43){return _0x2ffd43?{'count':_0x4a71ae,'rows':_0x2ffd43}:null;}})[_0xbef0('0x29')](respondWithResult(_0x258eed,null))[_0xbef0('0x49')](handleError(_0x258eed,null));};exports[_0xbef0('0x55')]=function(_0x29333a,_0x199d6d,_0xc599d6){var _0x135774={};var _0x393020={};var _0x5a4592;var _0x5b0bd1;return db[_0xbef0('0x30')][_0xbef0('0x50')]({'where':{'id':_0x29333a[_0xbef0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x199d6d,null))[_0xbef0('0x29')](function(_0x4d2704){if(_0x4d2704){_0x5a4592=_0x4d2704;_0x393020[_0xbef0('0x35')]=_['keys'](db[_0xbef0('0x51')][_0xbef0('0x31')]);_0x393020[_0xbef0('0x36')]=_[_0xbef0('0x4b')](_0x29333a['query']);_0x393020[_0xbef0('0x37')]=_[_0xbef0('0x38')](_0x393020[_0xbef0('0x35')],_0x393020[_0xbef0('0x36')]);_0x135774[_0xbef0('0x39')]=_[_0xbef0('0x38')](_0x393020['model'],qs['fields'](_0x29333a[_0xbef0('0x36')][_0xbef0('0x3a')]));_0x135774['attributes']=_0x135774[_0xbef0('0x39')][_0xbef0('0x3b')]?_0x135774[_0xbef0('0x39')]:_0x393020['model'];_0x135774[_0xbef0('0x3d')]=qs[_0xbef0('0x3e')](_0x29333a[_0xbef0('0x36')][_0xbef0('0x3e')]);_0x135774[_0xbef0('0x41')]=qs['filters'](_[_0xbef0('0x3f')](_0x29333a[_0xbef0('0x36')],_0x393020[_0xbef0('0x37')]));if(_0x29333a['query'][_0xbef0('0x40')]){_0x135774[_0xbef0('0x41')]=_[_0xbef0('0x42')](_0x135774[_0xbef0('0x41')],{'$or':_[_0xbef0('0x2f')](_0x135774['attributes'],function(_0x3048d2){var _0x20a781={};_0x20a781[_0x3048d2]={'$like':'%'+_0x29333a[_0xbef0('0x36')]['filter']+'%'};return _0x20a781;})});}_0x135774=_['merge']({},_0x135774,_0x29333a[_0xbef0('0x44')]);return _0x5a4592[_0xbef0('0x55')](_0x135774);}})[_0xbef0('0x29')](function(_0x3f7db0){if(_0x3f7db0){_0x5b0bd1=_0x3f7db0[_0xbef0('0x3b')];if(!_0x29333a[_0xbef0('0x36')][_0xbef0('0x3c')](_0xbef0('0x53'))){_0x135774[_0xbef0('0x21')]=qs['limit'](_0x29333a[_0xbef0('0x36')][_0xbef0('0x21')]);_0x135774[_0xbef0('0x20')]=qs[_0xbef0('0x20')](_0x29333a[_0xbef0('0x36')][_0xbef0('0x20')]);}return _0x5a4592[_0xbef0('0x55')](_0x135774);}})[_0xbef0('0x29')](function(_0x252cf7){if(_0x252cf7){return _0x252cf7?{'count':_0x5b0bd1,'rows':_0x252cf7}:null;}})[_0xbef0('0x29')](respondWithResult(_0x199d6d,null))[_0xbef0('0x49')](handleError(_0x199d6d,null));};exports[_0xbef0('0x56')]=function(_0x29ea87,_0x4a6f8b,_0x1dc91a){var _0x15a02e={};var _0x477d04={};var _0x9495b6;var _0x515f1a;return db[_0xbef0('0x30')][_0xbef0('0x50')]({'where':{'id':_0x29ea87[_0xbef0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4a6f8b,null))[_0xbef0('0x29')](function(_0x21e087){if(_0x21e087){_0x9495b6=_0x21e087;_0x477d04['model']=_[_0xbef0('0x4b')](db[_0xbef0('0x57')][_0xbef0('0x31')]);_0x477d04['query']=_[_0xbef0('0x4b')](_0x29ea87['query']);_0x477d04[_0xbef0('0x37')]=_[_0xbef0('0x38')](_0x477d04[_0xbef0('0x35')],_0x477d04[_0xbef0('0x36')]);_0x15a02e[_0xbef0('0x39')]=_[_0xbef0('0x38')](_0x477d04['model'],qs[_0xbef0('0x3a')](_0x29ea87[_0xbef0('0x36')][_0xbef0('0x3a')]));_0x15a02e[_0xbef0('0x39')]=_0x15a02e[_0xbef0('0x39')][_0xbef0('0x3b')]?_0x15a02e[_0xbef0('0x39')]:_0x477d04[_0xbef0('0x35')];_0x15a02e['order']=qs[_0xbef0('0x3e')](_0x29ea87[_0xbef0('0x36')][_0xbef0('0x3e')]);_0x15a02e[_0xbef0('0x41')]=qs['filters'](_[_0xbef0('0x3f')](_0x29ea87[_0xbef0('0x36')],_0x477d04['filters']));if(_0x29ea87['query'][_0xbef0('0x40')]){_0x15a02e[_0xbef0('0x41')]=_['merge'](_0x15a02e[_0xbef0('0x41')],{'$or':_['map'](_0x15a02e[_0xbef0('0x39')],function(_0x3fa2be){var _0x3abff0={};_0x3abff0[_0x3fa2be]={'$like':'%'+_0x29ea87[_0xbef0('0x36')][_0xbef0('0x40')]+'%'};return _0x3abff0;})});}_0x15a02e=_[_0xbef0('0x42')]({},_0x15a02e,_0x29ea87['options']);return _0x9495b6['getTags'](_0x15a02e);}})[_0xbef0('0x29')](function(_0x443731){if(_0x443731){_0x515f1a=_0x443731[_0xbef0('0x3b')];if(!_0x29ea87[_0xbef0('0x36')][_0xbef0('0x3c')](_0xbef0('0x53'))){_0x15a02e[_0xbef0('0x21')]=qs[_0xbef0('0x21')](_0x29ea87[_0xbef0('0x36')][_0xbef0('0x21')]);_0x15a02e[_0xbef0('0x20')]=qs[_0xbef0('0x20')](_0x29ea87[_0xbef0('0x36')][_0xbef0('0x20')]);}return _0x9495b6[_0xbef0('0x56')](_0x15a02e);}})[_0xbef0('0x29')](function(_0x2cba23){if(_0x2cba23){return _0x2cba23?{'count':_0x515f1a,'rows':_0x2cba23}:null;}})[_0xbef0('0x29')](respondWithResult(_0x4a6f8b,null))['catch'](handleError(_0x4a6f8b,null));};exports[_0xbef0('0x58')]=function(_0xd7563e,_0x2552f4,_0x1282f6){if(_0xd7563e[_0xbef0('0x4e')]['id']){delete _0xd7563e[_0xbef0('0x4e')]['id'];}return db[_0xbef0('0x30')][_0xbef0('0x50')]({'where':{'id':_0xd7563e['params']['id']}})[_0xbef0('0x29')](handleEntityNotFound(_0x2552f4,null))['then'](function(_0x48e180){if(_0x48e180){return _0x48e180[_0xbef0('0x58')](_0xd7563e[_0xbef0('0x4e')]['ids']||[]);}return null;})['then'](respondWithResult(_0x2552f4,null))[_0xbef0('0x49')](handleError(_0x2552f4,null));}; \ No newline at end of file +var _0x1757=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','options','include','findAll','rows','show','params','keys','intersection','includeAll','find','create','body','catch','update','getFields','FreshdeskField','sort','merge','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1757,0x90));var _0x7175=function(_0xd22061,_0x1c30d1){_0xd22061=_0xd22061-0x0;var _0x22037e=_0x1757[_0xd22061];return _0x22037e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7175('0x0'));var jsonpatch=require(_0x7175('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7175('0x2'));var Mustache=require('mustache');var util=require(_0x7175('0x3'));var path=require('path');var sox=require(_0x7175('0x4'));var csv=require(_0x7175('0x5'));var ejs=require(_0x7175('0x6'));var fs=require('fs');var fs_extra=require(_0x7175('0x7'));var _=require('lodash');var squel=require(_0x7175('0x8'));var crypto=require(_0x7175('0x9'));var jsforce=require(_0x7175('0xa'));var deskjs=require(_0x7175('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7175('0xc'));var Papa=require(_0x7175('0xd'));var Redis=require(_0x7175('0xe'));var authService=require(_0x7175('0xf'));var qs=require(_0x7175('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7175('0x11'))(_0x7175('0x12'));var utils=require(_0x7175('0x13'));var config=require(_0x7175('0x14'));var licenseUtil=require(_0x7175('0x15'));var db=require(_0x7175('0x16'))['db'];function respondWithStatusCode(_0x2e223a,_0x51da34){_0x51da34=_0x51da34||0xcc;return function(_0x470807){if(_0x470807){return _0x2e223a[_0x7175('0x17')](_0x51da34);}return _0x2e223a[_0x7175('0x18')](_0x51da34)[_0x7175('0x19')]();};}function respondWithResult(_0x39ff4b,_0x2a5f3d){_0x2a5f3d=_0x2a5f3d||0xc8;return function(_0xc0abc5){if(_0xc0abc5){return _0x39ff4b[_0x7175('0x18')](_0x2a5f3d)[_0x7175('0x1a')](_0xc0abc5);}};}function respondWithFilteredResult(_0x2cfe55,_0x1cfe27){return function(_0x15554a){if(_0x15554a){var _0x3f3858=typeof _0x1cfe27[_0x7175('0x1b')]===_0x7175('0x1c')&&typeof _0x1cfe27[_0x7175('0x1d')]===_0x7175('0x1c');var _0x36004c=_0x15554a[_0x7175('0x1e')];var _0x50ab1b=_0x3f3858?0x0:_0x1cfe27[_0x7175('0x1b')];var _0x572526=_0x3f3858?_0x15554a[_0x7175('0x1e')]:_0x1cfe27[_0x7175('0x1b')]+_0x1cfe27[_0x7175('0x1d')];var _0xa7f88e;if(_0x572526>=_0x36004c){_0x572526=_0x36004c;_0xa7f88e=0xc8;}else{_0xa7f88e=0xce;}_0x2cfe55[_0x7175('0x18')](_0xa7f88e);return _0x2cfe55[_0x7175('0x1f')](_0x7175('0x20'),_0x50ab1b+'-'+_0x572526+'/'+_0x36004c)['json'](_0x15554a);}return null;};}function patchUpdates(_0x3eb5df){return function(_0x2e4b77){try{jsonpatch['apply'](_0x2e4b77,_0x3eb5df,!![]);}catch(_0x49dfc2){return BPromise['reject'](_0x49dfc2);}return _0x2e4b77[_0x7175('0x21')]();};}function saveUpdates(_0x461589,_0x4f8578){return function(_0x2a8a3a){if(_0x2a8a3a){return _0x2a8a3a['update'](_0x461589)[_0x7175('0x22')](function(_0x2975ff){return _0x2975ff;});}return null;};}function removeEntity(_0x563e09,_0x29c64f){return function(_0x472347){if(_0x472347){return _0x472347[_0x7175('0x23')]()[_0x7175('0x22')](function(){_0x563e09[_0x7175('0x18')](0xcc)[_0x7175('0x19')]();});}};}function handleEntityNotFound(_0x5f0095,_0xcc87b5){return function(_0x3df712){if(!_0x3df712){_0x5f0095[_0x7175('0x17')](0x194);}return _0x3df712;};}function handleError(_0x40275a,_0x1abdee){_0x1abdee=_0x1abdee||0x1f4;return function(_0x48b799){logger[_0x7175('0x24')](_0x48b799['stack']);if(_0x48b799[_0x7175('0x25')]){delete _0x48b799[_0x7175('0x25')];}_0x40275a['status'](_0x1abdee)[_0x7175('0x26')](_0x48b799);};}exports[_0x7175('0x27')]=function(_0x3fb5e5,_0x253642){var _0x4f459a={},_0x5af9a9={},_0xa6e8a0={'count':0x0,'rows':[]};var _0x8b8c68=_[_0x7175('0x28')](db[_0x7175('0x29')][_0x7175('0x2a')],function(_0x37f84e){return{'name':_0x37f84e[_0x7175('0x2b')],'type':_0x37f84e[_0x7175('0x2c')][_0x7175('0x2d')]};});_0x5af9a9[_0x7175('0x2e')]=_[_0x7175('0x28')](_0x8b8c68,_0x7175('0x25'));_0x5af9a9[_0x7175('0x2f')]=_['keys'](_0x3fb5e5[_0x7175('0x2f')]);_0x5af9a9[_0x7175('0x30')]=_['intersection'](_0x5af9a9[_0x7175('0x2e')],_0x5af9a9[_0x7175('0x2f')]);_0x4f459a[_0x7175('0x31')]=_['intersection'](_0x5af9a9['model'],qs[_0x7175('0x32')](_0x3fb5e5['query'][_0x7175('0x32')]));_0x4f459a['attributes']=_0x4f459a[_0x7175('0x31')][_0x7175('0x33')]?_0x4f459a[_0x7175('0x31')]:_0x5af9a9[_0x7175('0x2e')];if(!_0x3fb5e5[_0x7175('0x2f')][_0x7175('0x34')](_0x7175('0x35'))){_0x4f459a[_0x7175('0x1d')]=qs[_0x7175('0x1d')](_0x3fb5e5[_0x7175('0x2f')][_0x7175('0x1d')]);_0x4f459a[_0x7175('0x1b')]=qs[_0x7175('0x1b')](_0x3fb5e5[_0x7175('0x2f')][_0x7175('0x1b')]);}_0x4f459a[_0x7175('0x36')]=qs['sort'](_0x3fb5e5[_0x7175('0x2f')]['sort']);_0x4f459a[_0x7175('0x37')]=qs[_0x7175('0x30')](_[_0x7175('0x38')](_0x3fb5e5['query'],_0x5af9a9[_0x7175('0x30')]),_0x8b8c68);if(_0x3fb5e5['query'][_0x7175('0x39')]){_0x4f459a[_0x7175('0x37')]=_['merge'](_0x4f459a['where'],{'$or':_[_0x7175('0x28')](_0x8b8c68,function(_0xd77928){if(_0xd77928['type']!=='VIRTUAL'){var _0x4ef43c={};_0x4ef43c[_0xd77928[_0x7175('0x25')]]={'$like':'%'+_0x3fb5e5[_0x7175('0x2f')][_0x7175('0x39')]+'%'};return _0x4ef43c;}})});}_0x4f459a=_['merge']({},_0x4f459a,_0x3fb5e5[_0x7175('0x3a')]);var _0x460bae={'where':_0x4f459a[_0x7175('0x37')]};return db[_0x7175('0x29')][_0x7175('0x1e')](_0x460bae)[_0x7175('0x22')](function(_0xaf00a2){_0xa6e8a0['count']=_0xaf00a2;if(_0x3fb5e5[_0x7175('0x2f')]['includeAll']){_0x4f459a[_0x7175('0x3b')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x7175('0x3c')](_0x4f459a);})[_0x7175('0x22')](function(_0x517274){_0xa6e8a0[_0x7175('0x3d')]=_0x517274;return _0xa6e8a0;})[_0x7175('0x22')](respondWithFilteredResult(_0x253642,_0x4f459a))['catch'](handleError(_0x253642,null));};exports[_0x7175('0x3e')]=function(_0x28cb20,_0x3f1d5b){var _0x6dd36a={'raw':![],'where':{'id':_0x28cb20[_0x7175('0x3f')]['id']}},_0x42a710={};_0x42a710[_0x7175('0x2e')]=_[_0x7175('0x40')](db['FreshdeskConfiguration'][_0x7175('0x2a')]);_0x42a710[_0x7175('0x2f')]=_[_0x7175('0x40')](_0x28cb20['query']);_0x42a710['filters']=_[_0x7175('0x41')](_0x42a710['model'],_0x42a710[_0x7175('0x2f')]);_0x6dd36a[_0x7175('0x31')]=_['intersection'](_0x42a710[_0x7175('0x2e')],qs['fields'](_0x28cb20['query'][_0x7175('0x32')]));_0x6dd36a[_0x7175('0x31')]=_0x6dd36a[_0x7175('0x31')][_0x7175('0x33')]?_0x6dd36a['attributes']:_0x42a710[_0x7175('0x2e')];if(_0x28cb20[_0x7175('0x2f')][_0x7175('0x42')]){_0x6dd36a[_0x7175('0x3b')]=[{'all':!![]}];}_0x6dd36a=_['merge']({},_0x6dd36a,_0x28cb20[_0x7175('0x3a')]);return db[_0x7175('0x29')][_0x7175('0x43')](_0x6dd36a)['then'](handleEntityNotFound(_0x3f1d5b,null))[_0x7175('0x22')](respondWithResult(_0x3f1d5b,null))['catch'](handleError(_0x3f1d5b,null));};exports[_0x7175('0x44')]=function(_0x3729cc,_0x153c0b){return db['FreshdeskConfiguration'][_0x7175('0x44')](_0x3729cc[_0x7175('0x45')],{})[_0x7175('0x22')](respondWithResult(_0x153c0b,0xc9))[_0x7175('0x46')](handleError(_0x153c0b,null));};exports[_0x7175('0x47')]=function(_0x38429b,_0xd49d18){if(_0x38429b[_0x7175('0x45')]['id']){delete _0x38429b[_0x7175('0x45')]['id'];}return db[_0x7175('0x29')][_0x7175('0x43')]({'where':{'id':_0x38429b['params']['id']}})[_0x7175('0x22')](handleEntityNotFound(_0xd49d18,null))[_0x7175('0x22')](saveUpdates(_0x38429b[_0x7175('0x45')],null))[_0x7175('0x22')](respondWithResult(_0xd49d18,null))[_0x7175('0x46')](handleError(_0xd49d18,null));};exports[_0x7175('0x23')]=function(_0x168ce6,_0x18855f){return db[_0x7175('0x29')]['find']({'where':{'id':_0x168ce6[_0x7175('0x3f')]['id']}})['then'](handleEntityNotFound(_0x18855f,null))[_0x7175('0x22')](removeEntity(_0x18855f,null))[_0x7175('0x46')](handleError(_0x18855f,null));};exports[_0x7175('0x48')]=function(_0x359d7f,_0x464f8a,_0x3e57c8){var _0x30dbbe={};var _0x1f4eb3={};var _0x5d7062;var _0x4fecea;return db[_0x7175('0x29')]['findOne']({'where':{'id':_0x359d7f[_0x7175('0x3f')]['id']}})[_0x7175('0x22')](handleEntityNotFound(_0x464f8a,null))[_0x7175('0x22')](function(_0x3d0ece){if(_0x3d0ece){_0x5d7062=_0x3d0ece;_0x1f4eb3[_0x7175('0x2e')]=_[_0x7175('0x40')](db[_0x7175('0x49')][_0x7175('0x2a')]);_0x1f4eb3[_0x7175('0x2f')]=_['keys'](_0x359d7f[_0x7175('0x2f')]);_0x1f4eb3['filters']=_['intersection'](_0x1f4eb3['model'],_0x1f4eb3[_0x7175('0x2f')]);_0x30dbbe[_0x7175('0x31')]=_[_0x7175('0x41')](_0x1f4eb3[_0x7175('0x2e')],qs[_0x7175('0x32')](_0x359d7f[_0x7175('0x2f')]['fields']));_0x30dbbe[_0x7175('0x31')]=_0x30dbbe[_0x7175('0x31')][_0x7175('0x33')]?_0x30dbbe[_0x7175('0x31')]:_0x1f4eb3[_0x7175('0x2e')];_0x30dbbe[_0x7175('0x36')]=qs['sort'](_0x359d7f[_0x7175('0x2f')][_0x7175('0x4a')]);_0x30dbbe[_0x7175('0x37')]=qs['filters'](_[_0x7175('0x38')](_0x359d7f[_0x7175('0x2f')],_0x1f4eb3[_0x7175('0x30')]));if(_0x359d7f[_0x7175('0x2f')][_0x7175('0x39')]){_0x30dbbe['where']=_[_0x7175('0x4b')](_0x30dbbe[_0x7175('0x37')],{'$or':_[_0x7175('0x28')](_0x30dbbe[_0x7175('0x31')],function(_0x1c6378){var _0x4071d2={};_0x4071d2[_0x1c6378]={'$like':'%'+_0x359d7f[_0x7175('0x2f')][_0x7175('0x39')]+'%'};return _0x4071d2;})});}_0x30dbbe=_[_0x7175('0x4b')]({},_0x30dbbe,_0x359d7f[_0x7175('0x3a')]);return _0x5d7062['getFields'](_0x30dbbe);}})[_0x7175('0x22')](function(_0x4cbb73){if(_0x4cbb73){_0x4fecea=_0x4cbb73[_0x7175('0x33')];if(!_0x359d7f[_0x7175('0x2f')][_0x7175('0x34')]('nolimit')){_0x30dbbe[_0x7175('0x1d')]=qs[_0x7175('0x1d')](_0x359d7f['query'][_0x7175('0x1d')]);_0x30dbbe['offset']=qs[_0x7175('0x1b')](_0x359d7f[_0x7175('0x2f')][_0x7175('0x1b')]);}return _0x5d7062[_0x7175('0x48')](_0x30dbbe);}})[_0x7175('0x22')](function(_0x5383d8){if(_0x5383d8){return _0x5383d8?{'count':_0x4fecea,'rows':_0x5383d8}:null;}})['then'](respondWithResult(_0x464f8a,null))[_0x7175('0x46')](handleError(_0x464f8a,null));};exports[_0x7175('0x4c')]=function(_0x540fe0,_0x3b04b7,_0xb7f636){var _0x596507={};var _0x55c5e5={};var _0x1f2fcb;var _0x20e1f9;return db[_0x7175('0x29')][_0x7175('0x4d')]({'where':{'id':_0x540fe0[_0x7175('0x3f')]['id']}})[_0x7175('0x22')](handleEntityNotFound(_0x3b04b7,null))[_0x7175('0x22')](function(_0x64c84d){if(_0x64c84d){_0x1f2fcb=_0x64c84d;_0x55c5e5[_0x7175('0x2e')]=_[_0x7175('0x40')](db[_0x7175('0x49')][_0x7175('0x2a')]);_0x55c5e5[_0x7175('0x2f')]=_[_0x7175('0x40')](_0x540fe0[_0x7175('0x2f')]);_0x55c5e5[_0x7175('0x30')]=_[_0x7175('0x41')](_0x55c5e5['model'],_0x55c5e5[_0x7175('0x2f')]);_0x596507[_0x7175('0x31')]=_[_0x7175('0x41')](_0x55c5e5[_0x7175('0x2e')],qs[_0x7175('0x32')](_0x540fe0['query'][_0x7175('0x32')]));_0x596507[_0x7175('0x31')]=_0x596507[_0x7175('0x31')]['length']?_0x596507[_0x7175('0x31')]:_0x55c5e5[_0x7175('0x2e')];_0x596507['order']=qs[_0x7175('0x4a')](_0x540fe0['query'][_0x7175('0x4a')]);_0x596507[_0x7175('0x37')]=qs[_0x7175('0x30')](_['pick'](_0x540fe0[_0x7175('0x2f')],_0x55c5e5[_0x7175('0x30')]));if(_0x540fe0[_0x7175('0x2f')][_0x7175('0x39')]){_0x596507[_0x7175('0x37')]=_[_0x7175('0x4b')](_0x596507[_0x7175('0x37')],{'$or':_[_0x7175('0x28')](_0x596507['attributes'],function(_0x187059){var _0xc18182={};_0xc18182[_0x187059]={'$like':'%'+_0x540fe0[_0x7175('0x2f')][_0x7175('0x39')]+'%'};return _0xc18182;})});}_0x596507=_[_0x7175('0x4b')]({},_0x596507,_0x540fe0[_0x7175('0x3a')]);return _0x1f2fcb['getSubjects'](_0x596507);}})[_0x7175('0x22')](function(_0x3aebac){if(_0x3aebac){_0x20e1f9=_0x3aebac[_0x7175('0x33')];if(!_0x540fe0['query']['hasOwnProperty']('nolimit')){_0x596507[_0x7175('0x1d')]=qs['limit'](_0x540fe0[_0x7175('0x2f')]['limit']);_0x596507[_0x7175('0x1b')]=qs[_0x7175('0x1b')](_0x540fe0[_0x7175('0x2f')][_0x7175('0x1b')]);}return _0x1f2fcb[_0x7175('0x4c')](_0x596507);}})[_0x7175('0x22')](function(_0x1b262e){if(_0x1b262e){return _0x1b262e?{'count':_0x20e1f9,'rows':_0x1b262e}:null;}})['then'](respondWithResult(_0x3b04b7,null))['catch'](handleError(_0x3b04b7,null));};exports['getDescriptions']=function(_0x547635,_0x3bc3a4,_0x166672){var _0x12a97e={};var _0x3380c7={};var _0x55dac4;var _0x2ff496;return db[_0x7175('0x29')]['findOne']({'where':{'id':_0x547635['params']['id']}})[_0x7175('0x22')](handleEntityNotFound(_0x3bc3a4,null))[_0x7175('0x22')](function(_0x4a11a3){if(_0x4a11a3){_0x55dac4=_0x4a11a3;_0x3380c7['model']=_[_0x7175('0x40')](db[_0x7175('0x49')]['rawAttributes']);_0x3380c7[_0x7175('0x2f')]=_[_0x7175('0x40')](_0x547635[_0x7175('0x2f')]);_0x3380c7['filters']=_[_0x7175('0x41')](_0x3380c7[_0x7175('0x2e')],_0x3380c7[_0x7175('0x2f')]);_0x12a97e[_0x7175('0x31')]=_[_0x7175('0x41')](_0x3380c7[_0x7175('0x2e')],qs['fields'](_0x547635['query'][_0x7175('0x32')]));_0x12a97e[_0x7175('0x31')]=_0x12a97e['attributes'][_0x7175('0x33')]?_0x12a97e['attributes']:_0x3380c7['model'];_0x12a97e[_0x7175('0x36')]=qs[_0x7175('0x4a')](_0x547635[_0x7175('0x2f')][_0x7175('0x4a')]);_0x12a97e[_0x7175('0x37')]=qs['filters'](_[_0x7175('0x38')](_0x547635[_0x7175('0x2f')],_0x3380c7[_0x7175('0x30')]));if(_0x547635['query'][_0x7175('0x39')]){_0x12a97e[_0x7175('0x37')]=_[_0x7175('0x4b')](_0x12a97e['where'],{'$or':_[_0x7175('0x28')](_0x12a97e[_0x7175('0x31')],function(_0x566dd4){var _0x5898ed={};_0x5898ed[_0x566dd4]={'$like':'%'+_0x547635['query'][_0x7175('0x39')]+'%'};return _0x5898ed;})});}_0x12a97e=_[_0x7175('0x4b')]({},_0x12a97e,_0x547635['options']);return _0x55dac4[_0x7175('0x4e')](_0x12a97e);}})[_0x7175('0x22')](function(_0x2a2d5f){if(_0x2a2d5f){_0x2ff496=_0x2a2d5f[_0x7175('0x33')];if(!_0x547635['query'][_0x7175('0x34')]('nolimit')){_0x12a97e['limit']=qs['limit'](_0x547635[_0x7175('0x2f')][_0x7175('0x1d')]);_0x12a97e['offset']=qs['offset'](_0x547635[_0x7175('0x2f')][_0x7175('0x1b')]);}return _0x55dac4[_0x7175('0x4e')](_0x12a97e);}})[_0x7175('0x22')](function(_0x35ff94){if(_0x35ff94){return _0x35ff94?{'count':_0x2ff496,'rows':_0x35ff94}:null;}})[_0x7175('0x22')](respondWithResult(_0x3bc3a4,null))[_0x7175('0x46')](handleError(_0x3bc3a4,null));};exports[_0x7175('0x4f')]=function(_0x1c7667,_0x2541e3,_0x1c714b){var _0x2263d1={};var _0x437d39={};var _0x176f64;var _0x4e0059;return db[_0x7175('0x29')]['findOne']({'where':{'id':_0x1c7667[_0x7175('0x3f')]['id']}})[_0x7175('0x22')](handleEntityNotFound(_0x2541e3,null))['then'](function(_0x22bd4a){if(_0x22bd4a){_0x176f64=_0x22bd4a;_0x437d39[_0x7175('0x2e')]=_[_0x7175('0x40')](db[_0x7175('0x50')][_0x7175('0x2a')]);_0x437d39[_0x7175('0x2f')]=_['keys'](_0x1c7667[_0x7175('0x2f')]);_0x437d39[_0x7175('0x30')]=_[_0x7175('0x41')](_0x437d39[_0x7175('0x2e')],_0x437d39[_0x7175('0x2f')]);_0x2263d1[_0x7175('0x31')]=_['intersection'](_0x437d39[_0x7175('0x2e')],qs[_0x7175('0x32')](_0x1c7667[_0x7175('0x2f')][_0x7175('0x32')]));_0x2263d1[_0x7175('0x31')]=_0x2263d1[_0x7175('0x31')][_0x7175('0x33')]?_0x2263d1[_0x7175('0x31')]:_0x437d39[_0x7175('0x2e')];_0x2263d1[_0x7175('0x36')]=qs['sort'](_0x1c7667[_0x7175('0x2f')][_0x7175('0x4a')]);_0x2263d1[_0x7175('0x37')]=qs[_0x7175('0x30')](_['pick'](_0x1c7667[_0x7175('0x2f')],_0x437d39['filters']));if(_0x1c7667[_0x7175('0x2f')][_0x7175('0x39')]){_0x2263d1['where']=_[_0x7175('0x4b')](_0x2263d1[_0x7175('0x37')],{'$or':_[_0x7175('0x28')](_0x2263d1[_0x7175('0x31')],function(_0x590e23){var _0x57882d={};_0x57882d[_0x590e23]={'$like':'%'+_0x1c7667['query']['filter']+'%'};return _0x57882d;})});}_0x2263d1=_['merge']({},_0x2263d1,_0x1c7667['options']);return _0x176f64[_0x7175('0x4f')](_0x2263d1);}})[_0x7175('0x22')](function(_0x454e1d){if(_0x454e1d){_0x4e0059=_0x454e1d[_0x7175('0x33')];if(!_0x1c7667['query']['hasOwnProperty'](_0x7175('0x35'))){_0x2263d1[_0x7175('0x1d')]=qs[_0x7175('0x1d')](_0x1c7667[_0x7175('0x2f')][_0x7175('0x1d')]);_0x2263d1[_0x7175('0x1b')]=qs[_0x7175('0x1b')](_0x1c7667[_0x7175('0x2f')][_0x7175('0x1b')]);}return _0x176f64[_0x7175('0x4f')](_0x2263d1);}})['then'](function(_0x22f444){if(_0x22f444){return _0x22f444?{'count':_0x4e0059,'rows':_0x22f444}:null;}})[_0x7175('0x22')](respondWithResult(_0x2541e3,null))['catch'](handleError(_0x2541e3,null));};exports[_0x7175('0x51')]=function(_0x43d4d1,_0x1be3e9,_0x431215){if(_0x43d4d1[_0x7175('0x45')]['id']){delete _0x43d4d1[_0x7175('0x45')]['id'];}return db['FreshdeskConfiguration'][_0x7175('0x4d')]({'where':{'id':_0x43d4d1[_0x7175('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1be3e9,null))[_0x7175('0x22')](function(_0x372ad1){if(_0x372ad1){return _0x372ad1['setTags'](_0x43d4d1['body'][_0x7175('0x52')]||[]);}return null;})[_0x7175('0x22')](respondWithResult(_0x1be3e9,null))[_0x7175('0x46')](handleError(_0x1be3e9,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 23a35e6..14dc842 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4506=['util','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x4506,0x15e));var _0x6450=function(_0x998272,_0x56ecca){_0x998272=_0x998272-0x0;var _0x2c474c=_0x4506[_0x998272];return _0x2c474c;};'use strict';var _=require(_0x6450('0x0'));var util=require(_0x6450('0x1'));var logger=require('../../config/logger')(_0x6450('0x2'));var moment=require(_0x6450('0x3'));var BPromise=require('bluebird');var rp=require(_0x6450('0x4'));var fs=require('fs');var path=require(_0x6450('0x5'));var rimraf=require(_0x6450('0x6'));var config=require(_0x6450('0x7'));var attributes=require(_0x6450('0x8'));module[_0x6450('0x9')]=function(_0x547431,_0x58fd6f){return _0x547431[_0x6450('0xa')](_0x6450('0xb'),attributes,{'tableName':_0x6450('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2ac=['rimraf','int_freshdesk_configurations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3bb5b4,_0x128455){var _0x586c60=function(_0x179226){while(--_0x179226){_0x3bb5b4['push'](_0x3bb5b4['shift']());}};_0x586c60(++_0x128455);}(_0xf2ac,0x136));var _0xcf2a=function(_0x59a8fe,_0x4a9af3){_0x59a8fe=_0x59a8fe-0x0;var _0xade71f=_0xf2ac[_0x59a8fe];return _0xade71f;};'use strict';var _=require(_0xcf2a('0x0'));var util=require(_0xcf2a('0x1'));var logger=require(_0xcf2a('0x2'))('api');var moment=require(_0xcf2a('0x3'));var BPromise=require(_0xcf2a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcf2a('0x5'));var config=require('../../config/environment');var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x3ed906,_0x11d45b){return _0x3ed906['define']('FreshdeskConfiguration',attributes,{'tableName':_0xcf2a('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 1f0096a..8ae55b6 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x832d=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x32f9d7,_0x283445){var _0xce4cf4=function(_0x13f8dc){while(--_0x13f8dc){_0x32f9d7['push'](_0x32f9d7['shift']());}};_0xce4cf4(++_0x283445);}(_0x832d,0xa6));var _0xd832=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x832d[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xd832('0x0'));var util=require(_0xd832('0x1'));var moment=require(_0xd832('0x2'));var BPromise=require(_0xd832('0x3'));var rs=require(_0xd832('0x4'));var fs=require('fs');var Redis=require(_0xd832('0x5'));var db=require(_0xd832('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd832('0x7'));var client=jayson['client'][_0xd832('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x237864,_0x4a3a24,_0xd36ba5){return new BPromise(function(_0x397981,_0x1225e4){return client[_0xd832('0x9')](_0x237864,_0xd36ba5)['then'](function(_0x32020a){logger[_0xd832('0xa')](_0xd832('0xb'),_0x4a3a24,_0xd832('0xc'));logger[_0xd832('0xd')](_0xd832('0xe'),_0x4a3a24,'request\x20sent',JSON['stringify'](_0x32020a));if(_0x32020a[_0xd832('0xf')]){if(_0x32020a[_0xd832('0xf')][_0xd832('0x10')]===0x1f4){logger[_0xd832('0xf')](_0xd832('0xb'),_0x4a3a24,_0x32020a[_0xd832('0xf')][_0xd832('0x11')]);return _0x1225e4(_0x32020a[_0xd832('0xf')][_0xd832('0x11')]);}logger['error'](_0xd832('0xb'),_0x4a3a24,_0x32020a[_0xd832('0xf')][_0xd832('0x11')]);return _0x397981(_0x32020a[_0xd832('0xf')][_0xd832('0x11')]);}else{logger['info'](_0xd832('0xb'),_0x4a3a24,'request\x20sent');_0x397981(_0x32020a['result'][_0xd832('0x11')]);}})['catch'](function(_0x5843f0){logger[_0xd832('0xf')](_0xd832('0xb'),_0x4a3a24,_0x5843f0);_0x1225e4(_0x5843f0);});});} \ No newline at end of file +var _0x6bf4=['debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x439d86,_0x4d5226){var _0xa3fcc7=function(_0x1e6f76){while(--_0x1e6f76){_0x439d86['push'](_0x439d86['shift']());}};_0xa3fcc7(++_0x4d5226);}(_0x6bf4,0x102));var _0x46bf=function(_0x6a1918,_0x24f5c5){_0x6a1918=_0x6a1918-0x0;var _0xb5d6af=_0x6bf4[_0x6a1918];return _0xb5d6af;};'use strict';var _=require('lodash');var util=require(_0x46bf('0x0'));var moment=require(_0x46bf('0x1'));var BPromise=require(_0x46bf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46bf('0x3'));var db=require(_0x46bf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x46bf('0x5'));var config=require(_0x46bf('0x6'));var jayson=require(_0x46bf('0x7'));var client=jayson[_0x46bf('0x8')][_0x46bf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18de8f,_0xc7be65,_0x184b8c){return new BPromise(function(_0x5e70e8,_0x3d80a9){return client[_0x46bf('0xa')](_0x18de8f,_0x184b8c)[_0x46bf('0xb')](function(_0x2ce12a){logger[_0x46bf('0xc')](_0x46bf('0xd'),_0xc7be65,_0x46bf('0xe'));logger[_0x46bf('0xf')](_0x46bf('0x10'),_0xc7be65,_0x46bf('0xe'),JSON['stringify'](_0x2ce12a));if(_0x2ce12a['error']){if(_0x2ce12a['error']['code']===0x1f4){logger[_0x46bf('0x11')](_0x46bf('0xd'),_0xc7be65,_0x2ce12a[_0x46bf('0x11')]['message']);return _0x3d80a9(_0x2ce12a['error'][_0x46bf('0x12')]);}logger[_0x46bf('0x11')](_0x46bf('0xd'),_0xc7be65,_0x2ce12a[_0x46bf('0x11')][_0x46bf('0x12')]);return _0x5e70e8(_0x2ce12a[_0x46bf('0x11')][_0x46bf('0x12')]);}else{logger[_0x46bf('0xc')](_0x46bf('0xd'),_0xc7be65,_0x46bf('0xe'));_0x5e70e8(_0x2ce12a[_0x46bf('0x13')][_0x46bf('0x12')]);}})[_0x46bf('0x14')](function(_0x51f14c){logger['error'](_0x46bf('0xd'),_0xc7be65,_0x51f14c);_0x3d80a9(_0x51f14c);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 0489f2b..82184c5 100644 --- a/server/api/intFreshdeskField/index.js +++ b/server/api/intFreshdeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2485=['get','isAuthenticated','/:id','post','create','put','update','delete','exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller'];(function(_0x32ab63,_0x4d6d70){var _0x18af42=function(_0x25397a){while(--_0x25397a){_0x32ab63['push'](_0x32ab63['shift']());}};_0x18af42(++_0x4d6d70);}(_0x2485,0x108));var _0x5248=function(_0x5be8db,_0x1f198f){_0x5be8db=_0x5be8db-0x0;var _0x2e8b8b=_0x2485[_0x5be8db];return _0x2e8b8b;};'use strict';var multer=require(_0x5248('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5248('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5248('0x2'));var interaction=require(_0x5248('0x3'));var config=require(_0x5248('0x4'));var controller=require(_0x5248('0x5'));router[_0x5248('0x6')]('/',auth[_0x5248('0x7')](),controller['index']);router['get'](_0x5248('0x8'),auth[_0x5248('0x7')](),controller['show']);router[_0x5248('0x9')]('/',auth[_0x5248('0x7')](),controller[_0x5248('0xa')]);router[_0x5248('0xb')](_0x5248('0x8'),auth[_0x5248('0x7')](),controller[_0x5248('0xc')]);router[_0x5248('0xd')](_0x5248('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x5248('0xe')]=router; \ No newline at end of file +var _0xf3d3=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','/:id','show','post','isAuthenticated','create','put','update','destroy','path','connect-timeout'];(function(_0x164888,_0x1cda63){var _0x2817cc=function(_0xaf4c8b){while(--_0xaf4c8b){_0x164888['push'](_0x164888['shift']());}};_0x2817cc(++_0x1cda63);}(_0xf3d3,0xa0));var _0x3f3d=function(_0x1ab396,_0x221eca){_0x1ab396=_0x1ab396-0x0;var _0xc9bd7d=_0xf3d3[_0x1ab396];return _0xc9bd7d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3f3d('0x0'));var timeout=require(_0x3f3d('0x1'));var express=require(_0x3f3d('0x2'));var router=express[_0x3f3d('0x3')]();var fs_extra=require(_0x3f3d('0x4'));var auth=require(_0x3f3d('0x5'));var interaction=require(_0x3f3d('0x6'));var config=require(_0x3f3d('0x7'));var controller=require(_0x3f3d('0x8'));router[_0x3f3d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3f3d('0x9')](_0x3f3d('0xa'),auth['isAuthenticated'](),controller[_0x3f3d('0xb')]);router[_0x3f3d('0xc')]('/',auth[_0x3f3d('0xd')](),controller[_0x3f3d('0xe')]);router[_0x3f3d('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3f3d('0x10')]);router['delete'](_0x3f3d('0xa'),auth[_0x3f3d('0xd')](),controller[_0x3f3d('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index ca8cb78..8bbcb82 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.attributes.js +++ b/server/api/intFreshdeskField/intFreshdeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc7f5=['exports','ENUM','string','variable','keyValue','customVariable','STRING'];(function(_0x2395a5,_0x39989c){var _0x755762=function(_0x337b1e){while(--_0x337b1e){_0x2395a5['push'](_0x2395a5['shift']());}};_0x755762(++_0x39989c);}(_0xc7f5,0x118));var _0x5c7f=function(_0x5e7e31,_0x23421a){_0x5e7e31=_0x5e7e31-0x0;var _0x246997=_0xc7f5[_0x5e7e31];return _0x246997;};'use strict';var Sequelize=require('sequelize');module[_0x5c7f('0x0')]={'type':{'type':Sequelize[_0x5c7f('0x1')](_0x5c7f('0x2'),_0x5c7f('0x3'),'customVariable',_0x5c7f('0x4'),'picklist'),'defaultValue':_0x5c7f('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5c7f('0x1')]('string',_0x5c7f('0x3'),_0x5c7f('0x5'))},'keyContent':{'type':Sequelize[_0x5c7f('0x6')]},'idField':{'type':Sequelize[_0x5c7f('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5c7f('0x6')]}}; \ No newline at end of file +var _0x47d7=['customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x56a7bc,_0x371faa){var _0x848053=function(_0x474f93){while(--_0x474f93){_0x56a7bc['push'](_0x56a7bc['shift']());}};_0x848053(++_0x371faa);}(_0x47d7,0xc1));var _0x747d=function(_0x34caca,_0x4e7fb9){_0x34caca=_0x34caca-0x0;var _0x295713=_0x47d7[_0x34caca];return _0x295713;};'use strict';var Sequelize=require(_0x747d('0x0'));module[_0x747d('0x1')]={'type':{'type':Sequelize[_0x747d('0x2')](_0x747d('0x3'),_0x747d('0x4'),_0x747d('0x5'),_0x747d('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x747d('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x747d('0x2')](_0x747d('0x3'),_0x747d('0x4'),_0x747d('0x5'))},'keyContent':{'type':Sequelize[_0x747d('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x747d('0x7')]},'customField':{'type':Sequelize[_0x747d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x747d('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 091af29..83ee464 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.controller.js +++ b/server/api/intFreshdeskField/intFreshdeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80df=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','FreshdeskField','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x3d785f,_0x407893){var _0x2ff37f=function(_0x5ecd29){while(--_0x5ecd29){_0x3d785f['push'](_0x3d785f['shift']());}};_0x2ff37f(++_0x407893);}(_0x80df,0x17e));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xf80d('0x0'));var rimraf=require(_0xf80d('0x1'));var zipdir=require(_0xf80d('0x2'));var jsonpatch=require(_0xf80d('0x3'));var rp=require('request-promise');var moment=require(_0xf80d('0x4'));var BPromise=require(_0xf80d('0x5'));var Mustache=require(_0xf80d('0x6'));var util=require(_0xf80d('0x7'));var path=require(_0xf80d('0x8'));var sox=require(_0xf80d('0x9'));var csv=require(_0xf80d('0xa'));var ejs=require(_0xf80d('0xb'));var fs=require('fs');var fs_extra=require(_0xf80d('0xc'));var _=require(_0xf80d('0xd'));var squel=require('squel');var crypto=require(_0xf80d('0xe'));var jsforce=require(_0xf80d('0xf'));var deskjs=require(_0xf80d('0x10'));var toCsv=require(_0xf80d('0xa'));var querystring=require(_0xf80d('0x11'));var Papa=require(_0xf80d('0x12'));var Redis=require(_0xf80d('0x13'));var authService=require(_0xf80d('0x14'));var qs=require(_0xf80d('0x15'));var as=require(_0xf80d('0x16'));var hardwareService=require(_0xf80d('0x17'));var logger=require(_0xf80d('0x18'))(_0xf80d('0x19'));var utils=require(_0xf80d('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf80d('0x1b'))['db'];function respondWithStatusCode(_0x74ce36,_0x489bdf){_0x489bdf=_0x489bdf||0xcc;return function(_0x34e130){if(_0x34e130){return _0x74ce36['sendStatus'](_0x489bdf);}return _0x74ce36[_0xf80d('0x1c')](_0x489bdf)['end']();};}function respondWithResult(_0x4285de,_0x50c968){_0x50c968=_0x50c968||0xc8;return function(_0x3be9a9){if(_0x3be9a9){return _0x4285de[_0xf80d('0x1c')](_0x50c968)[_0xf80d('0x1d')](_0x3be9a9);}};}function respondWithFilteredResult(_0x1e1b08,_0x2098d6){return function(_0x45751c){if(_0x45751c){var _0x482043=typeof _0x2098d6[_0xf80d('0x1e')]===_0xf80d('0x1f')&&typeof _0x2098d6[_0xf80d('0x20')]===_0xf80d('0x1f');var _0x27b2ea=_0x45751c[_0xf80d('0x21')];var _0x1d104a=_0x482043?0x0:_0x2098d6[_0xf80d('0x1e')];var _0x2ea2c1=_0x482043?_0x45751c[_0xf80d('0x21')]:_0x2098d6[_0xf80d('0x1e')]+_0x2098d6[_0xf80d('0x20')];var _0x5392c5;if(_0x2ea2c1>=_0x27b2ea){_0x2ea2c1=_0x27b2ea;_0x5392c5=0xc8;}else{_0x5392c5=0xce;}_0x1e1b08[_0xf80d('0x1c')](_0x5392c5);return _0x1e1b08[_0xf80d('0x22')]('Content-Range',_0x1d104a+'-'+_0x2ea2c1+'/'+_0x27b2ea)[_0xf80d('0x1d')](_0x45751c);}return null;};}function patchUpdates(_0x539c80){return function(_0x3f3a2a){try{jsonpatch[_0xf80d('0x23')](_0x3f3a2a,_0x539c80,!![]);}catch(_0x2d5e46){return BPromise[_0xf80d('0x24')](_0x2d5e46);}return _0x3f3a2a[_0xf80d('0x25')]();};}function saveUpdates(_0x25d031,_0x446153){return function(_0x269859){if(_0x269859){return _0x269859[_0xf80d('0x26')](_0x25d031)[_0xf80d('0x27')](function(_0x33d58c){return _0x33d58c;});}return null;};}function removeEntity(_0x739968,_0x570c99){return function(_0x32ad42){if(_0x32ad42){return _0x32ad42[_0xf80d('0x28')]()['then'](function(){_0x739968[_0xf80d('0x1c')](0xcc)[_0xf80d('0x29')]();});}};}function handleEntityNotFound(_0x323540,_0x947bb){return function(_0x4986ad){if(!_0x4986ad){_0x323540[_0xf80d('0x2a')](0x194);}return _0x4986ad;};}function handleError(_0x14399e,_0xf4c3af){_0xf4c3af=_0xf4c3af||0x1f4;return function(_0x2a4597){logger[_0xf80d('0x2b')](_0x2a4597[_0xf80d('0x2c')]);if(_0x2a4597[_0xf80d('0x2d')]){delete _0x2a4597[_0xf80d('0x2d')];}_0x14399e[_0xf80d('0x1c')](_0xf4c3af)['send'](_0x2a4597);};}exports[_0xf80d('0x2e')]=function(_0x1603a4,_0x3e2c8c){var _0x368865={},_0x3ce924={},_0x5eab42={'count':0x0,'rows':[]};var _0x401cfb=_['map'](db[_0xf80d('0x2f')][_0xf80d('0x30')],function(_0x214bff){return{'name':_0x214bff[_0xf80d('0x31')],'type':_0x214bff['type']['key']};});_0x3ce924[_0xf80d('0x32')]=_['map'](_0x401cfb,_0xf80d('0x2d'));_0x3ce924[_0xf80d('0x33')]=_[_0xf80d('0x34')](_0x1603a4['query']);_0x3ce924[_0xf80d('0x35')]=_[_0xf80d('0x36')](_0x3ce924['model'],_0x3ce924[_0xf80d('0x33')]);_0x368865[_0xf80d('0x37')]=_[_0xf80d('0x36')](_0x3ce924['model'],qs[_0xf80d('0x38')](_0x1603a4[_0xf80d('0x33')][_0xf80d('0x38')]));_0x368865[_0xf80d('0x37')]=_0x368865[_0xf80d('0x37')]['length']?_0x368865[_0xf80d('0x37')]:_0x3ce924['model'];if(!_0x1603a4[_0xf80d('0x33')][_0xf80d('0x39')](_0xf80d('0x3a'))){_0x368865[_0xf80d('0x20')]=qs['limit'](_0x1603a4[_0xf80d('0x33')][_0xf80d('0x20')]);_0x368865[_0xf80d('0x1e')]=qs[_0xf80d('0x1e')](_0x1603a4['query'][_0xf80d('0x1e')]);}_0x368865[_0xf80d('0x3b')]=qs[_0xf80d('0x3c')](_0x1603a4[_0xf80d('0x33')][_0xf80d('0x3c')]);_0x368865[_0xf80d('0x3d')]=qs[_0xf80d('0x35')](_[_0xf80d('0x3e')](_0x1603a4['query'],_0x3ce924[_0xf80d('0x35')]),_0x401cfb);if(_0x1603a4[_0xf80d('0x33')][_0xf80d('0x3f')]){_0x368865['where']=_[_0xf80d('0x40')](_0x368865['where'],{'$or':_[_0xf80d('0x41')](_0x401cfb,function(_0x1a4ab7){if(_0x1a4ab7[_0xf80d('0x42')]!==_0xf80d('0x43')){var _0x4a3c5e={};_0x4a3c5e[_0x1a4ab7['name']]={'$like':'%'+_0x1603a4['query'][_0xf80d('0x3f')]+'%'};return _0x4a3c5e;}})});}_0x368865=_[_0xf80d('0x40')]({},_0x368865,_0x1603a4[_0xf80d('0x44')]);var _0x4b9f1d={'where':_0x368865[_0xf80d('0x3d')]};return db[_0xf80d('0x2f')]['count'](_0x4b9f1d)[_0xf80d('0x27')](function(_0x511310){_0x5eab42[_0xf80d('0x21')]=_0x511310;if(_0x1603a4['query'][_0xf80d('0x45')]){_0x368865['include']=[{'all':!![]}];}return db[_0xf80d('0x2f')][_0xf80d('0x46')](_0x368865);})[_0xf80d('0x27')](function(_0x2cd371){_0x5eab42[_0xf80d('0x47')]=_0x2cd371;return _0x5eab42;})[_0xf80d('0x27')](respondWithFilteredResult(_0x3e2c8c,_0x368865))[_0xf80d('0x48')](handleError(_0x3e2c8c,null));};exports[_0xf80d('0x49')]=function(_0x99e531,_0x80f24a){var _0x1fcbad={'raw':!![],'where':{'id':_0x99e531[_0xf80d('0x4a')]['id']}},_0x437e44={};_0x437e44[_0xf80d('0x32')]=_[_0xf80d('0x34')](db[_0xf80d('0x2f')][_0xf80d('0x30')]);_0x437e44[_0xf80d('0x33')]=_[_0xf80d('0x34')](_0x99e531[_0xf80d('0x33')]);_0x437e44[_0xf80d('0x35')]=_[_0xf80d('0x36')](_0x437e44[_0xf80d('0x32')],_0x437e44[_0xf80d('0x33')]);_0x1fcbad[_0xf80d('0x37')]=_['intersection'](_0x437e44[_0xf80d('0x32')],qs[_0xf80d('0x38')](_0x99e531[_0xf80d('0x33')][_0xf80d('0x38')]));_0x1fcbad[_0xf80d('0x37')]=_0x1fcbad['attributes'][_0xf80d('0x4b')]?_0x1fcbad[_0xf80d('0x37')]:_0x437e44[_0xf80d('0x32')];if(_0x99e531[_0xf80d('0x33')][_0xf80d('0x45')]){_0x1fcbad[_0xf80d('0x4c')]=[{'all':!![]}];}_0x1fcbad=_[_0xf80d('0x40')]({},_0x1fcbad,_0x99e531[_0xf80d('0x44')]);return db[_0xf80d('0x2f')][_0xf80d('0x4d')](_0x1fcbad)[_0xf80d('0x27')](handleEntityNotFound(_0x80f24a,null))[_0xf80d('0x27')](respondWithResult(_0x80f24a,null))[_0xf80d('0x48')](handleError(_0x80f24a,null));};exports[_0xf80d('0x4e')]=function(_0x3a420d,_0x10d5b5){return db[_0xf80d('0x2f')]['create'](_0x3a420d[_0xf80d('0x4f')],{})[_0xf80d('0x27')](respondWithResult(_0x10d5b5,0xc9))[_0xf80d('0x48')](handleError(_0x10d5b5,null));};exports['update']=function(_0x3e5cf6,_0x1088ca){if(_0x3e5cf6['body']['id']){delete _0x3e5cf6['body']['id'];}return db[_0xf80d('0x2f')]['find']({'where':{'id':_0x3e5cf6[_0xf80d('0x4a')]['id']}})[_0xf80d('0x27')](handleEntityNotFound(_0x1088ca,null))[_0xf80d('0x27')](saveUpdates(_0x3e5cf6[_0xf80d('0x4f')],null))[_0xf80d('0x27')](respondWithResult(_0x1088ca,null))[_0xf80d('0x48')](handleError(_0x1088ca,null));};exports[_0xf80d('0x28')]=function(_0x114132,_0x115d1f){return db[_0xf80d('0x2f')][_0xf80d('0x4d')]({'where':{'id':_0x114132[_0xf80d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x115d1f,null))[_0xf80d('0x27')](removeEntity(_0x115d1f,null))[_0xf80d('0x48')](handleError(_0x115d1f,null));}; \ No newline at end of file +var _0x4483=['offset','undefined','limit','count','set','apply','reject','update','destroy','then','stack','name','send','index','FreshdeskField','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','includeAll','include','findAll','catch','show','params','filters','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json'];(function(_0x24c9a2,_0x351910){var _0x4895eb=function(_0x445f80){while(--_0x445f80){_0x24c9a2['push'](_0x24c9a2['shift']());}};_0x4895eb(++_0x351910);}(_0x4483,0x1a3));var _0x3448=function(_0x475bf1,_0x5235b6){_0x475bf1=_0x475bf1-0x0;var _0x4095d1=_0x4483[_0x475bf1];return _0x4095d1;};'use strict';var emlformat=require(_0x3448('0x0'));var rimraf=require(_0x3448('0x1'));var zipdir=require(_0x3448('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3448('0x3'));var moment=require(_0x3448('0x4'));var BPromise=require(_0x3448('0x5'));var Mustache=require(_0x3448('0x6'));var util=require(_0x3448('0x7'));var path=require('path');var sox=require(_0x3448('0x8'));var csv=require(_0x3448('0x9'));var ejs=require(_0x3448('0xa'));var fs=require('fs');var fs_extra=require(_0x3448('0xb'));var _=require(_0x3448('0xc'));var squel=require(_0x3448('0xd'));var crypto=require(_0x3448('0xe'));var jsforce=require(_0x3448('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3448('0x10'));var Papa=require(_0x3448('0x11'));var Redis=require(_0x3448('0x12'));var authService=require(_0x3448('0x13'));var qs=require(_0x3448('0x14'));var as=require(_0x3448('0x15'));var hardwareService=require(_0x3448('0x16'));var logger=require(_0x3448('0x17'))(_0x3448('0x18'));var utils=require(_0x3448('0x19'));var config=require(_0x3448('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x298ae6,_0x38fbb1){_0x38fbb1=_0x38fbb1||0xcc;return function(_0x5f52bd){if(_0x5f52bd){return _0x298ae6[_0x3448('0x1b')](_0x38fbb1);}return _0x298ae6[_0x3448('0x1c')](_0x38fbb1)[_0x3448('0x1d')]();};}function respondWithResult(_0x549306,_0x14104c){_0x14104c=_0x14104c||0xc8;return function(_0x2952a6){if(_0x2952a6){return _0x549306['status'](_0x14104c)[_0x3448('0x1e')](_0x2952a6);}};}function respondWithFilteredResult(_0x2c2da6,_0x46784f){return function(_0x4fc70f){if(_0x4fc70f){var _0x472518=typeof _0x46784f[_0x3448('0x1f')]===_0x3448('0x20')&&typeof _0x46784f[_0x3448('0x21')]===_0x3448('0x20');var _0x1b2081=_0x4fc70f[_0x3448('0x22')];var _0x425514=_0x472518?0x0:_0x46784f['offset'];var _0x1658cd=_0x472518?_0x4fc70f['count']:_0x46784f['offset']+_0x46784f['limit'];var _0x1e9774;if(_0x1658cd>=_0x1b2081){_0x1658cd=_0x1b2081;_0x1e9774=0xc8;}else{_0x1e9774=0xce;}_0x2c2da6[_0x3448('0x1c')](_0x1e9774);return _0x2c2da6[_0x3448('0x23')]('Content-Range',_0x425514+'-'+_0x1658cd+'/'+_0x1b2081)[_0x3448('0x1e')](_0x4fc70f);}return null;};}function patchUpdates(_0x392c8d){return function(_0x317de6){try{jsonpatch[_0x3448('0x24')](_0x317de6,_0x392c8d,!![]);}catch(_0x29a15a){return BPromise[_0x3448('0x25')](_0x29a15a);}return _0x317de6['save']();};}function saveUpdates(_0x54c7ee,_0x4e6716){return function(_0x1b3d5a){if(_0x1b3d5a){return _0x1b3d5a[_0x3448('0x26')](_0x54c7ee)['then'](function(_0x5b1f7c){return _0x5b1f7c;});}return null;};}function removeEntity(_0x2dcd40,_0x4371d6){return function(_0x22ad5c){if(_0x22ad5c){return _0x22ad5c[_0x3448('0x27')]()[_0x3448('0x28')](function(){_0x2dcd40['status'](0xcc)[_0x3448('0x1d')]();});}};}function handleEntityNotFound(_0x1b5c49,_0x114244){return function(_0x2088de){if(!_0x2088de){_0x1b5c49[_0x3448('0x1b')](0x194);}return _0x2088de;};}function handleError(_0x56b3ff,_0x329947){_0x329947=_0x329947||0x1f4;return function(_0x393081){logger['error'](_0x393081[_0x3448('0x29')]);if(_0x393081[_0x3448('0x2a')]){delete _0x393081[_0x3448('0x2a')];}_0x56b3ff[_0x3448('0x1c')](_0x329947)[_0x3448('0x2b')](_0x393081);};}exports[_0x3448('0x2c')]=function(_0x31be64,_0x95714e){var _0x5911b8={},_0x3307dc={},_0x450704={'count':0x0,'rows':[]};var _0xcfdc5=_['map'](db[_0x3448('0x2d')]['rawAttributes'],function(_0x486f2c){return{'name':_0x486f2c['fieldName'],'type':_0x486f2c[_0x3448('0x2e')][_0x3448('0x2f')]};});_0x3307dc['model']=_['map'](_0xcfdc5,_0x3448('0x2a'));_0x3307dc[_0x3448('0x30')]=_[_0x3448('0x31')](_0x31be64[_0x3448('0x30')]);_0x3307dc['filters']=_[_0x3448('0x32')](_0x3307dc[_0x3448('0x33')],_0x3307dc[_0x3448('0x30')]);_0x5911b8['attributes']=_[_0x3448('0x32')](_0x3307dc[_0x3448('0x33')],qs['fields'](_0x31be64['query'][_0x3448('0x34')]));_0x5911b8[_0x3448('0x35')]=_0x5911b8[_0x3448('0x35')][_0x3448('0x36')]?_0x5911b8['attributes']:_0x3307dc[_0x3448('0x33')];if(!_0x31be64[_0x3448('0x30')][_0x3448('0x37')](_0x3448('0x38'))){_0x5911b8['limit']=qs[_0x3448('0x21')](_0x31be64[_0x3448('0x30')]['limit']);_0x5911b8[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0x31be64[_0x3448('0x30')][_0x3448('0x1f')]);}_0x5911b8[_0x3448('0x39')]=qs[_0x3448('0x3a')](_0x31be64[_0x3448('0x30')][_0x3448('0x3a')]);_0x5911b8[_0x3448('0x3b')]=qs['filters'](_['pick'](_0x31be64[_0x3448('0x30')],_0x3307dc['filters']),_0xcfdc5);if(_0x31be64[_0x3448('0x30')][_0x3448('0x3c')]){_0x5911b8[_0x3448('0x3b')]=_[_0x3448('0x3d')](_0x5911b8['where'],{'$or':_[_0x3448('0x3e')](_0xcfdc5,function(_0x18fc16){if(_0x18fc16[_0x3448('0x2e')]!==_0x3448('0x3f')){var _0x2e83c6={};_0x2e83c6[_0x18fc16[_0x3448('0x2a')]]={'$like':'%'+_0x31be64[_0x3448('0x30')][_0x3448('0x3c')]+'%'};return _0x2e83c6;}})});}_0x5911b8=_[_0x3448('0x3d')]({},_0x5911b8,_0x31be64['options']);var _0x39b22e={'where':_0x5911b8[_0x3448('0x3b')]};return db[_0x3448('0x2d')][_0x3448('0x22')](_0x39b22e)[_0x3448('0x28')](function(_0x58963d){_0x450704[_0x3448('0x22')]=_0x58963d;if(_0x31be64[_0x3448('0x30')][_0x3448('0x40')]){_0x5911b8[_0x3448('0x41')]=[{'all':!![]}];}return db[_0x3448('0x2d')][_0x3448('0x42')](_0x5911b8);})[_0x3448('0x28')](function(_0x3db5f1){_0x450704['rows']=_0x3db5f1;return _0x450704;})[_0x3448('0x28')](respondWithFilteredResult(_0x95714e,_0x5911b8))[_0x3448('0x43')](handleError(_0x95714e,null));};exports[_0x3448('0x44')]=function(_0x4a04d0,_0x2465ff){var _0x1d2a7c={'raw':!![],'where':{'id':_0x4a04d0[_0x3448('0x45')]['id']}},_0x21f989={};_0x21f989[_0x3448('0x33')]=_[_0x3448('0x31')](db[_0x3448('0x2d')]['rawAttributes']);_0x21f989[_0x3448('0x30')]=_[_0x3448('0x31')](_0x4a04d0[_0x3448('0x30')]);_0x21f989[_0x3448('0x46')]=_[_0x3448('0x32')](_0x21f989[_0x3448('0x33')],_0x21f989['query']);_0x1d2a7c[_0x3448('0x35')]=_['intersection'](_0x21f989['model'],qs[_0x3448('0x34')](_0x4a04d0[_0x3448('0x30')]['fields']));_0x1d2a7c[_0x3448('0x35')]=_0x1d2a7c[_0x3448('0x35')]['length']?_0x1d2a7c[_0x3448('0x35')]:_0x21f989[_0x3448('0x33')];if(_0x4a04d0['query'][_0x3448('0x40')]){_0x1d2a7c[_0x3448('0x41')]=[{'all':!![]}];}_0x1d2a7c=_[_0x3448('0x3d')]({},_0x1d2a7c,_0x4a04d0[_0x3448('0x47')]);return db[_0x3448('0x2d')][_0x3448('0x48')](_0x1d2a7c)[_0x3448('0x28')](handleEntityNotFound(_0x2465ff,null))['then'](respondWithResult(_0x2465ff,null))['catch'](handleError(_0x2465ff,null));};exports[_0x3448('0x49')]=function(_0x3c9b82,_0x1b82e7){return db[_0x3448('0x2d')]['create'](_0x3c9b82[_0x3448('0x4a')],{})[_0x3448('0x28')](respondWithResult(_0x1b82e7,0xc9))[_0x3448('0x43')](handleError(_0x1b82e7,null));};exports[_0x3448('0x26')]=function(_0x363374,_0x5d942b){if(_0x363374[_0x3448('0x4a')]['id']){delete _0x363374['body']['id'];}return db[_0x3448('0x2d')][_0x3448('0x48')]({'where':{'id':_0x363374['params']['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x5d942b,null))[_0x3448('0x28')](saveUpdates(_0x363374[_0x3448('0x4a')],null))[_0x3448('0x28')](respondWithResult(_0x5d942b,null))[_0x3448('0x43')](handleError(_0x5d942b,null));};exports[_0x3448('0x27')]=function(_0xc769e1,_0x53236c){return db[_0x3448('0x2d')][_0x3448('0x48')]({'where':{'id':_0xc769e1['params']['id']}})['then'](handleEntityNotFound(_0x53236c,null))[_0x3448('0x28')](removeEntity(_0x53236c,null))[_0x3448('0x43')](handleError(_0x53236c,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 300f32e..5d91e23 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.model.js +++ b/server/api/intFreshdeskField/intFreshdeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b3=['freshdesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields'];(function(_0x3dcd52,_0x2c151a){var _0x4fb1c2=function(_0x34081a){while(--_0x34081a){_0x3dcd52['push'](_0x3dcd52['shift']());}};_0x4fb1c2(++_0x2c151a);}(_0xe5b3,0x133));var _0x3e5b=function(_0x26ded4,_0x2681e2){_0x26ded4=_0x26ded4-0x0;var _0xb52561=_0xe5b3[_0x26ded4];return _0xb52561;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var logger=require(_0x3e5b('0x1'))(_0x3e5b('0x2'));var moment=require(_0x3e5b('0x3'));var BPromise=require(_0x3e5b('0x4'));var rp=require(_0x3e5b('0x5'));var fs=require('fs');var path=require(_0x3e5b('0x6'));var rimraf=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var attributes=require(_0x3e5b('0x9'));module[_0x3e5b('0xa')]=function(_0x54e1fb,_0x174923){return _0x54e1fb[_0x3e5b('0xb')]('FreshdeskField',attributes,{'tableName':_0x3e5b('0xc'),'paranoid':![],'indexes':[{'name':_0x3e5b('0xd'),'fields':[_0x3e5b('0xe'),_0x3e5b('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1036=['bluebird','request-promise','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','FieldId','lodash','util','api','moment'];(function(_0x7753b8,_0x20ef98){var _0x40cb6f=function(_0x2523e4){while(--_0x2523e4){_0x7753b8['push'](_0x7753b8['shift']());}};_0x40cb6f(++_0x20ef98);}(_0x1036,0x18f));var _0x6103=function(_0x1febab,_0x212e9d){_0x1febab=_0x1febab-0x0;var _0x3e3287=_0x1036[_0x1febab];return _0x3e3287;};'use strict';var _=require(_0x6103('0x0'));var util=require(_0x6103('0x1'));var logger=require('../../config/logger')(_0x6103('0x2'));var moment=require(_0x6103('0x3'));var BPromise=require(_0x6103('0x4'));var rp=require(_0x6103('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6103('0x6'));var attributes=require(_0x6103('0x7'));module[_0x6103('0x8')]=function(_0x21bc0c,_0x276b4){return _0x21bc0c[_0x6103('0x9')](_0x6103('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x6103('0xb'),'fields':['idField',_0x6103('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 2fe938f..a92fd8b 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.rpc.js +++ b/server/api/intFreshdeskField/intFreshdeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x929d=['jayson/promise','http','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x33bfb3,_0xc8d3d2){var _0x5bc9dd=function(_0x804567){while(--_0x804567){_0x33bfb3['push'](_0x33bfb3['shift']());}};_0x5bc9dd(++_0xc8d3d2);}(_0x929d,0x98));var _0xd929=function(_0x44a81c,_0x119bba){_0x44a81c=_0x44a81c-0x0;var _0x507869=_0x929d[_0x44a81c];return _0x507869;};'use strict';var _=require(_0xd929('0x0'));var util=require(_0xd929('0x1'));var moment=require(_0xd929('0x2'));var BPromise=require(_0xd929('0x3'));var rs=require(_0xd929('0x4'));var fs=require('fs');var Redis=require(_0xd929('0x5'));var db=require(_0xd929('0x6'))['db'];var utils=require(_0xd929('0x7'));var logger=require(_0xd929('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd929('0x9'));var client=jayson['client'][_0xd929('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ae7d7,_0x3d70f2,_0x411d83){return new BPromise(function(_0xa2a978,_0x44c623){return client['request'](_0x5ae7d7,_0x411d83)[_0xd929('0xb')](function(_0x26291e){logger[_0xd929('0xc')](_0xd929('0xd'),_0x3d70f2,_0xd929('0xe'));logger[_0xd929('0xf')](_0xd929('0x10'),_0x3d70f2,_0xd929('0xe'),JSON[_0xd929('0x11')](_0x26291e));if(_0x26291e[_0xd929('0x12')]){if(_0x26291e[_0xd929('0x12')][_0xd929('0x13')]===0x1f4){logger['error'](_0xd929('0xd'),_0x3d70f2,_0x26291e[_0xd929('0x12')][_0xd929('0x14')]);return _0x44c623(_0x26291e['error'][_0xd929('0x14')]);}logger['error'](_0xd929('0xd'),_0x3d70f2,_0x26291e[_0xd929('0x12')]['message']);return _0xa2a978(_0x26291e[_0xd929('0x12')][_0xd929('0x14')]);}else{logger[_0xd929('0xc')](_0xd929('0xd'),_0x3d70f2,_0xd929('0xe'));_0xa2a978(_0x26291e[_0xd929('0x15')][_0xd929('0x14')]);}})[_0xd929('0x16')](function(_0x3c4b4e){logger[_0xd929('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x3d70f2,_0x3c4b4e);_0x44c623(_0x3c4b4e);});});} \ No newline at end of file +var _0xd350=['debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x2df864,_0x1e1504){var _0x17a34b=function(_0x549b90){while(--_0x549b90){_0x2df864['push'](_0x2df864['shift']());}};_0x17a34b(++_0x1e1504);}(_0xd350,0x65));var _0x0d35=function(_0x1460f6,_0x59051a){_0x1460f6=_0x1460f6-0x0;var _0x46ce94=_0xd350[_0x1460f6];return _0x46ce94;};'use strict';var _=require(_0x0d35('0x0'));var util=require(_0x0d35('0x1'));var moment=require(_0x0d35('0x2'));var BPromise=require(_0x0d35('0x3'));var rs=require(_0x0d35('0x4'));var fs=require('fs');var Redis=require(_0x0d35('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d35('0x6'));var logger=require('../../config/logger')(_0x0d35('0x7'));var config=require('../../config/environment');var jayson=require(_0x0d35('0x8'));var client=jayson[_0x0d35('0x9')][_0x0d35('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d40ca,_0x3d3ff,_0x53f8ac){return new BPromise(function(_0x29aef8,_0xdd2e16){return client[_0x0d35('0xb')](_0x2d40ca,_0x53f8ac)['then'](function(_0x11c752){logger[_0x0d35('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x3d3ff,_0x0d35('0xd'));logger[_0x0d35('0xe')](_0x0d35('0xf'),_0x3d3ff,_0x0d35('0xd'),JSON[_0x0d35('0x10')](_0x11c752));if(_0x11c752['error']){if(_0x11c752[_0x0d35('0x11')][_0x0d35('0x12')]===0x1f4){logger['error'](_0x0d35('0x13'),_0x3d3ff,_0x11c752['error'][_0x0d35('0x14')]);return _0xdd2e16(_0x11c752[_0x0d35('0x11')]['message']);}logger['error'](_0x0d35('0x13'),_0x3d3ff,_0x11c752[_0x0d35('0x11')][_0x0d35('0x14')]);return _0x29aef8(_0x11c752[_0x0d35('0x11')][_0x0d35('0x14')]);}else{logger[_0x0d35('0xc')](_0x0d35('0x13'),_0x3d3ff,_0x0d35('0xd'));_0x29aef8(_0x11c752[_0x0d35('0x15')][_0x0d35('0x14')]);}})[_0x0d35('0x16')](function(_0x1f176d){logger['error'](_0x0d35('0x13'),_0x3d3ff,_0x1f176d);_0xdd2e16(_0x1f176d);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index fc6e8f6..d32638f 100644 --- a/server/api/intFreshsalesAccount/index.js +++ b/server/api/intFreshsalesAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb74=['getFields','post','/:id/configurations','addConfiguration','put','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','show','getConfigurations','/:id/fields'];(function(_0x195db7,_0x80c3d6){var _0x3afb5e=function(_0x256392){while(--_0x256392){_0x195db7['push'](_0x195db7['shift']());}};_0x3afb5e(++_0x80c3d6);}(_0xeb74,0xe3));var _0x4eb7=function(_0x44210f,_0xd81690){_0x44210f=_0x44210f-0x0;var _0x907ced=_0xeb74[_0x44210f];return _0x907ced;};'use strict';var multer=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var path=require(_0x4eb7('0x2'));var timeout=require(_0x4eb7('0x3'));var express=require(_0x4eb7('0x4'));var router=express[_0x4eb7('0x5')]();var fs_extra=require(_0x4eb7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4eb7('0x7'));var config=require(_0x4eb7('0x8'));var controller=require(_0x4eb7('0x9'));router[_0x4eb7('0xa')]('/',auth[_0x4eb7('0xb')](),controller['index']);router[_0x4eb7('0xa')]('/:id',auth[_0x4eb7('0xb')](),controller[_0x4eb7('0xc')]);router['get']('/:id/configurations',auth[_0x4eb7('0xb')](),controller[_0x4eb7('0xd')]);router['get'](_0x4eb7('0xe'),auth['isAuthenticated'](),controller[_0x4eb7('0xf')]);router[_0x4eb7('0x10')]('/',auth[_0x4eb7('0xb')](),controller['create']);router[_0x4eb7('0x10')](_0x4eb7('0x11'),auth[_0x4eb7('0xb')](),controller[_0x4eb7('0x12')]);router[_0x4eb7('0x13')](_0x4eb7('0x14'),auth[_0x4eb7('0xb')](),controller['update']);router['delete']('/:id',auth[_0x4eb7('0xb')](),controller['destroy']);module[_0x4eb7('0x15')]=router; \ No newline at end of file +var _0x57f8=['/:id','/:id/configurations','/:id/fields','post','create','addConfiguration','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated'];(function(_0x75f34b,_0x305dfa){var _0x1ecf52=function(_0x1cd69f){while(--_0x1cd69f){_0x75f34b['push'](_0x75f34b['shift']());}};_0x1ecf52(++_0x305dfa);}(_0x57f8,0x198));var _0x857f=function(_0x169d90,_0x1e8ddf){_0x169d90=_0x169d90-0x0;var _0x2b501e=_0x57f8[_0x169d90];return _0x2b501e;};'use strict';var multer=require('multer');var util=require(_0x857f('0x0'));var path=require(_0x857f('0x1'));var timeout=require(_0x857f('0x2'));var express=require(_0x857f('0x3'));var router=express[_0x857f('0x4')]();var fs_extra=require(_0x857f('0x5'));var auth=require(_0x857f('0x6'));var interaction=require(_0x857f('0x7'));var config=require(_0x857f('0x8'));var controller=require(_0x857f('0x9'));router[_0x857f('0xa')]('/',auth[_0x857f('0xb')](),controller['index']);router[_0x857f('0xa')](_0x857f('0xc'),auth[_0x857f('0xb')](),controller['show']);router[_0x857f('0xa')](_0x857f('0xd'),auth[_0x857f('0xb')](),controller['getConfigurations']);router[_0x857f('0xa')](_0x857f('0xe'),auth[_0x857f('0xb')](),controller['getFields']);router[_0x857f('0xf')]('/',auth[_0x857f('0xb')](),controller[_0x857f('0x10')]);router[_0x857f('0xf')](_0x857f('0xd'),auth[_0x857f('0xb')](),controller[_0x857f('0x11')]);router['put'](_0x857f('0xc'),auth[_0x857f('0xb')](),controller[_0x857f('0x12')]);router[_0x857f('0x13')](_0x857f('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x857f('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index f00880e..c6afdbe 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x160f=['sequelize','exports','STRING','username','remoteUri'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf160('0x0'));module[_0xf160('0x1')]={'name':{'type':Sequelize[_0xf160('0x2')]},'description':{'type':Sequelize[_0xf160('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xf160('0x3')},'apiKey':{'type':Sequelize[_0xf160('0x2')]},'remoteUri':{'type':Sequelize[_0xf160('0x2')],'unique':_0xf160('0x4')},'serverUrl':{'type':Sequelize[_0xf160('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8f4c=['sequelize','exports','STRING','username','remoteUri'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x8f4c,0x113));var _0xc8f4=function(_0x2902c2,_0x40150){_0x2902c2=_0x2902c2-0x0;var _0x16f4fb=_0x8f4c[_0x2902c2];return _0x16f4fb;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'name':{'type':Sequelize[_0xc8f4('0x2')]},'description':{'type':Sequelize[_0xc8f4('0x2')]},'username':{'type':Sequelize[_0xc8f4('0x2')],'unique':_0xc8f4('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc8f4('0x2')],'unique':_0xc8f4('0x4')},'serverUrl':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 4b1c989..028c9ed 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bd7=['key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','FreshsalesAccount','includeAll','include','rows','catch','show','params','options','create','body','destroy','find','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','Descriptions','remoteUri','username','substring','lastIndexOf','format','/api/selector/owners','Token\x20token=','apiKey','users','email','statusCode','error','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','rawAttributes','fieldName','type'];(function(_0x574703,_0x53b5d5){var _0x1c707a=function(_0x5c5116){while(--_0x5c5116){_0x574703['push'](_0x574703['shift']());}};_0x1c707a(++_0x53b5d5);}(_0x8bd7,0x101));var _0x78bd=function(_0x1ca1ea,_0x1a13d5){_0x1ca1ea=_0x1ca1ea-0x0;var _0x3420d6=_0x8bd7[_0x1ca1ea];return _0x3420d6;};'use strict';var emlformat=require(_0x78bd('0x0'));var rimraf=require(_0x78bd('0x1'));var zipdir=require(_0x78bd('0x2'));var jsonpatch=require(_0x78bd('0x3'));var rp=require(_0x78bd('0x4'));var moment=require(_0x78bd('0x5'));var BPromise=require(_0x78bd('0x6'));var Mustache=require(_0x78bd('0x7'));var util=require(_0x78bd('0x8'));var path=require(_0x78bd('0x9'));var sox=require(_0x78bd('0xa'));var csv=require(_0x78bd('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x78bd('0xc'));var squel=require(_0x78bd('0xd'));var crypto=require(_0x78bd('0xe'));var jsforce=require(_0x78bd('0xf'));var deskjs=require(_0x78bd('0x10'));var toCsv=require(_0x78bd('0xb'));var querystring=require(_0x78bd('0x11'));var Papa=require('papaparse');var Redis=require(_0x78bd('0x12'));var authService=require(_0x78bd('0x13'));var qs=require(_0x78bd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78bd('0x15'));var logger=require('../../config/logger')(_0x78bd('0x16'));var utils=require(_0x78bd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x78bd('0x18'));var db=require(_0x78bd('0x19'))['db'];var integrations=require(_0x78bd('0x1a'));function respondWithStatusCode(_0x3f46ed,_0x29f2c7){_0x29f2c7=_0x29f2c7||0xcc;return function(_0x53e825){if(_0x53e825){return _0x3f46ed[_0x78bd('0x1b')](_0x29f2c7);}return _0x3f46ed[_0x78bd('0x1c')](_0x29f2c7)[_0x78bd('0x1d')]();};}function respondWithResult(_0x208832,_0x5e2682){_0x5e2682=_0x5e2682||0xc8;return function(_0x257af0){if(_0x257af0){return _0x208832[_0x78bd('0x1c')](_0x5e2682)[_0x78bd('0x1e')](_0x257af0);}};}function respondWithFilteredResult(_0x4929ca,_0x1ebd18){return function(_0x124226){if(_0x124226){var _0x208b55=typeof _0x1ebd18[_0x78bd('0x1f')]===_0x78bd('0x20')&&typeof _0x1ebd18[_0x78bd('0x21')]===_0x78bd('0x20');var _0x2240b6=_0x124226['count'];var _0x48df00=_0x208b55?0x0:_0x1ebd18[_0x78bd('0x1f')];var _0x4f4d48=_0x208b55?_0x124226[_0x78bd('0x22')]:_0x1ebd18[_0x78bd('0x1f')]+_0x1ebd18[_0x78bd('0x21')];var _0x335b67;if(_0x4f4d48>=_0x2240b6){_0x4f4d48=_0x2240b6;_0x335b67=0xc8;}else{_0x335b67=0xce;}_0x4929ca[_0x78bd('0x1c')](_0x335b67);return _0x4929ca[_0x78bd('0x23')](_0x78bd('0x24'),_0x48df00+'-'+_0x4f4d48+'/'+_0x2240b6)[_0x78bd('0x1e')](_0x124226);}return null;};}function patchUpdates(_0x563199){return function(_0x333621){try{jsonpatch[_0x78bd('0x25')](_0x333621,_0x563199,!![]);}catch(_0x4b1b79){return BPromise[_0x78bd('0x26')](_0x4b1b79);}return _0x333621[_0x78bd('0x27')]();};}function saveUpdates(_0x614045,_0x3cfcd2){return function(_0x10332e){if(_0x10332e){return _0x10332e[_0x78bd('0x28')](_0x614045)[_0x78bd('0x29')](function(_0x3060fe){return _0x3060fe;});}return null;};}function removeEntity(_0x41a82f,_0xe3a6){return function(_0x6f455a){if(_0x6f455a){return _0x6f455a['destroy']()['then'](function(){_0x41a82f[_0x78bd('0x1c')](0xcc)[_0x78bd('0x1d')]();});}};}function handleEntityNotFound(_0x533243,_0x1ec732){return function(_0x5ac91a){if(!_0x5ac91a){_0x533243[_0x78bd('0x1b')](0x194);}return _0x5ac91a;};}function handleError(_0x3b737e,_0x5288d4){_0x5288d4=_0x5288d4||0x1f4;return function(_0x4c8b5a){logger['error'](_0x4c8b5a[_0x78bd('0x2a')]);if(_0x4c8b5a['name']){delete _0x4c8b5a[_0x78bd('0x2b')];}_0x3b737e[_0x78bd('0x1c')](_0x5288d4)['send'](_0x4c8b5a);};}exports[_0x78bd('0x2c')]=function(_0x27bcb8,_0x141b3f){var _0x40c8d5={},_0x289764={},_0x44040d={'count':0x0,'rows':[]};var _0x1bcf74=_[_0x78bd('0x2d')](db['FreshsalesAccount'][_0x78bd('0x2e')],function(_0x293cd9){return{'name':_0x293cd9[_0x78bd('0x2f')],'type':_0x293cd9[_0x78bd('0x30')][_0x78bd('0x31')]};});_0x289764[_0x78bd('0x32')]=_['map'](_0x1bcf74,_0x78bd('0x2b'));_0x289764[_0x78bd('0x33')]=_[_0x78bd('0x34')](_0x27bcb8[_0x78bd('0x33')]);_0x289764[_0x78bd('0x35')]=_[_0x78bd('0x36')](_0x289764[_0x78bd('0x32')],_0x289764['query']);_0x40c8d5['attributes']=_[_0x78bd('0x36')](_0x289764['model'],qs[_0x78bd('0x37')](_0x27bcb8[_0x78bd('0x33')][_0x78bd('0x37')]));_0x40c8d5[_0x78bd('0x38')]=_0x40c8d5['attributes'][_0x78bd('0x39')]?_0x40c8d5[_0x78bd('0x38')]:_0x289764['model'];if(!_0x27bcb8[_0x78bd('0x33')][_0x78bd('0x3a')](_0x78bd('0x3b'))){_0x40c8d5[_0x78bd('0x21')]=qs[_0x78bd('0x21')](_0x27bcb8[_0x78bd('0x33')]['limit']);_0x40c8d5[_0x78bd('0x1f')]=qs[_0x78bd('0x1f')](_0x27bcb8[_0x78bd('0x33')][_0x78bd('0x1f')]);}_0x40c8d5[_0x78bd('0x3c')]=qs[_0x78bd('0x3d')](_0x27bcb8[_0x78bd('0x33')][_0x78bd('0x3d')]);_0x40c8d5[_0x78bd('0x3e')]=qs['filters'](_[_0x78bd('0x3f')](_0x27bcb8['query'],_0x289764[_0x78bd('0x35')]),_0x1bcf74);if(_0x27bcb8['query'][_0x78bd('0x40')]){_0x40c8d5[_0x78bd('0x3e')]=_['merge'](_0x40c8d5[_0x78bd('0x3e')],{'$or':_[_0x78bd('0x2d')](_0x1bcf74,function(_0x59d594){if(_0x59d594['type']!=='VIRTUAL'){var _0x54d83e={};_0x54d83e[_0x59d594['name']]={'$like':'%'+_0x27bcb8[_0x78bd('0x33')][_0x78bd('0x40')]+'%'};return _0x54d83e;}})});}_0x40c8d5=_[_0x78bd('0x41')]({},_0x40c8d5,_0x27bcb8['options']);var _0x31ac5b={'where':_0x40c8d5['where']};return db[_0x78bd('0x42')][_0x78bd('0x22')](_0x31ac5b)[_0x78bd('0x29')](function(_0x535984){_0x44040d[_0x78bd('0x22')]=_0x535984;if(_0x27bcb8[_0x78bd('0x33')][_0x78bd('0x43')]){_0x40c8d5[_0x78bd('0x44')]=[{'all':!![]}];}return db[_0x78bd('0x42')]['findAll'](_0x40c8d5);})[_0x78bd('0x29')](function(_0x231366){_0x44040d[_0x78bd('0x45')]=_0x231366;return _0x44040d;})[_0x78bd('0x29')](respondWithFilteredResult(_0x141b3f,_0x40c8d5))[_0x78bd('0x46')](handleError(_0x141b3f,null));};exports[_0x78bd('0x47')]=function(_0x33801b,_0x494c5e){var _0x321258={'raw':![],'where':{'id':_0x33801b[_0x78bd('0x48')]['id']}},_0x25ef6e={};_0x25ef6e[_0x78bd('0x32')]=_[_0x78bd('0x34')](db['FreshsalesAccount'][_0x78bd('0x2e')]);_0x25ef6e[_0x78bd('0x33')]=_[_0x78bd('0x34')](_0x33801b[_0x78bd('0x33')]);_0x25ef6e[_0x78bd('0x35')]=_[_0x78bd('0x36')](_0x25ef6e[_0x78bd('0x32')],_0x25ef6e[_0x78bd('0x33')]);_0x321258[_0x78bd('0x38')]=_[_0x78bd('0x36')](_0x25ef6e[_0x78bd('0x32')],qs[_0x78bd('0x37')](_0x33801b[_0x78bd('0x33')][_0x78bd('0x37')]));_0x321258[_0x78bd('0x38')]=_0x321258[_0x78bd('0x38')][_0x78bd('0x39')]?_0x321258[_0x78bd('0x38')]:_0x25ef6e[_0x78bd('0x32')];if(_0x33801b[_0x78bd('0x33')]['includeAll']){_0x321258['include']=[{'all':!![]}];}_0x321258=_[_0x78bd('0x41')]({},_0x321258,_0x33801b[_0x78bd('0x49')]);return db[_0x78bd('0x42')]['find'](_0x321258)[_0x78bd('0x29')](handleEntityNotFound(_0x494c5e,null))['then'](respondWithResult(_0x494c5e,null))[_0x78bd('0x46')](handleError(_0x494c5e,null));};exports[_0x78bd('0x4a')]=function(_0x321948,_0x328749){return db[_0x78bd('0x42')][_0x78bd('0x4a')](_0x321948[_0x78bd('0x4b')],{})['then'](respondWithResult(_0x328749,0xc9))[_0x78bd('0x46')](handleError(_0x328749,null));};exports[_0x78bd('0x28')]=function(_0xb3d79b,_0x56792e){if(_0xb3d79b[_0x78bd('0x4b')]['id']){delete _0xb3d79b[_0x78bd('0x4b')]['id'];}return db[_0x78bd('0x42')]['find']({'where':{'id':_0xb3d79b[_0x78bd('0x48')]['id']}})[_0x78bd('0x29')](handleEntityNotFound(_0x56792e,null))['then'](saveUpdates(_0xb3d79b[_0x78bd('0x4b')],null))[_0x78bd('0x29')](respondWithResult(_0x56792e,null))['catch'](handleError(_0x56792e,null));};exports[_0x78bd('0x4c')]=function(_0x35e4d6,_0xd95c29){return db[_0x78bd('0x42')][_0x78bd('0x4d')]({'where':{'id':_0x35e4d6[_0x78bd('0x48')]['id']}})['then'](handleEntityNotFound(_0xd95c29,null))[_0x78bd('0x29')](removeEntity(_0xd95c29,null))[_0x78bd('0x46')](handleError(_0xd95c29,null));};exports[_0x78bd('0x4e')]=function(_0x548bf5,_0x3bdf31,_0x27210a){var _0x299695={};var _0x3c6cf7={};var _0x35ac24;var _0x5e9a95;return db[_0x78bd('0x42')][_0x78bd('0x4f')]({'where':{'id':_0x548bf5[_0x78bd('0x48')]['id']}})[_0x78bd('0x29')](handleEntityNotFound(_0x3bdf31,null))[_0x78bd('0x29')](function(_0x25b060){if(_0x25b060){_0x35ac24=_0x25b060;_0x3c6cf7['model']=_[_0x78bd('0x34')](db[_0x78bd('0x50')][_0x78bd('0x2e')]);_0x3c6cf7['query']=_[_0x78bd('0x34')](_0x548bf5[_0x78bd('0x33')]);_0x3c6cf7[_0x78bd('0x35')]=_['intersection'](_0x3c6cf7[_0x78bd('0x32')],_0x3c6cf7[_0x78bd('0x33')]);_0x299695[_0x78bd('0x38')]=_[_0x78bd('0x36')](_0x3c6cf7[_0x78bd('0x32')],qs['fields'](_0x548bf5['query'][_0x78bd('0x37')]));_0x299695['attributes']=_0x299695['attributes']['length']?_0x299695[_0x78bd('0x38')]:_0x3c6cf7['model'];_0x299695['order']=qs['sort'](_0x548bf5[_0x78bd('0x33')]['sort']);_0x299695[_0x78bd('0x3e')]=qs[_0x78bd('0x35')](_['pick'](_0x548bf5[_0x78bd('0x33')],_0x3c6cf7[_0x78bd('0x35')]));if(_0x548bf5[_0x78bd('0x33')][_0x78bd('0x40')]){_0x299695[_0x78bd('0x3e')]=_[_0x78bd('0x41')](_0x299695[_0x78bd('0x3e')],{'$or':_[_0x78bd('0x2d')](_0x299695[_0x78bd('0x38')],function(_0x4236cf){var _0x21d9f2={};_0x21d9f2[_0x4236cf]={'$like':'%'+_0x548bf5[_0x78bd('0x33')][_0x78bd('0x40')]+'%'};return _0x21d9f2;})});}_0x299695=_[_0x78bd('0x41')]({},_0x299695,_0x548bf5[_0x78bd('0x49')]);return _0x35ac24[_0x78bd('0x4e')](_0x299695);}})[_0x78bd('0x29')](function(_0x55578c){if(_0x55578c){_0x5e9a95=_0x55578c[_0x78bd('0x39')];if(!_0x548bf5[_0x78bd('0x33')][_0x78bd('0x3a')](_0x78bd('0x3b'))){_0x299695[_0x78bd('0x21')]=qs[_0x78bd('0x21')](_0x548bf5[_0x78bd('0x33')][_0x78bd('0x21')]);_0x299695[_0x78bd('0x1f')]=qs[_0x78bd('0x1f')](_0x548bf5[_0x78bd('0x33')][_0x78bd('0x1f')]);}return _0x35ac24['getConfigurations'](_0x299695);}})[_0x78bd('0x29')](function(_0x374801){if(_0x374801){return _0x374801?{'count':_0x5e9a95,'rows':_0x374801}:null;}})[_0x78bd('0x29')](respondWithResult(_0x3bdf31,null))['catch'](handleError(_0x3bdf31,null));};exports[_0x78bd('0x51')]=function(_0x9854e7,_0x3768e2,_0x3c598e){if(_0x9854e7[_0x78bd('0x4b')]['id']){delete _0x9854e7['body']['id'];}return db['FreshsalesAccount'][_0x78bd('0x4f')]({'where':{'id':_0x9854e7['params']['id']}})[_0x78bd('0x29')](handleEntityNotFound(_0x3768e2,null))[_0x78bd('0x29')](function(_0x4b7853){if(_0x4b7853){_0x9854e7['body']['AccountId']=_0x4b7853['id'];_0x9854e7[_0x78bd('0x4b')][_0x78bd('0x52')]=integrations[_0x78bd('0x53')](_0x9854e7[_0x78bd('0x4b')][_0x78bd('0x54')],_0x9854e7[_0x78bd('0x4b')][_0x78bd('0x30')]);_0x9854e7[_0x78bd('0x4b')]['Descriptions']=integrations[_0x78bd('0x55')](_0x9854e7['body'][_0x78bd('0x54')],_0x9854e7[_0x78bd('0x4b')][_0x78bd('0x30')]);return db[_0x78bd('0x50')][_0x78bd('0x4a')](_0x9854e7[_0x78bd('0x4b')],{'include':[{'model':db[_0x78bd('0x56')],'as':'Subjects'},{'model':db[_0x78bd('0x56')],'as':_0x78bd('0x57')}]});}return null;})[_0x78bd('0x29')](respondWithResult(_0x3768e2,null))[_0x78bd('0x46')](handleError(_0x3768e2,null));};exports['getFields']=function(_0x3619cc,_0x24e45c,_0x58b9d8){var _0x44684a='';var _0x2cf1a7='';return db[_0x78bd('0x42')][_0x78bd('0x4f')]({'where':{'id':_0x3619cc[_0x78bd('0x48')]['id']},'attributes':['id','username',_0x78bd('0x58'),'apiKey']})['then'](handleEntityNotFound(_0x24e45c,null))[_0x78bd('0x29')](function(_0x129339){if(_0x129339){_0x2cf1a7=_0x129339[_0x78bd('0x59')];_0x44684a=_0x129339[_0x78bd('0x58')];var _0x771c6=_0x129339[_0x78bd('0x58')]['slice'](-0x1);if(_0x771c6==='/'){_0x44684a=_0x44684a[_0x78bd('0x5a')](0x0,_0x44684a[_0x78bd('0x5b')](_0x771c6));}return rp({'method':'GET','uri':util[_0x78bd('0x5c')]('%s%s',_0x44684a,_0x78bd('0x5d')),'headers':{'Authorization':_0x78bd('0x5e')+_0x129339[_0x78bd('0x5f')]},'json':!![]});}})[_0x78bd('0x29')](function(_0x498a47){if(_0x498a47){var _0x814639=_0x498a47[_0x78bd('0x60')];var _0x2daaa0=![];var _0x3b2711=null;for(_0x3b2711=0x0;_0x3b2711<_0x814639[_0x78bd('0x39')];_0x3b2711++){if(_0x814639[_0x3b2711][_0x78bd('0x61')]===_0x2cf1a7){_0x2daaa0=!![];}}if(_0x2daaa0){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x78bd('0x29')](respondWithResult(_0x24e45c,null))[_0x78bd('0x46')](function(_0x50693f){var _0x1a09df=_0x3619cc[_0x78bd('0x33')]['test']?0x1f4:_0x50693f[_0x78bd('0x62')]||0x1f4;logger[_0x78bd('0x63')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x1a09df,JSON[_0x78bd('0x64')](_0x50693f));delete _0x50693f['name'];if(_0x1a09df===0x191){_0x1a09df=0x190;}_0x24e45c['status'](_0x1a09df)['send'](_0x3619cc[_0x78bd('0x33')][_0x78bd('0x65')]?{'message':'Wrong\x20credentials','statusCode':_0x50693f[_0x78bd('0x62')]}:_0x50693f);});}; \ No newline at end of file +var _0x8ef2=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','FreshsalesAccount','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','rawAttributes','catch','create','body','find','FreshsalesConfiguration','order','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','users','email','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8ef2,0x1db));var _0x28ef=function(_0x133851,_0x4d6780){_0x133851=_0x133851-0x0;var _0x188215=_0x8ef2[_0x133851];return _0x188215;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28ef('0x0'));var zipdir=require(_0x28ef('0x1'));var jsonpatch=require(_0x28ef('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x28ef('0x3'));var util=require('util');var path=require(_0x28ef('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x28ef('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x28ef('0x6'));var squel=require(_0x28ef('0x7'));var crypto=require(_0x28ef('0x8'));var jsforce=require(_0x28ef('0x9'));var deskjs=require(_0x28ef('0xa'));var toCsv=require(_0x28ef('0xb'));var querystring=require(_0x28ef('0xc'));var Papa=require(_0x28ef('0xd'));var Redis=require('ioredis');var authService=require(_0x28ef('0xe'));var qs=require(_0x28ef('0xf'));var as=require(_0x28ef('0x10'));var hardwareService=require(_0x28ef('0x11'));var logger=require('../../config/logger')(_0x28ef('0x12'));var utils=require(_0x28ef('0x13'));var config=require(_0x28ef('0x14'));var licenseUtil=require(_0x28ef('0x15'));var db=require(_0x28ef('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1c066a,_0x2c6adb){_0x2c6adb=_0x2c6adb||0xcc;return function(_0x5c1fb3){if(_0x5c1fb3){return _0x1c066a[_0x28ef('0x17')](_0x2c6adb);}return _0x1c066a[_0x28ef('0x18')](_0x2c6adb)[_0x28ef('0x19')]();};}function respondWithResult(_0x2a04ee,_0x2f1327){_0x2f1327=_0x2f1327||0xc8;return function(_0x287649){if(_0x287649){return _0x2a04ee[_0x28ef('0x18')](_0x2f1327)[_0x28ef('0x1a')](_0x287649);}};}function respondWithFilteredResult(_0x372b4,_0x2bfdd6){return function(_0xc6bf3c){if(_0xc6bf3c){var _0x3b3c48=typeof _0x2bfdd6[_0x28ef('0x1b')]===_0x28ef('0x1c')&&typeof _0x2bfdd6[_0x28ef('0x1d')]===_0x28ef('0x1c');var _0x2728b1=_0xc6bf3c[_0x28ef('0x1e')];var _0x45fd12=_0x3b3c48?0x0:_0x2bfdd6['offset'];var _0x16f3f8=_0x3b3c48?_0xc6bf3c[_0x28ef('0x1e')]:_0x2bfdd6[_0x28ef('0x1b')]+_0x2bfdd6[_0x28ef('0x1d')];var _0x4858a8;if(_0x16f3f8>=_0x2728b1){_0x16f3f8=_0x2728b1;_0x4858a8=0xc8;}else{_0x4858a8=0xce;}_0x372b4[_0x28ef('0x18')](_0x4858a8);return _0x372b4[_0x28ef('0x1f')](_0x28ef('0x20'),_0x45fd12+'-'+_0x16f3f8+'/'+_0x2728b1)['json'](_0xc6bf3c);}return null;};}function patchUpdates(_0x3a8c50){return function(_0xa703d9){try{jsonpatch[_0x28ef('0x21')](_0xa703d9,_0x3a8c50,!![]);}catch(_0x1051e5){return BPromise[_0x28ef('0x22')](_0x1051e5);}return _0xa703d9['save']();};}function saveUpdates(_0x4b62ff,_0x38820){return function(_0x39f40a){if(_0x39f40a){return _0x39f40a['update'](_0x4b62ff)[_0x28ef('0x23')](function(_0x122d83){return _0x122d83;});}return null;};}function removeEntity(_0x3dd7a8,_0x13a79d){return function(_0x5b6b74){if(_0x5b6b74){return _0x5b6b74[_0x28ef('0x24')]()[_0x28ef('0x23')](function(){_0x3dd7a8[_0x28ef('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x304866,_0x4def8a){return function(_0x554a7d){if(!_0x554a7d){_0x304866[_0x28ef('0x17')](0x194);}return _0x554a7d;};}function handleError(_0x2b4112,_0x53a6e5){_0x53a6e5=_0x53a6e5||0x1f4;return function(_0x5b6c7a){logger['error'](_0x5b6c7a[_0x28ef('0x25')]);if(_0x5b6c7a[_0x28ef('0x26')]){delete _0x5b6c7a['name'];}_0x2b4112[_0x28ef('0x18')](_0x53a6e5)[_0x28ef('0x27')](_0x5b6c7a);};}exports[_0x28ef('0x28')]=function(_0x48ec0f,_0x41f88c){var _0x4ad501={},_0x1642db={},_0x2f8f1b={'count':0x0,'rows':[]};var _0x49cfa7=_[_0x28ef('0x29')](db[_0x28ef('0x2a')]['rawAttributes'],function(_0x508d5b){return{'name':_0x508d5b[_0x28ef('0x2b')],'type':_0x508d5b[_0x28ef('0x2c')]['key']};});_0x1642db[_0x28ef('0x2d')]=_[_0x28ef('0x29')](_0x49cfa7,_0x28ef('0x26'));_0x1642db[_0x28ef('0x2e')]=_[_0x28ef('0x2f')](_0x48ec0f[_0x28ef('0x2e')]);_0x1642db[_0x28ef('0x30')]=_[_0x28ef('0x31')](_0x1642db[_0x28ef('0x2d')],_0x1642db[_0x28ef('0x2e')]);_0x4ad501['attributes']=_[_0x28ef('0x31')](_0x1642db[_0x28ef('0x2d')],qs[_0x28ef('0x32')](_0x48ec0f[_0x28ef('0x2e')][_0x28ef('0x32')]));_0x4ad501['attributes']=_0x4ad501[_0x28ef('0x33')][_0x28ef('0x34')]?_0x4ad501[_0x28ef('0x33')]:_0x1642db[_0x28ef('0x2d')];if(!_0x48ec0f['query'][_0x28ef('0x35')](_0x28ef('0x36'))){_0x4ad501[_0x28ef('0x1d')]=qs[_0x28ef('0x1d')](_0x48ec0f[_0x28ef('0x2e')][_0x28ef('0x1d')]);_0x4ad501['offset']=qs[_0x28ef('0x1b')](_0x48ec0f[_0x28ef('0x2e')]['offset']);}_0x4ad501['order']=qs[_0x28ef('0x37')](_0x48ec0f[_0x28ef('0x2e')][_0x28ef('0x37')]);_0x4ad501[_0x28ef('0x38')]=qs[_0x28ef('0x30')](_[_0x28ef('0x39')](_0x48ec0f['query'],_0x1642db[_0x28ef('0x30')]),_0x49cfa7);if(_0x48ec0f[_0x28ef('0x2e')][_0x28ef('0x3a')]){_0x4ad501[_0x28ef('0x38')]=_[_0x28ef('0x3b')](_0x4ad501['where'],{'$or':_['map'](_0x49cfa7,function(_0x5dcbea){if(_0x5dcbea[_0x28ef('0x2c')]!=='VIRTUAL'){var _0x285b62={};_0x285b62[_0x5dcbea[_0x28ef('0x26')]]={'$like':'%'+_0x48ec0f[_0x28ef('0x2e')]['filter']+'%'};return _0x285b62;}})});}_0x4ad501=_[_0x28ef('0x3b')]({},_0x4ad501,_0x48ec0f[_0x28ef('0x3c')]);var _0x420366={'where':_0x4ad501['where']};return db[_0x28ef('0x2a')]['count'](_0x420366)[_0x28ef('0x23')](function(_0x589f90){_0x2f8f1b[_0x28ef('0x1e')]=_0x589f90;if(_0x48ec0f[_0x28ef('0x2e')][_0x28ef('0x3d')]){_0x4ad501[_0x28ef('0x3e')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x28ef('0x3f')](_0x4ad501);})['then'](function(_0xe70f6b){_0x2f8f1b[_0x28ef('0x40')]=_0xe70f6b;return _0x2f8f1b;})[_0x28ef('0x23')](respondWithFilteredResult(_0x41f88c,_0x4ad501))['catch'](handleError(_0x41f88c,null));};exports['show']=function(_0x3dd215,_0x1481a){var _0xac528e={'raw':![],'where':{'id':_0x3dd215[_0x28ef('0x41')]['id']}},_0x465f40={};_0x465f40[_0x28ef('0x2d')]=_['keys'](db[_0x28ef('0x2a')][_0x28ef('0x42')]);_0x465f40[_0x28ef('0x2e')]=_[_0x28ef('0x2f')](_0x3dd215[_0x28ef('0x2e')]);_0x465f40[_0x28ef('0x30')]=_[_0x28ef('0x31')](_0x465f40[_0x28ef('0x2d')],_0x465f40['query']);_0xac528e[_0x28ef('0x33')]=_[_0x28ef('0x31')](_0x465f40[_0x28ef('0x2d')],qs[_0x28ef('0x32')](_0x3dd215[_0x28ef('0x2e')][_0x28ef('0x32')]));_0xac528e[_0x28ef('0x33')]=_0xac528e['attributes'][_0x28ef('0x34')]?_0xac528e['attributes']:_0x465f40[_0x28ef('0x2d')];if(_0x3dd215[_0x28ef('0x2e')]['includeAll']){_0xac528e[_0x28ef('0x3e')]=[{'all':!![]}];}_0xac528e=_[_0x28ef('0x3b')]({},_0xac528e,_0x3dd215[_0x28ef('0x3c')]);return db[_0x28ef('0x2a')]['find'](_0xac528e)['then'](handleEntityNotFound(_0x1481a,null))[_0x28ef('0x23')](respondWithResult(_0x1481a,null))[_0x28ef('0x43')](handleError(_0x1481a,null));};exports[_0x28ef('0x44')]=function(_0x30c1a1,_0x23db80){return db['FreshsalesAccount'][_0x28ef('0x44')](_0x30c1a1[_0x28ef('0x45')],{})[_0x28ef('0x23')](respondWithResult(_0x23db80,0xc9))[_0x28ef('0x43')](handleError(_0x23db80,null));};exports['update']=function(_0x6a06c2,_0x363c47){if(_0x6a06c2[_0x28ef('0x45')]['id']){delete _0x6a06c2[_0x28ef('0x45')]['id'];}return db[_0x28ef('0x2a')][_0x28ef('0x46')]({'where':{'id':_0x6a06c2[_0x28ef('0x41')]['id']}})[_0x28ef('0x23')](handleEntityNotFound(_0x363c47,null))[_0x28ef('0x23')](saveUpdates(_0x6a06c2[_0x28ef('0x45')],null))[_0x28ef('0x23')](respondWithResult(_0x363c47,null))[_0x28ef('0x43')](handleError(_0x363c47,null));};exports[_0x28ef('0x24')]=function(_0x20b973,_0x43277b){return db[_0x28ef('0x2a')][_0x28ef('0x46')]({'where':{'id':_0x20b973[_0x28ef('0x41')]['id']}})[_0x28ef('0x23')](handleEntityNotFound(_0x43277b,null))[_0x28ef('0x23')](removeEntity(_0x43277b,null))[_0x28ef('0x43')](handleError(_0x43277b,null));};exports['getConfigurations']=function(_0x2eac2e,_0x4496ea,_0x3131da){var _0x2ced38={};var _0x467409={};var _0x5a58da;var _0x2a31ce;return db[_0x28ef('0x2a')]['findOne']({'where':{'id':_0x2eac2e['params']['id']}})['then'](handleEntityNotFound(_0x4496ea,null))['then'](function(_0x5ce646){if(_0x5ce646){_0x5a58da=_0x5ce646;_0x467409[_0x28ef('0x2d')]=_[_0x28ef('0x2f')](db[_0x28ef('0x47')][_0x28ef('0x42')]);_0x467409[_0x28ef('0x2e')]=_[_0x28ef('0x2f')](_0x2eac2e[_0x28ef('0x2e')]);_0x467409['filters']=_[_0x28ef('0x31')](_0x467409[_0x28ef('0x2d')],_0x467409['query']);_0x2ced38[_0x28ef('0x33')]=_[_0x28ef('0x31')](_0x467409[_0x28ef('0x2d')],qs[_0x28ef('0x32')](_0x2eac2e[_0x28ef('0x2e')][_0x28ef('0x32')]));_0x2ced38[_0x28ef('0x33')]=_0x2ced38['attributes'][_0x28ef('0x34')]?_0x2ced38[_0x28ef('0x33')]:_0x467409[_0x28ef('0x2d')];_0x2ced38[_0x28ef('0x48')]=qs[_0x28ef('0x37')](_0x2eac2e[_0x28ef('0x2e')][_0x28ef('0x37')]);_0x2ced38['where']=qs[_0x28ef('0x30')](_[_0x28ef('0x39')](_0x2eac2e[_0x28ef('0x2e')],_0x467409[_0x28ef('0x30')]));if(_0x2eac2e[_0x28ef('0x2e')]['filter']){_0x2ced38[_0x28ef('0x38')]=_['merge'](_0x2ced38[_0x28ef('0x38')],{'$or':_[_0x28ef('0x29')](_0x2ced38[_0x28ef('0x33')],function(_0x4382d1){var _0x235c60={};_0x235c60[_0x4382d1]={'$like':'%'+_0x2eac2e[_0x28ef('0x2e')][_0x28ef('0x3a')]+'%'};return _0x235c60;})});}_0x2ced38=_[_0x28ef('0x3b')]({},_0x2ced38,_0x2eac2e['options']);return _0x5a58da[_0x28ef('0x49')](_0x2ced38);}})[_0x28ef('0x23')](function(_0x2de122){if(_0x2de122){_0x2a31ce=_0x2de122[_0x28ef('0x34')];if(!_0x2eac2e[_0x28ef('0x2e')][_0x28ef('0x35')](_0x28ef('0x36'))){_0x2ced38[_0x28ef('0x1d')]=qs[_0x28ef('0x1d')](_0x2eac2e[_0x28ef('0x2e')][_0x28ef('0x1d')]);_0x2ced38['offset']=qs[_0x28ef('0x1b')](_0x2eac2e[_0x28ef('0x2e')][_0x28ef('0x1b')]);}return _0x5a58da[_0x28ef('0x49')](_0x2ced38);}})[_0x28ef('0x23')](function(_0x189067){if(_0x189067){return _0x189067?{'count':_0x2a31ce,'rows':_0x189067}:null;}})['then'](respondWithResult(_0x4496ea,null))[_0x28ef('0x43')](handleError(_0x4496ea,null));};exports[_0x28ef('0x4a')]=function(_0x1dde05,_0xb52e6,_0x58380b){if(_0x1dde05[_0x28ef('0x45')]['id']){delete _0x1dde05[_0x28ef('0x45')]['id'];}return db['FreshsalesAccount'][_0x28ef('0x4b')]({'where':{'id':_0x1dde05[_0x28ef('0x41')]['id']}})[_0x28ef('0x23')](handleEntityNotFound(_0xb52e6,null))[_0x28ef('0x23')](function(_0x314358){if(_0x314358){_0x1dde05[_0x28ef('0x45')][_0x28ef('0x4c')]=_0x314358['id'];_0x1dde05[_0x28ef('0x45')][_0x28ef('0x4d')]=integrations[_0x28ef('0x4e')](_0x1dde05[_0x28ef('0x45')][_0x28ef('0x4f')],_0x1dde05['body'][_0x28ef('0x2c')]);_0x1dde05[_0x28ef('0x45')]['Descriptions']=integrations[_0x28ef('0x50')](_0x1dde05[_0x28ef('0x45')]['channel'],_0x1dde05[_0x28ef('0x45')][_0x28ef('0x2c')]);return db['FreshsalesConfiguration'][_0x28ef('0x44')](_0x1dde05['body'],{'include':[{'model':db[_0x28ef('0x51')],'as':_0x28ef('0x4d')},{'model':db['FreshsalesField'],'as':_0x28ef('0x52')}]});}return null;})[_0x28ef('0x23')](respondWithResult(_0xb52e6,null))[_0x28ef('0x43')](handleError(_0xb52e6,null));};exports[_0x28ef('0x53')]=function(_0x5a0bbf,_0x72db3a,_0x1149d8){var _0xb5960d='';var _0x40abd7='';return db[_0x28ef('0x2a')][_0x28ef('0x4b')]({'where':{'id':_0x5a0bbf[_0x28ef('0x41')]['id']},'attributes':['id',_0x28ef('0x54'),_0x28ef('0x55'),_0x28ef('0x56')]})[_0x28ef('0x23')](handleEntityNotFound(_0x72db3a,null))[_0x28ef('0x23')](function(_0x26b602){if(_0x26b602){_0x40abd7=_0x26b602['username'];_0xb5960d=_0x26b602['remoteUri'];var _0xe29008=_0x26b602[_0x28ef('0x55')][_0x28ef('0x57')](-0x1);if(_0xe29008==='/'){_0xb5960d=_0xb5960d['substring'](0x0,_0xb5960d[_0x28ef('0x58')](_0xe29008));}return rp({'method':_0x28ef('0x59'),'uri':util[_0x28ef('0x5a')](_0x28ef('0x5b'),_0xb5960d,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x26b602['apiKey']},'json':!![]});}})[_0x28ef('0x23')](function(_0x652fcb){if(_0x652fcb){var _0x1e75a1=_0x652fcb[_0x28ef('0x5c')];var _0x11cd9f=![];var _0x11d2e6=null;for(_0x11d2e6=0x0;_0x11d2e6<_0x1e75a1[_0x28ef('0x34')];_0x11d2e6++){if(_0x1e75a1[_0x11d2e6][_0x28ef('0x5d')]===_0x40abd7){_0x11cd9f=!![];}}if(_0x11cd9f){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x28ef('0x23')](respondWithResult(_0x72db3a,null))[_0x28ef('0x43')](function(_0x3cc826){var _0x5f4c98=_0x5a0bbf[_0x28ef('0x2e')][_0x28ef('0x5e')]?0x1f4:_0x3cc826[_0x28ef('0x5f')]||0x1f4;logger[_0x28ef('0x60')](_0x28ef('0x61'),_0x28ef('0x53'),_0x5f4c98,JSON[_0x28ef('0x62')](_0x3cc826));delete _0x3cc826[_0x28ef('0x26')];if(_0x5f4c98===0x191){_0x5f4c98=0x190;}_0x72db3a[_0x28ef('0x18')](_0x5f4c98)[_0x28ef('0x27')](_0x5a0bbf['query']['test']?{'message':_0x28ef('0x63'),'statusCode':_0x3cc826[_0x28ef('0x5f')]}:_0x3cc826);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index bb92a95..2deb3d3 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdbd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshsalesAccount.attributes','exports','int_freshsales_accounts'];(function(_0x5ab1cc,_0x2a106e){var _0xe1d1fd=function(_0x1bfe3a){while(--_0x1bfe3a){_0x5ab1cc['push'](_0x5ab1cc['shift']());}};_0xe1d1fd(++_0x2a106e);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x271537,_0x8b7b3b){_0x271537=_0x271537-0x0;var _0x19dc22=_0xfdbd[_0x271537];return _0x19dc22;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xdfdb('0xa')]=function(_0x41bd5e,_0x489f19){return _0x41bd5e['define']('FreshsalesAccount',attributes,{'tableName':_0xdfdb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['path','../../config/environment','./intFreshsalesAccount.attributes','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x53ec,0x192));var _0xc53e=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0x53ec[_0x454018];return _0x24697d;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xc53e('0x9')]=function(_0x4f989b,_0x41a9e8){return _0x4f989b[_0xc53e('0xa')]('FreshsalesAccount',attributes,{'tableName':_0xc53e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index fa0d72d..80c2d0a 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['map','include','model','attributes','then','ShowFreshsalesAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','limit'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x5f2f,0x73));var _0xf5f2=function(_0x477d96,_0x96886){_0x477d96=_0x477d96-0x0;var _0x30694d=_0x5f2f[_0x477d96];return _0x30694d;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')]({'raw':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options']['where']||null:null,'attributes':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['attributes']||null:null,'limit':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1c')]||null:null,'include':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['include']?_[_0xf5f2('0x1d')](_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x2833fe){return{'model':db[_0x2833fe[_0xf5f2('0x1f')]],'as':_0x2833fe['as'],'attributes':_0x2833fe['attributes'],'include':_0x2833fe['include']?_[_0xf5f2('0x1d')](_0x2833fe[_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x375ca8){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')]('GetFreshsalesAccount',_0x20fccd,JSON['stringify'](_0x375ca8));_0x4ff59b(_0x375ca8);})[_0xf5f2('0x16')](function(_0x14c829){logger[_0xf5f2('0x11')]('GetFreshsalesAccount',_0x14c829['message'],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x14c829[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x22')]=function(_0x153924){var _0x1b381e=this;return new Promise(function(_0x54c0c8,_0x52e959){return db[_0xf5f2('0x18')]['find']({'raw':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x23')]||null:null,'attributes':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x20')]||null:null,'include':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x1408b9){return{'model':db[_0x1408b9[_0xf5f2('0x1f')]],'as':_0x1408b9['as'],'attributes':_0x1408b9[_0xf5f2('0x20')],'include':_0x1408b9['include']?_[_0xf5f2('0x1d')](_0x1408b9[_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x46ad4a){logger[_0xf5f2('0xd')]('ShowFreshsalesAccount',_0x153924);logger[_0xf5f2('0xf')]('ShowFreshsalesAccount',_0x153924,JSON[_0xf5f2('0x10')](_0x46ad4a));_0x54c0c8(_0x46ad4a);})['catch'](function(_0x46f464){logger[_0xf5f2('0x11')]('ShowFreshsalesAccount',_0x46f464[_0xf5f2('0x13')],_0x153924);_0x52e959(_0x1b381e[_0xf5f2('0x11')](0x1f4,_0x46f464[_0xf5f2('0x13')]));});});}; \ No newline at end of file +var _0x1883=['GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','attributes','limit','include','map','model','then','info','find','where','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x3e4a95,_0x3df90a){var _0x4336f6=function(_0x4d7ec1){while(--_0x4d7ec1){_0x3e4a95['push'](_0x3e4a95['shift']());}};_0x4336f6(++_0x3df90a);}(_0x1883,0xab));var _0x3188=function(_0x403d77,_0x2ff2c5){_0x403d77=_0x403d77-0x0;var _0x4e1f4b=_0x1883[_0x403d77];return _0x4e1f4b;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require(_0x3188('0x2'));var BPromise=require(_0x3188('0x3'));var rs=require(_0x3188('0x4'));var fs=require('fs');var Redis=require(_0x3188('0x5'));var db=require(_0x3188('0x6'))['db'];var utils=require(_0x3188('0x7'));var logger=require(_0x3188('0x8'))(_0x3188('0x9'));var config=require(_0x3188('0xa'));var jayson=require(_0x3188('0xb'));var client=jayson[_0x3188('0xc')][_0x3188('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24f2f1,_0x3ce7fd,_0x3e3afb){return new BPromise(function(_0x5c8f26,_0x446ab7){return client[_0x3188('0xe')](_0x24f2f1,_0x3e3afb)['then'](function(_0x2213b5){logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));logger[_0x3188('0x11')](_0x3188('0x12'),_0x3ce7fd,'request\x20sent',JSON[_0x3188('0x13')](_0x2213b5));if(_0x2213b5[_0x3188('0x14')]){if(_0x2213b5['error']['code']===0x1f4){logger[_0x3188('0x14')](_0x3188('0xf'),_0x3ce7fd,_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);return _0x446ab7(_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);}logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x2213b5['error']['message']);return _0x5c8f26(_0x2213b5[_0x3188('0x14')]['message']);}else{logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));_0x5c8f26(_0x2213b5[_0x3188('0x16')][_0x3188('0x15')]);}})[_0x3188('0x17')](function(_0x259321){logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x259321);_0x446ab7(_0x259321);});});}exports[_0x3188('0x18')]=function(_0x3f5b35){var _0x37e646=this;return new Promise(function(_0x18a71a,_0x4f27b0){return db[_0x3188('0x19')][_0x3188('0x1a')]({'raw':_0x3f5b35['options']?_0x3f5b35[_0x3188('0x1b')][_0x3188('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f5b35['options']?_0x3f5b35['options']['where']||null:null,'attributes':_0x3f5b35[_0x3188('0x1b')]?_0x3f5b35[_0x3188('0x1b')][_0x3188('0x1d')]||null:null,'limit':_0x3f5b35['options']?_0x3f5b35['options'][_0x3188('0x1e')]||null:null,'include':_0x3f5b35[_0x3188('0x1b')]?_0x3f5b35[_0x3188('0x1b')][_0x3188('0x1f')]?_[_0x3188('0x20')](_0x3f5b35['options'][_0x3188('0x1f')],function(_0x33f882){return{'model':db[_0x33f882['model']],'as':_0x33f882['as'],'attributes':_0x33f882[_0x3188('0x1d')],'include':_0x33f882['include']?_['map'](_0x33f882[_0x3188('0x1f')],function(_0x129bd7){return{'model':db[_0x129bd7[_0x3188('0x21')]],'as':_0x129bd7['as'],'attributes':_0x129bd7[_0x3188('0x1d')],'include':_0x129bd7[_0x3188('0x1f')]?_[_0x3188('0x20')](_0x129bd7[_0x3188('0x1f')],function(_0x11021c){return{'model':db[_0x11021c['model']],'as':_0x11021c['as'],'attributes':_0x11021c[_0x3188('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3188('0x22')](function(_0x52bb13){logger[_0x3188('0x23')](_0x3188('0x18'),_0x3f5b35);logger[_0x3188('0x11')](_0x3188('0x18'),_0x3f5b35,JSON[_0x3188('0x13')](_0x52bb13));_0x18a71a(_0x52bb13);})[_0x3188('0x17')](function(_0x8f810f){logger[_0x3188('0x14')]('GetFreshsalesAccount',_0x8f810f[_0x3188('0x15')],_0x3f5b35);_0x4f27b0(_0x37e646['error'](0x1f4,_0x8f810f[_0x3188('0x15')]));});});};exports['ShowFreshsalesAccount']=function(_0x3f82ce){var _0x80f9a8=this;return new Promise(function(_0x3be4f7,_0xacdad7){return db[_0x3188('0x19')][_0x3188('0x24')]({'raw':_0x3f82ce[_0x3188('0x1b')]?_0x3f82ce[_0x3188('0x1b')][_0x3188('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f82ce[_0x3188('0x1b')]?_0x3f82ce[_0x3188('0x1b')][_0x3188('0x25')]||null:null,'attributes':_0x3f82ce[_0x3188('0x1b')]?_0x3f82ce[_0x3188('0x1b')][_0x3188('0x1d')]||null:null,'include':_0x3f82ce[_0x3188('0x1b')]?_0x3f82ce[_0x3188('0x1b')][_0x3188('0x1f')]?_['map'](_0x3f82ce[_0x3188('0x1b')]['include'],function(_0x1c945e){return{'model':db[_0x1c945e[_0x3188('0x21')]],'as':_0x1c945e['as'],'attributes':_0x1c945e['attributes'],'include':_0x1c945e[_0x3188('0x1f')]?_[_0x3188('0x20')](_0x1c945e[_0x3188('0x1f')],function(_0x6d503d){return{'model':db[_0x6d503d[_0x3188('0x21')]],'as':_0x6d503d['as'],'attributes':_0x6d503d[_0x3188('0x1d')],'include':_0x6d503d[_0x3188('0x1f')]?_['map'](_0x6d503d['include'],function(_0xa876c8){return{'model':db[_0xa876c8[_0x3188('0x21')]],'as':_0xa876c8['as'],'attributes':_0xa876c8[_0x3188('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3188('0x22')](function(_0x4a64a4){logger[_0x3188('0x23')](_0x3188('0x26'),_0x3f82ce);logger[_0x3188('0x11')](_0x3188('0x26'),_0x3f82ce,JSON['stringify'](_0x4a64a4));_0x3be4f7(_0x4a64a4);})[_0x3188('0x17')](function(_0x4a290f){logger[_0x3188('0x14')]('ShowFreshsalesAccount',_0x4a290f[_0x3188('0x15')],_0x3f82ce);_0xacdad7(_0x80f9a8[_0x3188('0x14')](0x1f4,_0x4a290f[_0x3188('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 5470333..47d9b67 100644 --- a/server/api/intFreshsalesConfiguration/index.js +++ b/server/api/intFreshsalesConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a1d=['/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','getSubjects'];(function(_0x25f3e3,_0x207891){var _0xa89b6d=function(_0xa51f2){while(--_0xa51f2){_0x25f3e3['push'](_0x25f3e3['shift']());}};_0xa89b6d(++_0x207891);}(_0x8a1d,0xfa));var _0xd8a1=function(_0x1370a4,_0x1fc27c){_0x1370a4=_0x1370a4-0x0;var _0x2fde6f=_0x8a1d[_0x1370a4];return _0x2fde6f;};'use strict';var multer=require(_0xd8a1('0x0'));var util=require(_0xd8a1('0x1'));var path=require(_0xd8a1('0x2'));var timeout=require(_0xd8a1('0x3'));var express=require(_0xd8a1('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd8a1('0x5'));var config=require(_0xd8a1('0x6'));var controller=require(_0xd8a1('0x7'));router[_0xd8a1('0x8')]('/',auth[_0xd8a1('0x9')](),controller[_0xd8a1('0xa')]);router[_0xd8a1('0x8')](_0xd8a1('0xb'),auth[_0xd8a1('0x9')](),controller[_0xd8a1('0xc')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xd8a1('0xd')]);router[_0xd8a1('0x8')](_0xd8a1('0xe'),auth['isAuthenticated'](),controller[_0xd8a1('0xf')]);router[_0xd8a1('0x8')](_0xd8a1('0x10'),auth[_0xd8a1('0x9')](),controller[_0xd8a1('0x11')]);router[_0xd8a1('0x12')]('/',auth[_0xd8a1('0x9')](),controller[_0xd8a1('0x13')]);router['put']('/:id',auth[_0xd8a1('0x9')](),controller[_0xd8a1('0x14')]);router[_0xd8a1('0x15')](_0xd8a1('0xb'),auth[_0xd8a1('0x9')](),controller[_0xd8a1('0x16')]);module[_0xd8a1('0x17')]=router; \ No newline at end of file +var _0x5abd=['post','put','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5abd,0xad));var _0xd5ab=function(_0x55d217,_0x1399c7){_0x55d217=_0x55d217-0x0;var _0x2ce0ca=_0x5abd[_0x55d217];return _0x2ce0ca;};'use strict';var multer=require(_0xd5ab('0x0'));var util=require(_0xd5ab('0x1'));var path=require(_0xd5ab('0x2'));var timeout=require(_0xd5ab('0x3'));var express=require(_0xd5ab('0x4'));var router=express['Router']();var fs_extra=require(_0xd5ab('0x5'));var auth=require(_0xd5ab('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd5ab('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth[_0xd5ab('0x8')](),controller['index']);router[_0xd5ab('0x9')](_0xd5ab('0xa'),auth[_0xd5ab('0x8')](),controller[_0xd5ab('0xb')]);router[_0xd5ab('0x9')](_0xd5ab('0xc'),auth[_0xd5ab('0x8')](),controller[_0xd5ab('0xd')]);router[_0xd5ab('0x9')]('/:id/descriptions',auth[_0xd5ab('0x8')](),controller[_0xd5ab('0xe')]);router['get'](_0xd5ab('0xf'),auth['isAuthenticated'](),controller[_0xd5ab('0x10')]);router[_0xd5ab('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd5ab('0x12')](_0xd5ab('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xd5ab('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 6478830..564ac01 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x973d=['STRING','sequelize','exports'];(function(_0x1c3a30,_0x1c8c9e){var _0x44aeb8=function(_0x5d4640){while(--_0x5d4640){_0x1c3a30['push'](_0x1c3a30['shift']());}};_0x44aeb8(++_0x1c8c9e);}(_0x973d,0xa0));var _0xd973=function(_0x276c56,_0x4b6105){_0x276c56=_0x276c56-0x0;var _0x37c7d5=_0x973d[_0x276c56];return _0x37c7d5;};'use strict';var Sequelize=require(_0xd973('0x0'));module[_0xd973('0x1')]={'name':{'type':Sequelize[_0xd973('0x2')]},'description':{'type':Sequelize[_0xd973('0x2')]}}; \ No newline at end of file +var _0xedb6=['sequelize','exports','STRING'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xedb6,0xb7));var _0x6edb=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0xedb6[_0x3afe18];return _0x19ed1f;};'use strict';var Sequelize=require(_0x6edb('0x0'));module[_0x6edb('0x1')]={'name':{'type':Sequelize[_0x6edb('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index dbdd1b8..292c65d 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19fc=['pick','merge','VIRTUAL','filter','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','body','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','destroy','then','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where'];(function(_0x40cc74,_0x37e2ce){var _0x50610e=function(_0x3a0f22){while(--_0x3a0f22){_0x40cc74['push'](_0x40cc74['shift']());}};_0x50610e(++_0x37e2ce);}(_0x19fc,0x68));var _0xc19f=function(_0x5b406e,_0xcd06bc){_0x5b406e=_0x5b406e-0x0;var _0xe7d242=_0x19fc[_0x5b406e];return _0xe7d242;};'use strict';var emlformat=require(_0xc19f('0x0'));var rimraf=require(_0xc19f('0x1'));var zipdir=require(_0xc19f('0x2'));var jsonpatch=require(_0xc19f('0x3'));var rp=require(_0xc19f('0x4'));var moment=require(_0xc19f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc19f('0x6'));var util=require(_0xc19f('0x7'));var path=require(_0xc19f('0x8'));var sox=require('sox');var csv=require(_0xc19f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc19f('0xa'));var _=require(_0xc19f('0xb'));var squel=require(_0xc19f('0xc'));var crypto=require(_0xc19f('0xd'));var jsforce=require(_0xc19f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc19f('0x9'));var querystring=require(_0xc19f('0xf'));var Papa=require(_0xc19f('0x10'));var Redis=require('ioredis');var authService=require(_0xc19f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc19f('0x12'));var hardwareService=require(_0xc19f('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xc19f('0x14'));var config=require(_0xc19f('0x15'));var licenseUtil=require(_0xc19f('0x16'));var db=require(_0xc19f('0x17'))['db'];function respondWithStatusCode(_0x5ad042,_0xad1bd0){_0xad1bd0=_0xad1bd0||0xcc;return function(_0x53f95e){if(_0x53f95e){return _0x5ad042[_0xc19f('0x18')](_0xad1bd0);}return _0x5ad042[_0xc19f('0x19')](_0xad1bd0)[_0xc19f('0x1a')]();};}function respondWithResult(_0x2f6b55,_0x5f86bb){_0x5f86bb=_0x5f86bb||0xc8;return function(_0x1b499b){if(_0x1b499b){return _0x2f6b55['status'](_0x5f86bb)[_0xc19f('0x1b')](_0x1b499b);}};}function respondWithFilteredResult(_0x50dfb9,_0xf8f3b8){return function(_0x4ffbe7){if(_0x4ffbe7){var _0x5b86be=typeof _0xf8f3b8[_0xc19f('0x1c')]==='undefined'&&typeof _0xf8f3b8[_0xc19f('0x1d')]===_0xc19f('0x1e');var _0x5ce256=_0x4ffbe7['count'];var _0x3722f2=_0x5b86be?0x0:_0xf8f3b8[_0xc19f('0x1c')];var _0x28ea2d=_0x5b86be?_0x4ffbe7[_0xc19f('0x1f')]:_0xf8f3b8[_0xc19f('0x1c')]+_0xf8f3b8['limit'];var _0x43b339;if(_0x28ea2d>=_0x5ce256){_0x28ea2d=_0x5ce256;_0x43b339=0xc8;}else{_0x43b339=0xce;}_0x50dfb9['status'](_0x43b339);return _0x50dfb9[_0xc19f('0x20')]('Content-Range',_0x3722f2+'-'+_0x28ea2d+'/'+_0x5ce256)[_0xc19f('0x1b')](_0x4ffbe7);}return null;};}function patchUpdates(_0x3c8a2c){return function(_0x72b583){try{jsonpatch[_0xc19f('0x21')](_0x72b583,_0x3c8a2c,!![]);}catch(_0x52ac0b){return BPromise['reject'](_0x52ac0b);}return _0x72b583[_0xc19f('0x22')]();};}function saveUpdates(_0x55972a,_0x1a4d62){return function(_0xd59893){if(_0xd59893){return _0xd59893[_0xc19f('0x23')](_0x55972a)['then'](function(_0x28d406){return _0x28d406;});}return null;};}function removeEntity(_0x4199a6,_0x2c4a64){return function(_0x57ec6e){if(_0x57ec6e){return _0x57ec6e[_0xc19f('0x24')]()[_0xc19f('0x25')](function(){_0x4199a6[_0xc19f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x596c29,_0x57fb48){return function(_0x3dada8){if(!_0x3dada8){_0x596c29[_0xc19f('0x18')](0x194);}return _0x3dada8;};}function handleError(_0x3d1dd2,_0x38a91c){_0x38a91c=_0x38a91c||0x1f4;return function(_0x20a5af){logger[_0xc19f('0x26')](_0x20a5af[_0xc19f('0x27')]);if(_0x20a5af[_0xc19f('0x28')]){delete _0x20a5af['name'];}_0x3d1dd2[_0xc19f('0x19')](_0x38a91c)[_0xc19f('0x29')](_0x20a5af);};}exports[_0xc19f('0x2a')]=function(_0x3fe670,_0x173933){var _0x5b8610={},_0x2d8aa0={},_0x4fb2e2={'count':0x0,'rows':[]};var _0xf04cf4=_[_0xc19f('0x2b')](db[_0xc19f('0x2c')][_0xc19f('0x2d')],function(_0x4b507b){return{'name':_0x4b507b[_0xc19f('0x2e')],'type':_0x4b507b[_0xc19f('0x2f')][_0xc19f('0x30')]};});_0x2d8aa0[_0xc19f('0x31')]=_['map'](_0xf04cf4,_0xc19f('0x28'));_0x2d8aa0[_0xc19f('0x32')]=_[_0xc19f('0x33')](_0x3fe670[_0xc19f('0x32')]);_0x2d8aa0[_0xc19f('0x34')]=_[_0xc19f('0x35')](_0x2d8aa0[_0xc19f('0x31')],_0x2d8aa0['query']);_0x5b8610[_0xc19f('0x36')]=_[_0xc19f('0x35')](_0x2d8aa0['model'],qs[_0xc19f('0x37')](_0x3fe670['query'][_0xc19f('0x37')]));_0x5b8610[_0xc19f('0x36')]=_0x5b8610['attributes']['length']?_0x5b8610[_0xc19f('0x36')]:_0x2d8aa0['model'];if(!_0x3fe670['query']['hasOwnProperty'](_0xc19f('0x38'))){_0x5b8610[_0xc19f('0x1d')]=qs[_0xc19f('0x1d')](_0x3fe670[_0xc19f('0x32')]['limit']);_0x5b8610[_0xc19f('0x1c')]=qs[_0xc19f('0x1c')](_0x3fe670[_0xc19f('0x32')][_0xc19f('0x1c')]);}_0x5b8610[_0xc19f('0x39')]=qs['sort'](_0x3fe670[_0xc19f('0x32')][_0xc19f('0x3a')]);_0x5b8610[_0xc19f('0x3b')]=qs['filters'](_[_0xc19f('0x3c')](_0x3fe670[_0xc19f('0x32')],_0x2d8aa0[_0xc19f('0x34')]),_0xf04cf4);if(_0x3fe670[_0xc19f('0x32')]['filter']){_0x5b8610[_0xc19f('0x3b')]=_[_0xc19f('0x3d')](_0x5b8610[_0xc19f('0x3b')],{'$or':_[_0xc19f('0x2b')](_0xf04cf4,function(_0xa5342e){if(_0xa5342e[_0xc19f('0x2f')]!==_0xc19f('0x3e')){var _0x240061={};_0x240061[_0xa5342e[_0xc19f('0x28')]]={'$like':'%'+_0x3fe670[_0xc19f('0x32')][_0xc19f('0x3f')]+'%'};return _0x240061;}})});}_0x5b8610=_[_0xc19f('0x3d')]({},_0x5b8610,_0x3fe670['options']);var _0x3f18a8={'where':_0x5b8610[_0xc19f('0x3b')]};return db[_0xc19f('0x2c')][_0xc19f('0x1f')](_0x3f18a8)[_0xc19f('0x25')](function(_0x1d2e6b){_0x4fb2e2[_0xc19f('0x1f')]=_0x1d2e6b;if(_0x3fe670[_0xc19f('0x32')]['includeAll']){_0x5b8610[_0xc19f('0x40')]=[{'all':!![]}];}return db[_0xc19f('0x2c')][_0xc19f('0x41')](_0x5b8610);})['then'](function(_0x28f80c){_0x4fb2e2[_0xc19f('0x42')]=_0x28f80c;return _0x4fb2e2;})[_0xc19f('0x25')](respondWithFilteredResult(_0x173933,_0x5b8610))[_0xc19f('0x43')](handleError(_0x173933,null));};exports[_0xc19f('0x44')]=function(_0x42e550,_0x326374){var _0x51ea83={'raw':![],'where':{'id':_0x42e550[_0xc19f('0x45')]['id']}},_0x5bd40d={};_0x5bd40d[_0xc19f('0x31')]=_['keys'](db[_0xc19f('0x2c')]['rawAttributes']);_0x5bd40d['query']=_['keys'](_0x42e550['query']);_0x5bd40d[_0xc19f('0x34')]=_[_0xc19f('0x35')](_0x5bd40d[_0xc19f('0x31')],_0x5bd40d['query']);_0x51ea83['attributes']=_[_0xc19f('0x35')](_0x5bd40d['model'],qs[_0xc19f('0x37')](_0x42e550[_0xc19f('0x32')][_0xc19f('0x37')]));_0x51ea83[_0xc19f('0x36')]=_0x51ea83[_0xc19f('0x36')][_0xc19f('0x46')]?_0x51ea83[_0xc19f('0x36')]:_0x5bd40d[_0xc19f('0x31')];if(_0x42e550[_0xc19f('0x32')][_0xc19f('0x47')]){_0x51ea83[_0xc19f('0x40')]=[{'all':!![]}];}_0x51ea83=_['merge']({},_0x51ea83,_0x42e550[_0xc19f('0x48')]);return db['FreshsalesConfiguration'][_0xc19f('0x49')](_0x51ea83)[_0xc19f('0x25')](handleEntityNotFound(_0x326374,null))[_0xc19f('0x25')](respondWithResult(_0x326374,null))[_0xc19f('0x43')](handleError(_0x326374,null));};exports[_0xc19f('0x4a')]=function(_0x4e8bd9,_0x31df9f){return db['FreshsalesConfiguration'][_0xc19f('0x4a')](_0x4e8bd9['body'],{})[_0xc19f('0x25')](respondWithResult(_0x31df9f,0xc9))[_0xc19f('0x43')](handleError(_0x31df9f,null));};exports['update']=function(_0x57a695,_0x566c51){if(_0x57a695[_0xc19f('0x4b')]['id']){delete _0x57a695[_0xc19f('0x4b')]['id'];}return db[_0xc19f('0x2c')][_0xc19f('0x49')]({'where':{'id':_0x57a695['params']['id']}})[_0xc19f('0x25')](handleEntityNotFound(_0x566c51,null))[_0xc19f('0x25')](saveUpdates(_0x57a695['body'],null))[_0xc19f('0x25')](respondWithResult(_0x566c51,null))[_0xc19f('0x43')](handleError(_0x566c51,null));};exports[_0xc19f('0x24')]=function(_0x25ab94,_0x29b31d){return db[_0xc19f('0x2c')][_0xc19f('0x49')]({'where':{'id':_0x25ab94['params']['id']}})[_0xc19f('0x25')](handleEntityNotFound(_0x29b31d,null))[_0xc19f('0x25')](removeEntity(_0x29b31d,null))[_0xc19f('0x43')](handleError(_0x29b31d,null));};exports[_0xc19f('0x4c')]=function(_0x2ac2dc,_0x4d5642,_0x482fcb){var _0x17b574={};var _0x169c12={};var _0x3c2759;var _0x463602;return db['FreshsalesConfiguration'][_0xc19f('0x4d')]({'where':{'id':_0x2ac2dc[_0xc19f('0x45')]['id']}})[_0xc19f('0x25')](handleEntityNotFound(_0x4d5642,null))['then'](function(_0xc8d6b9){if(_0xc8d6b9){_0x3c2759=_0xc8d6b9;_0x169c12[_0xc19f('0x31')]=_[_0xc19f('0x33')](db[_0xc19f('0x4e')]['rawAttributes']);_0x169c12[_0xc19f('0x32')]=_[_0xc19f('0x33')](_0x2ac2dc['query']);_0x169c12['filters']=_[_0xc19f('0x35')](_0x169c12['model'],_0x169c12[_0xc19f('0x32')]);_0x17b574['attributes']=_[_0xc19f('0x35')](_0x169c12['model'],qs['fields'](_0x2ac2dc['query']['fields']));_0x17b574[_0xc19f('0x36')]=_0x17b574[_0xc19f('0x36')][_0xc19f('0x46')]?_0x17b574[_0xc19f('0x36')]:_0x169c12[_0xc19f('0x31')];_0x17b574[_0xc19f('0x39')]=qs[_0xc19f('0x3a')](_0x2ac2dc['query'][_0xc19f('0x3a')]);_0x17b574[_0xc19f('0x3b')]=qs['filters'](_[_0xc19f('0x3c')](_0x2ac2dc[_0xc19f('0x32')],_0x169c12['filters']));if(_0x2ac2dc[_0xc19f('0x32')][_0xc19f('0x3f')]){_0x17b574['where']=_[_0xc19f('0x3d')](_0x17b574[_0xc19f('0x3b')],{'$or':_[_0xc19f('0x2b')](_0x17b574[_0xc19f('0x36')],function(_0x97a446){var _0x437dda={};_0x437dda[_0x97a446]={'$like':'%'+_0x2ac2dc['query'][_0xc19f('0x3f')]+'%'};return _0x437dda;})});}_0x17b574=_[_0xc19f('0x3d')]({},_0x17b574,_0x2ac2dc[_0xc19f('0x48')]);return _0x3c2759[_0xc19f('0x4c')](_0x17b574);}})[_0xc19f('0x25')](function(_0x3d7447){if(_0x3d7447){_0x463602=_0x3d7447[_0xc19f('0x46')];if(!_0x2ac2dc['query'][_0xc19f('0x4f')](_0xc19f('0x38'))){_0x17b574[_0xc19f('0x1d')]=qs[_0xc19f('0x1d')](_0x2ac2dc['query'][_0xc19f('0x1d')]);_0x17b574['offset']=qs[_0xc19f('0x1c')](_0x2ac2dc[_0xc19f('0x32')][_0xc19f('0x1c')]);}return _0x3c2759[_0xc19f('0x4c')](_0x17b574);}})[_0xc19f('0x25')](function(_0x4519f2){if(_0x4519f2){return _0x4519f2?{'count':_0x463602,'rows':_0x4519f2}:null;}})[_0xc19f('0x25')](respondWithResult(_0x4d5642,null))[_0xc19f('0x43')](handleError(_0x4d5642,null));};exports[_0xc19f('0x50')]=function(_0x132c1e,_0x121b3f,_0x146444){var _0xf5f4c6={};var _0x5f353a={};var _0x669fdf;var _0x136ec0;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x132c1e[_0xc19f('0x45')]['id']}})[_0xc19f('0x25')](handleEntityNotFound(_0x121b3f,null))[_0xc19f('0x25')](function(_0x79f66a){if(_0x79f66a){_0x669fdf=_0x79f66a;_0x5f353a['model']=_[_0xc19f('0x33')](db[_0xc19f('0x4e')]['rawAttributes']);_0x5f353a[_0xc19f('0x32')]=_[_0xc19f('0x33')](_0x132c1e[_0xc19f('0x32')]);_0x5f353a['filters']=_[_0xc19f('0x35')](_0x5f353a[_0xc19f('0x31')],_0x5f353a['query']);_0xf5f4c6['attributes']=_[_0xc19f('0x35')](_0x5f353a[_0xc19f('0x31')],qs[_0xc19f('0x37')](_0x132c1e['query'][_0xc19f('0x37')]));_0xf5f4c6[_0xc19f('0x36')]=_0xf5f4c6['attributes'][_0xc19f('0x46')]?_0xf5f4c6[_0xc19f('0x36')]:_0x5f353a[_0xc19f('0x31')];_0xf5f4c6['order']=qs['sort'](_0x132c1e[_0xc19f('0x32')][_0xc19f('0x3a')]);_0xf5f4c6[_0xc19f('0x3b')]=qs['filters'](_[_0xc19f('0x3c')](_0x132c1e[_0xc19f('0x32')],_0x5f353a['filters']));if(_0x132c1e[_0xc19f('0x32')][_0xc19f('0x3f')]){_0xf5f4c6[_0xc19f('0x3b')]=_[_0xc19f('0x3d')](_0xf5f4c6[_0xc19f('0x3b')],{'$or':_[_0xc19f('0x2b')](_0xf5f4c6[_0xc19f('0x36')],function(_0x5121c5){var _0x3cdfbb={};_0x3cdfbb[_0x5121c5]={'$like':'%'+_0x132c1e[_0xc19f('0x32')][_0xc19f('0x3f')]+'%'};return _0x3cdfbb;})});}_0xf5f4c6=_[_0xc19f('0x3d')]({},_0xf5f4c6,_0x132c1e[_0xc19f('0x48')]);return _0x669fdf[_0xc19f('0x50')](_0xf5f4c6);}})[_0xc19f('0x25')](function(_0xf1c987){if(_0xf1c987){_0x136ec0=_0xf1c987[_0xc19f('0x46')];if(!_0x132c1e[_0xc19f('0x32')][_0xc19f('0x4f')](_0xc19f('0x38'))){_0xf5f4c6[_0xc19f('0x1d')]=qs['limit'](_0x132c1e[_0xc19f('0x32')][_0xc19f('0x1d')]);_0xf5f4c6['offset']=qs[_0xc19f('0x1c')](_0x132c1e[_0xc19f('0x32')][_0xc19f('0x1c')]);}return _0x669fdf[_0xc19f('0x50')](_0xf5f4c6);}})[_0xc19f('0x25')](function(_0x11ddec){if(_0x11ddec){return _0x11ddec?{'count':_0x136ec0,'rows':_0x11ddec}:null;}})[_0xc19f('0x25')](respondWithResult(_0x121b3f,null))[_0xc19f('0x43')](handleError(_0x121b3f,null));};exports[_0xc19f('0x51')]=function(_0x9151f4,_0x427248,_0x4d7985){var _0x1e6596={};var _0x4ddd77={};var _0x1e0111;var _0xe85cad;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x9151f4[_0xc19f('0x45')]['id']}})[_0xc19f('0x25')](handleEntityNotFound(_0x427248,null))['then'](function(_0x45aa50){if(_0x45aa50){_0x1e0111=_0x45aa50;_0x4ddd77[_0xc19f('0x31')]=_[_0xc19f('0x33')](db[_0xc19f('0x4e')]['rawAttributes']);_0x4ddd77[_0xc19f('0x32')]=_['keys'](_0x9151f4[_0xc19f('0x32')]);_0x4ddd77[_0xc19f('0x34')]=_['intersection'](_0x4ddd77[_0xc19f('0x31')],_0x4ddd77[_0xc19f('0x32')]);_0x1e6596[_0xc19f('0x36')]=_[_0xc19f('0x35')](_0x4ddd77[_0xc19f('0x31')],qs['fields'](_0x9151f4[_0xc19f('0x32')][_0xc19f('0x37')]));_0x1e6596['attributes']=_0x1e6596['attributes']['length']?_0x1e6596[_0xc19f('0x36')]:_0x4ddd77['model'];_0x1e6596[_0xc19f('0x39')]=qs[_0xc19f('0x3a')](_0x9151f4[_0xc19f('0x32')][_0xc19f('0x3a')]);_0x1e6596[_0xc19f('0x3b')]=qs[_0xc19f('0x34')](_[_0xc19f('0x3c')](_0x9151f4[_0xc19f('0x32')],_0x4ddd77[_0xc19f('0x34')]));if(_0x9151f4['query'][_0xc19f('0x3f')]){_0x1e6596['where']=_[_0xc19f('0x3d')](_0x1e6596[_0xc19f('0x3b')],{'$or':_[_0xc19f('0x2b')](_0x1e6596['attributes'],function(_0x3ed833){var _0x384b6a={};_0x384b6a[_0x3ed833]={'$like':'%'+_0x9151f4['query'][_0xc19f('0x3f')]+'%'};return _0x384b6a;})});}_0x1e6596=_[_0xc19f('0x3d')]({},_0x1e6596,_0x9151f4[_0xc19f('0x48')]);return _0x1e0111[_0xc19f('0x51')](_0x1e6596);}})[_0xc19f('0x25')](function(_0x28fa3a){if(_0x28fa3a){_0xe85cad=_0x28fa3a['length'];if(!_0x9151f4[_0xc19f('0x32')][_0xc19f('0x4f')]('nolimit')){_0x1e6596[_0xc19f('0x1d')]=qs[_0xc19f('0x1d')](_0x9151f4[_0xc19f('0x32')][_0xc19f('0x1d')]);_0x1e6596[_0xc19f('0x1c')]=qs['offset'](_0x9151f4[_0xc19f('0x32')][_0xc19f('0x1c')]);}return _0x1e0111[_0xc19f('0x51')](_0x1e6596);}})[_0xc19f('0x25')](function(_0x1225ae){if(_0x1225ae){return _0x1225ae?{'count':_0xe85cad,'rows':_0x1225ae}:null;}})[_0xc19f('0x25')](respondWithResult(_0x427248,null))['catch'](handleError(_0x427248,null));}; \ No newline at end of file +var _0xbd88=['error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','FreshsalesConfiguration','findAll','rows','show','params','catch','create','body','find','getSubjects','pick','getDescriptions','findOne','FreshsalesField','getFields','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x3f1068,_0x2d4f61){var _0x54c89c=function(_0x19e3aa){while(--_0x19e3aa){_0x3f1068['push'](_0x3f1068['shift']());}};_0x54c89c(++_0x2d4f61);}(_0xbd88,0x178));var _0x8bd8=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xbd88[_0x4a53d];return _0x27410e;};'use strict';var emlformat=require(_0x8bd8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8bd8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8bd8('0x2'));var moment=require(_0x8bd8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8bd8('0x4'));var path=require(_0x8bd8('0x5'));var sox=require(_0x8bd8('0x6'));var csv=require(_0x8bd8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8bd8('0x8'));var _=require(_0x8bd8('0x9'));var squel=require(_0x8bd8('0xa'));var crypto=require(_0x8bd8('0xb'));var jsforce=require(_0x8bd8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8bd8('0x7'));var querystring=require(_0x8bd8('0xd'));var Papa=require(_0x8bd8('0xe'));var Redis=require('ioredis');var authService=require(_0x8bd8('0xf'));var qs=require(_0x8bd8('0x10'));var as=require(_0x8bd8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8bd8('0x12'))(_0x8bd8('0x13'));var utils=require(_0x8bd8('0x14'));var config=require(_0x8bd8('0x15'));var licenseUtil=require(_0x8bd8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29b37d,_0x1cd34b){_0x1cd34b=_0x1cd34b||0xcc;return function(_0x2792a3){if(_0x2792a3){return _0x29b37d[_0x8bd8('0x17')](_0x1cd34b);}return _0x29b37d[_0x8bd8('0x18')](_0x1cd34b)[_0x8bd8('0x19')]();};}function respondWithResult(_0x1cb1ef,_0x43b740){_0x43b740=_0x43b740||0xc8;return function(_0x3366c1){if(_0x3366c1){return _0x1cb1ef[_0x8bd8('0x18')](_0x43b740)[_0x8bd8('0x1a')](_0x3366c1);}};}function respondWithFilteredResult(_0x495733,_0xa47978){return function(_0x2c027f){if(_0x2c027f){var _0x54aaea=typeof _0xa47978[_0x8bd8('0x1b')]===_0x8bd8('0x1c')&&typeof _0xa47978[_0x8bd8('0x1d')]===_0x8bd8('0x1c');var _0x4af352=_0x2c027f[_0x8bd8('0x1e')];var _0x46b152=_0x54aaea?0x0:_0xa47978[_0x8bd8('0x1b')];var _0x45cb66=_0x54aaea?_0x2c027f[_0x8bd8('0x1e')]:_0xa47978['offset']+_0xa47978[_0x8bd8('0x1d')];var _0x4c6349;if(_0x45cb66>=_0x4af352){_0x45cb66=_0x4af352;_0x4c6349=0xc8;}else{_0x4c6349=0xce;}_0x495733[_0x8bd8('0x18')](_0x4c6349);return _0x495733[_0x8bd8('0x1f')](_0x8bd8('0x20'),_0x46b152+'-'+_0x45cb66+'/'+_0x4af352)[_0x8bd8('0x1a')](_0x2c027f);}return null;};}function patchUpdates(_0x21f6d4){return function(_0x29ad59){try{jsonpatch[_0x8bd8('0x21')](_0x29ad59,_0x21f6d4,!![]);}catch(_0x5206df){return BPromise[_0x8bd8('0x22')](_0x5206df);}return _0x29ad59[_0x8bd8('0x23')]();};}function saveUpdates(_0x33868a,_0xb9a48c){return function(_0x389a26){if(_0x389a26){return _0x389a26[_0x8bd8('0x24')](_0x33868a)[_0x8bd8('0x25')](function(_0x4caf26){return _0x4caf26;});}return null;};}function removeEntity(_0x1e9b55,_0x5d32ee){return function(_0x3ffe89){if(_0x3ffe89){return _0x3ffe89[_0x8bd8('0x26')]()[_0x8bd8('0x25')](function(){_0x1e9b55[_0x8bd8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x489eeb,_0x379cbe){return function(_0x514629){if(!_0x514629){_0x489eeb[_0x8bd8('0x17')](0x194);}return _0x514629;};}function handleError(_0x54e7a6,_0x2762df){_0x2762df=_0x2762df||0x1f4;return function(_0x551cf2){logger[_0x8bd8('0x27')](_0x551cf2[_0x8bd8('0x28')]);if(_0x551cf2['name']){delete _0x551cf2[_0x8bd8('0x29')];}_0x54e7a6['status'](_0x2762df)[_0x8bd8('0x2a')](_0x551cf2);};}exports[_0x8bd8('0x2b')]=function(_0x19ad84,_0x85113e){var _0x2b4416={},_0x4625b1={},_0x3c57df={'count':0x0,'rows':[]};var _0x2de9ad=_['map'](db['FreshsalesConfiguration'][_0x8bd8('0x2c')],function(_0x68871e){return{'name':_0x68871e[_0x8bd8('0x2d')],'type':_0x68871e[_0x8bd8('0x2e')][_0x8bd8('0x2f')]};});_0x4625b1[_0x8bd8('0x30')]=_[_0x8bd8('0x31')](_0x2de9ad,_0x8bd8('0x29'));_0x4625b1[_0x8bd8('0x32')]=_[_0x8bd8('0x33')](_0x19ad84[_0x8bd8('0x32')]);_0x4625b1['filters']=_['intersection'](_0x4625b1[_0x8bd8('0x30')],_0x4625b1[_0x8bd8('0x32')]);_0x2b4416[_0x8bd8('0x34')]=_[_0x8bd8('0x35')](_0x4625b1[_0x8bd8('0x30')],qs[_0x8bd8('0x36')](_0x19ad84[_0x8bd8('0x32')][_0x8bd8('0x36')]));_0x2b4416['attributes']=_0x2b4416['attributes'][_0x8bd8('0x37')]?_0x2b4416['attributes']:_0x4625b1[_0x8bd8('0x30')];if(!_0x19ad84[_0x8bd8('0x32')][_0x8bd8('0x38')](_0x8bd8('0x39'))){_0x2b4416['limit']=qs[_0x8bd8('0x1d')](_0x19ad84['query'][_0x8bd8('0x1d')]);_0x2b4416[_0x8bd8('0x1b')]=qs[_0x8bd8('0x1b')](_0x19ad84[_0x8bd8('0x32')][_0x8bd8('0x1b')]);}_0x2b4416[_0x8bd8('0x3a')]=qs[_0x8bd8('0x3b')](_0x19ad84['query'][_0x8bd8('0x3b')]);_0x2b4416[_0x8bd8('0x3c')]=qs[_0x8bd8('0x3d')](_['pick'](_0x19ad84[_0x8bd8('0x32')],_0x4625b1['filters']),_0x2de9ad);if(_0x19ad84[_0x8bd8('0x32')][_0x8bd8('0x3e')]){_0x2b4416[_0x8bd8('0x3c')]=_[_0x8bd8('0x3f')](_0x2b4416[_0x8bd8('0x3c')],{'$or':_[_0x8bd8('0x31')](_0x2de9ad,function(_0x1ad399){if(_0x1ad399['type']!==_0x8bd8('0x40')){var _0x14bb0e={};_0x14bb0e[_0x1ad399['name']]={'$like':'%'+_0x19ad84[_0x8bd8('0x32')][_0x8bd8('0x3e')]+'%'};return _0x14bb0e;}})});}_0x2b4416=_['merge']({},_0x2b4416,_0x19ad84[_0x8bd8('0x41')]);var _0x4f3bb1={'where':_0x2b4416[_0x8bd8('0x3c')]};return db['FreshsalesConfiguration'][_0x8bd8('0x1e')](_0x4f3bb1)['then'](function(_0x32367f){_0x3c57df[_0x8bd8('0x1e')]=_0x32367f;if(_0x19ad84[_0x8bd8('0x32')][_0x8bd8('0x42')]){_0x2b4416[_0x8bd8('0x43')]=[{'all':!![]}];}return db[_0x8bd8('0x44')][_0x8bd8('0x45')](_0x2b4416);})[_0x8bd8('0x25')](function(_0x5842a2){_0x3c57df[_0x8bd8('0x46')]=_0x5842a2;return _0x3c57df;})['then'](respondWithFilteredResult(_0x85113e,_0x2b4416))['catch'](handleError(_0x85113e,null));};exports[_0x8bd8('0x47')]=function(_0x15a9ea,_0x5a9aa7){var _0x1ac9a9={'raw':![],'where':{'id':_0x15a9ea[_0x8bd8('0x48')]['id']}},_0x3be5f8={};_0x3be5f8['model']=_[_0x8bd8('0x33')](db[_0x8bd8('0x44')][_0x8bd8('0x2c')]);_0x3be5f8[_0x8bd8('0x32')]=_[_0x8bd8('0x33')](_0x15a9ea[_0x8bd8('0x32')]);_0x3be5f8[_0x8bd8('0x3d')]=_[_0x8bd8('0x35')](_0x3be5f8[_0x8bd8('0x30')],_0x3be5f8[_0x8bd8('0x32')]);_0x1ac9a9[_0x8bd8('0x34')]=_[_0x8bd8('0x35')](_0x3be5f8['model'],qs[_0x8bd8('0x36')](_0x15a9ea['query']['fields']));_0x1ac9a9['attributes']=_0x1ac9a9['attributes']['length']?_0x1ac9a9[_0x8bd8('0x34')]:_0x3be5f8['model'];if(_0x15a9ea['query'][_0x8bd8('0x42')]){_0x1ac9a9[_0x8bd8('0x43')]=[{'all':!![]}];}_0x1ac9a9=_[_0x8bd8('0x3f')]({},_0x1ac9a9,_0x15a9ea[_0x8bd8('0x41')]);return db[_0x8bd8('0x44')]['find'](_0x1ac9a9)[_0x8bd8('0x25')](handleEntityNotFound(_0x5a9aa7,null))['then'](respondWithResult(_0x5a9aa7,null))[_0x8bd8('0x49')](handleError(_0x5a9aa7,null));};exports['create']=function(_0x223efd,_0x273d6c){return db[_0x8bd8('0x44')][_0x8bd8('0x4a')](_0x223efd[_0x8bd8('0x4b')],{})[_0x8bd8('0x25')](respondWithResult(_0x273d6c,0xc9))[_0x8bd8('0x49')](handleError(_0x273d6c,null));};exports[_0x8bd8('0x24')]=function(_0x484edb,_0x231eee){if(_0x484edb[_0x8bd8('0x4b')]['id']){delete _0x484edb[_0x8bd8('0x4b')]['id'];}return db[_0x8bd8('0x44')]['find']({'where':{'id':_0x484edb[_0x8bd8('0x48')]['id']}})[_0x8bd8('0x25')](handleEntityNotFound(_0x231eee,null))['then'](saveUpdates(_0x484edb[_0x8bd8('0x4b')],null))[_0x8bd8('0x25')](respondWithResult(_0x231eee,null))['catch'](handleError(_0x231eee,null));};exports[_0x8bd8('0x26')]=function(_0x2c7d3f,_0x398241){return db[_0x8bd8('0x44')][_0x8bd8('0x4c')]({'where':{'id':_0x2c7d3f[_0x8bd8('0x48')]['id']}})[_0x8bd8('0x25')](handleEntityNotFound(_0x398241,null))[_0x8bd8('0x25')](removeEntity(_0x398241,null))[_0x8bd8('0x49')](handleError(_0x398241,null));};exports[_0x8bd8('0x4d')]=function(_0x1ab90a,_0x1dfc9a,_0x311065){var _0x313048={};var _0x57e781={};var _0x204f63;var _0xb3d207;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x1ab90a[_0x8bd8('0x48')]['id']}})[_0x8bd8('0x25')](handleEntityNotFound(_0x1dfc9a,null))[_0x8bd8('0x25')](function(_0x5d6dbc){if(_0x5d6dbc){_0x204f63=_0x5d6dbc;_0x57e781[_0x8bd8('0x30')]=_[_0x8bd8('0x33')](db['FreshsalesField'][_0x8bd8('0x2c')]);_0x57e781[_0x8bd8('0x32')]=_[_0x8bd8('0x33')](_0x1ab90a[_0x8bd8('0x32')]);_0x57e781[_0x8bd8('0x3d')]=_[_0x8bd8('0x35')](_0x57e781[_0x8bd8('0x30')],_0x57e781[_0x8bd8('0x32')]);_0x313048[_0x8bd8('0x34')]=_['intersection'](_0x57e781[_0x8bd8('0x30')],qs[_0x8bd8('0x36')](_0x1ab90a['query'][_0x8bd8('0x36')]));_0x313048['attributes']=_0x313048[_0x8bd8('0x34')][_0x8bd8('0x37')]?_0x313048[_0x8bd8('0x34')]:_0x57e781[_0x8bd8('0x30')];_0x313048[_0x8bd8('0x3a')]=qs[_0x8bd8('0x3b')](_0x1ab90a[_0x8bd8('0x32')][_0x8bd8('0x3b')]);_0x313048[_0x8bd8('0x3c')]=qs['filters'](_[_0x8bd8('0x4e')](_0x1ab90a[_0x8bd8('0x32')],_0x57e781[_0x8bd8('0x3d')]));if(_0x1ab90a[_0x8bd8('0x32')]['filter']){_0x313048[_0x8bd8('0x3c')]=_[_0x8bd8('0x3f')](_0x313048[_0x8bd8('0x3c')],{'$or':_[_0x8bd8('0x31')](_0x313048[_0x8bd8('0x34')],function(_0x7b11ae){var _0x23c1e2={};_0x23c1e2[_0x7b11ae]={'$like':'%'+_0x1ab90a[_0x8bd8('0x32')][_0x8bd8('0x3e')]+'%'};return _0x23c1e2;})});}_0x313048=_[_0x8bd8('0x3f')]({},_0x313048,_0x1ab90a[_0x8bd8('0x41')]);return _0x204f63[_0x8bd8('0x4d')](_0x313048);}})[_0x8bd8('0x25')](function(_0x1714a0){if(_0x1714a0){_0xb3d207=_0x1714a0[_0x8bd8('0x37')];if(!_0x1ab90a[_0x8bd8('0x32')][_0x8bd8('0x38')](_0x8bd8('0x39'))){_0x313048[_0x8bd8('0x1d')]=qs[_0x8bd8('0x1d')](_0x1ab90a[_0x8bd8('0x32')][_0x8bd8('0x1d')]);_0x313048[_0x8bd8('0x1b')]=qs[_0x8bd8('0x1b')](_0x1ab90a[_0x8bd8('0x32')]['offset']);}return _0x204f63[_0x8bd8('0x4d')](_0x313048);}})[_0x8bd8('0x25')](function(_0x479292){if(_0x479292){return _0x479292?{'count':_0xb3d207,'rows':_0x479292}:null;}})[_0x8bd8('0x25')](respondWithResult(_0x1dfc9a,null))['catch'](handleError(_0x1dfc9a,null));};exports[_0x8bd8('0x4f')]=function(_0x57cd40,_0x4487d0,_0x3e3976){var _0x10a357={};var _0x811390={};var _0x38ec67;var _0x6f5c3d;return db[_0x8bd8('0x44')][_0x8bd8('0x50')]({'where':{'id':_0x57cd40['params']['id']}})[_0x8bd8('0x25')](handleEntityNotFound(_0x4487d0,null))[_0x8bd8('0x25')](function(_0x47c030){if(_0x47c030){_0x38ec67=_0x47c030;_0x811390[_0x8bd8('0x30')]=_['keys'](db[_0x8bd8('0x51')][_0x8bd8('0x2c')]);_0x811390[_0x8bd8('0x32')]=_[_0x8bd8('0x33')](_0x57cd40['query']);_0x811390[_0x8bd8('0x3d')]=_[_0x8bd8('0x35')](_0x811390[_0x8bd8('0x30')],_0x811390[_0x8bd8('0x32')]);_0x10a357[_0x8bd8('0x34')]=_['intersection'](_0x811390['model'],qs[_0x8bd8('0x36')](_0x57cd40[_0x8bd8('0x32')]['fields']));_0x10a357[_0x8bd8('0x34')]=_0x10a357[_0x8bd8('0x34')][_0x8bd8('0x37')]?_0x10a357[_0x8bd8('0x34')]:_0x811390[_0x8bd8('0x30')];_0x10a357[_0x8bd8('0x3a')]=qs[_0x8bd8('0x3b')](_0x57cd40[_0x8bd8('0x32')][_0x8bd8('0x3b')]);_0x10a357[_0x8bd8('0x3c')]=qs[_0x8bd8('0x3d')](_['pick'](_0x57cd40[_0x8bd8('0x32')],_0x811390[_0x8bd8('0x3d')]));if(_0x57cd40['query'][_0x8bd8('0x3e')]){_0x10a357[_0x8bd8('0x3c')]=_[_0x8bd8('0x3f')](_0x10a357[_0x8bd8('0x3c')],{'$or':_[_0x8bd8('0x31')](_0x10a357[_0x8bd8('0x34')],function(_0x482363){var _0x3d083c={};_0x3d083c[_0x482363]={'$like':'%'+_0x57cd40[_0x8bd8('0x32')][_0x8bd8('0x3e')]+'%'};return _0x3d083c;})});}_0x10a357=_[_0x8bd8('0x3f')]({},_0x10a357,_0x57cd40[_0x8bd8('0x41')]);return _0x38ec67[_0x8bd8('0x4f')](_0x10a357);}})[_0x8bd8('0x25')](function(_0x3969c7){if(_0x3969c7){_0x6f5c3d=_0x3969c7[_0x8bd8('0x37')];if(!_0x57cd40[_0x8bd8('0x32')][_0x8bd8('0x38')](_0x8bd8('0x39'))){_0x10a357[_0x8bd8('0x1d')]=qs['limit'](_0x57cd40['query']['limit']);_0x10a357[_0x8bd8('0x1b')]=qs[_0x8bd8('0x1b')](_0x57cd40['query'][_0x8bd8('0x1b')]);}return _0x38ec67[_0x8bd8('0x4f')](_0x10a357);}})['then'](function(_0x4db1e9){if(_0x4db1e9){return _0x4db1e9?{'count':_0x6f5c3d,'rows':_0x4db1e9}:null;}})[_0x8bd8('0x25')](respondWithResult(_0x4487d0,null))['catch'](handleError(_0x4487d0,null));};exports[_0x8bd8('0x52')]=function(_0x23b799,_0x5f5324,_0x129bce){var _0x16e7ba={};var _0x20730a={};var _0x56191e;var _0x31a071;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x23b799[_0x8bd8('0x48')]['id']}})[_0x8bd8('0x25')](handleEntityNotFound(_0x5f5324,null))['then'](function(_0xd6aac9){if(_0xd6aac9){_0x56191e=_0xd6aac9;_0x20730a[_0x8bd8('0x30')]=_[_0x8bd8('0x33')](db['FreshsalesField'][_0x8bd8('0x2c')]);_0x20730a[_0x8bd8('0x32')]=_[_0x8bd8('0x33')](_0x23b799[_0x8bd8('0x32')]);_0x20730a[_0x8bd8('0x3d')]=_['intersection'](_0x20730a[_0x8bd8('0x30')],_0x20730a[_0x8bd8('0x32')]);_0x16e7ba[_0x8bd8('0x34')]=_[_0x8bd8('0x35')](_0x20730a[_0x8bd8('0x30')],qs['fields'](_0x23b799['query']['fields']));_0x16e7ba[_0x8bd8('0x34')]=_0x16e7ba[_0x8bd8('0x34')][_0x8bd8('0x37')]?_0x16e7ba[_0x8bd8('0x34')]:_0x20730a['model'];_0x16e7ba['order']=qs[_0x8bd8('0x3b')](_0x23b799[_0x8bd8('0x32')][_0x8bd8('0x3b')]);_0x16e7ba[_0x8bd8('0x3c')]=qs[_0x8bd8('0x3d')](_[_0x8bd8('0x4e')](_0x23b799[_0x8bd8('0x32')],_0x20730a['filters']));if(_0x23b799[_0x8bd8('0x32')]['filter']){_0x16e7ba[_0x8bd8('0x3c')]=_['merge'](_0x16e7ba[_0x8bd8('0x3c')],{'$or':_[_0x8bd8('0x31')](_0x16e7ba[_0x8bd8('0x34')],function(_0x57f804){var _0x49ca3e={};_0x49ca3e[_0x57f804]={'$like':'%'+_0x23b799['query'][_0x8bd8('0x3e')]+'%'};return _0x49ca3e;})});}_0x16e7ba=_['merge']({},_0x16e7ba,_0x23b799['options']);return _0x56191e[_0x8bd8('0x52')](_0x16e7ba);}})[_0x8bd8('0x25')](function(_0x5b382e){if(_0x5b382e){_0x31a071=_0x5b382e[_0x8bd8('0x37')];if(!_0x23b799['query'][_0x8bd8('0x38')](_0x8bd8('0x39'))){_0x16e7ba[_0x8bd8('0x1d')]=qs[_0x8bd8('0x1d')](_0x23b799[_0x8bd8('0x32')][_0x8bd8('0x1d')]);_0x16e7ba[_0x8bd8('0x1b')]=qs[_0x8bd8('0x1b')](_0x23b799[_0x8bd8('0x32')][_0x8bd8('0x1b')]);}return _0x56191e[_0x8bd8('0x52')](_0x16e7ba);}})[_0x8bd8('0x25')](function(_0x140f14){if(_0x140f14){return _0x140f14?{'count':_0x31a071,'rows':_0x140f14}:null;}})[_0x8bd8('0x25')](respondWithResult(_0x5f5324,null))[_0x8bd8('0x49')](handleError(_0x5f5324,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index af7c619..225a2a2 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3cf7=['api','bluebird','path','rimraf','./intFreshsalesConfiguration.attributes','exports','int_freshsales_configurations','lodash','util'];(function(_0x458775,_0x523411){var _0x48eb06=function(_0x98a4ac){while(--_0x98a4ac){_0x458775['push'](_0x458775['shift']());}};_0x48eb06(++_0x523411);}(_0x3cf7,0x73));var _0x73cf=function(_0x2a390b,_0xf49f9b){_0x2a390b=_0x2a390b-0x0;var _0x5df10a=_0x3cf7[_0x2a390b];return _0x5df10a;};'use strict';var _=require(_0x73cf('0x0'));var util=require(_0x73cf('0x1'));var logger=require('../../config/logger')(_0x73cf('0x2'));var moment=require('moment');var BPromise=require(_0x73cf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x73cf('0x4'));var rimraf=require(_0x73cf('0x5'));var config=require('../../config/environment');var attributes=require(_0x73cf('0x6'));module[_0x73cf('0x7')]=function(_0xb7d8d3,_0x473284){return _0xb7d8d3['define']('FreshsalesConfiguration',attributes,{'tableName':_0x73cf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0779=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x15bb1b,_0x4a3d3a){var _0x29022f=function(_0x37b550){while(--_0x37b550){_0x15bb1b['push'](_0x15bb1b['shift']());}};_0x29022f(++_0x4a3d3a);}(_0x0779,0x113));var _0x9077=function(_0xdea2f4,_0x2135ee){_0xdea2f4=_0xdea2f4-0x0;var _0x59619f=_0x0779[_0xdea2f4];return _0x59619f;};'use strict';var _=require(_0x9077('0x0'));var util=require('util');var logger=require(_0x9077('0x1'))(_0x9077('0x2'));var moment=require(_0x9077('0x3'));var BPromise=require(_0x9077('0x4'));var rp=require(_0x9077('0x5'));var fs=require('fs');var path=require(_0x9077('0x6'));var rimraf=require(_0x9077('0x7'));var config=require(_0x9077('0x8'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x9077('0x9')]=function(_0x2d0180,_0x4fc3ff){return _0x2d0180[_0x9077('0xa')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 3df5813..0b1405e 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b89=['../../config/logger','rpc','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x472cfc,_0x4ec9f3){var _0x3ba7cb=function(_0x49eb43){while(--_0x49eb43){_0x472cfc['push'](_0x472cfc['shift']());}};_0x3ba7cb(++_0x4ec9f3);}(_0x8b89,0x148));var _0x98b8=function(_0x1306f3,_0x1da761){_0x1306f3=_0x1306f3-0x0;var _0xc1c7bf=_0x8b89[_0x1306f3];return _0xc1c7bf;};'use strict';var _=require(_0x98b8('0x0'));var util=require(_0x98b8('0x1'));var moment=require(_0x98b8('0x2'));var BPromise=require(_0x98b8('0x3'));var rs=require(_0x98b8('0x4'));var fs=require('fs');var Redis=require(_0x98b8('0x5'));var db=require(_0x98b8('0x6'))['db'];var utils=require(_0x98b8('0x7'));var logger=require(_0x98b8('0x8'))(_0x98b8('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x98b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x353d3e,_0x3f3600,_0xeb2bf7){return new BPromise(function(_0x2aa785,_0x477c09){return client[_0x98b8('0xb')](_0x353d3e,_0xeb2bf7)['then'](function(_0x3aa2e5){logger[_0x98b8('0xc')](_0x98b8('0xd'),_0x3f3600,_0x98b8('0xe'));logger[_0x98b8('0xf')](_0x98b8('0x10'),_0x3f3600,_0x98b8('0xe'),JSON['stringify'](_0x3aa2e5));if(_0x3aa2e5[_0x98b8('0x11')]){if(_0x3aa2e5[_0x98b8('0x11')]['code']===0x1f4){logger[_0x98b8('0x11')](_0x98b8('0xd'),_0x3f3600,_0x3aa2e5['error'][_0x98b8('0x12')]);return _0x477c09(_0x3aa2e5['error'][_0x98b8('0x12')]);}logger[_0x98b8('0x11')](_0x98b8('0xd'),_0x3f3600,_0x3aa2e5[_0x98b8('0x11')][_0x98b8('0x12')]);return _0x2aa785(_0x3aa2e5['error'][_0x98b8('0x12')]);}else{logger[_0x98b8('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3f3600,'request\x20sent');_0x2aa785(_0x3aa2e5[_0x98b8('0x13')]['message']);}})[_0x98b8('0x14')](function(_0x135643){logger[_0x98b8('0x11')](_0x98b8('0xd'),_0x3f3600,_0x135643);_0x477c09(_0x135643);});});} \ No newline at end of file +var _0x72bf=['error','code','message','result','catch','lodash','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2456e4,_0x828444){var _0x4e6f9e=function(_0x53e256){while(--_0x53e256){_0x2456e4['push'](_0x2456e4['shift']());}};_0x4e6f9e(++_0x828444);}(_0x72bf,0xd6));var _0xf72b=function(_0x455fc8,_0xe5f899){_0x455fc8=_0x455fc8-0x0;var _0x266ad3=_0x72bf[_0x455fc8];return _0x266ad3;};'use strict';var _=require(_0xf72b('0x0'));var util=require('util');var moment=require(_0xf72b('0x1'));var BPromise=require(_0xf72b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf72b('0x3'));var logger=require('../../config/logger')(_0xf72b('0x4'));var config=require(_0xf72b('0x5'));var jayson=require(_0xf72b('0x6'));var client=jayson['client'][_0xf72b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x41f97d,_0x2469c1,_0x290c9c){return new BPromise(function(_0x1a7ae2,_0x4572d6){return client['request'](_0x41f97d,_0x290c9c)[_0xf72b('0x8')](function(_0x560d61){logger[_0xf72b('0x9')](_0xf72b('0xa'),_0x2469c1,_0xf72b('0xb'));logger['debug'](_0xf72b('0xc'),_0x2469c1,_0xf72b('0xb'),JSON[_0xf72b('0xd')](_0x560d61));if(_0x560d61['error']){if(_0x560d61[_0xf72b('0xe')][_0xf72b('0xf')]===0x1f4){logger[_0xf72b('0xe')](_0xf72b('0xa'),_0x2469c1,_0x560d61[_0xf72b('0xe')][_0xf72b('0x10')]);return _0x4572d6(_0x560d61[_0xf72b('0xe')][_0xf72b('0x10')]);}logger['error'](_0xf72b('0xa'),_0x2469c1,_0x560d61[_0xf72b('0xe')][_0xf72b('0x10')]);return _0x1a7ae2(_0x560d61[_0xf72b('0xe')][_0xf72b('0x10')]);}else{logger['info'](_0xf72b('0xa'),_0x2469c1,_0xf72b('0xb'));_0x1a7ae2(_0x560d61[_0xf72b('0x11')][_0xf72b('0x10')]);}})[_0xf72b('0x12')](function(_0x38aa5c){logger[_0xf72b('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2469c1,_0x38aa5c);_0x4572d6(_0x38aa5c);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 5f64de6..d1cfe78 100644 --- a/server/api/intFreshsalesField/index.js +++ b/server/api/intFreshsalesField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8278=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x348693,_0x54cfca){var _0x5c592a=function(_0x48208d){while(--_0x48208d){_0x348693['push'](_0x348693['shift']());}};_0x5c592a(++_0x54cfca);}(_0x8278,0x1ae));var _0x8827=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8278[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8827('0x0'));var util=require(_0x8827('0x1'));var path=require(_0x8827('0x2'));var timeout=require(_0x8827('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8827('0x4'));var auth=require(_0x8827('0x5'));var interaction=require(_0x8827('0x6'));var config=require(_0x8827('0x7'));var controller=require('./intFreshsalesField.controller');router[_0x8827('0x8')]('/',auth[_0x8827('0x9')](),controller[_0x8827('0xa')]);router[_0x8827('0x8')](_0x8827('0xb'),auth[_0x8827('0x9')](),controller[_0x8827('0xc')]);router[_0x8827('0xd')]('/',auth[_0x8827('0x9')](),controller[_0x8827('0xe')]);router[_0x8827('0xf')](_0x8827('0xb'),auth[_0x8827('0x9')](),controller['update']);router[_0x8827('0x10')](_0x8827('0xb'),auth['isAuthenticated'](),controller[_0x8827('0x11')]);module[_0x8827('0x12')]=router; \ No newline at end of file +var _0xf874=['fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','get','show','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x580971,_0x10984d){var _0x16d873=function(_0x594084){while(--_0x594084){_0x580971['push'](_0x580971['shift']());}};_0x16d873(++_0x10984d);}(_0xf874,0x177));var _0x4f87=function(_0x4651e1,_0x3c3ebf){_0x4651e1=_0x4651e1-0x0;var _0x56eb90=_0xf874[_0x4651e1];return _0x56eb90;};'use strict';var multer=require(_0x4f87('0x0'));var util=require('util');var path=require(_0x4f87('0x1'));var timeout=require(_0x4f87('0x2'));var express=require(_0x4f87('0x3'));var router=express[_0x4f87('0x4')]();var fs_extra=require(_0x4f87('0x5'));var auth=require(_0x4f87('0x6'));var interaction=require(_0x4f87('0x7'));var config=require('../../config/environment');var controller=require(_0x4f87('0x8'));router[_0x4f87('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4f87('0xa')]);router['post']('/',auth[_0x4f87('0xb')](),controller[_0x4f87('0xc')]);router[_0x4f87('0xd')](_0x4f87('0xe'),auth['isAuthenticated'](),controller[_0x4f87('0xf')]);router[_0x4f87('0x10')](_0x4f87('0xe'),auth[_0x4f87('0xb')](),controller[_0x4f87('0x11')]);module[_0x4f87('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 51621f0..60e98ad 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js +++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cad=['exports','ENUM','string','variable','customVariable','STRING','sequelize'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x6cad,0x1aa));var _0xd6ca=function(_0x2b81ea,_0x1b2826){_0x2b81ea=_0x2b81ea-0x0;var _0x23b966=_0x6cad[_0x2b81ea];return _0x23b966;};'use strict';var Sequelize=require(_0xd6ca('0x0'));module[_0xd6ca('0x1')]={'type':{'type':Sequelize[_0xd6ca('0x2')](_0xd6ca('0x3'),_0xd6ca('0x4'),_0xd6ca('0x5'),'keyValue','picklist'),'defaultValue':_0xd6ca('0x3')},'content':{'type':Sequelize[_0xd6ca('0x6')]},'key':{'type':Sequelize[_0xd6ca('0x6')]},'keyType':{'type':Sequelize[_0xd6ca('0x2')](_0xd6ca('0x3'),_0xd6ca('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xd6ca('0x6')]},'idField':{'type':Sequelize[_0xd6ca('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc466=['customVariable','STRING','exports','string','variable','picklist'];(function(_0x398294,_0x5ceb9d){var _0x2a872d=function(_0x390883){while(--_0x390883){_0x398294['push'](_0x398294['shift']());}};_0x2a872d(++_0x5ceb9d);}(_0xc466,0xc2));var _0x6c46=function(_0x9b6210,_0x148de8){_0x9b6210=_0x9b6210-0x0;var _0x53955d=_0xc466[_0x9b6210];return _0x53955d;};'use strict';var Sequelize=require('sequelize');module[_0x6c46('0x0')]={'type':{'type':Sequelize['ENUM'](_0x6c46('0x1'),_0x6c46('0x2'),'customVariable','keyValue',_0x6c46('0x3')),'defaultValue':_0x6c46('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x6c46('0x1'),'variable',_0x6c46('0x4'))},'keyContent':{'type':Sequelize[_0x6c46('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6c46('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6c46('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 10734d9..27f2844 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.controller.js +++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47a4=['then','includeAll','findAll','rawAttributes','keys','fields','include','find','catch','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','error','stack','name','send','fieldName','type','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesField'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x47a4,0xea));var _0x447a=function(_0x52c28b,_0x31e482){_0x52c28b=_0x52c28b-0x0;var _0x40952c=_0x47a4[_0x52c28b];return _0x40952c;};'use strict';var emlformat=require(_0x447a('0x0'));var rimraf=require(_0x447a('0x1'));var zipdir=require(_0x447a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x447a('0x3'));var BPromise=require(_0x447a('0x4'));var Mustache=require(_0x447a('0x5'));var util=require(_0x447a('0x6'));var path=require(_0x447a('0x7'));var sox=require('sox');var csv=require(_0x447a('0x8'));var ejs=require(_0x447a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x447a('0xa'));var squel=require(_0x447a('0xb'));var crypto=require(_0x447a('0xc'));var jsforce=require(_0x447a('0xd'));var deskjs=require(_0x447a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x447a('0xf'));var Papa=require('papaparse');var Redis=require(_0x447a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x447a('0x11'));var hardwareService=require(_0x447a('0x12'));var logger=require(_0x447a('0x13'))(_0x447a('0x14'));var utils=require(_0x447a('0x15'));var config=require(_0x447a('0x16'));var licenseUtil=require(_0x447a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d8329,_0x180530){_0x180530=_0x180530||0xcc;return function(_0x4061c4){if(_0x4061c4){return _0x5d8329[_0x447a('0x18')](_0x180530);}return _0x5d8329[_0x447a('0x19')](_0x180530)[_0x447a('0x1a')]();};}function respondWithResult(_0xa3e7a3,_0x405f75){_0x405f75=_0x405f75||0xc8;return function(_0x371071){if(_0x371071){return _0xa3e7a3[_0x447a('0x19')](_0x405f75)[_0x447a('0x1b')](_0x371071);}};}function respondWithFilteredResult(_0xc0b9bf,_0xba0199){return function(_0x1f8e8e){if(_0x1f8e8e){var _0x4aabf3=typeof _0xba0199[_0x447a('0x1c')]===_0x447a('0x1d')&&typeof _0xba0199[_0x447a('0x1e')]===_0x447a('0x1d');var _0x4ae5e7=_0x1f8e8e[_0x447a('0x1f')];var _0x357c2e=_0x4aabf3?0x0:_0xba0199['offset'];var _0x2c4abd=_0x4aabf3?_0x1f8e8e[_0x447a('0x1f')]:_0xba0199[_0x447a('0x1c')]+_0xba0199[_0x447a('0x1e')];var _0x4509a3;if(_0x2c4abd>=_0x4ae5e7){_0x2c4abd=_0x4ae5e7;_0x4509a3=0xc8;}else{_0x4509a3=0xce;}_0xc0b9bf[_0x447a('0x19')](_0x4509a3);return _0xc0b9bf[_0x447a('0x20')]('Content-Range',_0x357c2e+'-'+_0x2c4abd+'/'+_0x4ae5e7)[_0x447a('0x1b')](_0x1f8e8e);}return null;};}function patchUpdates(_0x42e58b){return function(_0x4791d4){try{jsonpatch[_0x447a('0x21')](_0x4791d4,_0x42e58b,!![]);}catch(_0x15b2f1){return BPromise[_0x447a('0x22')](_0x15b2f1);}return _0x4791d4[_0x447a('0x23')]();};}function saveUpdates(_0x49a73a,_0x8c2d2c){return function(_0xea5d2e){if(_0xea5d2e){return _0xea5d2e[_0x447a('0x24')](_0x49a73a)['then'](function(_0xc0bb72){return _0xc0bb72;});}return null;};}function removeEntity(_0x3200a5,_0x142042){return function(_0x9b7fe1){if(_0x9b7fe1){return _0x9b7fe1[_0x447a('0x25')]()['then'](function(){_0x3200a5[_0x447a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b56a3,_0x2280b1){return function(_0x38d205){if(!_0x38d205){_0x2b56a3['sendStatus'](0x194);}return _0x38d205;};}function handleError(_0x4622bd,_0x441bce){_0x441bce=_0x441bce||0x1f4;return function(_0x44152c){logger[_0x447a('0x26')](_0x44152c[_0x447a('0x27')]);if(_0x44152c[_0x447a('0x28')]){delete _0x44152c[_0x447a('0x28')];}_0x4622bd['status'](_0x441bce)[_0x447a('0x29')](_0x44152c);};}exports['index']=function(_0x503ab0,_0x28327b){var _0x2154ab={},_0x66da9f={},_0x17fda0={'count':0x0,'rows':[]};var _0x2bd367=_['map'](db['FreshsalesField']['rawAttributes'],function(_0x529805){return{'name':_0x529805[_0x447a('0x2a')],'type':_0x529805[_0x447a('0x2b')]['key']};});_0x66da9f[_0x447a('0x2c')]=_[_0x447a('0x2d')](_0x2bd367,_0x447a('0x28'));_0x66da9f[_0x447a('0x2e')]=_['keys'](_0x503ab0[_0x447a('0x2e')]);_0x66da9f[_0x447a('0x2f')]=_[_0x447a('0x30')](_0x66da9f[_0x447a('0x2c')],_0x66da9f[_0x447a('0x2e')]);_0x2154ab[_0x447a('0x31')]=_[_0x447a('0x30')](_0x66da9f['model'],qs['fields'](_0x503ab0['query']['fields']));_0x2154ab['attributes']=_0x2154ab['attributes'][_0x447a('0x32')]?_0x2154ab[_0x447a('0x31')]:_0x66da9f[_0x447a('0x2c')];if(!_0x503ab0['query'][_0x447a('0x33')](_0x447a('0x34'))){_0x2154ab['limit']=qs[_0x447a('0x1e')](_0x503ab0[_0x447a('0x2e')][_0x447a('0x1e')]);_0x2154ab[_0x447a('0x1c')]=qs['offset'](_0x503ab0['query']['offset']);}_0x2154ab[_0x447a('0x35')]=qs[_0x447a('0x36')](_0x503ab0[_0x447a('0x2e')][_0x447a('0x36')]);_0x2154ab[_0x447a('0x37')]=qs[_0x447a('0x2f')](_[_0x447a('0x38')](_0x503ab0['query'],_0x66da9f[_0x447a('0x2f')]),_0x2bd367);if(_0x503ab0[_0x447a('0x2e')][_0x447a('0x39')]){_0x2154ab[_0x447a('0x37')]=_[_0x447a('0x3a')](_0x2154ab[_0x447a('0x37')],{'$or':_[_0x447a('0x2d')](_0x2bd367,function(_0x24029d){if(_0x24029d[_0x447a('0x2b')]!==_0x447a('0x3b')){var _0x33e8a6={};_0x33e8a6[_0x24029d['name']]={'$like':'%'+_0x503ab0['query'][_0x447a('0x39')]+'%'};return _0x33e8a6;}})});}_0x2154ab=_['merge']({},_0x2154ab,_0x503ab0[_0x447a('0x3c')]);var _0x52a71f={'where':_0x2154ab[_0x447a('0x37')]};return db[_0x447a('0x3d')][_0x447a('0x1f')](_0x52a71f)[_0x447a('0x3e')](function(_0x46f157){_0x17fda0['count']=_0x46f157;if(_0x503ab0[_0x447a('0x2e')][_0x447a('0x3f')]){_0x2154ab['include']=[{'all':!![]}];}return db[_0x447a('0x3d')][_0x447a('0x40')](_0x2154ab);})[_0x447a('0x3e')](function(_0x35cd78){_0x17fda0['rows']=_0x35cd78;return _0x17fda0;})[_0x447a('0x3e')](respondWithFilteredResult(_0x28327b,_0x2154ab))['catch'](handleError(_0x28327b,null));};exports['show']=function(_0x1e4259,_0x138aa2){var _0x3e6720={'raw':!![],'where':{'id':_0x1e4259['params']['id']}},_0x50003f={};_0x50003f[_0x447a('0x2c')]=_['keys'](db[_0x447a('0x3d')][_0x447a('0x41')]);_0x50003f[_0x447a('0x2e')]=_[_0x447a('0x42')](_0x1e4259['query']);_0x50003f['filters']=_[_0x447a('0x30')](_0x50003f[_0x447a('0x2c')],_0x50003f[_0x447a('0x2e')]);_0x3e6720['attributes']=_[_0x447a('0x30')](_0x50003f[_0x447a('0x2c')],qs[_0x447a('0x43')](_0x1e4259[_0x447a('0x2e')][_0x447a('0x43')]));_0x3e6720[_0x447a('0x31')]=_0x3e6720['attributes'][_0x447a('0x32')]?_0x3e6720[_0x447a('0x31')]:_0x50003f[_0x447a('0x2c')];if(_0x1e4259[_0x447a('0x2e')][_0x447a('0x3f')]){_0x3e6720[_0x447a('0x44')]=[{'all':!![]}];}_0x3e6720=_['merge']({},_0x3e6720,_0x1e4259[_0x447a('0x3c')]);return db[_0x447a('0x3d')][_0x447a('0x45')](_0x3e6720)[_0x447a('0x3e')](handleEntityNotFound(_0x138aa2,null))['then'](respondWithResult(_0x138aa2,null))[_0x447a('0x46')](handleError(_0x138aa2,null));};exports['create']=function(_0x7581fe,_0x498186){return db[_0x447a('0x3d')][_0x447a('0x47')](_0x7581fe[_0x447a('0x48')],{})[_0x447a('0x3e')](respondWithResult(_0x498186,0xc9))[_0x447a('0x46')](handleError(_0x498186,null));};exports[_0x447a('0x24')]=function(_0x2b783e,_0x40bf22){if(_0x2b783e['body']['id']){delete _0x2b783e['body']['id'];}return db['FreshsalesField'][_0x447a('0x45')]({'where':{'id':_0x2b783e[_0x447a('0x49')]['id']}})['then'](handleEntityNotFound(_0x40bf22,null))[_0x447a('0x3e')](saveUpdates(_0x2b783e[_0x447a('0x48')],null))[_0x447a('0x3e')](respondWithResult(_0x40bf22,null))[_0x447a('0x46')](handleError(_0x40bf22,null));};exports[_0x447a('0x25')]=function(_0x720f34,_0x21ef82){return db['FreshsalesField'][_0x447a('0x45')]({'where':{'id':_0x720f34[_0x447a('0x49')]['id']}})['then'](handleEntityNotFound(_0x21ef82,null))[_0x447a('0x3e')](removeEntity(_0x21ef82,null))[_0x447a('0x46')](handleError(_0x21ef82,null));}; \ No newline at end of file +var _0x1ad4=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','destroy','then','end','error','stack','name','send','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','update','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x5515a7,_0x2c4af1){var _0x43f4bf=function(_0x3d519d){while(--_0x3d519d){_0x5515a7['push'](_0x5515a7['shift']());}};_0x43f4bf(++_0x2c4af1);}(_0x1ad4,0x15c));var _0x41ad=function(_0x562456,_0x9ad741){_0x562456=_0x562456-0x0;var _0x46d4a9=_0x1ad4[_0x562456];return _0x46d4a9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x41ad('0x0'));var jsonpatch=require(_0x41ad('0x1'));var rp=require(_0x41ad('0x2'));var moment=require('moment');var BPromise=require(_0x41ad('0x3'));var Mustache=require('mustache');var util=require(_0x41ad('0x4'));var path=require('path');var sox=require(_0x41ad('0x5'));var csv=require(_0x41ad('0x6'));var ejs=require(_0x41ad('0x7'));var fs=require('fs');var fs_extra=require(_0x41ad('0x8'));var _=require(_0x41ad('0x9'));var squel=require(_0x41ad('0xa'));var crypto=require(_0x41ad('0xb'));var jsforce=require(_0x41ad('0xc'));var deskjs=require(_0x41ad('0xd'));var toCsv=require('to-csv');var querystring=require(_0x41ad('0xe'));var Papa=require(_0x41ad('0xf'));var Redis=require(_0x41ad('0x10'));var authService=require(_0x41ad('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x41ad('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x41ad('0x13'))(_0x41ad('0x14'));var utils=require(_0x41ad('0x15'));var config=require(_0x41ad('0x16'));var licenseUtil=require(_0x41ad('0x17'));var db=require(_0x41ad('0x18'))['db'];function respondWithStatusCode(_0x31dd1f,_0x50232f){_0x50232f=_0x50232f||0xcc;return function(_0x37d44c){if(_0x37d44c){return _0x31dd1f[_0x41ad('0x19')](_0x50232f);}return _0x31dd1f[_0x41ad('0x1a')](_0x50232f)['end']();};}function respondWithResult(_0x592ed9,_0x4339cf){_0x4339cf=_0x4339cf||0xc8;return function(_0x11a244){if(_0x11a244){return _0x592ed9[_0x41ad('0x1a')](_0x4339cf)[_0x41ad('0x1b')](_0x11a244);}};}function respondWithFilteredResult(_0x39b6be,_0x2a5a95){return function(_0x3a2c76){if(_0x3a2c76){var _0x1c4fb0=typeof _0x2a5a95[_0x41ad('0x1c')]===_0x41ad('0x1d')&&typeof _0x2a5a95['limit']==='undefined';var _0x3856ba=_0x3a2c76['count'];var _0x1d593f=_0x1c4fb0?0x0:_0x2a5a95[_0x41ad('0x1c')];var _0x1c4996=_0x1c4fb0?_0x3a2c76[_0x41ad('0x1e')]:_0x2a5a95[_0x41ad('0x1c')]+_0x2a5a95[_0x41ad('0x1f')];var _0x3f0e45;if(_0x1c4996>=_0x3856ba){_0x1c4996=_0x3856ba;_0x3f0e45=0xc8;}else{_0x3f0e45=0xce;}_0x39b6be[_0x41ad('0x1a')](_0x3f0e45);return _0x39b6be[_0x41ad('0x20')]('Content-Range',_0x1d593f+'-'+_0x1c4996+'/'+_0x3856ba)['json'](_0x3a2c76);}return null;};}function patchUpdates(_0x33c294){return function(_0x2c910a){try{jsonpatch[_0x41ad('0x21')](_0x2c910a,_0x33c294,!![]);}catch(_0x5d73fe){return BPromise[_0x41ad('0x22')](_0x5d73fe);}return _0x2c910a['save']();};}function saveUpdates(_0xd65b68,_0x3e82da){return function(_0x23815e){if(_0x23815e){return _0x23815e['update'](_0xd65b68)['then'](function(_0x15bd51){return _0x15bd51;});}return null;};}function removeEntity(_0x399f33,_0x2537fc){return function(_0x398eb5){if(_0x398eb5){return _0x398eb5[_0x41ad('0x23')]()[_0x41ad('0x24')](function(){_0x399f33[_0x41ad('0x1a')](0xcc)[_0x41ad('0x25')]();});}};}function handleEntityNotFound(_0x2dba14,_0x45c338){return function(_0x1f4a9f){if(!_0x1f4a9f){_0x2dba14[_0x41ad('0x19')](0x194);}return _0x1f4a9f;};}function handleError(_0x360dcc,_0x55858d){_0x55858d=_0x55858d||0x1f4;return function(_0x1faf07){logger[_0x41ad('0x26')](_0x1faf07[_0x41ad('0x27')]);if(_0x1faf07['name']){delete _0x1faf07[_0x41ad('0x28')];}_0x360dcc[_0x41ad('0x1a')](_0x55858d)[_0x41ad('0x29')](_0x1faf07);};}exports['index']=function(_0x3bd67b,_0x3478c8){var _0x3835fd={},_0x15dc02={},_0xcecf9f={'count':0x0,'rows':[]};var _0xe6a317=_[_0x41ad('0x2a')](db[_0x41ad('0x2b')][_0x41ad('0x2c')],function(_0x3bc780){return{'name':_0x3bc780[_0x41ad('0x2d')],'type':_0x3bc780[_0x41ad('0x2e')][_0x41ad('0x2f')]};});_0x15dc02[_0x41ad('0x30')]=_[_0x41ad('0x2a')](_0xe6a317,_0x41ad('0x28'));_0x15dc02[_0x41ad('0x31')]=_[_0x41ad('0x32')](_0x3bd67b['query']);_0x15dc02['filters']=_['intersection'](_0x15dc02[_0x41ad('0x30')],_0x15dc02[_0x41ad('0x31')]);_0x3835fd[_0x41ad('0x33')]=_[_0x41ad('0x34')](_0x15dc02['model'],qs[_0x41ad('0x35')](_0x3bd67b[_0x41ad('0x31')][_0x41ad('0x35')]));_0x3835fd[_0x41ad('0x33')]=_0x3835fd['attributes']['length']?_0x3835fd[_0x41ad('0x33')]:_0x15dc02[_0x41ad('0x30')];if(!_0x3bd67b['query'][_0x41ad('0x36')](_0x41ad('0x37'))){_0x3835fd[_0x41ad('0x1f')]=qs[_0x41ad('0x1f')](_0x3bd67b[_0x41ad('0x31')][_0x41ad('0x1f')]);_0x3835fd[_0x41ad('0x1c')]=qs[_0x41ad('0x1c')](_0x3bd67b[_0x41ad('0x31')][_0x41ad('0x1c')]);}_0x3835fd['order']=qs[_0x41ad('0x38')](_0x3bd67b['query'][_0x41ad('0x38')]);_0x3835fd[_0x41ad('0x39')]=qs[_0x41ad('0x3a')](_[_0x41ad('0x3b')](_0x3bd67b[_0x41ad('0x31')],_0x15dc02[_0x41ad('0x3a')]),_0xe6a317);if(_0x3bd67b[_0x41ad('0x31')]['filter']){_0x3835fd[_0x41ad('0x39')]=_[_0x41ad('0x3c')](_0x3835fd['where'],{'$or':_[_0x41ad('0x2a')](_0xe6a317,function(_0x2d2803){if(_0x2d2803[_0x41ad('0x2e')]!==_0x41ad('0x3d')){var _0x6044f={};_0x6044f[_0x2d2803[_0x41ad('0x28')]]={'$like':'%'+_0x3bd67b['query'][_0x41ad('0x3e')]+'%'};return _0x6044f;}})});}_0x3835fd=_['merge']({},_0x3835fd,_0x3bd67b[_0x41ad('0x3f')]);var _0x533a9d={'where':_0x3835fd[_0x41ad('0x39')]};return db[_0x41ad('0x2b')][_0x41ad('0x1e')](_0x533a9d)[_0x41ad('0x24')](function(_0x585b40){_0xcecf9f[_0x41ad('0x1e')]=_0x585b40;if(_0x3bd67b['query'][_0x41ad('0x40')]){_0x3835fd[_0x41ad('0x41')]=[{'all':!![]}];}return db[_0x41ad('0x2b')]['findAll'](_0x3835fd);})[_0x41ad('0x24')](function(_0xb0d83e){_0xcecf9f[_0x41ad('0x42')]=_0xb0d83e;return _0xcecf9f;})[_0x41ad('0x24')](respondWithFilteredResult(_0x3478c8,_0x3835fd))[_0x41ad('0x43')](handleError(_0x3478c8,null));};exports[_0x41ad('0x44')]=function(_0x47c4cd,_0x596283){var _0x3c8a01={'raw':!![],'where':{'id':_0x47c4cd[_0x41ad('0x45')]['id']}},_0x5000e1={};_0x5000e1[_0x41ad('0x30')]=_[_0x41ad('0x32')](db[_0x41ad('0x2b')][_0x41ad('0x2c')]);_0x5000e1['query']=_[_0x41ad('0x32')](_0x47c4cd['query']);_0x5000e1[_0x41ad('0x3a')]=_['intersection'](_0x5000e1[_0x41ad('0x30')],_0x5000e1['query']);_0x3c8a01[_0x41ad('0x33')]=_['intersection'](_0x5000e1[_0x41ad('0x30')],qs[_0x41ad('0x35')](_0x47c4cd[_0x41ad('0x31')]['fields']));_0x3c8a01[_0x41ad('0x33')]=_0x3c8a01['attributes']['length']?_0x3c8a01[_0x41ad('0x33')]:_0x5000e1[_0x41ad('0x30')];if(_0x47c4cd['query']['includeAll']){_0x3c8a01['include']=[{'all':!![]}];}_0x3c8a01=_[_0x41ad('0x3c')]({},_0x3c8a01,_0x47c4cd[_0x41ad('0x3f')]);return db[_0x41ad('0x2b')][_0x41ad('0x46')](_0x3c8a01)[_0x41ad('0x24')](handleEntityNotFound(_0x596283,null))[_0x41ad('0x24')](respondWithResult(_0x596283,null))['catch'](handleError(_0x596283,null));};exports[_0x41ad('0x47')]=function(_0x3862e0,_0x3c7301){return db[_0x41ad('0x2b')][_0x41ad('0x47')](_0x3862e0[_0x41ad('0x48')],{})[_0x41ad('0x24')](respondWithResult(_0x3c7301,0xc9))[_0x41ad('0x43')](handleError(_0x3c7301,null));};exports[_0x41ad('0x49')]=function(_0x2956aa,_0x100cf9){if(_0x2956aa['body']['id']){delete _0x2956aa[_0x41ad('0x48')]['id'];}return db[_0x41ad('0x2b')][_0x41ad('0x46')]({'where':{'id':_0x2956aa[_0x41ad('0x45')]['id']}})[_0x41ad('0x24')](handleEntityNotFound(_0x100cf9,null))[_0x41ad('0x24')](saveUpdates(_0x2956aa[_0x41ad('0x48')],null))['then'](respondWithResult(_0x100cf9,null))[_0x41ad('0x43')](handleError(_0x100cf9,null));};exports['destroy']=function(_0x29c508,_0x197aae){return db[_0x41ad('0x2b')][_0x41ad('0x46')]({'where':{'id':_0x29c508[_0x41ad('0x45')]['id']}})[_0x41ad('0x24')](handleEntityNotFound(_0x197aae,null))[_0x41ad('0x24')](removeEntity(_0x197aae,null))[_0x41ad('0x43')](handleError(_0x197aae,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 620d686..31bc1eb 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.model.js +++ b/server/api/intFreshsalesField/intFreshsalesField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5525=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash'];(function(_0x3b4863,_0x3a823c){var _0x231504=function(_0x33917b){while(--_0x33917b){_0x3b4863['push'](_0x3b4863['shift']());}};_0x231504(++_0x3a823c);}(_0x5525,0xd1));var _0x5552=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5525[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x5552('0x0'));var util=require(_0x5552('0x1'));var logger=require(_0x5552('0x2'))(_0x5552('0x3'));var moment=require(_0x5552('0x4'));var BPromise=require(_0x5552('0x5'));var rp=require(_0x5552('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5552('0x7'));var config=require(_0x5552('0x8'));var attributes=require('./intFreshsalesField.attributes');module[_0x5552('0x9')]=function(_0x3fe1fb,_0x96ff0a){return _0x3fe1fb[_0x5552('0xa')](_0x5552('0xb'),attributes,{'tableName':_0x5552('0xc'),'paranoid':![],'indexes':[{'name':_0x5552('0xd'),'fields':[_0x5552('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x23bb=['rimraf','../../config/environment','freshsales_unique_index','FieldId','lodash','api','moment','bluebird','path'];(function(_0x33604c,_0x225d3a){var _0x4fae0f=function(_0x51f78c){while(--_0x51f78c){_0x33604c['push'](_0x33604c['shift']());}};_0x4fae0f(++_0x225d3a);}(_0x23bb,0x79));var _0xb23b=function(_0x233a13,_0x355a55){_0x233a13=_0x233a13-0x0;var _0x5ed596=_0x23bb[_0x233a13];return _0x5ed596;};'use strict';var _=require(_0xb23b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb23b('0x1'));var moment=require(_0xb23b('0x2'));var BPromise=require(_0xb23b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb23b('0x4'));var rimraf=require(_0xb23b('0x5'));var config=require(_0xb23b('0x6'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x50f8a8,_0x306f8b){return _0x50f8a8['define']('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xb23b('0x7'),'fields':['idField',_0xb23b('0x8')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 39f256f..de1821a 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js +++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x322d4a,_0x117df4){var _0x41b333=function(_0x17ef6c){while(--_0x17ef6c){_0x322d4a['push'](_0x322d4a['shift']());}};_0x41b333(++_0x117df4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc4aa[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x2542=['info','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x169bf2,_0x4ff725){var _0x1612c8=function(_0xef2444){while(--_0xef2444){_0x169bf2['push'](_0x169bf2['shift']());}};_0x1612c8(++_0x4ff725);}(_0x2542,0x169));var _0x2254=function(_0xcf592c,_0x4574d8){_0xcf592c=_0xcf592c-0x0;var _0x535847=_0x2542[_0xcf592c];return _0x535847;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 26aa281..563b003 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x591093,_0x469de1){var _0x23dc51=function(_0x589d8b){while(--_0x589d8b){_0x591093['push'](_0x591093['shift']());}};_0x23dc51(++_0x469de1);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x39115e,_0x3c8cf7){var _0x12f730=function(_0x250558){while(--_0x250558){_0x39115e['push'](_0x39115e['shift']());}};_0x12f730(++_0x3c8cf7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 39e9e1a..680fde1 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18b2=['newTab','exports','STRING','username','ENUM','integrationTab'];(function(_0x5c752b,_0x286f09){var _0x46d510=function(_0x117221){while(--_0x117221){_0x5c752b['push'](_0x5c752b['shift']());}};_0x46d510(++_0x286f09);}(_0x18b2,0x85));var _0x218b=function(_0x1634cf,_0x211d03){_0x1634cf=_0x1634cf-0x0;var _0xf27e1c=_0x18b2[_0x1634cf];return _0xf27e1c;};'use strict';var Sequelize=require('sequelize');module[_0x218b('0x0')]={'name':{'type':Sequelize[_0x218b('0x1')]},'description':{'type':Sequelize[_0x218b('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x218b('0x2')},'remoteUri':{'type':Sequelize[_0x218b('0x1')]},'password':{'type':Sequelize[_0x218b('0x1')]},'clientId':{'type':Sequelize[_0x218b('0x1')]},'clientSecret':{'type':Sequelize[_0x218b('0x1')]},'securityToken':{'type':Sequelize[_0x218b('0x1')]},'serverUrl':{'type':Sequelize[_0x218b('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x218b('0x3')](_0x218b('0x4'),_0x218b('0x5')),'defaultValue':_0x218b('0x4')}}; \ No newline at end of file +var _0xceef=['newTab','integrationTab','STRING','username'];(function(_0x46844a,_0x4600b7){var _0xcc1b=function(_0x11719c){while(--_0x11719c){_0x46844a['push'](_0x46844a['shift']());}};_0xcc1b(++_0x4600b7);}(_0xceef,0xf6));var _0xfcee=function(_0x2781b0,_0x4ec0d2){_0x2781b0=_0x2781b0-0x0;var _0xb532ba=_0xceef[_0x2781b0];return _0xb532ba;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfcee('0x0')]},'description':{'type':Sequelize[_0xfcee('0x0')]},'username':{'type':Sequelize['STRING'],'unique':_0xfcee('0x1')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xfcee('0x0')]},'clientId':{'type':Sequelize[_0xfcee('0x0')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xfcee('0x0')]},'serverUrl':{'type':Sequelize[_0xfcee('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0xfcee('0x2')),'defaultValue':_0xfcee('0x3')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 538a065..6df30d0 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa327=['label','custom','picklistValues','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','SalesforceAccount','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','catch','params','rawAttributes','options','create','body','destroy','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','Subjects','getSubjects','channel','SalesforceField','getFields','Task','clientSecret','password','securityToken','remoteUri','slice','substring','lastIndexOf','Connection','login','ticketType','sobject','ActivityDate','IsReminderSet','IsRecurrence','Description','string','int','picklist','boolean','textarea','remove','includes'];(function(_0x7261e6,_0x3e3bf7){var _0x20d5ed=function(_0x522641){while(--_0x522641){_0x7261e6['push'](_0x7261e6['shift']());}};_0x20d5ed(++_0x3e3bf7);}(_0xa327,0x166));var _0x7a32=function(_0x139888,_0x186d9a){_0x139888=_0x139888-0x0;var _0x3fc0d6=_0xa327[_0x139888];return _0x3fc0d6;};'use strict';var emlformat=require(_0x7a32('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7a32('0x1'));var jsonpatch=require(_0x7a32('0x2'));var rp=require('request-promise');var moment=require(_0x7a32('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7a32('0x4'));var sox=require('sox');var csv=require(_0x7a32('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7a32('0x6'));var _=require('lodash');var squel=require(_0x7a32('0x7'));var crypto=require(_0x7a32('0x8'));var jsforce=require(_0x7a32('0x9'));var deskjs=require(_0x7a32('0xa'));var toCsv=require(_0x7a32('0x5'));var querystring=require(_0x7a32('0xb'));var Papa=require(_0x7a32('0xc'));var Redis=require('ioredis');var authService=require(_0x7a32('0xd'));var qs=require(_0x7a32('0xe'));var as=require(_0x7a32('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7a32('0x10'))(_0x7a32('0x11'));var utils=require(_0x7a32('0x12'));var config=require(_0x7a32('0x13'));var licenseUtil=require(_0x7a32('0x14'));var db=require(_0x7a32('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x212ba4,_0x3cb622){_0x3cb622=_0x3cb622||0xcc;return function(_0x44e4a4){if(_0x44e4a4){return _0x212ba4[_0x7a32('0x16')](_0x3cb622);}return _0x212ba4[_0x7a32('0x17')](_0x3cb622)[_0x7a32('0x18')]();};}function respondWithResult(_0x248616,_0x3d8274){_0x3d8274=_0x3d8274||0xc8;return function(_0x482502){if(_0x482502){return _0x248616[_0x7a32('0x17')](_0x3d8274)[_0x7a32('0x19')](_0x482502);}};}function respondWithFilteredResult(_0x247425,_0x510f27){return function(_0x2270cb){if(_0x2270cb){var _0x191f8c=typeof _0x510f27[_0x7a32('0x1a')]==='undefined'&&typeof _0x510f27['limit']===_0x7a32('0x1b');var _0x4394c3=_0x2270cb[_0x7a32('0x1c')];var _0x206a83=_0x191f8c?0x0:_0x510f27['offset'];var _0x337971=_0x191f8c?_0x2270cb[_0x7a32('0x1c')]:_0x510f27[_0x7a32('0x1a')]+_0x510f27['limit'];var _0x52f070;if(_0x337971>=_0x4394c3){_0x337971=_0x4394c3;_0x52f070=0xc8;}else{_0x52f070=0xce;}_0x247425['status'](_0x52f070);return _0x247425[_0x7a32('0x1d')](_0x7a32('0x1e'),_0x206a83+'-'+_0x337971+'/'+_0x4394c3)[_0x7a32('0x19')](_0x2270cb);}return null;};}function patchUpdates(_0xf71cb5){return function(_0x5625c1){try{jsonpatch[_0x7a32('0x1f')](_0x5625c1,_0xf71cb5,!![]);}catch(_0xf66abb){return BPromise[_0x7a32('0x20')](_0xf66abb);}return _0x5625c1['save']();};}function saveUpdates(_0x41d3aa,_0x582a9a){return function(_0x297a6d){if(_0x297a6d){return _0x297a6d[_0x7a32('0x21')](_0x41d3aa)[_0x7a32('0x22')](function(_0x8acf3){return _0x8acf3;});}return null;};}function removeEntity(_0x288c4a,_0x1808ec){return function(_0x8d9418){if(_0x8d9418){return _0x8d9418['destroy']()['then'](function(){_0x288c4a[_0x7a32('0x17')](0xcc)[_0x7a32('0x18')]();});}};}function handleEntityNotFound(_0x2755f0,_0x43ecfc){return function(_0xeebc68){if(!_0xeebc68){_0x2755f0[_0x7a32('0x16')](0x194);}return _0xeebc68;};}function handleError(_0x34a898,_0x272a10){_0x272a10=_0x272a10||0x1f4;return function(_0x5ed400){logger[_0x7a32('0x23')](_0x5ed400[_0x7a32('0x24')]);if(_0x5ed400[_0x7a32('0x25')]){delete _0x5ed400[_0x7a32('0x25')];}_0x34a898[_0x7a32('0x17')](_0x272a10)[_0x7a32('0x26')](_0x5ed400);};}exports[_0x7a32('0x27')]=function(_0x571983,_0x1d02ce){var _0x4c27e5={},_0x2faf08={},_0x22cac4={'count':0x0,'rows':[]};var _0xc82021=_[_0x7a32('0x28')](db[_0x7a32('0x29')]['rawAttributes'],function(_0x17bd2a){return{'name':_0x17bd2a['fieldName'],'type':_0x17bd2a[_0x7a32('0x2a')]['key']};});_0x2faf08[_0x7a32('0x2b')]=_[_0x7a32('0x28')](_0xc82021,_0x7a32('0x25'));_0x2faf08[_0x7a32('0x2c')]=_[_0x7a32('0x2d')](_0x571983[_0x7a32('0x2c')]);_0x2faf08['filters']=_[_0x7a32('0x2e')](_0x2faf08[_0x7a32('0x2b')],_0x2faf08[_0x7a32('0x2c')]);_0x4c27e5['attributes']=_[_0x7a32('0x2e')](_0x2faf08[_0x7a32('0x2b')],qs[_0x7a32('0x2f')](_0x571983[_0x7a32('0x2c')][_0x7a32('0x2f')]));_0x4c27e5[_0x7a32('0x30')]=_0x4c27e5[_0x7a32('0x30')][_0x7a32('0x31')]?_0x4c27e5[_0x7a32('0x30')]:_0x2faf08[_0x7a32('0x2b')];if(!_0x571983[_0x7a32('0x2c')][_0x7a32('0x32')](_0x7a32('0x33'))){_0x4c27e5['limit']=qs['limit'](_0x571983['query'][_0x7a32('0x34')]);_0x4c27e5['offset']=qs[_0x7a32('0x1a')](_0x571983['query']['offset']);}_0x4c27e5[_0x7a32('0x35')]=qs[_0x7a32('0x36')](_0x571983['query'][_0x7a32('0x36')]);_0x4c27e5[_0x7a32('0x37')]=qs[_0x7a32('0x38')](_[_0x7a32('0x39')](_0x571983[_0x7a32('0x2c')],_0x2faf08[_0x7a32('0x38')]),_0xc82021);if(_0x571983[_0x7a32('0x2c')][_0x7a32('0x3a')]){_0x4c27e5[_0x7a32('0x37')]=_[_0x7a32('0x3b')](_0x4c27e5['where'],{'$or':_[_0x7a32('0x28')](_0xc82021,function(_0x50e433){if(_0x50e433[_0x7a32('0x2a')]!==_0x7a32('0x3c')){var _0x4f7ce2={};_0x4f7ce2[_0x50e433[_0x7a32('0x25')]]={'$like':'%'+_0x571983['query'][_0x7a32('0x3a')]+'%'};return _0x4f7ce2;}})});}_0x4c27e5=_[_0x7a32('0x3b')]({},_0x4c27e5,_0x571983['options']);var _0x9a471a={'where':_0x4c27e5['where']};return db[_0x7a32('0x29')][_0x7a32('0x1c')](_0x9a471a)['then'](function(_0x163c74){_0x22cac4['count']=_0x163c74;if(_0x571983[_0x7a32('0x2c')][_0x7a32('0x3d')]){_0x4c27e5[_0x7a32('0x3e')]=[{'all':!![]}];}return db[_0x7a32('0x29')]['findAll'](_0x4c27e5);})['then'](function(_0x26568f){_0x22cac4['rows']=_0x26568f;return _0x22cac4;})[_0x7a32('0x22')](respondWithFilteredResult(_0x1d02ce,_0x4c27e5))[_0x7a32('0x3f')](handleError(_0x1d02ce,null));};exports['show']=function(_0x3f0f2a,_0x455793){var _0x1a358c={'raw':![],'where':{'id':_0x3f0f2a[_0x7a32('0x40')]['id']}},_0x4f7c92={};_0x4f7c92[_0x7a32('0x2b')]=_[_0x7a32('0x2d')](db[_0x7a32('0x29')][_0x7a32('0x41')]);_0x4f7c92[_0x7a32('0x2c')]=_[_0x7a32('0x2d')](_0x3f0f2a[_0x7a32('0x2c')]);_0x4f7c92[_0x7a32('0x38')]=_[_0x7a32('0x2e')](_0x4f7c92['model'],_0x4f7c92[_0x7a32('0x2c')]);_0x1a358c[_0x7a32('0x30')]=_[_0x7a32('0x2e')](_0x4f7c92[_0x7a32('0x2b')],qs[_0x7a32('0x2f')](_0x3f0f2a[_0x7a32('0x2c')][_0x7a32('0x2f')]));_0x1a358c[_0x7a32('0x30')]=_0x1a358c[_0x7a32('0x30')][_0x7a32('0x31')]?_0x1a358c[_0x7a32('0x30')]:_0x4f7c92['model'];if(_0x3f0f2a['query'][_0x7a32('0x3d')]){_0x1a358c[_0x7a32('0x3e')]=[{'all':!![]}];}_0x1a358c=_['merge']({},_0x1a358c,_0x3f0f2a[_0x7a32('0x42')]);return db[_0x7a32('0x29')]['find'](_0x1a358c)[_0x7a32('0x22')](handleEntityNotFound(_0x455793,null))['then'](respondWithResult(_0x455793,null))['catch'](handleError(_0x455793,null));};exports[_0x7a32('0x43')]=function(_0x31ea14,_0x1f25d6){return db[_0x7a32('0x29')][_0x7a32('0x43')](_0x31ea14['body'],{})[_0x7a32('0x22')](respondWithResult(_0x1f25d6,0xc9))[_0x7a32('0x3f')](handleError(_0x1f25d6,null));};exports[_0x7a32('0x21')]=function(_0xed660a,_0x8ddc7e){if(_0xed660a[_0x7a32('0x44')]['id']){delete _0xed660a[_0x7a32('0x44')]['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0xed660a[_0x7a32('0x40')]['id']}})['then'](handleEntityNotFound(_0x8ddc7e,null))[_0x7a32('0x22')](saveUpdates(_0xed660a[_0x7a32('0x44')],null))['then'](respondWithResult(_0x8ddc7e,null))[_0x7a32('0x3f')](handleError(_0x8ddc7e,null));};exports[_0x7a32('0x45')]=function(_0x1f6bb6,_0x4a9de5){return db[_0x7a32('0x29')]['find']({'where':{'id':_0x1f6bb6[_0x7a32('0x40')]['id']}})['then'](handleEntityNotFound(_0x4a9de5,null))[_0x7a32('0x22')](removeEntity(_0x4a9de5,null))[_0x7a32('0x3f')](handleError(_0x4a9de5,null));};exports[_0x7a32('0x46')]=function(_0x4fa56f,_0x41c643,_0x323c24){var _0x3656bd={};var _0x2c8518={};var _0x5441aa;var _0x4d90be;return db[_0x7a32('0x29')][_0x7a32('0x47')]({'where':{'id':_0x4fa56f[_0x7a32('0x40')]['id']}})['then'](handleEntityNotFound(_0x41c643,null))[_0x7a32('0x22')](function(_0xb07ac9){if(_0xb07ac9){_0x5441aa=_0xb07ac9;_0x2c8518[_0x7a32('0x2b')]=_[_0x7a32('0x2d')](db[_0x7a32('0x48')][_0x7a32('0x41')]);_0x2c8518[_0x7a32('0x2c')]=_[_0x7a32('0x2d')](_0x4fa56f['query']);_0x2c8518[_0x7a32('0x38')]=_['intersection'](_0x2c8518[_0x7a32('0x2b')],_0x2c8518['query']);_0x3656bd[_0x7a32('0x30')]=_[_0x7a32('0x2e')](_0x2c8518[_0x7a32('0x2b')],qs['fields'](_0x4fa56f[_0x7a32('0x2c')]['fields']));_0x3656bd['attributes']=_0x3656bd['attributes'][_0x7a32('0x31')]?_0x3656bd[_0x7a32('0x30')]:_0x2c8518[_0x7a32('0x2b')];_0x3656bd[_0x7a32('0x35')]=qs[_0x7a32('0x36')](_0x4fa56f[_0x7a32('0x2c')][_0x7a32('0x36')]);_0x3656bd[_0x7a32('0x37')]=qs[_0x7a32('0x38')](_[_0x7a32('0x39')](_0x4fa56f['query'],_0x2c8518[_0x7a32('0x38')]));if(_0x4fa56f['query'][_0x7a32('0x3a')]){_0x3656bd[_0x7a32('0x37')]=_[_0x7a32('0x3b')](_0x3656bd[_0x7a32('0x37')],{'$or':_[_0x7a32('0x28')](_0x3656bd[_0x7a32('0x30')],function(_0x534c6c){var _0x12f397={};_0x12f397[_0x534c6c]={'$like':'%'+_0x4fa56f['query'][_0x7a32('0x3a')]+'%'};return _0x12f397;})});}_0x3656bd=_[_0x7a32('0x3b')]({},_0x3656bd,_0x4fa56f['options']);return _0x5441aa['getConfigurations'](_0x3656bd);}})[_0x7a32('0x22')](function(_0x4b81d9){if(_0x4b81d9){_0x4d90be=_0x4b81d9[_0x7a32('0x31')];if(!_0x4fa56f[_0x7a32('0x2c')][_0x7a32('0x32')](_0x7a32('0x33'))){_0x3656bd[_0x7a32('0x34')]=qs[_0x7a32('0x34')](_0x4fa56f['query'][_0x7a32('0x34')]);_0x3656bd[_0x7a32('0x1a')]=qs[_0x7a32('0x1a')](_0x4fa56f['query'][_0x7a32('0x1a')]);}return _0x5441aa[_0x7a32('0x46')](_0x3656bd);}})[_0x7a32('0x22')](function(_0x4ca7bf){if(_0x4ca7bf){return _0x4ca7bf?{'count':_0x4d90be,'rows':_0x4ca7bf}:null;}})[_0x7a32('0x22')](respondWithResult(_0x41c643,null))[_0x7a32('0x3f')](handleError(_0x41c643,null));};exports[_0x7a32('0x49')]=function(_0x3d615c,_0x4e7aa1,_0x3b728e){if(_0x3d615c['body']['id']){delete _0x3d615c['body']['id'];}return db[_0x7a32('0x29')][_0x7a32('0x47')]({'where':{'id':_0x3d615c['params']['id']}})[_0x7a32('0x22')](handleEntityNotFound(_0x4e7aa1,null))['then'](function(_0x116e0d){if(_0x116e0d){_0x3d615c[_0x7a32('0x44')]['AccountId']=_0x116e0d['id'];_0x3d615c[_0x7a32('0x44')][_0x7a32('0x4a')]=integrations[_0x7a32('0x4b')](_0x3d615c[_0x7a32('0x44')]['channel'],_0x3d615c[_0x7a32('0x44')][_0x7a32('0x2a')]);_0x3d615c[_0x7a32('0x44')]['Descriptions']=integrations['getDescriptions'](_0x3d615c[_0x7a32('0x44')][_0x7a32('0x4c')],_0x3d615c['body'][_0x7a32('0x2a')]);return db[_0x7a32('0x48')][_0x7a32('0x43')](_0x3d615c[_0x7a32('0x44')],{'include':[{'model':db[_0x7a32('0x4d')],'as':'Subjects'},{'model':db[_0x7a32('0x4d')],'as':'Descriptions'}]});}return null;})[_0x7a32('0x22')](respondWithResult(_0x4e7aa1,null))[_0x7a32('0x3f')](handleError(_0x4e7aa1,null));};exports[_0x7a32('0x4e')]=function(_0x5193ef,_0x572e15,_0x31a158){var _0x30a47d;var _0x5e518d='';var _0x174808=_0x7a32('0x4f');return db[_0x7a32('0x29')][_0x7a32('0x47')]({'where':{'id':_0x5193ef[_0x7a32('0x40')]['id']},'attributes':['id','remoteUri','clientId',_0x7a32('0x50'),'username',_0x7a32('0x51'),_0x7a32('0x52')]})[_0x7a32('0x22')](handleEntityNotFound(_0x572e15,null))[_0x7a32('0x22')](function(_0x1c2f13){if(_0x1c2f13){_0x5e518d=_0x1c2f13[_0x7a32('0x53')];var _0x326452=_0x5e518d[_0x7a32('0x54')](-0x1);if(_0x326452==='/'){_0x5e518d=_0x5e518d[_0x7a32('0x55')](0x0,_0x5e518d[_0x7a32('0x56')](_0x326452));}_0x30a47d=new jsforce[(_0x7a32('0x57'))]({'oauth2':{'loginUrl':_0x5e518d,'clientId':_0x1c2f13['clientId'],'clientSecret':_0x1c2f13['clientSecret']}});return _0x30a47d[_0x7a32('0x58')](_0x1c2f13['username'],_0x1c2f13[_0x7a32('0x51')]['concat'](_0x1c2f13[_0x7a32('0x52')]));}})[_0x7a32('0x22')](function(_0x25afb){if(_0x25afb){if(!_['isNil'](_0x5193ef['query'][_0x7a32('0x59')])){_0x174808=_0x5193ef[_0x7a32('0x2c')][_0x7a32('0x59')];}return _0x30a47d[_0x7a32('0x5a')](_0x174808)['describe']();}})[_0x7a32('0x22')](function(_0xbdab85){var _0x2526a5=['OwnerId',_0x7a32('0x5b'),_0x7a32('0x5c'),_0x7a32('0x5d'),'Subject',_0x7a32('0x5e')];var _0x41eda7=[_0x7a32('0x5f'),_0x7a32('0x60'),_0x7a32('0x61'),_0x7a32('0x62'),'email',_0x7a32('0x63'),'phone'];if(_0xbdab85){_[_0x7a32('0x64')](_0xbdab85[_0x7a32('0x2f')],function(_0x1143e2){return _0x2526a5[_0x7a32('0x65')](_0x1143e2[_0x7a32('0x25')])||!_0x41eda7[_0x7a32('0x65')](_0x1143e2['type']);});return{'count':_0xbdab85[_0x7a32('0x2f')][_0x7a32('0x31')],'rows':_[_0x7a32('0x28')](_0xbdab85[_0x7a32('0x2f')],function(_0x4b5198){return{'id':_0x4b5198[_0x7a32('0x25')],'name':_0x4b5198[_0x7a32('0x66')],'custom':_0x4b5198[_0x7a32('0x67')],'options':_0x4b5198[_0x7a32('0x68')][_0x7a32('0x31')]>0x0?_[_0x7a32('0x28')](_0x4b5198['picklistValues'],function(_0x511ce4){return{'name':_0x511ce4[_0x7a32('0x66')],'value':_0x511ce4[_0x7a32('0x69')]};}):_0x4b5198['type']==_0x7a32('0x62')?[{'name':_0x7a32('0x6a'),'value':_0x7a32('0x6b')},{'name':_0x7a32('0x6c'),'value':_0x7a32('0x6d')}]:[]};})};}})[_0x7a32('0x22')](respondWithResult(_0x572e15,null))[_0x7a32('0x3f')](function(_0x4504d6){var _0x2594e6=_0x5193ef[_0x7a32('0x2c')][_0x7a32('0x6e')]?0x1f4:_0x4504d6[_0x7a32('0x6f')]||0x1f4;logger[_0x7a32('0x23')](_0x7a32('0x70'),_0x7a32('0x4e'),_0x2594e6,JSON[_0x7a32('0x71')](_0x4504d6));delete _0x4504d6[_0x7a32('0x25')];if(_0x2594e6===0x191){_0x2594e6=0x190;}_0x572e15['status'](_0x2594e6)[_0x7a32('0x26')](_0x5193ef['query'][_0x7a32('0x6e')]?{'message':_0x7a32('0x72'),'statusCode':_0x4504d6[_0x7a32('0x6f')]}:_0x4504d6);});}; \ No newline at end of file +var _0xa575=['limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','status','index','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','includeAll','include','SalesforceAccount','findAll','rows','catch','show','length','merge','options','create','body','find','params','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','getSubjects','channel','Descriptions','SalesforceField','Subjects','getFields','remoteUri','username','password','securityToken','slice','lastIndexOf','clientId','clientSecret','concat','isNil','ticketType','sobject','OwnerId','IsReminderSet','IsRecurrence','Subject','string','int','boolean','textarea','phone','remove','includes','label','custom','picklistValues','true','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','json','offset'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0xa575,0x14b));var _0x5a57=function(_0x41d93c,_0x4a6967){_0x41d93c=_0x41d93c-0x0;var _0x45634d=_0xa575[_0x41d93c];return _0x45634d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a57('0x0'));var zipdir=require(_0x5a57('0x1'));var jsonpatch=require(_0x5a57('0x2'));var rp=require(_0x5a57('0x3'));var moment=require(_0x5a57('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5a57('0x5'));var util=require(_0x5a57('0x6'));var path=require(_0x5a57('0x7'));var sox=require(_0x5a57('0x8'));var csv=require(_0x5a57('0x9'));var ejs=require(_0x5a57('0xa'));var fs=require('fs');var fs_extra=require(_0x5a57('0xb'));var _=require(_0x5a57('0xc'));var squel=require(_0x5a57('0xd'));var crypto=require(_0x5a57('0xe'));var jsforce=require(_0x5a57('0xf'));var deskjs=require(_0x5a57('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5a57('0x11'));var Papa=require(_0x5a57('0x12'));var Redis=require(_0x5a57('0x13'));var authService=require(_0x5a57('0x14'));var qs=require(_0x5a57('0x15'));var as=require(_0x5a57('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5a57('0x17'))(_0x5a57('0x18'));var utils=require('../../config/utils');var config=require(_0x5a57('0x19'));var licenseUtil=require(_0x5a57('0x1a'));var db=require(_0x5a57('0x1b'))['db'];var integrations=require(_0x5a57('0x1c'));function respondWithStatusCode(_0x3fadae,_0x4f8297){_0x4f8297=_0x4f8297||0xcc;return function(_0x290759){if(_0x290759){return _0x3fadae['sendStatus'](_0x4f8297);}return _0x3fadae['status'](_0x4f8297)[_0x5a57('0x1d')]();};}function respondWithResult(_0x4a348b,_0xeb369f){_0xeb369f=_0xeb369f||0xc8;return function(_0x2f7897){if(_0x2f7897){return _0x4a348b['status'](_0xeb369f)[_0x5a57('0x1e')](_0x2f7897);}};}function respondWithFilteredResult(_0x18b808,_0x56c3f3){return function(_0x51fe3e){if(_0x51fe3e){var _0x96b8bb=typeof _0x56c3f3[_0x5a57('0x1f')]==='undefined'&&typeof _0x56c3f3[_0x5a57('0x20')]==='undefined';var _0x5a4ffe=_0x51fe3e[_0x5a57('0x21')];var _0xc04011=_0x96b8bb?0x0:_0x56c3f3[_0x5a57('0x1f')];var _0x18dc16=_0x96b8bb?_0x51fe3e[_0x5a57('0x21')]:_0x56c3f3['offset']+_0x56c3f3[_0x5a57('0x20')];var _0x83ae87;if(_0x18dc16>=_0x5a4ffe){_0x18dc16=_0x5a4ffe;_0x83ae87=0xc8;}else{_0x83ae87=0xce;}_0x18b808['status'](_0x83ae87);return _0x18b808['set'](_0x5a57('0x22'),_0xc04011+'-'+_0x18dc16+'/'+_0x5a4ffe)[_0x5a57('0x1e')](_0x51fe3e);}return null;};}function patchUpdates(_0x45859a){return function(_0x42ec81){try{jsonpatch['apply'](_0x42ec81,_0x45859a,!![]);}catch(_0x249b75){return BPromise[_0x5a57('0x23')](_0x249b75);}return _0x42ec81[_0x5a57('0x24')]();};}function saveUpdates(_0x574c04,_0x56ddf0){return function(_0x247a77){if(_0x247a77){return _0x247a77[_0x5a57('0x25')](_0x574c04)[_0x5a57('0x26')](function(_0x55beb8){return _0x55beb8;});}return null;};}function removeEntity(_0x5d89e4,_0xa94dbd){return function(_0x37f725){if(_0x37f725){return _0x37f725[_0x5a57('0x27')]()['then'](function(){_0x5d89e4['status'](0xcc)[_0x5a57('0x1d')]();});}};}function handleEntityNotFound(_0x563237,_0x4a766c){return function(_0x3baf99){if(!_0x3baf99){_0x563237[_0x5a57('0x28')](0x194);}return _0x3baf99;};}function handleError(_0x5da64b,_0x3065a2){_0x3065a2=_0x3065a2||0x1f4;return function(_0x1314ec){logger[_0x5a57('0x29')](_0x1314ec[_0x5a57('0x2a')]);if(_0x1314ec['name']){delete _0x1314ec[_0x5a57('0x2b')];}_0x5da64b[_0x5a57('0x2c')](_0x3065a2)['send'](_0x1314ec);};}exports[_0x5a57('0x2d')]=function(_0x1f521a,_0x46e7ac){var _0x3d59ec={},_0x1bc0b2={},_0x2b68e0={'count':0x0,'rows':[]};var _0x278093=_['map'](db['SalesforceAccount'][_0x5a57('0x2e')],function(_0x19b497){return{'name':_0x19b497[_0x5a57('0x2f')],'type':_0x19b497[_0x5a57('0x30')][_0x5a57('0x31')]};});_0x1bc0b2['model']=_['map'](_0x278093,_0x5a57('0x2b'));_0x1bc0b2['query']=_[_0x5a57('0x32')](_0x1f521a[_0x5a57('0x33')]);_0x1bc0b2[_0x5a57('0x34')]=_[_0x5a57('0x35')](_0x1bc0b2['model'],_0x1bc0b2[_0x5a57('0x33')]);_0x3d59ec[_0x5a57('0x36')]=_[_0x5a57('0x35')](_0x1bc0b2['model'],qs[_0x5a57('0x37')](_0x1f521a[_0x5a57('0x33')][_0x5a57('0x37')]));_0x3d59ec[_0x5a57('0x36')]=_0x3d59ec[_0x5a57('0x36')]['length']?_0x3d59ec['attributes']:_0x1bc0b2[_0x5a57('0x38')];if(!_0x1f521a['query'][_0x5a57('0x39')](_0x5a57('0x3a'))){_0x3d59ec[_0x5a57('0x20')]=qs[_0x5a57('0x20')](_0x1f521a[_0x5a57('0x33')][_0x5a57('0x20')]);_0x3d59ec[_0x5a57('0x1f')]=qs['offset'](_0x1f521a['query'][_0x5a57('0x1f')]);}_0x3d59ec[_0x5a57('0x3b')]=qs[_0x5a57('0x3c')](_0x1f521a[_0x5a57('0x33')][_0x5a57('0x3c')]);_0x3d59ec[_0x5a57('0x3d')]=qs[_0x5a57('0x34')](_[_0x5a57('0x3e')](_0x1f521a[_0x5a57('0x33')],_0x1bc0b2[_0x5a57('0x34')]),_0x278093);if(_0x1f521a[_0x5a57('0x33')][_0x5a57('0x3f')]){_0x3d59ec['where']=_['merge'](_0x3d59ec[_0x5a57('0x3d')],{'$or':_[_0x5a57('0x40')](_0x278093,function(_0x29eeb6){if(_0x29eeb6[_0x5a57('0x30')]!=='VIRTUAL'){var _0xa1079b={};_0xa1079b[_0x29eeb6['name']]={'$like':'%'+_0x1f521a[_0x5a57('0x33')]['filter']+'%'};return _0xa1079b;}})});}_0x3d59ec=_['merge']({},_0x3d59ec,_0x1f521a['options']);var _0x165c7a={'where':_0x3d59ec[_0x5a57('0x3d')]};return db['SalesforceAccount'][_0x5a57('0x21')](_0x165c7a)[_0x5a57('0x26')](function(_0x47f32a){_0x2b68e0[_0x5a57('0x21')]=_0x47f32a;if(_0x1f521a[_0x5a57('0x33')][_0x5a57('0x41')]){_0x3d59ec[_0x5a57('0x42')]=[{'all':!![]}];}return db[_0x5a57('0x43')][_0x5a57('0x44')](_0x3d59ec);})['then'](function(_0x364766){_0x2b68e0[_0x5a57('0x45')]=_0x364766;return _0x2b68e0;})[_0x5a57('0x26')](respondWithFilteredResult(_0x46e7ac,_0x3d59ec))[_0x5a57('0x46')](handleError(_0x46e7ac,null));};exports[_0x5a57('0x47')]=function(_0x3bd441,_0x4fa062){var _0xc46931={'raw':![],'where':{'id':_0x3bd441['params']['id']}},_0x3f38bf={};_0x3f38bf['model']=_[_0x5a57('0x32')](db['SalesforceAccount'][_0x5a57('0x2e')]);_0x3f38bf[_0x5a57('0x33')]=_[_0x5a57('0x32')](_0x3bd441[_0x5a57('0x33')]);_0x3f38bf['filters']=_[_0x5a57('0x35')](_0x3f38bf[_0x5a57('0x38')],_0x3f38bf[_0x5a57('0x33')]);_0xc46931[_0x5a57('0x36')]=_[_0x5a57('0x35')](_0x3f38bf['model'],qs[_0x5a57('0x37')](_0x3bd441[_0x5a57('0x33')][_0x5a57('0x37')]));_0xc46931[_0x5a57('0x36')]=_0xc46931[_0x5a57('0x36')][_0x5a57('0x48')]?_0xc46931[_0x5a57('0x36')]:_0x3f38bf[_0x5a57('0x38')];if(_0x3bd441['query']['includeAll']){_0xc46931[_0x5a57('0x42')]=[{'all':!![]}];}_0xc46931=_[_0x5a57('0x49')]({},_0xc46931,_0x3bd441[_0x5a57('0x4a')]);return db[_0x5a57('0x43')]['find'](_0xc46931)[_0x5a57('0x26')](handleEntityNotFound(_0x4fa062,null))['then'](respondWithResult(_0x4fa062,null))[_0x5a57('0x46')](handleError(_0x4fa062,null));};exports[_0x5a57('0x4b')]=function(_0x1b538f,_0x3a5e3e){return db[_0x5a57('0x43')][_0x5a57('0x4b')](_0x1b538f[_0x5a57('0x4c')],{})[_0x5a57('0x26')](respondWithResult(_0x3a5e3e,0xc9))[_0x5a57('0x46')](handleError(_0x3a5e3e,null));};exports['update']=function(_0x100f3f,_0x5f35ba){if(_0x100f3f[_0x5a57('0x4c')]['id']){delete _0x100f3f['body']['id'];}return db['SalesforceAccount'][_0x5a57('0x4d')]({'where':{'id':_0x100f3f[_0x5a57('0x4e')]['id']}})[_0x5a57('0x26')](handleEntityNotFound(_0x5f35ba,null))[_0x5a57('0x26')](saveUpdates(_0x100f3f[_0x5a57('0x4c')],null))['then'](respondWithResult(_0x5f35ba,null))['catch'](handleError(_0x5f35ba,null));};exports[_0x5a57('0x27')]=function(_0xb73aa6,_0x48c0ed){return db[_0x5a57('0x43')][_0x5a57('0x4d')]({'where':{'id':_0xb73aa6['params']['id']}})[_0x5a57('0x26')](handleEntityNotFound(_0x48c0ed,null))[_0x5a57('0x26')](removeEntity(_0x48c0ed,null))[_0x5a57('0x46')](handleError(_0x48c0ed,null));};exports[_0x5a57('0x4f')]=function(_0x162366,_0x22a516,_0x4ab537){var _0x3a7426={};var _0x33c8d5={};var _0x2979f6;var _0x27a296;return db[_0x5a57('0x43')][_0x5a57('0x50')]({'where':{'id':_0x162366[_0x5a57('0x4e')]['id']}})[_0x5a57('0x26')](handleEntityNotFound(_0x22a516,null))[_0x5a57('0x26')](function(_0x38a5f3){if(_0x38a5f3){_0x2979f6=_0x38a5f3;_0x33c8d5[_0x5a57('0x38')]=_[_0x5a57('0x32')](db[_0x5a57('0x51')][_0x5a57('0x2e')]);_0x33c8d5['query']=_[_0x5a57('0x32')](_0x162366['query']);_0x33c8d5['filters']=_[_0x5a57('0x35')](_0x33c8d5[_0x5a57('0x38')],_0x33c8d5['query']);_0x3a7426[_0x5a57('0x36')]=_['intersection'](_0x33c8d5[_0x5a57('0x38')],qs[_0x5a57('0x37')](_0x162366[_0x5a57('0x33')][_0x5a57('0x37')]));_0x3a7426[_0x5a57('0x36')]=_0x3a7426['attributes'][_0x5a57('0x48')]?_0x3a7426[_0x5a57('0x36')]:_0x33c8d5[_0x5a57('0x38')];_0x3a7426[_0x5a57('0x3b')]=qs[_0x5a57('0x3c')](_0x162366['query'][_0x5a57('0x3c')]);_0x3a7426[_0x5a57('0x3d')]=qs['filters'](_[_0x5a57('0x3e')](_0x162366[_0x5a57('0x33')],_0x33c8d5[_0x5a57('0x34')]));if(_0x162366[_0x5a57('0x33')][_0x5a57('0x3f')]){_0x3a7426['where']=_['merge'](_0x3a7426[_0x5a57('0x3d')],{'$or':_[_0x5a57('0x40')](_0x3a7426[_0x5a57('0x36')],function(_0x15f58f){var _0x456293={};_0x456293[_0x15f58f]={'$like':'%'+_0x162366[_0x5a57('0x33')][_0x5a57('0x3f')]+'%'};return _0x456293;})});}_0x3a7426=_[_0x5a57('0x49')]({},_0x3a7426,_0x162366[_0x5a57('0x4a')]);return _0x2979f6['getConfigurations'](_0x3a7426);}})[_0x5a57('0x26')](function(_0x552fd1){if(_0x552fd1){_0x27a296=_0x552fd1['length'];if(!_0x162366[_0x5a57('0x33')]['hasOwnProperty'](_0x5a57('0x3a'))){_0x3a7426[_0x5a57('0x20')]=qs['limit'](_0x162366[_0x5a57('0x33')][_0x5a57('0x20')]);_0x3a7426[_0x5a57('0x1f')]=qs[_0x5a57('0x1f')](_0x162366['query'][_0x5a57('0x1f')]);}return _0x2979f6['getConfigurations'](_0x3a7426);}})[_0x5a57('0x26')](function(_0x52fe65){if(_0x52fe65){return _0x52fe65?{'count':_0x27a296,'rows':_0x52fe65}:null;}})['then'](respondWithResult(_0x22a516,null))[_0x5a57('0x46')](handleError(_0x22a516,null));};exports[_0x5a57('0x52')]=function(_0x3be7c8,_0x1b9e41,_0x529ba0){if(_0x3be7c8[_0x5a57('0x4c')]['id']){delete _0x3be7c8['body']['id'];}return db[_0x5a57('0x43')][_0x5a57('0x50')]({'where':{'id':_0x3be7c8['params']['id']}})[_0x5a57('0x26')](handleEntityNotFound(_0x1b9e41,null))[_0x5a57('0x26')](function(_0x52bf89){if(_0x52bf89){_0x3be7c8['body']['AccountId']=_0x52bf89['id'];_0x3be7c8[_0x5a57('0x4c')]['Subjects']=integrations[_0x5a57('0x53')](_0x3be7c8[_0x5a57('0x4c')][_0x5a57('0x54')],_0x3be7c8[_0x5a57('0x4c')][_0x5a57('0x30')]);_0x3be7c8[_0x5a57('0x4c')][_0x5a57('0x55')]=integrations['getDescriptions'](_0x3be7c8['body'][_0x5a57('0x54')],_0x3be7c8[_0x5a57('0x4c')][_0x5a57('0x30')]);return db[_0x5a57('0x51')][_0x5a57('0x4b')](_0x3be7c8['body'],{'include':[{'model':db[_0x5a57('0x56')],'as':_0x5a57('0x57')},{'model':db['SalesforceField'],'as':_0x5a57('0x55')}]});}return null;})[_0x5a57('0x26')](respondWithResult(_0x1b9e41,null))[_0x5a57('0x46')](handleError(_0x1b9e41,null));};exports[_0x5a57('0x58')]=function(_0x56c422,_0x5c43a7,_0x14f17b){var _0x118415;var _0x20588b='';var _0x117132='Task';return db[_0x5a57('0x43')]['findOne']({'where':{'id':_0x56c422[_0x5a57('0x4e')]['id']},'attributes':['id',_0x5a57('0x59'),'clientId','clientSecret',_0x5a57('0x5a'),_0x5a57('0x5b'),_0x5a57('0x5c')]})[_0x5a57('0x26')](handleEntityNotFound(_0x5c43a7,null))[_0x5a57('0x26')](function(_0x137e94){if(_0x137e94){_0x20588b=_0x137e94[_0x5a57('0x59')];var _0xe3f381=_0x20588b[_0x5a57('0x5d')](-0x1);if(_0xe3f381==='/'){_0x20588b=_0x20588b['substring'](0x0,_0x20588b[_0x5a57('0x5e')](_0xe3f381));}_0x118415=new jsforce['Connection']({'oauth2':{'loginUrl':_0x20588b,'clientId':_0x137e94[_0x5a57('0x5f')],'clientSecret':_0x137e94[_0x5a57('0x60')]}});return _0x118415['login'](_0x137e94['username'],_0x137e94[_0x5a57('0x5b')][_0x5a57('0x61')](_0x137e94[_0x5a57('0x5c')]));}})[_0x5a57('0x26')](function(_0x54e526){if(_0x54e526){if(!_[_0x5a57('0x62')](_0x56c422['query']['ticketType'])){_0x117132=_0x56c422[_0x5a57('0x33')][_0x5a57('0x63')];}return _0x118415[_0x5a57('0x64')](_0x117132)['describe']();}})['then'](function(_0x454157){var _0x276ade=[_0x5a57('0x65'),'ActivityDate',_0x5a57('0x66'),_0x5a57('0x67'),_0x5a57('0x68'),'Description'];var _0x375e55=[_0x5a57('0x69'),_0x5a57('0x6a'),'picklist',_0x5a57('0x6b'),'email',_0x5a57('0x6c'),_0x5a57('0x6d')];if(_0x454157){_[_0x5a57('0x6e')](_0x454157['fields'],function(_0x620da5){return _0x276ade[_0x5a57('0x6f')](_0x620da5[_0x5a57('0x2b')])||!_0x375e55[_0x5a57('0x6f')](_0x620da5[_0x5a57('0x30')]);});return{'count':_0x454157[_0x5a57('0x37')][_0x5a57('0x48')],'rows':_[_0x5a57('0x40')](_0x454157[_0x5a57('0x37')],function(_0x24fda8){return{'id':_0x24fda8[_0x5a57('0x2b')],'name':_0x24fda8[_0x5a57('0x70')],'custom':_0x24fda8[_0x5a57('0x71')],'options':_0x24fda8[_0x5a57('0x72')][_0x5a57('0x48')]>0x0?_[_0x5a57('0x40')](_0x24fda8[_0x5a57('0x72')],function(_0x396794){return{'name':_0x396794[_0x5a57('0x70')],'value':_0x396794['value']};}):_0x24fda8[_0x5a57('0x30')]==_0x5a57('0x6b')?[{'name':'True','value':_0x5a57('0x73')},{'name':_0x5a57('0x74'),'value':'false'}]:[]};})};}})[_0x5a57('0x26')](respondWithResult(_0x5c43a7,null))['catch'](function(_0x1a0dc7){var _0x352b95=_0x56c422[_0x5a57('0x33')][_0x5a57('0x75')]?0x1f4:_0x1a0dc7[_0x5a57('0x76')]||0x1f4;logger[_0x5a57('0x29')](_0x5a57('0x77'),_0x5a57('0x58'),_0x352b95,JSON['stringify'](_0x1a0dc7));delete _0x1a0dc7[_0x5a57('0x2b')];if(_0x352b95===0x191){_0x352b95=0x190;}_0x5c43a7[_0x5a57('0x2c')](_0x352b95)[_0x5a57('0x78')](_0x56c422['query'][_0x5a57('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x1a0dc7[_0x5a57('0x76')]}:_0x1a0dc7);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index b700361..a5a138c 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.model.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cba=['rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x6ef61b,_0x415a0d){var _0x3beb7c=function(_0x51ca01){while(--_0x51ca01){_0x6ef61b['push'](_0x6ef61b['shift']());}};_0x3beb7c(++_0x415a0d);}(_0x6cba,0x17c));var _0xa6cb=function(_0x3f92f5,_0xdffb56){_0x3f92f5=_0x3f92f5-0x0;var _0x54aea6=_0x6cba[_0x3f92f5];return _0x54aea6;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa6cb('0x0'));var config=require(_0xa6cb('0x1'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xa6cb('0x2'));module[_0xa6cb('0x3')]=function(_0x891bca,_0x4b955e){return _0x891bca[_0xa6cb('0x4')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x493d=['bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','util','api','moment'];(function(_0x55a507,_0x511661){var _0x2a9d7f=function(_0x3e8c99){while(--_0x3e8c99){_0x55a507['push'](_0x55a507['shift']());}};_0x2a9d7f(++_0x511661);}(_0x493d,0xcd));var _0xd493=function(_0x5d5ea8,_0x24952a){_0x5d5ea8=_0x5d5ea8-0x0;var _0x553c87=_0x493d[_0x5d5ea8];return _0x553c87;};'use strict';var _=require('lodash');var util=require(_0xd493('0x0'));var logger=require('../../config/logger')(_0xd493('0x1'));var moment=require(_0xd493('0x2'));var BPromise=require(_0xd493('0x3'));var rp=require(_0xd493('0x4'));var fs=require('fs');var path=require(_0xd493('0x5'));var rimraf=require(_0xd493('0x6'));var config=require(_0xd493('0x7'));var attributes=require(_0xd493('0x8'));var integrations=require(_0xd493('0x9'));module['exports']=function(_0x2ed96a,_0x2c5984){return _0x2ed96a[_0xd493('0xa')](_0xd493('0xb'),attributes,{'tableName':_0xd493('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 739dab6..f7f6fcd 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98f0=['error','message','result','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','limit','include','map','model','info','stringify','ShowSalesforceAccount','find','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','then','request\x20sent','SalesforceAccount,\x20%s,\x20%s'];(function(_0x5e6cb8,_0x1d1eb5){var _0x41754f=function(_0x5ef4ef){while(--_0x5ef4ef){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x41754f(++_0x1d1eb5);}(_0x98f0,0xdd));var _0x098f=function(_0xc75028,_0x1ec537){_0xc75028=_0xc75028-0x0;var _0x2e553c=_0x98f0[_0xc75028];return _0x2e553c;};'use strict';var _=require('lodash');var util=require(_0x098f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x098f('0x1'));var fs=require('fs');var Redis=require(_0x098f('0x2'));var db=require(_0x098f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x098f('0x4'))('rpc');var config=require(_0x098f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x098f('0x6')][_0x098f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5b9fe5,_0x38a038,_0x6ec221){return new BPromise(function(_0x4ab493,_0xd788b0){return client['request'](_0x5b9fe5,_0x6ec221)[_0x098f('0x8')](function(_0x3d806a){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x38a038,_0x098f('0x9'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x38a038,'request\x20sent',JSON['stringify'](_0x3d806a));if(_0x3d806a['error']){if(_0x3d806a['error']['code']===0x1f4){logger['error'](_0x098f('0xa'),_0x38a038,_0x3d806a[_0x098f('0xb')][_0x098f('0xc')]);return _0xd788b0(_0x3d806a['error'][_0x098f('0xc')]);}logger[_0x098f('0xb')]('SalesforceAccount,\x20%s,\x20%s',_0x38a038,_0x3d806a['error'][_0x098f('0xc')]);return _0x4ab493(_0x3d806a[_0x098f('0xb')][_0x098f('0xc')]);}else{logger['info'](_0x098f('0xa'),_0x38a038,_0x098f('0x9'));_0x4ab493(_0x3d806a[_0x098f('0xd')][_0x098f('0xc')]);}})[_0x098f('0xe')](function(_0x37a9f5){logger[_0x098f('0xb')](_0x098f('0xa'),_0x38a038,_0x37a9f5);_0xd788b0(_0x37a9f5);});});}exports[_0x098f('0xf')]=function(_0x194feb){var _0x21ca24=this;return new Promise(function(_0x49de2a,_0x19eefd){return db[_0x098f('0x10')]['findAll']({'raw':_0x194feb[_0x098f('0x11')]?_0x194feb[_0x098f('0x11')][_0x098f('0x12')]===undefined?!![]:![]:!![],'where':_0x194feb[_0x098f('0x11')]?_0x194feb['options'][_0x098f('0x13')]||null:null,'attributes':_0x194feb[_0x098f('0x11')]?_0x194feb[_0x098f('0x11')][_0x098f('0x14')]||null:null,'limit':_0x194feb[_0x098f('0x11')]?_0x194feb[_0x098f('0x11')][_0x098f('0x15')]||null:null,'include':_0x194feb[_0x098f('0x11')]?_0x194feb['options'][_0x098f('0x16')]?_[_0x098f('0x17')](_0x194feb[_0x098f('0x11')][_0x098f('0x16')],function(_0x2d0ee4){return{'model':db[_0x2d0ee4[_0x098f('0x18')]],'as':_0x2d0ee4['as'],'attributes':_0x2d0ee4[_0x098f('0x14')],'include':_0x2d0ee4['include']?_[_0x098f('0x17')](_0x2d0ee4[_0x098f('0x16')],function(_0x52a8c6){return{'model':db[_0x52a8c6['model']],'as':_0x52a8c6['as'],'attributes':_0x52a8c6[_0x098f('0x14')],'include':_0x52a8c6['include']?_['map'](_0x52a8c6[_0x098f('0x16')],function(_0x283f58){return{'model':db[_0x283f58[_0x098f('0x18')]],'as':_0x283f58['as'],'attributes':_0x283f58['attributes']};}):[]};}):[]};}):[]:[]})[_0x098f('0x8')](function(_0xf3ade6){logger[_0x098f('0x19')]('GetSalesforceAccount',_0x194feb);logger['debug']('GetSalesforceAccount',_0x194feb,JSON[_0x098f('0x1a')](_0xf3ade6));_0x49de2a(_0xf3ade6);})[_0x098f('0xe')](function(_0x1ef11e){logger[_0x098f('0xb')](_0x098f('0xf'),_0x1ef11e[_0x098f('0xc')],_0x194feb);_0x19eefd(_0x21ca24[_0x098f('0xb')](0x1f4,_0x1ef11e[_0x098f('0xc')]));});});};exports[_0x098f('0x1b')]=function(_0x4cb19c){var _0x635c63=this;return new Promise(function(_0x10c960,_0x1e260f){return db[_0x098f('0x10')][_0x098f('0x1c')]({'raw':_0x4cb19c[_0x098f('0x11')]?_0x4cb19c['options']['raw']===undefined?!![]:![]:!![],'where':_0x4cb19c[_0x098f('0x11')]?_0x4cb19c[_0x098f('0x11')][_0x098f('0x13')]||null:null,'attributes':_0x4cb19c[_0x098f('0x11')]?_0x4cb19c['options'][_0x098f('0x14')]||null:null,'include':_0x4cb19c[_0x098f('0x11')]?_0x4cb19c[_0x098f('0x11')][_0x098f('0x16')]?_[_0x098f('0x17')](_0x4cb19c[_0x098f('0x11')]['include'],function(_0x4f7005){return{'model':db[_0x4f7005['model']],'as':_0x4f7005['as'],'attributes':_0x4f7005['attributes'],'include':_0x4f7005[_0x098f('0x16')]?_[_0x098f('0x17')](_0x4f7005[_0x098f('0x16')],function(_0x13afcb){return{'model':db[_0x13afcb['model']],'as':_0x13afcb['as'],'attributes':_0x13afcb['attributes'],'include':_0x13afcb[_0x098f('0x16')]?_['map'](_0x13afcb[_0x098f('0x16')],function(_0x274579){return{'model':db[_0x274579[_0x098f('0x18')]],'as':_0x274579['as'],'attributes':_0x274579[_0x098f('0x14')]};}):[]};}):[]};}):[]:[]})[_0x098f('0x8')](function(_0x214f58){logger['info'](_0x098f('0x1b'),_0x4cb19c);logger['debug']('ShowSalesforceAccount',_0x4cb19c,JSON[_0x098f('0x1a')](_0x214f58));_0x10c960(_0x214f58);})['catch'](function(_0x45315a){logger['error'](_0x098f('0x1b'),_0x45315a[_0x098f('0xc')],_0x4cb19c);_0x1e260f(_0x635c63['error'](0x1f4,_0x45315a[_0x098f('0xc')]));});});}; \ No newline at end of file +var _0xd965=['options','where','limit','include','map','model','attributes','GetSalesforceAccount','find','raw','ShowSalesforceAccount','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','request','then','info','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SalesforceAccount,\x20%s,\x20%s','result','catch','SalesforceAccount'];(function(_0x170f4c,_0x4a4c80){var _0x52eedd=function(_0x473905){while(--_0x473905){_0x170f4c['push'](_0x170f4c['shift']());}};_0x52eedd(++_0x4a4c80);}(_0xd965,0x1cb));var _0x5d96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd965[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5d96('0x0'));var util=require('util');var moment=require(_0x5d96('0x1'));var BPromise=require('bluebird');var rs=require(_0x5d96('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d96('0x3'))['db'];var utils=require(_0x5d96('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x5d96('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x5d96('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb93a4f,_0x24c8c8,_0x2f6614){return new BPromise(function(_0x4aec55,_0x3d3a4e){return client[_0x5d96('0x7')](_0xb93a4f,_0x2f6614)[_0x5d96('0x8')](function(_0x24b98b){logger[_0x5d96('0x9')]('SalesforceAccount,\x20%s,\x20%s',_0x24c8c8,'request\x20sent');logger[_0x5d96('0xa')](_0x5d96('0xb'),_0x24c8c8,_0x5d96('0xc'),JSON[_0x5d96('0xd')](_0x24b98b));if(_0x24b98b[_0x5d96('0xe')]){if(_0x24b98b['error'][_0x5d96('0xf')]===0x1f4){logger[_0x5d96('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x24c8c8,_0x24b98b['error']['message']);return _0x3d3a4e(_0x24b98b[_0x5d96('0xe')][_0x5d96('0x10')]);}logger[_0x5d96('0xe')](_0x5d96('0x11'),_0x24c8c8,_0x24b98b['error'][_0x5d96('0x10')]);return _0x4aec55(_0x24b98b[_0x5d96('0xe')][_0x5d96('0x10')]);}else{logger[_0x5d96('0x9')]('SalesforceAccount,\x20%s,\x20%s',_0x24c8c8,_0x5d96('0xc'));_0x4aec55(_0x24b98b[_0x5d96('0x12')]['message']);}})[_0x5d96('0x13')](function(_0x5d6ea6){logger['error'](_0x5d96('0x11'),_0x24c8c8,_0x5d6ea6);_0x3d3a4e(_0x5d6ea6);});});}exports['GetSalesforceAccount']=function(_0x48d0e0){var _0x6f610b=this;return new Promise(function(_0x24f06a,_0x19f120){return db[_0x5d96('0x14')]['findAll']({'raw':_0x48d0e0[_0x5d96('0x15')]?_0x48d0e0['options']['raw']===undefined?!![]:![]:!![],'where':_0x48d0e0[_0x5d96('0x15')]?_0x48d0e0[_0x5d96('0x15')][_0x5d96('0x16')]||null:null,'attributes':_0x48d0e0[_0x5d96('0x15')]?_0x48d0e0[_0x5d96('0x15')]['attributes']||null:null,'limit':_0x48d0e0['options']?_0x48d0e0[_0x5d96('0x15')][_0x5d96('0x17')]||null:null,'include':_0x48d0e0[_0x5d96('0x15')]?_0x48d0e0[_0x5d96('0x15')][_0x5d96('0x18')]?_[_0x5d96('0x19')](_0x48d0e0['options']['include'],function(_0x1715c9){return{'model':db[_0x1715c9[_0x5d96('0x1a')]],'as':_0x1715c9['as'],'attributes':_0x1715c9[_0x5d96('0x1b')],'include':_0x1715c9[_0x5d96('0x18')]?_[_0x5d96('0x19')](_0x1715c9[_0x5d96('0x18')],function(_0x115fd9){return{'model':db[_0x115fd9[_0x5d96('0x1a')]],'as':_0x115fd9['as'],'attributes':_0x115fd9[_0x5d96('0x1b')],'include':_0x115fd9['include']?_[_0x5d96('0x19')](_0x115fd9[_0x5d96('0x18')],function(_0x5ab984){return{'model':db[_0x5ab984['model']],'as':_0x5ab984['as'],'attributes':_0x5ab984[_0x5d96('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4faf21){logger[_0x5d96('0x9')](_0x5d96('0x1c'),_0x48d0e0);logger[_0x5d96('0xa')](_0x5d96('0x1c'),_0x48d0e0,JSON['stringify'](_0x4faf21));_0x24f06a(_0x4faf21);})[_0x5d96('0x13')](function(_0xdfc78d){logger['error']('GetSalesforceAccount',_0xdfc78d[_0x5d96('0x10')],_0x48d0e0);_0x19f120(_0x6f610b['error'](0x1f4,_0xdfc78d[_0x5d96('0x10')]));});});};exports['ShowSalesforceAccount']=function(_0x1a47df){var _0x200b6a=this;return new Promise(function(_0x4eca42,_0x333e6f){return db['SalesforceAccount'][_0x5d96('0x1d')]({'raw':_0x1a47df[_0x5d96('0x15')]?_0x1a47df[_0x5d96('0x15')][_0x5d96('0x1e')]===undefined?!![]:![]:!![],'where':_0x1a47df[_0x5d96('0x15')]?_0x1a47df[_0x5d96('0x15')]['where']||null:null,'attributes':_0x1a47df[_0x5d96('0x15')]?_0x1a47df['options'][_0x5d96('0x1b')]||null:null,'include':_0x1a47df[_0x5d96('0x15')]?_0x1a47df[_0x5d96('0x15')][_0x5d96('0x18')]?_['map'](_0x1a47df[_0x5d96('0x15')][_0x5d96('0x18')],function(_0x365f83){return{'model':db[_0x365f83[_0x5d96('0x1a')]],'as':_0x365f83['as'],'attributes':_0x365f83['attributes'],'include':_0x365f83['include']?_[_0x5d96('0x19')](_0x365f83[_0x5d96('0x18')],function(_0x1f68cd){return{'model':db[_0x1f68cd[_0x5d96('0x1a')]],'as':_0x1f68cd['as'],'attributes':_0x1f68cd[_0x5d96('0x1b')],'include':_0x1f68cd[_0x5d96('0x18')]?_[_0x5d96('0x19')](_0x1f68cd[_0x5d96('0x18')],function(_0x37f2e0){return{'model':db[_0x37f2e0[_0x5d96('0x1a')]],'as':_0x37f2e0['as'],'attributes':_0x37f2e0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xb152f2){logger[_0x5d96('0x9')]('ShowSalesforceAccount',_0x1a47df);logger['debug'](_0x5d96('0x1f'),_0x1a47df,JSON[_0x5d96('0xd')](_0xb152f2));_0x4eca42(_0xb152f2);})[_0x5d96('0x13')](function(_0x1e04d6){logger[_0x5d96('0xe')](_0x5d96('0x1f'),_0x1e04d6['message'],_0x1a47df);_0x333e6f(_0x200b6a[_0x5d96('0xe')](0x1f4,_0x1e04d6[_0x5d96('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 591612b..b1ec11b 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','exports','util','path','connect-timeout'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2032,0xd9));var _0x2203=function(_0x2db31b,_0x3841e7){_0x2db31b=_0x2db31b-0x0;var _0xf290b3=_0x2032[_0x2db31b];return _0xf290b3;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2203('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2203('0x13')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xdb28,0x106));var _0x8db2=function(_0x32670f,_0x3347c5){_0x32670f=_0x32670f-0x0;var _0x28954b=_0xdb28[_0x32670f];return _0x28954b;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 7464e6a..cf99852 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x304d=['nothing','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','lead','account_contact_lead','account'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0x304d,0xd2));var _0xd304=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x304d[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xd304('0x0'));module[_0xd304('0x1')]={'name':{'type':Sequelize[_0xd304('0x2')]},'description':{'type':Sequelize[_0xd304('0x2')]},'ticketType':{'type':Sequelize[_0xd304('0x3')](_0xd304('0x4'),_0xd304('0x5')),'defaultValue':_0xd304('0x4')},'moduleSearch':{'type':Sequelize[_0xd304('0x3')](_0xd304('0x6'),'contact',_0xd304('0x7'),_0xd304('0x8'),_0xd304('0x9')),'defaultValue':_0xd304('0x6')},'moduleCreate':{'type':Sequelize[_0xd304('0x3')](_0xd304('0xa'),'contact',_0xd304('0x7'),_0xd304('0x9')),'defaultValue':_0xd304('0x7')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xd304('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xd304('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3086=['contact_lead','lead','account','nothing','contact','sequelize','exports','STRING','Case','ENUM'];(function(_0x540a06,_0x27b728){var _0x46d997=function(_0x2c31d4){while(--_0x2c31d4){_0x540a06['push'](_0x540a06['shift']());}};_0x46d997(++_0x27b728);}(_0x3086,0x1d1));var _0x6308=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x3086[_0x487b0c];return _0x1adbdc;};'use strict';var Sequelize=require(_0x6308('0x0'));module[_0x6308('0x1')]={'name':{'type':Sequelize[_0x6308('0x2')]},'description':{'type':Sequelize[_0x6308('0x2')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0x6308('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x6308('0x4')](_0x6308('0x5'),'contact',_0x6308('0x6'),'account_contact_lead',_0x6308('0x7')),'defaultValue':_0x6308('0x5')},'moduleCreate':{'type':Sequelize[_0x6308('0x4')](_0x6308('0x8'),_0x6308('0x9'),_0x6308('0x6'),_0x6308('0x7')),'defaultValue':_0x6308('0x6')},'leadId':{'type':Sequelize[_0x6308('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x6308('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x6308('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x6308('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 7581a64..6cef5ae 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x37de=['filters','intersection','fields','query','attributes','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getFields','findOne','getSubjects','SalesforceField','pick','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','keys'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x37de,0x10f));var _0xe37d=function(_0x263cb4,_0x53ce57){_0x263cb4=_0x263cb4-0x0;var _0x32a04b=_0x37de[_0x263cb4];return _0x32a04b;};'use strict';var emlformat=require(_0xe37d('0x0'));var rimraf=require(_0xe37d('0x1'));var zipdir=require(_0xe37d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe37d('0x3'));var moment=require(_0xe37d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe37d('0x5'));var util=require('util');var path=require(_0xe37d('0x6'));var sox=require(_0xe37d('0x7'));var csv=require(_0xe37d('0x8'));var ejs=require(_0xe37d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe37d('0xa'));var crypto=require(_0xe37d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe37d('0xc'));var toCsv=require(_0xe37d('0x8'));var querystring=require(_0xe37d('0xd'));var Papa=require(_0xe37d('0xe'));var Redis=require(_0xe37d('0xf'));var authService=require(_0xe37d('0x10'));var qs=require(_0xe37d('0x11'));var as=require(_0xe37d('0x12'));var hardwareService=require(_0xe37d('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xe37d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe37d('0x15'));var db=require(_0xe37d('0x16'))['db'];function respondWithStatusCode(_0x262cca,_0x184120){_0x184120=_0x184120||0xcc;return function(_0x5dee3c){if(_0x5dee3c){return _0x262cca['sendStatus'](_0x184120);}return _0x262cca[_0xe37d('0x17')](_0x184120)['end']();};}function respondWithResult(_0x21b22a,_0x551811){_0x551811=_0x551811||0xc8;return function(_0x2e5304){if(_0x2e5304){return _0x21b22a[_0xe37d('0x17')](_0x551811)[_0xe37d('0x18')](_0x2e5304);}};}function respondWithFilteredResult(_0x16b925,_0x41584f){return function(_0x2e2728){if(_0x2e2728){var _0x1bff73=typeof _0x41584f[_0xe37d('0x19')]==='undefined'&&typeof _0x41584f[_0xe37d('0x1a')]===_0xe37d('0x1b');var _0x44422c=_0x2e2728['count'];var _0x2dcb70=_0x1bff73?0x0:_0x41584f[_0xe37d('0x19')];var _0x1f8964=_0x1bff73?_0x2e2728[_0xe37d('0x1c')]:_0x41584f['offset']+_0x41584f[_0xe37d('0x1a')];var _0x28ae1e;if(_0x1f8964>=_0x44422c){_0x1f8964=_0x44422c;_0x28ae1e=0xc8;}else{_0x28ae1e=0xce;}_0x16b925[_0xe37d('0x17')](_0x28ae1e);return _0x16b925[_0xe37d('0x1d')](_0xe37d('0x1e'),_0x2dcb70+'-'+_0x1f8964+'/'+_0x44422c)['json'](_0x2e2728);}return null;};}function patchUpdates(_0x3be3ad){return function(_0x9adb81){try{jsonpatch[_0xe37d('0x1f')](_0x9adb81,_0x3be3ad,!![]);}catch(_0x5eac6f){return BPromise[_0xe37d('0x20')](_0x5eac6f);}return _0x9adb81['save']();};}function saveUpdates(_0x2744eb,_0x46e295){return function(_0x1f949a){if(_0x1f949a){return _0x1f949a[_0xe37d('0x21')](_0x2744eb)['then'](function(_0x90bb9d){return _0x90bb9d;});}return null;};}function removeEntity(_0xb17327,_0x15ef7e){return function(_0x41ea11){if(_0x41ea11){return _0x41ea11[_0xe37d('0x22')]()[_0xe37d('0x23')](function(){_0xb17327[_0xe37d('0x17')](0xcc)[_0xe37d('0x24')]();});}};}function handleEntityNotFound(_0x558bc3,_0x1e9276){return function(_0x2ae185){if(!_0x2ae185){_0x558bc3['sendStatus'](0x194);}return _0x2ae185;};}function handleError(_0x44381e,_0x6c86b2){_0x6c86b2=_0x6c86b2||0x1f4;return function(_0xec276c){logger[_0xe37d('0x25')](_0xec276c[_0xe37d('0x26')]);if(_0xec276c['name']){delete _0xec276c[_0xe37d('0x27')];}_0x44381e[_0xe37d('0x17')](_0x6c86b2)[_0xe37d('0x28')](_0xec276c);};}exports['index']=function(_0x47fe4f,_0x59fb45){var _0x54e0f6={},_0x435bca={},_0x3d051f={'count':0x0,'rows':[]};var _0x4372be=_[_0xe37d('0x29')](db[_0xe37d('0x2a')][_0xe37d('0x2b')],function(_0x14383f){return{'name':_0x14383f[_0xe37d('0x2c')],'type':_0x14383f[_0xe37d('0x2d')][_0xe37d('0x2e')]};});_0x435bca[_0xe37d('0x2f')]=_[_0xe37d('0x29')](_0x4372be,_0xe37d('0x27'));_0x435bca['query']=_[_0xe37d('0x30')](_0x47fe4f['query']);_0x435bca[_0xe37d('0x31')]=_[_0xe37d('0x32')](_0x435bca[_0xe37d('0x2f')],_0x435bca['query']);_0x54e0f6['attributes']=_['intersection'](_0x435bca['model'],qs[_0xe37d('0x33')](_0x47fe4f[_0xe37d('0x34')][_0xe37d('0x33')]));_0x54e0f6[_0xe37d('0x35')]=_0x54e0f6['attributes']['length']?_0x54e0f6[_0xe37d('0x35')]:_0x435bca[_0xe37d('0x2f')];if(!_0x47fe4f['query'][_0xe37d('0x36')](_0xe37d('0x37'))){_0x54e0f6[_0xe37d('0x1a')]=qs[_0xe37d('0x1a')](_0x47fe4f[_0xe37d('0x34')][_0xe37d('0x1a')]);_0x54e0f6[_0xe37d('0x19')]=qs[_0xe37d('0x19')](_0x47fe4f['query'][_0xe37d('0x19')]);}_0x54e0f6[_0xe37d('0x38')]=qs[_0xe37d('0x39')](_0x47fe4f[_0xe37d('0x34')][_0xe37d('0x39')]);_0x54e0f6['where']=qs['filters'](_['pick'](_0x47fe4f[_0xe37d('0x34')],_0x435bca[_0xe37d('0x31')]),_0x4372be);if(_0x47fe4f[_0xe37d('0x34')][_0xe37d('0x3a')]){_0x54e0f6[_0xe37d('0x3b')]=_['merge'](_0x54e0f6[_0xe37d('0x3b')],{'$or':_[_0xe37d('0x29')](_0x4372be,function(_0x3cc437){if(_0x3cc437[_0xe37d('0x2d')]!==_0xe37d('0x3c')){var _0x2f75ac={};_0x2f75ac[_0x3cc437['name']]={'$like':'%'+_0x47fe4f[_0xe37d('0x34')][_0xe37d('0x3a')]+'%'};return _0x2f75ac;}})});}_0x54e0f6=_[_0xe37d('0x3d')]({},_0x54e0f6,_0x47fe4f[_0xe37d('0x3e')]);var _0x2dd724={'where':_0x54e0f6[_0xe37d('0x3b')]};return db[_0xe37d('0x2a')][_0xe37d('0x1c')](_0x2dd724)['then'](function(_0x5a392e){_0x3d051f[_0xe37d('0x1c')]=_0x5a392e;if(_0x47fe4f[_0xe37d('0x34')][_0xe37d('0x3f')]){_0x54e0f6[_0xe37d('0x40')]=[{'all':!![]}];}return db[_0xe37d('0x2a')][_0xe37d('0x41')](_0x54e0f6);})['then'](function(_0x332557){_0x3d051f[_0xe37d('0x42')]=_0x332557;return _0x3d051f;})[_0xe37d('0x23')](respondWithFilteredResult(_0x59fb45,_0x54e0f6))[_0xe37d('0x43')](handleError(_0x59fb45,null));};exports[_0xe37d('0x44')]=function(_0x5c3772,_0xa68aea){var _0x3033c6={'raw':![],'where':{'id':_0x5c3772[_0xe37d('0x45')]['id']}},_0x22bb11={};_0x22bb11[_0xe37d('0x2f')]=_[_0xe37d('0x30')](db[_0xe37d('0x2a')]['rawAttributes']);_0x22bb11['query']=_[_0xe37d('0x30')](_0x5c3772['query']);_0x22bb11[_0xe37d('0x31')]=_[_0xe37d('0x32')](_0x22bb11['model'],_0x22bb11[_0xe37d('0x34')]);_0x3033c6[_0xe37d('0x35')]=_[_0xe37d('0x32')](_0x22bb11['model'],qs[_0xe37d('0x33')](_0x5c3772[_0xe37d('0x34')][_0xe37d('0x33')]));_0x3033c6[_0xe37d('0x35')]=_0x3033c6[_0xe37d('0x35')][_0xe37d('0x46')]?_0x3033c6[_0xe37d('0x35')]:_0x22bb11[_0xe37d('0x2f')];if(_0x5c3772[_0xe37d('0x34')][_0xe37d('0x3f')]){_0x3033c6[_0xe37d('0x40')]=[{'all':!![]}];}_0x3033c6=_['merge']({},_0x3033c6,_0x5c3772['options']);return db[_0xe37d('0x2a')][_0xe37d('0x47')](_0x3033c6)[_0xe37d('0x23')](handleEntityNotFound(_0xa68aea,null))['then'](respondWithResult(_0xa68aea,null))[_0xe37d('0x43')](handleError(_0xa68aea,null));};exports['create']=function(_0x449211,_0x1d8f8d){return db[_0xe37d('0x2a')][_0xe37d('0x48')](_0x449211[_0xe37d('0x49')],{})[_0xe37d('0x23')](respondWithResult(_0x1d8f8d,0xc9))[_0xe37d('0x43')](handleError(_0x1d8f8d,null));};exports['update']=function(_0x20e372,_0x19c987){if(_0x20e372[_0xe37d('0x49')]['id']){delete _0x20e372[_0xe37d('0x49')]['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x20e372[_0xe37d('0x45')]['id']}})[_0xe37d('0x23')](handleEntityNotFound(_0x19c987,null))['then'](saveUpdates(_0x20e372[_0xe37d('0x49')],null))[_0xe37d('0x23')](respondWithResult(_0x19c987,null))[_0xe37d('0x43')](handleError(_0x19c987,null));};exports[_0xe37d('0x22')]=function(_0x33d9c3,_0x455528){return db['SalesforceConfiguration']['find']({'where':{'id':_0x33d9c3[_0xe37d('0x45')]['id']}})[_0xe37d('0x23')](handleEntityNotFound(_0x455528,null))[_0xe37d('0x23')](removeEntity(_0x455528,null))['catch'](handleError(_0x455528,null));};exports[_0xe37d('0x4a')]=function(_0x3deb59,_0x37050b,_0x105893){var _0x7c1f6b={};var _0x323956={};var _0x2b26bb;var _0x267a9f;return db['SalesforceConfiguration'][_0xe37d('0x4b')]({'where':{'id':_0x3deb59['params']['id']}})['then'](handleEntityNotFound(_0x37050b,null))[_0xe37d('0x23')](function(_0x4f9eb6){if(_0x4f9eb6){_0x2b26bb=_0x4f9eb6;_0x323956[_0xe37d('0x2f')]=_[_0xe37d('0x30')](db['SalesforceField'][_0xe37d('0x2b')]);_0x323956[_0xe37d('0x34')]=_['keys'](_0x3deb59[_0xe37d('0x34')]);_0x323956['filters']=_[_0xe37d('0x32')](_0x323956[_0xe37d('0x2f')],_0x323956[_0xe37d('0x34')]);_0x7c1f6b[_0xe37d('0x35')]=_[_0xe37d('0x32')](_0x323956[_0xe37d('0x2f')],qs['fields'](_0x3deb59[_0xe37d('0x34')][_0xe37d('0x33')]));_0x7c1f6b[_0xe37d('0x35')]=_0x7c1f6b[_0xe37d('0x35')]['length']?_0x7c1f6b[_0xe37d('0x35')]:_0x323956['model'];_0x7c1f6b[_0xe37d('0x38')]=qs['sort'](_0x3deb59[_0xe37d('0x34')]['sort']);_0x7c1f6b[_0xe37d('0x3b')]=qs['filters'](_['pick'](_0x3deb59['query'],_0x323956[_0xe37d('0x31')]));if(_0x3deb59[_0xe37d('0x34')][_0xe37d('0x3a')]){_0x7c1f6b[_0xe37d('0x3b')]=_[_0xe37d('0x3d')](_0x7c1f6b[_0xe37d('0x3b')],{'$or':_['map'](_0x7c1f6b[_0xe37d('0x35')],function(_0x2ceb4d){var _0x3b14af={};_0x3b14af[_0x2ceb4d]={'$like':'%'+_0x3deb59[_0xe37d('0x34')][_0xe37d('0x3a')]+'%'};return _0x3b14af;})});}_0x7c1f6b=_['merge']({},_0x7c1f6b,_0x3deb59['options']);return _0x2b26bb[_0xe37d('0x4a')](_0x7c1f6b);}})['then'](function(_0x495387){if(_0x495387){_0x267a9f=_0x495387[_0xe37d('0x46')];if(!_0x3deb59['query'][_0xe37d('0x36')](_0xe37d('0x37'))){_0x7c1f6b[_0xe37d('0x1a')]=qs['limit'](_0x3deb59[_0xe37d('0x34')][_0xe37d('0x1a')]);_0x7c1f6b[_0xe37d('0x19')]=qs['offset'](_0x3deb59[_0xe37d('0x34')][_0xe37d('0x19')]);}return _0x2b26bb['getFields'](_0x7c1f6b);}})[_0xe37d('0x23')](function(_0x410145){if(_0x410145){return _0x410145?{'count':_0x267a9f,'rows':_0x410145}:null;}})[_0xe37d('0x23')](respondWithResult(_0x37050b,null))[_0xe37d('0x43')](handleError(_0x37050b,null));};exports[_0xe37d('0x4c')]=function(_0x42d72e,_0x19092a,_0x5926ad){var _0x6d7580={};var _0x1b33cf={};var _0x2d8e3c;var _0x43833e;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x42d72e[_0xe37d('0x45')]['id']}})[_0xe37d('0x23')](handleEntityNotFound(_0x19092a,null))[_0xe37d('0x23')](function(_0x3fe710){if(_0x3fe710){_0x2d8e3c=_0x3fe710;_0x1b33cf[_0xe37d('0x2f')]=_[_0xe37d('0x30')](db[_0xe37d('0x4d')][_0xe37d('0x2b')]);_0x1b33cf[_0xe37d('0x34')]=_[_0xe37d('0x30')](_0x42d72e[_0xe37d('0x34')]);_0x1b33cf['filters']=_[_0xe37d('0x32')](_0x1b33cf[_0xe37d('0x2f')],_0x1b33cf[_0xe37d('0x34')]);_0x6d7580[_0xe37d('0x35')]=_[_0xe37d('0x32')](_0x1b33cf[_0xe37d('0x2f')],qs[_0xe37d('0x33')](_0x42d72e[_0xe37d('0x34')]['fields']));_0x6d7580[_0xe37d('0x35')]=_0x6d7580[_0xe37d('0x35')][_0xe37d('0x46')]?_0x6d7580[_0xe37d('0x35')]:_0x1b33cf[_0xe37d('0x2f')];_0x6d7580['order']=qs[_0xe37d('0x39')](_0x42d72e[_0xe37d('0x34')]['sort']);_0x6d7580[_0xe37d('0x3b')]=qs['filters'](_[_0xe37d('0x4e')](_0x42d72e[_0xe37d('0x34')],_0x1b33cf[_0xe37d('0x31')]));if(_0x42d72e[_0xe37d('0x34')]['filter']){_0x6d7580['where']=_[_0xe37d('0x3d')](_0x6d7580[_0xe37d('0x3b')],{'$or':_[_0xe37d('0x29')](_0x6d7580[_0xe37d('0x35')],function(_0x177013){var _0x3dd7af={};_0x3dd7af[_0x177013]={'$like':'%'+_0x42d72e[_0xe37d('0x34')][_0xe37d('0x3a')]+'%'};return _0x3dd7af;})});}_0x6d7580=_['merge']({},_0x6d7580,_0x42d72e['options']);return _0x2d8e3c[_0xe37d('0x4c')](_0x6d7580);}})['then'](function(_0x1573d8){if(_0x1573d8){_0x43833e=_0x1573d8[_0xe37d('0x46')];if(!_0x42d72e[_0xe37d('0x34')][_0xe37d('0x36')](_0xe37d('0x37'))){_0x6d7580[_0xe37d('0x1a')]=qs[_0xe37d('0x1a')](_0x42d72e[_0xe37d('0x34')][_0xe37d('0x1a')]);_0x6d7580['offset']=qs[_0xe37d('0x19')](_0x42d72e['query'][_0xe37d('0x19')]);}return _0x2d8e3c[_0xe37d('0x4c')](_0x6d7580);}})[_0xe37d('0x23')](function(_0x60a0d2){if(_0x60a0d2){return _0x60a0d2?{'count':_0x43833e,'rows':_0x60a0d2}:null;}})[_0xe37d('0x23')](respondWithResult(_0x19092a,null))[_0xe37d('0x43')](handleError(_0x19092a,null));};exports['getDescriptions']=function(_0x1ca192,_0x2c04ae,_0x60b67f){var _0x294b11={};var _0x17957e={};var _0x560855;var _0x5111df;return db['SalesforceConfiguration'][_0xe37d('0x4b')]({'where':{'id':_0x1ca192['params']['id']}})[_0xe37d('0x23')](handleEntityNotFound(_0x2c04ae,null))[_0xe37d('0x23')](function(_0xa301fb){if(_0xa301fb){_0x560855=_0xa301fb;_0x17957e['model']=_[_0xe37d('0x30')](db['SalesforceField']['rawAttributes']);_0x17957e[_0xe37d('0x34')]=_[_0xe37d('0x30')](_0x1ca192['query']);_0x17957e[_0xe37d('0x31')]=_[_0xe37d('0x32')](_0x17957e[_0xe37d('0x2f')],_0x17957e['query']);_0x294b11[_0xe37d('0x35')]=_['intersection'](_0x17957e[_0xe37d('0x2f')],qs[_0xe37d('0x33')](_0x1ca192[_0xe37d('0x34')]['fields']));_0x294b11[_0xe37d('0x35')]=_0x294b11['attributes']['length']?_0x294b11[_0xe37d('0x35')]:_0x17957e[_0xe37d('0x2f')];_0x294b11[_0xe37d('0x38')]=qs['sort'](_0x1ca192[_0xe37d('0x34')]['sort']);_0x294b11['where']=qs[_0xe37d('0x31')](_[_0xe37d('0x4e')](_0x1ca192[_0xe37d('0x34')],_0x17957e[_0xe37d('0x31')]));if(_0x1ca192['query']['filter']){_0x294b11[_0xe37d('0x3b')]=_[_0xe37d('0x3d')](_0x294b11['where'],{'$or':_['map'](_0x294b11[_0xe37d('0x35')],function(_0x2b58af){var _0x124663={};_0x124663[_0x2b58af]={'$like':'%'+_0x1ca192[_0xe37d('0x34')][_0xe37d('0x3a')]+'%'};return _0x124663;})});}_0x294b11=_[_0xe37d('0x3d')]({},_0x294b11,_0x1ca192['options']);return _0x560855[_0xe37d('0x4f')](_0x294b11);}})['then'](function(_0x1bbacf){if(_0x1bbacf){_0x5111df=_0x1bbacf[_0xe37d('0x46')];if(!_0x1ca192[_0xe37d('0x34')][_0xe37d('0x36')](_0xe37d('0x37'))){_0x294b11['limit']=qs[_0xe37d('0x1a')](_0x1ca192[_0xe37d('0x34')][_0xe37d('0x1a')]);_0x294b11[_0xe37d('0x19')]=qs['offset'](_0x1ca192[_0xe37d('0x34')][_0xe37d('0x19')]);}return _0x560855[_0xe37d('0x4f')](_0x294b11);}})[_0xe37d('0x23')](function(_0x30bc2e){if(_0x30bc2e){return _0x30bc2e?{'count':_0x5111df,'rows':_0x30bc2e}:null;}})[_0xe37d('0x23')](respondWithResult(_0x2c04ae,null))[_0xe37d('0x43')](handleError(_0x2c04ae,null));}; \ No newline at end of file +var _0xf0dd=['crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','sendStatus','stack','name','send','index','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','type','merge','options','SalesforceConfiguration','rows','params','includeAll','find','catch','create','body','getFields','findOne','SalesforceField','getSubjects','hasOwnProperty','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x376f78,_0x144dbf){var _0xb86d59=function(_0x2fd46f){while(--_0x2fd46f){_0x376f78['push'](_0x376f78['shift']());}};_0xb86d59(++_0x144dbf);}(_0xf0dd,0x84));var _0xdf0d=function(_0x3c9fda,_0x188817){_0x3c9fda=_0x3c9fda-0x0;var _0x45b841=_0xf0dd[_0x3c9fda];return _0x45b841;};'use strict';var emlformat=require(_0xdf0d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf0d('0x1'));var jsonpatch=require(_0xdf0d('0x2'));var rp=require('request-promise');var moment=require(_0xdf0d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdf0d('0x4'));var util=require(_0xdf0d('0x5'));var path=require(_0xdf0d('0x6'));var sox=require(_0xdf0d('0x7'));var csv=require(_0xdf0d('0x8'));var ejs=require(_0xdf0d('0x9'));var fs=require('fs');var fs_extra=require(_0xdf0d('0xa'));var _=require('lodash');var squel=require(_0xdf0d('0xb'));var crypto=require(_0xdf0d('0xc'));var jsforce=require(_0xdf0d('0xd'));var deskjs=require(_0xdf0d('0xe'));var toCsv=require(_0xdf0d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdf0d('0xf'));var qs=require(_0xdf0d('0x10'));var as=require(_0xdf0d('0x11'));var hardwareService=require(_0xdf0d('0x12'));var logger=require('../../config/logger')(_0xdf0d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdf0d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a6d5f,_0x1a7793){_0x1a7793=_0x1a7793||0xcc;return function(_0x4746b9){if(_0x4746b9){return _0x4a6d5f['sendStatus'](_0x1a7793);}return _0x4a6d5f[_0xdf0d('0x15')](_0x1a7793)[_0xdf0d('0x16')]();};}function respondWithResult(_0x33d5ac,_0x67e298){_0x67e298=_0x67e298||0xc8;return function(_0x469d0d){if(_0x469d0d){return _0x33d5ac['status'](_0x67e298)[_0xdf0d('0x17')](_0x469d0d);}};}function respondWithFilteredResult(_0x39c6b8,_0x56009f){return function(_0x799849){if(_0x799849){var _0x1126b1=typeof _0x56009f[_0xdf0d('0x18')]===_0xdf0d('0x19')&&typeof _0x56009f['limit']==='undefined';var _0x24bfb5=_0x799849[_0xdf0d('0x1a')];var _0x5e6c6=_0x1126b1?0x0:_0x56009f['offset'];var _0x2ae043=_0x1126b1?_0x799849[_0xdf0d('0x1a')]:_0x56009f['offset']+_0x56009f[_0xdf0d('0x1b')];var _0x47fa51;if(_0x2ae043>=_0x24bfb5){_0x2ae043=_0x24bfb5;_0x47fa51=0xc8;}else{_0x47fa51=0xce;}_0x39c6b8[_0xdf0d('0x15')](_0x47fa51);return _0x39c6b8[_0xdf0d('0x1c')]('Content-Range',_0x5e6c6+'-'+_0x2ae043+'/'+_0x24bfb5)[_0xdf0d('0x17')](_0x799849);}return null;};}function patchUpdates(_0x11a653){return function(_0x155a72){try{jsonpatch['apply'](_0x155a72,_0x11a653,!![]);}catch(_0x2c7e3f){return BPromise[_0xdf0d('0x1d')](_0x2c7e3f);}return _0x155a72[_0xdf0d('0x1e')]();};}function saveUpdates(_0x845eee,_0x4e06fe){return function(_0x20be14){if(_0x20be14){return _0x20be14[_0xdf0d('0x1f')](_0x845eee)[_0xdf0d('0x20')](function(_0xcccc40){return _0xcccc40;});}return null;};}function removeEntity(_0x50d378,_0x3ee224){return function(_0x198ded){if(_0x198ded){return _0x198ded['destroy']()[_0xdf0d('0x20')](function(){_0x50d378[_0xdf0d('0x15')](0xcc)[_0xdf0d('0x16')]();});}};}function handleEntityNotFound(_0x14f1c8,_0x43ff61){return function(_0x149124){if(!_0x149124){_0x14f1c8[_0xdf0d('0x21')](0x194);}return _0x149124;};}function handleError(_0x44c35b,_0x18e370){_0x18e370=_0x18e370||0x1f4;return function(_0x1d367a){logger['error'](_0x1d367a[_0xdf0d('0x22')]);if(_0x1d367a[_0xdf0d('0x23')]){delete _0x1d367a[_0xdf0d('0x23')];}_0x44c35b['status'](_0x18e370)[_0xdf0d('0x24')](_0x1d367a);};}exports[_0xdf0d('0x25')]=function(_0x2cf200,_0x23a002){var _0x2f40f3={},_0x2dc07b={},_0x1c644e={'count':0x0,'rows':[]};var _0x209c50=_['map'](db['SalesforceConfiguration'][_0xdf0d('0x26')],function(_0x2fa3c7){return{'name':_0x2fa3c7[_0xdf0d('0x27')],'type':_0x2fa3c7['type']['key']};});_0x2dc07b[_0xdf0d('0x28')]=_[_0xdf0d('0x29')](_0x209c50,'name');_0x2dc07b['query']=_[_0xdf0d('0x2a')](_0x2cf200[_0xdf0d('0x2b')]);_0x2dc07b[_0xdf0d('0x2c')]=_[_0xdf0d('0x2d')](_0x2dc07b[_0xdf0d('0x28')],_0x2dc07b[_0xdf0d('0x2b')]);_0x2f40f3[_0xdf0d('0x2e')]=_[_0xdf0d('0x2d')](_0x2dc07b[_0xdf0d('0x28')],qs[_0xdf0d('0x2f')](_0x2cf200[_0xdf0d('0x2b')]['fields']));_0x2f40f3[_0xdf0d('0x2e')]=_0x2f40f3[_0xdf0d('0x2e')][_0xdf0d('0x30')]?_0x2f40f3[_0xdf0d('0x2e')]:_0x2dc07b[_0xdf0d('0x28')];if(!_0x2cf200[_0xdf0d('0x2b')]['hasOwnProperty'](_0xdf0d('0x31'))){_0x2f40f3[_0xdf0d('0x1b')]=qs[_0xdf0d('0x1b')](_0x2cf200['query'][_0xdf0d('0x1b')]);_0x2f40f3['offset']=qs[_0xdf0d('0x18')](_0x2cf200['query'][_0xdf0d('0x18')]);}_0x2f40f3[_0xdf0d('0x32')]=qs[_0xdf0d('0x33')](_0x2cf200[_0xdf0d('0x2b')]['sort']);_0x2f40f3['where']=qs[_0xdf0d('0x2c')](_[_0xdf0d('0x34')](_0x2cf200[_0xdf0d('0x2b')],_0x2dc07b[_0xdf0d('0x2c')]),_0x209c50);if(_0x2cf200[_0xdf0d('0x2b')][_0xdf0d('0x35')]){_0x2f40f3[_0xdf0d('0x36')]=_['merge'](_0x2f40f3[_0xdf0d('0x36')],{'$or':_[_0xdf0d('0x29')](_0x209c50,function(_0x11b499){if(_0x11b499[_0xdf0d('0x37')]!=='VIRTUAL'){var _0x390add={};_0x390add[_0x11b499[_0xdf0d('0x23')]]={'$like':'%'+_0x2cf200['query'][_0xdf0d('0x35')]+'%'};return _0x390add;}})});}_0x2f40f3=_[_0xdf0d('0x38')]({},_0x2f40f3,_0x2cf200[_0xdf0d('0x39')]);var _0x10a007={'where':_0x2f40f3[_0xdf0d('0x36')]};return db[_0xdf0d('0x3a')][_0xdf0d('0x1a')](_0x10a007)[_0xdf0d('0x20')](function(_0x52a470){_0x1c644e[_0xdf0d('0x1a')]=_0x52a470;if(_0x2cf200['query']['includeAll']){_0x2f40f3['include']=[{'all':!![]}];}return db[_0xdf0d('0x3a')]['findAll'](_0x2f40f3);})[_0xdf0d('0x20')](function(_0x26fec9){_0x1c644e[_0xdf0d('0x3b')]=_0x26fec9;return _0x1c644e;})[_0xdf0d('0x20')](respondWithFilteredResult(_0x23a002,_0x2f40f3))['catch'](handleError(_0x23a002,null));};exports['show']=function(_0x1f4f57,_0xd7d1be){var _0x1ebd12={'raw':![],'where':{'id':_0x1f4f57[_0xdf0d('0x3c')]['id']}},_0x3bfb69={};_0x3bfb69[_0xdf0d('0x28')]=_[_0xdf0d('0x2a')](db[_0xdf0d('0x3a')]['rawAttributes']);_0x3bfb69[_0xdf0d('0x2b')]=_['keys'](_0x1f4f57[_0xdf0d('0x2b')]);_0x3bfb69['filters']=_[_0xdf0d('0x2d')](_0x3bfb69[_0xdf0d('0x28')],_0x3bfb69['query']);_0x1ebd12[_0xdf0d('0x2e')]=_[_0xdf0d('0x2d')](_0x3bfb69[_0xdf0d('0x28')],qs[_0xdf0d('0x2f')](_0x1f4f57['query'][_0xdf0d('0x2f')]));_0x1ebd12[_0xdf0d('0x2e')]=_0x1ebd12['attributes'][_0xdf0d('0x30')]?_0x1ebd12['attributes']:_0x3bfb69['model'];if(_0x1f4f57[_0xdf0d('0x2b')][_0xdf0d('0x3d')]){_0x1ebd12['include']=[{'all':!![]}];}_0x1ebd12=_[_0xdf0d('0x38')]({},_0x1ebd12,_0x1f4f57['options']);return db[_0xdf0d('0x3a')][_0xdf0d('0x3e')](_0x1ebd12)['then'](handleEntityNotFound(_0xd7d1be,null))['then'](respondWithResult(_0xd7d1be,null))[_0xdf0d('0x3f')](handleError(_0xd7d1be,null));};exports[_0xdf0d('0x40')]=function(_0x5c9434,_0x4f5ca4){return db[_0xdf0d('0x3a')][_0xdf0d('0x40')](_0x5c9434[_0xdf0d('0x41')],{})[_0xdf0d('0x20')](respondWithResult(_0x4f5ca4,0xc9))[_0xdf0d('0x3f')](handleError(_0x4f5ca4,null));};exports[_0xdf0d('0x1f')]=function(_0x2cb312,_0x31a139){if(_0x2cb312[_0xdf0d('0x41')]['id']){delete _0x2cb312[_0xdf0d('0x41')]['id'];}return db[_0xdf0d('0x3a')][_0xdf0d('0x3e')]({'where':{'id':_0x2cb312[_0xdf0d('0x3c')]['id']}})[_0xdf0d('0x20')](handleEntityNotFound(_0x31a139,null))[_0xdf0d('0x20')](saveUpdates(_0x2cb312[_0xdf0d('0x41')],null))[_0xdf0d('0x20')](respondWithResult(_0x31a139,null))['catch'](handleError(_0x31a139,null));};exports['destroy']=function(_0x26ddd7,_0x28ccd8){return db[_0xdf0d('0x3a')][_0xdf0d('0x3e')]({'where':{'id':_0x26ddd7['params']['id']}})[_0xdf0d('0x20')](handleEntityNotFound(_0x28ccd8,null))[_0xdf0d('0x20')](removeEntity(_0x28ccd8,null))[_0xdf0d('0x3f')](handleError(_0x28ccd8,null));};exports[_0xdf0d('0x42')]=function(_0x5e4cfd,_0x35c391,_0x44debf){var _0x15816b={};var _0x10726e={};var _0x5ad44e;var _0x169c9e;return db[_0xdf0d('0x3a')][_0xdf0d('0x43')]({'where':{'id':_0x5e4cfd[_0xdf0d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x35c391,null))[_0xdf0d('0x20')](function(_0xbfe604){if(_0xbfe604){_0x5ad44e=_0xbfe604;_0x10726e[_0xdf0d('0x28')]=_['keys'](db[_0xdf0d('0x44')][_0xdf0d('0x26')]);_0x10726e['query']=_[_0xdf0d('0x2a')](_0x5e4cfd[_0xdf0d('0x2b')]);_0x10726e[_0xdf0d('0x2c')]=_[_0xdf0d('0x2d')](_0x10726e['model'],_0x10726e['query']);_0x15816b[_0xdf0d('0x2e')]=_[_0xdf0d('0x2d')](_0x10726e[_0xdf0d('0x28')],qs[_0xdf0d('0x2f')](_0x5e4cfd[_0xdf0d('0x2b')]['fields']));_0x15816b[_0xdf0d('0x2e')]=_0x15816b[_0xdf0d('0x2e')]['length']?_0x15816b[_0xdf0d('0x2e')]:_0x10726e[_0xdf0d('0x28')];_0x15816b[_0xdf0d('0x32')]=qs['sort'](_0x5e4cfd['query'][_0xdf0d('0x33')]);_0x15816b[_0xdf0d('0x36')]=qs[_0xdf0d('0x2c')](_['pick'](_0x5e4cfd[_0xdf0d('0x2b')],_0x10726e['filters']));if(_0x5e4cfd[_0xdf0d('0x2b')][_0xdf0d('0x35')]){_0x15816b['where']=_['merge'](_0x15816b[_0xdf0d('0x36')],{'$or':_[_0xdf0d('0x29')](_0x15816b[_0xdf0d('0x2e')],function(_0x57c7ec){var _0x2035dd={};_0x2035dd[_0x57c7ec]={'$like':'%'+_0x5e4cfd[_0xdf0d('0x2b')][_0xdf0d('0x35')]+'%'};return _0x2035dd;})});}_0x15816b=_['merge']({},_0x15816b,_0x5e4cfd['options']);return _0x5ad44e[_0xdf0d('0x42')](_0x15816b);}})[_0xdf0d('0x20')](function(_0x29a01f){if(_0x29a01f){_0x169c9e=_0x29a01f[_0xdf0d('0x30')];if(!_0x5e4cfd[_0xdf0d('0x2b')]['hasOwnProperty'](_0xdf0d('0x31'))){_0x15816b[_0xdf0d('0x1b')]=qs[_0xdf0d('0x1b')](_0x5e4cfd['query'][_0xdf0d('0x1b')]);_0x15816b[_0xdf0d('0x18')]=qs['offset'](_0x5e4cfd['query'][_0xdf0d('0x18')]);}return _0x5ad44e[_0xdf0d('0x42')](_0x15816b);}})['then'](function(_0x4c0520){if(_0x4c0520){return _0x4c0520?{'count':_0x169c9e,'rows':_0x4c0520}:null;}})[_0xdf0d('0x20')](respondWithResult(_0x35c391,null))[_0xdf0d('0x3f')](handleError(_0x35c391,null));};exports['getSubjects']=function(_0x84c783,_0x68e039,_0x3ebf02){var _0x493b9b={};var _0x3a6eba={};var _0x28218c;var _0x5bfb5b;return db[_0xdf0d('0x3a')]['findOne']({'where':{'id':_0x84c783[_0xdf0d('0x3c')]['id']}})[_0xdf0d('0x20')](handleEntityNotFound(_0x68e039,null))[_0xdf0d('0x20')](function(_0x2c7643){if(_0x2c7643){_0x28218c=_0x2c7643;_0x3a6eba['model']=_[_0xdf0d('0x2a')](db[_0xdf0d('0x44')][_0xdf0d('0x26')]);_0x3a6eba[_0xdf0d('0x2b')]=_[_0xdf0d('0x2a')](_0x84c783[_0xdf0d('0x2b')]);_0x3a6eba[_0xdf0d('0x2c')]=_[_0xdf0d('0x2d')](_0x3a6eba[_0xdf0d('0x28')],_0x3a6eba[_0xdf0d('0x2b')]);_0x493b9b[_0xdf0d('0x2e')]=_[_0xdf0d('0x2d')](_0x3a6eba[_0xdf0d('0x28')],qs[_0xdf0d('0x2f')](_0x84c783['query']['fields']));_0x493b9b['attributes']=_0x493b9b[_0xdf0d('0x2e')][_0xdf0d('0x30')]?_0x493b9b[_0xdf0d('0x2e')]:_0x3a6eba[_0xdf0d('0x28')];_0x493b9b[_0xdf0d('0x32')]=qs[_0xdf0d('0x33')](_0x84c783[_0xdf0d('0x2b')][_0xdf0d('0x33')]);_0x493b9b[_0xdf0d('0x36')]=qs['filters'](_[_0xdf0d('0x34')](_0x84c783[_0xdf0d('0x2b')],_0x3a6eba['filters']));if(_0x84c783['query'][_0xdf0d('0x35')]){_0x493b9b['where']=_[_0xdf0d('0x38')](_0x493b9b[_0xdf0d('0x36')],{'$or':_[_0xdf0d('0x29')](_0x493b9b[_0xdf0d('0x2e')],function(_0x438301){var _0x122f72={};_0x122f72[_0x438301]={'$like':'%'+_0x84c783[_0xdf0d('0x2b')][_0xdf0d('0x35')]+'%'};return _0x122f72;})});}_0x493b9b=_['merge']({},_0x493b9b,_0x84c783[_0xdf0d('0x39')]);return _0x28218c[_0xdf0d('0x45')](_0x493b9b);}})[_0xdf0d('0x20')](function(_0x2ea581){if(_0x2ea581){_0x5bfb5b=_0x2ea581[_0xdf0d('0x30')];if(!_0x84c783['query'][_0xdf0d('0x46')](_0xdf0d('0x31'))){_0x493b9b[_0xdf0d('0x1b')]=qs[_0xdf0d('0x1b')](_0x84c783['query'][_0xdf0d('0x1b')]);_0x493b9b[_0xdf0d('0x18')]=qs['offset'](_0x84c783[_0xdf0d('0x2b')][_0xdf0d('0x18')]);}return _0x28218c[_0xdf0d('0x45')](_0x493b9b);}})[_0xdf0d('0x20')](function(_0x1099c2){if(_0x1099c2){return _0x1099c2?{'count':_0x5bfb5b,'rows':_0x1099c2}:null;}})['then'](respondWithResult(_0x68e039,null))[_0xdf0d('0x3f')](handleError(_0x68e039,null));};exports[_0xdf0d('0x47')]=function(_0x592a36,_0x51ad1c,_0x3e6553){var _0x4cd6cd={};var _0x2c1e81={};var _0xf77bc8;var _0x553224;return db[_0xdf0d('0x3a')]['findOne']({'where':{'id':_0x592a36[_0xdf0d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x51ad1c,null))[_0xdf0d('0x20')](function(_0x29a2f5){if(_0x29a2f5){_0xf77bc8=_0x29a2f5;_0x2c1e81[_0xdf0d('0x28')]=_[_0xdf0d('0x2a')](db[_0xdf0d('0x44')][_0xdf0d('0x26')]);_0x2c1e81['query']=_[_0xdf0d('0x2a')](_0x592a36['query']);_0x2c1e81['filters']=_['intersection'](_0x2c1e81['model'],_0x2c1e81[_0xdf0d('0x2b')]);_0x4cd6cd[_0xdf0d('0x2e')]=_[_0xdf0d('0x2d')](_0x2c1e81[_0xdf0d('0x28')],qs[_0xdf0d('0x2f')](_0x592a36[_0xdf0d('0x2b')]['fields']));_0x4cd6cd[_0xdf0d('0x2e')]=_0x4cd6cd[_0xdf0d('0x2e')][_0xdf0d('0x30')]?_0x4cd6cd[_0xdf0d('0x2e')]:_0x2c1e81[_0xdf0d('0x28')];_0x4cd6cd['order']=qs[_0xdf0d('0x33')](_0x592a36[_0xdf0d('0x2b')][_0xdf0d('0x33')]);_0x4cd6cd[_0xdf0d('0x36')]=qs['filters'](_[_0xdf0d('0x34')](_0x592a36[_0xdf0d('0x2b')],_0x2c1e81['filters']));if(_0x592a36[_0xdf0d('0x2b')][_0xdf0d('0x35')]){_0x4cd6cd[_0xdf0d('0x36')]=_['merge'](_0x4cd6cd[_0xdf0d('0x36')],{'$or':_[_0xdf0d('0x29')](_0x4cd6cd[_0xdf0d('0x2e')],function(_0x1edc7f){var _0xe3669b={};_0xe3669b[_0x1edc7f]={'$like':'%'+_0x592a36[_0xdf0d('0x2b')]['filter']+'%'};return _0xe3669b;})});}_0x4cd6cd=_[_0xdf0d('0x38')]({},_0x4cd6cd,_0x592a36[_0xdf0d('0x39')]);return _0xf77bc8['getDescriptions'](_0x4cd6cd);}})[_0xdf0d('0x20')](function(_0x27e501){if(_0x27e501){_0x553224=_0x27e501['length'];if(!_0x592a36['query'][_0xdf0d('0x46')](_0xdf0d('0x31'))){_0x4cd6cd[_0xdf0d('0x1b')]=qs[_0xdf0d('0x1b')](_0x592a36[_0xdf0d('0x2b')][_0xdf0d('0x1b')]);_0x4cd6cd[_0xdf0d('0x18')]=qs['offset'](_0x592a36['query'][_0xdf0d('0x18')]);}return _0xf77bc8[_0xdf0d('0x47')](_0x4cd6cd);}})[_0xdf0d('0x20')](function(_0x3da23f){if(_0x3da23f){return _0x3da23f?{'count':_0x553224,'rows':_0x3da23f}:null;}})[_0xdf0d('0x20')](respondWithResult(_0x51ad1c,null))[_0xdf0d('0x3f')](handleError(_0x51ad1c,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index f9835d0..da63553 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x139c=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x542b18,_0x2a27b8){var _0x4ccb1c=function(_0x4c00fb){while(--_0x4c00fb){_0x542b18['push'](_0x542b18['shift']());}};_0x4ccb1c(++_0x2a27b8);}(_0x139c,0x1b2));var _0xc139=function(_0x2d2309,_0x296b1d){_0x2d2309=_0x2d2309-0x0;var _0x35eaff=_0x139c[_0x2d2309];return _0x35eaff;};'use strict';var _=require(_0xc139('0x0'));var util=require(_0xc139('0x1'));var logger=require('../../config/logger')(_0xc139('0x2'));var moment=require(_0xc139('0x3'));var BPromise=require(_0xc139('0x4'));var rp=require(_0xc139('0x5'));var fs=require('fs');var path=require(_0xc139('0x6'));var rimraf=require(_0xc139('0x7'));var config=require(_0xc139('0x8'));var attributes=require(_0xc139('0x9'));module[_0xc139('0xa')]=function(_0x59826f,_0x4a6730){return _0x59826f[_0xc139('0xb')](_0xc139('0xc'),attributes,{'tableName':_0xc139('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x875d=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define'];(function(_0x5de961,_0x300960){var _0x2e7f56=function(_0x528a50){while(--_0x528a50){_0x5de961['push'](_0x5de961['shift']());}};_0x2e7f56(++_0x300960);}(_0x875d,0x120));var _0xd875=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0x875d[_0x59c301];return _0x3866b9;};'use strict';var _=require(_0xd875('0x0'));var util=require(_0xd875('0x1'));var logger=require(_0xd875('0x2'))('api');var moment=require(_0xd875('0x3'));var BPromise=require(_0xd875('0x4'));var rp=require(_0xd875('0x5'));var fs=require('fs');var path=require(_0xd875('0x6'));var rimraf=require(_0xd875('0x7'));var config=require(_0xd875('0x8'));var attributes=require(_0xd875('0x9'));module[_0xd875('0xa')]=function(_0x466188,_0x14ff8e){return _0x466188[_0xd875('0xb')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index aecaa68..e28d91f 100644 --- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js +++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f0b=['../../config/environment','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1abdba,_0x442f96){var _0xb618d4=function(_0x2a2ffa){while(--_0x2a2ffa){_0x1abdba['push'](_0x1abdba['shift']());}};_0xb618d4(++_0x442f96);}(_0x2f0b,0xc2));var _0xb2f0=function(_0x2b39c4,_0x1f9419){_0x2b39c4=_0x2b39c4-0x0;var _0x429ad8=_0x2f0b[_0x2b39c4];return _0x429ad8;};'use strict';var _=require(_0xb2f0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb2f0('0x1'));var rs=require(_0xb2f0('0x2'));var fs=require('fs');var Redis=require(_0xb2f0('0x3'));var db=require(_0xb2f0('0x4'))['db'];var utils=require(_0xb2f0('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb2f0('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb2f0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4f4a32,_0xc8fdc7,_0x4b1c75){return new BPromise(function(_0x5edb28,_0x55ed5b){return client[_0xb2f0('0x8')](_0x4f4a32,_0x4b1c75)[_0xb2f0('0x9')](function(_0x19b76f){logger[_0xb2f0('0xa')](_0xb2f0('0xb'),_0xc8fdc7,_0xb2f0('0xc'));logger['debug'](_0xb2f0('0xd'),_0xc8fdc7,_0xb2f0('0xc'),JSON[_0xb2f0('0xe')](_0x19b76f));if(_0x19b76f['error']){if(_0x19b76f[_0xb2f0('0xf')][_0xb2f0('0x10')]===0x1f4){logger['error'](_0xb2f0('0xb'),_0xc8fdc7,_0x19b76f[_0xb2f0('0xf')][_0xb2f0('0x11')]);return _0x55ed5b(_0x19b76f[_0xb2f0('0xf')][_0xb2f0('0x11')]);}logger[_0xb2f0('0xf')](_0xb2f0('0xb'),_0xc8fdc7,_0x19b76f[_0xb2f0('0xf')][_0xb2f0('0x11')]);return _0x5edb28(_0x19b76f[_0xb2f0('0xf')][_0xb2f0('0x11')]);}else{logger[_0xb2f0('0xa')](_0xb2f0('0xb'),_0xc8fdc7,'request\x20sent');_0x5edb28(_0x19b76f[_0xb2f0('0x12')][_0xb2f0('0x11')]);}})[_0xb2f0('0x13')](function(_0x4f9a8d){logger[_0xb2f0('0xf')](_0xb2f0('0xb'),_0xc8fdc7,_0x4f9a8d);_0x55ed5b(_0x4f9a8d);});});} \ No newline at end of file +var _0x9c23=['SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x1cbed5,_0x5e48c0){var _0x888293=function(_0x1c5a03){while(--_0x1c5a03){_0x1cbed5['push'](_0x1cbed5['shift']());}};_0x888293(++_0x5e48c0);}(_0x9c23,0x152));var _0x39c2=function(_0x53cc0a,_0x30848e){_0x53cc0a=_0x53cc0a-0x0;var _0x58044c=_0x9c23[_0x53cc0a];return _0x58044c;};'use strict';var _=require(_0x39c2('0x0'));var util=require(_0x39c2('0x1'));var moment=require(_0x39c2('0x2'));var BPromise=require(_0x39c2('0x3'));var rs=require(_0x39c2('0x4'));var fs=require('fs');var Redis=require(_0x39c2('0x5'));var db=require(_0x39c2('0x6'))['db'];var utils=require(_0x39c2('0x7'));var logger=require('../../config/logger')(_0x39c2('0x8'));var config=require(_0x39c2('0x9'));var jayson=require(_0x39c2('0xa'));var client=jayson[_0x39c2('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x418a56,_0x2eb762,_0x35f190){return new BPromise(function(_0x292ad7,_0x3a1c9c){return client[_0x39c2('0xc')](_0x418a56,_0x35f190)[_0x39c2('0xd')](function(_0x43b569){logger['info'](_0x39c2('0xe'),_0x2eb762,_0x39c2('0xf'));logger[_0x39c2('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x2eb762,_0x39c2('0xf'),JSON[_0x39c2('0x11')](_0x43b569));if(_0x43b569[_0x39c2('0x12')]){if(_0x43b569[_0x39c2('0x12')][_0x39c2('0x13')]===0x1f4){logger['error'](_0x39c2('0xe'),_0x2eb762,_0x43b569[_0x39c2('0x12')]['message']);return _0x3a1c9c(_0x43b569['error']['message']);}logger[_0x39c2('0x12')](_0x39c2('0xe'),_0x2eb762,_0x43b569[_0x39c2('0x12')][_0x39c2('0x14')]);return _0x292ad7(_0x43b569[_0x39c2('0x12')]['message']);}else{logger[_0x39c2('0x15')](_0x39c2('0xe'),_0x2eb762,'request\x20sent');_0x292ad7(_0x43b569['result']['message']);}})['catch'](function(_0x50e908){logger[_0x39c2('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2eb762,_0x50e908);_0x3a1c9c(_0x50e908);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 2438626..135a2c6 100644 --- a/server/api/intSalesforceField/index.js +++ b/server/api/intSalesforceField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6459=['index','/:id','show','create','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated'];(function(_0x973f76,_0x1f2b82){var _0x2fbdd3=function(_0x2138d2){while(--_0x2138d2){_0x973f76['push'](_0x973f76['shift']());}};_0x2fbdd3(++_0x1f2b82);}(_0x6459,0xa0));var _0x9645=function(_0x413004,_0x3ba30f){_0x413004=_0x413004-0x0;var _0x548bfc=_0x6459[_0x413004];return _0x548bfc;};'use strict';var multer=require('multer');var util=require(_0x9645('0x0'));var path=require(_0x9645('0x1'));var timeout=require('connect-timeout');var express=require(_0x9645('0x2'));var router=express[_0x9645('0x3')]();var fs_extra=require(_0x9645('0x4'));var auth=require(_0x9645('0x5'));var interaction=require(_0x9645('0x6'));var config=require(_0x9645('0x7'));var controller=require(_0x9645('0x8'));router[_0x9645('0x9')]('/',auth[_0x9645('0xa')](),controller[_0x9645('0xb')]);router[_0x9645('0x9')](_0x9645('0xc'),auth[_0x9645('0xa')](),controller[_0x9645('0xd')]);router['post']('/',auth[_0x9645('0xa')](),controller[_0x9645('0xe')]);router['put'](_0x9645('0xc'),auth[_0x9645('0xa')](),controller[_0x9645('0xf')]);router[_0x9645('0x10')](_0x9645('0xc'),auth[_0x9645('0xa')](),controller[_0x9645('0x11')]);module[_0x9645('0x12')]=router; \ No newline at end of file +var _0xd087=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','post','create','put','update','delete','/:id'];(function(_0x5acd84,_0x378158){var _0x4fbe2e=function(_0x1b35c5){while(--_0x1b35c5){_0x5acd84['push'](_0x5acd84['shift']());}};_0x4fbe2e(++_0x378158);}(_0xd087,0x156));var _0x7d08=function(_0x4d45fd,_0x16b74c){_0x4d45fd=_0x4d45fd-0x0;var _0x2b5aa5=_0xd087[_0x4d45fd];return _0x2b5aa5;};'use strict';var multer=require(_0x7d08('0x0'));var util=require(_0x7d08('0x1'));var path=require(_0x7d08('0x2'));var timeout=require(_0x7d08('0x3'));var express=require(_0x7d08('0x4'));var router=express[_0x7d08('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7d08('0x6'));var interaction=require(_0x7d08('0x7'));var config=require('../../config/environment');var controller=require(_0x7d08('0x8'));router[_0x7d08('0x9')]('/',auth[_0x7d08('0xa')](),controller[_0x7d08('0xb')]);router[_0x7d08('0x9')]('/:id',auth[_0x7d08('0xa')](),controller['show']);router[_0x7d08('0xc')]('/',auth[_0x7d08('0xa')](),controller[_0x7d08('0xd')]);router[_0x7d08('0xe')]('/:id',auth[_0x7d08('0xa')](),controller[_0x7d08('0xf')]);router[_0x7d08('0x10')](_0x7d08('0x11'),auth[_0x7d08('0xa')](),controller[_0x7d08('0x12')]);module[_0x7d08('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index a6c527c..d48e19d 100644 --- a/server/api/intSalesforceField/intSalesforceField.attributes.js +++ b/server/api/intSalesforceField/intSalesforceField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc602=['string','variable','customVariable','keyValue','STRING','sequelize','exports','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc602,0x1b5));var _0x2c60=function(_0x164b78,_0x30bc36){_0x164b78=_0x164b78-0x0;var _0x2b9cde=_0xc602[_0x164b78];return _0x2b9cde;};'use strict';var Sequelize=require(_0x2c60('0x0'));module[_0x2c60('0x1')]={'type':{'type':Sequelize[_0x2c60('0x2')](_0x2c60('0x3'),_0x2c60('0x4'),_0x2c60('0x5'),_0x2c60('0x6'),'picklist'),'defaultValue':_0x2c60('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2c60('0x7')]},'keyType':{'type':Sequelize[_0x2c60('0x2')](_0x2c60('0x3'),_0x2c60('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x2c60('0x7')]},'idField':{'type':Sequelize[_0x2c60('0x7')]},'variableName':{'type':Sequelize[_0x2c60('0x7')]}}; \ No newline at end of file +var _0x5836=['variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5836,0x1f4));var _0x6583=function(_0x2e0d2a,_0x8d568){_0x2e0d2a=_0x2e0d2a-0x0;var _0x4014f0=_0x5836[_0x2e0d2a];return _0x4014f0;};'use strict';var Sequelize=require(_0x6583('0x0'));module[_0x6583('0x1')]={'type':{'type':Sequelize[_0x6583('0x2')](_0x6583('0x3'),_0x6583('0x4'),_0x6583('0x5'),_0x6583('0x6'),_0x6583('0x7')),'defaultValue':_0x6583('0x3')},'content':{'type':Sequelize[_0x6583('0x8')]},'key':{'type':Sequelize[_0x6583('0x8')]},'keyType':{'type':Sequelize[_0x6583('0x2')](_0x6583('0x3'),_0x6583('0x4'),_0x6583('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index c8dd72a..783ffa6 100644 --- a/server/api/intSalesforceField/intSalesforceField.controller.js +++ b/server/api/intSalesforceField/intSalesforceField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe62c=['map','SalesforceField','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','merge','includeAll','include','rows','show','params','find','catch','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','name'];(function(_0x49804b,_0x19bd29){var _0x5d70aa=function(_0x36165e){while(--_0x36165e){_0x49804b['push'](_0x49804b['shift']());}};_0x5d70aa(++_0x19bd29);}(_0xe62c,0x11f));var _0xce62=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xe62c[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xce62('0x0'));var jsonpatch=require(_0xce62('0x1'));var rp=require(_0xce62('0x2'));var moment=require(_0xce62('0x3'));var BPromise=require(_0xce62('0x4'));var Mustache=require(_0xce62('0x5'));var util=require(_0xce62('0x6'));var path=require(_0xce62('0x7'));var sox=require(_0xce62('0x8'));var csv=require(_0xce62('0x9'));var ejs=require(_0xce62('0xa'));var fs=require('fs');var fs_extra=require(_0xce62('0xb'));var _=require('lodash');var squel=require(_0xce62('0xc'));var crypto=require(_0xce62('0xd'));var jsforce=require(_0xce62('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xce62('0x9'));var querystring=require('querystring');var Papa=require(_0xce62('0xf'));var Redis=require(_0xce62('0x10'));var authService=require(_0xce62('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xce62('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce62('0x13'))('api');var utils=require(_0xce62('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xce62('0x15'));var db=require(_0xce62('0x16'))['db'];function respondWithStatusCode(_0x567490,_0x19abca){_0x19abca=_0x19abca||0xcc;return function(_0x5c1934){if(_0x5c1934){return _0x567490['sendStatus'](_0x19abca);}return _0x567490['status'](_0x19abca)[_0xce62('0x17')]();};}function respondWithResult(_0x18100f,_0x26220b){_0x26220b=_0x26220b||0xc8;return function(_0x59d23a){if(_0x59d23a){return _0x18100f[_0xce62('0x18')](_0x26220b)[_0xce62('0x19')](_0x59d23a);}};}function respondWithFilteredResult(_0x1083a0,_0x25bd4e){return function(_0x10f3ef){if(_0x10f3ef){var _0x592b14=typeof _0x25bd4e['offset']===_0xce62('0x1a')&&typeof _0x25bd4e['limit']===_0xce62('0x1a');var _0x568579=_0x10f3ef['count'];var _0x2f3e0e=_0x592b14?0x0:_0x25bd4e[_0xce62('0x1b')];var _0x2cc0b4=_0x592b14?_0x10f3ef[_0xce62('0x1c')]:_0x25bd4e['offset']+_0x25bd4e['limit'];var _0x3fdc05;if(_0x2cc0b4>=_0x568579){_0x2cc0b4=_0x568579;_0x3fdc05=0xc8;}else{_0x3fdc05=0xce;}_0x1083a0[_0xce62('0x18')](_0x3fdc05);return _0x1083a0[_0xce62('0x1d')](_0xce62('0x1e'),_0x2f3e0e+'-'+_0x2cc0b4+'/'+_0x568579)[_0xce62('0x19')](_0x10f3ef);}return null;};}function patchUpdates(_0x3066d9){return function(_0x12a843){try{jsonpatch[_0xce62('0x1f')](_0x12a843,_0x3066d9,!![]);}catch(_0x2bda81){return BPromise[_0xce62('0x20')](_0x2bda81);}return _0x12a843[_0xce62('0x21')]();};}function saveUpdates(_0x7ec7c9,_0x5c664d){return function(_0xde0042){if(_0xde0042){return _0xde0042[_0xce62('0x22')](_0x7ec7c9)[_0xce62('0x23')](function(_0x30dd16){return _0x30dd16;});}return null;};}function removeEntity(_0x47a69c,_0xcb9b12){return function(_0x272073){if(_0x272073){return _0x272073[_0xce62('0x24')]()[_0xce62('0x23')](function(){_0x47a69c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46d1b2,_0x1bf55f){return function(_0xc614c9){if(!_0xc614c9){_0x46d1b2['sendStatus'](0x194);}return _0xc614c9;};}function handleError(_0x2c8972,_0x1912ca){_0x1912ca=_0x1912ca||0x1f4;return function(_0x3fe623){logger['error'](_0x3fe623['stack']);if(_0x3fe623[_0xce62('0x25')]){delete _0x3fe623[_0xce62('0x25')];}_0x2c8972[_0xce62('0x18')](_0x1912ca)['send'](_0x3fe623);};}exports['index']=function(_0x170ff1,_0x1738fb){var _0x75d714={},_0x135adc={},_0x4b8638={'count':0x0,'rows':[]};var _0x546c67=_[_0xce62('0x26')](db[_0xce62('0x27')]['rawAttributes'],function(_0x1eb035){return{'name':_0x1eb035[_0xce62('0x28')],'type':_0x1eb035[_0xce62('0x29')]['key']};});_0x135adc[_0xce62('0x2a')]=_[_0xce62('0x26')](_0x546c67,'name');_0x135adc[_0xce62('0x2b')]=_[_0xce62('0x2c')](_0x170ff1[_0xce62('0x2b')]);_0x135adc[_0xce62('0x2d')]=_[_0xce62('0x2e')](_0x135adc[_0xce62('0x2a')],_0x135adc['query']);_0x75d714[_0xce62('0x2f')]=_[_0xce62('0x2e')](_0x135adc[_0xce62('0x2a')],qs[_0xce62('0x30')](_0x170ff1[_0xce62('0x2b')][_0xce62('0x30')]));_0x75d714[_0xce62('0x2f')]=_0x75d714[_0xce62('0x2f')][_0xce62('0x31')]?_0x75d714[_0xce62('0x2f')]:_0x135adc[_0xce62('0x2a')];if(!_0x170ff1[_0xce62('0x2b')][_0xce62('0x32')]('nolimit')){_0x75d714['limit']=qs[_0xce62('0x33')](_0x170ff1[_0xce62('0x2b')]['limit']);_0x75d714[_0xce62('0x1b')]=qs[_0xce62('0x1b')](_0x170ff1['query'][_0xce62('0x1b')]);}_0x75d714[_0xce62('0x34')]=qs[_0xce62('0x35')](_0x170ff1[_0xce62('0x2b')][_0xce62('0x35')]);_0x75d714[_0xce62('0x36')]=qs[_0xce62('0x2d')](_['pick'](_0x170ff1[_0xce62('0x2b')],_0x135adc['filters']),_0x546c67);if(_0x170ff1[_0xce62('0x2b')]['filter']){_0x75d714[_0xce62('0x36')]=_[_0xce62('0x37')](_0x75d714[_0xce62('0x36')],{'$or':_[_0xce62('0x26')](_0x546c67,function(_0xc1a47){if(_0xc1a47['type']!=='VIRTUAL'){var _0xe786b8={};_0xe786b8[_0xc1a47[_0xce62('0x25')]]={'$like':'%'+_0x170ff1['query']['filter']+'%'};return _0xe786b8;}})});}_0x75d714=_[_0xce62('0x37')]({},_0x75d714,_0x170ff1['options']);var _0x2813fe={'where':_0x75d714['where']};return db[_0xce62('0x27')][_0xce62('0x1c')](_0x2813fe)[_0xce62('0x23')](function(_0x4ae1bc){_0x4b8638[_0xce62('0x1c')]=_0x4ae1bc;if(_0x170ff1['query'][_0xce62('0x38')]){_0x75d714[_0xce62('0x39')]=[{'all':!![]}];}return db[_0xce62('0x27')]['findAll'](_0x75d714);})[_0xce62('0x23')](function(_0x4ed660){_0x4b8638[_0xce62('0x3a')]=_0x4ed660;return _0x4b8638;})['then'](respondWithFilteredResult(_0x1738fb,_0x75d714))['catch'](handleError(_0x1738fb,null));};exports[_0xce62('0x3b')]=function(_0x2c8552,_0x2155b1){var _0x58d48e={'raw':!![],'where':{'id':_0x2c8552[_0xce62('0x3c')]['id']}},_0x2486d4={};_0x2486d4[_0xce62('0x2a')]=_['keys'](db['SalesforceField']['rawAttributes']);_0x2486d4['query']=_[_0xce62('0x2c')](_0x2c8552[_0xce62('0x2b')]);_0x2486d4[_0xce62('0x2d')]=_[_0xce62('0x2e')](_0x2486d4[_0xce62('0x2a')],_0x2486d4['query']);_0x58d48e[_0xce62('0x2f')]=_['intersection'](_0x2486d4[_0xce62('0x2a')],qs[_0xce62('0x30')](_0x2c8552[_0xce62('0x2b')][_0xce62('0x30')]));_0x58d48e[_0xce62('0x2f')]=_0x58d48e[_0xce62('0x2f')]['length']?_0x58d48e[_0xce62('0x2f')]:_0x2486d4[_0xce62('0x2a')];if(_0x2c8552[_0xce62('0x2b')][_0xce62('0x38')]){_0x58d48e[_0xce62('0x39')]=[{'all':!![]}];}_0x58d48e=_[_0xce62('0x37')]({},_0x58d48e,_0x2c8552['options']);return db[_0xce62('0x27')][_0xce62('0x3d')](_0x58d48e)[_0xce62('0x23')](handleEntityNotFound(_0x2155b1,null))[_0xce62('0x23')](respondWithResult(_0x2155b1,null))[_0xce62('0x3e')](handleError(_0x2155b1,null));};exports[_0xce62('0x3f')]=function(_0x2ead3e,_0x261674){return db[_0xce62('0x27')][_0xce62('0x3f')](_0x2ead3e['body'],{})[_0xce62('0x23')](respondWithResult(_0x261674,0xc9))[_0xce62('0x3e')](handleError(_0x261674,null));};exports[_0xce62('0x22')]=function(_0x48f437,_0x38a563){if(_0x48f437['body']['id']){delete _0x48f437[_0xce62('0x40')]['id'];}return db[_0xce62('0x27')]['find']({'where':{'id':_0x48f437[_0xce62('0x3c')]['id']}})[_0xce62('0x23')](handleEntityNotFound(_0x38a563,null))[_0xce62('0x23')](saveUpdates(_0x48f437['body'],null))[_0xce62('0x23')](respondWithResult(_0x38a563,null))['catch'](handleError(_0x38a563,null));};exports[_0xce62('0x24')]=function(_0x3c98a0,_0x46a81d){return db[_0xce62('0x27')][_0xce62('0x3d')]({'where':{'id':_0x3c98a0[_0xce62('0x3c')]['id']}})[_0xce62('0x23')](handleEntityNotFound(_0x46a81d,null))[_0xce62('0x23')](removeEntity(_0x46a81d,null))[_0xce62('0x3e')](handleError(_0x46a81d,null));}; \ No newline at end of file +var _0x235a=['stack','name','send','index','map','rawAttributes','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','where','filters','pick','filter','type','VIRTUAL','options','SalesforceField','includeAll','include','findAll','rows','show','keys','length','merge','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','then','end','error'];(function(_0x19e11a,_0x4fb378){var _0x3bc99e=function(_0x5b8e1a){while(--_0x5b8e1a){_0x19e11a['push'](_0x19e11a['shift']());}};_0x3bc99e(++_0x4fb378);}(_0x235a,0x100));var _0xa235=function(_0x4f28ab,_0x43d2f1){_0x4f28ab=_0x4f28ab-0x0;var _0x551362=_0x235a[_0x4f28ab];return _0x551362;};'use strict';var emlformat=require(_0xa235('0x0'));var rimraf=require(_0xa235('0x1'));var zipdir=require(_0xa235('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa235('0x3'));var BPromise=require(_0xa235('0x4'));var Mustache=require(_0xa235('0x5'));var util=require(_0xa235('0x6'));var path=require(_0xa235('0x7'));var sox=require(_0xa235('0x8'));var csv=require(_0xa235('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa235('0xa'));var _=require(_0xa235('0xb'));var squel=require(_0xa235('0xc'));var crypto=require(_0xa235('0xd'));var jsforce=require(_0xa235('0xe'));var deskjs=require(_0xa235('0xf'));var toCsv=require(_0xa235('0x9'));var querystring=require(_0xa235('0x10'));var Papa=require('papaparse');var Redis=require(_0xa235('0x11'));var authService=require(_0xa235('0x12'));var qs=require(_0xa235('0x13'));var as=require(_0xa235('0x14'));var hardwareService=require(_0xa235('0x15'));var logger=require(_0xa235('0x16'))(_0xa235('0x17'));var utils=require(_0xa235('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa235('0x19'));var db=require(_0xa235('0x1a'))['db'];function respondWithStatusCode(_0x2afea7,_0xdf11e5){_0xdf11e5=_0xdf11e5||0xcc;return function(_0x1f9a06){if(_0x1f9a06){return _0x2afea7[_0xa235('0x1b')](_0xdf11e5);}return _0x2afea7[_0xa235('0x1c')](_0xdf11e5)['end']();};}function respondWithResult(_0x43f994,_0x1de941){_0x1de941=_0x1de941||0xc8;return function(_0x2671c5){if(_0x2671c5){return _0x43f994[_0xa235('0x1c')](_0x1de941)[_0xa235('0x1d')](_0x2671c5);}};}function respondWithFilteredResult(_0x70733c,_0x8e42a5){return function(_0x20391c){if(_0x20391c){var _0x1ea7f7=typeof _0x8e42a5[_0xa235('0x1e')]===_0xa235('0x1f')&&typeof _0x8e42a5[_0xa235('0x20')]===_0xa235('0x1f');var _0x1a789c=_0x20391c['count'];var _0x39d9f4=_0x1ea7f7?0x0:_0x8e42a5['offset'];var _0x31c68b=_0x1ea7f7?_0x20391c[_0xa235('0x21')]:_0x8e42a5['offset']+_0x8e42a5[_0xa235('0x20')];var _0xa822e6;if(_0x31c68b>=_0x1a789c){_0x31c68b=_0x1a789c;_0xa822e6=0xc8;}else{_0xa822e6=0xce;}_0x70733c['status'](_0xa822e6);return _0x70733c[_0xa235('0x22')]('Content-Range',_0x39d9f4+'-'+_0x31c68b+'/'+_0x1a789c)[_0xa235('0x1d')](_0x20391c);}return null;};}function patchUpdates(_0x3f5108){return function(_0x327b82){try{jsonpatch[_0xa235('0x23')](_0x327b82,_0x3f5108,!![]);}catch(_0x34b1ba){return BPromise[_0xa235('0x24')](_0x34b1ba);}return _0x327b82['save']();};}function saveUpdates(_0x55bf39,_0x435370){return function(_0x509e77){if(_0x509e77){return _0x509e77['update'](_0x55bf39)[_0xa235('0x25')](function(_0x2cbc0a){return _0x2cbc0a;});}return null;};}function removeEntity(_0x3c07d0,_0x3c0c5e){return function(_0x9aecba){if(_0x9aecba){return _0x9aecba['destroy']()[_0xa235('0x25')](function(){_0x3c07d0['status'](0xcc)[_0xa235('0x26')]();});}};}function handleEntityNotFound(_0x3ebacd,_0x4dac4e){return function(_0x3e8449){if(!_0x3e8449){_0x3ebacd[_0xa235('0x1b')](0x194);}return _0x3e8449;};}function handleError(_0x2503d7,_0x599054){_0x599054=_0x599054||0x1f4;return function(_0x568d0f){logger[_0xa235('0x27')](_0x568d0f[_0xa235('0x28')]);if(_0x568d0f[_0xa235('0x29')]){delete _0x568d0f['name'];}_0x2503d7[_0xa235('0x1c')](_0x599054)[_0xa235('0x2a')](_0x568d0f);};}exports[_0xa235('0x2b')]=function(_0x270698,_0x1f6624){var _0x2de835={},_0x3db367={},_0x34f99f={'count':0x0,'rows':[]};var _0x325386=_[_0xa235('0x2c')](db['SalesforceField'][_0xa235('0x2d')],function(_0x30c223){return{'name':_0x30c223['fieldName'],'type':_0x30c223['type']['key']};});_0x3db367['model']=_[_0xa235('0x2c')](_0x325386,'name');_0x3db367['query']=_['keys'](_0x270698[_0xa235('0x2e')]);_0x3db367['filters']=_[_0xa235('0x2f')](_0x3db367[_0xa235('0x30')],_0x3db367[_0xa235('0x2e')]);_0x2de835['attributes']=_[_0xa235('0x2f')](_0x3db367[_0xa235('0x30')],qs[_0xa235('0x31')](_0x270698[_0xa235('0x2e')][_0xa235('0x31')]));_0x2de835[_0xa235('0x32')]=_0x2de835['attributes']['length']?_0x2de835['attributes']:_0x3db367[_0xa235('0x30')];if(!_0x270698[_0xa235('0x2e')][_0xa235('0x33')](_0xa235('0x34'))){_0x2de835[_0xa235('0x20')]=qs['limit'](_0x270698[_0xa235('0x2e')]['limit']);_0x2de835['offset']=qs['offset'](_0x270698[_0xa235('0x2e')][_0xa235('0x1e')]);}_0x2de835[_0xa235('0x35')]=qs['sort'](_0x270698['query']['sort']);_0x2de835[_0xa235('0x36')]=qs[_0xa235('0x37')](_[_0xa235('0x38')](_0x270698['query'],_0x3db367[_0xa235('0x37')]),_0x325386);if(_0x270698[_0xa235('0x2e')][_0xa235('0x39')]){_0x2de835[_0xa235('0x36')]=_['merge'](_0x2de835[_0xa235('0x36')],{'$or':_[_0xa235('0x2c')](_0x325386,function(_0xc5222){if(_0xc5222[_0xa235('0x3a')]!==_0xa235('0x3b')){var _0x2eb8f3={};_0x2eb8f3[_0xc5222[_0xa235('0x29')]]={'$like':'%'+_0x270698['query'][_0xa235('0x39')]+'%'};return _0x2eb8f3;}})});}_0x2de835=_['merge']({},_0x2de835,_0x270698[_0xa235('0x3c')]);var _0x235dec={'where':_0x2de835[_0xa235('0x36')]};return db[_0xa235('0x3d')][_0xa235('0x21')](_0x235dec)[_0xa235('0x25')](function(_0x13d376){_0x34f99f[_0xa235('0x21')]=_0x13d376;if(_0x270698[_0xa235('0x2e')][_0xa235('0x3e')]){_0x2de835[_0xa235('0x3f')]=[{'all':!![]}];}return db['SalesforceField'][_0xa235('0x40')](_0x2de835);})[_0xa235('0x25')](function(_0x3ae12e){_0x34f99f[_0xa235('0x41')]=_0x3ae12e;return _0x34f99f;})[_0xa235('0x25')](respondWithFilteredResult(_0x1f6624,_0x2de835))['catch'](handleError(_0x1f6624,null));};exports[_0xa235('0x42')]=function(_0x1009de,_0x3f55cf){var _0x27b9a5={'raw':!![],'where':{'id':_0x1009de['params']['id']}},_0x264c28={};_0x264c28[_0xa235('0x30')]=_[_0xa235('0x43')](db['SalesforceField'][_0xa235('0x2d')]);_0x264c28[_0xa235('0x2e')]=_[_0xa235('0x43')](_0x1009de[_0xa235('0x2e')]);_0x264c28[_0xa235('0x37')]=_[_0xa235('0x2f')](_0x264c28['model'],_0x264c28[_0xa235('0x2e')]);_0x27b9a5[_0xa235('0x32')]=_[_0xa235('0x2f')](_0x264c28['model'],qs[_0xa235('0x31')](_0x1009de['query'][_0xa235('0x31')]));_0x27b9a5[_0xa235('0x32')]=_0x27b9a5[_0xa235('0x32')][_0xa235('0x44')]?_0x27b9a5['attributes']:_0x264c28[_0xa235('0x30')];if(_0x1009de['query'][_0xa235('0x3e')]){_0x27b9a5['include']=[{'all':!![]}];}_0x27b9a5=_[_0xa235('0x45')]({},_0x27b9a5,_0x1009de[_0xa235('0x3c')]);return db['SalesforceField'][_0xa235('0x46')](_0x27b9a5)[_0xa235('0x25')](handleEntityNotFound(_0x3f55cf,null))[_0xa235('0x25')](respondWithResult(_0x3f55cf,null))[_0xa235('0x47')](handleError(_0x3f55cf,null));};exports['create']=function(_0x2d5fb8,_0x37a475){return db[_0xa235('0x3d')]['create'](_0x2d5fb8[_0xa235('0x48')],{})[_0xa235('0x25')](respondWithResult(_0x37a475,0xc9))['catch'](handleError(_0x37a475,null));};exports['update']=function(_0x2b8280,_0x5a182c){if(_0x2b8280['body']['id']){delete _0x2b8280[_0xa235('0x48')]['id'];}return db[_0xa235('0x3d')]['find']({'where':{'id':_0x2b8280[_0xa235('0x49')]['id']}})['then'](handleEntityNotFound(_0x5a182c,null))['then'](saveUpdates(_0x2b8280[_0xa235('0x48')],null))[_0xa235('0x25')](respondWithResult(_0x5a182c,null))[_0xa235('0x47')](handleError(_0x5a182c,null));};exports['destroy']=function(_0x2548ec,_0x1caf0c){return db[_0xa235('0x3d')][_0xa235('0x46')]({'where':{'id':_0x2548ec[_0xa235('0x49')]['id']}})['then'](handleEntityNotFound(_0x1caf0c,null))[_0xa235('0x25')](removeEntity(_0x1caf0c,null))[_0xa235('0x47')](handleError(_0x1caf0c,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 9a8ade5..ce495a2 100644 --- a/server/api/intSalesforceField/intSalesforceField.model.js +++ b/server/api/intSalesforceField/intSalesforceField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bc5=['request-promise','path','./intSalesforceField.attributes','exports','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','bluebird'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8bc5,0xd8));var _0x58bc=function(_0x577693,_0x5364f7){_0x577693=_0x577693-0x0;var _0xf68d7=_0x8bc5[_0x577693];return _0xf68d7;};'use strict';var _=require(_0x58bc('0x0'));var util=require(_0x58bc('0x1'));var logger=require(_0x58bc('0x2'))('api');var moment=require('moment');var BPromise=require(_0x58bc('0x3'));var rp=require(_0x58bc('0x4'));var fs=require('fs');var path=require(_0x58bc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x58bc('0x6'));module[_0x58bc('0x7')]=function(_0x519286,_0x3a8ffd){return _0x519286['define']('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x58bc('0x8'),'fields':[_0x58bc('0x9'),_0x58bc('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7839=['int_salesforce_fields','salesforce_unique_index','idField','FieldId','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField'];(function(_0x4cca92,_0x3b8aa7){var _0x15f2a2=function(_0x44316a){while(--_0x44316a){_0x4cca92['push'](_0x4cca92['shift']());}};_0x15f2a2(++_0x3b8aa7);}(_0x7839,0x74));var _0x9783=function(_0x5f3798,_0x15b758){_0x5f3798=_0x5f3798-0x0;var _0x1d979b=_0x7839[_0x5f3798];return _0x1d979b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9783('0x0'))(_0x9783('0x1'));var moment=require('moment');var BPromise=require(_0x9783('0x2'));var rp=require(_0x9783('0x3'));var fs=require('fs');var path=require(_0x9783('0x4'));var rimraf=require('rimraf');var config=require(_0x9783('0x5'));var attributes=require(_0x9783('0x6'));module[_0x9783('0x7')]=function(_0x5f4369,_0x59ba29){return _0x5f4369[_0x9783('0x8')](_0x9783('0x9'),attributes,{'tableName':_0x9783('0xa'),'paranoid':![],'indexes':[{'name':_0x9783('0xb'),'fields':[_0x9783('0xc'),_0x9783('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 75d21ba..110c288 100644 --- a/server/api/intSalesforceField/intSalesforceField.rpc.js +++ b/server/api/intSalesforceField/intSalesforceField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81ec=['error','code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x81ec,0x74));var _0xc81e=function(_0x3cba5e,_0x15dac9){_0x3cba5e=_0x3cba5e-0x0;var _0x312d63=_0x81ec[_0x3cba5e];return _0x312d63;};'use strict';var _=require(_0xc81e('0x0'));var util=require(_0xc81e('0x1'));var moment=require('moment');var BPromise=require(_0xc81e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc81e('0x3'));var db=require(_0xc81e('0x4'))['db'];var utils=require(_0xc81e('0x5'));var logger=require(_0xc81e('0x6'))(_0xc81e('0x7'));var config=require(_0xc81e('0x8'));var jayson=require(_0xc81e('0x9'));var client=jayson['client'][_0xc81e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8d3f6d,_0x325059,_0x5e8d40){return new BPromise(function(_0x4213df,_0x1f6fd9){return client[_0xc81e('0xb')](_0x8d3f6d,_0x5e8d40)['then'](function(_0x4769dc){logger[_0xc81e('0xc')]('SalesforceField,\x20%s,\x20%s',_0x325059,_0xc81e('0xd'));logger[_0xc81e('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x325059,'request\x20sent',JSON[_0xc81e('0xf')](_0x4769dc));if(_0x4769dc[_0xc81e('0x10')]){if(_0x4769dc['error'][_0xc81e('0x11')]===0x1f4){logger[_0xc81e('0x10')](_0xc81e('0x12'),_0x325059,_0x4769dc[_0xc81e('0x10')][_0xc81e('0x13')]);return _0x1f6fd9(_0x4769dc[_0xc81e('0x10')][_0xc81e('0x13')]);}logger[_0xc81e('0x10')](_0xc81e('0x12'),_0x325059,_0x4769dc['error']['message']);return _0x4213df(_0x4769dc['error'][_0xc81e('0x13')]);}else{logger[_0xc81e('0xc')](_0xc81e('0x12'),_0x325059,_0xc81e('0xd'));_0x4213df(_0x4769dc[_0xc81e('0x14')][_0xc81e('0x13')]);}})[_0xc81e('0x15')](function(_0x5990be){logger[_0xc81e('0x10')](_0xc81e('0x12'),_0x325059,_0x5990be);_0x1f6fd9(_0x5990be);});});} \ No newline at end of file +var _0x06ce=['jayson/promise','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4dfd2c,_0x23cb83){var _0x256e27=function(_0x46e542){while(--_0x46e542){_0x4dfd2c['push'](_0x4dfd2c['shift']());}};_0x256e27(++_0x23cb83);}(_0x06ce,0x1dc));var _0xe06c=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x06ce[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xe06c('0x0'));var util=require(_0xe06c('0x1'));var moment=require(_0xe06c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe06c('0x3'));var db=require(_0xe06c('0x4'))['db'];var utils=require(_0xe06c('0x5'));var logger=require(_0xe06c('0x6'))(_0xe06c('0x7'));var config=require('../../config/environment');var jayson=require(_0xe06c('0x8'));var client=jayson['client'][_0xe06c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25ea53,_0x556683,_0x52e0ee){return new BPromise(function(_0x554d62,_0x1d17f6){return client[_0xe06c('0xa')](_0x25ea53,_0x52e0ee)[_0xe06c('0xb')](function(_0x2048c3){logger[_0xe06c('0xc')](_0xe06c('0xd'),_0x556683,_0xe06c('0xe'));logger['debug'](_0xe06c('0xf'),_0x556683,_0xe06c('0xe'),JSON[_0xe06c('0x10')](_0x2048c3));if(_0x2048c3[_0xe06c('0x11')]){if(_0x2048c3[_0xe06c('0x11')][_0xe06c('0x12')]===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x556683,_0x2048c3[_0xe06c('0x11')][_0xe06c('0x13')]);return _0x1d17f6(_0x2048c3[_0xe06c('0x11')]['message']);}logger[_0xe06c('0x11')]('SalesforceField,\x20%s,\x20%s',_0x556683,_0x2048c3[_0xe06c('0x11')]['message']);return _0x554d62(_0x2048c3['error'][_0xe06c('0x13')]);}else{logger[_0xe06c('0xc')](_0xe06c('0xd'),_0x556683,_0xe06c('0xe'));_0x554d62(_0x2048c3[_0xe06c('0x14')][_0xe06c('0x13')]);}})[_0xe06c('0x15')](function(_0x272b4b){logger['error']('SalesforceField,\x20%s,\x20%s',_0x556683,_0x272b4b);_0x1d17f6(_0x272b4b);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index a973dd6..a4fcdcd 100644 --- a/server/api/intServicenowAccount/index.js +++ b/server/api/intServicenowAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2cbd=['../../components/interaction/service','get','isAuthenticated','index','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','put','/:id','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x176a4d,_0xa2aa0){var _0x40923a=function(_0x2dd930){while(--_0x2dd930){_0x176a4d['push'](_0x176a4d['shift']());}};_0x40923a(++_0xa2aa0);}(_0x2cbd,0x19e));var _0xd2cb=function(_0x3f4cd0,_0x303070){_0x3f4cd0=_0x3f4cd0-0x0;var _0x3f9f01=_0x2cbd[_0x3f4cd0];return _0x3f9f01;};'use strict';var multer=require(_0xd2cb('0x0'));var util=require(_0xd2cb('0x1'));var path=require('path');var timeout=require(_0xd2cb('0x2'));var express=require(_0xd2cb('0x3'));var router=express[_0xd2cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd2cb('0x5'));var interaction=require(_0xd2cb('0x6'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router[_0xd2cb('0x7')]('/',auth[_0xd2cb('0x8')](),controller[_0xd2cb('0x9')]);router[_0xd2cb('0x7')]('/:id',auth[_0xd2cb('0x8')](),controller['show']);router[_0xd2cb('0x7')]('/:id/configurations',auth[_0xd2cb('0x8')](),controller[_0xd2cb('0xa')]);router['get'](_0xd2cb('0xb'),auth[_0xd2cb('0x8')](),controller['getFields']);router[_0xd2cb('0xc')]('/',auth[_0xd2cb('0x8')](),controller[_0xd2cb('0xd')]);router[_0xd2cb('0xc')](_0xd2cb('0xe'),auth['isAuthenticated'](),controller[_0xd2cb('0xf')]);router[_0xd2cb('0x10')](_0xd2cb('0x11'),auth[_0xd2cb('0x8')](),controller[_0xd2cb('0x12')]);router['delete'](_0xd2cb('0x11'),auth[_0xd2cb('0x8')](),controller[_0xd2cb('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0747=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','destroy','exports','multer','util','path'];(function(_0x2e337f,_0x49b153){var _0x36d2c0=function(_0x37c866){while(--_0x37c866){_0x2e337f['push'](_0x2e337f['shift']());}};_0x36d2c0(++_0x49b153);}(_0x0747,0x97));var _0x7074=function(_0x1d8fa3,_0x79661c){_0x1d8fa3=_0x1d8fa3-0x0;var _0x208a95=_0x0747[_0x1d8fa3];return _0x208a95;};'use strict';var multer=require(_0x7074('0x0'));var util=require(_0x7074('0x1'));var path=require(_0x7074('0x2'));var timeout=require(_0x7074('0x3'));var express=require(_0x7074('0x4'));var router=express[_0x7074('0x5')]();var fs_extra=require(_0x7074('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7074('0x7'));var config=require(_0x7074('0x8'));var controller=require(_0x7074('0x9'));router[_0x7074('0xa')]('/',auth[_0x7074('0xb')](),controller['index']);router[_0x7074('0xa')](_0x7074('0xc'),auth[_0x7074('0xb')](),controller[_0x7074('0xd')]);router['get'](_0x7074('0xe'),auth[_0x7074('0xb')](),controller[_0x7074('0xf')]);router['get']('/:id/fields',auth[_0x7074('0xb')](),controller[_0x7074('0x10')]);router[_0x7074('0x11')]('/',auth[_0x7074('0xb')](),controller['create']);router[_0x7074('0x11')](_0x7074('0xe'),auth[_0x7074('0xb')](),controller[_0x7074('0x12')]);router[_0x7074('0x13')](_0x7074('0xc'),auth[_0x7074('0xb')](),controller['update']);router['delete']('/:id',auth[_0x7074('0xb')](),controller[_0x7074('0x14')]);module[_0x7074('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 8ffe61b..8e8ca12 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.attributes.js +++ b/server/api/intServicenowAccount/intServicenowAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c5b=['exports','STRING','username','remoteUri','sequelize'];(function(_0x58e8bd,_0x541ca5){var _0x381af9=function(_0x10a1d6){while(--_0x10a1d6){_0x58e8bd['push'](_0x58e8bd['shift']());}};_0x381af9(++_0x541ca5);}(_0x7c5b,0x171));var _0xb7c5=function(_0x1439bf,_0x2a4e32){_0x1439bf=_0x1439bf-0x0;var _0x1801f9=_0x7c5b[_0x1439bf];return _0x1801f9;};'use strict';var Sequelize=require(_0xb7c5('0x0'));module[_0xb7c5('0x1')]={'name':{'type':Sequelize[_0xb7c5('0x2')]},'description':{'type':Sequelize[_0xb7c5('0x2')]},'username':{'type':Sequelize[_0xb7c5('0x2')],'unique':_0xb7c5('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xb7c5('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xb7c5('0x4')},'serverUrl':{'type':Sequelize[_0xb7c5('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1dff=['username','remoteUri','sequelize','exports','STRING'];(function(_0x5312b7,_0x9961e2){var _0x3ddee2=function(_0x1d64ed){while(--_0x1d64ed){_0x5312b7['push'](_0x5312b7['shift']());}};_0x3ddee2(++_0x9961e2);}(_0x1dff,0x8e));var _0xf1df=function(_0x1d16c0,_0x5c30b4){_0x1d16c0=_0x1d16c0-0x0;var _0xb017b3=_0x1dff[_0x1d16c0];return _0xb017b3;};'use strict';var Sequelize=require(_0xf1df('0x0'));module[_0xf1df('0x1')]={'name':{'type':Sequelize[_0xf1df('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf1df('0x2')],'unique':_0xf1df('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf1df('0x2')]},'remoteUri':{'type':Sequelize[_0xf1df('0x2')],'unique':_0xf1df('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index a0b0d6d..79878ad 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.controller.js +++ b/server/api/intServicenowAccount/intServicenowAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc58=['findOne','ServicenowConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','Subjects','made_sla','hold_reason','subcategory','close_code','severity','category','parent','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','correlation_display','work_start','assignment_group','business_stc','description','notify','sys_class_name','close_notes','parent_incident','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','email','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','assign','includes','forEach','label','push','all','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','test','statusCode','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','ServicenowAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','getConfigurations'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xfc58,0x1c1));var _0x8fc5=function(_0x7eb3ad,_0x571c4e){_0x7eb3ad=_0x7eb3ad-0x0;var _0x19816b=_0xfc58[_0x7eb3ad];return _0x19816b;};'use strict';var emlformat=require(_0x8fc5('0x0'));var rimraf=require(_0x8fc5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8fc5('0x2'));var moment=require(_0x8fc5('0x3'));var BPromise=require(_0x8fc5('0x4'));var Mustache=require('mustache');var util=require(_0x8fc5('0x5'));var path=require('path');var sox=require(_0x8fc5('0x6'));var csv=require(_0x8fc5('0x7'));var ejs=require(_0x8fc5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8fc5('0x9'));var squel=require(_0x8fc5('0xa'));var crypto=require(_0x8fc5('0xb'));var jsforce=require(_0x8fc5('0xc'));var deskjs=require(_0x8fc5('0xd'));var toCsv=require(_0x8fc5('0x7'));var querystring=require(_0x8fc5('0xe'));var Papa=require(_0x8fc5('0xf'));var Redis=require('ioredis');var authService=require(_0x8fc5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8fc5('0x11'));var hardwareService=require(_0x8fc5('0x12'));var logger=require(_0x8fc5('0x13'))(_0x8fc5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8fc5('0x15'));var db=require(_0x8fc5('0x16'))['db'];var integrations=require(_0x8fc5('0x17'));function respondWithStatusCode(_0x474c7c,_0x44c747){_0x44c747=_0x44c747||0xcc;return function(_0x6db857){if(_0x6db857){return _0x474c7c[_0x8fc5('0x18')](_0x44c747);}return _0x474c7c[_0x8fc5('0x19')](_0x44c747)[_0x8fc5('0x1a')]();};}function respondWithResult(_0xb77bdf,_0x567b29){_0x567b29=_0x567b29||0xc8;return function(_0x49e8a1){if(_0x49e8a1){return _0xb77bdf[_0x8fc5('0x19')](_0x567b29)[_0x8fc5('0x1b')](_0x49e8a1);}};}function respondWithFilteredResult(_0x53a054,_0x5ea7ca){return function(_0x5e6581){if(_0x5e6581){var _0x5e04e2=typeof _0x5ea7ca[_0x8fc5('0x1c')]===_0x8fc5('0x1d')&&typeof _0x5ea7ca[_0x8fc5('0x1e')]==='undefined';var _0x4edbc5=_0x5e6581[_0x8fc5('0x1f')];var _0x20156b=_0x5e04e2?0x0:_0x5ea7ca[_0x8fc5('0x1c')];var _0x2305e9=_0x5e04e2?_0x5e6581[_0x8fc5('0x1f')]:_0x5ea7ca['offset']+_0x5ea7ca['limit'];var _0x5e21f2;if(_0x2305e9>=_0x4edbc5){_0x2305e9=_0x4edbc5;_0x5e21f2=0xc8;}else{_0x5e21f2=0xce;}_0x53a054[_0x8fc5('0x19')](_0x5e21f2);return _0x53a054['set'](_0x8fc5('0x20'),_0x20156b+'-'+_0x2305e9+'/'+_0x4edbc5)[_0x8fc5('0x1b')](_0x5e6581);}return null;};}function patchUpdates(_0x1dc57e){return function(_0x2c857a){try{jsonpatch[_0x8fc5('0x21')](_0x2c857a,_0x1dc57e,!![]);}catch(_0x16346e){return BPromise[_0x8fc5('0x22')](_0x16346e);}return _0x2c857a['save']();};}function saveUpdates(_0x5726c0,_0x24f197){return function(_0x385a4a){if(_0x385a4a){return _0x385a4a[_0x8fc5('0x23')](_0x5726c0)[_0x8fc5('0x24')](function(_0x35e509){return _0x35e509;});}return null;};}function removeEntity(_0x364231,_0x34b140){return function(_0x29dc72){if(_0x29dc72){return _0x29dc72[_0x8fc5('0x25')]()[_0x8fc5('0x24')](function(){_0x364231[_0x8fc5('0x19')](0xcc)[_0x8fc5('0x1a')]();});}};}function handleEntityNotFound(_0x34429e,_0x447821){return function(_0xa71486){if(!_0xa71486){_0x34429e[_0x8fc5('0x18')](0x194);}return _0xa71486;};}function handleError(_0x2873c9,_0x207de9){_0x207de9=_0x207de9||0x1f4;return function(_0xb0112c){logger[_0x8fc5('0x26')](_0xb0112c[_0x8fc5('0x27')]);if(_0xb0112c['name']){delete _0xb0112c[_0x8fc5('0x28')];}_0x2873c9[_0x8fc5('0x19')](_0x207de9)[_0x8fc5('0x29')](_0xb0112c);};}exports['index']=function(_0x4803e8,_0x5c8a87){var _0x339ca4={},_0x34c820={},_0x314eeb={'count':0x0,'rows':[]};var _0x573e79=_['map'](db[_0x8fc5('0x2a')][_0x8fc5('0x2b')],function(_0x86569d){return{'name':_0x86569d[_0x8fc5('0x2c')],'type':_0x86569d['type'][_0x8fc5('0x2d')]};});_0x34c820[_0x8fc5('0x2e')]=_['map'](_0x573e79,_0x8fc5('0x28'));_0x34c820[_0x8fc5('0x2f')]=_[_0x8fc5('0x30')](_0x4803e8['query']);_0x34c820[_0x8fc5('0x31')]=_[_0x8fc5('0x32')](_0x34c820[_0x8fc5('0x2e')],_0x34c820['query']);_0x339ca4[_0x8fc5('0x33')]=_['intersection'](_0x34c820[_0x8fc5('0x2e')],qs[_0x8fc5('0x34')](_0x4803e8[_0x8fc5('0x2f')]['fields']));_0x339ca4['attributes']=_0x339ca4[_0x8fc5('0x33')]['length']?_0x339ca4['attributes']:_0x34c820['model'];if(!_0x4803e8['query'][_0x8fc5('0x35')](_0x8fc5('0x36'))){_0x339ca4[_0x8fc5('0x1e')]=qs[_0x8fc5('0x1e')](_0x4803e8[_0x8fc5('0x2f')][_0x8fc5('0x1e')]);_0x339ca4['offset']=qs[_0x8fc5('0x1c')](_0x4803e8[_0x8fc5('0x2f')][_0x8fc5('0x1c')]);}_0x339ca4[_0x8fc5('0x37')]=qs[_0x8fc5('0x38')](_0x4803e8[_0x8fc5('0x2f')]['sort']);_0x339ca4[_0x8fc5('0x39')]=qs[_0x8fc5('0x31')](_[_0x8fc5('0x3a')](_0x4803e8[_0x8fc5('0x2f')],_0x34c820['filters']),_0x573e79);if(_0x4803e8[_0x8fc5('0x2f')][_0x8fc5('0x3b')]){_0x339ca4[_0x8fc5('0x39')]=_[_0x8fc5('0x3c')](_0x339ca4[_0x8fc5('0x39')],{'$or':_[_0x8fc5('0x3d')](_0x573e79,function(_0x4979c2){if(_0x4979c2[_0x8fc5('0x3e')]!=='VIRTUAL'){var _0x432ad7={};_0x432ad7[_0x4979c2['name']]={'$like':'%'+_0x4803e8[_0x8fc5('0x2f')]['filter']+'%'};return _0x432ad7;}})});}_0x339ca4=_[_0x8fc5('0x3c')]({},_0x339ca4,_0x4803e8[_0x8fc5('0x3f')]);var _0x53ccce={'where':_0x339ca4[_0x8fc5('0x39')]};return db[_0x8fc5('0x2a')][_0x8fc5('0x1f')](_0x53ccce)[_0x8fc5('0x24')](function(_0x53528f){_0x314eeb[_0x8fc5('0x1f')]=_0x53528f;if(_0x4803e8[_0x8fc5('0x2f')][_0x8fc5('0x40')]){_0x339ca4[_0x8fc5('0x41')]=[{'all':!![]}];}return db[_0x8fc5('0x2a')][_0x8fc5('0x42')](_0x339ca4);})[_0x8fc5('0x24')](function(_0x172c45){_0x314eeb[_0x8fc5('0x43')]=_0x172c45;return _0x314eeb;})[_0x8fc5('0x24')](respondWithFilteredResult(_0x5c8a87,_0x339ca4))[_0x8fc5('0x44')](handleError(_0x5c8a87,null));};exports[_0x8fc5('0x45')]=function(_0xb49562,_0x1e5d39){var _0x293758={'raw':![],'where':{'id':_0xb49562[_0x8fc5('0x46')]['id']}},_0x1cd1a0={};_0x1cd1a0[_0x8fc5('0x2e')]=_['keys'](db[_0x8fc5('0x2a')][_0x8fc5('0x2b')]);_0x1cd1a0[_0x8fc5('0x2f')]=_[_0x8fc5('0x30')](_0xb49562[_0x8fc5('0x2f')]);_0x1cd1a0[_0x8fc5('0x31')]=_[_0x8fc5('0x32')](_0x1cd1a0[_0x8fc5('0x2e')],_0x1cd1a0['query']);_0x293758[_0x8fc5('0x33')]=_[_0x8fc5('0x32')](_0x1cd1a0[_0x8fc5('0x2e')],qs[_0x8fc5('0x34')](_0xb49562['query']['fields']));_0x293758[_0x8fc5('0x33')]=_0x293758['attributes'][_0x8fc5('0x47')]?_0x293758[_0x8fc5('0x33')]:_0x1cd1a0[_0x8fc5('0x2e')];if(_0xb49562[_0x8fc5('0x2f')][_0x8fc5('0x40')]){_0x293758['include']=[{'all':!![]}];}_0x293758=_[_0x8fc5('0x3c')]({},_0x293758,_0xb49562[_0x8fc5('0x3f')]);return db['ServicenowAccount']['find'](_0x293758)[_0x8fc5('0x24')](handleEntityNotFound(_0x1e5d39,null))[_0x8fc5('0x24')](respondWithResult(_0x1e5d39,null))['catch'](handleError(_0x1e5d39,null));};exports[_0x8fc5('0x48')]=function(_0xb75b50,_0x2ba526){return db[_0x8fc5('0x2a')][_0x8fc5('0x48')](_0xb75b50[_0x8fc5('0x49')],{})['then'](respondWithResult(_0x2ba526,0xc9))[_0x8fc5('0x44')](handleError(_0x2ba526,null));};exports[_0x8fc5('0x23')]=function(_0x53eecb,_0x4fc4fc){if(_0x53eecb['body']['id']){delete _0x53eecb['body']['id'];}return db[_0x8fc5('0x2a')][_0x8fc5('0x4a')]({'where':{'id':_0x53eecb['params']['id']}})[_0x8fc5('0x24')](handleEntityNotFound(_0x4fc4fc,null))['then'](saveUpdates(_0x53eecb[_0x8fc5('0x49')],null))[_0x8fc5('0x24')](respondWithResult(_0x4fc4fc,null))[_0x8fc5('0x44')](handleError(_0x4fc4fc,null));};exports[_0x8fc5('0x25')]=function(_0x73f84e,_0x2913b9){return db[_0x8fc5('0x2a')][_0x8fc5('0x4a')]({'where':{'id':_0x73f84e['params']['id']}})[_0x8fc5('0x24')](handleEntityNotFound(_0x2913b9,null))[_0x8fc5('0x24')](removeEntity(_0x2913b9,null))['catch'](handleError(_0x2913b9,null));};exports[_0x8fc5('0x4b')]=function(_0x48af05,_0xa834dd,_0x380205){var _0x5a241f={};var _0x99d9f4={};var _0x1202ac;var _0x29375c;return db['ServicenowAccount'][_0x8fc5('0x4c')]({'where':{'id':_0x48af05[_0x8fc5('0x46')]['id']}})[_0x8fc5('0x24')](handleEntityNotFound(_0xa834dd,null))[_0x8fc5('0x24')](function(_0x16abc8){if(_0x16abc8){_0x1202ac=_0x16abc8;_0x99d9f4[_0x8fc5('0x2e')]=_[_0x8fc5('0x30')](db[_0x8fc5('0x4d')][_0x8fc5('0x2b')]);_0x99d9f4[_0x8fc5('0x2f')]=_['keys'](_0x48af05[_0x8fc5('0x2f')]);_0x99d9f4[_0x8fc5('0x31')]=_[_0x8fc5('0x32')](_0x99d9f4[_0x8fc5('0x2e')],_0x99d9f4[_0x8fc5('0x2f')]);_0x5a241f[_0x8fc5('0x33')]=_[_0x8fc5('0x32')](_0x99d9f4['model'],qs[_0x8fc5('0x34')](_0x48af05[_0x8fc5('0x2f')][_0x8fc5('0x34')]));_0x5a241f[_0x8fc5('0x33')]=_0x5a241f[_0x8fc5('0x33')][_0x8fc5('0x47')]?_0x5a241f[_0x8fc5('0x33')]:_0x99d9f4[_0x8fc5('0x2e')];_0x5a241f[_0x8fc5('0x37')]=qs[_0x8fc5('0x38')](_0x48af05[_0x8fc5('0x2f')][_0x8fc5('0x38')]);_0x5a241f[_0x8fc5('0x39')]=qs[_0x8fc5('0x31')](_[_0x8fc5('0x3a')](_0x48af05[_0x8fc5('0x2f')],_0x99d9f4['filters']));if(_0x48af05[_0x8fc5('0x2f')][_0x8fc5('0x3b')]){_0x5a241f[_0x8fc5('0x39')]=_[_0x8fc5('0x3c')](_0x5a241f['where'],{'$or':_[_0x8fc5('0x3d')](_0x5a241f[_0x8fc5('0x33')],function(_0x4907a3){var _0x3a073c={};_0x3a073c[_0x4907a3]={'$like':'%'+_0x48af05[_0x8fc5('0x2f')][_0x8fc5('0x3b')]+'%'};return _0x3a073c;})});}_0x5a241f=_[_0x8fc5('0x3c')]({},_0x5a241f,_0x48af05[_0x8fc5('0x3f')]);return _0x1202ac[_0x8fc5('0x4b')](_0x5a241f);}})[_0x8fc5('0x24')](function(_0x39193e){if(_0x39193e){_0x29375c=_0x39193e['length'];if(!_0x48af05[_0x8fc5('0x2f')]['hasOwnProperty'](_0x8fc5('0x36'))){_0x5a241f[_0x8fc5('0x1e')]=qs[_0x8fc5('0x1e')](_0x48af05['query'][_0x8fc5('0x1e')]);_0x5a241f[_0x8fc5('0x1c')]=qs[_0x8fc5('0x1c')](_0x48af05['query'][_0x8fc5('0x1c')]);}return _0x1202ac[_0x8fc5('0x4b')](_0x5a241f);}})[_0x8fc5('0x24')](function(_0x1a5218){if(_0x1a5218){return _0x1a5218?{'count':_0x29375c,'rows':_0x1a5218}:null;}})[_0x8fc5('0x24')](respondWithResult(_0xa834dd,null))[_0x8fc5('0x44')](handleError(_0xa834dd,null));};exports[_0x8fc5('0x4e')]=function(_0x50aad5,_0xca28ed,_0x4ec229){if(_0x50aad5[_0x8fc5('0x49')]['id']){delete _0x50aad5[_0x8fc5('0x49')]['id'];}return db[_0x8fc5('0x2a')][_0x8fc5('0x4c')]({'where':{'id':_0x50aad5['params']['id']}})[_0x8fc5('0x24')](handleEntityNotFound(_0xca28ed,null))['then'](function(_0xcbf213){if(_0xcbf213){_0x50aad5[_0x8fc5('0x49')][_0x8fc5('0x4f')]=_0xcbf213['id'];_0x50aad5['body']['Subjects']=integrations[_0x8fc5('0x50')](_0x50aad5[_0x8fc5('0x49')][_0x8fc5('0x51')],_0x50aad5[_0x8fc5('0x49')][_0x8fc5('0x3e')]);_0x50aad5['body'][_0x8fc5('0x52')]=integrations[_0x8fc5('0x53')](_0x50aad5[_0x8fc5('0x49')][_0x8fc5('0x51')],_0x50aad5[_0x8fc5('0x49')][_0x8fc5('0x3e')]);return db[_0x8fc5('0x4d')][_0x8fc5('0x48')](_0x50aad5[_0x8fc5('0x49')],{'include':[{'model':db[_0x8fc5('0x54')],'as':_0x8fc5('0x55')},{'model':db[_0x8fc5('0x54')],'as':_0x8fc5('0x52')}]});}return null;})[_0x8fc5('0x24')](respondWithResult(_0xca28ed,null))['catch'](handleError(_0xca28ed,null));};exports['getFields']=function(_0x371e98,_0x37189f,_0x5adcf5){var _0x1657b2=[_0x8fc5('0x56'),_0x8fc5('0x57'),'knowledge',_0x8fc5('0x58'),_0x8fc5('0x59'),'notify','incident_state',_0x8fc5('0x5a'),_0x8fc5('0x5b')];var _0x11e258=[_0x8fc5('0x5c'),_0x8fc5('0x56'),'caused_by','watch_list',_0x8fc5('0x5d'),_0x8fc5('0x5e'),_0x8fc5('0x5f'),'hold_reason',_0x8fc5('0x60'),_0x8fc5('0x61'),_0x8fc5('0x62'),'sys_updated_by',_0x8fc5('0x63'),'user_input',_0x8fc5('0x64'),_0x8fc5('0x65'),_0x8fc5('0x66'),_0x8fc5('0x67'),'knowledge','order',_0x8fc5('0x68'),'closed_at',_0x8fc5('0x69'),_0x8fc5('0x6a'),_0x8fc5('0x6b'),_0x8fc5('0x6c'),_0x8fc5('0x6d'),'business_service',_0x8fc5('0x6e'),'sys_domain_path',_0x8fc5('0x6f'),_0x8fc5('0x70'),_0x8fc5('0x71'),_0x8fc5('0x72'),_0x8fc5('0x73'),_0x8fc5('0x74'),_0x8fc5('0x75'),_0x8fc5('0x76'),_0x8fc5('0x77'),_0x8fc5('0x78'),'approval_set',_0x8fc5('0x58'),_0x8fc5('0x79'),'short_description',_0x8fc5('0x59'),_0x8fc5('0x7a'),'delivery_task',_0x8fc5('0x7b'),_0x8fc5('0x7c'),_0x8fc5('0x7d'),'additional_assignee_list',_0x8fc5('0x7e'),'calendar_duration',_0x8fc5('0x7f'),_0x8fc5('0x80'),_0x8fc5('0x81'),'closed_by','follow_up',_0x8fc5('0x82'),'sys_id','contact_type',_0x8fc5('0x83'),_0x8fc5('0x84'),_0x8fc5('0x85'),_0x8fc5('0x86'),_0x8fc5('0x87'),_0x8fc5('0x88'),_0x8fc5('0x89'),_0x8fc5('0x8a'),_0x8fc5('0x5a'),'comments',_0x8fc5('0x8b'),'approval','comments_and_work_notes',_0x8fc5('0x8c'),_0x8fc5('0x8d'),_0x8fc5('0x8e'),_0x8fc5('0x8f'),_0x8fc5('0x90'),_0x8fc5('0x91'),_0x8fc5('0x92'),_0x8fc5('0x93'),_0x8fc5('0x5b')];var _0x228c14='';var _0x1c273c='';var _0x19d0da=[];var _0x3e3eef='';var _0x4e5b5b='';var _0x37f633=[];var _0x2f0ba4='';var _0x3a7ca0='';var _0x56785d={};var _0x2d17da='';return db[_0x8fc5('0x2a')]['findOne']({'where':{'id':_0x371e98[_0x8fc5('0x46')]['id']},'attributes':['id',_0x8fc5('0x94'),'password',_0x8fc5('0x95'),_0x8fc5('0x96'),_0x8fc5('0x97')]})[_0x8fc5('0x24')](handleEntityNotFound(_0x37189f,null))[_0x8fc5('0x24')](function(_0x351158){if(_0x351158){_0x2d17da=_0x351158[_0x8fc5('0x96')];var _0x53b96c=_0x2d17da['slice'](-0x1);if(_0x53b96c==='/'){_0x2d17da=_0x2d17da[_0x8fc5('0x98')](0x0,_0x2d17da[_0x8fc5('0x99')](_0x53b96c));}_0x3a7ca0=util[_0x8fc5('0x9a')]('%s/api/now/doc/table/schema/',_0x2d17da);_0x2f0ba4=util[_0x8fc5('0x9a')](_0x8fc5('0x9b'),_0x2d17da);_0x56785d={'user':_0x351158[_0x8fc5('0x94')],'pass':_0x351158['password']};var _0x3ba7cf={'method':_0x8fc5('0x9c'),'uri':_0x3a7ca0+_0x8fc5('0x9d'),'auth':_0x56785d,'json':!![]};return rp(_0x3ba7cf);}})[_0x8fc5('0x24')](function(_0x383e73){if(_0x383e73[_0x8fc5('0x9e')][_0x8fc5('0x47')]>0x0){_0x228c14=_0x383e73[_0x8fc5('0x9e')];}console['log']('incident\x20table\x20objects',_0x228c14);_0x37f633=[];_0x1c273c=Object[_0x8fc5('0x9f')]([],_0x228c14);_['remove'](_0x1c273c,function(_0xe62b40){return!_0x1657b2[_0x8fc5('0xa0')](_0xe62b40[_0x8fc5('0x28')]);});_0x1c273c[_0x8fc5('0xa1')](function(_0x3ee0e8){var _0x2ebf10=createFieldObject(_0x2f0ba4,_0x56785d,_0x3ee0e8['internalType'],_0x3ee0e8[_0x8fc5('0x28')],_0x3ee0e8[_0x8fc5('0xa2')],![]);_0x37f633[_0x8fc5('0xa3')](_0x2ebf10);});return Promise[_0x8fc5('0xa4')](_0x37f633);})['then'](function(_0x5b6593){_0x19d0da=_0x5b6593;_0x3e3eef=Object[_0x8fc5('0x9f')]([],_0x228c14);console[_0x8fc5('0xa5')]('TCL:\x20_object',_0x228c14);_['remove'](_0x3e3eef,function(_0x51598b){return _0x11e258[_0x8fc5('0xa0')](_0x51598b['name']);});console[_0x8fc5('0xa5')](_0x8fc5('0xa6'),_0x3e3eef);_0x37f633=[];_0x3e3eef[_0x8fc5('0xa1')](function(_0x5e32db){var _0x5683d7=createFieldObject(_0x2f0ba4,_0x56785d,_0x5e32db['internalType'],_0x5e32db['name'],_0x5e32db[_0x8fc5('0xa2')],!![]);_0x37f633[_0x8fc5('0xa3')](_0x5683d7);});return Promise[_0x8fc5('0xa4')](_0x37f633);})[_0x8fc5('0x24')](function(_0x1a355f){_0x4e5b5b=_0x1a355f;var _0x7cc71c=_0x19d0da['concat'](_0x4e5b5b);return{'count':_0x7cc71c[_0x8fc5('0x47')],'rows':_0x7cc71c};})[_0x8fc5('0x24')](respondWithResult(_0x37189f,null))[_0x8fc5('0x44')](function(_0x51c0e4){console['log']('ServiceNow\x20error:\x20'+_0x51c0e4);var _0xf8e9ce=_0x371e98[_0x8fc5('0x2f')][_0x8fc5('0xa7')]?0x1f4:_0x51c0e4[_0x8fc5('0xa8')]||0x1f4;logger[_0x8fc5('0x26')](_0x51c0e4[_0x8fc5('0x27')]);delete _0x51c0e4[_0x8fc5('0x28')];if(_0xf8e9ce===0x191){_0xf8e9ce=0x190;}_0x37189f[_0x8fc5('0x19')](_0xf8e9ce)[_0x8fc5('0x29')](_0x371e98[_0x8fc5('0x2f')][_0x8fc5('0xa7')]?{'message':'Wrong\x20credentials','statusCode':_0x51c0e4[_0x8fc5('0xa8')]}:_0x51c0e4);});};function createFieldObject(_0x28b4f7,_0x1fd959,_0xc1f30d,_0x3da690,_0x3a9e5c,_0x57c8de){return new Promise(function(_0x288b4d,_0x5bd684){var _0x5e8aa0={'id':_0x3da690,'name':_0x3a9e5c,'custom':_0x57c8de};if(_0xc1f30d===_0x8fc5('0xa9')){_0x5e8aa0['options']=[{'name':_0x8fc5('0xaa'),'value':'true'},{'name':_0x8fc5('0xab'),'value':_0x8fc5('0xac')}];_0x288b4d(_0x5e8aa0);}else{var _0x3c202d={'method':_0x8fc5('0x9c'),'uri':_0x28b4f7+_0x8fc5('0xad')+_0x3da690,'auth':_0x1fd959,'json':!![]};return rp(_0x3c202d)[_0x8fc5('0x24')](function(_0x42e4d7){var _0x96d0de=[];if(_0x42e4d7['result'][_0x8fc5('0x47')]>0x0){_0x42e4d7[_0x8fc5('0x9e')][_0x8fc5('0xa1')](function(_0x1cc50e){if(_0x1cc50e[_0x8fc5('0xae')]===_0x8fc5('0xac')){var _0x585c0f={'name':_0x1cc50e[_0x8fc5('0xa2')],'value':_0x1cc50e['value']};_0x96d0de[_0x8fc5('0xa3')](_0x585c0f);}});}_0x5e8aa0['options']=_0x96d0de;if(_0x5e8aa0['options'][_0x8fc5('0x47')]>0x0){_0x288b4d(_0x5e8aa0);}else{if(_0x57c8de==![]){_0x288b4d();}else{_0x288b4d(_0x5e8aa0);}}});}});} \ No newline at end of file +var _0xbafc=['then','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','ServicenowConfiguration','getConfigurations','findOne','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','hold_reason','subcategory','close_code','incident_state','severity','parent','child_incidents','number','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','cmdb_ci','impact','active','work_notes_list','business_service','priority','rfc','time_worked','opened_at','business_duration','group_list','reopened_time','resolved_at','approval_set','work_notes','short_description','delivery_task','work_start','business_stc','description','calendar_duration','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','upon_approval','correlation_id','location','category','password','email','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','all','TCL:\x20_object','remove','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','true','false','inactive','value','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','error','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options'];(function(_0x1f09fa,_0x3265ca){var _0x197c8d=function(_0x91c3b){while(--_0x91c3b){_0x1f09fa['push'](_0x1f09fa['shift']());}};_0x197c8d(++_0x3265ca);}(_0xbafc,0x1c8));var _0xcbaf=function(_0x3efd98,_0x5a231a){_0x3efd98=_0x3efd98-0x0;var _0x3d99b7=_0xbafc[_0x3efd98];return _0x3d99b7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcbaf('0x0'));var jsonpatch=require(_0xcbaf('0x1'));var rp=require('request-promise');var moment=require(_0xcbaf('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xcbaf('0x3'));var sox=require(_0xcbaf('0x4'));var csv=require(_0xcbaf('0x5'));var ejs=require(_0xcbaf('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbaf('0x7'));var squel=require(_0xcbaf('0x8'));var crypto=require('crypto');var jsforce=require(_0xcbaf('0x9'));var deskjs=require(_0xcbaf('0xa'));var toCsv=require(_0xcbaf('0x5'));var querystring=require(_0xcbaf('0xb'));var Papa=require(_0xcbaf('0xc'));var Redis=require(_0xcbaf('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xcbaf('0xe'));var as=require(_0xcbaf('0xf'));var hardwareService=require(_0xcbaf('0x10'));var logger=require(_0xcbaf('0x11'))(_0xcbaf('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcbaf('0x13'))['db'];var integrations=require(_0xcbaf('0x14'));function respondWithStatusCode(_0x3d7899,_0xad7d3b){_0xad7d3b=_0xad7d3b||0xcc;return function(_0x294149){if(_0x294149){return _0x3d7899['sendStatus'](_0xad7d3b);}return _0x3d7899[_0xcbaf('0x15')](_0xad7d3b)['end']();};}function respondWithResult(_0x140d8f,_0x5a0533){_0x5a0533=_0x5a0533||0xc8;return function(_0x31330d){if(_0x31330d){return _0x140d8f[_0xcbaf('0x15')](_0x5a0533)[_0xcbaf('0x16')](_0x31330d);}};}function respondWithFilteredResult(_0x3838c0,_0x513004){return function(_0x1cb9c0){if(_0x1cb9c0){var _0xeb912c=typeof _0x513004[_0xcbaf('0x17')]===_0xcbaf('0x18')&&typeof _0x513004[_0xcbaf('0x19')]==='undefined';var _0x450d33=_0x1cb9c0[_0xcbaf('0x1a')];var _0x3036b3=_0xeb912c?0x0:_0x513004['offset'];var _0x33df1f=_0xeb912c?_0x1cb9c0[_0xcbaf('0x1a')]:_0x513004[_0xcbaf('0x17')]+_0x513004[_0xcbaf('0x19')];var _0x21ff13;if(_0x33df1f>=_0x450d33){_0x33df1f=_0x450d33;_0x21ff13=0xc8;}else{_0x21ff13=0xce;}_0x3838c0[_0xcbaf('0x15')](_0x21ff13);return _0x3838c0[_0xcbaf('0x1b')](_0xcbaf('0x1c'),_0x3036b3+'-'+_0x33df1f+'/'+_0x450d33)[_0xcbaf('0x16')](_0x1cb9c0);}return null;};}function patchUpdates(_0x5da568){return function(_0xb0dc44){try{jsonpatch[_0xcbaf('0x1d')](_0xb0dc44,_0x5da568,!![]);}catch(_0x4cea79){return BPromise[_0xcbaf('0x1e')](_0x4cea79);}return _0xb0dc44['save']();};}function saveUpdates(_0x562f6c,_0x181351){return function(_0x4be06d){if(_0x4be06d){return _0x4be06d[_0xcbaf('0x1f')](_0x562f6c)['then'](function(_0x2ccfa9){return _0x2ccfa9;});}return null;};}function removeEntity(_0x25971e,_0x1f84ee){return function(_0x4e28f2){if(_0x4e28f2){return _0x4e28f2['destroy']()['then'](function(){_0x25971e[_0xcbaf('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24a62f,_0x1ea64c){return function(_0x2a3ebd){if(!_0x2a3ebd){_0x24a62f['sendStatus'](0x194);}return _0x2a3ebd;};}function handleError(_0xb9d022,_0x5e6ac6){_0x5e6ac6=_0x5e6ac6||0x1f4;return function(_0x3ab4fa){logger[_0xcbaf('0x20')](_0x3ab4fa['stack']);if(_0x3ab4fa[_0xcbaf('0x21')]){delete _0x3ab4fa[_0xcbaf('0x21')];}_0xb9d022[_0xcbaf('0x15')](_0x5e6ac6)[_0xcbaf('0x22')](_0x3ab4fa);};}exports['index']=function(_0x5e1413,_0x4acc15){var _0x3b3eaa={},_0x52f43e={},_0x59c107={'count':0x0,'rows':[]};var _0x234195=_[_0xcbaf('0x23')](db[_0xcbaf('0x24')][_0xcbaf('0x25')],function(_0x18c575){return{'name':_0x18c575[_0xcbaf('0x26')],'type':_0x18c575[_0xcbaf('0x27')]['key']};});_0x52f43e['model']=_['map'](_0x234195,_0xcbaf('0x21'));_0x52f43e[_0xcbaf('0x28')]=_[_0xcbaf('0x29')](_0x5e1413[_0xcbaf('0x28')]);_0x52f43e[_0xcbaf('0x2a')]=_['intersection'](_0x52f43e[_0xcbaf('0x2b')],_0x52f43e['query']);_0x3b3eaa[_0xcbaf('0x2c')]=_[_0xcbaf('0x2d')](_0x52f43e[_0xcbaf('0x2b')],qs[_0xcbaf('0x2e')](_0x5e1413[_0xcbaf('0x28')][_0xcbaf('0x2e')]));_0x3b3eaa[_0xcbaf('0x2c')]=_0x3b3eaa[_0xcbaf('0x2c')][_0xcbaf('0x2f')]?_0x3b3eaa[_0xcbaf('0x2c')]:_0x52f43e[_0xcbaf('0x2b')];if(!_0x5e1413[_0xcbaf('0x28')][_0xcbaf('0x30')](_0xcbaf('0x31'))){_0x3b3eaa['limit']=qs[_0xcbaf('0x19')](_0x5e1413['query'][_0xcbaf('0x19')]);_0x3b3eaa[_0xcbaf('0x17')]=qs[_0xcbaf('0x17')](_0x5e1413['query'][_0xcbaf('0x17')]);}_0x3b3eaa[_0xcbaf('0x32')]=qs[_0xcbaf('0x33')](_0x5e1413['query'][_0xcbaf('0x33')]);_0x3b3eaa[_0xcbaf('0x34')]=qs[_0xcbaf('0x2a')](_[_0xcbaf('0x35')](_0x5e1413[_0xcbaf('0x28')],_0x52f43e[_0xcbaf('0x2a')]),_0x234195);if(_0x5e1413[_0xcbaf('0x28')][_0xcbaf('0x36')]){_0x3b3eaa[_0xcbaf('0x34')]=_[_0xcbaf('0x37')](_0x3b3eaa['where'],{'$or':_[_0xcbaf('0x23')](_0x234195,function(_0x3c76af){if(_0x3c76af[_0xcbaf('0x27')]!=='VIRTUAL'){var _0x45c29c={};_0x45c29c[_0x3c76af[_0xcbaf('0x21')]]={'$like':'%'+_0x5e1413[_0xcbaf('0x28')]['filter']+'%'};return _0x45c29c;}})});}_0x3b3eaa=_['merge']({},_0x3b3eaa,_0x5e1413[_0xcbaf('0x38')]);var _0x10631b={'where':_0x3b3eaa[_0xcbaf('0x34')]};return db[_0xcbaf('0x24')][_0xcbaf('0x1a')](_0x10631b)[_0xcbaf('0x39')](function(_0x327b9e){_0x59c107[_0xcbaf('0x1a')]=_0x327b9e;if(_0x5e1413[_0xcbaf('0x28')][_0xcbaf('0x3a')]){_0x3b3eaa[_0xcbaf('0x3b')]=[{'all':!![]}];}return db[_0xcbaf('0x24')][_0xcbaf('0x3c')](_0x3b3eaa);})[_0xcbaf('0x39')](function(_0x318a2f){_0x59c107[_0xcbaf('0x3d')]=_0x318a2f;return _0x59c107;})[_0xcbaf('0x39')](respondWithFilteredResult(_0x4acc15,_0x3b3eaa))[_0xcbaf('0x3e')](handleError(_0x4acc15,null));};exports[_0xcbaf('0x3f')]=function(_0x200ef3,_0x39a993){var _0x2de4f1={'raw':![],'where':{'id':_0x200ef3[_0xcbaf('0x40')]['id']}},_0x4e05a7={};_0x4e05a7['model']=_[_0xcbaf('0x29')](db[_0xcbaf('0x24')][_0xcbaf('0x25')]);_0x4e05a7[_0xcbaf('0x28')]=_[_0xcbaf('0x29')](_0x200ef3[_0xcbaf('0x28')]);_0x4e05a7[_0xcbaf('0x2a')]=_[_0xcbaf('0x2d')](_0x4e05a7['model'],_0x4e05a7[_0xcbaf('0x28')]);_0x2de4f1[_0xcbaf('0x2c')]=_[_0xcbaf('0x2d')](_0x4e05a7[_0xcbaf('0x2b')],qs['fields'](_0x200ef3[_0xcbaf('0x28')][_0xcbaf('0x2e')]));_0x2de4f1[_0xcbaf('0x2c')]=_0x2de4f1[_0xcbaf('0x2c')]['length']?_0x2de4f1[_0xcbaf('0x2c')]:_0x4e05a7['model'];if(_0x200ef3[_0xcbaf('0x28')]['includeAll']){_0x2de4f1[_0xcbaf('0x3b')]=[{'all':!![]}];}_0x2de4f1=_[_0xcbaf('0x37')]({},_0x2de4f1,_0x200ef3[_0xcbaf('0x38')]);return db[_0xcbaf('0x24')][_0xcbaf('0x41')](_0x2de4f1)[_0xcbaf('0x39')](handleEntityNotFound(_0x39a993,null))[_0xcbaf('0x39')](respondWithResult(_0x39a993,null))[_0xcbaf('0x3e')](handleError(_0x39a993,null));};exports[_0xcbaf('0x42')]=function(_0x5d007f,_0x261d23){return db[_0xcbaf('0x24')][_0xcbaf('0x42')](_0x5d007f[_0xcbaf('0x43')],{})[_0xcbaf('0x39')](respondWithResult(_0x261d23,0xc9))['catch'](handleError(_0x261d23,null));};exports['update']=function(_0xca83fc,_0x30cc1c){if(_0xca83fc[_0xcbaf('0x43')]['id']){delete _0xca83fc['body']['id'];}return db['ServicenowAccount'][_0xcbaf('0x41')]({'where':{'id':_0xca83fc[_0xcbaf('0x40')]['id']}})[_0xcbaf('0x39')](handleEntityNotFound(_0x30cc1c,null))[_0xcbaf('0x39')](saveUpdates(_0xca83fc[_0xcbaf('0x43')],null))['then'](respondWithResult(_0x30cc1c,null))[_0xcbaf('0x3e')](handleError(_0x30cc1c,null));};exports[_0xcbaf('0x44')]=function(_0x87aae5,_0x43252c){return db[_0xcbaf('0x24')][_0xcbaf('0x41')]({'where':{'id':_0x87aae5['params']['id']}})[_0xcbaf('0x39')](handleEntityNotFound(_0x43252c,null))[_0xcbaf('0x39')](removeEntity(_0x43252c,null))[_0xcbaf('0x3e')](handleError(_0x43252c,null));};exports['getConfigurations']=function(_0x1a90bd,_0x494da5,_0x25ecd0){var _0xab0e9d={};var _0x5a0114={};var _0x29ddf5;var _0x1a7d3b;return db[_0xcbaf('0x24')]['findOne']({'where':{'id':_0x1a90bd[_0xcbaf('0x40')]['id']}})[_0xcbaf('0x39')](handleEntityNotFound(_0x494da5,null))['then'](function(_0x424e0f){if(_0x424e0f){_0x29ddf5=_0x424e0f;_0x5a0114[_0xcbaf('0x2b')]=_[_0xcbaf('0x29')](db[_0xcbaf('0x45')][_0xcbaf('0x25')]);_0x5a0114[_0xcbaf('0x28')]=_[_0xcbaf('0x29')](_0x1a90bd['query']);_0x5a0114[_0xcbaf('0x2a')]=_[_0xcbaf('0x2d')](_0x5a0114[_0xcbaf('0x2b')],_0x5a0114[_0xcbaf('0x28')]);_0xab0e9d['attributes']=_[_0xcbaf('0x2d')](_0x5a0114[_0xcbaf('0x2b')],qs[_0xcbaf('0x2e')](_0x1a90bd[_0xcbaf('0x28')][_0xcbaf('0x2e')]));_0xab0e9d['attributes']=_0xab0e9d[_0xcbaf('0x2c')]['length']?_0xab0e9d['attributes']:_0x5a0114[_0xcbaf('0x2b')];_0xab0e9d[_0xcbaf('0x32')]=qs[_0xcbaf('0x33')](_0x1a90bd[_0xcbaf('0x28')][_0xcbaf('0x33')]);_0xab0e9d[_0xcbaf('0x34')]=qs[_0xcbaf('0x2a')](_[_0xcbaf('0x35')](_0x1a90bd[_0xcbaf('0x28')],_0x5a0114[_0xcbaf('0x2a')]));if(_0x1a90bd[_0xcbaf('0x28')][_0xcbaf('0x36')]){_0xab0e9d[_0xcbaf('0x34')]=_[_0xcbaf('0x37')](_0xab0e9d[_0xcbaf('0x34')],{'$or':_[_0xcbaf('0x23')](_0xab0e9d[_0xcbaf('0x2c')],function(_0x18d6e9){var _0x121e42={};_0x121e42[_0x18d6e9]={'$like':'%'+_0x1a90bd[_0xcbaf('0x28')][_0xcbaf('0x36')]+'%'};return _0x121e42;})});}_0xab0e9d=_[_0xcbaf('0x37')]({},_0xab0e9d,_0x1a90bd[_0xcbaf('0x38')]);return _0x29ddf5[_0xcbaf('0x46')](_0xab0e9d);}})[_0xcbaf('0x39')](function(_0x1379af){if(_0x1379af){_0x1a7d3b=_0x1379af[_0xcbaf('0x2f')];if(!_0x1a90bd[_0xcbaf('0x28')][_0xcbaf('0x30')](_0xcbaf('0x31'))){_0xab0e9d[_0xcbaf('0x19')]=qs[_0xcbaf('0x19')](_0x1a90bd[_0xcbaf('0x28')][_0xcbaf('0x19')]);_0xab0e9d[_0xcbaf('0x17')]=qs[_0xcbaf('0x17')](_0x1a90bd[_0xcbaf('0x28')][_0xcbaf('0x17')]);}return _0x29ddf5[_0xcbaf('0x46')](_0xab0e9d);}})[_0xcbaf('0x39')](function(_0x2b19c9){if(_0x2b19c9){return _0x2b19c9?{'count':_0x1a7d3b,'rows':_0x2b19c9}:null;}})['then'](respondWithResult(_0x494da5,null))['catch'](handleError(_0x494da5,null));};exports['addConfiguration']=function(_0x2a8ebc,_0x16bc57,_0x12ea13){if(_0x2a8ebc[_0xcbaf('0x43')]['id']){delete _0x2a8ebc['body']['id'];}return db[_0xcbaf('0x24')][_0xcbaf('0x47')]({'where':{'id':_0x2a8ebc[_0xcbaf('0x40')]['id']}})['then'](handleEntityNotFound(_0x16bc57,null))[_0xcbaf('0x39')](function(_0x1d28db){if(_0x1d28db){_0x2a8ebc[_0xcbaf('0x43')]['AccountId']=_0x1d28db['id'];_0x2a8ebc[_0xcbaf('0x43')][_0xcbaf('0x48')]=integrations[_0xcbaf('0x49')](_0x2a8ebc[_0xcbaf('0x43')][_0xcbaf('0x4a')],_0x2a8ebc[_0xcbaf('0x43')][_0xcbaf('0x27')]);_0x2a8ebc['body']['Descriptions']=integrations[_0xcbaf('0x4b')](_0x2a8ebc[_0xcbaf('0x43')]['channel'],_0x2a8ebc[_0xcbaf('0x43')]['type']);return db[_0xcbaf('0x45')][_0xcbaf('0x42')](_0x2a8ebc[_0xcbaf('0x43')],{'include':[{'model':db[_0xcbaf('0x4c')],'as':_0xcbaf('0x48')},{'model':db[_0xcbaf('0x4c')],'as':_0xcbaf('0x4d')}]});}return null;})[_0xcbaf('0x39')](respondWithResult(_0x16bc57,null))[_0xcbaf('0x3e')](handleError(_0x16bc57,null));};exports[_0xcbaf('0x4e')]=function(_0x4e11a3,_0x323199,_0x41e784){var _0x1d6c24=[_0xcbaf('0x4f'),_0xcbaf('0x50'),'knowledge',_0xcbaf('0x51'),_0xcbaf('0x52'),'notify',_0xcbaf('0x53'),_0xcbaf('0x54'),'category'];var _0x32b9fe=[_0xcbaf('0x55'),_0xcbaf('0x4f'),'caused_by','watch_list','upon_reject','sys_updated_on',_0xcbaf('0x56'),_0xcbaf('0x50'),'approval_history',_0xcbaf('0x57'),'resolved_by',_0xcbaf('0x58'),_0xcbaf('0x59'),_0xcbaf('0x5a'),_0xcbaf('0x5b'),_0xcbaf('0x5c'),_0xcbaf('0x5d'),_0xcbaf('0x5e'),_0xcbaf('0x5f'),_0xcbaf('0x32'),_0xcbaf('0x60'),'closed_at',_0xcbaf('0x61'),'delivery_plan',_0xcbaf('0x62'),_0xcbaf('0x63'),_0xcbaf('0x64'),_0xcbaf('0x65'),_0xcbaf('0x66'),'sys_domain_path',_0xcbaf('0x67'),_0xcbaf('0x68'),'expected_start',_0xcbaf('0x69'),_0xcbaf('0x6a'),_0xcbaf('0x6b'),'work_end',_0xcbaf('0x6c'),_0xcbaf('0x6d'),'caller_id',_0xcbaf('0x6e'),'subcategory',_0xcbaf('0x6f'),_0xcbaf('0x70'),_0xcbaf('0x52'),'correlation_display',_0xcbaf('0x71'),_0xcbaf('0x72'),'assignment_group',_0xcbaf('0x73'),'additional_assignee_list',_0xcbaf('0x74'),_0xcbaf('0x75'),'notify','sys_class_name',_0xcbaf('0x76'),_0xcbaf('0x77'),_0xcbaf('0x78'),'parent_incident',_0xcbaf('0x79'),_0xcbaf('0x7a'),_0xcbaf('0x7b'),_0xcbaf('0x53'),_0xcbaf('0x7c'),_0xcbaf('0x7d'),_0xcbaf('0x7e'),_0xcbaf('0x7f'),'activity_due','assigned_to',_0xcbaf('0x54'),'comments',_0xcbaf('0x80'),_0xcbaf('0x81'),_0xcbaf('0x82'),_0xcbaf('0x83'),_0xcbaf('0x84'),_0xcbaf('0x85'),'sys_tags','escalation',_0xcbaf('0x86'),_0xcbaf('0x87'),_0xcbaf('0x88'),_0xcbaf('0x89')];var _0x239911='';var _0x286987='';var _0x48769d=[];var _0x44e32d='';var _0x2046ce='';var _0x1e28a7=[];var _0x53c274='';var _0x3d6b8b='';var _0x4c6c1a={};var _0x2eec73='';return db[_0xcbaf('0x24')][_0xcbaf('0x47')]({'where':{'id':_0x4e11a3[_0xcbaf('0x40')]['id']},'attributes':['id','username',_0xcbaf('0x8a'),_0xcbaf('0x8b'),'remoteUri',_0xcbaf('0x8c')]})['then'](handleEntityNotFound(_0x323199,null))[_0xcbaf('0x39')](function(_0x253b84){if(_0x253b84){_0x2eec73=_0x253b84['remoteUri'];var _0x43781c=_0x2eec73[_0xcbaf('0x8d')](-0x1);if(_0x43781c==='/'){_0x2eec73=_0x2eec73[_0xcbaf('0x8e')](0x0,_0x2eec73[_0xcbaf('0x8f')](_0x43781c));}_0x3d6b8b=util[_0xcbaf('0x90')](_0xcbaf('0x91'),_0x2eec73);_0x53c274=util[_0xcbaf('0x90')](_0xcbaf('0x92'),_0x2eec73);_0x4c6c1a={'user':_0x253b84[_0xcbaf('0x93')],'pass':_0x253b84[_0xcbaf('0x8a')]};var _0x57aec2={'method':_0xcbaf('0x94'),'uri':_0x3d6b8b+_0xcbaf('0x95'),'auth':_0x4c6c1a,'json':!![]};return rp(_0x57aec2);}})[_0xcbaf('0x39')](function(_0xaead83){if(_0xaead83[_0xcbaf('0x96')][_0xcbaf('0x2f')]>0x0){_0x239911=_0xaead83[_0xcbaf('0x96')];}console[_0xcbaf('0x97')](_0xcbaf('0x98'),_0x239911);_0x1e28a7=[];_0x286987=Object[_0xcbaf('0x99')]([],_0x239911);_['remove'](_0x286987,function(_0x39fc85){return!_0x1d6c24[_0xcbaf('0x9a')](_0x39fc85[_0xcbaf('0x21')]);});_0x286987[_0xcbaf('0x9b')](function(_0x523c4f){var _0x47b2c4=createFieldObject(_0x53c274,_0x4c6c1a,_0x523c4f[_0xcbaf('0x9c')],_0x523c4f[_0xcbaf('0x21')],_0x523c4f[_0xcbaf('0x9d')],![]);_0x1e28a7[_0xcbaf('0x9e')](_0x47b2c4);});return Promise[_0xcbaf('0x9f')](_0x1e28a7);})[_0xcbaf('0x39')](function(_0x43baba){_0x48769d=_0x43baba;_0x44e32d=Object[_0xcbaf('0x99')]([],_0x239911);console[_0xcbaf('0x97')](_0xcbaf('0xa0'),_0x239911);_[_0xcbaf('0xa1')](_0x44e32d,function(_0x35ca86){return _0x32b9fe[_0xcbaf('0x9a')](_0x35ca86[_0xcbaf('0x21')]);});console[_0xcbaf('0x97')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x44e32d);_0x1e28a7=[];_0x44e32d[_0xcbaf('0x9b')](function(_0x25a080){var _0x508ac7=createFieldObject(_0x53c274,_0x4c6c1a,_0x25a080[_0xcbaf('0x9c')],_0x25a080[_0xcbaf('0x21')],_0x25a080[_0xcbaf('0x9d')],!![]);_0x1e28a7['push'](_0x508ac7);});return Promise[_0xcbaf('0x9f')](_0x1e28a7);})[_0xcbaf('0x39')](function(_0x41b5b1){_0x2046ce=_0x41b5b1;var _0x3720b4=_0x48769d[_0xcbaf('0xa2')](_0x2046ce);return{'count':_0x3720b4[_0xcbaf('0x2f')],'rows':_0x3720b4};})[_0xcbaf('0x39')](respondWithResult(_0x323199,null))[_0xcbaf('0x3e')](function(_0x44d3e4){console[_0xcbaf('0x97')](_0xcbaf('0xa3')+_0x44d3e4);var _0x2e2473=_0x4e11a3['query'][_0xcbaf('0xa4')]?0x1f4:_0x44d3e4[_0xcbaf('0xa5')]||0x1f4;logger[_0xcbaf('0x20')](_0x44d3e4['stack']);delete _0x44d3e4['name'];if(_0x2e2473===0x191){_0x2e2473=0x190;}_0x323199['status'](_0x2e2473)[_0xcbaf('0x22')](_0x4e11a3[_0xcbaf('0x28')][_0xcbaf('0xa4')]?{'message':_0xcbaf('0xa6'),'statusCode':_0x44d3e4[_0xcbaf('0xa5')]}:_0x44d3e4);});};function createFieldObject(_0x26612b,_0x29a35e,_0x3b734f,_0x5bc534,_0x5c3f81,_0x5d4057){return new Promise(function(_0x5d63ff,_0x277481){var _0x5096d9={'id':_0x5bc534,'name':_0x5c3f81,'custom':_0x5d4057};if(_0x3b734f==='boolean'){_0x5096d9[_0xcbaf('0x38')]=[{'name':'True','value':_0xcbaf('0xa7')},{'name':'False','value':_0xcbaf('0xa8')}];_0x5d63ff(_0x5096d9);}else{var _0x2acf51={'method':_0xcbaf('0x94'),'uri':_0x26612b+'sys_choice?sysparm_query=name=incident^element='+_0x5bc534,'auth':_0x29a35e,'json':!![]};return rp(_0x2acf51)[_0xcbaf('0x39')](function(_0x45debb){var _0x269d5e=[];if(_0x45debb[_0xcbaf('0x96')][_0xcbaf('0x2f')]>0x0){_0x45debb[_0xcbaf('0x96')][_0xcbaf('0x9b')](function(_0x40fc6e){if(_0x40fc6e[_0xcbaf('0xa9')]==='false'){var _0x48da96={'name':_0x40fc6e['label'],'value':_0x40fc6e[_0xcbaf('0xaa')]};_0x269d5e[_0xcbaf('0x9e')](_0x48da96);}});}_0x5096d9[_0xcbaf('0x38')]=_0x269d5e;if(_0x5096d9[_0xcbaf('0x38')][_0xcbaf('0x2f')]>0x0){_0x5d63ff(_0x5096d9);}else{if(_0x5d4057==![]){_0x5d63ff();}else{_0x5d63ff(_0x5096d9);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 7e3352b..32c6778 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.model.js +++ b/server/api/intServicenowAccount/intServicenowAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['api','moment','bluebird','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','../../config/logger'];(function(_0x42cc1f,_0xe9eb20){var _0x175df5=function(_0x2f3e22){while(--_0x2f3e22){_0x42cc1f['push'](_0x42cc1f['shift']());}};_0x175df5(++_0xe9eb20);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1ec3c8,_0x15eed1){_0x1ec3c8=_0x1ec3c8-0x0;var _0x212161=_0x1cb9[_0x1ec3c8];return _0x212161;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));var integrations=require(_0x91cb('0x8'));module[_0x91cb('0x9')]=function(_0x28543e,_0x3b9d98){return _0x28543e[_0x91cb('0xa')]('ServicenowAccount',attributes,{'tableName':_0x91cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d58=['request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','bluebird'];(function(_0x39efbf,_0x118364){var _0xcbd510=function(_0x4e152f){while(--_0x4e152f){_0x39efbf['push'](_0x39efbf['shift']());}};_0xcbd510(++_0x118364);}(_0x5d58,0x187));var _0x85d5=function(_0x3af196,_0x3f7545){_0x3af196=_0x3af196-0x0;var _0x5c7d11=_0x5d58[_0x3af196];return _0x5c7d11;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x85d5('0x4'));module[_0x85d5('0x5')]=function(_0x578fad,_0x46e7b4){return _0x578fad['define'](_0x85d5('0x6'),attributes,{'tableName':_0x85d5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 17c9d2d..47a29fc 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.rpc.js +++ b/server/api/intServicenowAccount/intServicenowAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e34=['raw','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','GetServicenowAccount','ServicenowAccount','findAll','options','attributes','limit','include','map','model','catch','ShowServicenowAccount','find'];(function(_0x4882dc,_0x1a6680){var _0x45257f=function(_0x4f1768){while(--_0x4f1768){_0x4882dc['push'](_0x4882dc['shift']());}};_0x45257f(++_0x1a6680);}(_0x0e34,0xb6));var _0x40e3=function(_0x52208e,_0x1e0e2b){_0x52208e=_0x52208e-0x0;var _0x1845be=_0x0e34[_0x52208e];return _0x1845be;};'use strict';var _=require(_0x40e3('0x0'));var util=require('util');var moment=require(_0x40e3('0x1'));var BPromise=require(_0x40e3('0x2'));var rs=require(_0x40e3('0x3'));var fs=require('fs');var Redis=require(_0x40e3('0x4'));var db=require(_0x40e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x40e3('0x6'));var config=require(_0x40e3('0x7'));var jayson=require(_0x40e3('0x8'));var client=jayson[_0x40e3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fc1a7,_0x42f76e,_0x2dd9d4){return new BPromise(function(_0x3f89da,_0x322212){return client[_0x40e3('0xa')](_0x1fc1a7,_0x2dd9d4)[_0x40e3('0xb')](function(_0x51645f){logger[_0x40e3('0xc')](_0x40e3('0xd'),_0x42f76e,_0x40e3('0xe'));logger[_0x40e3('0xf')](_0x40e3('0x10'),_0x42f76e,_0x40e3('0xe'),JSON[_0x40e3('0x11')](_0x51645f));if(_0x51645f['error']){if(_0x51645f['error'][_0x40e3('0x12')]===0x1f4){logger['error'](_0x40e3('0xd'),_0x42f76e,_0x51645f['error'][_0x40e3('0x13')]);return _0x322212(_0x51645f['error'][_0x40e3('0x13')]);}logger['error'](_0x40e3('0xd'),_0x42f76e,_0x51645f[_0x40e3('0x14')][_0x40e3('0x13')]);return _0x3f89da(_0x51645f[_0x40e3('0x14')][_0x40e3('0x13')]);}else{logger[_0x40e3('0xc')](_0x40e3('0xd'),_0x42f76e,_0x40e3('0xe'));_0x3f89da(_0x51645f[_0x40e3('0x15')][_0x40e3('0x13')]);}})['catch'](function(_0x2e43d2){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x42f76e,_0x2e43d2);_0x322212(_0x2e43d2);});});}exports[_0x40e3('0x16')]=function(_0x403e08){var _0x546939=this;return new Promise(function(_0xc15e5,_0x267fc3){return db[_0x40e3('0x17')][_0x40e3('0x18')]({'raw':_0x403e08['options']?_0x403e08[_0x40e3('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x403e08[_0x40e3('0x19')]?_0x403e08['options']['where']||null:null,'attributes':_0x403e08['options']?_0x403e08[_0x40e3('0x19')][_0x40e3('0x1a')]||null:null,'limit':_0x403e08[_0x40e3('0x19')]?_0x403e08[_0x40e3('0x19')][_0x40e3('0x1b')]||null:null,'include':_0x403e08['options']?_0x403e08[_0x40e3('0x19')][_0x40e3('0x1c')]?_[_0x40e3('0x1d')](_0x403e08[_0x40e3('0x19')][_0x40e3('0x1c')],function(_0x176782){return{'model':db[_0x176782[_0x40e3('0x1e')]],'as':_0x176782['as'],'attributes':_0x176782[_0x40e3('0x1a')],'include':_0x176782[_0x40e3('0x1c')]?_[_0x40e3('0x1d')](_0x176782[_0x40e3('0x1c')],function(_0x649ab9){return{'model':db[_0x649ab9['model']],'as':_0x649ab9['as'],'attributes':_0x649ab9[_0x40e3('0x1a')],'include':_0x649ab9[_0x40e3('0x1c')]?_[_0x40e3('0x1d')](_0x649ab9[_0x40e3('0x1c')],function(_0x28a7cd){return{'model':db[_0x28a7cd[_0x40e3('0x1e')]],'as':_0x28a7cd['as'],'attributes':_0x28a7cd[_0x40e3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x40e3('0xb')](function(_0xc95050){logger['info'](_0x40e3('0x16'),_0x403e08);logger[_0x40e3('0xf')]('GetServicenowAccount',_0x403e08,JSON[_0x40e3('0x11')](_0xc95050));_0xc15e5(_0xc95050);})[_0x40e3('0x1f')](function(_0x3c48e4){logger[_0x40e3('0x14')](_0x40e3('0x16'),_0x3c48e4[_0x40e3('0x13')],_0x403e08);_0x267fc3(_0x546939[_0x40e3('0x14')](0x1f4,_0x3c48e4[_0x40e3('0x13')]));});});};exports[_0x40e3('0x20')]=function(_0x4623da){var _0x5c71be=this;return new Promise(function(_0x171916,_0x2f86e0){return db[_0x40e3('0x17')][_0x40e3('0x21')]({'raw':_0x4623da[_0x40e3('0x19')]?_0x4623da[_0x40e3('0x19')][_0x40e3('0x22')]===undefined?!![]:![]:!![],'where':_0x4623da[_0x40e3('0x19')]?_0x4623da[_0x40e3('0x19')][_0x40e3('0x23')]||null:null,'attributes':_0x4623da[_0x40e3('0x19')]?_0x4623da['options'][_0x40e3('0x1a')]||null:null,'include':_0x4623da[_0x40e3('0x19')]?_0x4623da[_0x40e3('0x19')][_0x40e3('0x1c')]?_[_0x40e3('0x1d')](_0x4623da[_0x40e3('0x19')][_0x40e3('0x1c')],function(_0x140477){return{'model':db[_0x140477[_0x40e3('0x1e')]],'as':_0x140477['as'],'attributes':_0x140477['attributes'],'include':_0x140477[_0x40e3('0x1c')]?_[_0x40e3('0x1d')](_0x140477[_0x40e3('0x1c')],function(_0x2f2945){return{'model':db[_0x2f2945[_0x40e3('0x1e')]],'as':_0x2f2945['as'],'attributes':_0x2f2945[_0x40e3('0x1a')],'include':_0x2f2945[_0x40e3('0x1c')]?_[_0x40e3('0x1d')](_0x2f2945[_0x40e3('0x1c')],function(_0xc9fec6){return{'model':db[_0xc9fec6[_0x40e3('0x1e')]],'as':_0xc9fec6['as'],'attributes':_0xc9fec6[_0x40e3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x40e3('0xb')](function(_0x456a09){logger['info'](_0x40e3('0x20'),_0x4623da);logger['debug'](_0x40e3('0x20'),_0x4623da,JSON[_0x40e3('0x11')](_0x456a09));_0x171916(_0x456a09);})['catch'](function(_0x350ec5){logger[_0x40e3('0x14')](_0x40e3('0x20'),_0x350ec5[_0x40e3('0x13')],_0x4623da);_0x2f86e0(_0x5c71be[_0x40e3('0x14')](0x1f4,_0x350ec5[_0x40e3('0x13')]));});});}; \ No newline at end of file +var _0x7aee=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','limit','include','map','attributes','model','debug','ShowServicenowAccount','find','then','util','moment','bluebird','randomstring'];(function(_0x3fc48e,_0x59ca65){var _0x472328=function(_0x3ef99d){while(--_0x3ef99d){_0x3fc48e['push'](_0x3fc48e['shift']());}};_0x472328(++_0x59ca65);}(_0x7aee,0x9c));var _0xe7ae=function(_0x5e4c0a,_0x34f000){_0x5e4c0a=_0x5e4c0a-0x0;var _0x517c78=_0x7aee[_0x5e4c0a];return _0x517c78;};'use strict';var _=require('lodash');var util=require(_0xe7ae('0x0'));var moment=require(_0xe7ae('0x1'));var BPromise=require(_0xe7ae('0x2'));var rs=require(_0xe7ae('0x3'));var fs=require('fs');var Redis=require(_0xe7ae('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ae('0x5'));var logger=require(_0xe7ae('0x6'))('rpc');var config=require(_0xe7ae('0x7'));var jayson=require(_0xe7ae('0x8'));var client=jayson['client'][_0xe7ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f1f15,_0x91f4e4,_0x33c152){return new BPromise(function(_0x384cbc,_0x222e37){return client[_0xe7ae('0xa')](_0x4f1f15,_0x33c152)['then'](function(_0x1a4824){logger['info'](_0xe7ae('0xb'),_0x91f4e4,'request\x20sent');logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x91f4e4,_0xe7ae('0xc'),JSON[_0xe7ae('0xd')](_0x1a4824));if(_0x1a4824[_0xe7ae('0xe')]){if(_0x1a4824['error']['code']===0x1f4){logger[_0xe7ae('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x91f4e4,_0x1a4824['error'][_0xe7ae('0xf')]);return _0x222e37(_0x1a4824[_0xe7ae('0xe')][_0xe7ae('0xf')]);}logger[_0xe7ae('0xe')](_0xe7ae('0xb'),_0x91f4e4,_0x1a4824[_0xe7ae('0xe')][_0xe7ae('0xf')]);return _0x384cbc(_0x1a4824[_0xe7ae('0xe')][_0xe7ae('0xf')]);}else{logger[_0xe7ae('0x10')](_0xe7ae('0xb'),_0x91f4e4,_0xe7ae('0xc'));_0x384cbc(_0x1a4824['result'][_0xe7ae('0xf')]);}})[_0xe7ae('0x11')](function(_0x2617fb){logger['error'](_0xe7ae('0xb'),_0x91f4e4,_0x2617fb);_0x222e37(_0x2617fb);});});}exports[_0xe7ae('0x12')]=function(_0x13e814){var _0x115d50=this;return new Promise(function(_0x223acc,_0x836644){return db[_0xe7ae('0x13')]['findAll']({'raw':_0x13e814['options']?_0x13e814[_0xe7ae('0x14')][_0xe7ae('0x15')]===undefined?!![]:![]:!![],'where':_0x13e814['options']?_0x13e814[_0xe7ae('0x14')][_0xe7ae('0x16')]||null:null,'attributes':_0x13e814['options']?_0x13e814[_0xe7ae('0x14')]['attributes']||null:null,'limit':_0x13e814['options']?_0x13e814[_0xe7ae('0x14')][_0xe7ae('0x17')]||null:null,'include':_0x13e814[_0xe7ae('0x14')]?_0x13e814[_0xe7ae('0x14')][_0xe7ae('0x18')]?_[_0xe7ae('0x19')](_0x13e814['options']['include'],function(_0x5d544c){return{'model':db[_0x5d544c['model']],'as':_0x5d544c['as'],'attributes':_0x5d544c[_0xe7ae('0x1a')],'include':_0x5d544c[_0xe7ae('0x18')]?_[_0xe7ae('0x19')](_0x5d544c[_0xe7ae('0x18')],function(_0x10132b){return{'model':db[_0x10132b[_0xe7ae('0x1b')]],'as':_0x10132b['as'],'attributes':_0x10132b['attributes'],'include':_0x10132b[_0xe7ae('0x18')]?_[_0xe7ae('0x19')](_0x10132b[_0xe7ae('0x18')],function(_0x563ee1){return{'model':db[_0x563ee1[_0xe7ae('0x1b')]],'as':_0x563ee1['as'],'attributes':_0x563ee1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xf1b31){logger[_0xe7ae('0x10')]('GetServicenowAccount',_0x13e814);logger[_0xe7ae('0x1c')](_0xe7ae('0x12'),_0x13e814,JSON['stringify'](_0xf1b31));_0x223acc(_0xf1b31);})[_0xe7ae('0x11')](function(_0x486ac1){logger['error'](_0xe7ae('0x12'),_0x486ac1['message'],_0x13e814);_0x836644(_0x115d50[_0xe7ae('0xe')](0x1f4,_0x486ac1['message']));});});};exports[_0xe7ae('0x1d')]=function(_0x21577d){var _0x2fcc29=this;return new Promise(function(_0x4b8811,_0x402077){return db['ServicenowAccount'][_0xe7ae('0x1e')]({'raw':_0x21577d[_0xe7ae('0x14')]?_0x21577d[_0xe7ae('0x14')][_0xe7ae('0x15')]===undefined?!![]:![]:!![],'where':_0x21577d[_0xe7ae('0x14')]?_0x21577d[_0xe7ae('0x14')][_0xe7ae('0x16')]||null:null,'attributes':_0x21577d[_0xe7ae('0x14')]?_0x21577d[_0xe7ae('0x14')][_0xe7ae('0x1a')]||null:null,'include':_0x21577d['options']?_0x21577d[_0xe7ae('0x14')][_0xe7ae('0x18')]?_[_0xe7ae('0x19')](_0x21577d['options'][_0xe7ae('0x18')],function(_0x4c769b){return{'model':db[_0x4c769b[_0xe7ae('0x1b')]],'as':_0x4c769b['as'],'attributes':_0x4c769b[_0xe7ae('0x1a')],'include':_0x4c769b['include']?_[_0xe7ae('0x19')](_0x4c769b[_0xe7ae('0x18')],function(_0x2e69b6){return{'model':db[_0x2e69b6[_0xe7ae('0x1b')]],'as':_0x2e69b6['as'],'attributes':_0x2e69b6['attributes'],'include':_0x2e69b6[_0xe7ae('0x18')]?_[_0xe7ae('0x19')](_0x2e69b6[_0xe7ae('0x18')],function(_0x3897ed){return{'model':db[_0x3897ed[_0xe7ae('0x1b')]],'as':_0x3897ed['as'],'attributes':_0x3897ed[_0xe7ae('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe7ae('0x1f')](function(_0x6a12cc){logger[_0xe7ae('0x10')](_0xe7ae('0x1d'),_0x21577d);logger['debug'](_0xe7ae('0x1d'),_0x21577d,JSON[_0xe7ae('0xd')](_0x6a12cc));_0x4b8811(_0x6a12cc);})[_0xe7ae('0x11')](function(_0x1c2adc){logger[_0xe7ae('0xe')](_0xe7ae('0x1d'),_0x1c2adc[_0xe7ae('0xf')],_0x21577d);_0x402077(_0x2fcc29['error'](0x1f4,_0x1c2adc['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index ff0905a..6d6b249 100644 --- a/server/api/intServicenowConfiguration/index.js +++ b/server/api/intServicenowConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8d6=['show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa8d6,0x8e));var _0x6a8d=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa8d6[_0x4709c0];return _0x13348b;};'use strict';var multer=require(_0x6a8d('0x0'));var util=require(_0x6a8d('0x1'));var path=require(_0x6a8d('0x2'));var timeout=require(_0x6a8d('0x3'));var express=require(_0x6a8d('0x4'));var router=express[_0x6a8d('0x5')]();var fs_extra=require(_0x6a8d('0x6'));var auth=require(_0x6a8d('0x7'));var interaction=require(_0x6a8d('0x8'));var config=require('../../config/environment');var controller=require(_0x6a8d('0x9'));router[_0x6a8d('0xa')]('/',auth[_0x6a8d('0xb')](),controller[_0x6a8d('0xc')]);router[_0x6a8d('0xa')](_0x6a8d('0xd'),auth[_0x6a8d('0xb')](),controller[_0x6a8d('0xe')]);router[_0x6a8d('0xa')]('/:id/fields',auth[_0x6a8d('0xb')](),controller[_0x6a8d('0xf')]);router[_0x6a8d('0xa')](_0x6a8d('0x10'),auth[_0x6a8d('0xb')](),controller[_0x6a8d('0x11')]);router[_0x6a8d('0xa')](_0x6a8d('0x12'),auth[_0x6a8d('0xb')](),controller[_0x6a8d('0x13')]);router[_0x6a8d('0x14')]('/',auth[_0x6a8d('0xb')](),controller[_0x6a8d('0x15')]);router[_0x6a8d('0x16')](_0x6a8d('0xd'),auth[_0x6a8d('0xb')](),controller[_0x6a8d('0x17')]);router[_0x6a8d('0x18')](_0x6a8d('0xd'),auth[_0x6a8d('0xb')](),controller['destroy']);module[_0x6a8d('0x19')]=router; \ No newline at end of file +var _0xa3d2=['/:id','isAuthenticated','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intServicenowConfiguration.controller','get','index'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa3d2,0x194));var _0x2a3d=function(_0x27d8bc,_0x19e010){_0x27d8bc=_0x27d8bc-0x0;var _0x4b04cb=_0xa3d2[_0x27d8bc];return _0x4b04cb;};'use strict';var multer=require(_0x2a3d('0x0'));var util=require(_0x2a3d('0x1'));var path=require('path');var timeout=require(_0x2a3d('0x2'));var express=require(_0x2a3d('0x3'));var router=express[_0x2a3d('0x4')]();var fs_extra=require(_0x2a3d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2a3d('0x6'));var config=require('../../config/environment');var controller=require(_0x2a3d('0x7'));router[_0x2a3d('0x8')]('/',auth['isAuthenticated'](),controller[_0x2a3d('0x9')]);router[_0x2a3d('0x8')](_0x2a3d('0xa'),auth[_0x2a3d('0xb')](),controller[_0x2a3d('0xc')]);router['get'](_0x2a3d('0xd'),auth['isAuthenticated'](),controller[_0x2a3d('0xe')]);router[_0x2a3d('0x8')]('/:id/subjects',auth[_0x2a3d('0xb')](),controller['getSubjects']);router['get'](_0x2a3d('0xf'),auth['isAuthenticated'](),controller[_0x2a3d('0x10')]);router[_0x2a3d('0x11')]('/',auth[_0x2a3d('0xb')](),controller['create']);router[_0x2a3d('0x12')](_0x2a3d('0xa'),auth[_0x2a3d('0xb')](),controller[_0x2a3d('0x13')]);router[_0x2a3d('0x14')](_0x2a3d('0xa'),auth['isAuthenticated'](),controller[_0x2a3d('0x15')]);module[_0x2a3d('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 8120c20..29fc7ac 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed0a=['STRING','sequelize','exports'];(function(_0x21dfb3,_0x62390f){var _0x497b00=function(_0x176eb9){while(--_0x176eb9){_0x21dfb3['push'](_0x21dfb3['shift']());}};_0x497b00(++_0x62390f);}(_0xed0a,0x115));var _0xaed0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xed0a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaed0('0x0'));module[_0xaed0('0x1')]={'name':{'type':Sequelize[_0xaed0('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2705=['STRING','sequelize','exports'];(function(_0x1f8eb8,_0xfc4345){var _0x37ca05=function(_0x4595e2){while(--_0x4595e2){_0x1f8eb8['push'](_0x1f8eb8['shift']());}};_0x37ca05(++_0xfc4345);}(_0x2705,0xeb));var _0x5270=function(_0x28c21d,_0x1abbaa){_0x28c21d=_0x28c21d-0x0;var _0x4b0712=_0x2705[_0x28c21d];return _0x4b0712;};'use strict';var Sequelize=require(_0x5270('0x0'));module[_0x5270('0x1')]={'name':{'type':Sequelize[_0x5270('0x2')]},'description':{'type':Sequelize[_0x5270('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 92436c4..b626cd5 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x65ed=['filter','merge','VIRTUAL','options','ServicenowConfiguration','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getFields','ServicenowField','order','findOne','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','save','update','then','destroy','stack','name','send','map','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x4a991d,_0x497a6a){var _0x2ae61f=function(_0x121729){while(--_0x121729){_0x4a991d['push'](_0x4a991d['shift']());}};_0x2ae61f(++_0x497a6a);}(_0x65ed,0xfd));var _0xd65e=function(_0x462f2b,_0x337220){_0x462f2b=_0x462f2b-0x0;var _0x1308e7=_0x65ed[_0x462f2b];return _0x1308e7;};'use strict';var emlformat=require(_0xd65e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd65e('0x1'));var jsonpatch=require(_0xd65e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd65e('0x3'));var util=require(_0xd65e('0x4'));var path=require(_0xd65e('0x5'));var sox=require('sox');var csv=require(_0xd65e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd65e('0x7'));var squel=require(_0xd65e('0x8'));var crypto=require(_0xd65e('0x9'));var jsforce=require(_0xd65e('0xa'));var deskjs=require(_0xd65e('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd65e('0xc'));var Papa=require(_0xd65e('0xd'));var Redis=require(_0xd65e('0xe'));var authService=require(_0xd65e('0xf'));var qs=require(_0xd65e('0x10'));var as=require(_0xd65e('0x11'));var hardwareService=require(_0xd65e('0x12'));var logger=require(_0xd65e('0x13'))(_0xd65e('0x14'));var utils=require(_0xd65e('0x15'));var config=require(_0xd65e('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4edb66,_0x35062b){_0x35062b=_0x35062b||0xcc;return function(_0x46e489){if(_0x46e489){return _0x4edb66[_0xd65e('0x17')](_0x35062b);}return _0x4edb66[_0xd65e('0x18')](_0x35062b)[_0xd65e('0x19')]();};}function respondWithResult(_0x1973eb,_0xd794a7){_0xd794a7=_0xd794a7||0xc8;return function(_0x36f722){if(_0x36f722){return _0x1973eb[_0xd65e('0x18')](_0xd794a7)[_0xd65e('0x1a')](_0x36f722);}};}function respondWithFilteredResult(_0xbef9e3,_0x2a3942){return function(_0x32a95e){if(_0x32a95e){var _0x49c29c=typeof _0x2a3942[_0xd65e('0x1b')]===_0xd65e('0x1c')&&typeof _0x2a3942[_0xd65e('0x1d')]===_0xd65e('0x1c');var _0x5c23b7=_0x32a95e[_0xd65e('0x1e')];var _0x162851=_0x49c29c?0x0:_0x2a3942[_0xd65e('0x1b')];var _0x20b1d4=_0x49c29c?_0x32a95e[_0xd65e('0x1e')]:_0x2a3942[_0xd65e('0x1b')]+_0x2a3942['limit'];var _0x182946;if(_0x20b1d4>=_0x5c23b7){_0x20b1d4=_0x5c23b7;_0x182946=0xc8;}else{_0x182946=0xce;}_0xbef9e3[_0xd65e('0x18')](_0x182946);return _0xbef9e3['set']('Content-Range',_0x162851+'-'+_0x20b1d4+'/'+_0x5c23b7)[_0xd65e('0x1a')](_0x32a95e);}return null;};}function patchUpdates(_0x2b8a90){return function(_0x527d1b){try{jsonpatch['apply'](_0x527d1b,_0x2b8a90,!![]);}catch(_0x10c59c){return BPromise['reject'](_0x10c59c);}return _0x527d1b[_0xd65e('0x1f')]();};}function saveUpdates(_0xec2daf,_0x559335){return function(_0x75e501){if(_0x75e501){return _0x75e501[_0xd65e('0x20')](_0xec2daf)[_0xd65e('0x21')](function(_0x51a3e3){return _0x51a3e3;});}return null;};}function removeEntity(_0x42a501,_0x3df74e){return function(_0x12a31b){if(_0x12a31b){return _0x12a31b[_0xd65e('0x22')]()[_0xd65e('0x21')](function(){_0x42a501['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b6095,_0x54eec2){return function(_0x5c9870){if(!_0x5c9870){_0x2b6095[_0xd65e('0x17')](0x194);}return _0x5c9870;};}function handleError(_0x1afa4b,_0x3fbc91){_0x3fbc91=_0x3fbc91||0x1f4;return function(_0x2fb875){logger['error'](_0x2fb875[_0xd65e('0x23')]);if(_0x2fb875[_0xd65e('0x24')]){delete _0x2fb875[_0xd65e('0x24')];}_0x1afa4b[_0xd65e('0x18')](_0x3fbc91)[_0xd65e('0x25')](_0x2fb875);};}exports['index']=function(_0x108e05,_0x1b5646){var _0x61e561={},_0x2de7e7={},_0x3e4611={'count':0x0,'rows':[]};var _0x511019=_[_0xd65e('0x26')](db['ServicenowConfiguration']['rawAttributes'],function(_0x4d1c18){return{'name':_0x4d1c18[_0xd65e('0x27')],'type':_0x4d1c18[_0xd65e('0x28')][_0xd65e('0x29')]};});_0x2de7e7['model']=_[_0xd65e('0x26')](_0x511019,_0xd65e('0x24'));_0x2de7e7['query']=_[_0xd65e('0x2a')](_0x108e05[_0xd65e('0x2b')]);_0x2de7e7[_0xd65e('0x2c')]=_[_0xd65e('0x2d')](_0x2de7e7[_0xd65e('0x2e')],_0x2de7e7[_0xd65e('0x2b')]);_0x61e561[_0xd65e('0x2f')]=_[_0xd65e('0x2d')](_0x2de7e7[_0xd65e('0x2e')],qs[_0xd65e('0x30')](_0x108e05['query'][_0xd65e('0x30')]));_0x61e561[_0xd65e('0x2f')]=_0x61e561['attributes'][_0xd65e('0x31')]?_0x61e561[_0xd65e('0x2f')]:_0x2de7e7['model'];if(!_0x108e05[_0xd65e('0x2b')][_0xd65e('0x32')](_0xd65e('0x33'))){_0x61e561[_0xd65e('0x1d')]=qs[_0xd65e('0x1d')](_0x108e05[_0xd65e('0x2b')][_0xd65e('0x1d')]);_0x61e561['offset']=qs['offset'](_0x108e05['query'][_0xd65e('0x1b')]);}_0x61e561['order']=qs['sort'](_0x108e05[_0xd65e('0x2b')][_0xd65e('0x34')]);_0x61e561[_0xd65e('0x35')]=qs[_0xd65e('0x2c')](_[_0xd65e('0x36')](_0x108e05[_0xd65e('0x2b')],_0x2de7e7['filters']),_0x511019);if(_0x108e05[_0xd65e('0x2b')][_0xd65e('0x37')]){_0x61e561[_0xd65e('0x35')]=_[_0xd65e('0x38')](_0x61e561[_0xd65e('0x35')],{'$or':_[_0xd65e('0x26')](_0x511019,function(_0x41b94e){if(_0x41b94e[_0xd65e('0x28')]!==_0xd65e('0x39')){var _0x189e6b={};_0x189e6b[_0x41b94e['name']]={'$like':'%'+_0x108e05[_0xd65e('0x2b')][_0xd65e('0x37')]+'%'};return _0x189e6b;}})});}_0x61e561=_[_0xd65e('0x38')]({},_0x61e561,_0x108e05[_0xd65e('0x3a')]);var _0x54e28c={'where':_0x61e561['where']};return db[_0xd65e('0x3b')][_0xd65e('0x1e')](_0x54e28c)[_0xd65e('0x21')](function(_0x4e6349){_0x3e4611[_0xd65e('0x1e')]=_0x4e6349;if(_0x108e05['query'][_0xd65e('0x3c')]){_0x61e561[_0xd65e('0x3d')]=[{'all':!![]}];}return db[_0xd65e('0x3b')][_0xd65e('0x3e')](_0x61e561);})['then'](function(_0x4b7028){_0x3e4611[_0xd65e('0x3f')]=_0x4b7028;return _0x3e4611;})[_0xd65e('0x21')](respondWithFilteredResult(_0x1b5646,_0x61e561))[_0xd65e('0x40')](handleError(_0x1b5646,null));};exports[_0xd65e('0x41')]=function(_0xb976ea,_0x4eb28d){var _0x319e16={'raw':![],'where':{'id':_0xb976ea[_0xd65e('0x42')]['id']}},_0x5da293={};_0x5da293[_0xd65e('0x2e')]=_[_0xd65e('0x2a')](db[_0xd65e('0x3b')][_0xd65e('0x43')]);_0x5da293[_0xd65e('0x2b')]=_[_0xd65e('0x2a')](_0xb976ea['query']);_0x5da293[_0xd65e('0x2c')]=_[_0xd65e('0x2d')](_0x5da293['model'],_0x5da293['query']);_0x319e16[_0xd65e('0x2f')]=_[_0xd65e('0x2d')](_0x5da293['model'],qs[_0xd65e('0x30')](_0xb976ea[_0xd65e('0x2b')][_0xd65e('0x30')]));_0x319e16[_0xd65e('0x2f')]=_0x319e16[_0xd65e('0x2f')]['length']?_0x319e16[_0xd65e('0x2f')]:_0x5da293[_0xd65e('0x2e')];if(_0xb976ea[_0xd65e('0x2b')][_0xd65e('0x3c')]){_0x319e16[_0xd65e('0x3d')]=[{'all':!![]}];}_0x319e16=_[_0xd65e('0x38')]({},_0x319e16,_0xb976ea[_0xd65e('0x3a')]);return db[_0xd65e('0x3b')][_0xd65e('0x44')](_0x319e16)['then'](handleEntityNotFound(_0x4eb28d,null))[_0xd65e('0x21')](respondWithResult(_0x4eb28d,null))[_0xd65e('0x40')](handleError(_0x4eb28d,null));};exports[_0xd65e('0x45')]=function(_0x2bec6a,_0x4acab5){return db[_0xd65e('0x3b')][_0xd65e('0x45')](_0x2bec6a[_0xd65e('0x46')],{})[_0xd65e('0x21')](respondWithResult(_0x4acab5,0xc9))[_0xd65e('0x40')](handleError(_0x4acab5,null));};exports[_0xd65e('0x20')]=function(_0x5472de,_0x57ca8d){if(_0x5472de[_0xd65e('0x46')]['id']){delete _0x5472de['body']['id'];}return db['ServicenowConfiguration'][_0xd65e('0x44')]({'where':{'id':_0x5472de[_0xd65e('0x42')]['id']}})[_0xd65e('0x21')](handleEntityNotFound(_0x57ca8d,null))[_0xd65e('0x21')](saveUpdates(_0x5472de[_0xd65e('0x46')],null))[_0xd65e('0x21')](respondWithResult(_0x57ca8d,null))['catch'](handleError(_0x57ca8d,null));};exports[_0xd65e('0x22')]=function(_0x3dacf1,_0x221920){return db['ServicenowConfiguration'][_0xd65e('0x44')]({'where':{'id':_0x3dacf1['params']['id']}})['then'](handleEntityNotFound(_0x221920,null))[_0xd65e('0x21')](removeEntity(_0x221920,null))[_0xd65e('0x40')](handleError(_0x221920,null));};exports[_0xd65e('0x47')]=function(_0x343228,_0x5cf33b,_0x297693){var _0x4c3a58={};var _0x40e07c={};var _0x2d69e2;var _0x57e463;return db[_0xd65e('0x3b')]['findOne']({'where':{'id':_0x343228[_0xd65e('0x42')]['id']}})['then'](handleEntityNotFound(_0x5cf33b,null))[_0xd65e('0x21')](function(_0xc6712b){if(_0xc6712b){_0x2d69e2=_0xc6712b;_0x40e07c[_0xd65e('0x2e')]=_[_0xd65e('0x2a')](db[_0xd65e('0x48')]['rawAttributes']);_0x40e07c[_0xd65e('0x2b')]=_[_0xd65e('0x2a')](_0x343228[_0xd65e('0x2b')]);_0x40e07c[_0xd65e('0x2c')]=_[_0xd65e('0x2d')](_0x40e07c[_0xd65e('0x2e')],_0x40e07c['query']);_0x4c3a58['attributes']=_['intersection'](_0x40e07c[_0xd65e('0x2e')],qs[_0xd65e('0x30')](_0x343228['query'][_0xd65e('0x30')]));_0x4c3a58[_0xd65e('0x2f')]=_0x4c3a58['attributes'][_0xd65e('0x31')]?_0x4c3a58['attributes']:_0x40e07c[_0xd65e('0x2e')];_0x4c3a58[_0xd65e('0x49')]=qs[_0xd65e('0x34')](_0x343228[_0xd65e('0x2b')][_0xd65e('0x34')]);_0x4c3a58[_0xd65e('0x35')]=qs[_0xd65e('0x2c')](_['pick'](_0x343228[_0xd65e('0x2b')],_0x40e07c[_0xd65e('0x2c')]));if(_0x343228[_0xd65e('0x2b')][_0xd65e('0x37')]){_0x4c3a58[_0xd65e('0x35')]=_[_0xd65e('0x38')](_0x4c3a58[_0xd65e('0x35')],{'$or':_[_0xd65e('0x26')](_0x4c3a58[_0xd65e('0x2f')],function(_0x365e5d){var _0x1753ac={};_0x1753ac[_0x365e5d]={'$like':'%'+_0x343228[_0xd65e('0x2b')][_0xd65e('0x37')]+'%'};return _0x1753ac;})});}_0x4c3a58=_[_0xd65e('0x38')]({},_0x4c3a58,_0x343228[_0xd65e('0x3a')]);return _0x2d69e2['getFields'](_0x4c3a58);}})[_0xd65e('0x21')](function(_0x4451d7){if(_0x4451d7){_0x57e463=_0x4451d7[_0xd65e('0x31')];if(!_0x343228[_0xd65e('0x2b')]['hasOwnProperty'](_0xd65e('0x33'))){_0x4c3a58['limit']=qs['limit'](_0x343228[_0xd65e('0x2b')][_0xd65e('0x1d')]);_0x4c3a58[_0xd65e('0x1b')]=qs[_0xd65e('0x1b')](_0x343228[_0xd65e('0x2b')][_0xd65e('0x1b')]);}return _0x2d69e2['getFields'](_0x4c3a58);}})['then'](function(_0x598254){if(_0x598254){return _0x598254?{'count':_0x57e463,'rows':_0x598254}:null;}})[_0xd65e('0x21')](respondWithResult(_0x5cf33b,null))[_0xd65e('0x40')](handleError(_0x5cf33b,null));};exports['getSubjects']=function(_0x63d73c,_0x3679c7,_0x370b37){var _0x1c6d76={};var _0xca3f11={};var _0x1ca613;var _0x55b3f0;return db['ServicenowConfiguration'][_0xd65e('0x4a')]({'where':{'id':_0x63d73c['params']['id']}})[_0xd65e('0x21')](handleEntityNotFound(_0x3679c7,null))['then'](function(_0x1cfd97){if(_0x1cfd97){_0x1ca613=_0x1cfd97;_0xca3f11[_0xd65e('0x2e')]=_[_0xd65e('0x2a')](db[_0xd65e('0x48')]['rawAttributes']);_0xca3f11['query']=_[_0xd65e('0x2a')](_0x63d73c[_0xd65e('0x2b')]);_0xca3f11['filters']=_[_0xd65e('0x2d')](_0xca3f11[_0xd65e('0x2e')],_0xca3f11[_0xd65e('0x2b')]);_0x1c6d76['attributes']=_[_0xd65e('0x2d')](_0xca3f11[_0xd65e('0x2e')],qs[_0xd65e('0x30')](_0x63d73c[_0xd65e('0x2b')]['fields']));_0x1c6d76[_0xd65e('0x2f')]=_0x1c6d76[_0xd65e('0x2f')][_0xd65e('0x31')]?_0x1c6d76['attributes']:_0xca3f11[_0xd65e('0x2e')];_0x1c6d76['order']=qs[_0xd65e('0x34')](_0x63d73c[_0xd65e('0x2b')][_0xd65e('0x34')]);_0x1c6d76[_0xd65e('0x35')]=qs[_0xd65e('0x2c')](_['pick'](_0x63d73c[_0xd65e('0x2b')],_0xca3f11[_0xd65e('0x2c')]));if(_0x63d73c[_0xd65e('0x2b')]['filter']){_0x1c6d76[_0xd65e('0x35')]=_[_0xd65e('0x38')](_0x1c6d76['where'],{'$or':_[_0xd65e('0x26')](_0x1c6d76[_0xd65e('0x2f')],function(_0x35a1ee){var _0x359794={};_0x359794[_0x35a1ee]={'$like':'%'+_0x63d73c[_0xd65e('0x2b')][_0xd65e('0x37')]+'%'};return _0x359794;})});}_0x1c6d76=_[_0xd65e('0x38')]({},_0x1c6d76,_0x63d73c[_0xd65e('0x3a')]);return _0x1ca613[_0xd65e('0x4b')](_0x1c6d76);}})[_0xd65e('0x21')](function(_0x13d98c){if(_0x13d98c){_0x55b3f0=_0x13d98c['length'];if(!_0x63d73c['query']['hasOwnProperty']('nolimit')){_0x1c6d76[_0xd65e('0x1d')]=qs['limit'](_0x63d73c['query']['limit']);_0x1c6d76[_0xd65e('0x1b')]=qs[_0xd65e('0x1b')](_0x63d73c[_0xd65e('0x2b')][_0xd65e('0x1b')]);}return _0x1ca613[_0xd65e('0x4b')](_0x1c6d76);}})[_0xd65e('0x21')](function(_0x995bec){if(_0x995bec){return _0x995bec?{'count':_0x55b3f0,'rows':_0x995bec}:null;}})[_0xd65e('0x21')](respondWithResult(_0x3679c7,null))['catch'](handleError(_0x3679c7,null));};exports[_0xd65e('0x4c')]=function(_0x1472d2,_0x547877,_0x41780c){var _0x5b4a5c={};var _0x411987={};var _0x28c99f;var _0x833870;return db[_0xd65e('0x3b')]['findOne']({'where':{'id':_0x1472d2[_0xd65e('0x42')]['id']}})[_0xd65e('0x21')](handleEntityNotFound(_0x547877,null))['then'](function(_0x3f4dc6){if(_0x3f4dc6){_0x28c99f=_0x3f4dc6;_0x411987[_0xd65e('0x2e')]=_[_0xd65e('0x2a')](db['ServicenowField']['rawAttributes']);_0x411987[_0xd65e('0x2b')]=_[_0xd65e('0x2a')](_0x1472d2['query']);_0x411987[_0xd65e('0x2c')]=_['intersection'](_0x411987[_0xd65e('0x2e')],_0x411987['query']);_0x5b4a5c[_0xd65e('0x2f')]=_[_0xd65e('0x2d')](_0x411987['model'],qs['fields'](_0x1472d2['query'][_0xd65e('0x30')]));_0x5b4a5c[_0xd65e('0x2f')]=_0x5b4a5c['attributes'][_0xd65e('0x31')]?_0x5b4a5c[_0xd65e('0x2f')]:_0x411987['model'];_0x5b4a5c[_0xd65e('0x49')]=qs[_0xd65e('0x34')](_0x1472d2[_0xd65e('0x2b')]['sort']);_0x5b4a5c[_0xd65e('0x35')]=qs['filters'](_[_0xd65e('0x36')](_0x1472d2[_0xd65e('0x2b')],_0x411987[_0xd65e('0x2c')]));if(_0x1472d2['query']['filter']){_0x5b4a5c[_0xd65e('0x35')]=_[_0xd65e('0x38')](_0x5b4a5c[_0xd65e('0x35')],{'$or':_[_0xd65e('0x26')](_0x5b4a5c['attributes'],function(_0x522894){var _0x1dab6b={};_0x1dab6b[_0x522894]={'$like':'%'+_0x1472d2[_0xd65e('0x2b')][_0xd65e('0x37')]+'%'};return _0x1dab6b;})});}_0x5b4a5c=_[_0xd65e('0x38')]({},_0x5b4a5c,_0x1472d2['options']);return _0x28c99f['getDescriptions'](_0x5b4a5c);}})[_0xd65e('0x21')](function(_0x364055){if(_0x364055){_0x833870=_0x364055[_0xd65e('0x31')];if(!_0x1472d2['query'][_0xd65e('0x32')](_0xd65e('0x33'))){_0x5b4a5c[_0xd65e('0x1d')]=qs[_0xd65e('0x1d')](_0x1472d2[_0xd65e('0x2b')][_0xd65e('0x1d')]);_0x5b4a5c[_0xd65e('0x1b')]=qs[_0xd65e('0x1b')](_0x1472d2['query'][_0xd65e('0x1b')]);}return _0x28c99f[_0xd65e('0x4c')](_0x5b4a5c);}})['then'](function(_0x193bed){if(_0x193bed){return _0x193bed?{'count':_0x833870,'rows':_0x193bed}:null;}})[_0xd65e('0x21')](respondWithResult(_0x547877,null))[_0xd65e('0x40')](handleError(_0x547877,null));}; \ No newline at end of file +var _0x0ca2=['name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','include','findAll','rows','catch','show','keys','fields','find','create','body','params','getFields','findOne','ServicenowField','getSubjects','pick','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error'];(function(_0x5e8460,_0x2003b5){var _0x3d50fd=function(_0x4c499f){while(--_0x4c499f){_0x5e8460['push'](_0x5e8460['shift']());}};_0x3d50fd(++_0x2003b5);}(_0x0ca2,0x75));var _0x20ca=function(_0x127074,_0x3bd855){_0x127074=_0x127074-0x0;var _0x4c9463=_0x0ca2[_0x127074];return _0x4c9463;};'use strict';var emlformat=require(_0x20ca('0x0'));var rimraf=require(_0x20ca('0x1'));var zipdir=require(_0x20ca('0x2'));var jsonpatch=require(_0x20ca('0x3'));var rp=require('request-promise');var moment=require(_0x20ca('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x20ca('0x5'));var path=require(_0x20ca('0x6'));var sox=require(_0x20ca('0x7'));var csv=require(_0x20ca('0x8'));var ejs=require(_0x20ca('0x9'));var fs=require('fs');var fs_extra=require(_0x20ca('0xa'));var _=require(_0x20ca('0xb'));var squel=require(_0x20ca('0xc'));var crypto=require(_0x20ca('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x20ca('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x20ca('0xf'));var Redis=require(_0x20ca('0x10'));var authService=require(_0x20ca('0x11'));var qs=require(_0x20ca('0x12'));var as=require(_0x20ca('0x13'));var hardwareService=require(_0x20ca('0x14'));var logger=require(_0x20ca('0x15'))(_0x20ca('0x16'));var utils=require(_0x20ca('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x20ca('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d9fcf,_0x572a78){_0x572a78=_0x572a78||0xcc;return function(_0x5d422e){if(_0x5d422e){return _0x1d9fcf[_0x20ca('0x19')](_0x572a78);}return _0x1d9fcf[_0x20ca('0x1a')](_0x572a78)['end']();};}function respondWithResult(_0x51c3fa,_0xd95208){_0xd95208=_0xd95208||0xc8;return function(_0x3681d3){if(_0x3681d3){return _0x51c3fa[_0x20ca('0x1a')](_0xd95208)['json'](_0x3681d3);}};}function respondWithFilteredResult(_0x8fcdc1,_0x1ef90e){return function(_0x50ab08){if(_0x50ab08){var _0x58187d=typeof _0x1ef90e[_0x20ca('0x1b')]==='undefined'&&typeof _0x1ef90e[_0x20ca('0x1c')]==='undefined';var _0x3750ea=_0x50ab08['count'];var _0x23def8=_0x58187d?0x0:_0x1ef90e['offset'];var _0x4256a3=_0x58187d?_0x50ab08[_0x20ca('0x1d')]:_0x1ef90e['offset']+_0x1ef90e[_0x20ca('0x1c')];var _0x1f359e;if(_0x4256a3>=_0x3750ea){_0x4256a3=_0x3750ea;_0x1f359e=0xc8;}else{_0x1f359e=0xce;}_0x8fcdc1[_0x20ca('0x1a')](_0x1f359e);return _0x8fcdc1[_0x20ca('0x1e')](_0x20ca('0x1f'),_0x23def8+'-'+_0x4256a3+'/'+_0x3750ea)[_0x20ca('0x20')](_0x50ab08);}return null;};}function patchUpdates(_0x2c66e1){return function(_0x5f53c8){try{jsonpatch[_0x20ca('0x21')](_0x5f53c8,_0x2c66e1,!![]);}catch(_0x3270ab){return BPromise[_0x20ca('0x22')](_0x3270ab);}return _0x5f53c8[_0x20ca('0x23')]();};}function saveUpdates(_0x3cfc33,_0x8d6d51){return function(_0x20807e){if(_0x20807e){return _0x20807e[_0x20ca('0x24')](_0x3cfc33)[_0x20ca('0x25')](function(_0x4595f7){return _0x4595f7;});}return null;};}function removeEntity(_0x5f07a5,_0x471437){return function(_0x511aa3){if(_0x511aa3){return _0x511aa3[_0x20ca('0x26')]()['then'](function(){_0x5f07a5['status'](0xcc)[_0x20ca('0x27')]();});}};}function handleEntityNotFound(_0x2bb3c2,_0x11fe32){return function(_0x5ccb6d){if(!_0x5ccb6d){_0x2bb3c2['sendStatus'](0x194);}return _0x5ccb6d;};}function handleError(_0x4a7e14,_0x3aeb66){_0x3aeb66=_0x3aeb66||0x1f4;return function(_0x49468d){logger[_0x20ca('0x28')](_0x49468d['stack']);if(_0x49468d[_0x20ca('0x29')]){delete _0x49468d['name'];}_0x4a7e14[_0x20ca('0x1a')](_0x3aeb66)['send'](_0x49468d);};}exports[_0x20ca('0x2a')]=function(_0x29bc9e,_0x310ec5){var _0x464a80={},_0x174637={},_0x542b50={'count':0x0,'rows':[]};var _0x21b3b7=_[_0x20ca('0x2b')](db[_0x20ca('0x2c')][_0x20ca('0x2d')],function(_0xcbbbd0){return{'name':_0xcbbbd0[_0x20ca('0x2e')],'type':_0xcbbbd0[_0x20ca('0x2f')]['key']};});_0x174637['model']=_[_0x20ca('0x2b')](_0x21b3b7,_0x20ca('0x29'));_0x174637[_0x20ca('0x30')]=_['keys'](_0x29bc9e['query']);_0x174637[_0x20ca('0x31')]=_[_0x20ca('0x32')](_0x174637[_0x20ca('0x33')],_0x174637['query']);_0x464a80[_0x20ca('0x34')]=_[_0x20ca('0x32')](_0x174637[_0x20ca('0x33')],qs['fields'](_0x29bc9e[_0x20ca('0x30')]['fields']));_0x464a80[_0x20ca('0x34')]=_0x464a80['attributes'][_0x20ca('0x35')]?_0x464a80[_0x20ca('0x34')]:_0x174637[_0x20ca('0x33')];if(!_0x29bc9e[_0x20ca('0x30')][_0x20ca('0x36')](_0x20ca('0x37'))){_0x464a80['limit']=qs[_0x20ca('0x1c')](_0x29bc9e[_0x20ca('0x30')][_0x20ca('0x1c')]);_0x464a80[_0x20ca('0x1b')]=qs['offset'](_0x29bc9e[_0x20ca('0x30')][_0x20ca('0x1b')]);}_0x464a80[_0x20ca('0x38')]=qs[_0x20ca('0x39')](_0x29bc9e[_0x20ca('0x30')]['sort']);_0x464a80['where']=qs[_0x20ca('0x31')](_['pick'](_0x29bc9e[_0x20ca('0x30')],_0x174637['filters']),_0x21b3b7);if(_0x29bc9e['query'][_0x20ca('0x3a')]){_0x464a80[_0x20ca('0x3b')]=_[_0x20ca('0x3c')](_0x464a80[_0x20ca('0x3b')],{'$or':_[_0x20ca('0x2b')](_0x21b3b7,function(_0x56b7fc){if(_0x56b7fc['type']!=='VIRTUAL'){var _0x3f80fd={};_0x3f80fd[_0x56b7fc[_0x20ca('0x29')]]={'$like':'%'+_0x29bc9e[_0x20ca('0x30')][_0x20ca('0x3a')]+'%'};return _0x3f80fd;}})});}_0x464a80=_['merge']({},_0x464a80,_0x29bc9e[_0x20ca('0x3d')]);var _0x1396ed={'where':_0x464a80[_0x20ca('0x3b')]};return db[_0x20ca('0x2c')][_0x20ca('0x1d')](_0x1396ed)[_0x20ca('0x25')](function(_0x55cf43){_0x542b50[_0x20ca('0x1d')]=_0x55cf43;if(_0x29bc9e[_0x20ca('0x30')]['includeAll']){_0x464a80[_0x20ca('0x3e')]=[{'all':!![]}];}return db[_0x20ca('0x2c')][_0x20ca('0x3f')](_0x464a80);})['then'](function(_0x1d17bb){_0x542b50[_0x20ca('0x40')]=_0x1d17bb;return _0x542b50;})[_0x20ca('0x25')](respondWithFilteredResult(_0x310ec5,_0x464a80))[_0x20ca('0x41')](handleError(_0x310ec5,null));};exports[_0x20ca('0x42')]=function(_0x5acff2,_0xda689e){var _0x591f5d={'raw':![],'where':{'id':_0x5acff2['params']['id']}},_0x24b0cf={};_0x24b0cf[_0x20ca('0x33')]=_[_0x20ca('0x43')](db[_0x20ca('0x2c')]['rawAttributes']);_0x24b0cf[_0x20ca('0x30')]=_[_0x20ca('0x43')](_0x5acff2['query']);_0x24b0cf[_0x20ca('0x31')]=_[_0x20ca('0x32')](_0x24b0cf[_0x20ca('0x33')],_0x24b0cf['query']);_0x591f5d[_0x20ca('0x34')]=_['intersection'](_0x24b0cf['model'],qs[_0x20ca('0x44')](_0x5acff2['query'][_0x20ca('0x44')]));_0x591f5d['attributes']=_0x591f5d[_0x20ca('0x34')][_0x20ca('0x35')]?_0x591f5d['attributes']:_0x24b0cf[_0x20ca('0x33')];if(_0x5acff2[_0x20ca('0x30')]['includeAll']){_0x591f5d['include']=[{'all':!![]}];}_0x591f5d=_[_0x20ca('0x3c')]({},_0x591f5d,_0x5acff2[_0x20ca('0x3d')]);return db['ServicenowConfiguration'][_0x20ca('0x45')](_0x591f5d)[_0x20ca('0x25')](handleEntityNotFound(_0xda689e,null))[_0x20ca('0x25')](respondWithResult(_0xda689e,null))['catch'](handleError(_0xda689e,null));};exports[_0x20ca('0x46')]=function(_0x1fb146,_0x5a3b6e){return db[_0x20ca('0x2c')]['create'](_0x1fb146['body'],{})['then'](respondWithResult(_0x5a3b6e,0xc9))['catch'](handleError(_0x5a3b6e,null));};exports[_0x20ca('0x24')]=function(_0x4eb1bd,_0x4248ed){if(_0x4eb1bd[_0x20ca('0x47')]['id']){delete _0x4eb1bd['body']['id'];}return db['ServicenowConfiguration'][_0x20ca('0x45')]({'where':{'id':_0x4eb1bd[_0x20ca('0x48')]['id']}})[_0x20ca('0x25')](handleEntityNotFound(_0x4248ed,null))[_0x20ca('0x25')](saveUpdates(_0x4eb1bd[_0x20ca('0x47')],null))[_0x20ca('0x25')](respondWithResult(_0x4248ed,null))[_0x20ca('0x41')](handleError(_0x4248ed,null));};exports[_0x20ca('0x26')]=function(_0x2b59cd,_0x4448dd){return db[_0x20ca('0x2c')][_0x20ca('0x45')]({'where':{'id':_0x2b59cd[_0x20ca('0x48')]['id']}})['then'](handleEntityNotFound(_0x4448dd,null))['then'](removeEntity(_0x4448dd,null))[_0x20ca('0x41')](handleError(_0x4448dd,null));};exports[_0x20ca('0x49')]=function(_0x17ce5b,_0x1a59b5,_0x3f52c4){var _0x4a811d={};var _0x304cde={};var _0xfd24f4;var _0x1a8e2d;return db[_0x20ca('0x2c')][_0x20ca('0x4a')]({'where':{'id':_0x17ce5b[_0x20ca('0x48')]['id']}})[_0x20ca('0x25')](handleEntityNotFound(_0x1a59b5,null))[_0x20ca('0x25')](function(_0x169a0b){if(_0x169a0b){_0xfd24f4=_0x169a0b;_0x304cde[_0x20ca('0x33')]=_[_0x20ca('0x43')](db[_0x20ca('0x4b')][_0x20ca('0x2d')]);_0x304cde[_0x20ca('0x30')]=_[_0x20ca('0x43')](_0x17ce5b[_0x20ca('0x30')]);_0x304cde['filters']=_[_0x20ca('0x32')](_0x304cde[_0x20ca('0x33')],_0x304cde[_0x20ca('0x30')]);_0x4a811d[_0x20ca('0x34')]=_[_0x20ca('0x32')](_0x304cde[_0x20ca('0x33')],qs['fields'](_0x17ce5b[_0x20ca('0x30')][_0x20ca('0x44')]));_0x4a811d[_0x20ca('0x34')]=_0x4a811d[_0x20ca('0x34')][_0x20ca('0x35')]?_0x4a811d[_0x20ca('0x34')]:_0x304cde[_0x20ca('0x33')];_0x4a811d[_0x20ca('0x38')]=qs[_0x20ca('0x39')](_0x17ce5b[_0x20ca('0x30')]['sort']);_0x4a811d[_0x20ca('0x3b')]=qs[_0x20ca('0x31')](_['pick'](_0x17ce5b[_0x20ca('0x30')],_0x304cde[_0x20ca('0x31')]));if(_0x17ce5b[_0x20ca('0x30')]['filter']){_0x4a811d[_0x20ca('0x3b')]=_['merge'](_0x4a811d[_0x20ca('0x3b')],{'$or':_[_0x20ca('0x2b')](_0x4a811d[_0x20ca('0x34')],function(_0x189d5a){var _0x4aeb1f={};_0x4aeb1f[_0x189d5a]={'$like':'%'+_0x17ce5b[_0x20ca('0x30')][_0x20ca('0x3a')]+'%'};return _0x4aeb1f;})});}_0x4a811d=_[_0x20ca('0x3c')]({},_0x4a811d,_0x17ce5b[_0x20ca('0x3d')]);return _0xfd24f4['getFields'](_0x4a811d);}})['then'](function(_0x1244aa){if(_0x1244aa){_0x1a8e2d=_0x1244aa['length'];if(!_0x17ce5b[_0x20ca('0x30')]['hasOwnProperty'](_0x20ca('0x37'))){_0x4a811d[_0x20ca('0x1c')]=qs[_0x20ca('0x1c')](_0x17ce5b[_0x20ca('0x30')][_0x20ca('0x1c')]);_0x4a811d[_0x20ca('0x1b')]=qs[_0x20ca('0x1b')](_0x17ce5b[_0x20ca('0x30')][_0x20ca('0x1b')]);}return _0xfd24f4[_0x20ca('0x49')](_0x4a811d);}})[_0x20ca('0x25')](function(_0x77a8e0){if(_0x77a8e0){return _0x77a8e0?{'count':_0x1a8e2d,'rows':_0x77a8e0}:null;}})['then'](respondWithResult(_0x1a59b5,null))[_0x20ca('0x41')](handleError(_0x1a59b5,null));};exports[_0x20ca('0x4c')]=function(_0x457c2b,_0x144ce6,_0x40c1db){var _0x396e35={};var _0x5030aa={};var _0x1dd6ce;var _0x282399;return db[_0x20ca('0x2c')]['findOne']({'where':{'id':_0x457c2b[_0x20ca('0x48')]['id']}})[_0x20ca('0x25')](handleEntityNotFound(_0x144ce6,null))[_0x20ca('0x25')](function(_0x57da49){if(_0x57da49){_0x1dd6ce=_0x57da49;_0x5030aa[_0x20ca('0x33')]=_[_0x20ca('0x43')](db[_0x20ca('0x4b')][_0x20ca('0x2d')]);_0x5030aa[_0x20ca('0x30')]=_[_0x20ca('0x43')](_0x457c2b[_0x20ca('0x30')]);_0x5030aa[_0x20ca('0x31')]=_[_0x20ca('0x32')](_0x5030aa['model'],_0x5030aa[_0x20ca('0x30')]);_0x396e35[_0x20ca('0x34')]=_[_0x20ca('0x32')](_0x5030aa['model'],qs[_0x20ca('0x44')](_0x457c2b['query'][_0x20ca('0x44')]));_0x396e35[_0x20ca('0x34')]=_0x396e35[_0x20ca('0x34')][_0x20ca('0x35')]?_0x396e35['attributes']:_0x5030aa[_0x20ca('0x33')];_0x396e35[_0x20ca('0x38')]=qs[_0x20ca('0x39')](_0x457c2b[_0x20ca('0x30')]['sort']);_0x396e35['where']=qs['filters'](_[_0x20ca('0x4d')](_0x457c2b[_0x20ca('0x30')],_0x5030aa['filters']));if(_0x457c2b[_0x20ca('0x30')][_0x20ca('0x3a')]){_0x396e35['where']=_[_0x20ca('0x3c')](_0x396e35[_0x20ca('0x3b')],{'$or':_[_0x20ca('0x2b')](_0x396e35['attributes'],function(_0x3f605e){var _0x597c01={};_0x597c01[_0x3f605e]={'$like':'%'+_0x457c2b[_0x20ca('0x30')][_0x20ca('0x3a')]+'%'};return _0x597c01;})});}_0x396e35=_['merge']({},_0x396e35,_0x457c2b[_0x20ca('0x3d')]);return _0x1dd6ce[_0x20ca('0x4c')](_0x396e35);}})[_0x20ca('0x25')](function(_0x452e51){if(_0x452e51){_0x282399=_0x452e51[_0x20ca('0x35')];if(!_0x457c2b[_0x20ca('0x30')][_0x20ca('0x36')](_0x20ca('0x37'))){_0x396e35[_0x20ca('0x1c')]=qs[_0x20ca('0x1c')](_0x457c2b[_0x20ca('0x30')][_0x20ca('0x1c')]);_0x396e35[_0x20ca('0x1b')]=qs[_0x20ca('0x1b')](_0x457c2b[_0x20ca('0x30')][_0x20ca('0x1b')]);}return _0x1dd6ce['getSubjects'](_0x396e35);}})[_0x20ca('0x25')](function(_0x26076b){if(_0x26076b){return _0x26076b?{'count':_0x282399,'rows':_0x26076b}:null;}})[_0x20ca('0x25')](respondWithResult(_0x144ce6,null))['catch'](handleError(_0x144ce6,null));};exports[_0x20ca('0x4e')]=function(_0xfd8a82,_0x3bcbe3,_0xfe54d0){var _0x554900={};var _0x34ad95={};var _0x3fa398;var _0xbac0a0;return db['ServicenowConfiguration'][_0x20ca('0x4a')]({'where':{'id':_0xfd8a82[_0x20ca('0x48')]['id']}})[_0x20ca('0x25')](handleEntityNotFound(_0x3bcbe3,null))[_0x20ca('0x25')](function(_0x4d4ded){if(_0x4d4ded){_0x3fa398=_0x4d4ded;_0x34ad95[_0x20ca('0x33')]=_[_0x20ca('0x43')](db[_0x20ca('0x4b')][_0x20ca('0x2d')]);_0x34ad95[_0x20ca('0x30')]=_['keys'](_0xfd8a82['query']);_0x34ad95[_0x20ca('0x31')]=_['intersection'](_0x34ad95[_0x20ca('0x33')],_0x34ad95[_0x20ca('0x30')]);_0x554900[_0x20ca('0x34')]=_[_0x20ca('0x32')](_0x34ad95[_0x20ca('0x33')],qs['fields'](_0xfd8a82[_0x20ca('0x30')][_0x20ca('0x44')]));_0x554900[_0x20ca('0x34')]=_0x554900[_0x20ca('0x34')][_0x20ca('0x35')]?_0x554900[_0x20ca('0x34')]:_0x34ad95[_0x20ca('0x33')];_0x554900[_0x20ca('0x38')]=qs[_0x20ca('0x39')](_0xfd8a82['query'][_0x20ca('0x39')]);_0x554900[_0x20ca('0x3b')]=qs['filters'](_[_0x20ca('0x4d')](_0xfd8a82[_0x20ca('0x30')],_0x34ad95[_0x20ca('0x31')]));if(_0xfd8a82[_0x20ca('0x30')][_0x20ca('0x3a')]){_0x554900[_0x20ca('0x3b')]=_[_0x20ca('0x3c')](_0x554900['where'],{'$or':_[_0x20ca('0x2b')](_0x554900[_0x20ca('0x34')],function(_0x1abf35){var _0x2615d2={};_0x2615d2[_0x1abf35]={'$like':'%'+_0xfd8a82['query'][_0x20ca('0x3a')]+'%'};return _0x2615d2;})});}_0x554900=_[_0x20ca('0x3c')]({},_0x554900,_0xfd8a82[_0x20ca('0x3d')]);return _0x3fa398[_0x20ca('0x4e')](_0x554900);}})[_0x20ca('0x25')](function(_0x14de32){if(_0x14de32){_0xbac0a0=_0x14de32[_0x20ca('0x35')];if(!_0xfd8a82[_0x20ca('0x30')][_0x20ca('0x36')](_0x20ca('0x37'))){_0x554900[_0x20ca('0x1c')]=qs[_0x20ca('0x1c')](_0xfd8a82[_0x20ca('0x30')][_0x20ca('0x1c')]);_0x554900[_0x20ca('0x1b')]=qs['offset'](_0xfd8a82[_0x20ca('0x30')][_0x20ca('0x1b')]);}return _0x3fa398[_0x20ca('0x4e')](_0x554900);}})[_0x20ca('0x25')](function(_0x52ab05){if(_0x52ab05){return _0x52ab05?{'count':_0xbac0a0,'rows':_0x52ab05}:null;}})[_0x20ca('0x25')](respondWithResult(_0x3bcbe3,null))[_0x20ca('0x41')](handleError(_0x3bcbe3,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 912155e..e676f62 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b4f=['exports','define','int_servicenow_configurations','util','api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x2b4f,0x142));var _0xf2b4=function(_0x4cb571,_0x2b45a1){_0x4cb571=_0x4cb571-0x0;var _0x28aea5=_0x2b4f[_0x4cb571];return _0x28aea5;};'use strict';var _=require('lodash');var util=require(_0xf2b4('0x0'));var logger=require('../../config/logger')(_0xf2b4('0x1'));var moment=require(_0xf2b4('0x2'));var BPromise=require(_0xf2b4('0x3'));var rp=require(_0xf2b4('0x4'));var fs=require('fs');var path=require(_0xf2b4('0x5'));var rimraf=require('rimraf');var config=require(_0xf2b4('0x6'));var attributes=require(_0xf2b4('0x7'));module[_0xf2b4('0x8')]=function(_0x35a765,_0x55733c){return _0x35a765[_0xf2b4('0x9')]('ServicenowConfiguration',attributes,{'tableName':_0xf2b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf2f=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash'];(function(_0x3063ca,_0xa02c93){var _0x3ffca5=function(_0x27a493){while(--_0x27a493){_0x3063ca['push'](_0x3063ca['shift']());}};_0x3ffca5(++_0xa02c93);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x5ef9d0,_0x1f16fb){_0x5ef9d0=_0x5ef9d0-0x0;var _0x14286f=_0xcf2f[_0x5ef9d0];return _0x14286f;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var logger=require(_0xfcf2('0x2'))(_0xfcf2('0x3'));var moment=require(_0xfcf2('0x4'));var BPromise=require('bluebird');var rp=require(_0xfcf2('0x5'));var fs=require('fs');var path=require(_0xfcf2('0x6'));var rimraf=require(_0xfcf2('0x7'));var config=require(_0xfcf2('0x8'));var attributes=require(_0xfcf2('0x9'));module[_0xfcf2('0xa')]=function(_0x1e6d99,_0x3a4950){return _0x1e6d99[_0xfcf2('0xb')](_0xfcf2('0xc'),attributes,{'tableName':_0xfcf2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 98bd731..6bb5861 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0736=['http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x20e5f1,_0x39bb73){var _0x3ec48e=function(_0x57fe01){while(--_0x57fe01){_0x20e5f1['push'](_0x20e5f1['shift']());}};_0x3ec48e(++_0x39bb73);}(_0x0736,0x1c0));var _0x6073=function(_0x4aab84,_0xd00634){_0x4aab84=_0x4aab84-0x0;var _0x282571=_0x0736[_0x4aab84];return _0x282571;};'use strict';var _=require(_0x6073('0x0'));var util=require(_0x6073('0x1'));var moment=require('moment');var BPromise=require(_0x6073('0x2'));var rs=require(_0x6073('0x3'));var fs=require('fs');var Redis=require(_0x6073('0x4'));var db=require(_0x6073('0x5'))['db'];var utils=require(_0x6073('0x6'));var logger=require(_0x6073('0x7'))(_0x6073('0x8'));var config=require(_0x6073('0x9'));var jayson=require(_0x6073('0xa'));var client=jayson[_0x6073('0xb')][_0x6073('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c94dd,_0x35173a,_0x308d67){return new BPromise(function(_0x3a489c,_0xcdcf4){return client[_0x6073('0xd')](_0x1c94dd,_0x308d67)['then'](function(_0x594df9){logger[_0x6073('0xe')](_0x6073('0xf'),_0x35173a,_0x6073('0x10'));logger[_0x6073('0x11')](_0x6073('0x12'),_0x35173a,_0x6073('0x10'),JSON['stringify'](_0x594df9));if(_0x594df9['error']){if(_0x594df9['error']['code']===0x1f4){logger[_0x6073('0x13')](_0x6073('0xf'),_0x35173a,_0x594df9['error'][_0x6073('0x14')]);return _0xcdcf4(_0x594df9[_0x6073('0x13')][_0x6073('0x14')]);}logger[_0x6073('0x13')](_0x6073('0xf'),_0x35173a,_0x594df9[_0x6073('0x13')][_0x6073('0x14')]);return _0x3a489c(_0x594df9[_0x6073('0x13')][_0x6073('0x14')]);}else{logger[_0x6073('0xe')](_0x6073('0xf'),_0x35173a,_0x6073('0x10'));_0x3a489c(_0x594df9[_0x6073('0x15')]['message']);}})[_0x6073('0x16')](function(_0x258bed){logger[_0x6073('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x35173a,_0x258bed);_0xcdcf4(_0x258bed);});});} \ No newline at end of file +var _0x6d5c=['ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x6d5c,0x179));var _0xc6d5=function(_0x1b23bd,_0x4f89f2){_0x1b23bd=_0x1b23bd-0x0;var _0x108931=_0x6d5c[_0x1b23bd];return _0x108931;};'use strict';var _=require(_0xc6d5('0x0'));var util=require(_0xc6d5('0x1'));var moment=require(_0xc6d5('0x2'));var BPromise=require(_0xc6d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6d5('0x4'));var db=require(_0xc6d5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6d5('0x6'))(_0xc6d5('0x7'));var config=require(_0xc6d5('0x8'));var jayson=require(_0xc6d5('0x9'));var client=jayson['client'][_0xc6d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f110b,_0x42b7c2,_0x4eaff5){return new BPromise(function(_0x505e80,_0xa4f64e){return client[_0xc6d5('0xb')](_0x5f110b,_0x4eaff5)[_0xc6d5('0xc')](function(_0x2b27fa){logger[_0xc6d5('0xd')](_0xc6d5('0xe'),_0x42b7c2,_0xc6d5('0xf'));logger[_0xc6d5('0x10')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x42b7c2,_0xc6d5('0xf'),JSON[_0xc6d5('0x11')](_0x2b27fa));if(_0x2b27fa['error']){if(_0x2b27fa[_0xc6d5('0x12')][_0xc6d5('0x13')]===0x1f4){logger['error'](_0xc6d5('0xe'),_0x42b7c2,_0x2b27fa[_0xc6d5('0x12')][_0xc6d5('0x14')]);return _0xa4f64e(_0x2b27fa[_0xc6d5('0x12')][_0xc6d5('0x14')]);}logger['error'](_0xc6d5('0xe'),_0x42b7c2,_0x2b27fa[_0xc6d5('0x12')][_0xc6d5('0x14')]);return _0x505e80(_0x2b27fa[_0xc6d5('0x12')][_0xc6d5('0x14')]);}else{logger[_0xc6d5('0xd')](_0xc6d5('0xe'),_0x42b7c2,_0xc6d5('0xf'));_0x505e80(_0x2b27fa[_0xc6d5('0x15')][_0xc6d5('0x14')]);}})[_0xc6d5('0x16')](function(_0x3ab803){logger[_0xc6d5('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x42b7c2,_0x3ab803);_0xa4f64e(_0x3ab803);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 9ceac51..f2a524f 100644 --- a/server/api/intServicenowField/index.js +++ b/server/api/intServicenowField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3217=['update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','put'];(function(_0x3d9167,_0x2439d3){var _0x3c85be=function(_0x3671e6){while(--_0x3671e6){_0x3d9167['push'](_0x3d9167['shift']());}};_0x3c85be(++_0x2439d3);}(_0x3217,0x1cd));var _0x7321=function(_0xe6ffe0,_0x48d82c){_0xe6ffe0=_0xe6ffe0-0x0;var _0x1b2460=_0x3217[_0xe6ffe0];return _0x1b2460;};'use strict';var multer=require(_0x7321('0x0'));var util=require(_0x7321('0x1'));var path=require(_0x7321('0x2'));var timeout=require(_0x7321('0x3'));var express=require(_0x7321('0x4'));var router=express['Router']();var fs_extra=require(_0x7321('0x5'));var auth=require(_0x7321('0x6'));var interaction=require(_0x7321('0x7'));var config=require('../../config/environment');var controller=require('./intServicenowField.controller');router[_0x7321('0x8')]('/',auth[_0x7321('0x9')](),controller[_0x7321('0xa')]);router[_0x7321('0x8')]('/:id',auth[_0x7321('0x9')](),controller[_0x7321('0xb')]);router[_0x7321('0xc')]('/',auth[_0x7321('0x9')](),controller['create']);router[_0x7321('0xd')]('/:id',auth[_0x7321('0x9')](),controller[_0x7321('0xe')]);router[_0x7321('0xf')](_0x7321('0x10'),auth['isAuthenticated'](),controller[_0x7321('0x11')]);module[_0x7321('0x12')]=router; \ No newline at end of file +var _0x0932=['../../config/environment','isAuthenticated','get','/:id','post','update','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x0932,0x7e));var _0x2093=function(_0x2226d7,_0x30fef5){_0x2226d7=_0x2226d7-0x0;var _0x8819f9=_0x0932[_0x2226d7];return _0x8819f9;};'use strict';var multer=require('multer');var util=require(_0x2093('0x0'));var path=require(_0x2093('0x1'));var timeout=require('connect-timeout');var express=require(_0x2093('0x2'));var router=express[_0x2093('0x3')]();var fs_extra=require(_0x2093('0x4'));var auth=require(_0x2093('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2093('0x6'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x2093('0x7')](),controller['index']);router[_0x2093('0x8')](_0x2093('0x9'),auth[_0x2093('0x7')](),controller['show']);router[_0x2093('0xa')]('/',auth[_0x2093('0x7')](),controller['create']);router['put'](_0x2093('0x9'),auth['isAuthenticated'](),controller[_0x2093('0xb')]);router['delete'](_0x2093('0x9'),auth[_0x2093('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 86e4370..f2f224b 100644 --- a/server/api/intServicenowField/intServicenowField.attributes.js +++ b/server/api/intServicenowField/intServicenowField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8f5=['STRING','string','variable','customVariable','keyValue','picklist'];(function(_0x24fdbf,_0x151320){var _0x4f9e49=function(_0x1158a1){while(--_0x1158a1){_0x24fdbf['push'](_0x24fdbf['shift']());}};_0x4f9e49(++_0x151320);}(_0xc8f5,0x17b));var _0x5c8f=function(_0x4bbe00,_0x1d2f14){_0x4bbe00=_0x4bbe00-0x0;var _0x3999d2=_0xc8f5[_0x4bbe00];return _0x3999d2;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x5c8f('0x0'),_0x5c8f('0x1'),_0x5c8f('0x2'),_0x5c8f('0x3'),_0x5c8f('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5c8f('0x5')]},'key':{'type':Sequelize[_0x5c8f('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x5c8f('0x0'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x5c8f('0x5')]},'idField':{'type':Sequelize[_0x5c8f('0x5')]},'nameField':{'type':Sequelize[_0x5c8f('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5c8f('0x5')]}}; \ No newline at end of file +var _0xf706=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf706,0x99));var _0x6f70=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0xf706[_0x55821d];return _0x58ea8a;};'use strict';var Sequelize=require(_0x6f70('0x0'));module[_0x6f70('0x1')]={'type':{'type':Sequelize[_0x6f70('0x2')](_0x6f70('0x3'),_0x6f70('0x4'),_0x6f70('0x5'),_0x6f70('0x6'),_0x6f70('0x7')),'defaultValue':_0x6f70('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6f70('0x2')](_0x6f70('0x3'),_0x6f70('0x4'),_0x6f70('0x5'))},'keyContent':{'type':Sequelize[_0x6f70('0x8')]},'idField':{'type':Sequelize[_0x6f70('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6f70('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6f70('0x8')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 0213822..84e8c6d 100644 --- a/server/api/intServicenowField/intServicenowField.controller.js +++ b/server/api/intServicenowField/intServicenowField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe12=['limit','Content-Range','json','save','update','then','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ServicenowField','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','offset','undefined','count'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe12,0x109));var _0x2be1=function(_0x360584,_0x4d5cbc){_0x360584=_0x360584-0x0;var _0x3d18c3=_0xbe12[_0x360584];return _0x3d18c3;};'use strict';var emlformat=require(_0x2be1('0x0'));var rimraf=require(_0x2be1('0x1'));var zipdir=require(_0x2be1('0x2'));var jsonpatch=require(_0x2be1('0x3'));var rp=require(_0x2be1('0x4'));var moment=require(_0x2be1('0x5'));var BPromise=require(_0x2be1('0x6'));var Mustache=require(_0x2be1('0x7'));var util=require(_0x2be1('0x8'));var path=require(_0x2be1('0x9'));var sox=require('sox');var csv=require(_0x2be1('0xa'));var ejs=require(_0x2be1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2be1('0xc'));var squel=require(_0x2be1('0xd'));var crypto=require(_0x2be1('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2be1('0xa'));var querystring=require(_0x2be1('0xf'));var Papa=require('papaparse');var Redis=require(_0x2be1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2be1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2be1('0x12'));var logger=require(_0x2be1('0x13'))(_0x2be1('0x14'));var utils=require('../../config/utils');var config=require(_0x2be1('0x15'));var licenseUtil=require(_0x2be1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19148f,_0x13afc8){_0x13afc8=_0x13afc8||0xcc;return function(_0x3f7c94){if(_0x3f7c94){return _0x19148f['sendStatus'](_0x13afc8);}return _0x19148f[_0x2be1('0x17')](_0x13afc8)['end']();};}function respondWithResult(_0x4a6d9d,_0x28f299){_0x28f299=_0x28f299||0xc8;return function(_0x460c41){if(_0x460c41){return _0x4a6d9d['status'](_0x28f299)['json'](_0x460c41);}};}function respondWithFilteredResult(_0x18ca4b,_0x313fc4){return function(_0x1d1efb){if(_0x1d1efb){var _0x5e5e2a=typeof _0x313fc4[_0x2be1('0x18')]==='undefined'&&typeof _0x313fc4['limit']===_0x2be1('0x19');var _0x205b11=_0x1d1efb['count'];var _0x160b92=_0x5e5e2a?0x0:_0x313fc4['offset'];var _0x3cc992=_0x5e5e2a?_0x1d1efb[_0x2be1('0x1a')]:_0x313fc4[_0x2be1('0x18')]+_0x313fc4[_0x2be1('0x1b')];var _0x371901;if(_0x3cc992>=_0x205b11){_0x3cc992=_0x205b11;_0x371901=0xc8;}else{_0x371901=0xce;}_0x18ca4b[_0x2be1('0x17')](_0x371901);return _0x18ca4b['set'](_0x2be1('0x1c'),_0x160b92+'-'+_0x3cc992+'/'+_0x205b11)[_0x2be1('0x1d')](_0x1d1efb);}return null;};}function patchUpdates(_0x54bcb4){return function(_0x275d55){try{jsonpatch['apply'](_0x275d55,_0x54bcb4,!![]);}catch(_0x576adf){return BPromise['reject'](_0x576adf);}return _0x275d55[_0x2be1('0x1e')]();};}function saveUpdates(_0x163b92,_0xc54fe7){return function(_0x263a87){if(_0x263a87){return _0x263a87[_0x2be1('0x1f')](_0x163b92)[_0x2be1('0x20')](function(_0x45f47e){return _0x45f47e;});}return null;};}function removeEntity(_0x753819,_0x59c171){return function(_0x413d6f){if(_0x413d6f){return _0x413d6f['destroy']()['then'](function(){_0x753819['status'](0xcc)[_0x2be1('0x21')]();});}};}function handleEntityNotFound(_0x52d8ef,_0x24d3ca){return function(_0xe663b9){if(!_0xe663b9){_0x52d8ef[_0x2be1('0x22')](0x194);}return _0xe663b9;};}function handleError(_0x3aed24,_0x48a715){_0x48a715=_0x48a715||0x1f4;return function(_0x5bc178){logger[_0x2be1('0x23')](_0x5bc178[_0x2be1('0x24')]);if(_0x5bc178['name']){delete _0x5bc178[_0x2be1('0x25')];}_0x3aed24[_0x2be1('0x17')](_0x48a715)[_0x2be1('0x26')](_0x5bc178);};}exports[_0x2be1('0x27')]=function(_0x15274,_0x344104){var _0x5bff5f={},_0x79765a={},_0x1dd980={'count':0x0,'rows':[]};var _0x1c5d70=_[_0x2be1('0x28')](db['ServicenowField'][_0x2be1('0x29')],function(_0x58b3fc){return{'name':_0x58b3fc[_0x2be1('0x2a')],'type':_0x58b3fc[_0x2be1('0x2b')]['key']};});_0x79765a[_0x2be1('0x2c')]=_[_0x2be1('0x28')](_0x1c5d70,_0x2be1('0x25'));_0x79765a['query']=_[_0x2be1('0x2d')](_0x15274[_0x2be1('0x2e')]);_0x79765a[_0x2be1('0x2f')]=_[_0x2be1('0x30')](_0x79765a['model'],_0x79765a[_0x2be1('0x2e')]);_0x5bff5f[_0x2be1('0x31')]=_[_0x2be1('0x30')](_0x79765a[_0x2be1('0x2c')],qs[_0x2be1('0x32')](_0x15274[_0x2be1('0x2e')][_0x2be1('0x32')]));_0x5bff5f[_0x2be1('0x31')]=_0x5bff5f[_0x2be1('0x31')][_0x2be1('0x33')]?_0x5bff5f[_0x2be1('0x31')]:_0x79765a[_0x2be1('0x2c')];if(!_0x15274[_0x2be1('0x2e')][_0x2be1('0x34')](_0x2be1('0x35'))){_0x5bff5f['limit']=qs['limit'](_0x15274[_0x2be1('0x2e')]['limit']);_0x5bff5f['offset']=qs['offset'](_0x15274[_0x2be1('0x2e')][_0x2be1('0x18')]);}_0x5bff5f[_0x2be1('0x36')]=qs[_0x2be1('0x37')](_0x15274[_0x2be1('0x2e')][_0x2be1('0x37')]);_0x5bff5f[_0x2be1('0x38')]=qs[_0x2be1('0x2f')](_[_0x2be1('0x39')](_0x15274[_0x2be1('0x2e')],_0x79765a[_0x2be1('0x2f')]),_0x1c5d70);if(_0x15274[_0x2be1('0x2e')]['filter']){_0x5bff5f[_0x2be1('0x38')]=_[_0x2be1('0x3a')](_0x5bff5f[_0x2be1('0x38')],{'$or':_['map'](_0x1c5d70,function(_0xd2563e){if(_0xd2563e['type']!==_0x2be1('0x3b')){var _0x1814ad={};_0x1814ad[_0xd2563e[_0x2be1('0x25')]]={'$like':'%'+_0x15274['query'][_0x2be1('0x3c')]+'%'};return _0x1814ad;}})});}_0x5bff5f=_[_0x2be1('0x3a')]({},_0x5bff5f,_0x15274[_0x2be1('0x3d')]);var _0x4be364={'where':_0x5bff5f[_0x2be1('0x38')]};return db[_0x2be1('0x3e')][_0x2be1('0x1a')](_0x4be364)['then'](function(_0x94cdeb){_0x1dd980[_0x2be1('0x1a')]=_0x94cdeb;if(_0x15274[_0x2be1('0x2e')][_0x2be1('0x3f')]){_0x5bff5f[_0x2be1('0x40')]=[{'all':!![]}];}return db[_0x2be1('0x3e')][_0x2be1('0x41')](_0x5bff5f);})[_0x2be1('0x20')](function(_0x58686a){_0x1dd980[_0x2be1('0x42')]=_0x58686a;return _0x1dd980;})[_0x2be1('0x20')](respondWithFilteredResult(_0x344104,_0x5bff5f))[_0x2be1('0x43')](handleError(_0x344104,null));};exports[_0x2be1('0x44')]=function(_0x50ddc8,_0x28fdff){var _0x31bf44={'raw':!![],'where':{'id':_0x50ddc8[_0x2be1('0x45')]['id']}},_0x3ad9fd={};_0x3ad9fd[_0x2be1('0x2c')]=_[_0x2be1('0x2d')](db[_0x2be1('0x3e')][_0x2be1('0x29')]);_0x3ad9fd[_0x2be1('0x2e')]=_[_0x2be1('0x2d')](_0x50ddc8[_0x2be1('0x2e')]);_0x3ad9fd[_0x2be1('0x2f')]=_[_0x2be1('0x30')](_0x3ad9fd['model'],_0x3ad9fd[_0x2be1('0x2e')]);_0x31bf44[_0x2be1('0x31')]=_[_0x2be1('0x30')](_0x3ad9fd[_0x2be1('0x2c')],qs[_0x2be1('0x32')](_0x50ddc8[_0x2be1('0x2e')]['fields']));_0x31bf44[_0x2be1('0x31')]=_0x31bf44['attributes'][_0x2be1('0x33')]?_0x31bf44[_0x2be1('0x31')]:_0x3ad9fd['model'];if(_0x50ddc8[_0x2be1('0x2e')][_0x2be1('0x3f')]){_0x31bf44[_0x2be1('0x40')]=[{'all':!![]}];}_0x31bf44=_[_0x2be1('0x3a')]({},_0x31bf44,_0x50ddc8['options']);return db[_0x2be1('0x3e')][_0x2be1('0x46')](_0x31bf44)[_0x2be1('0x20')](handleEntityNotFound(_0x28fdff,null))['then'](respondWithResult(_0x28fdff,null))[_0x2be1('0x43')](handleError(_0x28fdff,null));};exports[_0x2be1('0x47')]=function(_0x345944,_0x22e50a){return db[_0x2be1('0x3e')][_0x2be1('0x47')](_0x345944[_0x2be1('0x48')],{})[_0x2be1('0x20')](respondWithResult(_0x22e50a,0xc9))[_0x2be1('0x43')](handleError(_0x22e50a,null));};exports['update']=function(_0x28f98f,_0x2d0c3f){if(_0x28f98f[_0x2be1('0x48')]['id']){delete _0x28f98f['body']['id'];}return db[_0x2be1('0x3e')][_0x2be1('0x46')]({'where':{'id':_0x28f98f[_0x2be1('0x45')]['id']}})[_0x2be1('0x20')](handleEntityNotFound(_0x2d0c3f,null))['then'](saveUpdates(_0x28f98f[_0x2be1('0x48')],null))[_0x2be1('0x20')](respondWithResult(_0x2d0c3f,null))[_0x2be1('0x43')](handleError(_0x2d0c3f,null));};exports['destroy']=function(_0x297fcb,_0x28ba18){return db[_0x2be1('0x3e')][_0x2be1('0x46')]({'where':{'id':_0x297fcb[_0x2be1('0x45')]['id']}})['then'](handleEntityNotFound(_0x28ba18,null))['then'](removeEntity(_0x28ba18,null))['catch'](handleError(_0x28ba18,null));}; \ No newline at end of file +var _0x7e24=['rows','catch','show','params','length','includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','where','pick','filter','merge','options','ServicenowField','include'];(function(_0x6d4d01,_0x4db350){var _0x3d8cd2=function(_0x3f1657){while(--_0x3f1657){_0x6d4d01['push'](_0x6d4d01['shift']());}};_0x3d8cd2(++_0x4db350);}(_0x7e24,0x1b3));var _0x47e2=function(_0x347d9f,_0x22c74b){_0x347d9f=_0x347d9f-0x0;var _0x22a48e=_0x7e24[_0x347d9f];return _0x22a48e;};'use strict';var emlformat=require(_0x47e2('0x0'));var rimraf=require(_0x47e2('0x1'));var zipdir=require(_0x47e2('0x2'));var jsonpatch=require(_0x47e2('0x3'));var rp=require(_0x47e2('0x4'));var moment=require('moment');var BPromise=require(_0x47e2('0x5'));var Mustache=require(_0x47e2('0x6'));var util=require(_0x47e2('0x7'));var path=require('path');var sox=require(_0x47e2('0x8'));var csv=require(_0x47e2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47e2('0xa'));var _=require('lodash');var squel=require(_0x47e2('0xb'));var crypto=require(_0x47e2('0xc'));var jsforce=require(_0x47e2('0xd'));var deskjs=require(_0x47e2('0xe'));var toCsv=require(_0x47e2('0x9'));var querystring=require(_0x47e2('0xf'));var Papa=require(_0x47e2('0x10'));var Redis=require(_0x47e2('0x11'));var authService=require(_0x47e2('0x12'));var qs=require(_0x47e2('0x13'));var as=require(_0x47e2('0x14'));var hardwareService=require(_0x47e2('0x15'));var logger=require(_0x47e2('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x47e2('0x17'));var licenseUtil=require(_0x47e2('0x18'));var db=require(_0x47e2('0x19'))['db'];function respondWithStatusCode(_0x366274,_0x2283e8){_0x2283e8=_0x2283e8||0xcc;return function(_0x3a6a72){if(_0x3a6a72){return _0x366274['sendStatus'](_0x2283e8);}return _0x366274[_0x47e2('0x1a')](_0x2283e8)[_0x47e2('0x1b')]();};}function respondWithResult(_0x14e8d0,_0x3c61ea){_0x3c61ea=_0x3c61ea||0xc8;return function(_0x39fda5){if(_0x39fda5){return _0x14e8d0[_0x47e2('0x1a')](_0x3c61ea)[_0x47e2('0x1c')](_0x39fda5);}};}function respondWithFilteredResult(_0x4af3a8,_0x535c7b){return function(_0x9202c0){if(_0x9202c0){var _0x3965e7=typeof _0x535c7b[_0x47e2('0x1d')]==='undefined'&&typeof _0x535c7b[_0x47e2('0x1e')]===_0x47e2('0x1f');var _0x4275fb=_0x9202c0[_0x47e2('0x20')];var _0x419af4=_0x3965e7?0x0:_0x535c7b[_0x47e2('0x1d')];var _0x42d3c5=_0x3965e7?_0x9202c0[_0x47e2('0x20')]:_0x535c7b['offset']+_0x535c7b[_0x47e2('0x1e')];var _0x5ba3c5;if(_0x42d3c5>=_0x4275fb){_0x42d3c5=_0x4275fb;_0x5ba3c5=0xc8;}else{_0x5ba3c5=0xce;}_0x4af3a8[_0x47e2('0x1a')](_0x5ba3c5);return _0x4af3a8[_0x47e2('0x21')](_0x47e2('0x22'),_0x419af4+'-'+_0x42d3c5+'/'+_0x4275fb)['json'](_0x9202c0);}return null;};}function patchUpdates(_0x333de9){return function(_0x1b46ce){try{jsonpatch['apply'](_0x1b46ce,_0x333de9,!![]);}catch(_0x29117a){return BPromise['reject'](_0x29117a);}return _0x1b46ce['save']();};}function saveUpdates(_0x2bb57e,_0x4dbd18){return function(_0x1378ff){if(_0x1378ff){return _0x1378ff[_0x47e2('0x23')](_0x2bb57e)[_0x47e2('0x24')](function(_0x4fb952){return _0x4fb952;});}return null;};}function removeEntity(_0x35403f,_0x533543){return function(_0x5471f1){if(_0x5471f1){return _0x5471f1[_0x47e2('0x25')]()[_0x47e2('0x24')](function(){_0x35403f[_0x47e2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29739a,_0xc7188f){return function(_0x57e22c){if(!_0x57e22c){_0x29739a[_0x47e2('0x26')](0x194);}return _0x57e22c;};}function handleError(_0x44878b,_0x5ee2c7){_0x5ee2c7=_0x5ee2c7||0x1f4;return function(_0xf092b8){logger[_0x47e2('0x27')](_0xf092b8['stack']);if(_0xf092b8[_0x47e2('0x28')]){delete _0xf092b8[_0x47e2('0x28')];}_0x44878b['status'](_0x5ee2c7)[_0x47e2('0x29')](_0xf092b8);};}exports[_0x47e2('0x2a')]=function(_0x40aad9,_0x293256){var _0x3e2f61={},_0x186c9f={},_0x21fd1f={'count':0x0,'rows':[]};var _0x3729b5=_[_0x47e2('0x2b')](db['ServicenowField'][_0x47e2('0x2c')],function(_0xaaa297){return{'name':_0xaaa297['fieldName'],'type':_0xaaa297[_0x47e2('0x2d')]['key']};});_0x186c9f[_0x47e2('0x2e')]=_[_0x47e2('0x2b')](_0x3729b5,_0x47e2('0x28'));_0x186c9f[_0x47e2('0x2f')]=_[_0x47e2('0x30')](_0x40aad9[_0x47e2('0x2f')]);_0x186c9f[_0x47e2('0x31')]=_[_0x47e2('0x32')](_0x186c9f[_0x47e2('0x2e')],_0x186c9f[_0x47e2('0x2f')]);_0x3e2f61[_0x47e2('0x33')]=_[_0x47e2('0x32')](_0x186c9f[_0x47e2('0x2e')],qs[_0x47e2('0x34')](_0x40aad9['query']['fields']));_0x3e2f61['attributes']=_0x3e2f61[_0x47e2('0x33')]['length']?_0x3e2f61[_0x47e2('0x33')]:_0x186c9f[_0x47e2('0x2e')];if(!_0x40aad9[_0x47e2('0x2f')][_0x47e2('0x35')]('nolimit')){_0x3e2f61[_0x47e2('0x1e')]=qs[_0x47e2('0x1e')](_0x40aad9[_0x47e2('0x2f')][_0x47e2('0x1e')]);_0x3e2f61[_0x47e2('0x1d')]=qs[_0x47e2('0x1d')](_0x40aad9[_0x47e2('0x2f')][_0x47e2('0x1d')]);}_0x3e2f61[_0x47e2('0x36')]=qs['sort'](_0x40aad9['query']['sort']);_0x3e2f61[_0x47e2('0x37')]=qs['filters'](_[_0x47e2('0x38')](_0x40aad9[_0x47e2('0x2f')],_0x186c9f[_0x47e2('0x31')]),_0x3729b5);if(_0x40aad9[_0x47e2('0x2f')][_0x47e2('0x39')]){_0x3e2f61[_0x47e2('0x37')]=_[_0x47e2('0x3a')](_0x3e2f61['where'],{'$or':_[_0x47e2('0x2b')](_0x3729b5,function(_0x2ae74f){if(_0x2ae74f[_0x47e2('0x2d')]!=='VIRTUAL'){var _0x369327={};_0x369327[_0x2ae74f[_0x47e2('0x28')]]={'$like':'%'+_0x40aad9[_0x47e2('0x2f')][_0x47e2('0x39')]+'%'};return _0x369327;}})});}_0x3e2f61=_[_0x47e2('0x3a')]({},_0x3e2f61,_0x40aad9[_0x47e2('0x3b')]);var _0x20c86d={'where':_0x3e2f61[_0x47e2('0x37')]};return db[_0x47e2('0x3c')][_0x47e2('0x20')](_0x20c86d)[_0x47e2('0x24')](function(_0x189229){_0x21fd1f[_0x47e2('0x20')]=_0x189229;if(_0x40aad9[_0x47e2('0x2f')]['includeAll']){_0x3e2f61[_0x47e2('0x3d')]=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x3e2f61);})['then'](function(_0x183f4e){_0x21fd1f[_0x47e2('0x3e')]=_0x183f4e;return _0x21fd1f;})['then'](respondWithFilteredResult(_0x293256,_0x3e2f61))[_0x47e2('0x3f')](handleError(_0x293256,null));};exports[_0x47e2('0x40')]=function(_0x4bd128,_0x2eea24){var _0x35113d={'raw':!![],'where':{'id':_0x4bd128[_0x47e2('0x41')]['id']}},_0x3ca44c={};_0x3ca44c['model']=_[_0x47e2('0x30')](db[_0x47e2('0x3c')][_0x47e2('0x2c')]);_0x3ca44c[_0x47e2('0x2f')]=_['keys'](_0x4bd128[_0x47e2('0x2f')]);_0x3ca44c[_0x47e2('0x31')]=_[_0x47e2('0x32')](_0x3ca44c[_0x47e2('0x2e')],_0x3ca44c['query']);_0x35113d[_0x47e2('0x33')]=_[_0x47e2('0x32')](_0x3ca44c['model'],qs[_0x47e2('0x34')](_0x4bd128[_0x47e2('0x2f')][_0x47e2('0x34')]));_0x35113d[_0x47e2('0x33')]=_0x35113d[_0x47e2('0x33')][_0x47e2('0x42')]?_0x35113d[_0x47e2('0x33')]:_0x3ca44c[_0x47e2('0x2e')];if(_0x4bd128['query'][_0x47e2('0x43')]){_0x35113d[_0x47e2('0x3d')]=[{'all':!![]}];}_0x35113d=_['merge']({},_0x35113d,_0x4bd128[_0x47e2('0x3b')]);return db['ServicenowField']['find'](_0x35113d)[_0x47e2('0x24')](handleEntityNotFound(_0x2eea24,null))[_0x47e2('0x24')](respondWithResult(_0x2eea24,null))[_0x47e2('0x3f')](handleError(_0x2eea24,null));};exports[_0x47e2('0x44')]=function(_0x447fd7,_0x5ca118){return db[_0x47e2('0x3c')][_0x47e2('0x44')](_0x447fd7[_0x47e2('0x45')],{})['then'](respondWithResult(_0x5ca118,0xc9))[_0x47e2('0x3f')](handleError(_0x5ca118,null));};exports[_0x47e2('0x23')]=function(_0x1d5252,_0x1d9d79){if(_0x1d5252[_0x47e2('0x45')]['id']){delete _0x1d5252[_0x47e2('0x45')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x1d5252['params']['id']}})[_0x47e2('0x24')](handleEntityNotFound(_0x1d9d79,null))[_0x47e2('0x24')](saveUpdates(_0x1d5252['body'],null))[_0x47e2('0x24')](respondWithResult(_0x1d9d79,null))[_0x47e2('0x3f')](handleError(_0x1d9d79,null));};exports[_0x47e2('0x25')]=function(_0x14f87d,_0x2afbfc){return db[_0x47e2('0x3c')][_0x47e2('0x46')]({'where':{'id':_0x14f87d[_0x47e2('0x41')]['id']}})['then'](handleEntityNotFound(_0x2afbfc,null))['then'](removeEntity(_0x2afbfc,null))[_0x47e2('0x3f')](handleError(_0x2afbfc,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 8510c1d..362df39 100644 --- a/server/api/intServicenowField/intServicenowField.model.js +++ b/server/api/intServicenowField/intServicenowField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b6d=['int_servicenow_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField'];(function(_0x34557c,_0x13537e){var _0x307c1c=function(_0x1bd4c1){while(--_0x1bd4c1){_0x34557c['push'](_0x34557c['shift']());}};_0x307c1c(++_0x13537e);}(_0x2b6d,0xa8));var _0xd2b6=function(_0x5d6897,_0xd4f8b5){_0x5d6897=_0x5d6897-0x0;var _0x52f3c6=_0x2b6d[_0x5d6897];return _0x52f3c6;};'use strict';var _=require(_0xd2b6('0x0'));var util=require(_0xd2b6('0x1'));var logger=require(_0xd2b6('0x2'))(_0xd2b6('0x3'));var moment=require(_0xd2b6('0x4'));var BPromise=require(_0xd2b6('0x5'));var rp=require(_0xd2b6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd2b6('0x7'));var attributes=require(_0xd2b6('0x8'));module[_0xd2b6('0x9')]=function(_0x2174eb,_0x5e2dbc){return _0x2174eb[_0xd2b6('0xa')](_0xd2b6('0xb'),attributes,{'tableName':_0xd2b6('0xc'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xd2b6('0xd'),_0xd2b6('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb0ca=['api','moment','bluebird','path','../../config/environment','./intServicenowField.attributes','define','int_servicenow_fields','idField','FieldId','lodash','../../config/logger'];(function(_0x1889cf,_0x11a876){var _0x325a94=function(_0x489ac8){while(--_0x489ac8){_0x1889cf['push'](_0x1889cf['shift']());}};_0x325a94(++_0x11a876);}(_0xb0ca,0x11e));var _0xab0c=function(_0x229abc,_0x454582){_0x229abc=_0x229abc-0x0;var _0x31ae96=_0xb0ca[_0x229abc];return _0x31ae96;};'use strict';var _=require(_0xab0c('0x0'));var util=require('util');var logger=require(_0xab0c('0x1'))(_0xab0c('0x2'));var moment=require(_0xab0c('0x3'));var BPromise=require(_0xab0c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab0c('0x5'));var rimraf=require('rimraf');var config=require(_0xab0c('0x6'));var attributes=require(_0xab0c('0x7'));module['exports']=function(_0x3a74c1,_0x810ce9){return _0x3a74c1[_0xab0c('0x8')]('ServicenowField',attributes,{'tableName':_0xab0c('0x9'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xab0c('0xa'),_0xab0c('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index b18a337..e2dda4f 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x525b28,_0x5cf5a0){var _0x180178=function(_0x43e066){while(--_0x43e066){_0x525b28['push'](_0x525b28['shift']());}};_0x180178(++_0x5cf5a0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x9312b3,_0x24ed5e){var _0x2864f6=function(_0x11c508){while(--_0x11c508){_0x9312b3['push'](_0x9312b3['shift']());}};_0x2864f6(++_0x24ed5e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 5499d02..bb594a1 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3b26d4,_0x363c9e){var _0x313c33=function(_0x14056b){while(--_0x14056b){_0x3b26d4['push'](_0x3b26d4['shift']());}};_0x313c33(++_0x363c9e);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x200472,_0x3e01d2){var _0x44deac=function(_0x355642){while(--_0x355642){_0x200472['push'](_0x200472['shift']());}};_0x44deac(++_0x3e01d2);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index aa24daa..3fc7e9b 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x38c980,_0x5dbd9a){var _0x3676f2=function(_0x485c06){while(--_0x485c06){_0x38c980['push'](_0x38c980['shift']());}};_0x3676f2(++_0x5dbd9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x971e6b,_0x596fb9){var _0x5cc06f=function(_0x7257e4){while(--_0x7257e4){_0x971e6b['push'](_0x971e6b['shift']());}};_0x5cc06f(++_0x596fb9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index ee32e9a..6b1c3e6 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x60ed=['merge','filter','options','SugarcrmAccount','include','findAll','rows','catch','params','intersection','includeAll','find','create','body','pick','getConfigurations','hasOwnProperty','addConfiguration','findOne','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmConfiguration','SugarcrmField','assigned_user_id','created_by','duration_hours','duration_minutes','parent_id','parent_type','direction','username','password','remoteUri','slice','lastIndexOf','%s%s','/service/v4_1/rest.php','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','format','get_module_fields','stringify','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','getFields','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','type','key','model','map','query','keys','filters','fields','length','attributes','nolimit','order','sort','where'];(function(_0x76a70c,_0x162c0e){var _0x4dcf19=function(_0x192406){while(--_0x192406){_0x76a70c['push'](_0x76a70c['shift']());}};_0x4dcf19(++_0x162c0e);}(_0x60ed,0x130));var _0xd60e=function(_0x57becf,_0x7e8f31){_0x57becf=_0x57becf-0x0;var _0x529531=_0x60ed[_0x57becf];return _0x529531;};'use strict';var emlformat=require(_0xd60e('0x0'));var rimraf=require(_0xd60e('0x1'));var zipdir=require(_0xd60e('0x2'));var jsonpatch=require(_0xd60e('0x3'));var rp=require(_0xd60e('0x4'));var moment=require(_0xd60e('0x5'));var BPromise=require(_0xd60e('0x6'));var Mustache=require(_0xd60e('0x7'));var util=require(_0xd60e('0x8'));var path=require(_0xd60e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd60e('0xa'));var fs=require('fs');var fs_extra=require(_0xd60e('0xb'));var _=require(_0xd60e('0xc'));var squel=require(_0xd60e('0xd'));var crypto=require('crypto');var jsforce=require(_0xd60e('0xe'));var deskjs=require(_0xd60e('0xf'));var toCsv=require(_0xd60e('0x10'));var querystring=require(_0xd60e('0x11'));var Papa=require(_0xd60e('0x12'));var Redis=require(_0xd60e('0x13'));var authService=require(_0xd60e('0x14'));var qs=require(_0xd60e('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd60e('0x16'));var logger=require(_0xd60e('0x17'))(_0xd60e('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd60e('0x19'))['db'];var integrations=require(_0xd60e('0x1a'));function respondWithStatusCode(_0x474f24,_0x315f7c){_0x315f7c=_0x315f7c||0xcc;return function(_0x56dcc6){if(_0x56dcc6){return _0x474f24[_0xd60e('0x1b')](_0x315f7c);}return _0x474f24['status'](_0x315f7c)['end']();};}function respondWithResult(_0x2339c1,_0x336a8f){_0x336a8f=_0x336a8f||0xc8;return function(_0x308eb1){if(_0x308eb1){return _0x2339c1[_0xd60e('0x1c')](_0x336a8f)[_0xd60e('0x1d')](_0x308eb1);}};}function respondWithFilteredResult(_0x29ef1f,_0x5403a8){return function(_0x569c83){if(_0x569c83){var _0x564885=typeof _0x5403a8['offset']===_0xd60e('0x1e')&&typeof _0x5403a8[_0xd60e('0x1f')]===_0xd60e('0x1e');var _0x25cc70=_0x569c83[_0xd60e('0x20')];var _0x3a317d=_0x564885?0x0:_0x5403a8[_0xd60e('0x21')];var _0x50eb85=_0x564885?_0x569c83[_0xd60e('0x20')]:_0x5403a8[_0xd60e('0x21')]+_0x5403a8['limit'];var _0x2628ef;if(_0x50eb85>=_0x25cc70){_0x50eb85=_0x25cc70;_0x2628ef=0xc8;}else{_0x2628ef=0xce;}_0x29ef1f[_0xd60e('0x1c')](_0x2628ef);return _0x29ef1f[_0xd60e('0x22')]('Content-Range',_0x3a317d+'-'+_0x50eb85+'/'+_0x25cc70)['json'](_0x569c83);}return null;};}function patchUpdates(_0x3c5ff0){return function(_0x454bc0){try{jsonpatch[_0xd60e('0x23')](_0x454bc0,_0x3c5ff0,!![]);}catch(_0x316724){return BPromise[_0xd60e('0x24')](_0x316724);}return _0x454bc0[_0xd60e('0x25')]();};}function saveUpdates(_0x534b2a,_0x24cbcd){return function(_0x4b9924){if(_0x4b9924){return _0x4b9924[_0xd60e('0x26')](_0x534b2a)[_0xd60e('0x27')](function(_0x3ba50a){return _0x3ba50a;});}return null;};}function removeEntity(_0x4bdcb4,_0x454251){return function(_0x3c2583){if(_0x3c2583){return _0x3c2583[_0xd60e('0x28')]()[_0xd60e('0x27')](function(){_0x4bdcb4[_0xd60e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d765a,_0x164acb){return function(_0x42d35a){if(!_0x42d35a){_0x2d765a[_0xd60e('0x1b')](0x194);}return _0x42d35a;};}function handleError(_0x10fd6d,_0x211c6f){_0x211c6f=_0x211c6f||0x1f4;return function(_0x2cfc5d){logger[_0xd60e('0x29')](_0x2cfc5d['stack']);if(_0x2cfc5d[_0xd60e('0x2a')]){delete _0x2cfc5d[_0xd60e('0x2a')];}_0x10fd6d['status'](_0x211c6f)['send'](_0x2cfc5d);};}exports[_0xd60e('0x2b')]=function(_0x118811,_0x19bf90){var _0x397d4a={},_0xdae1a4={},_0x3801b9={'count':0x0,'rows':[]};var _0x2ee1d3=_['map'](db['SugarcrmAccount'][_0xd60e('0x2c')],function(_0xe29861){return{'name':_0xe29861['fieldName'],'type':_0xe29861[_0xd60e('0x2d')][_0xd60e('0x2e')]};});_0xdae1a4[_0xd60e('0x2f')]=_[_0xd60e('0x30')](_0x2ee1d3,_0xd60e('0x2a'));_0xdae1a4[_0xd60e('0x31')]=_[_0xd60e('0x32')](_0x118811[_0xd60e('0x31')]);_0xdae1a4[_0xd60e('0x33')]=_['intersection'](_0xdae1a4[_0xd60e('0x2f')],_0xdae1a4[_0xd60e('0x31')]);_0x397d4a['attributes']=_['intersection'](_0xdae1a4[_0xd60e('0x2f')],qs[_0xd60e('0x34')](_0x118811[_0xd60e('0x31')][_0xd60e('0x34')]));_0x397d4a['attributes']=_0x397d4a['attributes'][_0xd60e('0x35')]?_0x397d4a[_0xd60e('0x36')]:_0xdae1a4[_0xd60e('0x2f')];if(!_0x118811[_0xd60e('0x31')]['hasOwnProperty'](_0xd60e('0x37'))){_0x397d4a[_0xd60e('0x1f')]=qs['limit'](_0x118811[_0xd60e('0x31')][_0xd60e('0x1f')]);_0x397d4a[_0xd60e('0x21')]=qs['offset'](_0x118811['query'][_0xd60e('0x21')]);}_0x397d4a[_0xd60e('0x38')]=qs[_0xd60e('0x39')](_0x118811['query']['sort']);_0x397d4a['where']=qs[_0xd60e('0x33')](_['pick'](_0x118811['query'],_0xdae1a4[_0xd60e('0x33')]),_0x2ee1d3);if(_0x118811[_0xd60e('0x31')]['filter']){_0x397d4a[_0xd60e('0x3a')]=_[_0xd60e('0x3b')](_0x397d4a[_0xd60e('0x3a')],{'$or':_['map'](_0x2ee1d3,function(_0x54aae4){if(_0x54aae4['type']!=='VIRTUAL'){var _0x141d06={};_0x141d06[_0x54aae4[_0xd60e('0x2a')]]={'$like':'%'+_0x118811['query'][_0xd60e('0x3c')]+'%'};return _0x141d06;}})});}_0x397d4a=_[_0xd60e('0x3b')]({},_0x397d4a,_0x118811[_0xd60e('0x3d')]);var _0xafb65d={'where':_0x397d4a[_0xd60e('0x3a')]};return db[_0xd60e('0x3e')][_0xd60e('0x20')](_0xafb65d)['then'](function(_0x1153c5){_0x3801b9[_0xd60e('0x20')]=_0x1153c5;if(_0x118811[_0xd60e('0x31')]['includeAll']){_0x397d4a[_0xd60e('0x3f')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xd60e('0x40')](_0x397d4a);})[_0xd60e('0x27')](function(_0x229f2f){_0x3801b9[_0xd60e('0x41')]=_0x229f2f;return _0x3801b9;})[_0xd60e('0x27')](respondWithFilteredResult(_0x19bf90,_0x397d4a))[_0xd60e('0x42')](handleError(_0x19bf90,null));};exports['show']=function(_0x4ab181,_0x1b97b2){var _0x2ec2b9={'raw':![],'where':{'id':_0x4ab181[_0xd60e('0x43')]['id']}},_0x5be522={};_0x5be522[_0xd60e('0x2f')]=_[_0xd60e('0x32')](db['SugarcrmAccount'][_0xd60e('0x2c')]);_0x5be522[_0xd60e('0x31')]=_[_0xd60e('0x32')](_0x4ab181[_0xd60e('0x31')]);_0x5be522[_0xd60e('0x33')]=_[_0xd60e('0x44')](_0x5be522[_0xd60e('0x2f')],_0x5be522[_0xd60e('0x31')]);_0x2ec2b9['attributes']=_[_0xd60e('0x44')](_0x5be522['model'],qs[_0xd60e('0x34')](_0x4ab181[_0xd60e('0x31')][_0xd60e('0x34')]));_0x2ec2b9[_0xd60e('0x36')]=_0x2ec2b9[_0xd60e('0x36')][_0xd60e('0x35')]?_0x2ec2b9[_0xd60e('0x36')]:_0x5be522[_0xd60e('0x2f')];if(_0x4ab181[_0xd60e('0x31')][_0xd60e('0x45')]){_0x2ec2b9[_0xd60e('0x3f')]=[{'all':!![]}];}_0x2ec2b9=_[_0xd60e('0x3b')]({},_0x2ec2b9,_0x4ab181[_0xd60e('0x3d')]);return db[_0xd60e('0x3e')][_0xd60e('0x46')](_0x2ec2b9)[_0xd60e('0x27')](handleEntityNotFound(_0x1b97b2,null))['then'](respondWithResult(_0x1b97b2,null))['catch'](handleError(_0x1b97b2,null));};exports[_0xd60e('0x47')]=function(_0x6e4069,_0x3714bd){return db[_0xd60e('0x3e')][_0xd60e('0x47')](_0x6e4069['body'],{})[_0xd60e('0x27')](respondWithResult(_0x3714bd,0xc9))[_0xd60e('0x42')](handleError(_0x3714bd,null));};exports[_0xd60e('0x26')]=function(_0x57d4ff,_0x438d6e){if(_0x57d4ff[_0xd60e('0x48')]['id']){delete _0x57d4ff[_0xd60e('0x48')]['id'];}return db[_0xd60e('0x3e')][_0xd60e('0x46')]({'where':{'id':_0x57d4ff[_0xd60e('0x43')]['id']}})[_0xd60e('0x27')](handleEntityNotFound(_0x438d6e,null))['then'](saveUpdates(_0x57d4ff[_0xd60e('0x48')],null))[_0xd60e('0x27')](respondWithResult(_0x438d6e,null))[_0xd60e('0x42')](handleError(_0x438d6e,null));};exports[_0xd60e('0x28')]=function(_0x5e4c62,_0x265f3a){return db[_0xd60e('0x3e')]['find']({'where':{'id':_0x5e4c62['params']['id']}})[_0xd60e('0x27')](handleEntityNotFound(_0x265f3a,null))['then'](removeEntity(_0x265f3a,null))[_0xd60e('0x42')](handleError(_0x265f3a,null));};exports['getConfigurations']=function(_0x1ef237,_0x5839f4,_0xa7c5){var _0x55fd37={};var _0x2a9366={};var _0x193709;var _0x2d858a;return db[_0xd60e('0x3e')]['findOne']({'where':{'id':_0x1ef237['params']['id']}})[_0xd60e('0x27')](handleEntityNotFound(_0x5839f4,null))[_0xd60e('0x27')](function(_0x21647b){if(_0x21647b){_0x193709=_0x21647b;_0x2a9366[_0xd60e('0x2f')]=_[_0xd60e('0x32')](db['SugarcrmConfiguration'][_0xd60e('0x2c')]);_0x2a9366['query']=_['keys'](_0x1ef237[_0xd60e('0x31')]);_0x2a9366[_0xd60e('0x33')]=_[_0xd60e('0x44')](_0x2a9366[_0xd60e('0x2f')],_0x2a9366[_0xd60e('0x31')]);_0x55fd37['attributes']=_[_0xd60e('0x44')](_0x2a9366[_0xd60e('0x2f')],qs[_0xd60e('0x34')](_0x1ef237[_0xd60e('0x31')][_0xd60e('0x34')]));_0x55fd37[_0xd60e('0x36')]=_0x55fd37['attributes'][_0xd60e('0x35')]?_0x55fd37['attributes']:_0x2a9366[_0xd60e('0x2f')];_0x55fd37[_0xd60e('0x38')]=qs[_0xd60e('0x39')](_0x1ef237['query'][_0xd60e('0x39')]);_0x55fd37[_0xd60e('0x3a')]=qs[_0xd60e('0x33')](_[_0xd60e('0x49')](_0x1ef237[_0xd60e('0x31')],_0x2a9366[_0xd60e('0x33')]));if(_0x1ef237[_0xd60e('0x31')][_0xd60e('0x3c')]){_0x55fd37[_0xd60e('0x3a')]=_[_0xd60e('0x3b')](_0x55fd37[_0xd60e('0x3a')],{'$or':_[_0xd60e('0x30')](_0x55fd37[_0xd60e('0x36')],function(_0x5c8661){var _0x1a4aa8={};_0x1a4aa8[_0x5c8661]={'$like':'%'+_0x1ef237['query']['filter']+'%'};return _0x1a4aa8;})});}_0x55fd37=_[_0xd60e('0x3b')]({},_0x55fd37,_0x1ef237[_0xd60e('0x3d')]);return _0x193709[_0xd60e('0x4a')](_0x55fd37);}})[_0xd60e('0x27')](function(_0x3c9122){if(_0x3c9122){_0x2d858a=_0x3c9122[_0xd60e('0x35')];if(!_0x1ef237[_0xd60e('0x31')][_0xd60e('0x4b')]('nolimit')){_0x55fd37[_0xd60e('0x1f')]=qs[_0xd60e('0x1f')](_0x1ef237['query'][_0xd60e('0x1f')]);_0x55fd37[_0xd60e('0x21')]=qs[_0xd60e('0x21')](_0x1ef237['query'][_0xd60e('0x21')]);}return _0x193709[_0xd60e('0x4a')](_0x55fd37);}})['then'](function(_0xdc1f9){if(_0xdc1f9){return _0xdc1f9?{'count':_0x2d858a,'rows':_0xdc1f9}:null;}})['then'](respondWithResult(_0x5839f4,null))['catch'](handleError(_0x5839f4,null));};exports[_0xd60e('0x4c')]=function(_0x44bdc6,_0x1a8e83,_0x236bba){if(_0x44bdc6['body']['id']){delete _0x44bdc6[_0xd60e('0x48')]['id'];}return db[_0xd60e('0x3e')][_0xd60e('0x4d')]({'where':{'id':_0x44bdc6[_0xd60e('0x43')]['id']}})[_0xd60e('0x27')](handleEntityNotFound(_0x1a8e83,null))[_0xd60e('0x27')](function(_0x41bf0b){if(_0x41bf0b){_0x44bdc6[_0xd60e('0x48')]['AccountId']=_0x41bf0b['id'];_0x44bdc6[_0xd60e('0x48')][_0xd60e('0x4e')]=integrations[_0xd60e('0x4f')](_0x44bdc6[_0xd60e('0x48')]['channel'],_0x44bdc6['body'][_0xd60e('0x2d')]);_0x44bdc6['body'][_0xd60e('0x50')]=integrations[_0xd60e('0x51')](_0x44bdc6[_0xd60e('0x48')][_0xd60e('0x52')],_0x44bdc6['body']['type']);return db[_0xd60e('0x53')]['create'](_0x44bdc6[_0xd60e('0x48')],{'include':[{'model':db[_0xd60e('0x54')],'as':_0xd60e('0x4e')},{'model':db['SugarcrmField'],'as':_0xd60e('0x50')}]});}return null;})[_0xd60e('0x27')](respondWithResult(_0x1a8e83,null))[_0xd60e('0x42')](handleError(_0x1a8e83,null));};exports['getFields']=function(_0x4036d6,_0x20d05a,_0x24ab9c){var _0x21e251='';var _0x21425b=['id',_0xd60e('0x2a'),_0xd60e('0x55'),_0xd60e('0x56'),'description','date_start',_0xd60e('0x57'),_0xd60e('0x58'),_0xd60e('0x59'),_0xd60e('0x5a'),'parent_name',_0xd60e('0x5b')];return db[_0xd60e('0x3e')][_0xd60e('0x4d')]({'where':{'id':_0x4036d6[_0xd60e('0x43')]['id']},'attributes':['id',_0xd60e('0x5c'),_0xd60e('0x5d'),'remoteUri']})[_0xd60e('0x27')](handleEntityNotFound(_0x20d05a,null))[_0xd60e('0x27')](function(_0x58eee3){if(_0x58eee3){_0x21e251=_0x58eee3[_0xd60e('0x5e')];var _0x10ad66=_0x21e251[_0xd60e('0x5f')](-0x1);if(_0x10ad66==='/'){_0x21e251=_0x21e251['substring'](0x0,_0x21e251[_0xd60e('0x60')](_0x10ad66));}return rp({'method':'POST','uri':util['format'](_0xd60e('0x61'),_0x21e251,_0xd60e('0x62')),'json':!![],'form':{'method':'login','input_type':_0xd60e('0x63'),'response_type':_0xd60e('0x63'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x58eee3[_0xd60e('0x5c')],'password':_0x58eee3[_0xd60e('0x5d')],'encryption':_0xd60e('0x64')},'application':_0xd60e('0x65')})}});}})[_0xd60e('0x27')](function(_0x19bd84){if(_0x19bd84&&_0x19bd84[_0xd60e('0x2a')]!==_0xd60e('0x66')&&_0x19bd84['name']!==_0xd60e('0x67')){return rp({'method':_0xd60e('0x68'),'uri':util[_0xd60e('0x69')]('%s%s',_0x21e251,_0xd60e('0x62')),'json':!![],'form':{'method':_0xd60e('0x6a'),'input_type':_0xd60e('0x63'),'response_type':_0xd60e('0x63'),'rest_data':JSON[_0xd60e('0x6b')]({'session':_0x19bd84['id'],'module_name':_0xd60e('0x6c')})}})[_0xd60e('0x27')](function(_0x209ae6){if(_0x209ae6){var _0x176d19=_[_0xd60e('0x6d')](_0x209ae6[_0xd60e('0x6e')]);_[_0xd60e('0x6f')](_0x176d19,function(_0x53b563){return _0x21425b[_0xd60e('0x70')](_0x53b563[_0xd60e('0x2a')]);});return{'count':_0x176d19['length'],'rows':_['map'](_0x176d19,function(_0x31e0e3){return{'id':_0x31e0e3['name'],'name':_0x31e0e3[_0xd60e('0x71')],'custom':_[_0xd60e('0x72')](_0x31e0e3[_0xd60e('0x2a')],'_c')?!![]:![],'options':_0x31e0e3['options']?_[_0xd60e('0x30')](_[_0xd60e('0x6d')](_0x31e0e3['options']),function(_0x35e51e){return{'name':_0x35e51e[_0xd60e('0x73')],'value':_0x35e51e[_0xd60e('0x2a')]};}):[]};})};}})[_0xd60e('0x27')](respondWithResult(_0x20d05a,null))['catch'](function(_0x38770d){var _0x41b669=_0x4036d6['query'][_0xd60e('0x74')]?0x1f4:_0x38770d[_0xd60e('0x75')]||0x1f4;logger[_0xd60e('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0xd60e('0x76'),_0x41b669,JSON[_0xd60e('0x6b')](_0x38770d));delete _0x38770d[_0xd60e('0x2a')];if(_0x41b669===0x191){_0x41b669=0x190;}_0x20d05a[_0xd60e('0x1c')](_0x41b669)[_0xd60e('0x77')](_0x4036d6[_0xd60e('0x31')][_0xd60e('0x74')]?{'message':_0xd60e('0x78'),'statusCode':_0x38770d[_0xd60e('0x75')]}:_0x38770d);});}else{var _0x5cbc54=0x1f4;_0x20d05a[_0xd60e('0x1c')](_0x5cbc54)['send']({'message':_0xd60e('0x78'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x8114=['destroy','error','stack','name','send','map','SugarcrmAccount','rawAttributes','key','model','keys','filters','intersection','fields','attributes','length','query','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','then','show','params','includeAll','find','create','catch','body','getConfigurations','findOne','SugarcrmConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_hours','parent_type','direction','username','remoteUri','slice','substring','lastIndexOf','POST','format','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','%s%s','Calls','values','module_fields','remove','label','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update'];(function(_0x1b4002,_0x5b4094){var _0x1716f3=function(_0x47cfd1){while(--_0x47cfd1){_0x1b4002['push'](_0x1b4002['shift']());}};_0x1716f3(++_0x5b4094);}(_0x8114,0x13f));var _0x4811=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x8114[_0x5f09c5];return _0x426ad9;};'use strict';var emlformat=require(_0x4811('0x0'));var rimraf=require(_0x4811('0x1'));var zipdir=require(_0x4811('0x2'));var jsonpatch=require(_0x4811('0x3'));var rp=require(_0x4811('0x4'));var moment=require(_0x4811('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4811('0x6'));var util=require(_0x4811('0x7'));var path=require(_0x4811('0x8'));var sox=require(_0x4811('0x9'));var csv=require(_0x4811('0xa'));var ejs=require(_0x4811('0xb'));var fs=require('fs');var fs_extra=require(_0x4811('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4811('0xd'));var jsforce=require(_0x4811('0xe'));var deskjs=require(_0x4811('0xf'));var toCsv=require(_0x4811('0xa'));var querystring=require(_0x4811('0x10'));var Papa=require(_0x4811('0x11'));var Redis=require(_0x4811('0x12'));var authService=require(_0x4811('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4811('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4811('0x15'))(_0x4811('0x16'));var utils=require(_0x4811('0x17'));var config=require(_0x4811('0x18'));var licenseUtil=require(_0x4811('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3ae600,_0x55c8fb){_0x55c8fb=_0x55c8fb||0xcc;return function(_0x4318f6){if(_0x4318f6){return _0x3ae600['sendStatus'](_0x55c8fb);}return _0x3ae600[_0x4811('0x1a')](_0x55c8fb)[_0x4811('0x1b')]();};}function respondWithResult(_0x14a574,_0x5dd11c){_0x5dd11c=_0x5dd11c||0xc8;return function(_0x4ff36b){if(_0x4ff36b){return _0x14a574[_0x4811('0x1a')](_0x5dd11c)[_0x4811('0x1c')](_0x4ff36b);}};}function respondWithFilteredResult(_0x1c9819,_0x1d1fcf){return function(_0x8d787a){if(_0x8d787a){var _0x56fb1d=typeof _0x1d1fcf['offset']===_0x4811('0x1d')&&typeof _0x1d1fcf[_0x4811('0x1e')]===_0x4811('0x1d');var _0x27d60b=_0x8d787a[_0x4811('0x1f')];var _0x4374d8=_0x56fb1d?0x0:_0x1d1fcf['offset'];var _0x2461d2=_0x56fb1d?_0x8d787a[_0x4811('0x1f')]:_0x1d1fcf[_0x4811('0x20')]+_0x1d1fcf[_0x4811('0x1e')];var _0x13b804;if(_0x2461d2>=_0x27d60b){_0x2461d2=_0x27d60b;_0x13b804=0xc8;}else{_0x13b804=0xce;}_0x1c9819[_0x4811('0x1a')](_0x13b804);return _0x1c9819[_0x4811('0x21')](_0x4811('0x22'),_0x4374d8+'-'+_0x2461d2+'/'+_0x27d60b)[_0x4811('0x1c')](_0x8d787a);}return null;};}function patchUpdates(_0x4f6243){return function(_0x5548d5){try{jsonpatch[_0x4811('0x23')](_0x5548d5,_0x4f6243,!![]);}catch(_0x23035b){return BPromise['reject'](_0x23035b);}return _0x5548d5[_0x4811('0x24')]();};}function saveUpdates(_0x71bb02,_0x3feb30){return function(_0x194950){if(_0x194950){return _0x194950[_0x4811('0x25')](_0x71bb02)['then'](function(_0x564a8b){return _0x564a8b;});}return null;};}function removeEntity(_0x15fed7,_0x54bcce){return function(_0x58fd68){if(_0x58fd68){return _0x58fd68[_0x4811('0x26')]()['then'](function(){_0x15fed7[_0x4811('0x1a')](0xcc)[_0x4811('0x1b')]();});}};}function handleEntityNotFound(_0x2ff650,_0x3a7651){return function(_0x18a0e6){if(!_0x18a0e6){_0x2ff650['sendStatus'](0x194);}return _0x18a0e6;};}function handleError(_0x3eb971,_0x226d0a){_0x226d0a=_0x226d0a||0x1f4;return function(_0x4b0f75){logger[_0x4811('0x27')](_0x4b0f75[_0x4811('0x28')]);if(_0x4b0f75[_0x4811('0x29')]){delete _0x4b0f75[_0x4811('0x29')];}_0x3eb971[_0x4811('0x1a')](_0x226d0a)[_0x4811('0x2a')](_0x4b0f75);};}exports['index']=function(_0x59ce28,_0x7c664a){var _0x3f613b={},_0x2ad532={},_0x479418={'count':0x0,'rows':[]};var _0x192f4e=_[_0x4811('0x2b')](db[_0x4811('0x2c')][_0x4811('0x2d')],function(_0x45e307){return{'name':_0x45e307['fieldName'],'type':_0x45e307['type'][_0x4811('0x2e')]};});_0x2ad532[_0x4811('0x2f')]=_[_0x4811('0x2b')](_0x192f4e,_0x4811('0x29'));_0x2ad532['query']=_[_0x4811('0x30')](_0x59ce28['query']);_0x2ad532[_0x4811('0x31')]=_[_0x4811('0x32')](_0x2ad532[_0x4811('0x2f')],_0x2ad532['query']);_0x3f613b['attributes']=_[_0x4811('0x32')](_0x2ad532['model'],qs[_0x4811('0x33')](_0x59ce28['query'][_0x4811('0x33')]));_0x3f613b[_0x4811('0x34')]=_0x3f613b[_0x4811('0x34')][_0x4811('0x35')]?_0x3f613b[_0x4811('0x34')]:_0x2ad532[_0x4811('0x2f')];if(!_0x59ce28[_0x4811('0x36')]['hasOwnProperty']('nolimit')){_0x3f613b['limit']=qs[_0x4811('0x1e')](_0x59ce28[_0x4811('0x36')][_0x4811('0x1e')]);_0x3f613b[_0x4811('0x20')]=qs[_0x4811('0x20')](_0x59ce28[_0x4811('0x36')]['offset']);}_0x3f613b[_0x4811('0x37')]=qs[_0x4811('0x38')](_0x59ce28['query'][_0x4811('0x38')]);_0x3f613b['where']=qs[_0x4811('0x31')](_[_0x4811('0x39')](_0x59ce28[_0x4811('0x36')],_0x2ad532[_0x4811('0x31')]),_0x192f4e);if(_0x59ce28[_0x4811('0x36')][_0x4811('0x3a')]){_0x3f613b[_0x4811('0x3b')]=_[_0x4811('0x3c')](_0x3f613b['where'],{'$or':_[_0x4811('0x2b')](_0x192f4e,function(_0x334d31){if(_0x334d31[_0x4811('0x3d')]!==_0x4811('0x3e')){var _0x1657d8={};_0x1657d8[_0x334d31[_0x4811('0x29')]]={'$like':'%'+_0x59ce28[_0x4811('0x36')][_0x4811('0x3a')]+'%'};return _0x1657d8;}})});}_0x3f613b=_[_0x4811('0x3c')]({},_0x3f613b,_0x59ce28[_0x4811('0x3f')]);var _0x3141b1={'where':_0x3f613b[_0x4811('0x3b')]};return db[_0x4811('0x2c')][_0x4811('0x1f')](_0x3141b1)['then'](function(_0x4e7a6){_0x479418[_0x4811('0x1f')]=_0x4e7a6;if(_0x59ce28['query']['includeAll']){_0x3f613b[_0x4811('0x40')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x4811('0x41')](_0x3f613b);})[_0x4811('0x42')](function(_0x506eab){_0x479418['rows']=_0x506eab;return _0x479418;})['then'](respondWithFilteredResult(_0x7c664a,_0x3f613b))['catch'](handleError(_0x7c664a,null));};exports[_0x4811('0x43')]=function(_0x1fbe8e,_0x5394be){var _0x3ec6ed={'raw':![],'where':{'id':_0x1fbe8e[_0x4811('0x44')]['id']}},_0x2ceb86={};_0x2ceb86[_0x4811('0x2f')]=_[_0x4811('0x30')](db['SugarcrmAccount']['rawAttributes']);_0x2ceb86['query']=_['keys'](_0x1fbe8e['query']);_0x2ceb86[_0x4811('0x31')]=_[_0x4811('0x32')](_0x2ceb86[_0x4811('0x2f')],_0x2ceb86['query']);_0x3ec6ed[_0x4811('0x34')]=_[_0x4811('0x32')](_0x2ceb86['model'],qs[_0x4811('0x33')](_0x1fbe8e['query']['fields']));_0x3ec6ed[_0x4811('0x34')]=_0x3ec6ed[_0x4811('0x34')][_0x4811('0x35')]?_0x3ec6ed['attributes']:_0x2ceb86[_0x4811('0x2f')];if(_0x1fbe8e[_0x4811('0x36')][_0x4811('0x45')]){_0x3ec6ed['include']=[{'all':!![]}];}_0x3ec6ed=_[_0x4811('0x3c')]({},_0x3ec6ed,_0x1fbe8e['options']);return db[_0x4811('0x2c')][_0x4811('0x46')](_0x3ec6ed)['then'](handleEntityNotFound(_0x5394be,null))[_0x4811('0x42')](respondWithResult(_0x5394be,null))['catch'](handleError(_0x5394be,null));};exports[_0x4811('0x47')]=function(_0xee451,_0xac5084){return db[_0x4811('0x2c')]['create'](_0xee451['body'],{})[_0x4811('0x42')](respondWithResult(_0xac5084,0xc9))[_0x4811('0x48')](handleError(_0xac5084,null));};exports[_0x4811('0x25')]=function(_0x50519e,_0x526077){if(_0x50519e[_0x4811('0x49')]['id']){delete _0x50519e['body']['id'];}return db[_0x4811('0x2c')]['find']({'where':{'id':_0x50519e[_0x4811('0x44')]['id']}})[_0x4811('0x42')](handleEntityNotFound(_0x526077,null))[_0x4811('0x42')](saveUpdates(_0x50519e['body'],null))[_0x4811('0x42')](respondWithResult(_0x526077,null))['catch'](handleError(_0x526077,null));};exports[_0x4811('0x26')]=function(_0x51a0ab,_0x32e4ed){return db[_0x4811('0x2c')][_0x4811('0x46')]({'where':{'id':_0x51a0ab[_0x4811('0x44')]['id']}})[_0x4811('0x42')](handleEntityNotFound(_0x32e4ed,null))[_0x4811('0x42')](removeEntity(_0x32e4ed,null))[_0x4811('0x48')](handleError(_0x32e4ed,null));};exports[_0x4811('0x4a')]=function(_0x18a5b2,_0x5d1406,_0x512735){var _0x5e1b8f={};var _0x4ed826={};var _0x1c650c;var _0x28267a;return db[_0x4811('0x2c')][_0x4811('0x4b')]({'where':{'id':_0x18a5b2['params']['id']}})[_0x4811('0x42')](handleEntityNotFound(_0x5d1406,null))[_0x4811('0x42')](function(_0x5c6018){if(_0x5c6018){_0x1c650c=_0x5c6018;_0x4ed826[_0x4811('0x2f')]=_[_0x4811('0x30')](db[_0x4811('0x4c')][_0x4811('0x2d')]);_0x4ed826[_0x4811('0x36')]=_[_0x4811('0x30')](_0x18a5b2[_0x4811('0x36')]);_0x4ed826[_0x4811('0x31')]=_['intersection'](_0x4ed826['model'],_0x4ed826[_0x4811('0x36')]);_0x5e1b8f[_0x4811('0x34')]=_[_0x4811('0x32')](_0x4ed826[_0x4811('0x2f')],qs[_0x4811('0x33')](_0x18a5b2[_0x4811('0x36')][_0x4811('0x33')]));_0x5e1b8f['attributes']=_0x5e1b8f['attributes'][_0x4811('0x35')]?_0x5e1b8f[_0x4811('0x34')]:_0x4ed826[_0x4811('0x2f')];_0x5e1b8f[_0x4811('0x37')]=qs[_0x4811('0x38')](_0x18a5b2[_0x4811('0x36')]['sort']);_0x5e1b8f[_0x4811('0x3b')]=qs[_0x4811('0x31')](_[_0x4811('0x39')](_0x18a5b2[_0x4811('0x36')],_0x4ed826[_0x4811('0x31')]));if(_0x18a5b2[_0x4811('0x36')][_0x4811('0x3a')]){_0x5e1b8f['where']=_['merge'](_0x5e1b8f[_0x4811('0x3b')],{'$or':_[_0x4811('0x2b')](_0x5e1b8f[_0x4811('0x34')],function(_0xa1d9c){var _0x48c041={};_0x48c041[_0xa1d9c]={'$like':'%'+_0x18a5b2[_0x4811('0x36')][_0x4811('0x3a')]+'%'};return _0x48c041;})});}_0x5e1b8f=_[_0x4811('0x3c')]({},_0x5e1b8f,_0x18a5b2[_0x4811('0x3f')]);return _0x1c650c[_0x4811('0x4a')](_0x5e1b8f);}})[_0x4811('0x42')](function(_0x4e99aa){if(_0x4e99aa){_0x28267a=_0x4e99aa['length'];if(!_0x18a5b2[_0x4811('0x36')][_0x4811('0x4d')](_0x4811('0x4e'))){_0x5e1b8f[_0x4811('0x1e')]=qs['limit'](_0x18a5b2[_0x4811('0x36')][_0x4811('0x1e')]);_0x5e1b8f['offset']=qs[_0x4811('0x20')](_0x18a5b2['query']['offset']);}return _0x1c650c['getConfigurations'](_0x5e1b8f);}})[_0x4811('0x42')](function(_0x422d59){if(_0x422d59){return _0x422d59?{'count':_0x28267a,'rows':_0x422d59}:null;}})['then'](respondWithResult(_0x5d1406,null))[_0x4811('0x48')](handleError(_0x5d1406,null));};exports[_0x4811('0x4f')]=function(_0x1451a8,_0x32947d,_0x48310e){if(_0x1451a8[_0x4811('0x49')]['id']){delete _0x1451a8['body']['id'];}return db[_0x4811('0x2c')][_0x4811('0x4b')]({'where':{'id':_0x1451a8['params']['id']}})['then'](handleEntityNotFound(_0x32947d,null))['then'](function(_0x4e5c46){if(_0x4e5c46){_0x1451a8[_0x4811('0x49')][_0x4811('0x50')]=_0x4e5c46['id'];_0x1451a8[_0x4811('0x49')][_0x4811('0x51')]=integrations[_0x4811('0x52')](_0x1451a8[_0x4811('0x49')]['channel'],_0x1451a8['body'][_0x4811('0x3d')]);_0x1451a8['body'][_0x4811('0x53')]=integrations['getDescriptions'](_0x1451a8[_0x4811('0x49')][_0x4811('0x54')],_0x1451a8['body']['type']);return db[_0x4811('0x4c')][_0x4811('0x47')](_0x1451a8[_0x4811('0x49')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0x4811('0x55')],'as':_0x4811('0x53')}]});}return null;})[_0x4811('0x42')](respondWithResult(_0x32947d,null))[_0x4811('0x48')](handleError(_0x32947d,null));};exports['getFields']=function(_0x29c7ae,_0xa879b4,_0x4b51bc){var _0x5ead11='';var _0x1b3239=['id',_0x4811('0x29'),_0x4811('0x56'),_0x4811('0x57'),_0x4811('0x58'),_0x4811('0x59'),_0x4811('0x5a'),'duration_minutes','parent_id',_0x4811('0x5b'),'parent_name',_0x4811('0x5c')];return db[_0x4811('0x2c')][_0x4811('0x4b')]({'where':{'id':_0x29c7ae[_0x4811('0x44')]['id']},'attributes':['id',_0x4811('0x5d'),'password',_0x4811('0x5e')]})['then'](handleEntityNotFound(_0xa879b4,null))[_0x4811('0x42')](function(_0x56e472){if(_0x56e472){_0x5ead11=_0x56e472[_0x4811('0x5e')];var _0x368715=_0x5ead11[_0x4811('0x5f')](-0x1);if(_0x368715==='/'){_0x5ead11=_0x5ead11[_0x4811('0x60')](0x0,_0x5ead11[_0x4811('0x61')](_0x368715));}return rp({'method':_0x4811('0x62'),'uri':util[_0x4811('0x63')]('%s%s',_0x5ead11,_0x4811('0x64')),'json':!![],'form':{'method':_0x4811('0x65'),'input_type':_0x4811('0x66'),'response_type':'JSON','rest_data':JSON[_0x4811('0x67')]({'user_auth':{'user_name':_0x56e472[_0x4811('0x5d')],'password':_0x56e472['password'],'encryption':_0x4811('0x68')},'application':_0x4811('0x69')})}});}})[_0x4811('0x42')](function(_0x4f06a2){if(_0x4f06a2&&_0x4f06a2[_0x4811('0x29')]!==_0x4811('0x6a')&&_0x4f06a2[_0x4811('0x29')]!==_0x4811('0x6b')){return rp({'method':_0x4811('0x62'),'uri':util[_0x4811('0x63')](_0x4811('0x6c'),_0x5ead11,_0x4811('0x64')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x4811('0x66'),'response_type':_0x4811('0x66'),'rest_data':JSON[_0x4811('0x67')]({'session':_0x4f06a2['id'],'module_name':_0x4811('0x6d')})}})[_0x4811('0x42')](function(_0x43f2fc){if(_0x43f2fc){var _0x42e7ba=_[_0x4811('0x6e')](_0x43f2fc[_0x4811('0x6f')]);_[_0x4811('0x70')](_0x42e7ba,function(_0x521f3a){return _0x1b3239['includes'](_0x521f3a[_0x4811('0x29')]);});return{'count':_0x42e7ba[_0x4811('0x35')],'rows':_[_0x4811('0x2b')](_0x42e7ba,function(_0x3ce589){return{'id':_0x3ce589[_0x4811('0x29')],'name':_0x3ce589[_0x4811('0x71')],'custom':_['endsWith'](_0x3ce589[_0x4811('0x29')],'_c')?!![]:![],'options':_0x3ce589[_0x4811('0x3f')]?_[_0x4811('0x2b')](_['values'](_0x3ce589[_0x4811('0x3f')]),function(_0x4c76ae){return{'name':_0x4c76ae[_0x4811('0x72')],'value':_0x4c76ae['name']};}):[]};})};}})[_0x4811('0x42')](respondWithResult(_0xa879b4,null))[_0x4811('0x48')](function(_0x17d3d8){var _0x4d0815=_0x29c7ae[_0x4811('0x36')][_0x4811('0x73')]?0x1f4:_0x17d3d8[_0x4811('0x74')]||0x1f4;logger[_0x4811('0x27')](_0x4811('0x75'),_0x4811('0x76'),_0x4d0815,JSON[_0x4811('0x67')](_0x17d3d8));delete _0x17d3d8[_0x4811('0x29')];if(_0x4d0815===0x191){_0x4d0815=0x190;}_0xa879b4[_0x4811('0x1a')](_0x4d0815)['send'](_0x29c7ae[_0x4811('0x36')][_0x4811('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x17d3d8[_0x4811('0x74')]}:_0x17d3d8);});}else{var _0x64c5f4=0x1f4;_0xa879b4[_0x4811('0x1a')](_0x64c5f4)[_0x4811('0x2a')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 5f75178..6724a8b 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbabe=['rimraf','../../config/environment','../../components/integrations/configuration','define','int_sugarcrm_accounts','lodash','util','api','request-promise'];(function(_0x33ef7a,_0x10191b){var _0x33c798=function(_0x1d500e){while(--_0x1d500e){_0x33ef7a['push'](_0x33ef7a['shift']());}};_0x33c798(++_0x10191b);}(_0xbabe,0x12e));var _0xebab=function(_0x574ce8,_0x438c0d){_0x574ce8=_0x574ce8-0x0;var _0x20bc2c=_0xbabe[_0x574ce8];return _0x20bc2c;};'use strict';var _=require(_0xebab('0x0'));var util=require(_0xebab('0x1'));var logger=require('../../config/logger')(_0xebab('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xebab('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xebab('0x4'));var config=require(_0xebab('0x5'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xebab('0x6'));module['exports']=function(_0x270ae6,_0x3ead71){return _0x270ae6[_0xebab('0x7')]('SugarcrmAccount',attributes,{'tableName':_0xebab('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5fa=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','lodash','util','../../config/logger','api'];(function(_0x1dd82f,_0x52acb7){var _0x353ca4=function(_0x5ee4c9){while(--_0x5ee4c9){_0x1dd82f['push'](_0x1dd82f['shift']());}};_0x353ca4(++_0x52acb7);}(_0xb5fa,0xf8));var _0xab5f=function(_0x1f357b,_0x1bc017){_0x1f357b=_0x1f357b-0x0;var _0x9499d=_0xb5fa[_0x1f357b];return _0x9499d;};'use strict';var _=require(_0xab5f('0x0'));var util=require(_0xab5f('0x1'));var logger=require(_0xab5f('0x2'))(_0xab5f('0x3'));var moment=require(_0xab5f('0x4'));var BPromise=require(_0xab5f('0x5'));var rp=require(_0xab5f('0x6'));var fs=require('fs');var path=require(_0xab5f('0x7'));var rimraf=require(_0xab5f('0x8'));var config=require(_0xab5f('0x9'));var attributes=require(_0xab5f('0xa'));var integrations=require(_0xab5f('0xb'));module['exports']=function(_0x4b40ca,_0x489cd2){return _0x4b40ca[_0xab5f('0xc')](_0xab5f('0xd'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index c321fef..b763001 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8498=['SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount','options','where','attributes','limit','include','map','model','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0xe9dc99,_0x48ab3d){var _0x420df5=function(_0x168509){while(--_0x168509){_0xe9dc99['push'](_0xe9dc99['shift']());}};_0x420df5(++_0x48ab3d);}(_0x8498,0xc3));var _0x8849=function(_0x4562c0,_0x76f431){_0x4562c0=_0x4562c0-0x0;var _0x4f70f1=_0x8498[_0x4562c0];return _0x4f70f1;};'use strict';var _=require(_0x8849('0x0'));var util=require(_0x8849('0x1'));var moment=require(_0x8849('0x2'));var BPromise=require(_0x8849('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8849('0x4'));var db=require(_0x8849('0x5'))['db'];var utils=require(_0x8849('0x6'));var logger=require(_0x8849('0x7'))(_0x8849('0x8'));var config=require(_0x8849('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8849('0xa')][_0x8849('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x424812,_0x20d081,_0x24cce6){return new BPromise(function(_0x58b4b0,_0x20865d){return client[_0x8849('0xc')](_0x424812,_0x24cce6)[_0x8849('0xd')](function(_0x459056){logger[_0x8849('0xe')](_0x8849('0xf'),_0x20d081,_0x8849('0x10'));logger[_0x8849('0x11')](_0x8849('0x12'),_0x20d081,_0x8849('0x10'),JSON[_0x8849('0x13')](_0x459056));if(_0x459056[_0x8849('0x14')]){if(_0x459056['error'][_0x8849('0x15')]===0x1f4){logger['error'](_0x8849('0xf'),_0x20d081,_0x459056['error'][_0x8849('0x16')]);return _0x20865d(_0x459056[_0x8849('0x14')]['message']);}logger['error'](_0x8849('0xf'),_0x20d081,_0x459056[_0x8849('0x14')][_0x8849('0x16')]);return _0x58b4b0(_0x459056['error'][_0x8849('0x16')]);}else{logger[_0x8849('0xe')](_0x8849('0xf'),_0x20d081,_0x8849('0x10'));_0x58b4b0(_0x459056[_0x8849('0x17')][_0x8849('0x16')]);}})[_0x8849('0x18')](function(_0x9546ac){logger[_0x8849('0x14')](_0x8849('0xf'),_0x20d081,_0x9546ac);_0x20865d(_0x9546ac);});});}exports[_0x8849('0x19')]=function(_0xd8d416){var _0x57251f=this;return new Promise(function(_0x55bda5,_0x4fd545){return db['SugarcrmAccount']['findAll']({'raw':_0xd8d416[_0x8849('0x1a')]?_0xd8d416[_0x8849('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xd8d416[_0x8849('0x1a')]?_0xd8d416[_0x8849('0x1a')][_0x8849('0x1b')]||null:null,'attributes':_0xd8d416['options']?_0xd8d416[_0x8849('0x1a')][_0x8849('0x1c')]||null:null,'limit':_0xd8d416[_0x8849('0x1a')]?_0xd8d416[_0x8849('0x1a')][_0x8849('0x1d')]||null:null,'include':_0xd8d416[_0x8849('0x1a')]?_0xd8d416['options'][_0x8849('0x1e')]?_[_0x8849('0x1f')](_0xd8d416[_0x8849('0x1a')][_0x8849('0x1e')],function(_0x298c8a){return{'model':db[_0x298c8a[_0x8849('0x20')]],'as':_0x298c8a['as'],'attributes':_0x298c8a[_0x8849('0x1c')],'include':_0x298c8a[_0x8849('0x1e')]?_['map'](_0x298c8a[_0x8849('0x1e')],function(_0x16db3a){return{'model':db[_0x16db3a[_0x8849('0x20')]],'as':_0x16db3a['as'],'attributes':_0x16db3a[_0x8849('0x1c')],'include':_0x16db3a['include']?_[_0x8849('0x1f')](_0x16db3a[_0x8849('0x1e')],function(_0xff533f){return{'model':db[_0xff533f[_0x8849('0x20')]],'as':_0xff533f['as'],'attributes':_0xff533f[_0x8849('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8849('0xd')](function(_0x2df600){logger[_0x8849('0xe')](_0x8849('0x19'),_0xd8d416);logger[_0x8849('0x11')]('GetSugarcrmAccount',_0xd8d416,JSON[_0x8849('0x13')](_0x2df600));_0x55bda5(_0x2df600);})[_0x8849('0x18')](function(_0x328119){logger[_0x8849('0x14')]('GetSugarcrmAccount',_0x328119[_0x8849('0x16')],_0xd8d416);_0x4fd545(_0x57251f[_0x8849('0x14')](0x1f4,_0x328119[_0x8849('0x16')]));});});};exports[_0x8849('0x21')]=function(_0x210cf0){var _0x5925f5=this;return new Promise(function(_0x263ac3,_0x5d780e){return db['SugarcrmAccount'][_0x8849('0x22')]({'raw':_0x210cf0['options']?_0x210cf0[_0x8849('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x210cf0['options']?_0x210cf0['options'][_0x8849('0x1b')]||null:null,'attributes':_0x210cf0['options']?_0x210cf0['options'][_0x8849('0x1c')]||null:null,'include':_0x210cf0['options']?_0x210cf0[_0x8849('0x1a')][_0x8849('0x1e')]?_[_0x8849('0x1f')](_0x210cf0[_0x8849('0x1a')][_0x8849('0x1e')],function(_0x27e87b){return{'model':db[_0x27e87b[_0x8849('0x20')]],'as':_0x27e87b['as'],'attributes':_0x27e87b[_0x8849('0x1c')],'include':_0x27e87b[_0x8849('0x1e')]?_[_0x8849('0x1f')](_0x27e87b[_0x8849('0x1e')],function(_0x210d99){return{'model':db[_0x210d99[_0x8849('0x20')]],'as':_0x210d99['as'],'attributes':_0x210d99[_0x8849('0x1c')],'include':_0x210d99[_0x8849('0x1e')]?_[_0x8849('0x1f')](_0x210d99[_0x8849('0x1e')],function(_0x2d4d22){return{'model':db[_0x2d4d22['model']],'as':_0x2d4d22['as'],'attributes':_0x2d4d22['attributes']};}):[]};}):[]};}):[]:[]})[_0x8849('0xd')](function(_0x1340ec){logger[_0x8849('0xe')]('ShowSugarcrmAccount',_0x210cf0);logger[_0x8849('0x11')](_0x8849('0x21'),_0x210cf0,JSON[_0x8849('0x13')](_0x1340ec));_0x263ac3(_0x1340ec);})[_0x8849('0x18')](function(_0x15660d){logger[_0x8849('0x14')](_0x8849('0x21'),_0x15660d[_0x8849('0x16')],_0x210cf0);_0x5d780e(_0x5925f5['error'](0x1f4,_0x15660d['message']));});});}; \ No newline at end of file +var _0xbac0=['SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowSugarcrmAccount','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug'];(function(_0x5b3d8b,_0x5624b8){var _0x22f546=function(_0x4f9b93){while(--_0x4f9b93){_0x5b3d8b['push'](_0x5b3d8b['shift']());}};_0x22f546(++_0x5624b8);}(_0xbac0,0x9f));var _0x0bac=function(_0x5ec454,_0xfcd77e){_0x5ec454=_0x5ec454-0x0;var _0x5ebf50=_0xbac0[_0x5ec454];return _0x5ebf50;};'use strict';var _=require(_0x0bac('0x0'));var util=require(_0x0bac('0x1'));var moment=require(_0x0bac('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bac('0x3'));var fs=require('fs');var Redis=require(_0x0bac('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0bac('0x5'));var logger=require(_0x0bac('0x6'))(_0x0bac('0x7'));var config=require(_0x0bac('0x8'));var jayson=require(_0x0bac('0x9'));var client=jayson[_0x0bac('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c980e,_0x52ff4c,_0x3da8e8){return new BPromise(function(_0xf4ff53,_0x533d18){return client[_0x0bac('0xb')](_0x5c980e,_0x3da8e8)[_0x0bac('0xc')](function(_0xbec598){logger[_0x0bac('0xd')](_0x0bac('0xe'),_0x52ff4c,'request\x20sent');logger[_0x0bac('0xf')](_0x0bac('0x10'),_0x52ff4c,'request\x20sent',JSON[_0x0bac('0x11')](_0xbec598));if(_0xbec598[_0x0bac('0x12')]){if(_0xbec598['error']['code']===0x1f4){logger[_0x0bac('0x12')](_0x0bac('0xe'),_0x52ff4c,_0xbec598['error'][_0x0bac('0x13')]);return _0x533d18(_0xbec598[_0x0bac('0x12')][_0x0bac('0x13')]);}logger[_0x0bac('0x12')](_0x0bac('0xe'),_0x52ff4c,_0xbec598['error']['message']);return _0xf4ff53(_0xbec598[_0x0bac('0x12')][_0x0bac('0x13')]);}else{logger[_0x0bac('0xd')](_0x0bac('0xe'),_0x52ff4c,_0x0bac('0x14'));_0xf4ff53(_0xbec598['result'][_0x0bac('0x13')]);}})[_0x0bac('0x15')](function(_0x34d9e3){logger[_0x0bac('0x12')](_0x0bac('0xe'),_0x52ff4c,_0x34d9e3);_0x533d18(_0x34d9e3);});});}exports[_0x0bac('0x16')]=function(_0x42b586){var _0x341561=this;return new Promise(function(_0x2f55f2,_0x3bf263){return db[_0x0bac('0x17')][_0x0bac('0x18')]({'raw':_0x42b586[_0x0bac('0x19')]?_0x42b586[_0x0bac('0x19')][_0x0bac('0x1a')]===undefined?!![]:![]:!![],'where':_0x42b586[_0x0bac('0x19')]?_0x42b586[_0x0bac('0x19')][_0x0bac('0x1b')]||null:null,'attributes':_0x42b586[_0x0bac('0x19')]?_0x42b586[_0x0bac('0x19')][_0x0bac('0x1c')]||null:null,'limit':_0x42b586['options']?_0x42b586[_0x0bac('0x19')][_0x0bac('0x1d')]||null:null,'include':_0x42b586[_0x0bac('0x19')]?_0x42b586[_0x0bac('0x19')][_0x0bac('0x1e')]?_[_0x0bac('0x1f')](_0x42b586[_0x0bac('0x19')][_0x0bac('0x1e')],function(_0x173522){return{'model':db[_0x173522[_0x0bac('0x20')]],'as':_0x173522['as'],'attributes':_0x173522[_0x0bac('0x1c')],'include':_0x173522[_0x0bac('0x1e')]?_[_0x0bac('0x1f')](_0x173522['include'],function(_0x135fa5){return{'model':db[_0x135fa5[_0x0bac('0x20')]],'as':_0x135fa5['as'],'attributes':_0x135fa5['attributes'],'include':_0x135fa5['include']?_['map'](_0x135fa5[_0x0bac('0x1e')],function(_0x1f4754){return{'model':db[_0x1f4754['model']],'as':_0x1f4754['as'],'attributes':_0x1f4754[_0x0bac('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x426c5b){logger[_0x0bac('0xd')](_0x0bac('0x16'),_0x42b586);logger[_0x0bac('0xf')](_0x0bac('0x16'),_0x42b586,JSON[_0x0bac('0x11')](_0x426c5b));_0x2f55f2(_0x426c5b);})[_0x0bac('0x15')](function(_0x2c189f){logger[_0x0bac('0x12')](_0x0bac('0x16'),_0x2c189f[_0x0bac('0x13')],_0x42b586);_0x3bf263(_0x341561[_0x0bac('0x12')](0x1f4,_0x2c189f[_0x0bac('0x13')]));});});};exports['ShowSugarcrmAccount']=function(_0x5cd520){var _0x5d1fd6=this;return new Promise(function(_0x1f5443,_0x3e98e5){return db[_0x0bac('0x17')][_0x0bac('0x21')]({'raw':_0x5cd520[_0x0bac('0x19')]?_0x5cd520[_0x0bac('0x19')][_0x0bac('0x1a')]===undefined?!![]:![]:!![],'where':_0x5cd520[_0x0bac('0x19')]?_0x5cd520[_0x0bac('0x19')][_0x0bac('0x1b')]||null:null,'attributes':_0x5cd520['options']?_0x5cd520[_0x0bac('0x19')][_0x0bac('0x1c')]||null:null,'include':_0x5cd520[_0x0bac('0x19')]?_0x5cd520['options'][_0x0bac('0x1e')]?_[_0x0bac('0x1f')](_0x5cd520[_0x0bac('0x19')][_0x0bac('0x1e')],function(_0xeaa532){return{'model':db[_0xeaa532[_0x0bac('0x20')]],'as':_0xeaa532['as'],'attributes':_0xeaa532[_0x0bac('0x1c')],'include':_0xeaa532[_0x0bac('0x1e')]?_['map'](_0xeaa532[_0x0bac('0x1e')],function(_0x43afa7){return{'model':db[_0x43afa7[_0x0bac('0x20')]],'as':_0x43afa7['as'],'attributes':_0x43afa7[_0x0bac('0x1c')],'include':_0x43afa7[_0x0bac('0x1e')]?_[_0x0bac('0x1f')](_0x43afa7[_0x0bac('0x1e')],function(_0x2216eb){return{'model':db[_0x2216eb[_0x0bac('0x20')]],'as':_0x2216eb['as'],'attributes':_0x2216eb[_0x0bac('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0bac('0xc')](function(_0x537a07){logger[_0x0bac('0xd')](_0x0bac('0x22'),_0x5cd520);logger[_0x0bac('0xf')](_0x0bac('0x22'),_0x5cd520,JSON[_0x0bac('0x11')](_0x537a07));_0x1f5443(_0x537a07);})[_0x0bac('0x15')](function(_0x34759a){logger[_0x0bac('0x12')](_0x0bac('0x22'),_0x34759a[_0x0bac('0x13')],_0x5cd520);_0x3e98e5(_0x5d1fd6[_0x0bac('0x12')](0x1f4,_0x34759a[_0x0bac('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index ee43db0..dd38323 100644 --- a/server/api/intSugarcrmConfiguration/index.js +++ b/server/api/intSugarcrmConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d99=['isAuthenticated','index','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x8ae98b,_0x155f88){var _0xc30bd4=function(_0x5ca462){while(--_0x5ca462){_0x8ae98b['push'](_0x8ae98b['shift']());}};_0xc30bd4(++_0x155f88);}(_0x8d99,0xf0));var _0x98d9=function(_0x4a15c6,_0x7699e5){_0x4a15c6=_0x4a15c6-0x0;var _0x19078f=_0x8d99[_0x4a15c6];return _0x19078f;};'use strict';var multer=require('multer');var util=require(_0x98d9('0x0'));var path=require(_0x98d9('0x1'));var timeout=require(_0x98d9('0x2'));var express=require(_0x98d9('0x3'));var router=express[_0x98d9('0x4')]();var fs_extra=require(_0x98d9('0x5'));var auth=require(_0x98d9('0x6'));var interaction=require(_0x98d9('0x7'));var config=require(_0x98d9('0x8'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x98d9('0x9')]('/',auth[_0x98d9('0xa')](),controller[_0x98d9('0xb')]);router['get'](_0x98d9('0xc'),auth[_0x98d9('0xa')](),controller[_0x98d9('0xd')]);router[_0x98d9('0x9')]('/:id/fields',auth[_0x98d9('0xa')](),controller[_0x98d9('0xe')]);router[_0x98d9('0x9')]('/:id/subjects',auth[_0x98d9('0xa')](),controller[_0x98d9('0xf')]);router[_0x98d9('0x9')](_0x98d9('0x10'),auth['isAuthenticated'](),controller[_0x98d9('0x11')]);router[_0x98d9('0x12')]('/',auth[_0x98d9('0xa')](),controller[_0x98d9('0x13')]);router[_0x98d9('0x14')](_0x98d9('0xc'),auth[_0x98d9('0xa')](),controller[_0x98d9('0x15')]);router[_0x98d9('0x16')]('/:id',auth[_0x98d9('0xa')](),controller[_0x98d9('0x17')]);module[_0x98d9('0x18')]=router; \ No newline at end of file +var _0x244a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','multer','connect-timeout','Router'];(function(_0x4264f1,_0x4f0491){var _0xa7d13a=function(_0x2e6c7a){while(--_0x2e6c7a){_0x4264f1['push'](_0x4264f1['shift']());}};_0xa7d13a(++_0x4f0491);}(_0x244a,0x90));var _0xa244=function(_0x4add85,_0x20180b){_0x4add85=_0x4add85-0x0;var _0xb12b40=_0x244a[_0x4add85];return _0xb12b40;};'use strict';var multer=require(_0xa244('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa244('0x1'));var express=require('express');var router=express[_0xa244('0x2')]();var fs_extra=require(_0xa244('0x3'));var auth=require(_0xa244('0x4'));var interaction=require(_0xa244('0x5'));var config=require(_0xa244('0x6'));var controller=require(_0xa244('0x7'));router[_0xa244('0x8')]('/',auth[_0xa244('0x9')](),controller['index']);router[_0xa244('0x8')](_0xa244('0xa'),auth['isAuthenticated'](),controller[_0xa244('0xb')]);router['get'](_0xa244('0xc'),auth[_0xa244('0x9')](),controller['getFields']);router[_0xa244('0x8')](_0xa244('0xd'),auth[_0xa244('0x9')](),controller['getSubjects']);router[_0xa244('0x8')](_0xa244('0xe'),auth['isAuthenticated'](),controller[_0xa244('0xf')]);router[_0xa244('0x10')]('/',auth[_0xa244('0x9')](),controller['create']);router[_0xa244('0x11')](_0xa244('0xa'),auth[_0xa244('0x9')](),controller[_0xa244('0x12')]);router[_0xa244('0x13')](_0xa244('0xa'),auth['isAuthenticated'](),controller[_0xa244('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 6d62ed0..eb8d205 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6359=['sequelize','STRING'];(function(_0x1ad749,_0x45ff00){var _0x4650fb=function(_0x2c758f){while(--_0x2c758f){_0x1ad749['push'](_0x1ad749['shift']());}};_0x4650fb(++_0x45ff00);}(_0x6359,0xa4));var _0x9635=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x6359[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x9635('0x0'));module['exports']={'name':{'type':Sequelize[_0x9635('0x1')]},'description':{'type':Sequelize[_0x9635('0x1')]}}; \ No newline at end of file +var _0x0c32=['sequelize','exports','STRING'];(function(_0x21bb71,_0x2c3295){var _0x414592=function(_0x2a9e79){while(--_0x2a9e79){_0x21bb71['push'](_0x21bb71['shift']());}};_0x414592(++_0x2c3295);}(_0x0c32,0xde));var _0x20c3=function(_0x58be9e,_0x3d55f5){_0x58be9e=_0x58be9e-0x0;var _0x21adbf=_0x0c32[_0x58be9e];return _0x21adbf;};'use strict';var Sequelize=require(_0x20c3('0x0'));module[_0x20c3('0x1')]={'name':{'type':Sequelize[_0x20c3('0x2')]},'description':{'type':Sequelize[_0x20c3('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index fc8e260..7fbb953 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf95=['limit','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','type','map','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','create','body','find','getFields','SugarcrmField','nolimit','getSubjects','getDescriptions','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count'];(function(_0x4726d0,_0x59835d){var _0x1aac2d=function(_0x52510a){while(--_0x52510a){_0x4726d0['push'](_0x4726d0['shift']());}};_0x1aac2d(++_0x59835d);}(_0xcf95,0x82));var _0x5cf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf95[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5cf9('0x0'));var rimraf=require(_0x5cf9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5cf9('0x2'));var rp=require(_0x5cf9('0x3'));var moment=require(_0x5cf9('0x4'));var BPromise=require(_0x5cf9('0x5'));var Mustache=require(_0x5cf9('0x6'));var util=require(_0x5cf9('0x7'));var path=require(_0x5cf9('0x8'));var sox=require('sox');var csv=require(_0x5cf9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5cf9('0xa'));var _=require(_0x5cf9('0xb'));var squel=require(_0x5cf9('0xc'));var crypto=require(_0x5cf9('0xd'));var jsforce=require(_0x5cf9('0xe'));var deskjs=require(_0x5cf9('0xf'));var toCsv=require(_0x5cf9('0x9'));var querystring=require(_0x5cf9('0x10'));var Papa=require(_0x5cf9('0x11'));var Redis=require(_0x5cf9('0x12'));var authService=require(_0x5cf9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5cf9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5cf9('0x15'))(_0x5cf9('0x16'));var utils=require(_0x5cf9('0x17'));var config=require(_0x5cf9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5cf9('0x19'))['db'];function respondWithStatusCode(_0x3f62ba,_0x35e3c2){_0x35e3c2=_0x35e3c2||0xcc;return function(_0x3550c1){if(_0x3550c1){return _0x3f62ba[_0x5cf9('0x1a')](_0x35e3c2);}return _0x3f62ba[_0x5cf9('0x1b')](_0x35e3c2)[_0x5cf9('0x1c')]();};}function respondWithResult(_0x4ec8d9,_0x488a11){_0x488a11=_0x488a11||0xc8;return function(_0x1c52cf){if(_0x1c52cf){return _0x4ec8d9['status'](_0x488a11)['json'](_0x1c52cf);}};}function respondWithFilteredResult(_0x222f51,_0x1dcff3){return function(_0x5b6e7e){if(_0x5b6e7e){var _0x319b96=typeof _0x1dcff3[_0x5cf9('0x1d')]==='undefined'&&typeof _0x1dcff3['limit']===_0x5cf9('0x1e');var _0x121159=_0x5b6e7e[_0x5cf9('0x1f')];var _0xf6ce07=_0x319b96?0x0:_0x1dcff3['offset'];var _0x2501a8=_0x319b96?_0x5b6e7e[_0x5cf9('0x1f')]:_0x1dcff3[_0x5cf9('0x1d')]+_0x1dcff3[_0x5cf9('0x20')];var _0x44e4fd;if(_0x2501a8>=_0x121159){_0x2501a8=_0x121159;_0x44e4fd=0xc8;}else{_0x44e4fd=0xce;}_0x222f51['status'](_0x44e4fd);return _0x222f51[_0x5cf9('0x21')](_0x5cf9('0x22'),_0xf6ce07+'-'+_0x2501a8+'/'+_0x121159)[_0x5cf9('0x23')](_0x5b6e7e);}return null;};}function patchUpdates(_0x4832d7){return function(_0x1e6a62){try{jsonpatch[_0x5cf9('0x24')](_0x1e6a62,_0x4832d7,!![]);}catch(_0x1efe28){return BPromise[_0x5cf9('0x25')](_0x1efe28);}return _0x1e6a62['save']();};}function saveUpdates(_0x496b01,_0x2578c8){return function(_0x43a4a3){if(_0x43a4a3){return _0x43a4a3[_0x5cf9('0x26')](_0x496b01)[_0x5cf9('0x27')](function(_0x4c739a){return _0x4c739a;});}return null;};}function removeEntity(_0x52ca43,_0x1744a4){return function(_0x25bb49){if(_0x25bb49){return _0x25bb49[_0x5cf9('0x28')]()['then'](function(){_0x52ca43[_0x5cf9('0x1b')](0xcc)[_0x5cf9('0x1c')]();});}};}function handleEntityNotFound(_0x1960e6,_0x13f9fb){return function(_0x371701){if(!_0x371701){_0x1960e6[_0x5cf9('0x1a')](0x194);}return _0x371701;};}function handleError(_0x570988,_0x21dd9b){_0x21dd9b=_0x21dd9b||0x1f4;return function(_0x2a8bab){logger['error'](_0x2a8bab[_0x5cf9('0x29')]);if(_0x2a8bab[_0x5cf9('0x2a')]){delete _0x2a8bab['name'];}_0x570988['status'](_0x21dd9b)[_0x5cf9('0x2b')](_0x2a8bab);};}exports[_0x5cf9('0x2c')]=function(_0x5a8074,_0x457aa5){var _0x1a66b9={},_0x4f3e0c={},_0x17c8aa={'count':0x0,'rows':[]};var _0x3ae7dc=_['map'](db[_0x5cf9('0x2d')][_0x5cf9('0x2e')],function(_0x4adc9e){return{'name':_0x4adc9e[_0x5cf9('0x2f')],'type':_0x4adc9e[_0x5cf9('0x30')]['key']};});_0x4f3e0c['model']=_[_0x5cf9('0x31')](_0x3ae7dc,_0x5cf9('0x2a'));_0x4f3e0c[_0x5cf9('0x32')]=_[_0x5cf9('0x33')](_0x5a8074[_0x5cf9('0x32')]);_0x4f3e0c['filters']=_[_0x5cf9('0x34')](_0x4f3e0c['model'],_0x4f3e0c[_0x5cf9('0x32')]);_0x1a66b9[_0x5cf9('0x35')]=_[_0x5cf9('0x34')](_0x4f3e0c[_0x5cf9('0x36')],qs[_0x5cf9('0x37')](_0x5a8074['query'][_0x5cf9('0x37')]));_0x1a66b9[_0x5cf9('0x35')]=_0x1a66b9[_0x5cf9('0x35')][_0x5cf9('0x38')]?_0x1a66b9[_0x5cf9('0x35')]:_0x4f3e0c[_0x5cf9('0x36')];if(!_0x5a8074['query'][_0x5cf9('0x39')]('nolimit')){_0x1a66b9[_0x5cf9('0x20')]=qs[_0x5cf9('0x20')](_0x5a8074[_0x5cf9('0x32')][_0x5cf9('0x20')]);_0x1a66b9['offset']=qs['offset'](_0x5a8074[_0x5cf9('0x32')][_0x5cf9('0x1d')]);}_0x1a66b9[_0x5cf9('0x3a')]=qs[_0x5cf9('0x3b')](_0x5a8074['query']['sort']);_0x1a66b9[_0x5cf9('0x3c')]=qs['filters'](_[_0x5cf9('0x3d')](_0x5a8074[_0x5cf9('0x32')],_0x4f3e0c[_0x5cf9('0x3e')]),_0x3ae7dc);if(_0x5a8074['query'][_0x5cf9('0x3f')]){_0x1a66b9[_0x5cf9('0x3c')]=_[_0x5cf9('0x40')](_0x1a66b9[_0x5cf9('0x3c')],{'$or':_['map'](_0x3ae7dc,function(_0x42687d){if(_0x42687d[_0x5cf9('0x30')]!==_0x5cf9('0x41')){var _0x25e137={};_0x25e137[_0x42687d[_0x5cf9('0x2a')]]={'$like':'%'+_0x5a8074[_0x5cf9('0x32')][_0x5cf9('0x3f')]+'%'};return _0x25e137;}})});}_0x1a66b9=_[_0x5cf9('0x40')]({},_0x1a66b9,_0x5a8074[_0x5cf9('0x42')]);var _0x4f68ce={'where':_0x1a66b9[_0x5cf9('0x3c')]};return db['SugarcrmConfiguration'][_0x5cf9('0x1f')](_0x4f68ce)['then'](function(_0x5b2713){_0x17c8aa[_0x5cf9('0x1f')]=_0x5b2713;if(_0x5a8074['query'][_0x5cf9('0x43')]){_0x1a66b9[_0x5cf9('0x44')]=[{'all':!![]}];}return db[_0x5cf9('0x2d')]['findAll'](_0x1a66b9);})[_0x5cf9('0x27')](function(_0xb27e8b){_0x17c8aa[_0x5cf9('0x45')]=_0xb27e8b;return _0x17c8aa;})[_0x5cf9('0x27')](respondWithFilteredResult(_0x457aa5,_0x1a66b9))[_0x5cf9('0x46')](handleError(_0x457aa5,null));};exports['show']=function(_0x1a45e8,_0x175bb2){var _0x5a929f={'raw':![],'where':{'id':_0x1a45e8[_0x5cf9('0x47')]['id']}},_0x5525bb={};_0x5525bb[_0x5cf9('0x36')]=_['keys'](db[_0x5cf9('0x2d')][_0x5cf9('0x2e')]);_0x5525bb[_0x5cf9('0x32')]=_['keys'](_0x1a45e8['query']);_0x5525bb[_0x5cf9('0x3e')]=_[_0x5cf9('0x34')](_0x5525bb[_0x5cf9('0x36')],_0x5525bb[_0x5cf9('0x32')]);_0x5a929f[_0x5cf9('0x35')]=_['intersection'](_0x5525bb[_0x5cf9('0x36')],qs[_0x5cf9('0x37')](_0x1a45e8['query'][_0x5cf9('0x37')]));_0x5a929f[_0x5cf9('0x35')]=_0x5a929f['attributes'][_0x5cf9('0x38')]?_0x5a929f[_0x5cf9('0x35')]:_0x5525bb[_0x5cf9('0x36')];if(_0x1a45e8[_0x5cf9('0x32')][_0x5cf9('0x43')]){_0x5a929f['include']=[{'all':!![]}];}_0x5a929f=_[_0x5cf9('0x40')]({},_0x5a929f,_0x1a45e8[_0x5cf9('0x42')]);return db[_0x5cf9('0x2d')]['find'](_0x5a929f)[_0x5cf9('0x27')](handleEntityNotFound(_0x175bb2,null))[_0x5cf9('0x27')](respondWithResult(_0x175bb2,null))[_0x5cf9('0x46')](handleError(_0x175bb2,null));};exports[_0x5cf9('0x48')]=function(_0x36f3f6,_0x929acb){return db[_0x5cf9('0x2d')][_0x5cf9('0x48')](_0x36f3f6[_0x5cf9('0x49')],{})[_0x5cf9('0x27')](respondWithResult(_0x929acb,0xc9))[_0x5cf9('0x46')](handleError(_0x929acb,null));};exports[_0x5cf9('0x26')]=function(_0x4424b1,_0x24d226){if(_0x4424b1[_0x5cf9('0x49')]['id']){delete _0x4424b1[_0x5cf9('0x49')]['id'];}return db['SugarcrmConfiguration'][_0x5cf9('0x4a')]({'where':{'id':_0x4424b1[_0x5cf9('0x47')]['id']}})['then'](handleEntityNotFound(_0x24d226,null))[_0x5cf9('0x27')](saveUpdates(_0x4424b1[_0x5cf9('0x49')],null))[_0x5cf9('0x27')](respondWithResult(_0x24d226,null))['catch'](handleError(_0x24d226,null));};exports[_0x5cf9('0x28')]=function(_0x3c85fd,_0x15a0a4){return db[_0x5cf9('0x2d')][_0x5cf9('0x4a')]({'where':{'id':_0x3c85fd['params']['id']}})[_0x5cf9('0x27')](handleEntityNotFound(_0x15a0a4,null))[_0x5cf9('0x27')](removeEntity(_0x15a0a4,null))[_0x5cf9('0x46')](handleError(_0x15a0a4,null));};exports[_0x5cf9('0x4b')]=function(_0x54cbd0,_0x1ce6ff,_0x39b22c){var _0x3613dc={};var _0x52325c={};var _0x55e39d;var _0x357f6f;return db[_0x5cf9('0x2d')]['findOne']({'where':{'id':_0x54cbd0[_0x5cf9('0x47')]['id']}})[_0x5cf9('0x27')](handleEntityNotFound(_0x1ce6ff,null))[_0x5cf9('0x27')](function(_0x545a6d){if(_0x545a6d){_0x55e39d=_0x545a6d;_0x52325c[_0x5cf9('0x36')]=_[_0x5cf9('0x33')](db[_0x5cf9('0x4c')][_0x5cf9('0x2e')]);_0x52325c['query']=_['keys'](_0x54cbd0[_0x5cf9('0x32')]);_0x52325c[_0x5cf9('0x3e')]=_[_0x5cf9('0x34')](_0x52325c[_0x5cf9('0x36')],_0x52325c[_0x5cf9('0x32')]);_0x3613dc['attributes']=_[_0x5cf9('0x34')](_0x52325c[_0x5cf9('0x36')],qs[_0x5cf9('0x37')](_0x54cbd0[_0x5cf9('0x32')]['fields']));_0x3613dc[_0x5cf9('0x35')]=_0x3613dc[_0x5cf9('0x35')][_0x5cf9('0x38')]?_0x3613dc[_0x5cf9('0x35')]:_0x52325c['model'];_0x3613dc[_0x5cf9('0x3a')]=qs['sort'](_0x54cbd0[_0x5cf9('0x32')]['sort']);_0x3613dc[_0x5cf9('0x3c')]=qs[_0x5cf9('0x3e')](_[_0x5cf9('0x3d')](_0x54cbd0['query'],_0x52325c[_0x5cf9('0x3e')]));if(_0x54cbd0[_0x5cf9('0x32')][_0x5cf9('0x3f')]){_0x3613dc[_0x5cf9('0x3c')]=_[_0x5cf9('0x40')](_0x3613dc['where'],{'$or':_['map'](_0x3613dc[_0x5cf9('0x35')],function(_0x32c444){var _0x52199a={};_0x52199a[_0x32c444]={'$like':'%'+_0x54cbd0['query'][_0x5cf9('0x3f')]+'%'};return _0x52199a;})});}_0x3613dc=_[_0x5cf9('0x40')]({},_0x3613dc,_0x54cbd0[_0x5cf9('0x42')]);return _0x55e39d[_0x5cf9('0x4b')](_0x3613dc);}})[_0x5cf9('0x27')](function(_0x206d6e){if(_0x206d6e){_0x357f6f=_0x206d6e[_0x5cf9('0x38')];if(!_0x54cbd0[_0x5cf9('0x32')][_0x5cf9('0x39')](_0x5cf9('0x4d'))){_0x3613dc[_0x5cf9('0x20')]=qs[_0x5cf9('0x20')](_0x54cbd0[_0x5cf9('0x32')][_0x5cf9('0x20')]);_0x3613dc['offset']=qs[_0x5cf9('0x1d')](_0x54cbd0['query']['offset']);}return _0x55e39d[_0x5cf9('0x4b')](_0x3613dc);}})[_0x5cf9('0x27')](function(_0x54f1b1){if(_0x54f1b1){return _0x54f1b1?{'count':_0x357f6f,'rows':_0x54f1b1}:null;}})[_0x5cf9('0x27')](respondWithResult(_0x1ce6ff,null))['catch'](handleError(_0x1ce6ff,null));};exports[_0x5cf9('0x4e')]=function(_0x5344da,_0x5e315f,_0x45964f){var _0x29f3d1={};var _0x7bf8b7={};var _0x228757;var _0x334444;return db[_0x5cf9('0x2d')]['findOne']({'where':{'id':_0x5344da[_0x5cf9('0x47')]['id']}})['then'](handleEntityNotFound(_0x5e315f,null))[_0x5cf9('0x27')](function(_0x3e400c){if(_0x3e400c){_0x228757=_0x3e400c;_0x7bf8b7['model']=_['keys'](db[_0x5cf9('0x4c')][_0x5cf9('0x2e')]);_0x7bf8b7[_0x5cf9('0x32')]=_[_0x5cf9('0x33')](_0x5344da['query']);_0x7bf8b7[_0x5cf9('0x3e')]=_[_0x5cf9('0x34')](_0x7bf8b7['model'],_0x7bf8b7[_0x5cf9('0x32')]);_0x29f3d1[_0x5cf9('0x35')]=_[_0x5cf9('0x34')](_0x7bf8b7['model'],qs[_0x5cf9('0x37')](_0x5344da[_0x5cf9('0x32')][_0x5cf9('0x37')]));_0x29f3d1[_0x5cf9('0x35')]=_0x29f3d1[_0x5cf9('0x35')][_0x5cf9('0x38')]?_0x29f3d1[_0x5cf9('0x35')]:_0x7bf8b7['model'];_0x29f3d1[_0x5cf9('0x3a')]=qs[_0x5cf9('0x3b')](_0x5344da[_0x5cf9('0x32')][_0x5cf9('0x3b')]);_0x29f3d1[_0x5cf9('0x3c')]=qs[_0x5cf9('0x3e')](_[_0x5cf9('0x3d')](_0x5344da[_0x5cf9('0x32')],_0x7bf8b7['filters']));if(_0x5344da['query'][_0x5cf9('0x3f')]){_0x29f3d1[_0x5cf9('0x3c')]=_['merge'](_0x29f3d1[_0x5cf9('0x3c')],{'$or':_[_0x5cf9('0x31')](_0x29f3d1[_0x5cf9('0x35')],function(_0x292096){var _0x1c0ab7={};_0x1c0ab7[_0x292096]={'$like':'%'+_0x5344da[_0x5cf9('0x32')][_0x5cf9('0x3f')]+'%'};return _0x1c0ab7;})});}_0x29f3d1=_[_0x5cf9('0x40')]({},_0x29f3d1,_0x5344da['options']);return _0x228757[_0x5cf9('0x4e')](_0x29f3d1);}})[_0x5cf9('0x27')](function(_0x303476){if(_0x303476){_0x334444=_0x303476[_0x5cf9('0x38')];if(!_0x5344da['query'][_0x5cf9('0x39')]('nolimit')){_0x29f3d1[_0x5cf9('0x20')]=qs['limit'](_0x5344da['query'][_0x5cf9('0x20')]);_0x29f3d1[_0x5cf9('0x1d')]=qs[_0x5cf9('0x1d')](_0x5344da['query'][_0x5cf9('0x1d')]);}return _0x228757[_0x5cf9('0x4e')](_0x29f3d1);}})[_0x5cf9('0x27')](function(_0x139164){if(_0x139164){return _0x139164?{'count':_0x334444,'rows':_0x139164}:null;}})['then'](respondWithResult(_0x5e315f,null))[_0x5cf9('0x46')](handleError(_0x5e315f,null));};exports[_0x5cf9('0x4f')]=function(_0xda5c97,_0x1cb094,_0x17c346){var _0x59d312={};var _0x377686={};var _0x14df6a;var _0x4c38e1;return db[_0x5cf9('0x2d')][_0x5cf9('0x50')]({'where':{'id':_0xda5c97[_0x5cf9('0x47')]['id']}})[_0x5cf9('0x27')](handleEntityNotFound(_0x1cb094,null))['then'](function(_0x410fff){if(_0x410fff){_0x14df6a=_0x410fff;_0x377686[_0x5cf9('0x36')]=_[_0x5cf9('0x33')](db[_0x5cf9('0x4c')][_0x5cf9('0x2e')]);_0x377686['query']=_['keys'](_0xda5c97[_0x5cf9('0x32')]);_0x377686[_0x5cf9('0x3e')]=_[_0x5cf9('0x34')](_0x377686[_0x5cf9('0x36')],_0x377686['query']);_0x59d312[_0x5cf9('0x35')]=_['intersection'](_0x377686[_0x5cf9('0x36')],qs['fields'](_0xda5c97[_0x5cf9('0x32')][_0x5cf9('0x37')]));_0x59d312['attributes']=_0x59d312[_0x5cf9('0x35')][_0x5cf9('0x38')]?_0x59d312[_0x5cf9('0x35')]:_0x377686[_0x5cf9('0x36')];_0x59d312[_0x5cf9('0x3a')]=qs[_0x5cf9('0x3b')](_0xda5c97[_0x5cf9('0x32')][_0x5cf9('0x3b')]);_0x59d312['where']=qs[_0x5cf9('0x3e')](_[_0x5cf9('0x3d')](_0xda5c97[_0x5cf9('0x32')],_0x377686[_0x5cf9('0x3e')]));if(_0xda5c97[_0x5cf9('0x32')][_0x5cf9('0x3f')]){_0x59d312[_0x5cf9('0x3c')]=_['merge'](_0x59d312[_0x5cf9('0x3c')],{'$or':_[_0x5cf9('0x31')](_0x59d312[_0x5cf9('0x35')],function(_0x465746){var _0x8b9640={};_0x8b9640[_0x465746]={'$like':'%'+_0xda5c97[_0x5cf9('0x32')][_0x5cf9('0x3f')]+'%'};return _0x8b9640;})});}_0x59d312=_['merge']({},_0x59d312,_0xda5c97[_0x5cf9('0x42')]);return _0x14df6a[_0x5cf9('0x4f')](_0x59d312);}})[_0x5cf9('0x27')](function(_0x2de54d){if(_0x2de54d){_0x4c38e1=_0x2de54d[_0x5cf9('0x38')];if(!_0xda5c97[_0x5cf9('0x32')][_0x5cf9('0x39')](_0x5cf9('0x4d'))){_0x59d312['limit']=qs[_0x5cf9('0x20')](_0xda5c97[_0x5cf9('0x32')][_0x5cf9('0x20')]);_0x59d312[_0x5cf9('0x1d')]=qs[_0x5cf9('0x1d')](_0xda5c97['query'][_0x5cf9('0x1d')]);}return _0x14df6a[_0x5cf9('0x4f')](_0x59d312);}})['then'](function(_0x305403){if(_0x305403){return _0x305403?{'count':_0x4c38e1,'rows':_0x305403}:null;}})[_0x5cf9('0x27')](respondWithResult(_0x1cb094,null))[_0x5cf9('0x46')](handleError(_0x1cb094,null));}; \ No newline at end of file +var _0xb150=['pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','getFields','SugarcrmField','map','getSubjects','findOne','getDescriptions','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','save','update','then','destroy','sendStatus','error','stack','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4620bb,_0x442ff6){var _0x3c23df=function(_0x22d21e){while(--_0x22d21e){_0x4620bb['push'](_0x4620bb['shift']());}};_0x3c23df(++_0x442ff6);}(_0xb150,0xb8));var _0x0b15=function(_0x29adb1,_0x98a1c2){_0x29adb1=_0x29adb1-0x0;var _0x16bc9e=_0xb150[_0x29adb1];return _0x16bc9e;};'use strict';var emlformat=require(_0x0b15('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0b15('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b15('0x2'));var moment=require('moment');var BPromise=require(_0x0b15('0x3'));var Mustache=require(_0x0b15('0x4'));var util=require(_0x0b15('0x5'));var path=require(_0x0b15('0x6'));var sox=require(_0x0b15('0x7'));var csv=require(_0x0b15('0x8'));var ejs=require(_0x0b15('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b15('0xa'));var squel=require(_0x0b15('0xb'));var crypto=require(_0x0b15('0xc'));var jsforce=require(_0x0b15('0xd'));var deskjs=require(_0x0b15('0xe'));var toCsv=require(_0x0b15('0x8'));var querystring=require(_0x0b15('0xf'));var Papa=require(_0x0b15('0x10'));var Redis=require(_0x0b15('0x11'));var authService=require(_0x0b15('0x12'));var qs=require(_0x0b15('0x13'));var as=require(_0x0b15('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b15('0x15'))(_0x0b15('0x16'));var utils=require(_0x0b15('0x17'));var config=require(_0x0b15('0x18'));var licenseUtil=require(_0x0b15('0x19'));var db=require(_0x0b15('0x1a'))['db'];function respondWithStatusCode(_0x1d0ade,_0x57cdf2){_0x57cdf2=_0x57cdf2||0xcc;return function(_0x3df598){if(_0x3df598){return _0x1d0ade['sendStatus'](_0x57cdf2);}return _0x1d0ade[_0x0b15('0x1b')](_0x57cdf2)[_0x0b15('0x1c')]();};}function respondWithResult(_0x37d5c0,_0xfb7a2b){_0xfb7a2b=_0xfb7a2b||0xc8;return function(_0x459674){if(_0x459674){return _0x37d5c0['status'](_0xfb7a2b)['json'](_0x459674);}};}function respondWithFilteredResult(_0x4e157d,_0x29b969){return function(_0x4440fb){if(_0x4440fb){var _0xcda949=typeof _0x29b969[_0x0b15('0x1d')]===_0x0b15('0x1e')&&typeof _0x29b969['limit']===_0x0b15('0x1e');var _0x9a784=_0x4440fb['count'];var _0x4ba1a8=_0xcda949?0x0:_0x29b969['offset'];var _0x37e692=_0xcda949?_0x4440fb[_0x0b15('0x1f')]:_0x29b969[_0x0b15('0x1d')]+_0x29b969[_0x0b15('0x20')];var _0x1d830a;if(_0x37e692>=_0x9a784){_0x37e692=_0x9a784;_0x1d830a=0xc8;}else{_0x1d830a=0xce;}_0x4e157d['status'](_0x1d830a);return _0x4e157d[_0x0b15('0x21')]('Content-Range',_0x4ba1a8+'-'+_0x37e692+'/'+_0x9a784)['json'](_0x4440fb);}return null;};}function patchUpdates(_0x156e44){return function(_0xbc33a3){try{jsonpatch['apply'](_0xbc33a3,_0x156e44,!![]);}catch(_0x2963d8){return BPromise['reject'](_0x2963d8);}return _0xbc33a3[_0x0b15('0x22')]();};}function saveUpdates(_0x3de282,_0x5d8701){return function(_0x269293){if(_0x269293){return _0x269293[_0x0b15('0x23')](_0x3de282)[_0x0b15('0x24')](function(_0x3539d9){return _0x3539d9;});}return null;};}function removeEntity(_0x103544,_0x4a5445){return function(_0x221751){if(_0x221751){return _0x221751[_0x0b15('0x25')]()[_0x0b15('0x24')](function(){_0x103544[_0x0b15('0x1b')](0xcc)[_0x0b15('0x1c')]();});}};}function handleEntityNotFound(_0xa04547,_0x4cc78f){return function(_0x1a6d7a){if(!_0x1a6d7a){_0xa04547[_0x0b15('0x26')](0x194);}return _0x1a6d7a;};}function handleError(_0x30e669,_0x21c327){_0x21c327=_0x21c327||0x1f4;return function(_0x2a0fdf){logger[_0x0b15('0x27')](_0x2a0fdf[_0x0b15('0x28')]);if(_0x2a0fdf[_0x0b15('0x29')]){delete _0x2a0fdf['name'];}_0x30e669[_0x0b15('0x1b')](_0x21c327)[_0x0b15('0x2a')](_0x2a0fdf);};}exports[_0x0b15('0x2b')]=function(_0x4da157,_0x43b636){var _0x45aab9={},_0x178328={},_0x1a0237={'count':0x0,'rows':[]};var _0xa45fa6=_['map'](db[_0x0b15('0x2c')][_0x0b15('0x2d')],function(_0x41ab5e){return{'name':_0x41ab5e[_0x0b15('0x2e')],'type':_0x41ab5e[_0x0b15('0x2f')][_0x0b15('0x30')]};});_0x178328['model']=_['map'](_0xa45fa6,_0x0b15('0x29'));_0x178328[_0x0b15('0x31')]=_[_0x0b15('0x32')](_0x4da157[_0x0b15('0x31')]);_0x178328[_0x0b15('0x33')]=_[_0x0b15('0x34')](_0x178328[_0x0b15('0x35')],_0x178328[_0x0b15('0x31')]);_0x45aab9['attributes']=_['intersection'](_0x178328[_0x0b15('0x35')],qs[_0x0b15('0x36')](_0x4da157[_0x0b15('0x31')]['fields']));_0x45aab9[_0x0b15('0x37')]=_0x45aab9['attributes'][_0x0b15('0x38')]?_0x45aab9['attributes']:_0x178328[_0x0b15('0x35')];if(!_0x4da157[_0x0b15('0x31')][_0x0b15('0x39')](_0x0b15('0x3a'))){_0x45aab9[_0x0b15('0x20')]=qs['limit'](_0x4da157[_0x0b15('0x31')]['limit']);_0x45aab9[_0x0b15('0x1d')]=qs[_0x0b15('0x1d')](_0x4da157['query']['offset']);}_0x45aab9[_0x0b15('0x3b')]=qs[_0x0b15('0x3c')](_0x4da157[_0x0b15('0x31')][_0x0b15('0x3c')]);_0x45aab9[_0x0b15('0x3d')]=qs['filters'](_[_0x0b15('0x3e')](_0x4da157[_0x0b15('0x31')],_0x178328[_0x0b15('0x33')]),_0xa45fa6);if(_0x4da157['query'][_0x0b15('0x3f')]){_0x45aab9[_0x0b15('0x3d')]=_[_0x0b15('0x40')](_0x45aab9[_0x0b15('0x3d')],{'$or':_['map'](_0xa45fa6,function(_0x2542b8){if(_0x2542b8[_0x0b15('0x2f')]!==_0x0b15('0x41')){var _0x18d661={};_0x18d661[_0x2542b8[_0x0b15('0x29')]]={'$like':'%'+_0x4da157[_0x0b15('0x31')][_0x0b15('0x3f')]+'%'};return _0x18d661;}})});}_0x45aab9=_['merge']({},_0x45aab9,_0x4da157[_0x0b15('0x42')]);var _0x46626f={'where':_0x45aab9['where']};return db['SugarcrmConfiguration']['count'](_0x46626f)['then'](function(_0x385b04){_0x1a0237[_0x0b15('0x1f')]=_0x385b04;if(_0x4da157['query'][_0x0b15('0x43')]){_0x45aab9['include']=[{'all':!![]}];}return db[_0x0b15('0x2c')][_0x0b15('0x44')](_0x45aab9);})[_0x0b15('0x24')](function(_0x27497d){_0x1a0237[_0x0b15('0x45')]=_0x27497d;return _0x1a0237;})[_0x0b15('0x24')](respondWithFilteredResult(_0x43b636,_0x45aab9))[_0x0b15('0x46')](handleError(_0x43b636,null));};exports[_0x0b15('0x47')]=function(_0x5267d3,_0x38b6c1){var _0x22d973={'raw':![],'where':{'id':_0x5267d3[_0x0b15('0x48')]['id']}},_0x5d700e={};_0x5d700e['model']=_[_0x0b15('0x32')](db[_0x0b15('0x2c')]['rawAttributes']);_0x5d700e[_0x0b15('0x31')]=_[_0x0b15('0x32')](_0x5267d3[_0x0b15('0x31')]);_0x5d700e[_0x0b15('0x33')]=_['intersection'](_0x5d700e[_0x0b15('0x35')],_0x5d700e[_0x0b15('0x31')]);_0x22d973['attributes']=_[_0x0b15('0x34')](_0x5d700e[_0x0b15('0x35')],qs[_0x0b15('0x36')](_0x5267d3['query'][_0x0b15('0x36')]));_0x22d973[_0x0b15('0x37')]=_0x22d973['attributes'][_0x0b15('0x38')]?_0x22d973[_0x0b15('0x37')]:_0x5d700e[_0x0b15('0x35')];if(_0x5267d3[_0x0b15('0x31')][_0x0b15('0x43')]){_0x22d973['include']=[{'all':!![]}];}_0x22d973=_[_0x0b15('0x40')]({},_0x22d973,_0x5267d3['options']);return db['SugarcrmConfiguration'][_0x0b15('0x49')](_0x22d973)[_0x0b15('0x24')](handleEntityNotFound(_0x38b6c1,null))[_0x0b15('0x24')](respondWithResult(_0x38b6c1,null))[_0x0b15('0x46')](handleError(_0x38b6c1,null));};exports['create']=function(_0x27dbce,_0x355ad9){return db[_0x0b15('0x2c')][_0x0b15('0x4a')](_0x27dbce[_0x0b15('0x4b')],{})[_0x0b15('0x24')](respondWithResult(_0x355ad9,0xc9))[_0x0b15('0x46')](handleError(_0x355ad9,null));};exports[_0x0b15('0x23')]=function(_0x361259,_0x14b66f){if(_0x361259[_0x0b15('0x4b')]['id']){delete _0x361259['body']['id'];}return db['SugarcrmConfiguration'][_0x0b15('0x49')]({'where':{'id':_0x361259[_0x0b15('0x48')]['id']}})['then'](handleEntityNotFound(_0x14b66f,null))[_0x0b15('0x24')](saveUpdates(_0x361259['body'],null))[_0x0b15('0x24')](respondWithResult(_0x14b66f,null))[_0x0b15('0x46')](handleError(_0x14b66f,null));};exports[_0x0b15('0x25')]=function(_0xcb9fe8,_0x33c2c9){return db['SugarcrmConfiguration'][_0x0b15('0x49')]({'where':{'id':_0xcb9fe8[_0x0b15('0x48')]['id']}})[_0x0b15('0x24')](handleEntityNotFound(_0x33c2c9,null))[_0x0b15('0x24')](removeEntity(_0x33c2c9,null))['catch'](handleError(_0x33c2c9,null));};exports[_0x0b15('0x4c')]=function(_0x13517a,_0x469e70,_0x7978e4){var _0x1926ef={};var _0xaad442={};var _0x5955bb;var _0x1f45ea;return db[_0x0b15('0x2c')]['findOne']({'where':{'id':_0x13517a[_0x0b15('0x48')]['id']}})[_0x0b15('0x24')](handleEntityNotFound(_0x469e70,null))[_0x0b15('0x24')](function(_0x4fc93e){if(_0x4fc93e){_0x5955bb=_0x4fc93e;_0xaad442[_0x0b15('0x35')]=_[_0x0b15('0x32')](db[_0x0b15('0x4d')][_0x0b15('0x2d')]);_0xaad442[_0x0b15('0x31')]=_[_0x0b15('0x32')](_0x13517a[_0x0b15('0x31')]);_0xaad442['filters']=_[_0x0b15('0x34')](_0xaad442[_0x0b15('0x35')],_0xaad442[_0x0b15('0x31')]);_0x1926ef['attributes']=_[_0x0b15('0x34')](_0xaad442[_0x0b15('0x35')],qs[_0x0b15('0x36')](_0x13517a[_0x0b15('0x31')]['fields']));_0x1926ef[_0x0b15('0x37')]=_0x1926ef['attributes'][_0x0b15('0x38')]?_0x1926ef['attributes']:_0xaad442[_0x0b15('0x35')];_0x1926ef['order']=qs[_0x0b15('0x3c')](_0x13517a['query'][_0x0b15('0x3c')]);_0x1926ef[_0x0b15('0x3d')]=qs[_0x0b15('0x33')](_[_0x0b15('0x3e')](_0x13517a[_0x0b15('0x31')],_0xaad442[_0x0b15('0x33')]));if(_0x13517a['query'][_0x0b15('0x3f')]){_0x1926ef[_0x0b15('0x3d')]=_[_0x0b15('0x40')](_0x1926ef['where'],{'$or':_[_0x0b15('0x4e')](_0x1926ef['attributes'],function(_0x1bd4d1){var _0x2be2d6={};_0x2be2d6[_0x1bd4d1]={'$like':'%'+_0x13517a[_0x0b15('0x31')][_0x0b15('0x3f')]+'%'};return _0x2be2d6;})});}_0x1926ef=_['merge']({},_0x1926ef,_0x13517a[_0x0b15('0x42')]);return _0x5955bb[_0x0b15('0x4c')](_0x1926ef);}})['then'](function(_0x379ec1){if(_0x379ec1){_0x1f45ea=_0x379ec1['length'];if(!_0x13517a[_0x0b15('0x31')][_0x0b15('0x39')]('nolimit')){_0x1926ef[_0x0b15('0x20')]=qs[_0x0b15('0x20')](_0x13517a[_0x0b15('0x31')]['limit']);_0x1926ef['offset']=qs[_0x0b15('0x1d')](_0x13517a['query']['offset']);}return _0x5955bb[_0x0b15('0x4c')](_0x1926ef);}})[_0x0b15('0x24')](function(_0x5ae0c6){if(_0x5ae0c6){return _0x5ae0c6?{'count':_0x1f45ea,'rows':_0x5ae0c6}:null;}})['then'](respondWithResult(_0x469e70,null))[_0x0b15('0x46')](handleError(_0x469e70,null));};exports[_0x0b15('0x4f')]=function(_0x2d3f80,_0x2972cb,_0xc6a637){var _0x45176f={};var _0x4c4114={};var _0x5b0e71;var _0x4234f4;return db[_0x0b15('0x2c')][_0x0b15('0x50')]({'where':{'id':_0x2d3f80[_0x0b15('0x48')]['id']}})[_0x0b15('0x24')](handleEntityNotFound(_0x2972cb,null))['then'](function(_0x50d140){if(_0x50d140){_0x5b0e71=_0x50d140;_0x4c4114['model']=_[_0x0b15('0x32')](db[_0x0b15('0x4d')][_0x0b15('0x2d')]);_0x4c4114['query']=_[_0x0b15('0x32')](_0x2d3f80[_0x0b15('0x31')]);_0x4c4114[_0x0b15('0x33')]=_[_0x0b15('0x34')](_0x4c4114[_0x0b15('0x35')],_0x4c4114[_0x0b15('0x31')]);_0x45176f[_0x0b15('0x37')]=_[_0x0b15('0x34')](_0x4c4114[_0x0b15('0x35')],qs[_0x0b15('0x36')](_0x2d3f80[_0x0b15('0x31')][_0x0b15('0x36')]));_0x45176f['attributes']=_0x45176f[_0x0b15('0x37')][_0x0b15('0x38')]?_0x45176f[_0x0b15('0x37')]:_0x4c4114[_0x0b15('0x35')];_0x45176f[_0x0b15('0x3b')]=qs[_0x0b15('0x3c')](_0x2d3f80[_0x0b15('0x31')]['sort']);_0x45176f['where']=qs[_0x0b15('0x33')](_[_0x0b15('0x3e')](_0x2d3f80['query'],_0x4c4114['filters']));if(_0x2d3f80[_0x0b15('0x31')][_0x0b15('0x3f')]){_0x45176f['where']=_[_0x0b15('0x40')](_0x45176f[_0x0b15('0x3d')],{'$or':_[_0x0b15('0x4e')](_0x45176f['attributes'],function(_0x18f47a){var _0x47c002={};_0x47c002[_0x18f47a]={'$like':'%'+_0x2d3f80[_0x0b15('0x31')]['filter']+'%'};return _0x47c002;})});}_0x45176f=_[_0x0b15('0x40')]({},_0x45176f,_0x2d3f80[_0x0b15('0x42')]);return _0x5b0e71[_0x0b15('0x4f')](_0x45176f);}})['then'](function(_0x4c377c){if(_0x4c377c){_0x4234f4=_0x4c377c[_0x0b15('0x38')];if(!_0x2d3f80[_0x0b15('0x31')][_0x0b15('0x39')](_0x0b15('0x3a'))){_0x45176f[_0x0b15('0x20')]=qs['limit'](_0x2d3f80[_0x0b15('0x31')][_0x0b15('0x20')]);_0x45176f[_0x0b15('0x1d')]=qs[_0x0b15('0x1d')](_0x2d3f80['query'][_0x0b15('0x1d')]);}return _0x5b0e71[_0x0b15('0x4f')](_0x45176f);}})[_0x0b15('0x24')](function(_0xda9f06){if(_0xda9f06){return _0xda9f06?{'count':_0x4234f4,'rows':_0xda9f06}:null;}})[_0x0b15('0x24')](respondWithResult(_0x2972cb,null))['catch'](handleError(_0x2972cb,null));};exports[_0x0b15('0x51')]=function(_0x5f52ab,_0x13ab11,_0x2a3c78){var _0x326fdf={};var _0x30894a={};var _0x261c01;var _0x469c8e;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x5f52ab[_0x0b15('0x48')]['id']}})[_0x0b15('0x24')](handleEntityNotFound(_0x13ab11,null))['then'](function(_0x5f11b6){if(_0x5f11b6){_0x261c01=_0x5f11b6;_0x30894a[_0x0b15('0x35')]=_['keys'](db[_0x0b15('0x4d')]['rawAttributes']);_0x30894a[_0x0b15('0x31')]=_[_0x0b15('0x32')](_0x5f52ab[_0x0b15('0x31')]);_0x30894a[_0x0b15('0x33')]=_['intersection'](_0x30894a['model'],_0x30894a[_0x0b15('0x31')]);_0x326fdf[_0x0b15('0x37')]=_[_0x0b15('0x34')](_0x30894a[_0x0b15('0x35')],qs[_0x0b15('0x36')](_0x5f52ab['query'][_0x0b15('0x36')]));_0x326fdf['attributes']=_0x326fdf[_0x0b15('0x37')][_0x0b15('0x38')]?_0x326fdf['attributes']:_0x30894a[_0x0b15('0x35')];_0x326fdf[_0x0b15('0x3b')]=qs[_0x0b15('0x3c')](_0x5f52ab['query'][_0x0b15('0x3c')]);_0x326fdf[_0x0b15('0x3d')]=qs[_0x0b15('0x33')](_['pick'](_0x5f52ab['query'],_0x30894a[_0x0b15('0x33')]));if(_0x5f52ab['query'][_0x0b15('0x3f')]){_0x326fdf[_0x0b15('0x3d')]=_['merge'](_0x326fdf['where'],{'$or':_[_0x0b15('0x4e')](_0x326fdf[_0x0b15('0x37')],function(_0x38ff13){var _0x2c9257={};_0x2c9257[_0x38ff13]={'$like':'%'+_0x5f52ab['query'][_0x0b15('0x3f')]+'%'};return _0x2c9257;})});}_0x326fdf=_[_0x0b15('0x40')]({},_0x326fdf,_0x5f52ab[_0x0b15('0x42')]);return _0x261c01[_0x0b15('0x51')](_0x326fdf);}})[_0x0b15('0x24')](function(_0x4e6125){if(_0x4e6125){_0x469c8e=_0x4e6125[_0x0b15('0x38')];if(!_0x5f52ab[_0x0b15('0x31')][_0x0b15('0x39')](_0x0b15('0x3a'))){_0x326fdf['limit']=qs[_0x0b15('0x20')](_0x5f52ab['query'][_0x0b15('0x20')]);_0x326fdf['offset']=qs[_0x0b15('0x1d')](_0x5f52ab[_0x0b15('0x31')]['offset']);}return _0x261c01[_0x0b15('0x51')](_0x326fdf);}})[_0x0b15('0x24')](function(_0x550895){if(_0x550895){return _0x550895?{'count':_0x469c8e,'rows':_0x550895}:null;}})[_0x0b15('0x24')](respondWithResult(_0x13ab11,null))[_0x0b15('0x46')](handleError(_0x13ab11,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index ef86eca..44c9f80 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb41d=['./intSugarcrmConfiguration.attributes','exports','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0xb41d,0xad));var _0xdb41=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xb41d[_0x397cfb];return _0x15fed9;};'use strict';var _=require('lodash');var util=require(_0xdb41('0x0'));var logger=require(_0xdb41('0x1'))(_0xdb41('0x2'));var moment=require(_0xdb41('0x3'));var BPromise=require(_0xdb41('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb41('0x5'));var rimraf=require(_0xdb41('0x6'));var config=require('../../config/environment');var attributes=require(_0xdb41('0x7'));module[_0xdb41('0x8')]=function(_0x3ca274,_0x26754a){return _0x3ca274['define']('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x806c=['exports','define','SugarcrmConfiguration','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x4d45c1,_0x2beda1){var _0x244478=function(_0x11304c){while(--_0x11304c){_0x4d45c1['push'](_0x4d45c1['shift']());}};_0x244478(++_0x2beda1);}(_0x806c,0x16b));var _0xc806=function(_0x23ec06,_0x561142){_0x23ec06=_0x23ec06-0x0;var _0x2831d4=_0x806c[_0x23ec06];return _0x2831d4;};'use strict';var _=require(_0xc806('0x0'));var util=require('util');var logger=require(_0xc806('0x1'))(_0xc806('0x2'));var moment=require(_0xc806('0x3'));var BPromise=require(_0xc806('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc806('0x5'));var rimraf=require(_0xc806('0x6'));var config=require(_0xc806('0x7'));var attributes=require(_0xc806('0x8'));module[_0xc806('0x9')]=function(_0x443454,_0x2940a0){return _0x443454[_0xc806('0xa')](_0xc806('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index e2310e2..4fc24ad 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3011=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3011,0x14c));var _0x1301=function(_0x248d46,_0xba08ec){_0x248d46=_0x248d46-0x0;var _0x354942=_0x3011[_0x248d46];return _0x354942;};'use strict';var _=require(_0x1301('0x0'));var util=require(_0x1301('0x1'));var moment=require(_0x1301('0x2'));var BPromise=require(_0x1301('0x3'));var rs=require(_0x1301('0x4'));var fs=require('fs');var Redis=require(_0x1301('0x5'));var db=require(_0x1301('0x6'))['db'];var utils=require(_0x1301('0x7'));var logger=require(_0x1301('0x8'))(_0x1301('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1301('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x547fe2,_0x4d1f4d,_0x4cfe69){return new BPromise(function(_0x49780b,_0x1884be){return client[_0x1301('0xb')](_0x547fe2,_0x4cfe69)[_0x1301('0xc')](function(_0x417a9e){logger[_0x1301('0xd')](_0x1301('0xe'),_0x4d1f4d,_0x1301('0xf'));logger[_0x1301('0x10')](_0x1301('0x11'),_0x4d1f4d,_0x1301('0xf'),JSON[_0x1301('0x12')](_0x417a9e));if(_0x417a9e[_0x1301('0x13')]){if(_0x417a9e['error'][_0x1301('0x14')]===0x1f4){logger['error'](_0x1301('0xe'),_0x4d1f4d,_0x417a9e[_0x1301('0x13')][_0x1301('0x15')]);return _0x1884be(_0x417a9e[_0x1301('0x13')][_0x1301('0x15')]);}logger[_0x1301('0x13')](_0x1301('0xe'),_0x4d1f4d,_0x417a9e[_0x1301('0x13')][_0x1301('0x15')]);return _0x49780b(_0x417a9e[_0x1301('0x13')][_0x1301('0x15')]);}else{logger[_0x1301('0xd')](_0x1301('0xe'),_0x4d1f4d,_0x1301('0xf'));_0x49780b(_0x417a9e[_0x1301('0x16')]['message']);}})[_0x1301('0x17')](function(_0x3b57a4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x4d1f4d,_0x3b57a4);_0x1884be(_0x3b57a4);});});} \ No newline at end of file +var _0x110a=['message','SugarcrmConfiguration,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x110a,0x88));var _0xa110=function(_0x28386c,_0x10f7ce){_0x28386c=_0x28386c-0x0;var _0x49b105=_0x110a[_0x28386c];return _0x49b105;};'use strict';var _=require(_0xa110('0x0'));var util=require('util');var moment=require(_0xa110('0x1'));var BPromise=require(_0xa110('0x2'));var rs=require(_0xa110('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa110('0x4'))['db'];var utils=require(_0xa110('0x5'));var logger=require('../../config/logger')(_0xa110('0x6'));var config=require('../../config/environment');var jayson=require(_0xa110('0x7'));var client=jayson[_0xa110('0x8')][_0xa110('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48afc9,_0x131fad,_0x29b0fa){return new BPromise(function(_0x56b8fb,_0x327c3c){return client[_0xa110('0xa')](_0x48afc9,_0x29b0fa)[_0xa110('0xb')](function(_0x5a5794){logger[_0xa110('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x131fad,_0xa110('0xd'));logger[_0xa110('0xe')](_0xa110('0xf'),_0x131fad,_0xa110('0xd'),JSON[_0xa110('0x10')](_0x5a5794));if(_0x5a5794[_0xa110('0x11')]){if(_0x5a5794['error']['code']===0x1f4){logger[_0xa110('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x131fad,_0x5a5794['error'][_0xa110('0x12')]);return _0x327c3c(_0x5a5794[_0xa110('0x11')][_0xa110('0x12')]);}logger[_0xa110('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x131fad,_0x5a5794[_0xa110('0x11')]['message']);return _0x56b8fb(_0x5a5794[_0xa110('0x11')][_0xa110('0x12')]);}else{logger[_0xa110('0xc')](_0xa110('0x13'),_0x131fad,_0xa110('0xd'));_0x56b8fb(_0x5a5794[_0xa110('0x14')][_0xa110('0x12')]);}})[_0xa110('0x15')](function(_0x5ec68c){logger[_0xa110('0x11')](_0xa110('0x13'),_0x131fad,_0x5ec68c);_0x327c3c(_0x5ec68c);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 7590e4c..644df53 100644 --- a/server/api/intSugarcrmField/index.js +++ b/server/api/intSugarcrmField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77bc=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','create','put','update'];(function(_0x3366ef,_0xd32082){var _0x2a8a16=function(_0x431534){while(--_0x431534){_0x3366ef['push'](_0x3366ef['shift']());}};_0x2a8a16(++_0xd32082);}(_0x77bc,0x8e));var _0xc77b=function(_0x377f2b,_0x2d2cf2){_0x377f2b=_0x377f2b-0x0;var _0x3c5c77=_0x77bc[_0x377f2b];return _0x3c5c77;};'use strict';var multer=require(_0xc77b('0x0'));var util=require(_0xc77b('0x1'));var path=require(_0xc77b('0x2'));var timeout=require(_0xc77b('0x3'));var express=require(_0xc77b('0x4'));var router=express[_0xc77b('0x5')]();var fs_extra=require(_0xc77b('0x6'));var auth=require(_0xc77b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc77b('0x8'));var controller=require(_0xc77b('0x9'));router[_0xc77b('0xa')]('/',auth[_0xc77b('0xb')](),controller[_0xc77b('0xc')]);router[_0xc77b('0xa')](_0xc77b('0xd'),auth['isAuthenticated'](),controller[_0xc77b('0xe')]);router['post']('/',auth[_0xc77b('0xb')](),controller[_0xc77b('0xf')]);router[_0xc77b('0x10')]('/:id',auth[_0xc77b('0xb')](),controller[_0xc77b('0x11')]);router[_0xc77b('0x12')](_0xc77b('0xd'),auth[_0xc77b('0xb')](),controller[_0xc77b('0x13')]);module['exports']=router; \ No newline at end of file +var _0x62dc=['show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id'];(function(_0xd93b26,_0x12bbf2){var _0x25f668=function(_0x133ff7){while(--_0x133ff7){_0xd93b26['push'](_0xd93b26['shift']());}};_0x25f668(++_0x12bbf2);}(_0x62dc,0x182));var _0xc62d=function(_0x4cf8fe,_0x11ade3){_0x4cf8fe=_0x4cf8fe-0x0;var _0xd97de2=_0x62dc[_0x4cf8fe];return _0xd97de2;};'use strict';var multer=require(_0xc62d('0x0'));var util=require(_0xc62d('0x1'));var path=require(_0xc62d('0x2'));var timeout=require(_0xc62d('0x3'));var express=require(_0xc62d('0x4'));var router=express[_0xc62d('0x5')]();var fs_extra=require(_0xc62d('0x6'));var auth=require(_0xc62d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc62d('0x8'));var controller=require(_0xc62d('0x9'));router[_0xc62d('0xa')]('/',auth[_0xc62d('0xb')](),controller[_0xc62d('0xc')]);router[_0xc62d('0xa')](_0xc62d('0xd'),auth[_0xc62d('0xb')](),controller[_0xc62d('0xe')]);router[_0xc62d('0xf')]('/',auth[_0xc62d('0xb')](),controller[_0xc62d('0x10')]);router[_0xc62d('0x11')](_0xc62d('0xd'),auth[_0xc62d('0xb')](),controller['update']);router[_0xc62d('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xc62d('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 6bc81b9..03dd57b 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.attributes.js +++ b/server/api/intSugarcrmField/intSugarcrmField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0e9=['exports','ENUM','string','customVariable','picklist','STRING','variable'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd0e9,0x111));var _0x9d0e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd0e9[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x9d0e('0x0')]={'type':{'type':Sequelize[_0x9d0e('0x1')](_0x9d0e('0x2'),'variable',_0x9d0e('0x3'),'keyValue',_0x9d0e('0x4')),'defaultValue':_0x9d0e('0x2')},'content':{'type':Sequelize[_0x9d0e('0x5')]},'key':{'type':Sequelize[_0x9d0e('0x5')]},'keyType':{'type':Sequelize[_0x9d0e('0x1')](_0x9d0e('0x2'),_0x9d0e('0x6'),_0x9d0e('0x3'))},'keyContent':{'type':Sequelize[_0x9d0e('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9d0e('0x5')]}}; \ No newline at end of file +var _0xb1eb=['picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','customVariable','keyValue'];(function(_0xac0de1,_0x12d3d9){var _0x1c1995=function(_0x3f96e8){while(--_0x3f96e8){_0xac0de1['push'](_0xac0de1['shift']());}};_0x1c1995(++_0x12d3d9);}(_0xb1eb,0x100));var _0xbb1e=function(_0xe89da2,_0x258ee0){_0xe89da2=_0xe89da2-0x0;var _0x11db04=_0xb1eb[_0xe89da2];return _0x11db04;};'use strict';var Sequelize=require(_0xbb1e('0x0'));module[_0xbb1e('0x1')]={'type':{'type':Sequelize['ENUM'](_0xbb1e('0x2'),'variable',_0xbb1e('0x3'),_0xbb1e('0x4'),_0xbb1e('0x5')),'defaultValue':_0xbb1e('0x2')},'content':{'type':Sequelize[_0xbb1e('0x6')]},'key':{'type':Sequelize[_0xbb1e('0x6')]},'keyType':{'type':Sequelize[_0xbb1e('0x7')](_0xbb1e('0x2'),'variable',_0xbb1e('0x3'))},'keyContent':{'type':Sequelize[_0xbb1e('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xbb1e('0x6')]},'customField':{'type':Sequelize[_0xbb1e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbb1e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index ed5b587..1f5b8dc 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.controller.js +++ b/server/api/intSugarcrmField/intSugarcrmField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa934=['update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','merge','type','VIRTUAL','filter','options','SugarcrmField','findAll','rows','catch','show','params','keys','includeAll','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','reject','save'];(function(_0x3e1226,_0x4199d6){var _0x1ff634=function(_0x4dbed0){while(--_0x4dbed0){_0x3e1226['push'](_0x3e1226['shift']());}};_0x1ff634(++_0x4199d6);}(_0xa934,0x72));var _0x4a93=function(_0x46c97d,_0x1bdfed){_0x46c97d=_0x46c97d-0x0;var _0x1d682f=_0xa934[_0x46c97d];return _0x1d682f;};'use strict';var emlformat=require(_0x4a93('0x0'));var rimraf=require(_0x4a93('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a93('0x2'));var rp=require(_0x4a93('0x3'));var moment=require(_0x4a93('0x4'));var BPromise=require(_0x4a93('0x5'));var Mustache=require(_0x4a93('0x6'));var util=require(_0x4a93('0x7'));var path=require(_0x4a93('0x8'));var sox=require(_0x4a93('0x9'));var csv=require(_0x4a93('0xa'));var ejs=require(_0x4a93('0xb'));var fs=require('fs');var fs_extra=require(_0x4a93('0xc'));var _=require(_0x4a93('0xd'));var squel=require(_0x4a93('0xe'));var crypto=require(_0x4a93('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4a93('0xa'));var querystring=require(_0x4a93('0x10'));var Papa=require(_0x4a93('0x11'));var Redis=require(_0x4a93('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4a93('0x13'));var as=require(_0x4a93('0x14'));var hardwareService=require(_0x4a93('0x15'));var logger=require(_0x4a93('0x16'))(_0x4a93('0x17'));var utils=require(_0x4a93('0x18'));var config=require(_0x4a93('0x19'));var licenseUtil=require(_0x4a93('0x1a'));var db=require(_0x4a93('0x1b'))['db'];function respondWithStatusCode(_0x451138,_0x24bbf0){_0x24bbf0=_0x24bbf0||0xcc;return function(_0x59d264){if(_0x59d264){return _0x451138[_0x4a93('0x1c')](_0x24bbf0);}return _0x451138[_0x4a93('0x1d')](_0x24bbf0)[_0x4a93('0x1e')]();};}function respondWithResult(_0x510e6d,_0x5231eb){_0x5231eb=_0x5231eb||0xc8;return function(_0x170ba7){if(_0x170ba7){return _0x510e6d['status'](_0x5231eb)[_0x4a93('0x1f')](_0x170ba7);}};}function respondWithFilteredResult(_0x414cb8,_0x5aa2bb){return function(_0x567d0b){if(_0x567d0b){var _0x8dcfa5=typeof _0x5aa2bb[_0x4a93('0x20')]===_0x4a93('0x21')&&typeof _0x5aa2bb['limit']===_0x4a93('0x21');var _0x2d6ede=_0x567d0b[_0x4a93('0x22')];var _0x301a74=_0x8dcfa5?0x0:_0x5aa2bb['offset'];var _0x42e4f4=_0x8dcfa5?_0x567d0b[_0x4a93('0x22')]:_0x5aa2bb[_0x4a93('0x20')]+_0x5aa2bb[_0x4a93('0x23')];var _0xe149ee;if(_0x42e4f4>=_0x2d6ede){_0x42e4f4=_0x2d6ede;_0xe149ee=0xc8;}else{_0xe149ee=0xce;}_0x414cb8['status'](_0xe149ee);return _0x414cb8['set']('Content-Range',_0x301a74+'-'+_0x42e4f4+'/'+_0x2d6ede)['json'](_0x567d0b);}return null;};}function patchUpdates(_0x31f8a3){return function(_0x57941d){try{jsonpatch['apply'](_0x57941d,_0x31f8a3,!![]);}catch(_0x33530c){return BPromise[_0x4a93('0x24')](_0x33530c);}return _0x57941d[_0x4a93('0x25')]();};}function saveUpdates(_0xfe2abf,_0x239352){return function(_0x12ed42){if(_0x12ed42){return _0x12ed42[_0x4a93('0x26')](_0xfe2abf)[_0x4a93('0x27')](function(_0x257ed5){return _0x257ed5;});}return null;};}function removeEntity(_0x3069c8,_0x9cf225){return function(_0x291ca9){if(_0x291ca9){return _0x291ca9[_0x4a93('0x28')]()[_0x4a93('0x27')](function(){_0x3069c8['status'](0xcc)[_0x4a93('0x1e')]();});}};}function handleEntityNotFound(_0x1fca9e,_0x331ad6){return function(_0x1461e1){if(!_0x1461e1){_0x1fca9e[_0x4a93('0x1c')](0x194);}return _0x1461e1;};}function handleError(_0x53f775,_0x17d021){_0x17d021=_0x17d021||0x1f4;return function(_0x4b747b){logger['error'](_0x4b747b[_0x4a93('0x29')]);if(_0x4b747b[_0x4a93('0x2a')]){delete _0x4b747b['name'];}_0x53f775[_0x4a93('0x1d')](_0x17d021)[_0x4a93('0x2b')](_0x4b747b);};}exports[_0x4a93('0x2c')]=function(_0xc3e8a3,_0x53709c){var _0x886b27={},_0x18df4b={},_0x37ddc6={'count':0x0,'rows':[]};var _0x4cdd33=_[_0x4a93('0x2d')](db['SugarcrmField'][_0x4a93('0x2e')],function(_0xcd833f){return{'name':_0xcd833f[_0x4a93('0x2f')],'type':_0xcd833f['type'][_0x4a93('0x30')]};});_0x18df4b[_0x4a93('0x31')]=_[_0x4a93('0x2d')](_0x4cdd33,_0x4a93('0x2a'));_0x18df4b[_0x4a93('0x32')]=_['keys'](_0xc3e8a3[_0x4a93('0x32')]);_0x18df4b['filters']=_[_0x4a93('0x33')](_0x18df4b['model'],_0x18df4b[_0x4a93('0x32')]);_0x886b27[_0x4a93('0x34')]=_[_0x4a93('0x33')](_0x18df4b[_0x4a93('0x31')],qs[_0x4a93('0x35')](_0xc3e8a3[_0x4a93('0x32')]['fields']));_0x886b27['attributes']=_0x886b27[_0x4a93('0x34')][_0x4a93('0x36')]?_0x886b27[_0x4a93('0x34')]:_0x18df4b[_0x4a93('0x31')];if(!_0xc3e8a3[_0x4a93('0x32')]['hasOwnProperty'](_0x4a93('0x37'))){_0x886b27[_0x4a93('0x23')]=qs[_0x4a93('0x23')](_0xc3e8a3['query'][_0x4a93('0x23')]);_0x886b27['offset']=qs[_0x4a93('0x20')](_0xc3e8a3[_0x4a93('0x32')][_0x4a93('0x20')]);}_0x886b27['order']=qs[_0x4a93('0x38')](_0xc3e8a3[_0x4a93('0x32')][_0x4a93('0x38')]);_0x886b27[_0x4a93('0x39')]=qs[_0x4a93('0x3a')](_['pick'](_0xc3e8a3[_0x4a93('0x32')],_0x18df4b['filters']),_0x4cdd33);if(_0xc3e8a3[_0x4a93('0x32')]['filter']){_0x886b27[_0x4a93('0x39')]=_[_0x4a93('0x3b')](_0x886b27[_0x4a93('0x39')],{'$or':_[_0x4a93('0x2d')](_0x4cdd33,function(_0x4dcc72){if(_0x4dcc72[_0x4a93('0x3c')]!==_0x4a93('0x3d')){var _0xff8c3b={};_0xff8c3b[_0x4dcc72[_0x4a93('0x2a')]]={'$like':'%'+_0xc3e8a3[_0x4a93('0x32')][_0x4a93('0x3e')]+'%'};return _0xff8c3b;}})});}_0x886b27=_['merge']({},_0x886b27,_0xc3e8a3[_0x4a93('0x3f')]);var _0x23b152={'where':_0x886b27[_0x4a93('0x39')]};return db[_0x4a93('0x40')][_0x4a93('0x22')](_0x23b152)['then'](function(_0xc14084){_0x37ddc6['count']=_0xc14084;if(_0xc3e8a3['query']['includeAll']){_0x886b27['include']=[{'all':!![]}];}return db['SugarcrmField'][_0x4a93('0x41')](_0x886b27);})[_0x4a93('0x27')](function(_0x25ce1c){_0x37ddc6[_0x4a93('0x42')]=_0x25ce1c;return _0x37ddc6;})[_0x4a93('0x27')](respondWithFilteredResult(_0x53709c,_0x886b27))[_0x4a93('0x43')](handleError(_0x53709c,null));};exports[_0x4a93('0x44')]=function(_0x2c8a0f,_0x35c75c){var _0x563d72={'raw':!![],'where':{'id':_0x2c8a0f[_0x4a93('0x45')]['id']}},_0x237ace={};_0x237ace[_0x4a93('0x31')]=_[_0x4a93('0x46')](db[_0x4a93('0x40')][_0x4a93('0x2e')]);_0x237ace[_0x4a93('0x32')]=_[_0x4a93('0x46')](_0x2c8a0f[_0x4a93('0x32')]);_0x237ace['filters']=_['intersection'](_0x237ace[_0x4a93('0x31')],_0x237ace['query']);_0x563d72['attributes']=_[_0x4a93('0x33')](_0x237ace[_0x4a93('0x31')],qs['fields'](_0x2c8a0f['query'][_0x4a93('0x35')]));_0x563d72[_0x4a93('0x34')]=_0x563d72['attributes'][_0x4a93('0x36')]?_0x563d72[_0x4a93('0x34')]:_0x237ace[_0x4a93('0x31')];if(_0x2c8a0f['query'][_0x4a93('0x47')]){_0x563d72[_0x4a93('0x48')]=[{'all':!![]}];}_0x563d72=_[_0x4a93('0x3b')]({},_0x563d72,_0x2c8a0f[_0x4a93('0x3f')]);return db[_0x4a93('0x40')][_0x4a93('0x49')](_0x563d72)[_0x4a93('0x27')](handleEntityNotFound(_0x35c75c,null))[_0x4a93('0x27')](respondWithResult(_0x35c75c,null))[_0x4a93('0x43')](handleError(_0x35c75c,null));};exports['create']=function(_0x498815,_0x2a4b78){return db[_0x4a93('0x40')][_0x4a93('0x4a')](_0x498815['body'],{})['then'](respondWithResult(_0x2a4b78,0xc9))['catch'](handleError(_0x2a4b78,null));};exports[_0x4a93('0x26')]=function(_0x30eac0,_0x4939c3){if(_0x30eac0['body']['id']){delete _0x30eac0[_0x4a93('0x4b')]['id'];}return db[_0x4a93('0x40')][_0x4a93('0x49')]({'where':{'id':_0x30eac0['params']['id']}})['then'](handleEntityNotFound(_0x4939c3,null))[_0x4a93('0x27')](saveUpdates(_0x30eac0[_0x4a93('0x4b')],null))[_0x4a93('0x27')](respondWithResult(_0x4939c3,null))[_0x4a93('0x43')](handleError(_0x4939c3,null));};exports[_0x4a93('0x28')]=function(_0x10861f,_0x5aa832){return db[_0x4a93('0x40')][_0x4a93('0x49')]({'where':{'id':_0x10861f['params']['id']}})[_0x4a93('0x27')](handleEntityNotFound(_0x5aa832,null))[_0x4a93('0x27')](removeEntity(_0x5aa832,null))[_0x4a93('0x43')](handleError(_0x5aa832,null));}; \ No newline at end of file +var _0x6da8=['set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','SugarcrmField','rawAttributes','fieldName','type','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count'];(function(_0x294a0d,_0x4ccad7){var _0x49ce49=function(_0x1f4671){while(--_0x1f4671){_0x294a0d['push'](_0x294a0d['shift']());}};_0x49ce49(++_0x4ccad7);}(_0x6da8,0x78));var _0x86da=function(_0x374d23,_0x54229c){_0x374d23=_0x374d23-0x0;var _0x42d835=_0x6da8[_0x374d23];return _0x42d835;};'use strict';var emlformat=require(_0x86da('0x0'));var rimraf=require(_0x86da('0x1'));var zipdir=require(_0x86da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x86da('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x86da('0x4'));var util=require(_0x86da('0x5'));var path=require(_0x86da('0x6'));var sox=require(_0x86da('0x7'));var csv=require(_0x86da('0x8'));var ejs=require(_0x86da('0x9'));var fs=require('fs');var fs_extra=require(_0x86da('0xa'));var _=require(_0x86da('0xb'));var squel=require(_0x86da('0xc'));var crypto=require(_0x86da('0xd'));var jsforce=require(_0x86da('0xe'));var deskjs=require(_0x86da('0xf'));var toCsv=require(_0x86da('0x8'));var querystring=require(_0x86da('0x10'));var Papa=require(_0x86da('0x11'));var Redis=require(_0x86da('0x12'));var authService=require(_0x86da('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x86da('0x14'));var logger=require(_0x86da('0x15'))(_0x86da('0x16'));var utils=require(_0x86da('0x17'));var config=require(_0x86da('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x86da('0x19'))['db'];function respondWithStatusCode(_0x572469,_0x5131ee){_0x5131ee=_0x5131ee||0xcc;return function(_0x7f7c0b){if(_0x7f7c0b){return _0x572469[_0x86da('0x1a')](_0x5131ee);}return _0x572469[_0x86da('0x1b')](_0x5131ee)[_0x86da('0x1c')]();};}function respondWithResult(_0x39c792,_0x4c7a6b){_0x4c7a6b=_0x4c7a6b||0xc8;return function(_0x2862e3){if(_0x2862e3){return _0x39c792[_0x86da('0x1b')](_0x4c7a6b)[_0x86da('0x1d')](_0x2862e3);}};}function respondWithFilteredResult(_0x51f5cc,_0x55a1ce){return function(_0x580ca9){if(_0x580ca9){var _0x2b169c=typeof _0x55a1ce[_0x86da('0x1e')]==='undefined'&&typeof _0x55a1ce[_0x86da('0x1f')]===_0x86da('0x20');var _0x236f78=_0x580ca9[_0x86da('0x21')];var _0x259aa4=_0x2b169c?0x0:_0x55a1ce[_0x86da('0x1e')];var _0x171265=_0x2b169c?_0x580ca9[_0x86da('0x21')]:_0x55a1ce['offset']+_0x55a1ce[_0x86da('0x1f')];var _0x3d1484;if(_0x171265>=_0x236f78){_0x171265=_0x236f78;_0x3d1484=0xc8;}else{_0x3d1484=0xce;}_0x51f5cc[_0x86da('0x1b')](_0x3d1484);return _0x51f5cc[_0x86da('0x22')](_0x86da('0x23'),_0x259aa4+'-'+_0x171265+'/'+_0x236f78)[_0x86da('0x1d')](_0x580ca9);}return null;};}function patchUpdates(_0x3de859){return function(_0x5aaa14){try{jsonpatch[_0x86da('0x24')](_0x5aaa14,_0x3de859,!![]);}catch(_0x107c32){return BPromise[_0x86da('0x25')](_0x107c32);}return _0x5aaa14[_0x86da('0x26')]();};}function saveUpdates(_0x19dd1f,_0x518019){return function(_0x371bf8){if(_0x371bf8){return _0x371bf8[_0x86da('0x27')](_0x19dd1f)[_0x86da('0x28')](function(_0x273e0f){return _0x273e0f;});}return null;};}function removeEntity(_0x5bf184,_0x5c8669){return function(_0x46d86f){if(_0x46d86f){return _0x46d86f[_0x86da('0x29')]()[_0x86da('0x28')](function(){_0x5bf184['status'](0xcc)[_0x86da('0x1c')]();});}};}function handleEntityNotFound(_0x20cfbd,_0x2cf580){return function(_0x248c48){if(!_0x248c48){_0x20cfbd['sendStatus'](0x194);}return _0x248c48;};}function handleError(_0x2e8809,_0x1180a9){_0x1180a9=_0x1180a9||0x1f4;return function(_0x5078bf){logger[_0x86da('0x2a')](_0x5078bf['stack']);if(_0x5078bf[_0x86da('0x2b')]){delete _0x5078bf[_0x86da('0x2b')];}_0x2e8809[_0x86da('0x1b')](_0x1180a9)[_0x86da('0x2c')](_0x5078bf);};}exports['index']=function(_0x19e54f,_0x1c3a7b){var _0x24b99e={},_0xf0266d={},_0x3a9c2e={'count':0x0,'rows':[]};var _0x379817=_['map'](db[_0x86da('0x2d')][_0x86da('0x2e')],function(_0x728cee){return{'name':_0x728cee[_0x86da('0x2f')],'type':_0x728cee[_0x86da('0x30')]['key']};});_0xf0266d['model']=_[_0x86da('0x31')](_0x379817,_0x86da('0x2b'));_0xf0266d[_0x86da('0x32')]=_[_0x86da('0x33')](_0x19e54f[_0x86da('0x32')]);_0xf0266d[_0x86da('0x34')]=_['intersection'](_0xf0266d[_0x86da('0x35')],_0xf0266d[_0x86da('0x32')]);_0x24b99e[_0x86da('0x36')]=_[_0x86da('0x37')](_0xf0266d[_0x86da('0x35')],qs[_0x86da('0x38')](_0x19e54f[_0x86da('0x32')]['fields']));_0x24b99e[_0x86da('0x36')]=_0x24b99e[_0x86da('0x36')][_0x86da('0x39')]?_0x24b99e[_0x86da('0x36')]:_0xf0266d[_0x86da('0x35')];if(!_0x19e54f[_0x86da('0x32')][_0x86da('0x3a')](_0x86da('0x3b'))){_0x24b99e[_0x86da('0x1f')]=qs['limit'](_0x19e54f[_0x86da('0x32')]['limit']);_0x24b99e[_0x86da('0x1e')]=qs[_0x86da('0x1e')](_0x19e54f[_0x86da('0x32')]['offset']);}_0x24b99e[_0x86da('0x3c')]=qs['sort'](_0x19e54f[_0x86da('0x32')][_0x86da('0x3d')]);_0x24b99e[_0x86da('0x3e')]=qs[_0x86da('0x34')](_[_0x86da('0x3f')](_0x19e54f['query'],_0xf0266d[_0x86da('0x34')]),_0x379817);if(_0x19e54f[_0x86da('0x32')]['filter']){_0x24b99e[_0x86da('0x3e')]=_[_0x86da('0x40')](_0x24b99e[_0x86da('0x3e')],{'$or':_['map'](_0x379817,function(_0x2db463){if(_0x2db463[_0x86da('0x30')]!==_0x86da('0x41')){var _0x2eaaf0={};_0x2eaaf0[_0x2db463[_0x86da('0x2b')]]={'$like':'%'+_0x19e54f[_0x86da('0x32')][_0x86da('0x42')]+'%'};return _0x2eaaf0;}})});}_0x24b99e=_[_0x86da('0x40')]({},_0x24b99e,_0x19e54f[_0x86da('0x43')]);var _0x53d288={'where':_0x24b99e['where']};return db[_0x86da('0x2d')]['count'](_0x53d288)['then'](function(_0x2a2d2a){_0x3a9c2e[_0x86da('0x21')]=_0x2a2d2a;if(_0x19e54f[_0x86da('0x32')]['includeAll']){_0x24b99e[_0x86da('0x44')]=[{'all':!![]}];}return db['SugarcrmField'][_0x86da('0x45')](_0x24b99e);})[_0x86da('0x28')](function(_0x2a2d28){_0x3a9c2e[_0x86da('0x46')]=_0x2a2d28;return _0x3a9c2e;})['then'](respondWithFilteredResult(_0x1c3a7b,_0x24b99e))[_0x86da('0x47')](handleError(_0x1c3a7b,null));};exports['show']=function(_0x34f037,_0x57f9b0){var _0xcf4178={'raw':!![],'where':{'id':_0x34f037[_0x86da('0x48')]['id']}},_0x514e60={};_0x514e60[_0x86da('0x35')]=_[_0x86da('0x33')](db[_0x86da('0x2d')][_0x86da('0x2e')]);_0x514e60['query']=_[_0x86da('0x33')](_0x34f037[_0x86da('0x32')]);_0x514e60[_0x86da('0x34')]=_['intersection'](_0x514e60[_0x86da('0x35')],_0x514e60[_0x86da('0x32')]);_0xcf4178[_0x86da('0x36')]=_[_0x86da('0x37')](_0x514e60[_0x86da('0x35')],qs[_0x86da('0x38')](_0x34f037[_0x86da('0x32')]['fields']));_0xcf4178[_0x86da('0x36')]=_0xcf4178[_0x86da('0x36')]['length']?_0xcf4178[_0x86da('0x36')]:_0x514e60[_0x86da('0x35')];if(_0x34f037[_0x86da('0x32')][_0x86da('0x49')]){_0xcf4178[_0x86da('0x44')]=[{'all':!![]}];}_0xcf4178=_[_0x86da('0x40')]({},_0xcf4178,_0x34f037[_0x86da('0x43')]);return db[_0x86da('0x2d')][_0x86da('0x4a')](_0xcf4178)[_0x86da('0x28')](handleEntityNotFound(_0x57f9b0,null))['then'](respondWithResult(_0x57f9b0,null))[_0x86da('0x47')](handleError(_0x57f9b0,null));};exports[_0x86da('0x4b')]=function(_0x233785,_0x5333ee){return db[_0x86da('0x2d')]['create'](_0x233785[_0x86da('0x4c')],{})[_0x86da('0x28')](respondWithResult(_0x5333ee,0xc9))['catch'](handleError(_0x5333ee,null));};exports[_0x86da('0x27')]=function(_0xba34f0,_0x20a683){if(_0xba34f0[_0x86da('0x4c')]['id']){delete _0xba34f0[_0x86da('0x4c')]['id'];}return db[_0x86da('0x2d')][_0x86da('0x4a')]({'where':{'id':_0xba34f0['params']['id']}})[_0x86da('0x28')](handleEntityNotFound(_0x20a683,null))[_0x86da('0x28')](saveUpdates(_0xba34f0[_0x86da('0x4c')],null))['then'](respondWithResult(_0x20a683,null))[_0x86da('0x47')](handleError(_0x20a683,null));};exports[_0x86da('0x29')]=function(_0x182ccf,_0x1e7a19){return db[_0x86da('0x2d')]['find']({'where':{'id':_0x182ccf[_0x86da('0x48')]['id']}})[_0x86da('0x28')](handleEntityNotFound(_0x1e7a19,null))[_0x86da('0x28')](removeEntity(_0x1e7a19,null))['catch'](handleError(_0x1e7a19,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 58e1ee4..392f072 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.model.js +++ b/server/api/intSugarcrmField/intSugarcrmField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15fb=['int_sugarcrm_fields','sugarcrm_unique_index','FieldId','lodash','util','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x657c68,_0x2ffd75){var _0xdf7b62=function(_0x649fda){while(--_0x649fda){_0x657c68['push'](_0x657c68['shift']());}};_0xdf7b62(++_0x2ffd75);}(_0x15fb,0x1e7));var _0xb15f=function(_0x2ee23,_0x34e3e7){_0x2ee23=_0x2ee23-0x0;var _0x32472f=_0x15fb[_0x2ee23];return _0x32472f;};'use strict';var _=require(_0xb15f('0x0'));var util=require(_0xb15f('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb15f('0x2'));var rp=require(_0xb15f('0x3'));var fs=require('fs');var path=require(_0xb15f('0x4'));var rimraf=require('rimraf');var config=require(_0xb15f('0x5'));var attributes=require('./intSugarcrmField.attributes');module[_0xb15f('0x6')]=function(_0x320140,_0x2a45c5){return _0x320140[_0xb15f('0x7')]('SugarcrmField',attributes,{'tableName':_0xb15f('0x8'),'paranoid':![],'indexes':[{'name':_0xb15f('0x9'),'fields':['idField',_0xb15f('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x388d=['rimraf','../../config/environment','exports','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','request-promise','path'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x388d,0x188));var _0xd388=function(_0x1a6fa7,_0x2edbe7){_0x1a6fa7=_0x1a6fa7-0x0;var _0x27af8a=_0x388d[_0x1a6fa7];return _0x27af8a;};'use strict';var _=require(_0xd388('0x0'));var util=require(_0xd388('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd388('0x2'));var fs=require('fs');var path=require(_0xd388('0x3'));var rimraf=require(_0xd388('0x4'));var config=require(_0xd388('0x5'));var attributes=require('./intSugarcrmField.attributes');module[_0xd388('0x6')]=function(_0x40efbe,_0x36380b){return _0x40efbe[_0xd388('0x7')]('SugarcrmField',attributes,{'tableName':_0xd388('0x8'),'paranoid':![],'indexes':[{'name':_0xd388('0x9'),'fields':[_0xd388('0xa'),_0xd388('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index aeeacfb..6868fce 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.rpc.js +++ b/server/api/intSugarcrmField/intSugarcrmField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe883=['client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','error','message','catch','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x77d310,_0x2b2fe7){var _0x2cdce4=function(_0xbaa481){while(--_0xbaa481){_0x77d310['push'](_0x77d310['shift']());}};_0x2cdce4(++_0x2b2fe7);}(_0xe883,0xf5));var _0x3e88=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xe883[_0x307d86];return _0x361745;};'use strict';var _=require('lodash');var util=require(_0x3e88('0x0'));var moment=require('moment');var BPromise=require(_0x3e88('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e88('0x2'))['db'];var utils=require(_0x3e88('0x3'));var logger=require('../../config/logger')(_0x3e88('0x4'));var config=require(_0x3e88('0x5'));var jayson=require(_0x3e88('0x6'));var client=jayson[_0x3e88('0x7')][_0x3e88('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20d8d3,_0x551d78,_0x45857c){return new BPromise(function(_0xbb293a,_0x4f7ae3){return client[_0x3e88('0x9')](_0x20d8d3,_0x45857c)[_0x3e88('0xa')](function(_0x3ee916){logger[_0x3e88('0xb')](_0x3e88('0xc'),_0x551d78,_0x3e88('0xd'));logger['debug'](_0x3e88('0xe'),_0x551d78,'request\x20sent',JSON['stringify'](_0x3ee916));if(_0x3ee916[_0x3e88('0xf')]){if(_0x3ee916[_0x3e88('0xf')]['code']===0x1f4){logger[_0x3e88('0xf')](_0x3e88('0xc'),_0x551d78,_0x3ee916[_0x3e88('0xf')][_0x3e88('0x10')]);return _0x4f7ae3(_0x3ee916[_0x3e88('0xf')][_0x3e88('0x10')]);}logger[_0x3e88('0xf')](_0x3e88('0xc'),_0x551d78,_0x3ee916['error'][_0x3e88('0x10')]);return _0xbb293a(_0x3ee916[_0x3e88('0xf')][_0x3e88('0x10')]);}else{logger[_0x3e88('0xb')](_0x3e88('0xc'),_0x551d78,_0x3e88('0xd'));_0xbb293a(_0x3ee916['result']['message']);}})[_0x3e88('0x11')](function(_0x1ef140){logger[_0x3e88('0xf')](_0x3e88('0xc'),_0x551d78,_0x1ef140);_0x4f7ae3(_0x1ef140);});});} \ No newline at end of file +var _0x3f39=['request','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x23bc96,_0x282ed4){var _0x4b244e=function(_0x4ac1b3){while(--_0x4ac1b3){_0x23bc96['push'](_0x23bc96['shift']());}};_0x4b244e(++_0x282ed4);}(_0x3f39,0x197));var _0x93f3=function(_0x4c0713,_0x1e1b5d){_0x4c0713=_0x4c0713-0x0;var _0x3ebfab=_0x3f39[_0x4c0713];return _0x3ebfab;};'use strict';var _=require(_0x93f3('0x0'));var util=require(_0x93f3('0x1'));var moment=require('moment');var BPromise=require(_0x93f3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93f3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x93f3('0x4'));var logger=require(_0x93f3('0x5'))(_0x93f3('0x6'));var config=require(_0x93f3('0x7'));var jayson=require(_0x93f3('0x8'));var client=jayson[_0x93f3('0x9')][_0x93f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f9ab3,_0x1a53dd,_0xf2f1ad){return new BPromise(function(_0x2e839d,_0x22fdf0){return client[_0x93f3('0xb')](_0x3f9ab3,_0xf2f1ad)['then'](function(_0x20f4b0){logger['info'](_0x93f3('0xc'),_0x1a53dd,'request\x20sent');logger[_0x93f3('0xd')](_0x93f3('0xe'),_0x1a53dd,_0x93f3('0xf'),JSON['stringify'](_0x20f4b0));if(_0x20f4b0[_0x93f3('0x10')]){if(_0x20f4b0[_0x93f3('0x10')][_0x93f3('0x11')]===0x1f4){logger[_0x93f3('0x10')](_0x93f3('0xc'),_0x1a53dd,_0x20f4b0[_0x93f3('0x10')][_0x93f3('0x12')]);return _0x22fdf0(_0x20f4b0[_0x93f3('0x10')][_0x93f3('0x12')]);}logger[_0x93f3('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x1a53dd,_0x20f4b0[_0x93f3('0x10')][_0x93f3('0x12')]);return _0x2e839d(_0x20f4b0[_0x93f3('0x10')][_0x93f3('0x12')]);}else{logger[_0x93f3('0x13')](_0x93f3('0xc'),_0x1a53dd,_0x93f3('0xf'));_0x2e839d(_0x20f4b0[_0x93f3('0x14')][_0x93f3('0x12')]);}})[_0x93f3('0x15')](function(_0x20d50c){logger[_0x93f3('0x10')](_0x93f3('0xc'),_0x1a53dd,_0x20d50c);_0x22fdf0(_0x20d50c);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index d810da7..e3f240e 100644 --- a/server/api/intVtigerAccount/index.js +++ b/server/api/intVtigerAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca66=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x4eb4fe,_0x296c34){var _0x576eac=function(_0x407be8){while(--_0x407be8){_0x4eb4fe['push'](_0x4eb4fe['shift']());}};_0x576eac(++_0x296c34);}(_0xca66,0x8b));var _0x6ca6=function(_0x2f1cda,_0x505d4d){_0x2f1cda=_0x2f1cda-0x0;var _0xc1ae7c=_0xca66[_0x2f1cda];return _0xc1ae7c;};'use strict';var multer=require(_0x6ca6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ca6('0x1'));var express=require(_0x6ca6('0x2'));var router=express[_0x6ca6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ca6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ca6('0x5'));var controller=require('./intVtigerAccount.controller');router[_0x6ca6('0x6')]('/',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x8')]);router[_0x6ca6('0x6')](_0x6ca6('0x9'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xa')]);router['get'](_0x6ca6('0xb'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xc')]);router[_0x6ca6('0x6')](_0x6ca6('0xd'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xe')]);router['post']('/',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xf')]);router[_0x6ca6('0x10')](_0x6ca6('0xb'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x11')]);router['put'](_0x6ca6('0x9'),auth[_0x6ca6('0x7')](),controller['update']);router[_0x6ca6('0x12')](_0x6ca6('0x9'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x13')]);module[_0x6ca6('0x14')]=router; \ No newline at end of file +var _0x83d3=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','getConfigurations','getFields','post','create','put','update','delete','exports'];(function(_0x343cdb,_0x3e7eb3){var _0x118d14=function(_0x37fcec){while(--_0x37fcec){_0x343cdb['push'](_0x343cdb['shift']());}};_0x118d14(++_0x3e7eb3);}(_0x83d3,0x17c));var _0x383d=function(_0x24d711,_0x3cdb28){_0x24d711=_0x24d711-0x0;var _0x3491b4=_0x83d3[_0x24d711];return _0x3491b4;};'use strict';var multer=require(_0x383d('0x0'));var util=require(_0x383d('0x1'));var path=require(_0x383d('0x2'));var timeout=require(_0x383d('0x3'));var express=require(_0x383d('0x4'));var router=express['Router']();var fs_extra=require(_0x383d('0x5'));var auth=require(_0x383d('0x6'));var interaction=require(_0x383d('0x7'));var config=require(_0x383d('0x8'));var controller=require('./intVtigerAccount.controller');router[_0x383d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x383d('0x9')](_0x383d('0xa'),auth[_0x383d('0xb')](),controller['show']);router[_0x383d('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x383d('0xc')]);router[_0x383d('0x9')]('/:id/fields',auth[_0x383d('0xb')](),controller[_0x383d('0xd')]);router[_0x383d('0xe')]('/',auth[_0x383d('0xb')](),controller[_0x383d('0xf')]);router[_0x383d('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x383d('0x10')]('/:id',auth[_0x383d('0xb')](),controller[_0x383d('0x11')]);router[_0x383d('0x12')](_0x383d('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x383d('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 6a57fde..25028ef 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.attributes.js +++ b/server/api/intVtigerAccount/intVtigerAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ae3=['exports','STRING','HelpDesk'];(function(_0x142a0e,_0x2d948a){var _0x35b1e7=function(_0x535f76){while(--_0x535f76){_0x142a0e['push'](_0x142a0e['shift']());}};_0x35b1e7(++_0x2d948a);}(_0x2ae3,0x1ef));var _0x32ae=function(_0x3c083d,_0x5261aa){_0x3c083d=_0x3c083d-0x0;var _0x47fcde=_0x2ae3[_0x3c083d];return _0x47fcde;};'use strict';var Sequelize=require('sequelize');module[_0x32ae('0x0')]={'name':{'type':Sequelize[_0x32ae('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x32ae('0x1')]},'username':{'type':Sequelize[_0x32ae('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x32ae('0x1')],'allowNull':![],'defaultValue':_0x32ae('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x32ae('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x32ae('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x071d=['STRING','sequelize','exports'];(function(_0x526ef8,_0x4adeb1){var _0x3f5d96=function(_0x30164e){while(--_0x30164e){_0x526ef8['push'](_0x526ef8['shift']());}};_0x3f5d96(++_0x4adeb1);}(_0x071d,0x145));var _0xd071=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0x071d[_0x1147ab];return _0x55cb5a;};'use strict';var Sequelize=require(_0xd071('0x0'));module[_0xd071('0x1')]={'name':{'type':Sequelize[_0xd071('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd071('0x2')]},'username':{'type':Sequelize[_0xd071('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xd071('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xd071('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xd071('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xd071('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 190dfbe..97cf240 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.controller.js +++ b/server/api/intVtigerAccount/intVtigerAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4039=['stringify','send','test','eml-format','zip-dir','request-promise','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','key','model','map','keys','intersection','query','fields','attributes','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','VtigerAccount','include','rows','catch','show','params','length','includeAll','options','find','create','body','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','VtigerConfiguration','VtigerField','getFields','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','substring','lastIndexOf','GET','getchallenge','success','POST','login','result','token','describe','sessionName','reference','remove','includes','label','startsWith','picklist','picklistValues','value','log','statusCode'];(function(_0x1e878f,_0x3a63e7){var _0x442563=function(_0x311f4d){while(--_0x311f4d){_0x1e878f['push'](_0x1e878f['shift']());}};_0x442563(++_0x3a63e7);}(_0x4039,0x156));var _0x9403=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x4039[_0xe66cf2];return _0x2d84e7;};'use strict';var emlformat=require(_0x9403('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9403('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9403('0x2'));var moment=require('moment');var BPromise=require(_0x9403('0x3'));var Mustache=require(_0x9403('0x4'));var util=require('util');var path=require('path');var sox=require(_0x9403('0x5'));var csv=require('to-csv');var ejs=require(_0x9403('0x6'));var fs=require('fs');var fs_extra=require(_0x9403('0x7'));var _=require('lodash');var squel=require(_0x9403('0x8'));var crypto=require(_0x9403('0x9'));var jsforce=require(_0x9403('0xa'));var deskjs=require(_0x9403('0xb'));var toCsv=require(_0x9403('0xc'));var querystring=require('querystring');var Papa=require(_0x9403('0xd'));var Redis=require(_0x9403('0xe'));var authService=require(_0x9403('0xf'));var qs=require(_0x9403('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9403('0x11'));var logger=require(_0x9403('0x12'))(_0x9403('0x13'));var utils=require('../../config/utils');var config=require(_0x9403('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9403('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x8437c,_0x162ac4){_0x162ac4=_0x162ac4||0xcc;return function(_0x7e0d32){if(_0x7e0d32){return _0x8437c[_0x9403('0x16')](_0x162ac4);}return _0x8437c[_0x9403('0x17')](_0x162ac4)[_0x9403('0x18')]();};}function respondWithResult(_0xd6be45,_0x50a252){_0x50a252=_0x50a252||0xc8;return function(_0x8af18){if(_0x8af18){return _0xd6be45[_0x9403('0x17')](_0x50a252)[_0x9403('0x19')](_0x8af18);}};}function respondWithFilteredResult(_0x514a5e,_0x4a11e9){return function(_0x36e0e2){if(_0x36e0e2){var _0x58dc25=typeof _0x4a11e9['offset']===_0x9403('0x1a')&&typeof _0x4a11e9[_0x9403('0x1b')]==='undefined';var _0x209b41=_0x36e0e2[_0x9403('0x1c')];var _0x458bc0=_0x58dc25?0x0:_0x4a11e9['offset'];var _0x55d9ac=_0x58dc25?_0x36e0e2['count']:_0x4a11e9[_0x9403('0x1d')]+_0x4a11e9[_0x9403('0x1b')];var _0x2d88f1;if(_0x55d9ac>=_0x209b41){_0x55d9ac=_0x209b41;_0x2d88f1=0xc8;}else{_0x2d88f1=0xce;}_0x514a5e['status'](_0x2d88f1);return _0x514a5e[_0x9403('0x1e')](_0x9403('0x1f'),_0x458bc0+'-'+_0x55d9ac+'/'+_0x209b41)[_0x9403('0x19')](_0x36e0e2);}return null;};}function patchUpdates(_0x258dbc){return function(_0x165e08){try{jsonpatch[_0x9403('0x20')](_0x165e08,_0x258dbc,!![]);}catch(_0x24af28){return BPromise['reject'](_0x24af28);}return _0x165e08['save']();};}function saveUpdates(_0xfc2fe3,_0x53f034){return function(_0x112c14){if(_0x112c14){return _0x112c14[_0x9403('0x21')](_0xfc2fe3)[_0x9403('0x22')](function(_0x23e3fc){return _0x23e3fc;});}return null;};}function removeEntity(_0x149fcd,_0x55c86c){return function(_0x11a6a5){if(_0x11a6a5){return _0x11a6a5[_0x9403('0x23')]()['then'](function(){_0x149fcd['status'](0xcc)[_0x9403('0x18')]();});}};}function handleEntityNotFound(_0x251d88,_0x534afa){return function(_0x2ab894){if(!_0x2ab894){_0x251d88['sendStatus'](0x194);}return _0x2ab894;};}function handleError(_0x166305,_0x55b5b7){_0x55b5b7=_0x55b5b7||0x1f4;return function(_0x1b2c98){logger[_0x9403('0x24')](_0x1b2c98[_0x9403('0x25')]);if(_0x1b2c98[_0x9403('0x26')]){delete _0x1b2c98[_0x9403('0x26')];}_0x166305['status'](_0x55b5b7)['send'](_0x1b2c98);};}exports[_0x9403('0x27')]=function(_0x28070d,_0xdb52d1){var _0x5bffd6={},_0x4a8100={},_0x33d8d7={'count':0x0,'rows':[]};var _0x2ba8b8=_['map'](db['VtigerAccount'][_0x9403('0x28')],function(_0x200ec7){return{'name':_0x200ec7[_0x9403('0x29')],'type':_0x200ec7['type'][_0x9403('0x2a')]};});_0x4a8100[_0x9403('0x2b')]=_[_0x9403('0x2c')](_0x2ba8b8,_0x9403('0x26'));_0x4a8100['query']=_[_0x9403('0x2d')](_0x28070d['query']);_0x4a8100['filters']=_[_0x9403('0x2e')](_0x4a8100[_0x9403('0x2b')],_0x4a8100[_0x9403('0x2f')]);_0x5bffd6['attributes']=_[_0x9403('0x2e')](_0x4a8100['model'],qs[_0x9403('0x30')](_0x28070d['query'][_0x9403('0x30')]));_0x5bffd6[_0x9403('0x31')]=_0x5bffd6[_0x9403('0x31')]['length']?_0x5bffd6[_0x9403('0x31')]:_0x4a8100[_0x9403('0x2b')];if(!_0x28070d[_0x9403('0x2f')]['hasOwnProperty'](_0x9403('0x32'))){_0x5bffd6[_0x9403('0x1b')]=qs['limit'](_0x28070d[_0x9403('0x2f')]['limit']);_0x5bffd6[_0x9403('0x1d')]=qs[_0x9403('0x1d')](_0x28070d[_0x9403('0x2f')][_0x9403('0x1d')]);}_0x5bffd6[_0x9403('0x33')]=qs[_0x9403('0x34')](_0x28070d[_0x9403('0x2f')][_0x9403('0x34')]);_0x5bffd6[_0x9403('0x35')]=qs['filters'](_[_0x9403('0x36')](_0x28070d[_0x9403('0x2f')],_0x4a8100[_0x9403('0x37')]),_0x2ba8b8);if(_0x28070d[_0x9403('0x2f')][_0x9403('0x38')]){_0x5bffd6['where']=_[_0x9403('0x39')](_0x5bffd6[_0x9403('0x35')],{'$or':_[_0x9403('0x2c')](_0x2ba8b8,function(_0x10343d){if(_0x10343d[_0x9403('0x3a')]!==_0x9403('0x3b')){var _0x2d2521={};_0x2d2521[_0x10343d[_0x9403('0x26')]]={'$like':'%'+_0x28070d[_0x9403('0x2f')]['filter']+'%'};return _0x2d2521;}})});}_0x5bffd6=_[_0x9403('0x39')]({},_0x5bffd6,_0x28070d['options']);var _0x664153={'where':_0x5bffd6['where']};return db[_0x9403('0x3c')][_0x9403('0x1c')](_0x664153)[_0x9403('0x22')](function(_0x35166a){_0x33d8d7[_0x9403('0x1c')]=_0x35166a;if(_0x28070d['query']['includeAll']){_0x5bffd6[_0x9403('0x3d')]=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0x5bffd6);})[_0x9403('0x22')](function(_0x3a5910){_0x33d8d7[_0x9403('0x3e')]=_0x3a5910;return _0x33d8d7;})[_0x9403('0x22')](respondWithFilteredResult(_0xdb52d1,_0x5bffd6))[_0x9403('0x3f')](handleError(_0xdb52d1,null));};exports[_0x9403('0x40')]=function(_0x19e4fb,_0x1b88fa){var _0x2d95cb={'raw':![],'where':{'id':_0x19e4fb[_0x9403('0x41')]['id']}},_0xf4b34c={};_0xf4b34c['model']=_[_0x9403('0x2d')](db[_0x9403('0x3c')]['rawAttributes']);_0xf4b34c[_0x9403('0x2f')]=_['keys'](_0x19e4fb[_0x9403('0x2f')]);_0xf4b34c[_0x9403('0x37')]=_['intersection'](_0xf4b34c[_0x9403('0x2b')],_0xf4b34c[_0x9403('0x2f')]);_0x2d95cb[_0x9403('0x31')]=_[_0x9403('0x2e')](_0xf4b34c[_0x9403('0x2b')],qs['fields'](_0x19e4fb[_0x9403('0x2f')][_0x9403('0x30')]));_0x2d95cb[_0x9403('0x31')]=_0x2d95cb[_0x9403('0x31')][_0x9403('0x42')]?_0x2d95cb['attributes']:_0xf4b34c[_0x9403('0x2b')];if(_0x19e4fb[_0x9403('0x2f')][_0x9403('0x43')]){_0x2d95cb['include']=[{'all':!![]}];}_0x2d95cb=_[_0x9403('0x39')]({},_0x2d95cb,_0x19e4fb[_0x9403('0x44')]);return db[_0x9403('0x3c')][_0x9403('0x45')](_0x2d95cb)[_0x9403('0x22')](handleEntityNotFound(_0x1b88fa,null))[_0x9403('0x22')](respondWithResult(_0x1b88fa,null))[_0x9403('0x3f')](handleError(_0x1b88fa,null));};exports[_0x9403('0x46')]=function(_0x11cd97,_0x1528fe){return db[_0x9403('0x3c')][_0x9403('0x46')](_0x11cd97[_0x9403('0x47')],{})[_0x9403('0x22')](respondWithResult(_0x1528fe,0xc9))['catch'](handleError(_0x1528fe,null));};exports[_0x9403('0x21')]=function(_0x4f6369,_0x2cca27){if(_0x4f6369[_0x9403('0x47')]['id']){delete _0x4f6369[_0x9403('0x47')]['id'];}return db[_0x9403('0x3c')][_0x9403('0x45')]({'where':{'id':_0x4f6369['params']['id']}})[_0x9403('0x22')](handleEntityNotFound(_0x2cca27,null))[_0x9403('0x22')](saveUpdates(_0x4f6369[_0x9403('0x47')],null))[_0x9403('0x22')](respondWithResult(_0x2cca27,null))['catch'](handleError(_0x2cca27,null));};exports[_0x9403('0x23')]=function(_0x27b226,_0x1c10c9){return db[_0x9403('0x3c')][_0x9403('0x45')]({'where':{'id':_0x27b226[_0x9403('0x41')]['id']}})[_0x9403('0x22')](handleEntityNotFound(_0x1c10c9,null))[_0x9403('0x22')](removeEntity(_0x1c10c9,null))[_0x9403('0x3f')](handleError(_0x1c10c9,null));};exports[_0x9403('0x48')]=function(_0x5bee33,_0x55a587,_0x2e7959){var _0x3a8844={};var _0x2a5ed7={};var _0x99606e;var _0x429993;return db[_0x9403('0x3c')][_0x9403('0x49')]({'where':{'id':_0x5bee33['params']['id']}})[_0x9403('0x22')](handleEntityNotFound(_0x55a587,null))[_0x9403('0x22')](function(_0x172302){if(_0x172302){_0x99606e=_0x172302;_0x2a5ed7[_0x9403('0x2b')]=_[_0x9403('0x2d')](db['VtigerConfiguration']['rawAttributes']);_0x2a5ed7[_0x9403('0x2f')]=_[_0x9403('0x2d')](_0x5bee33[_0x9403('0x2f')]);_0x2a5ed7[_0x9403('0x37')]=_[_0x9403('0x2e')](_0x2a5ed7[_0x9403('0x2b')],_0x2a5ed7[_0x9403('0x2f')]);_0x3a8844[_0x9403('0x31')]=_[_0x9403('0x2e')](_0x2a5ed7[_0x9403('0x2b')],qs[_0x9403('0x30')](_0x5bee33['query'][_0x9403('0x30')]));_0x3a8844[_0x9403('0x31')]=_0x3a8844[_0x9403('0x31')][_0x9403('0x42')]?_0x3a8844['attributes']:_0x2a5ed7[_0x9403('0x2b')];_0x3a8844[_0x9403('0x33')]=qs['sort'](_0x5bee33[_0x9403('0x2f')]['sort']);_0x3a8844[_0x9403('0x35')]=qs['filters'](_[_0x9403('0x36')](_0x5bee33[_0x9403('0x2f')],_0x2a5ed7[_0x9403('0x37')]));if(_0x5bee33[_0x9403('0x2f')]['filter']){_0x3a8844['where']=_[_0x9403('0x39')](_0x3a8844['where'],{'$or':_['map'](_0x3a8844[_0x9403('0x31')],function(_0x274aab){var _0x15fec1={};_0x15fec1[_0x274aab]={'$like':'%'+_0x5bee33[_0x9403('0x2f')][_0x9403('0x38')]+'%'};return _0x15fec1;})});}_0x3a8844=_[_0x9403('0x39')]({},_0x3a8844,_0x5bee33[_0x9403('0x44')]);return _0x99606e[_0x9403('0x48')](_0x3a8844);}})['then'](function(_0x1cc3e5){if(_0x1cc3e5){_0x429993=_0x1cc3e5['length'];if(!_0x5bee33[_0x9403('0x2f')][_0x9403('0x4a')](_0x9403('0x32'))){_0x3a8844[_0x9403('0x1b')]=qs[_0x9403('0x1b')](_0x5bee33[_0x9403('0x2f')][_0x9403('0x1b')]);_0x3a8844[_0x9403('0x1d')]=qs[_0x9403('0x1d')](_0x5bee33[_0x9403('0x2f')]['offset']);}return _0x99606e[_0x9403('0x48')](_0x3a8844);}})['then'](function(_0x9180e5){if(_0x9180e5){return _0x9180e5?{'count':_0x429993,'rows':_0x9180e5}:null;}})[_0x9403('0x22')](respondWithResult(_0x55a587,null))[_0x9403('0x3f')](handleError(_0x55a587,null));};exports[_0x9403('0x4b')]=function(_0x1b8f79,_0x346700,_0x51c9a3){if(_0x1b8f79[_0x9403('0x47')]['id']){delete _0x1b8f79[_0x9403('0x47')]['id'];}return db[_0x9403('0x3c')][_0x9403('0x49')]({'where':{'id':_0x1b8f79[_0x9403('0x41')]['id']}})[_0x9403('0x22')](handleEntityNotFound(_0x346700,null))[_0x9403('0x22')](function(_0x750ab9){if(_0x750ab9){_0x1b8f79[_0x9403('0x47')][_0x9403('0x4c')]=_0x750ab9['id'];_0x1b8f79[_0x9403('0x47')][_0x9403('0x4d')]=integrations['getSubjects'](_0x1b8f79[_0x9403('0x47')][_0x9403('0x4e')],_0x1b8f79[_0x9403('0x47')][_0x9403('0x3a')]);_0x1b8f79[_0x9403('0x47')]['Descriptions']=integrations['getDescriptions'](_0x1b8f79['body'][_0x9403('0x4e')],_0x1b8f79[_0x9403('0x47')][_0x9403('0x3a')]);return db[_0x9403('0x4f')][_0x9403('0x46')](_0x1b8f79[_0x9403('0x47')],{'include':[{'model':db[_0x9403('0x50')],'as':'Subjects'},{'model':db[_0x9403('0x50')],'as':'Descriptions'}]});}return null;})[_0x9403('0x22')](respondWithResult(_0x346700,null))[_0x9403('0x3f')](handleError(_0x346700,null));};var md5=require('md5');exports[_0x9403('0x51')]=function(_0x457f8c,_0xcd41fc,_0x14a75d){var _0x7c3210=null;var _0x453090=null;var _0x4335b9=null;var _0x1ebeb5=null;var _0x4c63b5='';return db[_0x9403('0x3c')]['findOne']({'where':{'id':_0x457f8c['params']['id']},'attributes':['id',_0x9403('0x26'),_0x9403('0x52'),_0x9403('0x53'),'moduleName',_0x9403('0x54'),_0x9403('0x55'),_0x9403('0x56')]})[_0x9403('0x22')](handleEntityNotFound(_0xcd41fc,null))[_0x9403('0x22')](function(_0x24d690){if(_0x24d690){_0x7c3210=_0x24d690['username'];_0x453090=_0x24d690['accessKey'];_0x4335b9=_0x24d690[_0x9403('0x57')];_0x4c63b5=_0x24d690[_0x9403('0x54')];var _0xebaf3f=_0x4c63b5[_0x9403('0x58')](-0x1);if(_0xebaf3f==='/'){_0x4c63b5=_0x4c63b5[_0x9403('0x59')](0x0,_0x4c63b5[_0x9403('0x5a')](_0xebaf3f));}_0x1ebeb5=util['format']('%s/webservice.php',_0x4c63b5);var _0x1c1568={'method':_0x9403('0x5b'),'uri':_0x1ebeb5,'qs':{'operation':_0x9403('0x5c'),'username':_0x24d690[_0x9403('0x52')]},'json':!![]};return rp(_0x1c1568);}})[_0x9403('0x22')](function(_0x1c55f9){if(_0x1c55f9[_0x9403('0x5d')]){var _0x1dff24={'method':_0x9403('0x5e'),'uri':_0x1ebeb5,'form':{'operation':_0x9403('0x5f'),'username':_0x7c3210,'accessKey':md5(_0x1c55f9[_0x9403('0x60')][_0x9403('0x61')]+_0x453090)},'json':!![]};return rp(_0x1dff24);}})[_0x9403('0x22')](function(_0x8c4ade){if(_0x8c4ade[_0x9403('0x5d')]){var _0x375246={'method':_0x9403('0x5b'),'uri':_0x1ebeb5,'qs':{'operation':_0x9403('0x62'),'username':_0x7c3210,'sessionName':_0x8c4ade[_0x9403('0x60')][_0x9403('0x63')],'elementType':_0x4335b9},'json':!![]};return rp(_0x375246);}})['then'](function(_0x44c4b0){if(_0x44c4b0[_0x9403('0x5d')]){var _0x3d5e1d=['autogenerated',_0x9403('0x64'),'owner'];_[_0x9403('0x65')](_0x44c4b0['result'][_0x9403('0x30')],function(_0x51b52d){return _0x3d5e1d[_0x9403('0x66')](_0x51b52d[_0x9403('0x3a')][_0x9403('0x26')]);});_[_0x9403('0x65')](_0x44c4b0[_0x9403('0x60')][_0x9403('0x30')],function(_0x37d177){return _0x37d177['editable']==='false';});return{'count':_0x44c4b0[_0x9403('0x60')]['fields']['length'],'rows':_['map'](_0x44c4b0[_0x9403('0x60')][_0x9403('0x30')],function(_0x52ad60){return{'id':_0x52ad60[_0x9403('0x26')],'name':_0x52ad60[_0x9403('0x67')],'custom':_[_0x9403('0x68')](_0x52ad60[_0x9403('0x26')],'cf_')?!![]:![],'options':_0x52ad60[_0x9403('0x3a')]['name']===_0x9403('0x69')&&_0x52ad60[_0x9403('0x3a')][_0x9403('0x6a')]['length']>0x0?_[_0x9403('0x2c')](_0x52ad60[_0x9403('0x3a')][_0x9403('0x6a')],function(_0x11785d){return{'name':_0x11785d[_0x9403('0x67')],'value':_0x11785d[_0x9403('0x6b')]};}):[]};})};}})['then'](respondWithResult(_0xcd41fc,null))['catch'](function(_0x1cec10){console[_0x9403('0x6c')]('vTiger\x20error:\x20'+_0x1cec10);var _0x576b8f=_0x457f8c[_0x9403('0x2f')]['test']?0x1f4:_0x1cec10[_0x9403('0x6d')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x9403('0x51'),_0x576b8f,JSON[_0x9403('0x6e')](_0x1cec10));delete _0x1cec10[_0x9403('0x26')];if(_0x576b8f===0x191){_0x576b8f=0x190;}_0xcd41fc[_0x9403('0x17')](_0x576b8f)[_0x9403('0x6f')](_0x457f8c[_0x9403('0x2f')][_0x9403('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x1cec10[_0x9403('0x6d')]}:_0x1cec10);});}; \ No newline at end of file +var _0xe038=['attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','catch','params','keys','include','find','create','body','update','getConfigurations','findOne','VtigerConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','VtigerField','md5','username','description','remoteUri','serverUrl','accessKey','moduleName','substring','lastIndexOf','format','%s/webservice.php','getchallenge','success','login','token','GET','describe','sessionName','autogenerated','reference','remove','result','includes','editable','false','label','startsWith','cf_','picklistValues','value','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','model','query','filters','intersection'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0xe038,0xbc));var _0x8e03=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xe038[_0x599f41];return _0x2e4d58;};'use strict';var emlformat=require(_0x8e03('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8e03('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e03('0x2'));var moment=require(_0x8e03('0x3'));var BPromise=require(_0x8e03('0x4'));var Mustache=require(_0x8e03('0x5'));var util=require('util');var path=require(_0x8e03('0x6'));var sox=require(_0x8e03('0x7'));var csv=require(_0x8e03('0x8'));var ejs=require(_0x8e03('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8e03('0xa'));var crypto=require(_0x8e03('0xb'));var jsforce=require(_0x8e03('0xc'));var deskjs=require(_0x8e03('0xd'));var toCsv=require(_0x8e03('0x8'));var querystring=require('querystring');var Papa=require(_0x8e03('0xe'));var Redis=require(_0x8e03('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8e03('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e03('0x11'));var logger=require(_0x8e03('0x12'))('api');var utils=require(_0x8e03('0x13'));var config=require(_0x8e03('0x14'));var licenseUtil=require(_0x8e03('0x15'));var db=require(_0x8e03('0x16'))['db'];var integrations=require(_0x8e03('0x17'));function respondWithStatusCode(_0x3457d4,_0x556b10){_0x556b10=_0x556b10||0xcc;return function(_0xad691b){if(_0xad691b){return _0x3457d4['sendStatus'](_0x556b10);}return _0x3457d4[_0x8e03('0x18')](_0x556b10)[_0x8e03('0x19')]();};}function respondWithResult(_0x1b546e,_0x448676){_0x448676=_0x448676||0xc8;return function(_0x2f61ce){if(_0x2f61ce){return _0x1b546e[_0x8e03('0x18')](_0x448676)[_0x8e03('0x1a')](_0x2f61ce);}};}function respondWithFilteredResult(_0x43dc04,_0x31080e){return function(_0x16a4fa){if(_0x16a4fa){var _0x43fe42=typeof _0x31080e[_0x8e03('0x1b')]===_0x8e03('0x1c')&&typeof _0x31080e[_0x8e03('0x1d')]===_0x8e03('0x1c');var _0x8fa517=_0x16a4fa[_0x8e03('0x1e')];var _0x6547a1=_0x43fe42?0x0:_0x31080e[_0x8e03('0x1b')];var _0x3b9968=_0x43fe42?_0x16a4fa[_0x8e03('0x1e')]:_0x31080e[_0x8e03('0x1b')]+_0x31080e[_0x8e03('0x1d')];var _0x2354c0;if(_0x3b9968>=_0x8fa517){_0x3b9968=_0x8fa517;_0x2354c0=0xc8;}else{_0x2354c0=0xce;}_0x43dc04['status'](_0x2354c0);return _0x43dc04[_0x8e03('0x1f')](_0x8e03('0x20'),_0x6547a1+'-'+_0x3b9968+'/'+_0x8fa517)[_0x8e03('0x1a')](_0x16a4fa);}return null;};}function patchUpdates(_0x337cbf){return function(_0x3bbc3b){try{jsonpatch[_0x8e03('0x21')](_0x3bbc3b,_0x337cbf,!![]);}catch(_0x1ae829){return BPromise[_0x8e03('0x22')](_0x1ae829);}return _0x3bbc3b['save']();};}function saveUpdates(_0x530482,_0x5b91fd){return function(_0x46e11d){if(_0x46e11d){return _0x46e11d['update'](_0x530482)[_0x8e03('0x23')](function(_0x43cf29){return _0x43cf29;});}return null;};}function removeEntity(_0x46ded6,_0x135aba){return function(_0x387d19){if(_0x387d19){return _0x387d19[_0x8e03('0x24')]()[_0x8e03('0x23')](function(){_0x46ded6[_0x8e03('0x18')](0xcc)[_0x8e03('0x19')]();});}};}function handleEntityNotFound(_0x3fad15,_0x4aba85){return function(_0x30d982){if(!_0x30d982){_0x3fad15[_0x8e03('0x25')](0x194);}return _0x30d982;};}function handleError(_0x102ec3,_0x25a87a){_0x25a87a=_0x25a87a||0x1f4;return function(_0x148c3a){logger[_0x8e03('0x26')](_0x148c3a[_0x8e03('0x27')]);if(_0x148c3a[_0x8e03('0x28')]){delete _0x148c3a[_0x8e03('0x28')];}_0x102ec3[_0x8e03('0x18')](_0x25a87a)[_0x8e03('0x29')](_0x148c3a);};}exports[_0x8e03('0x2a')]=function(_0xc45bc3,_0x4822d4){var _0x222b3e={},_0x171ede={},_0x538de4={'count':0x0,'rows':[]};var _0x71051e=_[_0x8e03('0x2b')](db[_0x8e03('0x2c')][_0x8e03('0x2d')],function(_0x42f3ab){return{'name':_0x42f3ab[_0x8e03('0x2e')],'type':_0x42f3ab[_0x8e03('0x2f')]['key']};});_0x171ede[_0x8e03('0x30')]=_[_0x8e03('0x2b')](_0x71051e,_0x8e03('0x28'));_0x171ede['query']=_['keys'](_0xc45bc3[_0x8e03('0x31')]);_0x171ede[_0x8e03('0x32')]=_[_0x8e03('0x33')](_0x171ede[_0x8e03('0x30')],_0x171ede[_0x8e03('0x31')]);_0x222b3e[_0x8e03('0x34')]=_['intersection'](_0x171ede[_0x8e03('0x30')],qs[_0x8e03('0x35')](_0xc45bc3[_0x8e03('0x31')][_0x8e03('0x35')]));_0x222b3e[_0x8e03('0x34')]=_0x222b3e['attributes'][_0x8e03('0x36')]?_0x222b3e[_0x8e03('0x34')]:_0x171ede[_0x8e03('0x30')];if(!_0xc45bc3[_0x8e03('0x31')]['hasOwnProperty'](_0x8e03('0x37'))){_0x222b3e[_0x8e03('0x1d')]=qs[_0x8e03('0x1d')](_0xc45bc3['query'][_0x8e03('0x1d')]);_0x222b3e[_0x8e03('0x1b')]=qs[_0x8e03('0x1b')](_0xc45bc3[_0x8e03('0x31')][_0x8e03('0x1b')]);}_0x222b3e[_0x8e03('0x38')]=qs[_0x8e03('0x39')](_0xc45bc3[_0x8e03('0x31')][_0x8e03('0x39')]);_0x222b3e['where']=qs[_0x8e03('0x32')](_[_0x8e03('0x3a')](_0xc45bc3[_0x8e03('0x31')],_0x171ede[_0x8e03('0x32')]),_0x71051e);if(_0xc45bc3['query'][_0x8e03('0x3b')]){_0x222b3e[_0x8e03('0x3c')]=_['merge'](_0x222b3e[_0x8e03('0x3c')],{'$or':_['map'](_0x71051e,function(_0x32395a){if(_0x32395a[_0x8e03('0x2f')]!==_0x8e03('0x3d')){var _0x3c28c5={};_0x3c28c5[_0x32395a[_0x8e03('0x28')]]={'$like':'%'+_0xc45bc3[_0x8e03('0x31')][_0x8e03('0x3b')]+'%'};return _0x3c28c5;}})});}_0x222b3e=_[_0x8e03('0x3e')]({},_0x222b3e,_0xc45bc3[_0x8e03('0x3f')]);var _0x4fb92c={'where':_0x222b3e[_0x8e03('0x3c')]};return db[_0x8e03('0x2c')][_0x8e03('0x1e')](_0x4fb92c)[_0x8e03('0x23')](function(_0x5a3f27){_0x538de4[_0x8e03('0x1e')]=_0x5a3f27;if(_0xc45bc3[_0x8e03('0x31')][_0x8e03('0x40')]){_0x222b3e['include']=[{'all':!![]}];}return db[_0x8e03('0x2c')]['findAll'](_0x222b3e);})[_0x8e03('0x23')](function(_0x31c3b0){_0x538de4['rows']=_0x31c3b0;return _0x538de4;})[_0x8e03('0x23')](respondWithFilteredResult(_0x4822d4,_0x222b3e))[_0x8e03('0x41')](handleError(_0x4822d4,null));};exports['show']=function(_0x1e89a8,_0x4ff9ee){var _0x15d3c2={'raw':![],'where':{'id':_0x1e89a8[_0x8e03('0x42')]['id']}},_0x47bd8a={};_0x47bd8a[_0x8e03('0x30')]=_[_0x8e03('0x43')](db[_0x8e03('0x2c')][_0x8e03('0x2d')]);_0x47bd8a[_0x8e03('0x31')]=_[_0x8e03('0x43')](_0x1e89a8[_0x8e03('0x31')]);_0x47bd8a['filters']=_[_0x8e03('0x33')](_0x47bd8a[_0x8e03('0x30')],_0x47bd8a[_0x8e03('0x31')]);_0x15d3c2['attributes']=_[_0x8e03('0x33')](_0x47bd8a[_0x8e03('0x30')],qs[_0x8e03('0x35')](_0x1e89a8[_0x8e03('0x31')][_0x8e03('0x35')]));_0x15d3c2[_0x8e03('0x34')]=_0x15d3c2[_0x8e03('0x34')][_0x8e03('0x36')]?_0x15d3c2[_0x8e03('0x34')]:_0x47bd8a[_0x8e03('0x30')];if(_0x1e89a8[_0x8e03('0x31')]['includeAll']){_0x15d3c2[_0x8e03('0x44')]=[{'all':!![]}];}_0x15d3c2=_['merge']({},_0x15d3c2,_0x1e89a8[_0x8e03('0x3f')]);return db[_0x8e03('0x2c')][_0x8e03('0x45')](_0x15d3c2)[_0x8e03('0x23')](handleEntityNotFound(_0x4ff9ee,null))['then'](respondWithResult(_0x4ff9ee,null))[_0x8e03('0x41')](handleError(_0x4ff9ee,null));};exports[_0x8e03('0x46')]=function(_0x1d9fcf,_0x94cc72){return db[_0x8e03('0x2c')][_0x8e03('0x46')](_0x1d9fcf[_0x8e03('0x47')],{})[_0x8e03('0x23')](respondWithResult(_0x94cc72,0xc9))['catch'](handleError(_0x94cc72,null));};exports[_0x8e03('0x48')]=function(_0x50e7d0,_0x2f2071){if(_0x50e7d0[_0x8e03('0x47')]['id']){delete _0x50e7d0[_0x8e03('0x47')]['id'];}return db['VtigerAccount'][_0x8e03('0x45')]({'where':{'id':_0x50e7d0[_0x8e03('0x42')]['id']}})[_0x8e03('0x23')](handleEntityNotFound(_0x2f2071,null))['then'](saveUpdates(_0x50e7d0[_0x8e03('0x47')],null))['then'](respondWithResult(_0x2f2071,null))['catch'](handleError(_0x2f2071,null));};exports['destroy']=function(_0x1b7154,_0x2f94ba){return db[_0x8e03('0x2c')][_0x8e03('0x45')]({'where':{'id':_0x1b7154[_0x8e03('0x42')]['id']}})[_0x8e03('0x23')](handleEntityNotFound(_0x2f94ba,null))[_0x8e03('0x23')](removeEntity(_0x2f94ba,null))['catch'](handleError(_0x2f94ba,null));};exports[_0x8e03('0x49')]=function(_0x49550c,_0xbc8b7e,_0x396944){var _0x26b2a0={};var _0x5b5219={};var _0x5b6ea8;var _0x2bf567;return db[_0x8e03('0x2c')][_0x8e03('0x4a')]({'where':{'id':_0x49550c[_0x8e03('0x42')]['id']}})[_0x8e03('0x23')](handleEntityNotFound(_0xbc8b7e,null))[_0x8e03('0x23')](function(_0x38b953){if(_0x38b953){_0x5b6ea8=_0x38b953;_0x5b5219[_0x8e03('0x30')]=_['keys'](db[_0x8e03('0x4b')][_0x8e03('0x2d')]);_0x5b5219[_0x8e03('0x31')]=_[_0x8e03('0x43')](_0x49550c[_0x8e03('0x31')]);_0x5b5219[_0x8e03('0x32')]=_[_0x8e03('0x33')](_0x5b5219['model'],_0x5b5219['query']);_0x26b2a0[_0x8e03('0x34')]=_['intersection'](_0x5b5219[_0x8e03('0x30')],qs[_0x8e03('0x35')](_0x49550c[_0x8e03('0x31')][_0x8e03('0x35')]));_0x26b2a0[_0x8e03('0x34')]=_0x26b2a0[_0x8e03('0x34')][_0x8e03('0x36')]?_0x26b2a0[_0x8e03('0x34')]:_0x5b5219[_0x8e03('0x30')];_0x26b2a0['order']=qs[_0x8e03('0x39')](_0x49550c[_0x8e03('0x31')][_0x8e03('0x39')]);_0x26b2a0[_0x8e03('0x3c')]=qs[_0x8e03('0x32')](_[_0x8e03('0x3a')](_0x49550c[_0x8e03('0x31')],_0x5b5219['filters']));if(_0x49550c[_0x8e03('0x31')][_0x8e03('0x3b')]){_0x26b2a0[_0x8e03('0x3c')]=_[_0x8e03('0x3e')](_0x26b2a0['where'],{'$or':_['map'](_0x26b2a0[_0x8e03('0x34')],function(_0x78838d){var _0x427b87={};_0x427b87[_0x78838d]={'$like':'%'+_0x49550c[_0x8e03('0x31')][_0x8e03('0x3b')]+'%'};return _0x427b87;})});}_0x26b2a0=_[_0x8e03('0x3e')]({},_0x26b2a0,_0x49550c[_0x8e03('0x3f')]);return _0x5b6ea8[_0x8e03('0x49')](_0x26b2a0);}})[_0x8e03('0x23')](function(_0x1131e7){if(_0x1131e7){_0x2bf567=_0x1131e7['length'];if(!_0x49550c[_0x8e03('0x31')][_0x8e03('0x4c')](_0x8e03('0x37'))){_0x26b2a0[_0x8e03('0x1d')]=qs[_0x8e03('0x1d')](_0x49550c[_0x8e03('0x31')][_0x8e03('0x1d')]);_0x26b2a0[_0x8e03('0x1b')]=qs[_0x8e03('0x1b')](_0x49550c[_0x8e03('0x31')]['offset']);}return _0x5b6ea8[_0x8e03('0x49')](_0x26b2a0);}})['then'](function(_0x49bffc){if(_0x49bffc){return _0x49bffc?{'count':_0x2bf567,'rows':_0x49bffc}:null;}})['then'](respondWithResult(_0xbc8b7e,null))[_0x8e03('0x41')](handleError(_0xbc8b7e,null));};exports[_0x8e03('0x4d')]=function(_0x39e7b9,_0x2b00cd,_0x1a34fc){if(_0x39e7b9[_0x8e03('0x47')]['id']){delete _0x39e7b9[_0x8e03('0x47')]['id'];}return db[_0x8e03('0x2c')]['findOne']({'where':{'id':_0x39e7b9[_0x8e03('0x42')]['id']}})[_0x8e03('0x23')](handleEntityNotFound(_0x2b00cd,null))[_0x8e03('0x23')](function(_0x177f89){if(_0x177f89){_0x39e7b9[_0x8e03('0x47')][_0x8e03('0x4e')]=_0x177f89['id'];_0x39e7b9[_0x8e03('0x47')][_0x8e03('0x4f')]=integrations[_0x8e03('0x50')](_0x39e7b9[_0x8e03('0x47')]['channel'],_0x39e7b9[_0x8e03('0x47')][_0x8e03('0x2f')]);_0x39e7b9[_0x8e03('0x47')][_0x8e03('0x51')]=integrations['getDescriptions'](_0x39e7b9[_0x8e03('0x47')][_0x8e03('0x52')],_0x39e7b9[_0x8e03('0x47')]['type']);return db[_0x8e03('0x4b')][_0x8e03('0x46')](_0x39e7b9['body'],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0x8e03('0x53')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x2b00cd,null))['catch'](handleError(_0x2b00cd,null));};var md5=require(_0x8e03('0x54'));exports['getFields']=function(_0x1fdabf,_0x104b4e,_0x5cd579){var _0x739a1=null;var _0x524229=null;var _0xb04625=null;var _0x34e712=null;var _0x46a7a0='';return db[_0x8e03('0x2c')][_0x8e03('0x4a')]({'where':{'id':_0x1fdabf['params']['id']},'attributes':['id',_0x8e03('0x28'),_0x8e03('0x55'),_0x8e03('0x56'),'moduleName',_0x8e03('0x57'),_0x8e03('0x58'),_0x8e03('0x59')]})[_0x8e03('0x23')](handleEntityNotFound(_0x104b4e,null))[_0x8e03('0x23')](function(_0x774670){if(_0x774670){_0x739a1=_0x774670[_0x8e03('0x55')];_0x524229=_0x774670['accessKey'];_0xb04625=_0x774670[_0x8e03('0x5a')];_0x46a7a0=_0x774670[_0x8e03('0x57')];var _0x191ee3=_0x46a7a0['slice'](-0x1);if(_0x191ee3==='/'){_0x46a7a0=_0x46a7a0[_0x8e03('0x5b')](0x0,_0x46a7a0[_0x8e03('0x5c')](_0x191ee3));}_0x34e712=util[_0x8e03('0x5d')](_0x8e03('0x5e'),_0x46a7a0);var _0x1393ae={'method':'GET','uri':_0x34e712,'qs':{'operation':_0x8e03('0x5f'),'username':_0x774670['username']},'json':!![]};return rp(_0x1393ae);}})[_0x8e03('0x23')](function(_0x24bf46){if(_0x24bf46[_0x8e03('0x60')]){var _0x3cd502={'method':'POST','uri':_0x34e712,'form':{'operation':_0x8e03('0x61'),'username':_0x739a1,'accessKey':md5(_0x24bf46['result'][_0x8e03('0x62')]+_0x524229)},'json':!![]};return rp(_0x3cd502);}})['then'](function(_0x285a0c){if(_0x285a0c[_0x8e03('0x60')]){var _0x31b069={'method':_0x8e03('0x63'),'uri':_0x34e712,'qs':{'operation':_0x8e03('0x64'),'username':_0x739a1,'sessionName':_0x285a0c['result'][_0x8e03('0x65')],'elementType':_0xb04625},'json':!![]};return rp(_0x31b069);}})[_0x8e03('0x23')](function(_0x44b3c4){if(_0x44b3c4[_0x8e03('0x60')]){var _0x126b68=[_0x8e03('0x66'),_0x8e03('0x67'),'owner'];_[_0x8e03('0x68')](_0x44b3c4[_0x8e03('0x69')][_0x8e03('0x35')],function(_0x2e58a3){return _0x126b68[_0x8e03('0x6a')](_0x2e58a3[_0x8e03('0x2f')][_0x8e03('0x28')]);});_[_0x8e03('0x68')](_0x44b3c4['result'][_0x8e03('0x35')],function(_0x1c75b6){return _0x1c75b6[_0x8e03('0x6b')]===_0x8e03('0x6c');});return{'count':_0x44b3c4[_0x8e03('0x69')][_0x8e03('0x35')]['length'],'rows':_[_0x8e03('0x2b')](_0x44b3c4[_0x8e03('0x69')]['fields'],function(_0x312ecb){return{'id':_0x312ecb[_0x8e03('0x28')],'name':_0x312ecb[_0x8e03('0x6d')],'custom':_[_0x8e03('0x6e')](_0x312ecb[_0x8e03('0x28')],_0x8e03('0x6f'))?!![]:![],'options':_0x312ecb['type'][_0x8e03('0x28')]==='picklist'&&_0x312ecb[_0x8e03('0x2f')][_0x8e03('0x70')][_0x8e03('0x36')]>0x0?_['map'](_0x312ecb[_0x8e03('0x2f')][_0x8e03('0x70')],function(_0x3cf73d){return{'name':_0x3cf73d[_0x8e03('0x6d')],'value':_0x3cf73d[_0x8e03('0x71')]};}):[]};})};}})[_0x8e03('0x23')](respondWithResult(_0x104b4e,null))[_0x8e03('0x41')](function(_0x54d51d){console['log'](_0x8e03('0x72')+_0x54d51d);var _0x2ae055=_0x1fdabf[_0x8e03('0x31')][_0x8e03('0x73')]?0x1f4:_0x54d51d[_0x8e03('0x74')]||0x1f4;logger[_0x8e03('0x26')](_0x8e03('0x75'),_0x8e03('0x76'),_0x2ae055,JSON['stringify'](_0x54d51d));delete _0x54d51d[_0x8e03('0x28')];if(_0x2ae055===0x191){_0x2ae055=0x190;}_0x104b4e[_0x8e03('0x18')](_0x2ae055)[_0x8e03('0x29')](_0x1fdabf[_0x8e03('0x31')][_0x8e03('0x73')]?{'message':_0x8e03('0x77'),'statusCode':_0x54d51d[_0x8e03('0x74')]}:_0x54d51d);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 32ca644..5e6b7e1 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.model.js +++ b/server/api/intVtigerAccount/intVtigerAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe27e=['../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xe27e,0x67));var _0xee27=function(_0x2ab365,_0xa3812e){_0x2ab365=_0x2ab365-0x0;var _0x49fef3=_0xe27e[_0x2ab365];return _0x49fef3;};'use strict';var _=require(_0xee27('0x0'));var util=require(_0xee27('0x1'));var logger=require(_0xee27('0x2'))(_0xee27('0x3'));var moment=require(_0xee27('0x4'));var BPromise=require(_0xee27('0x5'));var rp=require(_0xee27('0x6'));var fs=require('fs');var path=require(_0xee27('0x7'));var rimraf=require('rimraf');var config=require(_0xee27('0x8'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0xee27('0x9'));module[_0xee27('0xa')]=function(_0x468440,_0x58330b){return _0x468440[_0xee27('0xb')](_0xee27('0xc'),attributes,{'tableName':_0xee27('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x426c=['bluebird','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x422a66,_0x3dd024){var _0x32682b=function(_0xa96c99){while(--_0xa96c99){_0x422a66['push'](_0x422a66['shift']());}};_0x32682b(++_0x3dd024);}(_0x426c,0xdc));var _0xc426=function(_0x15a2cb,_0x571a10){_0x15a2cb=_0x15a2cb-0x0;var _0x26d3f6=_0x426c[_0x15a2cb];return _0x26d3f6;};'use strict';var _=require(_0xc426('0x0'));var util=require(_0xc426('0x1'));var logger=require(_0xc426('0x2'))(_0xc426('0x3'));var moment=require(_0xc426('0x4'));var BPromise=require(_0xc426('0x5'));var rp=require(_0xc426('0x6'));var fs=require('fs');var path=require(_0xc426('0x7'));var rimraf=require(_0xc426('0x8'));var config=require('../../config/environment');var attributes=require(_0xc426('0x9'));var integrations=require(_0xc426('0xa'));module[_0xc426('0xb')]=function(_0x4b5582,_0x5196de){return _0x4b5582[_0xc426('0xc')](_0xc426('0xd'),attributes,{'tableName':_0xc426('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 17d12dc..71713c6 100644 --- a/server/api/intVtigerAccount/intVtigerAccount.rpc.js +++ b/server/api/intVtigerAccount/intVtigerAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae60=['result','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','include','map','model','raw','ShowVtigerAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x327328,_0x2f4cea){var _0x1d0634=function(_0x433a89){while(--_0x433a89){_0x327328['push'](_0x327328['shift']());}};_0x1d0634(++_0x2f4cea);}(_0xae60,0x1c7));var _0x0ae6=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xae60[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var moment=require(_0x0ae6('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ae6('0x3'));var fs=require('fs');var Redis=require(_0x0ae6('0x4'));var db=require(_0x0ae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ae6('0x6'))(_0x0ae6('0x7'));var config=require('../../config/environment');var jayson=require(_0x0ae6('0x8'));var client=jayson[_0x0ae6('0x9')][_0x0ae6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46fed4,_0xbb596c,_0x447a1d){return new BPromise(function(_0x120910,_0x1b5e80){return client['request'](_0x46fed4,_0x447a1d)[_0x0ae6('0xb')](function(_0x36a5e0){logger[_0x0ae6('0xc')](_0x0ae6('0xd'),_0xbb596c,'request\x20sent');logger[_0x0ae6('0xe')](_0x0ae6('0xf'),_0xbb596c,_0x0ae6('0x10'),JSON[_0x0ae6('0x11')](_0x36a5e0));if(_0x36a5e0[_0x0ae6('0x12')]){if(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x13')]===0x1f4){logger[_0x0ae6('0x12')](_0x0ae6('0xd'),_0xbb596c,_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);return _0x1b5e80(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);}logger[_0x0ae6('0x12')]('VtigerAccount,\x20%s,\x20%s',_0xbb596c,_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);return _0x120910(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);}else{logger[_0x0ae6('0xc')](_0x0ae6('0xd'),_0xbb596c,_0x0ae6('0x10'));_0x120910(_0x36a5e0[_0x0ae6('0x15')][_0x0ae6('0x14')]);}})[_0x0ae6('0x16')](function(_0x8a4c9a){logger[_0x0ae6('0x12')](_0x0ae6('0xd'),_0xbb596c,_0x8a4c9a);_0x1b5e80(_0x8a4c9a);});});}exports[_0x0ae6('0x17')]=function(_0xda4f01){var _0x3f5c41=this;return new Promise(function(_0x2fdf25,_0x1735ba){return db[_0x0ae6('0x18')][_0x0ae6('0x19')]({'raw':_0xda4f01[_0x0ae6('0x1a')]?_0xda4f01[_0x0ae6('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xda4f01[_0x0ae6('0x1a')]?_0xda4f01[_0x0ae6('0x1a')][_0x0ae6('0x1b')]||null:null,'attributes':_0xda4f01[_0x0ae6('0x1a')]?_0xda4f01[_0x0ae6('0x1a')][_0x0ae6('0x1c')]||null:null,'limit':_0xda4f01[_0x0ae6('0x1a')]?_0xda4f01[_0x0ae6('0x1a')]['limit']||null:null,'include':_0xda4f01[_0x0ae6('0x1a')]?_0xda4f01[_0x0ae6('0x1a')][_0x0ae6('0x1d')]?_[_0x0ae6('0x1e')](_0xda4f01[_0x0ae6('0x1a')]['include'],function(_0x296a9d){return{'model':db[_0x296a9d[_0x0ae6('0x1f')]],'as':_0x296a9d['as'],'attributes':_0x296a9d[_0x0ae6('0x1c')],'include':_0x296a9d[_0x0ae6('0x1d')]?_[_0x0ae6('0x1e')](_0x296a9d[_0x0ae6('0x1d')],function(_0x5b86fe){return{'model':db[_0x5b86fe[_0x0ae6('0x1f')]],'as':_0x5b86fe['as'],'attributes':_0x5b86fe[_0x0ae6('0x1c')],'include':_0x5b86fe['include']?_['map'](_0x5b86fe[_0x0ae6('0x1d')],function(_0x3255a7){return{'model':db[_0x3255a7[_0x0ae6('0x1f')]],'as':_0x3255a7['as'],'attributes':_0x3255a7['attributes']};}):[]};}):[]};}):[]:[]})[_0x0ae6('0xb')](function(_0xb68cbe){logger[_0x0ae6('0xc')]('GetVtigerAccount',_0xda4f01);logger[_0x0ae6('0xe')](_0x0ae6('0x17'),_0xda4f01,JSON[_0x0ae6('0x11')](_0xb68cbe));_0x2fdf25(_0xb68cbe);})[_0x0ae6('0x16')](function(_0x14eed5){logger[_0x0ae6('0x12')]('GetVtigerAccount',_0x14eed5['message'],_0xda4f01);_0x1735ba(_0x3f5c41[_0x0ae6('0x12')](0x1f4,_0x14eed5[_0x0ae6('0x14')]));});});};exports['ShowVtigerAccount']=function(_0x4a06f1){var _0x1ca059=this;return new Promise(function(_0x278577,_0x714c6d){return db[_0x0ae6('0x18')]['find']({'raw':_0x4a06f1[_0x0ae6('0x1a')]?_0x4a06f1[_0x0ae6('0x1a')][_0x0ae6('0x20')]===undefined?!![]:![]:!![],'where':_0x4a06f1['options']?_0x4a06f1[_0x0ae6('0x1a')][_0x0ae6('0x1b')]||null:null,'attributes':_0x4a06f1[_0x0ae6('0x1a')]?_0x4a06f1[_0x0ae6('0x1a')][_0x0ae6('0x1c')]||null:null,'include':_0x4a06f1[_0x0ae6('0x1a')]?_0x4a06f1[_0x0ae6('0x1a')][_0x0ae6('0x1d')]?_[_0x0ae6('0x1e')](_0x4a06f1[_0x0ae6('0x1a')]['include'],function(_0x2410bd){return{'model':db[_0x2410bd[_0x0ae6('0x1f')]],'as':_0x2410bd['as'],'attributes':_0x2410bd['attributes'],'include':_0x2410bd[_0x0ae6('0x1d')]?_[_0x0ae6('0x1e')](_0x2410bd[_0x0ae6('0x1d')],function(_0x5b9662){return{'model':db[_0x5b9662[_0x0ae6('0x1f')]],'as':_0x5b9662['as'],'attributes':_0x5b9662['attributes'],'include':_0x5b9662['include']?_[_0x0ae6('0x1e')](_0x5b9662[_0x0ae6('0x1d')],function(_0x18fc19){return{'model':db[_0x18fc19[_0x0ae6('0x1f')]],'as':_0x18fc19['as'],'attributes':_0x18fc19[_0x0ae6('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x584dc8){logger[_0x0ae6('0xc')]('ShowVtigerAccount',_0x4a06f1);logger[_0x0ae6('0xe')]('ShowVtigerAccount',_0x4a06f1,JSON[_0x0ae6('0x11')](_0x584dc8));_0x278577(_0x584dc8);})['catch'](function(_0x7998e3){logger[_0x0ae6('0x12')](_0x0ae6('0x21'),_0x7998e3[_0x0ae6('0x14')],_0x4a06f1);_0x714c6d(_0x1ca059['error'](0x1f4,_0x7998e3['message']));});});}; \ No newline at end of file +var _0xcf66=['raw','where','attributes','limit','include','map','model','info','ShowVtigerAccount','find','debug','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','options'];(function(_0x145934,_0xe03781){var _0x3fc923=function(_0x14050f){while(--_0x14050f){_0x145934['push'](_0x145934['shift']());}};_0x3fc923(++_0xe03781);}(_0xcf66,0x71));var _0x6cf6=function(_0xf72ab3,_0x49c978){_0xf72ab3=_0xf72ab3-0x0;var _0x583350=_0xcf66[_0xf72ab3];return _0x583350;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cf6('0x3'));var fs=require('fs');var Redis=require(_0x6cf6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cf6('0x5'))(_0x6cf6('0x6'));var config=require('../../config/environment');var jayson=require(_0x6cf6('0x7'));var client=jayson[_0x6cf6('0x8')][_0x6cf6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb082,_0x94c6a9,_0x308d0d){return new BPromise(function(_0x36b892,_0x748c93){return client[_0x6cf6('0xa')](_0x5eb082,_0x308d0d)[_0x6cf6('0xb')](function(_0x5b3827){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x94c6a9,_0x6cf6('0xc'));logger['debug'](_0x6cf6('0xd'),_0x94c6a9,_0x6cf6('0xc'),JSON[_0x6cf6('0xe')](_0x5b3827));if(_0x5b3827[_0x6cf6('0xf')]){if(_0x5b3827['error']['code']===0x1f4){logger['error'](_0x6cf6('0x10'),_0x94c6a9,_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);return _0x748c93(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}logger[_0x6cf6('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x94c6a9,_0x5b3827[_0x6cf6('0xf')]['message']);return _0x36b892(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}else{logger['info'](_0x6cf6('0x10'),_0x94c6a9,_0x6cf6('0xc'));_0x36b892(_0x5b3827[_0x6cf6('0x12')][_0x6cf6('0x11')]);}})[_0x6cf6('0x13')](function(_0x2bdb12){logger[_0x6cf6('0xf')](_0x6cf6('0x10'),_0x94c6a9,_0x2bdb12);_0x748c93(_0x2bdb12);});});}exports[_0x6cf6('0x14')]=function(_0x2ca2b1){var _0x5e8b11=this;return new Promise(function(_0x11d994,_0x22915c){return db[_0x6cf6('0x15')]['findAll']({'raw':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x17')]===undefined?!![]:![]:!![],'where':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x18')]||null:null,'attributes':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1['options'][_0x6cf6('0x19')]||null:null,'limit':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x1a')]||null:null,'include':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x2ca2b1['options']['include'],function(_0x276225){return{'model':db[_0x276225['model']],'as':_0x276225['as'],'attributes':_0x276225[_0x6cf6('0x19')],'include':_0x276225[_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x276225[_0x6cf6('0x1b')],function(_0x3f9871){return{'model':db[_0x3f9871[_0x6cf6('0x1d')]],'as':_0x3f9871['as'],'attributes':_0x3f9871[_0x6cf6('0x19')],'include':_0x3f9871['include']?_[_0x6cf6('0x1c')](_0x3f9871[_0x6cf6('0x1b')],function(_0x3eaa31){return{'model':db[_0x3eaa31['model']],'as':_0x3eaa31['as'],'attributes':_0x3eaa31[_0x6cf6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6cf6('0xb')](function(_0x2224db){logger[_0x6cf6('0x1e')]('GetVtigerAccount',_0x2ca2b1);logger['debug'](_0x6cf6('0x14'),_0x2ca2b1,JSON[_0x6cf6('0xe')](_0x2224db));_0x11d994(_0x2224db);})[_0x6cf6('0x13')](function(_0x5869e9){logger['error'](_0x6cf6('0x14'),_0x5869e9['message'],_0x2ca2b1);_0x22915c(_0x5e8b11['error'](0x1f4,_0x5869e9['message']));});});};exports[_0x6cf6('0x1f')]=function(_0x65433){var _0x33d308=this;return new Promise(function(_0x42f488,_0x11c848){return db['VtigerAccount'][_0x6cf6('0x20')]({'raw':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')][_0x6cf6('0x18')]||null:null,'attributes':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')][_0x6cf6('0x19')]||null:null,'include':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')][_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x65433[_0x6cf6('0x16')][_0x6cf6('0x1b')],function(_0x4620b6){return{'model':db[_0x4620b6[_0x6cf6('0x1d')]],'as':_0x4620b6['as'],'attributes':_0x4620b6[_0x6cf6('0x19')],'include':_0x4620b6[_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x4620b6[_0x6cf6('0x1b')],function(_0x5cc6cd){return{'model':db[_0x5cc6cd[_0x6cf6('0x1d')]],'as':_0x5cc6cd['as'],'attributes':_0x5cc6cd[_0x6cf6('0x19')],'include':_0x5cc6cd[_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x5cc6cd[_0x6cf6('0x1b')],function(_0x2cf3a3){return{'model':db[_0x2cf3a3[_0x6cf6('0x1d')]],'as':_0x2cf3a3['as'],'attributes':_0x2cf3a3[_0x6cf6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6cf6('0xb')](function(_0x3718a1){logger[_0x6cf6('0x1e')]('ShowVtigerAccount',_0x65433);logger[_0x6cf6('0x21')](_0x6cf6('0x1f'),_0x65433,JSON[_0x6cf6('0xe')](_0x3718a1));_0x42f488(_0x3718a1);})[_0x6cf6('0x13')](function(_0x31c822){logger[_0x6cf6('0xf')](_0x6cf6('0x1f'),_0x31c822[_0x6cf6('0x11')],_0x65433);_0x11c848(_0x33d308[_0x6cf6('0xf')](0x1f4,_0x31c822['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 7eea3af..fbe7a0b 100644 --- a/server/api/intVtigerConfiguration/index.js +++ b/server/api/intVtigerConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9751=['update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x1889be,_0x5ce0b5){var _0xf2a872=function(_0x4f9e43){while(--_0x4f9e43){_0x1889be['push'](_0x1889be['shift']());}};_0xf2a872(++_0x5ce0b5);}(_0x9751,0x1df));var _0x1975=function(_0x2856c6,_0x745fd1){_0x2856c6=_0x2856c6-0x0;var _0x5f23a1=_0x9751[_0x2856c6];return _0x5f23a1;};'use strict';var multer=require(_0x1975('0x0'));var util=require(_0x1975('0x1'));var path=require('path');var timeout=require(_0x1975('0x2'));var express=require('express');var router=express[_0x1975('0x3')]();var fs_extra=require(_0x1975('0x4'));var auth=require(_0x1975('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1975('0x6'));var controller=require(_0x1975('0x7'));router[_0x1975('0x8')]('/',auth[_0x1975('0x9')](),controller[_0x1975('0xa')]);router[_0x1975('0x8')](_0x1975('0xb'),auth[_0x1975('0x9')](),controller['show']);router[_0x1975('0x8')](_0x1975('0xc'),auth['isAuthenticated'](),controller[_0x1975('0xd')]);router[_0x1975('0x8')](_0x1975('0xe'),auth['isAuthenticated'](),controller[_0x1975('0xf')]);router[_0x1975('0x8')](_0x1975('0x10'),auth[_0x1975('0x9')](),controller[_0x1975('0x11')]);router[_0x1975('0x12')]('/',auth[_0x1975('0x9')](),controller[_0x1975('0x13')]);router[_0x1975('0x14')]('/:id',auth[_0x1975('0x9')](),controller[_0x1975('0x15')]);router[_0x1975('0x16')](_0x1975('0xb'),auth['isAuthenticated'](),controller[_0x1975('0x17')]);module[_0x1975('0x18')]=router; \ No newline at end of file +var _0x45d0=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x5b1af8,_0x4455ae){var _0x2432c8=function(_0x233d10){while(--_0x233d10){_0x5b1af8['push'](_0x5b1af8['shift']());}};_0x2432c8(++_0x4455ae);}(_0x45d0,0x18a));var _0x045d=function(_0x34662e,_0x4b1abc){_0x34662e=_0x34662e-0x0;var _0x2252ba=_0x45d0[_0x34662e];return _0x2252ba;};'use strict';var multer=require(_0x045d('0x0'));var util=require(_0x045d('0x1'));var path=require(_0x045d('0x2'));var timeout=require(_0x045d('0x3'));var express=require('express');var router=express[_0x045d('0x4')]();var fs_extra=require(_0x045d('0x5'));var auth=require(_0x045d('0x6'));var interaction=require(_0x045d('0x7'));var config=require('../../config/environment');var controller=require(_0x045d('0x8'));router['get']('/',auth[_0x045d('0x9')](),controller[_0x045d('0xa')]);router[_0x045d('0xb')](_0x045d('0xc'),auth[_0x045d('0x9')](),controller[_0x045d('0xd')]);router['get'](_0x045d('0xe'),auth[_0x045d('0x9')](),controller[_0x045d('0xf')]);router['get'](_0x045d('0x10'),auth[_0x045d('0x9')](),controller[_0x045d('0x11')]);router['get'](_0x045d('0x12'),auth['isAuthenticated'](),controller[_0x045d('0x13')]);router[_0x045d('0x14')]('/',auth[_0x045d('0x9')](),controller[_0x045d('0x15')]);router['put'](_0x045d('0xc'),auth[_0x045d('0x9')](),controller[_0x045d('0x16')]);router[_0x045d('0x17')](_0x045d('0xc'),auth['isAuthenticated'](),controller[_0x045d('0x18')]);module[_0x045d('0x19')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 74caaa4..ee01534 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2632=['STRING','sequelize','exports'];(function(_0x3784ff,_0x1842a8){var _0x160732=function(_0x2b0eed){while(--_0x2b0eed){_0x3784ff['push'](_0x3784ff['shift']());}};_0x160732(++_0x1842a8);}(_0x2632,0x8b));var _0x2263=function(_0x4132fe,_0x61720d){_0x4132fe=_0x4132fe-0x0;var _0x3ab2eb=_0x2632[_0x4132fe];return _0x3ab2eb;};'use strict';var Sequelize=require(_0x2263('0x0'));module[_0x2263('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2263('0x2')]}}; \ No newline at end of file +var _0x687b=['STRING','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x687b,0xb2));var _0xb687=function(_0x3601f2,_0x34af7a){_0x3601f2=_0x3601f2-0x0;var _0xb360a3=_0x687b[_0x3601f2];return _0xb360a3;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb687('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index faa189c..3d2b867 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1fa7=['order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','create','body','update','find','params','getFields','VtigerField','getSubjects','findOne','getDescriptions','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','VtigerConfiguration','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x5d30b4,_0x199248){var _0x1acfb8=function(_0x3544b2){while(--_0x3544b2){_0x5d30b4['push'](_0x5d30b4['shift']());}};_0x1acfb8(++_0x199248);}(_0x1fa7,0x151));var _0x71fa=function(_0x2aadee,_0x323412){_0x2aadee=_0x2aadee-0x0;var _0x48a186=_0x1fa7[_0x2aadee];return _0x48a186;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x71fa('0x0'));var zipdir=require(_0x71fa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x71fa('0x2'));var BPromise=require(_0x71fa('0x3'));var Mustache=require('mustache');var util=require(_0x71fa('0x4'));var path=require('path');var sox=require(_0x71fa('0x5'));var csv=require(_0x71fa('0x6'));var ejs=require(_0x71fa('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x71fa('0x8'));var squel=require(_0x71fa('0x9'));var crypto=require(_0x71fa('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x71fa('0x6'));var querystring=require(_0x71fa('0xb'));var Papa=require(_0x71fa('0xc'));var Redis=require(_0x71fa('0xd'));var authService=require(_0x71fa('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x71fa('0xf'));var hardwareService=require(_0x71fa('0x10'));var logger=require(_0x71fa('0x11'))(_0x71fa('0x12'));var utils=require(_0x71fa('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x71fa('0x14'));var db=require(_0x71fa('0x15'))['db'];function respondWithStatusCode(_0x5edc6e,_0x2966d5){_0x2966d5=_0x2966d5||0xcc;return function(_0x23751d){if(_0x23751d){return _0x5edc6e['sendStatus'](_0x2966d5);}return _0x5edc6e[_0x71fa('0x16')](_0x2966d5)[_0x71fa('0x17')]();};}function respondWithResult(_0x262e75,_0x157024){_0x157024=_0x157024||0xc8;return function(_0xc1fc2a){if(_0xc1fc2a){return _0x262e75[_0x71fa('0x16')](_0x157024)[_0x71fa('0x18')](_0xc1fc2a);}};}function respondWithFilteredResult(_0x1b6174,_0x50e6c8){return function(_0x25b825){if(_0x25b825){var _0x29ba6a=typeof _0x50e6c8[_0x71fa('0x19')]===_0x71fa('0x1a')&&typeof _0x50e6c8['limit']==='undefined';var _0x27cbaf=_0x25b825[_0x71fa('0x1b')];var _0x1f88b5=_0x29ba6a?0x0:_0x50e6c8[_0x71fa('0x19')];var _0xa78e6a=_0x29ba6a?_0x25b825[_0x71fa('0x1b')]:_0x50e6c8['offset']+_0x50e6c8[_0x71fa('0x1c')];var _0x5dab42;if(_0xa78e6a>=_0x27cbaf){_0xa78e6a=_0x27cbaf;_0x5dab42=0xc8;}else{_0x5dab42=0xce;}_0x1b6174[_0x71fa('0x16')](_0x5dab42);return _0x1b6174[_0x71fa('0x1d')](_0x71fa('0x1e'),_0x1f88b5+'-'+_0xa78e6a+'/'+_0x27cbaf)[_0x71fa('0x18')](_0x25b825);}return null;};}function patchUpdates(_0x4638f5){return function(_0x54d52d){try{jsonpatch[_0x71fa('0x1f')](_0x54d52d,_0x4638f5,!![]);}catch(_0xda7ff2){return BPromise[_0x71fa('0x20')](_0xda7ff2);}return _0x54d52d[_0x71fa('0x21')]();};}function saveUpdates(_0x5b7f75,_0x472440){return function(_0x51fd35){if(_0x51fd35){return _0x51fd35['update'](_0x5b7f75)[_0x71fa('0x22')](function(_0x120608){return _0x120608;});}return null;};}function removeEntity(_0x408e13,_0x16e0c3){return function(_0x358591){if(_0x358591){return _0x358591[_0x71fa('0x23')]()[_0x71fa('0x22')](function(){_0x408e13[_0x71fa('0x16')](0xcc)[_0x71fa('0x17')]();});}};}function handleEntityNotFound(_0x46bc02,_0x4d3818){return function(_0x16fdfe){if(!_0x16fdfe){_0x46bc02['sendStatus'](0x194);}return _0x16fdfe;};}function handleError(_0x23e988,_0x12457c){_0x12457c=_0x12457c||0x1f4;return function(_0x3d5c60){logger[_0x71fa('0x24')](_0x3d5c60['stack']);if(_0x3d5c60['name']){delete _0x3d5c60[_0x71fa('0x25')];}_0x23e988[_0x71fa('0x16')](_0x12457c)[_0x71fa('0x26')](_0x3d5c60);};}exports[_0x71fa('0x27')]=function(_0x41b50f,_0x3ba2b2){var _0xcb78={},_0x2fa76d={},_0x2773a0={'count':0x0,'rows':[]};var _0x12605b=_[_0x71fa('0x28')](db[_0x71fa('0x29')]['rawAttributes'],function(_0x172eb4){return{'name':_0x172eb4['fieldName'],'type':_0x172eb4['type'][_0x71fa('0x2a')]};});_0x2fa76d[_0x71fa('0x2b')]=_[_0x71fa('0x28')](_0x12605b,_0x71fa('0x25'));_0x2fa76d[_0x71fa('0x2c')]=_[_0x71fa('0x2d')](_0x41b50f[_0x71fa('0x2c')]);_0x2fa76d[_0x71fa('0x2e')]=_[_0x71fa('0x2f')](_0x2fa76d[_0x71fa('0x2b')],_0x2fa76d[_0x71fa('0x2c')]);_0xcb78['attributes']=_[_0x71fa('0x2f')](_0x2fa76d[_0x71fa('0x2b')],qs[_0x71fa('0x30')](_0x41b50f['query']['fields']));_0xcb78['attributes']=_0xcb78[_0x71fa('0x31')][_0x71fa('0x32')]?_0xcb78[_0x71fa('0x31')]:_0x2fa76d[_0x71fa('0x2b')];if(!_0x41b50f[_0x71fa('0x2c')][_0x71fa('0x33')](_0x71fa('0x34'))){_0xcb78['limit']=qs[_0x71fa('0x1c')](_0x41b50f[_0x71fa('0x2c')][_0x71fa('0x1c')]);_0xcb78[_0x71fa('0x19')]=qs[_0x71fa('0x19')](_0x41b50f['query'][_0x71fa('0x19')]);}_0xcb78[_0x71fa('0x35')]=qs[_0x71fa('0x36')](_0x41b50f[_0x71fa('0x2c')][_0x71fa('0x36')]);_0xcb78[_0x71fa('0x37')]=qs[_0x71fa('0x2e')](_[_0x71fa('0x38')](_0x41b50f[_0x71fa('0x2c')],_0x2fa76d[_0x71fa('0x2e')]),_0x12605b);if(_0x41b50f['query'][_0x71fa('0x39')]){_0xcb78[_0x71fa('0x37')]=_[_0x71fa('0x3a')](_0xcb78[_0x71fa('0x37')],{'$or':_[_0x71fa('0x28')](_0x12605b,function(_0xa2b3d9){if(_0xa2b3d9[_0x71fa('0x3b')]!==_0x71fa('0x3c')){var _0x1ffa62={};_0x1ffa62[_0xa2b3d9[_0x71fa('0x25')]]={'$like':'%'+_0x41b50f[_0x71fa('0x2c')][_0x71fa('0x39')]+'%'};return _0x1ffa62;}})});}_0xcb78=_[_0x71fa('0x3a')]({},_0xcb78,_0x41b50f[_0x71fa('0x3d')]);var _0xd7c8b3={'where':_0xcb78['where']};return db['VtigerConfiguration']['count'](_0xd7c8b3)[_0x71fa('0x22')](function(_0x45d35c){_0x2773a0['count']=_0x45d35c;if(_0x41b50f[_0x71fa('0x2c')][_0x71fa('0x3e')]){_0xcb78['include']=[{'all':!![]}];}return db[_0x71fa('0x29')][_0x71fa('0x3f')](_0xcb78);})[_0x71fa('0x22')](function(_0x2702fb){_0x2773a0[_0x71fa('0x40')]=_0x2702fb;return _0x2773a0;})['then'](respondWithFilteredResult(_0x3ba2b2,_0xcb78))[_0x71fa('0x41')](handleError(_0x3ba2b2,null));};exports[_0x71fa('0x42')]=function(_0x1a566a,_0x2df04a){var _0x1bebab={'raw':![],'where':{'id':_0x1a566a['params']['id']}},_0x4793b1={};_0x4793b1['model']=_['keys'](db['VtigerConfiguration'][_0x71fa('0x43')]);_0x4793b1[_0x71fa('0x2c')]=_[_0x71fa('0x2d')](_0x1a566a['query']);_0x4793b1[_0x71fa('0x2e')]=_[_0x71fa('0x2f')](_0x4793b1[_0x71fa('0x2b')],_0x4793b1[_0x71fa('0x2c')]);_0x1bebab[_0x71fa('0x31')]=_[_0x71fa('0x2f')](_0x4793b1[_0x71fa('0x2b')],qs[_0x71fa('0x30')](_0x1a566a[_0x71fa('0x2c')][_0x71fa('0x30')]));_0x1bebab[_0x71fa('0x31')]=_0x1bebab[_0x71fa('0x31')][_0x71fa('0x32')]?_0x1bebab[_0x71fa('0x31')]:_0x4793b1['model'];if(_0x1a566a[_0x71fa('0x2c')][_0x71fa('0x3e')]){_0x1bebab['include']=[{'all':!![]}];}_0x1bebab=_[_0x71fa('0x3a')]({},_0x1bebab,_0x1a566a[_0x71fa('0x3d')]);return db[_0x71fa('0x29')]['find'](_0x1bebab)[_0x71fa('0x22')](handleEntityNotFound(_0x2df04a,null))[_0x71fa('0x22')](respondWithResult(_0x2df04a,null))[_0x71fa('0x41')](handleError(_0x2df04a,null));};exports[_0x71fa('0x44')]=function(_0x28bc29,_0x1b35e5){return db[_0x71fa('0x29')][_0x71fa('0x44')](_0x28bc29[_0x71fa('0x45')],{})['then'](respondWithResult(_0x1b35e5,0xc9))[_0x71fa('0x41')](handleError(_0x1b35e5,null));};exports[_0x71fa('0x46')]=function(_0x3c558d,_0x56433e){if(_0x3c558d['body']['id']){delete _0x3c558d[_0x71fa('0x45')]['id'];}return db['VtigerConfiguration'][_0x71fa('0x47')]({'where':{'id':_0x3c558d['params']['id']}})['then'](handleEntityNotFound(_0x56433e,null))[_0x71fa('0x22')](saveUpdates(_0x3c558d['body'],null))['then'](respondWithResult(_0x56433e,null))['catch'](handleError(_0x56433e,null));};exports['destroy']=function(_0x273d2d,_0x3a94dd){return db[_0x71fa('0x29')]['find']({'where':{'id':_0x273d2d[_0x71fa('0x48')]['id']}})['then'](handleEntityNotFound(_0x3a94dd,null))[_0x71fa('0x22')](removeEntity(_0x3a94dd,null))[_0x71fa('0x41')](handleError(_0x3a94dd,null));};exports[_0x71fa('0x49')]=function(_0x4cdfd2,_0x4921a0,_0x4edbfd){var _0x3f0871={};var _0x52d5a0={};var _0x1a67b6;var _0x27219b;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x4cdfd2[_0x71fa('0x48')]['id']}})['then'](handleEntityNotFound(_0x4921a0,null))[_0x71fa('0x22')](function(_0x30c778){if(_0x30c778){_0x1a67b6=_0x30c778;_0x52d5a0[_0x71fa('0x2b')]=_[_0x71fa('0x2d')](db[_0x71fa('0x4a')][_0x71fa('0x43')]);_0x52d5a0['query']=_['keys'](_0x4cdfd2[_0x71fa('0x2c')]);_0x52d5a0[_0x71fa('0x2e')]=_[_0x71fa('0x2f')](_0x52d5a0[_0x71fa('0x2b')],_0x52d5a0[_0x71fa('0x2c')]);_0x3f0871[_0x71fa('0x31')]=_['intersection'](_0x52d5a0[_0x71fa('0x2b')],qs['fields'](_0x4cdfd2['query'][_0x71fa('0x30')]));_0x3f0871['attributes']=_0x3f0871[_0x71fa('0x31')][_0x71fa('0x32')]?_0x3f0871[_0x71fa('0x31')]:_0x52d5a0[_0x71fa('0x2b')];_0x3f0871[_0x71fa('0x35')]=qs[_0x71fa('0x36')](_0x4cdfd2[_0x71fa('0x2c')][_0x71fa('0x36')]);_0x3f0871['where']=qs[_0x71fa('0x2e')](_['pick'](_0x4cdfd2['query'],_0x52d5a0[_0x71fa('0x2e')]));if(_0x4cdfd2[_0x71fa('0x2c')][_0x71fa('0x39')]){_0x3f0871['where']=_[_0x71fa('0x3a')](_0x3f0871[_0x71fa('0x37')],{'$or':_['map'](_0x3f0871[_0x71fa('0x31')],function(_0x2b94e8){var _0x4afa64={};_0x4afa64[_0x2b94e8]={'$like':'%'+_0x4cdfd2[_0x71fa('0x2c')][_0x71fa('0x39')]+'%'};return _0x4afa64;})});}_0x3f0871=_[_0x71fa('0x3a')]({},_0x3f0871,_0x4cdfd2['options']);return _0x1a67b6['getFields'](_0x3f0871);}})[_0x71fa('0x22')](function(_0x5ed4dd){if(_0x5ed4dd){_0x27219b=_0x5ed4dd['length'];if(!_0x4cdfd2[_0x71fa('0x2c')][_0x71fa('0x33')](_0x71fa('0x34'))){_0x3f0871[_0x71fa('0x1c')]=qs[_0x71fa('0x1c')](_0x4cdfd2[_0x71fa('0x2c')][_0x71fa('0x1c')]);_0x3f0871['offset']=qs[_0x71fa('0x19')](_0x4cdfd2['query']['offset']);}return _0x1a67b6[_0x71fa('0x49')](_0x3f0871);}})[_0x71fa('0x22')](function(_0x57ac9d){if(_0x57ac9d){return _0x57ac9d?{'count':_0x27219b,'rows':_0x57ac9d}:null;}})[_0x71fa('0x22')](respondWithResult(_0x4921a0,null))[_0x71fa('0x41')](handleError(_0x4921a0,null));};exports[_0x71fa('0x4b')]=function(_0x23e6a1,_0x188fbe,_0x660cf){var _0x63a04d={};var _0x170f47={};var _0x3d9d45;var _0x7de2d2;return db[_0x71fa('0x29')][_0x71fa('0x4c')]({'where':{'id':_0x23e6a1['params']['id']}})[_0x71fa('0x22')](handleEntityNotFound(_0x188fbe,null))[_0x71fa('0x22')](function(_0x329982){if(_0x329982){_0x3d9d45=_0x329982;_0x170f47[_0x71fa('0x2b')]=_[_0x71fa('0x2d')](db['VtigerField'][_0x71fa('0x43')]);_0x170f47[_0x71fa('0x2c')]=_[_0x71fa('0x2d')](_0x23e6a1[_0x71fa('0x2c')]);_0x170f47[_0x71fa('0x2e')]=_['intersection'](_0x170f47[_0x71fa('0x2b')],_0x170f47[_0x71fa('0x2c')]);_0x63a04d[_0x71fa('0x31')]=_[_0x71fa('0x2f')](_0x170f47[_0x71fa('0x2b')],qs[_0x71fa('0x30')](_0x23e6a1[_0x71fa('0x2c')][_0x71fa('0x30')]));_0x63a04d[_0x71fa('0x31')]=_0x63a04d[_0x71fa('0x31')]['length']?_0x63a04d[_0x71fa('0x31')]:_0x170f47[_0x71fa('0x2b')];_0x63a04d[_0x71fa('0x35')]=qs[_0x71fa('0x36')](_0x23e6a1[_0x71fa('0x2c')][_0x71fa('0x36')]);_0x63a04d['where']=qs[_0x71fa('0x2e')](_[_0x71fa('0x38')](_0x23e6a1['query'],_0x170f47[_0x71fa('0x2e')]));if(_0x23e6a1[_0x71fa('0x2c')]['filter']){_0x63a04d['where']=_[_0x71fa('0x3a')](_0x63a04d[_0x71fa('0x37')],{'$or':_['map'](_0x63a04d[_0x71fa('0x31')],function(_0x5c1d3e){var _0x295e78={};_0x295e78[_0x5c1d3e]={'$like':'%'+_0x23e6a1[_0x71fa('0x2c')][_0x71fa('0x39')]+'%'};return _0x295e78;})});}_0x63a04d=_[_0x71fa('0x3a')]({},_0x63a04d,_0x23e6a1['options']);return _0x3d9d45['getSubjects'](_0x63a04d);}})[_0x71fa('0x22')](function(_0x477cb9){if(_0x477cb9){_0x7de2d2=_0x477cb9[_0x71fa('0x32')];if(!_0x23e6a1['query'][_0x71fa('0x33')]('nolimit')){_0x63a04d[_0x71fa('0x1c')]=qs[_0x71fa('0x1c')](_0x23e6a1[_0x71fa('0x2c')][_0x71fa('0x1c')]);_0x63a04d[_0x71fa('0x19')]=qs['offset'](_0x23e6a1[_0x71fa('0x2c')][_0x71fa('0x19')]);}return _0x3d9d45[_0x71fa('0x4b')](_0x63a04d);}})[_0x71fa('0x22')](function(_0x25b202){if(_0x25b202){return _0x25b202?{'count':_0x7de2d2,'rows':_0x25b202}:null;}})[_0x71fa('0x22')](respondWithResult(_0x188fbe,null))[_0x71fa('0x41')](handleError(_0x188fbe,null));};exports[_0x71fa('0x4d')]=function(_0x2a0bc0,_0x15a7a3,_0x5e46d4){var _0x6c446={};var _0x184a75={};var _0x4f14f3;var _0x5eb399;return db[_0x71fa('0x29')][_0x71fa('0x4c')]({'where':{'id':_0x2a0bc0[_0x71fa('0x48')]['id']}})['then'](handleEntityNotFound(_0x15a7a3,null))[_0x71fa('0x22')](function(_0xd29b83){if(_0xd29b83){_0x4f14f3=_0xd29b83;_0x184a75[_0x71fa('0x2b')]=_[_0x71fa('0x2d')](db[_0x71fa('0x4a')][_0x71fa('0x43')]);_0x184a75['query']=_['keys'](_0x2a0bc0[_0x71fa('0x2c')]);_0x184a75[_0x71fa('0x2e')]=_[_0x71fa('0x2f')](_0x184a75[_0x71fa('0x2b')],_0x184a75[_0x71fa('0x2c')]);_0x6c446[_0x71fa('0x31')]=_[_0x71fa('0x2f')](_0x184a75['model'],qs[_0x71fa('0x30')](_0x2a0bc0[_0x71fa('0x2c')][_0x71fa('0x30')]));_0x6c446[_0x71fa('0x31')]=_0x6c446[_0x71fa('0x31')][_0x71fa('0x32')]?_0x6c446[_0x71fa('0x31')]:_0x184a75[_0x71fa('0x2b')];_0x6c446[_0x71fa('0x35')]=qs[_0x71fa('0x36')](_0x2a0bc0[_0x71fa('0x2c')][_0x71fa('0x36')]);_0x6c446[_0x71fa('0x37')]=qs[_0x71fa('0x2e')](_[_0x71fa('0x38')](_0x2a0bc0[_0x71fa('0x2c')],_0x184a75[_0x71fa('0x2e')]));if(_0x2a0bc0[_0x71fa('0x2c')]['filter']){_0x6c446[_0x71fa('0x37')]=_[_0x71fa('0x3a')](_0x6c446[_0x71fa('0x37')],{'$or':_[_0x71fa('0x28')](_0x6c446[_0x71fa('0x31')],function(_0x13b645){var _0x1e3484={};_0x1e3484[_0x13b645]={'$like':'%'+_0x2a0bc0[_0x71fa('0x2c')][_0x71fa('0x39')]+'%'};return _0x1e3484;})});}_0x6c446=_[_0x71fa('0x3a')]({},_0x6c446,_0x2a0bc0[_0x71fa('0x3d')]);return _0x4f14f3[_0x71fa('0x4d')](_0x6c446);}})[_0x71fa('0x22')](function(_0x4020fb){if(_0x4020fb){_0x5eb399=_0x4020fb['length'];if(!_0x2a0bc0[_0x71fa('0x2c')]['hasOwnProperty'](_0x71fa('0x34'))){_0x6c446[_0x71fa('0x1c')]=qs['limit'](_0x2a0bc0[_0x71fa('0x2c')][_0x71fa('0x1c')]);_0x6c446[_0x71fa('0x19')]=qs[_0x71fa('0x19')](_0x2a0bc0['query'][_0x71fa('0x19')]);}return _0x4f14f3[_0x71fa('0x4d')](_0x6c446);}})[_0x71fa('0x22')](function(_0x446236){if(_0x446236){return _0x446236?{'count':_0x5eb399,'rows':_0x446236}:null;}})[_0x71fa('0x22')](respondWithResult(_0x15a7a3,null))[_0x71fa('0x41')](handleError(_0x15a7a3,null));}; \ No newline at end of file +var _0xf337=['desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','apply','save','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','VtigerConfiguration','count','includeAll','include','catch','show','params','find','create','body','getFields','findOne','VtigerField','getSubjects','getDescriptions','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x318256,_0xa773f3){var _0xb1e352=function(_0x4bb14e){while(--_0x4bb14e){_0x318256['push'](_0x318256['shift']());}};_0xb1e352(++_0xa773f3);}(_0xf337,0x174));var _0x7f33=function(_0x1a332f,_0x5e7365){_0x1a332f=_0x1a332f-0x0;var _0x611ed5=_0xf337[_0x1a332f];return _0x611ed5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f33('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7f33('0x1'));var moment=require(_0x7f33('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7f33('0x3'));var util=require(_0x7f33('0x4'));var path=require(_0x7f33('0x5'));var sox=require(_0x7f33('0x6'));var csv=require(_0x7f33('0x7'));var ejs=require(_0x7f33('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f33('0x9'));var squel=require(_0x7f33('0xa'));var crypto=require(_0x7f33('0xb'));var jsforce=require(_0x7f33('0xc'));var deskjs=require(_0x7f33('0xd'));var toCsv=require(_0x7f33('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7f33('0xe'));var authService=require(_0x7f33('0xf'));var qs=require(_0x7f33('0x10'));var as=require(_0x7f33('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f33('0x12'))('api');var utils=require(_0x7f33('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7f33('0x14'));var db=require(_0x7f33('0x15'))['db'];function respondWithStatusCode(_0x38294e,_0x3617c5){_0x3617c5=_0x3617c5||0xcc;return function(_0x2b13a3){if(_0x2b13a3){return _0x38294e[_0x7f33('0x16')](_0x3617c5);}return _0x38294e['status'](_0x3617c5)[_0x7f33('0x17')]();};}function respondWithResult(_0x22f4d6,_0x17f699){_0x17f699=_0x17f699||0xc8;return function(_0x5c23e2){if(_0x5c23e2){return _0x22f4d6[_0x7f33('0x18')](_0x17f699)['json'](_0x5c23e2);}};}function respondWithFilteredResult(_0x5ea40f,_0x4c12d7){return function(_0x1f0ec8){if(_0x1f0ec8){var _0x4ef498=typeof _0x4c12d7[_0x7f33('0x19')]===_0x7f33('0x1a')&&typeof _0x4c12d7[_0x7f33('0x1b')]==='undefined';var _0x2bbf16=_0x1f0ec8['count'];var _0x1f7ce9=_0x4ef498?0x0:_0x4c12d7[_0x7f33('0x19')];var _0x5cb525=_0x4ef498?_0x1f0ec8['count']:_0x4c12d7[_0x7f33('0x19')]+_0x4c12d7[_0x7f33('0x1b')];var _0x13e0b2;if(_0x5cb525>=_0x2bbf16){_0x5cb525=_0x2bbf16;_0x13e0b2=0xc8;}else{_0x13e0b2=0xce;}_0x5ea40f[_0x7f33('0x18')](_0x13e0b2);return _0x5ea40f[_0x7f33('0x1c')](_0x7f33('0x1d'),_0x1f7ce9+'-'+_0x5cb525+'/'+_0x2bbf16)[_0x7f33('0x1e')](_0x1f0ec8);}return null;};}function patchUpdates(_0x2328ab){return function(_0xdc2610){try{jsonpatch[_0x7f33('0x1f')](_0xdc2610,_0x2328ab,!![]);}catch(_0x3d014b){return BPromise['reject'](_0x3d014b);}return _0xdc2610[_0x7f33('0x20')]();};}function saveUpdates(_0x22109e,_0x583e8d){return function(_0x75804a){if(_0x75804a){return _0x75804a[_0x7f33('0x21')](_0x22109e)[_0x7f33('0x22')](function(_0x31f1ec){return _0x31f1ec;});}return null;};}function removeEntity(_0xf5fa60,_0x137cb0){return function(_0x1961a3){if(_0x1961a3){return _0x1961a3['destroy']()[_0x7f33('0x22')](function(){_0xf5fa60[_0x7f33('0x18')](0xcc)[_0x7f33('0x17')]();});}};}function handleEntityNotFound(_0x154966,_0x1f80ad){return function(_0x17a00f){if(!_0x17a00f){_0x154966[_0x7f33('0x16')](0x194);}return _0x17a00f;};}function handleError(_0x4602a8,_0x576f50){_0x576f50=_0x576f50||0x1f4;return function(_0x4f1498){logger[_0x7f33('0x23')](_0x4f1498[_0x7f33('0x24')]);if(_0x4f1498[_0x7f33('0x25')]){delete _0x4f1498[_0x7f33('0x25')];}_0x4602a8[_0x7f33('0x18')](_0x576f50)[_0x7f33('0x26')](_0x4f1498);};}exports['index']=function(_0x4296c3,_0x58ba21){var _0x1661b5={},_0x256cc0={},_0x2095fe={'count':0x0,'rows':[]};var _0x527c86=_['map'](db['VtigerConfiguration'][_0x7f33('0x27')],function(_0x32b0ab){return{'name':_0x32b0ab[_0x7f33('0x28')],'type':_0x32b0ab[_0x7f33('0x29')][_0x7f33('0x2a')]};});_0x256cc0[_0x7f33('0x2b')]=_[_0x7f33('0x2c')](_0x527c86,_0x7f33('0x25'));_0x256cc0[_0x7f33('0x2d')]=_[_0x7f33('0x2e')](_0x4296c3[_0x7f33('0x2d')]);_0x256cc0[_0x7f33('0x2f')]=_[_0x7f33('0x30')](_0x256cc0[_0x7f33('0x2b')],_0x256cc0[_0x7f33('0x2d')]);_0x1661b5['attributes']=_[_0x7f33('0x30')](_0x256cc0[_0x7f33('0x2b')],qs[_0x7f33('0x31')](_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x31')]));_0x1661b5[_0x7f33('0x32')]=_0x1661b5[_0x7f33('0x32')][_0x7f33('0x33')]?_0x1661b5['attributes']:_0x256cc0[_0x7f33('0x2b')];if(!_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x34')](_0x7f33('0x35'))){_0x1661b5['limit']=qs[_0x7f33('0x1b')](_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x1b')]);_0x1661b5[_0x7f33('0x19')]=qs['offset'](_0x4296c3['query'][_0x7f33('0x19')]);}_0x1661b5[_0x7f33('0x36')]=qs[_0x7f33('0x37')](_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x37')]);_0x1661b5['where']=qs['filters'](_[_0x7f33('0x38')](_0x4296c3[_0x7f33('0x2d')],_0x256cc0['filters']),_0x527c86);if(_0x4296c3['query'][_0x7f33('0x39')]){_0x1661b5[_0x7f33('0x3a')]=_[_0x7f33('0x3b')](_0x1661b5[_0x7f33('0x3a')],{'$or':_[_0x7f33('0x2c')](_0x527c86,function(_0x4d5e3c){if(_0x4d5e3c[_0x7f33('0x29')]!==_0x7f33('0x3c')){var _0x15bd2b={};_0x15bd2b[_0x4d5e3c[_0x7f33('0x25')]]={'$like':'%'+_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x39')]+'%'};return _0x15bd2b;}})});}_0x1661b5=_[_0x7f33('0x3b')]({},_0x1661b5,_0x4296c3[_0x7f33('0x3d')]);var _0x33f5a9={'where':_0x1661b5[_0x7f33('0x3a')]};return db[_0x7f33('0x3e')]['count'](_0x33f5a9)[_0x7f33('0x22')](function(_0x4a84ef){_0x2095fe[_0x7f33('0x3f')]=_0x4a84ef;if(_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x40')]){_0x1661b5[_0x7f33('0x41')]=[{'all':!![]}];}return db[_0x7f33('0x3e')]['findAll'](_0x1661b5);})[_0x7f33('0x22')](function(_0x1d3f4b){_0x2095fe['rows']=_0x1d3f4b;return _0x2095fe;})['then'](respondWithFilteredResult(_0x58ba21,_0x1661b5))[_0x7f33('0x42')](handleError(_0x58ba21,null));};exports[_0x7f33('0x43')]=function(_0x1ced77,_0x1a2ba9){var _0x3f418e={'raw':![],'where':{'id':_0x1ced77[_0x7f33('0x44')]['id']}},_0x4e2ae7={};_0x4e2ae7[_0x7f33('0x2b')]=_['keys'](db[_0x7f33('0x3e')][_0x7f33('0x27')]);_0x4e2ae7[_0x7f33('0x2d')]=_[_0x7f33('0x2e')](_0x1ced77[_0x7f33('0x2d')]);_0x4e2ae7[_0x7f33('0x2f')]=_[_0x7f33('0x30')](_0x4e2ae7[_0x7f33('0x2b')],_0x4e2ae7[_0x7f33('0x2d')]);_0x3f418e[_0x7f33('0x32')]=_[_0x7f33('0x30')](_0x4e2ae7[_0x7f33('0x2b')],qs['fields'](_0x1ced77[_0x7f33('0x2d')]['fields']));_0x3f418e[_0x7f33('0x32')]=_0x3f418e[_0x7f33('0x32')][_0x7f33('0x33')]?_0x3f418e[_0x7f33('0x32')]:_0x4e2ae7['model'];if(_0x1ced77[_0x7f33('0x2d')]['includeAll']){_0x3f418e['include']=[{'all':!![]}];}_0x3f418e=_['merge']({},_0x3f418e,_0x1ced77[_0x7f33('0x3d')]);return db[_0x7f33('0x3e')][_0x7f33('0x45')](_0x3f418e)['then'](handleEntityNotFound(_0x1a2ba9,null))[_0x7f33('0x22')](respondWithResult(_0x1a2ba9,null))['catch'](handleError(_0x1a2ba9,null));};exports[_0x7f33('0x46')]=function(_0x4bcddf,_0x4d42cb){return db[_0x7f33('0x3e')][_0x7f33('0x46')](_0x4bcddf['body'],{})[_0x7f33('0x22')](respondWithResult(_0x4d42cb,0xc9))[_0x7f33('0x42')](handleError(_0x4d42cb,null));};exports['update']=function(_0x4a9739,_0x3859ea){if(_0x4a9739[_0x7f33('0x47')]['id']){delete _0x4a9739['body']['id'];}return db[_0x7f33('0x3e')]['find']({'where':{'id':_0x4a9739[_0x7f33('0x44')]['id']}})[_0x7f33('0x22')](handleEntityNotFound(_0x3859ea,null))[_0x7f33('0x22')](saveUpdates(_0x4a9739[_0x7f33('0x47')],null))[_0x7f33('0x22')](respondWithResult(_0x3859ea,null))[_0x7f33('0x42')](handleError(_0x3859ea,null));};exports['destroy']=function(_0x20ccd9,_0x57c776){return db[_0x7f33('0x3e')][_0x7f33('0x45')]({'where':{'id':_0x20ccd9['params']['id']}})[_0x7f33('0x22')](handleEntityNotFound(_0x57c776,null))[_0x7f33('0x22')](removeEntity(_0x57c776,null))['catch'](handleError(_0x57c776,null));};exports[_0x7f33('0x48')]=function(_0x552126,_0x55e54e,_0x1d58b8){var _0x2b9449={};var _0x1a5380={};var _0x2be467;var _0x3fc225;return db[_0x7f33('0x3e')][_0x7f33('0x49')]({'where':{'id':_0x552126[_0x7f33('0x44')]['id']}})[_0x7f33('0x22')](handleEntityNotFound(_0x55e54e,null))[_0x7f33('0x22')](function(_0x567c60){if(_0x567c60){_0x2be467=_0x567c60;_0x1a5380[_0x7f33('0x2b')]=_['keys'](db[_0x7f33('0x4a')][_0x7f33('0x27')]);_0x1a5380[_0x7f33('0x2d')]=_[_0x7f33('0x2e')](_0x552126[_0x7f33('0x2d')]);_0x1a5380[_0x7f33('0x2f')]=_[_0x7f33('0x30')](_0x1a5380[_0x7f33('0x2b')],_0x1a5380[_0x7f33('0x2d')]);_0x2b9449[_0x7f33('0x32')]=_['intersection'](_0x1a5380[_0x7f33('0x2b')],qs[_0x7f33('0x31')](_0x552126[_0x7f33('0x2d')][_0x7f33('0x31')]));_0x2b9449['attributes']=_0x2b9449[_0x7f33('0x32')][_0x7f33('0x33')]?_0x2b9449[_0x7f33('0x32')]:_0x1a5380[_0x7f33('0x2b')];_0x2b9449[_0x7f33('0x36')]=qs['sort'](_0x552126[_0x7f33('0x2d')][_0x7f33('0x37')]);_0x2b9449[_0x7f33('0x3a')]=qs[_0x7f33('0x2f')](_[_0x7f33('0x38')](_0x552126[_0x7f33('0x2d')],_0x1a5380['filters']));if(_0x552126['query'][_0x7f33('0x39')]){_0x2b9449[_0x7f33('0x3a')]=_[_0x7f33('0x3b')](_0x2b9449[_0x7f33('0x3a')],{'$or':_[_0x7f33('0x2c')](_0x2b9449[_0x7f33('0x32')],function(_0x2fdb0c){var _0x2d46ea={};_0x2d46ea[_0x2fdb0c]={'$like':'%'+_0x552126[_0x7f33('0x2d')][_0x7f33('0x39')]+'%'};return _0x2d46ea;})});}_0x2b9449=_[_0x7f33('0x3b')]({},_0x2b9449,_0x552126[_0x7f33('0x3d')]);return _0x2be467[_0x7f33('0x48')](_0x2b9449);}})[_0x7f33('0x22')](function(_0x5963bc){if(_0x5963bc){_0x3fc225=_0x5963bc['length'];if(!_0x552126[_0x7f33('0x2d')][_0x7f33('0x34')](_0x7f33('0x35'))){_0x2b9449['limit']=qs['limit'](_0x552126[_0x7f33('0x2d')][_0x7f33('0x1b')]);_0x2b9449[_0x7f33('0x19')]=qs['offset'](_0x552126[_0x7f33('0x2d')][_0x7f33('0x19')]);}return _0x2be467[_0x7f33('0x48')](_0x2b9449);}})[_0x7f33('0x22')](function(_0x3f5e49){if(_0x3f5e49){return _0x3f5e49?{'count':_0x3fc225,'rows':_0x3f5e49}:null;}})[_0x7f33('0x22')](respondWithResult(_0x55e54e,null))[_0x7f33('0x42')](handleError(_0x55e54e,null));};exports[_0x7f33('0x4b')]=function(_0x5361f5,_0x4270a3,_0x3616c9){var _0x5e4da1={};var _0x5a9ef7={};var _0x1688b4;var _0xdc7f16;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x5361f5[_0x7f33('0x44')]['id']}})[_0x7f33('0x22')](handleEntityNotFound(_0x4270a3,null))[_0x7f33('0x22')](function(_0x869d58){if(_0x869d58){_0x1688b4=_0x869d58;_0x5a9ef7['model']=_[_0x7f33('0x2e')](db[_0x7f33('0x4a')][_0x7f33('0x27')]);_0x5a9ef7[_0x7f33('0x2d')]=_['keys'](_0x5361f5['query']);_0x5a9ef7[_0x7f33('0x2f')]=_['intersection'](_0x5a9ef7[_0x7f33('0x2b')],_0x5a9ef7['query']);_0x5e4da1['attributes']=_[_0x7f33('0x30')](_0x5a9ef7['model'],qs[_0x7f33('0x31')](_0x5361f5[_0x7f33('0x2d')][_0x7f33('0x31')]));_0x5e4da1[_0x7f33('0x32')]=_0x5e4da1[_0x7f33('0x32')][_0x7f33('0x33')]?_0x5e4da1[_0x7f33('0x32')]:_0x5a9ef7[_0x7f33('0x2b')];_0x5e4da1[_0x7f33('0x36')]=qs['sort'](_0x5361f5['query']['sort']);_0x5e4da1[_0x7f33('0x3a')]=qs[_0x7f33('0x2f')](_[_0x7f33('0x38')](_0x5361f5[_0x7f33('0x2d')],_0x5a9ef7['filters']));if(_0x5361f5['query']['filter']){_0x5e4da1[_0x7f33('0x3a')]=_['merge'](_0x5e4da1[_0x7f33('0x3a')],{'$or':_[_0x7f33('0x2c')](_0x5e4da1[_0x7f33('0x32')],function(_0x121b24){var _0x11096f={};_0x11096f[_0x121b24]={'$like':'%'+_0x5361f5[_0x7f33('0x2d')][_0x7f33('0x39')]+'%'};return _0x11096f;})});}_0x5e4da1=_[_0x7f33('0x3b')]({},_0x5e4da1,_0x5361f5[_0x7f33('0x3d')]);return _0x1688b4[_0x7f33('0x4b')](_0x5e4da1);}})[_0x7f33('0x22')](function(_0xac50cc){if(_0xac50cc){_0xdc7f16=_0xac50cc[_0x7f33('0x33')];if(!_0x5361f5[_0x7f33('0x2d')][_0x7f33('0x34')](_0x7f33('0x35'))){_0x5e4da1[_0x7f33('0x1b')]=qs['limit'](_0x5361f5['query'][_0x7f33('0x1b')]);_0x5e4da1[_0x7f33('0x19')]=qs[_0x7f33('0x19')](_0x5361f5[_0x7f33('0x2d')][_0x7f33('0x19')]);}return _0x1688b4[_0x7f33('0x4b')](_0x5e4da1);}})[_0x7f33('0x22')](function(_0x1ace34){if(_0x1ace34){return _0x1ace34?{'count':_0xdc7f16,'rows':_0x1ace34}:null;}})[_0x7f33('0x22')](respondWithResult(_0x4270a3,null))[_0x7f33('0x42')](handleError(_0x4270a3,null));};exports[_0x7f33('0x4c')]=function(_0x594f91,_0x22466e,_0x1cc46f){var _0x2d8947={};var _0x1c7a8f={};var _0x809a09;var _0x3ae171;return db[_0x7f33('0x3e')][_0x7f33('0x49')]({'where':{'id':_0x594f91['params']['id']}})['then'](handleEntityNotFound(_0x22466e,null))[_0x7f33('0x22')](function(_0x127aaf){if(_0x127aaf){_0x809a09=_0x127aaf;_0x1c7a8f[_0x7f33('0x2b')]=_[_0x7f33('0x2e')](db[_0x7f33('0x4a')][_0x7f33('0x27')]);_0x1c7a8f['query']=_[_0x7f33('0x2e')](_0x594f91['query']);_0x1c7a8f[_0x7f33('0x2f')]=_[_0x7f33('0x30')](_0x1c7a8f[_0x7f33('0x2b')],_0x1c7a8f[_0x7f33('0x2d')]);_0x2d8947[_0x7f33('0x32')]=_[_0x7f33('0x30')](_0x1c7a8f[_0x7f33('0x2b')],qs[_0x7f33('0x31')](_0x594f91[_0x7f33('0x2d')][_0x7f33('0x31')]));_0x2d8947[_0x7f33('0x32')]=_0x2d8947[_0x7f33('0x32')]['length']?_0x2d8947[_0x7f33('0x32')]:_0x1c7a8f['model'];_0x2d8947[_0x7f33('0x36')]=qs[_0x7f33('0x37')](_0x594f91[_0x7f33('0x2d')][_0x7f33('0x37')]);_0x2d8947[_0x7f33('0x3a')]=qs['filters'](_['pick'](_0x594f91[_0x7f33('0x2d')],_0x1c7a8f['filters']));if(_0x594f91[_0x7f33('0x2d')][_0x7f33('0x39')]){_0x2d8947['where']=_[_0x7f33('0x3b')](_0x2d8947['where'],{'$or':_[_0x7f33('0x2c')](_0x2d8947[_0x7f33('0x32')],function(_0x539407){var _0x12b047={};_0x12b047[_0x539407]={'$like':'%'+_0x594f91[_0x7f33('0x2d')][_0x7f33('0x39')]+'%'};return _0x12b047;})});}_0x2d8947=_[_0x7f33('0x3b')]({},_0x2d8947,_0x594f91['options']);return _0x809a09[_0x7f33('0x4c')](_0x2d8947);}})[_0x7f33('0x22')](function(_0xb6dfe6){if(_0xb6dfe6){_0x3ae171=_0xb6dfe6['length'];if(!_0x594f91[_0x7f33('0x2d')][_0x7f33('0x34')](_0x7f33('0x35'))){_0x2d8947[_0x7f33('0x1b')]=qs['limit'](_0x594f91[_0x7f33('0x2d')]['limit']);_0x2d8947['offset']=qs[_0x7f33('0x19')](_0x594f91['query'][_0x7f33('0x19')]);}return _0x809a09[_0x7f33('0x4c')](_0x2d8947);}})[_0x7f33('0x22')](function(_0x18e7e2){if(_0x18e7e2){return _0x18e7e2?{'count':_0x3ae171,'rows':_0x18e7e2}:null;}})[_0x7f33('0x22')](respondWithResult(_0x22466e,null))[_0x7f33('0x42')](handleError(_0x22466e,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 71db3e9..00ba702 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f8e=['path','rimraf','../../config/environment','exports','define','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x208505,_0x241a77){var _0x1a985f=function(_0x4a5110){while(--_0x4a5110){_0x208505['push'](_0x208505['shift']());}};_0x1a985f(++_0x241a77);}(_0x2f8e,0x117));var _0xe2f8=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2f8e[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xe2f8('0x0'));var util=require(_0xe2f8('0x1'));var logger=require(_0xe2f8('0x2'))(_0xe2f8('0x3'));var moment=require(_0xe2f8('0x4'));var BPromise=require(_0xe2f8('0x5'));var rp=require(_0xe2f8('0x6'));var fs=require('fs');var path=require(_0xe2f8('0x7'));var rimraf=require(_0xe2f8('0x8'));var config=require(_0xe2f8('0x9'));var attributes=require('./intVtigerConfiguration.attributes');module[_0xe2f8('0xa')]=function(_0x2f5cdf,_0xeb07ac){return _0x2f5cdf[_0xe2f8('0xb')]('VtigerConfiguration',attributes,{'tableName':_0xe2f8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2772=['VtigerConfiguration','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2772,0xd2));var _0x2277=function(_0x44c8a7,_0x532f17){_0x44c8a7=_0x44c8a7-0x0;var _0x15e789=_0x2772[_0x44c8a7];return _0x15e789;};'use strict';var _=require(_0x2277('0x0'));var util=require(_0x2277('0x1'));var logger=require(_0x2277('0x2'))(_0x2277('0x3'));var moment=require(_0x2277('0x4'));var BPromise=require('bluebird');var rp=require(_0x2277('0x5'));var fs=require('fs');var path=require(_0x2277('0x6'));var rimraf=require(_0x2277('0x7'));var config=require(_0x2277('0x8'));var attributes=require(_0x2277('0x9'));module['exports']=function(_0x2895fa,_0x16f588){return _0x2895fa['define'](_0x2277('0xa'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 4a98a16..14382cc 100644 --- a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js +++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x894a=['stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5ca6b7,_0x1a4f32){var _0x2d7743=function(_0x569d42){while(--_0x569d42){_0x5ca6b7['push'](_0x5ca6b7['shift']());}};_0x2d7743(++_0x1a4f32);}(_0x894a,0x8d));var _0xa894=function(_0x4bf762,_0x37b8f0){_0x4bf762=_0x4bf762-0x0;var _0x1613c7=_0x894a[_0x4bf762];return _0x1613c7;};'use strict';var _=require('lodash');var util=require(_0xa894('0x0'));var moment=require(_0xa894('0x1'));var BPromise=require(_0xa894('0x2'));var rs=require(_0xa894('0x3'));var fs=require('fs');var Redis=require(_0xa894('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa894('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa894('0x6'));var client=jayson[_0xa894('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34b812,_0x459dce,_0x49c6b8){return new BPromise(function(_0x3dd7ec,_0x1ad04d){return client['request'](_0x34b812,_0x49c6b8)['then'](function(_0x954d69){logger[_0xa894('0x8')](_0xa894('0x9'),_0x459dce,_0xa894('0xa'));logger[_0xa894('0xb')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x459dce,_0xa894('0xa'),JSON[_0xa894('0xc')](_0x954d69));if(_0x954d69['error']){if(_0x954d69[_0xa894('0xd')][_0xa894('0xe')]===0x1f4){logger[_0xa894('0xd')](_0xa894('0x9'),_0x459dce,_0x954d69[_0xa894('0xd')]['message']);return _0x1ad04d(_0x954d69[_0xa894('0xd')]['message']);}logger[_0xa894('0xd')](_0xa894('0x9'),_0x459dce,_0x954d69[_0xa894('0xd')]['message']);return _0x3dd7ec(_0x954d69[_0xa894('0xd')][_0xa894('0xf')]);}else{logger[_0xa894('0x8')]('VtigerConfiguration,\x20%s,\x20%s',_0x459dce,_0xa894('0xa'));_0x3dd7ec(_0x954d69['result'][_0xa894('0xf')]);}})[_0xa894('0x10')](function(_0x3363e8){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x459dce,_0x3363e8);_0x1ad04d(_0x3363e8);});});} \ No newline at end of file +var _0x9f1b=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x7dbc21,_0x467594){var _0x47f389=function(_0x509473){while(--_0x509473){_0x7dbc21['push'](_0x7dbc21['shift']());}};_0x47f389(++_0x467594);}(_0x9f1b,0xc7));var _0xb9f1=function(_0x1a2c2a,_0x45c87d){_0x1a2c2a=_0x1a2c2a-0x0;var _0x1c38e8=_0x9f1b[_0x1a2c2a];return _0x1c38e8;};'use strict';var _=require(_0xb9f1('0x0'));var util=require(_0xb9f1('0x1'));var moment=require(_0xb9f1('0x2'));var BPromise=require(_0xb9f1('0x3'));var rs=require(_0xb9f1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9f1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb9f1('0x6'));var config=require('../../config/environment');var jayson=require(_0xb9f1('0x7'));var client=jayson['client'][_0xb9f1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x479b80,_0x127f5,_0x4bfc14){return new BPromise(function(_0x55ac8f,_0x2cb17b){return client[_0xb9f1('0x9')](_0x479b80,_0x4bfc14)[_0xb9f1('0xa')](function(_0x288653){logger[_0xb9f1('0xb')](_0xb9f1('0xc'),_0x127f5,_0xb9f1('0xd'));logger[_0xb9f1('0xe')](_0xb9f1('0xf'),_0x127f5,_0xb9f1('0xd'),JSON[_0xb9f1('0x10')](_0x288653));if(_0x288653['error']){if(_0x288653[_0xb9f1('0x11')][_0xb9f1('0x12')]===0x1f4){logger[_0xb9f1('0x11')](_0xb9f1('0xc'),_0x127f5,_0x288653[_0xb9f1('0x11')]['message']);return _0x2cb17b(_0x288653[_0xb9f1('0x11')]['message']);}logger[_0xb9f1('0x11')](_0xb9f1('0xc'),_0x127f5,_0x288653[_0xb9f1('0x11')][_0xb9f1('0x13')]);return _0x55ac8f(_0x288653[_0xb9f1('0x11')]['message']);}else{logger[_0xb9f1('0xb')](_0xb9f1('0xc'),_0x127f5,_0xb9f1('0xd'));_0x55ac8f(_0x288653[_0xb9f1('0x14')][_0xb9f1('0x13')]);}})[_0xb9f1('0x15')](function(_0x4fcd73){logger[_0xb9f1('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x127f5,_0x4fcd73);_0x2cb17b(_0x4fcd73);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index de2ee07..5b5398e 100644 --- a/server/api/intVtigerField/index.js +++ b/server/api/intVtigerField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a45=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','update','delete'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6a45,0x144));var _0x56a4=function(_0x470970,_0x58db2a){_0x470970=_0x470970-0x0;var _0x3fcaae=_0x6a45[_0x470970];return _0x3fcaae;};'use strict';var multer=require(_0x56a4('0x0'));var util=require(_0x56a4('0x1'));var path=require(_0x56a4('0x2'));var timeout=require(_0x56a4('0x3'));var express=require(_0x56a4('0x4'));var router=express[_0x56a4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x56a4('0x6'));var interaction=require(_0x56a4('0x7'));var config=require(_0x56a4('0x8'));var controller=require('./intVtigerField.controller');router[_0x56a4('0x9')]('/',auth['isAuthenticated'](),controller[_0x56a4('0xa')]);router[_0x56a4('0x9')](_0x56a4('0xb'),auth[_0x56a4('0xc')](),controller[_0x56a4('0xd')]);router[_0x56a4('0xe')]('/',auth[_0x56a4('0xc')](),controller[_0x56a4('0xf')]);router['put'](_0x56a4('0xb'),auth['isAuthenticated'](),controller[_0x56a4('0x10')]);router[_0x56a4('0x11')](_0x56a4('0xb'),auth[_0x56a4('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x873a=['./intVtigerField.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5061d5,_0x4ee6b0){var _0x508922=function(_0x47b09c){while(--_0x47b09c){_0x5061d5['push'](_0x5061d5['shift']());}};_0x508922(++_0x4ee6b0);}(_0x873a,0x108));var _0xa873=function(_0x120859,_0x13eee8){_0x120859=_0x120859-0x0;var _0x4b0d8b=_0x873a[_0x120859];return _0x4b0d8b;};'use strict';var multer=require(_0xa873('0x0'));var util=require(_0xa873('0x1'));var path=require(_0xa873('0x2'));var timeout=require(_0xa873('0x3'));var express=require(_0xa873('0x4'));var router=express[_0xa873('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa873('0x6'));var interaction=require(_0xa873('0x7'));var config=require(_0xa873('0x8'));var controller=require(_0xa873('0x9'));router[_0xa873('0xa')]('/',auth['isAuthenticated'](),controller[_0xa873('0xb')]);router[_0xa873('0xa')](_0xa873('0xc'),auth[_0xa873('0xd')](),controller[_0xa873('0xe')]);router[_0xa873('0xf')]('/',auth[_0xa873('0xd')](),controller[_0xa873('0x10')]);router[_0xa873('0x11')](_0xa873('0xc'),auth[_0xa873('0xd')](),controller['update']);router[_0xa873('0x12')](_0xa873('0xc'),auth[_0xa873('0xd')](),controller[_0xa873('0x13')]);module[_0xa873('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 06ea099..1d8fe43 100644 --- a/server/api/intVtigerField/intVtigerField.attributes.js +++ b/server/api/intVtigerField/intVtigerField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75d9=['keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x75d9,0x1bd));var _0x975d=function(_0x30faee,_0x1c3794){_0x30faee=_0x30faee-0x0;var _0x3a90ab=_0x75d9[_0x30faee];return _0x3a90ab;};'use strict';var Sequelize=require('sequelize');module[_0x975d('0x0')]={'type':{'type':Sequelize[_0x975d('0x1')](_0x975d('0x2'),_0x975d('0x3'),_0x975d('0x4'),_0x975d('0x5'),_0x975d('0x6')),'defaultValue':_0x975d('0x2')},'content':{'type':Sequelize[_0x975d('0x7')]},'key':{'type':Sequelize[_0x975d('0x7')]},'keyType':{'type':Sequelize[_0x975d('0x1')](_0x975d('0x2'),_0x975d('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x975d('0x7')]},'idField':{'type':Sequelize[_0x975d('0x7')]},'nameField':{'type':Sequelize[_0x975d('0x7')]},'customField':{'type':Sequelize[_0x975d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf714=['keyValue','picklist','string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x2b8ead,_0x4ac69b){var _0x2faa50=function(_0x18b467){while(--_0x18b467){_0x2b8ead['push'](_0x2b8ead['shift']());}};_0x2faa50(++_0x4ac69b);}(_0xf714,0x126));var _0x4f71=function(_0x33f62a,_0x524ab5){_0x33f62a=_0x33f62a-0x0;var _0x4f5bd8=_0xf714[_0x33f62a];return _0x4f5bd8;};'use strict';var Sequelize=require(_0x4f71('0x0'));module[_0x4f71('0x1')]={'type':{'type':Sequelize[_0x4f71('0x2')]('string','variable','customVariable',_0x4f71('0x3'),_0x4f71('0x4')),'defaultValue':_0x4f71('0x5')},'content':{'type':Sequelize[_0x4f71('0x6')]},'key':{'type':Sequelize[_0x4f71('0x6')]},'keyType':{'type':Sequelize[_0x4f71('0x2')](_0x4f71('0x5'),'variable',_0x4f71('0x7'))},'keyContent':{'type':Sequelize[_0x4f71('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4f71('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 55d4581..5c85e5c 100644 --- a/server/api/intVtigerField/intVtigerField.controller.js +++ b/server/api/intVtigerField/intVtigerField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x612f=['squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','then','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra'];(function(_0x403ce1,_0xc1b506){var _0x223831=function(_0x4e5f95){while(--_0x4e5f95){_0x403ce1['push'](_0x403ce1['shift']());}};_0x223831(++_0xc1b506);}(_0x612f,0x19f));var _0xf612=function(_0x45df64,_0x537b7f){_0x45df64=_0x45df64-0x0;var _0x4a0c99=_0x612f[_0x45df64];return _0x4a0c99;};'use strict';var emlformat=require(_0xf612('0x0'));var rimraf=require(_0xf612('0x1'));var zipdir=require(_0xf612('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf612('0x3'));var moment=require(_0xf612('0x4'));var BPromise=require(_0xf612('0x5'));var Mustache=require('mustache');var util=require(_0xf612('0x6'));var path=require(_0xf612('0x7'));var sox=require(_0xf612('0x8'));var csv=require(_0xf612('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf612('0xa'));var _=require('lodash');var squel=require(_0xf612('0xb'));var crypto=require(_0xf612('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf612('0x9'));var querystring=require(_0xf612('0xd'));var Papa=require('papaparse');var Redis=require(_0xf612('0xe'));var authService=require(_0xf612('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf612('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf612('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xf612('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xf612('0x13'))['db'];function respondWithStatusCode(_0x4b38ce,_0xbbe539){_0xbbe539=_0xbbe539||0xcc;return function(_0x393184){if(_0x393184){return _0x4b38ce[_0xf612('0x14')](_0xbbe539);}return _0x4b38ce[_0xf612('0x15')](_0xbbe539)[_0xf612('0x16')]();};}function respondWithResult(_0x224535,_0x1c6b1f){_0x1c6b1f=_0x1c6b1f||0xc8;return function(_0x4758fb){if(_0x4758fb){return _0x224535[_0xf612('0x15')](_0x1c6b1f)[_0xf612('0x17')](_0x4758fb);}};}function respondWithFilteredResult(_0x305c85,_0x34b6e0){return function(_0x2ead7f){if(_0x2ead7f){var _0x56c6e6=typeof _0x34b6e0[_0xf612('0x18')]==='undefined'&&typeof _0x34b6e0[_0xf612('0x19')]==='undefined';var _0x5399b9=_0x2ead7f[_0xf612('0x1a')];var _0x4d330a=_0x56c6e6?0x0:_0x34b6e0['offset'];var _0xf47b1d=_0x56c6e6?_0x2ead7f[_0xf612('0x1a')]:_0x34b6e0[_0xf612('0x18')]+_0x34b6e0['limit'];var _0x243ec1;if(_0xf47b1d>=_0x5399b9){_0xf47b1d=_0x5399b9;_0x243ec1=0xc8;}else{_0x243ec1=0xce;}_0x305c85[_0xf612('0x15')](_0x243ec1);return _0x305c85['set'](_0xf612('0x1b'),_0x4d330a+'-'+_0xf47b1d+'/'+_0x5399b9)[_0xf612('0x17')](_0x2ead7f);}return null;};}function patchUpdates(_0x401688){return function(_0x3a6162){try{jsonpatch[_0xf612('0x1c')](_0x3a6162,_0x401688,!![]);}catch(_0x4feeeb){return BPromise[_0xf612('0x1d')](_0x4feeeb);}return _0x3a6162['save']();};}function saveUpdates(_0x4b00b9,_0x3150e6){return function(_0x2b8de4){if(_0x2b8de4){return _0x2b8de4[_0xf612('0x1e')](_0x4b00b9)['then'](function(_0xf78433){return _0xf78433;});}return null;};}function removeEntity(_0x26e1bd,_0x24f6d9){return function(_0x138409){if(_0x138409){return _0x138409[_0xf612('0x1f')]()['then'](function(){_0x26e1bd[_0xf612('0x15')](0xcc)[_0xf612('0x16')]();});}};}function handleEntityNotFound(_0x478560,_0x3e9d9e){return function(_0x117d23){if(!_0x117d23){_0x478560['sendStatus'](0x194);}return _0x117d23;};}function handleError(_0x24f621,_0x449e5c){_0x449e5c=_0x449e5c||0x1f4;return function(_0x50aa00){logger[_0xf612('0x20')](_0x50aa00[_0xf612('0x21')]);if(_0x50aa00[_0xf612('0x22')]){delete _0x50aa00['name'];}_0x24f621[_0xf612('0x15')](_0x449e5c)[_0xf612('0x23')](_0x50aa00);};}exports[_0xf612('0x24')]=function(_0x203161,_0xdefdaa){var _0x1d8432={},_0x235bf4={},_0x2a772c={'count':0x0,'rows':[]};var _0x193a54=_[_0xf612('0x25')](db[_0xf612('0x26')][_0xf612('0x27')],function(_0x1a7062){return{'name':_0x1a7062[_0xf612('0x28')],'type':_0x1a7062[_0xf612('0x29')][_0xf612('0x2a')]};});_0x235bf4[_0xf612('0x2b')]=_[_0xf612('0x25')](_0x193a54,_0xf612('0x22'));_0x235bf4[_0xf612('0x2c')]=_['keys'](_0x203161[_0xf612('0x2c')]);_0x235bf4['filters']=_[_0xf612('0x2d')](_0x235bf4[_0xf612('0x2b')],_0x235bf4[_0xf612('0x2c')]);_0x1d8432['attributes']=_[_0xf612('0x2d')](_0x235bf4[_0xf612('0x2b')],qs[_0xf612('0x2e')](_0x203161[_0xf612('0x2c')]['fields']));_0x1d8432[_0xf612('0x2f')]=_0x1d8432['attributes'][_0xf612('0x30')]?_0x1d8432[_0xf612('0x2f')]:_0x235bf4[_0xf612('0x2b')];if(!_0x203161[_0xf612('0x2c')][_0xf612('0x31')]('nolimit')){_0x1d8432[_0xf612('0x19')]=qs[_0xf612('0x19')](_0x203161['query'][_0xf612('0x19')]);_0x1d8432[_0xf612('0x18')]=qs['offset'](_0x203161[_0xf612('0x2c')][_0xf612('0x18')]);}_0x1d8432[_0xf612('0x32')]=qs[_0xf612('0x33')](_0x203161['query'][_0xf612('0x33')]);_0x1d8432[_0xf612('0x34')]=qs[_0xf612('0x35')](_[_0xf612('0x36')](_0x203161['query'],_0x235bf4[_0xf612('0x35')]),_0x193a54);if(_0x203161[_0xf612('0x2c')]['filter']){_0x1d8432[_0xf612('0x34')]=_[_0xf612('0x37')](_0x1d8432[_0xf612('0x34')],{'$or':_[_0xf612('0x25')](_0x193a54,function(_0x3294ea){if(_0x3294ea[_0xf612('0x29')]!==_0xf612('0x38')){var _0x5f31e2={};_0x5f31e2[_0x3294ea[_0xf612('0x22')]]={'$like':'%'+_0x203161[_0xf612('0x2c')][_0xf612('0x39')]+'%'};return _0x5f31e2;}})});}_0x1d8432=_['merge']({},_0x1d8432,_0x203161[_0xf612('0x3a')]);var _0x5cc17a={'where':_0x1d8432['where']};return db[_0xf612('0x26')][_0xf612('0x1a')](_0x5cc17a)['then'](function(_0x5af55b){_0x2a772c[_0xf612('0x1a')]=_0x5af55b;if(_0x203161['query'][_0xf612('0x3b')]){_0x1d8432[_0xf612('0x3c')]=[{'all':!![]}];}return db[_0xf612('0x26')][_0xf612('0x3d')](_0x1d8432);})[_0xf612('0x3e')](function(_0x16ef22){_0x2a772c[_0xf612('0x3f')]=_0x16ef22;return _0x2a772c;})[_0xf612('0x3e')](respondWithFilteredResult(_0xdefdaa,_0x1d8432))[_0xf612('0x40')](handleError(_0xdefdaa,null));};exports[_0xf612('0x41')]=function(_0xcc1075,_0x768a1d){var _0x4c7d76={'raw':!![],'where':{'id':_0xcc1075[_0xf612('0x42')]['id']}},_0x4a1f26={};_0x4a1f26[_0xf612('0x2b')]=_[_0xf612('0x43')](db[_0xf612('0x26')][_0xf612('0x27')]);_0x4a1f26[_0xf612('0x2c')]=_[_0xf612('0x43')](_0xcc1075[_0xf612('0x2c')]);_0x4a1f26['filters']=_[_0xf612('0x2d')](_0x4a1f26[_0xf612('0x2b')],_0x4a1f26[_0xf612('0x2c')]);_0x4c7d76[_0xf612('0x2f')]=_[_0xf612('0x2d')](_0x4a1f26[_0xf612('0x2b')],qs['fields'](_0xcc1075[_0xf612('0x2c')][_0xf612('0x2e')]));_0x4c7d76[_0xf612('0x2f')]=_0x4c7d76[_0xf612('0x2f')][_0xf612('0x30')]?_0x4c7d76[_0xf612('0x2f')]:_0x4a1f26['model'];if(_0xcc1075[_0xf612('0x2c')]['includeAll']){_0x4c7d76[_0xf612('0x3c')]=[{'all':!![]}];}_0x4c7d76=_['merge']({},_0x4c7d76,_0xcc1075[_0xf612('0x3a')]);return db[_0xf612('0x26')][_0xf612('0x44')](_0x4c7d76)['then'](handleEntityNotFound(_0x768a1d,null))['then'](respondWithResult(_0x768a1d,null))[_0xf612('0x40')](handleError(_0x768a1d,null));};exports[_0xf612('0x45')]=function(_0x3b3009,_0x3bbda4){return db[_0xf612('0x26')][_0xf612('0x45')](_0x3b3009[_0xf612('0x46')],{})[_0xf612('0x3e')](respondWithResult(_0x3bbda4,0xc9))[_0xf612('0x40')](handleError(_0x3bbda4,null));};exports['update']=function(_0x5373b5,_0x2350ff){if(_0x5373b5['body']['id']){delete _0x5373b5[_0xf612('0x46')]['id'];}return db[_0xf612('0x26')][_0xf612('0x44')]({'where':{'id':_0x5373b5[_0xf612('0x42')]['id']}})[_0xf612('0x3e')](handleEntityNotFound(_0x2350ff,null))[_0xf612('0x3e')](saveUpdates(_0x5373b5['body'],null))['then'](respondWithResult(_0x2350ff,null))[_0xf612('0x40')](handleError(_0x2350ff,null));};exports[_0xf612('0x1f')]=function(_0x18ca6e,_0x1d7a9e){return db[_0xf612('0x26')][_0xf612('0x44')]({'where':{'id':_0x18ca6e[_0xf612('0x42')]['id']}})[_0xf612('0x3e')](handleEntityNotFound(_0x1d7a9e,null))[_0xf612('0x3e')](removeEntity(_0x1d7a9e,null))[_0xf612('0x40')](handleError(_0x1d7a9e,null));}; \ No newline at end of file +var _0xbfc4=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','then','end','error','stack','name','send','map','VtigerField','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','update','body','find','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x48b351,_0xb96838){var _0x2579c5=function(_0x1e1105){while(--_0x1e1105){_0x48b351['push'](_0x48b351['shift']());}};_0x2579c5(++_0xb96838);}(_0xbfc4,0x85));var _0x4bfc=function(_0x570d73,_0x1f0698){_0x570d73=_0x570d73-0x0;var _0x456a2b=_0xbfc4[_0x570d73];return _0x456a2b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4bfc('0x0'));var jsonpatch=require(_0x4bfc('0x1'));var rp=require(_0x4bfc('0x2'));var moment=require(_0x4bfc('0x3'));var BPromise=require(_0x4bfc('0x4'));var Mustache=require(_0x4bfc('0x5'));var util=require(_0x4bfc('0x6'));var path=require('path');var sox=require(_0x4bfc('0x7'));var csv=require(_0x4bfc('0x8'));var ejs=require(_0x4bfc('0x9'));var fs=require('fs');var fs_extra=require(_0x4bfc('0xa'));var _=require('lodash');var squel=require(_0x4bfc('0xb'));var crypto=require(_0x4bfc('0xc'));var jsforce=require(_0x4bfc('0xd'));var deskjs=require(_0x4bfc('0xe'));var toCsv=require(_0x4bfc('0x8'));var querystring=require(_0x4bfc('0xf'));var Papa=require(_0x4bfc('0x10'));var Redis=require(_0x4bfc('0x11'));var authService=require(_0x4bfc('0x12'));var qs=require(_0x4bfc('0x13'));var as=require(_0x4bfc('0x14'));var hardwareService=require(_0x4bfc('0x15'));var logger=require(_0x4bfc('0x16'))(_0x4bfc('0x17'));var utils=require('../../config/utils');var config=require(_0x4bfc('0x18'));var licenseUtil=require(_0x4bfc('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5560d2,_0x7a7d4){_0x7a7d4=_0x7a7d4||0xcc;return function(_0x311bcd){if(_0x311bcd){return _0x5560d2[_0x4bfc('0x1a')](_0x7a7d4);}return _0x5560d2[_0x4bfc('0x1b')](_0x7a7d4)['end']();};}function respondWithResult(_0x3e8965,_0x523b3d){_0x523b3d=_0x523b3d||0xc8;return function(_0xd2e35d){if(_0xd2e35d){return _0x3e8965['status'](_0x523b3d)[_0x4bfc('0x1c')](_0xd2e35d);}};}function respondWithFilteredResult(_0x5c92b9,_0x502126){return function(_0xadebfd){if(_0xadebfd){var _0x26246c=typeof _0x502126[_0x4bfc('0x1d')]===_0x4bfc('0x1e')&&typeof _0x502126[_0x4bfc('0x1f')]===_0x4bfc('0x1e');var _0x476d63=_0xadebfd[_0x4bfc('0x20')];var _0x363f0d=_0x26246c?0x0:_0x502126[_0x4bfc('0x1d')];var _0x106c09=_0x26246c?_0xadebfd['count']:_0x502126[_0x4bfc('0x1d')]+_0x502126['limit'];var _0x108022;if(_0x106c09>=_0x476d63){_0x106c09=_0x476d63;_0x108022=0xc8;}else{_0x108022=0xce;}_0x5c92b9[_0x4bfc('0x1b')](_0x108022);return _0x5c92b9['set'](_0x4bfc('0x21'),_0x363f0d+'-'+_0x106c09+'/'+_0x476d63)[_0x4bfc('0x1c')](_0xadebfd);}return null;};}function patchUpdates(_0x489cfd){return function(_0xcf66d6){try{jsonpatch[_0x4bfc('0x22')](_0xcf66d6,_0x489cfd,!![]);}catch(_0x1e45a8){return BPromise['reject'](_0x1e45a8);}return _0xcf66d6['save']();};}function saveUpdates(_0x4a619b,_0x350ece){return function(_0x1b6fc0){if(_0x1b6fc0){return _0x1b6fc0['update'](_0x4a619b)[_0x4bfc('0x23')](function(_0x338a93){return _0x338a93;});}return null;};}function removeEntity(_0xb30b9b,_0xbbf8a7){return function(_0x1a7e82){if(_0x1a7e82){return _0x1a7e82['destroy']()[_0x4bfc('0x23')](function(){_0xb30b9b[_0x4bfc('0x1b')](0xcc)[_0x4bfc('0x24')]();});}};}function handleEntityNotFound(_0x423572,_0x380fa3){return function(_0x1bfaa1){if(!_0x1bfaa1){_0x423572['sendStatus'](0x194);}return _0x1bfaa1;};}function handleError(_0x2000ac,_0x3e848e){_0x3e848e=_0x3e848e||0x1f4;return function(_0x337bda){logger[_0x4bfc('0x25')](_0x337bda[_0x4bfc('0x26')]);if(_0x337bda['name']){delete _0x337bda[_0x4bfc('0x27')];}_0x2000ac[_0x4bfc('0x1b')](_0x3e848e)[_0x4bfc('0x28')](_0x337bda);};}exports['index']=function(_0x289c1b,_0x7ed8fc){var _0x17a7e2={},_0x35367b={},_0x2d1440={'count':0x0,'rows':[]};var _0x28cf24=_[_0x4bfc('0x29')](db[_0x4bfc('0x2a')]['rawAttributes'],function(_0x255727){return{'name':_0x255727[_0x4bfc('0x2b')],'type':_0x255727[_0x4bfc('0x2c')]['key']};});_0x35367b['model']=_['map'](_0x28cf24,'name');_0x35367b[_0x4bfc('0x2d')]=_[_0x4bfc('0x2e')](_0x289c1b[_0x4bfc('0x2d')]);_0x35367b[_0x4bfc('0x2f')]=_[_0x4bfc('0x30')](_0x35367b[_0x4bfc('0x31')],_0x35367b['query']);_0x17a7e2['attributes']=_[_0x4bfc('0x30')](_0x35367b[_0x4bfc('0x31')],qs[_0x4bfc('0x32')](_0x289c1b[_0x4bfc('0x2d')][_0x4bfc('0x32')]));_0x17a7e2[_0x4bfc('0x33')]=_0x17a7e2['attributes'][_0x4bfc('0x34')]?_0x17a7e2[_0x4bfc('0x33')]:_0x35367b[_0x4bfc('0x31')];if(!_0x289c1b[_0x4bfc('0x2d')][_0x4bfc('0x35')](_0x4bfc('0x36'))){_0x17a7e2[_0x4bfc('0x1f')]=qs[_0x4bfc('0x1f')](_0x289c1b[_0x4bfc('0x2d')][_0x4bfc('0x1f')]);_0x17a7e2[_0x4bfc('0x1d')]=qs[_0x4bfc('0x1d')](_0x289c1b[_0x4bfc('0x2d')]['offset']);}_0x17a7e2[_0x4bfc('0x37')]=qs['sort'](_0x289c1b['query'][_0x4bfc('0x38')]);_0x17a7e2[_0x4bfc('0x39')]=qs[_0x4bfc('0x2f')](_['pick'](_0x289c1b[_0x4bfc('0x2d')],_0x35367b[_0x4bfc('0x2f')]),_0x28cf24);if(_0x289c1b[_0x4bfc('0x2d')][_0x4bfc('0x3a')]){_0x17a7e2['where']=_[_0x4bfc('0x3b')](_0x17a7e2[_0x4bfc('0x39')],{'$or':_[_0x4bfc('0x29')](_0x28cf24,function(_0x5c6c75){if(_0x5c6c75[_0x4bfc('0x2c')]!==_0x4bfc('0x3c')){var _0x5a6f15={};_0x5a6f15[_0x5c6c75[_0x4bfc('0x27')]]={'$like':'%'+_0x289c1b[_0x4bfc('0x2d')]['filter']+'%'};return _0x5a6f15;}})});}_0x17a7e2=_[_0x4bfc('0x3b')]({},_0x17a7e2,_0x289c1b[_0x4bfc('0x3d')]);var _0x4abd71={'where':_0x17a7e2[_0x4bfc('0x39')]};return db['VtigerField'][_0x4bfc('0x20')](_0x4abd71)['then'](function(_0x35ca2c){_0x2d1440[_0x4bfc('0x20')]=_0x35ca2c;if(_0x289c1b[_0x4bfc('0x2d')][_0x4bfc('0x3e')]){_0x17a7e2['include']=[{'all':!![]}];}return db[_0x4bfc('0x2a')][_0x4bfc('0x3f')](_0x17a7e2);})[_0x4bfc('0x23')](function(_0x475c41){_0x2d1440[_0x4bfc('0x40')]=_0x475c41;return _0x2d1440;})[_0x4bfc('0x23')](respondWithFilteredResult(_0x7ed8fc,_0x17a7e2))[_0x4bfc('0x41')](handleError(_0x7ed8fc,null));};exports[_0x4bfc('0x42')]=function(_0x6aa125,_0x4d09e0){var _0x8a09a4={'raw':!![],'where':{'id':_0x6aa125[_0x4bfc('0x43')]['id']}},_0x5dfe5e={};_0x5dfe5e[_0x4bfc('0x31')]=_[_0x4bfc('0x2e')](db['VtigerField'][_0x4bfc('0x44')]);_0x5dfe5e[_0x4bfc('0x2d')]=_['keys'](_0x6aa125['query']);_0x5dfe5e['filters']=_['intersection'](_0x5dfe5e[_0x4bfc('0x31')],_0x5dfe5e[_0x4bfc('0x2d')]);_0x8a09a4[_0x4bfc('0x33')]=_[_0x4bfc('0x30')](_0x5dfe5e['model'],qs['fields'](_0x6aa125[_0x4bfc('0x2d')][_0x4bfc('0x32')]));_0x8a09a4[_0x4bfc('0x33')]=_0x8a09a4[_0x4bfc('0x33')][_0x4bfc('0x34')]?_0x8a09a4[_0x4bfc('0x33')]:_0x5dfe5e['model'];if(_0x6aa125[_0x4bfc('0x2d')][_0x4bfc('0x3e')]){_0x8a09a4[_0x4bfc('0x45')]=[{'all':!![]}];}_0x8a09a4=_['merge']({},_0x8a09a4,_0x6aa125[_0x4bfc('0x3d')]);return db[_0x4bfc('0x2a')]['find'](_0x8a09a4)[_0x4bfc('0x23')](handleEntityNotFound(_0x4d09e0,null))[_0x4bfc('0x23')](respondWithResult(_0x4d09e0,null))[_0x4bfc('0x41')](handleError(_0x4d09e0,null));};exports['create']=function(_0x2b31cc,_0x4ed4f3){return db[_0x4bfc('0x2a')]['create'](_0x2b31cc['body'],{})[_0x4bfc('0x23')](respondWithResult(_0x4ed4f3,0xc9))[_0x4bfc('0x41')](handleError(_0x4ed4f3,null));};exports[_0x4bfc('0x46')]=function(_0x2efdbd,_0x26a527){if(_0x2efdbd['body']['id']){delete _0x2efdbd[_0x4bfc('0x47')]['id'];}return db['VtigerField'][_0x4bfc('0x48')]({'where':{'id':_0x2efdbd[_0x4bfc('0x43')]['id']}})[_0x4bfc('0x23')](handleEntityNotFound(_0x26a527,null))['then'](saveUpdates(_0x2efdbd[_0x4bfc('0x47')],null))[_0x4bfc('0x23')](respondWithResult(_0x26a527,null))[_0x4bfc('0x41')](handleError(_0x26a527,null));};exports[_0x4bfc('0x49')]=function(_0x1d41a8,_0x4027e3){return db['VtigerField'][_0x4bfc('0x48')]({'where':{'id':_0x1d41a8[_0x4bfc('0x43')]['id']}})[_0x4bfc('0x23')](handleEntityNotFound(_0x4027e3,null))[_0x4bfc('0x23')](removeEntity(_0x4027e3,null))['catch'](handleError(_0x4027e3,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 3508814..c771a1f 100644 --- a/server/api/intVtigerField/intVtigerField.model.js +++ b/server/api/intVtigerField/intVtigerField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9da6=['define','VtigerField','idField','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0x9da6,0xfa));var _0x69da=function(_0x30a25b,_0x11c54f){_0x30a25b=_0x30a25b-0x0;var _0xf5b527=_0x9da6[_0x30a25b];return _0xf5b527;};'use strict';var _=require(_0x69da('0x0'));var util=require(_0x69da('0x1'));var logger=require('../../config/logger')(_0x69da('0x2'));var moment=require(_0x69da('0x3'));var BPromise=require(_0x69da('0x4'));var rp=require(_0x69da('0x5'));var fs=require('fs');var path=require(_0x69da('0x6'));var rimraf=require(_0x69da('0x7'));var config=require(_0x69da('0x8'));var attributes=require('./intVtigerField.attributes');module[_0x69da('0x9')]=function(_0x3eb862,_0x248003){return _0x3eb862[_0x69da('0xa')](_0x69da('0xb'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x69da('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3ef9=['path','../../config/environment','exports','VtigerField','int_vtiger_fields','FieldId','lodash','util','moment','bluebird','request-promise'];(function(_0x44fc48,_0x59df02){var _0x384684=function(_0x5a881e){while(--_0x5a881e){_0x44fc48['push'](_0x44fc48['shift']());}};_0x384684(++_0x59df02);}(_0x3ef9,0xed));var _0x93ef=function(_0x418187,_0x44f9e6){_0x418187=_0x418187-0x0;var _0x3a821c=_0x3ef9[_0x418187];return _0x3a821c;};'use strict';var _=require(_0x93ef('0x0'));var util=require(_0x93ef('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x93ef('0x2'));var BPromise=require(_0x93ef('0x3'));var rp=require(_0x93ef('0x4'));var fs=require('fs');var path=require(_0x93ef('0x5'));var rimraf=require('rimraf');var config=require(_0x93ef('0x6'));var attributes=require('./intVtigerField.attributes');module[_0x93ef('0x7')]=function(_0x4006c5,_0x340066){return _0x4006c5['define'](_0x93ef('0x8'),attributes,{'tableName':_0x93ef('0x9'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0x93ef('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index bd2831f..075b814 100644 --- a/server/api/intVtigerField/intVtigerField.rpc.js +++ b/server/api/intVtigerField/intVtigerField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd1ab=['rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd1ab,0x101));var _0xbd1a=function(_0x156a4d,_0x2d89eb){_0x156a4d=_0x156a4d-0x0;var _0x1b94b9=_0xd1ab[_0x156a4d];return _0x1b94b9;};'use strict';var _=require(_0xbd1a('0x0'));var util=require(_0xbd1a('0x1'));var moment=require(_0xbd1a('0x2'));var BPromise=require('bluebird');var rs=require(_0xbd1a('0x3'));var fs=require('fs');var Redis=require(_0xbd1a('0x4'));var db=require(_0xbd1a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd1a('0x6'))(_0xbd1a('0x7'));var config=require(_0xbd1a('0x8'));var jayson=require(_0xbd1a('0x9'));var client=jayson[_0xbd1a('0xa')][_0xbd1a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a222e,_0x1bc0ea,_0x24d570){return new BPromise(function(_0x23055a,_0x26cefe){return client['request'](_0x3a222e,_0x24d570)[_0xbd1a('0xc')](function(_0x534b40){logger[_0xbd1a('0xd')](_0xbd1a('0xe'),_0x1bc0ea,_0xbd1a('0xf'));logger[_0xbd1a('0x10')](_0xbd1a('0x11'),_0x1bc0ea,_0xbd1a('0xf'),JSON[_0xbd1a('0x12')](_0x534b40));if(_0x534b40[_0xbd1a('0x13')]){if(_0x534b40[_0xbd1a('0x13')][_0xbd1a('0x14')]===0x1f4){logger[_0xbd1a('0x13')](_0xbd1a('0xe'),_0x1bc0ea,_0x534b40['error'][_0xbd1a('0x15')]);return _0x26cefe(_0x534b40[_0xbd1a('0x13')][_0xbd1a('0x15')]);}logger[_0xbd1a('0x13')](_0xbd1a('0xe'),_0x1bc0ea,_0x534b40[_0xbd1a('0x13')][_0xbd1a('0x15')]);return _0x23055a(_0x534b40['error']['message']);}else{logger[_0xbd1a('0xd')](_0xbd1a('0xe'),_0x1bc0ea,_0xbd1a('0xf'));_0x23055a(_0x534b40[_0xbd1a('0x16')][_0xbd1a('0x15')]);}})[_0xbd1a('0x17')](function(_0x54ccfb){logger[_0xbd1a('0x13')](_0xbd1a('0xe'),_0x1bc0ea,_0x54ccfb);_0x26cefe(_0x54ccfb);});});} \ No newline at end of file +var _0x57eb=['then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request'];(function(_0x5c9016,_0x3a1d03){var _0x5cb789=function(_0x3683b3){while(--_0x3683b3){_0x5c9016['push'](_0x5c9016['shift']());}};_0x5cb789(++_0x3a1d03);}(_0x57eb,0xf2));var _0xb57e=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x57eb[_0x34021d];return _0x16597b;};'use strict';var _=require('lodash');var util=require(_0xb57e('0x0'));var moment=require(_0xb57e('0x1'));var BPromise=require('bluebird');var rs=require(_0xb57e('0x2'));var fs=require('fs');var Redis=require(_0xb57e('0x3'));var db=require(_0xb57e('0x4'))['db'];var utils=require(_0xb57e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb57e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb57e('0x7')][_0xb57e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d0b12,_0x54c654,_0x45df59){return new BPromise(function(_0x5bbcaa,_0x22f749){return client[_0xb57e('0x9')](_0x5d0b12,_0x45df59)[_0xb57e('0xa')](function(_0x4cfa7a){logger[_0xb57e('0xb')](_0xb57e('0xc'),_0x54c654,_0xb57e('0xd'));logger[_0xb57e('0xe')](_0xb57e('0xf'),_0x54c654,_0xb57e('0xd'),JSON[_0xb57e('0x10')](_0x4cfa7a));if(_0x4cfa7a[_0xb57e('0x11')]){if(_0x4cfa7a[_0xb57e('0x11')]['code']===0x1f4){logger['error'](_0xb57e('0xc'),_0x54c654,_0x4cfa7a[_0xb57e('0x11')][_0xb57e('0x12')]);return _0x22f749(_0x4cfa7a['error'][_0xb57e('0x12')]);}logger['error'](_0xb57e('0xc'),_0x54c654,_0x4cfa7a[_0xb57e('0x11')][_0xb57e('0x12')]);return _0x5bbcaa(_0x4cfa7a['error']['message']);}else{logger[_0xb57e('0xb')]('VtigerField,\x20%s,\x20%s',_0x54c654,_0xb57e('0xd'));_0x5bbcaa(_0x4cfa7a[_0xb57e('0x13')]['message']);}})[_0xb57e('0x14')](function(_0x2abdd5){logger[_0xb57e('0x11')]('VtigerField,\x20%s,\x20%s',_0x54c654,_0x2abdd5);_0x22f749(_0x2abdd5);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 0781a84..efa5f4f 100644 --- a/server/api/intZendeskAccount/index.js +++ b/server/api/intZendeskAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6093=['util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','destroy','exports','multer'];(function(_0x2c7b86,_0x59ef3c){var _0x256735=function(_0x352e33){while(--_0x352e33){_0x2c7b86['push'](_0x2c7b86['shift']());}};_0x256735(++_0x59ef3c);}(_0x6093,0x107));var _0x3609=function(_0x4d38c5,_0x9a8222){_0x4d38c5=_0x4d38c5-0x0;var _0x349d9b=_0x6093[_0x4d38c5];return _0x349d9b;};'use strict';var multer=require(_0x3609('0x0'));var util=require(_0x3609('0x1'));var path=require(_0x3609('0x2'));var timeout=require(_0x3609('0x3'));var express=require(_0x3609('0x4'));var router=express[_0x3609('0x5')]();var fs_extra=require(_0x3609('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3609('0x7'));var controller=require(_0x3609('0x8'));router[_0x3609('0x9')]('/',auth[_0x3609('0xa')](),controller['index']);router[_0x3609('0x9')](_0x3609('0xb'),auth[_0x3609('0xa')](),controller['show']);router[_0x3609('0x9')](_0x3609('0xc'),auth[_0x3609('0xa')](),controller[_0x3609('0xd')]);router[_0x3609('0x9')](_0x3609('0xe'),auth['isAuthenticated'](),controller[_0x3609('0xf')]);router[_0x3609('0x10')]('/',auth[_0x3609('0xa')](),controller[_0x3609('0x11')]);router['post'](_0x3609('0xc'),auth[_0x3609('0xa')](),controller[_0x3609('0x12')]);router[_0x3609('0x13')](_0x3609('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x3609('0xb'),auth[_0x3609('0xa')](),controller[_0x3609('0x14')]);module[_0x3609('0x15')]=router; \ No newline at end of file +var _0x152b=['destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0x152b,0x182));var _0xb152=function(_0x21c6b8,_0x16d6f6){_0x21c6b8=_0x21c6b8-0x0;var _0x39d474=_0x152b[_0x21c6b8];return _0x39d474;};'use strict';var multer=require(_0xb152('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb152('0x1'));var express=require(_0xb152('0x2'));var router=express[_0xb152('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb152('0x4'));var interaction=require(_0xb152('0x5'));var config=require(_0xb152('0x6'));var controller=require(_0xb152('0x7'));router[_0xb152('0x8')]('/',auth[_0xb152('0x9')](),controller[_0xb152('0xa')]);router[_0xb152('0x8')](_0xb152('0xb'),auth[_0xb152('0x9')](),controller[_0xb152('0xc')]);router[_0xb152('0x8')]('/:id/configurations',auth[_0xb152('0x9')](),controller[_0xb152('0xd')]);router['get'](_0xb152('0xe'),auth[_0xb152('0x9')](),controller[_0xb152('0xf')]);router[_0xb152('0x10')]('/',auth[_0xb152('0x9')](),controller[_0xb152('0x11')]);router['post'](_0xb152('0x12'),auth[_0xb152('0x9')](),controller[_0xb152('0x13')]);router[_0xb152('0x14')](_0xb152('0xb'),auth[_0xb152('0x9')](),controller[_0xb152('0x15')]);router['delete'](_0xb152('0xb'),auth[_0xb152('0x9')](),controller[_0xb152('0x16')]);module[_0xb152('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 14a6957..b7d5c3f 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.attributes.js +++ b/server/api/intZendeskAccount/intZendeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba18=['sequelize','exports','STRING','username','remoteUri','ENUM','password','token','integrationTab','newTab'];(function(_0x1b983e,_0x47ab07){var _0x5c1e2d=function(_0x38c261){while(--_0x38c261){_0x1b983e['push'](_0x1b983e['shift']());}};_0x5c1e2d(++_0x47ab07);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8ba1('0x0'));module[_0x8ba1('0x1')]={'name':{'type':Sequelize[_0x8ba1('0x2')]},'description':{'type':Sequelize[_0x8ba1('0x2')]},'username':{'type':Sequelize[_0x8ba1('0x2')],'unique':_0x8ba1('0x3')},'password':{'type':Sequelize[_0x8ba1('0x2')]},'token':{'type':Sequelize[_0x8ba1('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8ba1('0x4')},'authType':{'type':Sequelize[_0x8ba1('0x5')](_0x8ba1('0x6'),_0x8ba1('0x7')),'defaultValue':_0x8ba1('0x6')},'serverUrl':{'type':Sequelize[_0x8ba1('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8ba1('0x8'),_0x8ba1('0x9')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x687b=['remoteUri','ENUM','password','token','newTab','integrationTab','sequelize','exports','STRING'];(function(_0x9b01d9,_0x4802b0){var _0x401588=function(_0x5d9b07){while(--_0x5d9b07){_0x9b01d9['push'](_0x9b01d9['shift']());}};_0x401588(++_0x4802b0);}(_0x687b,0x14a));var _0xb687=function(_0x42ce25,_0x7f11aa){_0x42ce25=_0x42ce25-0x0;var _0x14b4cd=_0x687b[_0x42ce25];return _0x14b4cd;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')]},'description':{'type':Sequelize[_0xb687('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xb687('0x2')]},'token':{'type':Sequelize[_0xb687('0x2')]},'remoteUri':{'type':Sequelize[_0xb687('0x2')],'unique':_0xb687('0x3')},'authType':{'type':Sequelize[_0xb687('0x4')](_0xb687('0x5'),_0xb687('0x6')),'defaultValue':_0xb687('0x5')},'serverUrl':{'type':Sequelize[_0xb687('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb687('0x4')]('integrationTab',_0xb687('0x7')),'defaultValue':_0xb687('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 2b328c1..c339edd 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.controller.js +++ b/server/api/intZendeskAccount/intZendeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02ce=['sendStatus','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','options','include','findAll','rows','catch','show','params','length','merge','find','create','body','ZendeskConfiguration','getConfigurations','addConfiguration','findOne','channel','getDescriptions','Subjects','ZendeskField','Descriptions','username','password','authType','remoteUri','GET','format','%s/%s','ticket_fields','headers','toString','base64','%s/token:%s','token','Sequelize','ValidationError','subject','description','group','assignee','remove','title','position','system_field_options','custom_field_options','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','offset','limit','undefined','count','set','reject','update','then','destroy'];(function(_0x1d8458,_0x113b11){var _0x381c19=function(_0x1fbce1){while(--_0x1fbce1){_0x1d8458['push'](_0x1d8458['shift']());}};_0x381c19(++_0x113b11);}(_0x02ce,0x1ac));var _0xe02c=function(_0x180152,_0x448d8c){_0x180152=_0x180152-0x0;var _0x1da90a=_0x02ce[_0x180152];return _0x1da90a;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];var integrations=require(_0xe02c('0x1c'));function respondWithStatusCode(_0x32fc45,_0x5d6d13){_0x5d6d13=_0x5d6d13||0xcc;return function(_0x43079c){if(_0x43079c){return _0x32fc45['sendStatus'](_0x5d6d13);}return _0x32fc45['status'](_0x5d6d13)[_0xe02c('0x1d')]();};}function respondWithResult(_0x56405a,_0x221910){_0x221910=_0x221910||0xc8;return function(_0x59614c){if(_0x59614c){return _0x56405a[_0xe02c('0x1e')](_0x221910)['json'](_0x59614c);}};}function respondWithFilteredResult(_0x256311,_0x366893){return function(_0x59f2f6){if(_0x59f2f6){var _0x10a2a6=typeof _0x366893[_0xe02c('0x1f')]==='undefined'&&typeof _0x366893[_0xe02c('0x20')]===_0xe02c('0x21');var _0x5a4583=_0x59f2f6['count'];var _0x3e37bf=_0x10a2a6?0x0:_0x366893['offset'];var _0x1f8f37=_0x10a2a6?_0x59f2f6[_0xe02c('0x22')]:_0x366893[_0xe02c('0x1f')]+_0x366893[_0xe02c('0x20')];var _0x3898dc;if(_0x1f8f37>=_0x5a4583){_0x1f8f37=_0x5a4583;_0x3898dc=0xc8;}else{_0x3898dc=0xce;}_0x256311['status'](_0x3898dc);return _0x256311[_0xe02c('0x23')]('Content-Range',_0x3e37bf+'-'+_0x1f8f37+'/'+_0x5a4583)['json'](_0x59f2f6);}return null;};}function patchUpdates(_0x393621){return function(_0x4514ac){try{jsonpatch['apply'](_0x4514ac,_0x393621,!![]);}catch(_0x3fe8f7){return BPromise[_0xe02c('0x24')](_0x3fe8f7);}return _0x4514ac['save']();};}function saveUpdates(_0x38dce2,_0x45fd82){return function(_0x39b00c){if(_0x39b00c){return _0x39b00c[_0xe02c('0x25')](_0x38dce2)[_0xe02c('0x26')](function(_0x557142){return _0x557142;});}return null;};}function removeEntity(_0x3e80e3,_0xf41d4c){return function(_0xeae877){if(_0xeae877){return _0xeae877[_0xe02c('0x27')]()[_0xe02c('0x26')](function(){_0x3e80e3['status'](0xcc)[_0xe02c('0x1d')]();});}};}function handleEntityNotFound(_0x4411d8,_0x3592ca){return function(_0x14ffba){if(!_0x14ffba){_0x4411d8[_0xe02c('0x28')](0x194);}return _0x14ffba;};}function handleError(_0x303d24,_0x43dc78){_0x43dc78=_0x43dc78||0x1f4;return function(_0x1c14d6){logger['error'](_0x1c14d6[_0xe02c('0x29')]);if(_0x1c14d6[_0xe02c('0x2a')]){delete _0x1c14d6[_0xe02c('0x2a')];}_0x303d24['status'](_0x43dc78)[_0xe02c('0x2b')](_0x1c14d6);};}exports[_0xe02c('0x2c')]=function(_0x445421,_0x287f7e){var _0x1e7eab={},_0x35a309={},_0x22a285={'count':0x0,'rows':[]};var _0x1b8f21=_[_0xe02c('0x2d')](db[_0xe02c('0x2e')][_0xe02c('0x2f')],function(_0x5a2da0){return{'name':_0x5a2da0[_0xe02c('0x30')],'type':_0x5a2da0[_0xe02c('0x31')][_0xe02c('0x32')]};});_0x35a309[_0xe02c('0x33')]=_[_0xe02c('0x2d')](_0x1b8f21,_0xe02c('0x2a'));_0x35a309['query']=_[_0xe02c('0x34')](_0x445421[_0xe02c('0x35')]);_0x35a309['filters']=_[_0xe02c('0x36')](_0x35a309[_0xe02c('0x33')],_0x35a309[_0xe02c('0x35')]);_0x1e7eab[_0xe02c('0x37')]=_[_0xe02c('0x36')](_0x35a309['model'],qs['fields'](_0x445421[_0xe02c('0x35')][_0xe02c('0x38')]));_0x1e7eab['attributes']=_0x1e7eab[_0xe02c('0x37')]['length']?_0x1e7eab[_0xe02c('0x37')]:_0x35a309[_0xe02c('0x33')];if(!_0x445421[_0xe02c('0x35')][_0xe02c('0x39')](_0xe02c('0x3a'))){_0x1e7eab['limit']=qs[_0xe02c('0x20')](_0x445421['query'][_0xe02c('0x20')]);_0x1e7eab[_0xe02c('0x1f')]=qs[_0xe02c('0x1f')](_0x445421[_0xe02c('0x35')][_0xe02c('0x1f')]);}_0x1e7eab[_0xe02c('0x3b')]=qs['sort'](_0x445421[_0xe02c('0x35')][_0xe02c('0x3c')]);_0x1e7eab['where']=qs[_0xe02c('0x3d')](_[_0xe02c('0x3e')](_0x445421['query'],_0x35a309[_0xe02c('0x3d')]),_0x1b8f21);if(_0x445421['query'][_0xe02c('0x3f')]){_0x1e7eab[_0xe02c('0x40')]=_['merge'](_0x1e7eab[_0xe02c('0x40')],{'$or':_[_0xe02c('0x2d')](_0x1b8f21,function(_0x2502c8){if(_0x2502c8[_0xe02c('0x31')]!==_0xe02c('0x41')){var _0x28922a={};_0x28922a[_0x2502c8['name']]={'$like':'%'+_0x445421[_0xe02c('0x35')]['filter']+'%'};return _0x28922a;}})});}_0x1e7eab=_['merge']({},_0x1e7eab,_0x445421[_0xe02c('0x42')]);var _0x1095fb={'where':_0x1e7eab[_0xe02c('0x40')]};return db[_0xe02c('0x2e')]['count'](_0x1095fb)[_0xe02c('0x26')](function(_0x17830e){_0x22a285[_0xe02c('0x22')]=_0x17830e;if(_0x445421['query']['includeAll']){_0x1e7eab[_0xe02c('0x43')]=[{'all':!![]}];}return db[_0xe02c('0x2e')][_0xe02c('0x44')](_0x1e7eab);})[_0xe02c('0x26')](function(_0x1b0876){_0x22a285[_0xe02c('0x45')]=_0x1b0876;return _0x22a285;})[_0xe02c('0x26')](respondWithFilteredResult(_0x287f7e,_0x1e7eab))[_0xe02c('0x46')](handleError(_0x287f7e,null));};exports[_0xe02c('0x47')]=function(_0x53d123,_0xc7e935){var _0x5ef4a1={'raw':![],'where':{'id':_0x53d123[_0xe02c('0x48')]['id']}},_0x4d4be5={};_0x4d4be5[_0xe02c('0x33')]=_[_0xe02c('0x34')](db[_0xe02c('0x2e')][_0xe02c('0x2f')]);_0x4d4be5[_0xe02c('0x35')]=_[_0xe02c('0x34')](_0x53d123[_0xe02c('0x35')]);_0x4d4be5['filters']=_['intersection'](_0x4d4be5[_0xe02c('0x33')],_0x4d4be5[_0xe02c('0x35')]);_0x5ef4a1[_0xe02c('0x37')]=_['intersection'](_0x4d4be5[_0xe02c('0x33')],qs[_0xe02c('0x38')](_0x53d123[_0xe02c('0x35')][_0xe02c('0x38')]));_0x5ef4a1[_0xe02c('0x37')]=_0x5ef4a1[_0xe02c('0x37')][_0xe02c('0x49')]?_0x5ef4a1[_0xe02c('0x37')]:_0x4d4be5[_0xe02c('0x33')];if(_0x53d123[_0xe02c('0x35')]['includeAll']){_0x5ef4a1[_0xe02c('0x43')]=[{'all':!![]}];}_0x5ef4a1=_[_0xe02c('0x4a')]({},_0x5ef4a1,_0x53d123[_0xe02c('0x42')]);return db[_0xe02c('0x2e')][_0xe02c('0x4b')](_0x5ef4a1)[_0xe02c('0x26')](handleEntityNotFound(_0xc7e935,null))[_0xe02c('0x26')](respondWithResult(_0xc7e935,null))[_0xe02c('0x46')](handleError(_0xc7e935,null));};exports[_0xe02c('0x4c')]=function(_0x1176c9,_0xfed475){return db[_0xe02c('0x2e')][_0xe02c('0x4c')](_0x1176c9['body'],{})[_0xe02c('0x26')](respondWithResult(_0xfed475,0xc9))['catch'](handleError(_0xfed475,null));};exports[_0xe02c('0x25')]=function(_0x324911,_0x45a6df){if(_0x324911[_0xe02c('0x4d')]['id']){delete _0x324911[_0xe02c('0x4d')]['id'];}return db[_0xe02c('0x2e')][_0xe02c('0x4b')]({'where':{'id':_0x324911[_0xe02c('0x48')]['id']}})[_0xe02c('0x26')](handleEntityNotFound(_0x45a6df,null))[_0xe02c('0x26')](saveUpdates(_0x324911['body'],null))[_0xe02c('0x26')](respondWithResult(_0x45a6df,null))[_0xe02c('0x46')](handleError(_0x45a6df,null));};exports[_0xe02c('0x27')]=function(_0x536cf7,_0xdab6cb){return db['ZendeskAccount'][_0xe02c('0x4b')]({'where':{'id':_0x536cf7['params']['id']}})['then'](handleEntityNotFound(_0xdab6cb,null))['then'](removeEntity(_0xdab6cb,null))['catch'](handleError(_0xdab6cb,null));};exports['getConfigurations']=function(_0x5740df,_0x107f3f,_0x3ac0a5){var _0x1510aa={};var _0x35fbe2={};var _0x5d963d;var _0x274beb;return db[_0xe02c('0x2e')]['findOne']({'where':{'id':_0x5740df[_0xe02c('0x48')]['id']}})[_0xe02c('0x26')](handleEntityNotFound(_0x107f3f,null))[_0xe02c('0x26')](function(_0x51f940){if(_0x51f940){_0x5d963d=_0x51f940;_0x35fbe2['model']=_[_0xe02c('0x34')](db[_0xe02c('0x4e')][_0xe02c('0x2f')]);_0x35fbe2['query']=_[_0xe02c('0x34')](_0x5740df['query']);_0x35fbe2['filters']=_[_0xe02c('0x36')](_0x35fbe2[_0xe02c('0x33')],_0x35fbe2['query']);_0x1510aa[_0xe02c('0x37')]=_[_0xe02c('0x36')](_0x35fbe2[_0xe02c('0x33')],qs['fields'](_0x5740df[_0xe02c('0x35')][_0xe02c('0x38')]));_0x1510aa['attributes']=_0x1510aa[_0xe02c('0x37')][_0xe02c('0x49')]?_0x1510aa[_0xe02c('0x37')]:_0x35fbe2[_0xe02c('0x33')];_0x1510aa[_0xe02c('0x3b')]=qs[_0xe02c('0x3c')](_0x5740df[_0xe02c('0x35')][_0xe02c('0x3c')]);_0x1510aa[_0xe02c('0x40')]=qs['filters'](_['pick'](_0x5740df['query'],_0x35fbe2[_0xe02c('0x3d')]));if(_0x5740df[_0xe02c('0x35')][_0xe02c('0x3f')]){_0x1510aa['where']=_['merge'](_0x1510aa[_0xe02c('0x40')],{'$or':_[_0xe02c('0x2d')](_0x1510aa[_0xe02c('0x37')],function(_0xb50cfa){var _0xe02798={};_0xe02798[_0xb50cfa]={'$like':'%'+_0x5740df['query'][_0xe02c('0x3f')]+'%'};return _0xe02798;})});}_0x1510aa=_[_0xe02c('0x4a')]({},_0x1510aa,_0x5740df['options']);return _0x5d963d['getConfigurations'](_0x1510aa);}})[_0xe02c('0x26')](function(_0x566204){if(_0x566204){_0x274beb=_0x566204['length'];if(!_0x5740df['query'][_0xe02c('0x39')](_0xe02c('0x3a'))){_0x1510aa[_0xe02c('0x20')]=qs[_0xe02c('0x20')](_0x5740df[_0xe02c('0x35')][_0xe02c('0x20')]);_0x1510aa['offset']=qs[_0xe02c('0x1f')](_0x5740df['query']['offset']);}return _0x5d963d[_0xe02c('0x4f')](_0x1510aa);}})[_0xe02c('0x26')](function(_0x44ba68){if(_0x44ba68){return _0x44ba68?{'count':_0x274beb,'rows':_0x44ba68}:null;}})[_0xe02c('0x26')](respondWithResult(_0x107f3f,null))['catch'](handleError(_0x107f3f,null));};exports[_0xe02c('0x50')]=function(_0x31c287,_0x5d2119,_0xa7133f){if(_0x31c287[_0xe02c('0x4d')]['id']){delete _0x31c287['body']['id'];}return db[_0xe02c('0x2e')][_0xe02c('0x51')]({'where':{'id':_0x31c287[_0xe02c('0x48')]['id']}})[_0xe02c('0x26')](handleEntityNotFound(_0x5d2119,null))[_0xe02c('0x26')](function(_0x3a62a2){if(_0x3a62a2){_0x31c287[_0xe02c('0x4d')]['AccountId']=_0x3a62a2['id'];_0x31c287[_0xe02c('0x4d')]['Subjects']=integrations['getSubjects'](_0x31c287['body'][_0xe02c('0x52')],_0x31c287[_0xe02c('0x4d')][_0xe02c('0x31')]);_0x31c287[_0xe02c('0x4d')]['Descriptions']=integrations[_0xe02c('0x53')](_0x31c287[_0xe02c('0x4d')]['channel'],_0x31c287['body']['type']);return db[_0xe02c('0x4e')][_0xe02c('0x4c')](_0x31c287['body'],{'include':[{'model':db['ZendeskField'],'as':_0xe02c('0x54')},{'model':db[_0xe02c('0x55')],'as':_0xe02c('0x56')}]});}return null;})[_0xe02c('0x26')](respondWithResult(_0x5d2119,null))[_0xe02c('0x46')](handleError(_0x5d2119,null));};exports['getFields']=function(_0x39c7db,_0x12ac9f,_0x3f277b){var _0x2776c0='';return db[_0xe02c('0x2e')][_0xe02c('0x51')]({'where':{'id':_0x39c7db['params']['id']},'attributes':['id',_0xe02c('0x57'),_0xe02c('0x58'),'token',_0xe02c('0x59'),_0xe02c('0x5a')]})[_0xe02c('0x26')](handleEntityNotFound(_0x12ac9f,null))[_0xe02c('0x26')](function(_0x5d2455){if(_0x5d2455){_0x2776c0=_0x5d2455[_0xe02c('0x5a')];var _0x2229ae=_0x2776c0['slice'](-0x1);if(_0x2229ae==='/'){_0x2776c0=_0x2776c0['substring'](0x0,_0x2776c0['lastIndexOf'](_0x2229ae));}var _0x43977c={'method':_0xe02c('0x5b'),'uri':util[_0xe02c('0x5c')](_0xe02c('0x5d'),_0x2776c0,_0xe02c('0x5e')),'json':!![]};switch(_0x5d2455['authType']){case _0xe02c('0x58'):_0x43977c[_0xe02c('0x5f')]={'Authorization':util[_0xe02c('0x5c')]('Basic\x20%s',new Buffer(util['format']('%s:%s',_0x5d2455[_0xe02c('0x57')],_0x5d2455[_0xe02c('0x58')]))[_0xe02c('0x60')](_0xe02c('0x61')))};break;case'token':_0x43977c[_0xe02c('0x5f')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xe02c('0x5c')](_0xe02c('0x62'),_0x5d2455[_0xe02c('0x57')],_0x5d2455[_0xe02c('0x63')]))[_0xe02c('0x60')](_0xe02c('0x61')))};break;default:throw new db[(_0xe02c('0x64'))][(_0xe02c('0x65'))]('Unknown\x20authentication\x20type');}return rp(_0x43977c);}})[_0xe02c('0x26')](function(_0x21049f){if(_0x21049f){var _0x2386cf=[_0xe02c('0x66'),_0xe02c('0x67'),_0xe02c('0x68'),_0xe02c('0x69')];_[_0xe02c('0x6a')](_0x21049f[_0xe02c('0x5e')],function(_0x411cd5){return _0x2386cf['includes'](_0x411cd5['type']);});return{'count':_0x21049f[_0xe02c('0x5e')][_0xe02c('0x49')],'rows':_[_0xe02c('0x2d')](_0x21049f[_0xe02c('0x5e')],function(_0x108566){return{'id':_0x108566['id'],'name':_0x108566['position']>0x7?_0x108566[_0xe02c('0x6b')]:_0x108566[_0xe02c('0x31')],'custom':_0x108566[_0xe02c('0x6c')]>0x7?!![]:![],'options':_0x108566[_0xe02c('0x6d')]?_0x108566[_0xe02c('0x6d')]:_0x108566[_0xe02c('0x6e')]?_0x108566[_0xe02c('0x6e')]:[]};})};}})[_0xe02c('0x26')](respondWithResult(_0x12ac9f,null))[_0xe02c('0x46')](function(_0x159f58){var _0x287eca=_0x39c7db[_0xe02c('0x35')]['test']?0x1f4:_0x159f58['statusCode']||0x1f4;logger[_0xe02c('0x6f')](_0xe02c('0x70'),'getFields',_0x287eca,JSON[_0xe02c('0x71')](_0x159f58));delete _0x159f58['name'];if(_0x287eca===0x191){_0x287eca=0x190;}_0x12ac9f[_0xe02c('0x1e')](_0x287eca)['send'](_0x39c7db[_0xe02c('0x35')][_0xe02c('0x72')]?{'message':_0xe02c('0x73'),'statusCode':_0x159f58[_0xe02c('0x74')]}:_0x159f58);});}; \ No newline at end of file +var _0x3de3=['token','%s/token:%s','base64','ValidationError','subject','description','assignee','includes','position','title','system_field_options','statusCode','stringify','test','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','json','offset','undefined','status','set','Content-Range','reject','update','destroy','then','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','create','body','find','params','getConfigurations','ZendeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Descriptions','channel','ZendeskField','Subjects','getFields','findOne','username','password','remoteUri','slice','substring','lastIndexOf','format','%s/%s','ticket_fields','authType','headers','%s:%s','toString'];(function(_0x355e2b,_0x1e99eb){var _0x2b59bb=function(_0x14f698){while(--_0x14f698){_0x355e2b['push'](_0x355e2b['shift']());}};_0x2b59bb(++_0x1e99eb);}(_0x3de3,0x1ce));var _0x33de=function(_0x5e8e35,_0x5689e4){_0x5e8e35=_0x5e8e35-0x0;var _0x122b3c=_0x3de3[_0x5e8e35];return _0x122b3c;};'use strict';var emlformat=require(_0x33de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x33de('0x1'));var jsonpatch=require(_0x33de('0x2'));var rp=require('request-promise');var moment=require(_0x33de('0x3'));var BPromise=require(_0x33de('0x4'));var Mustache=require(_0x33de('0x5'));var util=require(_0x33de('0x6'));var path=require('path');var sox=require(_0x33de('0x7'));var csv=require(_0x33de('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x33de('0x9'));var _=require('lodash');var squel=require(_0x33de('0xa'));var crypto=require(_0x33de('0xb'));var jsforce=require(_0x33de('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x33de('0x8'));var querystring=require(_0x33de('0xd'));var Papa=require(_0x33de('0xe'));var Redis=require('ioredis');var authService=require(_0x33de('0xf'));var qs=require(_0x33de('0x10'));var as=require(_0x33de('0x11'));var hardwareService=require(_0x33de('0x12'));var logger=require(_0x33de('0x13'))(_0x33de('0x14'));var utils=require(_0x33de('0x15'));var config=require(_0x33de('0x16'));var licenseUtil=require(_0x33de('0x17'));var db=require(_0x33de('0x18'))['db'];var integrations=require(_0x33de('0x19'));function respondWithStatusCode(_0x5170ad,_0x6b1a4c){_0x6b1a4c=_0x6b1a4c||0xcc;return function(_0x25d069){if(_0x25d069){return _0x5170ad['sendStatus'](_0x6b1a4c);}return _0x5170ad['status'](_0x6b1a4c)[_0x33de('0x1a')]();};}function respondWithResult(_0x22bda8,_0x2b3748){_0x2b3748=_0x2b3748||0xc8;return function(_0x57a2a1){if(_0x57a2a1){return _0x22bda8['status'](_0x2b3748)[_0x33de('0x1b')](_0x57a2a1);}};}function respondWithFilteredResult(_0x1b1166,_0x522ba0){return function(_0x4ff69f){if(_0x4ff69f){var _0x185849=typeof _0x522ba0[_0x33de('0x1c')]===_0x33de('0x1d')&&typeof _0x522ba0['limit']===_0x33de('0x1d');var _0x1203cf=_0x4ff69f['count'];var _0x2815a7=_0x185849?0x0:_0x522ba0[_0x33de('0x1c')];var _0x482667=_0x185849?_0x4ff69f['count']:_0x522ba0[_0x33de('0x1c')]+_0x522ba0['limit'];var _0x16255f;if(_0x482667>=_0x1203cf){_0x482667=_0x1203cf;_0x16255f=0xc8;}else{_0x16255f=0xce;}_0x1b1166[_0x33de('0x1e')](_0x16255f);return _0x1b1166[_0x33de('0x1f')](_0x33de('0x20'),_0x2815a7+'-'+_0x482667+'/'+_0x1203cf)[_0x33de('0x1b')](_0x4ff69f);}return null;};}function patchUpdates(_0x40a8e6){return function(_0x6cdc4f){try{jsonpatch['apply'](_0x6cdc4f,_0x40a8e6,!![]);}catch(_0x571086){return BPromise[_0x33de('0x21')](_0x571086);}return _0x6cdc4f['save']();};}function saveUpdates(_0x8acd8d,_0x4cd8db){return function(_0x28ed17){if(_0x28ed17){return _0x28ed17[_0x33de('0x22')](_0x8acd8d)['then'](function(_0x2dbcf2){return _0x2dbcf2;});}return null;};}function removeEntity(_0x5cd77e,_0x67d040){return function(_0x5c602d){if(_0x5c602d){return _0x5c602d[_0x33de('0x23')]()[_0x33de('0x24')](function(){_0x5cd77e[_0x33de('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bdba4,_0x2d206b){return function(_0x140979){if(!_0x140979){_0x3bdba4['sendStatus'](0x194);}return _0x140979;};}function handleError(_0x34fba3,_0x5585a2){_0x5585a2=_0x5585a2||0x1f4;return function(_0x566373){logger[_0x33de('0x25')](_0x566373[_0x33de('0x26')]);if(_0x566373[_0x33de('0x27')]){delete _0x566373[_0x33de('0x27')];}_0x34fba3[_0x33de('0x1e')](_0x5585a2)[_0x33de('0x28')](_0x566373);};}exports[_0x33de('0x29')]=function(_0x1b4703,_0x59bc3b){var _0x5ae0e8={},_0x2755e6={},_0x1420d2={'count':0x0,'rows':[]};var _0xaeaec5=_[_0x33de('0x2a')](db[_0x33de('0x2b')][_0x33de('0x2c')],function(_0x427e82){return{'name':_0x427e82['fieldName'],'type':_0x427e82[_0x33de('0x2d')][_0x33de('0x2e')]};});_0x2755e6[_0x33de('0x2f')]=_[_0x33de('0x2a')](_0xaeaec5,'name');_0x2755e6[_0x33de('0x30')]=_[_0x33de('0x31')](_0x1b4703['query']);_0x2755e6['filters']=_['intersection'](_0x2755e6[_0x33de('0x2f')],_0x2755e6[_0x33de('0x30')]);_0x5ae0e8['attributes']=_[_0x33de('0x32')](_0x2755e6['model'],qs['fields'](_0x1b4703[_0x33de('0x30')][_0x33de('0x33')]));_0x5ae0e8[_0x33de('0x34')]=_0x5ae0e8[_0x33de('0x34')][_0x33de('0x35')]?_0x5ae0e8[_0x33de('0x34')]:_0x2755e6[_0x33de('0x2f')];if(!_0x1b4703[_0x33de('0x30')]['hasOwnProperty'](_0x33de('0x36'))){_0x5ae0e8['limit']=qs[_0x33de('0x37')](_0x1b4703['query']['limit']);_0x5ae0e8[_0x33de('0x1c')]=qs[_0x33de('0x1c')](_0x1b4703[_0x33de('0x30')][_0x33de('0x1c')]);}_0x5ae0e8[_0x33de('0x38')]=qs[_0x33de('0x39')](_0x1b4703['query'][_0x33de('0x39')]);_0x5ae0e8[_0x33de('0x3a')]=qs[_0x33de('0x3b')](_[_0x33de('0x3c')](_0x1b4703[_0x33de('0x30')],_0x2755e6[_0x33de('0x3b')]),_0xaeaec5);if(_0x1b4703[_0x33de('0x30')]['filter']){_0x5ae0e8[_0x33de('0x3a')]=_[_0x33de('0x3d')](_0x5ae0e8[_0x33de('0x3a')],{'$or':_[_0x33de('0x2a')](_0xaeaec5,function(_0x46ddfe){if(_0x46ddfe[_0x33de('0x2d')]!==_0x33de('0x3e')){var _0x511691={};_0x511691[_0x46ddfe[_0x33de('0x27')]]={'$like':'%'+_0x1b4703[_0x33de('0x30')][_0x33de('0x3f')]+'%'};return _0x511691;}})});}_0x5ae0e8=_[_0x33de('0x3d')]({},_0x5ae0e8,_0x1b4703[_0x33de('0x40')]);var _0x640136={'where':_0x5ae0e8['where']};return db[_0x33de('0x2b')]['count'](_0x640136)[_0x33de('0x24')](function(_0x66897c){_0x1420d2['count']=_0x66897c;if(_0x1b4703[_0x33de('0x30')][_0x33de('0x41')]){_0x5ae0e8[_0x33de('0x42')]=[{'all':!![]}];}return db[_0x33de('0x2b')][_0x33de('0x43')](_0x5ae0e8);})[_0x33de('0x24')](function(_0x22518d){_0x1420d2[_0x33de('0x44')]=_0x22518d;return _0x1420d2;})[_0x33de('0x24')](respondWithFilteredResult(_0x59bc3b,_0x5ae0e8))['catch'](handleError(_0x59bc3b,null));};exports['show']=function(_0x417d9b,_0x1f75f7){var _0x20d04f={'raw':![],'where':{'id':_0x417d9b['params']['id']}},_0x376c55={};_0x376c55[_0x33de('0x2f')]=_['keys'](db['ZendeskAccount'][_0x33de('0x2c')]);_0x376c55[_0x33de('0x30')]=_[_0x33de('0x31')](_0x417d9b[_0x33de('0x30')]);_0x376c55[_0x33de('0x3b')]=_[_0x33de('0x32')](_0x376c55[_0x33de('0x2f')],_0x376c55['query']);_0x20d04f[_0x33de('0x34')]=_['intersection'](_0x376c55[_0x33de('0x2f')],qs['fields'](_0x417d9b[_0x33de('0x30')][_0x33de('0x33')]));_0x20d04f['attributes']=_0x20d04f[_0x33de('0x34')][_0x33de('0x35')]?_0x20d04f[_0x33de('0x34')]:_0x376c55['model'];if(_0x417d9b['query'][_0x33de('0x41')]){_0x20d04f[_0x33de('0x42')]=[{'all':!![]}];}_0x20d04f=_['merge']({},_0x20d04f,_0x417d9b['options']);return db[_0x33de('0x2b')]['find'](_0x20d04f)['then'](handleEntityNotFound(_0x1f75f7,null))['then'](respondWithResult(_0x1f75f7,null))[_0x33de('0x45')](handleError(_0x1f75f7,null));};exports[_0x33de('0x46')]=function(_0x9a816c,_0xce6079){return db['ZendeskAccount']['create'](_0x9a816c[_0x33de('0x47')],{})[_0x33de('0x24')](respondWithResult(_0xce6079,0xc9))['catch'](handleError(_0xce6079,null));};exports[_0x33de('0x22')]=function(_0xc23633,_0x23a5e7){if(_0xc23633[_0x33de('0x47')]['id']){delete _0xc23633[_0x33de('0x47')]['id'];}return db['ZendeskAccount'][_0x33de('0x48')]({'where':{'id':_0xc23633[_0x33de('0x49')]['id']}})['then'](handleEntityNotFound(_0x23a5e7,null))[_0x33de('0x24')](saveUpdates(_0xc23633[_0x33de('0x47')],null))[_0x33de('0x24')](respondWithResult(_0x23a5e7,null))[_0x33de('0x45')](handleError(_0x23a5e7,null));};exports[_0x33de('0x23')]=function(_0x40f1b7,_0x3d6424){return db[_0x33de('0x2b')][_0x33de('0x48')]({'where':{'id':_0x40f1b7[_0x33de('0x49')]['id']}})['then'](handleEntityNotFound(_0x3d6424,null))[_0x33de('0x24')](removeEntity(_0x3d6424,null))[_0x33de('0x45')](handleError(_0x3d6424,null));};exports[_0x33de('0x4a')]=function(_0x464502,_0xe6d59,_0x3fe65d){var _0x5c91e7={};var _0x49e1d9={};var _0x109ec5;var _0x32042e;return db[_0x33de('0x2b')]['findOne']({'where':{'id':_0x464502[_0x33de('0x49')]['id']}})[_0x33de('0x24')](handleEntityNotFound(_0xe6d59,null))[_0x33de('0x24')](function(_0x303f72){if(_0x303f72){_0x109ec5=_0x303f72;_0x49e1d9['model']=_['keys'](db[_0x33de('0x4b')][_0x33de('0x2c')]);_0x49e1d9[_0x33de('0x30')]=_[_0x33de('0x31')](_0x464502[_0x33de('0x30')]);_0x49e1d9['filters']=_['intersection'](_0x49e1d9[_0x33de('0x2f')],_0x49e1d9[_0x33de('0x30')]);_0x5c91e7[_0x33de('0x34')]=_[_0x33de('0x32')](_0x49e1d9[_0x33de('0x2f')],qs[_0x33de('0x33')](_0x464502[_0x33de('0x30')][_0x33de('0x33')]));_0x5c91e7[_0x33de('0x34')]=_0x5c91e7['attributes'][_0x33de('0x35')]?_0x5c91e7[_0x33de('0x34')]:_0x49e1d9[_0x33de('0x2f')];_0x5c91e7['order']=qs[_0x33de('0x39')](_0x464502['query']['sort']);_0x5c91e7['where']=qs['filters'](_[_0x33de('0x3c')](_0x464502[_0x33de('0x30')],_0x49e1d9['filters']));if(_0x464502[_0x33de('0x30')][_0x33de('0x3f')]){_0x5c91e7['where']=_[_0x33de('0x3d')](_0x5c91e7[_0x33de('0x3a')],{'$or':_['map'](_0x5c91e7[_0x33de('0x34')],function(_0x2bd687){var _0x277bb7={};_0x277bb7[_0x2bd687]={'$like':'%'+_0x464502[_0x33de('0x30')][_0x33de('0x3f')]+'%'};return _0x277bb7;})});}_0x5c91e7=_[_0x33de('0x3d')]({},_0x5c91e7,_0x464502[_0x33de('0x40')]);return _0x109ec5['getConfigurations'](_0x5c91e7);}})['then'](function(_0x409e2e){if(_0x409e2e){_0x32042e=_0x409e2e['length'];if(!_0x464502[_0x33de('0x30')][_0x33de('0x4c')]('nolimit')){_0x5c91e7[_0x33de('0x37')]=qs['limit'](_0x464502[_0x33de('0x30')][_0x33de('0x37')]);_0x5c91e7['offset']=qs['offset'](_0x464502[_0x33de('0x30')][_0x33de('0x1c')]);}return _0x109ec5[_0x33de('0x4a')](_0x5c91e7);}})[_0x33de('0x24')](function(_0x24d936){if(_0x24d936){return _0x24d936?{'count':_0x32042e,'rows':_0x24d936}:null;}})['then'](respondWithResult(_0xe6d59,null))[_0x33de('0x45')](handleError(_0xe6d59,null));};exports[_0x33de('0x4d')]=function(_0x5d4ffd,_0xa10291,_0x375bda){if(_0x5d4ffd['body']['id']){delete _0x5d4ffd[_0x33de('0x47')]['id'];}return db[_0x33de('0x2b')]['findOne']({'where':{'id':_0x5d4ffd['params']['id']}})[_0x33de('0x24')](handleEntityNotFound(_0xa10291,null))['then'](function(_0x31a511){if(_0x31a511){_0x5d4ffd['body'][_0x33de('0x4e')]=_0x31a511['id'];_0x5d4ffd['body']['Subjects']=integrations['getSubjects'](_0x5d4ffd['body']['channel'],_0x5d4ffd['body'][_0x33de('0x2d')]);_0x5d4ffd['body'][_0x33de('0x4f')]=integrations['getDescriptions'](_0x5d4ffd['body'][_0x33de('0x50')],_0x5d4ffd[_0x33de('0x47')][_0x33de('0x2d')]);return db[_0x33de('0x4b')][_0x33de('0x46')](_0x5d4ffd[_0x33de('0x47')],{'include':[{'model':db[_0x33de('0x51')],'as':_0x33de('0x52')},{'model':db['ZendeskField'],'as':_0x33de('0x4f')}]});}return null;})['then'](respondWithResult(_0xa10291,null))[_0x33de('0x45')](handleError(_0xa10291,null));};exports[_0x33de('0x53')]=function(_0x2cbf20,_0x3a8d6b,_0x8a9729){var _0x3f5d52='';return db[_0x33de('0x2b')][_0x33de('0x54')]({'where':{'id':_0x2cbf20[_0x33de('0x49')]['id']},'attributes':['id',_0x33de('0x55'),_0x33de('0x56'),'token','authType',_0x33de('0x57')]})[_0x33de('0x24')](handleEntityNotFound(_0x3a8d6b,null))[_0x33de('0x24')](function(_0xbf482f){if(_0xbf482f){_0x3f5d52=_0xbf482f[_0x33de('0x57')];var _0x21a3ec=_0x3f5d52[_0x33de('0x58')](-0x1);if(_0x21a3ec==='/'){_0x3f5d52=_0x3f5d52[_0x33de('0x59')](0x0,_0x3f5d52[_0x33de('0x5a')](_0x21a3ec));}var _0x39e8c9={'method':'GET','uri':util[_0x33de('0x5b')](_0x33de('0x5c'),_0x3f5d52,_0x33de('0x5d')),'json':!![]};switch(_0xbf482f[_0x33de('0x5e')]){case _0x33de('0x56'):_0x39e8c9[_0x33de('0x5f')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util['format'](_0x33de('0x60'),_0xbf482f[_0x33de('0x55')],_0xbf482f[_0x33de('0x56')]))[_0x33de('0x61')]('base64'))};break;case _0x33de('0x62'):_0x39e8c9[_0x33de('0x5f')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util['format'](_0x33de('0x63'),_0xbf482f[_0x33de('0x55')],_0xbf482f[_0x33de('0x62')]))[_0x33de('0x61')](_0x33de('0x64')))};break;default:throw new db['Sequelize'][(_0x33de('0x65'))]('Unknown\x20authentication\x20type');}return rp(_0x39e8c9);}})[_0x33de('0x24')](function(_0x20e8ce){if(_0x20e8ce){var _0x50587b=[_0x33de('0x66'),_0x33de('0x67'),'group',_0x33de('0x68')];_['remove'](_0x20e8ce['ticket_fields'],function(_0x2b6729){return _0x50587b[_0x33de('0x69')](_0x2b6729[_0x33de('0x2d')]);});return{'count':_0x20e8ce[_0x33de('0x5d')][_0x33de('0x35')],'rows':_['map'](_0x20e8ce[_0x33de('0x5d')],function(_0x3bda5e){return{'id':_0x3bda5e['id'],'name':_0x3bda5e[_0x33de('0x6a')]>0x7?_0x3bda5e[_0x33de('0x6b')]:_0x3bda5e['type'],'custom':_0x3bda5e[_0x33de('0x6a')]>0x7?!![]:![],'options':_0x3bda5e[_0x33de('0x6c')]?_0x3bda5e[_0x33de('0x6c')]:_0x3bda5e['custom_field_options']?_0x3bda5e['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x3a8d6b,null))['catch'](function(_0x5769f7){var _0x1f0e87=_0x2cbf20[_0x33de('0x30')]['test']?0x1f4:_0x5769f7[_0x33de('0x6d')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x33de('0x53'),_0x1f0e87,JSON[_0x33de('0x6e')](_0x5769f7));delete _0x5769f7['name'];if(_0x1f0e87===0x191){_0x1f0e87=0x190;}_0x3a8d6b[_0x33de('0x1e')](_0x1f0e87)[_0x33de('0x28')](_0x2cbf20['query'][_0x33de('0x6f')]?{'message':'Wrong\x20credentials','statusCode':_0x5769f7[_0x33de('0x6d')]}:_0x5769f7);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 8161cd4..9d033c7 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.model.js +++ b/server/api/intZendeskAccount/intZendeskAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4aa2=['ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../components/integrations/configuration','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4aa2,0x86));var _0x24aa=function(_0x2cc2c5,_0x53b1b1){_0x2cc2c5=_0x2cc2c5-0x0;var _0xf7f48f=_0x4aa2[_0x2cc2c5];return _0xf7f48f;};'use strict';var _=require(_0x24aa('0x0'));var util=require(_0x24aa('0x1'));var logger=require(_0x24aa('0x2'))(_0x24aa('0x3'));var moment=require(_0x24aa('0x4'));var BPromise=require('bluebird');var rp=require(_0x24aa('0x5'));var fs=require('fs');var path=require(_0x24aa('0x6'));var rimraf=require(_0x24aa('0x7'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x24aa('0x8'));module[_0x24aa('0x9')]=function(_0x43d5f9,_0x227bc9){return _0x43d5f9['define'](_0x24aa('0xa'),attributes,{'tableName':_0x24aa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadf6=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','./intZendeskAccount.attributes','exports','ZendeskAccount'];(function(_0x4fe762,_0x3a041e){var _0x31b316=function(_0x3c4730){while(--_0x3c4730){_0x4fe762['push'](_0x4fe762['shift']());}};_0x31b316(++_0x3a041e);}(_0xadf6,0x78));var _0x6adf=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xadf6[_0x934425];return _0x31d596;};'use strict';var _=require(_0x6adf('0x0'));var util=require(_0x6adf('0x1'));var logger=require(_0x6adf('0x2'))('api');var moment=require(_0x6adf('0x3'));var BPromise=require(_0x6adf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6adf('0x5'));var rimraf=require(_0x6adf('0x6'));var config=require('../../config/environment');var attributes=require(_0x6adf('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x6adf('0x8')]=function(_0x48d80d,_0x41fdf1){return _0x48d80d['define'](_0x6adf('0x9'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 5657c49..8632430 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.rpc.js +++ b/server/api/intZendeskAccount/intZendeskAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x88c4=['code','ZendeskAccount,\x20%s,\x20%s','message','catch','GetZendeskAccount','findAll','options','raw','attributes','limit','include','model','map','ShowZendeskAccount','ZendeskAccount','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x41e6c5,_0x53d228){var _0x39a1da=function(_0x307ac9){while(--_0x307ac9){_0x41e6c5['push'](_0x41e6c5['shift']());}};_0x39a1da(++_0x53d228);}(_0x88c4,0x14b));var _0x488c=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x88c4[_0xbf8ebe];return _0x1e25e8;};'use strict';var _=require(_0x488c('0x0'));var util=require('util');var moment=require(_0x488c('0x1'));var BPromise=require(_0x488c('0x2'));var rs=require(_0x488c('0x3'));var fs=require('fs');var Redis=require(_0x488c('0x4'));var db=require(_0x488c('0x5'))['db'];var utils=require(_0x488c('0x6'));var logger=require(_0x488c('0x7'))(_0x488c('0x8'));var config=require(_0x488c('0x9'));var jayson=require(_0x488c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x40e493,_0x5c86f2,_0x2e7c3b){return new BPromise(function(_0x32e6f6,_0x55e8f9){return client[_0x488c('0xb')](_0x40e493,_0x2e7c3b)[_0x488c('0xc')](function(_0x4f9ef3){logger[_0x488c('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x5c86f2,_0x488c('0xe'));logger[_0x488c('0xf')](_0x488c('0x10'),_0x5c86f2,_0x488c('0xe'),JSON[_0x488c('0x11')](_0x4f9ef3));if(_0x4f9ef3[_0x488c('0x12')]){if(_0x4f9ef3[_0x488c('0x12')][_0x488c('0x13')]===0x1f4){logger[_0x488c('0x12')](_0x488c('0x14'),_0x5c86f2,_0x4f9ef3[_0x488c('0x12')][_0x488c('0x15')]);return _0x55e8f9(_0x4f9ef3[_0x488c('0x12')][_0x488c('0x15')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x5c86f2,_0x4f9ef3[_0x488c('0x12')][_0x488c('0x15')]);return _0x32e6f6(_0x4f9ef3[_0x488c('0x12')][_0x488c('0x15')]);}else{logger[_0x488c('0xd')](_0x488c('0x14'),_0x5c86f2,'request\x20sent');_0x32e6f6(_0x4f9ef3['result'][_0x488c('0x15')]);}})[_0x488c('0x16')](function(_0xf45bbb){logger[_0x488c('0x12')](_0x488c('0x14'),_0x5c86f2,_0xf45bbb);_0x55e8f9(_0xf45bbb);});});}exports[_0x488c('0x17')]=function(_0x22ce75){var _0x16cae5=this;return new Promise(function(_0x2cd73e,_0x254b5d){return db['ZendeskAccount'][_0x488c('0x18')]({'raw':_0x22ce75[_0x488c('0x19')]?_0x22ce75[_0x488c('0x19')][_0x488c('0x1a')]===undefined?!![]:![]:!![],'where':_0x22ce75['options']?_0x22ce75[_0x488c('0x19')]['where']||null:null,'attributes':_0x22ce75['options']?_0x22ce75[_0x488c('0x19')][_0x488c('0x1b')]||null:null,'limit':_0x22ce75['options']?_0x22ce75[_0x488c('0x19')][_0x488c('0x1c')]||null:null,'include':_0x22ce75[_0x488c('0x19')]?_0x22ce75['options'][_0x488c('0x1d')]?_['map'](_0x22ce75[_0x488c('0x19')]['include'],function(_0x28d14d){return{'model':db[_0x28d14d[_0x488c('0x1e')]],'as':_0x28d14d['as'],'attributes':_0x28d14d[_0x488c('0x1b')],'include':_0x28d14d['include']?_['map'](_0x28d14d[_0x488c('0x1d')],function(_0x499cb7){return{'model':db[_0x499cb7[_0x488c('0x1e')]],'as':_0x499cb7['as'],'attributes':_0x499cb7['attributes'],'include':_0x499cb7[_0x488c('0x1d')]?_[_0x488c('0x1f')](_0x499cb7[_0x488c('0x1d')],function(_0x4baf3f){return{'model':db[_0x4baf3f[_0x488c('0x1e')]],'as':_0x4baf3f['as'],'attributes':_0x4baf3f['attributes']};}):[]};}):[]};}):[]:[]})[_0x488c('0xc')](function(_0xe7a2fa){logger['info'](_0x488c('0x17'),_0x22ce75);logger[_0x488c('0xf')]('GetZendeskAccount',_0x22ce75,JSON[_0x488c('0x11')](_0xe7a2fa));_0x2cd73e(_0xe7a2fa);})['catch'](function(_0x4172aa){logger[_0x488c('0x12')](_0x488c('0x17'),_0x4172aa[_0x488c('0x15')],_0x22ce75);_0x254b5d(_0x16cae5[_0x488c('0x12')](0x1f4,_0x4172aa[_0x488c('0x15')]));});});};exports[_0x488c('0x20')]=function(_0x19fbd0){var _0x5b12b0=this;return new Promise(function(_0x1240cf,_0xadded4){return db[_0x488c('0x21')]['find']({'raw':_0x19fbd0[_0x488c('0x19')]?_0x19fbd0[_0x488c('0x19')][_0x488c('0x1a')]===undefined?!![]:![]:!![],'where':_0x19fbd0[_0x488c('0x19')]?_0x19fbd0['options'][_0x488c('0x22')]||null:null,'attributes':_0x19fbd0[_0x488c('0x19')]?_0x19fbd0[_0x488c('0x19')][_0x488c('0x1b')]||null:null,'include':_0x19fbd0[_0x488c('0x19')]?_0x19fbd0[_0x488c('0x19')]['include']?_[_0x488c('0x1f')](_0x19fbd0['options'][_0x488c('0x1d')],function(_0x1835ea){return{'model':db[_0x1835ea['model']],'as':_0x1835ea['as'],'attributes':_0x1835ea[_0x488c('0x1b')],'include':_0x1835ea['include']?_[_0x488c('0x1f')](_0x1835ea[_0x488c('0x1d')],function(_0x182a98){return{'model':db[_0x182a98[_0x488c('0x1e')]],'as':_0x182a98['as'],'attributes':_0x182a98[_0x488c('0x1b')],'include':_0x182a98['include']?_[_0x488c('0x1f')](_0x182a98['include'],function(_0x515b3c){return{'model':db[_0x515b3c[_0x488c('0x1e')]],'as':_0x515b3c['as'],'attributes':_0x515b3c[_0x488c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x488c('0xc')](function(_0x3cde89){logger[_0x488c('0xd')](_0x488c('0x20'),_0x19fbd0);logger[_0x488c('0xf')]('ShowZendeskAccount',_0x19fbd0,JSON[_0x488c('0x11')](_0x3cde89));_0x1240cf(_0x3cde89);})[_0x488c('0x16')](function(_0x582a05){logger[_0x488c('0x12')](_0x488c('0x20'),_0x582a05[_0x488c('0x15')],_0x19fbd0);_0xadded4(_0x5b12b0[_0x488c('0x12')](0x1f4,_0x582a05[_0x488c('0x15')]));});});}; \ No newline at end of file +var _0x2fef=['info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','options','raw','where','limit','map','include','model','attributes','debug','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x2fef,0x1a3));var _0xf2fe=function(_0x13594e,_0x6f0ed0){_0x13594e=_0x13594e-0x0;var _0x1a4f42=_0x2fef[_0x13594e];return _0x1a4f42;};'use strict';var _=require(_0xf2fe('0x0'));var util=require(_0xf2fe('0x1'));var moment=require(_0xf2fe('0x2'));var BPromise=require(_0xf2fe('0x3'));var rs=require(_0xf2fe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf2fe('0x5'))['db'];var utils=require(_0xf2fe('0x6'));var logger=require('../../config/logger')(_0xf2fe('0x7'));var config=require(_0xf2fe('0x8'));var jayson=require(_0xf2fe('0x9'));var client=jayson['client'][_0xf2fe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c2c32,_0x45a329,_0x12f719){return new BPromise(function(_0x518159,_0x230c83){return client[_0xf2fe('0xb')](_0x3c2c32,_0x12f719)[_0xf2fe('0xc')](function(_0x25d7de){logger[_0xf2fe('0xd')](_0xf2fe('0xe'),_0x45a329,_0xf2fe('0xf'));logger['debug'](_0xf2fe('0x10'),_0x45a329,_0xf2fe('0xf'),JSON[_0xf2fe('0x11')](_0x25d7de));if(_0x25d7de[_0xf2fe('0x12')]){if(_0x25d7de[_0xf2fe('0x12')][_0xf2fe('0x13')]===0x1f4){logger[_0xf2fe('0x12')](_0xf2fe('0xe'),_0x45a329,_0x25d7de[_0xf2fe('0x12')][_0xf2fe('0x14')]);return _0x230c83(_0x25d7de[_0xf2fe('0x12')]['message']);}logger['error'](_0xf2fe('0xe'),_0x45a329,_0x25d7de[_0xf2fe('0x12')][_0xf2fe('0x14')]);return _0x518159(_0x25d7de[_0xf2fe('0x12')][_0xf2fe('0x14')]);}else{logger[_0xf2fe('0xd')](_0xf2fe('0xe'),_0x45a329,_0xf2fe('0xf'));_0x518159(_0x25d7de[_0xf2fe('0x15')]['message']);}})[_0xf2fe('0x16')](function(_0x54cae4){logger['error'](_0xf2fe('0xe'),_0x45a329,_0x54cae4);_0x230c83(_0x54cae4);});});}exports[_0xf2fe('0x17')]=function(_0x266e2e){var _0x136034=this;return new Promise(function(_0x2c9a43,_0x4a5ee8){return db[_0xf2fe('0x18')]['findAll']({'raw':_0x266e2e['options']?_0x266e2e[_0xf2fe('0x19')][_0xf2fe('0x1a')]===undefined?!![]:![]:!![],'where':_0x266e2e['options']?_0x266e2e[_0xf2fe('0x19')][_0xf2fe('0x1b')]||null:null,'attributes':_0x266e2e[_0xf2fe('0x19')]?_0x266e2e[_0xf2fe('0x19')]['attributes']||null:null,'limit':_0x266e2e[_0xf2fe('0x19')]?_0x266e2e[_0xf2fe('0x19')][_0xf2fe('0x1c')]||null:null,'include':_0x266e2e['options']?_0x266e2e[_0xf2fe('0x19')]['include']?_[_0xf2fe('0x1d')](_0x266e2e[_0xf2fe('0x19')][_0xf2fe('0x1e')],function(_0x4b4db3){return{'model':db[_0x4b4db3[_0xf2fe('0x1f')]],'as':_0x4b4db3['as'],'attributes':_0x4b4db3[_0xf2fe('0x20')],'include':_0x4b4db3[_0xf2fe('0x1e')]?_[_0xf2fe('0x1d')](_0x4b4db3[_0xf2fe('0x1e')],function(_0x321d9b){return{'model':db[_0x321d9b[_0xf2fe('0x1f')]],'as':_0x321d9b['as'],'attributes':_0x321d9b[_0xf2fe('0x20')],'include':_0x321d9b[_0xf2fe('0x1e')]?_[_0xf2fe('0x1d')](_0x321d9b[_0xf2fe('0x1e')],function(_0x133366){return{'model':db[_0x133366['model']],'as':_0x133366['as'],'attributes':_0x133366['attributes']};}):[]};}):[]};}):[]:[]})[_0xf2fe('0xc')](function(_0x1be55e){logger[_0xf2fe('0xd')](_0xf2fe('0x17'),_0x266e2e);logger[_0xf2fe('0x21')](_0xf2fe('0x17'),_0x266e2e,JSON['stringify'](_0x1be55e));_0x2c9a43(_0x1be55e);})[_0xf2fe('0x16')](function(_0x60fc19){logger[_0xf2fe('0x12')](_0xf2fe('0x17'),_0x60fc19[_0xf2fe('0x14')],_0x266e2e);_0x4a5ee8(_0x136034[_0xf2fe('0x12')](0x1f4,_0x60fc19[_0xf2fe('0x14')]));});});};exports[_0xf2fe('0x22')]=function(_0x3636d5){var _0x460793=this;return new Promise(function(_0x1c5a95,_0x46d1b0){return db[_0xf2fe('0x18')][_0xf2fe('0x23')]({'raw':_0x3636d5[_0xf2fe('0x19')]?_0x3636d5['options'][_0xf2fe('0x1a')]===undefined?!![]:![]:!![],'where':_0x3636d5[_0xf2fe('0x19')]?_0x3636d5[_0xf2fe('0x19')][_0xf2fe('0x1b')]||null:null,'attributes':_0x3636d5['options']?_0x3636d5[_0xf2fe('0x19')][_0xf2fe('0x20')]||null:null,'include':_0x3636d5[_0xf2fe('0x19')]?_0x3636d5[_0xf2fe('0x19')][_0xf2fe('0x1e')]?_[_0xf2fe('0x1d')](_0x3636d5[_0xf2fe('0x19')][_0xf2fe('0x1e')],function(_0x17b1de){return{'model':db[_0x17b1de['model']],'as':_0x17b1de['as'],'attributes':_0x17b1de[_0xf2fe('0x20')],'include':_0x17b1de[_0xf2fe('0x1e')]?_[_0xf2fe('0x1d')](_0x17b1de[_0xf2fe('0x1e')],function(_0x20e2f4){return{'model':db[_0x20e2f4[_0xf2fe('0x1f')]],'as':_0x20e2f4['as'],'attributes':_0x20e2f4['attributes'],'include':_0x20e2f4[_0xf2fe('0x1e')]?_[_0xf2fe('0x1d')](_0x20e2f4['include'],function(_0x46a1d3){return{'model':db[_0x46a1d3[_0xf2fe('0x1f')]],'as':_0x46a1d3['as'],'attributes':_0x46a1d3[_0xf2fe('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8836bf){logger[_0xf2fe('0xd')](_0xf2fe('0x22'),_0x3636d5);logger['debug'](_0xf2fe('0x22'),_0x3636d5,JSON['stringify'](_0x8836bf));_0x1c5a95(_0x8836bf);})[_0xf2fe('0x16')](function(_0xbd4b3a){logger[_0xf2fe('0x12')]('ShowZendeskAccount',_0xbd4b3a[_0xf2fe('0x14')],_0x3636d5);_0x46d1b0(_0x460793[_0xf2fe('0x12')](0x1f4,_0xbd4b3a[_0xf2fe('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 609fde9..d47526b 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x446381,_0x24e7be){var _0xb71b1a=function(_0x18056a){while(--_0x18056a){_0x446381['push'](_0x446381['shift']());}};_0xb71b1a(++_0x24e7be);}(_0xe706,0xa3));var _0x6e70=function(_0x4e3ee6,_0x1cac16){_0x4e3ee6=_0x4e3ee6-0x0;var _0x3a1887=_0xe706[_0x4e3ee6];return _0x3a1887;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0xa')](_0x6e70('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6e70('0xa')](_0x6e70('0x14'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x6e70('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6e70('0x19')]);router[_0x6e70('0x1a')]('/:id',auth[_0x6e70('0xb')](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0xe5b5=['../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x56e8e1,_0x41a4ad){var _0x1b9529=function(_0x67439){while(--_0x67439){_0x56e8e1['push'](_0x56e8e1['shift']());}};_0x1b9529(++_0x41a4ad);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xe5b5[_0x513aa5];return _0x1a1a7c;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0xb')](_0x5e5b('0x10'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0xb')]('/:id/subjects',auth[_0x5e5b('0xc')](),controller['getSubjects']);router[_0x5e5b('0xb')](_0x5e5b('0x12'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x13')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x5e5b('0x14')]);router[_0x5e5b('0x15')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x16')]);router[_0x5e5b('0x15')](_0x5e5b('0x17'),auth[_0x5e5b('0xc')](),controller['setTags']);router[_0x5e5b('0x18')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x19')]);router['delete']('/:id',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x1a')]);module[_0x5e5b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 2633ae4..f98342b 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa1d3=['STRING','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa1d3,0x18f));var _0x3a1d=function(_0x23f0e1,_0x11d94b){_0x23f0e1=_0x23f0e1-0x0;var _0x257f0d=_0xa1d3[_0x23f0e1];return _0x257f0d;};'use strict';var Sequelize=require('sequelize');module[_0x3a1d('0x0')]={'name':{'type':Sequelize[_0x3a1d('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa588=['sequelize','exports','STRING'];(function(_0x42b303,_0x553d0b){var _0x113500=function(_0x326484){while(--_0x326484){_0x42b303['push'](_0x42b303['shift']());}};_0x113500(++_0x553d0b);}(_0xa588,0x1ef));var _0x8a58=function(_0x27c156,_0x14ce9b){_0x27c156=_0x27c156-0x0;var _0x4a94af=_0xa588[_0x27c156];return _0x4a94af;};'use strict';var Sequelize=require(_0x8a58('0x0'));module[_0x8a58('0x1')]={'name':{'type':Sequelize[_0x8a58('0x2')]},'description':{'type':Sequelize[_0x8a58('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index d325f0d..d737b4f 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1dd2=['pick','merge','type','VIRTUAL','filter','includeAll','include','ZendeskConfiguration','findAll','catch','show','options','find','create','body','params','getFields','findOne','length','getSubjects','ZendeskField','getDescriptions','getTags','setTags','ids','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','key','keys','filters','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2e8abe,_0x3504a7){var _0x2838f9=function(_0x5581c2){while(--_0x5581c2){_0x2e8abe['push'](_0x2e8abe['shift']());}};_0x2838f9(++_0x3504a7);}(_0x1dd2,0x115));var _0x21dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dd2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x21dd('0x0'));var rimraf=require(_0x21dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x21dd('0x2'));var moment=require(_0x21dd('0x3'));var BPromise=require(_0x21dd('0x4'));var Mustache=require(_0x21dd('0x5'));var util=require(_0x21dd('0x6'));var path=require(_0x21dd('0x7'));var sox=require('sox');var csv=require(_0x21dd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x21dd('0x9'));var _=require('lodash');var squel=require(_0x21dd('0xa'));var crypto=require(_0x21dd('0xb'));var jsforce=require(_0x21dd('0xc'));var deskjs=require(_0x21dd('0xd'));var toCsv=require(_0x21dd('0x8'));var querystring=require(_0x21dd('0xe'));var Papa=require('papaparse');var Redis=require(_0x21dd('0xf'));var authService=require(_0x21dd('0x10'));var qs=require(_0x21dd('0x11'));var as=require(_0x21dd('0x12'));var hardwareService=require(_0x21dd('0x13'));var logger=require(_0x21dd('0x14'))(_0x21dd('0x15'));var utils=require(_0x21dd('0x16'));var config=require(_0x21dd('0x17'));var licenseUtil=require(_0x21dd('0x18'));var db=require(_0x21dd('0x19'))['db'];function respondWithStatusCode(_0xf729c3,_0x2f36be){_0x2f36be=_0x2f36be||0xcc;return function(_0x43ded4){if(_0x43ded4){return _0xf729c3[_0x21dd('0x1a')](_0x2f36be);}return _0xf729c3[_0x21dd('0x1b')](_0x2f36be)[_0x21dd('0x1c')]();};}function respondWithResult(_0x5f5c06,_0x4193b6){_0x4193b6=_0x4193b6||0xc8;return function(_0x339db7){if(_0x339db7){return _0x5f5c06[_0x21dd('0x1b')](_0x4193b6)['json'](_0x339db7);}};}function respondWithFilteredResult(_0x4de159,_0x4c3e05){return function(_0x2ba1a5){if(_0x2ba1a5){var _0xd40375=typeof _0x4c3e05[_0x21dd('0x1d')]===_0x21dd('0x1e')&&typeof _0x4c3e05[_0x21dd('0x1f')]===_0x21dd('0x1e');var _0x45d415=_0x2ba1a5[_0x21dd('0x20')];var _0x1fc6f5=_0xd40375?0x0:_0x4c3e05[_0x21dd('0x1d')];var _0x5065b8=_0xd40375?_0x2ba1a5[_0x21dd('0x20')]:_0x4c3e05['offset']+_0x4c3e05[_0x21dd('0x1f')];var _0x68f2ed;if(_0x5065b8>=_0x45d415){_0x5065b8=_0x45d415;_0x68f2ed=0xc8;}else{_0x68f2ed=0xce;}_0x4de159['status'](_0x68f2ed);return _0x4de159['set'](_0x21dd('0x21'),_0x1fc6f5+'-'+_0x5065b8+'/'+_0x45d415)[_0x21dd('0x22')](_0x2ba1a5);}return null;};}function patchUpdates(_0x16940c){return function(_0x1c041a){try{jsonpatch['apply'](_0x1c041a,_0x16940c,!![]);}catch(_0xf8158d){return BPromise[_0x21dd('0x23')](_0xf8158d);}return _0x1c041a[_0x21dd('0x24')]();};}function saveUpdates(_0x1674b6,_0xbcb5ff){return function(_0x396544){if(_0x396544){return _0x396544[_0x21dd('0x25')](_0x1674b6)[_0x21dd('0x26')](function(_0x2c56f6){return _0x2c56f6;});}return null;};}function removeEntity(_0xfda0c7,_0x1c16b8){return function(_0x4d4bf3){if(_0x4d4bf3){return _0x4d4bf3[_0x21dd('0x27')]()['then'](function(){_0xfda0c7[_0x21dd('0x1b')](0xcc)[_0x21dd('0x1c')]();});}};}function handleEntityNotFound(_0x3e9782,_0x1496cd){return function(_0x3b855f){if(!_0x3b855f){_0x3e9782[_0x21dd('0x1a')](0x194);}return _0x3b855f;};}function handleError(_0x558594,_0x35deb2){_0x35deb2=_0x35deb2||0x1f4;return function(_0x432872){logger[_0x21dd('0x28')](_0x432872['stack']);if(_0x432872['name']){delete _0x432872[_0x21dd('0x29')];}_0x558594[_0x21dd('0x1b')](_0x35deb2)['send'](_0x432872);};}exports[_0x21dd('0x2a')]=function(_0x57cf54,_0x154be2){var _0x41df05={},_0x1c4f4e={},_0x1b0c3d={'count':0x0,'rows':[]};var _0x56e252=_[_0x21dd('0x2b')](db['ZendeskConfiguration'][_0x21dd('0x2c')],function(_0x176ca3){return{'name':_0x176ca3[_0x21dd('0x2d')],'type':_0x176ca3['type'][_0x21dd('0x2e')]};});_0x1c4f4e['model']=_[_0x21dd('0x2b')](_0x56e252,_0x21dd('0x29'));_0x1c4f4e['query']=_[_0x21dd('0x2f')](_0x57cf54['query']);_0x1c4f4e[_0x21dd('0x30')]=_['intersection'](_0x1c4f4e[_0x21dd('0x31')],_0x1c4f4e[_0x21dd('0x32')]);_0x41df05[_0x21dd('0x33')]=_[_0x21dd('0x34')](_0x1c4f4e['model'],qs[_0x21dd('0x35')](_0x57cf54['query'][_0x21dd('0x35')]));_0x41df05[_0x21dd('0x33')]=_0x41df05[_0x21dd('0x33')]['length']?_0x41df05['attributes']:_0x1c4f4e[_0x21dd('0x31')];if(!_0x57cf54[_0x21dd('0x32')][_0x21dd('0x36')](_0x21dd('0x37'))){_0x41df05[_0x21dd('0x1f')]=qs['limit'](_0x57cf54[_0x21dd('0x32')]['limit']);_0x41df05[_0x21dd('0x1d')]=qs[_0x21dd('0x1d')](_0x57cf54[_0x21dd('0x32')][_0x21dd('0x1d')]);}_0x41df05[_0x21dd('0x38')]=qs['sort'](_0x57cf54[_0x21dd('0x32')][_0x21dd('0x39')]);_0x41df05[_0x21dd('0x3a')]=qs[_0x21dd('0x30')](_[_0x21dd('0x3b')](_0x57cf54['query'],_0x1c4f4e[_0x21dd('0x30')]),_0x56e252);if(_0x57cf54[_0x21dd('0x32')]['filter']){_0x41df05['where']=_[_0x21dd('0x3c')](_0x41df05['where'],{'$or':_['map'](_0x56e252,function(_0x562d17){if(_0x562d17[_0x21dd('0x3d')]!==_0x21dd('0x3e')){var _0x413556={};_0x413556[_0x562d17[_0x21dd('0x29')]]={'$like':'%'+_0x57cf54[_0x21dd('0x32')][_0x21dd('0x3f')]+'%'};return _0x413556;}})});}_0x41df05=_[_0x21dd('0x3c')]({},_0x41df05,_0x57cf54['options']);var _0x2e0020={'where':_0x41df05[_0x21dd('0x3a')]};return db['ZendeskConfiguration'][_0x21dd('0x20')](_0x2e0020)[_0x21dd('0x26')](function(_0xa04c02){_0x1b0c3d[_0x21dd('0x20')]=_0xa04c02;if(_0x57cf54[_0x21dd('0x32')][_0x21dd('0x40')]){_0x41df05[_0x21dd('0x41')]=[{'all':!![]}];}return db[_0x21dd('0x42')][_0x21dd('0x43')](_0x41df05);})[_0x21dd('0x26')](function(_0x3acecd){_0x1b0c3d['rows']=_0x3acecd;return _0x1b0c3d;})[_0x21dd('0x26')](respondWithFilteredResult(_0x154be2,_0x41df05))[_0x21dd('0x44')](handleError(_0x154be2,null));};exports[_0x21dd('0x45')]=function(_0x56082a,_0x382e4a){var _0x4a543e={'raw':![],'where':{'id':_0x56082a['params']['id']}},_0x1ec7a3={};_0x1ec7a3['model']=_[_0x21dd('0x2f')](db[_0x21dd('0x42')][_0x21dd('0x2c')]);_0x1ec7a3[_0x21dd('0x32')]=_[_0x21dd('0x2f')](_0x56082a[_0x21dd('0x32')]);_0x1ec7a3['filters']=_[_0x21dd('0x34')](_0x1ec7a3[_0x21dd('0x31')],_0x1ec7a3['query']);_0x4a543e['attributes']=_[_0x21dd('0x34')](_0x1ec7a3[_0x21dd('0x31')],qs[_0x21dd('0x35')](_0x56082a['query'][_0x21dd('0x35')]));_0x4a543e[_0x21dd('0x33')]=_0x4a543e['attributes']['length']?_0x4a543e['attributes']:_0x1ec7a3[_0x21dd('0x31')];if(_0x56082a[_0x21dd('0x32')][_0x21dd('0x40')]){_0x4a543e[_0x21dd('0x41')]=[{'all':!![]}];}_0x4a543e=_[_0x21dd('0x3c')]({},_0x4a543e,_0x56082a[_0x21dd('0x46')]);return db[_0x21dd('0x42')][_0x21dd('0x47')](_0x4a543e)[_0x21dd('0x26')](handleEntityNotFound(_0x382e4a,null))['then'](respondWithResult(_0x382e4a,null))[_0x21dd('0x44')](handleError(_0x382e4a,null));};exports['create']=function(_0x3a1b35,_0xc9887c){return db[_0x21dd('0x42')][_0x21dd('0x48')](_0x3a1b35[_0x21dd('0x49')],{})[_0x21dd('0x26')](respondWithResult(_0xc9887c,0xc9))[_0x21dd('0x44')](handleError(_0xc9887c,null));};exports[_0x21dd('0x25')]=function(_0x27ae06,_0x2c14c3){if(_0x27ae06[_0x21dd('0x49')]['id']){delete _0x27ae06[_0x21dd('0x49')]['id'];}return db[_0x21dd('0x42')]['find']({'where':{'id':_0x27ae06['params']['id']}})[_0x21dd('0x26')](handleEntityNotFound(_0x2c14c3,null))[_0x21dd('0x26')](saveUpdates(_0x27ae06['body'],null))[_0x21dd('0x26')](respondWithResult(_0x2c14c3,null))[_0x21dd('0x44')](handleError(_0x2c14c3,null));};exports[_0x21dd('0x27')]=function(_0x20a1f3,_0x452882){return db[_0x21dd('0x42')]['find']({'where':{'id':_0x20a1f3[_0x21dd('0x4a')]['id']}})[_0x21dd('0x26')](handleEntityNotFound(_0x452882,null))['then'](removeEntity(_0x452882,null))['catch'](handleError(_0x452882,null));};exports[_0x21dd('0x4b')]=function(_0x53a687,_0x564817,_0x48ab77){var _0x4b4773={};var _0x7df510={};var _0x5341c0;var _0x14a23c;return db[_0x21dd('0x42')][_0x21dd('0x4c')]({'where':{'id':_0x53a687[_0x21dd('0x4a')]['id']}})[_0x21dd('0x26')](handleEntityNotFound(_0x564817,null))[_0x21dd('0x26')](function(_0x35b7e8){if(_0x35b7e8){_0x5341c0=_0x35b7e8;_0x7df510[_0x21dd('0x31')]=_[_0x21dd('0x2f')](db['ZendeskField'][_0x21dd('0x2c')]);_0x7df510[_0x21dd('0x32')]=_[_0x21dd('0x2f')](_0x53a687['query']);_0x7df510[_0x21dd('0x30')]=_['intersection'](_0x7df510[_0x21dd('0x31')],_0x7df510['query']);_0x4b4773[_0x21dd('0x33')]=_[_0x21dd('0x34')](_0x7df510[_0x21dd('0x31')],qs[_0x21dd('0x35')](_0x53a687[_0x21dd('0x32')][_0x21dd('0x35')]));_0x4b4773[_0x21dd('0x33')]=_0x4b4773[_0x21dd('0x33')]['length']?_0x4b4773[_0x21dd('0x33')]:_0x7df510[_0x21dd('0x31')];_0x4b4773[_0x21dd('0x38')]=qs['sort'](_0x53a687['query'][_0x21dd('0x39')]);_0x4b4773[_0x21dd('0x3a')]=qs[_0x21dd('0x30')](_[_0x21dd('0x3b')](_0x53a687[_0x21dd('0x32')],_0x7df510[_0x21dd('0x30')]));if(_0x53a687[_0x21dd('0x32')]['filter']){_0x4b4773['where']=_['merge'](_0x4b4773[_0x21dd('0x3a')],{'$or':_[_0x21dd('0x2b')](_0x4b4773['attributes'],function(_0x24d3a5){var _0x2e52cf={};_0x2e52cf[_0x24d3a5]={'$like':'%'+_0x53a687[_0x21dd('0x32')]['filter']+'%'};return _0x2e52cf;})});}_0x4b4773=_[_0x21dd('0x3c')]({},_0x4b4773,_0x53a687[_0x21dd('0x46')]);return _0x5341c0[_0x21dd('0x4b')](_0x4b4773);}})[_0x21dd('0x26')](function(_0x5d7305){if(_0x5d7305){_0x14a23c=_0x5d7305[_0x21dd('0x4d')];if(!_0x53a687[_0x21dd('0x32')][_0x21dd('0x36')](_0x21dd('0x37'))){_0x4b4773['limit']=qs[_0x21dd('0x1f')](_0x53a687['query']['limit']);_0x4b4773['offset']=qs[_0x21dd('0x1d')](_0x53a687['query'][_0x21dd('0x1d')]);}return _0x5341c0[_0x21dd('0x4b')](_0x4b4773);}})[_0x21dd('0x26')](function(_0x480d4b){if(_0x480d4b){return _0x480d4b?{'count':_0x14a23c,'rows':_0x480d4b}:null;}})[_0x21dd('0x26')](respondWithResult(_0x564817,null))[_0x21dd('0x44')](handleError(_0x564817,null));};exports[_0x21dd('0x4e')]=function(_0x32e5f9,_0x439136,_0x3f8b88){var _0x516be3={};var _0x251e9d={};var _0x27f591;var _0x35b679;return db['ZendeskConfiguration'][_0x21dd('0x4c')]({'where':{'id':_0x32e5f9[_0x21dd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x439136,null))[_0x21dd('0x26')](function(_0x23d9d9){if(_0x23d9d9){_0x27f591=_0x23d9d9;_0x251e9d[_0x21dd('0x31')]=_['keys'](db[_0x21dd('0x4f')]['rawAttributes']);_0x251e9d[_0x21dd('0x32')]=_['keys'](_0x32e5f9[_0x21dd('0x32')]);_0x251e9d[_0x21dd('0x30')]=_['intersection'](_0x251e9d[_0x21dd('0x31')],_0x251e9d['query']);_0x516be3['attributes']=_[_0x21dd('0x34')](_0x251e9d[_0x21dd('0x31')],qs['fields'](_0x32e5f9[_0x21dd('0x32')][_0x21dd('0x35')]));_0x516be3[_0x21dd('0x33')]=_0x516be3['attributes'][_0x21dd('0x4d')]?_0x516be3[_0x21dd('0x33')]:_0x251e9d['model'];_0x516be3['order']=qs[_0x21dd('0x39')](_0x32e5f9['query']['sort']);_0x516be3[_0x21dd('0x3a')]=qs[_0x21dd('0x30')](_[_0x21dd('0x3b')](_0x32e5f9[_0x21dd('0x32')],_0x251e9d[_0x21dd('0x30')]));if(_0x32e5f9[_0x21dd('0x32')][_0x21dd('0x3f')]){_0x516be3['where']=_[_0x21dd('0x3c')](_0x516be3['where'],{'$or':_['map'](_0x516be3[_0x21dd('0x33')],function(_0x48ed87){var _0x3476ad={};_0x3476ad[_0x48ed87]={'$like':'%'+_0x32e5f9['query'][_0x21dd('0x3f')]+'%'};return _0x3476ad;})});}_0x516be3=_[_0x21dd('0x3c')]({},_0x516be3,_0x32e5f9['options']);return _0x27f591['getSubjects'](_0x516be3);}})['then'](function(_0xa1edbe){if(_0xa1edbe){_0x35b679=_0xa1edbe[_0x21dd('0x4d')];if(!_0x32e5f9[_0x21dd('0x32')][_0x21dd('0x36')]('nolimit')){_0x516be3['limit']=qs[_0x21dd('0x1f')](_0x32e5f9[_0x21dd('0x32')][_0x21dd('0x1f')]);_0x516be3[_0x21dd('0x1d')]=qs['offset'](_0x32e5f9[_0x21dd('0x32')][_0x21dd('0x1d')]);}return _0x27f591[_0x21dd('0x4e')](_0x516be3);}})[_0x21dd('0x26')](function(_0x1ac86e){if(_0x1ac86e){return _0x1ac86e?{'count':_0x35b679,'rows':_0x1ac86e}:null;}})[_0x21dd('0x26')](respondWithResult(_0x439136,null))[_0x21dd('0x44')](handleError(_0x439136,null));};exports['getDescriptions']=function(_0x47843f,_0x4fd5ee,_0x428b48){var _0x564fd9={};var _0x27745b={};var _0x404164;var _0x3c5e51;return db[_0x21dd('0x42')][_0x21dd('0x4c')]({'where':{'id':_0x47843f['params']['id']}})[_0x21dd('0x26')](handleEntityNotFound(_0x4fd5ee,null))[_0x21dd('0x26')](function(_0xfcf8dd){if(_0xfcf8dd){_0x404164=_0xfcf8dd;_0x27745b['model']=_[_0x21dd('0x2f')](db[_0x21dd('0x4f')][_0x21dd('0x2c')]);_0x27745b[_0x21dd('0x32')]=_['keys'](_0x47843f[_0x21dd('0x32')]);_0x27745b[_0x21dd('0x30')]=_['intersection'](_0x27745b[_0x21dd('0x31')],_0x27745b[_0x21dd('0x32')]);_0x564fd9[_0x21dd('0x33')]=_[_0x21dd('0x34')](_0x27745b['model'],qs[_0x21dd('0x35')](_0x47843f['query']['fields']));_0x564fd9[_0x21dd('0x33')]=_0x564fd9[_0x21dd('0x33')]['length']?_0x564fd9[_0x21dd('0x33')]:_0x27745b[_0x21dd('0x31')];_0x564fd9[_0x21dd('0x38')]=qs[_0x21dd('0x39')](_0x47843f[_0x21dd('0x32')][_0x21dd('0x39')]);_0x564fd9[_0x21dd('0x3a')]=qs[_0x21dd('0x30')](_[_0x21dd('0x3b')](_0x47843f['query'],_0x27745b[_0x21dd('0x30')]));if(_0x47843f['query'][_0x21dd('0x3f')]){_0x564fd9[_0x21dd('0x3a')]=_['merge'](_0x564fd9['where'],{'$or':_[_0x21dd('0x2b')](_0x564fd9[_0x21dd('0x33')],function(_0x3b7f1c){var _0x515d0a={};_0x515d0a[_0x3b7f1c]={'$like':'%'+_0x47843f[_0x21dd('0x32')]['filter']+'%'};return _0x515d0a;})});}_0x564fd9=_[_0x21dd('0x3c')]({},_0x564fd9,_0x47843f[_0x21dd('0x46')]);return _0x404164[_0x21dd('0x50')](_0x564fd9);}})['then'](function(_0x5d3c05){if(_0x5d3c05){_0x3c5e51=_0x5d3c05[_0x21dd('0x4d')];if(!_0x47843f[_0x21dd('0x32')][_0x21dd('0x36')]('nolimit')){_0x564fd9[_0x21dd('0x1f')]=qs[_0x21dd('0x1f')](_0x47843f['query']['limit']);_0x564fd9[_0x21dd('0x1d')]=qs[_0x21dd('0x1d')](_0x47843f[_0x21dd('0x32')][_0x21dd('0x1d')]);}return _0x404164[_0x21dd('0x50')](_0x564fd9);}})[_0x21dd('0x26')](function(_0x1a1fee){if(_0x1a1fee){return _0x1a1fee?{'count':_0x3c5e51,'rows':_0x1a1fee}:null;}})[_0x21dd('0x26')](respondWithResult(_0x4fd5ee,null))[_0x21dd('0x44')](handleError(_0x4fd5ee,null));};exports[_0x21dd('0x51')]=function(_0x56ec47,_0x6bdd04,_0x20f02e){var _0x42569a={};var _0x3f0621={};var _0xaca478;var _0x3a2d2a;return db[_0x21dd('0x42')][_0x21dd('0x4c')]({'where':{'id':_0x56ec47[_0x21dd('0x4a')]['id']}})[_0x21dd('0x26')](handleEntityNotFound(_0x6bdd04,null))['then'](function(_0x1f2ec4){if(_0x1f2ec4){_0xaca478=_0x1f2ec4;_0x3f0621[_0x21dd('0x31')]=_['keys'](db['Tag'][_0x21dd('0x2c')]);_0x3f0621[_0x21dd('0x32')]=_['keys'](_0x56ec47[_0x21dd('0x32')]);_0x3f0621['filters']=_['intersection'](_0x3f0621['model'],_0x3f0621['query']);_0x42569a[_0x21dd('0x33')]=_['intersection'](_0x3f0621[_0x21dd('0x31')],qs[_0x21dd('0x35')](_0x56ec47[_0x21dd('0x32')][_0x21dd('0x35')]));_0x42569a[_0x21dd('0x33')]=_0x42569a[_0x21dd('0x33')][_0x21dd('0x4d')]?_0x42569a[_0x21dd('0x33')]:_0x3f0621[_0x21dd('0x31')];_0x42569a[_0x21dd('0x38')]=qs[_0x21dd('0x39')](_0x56ec47[_0x21dd('0x32')][_0x21dd('0x39')]);_0x42569a[_0x21dd('0x3a')]=qs[_0x21dd('0x30')](_[_0x21dd('0x3b')](_0x56ec47['query'],_0x3f0621['filters']));if(_0x56ec47[_0x21dd('0x32')][_0x21dd('0x3f')]){_0x42569a[_0x21dd('0x3a')]=_[_0x21dd('0x3c')](_0x42569a['where'],{'$or':_[_0x21dd('0x2b')](_0x42569a['attributes'],function(_0x2c3f5c){var _0x5a8be5={};_0x5a8be5[_0x2c3f5c]={'$like':'%'+_0x56ec47[_0x21dd('0x32')]['filter']+'%'};return _0x5a8be5;})});}_0x42569a=_['merge']({},_0x42569a,_0x56ec47[_0x21dd('0x46')]);return _0xaca478['getTags'](_0x42569a);}})[_0x21dd('0x26')](function(_0x2ebadc){if(_0x2ebadc){_0x3a2d2a=_0x2ebadc[_0x21dd('0x4d')];if(!_0x56ec47['query'][_0x21dd('0x36')](_0x21dd('0x37'))){_0x42569a['limit']=qs[_0x21dd('0x1f')](_0x56ec47['query'][_0x21dd('0x1f')]);_0x42569a[_0x21dd('0x1d')]=qs[_0x21dd('0x1d')](_0x56ec47[_0x21dd('0x32')][_0x21dd('0x1d')]);}return _0xaca478[_0x21dd('0x51')](_0x42569a);}})[_0x21dd('0x26')](function(_0x56594d){if(_0x56594d){return _0x56594d?{'count':_0x3a2d2a,'rows':_0x56594d}:null;}})[_0x21dd('0x26')](respondWithResult(_0x6bdd04,null))['catch'](handleError(_0x6bdd04,null));};exports[_0x21dd('0x52')]=function(_0x443f59,_0x142eff,_0x266c49){if(_0x443f59[_0x21dd('0x49')]['id']){delete _0x443f59[_0x21dd('0x49')]['id'];}return db[_0x21dd('0x42')][_0x21dd('0x4c')]({'where':{'id':_0x443f59[_0x21dd('0x4a')]['id']}})[_0x21dd('0x26')](handleEntityNotFound(_0x142eff,null))[_0x21dd('0x26')](function(_0x11aafc){if(_0x11aafc){return _0x11aafc[_0x21dd('0x52')](_0x443f59[_0x21dd('0x49')][_0x21dd('0x53')]||[]);}return null;})['then'](respondWithResult(_0x142eff,null))[_0x21dd('0x44')](handleError(_0x142eff,null));}; \ No newline at end of file +var _0x3eca=['undefined','offset','count','limit','set','update','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','find','create','body','getFields','findOne','ZendeskField','pick','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x5589a0,_0x5c022f){var _0x172e8a=function(_0x44a005){while(--_0x44a005){_0x5589a0['push'](_0x5589a0['shift']());}};_0x172e8a(++_0x5c022f);}(_0x3eca,0x15f));var _0xa3ec=function(_0x13ff53,_0x5e1424){_0x13ff53=_0x13ff53-0x0;var _0x290228=_0x3eca[_0x13ff53];return _0x290228;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa3ec('0x0'));var zipdir=require(_0xa3ec('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa3ec('0x2'));var moment=require(_0xa3ec('0x3'));var BPromise=require(_0xa3ec('0x4'));var Mustache=require('mustache');var util=require(_0xa3ec('0x5'));var path=require(_0xa3ec('0x6'));var sox=require('sox');var csv=require(_0xa3ec('0x7'));var ejs=require(_0xa3ec('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa3ec('0x9'));var crypto=require(_0xa3ec('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa3ec('0x7'));var querystring=require(_0xa3ec('0xb'));var Papa=require(_0xa3ec('0xc'));var Redis=require(_0xa3ec('0xd'));var authService=require(_0xa3ec('0xe'));var qs=require(_0xa3ec('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa3ec('0x10'));var utils=require(_0xa3ec('0x11'));var config=require(_0xa3ec('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xa3ec('0x13'))['db'];function respondWithStatusCode(_0x338825,_0x2b6078){_0x2b6078=_0x2b6078||0xcc;return function(_0x1a62fe){if(_0x1a62fe){return _0x338825[_0xa3ec('0x14')](_0x2b6078);}return _0x338825[_0xa3ec('0x15')](_0x2b6078)[_0xa3ec('0x16')]();};}function respondWithResult(_0xe7f040,_0x242c74){_0x242c74=_0x242c74||0xc8;return function(_0x53ccbf){if(_0x53ccbf){return _0xe7f040[_0xa3ec('0x15')](_0x242c74)[_0xa3ec('0x17')](_0x53ccbf);}};}function respondWithFilteredResult(_0x18e270,_0x16f37e){return function(_0x259902){if(_0x259902){var _0x466205=typeof _0x16f37e['offset']===_0xa3ec('0x18')&&typeof _0x16f37e['limit']===_0xa3ec('0x18');var _0x118e47=_0x259902['count'];var _0x4b1203=_0x466205?0x0:_0x16f37e[_0xa3ec('0x19')];var _0x2baf0a=_0x466205?_0x259902[_0xa3ec('0x1a')]:_0x16f37e['offset']+_0x16f37e[_0xa3ec('0x1b')];var _0x26703b;if(_0x2baf0a>=_0x118e47){_0x2baf0a=_0x118e47;_0x26703b=0xc8;}else{_0x26703b=0xce;}_0x18e270[_0xa3ec('0x15')](_0x26703b);return _0x18e270[_0xa3ec('0x1c')]('Content-Range',_0x4b1203+'-'+_0x2baf0a+'/'+_0x118e47)[_0xa3ec('0x17')](_0x259902);}return null;};}function patchUpdates(_0x56dfef){return function(_0x2c55ec){try{jsonpatch['apply'](_0x2c55ec,_0x56dfef,!![]);}catch(_0x34cc41){return BPromise['reject'](_0x34cc41);}return _0x2c55ec['save']();};}function saveUpdates(_0x2520c,_0x6aea72){return function(_0x9dba2d){if(_0x9dba2d){return _0x9dba2d[_0xa3ec('0x1d')](_0x2520c)[_0xa3ec('0x1e')](function(_0x4702d7){return _0x4702d7;});}return null;};}function removeEntity(_0x50a6f6,_0x5193f0){return function(_0x1a5a30){if(_0x1a5a30){return _0x1a5a30[_0xa3ec('0x1f')]()[_0xa3ec('0x1e')](function(){_0x50a6f6[_0xa3ec('0x15')](0xcc)[_0xa3ec('0x16')]();});}};}function handleEntityNotFound(_0x50f1b5,_0x4abca2){return function(_0x4a68eb){if(!_0x4a68eb){_0x50f1b5[_0xa3ec('0x14')](0x194);}return _0x4a68eb;};}function handleError(_0xc9e53c,_0x35540e){_0x35540e=_0x35540e||0x1f4;return function(_0x40e89e){logger[_0xa3ec('0x20')](_0x40e89e[_0xa3ec('0x21')]);if(_0x40e89e[_0xa3ec('0x22')]){delete _0x40e89e[_0xa3ec('0x22')];}_0xc9e53c[_0xa3ec('0x15')](_0x35540e)[_0xa3ec('0x23')](_0x40e89e);};}exports[_0xa3ec('0x24')]=function(_0x4132ca,_0x4897bd){var _0xc4e563={},_0x38705d={},_0xe801ef={'count':0x0,'rows':[]};var _0x3d3c59=_[_0xa3ec('0x25')](db[_0xa3ec('0x26')]['rawAttributes'],function(_0x3449d0){return{'name':_0x3449d0['fieldName'],'type':_0x3449d0[_0xa3ec('0x27')]['key']};});_0x38705d[_0xa3ec('0x28')]=_[_0xa3ec('0x25')](_0x3d3c59,_0xa3ec('0x22'));_0x38705d[_0xa3ec('0x29')]=_[_0xa3ec('0x2a')](_0x4132ca['query']);_0x38705d[_0xa3ec('0x2b')]=_[_0xa3ec('0x2c')](_0x38705d[_0xa3ec('0x28')],_0x38705d[_0xa3ec('0x29')]);_0xc4e563[_0xa3ec('0x2d')]=_[_0xa3ec('0x2c')](_0x38705d['model'],qs[_0xa3ec('0x2e')](_0x4132ca['query'][_0xa3ec('0x2e')]));_0xc4e563[_0xa3ec('0x2d')]=_0xc4e563[_0xa3ec('0x2d')][_0xa3ec('0x2f')]?_0xc4e563[_0xa3ec('0x2d')]:_0x38705d[_0xa3ec('0x28')];if(!_0x4132ca[_0xa3ec('0x29')][_0xa3ec('0x30')]('nolimit')){_0xc4e563['limit']=qs[_0xa3ec('0x1b')](_0x4132ca[_0xa3ec('0x29')][_0xa3ec('0x1b')]);_0xc4e563[_0xa3ec('0x19')]=qs[_0xa3ec('0x19')](_0x4132ca[_0xa3ec('0x29')][_0xa3ec('0x19')]);}_0xc4e563[_0xa3ec('0x31')]=qs[_0xa3ec('0x32')](_0x4132ca[_0xa3ec('0x29')][_0xa3ec('0x32')]);_0xc4e563[_0xa3ec('0x33')]=qs[_0xa3ec('0x2b')](_['pick'](_0x4132ca['query'],_0x38705d['filters']),_0x3d3c59);if(_0x4132ca[_0xa3ec('0x29')][_0xa3ec('0x34')]){_0xc4e563['where']=_[_0xa3ec('0x35')](_0xc4e563[_0xa3ec('0x33')],{'$or':_[_0xa3ec('0x25')](_0x3d3c59,function(_0x49b714){if(_0x49b714[_0xa3ec('0x27')]!==_0xa3ec('0x36')){var _0x13e5bc={};_0x13e5bc[_0x49b714[_0xa3ec('0x22')]]={'$like':'%'+_0x4132ca['query'][_0xa3ec('0x34')]+'%'};return _0x13e5bc;}})});}_0xc4e563=_[_0xa3ec('0x35')]({},_0xc4e563,_0x4132ca[_0xa3ec('0x37')]);var _0x58ebbc={'where':_0xc4e563[_0xa3ec('0x33')]};return db['ZendeskConfiguration'][_0xa3ec('0x1a')](_0x58ebbc)[_0xa3ec('0x1e')](function(_0x49bd06){_0xe801ef['count']=_0x49bd06;if(_0x4132ca['query'][_0xa3ec('0x38')]){_0xc4e563['include']=[{'all':!![]}];}return db[_0xa3ec('0x26')][_0xa3ec('0x39')](_0xc4e563);})[_0xa3ec('0x1e')](function(_0x49d9f5){_0xe801ef[_0xa3ec('0x3a')]=_0x49d9f5;return _0xe801ef;})[_0xa3ec('0x1e')](respondWithFilteredResult(_0x4897bd,_0xc4e563))[_0xa3ec('0x3b')](handleError(_0x4897bd,null));};exports['show']=function(_0x7f4ee6,_0x1949bd){var _0x43358e={'raw':![],'where':{'id':_0x7f4ee6[_0xa3ec('0x3c')]['id']}},_0x3ba9ef={};_0x3ba9ef[_0xa3ec('0x28')]=_['keys'](db['ZendeskConfiguration'][_0xa3ec('0x3d')]);_0x3ba9ef['query']=_[_0xa3ec('0x2a')](_0x7f4ee6['query']);_0x3ba9ef[_0xa3ec('0x2b')]=_[_0xa3ec('0x2c')](_0x3ba9ef[_0xa3ec('0x28')],_0x3ba9ef[_0xa3ec('0x29')]);_0x43358e['attributes']=_[_0xa3ec('0x2c')](_0x3ba9ef['model'],qs[_0xa3ec('0x2e')](_0x7f4ee6[_0xa3ec('0x29')][_0xa3ec('0x2e')]));_0x43358e[_0xa3ec('0x2d')]=_0x43358e[_0xa3ec('0x2d')][_0xa3ec('0x2f')]?_0x43358e[_0xa3ec('0x2d')]:_0x3ba9ef[_0xa3ec('0x28')];if(_0x7f4ee6[_0xa3ec('0x29')][_0xa3ec('0x38')]){_0x43358e['include']=[{'all':!![]}];}_0x43358e=_[_0xa3ec('0x35')]({},_0x43358e,_0x7f4ee6[_0xa3ec('0x37')]);return db[_0xa3ec('0x26')][_0xa3ec('0x3e')](_0x43358e)['then'](handleEntityNotFound(_0x1949bd,null))[_0xa3ec('0x1e')](respondWithResult(_0x1949bd,null))[_0xa3ec('0x3b')](handleError(_0x1949bd,null));};exports['create']=function(_0x43321c,_0x51b570){return db['ZendeskConfiguration'][_0xa3ec('0x3f')](_0x43321c['body'],{})[_0xa3ec('0x1e')](respondWithResult(_0x51b570,0xc9))['catch'](handleError(_0x51b570,null));};exports[_0xa3ec('0x1d')]=function(_0x54b061,_0x2f5d94){if(_0x54b061[_0xa3ec('0x40')]['id']){delete _0x54b061[_0xa3ec('0x40')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x54b061[_0xa3ec('0x3c')]['id']}})[_0xa3ec('0x1e')](handleEntityNotFound(_0x2f5d94,null))[_0xa3ec('0x1e')](saveUpdates(_0x54b061[_0xa3ec('0x40')],null))[_0xa3ec('0x1e')](respondWithResult(_0x2f5d94,null))[_0xa3ec('0x3b')](handleError(_0x2f5d94,null));};exports['destroy']=function(_0x546e43,_0x132401){return db[_0xa3ec('0x26')][_0xa3ec('0x3e')]({'where':{'id':_0x546e43[_0xa3ec('0x3c')]['id']}})[_0xa3ec('0x1e')](handleEntityNotFound(_0x132401,null))[_0xa3ec('0x1e')](removeEntity(_0x132401,null))[_0xa3ec('0x3b')](handleError(_0x132401,null));};exports[_0xa3ec('0x41')]=function(_0x4cc787,_0x34acc6,_0x155192){var _0x1fc800={};var _0x333843={};var _0x2a0163;var _0x29952b;return db[_0xa3ec('0x26')][_0xa3ec('0x42')]({'where':{'id':_0x4cc787[_0xa3ec('0x3c')]['id']}})[_0xa3ec('0x1e')](handleEntityNotFound(_0x34acc6,null))['then'](function(_0x1d5436){if(_0x1d5436){_0x2a0163=_0x1d5436;_0x333843[_0xa3ec('0x28')]=_[_0xa3ec('0x2a')](db[_0xa3ec('0x43')][_0xa3ec('0x3d')]);_0x333843[_0xa3ec('0x29')]=_[_0xa3ec('0x2a')](_0x4cc787['query']);_0x333843[_0xa3ec('0x2b')]=_[_0xa3ec('0x2c')](_0x333843['model'],_0x333843[_0xa3ec('0x29')]);_0x1fc800['attributes']=_[_0xa3ec('0x2c')](_0x333843[_0xa3ec('0x28')],qs[_0xa3ec('0x2e')](_0x4cc787[_0xa3ec('0x29')][_0xa3ec('0x2e')]));_0x1fc800[_0xa3ec('0x2d')]=_0x1fc800[_0xa3ec('0x2d')][_0xa3ec('0x2f')]?_0x1fc800[_0xa3ec('0x2d')]:_0x333843[_0xa3ec('0x28')];_0x1fc800[_0xa3ec('0x31')]=qs[_0xa3ec('0x32')](_0x4cc787[_0xa3ec('0x29')]['sort']);_0x1fc800[_0xa3ec('0x33')]=qs[_0xa3ec('0x2b')](_[_0xa3ec('0x44')](_0x4cc787[_0xa3ec('0x29')],_0x333843['filters']));if(_0x4cc787['query']['filter']){_0x1fc800[_0xa3ec('0x33')]=_[_0xa3ec('0x35')](_0x1fc800[_0xa3ec('0x33')],{'$or':_[_0xa3ec('0x25')](_0x1fc800[_0xa3ec('0x2d')],function(_0x225e6d){var _0x433506={};_0x433506[_0x225e6d]={'$like':'%'+_0x4cc787['query'][_0xa3ec('0x34')]+'%'};return _0x433506;})});}_0x1fc800=_['merge']({},_0x1fc800,_0x4cc787[_0xa3ec('0x37')]);return _0x2a0163[_0xa3ec('0x41')](_0x1fc800);}})[_0xa3ec('0x1e')](function(_0x2ba08e){if(_0x2ba08e){_0x29952b=_0x2ba08e[_0xa3ec('0x2f')];if(!_0x4cc787[_0xa3ec('0x29')]['hasOwnProperty'](_0xa3ec('0x45'))){_0x1fc800['limit']=qs[_0xa3ec('0x1b')](_0x4cc787[_0xa3ec('0x29')][_0xa3ec('0x1b')]);_0x1fc800['offset']=qs['offset'](_0x4cc787[_0xa3ec('0x29')]['offset']);}return _0x2a0163[_0xa3ec('0x41')](_0x1fc800);}})[_0xa3ec('0x1e')](function(_0x3f9c9c){if(_0x3f9c9c){return _0x3f9c9c?{'count':_0x29952b,'rows':_0x3f9c9c}:null;}})['then'](respondWithResult(_0x34acc6,null))[_0xa3ec('0x3b')](handleError(_0x34acc6,null));};exports[_0xa3ec('0x46')]=function(_0x402f3e,_0x56321e,_0x24e343){var _0x1cfb24={};var _0x59d76f={};var _0x5e209a;var _0x2d90e;return db[_0xa3ec('0x26')][_0xa3ec('0x42')]({'where':{'id':_0x402f3e['params']['id']}})[_0xa3ec('0x1e')](handleEntityNotFound(_0x56321e,null))[_0xa3ec('0x1e')](function(_0x3eac6a){if(_0x3eac6a){_0x5e209a=_0x3eac6a;_0x59d76f[_0xa3ec('0x28')]=_['keys'](db[_0xa3ec('0x43')][_0xa3ec('0x3d')]);_0x59d76f['query']=_[_0xa3ec('0x2a')](_0x402f3e[_0xa3ec('0x29')]);_0x59d76f[_0xa3ec('0x2b')]=_[_0xa3ec('0x2c')](_0x59d76f[_0xa3ec('0x28')],_0x59d76f[_0xa3ec('0x29')]);_0x1cfb24['attributes']=_['intersection'](_0x59d76f['model'],qs[_0xa3ec('0x2e')](_0x402f3e[_0xa3ec('0x29')][_0xa3ec('0x2e')]));_0x1cfb24[_0xa3ec('0x2d')]=_0x1cfb24['attributes']['length']?_0x1cfb24[_0xa3ec('0x2d')]:_0x59d76f[_0xa3ec('0x28')];_0x1cfb24[_0xa3ec('0x31')]=qs['sort'](_0x402f3e['query'][_0xa3ec('0x32')]);_0x1cfb24[_0xa3ec('0x33')]=qs['filters'](_[_0xa3ec('0x44')](_0x402f3e[_0xa3ec('0x29')],_0x59d76f[_0xa3ec('0x2b')]));if(_0x402f3e[_0xa3ec('0x29')][_0xa3ec('0x34')]){_0x1cfb24['where']=_[_0xa3ec('0x35')](_0x1cfb24[_0xa3ec('0x33')],{'$or':_['map'](_0x1cfb24[_0xa3ec('0x2d')],function(_0x42ec51){var _0x7147e9={};_0x7147e9[_0x42ec51]={'$like':'%'+_0x402f3e[_0xa3ec('0x29')][_0xa3ec('0x34')]+'%'};return _0x7147e9;})});}_0x1cfb24=_[_0xa3ec('0x35')]({},_0x1cfb24,_0x402f3e[_0xa3ec('0x37')]);return _0x5e209a['getSubjects'](_0x1cfb24);}})['then'](function(_0xfb54dd){if(_0xfb54dd){_0x2d90e=_0xfb54dd['length'];if(!_0x402f3e[_0xa3ec('0x29')][_0xa3ec('0x30')](_0xa3ec('0x45'))){_0x1cfb24['limit']=qs['limit'](_0x402f3e[_0xa3ec('0x29')][_0xa3ec('0x1b')]);_0x1cfb24[_0xa3ec('0x19')]=qs[_0xa3ec('0x19')](_0x402f3e[_0xa3ec('0x29')][_0xa3ec('0x19')]);}return _0x5e209a[_0xa3ec('0x46')](_0x1cfb24);}})[_0xa3ec('0x1e')](function(_0x2cf864){if(_0x2cf864){return _0x2cf864?{'count':_0x2d90e,'rows':_0x2cf864}:null;}})[_0xa3ec('0x1e')](respondWithResult(_0x56321e,null))['catch'](handleError(_0x56321e,null));};exports[_0xa3ec('0x47')]=function(_0x5b90d7,_0x30084d,_0x333df7){var _0x4d30d7={};var _0x472bdf={};var _0x2807d8;var _0x354644;return db[_0xa3ec('0x26')]['findOne']({'where':{'id':_0x5b90d7['params']['id']}})[_0xa3ec('0x1e')](handleEntityNotFound(_0x30084d,null))[_0xa3ec('0x1e')](function(_0x219982){if(_0x219982){_0x2807d8=_0x219982;_0x472bdf[_0xa3ec('0x28')]=_[_0xa3ec('0x2a')](db[_0xa3ec('0x43')]['rawAttributes']);_0x472bdf[_0xa3ec('0x29')]=_[_0xa3ec('0x2a')](_0x5b90d7[_0xa3ec('0x29')]);_0x472bdf[_0xa3ec('0x2b')]=_['intersection'](_0x472bdf[_0xa3ec('0x28')],_0x472bdf[_0xa3ec('0x29')]);_0x4d30d7[_0xa3ec('0x2d')]=_[_0xa3ec('0x2c')](_0x472bdf['model'],qs['fields'](_0x5b90d7[_0xa3ec('0x29')][_0xa3ec('0x2e')]));_0x4d30d7['attributes']=_0x4d30d7[_0xa3ec('0x2d')][_0xa3ec('0x2f')]?_0x4d30d7[_0xa3ec('0x2d')]:_0x472bdf[_0xa3ec('0x28')];_0x4d30d7[_0xa3ec('0x31')]=qs['sort'](_0x5b90d7[_0xa3ec('0x29')][_0xa3ec('0x32')]);_0x4d30d7[_0xa3ec('0x33')]=qs[_0xa3ec('0x2b')](_[_0xa3ec('0x44')](_0x5b90d7[_0xa3ec('0x29')],_0x472bdf[_0xa3ec('0x2b')]));if(_0x5b90d7[_0xa3ec('0x29')][_0xa3ec('0x34')]){_0x4d30d7[_0xa3ec('0x33')]=_['merge'](_0x4d30d7[_0xa3ec('0x33')],{'$or':_[_0xa3ec('0x25')](_0x4d30d7[_0xa3ec('0x2d')],function(_0x515916){var _0x5611a1={};_0x5611a1[_0x515916]={'$like':'%'+_0x5b90d7[_0xa3ec('0x29')][_0xa3ec('0x34')]+'%'};return _0x5611a1;})});}_0x4d30d7=_[_0xa3ec('0x35')]({},_0x4d30d7,_0x5b90d7[_0xa3ec('0x37')]);return _0x2807d8[_0xa3ec('0x47')](_0x4d30d7);}})[_0xa3ec('0x1e')](function(_0x5436a2){if(_0x5436a2){_0x354644=_0x5436a2['length'];if(!_0x5b90d7[_0xa3ec('0x29')][_0xa3ec('0x30')](_0xa3ec('0x45'))){_0x4d30d7['limit']=qs[_0xa3ec('0x1b')](_0x5b90d7[_0xa3ec('0x29')][_0xa3ec('0x1b')]);_0x4d30d7['offset']=qs[_0xa3ec('0x19')](_0x5b90d7[_0xa3ec('0x29')][_0xa3ec('0x19')]);}return _0x2807d8[_0xa3ec('0x47')](_0x4d30d7);}})[_0xa3ec('0x1e')](function(_0x592fc5){if(_0x592fc5){return _0x592fc5?{'count':_0x354644,'rows':_0x592fc5}:null;}})[_0xa3ec('0x1e')](respondWithResult(_0x30084d,null))['catch'](handleError(_0x30084d,null));};exports[_0xa3ec('0x48')]=function(_0x5ebc85,_0x695d43,_0x1369fc){var _0xf9a26b={};var _0x27b0bd={};var _0x53fe99;var _0x5e3641;return db[_0xa3ec('0x26')]['findOne']({'where':{'id':_0x5ebc85['params']['id']}})[_0xa3ec('0x1e')](handleEntityNotFound(_0x695d43,null))[_0xa3ec('0x1e')](function(_0x174eb8){if(_0x174eb8){_0x53fe99=_0x174eb8;_0x27b0bd[_0xa3ec('0x28')]=_[_0xa3ec('0x2a')](db[_0xa3ec('0x49')][_0xa3ec('0x3d')]);_0x27b0bd[_0xa3ec('0x29')]=_[_0xa3ec('0x2a')](_0x5ebc85['query']);_0x27b0bd[_0xa3ec('0x2b')]=_[_0xa3ec('0x2c')](_0x27b0bd['model'],_0x27b0bd['query']);_0xf9a26b[_0xa3ec('0x2d')]=_[_0xa3ec('0x2c')](_0x27b0bd['model'],qs[_0xa3ec('0x2e')](_0x5ebc85[_0xa3ec('0x29')]['fields']));_0xf9a26b[_0xa3ec('0x2d')]=_0xf9a26b[_0xa3ec('0x2d')]['length']?_0xf9a26b[_0xa3ec('0x2d')]:_0x27b0bd[_0xa3ec('0x28')];_0xf9a26b['order']=qs[_0xa3ec('0x32')](_0x5ebc85[_0xa3ec('0x29')][_0xa3ec('0x32')]);_0xf9a26b[_0xa3ec('0x33')]=qs[_0xa3ec('0x2b')](_[_0xa3ec('0x44')](_0x5ebc85[_0xa3ec('0x29')],_0x27b0bd[_0xa3ec('0x2b')]));if(_0x5ebc85[_0xa3ec('0x29')]['filter']){_0xf9a26b[_0xa3ec('0x33')]=_[_0xa3ec('0x35')](_0xf9a26b['where'],{'$or':_['map'](_0xf9a26b['attributes'],function(_0x159a79){var _0x1e1789={};_0x1e1789[_0x159a79]={'$like':'%'+_0x5ebc85[_0xa3ec('0x29')][_0xa3ec('0x34')]+'%'};return _0x1e1789;})});}_0xf9a26b=_['merge']({},_0xf9a26b,_0x5ebc85[_0xa3ec('0x37')]);return _0x53fe99['getTags'](_0xf9a26b);}})[_0xa3ec('0x1e')](function(_0x353659){if(_0x353659){_0x5e3641=_0x353659[_0xa3ec('0x2f')];if(!_0x5ebc85[_0xa3ec('0x29')][_0xa3ec('0x30')]('nolimit')){_0xf9a26b['limit']=qs[_0xa3ec('0x1b')](_0x5ebc85[_0xa3ec('0x29')][_0xa3ec('0x1b')]);_0xf9a26b['offset']=qs[_0xa3ec('0x19')](_0x5ebc85[_0xa3ec('0x29')]['offset']);}return _0x53fe99['getTags'](_0xf9a26b);}})[_0xa3ec('0x1e')](function(_0xdc308){if(_0xdc308){return _0xdc308?{'count':_0x5e3641,'rows':_0xdc308}:null;}})[_0xa3ec('0x1e')](respondWithResult(_0x695d43,null))[_0xa3ec('0x3b')](handleError(_0x695d43,null));};exports[_0xa3ec('0x4a')]=function(_0xafb26f,_0x2714af,_0x234a88){if(_0xafb26f[_0xa3ec('0x40')]['id']){delete _0xafb26f[_0xa3ec('0x40')]['id'];}return db[_0xa3ec('0x26')]['findOne']({'where':{'id':_0xafb26f[_0xa3ec('0x3c')]['id']}})[_0xa3ec('0x1e')](handleEntityNotFound(_0x2714af,null))['then'](function(_0x3fabeb){if(_0x3fabeb){return _0x3fabeb[_0xa3ec('0x4a')](_0xafb26f['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x2714af,null))['catch'](handleError(_0x2714af,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index a3d1ab2..8a16490 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb62e=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define','int_zendesk_configurations','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb62e,0x1de));var _0xeb62=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb62e[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var logger=require(_0xeb62('0x2'))(_0xeb62('0x3'));var moment=require('moment');var BPromise=require(_0xeb62('0x4'));var rp=require(_0xeb62('0x5'));var fs=require('fs');var path=require(_0xeb62('0x6'));var rimraf=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var attributes=require(_0xeb62('0x9'));module['exports']=function(_0x3ec879,_0x455e1a){return _0x3ec879[_0xeb62('0xa')]('ZendeskConfiguration',attributes,{'tableName':_0xeb62('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14a0=['../../config/logger','api','moment','bluebird','request-promise','path','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations','util'];(function(_0x315888,_0xf732d3){var _0x2cd71c=function(_0xf2b73a){while(--_0xf2b73a){_0x315888['push'](_0x315888['shift']());}};_0x2cd71c(++_0xf732d3);}(_0x14a0,0x8e));var _0x014a=function(_0x249f94,_0x3df8a1){_0x249f94=_0x249f94-0x0;var _0x255a06=_0x14a0[_0x249f94];return _0x255a06;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var logger=require(_0x014a('0x1'))(_0x014a('0x2'));var moment=require(_0x014a('0x3'));var BPromise=require(_0x014a('0x4'));var rp=require(_0x014a('0x5'));var fs=require('fs');var path=require(_0x014a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x014a('0x7'));module[_0x014a('0x8')]=function(_0x38a22c,_0x5ec84d){return _0x38a22c['define'](_0x014a('0x9'),attributes,{'tableName':_0x014a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index f122699..6c4b986 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d42=['info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x39a71e,_0x128d6c){var _0x1d62fb=function(_0x5206a0){while(--_0x5206a0){_0x39a71e['push'](_0x39a71e['shift']());}};_0x1d62fb(++_0x128d6c);}(_0x6d42,0x136));var _0x26d4=function(_0x3e0d42,_0x2fa83e){_0x3e0d42=_0x3e0d42-0x0;var _0x58e93a=_0x6d42[_0x3e0d42];return _0x58e93a;};'use strict';var _=require(_0x26d4('0x0'));var util=require('util');var moment=require(_0x26d4('0x1'));var BPromise=require(_0x26d4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x26d4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x26d4('0x4'));var logger=require('../../config/logger')(_0x26d4('0x5'));var config=require(_0x26d4('0x6'));var jayson=require(_0x26d4('0x7'));var client=jayson[_0x26d4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5de266,_0x379805,_0x175028){return new BPromise(function(_0xb8a27c,_0x1d2dd1){return client[_0x26d4('0x9')](_0x5de266,_0x175028)['then'](function(_0x52820e){logger[_0x26d4('0xa')](_0x26d4('0xb'),_0x379805,_0x26d4('0xc'));logger[_0x26d4('0xd')](_0x26d4('0xe'),_0x379805,_0x26d4('0xc'),JSON['stringify'](_0x52820e));if(_0x52820e[_0x26d4('0xf')]){if(_0x52820e[_0x26d4('0xf')][_0x26d4('0x10')]===0x1f4){logger[_0x26d4('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x379805,_0x52820e[_0x26d4('0xf')]['message']);return _0x1d2dd1(_0x52820e['error'][_0x26d4('0x11')]);}logger[_0x26d4('0xf')](_0x26d4('0xb'),_0x379805,_0x52820e[_0x26d4('0xf')][_0x26d4('0x11')]);return _0xb8a27c(_0x52820e[_0x26d4('0xf')][_0x26d4('0x11')]);}else{logger[_0x26d4('0xa')](_0x26d4('0xb'),_0x379805,_0x26d4('0xc'));_0xb8a27c(_0x52820e[_0x26d4('0x12')][_0x26d4('0x11')]);}})[_0x26d4('0x13')](function(_0x2d5bfc){logger[_0x26d4('0xf')](_0x26d4('0xb'),_0x379805,_0x2d5bfc);_0x1d2dd1(_0x2d5bfc);});});} \ No newline at end of file +var _0xbbf1=['client','http','request','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x50054d,_0x38ecaf){var _0x34bceb=function(_0x285574){while(--_0x285574){_0x50054d['push'](_0x50054d['shift']());}};_0x34bceb(++_0x38ecaf);}(_0xbbf1,0x17d));var _0x1bbf=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xbbf1[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x1bbf('0x0'));var util=require(_0x1bbf('0x1'));var moment=require('moment');var BPromise=require(_0x1bbf('0x2'));var rs=require(_0x1bbf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1bbf('0x4'))['db'];var utils=require(_0x1bbf('0x5'));var logger=require(_0x1bbf('0x6'))(_0x1bbf('0x7'));var config=require(_0x1bbf('0x8'));var jayson=require(_0x1bbf('0x9'));var client=jayson[_0x1bbf('0xa')][_0x1bbf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4116eb,_0x147873,_0x1e9af1){return new BPromise(function(_0x414ed3,_0x3feab7){return client[_0x1bbf('0xc')](_0x4116eb,_0x1e9af1)[_0x1bbf('0xd')](function(_0x2224b9){logger[_0x1bbf('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x147873,_0x1bbf('0xf'));logger[_0x1bbf('0x10')](_0x1bbf('0x11'),_0x147873,_0x1bbf('0xf'),JSON['stringify'](_0x2224b9));if(_0x2224b9['error']){if(_0x2224b9[_0x1bbf('0x12')]['code']===0x1f4){logger[_0x1bbf('0x12')](_0x1bbf('0x13'),_0x147873,_0x2224b9[_0x1bbf('0x12')][_0x1bbf('0x14')]);return _0x3feab7(_0x2224b9[_0x1bbf('0x12')]['message']);}logger[_0x1bbf('0x12')](_0x1bbf('0x13'),_0x147873,_0x2224b9[_0x1bbf('0x12')]['message']);return _0x414ed3(_0x2224b9[_0x1bbf('0x12')][_0x1bbf('0x14')]);}else{logger[_0x1bbf('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x147873,_0x1bbf('0xf'));_0x414ed3(_0x2224b9[_0x1bbf('0x15')]['message']);}})[_0x1bbf('0x16')](function(_0x298dbf){logger[_0x1bbf('0x12')](_0x1bbf('0x13'),_0x147873,_0x298dbf);_0x3feab7(_0x298dbf);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index ba59a03..6a37aff 100644 --- a/server/api/intZendeskField/index.js +++ b/server/api/intZendeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0288=['../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x336264,_0x32e1d9){var _0x53cf91=function(_0x21026c){while(--_0x21026c){_0x336264['push'](_0x336264['shift']());}};_0x53cf91(++_0x32e1d9);}(_0x0288,0xca));var _0x8028=function(_0x3591ab,_0x1d9e6a){_0x3591ab=_0x3591ab-0x0;var _0x5f5b71=_0x0288[_0x3591ab];return _0x5f5b71;};'use strict';var multer=require('multer');var util=require(_0x8028('0x0'));var path=require(_0x8028('0x1'));var timeout=require(_0x8028('0x2'));var express=require(_0x8028('0x3'));var router=express[_0x8028('0x4')]();var fs_extra=require(_0x8028('0x5'));var auth=require(_0x8028('0x6'));var interaction=require(_0x8028('0x7'));var config=require(_0x8028('0x8'));var controller=require(_0x8028('0x9'));router[_0x8028('0xa')]('/',auth[_0x8028('0xb')](),controller[_0x8028('0xc')]);router['get'](_0x8028('0xd'),auth[_0x8028('0xb')](),controller[_0x8028('0xe')]);router['post']('/',auth[_0x8028('0xb')](),controller[_0x8028('0xf')]);router[_0x8028('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8028('0x11')](_0x8028('0xd'),auth[_0x8028('0xb')](),controller[_0x8028('0x12')]);module['exports']=router; \ No newline at end of file +var _0x5dd7=['post','create','put','update','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x44512c,_0x26b978){var _0x302438=function(_0x1ae916){while(--_0x1ae916){_0x44512c['push'](_0x44512c['shift']());}};_0x302438(++_0x26b978);}(_0x5dd7,0xe6));var _0x75dd=function(_0x285bc9,_0x5194e6){_0x285bc9=_0x285bc9-0x0;var _0x185992=_0x5dd7[_0x285bc9];return _0x185992;};'use strict';var multer=require(_0x75dd('0x0'));var util=require('util');var path=require(_0x75dd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x75dd('0x2'));var auth=require(_0x75dd('0x3'));var interaction=require(_0x75dd('0x4'));var config=require(_0x75dd('0x5'));var controller=require('./intZendeskField.controller');router[_0x75dd('0x6')]('/',auth[_0x75dd('0x7')](),controller['index']);router[_0x75dd('0x6')](_0x75dd('0x8'),auth[_0x75dd('0x7')](),controller[_0x75dd('0x9')]);router[_0x75dd('0xa')]('/',auth[_0x75dd('0x7')](),controller[_0x75dd('0xb')]);router[_0x75dd('0xc')](_0x75dd('0x8'),auth[_0x75dd('0x7')](),controller[_0x75dd('0xd')]);router['delete']('/:id',auth[_0x75dd('0x7')](),controller['destroy']);module[_0x75dd('0xe')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 2134b99..b74778c 100644 --- a/server/api/intZendeskField/intZendeskField.attributes.js +++ b/server/api/intZendeskField/intZendeskField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21f2=['picklist','string','customVariable','STRING','BOOLEAN','sequelize','ENUM','variable'];(function(_0x44db8e,_0x143b54){var _0x40667a=function(_0x618866){while(--_0x618866){_0x44db8e['push'](_0x44db8e['shift']());}};_0x40667a(++_0x143b54);}(_0x21f2,0xfd));var _0x221f=function(_0x34a1ef,_0x6741e7){_0x34a1ef=_0x34a1ef-0x0;var _0x54d9e6=_0x21f2[_0x34a1ef];return _0x54d9e6;};'use strict';var Sequelize=require(_0x221f('0x0'));module['exports']={'type':{'type':Sequelize[_0x221f('0x1')]('string',_0x221f('0x2'),'customVariable','keyValue',_0x221f('0x3')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x221f('0x1')](_0x221f('0x4'),_0x221f('0x2'),_0x221f('0x5'))},'keyContent':{'type':Sequelize[_0x221f('0x6')]},'idField':{'type':Sequelize[_0x221f('0x6')]},'nameField':{'type':Sequelize[_0x221f('0x6')]},'customField':{'type':Sequelize[_0x221f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x221f('0x6')]}}; \ No newline at end of file +var _0xc3ae=['STRING','BOOLEAN','sequelize','customVariable','keyValue','string'];(function(_0x1dac7a,_0x1828ce){var _0x4cb363=function(_0x80f6de){while(--_0x80f6de){_0x1dac7a['push'](_0x1dac7a['shift']());}};_0x4cb363(++_0x1828ce);}(_0xc3ae,0x140));var _0xec3a=function(_0x25766b,_0x3fb9a7){_0x25766b=_0x25766b-0x0;var _0x12149e=_0xc3ae[_0x25766b];return _0x12149e;};'use strict';var Sequelize=require(_0xec3a('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string','variable',_0xec3a('0x1'),_0xec3a('0x2'),'picklist'),'defaultValue':_0xec3a('0x3')},'content':{'type':Sequelize[_0xec3a('0x4')]},'key':{'type':Sequelize[_0xec3a('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xec3a('0x3'),'variable',_0xec3a('0x1'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xec3a('0x4')]},'nameField':{'type':Sequelize[_0xec3a('0x4')]},'customField':{'type':Sequelize[_0xec3a('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xec3a('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 359c316..bf01d92 100644 --- a/server/api/intZendeskField/intZendeskField.controller.js +++ b/server/api/intZendeskField/intZendeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcece=['count','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xcece,0x1f4));var _0xecec=function(_0x600cb7,_0x333795){_0x600cb7=_0x600cb7-0x0;var _0xfb9d17=_0xcece[_0x600cb7];return _0xfb9d17;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xecec('0x0'));var zipdir=require(_0xecec('0x1'));var jsonpatch=require(_0xecec('0x2'));var rp=require('request-promise');var moment=require(_0xecec('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xecec('0x4'));var util=require(_0xecec('0x5'));var path=require(_0xecec('0x6'));var sox=require(_0xecec('0x7'));var csv=require(_0xecec('0x8'));var ejs=require(_0xecec('0x9'));var fs=require('fs');var fs_extra=require(_0xecec('0xa'));var _=require(_0xecec('0xb'));var squel=require(_0xecec('0xc'));var crypto=require(_0xecec('0xd'));var jsforce=require(_0xecec('0xe'));var deskjs=require(_0xecec('0xf'));var toCsv=require(_0xecec('0x8'));var querystring=require(_0xecec('0x10'));var Papa=require(_0xecec('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xecec('0x12'));var as=require(_0xecec('0x13'));var hardwareService=require(_0xecec('0x14'));var logger=require(_0xecec('0x15'))('api');var utils=require(_0xecec('0x16'));var config=require(_0xecec('0x17'));var licenseUtil=require(_0xecec('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33f626,_0x13efa6){_0x13efa6=_0x13efa6||0xcc;return function(_0x19ba3b){if(_0x19ba3b){return _0x33f626[_0xecec('0x19')](_0x13efa6);}return _0x33f626[_0xecec('0x1a')](_0x13efa6)[_0xecec('0x1b')]();};}function respondWithResult(_0xa33227,_0x566a5a){_0x566a5a=_0x566a5a||0xc8;return function(_0x2c2aa4){if(_0x2c2aa4){return _0xa33227[_0xecec('0x1a')](_0x566a5a)[_0xecec('0x1c')](_0x2c2aa4);}};}function respondWithFilteredResult(_0x402862,_0x2da83c){return function(_0x29313c){if(_0x29313c){var _0x39ad31=typeof _0x2da83c[_0xecec('0x1d')]===_0xecec('0x1e')&&typeof _0x2da83c[_0xecec('0x1f')]===_0xecec('0x1e');var _0x45f52e=_0x29313c[_0xecec('0x20')];var _0x167811=_0x39ad31?0x0:_0x2da83c[_0xecec('0x1d')];var _0xe7c27b=_0x39ad31?_0x29313c[_0xecec('0x20')]:_0x2da83c[_0xecec('0x1d')]+_0x2da83c['limit'];var _0x46e027;if(_0xe7c27b>=_0x45f52e){_0xe7c27b=_0x45f52e;_0x46e027=0xc8;}else{_0x46e027=0xce;}_0x402862[_0xecec('0x1a')](_0x46e027);return _0x402862['set']('Content-Range',_0x167811+'-'+_0xe7c27b+'/'+_0x45f52e)[_0xecec('0x1c')](_0x29313c);}return null;};}function patchUpdates(_0x9f2f6f){return function(_0x3bbbd0){try{jsonpatch[_0xecec('0x21')](_0x3bbbd0,_0x9f2f6f,!![]);}catch(_0x1686dd){return BPromise[_0xecec('0x22')](_0x1686dd);}return _0x3bbbd0[_0xecec('0x23')]();};}function saveUpdates(_0x3fc7fa,_0x14556a){return function(_0x16bd4b){if(_0x16bd4b){return _0x16bd4b[_0xecec('0x24')](_0x3fc7fa)['then'](function(_0x1edfbd){return _0x1edfbd;});}return null;};}function removeEntity(_0x244bae,_0x303aca){return function(_0x2c4e08){if(_0x2c4e08){return _0x2c4e08[_0xecec('0x25')]()[_0xecec('0x26')](function(){_0x244bae[_0xecec('0x1a')](0xcc)[_0xecec('0x1b')]();});}};}function handleEntityNotFound(_0x383898,_0x55f0f7){return function(_0xf9df40){if(!_0xf9df40){_0x383898[_0xecec('0x19')](0x194);}return _0xf9df40;};}function handleError(_0x31d6f3,_0x717159){_0x717159=_0x717159||0x1f4;return function(_0x424497){logger[_0xecec('0x27')](_0x424497[_0xecec('0x28')]);if(_0x424497[_0xecec('0x29')]){delete _0x424497[_0xecec('0x29')];}_0x31d6f3['status'](_0x717159)[_0xecec('0x2a')](_0x424497);};}exports[_0xecec('0x2b')]=function(_0x3ccac3,_0xf1e7cd){var _0x3e8933={},_0x3f2a40={},_0x58c9ad={'count':0x0,'rows':[]};var _0x5e12d5=_[_0xecec('0x2c')](db[_0xecec('0x2d')][_0xecec('0x2e')],function(_0x1cfb3b){return{'name':_0x1cfb3b[_0xecec('0x2f')],'type':_0x1cfb3b[_0xecec('0x30')][_0xecec('0x31')]};});_0x3f2a40['model']=_[_0xecec('0x2c')](_0x5e12d5,_0xecec('0x29'));_0x3f2a40[_0xecec('0x32')]=_[_0xecec('0x33')](_0x3ccac3[_0xecec('0x32')]);_0x3f2a40['filters']=_['intersection'](_0x3f2a40['model'],_0x3f2a40['query']);_0x3e8933[_0xecec('0x34')]=_[_0xecec('0x35')](_0x3f2a40['model'],qs[_0xecec('0x36')](_0x3ccac3['query'][_0xecec('0x36')]));_0x3e8933[_0xecec('0x34')]=_0x3e8933['attributes'][_0xecec('0x37')]?_0x3e8933[_0xecec('0x34')]:_0x3f2a40[_0xecec('0x38')];if(!_0x3ccac3[_0xecec('0x32')][_0xecec('0x39')](_0xecec('0x3a'))){_0x3e8933[_0xecec('0x1f')]=qs[_0xecec('0x1f')](_0x3ccac3[_0xecec('0x32')]['limit']);_0x3e8933['offset']=qs[_0xecec('0x1d')](_0x3ccac3[_0xecec('0x32')][_0xecec('0x1d')]);}_0x3e8933[_0xecec('0x3b')]=qs[_0xecec('0x3c')](_0x3ccac3[_0xecec('0x32')][_0xecec('0x3c')]);_0x3e8933[_0xecec('0x3d')]=qs[_0xecec('0x3e')](_['pick'](_0x3ccac3['query'],_0x3f2a40[_0xecec('0x3e')]),_0x5e12d5);if(_0x3ccac3[_0xecec('0x32')]['filter']){_0x3e8933[_0xecec('0x3d')]=_['merge'](_0x3e8933['where'],{'$or':_[_0xecec('0x2c')](_0x5e12d5,function(_0x86f839){if(_0x86f839[_0xecec('0x30')]!==_0xecec('0x3f')){var _0x1aa419={};_0x1aa419[_0x86f839['name']]={'$like':'%'+_0x3ccac3['query']['filter']+'%'};return _0x1aa419;}})});}_0x3e8933=_[_0xecec('0x40')]({},_0x3e8933,_0x3ccac3[_0xecec('0x41')]);var _0x5757ff={'where':_0x3e8933[_0xecec('0x3d')]};return db['ZendeskField']['count'](_0x5757ff)[_0xecec('0x26')](function(_0x3a7877){_0x58c9ad[_0xecec('0x20')]=_0x3a7877;if(_0x3ccac3['query'][_0xecec('0x42')]){_0x3e8933[_0xecec('0x43')]=[{'all':!![]}];}return db[_0xecec('0x2d')][_0xecec('0x44')](_0x3e8933);})[_0xecec('0x26')](function(_0x331251){_0x58c9ad[_0xecec('0x45')]=_0x331251;return _0x58c9ad;})[_0xecec('0x26')](respondWithFilteredResult(_0xf1e7cd,_0x3e8933))['catch'](handleError(_0xf1e7cd,null));};exports[_0xecec('0x46')]=function(_0x2e31cf,_0x39c07c){var _0x53ffb5={'raw':!![],'where':{'id':_0x2e31cf[_0xecec('0x47')]['id']}},_0x1ae1d6={};_0x1ae1d6[_0xecec('0x38')]=_['keys'](db[_0xecec('0x2d')][_0xecec('0x2e')]);_0x1ae1d6[_0xecec('0x32')]=_[_0xecec('0x33')](_0x2e31cf[_0xecec('0x32')]);_0x1ae1d6[_0xecec('0x3e')]=_['intersection'](_0x1ae1d6[_0xecec('0x38')],_0x1ae1d6[_0xecec('0x32')]);_0x53ffb5[_0xecec('0x34')]=_['intersection'](_0x1ae1d6[_0xecec('0x38')],qs['fields'](_0x2e31cf[_0xecec('0x32')][_0xecec('0x36')]));_0x53ffb5[_0xecec('0x34')]=_0x53ffb5['attributes'][_0xecec('0x37')]?_0x53ffb5[_0xecec('0x34')]:_0x1ae1d6[_0xecec('0x38')];if(_0x2e31cf[_0xecec('0x32')][_0xecec('0x42')]){_0x53ffb5[_0xecec('0x43')]=[{'all':!![]}];}_0x53ffb5=_['merge']({},_0x53ffb5,_0x2e31cf[_0xecec('0x41')]);return db[_0xecec('0x2d')][_0xecec('0x48')](_0x53ffb5)['then'](handleEntityNotFound(_0x39c07c,null))[_0xecec('0x26')](respondWithResult(_0x39c07c,null))[_0xecec('0x49')](handleError(_0x39c07c,null));};exports[_0xecec('0x4a')]=function(_0x4b6b6f,_0x7b4ad2){return db[_0xecec('0x2d')]['create'](_0x4b6b6f[_0xecec('0x4b')],{})[_0xecec('0x26')](respondWithResult(_0x7b4ad2,0xc9))['catch'](handleError(_0x7b4ad2,null));};exports['update']=function(_0x1fddbe,_0x2224c5){if(_0x1fddbe[_0xecec('0x4b')]['id']){delete _0x1fddbe['body']['id'];}return db[_0xecec('0x2d')][_0xecec('0x48')]({'where':{'id':_0x1fddbe[_0xecec('0x47')]['id']}})[_0xecec('0x26')](handleEntityNotFound(_0x2224c5,null))[_0xecec('0x26')](saveUpdates(_0x1fddbe['body'],null))[_0xecec('0x26')](respondWithResult(_0x2224c5,null))[_0xecec('0x49')](handleError(_0x2224c5,null));};exports[_0xecec('0x25')]=function(_0xd05c42,_0x259666){return db[_0xecec('0x2d')][_0xecec('0x48')]({'where':{'id':_0xd05c42[_0xecec('0x47')]['id']}})['then'](handleEntityNotFound(_0x259666,null))[_0xecec('0x26')](removeEntity(_0x259666,null))['catch'](handleError(_0x259666,null));}; \ No newline at end of file +var _0x4746=['ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','json','limit','undefined','count','offset','status','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','type','VIRTUAL','merge','where','includeAll','ZendeskField','findAll','catch','params','include','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x30578e,_0x4e8c81){var _0x30e739=function(_0x1cc762){while(--_0x1cc762){_0x30578e['push'](_0x30578e['shift']());}};_0x30e739(++_0x4e8c81);}(_0x4746,0x10e));var _0x6474=function(_0x3c234a,_0x59e6e5){_0x3c234a=_0x3c234a-0x0;var _0x28b80f=_0x4746[_0x3c234a];return _0x28b80f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6474('0x0'));var zipdir=require(_0x6474('0x1'));var jsonpatch=require(_0x6474('0x2'));var rp=require(_0x6474('0x3'));var moment=require(_0x6474('0x4'));var BPromise=require(_0x6474('0x5'));var Mustache=require(_0x6474('0x6'));var util=require('util');var path=require(_0x6474('0x7'));var sox=require(_0x6474('0x8'));var csv=require(_0x6474('0x9'));var ejs=require(_0x6474('0xa'));var fs=require('fs');var fs_extra=require(_0x6474('0xb'));var _=require('lodash');var squel=require(_0x6474('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6474('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6474('0xe'));var Papa=require(_0x6474('0xf'));var Redis=require(_0x6474('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6474('0x11'));var as=require(_0x6474('0x12'));var hardwareService=require(_0x6474('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6474('0x14'));var db=require(_0x6474('0x15'))['db'];function respondWithStatusCode(_0x792f29,_0x22ae1a){_0x22ae1a=_0x22ae1a||0xcc;return function(_0x4e964b){if(_0x4e964b){return _0x792f29[_0x6474('0x16')](_0x22ae1a);}return _0x792f29['status'](_0x22ae1a)['end']();};}function respondWithResult(_0x1b911,_0x580c92){_0x580c92=_0x580c92||0xc8;return function(_0x68c90b){if(_0x68c90b){return _0x1b911['status'](_0x580c92)[_0x6474('0x17')](_0x68c90b);}};}function respondWithFilteredResult(_0x130aab,_0x416437){return function(_0x58163f){if(_0x58163f){var _0x5f5b53=typeof _0x416437['offset']==='undefined'&&typeof _0x416437[_0x6474('0x18')]===_0x6474('0x19');var _0x327d97=_0x58163f[_0x6474('0x1a')];var _0x20b41=_0x5f5b53?0x0:_0x416437[_0x6474('0x1b')];var _0x14935a=_0x5f5b53?_0x58163f[_0x6474('0x1a')]:_0x416437[_0x6474('0x1b')]+_0x416437['limit'];var _0x1641ca;if(_0x14935a>=_0x327d97){_0x14935a=_0x327d97;_0x1641ca=0xc8;}else{_0x1641ca=0xce;}_0x130aab[_0x6474('0x1c')](_0x1641ca);return _0x130aab['set'](_0x6474('0x1d'),_0x20b41+'-'+_0x14935a+'/'+_0x327d97)[_0x6474('0x17')](_0x58163f);}return null;};}function patchUpdates(_0x3cf395){return function(_0x1d870c){try{jsonpatch['apply'](_0x1d870c,_0x3cf395,!![]);}catch(_0x28e050){return BPromise[_0x6474('0x1e')](_0x28e050);}return _0x1d870c[_0x6474('0x1f')]();};}function saveUpdates(_0x1ab5bb,_0x163f30){return function(_0x2a4a4e){if(_0x2a4a4e){return _0x2a4a4e[_0x6474('0x20')](_0x1ab5bb)[_0x6474('0x21')](function(_0x386839){return _0x386839;});}return null;};}function removeEntity(_0x20eb46,_0xf7e75f){return function(_0x4c6315){if(_0x4c6315){return _0x4c6315[_0x6474('0x22')]()[_0x6474('0x21')](function(){_0x20eb46[_0x6474('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xeea2ee,_0x13247){return function(_0x4a645d){if(!_0x4a645d){_0xeea2ee[_0x6474('0x16')](0x194);}return _0x4a645d;};}function handleError(_0xc903d5,_0x4be4f3){_0x4be4f3=_0x4be4f3||0x1f4;return function(_0x4b6daf){logger[_0x6474('0x23')](_0x4b6daf[_0x6474('0x24')]);if(_0x4b6daf[_0x6474('0x25')]){delete _0x4b6daf['name'];}_0xc903d5[_0x6474('0x1c')](_0x4be4f3)[_0x6474('0x26')](_0x4b6daf);};}exports['index']=function(_0x16c169,_0x40d15c){var _0x40d890={},_0xcdfa65={},_0x501685={'count':0x0,'rows':[]};var _0x2dfdea=_[_0x6474('0x27')](db['ZendeskField'][_0x6474('0x28')],function(_0x3959af){return{'name':_0x3959af[_0x6474('0x29')],'type':_0x3959af['type'][_0x6474('0x2a')]};});_0xcdfa65[_0x6474('0x2b')]=_[_0x6474('0x27')](_0x2dfdea,'name');_0xcdfa65[_0x6474('0x2c')]=_[_0x6474('0x2d')](_0x16c169[_0x6474('0x2c')]);_0xcdfa65[_0x6474('0x2e')]=_['intersection'](_0xcdfa65[_0x6474('0x2b')],_0xcdfa65[_0x6474('0x2c')]);_0x40d890[_0x6474('0x2f')]=_[_0x6474('0x30')](_0xcdfa65[_0x6474('0x2b')],qs[_0x6474('0x31')](_0x16c169[_0x6474('0x2c')][_0x6474('0x31')]));_0x40d890[_0x6474('0x2f')]=_0x40d890[_0x6474('0x2f')][_0x6474('0x32')]?_0x40d890[_0x6474('0x2f')]:_0xcdfa65['model'];if(!_0x16c169['query'][_0x6474('0x33')](_0x6474('0x34'))){_0x40d890[_0x6474('0x18')]=qs[_0x6474('0x18')](_0x16c169['query'][_0x6474('0x18')]);_0x40d890[_0x6474('0x1b')]=qs['offset'](_0x16c169['query'][_0x6474('0x1b')]);}_0x40d890['order']=qs[_0x6474('0x35')](_0x16c169[_0x6474('0x2c')][_0x6474('0x35')]);_0x40d890['where']=qs['filters'](_[_0x6474('0x36')](_0x16c169[_0x6474('0x2c')],_0xcdfa65[_0x6474('0x2e')]),_0x2dfdea);if(_0x16c169[_0x6474('0x2c')][_0x6474('0x37')]){_0x40d890['where']=_['merge'](_0x40d890['where'],{'$or':_[_0x6474('0x27')](_0x2dfdea,function(_0x1f0f35){if(_0x1f0f35[_0x6474('0x38')]!==_0x6474('0x39')){var _0x40229d={};_0x40229d[_0x1f0f35['name']]={'$like':'%'+_0x16c169[_0x6474('0x2c')][_0x6474('0x37')]+'%'};return _0x40229d;}})});}_0x40d890=_[_0x6474('0x3a')]({},_0x40d890,_0x16c169['options']);var _0x101025={'where':_0x40d890[_0x6474('0x3b')]};return db['ZendeskField'][_0x6474('0x1a')](_0x101025)[_0x6474('0x21')](function(_0x1d3b5e){_0x501685[_0x6474('0x1a')]=_0x1d3b5e;if(_0x16c169[_0x6474('0x2c')][_0x6474('0x3c')]){_0x40d890['include']=[{'all':!![]}];}return db[_0x6474('0x3d')][_0x6474('0x3e')](_0x40d890);})['then'](function(_0x5c6dfc){_0x501685['rows']=_0x5c6dfc;return _0x501685;})[_0x6474('0x21')](respondWithFilteredResult(_0x40d15c,_0x40d890))[_0x6474('0x3f')](handleError(_0x40d15c,null));};exports['show']=function(_0x4cd8ff,_0x48b1b2){var _0x2646db={'raw':!![],'where':{'id':_0x4cd8ff[_0x6474('0x40')]['id']}},_0x1bbf98={};_0x1bbf98[_0x6474('0x2b')]=_[_0x6474('0x2d')](db['ZendeskField'][_0x6474('0x28')]);_0x1bbf98[_0x6474('0x2c')]=_[_0x6474('0x2d')](_0x4cd8ff[_0x6474('0x2c')]);_0x1bbf98[_0x6474('0x2e')]=_[_0x6474('0x30')](_0x1bbf98[_0x6474('0x2b')],_0x1bbf98[_0x6474('0x2c')]);_0x2646db[_0x6474('0x2f')]=_[_0x6474('0x30')](_0x1bbf98[_0x6474('0x2b')],qs['fields'](_0x4cd8ff[_0x6474('0x2c')][_0x6474('0x31')]));_0x2646db[_0x6474('0x2f')]=_0x2646db[_0x6474('0x2f')][_0x6474('0x32')]?_0x2646db[_0x6474('0x2f')]:_0x1bbf98[_0x6474('0x2b')];if(_0x4cd8ff[_0x6474('0x2c')][_0x6474('0x3c')]){_0x2646db[_0x6474('0x41')]=[{'all':!![]}];}_0x2646db=_[_0x6474('0x3a')]({},_0x2646db,_0x4cd8ff[_0x6474('0x42')]);return db[_0x6474('0x3d')][_0x6474('0x43')](_0x2646db)[_0x6474('0x21')](handleEntityNotFound(_0x48b1b2,null))[_0x6474('0x21')](respondWithResult(_0x48b1b2,null))[_0x6474('0x3f')](handleError(_0x48b1b2,null));};exports['create']=function(_0x28f2ad,_0x8029ec){return db[_0x6474('0x3d')][_0x6474('0x44')](_0x28f2ad[_0x6474('0x45')],{})[_0x6474('0x21')](respondWithResult(_0x8029ec,0xc9))[_0x6474('0x3f')](handleError(_0x8029ec,null));};exports[_0x6474('0x20')]=function(_0x28917a,_0x167453){if(_0x28917a[_0x6474('0x45')]['id']){delete _0x28917a[_0x6474('0x45')]['id'];}return db[_0x6474('0x3d')][_0x6474('0x43')]({'where':{'id':_0x28917a['params']['id']}})['then'](handleEntityNotFound(_0x167453,null))[_0x6474('0x21')](saveUpdates(_0x28917a[_0x6474('0x45')],null))[_0x6474('0x21')](respondWithResult(_0x167453,null))[_0x6474('0x3f')](handleError(_0x167453,null));};exports[_0x6474('0x22')]=function(_0x25cda3,_0x327283){return db['ZendeskField']['find']({'where':{'id':_0x25cda3['params']['id']}})['then'](handleEntityNotFound(_0x327283,null))[_0x6474('0x21')](removeEntity(_0x327283,null))[_0x6474('0x3f')](handleError(_0x327283,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 17bb76a..992506f 100644 --- a/server/api/intZendeskField/intZendeskField.model.js +++ b/server/api/intZendeskField/intZendeskField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c96=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','FieldId'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9c96,0x150));var _0x69c9=function(_0x3e0cda,_0x10a569){_0x3e0cda=_0x3e0cda-0x0;var _0x3fee1b=_0x9c96[_0x3e0cda];return _0x3fee1b;};'use strict';var _=require(_0x69c9('0x0'));var util=require(_0x69c9('0x1'));var logger=require(_0x69c9('0x2'))(_0x69c9('0x3'));var moment=require(_0x69c9('0x4'));var BPromise=require(_0x69c9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x69c9('0x6'));var rimraf=require('rimraf');var config=require(_0x69c9('0x7'));var attributes=require(_0x69c9('0x8'));module[_0x69c9('0x9')]=function(_0x1cd00e,_0x47b9b6){return _0x1cd00e[_0x69c9('0xa')](_0x69c9('0xb'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x69c9('0xc'),'fields':['idField',_0x69c9('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xec63=['ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','define'];(function(_0x560894,_0x5ad9ba){var _0x37e22b=function(_0xb7b0b5){while(--_0xb7b0b5){_0x560894['push'](_0x560894['shift']());}};_0x37e22b(++_0x5ad9ba);}(_0xec63,0x155));var _0x3ec6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec63[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x3ec6('0x0'));var logger=require(_0x3ec6('0x1'))('api');var moment=require(_0x3ec6('0x2'));var BPromise=require(_0x3ec6('0x3'));var rp=require(_0x3ec6('0x4'));var fs=require('fs');var path=require(_0x3ec6('0x5'));var rimraf=require(_0x3ec6('0x6'));var config=require('../../config/environment');var attributes=require(_0x3ec6('0x7'));module['exports']=function(_0x240718,_0x31524a){return _0x240718[_0x3ec6('0x8')](_0x3ec6('0x9'),attributes,{'tableName':_0x3ec6('0xa'),'paranoid':![],'indexes':[{'name':_0x3ec6('0xb'),'fields':[_0x3ec6('0xc'),_0x3ec6('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 260b5fb..72f5a41 100644 --- a/server/api/intZendeskField/intZendeskField.rpc.js +++ b/server/api/intZendeskField/intZendeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7b3=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x5be253,_0x470b74){var _0x3fee0e=function(_0x12e485){while(--_0x12e485){_0x5be253['push'](_0x5be253['shift']());}};_0x3fee0e(++_0x470b74);}(_0xa7b3,0x7f));var _0x3a7b=function(_0x3b2bb4,_0x1c48c8){_0x3b2bb4=_0x3b2bb4-0x0;var _0x497e44=_0xa7b3[_0x3b2bb4];return _0x497e44;};'use strict';var _=require('lodash');var util=require(_0x3a7b('0x0'));var moment=require(_0x3a7b('0x1'));var BPromise=require(_0x3a7b('0x2'));var rs=require(_0x3a7b('0x3'));var fs=require('fs');var Redis=require(_0x3a7b('0x4'));var db=require(_0x3a7b('0x5'))['db'];var utils=require(_0x3a7b('0x6'));var logger=require(_0x3a7b('0x7'))('rpc');var config=require(_0x3a7b('0x8'));var jayson=require(_0x3a7b('0x9'));var client=jayson['client'][_0x3a7b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30e06f,_0x382585,_0x5a5548){return new BPromise(function(_0x37c659,_0x2c5027){return client[_0x3a7b('0xb')](_0x30e06f,_0x5a5548)[_0x3a7b('0xc')](function(_0x23152b){logger[_0x3a7b('0xd')](_0x3a7b('0xe'),_0x382585,_0x3a7b('0xf'));logger[_0x3a7b('0x10')](_0x3a7b('0x11'),_0x382585,'request\x20sent',JSON['stringify'](_0x23152b));if(_0x23152b[_0x3a7b('0x12')]){if(_0x23152b[_0x3a7b('0x12')][_0x3a7b('0x13')]===0x1f4){logger['error'](_0x3a7b('0xe'),_0x382585,_0x23152b[_0x3a7b('0x12')]['message']);return _0x2c5027(_0x23152b[_0x3a7b('0x12')][_0x3a7b('0x14')]);}logger['error'](_0x3a7b('0xe'),_0x382585,_0x23152b[_0x3a7b('0x12')][_0x3a7b('0x14')]);return _0x37c659(_0x23152b[_0x3a7b('0x12')][_0x3a7b('0x14')]);}else{logger[_0x3a7b('0xd')](_0x3a7b('0xe'),_0x382585,_0x3a7b('0xf'));_0x37c659(_0x23152b['result'][_0x3a7b('0x14')]);}})[_0x3a7b('0x15')](function(_0x4ef295){logger[_0x3a7b('0x12')](_0x3a7b('0xe'),_0x382585,_0x4ef295);_0x2c5027(_0x4ef295);});});} \ No newline at end of file +var _0x6421=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1e28a9,_0x3a6fda){var _0x15d4f1=function(_0x1ba185){while(--_0x1ba185){_0x1e28a9['push'](_0x1e28a9['shift']());}};_0x15d4f1(++_0x3a6fda);}(_0x6421,0x188));var _0x1642=function(_0x40cbb0,_0x4dc8f6){_0x40cbb0=_0x40cbb0-0x0;var _0x4d3db6=_0x6421[_0x40cbb0];return _0x4d3db6;};'use strict';var _=require(_0x1642('0x0'));var util=require(_0x1642('0x1'));var moment=require(_0x1642('0x2'));var BPromise=require(_0x1642('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1642('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1642('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1642('0x6'));var jayson=require(_0x1642('0x7'));var client=jayson[_0x1642('0x8')][_0x1642('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3146e8,_0x1d7b15,_0x3fd9e6){return new BPromise(function(_0xe1413f,_0x2cfeb6){return client[_0x1642('0xa')](_0x3146e8,_0x3fd9e6)[_0x1642('0xb')](function(_0x29c45c){logger[_0x1642('0xc')](_0x1642('0xd'),_0x1d7b15,'request\x20sent');logger[_0x1642('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x1d7b15,_0x1642('0xf'),JSON[_0x1642('0x10')](_0x29c45c));if(_0x29c45c['error']){if(_0x29c45c[_0x1642('0x11')][_0x1642('0x12')]===0x1f4){logger[_0x1642('0x11')](_0x1642('0xd'),_0x1d7b15,_0x29c45c['error'][_0x1642('0x13')]);return _0x2cfeb6(_0x29c45c[_0x1642('0x11')][_0x1642('0x13')]);}logger[_0x1642('0x11')](_0x1642('0xd'),_0x1d7b15,_0x29c45c[_0x1642('0x11')][_0x1642('0x13')]);return _0xe1413f(_0x29c45c[_0x1642('0x11')][_0x1642('0x13')]);}else{logger[_0x1642('0xc')](_0x1642('0xd'),_0x1d7b15,'request\x20sent');_0xe1413f(_0x29c45c[_0x1642('0x14')][_0x1642('0x13')]);}})[_0x1642('0x15')](function(_0x7e008f){logger[_0x1642('0x11')](_0x1642('0xd'),_0x1d7b15,_0x7e008f);_0x2cfeb6(_0x7e008f);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index a4fbe4b..a469c2e 100644 --- a/server/api/intZohoAccount/index.js +++ b/server/api/intZohoAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe570=['../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','index','/:id','isAuthenticated','show','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x5d8c3a,_0x52c448){var _0x5fbe1b=function(_0x5a07b4){while(--_0x5a07b4){_0x5d8c3a['push'](_0x5d8c3a['shift']());}};_0x5fbe1b(++_0x52c448);}(_0xe570,0x10e));var _0x0e57=function(_0x141b9a,_0x32c1fa){_0x141b9a=_0x141b9a-0x0;var _0x23cd92=_0xe570[_0x141b9a];return _0x23cd92;};'use strict';var multer=require(_0x0e57('0x0'));var util=require(_0x0e57('0x1'));var path=require(_0x0e57('0x2'));var timeout=require(_0x0e57('0x3'));var express=require('express');var router=express[_0x0e57('0x4')]();var fs_extra=require(_0x0e57('0x5'));var auth=require(_0x0e57('0x6'));var interaction=require(_0x0e57('0x7'));var config=require('../../config/environment');var controller=require(_0x0e57('0x8'));router[_0x0e57('0x9')]('/',auth['isAuthenticated'](),controller[_0x0e57('0xa')]);router[_0x0e57('0x9')](_0x0e57('0xb'),auth[_0x0e57('0xc')](),controller[_0x0e57('0xd')]);router[_0x0e57('0x9')]('/:id/configurations',auth[_0x0e57('0xc')](),controller[_0x0e57('0xe')]);router[_0x0e57('0x9')]('/:id/fields',auth[_0x0e57('0xc')](),controller[_0x0e57('0xf')]);router[_0x0e57('0x10')]('/',auth[_0x0e57('0xc')](),controller[_0x0e57('0x11')]);router[_0x0e57('0x10')](_0x0e57('0x12'),auth['isAuthenticated'](),controller[_0x0e57('0x13')]);router['put'](_0x0e57('0xb'),auth[_0x0e57('0xc')](),controller[_0x0e57('0x14')]);router[_0x0e57('0x15')]('/:id',auth[_0x0e57('0xc')](),controller[_0x0e57('0x16')]);module['exports']=router; \ No newline at end of file +var _0xb281=['exports','multer','util','path','fs-extra','../../config/environment','./intZohoAccount.controller','get','index','/:id','show','/:id/configurations','isAuthenticated','/:id/fields','post','create','addConfiguration','update','delete','destroy'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xb281,0x65));var _0x1b28=function(_0x96783a,_0x56b31f){_0x96783a=_0x96783a-0x0;var _0x2d279=_0xb281[_0x96783a];return _0x2d279;};'use strict';var multer=require(_0x1b28('0x0'));var util=require(_0x1b28('0x1'));var path=require(_0x1b28('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1b28('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b28('0x4'));var controller=require(_0x1b28('0x5'));router[_0x1b28('0x6')]('/',auth['isAuthenticated'](),controller[_0x1b28('0x7')]);router[_0x1b28('0x6')](_0x1b28('0x8'),auth['isAuthenticated'](),controller[_0x1b28('0x9')]);router[_0x1b28('0x6')](_0x1b28('0xa'),auth[_0x1b28('0xb')](),controller['getConfigurations']);router[_0x1b28('0x6')](_0x1b28('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x1b28('0xd')]('/',auth[_0x1b28('0xb')](),controller[_0x1b28('0xe')]);router[_0x1b28('0xd')](_0x1b28('0xa'),auth[_0x1b28('0xb')](),controller[_0x1b28('0xf')]);router['put'](_0x1b28('0x8'),auth[_0x1b28('0xb')](),controller[_0x1b28('0x10')]);router[_0x1b28('0x11')](_0x1b28('0x8'),auth[_0x1b28('0xb')](),controller[_0x1b28('0x12')]);module[_0x1b28('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 07a5720..6fa42d4 100644 --- a/server/api/intZohoAccount/intZohoAccount.attributes.js +++ b/server/api/intZohoAccount/intZohoAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['sequelize','exports','STRING'];(function(_0x30a204,_0x48370f){var _0x1a1350=function(_0x5844db){while(--_0x5844db){_0x30a204['push'](_0x30a204['shift']());}};_0x1a1350(++_0x48370f);}(_0x34e8,0x12c));var _0x834e=function(_0x4a9213,_0x17eb19){_0x4a9213=_0x4a9213-0x0;var _0x3a770b=_0x34e8[_0x4a9213];return _0x3a770b;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')]},'description':{'type':Sequelize[_0x834e('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x834e('0x2')]},'clientId':{'type':Sequelize[_0x834e('0x2')]},'clientSecret':{'type':Sequelize[_0x834e('0x2')]},'serverUrl':{'type':Sequelize[_0x834e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x834e('0x2')]},'refreshToken':{'type':Sequelize[_0x834e('0x2')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','sequelize'];(function(_0x4522da,_0xe3041d){var _0x5eb803=function(_0x2ff978){while(--_0x2ff978){_0x4522da['push'](_0x4522da['shift']());}};_0x5eb803(++_0xe3041d);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x18ea8a,_0x32f09f){_0x18ea8a=_0x18ea8a-0x0;var _0x19c99a=_0xf3cd[_0x18ea8a];return _0x19c99a;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'name':{'type':Sequelize[_0xdf3c('0x2')]},'description':{'type':Sequelize[_0xdf3c('0x2')]},'host':{'type':Sequelize[_0xdf3c('0x2')]},'zone':{'type':Sequelize[_0xdf3c('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xdf3c('0x2')]},'serverUrl':{'type':Sequelize[_0xdf3c('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xdf3c('0x2')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index b3d92c9..009f958 100644 --- a/server/api/intZohoAccount/intZohoAccount.controller.js +++ b/server/api/intZohoAccount/intZohoAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7372=['find','create','body','params','getConfigurations','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','getFields','host','clientId','serverUrl','code','zoho.eu','com','slice','substring','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Type','remove','push','display_label','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ZohoAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','count','includeAll','include','findAll','catch','show'];(function(_0xfa8d0e,_0x1ea321){var _0x4c6e03=function(_0xbc7455){while(--_0xbc7455){_0xfa8d0e['push'](_0xfa8d0e['shift']());}};_0x4c6e03(++_0x1ea321);}(_0x7372,0xb3));var _0x2737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7372[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2737('0x0'));var rimraf=require(_0x2737('0x1'));var zipdir=require(_0x2737('0x2'));var jsonpatch=require(_0x2737('0x3'));var rp=require(_0x2737('0x4'));var moment=require(_0x2737('0x5'));var BPromise=require(_0x2737('0x6'));var Mustache=require(_0x2737('0x7'));var util=require(_0x2737('0x8'));var path=require('path');var sox=require(_0x2737('0x9'));var csv=require(_0x2737('0xa'));var ejs=require(_0x2737('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2737('0xc'));var squel=require(_0x2737('0xd'));var crypto=require('crypto');var jsforce=require(_0x2737('0xe'));var deskjs=require(_0x2737('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2737('0x10'));var Papa=require('papaparse');var Redis=require(_0x2737('0x11'));var authService=require(_0x2737('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2737('0x13'));var hardwareService=require(_0x2737('0x14'));var logger=require(_0x2737('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2737('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x2737('0x17'));function respondWithStatusCode(_0x49356f,_0x2a5d3f){_0x2a5d3f=_0x2a5d3f||0xcc;return function(_0xd8a6a2){if(_0xd8a6a2){return _0x49356f[_0x2737('0x18')](_0x2a5d3f);}return _0x49356f['status'](_0x2a5d3f)[_0x2737('0x19')]();};}function respondWithResult(_0x41c495,_0x39c9a1){_0x39c9a1=_0x39c9a1||0xc8;return function(_0x556575){if(_0x556575){return _0x41c495[_0x2737('0x1a')](_0x39c9a1)[_0x2737('0x1b')](_0x556575);}};}function respondWithFilteredResult(_0x2f1e32,_0xcd14c9){return function(_0x28150b){if(_0x28150b){var _0x49fd83=typeof _0xcd14c9['offset']===_0x2737('0x1c')&&typeof _0xcd14c9[_0x2737('0x1d')]==='undefined';var _0x4d2fb2=_0x28150b['count'];var _0x281afd=_0x49fd83?0x0:_0xcd14c9['offset'];var _0x2380d9=_0x49fd83?_0x28150b['count']:_0xcd14c9[_0x2737('0x1e')]+_0xcd14c9[_0x2737('0x1d')];var _0x3280dd;if(_0x2380d9>=_0x4d2fb2){_0x2380d9=_0x4d2fb2;_0x3280dd=0xc8;}else{_0x3280dd=0xce;}_0x2f1e32[_0x2737('0x1a')](_0x3280dd);return _0x2f1e32[_0x2737('0x1f')](_0x2737('0x20'),_0x281afd+'-'+_0x2380d9+'/'+_0x4d2fb2)[_0x2737('0x1b')](_0x28150b);}return null;};}function patchUpdates(_0x85e61c){return function(_0x329743){try{jsonpatch[_0x2737('0x21')](_0x329743,_0x85e61c,!![]);}catch(_0xf319f6){return BPromise[_0x2737('0x22')](_0xf319f6);}return _0x329743[_0x2737('0x23')]();};}function saveUpdates(_0x101ee9,_0x323213){return function(_0x5dc232){if(_0x5dc232){return _0x5dc232[_0x2737('0x24')](_0x101ee9)[_0x2737('0x25')](function(_0x17933f){return _0x17933f;});}return null;};}function removeEntity(_0x50c0fa,_0x13d654){return function(_0xe301a2){if(_0xe301a2){return _0xe301a2[_0x2737('0x26')]()[_0x2737('0x25')](function(){_0x50c0fa[_0x2737('0x1a')](0xcc)[_0x2737('0x19')]();});}};}function handleEntityNotFound(_0x34967f,_0x63fcf4){return function(_0x159f53){if(!_0x159f53){_0x34967f['sendStatus'](0x194);}return _0x159f53;};}function handleError(_0x327827,_0x1a4e27){_0x1a4e27=_0x1a4e27||0x1f4;return function(_0x1146f6){logger[_0x2737('0x27')](_0x1146f6['stack']);if(_0x1146f6[_0x2737('0x28')]){delete _0x1146f6[_0x2737('0x28')];}_0x327827[_0x2737('0x1a')](_0x1a4e27)[_0x2737('0x29')](_0x1146f6);};}exports[_0x2737('0x2a')]=function(_0x5a1af5,_0x5889fe){var _0x29d6e8={},_0x4ff9b7={},_0x159fdd={'count':0x0,'rows':[]};var _0x331ec8=_[_0x2737('0x2b')](db[_0x2737('0x2c')][_0x2737('0x2d')],function(_0x32152e){return{'name':_0x32152e['fieldName'],'type':_0x32152e['type'][_0x2737('0x2e')]};});_0x4ff9b7[_0x2737('0x2f')]=_[_0x2737('0x2b')](_0x331ec8,_0x2737('0x28'));_0x4ff9b7[_0x2737('0x30')]=_[_0x2737('0x31')](_0x5a1af5[_0x2737('0x30')]);_0x4ff9b7[_0x2737('0x32')]=_[_0x2737('0x33')](_0x4ff9b7['model'],_0x4ff9b7[_0x2737('0x30')]);_0x29d6e8[_0x2737('0x34')]=_[_0x2737('0x33')](_0x4ff9b7[_0x2737('0x2f')],qs[_0x2737('0x35')](_0x5a1af5[_0x2737('0x30')][_0x2737('0x35')]));_0x29d6e8[_0x2737('0x34')]=_0x29d6e8['attributes'][_0x2737('0x36')]?_0x29d6e8['attributes']:_0x4ff9b7[_0x2737('0x2f')];if(!_0x5a1af5[_0x2737('0x30')][_0x2737('0x37')](_0x2737('0x38'))){_0x29d6e8[_0x2737('0x1d')]=qs[_0x2737('0x1d')](_0x5a1af5[_0x2737('0x30')][_0x2737('0x1d')]);_0x29d6e8[_0x2737('0x1e')]=qs[_0x2737('0x1e')](_0x5a1af5[_0x2737('0x30')]['offset']);}_0x29d6e8[_0x2737('0x39')]=qs[_0x2737('0x3a')](_0x5a1af5[_0x2737('0x30')][_0x2737('0x3a')]);_0x29d6e8[_0x2737('0x3b')]=qs[_0x2737('0x32')](_[_0x2737('0x3c')](_0x5a1af5[_0x2737('0x30')],_0x4ff9b7['filters']),_0x331ec8);if(_0x5a1af5[_0x2737('0x30')][_0x2737('0x3d')]){_0x29d6e8[_0x2737('0x3b')]=_[_0x2737('0x3e')](_0x29d6e8[_0x2737('0x3b')],{'$or':_[_0x2737('0x2b')](_0x331ec8,function(_0x5f3114){if(_0x5f3114[_0x2737('0x3f')]!=='VIRTUAL'){var _0x2f9bf6={};_0x2f9bf6[_0x5f3114[_0x2737('0x28')]]={'$like':'%'+_0x5a1af5[_0x2737('0x30')][_0x2737('0x3d')]+'%'};return _0x2f9bf6;}})});}_0x29d6e8=_[_0x2737('0x3e')]({},_0x29d6e8,_0x5a1af5[_0x2737('0x40')]);var _0x239152={'where':_0x29d6e8[_0x2737('0x3b')]};return db[_0x2737('0x2c')][_0x2737('0x41')](_0x239152)[_0x2737('0x25')](function(_0x192c37){_0x159fdd['count']=_0x192c37;if(_0x5a1af5[_0x2737('0x30')][_0x2737('0x42')]){_0x29d6e8[_0x2737('0x43')]=[{'all':!![]}];}return db[_0x2737('0x2c')][_0x2737('0x44')](_0x29d6e8);})[_0x2737('0x25')](function(_0x4b9bc3){_0x159fdd['rows']=_0x4b9bc3;return _0x159fdd;})[_0x2737('0x25')](respondWithFilteredResult(_0x5889fe,_0x29d6e8))[_0x2737('0x45')](handleError(_0x5889fe,null));};exports[_0x2737('0x46')]=function(_0x4c5261,_0x616399){var _0x20d053={'raw':![],'where':{'id':_0x4c5261['params']['id']}},_0x18dc3b={};_0x18dc3b[_0x2737('0x2f')]=_[_0x2737('0x31')](db[_0x2737('0x2c')][_0x2737('0x2d')]);_0x18dc3b[_0x2737('0x30')]=_[_0x2737('0x31')](_0x4c5261['query']);_0x18dc3b[_0x2737('0x32')]=_['intersection'](_0x18dc3b[_0x2737('0x2f')],_0x18dc3b[_0x2737('0x30')]);_0x20d053[_0x2737('0x34')]=_[_0x2737('0x33')](_0x18dc3b[_0x2737('0x2f')],qs['fields'](_0x4c5261[_0x2737('0x30')]['fields']));_0x20d053[_0x2737('0x34')]=_0x20d053['attributes'][_0x2737('0x36')]?_0x20d053[_0x2737('0x34')]:_0x18dc3b[_0x2737('0x2f')];if(_0x4c5261[_0x2737('0x30')]['includeAll']){_0x20d053[_0x2737('0x43')]=[{'all':!![]}];}_0x20d053=_[_0x2737('0x3e')]({},_0x20d053,_0x4c5261[_0x2737('0x40')]);return db[_0x2737('0x2c')][_0x2737('0x47')](_0x20d053)[_0x2737('0x25')](handleEntityNotFound(_0x616399,null))[_0x2737('0x25')](respondWithResult(_0x616399,null))['catch'](handleError(_0x616399,null));};exports[_0x2737('0x48')]=function(_0x3ea127,_0x3080ed){return db[_0x2737('0x2c')][_0x2737('0x48')](_0x3ea127[_0x2737('0x49')],{})[_0x2737('0x25')](respondWithResult(_0x3080ed,0xc9))['catch'](handleError(_0x3080ed,null));};exports[_0x2737('0x24')]=function(_0x318df8,_0x2a0fb5){if(_0x318df8[_0x2737('0x49')]['id']){delete _0x318df8[_0x2737('0x49')]['id'];}return db['ZohoAccount'][_0x2737('0x47')]({'where':{'id':_0x318df8[_0x2737('0x4a')]['id']}})[_0x2737('0x25')](handleEntityNotFound(_0x2a0fb5,null))[_0x2737('0x25')](saveUpdates(_0x318df8['body'],null))[_0x2737('0x25')](respondWithResult(_0x2a0fb5,null))[_0x2737('0x45')](handleError(_0x2a0fb5,null));};exports[_0x2737('0x26')]=function(_0x2e9ffb,_0x187ea3){return db[_0x2737('0x2c')][_0x2737('0x47')]({'where':{'id':_0x2e9ffb[_0x2737('0x4a')]['id']}})['then'](handleEntityNotFound(_0x187ea3,null))[_0x2737('0x25')](removeEntity(_0x187ea3,null))['catch'](handleError(_0x187ea3,null));};exports[_0x2737('0x4b')]=function(_0x23d31c,_0x3441d5,_0x18b8dd){var _0x5ca40a={};var _0x5ae122={};var _0x808067;var _0x37dbc6;return db[_0x2737('0x2c')]['findOne']({'where':{'id':_0x23d31c[_0x2737('0x4a')]['id']}})[_0x2737('0x25')](handleEntityNotFound(_0x3441d5,null))[_0x2737('0x25')](function(_0x3a61a5){if(_0x3a61a5){_0x808067=_0x3a61a5;_0x5ae122[_0x2737('0x2f')]=_[_0x2737('0x31')](db['ZohoConfiguration'][_0x2737('0x2d')]);_0x5ae122[_0x2737('0x30')]=_[_0x2737('0x31')](_0x23d31c[_0x2737('0x30')]);_0x5ae122[_0x2737('0x32')]=_[_0x2737('0x33')](_0x5ae122[_0x2737('0x2f')],_0x5ae122[_0x2737('0x30')]);_0x5ca40a['attributes']=_[_0x2737('0x33')](_0x5ae122['model'],qs['fields'](_0x23d31c[_0x2737('0x30')][_0x2737('0x35')]));_0x5ca40a['attributes']=_0x5ca40a[_0x2737('0x34')][_0x2737('0x36')]?_0x5ca40a['attributes']:_0x5ae122[_0x2737('0x2f')];_0x5ca40a['order']=qs[_0x2737('0x3a')](_0x23d31c[_0x2737('0x30')][_0x2737('0x3a')]);_0x5ca40a[_0x2737('0x3b')]=qs[_0x2737('0x32')](_[_0x2737('0x3c')](_0x23d31c[_0x2737('0x30')],_0x5ae122[_0x2737('0x32')]));if(_0x23d31c[_0x2737('0x30')][_0x2737('0x3d')]){_0x5ca40a[_0x2737('0x3b')]=_['merge'](_0x5ca40a[_0x2737('0x3b')],{'$or':_['map'](_0x5ca40a[_0x2737('0x34')],function(_0x3645de){var _0x3e9c6d={};_0x3e9c6d[_0x3645de]={'$like':'%'+_0x23d31c[_0x2737('0x30')][_0x2737('0x3d')]+'%'};return _0x3e9c6d;})});}_0x5ca40a=_[_0x2737('0x3e')]({},_0x5ca40a,_0x23d31c[_0x2737('0x40')]);return _0x808067[_0x2737('0x4b')](_0x5ca40a);}})[_0x2737('0x25')](function(_0x2f602a){if(_0x2f602a){_0x37dbc6=_0x2f602a[_0x2737('0x36')];if(!_0x23d31c['query'][_0x2737('0x37')](_0x2737('0x38'))){_0x5ca40a[_0x2737('0x1d')]=qs[_0x2737('0x1d')](_0x23d31c[_0x2737('0x30')][_0x2737('0x1d')]);_0x5ca40a[_0x2737('0x1e')]=qs['offset'](_0x23d31c[_0x2737('0x30')][_0x2737('0x1e')]);}return _0x808067[_0x2737('0x4b')](_0x5ca40a);}})[_0x2737('0x25')](function(_0x4ea45b){if(_0x4ea45b){return _0x4ea45b?{'count':_0x37dbc6,'rows':_0x4ea45b}:null;}})[_0x2737('0x25')](respondWithResult(_0x3441d5,null))['catch'](handleError(_0x3441d5,null));};exports[_0x2737('0x4c')]=function(_0x47e2f4,_0x4f4515,_0x1afb58){if(_0x47e2f4[_0x2737('0x49')]['id']){delete _0x47e2f4['body']['id'];}return db[_0x2737('0x2c')][_0x2737('0x4d')]({'where':{'id':_0x47e2f4[_0x2737('0x4a')]['id']}})[_0x2737('0x25')](handleEntityNotFound(_0x4f4515,null))[_0x2737('0x25')](function(_0x1d8c58){if(_0x1d8c58){_0x47e2f4[_0x2737('0x49')][_0x2737('0x4e')]=_0x1d8c58['id'];_0x47e2f4[_0x2737('0x49')]['Subjects']=integrations[_0x2737('0x4f')](_0x47e2f4[_0x2737('0x49')][_0x2737('0x50')],_0x47e2f4[_0x2737('0x49')][_0x2737('0x3f')]);_0x47e2f4[_0x2737('0x49')][_0x2737('0x51')]=integrations[_0x2737('0x52')](_0x47e2f4['body'][_0x2737('0x50')],_0x47e2f4[_0x2737('0x49')][_0x2737('0x3f')]);return db[_0x2737('0x53')][_0x2737('0x48')](_0x47e2f4['body'],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0x2737('0x54')],'as':'Descriptions'}]});}return null;})[_0x2737('0x25')](respondWithResult(_0x4f4515,null))[_0x2737('0x45')](handleError(_0x4f4515,null));};function getAccessToken(_0x1bb685){return new Promise(function(_0x57cf77,_0x415fc6){var _0x381c63;switch(_0x1bb685[_0x2737('0x55')]){case'US':_0x381c63='https://accounts.zoho.com';break;case'AU':_0x381c63=_0x2737('0x56');break;case'EU':_0x381c63='https://accounts.zoho.eu';break;case'IN':_0x381c63='https://accounts.zoho.in';break;case'CN':_0x381c63='https://accounts.zoho.com.cn';break;default:_0x381c63=_0x2737('0x57');break;}var _0x48f302={'method':_0x2737('0x58'),'uri':_0x381c63+_0x2737('0x59'),'qs':{'refresh_token':_0x1bb685[_0x2737('0x5a')],'client_id':_0x1bb685['clientId'],'client_secret':_0x1bb685[_0x2737('0x5b')],'grant_type':_0x2737('0x5c')},'json':!![]};return rp(_0x48f302)[_0x2737('0x25')](function(_0x3337db){if(_0x3337db['access_token']){_0x57cf77(_0x3337db[_0x2737('0x5d')]);}else{_0x415fc6('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x2737('0x45')](function(_0x217b61){_0x415fc6(_0x217b61);});});}exports[_0x2737('0x5e')]=function(_0x48a92d,_0x2ddac9,_0x3f3b63){var _0x21c45b,_0x5b7c9a,_0x4be8b1,_0x3e8037,_0x4e4005;return db[_0x2737('0x2c')]['findOne']({'where':{'id':_0x48a92d[_0x2737('0x4a')]['id']},'attributes':['id',_0x2737('0x5f'),_0x2737('0x55'),_0x2737('0x60'),_0x2737('0x5b'),_0x2737('0x61'),_0x2737('0x62'),'refreshToken']})[_0x2737('0x25')](handleEntityNotFound(_0x2ddac9,null))[_0x2737('0x25')](function(_0xea98bc){_0x4e4005=_0xea98bc;_0x21c45b=_0x4e4005['host'];_0x5b7c9a=_0x21c45b===_0x2737('0x63')?'eu':_0x2737('0x64');_0x4be8b1=_0x4e4005[_0x2737('0x61')];var _0x4f3395=_0x4be8b1[_0x2737('0x65')](-0x1);if(_0x4f3395==='/'||_0x4f3395==='\x5c'||_0x4f3395===':'){_0x4be8b1=_0x4be8b1[_0x2737('0x66')](0x0,_0x4be8b1['lastIndexOf'](_0x4f3395));}if(!_0x4e4005[_0x2737('0x5a')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x4e4005);})['then'](function(_0x358a3d){if(_0x358a3d){return rp({'method':_0x2737('0x67'),'uri':util['format'](_0x2737('0x68'),_0x5b7c9a),'qs':{'module':_0x2737('0x69')},'headers':{'Authorization':_0x2737('0x6a')+_0x358a3d},'json':!![]});}})[_0x2737('0x25')](function(_0x3040f7){if(_0x3040f7){if(_0x3040f7[_0x2737('0x6b')]&&_0x3040f7[_0x2737('0x6b')][_0x2737('0x27')]){throw new Error(_0x3040f7[_0x2737('0x6b')][_0x2737('0x27')][_0x2737('0x6c')]);}var _0x40ce5b=[];var _0x324bd1=[];var _0x1be0d7=[_0x2737('0x6d'),_0x2737('0x6e'),_0x2737('0x6f'),'WhoId',_0x2737('0x70'),_0x2737('0x71'),'Call_Start_Time',_0x2737('0x72')];_0x324bd1=_[_0x2737('0x73')](_0x3040f7['fields'],function(_0x11cf44){return _0x1be0d7['includes'](_0x11cf44['api_name']);});for(var _0x36eaca=0x0;_0x36eaca<_0x324bd1[_0x2737('0x36')];_0x36eaca++){if(_0x324bd1[_0x36eaca]['system_mandatory']===![]){_0x40ce5b[_0x2737('0x74')]({'id':_0x324bd1[_0x36eaca]['id'],'name':_0x324bd1[_0x36eaca][_0x2737('0x75')],'custom':_0x324bd1[_0x36eaca]['custom_field'],'options':_0x324bd1[_0x36eaca][_0x2737('0x76')]===_0x2737('0x77')&&_0x324bd1[_0x36eaca][_0x2737('0x78')]['length']>-0x1?_[_0x2737('0x2b')](_0x324bd1[_0x36eaca][_0x2737('0x78')],function(_0x59acf9){return{'name':_0x59acf9,'value':_0x59acf9};}):[]});}}return{'count':_0x40ce5b['length'],'rows':_0x40ce5b};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x2ddac9,null))[_0x2737('0x45')](function(_0x480e67){var _0x126d58=_0x48a92d['query'][_0x2737('0x79')]?0x1f4:_0x480e67[_0x2737('0x7a')]||0x1f4;logger[_0x2737('0x27')](_0x2737('0x7b'),'getFields',_0x126d58,JSON['stringify'](_0x480e67));delete _0x480e67[_0x2737('0x28')];if(_0x126d58===0x191){_0x126d58=0x190;}_0x2ddac9[_0x2737('0x1a')](_0x126d58)[_0x2737('0x29')](_0x48a92d[_0x2737('0x30')][_0x2737('0x79')]?{'message':_0x2737('0x7c'),'statusCode':_0x480e67[_0x2737('0x7a')]}:_0x480e67);});}; \ No newline at end of file +var _0x81bf=['hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','refreshToken','clientSecret','refresh_token','access_token','host','serverUrl','code','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','Zoho-oauthtoken\x20','response','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','push','display_label','custom_field','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','send','map','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','where','filter','VIRTUAL','options','ZohoAccount','includeAll','include','findAll','rows','catch','show','params','length','merge','find','create','body','findOne','ZohoConfiguration','pick','getConfigurations'];(function(_0x2fcfe5,_0x2b8298){var _0x52075a=function(_0xf4ea07){while(--_0xf4ea07){_0x2fcfe5['push'](_0x2fcfe5['shift']());}};_0x52075a(++_0x2b8298);}(_0x81bf,0x1ac));var _0xf81b=function(_0x10c111,_0x17b3e5){_0x10c111=_0x10c111-0x0;var _0x357560=_0x81bf[_0x10c111];return _0x357560;};'use strict';var emlformat=require(_0xf81b('0x0'));var rimraf=require(_0xf81b('0x1'));var zipdir=require(_0xf81b('0x2'));var jsonpatch=require(_0xf81b('0x3'));var rp=require(_0xf81b('0x4'));var moment=require(_0xf81b('0x5'));var BPromise=require(_0xf81b('0x6'));var Mustache=require(_0xf81b('0x7'));var util=require(_0xf81b('0x8'));var path=require(_0xf81b('0x9'));var sox=require(_0xf81b('0xa'));var csv=require(_0xf81b('0xb'));var ejs=require(_0xf81b('0xc'));var fs=require('fs');var fs_extra=require(_0xf81b('0xd'));var _=require(_0xf81b('0xe'));var squel=require(_0xf81b('0xf'));var crypto=require(_0xf81b('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xf81b('0x11'));var toCsv=require(_0xf81b('0xb'));var querystring=require('querystring');var Papa=require(_0xf81b('0x12'));var Redis=require('ioredis');var authService=require(_0xf81b('0x13'));var qs=require(_0xf81b('0x14'));var as=require(_0xf81b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf81b('0x16'))(_0xf81b('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xf81b('0x18'));function respondWithStatusCode(_0x4396b7,_0x3274ee){_0x3274ee=_0x3274ee||0xcc;return function(_0x317f16){if(_0x317f16){return _0x4396b7[_0xf81b('0x19')](_0x3274ee);}return _0x4396b7[_0xf81b('0x1a')](_0x3274ee)[_0xf81b('0x1b')]();};}function respondWithResult(_0x5768ed,_0xad85c2){_0xad85c2=_0xad85c2||0xc8;return function(_0x459dbc){if(_0x459dbc){return _0x5768ed[_0xf81b('0x1a')](_0xad85c2)[_0xf81b('0x1c')](_0x459dbc);}};}function respondWithFilteredResult(_0x5200f5,_0x21d9b0){return function(_0x4f05dd){if(_0x4f05dd){var _0x65096c=typeof _0x21d9b0['offset']===_0xf81b('0x1d')&&typeof _0x21d9b0[_0xf81b('0x1e')]===_0xf81b('0x1d');var _0x6b777b=_0x4f05dd[_0xf81b('0x1f')];var _0x222ffa=_0x65096c?0x0:_0x21d9b0[_0xf81b('0x20')];var _0xe1f380=_0x65096c?_0x4f05dd[_0xf81b('0x1f')]:_0x21d9b0['offset']+_0x21d9b0[_0xf81b('0x1e')];var _0x5d04b0;if(_0xe1f380>=_0x6b777b){_0xe1f380=_0x6b777b;_0x5d04b0=0xc8;}else{_0x5d04b0=0xce;}_0x5200f5['status'](_0x5d04b0);return _0x5200f5[_0xf81b('0x21')](_0xf81b('0x22'),_0x222ffa+'-'+_0xe1f380+'/'+_0x6b777b)[_0xf81b('0x1c')](_0x4f05dd);}return null;};}function patchUpdates(_0x4015b1){return function(_0x1ad282){try{jsonpatch['apply'](_0x1ad282,_0x4015b1,!![]);}catch(_0x1b7286){return BPromise[_0xf81b('0x23')](_0x1b7286);}return _0x1ad282[_0xf81b('0x24')]();};}function saveUpdates(_0x2a4962,_0x198596){return function(_0x568ab1){if(_0x568ab1){return _0x568ab1[_0xf81b('0x25')](_0x2a4962)[_0xf81b('0x26')](function(_0x112b5a){return _0x112b5a;});}return null;};}function removeEntity(_0x46636a,_0x475816){return function(_0x33e7b5){if(_0x33e7b5){return _0x33e7b5[_0xf81b('0x27')]()[_0xf81b('0x26')](function(){_0x46636a[_0xf81b('0x1a')](0xcc)[_0xf81b('0x1b')]();});}};}function handleEntityNotFound(_0x35c0eb,_0x5209fb){return function(_0xd4b1be){if(!_0xd4b1be){_0x35c0eb[_0xf81b('0x19')](0x194);}return _0xd4b1be;};}function handleError(_0x3c1705,_0x73804f){_0x73804f=_0x73804f||0x1f4;return function(_0x4d8d17){logger[_0xf81b('0x28')](_0x4d8d17[_0xf81b('0x29')]);if(_0x4d8d17['name']){delete _0x4d8d17['name'];}_0x3c1705[_0xf81b('0x1a')](_0x73804f)[_0xf81b('0x2a')](_0x4d8d17);};}exports['index']=function(_0x56e95d,_0xeb7235){var _0x59d1a8={},_0x30fd80={},_0x265f8a={'count':0x0,'rows':[]};var _0x2d3f7a=_[_0xf81b('0x2b')](db['ZohoAccount'][_0xf81b('0x2c')],function(_0x16748d){return{'name':_0x16748d[_0xf81b('0x2d')],'type':_0x16748d[_0xf81b('0x2e')][_0xf81b('0x2f')]};});_0x30fd80['model']=_[_0xf81b('0x2b')](_0x2d3f7a,_0xf81b('0x30'));_0x30fd80[_0xf81b('0x31')]=_[_0xf81b('0x32')](_0x56e95d[_0xf81b('0x31')]);_0x30fd80[_0xf81b('0x33')]=_[_0xf81b('0x34')](_0x30fd80['model'],_0x30fd80[_0xf81b('0x31')]);_0x59d1a8[_0xf81b('0x35')]=_[_0xf81b('0x34')](_0x30fd80[_0xf81b('0x36')],qs['fields'](_0x56e95d[_0xf81b('0x31')][_0xf81b('0x37')]));_0x59d1a8[_0xf81b('0x35')]=_0x59d1a8['attributes']['length']?_0x59d1a8[_0xf81b('0x35')]:_0x30fd80[_0xf81b('0x36')];if(!_0x56e95d[_0xf81b('0x31')]['hasOwnProperty'](_0xf81b('0x38'))){_0x59d1a8[_0xf81b('0x1e')]=qs['limit'](_0x56e95d[_0xf81b('0x31')][_0xf81b('0x1e')]);_0x59d1a8[_0xf81b('0x20')]=qs[_0xf81b('0x20')](_0x56e95d[_0xf81b('0x31')]['offset']);}_0x59d1a8[_0xf81b('0x39')]=qs[_0xf81b('0x3a')](_0x56e95d[_0xf81b('0x31')][_0xf81b('0x3a')]);_0x59d1a8[_0xf81b('0x3b')]=qs['filters'](_['pick'](_0x56e95d[_0xf81b('0x31')],_0x30fd80[_0xf81b('0x33')]),_0x2d3f7a);if(_0x56e95d[_0xf81b('0x31')][_0xf81b('0x3c')]){_0x59d1a8[_0xf81b('0x3b')]=_['merge'](_0x59d1a8[_0xf81b('0x3b')],{'$or':_['map'](_0x2d3f7a,function(_0x41565f){if(_0x41565f[_0xf81b('0x2e')]!==_0xf81b('0x3d')){var _0x174615={};_0x174615[_0x41565f[_0xf81b('0x30')]]={'$like':'%'+_0x56e95d[_0xf81b('0x31')][_0xf81b('0x3c')]+'%'};return _0x174615;}})});}_0x59d1a8=_['merge']({},_0x59d1a8,_0x56e95d[_0xf81b('0x3e')]);var _0xab5372={'where':_0x59d1a8[_0xf81b('0x3b')]};return db[_0xf81b('0x3f')][_0xf81b('0x1f')](_0xab5372)['then'](function(_0x333946){_0x265f8a[_0xf81b('0x1f')]=_0x333946;if(_0x56e95d['query'][_0xf81b('0x40')]){_0x59d1a8[_0xf81b('0x41')]=[{'all':!![]}];}return db[_0xf81b('0x3f')][_0xf81b('0x42')](_0x59d1a8);})[_0xf81b('0x26')](function(_0x34a187){_0x265f8a[_0xf81b('0x43')]=_0x34a187;return _0x265f8a;})[_0xf81b('0x26')](respondWithFilteredResult(_0xeb7235,_0x59d1a8))[_0xf81b('0x44')](handleError(_0xeb7235,null));};exports[_0xf81b('0x45')]=function(_0x502eb3,_0x4a49ba){var _0x2829ed={'raw':![],'where':{'id':_0x502eb3[_0xf81b('0x46')]['id']}},_0x455cd3={};_0x455cd3[_0xf81b('0x36')]=_[_0xf81b('0x32')](db[_0xf81b('0x3f')][_0xf81b('0x2c')]);_0x455cd3['query']=_[_0xf81b('0x32')](_0x502eb3[_0xf81b('0x31')]);_0x455cd3[_0xf81b('0x33')]=_[_0xf81b('0x34')](_0x455cd3['model'],_0x455cd3[_0xf81b('0x31')]);_0x2829ed[_0xf81b('0x35')]=_[_0xf81b('0x34')](_0x455cd3[_0xf81b('0x36')],qs[_0xf81b('0x37')](_0x502eb3[_0xf81b('0x31')][_0xf81b('0x37')]));_0x2829ed[_0xf81b('0x35')]=_0x2829ed[_0xf81b('0x35')][_0xf81b('0x47')]?_0x2829ed['attributes']:_0x455cd3[_0xf81b('0x36')];if(_0x502eb3[_0xf81b('0x31')][_0xf81b('0x40')]){_0x2829ed['include']=[{'all':!![]}];}_0x2829ed=_[_0xf81b('0x48')]({},_0x2829ed,_0x502eb3[_0xf81b('0x3e')]);return db['ZohoAccount'][_0xf81b('0x49')](_0x2829ed)[_0xf81b('0x26')](handleEntityNotFound(_0x4a49ba,null))[_0xf81b('0x26')](respondWithResult(_0x4a49ba,null))[_0xf81b('0x44')](handleError(_0x4a49ba,null));};exports[_0xf81b('0x4a')]=function(_0x52d1c2,_0x218b8d){return db['ZohoAccount'][_0xf81b('0x4a')](_0x52d1c2[_0xf81b('0x4b')],{})[_0xf81b('0x26')](respondWithResult(_0x218b8d,0xc9))[_0xf81b('0x44')](handleError(_0x218b8d,null));};exports[_0xf81b('0x25')]=function(_0xfe1bf,_0x41bb1f){if(_0xfe1bf[_0xf81b('0x4b')]['id']){delete _0xfe1bf[_0xf81b('0x4b')]['id'];}return db[_0xf81b('0x3f')][_0xf81b('0x49')]({'where':{'id':_0xfe1bf['params']['id']}})[_0xf81b('0x26')](handleEntityNotFound(_0x41bb1f,null))['then'](saveUpdates(_0xfe1bf[_0xf81b('0x4b')],null))[_0xf81b('0x26')](respondWithResult(_0x41bb1f,null))['catch'](handleError(_0x41bb1f,null));};exports[_0xf81b('0x27')]=function(_0xb32cb1,_0xbdcb1e){return db[_0xf81b('0x3f')][_0xf81b('0x49')]({'where':{'id':_0xb32cb1[_0xf81b('0x46')]['id']}})['then'](handleEntityNotFound(_0xbdcb1e,null))[_0xf81b('0x26')](removeEntity(_0xbdcb1e,null))['catch'](handleError(_0xbdcb1e,null));};exports['getConfigurations']=function(_0x54015d,_0x2073f4,_0xfbf4c7){var _0x560993={};var _0x444090={};var _0x1d12d5;var _0x45d474;return db[_0xf81b('0x3f')][_0xf81b('0x4c')]({'where':{'id':_0x54015d[_0xf81b('0x46')]['id']}})[_0xf81b('0x26')](handleEntityNotFound(_0x2073f4,null))[_0xf81b('0x26')](function(_0x123c9c){if(_0x123c9c){_0x1d12d5=_0x123c9c;_0x444090['model']=_[_0xf81b('0x32')](db[_0xf81b('0x4d')][_0xf81b('0x2c')]);_0x444090[_0xf81b('0x31')]=_[_0xf81b('0x32')](_0x54015d['query']);_0x444090[_0xf81b('0x33')]=_['intersection'](_0x444090['model'],_0x444090['query']);_0x560993[_0xf81b('0x35')]=_[_0xf81b('0x34')](_0x444090[_0xf81b('0x36')],qs['fields'](_0x54015d[_0xf81b('0x31')][_0xf81b('0x37')]));_0x560993[_0xf81b('0x35')]=_0x560993[_0xf81b('0x35')]['length']?_0x560993['attributes']:_0x444090[_0xf81b('0x36')];_0x560993['order']=qs[_0xf81b('0x3a')](_0x54015d['query'][_0xf81b('0x3a')]);_0x560993[_0xf81b('0x3b')]=qs['filters'](_[_0xf81b('0x4e')](_0x54015d[_0xf81b('0x31')],_0x444090[_0xf81b('0x33')]));if(_0x54015d[_0xf81b('0x31')][_0xf81b('0x3c')]){_0x560993[_0xf81b('0x3b')]=_[_0xf81b('0x48')](_0x560993[_0xf81b('0x3b')],{'$or':_[_0xf81b('0x2b')](_0x560993[_0xf81b('0x35')],function(_0x196a87){var _0x5e6862={};_0x5e6862[_0x196a87]={'$like':'%'+_0x54015d[_0xf81b('0x31')]['filter']+'%'};return _0x5e6862;})});}_0x560993=_[_0xf81b('0x48')]({},_0x560993,_0x54015d[_0xf81b('0x3e')]);return _0x1d12d5[_0xf81b('0x4f')](_0x560993);}})[_0xf81b('0x26')](function(_0x41c150){if(_0x41c150){_0x45d474=_0x41c150[_0xf81b('0x47')];if(!_0x54015d[_0xf81b('0x31')][_0xf81b('0x50')]('nolimit')){_0x560993[_0xf81b('0x1e')]=qs[_0xf81b('0x1e')](_0x54015d[_0xf81b('0x31')]['limit']);_0x560993['offset']=qs[_0xf81b('0x20')](_0x54015d[_0xf81b('0x31')][_0xf81b('0x20')]);}return _0x1d12d5[_0xf81b('0x4f')](_0x560993);}})[_0xf81b('0x26')](function(_0x584c94){if(_0x584c94){return _0x584c94?{'count':_0x45d474,'rows':_0x584c94}:null;}})['then'](respondWithResult(_0x2073f4,null))[_0xf81b('0x44')](handleError(_0x2073f4,null));};exports[_0xf81b('0x51')]=function(_0x7cdc68,_0x4509fe,_0x9d40af){if(_0x7cdc68[_0xf81b('0x4b')]['id']){delete _0x7cdc68[_0xf81b('0x4b')]['id'];}return db['ZohoAccount'][_0xf81b('0x4c')]({'where':{'id':_0x7cdc68[_0xf81b('0x46')]['id']}})[_0xf81b('0x26')](handleEntityNotFound(_0x4509fe,null))[_0xf81b('0x26')](function(_0x5bedcb){if(_0x5bedcb){_0x7cdc68[_0xf81b('0x4b')][_0xf81b('0x52')]=_0x5bedcb['id'];_0x7cdc68['body'][_0xf81b('0x53')]=integrations[_0xf81b('0x54')](_0x7cdc68[_0xf81b('0x4b')]['channel'],_0x7cdc68['body'][_0xf81b('0x2e')]);_0x7cdc68['body'][_0xf81b('0x55')]=integrations[_0xf81b('0x56')](_0x7cdc68[_0xf81b('0x4b')][_0xf81b('0x57')],_0x7cdc68['body'][_0xf81b('0x2e')]);return db['ZohoConfiguration'][_0xf81b('0x4a')](_0x7cdc68['body'],{'include':[{'model':db[_0xf81b('0x58')],'as':_0xf81b('0x53')},{'model':db[_0xf81b('0x58')],'as':_0xf81b('0x55')}]});}return null;})['then'](respondWithResult(_0x4509fe,null))[_0xf81b('0x44')](handleError(_0x4509fe,null));};function getAccessToken(_0xcdd264){return new Promise(function(_0x92a0af,_0x5f158f){var _0x4982d5;switch(_0xcdd264[_0xf81b('0x59')]){case'US':_0x4982d5=_0xf81b('0x5a');break;case'AU':_0x4982d5='https://accounts.zoho.com.au';break;case'EU':_0x4982d5=_0xf81b('0x5b');break;case'IN':_0x4982d5=_0xf81b('0x5c');break;case'CN':_0x4982d5=_0xf81b('0x5d');break;default:_0x4982d5=_0xf81b('0x5b');break;}var _0x12ed03={'method':'POST','uri':_0x4982d5+'/oauth/v2/token','qs':{'refresh_token':_0xcdd264[_0xf81b('0x5e')],'client_id':_0xcdd264['clientId'],'client_secret':_0xcdd264[_0xf81b('0x5f')],'grant_type':_0xf81b('0x60')},'json':!![]};return rp(_0x12ed03)['then'](function(_0x3dd249){if(_0x3dd249[_0xf81b('0x61')]){_0x92a0af(_0x3dd249[_0xf81b('0x61')]);}else{_0x5f158f('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xf81b('0x44')](function(_0x43c606){_0x5f158f(_0x43c606);});});}exports['getFields']=function(_0x2d0b15,_0x7e29da,_0x441afe){var _0x252f05,_0x223535,_0x302035,_0x4b1393,_0x293cd9;return db[_0xf81b('0x3f')]['findOne']({'where':{'id':_0x2d0b15[_0xf81b('0x46')]['id']},'attributes':['id',_0xf81b('0x62'),'zone','clientId','clientSecret',_0xf81b('0x63'),_0xf81b('0x64'),_0xf81b('0x5e')]})['then'](handleEntityNotFound(_0x7e29da,null))[_0xf81b('0x26')](function(_0x474bd3){_0x293cd9=_0x474bd3;_0x252f05=_0x293cd9['host'];_0x223535=_0x252f05==='zoho.eu'?'eu':_0xf81b('0x65');_0x302035=_0x293cd9[_0xf81b('0x63')];var _0x12bdf4=_0x302035[_0xf81b('0x66')](-0x1);if(_0x12bdf4==='/'||_0x12bdf4==='\x5c'||_0x12bdf4===':'){_0x302035=_0x302035[_0xf81b('0x67')](0x0,_0x302035[_0xf81b('0x68')](_0x12bdf4));}if(!_0x293cd9['refreshToken']){throw new Error(_0xf81b('0x69'));}return getAccessToken(_0x293cd9);})[_0xf81b('0x26')](function(_0x5dc289){if(_0x5dc289){return rp({'method':'GET','uri':util[_0xf81b('0x6a')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x223535),'qs':{'module':'Calls'},'headers':{'Authorization':_0xf81b('0x6b')+_0x5dc289},'json':!![]});}})['then'](function(_0x11fa9f){if(_0x11fa9f){if(_0x11fa9f[_0xf81b('0x6c')]&&_0x11fa9f[_0xf81b('0x6c')][_0xf81b('0x28')]){throw new Error(_0x11fa9f[_0xf81b('0x6c')][_0xf81b('0x28')]['message']);}var _0x454b70=[];var _0xdfe65f=[];var _0x1b5848=['Owner','Subject','Description',_0xf81b('0x6d'),_0xf81b('0x6e'),_0xf81b('0x6f'),_0xf81b('0x70'),_0xf81b('0x71')];_0xdfe65f=_[_0xf81b('0x72')](_0x11fa9f[_0xf81b('0x37')],function(_0x4add6d){return _0x1b5848[_0xf81b('0x73')](_0x4add6d['api_name']);});for(var _0x1cd4e6=0x0;_0x1cd4e6<_0xdfe65f[_0xf81b('0x47')];_0x1cd4e6++){if(_0xdfe65f[_0x1cd4e6]['system_mandatory']===![]){_0x454b70[_0xf81b('0x74')]({'id':_0xdfe65f[_0x1cd4e6]['id'],'name':_0xdfe65f[_0x1cd4e6][_0xf81b('0x75')],'custom':_0xdfe65f[_0x1cd4e6][_0xf81b('0x76')],'options':_0xdfe65f[_0x1cd4e6]['data_type']===_0xf81b('0x77')&&_0xdfe65f[_0x1cd4e6][_0xf81b('0x78')][_0xf81b('0x47')]>-0x1?_['map'](_0xdfe65f[_0x1cd4e6][_0xf81b('0x78')],function(_0x1edb6e){return{'name':_0x1edb6e,'value':_0x1edb6e};}):[]});}}return{'count':_0x454b70[_0xf81b('0x47')],'rows':_0x454b70};}else{return{'count':0x0,'rows':[]};}})[_0xf81b('0x26')](respondWithResult(_0x7e29da,null))[_0xf81b('0x44')](function(_0x2ec2d0){var _0x5a1b11=_0x2d0b15[_0xf81b('0x31')][_0xf81b('0x79')]?0x1f4:_0x2ec2d0[_0xf81b('0x7a')]||0x1f4;logger[_0xf81b('0x28')](_0xf81b('0x7b'),_0xf81b('0x7c'),_0x5a1b11,JSON[_0xf81b('0x7d')](_0x2ec2d0));delete _0x2ec2d0[_0xf81b('0x30')];if(_0x5a1b11===0x191){_0x5a1b11=0x190;}_0x7e29da['status'](_0x5a1b11)[_0xf81b('0x2a')](_0x2d0b15['query'][_0xf81b('0x79')]?{'message':_0xf81b('0x7e'),'statusCode':_0x2ec2d0[_0xf81b('0x7a')]}:_0x2ec2d0);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index b68a98f..142405c 100644 --- a/server/api/intZohoAccount/intZohoAccount.model.js +++ b/server/api/intZohoAccount/intZohoAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x583c=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','clientId','clientSecret','code','host','serverUrl','slice','substring','zone','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','parse','refreshToken','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','error','name','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','then'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0x583c,0xac));var _0xc583=function(_0x29c261,_0x3af39a){_0x29c261=_0x29c261-0x0;var _0x1a9335=_0x583c[_0x29c261];return _0x1a9335;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc583('0x0'))(_0xc583('0x1'));var moment=require(_0xc583('0x2'));var BPromise=require(_0xc583('0x3'));var rp=require(_0xc583('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc583('0x5'));var attributes=require(_0xc583('0x6'));var integrations=require(_0xc583('0x7'));module[_0xc583('0x8')]=function(_0x3ad923,_0x1ace1b){return _0x3ad923[_0xc583('0x9')](_0xc583('0xa'),attributes,{'tableName':_0xc583('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5c57da,_0x478b25,_0x50a6cf){if(_0x5c57da['changed']('zone')||_0x5c57da[_0xc583('0xc')]('serverUrl')||_0x5c57da[_0xc583('0xc')](_0xc583('0xd'))||_0x5c57da[_0xc583('0xc')](_0xc583('0xe'))||_0x5c57da[_0xc583('0xc')](_0xc583('0xf'))||_0x5c57da[_0xc583('0xc')](_0xc583('0x10'))){var _0x2163e2,_0x1eee99;_0x2163e2=_0x5c57da[_0xc583('0x11')];var _0x56e26a=_0x2163e2[_0xc583('0x12')](-0x1);if(_0x56e26a==='/'||_0x56e26a==='\x5c'||_0x56e26a===':'){_0x2163e2=_0x2163e2[_0xc583('0x13')](0x0,_0x2163e2['lastIndexOf'](_0x56e26a));}switch(_0x5c57da[_0xc583('0x14')]){case'US':_0x1eee99='https://accounts.zoho.com';break;case'AU':_0x1eee99='https://accounts.zoho.com.au';break;case'IN':_0x1eee99='https://accounts.zoho.in';break;case'CN':_0x1eee99=_0xc583('0x15');break;default:_0x1eee99=_0xc583('0x16');break;}var _0x2faee1={'method':_0xc583('0x17'),'uri':_0x1eee99+_0xc583('0x18'),'form':{'grant_type':_0xc583('0x19'),'client_id':_0x5c57da[_0xc583('0xd')],'client_secret':_0x5c57da['clientSecret'],'redirect_uri':_0x5c57da[_0xc583('0x11')],'code':_0x5c57da[_0xc583('0xf')]},'headers':{'Content-Type':_0xc583('0x1a')}};return rp(_0x2faee1)['then'](function(_0x1f857e){var _0x2e1be0=JSON[_0xc583('0x1b')](_0x1f857e);if(_0x2e1be0['refresh_token']){_0x5c57da[_0xc583('0x1c')]=_0x2e1be0[_0xc583('0x1d')];logger[_0xc583('0x1e')](util[_0xc583('0x1f')](_0xc583('0x20'),_0x5c57da['name'],_0x5c57da['id']));}else{logger['error'](util[_0xc583('0x1f')](_0xc583('0x21'),_0x5c57da['name'],_0x5c57da['id']),util[_0xc583('0x22')](_0x2e1be0,{'showHidden':![],'depth':null}));}return _0x50a6cf(null,_0x478b25);})[_0xc583('0x23')](function(_0x187c96){logger[_0xc583('0x24')](util[_0xc583('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5c57da[_0xc583('0x25')],_0x5c57da['id']),util[_0xc583('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x50a6cf(_0x187c96);});}else{return _0x50a6cf(null,_0x478b25);}},'beforeUpdate':function(_0x58cb1f,_0x16fdee,_0x2446ce){if(_0x58cb1f['changed'](_0xc583('0x14'))||_0x58cb1f[_0xc583('0xc')](_0xc583('0x11'))||_0x58cb1f[_0xc583('0xc')](_0xc583('0xd'))||_0x58cb1f['changed']('clientSecret')||_0x58cb1f[_0xc583('0xc')]('code')||_0x58cb1f[_0xc583('0xc')]('host')){var _0x44bff4,_0x43ed1d;_0x44bff4=_0x58cb1f[_0xc583('0x11')];var _0x2931a6=_0x44bff4[_0xc583('0x12')](-0x1);if(_0x2931a6==='/'||_0x2931a6==='\x5c'||_0x2931a6===':'){_0x44bff4=_0x44bff4[_0xc583('0x13')](0x0,_0x44bff4[_0xc583('0x26')](_0x2931a6));}switch(_0x58cb1f['zone']){case'US':_0x43ed1d=_0xc583('0x27');break;case'AU':_0x43ed1d=_0xc583('0x28');break;case'IN':_0x43ed1d=_0xc583('0x29');break;case'CN':_0x43ed1d=_0xc583('0x15');break;default:_0x43ed1d='https://accounts.zoho.eu';break;}var _0x20919e={'method':_0xc583('0x17'),'uri':_0x43ed1d+_0xc583('0x18'),'form':{'grant_type':_0xc583('0x19'),'client_id':_0x58cb1f[_0xc583('0xd')],'client_secret':_0x58cb1f[_0xc583('0xe')],'redirect_uri':_0x58cb1f['serverUrl'],'code':_0x58cb1f['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x20919e)[_0xc583('0x2a')](function(_0x31175c){var _0x353170=JSON[_0xc583('0x1b')](_0x31175c);if(_0x353170[_0xc583('0x1d')]){_0x58cb1f['refreshToken']=_0x353170[_0xc583('0x1d')];logger[_0xc583('0x1e')](util[_0xc583('0x1f')](_0xc583('0x20'),_0x58cb1f['name'],_0x58cb1f['id']));}else{logger[_0xc583('0x24')](util[_0xc583('0x1f')](_0xc583('0x21'),_0x58cb1f['name'],_0x58cb1f['id']),util[_0xc583('0x22')](_0x353170,{'showHidden':![],'depth':null}));}return _0x2446ce(null,_0x16fdee);})['catch'](function(_0x4334f5){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x58cb1f[_0xc583('0x25')],_0x58cb1f['id']),util[_0xc583('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x2446ce(_0x4334f5);});}else{return _0x2446ce(null,_0x16fdee);}}}});}; \ No newline at end of file +var _0xe3b7=['inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','host','https://accounts.zoho.com','https://accounts.zoho.com.au','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration','exports','define','ZohoAccount','changed','zone','clientId','clientSecret','code','slice','lastIndexOf','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','serverUrl','application/x-www-form-urlencoded','then','parse','refreshToken','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error'];(function(_0x115683,_0x4a1c36){var _0x5715b0=function(_0x17a343){while(--_0x17a343){_0x115683['push'](_0x115683['shift']());}};_0x5715b0(++_0x4a1c36);}(_0xe3b7,0x12c));var _0x7e3b=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xe3b7[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require(_0x7e3b('0x0'));var util=require(_0x7e3b('0x1'));var logger=require(_0x7e3b('0x2'))(_0x7e3b('0x3'));var moment=require('moment');var BPromise=require(_0x7e3b('0x4'));var rp=require(_0x7e3b('0x5'));var fs=require('fs');var path=require(_0x7e3b('0x6'));var rimraf=require('rimraf');var config=require(_0x7e3b('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x7e3b('0x8'));module[_0x7e3b('0x9')]=function(_0x4b7396,_0xfbede5){return _0x4b7396[_0x7e3b('0xa')](_0x7e3b('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4eb0b3,_0x27790b,_0x3b94ba){if(_0x4eb0b3[_0x7e3b('0xc')](_0x7e3b('0xd'))||_0x4eb0b3[_0x7e3b('0xc')]('serverUrl')||_0x4eb0b3[_0x7e3b('0xc')](_0x7e3b('0xe'))||_0x4eb0b3[_0x7e3b('0xc')](_0x7e3b('0xf'))||_0x4eb0b3['changed'](_0x7e3b('0x10'))||_0x4eb0b3[_0x7e3b('0xc')]('host')){var _0x692c32,_0x4dfec6;_0x692c32=_0x4eb0b3['serverUrl'];var _0x4cb56f=_0x692c32[_0x7e3b('0x11')](-0x1);if(_0x4cb56f==='/'||_0x4cb56f==='\x5c'||_0x4cb56f===':'){_0x692c32=_0x692c32['substring'](0x0,_0x692c32[_0x7e3b('0x12')](_0x4cb56f));}switch(_0x4eb0b3[_0x7e3b('0xd')]){case'US':_0x4dfec6='https://accounts.zoho.com';break;case'AU':_0x4dfec6='https://accounts.zoho.com.au';break;case'IN':_0x4dfec6=_0x7e3b('0x13');break;case'CN':_0x4dfec6=_0x7e3b('0x14');break;default:_0x4dfec6=_0x7e3b('0x15');break;}var _0x1715d2={'method':_0x7e3b('0x16'),'uri':_0x4dfec6+_0x7e3b('0x17'),'form':{'grant_type':_0x7e3b('0x18'),'client_id':_0x4eb0b3['clientId'],'client_secret':_0x4eb0b3[_0x7e3b('0xf')],'redirect_uri':_0x4eb0b3[_0x7e3b('0x19')],'code':_0x4eb0b3[_0x7e3b('0x10')]},'headers':{'Content-Type':_0x7e3b('0x1a')}};return rp(_0x1715d2)[_0x7e3b('0x1b')](function(_0x425982){var _0x123550=JSON[_0x7e3b('0x1c')](_0x425982);if(_0x123550['refresh_token']){_0x4eb0b3[_0x7e3b('0x1d')]=_0x123550[_0x7e3b('0x1e')];logger[_0x7e3b('0x1f')](util[_0x7e3b('0x20')](_0x7e3b('0x21'),_0x4eb0b3[_0x7e3b('0x22')],_0x4eb0b3['id']));}else{logger[_0x7e3b('0x23')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4eb0b3[_0x7e3b('0x22')],_0x4eb0b3['id']),util[_0x7e3b('0x24')](_0x123550,{'showHidden':![],'depth':null}));}return _0x3b94ba(null,_0x27790b);})[_0x7e3b('0x25')](function(_0x5cc853){logger['error'](util[_0x7e3b('0x20')](_0x7e3b('0x26'),_0x4eb0b3['name'],_0x4eb0b3['id']),util[_0x7e3b('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x3b94ba(_0x5cc853);});}else{return _0x3b94ba(null,_0x27790b);}},'beforeUpdate':function(_0x568e1d,_0x1d6db1,_0x107770){if(_0x568e1d[_0x7e3b('0xc')](_0x7e3b('0xd'))||_0x568e1d[_0x7e3b('0xc')](_0x7e3b('0x19'))||_0x568e1d[_0x7e3b('0xc')](_0x7e3b('0xe'))||_0x568e1d['changed'](_0x7e3b('0xf'))||_0x568e1d['changed']('code')||_0x568e1d[_0x7e3b('0xc')](_0x7e3b('0x27'))){var _0x309751,_0x519a40;_0x309751=_0x568e1d[_0x7e3b('0x19')];var _0x45ba89=_0x309751[_0x7e3b('0x11')](-0x1);if(_0x45ba89==='/'||_0x45ba89==='\x5c'||_0x45ba89===':'){_0x309751=_0x309751['substring'](0x0,_0x309751['lastIndexOf'](_0x45ba89));}switch(_0x568e1d[_0x7e3b('0xd')]){case'US':_0x519a40=_0x7e3b('0x28');break;case'AU':_0x519a40=_0x7e3b('0x29');break;case'IN':_0x519a40=_0x7e3b('0x13');break;case'CN':_0x519a40=_0x7e3b('0x14');break;default:_0x519a40=_0x7e3b('0x15');break;}var _0x4b7e41={'method':'POST','uri':_0x519a40+_0x7e3b('0x17'),'form':{'grant_type':_0x7e3b('0x18'),'client_id':_0x568e1d[_0x7e3b('0xe')],'client_secret':_0x568e1d['clientSecret'],'redirect_uri':_0x568e1d[_0x7e3b('0x19')],'code':_0x568e1d[_0x7e3b('0x10')]},'headers':{'Content-Type':_0x7e3b('0x1a')}};return rp(_0x4b7e41)[_0x7e3b('0x1b')](function(_0x4c6e68){var _0x3ca079=JSON[_0x7e3b('0x1c')](_0x4c6e68);if(_0x3ca079[_0x7e3b('0x1e')]){_0x568e1d[_0x7e3b('0x1d')]=_0x3ca079[_0x7e3b('0x1e')];logger[_0x7e3b('0x1f')](util[_0x7e3b('0x20')](_0x7e3b('0x21'),_0x568e1d[_0x7e3b('0x22')],_0x568e1d['id']));}else{logger[_0x7e3b('0x23')](util[_0x7e3b('0x20')](_0x7e3b('0x26'),_0x568e1d[_0x7e3b('0x22')],_0x568e1d['id']),util[_0x7e3b('0x24')](_0x3ca079,{'showHidden':![],'depth':null}));}return _0x107770(null,_0x1d6db1);})[_0x7e3b('0x25')](function(_0x52afc4){logger[_0x7e3b('0x23')](util[_0x7e3b('0x20')](_0x7e3b('0x26'),_0x568e1d['name'],_0x568e1d['id']),util[_0x7e3b('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x107770(_0x52afc4);});}else{return _0x107770(null,_0x1d6db1);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 88453da..f790248 100644 --- a/server/api/intZohoAccount/intZohoAccount.rpc.js +++ b/server/api/intZohoAccount/intZohoAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fea=['ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','raw','options','where','attributes','limit','include','map','model','then','debug','stringify','ShowZohoAccount','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x7fea,0x149));var _0xa7fe=function(_0x401915,_0x47b6e7){_0x401915=_0x401915-0x0;var _0x12aa44=_0x7fea[_0x401915];return _0x12aa44;};'use strict';var _=require('lodash');var util=require(_0xa7fe('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa7fe('0x1'));var fs=require('fs');var Redis=require(_0xa7fe('0x2'));var db=require(_0xa7fe('0x3'))['db'];var utils=require(_0xa7fe('0x4'));var logger=require(_0xa7fe('0x5'))(_0xa7fe('0x6'));var config=require('../../config/environment');var jayson=require(_0xa7fe('0x7'));var client=jayson[_0xa7fe('0x8')][_0xa7fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1132f1,_0x45f967,_0x3597b0){return new BPromise(function(_0x4668f0,_0x3d9135){return client['request'](_0x1132f1,_0x3597b0)['then'](function(_0x1db10e){logger[_0xa7fe('0xa')](_0xa7fe('0xb'),_0x45f967,_0xa7fe('0xc'));logger['debug'](_0xa7fe('0xd'),_0x45f967,_0xa7fe('0xc'),JSON['stringify'](_0x1db10e));if(_0x1db10e[_0xa7fe('0xe')]){if(_0x1db10e['error'][_0xa7fe('0xf')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x45f967,_0x1db10e[_0xa7fe('0xe')][_0xa7fe('0x10')]);return _0x3d9135(_0x1db10e[_0xa7fe('0xe')][_0xa7fe('0x10')]);}logger[_0xa7fe('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x45f967,_0x1db10e['error'][_0xa7fe('0x10')]);return _0x4668f0(_0x1db10e[_0xa7fe('0xe')][_0xa7fe('0x10')]);}else{logger[_0xa7fe('0xa')](_0xa7fe('0xb'),_0x45f967,'request\x20sent');_0x4668f0(_0x1db10e[_0xa7fe('0x11')][_0xa7fe('0x10')]);}})[_0xa7fe('0x12')](function(_0x253293){logger[_0xa7fe('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x45f967,_0x253293);_0x3d9135(_0x253293);});});}exports[_0xa7fe('0x13')]=function(_0x1e4966){var _0x2bf8db=this;return new Promise(function(_0x2ef53c,_0x179b9e){return db[_0xa7fe('0x14')][_0xa7fe('0x15')]({'raw':_0x1e4966['options']?_0x1e4966['options'][_0xa7fe('0x16')]===undefined?!![]:![]:!![],'where':_0x1e4966[_0xa7fe('0x17')]?_0x1e4966[_0xa7fe('0x17')][_0xa7fe('0x18')]||null:null,'attributes':_0x1e4966[_0xa7fe('0x17')]?_0x1e4966[_0xa7fe('0x17')][_0xa7fe('0x19')]||null:null,'limit':_0x1e4966['options']?_0x1e4966[_0xa7fe('0x17')][_0xa7fe('0x1a')]||null:null,'include':_0x1e4966[_0xa7fe('0x17')]?_0x1e4966[_0xa7fe('0x17')][_0xa7fe('0x1b')]?_[_0xa7fe('0x1c')](_0x1e4966[_0xa7fe('0x17')][_0xa7fe('0x1b')],function(_0x4ac7e0){return{'model':db[_0x4ac7e0[_0xa7fe('0x1d')]],'as':_0x4ac7e0['as'],'attributes':_0x4ac7e0['attributes'],'include':_0x4ac7e0['include']?_[_0xa7fe('0x1c')](_0x4ac7e0[_0xa7fe('0x1b')],function(_0x24ec1b){return{'model':db[_0x24ec1b[_0xa7fe('0x1d')]],'as':_0x24ec1b['as'],'attributes':_0x24ec1b[_0xa7fe('0x19')],'include':_0x24ec1b['include']?_[_0xa7fe('0x1c')](_0x24ec1b[_0xa7fe('0x1b')],function(_0xa3fde9){return{'model':db[_0xa3fde9[_0xa7fe('0x1d')]],'as':_0xa3fde9['as'],'attributes':_0xa3fde9[_0xa7fe('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa7fe('0x1e')](function(_0x11aff3){logger[_0xa7fe('0xa')](_0xa7fe('0x13'),_0x1e4966);logger[_0xa7fe('0x1f')](_0xa7fe('0x13'),_0x1e4966,JSON[_0xa7fe('0x20')](_0x11aff3));_0x2ef53c(_0x11aff3);})[_0xa7fe('0x12')](function(_0x42ca9d){logger[_0xa7fe('0xe')](_0xa7fe('0x13'),_0x42ca9d[_0xa7fe('0x10')],_0x1e4966);_0x179b9e(_0x2bf8db[_0xa7fe('0xe')](0x1f4,_0x42ca9d[_0xa7fe('0x10')]));});});};exports[_0xa7fe('0x21')]=function(_0x5bd01d){var _0x3f900a=this;return new Promise(function(_0x3198f9,_0x5bde8b){return db['ZohoAccount']['find']({'raw':_0x5bd01d[_0xa7fe('0x17')]?_0x5bd01d[_0xa7fe('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5bd01d[_0xa7fe('0x17')]?_0x5bd01d[_0xa7fe('0x17')][_0xa7fe('0x18')]||null:null,'attributes':_0x5bd01d[_0xa7fe('0x17')]?_0x5bd01d[_0xa7fe('0x17')][_0xa7fe('0x19')]||null:null,'include':_0x5bd01d[_0xa7fe('0x17')]?_0x5bd01d[_0xa7fe('0x17')][_0xa7fe('0x1b')]?_['map'](_0x5bd01d[_0xa7fe('0x17')]['include'],function(_0x279f57){return{'model':db[_0x279f57[_0xa7fe('0x1d')]],'as':_0x279f57['as'],'attributes':_0x279f57[_0xa7fe('0x19')],'include':_0x279f57['include']?_[_0xa7fe('0x1c')](_0x279f57[_0xa7fe('0x1b')],function(_0x1618e1){return{'model':db[_0x1618e1[_0xa7fe('0x1d')]],'as':_0x1618e1['as'],'attributes':_0x1618e1['attributes'],'include':_0x1618e1[_0xa7fe('0x1b')]?_[_0xa7fe('0x1c')](_0x1618e1['include'],function(_0x1d4b04){return{'model':db[_0x1d4b04[_0xa7fe('0x1d')]],'as':_0x1d4b04['as'],'attributes':_0x1d4b04[_0xa7fe('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa7fe('0x1e')](function(_0xe730b){logger[_0xa7fe('0xa')](_0xa7fe('0x21'),_0x5bd01d);logger[_0xa7fe('0x1f')](_0xa7fe('0x21'),_0x5bd01d,JSON[_0xa7fe('0x20')](_0xe730b));_0x3198f9(_0xe730b);})[_0xa7fe('0x12')](function(_0x36897b){logger[_0xa7fe('0xe')](_0xa7fe('0x21'),_0x36897b[_0xa7fe('0x10')],_0x5bd01d);_0x5bde8b(_0x3f900a[_0xa7fe('0xe')](0x1f4,_0x36897b['message']));});});}; \ No newline at end of file +var _0x01d9=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','attributes','limit','include','map','model','ShowZohoAccount','find','where','stringify','lodash','util','moment'];(function(_0x5db5d0,_0x3eb4c8){var _0x372282=function(_0xce24c1){while(--_0xce24c1){_0x5db5d0['push'](_0x5db5d0['shift']());}};_0x372282(++_0x3eb4c8);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6c9ac8,_0x21e1d7,_0x12c39f){return new BPromise(function(_0x313f85,_0x39fc94){return client[_0x901d('0xc')](_0x6c9ac8,_0x12c39f)[_0x901d('0xd')](function(_0x15076e){logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));logger[_0x901d('0x11')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x21e1d7,_0x901d('0x10'),JSON['stringify'](_0x15076e));if(_0x15076e[_0x901d('0x12')]){if(_0x15076e[_0x901d('0x12')][_0x901d('0x13')]===0x1f4){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e['error'][_0x901d('0x14')]);return _0x39fc94(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e[_0x901d('0x12')]['message']);return _0x313f85(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}else{logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));_0x313f85(_0x15076e[_0x901d('0x15')][_0x901d('0x14')]);}})[_0x901d('0x16')](function(_0x3368fc){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x3368fc);_0x39fc94(_0x3368fc);});});}exports[_0x901d('0x17')]=function(_0x285353){var _0x403db9=this;return new Promise(function(_0x38f42b,_0x414171){return db[_0x901d('0x18')][_0x901d('0x19')]({'raw':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1b')]===undefined?!![]:![]:!![],'where':_0x285353['options']?_0x285353['options']['where']||null:null,'attributes':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1c')]||null:null,'limit':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1d')]||null:null,'include':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1e')]?_[_0x901d('0x1f')](_0x285353[_0x901d('0x1a')][_0x901d('0x1e')],function(_0x1818d3){return{'model':db[_0x1818d3[_0x901d('0x20')]],'as':_0x1818d3['as'],'attributes':_0x1818d3[_0x901d('0x1c')],'include':_0x1818d3['include']?_[_0x901d('0x1f')](_0x1818d3[_0x901d('0x1e')],function(_0xbc89a5){return{'model':db[_0xbc89a5[_0x901d('0x20')]],'as':_0xbc89a5['as'],'attributes':_0xbc89a5['attributes'],'include':_0xbc89a5[_0x901d('0x1e')]?_[_0x901d('0x1f')](_0xbc89a5[_0x901d('0x1e')],function(_0x3cbe43){return{'model':db[_0x3cbe43[_0x901d('0x20')]],'as':_0x3cbe43['as'],'attributes':_0x3cbe43['attributes']};}):[]};}):[]};}):[]:[]})[_0x901d('0xd')](function(_0xc52d0f){logger[_0x901d('0xe')](_0x901d('0x17'),_0x285353);logger[_0x901d('0x11')](_0x901d('0x17'),_0x285353,JSON['stringify'](_0xc52d0f));_0x38f42b(_0xc52d0f);})[_0x901d('0x16')](function(_0x533038){logger[_0x901d('0x12')](_0x901d('0x17'),_0x533038[_0x901d('0x14')],_0x285353);_0x414171(_0x403db9[_0x901d('0x12')](0x1f4,_0x533038[_0x901d('0x14')]));});});};exports[_0x901d('0x21')]=function(_0x4137b7){var _0x115676=this;return new Promise(function(_0x530c4b,_0x336f28){return db[_0x901d('0x18')][_0x901d('0x22')]({'raw':_0x4137b7[_0x901d('0x1a')]?_0x4137b7[_0x901d('0x1a')][_0x901d('0x1b')]===undefined?!![]:![]:!![],'where':_0x4137b7['options']?_0x4137b7[_0x901d('0x1a')][_0x901d('0x23')]||null:null,'attributes':_0x4137b7[_0x901d('0x1a')]?_0x4137b7['options'][_0x901d('0x1c')]||null:null,'include':_0x4137b7[_0x901d('0x1a')]?_0x4137b7[_0x901d('0x1a')][_0x901d('0x1e')]?_[_0x901d('0x1f')](_0x4137b7[_0x901d('0x1a')][_0x901d('0x1e')],function(_0x1b8d3){return{'model':db[_0x1b8d3[_0x901d('0x20')]],'as':_0x1b8d3['as'],'attributes':_0x1b8d3[_0x901d('0x1c')],'include':_0x1b8d3['include']?_['map'](_0x1b8d3[_0x901d('0x1e')],function(_0x4e66b4){return{'model':db[_0x4e66b4[_0x901d('0x20')]],'as':_0x4e66b4['as'],'attributes':_0x4e66b4[_0x901d('0x1c')],'include':_0x4e66b4['include']?_[_0x901d('0x1f')](_0x4e66b4[_0x901d('0x1e')],function(_0x2f5e22){return{'model':db[_0x2f5e22['model']],'as':_0x2f5e22['as'],'attributes':_0x2f5e22[_0x901d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x901d('0xd')](function(_0x1a1f9c){logger[_0x901d('0xe')](_0x901d('0x21'),_0x4137b7);logger[_0x901d('0x11')](_0x901d('0x21'),_0x4137b7,JSON[_0x901d('0x24')](_0x1a1f9c));_0x530c4b(_0x1a1f9c);})[_0x901d('0x16')](function(_0x384d82){logger[_0x901d('0x12')](_0x901d('0x21'),_0x384d82[_0x901d('0x14')],_0x4137b7);_0x336f28(_0x115676[_0x901d('0x12')](0x1f4,_0x384d82[_0x901d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 380c826..91d964b 100644 --- a/server/api/intZohoConfiguration/index.js +++ b/server/api/intZohoConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd5c=['getFields','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','update','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id/fields'];(function(_0x4be69b,_0x1ee0b6){var _0x5bfb4d=function(_0x319429){while(--_0x319429){_0x4be69b['push'](_0x4be69b['shift']());}};_0x5bfb4d(++_0x1ee0b6);}(_0xcd5c,0x1c2));var _0xccd5=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xcd5c[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xccd5('0x0'));var util=require(_0xccd5('0x1'));var path=require(_0xccd5('0x2'));var timeout=require(_0xccd5('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xccd5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xccd5('0x5'));var config=require(_0xccd5('0x6'));var controller=require(_0xccd5('0x7'));router[_0xccd5('0x8')]('/',auth[_0xccd5('0x9')](),controller[_0xccd5('0xa')]);router[_0xccd5('0x8')]('/:id',auth[_0xccd5('0x9')](),controller['show']);router['get'](_0xccd5('0xb'),auth[_0xccd5('0x9')](),controller[_0xccd5('0xc')]);router[_0xccd5('0x8')]('/:id/subjects',auth[_0xccd5('0x9')](),controller[_0xccd5('0xd')]);router['get'](_0xccd5('0xe'),auth['isAuthenticated'](),controller[_0xccd5('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xccd5('0x10')]);router[_0xccd5('0x11')](_0xccd5('0x12'),auth[_0xccd5('0x9')](),controller[_0xccd5('0x13')]);router['delete']('/:id',auth[_0xccd5('0x9')](),controller[_0xccd5('0x14')]);module['exports']=router; \ No newline at end of file +var _0x05a3=['getSubjects','/:id/descriptions','post','create','put','/:id','delete','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/fields','isAuthenticated'];(function(_0x4264bf,_0x39db0f){var _0x515e5f=function(_0x130168){while(--_0x130168){_0x4264bf['push'](_0x4264bf['shift']());}};_0x515e5f(++_0x39db0f);}(_0x05a3,0x1e8));var _0x305a=function(_0x13c59f,_0x36f10b){_0x13c59f=_0x13c59f-0x0;var _0x5bcc29=_0x05a3[_0x13c59f];return _0x5bcc29;};'use strict';var multer=require(_0x305a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x305a('0x1'));var express=require(_0x305a('0x2'));var router=express['Router']();var fs_extra=require(_0x305a('0x3'));var auth=require(_0x305a('0x4'));var interaction=require(_0x305a('0x5'));var config=require(_0x305a('0x6'));var controller=require('./intZohoConfiguration.controller');router[_0x305a('0x7')]('/',auth['isAuthenticated'](),controller[_0x305a('0x8')]);router[_0x305a('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x305a('0x9')]);router[_0x305a('0x7')](_0x305a('0xa'),auth[_0x305a('0xb')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x305a('0xb')](),controller[_0x305a('0xc')]);router[_0x305a('0x7')](_0x305a('0xd'),auth[_0x305a('0xb')](),controller['getDescriptions']);router[_0x305a('0xe')]('/',auth[_0x305a('0xb')](),controller[_0x305a('0xf')]);router[_0x305a('0x10')](_0x305a('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x305a('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x305a('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 6b3aad8..89af939 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0f9=['lead','contact','contact_lead','sequelize','exports','STRING','ENUM'];(function(_0x13d71e,_0x1ab6a1){var _0x2dc8aa=function(_0x466e63){while(--_0x466e63){_0x13d71e['push'](_0x13d71e['shift']());}};_0x2dc8aa(++_0x1ab6a1);}(_0xd0f9,0xdc));var _0x9d0f=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0xd0f9[_0x43a37c];return _0x5d1d40;};'use strict';var Sequelize=require(_0x9d0f('0x0'));module[_0x9d0f('0x1')]={'name':{'type':Sequelize[_0x9d0f('0x2')]},'moduleCreate':{'type':Sequelize[_0x9d0f('0x3')](_0x9d0f('0x4'),_0x9d0f('0x5'),'nothing'),'defaultValue':_0x9d0f('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0x9d0f('0x6'),_0x9d0f('0x5'),'lead'),'defaultValue':_0x9d0f('0x6')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2131=['sequelize','exports','ENUM','lead','contact','nothing','STRING'];(function(_0x20bc57,_0x46b9ac){var _0x3b13b0=function(_0x4569f){while(--_0x4569f){_0x20bc57['push'](_0x20bc57['shift']());}};_0x3b13b0(++_0x46b9ac);}(_0x2131,0xee));var _0x1213=function(_0x40769f,_0x4d516d){_0x40769f=_0x40769f-0x0;var _0x469d2b=_0x2131[_0x40769f];return _0x469d2b;};'use strict';var Sequelize=require(_0x1213('0x0'));module[_0x1213('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x1213('0x2')](_0x1213('0x3'),_0x1213('0x4'),_0x1213('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x1213('0x2')]('contact_lead',_0x1213('0x4'),'lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x1213('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 8ff97d1..21c428d 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8adc=['lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','ZohoConfiguration','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','findAll','catch','params','rawAttributes','include','find','create','body','findOne','ZohoField','getFields','hasOwnProperty','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x8adc,0x137));var _0xc8ad=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8adc[_0x160c73];return _0xd9302;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc8ad('0x0'));var jsonpatch=require(_0xc8ad('0x1'));var rp=require(_0xc8ad('0x2'));var moment=require('moment');var BPromise=require(_0xc8ad('0x3'));var Mustache=require(_0xc8ad('0x4'));var util=require(_0xc8ad('0x5'));var path=require('path');var sox=require(_0xc8ad('0x6'));var csv=require(_0xc8ad('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc8ad('0x8'));var _=require(_0xc8ad('0x9'));var squel=require(_0xc8ad('0xa'));var crypto=require(_0xc8ad('0xb'));var jsforce=require(_0xc8ad('0xc'));var deskjs=require(_0xc8ad('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc8ad('0xe'));var Redis=require(_0xc8ad('0xf'));var authService=require(_0xc8ad('0x10'));var qs=require(_0xc8ad('0x11'));var as=require(_0xc8ad('0x12'));var hardwareService=require(_0xc8ad('0x13'));var logger=require(_0xc8ad('0x14'))(_0xc8ad('0x15'));var utils=require(_0xc8ad('0x16'));var config=require(_0xc8ad('0x17'));var licenseUtil=require(_0xc8ad('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d5d77,_0x58a0b5){_0x58a0b5=_0x58a0b5||0xcc;return function(_0x14f80b){if(_0x14f80b){return _0x1d5d77['sendStatus'](_0x58a0b5);}return _0x1d5d77[_0xc8ad('0x19')](_0x58a0b5)[_0xc8ad('0x1a')]();};}function respondWithResult(_0x19009c,_0x5c5414){_0x5c5414=_0x5c5414||0xc8;return function(_0x1ccddd){if(_0x1ccddd){return _0x19009c[_0xc8ad('0x19')](_0x5c5414)['json'](_0x1ccddd);}};}function respondWithFilteredResult(_0x3f6500,_0x163bea){return function(_0x43eb12){if(_0x43eb12){var _0x276578=typeof _0x163bea[_0xc8ad('0x1b')]===_0xc8ad('0x1c')&&typeof _0x163bea['limit']==='undefined';var _0x442b49=_0x43eb12['count'];var _0x2ba72c=_0x276578?0x0:_0x163bea[_0xc8ad('0x1b')];var _0x4cee40=_0x276578?_0x43eb12['count']:_0x163bea[_0xc8ad('0x1b')]+_0x163bea['limit'];var _0x286581;if(_0x4cee40>=_0x442b49){_0x4cee40=_0x442b49;_0x286581=0xc8;}else{_0x286581=0xce;}_0x3f6500[_0xc8ad('0x19')](_0x286581);return _0x3f6500['set'](_0xc8ad('0x1d'),_0x2ba72c+'-'+_0x4cee40+'/'+_0x442b49)[_0xc8ad('0x1e')](_0x43eb12);}return null;};}function patchUpdates(_0x4b1a36){return function(_0x3b6d97){try{jsonpatch[_0xc8ad('0x1f')](_0x3b6d97,_0x4b1a36,!![]);}catch(_0x9e6796){return BPromise[_0xc8ad('0x20')](_0x9e6796);}return _0x3b6d97[_0xc8ad('0x21')]();};}function saveUpdates(_0x9e69b3,_0x594b5f){return function(_0x227294){if(_0x227294){return _0x227294[_0xc8ad('0x22')](_0x9e69b3)['then'](function(_0x332ce7){return _0x332ce7;});}return null;};}function removeEntity(_0x58a4fa,_0x1230ae){return function(_0x4d90a1){if(_0x4d90a1){return _0x4d90a1[_0xc8ad('0x23')]()[_0xc8ad('0x24')](function(){_0x58a4fa[_0xc8ad('0x19')](0xcc)[_0xc8ad('0x1a')]();});}};}function handleEntityNotFound(_0x3f1bae,_0x217263){return function(_0x281bbf){if(!_0x281bbf){_0x3f1bae[_0xc8ad('0x25')](0x194);}return _0x281bbf;};}function handleError(_0x32716f,_0xc89c89){_0xc89c89=_0xc89c89||0x1f4;return function(_0xca24a5){logger[_0xc8ad('0x26')](_0xca24a5['stack']);if(_0xca24a5['name']){delete _0xca24a5[_0xc8ad('0x27')];}_0x32716f[_0xc8ad('0x19')](_0xc89c89)[_0xc8ad('0x28')](_0xca24a5);};}exports[_0xc8ad('0x29')]=function(_0x11bde7,_0x4f529f){var _0x3268a8={},_0x2c303a={},_0x8d4085={'count':0x0,'rows':[]};var _0x18f911=_[_0xc8ad('0x2a')](db[_0xc8ad('0x2b')]['rawAttributes'],function(_0x27bdfc){return{'name':_0x27bdfc[_0xc8ad('0x2c')],'type':_0x27bdfc[_0xc8ad('0x2d')][_0xc8ad('0x2e')]};});_0x2c303a['model']=_['map'](_0x18f911,_0xc8ad('0x27'));_0x2c303a[_0xc8ad('0x2f')]=_[_0xc8ad('0x30')](_0x11bde7['query']);_0x2c303a[_0xc8ad('0x31')]=_[_0xc8ad('0x32')](_0x2c303a[_0xc8ad('0x33')],_0x2c303a['query']);_0x3268a8[_0xc8ad('0x34')]=_['intersection'](_0x2c303a[_0xc8ad('0x33')],qs[_0xc8ad('0x35')](_0x11bde7[_0xc8ad('0x2f')][_0xc8ad('0x35')]));_0x3268a8[_0xc8ad('0x34')]=_0x3268a8['attributes'][_0xc8ad('0x36')]?_0x3268a8[_0xc8ad('0x34')]:_0x2c303a[_0xc8ad('0x33')];if(!_0x11bde7[_0xc8ad('0x2f')]['hasOwnProperty'](_0xc8ad('0x37'))){_0x3268a8[_0xc8ad('0x38')]=qs['limit'](_0x11bde7[_0xc8ad('0x2f')][_0xc8ad('0x38')]);_0x3268a8[_0xc8ad('0x1b')]=qs[_0xc8ad('0x1b')](_0x11bde7[_0xc8ad('0x2f')][_0xc8ad('0x1b')]);}_0x3268a8[_0xc8ad('0x39')]=qs[_0xc8ad('0x3a')](_0x11bde7[_0xc8ad('0x2f')][_0xc8ad('0x3a')]);_0x3268a8[_0xc8ad('0x3b')]=qs[_0xc8ad('0x31')](_[_0xc8ad('0x3c')](_0x11bde7['query'],_0x2c303a[_0xc8ad('0x31')]),_0x18f911);if(_0x11bde7[_0xc8ad('0x2f')][_0xc8ad('0x3d')]){_0x3268a8[_0xc8ad('0x3b')]=_[_0xc8ad('0x3e')](_0x3268a8['where'],{'$or':_[_0xc8ad('0x2a')](_0x18f911,function(_0x427b9c){if(_0x427b9c[_0xc8ad('0x2d')]!==_0xc8ad('0x3f')){var _0x4fc2ac={};_0x4fc2ac[_0x427b9c[_0xc8ad('0x27')]]={'$like':'%'+_0x11bde7['query'][_0xc8ad('0x3d')]+'%'};return _0x4fc2ac;}})});}_0x3268a8=_[_0xc8ad('0x3e')]({},_0x3268a8,_0x11bde7[_0xc8ad('0x40')]);var _0x164975={'where':_0x3268a8[_0xc8ad('0x3b')]};return db[_0xc8ad('0x2b')]['count'](_0x164975)['then'](function(_0xbae210){_0x8d4085[_0xc8ad('0x41')]=_0xbae210;if(_0x11bde7[_0xc8ad('0x2f')]['includeAll']){_0x3268a8['include']=[{'all':!![]}];}return db[_0xc8ad('0x2b')][_0xc8ad('0x42')](_0x3268a8);})[_0xc8ad('0x24')](function(_0x3353b8){_0x8d4085['rows']=_0x3353b8;return _0x8d4085;})['then'](respondWithFilteredResult(_0x4f529f,_0x3268a8))[_0xc8ad('0x43')](handleError(_0x4f529f,null));};exports['show']=function(_0x2c11e7,_0x1191f5){var _0x3b7023={'raw':![],'where':{'id':_0x2c11e7[_0xc8ad('0x44')]['id']}},_0x5bb800={};_0x5bb800[_0xc8ad('0x33')]=_['keys'](db[_0xc8ad('0x2b')][_0xc8ad('0x45')]);_0x5bb800[_0xc8ad('0x2f')]=_[_0xc8ad('0x30')](_0x2c11e7[_0xc8ad('0x2f')]);_0x5bb800['filters']=_[_0xc8ad('0x32')](_0x5bb800['model'],_0x5bb800['query']);_0x3b7023[_0xc8ad('0x34')]=_['intersection'](_0x5bb800[_0xc8ad('0x33')],qs['fields'](_0x2c11e7[_0xc8ad('0x2f')][_0xc8ad('0x35')]));_0x3b7023[_0xc8ad('0x34')]=_0x3b7023[_0xc8ad('0x34')][_0xc8ad('0x36')]?_0x3b7023[_0xc8ad('0x34')]:_0x5bb800[_0xc8ad('0x33')];if(_0x2c11e7['query']['includeAll']){_0x3b7023[_0xc8ad('0x46')]=[{'all':!![]}];}_0x3b7023=_[_0xc8ad('0x3e')]({},_0x3b7023,_0x2c11e7[_0xc8ad('0x40')]);return db['ZohoConfiguration'][_0xc8ad('0x47')](_0x3b7023)['then'](handleEntityNotFound(_0x1191f5,null))['then'](respondWithResult(_0x1191f5,null))[_0xc8ad('0x43')](handleError(_0x1191f5,null));};exports[_0xc8ad('0x48')]=function(_0x13ae67,_0x53d0a8){return db['ZohoConfiguration'][_0xc8ad('0x48')](_0x13ae67[_0xc8ad('0x49')],{})[_0xc8ad('0x24')](respondWithResult(_0x53d0a8,0xc9))['catch'](handleError(_0x53d0a8,null));};exports[_0xc8ad('0x22')]=function(_0x480b22,_0x1543a3){if(_0x480b22[_0xc8ad('0x49')]['id']){delete _0x480b22[_0xc8ad('0x49')]['id'];}return db[_0xc8ad('0x2b')][_0xc8ad('0x47')]({'where':{'id':_0x480b22[_0xc8ad('0x44')]['id']}})[_0xc8ad('0x24')](handleEntityNotFound(_0x1543a3,null))[_0xc8ad('0x24')](saveUpdates(_0x480b22['body'],null))['then'](respondWithResult(_0x1543a3,null))[_0xc8ad('0x43')](handleError(_0x1543a3,null));};exports[_0xc8ad('0x23')]=function(_0x43864e,_0x222e67){return db[_0xc8ad('0x2b')]['find']({'where':{'id':_0x43864e[_0xc8ad('0x44')]['id']}})['then'](handleEntityNotFound(_0x222e67,null))['then'](removeEntity(_0x222e67,null))[_0xc8ad('0x43')](handleError(_0x222e67,null));};exports['getFields']=function(_0x561c9d,_0x385de8,_0x50753f){var _0x3369f2={};var _0x4c263a={};var _0x5d5c76;var _0x4841a1;return db[_0xc8ad('0x2b')][_0xc8ad('0x4a')]({'where':{'id':_0x561c9d[_0xc8ad('0x44')]['id']}})[_0xc8ad('0x24')](handleEntityNotFound(_0x385de8,null))[_0xc8ad('0x24')](function(_0x4029da){if(_0x4029da){_0x5d5c76=_0x4029da;_0x4c263a[_0xc8ad('0x33')]=_['keys'](db[_0xc8ad('0x4b')][_0xc8ad('0x45')]);_0x4c263a[_0xc8ad('0x2f')]=_['keys'](_0x561c9d['query']);_0x4c263a['filters']=_[_0xc8ad('0x32')](_0x4c263a[_0xc8ad('0x33')],_0x4c263a['query']);_0x3369f2[_0xc8ad('0x34')]=_[_0xc8ad('0x32')](_0x4c263a['model'],qs[_0xc8ad('0x35')](_0x561c9d[_0xc8ad('0x2f')][_0xc8ad('0x35')]));_0x3369f2[_0xc8ad('0x34')]=_0x3369f2[_0xc8ad('0x34')]['length']?_0x3369f2[_0xc8ad('0x34')]:_0x4c263a['model'];_0x3369f2[_0xc8ad('0x39')]=qs[_0xc8ad('0x3a')](_0x561c9d[_0xc8ad('0x2f')][_0xc8ad('0x3a')]);_0x3369f2[_0xc8ad('0x3b')]=qs['filters'](_[_0xc8ad('0x3c')](_0x561c9d[_0xc8ad('0x2f')],_0x4c263a[_0xc8ad('0x31')]));if(_0x561c9d[_0xc8ad('0x2f')][_0xc8ad('0x3d')]){_0x3369f2[_0xc8ad('0x3b')]=_[_0xc8ad('0x3e')](_0x3369f2[_0xc8ad('0x3b')],{'$or':_[_0xc8ad('0x2a')](_0x3369f2[_0xc8ad('0x34')],function(_0x5574c3){var _0xf93ebe={};_0xf93ebe[_0x5574c3]={'$like':'%'+_0x561c9d[_0xc8ad('0x2f')]['filter']+'%'};return _0xf93ebe;})});}_0x3369f2=_[_0xc8ad('0x3e')]({},_0x3369f2,_0x561c9d['options']);return _0x5d5c76[_0xc8ad('0x4c')](_0x3369f2);}})[_0xc8ad('0x24')](function(_0x33c9f5){if(_0x33c9f5){_0x4841a1=_0x33c9f5['length'];if(!_0x561c9d[_0xc8ad('0x2f')][_0xc8ad('0x4d')]('nolimit')){_0x3369f2[_0xc8ad('0x38')]=qs[_0xc8ad('0x38')](_0x561c9d[_0xc8ad('0x2f')][_0xc8ad('0x38')]);_0x3369f2[_0xc8ad('0x1b')]=qs[_0xc8ad('0x1b')](_0x561c9d[_0xc8ad('0x2f')][_0xc8ad('0x1b')]);}return _0x5d5c76['getFields'](_0x3369f2);}})[_0xc8ad('0x24')](function(_0x41a0f3){if(_0x41a0f3){return _0x41a0f3?{'count':_0x4841a1,'rows':_0x41a0f3}:null;}})[_0xc8ad('0x24')](respondWithResult(_0x385de8,null))['catch'](handleError(_0x385de8,null));};exports[_0xc8ad('0x4e')]=function(_0x4fcfa0,_0x44a2e7,_0x1a0a6c){var _0x306f1d={};var _0x5add83={};var _0x23fdc6;var _0x176bb2;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x4fcfa0['params']['id']}})['then'](handleEntityNotFound(_0x44a2e7,null))['then'](function(_0x3209ad){if(_0x3209ad){_0x23fdc6=_0x3209ad;_0x5add83[_0xc8ad('0x33')]=_[_0xc8ad('0x30')](db['ZohoField'][_0xc8ad('0x45')]);_0x5add83['query']=_[_0xc8ad('0x30')](_0x4fcfa0[_0xc8ad('0x2f')]);_0x5add83[_0xc8ad('0x31')]=_['intersection'](_0x5add83[_0xc8ad('0x33')],_0x5add83['query']);_0x306f1d[_0xc8ad('0x34')]=_[_0xc8ad('0x32')](_0x5add83[_0xc8ad('0x33')],qs['fields'](_0x4fcfa0['query'][_0xc8ad('0x35')]));_0x306f1d[_0xc8ad('0x34')]=_0x306f1d[_0xc8ad('0x34')]['length']?_0x306f1d[_0xc8ad('0x34')]:_0x5add83[_0xc8ad('0x33')];_0x306f1d[_0xc8ad('0x39')]=qs[_0xc8ad('0x3a')](_0x4fcfa0[_0xc8ad('0x2f')][_0xc8ad('0x3a')]);_0x306f1d[_0xc8ad('0x3b')]=qs['filters'](_[_0xc8ad('0x3c')](_0x4fcfa0[_0xc8ad('0x2f')],_0x5add83['filters']));if(_0x4fcfa0['query'][_0xc8ad('0x3d')]){_0x306f1d[_0xc8ad('0x3b')]=_[_0xc8ad('0x3e')](_0x306f1d[_0xc8ad('0x3b')],{'$or':_[_0xc8ad('0x2a')](_0x306f1d[_0xc8ad('0x34')],function(_0x2e284a){var _0x405e1c={};_0x405e1c[_0x2e284a]={'$like':'%'+_0x4fcfa0[_0xc8ad('0x2f')]['filter']+'%'};return _0x405e1c;})});}_0x306f1d=_[_0xc8ad('0x3e')]({},_0x306f1d,_0x4fcfa0[_0xc8ad('0x40')]);return _0x23fdc6['getSubjects'](_0x306f1d);}})['then'](function(_0x3af3bf){if(_0x3af3bf){_0x176bb2=_0x3af3bf[_0xc8ad('0x36')];if(!_0x4fcfa0[_0xc8ad('0x2f')][_0xc8ad('0x4d')](_0xc8ad('0x37'))){_0x306f1d['limit']=qs[_0xc8ad('0x38')](_0x4fcfa0['query']['limit']);_0x306f1d[_0xc8ad('0x1b')]=qs['offset'](_0x4fcfa0[_0xc8ad('0x2f')][_0xc8ad('0x1b')]);}return _0x23fdc6[_0xc8ad('0x4e')](_0x306f1d);}})[_0xc8ad('0x24')](function(_0x480d2f){if(_0x480d2f){return _0x480d2f?{'count':_0x176bb2,'rows':_0x480d2f}:null;}})['then'](respondWithResult(_0x44a2e7,null))[_0xc8ad('0x43')](handleError(_0x44a2e7,null));};exports[_0xc8ad('0x4f')]=function(_0x332d0b,_0x34d25d,_0x33e2ad){var _0x3d4e9d={};var _0x52f3f4={};var _0x38a39b;var _0x2888ae;return db[_0xc8ad('0x2b')][_0xc8ad('0x4a')]({'where':{'id':_0x332d0b[_0xc8ad('0x44')]['id']}})[_0xc8ad('0x24')](handleEntityNotFound(_0x34d25d,null))[_0xc8ad('0x24')](function(_0x5b8bf0){if(_0x5b8bf0){_0x38a39b=_0x5b8bf0;_0x52f3f4[_0xc8ad('0x33')]=_[_0xc8ad('0x30')](db['ZohoField'][_0xc8ad('0x45')]);_0x52f3f4['query']=_['keys'](_0x332d0b[_0xc8ad('0x2f')]);_0x52f3f4[_0xc8ad('0x31')]=_[_0xc8ad('0x32')](_0x52f3f4[_0xc8ad('0x33')],_0x52f3f4[_0xc8ad('0x2f')]);_0x3d4e9d['attributes']=_[_0xc8ad('0x32')](_0x52f3f4[_0xc8ad('0x33')],qs[_0xc8ad('0x35')](_0x332d0b['query']['fields']));_0x3d4e9d[_0xc8ad('0x34')]=_0x3d4e9d['attributes'][_0xc8ad('0x36')]?_0x3d4e9d['attributes']:_0x52f3f4[_0xc8ad('0x33')];_0x3d4e9d['order']=qs['sort'](_0x332d0b[_0xc8ad('0x2f')][_0xc8ad('0x3a')]);_0x3d4e9d['where']=qs[_0xc8ad('0x31')](_['pick'](_0x332d0b['query'],_0x52f3f4['filters']));if(_0x332d0b[_0xc8ad('0x2f')][_0xc8ad('0x3d')]){_0x3d4e9d[_0xc8ad('0x3b')]=_['merge'](_0x3d4e9d['where'],{'$or':_[_0xc8ad('0x2a')](_0x3d4e9d[_0xc8ad('0x34')],function(_0x1f2f87){var _0x157f2a={};_0x157f2a[_0x1f2f87]={'$like':'%'+_0x332d0b['query']['filter']+'%'};return _0x157f2a;})});}_0x3d4e9d=_[_0xc8ad('0x3e')]({},_0x3d4e9d,_0x332d0b['options']);return _0x38a39b['getDescriptions'](_0x3d4e9d);}})[_0xc8ad('0x24')](function(_0x42e06c){if(_0x42e06c){_0x2888ae=_0x42e06c[_0xc8ad('0x36')];if(!_0x332d0b[_0xc8ad('0x2f')][_0xc8ad('0x4d')]('nolimit')){_0x3d4e9d['limit']=qs[_0xc8ad('0x38')](_0x332d0b[_0xc8ad('0x2f')][_0xc8ad('0x38')]);_0x3d4e9d[_0xc8ad('0x1b')]=qs[_0xc8ad('0x1b')](_0x332d0b['query']['offset']);}return _0x38a39b[_0xc8ad('0x4f')](_0x3d4e9d);}})[_0xc8ad('0x24')](function(_0x5cfa1c){if(_0x5cfa1c){return _0x5cfa1c?{'count':_0x2888ae,'rows':_0x5cfa1c}:null;}})[_0xc8ad('0x24')](respondWithResult(_0x34d25d,null))[_0xc8ad('0x43')](handleError(_0x34d25d,null));}; \ No newline at end of file +var _0x3f19=['path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','error','stack','name','send','index','map','ZohoConfiguration','fieldName','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','then','include','findAll','rows','catch','show','params','rawAttributes','keys','length','includeAll','find','create','body','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','bluebird'];(function(_0x56a494,_0x2117fc){var _0x51fab2=function(_0x2c3c8f){while(--_0x2c3c8f){_0x56a494['push'](_0x56a494['shift']());}};_0x51fab2(++_0x2117fc);}(_0x3f19,0x182));var _0x93f1=function(_0x4aca28,_0x4ab42c){_0x4aca28=_0x4aca28-0x0;var _0x1946a0=_0x3f19[_0x4aca28];return _0x1946a0;};'use strict';var emlformat=require(_0x93f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x93f1('0x1'));var jsonpatch=require(_0x93f1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x93f1('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x93f1('0x4'));var sox=require('sox');var csv=require(_0x93f1('0x5'));var ejs=require(_0x93f1('0x6'));var fs=require('fs');var fs_extra=require(_0x93f1('0x7'));var _=require(_0x93f1('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x93f1('0x9'));var deskjs=require(_0x93f1('0xa'));var toCsv=require(_0x93f1('0x5'));var querystring=require(_0x93f1('0xb'));var Papa=require(_0x93f1('0xc'));var Redis=require('ioredis');var authService=require(_0x93f1('0xd'));var qs=require(_0x93f1('0xe'));var as=require(_0x93f1('0xf'));var hardwareService=require(_0x93f1('0x10'));var logger=require(_0x93f1('0x11'))(_0x93f1('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x93f1('0x13'));var db=require(_0x93f1('0x14'))['db'];function respondWithStatusCode(_0xd80cfe,_0x559668){_0x559668=_0x559668||0xcc;return function(_0x29b60b){if(_0x29b60b){return _0xd80cfe['sendStatus'](_0x559668);}return _0xd80cfe[_0x93f1('0x15')](_0x559668)[_0x93f1('0x16')]();};}function respondWithResult(_0x3a00f0,_0x2f4bda){_0x2f4bda=_0x2f4bda||0xc8;return function(_0x9e4764){if(_0x9e4764){return _0x3a00f0[_0x93f1('0x15')](_0x2f4bda)[_0x93f1('0x17')](_0x9e4764);}};}function respondWithFilteredResult(_0x4e232e,_0x32de22){return function(_0x10e2f4){if(_0x10e2f4){var _0x5e82d8=typeof _0x32de22[_0x93f1('0x18')]===_0x93f1('0x19')&&typeof _0x32de22[_0x93f1('0x1a')]===_0x93f1('0x19');var _0x1c8450=_0x10e2f4[_0x93f1('0x1b')];var _0x5d1b77=_0x5e82d8?0x0:_0x32de22[_0x93f1('0x18')];var _0x1ed11e=_0x5e82d8?_0x10e2f4[_0x93f1('0x1b')]:_0x32de22['offset']+_0x32de22[_0x93f1('0x1a')];var _0x362a28;if(_0x1ed11e>=_0x1c8450){_0x1ed11e=_0x1c8450;_0x362a28=0xc8;}else{_0x362a28=0xce;}_0x4e232e[_0x93f1('0x15')](_0x362a28);return _0x4e232e[_0x93f1('0x1c')]('Content-Range',_0x5d1b77+'-'+_0x1ed11e+'/'+_0x1c8450)[_0x93f1('0x17')](_0x10e2f4);}return null;};}function patchUpdates(_0x4f7edc){return function(_0x4934a3){try{jsonpatch[_0x93f1('0x1d')](_0x4934a3,_0x4f7edc,!![]);}catch(_0xc99f30){return BPromise[_0x93f1('0x1e')](_0xc99f30);}return _0x4934a3[_0x93f1('0x1f')]();};}function saveUpdates(_0x1877d5,_0x4ad68a){return function(_0x19a650){if(_0x19a650){return _0x19a650[_0x93f1('0x20')](_0x1877d5)['then'](function(_0x9367e8){return _0x9367e8;});}return null;};}function removeEntity(_0xb07f18,_0x5329f9){return function(_0x1aadb7){if(_0x1aadb7){return _0x1aadb7[_0x93f1('0x21')]()['then'](function(){_0xb07f18[_0x93f1('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47ebb8,_0xd8de6f){return function(_0x4f3d01){if(!_0x4f3d01){_0x47ebb8['sendStatus'](0x194);}return _0x4f3d01;};}function handleError(_0x248a83,_0x97f532){_0x97f532=_0x97f532||0x1f4;return function(_0x37cdf0){logger[_0x93f1('0x22')](_0x37cdf0[_0x93f1('0x23')]);if(_0x37cdf0['name']){delete _0x37cdf0[_0x93f1('0x24')];}_0x248a83[_0x93f1('0x15')](_0x97f532)[_0x93f1('0x25')](_0x37cdf0);};}exports[_0x93f1('0x26')]=function(_0x4cd947,_0x591270){var _0x4e6257={},_0x1ea982={},_0x309cfa={'count':0x0,'rows':[]};var _0x14980e=_[_0x93f1('0x27')](db[_0x93f1('0x28')]['rawAttributes'],function(_0x21038c){return{'name':_0x21038c[_0x93f1('0x29')],'type':_0x21038c[_0x93f1('0x2a')]['key']};});_0x1ea982['model']=_[_0x93f1('0x27')](_0x14980e,_0x93f1('0x24'));_0x1ea982[_0x93f1('0x2b')]=_['keys'](_0x4cd947[_0x93f1('0x2b')]);_0x1ea982[_0x93f1('0x2c')]=_[_0x93f1('0x2d')](_0x1ea982[_0x93f1('0x2e')],_0x1ea982['query']);_0x4e6257[_0x93f1('0x2f')]=_['intersection'](_0x1ea982['model'],qs['fields'](_0x4cd947[_0x93f1('0x2b')][_0x93f1('0x30')]));_0x4e6257['attributes']=_0x4e6257[_0x93f1('0x2f')]['length']?_0x4e6257[_0x93f1('0x2f')]:_0x1ea982[_0x93f1('0x2e')];if(!_0x4cd947[_0x93f1('0x2b')][_0x93f1('0x31')](_0x93f1('0x32'))){_0x4e6257['limit']=qs[_0x93f1('0x1a')](_0x4cd947['query'][_0x93f1('0x1a')]);_0x4e6257[_0x93f1('0x18')]=qs['offset'](_0x4cd947['query'][_0x93f1('0x18')]);}_0x4e6257[_0x93f1('0x33')]=qs[_0x93f1('0x34')](_0x4cd947[_0x93f1('0x2b')][_0x93f1('0x34')]);_0x4e6257[_0x93f1('0x35')]=qs[_0x93f1('0x2c')](_[_0x93f1('0x36')](_0x4cd947['query'],_0x1ea982['filters']),_0x14980e);if(_0x4cd947[_0x93f1('0x2b')]['filter']){_0x4e6257[_0x93f1('0x35')]=_['merge'](_0x4e6257[_0x93f1('0x35')],{'$or':_[_0x93f1('0x27')](_0x14980e,function(_0x15ca4e){if(_0x15ca4e[_0x93f1('0x2a')]!==_0x93f1('0x37')){var _0x1909fe={};_0x1909fe[_0x15ca4e[_0x93f1('0x24')]]={'$like':'%'+_0x4cd947['query'][_0x93f1('0x38')]+'%'};return _0x1909fe;}})});}_0x4e6257=_[_0x93f1('0x39')]({},_0x4e6257,_0x4cd947[_0x93f1('0x3a')]);var _0x233f96={'where':_0x4e6257[_0x93f1('0x35')]};return db[_0x93f1('0x28')][_0x93f1('0x1b')](_0x233f96)[_0x93f1('0x3b')](function(_0x250947){_0x309cfa['count']=_0x250947;if(_0x4cd947[_0x93f1('0x2b')]['includeAll']){_0x4e6257[_0x93f1('0x3c')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x93f1('0x3d')](_0x4e6257);})[_0x93f1('0x3b')](function(_0x5912e2){_0x309cfa[_0x93f1('0x3e')]=_0x5912e2;return _0x309cfa;})['then'](respondWithFilteredResult(_0x591270,_0x4e6257))[_0x93f1('0x3f')](handleError(_0x591270,null));};exports[_0x93f1('0x40')]=function(_0x18bc4a,_0xdf40b0){var _0x59d863={'raw':![],'where':{'id':_0x18bc4a[_0x93f1('0x41')]['id']}},_0x34a1d8={};_0x34a1d8[_0x93f1('0x2e')]=_['keys'](db[_0x93f1('0x28')][_0x93f1('0x42')]);_0x34a1d8[_0x93f1('0x2b')]=_[_0x93f1('0x43')](_0x18bc4a[_0x93f1('0x2b')]);_0x34a1d8[_0x93f1('0x2c')]=_[_0x93f1('0x2d')](_0x34a1d8['model'],_0x34a1d8[_0x93f1('0x2b')]);_0x59d863[_0x93f1('0x2f')]=_[_0x93f1('0x2d')](_0x34a1d8[_0x93f1('0x2e')],qs[_0x93f1('0x30')](_0x18bc4a[_0x93f1('0x2b')]['fields']));_0x59d863[_0x93f1('0x2f')]=_0x59d863[_0x93f1('0x2f')][_0x93f1('0x44')]?_0x59d863[_0x93f1('0x2f')]:_0x34a1d8[_0x93f1('0x2e')];if(_0x18bc4a[_0x93f1('0x2b')][_0x93f1('0x45')]){_0x59d863[_0x93f1('0x3c')]=[{'all':!![]}];}_0x59d863=_['merge']({},_0x59d863,_0x18bc4a[_0x93f1('0x3a')]);return db[_0x93f1('0x28')][_0x93f1('0x46')](_0x59d863)[_0x93f1('0x3b')](handleEntityNotFound(_0xdf40b0,null))['then'](respondWithResult(_0xdf40b0,null))['catch'](handleError(_0xdf40b0,null));};exports[_0x93f1('0x47')]=function(_0x791bc1,_0x473cfc){return db[_0x93f1('0x28')][_0x93f1('0x47')](_0x791bc1[_0x93f1('0x48')],{})[_0x93f1('0x3b')](respondWithResult(_0x473cfc,0xc9))[_0x93f1('0x3f')](handleError(_0x473cfc,null));};exports[_0x93f1('0x20')]=function(_0x1866b7,_0x5ac052){if(_0x1866b7[_0x93f1('0x48')]['id']){delete _0x1866b7[_0x93f1('0x48')]['id'];}return db[_0x93f1('0x28')][_0x93f1('0x46')]({'where':{'id':_0x1866b7[_0x93f1('0x41')]['id']}})[_0x93f1('0x3b')](handleEntityNotFound(_0x5ac052,null))[_0x93f1('0x3b')](saveUpdates(_0x1866b7[_0x93f1('0x48')],null))[_0x93f1('0x3b')](respondWithResult(_0x5ac052,null))[_0x93f1('0x3f')](handleError(_0x5ac052,null));};exports[_0x93f1('0x21')]=function(_0x11f93b,_0x2db81c){return db['ZohoConfiguration'][_0x93f1('0x46')]({'where':{'id':_0x11f93b['params']['id']}})[_0x93f1('0x3b')](handleEntityNotFound(_0x2db81c,null))[_0x93f1('0x3b')](removeEntity(_0x2db81c,null))[_0x93f1('0x3f')](handleError(_0x2db81c,null));};exports[_0x93f1('0x49')]=function(_0x3bd452,_0x348dc1,_0x291c1c){var _0x4761b2={};var _0x500a9c={};var _0x282e50;var _0xa38b81;return db[_0x93f1('0x28')][_0x93f1('0x4a')]({'where':{'id':_0x3bd452[_0x93f1('0x41')]['id']}})[_0x93f1('0x3b')](handleEntityNotFound(_0x348dc1,null))[_0x93f1('0x3b')](function(_0xe9e6bd){if(_0xe9e6bd){_0x282e50=_0xe9e6bd;_0x500a9c[_0x93f1('0x2e')]=_[_0x93f1('0x43')](db[_0x93f1('0x4b')]['rawAttributes']);_0x500a9c[_0x93f1('0x2b')]=_[_0x93f1('0x43')](_0x3bd452[_0x93f1('0x2b')]);_0x500a9c['filters']=_[_0x93f1('0x2d')](_0x500a9c[_0x93f1('0x2e')],_0x500a9c[_0x93f1('0x2b')]);_0x4761b2[_0x93f1('0x2f')]=_[_0x93f1('0x2d')](_0x500a9c[_0x93f1('0x2e')],qs[_0x93f1('0x30')](_0x3bd452['query'][_0x93f1('0x30')]));_0x4761b2[_0x93f1('0x2f')]=_0x4761b2[_0x93f1('0x2f')][_0x93f1('0x44')]?_0x4761b2['attributes']:_0x500a9c[_0x93f1('0x2e')];_0x4761b2[_0x93f1('0x33')]=qs[_0x93f1('0x34')](_0x3bd452[_0x93f1('0x2b')][_0x93f1('0x34')]);_0x4761b2[_0x93f1('0x35')]=qs[_0x93f1('0x2c')](_['pick'](_0x3bd452[_0x93f1('0x2b')],_0x500a9c[_0x93f1('0x2c')]));if(_0x3bd452[_0x93f1('0x2b')][_0x93f1('0x38')]){_0x4761b2[_0x93f1('0x35')]=_[_0x93f1('0x39')](_0x4761b2[_0x93f1('0x35')],{'$or':_[_0x93f1('0x27')](_0x4761b2[_0x93f1('0x2f')],function(_0xea8180){var _0x525d7f={};_0x525d7f[_0xea8180]={'$like':'%'+_0x3bd452['query'][_0x93f1('0x38')]+'%'};return _0x525d7f;})});}_0x4761b2=_[_0x93f1('0x39')]({},_0x4761b2,_0x3bd452[_0x93f1('0x3a')]);return _0x282e50[_0x93f1('0x49')](_0x4761b2);}})[_0x93f1('0x3b')](function(_0x12285d){if(_0x12285d){_0xa38b81=_0x12285d['length'];if(!_0x3bd452[_0x93f1('0x2b')][_0x93f1('0x31')]('nolimit')){_0x4761b2[_0x93f1('0x1a')]=qs[_0x93f1('0x1a')](_0x3bd452[_0x93f1('0x2b')][_0x93f1('0x1a')]);_0x4761b2[_0x93f1('0x18')]=qs[_0x93f1('0x18')](_0x3bd452[_0x93f1('0x2b')][_0x93f1('0x18')]);}return _0x282e50['getFields'](_0x4761b2);}})[_0x93f1('0x3b')](function(_0xc47301){if(_0xc47301){return _0xc47301?{'count':_0xa38b81,'rows':_0xc47301}:null;}})[_0x93f1('0x3b')](respondWithResult(_0x348dc1,null))[_0x93f1('0x3f')](handleError(_0x348dc1,null));};exports[_0x93f1('0x4c')]=function(_0x47ee7d,_0x4b8ef3,_0x569a93){var _0x58c47c={};var _0x2e344a={};var _0x4a2e68;var _0x3ed05c;return db['ZohoConfiguration'][_0x93f1('0x4a')]({'where':{'id':_0x47ee7d['params']['id']}})[_0x93f1('0x3b')](handleEntityNotFound(_0x4b8ef3,null))[_0x93f1('0x3b')](function(_0x40a377){if(_0x40a377){_0x4a2e68=_0x40a377;_0x2e344a['model']=_['keys'](db['ZohoField'][_0x93f1('0x42')]);_0x2e344a[_0x93f1('0x2b')]=_[_0x93f1('0x43')](_0x47ee7d['query']);_0x2e344a[_0x93f1('0x2c')]=_['intersection'](_0x2e344a[_0x93f1('0x2e')],_0x2e344a[_0x93f1('0x2b')]);_0x58c47c[_0x93f1('0x2f')]=_[_0x93f1('0x2d')](_0x2e344a[_0x93f1('0x2e')],qs[_0x93f1('0x30')](_0x47ee7d[_0x93f1('0x2b')][_0x93f1('0x30')]));_0x58c47c['attributes']=_0x58c47c['attributes'][_0x93f1('0x44')]?_0x58c47c[_0x93f1('0x2f')]:_0x2e344a[_0x93f1('0x2e')];_0x58c47c['order']=qs[_0x93f1('0x34')](_0x47ee7d[_0x93f1('0x2b')][_0x93f1('0x34')]);_0x58c47c[_0x93f1('0x35')]=qs[_0x93f1('0x2c')](_[_0x93f1('0x36')](_0x47ee7d[_0x93f1('0x2b')],_0x2e344a[_0x93f1('0x2c')]));if(_0x47ee7d[_0x93f1('0x2b')][_0x93f1('0x38')]){_0x58c47c[_0x93f1('0x35')]=_[_0x93f1('0x39')](_0x58c47c[_0x93f1('0x35')],{'$or':_[_0x93f1('0x27')](_0x58c47c[_0x93f1('0x2f')],function(_0x573fe6){var _0x3f16ae={};_0x3f16ae[_0x573fe6]={'$like':'%'+_0x47ee7d[_0x93f1('0x2b')][_0x93f1('0x38')]+'%'};return _0x3f16ae;})});}_0x58c47c=_[_0x93f1('0x39')]({},_0x58c47c,_0x47ee7d[_0x93f1('0x3a')]);return _0x4a2e68['getSubjects'](_0x58c47c);}})[_0x93f1('0x3b')](function(_0x57ad5f){if(_0x57ad5f){_0x3ed05c=_0x57ad5f[_0x93f1('0x44')];if(!_0x47ee7d['query'][_0x93f1('0x31')](_0x93f1('0x32'))){_0x58c47c[_0x93f1('0x1a')]=qs[_0x93f1('0x1a')](_0x47ee7d[_0x93f1('0x2b')][_0x93f1('0x1a')]);_0x58c47c[_0x93f1('0x18')]=qs[_0x93f1('0x18')](_0x47ee7d[_0x93f1('0x2b')][_0x93f1('0x18')]);}return _0x4a2e68['getSubjects'](_0x58c47c);}})[_0x93f1('0x3b')](function(_0x5dbcd0){if(_0x5dbcd0){return _0x5dbcd0?{'count':_0x3ed05c,'rows':_0x5dbcd0}:null;}})['then'](respondWithResult(_0x4b8ef3,null))['catch'](handleError(_0x4b8ef3,null));};exports[_0x93f1('0x4d')]=function(_0x4233ae,_0x2afc59,_0x501b83){var _0x501d08={};var _0x44b1e1={};var _0x2e24dd;var _0x4f2ab4;return db['ZohoConfiguration'][_0x93f1('0x4a')]({'where':{'id':_0x4233ae['params']['id']}})[_0x93f1('0x3b')](handleEntityNotFound(_0x2afc59,null))[_0x93f1('0x3b')](function(_0x2a85da){if(_0x2a85da){_0x2e24dd=_0x2a85da;_0x44b1e1[_0x93f1('0x2e')]=_[_0x93f1('0x43')](db['ZohoField']['rawAttributes']);_0x44b1e1[_0x93f1('0x2b')]=_[_0x93f1('0x43')](_0x4233ae[_0x93f1('0x2b')]);_0x44b1e1['filters']=_[_0x93f1('0x2d')](_0x44b1e1['model'],_0x44b1e1[_0x93f1('0x2b')]);_0x501d08[_0x93f1('0x2f')]=_[_0x93f1('0x2d')](_0x44b1e1[_0x93f1('0x2e')],qs[_0x93f1('0x30')](_0x4233ae[_0x93f1('0x2b')][_0x93f1('0x30')]));_0x501d08[_0x93f1('0x2f')]=_0x501d08[_0x93f1('0x2f')][_0x93f1('0x44')]?_0x501d08[_0x93f1('0x2f')]:_0x44b1e1[_0x93f1('0x2e')];_0x501d08[_0x93f1('0x33')]=qs['sort'](_0x4233ae[_0x93f1('0x2b')][_0x93f1('0x34')]);_0x501d08[_0x93f1('0x35')]=qs[_0x93f1('0x2c')](_[_0x93f1('0x36')](_0x4233ae[_0x93f1('0x2b')],_0x44b1e1[_0x93f1('0x2c')]));if(_0x4233ae[_0x93f1('0x2b')][_0x93f1('0x38')]){_0x501d08[_0x93f1('0x35')]=_[_0x93f1('0x39')](_0x501d08[_0x93f1('0x35')],{'$or':_[_0x93f1('0x27')](_0x501d08[_0x93f1('0x2f')],function(_0x36cde2){var _0x40ce11={};_0x40ce11[_0x36cde2]={'$like':'%'+_0x4233ae[_0x93f1('0x2b')][_0x93f1('0x38')]+'%'};return _0x40ce11;})});}_0x501d08=_[_0x93f1('0x39')]({},_0x501d08,_0x4233ae[_0x93f1('0x3a')]);return _0x2e24dd[_0x93f1('0x4d')](_0x501d08);}})[_0x93f1('0x3b')](function(_0x4f0c7a){if(_0x4f0c7a){_0x4f2ab4=_0x4f0c7a[_0x93f1('0x44')];if(!_0x4233ae['query'][_0x93f1('0x31')](_0x93f1('0x32'))){_0x501d08[_0x93f1('0x1a')]=qs[_0x93f1('0x1a')](_0x4233ae[_0x93f1('0x2b')]['limit']);_0x501d08[_0x93f1('0x18')]=qs['offset'](_0x4233ae['query']['offset']);}return _0x2e24dd[_0x93f1('0x4d')](_0x501d08);}})[_0x93f1('0x3b')](function(_0x347f78){if(_0x347f78){return _0x347f78?{'count':_0x4f2ab4,'rows':_0x347f78}:null;}})[_0x93f1('0x3b')](respondWithResult(_0x2afc59,null))[_0x93f1('0x3f')](handleError(_0x2afc59,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 846fbc0..4152fa9 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.model.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e1f=['exports','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','bluebird','../../config/environment'];(function(_0x54a2e4,_0x1ff92c){var _0x4742d0=function(_0x147a6f){while(--_0x147a6f){_0x54a2e4['push'](_0x54a2e4['shift']());}};_0x4742d0(++_0x1ff92c);}(_0x4e1f,0x19b));var _0xf4e1=function(_0x459588,_0x19db6b){_0x459588=_0x459588-0x0;var _0x153c02=_0x4e1f[_0x459588];return _0x153c02;};'use strict';var _=require(_0xf4e1('0x0'));var util=require('util');var logger=require(_0xf4e1('0x1'))(_0xf4e1('0x2'));var moment=require('moment');var BPromise=require(_0xf4e1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf4e1('0x4'));var attributes=require('./intZohoConfiguration.attributes');module[_0xf4e1('0x5')]=function(_0xe18e77,_0x2e6b23){return _0xe18e77['define'](_0xf4e1('0x6'),attributes,{'tableName':_0xf4e1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc413=['lodash','util','api','bluebird','path','rimraf','define','ZohoConfiguration','int_zoho_configurations'];(function(_0x3d2b19,_0x349a5b){var _0x29769b=function(_0x5048ad){while(--_0x5048ad){_0x3d2b19['push'](_0x3d2b19['shift']());}};_0x29769b(++_0x349a5b);}(_0xc413,0x183));var _0x3c41=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc413[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x3c41('0x0'));var util=require(_0x3c41('0x1'));var logger=require('../../config/logger')(_0x3c41('0x2'));var moment=require('moment');var BPromise=require(_0x3c41('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3c41('0x4'));var rimraf=require(_0x3c41('0x5'));var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x111f14,_0x3db98d){return _0x111f14[_0x3c41('0x6')](_0x3c41('0x7'),attributes,{'tableName':_0x3c41('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index ac1f3e1..856d053 100644 --- a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js +++ b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab22=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x282dc9,_0x565f16){var _0x1aa4c8=function(_0x78fbf0){while(--_0x78fbf0){_0x282dc9['push'](_0x282dc9['shift']());}};_0x1aa4c8(++_0x565f16);}(_0xab22,0x1b7));var _0x2ab2=function(_0xb21919,_0x5dab4e){_0xb21919=_0xb21919-0x0;var _0xd4bed3=_0xab22[_0xb21919];return _0xd4bed3;};'use strict';var _=require(_0x2ab2('0x0'));var util=require(_0x2ab2('0x1'));var moment=require(_0x2ab2('0x2'));var BPromise=require(_0x2ab2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ab2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ab2('0x5'));var logger=require(_0x2ab2('0x6'))(_0x2ab2('0x7'));var config=require(_0x2ab2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2ab2('0x9')][_0x2ab2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49042c,_0x21e442,_0xbf7abe){return new BPromise(function(_0x399edd,_0xc20e5b){return client[_0x2ab2('0xb')](_0x49042c,_0xbf7abe)['then'](function(_0x50c828){logger[_0x2ab2('0xc')](_0x2ab2('0xd'),_0x21e442,_0x2ab2('0xe'));logger['debug'](_0x2ab2('0xf'),_0x21e442,_0x2ab2('0xe'),JSON[_0x2ab2('0x10')](_0x50c828));if(_0x50c828[_0x2ab2('0x11')]){if(_0x50c828[_0x2ab2('0x11')]['code']===0x1f4){logger[_0x2ab2('0x11')](_0x2ab2('0xd'),_0x21e442,_0x50c828[_0x2ab2('0x11')]['message']);return _0xc20e5b(_0x50c828[_0x2ab2('0x11')][_0x2ab2('0x12')]);}logger[_0x2ab2('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x21e442,_0x50c828[_0x2ab2('0x11')][_0x2ab2('0x12')]);return _0x399edd(_0x50c828[_0x2ab2('0x11')][_0x2ab2('0x12')]);}else{logger[_0x2ab2('0xc')](_0x2ab2('0xd'),_0x21e442,'request\x20sent');_0x399edd(_0x50c828[_0x2ab2('0x13')]['message']);}})[_0x2ab2('0x14')](function(_0x1d1c26){logger[_0x2ab2('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x21e442,_0x1d1c26);_0xc20e5b(_0x1d1c26);});});} \ No newline at end of file +var _0xd217=['request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0xd217,0x10b));var _0x7d21=function(_0x4ae4f9,_0x5d2905){_0x4ae4f9=_0x4ae4f9-0x0;var _0x5f4f99=_0xd217[_0x4ae4f9];return _0x5f4f99;};'use strict';var _=require(_0x7d21('0x0'));var util=require('util');var moment=require(_0x7d21('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d21('0x2'));var db=require(_0x7d21('0x3'))['db'];var utils=require(_0x7d21('0x4'));var logger=require(_0x7d21('0x5'))('rpc');var config=require(_0x7d21('0x6'));var jayson=require(_0x7d21('0x7'));var client=jayson[_0x7d21('0x8')][_0x7d21('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bf470,_0x53526f,_0x31871c){return new BPromise(function(_0x54ead5,_0x193c15){return client[_0x7d21('0xa')](_0x3bf470,_0x31871c)[_0x7d21('0xb')](function(_0x2de395){logger['info'](_0x7d21('0xc'),_0x53526f,_0x7d21('0xd'));logger['debug'](_0x7d21('0xe'),_0x53526f,_0x7d21('0xd'),JSON[_0x7d21('0xf')](_0x2de395));if(_0x2de395['error']){if(_0x2de395[_0x7d21('0x10')][_0x7d21('0x11')]===0x1f4){logger['error'](_0x7d21('0xc'),_0x53526f,_0x2de395['error']['message']);return _0x193c15(_0x2de395[_0x7d21('0x10')][_0x7d21('0x12')]);}logger[_0x7d21('0x10')](_0x7d21('0xc'),_0x53526f,_0x2de395[_0x7d21('0x10')][_0x7d21('0x12')]);return _0x54ead5(_0x2de395['error'][_0x7d21('0x12')]);}else{logger['info'](_0x7d21('0xc'),_0x53526f,_0x7d21('0xd'));_0x54ead5(_0x2de395[_0x7d21('0x13')]['message']);}})['catch'](function(_0x44b0fe){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x53526f,_0x44b0fe);_0x193c15(_0x44b0fe);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 920c7b1..52a2664 100644 --- a/server/api/intZohoField/index.js +++ b/server/api/intZohoField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd27=['create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./intZohoField.controller','isAuthenticated','get','/:id','show','post'];(function(_0xfbe06e,_0x2fb7ab){var _0x24e5b6=function(_0x48569f){while(--_0x48569f){_0xfbe06e['push'](_0xfbe06e['shift']());}};_0x24e5b6(++_0x2fb7ab);}(_0xdd27,0x114));var _0x7dd2=function(_0x5c8827,_0x5bc5d7){_0x5c8827=_0x5c8827-0x0;var _0x50ffd5=_0xdd27[_0x5c8827];return _0x50ffd5;};'use strict';var multer=require(_0x7dd2('0x0'));var util=require(_0x7dd2('0x1'));var path=require('path');var timeout=require(_0x7dd2('0x2'));var express=require(_0x7dd2('0x3'));var router=express[_0x7dd2('0x4')]();var fs_extra=require(_0x7dd2('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7dd2('0x6'));var controller=require(_0x7dd2('0x7'));router['get']('/',auth[_0x7dd2('0x8')](),controller['index']);router[_0x7dd2('0x9')](_0x7dd2('0xa'),auth[_0x7dd2('0x8')](),controller[_0x7dd2('0xb')]);router[_0x7dd2('0xc')]('/',auth[_0x7dd2('0x8')](),controller[_0x7dd2('0xd')]);router[_0x7dd2('0xe')](_0x7dd2('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7dd2('0xf')]);module[_0x7dd2('0x10')]=router; \ No newline at end of file +var _0x9a21=['update','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','post','create'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x9a21,0x151));var _0x19a2=function(_0x3c40f4,_0x500b8a){_0x3c40f4=_0x3c40f4-0x0;var _0x1209d=_0x9a21[_0x3c40f4];return _0x1209d;};'use strict';var multer=require('multer');var util=require(_0x19a2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x19a2('0x1'));var router=express[_0x19a2('0x2')]();var fs_extra=require(_0x19a2('0x3'));var auth=require(_0x19a2('0x4'));var interaction=require(_0x19a2('0x5'));var config=require('../../config/environment');var controller=require(_0x19a2('0x6'));router[_0x19a2('0x7')]('/',auth[_0x19a2('0x8')](),controller[_0x19a2('0x9')]);router[_0x19a2('0x7')](_0x19a2('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x19a2('0xb')]('/',auth['isAuthenticated'](),controller[_0x19a2('0xc')]);router['put'](_0x19a2('0xa'),auth[_0x19a2('0x8')](),controller[_0x19a2('0xd')]);router['delete'](_0x19a2('0xa'),auth[_0x19a2('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 100e320..5827381 100644 --- a/server/api/intZohoField/intZohoField.attributes.js +++ b/server/api/intZohoField/intZohoField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf12=['string','STRING','variable','BOOLEAN','ENUM','customVariable','keyValue','picklist'];(function(_0x76cc52,_0x2b7c64){var _0x172d81=function(_0x1359eb){while(--_0x1359eb){_0x76cc52['push'](_0x76cc52['shift']());}};_0x172d81(++_0x2b7c64);}(_0xdf12,0x6c));var _0x2df1=function(_0x48cd9c,_0x595ba7){_0x48cd9c=_0x48cd9c-0x0;var _0x23c6df=_0xdf12[_0x48cd9c];return _0x23c6df;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x2df1('0x0')]('string','variable',_0x2df1('0x1'),_0x2df1('0x2'),_0x2df1('0x3')),'defaultValue':_0x2df1('0x4')},'content':{'type':Sequelize[_0x2df1('0x5')]},'key':{'type':Sequelize[_0x2df1('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x2df1('0x4'),_0x2df1('0x6'),_0x2df1('0x1'))},'keyContent':{'type':Sequelize[_0x2df1('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2df1('0x5')]},'customField':{'type':Sequelize[_0x2df1('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2df1('0x5')]}}; \ No newline at end of file +var _0xfe36=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports'];(function(_0x2caf2a,_0x1a0827){var _0xfccfb8=function(_0x4aa624){while(--_0x4aa624){_0x2caf2a['push'](_0x2caf2a['shift']());}};_0xfccfb8(++_0x1a0827);}(_0xfe36,0x1dc));var _0x6fe3=function(_0x5dabe8,_0x1755db){_0x5dabe8=_0x5dabe8-0x0;var _0x174d7c=_0xfe36[_0x5dabe8];return _0x174d7c;};'use strict';var Sequelize=require('sequelize');module[_0x6fe3('0x0')]={'type':{'type':Sequelize[_0x6fe3('0x1')](_0x6fe3('0x2'),_0x6fe3('0x3'),_0x6fe3('0x4'),_0x6fe3('0x5'),_0x6fe3('0x6')),'defaultValue':_0x6fe3('0x2')},'content':{'type':Sequelize[_0x6fe3('0x7')]},'key':{'type':Sequelize[_0x6fe3('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x6fe3('0x2'),_0x6fe3('0x3'),_0x6fe3('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6fe3('0x7')]},'nameField':{'type':Sequelize[_0x6fe3('0x7')]},'customField':{'type':Sequelize[_0x6fe3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6fe3('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 0da877a..89612d8 100644 --- a/server/api/intZohoField/intZohoField.controller.js +++ b/server/api/intZohoField/intZohoField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc487=['map','ZohoField','rawAttributes','key','model','name','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','type','findAll','catch','show','params','includeAll','include','options','find','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','reject','save','destroy','then','error','stack','send','index'];(function(_0x233d57,_0x284678){var _0x3eec8c=function(_0x56d91b){while(--_0x56d91b){_0x233d57['push'](_0x233d57['shift']());}};_0x3eec8c(++_0x284678);}(_0xc487,0x6b));var _0x7c48=function(_0x2badee,_0xa39b95){_0x2badee=_0x2badee-0x0;var _0x3f645c=_0xc487[_0x2badee];return _0x3f645c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c48('0x0'));var zipdir=require(_0x7c48('0x1'));var jsonpatch=require(_0x7c48('0x2'));var rp=require(_0x7c48('0x3'));var moment=require(_0x7c48('0x4'));var BPromise=require(_0x7c48('0x5'));var Mustache=require(_0x7c48('0x6'));var util=require(_0x7c48('0x7'));var path=require(_0x7c48('0x8'));var sox=require(_0x7c48('0x9'));var csv=require(_0x7c48('0xa'));var ejs=require(_0x7c48('0xb'));var fs=require('fs');var fs_extra=require(_0x7c48('0xc'));var _=require('lodash');var squel=require(_0x7c48('0xd'));var crypto=require(_0x7c48('0xe'));var jsforce=require(_0x7c48('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7c48('0xa'));var querystring=require(_0x7c48('0x10'));var Papa=require('papaparse');var Redis=require(_0x7c48('0x11'));var authService=require(_0x7c48('0x12'));var qs=require(_0x7c48('0x13'));var as=require(_0x7c48('0x14'));var hardwareService=require(_0x7c48('0x15'));var logger=require('../../config/logger')(_0x7c48('0x16'));var utils=require('../../config/utils');var config=require(_0x7c48('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7c48('0x18'))['db'];function respondWithStatusCode(_0x4fffb8,_0x4b27b6){_0x4b27b6=_0x4b27b6||0xcc;return function(_0x400dd4){if(_0x400dd4){return _0x4fffb8[_0x7c48('0x19')](_0x4b27b6);}return _0x4fffb8[_0x7c48('0x1a')](_0x4b27b6)[_0x7c48('0x1b')]();};}function respondWithResult(_0x364e58,_0x5c5268){_0x5c5268=_0x5c5268||0xc8;return function(_0x4b85cd){if(_0x4b85cd){return _0x364e58[_0x7c48('0x1a')](_0x5c5268)[_0x7c48('0x1c')](_0x4b85cd);}};}function respondWithFilteredResult(_0x54640d,_0xa50f4){return function(_0x1792be){if(_0x1792be){var _0x37af6e=typeof _0xa50f4['offset']===_0x7c48('0x1d')&&typeof _0xa50f4[_0x7c48('0x1e')]==='undefined';var _0x197b96=_0x1792be[_0x7c48('0x1f')];var _0x88cca=_0x37af6e?0x0:_0xa50f4['offset'];var _0x1efd67=_0x37af6e?_0x1792be[_0x7c48('0x1f')]:_0xa50f4['offset']+_0xa50f4[_0x7c48('0x1e')];var _0x16b500;if(_0x1efd67>=_0x197b96){_0x1efd67=_0x197b96;_0x16b500=0xc8;}else{_0x16b500=0xce;}_0x54640d[_0x7c48('0x1a')](_0x16b500);return _0x54640d[_0x7c48('0x20')]('Content-Range',_0x88cca+'-'+_0x1efd67+'/'+_0x197b96)['json'](_0x1792be);}return null;};}function patchUpdates(_0xba2d7a){return function(_0x301bb3){try{jsonpatch['apply'](_0x301bb3,_0xba2d7a,!![]);}catch(_0x13334f){return BPromise[_0x7c48('0x21')](_0x13334f);}return _0x301bb3[_0x7c48('0x22')]();};}function saveUpdates(_0x456ab6,_0x1beab0){return function(_0xd565f5){if(_0xd565f5){return _0xd565f5['update'](_0x456ab6)['then'](function(_0x3a3f6f){return _0x3a3f6f;});}return null;};}function removeEntity(_0x397bbf,_0x31b4d6){return function(_0x4ebdb9){if(_0x4ebdb9){return _0x4ebdb9[_0x7c48('0x23')]()[_0x7c48('0x24')](function(){_0x397bbf[_0x7c48('0x1a')](0xcc)[_0x7c48('0x1b')]();});}};}function handleEntityNotFound(_0x264a08,_0x50e5ad){return function(_0x3bfaa5){if(!_0x3bfaa5){_0x264a08[_0x7c48('0x19')](0x194);}return _0x3bfaa5;};}function handleError(_0x3ec62b,_0x17685a){_0x17685a=_0x17685a||0x1f4;return function(_0x5bc455){logger[_0x7c48('0x25')](_0x5bc455[_0x7c48('0x26')]);if(_0x5bc455['name']){delete _0x5bc455['name'];}_0x3ec62b[_0x7c48('0x1a')](_0x17685a)[_0x7c48('0x27')](_0x5bc455);};}exports[_0x7c48('0x28')]=function(_0x1ca7ab,_0x3a500a){var _0x34a4df={},_0x7e49b7={},_0x59e15a={'count':0x0,'rows':[]};var _0x38ff2e=_[_0x7c48('0x29')](db[_0x7c48('0x2a')][_0x7c48('0x2b')],function(_0x500279){return{'name':_0x500279['fieldName'],'type':_0x500279['type'][_0x7c48('0x2c')]};});_0x7e49b7[_0x7c48('0x2d')]=_[_0x7c48('0x29')](_0x38ff2e,_0x7c48('0x2e'));_0x7e49b7['query']=_[_0x7c48('0x2f')](_0x1ca7ab['query']);_0x7e49b7[_0x7c48('0x30')]=_['intersection'](_0x7e49b7['model'],_0x7e49b7[_0x7c48('0x31')]);_0x34a4df[_0x7c48('0x32')]=_[_0x7c48('0x33')](_0x7e49b7[_0x7c48('0x2d')],qs[_0x7c48('0x34')](_0x1ca7ab[_0x7c48('0x31')][_0x7c48('0x34')]));_0x34a4df[_0x7c48('0x32')]=_0x34a4df['attributes'][_0x7c48('0x35')]?_0x34a4df['attributes']:_0x7e49b7[_0x7c48('0x2d')];if(!_0x1ca7ab[_0x7c48('0x31')][_0x7c48('0x36')](_0x7c48('0x37'))){_0x34a4df[_0x7c48('0x1e')]=qs[_0x7c48('0x1e')](_0x1ca7ab[_0x7c48('0x31')][_0x7c48('0x1e')]);_0x34a4df[_0x7c48('0x38')]=qs[_0x7c48('0x38')](_0x1ca7ab[_0x7c48('0x31')][_0x7c48('0x38')]);}_0x34a4df[_0x7c48('0x39')]=qs['sort'](_0x1ca7ab['query'][_0x7c48('0x3a')]);_0x34a4df['where']=qs['filters'](_[_0x7c48('0x3b')](_0x1ca7ab[_0x7c48('0x31')],_0x7e49b7['filters']),_0x38ff2e);if(_0x1ca7ab[_0x7c48('0x31')][_0x7c48('0x3c')]){_0x34a4df[_0x7c48('0x3d')]=_[_0x7c48('0x3e')](_0x34a4df[_0x7c48('0x3d')],{'$or':_[_0x7c48('0x29')](_0x38ff2e,function(_0x2d4e38){if(_0x2d4e38[_0x7c48('0x3f')]!=='VIRTUAL'){var _0x1cde67={};_0x1cde67[_0x2d4e38[_0x7c48('0x2e')]]={'$like':'%'+_0x1ca7ab['query'][_0x7c48('0x3c')]+'%'};return _0x1cde67;}})});}_0x34a4df=_[_0x7c48('0x3e')]({},_0x34a4df,_0x1ca7ab['options']);var _0x2aa4d4={'where':_0x34a4df[_0x7c48('0x3d')]};return db[_0x7c48('0x2a')]['count'](_0x2aa4d4)[_0x7c48('0x24')](function(_0x518bb1){_0x59e15a[_0x7c48('0x1f')]=_0x518bb1;if(_0x1ca7ab['query']['includeAll']){_0x34a4df['include']=[{'all':!![]}];}return db[_0x7c48('0x2a')][_0x7c48('0x40')](_0x34a4df);})['then'](function(_0x2ef398){_0x59e15a['rows']=_0x2ef398;return _0x59e15a;})[_0x7c48('0x24')](respondWithFilteredResult(_0x3a500a,_0x34a4df))[_0x7c48('0x41')](handleError(_0x3a500a,null));};exports[_0x7c48('0x42')]=function(_0x5010d3,_0x3b74f8){var _0x41a055={'raw':!![],'where':{'id':_0x5010d3[_0x7c48('0x43')]['id']}},_0x260c41={};_0x260c41['model']=_[_0x7c48('0x2f')](db[_0x7c48('0x2a')][_0x7c48('0x2b')]);_0x260c41[_0x7c48('0x31')]=_[_0x7c48('0x2f')](_0x5010d3[_0x7c48('0x31')]);_0x260c41['filters']=_['intersection'](_0x260c41[_0x7c48('0x2d')],_0x260c41['query']);_0x41a055['attributes']=_[_0x7c48('0x33')](_0x260c41['model'],qs[_0x7c48('0x34')](_0x5010d3['query'][_0x7c48('0x34')]));_0x41a055['attributes']=_0x41a055[_0x7c48('0x32')][_0x7c48('0x35')]?_0x41a055[_0x7c48('0x32')]:_0x260c41[_0x7c48('0x2d')];if(_0x5010d3[_0x7c48('0x31')][_0x7c48('0x44')]){_0x41a055[_0x7c48('0x45')]=[{'all':!![]}];}_0x41a055=_['merge']({},_0x41a055,_0x5010d3[_0x7c48('0x46')]);return db[_0x7c48('0x2a')][_0x7c48('0x47')](_0x41a055)['then'](handleEntityNotFound(_0x3b74f8,null))[_0x7c48('0x24')](respondWithResult(_0x3b74f8,null))[_0x7c48('0x41')](handleError(_0x3b74f8,null));};exports['create']=function(_0x2b0a58,_0x5dc3d1){return db['ZohoField']['create'](_0x2b0a58['body'],{})['then'](respondWithResult(_0x5dc3d1,0xc9))['catch'](handleError(_0x5dc3d1,null));};exports[_0x7c48('0x48')]=function(_0x1b6685,_0x35b145){if(_0x1b6685[_0x7c48('0x49')]['id']){delete _0x1b6685[_0x7c48('0x49')]['id'];}return db[_0x7c48('0x2a')][_0x7c48('0x47')]({'where':{'id':_0x1b6685['params']['id']}})[_0x7c48('0x24')](handleEntityNotFound(_0x35b145,null))[_0x7c48('0x24')](saveUpdates(_0x1b6685[_0x7c48('0x49')],null))[_0x7c48('0x24')](respondWithResult(_0x35b145,null))['catch'](handleError(_0x35b145,null));};exports[_0x7c48('0x23')]=function(_0x94d525,_0xbf8b2c){return db[_0x7c48('0x2a')][_0x7c48('0x47')]({'where':{'id':_0x94d525[_0x7c48('0x43')]['id']}})[_0x7c48('0x24')](handleEntityNotFound(_0xbf8b2c,null))['then'](removeEntity(_0xbf8b2c,null))[_0x7c48('0x41')](handleError(_0xbf8b2c,null));}; \ No newline at end of file +var _0x16f0=['rows','catch','show','params','rawAttributes','fields','options','create','update','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','error','stack','name','send','index','ZohoField','type','key','model','map','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x16f0,0xa3));var _0x016f=function(_0x3d85be,_0x382b11){_0x3d85be=_0x3d85be-0x0;var _0x3fa27c=_0x16f0[_0x3d85be];return _0x3fa27c;};'use strict';var emlformat=require(_0x016f('0x0'));var rimraf=require(_0x016f('0x1'));var zipdir=require(_0x016f('0x2'));var jsonpatch=require(_0x016f('0x3'));var rp=require(_0x016f('0x4'));var moment=require(_0x016f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x016f('0x6'));var sox=require(_0x016f('0x7'));var csv=require(_0x016f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x016f('0x9'));var _=require(_0x016f('0xa'));var squel=require(_0x016f('0xb'));var crypto=require(_0x016f('0xc'));var jsforce=require(_0x016f('0xd'));var deskjs=require(_0x016f('0xe'));var toCsv=require(_0x016f('0x8'));var querystring=require(_0x016f('0xf'));var Papa=require(_0x016f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x016f('0x11'));var as=require(_0x016f('0x12'));var hardwareService=require(_0x016f('0x13'));var logger=require(_0x016f('0x14'))(_0x016f('0x15'));var utils=require(_0x016f('0x16'));var config=require(_0x016f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x016f('0x18'))['db'];function respondWithStatusCode(_0x1833cd,_0xe11ac1){_0xe11ac1=_0xe11ac1||0xcc;return function(_0x5ca254){if(_0x5ca254){return _0x1833cd[_0x016f('0x19')](_0xe11ac1);}return _0x1833cd[_0x016f('0x1a')](_0xe11ac1)[_0x016f('0x1b')]();};}function respondWithResult(_0x42eb54,_0x5ae182){_0x5ae182=_0x5ae182||0xc8;return function(_0x3e08fe){if(_0x3e08fe){return _0x42eb54[_0x016f('0x1a')](_0x5ae182)[_0x016f('0x1c')](_0x3e08fe);}};}function respondWithFilteredResult(_0x153ec2,_0x1ff9eb){return function(_0x5a668d){if(_0x5a668d){var _0x1656b9=typeof _0x1ff9eb[_0x016f('0x1d')]===_0x016f('0x1e')&&typeof _0x1ff9eb[_0x016f('0x1f')]===_0x016f('0x1e');var _0x42ef2b=_0x5a668d[_0x016f('0x20')];var _0x4de5f9=_0x1656b9?0x0:_0x1ff9eb[_0x016f('0x1d')];var _0x16497f=_0x1656b9?_0x5a668d['count']:_0x1ff9eb[_0x016f('0x1d')]+_0x1ff9eb[_0x016f('0x1f')];var _0x84d4f1;if(_0x16497f>=_0x42ef2b){_0x16497f=_0x42ef2b;_0x84d4f1=0xc8;}else{_0x84d4f1=0xce;}_0x153ec2[_0x016f('0x1a')](_0x84d4f1);return _0x153ec2['set'](_0x016f('0x21'),_0x4de5f9+'-'+_0x16497f+'/'+_0x42ef2b)[_0x016f('0x1c')](_0x5a668d);}return null;};}function patchUpdates(_0x2b4707){return function(_0x391ce7){try{jsonpatch[_0x016f('0x22')](_0x391ce7,_0x2b4707,!![]);}catch(_0x113c31){return BPromise['reject'](_0x113c31);}return _0x391ce7[_0x016f('0x23')]();};}function saveUpdates(_0x4196b7,_0x42f5b4){return function(_0x1352dd){if(_0x1352dd){return _0x1352dd['update'](_0x4196b7)[_0x016f('0x24')](function(_0x14b69c){return _0x14b69c;});}return null;};}function removeEntity(_0x4da27b,_0x1ec2a6){return function(_0x167a09){if(_0x167a09){return _0x167a09[_0x016f('0x25')]()[_0x016f('0x24')](function(){_0x4da27b['status'](0xcc)[_0x016f('0x1b')]();});}};}function handleEntityNotFound(_0xf0636,_0x534aa3){return function(_0x19aff2){if(!_0x19aff2){_0xf0636[_0x016f('0x19')](0x194);}return _0x19aff2;};}function handleError(_0x368c62,_0x2b654f){_0x2b654f=_0x2b654f||0x1f4;return function(_0x33a53a){logger[_0x016f('0x26')](_0x33a53a[_0x016f('0x27')]);if(_0x33a53a[_0x016f('0x28')]){delete _0x33a53a[_0x016f('0x28')];}_0x368c62[_0x016f('0x1a')](_0x2b654f)[_0x016f('0x29')](_0x33a53a);};}exports[_0x016f('0x2a')]=function(_0x407125,_0x23109c){var _0x454c85={},_0x24434d={},_0x2f04fd={'count':0x0,'rows':[]};var _0x44f2c3=_['map'](db[_0x016f('0x2b')]['rawAttributes'],function(_0x363dac){return{'name':_0x363dac['fieldName'],'type':_0x363dac[_0x016f('0x2c')][_0x016f('0x2d')]};});_0x24434d[_0x016f('0x2e')]=_[_0x016f('0x2f')](_0x44f2c3,_0x016f('0x28'));_0x24434d[_0x016f('0x30')]=_[_0x016f('0x31')](_0x407125[_0x016f('0x30')]);_0x24434d[_0x016f('0x32')]=_[_0x016f('0x33')](_0x24434d[_0x016f('0x2e')],_0x24434d[_0x016f('0x30')]);_0x454c85['attributes']=_['intersection'](_0x24434d[_0x016f('0x2e')],qs['fields'](_0x407125[_0x016f('0x30')]['fields']));_0x454c85[_0x016f('0x34')]=_0x454c85[_0x016f('0x34')][_0x016f('0x35')]?_0x454c85[_0x016f('0x34')]:_0x24434d[_0x016f('0x2e')];if(!_0x407125[_0x016f('0x30')]['hasOwnProperty'](_0x016f('0x36'))){_0x454c85[_0x016f('0x1f')]=qs[_0x016f('0x1f')](_0x407125[_0x016f('0x30')][_0x016f('0x1f')]);_0x454c85[_0x016f('0x1d')]=qs[_0x016f('0x1d')](_0x407125[_0x016f('0x30')][_0x016f('0x1d')]);}_0x454c85[_0x016f('0x37')]=qs['sort'](_0x407125[_0x016f('0x30')][_0x016f('0x38')]);_0x454c85[_0x016f('0x39')]=qs[_0x016f('0x32')](_[_0x016f('0x3a')](_0x407125['query'],_0x24434d[_0x016f('0x32')]),_0x44f2c3);if(_0x407125[_0x016f('0x30')][_0x016f('0x3b')]){_0x454c85[_0x016f('0x39')]=_[_0x016f('0x3c')](_0x454c85[_0x016f('0x39')],{'$or':_[_0x016f('0x2f')](_0x44f2c3,function(_0x2701ab){if(_0x2701ab[_0x016f('0x2c')]!==_0x016f('0x3d')){var _0x2833e0={};_0x2833e0[_0x2701ab[_0x016f('0x28')]]={'$like':'%'+_0x407125[_0x016f('0x30')][_0x016f('0x3b')]+'%'};return _0x2833e0;}})});}_0x454c85=_['merge']({},_0x454c85,_0x407125['options']);var _0x31b42c={'where':_0x454c85[_0x016f('0x39')]};return db[_0x016f('0x2b')]['count'](_0x31b42c)['then'](function(_0x4bd180){_0x2f04fd[_0x016f('0x20')]=_0x4bd180;if(_0x407125[_0x016f('0x30')][_0x016f('0x3e')]){_0x454c85[_0x016f('0x3f')]=[{'all':!![]}];}return db[_0x016f('0x2b')][_0x016f('0x40')](_0x454c85);})[_0x016f('0x24')](function(_0x41ce27){_0x2f04fd[_0x016f('0x41')]=_0x41ce27;return _0x2f04fd;})[_0x016f('0x24')](respondWithFilteredResult(_0x23109c,_0x454c85))[_0x016f('0x42')](handleError(_0x23109c,null));};exports[_0x016f('0x43')]=function(_0x128fe1,_0x246e00){var _0x5eec75={'raw':!![],'where':{'id':_0x128fe1[_0x016f('0x44')]['id']}},_0x180a48={};_0x180a48['model']=_[_0x016f('0x31')](db[_0x016f('0x2b')][_0x016f('0x45')]);_0x180a48[_0x016f('0x30')]=_['keys'](_0x128fe1['query']);_0x180a48[_0x016f('0x32')]=_['intersection'](_0x180a48[_0x016f('0x2e')],_0x180a48[_0x016f('0x30')]);_0x5eec75['attributes']=_['intersection'](_0x180a48[_0x016f('0x2e')],qs[_0x016f('0x46')](_0x128fe1[_0x016f('0x30')]['fields']));_0x5eec75[_0x016f('0x34')]=_0x5eec75[_0x016f('0x34')][_0x016f('0x35')]?_0x5eec75[_0x016f('0x34')]:_0x180a48[_0x016f('0x2e')];if(_0x128fe1[_0x016f('0x30')][_0x016f('0x3e')]){_0x5eec75[_0x016f('0x3f')]=[{'all':!![]}];}_0x5eec75=_[_0x016f('0x3c')]({},_0x5eec75,_0x128fe1[_0x016f('0x47')]);return db[_0x016f('0x2b')]['find'](_0x5eec75)[_0x016f('0x24')](handleEntityNotFound(_0x246e00,null))['then'](respondWithResult(_0x246e00,null))[_0x016f('0x42')](handleError(_0x246e00,null));};exports[_0x016f('0x48')]=function(_0x4f6f73,_0x33fac3){return db['ZohoField']['create'](_0x4f6f73['body'],{})[_0x016f('0x24')](respondWithResult(_0x33fac3,0xc9))[_0x016f('0x42')](handleError(_0x33fac3,null));};exports[_0x016f('0x49')]=function(_0x41b785,_0x71b31b){if(_0x41b785[_0x016f('0x4a')]['id']){delete _0x41b785[_0x016f('0x4a')]['id'];}return db['ZohoField'][_0x016f('0x4b')]({'where':{'id':_0x41b785[_0x016f('0x44')]['id']}})[_0x016f('0x24')](handleEntityNotFound(_0x71b31b,null))['then'](saveUpdates(_0x41b785[_0x016f('0x4a')],null))['then'](respondWithResult(_0x71b31b,null))[_0x016f('0x42')](handleError(_0x71b31b,null));};exports['destroy']=function(_0x2c99df,_0x40e636){return db[_0x016f('0x2b')]['find']({'where':{'id':_0x2c99df[_0x016f('0x44')]['id']}})[_0x016f('0x24')](handleEntityNotFound(_0x40e636,null))[_0x016f('0x24')](removeEntity(_0x40e636,null))['catch'](handleError(_0x40e636,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 8e23985..fc8b84e 100644 --- a/server/api/intZohoField/intZohoField.model.js +++ b/server/api/intZohoField/intZohoField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1893=['rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3fd275,_0xf0cd7){var _0xe4f14f=function(_0x23971d){while(--_0x23971d){_0x3fd275['push'](_0x3fd275['shift']());}};_0xe4f14f(++_0xf0cd7);}(_0x1893,0xa2));var _0x3189=function(_0x29f574,_0x4e27dd){_0x29f574=_0x29f574-0x0;var _0xbc2316=_0x1893[_0x29f574];return _0xbc2316;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3189('0x0'))(_0x3189('0x1'));var moment=require(_0x3189('0x2'));var BPromise=require(_0x3189('0x3'));var rp=require(_0x3189('0x4'));var fs=require('fs');var path=require(_0x3189('0x5'));var rimraf=require(_0x3189('0x6'));var config=require('../../config/environment');var attributes=require(_0x3189('0x7'));module[_0x3189('0x8')]=function(_0x2333e6,_0x4080a9){return _0x2333e6[_0x3189('0x9')](_0x3189('0xa'),attributes,{'tableName':_0x3189('0xb'),'paranoid':![],'indexes':[{'name':_0x3189('0xc'),'fields':['idField',_0x3189('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7278=['idField','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index'];(function(_0xb1ef46,_0x110cae){var _0x4d949a=function(_0x503ac6){while(--_0x503ac6){_0xb1ef46['push'](_0xb1ef46['shift']());}};_0x4d949a(++_0x110cae);}(_0x7278,0x161));var _0x8727=function(_0x3f56a8,_0x561e11){_0x3f56a8=_0x3f56a8-0x0;var _0x5671ac=_0x7278[_0x3f56a8];return _0x5671ac;};'use strict';var _=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var logger=require(_0x8727('0x2'))(_0x8727('0x3'));var moment=require(_0x8727('0x4'));var BPromise=require('bluebird');var rp=require(_0x8727('0x5'));var fs=require('fs');var path=require(_0x8727('0x6'));var rimraf=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var attributes=require(_0x8727('0x9'));module[_0x8727('0xa')]=function(_0x180b71,_0x5549d5){return _0x180b71[_0x8727('0xb')](_0x8727('0xc'),attributes,{'tableName':_0x8727('0xd'),'paranoid':![],'indexes':[{'name':_0x8727('0xe'),'fields':[_0x8727('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 818d303..3b3291a 100644 --- a/server/api/intZohoField/intZohoField.rpc.js +++ b/server/api/intZohoField/intZohoField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x275f=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x2636c2,_0x52be92){var _0x3ebab7=function(_0xa85b5c){while(--_0xa85b5c){_0x2636c2['push'](_0x2636c2['shift']());}};_0x3ebab7(++_0x52be92);}(_0x275f,0x1ce));var _0xf275=function(_0x4a7843,_0x24f6d1){_0x4a7843=_0x4a7843-0x0;var _0x2c57fe=_0x275f[_0x4a7843];return _0x2c57fe;};'use strict';var _=require(_0xf275('0x0'));var util=require('util');var moment=require(_0xf275('0x1'));var BPromise=require(_0xf275('0x2'));var rs=require(_0xf275('0x3'));var fs=require('fs');var Redis=require(_0xf275('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf275('0x5'));var logger=require(_0xf275('0x6'))(_0xf275('0x7'));var config=require(_0xf275('0x8'));var jayson=require(_0xf275('0x9'));var client=jayson[_0xf275('0xa')][_0xf275('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d563e,_0x19cf36,_0x152aba){return new BPromise(function(_0x138e00,_0x4badc6){return client[_0xf275('0xc')](_0x3d563e,_0x152aba)[_0xf275('0xd')](function(_0x3d63b3){logger[_0xf275('0xe')](_0xf275('0xf'),_0x19cf36,_0xf275('0x10'));logger['debug'](_0xf275('0x11'),_0x19cf36,_0xf275('0x10'),JSON['stringify'](_0x3d63b3));if(_0x3d63b3[_0xf275('0x12')]){if(_0x3d63b3[_0xf275('0x12')][_0xf275('0x13')]===0x1f4){logger[_0xf275('0x12')](_0xf275('0xf'),_0x19cf36,_0x3d63b3[_0xf275('0x12')][_0xf275('0x14')]);return _0x4badc6(_0x3d63b3['error'][_0xf275('0x14')]);}logger[_0xf275('0x12')](_0xf275('0xf'),_0x19cf36,_0x3d63b3['error'][_0xf275('0x14')]);return _0x138e00(_0x3d63b3[_0xf275('0x12')][_0xf275('0x14')]);}else{logger['info'](_0xf275('0xf'),_0x19cf36,_0xf275('0x10'));_0x138e00(_0x3d63b3['result']['message']);}})[_0xf275('0x15')](function(_0x13c3b9){logger['error'](_0xf275('0xf'),_0x19cf36,_0x13c3b9);_0x4badc6(_0x13c3b9);});});} \ No newline at end of file +var _0xd991=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x53b243,_0x5d0b8c){var _0x4e2b9d=function(_0x1ad0b1){while(--_0x1ad0b1){_0x53b243['push'](_0x53b243['shift']());}};_0x4e2b9d(++_0x5d0b8c);}(_0xd991,0x188));var _0x1d99=function(_0x38cb4e,_0x1e562c){_0x38cb4e=_0x38cb4e-0x0;var _0x33e0aa=_0xd991[_0x38cb4e];return _0x33e0aa;};'use strict';var _=require(_0x1d99('0x0'));var util=require(_0x1d99('0x1'));var moment=require(_0x1d99('0x2'));var BPromise=require(_0x1d99('0x3'));var rs=require(_0x1d99('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d99('0x5'))['db'];var utils=require(_0x1d99('0x6'));var logger=require(_0x1d99('0x7'))(_0x1d99('0x8'));var config=require(_0x1d99('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1d99('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31a1c9,_0x548dfb,_0x3493b5){return new BPromise(function(_0x262903,_0x55339e){return client['request'](_0x31a1c9,_0x3493b5)[_0x1d99('0xb')](function(_0x394fa2){logger[_0x1d99('0xc')](_0x1d99('0xd'),_0x548dfb,'request\x20sent');logger[_0x1d99('0xe')](_0x1d99('0xf'),_0x548dfb,_0x1d99('0x10'),JSON['stringify'](_0x394fa2));if(_0x394fa2['error']){if(_0x394fa2[_0x1d99('0x11')][_0x1d99('0x12')]===0x1f4){logger['error'](_0x1d99('0xd'),_0x548dfb,_0x394fa2[_0x1d99('0x11')][_0x1d99('0x13')]);return _0x55339e(_0x394fa2[_0x1d99('0x11')][_0x1d99('0x13')]);}logger[_0x1d99('0x11')](_0x1d99('0xd'),_0x548dfb,_0x394fa2[_0x1d99('0x11')][_0x1d99('0x13')]);return _0x262903(_0x394fa2[_0x1d99('0x11')][_0x1d99('0x13')]);}else{logger[_0x1d99('0xc')](_0x1d99('0xd'),_0x548dfb,_0x1d99('0x10'));_0x262903(_0x394fa2[_0x1d99('0x14')][_0x1d99('0x13')]);}})[_0x1d99('0x15')](function(_0x2b6973){logger['error'](_0x1d99('0xd'),_0x548dfb,_0x2b6973);_0x55339e(_0x2b6973);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 88f3646..094b47a 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x598902,_0x51f745){var _0x4fe82c=function(_0x5deab3){while(--_0x5deab3){_0x598902['push'](_0x598902['shift']());}};_0x4fe82c(++_0x51f745);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x22c684,_0x753309){_0x22c684=_0x22c684-0x0;var _0x39fcbb=_0xcb91[_0x22c684];return _0x39fcbb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x24691d,_0x43ad03){var _0x4dfd02=function(_0x3d1d3a){while(--_0x3d1d3a){_0x24691d['push'](_0x24691d['shift']());}};_0x4dfd02(++_0x43ad03);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 2186f08..9dcb560 100644 --- a/server/api/integration/integration.attributes.js +++ b/server/api/integration/integration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb296=['state','sequelize','exports','unique_name_and_version','STRING','app.js'];(function(_0x546eb1,_0x700cb6){var _0x36054c=function(_0x47b035){while(--_0x47b035){_0x546eb1['push'](_0x546eb1['shift']());}};_0x36054c(++_0x700cb6);}(_0xb296,0xeb));var _0x6b29=function(_0xc2506e,_0x5c87bc){_0xc2506e=_0xc2506e-0x0;var _0x2fe43a=_0xb296[_0xc2506e];return _0x2fe43a;};'use strict';var Sequelize=require(_0x6b29('0x0'));module[_0x6b29('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6b29('0x2')},'version':{'type':Sequelize[_0x6b29('0x3')],'allowNull':![],'unique':_0x6b29('0x2')},'main':{'type':Sequelize[_0x6b29('0x3')],'defaultValue':_0x6b29('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6b29('0x3')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x6b29('0x3')]},'logo':{'type':Sequelize[_0x6b29('0x3')]},'state':{'type':Sequelize[_0x6b29('0x3')],'unique':_0x6b29('0x5')},'description':{'type':Sequelize[_0x6b29('0x3')]},'title':{'type':Sequelize[_0x6b29('0x3')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x6b29('0x3')],'defaultValue':'#'}}; \ No newline at end of file +var _0x5eb1=['STRING','unique_name_and_version','INTEGER','state','exports'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0x5eb1,0x7c));var _0x15eb=function(_0x59e862,_0x477bf2){_0x59e862=_0x59e862-0x0;var _0x1a25ee=_0x5eb1[_0x59e862];return _0x1a25ee;};'use strict';var Sequelize=require('sequelize');module[_0x15eb('0x0')]={'name':{'type':Sequelize[_0x15eb('0x1')],'allowNull':![],'unique':_0x15eb('0x2')},'version':{'type':Sequelize[_0x15eb('0x1')],'allowNull':![],'unique':_0x15eb('0x2')},'main':{'type':Sequelize[_0x15eb('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x15eb('0x1')]},'path':{'type':Sequelize[_0x15eb('0x1')]},'type':{'type':Sequelize[_0x15eb('0x1')]},'size':{'type':Sequelize[_0x15eb('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x15eb('0x1')]},'logo':{'type':Sequelize[_0x15eb('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0x15eb('0x4')},'description':{'type':Sequelize[_0x15eb('0x1')]},'title':{'type':Sequelize[_0x15eb('0x1')]},'remoteUri':{'type':Sequelize[_0x15eb('0x1')]},'link':{'type':Sequelize[_0x15eb('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 6250480..bceafde 100644 --- a/server/api/integration/integration.controller.js +++ b/server/api/integration/integration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba34=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','Integration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x148652,_0x5f3c92){var _0x422ca2=function(_0xbb8167){while(--_0xbb8167){_0x148652['push'](_0x148652['shift']());}};_0x422ca2(++_0x5f3c92);}(_0xba34,0x119));var _0x4ba3=function(_0x1a2aab,_0x107f5){_0x1a2aab=_0x1a2aab-0x0;var _0x46e436=_0xba34[_0x1a2aab];return _0x46e436;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['Integration']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['create']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['create'](_0xa4bbb2[_0x4ba3('0x49')],{})[_0x4ba3('0x26')](respondWithResult(_0x1fe115,0xc9))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports['update']=function(_0x47f588,_0x34dc04){if(_0x47f588['body']['id']){delete _0x47f588[_0x4ba3('0x49')]['id'];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x47f588[_0x4ba3('0x4a')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x34dc04,null))[_0x4ba3('0x26')](saveUpdates(_0x47f588['body'],null))[_0x4ba3('0x26')](respondWithResult(_0x34dc04,null))[_0x4ba3('0x46')](handleError(_0x34dc04,null));};exports['destroy']=function(_0x325475,_0x12ae6f){return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x325475[_0x4ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12ae6f,null))[_0x4ba3('0x26')](removeEntity(_0x12ae6f,null))[_0x4ba3('0x46')](handleError(_0x12ae6f,null));}; \ No newline at end of file +var _0xc6ac=['type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','Integration','rawAttributes','fieldName'];(function(_0x1120c7,_0x18f931){var _0x436f8a=function(_0x19f1dd){while(--_0x19f1dd){_0x1120c7['push'](_0x1120c7['shift']());}};_0x436f8a(++_0x18f931);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x44c090,_0x3a2722){_0x44c090=_0x44c090-0x0;var _0x34e8d1=_0xc6ac[_0x44c090];return _0x34e8d1;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['Integration'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['create']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')](_0x4e1a0b[_0xcc6a('0x4d')],{})[_0xcc6a('0x27')](respondWithResult(_0x47c999,0xc9))['catch'](handleError(_0x47c999,null));};exports[_0xcc6a('0x4e')]=function(_0x5e7bab,_0x3aa7dd){if(_0x5e7bab[_0xcc6a('0x4d')]['id']){delete _0x5e7bab[_0xcc6a('0x4d')]['id'];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x5e7bab[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3aa7dd,null))[_0xcc6a('0x27')](saveUpdates(_0x5e7bab[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x3aa7dd,null))[_0xcc6a('0x4b')](handleError(_0x3aa7dd,null));};exports[_0xcc6a('0x28')]=function(_0x362bf6,_0x431684){return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x362bf6[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x431684,null))[_0xcc6a('0x27')](removeEntity(_0x431684,null))[_0xcc6a('0x4b')](handleError(_0x431684,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 97e45db..ed08962 100644 --- a/server/api/integration/integration.model.js +++ b/server/api/integration/integration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae7a=['path','rimraf','./integration.attributes','exports','define','integrations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x21cb7f,_0x48cd16){var _0x5a079a=function(_0x569a4f){while(--_0x569a4f){_0x21cb7f['push'](_0x21cb7f['shift']());}};_0x5a079a(++_0x48cd16);}(_0xae7a,0x7e));var _0xaae7=function(_0xc0da83,_0x593052){_0xc0da83=_0xc0da83-0x0;var _0x3e2841=_0xae7a[_0xc0da83];return _0x3e2841;};'use strict';var _=require(_0xaae7('0x0'));var util=require(_0xaae7('0x1'));var logger=require(_0xaae7('0x2'))(_0xaae7('0x3'));var moment=require(_0xaae7('0x4'));var BPromise=require(_0xaae7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaae7('0x6'));var rimraf=require(_0xaae7('0x7'));var config=require('../../config/environment');var attributes=require(_0xaae7('0x8'));module[_0xaae7('0x9')]=function(_0x24bb0c,_0x2497db){return _0x24bb0c[_0xaae7('0xa')]('Integration',attributes,{'tableName':_0xaae7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1615=['integrations','lodash','util','../../config/logger','api','path','rimraf','define'];(function(_0x20d54d,_0x1adc8e){var _0x516e8b=function(_0x2754e1){while(--_0x2754e1){_0x20d54d['push'](_0x20d54d['shift']());}};_0x516e8b(++_0x1adc8e);}(_0x1615,0x79));var _0x5161=function(_0x2c4aa6,_0xecc5c9){_0x2c4aa6=_0x2c4aa6-0x0;var _0x16dc4f=_0x1615[_0x2c4aa6];return _0x16dc4f;};'use strict';var _=require(_0x5161('0x0'));var util=require(_0x5161('0x1'));var logger=require(_0x5161('0x2'))(_0x5161('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5161('0x4'));var rimraf=require(_0x5161('0x5'));var config=require('../../config/environment');var attributes=require('./integration.attributes');module['exports']=function(_0x8f8af2,_0xfa264){return _0x8f8af2[_0x5161('0x6')]('Integration',attributes,{'tableName':_0x5161('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index e063ce2..f390baf 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x896e=['Integration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x47dcf6,_0x2bd422){var _0x2dfdc5=function(_0x5d0eb8){while(--_0x5d0eb8){_0x47dcf6['push'](_0x47dcf6['shift']());}};_0x2dfdc5(++_0x2bd422);}(_0x896e,0x1e9));var _0xe896=function(_0x4da4b6,_0x300a15){_0x4da4b6=_0x4da4b6-0x0;var _0xac3f=_0x896e[_0x4da4b6];return _0xac3f;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('Integration,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('Integration,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});} \ No newline at end of file +var _0xd7d1=['info','Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x523597,_0x234653){var _0x1d190c=function(_0x23dfe7){while(--_0x23dfe7){_0x523597['push'](_0x523597['shift']());}};_0x1d190c(++_0x234653);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x36ceef,_0x3cdd9b){_0x36ceef=_0x36ceef-0x0;var _0x48efc5=_0xd7d1[_0x36ceef];return _0x48efc5;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('Integration,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('Integration,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 50e17b7..db6357b 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a85=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x5c1eaf,_0x2d7243){var _0x5d1455=function(_0x4b9ad2){while(--_0x4b9ad2){_0x5c1eaf['push'](_0x5c1eaf['shift']());}};_0x5d1455(++_0x2d7243);}(_0x1a85,0x178));var _0x51a8=function(_0x5e761b,_0x355e38){_0x5e761b=_0x5e761b-0x0;var _0x98502c=_0x1a85[_0x5e761b];return _0x98502c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./integrationReport.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')]('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0xd')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xf')]);router[_0x51a8('0x10')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x11')]);module[_0x51a8('0x12')]=router; \ No newline at end of file +var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4cfd27,_0x34f362){_0x4cfd27=_0x4cfd27-0x0;var _0x7efd47=_0x5f2f[_0x4cfd27];return _0x7efd47;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')]('/',auth[_0xf5f2('0xa')](),controller['create']);router[_0xf5f2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 0852a0e..4f52bc1 100644 --- a/server/api/integrationReport/integrationReport.attributes.js +++ b/server/api/integrationReport/integrationReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ded=['SENT','SENDING','RECEIVED','FAILED','sequelize','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM'];(function(_0x53c16c,_0x555890){var _0x12abfb=function(_0x151602){while(--_0x151602){_0x53c16c['push'](_0x53c16c['shift']());}};_0x12abfb(++_0x555890);}(_0x3ded,0x72));var _0xd3de=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x3ded[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require(_0xd3de('0x0'));module['exports']={'integration':{'type':Sequelize[_0xd3de('0x1')]},'eventChannel':{'type':Sequelize[_0xd3de('0x1')]},'exitStatus':{'type':Sequelize[_0xd3de('0x1')]},'ticketId':{'type':Sequelize[_0xd3de('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xd3de('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd3de('0x1')]},'calleridname':{'type':Sequelize[_0xd3de('0x1')]},'queue':{'type':Sequelize[_0xd3de('0x1')]},'interface':{'type':Sequelize[_0xd3de('0x1')]},'membername':{'type':Sequelize[_0xd3de('0x1')]},'agentcalledAt':{'type':Sequelize[_0xd3de('0x2')]},'agentconnectAt':{'type':Sequelize[_0xd3de('0x2')]},'holdtime':{'type':Sequelize[_0xd3de('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xd3de('0x2')]},'talktime':{'type':Sequelize[_0xd3de('0x3')]},'agentacw':{'type':Sequelize[_0xd3de('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd3de('0x3')]},'reason':{'type':Sequelize[_0xd3de('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xd3de('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xd3de('0x2')]},'agentdump':{'type':Sequelize[_0xd3de('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xd3de('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd3de('0x1')]},'channelstate':{'type':Sequelize[_0xd3de('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd3de('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd3de('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd3de('0x1')]},'accountcode':{'type':Sequelize[_0xd3de('0x1')]},'context':{'type':Sequelize[_0xd3de('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd3de('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xd3de('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xd3de('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd3de('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd3de('0x1')]},'destlanguage':{'type':Sequelize[_0xd3de('0x1')]},'destaccountcode':{'type':Sequelize[_0xd3de('0x1')]},'destcontext':{'type':Sequelize[_0xd3de('0x1')]},'destexten':{'type':Sequelize[_0xd3de('0x1')]},'destpriority':{'type':Sequelize[_0xd3de('0x1')]},'destuniqueid':{'type':Sequelize[_0xd3de('0x1')]},'messageId':{'type':Sequelize[_0xd3de('0x1')]},'inReplyTo':{'type':Sequelize[_0xd3de('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xd3de('0x1')]},'to':{'type':Sequelize[_0xd3de('0x1')]},'cc':{'type':Sequelize[_0xd3de('0x1')]},'attachment':{'type':Sequelize[_0xd3de('0x5')]},'html':{'type':Sequelize[_0xd3de('0x5')]},'text':{'type':Sequelize[_0xd3de('0x5')]},'status':{'type':Sequelize[_0xd3de('0x6')](_0xd3de('0x7'),_0xd3de('0x8'),_0xd3de('0x9'),_0xd3de('0xa'))},'url':{'type':Sequelize[_0xd3de('0x1')]},'app':{'type':Sequelize[_0xd3de('0x1')]},'appdata':{'type':Sequelize[_0xd3de('0x1')]},'projectId':{'type':Sequelize[_0xd3de('0x3')]}}; \ No newline at end of file +var _0x437a=['TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x21b14d,_0x2ae621){var _0x25a7fb=function(_0x44278c){while(--_0x44278c){_0x21b14d['push'](_0x21b14d['shift']());}};_0x25a7fb(++_0x2ae621);}(_0x437a,0xba));var _0xa437=function(_0x5e9876,_0x16052d){_0x5e9876=_0x5e9876-0x0;var _0x576c48=_0x437a[_0x5e9876];return _0x576c48;};'use strict';var Sequelize=require(_0xa437('0x0'));module[_0xa437('0x1')]={'integration':{'type':Sequelize[_0xa437('0x2')]},'eventChannel':{'type':Sequelize[_0xa437('0x2')]},'exitStatus':{'type':Sequelize[_0xa437('0x2')]},'ticketId':{'type':Sequelize[_0xa437('0x2')]},'integrationId':{'type':Sequelize[_0xa437('0x3')]},'contacts':{'type':Sequelize[_0xa437('0x2')]},'uniqueid':{'type':Sequelize[_0xa437('0x2')]},'calleridnum':{'type':Sequelize[_0xa437('0x2')]},'calleridname':{'type':Sequelize[_0xa437('0x2')]},'queue':{'type':Sequelize[_0xa437('0x2')]},'interface':{'type':Sequelize[_0xa437('0x2')]},'membername':{'type':Sequelize[_0xa437('0x2')]},'agentcalledAt':{'type':Sequelize[_0xa437('0x4')]},'agentconnectAt':{'type':Sequelize[_0xa437('0x4')]},'holdtime':{'type':Sequelize[_0xa437('0x3')]},'agentcomplete':{'type':Sequelize[_0xa437('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xa437('0x3')]},'agentacw':{'type':Sequelize[_0xa437('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa437('0x3')]},'reason':{'type':Sequelize[_0xa437('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xa437('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xa437('0x4')]},'agentdump':{'type':Sequelize[_0xa437('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xa437('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xa437('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa437('0x2')]},'connectedlinenum':{'type':Sequelize[_0xa437('0x2')]},'connectedlinename':{'type':Sequelize[_0xa437('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa437('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xa437('0x2')]},'priority':{'type':Sequelize[_0xa437('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa437('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xa437('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa437('0x2')]},'destcalleridname':{'type':Sequelize[_0xa437('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xa437('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xa437('0x2')]},'destlanguage':{'type':Sequelize[_0xa437('0x2')]},'destaccountcode':{'type':Sequelize[_0xa437('0x2')]},'destcontext':{'type':Sequelize[_0xa437('0x2')]},'destexten':{'type':Sequelize[_0xa437('0x2')]},'destpriority':{'type':Sequelize[_0xa437('0x2')]},'destuniqueid':{'type':Sequelize[_0xa437('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xa437('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xa437('0x2')]},'to':{'type':Sequelize[_0xa437('0x2')]},'cc':{'type':Sequelize[_0xa437('0x2')]},'attachment':{'type':Sequelize[_0xa437('0x6')]},'html':{'type':Sequelize[_0xa437('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xa437('0x7')](_0xa437('0x8'),_0xa437('0x9'),_0xa437('0xa'),_0xa437('0xb'))},'url':{'type':Sequelize[_0xa437('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xa437('0x2')]},'projectId':{'type':Sequelize[_0xa437('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 27d47e7..bafaa76 100644 --- a/server/api/integrationReport/integrationReport.controller.js +++ b/server/api/integrationReport/integrationReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb405=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','destroy','then','sendStatus','name','index','IntegrationReport','rawAttributes','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','rows','params','intersection','options','find','catch','create','body','rimraf','zip-dir'];(function(_0x48a22d,_0x1eb0bd){var _0x28deb3=function(_0x597022){while(--_0x597022){_0x48a22d['push'](_0x48a22d['shift']());}};_0x28deb3(++_0x1eb0bd);}(_0xb405,0x12a));var _0x5b40=function(_0x33c587,_0x5b0278){_0x33c587=_0x33c587-0x0;var _0x518c09=_0xb405[_0x33c587];return _0x518c09;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b40('0x0'));var zipdir=require(_0x5b40('0x1'));var jsonpatch=require(_0x5b40('0x2'));var rp=require(_0x5b40('0x3'));var moment=require(_0x5b40('0x4'));var BPromise=require(_0x5b40('0x5'));var Mustache=require(_0x5b40('0x6'));var util=require(_0x5b40('0x7'));var path=require(_0x5b40('0x8'));var sox=require(_0x5b40('0x9'));var csv=require(_0x5b40('0xa'));var ejs=require(_0x5b40('0xb'));var fs=require('fs');var fs_extra=require(_0x5b40('0xc'));var _=require(_0x5b40('0xd'));var squel=require(_0x5b40('0xe'));var crypto=require(_0x5b40('0xf'));var jsforce=require(_0x5b40('0x10'));var deskjs=require(_0x5b40('0x11'));var toCsv=require(_0x5b40('0xa'));var querystring=require(_0x5b40('0x12'));var Papa=require(_0x5b40('0x13'));var Redis=require('ioredis');var authService=require(_0x5b40('0x14'));var qs=require(_0x5b40('0x15'));var as=require(_0x5b40('0x16'));var hardwareService=require(_0x5b40('0x17'));var logger=require('../../config/logger')(_0x5b40('0x18'));var utils=require(_0x5b40('0x19'));var config=require(_0x5b40('0x1a'));var licenseUtil=require(_0x5b40('0x1b'));var db=require(_0x5b40('0x1c'))['db'];function respondWithStatusCode(_0x465875,_0xdc4d20){_0xdc4d20=_0xdc4d20||0xcc;return function(_0x62172a){if(_0x62172a){return _0x465875['sendStatus'](_0xdc4d20);}return _0x465875['status'](_0xdc4d20)[_0x5b40('0x1d')]();};}function respondWithResult(_0x375592,_0x370bb0){_0x370bb0=_0x370bb0||0xc8;return function(_0x1b32ef){if(_0x1b32ef){return _0x375592['status'](_0x370bb0)[_0x5b40('0x1e')](_0x1b32ef);}};}function respondWithFilteredResult(_0x237d78,_0x24680d){return function(_0x5fd955){if(_0x5fd955){var _0x2f5518=typeof _0x24680d[_0x5b40('0x1f')]===_0x5b40('0x20')&&typeof _0x24680d[_0x5b40('0x21')]===_0x5b40('0x20');var _0xce1106=_0x5fd955[_0x5b40('0x22')];var _0x54b75a=_0x2f5518?0x0:_0x24680d[_0x5b40('0x1f')];var _0x5c9ee5=_0x2f5518?_0x5fd955[_0x5b40('0x22')]:_0x24680d['offset']+_0x24680d[_0x5b40('0x21')];var _0x47d61e;if(_0x5c9ee5>=_0xce1106){_0x5c9ee5=_0xce1106;_0x47d61e=0xc8;}else{_0x47d61e=0xce;}_0x237d78[_0x5b40('0x23')](_0x47d61e);return _0x237d78[_0x5b40('0x24')]('Content-Range',_0x54b75a+'-'+_0x5c9ee5+'/'+_0xce1106)[_0x5b40('0x1e')](_0x5fd955);}return null;};}function patchUpdates(_0x33949f){return function(_0x38055c){try{jsonpatch[_0x5b40('0x25')](_0x38055c,_0x33949f,!![]);}catch(_0x2db78e){return BPromise[_0x5b40('0x26')](_0x2db78e);}return _0x38055c[_0x5b40('0x27')]();};}function saveUpdates(_0x3e9904,_0x31aaf5){return function(_0x14d622){if(_0x14d622){return _0x14d622[_0x5b40('0x28')](_0x3e9904)['then'](function(_0x9ffbae){return _0x9ffbae;});}return null;};}function removeEntity(_0x2359db,_0x2676ab){return function(_0x122c59){if(_0x122c59){return _0x122c59[_0x5b40('0x29')]()[_0x5b40('0x2a')](function(){_0x2359db[_0x5b40('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x508c87,_0xd5f086){return function(_0x1782c2){if(!_0x1782c2){_0x508c87[_0x5b40('0x2b')](0x194);}return _0x1782c2;};}function handleError(_0x3b3979,_0x218e02){_0x218e02=_0x218e02||0x1f4;return function(_0x5c2bde){logger['error'](_0x5c2bde['stack']);if(_0x5c2bde[_0x5b40('0x2c')]){delete _0x5c2bde[_0x5b40('0x2c')];}_0x3b3979['status'](_0x218e02)['send'](_0x5c2bde);};}exports[_0x5b40('0x2d')]=function(_0x1a0018,_0x599659){var _0x343909={},_0x20a0e5={},_0x5efd24={'count':0x0,'rows':[]};var _0x31444f=_['map'](db[_0x5b40('0x2e')][_0x5b40('0x2f')],function(_0x2a2dfa){return{'name':_0x2a2dfa['fieldName'],'type':_0x2a2dfa[_0x5b40('0x30')][_0x5b40('0x31')]};});_0x20a0e5['model']=_['map'](_0x31444f,'name');_0x20a0e5[_0x5b40('0x32')]=_[_0x5b40('0x33')](_0x1a0018[_0x5b40('0x32')]);_0x20a0e5[_0x5b40('0x34')]=_['intersection'](_0x20a0e5[_0x5b40('0x35')],_0x20a0e5['query']);_0x343909['attributes']=_['intersection'](_0x20a0e5['model'],qs[_0x5b40('0x36')](_0x1a0018[_0x5b40('0x32')][_0x5b40('0x36')]));_0x343909[_0x5b40('0x37')]=_0x343909[_0x5b40('0x37')][_0x5b40('0x38')]?_0x343909[_0x5b40('0x37')]:_0x20a0e5['model'];if(!_0x1a0018[_0x5b40('0x32')][_0x5b40('0x39')]('nolimit')){_0x343909['limit']=qs[_0x5b40('0x21')](_0x1a0018[_0x5b40('0x32')][_0x5b40('0x21')]);_0x343909[_0x5b40('0x1f')]=qs[_0x5b40('0x1f')](_0x1a0018[_0x5b40('0x32')][_0x5b40('0x1f')]);}_0x343909['order']=qs[_0x5b40('0x3a')](_0x1a0018['query'][_0x5b40('0x3a')]);_0x343909[_0x5b40('0x3b')]=qs[_0x5b40('0x34')](_[_0x5b40('0x3c')](_0x1a0018['query'],_0x20a0e5[_0x5b40('0x34')]),_0x31444f);if(_0x1a0018[_0x5b40('0x32')][_0x5b40('0x3d')]){_0x343909['where']=_[_0x5b40('0x3e')](_0x343909[_0x5b40('0x3b')],{'$or':_[_0x5b40('0x3f')](_0x31444f,function(_0xee6a2a){if(_0xee6a2a['type']!==_0x5b40('0x40')){var _0x5979cd={};_0x5979cd[_0xee6a2a[_0x5b40('0x2c')]]={'$like':'%'+_0x1a0018[_0x5b40('0x32')][_0x5b40('0x3d')]+'%'};return _0x5979cd;}})});}_0x343909=_[_0x5b40('0x3e')]({},_0x343909,_0x1a0018['options']);var _0x44f6df={'where':_0x343909[_0x5b40('0x3b')]};return db[_0x5b40('0x2e')][_0x5b40('0x22')](_0x44f6df)[_0x5b40('0x2a')](function(_0x17d059){_0x5efd24[_0x5b40('0x22')]=_0x17d059;if(_0x1a0018['query'][_0x5b40('0x41')]){_0x343909[_0x5b40('0x42')]=[{'all':!![]}];}return db[_0x5b40('0x2e')]['findAll'](_0x343909);})['then'](function(_0x50e03d){_0x5efd24[_0x5b40('0x43')]=_0x50e03d;return _0x5efd24;})['then'](respondWithFilteredResult(_0x599659,_0x343909))['catch'](handleError(_0x599659,null));};exports['show']=function(_0x310218,_0x1294f5){var _0x5a4274={'raw':![],'where':{'id':_0x310218[_0x5b40('0x44')]['id']}},_0x44573e={};_0x44573e[_0x5b40('0x35')]=_['keys'](db[_0x5b40('0x2e')]['rawAttributes']);_0x44573e[_0x5b40('0x32')]=_['keys'](_0x310218[_0x5b40('0x32')]);_0x44573e[_0x5b40('0x34')]=_['intersection'](_0x44573e['model'],_0x44573e['query']);_0x5a4274[_0x5b40('0x37')]=_[_0x5b40('0x45')](_0x44573e[_0x5b40('0x35')],qs[_0x5b40('0x36')](_0x310218['query']['fields']));_0x5a4274['attributes']=_0x5a4274[_0x5b40('0x37')]['length']?_0x5a4274[_0x5b40('0x37')]:_0x44573e[_0x5b40('0x35')];if(_0x310218[_0x5b40('0x32')]['includeAll']){_0x5a4274['include']=[{'all':!![]}];}_0x5a4274=_[_0x5b40('0x3e')]({},_0x5a4274,_0x310218[_0x5b40('0x46')]);return db[_0x5b40('0x2e')][_0x5b40('0x47')](_0x5a4274)[_0x5b40('0x2a')](handleEntityNotFound(_0x1294f5,null))[_0x5b40('0x2a')](respondWithResult(_0x1294f5,null))[_0x5b40('0x48')](handleError(_0x1294f5,null));};exports[_0x5b40('0x49')]=function(_0x4ed965,_0x5b58f3){return db[_0x5b40('0x2e')][_0x5b40('0x49')](_0x4ed965[_0x5b40('0x4a')],{})[_0x5b40('0x2a')](respondWithResult(_0x5b58f3,0xc9))[_0x5b40('0x48')](handleError(_0x5b58f3,null));};exports[_0x5b40('0x28')]=function(_0x36b360,_0x3acc15){if(_0x36b360[_0x5b40('0x4a')]['id']){delete _0x36b360[_0x5b40('0x4a')]['id'];}return db[_0x5b40('0x2e')][_0x5b40('0x47')]({'where':{'id':_0x36b360[_0x5b40('0x44')]['id']}})[_0x5b40('0x2a')](handleEntityNotFound(_0x3acc15,null))[_0x5b40('0x2a')](saveUpdates(_0x36b360[_0x5b40('0x4a')],null))[_0x5b40('0x2a')](respondWithResult(_0x3acc15,null))[_0x5b40('0x48')](handleError(_0x3acc15,null));};exports[_0x5b40('0x29')]=function(_0x2ac83e,_0x22b3d0){return db[_0x5b40('0x2e')][_0x5b40('0x47')]({'where':{'id':_0x2ac83e[_0x5b40('0x44')]['id']}})[_0x5b40('0x2a')](handleEntityNotFound(_0x22b3d0,null))[_0x5b40('0x2a')](removeEntity(_0x22b3d0,null))[_0x5b40('0x48')](handleError(_0x22b3d0,null));};exports['describe']=function(_0x4d094b,_0x57204c){return db['IntegrationReport']['describe']()[_0x5b40('0x2a')](respondWithResult(_0x57204c,null))[_0x5b40('0x48')](handleError(_0x57204c,null));}; \ No newline at end of file +var _0xf85c=['index','map','IntegrationReport','rawAttributes','fieldName','type','query','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','destroy','then','error','name'];(function(_0x39a3f4,_0x7f4ae8){var _0x4a894d=function(_0x190460){while(--_0x190460){_0x39a3f4['push'](_0x39a3f4['shift']());}};_0x4a894d(++_0x7f4ae8);}(_0xf85c,0x1f0));var _0xcf85=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xf85c[_0xd0b415];return _0x2bdf2c;};'use strict';var emlformat=require(_0xcf85('0x0'));var rimraf=require(_0xcf85('0x1'));var zipdir=require(_0xcf85('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf85('0x3'));var moment=require(_0xcf85('0x4'));var BPromise=require(_0xcf85('0x5'));var Mustache=require(_0xcf85('0x6'));var util=require(_0xcf85('0x7'));var path=require(_0xcf85('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf85('0x9'));var _=require(_0xcf85('0xa'));var squel=require(_0xcf85('0xb'));var crypto=require(_0xcf85('0xc'));var jsforce=require(_0xcf85('0xd'));var deskjs=require(_0xcf85('0xe'));var toCsv=require(_0xcf85('0xf'));var querystring=require('querystring');var Papa=require(_0xcf85('0x10'));var Redis=require(_0xcf85('0x11'));var authService=require(_0xcf85('0x12'));var qs=require(_0xcf85('0x13'));var as=require(_0xcf85('0x14'));var hardwareService=require(_0xcf85('0x15'));var logger=require(_0xcf85('0x16'))(_0xcf85('0x17'));var utils=require(_0xcf85('0x18'));var config=require(_0xcf85('0x19'));var licenseUtil=require(_0xcf85('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d57a7,_0x363283){_0x363283=_0x363283||0xcc;return function(_0x23f1e7){if(_0x23f1e7){return _0x2d57a7['sendStatus'](_0x363283);}return _0x2d57a7[_0xcf85('0x1b')](_0x363283)[_0xcf85('0x1c')]();};}function respondWithResult(_0x377399,_0x3f8b08){_0x3f8b08=_0x3f8b08||0xc8;return function(_0x562169){if(_0x562169){return _0x377399[_0xcf85('0x1b')](_0x3f8b08)['json'](_0x562169);}};}function respondWithFilteredResult(_0x5e801e,_0x32896c){return function(_0x3c9b8d){if(_0x3c9b8d){var _0x88b0d9=typeof _0x32896c['offset']===_0xcf85('0x1d')&&typeof _0x32896c[_0xcf85('0x1e')]===_0xcf85('0x1d');var _0x51739c=_0x3c9b8d[_0xcf85('0x1f')];var _0x58466c=_0x88b0d9?0x0:_0x32896c[_0xcf85('0x20')];var _0x565935=_0x88b0d9?_0x3c9b8d[_0xcf85('0x1f')]:_0x32896c[_0xcf85('0x20')]+_0x32896c[_0xcf85('0x1e')];var _0x2403a7;if(_0x565935>=_0x51739c){_0x565935=_0x51739c;_0x2403a7=0xc8;}else{_0x2403a7=0xce;}_0x5e801e[_0xcf85('0x1b')](_0x2403a7);return _0x5e801e[_0xcf85('0x21')](_0xcf85('0x22'),_0x58466c+'-'+_0x565935+'/'+_0x51739c)[_0xcf85('0x23')](_0x3c9b8d);}return null;};}function patchUpdates(_0x3998a1){return function(_0x5c0474){try{jsonpatch[_0xcf85('0x24')](_0x5c0474,_0x3998a1,!![]);}catch(_0x38692c){return BPromise[_0xcf85('0x25')](_0x38692c);}return _0x5c0474[_0xcf85('0x26')]();};}function saveUpdates(_0x5417f6,_0x23de3d){return function(_0x3d8cc7){if(_0x3d8cc7){return _0x3d8cc7['update'](_0x5417f6)['then'](function(_0x46f110){return _0x46f110;});}return null;};}function removeEntity(_0x2c206d,_0xc301a8){return function(_0x4efda4){if(_0x4efda4){return _0x4efda4[_0xcf85('0x27')]()[_0xcf85('0x28')](function(){_0x2c206d[_0xcf85('0x1b')](0xcc)[_0xcf85('0x1c')]();});}};}function handleEntityNotFound(_0x166324,_0x5cd3c6){return function(_0x4cd3f4){if(!_0x4cd3f4){_0x166324['sendStatus'](0x194);}return _0x4cd3f4;};}function handleError(_0x2f05b4,_0x595d4f){_0x595d4f=_0x595d4f||0x1f4;return function(_0xa847b7){logger[_0xcf85('0x29')](_0xa847b7['stack']);if(_0xa847b7[_0xcf85('0x2a')]){delete _0xa847b7['name'];}_0x2f05b4[_0xcf85('0x1b')](_0x595d4f)['send'](_0xa847b7);};}exports[_0xcf85('0x2b')]=function(_0x511aac,_0x33a227){var _0x1dd4f5={},_0x321402={},_0x3f0468={'count':0x0,'rows':[]};var _0x534741=_[_0xcf85('0x2c')](db[_0xcf85('0x2d')][_0xcf85('0x2e')],function(_0x5483c5){return{'name':_0x5483c5[_0xcf85('0x2f')],'type':_0x5483c5[_0xcf85('0x30')]['key']};});_0x321402['model']=_['map'](_0x534741,_0xcf85('0x2a'));_0x321402[_0xcf85('0x31')]=_['keys'](_0x511aac['query']);_0x321402[_0xcf85('0x32')]=_[_0xcf85('0x33')](_0x321402['model'],_0x321402[_0xcf85('0x31')]);_0x1dd4f5[_0xcf85('0x34')]=_[_0xcf85('0x33')](_0x321402['model'],qs['fields'](_0x511aac['query'][_0xcf85('0x35')]));_0x1dd4f5['attributes']=_0x1dd4f5[_0xcf85('0x34')]['length']?_0x1dd4f5[_0xcf85('0x34')]:_0x321402[_0xcf85('0x36')];if(!_0x511aac[_0xcf85('0x31')][_0xcf85('0x37')](_0xcf85('0x38'))){_0x1dd4f5[_0xcf85('0x1e')]=qs[_0xcf85('0x1e')](_0x511aac[_0xcf85('0x31')][_0xcf85('0x1e')]);_0x1dd4f5[_0xcf85('0x20')]=qs[_0xcf85('0x20')](_0x511aac[_0xcf85('0x31')][_0xcf85('0x20')]);}_0x1dd4f5[_0xcf85('0x39')]=qs[_0xcf85('0x3a')](_0x511aac[_0xcf85('0x31')][_0xcf85('0x3a')]);_0x1dd4f5[_0xcf85('0x3b')]=qs[_0xcf85('0x32')](_[_0xcf85('0x3c')](_0x511aac[_0xcf85('0x31')],_0x321402[_0xcf85('0x32')]),_0x534741);if(_0x511aac[_0xcf85('0x31')][_0xcf85('0x3d')]){_0x1dd4f5[_0xcf85('0x3b')]=_[_0xcf85('0x3e')](_0x1dd4f5[_0xcf85('0x3b')],{'$or':_['map'](_0x534741,function(_0x3a24e5){if(_0x3a24e5[_0xcf85('0x30')]!=='VIRTUAL'){var _0x12f435={};_0x12f435[_0x3a24e5[_0xcf85('0x2a')]]={'$like':'%'+_0x511aac[_0xcf85('0x31')][_0xcf85('0x3d')]+'%'};return _0x12f435;}})});}_0x1dd4f5=_['merge']({},_0x1dd4f5,_0x511aac[_0xcf85('0x3f')]);var _0x3eb3b0={'where':_0x1dd4f5[_0xcf85('0x3b')]};return db[_0xcf85('0x2d')][_0xcf85('0x1f')](_0x3eb3b0)[_0xcf85('0x28')](function(_0x2f0119){_0x3f0468['count']=_0x2f0119;if(_0x511aac[_0xcf85('0x31')][_0xcf85('0x40')]){_0x1dd4f5[_0xcf85('0x41')]=[{'all':!![]}];}return db[_0xcf85('0x2d')][_0xcf85('0x42')](_0x1dd4f5);})[_0xcf85('0x28')](function(_0x4421b3){_0x3f0468['rows']=_0x4421b3;return _0x3f0468;})[_0xcf85('0x28')](respondWithFilteredResult(_0x33a227,_0x1dd4f5))[_0xcf85('0x43')](handleError(_0x33a227,null));};exports[_0xcf85('0x44')]=function(_0x1f13b5,_0x5ca8ff){var _0x3afe83={'raw':![],'where':{'id':_0x1f13b5[_0xcf85('0x45')]['id']}},_0x9261d1={};_0x9261d1['model']=_[_0xcf85('0x46')](db[_0xcf85('0x2d')][_0xcf85('0x2e')]);_0x9261d1[_0xcf85('0x31')]=_[_0xcf85('0x46')](_0x1f13b5['query']);_0x9261d1[_0xcf85('0x32')]=_[_0xcf85('0x33')](_0x9261d1['model'],_0x9261d1['query']);_0x3afe83[_0xcf85('0x34')]=_[_0xcf85('0x33')](_0x9261d1[_0xcf85('0x36')],qs[_0xcf85('0x35')](_0x1f13b5[_0xcf85('0x31')][_0xcf85('0x35')]));_0x3afe83[_0xcf85('0x34')]=_0x3afe83[_0xcf85('0x34')][_0xcf85('0x47')]?_0x3afe83[_0xcf85('0x34')]:_0x9261d1[_0xcf85('0x36')];if(_0x1f13b5[_0xcf85('0x31')]['includeAll']){_0x3afe83[_0xcf85('0x41')]=[{'all':!![]}];}_0x3afe83=_[_0xcf85('0x3e')]({},_0x3afe83,_0x1f13b5[_0xcf85('0x3f')]);return db['IntegrationReport'][_0xcf85('0x48')](_0x3afe83)[_0xcf85('0x28')](handleEntityNotFound(_0x5ca8ff,null))[_0xcf85('0x28')](respondWithResult(_0x5ca8ff,null))[_0xcf85('0x43')](handleError(_0x5ca8ff,null));};exports['create']=function(_0x1982e5,_0x10fd64){return db['IntegrationReport'][_0xcf85('0x49')](_0x1982e5[_0xcf85('0x4a')],{})['then'](respondWithResult(_0x10fd64,0xc9))[_0xcf85('0x43')](handleError(_0x10fd64,null));};exports[_0xcf85('0x4b')]=function(_0x217c54,_0xd36527){if(_0x217c54[_0xcf85('0x4a')]['id']){delete _0x217c54['body']['id'];}return db[_0xcf85('0x2d')][_0xcf85('0x48')]({'where':{'id':_0x217c54[_0xcf85('0x45')]['id']}})[_0xcf85('0x28')](handleEntityNotFound(_0xd36527,null))[_0xcf85('0x28')](saveUpdates(_0x217c54[_0xcf85('0x4a')],null))[_0xcf85('0x28')](respondWithResult(_0xd36527,null))[_0xcf85('0x43')](handleError(_0xd36527,null));};exports['destroy']=function(_0x575b1e,_0x1302b7){return db[_0xcf85('0x2d')][_0xcf85('0x48')]({'where':{'id':_0x575b1e[_0xcf85('0x45')]['id']}})[_0xcf85('0x28')](handleEntityNotFound(_0x1302b7,null))[_0xcf85('0x28')](removeEntity(_0x1302b7,null))[_0xcf85('0x43')](handleError(_0x1302b7,null));};exports['describe']=function(_0x278fbb,_0x29356b){return db['IntegrationReport'][_0xcf85('0x4c')]()[_0xcf85('0x28')](respondWithResult(_0x29356b,null))[_0xcf85('0x43')](handleError(_0x29356b,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 73c9c41..13af76b 100644 --- a/server/api/integrationReport/integrationReport.model.js +++ b/server/api/integrationReport/integrationReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ec4=['request-promise','path','../../config/environment','exports','define','report_integration','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x42e7ce,_0x375d2e){var _0x3d5428=function(_0x5bcd4b){while(--_0x5bcd4b){_0x42e7ce['push'](_0x42e7ce['shift']());}};_0x3d5428(++_0x375d2e);}(_0x8ec4,0x156));var _0x48ec=function(_0x5202dd,_0x49fe79){_0x5202dd=_0x5202dd-0x0;var _0x1926fe=_0x8ec4[_0x5202dd];return _0x1926fe;};'use strict';var _=require(_0x48ec('0x0'));var util=require(_0x48ec('0x1'));var logger=require(_0x48ec('0x2'))(_0x48ec('0x3'));var moment=require(_0x48ec('0x4'));var BPromise=require(_0x48ec('0x5'));var rp=require(_0x48ec('0x6'));var fs=require('fs');var path=require(_0x48ec('0x7'));var rimraf=require('rimraf');var config=require(_0x48ec('0x8'));var attributes=require('./integrationReport.attributes');module[_0x48ec('0x9')]=function(_0x5d7000,_0x442f25){return _0x5d7000[_0x48ec('0xa')]('IntegrationReport',attributes,{'tableName':_0x48ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51f4=['path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x481192,_0x350167){var _0x1a4c3d=function(_0x293978){while(--_0x293978){_0x481192['push'](_0x481192['shift']());}};_0x1a4c3d(++_0x350167);}(_0x51f4,0x1ba));var _0x451f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x51f4[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x451f('0x0'));var util=require(_0x451f('0x1'));var logger=require(_0x451f('0x2'))(_0x451f('0x3'));var moment=require(_0x451f('0x4'));var BPromise=require(_0x451f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x451f('0x6'));var rimraf=require(_0x451f('0x7'));var config=require(_0x451f('0x8'));var attributes=require(_0x451f('0x9'));module[_0x451f('0xa')]=function(_0x25dc24,_0x20530d){return _0x25dc24[_0x451f('0xb')](_0x451f('0xc'),attributes,{'tableName':_0x451f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 80b011e..799f608 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x451420,_0x278780){var _0xa2cd7b=function(_0x22965d){while(--_0x22965d){_0x451420['push'](_0x451420['shift']());}};_0xa2cd7b(++_0x278780);}(_0x2675,0x75));var _0x5267=function(_0x375b7d,_0x377f03){_0x375b7d=_0x375b7d-0x0;var _0x9a58be=_0x2675[_0x375b7d];return _0x9a58be;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});} \ No newline at end of file +var _0x1261=['then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x23fa99,_0x558c30){var _0x2911a5=function(_0x28ed76){while(--_0x28ed76){_0x23fa99['push'](_0x23fa99['shift']());}};_0x2911a5(++_0x558c30);}(_0x1261,0x144));var _0x1126=function(_0x156b03,_0x238b09){_0x156b03=_0x156b03-0x0;var _0x302cc5=_0x1261[_0x156b03];return _0x302cc5;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index b1c3d5b..9d8c5a0 100644 --- a/server/api/interval/index.js +++ b/server/api/interval/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3fa4=['getIntervals','create','post','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','/:id','update','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated','index','get','show'];(function(_0x20dd9b,_0x3c0fb8){var _0x2de3b0=function(_0x5673d2){while(--_0x5673d2){_0x20dd9b['push'](_0x20dd9b['shift']());}};_0x2de3b0(++_0x3c0fb8);}(_0x3fa4,0xf0));var _0x43fa=function(_0xa3fe1d,_0x194364){_0xa3fe1d=_0xa3fe1d-0x0;var _0x1ce348=_0x3fa4[_0xa3fe1d];return _0x1ce348;};'use strict';var multer=require(_0x43fa('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x43fa('0x1'));var router=express[_0x43fa('0x2')]();var fs_extra=require(_0x43fa('0x3'));var auth=require(_0x43fa('0x4'));var interaction=require(_0x43fa('0x5'));var config=require(_0x43fa('0x6'));var controller=require(_0x43fa('0x7'));router['get']('/',auth[_0x43fa('0x8')](),controller[_0x43fa('0x9')]);router[_0x43fa('0xa')]('/:id',auth[_0x43fa('0x8')](),controller[_0x43fa('0xb')]);router[_0x43fa('0xa')]('/:id/sub_intervals',auth[_0x43fa('0x8')](),controller[_0x43fa('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x43fa('0xd')]);router[_0x43fa('0xe')](_0x43fa('0xf'),auth[_0x43fa('0x8')](),controller[_0x43fa('0x10')]);router['post'](_0x43fa('0x11'),auth[_0x43fa('0x8')](),controller[_0x43fa('0x12')]);router['put'](_0x43fa('0x13'),auth[_0x43fa('0x8')](),controller[_0x43fa('0x14')]);router['delete'](_0x43fa('0x13'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xeac1=['../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','put','update','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x5a67bd,_0x5be9c3){var _0x613a79=function(_0x36ca3e){while(--_0x36ca3e){_0x5a67bd['push'](_0x5a67bd['shift']());}};_0x613a79(++_0x5be9c3);}(_0xeac1,0x146));var _0x1eac=function(_0x1d1d4d,_0x44e587){_0x1d1d4d=_0x1d1d4d-0x0;var _0x485ebf=_0xeac1[_0x1d1d4d];return _0x485ebf;};'use strict';var multer=require('multer');var util=require(_0x1eac('0x0'));var path=require(_0x1eac('0x1'));var timeout=require(_0x1eac('0x2'));var express=require('express');var router=express[_0x1eac('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1eac('0x4'));var config=require(_0x1eac('0x5'));var controller=require(_0x1eac('0x6'));router[_0x1eac('0x7')]('/',auth[_0x1eac('0x8')](),controller[_0x1eac('0x9')]);router[_0x1eac('0x7')](_0x1eac('0xa'),auth[_0x1eac('0x8')](),controller['show']);router[_0x1eac('0x7')]('/:id/sub_intervals',auth[_0x1eac('0x8')](),controller[_0x1eac('0xb')]);router[_0x1eac('0xc')]('/',auth[_0x1eac('0x8')](),controller[_0x1eac('0xd')]);router[_0x1eac('0xc')](_0x1eac('0xe'),auth[_0x1eac('0x8')](),controller[_0x1eac('0xf')]);router[_0x1eac('0xc')](_0x1eac('0x10'),auth[_0x1eac('0x8')](),controller['addIntervals']);router[_0x1eac('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x1eac('0x12')]);router[_0x1eac('0x13')](_0x1eac('0xa'),auth[_0x1eac('0x8')](),controller[_0x1eac('0x14')]);module[_0x1eac('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 5ef93c0..4aa6e87 100644 --- a/server/api/interval/interval.attributes.js +++ b/server/api/interval/interval.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfac5=['sequelize','exports','STRING'];(function(_0x446e02,_0x27c8e1){var _0x54c862=function(_0x4d5f08){while(--_0x4d5f08){_0x446e02['push'](_0x446e02['shift']());}};_0x54c862(++_0x27c8e1);}(_0xfac5,0x8d));var _0x5fac=function(_0x3da7ed,_0x3d2ab6){_0x3da7ed=_0x3da7ed-0x0;var _0x2c14e8=_0xfac5[_0x3da7ed];return _0x2c14e8;};'use strict';var Sequelize=require(_0x5fac('0x0'));module[_0x5fac('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5fac('0x2')]},'interval':{'type':Sequelize[_0x5fac('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x675c=['STRING'];(function(_0xdeefbd,_0x9e1b3d){var _0x4ff63f=function(_0x4b51f9){while(--_0x4b51f9){_0xdeefbd['push'](_0xdeefbd['shift']());}};_0x4ff63f(++_0x9e1b3d);}(_0x675c,0x198));var _0xc675=function(_0x1cbe1d,_0x389423){_0x1cbe1d=_0x1cbe1d-0x0;var _0x2e70ee=_0x675c[_0x1cbe1d];return _0x2e70ee;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc675('0x0')]},'description':{'type':Sequelize[_0xc675('0x0')]},'interval':{'type':Sequelize[_0xc675('0x0')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index e167c3d..572d58d 100644 --- a/server/api/interval/interval.controller.js +++ b/server/api/interval/interval.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfaa5=['util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../components/extensions/rewrite','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','index','Interval','rawAttributes','type','key','map','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','findOne','getIntervals','addIntervals','sequelize','transaction','bulkCreate','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x21ecc8,_0x2bdead){var _0x510c1d=function(_0x3b6862){while(--_0x3b6862){_0x21ecc8['push'](_0x21ecc8['shift']());}};_0x510c1d(++_0x2bdead);}(_0xfaa5,0x1e3));var _0x5faa=function(_0x4c7ee1,_0xdd33ba){_0x4c7ee1=_0x4c7ee1-0x0;var _0x3576fb=_0xfaa5[_0x4c7ee1];return _0x3576fb;};'use strict';var emlformat=require(_0x5faa('0x0'));var rimraf=require(_0x5faa('0x1'));var zipdir=require(_0x5faa('0x2'));var jsonpatch=require(_0x5faa('0x3'));var rp=require('request-promise');var moment=require(_0x5faa('0x4'));var BPromise=require(_0x5faa('0x5'));var Mustache=require(_0x5faa('0x6'));var util=require(_0x5faa('0x7'));var path=require(_0x5faa('0x8'));var sox=require('sox');var csv=require(_0x5faa('0x9'));var ejs=require(_0x5faa('0xa'));var fs=require('fs');var fs_extra=require(_0x5faa('0xb'));var _=require(_0x5faa('0xc'));var squel=require(_0x5faa('0xd'));var crypto=require(_0x5faa('0xe'));var jsforce=require(_0x5faa('0xf'));var deskjs=require(_0x5faa('0x10'));var toCsv=require(_0x5faa('0x9'));var querystring=require('querystring');var Papa=require(_0x5faa('0x11'));var Redis=require(_0x5faa('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5faa('0x13'));var as=require(_0x5faa('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5faa('0x15'))(_0x5faa('0x16'));var utils=require(_0x5faa('0x17'));var config=require(_0x5faa('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var extensions=require(_0x5faa('0x19'));function respondWithStatusCode(_0x38c20f,_0x1e9493){_0x1e9493=_0x1e9493||0xcc;return function(_0x46b535){if(_0x46b535){return _0x38c20f[_0x5faa('0x1a')](_0x1e9493);}return _0x38c20f[_0x5faa('0x1b')](_0x1e9493)[_0x5faa('0x1c')]();};}function respondWithResult(_0xf4fba5,_0x2acae7){_0x2acae7=_0x2acae7||0xc8;return function(_0x196b7e){if(_0x196b7e){return _0xf4fba5['status'](_0x2acae7)['json'](_0x196b7e);}};}function respondWithFilteredResult(_0x4b5868,_0x2bb965){return function(_0x4d11e9){if(_0x4d11e9){var _0x476db4=typeof _0x2bb965[_0x5faa('0x1d')]===_0x5faa('0x1e')&&typeof _0x2bb965[_0x5faa('0x1f')]===_0x5faa('0x1e');var _0x146d09=_0x4d11e9['count'];var _0x392713=_0x476db4?0x0:_0x2bb965[_0x5faa('0x1d')];var _0x5dde0c=_0x476db4?_0x4d11e9[_0x5faa('0x20')]:_0x2bb965[_0x5faa('0x1d')]+_0x2bb965['limit'];var _0x5e18db;if(_0x5dde0c>=_0x146d09){_0x5dde0c=_0x146d09;_0x5e18db=0xc8;}else{_0x5e18db=0xce;}_0x4b5868[_0x5faa('0x1b')](_0x5e18db);return _0x4b5868[_0x5faa('0x21')](_0x5faa('0x22'),_0x392713+'-'+_0x5dde0c+'/'+_0x146d09)[_0x5faa('0x23')](_0x4d11e9);}return null;};}function patchUpdates(_0x3db3ad){return function(_0x4d1629){try{jsonpatch[_0x5faa('0x24')](_0x4d1629,_0x3db3ad,!![]);}catch(_0x1fa68c){return BPromise[_0x5faa('0x25')](_0x1fa68c);}return _0x4d1629[_0x5faa('0x26')]();};}function saveUpdates(_0x1e64e8,_0x3f435b){return function(_0x4585a7){if(_0x4585a7){return _0x4585a7[_0x5faa('0x27')](_0x1e64e8)[_0x5faa('0x28')](function(_0x27f887){return _0x27f887;});}return null;};}function removeEntity(_0x2b70bc,_0x3df2a0){return function(_0x45f6ff){if(_0x45f6ff){return _0x45f6ff[_0x5faa('0x29')]()[_0x5faa('0x28')](function(){var _0x43ac60=_0x45f6ff[_0x5faa('0x2a')]({'plain':!![]});var _0x11583e=_0x5faa('0x2b');return db[_0x5faa('0x2c')][_0x5faa('0x29')]({'where':{'type':_0x11583e,'resourceId':_0x43ac60['id']}})[_0x5faa('0x28')](function(){return _0x45f6ff;});})[_0x5faa('0x28')](function(){_0x2b70bc[_0x5faa('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b48b6,_0x30a870){return function(_0x3c5aa7){if(!_0x3c5aa7){_0x5b48b6['sendStatus'](0x194);}return _0x3c5aa7;};}function handleError(_0x310598,_0x5d156b){_0x5d156b=_0x5d156b||0x1f4;return function(_0x416ade){logger[_0x5faa('0x2d')](_0x416ade[_0x5faa('0x2e')]);if(_0x416ade[_0x5faa('0x2f')]){delete _0x416ade[_0x5faa('0x2f')];}_0x310598['status'](_0x5d156b)[_0x5faa('0x30')](_0x416ade);};}exports[_0x5faa('0x31')]=function(_0xa1cdff,_0x754ed){var _0x39358d={},_0x621a16={},_0x53450e={'count':0x0,'rows':[]};var _0x107ee7=_['map'](db[_0x5faa('0x32')][_0x5faa('0x33')],function(_0x262f9c){return{'name':_0x262f9c['fieldName'],'type':_0x262f9c[_0x5faa('0x34')][_0x5faa('0x35')]};});_0x621a16['model']=_[_0x5faa('0x36')](_0x107ee7,_0x5faa('0x2f'));_0x621a16[_0x5faa('0x37')]=_[_0x5faa('0x38')](_0xa1cdff[_0x5faa('0x37')]);_0x621a16['filters']=_[_0x5faa('0x39')](_0x621a16['model'],_0x621a16['query']);_0x39358d[_0x5faa('0x3a')]=_[_0x5faa('0x39')](_0x621a16[_0x5faa('0x3b')],qs[_0x5faa('0x3c')](_0xa1cdff[_0x5faa('0x37')][_0x5faa('0x3c')]));_0x39358d['attributes']=_0x39358d[_0x5faa('0x3a')][_0x5faa('0x3d')]?_0x39358d[_0x5faa('0x3a')]:_0x621a16[_0x5faa('0x3b')];if(!_0xa1cdff[_0x5faa('0x37')][_0x5faa('0x3e')](_0x5faa('0x3f'))){_0x39358d['limit']=qs['limit'](_0xa1cdff[_0x5faa('0x37')][_0x5faa('0x1f')]);_0x39358d[_0x5faa('0x1d')]=qs['offset'](_0xa1cdff[_0x5faa('0x37')]['offset']);}_0x39358d[_0x5faa('0x40')]=qs[_0x5faa('0x41')](_0xa1cdff[_0x5faa('0x37')][_0x5faa('0x41')]);_0x39358d[_0x5faa('0x42')]=qs[_0x5faa('0x43')](_[_0x5faa('0x44')](_0xa1cdff[_0x5faa('0x37')],_0x621a16[_0x5faa('0x43')]),_0x107ee7);if(_0xa1cdff[_0x5faa('0x37')][_0x5faa('0x45')]){_0x39358d[_0x5faa('0x42')]=_[_0x5faa('0x46')](_0x39358d[_0x5faa('0x42')],{'$or':_['map'](_0x107ee7,function(_0x5e1ea5){if(_0x5e1ea5[_0x5faa('0x34')]!==_0x5faa('0x47')){var _0x3f3655={};_0x3f3655[_0x5e1ea5['name']]={'$like':'%'+_0xa1cdff[_0x5faa('0x37')]['filter']+'%'};return _0x3f3655;}})});}_0x39358d=_[_0x5faa('0x46')]({},_0x39358d,_0xa1cdff[_0x5faa('0x48')]);var _0x162a57={'where':_0x39358d[_0x5faa('0x42')]};return db[_0x5faa('0x32')][_0x5faa('0x20')](_0x162a57)[_0x5faa('0x28')](function(_0x353a89){_0x53450e[_0x5faa('0x20')]=_0x353a89;if(_0xa1cdff[_0x5faa('0x37')][_0x5faa('0x49')]){_0x39358d['include']=[{'all':!![]}];}return db[_0x5faa('0x32')]['findAll'](_0x39358d);})[_0x5faa('0x28')](function(_0x60011){_0x53450e[_0x5faa('0x4a')]=_0x60011;return _0x53450e;})[_0x5faa('0x28')](respondWithFilteredResult(_0x754ed,_0x39358d))['catch'](handleError(_0x754ed,null));};exports[_0x5faa('0x4b')]=function(_0x17d22e,_0x447bcc){var _0x3fb287={'raw':!![],'where':{'id':_0x17d22e[_0x5faa('0x4c')]['id']}},_0x3aff11={};_0x3aff11['model']=_['keys'](db[_0x5faa('0x32')][_0x5faa('0x33')]);_0x3aff11['query']=_[_0x5faa('0x38')](_0x17d22e[_0x5faa('0x37')]);_0x3aff11[_0x5faa('0x43')]=_['intersection'](_0x3aff11['model'],_0x3aff11[_0x5faa('0x37')]);_0x3fb287[_0x5faa('0x3a')]=_[_0x5faa('0x39')](_0x3aff11[_0x5faa('0x3b')],qs[_0x5faa('0x3c')](_0x17d22e[_0x5faa('0x37')][_0x5faa('0x3c')]));_0x3fb287[_0x5faa('0x3a')]=_0x3fb287[_0x5faa('0x3a')]['length']?_0x3fb287[_0x5faa('0x3a')]:_0x3aff11['model'];if(_0x17d22e[_0x5faa('0x37')][_0x5faa('0x49')]){_0x3fb287[_0x5faa('0x4d')]=[{'all':!![]}];}_0x3fb287=_[_0x5faa('0x46')]({},_0x3fb287,_0x17d22e[_0x5faa('0x48')]);return db[_0x5faa('0x32')][_0x5faa('0x4e')](_0x3fb287)[_0x5faa('0x28')](handleEntityNotFound(_0x447bcc,null))[_0x5faa('0x28')](respondWithResult(_0x447bcc,null))[_0x5faa('0x4f')](handleError(_0x447bcc,null));};exports['create']=function(_0x214ab0,_0x28c5ed){return db[_0x5faa('0x32')][_0x5faa('0x50')](_0x214ab0[_0x5faa('0x51')],{})[_0x5faa('0x28')](function(_0x456a84){var _0x52dd85=_0x214ab0[_0x5faa('0x52')]['get']({'plain':!![]});if(!_0x52dd85)throw new Error(_0x5faa('0x53'));if(_0x52dd85[_0x5faa('0x54')]===_0x5faa('0x52')){var _0x135907=_0x456a84['get']({'plain':!![]});var _0x546804='Intervals';return db[_0x5faa('0x55')][_0x5faa('0x4e')]({'where':{'name':_0x546804,'userProfileId':_0x52dd85[_0x5faa('0x56')]},'raw':!![]})[_0x5faa('0x28')](function(_0x49a2a3){if(_0x49a2a3&&_0x49a2a3[_0x5faa('0x57')]===0x0){return db[_0x5faa('0x2c')][_0x5faa('0x50')]({'name':_0x135907[_0x5faa('0x2f')],'resourceId':_0x135907['id'],'type':_0x49a2a3[_0x5faa('0x2f')],'sectionId':_0x49a2a3['id']},{})[_0x5faa('0x28')](function(){return _0x456a84;});}else{return _0x456a84;}})['catch'](function(_0x3649ba){logger[_0x5faa('0x2d')](_0x5faa('0x58'),_0x3649ba);throw _0x3649ba;});}return _0x456a84;})['then'](respondWithResult(_0x28c5ed,0xc9))[_0x5faa('0x4f')](handleError(_0x28c5ed,null));};exports[_0x5faa('0x27')]=function(_0x459964,_0xf54908){if(_0x459964['body']['id']){delete _0x459964[_0x5faa('0x51')]['id'];}return db[_0x5faa('0x32')][_0x5faa('0x4e')]({'where':{'id':_0x459964[_0x5faa('0x4c')]['id']}})[_0x5faa('0x28')](handleEntityNotFound(_0xf54908,null))[_0x5faa('0x28')](saveUpdates(_0x459964[_0x5faa('0x51')],null))[_0x5faa('0x28')](respondWithResult(_0xf54908,null))[_0x5faa('0x4f')](handleError(_0xf54908,null));};exports[_0x5faa('0x29')]=function(_0x3eed34,_0xa3cc4b){return db[_0x5faa('0x32')][_0x5faa('0x4e')]({'where':{'id':_0x3eed34[_0x5faa('0x4c')]['id']}})[_0x5faa('0x28')](handleEntityNotFound(_0xa3cc4b,null))[_0x5faa('0x28')](removeEntity(_0xa3cc4b,null))[_0x5faa('0x4f')](handleError(_0xa3cc4b,null));};exports[_0x5faa('0x59')]=function(_0x4e1bcf,_0x36ec92,_0x5c6fb6){if(_0x4e1bcf[_0x5faa('0x51')]['id']){delete _0x4e1bcf['body']['id'];}return db[_0x5faa('0x32')]['find']({'where':{'id':_0x4e1bcf['params']['id']}})[_0x5faa('0x28')](handleEntityNotFound(_0x36ec92,null))[_0x5faa('0x28')](function(_0x4fae5c){if(_0x4fae5c){_0x4e1bcf['body'][_0x5faa('0x5a')]=_0x4fae5c['id'];return db[_0x5faa('0x32')][_0x5faa('0x50')](_0x4e1bcf['body']);}})[_0x5faa('0x28')](respondWithResult(_0x36ec92,null))[_0x5faa('0x4f')](handleError(_0x36ec92,null));};exports['getIntervals']=function(_0x4ef580,_0x2472f3,_0x54d2a6){var _0x4662ac={};var _0xe61540={};var _0x374486;var _0x19c4c6;return db['Interval'][_0x5faa('0x5b')]({'where':{'id':_0x4ef580[_0x5faa('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2472f3,null))[_0x5faa('0x28')](function(_0x485c70){if(_0x485c70){_0x374486=_0x485c70;_0xe61540[_0x5faa('0x3b')]=_[_0x5faa('0x38')](db[_0x5faa('0x32')][_0x5faa('0x33')]);_0xe61540[_0x5faa('0x37')]=_[_0x5faa('0x38')](_0x4ef580['query']);_0xe61540[_0x5faa('0x43')]=_[_0x5faa('0x39')](_0xe61540[_0x5faa('0x3b')],_0xe61540[_0x5faa('0x37')]);_0x4662ac[_0x5faa('0x3a')]=_[_0x5faa('0x39')](_0xe61540[_0x5faa('0x3b')],qs[_0x5faa('0x3c')](_0x4ef580[_0x5faa('0x37')][_0x5faa('0x3c')]));_0x4662ac[_0x5faa('0x3a')]=_0x4662ac[_0x5faa('0x3a')][_0x5faa('0x3d')]?_0x4662ac[_0x5faa('0x3a')]:_0xe61540[_0x5faa('0x3b')];_0x4662ac['order']=qs['sort'](_0x4ef580[_0x5faa('0x37')][_0x5faa('0x41')]);_0x4662ac[_0x5faa('0x42')]=qs[_0x5faa('0x43')](_[_0x5faa('0x44')](_0x4ef580['query'],_0xe61540[_0x5faa('0x43')]));if(_0x4ef580[_0x5faa('0x37')][_0x5faa('0x45')]){_0x4662ac[_0x5faa('0x42')]=_['merge'](_0x4662ac[_0x5faa('0x42')],{'$or':_[_0x5faa('0x36')](_0x4662ac[_0x5faa('0x3a')],function(_0xa36363){var _0x59cec8={};_0x59cec8[_0xa36363]={'$like':'%'+_0x4ef580[_0x5faa('0x37')][_0x5faa('0x45')]+'%'};return _0x59cec8;})});}_0x4662ac=_['merge']({},_0x4662ac,_0x4ef580[_0x5faa('0x48')]);return _0x374486['getIntervals'](_0x4662ac);}})[_0x5faa('0x28')](function(_0x4675c7){if(_0x4675c7){_0x19c4c6=_0x4675c7[_0x5faa('0x3d')];if(!_0x4ef580['query'][_0x5faa('0x3e')](_0x5faa('0x3f'))){_0x4662ac[_0x5faa('0x1f')]=qs[_0x5faa('0x1f')](_0x4ef580[_0x5faa('0x37')][_0x5faa('0x1f')]);_0x4662ac[_0x5faa('0x1d')]=qs[_0x5faa('0x1d')](_0x4ef580[_0x5faa('0x37')][_0x5faa('0x1d')]);}return _0x374486[_0x5faa('0x5c')](_0x4662ac);}})[_0x5faa('0x28')](function(_0x1d912c){if(_0x1d912c){return _0x1d912c?{'count':_0x19c4c6,'rows':_0x1d912c}:null;}})[_0x5faa('0x28')](respondWithResult(_0x2472f3,null))[_0x5faa('0x4f')](handleError(_0x2472f3,null));};exports[_0x5faa('0x5d')]=function(_0xfee6af,_0x2381bd,_0x37b02e){return db[_0x5faa('0x32')][_0x5faa('0x5b')]({'where':{'id':_0xfee6af[_0x5faa('0x4c')]['id']}})[_0x5faa('0x28')](handleEntityNotFound(_0x2381bd,null))[_0x5faa('0x28')](function(_0x5c8e34){if(_0x5c8e34){return db[_0x5faa('0x5e')][_0x5faa('0x5f')](function(_0x18ac2a){return db[_0x5faa('0x32')][_0x5faa('0x29')]({'where':{'IntervalId':_0xfee6af[_0x5faa('0x4c')]['id']},'transaction':_0x18ac2a})[_0x5faa('0x28')](function(_0x349c82){var _0x15ebae=_[_0x5faa('0x36')](_0xfee6af[_0x5faa('0x51')],function(_0x1480db){delete _0x1480db['id'];_0x1480db['IntervalId']=_0xfee6af[_0x5faa('0x4c')]['id'];return _0x1480db;});return db[_0x5faa('0x32')][_0x5faa('0x60')](_0x15ebae,{'transaction':_0x18ac2a});});})[_0x5faa('0x28')](function(){return db['Interval'][_0x5faa('0x61')]({'where':{'IntervalId':_0xfee6af[_0x5faa('0x4c')]['id']}});});}})[_0x5faa('0x28')](respondWithResult(_0x2381bd,null))['catch'](handleError(_0x2381bd,null));}; \ No newline at end of file +var _0x26e2=['params','addInterval','IntervalId','getIntervals','findOne','sequelize','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','Intervals','then','error','stack','name','send','Interval','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x26e2,0x1ce));var _0x226e=function(_0xc0bfe6,_0x4c172b){_0xc0bfe6=_0xc0bfe6-0x0;var _0x25e44f=_0x26e2[_0xc0bfe6];return _0x25e44f;};'use strict';var emlformat=require(_0x226e('0x0'));var rimraf=require(_0x226e('0x1'));var zipdir=require(_0x226e('0x2'));var jsonpatch=require(_0x226e('0x3'));var rp=require(_0x226e('0x4'));var moment=require('moment');var BPromise=require(_0x226e('0x5'));var Mustache=require('mustache');var util=require(_0x226e('0x6'));var path=require(_0x226e('0x7'));var sox=require(_0x226e('0x8'));var csv=require(_0x226e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x226e('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x226e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x226e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x226e('0xd'));var Papa=require(_0x226e('0xe'));var Redis=require(_0x226e('0xf'));var authService=require(_0x226e('0x10'));var qs=require(_0x226e('0x11'));var as=require(_0x226e('0x12'));var hardwareService=require(_0x226e('0x13'));var logger=require(_0x226e('0x14'))('api');var utils=require(_0x226e('0x15'));var config=require(_0x226e('0x16'));var licenseUtil=require(_0x226e('0x17'));var db=require(_0x226e('0x18'))['db'];var extensions=require(_0x226e('0x19'));function respondWithStatusCode(_0x30aaa0,_0x223d7a){_0x223d7a=_0x223d7a||0xcc;return function(_0x7f786c){if(_0x7f786c){return _0x30aaa0[_0x226e('0x1a')](_0x223d7a);}return _0x30aaa0[_0x226e('0x1b')](_0x223d7a)['end']();};}function respondWithResult(_0x359886,_0x30881e){_0x30881e=_0x30881e||0xc8;return function(_0x404ef2){if(_0x404ef2){return _0x359886[_0x226e('0x1b')](_0x30881e)[_0x226e('0x1c')](_0x404ef2);}};}function respondWithFilteredResult(_0x337dc8,_0x11c21c){return function(_0x5486c5){if(_0x5486c5){var _0x1ccfc4=typeof _0x11c21c[_0x226e('0x1d')]===_0x226e('0x1e')&&typeof _0x11c21c[_0x226e('0x1f')]==='undefined';var _0x110a47=_0x5486c5[_0x226e('0x20')];var _0x629a1e=_0x1ccfc4?0x0:_0x11c21c['offset'];var _0x586247=_0x1ccfc4?_0x5486c5[_0x226e('0x20')]:_0x11c21c['offset']+_0x11c21c['limit'];var _0x36864c;if(_0x586247>=_0x110a47){_0x586247=_0x110a47;_0x36864c=0xc8;}else{_0x36864c=0xce;}_0x337dc8[_0x226e('0x1b')](_0x36864c);return _0x337dc8[_0x226e('0x21')](_0x226e('0x22'),_0x629a1e+'-'+_0x586247+'/'+_0x110a47)['json'](_0x5486c5);}return null;};}function patchUpdates(_0x4620e6){return function(_0x6ad10f){try{jsonpatch['apply'](_0x6ad10f,_0x4620e6,!![]);}catch(_0x5ae10d){return BPromise[_0x226e('0x23')](_0x5ae10d);}return _0x6ad10f[_0x226e('0x24')]();};}function saveUpdates(_0x4c8389,_0x14abe4){return function(_0x11dc7d){if(_0x11dc7d){return _0x11dc7d[_0x226e('0x25')](_0x4c8389)['then'](function(_0x29a975){return _0x29a975;});}return null;};}function removeEntity(_0x46750c,_0x10d1bc){return function(_0x13c45e){if(_0x13c45e){return _0x13c45e[_0x226e('0x26')]()['then'](function(){var _0x2e5b52=_0x13c45e[_0x226e('0x27')]({'plain':!![]});var _0x296eed=_0x226e('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x296eed,'resourceId':_0x2e5b52['id']}})[_0x226e('0x29')](function(){return _0x13c45e;});})[_0x226e('0x29')](function(){_0x46750c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1636bd,_0x34e1ef){return function(_0x34c9d5){if(!_0x34c9d5){_0x1636bd[_0x226e('0x1a')](0x194);}return _0x34c9d5;};}function handleError(_0x238bb4,_0x5a38e7){_0x5a38e7=_0x5a38e7||0x1f4;return function(_0x319894){logger[_0x226e('0x2a')](_0x319894[_0x226e('0x2b')]);if(_0x319894[_0x226e('0x2c')]){delete _0x319894[_0x226e('0x2c')];}_0x238bb4[_0x226e('0x1b')](_0x5a38e7)[_0x226e('0x2d')](_0x319894);};}exports['index']=function(_0xe099a0,_0x42f536){var _0xe998d1={},_0x4abaaa={},_0x5bd625={'count':0x0,'rows':[]};var _0x1574c0=_['map'](db[_0x226e('0x2e')][_0x226e('0x2f')],function(_0x437e05){return{'name':_0x437e05[_0x226e('0x30')],'type':_0x437e05[_0x226e('0x31')][_0x226e('0x32')]};});_0x4abaaa[_0x226e('0x33')]=_['map'](_0x1574c0,_0x226e('0x2c'));_0x4abaaa['query']=_[_0x226e('0x34')](_0xe099a0[_0x226e('0x35')]);_0x4abaaa[_0x226e('0x36')]=_[_0x226e('0x37')](_0x4abaaa['model'],_0x4abaaa[_0x226e('0x35')]);_0xe998d1['attributes']=_['intersection'](_0x4abaaa['model'],qs[_0x226e('0x38')](_0xe099a0[_0x226e('0x35')][_0x226e('0x38')]));_0xe998d1['attributes']=_0xe998d1['attributes'][_0x226e('0x39')]?_0xe998d1[_0x226e('0x3a')]:_0x4abaaa['model'];if(!_0xe099a0[_0x226e('0x35')][_0x226e('0x3b')]('nolimit')){_0xe998d1['limit']=qs[_0x226e('0x1f')](_0xe099a0['query']['limit']);_0xe998d1[_0x226e('0x1d')]=qs['offset'](_0xe099a0[_0x226e('0x35')][_0x226e('0x1d')]);}_0xe998d1[_0x226e('0x3c')]=qs['sort'](_0xe099a0[_0x226e('0x35')][_0x226e('0x3d')]);_0xe998d1[_0x226e('0x3e')]=qs[_0x226e('0x36')](_[_0x226e('0x3f')](_0xe099a0[_0x226e('0x35')],_0x4abaaa['filters']),_0x1574c0);if(_0xe099a0[_0x226e('0x35')]['filter']){_0xe998d1[_0x226e('0x3e')]=_[_0x226e('0x40')](_0xe998d1[_0x226e('0x3e')],{'$or':_[_0x226e('0x41')](_0x1574c0,function(_0x2a5d79){if(_0x2a5d79[_0x226e('0x31')]!==_0x226e('0x42')){var _0x5c0e90={};_0x5c0e90[_0x2a5d79[_0x226e('0x2c')]]={'$like':'%'+_0xe099a0[_0x226e('0x35')][_0x226e('0x43')]+'%'};return _0x5c0e90;}})});}_0xe998d1=_['merge']({},_0xe998d1,_0xe099a0['options']);var _0x2c2302={'where':_0xe998d1['where']};return db['Interval'][_0x226e('0x20')](_0x2c2302)[_0x226e('0x29')](function(_0x1b2baf){_0x5bd625['count']=_0x1b2baf;if(_0xe099a0[_0x226e('0x35')][_0x226e('0x44')]){_0xe998d1[_0x226e('0x45')]=[{'all':!![]}];}return db['Interval'][_0x226e('0x46')](_0xe998d1);})['then'](function(_0x4d3915){_0x5bd625[_0x226e('0x47')]=_0x4d3915;return _0x5bd625;})[_0x226e('0x29')](respondWithFilteredResult(_0x42f536,_0xe998d1))[_0x226e('0x48')](handleError(_0x42f536,null));};exports[_0x226e('0x49')]=function(_0x55ccd8,_0xd563fb){var _0x123c78={'raw':!![],'where':{'id':_0x55ccd8['params']['id']}},_0x31a858={};_0x31a858[_0x226e('0x33')]=_[_0x226e('0x34')](db['Interval'][_0x226e('0x2f')]);_0x31a858[_0x226e('0x35')]=_[_0x226e('0x34')](_0x55ccd8[_0x226e('0x35')]);_0x31a858[_0x226e('0x36')]=_['intersection'](_0x31a858['model'],_0x31a858[_0x226e('0x35')]);_0x123c78['attributes']=_['intersection'](_0x31a858[_0x226e('0x33')],qs['fields'](_0x55ccd8['query'][_0x226e('0x38')]));_0x123c78[_0x226e('0x3a')]=_0x123c78[_0x226e('0x3a')][_0x226e('0x39')]?_0x123c78['attributes']:_0x31a858[_0x226e('0x33')];if(_0x55ccd8[_0x226e('0x35')][_0x226e('0x44')]){_0x123c78['include']=[{'all':!![]}];}_0x123c78=_['merge']({},_0x123c78,_0x55ccd8[_0x226e('0x4a')]);return db[_0x226e('0x2e')][_0x226e('0x4b')](_0x123c78)[_0x226e('0x29')](handleEntityNotFound(_0xd563fb,null))[_0x226e('0x29')](respondWithResult(_0xd563fb,null))[_0x226e('0x48')](handleError(_0xd563fb,null));};exports['create']=function(_0x3bb1f9,_0x5f035a){return db[_0x226e('0x2e')][_0x226e('0x4c')](_0x3bb1f9[_0x226e('0x4d')],{})[_0x226e('0x29')](function(_0x3f1d77){var _0x166015=_0x3bb1f9[_0x226e('0x4e')][_0x226e('0x27')]({'plain':!![]});if(!_0x166015)throw new Error(_0x226e('0x4f'));if(_0x166015[_0x226e('0x50')]===_0x226e('0x4e')){var _0x378b6e=_0x3f1d77[_0x226e('0x27')]({'plain':!![]});var _0x210f59=_0x226e('0x28');return db[_0x226e('0x51')]['find']({'where':{'name':_0x210f59,'userProfileId':_0x166015[_0x226e('0x52')]},'raw':!![]})[_0x226e('0x29')](function(_0x3bf22f){if(_0x3bf22f&&_0x3bf22f['autoAssociation']===0x0){return db[_0x226e('0x53')][_0x226e('0x4c')]({'name':_0x378b6e[_0x226e('0x2c')],'resourceId':_0x378b6e['id'],'type':_0x3bf22f[_0x226e('0x2c')],'sectionId':_0x3bf22f['id']},{})['then'](function(){return _0x3f1d77;});}else{return _0x3f1d77;}})[_0x226e('0x48')](function(_0x157281){logger[_0x226e('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x157281);throw _0x157281;});}return _0x3f1d77;})[_0x226e('0x29')](respondWithResult(_0x5f035a,0xc9))[_0x226e('0x48')](handleError(_0x5f035a,null));};exports[_0x226e('0x25')]=function(_0x17173e,_0xf8c0e9){if(_0x17173e[_0x226e('0x4d')]['id']){delete _0x17173e['body']['id'];}return db[_0x226e('0x2e')][_0x226e('0x4b')]({'where':{'id':_0x17173e[_0x226e('0x54')]['id']}})['then'](handleEntityNotFound(_0xf8c0e9,null))[_0x226e('0x29')](saveUpdates(_0x17173e['body'],null))[_0x226e('0x29')](respondWithResult(_0xf8c0e9,null))['catch'](handleError(_0xf8c0e9,null));};exports[_0x226e('0x26')]=function(_0x450bc9,_0x3c1e6b){return db['Interval'][_0x226e('0x4b')]({'where':{'id':_0x450bc9[_0x226e('0x54')]['id']}})[_0x226e('0x29')](handleEntityNotFound(_0x3c1e6b,null))['then'](removeEntity(_0x3c1e6b,null))[_0x226e('0x48')](handleError(_0x3c1e6b,null));};exports[_0x226e('0x55')]=function(_0x5ab6ff,_0x49476a,_0x3dc1ad){if(_0x5ab6ff['body']['id']){delete _0x5ab6ff[_0x226e('0x4d')]['id'];}return db[_0x226e('0x2e')][_0x226e('0x4b')]({'where':{'id':_0x5ab6ff[_0x226e('0x54')]['id']}})[_0x226e('0x29')](handleEntityNotFound(_0x49476a,null))['then'](function(_0x48125e){if(_0x48125e){_0x5ab6ff[_0x226e('0x4d')][_0x226e('0x56')]=_0x48125e['id'];return db[_0x226e('0x2e')][_0x226e('0x4c')](_0x5ab6ff[_0x226e('0x4d')]);}})[_0x226e('0x29')](respondWithResult(_0x49476a,null))[_0x226e('0x48')](handleError(_0x49476a,null));};exports[_0x226e('0x57')]=function(_0x5604d4,_0x37e3c7,_0x54a747){var _0x3bfad5={};var _0x2b8e43={};var _0x120762;var _0x77c1ce;return db[_0x226e('0x2e')][_0x226e('0x58')]({'where':{'id':_0x5604d4[_0x226e('0x54')]['id']}})['then'](handleEntityNotFound(_0x37e3c7,null))['then'](function(_0x66b19b){if(_0x66b19b){_0x120762=_0x66b19b;_0x2b8e43[_0x226e('0x33')]=_[_0x226e('0x34')](db['Interval'][_0x226e('0x2f')]);_0x2b8e43[_0x226e('0x35')]=_[_0x226e('0x34')](_0x5604d4[_0x226e('0x35')]);_0x2b8e43[_0x226e('0x36')]=_[_0x226e('0x37')](_0x2b8e43[_0x226e('0x33')],_0x2b8e43[_0x226e('0x35')]);_0x3bfad5[_0x226e('0x3a')]=_[_0x226e('0x37')](_0x2b8e43[_0x226e('0x33')],qs[_0x226e('0x38')](_0x5604d4[_0x226e('0x35')][_0x226e('0x38')]));_0x3bfad5[_0x226e('0x3a')]=_0x3bfad5[_0x226e('0x3a')][_0x226e('0x39')]?_0x3bfad5[_0x226e('0x3a')]:_0x2b8e43[_0x226e('0x33')];_0x3bfad5[_0x226e('0x3c')]=qs[_0x226e('0x3d')](_0x5604d4['query']['sort']);_0x3bfad5[_0x226e('0x3e')]=qs[_0x226e('0x36')](_[_0x226e('0x3f')](_0x5604d4['query'],_0x2b8e43['filters']));if(_0x5604d4[_0x226e('0x35')][_0x226e('0x43')]){_0x3bfad5[_0x226e('0x3e')]=_['merge'](_0x3bfad5['where'],{'$or':_[_0x226e('0x41')](_0x3bfad5[_0x226e('0x3a')],function(_0x197750){var _0x4f6c70={};_0x4f6c70[_0x197750]={'$like':'%'+_0x5604d4['query'][_0x226e('0x43')]+'%'};return _0x4f6c70;})});}_0x3bfad5=_['merge']({},_0x3bfad5,_0x5604d4[_0x226e('0x4a')]);return _0x120762['getIntervals'](_0x3bfad5);}})[_0x226e('0x29')](function(_0x5378b8){if(_0x5378b8){_0x77c1ce=_0x5378b8[_0x226e('0x39')];if(!_0x5604d4[_0x226e('0x35')]['hasOwnProperty']('nolimit')){_0x3bfad5[_0x226e('0x1f')]=qs[_0x226e('0x1f')](_0x5604d4[_0x226e('0x35')][_0x226e('0x1f')]);_0x3bfad5[_0x226e('0x1d')]=qs['offset'](_0x5604d4[_0x226e('0x35')][_0x226e('0x1d')]);}return _0x120762['getIntervals'](_0x3bfad5);}})['then'](function(_0x17e711){if(_0x17e711){return _0x17e711?{'count':_0x77c1ce,'rows':_0x17e711}:null;}})[_0x226e('0x29')](respondWithResult(_0x37e3c7,null))[_0x226e('0x48')](handleError(_0x37e3c7,null));};exports['addIntervals']=function(_0x5c850,_0xb9d2e7,_0x305d41){return db[_0x226e('0x2e')][_0x226e('0x58')]({'where':{'id':_0x5c850[_0x226e('0x54')]['id']}})['then'](handleEntityNotFound(_0xb9d2e7,null))[_0x226e('0x29')](function(_0x5280bf){if(_0x5280bf){return db[_0x226e('0x59')]['transaction'](function(_0xad6f01){return db[_0x226e('0x2e')][_0x226e('0x26')]({'where':{'IntervalId':_0x5c850[_0x226e('0x54')]['id']},'transaction':_0xad6f01})['then'](function(_0xb3d735){var _0x62234d=_['map'](_0x5c850[_0x226e('0x4d')],function(_0x3e89b3){delete _0x3e89b3['id'];_0x3e89b3[_0x226e('0x56')]=_0x5c850[_0x226e('0x54')]['id'];return _0x3e89b3;});return db[_0x226e('0x2e')][_0x226e('0x5a')](_0x62234d,{'transaction':_0xad6f01});});})['then'](function(){return db[_0x226e('0x2e')]['findAll']({'where':{'IntervalId':_0x5c850[_0x226e('0x54')]['id']}});});}})[_0x226e('0x29')](respondWithResult(_0xb9d2e7,null))[_0x226e('0x48')](handleError(_0xb9d2e7,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 69e99d7..ac24eee 100644 --- a/server/api/interval/interval.model.js +++ b/server/api/interval/interval.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1071=['rewrite','interval','string','getIntervals','then','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','exports','define','Interval'];(function(_0x5012b6,_0x510fe6){var _0x3514d2=function(_0x5ef76c){while(--_0x5ef76c){_0x5012b6['push'](_0x5012b6['shift']());}};_0x3514d2(++_0x510fe6);}(_0x1071,0x180));var _0x1107=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1071[_0x432682];return _0x463d05;};'use strict';var attributes=require(_0x1107('0x0'));var extensions=require(_0x1107('0x1'));var iftime=require(_0x1107('0x2'))['iftime'];module[_0x1107('0x3')]=function(_0x175918){return _0x175918[_0x1107('0x4')](_0x1107('0x5'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c41cb){extensions[_0x1107('0x6')](_0x175918,_0x4c41cb);},'afterBulkCreate':function(_0x12c785,_0x50710d,_0x3900d8){_0x3900d8();extensions[_0x1107('0x6')](_0x175918,_0x12c785[0x0]);},'afterUpdate':function(_0x9c29be){extensions[_0x1107('0x6')](_0x175918,_0x9c29be);},'afterDestroy':function(_0x1b5e2f){extensions[_0x1107('0x6')](_0x175918,_0x1b5e2f);}},'instanceMethods':{'ifTime':function(_0xaee01d=undefined,_0x5898b8=new Date()){if(typeof this[_0x1107('0x7')]===_0x1107('0x8')){return iftime(this['interval'],_0xaee01d,_0x5898b8);}else{return this[_0x1107('0x9')]()[_0x1107('0xa')](function(_0x52063c){return Promise['all'](_0x52063c['map'](function(_0x10d24d){return _0x10d24d[_0x1107('0xb')](_0xaee01d,_0x5898b8);}));})[_0x1107('0xa')](function(_0x5033b6){return _0x5033b6[_0x1107('0xc')](function(_0xe47ffc,_0x31bbe){return _0xe47ffc||_0x31bbe;},![]);});}}}});}; \ No newline at end of file +var _0xb1b2=['all','map','./interval.attributes','../../components/extensions/rewrite','iftime','exports','tools_intervals','rewrite','interval','string','then'];(function(_0x27d61f,_0x4dc631){var _0x532e42=function(_0x5f55a2){while(--_0x5f55a2){_0x27d61f['push'](_0x27d61f['shift']());}};_0x532e42(++_0x4dc631);}(_0xb1b2,0x65));var _0x2b1b=function(_0x1b40c0,_0x49961b){_0x1b40c0=_0x1b40c0-0x0;var _0x2adf8f=_0xb1b2[_0x1b40c0];return _0x2adf8f;};'use strict';var attributes=require(_0x2b1b('0x0'));var extensions=require(_0x2b1b('0x1'));var iftime=require('../../utils/iftime')[_0x2b1b('0x2')];module[_0x2b1b('0x3')]=function(_0x2b59e4){return _0x2b59e4['define']('Interval',attributes,{'tableName':_0x2b1b('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1b7960){extensions[_0x2b1b('0x5')](_0x2b59e4,_0x1b7960);},'afterBulkCreate':function(_0x1ab981,_0x495856,_0x1483bf){_0x1483bf();extensions[_0x2b1b('0x5')](_0x2b59e4,_0x1ab981[0x0]);},'afterUpdate':function(_0x2bd5b2){extensions[_0x2b1b('0x5')](_0x2b59e4,_0x2bd5b2);},'afterDestroy':function(_0x44d5fe){extensions[_0x2b1b('0x5')](_0x2b59e4,_0x44d5fe);}},'instanceMethods':{'ifTime':function(_0x53fde3=undefined,_0x241a1c=new Date()){if(typeof this[_0x2b1b('0x6')]===_0x2b1b('0x7')){return iftime(this['interval'],_0x53fde3,_0x241a1c);}else{return this['getIntervals']()[_0x2b1b('0x8')](function(_0x175314){return Promise[_0x2b1b('0x9')](_0x175314[_0x2b1b('0xa')](function(_0x5a560b){return _0x5a560b['ifTime'](_0x53fde3,_0x241a1c);}));})[_0x2b1b('0x8')](function(_0x3d1280){return _0x3d1280['reduce'](function(_0x594ec8,_0x3bdad0){return _0x594ec8||_0x3bdad0;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index bd68f48..c64ed73 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa89=['map','model','info','GetInterval','debug','stringify','catch','error','message','ShowInterval','find','where','then','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','IntervalIftime','intervalIds','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','util','../../mysqldb','../../utils/iftime','rpc','Interval','findAll','options','raw','attributes','include'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xaa89,0x170));var _0x9aa8=function(_0x25a0b9,_0x86e28f){_0x25a0b9=_0x25a0b9-0x0;var _0x30b9ab=_0xaa89[_0x25a0b9];return _0x30b9ab;};'use strict';var _=require('lodash');var util=require(_0x9aa8('0x0'));var db=require(_0x9aa8('0x1'))['db'];var iftime=require(_0x9aa8('0x2'))['iftime'];var logger=require('../../config/logger')(_0x9aa8('0x3'));exports['GetInterval']=function(_0x1ba643){var _0x292b8e=this;return new Promise(function(_0x297e6e,_0x539fde){return db[_0x9aa8('0x4')][_0x9aa8('0x5')]({'raw':_0x1ba643[_0x9aa8('0x6')]?_0x1ba643[_0x9aa8('0x6')][_0x9aa8('0x7')]===undefined?!![]:![]:!![],'where':_0x1ba643[_0x9aa8('0x6')]?_0x1ba643[_0x9aa8('0x6')]['where']||null:null,'attributes':_0x1ba643[_0x9aa8('0x6')]?_0x1ba643['options'][_0x9aa8('0x8')]||null:null,'limit':_0x1ba643[_0x9aa8('0x6')]?_0x1ba643[_0x9aa8('0x6')]['limit']||null:null,'include':_0x1ba643[_0x9aa8('0x6')]?_0x1ba643[_0x9aa8('0x6')][_0x9aa8('0x9')]?_[_0x9aa8('0xa')](_0x1ba643[_0x9aa8('0x6')][_0x9aa8('0x9')],function(_0x5a3ea5){return{'model':db[_0x5a3ea5[_0x9aa8('0xb')]],'as':_0x5a3ea5['as'],'attributes':_0x5a3ea5[_0x9aa8('0x8')],'include':_0x5a3ea5[_0x9aa8('0x9')]?_[_0x9aa8('0xa')](_0x5a3ea5['include'],function(_0x453187){return{'model':db[_0x453187[_0x9aa8('0xb')]],'as':_0x453187['as'],'attributes':_0x453187[_0x9aa8('0x8')],'include':_0x453187['include']?_[_0x9aa8('0xa')](_0x453187['include'],function(_0x1afc08){return{'model':db[_0x1afc08[_0x9aa8('0xb')]],'as':_0x1afc08['as'],'attributes':_0x1afc08[_0x9aa8('0x8')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b4360){logger[_0x9aa8('0xc')](_0x9aa8('0xd'),_0x1ba643);logger[_0x9aa8('0xe')](_0x9aa8('0xd'),_0x1ba643,JSON[_0x9aa8('0xf')](_0x1b4360));_0x297e6e(_0x1b4360);})[_0x9aa8('0x10')](function(_0x32a127){logger[_0x9aa8('0x11')](_0x9aa8('0xd'),_0x32a127['message'],_0x1ba643);_0x539fde(_0x292b8e['error'](0x1f4,_0x32a127[_0x9aa8('0x12')]));});});};exports[_0x9aa8('0x13')]=function(_0x38edff){var _0x59ad08=this;return new Promise(function(_0x2948bc,_0x415d8e){return db[_0x9aa8('0x4')][_0x9aa8('0x14')]({'raw':_0x38edff[_0x9aa8('0x6')]?_0x38edff['options'][_0x9aa8('0x7')]===undefined?!![]:![]:!![],'where':_0x38edff[_0x9aa8('0x6')]?_0x38edff['options'][_0x9aa8('0x15')]||null:null,'attributes':_0x38edff[_0x9aa8('0x6')]?_0x38edff['options']['attributes']||null:null,'include':_0x38edff[_0x9aa8('0x6')]?_0x38edff[_0x9aa8('0x6')]['include']?_[_0x9aa8('0xa')](_0x38edff['options'][_0x9aa8('0x9')],function(_0x5ed018){return{'model':db[_0x5ed018[_0x9aa8('0xb')]],'as':_0x5ed018['as'],'attributes':_0x5ed018['attributes'],'include':_0x5ed018[_0x9aa8('0x9')]?_[_0x9aa8('0xa')](_0x5ed018[_0x9aa8('0x9')],function(_0x22eafa){return{'model':db[_0x22eafa[_0x9aa8('0xb')]],'as':_0x22eafa['as'],'attributes':_0x22eafa[_0x9aa8('0x8')],'include':_0x22eafa[_0x9aa8('0x9')]?_[_0x9aa8('0xa')](_0x22eafa[_0x9aa8('0x9')],function(_0x5c0c73){return{'model':db[_0x5c0c73[_0x9aa8('0xb')]],'as':_0x5c0c73['as'],'attributes':_0x5c0c73[_0x9aa8('0x8')]};}):[]};}):[]};}):[]:[]})[_0x9aa8('0x16')](function(_0x46cb5f){logger[_0x9aa8('0xc')](_0x9aa8('0x13'),_0x38edff);logger[_0x9aa8('0xe')](_0x9aa8('0x13'),_0x38edff,JSON[_0x9aa8('0xf')](_0x46cb5f));_0x2948bc(_0x46cb5f);})[_0x9aa8('0x10')](function(_0x3e5863){logger[_0x9aa8('0x11')](_0x9aa8('0x13'),_0x3e5863[_0x9aa8('0x12')],_0x38edff);_0x415d8e(_0x59ad08[_0x9aa8('0x11')](0x1f4,_0x3e5863[_0x9aa8('0x12')]));});});};function checkArrayOfIntervals(_0xf3e34,_0x1220e0){var _0xb969f9=[];return db[_0x9aa8('0x4')][_0x9aa8('0x5')]({'where':{'id':_0xf3e34}})[_0x9aa8('0x16')](function(_0x2fa6cf){_0xb969f9=_0x2fa6cf;return Promise[_0x9aa8('0x17')](_0xb969f9[_0x9aa8('0xa')](function(_0x3a2036){return _0x3a2036[_0x9aa8('0x18')](_0x1220e0);}));})[_0x9aa8('0x16')](function(_0x480ca4){var _0x36b001=_0x480ca4[_0x9aa8('0x19')](function(_0x1b82e1,_0x2c518d){return _0x1b82e1||_0x2c518d;},![]);logger[_0x9aa8('0xc')](util[_0x9aa8('0x1a')](_0x9aa8('0x1b'),_0xb969f9[_0x9aa8('0xa')](function(_0x3c642d){return _0x3c642d['name'];})[_0x9aa8('0x1c')](',\x20'),_0xb969f9[_0x9aa8('0xa')](function(_0x5d4dc2){return _0x5d4dc2['id'];})[_0x9aa8('0x1c')](',\x20')));return _0x36b001;});}function checkSingleInterval(_0x1bf9c6,_0xf9a911){return db[_0x9aa8('0x4')]['findById'](_0x1bf9c6)[_0x9aa8('0x16')](function(_0x4273f7){if(_0x4273f7){logger[_0x9aa8('0xc')](util['format'](_0x9aa8('0x1d'),_0x4273f7[_0x9aa8('0x1e')],_0x4273f7['id']));return _0x4273f7[_0x9aa8('0x18')](_0xf9a911);}});}exports[_0x9aa8('0x1f')]=function(_0x2b937d){var _0x25bd32=_0x2b937d[_0x9aa8('0x20')];var _0x6d2d80=Array['isArray'](_0x2b937d[_0x9aa8('0x21')])?_0x2b937d[_0x9aa8('0x21')]:typeof _0x2b937d[_0x9aa8('0x21')]===_0x9aa8('0x22')?[_0x2b937d[_0x9aa8('0x21')]]:[];var _0x513bfe=_0x2b937d[_0x9aa8('0x23')]||undefined;var _0x308f65=![];if(_0x6d2d80[_0x9aa8('0x24')]){logger[_0x9aa8('0xc')](util['format'](_0x9aa8('0x25'),_0x6d2d80['join'](';\x20')));}if(_0x513bfe){logger[_0x9aa8('0xc')](util[_0x9aa8('0x1a')](_0x9aa8('0x26'),_0x513bfe));}logger[_0x9aa8('0xe')](_0x9aa8('0x27'),_0x308f65);logger[_0x9aa8('0x28')]('IntervalIftime',_0x2b937d);return Promise[_0x9aa8('0x29')]()[_0x9aa8('0x16')](function(){if(Array['isArray'](_0x25bd32)){return checkArrayOfIntervals(_0x25bd32,_0x513bfe);}else if(_0x25bd32){return checkSingleInterval(_0x25bd32,_0x513bfe);}})[_0x9aa8('0x16')](function(_0x464165){var _0x32926f=_0x6d2d80[_0x9aa8('0x19')](function(_0x1c9c1f,_0x44b548){return _0x1c9c1f||iftime(_0x44b548,_0x513bfe);},![]);_0x308f65=_0x464165||_0x32926f;return _0x308f65;})[_0x9aa8('0x10')](function(_0x1cd0e3){logger[_0x9aa8('0x11')](_0x9aa8('0x1f'),_0x2b937d,_0x1cd0e3);throw this['error'](0x1f4,_0x1cd0e3[_0x9aa8('0x12')]);});}; \ No newline at end of file +var _0xcca7=['catch','error','message','ShowInterval','Interval','find','where','all','ifTime','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','intervalIds','isArray','intervals','string','timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','silly','IntervalIftime','reduce','lodash','../../mysqldb','../../utils/iftime','iftime','rpc','GetInterval','findAll','options','raw','attributes','limit','include','map','model','then','info','debug','stringify'];(function(_0x1ecb87,_0xa987f4){var _0x2ae351=function(_0x2621c4){while(--_0x2621c4){_0x1ecb87['push'](_0x1ecb87['shift']());}};_0x2ae351(++_0xa987f4);}(_0xcca7,0x146));var _0x7cca=function(_0x5f347d,_0x26795e){_0x5f347d=_0x5f347d-0x0;var _0x1a69f6=_0xcca7[_0x5f347d];return _0x1a69f6;};'use strict';var _=require(_0x7cca('0x0'));var util=require('util');var db=require(_0x7cca('0x1'))['db'];var iftime=require(_0x7cca('0x2'))[_0x7cca('0x3')];var logger=require('../../config/logger')(_0x7cca('0x4'));exports[_0x7cca('0x5')]=function(_0x57a409){var _0x5e26f5=this;return new Promise(function(_0xd28fe7,_0x18f56c){return db['Interval'][_0x7cca('0x6')]({'raw':_0x57a409[_0x7cca('0x7')]?_0x57a409[_0x7cca('0x7')][_0x7cca('0x8')]===undefined?!![]:![]:!![],'where':_0x57a409[_0x7cca('0x7')]?_0x57a409[_0x7cca('0x7')]['where']||null:null,'attributes':_0x57a409[_0x7cca('0x7')]?_0x57a409[_0x7cca('0x7')][_0x7cca('0x9')]||null:null,'limit':_0x57a409[_0x7cca('0x7')]?_0x57a409['options'][_0x7cca('0xa')]||null:null,'include':_0x57a409[_0x7cca('0x7')]?_0x57a409['options'][_0x7cca('0xb')]?_[_0x7cca('0xc')](_0x57a409['options'][_0x7cca('0xb')],function(_0x11c2d8){return{'model':db[_0x11c2d8[_0x7cca('0xd')]],'as':_0x11c2d8['as'],'attributes':_0x11c2d8[_0x7cca('0x9')],'include':_0x11c2d8[_0x7cca('0xb')]?_[_0x7cca('0xc')](_0x11c2d8[_0x7cca('0xb')],function(_0x3faf93){return{'model':db[_0x3faf93[_0x7cca('0xd')]],'as':_0x3faf93['as'],'attributes':_0x3faf93['attributes'],'include':_0x3faf93[_0x7cca('0xb')]?_['map'](_0x3faf93[_0x7cca('0xb')],function(_0x5c32a3){return{'model':db[_0x5c32a3[_0x7cca('0xd')]],'as':_0x5c32a3['as'],'attributes':_0x5c32a3[_0x7cca('0x9')]};}):[]};}):[]};}):[]:[]})[_0x7cca('0xe')](function(_0x46524d){logger[_0x7cca('0xf')]('GetInterval',_0x57a409);logger[_0x7cca('0x10')]('GetInterval',_0x57a409,JSON[_0x7cca('0x11')](_0x46524d));_0xd28fe7(_0x46524d);})[_0x7cca('0x12')](function(_0x10b841){logger[_0x7cca('0x13')](_0x7cca('0x5'),_0x10b841[_0x7cca('0x14')],_0x57a409);_0x18f56c(_0x5e26f5[_0x7cca('0x13')](0x1f4,_0x10b841[_0x7cca('0x14')]));});});};exports[_0x7cca('0x15')]=function(_0x4e3645){var _0x3d5157=this;return new Promise(function(_0x3af5d6,_0x11cb00){return db[_0x7cca('0x16')][_0x7cca('0x17')]({'raw':_0x4e3645[_0x7cca('0x7')]?_0x4e3645[_0x7cca('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x4e3645[_0x7cca('0x7')]?_0x4e3645[_0x7cca('0x7')][_0x7cca('0x18')]||null:null,'attributes':_0x4e3645[_0x7cca('0x7')]?_0x4e3645['options'][_0x7cca('0x9')]||null:null,'include':_0x4e3645[_0x7cca('0x7')]?_0x4e3645[_0x7cca('0x7')][_0x7cca('0xb')]?_['map'](_0x4e3645[_0x7cca('0x7')][_0x7cca('0xb')],function(_0x52797c){return{'model':db[_0x52797c[_0x7cca('0xd')]],'as':_0x52797c['as'],'attributes':_0x52797c['attributes'],'include':_0x52797c['include']?_[_0x7cca('0xc')](_0x52797c['include'],function(_0x167adf){return{'model':db[_0x167adf[_0x7cca('0xd')]],'as':_0x167adf['as'],'attributes':_0x167adf['attributes'],'include':_0x167adf[_0x7cca('0xb')]?_[_0x7cca('0xc')](_0x167adf[_0x7cca('0xb')],function(_0x26476a){return{'model':db[_0x26476a['model']],'as':_0x26476a['as'],'attributes':_0x26476a[_0x7cca('0x9')]};}):[]};}):[]};}):[]:[]})[_0x7cca('0xe')](function(_0x2f2556){logger[_0x7cca('0xf')]('ShowInterval',_0x4e3645);logger[_0x7cca('0x10')](_0x7cca('0x15'),_0x4e3645,JSON[_0x7cca('0x11')](_0x2f2556));_0x3af5d6(_0x2f2556);})[_0x7cca('0x12')](function(_0xbdf5f6){logger[_0x7cca('0x13')](_0x7cca('0x15'),_0xbdf5f6[_0x7cca('0x14')],_0x4e3645);_0x11cb00(_0x3d5157['error'](0x1f4,_0xbdf5f6[_0x7cca('0x14')]));});});};function checkArrayOfIntervals(_0x575138,_0x114cef){var _0x3a5afb=[];return db[_0x7cca('0x16')]['findAll']({'where':{'id':_0x575138}})[_0x7cca('0xe')](function(_0x283ce7){_0x3a5afb=_0x283ce7;return Promise[_0x7cca('0x19')](_0x3a5afb[_0x7cca('0xc')](function(_0x2346bb){return _0x2346bb[_0x7cca('0x1a')](_0x114cef);}));})[_0x7cca('0xe')](function(_0x3610ad){var _0x561de3=_0x3610ad['reduce'](function(_0xfac1a3,_0x1efeb5){return _0xfac1a3||_0x1efeb5;},![]);logger[_0x7cca('0xf')](util[_0x7cca('0x1b')](_0x7cca('0x1c'),_0x3a5afb['map'](function(_0x21ebcb){return _0x21ebcb[_0x7cca('0x1d')];})[_0x7cca('0x1e')](',\x20'),_0x3a5afb[_0x7cca('0xc')](function(_0x54fe42){return _0x54fe42['id'];})['join'](',\x20')));return _0x561de3;});}function checkSingleInterval(_0xdc7ba3,_0x29f5ec){return db['Interval'][_0x7cca('0x1f')](_0xdc7ba3)[_0x7cca('0xe')](function(_0x3a62a8){if(_0x3a62a8){logger[_0x7cca('0xf')](util[_0x7cca('0x1b')](_0x7cca('0x20'),_0x3a62a8[_0x7cca('0x1d')],_0x3a62a8['id']));return _0x3a62a8['ifTime'](_0x29f5ec);}});}exports['IntervalIftime']=function(_0x12be17){var _0x2b3811=_0x12be17[_0x7cca('0x21')];var _0x2e5b41=Array[_0x7cca('0x22')](_0x12be17[_0x7cca('0x23')])?_0x12be17[_0x7cca('0x23')]:typeof _0x12be17[_0x7cca('0x23')]===_0x7cca('0x24')?[_0x12be17[_0x7cca('0x23')]]:[];var _0x54e433=_0x12be17[_0x7cca('0x25')]||undefined;var _0x1e3ac7=![];if(_0x2e5b41['length']){logger[_0x7cca('0xf')](util['format'](_0x7cca('0x26'),_0x2e5b41['join'](';\x20')));}if(_0x54e433){logger[_0x7cca('0xf')](util[_0x7cca('0x1b')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x54e433));}logger[_0x7cca('0x10')](_0x7cca('0x27'),_0x1e3ac7);logger[_0x7cca('0x28')](_0x7cca('0x29'),_0x12be17);return Promise['resolve']()[_0x7cca('0xe')](function(){if(Array['isArray'](_0x2b3811)){return checkArrayOfIntervals(_0x2b3811,_0x54e433);}else if(_0x2b3811){return checkSingleInterval(_0x2b3811,_0x54e433);}})[_0x7cca('0xe')](function(_0x5ab7c5){var _0x4423e3=_0x2e5b41[_0x7cca('0x2a')](function(_0x32d559,_0xaab185){return _0x32d559||iftime(_0xaab185,_0x54e433);},![]);_0x1e3ac7=_0x5ab7c5||_0x4423e3;return _0x1e3ac7;})[_0x7cca('0x12')](function(_0x59e28a){logger[_0x7cca('0x13')]('IntervalIftime',_0x12be17,_0x59e28a);throw this[_0x7cca('0x13')](0x1f4,_0x59e28a[_0x7cca('0x14')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index cc1f222..8eb33c3 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x2703b4,_0x327991){var _0x394cdf=function(_0x23c129){while(--_0x23c129){_0x2703b4['push'](_0x2703b4['shift']());}};_0x394cdf(++_0x327991);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2f3254,_0x2a7ac1){_0x2f3254=_0x2f3254-0x0;var _0x1309e5=_0x5f2f[_0x2f3254];return _0x1309e5;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x47258f,_0x2073e6){var _0x5897cd=function(_0x5e2f39){while(--_0x5e2f39){_0x47258f['push'](_0x47258f['shift']());}};_0x5897cd(++_0x2073e6);}(_0x2ef3,0xba));var _0x32ef=function(_0x556da8,_0x15d169){_0x556da8=_0x556da8-0x0;var _0x7cb570=_0x2ef3[_0x556da8];return _0x7cb570;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index c2fd3b4..db0e05b 100644 --- a/server/api/jira/jira.controller.js +++ b/server/api/jira/jira.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc10=['track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','remoteAddress','socket','connection','bluebird','api','support','key','MOTGUI','summary','Report','description','stringify','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11503','name','reason','customfield_10102'];(function(_0x147c73,_0x3cbc12){var _0x46b494=function(_0x421900){while(--_0x421900){_0x147c73['push'](_0x147c73['shift']());}};_0x46b494(++_0x3cbc12);}(_0xcc10,0xfb));var _0x0cc1=function(_0x4d8eaa,_0xab041){_0x4d8eaa=_0x4d8eaa-0x0;var _0x4208e5=_0xcc10[_0x4d8eaa];return _0x4208e5;};'use strict';var BPromise=require(_0x0cc1('0x0'));var https=require('https');var logger=require('../../config/logger')(_0x0cc1('0x1'));var USERNAME=_0x0cc1('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x4fc7e1,_0x297430){var _0x19219d={'fields':{'project':{'key':_0x4fc7e1[_0x0cc1('0x3')]||_0x0cc1('0x4')},'summary':(_0x4fc7e1[_0x0cc1('0x5')]||_0x0cc1('0x6'))+'\x20from\x20'+_0x4fc7e1['ip'],'description':_0x4fc7e1[_0x0cc1('0x7')]||JSON[_0x0cc1('0x8')](_0x4fc7e1),'issuetype':{'name':_0x4fc7e1['issuetype']||_0x0cc1('0x9')}}};_0x19219d[_0x0cc1('0xa')][_0x0cc1('0xb')]=_0x4fc7e1[_0x0cc1('0xc')];_0x19219d['fields'][_0x0cc1('0xd')]=_0x4fc7e1[_0x0cc1('0xe')];_0x19219d['fields']['customfield_11502']=_0x4fc7e1['newToken'];_0x19219d['fields'][_0x0cc1('0xf')]=_0x4fc7e1[_0x0cc1('0x10')];_0x19219d['fields']['customfield_11504']=_0x4fc7e1[_0x0cc1('0x11')];_0x19219d['fields'][_0x0cc1('0x12')]=_0x4fc7e1['ip'];var _0x5b56a9={'host':_0x0cc1('0x13'),'port':0x1bb,'path':_0x0cc1('0x14'),'method':_0x0cc1('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x0cc1('0x16'),'Authorization':_0x0cc1('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x0cc1('0x18')](_0x0cc1('0x19'))}};var _0x3328d1=JSON[_0x0cc1('0x8')](_0x19219d);var _0xb0db37=https[_0x0cc1('0x1a')](_0x5b56a9,function(_0x54d1a8){_0x54d1a8[_0x0cc1('0x1b')](_0x0cc1('0x1c'));var _0x38d03c='';_0x54d1a8['on'](_0x0cc1('0x1d'),function(_0x4d9a42){_0x38d03c+=_0x4d9a42;});_0x54d1a8['on'](_0x0cc1('0x1e'),function(){if(_0x297430){return _0x297430[_0x0cc1('0x1f')](_0x54d1a8[_0x0cc1('0x20')])[_0x0cc1('0x21')](JSON[_0x0cc1('0x22')](_0x38d03c));}});});_0xb0db37['on'](_0x0cc1('0x23'),function(_0x2ca9fb){if(_0x297430){return _0x297430[_0x0cc1('0x1f')](0x1f4)['json']({'errors':[{'message':_0x0cc1('0x24'),'type':_0x0cc1('0x25')}]});}});_0xb0db37[_0x0cc1('0x26')](_0x3328d1);_0xb0db37[_0x0cc1('0x1e')]();}exports[_0x0cc1('0x27')]=openIssue;exports['send']=function(_0x216b99,_0xda8a59){_0x216b99[_0x0cc1('0x28')]['ip']=_0x216b99[_0x0cc1('0x29')]['x-forwarded-for']||_0x216b99['connection'][_0x0cc1('0x2a')]||_0x216b99[_0x0cc1('0x2b')][_0x0cc1('0x2a')]||_0x216b99[_0x0cc1('0x2c')][_0x0cc1('0x2b')]['remoteAddress'];return openIssue(_0x216b99['body'],_0xda8a59);}; \ No newline at end of file +var _0xa32f=['issuetype','customfield_11500','email','fields','customfield_11501','oldToken','newToken','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','toString','utf8','data','status','statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','openIssue','body','headers','x-forwarded-for','connection','socket','remoteAddress','bluebird','https','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','description','stringify'];(function(_0x26baba,_0x15b482){var _0x3951b0=function(_0x4c653){while(--_0x4c653){_0x26baba['push'](_0x26baba['shift']());}};_0x3951b0(++_0x15b482);}(_0xa32f,0x181));var _0xfa32=function(_0x469f93,_0x2a2c71){_0x469f93=_0x469f93-0x0;var _0x465f36=_0xa32f[_0x469f93];return _0x465f36;};'use strict';var BPromise=require(_0xfa32('0x0'));var https=require(_0xfa32('0x1'));var logger=require('../../config/logger')(_0xfa32('0x2'));var USERNAME=_0xfa32('0x3');var PASSWORD=_0xfa32('0x4');function openIssue(_0x568643,_0x4e35d6){var _0x254f3d={'fields':{'project':{'key':_0x568643[_0xfa32('0x5')]||_0xfa32('0x6')},'summary':(_0x568643[_0xfa32('0x7')]||_0xfa32('0x8'))+'\x20from\x20'+_0x568643['ip'],'description':_0x568643[_0xfa32('0x9')]||JSON[_0xfa32('0xa')](_0x568643),'issuetype':{'name':_0x568643[_0xfa32('0xb')]||'Bug'}}};_0x254f3d['fields'][_0xfa32('0xc')]=_0x568643[_0xfa32('0xd')];_0x254f3d[_0xfa32('0xe')][_0xfa32('0xf')]=_0x568643[_0xfa32('0x10')];_0x254f3d[_0xfa32('0xe')]['customfield_11502']=_0x568643[_0xfa32('0x11')];_0x254f3d['fields']['customfield_11503']=_0x568643[_0xfa32('0x12')];_0x254f3d[_0xfa32('0xe')][_0xfa32('0x13')]=_0x568643[_0xfa32('0x14')];_0x254f3d[_0xfa32('0xe')][_0xfa32('0x15')]=_0x568643['ip'];var _0x110393={'host':_0xfa32('0x16'),'port':0x1bb,'path':_0xfa32('0x17'),'method':_0xfa32('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0xfa32('0x19'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xfa32('0x1a')]('base64')}};var _0x1f3d57=JSON['stringify'](_0x254f3d);var _0x4adfa3=https['request'](_0x110393,function(_0x46b16c){_0x46b16c['setEncoding'](_0xfa32('0x1b'));var _0x3b8ed6='';_0x46b16c['on'](_0xfa32('0x1c'),function(_0x47c151){_0x3b8ed6+=_0x47c151;});_0x46b16c['on']('end',function(){if(_0x4e35d6){return _0x4e35d6[_0xfa32('0x1d')](_0x46b16c[_0xfa32('0x1e')])[_0xfa32('0x1f')](JSON['parse'](_0x3b8ed6));}});});_0x4adfa3['on'](_0xfa32('0x20'),function(_0x53577e){if(_0x4e35d6){return _0x4e35d6['status'](0x1f4)[_0xfa32('0x1f')]({'errors':[{'message':_0xfa32('0x21'),'type':_0xfa32('0x22')}]});}});_0x4adfa3[_0xfa32('0x23')](_0x1f3d57);_0x4adfa3[_0xfa32('0x24')]();}exports[_0xfa32('0x25')]=openIssue;exports['send']=function(_0x109fa3,_0x1f8f7e){_0x109fa3[_0xfa32('0x26')]['ip']=_0x109fa3[_0xfa32('0x27')][_0xfa32('0x28')]||_0x109fa3[_0xfa32('0x29')]['remoteAddress']||_0x109fa3[_0xfa32('0x2a')][_0xfa32('0x2b')]||_0x109fa3[_0xfa32('0x29')][_0xfa32('0x2a')][_0xfa32('0x2b')];return openIssue(_0x109fa3[_0xfa32('0x26')],_0x1f8f7e);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 929eeb2..a6c12e6 100644 --- a/server/api/jscriptyAnswerReport/index.js +++ b/server/api/jscriptyAnswerReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4522=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','path','connect-timeout','express','fs-extra'];(function(_0xe3c2e4,_0x3100c9){var _0x35afb6=function(_0x4c3fc7){while(--_0x4c3fc7){_0xe3c2e4['push'](_0xe3c2e4['shift']());}};_0x35afb6(++_0x3100c9);}(_0x4522,0x1a0));var _0x2452=function(_0x2e4b84,_0x2092ce){_0x2e4b84=_0x2e4b84-0x0;var _0x38af1e=_0x4522[_0x2e4b84];return _0x38af1e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2452('0x0'));var timeout=require(_0x2452('0x1'));var express=require(_0x2452('0x2'));var router=express['Router']();var fs_extra=require(_0x2452('0x3'));var auth=require(_0x2452('0x4'));var interaction=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var controller=require(_0x2452('0x7'));router[_0x2452('0x8')]('/',auth[_0x2452('0x9')](),controller[_0x2452('0xa')]);router[_0x2452('0x8')](_0x2452('0xb'),auth[_0x2452('0x9')](),controller[_0x2452('0xc')]);router[_0x2452('0x8')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2452('0xf')]);router['put']('/:id',auth[_0x2452('0x9')](),controller[_0x2452('0x10')]);router[_0x2452('0x11')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0x12')]);module[_0x2452('0x13')]=router; \ No newline at end of file +var _0xa75b=['isAuthenticated','index','/describe','show','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get'];(function(_0x34858a,_0x7847e1){var _0x5c122c=function(_0x126017){while(--_0x126017){_0x34858a['push'](_0x34858a['shift']());}};_0x5c122c(++_0x7847e1);}(_0xa75b,0x170));var _0xba75=function(_0x310187,_0x25485a){_0x310187=_0x310187-0x0;var _0x30cad0=_0xa75b[_0x310187];return _0x30cad0;};'use strict';var multer=require(_0xba75('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba75('0x1'));var express=require(_0xba75('0x2'));var router=express[_0xba75('0x3')]();var fs_extra=require(_0xba75('0x4'));var auth=require(_0xba75('0x5'));var interaction=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var controller=require(_0xba75('0x8'));router[_0xba75('0x9')]('/',auth[_0xba75('0xa')](),controller[_0xba75('0xb')]);router[_0xba75('0x9')](_0xba75('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xba75('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xba75('0xd')]);router['post']('/',auth[_0xba75('0xa')](),controller[_0xba75('0xe')]);router[_0xba75('0xf')](_0xba75('0x10'),auth[_0xba75('0xa')](),controller[_0xba75('0x11')]);router[_0xba75('0x12')](_0xba75('0x10'),auth[_0xba75('0xa')](),controller[_0xba75('0x13')]);module[_0xba75('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 15fb5bd..74edf16 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7a54,0x106));var _0x47a5=function(_0x503d2c,_0x379ac1){_0x503d2c=_0x503d2c-0x0;var _0x5a54d6=_0x7a54[_0x503d2c];return _0x5a54d6;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x7a54,0x106));var _0x47a5=function(_0x14bf1e,_0x1fbaf8){_0x14bf1e=_0x14bf1e-0x0;var _0x5e952a=_0x7a54[_0x14bf1e];return _0x5e952a;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 262cfb5..e05fdaf 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3fa4=['model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','intersection','length','find','create','body','params','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key'];(function(_0xc1ed4,_0x27ba12){var _0x1685ff=function(_0xe04956){while(--_0xe04956){_0xc1ed4['push'](_0xc1ed4['shift']());}};_0x1685ff(++_0x27ba12);}(_0x3fa4,0xf0));var _0x43fa=function(_0x236c43,_0x36f5f3){_0x236c43=_0x236c43-0x0;var _0x382c05=_0x3fa4[_0x236c43];return _0x382c05;};'use strict';var emlformat=require(_0x43fa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x43fa('0x1'));var moment=require(_0x43fa('0x2'));var BPromise=require(_0x43fa('0x3'));var Mustache=require(_0x43fa('0x4'));var util=require(_0x43fa('0x5'));var path=require(_0x43fa('0x6'));var sox=require(_0x43fa('0x7'));var csv=require('to-csv');var ejs=require(_0x43fa('0x8'));var fs=require('fs');var fs_extra=require(_0x43fa('0x9'));var _=require(_0x43fa('0xa'));var squel=require('squel');var crypto=require(_0x43fa('0xb'));var jsforce=require(_0x43fa('0xc'));var deskjs=require(_0x43fa('0xd'));var toCsv=require('to-csv');var querystring=require(_0x43fa('0xe'));var Papa=require(_0x43fa('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43fa('0x10'));var as=require(_0x43fa('0x11'));var hardwareService=require(_0x43fa('0x12'));var logger=require(_0x43fa('0x13'))(_0x43fa('0x14'));var utils=require('../../config/utils');var config=require(_0x43fa('0x15'));var licenseUtil=require(_0x43fa('0x16'));var db=require(_0x43fa('0x17'))['db'];function respondWithStatusCode(_0x582ec2,_0xfbf89e){_0xfbf89e=_0xfbf89e||0xcc;return function(_0x4353c1){if(_0x4353c1){return _0x582ec2[_0x43fa('0x18')](_0xfbf89e);}return _0x582ec2['status'](_0xfbf89e)[_0x43fa('0x19')]();};}function respondWithResult(_0x4bb4b0,_0x5bc292){_0x5bc292=_0x5bc292||0xc8;return function(_0x4fba54){if(_0x4fba54){return _0x4bb4b0[_0x43fa('0x1a')](_0x5bc292)['json'](_0x4fba54);}};}function respondWithFilteredResult(_0x1a898a,_0x12ae9e){return function(_0x4a07b5){if(_0x4a07b5){var _0x27b87f=typeof _0x12ae9e[_0x43fa('0x1b')]===_0x43fa('0x1c')&&typeof _0x12ae9e[_0x43fa('0x1d')]===_0x43fa('0x1c');var _0x53c04c=_0x4a07b5['count'];var _0x479d81=_0x27b87f?0x0:_0x12ae9e[_0x43fa('0x1b')];var _0x29b8aa=_0x27b87f?_0x4a07b5[_0x43fa('0x1e')]:_0x12ae9e[_0x43fa('0x1b')]+_0x12ae9e[_0x43fa('0x1d')];var _0x15e594;if(_0x29b8aa>=_0x53c04c){_0x29b8aa=_0x53c04c;_0x15e594=0xc8;}else{_0x15e594=0xce;}_0x1a898a[_0x43fa('0x1a')](_0x15e594);return _0x1a898a[_0x43fa('0x1f')](_0x43fa('0x20'),_0x479d81+'-'+_0x29b8aa+'/'+_0x53c04c)['json'](_0x4a07b5);}return null;};}function patchUpdates(_0xfd8d3){return function(_0x551528){try{jsonpatch[_0x43fa('0x21')](_0x551528,_0xfd8d3,!![]);}catch(_0x319cfd){return BPromise[_0x43fa('0x22')](_0x319cfd);}return _0x551528['save']();};}function saveUpdates(_0x2c6075,_0x3c78fb){return function(_0x2db3dd){if(_0x2db3dd){return _0x2db3dd[_0x43fa('0x23')](_0x2c6075)[_0x43fa('0x24')](function(_0x1d3328){return _0x1d3328;});}return null;};}function removeEntity(_0x3b8cb9,_0x241948){return function(_0x427426){if(_0x427426){return _0x427426['destroy']()['then'](function(){_0x3b8cb9[_0x43fa('0x1a')](0xcc)[_0x43fa('0x19')]();});}};}function handleEntityNotFound(_0x28f695,_0x78f105){return function(_0x40969a){if(!_0x40969a){_0x28f695[_0x43fa('0x18')](0x194);}return _0x40969a;};}function handleError(_0x5014fb,_0x4f6101){_0x4f6101=_0x4f6101||0x1f4;return function(_0x1fa077){logger[_0x43fa('0x25')](_0x1fa077[_0x43fa('0x26')]);if(_0x1fa077[_0x43fa('0x27')]){delete _0x1fa077['name'];}_0x5014fb[_0x43fa('0x1a')](_0x4f6101)[_0x43fa('0x28')](_0x1fa077);};}exports[_0x43fa('0x29')]=function(_0x186249,_0x4d6c8c){var _0x3d5abd={},_0x44fdef={},_0x398c44={'count':0x0,'rows':[]};var _0x28b833=_[_0x43fa('0x2a')](db[_0x43fa('0x2b')][_0x43fa('0x2c')],function(_0x41a3cf){return{'name':_0x41a3cf[_0x43fa('0x2d')],'type':_0x41a3cf[_0x43fa('0x2e')][_0x43fa('0x2f')]};});_0x44fdef[_0x43fa('0x30')]=_['map'](_0x28b833,'name');_0x44fdef[_0x43fa('0x31')]=_[_0x43fa('0x32')](_0x186249[_0x43fa('0x31')]);_0x44fdef[_0x43fa('0x33')]=_['intersection'](_0x44fdef[_0x43fa('0x30')],_0x44fdef[_0x43fa('0x31')]);_0x3d5abd[_0x43fa('0x34')]=_['intersection'](_0x44fdef[_0x43fa('0x30')],qs[_0x43fa('0x35')](_0x186249[_0x43fa('0x31')][_0x43fa('0x35')]));_0x3d5abd['attributes']=_0x3d5abd[_0x43fa('0x34')]['length']?_0x3d5abd[_0x43fa('0x34')]:_0x44fdef[_0x43fa('0x30')];if(!_0x186249[_0x43fa('0x31')]['hasOwnProperty'](_0x43fa('0x36'))){_0x3d5abd['limit']=qs['limit'](_0x186249[_0x43fa('0x31')][_0x43fa('0x1d')]);_0x3d5abd[_0x43fa('0x1b')]=qs['offset'](_0x186249[_0x43fa('0x31')][_0x43fa('0x1b')]);}_0x3d5abd[_0x43fa('0x37')]=qs[_0x43fa('0x38')](_0x186249[_0x43fa('0x31')]['sort']);_0x3d5abd[_0x43fa('0x39')]=qs[_0x43fa('0x33')](_[_0x43fa('0x3a')](_0x186249[_0x43fa('0x31')],_0x44fdef['filters']),_0x28b833);if(_0x186249['query'][_0x43fa('0x3b')]){_0x3d5abd[_0x43fa('0x39')]=_[_0x43fa('0x3c')](_0x3d5abd[_0x43fa('0x39')],{'$or':_[_0x43fa('0x2a')](_0x28b833,function(_0x595d49){if(_0x595d49[_0x43fa('0x2e')]!=='VIRTUAL'){var _0x4cb1bd={};_0x4cb1bd[_0x595d49[_0x43fa('0x27')]]={'$like':'%'+_0x186249['query'][_0x43fa('0x3b')]+'%'};return _0x4cb1bd;}})});}_0x3d5abd=_[_0x43fa('0x3c')]({},_0x3d5abd,_0x186249[_0x43fa('0x3d')]);var _0x17403c={'where':_0x3d5abd['where']};return db['JscriptyAnswerReport']['count'](_0x17403c)[_0x43fa('0x24')](function(_0x15ef49){_0x398c44['count']=_0x15ef49;if(_0x186249[_0x43fa('0x31')][_0x43fa('0x3e')]){_0x3d5abd[_0x43fa('0x3f')]=[{'all':!![]}];}return db[_0x43fa('0x2b')]['findAll'](_0x3d5abd);})[_0x43fa('0x24')](function(_0x23e156){_0x398c44['rows']=_0x23e156;return _0x398c44;})['then'](respondWithFilteredResult(_0x4d6c8c,_0x3d5abd))[_0x43fa('0x40')](handleError(_0x4d6c8c,null));};exports['show']=function(_0x3a6d39,_0x137ef){var _0x5cef1e={'raw':!![],'where':{'id':_0x3a6d39['params']['id']}},_0x4735d1={};_0x4735d1[_0x43fa('0x30')]=_[_0x43fa('0x32')](db[_0x43fa('0x2b')]['rawAttributes']);_0x4735d1[_0x43fa('0x31')]=_[_0x43fa('0x32')](_0x3a6d39[_0x43fa('0x31')]);_0x4735d1[_0x43fa('0x33')]=_[_0x43fa('0x41')](_0x4735d1[_0x43fa('0x30')],_0x4735d1['query']);_0x5cef1e[_0x43fa('0x34')]=_['intersection'](_0x4735d1[_0x43fa('0x30')],qs['fields'](_0x3a6d39[_0x43fa('0x31')][_0x43fa('0x35')]));_0x5cef1e[_0x43fa('0x34')]=_0x5cef1e[_0x43fa('0x34')][_0x43fa('0x42')]?_0x5cef1e['attributes']:_0x4735d1[_0x43fa('0x30')];if(_0x3a6d39['query']['includeAll']){_0x5cef1e['include']=[{'all':!![]}];}_0x5cef1e=_[_0x43fa('0x3c')]({},_0x5cef1e,_0x3a6d39[_0x43fa('0x3d')]);return db[_0x43fa('0x2b')][_0x43fa('0x43')](_0x5cef1e)[_0x43fa('0x24')](handleEntityNotFound(_0x137ef,null))['then'](respondWithResult(_0x137ef,null))[_0x43fa('0x40')](handleError(_0x137ef,null));};exports[_0x43fa('0x44')]=function(_0x305e90,_0x19b0f0){return db[_0x43fa('0x2b')][_0x43fa('0x44')](_0x305e90[_0x43fa('0x45')],{})[_0x43fa('0x24')](respondWithResult(_0x19b0f0,0xc9))[_0x43fa('0x40')](handleError(_0x19b0f0,null));};exports[_0x43fa('0x23')]=function(_0x1ae6e0,_0x52d66f){if(_0x1ae6e0[_0x43fa('0x45')]['id']){delete _0x1ae6e0[_0x43fa('0x45')]['id'];}return db['JscriptyAnswerReport'][_0x43fa('0x43')]({'where':{'id':_0x1ae6e0['params']['id']}})[_0x43fa('0x24')](handleEntityNotFound(_0x52d66f,null))[_0x43fa('0x24')](saveUpdates(_0x1ae6e0[_0x43fa('0x45')],null))[_0x43fa('0x24')](respondWithResult(_0x52d66f,null))[_0x43fa('0x40')](handleError(_0x52d66f,null));};exports['destroy']=function(_0x1bbae4,_0x4a24f1){return db[_0x43fa('0x2b')][_0x43fa('0x43')]({'where':{'id':_0x1bbae4[_0x43fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a24f1,null))['then'](removeEntity(_0x4a24f1,null))[_0x43fa('0x40')](handleError(_0x4a24f1,null));};exports['describe']=function(_0x2ca431,_0x574076){return db['JscriptyAnswerReport'][_0x43fa('0x47')]()[_0x43fa('0x24')](respondWithResult(_0x574076,null))['catch'](handleError(_0x574076,null));}; \ No newline at end of file +var _0x979e=['hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','update','then','destroy','error','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','length'];(function(_0x1bf03c,_0x41d364){var _0x176b4f=function(_0x43ec16){while(--_0x43ec16){_0x1bf03c['push'](_0x1bf03c['shift']());}};_0x176b4f(++_0x41d364);}(_0x979e,0x195));var _0xe979=function(_0x5391ba,_0x2be23e){_0x5391ba=_0x5391ba-0x0;var _0xb76679=_0x979e[_0x5391ba];return _0xb76679;};'use strict';var emlformat=require(_0xe979('0x0'));var rimraf=require(_0xe979('0x1'));var zipdir=require(_0xe979('0x2'));var jsonpatch=require(_0xe979('0x3'));var rp=require('request-promise');var moment=require(_0xe979('0x4'));var BPromise=require(_0xe979('0x5'));var Mustache=require(_0xe979('0x6'));var util=require(_0xe979('0x7'));var path=require(_0xe979('0x8'));var sox=require('sox');var csv=require(_0xe979('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe979('0xa'));var _=require(_0xe979('0xb'));var squel=require(_0xe979('0xc'));var crypto=require(_0xe979('0xd'));var jsforce=require(_0xe979('0xe'));var deskjs=require(_0xe979('0xf'));var toCsv=require(_0xe979('0x9'));var querystring=require(_0xe979('0x10'));var Papa=require(_0xe979('0x11'));var Redis=require(_0xe979('0x12'));var authService=require(_0xe979('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe979('0x14'));var hardwareService=require(_0xe979('0x15'));var logger=require(_0xe979('0x16'))('api');var utils=require(_0xe979('0x17'));var config=require(_0xe979('0x18'));var licenseUtil=require(_0xe979('0x19'));var db=require(_0xe979('0x1a'))['db'];function respondWithStatusCode(_0x2f76cb,_0x1170c6){_0x1170c6=_0x1170c6||0xcc;return function(_0x76e6e5){if(_0x76e6e5){return _0x2f76cb[_0xe979('0x1b')](_0x1170c6);}return _0x2f76cb['status'](_0x1170c6)[_0xe979('0x1c')]();};}function respondWithResult(_0x3b2b92,_0x1f7a6d){_0x1f7a6d=_0x1f7a6d||0xc8;return function(_0x4c56eb){if(_0x4c56eb){return _0x3b2b92['status'](_0x1f7a6d)[_0xe979('0x1d')](_0x4c56eb);}};}function respondWithFilteredResult(_0x265080,_0x1ae6a2){return function(_0x218ce0){if(_0x218ce0){var _0x49de62=typeof _0x1ae6a2[_0xe979('0x1e')]===_0xe979('0x1f')&&typeof _0x1ae6a2[_0xe979('0x20')]===_0xe979('0x1f');var _0x20d50a=_0x218ce0[_0xe979('0x21')];var _0x104a7b=_0x49de62?0x0:_0x1ae6a2['offset'];var _0x25e06d=_0x49de62?_0x218ce0['count']:_0x1ae6a2['offset']+_0x1ae6a2[_0xe979('0x20')];var _0x2a8ffd;if(_0x25e06d>=_0x20d50a){_0x25e06d=_0x20d50a;_0x2a8ffd=0xc8;}else{_0x2a8ffd=0xce;}_0x265080[_0xe979('0x22')](_0x2a8ffd);return _0x265080[_0xe979('0x23')]('Content-Range',_0x104a7b+'-'+_0x25e06d+'/'+_0x20d50a)[_0xe979('0x1d')](_0x218ce0);}return null;};}function patchUpdates(_0x480fbd){return function(_0x43207c){try{jsonpatch[_0xe979('0x24')](_0x43207c,_0x480fbd,!![]);}catch(_0x27c6fb){return BPromise[_0xe979('0x25')](_0x27c6fb);}return _0x43207c['save']();};}function saveUpdates(_0x19e171,_0x4a2d84){return function(_0x37b1d4){if(_0x37b1d4){return _0x37b1d4[_0xe979('0x26')](_0x19e171)[_0xe979('0x27')](function(_0x52b564){return _0x52b564;});}return null;};}function removeEntity(_0x1b49a1,_0x58f9ac){return function(_0x51e0a0){if(_0x51e0a0){return _0x51e0a0[_0xe979('0x28')]()[_0xe979('0x27')](function(){_0x1b49a1['status'](0xcc)[_0xe979('0x1c')]();});}};}function handleEntityNotFound(_0x5bbfea,_0x45dd65){return function(_0x4bfb4b){if(!_0x4bfb4b){_0x5bbfea[_0xe979('0x1b')](0x194);}return _0x4bfb4b;};}function handleError(_0x3afdab,_0x111fbb){_0x111fbb=_0x111fbb||0x1f4;return function(_0x1a01a9){logger[_0xe979('0x29')](_0x1a01a9['stack']);if(_0x1a01a9[_0xe979('0x2a')]){delete _0x1a01a9[_0xe979('0x2a')];}_0x3afdab[_0xe979('0x22')](_0x111fbb)[_0xe979('0x2b')](_0x1a01a9);};}exports[_0xe979('0x2c')]=function(_0x53ada7,_0x1d8dc7){var _0x413c46={},_0x53ba87={},_0x2d7302={'count':0x0,'rows':[]};var _0x6e1b39=_['map'](db[_0xe979('0x2d')][_0xe979('0x2e')],function(_0x112595){return{'name':_0x112595[_0xe979('0x2f')],'type':_0x112595[_0xe979('0x30')]['key']};});_0x53ba87[_0xe979('0x31')]=_[_0xe979('0x32')](_0x6e1b39,'name');_0x53ba87[_0xe979('0x33')]=_['keys'](_0x53ada7[_0xe979('0x33')]);_0x53ba87[_0xe979('0x34')]=_[_0xe979('0x35')](_0x53ba87[_0xe979('0x31')],_0x53ba87[_0xe979('0x33')]);_0x413c46['attributes']=_['intersection'](_0x53ba87['model'],qs[_0xe979('0x36')](_0x53ada7[_0xe979('0x33')][_0xe979('0x36')]));_0x413c46['attributes']=_0x413c46[_0xe979('0x37')][_0xe979('0x38')]?_0x413c46[_0xe979('0x37')]:_0x53ba87['model'];if(!_0x53ada7[_0xe979('0x33')][_0xe979('0x39')](_0xe979('0x3a'))){_0x413c46[_0xe979('0x20')]=qs[_0xe979('0x20')](_0x53ada7[_0xe979('0x33')][_0xe979('0x20')]);_0x413c46[_0xe979('0x1e')]=qs[_0xe979('0x1e')](_0x53ada7[_0xe979('0x33')][_0xe979('0x1e')]);}_0x413c46[_0xe979('0x3b')]=qs['sort'](_0x53ada7[_0xe979('0x33')][_0xe979('0x3c')]);_0x413c46[_0xe979('0x3d')]=qs[_0xe979('0x34')](_['pick'](_0x53ada7[_0xe979('0x33')],_0x53ba87['filters']),_0x6e1b39);if(_0x53ada7[_0xe979('0x33')][_0xe979('0x3e')]){_0x413c46['where']=_[_0xe979('0x3f')](_0x413c46['where'],{'$or':_['map'](_0x6e1b39,function(_0x4fb547){if(_0x4fb547[_0xe979('0x30')]!=='VIRTUAL'){var _0x31aa6f={};_0x31aa6f[_0x4fb547[_0xe979('0x2a')]]={'$like':'%'+_0x53ada7[_0xe979('0x33')][_0xe979('0x3e')]+'%'};return _0x31aa6f;}})});}_0x413c46=_[_0xe979('0x3f')]({},_0x413c46,_0x53ada7['options']);var _0x3bc689={'where':_0x413c46[_0xe979('0x3d')]};return db[_0xe979('0x2d')][_0xe979('0x21')](_0x3bc689)[_0xe979('0x27')](function(_0x11d17f){_0x2d7302[_0xe979('0x21')]=_0x11d17f;if(_0x53ada7[_0xe979('0x33')][_0xe979('0x40')]){_0x413c46[_0xe979('0x41')]=[{'all':!![]}];}return db[_0xe979('0x2d')][_0xe979('0x42')](_0x413c46);})['then'](function(_0x24f293){_0x2d7302[_0xe979('0x43')]=_0x24f293;return _0x2d7302;})['then'](respondWithFilteredResult(_0x1d8dc7,_0x413c46))[_0xe979('0x44')](handleError(_0x1d8dc7,null));};exports[_0xe979('0x45')]=function(_0x23815b,_0x505ad4){var _0x585aad={'raw':!![],'where':{'id':_0x23815b['params']['id']}},_0x520a6f={};_0x520a6f['model']=_['keys'](db[_0xe979('0x2d')][_0xe979('0x2e')]);_0x520a6f['query']=_[_0xe979('0x46')](_0x23815b[_0xe979('0x33')]);_0x520a6f[_0xe979('0x34')]=_[_0xe979('0x35')](_0x520a6f[_0xe979('0x31')],_0x520a6f['query']);_0x585aad[_0xe979('0x37')]=_[_0xe979('0x35')](_0x520a6f['model'],qs[_0xe979('0x36')](_0x23815b[_0xe979('0x33')][_0xe979('0x36')]));_0x585aad[_0xe979('0x37')]=_0x585aad[_0xe979('0x37')]['length']?_0x585aad[_0xe979('0x37')]:_0x520a6f['model'];if(_0x23815b[_0xe979('0x33')][_0xe979('0x40')]){_0x585aad['include']=[{'all':!![]}];}_0x585aad=_[_0xe979('0x3f')]({},_0x585aad,_0x23815b[_0xe979('0x47')]);return db[_0xe979('0x2d')][_0xe979('0x48')](_0x585aad)[_0xe979('0x27')](handleEntityNotFound(_0x505ad4,null))['then'](respondWithResult(_0x505ad4,null))['catch'](handleError(_0x505ad4,null));};exports[_0xe979('0x49')]=function(_0x3a7945,_0x2a47f6){return db[_0xe979('0x2d')]['create'](_0x3a7945[_0xe979('0x4a')],{})[_0xe979('0x27')](respondWithResult(_0x2a47f6,0xc9))[_0xe979('0x44')](handleError(_0x2a47f6,null));};exports[_0xe979('0x26')]=function(_0x46995e,_0x193c45){if(_0x46995e['body']['id']){delete _0x46995e[_0xe979('0x4a')]['id'];}return db[_0xe979('0x2d')][_0xe979('0x48')]({'where':{'id':_0x46995e[_0xe979('0x4b')]['id']}})[_0xe979('0x27')](handleEntityNotFound(_0x193c45,null))[_0xe979('0x27')](saveUpdates(_0x46995e['body'],null))[_0xe979('0x27')](respondWithResult(_0x193c45,null))[_0xe979('0x44')](handleError(_0x193c45,null));};exports[_0xe979('0x28')]=function(_0x54c57f,_0x4c9ade){return db['JscriptyAnswerReport'][_0xe979('0x48')]({'where':{'id':_0x54c57f[_0xe979('0x4b')]['id']}})[_0xe979('0x27')](handleEntityNotFound(_0x4c9ade,null))['then'](removeEntity(_0x4c9ade,null))['catch'](handleError(_0x4c9ade,null));};exports[_0xe979('0x4c')]=function(_0xdc5b67,_0x28e27d){return db[_0xe979('0x2d')][_0xe979('0x4c')]()[_0xe979('0x27')](respondWithResult(_0x28e27d,null))['catch'](handleError(_0x28e27d,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 668ac46..9eb0237 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd49=['./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment'];(function(_0xc6428,_0x17447b){var _0x2e17b1=function(_0xae5fa7){while(--_0xae5fa7){_0xc6428['push'](_0xc6428['shift']());}};_0x2e17b1(++_0x17447b);}(_0xcd49,0x1cf));var _0x9cd4=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0xcd49[_0x39f34f];return _0x59fee1;};'use strict';var _=require(_0x9cd4('0x0'));var util=require(_0x9cd4('0x1'));var logger=require(_0x9cd4('0x2'))(_0x9cd4('0x3'));var moment=require('moment');var BPromise=require(_0x9cd4('0x4'));var rp=require(_0x9cd4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9cd4('0x6'));var attributes=require(_0x9cd4('0x7'));module[_0x9cd4('0x8')]=function(_0x33a1ef,_0x27fcac){return _0x33a1ef['define'](_0x9cd4('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x478c=['path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x34f273,_0x37a8c3){var _0x1f2544=function(_0x1b9a6b){while(--_0x1b9a6b){_0x34f273['push'](_0x34f273['shift']());}};_0x1f2544(++_0x37a8c3);}(_0x478c,0x132));var _0xc478=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x478c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc478('0x0'));var util=require(_0xc478('0x1'));var logger=require(_0xc478('0x2'))(_0xc478('0x3'));var moment=require('moment');var BPromise=require(_0xc478('0x4'));var rp=require(_0xc478('0x5'));var fs=require('fs');var path=require(_0xc478('0x6'));var rimraf=require(_0xc478('0x7'));var config=require(_0xc478('0x8'));var attributes=require(_0xc478('0x9'));module[_0xc478('0xa')]=function(_0x39c103,_0x15bfb9){return _0x39c103['define'](_0xc478('0xb'),attributes,{'tableName':_0xc478('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index e78ee6d..2ebf680 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4619=['jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0x3783d8,_0x8aad69){var _0x44a863=function(_0x4c4c88){while(--_0x4c4c88){_0x3783d8['push'](_0x3783d8['shift']());}};_0x44a863(++_0x8aad69);}(_0x4619,0x162));var _0x9461=function(_0x4f49bb,_0x45651b){_0x4f49bb=_0x4f49bb-0x0;var _0x2c57db=_0x4619[_0x4f49bb];return _0x2c57db;};'use strict';var _=require(_0x9461('0x0'));var util=require(_0x9461('0x1'));var moment=require('moment');var BPromise=require(_0x9461('0x2'));var rs=require(_0x9461('0x3'));var fs=require('fs');var Redis=require(_0x9461('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9461('0x5'))('rpc');var config=require(_0x9461('0x6'));var jayson=require(_0x9461('0x7'));var client=jayson[_0x9461('0x8')][_0x9461('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f654b,_0x56bdfd,_0x5f0fe7){return new BPromise(function(_0x1d7a3b,_0x1876e8){return client['request'](_0x1f654b,_0x5f0fe7)[_0x9461('0xa')](function(_0x268ff0){logger[_0x9461('0xb')](_0x9461('0xc'),_0x56bdfd,_0x9461('0xd'));logger[_0x9461('0xe')](_0x9461('0xf'),_0x56bdfd,_0x9461('0xd'),JSON['stringify'](_0x268ff0));if(_0x268ff0['error']){if(_0x268ff0[_0x9461('0x10')][_0x9461('0x11')]===0x1f4){logger['error'](_0x9461('0xc'),_0x56bdfd,_0x268ff0[_0x9461('0x10')][_0x9461('0x12')]);return _0x1876e8(_0x268ff0[_0x9461('0x10')][_0x9461('0x12')]);}logger[_0x9461('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x56bdfd,_0x268ff0[_0x9461('0x10')][_0x9461('0x12')]);return _0x1d7a3b(_0x268ff0[_0x9461('0x10')][_0x9461('0x12')]);}else{logger[_0x9461('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x56bdfd,_0x9461('0xd'));_0x1d7a3b(_0x268ff0['result'][_0x9461('0x12')]);}})['catch'](function(_0x28cdfc){logger[_0x9461('0x10')](_0x9461('0xc'),_0x56bdfd,_0x28cdfc);_0x1876e8(_0x28cdfc);});});} \ No newline at end of file +var _0x5027=['stringify','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x5027,0x10e));var _0x7502=function(_0xd9cc3d,_0x1d0065){_0xd9cc3d=_0xd9cc3d-0x0;var _0x2c2613=_0x5027[_0xd9cc3d];return _0x2c2613;};'use strict';var _=require('lodash');var util=require(_0x7502('0x0'));var moment=require('moment');var BPromise=require(_0x7502('0x1'));var rs=require(_0x7502('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7502('0x3'))['db'];var utils=require(_0x7502('0x4'));var logger=require(_0x7502('0x5'))(_0x7502('0x6'));var config=require(_0x7502('0x7'));var jayson=require(_0x7502('0x8'));var client=jayson[_0x7502('0x9')][_0x7502('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e31e9,_0x481385,_0x4bc50b){return new BPromise(function(_0x28ab16,_0x5bbc77){return client[_0x7502('0xb')](_0x4e31e9,_0x4bc50b)[_0x7502('0xc')](function(_0x4c4671){logger[_0x7502('0xd')](_0x7502('0xe'),_0x481385,'request\x20sent');logger[_0x7502('0xf')](_0x7502('0x10'),_0x481385,_0x7502('0x11'),JSON[_0x7502('0x12')](_0x4c4671));if(_0x4c4671[_0x7502('0x13')]){if(_0x4c4671['error'][_0x7502('0x14')]===0x1f4){logger[_0x7502('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x481385,_0x4c4671[_0x7502('0x13')][_0x7502('0x15')]);return _0x5bbc77(_0x4c4671[_0x7502('0x13')][_0x7502('0x15')]);}logger[_0x7502('0x13')](_0x7502('0xe'),_0x481385,_0x4c4671[_0x7502('0x13')]['message']);return _0x28ab16(_0x4c4671[_0x7502('0x13')][_0x7502('0x15')]);}else{logger[_0x7502('0xd')](_0x7502('0xe'),_0x481385,_0x7502('0x11'));_0x28ab16(_0x4c4671[_0x7502('0x16')][_0x7502('0x15')]);}})[_0x7502('0x17')](function(_0xed2c72){logger[_0x7502('0x13')](_0x7502('0xe'),_0x481385,_0xed2c72);_0x5bbc77(_0xed2c72);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 6a4d9bd..e8297bc 100644 --- a/server/api/jscriptyProject/index.js +++ b/server/api/jscriptyProject/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa5e=['get','isAuthenticated','index','/:id','getSessions','/:id/answers','getAnswers','getSummary','post','create','clone','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x835ab1,_0x338f11){var _0x36fabf=function(_0x5e93f9){while(--_0x5e93f9){_0x835ab1['push'](_0x835ab1['shift']());}};_0x36fabf(++_0x338f11);}(_0xaa5e,0xa0));var _0xeaa5=function(_0x2e31a9,_0xbabc7){_0x2e31a9=_0x2e31a9-0x0;var _0x471249=_0xaa5e[_0x2e31a9];return _0x471249;};'use strict';var multer=require(_0xeaa5('0x0'));var util=require('util');var path=require(_0xeaa5('0x1'));var timeout=require(_0xeaa5('0x2'));var express=require(_0xeaa5('0x3'));var router=express[_0xeaa5('0x4')]();var fs_extra=require(_0xeaa5('0x5'));var auth=require(_0xeaa5('0x6'));var interaction=require(_0xeaa5('0x7'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0xeaa5('0x8')]('/',auth[_0xeaa5('0x9')](),controller[_0xeaa5('0xa')]);router[_0xeaa5('0x8')](_0xeaa5('0xb'),auth[_0xeaa5('0x9')](),controller['show']);router[_0xeaa5('0x8')]('/:id/sessions',auth[_0xeaa5('0x9')](),controller[_0xeaa5('0xc')]);router[_0xeaa5('0x8')](_0xeaa5('0xd'),auth['isAuthenticated'](),controller[_0xeaa5('0xe')]);router[_0xeaa5('0x8')]('/:id/summary',auth['isAuthenticated'](),timeout('30s'),controller[_0xeaa5('0xf')]);router[_0xeaa5('0x10')]('/',auth['isAuthenticated'](),controller[_0xeaa5('0x11')]);router[_0xeaa5('0x10')]('/:id/clone',auth[_0xeaa5('0x9')](),controller[_0xeaa5('0x12')]);router['put'](_0xeaa5('0xb'),auth[_0xeaa5('0x9')](),controller['update']);router[_0xeaa5('0x13')](_0xeaa5('0xb'),auth[_0xeaa5('0x9')](),controller['destroy']);module[_0xeaa5('0x14')]=router; \ No newline at end of file +var _0x7208=['clone','put','/:id','destroy','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getSessions','/:id/summary','post','create','/:id/clone'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x7208,0x16d));var _0x8720=function(_0x103998,_0x1cdeba){_0x103998=_0x103998-0x0;var _0x147df7=_0x7208[_0x103998];return _0x147df7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8720('0x0'));var timeout=require('connect-timeout');var express=require(_0x8720('0x1'));var router=express['Router']();var fs_extra=require(_0x8720('0x2'));var auth=require(_0x8720('0x3'));var interaction=require(_0x8720('0x4'));var config=require(_0x8720('0x5'));var controller=require('./jscriptyProject.controller');router[_0x8720('0x6')]('/',auth[_0x8720('0x7')](),controller[_0x8720('0x8')]);router[_0x8720('0x6')]('/:id',auth[_0x8720('0x7')](),controller[_0x8720('0x9')]);router['get']('/:id/sessions',auth['isAuthenticated'](),controller[_0x8720('0xa')]);router[_0x8720('0x6')]('/:id/answers',auth[_0x8720('0x7')](),controller['getAnswers']);router['get'](_0x8720('0xb'),auth[_0x8720('0x7')](),timeout('30s'),controller['getSummary']);router[_0x8720('0xc')]('/',auth[_0x8720('0x7')](),controller[_0x8720('0xd')]);router[_0x8720('0xc')](_0x8720('0xe'),auth[_0x8720('0x7')](),controller[_0x8720('0xf')]);router[_0x8720('0x10')](_0x8720('0x11'),auth[_0x8720('0x7')](),controller['update']);router['delete'](_0x8720('0x11'),auth['isAuthenticated'](),controller[_0x8720('0x12')]);module[_0x8720('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 57281c3..337c743 100644 --- a/server/api/jscriptyProject/jscriptyProject.attributes.js +++ b/server/api/jscriptyProject/jscriptyProject.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5cb=['isString','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify'];(function(_0x23fd63,_0x27b3a3){var _0x3ca68e=function(_0x18f488){while(--_0x18f488){_0x23fd63['push'](_0x23fd63['shift']());}};_0x3ca68e(++_0x27b3a3);}(_0xa5cb,0x194));var _0xba5c=function(_0x2cc36f,_0x185256){_0x2cc36f=_0x2cc36f-0x0;var _0x569ebd=_0xa5cb[_0x2cc36f];return _0x569ebd;};'use strict';var Sequelize=require(_0xba5c('0x0'));var _=require(_0xba5c('0x1'));var util=require(_0xba5c('0x2'));module[_0xba5c('0x3')]={'name':{'type':Sequelize[_0xba5c('0x4')],'unique':_0xba5c('0x5')},'description':{'type':Sequelize[_0xba5c('0x4')]},'formData':{'type':Sequelize[_0xba5c('0x6')](_0xba5c('0x7')),'set':function(_0x34d934){if(_[_0xba5c('0x8')](_0x34d934)){this[_0xba5c('0x9')](_0xba5c('0xa'),JSON[_0xba5c('0xb')](_0x34d934));}else if(_[_0xba5c('0xc')](_0x34d934)){this[_0xba5c('0x9')](_0xba5c('0xa'),_0x34d934);}else{this[_0xba5c('0x9')](_0xba5c('0xa'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xba5c('0xd')](_0xba5c('0x5'))||'',this['getDataValue'](_0xba5c('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xba5c('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8b8d=['setDataValue','formData','stringify','isString','format','getDataValue','name','description','BOOLEAN','sequelize','lodash','exports','STRING','TEXT','long','isObjectLike'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8b8d,0x159));var _0xd8b8=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x8b8d[_0x3de8a4];return _0x4635cf;};'use strict';var Sequelize=require(_0xd8b8('0x0'));var _=require(_0xd8b8('0x1'));var util=require('util');module[_0xd8b8('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xd8b8('0x3')]},'formData':{'type':Sequelize[_0xd8b8('0x4')](_0xd8b8('0x5')),'set':function(_0x1b2da5){if(_[_0xd8b8('0x6')](_0x1b2da5)){this[_0xd8b8('0x7')](_0xd8b8('0x8'),JSON[_0xd8b8('0x9')](_0x1b2da5));}else if(_[_0xd8b8('0xa')](_0x1b2da5)){this[_0xd8b8('0x7')](_0xd8b8('0x8'),_0x1b2da5);}else{this[_0xd8b8('0x7')](_0xd8b8('0x8'),util[_0xd8b8('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xd8b8('0xc')](_0xd8b8('0xd'))||'',this[_0xd8b8('0xc')](_0xd8b8('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xd8b8('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index dbdec12..b7793cf 100644 --- a/server/api/jscriptyProject/jscriptyProject.controller.js +++ b/server/api/jscriptyProject/jscriptyProject.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1184=['role','user','UserProfileSection','userProfileId','autoAssociation','clone','params','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getSessions','findOne','JscriptySessionReport','nolimit','order','ProjectId','getAnswers','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','question','format','questionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','get','Projects','UserProfileResource','error','stack','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x694cf9,_0x4428c4){var _0x3a4604=function(_0x25ccc6){while(--_0x25ccc6){_0x694cf9['push'](_0x694cf9['shift']());}};_0x3a4604(++_0x4428c4);}(_0x1184,0xa0));var _0x4118=function(_0x29462a,_0x28bb1a){_0x29462a=_0x29462a-0x0;var _0x196462=_0x1184[_0x29462a];return _0x196462;};'use strict';var emlformat=require(_0x4118('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4118('0x1'));var jsonpatch=require(_0x4118('0x2'));var rp=require('request-promise');var moment=require(_0x4118('0x3'));var BPromise=require(_0x4118('0x4'));var Mustache=require(_0x4118('0x5'));var util=require(_0x4118('0x6'));var path=require('path');var sox=require(_0x4118('0x7'));var csv=require(_0x4118('0x8'));var ejs=require(_0x4118('0x9'));var fs=require('fs');var fs_extra=require(_0x4118('0xa'));var _=require('lodash');var squel=require(_0x4118('0xb'));var crypto=require(_0x4118('0xc'));var jsforce=require(_0x4118('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4118('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4118('0xf'));var qs=require(_0x4118('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4118('0x11'));var utils=require('../../config/utils');var config=require(_0x4118('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24e172,_0x5439de){_0x5439de=_0x5439de||0xcc;return function(_0x52c3dd){if(_0x52c3dd){return _0x24e172[_0x4118('0x13')](_0x5439de);}return _0x24e172[_0x4118('0x14')](_0x5439de)[_0x4118('0x15')]();};}function respondWithResult(_0x5aeaac,_0x292086){_0x292086=_0x292086||0xc8;return function(_0xc9fee9){if(_0xc9fee9){return _0x5aeaac[_0x4118('0x14')](_0x292086)['json'](_0xc9fee9);}};}function respondWithFilteredResult(_0x30e9e4,_0x5c9b25){return function(_0x18d135){if(_0x18d135){var _0x45ec56=typeof _0x5c9b25[_0x4118('0x16')]==='undefined'&&typeof _0x5c9b25[_0x4118('0x17')]===_0x4118('0x18');var _0x33eb6d=_0x18d135[_0x4118('0x19')];var _0x1fb629=_0x45ec56?0x0:_0x5c9b25['offset'];var _0x2d48ec=_0x45ec56?_0x18d135[_0x4118('0x19')]:_0x5c9b25[_0x4118('0x16')]+_0x5c9b25[_0x4118('0x17')];var _0x1e1824;if(_0x2d48ec>=_0x33eb6d){_0x2d48ec=_0x33eb6d;_0x1e1824=0xc8;}else{_0x1e1824=0xce;}_0x30e9e4['status'](_0x1e1824);return _0x30e9e4[_0x4118('0x1a')](_0x4118('0x1b'),_0x1fb629+'-'+_0x2d48ec+'/'+_0x33eb6d)[_0x4118('0x1c')](_0x18d135);}return null;};}function patchUpdates(_0x545bc9){return function(_0x34c62f){try{jsonpatch[_0x4118('0x1d')](_0x34c62f,_0x545bc9,!![]);}catch(_0x3a0fe0){return BPromise[_0x4118('0x1e')](_0x3a0fe0);}return _0x34c62f[_0x4118('0x1f')]();};}function saveUpdates(_0x2e8dec,_0x5dc4a7){return function(_0x70906e){if(_0x70906e){return _0x70906e[_0x4118('0x20')](_0x2e8dec)[_0x4118('0x21')](function(_0x1ee843){return _0x1ee843;});}return null;};}function removeEntity(_0xa6c615,_0x4b49b0){return function(_0x4af9c5){if(_0x4af9c5){return _0x4af9c5['destroy']()['then'](function(){var _0x5eba49=_0x4af9c5[_0x4118('0x22')]({'plain':!![]});var _0x21aca4=_0x4118('0x23');return db[_0x4118('0x24')]['destroy']({'where':{'type':_0x21aca4,'resourceId':_0x5eba49['id']}})[_0x4118('0x21')](function(){return _0x4af9c5;});})['then'](function(){_0xa6c615[_0x4118('0x14')](0xcc)[_0x4118('0x15')]();});}};}function handleEntityNotFound(_0x8e261e,_0x2773b2){return function(_0x35d809){if(!_0x35d809){_0x8e261e[_0x4118('0x13')](0x194);}return _0x35d809;};}function handleError(_0x49a5dd,_0x138df2){_0x138df2=_0x138df2||0x1f4;return function(_0x170a67){logger[_0x4118('0x25')](_0x170a67[_0x4118('0x26')]);if(_0x170a67['name']){delete _0x170a67['name'];}_0x49a5dd[_0x4118('0x14')](_0x138df2)[_0x4118('0x27')](_0x170a67);};}exports[_0x4118('0x28')]=function(_0x359783,_0x132e76){var _0x5949c5={},_0x5f115e={},_0x2462d1={'count':0x0,'rows':[]};var _0x36f0c5=_[_0x4118('0x29')](db[_0x4118('0x2a')][_0x4118('0x2b')],function(_0x2638ff){return{'name':_0x2638ff[_0x4118('0x2c')],'type':_0x2638ff[_0x4118('0x2d')][_0x4118('0x2e')]};});_0x5f115e[_0x4118('0x2f')]=_[_0x4118('0x29')](_0x36f0c5,_0x4118('0x30'));_0x5f115e[_0x4118('0x31')]=_[_0x4118('0x32')](_0x359783[_0x4118('0x31')]);_0x5f115e[_0x4118('0x33')]=_[_0x4118('0x34')](_0x5f115e[_0x4118('0x2f')],_0x5f115e[_0x4118('0x31')]);_0x5949c5['attributes']=_[_0x4118('0x34')](_0x5f115e[_0x4118('0x2f')],qs[_0x4118('0x35')](_0x359783[_0x4118('0x31')][_0x4118('0x35')]));_0x5949c5[_0x4118('0x36')]=_0x5949c5['attributes'][_0x4118('0x37')]?_0x5949c5['attributes']:_0x5f115e['model'];if(!_0x359783[_0x4118('0x31')][_0x4118('0x38')]('nolimit')){_0x5949c5[_0x4118('0x17')]=qs[_0x4118('0x17')](_0x359783[_0x4118('0x31')]['limit']);_0x5949c5[_0x4118('0x16')]=qs[_0x4118('0x16')](_0x359783[_0x4118('0x31')]['offset']);}_0x5949c5['order']=qs[_0x4118('0x39')](_0x359783[_0x4118('0x31')][_0x4118('0x39')]);_0x5949c5[_0x4118('0x3a')]=qs[_0x4118('0x33')](_[_0x4118('0x3b')](_0x359783['query'],_0x5f115e[_0x4118('0x33')]),_0x36f0c5);if(_0x359783['query']['filter']){_0x5949c5[_0x4118('0x3a')]=_['merge'](_0x5949c5[_0x4118('0x3a')],{'$or':_[_0x4118('0x29')](_0x36f0c5,function(_0x2f151a){if(_0x2f151a['type']!==_0x4118('0x3c')){var _0x1ef488={};_0x1ef488[_0x2f151a[_0x4118('0x30')]]={'$like':'%'+_0x359783[_0x4118('0x31')][_0x4118('0x3d')]+'%'};return _0x1ef488;}})});}_0x5949c5=_[_0x4118('0x3e')]({},_0x5949c5,_0x359783[_0x4118('0x3f')]);var _0x30e355={'where':_0x5949c5['where']};return db[_0x4118('0x2a')][_0x4118('0x19')](_0x30e355)[_0x4118('0x21')](function(_0x12cac6){_0x2462d1[_0x4118('0x19')]=_0x12cac6;if(_0x359783[_0x4118('0x31')][_0x4118('0x40')]){_0x5949c5[_0x4118('0x41')]=[{'all':!![]}];}return db['JscriptyProject'][_0x4118('0x42')](_0x5949c5);})['then'](function(_0x38cac1){_0x2462d1[_0x4118('0x43')]=_0x38cac1;return _0x2462d1;})['then'](respondWithFilteredResult(_0x132e76,_0x5949c5))['catch'](handleError(_0x132e76,null));};exports[_0x4118('0x44')]=function(_0x8a16ec,_0x3c929f){var _0x2b24ac={'raw':![],'where':{'id':_0x8a16ec['params']['id']}},_0x5e72a1={};_0x5e72a1['model']=_['keys'](db[_0x4118('0x2a')]['rawAttributes']);_0x5e72a1[_0x4118('0x31')]=_[_0x4118('0x32')](_0x8a16ec[_0x4118('0x31')]);_0x5e72a1[_0x4118('0x33')]=_[_0x4118('0x34')](_0x5e72a1[_0x4118('0x2f')],_0x5e72a1['query']);_0x2b24ac[_0x4118('0x36')]=_[_0x4118('0x34')](_0x5e72a1[_0x4118('0x2f')],qs[_0x4118('0x35')](_0x8a16ec[_0x4118('0x31')][_0x4118('0x35')]));_0x2b24ac['attributes']=_0x2b24ac['attributes']['length']?_0x2b24ac[_0x4118('0x36')]:_0x5e72a1[_0x4118('0x2f')];if(_0x8a16ec['query'][_0x4118('0x40')]){_0x2b24ac[_0x4118('0x41')]=[{'all':!![]}];}_0x2b24ac=_[_0x4118('0x3e')]({},_0x2b24ac,_0x8a16ec[_0x4118('0x3f')]);return db['JscriptyProject'][_0x4118('0x45')](_0x2b24ac)[_0x4118('0x21')](handleEntityNotFound(_0x3c929f,null))[_0x4118('0x21')](respondWithResult(_0x3c929f,null))[_0x4118('0x46')](handleError(_0x3c929f,null));};exports[_0x4118('0x47')]=function(_0x291461,_0x4421d6){return db[_0x4118('0x2a')][_0x4118('0x47')](_0x291461[_0x4118('0x48')],{})[_0x4118('0x21')](function(_0x5e3f0d){var _0x5970e1=_0x291461['user'][_0x4118('0x22')]({'plain':!![]});if(!_0x5970e1)throw new Error(_0x4118('0x49'));if(_0x5970e1[_0x4118('0x4a')]===_0x4118('0x4b')){var _0x526478=_0x5e3f0d[_0x4118('0x22')]({'plain':!![]});var _0x448aa2=_0x4118('0x23');return db[_0x4118('0x4c')][_0x4118('0x45')]({'where':{'name':_0x448aa2,'userProfileId':_0x5970e1[_0x4118('0x4d')]},'raw':!![]})[_0x4118('0x21')](function(_0x147148){if(_0x147148&&_0x147148[_0x4118('0x4e')]===0x0){return db[_0x4118('0x24')][_0x4118('0x47')]({'name':_0x526478['name'],'resourceId':_0x526478['id'],'type':_0x147148[_0x4118('0x30')],'sectionId':_0x147148['id']},{})[_0x4118('0x21')](function(){return _0x5e3f0d;});}else{return _0x5e3f0d;}})['catch'](function(_0x1f8e3b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f8e3b);throw _0x1f8e3b;});}return _0x5e3f0d;})[_0x4118('0x21')](respondWithResult(_0x4421d6,0xc9))[_0x4118('0x46')](handleError(_0x4421d6,null));};exports[_0x4118('0x4f')]=function(_0x5e285d,_0x2e195c){var _0x5377a8={'where':{'id':_0x5e285d[_0x4118('0x50')]['id']}},_0x51dddd={};_0x51dddd['model']=_[_0x4118('0x32')](db[_0x4118('0x2a')][_0x4118('0x2b')]);_0x5377a8['attributes']=_[_0x4118('0x34')](_0x51dddd['model'],qs[_0x4118('0x35')](_0x5e285d['query'][_0x4118('0x35')]));_0x5377a8[_0x4118('0x36')]=_0x5377a8[_0x4118('0x36')][_0x4118('0x37')]?_0x5377a8[_0x4118('0x36')]:_0x51dddd[_0x4118('0x2f')];if(_0x5e285d[_0x4118('0x31')][_0x4118('0x40')]){_0x5377a8['include']=[{'all':!![]}];}_0x5377a8=_[_0x4118('0x3e')]({},_0x5377a8,_0x5e285d[_0x4118('0x3f')]);return db['JscriptyProject']['find'](_0x5377a8)[_0x4118('0x21')](handleEntityNotFound(_0x2e195c,null))['then'](function(_0x5bf1fe){if(_0x5bf1fe){var _0x5f34aa=_0x5bf1fe[_0x4118('0x22')]({'plain':!![]});_0x5f34aa=qs['omit'](_0x5f34aa,['id',_0x4118('0x51'),_0x4118('0x52')]);_0x5e285d[_0x4118('0x48')]=_['omit'](_0x5e285d[_0x4118('0x48')],['id','createdAt',_0x4118('0x52')]);return db['JscriptyProject'][_0x4118('0x47')](_['merge'](_0x5f34aa,_0x5e285d['body']),{'include':_0x5e285d[_0x4118('0x31')][_0x4118('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x506cd1){var _0x504fc1=_0x5e285d[_0x4118('0x4b')]['get']({'plain':!![]});if(!_0x504fc1)throw new Error(_0x4118('0x49'));if(_0x504fc1[_0x4118('0x4a')]===_0x4118('0x4b')){var _0x500833=_0x506cd1[_0x4118('0x22')]({'plain':!![]});var _0x3cac26=_0x4118('0x23');return db[_0x4118('0x4c')][_0x4118('0x45')]({'where':{'name':_0x3cac26,'userProfileId':_0x504fc1[_0x4118('0x4d')]},'raw':!![]})[_0x4118('0x21')](function(_0x27cf50){if(_0x27cf50&&_0x27cf50[_0x4118('0x4e')]===0x0){return db[_0x4118('0x24')][_0x4118('0x47')]({'name':_0x500833[_0x4118('0x30')],'resourceId':_0x500833['id'],'type':_0x27cf50[_0x4118('0x30')],'sectionId':_0x27cf50['id']},{})[_0x4118('0x21')](function(){return _0x506cd1;});}else{return _0x506cd1;}})['catch'](function(_0x20a937){logger['error'](_0x4118('0x53'),_0x20a937);throw _0x20a937;});}return _0x506cd1;});}})['then'](respondWithResult(_0x2e195c,0xc9))[_0x4118('0x46')](handleError(_0x2e195c,null));};exports[_0x4118('0x20')]=function(_0x5e92d1,_0x1a0a8c){if(_0x5e92d1['body']['id']){delete _0x5e92d1['body']['id'];}return db[_0x4118('0x2a')][_0x4118('0x45')]({'where':{'id':_0x5e92d1['params']['id']}})[_0x4118('0x21')](handleEntityNotFound(_0x1a0a8c,null))[_0x4118('0x21')](saveUpdates(_0x5e92d1[_0x4118('0x48')],null))[_0x4118('0x21')](respondWithResult(_0x1a0a8c,null))[_0x4118('0x46')](handleError(_0x1a0a8c,null));};exports[_0x4118('0x54')]=function(_0x2705a9,_0x4f699f){return db[_0x4118('0x2a')]['find']({'where':{'id':_0x2705a9[_0x4118('0x50')]['id']}})[_0x4118('0x21')](handleEntityNotFound(_0x4f699f,null))[_0x4118('0x21')](removeEntity(_0x4f699f,null))[_0x4118('0x46')](handleError(_0x4f699f,null));};exports[_0x4118('0x55')]=function(_0x13bcbc,_0x413724,_0x5a1846){var _0x552448={'raw':!![],'where':{}};var _0x42844f={};var _0x2e31ed={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x4118('0x56')]({'where':{'id':_0x13bcbc[_0x4118('0x50')]['id']}})[_0x4118('0x21')](handleEntityNotFound(_0x413724,null))['then'](function(_0x54529e){if(_0x54529e){_0x42844f[_0x4118('0x2f')]=_[_0x4118('0x32')](db[_0x4118('0x57')][_0x4118('0x2b')]);_0x42844f[_0x4118('0x31')]=_[_0x4118('0x32')](_0x13bcbc[_0x4118('0x31')]);_0x42844f['filters']=_[_0x4118('0x34')](_0x42844f[_0x4118('0x2f')],_0x42844f[_0x4118('0x31')]);_0x552448[_0x4118('0x36')]=_[_0x4118('0x34')](_0x42844f['model'],qs[_0x4118('0x35')](_0x13bcbc[_0x4118('0x31')][_0x4118('0x35')]));_0x552448['attributes']=_0x552448[_0x4118('0x36')]['length']?_0x552448[_0x4118('0x36')]:_0x42844f[_0x4118('0x2f')];if(!_0x13bcbc[_0x4118('0x31')]['hasOwnProperty'](_0x4118('0x58'))){_0x552448['limit']=qs['limit'](_0x13bcbc[_0x4118('0x31')][_0x4118('0x17')]);_0x552448[_0x4118('0x16')]=qs[_0x4118('0x16')](_0x13bcbc[_0x4118('0x31')][_0x4118('0x16')]);}_0x552448[_0x4118('0x59')]=qs['sort'](_0x13bcbc[_0x4118('0x31')][_0x4118('0x39')]);_0x552448[_0x4118('0x3a')]=qs[_0x4118('0x33')](_[_0x4118('0x3b')](_0x13bcbc[_0x4118('0x31')],_0x42844f[_0x4118('0x33')]));_0x552448[_0x4118('0x3a')][_0x4118('0x5a')]=_0x54529e['id'];if(_0x13bcbc[_0x4118('0x31')]['filter']){_0x552448['where']=_[_0x4118('0x3e')](_0x552448[_0x4118('0x3a')],{'$or':_[_0x4118('0x29')](_0x552448[_0x4118('0x36')],function(_0x133e9d){var _0x14ab8e={};_0x14ab8e[_0x133e9d]={'$like':'%'+_0x13bcbc['query']['filter']+'%'};return _0x14ab8e;})});}_0x552448=_[_0x4118('0x3e')]({},_0x552448,_0x13bcbc[_0x4118('0x3f')]);return db[_0x4118('0x57')][_0x4118('0x19')]({'where':_0x552448[_0x4118('0x3a')]})[_0x4118('0x21')](function(_0x11be80){_0x2e31ed[_0x4118('0x19')]=_0x11be80;if(_0x13bcbc['query']['includeAll']){_0x552448['include']=[{'all':!![]}];}return db[_0x4118('0x57')][_0x4118('0x42')](_0x552448);})[_0x4118('0x21')](function(_0x4ff32f){_0x2e31ed[_0x4118('0x43')]=_0x4ff32f;return _0x2e31ed;});}})[_0x4118('0x21')](respondWithFilteredResult(_0x413724,_0x552448))['catch'](handleError(_0x413724,null));};exports[_0x4118('0x5b')]=function(_0x4da54b,_0xf26d53,_0x5b3d89){var _0x21ea00={'raw':!![],'where':{}};var _0x5a3b3b={};var _0x5400d3={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x4118('0x56')]({'where':{'id':_0x4da54b[_0x4118('0x50')]['id']}})['then'](handleEntityNotFound(_0xf26d53,null))[_0x4118('0x21')](function(_0x3ed43c){if(_0x3ed43c){_0x5a3b3b[_0x4118('0x2f')]=_[_0x4118('0x32')](db[_0x4118('0x5c')][_0x4118('0x2b')]);_0x5a3b3b[_0x4118('0x31')]=_[_0x4118('0x32')](_0x4da54b[_0x4118('0x31')]);_0x5a3b3b[_0x4118('0x33')]=_[_0x4118('0x34')](_0x5a3b3b[_0x4118('0x2f')],_0x5a3b3b[_0x4118('0x31')]);_0x21ea00[_0x4118('0x36')]=_[_0x4118('0x34')](_0x5a3b3b[_0x4118('0x2f')],qs[_0x4118('0x35')](_0x4da54b['query']['fields']));_0x21ea00[_0x4118('0x36')]=_0x21ea00[_0x4118('0x36')][_0x4118('0x37')]?_0x21ea00[_0x4118('0x36')]:_0x5a3b3b[_0x4118('0x2f')];if(!_0x4da54b[_0x4118('0x31')][_0x4118('0x38')](_0x4118('0x58'))){_0x21ea00['limit']=qs['limit'](_0x4da54b[_0x4118('0x31')][_0x4118('0x17')]);_0x21ea00['offset']=qs[_0x4118('0x16')](_0x4da54b['query']['offset']);}_0x21ea00[_0x4118('0x59')]=qs['sort'](_0x4da54b[_0x4118('0x31')][_0x4118('0x39')]);_0x21ea00[_0x4118('0x3a')]=qs[_0x4118('0x33')](_[_0x4118('0x3b')](_0x4da54b[_0x4118('0x31')],_0x5a3b3b[_0x4118('0x33')]));_0x21ea00[_0x4118('0x3a')][_0x4118('0x5a')]=_0x3ed43c['id'];if(_0x4da54b[_0x4118('0x31')]['filter']){_0x21ea00['where']=_[_0x4118('0x3e')](_0x21ea00[_0x4118('0x3a')],{'$or':_['map'](_0x21ea00['attributes'],function(_0x58885e){var _0x317cad={};_0x317cad[_0x58885e]={'$like':'%'+_0x4da54b[_0x4118('0x31')][_0x4118('0x3d')]+'%'};return _0x317cad;})});}_0x21ea00=_[_0x4118('0x3e')]({},_0x21ea00,_0x4da54b[_0x4118('0x3f')]);return db['JscriptyAnswerReport'][_0x4118('0x19')]({'where':_0x21ea00['where']})['then'](function(_0x5d57aa){_0x5400d3[_0x4118('0x19')]=_0x5d57aa;if(_0x4da54b[_0x4118('0x31')]['includeAll']){_0x21ea00[_0x4118('0x41')]=[{'all':!![]}];}return db[_0x4118('0x5c')][_0x4118('0x42')](_0x21ea00);})[_0x4118('0x21')](function(_0x42c45d){_0x5400d3[_0x4118('0x43')]=_0x42c45d;return _0x5400d3;});}})[_0x4118('0x21')](respondWithFilteredResult(_0xf26d53,_0x21ea00))[_0x4118('0x46')](handleError(_0xf26d53,null));};function char(_0x4f8e5f){return _0x4118('0x5d')===typeof _0x4f8e5f?String['fromCharCode'][_0x4118('0x1d')](null,arguments):_0x4f8e5f;}function needsEncapsulation(_0x585e27){return!!_0x585e27&&(_0x585e27[_0x4118('0x5e')]()[_0x4118('0x5f')](char(0xd))>=0x0||_0x585e27[_0x4118('0x5e')]()['indexOf'](char(0xa))>=0x0||_0x585e27[_0x4118('0x5e')]()[_0x4118('0x5f')](char(0x2c))>=0x0||_0x585e27['toString']()[_0x4118('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x4f7426){var _0x49af03=char(0x22),_0x11eb2d='\x5c'+char(0x22),_0x407c74=_0x4f7426[_0x4118('0x5e')]()[_0x4118('0x60')](new RegExp(_0x49af03,'g'),_0x11eb2d);return _0x49af03+_0x407c74+_0x49af03;}exports[_0x4118('0x61')]=function(_0xfdbd0f,_0x58c464,_0xc51d8e){var _0x3cb136,_0x495aa4;var _0x4ed269={'where':{'ProjectId':_0xfdbd0f[_0x4118('0x50')]['id']}};if(_0xfdbd0f[_0x4118('0x31')][_0x4118('0x62')]){_0x4ed269[_0x4118('0x3a')][_0x4118('0x63')]=JSON[_0x4118('0x64')](_0xfdbd0f['query']['startTime']);}return db['JscriptySessionReport'][_0x4118('0x42')](_0x4ed269)['then'](handleEntityNotFound(_0x58c464,null))['then'](function(_0x7e9eaf){if(_0x7e9eaf){_0x3cb136=_0x7e9eaf;return db[_0x4118('0x65')][_0x4118('0x42')]({'where':{'SessionId':{'$in':_['map'](_0x3cb136,'id')},'ProjectId':_0xfdbd0f[_0x4118('0x50')]['id']},'order':_0x4118('0x66')});}})[_0x4118('0x21')](handleEntityNotFound(_0x58c464,null))[_0x4118('0x21')](function(_0x510aef){if(_0x510aef){_0x495aa4=_0x510aef;var _0x2bb6e9={};for(var _0x912782=0x0,_0x53211c=_0x495aa4[_0x4118('0x37')];_0x912782<_0x53211c;_0x912782++){if(!_0x2bb6e9['hasOwnProperty'](_0x495aa4[_0x912782]['questionId'])){_0x2bb6e9[_0x495aa4[_0x912782]['questionId']]=needsEncapsulation(_0x495aa4[_0x912782][_0x4118('0x67')])?encapsulate(_0x495aa4[_0x912782][_0x4118('0x67')]):_0x495aa4[_0x912782][_0x4118('0x67')];}}var _0x3ba61f=[],_0x29134e={};for(var _0x316f0e=0x0,_0x69d772=_0x3cb136[_0x4118('0x37')];_0x316f0e<_0x69d772;_0x316f0e++){_0x29134e={'ProjectId':_0xfdbd0f[_0x4118('0x50')]['id'],'SessionId':_0x3cb136[_0x316f0e]['id'],'StartTime':moment(_0x3cb136[_0x316f0e]['starttime'])[_0x4118('0x68')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x2af1eb=0x0,_0x52e152=_0x495aa4[_0x4118('0x37')];_0x2af1eb<_0x52e152;_0x2af1eb++){if(_0x495aa4[_0x2af1eb]['SessionId']==_0x3cb136[_0x316f0e]['id']&&_0x2bb6e9[_0x4118('0x38')](_0x495aa4[_0x2af1eb][_0x4118('0x69')])){_0x29134e[_0x2bb6e9[_0x495aa4[_0x2af1eb][_0x4118('0x69')]]]=_0x495aa4[_0x2af1eb][_0x4118('0x6a')];}}for(var _0x22a2b6 in _0x2bb6e9){if(!_0x29134e[_0x4118('0x38')](_0x2bb6e9[_0x22a2b6])){_0x29134e[_0x2bb6e9[_0x22a2b6]]=null;}}_0x3ba61f[_0x4118('0x6b')](_0x29134e);}return _0x3ba61f;}})['then'](function(_0x5ef2b9){if(!_[_0x4118('0x6c')](_0x5ef2b9)){var _0x36379b=toCsv(_0x5ef2b9);var _0x59672a=Date[_0x4118('0x6d')]();fs[_0x4118('0x6e')](util['format'](_0x4118('0x6f'),_0xfdbd0f[_0x4118('0x50')]['id'],_0x59672a),_0x36379b);_0x58c464[_0x4118('0x70')](_0x4118('0x71'),_0x4118('0x72')+util[_0x4118('0x68')]('Jscripty_Project_%d_Summary_%s.csv',_0xfdbd0f[_0x4118('0x50')]['id'],_0x59672a));_0x58c464[_0x4118('0x70')](_0x4118('0x73'),_0x4118('0x74'));return _0x58c464['download'](util[_0x4118('0x68')](_0x4118('0x6f'),_0xfdbd0f[_0x4118('0x50')]['id'],_0x59672a));}else{return _0x58c464['sendStatus'](0xcc);}})[_0x4118('0x46')](handleError(_0x58c464,null));}; \ No newline at end of file +var _0x53aa=['lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','get','Projects','UserProfileResource','destroy','stack','name','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','JscriptyProject','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','params','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','parse','startTime','-createdAt','questionId','question','format','SessionId','answer','push','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs'];(function(_0x2c96c7,_0x13b62c){var _0x298921=function(_0x2fb166){while(--_0x2fb166){_0x2c96c7['push'](_0x2c96c7['shift']());}};_0x298921(++_0x13b62c);}(_0x53aa,0x167));var _0xa53a=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x53aa[_0x4fbfd9];return _0x31dc94;};'use strict';var emlformat=require(_0xa53a('0x0'));var rimraf=require(_0xa53a('0x1'));var zipdir=require(_0xa53a('0x2'));var jsonpatch=require(_0xa53a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa53a('0x4'));var Mustache=require('mustache');var util=require(_0xa53a('0x5'));var path=require(_0xa53a('0x6'));var sox=require(_0xa53a('0x7'));var csv=require(_0xa53a('0x8'));var ejs=require(_0xa53a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa53a('0xa'));var squel=require(_0xa53a('0xb'));var crypto=require('crypto');var jsforce=require(_0xa53a('0xc'));var deskjs=require(_0xa53a('0xd'));var toCsv=require(_0xa53a('0x8'));var querystring=require('querystring');var Papa=require(_0xa53a('0xe'));var Redis=require('ioredis');var authService=require(_0xa53a('0xf'));var qs=require(_0xa53a('0x10'));var as=require(_0xa53a('0x11'));var hardwareService=require(_0xa53a('0x12'));var logger=require(_0xa53a('0x13'))(_0xa53a('0x14'));var utils=require(_0xa53a('0x15'));var config=require(_0xa53a('0x16'));var licenseUtil=require(_0xa53a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x448fcb,_0x52cb14){_0x52cb14=_0x52cb14||0xcc;return function(_0x3d5a63){if(_0x3d5a63){return _0x448fcb[_0xa53a('0x18')](_0x52cb14);}return _0x448fcb[_0xa53a('0x19')](_0x52cb14)[_0xa53a('0x1a')]();};}function respondWithResult(_0x252c59,_0x333cdc){_0x333cdc=_0x333cdc||0xc8;return function(_0xebb4b7){if(_0xebb4b7){return _0x252c59[_0xa53a('0x19')](_0x333cdc)[_0xa53a('0x1b')](_0xebb4b7);}};}function respondWithFilteredResult(_0x1ce266,_0x2d1f21){return function(_0x427d66){if(_0x427d66){var _0x5c5a14=typeof _0x2d1f21[_0xa53a('0x1c')]===_0xa53a('0x1d')&&typeof _0x2d1f21['limit']===_0xa53a('0x1d');var _0x3f3869=_0x427d66[_0xa53a('0x1e')];var _0xf61650=_0x5c5a14?0x0:_0x2d1f21[_0xa53a('0x1c')];var _0x379a0b=_0x5c5a14?_0x427d66[_0xa53a('0x1e')]:_0x2d1f21[_0xa53a('0x1c')]+_0x2d1f21[_0xa53a('0x1f')];var _0x1e1401;if(_0x379a0b>=_0x3f3869){_0x379a0b=_0x3f3869;_0x1e1401=0xc8;}else{_0x1e1401=0xce;}_0x1ce266[_0xa53a('0x19')](_0x1e1401);return _0x1ce266[_0xa53a('0x20')](_0xa53a('0x21'),_0xf61650+'-'+_0x379a0b+'/'+_0x3f3869)[_0xa53a('0x1b')](_0x427d66);}return null;};}function patchUpdates(_0x584c4e){return function(_0x4527c8){try{jsonpatch[_0xa53a('0x22')](_0x4527c8,_0x584c4e,!![]);}catch(_0x478ff2){return BPromise[_0xa53a('0x23')](_0x478ff2);}return _0x4527c8['save']();};}function saveUpdates(_0x1a2a2a,_0x352f91){return function(_0xc5fe37){if(_0xc5fe37){return _0xc5fe37[_0xa53a('0x24')](_0x1a2a2a)[_0xa53a('0x25')](function(_0x324a24){return _0x324a24;});}return null;};}function removeEntity(_0x5cdb5c,_0x138a10){return function(_0x2cc210){if(_0x2cc210){return _0x2cc210['destroy']()[_0xa53a('0x25')](function(){var _0x3878e0=_0x2cc210[_0xa53a('0x26')]({'plain':!![]});var _0x1d9466=_0xa53a('0x27');return db[_0xa53a('0x28')][_0xa53a('0x29')]({'where':{'type':_0x1d9466,'resourceId':_0x3878e0['id']}})['then'](function(){return _0x2cc210;});})['then'](function(){_0x5cdb5c[_0xa53a('0x19')](0xcc)[_0xa53a('0x1a')]();});}};}function handleEntityNotFound(_0x512d96,_0x3d11a2){return function(_0xe10903){if(!_0xe10903){_0x512d96[_0xa53a('0x18')](0x194);}return _0xe10903;};}function handleError(_0x33565a,_0x2ffcb6){_0x2ffcb6=_0x2ffcb6||0x1f4;return function(_0x1e796b){logger['error'](_0x1e796b[_0xa53a('0x2a')]);if(_0x1e796b[_0xa53a('0x2b')]){delete _0x1e796b[_0xa53a('0x2b')];}_0x33565a['status'](_0x2ffcb6)['send'](_0x1e796b);};}exports[_0xa53a('0x2c')]=function(_0x37ef40,_0x1bb99d){var _0x4bd9b9={},_0x2d78eb={},_0xd60689={'count':0x0,'rows':[]};var _0x7e6177=_[_0xa53a('0x2d')](db['JscriptyProject']['rawAttributes'],function(_0x2b7024){return{'name':_0x2b7024[_0xa53a('0x2e')],'type':_0x2b7024[_0xa53a('0x2f')][_0xa53a('0x30')]};});_0x2d78eb[_0xa53a('0x31')]=_[_0xa53a('0x2d')](_0x7e6177,_0xa53a('0x2b'));_0x2d78eb[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x37ef40['query']);_0x2d78eb[_0xa53a('0x34')]=_['intersection'](_0x2d78eb[_0xa53a('0x31')],_0x2d78eb[_0xa53a('0x32')]);_0x4bd9b9[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x2d78eb[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x37ef40[_0xa53a('0x32')][_0xa53a('0x37')]));_0x4bd9b9[_0xa53a('0x35')]=_0x4bd9b9['attributes'][_0xa53a('0x38')]?_0x4bd9b9['attributes']:_0x2d78eb['model'];if(!_0x37ef40[_0xa53a('0x32')][_0xa53a('0x39')](_0xa53a('0x3a'))){_0x4bd9b9['limit']=qs[_0xa53a('0x1f')](_0x37ef40['query'][_0xa53a('0x1f')]);_0x4bd9b9[_0xa53a('0x1c')]=qs['offset'](_0x37ef40[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0x4bd9b9[_0xa53a('0x3b')]=qs['sort'](_0x37ef40[_0xa53a('0x32')][_0xa53a('0x3c')]);_0x4bd9b9['where']=qs[_0xa53a('0x34')](_[_0xa53a('0x3d')](_0x37ef40[_0xa53a('0x32')],_0x2d78eb[_0xa53a('0x34')]),_0x7e6177);if(_0x37ef40[_0xa53a('0x32')]['filter']){_0x4bd9b9[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0x4bd9b9['where'],{'$or':_[_0xa53a('0x2d')](_0x7e6177,function(_0x11e623){if(_0x11e623[_0xa53a('0x2f')]!==_0xa53a('0x40')){var _0x4602b5={};_0x4602b5[_0x11e623[_0xa53a('0x2b')]]={'$like':'%'+_0x37ef40[_0xa53a('0x32')][_0xa53a('0x41')]+'%'};return _0x4602b5;}})});}_0x4bd9b9=_[_0xa53a('0x3f')]({},_0x4bd9b9,_0x37ef40[_0xa53a('0x42')]);var _0x50fd89={'where':_0x4bd9b9[_0xa53a('0x3e')]};return db['JscriptyProject'][_0xa53a('0x1e')](_0x50fd89)[_0xa53a('0x25')](function(_0x4a9d5d){_0xd60689[_0xa53a('0x1e')]=_0x4a9d5d;if(_0x37ef40[_0xa53a('0x32')][_0xa53a('0x43')]){_0x4bd9b9[_0xa53a('0x44')]=[{'all':!![]}];}return db[_0xa53a('0x45')][_0xa53a('0x46')](_0x4bd9b9);})[_0xa53a('0x25')](function(_0x3fc9ea){_0xd60689[_0xa53a('0x47')]=_0x3fc9ea;return _0xd60689;})[_0xa53a('0x25')](respondWithFilteredResult(_0x1bb99d,_0x4bd9b9))[_0xa53a('0x48')](handleError(_0x1bb99d,null));};exports[_0xa53a('0x49')]=function(_0x4f5178,_0x1e4536){var _0x55ded6={'raw':![],'where':{'id':_0x4f5178['params']['id']}},_0x1dd82b={};_0x1dd82b[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x45')][_0xa53a('0x4a')]);_0x1dd82b[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x4f5178[_0xa53a('0x32')]);_0x1dd82b[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x1dd82b[_0xa53a('0x31')],_0x1dd82b[_0xa53a('0x32')]);_0x55ded6[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x1dd82b[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x4f5178['query']['fields']));_0x55ded6[_0xa53a('0x35')]=_0x55ded6[_0xa53a('0x35')][_0xa53a('0x38')]?_0x55ded6[_0xa53a('0x35')]:_0x1dd82b[_0xa53a('0x31')];if(_0x4f5178[_0xa53a('0x32')][_0xa53a('0x43')]){_0x55ded6[_0xa53a('0x44')]=[{'all':!![]}];}_0x55ded6=_[_0xa53a('0x3f')]({},_0x55ded6,_0x4f5178['options']);return db[_0xa53a('0x45')][_0xa53a('0x4b')](_0x55ded6)[_0xa53a('0x25')](handleEntityNotFound(_0x1e4536,null))[_0xa53a('0x25')](respondWithResult(_0x1e4536,null))[_0xa53a('0x48')](handleError(_0x1e4536,null));};exports['create']=function(_0xd16651,_0xec389b){return db[_0xa53a('0x45')][_0xa53a('0x4c')](_0xd16651[_0xa53a('0x4d')],{})[_0xa53a('0x25')](function(_0x30e30f){var _0x10b86b=_0xd16651[_0xa53a('0x4e')][_0xa53a('0x26')]({'plain':!![]});if(!_0x10b86b)throw new Error(_0xa53a('0x4f'));if(_0x10b86b[_0xa53a('0x50')]===_0xa53a('0x4e')){var _0x515f62=_0x30e30f[_0xa53a('0x26')]({'plain':!![]});var _0x5380bb=_0xa53a('0x27');return db[_0xa53a('0x51')]['find']({'where':{'name':_0x5380bb,'userProfileId':_0x10b86b[_0xa53a('0x52')]},'raw':!![]})[_0xa53a('0x25')](function(_0x13acaf){if(_0x13acaf&&_0x13acaf[_0xa53a('0x53')]===0x0){return db[_0xa53a('0x28')][_0xa53a('0x4c')]({'name':_0x515f62[_0xa53a('0x2b')],'resourceId':_0x515f62['id'],'type':_0x13acaf[_0xa53a('0x2b')],'sectionId':_0x13acaf['id']},{})[_0xa53a('0x25')](function(){return _0x30e30f;});}else{return _0x30e30f;}})['catch'](function(_0x56a4ef){logger[_0xa53a('0x54')](_0xa53a('0x55'),_0x56a4ef);throw _0x56a4ef;});}return _0x30e30f;})[_0xa53a('0x25')](respondWithResult(_0xec389b,0xc9))['catch'](handleError(_0xec389b,null));};exports[_0xa53a('0x56')]=function(_0x1a9449,_0x36b9c){var _0x2416f3={'where':{'id':_0x1a9449['params']['id']}},_0x5709e9={};_0x5709e9[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x45')][_0xa53a('0x4a')]);_0x2416f3[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x5709e9[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x1a9449[_0xa53a('0x32')][_0xa53a('0x37')]));_0x2416f3['attributes']=_0x2416f3[_0xa53a('0x35')]['length']?_0x2416f3['attributes']:_0x5709e9[_0xa53a('0x31')];if(_0x1a9449[_0xa53a('0x32')][_0xa53a('0x43')]){_0x2416f3['include']=[{'all':!![]}];}_0x2416f3=_[_0xa53a('0x3f')]({},_0x2416f3,_0x1a9449[_0xa53a('0x42')]);return db['JscriptyProject'][_0xa53a('0x4b')](_0x2416f3)[_0xa53a('0x25')](handleEntityNotFound(_0x36b9c,null))[_0xa53a('0x25')](function(_0x4fbe3b){if(_0x4fbe3b){var _0x75f0e0=_0x4fbe3b[_0xa53a('0x26')]({'plain':!![]});_0x75f0e0=qs[_0xa53a('0x57')](_0x75f0e0,['id',_0xa53a('0x58'),_0xa53a('0x59')]);_0x1a9449['body']=_['omit'](_0x1a9449['body'],['id','createdAt','updatedAt']);return db[_0xa53a('0x45')][_0xa53a('0x4c')](_[_0xa53a('0x3f')](_0x75f0e0,_0x1a9449['body']),{'include':_0x1a9449[_0xa53a('0x32')][_0xa53a('0x43')]?[{'all':!![]}]:undefined})[_0xa53a('0x25')](function(_0x5556da){var _0x306891=_0x1a9449['user']['get']({'plain':!![]});if(!_0x306891)throw new Error(_0xa53a('0x4f'));if(_0x306891['role']===_0xa53a('0x4e')){var _0xfa9984=_0x5556da[_0xa53a('0x26')]({'plain':!![]});var _0x35c243=_0xa53a('0x27');return db[_0xa53a('0x51')]['find']({'where':{'name':_0x35c243,'userProfileId':_0x306891[_0xa53a('0x52')]},'raw':!![]})[_0xa53a('0x25')](function(_0x1439a4){if(_0x1439a4&&_0x1439a4['autoAssociation']===0x0){return db[_0xa53a('0x28')][_0xa53a('0x4c')]({'name':_0xfa9984[_0xa53a('0x2b')],'resourceId':_0xfa9984['id'],'type':_0x1439a4[_0xa53a('0x2b')],'sectionId':_0x1439a4['id']},{})[_0xa53a('0x25')](function(){return _0x5556da;});}else{return _0x5556da;}})[_0xa53a('0x48')](function(_0x5bd848){logger[_0xa53a('0x54')](_0xa53a('0x55'),_0x5bd848);throw _0x5bd848;});}return _0x5556da;});}})['then'](respondWithResult(_0x36b9c,0xc9))[_0xa53a('0x48')](handleError(_0x36b9c,null));};exports[_0xa53a('0x24')]=function(_0x530ca8,_0x4c7f47){if(_0x530ca8['body']['id']){delete _0x530ca8[_0xa53a('0x4d')]['id'];}return db[_0xa53a('0x45')][_0xa53a('0x4b')]({'where':{'id':_0x530ca8[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x4c7f47,null))['then'](saveUpdates(_0x530ca8[_0xa53a('0x4d')],null))[_0xa53a('0x25')](respondWithResult(_0x4c7f47,null))[_0xa53a('0x48')](handleError(_0x4c7f47,null));};exports[_0xa53a('0x29')]=function(_0x16ac88,_0x240a25){return db[_0xa53a('0x45')][_0xa53a('0x4b')]({'where':{'id':_0x16ac88[_0xa53a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x240a25,null))['then'](removeEntity(_0x240a25,null))['catch'](handleError(_0x240a25,null));};exports[_0xa53a('0x5b')]=function(_0x25044f,_0x11f1c3,_0x3f16df){var _0x17f983={'raw':!![],'where':{}};var _0x229f8c={};var _0x4143f2={'count':0x0,'rows':[]};return db[_0xa53a('0x45')][_0xa53a('0x5c')]({'where':{'id':_0x25044f[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x11f1c3,null))[_0xa53a('0x25')](function(_0x363ae1){if(_0x363ae1){_0x229f8c['model']=_[_0xa53a('0x33')](db[_0xa53a('0x5d')][_0xa53a('0x4a')]);_0x229f8c[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x25044f[_0xa53a('0x32')]);_0x229f8c[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x229f8c['model'],_0x229f8c['query']);_0x17f983[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x229f8c['model'],qs['fields'](_0x25044f[_0xa53a('0x32')][_0xa53a('0x37')]));_0x17f983[_0xa53a('0x35')]=_0x17f983[_0xa53a('0x35')]['length']?_0x17f983[_0xa53a('0x35')]:_0x229f8c[_0xa53a('0x31')];if(!_0x25044f[_0xa53a('0x32')][_0xa53a('0x39')](_0xa53a('0x3a'))){_0x17f983[_0xa53a('0x1f')]=qs[_0xa53a('0x1f')](_0x25044f[_0xa53a('0x32')][_0xa53a('0x1f')]);_0x17f983[_0xa53a('0x1c')]=qs[_0xa53a('0x1c')](_0x25044f[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0x17f983[_0xa53a('0x3b')]=qs[_0xa53a('0x3c')](_0x25044f[_0xa53a('0x32')][_0xa53a('0x3c')]);_0x17f983[_0xa53a('0x3e')]=qs[_0xa53a('0x34')](_['pick'](_0x25044f[_0xa53a('0x32')],_0x229f8c[_0xa53a('0x34')]));_0x17f983[_0xa53a('0x3e')][_0xa53a('0x5e')]=_0x363ae1['id'];if(_0x25044f[_0xa53a('0x32')]['filter']){_0x17f983[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0x17f983['where'],{'$or':_[_0xa53a('0x2d')](_0x17f983[_0xa53a('0x35')],function(_0x3a7675){var _0x15976a={};_0x15976a[_0x3a7675]={'$like':'%'+_0x25044f['query'][_0xa53a('0x41')]+'%'};return _0x15976a;})});}_0x17f983=_[_0xa53a('0x3f')]({},_0x17f983,_0x25044f[_0xa53a('0x42')]);return db['JscriptySessionReport']['count']({'where':_0x17f983[_0xa53a('0x3e')]})[_0xa53a('0x25')](function(_0x343235){_0x4143f2['count']=_0x343235;if(_0x25044f[_0xa53a('0x32')][_0xa53a('0x43')]){_0x17f983[_0xa53a('0x44')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xa53a('0x46')](_0x17f983);})[_0xa53a('0x25')](function(_0x5da9ce){_0x4143f2[_0xa53a('0x47')]=_0x5da9ce;return _0x4143f2;});}})[_0xa53a('0x25')](respondWithFilteredResult(_0x11f1c3,_0x17f983))['catch'](handleError(_0x11f1c3,null));};exports[_0xa53a('0x5f')]=function(_0x27decf,_0xdec0eb,_0x77779){var _0x208d92={'raw':!![],'where':{}};var _0x324446={};var _0x916b0a={'count':0x0,'rows':[]};return db[_0xa53a('0x45')][_0xa53a('0x5c')]({'where':{'id':_0x27decf[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0xdec0eb,null))[_0xa53a('0x25')](function(_0x2a3227){if(_0x2a3227){_0x324446[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x60')][_0xa53a('0x4a')]);_0x324446[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x27decf['query']);_0x324446['filters']=_[_0xa53a('0x36')](_0x324446['model'],_0x324446[_0xa53a('0x32')]);_0x208d92[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x324446[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x27decf[_0xa53a('0x32')]['fields']));_0x208d92[_0xa53a('0x35')]=_0x208d92['attributes'][_0xa53a('0x38')]?_0x208d92[_0xa53a('0x35')]:_0x324446[_0xa53a('0x31')];if(!_0x27decf[_0xa53a('0x32')][_0xa53a('0x39')]('nolimit')){_0x208d92[_0xa53a('0x1f')]=qs[_0xa53a('0x1f')](_0x27decf[_0xa53a('0x32')]['limit']);_0x208d92[_0xa53a('0x1c')]=qs[_0xa53a('0x1c')](_0x27decf[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0x208d92[_0xa53a('0x3b')]=qs[_0xa53a('0x3c')](_0x27decf[_0xa53a('0x32')]['sort']);_0x208d92[_0xa53a('0x3e')]=qs['filters'](_[_0xa53a('0x3d')](_0x27decf[_0xa53a('0x32')],_0x324446[_0xa53a('0x34')]));_0x208d92[_0xa53a('0x3e')]['ProjectId']=_0x2a3227['id'];if(_0x27decf[_0xa53a('0x32')][_0xa53a('0x41')]){_0x208d92[_0xa53a('0x3e')]=_['merge'](_0x208d92['where'],{'$or':_['map'](_0x208d92[_0xa53a('0x35')],function(_0x5004e8){var _0x31ec53={};_0x31ec53[_0x5004e8]={'$like':'%'+_0x27decf[_0xa53a('0x32')][_0xa53a('0x41')]+'%'};return _0x31ec53;})});}_0x208d92=_[_0xa53a('0x3f')]({},_0x208d92,_0x27decf[_0xa53a('0x42')]);return db[_0xa53a('0x60')][_0xa53a('0x1e')]({'where':_0x208d92[_0xa53a('0x3e')]})[_0xa53a('0x25')](function(_0x2335ea){_0x916b0a['count']=_0x2335ea;if(_0x27decf['query']['includeAll']){_0x208d92[_0xa53a('0x44')]=[{'all':!![]}];}return db[_0xa53a('0x60')][_0xa53a('0x46')](_0x208d92);})['then'](function(_0x439134){_0x916b0a[_0xa53a('0x47')]=_0x439134;return _0x916b0a;});}})[_0xa53a('0x25')](respondWithFilteredResult(_0xdec0eb,_0x208d92))[_0xa53a('0x48')](handleError(_0xdec0eb,null));};function char(_0x399f51){return _0xa53a('0x61')===typeof _0x399f51?String[_0xa53a('0x62')][_0xa53a('0x22')](null,arguments):_0x399f51;}function needsEncapsulation(_0xf317e7){return!!_0xf317e7&&(_0xf317e7[_0xa53a('0x63')]()[_0xa53a('0x64')](char(0xd))>=0x0||_0xf317e7['toString']()[_0xa53a('0x64')](char(0xa))>=0x0||_0xf317e7[_0xa53a('0x63')]()[_0xa53a('0x64')](char(0x2c))>=0x0||_0xf317e7['toString']()[_0xa53a('0x64')](char(0x22))>=0x0);}function encapsulate(_0x26fcdd){var _0x5b8973=char(0x22),_0x154dd8='\x5c'+char(0x22),_0x2ef02d=_0x26fcdd[_0xa53a('0x63')]()[_0xa53a('0x65')](new RegExp(_0x5b8973,'g'),_0x154dd8);return _0x5b8973+_0x2ef02d+_0x5b8973;}exports[_0xa53a('0x66')]=function(_0x10b515,_0x4293be,_0x51c334){var _0x29d054,_0x49df9f;var _0x187080={'where':{'ProjectId':_0x10b515['params']['id']}};if(_0x10b515[_0xa53a('0x32')]['startTime']){_0x187080[_0xa53a('0x3e')]['starttime']=JSON[_0xa53a('0x67')](_0x10b515[_0xa53a('0x32')][_0xa53a('0x68')]);}return db[_0xa53a('0x5d')]['findAll'](_0x187080)[_0xa53a('0x25')](handleEntityNotFound(_0x4293be,null))['then'](function(_0x1a6d2c){if(_0x1a6d2c){_0x29d054=_0x1a6d2c;return db['JscriptyQuestionReport'][_0xa53a('0x46')]({'where':{'SessionId':{'$in':_['map'](_0x29d054,'id')},'ProjectId':_0x10b515[_0xa53a('0x5a')]['id']},'order':_0xa53a('0x69')});}})[_0xa53a('0x25')](handleEntityNotFound(_0x4293be,null))[_0xa53a('0x25')](function(_0x225db5){if(_0x225db5){_0x49df9f=_0x225db5;var _0x5ec379={};for(var _0x5e95ca=0x0,_0x2aa84d=_0x49df9f['length'];_0x5e95ca<_0x2aa84d;_0x5e95ca++){if(!_0x5ec379[_0xa53a('0x39')](_0x49df9f[_0x5e95ca][_0xa53a('0x6a')])){_0x5ec379[_0x49df9f[_0x5e95ca][_0xa53a('0x6a')]]=needsEncapsulation(_0x49df9f[_0x5e95ca][_0xa53a('0x6b')])?encapsulate(_0x49df9f[_0x5e95ca][_0xa53a('0x6b')]):_0x49df9f[_0x5e95ca][_0xa53a('0x6b')];}}var _0x5520a0=[],_0x5f6840={};for(var _0x2987a1=0x0,_0x402809=_0x29d054[_0xa53a('0x38')];_0x2987a1<_0x402809;_0x2987a1++){_0x5f6840={'ProjectId':_0x10b515[_0xa53a('0x5a')]['id'],'SessionId':_0x29d054[_0x2987a1]['id'],'StartTime':moment(_0x29d054[_0x2987a1]['starttime'])[_0xa53a('0x6c')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x2e715b=0x0,_0x37419f=_0x49df9f['length'];_0x2e715b<_0x37419f;_0x2e715b++){if(_0x49df9f[_0x2e715b][_0xa53a('0x6d')]==_0x29d054[_0x2987a1]['id']&&_0x5ec379[_0xa53a('0x39')](_0x49df9f[_0x2e715b][_0xa53a('0x6a')])){_0x5f6840[_0x5ec379[_0x49df9f[_0x2e715b][_0xa53a('0x6a')]]]=_0x49df9f[_0x2e715b][_0xa53a('0x6e')];}}for(var _0x447fbb in _0x5ec379){if(!_0x5f6840['hasOwnProperty'](_0x5ec379[_0x447fbb])){_0x5f6840[_0x5ec379[_0x447fbb]]=null;}}_0x5520a0[_0xa53a('0x6f')](_0x5f6840);}return _0x5520a0;}})[_0xa53a('0x25')](function(_0x345e34){if(!_[_0xa53a('0x70')](_0x345e34)){var _0x5733ec=toCsv(_0x345e34);var _0x297a22=Date[_0xa53a('0x71')]();fs[_0xa53a('0x72')](util[_0xa53a('0x6c')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x10b515[_0xa53a('0x5a')]['id'],_0x297a22),_0x5733ec);_0x4293be[_0xa53a('0x73')](_0xa53a('0x74'),_0xa53a('0x75')+util[_0xa53a('0x6c')](_0xa53a('0x76'),_0x10b515[_0xa53a('0x5a')]['id'],_0x297a22));_0x4293be[_0xa53a('0x73')](_0xa53a('0x77'),_0xa53a('0x78'));return _0x4293be[_0xa53a('0x79')](util[_0xa53a('0x6c')](_0xa53a('0x7a'),_0x10b515[_0xa53a('0x5a')]['id'],_0x297a22));}else{return _0x4293be[_0xa53a('0x18')](0xcc);}})[_0xa53a('0x48')](handleError(_0x4293be,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 164c120..59ddfdf 100644 --- a/server/api/jscriptyProject/jscriptyProject.model.js +++ b/server/api/jscriptyProject/jscriptyProject.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2d6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','define','jscripty_projects','util','../../config/logger','api'];(function(_0x4f3baa,_0xec75ff){var _0x397e33=function(_0x185827){while(--_0x185827){_0x4f3baa['push'](_0x4f3baa['shift']());}};_0x397e33(++_0xec75ff);}(_0xc2d6,0x171));var _0x6c2d=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xc2d6[_0x43d11d];return _0x38cd08;};'use strict';var _=require('lodash');var util=require(_0x6c2d('0x0'));var logger=require(_0x6c2d('0x1'))(_0x6c2d('0x2'));var moment=require(_0x6c2d('0x3'));var BPromise=require(_0x6c2d('0x4'));var rp=require(_0x6c2d('0x5'));var fs=require('fs');var path=require(_0x6c2d('0x6'));var rimraf=require(_0x6c2d('0x7'));var config=require(_0x6c2d('0x8'));var attributes=require(_0x6c2d('0x9'));module['exports']=function(_0x1141f7,_0x3cf33f){return _0x1141f7[_0x6c2d('0xa')]('JscriptyProject',attributes,{'tableName':_0x6c2d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaba6=['define','jscripty_projects','lodash','util','request-promise','path','../../config/environment','./jscriptyProject.attributes'];(function(_0x43cba5,_0x4a2f83){var _0x359d1a=function(_0x888a02){while(--_0x888a02){_0x43cba5['push'](_0x43cba5['shift']());}};_0x359d1a(++_0x4a2f83);}(_0xaba6,0xe2));var _0x6aba=function(_0x11aadc,_0x1dd983){_0x11aadc=_0x11aadc-0x0;var _0x1a80bc=_0xaba6[_0x11aadc];return _0x1a80bc;};'use strict';var _=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6aba('0x2'));var fs=require('fs');var path=require(_0x6aba('0x3'));var rimraf=require('rimraf');var config=require(_0x6aba('0x4'));var attributes=require(_0x6aba('0x5'));module['exports']=function(_0x4e929a,_0x5ae14c){return _0x4e929a[_0x6aba('0x6')]('JscriptyProject',attributes,{'tableName':_0x6aba('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 8b19958..d9fda46 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x1209c3,_0x1bc3f0){var _0x37e8c2=function(_0x17a0d7){while(--_0x17a0d7){_0x1209c3['push'](_0x1209c3['shift']());}};_0x37e8c2(++_0x1bc3f0);}(_0x54ef,0x112));var _0xf54e=function(_0x56c9c5,_0x102eeb){_0x56c9c5=_0x56c9c5-0x0;var _0x5e0562=_0x54ef[_0x56c9c5];return _0x5e0562;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});} \ No newline at end of file +var _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2b379a,_0x2b2fba){var _0x7b2af4=function(_0x1f200f){while(--_0x1f200f){_0x2b379a['push'](_0x2b379a['shift']());}};_0x7b2af4(++_0x2b2fba);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index e9aa8ac..f4efd11 100644 --- a/server/api/jscriptyQuestionReport/index.js +++ b/server/api/jscriptyQuestionReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac10=['Router','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x31e40,_0x1bd772){var _0x1fd357=function(_0xf8947a){while(--_0xf8947a){_0x31e40['push'](_0x31e40['shift']());}};_0x1fd357(++_0x1bd772);}(_0xac10,0x14b));var _0x0ac1=function(_0x534617,_0x41a7ba){_0x534617=_0x534617-0x0;var _0x516e6a=_0xac10[_0x534617];return _0x516e6a;};'use strict';var multer=require(_0x0ac1('0x0'));var util=require(_0x0ac1('0x1'));var path=require(_0x0ac1('0x2'));var timeout=require(_0x0ac1('0x3'));var express=require(_0x0ac1('0x4'));var router=express[_0x0ac1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0ac1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0ac1('0x7'));var controller=require(_0x0ac1('0x8'));router[_0x0ac1('0x9')]('/',auth[_0x0ac1('0xa')](),controller[_0x0ac1('0xb')]);router['get']('/describe',auth[_0x0ac1('0xa')](),controller[_0x0ac1('0xc')]);router[_0x0ac1('0x9')](_0x0ac1('0xd'),auth[_0x0ac1('0xa')](),controller[_0x0ac1('0xe')]);router[_0x0ac1('0xf')]('/',auth[_0x0ac1('0xa')](),controller[_0x0ac1('0x10')]);router[_0x0ac1('0x11')](_0x0ac1('0xd'),auth[_0x0ac1('0xa')](),controller['update']);router[_0x0ac1('0x12')]('/:id',auth[_0x0ac1('0xa')](),controller[_0x0ac1('0x13')]);module[_0x0ac1('0x14')]=router; \ No newline at end of file +var _0x30fe=['../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','describe','post','create','put','/:id','update','delete','multer','util','path','express'];(function(_0x2f75d0,_0x5c990d){var _0x137d2d=function(_0x4d3042){while(--_0x4d3042){_0x2f75d0['push'](_0x2f75d0['shift']());}};_0x137d2d(++_0x5c990d);}(_0x30fe,0xd9));var _0xe30f=function(_0x1ae9ff,_0x89c032){_0x1ae9ff=_0x1ae9ff-0x0;var _0x4b16ea=_0x30fe[_0x1ae9ff];return _0x4b16ea;};'use strict';var multer=require(_0xe30f('0x0'));var util=require(_0xe30f('0x1'));var path=require(_0xe30f('0x2'));var timeout=require('connect-timeout');var express=require(_0xe30f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe30f('0x4'));var controller=require(_0xe30f('0x5'));router['get']('/',auth[_0xe30f('0x6')](),controller[_0xe30f('0x7')]);router[_0xe30f('0x8')](_0xe30f('0x9'),auth['isAuthenticated'](),controller[_0xe30f('0xa')]);router[_0xe30f('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xe30f('0xb')]('/',auth['isAuthenticated'](),controller[_0xe30f('0xc')]);router[_0xe30f('0xd')](_0xe30f('0xe'),auth[_0xe30f('0x6')](),controller[_0xe30f('0xf')]);router[_0xe30f('0x10')]('/:id',auth[_0xe30f('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 37a73db..60e9cc4 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a54,0x106));var _0x47a5=function(_0x4a693e,_0x18c135){_0x4a693e=_0x4a693e-0x0;var _0x1b9f0d=_0x7a54[_0x4a693e];return _0x1b9f0d;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7a54,0x106));var _0x47a5=function(_0x2d1e2f,_0x20c7ca){_0x2d1e2f=_0x2d1e2f-0x0;var _0x3eb57a=_0x7a54[_0x2d1e2f];return _0x3eb57a;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index b98d483..dad2911 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d84=['index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','options','JscriptyQuestionReport','includeAll','include','findAll','rows','catch','show','params','merge','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','sendStatus','error','stack','name','send'];(function(_0x2cb780,_0x587221){var _0x4bcb55=function(_0x93b04a){while(--_0x93b04a){_0x2cb780['push'](_0x2cb780['shift']());}};_0x4bcb55(++_0x587221);}(_0x2d84,0x6d));var _0x42d8=function(_0x54d87e,_0x5a5790){_0x54d87e=_0x54d87e-0x0;var _0x3f74fe=_0x2d84[_0x54d87e];return _0x3f74fe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x42d8('0x0'));var zipdir=require(_0x42d8('0x1'));var jsonpatch=require(_0x42d8('0x2'));var rp=require(_0x42d8('0x3'));var moment=require(_0x42d8('0x4'));var BPromise=require(_0x42d8('0x5'));var Mustache=require(_0x42d8('0x6'));var util=require(_0x42d8('0x7'));var path=require(_0x42d8('0x8'));var sox=require('sox');var csv=require(_0x42d8('0x9'));var ejs=require(_0x42d8('0xa'));var fs=require('fs');var fs_extra=require(_0x42d8('0xb'));var _=require(_0x42d8('0xc'));var squel=require('squel');var crypto=require(_0x42d8('0xd'));var jsforce=require(_0x42d8('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x42d8('0xf'));var Papa=require(_0x42d8('0x10'));var Redis=require('ioredis');var authService=require(_0x42d8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x42d8('0x12'));var hardwareService=require(_0x42d8('0x13'));var logger=require('../../config/logger')(_0x42d8('0x14'));var utils=require(_0x42d8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x42d8('0x16'));var db=require(_0x42d8('0x17'))['db'];function respondWithStatusCode(_0x1d46dc,_0x34c90b){_0x34c90b=_0x34c90b||0xcc;return function(_0x35ef27){if(_0x35ef27){return _0x1d46dc['sendStatus'](_0x34c90b);}return _0x1d46dc[_0x42d8('0x18')](_0x34c90b)[_0x42d8('0x19')]();};}function respondWithResult(_0x2549b0,_0x432e0f){_0x432e0f=_0x432e0f||0xc8;return function(_0x259020){if(_0x259020){return _0x2549b0[_0x42d8('0x18')](_0x432e0f)[_0x42d8('0x1a')](_0x259020);}};}function respondWithFilteredResult(_0x2a7cfe,_0x3d5f98){return function(_0x438fc0){if(_0x438fc0){var _0x2749e6=typeof _0x3d5f98[_0x42d8('0x1b')]===_0x42d8('0x1c')&&typeof _0x3d5f98[_0x42d8('0x1d')]===_0x42d8('0x1c');var _0x4dc1f4=_0x438fc0[_0x42d8('0x1e')];var _0x237e8f=_0x2749e6?0x0:_0x3d5f98['offset'];var _0x209dbc=_0x2749e6?_0x438fc0[_0x42d8('0x1e')]:_0x3d5f98[_0x42d8('0x1b')]+_0x3d5f98[_0x42d8('0x1d')];var _0xb0c0c0;if(_0x209dbc>=_0x4dc1f4){_0x209dbc=_0x4dc1f4;_0xb0c0c0=0xc8;}else{_0xb0c0c0=0xce;}_0x2a7cfe[_0x42d8('0x18')](_0xb0c0c0);return _0x2a7cfe[_0x42d8('0x1f')]('Content-Range',_0x237e8f+'-'+_0x209dbc+'/'+_0x4dc1f4)[_0x42d8('0x1a')](_0x438fc0);}return null;};}function patchUpdates(_0x59eeb7){return function(_0x1e1a38){try{jsonpatch[_0x42d8('0x20')](_0x1e1a38,_0x59eeb7,!![]);}catch(_0xc8894){return BPromise[_0x42d8('0x21')](_0xc8894);}return _0x1e1a38['save']();};}function saveUpdates(_0x8f1e89,_0x1144d0){return function(_0x5a6340){if(_0x5a6340){return _0x5a6340[_0x42d8('0x22')](_0x8f1e89)[_0x42d8('0x23')](function(_0x293cfb){return _0x293cfb;});}return null;};}function removeEntity(_0x5ed13b,_0x5260df){return function(_0x362610){if(_0x362610){return _0x362610['destroy']()[_0x42d8('0x23')](function(){_0x5ed13b[_0x42d8('0x18')](0xcc)[_0x42d8('0x19')]();});}};}function handleEntityNotFound(_0x21bec2,_0x5a3fda){return function(_0x13f5ff){if(!_0x13f5ff){_0x21bec2[_0x42d8('0x24')](0x194);}return _0x13f5ff;};}function handleError(_0x3746c8,_0xf3bda3){_0xf3bda3=_0xf3bda3||0x1f4;return function(_0x143e10){logger[_0x42d8('0x25')](_0x143e10[_0x42d8('0x26')]);if(_0x143e10[_0x42d8('0x27')]){delete _0x143e10['name'];}_0x3746c8[_0x42d8('0x18')](_0xf3bda3)[_0x42d8('0x28')](_0x143e10);};}exports[_0x42d8('0x29')]=function(_0x13b5c9,_0x5bb616){var _0x3ed97a={},_0x29125d={},_0x40a393={'count':0x0,'rows':[]};var _0x1df4bb=_[_0x42d8('0x2a')](db['JscriptyQuestionReport'][_0x42d8('0x2b')],function(_0x7c736){return{'name':_0x7c736[_0x42d8('0x2c')],'type':_0x7c736['type']['key']};});_0x29125d[_0x42d8('0x2d')]=_[_0x42d8('0x2a')](_0x1df4bb,_0x42d8('0x27'));_0x29125d[_0x42d8('0x2e')]=_[_0x42d8('0x2f')](_0x13b5c9[_0x42d8('0x2e')]);_0x29125d[_0x42d8('0x30')]=_[_0x42d8('0x31')](_0x29125d[_0x42d8('0x2d')],_0x29125d['query']);_0x3ed97a[_0x42d8('0x32')]=_[_0x42d8('0x31')](_0x29125d[_0x42d8('0x2d')],qs[_0x42d8('0x33')](_0x13b5c9[_0x42d8('0x2e')][_0x42d8('0x33')]));_0x3ed97a[_0x42d8('0x32')]=_0x3ed97a['attributes'][_0x42d8('0x34')]?_0x3ed97a[_0x42d8('0x32')]:_0x29125d['model'];if(!_0x13b5c9['query'][_0x42d8('0x35')](_0x42d8('0x36'))){_0x3ed97a[_0x42d8('0x1d')]=qs['limit'](_0x13b5c9[_0x42d8('0x2e')][_0x42d8('0x1d')]);_0x3ed97a[_0x42d8('0x1b')]=qs[_0x42d8('0x1b')](_0x13b5c9[_0x42d8('0x2e')][_0x42d8('0x1b')]);}_0x3ed97a[_0x42d8('0x37')]=qs[_0x42d8('0x38')](_0x13b5c9[_0x42d8('0x2e')][_0x42d8('0x38')]);_0x3ed97a[_0x42d8('0x39')]=qs[_0x42d8('0x30')](_[_0x42d8('0x3a')](_0x13b5c9[_0x42d8('0x2e')],_0x29125d['filters']),_0x1df4bb);if(_0x13b5c9['query'][_0x42d8('0x3b')]){_0x3ed97a[_0x42d8('0x39')]=_['merge'](_0x3ed97a[_0x42d8('0x39')],{'$or':_[_0x42d8('0x2a')](_0x1df4bb,function(_0x48ac3b){if(_0x48ac3b[_0x42d8('0x3c')]!=='VIRTUAL'){var _0x2bc4d8={};_0x2bc4d8[_0x48ac3b[_0x42d8('0x27')]]={'$like':'%'+_0x13b5c9[_0x42d8('0x2e')]['filter']+'%'};return _0x2bc4d8;}})});}_0x3ed97a=_['merge']({},_0x3ed97a,_0x13b5c9[_0x42d8('0x3d')]);var _0xe8b25={'where':_0x3ed97a[_0x42d8('0x39')]};return db[_0x42d8('0x3e')][_0x42d8('0x1e')](_0xe8b25)[_0x42d8('0x23')](function(_0x18324e){_0x40a393[_0x42d8('0x1e')]=_0x18324e;if(_0x13b5c9[_0x42d8('0x2e')][_0x42d8('0x3f')]){_0x3ed97a[_0x42d8('0x40')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x42d8('0x41')](_0x3ed97a);})[_0x42d8('0x23')](function(_0x39cb66){_0x40a393[_0x42d8('0x42')]=_0x39cb66;return _0x40a393;})[_0x42d8('0x23')](respondWithFilteredResult(_0x5bb616,_0x3ed97a))[_0x42d8('0x43')](handleError(_0x5bb616,null));};exports[_0x42d8('0x44')]=function(_0x203c4b,_0x1d65a7){var _0x250ee8={'raw':!![],'where':{'id':_0x203c4b[_0x42d8('0x45')]['id']}},_0x521ecf={};_0x521ecf[_0x42d8('0x2d')]=_[_0x42d8('0x2f')](db[_0x42d8('0x3e')][_0x42d8('0x2b')]);_0x521ecf[_0x42d8('0x2e')]=_['keys'](_0x203c4b[_0x42d8('0x2e')]);_0x521ecf['filters']=_[_0x42d8('0x31')](_0x521ecf['model'],_0x521ecf['query']);_0x250ee8[_0x42d8('0x32')]=_['intersection'](_0x521ecf[_0x42d8('0x2d')],qs[_0x42d8('0x33')](_0x203c4b[_0x42d8('0x2e')]['fields']));_0x250ee8[_0x42d8('0x32')]=_0x250ee8[_0x42d8('0x32')][_0x42d8('0x34')]?_0x250ee8['attributes']:_0x521ecf['model'];if(_0x203c4b['query']['includeAll']){_0x250ee8[_0x42d8('0x40')]=[{'all':!![]}];}_0x250ee8=_[_0x42d8('0x46')]({},_0x250ee8,_0x203c4b['options']);return db[_0x42d8('0x3e')]['find'](_0x250ee8)[_0x42d8('0x23')](handleEntityNotFound(_0x1d65a7,null))[_0x42d8('0x23')](respondWithResult(_0x1d65a7,null))[_0x42d8('0x43')](handleError(_0x1d65a7,null));};exports[_0x42d8('0x47')]=function(_0x9a027f,_0x8802ef){return db[_0x42d8('0x3e')][_0x42d8('0x47')](_0x9a027f[_0x42d8('0x48')],{})[_0x42d8('0x23')](respondWithResult(_0x8802ef,0xc9))['catch'](handleError(_0x8802ef,null));};exports[_0x42d8('0x22')]=function(_0x5efa97,_0xbe9668){if(_0x5efa97[_0x42d8('0x48')]['id']){delete _0x5efa97['body']['id'];}return db[_0x42d8('0x3e')][_0x42d8('0x49')]({'where':{'id':_0x5efa97['params']['id']}})[_0x42d8('0x23')](handleEntityNotFound(_0xbe9668,null))[_0x42d8('0x23')](saveUpdates(_0x5efa97[_0x42d8('0x48')],null))[_0x42d8('0x23')](respondWithResult(_0xbe9668,null))[_0x42d8('0x43')](handleError(_0xbe9668,null));};exports['destroy']=function(_0x4de4a9,_0x432cf3){return db[_0x42d8('0x3e')][_0x42d8('0x49')]({'where':{'id':_0x4de4a9[_0x42d8('0x45')]['id']}})[_0x42d8('0x23')](handleEntityNotFound(_0x432cf3,null))['then'](removeEntity(_0x432cf3,null))[_0x42d8('0x43')](handleError(_0x432cf3,null));};exports[_0x42d8('0x4a')]=function(_0x21974b,_0x8869c6){return db[_0x42d8('0x3e')][_0x42d8('0x4a')]()[_0x42d8('0x23')](respondWithResult(_0x8869c6,null))['catch'](handleError(_0x8869c6,null));}; \ No newline at end of file +var _0x1d84=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x45adb4,_0x2abb06){var _0x137296=function(_0x552ec9){while(--_0x552ec9){_0x45adb4['push'](_0x45adb4['shift']());}};_0x137296(++_0x2abb06);}(_0x1d84,0x173));var _0x41d8=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x1d84[_0x819464];return _0x49dcc0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x41d8('0x0'));var zipdir=require(_0x41d8('0x1'));var jsonpatch=require(_0x41d8('0x2'));var rp=require('request-promise');var moment=require(_0x41d8('0x3'));var BPromise=require(_0x41d8('0x4'));var Mustache=require('mustache');var util=require(_0x41d8('0x5'));var path=require(_0x41d8('0x6'));var sox=require(_0x41d8('0x7'));var csv=require(_0x41d8('0x8'));var ejs=require(_0x41d8('0x9'));var fs=require('fs');var fs_extra=require(_0x41d8('0xa'));var _=require(_0x41d8('0xb'));var squel=require(_0x41d8('0xc'));var crypto=require(_0x41d8('0xd'));var jsforce=require(_0x41d8('0xe'));var deskjs=require(_0x41d8('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x41d8('0x10'));var Redis=require(_0x41d8('0x11'));var authService=require(_0x41d8('0x12'));var qs=require(_0x41d8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x41d8('0x14'));var logger=require(_0x41d8('0x15'))(_0x41d8('0x16'));var utils=require('../../config/utils');var config=require(_0x41d8('0x17'));var licenseUtil=require(_0x41d8('0x18'));var db=require(_0x41d8('0x19'))['db'];function respondWithStatusCode(_0x587f22,_0x4eac37){_0x4eac37=_0x4eac37||0xcc;return function(_0x4e5a11){if(_0x4e5a11){return _0x587f22[_0x41d8('0x1a')](_0x4eac37);}return _0x587f22[_0x41d8('0x1b')](_0x4eac37)[_0x41d8('0x1c')]();};}function respondWithResult(_0x433ec2,_0x1ba02f){_0x1ba02f=_0x1ba02f||0xc8;return function(_0x424358){if(_0x424358){return _0x433ec2['status'](_0x1ba02f)[_0x41d8('0x1d')](_0x424358);}};}function respondWithFilteredResult(_0x810b4f,_0x2474da){return function(_0x532200){if(_0x532200){var _0x2ec0c7=typeof _0x2474da[_0x41d8('0x1e')]===_0x41d8('0x1f')&&typeof _0x2474da[_0x41d8('0x20')]===_0x41d8('0x1f');var _0x4e8503=_0x532200['count'];var _0x5839b3=_0x2ec0c7?0x0:_0x2474da[_0x41d8('0x1e')];var _0xcb0217=_0x2ec0c7?_0x532200[_0x41d8('0x21')]:_0x2474da['offset']+_0x2474da[_0x41d8('0x20')];var _0x466903;if(_0xcb0217>=_0x4e8503){_0xcb0217=_0x4e8503;_0x466903=0xc8;}else{_0x466903=0xce;}_0x810b4f[_0x41d8('0x1b')](_0x466903);return _0x810b4f[_0x41d8('0x22')](_0x41d8('0x23'),_0x5839b3+'-'+_0xcb0217+'/'+_0x4e8503)[_0x41d8('0x1d')](_0x532200);}return null;};}function patchUpdates(_0x123095){return function(_0x1bd770){try{jsonpatch['apply'](_0x1bd770,_0x123095,!![]);}catch(_0x55db03){return BPromise[_0x41d8('0x24')](_0x55db03);}return _0x1bd770[_0x41d8('0x25')]();};}function saveUpdates(_0xdbdd1,_0x1a6665){return function(_0x225106){if(_0x225106){return _0x225106[_0x41d8('0x26')](_0xdbdd1)[_0x41d8('0x27')](function(_0x2ade16){return _0x2ade16;});}return null;};}function removeEntity(_0xce3ecf,_0xd1f50d){return function(_0x2fc92d){if(_0x2fc92d){return _0x2fc92d[_0x41d8('0x28')]()[_0x41d8('0x27')](function(){_0xce3ecf[_0x41d8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d009a,_0x379a3f){return function(_0x556727){if(!_0x556727){_0x4d009a[_0x41d8('0x1a')](0x194);}return _0x556727;};}function handleError(_0x4e591c,_0x2ea3dd){_0x2ea3dd=_0x2ea3dd||0x1f4;return function(_0x105d1d){logger[_0x41d8('0x29')](_0x105d1d[_0x41d8('0x2a')]);if(_0x105d1d[_0x41d8('0x2b')]){delete _0x105d1d[_0x41d8('0x2b')];}_0x4e591c[_0x41d8('0x1b')](_0x2ea3dd)[_0x41d8('0x2c')](_0x105d1d);};}exports[_0x41d8('0x2d')]=function(_0x739d8a,_0x2663d6){var _0x49f70d={},_0x153d02={},_0x1521f2={'count':0x0,'rows':[]};var _0x148ccc=_[_0x41d8('0x2e')](db[_0x41d8('0x2f')][_0x41d8('0x30')],function(_0x4c9059){return{'name':_0x4c9059[_0x41d8('0x31')],'type':_0x4c9059[_0x41d8('0x32')][_0x41d8('0x33')]};});_0x153d02['model']=_[_0x41d8('0x2e')](_0x148ccc,_0x41d8('0x2b'));_0x153d02['query']=_[_0x41d8('0x34')](_0x739d8a['query']);_0x153d02['filters']=_[_0x41d8('0x35')](_0x153d02[_0x41d8('0x36')],_0x153d02[_0x41d8('0x37')]);_0x49f70d[_0x41d8('0x38')]=_['intersection'](_0x153d02[_0x41d8('0x36')],qs[_0x41d8('0x39')](_0x739d8a['query'][_0x41d8('0x39')]));_0x49f70d['attributes']=_0x49f70d[_0x41d8('0x38')][_0x41d8('0x3a')]?_0x49f70d[_0x41d8('0x38')]:_0x153d02['model'];if(!_0x739d8a[_0x41d8('0x37')][_0x41d8('0x3b')](_0x41d8('0x3c'))){_0x49f70d['limit']=qs['limit'](_0x739d8a[_0x41d8('0x37')][_0x41d8('0x20')]);_0x49f70d[_0x41d8('0x1e')]=qs[_0x41d8('0x1e')](_0x739d8a[_0x41d8('0x37')][_0x41d8('0x1e')]);}_0x49f70d[_0x41d8('0x3d')]=qs['sort'](_0x739d8a[_0x41d8('0x37')]['sort']);_0x49f70d[_0x41d8('0x3e')]=qs[_0x41d8('0x3f')](_[_0x41d8('0x40')](_0x739d8a[_0x41d8('0x37')],_0x153d02[_0x41d8('0x3f')]),_0x148ccc);if(_0x739d8a[_0x41d8('0x37')][_0x41d8('0x41')]){_0x49f70d['where']=_['merge'](_0x49f70d[_0x41d8('0x3e')],{'$or':_['map'](_0x148ccc,function(_0x1d36c1){if(_0x1d36c1[_0x41d8('0x32')]!==_0x41d8('0x42')){var _0x312805={};_0x312805[_0x1d36c1[_0x41d8('0x2b')]]={'$like':'%'+_0x739d8a[_0x41d8('0x37')][_0x41d8('0x41')]+'%'};return _0x312805;}})});}_0x49f70d=_[_0x41d8('0x43')]({},_0x49f70d,_0x739d8a[_0x41d8('0x44')]);var _0x192056={'where':_0x49f70d[_0x41d8('0x3e')]};return db['JscriptyQuestionReport'][_0x41d8('0x21')](_0x192056)['then'](function(_0x31f032){_0x1521f2[_0x41d8('0x21')]=_0x31f032;if(_0x739d8a[_0x41d8('0x37')][_0x41d8('0x45')]){_0x49f70d[_0x41d8('0x46')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x41d8('0x47')](_0x49f70d);})['then'](function(_0x239c4a){_0x1521f2[_0x41d8('0x48')]=_0x239c4a;return _0x1521f2;})[_0x41d8('0x27')](respondWithFilteredResult(_0x2663d6,_0x49f70d))[_0x41d8('0x49')](handleError(_0x2663d6,null));};exports['show']=function(_0x259a13,_0x1fbcd9){var _0xc793fa={'raw':!![],'where':{'id':_0x259a13[_0x41d8('0x4a')]['id']}},_0x51453d={};_0x51453d['model']=_['keys'](db[_0x41d8('0x2f')][_0x41d8('0x30')]);_0x51453d['query']=_[_0x41d8('0x34')](_0x259a13[_0x41d8('0x37')]);_0x51453d['filters']=_[_0x41d8('0x35')](_0x51453d[_0x41d8('0x36')],_0x51453d[_0x41d8('0x37')]);_0xc793fa['attributes']=_[_0x41d8('0x35')](_0x51453d[_0x41d8('0x36')],qs[_0x41d8('0x39')](_0x259a13['query'][_0x41d8('0x39')]));_0xc793fa[_0x41d8('0x38')]=_0xc793fa[_0x41d8('0x38')][_0x41d8('0x3a')]?_0xc793fa[_0x41d8('0x38')]:_0x51453d[_0x41d8('0x36')];if(_0x259a13[_0x41d8('0x37')]['includeAll']){_0xc793fa[_0x41d8('0x46')]=[{'all':!![]}];}_0xc793fa=_[_0x41d8('0x43')]({},_0xc793fa,_0x259a13[_0x41d8('0x44')]);return db[_0x41d8('0x2f')][_0x41d8('0x4b')](_0xc793fa)[_0x41d8('0x27')](handleEntityNotFound(_0x1fbcd9,null))[_0x41d8('0x27')](respondWithResult(_0x1fbcd9,null))[_0x41d8('0x49')](handleError(_0x1fbcd9,null));};exports[_0x41d8('0x4c')]=function(_0x55f7b0,_0x1a9a18){return db['JscriptyQuestionReport'][_0x41d8('0x4c')](_0x55f7b0[_0x41d8('0x4d')],{})[_0x41d8('0x27')](respondWithResult(_0x1a9a18,0xc9))['catch'](handleError(_0x1a9a18,null));};exports[_0x41d8('0x26')]=function(_0x386e52,_0x3615f2){if(_0x386e52[_0x41d8('0x4d')]['id']){delete _0x386e52['body']['id'];}return db[_0x41d8('0x2f')][_0x41d8('0x4b')]({'where':{'id':_0x386e52['params']['id']}})[_0x41d8('0x27')](handleEntityNotFound(_0x3615f2,null))['then'](saveUpdates(_0x386e52['body'],null))[_0x41d8('0x27')](respondWithResult(_0x3615f2,null))[_0x41d8('0x49')](handleError(_0x3615f2,null));};exports[_0x41d8('0x28')]=function(_0x42acff,_0x2bd59f){return db[_0x41d8('0x2f')][_0x41d8('0x4b')]({'where':{'id':_0x42acff['params']['id']}})['then'](handleEntityNotFound(_0x2bd59f,null))[_0x41d8('0x27')](removeEntity(_0x2bd59f,null))[_0x41d8('0x49')](handleError(_0x2bd59f,null));};exports[_0x41d8('0x4e')]=function(_0x458552,_0x3b3939){return db[_0x41d8('0x2f')][_0x41d8('0x4e')]()[_0x41d8('0x27')](respondWithResult(_0x3b3939,null))[_0x41d8('0x49')](handleError(_0x3b3939,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index a063729..5d1ffa9 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x963d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','define','JscriptyQuestionReport'];(function(_0xaee9b2,_0x4f74cf){var _0x8c26c1=function(_0x252b5a){while(--_0x252b5a){_0xaee9b2['push'](_0xaee9b2['shift']());}};_0x8c26c1(++_0x4f74cf);}(_0x963d,0xaa));var _0xd963=function(_0x40bb62,_0x572bfe){_0x40bb62=_0x40bb62-0x0;var _0x235725=_0x963d[_0x40bb62];return _0x235725;};'use strict';var _=require(_0xd963('0x0'));var util=require(_0xd963('0x1'));var logger=require(_0xd963('0x2'))(_0xd963('0x3'));var moment=require(_0xd963('0x4'));var BPromise=require(_0xd963('0x5'));var rp=require(_0xd963('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd963('0x7'));var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x2579ac,_0x12b5e0){return _0x2579ac[_0xd963('0x8')](_0xd963('0x9'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7ae=['../../config/logger','moment','request-promise','../../config/environment','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','report_jscripty_questions','lodash','util'];(function(_0x40ebb7,_0xa32cf5){var _0x51285f=function(_0x8670c8){while(--_0x8670c8){_0x40ebb7['push'](_0x40ebb7['shift']());}};_0x51285f(++_0xa32cf5);}(_0xd7ae,0x120));var _0xed7a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd7ae[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xed7a('0x0'));var util=require(_0xed7a('0x1'));var logger=require(_0xed7a('0x2'))('api');var moment=require(_0xed7a('0x3'));var BPromise=require('bluebird');var rp=require(_0xed7a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xed7a('0x5'));var attributes=require(_0xed7a('0x6'));module[_0xed7a('0x7')]=function(_0x65f15b,_0x4e16ec){return _0x65f15b['define'](_0xed7a('0x8'),attributes,{'tableName':_0xed7a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 1330602..87b29e4 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ca4=['../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','JscriptyQuestionReport,\x20%s,\x20%s','info','result','catch','lodash','util','moment','randomstring'];(function(_0x11f168,_0x36fd15){var _0x3a5e27=function(_0x3274e1){while(--_0x3274e1){_0x11f168['push'](_0x11f168['shift']());}};_0x3a5e27(++_0x36fd15);}(_0x7ca4,0x1dc));var _0x47ca=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7ca4[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x47ca('0x0'));var util=require(_0x47ca('0x1'));var moment=require(_0x47ca('0x2'));var BPromise=require('bluebird');var rs=require(_0x47ca('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x47ca('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x47ca('0x5'));var config=require(_0x47ca('0x6'));var jayson=require(_0x47ca('0x7'));var client=jayson['client'][_0x47ca('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13f1c6,_0x207eda,_0x5c77ff){return new BPromise(function(_0x18c32c,_0x2e01dc){return client[_0x47ca('0x9')](_0x13f1c6,_0x5c77ff)['then'](function(_0x1a13bd){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x207eda,_0x47ca('0xa'));logger[_0x47ca('0xb')](_0x47ca('0xc'),_0x207eda,'request\x20sent',JSON[_0x47ca('0xd')](_0x1a13bd));if(_0x1a13bd[_0x47ca('0xe')]){if(_0x1a13bd['error']['code']===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x207eda,_0x1a13bd[_0x47ca('0xe')][_0x47ca('0xf')]);return _0x2e01dc(_0x1a13bd['error'][_0x47ca('0xf')]);}logger[_0x47ca('0xe')](_0x47ca('0x10'),_0x207eda,_0x1a13bd['error'][_0x47ca('0xf')]);return _0x18c32c(_0x1a13bd['error'][_0x47ca('0xf')]);}else{logger[_0x47ca('0x11')](_0x47ca('0x10'),_0x207eda,'request\x20sent');_0x18c32c(_0x1a13bd[_0x47ca('0x12')][_0x47ca('0xf')]);}})[_0x47ca('0x13')](function(_0x3b2ebb){logger[_0x47ca('0xe')](_0x47ca('0x10'),_0x207eda,_0x3b2ebb);_0x2e01dc(_0x3b2ebb);});});} \ No newline at end of file +var _0x189e=['message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xb1c60b,_0x385134){var _0x4c391d=function(_0x34a8f3){while(--_0x34a8f3){_0xb1c60b['push'](_0xb1c60b['shift']());}};_0x4c391d(++_0x385134);}(_0x189e,0x70));var _0xe189=function(_0x58ad88,_0x19e7b4){_0x58ad88=_0x58ad88-0x0;var _0xda2e75=_0x189e[_0x58ad88];return _0xda2e75;};'use strict';var _=require(_0xe189('0x0'));var util=require(_0xe189('0x1'));var moment=require(_0xe189('0x2'));var BPromise=require(_0xe189('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe189('0x4'))['db'];var utils=require(_0xe189('0x5'));var logger=require(_0xe189('0x6'))(_0xe189('0x7'));var config=require('../../config/environment');var jayson=require(_0xe189('0x8'));var client=jayson[_0xe189('0x9')][_0xe189('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31965a,_0x2d70a9,_0x49d5e2){return new BPromise(function(_0x1a77bf,_0x58578d){return client[_0xe189('0xb')](_0x31965a,_0x49d5e2)[_0xe189('0xc')](function(_0x33fd4b){logger[_0xe189('0xd')](_0xe189('0xe'),_0x2d70a9,_0xe189('0xf'));logger[_0xe189('0x10')](_0xe189('0x11'),_0x2d70a9,_0xe189('0xf'),JSON[_0xe189('0x12')](_0x33fd4b));if(_0x33fd4b[_0xe189('0x13')]){if(_0x33fd4b['error']['code']===0x1f4){logger[_0xe189('0x13')](_0xe189('0xe'),_0x2d70a9,_0x33fd4b[_0xe189('0x13')][_0xe189('0x14')]);return _0x58578d(_0x33fd4b[_0xe189('0x13')][_0xe189('0x14')]);}logger[_0xe189('0x13')](_0xe189('0xe'),_0x2d70a9,_0x33fd4b['error'][_0xe189('0x14')]);return _0x1a77bf(_0x33fd4b[_0xe189('0x13')][_0xe189('0x14')]);}else{logger[_0xe189('0xd')](_0xe189('0xe'),_0x2d70a9,_0xe189('0xf'));_0x1a77bf(_0x33fd4b['result'][_0xe189('0x14')]);}})[_0xe189('0x15')](function(_0x51d7a5){logger['error'](_0xe189('0xe'),_0x2d70a9,_0x51d7a5);_0x58578d(_0x51d7a5);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index c027b07..9cc2227 100644 --- a/server/api/jscriptySessionReport/index.js +++ b/server/api/jscriptySessionReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87fe=['connect-timeout','express','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','post','put','delete','destroy','exports','multer','util','path'];(function(_0x4e37bc,_0x8174e7){var _0x48a8b7=function(_0x458409){while(--_0x458409){_0x4e37bc['push'](_0x4e37bc['shift']());}};_0x48a8b7(++_0x8174e7);}(_0x87fe,0x165));var _0xe87f=function(_0x1e3c02,_0x5c07a2){_0x1e3c02=_0x1e3c02-0x0;var _0x4d26d7=_0x87fe[_0x1e3c02];return _0x4d26d7;};'use strict';var multer=require(_0xe87f('0x0'));var util=require(_0xe87f('0x1'));var path=require(_0xe87f('0x2'));var timeout=require(_0xe87f('0x3'));var express=require(_0xe87f('0x4'));var router=express['Router']();var fs_extra=require(_0xe87f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe87f('0x6'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0xe87f('0x7')](),controller[_0xe87f('0x8')]);router[_0xe87f('0x9')](_0xe87f('0xa'),auth[_0xe87f('0x7')](),controller[_0xe87f('0xb')]);router[_0xe87f('0x9')](_0xe87f('0xc'),auth[_0xe87f('0x7')](),controller['show']);router[_0xe87f('0x9')]('/:id/questions',auth[_0xe87f('0x7')](),controller['getQuestions']);router[_0xe87f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe87f('0xe')](_0xe87f('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xe87f('0xf')](_0xe87f('0xc'),auth['isAuthenticated'](),controller[_0xe87f('0x10')]);module[_0xe87f('0x11')]=router; \ No newline at end of file +var _0x591c=['create','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./jscriptySessionReport.controller','get','describe','isAuthenticated','show','/:id/questions','getQuestions','post'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x591c,0x116));var _0xc591=function(_0x2ade6c,_0x2d42f2){_0x2ade6c=_0x2ade6c-0x0;var _0x2cb372=_0x591c[_0x2ade6c];return _0x2cb372;};'use strict';var multer=require(_0xc591('0x0'));var util=require(_0xc591('0x1'));var path=require(_0xc591('0x2'));var timeout=require(_0xc591('0x3'));var express=require(_0xc591('0x4'));var router=express[_0xc591('0x5')]();var fs_extra=require(_0xc591('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc591('0x7'));var config=require('../../config/environment');var controller=require(_0xc591('0x8'));router[_0xc591('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc591('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xc591('0xa')]);router[_0xc591('0x9')]('/:id',auth[_0xc591('0xb')](),controller[_0xc591('0xc')]);router[_0xc591('0x9')](_0xc591('0xd'),auth[_0xc591('0xb')](),controller[_0xc591('0xe')]);router[_0xc591('0xf')]('/',auth[_0xc591('0xb')](),controller[_0xc591('0x10')]);router[_0xc591('0x11')](_0xc591('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xc591('0x13')](_0xc591('0x12'),auth[_0xc591('0xb')](),controller['destroy']);module[_0xc591('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index b584486..bb2f453 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdbed=['sequelize','exports','DATE','setDataValue','STRING','BOOLEAN','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xdbed,0xca));var _0xddbe=function(_0x345133,_0x216ea6){_0x345133=_0x345133-0x0;var _0x3dd28a=_0xdbed[_0x345133];return _0x3dd28a;};'use strict';var moment=require(_0xddbe('0x0'));var Sequelize=require(_0xddbe('0x1'));module[_0xddbe('0x2')]={'starttime':{'type':Sequelize[_0xddbe('0x3')],'set':function(_0x4f7e45){this[_0xddbe('0x4')]('starttime',_0x4f7e45);this['setDataValue']('endtime',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xddbe('0x3')]},'membername':{'type':Sequelize[_0xddbe('0x5')]},'projectname':{'type':Sequelize[_0xddbe('0x5')]},'queue':{'type':Sequelize[_0xddbe('0x5')]},'uniqueid':{'type':Sequelize[_0xddbe('0x5')]},'calleridname':{'type':Sequelize[_0xddbe('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xddbe('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x23ce=['STRING','BOOLEAN','moment','sequelize','DATE','starttime','endtime','format'];(function(_0x249611,_0x52dbb0){var _0x1f23bd=function(_0x37509e){while(--_0x37509e){_0x249611['push'](_0x249611['shift']());}};_0x1f23bd(++_0x52dbb0);}(_0x23ce,0x1e2));var _0xe23c=function(_0x85953f,_0x2decd2){_0x85953f=_0x85953f-0x0;var _0x35a9c5=_0x23ce[_0x85953f];return _0x35a9c5;};'use strict';var moment=require(_0xe23c('0x0'));var Sequelize=require(_0xe23c('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xe23c('0x2')],'set':function(_0x3eef00){this['setDataValue'](_0xe23c('0x3'),_0x3eef00);this['setDataValue'](_0xe23c('0x4'),moment()[_0xe23c('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xe23c('0x2')]},'membername':{'type':Sequelize[_0xe23c('0x6')]},'projectname':{'type':Sequelize[_0xe23c('0x6')]},'queue':{'type':Sequelize[_0xe23c('0x6')]},'uniqueid':{'type':Sequelize[_0xe23c('0x6')]},'calleridname':{'type':Sequelize[_0xe23c('0x6')]},'calleridnum':{'type':Sequelize[_0xe23c('0x6')]},'completed':{'type':Sequelize[_0xe23c('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index ed8e8c0..7ca31fb 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45ee=['find','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','sort','findAll','rows','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','limit','offset','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','name','send','index','map','JscriptySessionReport','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','rawAttributes','intersection','length'];(function(_0x305560,_0x3adb64){var _0x3c2ae2=function(_0x33e61d){while(--_0x33e61d){_0x305560['push'](_0x305560['shift']());}};_0x3c2ae2(++_0x3adb64);}(_0x45ee,0xfe));var _0xe45e=function(_0xb314a6,_0x3e9b41){_0xb314a6=_0xb314a6-0x0;var _0x1a5c11=_0x45ee[_0xb314a6];return _0x1a5c11;};'use strict';var emlformat=require(_0xe45e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe45e('0x1'));var jsonpatch=require(_0xe45e('0x2'));var rp=require(_0xe45e('0x3'));var moment=require(_0xe45e('0x4'));var BPromise=require(_0xe45e('0x5'));var Mustache=require(_0xe45e('0x6'));var util=require(_0xe45e('0x7'));var path=require(_0xe45e('0x8'));var sox=require(_0xe45e('0x9'));var csv=require(_0xe45e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe45e('0xb'));var _=require(_0xe45e('0xc'));var squel=require(_0xe45e('0xd'));var crypto=require('crypto');var jsforce=require(_0xe45e('0xe'));var deskjs=require(_0xe45e('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe45e('0x10'));var Redis=require(_0xe45e('0x11'));var authService=require(_0xe45e('0x12'));var qs=require(_0xe45e('0x13'));var as=require(_0xe45e('0x14'));var hardwareService=require(_0xe45e('0x15'));var logger=require('../../config/logger')(_0xe45e('0x16'));var utils=require(_0xe45e('0x17'));var config=require(_0xe45e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe45e('0x19'))['db'];function respondWithStatusCode(_0x1e8673,_0x288130){_0x288130=_0x288130||0xcc;return function(_0x58c81e){if(_0x58c81e){return _0x1e8673['sendStatus'](_0x288130);}return _0x1e8673['status'](_0x288130)[_0xe45e('0x1a')]();};}function respondWithResult(_0x42e0d9,_0x5491c9){_0x5491c9=_0x5491c9||0xc8;return function(_0x1dc5f1){if(_0x1dc5f1){return _0x42e0d9[_0xe45e('0x1b')](_0x5491c9)[_0xe45e('0x1c')](_0x1dc5f1);}};}function respondWithFilteredResult(_0x548cbb,_0x2c60a3){return function(_0x4bdaa2){if(_0x4bdaa2){var _0x5b0d4d=typeof _0x2c60a3['offset']==='undefined'&&typeof _0x2c60a3[_0xe45e('0x1d')]==='undefined';var _0x4fe5a6=_0x4bdaa2['count'];var _0x2f6a88=_0x5b0d4d?0x0:_0x2c60a3[_0xe45e('0x1e')];var _0x2926b4=_0x5b0d4d?_0x4bdaa2[_0xe45e('0x1f')]:_0x2c60a3[_0xe45e('0x1e')]+_0x2c60a3[_0xe45e('0x1d')];var _0x167ede;if(_0x2926b4>=_0x4fe5a6){_0x2926b4=_0x4fe5a6;_0x167ede=0xc8;}else{_0x167ede=0xce;}_0x548cbb[_0xe45e('0x1b')](_0x167ede);return _0x548cbb[_0xe45e('0x20')](_0xe45e('0x21'),_0x2f6a88+'-'+_0x2926b4+'/'+_0x4fe5a6)[_0xe45e('0x1c')](_0x4bdaa2);}return null;};}function patchUpdates(_0x48d3fb){return function(_0x246ffb){try{jsonpatch[_0xe45e('0x22')](_0x246ffb,_0x48d3fb,!![]);}catch(_0x2fb7fa){return BPromise['reject'](_0x2fb7fa);}return _0x246ffb['save']();};}function saveUpdates(_0x2a2f11,_0x420309){return function(_0x49ee47){if(_0x49ee47){return _0x49ee47[_0xe45e('0x23')](_0x2a2f11)[_0xe45e('0x24')](function(_0x399e53){return _0x399e53;});}return null;};}function removeEntity(_0x4c8cdb,_0x5b39cb){return function(_0x4afd84){if(_0x4afd84){return _0x4afd84[_0xe45e('0x25')]()[_0xe45e('0x24')](function(){_0x4c8cdb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3281f7,_0x39d017){return function(_0x198658){if(!_0x198658){_0x3281f7[_0xe45e('0x26')](0x194);}return _0x198658;};}function handleError(_0x3ff65c,_0x47992f){_0x47992f=_0x47992f||0x1f4;return function(_0xe262f0){logger[_0xe45e('0x27')](_0xe262f0['stack']);if(_0xe262f0[_0xe45e('0x28')]){delete _0xe262f0[_0xe45e('0x28')];}_0x3ff65c['status'](_0x47992f)[_0xe45e('0x29')](_0xe262f0);};}exports[_0xe45e('0x2a')]=function(_0xd8ccb8,_0x5495c3){var _0x247d3a={},_0x36679f={},_0x1196cb={'count':0x0,'rows':[]};var _0x3da281=_[_0xe45e('0x2b')](db[_0xe45e('0x2c')]['rawAttributes'],function(_0x54daa9){return{'name':_0x54daa9[_0xe45e('0x2d')],'type':_0x54daa9[_0xe45e('0x2e')][_0xe45e('0x2f')]};});_0x36679f[_0xe45e('0x30')]=_['map'](_0x3da281,_0xe45e('0x28'));_0x36679f[_0xe45e('0x31')]=_[_0xe45e('0x32')](_0xd8ccb8['query']);_0x36679f[_0xe45e('0x33')]=_['intersection'](_0x36679f[_0xe45e('0x30')],_0x36679f[_0xe45e('0x31')]);_0x247d3a[_0xe45e('0x34')]=_['intersection'](_0x36679f[_0xe45e('0x30')],qs[_0xe45e('0x35')](_0xd8ccb8[_0xe45e('0x31')][_0xe45e('0x35')]));_0x247d3a[_0xe45e('0x34')]=_0x247d3a[_0xe45e('0x34')]['length']?_0x247d3a['attributes']:_0x36679f[_0xe45e('0x30')];if(!_0xd8ccb8[_0xe45e('0x31')][_0xe45e('0x36')](_0xe45e('0x37'))){_0x247d3a[_0xe45e('0x1d')]=qs[_0xe45e('0x1d')](_0xd8ccb8[_0xe45e('0x31')][_0xe45e('0x1d')]);_0x247d3a[_0xe45e('0x1e')]=qs[_0xe45e('0x1e')](_0xd8ccb8['query'][_0xe45e('0x1e')]);}_0x247d3a[_0xe45e('0x38')]=qs['sort'](_0xd8ccb8[_0xe45e('0x31')]['sort']);_0x247d3a[_0xe45e('0x39')]=qs[_0xe45e('0x33')](_[_0xe45e('0x3a')](_0xd8ccb8[_0xe45e('0x31')],_0x36679f[_0xe45e('0x33')]),_0x3da281);if(_0xd8ccb8[_0xe45e('0x31')][_0xe45e('0x3b')]){_0x247d3a[_0xe45e('0x39')]=_[_0xe45e('0x3c')](_0x247d3a[_0xe45e('0x39')],{'$or':_['map'](_0x3da281,function(_0x352d92){if(_0x352d92[_0xe45e('0x2e')]!==_0xe45e('0x3d')){var _0x42e6be={};_0x42e6be[_0x352d92[_0xe45e('0x28')]]={'$like':'%'+_0xd8ccb8['query'][_0xe45e('0x3b')]+'%'};return _0x42e6be;}})});}_0x247d3a=_['merge']({},_0x247d3a,_0xd8ccb8[_0xe45e('0x3e')]);var _0x4714c4={'where':_0x247d3a[_0xe45e('0x39')]};return db[_0xe45e('0x2c')][_0xe45e('0x1f')](_0x4714c4)[_0xe45e('0x24')](function(_0x554d24){_0x1196cb['count']=_0x554d24;if(_0xd8ccb8['query'][_0xe45e('0x3f')]){_0x247d3a[_0xe45e('0x40')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x247d3a);})[_0xe45e('0x24')](function(_0x178c48){_0x1196cb['rows']=_0x178c48;return _0x1196cb;})['then'](respondWithFilteredResult(_0x5495c3,_0x247d3a))[_0xe45e('0x41')](handleError(_0x5495c3,null));};exports[_0xe45e('0x42')]=function(_0xf58ba6,_0x198c31){var _0x4ab80b={'raw':!![],'where':{'id':_0xf58ba6['params']['id']}},_0xc72f57={};_0xc72f57[_0xe45e('0x30')]=_['keys'](db[_0xe45e('0x2c')][_0xe45e('0x43')]);_0xc72f57[_0xe45e('0x31')]=_[_0xe45e('0x32')](_0xf58ba6[_0xe45e('0x31')]);_0xc72f57['filters']=_[_0xe45e('0x44')](_0xc72f57[_0xe45e('0x30')],_0xc72f57[_0xe45e('0x31')]);_0x4ab80b[_0xe45e('0x34')]=_[_0xe45e('0x44')](_0xc72f57[_0xe45e('0x30')],qs[_0xe45e('0x35')](_0xf58ba6[_0xe45e('0x31')][_0xe45e('0x35')]));_0x4ab80b[_0xe45e('0x34')]=_0x4ab80b[_0xe45e('0x34')][_0xe45e('0x45')]?_0x4ab80b[_0xe45e('0x34')]:_0xc72f57['model'];if(_0xf58ba6[_0xe45e('0x31')]['includeAll']){_0x4ab80b[_0xe45e('0x40')]=[{'all':!![]}];}_0x4ab80b=_[_0xe45e('0x3c')]({},_0x4ab80b,_0xf58ba6[_0xe45e('0x3e')]);return db[_0xe45e('0x2c')][_0xe45e('0x46')](_0x4ab80b)['then'](handleEntityNotFound(_0x198c31,null))[_0xe45e('0x24')](respondWithResult(_0x198c31,null))[_0xe45e('0x41')](handleError(_0x198c31,null));};exports[_0xe45e('0x47')]=function(_0x38cf6c,_0x3286f2){return db[_0xe45e('0x2c')][_0xe45e('0x47')](_0x38cf6c[_0xe45e('0x48')],{})[_0xe45e('0x24')](respondWithResult(_0x3286f2,0xc9))[_0xe45e('0x41')](handleError(_0x3286f2,null));};exports[_0xe45e('0x23')]=function(_0x112bc8,_0x3a6f8a){if(_0x112bc8['body']['id']){delete _0x112bc8[_0xe45e('0x48')]['id'];}return db[_0xe45e('0x2c')][_0xe45e('0x46')]({'where':{'id':_0x112bc8[_0xe45e('0x49')]['id']}})['then'](handleEntityNotFound(_0x3a6f8a,null))[_0xe45e('0x24')](saveUpdates(_0x112bc8[_0xe45e('0x48')],null))[_0xe45e('0x24')](respondWithResult(_0x3a6f8a,null))[_0xe45e('0x41')](handleError(_0x3a6f8a,null));};exports[_0xe45e('0x25')]=function(_0x39bb7d,_0x2f76b0){return db[_0xe45e('0x2c')][_0xe45e('0x46')]({'where':{'id':_0x39bb7d[_0xe45e('0x49')]['id']}})[_0xe45e('0x24')](handleEntityNotFound(_0x2f76b0,null))[_0xe45e('0x24')](removeEntity(_0x2f76b0,null))['catch'](handleError(_0x2f76b0,null));};exports['describe']=function(_0x2fcfc8,_0x324f92){return db[_0xe45e('0x2c')][_0xe45e('0x4a')]()[_0xe45e('0x24')](respondWithResult(_0x324f92,null))[_0xe45e('0x41')](handleError(_0x324f92,null));};exports[_0xe45e('0x4b')]=function(_0x7ea0cc,_0x44787c,_0x5c3cc1){var _0x1fb487={'raw':!![],'where':{}};var _0x49d8b8={};var _0x57bad4={'count':0x0,'rows':[]};return db[_0xe45e('0x2c')][_0xe45e('0x4c')]({'where':{'id':_0x7ea0cc[_0xe45e('0x49')]['id']}})[_0xe45e('0x24')](handleEntityNotFound(_0x44787c,null))[_0xe45e('0x24')](function(_0x58151b){if(_0x58151b){_0x49d8b8[_0xe45e('0x30')]=_['keys'](db[_0xe45e('0x4d')]['rawAttributes']);_0x49d8b8[_0xe45e('0x31')]=_[_0xe45e('0x32')](_0x7ea0cc[_0xe45e('0x31')]);_0x49d8b8[_0xe45e('0x33')]=_[_0xe45e('0x44')](_0x49d8b8[_0xe45e('0x30')],_0x49d8b8[_0xe45e('0x31')]);_0x1fb487[_0xe45e('0x34')]=_[_0xe45e('0x44')](_0x49d8b8[_0xe45e('0x30')],qs[_0xe45e('0x35')](_0x7ea0cc[_0xe45e('0x31')][_0xe45e('0x35')]));_0x1fb487[_0xe45e('0x34')]=_0x1fb487['attributes'][_0xe45e('0x45')]?_0x1fb487[_0xe45e('0x34')]:_0x49d8b8[_0xe45e('0x30')];if(!_0x7ea0cc[_0xe45e('0x31')][_0xe45e('0x36')](_0xe45e('0x37'))){_0x1fb487[_0xe45e('0x1d')]=qs[_0xe45e('0x1d')](_0x7ea0cc[_0xe45e('0x31')][_0xe45e('0x1d')]);_0x1fb487[_0xe45e('0x1e')]=qs['offset'](_0x7ea0cc[_0xe45e('0x31')][_0xe45e('0x1e')]);}_0x1fb487[_0xe45e('0x38')]=qs[_0xe45e('0x4e')](_0x7ea0cc[_0xe45e('0x31')][_0xe45e('0x4e')]);_0x1fb487[_0xe45e('0x39')]=qs[_0xe45e('0x33')](_['pick'](_0x7ea0cc[_0xe45e('0x31')],_0x49d8b8['filters']));_0x1fb487[_0xe45e('0x39')]['SessionId']=_0x58151b['id'];if(_0x7ea0cc[_0xe45e('0x31')][_0xe45e('0x3b')]){_0x1fb487[_0xe45e('0x39')]=_[_0xe45e('0x3c')](_0x1fb487[_0xe45e('0x39')],{'$or':_[_0xe45e('0x2b')](_0x1fb487['attributes'],function(_0x3e0c32){var _0x14c458={};_0x14c458[_0x3e0c32]={'$like':'%'+_0x7ea0cc['query']['filter']+'%'};return _0x14c458;})});}_0x1fb487=_[_0xe45e('0x3c')]({},_0x1fb487,_0x7ea0cc[_0xe45e('0x3e')]);return db[_0xe45e('0x4d')][_0xe45e('0x1f')]({'where':_0x1fb487[_0xe45e('0x39')]})[_0xe45e('0x24')](function(_0x204e97){_0x57bad4['count']=_0x204e97;if(_0x7ea0cc[_0xe45e('0x31')][_0xe45e('0x3f')]){_0x1fb487['include']=[{'all':!![]}];}return db[_0xe45e('0x4d')][_0xe45e('0x4f')](_0x1fb487);})[_0xe45e('0x24')](function(_0x894f6d){_0x57bad4[_0xe45e('0x50')]=_0x894f6d;return _0x57bad4;});}})[_0xe45e('0x24')](respondWithFilteredResult(_0x44787c,_0x1fb487))['catch'](handleError(_0x44787c,null));}; \ No newline at end of file +var _0xf30d=['model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','find','body','getQuestions','findOne','JscriptyQuestionReport','count','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','update','then','destroy','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf30d,0x153));var _0xdf30=function(_0x2e5016,_0x5bc3f4){_0x2e5016=_0x2e5016-0x0;var _0x38eeab=_0xf30d[_0x2e5016];return _0x38eeab;};'use strict';var emlformat=require(_0xdf30('0x0'));var rimraf=require(_0xdf30('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf30('0x2'));var rp=require(_0xdf30('0x3'));var moment=require(_0xdf30('0x4'));var BPromise=require(_0xdf30('0x5'));var Mustache=require(_0xdf30('0x6'));var util=require(_0xdf30('0x7'));var path=require(_0xdf30('0x8'));var sox=require('sox');var csv=require(_0xdf30('0x9'));var ejs=require(_0xdf30('0xa'));var fs=require('fs');var fs_extra=require(_0xdf30('0xb'));var _=require(_0xdf30('0xc'));var squel=require('squel');var crypto=require(_0xdf30('0xd'));var jsforce=require(_0xdf30('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdf30('0x9'));var querystring=require(_0xdf30('0xf'));var Papa=require('papaparse');var Redis=require(_0xdf30('0x10'));var authService=require(_0xdf30('0x11'));var qs=require(_0xdf30('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdf30('0x13'));var utils=require(_0xdf30('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdf30('0x15'));var db=require(_0xdf30('0x16'))['db'];function respondWithStatusCode(_0x105940,_0x1d8b28){_0x1d8b28=_0x1d8b28||0xcc;return function(_0x208261){if(_0x208261){return _0x105940[_0xdf30('0x17')](_0x1d8b28);}return _0x105940[_0xdf30('0x18')](_0x1d8b28)[_0xdf30('0x19')]();};}function respondWithResult(_0x189ee5,_0x306975){_0x306975=_0x306975||0xc8;return function(_0x52d2cb){if(_0x52d2cb){return _0x189ee5[_0xdf30('0x18')](_0x306975)[_0xdf30('0x1a')](_0x52d2cb);}};}function respondWithFilteredResult(_0x1ad936,_0x199167){return function(_0x41ad4d){if(_0x41ad4d){var _0x3dc5da=typeof _0x199167[_0xdf30('0x1b')]===_0xdf30('0x1c')&&typeof _0x199167[_0xdf30('0x1d')]==='undefined';var _0x2d09c9=_0x41ad4d['count'];var _0x2baf25=_0x3dc5da?0x0:_0x199167[_0xdf30('0x1b')];var _0x55c213=_0x3dc5da?_0x41ad4d['count']:_0x199167[_0xdf30('0x1b')]+_0x199167[_0xdf30('0x1d')];var _0x45a049;if(_0x55c213>=_0x2d09c9){_0x55c213=_0x2d09c9;_0x45a049=0xc8;}else{_0x45a049=0xce;}_0x1ad936[_0xdf30('0x18')](_0x45a049);return _0x1ad936[_0xdf30('0x1e')]('Content-Range',_0x2baf25+'-'+_0x55c213+'/'+_0x2d09c9)['json'](_0x41ad4d);}return null;};}function patchUpdates(_0x302322){return function(_0x86bf30){try{jsonpatch[_0xdf30('0x1f')](_0x86bf30,_0x302322,!![]);}catch(_0x38dd3d){return BPromise[_0xdf30('0x20')](_0x38dd3d);}return _0x86bf30['save']();};}function saveUpdates(_0x9332f,_0x5e88a9){return function(_0x2558e3){if(_0x2558e3){return _0x2558e3[_0xdf30('0x21')](_0x9332f)[_0xdf30('0x22')](function(_0x18405f){return _0x18405f;});}return null;};}function removeEntity(_0x1abd97,_0x551100){return function(_0x507b73){if(_0x507b73){return _0x507b73[_0xdf30('0x23')]()['then'](function(){_0x1abd97[_0xdf30('0x18')](0xcc)[_0xdf30('0x19')]();});}};}function handleEntityNotFound(_0x1cd2a6,_0x2270bc){return function(_0x36df88){if(!_0x36df88){_0x1cd2a6[_0xdf30('0x17')](0x194);}return _0x36df88;};}function handleError(_0x26e08f,_0xa1c43b){_0xa1c43b=_0xa1c43b||0x1f4;return function(_0x1e7db8){logger['error'](_0x1e7db8[_0xdf30('0x24')]);if(_0x1e7db8[_0xdf30('0x25')]){delete _0x1e7db8[_0xdf30('0x25')];}_0x26e08f[_0xdf30('0x18')](_0xa1c43b)[_0xdf30('0x26')](_0x1e7db8);};}exports[_0xdf30('0x27')]=function(_0x5ac03e,_0x1f6a62){var _0x4b2838={},_0x2d1cec={},_0x4d96c7={'count':0x0,'rows':[]};var _0x5f2444=_[_0xdf30('0x28')](db[_0xdf30('0x29')][_0xdf30('0x2a')],function(_0xa08717){return{'name':_0xa08717[_0xdf30('0x2b')],'type':_0xa08717[_0xdf30('0x2c')][_0xdf30('0x2d')]};});_0x2d1cec[_0xdf30('0x2e')]=_['map'](_0x5f2444,_0xdf30('0x25'));_0x2d1cec[_0xdf30('0x2f')]=_[_0xdf30('0x30')](_0x5ac03e[_0xdf30('0x2f')]);_0x2d1cec[_0xdf30('0x31')]=_['intersection'](_0x2d1cec[_0xdf30('0x2e')],_0x2d1cec[_0xdf30('0x2f')]);_0x4b2838[_0xdf30('0x32')]=_[_0xdf30('0x33')](_0x2d1cec[_0xdf30('0x2e')],qs[_0xdf30('0x34')](_0x5ac03e['query'][_0xdf30('0x34')]));_0x4b2838['attributes']=_0x4b2838['attributes'][_0xdf30('0x35')]?_0x4b2838[_0xdf30('0x32')]:_0x2d1cec['model'];if(!_0x5ac03e[_0xdf30('0x2f')][_0xdf30('0x36')]('nolimit')){_0x4b2838[_0xdf30('0x1d')]=qs['limit'](_0x5ac03e[_0xdf30('0x2f')][_0xdf30('0x1d')]);_0x4b2838[_0xdf30('0x1b')]=qs[_0xdf30('0x1b')](_0x5ac03e[_0xdf30('0x2f')][_0xdf30('0x1b')]);}_0x4b2838[_0xdf30('0x37')]=qs[_0xdf30('0x38')](_0x5ac03e['query'][_0xdf30('0x38')]);_0x4b2838['where']=qs['filters'](_[_0xdf30('0x39')](_0x5ac03e[_0xdf30('0x2f')],_0x2d1cec[_0xdf30('0x31')]),_0x5f2444);if(_0x5ac03e[_0xdf30('0x2f')][_0xdf30('0x3a')]){_0x4b2838[_0xdf30('0x3b')]=_[_0xdf30('0x3c')](_0x4b2838['where'],{'$or':_[_0xdf30('0x28')](_0x5f2444,function(_0xefd5b3){if(_0xefd5b3[_0xdf30('0x2c')]!==_0xdf30('0x3d')){var _0x146a8f={};_0x146a8f[_0xefd5b3[_0xdf30('0x25')]]={'$like':'%'+_0x5ac03e[_0xdf30('0x2f')][_0xdf30('0x3a')]+'%'};return _0x146a8f;}})});}_0x4b2838=_[_0xdf30('0x3c')]({},_0x4b2838,_0x5ac03e[_0xdf30('0x3e')]);var _0x2c5b54={'where':_0x4b2838[_0xdf30('0x3b')]};return db['JscriptySessionReport']['count'](_0x2c5b54)['then'](function(_0x83c4fe){_0x4d96c7['count']=_0x83c4fe;if(_0x5ac03e[_0xdf30('0x2f')][_0xdf30('0x3f')]){_0x4b2838[_0xdf30('0x40')]=[{'all':!![]}];}return db[_0xdf30('0x29')][_0xdf30('0x41')](_0x4b2838);})[_0xdf30('0x22')](function(_0x516040){_0x4d96c7[_0xdf30('0x42')]=_0x516040;return _0x4d96c7;})[_0xdf30('0x22')](respondWithFilteredResult(_0x1f6a62,_0x4b2838))[_0xdf30('0x43')](handleError(_0x1f6a62,null));};exports[_0xdf30('0x44')]=function(_0x2bc7f3,_0x1b2225){var _0x84ec24={'raw':!![],'where':{'id':_0x2bc7f3[_0xdf30('0x45')]['id']}},_0x202f8a={};_0x202f8a['model']=_['keys'](db[_0xdf30('0x29')][_0xdf30('0x2a')]);_0x202f8a[_0xdf30('0x2f')]=_['keys'](_0x2bc7f3[_0xdf30('0x2f')]);_0x202f8a[_0xdf30('0x31')]=_[_0xdf30('0x33')](_0x202f8a[_0xdf30('0x2e')],_0x202f8a[_0xdf30('0x2f')]);_0x84ec24[_0xdf30('0x32')]=_[_0xdf30('0x33')](_0x202f8a[_0xdf30('0x2e')],qs[_0xdf30('0x34')](_0x2bc7f3[_0xdf30('0x2f')][_0xdf30('0x34')]));_0x84ec24[_0xdf30('0x32')]=_0x84ec24[_0xdf30('0x32')]['length']?_0x84ec24[_0xdf30('0x32')]:_0x202f8a['model'];if(_0x2bc7f3['query'][_0xdf30('0x3f')]){_0x84ec24[_0xdf30('0x40')]=[{'all':!![]}];}_0x84ec24=_[_0xdf30('0x3c')]({},_0x84ec24,_0x2bc7f3[_0xdf30('0x3e')]);return db[_0xdf30('0x29')]['find'](_0x84ec24)[_0xdf30('0x22')](handleEntityNotFound(_0x1b2225,null))[_0xdf30('0x22')](respondWithResult(_0x1b2225,null))[_0xdf30('0x43')](handleError(_0x1b2225,null));};exports[_0xdf30('0x46')]=function(_0x1a9fc0,_0x5dfea1){return db[_0xdf30('0x29')][_0xdf30('0x46')](_0x1a9fc0['body'],{})[_0xdf30('0x22')](respondWithResult(_0x5dfea1,0xc9))[_0xdf30('0x43')](handleError(_0x5dfea1,null));};exports[_0xdf30('0x21')]=function(_0x230776,_0x1b971e){if(_0x230776['body']['id']){delete _0x230776['body']['id'];}return db[_0xdf30('0x29')][_0xdf30('0x47')]({'where':{'id':_0x230776[_0xdf30('0x45')]['id']}})['then'](handleEntityNotFound(_0x1b971e,null))['then'](saveUpdates(_0x230776[_0xdf30('0x48')],null))[_0xdf30('0x22')](respondWithResult(_0x1b971e,null))[_0xdf30('0x43')](handleError(_0x1b971e,null));};exports['destroy']=function(_0x21fed5,_0x213883){return db[_0xdf30('0x29')][_0xdf30('0x47')]({'where':{'id':_0x21fed5['params']['id']}})[_0xdf30('0x22')](handleEntityNotFound(_0x213883,null))[_0xdf30('0x22')](removeEntity(_0x213883,null))['catch'](handleError(_0x213883,null));};exports['describe']=function(_0x24adf9,_0x2b5e36){return db['JscriptySessionReport']['describe']()[_0xdf30('0x22')](respondWithResult(_0x2b5e36,null))['catch'](handleError(_0x2b5e36,null));};exports[_0xdf30('0x49')]=function(_0xa8892a,_0x3a3b4f,_0x2c3027){var _0x406eca={'raw':!![],'where':{}};var _0x353246={};var _0xbf1fd7={'count':0x0,'rows':[]};return db[_0xdf30('0x29')][_0xdf30('0x4a')]({'where':{'id':_0xa8892a[_0xdf30('0x45')]['id']}})['then'](handleEntityNotFound(_0x3a3b4f,null))[_0xdf30('0x22')](function(_0x4824b6){if(_0x4824b6){_0x353246['model']=_[_0xdf30('0x30')](db[_0xdf30('0x4b')][_0xdf30('0x2a')]);_0x353246['query']=_[_0xdf30('0x30')](_0xa8892a[_0xdf30('0x2f')]);_0x353246[_0xdf30('0x31')]=_[_0xdf30('0x33')](_0x353246[_0xdf30('0x2e')],_0x353246['query']);_0x406eca[_0xdf30('0x32')]=_[_0xdf30('0x33')](_0x353246[_0xdf30('0x2e')],qs[_0xdf30('0x34')](_0xa8892a[_0xdf30('0x2f')][_0xdf30('0x34')]));_0x406eca[_0xdf30('0x32')]=_0x406eca['attributes']['length']?_0x406eca[_0xdf30('0x32')]:_0x353246[_0xdf30('0x2e')];if(!_0xa8892a['query']['hasOwnProperty']('nolimit')){_0x406eca[_0xdf30('0x1d')]=qs[_0xdf30('0x1d')](_0xa8892a[_0xdf30('0x2f')][_0xdf30('0x1d')]);_0x406eca[_0xdf30('0x1b')]=qs['offset'](_0xa8892a[_0xdf30('0x2f')][_0xdf30('0x1b')]);}_0x406eca[_0xdf30('0x37')]=qs[_0xdf30('0x38')](_0xa8892a[_0xdf30('0x2f')]['sort']);_0x406eca[_0xdf30('0x3b')]=qs['filters'](_[_0xdf30('0x39')](_0xa8892a['query'],_0x353246[_0xdf30('0x31')]));_0x406eca['where']['SessionId']=_0x4824b6['id'];if(_0xa8892a['query']['filter']){_0x406eca[_0xdf30('0x3b')]=_[_0xdf30('0x3c')](_0x406eca[_0xdf30('0x3b')],{'$or':_['map'](_0x406eca[_0xdf30('0x32')],function(_0x2bc5bc){var _0xe4c56a={};_0xe4c56a[_0x2bc5bc]={'$like':'%'+_0xa8892a['query']['filter']+'%'};return _0xe4c56a;})});}_0x406eca=_[_0xdf30('0x3c')]({},_0x406eca,_0xa8892a[_0xdf30('0x3e')]);return db[_0xdf30('0x4b')][_0xdf30('0x4c')]({'where':_0x406eca[_0xdf30('0x3b')]})[_0xdf30('0x22')](function(_0x536ea3){_0xbf1fd7['count']=_0x536ea3;if(_0xa8892a[_0xdf30('0x2f')][_0xdf30('0x3f')]){_0x406eca[_0xdf30('0x40')]=[{'all':!![]}];}return db[_0xdf30('0x4b')]['findAll'](_0x406eca);})[_0xdf30('0x22')](function(_0x490762){_0xbf1fd7[_0xdf30('0x42')]=_0x490762;return _0xbf1fd7;});}})[_0xdf30('0x22')](respondWithFilteredResult(_0x3a3b4f,_0x406eca))[_0xdf30('0x43')](handleError(_0x3a3b4f,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index a4d044f..bdf10cf 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.model.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd51=['exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','./jscriptySessionReport.attributes'];(function(_0x328aec,_0x41423d){var _0x14c7d6=function(_0x1b09b5){while(--_0x1b09b5){_0x328aec['push'](_0x328aec['shift']());}};_0x14c7d6(++_0x41423d);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x1189c9,_0x203f15){_0x1189c9=_0x1189c9-0x0;var _0x467c94=_0xbd51[_0x1189c9];return _0x467c94;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bd5('0x5'));module[_0x1bd5('0x6')]=function(_0x43e6b6,_0x59ddfb){return _0x43e6b6[_0x1bd5('0x7')](_0x1bd5('0x8'),attributes,{'tableName':_0x1bd5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6ac=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x2ddd39,_0x1913e3){_0x2ddd39=_0x2ddd39-0x0;var _0x44c8a4=_0xc6ac[_0x2ddd39];return _0x44c8a4;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 73eb9da..84f772c 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6b0=['client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5e921f,_0xf3c8e6){var _0x20d4d5=function(_0x1c89af){while(--_0x1c89af){_0x5e921f['push'](_0x5e921f['shift']());}};_0x20d4d5(++_0xf3c8e6);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x1185ba,_0x44f91e){_0x1185ba=_0x1185ba-0x0;var _0x267ccd=_0xa6b0[_0x1185ba];return _0x267ccd;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0a6b('0x2'));var fs=require('fs');var Redis=require(_0x0a6b('0x3'));var db=require(_0x0a6b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a6b('0x5'))(_0x0a6b('0x6'));var config=require(_0x0a6b('0x7'));var jayson=require(_0x0a6b('0x8'));var client=jayson[_0x0a6b('0x9')][_0x0a6b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b5fb5,_0xa908dd,_0x26f761){return new BPromise(function(_0x340a33,_0x8e89f){return client[_0x0a6b('0xb')](_0x1b5fb5,_0x26f761)['then'](function(_0x493948){logger[_0x0a6b('0xc')](_0x0a6b('0xd'),_0xa908dd,_0x0a6b('0xe'));logger[_0x0a6b('0xf')](_0x0a6b('0x10'),_0xa908dd,_0x0a6b('0xe'),JSON[_0x0a6b('0x11')](_0x493948));if(_0x493948[_0x0a6b('0x12')]){if(_0x493948[_0x0a6b('0x12')][_0x0a6b('0x13')]===0x1f4){logger[_0x0a6b('0x12')](_0x0a6b('0xd'),_0xa908dd,_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);return _0x8e89f(_0x493948['error']['message']);}logger[_0x0a6b('0x12')](_0x0a6b('0xd'),_0xa908dd,_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);return _0x340a33(_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);}else{logger[_0x0a6b('0xc')](_0x0a6b('0xd'),_0xa908dd,_0x0a6b('0xe'));_0x340a33(_0x493948[_0x0a6b('0x15')]['message']);}})[_0x0a6b('0x16')](function(_0x1538f4){logger['error'](_0x0a6b('0xd'),_0xa908dd,_0x1538f4);_0x8e89f(_0x1538f4);});});} \ No newline at end of file +var _0x4991=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x4991,0xf7));var _0x1499=function(_0x2f30e2,_0x5d9c78){_0x2f30e2=_0x2f30e2-0x0;var _0x1f5ca8=_0x4991[_0x2f30e2];return _0x1f5ca8;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var moment=require(_0x1499('0x1'));var BPromise=require('bluebird');var rs=require(_0x1499('0x2'));var fs=require('fs');var Redis=require(_0x1499('0x3'));var db=require(_0x1499('0x4'))['db'];var utils=require(_0x1499('0x5'));var logger=require(_0x1499('0x6'))(_0x1499('0x7'));var config=require(_0x1499('0x8'));var jayson=require(_0x1499('0x9'));var client=jayson['client'][_0x1499('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c3bd7,_0x1c65c3,_0x33b261){return new BPromise(function(_0x133bae,_0x380e48){return client[_0x1499('0xb')](_0x1c3bd7,_0x33b261)[_0x1499('0xc')](function(_0x48d2ca){logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');logger[_0x1499('0xf')](_0x1499('0x10'),_0x1c65c3,'request\x20sent',JSON[_0x1499('0x11')](_0x48d2ca));if(_0x48d2ca[_0x1499('0x12')]){if(_0x48d2ca['error']['code']===0x1f4){logger['error'](_0x1499('0xe'),_0x1c65c3,_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);return _0x380e48(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x1c65c3,_0x48d2ca[_0x1499('0x12')]['message']);return _0x133bae(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}else{logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');_0x133bae(_0x48d2ca[_0x1499('0x14')][_0x1499('0x13')]);}})['catch'](function(_0x25164c){logger[_0x1499('0x12')](_0x1499('0xe'),_0x1c65c3,_0x25164c);_0x380e48(_0x25164c);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 9739093..bff91b0 100644 --- a/server/api/license/index.js +++ b/server/api/license/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4214=['downloadLogFile','exports','multer','util','connect-timeout','Router','fs-extra','./license.controller','get','index','put','/:id','isAuthenticated','update'];(function(_0x13bf29,_0x5ab553){var _0x497b3a=function(_0x49f9eb){while(--_0x49f9eb){_0x13bf29['push'](_0x13bf29['shift']());}};_0x497b3a(++_0x5ab553);}(_0x4214,0x72));var _0x4421=function(_0x5b5947,_0x11623c){_0x5b5947=_0x5b5947-0x0;var _0x7623e0=_0x4214[_0x5b5947];return _0x7623e0;};'use strict';var multer=require(_0x4421('0x0'));var util=require(_0x4421('0x1'));var path=require('path');var timeout=require(_0x4421('0x2'));var express=require('express');var router=express[_0x4421('0x3')]();var fs_extra=require(_0x4421('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4421('0x5'));router[_0x4421('0x6')]('/',controller[_0x4421('0x7')]);router[_0x4421('0x8')](_0x4421('0x9'),auth[_0x4421('0xa')](),controller[_0x4421('0xb')]);router[_0x4421('0x6')]('/download_log_file',auth['isAuthenticated'](),controller[_0x4421('0xc')]);module[_0x4421('0xd')]=router; \ No newline at end of file +var _0xee6f=['index','isAuthenticated','downloadLogFile','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0xee6f,0x17b));var _0xfee6=function(_0x156a77,_0x522c13){_0x156a77=_0x156a77-0x0;var _0x32398a=_0xee6f[_0x156a77];return _0x32398a;};'use strict';var multer=require(_0xfee6('0x0'));var util=require(_0xfee6('0x1'));var path=require(_0xfee6('0x2'));var timeout=require(_0xfee6('0x3'));var express=require(_0xfee6('0x4'));var router=express[_0xfee6('0x5')]();var fs_extra=require(_0xfee6('0x6'));var auth=require(_0xfee6('0x7'));var interaction=require(_0xfee6('0x8'));var config=require(_0xfee6('0x9'));var controller=require('./license.controller');router[_0xfee6('0xa')]('/',controller[_0xfee6('0xb')]);router['put']('/:id',auth[_0xfee6('0xc')](),controller['update']);router[_0xfee6('0xa')]('/download_log_file',auth[_0xfee6('0xc')](),controller[_0xfee6('0xd')]);module[_0xfee6('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index a990aa1..4553736 100644 --- a/server/api/license/license.attributes.js +++ b/server/api/license/license.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27ac=['TEXT','STRING','INTEGER','sequelize'];(function(_0x3115fa,_0x1bf37e){var _0x3a5567=function(_0x18f739){while(--_0x18f739){_0x3115fa['push'](_0x3115fa['shift']());}};_0x3a5567(++_0x1bf37e);}(_0x27ac,0x13b));var _0xc27a=function(_0x30a956,_0x11222e){_0x30a956=_0x30a956-0x0;var _0x2ac17d=_0x27ac[_0x30a956];return _0x2ac17d;};'use strict';var Sequelize=require(_0xc27a('0x0'));module['exports']={'license':{'type':Sequelize[_0xc27a('0x1')]},'data1':{'type':Sequelize[_0xc27a('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xc27a('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x53b2=['STRING','sequelize','TEXT'];(function(_0x554035,_0xd99fa2){var _0x41e504=function(_0x1b2381){while(--_0x1b2381){_0x554035['push'](_0x554035['shift']());}};_0x41e504(++_0xd99fa2);}(_0x53b2,0x70));var _0x253b=function(_0x2c1b08,_0x48cd20){_0x2c1b08=_0x2c1b08-0x0;var _0x58acc9=_0x53b2[_0x2c1b08];return _0x58acc9;};'use strict';var Sequelize=require(_0x253b('0x0'));module['exports']={'license':{'type':Sequelize[_0x253b('0x1')]},'data1':{'type':Sequelize[_0x253b('0x2')]},'data2':{'type':Sequelize[_0x253b('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index acac3c9..84bea70 100644 --- a/server/api/license/license.controller.js +++ b/server/api/license/license.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7ae=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','error','stack','name','send','index','keys','License','rawAttributes','query','filters','intersection','model','attributes','fields','length','merge','options','catch','body','find','params','get','checkLicense','demo','downloadLogFile','license-info.log','join','/var','xcally','setHeader','Content-disposition','attachment;\x20filename=','text/plain','download','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x5ea1a8,_0xf18c84){var _0x3429b2=function(_0x11f0d6){while(--_0x11f0d6){_0x5ea1a8['push'](_0x5ea1a8['shift']());}};_0x3429b2(++_0xf18c84);}(_0xe7ae,0xd7));var _0xee7a=function(_0x310990,_0x245984){_0x310990=_0x310990-0x0;var _0x648534=_0xe7ae[_0x310990];return _0x648534;};'use strict';var emlformat=require(_0xee7a('0x0'));var rimraf=require(_0xee7a('0x1'));var zipdir=require(_0xee7a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xee7a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xee7a('0x4'));var util=require(_0xee7a('0x5'));var path=require(_0xee7a('0x6'));var sox=require(_0xee7a('0x7'));var csv=require(_0xee7a('0x8'));var ejs=require(_0xee7a('0x9'));var fs=require('fs');var fs_extra=require(_0xee7a('0xa'));var _=require(_0xee7a('0xb'));var squel=require(_0xee7a('0xc'));var crypto=require(_0xee7a('0xd'));var jsforce=require(_0xee7a('0xe'));var deskjs=require(_0xee7a('0xf'));var toCsv=require(_0xee7a('0x8'));var querystring=require(_0xee7a('0x10'));var Papa=require(_0xee7a('0x11'));var Redis=require(_0xee7a('0x12'));var authService=require(_0xee7a('0x13'));var qs=require(_0xee7a('0x14'));var as=require(_0xee7a('0x15'));var hardwareService=require(_0xee7a('0x16'));var logger=require(_0xee7a('0x17'))('api');var utils=require(_0xee7a('0x18'));var config=require(_0xee7a('0x19'));var licenseUtil=require(_0xee7a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb67f80,_0x24a970){_0x24a970=_0x24a970||0xcc;return function(_0x3271d5){if(_0x3271d5){return _0xb67f80[_0xee7a('0x1b')](_0x24a970);}return _0xb67f80['status'](_0x24a970)[_0xee7a('0x1c')]();};}function respondWithResult(_0x590f0a,_0x572d2f){_0x572d2f=_0x572d2f||0xc8;return function(_0xbb982c){if(_0xbb982c){return _0x590f0a['status'](_0x572d2f)[_0xee7a('0x1d')](_0xbb982c);}};}function respondWithFilteredResult(_0x173bc6,_0x5801be){return function(_0x3290b1){if(_0x3290b1){var _0x12272d=typeof _0x5801be[_0xee7a('0x1e')]===_0xee7a('0x1f')&&typeof _0x5801be[_0xee7a('0x20')]===_0xee7a('0x1f');var _0xd6b5d4=_0x3290b1[_0xee7a('0x21')];var _0x25d511=_0x12272d?0x0:_0x5801be[_0xee7a('0x1e')];var _0x4f31ae=_0x12272d?_0x3290b1[_0xee7a('0x21')]:_0x5801be['offset']+_0x5801be[_0xee7a('0x20')];var _0x4bfa2c;if(_0x4f31ae>=_0xd6b5d4){_0x4f31ae=_0xd6b5d4;_0x4bfa2c=0xc8;}else{_0x4bfa2c=0xce;}_0x173bc6[_0xee7a('0x22')](_0x4bfa2c);return _0x173bc6[_0xee7a('0x23')](_0xee7a('0x24'),_0x25d511+'-'+_0x4f31ae+'/'+_0xd6b5d4)[_0xee7a('0x1d')](_0x3290b1);}return null;};}function patchUpdates(_0x3b29ce){return function(_0xcb8e3e){try{jsonpatch['apply'](_0xcb8e3e,_0x3b29ce,!![]);}catch(_0x1db4ef){return BPromise[_0xee7a('0x25')](_0x1db4ef);}return _0xcb8e3e[_0xee7a('0x26')]();};}function saveUpdates(_0x5f4218,_0x5f2b79){return function(_0x38a841){if(_0x38a841){return _0x38a841[_0xee7a('0x27')](_0x5f4218)[_0xee7a('0x28')](function(_0x2c293e){return _0x2c293e;});}return null;};}function removeEntity(_0x34fea5,_0x4154a9){return function(_0x15e685){if(_0x15e685){return _0x15e685['destroy']()[_0xee7a('0x28')](function(){_0x34fea5['status'](0xcc)[_0xee7a('0x1c')]();});}};}function handleEntityNotFound(_0x320c23,_0x5a7ce5){return function(_0x26692e){if(!_0x26692e){_0x320c23['sendStatus'](0x194);}return _0x26692e;};}function handleError(_0x432e49,_0x1f6f48){_0x1f6f48=_0x1f6f48||0x1f4;return function(_0x1c887a){logger[_0xee7a('0x29')](_0x1c887a[_0xee7a('0x2a')]);if(_0x1c887a['name']){delete _0x1c887a[_0xee7a('0x2b')];}_0x432e49[_0xee7a('0x22')](_0x1f6f48)[_0xee7a('0x2c')](_0x1c887a);};}var utilLicense=require(_0xee7a('0x1a'));exports[_0xee7a('0x2d')]=function(_0x3fd9e8,_0x4e98d1){var _0x20b410={'raw':!![],'where':{'id':0x1}},_0x3110c2={};_0x3110c2['model']=_[_0xee7a('0x2e')](db[_0xee7a('0x2f')][_0xee7a('0x30')]);_0x3110c2[_0xee7a('0x31')]=_[_0xee7a('0x2e')](_0x3fd9e8[_0xee7a('0x31')]);_0x3110c2[_0xee7a('0x32')]=_[_0xee7a('0x33')](_0x3110c2[_0xee7a('0x34')],_0x3110c2['query']);_0x20b410[_0xee7a('0x35')]=_['intersection'](_0x3110c2[_0xee7a('0x34')],qs['fields'](_0x3fd9e8[_0xee7a('0x31')][_0xee7a('0x36')]));_0x20b410[_0xee7a('0x35')]=_0x20b410[_0xee7a('0x35')][_0xee7a('0x37')]?_0x20b410[_0xee7a('0x35')]:_0x3110c2['model'];_0x20b410=_[_0xee7a('0x38')]({},_0x20b410,_0x3fd9e8[_0xee7a('0x39')]);return utilLicense['getLicense'](_0x20b410)[_0xee7a('0x28')](respondWithResult(_0x4e98d1,null))[_0xee7a('0x3a')](handleError(_0x4e98d1,null));};exports[_0xee7a('0x27')]=function(_0x864598,_0x382836){if(_0x864598[_0xee7a('0x3b')]['id']){delete _0x864598[_0xee7a('0x3b')]['id'];}return db['License'][_0xee7a('0x3c')]({'where':{'id':_0x864598[_0xee7a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x382836,null))[_0xee7a('0x28')](function(_0x46a33a){var _0x6e8c92=_0x46a33a[_0xee7a('0x3e')]({'plain':!![]});return utilLicense[_0xee7a('0x3f')](_0x6e8c92,_0x864598[_0xee7a('0x3b')]['key']);})[_0xee7a('0x28')](function(_0x304e16){if(!_0x304e16[_0xee7a('0x40')]){return saveUpdates(_0x864598[_0xee7a('0x3b')],null);}return _0x304e16;})[_0xee7a('0x28')](respondWithResult(_0x382836,null))[_0xee7a('0x3a')](handleError(_0x382836,null));};exports[_0xee7a('0x41')]=function(_0x3f53fa,_0x5015c7){var _0x8f2047=_0xee7a('0x42');var _0x4c75d=path[_0xee7a('0x43')](_0xee7a('0x44'),'log',_0xee7a('0x45'),_0x8f2047);_0x5015c7[_0xee7a('0x46')](_0xee7a('0x47'),_0xee7a('0x48')+_0x8f2047);_0x5015c7['set']('Content-Type',_0xee7a('0x49'));_0x5015c7[_0xee7a('0x4a')](_0x4c75d);}; \ No newline at end of file +var _0x6ecd=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','model','rawAttributes','query','filters','intersection','attributes','fields','options','getLicense','update','body','License','find','params','get','key','catch','downloadLogFile','join','/var','log','xcally','setHeader','Content-disposition','text/plain','download','eml-format','zip-dir'];(function(_0x5df3d9,_0x1fc227){var _0x5bc0ba=function(_0x1b35c5){while(--_0x1b35c5){_0x5df3d9['push'](_0x5df3d9['shift']());}};_0x5bc0ba(++_0x1fc227);}(_0x6ecd,0x8c));var _0xd6ec=function(_0x1fa7a6,_0x456fa0){_0x1fa7a6=_0x1fa7a6-0x0;var _0x2438e8=_0x6ecd[_0x1fa7a6];return _0x2438e8;};'use strict';var emlformat=require(_0xd6ec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd6ec('0x1'));var jsonpatch=require(_0xd6ec('0x2'));var rp=require(_0xd6ec('0x3'));var moment=require(_0xd6ec('0x4'));var BPromise=require(_0xd6ec('0x5'));var Mustache=require(_0xd6ec('0x6'));var util=require('util');var path=require(_0xd6ec('0x7'));var sox=require(_0xd6ec('0x8'));var csv=require('to-csv');var ejs=require(_0xd6ec('0x9'));var fs=require('fs');var fs_extra=require(_0xd6ec('0xa'));var _=require(_0xd6ec('0xb'));var squel=require(_0xd6ec('0xc'));var crypto=require(_0xd6ec('0xd'));var jsforce=require(_0xd6ec('0xe'));var deskjs=require(_0xd6ec('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd6ec('0x10'));var Papa=require(_0xd6ec('0x11'));var Redis=require(_0xd6ec('0x12'));var authService=require(_0xd6ec('0x13'));var qs=require(_0xd6ec('0x14'));var as=require(_0xd6ec('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd6ec('0x16'))('api');var utils=require(_0xd6ec('0x17'));var config=require(_0xd6ec('0x18'));var licenseUtil=require(_0xd6ec('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3aa01d,_0x5ae1fb){_0x5ae1fb=_0x5ae1fb||0xcc;return function(_0xf0b80f){if(_0xf0b80f){return _0x3aa01d[_0xd6ec('0x1a')](_0x5ae1fb);}return _0x3aa01d[_0xd6ec('0x1b')](_0x5ae1fb)[_0xd6ec('0x1c')]();};}function respondWithResult(_0x1b13eb,_0x3d5500){_0x3d5500=_0x3d5500||0xc8;return function(_0xd36041){if(_0xd36041){return _0x1b13eb[_0xd6ec('0x1b')](_0x3d5500)[_0xd6ec('0x1d')](_0xd36041);}};}function respondWithFilteredResult(_0x825321,_0x2e051c){return function(_0x119c96){if(_0x119c96){var _0x3466ef=typeof _0x2e051c[_0xd6ec('0x1e')]===_0xd6ec('0x1f')&&typeof _0x2e051c[_0xd6ec('0x20')]===_0xd6ec('0x1f');var _0x5cb877=_0x119c96[_0xd6ec('0x21')];var _0x1c1d08=_0x3466ef?0x0:_0x2e051c[_0xd6ec('0x1e')];var _0x2437fa=_0x3466ef?_0x119c96['count']:_0x2e051c['offset']+_0x2e051c[_0xd6ec('0x20')];var _0x2abcc3;if(_0x2437fa>=_0x5cb877){_0x2437fa=_0x5cb877;_0x2abcc3=0xc8;}else{_0x2abcc3=0xce;}_0x825321[_0xd6ec('0x1b')](_0x2abcc3);return _0x825321[_0xd6ec('0x22')](_0xd6ec('0x23'),_0x1c1d08+'-'+_0x2437fa+'/'+_0x5cb877)[_0xd6ec('0x1d')](_0x119c96);}return null;};}function patchUpdates(_0x2e78fa){return function(_0x4d24ef){try{jsonpatch[_0xd6ec('0x24')](_0x4d24ef,_0x2e78fa,!![]);}catch(_0x34795d){return BPromise[_0xd6ec('0x25')](_0x34795d);}return _0x4d24ef[_0xd6ec('0x26')]();};}function saveUpdates(_0x4e83c2,_0x287e4b){return function(_0x2bcf97){if(_0x2bcf97){return _0x2bcf97['update'](_0x4e83c2)[_0xd6ec('0x27')](function(_0x1e69e3){return _0x1e69e3;});}return null;};}function removeEntity(_0x3ada34,_0x1f0816){return function(_0x9d9f30){if(_0x9d9f30){return _0x9d9f30[_0xd6ec('0x28')]()[_0xd6ec('0x27')](function(){_0x3ada34['status'](0xcc)[_0xd6ec('0x1c')]();});}};}function handleEntityNotFound(_0x124443,_0x34c103){return function(_0x224cf9){if(!_0x224cf9){_0x124443[_0xd6ec('0x1a')](0x194);}return _0x224cf9;};}function handleError(_0x249f9a,_0x5b25d2){_0x5b25d2=_0x5b25d2||0x1f4;return function(_0x597b24){logger[_0xd6ec('0x29')](_0x597b24['stack']);if(_0x597b24['name']){delete _0x597b24[_0xd6ec('0x2a')];}_0x249f9a['status'](_0x5b25d2)[_0xd6ec('0x2b')](_0x597b24);};}var utilLicense=require(_0xd6ec('0x19'));exports[_0xd6ec('0x2c')]=function(_0x57aa74,_0x3a125a){var _0x33e298={'raw':!![],'where':{'id':0x1}},_0x5a84a6={};_0x5a84a6[_0xd6ec('0x2d')]=_['keys'](db['License'][_0xd6ec('0x2e')]);_0x5a84a6[_0xd6ec('0x2f')]=_['keys'](_0x57aa74[_0xd6ec('0x2f')]);_0x5a84a6[_0xd6ec('0x30')]=_[_0xd6ec('0x31')](_0x5a84a6[_0xd6ec('0x2d')],_0x5a84a6['query']);_0x33e298[_0xd6ec('0x32')]=_[_0xd6ec('0x31')](_0x5a84a6[_0xd6ec('0x2d')],qs[_0xd6ec('0x33')](_0x57aa74['query'][_0xd6ec('0x33')]));_0x33e298[_0xd6ec('0x32')]=_0x33e298['attributes']['length']?_0x33e298[_0xd6ec('0x32')]:_0x5a84a6['model'];_0x33e298=_['merge']({},_0x33e298,_0x57aa74[_0xd6ec('0x34')]);return utilLicense[_0xd6ec('0x35')](_0x33e298)[_0xd6ec('0x27')](respondWithResult(_0x3a125a,null))['catch'](handleError(_0x3a125a,null));};exports[_0xd6ec('0x36')]=function(_0x9f4f8a,_0x53d8ce){if(_0x9f4f8a[_0xd6ec('0x37')]['id']){delete _0x9f4f8a[_0xd6ec('0x37')]['id'];}return db[_0xd6ec('0x38')][_0xd6ec('0x39')]({'where':{'id':_0x9f4f8a[_0xd6ec('0x3a')]['id']}})[_0xd6ec('0x27')](handleEntityNotFound(_0x53d8ce,null))['then'](function(_0x3a7aac){var _0x4af79f=_0x3a7aac[_0xd6ec('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x4af79f,_0x9f4f8a[_0xd6ec('0x37')][_0xd6ec('0x3c')]);})['then'](function(_0x28b8c1){if(!_0x28b8c1['demo']){return saveUpdates(_0x9f4f8a[_0xd6ec('0x37')],null);}return _0x28b8c1;})[_0xd6ec('0x27')](respondWithResult(_0x53d8ce,null))[_0xd6ec('0x3d')](handleError(_0x53d8ce,null));};exports[_0xd6ec('0x3e')]=function(_0x5c39dd,_0x388fa1){var _0x4d766c='license-info.log';var _0x26b1c3=path[_0xd6ec('0x3f')](_0xd6ec('0x40'),_0xd6ec('0x41'),_0xd6ec('0x42'),_0x4d766c);_0x388fa1[_0xd6ec('0x43')](_0xd6ec('0x44'),'attachment;\x20filename='+_0x4d766c);_0x388fa1[_0xd6ec('0x22')]('Content-Type',_0xd6ec('0x45'));_0x388fa1[_0xd6ec('0x46')](_0x26b1c3);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 2380403..63d14e7 100644 --- a/server/api/license/license.model.js +++ b/server/api/license/license.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a2e=['api','moment','request-promise','path','rimraf','../../config/environment','./license.attributes','define','license','lodash'];(function(_0x47f7ec,_0x369f9d){var _0x415101=function(_0x41317a){while(--_0x41317a){_0x47f7ec['push'](_0x47f7ec['shift']());}};_0x415101(++_0x369f9d);}(_0x3a2e,0x1f3));var _0xe3a2=function(_0xd7acd1,_0x4f864e){_0xd7acd1=_0xd7acd1-0x0;var _0x561856=_0x3a2e[_0xd7acd1];return _0x561856;};'use strict';var _=require(_0xe3a2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe3a2('0x1'));var moment=require(_0xe3a2('0x2'));var BPromise=require('bluebird');var rp=require(_0xe3a2('0x3'));var fs=require('fs');var path=require(_0xe3a2('0x4'));var rimraf=require(_0xe3a2('0x5'));var config=require(_0xe3a2('0x6'));var attributes=require(_0xe3a2('0x7'));module['exports']=function(_0x38f4dd,_0xc9d9b2){return _0x38f4dd[_0xe3a2('0x8')]('License',attributes,{'tableName':_0xe3a2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa4e=['exports','define','License','license','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./license.attributes'];(function(_0x120465,_0x1acee7){var _0x49992f=function(_0x2520c1){while(--_0x2520c1){_0x120465['push'](_0x120465['shift']());}};_0x49992f(++_0x1acee7);}(_0xfa4e,0x1d8));var _0xefa4=function(_0x2d9566,_0x1aa421){_0x2d9566=_0x2d9566-0x0;var _0x5ce511=_0xfa4e[_0x2d9566];return _0x5ce511;};'use strict';var _=require(_0xefa4('0x0'));var util=require(_0xefa4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xefa4('0x2'));var BPromise=require(_0xefa4('0x3'));var rp=require(_0xefa4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xefa4('0x5'));var config=require(_0xefa4('0x6'));var attributes=require(_0xefa4('0x7'));module[_0xefa4('0x8')]=function(_0x1f2349,_0xcbb7b1){return _0x1f2349[_0xefa4('0x9')](_0xefa4('0xa'),attributes,{'tableName':_0xefa4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 3d560b6..3ec2bed 100644 --- a/server/api/license/license.rpc.js +++ b/server/api/license/license.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46a3=['request','then','info','License,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x49ca6b,_0x3ba842){var _0x1d957f=function(_0x12ef94){while(--_0x12ef94){_0x49ca6b['push'](_0x49ca6b['shift']());}};_0x1d957f(++_0x3ba842);}(_0x46a3,0x172));var _0x346a=function(_0x47c298,_0x11408e){_0x47c298=_0x47c298-0x0;var _0x7322f6=_0x46a3[_0x47c298];return _0x7322f6;};'use strict';var _=require(_0x346a('0x0'));var util=require(_0x346a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x346a('0x2'));var fs=require('fs');var Redis=require(_0x346a('0x3'));var db=require(_0x346a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x346a('0x5'))(_0x346a('0x6'));var config=require(_0x346a('0x7'));var jayson=require(_0x346a('0x8'));var client=jayson['client'][_0x346a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x361962,_0x3192b3,_0x34ead8){return new BPromise(function(_0x494749,_0x194209){return client[_0x346a('0xa')](_0x361962,_0x34ead8)[_0x346a('0xb')](function(_0x3d580e){logger[_0x346a('0xc')](_0x346a('0xd'),_0x3192b3,_0x346a('0xe'));logger['debug']('License,\x20%s,\x20%s,\x20%s',_0x3192b3,_0x346a('0xe'),JSON[_0x346a('0xf')](_0x3d580e));if(_0x3d580e[_0x346a('0x10')]){if(_0x3d580e[_0x346a('0x10')][_0x346a('0x11')]===0x1f4){logger['error'](_0x346a('0xd'),_0x3192b3,_0x3d580e['error']['message']);return _0x194209(_0x3d580e[_0x346a('0x10')][_0x346a('0x12')]);}logger[_0x346a('0x10')](_0x346a('0xd'),_0x3192b3,_0x3d580e['error'][_0x346a('0x12')]);return _0x494749(_0x3d580e['error']['message']);}else{logger['info']('License,\x20%s,\x20%s',_0x3192b3,'request\x20sent');_0x494749(_0x3d580e[_0x346a('0x13')]['message']);}})['catch'](function(_0x512221){logger[_0x346a('0x10')](_0x346a('0xd'),_0x3192b3,_0x512221);_0x194209(_0x512221);});});} \ No newline at end of file +var _0xf068=['../../config/utils','../../config/logger','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x277293,_0x2dcda1){var _0xcde159=function(_0x2deb8c){while(--_0x2deb8c){_0x277293['push'](_0x277293['shift']());}};_0xcde159(++_0x2dcda1);}(_0xf068,0x93));var _0x8f06=function(_0x496a13,_0x381406){_0x496a13=_0x496a13-0x0;var _0x18ad08=_0xf068[_0x496a13];return _0x18ad08;};'use strict';var _=require(_0x8f06('0x0'));var util=require(_0x8f06('0x1'));var moment=require(_0x8f06('0x2'));var BPromise=require(_0x8f06('0x3'));var rs=require(_0x8f06('0x4'));var fs=require('fs');var Redis=require(_0x8f06('0x5'));var db=require(_0x8f06('0x6'))['db'];var utils=require(_0x8f06('0x7'));var logger=require(_0x8f06('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8f06('0x9'));var client=jayson['client'][_0x8f06('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4113b8,_0x1ee02d,_0x2d84a1){return new BPromise(function(_0xf3588b,_0x27d376){return client[_0x8f06('0xb')](_0x4113b8,_0x2d84a1)[_0x8f06('0xc')](function(_0x4b4dbd){logger[_0x8f06('0xd')](_0x8f06('0xe'),_0x1ee02d,_0x8f06('0xf'));logger['debug'](_0x8f06('0x10'),_0x1ee02d,_0x8f06('0xf'),JSON[_0x8f06('0x11')](_0x4b4dbd));if(_0x4b4dbd[_0x8f06('0x12')]){if(_0x4b4dbd[_0x8f06('0x12')]['code']===0x1f4){logger[_0x8f06('0x12')](_0x8f06('0xe'),_0x1ee02d,_0x4b4dbd['error'][_0x8f06('0x13')]);return _0x27d376(_0x4b4dbd[_0x8f06('0x12')]['message']);}logger[_0x8f06('0x12')]('License,\x20%s,\x20%s',_0x1ee02d,_0x4b4dbd[_0x8f06('0x12')][_0x8f06('0x13')]);return _0xf3588b(_0x4b4dbd[_0x8f06('0x12')][_0x8f06('0x13')]);}else{logger[_0x8f06('0xd')](_0x8f06('0xe'),_0x1ee02d,_0x8f06('0xf'));_0xf3588b(_0x4b4dbd[_0x8f06('0x14')]['message']);}})[_0x8f06('0x15')](function(_0x1d754d){logger[_0x8f06('0x12')](_0x8f06('0xe'),_0x1ee02d,_0x1d754d);_0x27d376(_0x1d754d);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 59fd071..3a7ee7f 100644 --- a/server/api/mailAccount/index.js +++ b/server/api/mailAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4f5=['put','update','delete','removeDispositions','removeAnswers','/:id/out_servers','removeSmtp','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','create','addImap','addInteraction','addApplications','/:id/send','send','addAgents'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xb4f5,0x1aa));var _0x5b4f=function(_0x2d9e27,_0x5965b2){_0x2d9e27=_0x2d9e27-0x0;var _0xd35381=_0xb4f5[_0x2d9e27];return _0xd35381;};'use strict';var multer=require('multer');var util=require(_0x5b4f('0x0'));var path=require(_0x5b4f('0x1'));var timeout=require(_0x5b4f('0x2'));var express=require(_0x5b4f('0x3'));var router=express[_0x5b4f('0x4')]();var fs_extra=require(_0x5b4f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5b4f('0x6'));var config=require(_0x5b4f('0x7'));var controller=require(_0x5b4f('0x8'));router[_0x5b4f('0x9')]('/',auth[_0x5b4f('0xa')](),controller[_0x5b4f('0xb')]);router[_0x5b4f('0x9')](_0x5b4f('0xc'),auth[_0x5b4f('0xa')](),controller[_0x5b4f('0xd')]);router['get'](_0x5b4f('0xe'),auth['isAuthenticated'](),controller[_0x5b4f('0xf')]);router['get'](_0x5b4f('0x10'),auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x11')]);router[_0x5b4f('0x9')](_0x5b4f('0x12'),auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x13')]);router['get'](_0x5b4f('0x14'),auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x15')]);router[_0x5b4f('0x9')]('/:id/out_servers',auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x16')]);router[_0x5b4f('0x9')](_0x5b4f('0x17'),auth['isAuthenticated'](),controller[_0x5b4f('0x18')]);router['get'](_0x5b4f('0x19'),auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x1a')]);router[_0x5b4f('0x9')](_0x5b4f('0x1b'),auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x1c')]);router['get'](_0x5b4f('0x1d'),auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x1e')]);router['get'](_0x5b4f('0x1f'),auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x20')]);router[_0x5b4f('0x21')](_0x5b4f('0x10'),auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x22')]);router[_0x5b4f('0x21')]('/:id/canned_answers',auth[_0x5b4f('0xa')](),controller['addAnswer']);router[_0x5b4f('0x21')]('/',auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x23')]);router[_0x5b4f('0x21')]('/:id/in_servers',auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x24')]);router['post']('/:id/out_servers',auth[_0x5b4f('0xa')](),controller['addSmtp']);router[_0x5b4f('0x21')]('/:id/interactions',auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x25')]);router[_0x5b4f('0x21')](_0x5b4f('0x19'),auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x26')]);router[_0x5b4f('0x21')](_0x5b4f('0x27'),auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x28')]);router[_0x5b4f('0x21')](_0x5b4f('0x1f'),auth['isAuthenticated'](),controller[_0x5b4f('0x29')]);router[_0x5b4f('0x2a')](_0x5b4f('0xe'),auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x2b')]);router[_0x5b4f('0x2c')](_0x5b4f('0x10'),auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x2d')]);router[_0x5b4f('0x2c')](_0x5b4f('0x12'),auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x2e')]);router[_0x5b4f('0x2c')](_0x5b4f('0x14'),auth[_0x5b4f('0xa')](),controller['removeImap']);router[_0x5b4f('0x2c')](_0x5b4f('0x2f'),auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x30')]);router[_0x5b4f('0x2c')](_0x5b4f('0xe'),auth['isAuthenticated'](),controller[_0x5b4f('0x31')]);router['delete']('/:id/users',auth[_0x5b4f('0xa')](),controller[_0x5b4f('0x32')]);module[_0x5b4f('0x33')]=router; \ No newline at end of file +var _0x9919=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','/:id/users','getAgents','addDisposition','post','create','/:id/in_servers','addImap','addSmtp','addInteraction','/:id/send','send','addAgents','put','update','delete','removeImap','removeSmtp','removeAgents'];(function(_0x285919,_0x4ee768){var _0x230865=function(_0x56052c){while(--_0x56052c){_0x285919['push'](_0x285919['shift']());}};_0x230865(++_0x4ee768);}(_0x9919,0x149));var _0x9991=function(_0x53758c,_0x5664af){_0x53758c=_0x53758c-0x0;var _0x425eff=_0x9919[_0x53758c];return _0x425eff;};'use strict';var multer=require(_0x9991('0x0'));var util=require(_0x9991('0x1'));var path=require(_0x9991('0x2'));var timeout=require(_0x9991('0x3'));var express=require(_0x9991('0x4'));var router=express[_0x9991('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9991('0x6'));var interaction=require(_0x9991('0x7'));var config=require(_0x9991('0x8'));var controller=require('./mailAccount.controller');router[_0x9991('0x9')]('/',auth[_0x9991('0xa')](),controller[_0x9991('0xb')]);router[_0x9991('0x9')](_0x9991('0xc'),auth[_0x9991('0xa')](),controller[_0x9991('0xd')]);router['get'](_0x9991('0xe'),auth[_0x9991('0xa')](),controller[_0x9991('0xf')]);router[_0x9991('0x9')](_0x9991('0x10'),auth[_0x9991('0xa')](),controller[_0x9991('0x11')]);router[_0x9991('0x9')](_0x9991('0x12'),auth[_0x9991('0xa')](),controller[_0x9991('0x13')]);router[_0x9991('0x9')]('/:id/in_servers',auth[_0x9991('0xa')](),controller[_0x9991('0x14')]);router['get'](_0x9991('0x15'),auth[_0x9991('0xa')](),controller[_0x9991('0x16')]);router[_0x9991('0x9')](_0x9991('0x17'),auth[_0x9991('0xa')](),controller[_0x9991('0x18')]);router['get'](_0x9991('0x19'),auth[_0x9991('0xa')](),controller[_0x9991('0x1a')]);router[_0x9991('0x9')]('/:id/messages',auth[_0x9991('0xa')](),controller[_0x9991('0x1b')]);router[_0x9991('0x9')](_0x9991('0x1c'),auth['isAuthenticated'](),controller['verifySmtp']);router[_0x9991('0x9')](_0x9991('0x1d'),auth[_0x9991('0xa')](),controller[_0x9991('0x1e')]);router['post']('/:id/dispositions',auth[_0x9991('0xa')](),controller[_0x9991('0x1f')]);router[_0x9991('0x20')](_0x9991('0x12'),auth[_0x9991('0xa')](),controller['addAnswer']);router[_0x9991('0x20')]('/',auth[_0x9991('0xa')](),controller[_0x9991('0x21')]);router[_0x9991('0x20')](_0x9991('0x22'),auth[_0x9991('0xa')](),controller[_0x9991('0x23')]);router[_0x9991('0x20')](_0x9991('0x15'),auth[_0x9991('0xa')](),controller[_0x9991('0x24')]);router[_0x9991('0x20')](_0x9991('0x17'),auth[_0x9991('0xa')](),controller[_0x9991('0x25')]);router['post'](_0x9991('0x19'),auth['isAuthenticated'](),controller['addApplications']);router[_0x9991('0x20')](_0x9991('0x26'),auth[_0x9991('0xa')](),controller[_0x9991('0x27')]);router[_0x9991('0x20')](_0x9991('0x1d'),auth[_0x9991('0xa')](),controller[_0x9991('0x28')]);router[_0x9991('0x29')]('/:id',auth['isAuthenticated'](),controller[_0x9991('0x2a')]);router[_0x9991('0x2b')](_0x9991('0x10'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x9991('0x2b')]('/:id/canned_answers',auth[_0x9991('0xa')](),controller['removeAnswers']);router['delete']('/:id/in_servers',auth[_0x9991('0xa')](),controller[_0x9991('0x2c')]);router[_0x9991('0x2b')](_0x9991('0x15'),auth['isAuthenticated'](),controller[_0x9991('0x2d')]);router[_0x9991('0x2b')](_0x9991('0xe'),auth[_0x9991('0xa')](),controller['destroy']);router['delete'](_0x9991('0x1d'),auth[_0x9991('0xa')](),controller[_0x9991('0x2e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index ed63104..2ff9bf1 100644 --- a/server/api/mailAccount/mailAccount.attributes.js +++ b/server/api/mailAccount/mailAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1af2=['hotmail','yahoo','getDataValue','custom','provider','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','ENUM','gmail'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x1af2,0x15b));var _0x21af=function(_0x34f756,_0x1ea7ab){_0x34f756=_0x34f756-0x0;var _0x26e745=_0x1af2[_0x34f756];return _0x26e745;};'use strict';var Sequelize=require(_0x21af('0x0'));module[_0x21af('0x1')]={'description':{'type':Sequelize[_0x21af('0x2')]},'name':{'type':Sequelize[_0x21af('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x21af('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x21af('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x21af('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x21af('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x21af('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x21af('0x5')},'fontSize':{'type':Sequelize[_0x21af('0x6')](0x2)[_0x21af('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x21af('0x4')],'defaultValue':function(){return _0x21af('0x8');}},'notificationSound':{'type':Sequelize[_0x21af('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x21af('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x21af('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x21af('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x21af('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x21af('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x21af('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x21af('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x21af('0x3')],'defaultValue':![],'comment':_0x21af('0x9'),'set':function(_0xe9748c){if(!_0xe9748c)this[_0x21af('0xa')](_0x21af('0xb'),null);this[_0x21af('0xa')]('mandatoryDisposition',_0xe9748c);}},'provider':{'type':Sequelize[_0x21af('0xc')](_0x21af('0xd'),_0x21af('0xe'),_0x21af('0xf'),'outlook365'),'defaultValue':null,'get':function(){var _0xfd43e=this[_0x21af('0x10')]('provider');return _0xfd43e||_0x21af('0x11');},'set':function(_0x1c7751){if(_0x1c7751===_0x21af('0x11')){_0x1c7751=null;}return this[_0x21af('0xa')](_0x21af('0x12'),_0x1c7751);}}}; \ No newline at end of file +var _0x5807=['STRING','BOOLEAN','Arial,Helvetica,sans-serif','UNSIGNED','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','yahoo','outlook365','provider','custom','sequelize'];(function(_0x1f43a4,_0x2121ae){var _0x1ca1cc=function(_0x35047b){while(--_0x35047b){_0x1f43a4['push'](_0x1f43a4['shift']());}};_0x1ca1cc(++_0x2121ae);}(_0x5807,0x18b));var _0x7580=function(_0x263f4c,_0x438626){_0x263f4c=_0x263f4c-0x0;var _0x3a78d3=_0x5807[_0x263f4c];return _0x3a78d3;};'use strict';var Sequelize=require(_0x7580('0x0'));module['exports']={'description':{'type':Sequelize[_0x7580('0x1')]},'name':{'type':Sequelize[_0x7580('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x7580('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x7580('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x7580('0x1')],'allowNull':![],'defaultValue':_0x7580('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x7580('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x7580('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x7580('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7580('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x7580('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7580('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7580('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7580('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7580('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7580('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x7580('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x7580('0x8'),'set':function(_0x2b4524){if(!_0x2b4524)this[_0x7580('0x9')](_0x7580('0xa'),null);this[_0x7580('0x9')](_0x7580('0xb'),_0x2b4524);}},'provider':{'type':Sequelize[_0x7580('0xc')](_0x7580('0xd'),'hotmail',_0x7580('0xe'),_0x7580('0xf')),'defaultValue':null,'get':function(){var _0x43ac76=this['getDataValue'](_0x7580('0x10'));return _0x43ac76||_0x7580('0x11');},'set':function(_0xf1338b){if(_0xf1338b===_0x7580('0x11')){_0xf1338b=null;}return this[_0x7580('0x9')]('provider',_0xf1338b);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 92c9141..979a271 100644 --- a/server/api/mailAccount/mailAccount.controller.js +++ b/server/api/mailAccount/mailAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce37=['from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','SendMail','List\x20not\x20found','defaults','messageId','subject','attach','out','Interaction','verifySmtp','getSmtpOptions','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','User','getAgents','moment','bluebird','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./mailAccount.socket','jayson/promise','http','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','end','json','offset','limit','count','set','Content-Range','destroy','get','MailAccounts','UserProfileResource','stack','name','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','hotmail','smtp-mail.outlook.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','MailServerIn','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','MailServerOut','rawAttributes','find','update','body','provider','custom','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','keys','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','getInteractions','Contact','Owner','fullname','Tag','Tags','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','finally','send','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','CmContact','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found'];(function(_0x20ba2d,_0x594ce5){var _0x1f9aae=function(_0x4963f6){while(--_0x4963f6){_0x20ba2d['push'](_0x20ba2d['shift']());}};_0x1f9aae(++_0x594ce5);}(_0xce37,0x1a6));var _0x7ce3=function(_0x10b3a8,_0x19ed76){_0x10b3a8=_0x10b3a8-0x0;var _0x5eea65=_0xce37[_0x10b3a8];return _0x5eea65;};'use strict';var moment=require(_0x7ce3('0x0'));var BPromise=require(_0x7ce3('0x1'));var util=require('util');var path=require(_0x7ce3('0x2'));var _=require(_0x7ce3('0x3'));var juice=require('juice');var Redis=require(_0x7ce3('0x4'));var qs=require(_0x7ce3('0x5'));var logger=require(_0x7ce3('0x6'))(_0x7ce3('0x7'));var config=require(_0x7ce3('0x8'));var db=require(_0x7ce3('0x9'))['db'];config[_0x7ce3('0xa')]=_['defaults'](config[_0x7ce3('0xa')],{'host':_0x7ce3('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7ce3('0xc'))['register'](socket);var jayson=require(_0x7ce3('0xd'));var client=jayson['client'][_0x7ce3('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x1145e7,_0x55be9e,_0x44ebcf,_0x47e6c4){return new BPromise(function(_0x57b5a7,_0x14924b){var _0x1a385f=_0x47e6c4||client;return _0x1a385f['request'](_0x1145e7,_0x44ebcf)[_0x7ce3('0xf')](function(_0xd13983){logger[_0x7ce3('0x10')](_0x7ce3('0x11'),_0x55be9e,_0x7ce3('0x12'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x55be9e,_0x7ce3('0x12'),JSON[_0x7ce3('0x13')](_0xd13983));if(_0xd13983[_0x7ce3('0x14')]){if(_0xd13983[_0x7ce3('0x14')][_0x7ce3('0x15')]===0x1f4){logger[_0x7ce3('0x14')]('MailAccount,\x20%s,\x20%s',_0x55be9e,_0xd13983['error'][_0x7ce3('0x16')]);return _0x14924b(_0xd13983[_0x7ce3('0x14')][_0x7ce3('0x16')]);}logger[_0x7ce3('0x14')](_0x7ce3('0x11'),_0x55be9e,_0xd13983[_0x7ce3('0x14')][_0x7ce3('0x16')]);return _0x57b5a7(_0xd13983[_0x7ce3('0x14')][_0x7ce3('0x16')]);}else{logger[_0x7ce3('0x10')](_0x7ce3('0x11'),_0x55be9e,_0x7ce3('0x12'));_0x57b5a7(_0xd13983['result']['message']);}})['catch'](function(_0x17b982){logger['error'](_0x7ce3('0x11'),_0x55be9e,_0x17b982);_0x14924b(_0x17b982);});});}function respondWithStatusCode(_0x31d51b,_0x53209c){_0x53209c=_0x53209c||0xcc;return function(_0xd51b2e){if(_0xd51b2e){return _0x31d51b[_0x7ce3('0x17')](_0x53209c);}return _0x31d51b[_0x7ce3('0x18')](_0x53209c)[_0x7ce3('0x19')]();};}function respondWithResult(_0x997c4a,_0x289ffc){_0x289ffc=_0x289ffc||0xc8;return function(_0x1d44ee){if(_0x1d44ee){return _0x997c4a['status'](_0x289ffc)[_0x7ce3('0x1a')](_0x1d44ee);}};}function respondWithFilteredResult(_0x2bdb1c,_0x1be2f8){return function(_0x1889df){if(_0x1889df){var _0xa8b8fc=typeof _0x1be2f8[_0x7ce3('0x1b')]==='undefined'&&typeof _0x1be2f8[_0x7ce3('0x1c')]==='undefined';var _0x2b6385=_0x1889df[_0x7ce3('0x1d')];var _0x1890a9=_0xa8b8fc?0x0:_0x1be2f8[_0x7ce3('0x1b')];var _0x4f5253=_0xa8b8fc?_0x1889df[_0x7ce3('0x1d')]:_0x1be2f8[_0x7ce3('0x1b')]+_0x1be2f8[_0x7ce3('0x1c')];var _0x444e13;if(_0x4f5253>=_0x2b6385){_0x4f5253=_0x2b6385;_0x444e13=0xc8;}else{_0x444e13=0xce;}_0x2bdb1c[_0x7ce3('0x18')](_0x444e13);return _0x2bdb1c[_0x7ce3('0x1e')](_0x7ce3('0x1f'),_0x1890a9+'-'+_0x4f5253+'/'+_0x2b6385)[_0x7ce3('0x1a')](_0x1889df);}return null;};}function saveUpdates(_0xe5d68){return function(_0x261282){if(_0x261282){return _0x261282['update'](_0xe5d68)['then'](function(_0x25c37d){return _0x25c37d;});}return null;};}function removeEntity(_0xa367a1){return function(_0x8c82aa){if(_0x8c82aa){return _0x8c82aa[_0x7ce3('0x20')]()[_0x7ce3('0xf')](function(){var _0x2e45ed=_0x8c82aa[_0x7ce3('0x21')]({'plain':!![]});var _0x2d52db=_0x7ce3('0x22');return db[_0x7ce3('0x23')][_0x7ce3('0x20')]({'where':{'type':_0x2d52db,'resourceId':_0x2e45ed['id']}})['then'](function(){return _0x8c82aa;});})[_0x7ce3('0xf')](function(){_0xa367a1['status'](0xcc)[_0x7ce3('0x19')]();});}};}function handleEntityNotFound(_0x53e7b7){return function(_0x47ab1f){if(!_0x47ab1f){_0x53e7b7['sendStatus'](0x194);}return _0x47ab1f;};}function handleError(_0x5842a4,_0x3c652c){_0x3c652c=_0x3c652c||0x1f4;return function(_0x4a7221){logger[_0x7ce3('0x14')](_0x4a7221[_0x7ce3('0x24')]);if(_0x4a7221[_0x7ce3('0x25')]){delete _0x4a7221[_0x7ce3('0x25')];}_0x5842a4[_0x7ce3('0x18')](_0x3c652c)['send'](_0x4a7221);};}function getImapHost(_0x1c9b0f){switch(_0x1c9b0f){case _0x7ce3('0x26'):return _0x7ce3('0x27');case _0x7ce3('0x28'):return _0x7ce3('0x29');case'hotmail':return _0x7ce3('0x2a');case _0x7ce3('0x2b'):return _0x7ce3('0x2c');}throw new Error('Unknown\x20email\x20service\x20provider',_0x1c9b0f);}function getSmtpHost(_0x1d30f2){switch(_0x1d30f2){case _0x7ce3('0x26'):return'smtp.gmail.com';case _0x7ce3('0x28'):return'smtp.mail.yahoo.com';case _0x7ce3('0x2d'):return _0x7ce3('0x2e');case'outlook365':return _0x7ce3('0x2f');}throw new Error(_0x7ce3('0x30'),_0x1d30f2);}function getAuthenticationOptions(_0x10ea11,_0x4106e6){var _0x1d429a={};var _0x2ec1db={};if(_0x10ea11){_0x1d429a['user']=_0x2ec1db[_0x7ce3('0x31')]=_0x4106e6[_0x7ce3('0x32')];_0x1d429a[_0x7ce3('0x33')]=_0x2ec1db[_0x7ce3('0x34')]=_0x4106e6['password'];if(_0x4106e6[_0x7ce3('0x35')]){_0x1d429a[_0x7ce3('0x35')]=_0x2ec1db[_0x7ce3('0x35')]=!![];_0x1d429a[_0x7ce3('0x36')]=_0x2ec1db['CloudProviderId']=_0x4106e6[_0x7ce3('0x36')];_0x1d429a['password']=_0x2ec1db[_0x7ce3('0x34')]=null;}else{_0x1d429a[_0x7ce3('0x36')]=_0x2ec1db['CloudProviderId']=null;}_0x1d429a[_0x7ce3('0x37')]=getImapHost(_0x10ea11);_0x1d429a[_0x7ce3('0x38')]=0x3e1;_0x2ec1db['host']=getSmtpHost(_0x10ea11);_0x2ec1db[_0x7ce3('0x38')]=0x24b;_0x2ec1db[_0x7ce3('0x39')]=![];_0x1d429a[_0x7ce3('0x3a')]=_0x2ec1db[_0x7ce3('0x3a')]=null;}else{if(_0x4106e6[_0x7ce3('0x3b')]){_0x1d429a['user']=_0x2ec1db['user']=_0x4106e6[_0x7ce3('0x32')];_0x1d429a[_0x7ce3('0x33')]=_0x2ec1db[_0x7ce3('0x34')]=_0x4106e6[_0x7ce3('0x33')];}else{_0x1d429a[_0x7ce3('0x3b')]=_0x2ec1db[_0x7ce3('0x3b')]=![];_0x1d429a[_0x7ce3('0x31')]=_0x2ec1db['user']=null;_0x1d429a[_0x7ce3('0x33')]=_0x2ec1db[_0x7ce3('0x34')]=null;}_0x1d429a['host']=_0x4106e6[_0x7ce3('0x3c')]['host'];_0x1d429a[_0x7ce3('0x38')]=_0x4106e6['Imap']['port'];_0x2ec1db[_0x7ce3('0x37')]=_0x4106e6[_0x7ce3('0x3d')][_0x7ce3('0x37')];_0x2ec1db[_0x7ce3('0x38')]=_0x4106e6[_0x7ce3('0x3d')]['port'];}return{'Imap':_0x1d429a,'Smtp':_0x2ec1db};}exports['index']=function(_0x68c4c7,_0x4774a1){var _0x1de674={'include':[{'model':db[_0x7ce3('0x3e')],'as':_0x7ce3('0x3c')},{'model':db['MailServerOut'],'as':_0x7ce3('0x3d')},{'model':db[_0x7ce3('0x3f')],'as':_0x7ce3('0x40')}]},_0x1974ca={},_0x215694={'count':0x0,'rows':[]};var _0x400357=_[_0x7ce3('0x41')](db[_0x7ce3('0x42')]['rawAttributes'],function(_0x45d48f){return{'name':_0x45d48f[_0x7ce3('0x43')],'type':_0x45d48f['type'][_0x7ce3('0x44')]};});_0x1974ca['model']=_['map'](_0x400357,_0x7ce3('0x25'));_0x1974ca[_0x7ce3('0x45')]=_['keys'](_0x68c4c7[_0x7ce3('0x45')]);_0x1974ca[_0x7ce3('0x46')]=_[_0x7ce3('0x47')](_0x1974ca[_0x7ce3('0x48')],_0x1974ca['query']);_0x1de674[_0x7ce3('0x49')]=_[_0x7ce3('0x47')](_0x1974ca[_0x7ce3('0x48')],qs['fields'](_0x68c4c7[_0x7ce3('0x45')][_0x7ce3('0x4a')]));_0x1de674[_0x7ce3('0x49')]=_0x1de674[_0x7ce3('0x49')][_0x7ce3('0x4b')]?_0x1de674[_0x7ce3('0x49')]:_0x1974ca[_0x7ce3('0x48')];if(!_0x68c4c7[_0x7ce3('0x45')]['hasOwnProperty'](_0x7ce3('0x4c'))){_0x1de674[_0x7ce3('0x1c')]=qs[_0x7ce3('0x1c')](_0x68c4c7['query'][_0x7ce3('0x1c')]);_0x1de674['offset']=qs[_0x7ce3('0x1b')](_0x68c4c7[_0x7ce3('0x45')][_0x7ce3('0x1b')]);}_0x1de674[_0x7ce3('0x4d')]=qs[_0x7ce3('0x4e')](_0x68c4c7[_0x7ce3('0x45')][_0x7ce3('0x4e')]);_0x1de674[_0x7ce3('0x4f')]=qs[_0x7ce3('0x46')](_[_0x7ce3('0x50')](_0x68c4c7[_0x7ce3('0x45')],_0x1974ca['filters']),_0x400357);if(_0x68c4c7['query'][_0x7ce3('0x51')]){_0x1de674[_0x7ce3('0x4f')]=_[_0x7ce3('0x52')](_0x1de674[_0x7ce3('0x4f')],{'$or':_[_0x7ce3('0x41')](_0x400357,function(_0x46c6ae){if(_0x46c6ae[_0x7ce3('0x53')]!=='VIRTUAL'){var _0x2d602a={};_0x2d602a[_0x46c6ae['name']]={'$like':'%'+_0x68c4c7[_0x7ce3('0x45')]['filter']+'%'};return _0x2d602a;}})});}_0x1de674=_[_0x7ce3('0x52')]({},_0x1de674,_0x68c4c7[_0x7ce3('0x54')]);var _0x558123={'where':_0x1de674[_0x7ce3('0x4f')]};return db['MailAccount'][_0x7ce3('0x1d')](_0x558123)[_0x7ce3('0xf')](function(_0x217fdf){_0x215694[_0x7ce3('0x1d')]=_0x217fdf;if(_0x68c4c7[_0x7ce3('0x45')][_0x7ce3('0x55')]){_0x1de674[_0x7ce3('0x56')]=[{'all':!![]}];}return db['MailAccount'][_0x7ce3('0x57')](_0x1de674);})['then'](function(_0x4b9879){_0x215694[_0x7ce3('0x58')]=_0x4b9879;return _0x215694;})['then'](respondWithFilteredResult(_0x4774a1,_0x1de674))[_0x7ce3('0x59')](handleError(_0x4774a1,null));};exports[_0x7ce3('0x5a')]=function(_0x59e1cf,_0x5e2aef){var _0x2a8bd0={'raw':![],'where':{'id':_0x59e1cf[_0x7ce3('0x5b')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x7ce3('0x3c')},{'model':db[_0x7ce3('0x5c')],'as':_0x7ce3('0x3d')},{'model':db[_0x7ce3('0x3f')],'as':_0x7ce3('0x40')}]},_0x2c9406={};_0x2c9406[_0x7ce3('0x48')]=_['keys'](db['MailAccount'][_0x7ce3('0x5d')]);_0x2c9406[_0x7ce3('0x45')]=_['keys'](_0x59e1cf[_0x7ce3('0x45')]);_0x2c9406[_0x7ce3('0x46')]=_[_0x7ce3('0x47')](_0x2c9406[_0x7ce3('0x48')],_0x2c9406['query']);_0x2a8bd0[_0x7ce3('0x49')]=_[_0x7ce3('0x47')](_0x2c9406['model'],qs['fields'](_0x59e1cf[_0x7ce3('0x45')][_0x7ce3('0x4a')]));_0x2a8bd0[_0x7ce3('0x49')]=_0x2a8bd0[_0x7ce3('0x49')][_0x7ce3('0x4b')]?_0x2a8bd0['attributes']:_0x2c9406[_0x7ce3('0x48')];if(_0x59e1cf[_0x7ce3('0x45')][_0x7ce3('0x55')]){_0x2a8bd0['include']=[{'all':!![]}];}_0x2a8bd0=_[_0x7ce3('0x52')]({},_0x2a8bd0,_0x59e1cf['options']);return db['MailAccount'][_0x7ce3('0x5e')](_0x2a8bd0)[_0x7ce3('0xf')](handleEntityNotFound(_0x5e2aef,null))[_0x7ce3('0xf')](respondWithResult(_0x5e2aef,null))['catch'](handleError(_0x5e2aef,null));};exports[_0x7ce3('0x5f')]=function(_0x225c12,_0x3862a0){if(_0x225c12[_0x7ce3('0x60')]['id']){delete _0x225c12['body']['id'];}var _0x4cf964=_0x225c12['body'][_0x7ce3('0x61')]===_0x7ce3('0x62')?null:_0x225c12[_0x7ce3('0x60')][_0x7ce3('0x61')];var _0x10ae93=_0x225c12[_0x7ce3('0x60')][_0x7ce3('0x3c')]||{};var _0x561942=_0x225c12['body']['Smtp']||{};if(_0x4cf964){_0x10ae93['host']=getImapHost(_0x4cf964);_0x10ae93[_0x7ce3('0x38')]=0x3e1;_0x561942['host']=getSmtpHost(_0x4cf964);_0x561942[_0x7ce3('0x38')]=0x24b;_0x561942[_0x7ce3('0x39')]=![];}if(_0x561942[_0x7ce3('0x35')]){_0x561942[_0x7ce3('0x39')]=![];}else{_0x561942['CloudProviderId']=null;}if(!_0x10ae93[_0x7ce3('0x35')])_0x10ae93['CloudProviderId']=null;_0x225c12[_0x7ce3('0x60')]['Imap']=_0x10ae93;_0x225c12[_0x7ce3('0x60')]['Smtp']=_0x561942;return db[_0x7ce3('0x42')]['find']({'where':{'id':_0x225c12['params']['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x7ce3('0x3d')},{'model':db[_0x7ce3('0x3f')],'as':'mandatoryDispositionPause'}]})[_0x7ce3('0xf')](handleEntityNotFound(_0x3862a0,null))[_0x7ce3('0xf')](function(_0x42912b){if(!_0x42912b)throw new Error('Mail\x20Account\x20not\x20found');if(_0x42912b[_0x7ce3('0x3a')])delete _0x225c12[_0x7ce3('0x60')][_0x7ce3('0x3c')];return _0x42912b;})['then'](saveUpdates(_0x225c12['body'],null))['then'](function(_0x107d41){if(!_0x225c12[_0x7ce3('0x60')][_0x7ce3('0x3c')])return _0x107d41;return db[_0x7ce3('0x3e')]['update'](_0x225c12['body']['Imap'],{'where':{'MailAccountId':_0x107d41['id']}})[_0x7ce3('0xf')](function(){return _0x107d41;});})[_0x7ce3('0xf')](function(_0x3a95c5){if(!_0x225c12['body'][_0x7ce3('0x3d')])return _0x3a95c5;return db[_0x7ce3('0x5c')][_0x7ce3('0x5f')](_0x225c12['body']['Smtp'],{'where':{'MailAccountId':_0x3a95c5['id']}})[_0x7ce3('0xf')](function(){return _0x3a95c5;});})[_0x7ce3('0xf')](respondWithResult(_0x3862a0,null))['catch'](handleError(_0x3862a0,null));};exports[_0x7ce3('0x63')]=function(_0x21b93f,_0x24a251){return db[_0x7ce3('0x42')][_0x7ce3('0x63')]()[_0x7ce3('0xf')](respondWithResult(_0x24a251,null))['catch'](handleError(_0x24a251,null));};exports[_0x7ce3('0x64')]=function(_0x5af0ae,_0x57e477){if(_0x5af0ae[_0x7ce3('0x60')]['id']){delete _0x5af0ae[_0x7ce3('0x60')]['id'];}return db[_0x7ce3('0x42')][_0x7ce3('0x5e')]({'where':{'id':_0x5af0ae[_0x7ce3('0x5b')]['id']}})[_0x7ce3('0xf')](handleEntityNotFound(_0x57e477,null))[_0x7ce3('0xf')](function(_0x275043){if(_0x275043){_0x5af0ae[_0x7ce3('0x60')][_0x7ce3('0x65')]=_0x275043['id'];return db[_0x7ce3('0x66')][_0x7ce3('0x67')](_0x5af0ae['body']);}})[_0x7ce3('0xf')](respondWithResult(_0x57e477,null))[_0x7ce3('0x59')](handleError(_0x57e477,null));};exports[_0x7ce3('0x68')]=function(_0x549b22,_0x443d58){var _0x281e1b={'raw':![],'where':{}};var _0x936b9={};var _0x1f8969={'count':0x0,'rows':[]};return db[_0x7ce3('0x42')][_0x7ce3('0x69')]({'where':{'id':_0x549b22['params']['id']}})[_0x7ce3('0xf')](handleEntityNotFound(_0x443d58,null))[_0x7ce3('0xf')](function(_0x2444e8){if(_0x2444e8){_0x936b9['model']=_[_0x7ce3('0x6a')](db['Disposition'][_0x7ce3('0x5d')]);_0x936b9[_0x7ce3('0x45')]=_[_0x7ce3('0x6a')](_0x549b22[_0x7ce3('0x45')]);_0x936b9[_0x7ce3('0x46')]=_[_0x7ce3('0x47')](_0x936b9[_0x7ce3('0x48')],_0x936b9['query']);_0x281e1b[_0x7ce3('0x49')]=_[_0x7ce3('0x47')](_0x936b9[_0x7ce3('0x48')],qs[_0x7ce3('0x4a')](_0x549b22[_0x7ce3('0x45')]['fields']));_0x281e1b[_0x7ce3('0x49')]=_0x281e1b['attributes'][_0x7ce3('0x4b')]?_0x281e1b[_0x7ce3('0x49')]:_0x936b9['model'];if(!_0x549b22['query'][_0x7ce3('0x6b')](_0x7ce3('0x4c'))){_0x281e1b['limit']=qs[_0x7ce3('0x1c')](_0x549b22[_0x7ce3('0x45')][_0x7ce3('0x1c')]);_0x281e1b[_0x7ce3('0x1b')]=qs[_0x7ce3('0x1b')](_0x549b22[_0x7ce3('0x45')][_0x7ce3('0x1b')]);}_0x281e1b['order']=qs[_0x7ce3('0x4e')](_0x549b22[_0x7ce3('0x45')]['sort']);_0x281e1b[_0x7ce3('0x4f')]=qs[_0x7ce3('0x46')](_[_0x7ce3('0x50')](_0x549b22[_0x7ce3('0x45')],_0x936b9['filters']));_0x281e1b[_0x7ce3('0x4f')][_0x7ce3('0x65')]=_0x2444e8['id'];if(_0x549b22[_0x7ce3('0x45')][_0x7ce3('0x51')]){_0x281e1b['where']=_[_0x7ce3('0x52')](_0x281e1b[_0x7ce3('0x4f')],{'$or':_[_0x7ce3('0x41')](_0x281e1b[_0x7ce3('0x49')],function(_0x22bce2){var _0x2439f5={};_0x2439f5[_0x22bce2]={'$like':'%'+_0x549b22[_0x7ce3('0x45')][_0x7ce3('0x51')]+'%'};return _0x2439f5;})});}_0x281e1b=_['merge']({},_0x281e1b,_0x549b22[_0x7ce3('0x54')]);return db[_0x7ce3('0x66')][_0x7ce3('0x1d')]({'where':_0x281e1b['where']})[_0x7ce3('0xf')](function(_0x4e9872){_0x1f8969[_0x7ce3('0x1d')]=_0x4e9872;if(_0x549b22['query'][_0x7ce3('0x55')]){_0x281e1b[_0x7ce3('0x56')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x281e1b);})[_0x7ce3('0xf')](function(_0x136fe1){_0x1f8969[_0x7ce3('0x58')]=_0x136fe1;return _0x1f8969;});}})['then'](respondWithFilteredResult(_0x443d58,_0x281e1b))['catch'](handleError(_0x443d58,null));};exports[_0x7ce3('0x6c')]=function(_0x3dad3d,_0x3f1541){return db['MailAccount'][_0x7ce3('0x5e')]({'where':{'id':_0x3dad3d[_0x7ce3('0x5b')]['id']}})[_0x7ce3('0xf')](handleEntityNotFound(_0x3f1541,null))[_0x7ce3('0xf')](function(_0xaa48ac){if(_0xaa48ac){return _0xaa48ac[_0x7ce3('0x6c')](_0x3dad3d[_0x7ce3('0x45')][_0x7ce3('0x6d')]);}})['then'](respondWithStatusCode(_0x3f1541,null))[_0x7ce3('0x59')](handleError(_0x3f1541,null));};exports[_0x7ce3('0x6e')]=function(_0x18693a,_0x2536cb){if(_0x18693a[_0x7ce3('0x60')]['id']){delete _0x18693a[_0x7ce3('0x60')]['id'];}return db[_0x7ce3('0x42')][_0x7ce3('0x5e')]({'where':{'id':_0x18693a[_0x7ce3('0x5b')]['id']}})[_0x7ce3('0xf')](handleEntityNotFound(_0x2536cb,null))[_0x7ce3('0xf')](function(_0x593038){if(_0x593038){_0x18693a[_0x7ce3('0x60')][_0x7ce3('0x65')]=_0x593038['id'];return db[_0x7ce3('0x6f')][_0x7ce3('0x67')](_0x18693a[_0x7ce3('0x60')]);}})[_0x7ce3('0xf')](respondWithResult(_0x2536cb,null))['catch'](handleError(_0x2536cb,null));};exports[_0x7ce3('0x70')]=function(_0xc210b1,_0x1f6722){var _0x181dc8={'raw':![],'where':{}};var _0x55a77f={};var _0xbdbebe={'count':0x0,'rows':[]};return db[_0x7ce3('0x42')][_0x7ce3('0x69')]({'where':{'id':_0xc210b1[_0x7ce3('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1f6722,null))['then'](function(_0x465648){if(_0x465648){_0x55a77f['model']=_[_0x7ce3('0x6a')](db[_0x7ce3('0x6f')][_0x7ce3('0x5d')]);_0x55a77f[_0x7ce3('0x45')]=_['keys'](_0xc210b1['query']);_0x55a77f[_0x7ce3('0x46')]=_[_0x7ce3('0x47')](_0x55a77f[_0x7ce3('0x48')],_0x55a77f[_0x7ce3('0x45')]);_0x181dc8[_0x7ce3('0x49')]=_['intersection'](_0x55a77f['model'],qs[_0x7ce3('0x4a')](_0xc210b1[_0x7ce3('0x45')][_0x7ce3('0x4a')]));_0x181dc8[_0x7ce3('0x49')]=_0x181dc8['attributes']['length']?_0x181dc8[_0x7ce3('0x49')]:_0x55a77f['model'];if(!_0xc210b1[_0x7ce3('0x45')][_0x7ce3('0x6b')]('nolimit')){_0x181dc8[_0x7ce3('0x1c')]=qs[_0x7ce3('0x1c')](_0xc210b1['query'][_0x7ce3('0x1c')]);_0x181dc8[_0x7ce3('0x1b')]=qs[_0x7ce3('0x1b')](_0xc210b1[_0x7ce3('0x45')][_0x7ce3('0x1b')]);}_0x181dc8[_0x7ce3('0x4d')]=qs[_0x7ce3('0x4e')](_0xc210b1[_0x7ce3('0x45')]['sort']);_0x181dc8[_0x7ce3('0x4f')]=qs['filters'](_[_0x7ce3('0x50')](_0xc210b1[_0x7ce3('0x45')],_0x55a77f[_0x7ce3('0x46')]));_0x181dc8['where']['MailAccountId']=_0x465648['id'];if(_0xc210b1[_0x7ce3('0x45')][_0x7ce3('0x51')]){_0x181dc8[_0x7ce3('0x4f')]=_[_0x7ce3('0x52')](_0x181dc8[_0x7ce3('0x4f')],{'$or':_[_0x7ce3('0x41')](_0x181dc8['attributes'],function(_0x401b72){var _0x5d4637={};_0x5d4637[_0x401b72]={'$like':'%'+_0xc210b1[_0x7ce3('0x45')]['filter']+'%'};return _0x5d4637;})});}_0x181dc8=_[_0x7ce3('0x52')]({},_0x181dc8,_0xc210b1[_0x7ce3('0x54')]);return db[_0x7ce3('0x6f')]['count']({'where':_0x181dc8[_0x7ce3('0x4f')]})['then'](function(_0x184551){_0xbdbebe['count']=_0x184551;if(_0xc210b1['query'][_0x7ce3('0x55')]){_0x181dc8['include']=[{'all':!![]}];}return db[_0x7ce3('0x6f')]['findAll'](_0x181dc8);})[_0x7ce3('0xf')](function(_0x46a67c){_0xbdbebe[_0x7ce3('0x58')]=_0x46a67c;return _0xbdbebe;});}})[_0x7ce3('0xf')](respondWithFilteredResult(_0x1f6722,_0x181dc8))[_0x7ce3('0x59')](handleError(_0x1f6722,null));};exports[_0x7ce3('0x71')]=function(_0x499017,_0x3d6d37){return db[_0x7ce3('0x42')][_0x7ce3('0x5e')]({'where':{'id':_0x499017[_0x7ce3('0x5b')]['id']}})[_0x7ce3('0xf')](handleEntityNotFound(_0x3d6d37,null))[_0x7ce3('0xf')](function(_0x4db919){if(_0x4db919){return _0x4db919[_0x7ce3('0x71')](_0x499017[_0x7ce3('0x45')][_0x7ce3('0x6d')]);}})['then'](respondWithStatusCode(_0x3d6d37,null))['catch'](handleError(_0x3d6d37,null));};exports['create']=function(_0x5a732c,_0x51cdf5){var _0x2134f8={'name':_0x5a732c['body'][_0x7ce3('0x25')],'key':_0x5a732c[_0x7ce3('0x60')][_0x7ce3('0x44')],'provider':_0x5a732c['body'][_0x7ce3('0x61')]===_0x7ce3('0x62')?null:_0x5a732c[_0x7ce3('0x60')][_0x7ce3('0x61')],'email':_0x5a732c['body'][_0x7ce3('0x72')],'ListId':_0x5a732c[_0x7ce3('0x60')][_0x7ce3('0x73')],'active':!_[_0x7ce3('0x74')](_0x5a732c[_0x7ce3('0x60')][_0x7ce3('0x75')])?_0x5a732c[_0x7ce3('0x60')]['active']:!![],'description':_0x5a732c[_0x7ce3('0x60')][_0x7ce3('0x76')]||null};var _0x3ec73a=getAuthenticationOptions(_0x2134f8['provider'],_0x5a732c['body']);_0x2134f8[_0x7ce3('0x3c')]=_0x3ec73a['Imap'];_0x2134f8[_0x7ce3('0x3d')]=_0x3ec73a[_0x7ce3('0x3d')];return db[_0x7ce3('0x42')][_0x7ce3('0x67')](_0x2134f8,{'include':[{'model':db[_0x7ce3('0x5c')],'as':_0x7ce3('0x3d')},{'model':db[_0x7ce3('0x3e')],'as':'Imap'}]})[_0x7ce3('0xf')](function(_0x42df4a){var _0x19e376=_0x5a732c[_0x7ce3('0x31')][_0x7ce3('0x21')]({'plain':!![]});if(!_0x19e376)throw new Error(_0x7ce3('0x77'));if(_0x19e376[_0x7ce3('0x78')]==='user'){var _0x502b7c=_0x42df4a[_0x7ce3('0x21')]({'plain':!![]});return db[_0x7ce3('0x79')][_0x7ce3('0x5e')]({'where':{'name':'MailAccounts','userProfileId':_0x19e376[_0x7ce3('0x7a')]},'raw':!![]})[_0x7ce3('0xf')](function(_0x3c57e0){if(_0x3c57e0&&_0x3c57e0['autoAssociation']===0x0){return db[_0x7ce3('0x23')][_0x7ce3('0x67')]({'name':_0x502b7c[_0x7ce3('0x25')],'resourceId':_0x502b7c['id'],'type':_0x3c57e0[_0x7ce3('0x25')],'sectionId':_0x3c57e0['id']},{})[_0x7ce3('0xf')](function(){return _0x42df4a;});}else{return _0x42df4a;}})[_0x7ce3('0x59')](function(_0x347fc9){logger[_0x7ce3('0x14')](_0x7ce3('0x7b'),_0x347fc9);throw _0x347fc9;});}return _0x42df4a;})[_0x7ce3('0xf')](respondWithResult(_0x51cdf5,0xc9))[_0x7ce3('0x59')](handleError(_0x51cdf5,null));};exports[_0x7ce3('0x7c')]=function(_0x23cff3,_0x244cc5){return db[_0x7ce3('0x42')][_0x7ce3('0x69')]({'where':{'id':_0x23cff3[_0x7ce3('0x5b')]['id']}})[_0x7ce3('0xf')](handleEntityNotFound(_0x244cc5,null))[_0x7ce3('0xf')](function(_0x18c375){if(_0x18c375){return _0x18c375[_0x7ce3('0x7c')]();}return null;})[_0x7ce3('0xf')](respondWithResult(_0x244cc5,null))[_0x7ce3('0x59')](handleError(_0x244cc5,null));};exports[_0x7ce3('0x7d')]=function(_0x5722a1,_0x5f13e4){if(_0x5722a1['body']['id']){delete _0x5722a1[_0x7ce3('0x60')]['id'];}return db[_0x7ce3('0x42')][_0x7ce3('0x5e')]({'where':{'id':_0x5722a1[_0x7ce3('0x5b')]['id']}})[_0x7ce3('0xf')](handleEntityNotFound(_0x5f13e4,null))[_0x7ce3('0xf')](function(_0x574f64){if(_0x574f64){_0x5722a1['body'][_0x7ce3('0x65')]=_0x574f64['id'];return db[_0x7ce3('0x3e')][_0x7ce3('0x67')](_0x5722a1['body']);}})[_0x7ce3('0xf')](respondWithResult(_0x5f13e4,null))['catch'](handleError(_0x5f13e4,null));};exports[_0x7ce3('0x7e')]=function(_0x21ac22,_0x36de87){return db[_0x7ce3('0x42')][_0x7ce3('0x69')]({'where':{'id':_0x21ac22[_0x7ce3('0x5b')]['id']}})[_0x7ce3('0xf')](handleEntityNotFound(_0x36de87,null))[_0x7ce3('0xf')](function(_0x2b7b6a){if(_0x2b7b6a){return _0x2b7b6a[_0x7ce3('0x7f')](null);}return null;})[_0x7ce3('0xf')](respondWithStatusCode(_0x36de87,null))[_0x7ce3('0x59')](handleError(_0x36de87,null));};exports[_0x7ce3('0x80')]=function(_0x39f0f9,_0x24588b){return db[_0x7ce3('0x42')][_0x7ce3('0x69')]({'where':{'id':_0x39f0f9[_0x7ce3('0x5b')]['id']}})[_0x7ce3('0xf')](handleEntityNotFound(_0x24588b,null))[_0x7ce3('0xf')](function(_0x4e2809){if(_0x4e2809){return _0x4e2809[_0x7ce3('0x80')]();}return null;})[_0x7ce3('0xf')](respondWithResult(_0x24588b,null))['catch'](handleError(_0x24588b,null));};exports[_0x7ce3('0x81')]=function(_0x15f1ff,_0x5160bc){if(_0x15f1ff[_0x7ce3('0x60')]['id']){delete _0x15f1ff[_0x7ce3('0x60')]['id'];}return db['MailAccount'][_0x7ce3('0x5e')]({'where':{'id':_0x15f1ff[_0x7ce3('0x5b')]['id']}})[_0x7ce3('0xf')](handleEntityNotFound(_0x5160bc,null))[_0x7ce3('0xf')](function(_0x571d6e){if(_0x571d6e){_0x15f1ff[_0x7ce3('0x60')][_0x7ce3('0x65')]=_0x571d6e['id'];return db[_0x7ce3('0x5c')][_0x7ce3('0x67')](_0x15f1ff[_0x7ce3('0x60')]);}})[_0x7ce3('0xf')](respondWithResult(_0x5160bc,null))[_0x7ce3('0x59')](handleError(_0x5160bc,null));};exports[_0x7ce3('0x82')]=function(_0x1c2e7b,_0x58f7e9){return db[_0x7ce3('0x42')][_0x7ce3('0x69')]({'where':{'id':_0x1c2e7b['params']['id']}})['then'](handleEntityNotFound(_0x58f7e9,null))[_0x7ce3('0xf')](function(_0x5080d3){if(_0x5080d3){return _0x5080d3['setSmtp'](null);}return null;})[_0x7ce3('0xf')](respondWithStatusCode(_0x58f7e9,null))['catch'](handleError(_0x58f7e9,null));};exports[_0x7ce3('0x83')]=function(_0x32f4d9,_0x4eb2fe){return db[_0x7ce3('0x84')][_0x7ce3('0x5e')]({'where':{'id':_0x32f4d9[_0x7ce3('0x5b')]['id']}})[_0x7ce3('0xf')](handleEntityNotFound(_0x4eb2fe,null))[_0x7ce3('0xf')](function(_0x3f1a6f){if(_0x3f1a6f){return _0x3f1a6f[_0x7ce3('0x83')](_0x32f4d9[_0x7ce3('0x60')][_0x7ce3('0x6d')],_['omit'](_0x32f4d9[_0x7ce3('0x60')],[_0x7ce3('0x6d'),'id'])||{});}})[_0x7ce3('0xf')](respondWithResult(_0x4eb2fe,null))[_0x7ce3('0x59')](handleError(_0x4eb2fe,null));};exports[_0x7ce3('0x85')]=function(_0x3cb0f4,_0x3f4eee){var _0x5bbd43={'raw':![],'where':{}};var _0x423f3d={};var _0x182f63={'count':0x0,'rows':[]};return db[_0x7ce3('0x42')][_0x7ce3('0x69')]({'where':{'id':_0x3cb0f4['params']['id']}})[_0x7ce3('0xf')](handleEntityNotFound(_0x3f4eee,null))[_0x7ce3('0xf')](function(_0x4d1311){if(_0x4d1311){_0x423f3d[_0x7ce3('0x48')]=_['keys'](db[_0x7ce3('0x84')][_0x7ce3('0x5d')]);_0x423f3d['query']=_[_0x7ce3('0x6a')](_0x3cb0f4['query']);_0x423f3d['filters']=_['intersection'](_0x423f3d[_0x7ce3('0x48')],_0x423f3d[_0x7ce3('0x45')]);_0x5bbd43[_0x7ce3('0x49')]=_[_0x7ce3('0x47')](_0x423f3d[_0x7ce3('0x48')],qs[_0x7ce3('0x4a')](_0x3cb0f4[_0x7ce3('0x45')][_0x7ce3('0x4a')]));_0x5bbd43[_0x7ce3('0x49')]=_0x5bbd43[_0x7ce3('0x49')][_0x7ce3('0x4b')]?_0x5bbd43[_0x7ce3('0x49')]:_0x423f3d[_0x7ce3('0x48')];if(!_0x3cb0f4[_0x7ce3('0x45')][_0x7ce3('0x6b')]('nolimit')){_0x5bbd43[_0x7ce3('0x1c')]=qs[_0x7ce3('0x1c')](_0x3cb0f4[_0x7ce3('0x45')][_0x7ce3('0x1c')]);_0x5bbd43[_0x7ce3('0x1b')]=qs[_0x7ce3('0x1b')](_0x3cb0f4[_0x7ce3('0x45')][_0x7ce3('0x1b')]);}_0x5bbd43['order']=qs[_0x7ce3('0x4e')](_0x3cb0f4['query'][_0x7ce3('0x4e')]);_0x5bbd43[_0x7ce3('0x4f')]=qs[_0x7ce3('0x46')](_['pick'](_0x3cb0f4['query'],_0x423f3d[_0x7ce3('0x46')]));_0x5bbd43['where'][_0x7ce3('0x65')]=_0x4d1311['id'];if(_0x3cb0f4[_0x7ce3('0x45')][_0x7ce3('0x51')]){_0x5bbd43['where']=_['merge'](_0x5bbd43[_0x7ce3('0x4f')],{'$or':_[_0x7ce3('0x41')](_0x5bbd43[_0x7ce3('0x49')],function(_0x3eda98){var _0x5d1fd1={};_0x5d1fd1[_0x3eda98]={'$like':'%'+_0x3cb0f4['query'][_0x7ce3('0x51')]+'%'};return _0x5d1fd1;})});}_0x5bbd43=_[_0x7ce3('0x52')]({},_0x5bbd43,_0x3cb0f4['options']);return db['MailInteraction'][_0x7ce3('0x1d')]({'where':_0x5bbd43['where']})[_0x7ce3('0xf')](function(_0x433dfa){_0x182f63['count']=_0x433dfa;if(_0x3cb0f4['query'][_0x7ce3('0x55')]){_0x5bbd43[_0x7ce3('0x56')]=[{'model':db['CmContact'],'as':_0x7ce3('0x86'),'required':![]},{'model':db['User'],'as':_0x7ce3('0x87'),'attributes':['name',_0x7ce3('0x88'),'internal'],'required':![]},{'model':db[_0x7ce3('0x89')],'as':_0x7ce3('0x8a'),'attributes':['id','name','color'],'where':_0x3cb0f4['query'][_0x7ce3('0x8b')]?{'id':_0x3cb0f4[_0x7ce3('0x45')]['tag']}:undefined,'required':_0x3cb0f4[_0x7ce3('0x45')]['tag']?!![]:![]}];}return db[_0x7ce3('0x84')]['findAll'](_0x5bbd43);})[_0x7ce3('0xf')](function(_0x189c72){_0x182f63['rows']=_0x189c72;return _0x182f63;});}})[_0x7ce3('0xf')](respondWithFilteredResult(_0x3f4eee,_0x5bbd43))[_0x7ce3('0x59')](handleError(_0x3f4eee,null));};exports[_0x7ce3('0x8c')]=function addApplications(_0x884bb4,_0x18c741){var _0x12fdfd=_0x884bb4['params']['id'];var _0xe5d0e7=_0x884bb4[_0x7ce3('0x60')];var _0x554fab=0xc8;var _0x3c5d9c=null;return db[_0x7ce3('0x8d')][_0x7ce3('0x8e')]({'isolationLevel':db['sequelize']['Transaction'][_0x7ce3('0x8f')][_0x7ce3('0x90')]},function(_0x174f2c){return db[_0x7ce3('0x42')][_0x7ce3('0x69')]({'where':{'id':_0x12fdfd},'transaction':_0x174f2c})[_0x7ce3('0xf')](function(_0x3e6ef2){if(_0x3e6ef2){return db[_0x7ce3('0x91')]['destroy']({'where':{'MailAccountId':_0x12fdfd},'transaction':_0x174f2c})[_0x7ce3('0xf')](function(){var _0x82a679=_[_0x7ce3('0x41')](_0xe5d0e7,function(_0x1a43fc){_0x1a43fc[_0x7ce3('0x65')]=_0x12fdfd;return _0x1a43fc;});return db[_0x7ce3('0x91')][_0x7ce3('0x92')](_0x82a679,{'transaction':_0x174f2c});});}else{_0x554fab=0x194;_0x3c5d9c=[];}});})[_0x7ce3('0xf')](function(){if(_0x554fab!==0x194){return db[_0x7ce3('0x91')][_0x7ce3('0x93')]({'where':{'MailAccountId':_0x12fdfd},'order':'priority'})[_0x7ce3('0xf')](function(_0x177e85){_0x3c5d9c=_0x177e85;});}})['catch'](function(_0x5b4777){_0x554fab=0x1f4;logger[_0x7ce3('0x14')](_0x5b4777[_0x7ce3('0x24')]);if(_0x5b4777['name']){delete _0x5b4777[_0x7ce3('0x25')];}_0x3c5d9c=_0x5b4777;})[_0x7ce3('0x94')](function(){if(_0x3c5d9c===null){_0x18c741[_0x7ce3('0x17')](_0x554fab);}else{if(_0x554fab===0x1f4){_0x18c741[_0x7ce3('0x18')](_0x554fab)[_0x7ce3('0x95')](_0x3c5d9c);}else{_0x18c741[_0x7ce3('0x18')](_0x554fab)[_0x7ce3('0x1a')](_0x3c5d9c);}}});};exports[_0x7ce3('0x96')]=function(_0x5af4d3,_0x1a6c8f){var _0xfa016d={};var _0x31d623={};var _0x409244;var _0x2532c0;return db[_0x7ce3('0x42')][_0x7ce3('0x69')]({'where':{'id':_0x5af4d3[_0x7ce3('0x5b')]['id']}})[_0x7ce3('0xf')](handleEntityNotFound(_0x1a6c8f,null))[_0x7ce3('0xf')](function(_0x1da1c6){if(_0x1da1c6){_0x409244=_0x1da1c6;_0x31d623[_0x7ce3('0x48')]=_[_0x7ce3('0x6a')](db[_0x7ce3('0x91')][_0x7ce3('0x5d')]);_0x31d623[_0x7ce3('0x45')]=_[_0x7ce3('0x6a')](_0x5af4d3[_0x7ce3('0x45')]);_0x31d623['filters']=_['intersection'](_0x31d623[_0x7ce3('0x48')],_0x31d623[_0x7ce3('0x45')]);_0xfa016d[_0x7ce3('0x49')]=_[_0x7ce3('0x47')](_0x31d623[_0x7ce3('0x48')],qs[_0x7ce3('0x4a')](_0x5af4d3[_0x7ce3('0x45')][_0x7ce3('0x4a')]));_0xfa016d[_0x7ce3('0x49')]=_0xfa016d[_0x7ce3('0x49')][_0x7ce3('0x4b')]?_0xfa016d[_0x7ce3('0x49')]:_0x31d623[_0x7ce3('0x48')];_0xfa016d[_0x7ce3('0x4d')]=qs['sort'](_0x5af4d3[_0x7ce3('0x45')][_0x7ce3('0x4e')]);_0xfa016d['where']=qs[_0x7ce3('0x46')](_['pick'](_0x5af4d3[_0x7ce3('0x45')],_0x31d623[_0x7ce3('0x46')]));if(_0x5af4d3[_0x7ce3('0x45')][_0x7ce3('0x51')]){_0xfa016d[_0x7ce3('0x4f')]=_[_0x7ce3('0x52')](_0xfa016d['where'],{'$or':_[_0x7ce3('0x41')](_0xfa016d[_0x7ce3('0x49')],function(_0x417f79){var _0xc49b50={};_0xc49b50[_0x417f79]={'$like':'%'+_0x5af4d3[_0x7ce3('0x45')][_0x7ce3('0x51')]+'%'};return _0xc49b50;})});}_0xfa016d=_[_0x7ce3('0x52')]({},_0xfa016d,_0x5af4d3[_0x7ce3('0x54')]);return _0x409244[_0x7ce3('0x96')](_0xfa016d);}})[_0x7ce3('0xf')](function(_0x27298d){if(_0x27298d){_0x2532c0=_0x27298d['length'];if(!_0x5af4d3['query'][_0x7ce3('0x6b')]('nolimit')){_0xfa016d['limit']=qs[_0x7ce3('0x1c')](_0x5af4d3[_0x7ce3('0x45')]['limit']);_0xfa016d['offset']=qs[_0x7ce3('0x1b')](_0x5af4d3['query']['offset']);}return _0x409244[_0x7ce3('0x96')](_0xfa016d);}})['then'](function(_0x3e8285){if(_0x3e8285){return _0x3e8285?{'count':_0x2532c0,'rows':_0x3e8285}:null;}})[_0x7ce3('0xf')](respondWithResult(_0x1a6c8f,null))[_0x7ce3('0x59')](handleError(_0x1a6c8f,null));};exports[_0x7ce3('0x97')]=function(_0x27c2b6,_0x3f68c5){var _0x5062c5={'raw':!![],'where':{}};var _0x28861e={};var _0x454774={'count':0x0,'rows':[]};return db[_0x7ce3('0x42')]['findOne']({'where':{'id':_0x27c2b6[_0x7ce3('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3f68c5,null))[_0x7ce3('0xf')](function(_0x45d7cc){if(_0x45d7cc){_0x28861e[_0x7ce3('0x48')]=_[_0x7ce3('0x6a')](db[_0x7ce3('0x98')][_0x7ce3('0x5d')]);_0x28861e[_0x7ce3('0x45')]=_[_0x7ce3('0x6a')](_0x27c2b6[_0x7ce3('0x45')]);_0x28861e[_0x7ce3('0x46')]=_[_0x7ce3('0x47')](_0x28861e[_0x7ce3('0x48')],_0x28861e[_0x7ce3('0x45')]);_0x5062c5[_0x7ce3('0x49')]=_['intersection'](_0x28861e[_0x7ce3('0x48')],qs[_0x7ce3('0x4a')](_0x27c2b6[_0x7ce3('0x45')][_0x7ce3('0x4a')]));_0x5062c5['attributes']=_0x5062c5['attributes']['length']?_0x5062c5[_0x7ce3('0x49')]:_0x28861e[_0x7ce3('0x48')];if(!_0x27c2b6['query'][_0x7ce3('0x6b')](_0x7ce3('0x4c'))){_0x5062c5[_0x7ce3('0x1c')]=qs[_0x7ce3('0x1c')](_0x27c2b6[_0x7ce3('0x45')][_0x7ce3('0x1c')]);_0x5062c5[_0x7ce3('0x1b')]=qs[_0x7ce3('0x1b')](_0x27c2b6[_0x7ce3('0x45')][_0x7ce3('0x1b')]);}_0x5062c5[_0x7ce3('0x4d')]=qs[_0x7ce3('0x4e')](_0x27c2b6['query'][_0x7ce3('0x4e')]);_0x5062c5[_0x7ce3('0x4f')]=qs[_0x7ce3('0x46')](_[_0x7ce3('0x50')](_0x27c2b6[_0x7ce3('0x45')],_0x28861e['filters']));_0x5062c5[_0x7ce3('0x4f')][_0x7ce3('0x65')]=_0x45d7cc['id'];if(_0x27c2b6[_0x7ce3('0x45')][_0x7ce3('0x51')]){_0x5062c5[_0x7ce3('0x4f')]=_[_0x7ce3('0x52')](_0x5062c5[_0x7ce3('0x4f')],{'$or':_['map'](_0x5062c5['attributes'],function(_0x28d616){var _0x3a6b36={};_0x3a6b36[_0x28d616]={'$like':'%'+_0x27c2b6['query']['filter']+'%'};return _0x3a6b36;})});}if(_0x27c2b6[_0x7ce3('0x45')][_0x7ce3('0x99')]){var _0x21079c=_0x27c2b6[_0x7ce3('0x45')][_0x7ce3('0x99')][_0x7ce3('0x9a')](',');var _0x41da10={};_0x41da10[_0x21079c[0x0]]={'$gte':moment(_0x21079c[0x1])[_0x7ce3('0x9b')](_0x7ce3('0x9c'))};_0x5062c5[_0x7ce3('0x4f')]=_[_0x7ce3('0x52')](_0x5062c5['where'],_0x41da10);}_0x5062c5=_['merge']({},_0x5062c5,_0x27c2b6[_0x7ce3('0x54')]);return db[_0x7ce3('0x98')][_0x7ce3('0x1d')]({'where':_0x5062c5[_0x7ce3('0x4f')]})[_0x7ce3('0xf')](function(_0x10d37c){_0x454774[_0x7ce3('0x1d')]=_0x10d37c;if(_0x27c2b6[_0x7ce3('0x45')][_0x7ce3('0x55')]){_0x5062c5[_0x7ce3('0x56')]=[{'all':!![]}];}return db[_0x7ce3('0x98')][_0x7ce3('0x57')](_0x5062c5);})[_0x7ce3('0xf')](function(_0x2161d6){if(_0x27c2b6[_0x7ce3('0x45')]['inlineCss']===_0x7ce3('0x9d')){for(var _0xfcba96=0x0;_0xfcba96<_0x2161d6[_0x7ce3('0x4b')];_0xfcba96++){_0x2161d6[_0xfcba96][_0x7ce3('0x60')]=juice(_0x2161d6[_0xfcba96][_0x7ce3('0x60')]);}}_0x454774[_0x7ce3('0x58')]=_0x2161d6;return _0x454774;});}})[_0x7ce3('0xf')](respondWithFilteredResult(_0x3f68c5,_0x5062c5))['catch'](handleError(_0x3f68c5,null));};exports['send']=function(_0x3531e4,_0x1bc9e2){var _0x1a657c,_0x385383={},_0x4d5611;if(_0x3531e4[_0x7ce3('0x60')]['to']){_0x4d5611=_0x3531e4[_0x7ce3('0x60')]['to'][_0x7ce3('0x9a')](',')[0x0];}return db['MailAccount'][_0x7ce3('0x5e')]({'where':{'id':_0x3531e4[_0x7ce3('0x5b')]['id']},'include':[{'model':db[_0x7ce3('0x9e')],'as':_0x7ce3('0x9f'),'include':[{'model':db[_0x7ce3('0xa0')],'as':_0x7ce3('0xa1'),'where':{'email':_0x4d5611},'limit':0x1,'order':[[_0x7ce3('0xa2'),_0x7ce3('0xa3')]]}]},{'model':db[_0x7ce3('0x5c')],'as':_0x7ce3('0x3d'),'raw':!![],'include':[{'model':db[_0x7ce3('0xa4')],'as':_0x7ce3('0xa4'),'raw':!![]}]}]})[_0x7ce3('0xf')](handleEntityNotFound(_0x1bc9e2,null))[_0x7ce3('0xf')](function(_0x5b7418){if(!_0x5b7418)return;_0x1a657c=_0x5b7418;if(!_0x5b7418[_0x7ce3('0x3d')])throw new Error(_0x7ce3('0xa5'));if(_[_0x7ce3('0x74')](_0x3531e4['body']['from'])){_0x3531e4[_0x7ce3('0x60')][_0x7ce3('0xa6')]=util[_0x7ce3('0x9b')](_0x7ce3('0xa7'),_0x5b7418[_0x7ce3('0x25')],_0x5b7418[_0x7ce3('0x72')]||_0x5b7418['Smtp']['user']);}if(_0x3531e4[_0x7ce3('0x60')][_0x7ce3('0xa8')]&&_0x3531e4['body'][_0x7ce3('0xa8')][_0x7ce3('0x4b')]){for(var _0x334981=0x0;_0x334981<_0x3531e4[_0x7ce3('0x60')][_0x7ce3('0xa8')][_0x7ce3('0x4b')];_0x334981+=0x1){_0x3531e4[_0x7ce3('0x60')]['attachments'][_0x334981]={'filename':_0x3531e4[_0x7ce3('0x60')][_0x7ce3('0xa8')][_0x334981][_0x7ce3('0x25')],'path':path[_0x7ce3('0xa9')](config[_0x7ce3('0xaa')],_0x7ce3('0xab'),_0x3531e4[_0x7ce3('0x60')]['attachments'][_0x334981][_0x7ce3('0xac')])};}}var _0x14093e=_0x5b7418['getSmtpOptions']();return respondWithRpcPromise(_0x7ce3('0xad'),'sendMail',{'account':_0x14093e,'message':_0x3531e4[_0x7ce3('0x60')]});})['then'](function(_0x2b1bf9){if(!_0x2b1bf9)return;_0x385383=_0x2b1bf9;if(!_0x1a657c[_0x7ce3('0x9f')])throw new Error(_0x7ce3('0xae'));if(_0x1a657c[_0x7ce3('0x9f')][_0x7ce3('0xa1')][_0x7ce3('0x4b')])return _0x1a657c[_0x7ce3('0x9f')][_0x7ce3('0xa1')][0x0];return db[_0x7ce3('0xa0')][_0x7ce3('0x67')](_[_0x7ce3('0xaf')](_0x3531e4[_0x7ce3('0x60')],{'firstName':_0x3531e4[_0x7ce3('0x60')]['to'],'email':_0x3531e4[_0x7ce3('0x60')]['to'],'phone':_0x3531e4['body']['to'],'ListId':_0x1a657c[_0x7ce3('0x73')]}));})['then'](function(_0x5d3e1d){if(!_0x5d3e1d)return;var _0xe7f836={'UserId':_0x3531e4[_0x7ce3('0x31')]['id'],'ContactId':_0x5d3e1d['id'],'MailAccountId':_0x1a657c['id'],'inReplyTo':_0x385383[_0x7ce3('0xb0')],'to':_0x3531e4[_0x7ce3('0x60')]['from'],'cc':_0x3531e4[_0x7ce3('0x60')]['cc'],'subject':_0x3531e4[_0x7ce3('0x60')][_0x7ce3('0xb1')],'attach':_0x3531e4['body'][_0x7ce3('0xb2')],'firstMsgDirection':_0x7ce3('0xb3'),'lastMsgAt':moment()[_0x7ce3('0x9b')](_0x7ce3('0x9c')),'lastMsgDirection':'out','Messages':[_['merge'](_0x3531e4['body'],{'messageId':_0x385383['messageId'],'sentAt':moment()[_0x7ce3('0x9b')](_0x7ce3('0x9c')),'read':!![],'MailAccountId':_0x1a657c['id'],'UserId':_0x3531e4[_0x7ce3('0x31')]['id'],'ContactId':_0x5d3e1d['id']})]};if(_0x3531e4['body'][_0x7ce3('0xb4')]){_0xe7f836=_[_0x7ce3('0x52')](_0xe7f836,_0x3531e4[_0x7ce3('0x60')][_0x7ce3('0xb4')]);}return db[_0x7ce3('0x84')][_0x7ce3('0x67')](_0xe7f836,{'include':[{'model':db[_0x7ce3('0x98')],'as':'Messages'}]});})[_0x7ce3('0xf')](respondWithResult(_0x1bc9e2,null))['catch'](handleError(_0x1bc9e2,null));};exports[_0x7ce3('0xb5')]=function(_0x286d33,_0xf047bb){return db[_0x7ce3('0x42')][_0x7ce3('0x5e')]({'where':{'id':_0x286d33['params']['id']},'include':[{'model':db[_0x7ce3('0x5c')],'as':_0x7ce3('0x3d'),'raw':!![],'include':[{'model':db[_0x7ce3('0xa4')],'as':'CloudProvider','raw':!![]}]}]})[_0x7ce3('0xf')](handleEntityNotFound(_0xf047bb,null))[_0x7ce3('0xf')](function(_0x2e92ff){if(!_0x2e92ff[_0x7ce3('0x3d')])return;var _0x51999e=_0x2e92ff[_0x7ce3('0xb6')]();return respondWithRpcPromise(_0x7ce3('0xb7'),'verifySmtp',{'account':_0x51999e});})['then'](respondWithResult(_0xf047bb,null))[_0x7ce3('0x59')](handleError(_0xf047bb,null));};exports[_0x7ce3('0x20')]=function(_0x13b26b,_0x4e8217){return db[_0x7ce3('0x42')]['find']({'where':{'id':_0x13b26b[_0x7ce3('0x5b')]['id']}})[_0x7ce3('0xf')](handleEntityNotFound(_0x4e8217,null))[_0x7ce3('0xf')](function(_0x5e50a9){if(_0x5e50a9&&_0x5e50a9[_0x7ce3('0x3a')]){throw new db['Sequelize'][(_0x7ce3('0xb8'))](_0x7ce3('0xb9'));}return _0x5e50a9;})['then'](removeEntity(_0x4e8217,null))[_0x7ce3('0x59')](handleError(_0x4e8217,null));};exports[_0x7ce3('0xba')]=function(_0x19ef24,_0x2cd4ac){return db['MailAccount'][_0x7ce3('0x5e')]({'where':{'id':_0x19ef24['params']['id']}})[_0x7ce3('0xf')](handleEntityNotFound(_0x2cd4ac,null))[_0x7ce3('0xf')](function(_0x51c179){if(_0x51c179){return _0x51c179[_0x7ce3('0xba')](_0x19ef24[_0x7ce3('0x60')]['ids'],_[_0x7ce3('0xbb')](_0x19ef24[_0x7ce3('0x60')],['ids','id'])||{})[_0x7ce3('0xbc')](function(_0x119f53){for(var _0xb95cb7=0x0;_0xb95cb7<_0x19ef24[_0x7ce3('0x60')][_0x7ce3('0x6d')][_0x7ce3('0x4b')];_0xb95cb7+=0x1){socket[_0x7ce3('0xbd')](_0x7ce3('0xbe'),{'UserId':Number(_0x19ef24['body'][_0x7ce3('0x6d')][_0xb95cb7]),'MailAccountId':Number(_0x19ef24[_0x7ce3('0x5b')]['id'])});}return _0x119f53;});}})['then'](respondWithResult(_0x2cd4ac,null))[_0x7ce3('0x59')](handleError(_0x2cd4ac,null));};exports[_0x7ce3('0xbf')]=function(_0x213600,_0x3c3e29){return db['MailAccount']['find']({'where':{'id':_0x213600[_0x7ce3('0x5b')]['id']}})[_0x7ce3('0xf')](handleEntityNotFound(_0x3c3e29,null))[_0x7ce3('0xf')](function(_0x20301a){if(_0x20301a){return _0x20301a['removeAgents'](_0x213600[_0x7ce3('0x45')][_0x7ce3('0x6d')])[_0x7ce3('0xf')](function(){if(_[_0x7ce3('0xc0')](_0x213600[_0x7ce3('0x45')][_0x7ce3('0x6d')])){for(var _0x2e74a9=0x0;_0x2e74a9<_0x213600[_0x7ce3('0x45')]['ids'][_0x7ce3('0x4b')];_0x2e74a9+=0x1){socket[_0x7ce3('0xbd')]('userMailAccount:remove',{'UserId':Number(_0x213600['query'][_0x7ce3('0x6d')][_0x2e74a9]),'MailAccountId':Number(_0x213600[_0x7ce3('0x5b')]['id'])});}}else{socket['emit'](_0x7ce3('0xc1'),{'UserId':Number(_0x213600[_0x7ce3('0x45')][_0x7ce3('0x6d')]),'MailAccountId':Number(_0x213600['params']['id'])});}});}})[_0x7ce3('0xf')](respondWithStatusCode(_0x3c3e29,null))[_0x7ce3('0x59')](handleError(_0x3c3e29,null));};exports['getAgents']=function(_0x2bdac7,_0x40897c){var _0x47544b={};var _0x14c9cc={};var _0x4a503d;var _0x4b0a31;return db[_0x7ce3('0x42')][_0x7ce3('0x69')]({'where':{'id':_0x2bdac7[_0x7ce3('0x5b')]['id']}})['then'](handleEntityNotFound(_0x40897c,null))[_0x7ce3('0xf')](function(_0xc0bb73){if(_0xc0bb73){_0x4a503d=_0xc0bb73;_0x14c9cc['model']=_[_0x7ce3('0x6a')](db[_0x7ce3('0xc2')]['rawAttributes']);_0x14c9cc[_0x7ce3('0x45')]=_[_0x7ce3('0x6a')](_0x2bdac7['query']);_0x14c9cc[_0x7ce3('0x46')]=_[_0x7ce3('0x47')](_0x14c9cc[_0x7ce3('0x48')],_0x14c9cc[_0x7ce3('0x45')]);_0x47544b['attributes']=_[_0x7ce3('0x47')](_0x14c9cc[_0x7ce3('0x48')],qs[_0x7ce3('0x4a')](_0x2bdac7[_0x7ce3('0x45')][_0x7ce3('0x4a')]));_0x47544b[_0x7ce3('0x49')]=_0x47544b[_0x7ce3('0x49')][_0x7ce3('0x4b')]?_0x47544b[_0x7ce3('0x49')]:_0x14c9cc['model'];_0x47544b[_0x7ce3('0x4d')]=qs[_0x7ce3('0x4e')](_0x2bdac7[_0x7ce3('0x45')]['sort']);_0x47544b[_0x7ce3('0x4f')]=qs[_0x7ce3('0x46')](_[_0x7ce3('0x50')](_0x2bdac7[_0x7ce3('0x45')],_0x14c9cc[_0x7ce3('0x46')]));if(_0x2bdac7['query'][_0x7ce3('0x51')]){_0x47544b[_0x7ce3('0x4f')]=_['merge'](_0x47544b[_0x7ce3('0x4f')],{'$or':_[_0x7ce3('0x41')](_0x47544b['attributes'],function(_0x22d9d4){var _0x8a9c9c={};_0x8a9c9c[_0x22d9d4]={'$like':'%'+_0x2bdac7['query'][_0x7ce3('0x51')]+'%'};return _0x8a9c9c;})});}_0x47544b=_[_0x7ce3('0x52')]({},_0x47544b,_0x2bdac7['options']);return _0x4a503d[_0x7ce3('0xc3')](_0x47544b);}})[_0x7ce3('0xf')](function(_0x5ad6fc){if(_0x5ad6fc){_0x4b0a31=_0x5ad6fc[_0x7ce3('0x4b')];if(!_0x2bdac7['query'][_0x7ce3('0x6b')](_0x7ce3('0x4c'))){_0x47544b[_0x7ce3('0x1c')]=qs[_0x7ce3('0x1c')](_0x2bdac7[_0x7ce3('0x45')][_0x7ce3('0x1c')]);_0x47544b[_0x7ce3('0x1b')]=qs[_0x7ce3('0x1b')](_0x2bdac7['query'][_0x7ce3('0x1b')]);}return _0x4a503d[_0x7ce3('0xc3')](_0x47544b);}})['then'](function(_0x378a3a){if(_0x378a3a){return _0x378a3a?{'count':_0x4b0a31,'rows':_0x378a3a}:null;}})['then'](respondWithResult(_0x40897c,null))[_0x7ce3('0x59')](handleError(_0x40897c,null));}; \ No newline at end of file +var _0xfe31=['limit','offset','set','Content-Range','then','get','MailAccounts','destroy','stack','name','send','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp.office365.com','user','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','username','Imap','index','MailServerIn','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params','keys','update','body','custom','find','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','getDispositions','filter','removeDispositions','ids','addAnswer','create','getAnswers','findOne','CannedAnswer','removeAnswers','key','provider','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','fullname','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','MailApplication','bulkCreate','priority','finally','getApplications','MailMessage','$gte','split','inlineCss','true','CmList','Contacts','updatedAt','CloudProvider','isNil','from','format','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','List','List\x20not\x20found','defaults','ListId','messageId','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','getSmtpOptions','Sequelize','ValidationError','addAgents','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./mailAccount.socket','register','jayson/promise','client','http','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined'];(function(_0x335ae5,_0x23311d){var _0xca43fc=function(_0x3cb209){while(--_0x3cb209){_0x335ae5['push'](_0x335ae5['shift']());}};_0xca43fc(++_0x23311d);}(_0xfe31,0xa7));var _0x1fe3=function(_0x7b4341,_0xf1a985){_0x7b4341=_0x7b4341-0x0;var _0x4869f3=_0xfe31[_0x7b4341];return _0x4869f3;};'use strict';var moment=require(_0x1fe3('0x0'));var BPromise=require(_0x1fe3('0x1'));var util=require(_0x1fe3('0x2'));var path=require(_0x1fe3('0x3'));var _=require(_0x1fe3('0x4'));var juice=require('juice');var Redis=require(_0x1fe3('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x1fe3('0x6'))('api');var config=require(_0x1fe3('0x7'));var db=require(_0x1fe3('0x8'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x1fe3('0x9'),'port':0x18eb});var socket=require(_0x1fe3('0xa'))(new Redis(config[_0x1fe3('0xb')]));require(_0x1fe3('0xc'))[_0x1fe3('0xd')](socket);var jayson=require(_0x1fe3('0xe'));var client=jayson[_0x1fe3('0xf')][_0x1fe3('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x45c191,_0x2e9487,_0x253bae,_0x3201ad){return new BPromise(function(_0x47ef93,_0x93fdaf){var _0x2e8ee6=_0x3201ad||client;return _0x2e8ee6['request'](_0x45c191,_0x253bae)['then'](function(_0x28c63d){logger[_0x1fe3('0x11')]('MailAccount,\x20%s,\x20%s',_0x2e9487,_0x1fe3('0x12'));logger[_0x1fe3('0x13')](_0x1fe3('0x14'),_0x2e9487,'request\x20sent',JSON[_0x1fe3('0x15')](_0x28c63d));if(_0x28c63d['error']){if(_0x28c63d[_0x1fe3('0x16')][_0x1fe3('0x17')]===0x1f4){logger['error'](_0x1fe3('0x18'),_0x2e9487,_0x28c63d['error'][_0x1fe3('0x19')]);return _0x93fdaf(_0x28c63d[_0x1fe3('0x16')][_0x1fe3('0x19')]);}logger[_0x1fe3('0x16')](_0x1fe3('0x18'),_0x2e9487,_0x28c63d[_0x1fe3('0x16')][_0x1fe3('0x19')]);return _0x47ef93(_0x28c63d['error'][_0x1fe3('0x19')]);}else{logger['info'](_0x1fe3('0x18'),_0x2e9487,'request\x20sent');_0x47ef93(_0x28c63d[_0x1fe3('0x1a')][_0x1fe3('0x19')]);}})[_0x1fe3('0x1b')](function(_0x438fd2){logger[_0x1fe3('0x16')]('MailAccount,\x20%s,\x20%s',_0x2e9487,_0x438fd2);_0x93fdaf(_0x438fd2);});});}function respondWithStatusCode(_0x13889b,_0x2cef34){_0x2cef34=_0x2cef34||0xcc;return function(_0x37ff2d){if(_0x37ff2d){return _0x13889b[_0x1fe3('0x1c')](_0x2cef34);}return _0x13889b[_0x1fe3('0x1d')](_0x2cef34)[_0x1fe3('0x1e')]();};}function respondWithResult(_0x5e1368,_0x120af5){_0x120af5=_0x120af5||0xc8;return function(_0x2a54e7){if(_0x2a54e7){return _0x5e1368[_0x1fe3('0x1d')](_0x120af5)[_0x1fe3('0x1f')](_0x2a54e7);}};}function respondWithFilteredResult(_0x233319,_0x316b36){return function(_0x874a1){if(_0x874a1){var _0x54ed53=typeof _0x316b36['offset']===_0x1fe3('0x20')&&typeof _0x316b36[_0x1fe3('0x21')]===_0x1fe3('0x20');var _0x2dd3ea=_0x874a1['count'];var _0x1c59bf=_0x54ed53?0x0:_0x316b36[_0x1fe3('0x22')];var _0x55be7f=_0x54ed53?_0x874a1['count']:_0x316b36[_0x1fe3('0x22')]+_0x316b36[_0x1fe3('0x21')];var _0x2a1b91;if(_0x55be7f>=_0x2dd3ea){_0x55be7f=_0x2dd3ea;_0x2a1b91=0xc8;}else{_0x2a1b91=0xce;}_0x233319[_0x1fe3('0x1d')](_0x2a1b91);return _0x233319[_0x1fe3('0x23')](_0x1fe3('0x24'),_0x1c59bf+'-'+_0x55be7f+'/'+_0x2dd3ea)['json'](_0x874a1);}return null;};}function saveUpdates(_0x3aff9c){return function(_0x8d53b8){if(_0x8d53b8){return _0x8d53b8['update'](_0x3aff9c)[_0x1fe3('0x25')](function(_0x36ea84){return _0x36ea84;});}return null;};}function removeEntity(_0x572eab){return function(_0x14049b){if(_0x14049b){return _0x14049b['destroy']()['then'](function(){var _0x584888=_0x14049b[_0x1fe3('0x26')]({'plain':!![]});var _0x518d41=_0x1fe3('0x27');return db['UserProfileResource'][_0x1fe3('0x28')]({'where':{'type':_0x518d41,'resourceId':_0x584888['id']}})[_0x1fe3('0x25')](function(){return _0x14049b;});})[_0x1fe3('0x25')](function(){_0x572eab[_0x1fe3('0x1d')](0xcc)[_0x1fe3('0x1e')]();});}};}function handleEntityNotFound(_0x13fbfe){return function(_0x34fcb1){if(!_0x34fcb1){_0x13fbfe[_0x1fe3('0x1c')](0x194);}return _0x34fcb1;};}function handleError(_0xe51af1,_0x4cdad4){_0x4cdad4=_0x4cdad4||0x1f4;return function(_0x2c2d73){logger[_0x1fe3('0x16')](_0x2c2d73[_0x1fe3('0x29')]);if(_0x2c2d73[_0x1fe3('0x2a')]){delete _0x2c2d73['name'];}_0xe51af1[_0x1fe3('0x1d')](_0x4cdad4)[_0x1fe3('0x2b')](_0x2c2d73);};}function getImapHost(_0xb780a5){switch(_0xb780a5){case _0x1fe3('0x2c'):return _0x1fe3('0x2d');case _0x1fe3('0x2e'):return'imap.mail.yahoo.com';case _0x1fe3('0x2f'):return _0x1fe3('0x30');case _0x1fe3('0x31'):return _0x1fe3('0x32');}throw new Error(_0x1fe3('0x33'),_0xb780a5);}function getSmtpHost(_0x5b2764){switch(_0x5b2764){case _0x1fe3('0x2c'):return _0x1fe3('0x34');case'yahoo':return _0x1fe3('0x35');case _0x1fe3('0x2f'):return'smtp-mail.outlook.com';case'outlook365':return _0x1fe3('0x36');}throw new Error(_0x1fe3('0x33'),_0x5b2764);}function getAuthenticationOptions(_0x5c583c,_0x2a8a98){var _0x3718c1={};var _0x46653b={};if(_0x5c583c){_0x3718c1[_0x1fe3('0x37')]=_0x46653b['user']=_0x2a8a98['username'];_0x3718c1[_0x1fe3('0x38')]=_0x46653b[_0x1fe3('0x39')]=_0x2a8a98['password'];if(_0x2a8a98[_0x1fe3('0x3a')]){_0x3718c1[_0x1fe3('0x3a')]=_0x46653b['modernAuthentication']=!![];_0x3718c1[_0x1fe3('0x3b')]=_0x46653b[_0x1fe3('0x3b')]=_0x2a8a98[_0x1fe3('0x3b')];_0x3718c1['password']=_0x46653b[_0x1fe3('0x39')]=null;}else{_0x3718c1[_0x1fe3('0x3b')]=_0x46653b[_0x1fe3('0x3b')]=null;}_0x3718c1[_0x1fe3('0x3c')]=getImapHost(_0x5c583c);_0x3718c1[_0x1fe3('0x3d')]=0x3e1;_0x46653b[_0x1fe3('0x3c')]=getSmtpHost(_0x5c583c);_0x46653b[_0x1fe3('0x3d')]=0x24b;_0x46653b[_0x1fe3('0x3e')]=![];_0x3718c1[_0x1fe3('0x3f')]=_0x46653b[_0x1fe3('0x3f')]=null;}else{if(_0x2a8a98[_0x1fe3('0x40')]){_0x3718c1['user']=_0x46653b[_0x1fe3('0x37')]=_0x2a8a98[_0x1fe3('0x41')];_0x3718c1['password']=_0x46653b[_0x1fe3('0x39')]=_0x2a8a98[_0x1fe3('0x38')];}else{_0x3718c1['authentication']=_0x46653b[_0x1fe3('0x40')]=![];_0x3718c1[_0x1fe3('0x37')]=_0x46653b[_0x1fe3('0x37')]=null;_0x3718c1[_0x1fe3('0x38')]=_0x46653b[_0x1fe3('0x39')]=null;}_0x3718c1[_0x1fe3('0x3c')]=_0x2a8a98[_0x1fe3('0x42')][_0x1fe3('0x3c')];_0x3718c1[_0x1fe3('0x3d')]=_0x2a8a98[_0x1fe3('0x42')][_0x1fe3('0x3d')];_0x46653b[_0x1fe3('0x3c')]=_0x2a8a98['Smtp'][_0x1fe3('0x3c')];_0x46653b[_0x1fe3('0x3d')]=_0x2a8a98['Smtp'][_0x1fe3('0x3d')];}return{'Imap':_0x3718c1,'Smtp':_0x46653b};}exports[_0x1fe3('0x43')]=function(_0x36c5eb,_0x53c396){var _0x466290={'include':[{'model':db[_0x1fe3('0x44')],'as':_0x1fe3('0x42')},{'model':db[_0x1fe3('0x45')],'as':_0x1fe3('0x46')},{'model':db[_0x1fe3('0x47')],'as':_0x1fe3('0x48')}]},_0x5834bf={},_0x1d6c4a={'count':0x0,'rows':[]};var _0x3233a0=_['map'](db[_0x1fe3('0x49')][_0x1fe3('0x4a')],function(_0x4abf35){return{'name':_0x4abf35[_0x1fe3('0x4b')],'type':_0x4abf35[_0x1fe3('0x4c')]['key']};});_0x5834bf[_0x1fe3('0x4d')]=_[_0x1fe3('0x4e')](_0x3233a0,'name');_0x5834bf[_0x1fe3('0x4f')]=_['keys'](_0x36c5eb[_0x1fe3('0x4f')]);_0x5834bf[_0x1fe3('0x50')]=_[_0x1fe3('0x51')](_0x5834bf[_0x1fe3('0x4d')],_0x5834bf[_0x1fe3('0x4f')]);_0x466290[_0x1fe3('0x52')]=_[_0x1fe3('0x51')](_0x5834bf['model'],qs[_0x1fe3('0x53')](_0x36c5eb[_0x1fe3('0x4f')][_0x1fe3('0x53')]));_0x466290[_0x1fe3('0x52')]=_0x466290[_0x1fe3('0x52')][_0x1fe3('0x54')]?_0x466290[_0x1fe3('0x52')]:_0x5834bf[_0x1fe3('0x4d')];if(!_0x36c5eb[_0x1fe3('0x4f')][_0x1fe3('0x55')](_0x1fe3('0x56'))){_0x466290['limit']=qs[_0x1fe3('0x21')](_0x36c5eb[_0x1fe3('0x4f')]['limit']);_0x466290[_0x1fe3('0x22')]=qs['offset'](_0x36c5eb[_0x1fe3('0x4f')][_0x1fe3('0x22')]);}_0x466290[_0x1fe3('0x57')]=qs[_0x1fe3('0x58')](_0x36c5eb['query'][_0x1fe3('0x58')]);_0x466290[_0x1fe3('0x59')]=qs['filters'](_[_0x1fe3('0x5a')](_0x36c5eb['query'],_0x5834bf['filters']),_0x3233a0);if(_0x36c5eb['query']['filter']){_0x466290['where']=_['merge'](_0x466290[_0x1fe3('0x59')],{'$or':_[_0x1fe3('0x4e')](_0x3233a0,function(_0x1e0e85){if(_0x1e0e85[_0x1fe3('0x4c')]!==_0x1fe3('0x5b')){var _0x2f1d82={};_0x2f1d82[_0x1e0e85[_0x1fe3('0x2a')]]={'$like':'%'+_0x36c5eb[_0x1fe3('0x4f')]['filter']+'%'};return _0x2f1d82;}})});}_0x466290=_[_0x1fe3('0x5c')]({},_0x466290,_0x36c5eb[_0x1fe3('0x5d')]);var _0x13e40b={'where':_0x466290['where']};return db['MailAccount'][_0x1fe3('0x5e')](_0x13e40b)[_0x1fe3('0x25')](function(_0x434099){_0x1d6c4a[_0x1fe3('0x5e')]=_0x434099;if(_0x36c5eb[_0x1fe3('0x4f')][_0x1fe3('0x5f')]){_0x466290[_0x1fe3('0x60')]=[{'all':!![]}];}return db[_0x1fe3('0x49')][_0x1fe3('0x61')](_0x466290);})[_0x1fe3('0x25')](function(_0x4850d4){_0x1d6c4a[_0x1fe3('0x62')]=_0x4850d4;return _0x1d6c4a;})[_0x1fe3('0x25')](respondWithFilteredResult(_0x53c396,_0x466290))[_0x1fe3('0x1b')](handleError(_0x53c396,null));};exports[_0x1fe3('0x63')]=function(_0x35393b,_0x5507da){var _0x368c15={'raw':![],'where':{'id':_0x35393b[_0x1fe3('0x64')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x1fe3('0x42')},{'model':db[_0x1fe3('0x45')],'as':'Smtp'},{'model':db['Pause'],'as':_0x1fe3('0x48')}]},_0x25d17b={};_0x25d17b[_0x1fe3('0x4d')]=_[_0x1fe3('0x65')](db['MailAccount']['rawAttributes']);_0x25d17b['query']=_[_0x1fe3('0x65')](_0x35393b['query']);_0x25d17b[_0x1fe3('0x50')]=_['intersection'](_0x25d17b['model'],_0x25d17b['query']);_0x368c15[_0x1fe3('0x52')]=_[_0x1fe3('0x51')](_0x25d17b[_0x1fe3('0x4d')],qs[_0x1fe3('0x53')](_0x35393b[_0x1fe3('0x4f')]['fields']));_0x368c15[_0x1fe3('0x52')]=_0x368c15['attributes']['length']?_0x368c15['attributes']:_0x25d17b[_0x1fe3('0x4d')];if(_0x35393b['query'][_0x1fe3('0x5f')]){_0x368c15[_0x1fe3('0x60')]=[{'all':!![]}];}_0x368c15=_[_0x1fe3('0x5c')]({},_0x368c15,_0x35393b[_0x1fe3('0x5d')]);return db['MailAccount']['find'](_0x368c15)[_0x1fe3('0x25')](handleEntityNotFound(_0x5507da,null))['then'](respondWithResult(_0x5507da,null))[_0x1fe3('0x1b')](handleError(_0x5507da,null));};exports[_0x1fe3('0x66')]=function(_0x204787,_0x24f7dc){if(_0x204787['body']['id']){delete _0x204787[_0x1fe3('0x67')]['id'];}var _0x4835bf=_0x204787['body']['provider']===_0x1fe3('0x68')?null:_0x204787[_0x1fe3('0x67')]['provider'];var _0x28e9c0=_0x204787['body'][_0x1fe3('0x42')]||{};var _0x258cd2=_0x204787['body']['Smtp']||{};if(_0x4835bf){_0x28e9c0['host']=getImapHost(_0x4835bf);_0x28e9c0[_0x1fe3('0x3d')]=0x3e1;_0x258cd2[_0x1fe3('0x3c')]=getSmtpHost(_0x4835bf);_0x258cd2['port']=0x24b;_0x258cd2[_0x1fe3('0x3e')]=![];}if(_0x258cd2['modernAuthentication']){_0x258cd2[_0x1fe3('0x3e')]=![];}else{_0x258cd2[_0x1fe3('0x3b')]=null;}if(!_0x28e9c0['modernAuthentication'])_0x28e9c0[_0x1fe3('0x3b')]=null;_0x204787['body']['Imap']=_0x28e9c0;_0x204787[_0x1fe3('0x67')][_0x1fe3('0x46')]=_0x258cd2;return db['MailAccount'][_0x1fe3('0x69')]({'where':{'id':_0x204787['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x1fe3('0x42')},{'model':db[_0x1fe3('0x45')],'as':_0x1fe3('0x46')},{'model':db[_0x1fe3('0x47')],'as':_0x1fe3('0x48')}]})[_0x1fe3('0x25')](handleEntityNotFound(_0x24f7dc,null))[_0x1fe3('0x25')](function(_0x199185){if(!_0x199185)throw new Error(_0x1fe3('0x6a'));if(_0x199185['service'])delete _0x204787['body'][_0x1fe3('0x42')];return _0x199185;})['then'](saveUpdates(_0x204787[_0x1fe3('0x67')],null))[_0x1fe3('0x25')](function(_0xa3c5c3){if(!_0x204787[_0x1fe3('0x67')][_0x1fe3('0x42')])return _0xa3c5c3;return db['MailServerIn']['update'](_0x204787[_0x1fe3('0x67')][_0x1fe3('0x42')],{'where':{'MailAccountId':_0xa3c5c3['id']}})[_0x1fe3('0x25')](function(){return _0xa3c5c3;});})[_0x1fe3('0x25')](function(_0x35937e){if(!_0x204787[_0x1fe3('0x67')][_0x1fe3('0x46')])return _0x35937e;return db[_0x1fe3('0x45')][_0x1fe3('0x66')](_0x204787[_0x1fe3('0x67')][_0x1fe3('0x46')],{'where':{'MailAccountId':_0x35937e['id']}})[_0x1fe3('0x25')](function(){return _0x35937e;});})[_0x1fe3('0x25')](respondWithResult(_0x24f7dc,null))[_0x1fe3('0x1b')](handleError(_0x24f7dc,null));};exports[_0x1fe3('0x6b')]=function(_0x436258,_0x3b80f2){return db[_0x1fe3('0x49')][_0x1fe3('0x6b')]()[_0x1fe3('0x25')](respondWithResult(_0x3b80f2,null))[_0x1fe3('0x1b')](handleError(_0x3b80f2,null));};exports[_0x1fe3('0x6c')]=function(_0x22ddab,_0x313b34){if(_0x22ddab['body']['id']){delete _0x22ddab['body']['id'];}return db[_0x1fe3('0x49')]['find']({'where':{'id':_0x22ddab[_0x1fe3('0x64')]['id']}})[_0x1fe3('0x25')](handleEntityNotFound(_0x313b34,null))['then'](function(_0x3e9383){if(_0x3e9383){_0x22ddab['body'][_0x1fe3('0x6d')]=_0x3e9383['id'];return db[_0x1fe3('0x6e')]['create'](_0x22ddab[_0x1fe3('0x67')]);}})[_0x1fe3('0x25')](respondWithResult(_0x313b34,null))[_0x1fe3('0x1b')](handleError(_0x313b34,null));};exports[_0x1fe3('0x6f')]=function(_0x537063,_0x34fe8f){var _0x1e106b={'raw':![],'where':{}};var _0x27c47d={};var _0x4977af={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x537063['params']['id']}})[_0x1fe3('0x25')](handleEntityNotFound(_0x34fe8f,null))['then'](function(_0x48cbfa){if(_0x48cbfa){_0x27c47d['model']=_['keys'](db['Disposition'][_0x1fe3('0x4a')]);_0x27c47d[_0x1fe3('0x4f')]=_[_0x1fe3('0x65')](_0x537063[_0x1fe3('0x4f')]);_0x27c47d[_0x1fe3('0x50')]=_['intersection'](_0x27c47d[_0x1fe3('0x4d')],_0x27c47d[_0x1fe3('0x4f')]);_0x1e106b[_0x1fe3('0x52')]=_[_0x1fe3('0x51')](_0x27c47d['model'],qs['fields'](_0x537063[_0x1fe3('0x4f')]['fields']));_0x1e106b[_0x1fe3('0x52')]=_0x1e106b[_0x1fe3('0x52')]['length']?_0x1e106b['attributes']:_0x27c47d['model'];if(!_0x537063[_0x1fe3('0x4f')][_0x1fe3('0x55')]('nolimit')){_0x1e106b[_0x1fe3('0x21')]=qs['limit'](_0x537063[_0x1fe3('0x4f')][_0x1fe3('0x21')]);_0x1e106b['offset']=qs[_0x1fe3('0x22')](_0x537063['query']['offset']);}_0x1e106b[_0x1fe3('0x57')]=qs[_0x1fe3('0x58')](_0x537063[_0x1fe3('0x4f')][_0x1fe3('0x58')]);_0x1e106b[_0x1fe3('0x59')]=qs[_0x1fe3('0x50')](_['pick'](_0x537063[_0x1fe3('0x4f')],_0x27c47d[_0x1fe3('0x50')]));_0x1e106b['where'][_0x1fe3('0x6d')]=_0x48cbfa['id'];if(_0x537063[_0x1fe3('0x4f')][_0x1fe3('0x70')]){_0x1e106b[_0x1fe3('0x59')]=_[_0x1fe3('0x5c')](_0x1e106b[_0x1fe3('0x59')],{'$or':_['map'](_0x1e106b[_0x1fe3('0x52')],function(_0x18829c){var _0x6063d2={};_0x6063d2[_0x18829c]={'$like':'%'+_0x537063[_0x1fe3('0x4f')][_0x1fe3('0x70')]+'%'};return _0x6063d2;})});}_0x1e106b=_[_0x1fe3('0x5c')]({},_0x1e106b,_0x537063[_0x1fe3('0x5d')]);return db[_0x1fe3('0x6e')][_0x1fe3('0x5e')]({'where':_0x1e106b[_0x1fe3('0x59')]})[_0x1fe3('0x25')](function(_0x28573f){_0x4977af[_0x1fe3('0x5e')]=_0x28573f;if(_0x537063[_0x1fe3('0x4f')][_0x1fe3('0x5f')]){_0x1e106b[_0x1fe3('0x60')]=[{'all':!![]}];}return db[_0x1fe3('0x6e')][_0x1fe3('0x61')](_0x1e106b);})[_0x1fe3('0x25')](function(_0x5f1e51){_0x4977af[_0x1fe3('0x62')]=_0x5f1e51;return _0x4977af;});}})[_0x1fe3('0x25')](respondWithFilteredResult(_0x34fe8f,_0x1e106b))['catch'](handleError(_0x34fe8f,null));};exports[_0x1fe3('0x71')]=function(_0x5973fc,_0x241526){return db[_0x1fe3('0x49')][_0x1fe3('0x69')]({'where':{'id':_0x5973fc[_0x1fe3('0x64')]['id']}})[_0x1fe3('0x25')](handleEntityNotFound(_0x241526,null))['then'](function(_0x14c956){if(_0x14c956){return _0x14c956[_0x1fe3('0x71')](_0x5973fc[_0x1fe3('0x4f')][_0x1fe3('0x72')]);}})[_0x1fe3('0x25')](respondWithStatusCode(_0x241526,null))['catch'](handleError(_0x241526,null));};exports[_0x1fe3('0x73')]=function(_0x14d5b4,_0x226d88){if(_0x14d5b4['body']['id']){delete _0x14d5b4['body']['id'];}return db[_0x1fe3('0x49')][_0x1fe3('0x69')]({'where':{'id':_0x14d5b4[_0x1fe3('0x64')]['id']}})[_0x1fe3('0x25')](handleEntityNotFound(_0x226d88,null))[_0x1fe3('0x25')](function(_0x1b7273){if(_0x1b7273){_0x14d5b4[_0x1fe3('0x67')][_0x1fe3('0x6d')]=_0x1b7273['id'];return db['CannedAnswer'][_0x1fe3('0x74')](_0x14d5b4['body']);}})['then'](respondWithResult(_0x226d88,null))[_0x1fe3('0x1b')](handleError(_0x226d88,null));};exports[_0x1fe3('0x75')]=function(_0x4d7e51,_0x1d1805){var _0x87b799={'raw':![],'where':{}};var _0x2696f2={};var _0x481e99={'count':0x0,'rows':[]};return db[_0x1fe3('0x49')][_0x1fe3('0x76')]({'where':{'id':_0x4d7e51[_0x1fe3('0x64')]['id']}})['then'](handleEntityNotFound(_0x1d1805,null))[_0x1fe3('0x25')](function(_0x32f2ac){if(_0x32f2ac){_0x2696f2['model']=_[_0x1fe3('0x65')](db[_0x1fe3('0x77')][_0x1fe3('0x4a')]);_0x2696f2[_0x1fe3('0x4f')]=_[_0x1fe3('0x65')](_0x4d7e51[_0x1fe3('0x4f')]);_0x2696f2[_0x1fe3('0x50')]=_[_0x1fe3('0x51')](_0x2696f2[_0x1fe3('0x4d')],_0x2696f2[_0x1fe3('0x4f')]);_0x87b799['attributes']=_[_0x1fe3('0x51')](_0x2696f2['model'],qs[_0x1fe3('0x53')](_0x4d7e51[_0x1fe3('0x4f')][_0x1fe3('0x53')]));_0x87b799[_0x1fe3('0x52')]=_0x87b799[_0x1fe3('0x52')]['length']?_0x87b799[_0x1fe3('0x52')]:_0x2696f2[_0x1fe3('0x4d')];if(!_0x4d7e51[_0x1fe3('0x4f')][_0x1fe3('0x55')](_0x1fe3('0x56'))){_0x87b799[_0x1fe3('0x21')]=qs[_0x1fe3('0x21')](_0x4d7e51[_0x1fe3('0x4f')][_0x1fe3('0x21')]);_0x87b799['offset']=qs['offset'](_0x4d7e51[_0x1fe3('0x4f')]['offset']);}_0x87b799['order']=qs[_0x1fe3('0x58')](_0x4d7e51[_0x1fe3('0x4f')]['sort']);_0x87b799[_0x1fe3('0x59')]=qs[_0x1fe3('0x50')](_[_0x1fe3('0x5a')](_0x4d7e51[_0x1fe3('0x4f')],_0x2696f2[_0x1fe3('0x50')]));_0x87b799[_0x1fe3('0x59')]['MailAccountId']=_0x32f2ac['id'];if(_0x4d7e51[_0x1fe3('0x4f')]['filter']){_0x87b799['where']=_[_0x1fe3('0x5c')](_0x87b799[_0x1fe3('0x59')],{'$or':_['map'](_0x87b799[_0x1fe3('0x52')],function(_0x53a2b3){var _0x4bda73={};_0x4bda73[_0x53a2b3]={'$like':'%'+_0x4d7e51['query']['filter']+'%'};return _0x4bda73;})});}_0x87b799=_[_0x1fe3('0x5c')]({},_0x87b799,_0x4d7e51[_0x1fe3('0x5d')]);return db['CannedAnswer'][_0x1fe3('0x5e')]({'where':_0x87b799['where']})['then'](function(_0x4df705){_0x481e99[_0x1fe3('0x5e')]=_0x4df705;if(_0x4d7e51[_0x1fe3('0x4f')][_0x1fe3('0x5f')]){_0x87b799['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x1fe3('0x61')](_0x87b799);})[_0x1fe3('0x25')](function(_0x822616){_0x481e99[_0x1fe3('0x62')]=_0x822616;return _0x481e99;});}})[_0x1fe3('0x25')](respondWithFilteredResult(_0x1d1805,_0x87b799))[_0x1fe3('0x1b')](handleError(_0x1d1805,null));};exports['removeAnswers']=function(_0x5ced34,_0x1a3285){return db['MailAccount']['find']({'where':{'id':_0x5ced34[_0x1fe3('0x64')]['id']}})[_0x1fe3('0x25')](handleEntityNotFound(_0x1a3285,null))[_0x1fe3('0x25')](function(_0x408464){if(_0x408464){return _0x408464[_0x1fe3('0x78')](_0x5ced34['query'][_0x1fe3('0x72')]);}})[_0x1fe3('0x25')](respondWithStatusCode(_0x1a3285,null))[_0x1fe3('0x1b')](handleError(_0x1a3285,null));};exports[_0x1fe3('0x74')]=function(_0x1e8a8a,_0x1d1b8a){var _0x3c5f6a={'name':_0x1e8a8a[_0x1fe3('0x67')][_0x1fe3('0x2a')],'key':_0x1e8a8a[_0x1fe3('0x67')][_0x1fe3('0x79')],'provider':_0x1e8a8a[_0x1fe3('0x67')][_0x1fe3('0x7a')]===_0x1fe3('0x68')?null:_0x1e8a8a[_0x1fe3('0x67')][_0x1fe3('0x7a')],'email':_0x1e8a8a[_0x1fe3('0x67')]['email'],'ListId':_0x1e8a8a[_0x1fe3('0x67')]['ListId'],'active':!_['isNil'](_0x1e8a8a[_0x1fe3('0x67')][_0x1fe3('0x7b')])?_0x1e8a8a[_0x1fe3('0x67')][_0x1fe3('0x7b')]:!![],'description':_0x1e8a8a[_0x1fe3('0x67')][_0x1fe3('0x7c')]||null};var _0x4a7344=getAuthenticationOptions(_0x3c5f6a[_0x1fe3('0x7a')],_0x1e8a8a[_0x1fe3('0x67')]);_0x3c5f6a[_0x1fe3('0x42')]=_0x4a7344['Imap'];_0x3c5f6a[_0x1fe3('0x46')]=_0x4a7344[_0x1fe3('0x46')];return db[_0x1fe3('0x49')]['create'](_0x3c5f6a,{'include':[{'model':db[_0x1fe3('0x45')],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0x1fe3('0x42')}]})[_0x1fe3('0x25')](function(_0xfaca4a){var _0x388655=_0x1e8a8a[_0x1fe3('0x37')][_0x1fe3('0x26')]({'plain':!![]});if(!_0x388655)throw new Error(_0x1fe3('0x7d'));if(_0x388655[_0x1fe3('0x7e')]==='user'){var _0x24e334=_0xfaca4a[_0x1fe3('0x26')]({'plain':!![]});return db[_0x1fe3('0x7f')][_0x1fe3('0x69')]({'where':{'name':_0x1fe3('0x27'),'userProfileId':_0x388655[_0x1fe3('0x80')]},'raw':!![]})['then'](function(_0x806cdf){if(_0x806cdf&&_0x806cdf['autoAssociation']===0x0){return db[_0x1fe3('0x81')][_0x1fe3('0x74')]({'name':_0x24e334[_0x1fe3('0x2a')],'resourceId':_0x24e334['id'],'type':_0x806cdf[_0x1fe3('0x2a')],'sectionId':_0x806cdf['id']},{})[_0x1fe3('0x25')](function(){return _0xfaca4a;});}else{return _0xfaca4a;}})[_0x1fe3('0x1b')](function(_0x3f4367){logger[_0x1fe3('0x16')](_0x1fe3('0x82'),_0x3f4367);throw _0x3f4367;});}return _0xfaca4a;})['then'](respondWithResult(_0x1d1b8a,0xc9))[_0x1fe3('0x1b')](handleError(_0x1d1b8a,null));};exports[_0x1fe3('0x83')]=function(_0x21fc20,_0x7f99b7){return db['MailAccount'][_0x1fe3('0x76')]({'where':{'id':_0x21fc20[_0x1fe3('0x64')]['id']}})[_0x1fe3('0x25')](handleEntityNotFound(_0x7f99b7,null))[_0x1fe3('0x25')](function(_0xa477a2){if(_0xa477a2){return _0xa477a2[_0x1fe3('0x83')]();}return null;})[_0x1fe3('0x25')](respondWithResult(_0x7f99b7,null))[_0x1fe3('0x1b')](handleError(_0x7f99b7,null));};exports[_0x1fe3('0x84')]=function(_0x40775c,_0x15e01e){if(_0x40775c[_0x1fe3('0x67')]['id']){delete _0x40775c[_0x1fe3('0x67')]['id'];}return db[_0x1fe3('0x49')]['find']({'where':{'id':_0x40775c[_0x1fe3('0x64')]['id']}})[_0x1fe3('0x25')](handleEntityNotFound(_0x15e01e,null))[_0x1fe3('0x25')](function(_0x28ca9a){if(_0x28ca9a){_0x40775c['body'][_0x1fe3('0x6d')]=_0x28ca9a['id'];return db[_0x1fe3('0x44')]['create'](_0x40775c['body']);}})['then'](respondWithResult(_0x15e01e,null))[_0x1fe3('0x1b')](handleError(_0x15e01e,null));};exports[_0x1fe3('0x85')]=function(_0x133fbb,_0x197feb){return db['MailAccount']['findOne']({'where':{'id':_0x133fbb[_0x1fe3('0x64')]['id']}})['then'](handleEntityNotFound(_0x197feb,null))['then'](function(_0x3b26f9){if(_0x3b26f9){return _0x3b26f9[_0x1fe3('0x86')](null);}return null;})[_0x1fe3('0x25')](respondWithStatusCode(_0x197feb,null))['catch'](handleError(_0x197feb,null));};exports[_0x1fe3('0x87')]=function(_0x124e4a,_0x8f357){return db[_0x1fe3('0x49')][_0x1fe3('0x76')]({'where':{'id':_0x124e4a[_0x1fe3('0x64')]['id']}})[_0x1fe3('0x25')](handleEntityNotFound(_0x8f357,null))[_0x1fe3('0x25')](function(_0x1b2477){if(_0x1b2477){return _0x1b2477[_0x1fe3('0x87')]();}return null;})[_0x1fe3('0x25')](respondWithResult(_0x8f357,null))[_0x1fe3('0x1b')](handleError(_0x8f357,null));};exports[_0x1fe3('0x88')]=function(_0x488121,_0x2e0f7b){if(_0x488121[_0x1fe3('0x67')]['id']){delete _0x488121['body']['id'];}return db[_0x1fe3('0x49')][_0x1fe3('0x69')]({'where':{'id':_0x488121['params']['id']}})[_0x1fe3('0x25')](handleEntityNotFound(_0x2e0f7b,null))[_0x1fe3('0x25')](function(_0x4cc1f9){if(_0x4cc1f9){_0x488121[_0x1fe3('0x67')][_0x1fe3('0x6d')]=_0x4cc1f9['id'];return db[_0x1fe3('0x45')]['create'](_0x488121[_0x1fe3('0x67')]);}})[_0x1fe3('0x25')](respondWithResult(_0x2e0f7b,null))[_0x1fe3('0x1b')](handleError(_0x2e0f7b,null));};exports[_0x1fe3('0x89')]=function(_0x160cd5,_0xcab7db){return db[_0x1fe3('0x49')][_0x1fe3('0x76')]({'where':{'id':_0x160cd5[_0x1fe3('0x64')]['id']}})['then'](handleEntityNotFound(_0xcab7db,null))[_0x1fe3('0x25')](function(_0x54616f){if(_0x54616f){return _0x54616f[_0x1fe3('0x8a')](null);}return null;})[_0x1fe3('0x25')](respondWithStatusCode(_0xcab7db,null))['catch'](handleError(_0xcab7db,null));};exports[_0x1fe3('0x8b')]=function(_0x249a5f,_0x441891){return db[_0x1fe3('0x8c')][_0x1fe3('0x69')]({'where':{'id':_0x249a5f['params']['id']}})[_0x1fe3('0x25')](handleEntityNotFound(_0x441891,null))[_0x1fe3('0x25')](function(_0x2e3a76){if(_0x2e3a76){return _0x2e3a76[_0x1fe3('0x8b')](_0x249a5f[_0x1fe3('0x67')][_0x1fe3('0x72')],_[_0x1fe3('0x8d')](_0x249a5f[_0x1fe3('0x67')],[_0x1fe3('0x72'),'id'])||{});}})[_0x1fe3('0x25')](respondWithResult(_0x441891,null))[_0x1fe3('0x1b')](handleError(_0x441891,null));};exports[_0x1fe3('0x8e')]=function(_0x1f32af,_0xc362ef){var _0x16bd4b={'raw':![],'where':{}};var _0x126914={};var _0x130bba={'count':0x0,'rows':[]};return db[_0x1fe3('0x49')][_0x1fe3('0x76')]({'where':{'id':_0x1f32af[_0x1fe3('0x64')]['id']}})[_0x1fe3('0x25')](handleEntityNotFound(_0xc362ef,null))[_0x1fe3('0x25')](function(_0x1a09d9){if(_0x1a09d9){_0x126914['model']=_[_0x1fe3('0x65')](db[_0x1fe3('0x8c')][_0x1fe3('0x4a')]);_0x126914['query']=_[_0x1fe3('0x65')](_0x1f32af[_0x1fe3('0x4f')]);_0x126914['filters']=_[_0x1fe3('0x51')](_0x126914[_0x1fe3('0x4d')],_0x126914['query']);_0x16bd4b[_0x1fe3('0x52')]=_[_0x1fe3('0x51')](_0x126914['model'],qs['fields'](_0x1f32af[_0x1fe3('0x4f')]['fields']));_0x16bd4b[_0x1fe3('0x52')]=_0x16bd4b['attributes'][_0x1fe3('0x54')]?_0x16bd4b['attributes']:_0x126914[_0x1fe3('0x4d')];if(!_0x1f32af[_0x1fe3('0x4f')]['hasOwnProperty']('nolimit')){_0x16bd4b['limit']=qs[_0x1fe3('0x21')](_0x1f32af[_0x1fe3('0x4f')][_0x1fe3('0x21')]);_0x16bd4b[_0x1fe3('0x22')]=qs[_0x1fe3('0x22')](_0x1f32af[_0x1fe3('0x4f')]['offset']);}_0x16bd4b['order']=qs[_0x1fe3('0x58')](_0x1f32af['query']['sort']);_0x16bd4b['where']=qs[_0x1fe3('0x50')](_[_0x1fe3('0x5a')](_0x1f32af[_0x1fe3('0x4f')],_0x126914[_0x1fe3('0x50')]));_0x16bd4b['where'][_0x1fe3('0x6d')]=_0x1a09d9['id'];if(_0x1f32af[_0x1fe3('0x4f')][_0x1fe3('0x70')]){_0x16bd4b[_0x1fe3('0x59')]=_[_0x1fe3('0x5c')](_0x16bd4b[_0x1fe3('0x59')],{'$or':_[_0x1fe3('0x4e')](_0x16bd4b[_0x1fe3('0x52')],function(_0x35228a){var _0x171f38={};_0x171f38[_0x35228a]={'$like':'%'+_0x1f32af[_0x1fe3('0x4f')]['filter']+'%'};return _0x171f38;})});}_0x16bd4b=_['merge']({},_0x16bd4b,_0x1f32af['options']);return db['MailInteraction']['count']({'where':_0x16bd4b[_0x1fe3('0x59')]})[_0x1fe3('0x25')](function(_0x178784){_0x130bba['count']=_0x178784;if(_0x1f32af[_0x1fe3('0x4f')][_0x1fe3('0x5f')]){_0x16bd4b[_0x1fe3('0x60')]=[{'model':db[_0x1fe3('0x8f')],'as':_0x1fe3('0x90'),'required':![]},{'model':db[_0x1fe3('0x91')],'as':'Owner','attributes':[_0x1fe3('0x2a'),_0x1fe3('0x92'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x1fe3('0x93'),'attributes':['id',_0x1fe3('0x2a'),_0x1fe3('0x94')],'where':_0x1f32af[_0x1fe3('0x4f')][_0x1fe3('0x95')]?{'id':_0x1f32af[_0x1fe3('0x4f')][_0x1fe3('0x95')]}:undefined,'required':_0x1f32af[_0x1fe3('0x4f')][_0x1fe3('0x95')]?!![]:![]}];}return db['MailInteraction'][_0x1fe3('0x61')](_0x16bd4b);})[_0x1fe3('0x25')](function(_0x230d67){_0x130bba[_0x1fe3('0x62')]=_0x230d67;return _0x130bba;});}})[_0x1fe3('0x25')](respondWithFilteredResult(_0xc362ef,_0x16bd4b))[_0x1fe3('0x1b')](handleError(_0xc362ef,null));};exports['addApplications']=function addApplications(_0x1aa8f4,_0x3067fa){var _0x3018e4=_0x1aa8f4[_0x1fe3('0x64')]['id'];var _0x45f9eb=_0x1aa8f4['body'];var _0x5ea2c2=0xc8;var _0x3e126d=null;return db[_0x1fe3('0x96')][_0x1fe3('0x97')]({'isolationLevel':db[_0x1fe3('0x96')][_0x1fe3('0x98')][_0x1fe3('0x99')]['READ_COMMITTED']},function(_0x43195d){return db[_0x1fe3('0x49')][_0x1fe3('0x76')]({'where':{'id':_0x3018e4},'transaction':_0x43195d})[_0x1fe3('0x25')](function(_0x1e58f0){if(_0x1e58f0){return db[_0x1fe3('0x9a')][_0x1fe3('0x28')]({'where':{'MailAccountId':_0x3018e4},'transaction':_0x43195d})['then'](function(){var _0x391a93=_[_0x1fe3('0x4e')](_0x45f9eb,function(_0x22ce46){_0x22ce46[_0x1fe3('0x6d')]=_0x3018e4;return _0x22ce46;});return db[_0x1fe3('0x9a')][_0x1fe3('0x9b')](_0x391a93,{'transaction':_0x43195d});});}else{_0x5ea2c2=0x194;_0x3e126d=[];}});})['then'](function(){if(_0x5ea2c2!==0x194){return db[_0x1fe3('0x9a')]['findAndCountAll']({'where':{'MailAccountId':_0x3018e4},'order':_0x1fe3('0x9c')})[_0x1fe3('0x25')](function(_0x3d61fa){_0x3e126d=_0x3d61fa;});}})['catch'](function(_0x28915d){_0x5ea2c2=0x1f4;logger['error'](_0x28915d[_0x1fe3('0x29')]);if(_0x28915d[_0x1fe3('0x2a')]){delete _0x28915d[_0x1fe3('0x2a')];}_0x3e126d=_0x28915d;})[_0x1fe3('0x9d')](function(){if(_0x3e126d===null){_0x3067fa[_0x1fe3('0x1c')](_0x5ea2c2);}else{if(_0x5ea2c2===0x1f4){_0x3067fa[_0x1fe3('0x1d')](_0x5ea2c2)['send'](_0x3e126d);}else{_0x3067fa[_0x1fe3('0x1d')](_0x5ea2c2)[_0x1fe3('0x1f')](_0x3e126d);}}});};exports[_0x1fe3('0x9e')]=function(_0x31f08f,_0x1f2d3f){var _0x565366={};var _0x927203={};var _0x4400b1;var _0x4acf5e;return db[_0x1fe3('0x49')][_0x1fe3('0x76')]({'where':{'id':_0x31f08f['params']['id']}})[_0x1fe3('0x25')](handleEntityNotFound(_0x1f2d3f,null))[_0x1fe3('0x25')](function(_0x34ce9f){if(_0x34ce9f){_0x4400b1=_0x34ce9f;_0x927203[_0x1fe3('0x4d')]=_[_0x1fe3('0x65')](db[_0x1fe3('0x9a')][_0x1fe3('0x4a')]);_0x927203['query']=_[_0x1fe3('0x65')](_0x31f08f[_0x1fe3('0x4f')]);_0x927203[_0x1fe3('0x50')]=_['intersection'](_0x927203['model'],_0x927203['query']);_0x565366['attributes']=_[_0x1fe3('0x51')](_0x927203[_0x1fe3('0x4d')],qs[_0x1fe3('0x53')](_0x31f08f[_0x1fe3('0x4f')][_0x1fe3('0x53')]));_0x565366[_0x1fe3('0x52')]=_0x565366['attributes']['length']?_0x565366[_0x1fe3('0x52')]:_0x927203[_0x1fe3('0x4d')];_0x565366[_0x1fe3('0x57')]=qs[_0x1fe3('0x58')](_0x31f08f[_0x1fe3('0x4f')]['sort']);_0x565366['where']=qs[_0x1fe3('0x50')](_[_0x1fe3('0x5a')](_0x31f08f[_0x1fe3('0x4f')],_0x927203[_0x1fe3('0x50')]));if(_0x31f08f['query'][_0x1fe3('0x70')]){_0x565366['where']=_[_0x1fe3('0x5c')](_0x565366['where'],{'$or':_[_0x1fe3('0x4e')](_0x565366[_0x1fe3('0x52')],function(_0x44a2fd){var _0x44d2cb={};_0x44d2cb[_0x44a2fd]={'$like':'%'+_0x31f08f[_0x1fe3('0x4f')][_0x1fe3('0x70')]+'%'};return _0x44d2cb;})});}_0x565366=_[_0x1fe3('0x5c')]({},_0x565366,_0x31f08f[_0x1fe3('0x5d')]);return _0x4400b1[_0x1fe3('0x9e')](_0x565366);}})[_0x1fe3('0x25')](function(_0x5cca83){if(_0x5cca83){_0x4acf5e=_0x5cca83[_0x1fe3('0x54')];if(!_0x31f08f['query'][_0x1fe3('0x55')](_0x1fe3('0x56'))){_0x565366['limit']=qs[_0x1fe3('0x21')](_0x31f08f['query'][_0x1fe3('0x21')]);_0x565366[_0x1fe3('0x22')]=qs[_0x1fe3('0x22')](_0x31f08f[_0x1fe3('0x4f')][_0x1fe3('0x22')]);}return _0x4400b1[_0x1fe3('0x9e')](_0x565366);}})[_0x1fe3('0x25')](function(_0x516712){if(_0x516712){return _0x516712?{'count':_0x4acf5e,'rows':_0x516712}:null;}})[_0x1fe3('0x25')](respondWithResult(_0x1f2d3f,null))[_0x1fe3('0x1b')](handleError(_0x1f2d3f,null));};exports['getMessages']=function(_0x40a056,_0x31273c){var _0x58a3f2={'raw':!![],'where':{}};var _0x243145={};var _0x3cdce2={'count':0x0,'rows':[]};return db[_0x1fe3('0x49')][_0x1fe3('0x76')]({'where':{'id':_0x40a056[_0x1fe3('0x64')]['id']}})[_0x1fe3('0x25')](handleEntityNotFound(_0x31273c,null))['then'](function(_0xc17142){if(_0xc17142){_0x243145[_0x1fe3('0x4d')]=_[_0x1fe3('0x65')](db[_0x1fe3('0x9f')][_0x1fe3('0x4a')]);_0x243145[_0x1fe3('0x4f')]=_[_0x1fe3('0x65')](_0x40a056[_0x1fe3('0x4f')]);_0x243145[_0x1fe3('0x50')]=_['intersection'](_0x243145['model'],_0x243145[_0x1fe3('0x4f')]);_0x58a3f2['attributes']=_[_0x1fe3('0x51')](_0x243145[_0x1fe3('0x4d')],qs['fields'](_0x40a056[_0x1fe3('0x4f')][_0x1fe3('0x53')]));_0x58a3f2['attributes']=_0x58a3f2['attributes'][_0x1fe3('0x54')]?_0x58a3f2[_0x1fe3('0x52')]:_0x243145[_0x1fe3('0x4d')];if(!_0x40a056['query'][_0x1fe3('0x55')](_0x1fe3('0x56'))){_0x58a3f2[_0x1fe3('0x21')]=qs['limit'](_0x40a056[_0x1fe3('0x4f')][_0x1fe3('0x21')]);_0x58a3f2[_0x1fe3('0x22')]=qs[_0x1fe3('0x22')](_0x40a056['query'][_0x1fe3('0x22')]);}_0x58a3f2['order']=qs[_0x1fe3('0x58')](_0x40a056[_0x1fe3('0x4f')][_0x1fe3('0x58')]);_0x58a3f2[_0x1fe3('0x59')]=qs[_0x1fe3('0x50')](_[_0x1fe3('0x5a')](_0x40a056[_0x1fe3('0x4f')],_0x243145['filters']));_0x58a3f2[_0x1fe3('0x59')][_0x1fe3('0x6d')]=_0xc17142['id'];if(_0x40a056[_0x1fe3('0x4f')]['filter']){_0x58a3f2[_0x1fe3('0x59')]=_[_0x1fe3('0x5c')](_0x58a3f2[_0x1fe3('0x59')],{'$or':_['map'](_0x58a3f2[_0x1fe3('0x52')],function(_0x2a5c88){var _0x456846={};_0x456846[_0x2a5c88]={'$like':'%'+_0x40a056[_0x1fe3('0x4f')][_0x1fe3('0x70')]+'%'};return _0x456846;})});}if(_0x40a056[_0x1fe3('0x4f')][_0x1fe3('0xa0')]){var _0x42eed0=_0x40a056[_0x1fe3('0x4f')][_0x1fe3('0xa0')][_0x1fe3('0xa1')](',');var _0x3417ab={};_0x3417ab[_0x42eed0[0x0]]={'$gte':moment(_0x42eed0[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x58a3f2[_0x1fe3('0x59')]=_[_0x1fe3('0x5c')](_0x58a3f2[_0x1fe3('0x59')],_0x3417ab);}_0x58a3f2=_[_0x1fe3('0x5c')]({},_0x58a3f2,_0x40a056[_0x1fe3('0x5d')]);return db['MailMessage'][_0x1fe3('0x5e')]({'where':_0x58a3f2[_0x1fe3('0x59')]})['then'](function(_0x120cda){_0x3cdce2[_0x1fe3('0x5e')]=_0x120cda;if(_0x40a056['query']['includeAll']){_0x58a3f2[_0x1fe3('0x60')]=[{'all':!![]}];}return db[_0x1fe3('0x9f')]['findAll'](_0x58a3f2);})[_0x1fe3('0x25')](function(_0x32e36f){if(_0x40a056[_0x1fe3('0x4f')][_0x1fe3('0xa2')]===_0x1fe3('0xa3')){for(var _0x13fa8e=0x0;_0x13fa8e<_0x32e36f['length'];_0x13fa8e++){_0x32e36f[_0x13fa8e][_0x1fe3('0x67')]=juice(_0x32e36f[_0x13fa8e][_0x1fe3('0x67')]);}}_0x3cdce2[_0x1fe3('0x62')]=_0x32e36f;return _0x3cdce2;});}})[_0x1fe3('0x25')](respondWithFilteredResult(_0x31273c,_0x58a3f2))['catch'](handleError(_0x31273c,null));};exports['send']=function(_0x1a11d0,_0x16fa6a){var _0x481cb8,_0x2cab3e={},_0x4b6c14;if(_0x1a11d0[_0x1fe3('0x67')]['to']){_0x4b6c14=_0x1a11d0['body']['to'][_0x1fe3('0xa1')](',')[0x0];}return db[_0x1fe3('0x49')][_0x1fe3('0x69')]({'where':{'id':_0x1a11d0[_0x1fe3('0x64')]['id']},'include':[{'model':db[_0x1fe3('0xa4')],'as':'List','include':[{'model':db[_0x1fe3('0x8f')],'as':_0x1fe3('0xa5'),'where':{'email':_0x4b6c14},'limit':0x1,'order':[[_0x1fe3('0xa6'),'DESC']]}]},{'model':db[_0x1fe3('0x45')],'as':_0x1fe3('0x46'),'raw':!![],'include':[{'model':db[_0x1fe3('0xa7')],'as':_0x1fe3('0xa7'),'raw':!![]}]}]})[_0x1fe3('0x25')](handleEntityNotFound(_0x16fa6a,null))[_0x1fe3('0x25')](function(_0xf09e2f){if(!_0xf09e2f)return;_0x481cb8=_0xf09e2f;if(!_0xf09e2f[_0x1fe3('0x46')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x1fe3('0xa8')](_0x1a11d0[_0x1fe3('0x67')][_0x1fe3('0xa9')])){_0x1a11d0[_0x1fe3('0x67')]['from']=util[_0x1fe3('0xaa')](_0x1fe3('0xab'),_0xf09e2f[_0x1fe3('0x2a')],_0xf09e2f[_0x1fe3('0xac')]||_0xf09e2f['Smtp'][_0x1fe3('0x37')]);}if(_0x1a11d0[_0x1fe3('0x67')][_0x1fe3('0xad')]&&_0x1a11d0['body']['attachments'][_0x1fe3('0x54')]){for(var _0x263669=0x0;_0x263669<_0x1a11d0[_0x1fe3('0x67')][_0x1fe3('0xad')][_0x1fe3('0x54')];_0x263669+=0x1){_0x1a11d0[_0x1fe3('0x67')][_0x1fe3('0xad')][_0x263669]={'filename':_0x1a11d0[_0x1fe3('0x67')][_0x1fe3('0xad')][_0x263669][_0x1fe3('0x2a')],'path':path[_0x1fe3('0xae')](config[_0x1fe3('0xaf')],_0x1fe3('0xb0'),_0x1a11d0[_0x1fe3('0x67')][_0x1fe3('0xad')][_0x263669][_0x1fe3('0xb1')])};}}var _0x5959c2=_0xf09e2f['getSmtpOptions']();return respondWithRpcPromise(_0x1fe3('0xb2'),_0x1fe3('0xb3'),{'account':_0x5959c2,'message':_0x1a11d0['body']});})[_0x1fe3('0x25')](function(_0x9d82f7){if(!_0x9d82f7)return;_0x2cab3e=_0x9d82f7;if(!_0x481cb8[_0x1fe3('0xb4')])throw new Error(_0x1fe3('0xb5'));if(_0x481cb8[_0x1fe3('0xb4')]['Contacts'][_0x1fe3('0x54')])return _0x481cb8[_0x1fe3('0xb4')][_0x1fe3('0xa5')][0x0];return db['CmContact'][_0x1fe3('0x74')](_[_0x1fe3('0xb6')](_0x1a11d0[_0x1fe3('0x67')],{'firstName':_0x1a11d0[_0x1fe3('0x67')]['to'],'email':_0x1a11d0[_0x1fe3('0x67')]['to'],'phone':_0x1a11d0[_0x1fe3('0x67')]['to'],'ListId':_0x481cb8[_0x1fe3('0xb7')]}));})[_0x1fe3('0x25')](function(_0x124f9e){if(!_0x124f9e)return;var _0x556518={'UserId':_0x1a11d0[_0x1fe3('0x37')]['id'],'ContactId':_0x124f9e['id'],'MailAccountId':_0x481cb8['id'],'inReplyTo':_0x2cab3e[_0x1fe3('0xb8')],'to':_0x1a11d0[_0x1fe3('0x67')][_0x1fe3('0xa9')],'cc':_0x1a11d0[_0x1fe3('0x67')]['cc'],'subject':_0x1a11d0['body']['subject'],'attach':_0x1a11d0[_0x1fe3('0x67')][_0x1fe3('0xb9')],'firstMsgDirection':_0x1fe3('0xba'),'lastMsgAt':moment()[_0x1fe3('0xaa')](_0x1fe3('0xbb')),'lastMsgDirection':_0x1fe3('0xba'),'Messages':[_[_0x1fe3('0x5c')](_0x1a11d0[_0x1fe3('0x67')],{'messageId':_0x2cab3e[_0x1fe3('0xb8')],'sentAt':moment()[_0x1fe3('0xaa')](_0x1fe3('0xbb')),'read':!![],'MailAccountId':_0x481cb8['id'],'UserId':_0x1a11d0[_0x1fe3('0x37')]['id'],'ContactId':_0x124f9e['id']})]};if(_0x1a11d0['body'][_0x1fe3('0xbc')]){_0x556518=_['merge'](_0x556518,_0x1a11d0[_0x1fe3('0x67')]['Interaction']);}return db['MailInteraction'][_0x1fe3('0x74')](_0x556518,{'include':[{'model':db['MailMessage'],'as':_0x1fe3('0xbd')}]});})[_0x1fe3('0x25')](respondWithResult(_0x16fa6a,null))[_0x1fe3('0x1b')](handleError(_0x16fa6a,null));};exports[_0x1fe3('0xbe')]=function(_0x364cfb,_0x1a69ca){return db[_0x1fe3('0x49')][_0x1fe3('0x69')]({'where':{'id':_0x364cfb[_0x1fe3('0x64')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x1fe3('0x46'),'raw':!![],'include':[{'model':db[_0x1fe3('0xa7')],'as':'CloudProvider','raw':!![]}]}]})[_0x1fe3('0x25')](handleEntityNotFound(_0x1a69ca,null))['then'](function(_0x34f607){if(!_0x34f607[_0x1fe3('0x46')])return;var _0x51e74e=_0x34f607[_0x1fe3('0xbf')]();return respondWithRpcPromise('VerifySmtp',_0x1fe3('0xbe'),{'account':_0x51e74e});})[_0x1fe3('0x25')](respondWithResult(_0x1a69ca,null))['catch'](handleError(_0x1a69ca,null));};exports[_0x1fe3('0x28')]=function(_0x386cec,_0x40c571){return db[_0x1fe3('0x49')][_0x1fe3('0x69')]({'where':{'id':_0x386cec[_0x1fe3('0x64')]['id']}})['then'](handleEntityNotFound(_0x40c571,null))['then'](function(_0x5cba88){if(_0x5cba88&&_0x5cba88[_0x1fe3('0x3f')]){throw new db[(_0x1fe3('0xc0'))][(_0x1fe3('0xc1'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x5cba88;})['then'](removeEntity(_0x40c571,null))[_0x1fe3('0x1b')](handleError(_0x40c571,null));};exports[_0x1fe3('0xc2')]=function(_0x4403fb,_0x1451e5){return db[_0x1fe3('0x49')][_0x1fe3('0x69')]({'where':{'id':_0x4403fb[_0x1fe3('0x64')]['id']}})['then'](handleEntityNotFound(_0x1451e5,null))['then'](function(_0x56e44a){if(_0x56e44a){return _0x56e44a[_0x1fe3('0xc2')](_0x4403fb['body'][_0x1fe3('0x72')],_['omit'](_0x4403fb[_0x1fe3('0x67')],[_0x1fe3('0x72'),'id'])||{})['spread'](function(_0x362894){for(var _0x54099f=0x0;_0x54099f<_0x4403fb[_0x1fe3('0x67')]['ids'][_0x1fe3('0x54')];_0x54099f+=0x1){socket[_0x1fe3('0xc3')](_0x1fe3('0xc4'),{'UserId':Number(_0x4403fb['body'][_0x1fe3('0x72')][_0x54099f]),'MailAccountId':Number(_0x4403fb[_0x1fe3('0x64')]['id'])});}return _0x362894;});}})[_0x1fe3('0x25')](respondWithResult(_0x1451e5,null))[_0x1fe3('0x1b')](handleError(_0x1451e5,null));};exports[_0x1fe3('0xc5')]=function(_0x278044,_0x115ecb){return db[_0x1fe3('0x49')][_0x1fe3('0x69')]({'where':{'id':_0x278044['params']['id']}})[_0x1fe3('0x25')](handleEntityNotFound(_0x115ecb,null))[_0x1fe3('0x25')](function(_0x4d5876){if(_0x4d5876){return _0x4d5876['removeAgents'](_0x278044['query'][_0x1fe3('0x72')])[_0x1fe3('0x25')](function(){if(_['isArray'](_0x278044[_0x1fe3('0x4f')][_0x1fe3('0x72')])){for(var _0x407a37=0x0;_0x407a37<_0x278044['query'][_0x1fe3('0x72')][_0x1fe3('0x54')];_0x407a37+=0x1){socket[_0x1fe3('0xc3')](_0x1fe3('0xc6'),{'UserId':Number(_0x278044[_0x1fe3('0x4f')][_0x1fe3('0x72')][_0x407a37]),'MailAccountId':Number(_0x278044['params']['id'])});}}else{socket[_0x1fe3('0xc3')](_0x1fe3('0xc6'),{'UserId':Number(_0x278044['query'][_0x1fe3('0x72')]),'MailAccountId':Number(_0x278044[_0x1fe3('0x64')]['id'])});}});}})[_0x1fe3('0x25')](respondWithStatusCode(_0x115ecb,null))[_0x1fe3('0x1b')](handleError(_0x115ecb,null));};exports[_0x1fe3('0xc7')]=function(_0x16ef30,_0x57398c){var _0x1333e6={};var _0x9a31e={};var _0x182ca0;var _0x376270;return db[_0x1fe3('0x49')][_0x1fe3('0x76')]({'where':{'id':_0x16ef30[_0x1fe3('0x64')]['id']}})['then'](handleEntityNotFound(_0x57398c,null))[_0x1fe3('0x25')](function(_0x9b9cf7){if(_0x9b9cf7){_0x182ca0=_0x9b9cf7;_0x9a31e['model']=_[_0x1fe3('0x65')](db['User'][_0x1fe3('0x4a')]);_0x9a31e['query']=_['keys'](_0x16ef30[_0x1fe3('0x4f')]);_0x9a31e['filters']=_[_0x1fe3('0x51')](_0x9a31e['model'],_0x9a31e[_0x1fe3('0x4f')]);_0x1333e6[_0x1fe3('0x52')]=_[_0x1fe3('0x51')](_0x9a31e['model'],qs[_0x1fe3('0x53')](_0x16ef30[_0x1fe3('0x4f')][_0x1fe3('0x53')]));_0x1333e6[_0x1fe3('0x52')]=_0x1333e6[_0x1fe3('0x52')]['length']?_0x1333e6[_0x1fe3('0x52')]:_0x9a31e['model'];_0x1333e6[_0x1fe3('0x57')]=qs['sort'](_0x16ef30['query']['sort']);_0x1333e6[_0x1fe3('0x59')]=qs[_0x1fe3('0x50')](_[_0x1fe3('0x5a')](_0x16ef30[_0x1fe3('0x4f')],_0x9a31e['filters']));if(_0x16ef30['query'][_0x1fe3('0x70')]){_0x1333e6['where']=_[_0x1fe3('0x5c')](_0x1333e6[_0x1fe3('0x59')],{'$or':_['map'](_0x1333e6['attributes'],function(_0x4c36a7){var _0x4b4298={};_0x4b4298[_0x4c36a7]={'$like':'%'+_0x16ef30['query'][_0x1fe3('0x70')]+'%'};return _0x4b4298;})});}_0x1333e6=_['merge']({},_0x1333e6,_0x16ef30[_0x1fe3('0x5d')]);return _0x182ca0[_0x1fe3('0xc7')](_0x1333e6);}})[_0x1fe3('0x25')](function(_0x45b28f){if(_0x45b28f){_0x376270=_0x45b28f['length'];if(!_0x16ef30[_0x1fe3('0x4f')]['hasOwnProperty']('nolimit')){_0x1333e6[_0x1fe3('0x21')]=qs['limit'](_0x16ef30[_0x1fe3('0x4f')][_0x1fe3('0x21')]);_0x1333e6[_0x1fe3('0x22')]=qs['offset'](_0x16ef30['query'][_0x1fe3('0x22')]);}return _0x182ca0[_0x1fe3('0xc7')](_0x1333e6);}})[_0x1fe3('0x25')](function(_0x4fe659){if(_0x4fe659){return _0x4fe659?{'count':_0x376270,'rows':_0x4fe659}:null;}})[_0x1fe3('0x25')](respondWithResult(_0x57398c,null))[_0x1fe3('0x1b')](handleError(_0x57398c,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 11bda50..351841a 100644 --- a/server/api/mailAccount/mailAccount.events.js +++ b/server/api/mailAccount/mailAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa064=['hasOwnProperty','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','emit'];(function(_0x767d35,_0x29ba19){var _0x31c4ee=function(_0x183274){while(--_0x183274){_0x767d35['push'](_0x767d35['shift']());}};_0x31c4ee(++_0x29ba19);}(_0xa064,0x192));var _0x4a06=function(_0x52cbe2,_0x5afefb){_0x52cbe2=_0x52cbe2-0x0;var _0x277141=_0xa064[_0x52cbe2];return _0x277141;};'use strict';var EventEmitter=require(_0x4a06('0x0'));var MailAccount=require(_0x4a06('0x1'))['db'][_0x4a06('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x4a06('0x3')](0x0);var events={'afterCreate':_0x4a06('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2e300a){return function(_0x4add79,_0x390fdc,_0x475a0d){MailAccountEvents['emit'](_0x2e300a+':'+_0x4add79['id'],_0x4add79);MailAccountEvents[_0x4a06('0x5')](_0x2e300a,_0x4add79);_0x475a0d(null);};}for(var e in events){if(events[_0x4a06('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x4a06('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x52aa=['update','remove','emit','hook','exports','../../mysqldb','MailAccount','setMaxListeners','save'];(function(_0x16cb03,_0x43ea58){var _0x10944e=function(_0x27ebaa){while(--_0x27ebaa){_0x16cb03['push'](_0x16cb03['shift']());}};_0x10944e(++_0x43ea58);}(_0x52aa,0x113));var _0xa52a=function(_0x4aab35,_0x2152fa){_0x4aab35=_0x4aab35-0x0;var _0x3884ef=_0x52aa[_0x4aab35];return _0x3884ef;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xa52a('0x0'))['db'][_0xa52a('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xa52a('0x2')](0x0);var events={'afterCreate':_0xa52a('0x3'),'afterUpdate':_0xa52a('0x4'),'afterDestroy':_0xa52a('0x5')};function emitEvent(_0x1145c1){return function(_0x1cab36,_0x18975a,_0x3aaabd){MailAccountEvents[_0xa52a('0x6')](_0x1145c1+':'+_0x1cab36['id'],_0x1cab36);MailAccountEvents['emit'](_0x1145c1,_0x1cab36);_0x3aaabd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xa52a('0x7')](e,emitEvent(event));}}module[_0xa52a('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index ecbdc09..9646132 100644 --- a/server/api/mailAccount/mailAccount.model.js +++ b/server/api/mailAccount/mailAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x912d=['./mailAccount.attributes','exports','MailAccount','mail_accounts','custom','host','port','secure','Smtp','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','data5','auth','user','pass'];(function(_0x43f6c4,_0x2ff782){var _0x70942c=function(_0x2fc9e2){while(--_0x2fc9e2){_0x43f6c4['push'](_0x43f6c4['shift']());}};_0x70942c(++_0x2ff782);}(_0x912d,0x17a));var _0xd912=function(_0x22f67c,_0x4e8f91){_0x22f67c=_0x22f67c-0x0;var _0x270d5a=_0x912d[_0x22f67c];return _0x270d5a;};'use strict';var attributes=require(_0xd912('0x0'));module[_0xd912('0x1')]=function(_0x17bdb1){return _0x17bdb1['define'](_0xd912('0x2'),attributes,{'tableName':_0xd912('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0xd976b6=this;var _0x2686ed={'id':_0xd976b6['id'],'tls':{'rejectUnauthorized':![]}};if(_0xd976b6['provider']!==_0xd912('0x4')){_0x2686ed['service']=_0xd976b6['provider'];}else{_0x2686ed[_0xd912('0x5')]=_0xd976b6['Smtp'][_0xd912('0x5')];_0x2686ed[_0xd912('0x6')]=_0xd976b6['Smtp'][_0xd912('0x6')];_0x2686ed[_0xd912('0x7')]=_0xd976b6[_0xd912('0x8')][_0xd912('0x7')];}if(_0xd976b6[_0xd912('0x8')][_0xd912('0x9')]){if(_0xd976b6[_0xd912('0x8')][_0xd912('0xa')]){if(!_0xd976b6[_0xd912('0x8')][_0xd912('0xb')])throw new Error(_0xd912('0xc'));_0x2686ed['auth']={'type':_0xd912('0xd'),'user':_0xd976b6[_0xd912('0x8')]['user'],'accessToken':_0xd976b6['Smtp'][_0xd912('0xb')][_0xd912('0xe')]};}else{_0x2686ed[_0xd912('0xf')]={'user':_0xd976b6[_0xd912('0x8')][_0xd912('0x10')],'pass':_0xd976b6[_0xd912('0x8')][_0xd912('0x11')]};}}return _0x2686ed;}}});}; \ No newline at end of file +var _0x1e56=['host','Smtp','port','secure','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','data5','auth','pass','./mailAccount.attributes','exports','MailAccount','provider','custom','service'];(function(_0x3978f7,_0xa89fd3){var _0x439d82=function(_0x222414){while(--_0x222414){_0x3978f7['push'](_0x3978f7['shift']());}};_0x439d82(++_0xa89fd3);}(_0x1e56,0x1ba));var _0x61e5=function(_0x31e82b,_0x55e159){_0x31e82b=_0x31e82b-0x0;var _0x38fd35=_0x1e56[_0x31e82b];return _0x38fd35;};'use strict';var attributes=require(_0x61e5('0x0'));module[_0x61e5('0x1')]=function(_0x4ed98c){return _0x4ed98c['define'](_0x61e5('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2cd0ba=this;var _0x6d2c5e={'id':_0x2cd0ba['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2cd0ba[_0x61e5('0x3')]!==_0x61e5('0x4')){_0x6d2c5e[_0x61e5('0x5')]=_0x2cd0ba[_0x61e5('0x3')];}else{_0x6d2c5e[_0x61e5('0x6')]=_0x2cd0ba[_0x61e5('0x7')][_0x61e5('0x6')];_0x6d2c5e['port']=_0x2cd0ba[_0x61e5('0x7')][_0x61e5('0x8')];_0x6d2c5e['secure']=_0x2cd0ba['Smtp'][_0x61e5('0x9')];}if(_0x2cd0ba[_0x61e5('0x7')]['authentication']){if(_0x2cd0ba[_0x61e5('0x7')]['modernAuthentication']){if(!_0x2cd0ba[_0x61e5('0x7')]['CloudProvider'])throw new Error(_0x61e5('0xa'));_0x6d2c5e['auth']={'type':_0x61e5('0xb'),'user':_0x2cd0ba[_0x61e5('0x7')][_0x61e5('0xc')],'accessToken':_0x2cd0ba['Smtp']['CloudProvider'][_0x61e5('0xd')]};}else{_0x6d2c5e[_0x61e5('0xe')]={'user':_0x2cd0ba['Smtp'][_0x61e5('0xc')],'pass':_0x2cd0ba[_0x61e5('0x7')][_0x61e5('0xf')]};}}return _0x6d2c5e;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index edd34d4..bbc5f43 100644 --- a/server/api/mailAccount/mailAccount.rpc.js +++ b/server/api/mailAccount/mailAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3435=['*,*,*,*','length','create','List\x20not\x20found','contact','generate','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','format','interaction','attachments','originTo','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','User','name','waitForTheAssignedAgent','queueId','unshift','queue','waitForTheAssignedQueue','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','info','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailAccount','find','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','DESC','Applications','CloudProvider','get','omit','applications','list','orderBy','priority','asc','autoclose','push','close'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3435,0xfa));var _0x5343=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0x3435[_0x4b4f24];return _0x1c13d4;};'use strict';var _=require(_0x5343('0x0'));var moment=require(_0x5343('0x1'));var BPromise=require(_0x5343('0x2'));var rs=require(_0x5343('0x3'));var Redis=require(_0x5343('0x4'));var db=require(_0x5343('0x5'))['db'];var logger=require('../../config/logger')(_0x5343('0x6'));var config=require(_0x5343('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5343('0x8')]({'port':0x232c});config[_0x5343('0x9')]=_['defaults'](config['redis'],{'host':_0x5343('0xa'),'port':0x18eb});var socket=require(_0x5343('0xb'))(new Redis(config[_0x5343('0x9')]));require(_0x5343('0xc'))[_0x5343('0xd')](socket);function respondWithRpcPromise(_0x5e1147,_0x44421c,_0x50d857){return new BPromise(function(_0x1b310a,_0x328e54){return client[_0x5343('0xe')](_0x5e1147,_0x50d857)[_0x5343('0xf')](function(_0x9a2007){logger['info'](_0x5343('0x10'),_0x44421c,_0x5343('0x11'));logger[_0x5343('0x12')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x44421c,_0x5343('0x11'),JSON['stringify'](_0x9a2007));if(_0x9a2007[_0x5343('0x13')]){if(_0x9a2007[_0x5343('0x13')]['code']===0x1f4){logger[_0x5343('0x13')]('MailAccount,\x20%s,\x20%s',_0x44421c,_0x9a2007[_0x5343('0x13')][_0x5343('0x14')]);return _0x328e54(_0x9a2007[_0x5343('0x13')][_0x5343('0x14')]);}logger['error'](_0x5343('0x10'),_0x44421c,_0x9a2007[_0x5343('0x13')][_0x5343('0x14')]);return _0x1b310a(_0x9a2007[_0x5343('0x13')][_0x5343('0x14')]);}else{logger[_0x5343('0x15')](_0x5343('0x10'),_0x44421c,_0x5343('0x11'));_0x1b310a(_0x9a2007['result'][_0x5343('0x14')]);}})[_0x5343('0x16')](function(_0x1f5098){logger['error'](_0x5343('0x10'),_0x44421c,_0x1f5098);_0x328e54(_0x1f5098);});});}exports[_0x5343('0x17')]=function(_0x376c35){var _0x2f1b48=this;return new Promise(function(_0x35e68c,_0xd93241){return db[_0x5343('0x18')][_0x5343('0x19')]({'raw':_0x376c35[_0x5343('0x1a')]?_0x376c35['options'][_0x5343('0x1b')]===undefined?!![]:![]:!![],'where':_0x376c35[_0x5343('0x1a')]?_0x376c35[_0x5343('0x1a')][_0x5343('0x1c')]||null:null,'attributes':_0x376c35[_0x5343('0x1a')]?_0x376c35['options'][_0x5343('0x1d')]||null:null,'limit':_0x376c35[_0x5343('0x1a')]?_0x376c35[_0x5343('0x1a')][_0x5343('0x1e')]||null:null,'include':_0x376c35[_0x5343('0x1a')]?_0x376c35['options'][_0x5343('0x1f')]?_[_0x5343('0x20')](_0x376c35['options'][_0x5343('0x1f')],function(_0x96bbf6){return{'model':db[_0x96bbf6[_0x5343('0x21')]],'as':_0x96bbf6['as'],'attributes':_0x96bbf6['attributes'],'include':_0x96bbf6['include']?_[_0x5343('0x20')](_0x96bbf6['include'],function(_0x14d05a){return{'model':db[_0x14d05a['model']],'as':_0x14d05a['as'],'attributes':_0x14d05a[_0x5343('0x1d')],'include':_0x14d05a['include']?_['map'](_0x14d05a[_0x5343('0x1f')],function(_0x4cb858){return{'model':db[_0x4cb858['model']],'as':_0x4cb858['as'],'attributes':_0x4cb858['attributes']};}):[]};}):[]};}):[]:[]})[_0x5343('0xf')](function(_0x5d0853){logger[_0x5343('0x15')]('GetMailAccount',_0x376c35);logger['debug'](_0x5343('0x17'),_0x376c35,JSON['stringify'](_0x5d0853));_0x35e68c(_0x5d0853);})['catch'](function(_0x125e4c){logger[_0x5343('0x13')](_0x5343('0x17'),_0x125e4c[_0x5343('0x14')],_0x376c35);_0xd93241(_0x2f1b48['error'](0x1f4,_0x125e4c['message']));});});};exports[_0x5343('0x22')]=function(_0x32ecf2){var _0x1fb79f=this;return new Promise(function(_0x1278a1,_0x473c59){return db[_0x5343('0x18')][_0x5343('0x23')]({'raw':_0x32ecf2[_0x5343('0x1a')]?_0x32ecf2[_0x5343('0x1a')][_0x5343('0x1b')]===undefined?!![]:![]:!![],'where':_0x32ecf2[_0x5343('0x1a')]?_0x32ecf2[_0x5343('0x1a')]['where']||null:null,'attributes':_0x32ecf2['options']?_0x32ecf2[_0x5343('0x1a')][_0x5343('0x1d')]||null:null,'include':_0x32ecf2['options']?_0x32ecf2[_0x5343('0x1a')]['include']?_[_0x5343('0x20')](_0x32ecf2[_0x5343('0x1a')][_0x5343('0x1f')],function(_0xcb89df){return{'model':db[_0xcb89df['model']],'as':_0xcb89df['as'],'attributes':_0xcb89df['attributes'],'include':_0xcb89df[_0x5343('0x1f')]?_['map'](_0xcb89df[_0x5343('0x1f')],function(_0x11954b){return{'model':db[_0x11954b['model']],'as':_0x11954b['as'],'attributes':_0x11954b[_0x5343('0x1d')],'include':_0x11954b['include']?_['map'](_0x11954b[_0x5343('0x1f')],function(_0x16383f){return{'model':db[_0x16383f[_0x5343('0x21')]],'as':_0x16383f['as'],'attributes':_0x16383f[_0x5343('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x549996){if(_0x32ecf2['options']['smtp']===!![])_0x549996[_0x5343('0x24')](_0x5343('0x25'),_0x549996[_0x5343('0x26')]());logger[_0x5343('0x15')](_0x5343('0x22'),_0x32ecf2);logger[_0x5343('0x12')](_0x5343('0x22'),_0x32ecf2,JSON['stringify'](_0x549996));_0x1278a1(_0x549996);})[_0x5343('0x16')](function(_0x4926f8){logger[_0x5343('0x13')](_0x5343('0x22'),_0x4926f8[_0x5343('0x14')],_0x32ecf2);_0x473c59(_0x1fb79f[_0x5343('0x13')](0x1f4,_0x4926f8[_0x5343('0x14')]));});});};exports[_0x5343('0x27')]=function(_0x1fe925){var _0x4d919e=this;return new Promise(function(_0xb93d9,_0x52c521){var _0x28c274={'body':_0x1fe925[_0x5343('0x28')],'channel':_0x5343('0x29')};var _0x32b3ec=_[_0x5343('0x2a')](_[_0x5343('0x2b')](db[_0x5343('0x2c')]['rawAttributes']),[_0x5343('0x2d'),_0x5343('0x2e'),'CompanyId',_0x5343('0x2f')]);var _0x16c880=![];if(_0x1fe925['body']['id']){delete _0x1fe925['body']['id'];}if(_[_0x5343('0x30')](_0x1fe925[_0x5343('0x28')][_0x5343('0x31')])){return _0x52c521(_0x4d919e['error'](0x1f4,_0x5343('0x32')));}if(_[_0x5343('0x30')](_0x1fe925[_0x5343('0x28')][_0x5343('0x28')])||_0x1fe925[_0x5343('0x28')][_0x5343('0x28')]===''){return _0x52c521(_0x4d919e[_0x5343('0x13')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x5343('0x30')](_0x1fe925[_0x5343('0x28')][_0x5343('0x33')])){return _0x52c521(_0x4d919e[_0x5343('0x13')](0x1f4,_0x5343('0x34')+_0x32b3ec));}if(!_[_0x5343('0x35')](_0x32b3ec,_0x1fe925[_0x5343('0x28')][_0x5343('0x33')])){return _0x52c521(_0x4d919e[_0x5343('0x13')](0x1f4,_0x5343('0x36')+_0x32b3ec));}var _0xd4e75={};_0xd4e75[_0x1fe925[_0x5343('0x28')][_0x5343('0x33')]]=_0x1fe925[_0x5343('0x28')][_0x5343('0x31')];return db['MailAccount'][_0x5343('0x23')]({'where':{'id':_0x1fe925[_0x5343('0x37')]['id']},'include':[{'model':db['CmList'],'as':_0x5343('0x38'),'include':[{'model':db[_0x5343('0x2c')],'as':_0x5343('0x39'),'where':_0xd4e75,'limit':0x1,'order':[[_0x5343('0x2e'),_0x5343('0x3a')]]}]},{'model':db['MailApplication'],'as':_0x5343('0x3b')},{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x5343('0x3c')],'as':_0x5343('0x3c')}]}]})[_0x5343('0xf')](function(_0x1cd4ed){if(_0x1cd4ed&&_0x1cd4ed['List']){var _0x15c77b=_0x1cd4ed[_0x5343('0x3d')]({'plain':!![]});_0x28c274[_0x5343('0x37')]=_[_0x5343('0x3e')](_0x15c77b,[_0x5343('0x3b'),_0x5343('0x38')]);_0x28c274[_0x5343('0x37')][_0x5343('0x25')]=_0x1cd4ed[_0x5343('0x26')]();_0x28c274[_0x5343('0x3f')]=_0x15c77b['Applications'];_0x28c274[_0x5343('0x40')]=_0x15c77b[_0x5343('0x38')];_0x28c274[_0x5343('0x3f')]=_[_0x5343('0x41')](_0x28c274[_0x5343('0x3f')],[_0x5343('0x42')],[_0x5343('0x43')]);if(_0x28c274[_0x5343('0x37')]&&_0x28c274[_0x5343('0x37')][_0x5343('0x44')]){_0x28c274['applications'][_0x5343('0x45')]({'id':0x0,'priority':_0x28c274['applications']['length']+0x1,'app':_0x5343('0x46'),'appdata':_0x5343('0x44'),'interval':_0x5343('0x47')});}if(_0x28c274[_0x5343('0x37')][_0x5343('0x3b')]){delete _0x28c274['account'][_0x5343('0x3b')];}if(_0x28c274['account'][_0x5343('0x38')]){delete _0x28c274['account'][_0x5343('0x38')];}if(_0x15c77b['List'][_0x5343('0x39')][_0x5343('0x48')]){return _0x15c77b[_0x5343('0x38')][_0x5343('0x39')][0x0];}var _0x23c4e5=_['defaults'](_0x1fe925[_0x5343('0x28')],{'firstName':_0x1fe925[_0x5343('0x28')][_0x5343('0x31')],'ListId':_0x15c77b[_0x5343('0x2f')]});_0x23c4e5[_0x1fe925[_0x5343('0x28')]['mapKey']]=_0x1fe925['body'][_0x5343('0x31')];return db['CmContact'][_0x5343('0x49')](_0x23c4e5);}else{throw new Error(_0x5343('0x4a'));}})[_0x5343('0xf')](function(_0x21706d){_0x28c274[_0x5343('0x4b')]=_0x21706d;if(_0x21706d){if(!_0x1fe925[_0x5343('0x28')][_0x5343('0x14')]['messageId']){_0x1fe925[_0x5343('0x28')][_0x5343('0x14')]['messageId']=rs[_0x5343('0x4c')]()+'\x20'+_0x1fe925['body'][_0x5343('0x14')]['from'];}var _0xe73b0={'ContactId':_0x21706d['id'],'MailAccountId':_0x1fe925['account']['id'],'inReplyTo':_0x1fe925[_0x5343('0x28')][_0x5343('0x14')][_0x5343('0x4d')],'to':_0x1fe925[_0x5343('0x28')][_0x5343('0x14')][_0x5343('0x31')],'cc':_0x1fe925['body'][_0x5343('0x14')]['cc'],'subject':_0x1fe925[_0x5343('0x28')][_0x5343('0x14')][_0x5343('0x4e')],'attach':_0x1fe925['body'][_0x5343('0x14')][_0x5343('0x4f')],'lastMsgAt':moment()['format'](_0x5343('0x50')),'lastMsgDirection':'in'};return db[_0x5343('0x51')][_0x5343('0x23')]({'where':{'closed':![],'MailAccountId':_0x1fe925['account']['id']},'include':[{'model':db[_0x5343('0x52')],'as':_0x5343('0x53'),'attributes':[_0x5343('0x4d')],'where':{'messageId':_0x1fe925[_0x5343('0x28')]['message'][_0x5343('0x54')]}}]})[_0x5343('0xf')](function(_0xb461d0){if(_0xb461d0){return[_0xb461d0,![]];}return db[_0x5343('0x51')][_0x5343('0x49')](_0xe73b0)['then'](function(_0x52c679){return[_0x52c679,!![]];});});}else{throw new Error(_0x5343('0x55'));}})['spread'](function(_0x4c3c93,_0x5d5cb5){if(_0x4c3c93){_0x16c880=_0x5d5cb5;if(!_0x5d5cb5){return _0x4c3c93[_0x5343('0x56')]({'inReplyTo':_0x1fe925[_0x5343('0x28')]['message']['messageId'],'to':_0x1fe925['body'][_0x5343('0x14')][_0x5343('0x31')],'cc':_0x1fe925[_0x5343('0x28')][_0x5343('0x14')]['cc'],'subject':_0x1fe925[_0x5343('0x28')][_0x5343('0x14')][_0x5343('0x4e')],'attach':_0x4c3c93[_0x5343('0x4f')]?_0x4c3c93['attach']:_0x1fe925['body']['message'][_0x5343('0x4f')],'substatus':null,'substatusAt':moment()[_0x5343('0x57')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x5343('0x57')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x4c3c93;}}})[_0x5343('0xf')](function(_0x1046e5){_0x28c274[_0x5343('0x58')]=_0x1046e5[_0x5343('0x3d')]({'plain':!![]});_0x28c274[_0x5343('0x58')]['created']=_0x16c880;return db['MailMessage']['create']({'body':_0x1fe925[_0x5343('0x28')][_0x5343('0x28')],'MailAccountId':_0x1fe925[_0x5343('0x37')]['id'],'MailInteractionId':_0x1046e5['id'],'direction':'in','ContactId':_0x28c274[_0x5343('0x4b')]['id'],'messageId':_0x1fe925[_0x5343('0x28')]['message'][_0x5343('0x4d')],'from':_0x1fe925['body']['message'][_0x5343('0x31')],'to':_0x1fe925[_0x5343('0x28')][_0x5343('0x14')]['to'],'cc':_0x1fe925[_0x5343('0x28')][_0x5343('0x14')]['cc'],'subject':_0x1fe925[_0x5343('0x28')][_0x5343('0x14')][_0x5343('0x4e')],'attach':_0x1fe925['body'][_0x5343('0x14')]['attach'],'Attachments':_0x1fe925[_0x5343('0x28')][_0x5343('0x14')][_0x5343('0x59')],'originTo':_0x1fe925[_0x5343('0x28')][_0x5343('0x14')][_0x5343('0x5a')],'originCc':_0x1fe925['body']['message'][_0x5343('0x5b')],'bcc':_0x1fe925['body']['message']['bcc'],'ChatWebsiteId':_0x1fe925['body'][_0x5343('0x14')][_0x5343('0x5c')]||null,'originChannel':_0x1fe925[_0x5343('0x28')][_0x5343('0x14')][_0x5343('0x5d')]||_0x5343('0x5e'),'ChatOfflineMessageId':_0x1fe925[_0x5343('0x28')][_0x5343('0x14')][_0x5343('0x5f')]||null},{'include':[{'model':db[_0x5343('0x60')],'as':_0x5343('0x61')}]});})['then'](function(_0x1a2904){_0x28c274[_0x5343('0x14')]=_0x1a2904;if(!_0x28c274[_0x5343('0x58')]['UserId']){return;}return db[_0x5343('0x62')]['find']({'attributes':['id',_0x5343('0x63')],'where':{'id':_0x28c274[_0x5343('0x58')]['UserId']}});})['then'](function(_0x1fa24e){if(_0x1fa24e){_0x28c274['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1fa24e[_0x5343('0x63')]+','+(_0x28c274[_0x5343('0x37')][_0x5343('0x64')]||0xa),'interval':_0x5343('0x47')});}if(!_0x28c274[_0x5343('0x58')]['queueId']){return;}return db['MailQueue'][_0x5343('0x23')]({'attributes':['id',_0x5343('0x63')],'where':{'id':_0x28c274[_0x5343('0x58')][_0x5343('0x65')]}});})[_0x5343('0xf')](function(_0x2e7e18){if(_0x2e7e18){_0x28c274[_0x5343('0x3f')][_0x5343('0x66')]({'id':0x0,'priority':0x1,'app':_0x5343('0x67'),'appdata':_0x2e7e18[_0x5343('0x63')]+','+(_0x28c274['account'][_0x5343('0x68')]||0x12c),'interval':_0x5343('0x47')});}return respondWithRpcPromise(_0x5343('0x69'),_0x5343('0x6a'),_0x28c274);})[_0x5343('0xf')](function(_0x268de3){_0xb93d9(_0x268de3);})[_0x5343('0x16')](function(_0x2e6224){_0x52c521(_0x4d919e[_0x5343('0x13')](0x1f4,_0x2e6224[_0x5343('0x14')]));});});}; \ No newline at end of file +var _0x24ca=['YYYY-MM-DD\x20HH:mm:ss','interaction','created','contact','subject','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','queueId','MailQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','lodash','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','localhost','socket.io-emitter','redis','./mailAccount.socket','register','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','limit','include','map','attributes','model','then','stringify','find','smtp','setDataValue','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','createdAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact','Contacts','updatedAt','DESC','Applications','Smtp','CloudProvider','get','omit','applications','list','orderBy','push','length','*,*,*,*','ListId','messageId','generate','format','MailInteraction','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','spread','update','attach'];(function(_0x18b191,_0x4e0684){var _0x43e146=function(_0x4b464e){while(--_0x4b464e){_0x18b191['push'](_0x18b191['shift']());}};_0x43e146(++_0x4e0684);}(_0x24ca,0x8c));var _0xa24c=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0x24ca[_0x10291b];return _0x1d5fbe;};'use strict';var _=require(_0xa24c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa24c('0x1'));var Redis=require('ioredis');var db=require(_0xa24c('0x2'))['db'];var logger=require(_0xa24c('0x3'))(_0xa24c('0x4'));var config=require('../../config/environment');var jayson=require(_0xa24c('0x5'));var client=jayson[_0xa24c('0x6')][_0xa24c('0x7')]({'port':0x232c});config['redis']=_['defaults'](config['redis'],{'host':_0xa24c('0x8'),'port':0x18eb});var socket=require(_0xa24c('0x9'))(new Redis(config[_0xa24c('0xa')]));require(_0xa24c('0xb'))[_0xa24c('0xc')](socket);function respondWithRpcPromise(_0x87c265,_0x5bedc6,_0x101ca7){return new BPromise(function(_0x413b3d,_0x355882){return client['request'](_0x87c265,_0x101ca7)['then'](function(_0x1331f4){logger[_0xa24c('0xd')](_0xa24c('0xe'),_0x5bedc6,_0xa24c('0xf'));logger[_0xa24c('0x10')](_0xa24c('0x11'),_0x5bedc6,'request\x20sent',JSON['stringify'](_0x1331f4));if(_0x1331f4['error']){if(_0x1331f4[_0xa24c('0x12')][_0xa24c('0x13')]===0x1f4){logger[_0xa24c('0x12')](_0xa24c('0xe'),_0x5bedc6,_0x1331f4[_0xa24c('0x12')]['message']);return _0x355882(_0x1331f4[_0xa24c('0x12')]['message']);}logger['error']('MailAccount,\x20%s,\x20%s',_0x5bedc6,_0x1331f4[_0xa24c('0x12')][_0xa24c('0x14')]);return _0x413b3d(_0x1331f4[_0xa24c('0x12')][_0xa24c('0x14')]);}else{logger[_0xa24c('0xd')](_0xa24c('0xe'),_0x5bedc6,_0xa24c('0xf'));_0x413b3d(_0x1331f4[_0xa24c('0x15')][_0xa24c('0x14')]);}})[_0xa24c('0x16')](function(_0x1970fc){logger[_0xa24c('0x12')](_0xa24c('0xe'),_0x5bedc6,_0x1970fc);_0x355882(_0x1970fc);});});}exports[_0xa24c('0x17')]=function(_0x5276b6){var _0x167a76=this;return new Promise(function(_0x48fb65,_0x98802d){return db[_0xa24c('0x18')][_0xa24c('0x19')]({'raw':_0x5276b6[_0xa24c('0x1a')]?_0x5276b6[_0xa24c('0x1a')][_0xa24c('0x1b')]===undefined?!![]:![]:!![],'where':_0x5276b6[_0xa24c('0x1a')]?_0x5276b6[_0xa24c('0x1a')][_0xa24c('0x1c')]||null:null,'attributes':_0x5276b6[_0xa24c('0x1a')]?_0x5276b6[_0xa24c('0x1a')]['attributes']||null:null,'limit':_0x5276b6['options']?_0x5276b6[_0xa24c('0x1a')][_0xa24c('0x1d')]||null:null,'include':_0x5276b6[_0xa24c('0x1a')]?_0x5276b6[_0xa24c('0x1a')][_0xa24c('0x1e')]?_[_0xa24c('0x1f')](_0x5276b6[_0xa24c('0x1a')][_0xa24c('0x1e')],function(_0x304d6c){return{'model':db[_0x304d6c['model']],'as':_0x304d6c['as'],'attributes':_0x304d6c[_0xa24c('0x20')],'include':_0x304d6c['include']?_[_0xa24c('0x1f')](_0x304d6c[_0xa24c('0x1e')],function(_0x471421){return{'model':db[_0x471421[_0xa24c('0x21')]],'as':_0x471421['as'],'attributes':_0x471421['attributes'],'include':_0x471421['include']?_['map'](_0x471421['include'],function(_0x23fb79){return{'model':db[_0x23fb79[_0xa24c('0x21')]],'as':_0x23fb79['as'],'attributes':_0x23fb79[_0xa24c('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa24c('0x22')](function(_0x37cbd3){logger['info']('GetMailAccount',_0x5276b6);logger[_0xa24c('0x10')](_0xa24c('0x17'),_0x5276b6,JSON[_0xa24c('0x23')](_0x37cbd3));_0x48fb65(_0x37cbd3);})[_0xa24c('0x16')](function(_0x4566dc){logger[_0xa24c('0x12')](_0xa24c('0x17'),_0x4566dc[_0xa24c('0x14')],_0x5276b6);_0x98802d(_0x167a76[_0xa24c('0x12')](0x1f4,_0x4566dc[_0xa24c('0x14')]));});});};exports['ShowMailAccount']=function(_0x2dd4f1){var _0x3b94f0=this;return new Promise(function(_0x56b717,_0x3c9649){return db[_0xa24c('0x18')][_0xa24c('0x24')]({'raw':_0x2dd4f1[_0xa24c('0x1a')]?_0x2dd4f1[_0xa24c('0x1a')][_0xa24c('0x1b')]===undefined?!![]:![]:!![],'where':_0x2dd4f1[_0xa24c('0x1a')]?_0x2dd4f1[_0xa24c('0x1a')][_0xa24c('0x1c')]||null:null,'attributes':_0x2dd4f1[_0xa24c('0x1a')]?_0x2dd4f1['options']['attributes']||null:null,'include':_0x2dd4f1['options']?_0x2dd4f1[_0xa24c('0x1a')]['include']?_[_0xa24c('0x1f')](_0x2dd4f1[_0xa24c('0x1a')][_0xa24c('0x1e')],function(_0x4b8627){return{'model':db[_0x4b8627[_0xa24c('0x21')]],'as':_0x4b8627['as'],'attributes':_0x4b8627[_0xa24c('0x20')],'include':_0x4b8627[_0xa24c('0x1e')]?_['map'](_0x4b8627[_0xa24c('0x1e')],function(_0x16835f){return{'model':db[_0x16835f['model']],'as':_0x16835f['as'],'attributes':_0x16835f[_0xa24c('0x20')],'include':_0x16835f[_0xa24c('0x1e')]?_[_0xa24c('0x1f')](_0x16835f['include'],function(_0x45c429){return{'model':db[_0x45c429[_0xa24c('0x21')]],'as':_0x45c429['as'],'attributes':_0x45c429[_0xa24c('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa24c('0x22')](function(_0x12e184){if(_0x2dd4f1['options'][_0xa24c('0x25')]===!![])_0x12e184[_0xa24c('0x26')]('smtpOptions',_0x12e184[_0xa24c('0x27')]());logger[_0xa24c('0xd')](_0xa24c('0x28'),_0x2dd4f1);logger['debug']('ShowMailAccount',_0x2dd4f1,JSON[_0xa24c('0x23')](_0x12e184));_0x56b717(_0x12e184);})[_0xa24c('0x16')](function(_0x219b2c){logger[_0xa24c('0x12')](_0xa24c('0x28'),_0x219b2c[_0xa24c('0x14')],_0x2dd4f1);_0x3c9649(_0x3b94f0['error'](0x1f4,_0x219b2c[_0xa24c('0x14')]));});});};exports[_0xa24c('0x29')]=function(_0x21e804){var _0x137a1d=this;return new Promise(function(_0x5f3cd4,_0x34026c){var _0x190dfc={'body':_0x21e804[_0xa24c('0x2a')],'channel':_0xa24c('0x2b')};var _0x103b50=_[_0xa24c('0x2c')](_[_0xa24c('0x2d')](db['CmContact']['rawAttributes']),[_0xa24c('0x2e'),'updatedAt',_0xa24c('0x2f'),'ListId']);var _0x32e151=![];if(_0x21e804[_0xa24c('0x2a')]['id']){delete _0x21e804[_0xa24c('0x2a')]['id'];}if(_[_0xa24c('0x30')](_0x21e804[_0xa24c('0x2a')][_0xa24c('0x31')])){return _0x34026c(_0x137a1d[_0xa24c('0x12')](0x1f4,_0xa24c('0x32')));}if(_[_0xa24c('0x30')](_0x21e804[_0xa24c('0x2a')][_0xa24c('0x2a')])||_0x21e804[_0xa24c('0x2a')][_0xa24c('0x2a')]===''){return _0x34026c(_0x137a1d[_0xa24c('0x12')](0x1f4,_0xa24c('0x33')));}if(_[_0xa24c('0x30')](_0x21e804['body'][_0xa24c('0x34')])){return _0x34026c(_0x137a1d[_0xa24c('0x12')](0x1f4,_0xa24c('0x35')+_0x103b50));}if(!_['includes'](_0x103b50,_0x21e804[_0xa24c('0x2a')][_0xa24c('0x34')])){return _0x34026c(_0x137a1d[_0xa24c('0x12')](0x1f4,_0xa24c('0x36')+_0x103b50));}var _0x4d8b8e={};_0x4d8b8e[_0x21e804[_0xa24c('0x2a')][_0xa24c('0x34')]]=_0x21e804[_0xa24c('0x2a')][_0xa24c('0x31')];return db[_0xa24c('0x18')][_0xa24c('0x24')]({'where':{'id':_0x21e804[_0xa24c('0x37')]['id']},'include':[{'model':db[_0xa24c('0x38')],'as':_0xa24c('0x39'),'include':[{'model':db[_0xa24c('0x3a')],'as':_0xa24c('0x3b'),'where':_0x4d8b8e,'limit':0x1,'order':[[_0xa24c('0x3c'),_0xa24c('0x3d')]]}]},{'model':db['MailApplication'],'as':_0xa24c('0x3e')},{'model':db['MailServerOut'],'as':_0xa24c('0x3f'),'include':[{'model':db[_0xa24c('0x40')],'as':_0xa24c('0x40')}]}]})[_0xa24c('0x22')](function(_0xd4761e){if(_0xd4761e&&_0xd4761e[_0xa24c('0x39')]){var _0x338877=_0xd4761e[_0xa24c('0x41')]({'plain':!![]});_0x190dfc[_0xa24c('0x37')]=_[_0xa24c('0x42')](_0x338877,[_0xa24c('0x3e'),_0xa24c('0x39')]);_0x190dfc[_0xa24c('0x37')]['smtpOptions']=_0xd4761e[_0xa24c('0x27')]();_0x190dfc[_0xa24c('0x43')]=_0x338877[_0xa24c('0x3e')];_0x190dfc[_0xa24c('0x44')]=_0x338877['List'];_0x190dfc[_0xa24c('0x43')]=_[_0xa24c('0x45')](_0x190dfc[_0xa24c('0x43')],['priority'],['asc']);if(_0x190dfc[_0xa24c('0x37')]&&_0x190dfc[_0xa24c('0x37')]['autoclose']){_0x190dfc[_0xa24c('0x43')][_0xa24c('0x46')]({'id':0x0,'priority':_0x190dfc['applications'][_0xa24c('0x47')]+0x1,'app':'close','appdata':'autoclose','interval':_0xa24c('0x48')});}if(_0x190dfc['account'][_0xa24c('0x3e')]){delete _0x190dfc[_0xa24c('0x37')]['Applications'];}if(_0x190dfc[_0xa24c('0x37')][_0xa24c('0x39')]){delete _0x190dfc[_0xa24c('0x37')][_0xa24c('0x39')];}if(_0x338877['List'][_0xa24c('0x3b')]['length']){return _0x338877[_0xa24c('0x39')][_0xa24c('0x3b')][0x0];}var _0x53e305=_['defaults'](_0x21e804[_0xa24c('0x2a')],{'firstName':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x31')],'ListId':_0x338877[_0xa24c('0x49')]});_0x53e305[_0x21e804[_0xa24c('0x2a')]['mapKey']]=_0x21e804[_0xa24c('0x2a')]['from'];return db[_0xa24c('0x3a')]['create'](_0x53e305);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x3fc3d9){_0x190dfc['contact']=_0x3fc3d9;if(_0x3fc3d9){if(!_0x21e804['body'][_0xa24c('0x14')]['messageId']){_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x4a')]=rs[_0xa24c('0x4b')]()+'\x20'+_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x31')];}var _0x366505={'ContactId':_0x3fc3d9['id'],'MailAccountId':_0x21e804['account']['id'],'inReplyTo':_0x21e804['body'][_0xa24c('0x14')][_0xa24c('0x4a')],'to':_0x21e804['body'][_0xa24c('0x14')][_0xa24c('0x31')],'cc':_0x21e804['body'][_0xa24c('0x14')]['cc'],'subject':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')]['subject'],'attach':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')]['attach'],'lastMsgAt':moment()[_0xa24c('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0xa24c('0x4d')][_0xa24c('0x24')]({'where':{'closed':![],'MailAccountId':_0x21e804[_0xa24c('0x37')]['id']},'include':[{'model':db[_0xa24c('0x4e')],'as':_0xa24c('0x4f'),'attributes':[_0xa24c('0x4a')],'where':{'messageId':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x50')]}}]})[_0xa24c('0x22')](function(_0x37a9c8){if(_0x37a9c8){return[_0x37a9c8,![]];}return db[_0xa24c('0x4d')][_0xa24c('0x51')](_0x366505)[_0xa24c('0x22')](function(_0xe32b69){return[_0xe32b69,!![]];});});}else{throw new Error(_0xa24c('0x52'));}})[_0xa24c('0x53')](function(_0x46aded,_0x5b5826){if(_0x46aded){_0x32e151=_0x5b5826;if(!_0x5b5826){return _0x46aded[_0xa24c('0x54')]({'inReplyTo':_0x21e804['body'][_0xa24c('0x14')][_0xa24c('0x4a')],'to':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')]['from'],'cc':_0x21e804['body'][_0xa24c('0x14')]['cc'],'subject':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')]['subject'],'attach':_0x46aded[_0xa24c('0x55')]?_0x46aded[_0xa24c('0x55')]:_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x55')],'substatus':null,'substatusAt':moment()[_0xa24c('0x4c')](_0xa24c('0x56')),'lastMsgAt':moment()[_0xa24c('0x4c')](_0xa24c('0x56')),'lastMsgDirection':'in'});}else{return _0x46aded;}}})[_0xa24c('0x22')](function(_0x2cb64e){_0x190dfc[_0xa24c('0x57')]=_0x2cb64e[_0xa24c('0x41')]({'plain':!![]});_0x190dfc[_0xa24c('0x57')][_0xa24c('0x58')]=_0x32e151;return db[_0xa24c('0x4e')][_0xa24c('0x51')]({'body':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x2a')],'MailAccountId':_0x21e804[_0xa24c('0x37')]['id'],'MailInteractionId':_0x2cb64e['id'],'direction':'in','ContactId':_0x190dfc[_0xa24c('0x59')]['id'],'messageId':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x4a')],'from':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x31')],'to':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')]['to'],'cc':_0x21e804[_0xa24c('0x2a')]['message']['cc'],'subject':_0x21e804[_0xa24c('0x2a')]['message'][_0xa24c('0x5a')],'attach':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x55')],'Attachments':_0x21e804['body'][_0xa24c('0x14')][_0xa24c('0x5b')],'originTo':_0x21e804[_0xa24c('0x2a')]['message'][_0xa24c('0x5c')],'originCc':_0x21e804['body'][_0xa24c('0x14')][_0xa24c('0x5d')],'bcc':_0x21e804[_0xa24c('0x2a')]['message'][_0xa24c('0x5e')],'ChatWebsiteId':_0x21e804[_0xa24c('0x2a')]['message'][_0xa24c('0x5f')]||null,'originChannel':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x60')]||_0xa24c('0x61'),'ChatOfflineMessageId':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x62')]||null},{'include':[{'model':db[_0xa24c('0x63')],'as':_0xa24c('0x64')}]});})[_0xa24c('0x22')](function(_0x259684){_0x190dfc[_0xa24c('0x14')]=_0x259684;if(!_0x190dfc[_0xa24c('0x57')][_0xa24c('0x65')]){return;}return db[_0xa24c('0x66')]['find']({'attributes':['id',_0xa24c('0x67')],'where':{'id':_0x190dfc[_0xa24c('0x57')][_0xa24c('0x65')]}});})[_0xa24c('0x22')](function(_0xdf074f){if(_0xdf074f){_0x190dfc['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xa24c('0x68'),'appdata':_0xdf074f[_0xa24c('0x67')]+','+(_0x190dfc[_0xa24c('0x37')][_0xa24c('0x69')]||0xa),'interval':_0xa24c('0x48')});}if(!_0x190dfc['interaction'][_0xa24c('0x6a')]){return;}return db[_0xa24c('0x6b')][_0xa24c('0x24')]({'attributes':['id','name'],'where':{'id':_0x190dfc[_0xa24c('0x57')]['queueId']}});})['then'](function(_0x5d507a){if(_0x5d507a){_0x190dfc[_0xa24c('0x43')][_0xa24c('0x6c')]({'id':0x0,'priority':0x1,'app':_0xa24c('0x6d'),'appdata':_0x5d507a[_0xa24c('0x67')]+','+(_0x190dfc['account'][_0xa24c('0x6e')]||0x12c),'interval':_0xa24c('0x48')});}return respondWithRpcPromise(_0xa24c('0x6f'),_0xa24c('0x70'),_0x190dfc);})[_0xa24c('0x22')](function(_0x4baa40){_0x5f3cd4(_0x4baa40);})[_0xa24c('0x16')](function(_0x157552){_0x34026c(_0x137a1d['error'](0x1f4,_0x157552['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 4a7630a..059bf3b 100644 --- a/server/api/mailAccount/mailAccount.socket.js +++ b/server/api/mailAccount/mailAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7ab=['remove','update','removeListener','length','mailAccount:','./mailAccount.events','save'];(function(_0x2c146b,_0x39eee8){var _0x5e808c=function(_0x5a702d){while(--_0x5a702d){_0x2c146b['push'](_0x2c146b['shift']());}};_0x5e808c(++_0x39eee8);}(_0xd7ab,0x14e));var _0xbd7a=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xd7ab[_0x3947c9];return _0x2e7871;};'use strict';var MailAccountEvents=require(_0xbd7a('0x0'));var events=[_0xbd7a('0x1'),_0xbd7a('0x2'),_0xbd7a('0x3')];function createListener(_0x687a21,_0x5d2c5a){return function(_0xa417ef){_0x5d2c5a['emit'](_0x687a21,_0xa417ef);};}function removeListener(_0x5104f2,_0x5a7dc8){return function(){MailAccountEvents[_0xbd7a('0x4')](_0x5104f2,_0x5a7dc8);};}exports['register']=function(_0x480cb0){for(var _0x458cda=0x0,_0x331bcb=events[_0xbd7a('0x5')];_0x458cda<_0x331bcb;_0x458cda++){var _0x5ccda4=events[_0x458cda];var _0x3eb09d=createListener(_0xbd7a('0x6')+_0x5ccda4,_0x480cb0);MailAccountEvents['on'](_0x5ccda4,_0x3eb09d);}}; \ No newline at end of file +var _0x291f=['remove','emit','register','length','mailAccount:','./mailAccount.events','save'];(function(_0x2e6dbf,_0x57dd06){var _0x2680e5=function(_0x4018f4){while(--_0x4018f4){_0x2e6dbf['push'](_0x2e6dbf['shift']());}};_0x2680e5(++_0x57dd06);}(_0x291f,0xc9));var _0xf291=function(_0x1a849e,_0x558a1a){_0x1a849e=_0x1a849e-0x0;var _0x18e1bd=_0x291f[_0x1a849e];return _0x18e1bd;};'use strict';var MailAccountEvents=require(_0xf291('0x0'));var events=[_0xf291('0x1'),_0xf291('0x2'),'update'];function createListener(_0xc257f5,_0x1fd9a5){return function(_0x39bdb1){_0x1fd9a5[_0xf291('0x3')](_0xc257f5,_0x39bdb1);};}function removeListener(_0x2119c2,_0x2a120c){return function(){MailAccountEvents['removeListener'](_0x2119c2,_0x2a120c);};}exports[_0xf291('0x4')]=function(_0x1b6423){for(var _0x59b180=0x0,_0x48ab4e=events[_0xf291('0x5')];_0x59b180<_0x48ab4e;_0x59b180++){var _0x51fcf6=events[_0x59b180];var _0x22cfa4=createListener(_0xf291('0x6')+_0x51fcf6,_0x1b6423);MailAccountEvents['on'](_0x51fcf6,_0x22cfa4);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 75b285e..4a79c2e 100644 --- a/server/api/mailApplication/index.js +++ b/server/api/mailApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb01=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update'];(function(_0x2933db,_0x518b6f){var _0x23e6b4=function(_0x124372){while(--_0x124372){_0x2933db['push'](_0x2933db['shift']());}};_0x23e6b4(++_0x518b6f);}(_0xcb01,0x16b));var _0x1cb0=function(_0x298152,_0x2bab07){_0x298152=_0x298152-0x0;var _0x58117d=_0xcb01[_0x298152];return _0x58117d;};'use strict';var multer=require(_0x1cb0('0x0'));var util=require(_0x1cb0('0x1'));var path=require(_0x1cb0('0x2'));var timeout=require(_0x1cb0('0x3'));var express=require(_0x1cb0('0x4'));var router=express[_0x1cb0('0x5')]();var fs_extra=require(_0x1cb0('0x6'));var auth=require(_0x1cb0('0x7'));var interaction=require(_0x1cb0('0x8'));var config=require(_0x1cb0('0x9'));var controller=require(_0x1cb0('0xa'));router[_0x1cb0('0xb')](_0x1cb0('0xc'),auth[_0x1cb0('0xd')](),controller[_0x1cb0('0xe')]);router[_0x1cb0('0xf')](_0x1cb0('0xc'),auth[_0x1cb0('0xd')](),controller[_0x1cb0('0x10')]);router[_0x1cb0('0x11')](_0x1cb0('0xc'),auth[_0x1cb0('0xd')](),controller[_0x1cb0('0x12')]);module[_0x1cb0('0x13')]=router; \ No newline at end of file +var _0xb254=['put','update','delete','isAuthenticated','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','show'];(function(_0x374785,_0x4f71b8){var _0x572c40=function(_0x1cf7b0){while(--_0x1cf7b0){_0x374785['push'](_0x374785['shift']());}};_0x572c40(++_0x4f71b8);}(_0xb254,0x1b5));var _0x4b25=function(_0x192b63,_0x24c007){_0x192b63=_0x192b63-0x0;var _0x224725=_0xb254[_0x192b63];return _0x224725;};'use strict';var multer=require(_0x4b25('0x0'));var util=require(_0x4b25('0x1'));var path=require(_0x4b25('0x2'));var timeout=require('connect-timeout');var express=require(_0x4b25('0x3'));var router=express[_0x4b25('0x4')]();var fs_extra=require(_0x4b25('0x5'));var auth=require(_0x4b25('0x6'));var interaction=require(_0x4b25('0x7'));var config=require(_0x4b25('0x8'));var controller=require(_0x4b25('0x9'));router[_0x4b25('0xa')](_0x4b25('0xb'),auth['isAuthenticated'](),controller[_0x4b25('0xc')]);router[_0x4b25('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x4b25('0xe')]);router[_0x4b25('0xf')]('/:id',auth[_0x4b25('0x10')](),controller[_0x4b25('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 42aaff5..70692bf 100644 --- a/server/api/mailApplication/mailApplication.attributes.js +++ b/server/api/mailApplication/mailApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f27=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x403d07,_0x13d68b){var _0x2d8c4c=function(_0xeb190b){while(--_0xeb190b){_0x403d07['push'](_0x403d07['shift']());}};_0x2d8c4c(++_0x13d68b);}(_0x6f27,0x17c));var _0x76f2=function(_0x498b9e,_0x46ae26){_0x498b9e=_0x498b9e-0x0;var _0x29dd57=_0x6f27[_0x498b9e];return _0x29dd57;};'use strict';var Sequelize=require('sequelize');module[_0x76f2('0x0')]={'priority':{'type':Sequelize[_0x76f2('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x76f2('0x2')],'allowNull':![],'defaultValue':_0x76f2('0x3')},'appdata':{'type':Sequelize[_0x76f2('0x4')]()},'description':{'type':Sequelize[_0x76f2('0x2')]},'interval':{'type':Sequelize[_0x76f2('0x2')],'defaultValue':_0x76f2('0x5')}}; \ No newline at end of file +var _0xd451=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x45ecd3,_0x1a803f){var _0x2d2b7b=function(_0x15bf08){while(--_0x15bf08){_0x45ecd3['push'](_0x45ecd3['shift']());}};_0x2d2b7b(++_0x1a803f);}(_0xd451,0xa6));var _0x1d45=function(_0x2a6264,_0x3a7065){_0x2a6264=_0x2a6264-0x0;var _0x18948e=_0xd451[_0x2a6264];return _0x18948e;};'use strict';var Sequelize=require(_0x1d45('0x0'));module[_0x1d45('0x1')]={'priority':{'type':Sequelize[_0x1d45('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1d45('0x3')],'allowNull':![],'defaultValue':_0x1d45('0x4')},'appdata':{'type':Sequelize[_0x1d45('0x5')]()},'description':{'type':Sequelize[_0x1d45('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x1d45('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index b5b1757..d5a420e 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x1a87b3,_0x45ba68){_0x1a87b3=_0x1a87b3-0x0;var _0x37e84d=_0xaa88[_0x1a87b3];return _0x37e84d;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file +var _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x2fccfb,_0x1aceca){var _0x543c8f=function(_0x5ebb3e){while(--_0x5ebb3e){_0x2fccfb['push'](_0x2fccfb['shift']());}};_0x543c8f(++_0x1aceca);}(_0xac4a,0x13f));var _0xaac4=function(_0x29156a,_0x4f04c4){_0x29156a=_0x29156a-0x0;var _0x53ad8c=_0xac4a[_0x29156a];return _0x53ad8c;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 2e631b7..4a29dec 100644 --- a/server/api/mailApplication/mailApplication.model.js +++ b/server/api/mailApplication/mailApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5f7=['utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./mailApplication.attributes','mail_applications','utf8mb4'];(function(_0x25de3b,_0x140036){var _0x3ec499=function(_0x3d93f5){while(--_0x3d93f5){_0x25de3b['push'](_0x25de3b['shift']());}};_0x3ec499(++_0x140036);}(_0xa5f7,0x79));var _0x7a5f=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0xa5f7[_0x1a8f86];return _0x20d876;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7a5f('0x0'))(_0x7a5f('0x1'));var moment=require(_0x7a5f('0x2'));var BPromise=require(_0x7a5f('0x3'));var rp=require(_0x7a5f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7a5f('0x5'));var attributes=require(_0x7a5f('0x6'));module['exports']=function(_0x252b75,_0x399da4){return _0x252b75['define']('MailApplication',attributes,{'tableName':_0x7a5f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7a5f('0x8'),'collate':_0x7a5f('0x9')});}; \ No newline at end of file +var _0x637c=['define','mail_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./mailApplication.attributes','exports'];(function(_0x5e1a64,_0x4466c3){var _0x1ab18b=function(_0x29c88d){while(--_0x29c88d){_0x5e1a64['push'](_0x5e1a64['shift']());}};_0x1ab18b(++_0x4466c3);}(_0x637c,0xed));var _0xc637=function(_0xff15d9,_0x118aa5){_0xff15d9=_0xff15d9-0x0;var _0xda584b=_0x637c[_0xff15d9];return _0xda584b;};'use strict';var _=require(_0xc637('0x0'));var util=require(_0xc637('0x1'));var logger=require(_0xc637('0x2'))(_0xc637('0x3'));var moment=require(_0xc637('0x4'));var BPromise=require('bluebird');var rp=require(_0xc637('0x5'));var fs=require('fs');var path=require(_0xc637('0x6'));var rimraf=require('rimraf');var config=require(_0xc637('0x7'));var attributes=require(_0xc637('0x8'));module[_0xc637('0x9')]=function(_0x288e3c,_0x293ef4){return _0x288e3c[_0xc637('0xa')]('MailApplication',attributes,{'tableName':_0xc637('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc637('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 8c75216..ca87d28 100644 --- a/server/api/mailApplication/mailApplication.rpc.js +++ b/server/api/mailApplication/mailApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66cd=['stringify','error','code','message','catch','UpdateMailApplication','MailApplication','update','body','raw','options','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1663af,_0x1f74aa){var _0x95c1d=function(_0x352544){while(--_0x352544){_0x1663af['push'](_0x1663af['shift']());}};_0x95c1d(++_0x1f74aa);}(_0x66cd,0x1b2));var _0xd66c=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x66cd[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xd66c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd66c('0x1'));var rs=require(_0xd66c('0x2'));var fs=require('fs');var Redis=require(_0xd66c('0x3'));var db=require(_0xd66c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd66c('0x5'))(_0xd66c('0x6'));var config=require(_0xd66c('0x7'));var jayson=require(_0xd66c('0x8'));var client=jayson[_0xd66c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf95135,_0x1cb0eb,_0x10b229){return new BPromise(function(_0x26f8bd,_0x167f82){return client['request'](_0xf95135,_0x10b229)[_0xd66c('0xa')](function(_0x4603f8){logger[_0xd66c('0xb')](_0xd66c('0xc'),_0x1cb0eb,'request\x20sent');logger[_0xd66c('0xd')](_0xd66c('0xe'),_0x1cb0eb,_0xd66c('0xf'),JSON[_0xd66c('0x10')](_0x4603f8));if(_0x4603f8[_0xd66c('0x11')]){if(_0x4603f8[_0xd66c('0x11')][_0xd66c('0x12')]===0x1f4){logger[_0xd66c('0x11')](_0xd66c('0xc'),_0x1cb0eb,_0x4603f8['error'][_0xd66c('0x13')]);return _0x167f82(_0x4603f8[_0xd66c('0x11')][_0xd66c('0x13')]);}logger[_0xd66c('0x11')](_0xd66c('0xc'),_0x1cb0eb,_0x4603f8[_0xd66c('0x11')][_0xd66c('0x13')]);return _0x26f8bd(_0x4603f8['error'][_0xd66c('0x13')]);}else{logger[_0xd66c('0xb')]('MailApplication,\x20%s,\x20%s',_0x1cb0eb,'request\x20sent');_0x26f8bd(_0x4603f8['result']['message']);}})[_0xd66c('0x14')](function(_0x1e1a32){logger[_0xd66c('0x11')]('MailApplication,\x20%s,\x20%s',_0x1cb0eb,_0x1e1a32);_0x167f82(_0x1e1a32);});});}exports[_0xd66c('0x15')]=function(_0x205c30){var _0x24dfce=this;return new Promise(function(_0x3f0789,_0x4d9291){return db[_0xd66c('0x16')][_0xd66c('0x17')](_0x205c30[_0xd66c('0x18')],{'raw':_0x205c30['options']?_0x205c30['options'][_0xd66c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x205c30[_0xd66c('0x1a')]?_0x205c30[_0xd66c('0x1a')][_0xd66c('0x1b')]||null:null,'attributes':_0x205c30[_0xd66c('0x1a')]?_0x205c30[_0xd66c('0x1a')][_0xd66c('0x1c')]||null:null,'limit':_0x205c30['options']?_0x205c30[_0xd66c('0x1a')][_0xd66c('0x1d')]||null:null})['then'](function(_0x53dbe9){logger[_0xd66c('0xb')](_0xd66c('0x15'),_0x205c30);logger[_0xd66c('0xd')](_0xd66c('0x15'),_0x205c30,JSON['stringify'](_0x53dbe9));_0x3f0789(_0x53dbe9);})[_0xd66c('0x14')](function(_0x2fe300){logger[_0xd66c('0x11')]('UpdateMailApplication',_0x2fe300[_0xd66c('0x13')],_0x205c30);_0x4d9291(_0x24dfce[_0xd66c('0x11')](0x1f4,_0x2fe300['message']));});});}; \ No newline at end of file +var _0xc9cd=['UpdateMailApplication','update','options','raw','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x316904,_0x1e8b77){var _0xfa9a21=function(_0x2b75ae){while(--_0x2b75ae){_0x316904['push'](_0x316904['shift']());}};_0xfa9a21(++_0x1e8b77);}(_0xc9cd,0x17e));var _0xdc9c=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0xc9cd[_0x2afbb0];return _0x411ff2;};'use strict';var _=require(_0xdc9c('0x0'));var util=require(_0xdc9c('0x1'));var moment=require(_0xdc9c('0x2'));var BPromise=require(_0xdc9c('0x3'));var rs=require(_0xdc9c('0x4'));var fs=require('fs');var Redis=require(_0xdc9c('0x5'));var db=require(_0xdc9c('0x6'))['db'];var utils=require(_0xdc9c('0x7'));var logger=require(_0xdc9c('0x8'))(_0xdc9c('0x9'));var config=require('../../config/environment');var jayson=require(_0xdc9c('0xa'));var client=jayson[_0xdc9c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc08169,_0x31ef2b,_0x3a0d52){return new BPromise(function(_0x11abcd,_0x2ff9d8){return client[_0xdc9c('0xc')](_0xc08169,_0x3a0d52)[_0xdc9c('0xd')](function(_0x333551){logger[_0xdc9c('0xe')](_0xdc9c('0xf'),_0x31ef2b,_0xdc9c('0x10'));logger[_0xdc9c('0x11')](_0xdc9c('0x12'),_0x31ef2b,_0xdc9c('0x10'),JSON[_0xdc9c('0x13')](_0x333551));if(_0x333551['error']){if(_0x333551[_0xdc9c('0x14')][_0xdc9c('0x15')]===0x1f4){logger['error'](_0xdc9c('0xf'),_0x31ef2b,_0x333551[_0xdc9c('0x14')]['message']);return _0x2ff9d8(_0x333551[_0xdc9c('0x14')][_0xdc9c('0x16')]);}logger['error'](_0xdc9c('0xf'),_0x31ef2b,_0x333551[_0xdc9c('0x14')][_0xdc9c('0x16')]);return _0x11abcd(_0x333551[_0xdc9c('0x14')][_0xdc9c('0x16')]);}else{logger[_0xdc9c('0xe')](_0xdc9c('0xf'),_0x31ef2b,_0xdc9c('0x10'));_0x11abcd(_0x333551[_0xdc9c('0x17')][_0xdc9c('0x16')]);}})['catch'](function(_0x52fb51){logger[_0xdc9c('0x14')](_0xdc9c('0xf'),_0x31ef2b,_0x52fb51);_0x2ff9d8(_0x52fb51);});});}exports[_0xdc9c('0x18')]=function(_0xd0487){var _0x142ba7=this;return new Promise(function(_0x2b7aac,_0x551f6e){return db['MailApplication'][_0xdc9c('0x19')](_0xd0487['body'],{'raw':_0xd0487[_0xdc9c('0x1a')]?_0xd0487['options'][_0xdc9c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd0487[_0xdc9c('0x1a')]?_0xd0487['options']['where']||null:null,'attributes':_0xd0487['options']?_0xd0487['options']['attributes']||null:null,'limit':_0xd0487['options']?_0xd0487[_0xdc9c('0x1a')][_0xdc9c('0x1c')]||null:null})[_0xdc9c('0xd')](function(_0x2094d6){logger[_0xdc9c('0xe')](_0xdc9c('0x18'),_0xd0487);logger[_0xdc9c('0x11')](_0xdc9c('0x18'),_0xd0487,JSON[_0xdc9c('0x13')](_0x2094d6));_0x2b7aac(_0x2094d6);})['catch'](function(_0x22f1f6){logger[_0xdc9c('0x14')]('UpdateMailApplication',_0x22f1f6[_0xdc9c('0x16')],_0xd0487);_0x551f6e(_0x142ba7['error'](0x1f4,_0x22f1f6[_0xdc9c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index c6e4ee7..e089aab 100644 --- a/server/api/mailInteraction/index.js +++ b/server/api/mailInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83c2=['mailinteraction:addtags','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/:id','show','/:id/messages','/:id/download','download','post','create','tracked','mail'];(function(_0xe5b5f5,_0x18f5ec){var _0xc71b65=function(_0x3fa688){while(--_0x3fa688){_0xe5b5f5['push'](_0xe5b5f5['shift']());}};_0xc71b65(++_0x18f5ec);}(_0x83c2,0x1c3));var _0x283c=function(_0x4ec7f2,_0x3d92d2){_0x4ec7f2=_0x4ec7f2-0x0;var _0x118004=_0x83c2[_0x4ec7f2];return _0x118004;};'use strict';var express=require(_0x283c('0x0'));var router=express[_0x283c('0x1')]();var auth=require(_0x283c('0x2'));var interaction=require(_0x283c('0x3'));var controller=require(_0x283c('0x4'));router[_0x283c('0x5')]('/',auth[_0x283c('0x6')](),controller[_0x283c('0x7')]);router[_0x283c('0x5')]('/describe',auth[_0x283c('0x6')](),controller['describe']);router['get'](_0x283c('0x8'),auth[_0x283c('0x6')](),controller[_0x283c('0x9')]);router['get'](_0x283c('0xa'),auth['isAuthenticated'](),controller['getMessages']);router[_0x283c('0x5')](_0x283c('0xb'),auth[_0x283c('0x6')](),controller[_0x283c('0xc')]);router[_0x283c('0xd')]('/',auth[_0x283c('0x6')](),controller[_0x283c('0xe')]);router[_0x283c('0xd')]('/:id/messages',auth[_0x283c('0x6')](),controller['addMessage']);router['post']('/:id/tags',auth[_0x283c('0x6')](),interaction[_0x283c('0xf')](_0x283c('0x10'),_0x283c('0x11')),controller['addTags']);router['put'](_0x283c('0x8'),auth['isAuthenticated'](),interaction[_0x283c('0xf')]('mail',_0x283c('0x12')),controller[_0x283c('0x13')]);router[_0x283c('0x14')](_0x283c('0x8'),auth[_0x283c('0x6')](),interaction[_0x283c('0xf')]('mail',_0x283c('0x15')),controller[_0x283c('0x16')]);router[_0x283c('0x14')](_0x283c('0x17'),auth[_0x283c('0x6')](),controller[_0x283c('0x18')]);module[_0x283c('0x19')]=router; \ No newline at end of file +var _0x720b=['/:id/download','download','create','addMessage','post','/:id/tags','put','/:id','tracked','mailinteraction:update','update','delete','mail','mailinteraction:destroy','destroy','exports','express','Router','./mailInteraction.controller','get','isAuthenticated','/describe','/:id/messages','getMessages'];(function(_0x50f057,_0xf49e85){var _0x14999d=function(_0x56f90f){while(--_0x56f90f){_0x50f057['push'](_0x50f057['shift']());}};_0x14999d(++_0xf49e85);}(_0x720b,0xb8));var _0xb720=function(_0x238fce,_0x3ed01f){_0x238fce=_0x238fce-0x0;var _0x3a9d50=_0x720b[_0x238fce];return _0x3a9d50;};'use strict';var express=require(_0xb720('0x0'));var router=express[_0xb720('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require(_0xb720('0x2'));router[_0xb720('0x3')]('/',auth[_0xb720('0x4')](),controller['index']);router[_0xb720('0x3')](_0xb720('0x5'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xb720('0x4')](),controller['show']);router['get'](_0xb720('0x6'),auth[_0xb720('0x4')](),controller[_0xb720('0x7')]);router[_0xb720('0x3')](_0xb720('0x8'),auth[_0xb720('0x4')](),controller[_0xb720('0x9')]);router['post']('/',auth[_0xb720('0x4')](),controller[_0xb720('0xa')]);router['post'](_0xb720('0x6'),auth['isAuthenticated'](),controller[_0xb720('0xb')]);router[_0xb720('0xc')](_0xb720('0xd'),auth[_0xb720('0x4')](),interaction['tracked']('mail','mailinteraction:addtags'),controller['addTags']);router[_0xb720('0xe')](_0xb720('0xf'),auth['isAuthenticated'](),interaction[_0xb720('0x10')]('mail',_0xb720('0x11')),controller[_0xb720('0x12')]);router[_0xb720('0x13')]('/:id',auth[_0xb720('0x4')](),interaction['tracked'](_0xb720('0x14'),_0xb720('0x15')),controller[_0xb720('0x16')]);router[_0xb720('0x13')](_0xb720('0xd'),auth[_0xb720('0x4')](),controller['removeTags']);module[_0xb720('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index a08bec1..34a5c70 100644 --- a/server/api/mailInteraction/mailInteraction.attributes.js +++ b/server/api/mailInteraction/mailInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x121e=['STRING','TEXT','long','out','ENUM','INTEGER','sequelize','iconv','exports','BOOLEAN','DATE'];(function(_0x77334b,_0x19e17b){var _0x5d3953=function(_0x3a4bad){while(--_0x3a4bad){_0x77334b['push'](_0x77334b['shift']());}};_0x5d3953(++_0x19e17b);}(_0x121e,0xab));var _0xe121=function(_0x6bfd7e,_0x390245){_0x6bfd7e=_0x6bfd7e-0x0;var _0x3742c1=_0x121e[_0x6bfd7e];return _0x3742c1;};'use strict';var Sequelize=require(_0xe121('0x0'));var iconv=require(_0xe121('0x1'));module[_0xe121('0x2')]={'closed':{'type':Sequelize[_0xe121('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe121('0x4')]},'disposition':{'type':Sequelize[_0xe121('0x5')]},'secondDisposition':{'type':Sequelize[_0xe121('0x5')]},'thirdDisposition':{'type':Sequelize[_0xe121('0x5')]},'note':{'type':Sequelize[_0xe121('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xe121('0x5')]},'cc':{'type':Sequelize[_0xe121('0x6')](_0xe121('0x7'))},'subject':{'type':Sequelize[_0xe121('0x6')]()},'attach':{'type':Sequelize[_0xe121('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xe121('0x4')]},'substatus':{'type':Sequelize[_0xe121('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0xe121('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xe121('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe121('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xe121('0x9')]('in',_0xe121('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xe121('0xa')]}}; \ No newline at end of file +var _0xfe0d=['out','ENUM','INTEGER','iconv','exports','BOOLEAN','DATE','STRING','long','TEXT'];(function(_0x17fdde,_0x4b3717){var _0x4fd885=function(_0x4a9793){while(--_0x4a9793){_0x17fdde['push'](_0x17fdde['shift']());}};_0x4fd885(++_0x4b3717);}(_0xfe0d,0x189));var _0xdfe0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfe0d[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xdfe0('0x0'));module[_0xdfe0('0x1')]={'closed':{'type':Sequelize[_0xdfe0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdfe0('0x3')]},'disposition':{'type':Sequelize[_0xdfe0('0x4')]},'secondDisposition':{'type':Sequelize[_0xdfe0('0x4')]},'thirdDisposition':{'type':Sequelize[_0xdfe0('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xdfe0('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0xdfe0('0x5'))},'subject':{'type':Sequelize[_0xdfe0('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xdfe0('0x3')]},'substatus':{'type':Sequelize[_0xdfe0('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xdfe0('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xdfe0('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdfe0('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xdfe0('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xdfe0('0x9')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 4658697..1496815 100644 --- a/server/api/mailInteraction/mailInteraction.controller.js +++ b/server/api/mailInteraction/mailInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['count','Content-Range','update','then','error','stack','name','send','map','MailInteraction','rawAttributes','type','key','getOptions','findAll','mail','query','user','catch','show','params','model','filters','intersection','fields','attributes','length','includeAll','include','merge','options','create','body','find','describe','addMessage','MailMessage','findOne','keys','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','rows','addTags','ids','Tag','color','removeTags','unix','toString','join','root','server','tmp','files','attachments','push','Attachment','Attachments','from','bcc','createdAt','Messages','get','mkdirSync','each','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','build','writeFileSync','message%d.eml','download','eml-format','rimraf','zip-dir','moment','bluebird','util','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x543673,_0xe0ea22){var _0x45468c=function(_0x4e44a7){while(--_0x4e44a7){_0x543673['push'](_0x543673['shift']());}};_0x45468c(++_0xe0ea22);}(_0x34e8,0x1a9));var _0x834e=function(_0x32caca,_0x446cd5){_0x32caca=_0x32caca-0x0;var _0x5abadb=_0x34e8[_0x32caca];return _0x5abadb;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var moment=require(_0x834e('0x3'));var BPromise=require(_0x834e('0x4'));var util=require(_0x834e('0x5'));var path=require('path');var fs=require('fs');var _=require('lodash');var juice=require(_0x834e('0x6'));var Redis=require(_0x834e('0x7'));var interaction=require(_0x834e('0x8'));var qs=require(_0x834e('0x9'));var logger=require(_0x834e('0xa'))(_0x834e('0xb'));var config=require(_0x834e('0xc'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x834e('0xd'));config[_0x834e('0xe')]=_[_0x834e('0xf')](config['redis'],{'host':_0x834e('0x10'),'port':0x18eb});var socket=require(_0x834e('0x11'))(new Redis(config['redis']));require(_0x834e('0x12'))[_0x834e('0x13')](socket);function respondWithStatusCode(_0x378061,_0x22f3e2){_0x22f3e2=_0x22f3e2||0xcc;return function(_0x46640c){if(_0x46640c){return _0x378061[_0x834e('0x14')](_0x22f3e2);}return _0x378061[_0x834e('0x15')](_0x22f3e2)[_0x834e('0x16')]();};}function respondWithResult(_0x103d70,_0x30ca4b){_0x30ca4b=_0x30ca4b||0xc8;return function(_0x6cef50){if(_0x6cef50){return _0x103d70[_0x834e('0x15')](_0x30ca4b)[_0x834e('0x17')](_0x6cef50);}};}function respondWithFilteredResult(_0x3b4e98,_0xff034){return function(_0x2b89ad){if(_0x2b89ad){var _0x3c70c2=typeof _0xff034[_0x834e('0x18')]===_0x834e('0x19')&&typeof _0xff034[_0x834e('0x1a')]===_0x834e('0x19');var _0x1fb0db=_0x2b89ad['count'];var _0x2dad6a=_0x3c70c2?0x0:_0xff034[_0x834e('0x18')];var _0x40ef41=_0x3c70c2?_0x2b89ad[_0x834e('0x1b')]:_0xff034['offset']+_0xff034['limit'];var _0x1fa4d3;if(_0x40ef41>=_0x1fb0db){_0x40ef41=_0x1fb0db;_0x1fa4d3=0xc8;}else{_0x1fa4d3=0xce;}_0x3b4e98[_0x834e('0x15')](_0x1fa4d3);return _0x3b4e98['set'](_0x834e('0x1c'),_0x2dad6a+'-'+_0x40ef41+'/'+_0x1fb0db)[_0x834e('0x17')](_0x2b89ad);}return null;};}function saveUpdates(_0x46c4e5){return function(_0x244294){if(_0x244294){return _0x244294[_0x834e('0x1d')](_0x46c4e5)[_0x834e('0x1e')](function(_0x3ca178){return _0x3ca178;});}return null;};}function removeEntity(_0x4d53d4){return function(_0x4d7c03){if(_0x4d7c03){return _0x4d7c03['destroy']()[_0x834e('0x1e')](function(){_0x4d53d4[_0x834e('0x15')](0xcc)[_0x834e('0x16')]();});}};}function handleEntityNotFound(_0x597c7c){return function(_0x2bdd65){if(!_0x2bdd65){_0x597c7c[_0x834e('0x14')](0x194);}return _0x2bdd65;};}function handleError(_0x59e635,_0x315ead){_0x315ead=_0x315ead||0x1f4;return function(_0x2ae700){logger[_0x834e('0x1f')](_0x2ae700[_0x834e('0x20')]);if(_0x2ae700[_0x834e('0x21')]){delete _0x2ae700[_0x834e('0x21')];}_0x59e635[_0x834e('0x15')](_0x315ead)[_0x834e('0x22')](_0x2ae700);};}exports['index']=function(_0x2eaa9b,_0x42bc53){var _0x57e3fe={};var _0x5a407c=_[_0x834e('0x23')](db[_0x834e('0x24')][_0x834e('0x25')],function(_0x3b4207){return{'name':_0x3b4207['fieldName'],'type':_0x3b4207[_0x834e('0x26')][_0x834e('0x27')]};});_0x57e3fe=qs[_0x834e('0x28')](_0x5a407c,_0x2eaa9b);return interaction[_0x834e('0x29')](_0x834e('0x2a'),_0x2eaa9b[_0x834e('0x2b')],_0x2eaa9b[_0x834e('0x2c')],_0x57e3fe,_0x5a407c)[_0x834e('0x1e')](respondWithFilteredResult(_0x42bc53,_0x57e3fe))[_0x834e('0x2d')](handleError(_0x42bc53,null));};exports[_0x834e('0x2e')]=function(_0x258718,_0x3f9eeb){var _0x5a442f={'raw':![],'where':{'id':_0x258718[_0x834e('0x2f')]['id']}},_0x5cbd20={};_0x5cbd20[_0x834e('0x30')]=_['keys'](db['MailInteraction'][_0x834e('0x25')]);_0x5cbd20[_0x834e('0x2b')]=_['keys'](_0x258718[_0x834e('0x2b')]);_0x5cbd20[_0x834e('0x31')]=_['intersection'](_0x5cbd20[_0x834e('0x30')],_0x5cbd20[_0x834e('0x2b')]);_0x5a442f['attributes']=_[_0x834e('0x32')](_0x5cbd20[_0x834e('0x30')],qs['fields'](_0x258718['query'][_0x834e('0x33')]));_0x5a442f[_0x834e('0x34')]=_0x5a442f[_0x834e('0x34')][_0x834e('0x35')]?_0x5a442f['attributes']:_0x5cbd20['model'];if(_0x258718[_0x834e('0x2b')][_0x834e('0x36')]){_0x5a442f[_0x834e('0x37')]=[{'all':!![]}];}_0x5a442f=_[_0x834e('0x38')]({},_0x5a442f,_0x258718[_0x834e('0x39')]);return db['MailInteraction']['find'](_0x5a442f)['then'](handleEntityNotFound(_0x3f9eeb,null))[_0x834e('0x1e')](respondWithResult(_0x3f9eeb,null))['catch'](handleError(_0x3f9eeb,null));};exports[_0x834e('0x3a')]=function(_0x4bafee,_0x47e4bb){return db['MailInteraction'][_0x834e('0x3a')](_0x4bafee[_0x834e('0x3b')],{})[_0x834e('0x1e')](respondWithResult(_0x47e4bb,0xc9))[_0x834e('0x2d')](handleError(_0x47e4bb,null));};exports['update']=function(_0x264695,_0x95d69e){if(_0x264695[_0x834e('0x3b')]['id']){delete _0x264695[_0x834e('0x3b')]['id'];}return db['MailInteraction'][_0x834e('0x3c')]({'where':{'id':_0x264695[_0x834e('0x2f')]['id']}})[_0x834e('0x1e')](handleEntityNotFound(_0x95d69e,null))[_0x834e('0x1e')](saveUpdates(_0x264695['body'],null))[_0x834e('0x1e')](respondWithResult(_0x95d69e,null))[_0x834e('0x2d')](handleError(_0x95d69e,null));};exports['destroy']=function(_0x1c67c7,_0x863f9c){return db[_0x834e('0x24')][_0x834e('0x3c')]({'where':{'id':_0x1c67c7[_0x834e('0x2f')]['id']}})[_0x834e('0x1e')](handleEntityNotFound(_0x863f9c,null))['then'](removeEntity(_0x863f9c,null))[_0x834e('0x2d')](handleError(_0x863f9c,null));};exports[_0x834e('0x3d')]=function(_0x1d600f,_0x5d1f0e){return db['MailInteraction'][_0x834e('0x3d')]()['then'](respondWithResult(_0x5d1f0e,null))[_0x834e('0x2d')](handleError(_0x5d1f0e,null));};exports[_0x834e('0x3e')]=function(_0x1f61ce,_0x21f9ec){return db[_0x834e('0x3f')]['find']({'where':{'id':_0x1f61ce[_0x834e('0x2f')]['id']}})['then'](handleEntityNotFound(_0x21f9ec,null))[_0x834e('0x1e')](function(_0xd538a4){if(_0xd538a4){return _0xd538a4[_0x834e('0x3e')](_0x1f61ce[_0x834e('0x3b')]['ids'],_['omit'](_0x1f61ce[_0x834e('0x3b')],['ids','id'])||{});}})[_0x834e('0x1e')](respondWithResult(_0x21f9ec,null))['catch'](handleError(_0x21f9ec,null));};exports['getMessages']=function(_0x3b0988,_0x464011){var _0x332e53={'raw':![],'where':{}};var _0x56b063={};var _0x3b725c={'count':0x0,'rows':[]};return db['MailInteraction'][_0x834e('0x40')]({'where':{'id':_0x3b0988[_0x834e('0x2f')]['id']}})['then'](handleEntityNotFound(_0x464011,null))[_0x834e('0x1e')](function(_0xf7d8bf){if(_0xf7d8bf){_0x56b063['model']=_[_0x834e('0x41')](db[_0x834e('0x3f')][_0x834e('0x25')]);_0x56b063['query']=_[_0x834e('0x41')](_0x3b0988[_0x834e('0x2b')]);_0x56b063[_0x834e('0x31')]=_[_0x834e('0x32')](_0x56b063[_0x834e('0x30')],_0x56b063[_0x834e('0x2b')]);_0x332e53[_0x834e('0x34')]=_[_0x834e('0x32')](_0x56b063['model'],qs['fields'](_0x3b0988[_0x834e('0x2b')][_0x834e('0x33')]));_0x332e53[_0x834e('0x34')]=_0x332e53[_0x834e('0x34')]['length']?_0x332e53[_0x834e('0x34')]:_0x56b063['model'];if(!_0x3b0988[_0x834e('0x2b')][_0x834e('0x42')](_0x834e('0x43'))){_0x332e53[_0x834e('0x1a')]=qs['limit'](_0x3b0988['query']['limit']);_0x332e53[_0x834e('0x18')]=qs[_0x834e('0x18')](_0x3b0988[_0x834e('0x2b')][_0x834e('0x18')]);}_0x332e53[_0x834e('0x44')]=qs[_0x834e('0x45')](_0x3b0988[_0x834e('0x2b')]['sort']);_0x332e53[_0x834e('0x46')]=qs['filters'](_[_0x834e('0x47')](_0x3b0988[_0x834e('0x2b')],_0x56b063[_0x834e('0x31')]));_0x332e53[_0x834e('0x46')][_0x834e('0x48')]=_0xf7d8bf['id'];if(_0x3b0988[_0x834e('0x2b')]['filter']){_0x332e53[_0x834e('0x46')]=_[_0x834e('0x38')](_0x332e53['where'],{'$or':_[_0x834e('0x23')](_0x332e53[_0x834e('0x34')],function(_0x34524c){var _0xf9d91b={};_0xf9d91b[_0x34524c]={'$like':'%'+_0x3b0988[_0x834e('0x2b')][_0x834e('0x49')]+'%'};return _0xf9d91b;})});}if(_0x3b0988[_0x834e('0x2b')][_0x834e('0x4a')]){var _0x452a3a=_0x3b0988[_0x834e('0x2b')][_0x834e('0x4a')][_0x834e('0x4b')](',');var _0x4b0bdd={};_0x4b0bdd[_0x452a3a[0x0]]={'$gte':moment(_0x452a3a[0x1])[_0x834e('0x4c')](_0x834e('0x4d'))};_0x332e53[_0x834e('0x46')]=_[_0x834e('0x38')](_0x332e53[_0x834e('0x46')],_0x4b0bdd);}_0x332e53=_[_0x834e('0x38')]({},_0x332e53,_0x3b0988['options']);return db[_0x834e('0x3f')][_0x834e('0x1b')]({'where':_0x332e53['where']})[_0x834e('0x1e')](function(_0x33065c){_0x3b725c[_0x834e('0x1b')]=_0x33065c;if(_0x3b0988['query'][_0x834e('0x36')]){_0x332e53['include']=[{'all':!![]}];}return db[_0x834e('0x3f')][_0x834e('0x29')](_0x332e53);})[_0x834e('0x1e')](function(_0x3e3339){if(_0x3b0988['query']['inlineCss']===_0x834e('0x4e')){for(var _0x11dc84=0x0;_0x11dc84<_0x3e3339[_0x834e('0x35')];_0x11dc84++){_0x3e3339[_0x11dc84][_0x834e('0x3b')]=juice(_0x3e3339[_0x11dc84]['body']);}}_0x3b725c[_0x834e('0x4f')]=_0x3e3339;return _0x3b725c;});}})[_0x834e('0x1e')](respondWithFilteredResult(_0x464011,_0x332e53))[_0x834e('0x2d')](handleError(_0x464011,null));};exports[_0x834e('0x50')]=function(_0x273ef9,_0x4480c9){return db[_0x834e('0x24')][_0x834e('0x3c')]({'where':{'id':_0x273ef9[_0x834e('0x2f')]['id']}})['then'](handleEntityNotFound(_0x4480c9,null))[_0x834e('0x1e')](function(_0x12d984){if(_0x12d984){return _0x12d984['setTags'](_0x273ef9[_0x834e('0x3b')][_0x834e('0x51')],_['omit'](_0x273ef9[_0x834e('0x3b')],[_0x834e('0x51'),'id'])||{})['spread'](function(){return db[_0x834e('0x52')]['findAll']({'attributes':['id',_0x834e('0x21'),_0x834e('0x53')],'where':{'id':_0x273ef9['body'][_0x834e('0x51')]}});})[_0x834e('0x1e')](function(_0x5ee7c2){socket['emit']('mailInteractionTags:save',{'id':Number(_0x273ef9['params']['id']),'tags':_0x5ee7c2||[]});return{'id':Number(_0x273ef9['params']['id']),'tags':_0x5ee7c2||[]};});}})[_0x834e('0x1e')](respondWithResult(_0x4480c9,null))['catch'](handleError(_0x4480c9,null));};exports[_0x834e('0x54')]=function(_0x1287ba,_0x2f2682){return db[_0x834e('0x24')]['find']({'where':{'id':_0x1287ba['params']['id']}})[_0x834e('0x1e')](handleEntityNotFound(_0x2f2682,null))[_0x834e('0x1e')](function(_0x38a3f6){if(_0x38a3f6){return _0x38a3f6[_0x834e('0x54')](_0x1287ba[_0x834e('0x2b')][_0x834e('0x51')]);}})['then'](respondWithStatusCode(_0x2f2682,null))[_0x834e('0x2d')](handleError(_0x2f2682,null));};exports['download']=function(_0xb65ebf,_0x43ccdf){var _0x100376=moment()[_0x834e('0x55')]()[_0x834e('0x56')]();var _0xd0dc46=path[_0x834e('0x57')](config[_0x834e('0x58')],_0x834e('0x59'),'files',_0x834e('0x5a'));var _0x5bf20c=path['join'](config[_0x834e('0x58')],_0x834e('0x59'),_0x834e('0x5b'),_0x834e('0x5c'));var _0x17cd1f=path[_0x834e('0x57')](_0xd0dc46,_0x100376);var _0x28bd53=util['format']('transcript-%d-%s.zip',_0xb65ebf[_0x834e('0x2f')]['id'],_0x100376);var _0x47dbba=path[_0x834e('0x57')](_0xd0dc46,_0x28bd53);var _0x111e4d=[];if(_0xb65ebf[_0x834e('0x2b')][_0x834e('0x5c')]){_0x111e4d[_0x834e('0x5d')]({'model':db[_0x834e('0x5e')],'as':_0x834e('0x5f'),'raw':!![]});}var _0x1d314d=[{'model':db['MailMessage'],'as':'Messages','attributes':['id',_0x834e('0x3b'),_0x834e('0x60'),'to','cc',_0x834e('0x61'),'subject',_0x834e('0x62')],'where':{'secret':![]},'order':qs[_0x834e('0x45')]('id'),'include':_0x111e4d}];return db['MailInteraction']['find']({'where':{'id':_0xb65ebf[_0x834e('0x2f')]['id']},'include':_0x1d314d})[_0x834e('0x1e')](handleEntityNotFound(_0x43ccdf,null))[_0x834e('0x1e')](function(_0x595f6b){if(_0x595f6b&&_0x595f6b[_0x834e('0x63')]){var _0x1b0e88=_0x595f6b[_0x834e('0x64')]({'plain':!![]});fs[_0x834e('0x65')](_0x17cd1f);return BPromise[_0x834e('0x66')](_0x1b0e88[_0x834e('0x63')],function(_0x5c69b9,_0x568262){var _0x453575={'from':_0x5c69b9[_0x834e('0x60')],'to':_0x5c69b9['to']||'missing.recipient@your.company.com','subject':_0x5c69b9[_0x834e('0x67')],'html':htmlEntities[_0x834e('0x68')](_0x5c69b9['body']),'headers':{'Date':moment(_0x5c69b9[_0x834e('0x62')])[_0x834e('0x4c')](_0x834e('0x69'))},'attachments':[]};if(_0x5c69b9['cc']){_0x453575[_0x834e('0x6a')]['Cc']=_0x5c69b9['cc'];}if(_0x5c69b9['bcc']){_0x453575[_0x834e('0x6a')]['Bcc']=_0x5c69b9[_0x834e('0x61')];}return new BPromise(function(_0x5d648a,_0x30485e){if(_0x5c69b9[_0x834e('0x5f')]){for(var _0x42cd2f=0x0;_0x42cd2f<_0x5c69b9['Attachments'][_0x834e('0x35')];_0x42cd2f++){var _0x41e62f=_0x5c69b9['Attachments'][_0x42cd2f];var _0x24d5fe=path[_0x834e('0x57')](_0x5bf20c,_0x41e62f[_0x834e('0x6b')]);if(fs[_0x834e('0x6c')](_0x24d5fe)){_0x453575[_0x834e('0x5c')][_0x834e('0x5d')]({'name':_0x41e62f[_0x834e('0x21')],'contentType':_0x41e62f['type'],'data':fs['readFileSync'](_0x24d5fe)});}}}emlformat[_0x834e('0x6d')](_0x453575,function(_0x6f6ede,_0x222466){if(_0x6f6ede)return _0x30485e(_0x6f6ede);fs[_0x834e('0x6e')](path[_0x834e('0x57')](_0x17cd1f,util['format'](_0x834e('0x6f'),_0x568262)),_0x222466);return _0x5d648a(_0x222466);});});})[_0x834e('0x1e')](function(){return new BPromise(function(_0x5b8ee9,_0x4edc22){zipdir(_0x17cd1f,{'saveTo':_0x47dbba},function(_0x2c21bc,_0xb9acf5){if(_0x2c21bc)return _0x4edc22(_0x2c21bc);return _0x5b8ee9(_0xb9acf5);});})[_0x834e('0x1e')](function(){return new BPromise(function(_0x2175ea,_0x460df0){rimraf(_0x17cd1f,function(_0x26b77d){if(_0x26b77d)_0x460df0(_0x26b77d);return _0x2175ea();});});})[_0x834e('0x1e')](function(){return _0x43ccdf[_0x834e('0x70')](_0x47dbba,_0x28bd53,function(_0x3db30e){if(!_0x3db30e)fs['unlinkSync'](_0x47dbba);});});});}else{return _0x43ccdf[_0x834e('0x14')](0xc8);}})[_0x834e('0x2d')](handleError(_0x43ccdf,null));}; \ No newline at end of file +var _0x447e=['../../config/logger','api','../../config/environment','defaults','redis','localhost','./mailInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','error','stack','name','send','index','map','MailInteraction','rawAttributes','key','mail','query','user','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','destroy','MailMessage','addMessage','ids','getMessages','hasOwnProperty','order','where','pick','MailInteractionId','filter','$gte','split','format','findAll','inlineCss','true','addTags','omit','Tag','color','mailInteractionTags:save','removeTags','download','unix','toString','join','files','tmp','root','transcript-%d-%s.zip','attachments','push','Attachment','Messages','from','bcc','createdAt','sort','get','each','missing.recipient@your.company.com','subject','decode','headers','Attachments','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','util','path','lodash','juice','../../components/interaction/service','../../components/parsers/qs'];(function(_0x23efd8,_0x502628){var _0x55ede=function(_0xbdc0b7){while(--_0xbdc0b7){_0x23efd8['push'](_0x23efd8['shift']());}};_0x55ede(++_0x502628);}(_0x447e,0x146));var _0xe447=function(_0x11aa74,_0x589680){_0x11aa74=_0x11aa74-0x0;var _0x172f1c=_0x447e[_0x11aa74];return _0x172f1c;};'use strict';var emlformat=require(_0xe447('0x0'));var rimraf=require(_0xe447('0x1'));var zipdir=require(_0xe447('0x2'));var moment=require(_0xe447('0x3'));var BPromise=require('bluebird');var util=require(_0xe447('0x4'));var path=require(_0xe447('0x5'));var fs=require('fs');var _=require(_0xe447('0x6'));var juice=require(_0xe447('0x7'));var Redis=require('ioredis');var interaction=require(_0xe447('0x8'));var qs=require(_0xe447('0x9'));var logger=require(_0xe447('0xa'))(_0xe447('0xb'));var config=require(_0xe447('0xc'));var db=require('../../mysqldb')['db'];var htmlEntities=require('html-entities');config['redis']=_[_0xe447('0xd')](config[_0xe447('0xe')],{'host':_0xe447('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe447('0xe')]));require(_0xe447('0x10'))[_0xe447('0x11')](socket);function respondWithStatusCode(_0x4d950a,_0x381ca1){_0x381ca1=_0x381ca1||0xcc;return function(_0x126ff4){if(_0x126ff4){return _0x4d950a[_0xe447('0x12')](_0x381ca1);}return _0x4d950a[_0xe447('0x13')](_0x381ca1)[_0xe447('0x14')]();};}function respondWithResult(_0x5d1f5b,_0x30a97b){_0x30a97b=_0x30a97b||0xc8;return function(_0x3bd134){if(_0x3bd134){return _0x5d1f5b[_0xe447('0x13')](_0x30a97b)['json'](_0x3bd134);}};}function respondWithFilteredResult(_0x912195,_0x23febd){return function(_0x5f446b){if(_0x5f446b){var _0x116c75=typeof _0x23febd[_0xe447('0x15')]===_0xe447('0x16')&&typeof _0x23febd[_0xe447('0x17')]===_0xe447('0x16');var _0x3263d8=_0x5f446b['count'];var _0xefd8a9=_0x116c75?0x0:_0x23febd[_0xe447('0x15')];var _0x379222=_0x116c75?_0x5f446b[_0xe447('0x18')]:_0x23febd[_0xe447('0x15')]+_0x23febd[_0xe447('0x17')];var _0x2bf39f;if(_0x379222>=_0x3263d8){_0x379222=_0x3263d8;_0x2bf39f=0xc8;}else{_0x2bf39f=0xce;}_0x912195['status'](_0x2bf39f);return _0x912195[_0xe447('0x19')](_0xe447('0x1a'),_0xefd8a9+'-'+_0x379222+'/'+_0x3263d8)[_0xe447('0x1b')](_0x5f446b);}return null;};}function saveUpdates(_0x1a1ab3){return function(_0x148a35){if(_0x148a35){return _0x148a35[_0xe447('0x1c')](_0x1a1ab3)[_0xe447('0x1d')](function(_0x5362ed){return _0x5362ed;});}return null;};}function removeEntity(_0x54a9d0){return function(_0x3dc90b){if(_0x3dc90b){return _0x3dc90b['destroy']()['then'](function(){_0x54a9d0['status'](0xcc)[_0xe447('0x14')]();});}};}function handleEntityNotFound(_0xfa0d9e){return function(_0x2bf4af){if(!_0x2bf4af){_0xfa0d9e[_0xe447('0x12')](0x194);}return _0x2bf4af;};}function handleError(_0x2a5fc0,_0x257147){_0x257147=_0x257147||0x1f4;return function(_0x555a04){logger[_0xe447('0x1e')](_0x555a04[_0xe447('0x1f')]);if(_0x555a04['name']){delete _0x555a04[_0xe447('0x20')];}_0x2a5fc0['status'](_0x257147)[_0xe447('0x21')](_0x555a04);};}exports[_0xe447('0x22')]=function(_0x4d1c4d,_0x2f82dd){var _0x22f7b9={};var _0x400180=_[_0xe447('0x23')](db[_0xe447('0x24')][_0xe447('0x25')],function(_0x11e394){return{'name':_0x11e394['fieldName'],'type':_0x11e394['type'][_0xe447('0x26')]};});_0x22f7b9=qs['getOptions'](_0x400180,_0x4d1c4d);return interaction['findAll'](_0xe447('0x27'),_0x4d1c4d[_0xe447('0x28')],_0x4d1c4d[_0xe447('0x29')],_0x22f7b9,_0x400180)[_0xe447('0x1d')](respondWithFilteredResult(_0x2f82dd,_0x22f7b9))['catch'](handleError(_0x2f82dd,null));};exports[_0xe447('0x2a')]=function(_0x490a2a,_0x7710f2){var _0x5ac0c1={'raw':![],'where':{'id':_0x490a2a[_0xe447('0x2b')]['id']}},_0x1f70b6={};_0x1f70b6[_0xe447('0x2c')]=_[_0xe447('0x2d')](db[_0xe447('0x24')][_0xe447('0x25')]);_0x1f70b6[_0xe447('0x28')]=_[_0xe447('0x2d')](_0x490a2a['query']);_0x1f70b6[_0xe447('0x2e')]=_[_0xe447('0x2f')](_0x1f70b6[_0xe447('0x2c')],_0x1f70b6[_0xe447('0x28')]);_0x5ac0c1[_0xe447('0x30')]=_[_0xe447('0x2f')](_0x1f70b6['model'],qs[_0xe447('0x31')](_0x490a2a[_0xe447('0x28')]['fields']));_0x5ac0c1[_0xe447('0x30')]=_0x5ac0c1['attributes'][_0xe447('0x32')]?_0x5ac0c1[_0xe447('0x30')]:_0x1f70b6[_0xe447('0x2c')];if(_0x490a2a['query'][_0xe447('0x33')]){_0x5ac0c1[_0xe447('0x34')]=[{'all':!![]}];}_0x5ac0c1=_[_0xe447('0x35')]({},_0x5ac0c1,_0x490a2a[_0xe447('0x36')]);return db[_0xe447('0x24')][_0xe447('0x37')](_0x5ac0c1)[_0xe447('0x1d')](handleEntityNotFound(_0x7710f2,null))[_0xe447('0x1d')](respondWithResult(_0x7710f2,null))[_0xe447('0x38')](handleError(_0x7710f2,null));};exports[_0xe447('0x39')]=function(_0x43634b,_0x3ad18b){return db['MailInteraction'][_0xe447('0x39')](_0x43634b[_0xe447('0x3a')],{})['then'](respondWithResult(_0x3ad18b,0xc9))['catch'](handleError(_0x3ad18b,null));};exports[_0xe447('0x1c')]=function(_0x9b9d1d,_0x5b1428){if(_0x9b9d1d[_0xe447('0x3a')]['id']){delete _0x9b9d1d[_0xe447('0x3a')]['id'];}return db[_0xe447('0x24')][_0xe447('0x37')]({'where':{'id':_0x9b9d1d[_0xe447('0x2b')]['id']}})[_0xe447('0x1d')](handleEntityNotFound(_0x5b1428,null))[_0xe447('0x1d')](saveUpdates(_0x9b9d1d[_0xe447('0x3a')],null))[_0xe447('0x1d')](respondWithResult(_0x5b1428,null))[_0xe447('0x38')](handleError(_0x5b1428,null));};exports[_0xe447('0x3b')]=function(_0x1d72ef,_0x29bc53){return db['MailInteraction']['find']({'where':{'id':_0x1d72ef[_0xe447('0x2b')]['id']}})['then'](handleEntityNotFound(_0x29bc53,null))[_0xe447('0x1d')](removeEntity(_0x29bc53,null))[_0xe447('0x38')](handleError(_0x29bc53,null));};exports['describe']=function(_0x3c10f4,_0x17a55e){return db[_0xe447('0x24')]['describe']()[_0xe447('0x1d')](respondWithResult(_0x17a55e,null))[_0xe447('0x38')](handleError(_0x17a55e,null));};exports['addMessage']=function(_0x1c5bd9,_0x272703){return db[_0xe447('0x3c')][_0xe447('0x37')]({'where':{'id':_0x1c5bd9['params']['id']}})['then'](handleEntityNotFound(_0x272703,null))[_0xe447('0x1d')](function(_0x5ef2e2){if(_0x5ef2e2){return _0x5ef2e2[_0xe447('0x3d')](_0x1c5bd9[_0xe447('0x3a')][_0xe447('0x3e')],_['omit'](_0x1c5bd9['body'],['ids','id'])||{});}})[_0xe447('0x1d')](respondWithResult(_0x272703,null))[_0xe447('0x38')](handleError(_0x272703,null));};exports[_0xe447('0x3f')]=function(_0x5d1d84,_0x5057e4){var _0x4e7bc6={'raw':![],'where':{}};var _0x1c69e6={};var _0x2a5711={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x5d1d84[_0xe447('0x2b')]['id']}})[_0xe447('0x1d')](handleEntityNotFound(_0x5057e4,null))[_0xe447('0x1d')](function(_0x10a97a){if(_0x10a97a){_0x1c69e6['model']=_['keys'](db['MailMessage']['rawAttributes']);_0x1c69e6[_0xe447('0x28')]=_[_0xe447('0x2d')](_0x5d1d84[_0xe447('0x28')]);_0x1c69e6[_0xe447('0x2e')]=_[_0xe447('0x2f')](_0x1c69e6['model'],_0x1c69e6['query']);_0x4e7bc6['attributes']=_[_0xe447('0x2f')](_0x1c69e6[_0xe447('0x2c')],qs['fields'](_0x5d1d84[_0xe447('0x28')][_0xe447('0x31')]));_0x4e7bc6[_0xe447('0x30')]=_0x4e7bc6[_0xe447('0x30')]['length']?_0x4e7bc6[_0xe447('0x30')]:_0x1c69e6['model'];if(!_0x5d1d84[_0xe447('0x28')][_0xe447('0x40')]('nolimit')){_0x4e7bc6[_0xe447('0x17')]=qs['limit'](_0x5d1d84[_0xe447('0x28')][_0xe447('0x17')]);_0x4e7bc6[_0xe447('0x15')]=qs[_0xe447('0x15')](_0x5d1d84['query']['offset']);}_0x4e7bc6[_0xe447('0x41')]=qs['sort'](_0x5d1d84[_0xe447('0x28')]['sort']);_0x4e7bc6[_0xe447('0x42')]=qs[_0xe447('0x2e')](_[_0xe447('0x43')](_0x5d1d84['query'],_0x1c69e6[_0xe447('0x2e')]));_0x4e7bc6[_0xe447('0x42')][_0xe447('0x44')]=_0x10a97a['id'];if(_0x5d1d84[_0xe447('0x28')]['filter']){_0x4e7bc6[_0xe447('0x42')]=_[_0xe447('0x35')](_0x4e7bc6['where'],{'$or':_['map'](_0x4e7bc6[_0xe447('0x30')],function(_0x467dea){var _0x4626d1={};_0x4626d1[_0x467dea]={'$like':'%'+_0x5d1d84[_0xe447('0x28')][_0xe447('0x45')]+'%'};return _0x4626d1;})});}if(_0x5d1d84[_0xe447('0x28')][_0xe447('0x46')]){var _0x46066=_0x5d1d84[_0xe447('0x28')]['$gte'][_0xe447('0x47')](',');var _0x1293e2={};_0x1293e2[_0x46066[0x0]]={'$gte':moment(_0x46066[0x1])[_0xe447('0x48')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4e7bc6[_0xe447('0x42')]=_[_0xe447('0x35')](_0x4e7bc6[_0xe447('0x42')],_0x1293e2);}_0x4e7bc6=_[_0xe447('0x35')]({},_0x4e7bc6,_0x5d1d84[_0xe447('0x36')]);return db['MailMessage'][_0xe447('0x18')]({'where':_0x4e7bc6[_0xe447('0x42')]})[_0xe447('0x1d')](function(_0x4d5631){_0x2a5711[_0xe447('0x18')]=_0x4d5631;if(_0x5d1d84[_0xe447('0x28')][_0xe447('0x33')]){_0x4e7bc6['include']=[{'all':!![]}];}return db['MailMessage'][_0xe447('0x49')](_0x4e7bc6);})[_0xe447('0x1d')](function(_0x1a099a){if(_0x5d1d84['query'][_0xe447('0x4a')]===_0xe447('0x4b')){for(var _0xf8709c=0x0;_0xf8709c<_0x1a099a['length'];_0xf8709c++){_0x1a099a[_0xf8709c][_0xe447('0x3a')]=juice(_0x1a099a[_0xf8709c][_0xe447('0x3a')]);}}_0x2a5711['rows']=_0x1a099a;return _0x2a5711;});}})[_0xe447('0x1d')](respondWithFilteredResult(_0x5057e4,_0x4e7bc6))['catch'](handleError(_0x5057e4,null));};exports[_0xe447('0x4c')]=function(_0xac0cea,_0x8e8203){return db[_0xe447('0x24')][_0xe447('0x37')]({'where':{'id':_0xac0cea[_0xe447('0x2b')]['id']}})[_0xe447('0x1d')](handleEntityNotFound(_0x8e8203,null))['then'](function(_0x555058){if(_0x555058){return _0x555058['setTags'](_0xac0cea[_0xe447('0x3a')][_0xe447('0x3e')],_[_0xe447('0x4d')](_0xac0cea[_0xe447('0x3a')],[_0xe447('0x3e'),'id'])||{})['spread'](function(){return db[_0xe447('0x4e')][_0xe447('0x49')]({'attributes':['id',_0xe447('0x20'),_0xe447('0x4f')],'where':{'id':_0xac0cea[_0xe447('0x3a')][_0xe447('0x3e')]}});})[_0xe447('0x1d')](function(_0x2adab8){socket['emit'](_0xe447('0x50'),{'id':Number(_0xac0cea[_0xe447('0x2b')]['id']),'tags':_0x2adab8||[]});return{'id':Number(_0xac0cea[_0xe447('0x2b')]['id']),'tags':_0x2adab8||[]};});}})[_0xe447('0x1d')](respondWithResult(_0x8e8203,null))[_0xe447('0x38')](handleError(_0x8e8203,null));};exports[_0xe447('0x51')]=function(_0x24ce90,_0x238153){return db[_0xe447('0x24')][_0xe447('0x37')]({'where':{'id':_0x24ce90[_0xe447('0x2b')]['id']}})[_0xe447('0x1d')](handleEntityNotFound(_0x238153,null))[_0xe447('0x1d')](function(_0x1ba58f){if(_0x1ba58f){return _0x1ba58f[_0xe447('0x51')](_0x24ce90['query'][_0xe447('0x3e')]);}})['then'](respondWithStatusCode(_0x238153,null))[_0xe447('0x38')](handleError(_0x238153,null));};exports[_0xe447('0x52')]=function(_0x5ceacf,_0x334723){var _0x1e552e=moment()[_0xe447('0x53')]()[_0xe447('0x54')]();var _0x257c1d=path[_0xe447('0x55')](config['root'],'server',_0xe447('0x56'),_0xe447('0x57'));var _0x5901f2=path[_0xe447('0x55')](config[_0xe447('0x58')],'server',_0xe447('0x56'),'attachments');var _0x5a47a1=path[_0xe447('0x55')](_0x257c1d,_0x1e552e);var _0xa87a1a=util['format'](_0xe447('0x59'),_0x5ceacf[_0xe447('0x2b')]['id'],_0x1e552e);var _0x42d46a=path['join'](_0x257c1d,_0xa87a1a);var _0xe01af6=[];if(_0x5ceacf[_0xe447('0x28')][_0xe447('0x5a')]){_0xe01af6[_0xe447('0x5b')]({'model':db[_0xe447('0x5c')],'as':'Attachments','raw':!![]});}var _0x50876d=[{'model':db[_0xe447('0x3c')],'as':_0xe447('0x5d'),'attributes':['id','body',_0xe447('0x5e'),'to','cc',_0xe447('0x5f'),'subject',_0xe447('0x60')],'where':{'secret':![]},'order':qs[_0xe447('0x61')]('id'),'include':_0xe01af6}];return db[_0xe447('0x24')][_0xe447('0x37')]({'where':{'id':_0x5ceacf[_0xe447('0x2b')]['id']},'include':_0x50876d})[_0xe447('0x1d')](handleEntityNotFound(_0x334723,null))[_0xe447('0x1d')](function(_0x3fe3d4){if(_0x3fe3d4&&_0x3fe3d4[_0xe447('0x5d')]){var _0x247c7c=_0x3fe3d4[_0xe447('0x62')]({'plain':!![]});fs['mkdirSync'](_0x5a47a1);return BPromise[_0xe447('0x63')](_0x247c7c[_0xe447('0x5d')],function(_0x301ad0,_0x220a76){var _0x1b69e0={'from':_0x301ad0[_0xe447('0x5e')],'to':_0x301ad0['to']||_0xe447('0x64'),'subject':_0x301ad0[_0xe447('0x65')],'html':htmlEntities[_0xe447('0x66')](_0x301ad0[_0xe447('0x3a')]),'headers':{'Date':moment(_0x301ad0['createdAt'])[_0xe447('0x48')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x301ad0['cc']){_0x1b69e0[_0xe447('0x67')]['Cc']=_0x301ad0['cc'];}if(_0x301ad0[_0xe447('0x5f')]){_0x1b69e0[_0xe447('0x67')]['Bcc']=_0x301ad0['bcc'];}return new BPromise(function(_0x1ea67b,_0x17aa7b){if(_0x301ad0['Attachments']){for(var _0x469286=0x0;_0x469286<_0x301ad0[_0xe447('0x68')][_0xe447('0x32')];_0x469286++){var _0x178b3e=_0x301ad0[_0xe447('0x68')][_0x469286];var _0x10b78d=path['join'](_0x5901f2,_0x178b3e[_0xe447('0x69')]);if(fs[_0xe447('0x6a')](_0x10b78d)){_0x1b69e0[_0xe447('0x5a')]['push']({'name':_0x178b3e[_0xe447('0x20')],'contentType':_0x178b3e['type'],'data':fs[_0xe447('0x6b')](_0x10b78d)});}}}emlformat[_0xe447('0x6c')](_0x1b69e0,function(_0x1a6f01,_0x1f83ba){if(_0x1a6f01)return _0x17aa7b(_0x1a6f01);fs[_0xe447('0x6d')](path[_0xe447('0x55')](_0x5a47a1,util['format'](_0xe447('0x6e'),_0x220a76)),_0x1f83ba);return _0x1ea67b(_0x1f83ba);});});})[_0xe447('0x1d')](function(){return new BPromise(function(_0x313283,_0x44a1f4){zipdir(_0x5a47a1,{'saveTo':_0x42d46a},function(_0x3ba834,_0x5438fc){if(_0x3ba834)return _0x44a1f4(_0x3ba834);return _0x313283(_0x5438fc);});})['then'](function(){return new BPromise(function(_0x38805c,_0x531e49){rimraf(_0x5a47a1,function(_0x4518d3){if(_0x4518d3)_0x531e49(_0x4518d3);return _0x38805c();});});})[_0xe447('0x1d')](function(){return _0x334723[_0xe447('0x52')](_0x42d46a,_0xa87a1a,function(_0x566195){if(!_0x566195)fs[_0xe447('0x6f')](_0x42d46a);});});});}else{return _0x334723['sendStatus'](0xc8);}})[_0xe447('0x38')](handleError(_0x334723,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 7ad2b34..f80ea45 100644 --- a/server/api/mailInteraction/mailInteraction.events.js +++ b/server/api/mailInteraction/mailInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e3b=['map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','MailInteraction','../../mysqldb','MailMessage','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x2a5d7a,_0x47b143){var _0x231c09=function(_0x48a2a6){while(--_0x48a2a6){_0x2a5d7a['push'](_0x2a5d7a['shift']());}};_0x231c09(++_0x47b143);}(_0x1e3b,0x126));var _0xb1e3=function(_0x48e07b,_0x3763e2){_0x48e07b=_0x48e07b-0x0;var _0x1321f5=_0x1e3b[_0x48e07b];return _0x1321f5;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0xb1e3('0x0')];var MailMessage=require(_0xb1e3('0x1'))['db'][_0xb1e3('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb1e3('0x3'),'afterUpdate':_0xb1e3('0x4'),'afterDestroy':_0xb1e3('0x5')};function emitEvent(_0x564fb3){return function(_0x4eeb9a,_0x171d0f,_0x39f7ff){_0x4eeb9a[_0xb1e3('0x6')]({'attributes':['id'],'raw':!![]})[_0xb1e3('0x7')](function(_0x10732f){_0x4eeb9a[_0xb1e3('0x8')](_0xb1e3('0x9'),_0x10732f[_0xb1e3('0xa')](function(_0x562113){return{'id':_0x562113['id']};}));return MailMessage[_0xb1e3('0xb')]({'where':{'MailInteractionId':_0x4eeb9a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb1e3('0x7')](function(_0x45da0c){_0x4eeb9a['setDataValue'](_0xb1e3('0xc'),_0x45da0c[_0xb1e3('0xd')]);MailInteractionEvents[_0xb1e3('0xe')](_0x564fb3+':'+_0x4eeb9a['id'],_0x4eeb9a);MailInteractionEvents[_0xb1e3('0xe')](_0x564fb3,_0x4eeb9a);_0x39f7ff(null);})[_0xb1e3('0xf')](_0x39f7ff(null));};}for(var e in events){if(events[_0xb1e3('0x10')](e)){var event=events[e];MailInteraction[_0xb1e3('0x11')](e,emitEvent(event));}}module[_0xb1e3('0x12')]=MailInteractionEvents; \ No newline at end of file +var _0x11fa=['length','emit','catch','hook','MailInteraction','update','then','setDataValue','Users','findAll','unreadMessages'];(function(_0x145ea3,_0x255ee5){var _0x36ea15=function(_0x3dbec8){while(--_0x3dbec8){_0x145ea3['push'](_0x145ea3['shift']());}};_0x36ea15(++_0x255ee5);}(_0x11fa,0x164));var _0xa11f=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x11fa[_0x82129b];return _0x2ae5dc;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0xa11f('0x0')];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa11f('0x1'),'afterDestroy':'remove'};function emitEvent(_0x1a2bf9){return function(_0x4f862b,_0x18de10,_0x60a4fd){_0x4f862b['getUsers']({'attributes':['id'],'raw':!![]})[_0xa11f('0x2')](function(_0x32b461){_0x4f862b[_0xa11f('0x3')](_0xa11f('0x4'),_0x32b461['map'](function(_0x508ab1){return{'id':_0x508ab1['id']};}));return MailMessage[_0xa11f('0x5')]({'where':{'MailInteractionId':_0x4f862b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa11f('0x2')](function(_0x4c0411){_0x4f862b[_0xa11f('0x3')](_0xa11f('0x6'),_0x4c0411[_0xa11f('0x7')]);MailInteractionEvents[_0xa11f('0x8')](_0x1a2bf9+':'+_0x4f862b['id'],_0x4f862b);MailInteractionEvents['emit'](_0x1a2bf9,_0x4f862b);_0x60a4fd(null);})[_0xa11f('0x9')](_0x60a4fd(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xa11f('0xa')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 5344912..cbeb411 100644 --- a/server/api/mailInteraction/mailInteraction.model.js +++ b/server/api/mailInteraction/mailInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c37=['YYYY-MM-DD\x20HH:mm:ss','closedAt','models','MailMessage','update','catch','utf8mb4','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','closed'];(function(_0x4c6d1f,_0x2fc652){var _0x43e02b=function(_0x5e150e){while(--_0x5e150e){_0x4c6d1f['push'](_0x4c6d1f['shift']());}};_0x43e02b(++_0x2fc652);}(_0x6c37,0x97));var _0x76c3=function(_0x6204bd,_0x5538cd){_0x6204bd=_0x6204bd-0x0;var _0x1bd5f2=_0x6c37[_0x6204bd];return _0x1bd5f2;};'use strict';var _=require(_0x76c3('0x0'));var util=require(_0x76c3('0x1'));var logger=require(_0x76c3('0x2'))(_0x76c3('0x3'));var moment=require('moment');var BPromise=require(_0x76c3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x76c3('0x5'));var config=require(_0x76c3('0x6'));var attributes=require(_0x76c3('0x7'));module[_0x76c3('0x8')]=function(_0x2a31cd,_0x13f6c9){return _0x2a31cd['define'](_0x76c3('0x9'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x76c3('0xa'),'fields':[_0x76c3('0xb'),'to'],'type':_0x76c3('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4659a3,_0x1ac5e3,_0x54bd15){if(_0x4659a3[_0x76c3('0xd')]){_0x4659a3[_0x76c3('0xe')]=moment()[_0x76c3('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4659a3[_0x76c3('0x10')]){_0x4659a3['closedAt']=moment()[_0x76c3('0xf')](_0x76c3('0x11'));}_0x54bd15(null,_0x1ac5e3);},'beforeUpdate':function(_0x2342e6,_0x227e5d,_0x363afe){if(_0x2342e6['changed'](_0x76c3('0xd'))){_0x2342e6['substatusAt']=_0x2342e6[_0x76c3('0xd')]?moment()[_0x76c3('0xf')](_0x76c3('0x11')):null;}if(_0x2342e6['changed'](_0x76c3('0x10'))){_0x2342e6[_0x76c3('0x12')]=moment()[_0x76c3('0xf')](_0x76c3('0x11'));_0x2342e6[_0x76c3('0xd')]=null;_0x2342e6[_0x76c3('0xe')]=null;}_0x363afe(null,_0x2342e6);},'afterUpdate':function(_0x4b0976,_0x4c3f53,_0x1bef9e){var _0x9a1fd9=_0x2a31cd[_0x76c3('0x13')];var _0x39fb49=_0x4b0976['get']({'plain':!![]});if(_0x39fb49[_0x76c3('0x10')]){return _0x9a1fd9[_0x76c3('0x14')][_0x76c3('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x39fb49['id']}})['then'](function(){_0x1bef9e();})[_0x76c3('0x16')](function(_0x304142){_0x1bef9e(_0x304142);});}else{_0x1bef9e();}}},'charset':_0x76c3('0x17'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3d95=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','closedAt','models','get','closed','MailMessage','update','then','utf8mb4_unicode_ci'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x3d95,0x1b3));var _0x53d9=function(_0x15e134,_0x157db8){_0x15e134=_0x15e134-0x0;var _0x1f8fb4=_0x3d95[_0x15e134];return _0x1f8fb4;};'use strict';var _=require('lodash');var util=require(_0x53d9('0x0'));var logger=require(_0x53d9('0x1'))(_0x53d9('0x2'));var moment=require('moment');var BPromise=require(_0x53d9('0x3'));var rp=require(_0x53d9('0x4'));var fs=require('fs');var path=require(_0x53d9('0x5'));var rimraf=require(_0x53d9('0x6'));var config=require(_0x53d9('0x7'));var attributes=require(_0x53d9('0x8'));module[_0x53d9('0x9')]=function(_0x5aa869,_0x30e6c8){return _0x5aa869[_0x53d9('0xa')](_0x53d9('0xb'),attributes,{'tableName':_0x53d9('0xc'),'paranoid':![],'indexes':[{'name':_0x53d9('0xd'),'fields':[_0x53d9('0xe'),'to'],'type':_0x53d9('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x22c2bd,_0xd1fc57,_0x524649){if(_0x22c2bd[_0x53d9('0x10')]){_0x22c2bd[_0x53d9('0x11')]=moment()[_0x53d9('0x12')](_0x53d9('0x13'));}if(_0x22c2bd['closed']){_0x22c2bd['closedAt']=moment()[_0x53d9('0x12')](_0x53d9('0x13'));}_0x524649(null,_0xd1fc57);},'beforeUpdate':function(_0x147bf5,_0x3f711e,_0x12e652){if(_0x147bf5[_0x53d9('0x14')](_0x53d9('0x10'))){_0x147bf5[_0x53d9('0x11')]=_0x147bf5[_0x53d9('0x10')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x147bf5['changed']('closed')){_0x147bf5[_0x53d9('0x15')]=moment()['format'](_0x53d9('0x13'));_0x147bf5[_0x53d9('0x10')]=null;_0x147bf5[_0x53d9('0x11')]=null;}_0x12e652(null,_0x147bf5);},'afterUpdate':function(_0x6d7697,_0x155a13,_0x1fe257){var _0x43445f=_0x5aa869[_0x53d9('0x16')];var _0x7e2602=_0x6d7697[_0x53d9('0x17')]({'plain':!![]});if(_0x7e2602[_0x53d9('0x18')]){return _0x43445f[_0x53d9('0x19')][_0x53d9('0x1a')]({'read':!![]},{'where':{'MailInteractionId':_0x7e2602['id']}})[_0x53d9('0x1b')](function(){_0x1fe257();})['catch'](function(_0x1695b9){_0x1fe257(_0x1695b9);});}else{_0x1fe257();}}},'charset':'utf8mb4','collate':_0x53d9('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index dcbe48d..0819b5f 100644 --- a/server/api/mailInteraction/mailInteraction.rpc.js +++ b/server/api/mailInteraction/mailInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde97=['spread','AddTags','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','UpdateMailInteraction','MailInteraction','update','raw','options','where','attributes','limit','catch','find','addTags','ids','omit','body'];(function(_0x2e3417,_0x33ddd1){var _0x10ea53=function(_0x19ad71){while(--_0x19ad71){_0x2e3417['push'](_0x2e3417['shift']());}};_0x10ea53(++_0x33ddd1);}(_0xde97,0x192));var _0x7de9=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0xde97[_0x4551f6];return _0x581dc2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7de9('0x0'));var BPromise=require('bluebird');var rs=require(_0x7de9('0x1'));var fs=require('fs');var Redis=require(_0x7de9('0x2'));var db=require(_0x7de9('0x3'))['db'];var utils=require(_0x7de9('0x4'));var logger=require('../../config/logger')(_0x7de9('0x5'));var config=require(_0x7de9('0x6'));var jayson=require(_0x7de9('0x7'));var client=jayson[_0x7de9('0x8')][_0x7de9('0x9')]({'port':0x232a});config[_0x7de9('0xa')]=_[_0x7de9('0xb')](config['redis'],{'host':_0x7de9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7de9('0xa')]));require(_0x7de9('0xd'))[_0x7de9('0xe')](socket);function respondWithRpcPromise(_0x237b30,_0x21179a,_0x1c4d6d){return new BPromise(function(_0x575362,_0x15d85d){return client['request'](_0x237b30,_0x1c4d6d)[_0x7de9('0xf')](function(_0x2e2a06){logger[_0x7de9('0x10')](_0x7de9('0x11'),_0x21179a,_0x7de9('0x12'));logger[_0x7de9('0x13')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x21179a,'request\x20sent',JSON[_0x7de9('0x14')](_0x2e2a06));if(_0x2e2a06[_0x7de9('0x15')]){if(_0x2e2a06[_0x7de9('0x15')][_0x7de9('0x16')]===0x1f4){logger[_0x7de9('0x15')](_0x7de9('0x11'),_0x21179a,_0x2e2a06[_0x7de9('0x15')]['message']);return _0x15d85d(_0x2e2a06[_0x7de9('0x15')]['message']);}logger[_0x7de9('0x15')](_0x7de9('0x11'),_0x21179a,_0x2e2a06[_0x7de9('0x15')]['message']);return _0x575362(_0x2e2a06[_0x7de9('0x15')]['message']);}else{logger['info'](_0x7de9('0x11'),_0x21179a,'request\x20sent');_0x575362(_0x2e2a06['result'][_0x7de9('0x17')]);}})['catch'](function(_0x43e4a0){logger[_0x7de9('0x15')](_0x7de9('0x11'),_0x21179a,_0x43e4a0);_0x15d85d(_0x43e4a0);});});}exports[_0x7de9('0x18')]=function(_0x1a7769){var _0xd5f0e9=this;return new Promise(function(_0x5a1e1a,_0x5b0ee5){return db[_0x7de9('0x19')][_0x7de9('0x1a')](_0x1a7769['body'],{'raw':_0x1a7769['options']?_0x1a7769['options'][_0x7de9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a7769[_0x7de9('0x1c')]?_0x1a7769['options'][_0x7de9('0x1d')]||null:null,'attributes':_0x1a7769[_0x7de9('0x1c')]?_0x1a7769[_0x7de9('0x1c')][_0x7de9('0x1e')]||null:null,'limit':_0x1a7769[_0x7de9('0x1c')]?_0x1a7769[_0x7de9('0x1c')][_0x7de9('0x1f')]||null:null})[_0x7de9('0xf')](function(_0x115a93){logger[_0x7de9('0x10')](_0x7de9('0x18'),_0x1a7769);logger[_0x7de9('0x13')](_0x7de9('0x18'),_0x1a7769,JSON['stringify'](_0x115a93));_0x5a1e1a(_0x115a93);})[_0x7de9('0x20')](function(_0x18777d){logger['error'](_0x7de9('0x18'),_0x18777d['message'],_0x1a7769);_0x5b0ee5(_0xd5f0e9[_0x7de9('0x15')](0x1f4,_0x18777d['message']));});});};exports['AddTagsToMailInteraction']=function(_0x22ef7d){return new Promise(function(_0x5c7990,_0x4e6250){return db['MailInteraction'][_0x7de9('0x21')]({'where':_0x22ef7d[_0x7de9('0x1c')]?_0x22ef7d[_0x7de9('0x1c')]['where']||null:null})[_0x7de9('0xf')](function(_0x15cd91){if(_0x15cd91){return _0x15cd91[_0x7de9('0x22')](_0x22ef7d['body'][_0x7de9('0x23')],_[_0x7de9('0x24')](_0x22ef7d[_0x7de9('0x25')],[_0x7de9('0x23'),'id'])||{});}})[_0x7de9('0x26')](function(_0x227d0c){logger[_0x7de9('0x10')]('AddTags',_0x22ef7d);logger[_0x7de9('0x13')](_0x7de9('0x27'),_0x22ef7d,JSON[_0x7de9('0x14')](_0x227d0c));_0x5c7990(_0x227d0c);})[_0x7de9('0x20')](function(_0xe107c4){logger[_0x7de9('0x15')](_0x7de9('0x27'),_0xe107c4[_0x7de9('0x17')],_0x22ef7d);_0x4e6250(_this['error'](0x1f4,_0xe107c4['message']));});});}; \ No newline at end of file +var _0x3d30=['jayson/promise','client','http','redis','localhost','./mailInteraction.socket','register','request','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','MailInteraction','update','options','raw','where','attributes','then','UpdateMailInteraction','addTags','body','ids','omit','spread','AddTags','moment','randomstring','../../config/utils','rpc','../../config/environment'];(function(_0x2f5c7c,_0x380b64){var _0x153417=function(_0x3bd82a){while(--_0x3bd82a){_0x2f5c7c['push'](_0x2f5c7c['shift']());}};_0x153417(++_0x380b64);}(_0x3d30,0x6a));var _0x03d3=function(_0x21c0c8,_0xa8cdd8){_0x21c0c8=_0x21c0c8-0x0;var _0x5d0464=_0x3d30[_0x21c0c8];return _0x5d0464;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x03d3('0x0'));var BPromise=require('bluebird');var rs=require(_0x03d3('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x03d3('0x2'));var logger=require('../../config/logger')(_0x03d3('0x3'));var config=require(_0x03d3('0x4'));var jayson=require(_0x03d3('0x5'));var client=jayson[_0x03d3('0x6')][_0x03d3('0x7')]({'port':0x232a});config[_0x03d3('0x8')]=_['defaults'](config[_0x03d3('0x8')],{'host':_0x03d3('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03d3('0x8')]));require(_0x03d3('0xa'))[_0x03d3('0xb')](socket);function respondWithRpcPromise(_0x3b5148,_0x31c272,_0x11f4a3){return new BPromise(function(_0x3679a5,_0x18fb9b){return client[_0x03d3('0xc')](_0x3b5148,_0x11f4a3)['then'](function(_0x47c708){logger['info'](_0x03d3('0xd'),_0x31c272,_0x03d3('0xe'));logger[_0x03d3('0xf')](_0x03d3('0x10'),_0x31c272,_0x03d3('0xe'),JSON[_0x03d3('0x11')](_0x47c708));if(_0x47c708['error']){if(_0x47c708[_0x03d3('0x12')][_0x03d3('0x13')]===0x1f4){logger[_0x03d3('0x12')](_0x03d3('0xd'),_0x31c272,_0x47c708['error'][_0x03d3('0x14')]);return _0x18fb9b(_0x47c708[_0x03d3('0x12')]['message']);}logger[_0x03d3('0x12')](_0x03d3('0xd'),_0x31c272,_0x47c708[_0x03d3('0x12')][_0x03d3('0x14')]);return _0x3679a5(_0x47c708['error'][_0x03d3('0x14')]);}else{logger[_0x03d3('0x15')](_0x03d3('0xd'),_0x31c272,_0x03d3('0xe'));_0x3679a5(_0x47c708['result'][_0x03d3('0x14')]);}})[_0x03d3('0x16')](function(_0x4bed38){logger[_0x03d3('0x12')](_0x03d3('0xd'),_0x31c272,_0x4bed38);_0x18fb9b(_0x4bed38);});});}exports['UpdateMailInteraction']=function(_0x57e294){var _0x313b5c=this;return new Promise(function(_0x157632,_0x1f1cb9){return db[_0x03d3('0x17')][_0x03d3('0x18')](_0x57e294['body'],{'raw':_0x57e294[_0x03d3('0x19')]?_0x57e294[_0x03d3('0x19')][_0x03d3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57e294[_0x03d3('0x19')]?_0x57e294[_0x03d3('0x19')][_0x03d3('0x1b')]||null:null,'attributes':_0x57e294[_0x03d3('0x19')]?_0x57e294[_0x03d3('0x19')][_0x03d3('0x1c')]||null:null,'limit':_0x57e294[_0x03d3('0x19')]?_0x57e294[_0x03d3('0x19')]['limit']||null:null})[_0x03d3('0x1d')](function(_0x287f72){logger[_0x03d3('0x15')](_0x03d3('0x1e'),_0x57e294);logger[_0x03d3('0xf')](_0x03d3('0x1e'),_0x57e294,JSON[_0x03d3('0x11')](_0x287f72));_0x157632(_0x287f72);})[_0x03d3('0x16')](function(_0x180db7){logger[_0x03d3('0x12')](_0x03d3('0x1e'),_0x180db7[_0x03d3('0x14')],_0x57e294);_0x1f1cb9(_0x313b5c[_0x03d3('0x12')](0x1f4,_0x180db7[_0x03d3('0x14')]));});});};exports['AddTagsToMailInteraction']=function(_0x36e9ba){return new Promise(function(_0x4c83fb,_0x380c95){return db[_0x03d3('0x17')]['find']({'where':_0x36e9ba[_0x03d3('0x19')]?_0x36e9ba[_0x03d3('0x19')][_0x03d3('0x1b')]||null:null})[_0x03d3('0x1d')](function(_0x35088b){if(_0x35088b){return _0x35088b[_0x03d3('0x1f')](_0x36e9ba[_0x03d3('0x20')][_0x03d3('0x21')],_[_0x03d3('0x22')](_0x36e9ba['body'],[_0x03d3('0x21'),'id'])||{});}})[_0x03d3('0x23')](function(_0x36cca4){logger[_0x03d3('0x15')](_0x03d3('0x24'),_0x36e9ba);logger[_0x03d3('0xf')](_0x03d3('0x24'),_0x36e9ba,JSON['stringify'](_0x36cca4));_0x4c83fb(_0x36cca4);})['catch'](function(_0x9f7a44){logger['error'](_0x03d3('0x24'),_0x9f7a44[_0x03d3('0x14')],_0x36e9ba);_0x380c95(_this['error'](0x1f4,_0x9f7a44[_0x03d3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 477fa3d..073b77f 100644 --- a/server/api/mailInteraction/mailInteraction.socket.js +++ b/server/api/mailInteraction/mailInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc020=['mailInteraction:','./mailInteraction.events','save','update','emit','removeListener','register','length'];(function(_0x315cdd,_0x364667){var _0x21e583=function(_0x52a790){while(--_0x52a790){_0x315cdd['push'](_0x315cdd['shift']());}};_0x21e583(++_0x364667);}(_0xc020,0x141));var _0x0c02=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0xc020[_0xb1cf84];return _0x4bad2e;};'use strict';var MailInteractionEvents=require(_0x0c02('0x0'));var events=[_0x0c02('0x1'),'remove',_0x0c02('0x2')];function createListener(_0x3c4177,_0x3d3829){return function(_0x2f78be){_0x3d3829[_0x0c02('0x3')](_0x3c4177,_0x2f78be);};}function removeListener(_0x11a809,_0x3f5b01){return function(){MailInteractionEvents[_0x0c02('0x4')](_0x11a809,_0x3f5b01);};}exports[_0x0c02('0x5')]=function(_0x3ecad8){for(var _0x48c113=0x0,_0x112d19=events[_0x0c02('0x6')];_0x48c113<_0x112d19;_0x48c113++){var _0x441c87=events[_0x48c113];var _0x48b8ed=createListener(_0x0c02('0x7')+_0x441c87,_0x3ecad8);MailInteractionEvents['on'](_0x441c87,_0x48b8ed);}}; \ No newline at end of file +var _0x1087=['remove','update','emit','register','length','mailInteraction:','save'];(function(_0xe8abcc,_0x11a5ca){var _0x2d2aa1=function(_0x24df51){while(--_0x24df51){_0xe8abcc['push'](_0xe8abcc['shift']());}};_0x2d2aa1(++_0x11a5ca);}(_0x1087,0x141));var _0x7108=function(_0x1ae337,_0x319658){_0x1ae337=_0x1ae337-0x0;var _0x1b9c6a=_0x1087[_0x1ae337];return _0x1b9c6a;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x7108('0x0'),_0x7108('0x1'),_0x7108('0x2')];function createListener(_0x5e3a77,_0x35a7fb){return function(_0x279890){_0x35a7fb[_0x7108('0x3')](_0x5e3a77,_0x279890);};}function removeListener(_0x53bd8f,_0x3f1fac){return function(){MailInteractionEvents['removeListener'](_0x53bd8f,_0x3f1fac);};}exports[_0x7108('0x4')]=function(_0x267ae1){for(var _0x14f2b9=0x0,_0xf3377f=events[_0x7108('0x5')];_0x14f2b9<_0xf3377f;_0x14f2b9++){var _0x36efff=events[_0x14f2b9];var _0x3031f0=createListener(_0x7108('0x6')+_0x36efff,_0x267ae1);MailInteractionEvents['on'](_0x36efff,_0x3031f0);}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/index.js b/server/api/mailInteractionHasTag/index.js index 2841d19..2ad7f2f 100644 --- a/server/api/mailInteractionHasTag/index.js +++ b/server/api/mailInteractionHasTag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda91=['express','../../components/auth/service','./mailInteractionHasTag.controller','get','/describe','exports'];(function(_0x36fdfc,_0xfec84f){var _0x277ec5=function(_0x14365b){while(--_0x14365b){_0x36fdfc['push'](_0x36fdfc['shift']());}};_0x277ec5(++_0xfec84f);}(_0xda91,0x72));var _0x1da9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xda91[_0x17d9e3];return _0x14192d;};'use strict';var express=require(_0x1da9('0x0'));var router=express['Router']();var auth=require(_0x1da9('0x1'));var controller=require(_0x1da9('0x2'));router[_0x1da9('0x3')](_0x1da9('0x4'),auth['isAuthenticated'](),controller['describe']);module[_0x1da9('0x5')]=router; \ No newline at end of file +var _0x4300=['describe','exports','express','/describe','isAuthenticated'];(function(_0x43c74f,_0x25a0d2){var _0x265ef6=function(_0x21d0dd){while(--_0x21d0dd){_0x43c74f['push'](_0x43c74f['shift']());}};_0x265ef6(++_0x25a0d2);}(_0x4300,0x1a6));var _0x0430=function(_0x31a133,_0x27fc33){_0x31a133=_0x31a133-0x0;var _0x4a3d17=_0x4300[_0x31a133];return _0x4a3d17;};'use strict';var express=require(_0x0430('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./mailInteractionHasTag.controller');router['get'](_0x0430('0x1'),auth[_0x0430('0x2')](),controller[_0x0430('0x3')]);module[_0x0430('0x4')]=router; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js index e9796c7..53d79b1 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x27bbbc,_0x1b36c4){var _0x169ad8=function(_0x494a7a){while(--_0x494a7a){_0x27bbbc['push'](_0x27bbbc['shift']());}};_0x169ad8(++_0x1b36c4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file +var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x1f58e7,_0x374c7d){var _0xf0e2a3=function(_0x3efd2e){while(--_0x3efd2e){_0x1f58e7['push'](_0x1f58e7['shift']());}};_0xf0e2a3(++_0x374c7d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.js index 295ff74..be457ba 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x401e=['INTEGER','sequelize'];(function(_0xf9eec5,_0x38a1d6){var _0x28b590=function(_0xf73c77){while(--_0xf73c77){_0xf9eec5['push'](_0xf9eec5['shift']());}};_0x28b590(++_0x38a1d6);}(_0x401e,0xc1));var _0xe401=function(_0x431979,_0x2b3eb6){_0x431979=_0x431979-0x0;var _0x731032=_0x401e[_0x431979];return _0x731032;};'use strict';var Sequelize=require(_0xe401('0x0'));module['exports']={'MailInteractionId':{'type':Sequelize[_0xe401('0x1')],'primaryKey':!![]},'TagId':{'type':Sequelize[_0xe401('0x1')],'defaultValue':null}}; \ No newline at end of file +var _0x946e=['INTEGER'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0x946e,0x74));var _0xe946=function(_0x4d3740,_0x191968){_0x4d3740=_0x4d3740-0x0;var _0x54f5d8=_0x946e[_0x4d3740];return _0x54f5d8;};'use strict';var Sequelize=require('sequelize');module['exports']={'MailInteractionId':{'type':Sequelize[_0xe946('0x0')],'primaryKey':!![]},'TagId':{'type':Sequelize[_0xe946('0x0')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js index bdf9343..2a1f454 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe389=['./mailInteractionHasTag','MailInteractionHasTag','mail_interaction_has_tags'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xe389,0x1cb));var _0x9e38=function(_0x46f836,_0x3f33c4){_0x46f836=_0x46f836-0x0;var _0x5b48d1=_0xe389[_0x46f836];return _0x5b48d1;};'use strict';var attributes=require(_0x9e38('0x0'));module['exports']=function(_0x2031de){return _0x2031de['define'](_0x9e38('0x1'),attributes,{'tableName':_0x9e38('0x2'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65cf=['exports','define','mail_interaction_has_tags','./mailInteractionHasTag'];(function(_0x2193f1,_0x4165dc){var _0x46a13a=function(_0xd7a138){while(--_0xd7a138){_0x2193f1['push'](_0x2193f1['shift']());}};_0x46a13a(++_0x4165dc);}(_0x65cf,0x17b));var _0xf65c=function(_0x374835,_0x47f481){_0x374835=_0x374835-0x0;var _0x222651=_0x65cf[_0x374835];return _0x222651;};'use strict';var attributes=require(_0xf65c('0x0'));module[_0xf65c('0x1')]=function(_0x4697e2){return _0x4697e2[_0xf65c('0x2')]('MailInteractionHasTag',attributes,{'tableName':_0xf65c('0x3'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index dd65fe6..8f7f31d 100644 --- a/server/api/mailMessage/index.js +++ b/server/api/mailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1730=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','show','download','post','tracked','mailmessage:create','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0xd304db,_0x1d6939){var _0x19a3dc=function(_0x20f35b){while(--_0x20f35b){_0xd304db['push'](_0xd304db['shift']());}};_0x19a3dc(++_0x1d6939);}(_0x1730,0xda));var _0x0173=function(_0x46859c,_0x2b2b9a){_0x46859c=_0x46859c-0x0;var _0xdf459=_0x1730[_0x46859c];return _0xdf459;};'use strict';var multer=require('multer');var util=require(_0x0173('0x0'));var path=require(_0x0173('0x1'));var timeout=require(_0x0173('0x2'));var express=require(_0x0173('0x3'));var router=express[_0x0173('0x4')]();var fs_extra=require(_0x0173('0x5'));var auth=require(_0x0173('0x6'));var interaction=require(_0x0173('0x7'));var config=require(_0x0173('0x8'));var controller=require(_0x0173('0x9'));router[_0x0173('0xa')]('/',auth[_0x0173('0xb')](),controller[_0x0173('0xc')]);router[_0x0173('0xa')](_0x0173('0xd'),auth[_0x0173('0xb')](),controller[_0x0173('0xe')]);router[_0x0173('0xa')]('/:id',auth[_0x0173('0xb')](),controller[_0x0173('0xf')]);router[_0x0173('0xa')]('/:id/download',auth[_0x0173('0xb')](),controller[_0x0173('0x10')]);router[_0x0173('0x11')]('/',auth[_0x0173('0xb')](),interaction[_0x0173('0x12')]('mail',_0x0173('0x13')),controller['create']);router[_0x0173('0x14')](_0x0173('0x15'),auth[_0x0173('0xb')](),controller['update']);router[_0x0173('0x14')](_0x0173('0x16'),auth[_0x0173('0xb')](),controller[_0x0173('0x17')]);router[_0x0173('0x14')](_0x0173('0x18'),auth[_0x0173('0xb')](),controller[_0x0173('0x19')]);router[_0x0173('0x1a')](_0x0173('0x15'),auth[_0x0173('0xb')](),controller['destroy']);module[_0x0173('0x1b')]=router; \ No newline at end of file +var _0x3402=['get','/describe','isAuthenticated','describe','show','/:id/download','post','mailmessage:create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0x3402,0x1f0));var _0x2340=function(_0x448b30,_0x46da3c){_0x448b30=_0x448b30-0x0;var _0x110419=_0x3402[_0x448b30];return _0x110419;};'use strict';var multer=require(_0x2340('0x0'));var util=require('util');var path=require(_0x2340('0x1'));var timeout=require(_0x2340('0x2'));var express=require(_0x2340('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2340('0x4'));var interaction=require(_0x2340('0x5'));var config=require(_0x2340('0x6'));var controller=require(_0x2340('0x7'));router[_0x2340('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2340('0x8')](_0x2340('0x9'),auth[_0x2340('0xa')](),controller[_0x2340('0xb')]);router[_0x2340('0x8')]('/:id',auth[_0x2340('0xa')](),controller[_0x2340('0xc')]);router[_0x2340('0x8')](_0x2340('0xd'),auth[_0x2340('0xa')](),controller['download']);router[_0x2340('0xe')]('/',auth[_0x2340('0xa')](),interaction['tracked']('mail',_0x2340('0xf')),controller['create']);router[_0x2340('0x10')]('/:id',auth[_0x2340('0xa')](),controller[_0x2340('0x11')]);router[_0x2340('0x10')](_0x2340('0x12'),auth[_0x2340('0xa')](),controller[_0x2340('0x13')]);router[_0x2340('0x10')]('/:id/reject',auth[_0x2340('0xa')](),controller[_0x2340('0x14')]);router[_0x2340('0x15')]('/:id',auth[_0x2340('0xa')](),controller[_0x2340('0x16')]);module[_0x2340('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 6cb099f..4aac4b2 100644 --- a/server/api/mailMessage/mailMessage.attributes.js +++ b/server/api/mailMessage/mailMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1fe1=['BOOLEAN','STRING','DATE','INTEGER','ENUM','Email','Chat','sequelize','lodash','exports','long','TEXT','medium'];(function(_0x320d1b,_0x4e4191){var _0x44a198=function(_0x3aa9ea){while(--_0x3aa9ea){_0x320d1b['push'](_0x320d1b['shift']());}};_0x44a198(++_0x4e4191);}(_0x1fe1,0xbd));var _0x11fe=function(_0x179b22,_0x177708){_0x179b22=_0x179b22-0x0;var _0x3850b9=_0x1fe1[_0x179b22];return _0x3850b9;};'use strict';var Sequelize=require(_0x11fe('0x0'));var _=require(_0x11fe('0x1'));module[_0x11fe('0x2')]={'body':{'type':Sequelize['TEXT'](_0x11fe('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x11fe('0x4')](_0x11fe('0x5'))},'read':{'type':Sequelize[_0x11fe('0x6')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x11fe('0x7')](0x1fe)},'from':{'type':Sequelize[_0x11fe('0x7')]},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize[_0x11fe('0x4')](_0x11fe('0x3'))},'bcc':{'type':Sequelize[_0x11fe('0x4')]('long')},'subject':{'type':Sequelize[_0x11fe('0x4')]},'sentAt':{'type':Sequelize[_0x11fe('0x8')]},'attach':{'type':Sequelize[_0x11fe('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x11fe('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x11fe('0x4')]('long')},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0x11fe('0xa')](_0x11fe('0xb'),_0x11fe('0xc')),'defaultValue':_0x11fe('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x02ca=['BOOLEAN','out','STRING','long','DATE','ENUM','Email','sequelize','lodash','exports','TEXT','medium'];(function(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0x02ca,0x13f));var _0xa02c=function(_0x590e43,_0x3bd0de){_0x590e43=_0x590e43-0x0;var _0x418510=_0x02ca[_0x590e43];return _0x418510;};'use strict';var Sequelize=require(_0xa02c('0x0'));var _=require(_0xa02c('0x1'));module[_0xa02c('0x2')]={'body':{'type':Sequelize[_0xa02c('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xa02c('0x3')](_0xa02c('0x4'))},'read':{'type':Sequelize[_0xa02c('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa02c('0x6')),'defaultValue':_0xa02c('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xa02c('0x7')]},'to':{'type':Sequelize[_0xa02c('0x3')]('long')},'cc':{'type':Sequelize[_0xa02c('0x3')](_0xa02c('0x8'))},'bcc':{'type':Sequelize[_0xa02c('0x3')](_0xa02c('0x8'))},'subject':{'type':Sequelize[_0xa02c('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xa02c('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xa02c('0x9')]},'originTo':{'type':Sequelize[_0xa02c('0x3')]('long')},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0xa02c('0xa')](_0xa02c('0xb'),'Chat'),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index b100912..e64e4d9 100644 --- a/server/api/mailMessage/mailMessage.controller.js +++ b/server/api/mailMessage/mailMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f5f=['SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','format','UserId','agent','isNil','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','SELECT','User','fullname','email','internal','manual','interface','channel','motionChannel','event','fromString','EventManager','acceptmessage','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','contact','SIP/%s','reject','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','eml-format','moment','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','end','sendStatus','name','send','index','map','MailMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','body','describe','create','direction','secret','split','findOne','MailAccountId','CmList','CmContact','updatedAt','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','List','Contacts','ListId','List\x20not\x20found'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0x6f5f,0xe7));var _0xf6f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f5f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf6f5('0x0'));var moment=require(_0xf6f5('0x1'));var BPromise=require(_0xf6f5('0x2'));var util=require(_0xf6f5('0x3'));var path=require('path');var fs=require('fs');var _=require(_0xf6f5('0x4'));var Redis=require(_0xf6f5('0x5'));var htmlToText=require(_0xf6f5('0x6'));var qs=require(_0xf6f5('0x7'));var logger=require(_0xf6f5('0x8'))(_0xf6f5('0x9'));var interaction_log=require(_0xf6f5('0x8'))('mail-interactions');var config=require('../../config/environment');var db=require(_0xf6f5('0xa'))['db'];config[_0xf6f5('0xb')]=_[_0xf6f5('0xc')](config[_0xf6f5('0xb')],{'host':_0xf6f5('0xd'),'port':0x18eb});var socket=require(_0xf6f5('0xe'))(new Redis(config[_0xf6f5('0xb')]));var htmlEntities=require(_0xf6f5('0xf'));require(_0xf6f5('0x10'))[_0xf6f5('0x11')](socket);var jayson=require(_0xf6f5('0x12'));var client=jayson[_0xf6f5('0x13')][_0xf6f5('0x14')]({'port':0x232c});var client9003=jayson[_0xf6f5('0x13')][_0xf6f5('0x14')]({'port':0x232b});var client9002=jayson[_0xf6f5('0x13')][_0xf6f5('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x44290c,_0x425822,_0x8d6f6,_0x125677){return new BPromise(function(_0x52c6e3,_0x244499){var _0x3afb95=_0x125677||client;return _0x3afb95['request'](_0x44290c,_0x8d6f6)[_0xf6f5('0x15')](function(_0x116a35){logger[_0xf6f5('0x16')]('MailMessage,\x20%s,\x20%s',_0x425822,_0xf6f5('0x17'));logger['debug'](_0xf6f5('0x18'),_0x425822,_0xf6f5('0x17'),JSON[_0xf6f5('0x19')](_0x116a35));if(_0x116a35[_0xf6f5('0x1a')]){if(_0x116a35[_0xf6f5('0x1a')]['code']===0x1f4){logger['error'](_0xf6f5('0x1b'),_0x425822,_0x116a35[_0xf6f5('0x1a')][_0xf6f5('0x1c')]);return _0x244499(_0x116a35[_0xf6f5('0x1a')][_0xf6f5('0x1c')]);}logger[_0xf6f5('0x1a')](_0xf6f5('0x1b'),_0x425822,_0x116a35['error'][_0xf6f5('0x1c')]);return _0x52c6e3(_0x116a35[_0xf6f5('0x1a')][_0xf6f5('0x1c')]);}else{logger['info'](_0xf6f5('0x1b'),_0x425822,_0xf6f5('0x17'));_0x52c6e3(_0x116a35[_0xf6f5('0x1d')][_0xf6f5('0x1c')]);}})[_0xf6f5('0x1e')](function(_0x667aad){logger[_0xf6f5('0x1a')](_0xf6f5('0x1b'),_0x425822,_0x667aad);_0x244499(_0x667aad);});});}function respondWithResult(_0x110a70,_0x3ff047){_0x3ff047=_0x3ff047||0xc8;return function(_0x5a3f42){if(_0x5a3f42){return _0x110a70[_0xf6f5('0x1f')](_0x3ff047)['json'](_0x5a3f42);}};}function respondWithFilteredResult(_0x3ebc64,_0x23ce20){return function(_0x457ffa){if(_0x457ffa){var _0x267a8d=typeof _0x23ce20[_0xf6f5('0x20')]===_0xf6f5('0x21')&&typeof _0x23ce20[_0xf6f5('0x22')]===_0xf6f5('0x21');var _0x23ff20=_0x457ffa[_0xf6f5('0x23')];var _0xb9cdfc=_0x267a8d?0x0:_0x23ce20[_0xf6f5('0x20')];var _0x25581b=_0x267a8d?_0x457ffa[_0xf6f5('0x23')]:_0x23ce20['offset']+_0x23ce20[_0xf6f5('0x22')];var _0x214a54;if(_0x25581b>=_0x23ff20){_0x25581b=_0x23ff20;_0x214a54=0xc8;}else{_0x214a54=0xce;}_0x3ebc64[_0xf6f5('0x1f')](_0x214a54);return _0x3ebc64[_0xf6f5('0x24')](_0xf6f5('0x25'),_0xb9cdfc+'-'+_0x25581b+'/'+_0x23ff20)[_0xf6f5('0x26')](_0x457ffa);}return null;};}function saveUpdates(_0x3eff6c){return function(_0x2b967c){if(_0x2b967c){return _0x2b967c[_0xf6f5('0x27')](_0x3eff6c)[_0xf6f5('0x15')](function(_0x58d4c2){return _0x58d4c2;});}return null;};}function removeEntity(_0x453d16){return function(_0x1b4a81){if(_0x1b4a81){return _0x1b4a81[_0xf6f5('0x28')]()['then'](function(){_0x453d16[_0xf6f5('0x1f')](0xcc)[_0xf6f5('0x29')]();});}};}function handleEntityNotFound(_0x3c39cb){return function(_0x55f938){if(!_0x55f938){_0x3c39cb[_0xf6f5('0x2a')](0x194);}return _0x55f938;};}function handleError(_0x4d79b5,_0x6caf31){_0x6caf31=_0x6caf31||0x1f4;return function(_0x366f6d){logger[_0xf6f5('0x1a')](_0x366f6d['stack']);if(_0x366f6d[_0xf6f5('0x2b')]){delete _0x366f6d['name'];}_0x4d79b5['status'](_0x6caf31)[_0xf6f5('0x2c')](_0x366f6d);};}exports[_0xf6f5('0x2d')]=function(_0x1282ec,_0x20bd23){var _0x532851={},_0x1eeb1={},_0x12bdf6={'count':0x0,'rows':[]};var _0x2fb31a=_[_0xf6f5('0x2e')](db[_0xf6f5('0x2f')]['rawAttributes'],function(_0x2f3c43){return{'name':_0x2f3c43[_0xf6f5('0x30')],'type':_0x2f3c43[_0xf6f5('0x31')][_0xf6f5('0x32')]};});_0x1eeb1[_0xf6f5('0x33')]=_[_0xf6f5('0x2e')](_0x2fb31a,_0xf6f5('0x2b'));_0x1eeb1[_0xf6f5('0x34')]=_[_0xf6f5('0x35')](_0x1282ec[_0xf6f5('0x34')]);_0x1eeb1[_0xf6f5('0x36')]=_[_0xf6f5('0x37')](_0x1eeb1['model'],_0x1eeb1['query']);_0x532851[_0xf6f5('0x38')]=_['intersection'](_0x1eeb1['model'],qs[_0xf6f5('0x39')](_0x1282ec[_0xf6f5('0x34')][_0xf6f5('0x39')]));_0x532851[_0xf6f5('0x38')]=_0x532851['attributes'][_0xf6f5('0x3a')]?_0x532851['attributes']:_0x1eeb1[_0xf6f5('0x33')];if(!_0x1282ec[_0xf6f5('0x34')][_0xf6f5('0x3b')]('nolimit')){_0x532851['limit']=qs[_0xf6f5('0x22')](_0x1282ec[_0xf6f5('0x34')][_0xf6f5('0x22')]);_0x532851['offset']=qs[_0xf6f5('0x20')](_0x1282ec[_0xf6f5('0x34')][_0xf6f5('0x20')]);}_0x532851['order']=qs[_0xf6f5('0x3c')](_0x1282ec['query'][_0xf6f5('0x3c')]);_0x532851[_0xf6f5('0x3d')]=qs[_0xf6f5('0x36')](_[_0xf6f5('0x3e')](_0x1282ec['query'],_0x1eeb1[_0xf6f5('0x36')]),_0x2fb31a);if(_0x1282ec['query'][_0xf6f5('0x3f')]){_0x532851[_0xf6f5('0x3d')]=_[_0xf6f5('0x40')](_0x532851[_0xf6f5('0x3d')],{'$or':_[_0xf6f5('0x2e')](_0x2fb31a,function(_0x2012d1){if(_0x2012d1[_0xf6f5('0x31')]!==_0xf6f5('0x41')){var _0x4381a5={};_0x4381a5[_0x2012d1[_0xf6f5('0x2b')]]={'$like':'%'+_0x1282ec[_0xf6f5('0x34')][_0xf6f5('0x3f')]+'%'};return _0x4381a5;}})});}_0x532851=_[_0xf6f5('0x40')]({},_0x532851,_0x1282ec[_0xf6f5('0x42')]);var _0x2a323a={'where':_0x532851[_0xf6f5('0x3d')]};return db[_0xf6f5('0x2f')][_0xf6f5('0x23')](_0x2a323a)[_0xf6f5('0x15')](function(_0x292934){_0x12bdf6['count']=_0x292934;if(_0x1282ec[_0xf6f5('0x34')][_0xf6f5('0x43')]){_0x532851['include']=[{'all':!![]}];}return db[_0xf6f5('0x2f')][_0xf6f5('0x44')](_0x532851);})[_0xf6f5('0x15')](function(_0x4c5036){_0x12bdf6[_0xf6f5('0x45')]=_0x4c5036;return _0x12bdf6;})['then'](respondWithFilteredResult(_0x20bd23,_0x532851))[_0xf6f5('0x1e')](handleError(_0x20bd23,null));};exports[_0xf6f5('0x46')]=function(_0x3a806a,_0x578c5d){var _0x41e7ba={'raw':!![],'where':{'id':_0x3a806a[_0xf6f5('0x47')]['id']}},_0x5845c7={};_0x5845c7[_0xf6f5('0x33')]=_[_0xf6f5('0x35')](db[_0xf6f5('0x2f')][_0xf6f5('0x48')]);_0x5845c7[_0xf6f5('0x34')]=_['keys'](_0x3a806a[_0xf6f5('0x34')]);_0x5845c7['filters']=_[_0xf6f5('0x37')](_0x5845c7[_0xf6f5('0x33')],_0x5845c7[_0xf6f5('0x34')]);_0x41e7ba[_0xf6f5('0x38')]=_[_0xf6f5('0x37')](_0x5845c7[_0xf6f5('0x33')],qs[_0xf6f5('0x39')](_0x3a806a['query'][_0xf6f5('0x39')]));_0x41e7ba[_0xf6f5('0x38')]=_0x41e7ba['attributes'][_0xf6f5('0x3a')]?_0x41e7ba['attributes']:_0x5845c7[_0xf6f5('0x33')];if(_0x3a806a[_0xf6f5('0x34')]['includeAll']){_0x41e7ba[_0xf6f5('0x49')]=[{'all':!![]}];}_0x41e7ba=_[_0xf6f5('0x40')]({},_0x41e7ba,_0x3a806a[_0xf6f5('0x42')]);return db[_0xf6f5('0x2f')][_0xf6f5('0x4a')](_0x41e7ba)[_0xf6f5('0x15')](handleEntityNotFound(_0x578c5d,null))[_0xf6f5('0x15')](respondWithResult(_0x578c5d,null))[_0xf6f5('0x1e')](handleError(_0x578c5d,null));};exports[_0xf6f5('0x27')]=function(_0x51e7f2,_0x288eb4){if(_0x51e7f2['body']['id']){delete _0x51e7f2['body']['id'];}return db[_0xf6f5('0x2f')]['find']({'where':{'id':_0x51e7f2[_0xf6f5('0x47')]['id']}})['then'](handleEntityNotFound(_0x288eb4,null))['then'](saveUpdates(_0x51e7f2[_0xf6f5('0x4b')],null))[_0xf6f5('0x15')](respondWithResult(_0x288eb4,null))[_0xf6f5('0x1e')](handleError(_0x288eb4,null));};exports[_0xf6f5('0x28')]=function(_0x19da56,_0x46621b){return db[_0xf6f5('0x2f')][_0xf6f5('0x4a')]({'where':{'id':_0x19da56[_0xf6f5('0x47')]['id']}})[_0xf6f5('0x15')](handleEntityNotFound(_0x46621b,null))[_0xf6f5('0x15')](removeEntity(_0x46621b,null))[_0xf6f5('0x1e')](handleError(_0x46621b,null));};exports[_0xf6f5('0x4c')]=function(_0x1b59dd,_0x49cb6f){return db[_0xf6f5('0x2f')]['describe']()['then'](respondWithResult(_0x49cb6f,null))[_0xf6f5('0x1e')](handleError(_0x49cb6f,null));};exports[_0xf6f5('0x4d')]=function(_0x282165,_0x1f110a){return db[_0xf6f5('0x2f')][_0xf6f5('0x4d')](_0x282165[_0xf6f5('0x4b')])[_0xf6f5('0x15')](function(_0x5eaad1){if(_0x5eaad1){if(_0x5eaad1[_0xf6f5('0x4e')]==='out'&&!_0x5eaad1[_0xf6f5('0x4f')]){var _0x3a49e4,_0x51a1ba,_0x8c9356;if(_0x282165[_0xf6f5('0x4b')]['to']){_0x51a1ba=_0x282165[_0xf6f5('0x4b')]['to'][_0xf6f5('0x50')](',')[0x0];}return db['MailAccount'][_0xf6f5('0x51')]({'where':{'id':_0x5eaad1[_0xf6f5('0x52')]},'include':[{'model':db[_0xf6f5('0x53')],'as':'List','include':[{'model':db[_0xf6f5('0x54')],'as':'Contacts','where':{'email':_0x51a1ba},'limit':0x1,'order':[[_0xf6f5('0x55'),'DESC']]}]},{'model':db[_0xf6f5('0x56')],'as':_0xf6f5('0x57'),'raw':!![],'include':[{'model':db[_0xf6f5('0x58')],'as':_0xf6f5('0x58'),'raw':!![]}]}]})[_0xf6f5('0x15')](function(_0x16731b){_0x3a49e4=_0x16731b;if(!_0x3a49e4||!_0x3a49e4['Smtp'])return;var _0x187961=_0x3a49e4[_0xf6f5('0x59')]();if(_0x282165['body'][_0xf6f5('0x5a')]&&_0x282165[_0xf6f5('0x4b')]['attachments']['length']){for(var _0x4853b4=0x0;_0x4853b4<_0x282165[_0xf6f5('0x4b')]['attachments']['length'];_0x4853b4+=0x1){_0x282165[_0xf6f5('0x4b')][_0xf6f5('0x5a')][_0x4853b4]={'filename':_0x282165[_0xf6f5('0x4b')]['attachments'][_0x4853b4]['name'],'path':path[_0xf6f5('0x5b')](config[_0xf6f5('0x5c')],_0xf6f5('0x5d'),_0x282165[_0xf6f5('0x4b')][_0xf6f5('0x5a')][_0x4853b4][_0xf6f5('0x5e')])};}}_0x8c9356={'account':_0x187961,'message':_0x282165[_0xf6f5('0x4b')]};return;})[_0xf6f5('0x15')](function(){if(_0x3a49e4[_0xf6f5('0x5f')]){if(_0x3a49e4[_0xf6f5('0x5f')]['Contacts'][_0xf6f5('0x3a')]){return _0x3a49e4['List'][_0xf6f5('0x60')][0x0];}else{return db[_0xf6f5('0x54')]['create'](_['defaults'](_0x282165[_0xf6f5('0x4b')],{'firstName':_0x282165['body']['to'],'email':_0x282165[_0xf6f5('0x4b')]['to'],'phone':_0x282165['body']['to'],'ListId':_0x3a49e4[_0xf6f5('0x61')]}));}}else{throw new Error(_0xf6f5('0x62'));}})[_0xf6f5('0x15')](function(){if(_0x8c9356){return respondWithRpcPromise(_0xf6f5('0x63'),_0xf6f5('0x64'),_0x8c9356,client9003)['then'](function(_0x3cf39c){return _0x5eaad1['update']({'read':!![],'messageId':_0x3cf39c[_0xf6f5('0x65')],'sentAt':moment()['format'](_0xf6f5('0x66'))});})[_0xf6f5('0x1e')](function(_0x5e9791){logger[_0xf6f5('0x1a')]('%s',JSON[_0xf6f5('0x19')](_0x5e9791));return _0x5eaad1;});}return _0x5eaad1;});}return _0x5eaad1;}})['then'](respondWithResult(_0x1f110a,0xc9))[_0xf6f5('0x1e')](handleError(_0x1f110a,null));};exports[_0xf6f5('0x67')]=function(_0x5e9743,_0x2fa2b8){var _0x377c13={'agent':{},'channel':_0xf6f5('0x68')};if(_0x5e9743[_0xf6f5('0x4b')]['id']){delete _0x5e9743[_0xf6f5('0x4b')]['id'];}_0x5e9743[_0xf6f5('0x4b')]['read']=!![];_0x5e9743[_0xf6f5('0x4b')][_0xf6f5('0x69')]=moment()[_0xf6f5('0x6a')](_0xf6f5('0x66'));_0x5e9743['body']['UserId']=_0x5e9743[_0xf6f5('0x4b')][_0xf6f5('0x6b')]||_0x5e9743['user']['id'];_0x377c13[_0xf6f5('0x6c')]['id']=_0x5e9743[_0xf6f5('0x4b')][_0xf6f5('0x6b')];return db[_0xf6f5('0x2f')][_0xf6f5('0x4a')]({'where':{'id':_0x5e9743[_0xf6f5('0x47')]['id'],'UserId':null}})[_0xf6f5('0x15')](handleEntityNotFound(_0x2fa2b8,null))[_0xf6f5('0x15')](saveUpdates(_0x5e9743[_0xf6f5('0x4b')],null))['then'](function(_0x4f0513){if(_0x4f0513){_0x377c13['message']=_0x4f0513['get']({'plain':!![]});return db['MailInteraction'][_0xf6f5('0x4a')]({'where':{'id':_0x4f0513['MailInteractionId']}});}return null;})[_0xf6f5('0x15')](handleEntityNotFound(_0x2fa2b8,null))[_0xf6f5('0x15')](function(_0x2999d2){if(_0x2999d2){return _0x2999d2[_0xf6f5('0x27')]({'UserId':_0x5e9743['body'][_0xf6f5('0x6b')],'read1stAt':_[_0xf6f5('0x6d')](_0x2999d2[_0xf6f5('0x6e')])?moment()[_0xf6f5('0x6a')](_0xf6f5('0x66')):undefined});}return null;})[_0xf6f5('0x15')](function(_0x5da973){if(_0x5da973){_0x377c13[_0xf6f5('0x6f')]=_0x5da973[_0xf6f5('0x70')]({'plain':!![]});interaction_log[_0xf6f5('0x16')](_0xf6f5('0x71'),_0x5e9743[_0xf6f5('0x72')]['id'],_0x5e9743[_0xf6f5('0x72')]['name'],_0x5e9743[_0xf6f5('0x72')][_0xf6f5('0x73')],_0x377c13[_0xf6f5('0x6f')]['id'],_0x5e9743[_0xf6f5('0x4b')]?JSON['stringify'](_0x5e9743[_0xf6f5('0x4b')]):_0xf6f5('0x74'));return respondWithRpcPromise(_0xf6f5('0x75'),_0xf6f5('0x76'),_0x377c13);}return null;})[_0xf6f5('0x15')](function(_0x3c42ba){var _0x4a77af='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3c42ba[_0xf6f5('0x1c')][_0xf6f5('0x77')];return db['sequelize']['query'](_0x4a77af,{'type':db[_0xf6f5('0x78')]['QueryTypes'][_0xf6f5('0x79')],'raw':!![]})[_0xf6f5('0x15')](function(_0x405c85){return _0x405c85;});})[_0xf6f5('0x15')](function(_0x308364){if(_0x308364){_0x377c13[_0xf6f5('0x1c')]['contact']=_0x308364[0x0];if(!_0x5e9743[_0xf6f5('0x4b')][_0xf6f5('0x6b')])return;return db[_0xf6f5('0x7a')]['find']({'where':{'id':_0x5e9743[_0xf6f5('0x4b')][_0xf6f5('0x6b')],'role':_0xf6f5('0x6c')},'attributes':['id',_0xf6f5('0x2b'),_0xf6f5('0x7b'),_0xf6f5('0x7c'),_0xf6f5('0x7d')],'raw':!![]});}return null;})[_0xf6f5('0x15')](function(_0x5b898c){if(!_0x5b898c)return null;_0x377c13[_0xf6f5('0x1c')]['agent']=_0x5b898c;return _0x377c13;})[_0xf6f5('0x15')](function(_0x1ed6ca){if(_0x1ed6ca){if(_0x5e9743[_0xf6f5('0x4b')][_0xf6f5('0x7e')]){_0x377c13[_0xf6f5('0x1c')][_0xf6f5('0x7f')]=util[_0xf6f5('0x6a')]('SIP/%s',_0x5e9743[_0xf6f5('0x72')]['name']);_0x377c13[_0xf6f5('0x1c')]['channel']=_0x377c13[_0xf6f5('0x80')];_0x377c13[_0xf6f5('0x1c')][_0xf6f5('0x81')]=_0x377c13['channel'];_0x377c13['message'][_0xf6f5('0x82')]=_0xf6f5('0x67');_0x377c13[_0xf6f5('0x1c')][_0xf6f5('0x4b')]=htmlToText[_0xf6f5('0x83')](_0x377c13[_0xf6f5('0x1c')][_0xf6f5('0x4b')]);return respondWithRpcPromise('EventManager',_0xf6f5('0x84'),{'event':_0xf6f5('0x85'),'message':_0x377c13[_0xf6f5('0x1c')]},client9002)[_0xf6f5('0x15')](function(){return _0x377c13;});}return _0x377c13;}return null;})[_0xf6f5('0x15')](respondWithResult(_0x2fa2b8,null))[_0xf6f5('0x1e')](handleError(_0x2fa2b8,null));};exports['reject']=function(_0x1bbb98,_0x12acc4){var _0x512c5b={'agent':{},'channel':'mail'};if(_0x1bbb98[_0xf6f5('0x4b')]['id']){delete _0x1bbb98['body']['id'];}_0x1bbb98[_0xf6f5('0x4b')]['UserId']=_0x1bbb98[_0xf6f5('0x4b')]['UserId']||_0x1bbb98['user']['id'];_0x512c5b[_0xf6f5('0x6c')]['id']=_0x1bbb98['body'][_0xf6f5('0x6b')];return db[_0xf6f5('0x2f')]['find']({'where':{'id':_0x1bbb98['params']['id'],'UserId':null}})[_0xf6f5('0x15')](handleEntityNotFound(_0x12acc4,null))[_0xf6f5('0x15')](function(_0x4673fc){if(_0x4673fc){_0x512c5b[_0xf6f5('0x1c')]=_0x4673fc[_0xf6f5('0x70')]({'plain':!![]});return db[_0xf6f5('0x86')][_0xf6f5('0x4a')]({'where':{'id':_0x4673fc['MailInteractionId']}});}return null;})[_0xf6f5('0x15')](handleEntityNotFound(_0x12acc4,null))[_0xf6f5('0x15')](function(_0x4a8c4b){if(_0x4a8c4b){_0x512c5b[_0xf6f5('0x6f')]=_0x4a8c4b['get']({'plain':!![]});interaction_log[_0xf6f5('0x16')](_0xf6f5('0x87'),_0x1bbb98[_0xf6f5('0x72')]['id'],_0x1bbb98[_0xf6f5('0x72')][_0xf6f5('0x2b')],_0x1bbb98[_0xf6f5('0x72')][_0xf6f5('0x73')],_0x512c5b['interaction']['id'],_0x1bbb98[_0xf6f5('0x4b')]?JSON[_0xf6f5('0x19')](_0x1bbb98[_0xf6f5('0x4b')]):'null');return respondWithRpcPromise(_0xf6f5('0x88'),_0xf6f5('0x89'),_0x512c5b);}return null;})['then'](function(_0x227a6f){var _0x3218c2=_0xf6f5('0x8a')+_0x227a6f[_0xf6f5('0x1c')][_0xf6f5('0x77')];return db[_0xf6f5('0x8b')][_0xf6f5('0x34')](_0x3218c2,{'type':db['Sequelize'][_0xf6f5('0x8c')][_0xf6f5('0x79')],'raw':!![]})[_0xf6f5('0x15')](function(_0x474dcb){return _0x474dcb;});})['then'](function(_0x551c42){if(_0x551c42){_0x512c5b['message'][_0xf6f5('0x8d')]=_0x551c42[0x0];if(!_0x1bbb98['body'][_0xf6f5('0x6b')])return;return db[_0xf6f5('0x7a')][_0xf6f5('0x4a')]({'where':{'id':_0x1bbb98[_0xf6f5('0x4b')][_0xf6f5('0x6b')],'role':_0xf6f5('0x6c')},'attributes':['id',_0xf6f5('0x2b'),'fullname',_0xf6f5('0x7c'),_0xf6f5('0x7d')],'raw':!![]});}return null;})[_0xf6f5('0x15')](function(_0x47b628){if(!_0x47b628)return null;_0x512c5b[_0xf6f5('0x1c')][_0xf6f5('0x6c')]=_0x47b628;return _0x512c5b;})['then'](function(_0x171b11){if(_0x171b11){_0x171b11[_0xf6f5('0x1c')][_0xf6f5('0x7f')]=util[_0xf6f5('0x6a')](_0xf6f5('0x8e'),_0x1bbb98[_0xf6f5('0x72')]['name']);_0x171b11[_0xf6f5('0x1c')][_0xf6f5('0x80')]=_0x512c5b[_0xf6f5('0x80')];_0x171b11[_0xf6f5('0x1c')][_0xf6f5('0x81')]=_0x512c5b['channel'];_0x171b11['message'][_0xf6f5('0x82')]=_0xf6f5('0x8f');_0x171b11[_0xf6f5('0x1c')][_0xf6f5('0x4b')]=htmlToText['fromString'](_0x512c5b['message']['body']);respondWithRpcPromise(_0xf6f5('0x84'),_0xf6f5('0x84'),{'event':_0xf6f5('0x90'),'message':_0x171b11[_0xf6f5('0x1c')]},client9002);return _0x512c5b;}return null;})['then'](respondWithResult(_0x12acc4,null))[_0xf6f5('0x1e')](handleError(_0x12acc4,null));};exports[_0xf6f5('0x91')]=function(_0x55654b,_0x1131ff){var _0x819147=moment()[_0xf6f5('0x92')]()[_0xf6f5('0x93')]();var _0x5ca623=path[_0xf6f5('0x5b')](config[_0xf6f5('0x5c')],_0xf6f5('0x94'),_0xf6f5('0x95'),_0xf6f5('0x96'));var _0x40d344=path['join'](config[_0xf6f5('0x5c')],_0xf6f5('0x94'),_0xf6f5('0x95'),_0xf6f5('0x5a'));var _0x1c197d=util[_0xf6f5('0x6a')](_0xf6f5('0x97'),_0x819147);return db['MailMessage'][_0xf6f5('0x4a')]({'where':{'id':_0x55654b[_0xf6f5('0x47')]['id']},'attributes':['id','body',_0xf6f5('0x98'),'to','cc',_0xf6f5('0x99'),_0xf6f5('0x9a'),_0xf6f5('0x9b')],'include':_0x55654b[_0xf6f5('0x34')][_0xf6f5('0x5a')]?[{'model':db['Attachment'],'as':_0xf6f5('0x9c')}]:undefined})['then'](handleEntityNotFound(_0x1131ff,null))['then'](function(_0x3cd256){if(_0x3cd256){var _0x552b97=_0x3cd256;var _0x306bab={'from':_0x552b97[_0xf6f5('0x98')],'to':_0x552b97['to'],'subject':_0x552b97[_0xf6f5('0x9a')],'html':htmlEntities['decode'](_0x552b97[_0xf6f5('0x4b')]),'headers':{'Date':moment(_0x552b97[_0xf6f5('0x9b')])['format'](_0xf6f5('0x9d'))},'attachments':[]};if(_0x3cd256['cc']){_0x306bab[_0xf6f5('0x9e')]['Cc']=_0x3cd256['cc'];}if(_0x3cd256['bcc']){_0x306bab[_0xf6f5('0x9e')][_0xf6f5('0x9f')]=_0x3cd256[_0xf6f5('0x99')];}return new BPromise(function(_0x5ef2d1,_0x366949){if(_0x3cd256[_0xf6f5('0x9c')]){for(var _0x2d1088=0x0;_0x2d1088<_0x3cd256[_0xf6f5('0x9c')]['length'];_0x2d1088++){var _0x48b63e=_0x3cd256[_0xf6f5('0x9c')][_0x2d1088];var _0xb59982=path['join'](_0x40d344,_0x48b63e[_0xf6f5('0x5e')]);if(fs[_0xf6f5('0xa0')](_0xb59982)){_0x306bab[_0xf6f5('0x5a')][_0xf6f5('0xa1')]({'name':_0x48b63e[_0xf6f5('0x2b')],'contentType':_0x48b63e[_0xf6f5('0x31')],'data':fs[_0xf6f5('0xa2')](_0xb59982)});}}}emlformat[_0xf6f5('0xa3')](_0x306bab,function(_0x436e35,_0x34fafb){if(_0x436e35)return _0x366949(_0x436e35);fs[_0xf6f5('0xa4')](path[_0xf6f5('0x5b')](_0x5ca623,_0x1c197d),_0x34fafb);return _0x5ef2d1(_0x34fafb);});});}})['then'](function(_0x4fd545){if(_0x4fd545){return _0x1131ff[_0xf6f5('0x91')](path[_0xf6f5('0x5b')](_0x5ca623,_0x1c197d),_0x1c197d,function(_0x55b36e){if(!_0x55b36e)fs['unlinkSync'](path[_0xf6f5('0x5b')](_0x5ca623,_0x1c197d));});}})[_0xf6f5('0x1e')](handleError(_0x1131ff,null));}; \ No newline at end of file +var _0x831d=['[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','internal','interface','rejectmessage','toString','server','files','tmp','message-%s.eml','from','Attachment','Attachments','subject','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','push','readFileSync','build','writeFileSync','download','eml-format','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','html-entities','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','end','send','index','map','MailMessage','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','name','includeAll','include','findAll','show','params','rawAttributes','intersection','body','find','describe','create','direction','out','secret','split','MailAccount','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','format','UserId','user','agent','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','manual','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','MailInteraction','MailInteractionId'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0x831d,0xb9));var _0xd831=function(_0x5aed32,_0x2a5832){_0x5aed32=_0x5aed32-0x0;var _0x4d897f=_0x831d[_0x5aed32];return _0x4d897f;};'use strict';var emlformat=require(_0xd831('0x0'));var moment=require('moment');var BPromise=require(_0xd831('0x1'));var util=require(_0xd831('0x2'));var path=require(_0xd831('0x3'));var fs=require('fs');var _=require(_0xd831('0x4'));var Redis=require(_0xd831('0x5'));var htmlToText=require('html-to-text');var qs=require(_0xd831('0x6'));var logger=require(_0xd831('0x7'))(_0xd831('0x8'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require(_0xd831('0x9'));var db=require(_0xd831('0xa'))['db'];config['redis']=_[_0xd831('0xb')](config[_0xd831('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd831('0xc')]));var htmlEntities=require(_0xd831('0xd'));require('./mailMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9003=jayson[_0xd831('0xe')][_0xd831('0xf')]({'port':0x232b});var client9002=jayson['client'][_0xd831('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x56ae63,_0x4b52c5,_0x1db300,_0x11f344){return new BPromise(function(_0xd13f22,_0xceed0b){var _0x5b4e6d=_0x11f344||client;return _0x5b4e6d[_0xd831('0x10')](_0x56ae63,_0x1db300)['then'](function(_0x68608e){logger[_0xd831('0x11')](_0xd831('0x12'),_0x4b52c5,_0xd831('0x13'));logger[_0xd831('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x4b52c5,_0xd831('0x13'),JSON[_0xd831('0x15')](_0x68608e));if(_0x68608e[_0xd831('0x16')]){if(_0x68608e[_0xd831('0x16')]['code']===0x1f4){logger[_0xd831('0x16')](_0xd831('0x12'),_0x4b52c5,_0x68608e[_0xd831('0x16')][_0xd831('0x17')]);return _0xceed0b(_0x68608e['error'][_0xd831('0x17')]);}logger[_0xd831('0x16')](_0xd831('0x12'),_0x4b52c5,_0x68608e[_0xd831('0x16')]['message']);return _0xd13f22(_0x68608e[_0xd831('0x16')][_0xd831('0x17')]);}else{logger[_0xd831('0x11')](_0xd831('0x12'),_0x4b52c5,_0xd831('0x13'));_0xd13f22(_0x68608e[_0xd831('0x18')]['message']);}})[_0xd831('0x19')](function(_0x17647c){logger[_0xd831('0x16')]('MailMessage,\x20%s,\x20%s',_0x4b52c5,_0x17647c);_0xceed0b(_0x17647c);});});}function respondWithResult(_0x55f19f,_0x20762e){_0x20762e=_0x20762e||0xc8;return function(_0x447960){if(_0x447960){return _0x55f19f[_0xd831('0x1a')](_0x20762e)[_0xd831('0x1b')](_0x447960);}};}function respondWithFilteredResult(_0x4e51a3,_0x1aba84){return function(_0x3b4566){if(_0x3b4566){var _0x13b28d=typeof _0x1aba84[_0xd831('0x1c')]===_0xd831('0x1d')&&typeof _0x1aba84['limit']===_0xd831('0x1d');var _0x43c856=_0x3b4566[_0xd831('0x1e')];var _0x1e0810=_0x13b28d?0x0:_0x1aba84[_0xd831('0x1c')];var _0x4adf7a=_0x13b28d?_0x3b4566[_0xd831('0x1e')]:_0x1aba84[_0xd831('0x1c')]+_0x1aba84[_0xd831('0x1f')];var _0x54e5d1;if(_0x4adf7a>=_0x43c856){_0x4adf7a=_0x43c856;_0x54e5d1=0xc8;}else{_0x54e5d1=0xce;}_0x4e51a3['status'](_0x54e5d1);return _0x4e51a3[_0xd831('0x20')](_0xd831('0x21'),_0x1e0810+'-'+_0x4adf7a+'/'+_0x43c856)[_0xd831('0x1b')](_0x3b4566);}return null;};}function saveUpdates(_0x4ec314){return function(_0x41ea30){if(_0x41ea30){return _0x41ea30[_0xd831('0x22')](_0x4ec314)[_0xd831('0x23')](function(_0x3e51e2){return _0x3e51e2;});}return null;};}function removeEntity(_0x449d9d){return function(_0x530529){if(_0x530529){return _0x530529[_0xd831('0x24')]()[_0xd831('0x23')](function(){_0x449d9d['status'](0xcc)[_0xd831('0x25')]();});}};}function handleEntityNotFound(_0x43579c){return function(_0x3a4931){if(!_0x3a4931){_0x43579c['sendStatus'](0x194);}return _0x3a4931;};}function handleError(_0x44f801,_0x3e9a7e){_0x3e9a7e=_0x3e9a7e||0x1f4;return function(_0x294474){logger[_0xd831('0x16')](_0x294474['stack']);if(_0x294474['name']){delete _0x294474['name'];}_0x44f801['status'](_0x3e9a7e)[_0xd831('0x26')](_0x294474);};}exports[_0xd831('0x27')]=function(_0x4eaa2c,_0x40d575){var _0x576c98={},_0x444d7d={},_0x285cd0={'count':0x0,'rows':[]};var _0x138d32=_[_0xd831('0x28')](db[_0xd831('0x29')]['rawAttributes'],function(_0x2ae130){return{'name':_0x2ae130[_0xd831('0x2a')],'type':_0x2ae130[_0xd831('0x2b')][_0xd831('0x2c')]};});_0x444d7d[_0xd831('0x2d')]=_['map'](_0x138d32,'name');_0x444d7d[_0xd831('0x2e')]=_[_0xd831('0x2f')](_0x4eaa2c[_0xd831('0x2e')]);_0x444d7d[_0xd831('0x30')]=_['intersection'](_0x444d7d['model'],_0x444d7d[_0xd831('0x2e')]);_0x576c98[_0xd831('0x31')]=_['intersection'](_0x444d7d[_0xd831('0x2d')],qs[_0xd831('0x32')](_0x4eaa2c[_0xd831('0x2e')][_0xd831('0x32')]));_0x576c98[_0xd831('0x31')]=_0x576c98[_0xd831('0x31')][_0xd831('0x33')]?_0x576c98[_0xd831('0x31')]:_0x444d7d[_0xd831('0x2d')];if(!_0x4eaa2c[_0xd831('0x2e')][_0xd831('0x34')]('nolimit')){_0x576c98['limit']=qs[_0xd831('0x1f')](_0x4eaa2c[_0xd831('0x2e')][_0xd831('0x1f')]);_0x576c98[_0xd831('0x1c')]=qs[_0xd831('0x1c')](_0x4eaa2c[_0xd831('0x2e')][_0xd831('0x1c')]);}_0x576c98[_0xd831('0x35')]=qs['sort'](_0x4eaa2c[_0xd831('0x2e')][_0xd831('0x36')]);_0x576c98[_0xd831('0x37')]=qs[_0xd831('0x30')](_[_0xd831('0x38')](_0x4eaa2c[_0xd831('0x2e')],_0x444d7d[_0xd831('0x30')]),_0x138d32);if(_0x4eaa2c['query'][_0xd831('0x39')]){_0x576c98[_0xd831('0x37')]=_[_0xd831('0x3a')](_0x576c98[_0xd831('0x37')],{'$or':_[_0xd831('0x28')](_0x138d32,function(_0x39e904){if(_0x39e904[_0xd831('0x2b')]!=='VIRTUAL'){var _0x7302d5={};_0x7302d5[_0x39e904[_0xd831('0x3b')]]={'$like':'%'+_0x4eaa2c[_0xd831('0x2e')][_0xd831('0x39')]+'%'};return _0x7302d5;}})});}_0x576c98=_[_0xd831('0x3a')]({},_0x576c98,_0x4eaa2c['options']);var _0x28893b={'where':_0x576c98[_0xd831('0x37')]};return db['MailMessage'][_0xd831('0x1e')](_0x28893b)[_0xd831('0x23')](function(_0x445369){_0x285cd0[_0xd831('0x1e')]=_0x445369;if(_0x4eaa2c[_0xd831('0x2e')][_0xd831('0x3c')]){_0x576c98[_0xd831('0x3d')]=[{'all':!![]}];}return db[_0xd831('0x29')][_0xd831('0x3e')](_0x576c98);})[_0xd831('0x23')](function(_0x3f12d0){_0x285cd0['rows']=_0x3f12d0;return _0x285cd0;})[_0xd831('0x23')](respondWithFilteredResult(_0x40d575,_0x576c98))[_0xd831('0x19')](handleError(_0x40d575,null));};exports[_0xd831('0x3f')]=function(_0x5598ed,_0x17e1ce){var _0x162324={'raw':!![],'where':{'id':_0x5598ed[_0xd831('0x40')]['id']}},_0x40f580={};_0x40f580[_0xd831('0x2d')]=_[_0xd831('0x2f')](db[_0xd831('0x29')][_0xd831('0x41')]);_0x40f580[_0xd831('0x2e')]=_[_0xd831('0x2f')](_0x5598ed[_0xd831('0x2e')]);_0x40f580[_0xd831('0x30')]=_['intersection'](_0x40f580[_0xd831('0x2d')],_0x40f580['query']);_0x162324['attributes']=_[_0xd831('0x42')](_0x40f580[_0xd831('0x2d')],qs[_0xd831('0x32')](_0x5598ed[_0xd831('0x2e')][_0xd831('0x32')]));_0x162324['attributes']=_0x162324['attributes'][_0xd831('0x33')]?_0x162324[_0xd831('0x31')]:_0x40f580[_0xd831('0x2d')];if(_0x5598ed['query'][_0xd831('0x3c')]){_0x162324[_0xd831('0x3d')]=[{'all':!![]}];}_0x162324=_['merge']({},_0x162324,_0x5598ed['options']);return db[_0xd831('0x29')]['find'](_0x162324)[_0xd831('0x23')](handleEntityNotFound(_0x17e1ce,null))[_0xd831('0x23')](respondWithResult(_0x17e1ce,null))['catch'](handleError(_0x17e1ce,null));};exports[_0xd831('0x22')]=function(_0x30ee65,_0x5cfc8e){if(_0x30ee65[_0xd831('0x43')]['id']){delete _0x30ee65[_0xd831('0x43')]['id'];}return db['MailMessage'][_0xd831('0x44')]({'where':{'id':_0x30ee65[_0xd831('0x40')]['id']}})[_0xd831('0x23')](handleEntityNotFound(_0x5cfc8e,null))['then'](saveUpdates(_0x30ee65[_0xd831('0x43')],null))[_0xd831('0x23')](respondWithResult(_0x5cfc8e,null))[_0xd831('0x19')](handleError(_0x5cfc8e,null));};exports['destroy']=function(_0x57b160,_0x52e7d7){return db[_0xd831('0x29')]['find']({'where':{'id':_0x57b160['params']['id']}})[_0xd831('0x23')](handleEntityNotFound(_0x52e7d7,null))[_0xd831('0x23')](removeEntity(_0x52e7d7,null))[_0xd831('0x19')](handleError(_0x52e7d7,null));};exports[_0xd831('0x45')]=function(_0xeae3f7,_0x2d74c8){return db[_0xd831('0x29')][_0xd831('0x45')]()[_0xd831('0x23')](respondWithResult(_0x2d74c8,null))[_0xd831('0x19')](handleError(_0x2d74c8,null));};exports[_0xd831('0x46')]=function(_0x3fe9ff,_0x1838cd){return db[_0xd831('0x29')]['create'](_0x3fe9ff[_0xd831('0x43')])[_0xd831('0x23')](function(_0x17db93){if(_0x17db93){if(_0x17db93[_0xd831('0x47')]===_0xd831('0x48')&&!_0x17db93[_0xd831('0x49')]){var _0x545279,_0x3f7b76,_0x22cd5d;if(_0x3fe9ff[_0xd831('0x43')]['to']){_0x3f7b76=_0x3fe9ff[_0xd831('0x43')]['to'][_0xd831('0x4a')](',')[0x0];}return db[_0xd831('0x4b')]['findOne']({'where':{'id':_0x17db93[_0xd831('0x4c')]},'include':[{'model':db[_0xd831('0x4d')],'as':_0xd831('0x4e'),'include':[{'model':db[_0xd831('0x4f')],'as':_0xd831('0x50'),'where':{'email':_0x3f7b76},'limit':0x1,'order':[[_0xd831('0x51'),_0xd831('0x52')]]}]},{'model':db[_0xd831('0x53')],'as':_0xd831('0x54'),'raw':!![],'include':[{'model':db[_0xd831('0x55')],'as':_0xd831('0x55'),'raw':!![]}]}]})[_0xd831('0x23')](function(_0x2bfa5f){_0x545279=_0x2bfa5f;if(!_0x545279||!_0x545279[_0xd831('0x54')])return;var _0x5a59d3=_0x545279[_0xd831('0x56')]();if(_0x3fe9ff[_0xd831('0x43')][_0xd831('0x57')]&&_0x3fe9ff['body']['attachments'][_0xd831('0x33')]){for(var _0x514c61=0x0;_0x514c61<_0x3fe9ff[_0xd831('0x43')][_0xd831('0x57')][_0xd831('0x33')];_0x514c61+=0x1){_0x3fe9ff['body'][_0xd831('0x57')][_0x514c61]={'filename':_0x3fe9ff[_0xd831('0x43')][_0xd831('0x57')][_0x514c61][_0xd831('0x3b')],'path':path[_0xd831('0x58')](config[_0xd831('0x59')],_0xd831('0x5a'),_0x3fe9ff[_0xd831('0x43')][_0xd831('0x57')][_0x514c61][_0xd831('0x5b')])};}}_0x22cd5d={'account':_0x5a59d3,'message':_0x3fe9ff[_0xd831('0x43')]};return;})[_0xd831('0x23')](function(){if(_0x545279['List']){if(_0x545279[_0xd831('0x4e')][_0xd831('0x50')][_0xd831('0x33')]){return _0x545279[_0xd831('0x4e')][_0xd831('0x50')][0x0];}else{return db['CmContact'][_0xd831('0x46')](_[_0xd831('0xb')](_0x3fe9ff[_0xd831('0x43')],{'firstName':_0x3fe9ff[_0xd831('0x43')]['to'],'email':_0x3fe9ff[_0xd831('0x43')]['to'],'phone':_0x3fe9ff[_0xd831('0x43')]['to'],'ListId':_0x545279[_0xd831('0x5c')]}));}}else{throw new Error(_0xd831('0x5d'));}})[_0xd831('0x23')](function(){if(_0x22cd5d){return respondWithRpcPromise(_0xd831('0x5e'),_0xd831('0x5f'),_0x22cd5d,client9003)[_0xd831('0x23')](function(_0x2b93e0){return _0x17db93['update']({'read':!![],'messageId':_0x2b93e0[_0xd831('0x60')],'sentAt':moment()['format'](_0xd831('0x61'))});})[_0xd831('0x19')](function(_0x24b5a3){logger['error']('%s',JSON['stringify'](_0x24b5a3));return _0x17db93;});}return _0x17db93;});}return _0x17db93;}})[_0xd831('0x23')](respondWithResult(_0x1838cd,0xc9))[_0xd831('0x19')](handleError(_0x1838cd,null));};exports[_0xd831('0x62')]=function(_0x231c9c,_0x118586){var _0x5a9a32={'agent':{},'channel':_0xd831('0x63')};if(_0x231c9c[_0xd831('0x43')]['id']){delete _0x231c9c[_0xd831('0x43')]['id'];}_0x231c9c['body']['read']=!![];_0x231c9c[_0xd831('0x43')][_0xd831('0x64')]=moment()[_0xd831('0x65')](_0xd831('0x61'));_0x231c9c[_0xd831('0x43')][_0xd831('0x66')]=_0x231c9c[_0xd831('0x43')]['UserId']||_0x231c9c[_0xd831('0x67')]['id'];_0x5a9a32[_0xd831('0x68')]['id']=_0x231c9c[_0xd831('0x43')][_0xd831('0x66')];return db['MailMessage']['find']({'where':{'id':_0x231c9c['params']['id'],'UserId':null}})[_0xd831('0x23')](handleEntityNotFound(_0x118586,null))['then'](saveUpdates(_0x231c9c['body'],null))[_0xd831('0x23')](function(_0x2e41bc){if(_0x2e41bc){_0x5a9a32[_0xd831('0x17')]=_0x2e41bc['get']({'plain':!![]});return db['MailInteraction'][_0xd831('0x44')]({'where':{'id':_0x2e41bc['MailInteractionId']}});}return null;})[_0xd831('0x23')](handleEntityNotFound(_0x118586,null))[_0xd831('0x23')](function(_0x319495){if(_0x319495){return _0x319495[_0xd831('0x22')]({'UserId':_0x231c9c[_0xd831('0x43')][_0xd831('0x66')],'read1stAt':_['isNil'](_0x319495['read1stAt'])?moment()['format'](_0xd831('0x61')):undefined});}return null;})[_0xd831('0x23')](function(_0x9f87d5){if(_0x9f87d5){_0x5a9a32[_0xd831('0x69')]=_0x9f87d5[_0xd831('0x6a')]({'plain':!![]});interaction_log['info'](_0xd831('0x6b'),_0x231c9c[_0xd831('0x67')]['id'],_0x231c9c[_0xd831('0x67')][_0xd831('0x3b')],_0x231c9c[_0xd831('0x67')][_0xd831('0x6c')],_0x5a9a32[_0xd831('0x69')]['id'],_0x231c9c[_0xd831('0x43')]?JSON[_0xd831('0x15')](_0x231c9c['body']):_0xd831('0x6d'));return respondWithRpcPromise(_0xd831('0x6e'),'acceptMessage',_0x5a9a32);}return null;})[_0xd831('0x23')](function(_0x3934bf){var _0x99511b=_0xd831('0x6f')+_0x3934bf[_0xd831('0x17')][_0xd831('0x70')];return db[_0xd831('0x71')]['query'](_0x99511b,{'type':db[_0xd831('0x72')][_0xd831('0x73')]['SELECT'],'raw':!![]})['then'](function(_0x514be8){return _0x514be8;});})[_0xd831('0x23')](function(_0x55b817){if(_0x55b817){_0x5a9a32[_0xd831('0x17')][_0xd831('0x74')]=_0x55b817[0x0];if(!_0x231c9c[_0xd831('0x43')][_0xd831('0x66')])return;return db[_0xd831('0x75')]['find']({'where':{'id':_0x231c9c[_0xd831('0x43')][_0xd831('0x66')],'role':_0xd831('0x68')},'attributes':['id',_0xd831('0x3b'),_0xd831('0x76'),_0xd831('0x77'),'internal'],'raw':!![]});}return null;})[_0xd831('0x23')](function(_0x5330b9){if(!_0x5330b9)return null;_0x5a9a32[_0xd831('0x17')][_0xd831('0x68')]=_0x5330b9;return _0x5a9a32;})[_0xd831('0x23')](function(_0x36120f){if(_0x36120f){if(_0x231c9c['body'][_0xd831('0x78')]){_0x5a9a32[_0xd831('0x17')]['interface']=util[_0xd831('0x65')](_0xd831('0x79'),_0x231c9c['user'][_0xd831('0x3b')]);_0x5a9a32[_0xd831('0x17')][_0xd831('0x7a')]=_0x5a9a32[_0xd831('0x7a')];_0x5a9a32[_0xd831('0x17')][_0xd831('0x7b')]=_0x5a9a32['channel'];_0x5a9a32[_0xd831('0x17')][_0xd831('0x7c')]=_0xd831('0x62');_0x5a9a32[_0xd831('0x17')][_0xd831('0x43')]=htmlToText[_0xd831('0x7d')](_0x5a9a32[_0xd831('0x17')][_0xd831('0x43')]);return respondWithRpcPromise(_0xd831('0x7e'),_0xd831('0x7e'),{'event':_0xd831('0x7f'),'message':_0x5a9a32[_0xd831('0x17')]},client9002)['then'](function(){return _0x5a9a32;});}return _0x5a9a32;}return null;})[_0xd831('0x23')](respondWithResult(_0x118586,null))['catch'](handleError(_0x118586,null));};exports[_0xd831('0x80')]=function(_0x1e2c0a,_0x53e100){var _0x51d418={'agent':{},'channel':'mail'};if(_0x1e2c0a['body']['id']){delete _0x1e2c0a[_0xd831('0x43')]['id'];}_0x1e2c0a[_0xd831('0x43')][_0xd831('0x66')]=_0x1e2c0a[_0xd831('0x43')][_0xd831('0x66')]||_0x1e2c0a[_0xd831('0x67')]['id'];_0x51d418[_0xd831('0x68')]['id']=_0x1e2c0a[_0xd831('0x43')][_0xd831('0x66')];return db[_0xd831('0x29')][_0xd831('0x44')]({'where':{'id':_0x1e2c0a['params']['id'],'UserId':null}})[_0xd831('0x23')](handleEntityNotFound(_0x53e100,null))['then'](function(_0x4202a4){if(_0x4202a4){_0x51d418['message']=_0x4202a4['get']({'plain':!![]});return db[_0xd831('0x81')][_0xd831('0x44')]({'where':{'id':_0x4202a4[_0xd831('0x82')]}});}return null;})[_0xd831('0x23')](handleEntityNotFound(_0x53e100,null))['then'](function(_0x19ef47){if(_0x19ef47){_0x51d418[_0xd831('0x69')]=_0x19ef47[_0xd831('0x6a')]({'plain':!![]});interaction_log['info'](_0xd831('0x83'),_0x1e2c0a[_0xd831('0x67')]['id'],_0x1e2c0a[_0xd831('0x67')][_0xd831('0x3b')],_0x1e2c0a[_0xd831('0x67')]['role'],_0x51d418[_0xd831('0x69')]['id'],_0x1e2c0a[_0xd831('0x43')]?JSON[_0xd831('0x15')](_0x1e2c0a[_0xd831('0x43')]):_0xd831('0x6d'));return respondWithRpcPromise(_0xd831('0x84'),_0xd831('0x85'),_0x51d418);}return null;})[_0xd831('0x23')](function(_0x15adb0){var _0x3b890a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x15adb0[_0xd831('0x17')]['ContactId'];return db[_0xd831('0x71')][_0xd831('0x2e')](_0x3b890a,{'type':db['Sequelize'][_0xd831('0x73')][_0xd831('0x86')],'raw':!![]})[_0xd831('0x23')](function(_0x25116b){return _0x25116b;});})[_0xd831('0x23')](function(_0x25af72){if(_0x25af72){_0x51d418[_0xd831('0x17')]['contact']=_0x25af72[0x0];if(!_0x1e2c0a[_0xd831('0x43')][_0xd831('0x66')])return;return db[_0xd831('0x75')]['find']({'where':{'id':_0x1e2c0a['body'][_0xd831('0x66')],'role':_0xd831('0x68')},'attributes':['id',_0xd831('0x3b'),_0xd831('0x76'),'email',_0xd831('0x87')],'raw':!![]});}return null;})[_0xd831('0x23')](function(_0x524ce9){if(!_0x524ce9)return null;_0x51d418[_0xd831('0x17')][_0xd831('0x68')]=_0x524ce9;return _0x51d418;})[_0xd831('0x23')](function(_0x55c2c6){if(_0x55c2c6){_0x55c2c6['message'][_0xd831('0x88')]=util['format'](_0xd831('0x79'),_0x1e2c0a[_0xd831('0x67')][_0xd831('0x3b')]);_0x55c2c6['message'][_0xd831('0x7a')]=_0x51d418[_0xd831('0x7a')];_0x55c2c6[_0xd831('0x17')][_0xd831('0x7b')]=_0x51d418[_0xd831('0x7a')];_0x55c2c6[_0xd831('0x17')][_0xd831('0x7c')]='reject';_0x55c2c6['message'][_0xd831('0x43')]=htmlToText[_0xd831('0x7d')](_0x51d418[_0xd831('0x17')][_0xd831('0x43')]);respondWithRpcPromise(_0xd831('0x7e'),_0xd831('0x7e'),{'event':_0xd831('0x89'),'message':_0x55c2c6[_0xd831('0x17')]},client9002);return _0x51d418;}return null;})[_0xd831('0x23')](respondWithResult(_0x53e100,null))['catch'](handleError(_0x53e100,null));};exports['download']=function(_0x114c7b,_0x234b05){var _0x77770f=moment()['unix']()[_0xd831('0x8a')]();var _0x121c1c=path[_0xd831('0x58')](config[_0xd831('0x59')],_0xd831('0x8b'),_0xd831('0x8c'),_0xd831('0x8d'));var _0x2a8ba4=path[_0xd831('0x58')](config[_0xd831('0x59')],_0xd831('0x8b'),'files',_0xd831('0x57'));var _0x3d48ab=util[_0xd831('0x65')](_0xd831('0x8e'),_0x77770f);return db[_0xd831('0x29')]['find']({'where':{'id':_0x114c7b[_0xd831('0x40')]['id']},'attributes':['id',_0xd831('0x43'),_0xd831('0x8f'),'to','cc','bcc','subject','createdAt'],'include':_0x114c7b[_0xd831('0x2e')][_0xd831('0x57')]?[{'model':db[_0xd831('0x90')],'as':_0xd831('0x91')}]:undefined})[_0xd831('0x23')](handleEntityNotFound(_0x234b05,null))['then'](function(_0x31058e){if(_0x31058e){var _0x4a2f14=_0x31058e;var _0x2f89ce={'from':_0x4a2f14['from'],'to':_0x4a2f14['to'],'subject':_0x4a2f14[_0xd831('0x92')],'html':htmlEntities[_0xd831('0x93')](_0x4a2f14[_0xd831('0x43')]),'headers':{'Date':moment(_0x4a2f14[_0xd831('0x94')])[_0xd831('0x65')](_0xd831('0x95'))},'attachments':[]};if(_0x31058e['cc']){_0x2f89ce[_0xd831('0x96')]['Cc']=_0x31058e['cc'];}if(_0x31058e[_0xd831('0x97')]){_0x2f89ce['headers'][_0xd831('0x98')]=_0x31058e['bcc'];}return new BPromise(function(_0x117ebc,_0x46223a){if(_0x31058e[_0xd831('0x91')]){for(var _0x8277a5=0x0;_0x8277a5<_0x31058e[_0xd831('0x91')][_0xd831('0x33')];_0x8277a5++){var _0x4e40a2=_0x31058e[_0xd831('0x91')][_0x8277a5];var _0x47b705=path[_0xd831('0x58')](_0x2a8ba4,_0x4e40a2['basename']);if(fs['existsSync'](_0x47b705)){_0x2f89ce['attachments'][_0xd831('0x99')]({'name':_0x4e40a2[_0xd831('0x3b')],'contentType':_0x4e40a2[_0xd831('0x2b')],'data':fs[_0xd831('0x9a')](_0x47b705)});}}}emlformat[_0xd831('0x9b')](_0x2f89ce,function(_0x9d5a46,_0x32f9b4){if(_0x9d5a46)return _0x46223a(_0x9d5a46);fs[_0xd831('0x9c')](path[_0xd831('0x58')](_0x121c1c,_0x3d48ab),_0x32f9b4);return _0x117ebc(_0x32f9b4);});});}})[_0xd831('0x23')](function(_0x349b0c){if(_0x349b0c){return _0x234b05[_0xd831('0x9d')](path[_0xd831('0x58')](_0x121c1c,_0x3d48ab),_0x3d48ab,function(_0x210b44){if(!_0x210b44)fs['unlinkSync'](path[_0xd831('0x58')](_0x121c1c,_0x3d48ab));});}})[_0xd831('0x19')](handleError(_0x234b05,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index f2740d2..6b7fd49 100644 --- a/server/api/mailMessage/mailMessage.events.js +++ b/server/api/mailMessage/mailMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x23c2=['../../mysqldb','MailMessage','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0x23c2,0xe9));var _0x223c=function(_0x297d6f,_0x12c8be){_0x297d6f=_0x297d6f-0x0;var _0x4e0852=_0x23c2[_0x297d6f];return _0x4e0852;};'use strict';var EventEmitter=require(_0x223c('0x0'));var MailMessage=require(_0x223c('0x1'))['db'][_0x223c('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x223c('0x3'),'afterUpdate':_0x223c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x471e71){return function(_0x56e16f,_0x1ed8ce,_0x4e55e9){MailMessageEvents['emit'](_0x471e71+':'+_0x56e16f['id'],_0x56e16f);MailMessageEvents[_0x223c('0x5')](_0x471e71,_0x56e16f);_0x4e55e9(null);};}for(var e in events){if(events[_0x223c('0x6')](e)){var event=events[e];MailMessage[_0x223c('0x7')](e,emitEvent(event));}}module[_0x223c('0x8')]=MailMessageEvents; \ No newline at end of file +var _0xcd56=['events','../../mysqldb','MailMessage','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x191cde,_0x136b38){var _0x198884=function(_0x2345ee){while(--_0x2345ee){_0x191cde['push'](_0x191cde['shift']());}};_0x198884(++_0x136b38);}(_0xcd56,0xfc));var _0x6cd5=function(_0x48e9e4,_0x2c4abe){_0x48e9e4=_0x48e9e4-0x0;var _0x31b4b3=_0xcd56[_0x48e9e4];return _0x31b4b3;};'use strict';var EventEmitter=require(_0x6cd5('0x0'));var MailMessage=require(_0x6cd5('0x1'))['db'][_0x6cd5('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x6cd5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6cd5('0x4')};function emitEvent(_0x48ccc0){return function(_0x54168c,_0x2ba332,_0x4f592e){MailMessageEvents[_0x6cd5('0x5')](_0x48ccc0+':'+_0x54168c['id'],_0x54168c);MailMessageEvents['emit'](_0x48ccc0,_0x54168c);_0x4f592e(null);};}for(var e in events){if(events[_0x6cd5('0x6')](e)){var event=events[e];MailMessage[_0x6cd5('0x7')](e,emitEvent(event));}}module[_0x6cd5('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 0319139..bfd07ea 100644 --- a/server/api/mailMessage/mailMessage.model.js +++ b/server/api/mailMessage/mailMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8232=['utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch'];(function(_0x37e550,_0x685fcc){var _0x30bc4e=function(_0xf073fd){while(--_0xf073fd){_0x37e550['push'](_0x37e550['shift']());}};_0x30bc4e(++_0x685fcc);}(_0x8232,0x1b2));var _0x2823=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x8232[_0x521929];return _0x632436;};'use strict';var _=require(_0x2823('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2823('0x1'));var moment=require(_0x2823('0x2'));var BPromise=require(_0x2823('0x3'));var rp=require(_0x2823('0x4'));var htmlToText=require(_0x2823('0x5'));var fs=require('fs');var path=require(_0x2823('0x6'));var rimraf=require(_0x2823('0x7'));var config=require(_0x2823('0x8'));var attributes=require('./mailMessage.attributes');module[_0x2823('0x9')]=function(_0xa2f10f,_0x5a6089){return _0xa2f10f[_0x2823('0xa')](_0x2823('0xb'),attributes,{'tableName':_0x2823('0xc'),'paranoid':![],'indexes':[{'name':_0x2823('0xd'),'fields':[_0x2823('0xd')]},{'name':_0x2823('0xe'),'fields':[_0x2823('0xf'),_0x2823('0x10')],'type':_0x2823('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x12955f,_0x40ef03,_0x148d18){if(_0x12955f[_0x2823('0x12')]){_0x12955f[_0x2823('0xf')]=htmlToText[_0x2823('0x13')](_0x12955f[_0x2823('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x148d18(null,_0x40ef03);},'afterCreate':function(_0x1e13a6,_0x172e39,_0xb80252){var _0x4c5073=_0xa2f10f[_0x2823('0x14')];var _0x508f28=_0x1e13a6[_0x2823('0x15')]({'plain':!![]});if(_0x508f28[_0x2823('0x16')][_0x2823('0x17')]()==='in'||_0x508f28['direction'][_0x2823('0x17')]()==='out'&&!_0x508f28[_0x2823('0x18')]&&!_[_0x2823('0x19')](_0x508f28[_0x2823('0x1a')])){_0x4c5073[_0x2823('0x1b')][_0x2823('0x1c')]({'where':{'id':_0x508f28[_0x2823('0x1d')]}})[_0x2823('0x1e')](function(_0x26ea6c){if(_0x26ea6c){_0x26ea6c[_0x2823('0x1f')]({'lastMsgAt':_0x508f28[_0x2823('0x20')],'lastMsgDirection':_0x508f28[_0x2823('0x16')][_0x2823('0x17')]()});}})[_0x2823('0x21')](function(_0x5c045d){console['error'](_0x5c045d);});}_0xb80252();}},'charset':_0x2823('0x22'),'collate':_0x2823('0x23')});}; \ No newline at end of file +var _0x3095=['body','fromString','models','get','direction','toLowerCase','out','secret','isNil','findOne','MailInteractionId','then','update','createdAt','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./mailMessage.attributes','exports','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT'];(function(_0x56413f,_0x43363d){var _0x465965=function(_0x84ac4d){while(--_0x84ac4d){_0x56413f['push'](_0x56413f['shift']());}};_0x465965(++_0x43363d);}(_0x3095,0x6d));var _0x5309=function(_0x475bec,_0x21dd89){_0x475bec=_0x475bec-0x0;var _0x28636b=_0x3095[_0x475bec];return _0x28636b;};'use strict';var _=require(_0x5309('0x0'));var util=require(_0x5309('0x1'));var logger=require(_0x5309('0x2'))('api');var moment=require(_0x5309('0x3'));var BPromise=require('bluebird');var rp=require(_0x5309('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x5309('0x5'));var rimraf=require('rimraf');var config=require(_0x5309('0x6'));var attributes=require(_0x5309('0x7'));module[_0x5309('0x8')]=function(_0x4aafd3,_0x3d25f6){return _0x4aafd3['define']('MailMessage',attributes,{'tableName':_0x5309('0x9'),'paranoid':![],'indexes':[{'name':_0x5309('0xa'),'fields':[_0x5309('0xa')]},{'name':_0x5309('0xb'),'fields':[_0x5309('0xc'),_0x5309('0xd')],'type':_0x5309('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xc75a93,_0x2c8cca,_0x461a2a){if(_0xc75a93[_0x5309('0xf')]){_0xc75a93[_0x5309('0xc')]=htmlToText[_0x5309('0x10')](_0xc75a93['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x461a2a(null,_0x2c8cca);},'afterCreate':function(_0x336b25,_0x11ae35,_0x1b4971){var _0x221d9b=_0x4aafd3[_0x5309('0x11')];var _0x57b3f4=_0x336b25[_0x5309('0x12')]({'plain':!![]});if(_0x57b3f4[_0x5309('0x13')][_0x5309('0x14')]()==='in'||_0x57b3f4[_0x5309('0x13')]['toLowerCase']()===_0x5309('0x15')&&!_0x57b3f4[_0x5309('0x16')]&&!_[_0x5309('0x17')](_0x57b3f4['UserId'])){_0x221d9b['MailInteraction'][_0x5309('0x18')]({'where':{'id':_0x57b3f4[_0x5309('0x19')]}})[_0x5309('0x1a')](function(_0x59d448){if(_0x59d448){_0x59d448[_0x5309('0x1b')]({'lastMsgAt':_0x57b3f4[_0x5309('0x1c')],'lastMsgDirection':_0x57b3f4[_0x5309('0x13')]['toLowerCase']()});}})[_0x5309('0x1d')](function(_0x4847ae){console['error'](_0x4847ae);});}_0x1b4971();}},'charset':'utf8mb4','collate':_0x5309('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 13afeb3..5ee8052 100644 --- a/server/api/mailMessage/mailMessage.rpc.js +++ b/server/api/mailMessage/mailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4f4=['CreateMailMessage','create','body','options','raw','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x23a5ae,_0x212d4b){var _0x9292d9=function(_0x1b0042){while(--_0x1b0042){_0x23a5ae['push'](_0x23a5ae['shift']());}};_0x9292d9(++_0x212d4b);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x5d360d,_0x13990f){_0x5d360d=_0x5d360d-0x0;var _0x4f91ba=_0xd4f4[_0x5d360d];return _0x4f91ba;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var moment=require(_0x4d4f('0x2'));var BPromise=require(_0x4d4f('0x3'));var rs=require(_0x4d4f('0x4'));var fs=require('fs');var Redis=require(_0x4d4f('0x5'));var db=require(_0x4d4f('0x6'))['db'];var utils=require(_0x4d4f('0x7'));var logger=require(_0x4d4f('0x8'))(_0x4d4f('0x9'));var config=require(_0x4d4f('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x4d4f('0xb')]=_[_0x4d4f('0xc')](config[_0x4d4f('0xb')],{'host':_0x4d4f('0xd'),'port':0x18eb});var socket=require(_0x4d4f('0xe'))(new Redis(config[_0x4d4f('0xb')]));require(_0x4d4f('0xf'))[_0x4d4f('0x10')](socket);function respondWithRpcPromise(_0x385597,_0xba5200,_0x20db50){return new BPromise(function(_0x88b592,_0x128d39){return client[_0x4d4f('0x11')](_0x385597,_0x20db50)[_0x4d4f('0x12')](function(_0x28fb3e){logger[_0x4d4f('0x13')](_0x4d4f('0x14'),_0xba5200,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0xba5200,_0x4d4f('0x15'),JSON[_0x4d4f('0x16')](_0x28fb3e));if(_0x28fb3e['error']){if(_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x18')]===0x1f4){logger[_0x4d4f('0x17')]('MailMessage,\x20%s,\x20%s',_0xba5200,_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x19')]);return _0x128d39(_0x28fb3e[_0x4d4f('0x17')]['message']);}logger[_0x4d4f('0x17')]('MailMessage,\x20%s,\x20%s',_0xba5200,_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x19')]);return _0x88b592(_0x28fb3e[_0x4d4f('0x17')]['message']);}else{logger[_0x4d4f('0x13')](_0x4d4f('0x14'),_0xba5200,'request\x20sent');_0x88b592(_0x28fb3e['result']['message']);}})['catch'](function(_0x5eebec){logger[_0x4d4f('0x17')](_0x4d4f('0x14'),_0xba5200,_0x5eebec);_0x128d39(_0x5eebec);});});}exports[_0x4d4f('0x1a')]=function(_0x3566a5){var _0x5d7b1f=this;return new Promise(function(_0x5b2863,_0x1e1ae2){return db['MailMessage'][_0x4d4f('0x1b')](_0x3566a5[_0x4d4f('0x1c')],{'raw':_0x3566a5[_0x4d4f('0x1d')]?_0x3566a5[_0x4d4f('0x1d')][_0x4d4f('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x570520){logger[_0x4d4f('0x13')]('CreateMailMessage',_0x3566a5);logger[_0x4d4f('0x1f')](_0x4d4f('0x1a'),_0x3566a5,JSON[_0x4d4f('0x16')](_0x570520));_0x5b2863(_0x570520);})[_0x4d4f('0x20')](function(_0xf3f7a4){logger['error'](_0x4d4f('0x1a'),_0xf3f7a4[_0x4d4f('0x19')],_0x3566a5);_0x1e1ae2(_0x5d7b1f[_0x4d4f('0x17')](0x1f4,_0xf3f7a4[_0x4d4f('0x19')]));});});}; \ No newline at end of file +var _0x9582=['client','http','redis','defaults','register','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateMailMessage','MailMessage','options','raw','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4c1da1,_0xe2763a){var _0x214ad0=function(_0x2b44c5){while(--_0x2b44c5){_0x4c1da1['push'](_0x4c1da1['shift']());}};_0x214ad0(++_0xe2763a);}(_0x9582,0x95));var _0x2958=function(_0x28a71d,_0x716c17){_0x28a71d=_0x28a71d-0x0;var _0xba313a=_0x9582[_0x28a71d];return _0xba313a;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});config[_0x2958('0xd')]=_[_0x2958('0xe')](config[_0x2958('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2958('0xd')]));require('./mailMessage.socket')[_0x2958('0xf')](socket);function respondWithRpcPromise(_0x51e460,_0x44cccc,_0x5ef23c){return new BPromise(function(_0x3aacfa,_0x29776c){return client[_0x2958('0x10')](_0x51e460,_0x5ef23c)[_0x2958('0x11')](function(_0x11ec8d){logger['info'](_0x2958('0x12'),_0x44cccc,_0x2958('0x13'));logger[_0x2958('0x14')](_0x2958('0x15'),_0x44cccc,_0x2958('0x13'),JSON[_0x2958('0x16')](_0x11ec8d));if(_0x11ec8d[_0x2958('0x17')]){if(_0x11ec8d[_0x2958('0x17')]['code']===0x1f4){logger[_0x2958('0x17')](_0x2958('0x12'),_0x44cccc,_0x11ec8d['error']['message']);return _0x29776c(_0x11ec8d[_0x2958('0x17')][_0x2958('0x18')]);}logger['error'](_0x2958('0x12'),_0x44cccc,_0x11ec8d['error']['message']);return _0x3aacfa(_0x11ec8d[_0x2958('0x17')][_0x2958('0x18')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x44cccc,_0x2958('0x13'));_0x3aacfa(_0x11ec8d[_0x2958('0x19')][_0x2958('0x18')]);}})[_0x2958('0x1a')](function(_0x27599c){logger['error'](_0x2958('0x12'),_0x44cccc,_0x27599c);_0x29776c(_0x27599c);});});}exports[_0x2958('0x1b')]=function(_0x1a12fa){var _0x57b6c5=this;return new Promise(function(_0x1e77eb,_0x53b100){return db[_0x2958('0x1c')]['create'](_0x1a12fa['body'],{'raw':_0x1a12fa[_0x2958('0x1d')]?_0x1a12fa[_0x2958('0x1d')][_0x2958('0x1e')]===undefined?!![]:![]:!![]})[_0x2958('0x11')](function(_0x2202f8){logger[_0x2958('0x1f')](_0x2958('0x1b'),_0x1a12fa);logger[_0x2958('0x14')](_0x2958('0x1b'),_0x1a12fa,JSON[_0x2958('0x16')](_0x2202f8));_0x1e77eb(_0x2202f8);})[_0x2958('0x1a')](function(_0xd58ae1){logger[_0x2958('0x17')](_0x2958('0x1b'),_0xd58ae1[_0x2958('0x18')],_0x1a12fa);_0x53b100(_0x57b6c5['error'](0x1f4,_0xd58ae1['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index e4b5bdf..f5b34ee 100644 --- a/server/api/mailMessage/mailMessage.socket.js +++ b/server/api/mailMessage/mailMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbbcb=['update','emit','removeListener','register','length','mailMessage:','./mailMessage.events','save','remove'];(function(_0xda5fef,_0x47abfe){var _0x19bbac=function(_0x4538d2){while(--_0x4538d2){_0xda5fef['push'](_0xda5fef['shift']());}};_0x19bbac(++_0x47abfe);}(_0xbbcb,0x16e));var _0xbbbc=function(_0x113031,_0x47cc38){_0x113031=_0x113031-0x0;var _0xec022c=_0xbbcb[_0x113031];return _0xec022c;};'use strict';var MailMessageEvents=require(_0xbbbc('0x0'));var events=[_0xbbbc('0x1'),_0xbbbc('0x2'),_0xbbbc('0x3')];function createListener(_0x38ffe2,_0x28fa3e){return function(_0x543d12){_0x28fa3e[_0xbbbc('0x4')](_0x38ffe2,_0x543d12);};}function removeListener(_0x2c1080,_0xd46d70){return function(){MailMessageEvents[_0xbbbc('0x5')](_0x2c1080,_0xd46d70);};}exports[_0xbbbc('0x6')]=function(_0x1a56be){for(var _0x1bea66=0x0,_0x343542=events[_0xbbbc('0x7')];_0x1bea66<_0x343542;_0x1bea66++){var _0x531138=events[_0x1bea66];var _0x562272=createListener(_0xbbbc('0x8')+_0x531138,_0x1a56be);MailMessageEvents['on'](_0x531138,_0x562272);}}; \ No newline at end of file +var _0x1689=['length','mailMessage:','remove','update','removeListener','register'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1689,0x19a));var _0x9168=function(_0x1dc82e,_0x122e8d){_0x1dc82e=_0x1dc82e-0x0;var _0xb462f6=_0x1689[_0x1dc82e];return _0xb462f6;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0x9168('0x0'),_0x9168('0x1')];function createListener(_0x16315d,_0x4b45a4){return function(_0x5836e0){_0x4b45a4['emit'](_0x16315d,_0x5836e0);};}function removeListener(_0x3e3d55,_0x290d45){return function(){MailMessageEvents[_0x9168('0x2')](_0x3e3d55,_0x290d45);};}exports[_0x9168('0x3')]=function(_0x44b6d5){for(var _0x5ed682=0x0,_0x4880a7=events[_0x9168('0x4')];_0x5ed682<_0x4880a7;_0x5ed682++){var _0x1bcd5=events[_0x5ed682];var _0x4c6b38=createListener(_0x9168('0x5')+_0x1bcd5,_0x44b6d5);MailMessageEvents['on'](_0x1bcd5,_0x4c6b38);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index a6d4fda..2dd9bac 100644 --- a/server/api/mailQueue/index.js +++ b/server/api/mailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b96=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addAgents','update','delete','destroy','removeTeams','exports'];(function(_0x3fe1ba,_0x1a33c5){var _0x5df1b4=function(_0x55d7c3){while(--_0x55d7c3){_0x3fe1ba['push'](_0x3fe1ba['shift']());}};_0x5df1b4(++_0x1a33c5);}(_0x4b96,0xfc));var _0x64b9=function(_0x569f4b,_0x3c4a23){_0x569f4b=_0x569f4b-0x0;var _0x598302=_0x4b96[_0x569f4b];return _0x598302;};'use strict';var multer=require('multer');var util=require(_0x64b9('0x0'));var path=require(_0x64b9('0x1'));var timeout=require(_0x64b9('0x2'));var express=require(_0x64b9('0x3'));var router=express[_0x64b9('0x4')]();var fs_extra=require(_0x64b9('0x5'));var auth=require(_0x64b9('0x6'));var interaction=require(_0x64b9('0x7'));var config=require('../../config/environment');var controller=require(_0x64b9('0x8'));router['get']('/',auth[_0x64b9('0x9')](),controller[_0x64b9('0xa')]);router[_0x64b9('0xb')](_0x64b9('0xc'),auth[_0x64b9('0x9')](),controller['describe']);router[_0x64b9('0xb')](_0x64b9('0xd'),auth[_0x64b9('0x9')](),controller[_0x64b9('0xe')]);router[_0x64b9('0xb')](_0x64b9('0xf'),auth[_0x64b9('0x9')](),controller[_0x64b9('0x10')]);router[_0x64b9('0xb')]('/:id/teams',auth[_0x64b9('0x9')](),controller[_0x64b9('0x11')]);router[_0x64b9('0xb')](_0x64b9('0x12'),auth[_0x64b9('0x9')](),controller[_0x64b9('0x13')]);router['post']('/',auth[_0x64b9('0x9')](),controller['create']);router[_0x64b9('0x14')](_0x64b9('0x15'),auth[_0x64b9('0x9')](),controller['addTeams']);router[_0x64b9('0x14')](_0x64b9('0x12'),auth[_0x64b9('0x9')](),controller[_0x64b9('0x16')]);router['put'](_0x64b9('0xd'),auth[_0x64b9('0x9')](),controller[_0x64b9('0x17')]);router[_0x64b9('0x18')](_0x64b9('0xd'),auth[_0x64b9('0x9')](),controller[_0x64b9('0x19')]);router[_0x64b9('0x18')]('/:id/teams',auth[_0x64b9('0x9')](),controller[_0x64b9('0x1a')]);router[_0x64b9('0x18')]('/:id/users',auth[_0x64b9('0x9')](),controller['removeAgents']);module[_0x64b9('0x1b')]=router; \ No newline at end of file +var _0x53d9=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./mailQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams'];(function(_0x5cc30e,_0x2646b6){var _0x208c6d=function(_0x1abc53){while(--_0x1abc53){_0x5cc30e['push'](_0x5cc30e['shift']());}};_0x208c6d(++_0x2646b6);}(_0x53d9,0x188));var _0x953d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53d9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x953d('0x0'));var util=require(_0x953d('0x1'));var path=require(_0x953d('0x2'));var timeout=require(_0x953d('0x3'));var express=require(_0x953d('0x4'));var router=express[_0x953d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x953d('0x6'));var controller=require(_0x953d('0x7'));router[_0x953d('0x8')]('/',auth['isAuthenticated'](),controller[_0x953d('0x9')]);router['get'](_0x953d('0xa'),auth[_0x953d('0xb')](),controller[_0x953d('0xc')]);router[_0x953d('0x8')](_0x953d('0xd'),auth['isAuthenticated'](),controller[_0x953d('0xe')]);router[_0x953d('0x8')](_0x953d('0xf'),auth['isAuthenticated'](),controller['getMembers']);router[_0x953d('0x8')](_0x953d('0x10'),auth[_0x953d('0xb')](),controller['getTeams']);router[_0x953d('0x8')](_0x953d('0x11'),auth[_0x953d('0xb')](),controller[_0x953d('0x12')]);router[_0x953d('0x13')]('/',auth[_0x953d('0xb')](),controller[_0x953d('0x14')]);router[_0x953d('0x13')](_0x953d('0x10'),auth[_0x953d('0xb')](),controller[_0x953d('0x15')]);router[_0x953d('0x13')](_0x953d('0x11'),auth['isAuthenticated'](),controller[_0x953d('0x16')]);router[_0x953d('0x17')](_0x953d('0xd'),auth[_0x953d('0xb')](),controller[_0x953d('0x18')]);router[_0x953d('0x19')]('/:id',auth[_0x953d('0xb')](),controller[_0x953d('0x1a')]);router[_0x953d('0x19')]('/:id/teams',auth[_0x953d('0xb')](),controller[_0x953d('0x1b')]);router[_0x953d('0x19')](_0x953d('0x11'),auth[_0x953d('0xb')](),controller[_0x953d('0x1c')]);module[_0x953d('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 9b06889..54676f9 100644 --- a/server/api/mailQueue/mailQueue.attributes.js +++ b/server/api/mailQueue/mailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d5b=['exports','STRING','name','ENUM','beepall','roundrobin','sequelize'];(function(_0x475a39,_0x5eab52){var _0x194426=function(_0x4e823f){while(--_0x4e823f){_0x475a39['push'](_0x475a39['shift']());}};_0x194426(++_0x5eab52);}(_0x9d5b,0x13a));var _0xb9d5=function(_0x5bb9a7,_0x32b6e4){_0x5bb9a7=_0x5bb9a7-0x0;var _0x4bd558=_0x9d5b[_0x5bb9a7];return _0x4bd558;};'use strict';var Sequelize=require(_0xb9d5('0x0'));module[_0xb9d5('0x1')]={'name':{'type':Sequelize[_0xb9d5('0x2')],'unique':_0xb9d5('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb9d5('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb9d5('0x4')]('rrmemory',_0xb9d5('0x5'),_0xb9d5('0x6'))}}; \ No newline at end of file +var _0x4334=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x544baa,_0x1b17fe){var _0x5e8cc1=function(_0x1b55dc){while(--_0x1b55dc){_0x544baa['push'](_0x544baa['shift']());}};_0x5e8cc1(++_0x1b17fe);}(_0x4334,0x148));var _0x4433=function(_0x4bee3f,_0x972ccc){_0x4bee3f=_0x4bee3f-0x0;var _0x381663=_0x4334[_0x4bee3f];return _0x381663;};'use strict';var Sequelize=require(_0x4433('0x0'));module['exports']={'name':{'type':Sequelize[_0x4433('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4433('0x1')]},'timeout':{'type':Sequelize[_0x4433('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4433('0x3')](_0x4433('0x4'),_0x4433('0x5'),_0x4433('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 03e78f4..756545e 100644 --- a/server/api/mailQueue/mailQueue.controller.js +++ b/server/api/mailQueue/mailQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x76e5=['includes','all','value','transaction','isEmpty','forEach','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','removeAgents','isArray','getAgents','bluebird','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','update','then','UserProfileResource','destroy','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','rows','catch','params','model','keys','filters','intersection','fields','attributes','length','includeAll','merge','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MailQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','nolimit','order','sort','pick','filter','User','findAndCountAll','UserId','mailPause','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','UserMailQueue','emit','removeTeams','ids','select','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT'];(function(_0x524b4d,_0x141f95){var _0x44500d=function(_0x48a2be){while(--_0x48a2be){_0x524b4d['push'](_0x524b4d['shift']());}};_0x44500d(++_0x141f95);}(_0x76e5,0x106));var _0x576e=function(_0x4068ac,_0x4cfdab){_0x4068ac=_0x4068ac-0x0;var _0x28e371=_0x76e5[_0x4068ac];return _0x28e371;};'use strict';var BPromise=require(_0x576e('0x0'));var util=require('util');var _=require('lodash');var squel=require(_0x576e('0x1'));var Redis=require(_0x576e('0x2'));var qs=require(_0x576e('0x3'));var logger=require(_0x576e('0x4'))(_0x576e('0x5'));var config=require('../../config/environment');var db=require(_0x576e('0x6'))['db'];config[_0x576e('0x7')]=_[_0x576e('0x8')](config['redis'],{'host':_0x576e('0x9'),'port':0x18eb});var socket=require(_0x576e('0xa'))(new Redis(config[_0x576e('0x7')]));require(_0x576e('0xb'))[_0x576e('0xc')](socket);function respondWithStatusCode(_0x47a7f8,_0x13e38f){_0x13e38f=_0x13e38f||0xcc;return function(_0x41581d){if(_0x41581d){return _0x47a7f8[_0x576e('0xd')](_0x13e38f);}return _0x47a7f8['status'](_0x13e38f)[_0x576e('0xe')]();};}function respondWithResult(_0x3bbe4c,_0x3a4f67){_0x3a4f67=_0x3a4f67||0xc8;return function(_0x4350fb){if(_0x4350fb){return _0x3bbe4c['status'](_0x3a4f67)[_0x576e('0xf')](_0x4350fb);}};}function respondWithFilteredResult(_0x5d2427,_0x241fbc){return function(_0x39dd2f){if(_0x39dd2f){var _0x53d750=typeof _0x241fbc[_0x576e('0x10')]===_0x576e('0x11')&&typeof _0x241fbc[_0x576e('0x12')]==='undefined';var _0x5ba501=_0x39dd2f['count'];var _0xe7e02c=_0x53d750?0x0:_0x241fbc[_0x576e('0x10')];var _0x3b0b72=_0x53d750?_0x39dd2f[_0x576e('0x13')]:_0x241fbc['offset']+_0x241fbc[_0x576e('0x12')];var _0x1c89de;if(_0x3b0b72>=_0x5ba501){_0x3b0b72=_0x5ba501;_0x1c89de=0xc8;}else{_0x1c89de=0xce;}_0x5d2427[_0x576e('0x14')](_0x1c89de);return _0x5d2427[_0x576e('0x15')](_0x576e('0x16'),_0xe7e02c+'-'+_0x3b0b72+'/'+_0x5ba501)['json'](_0x39dd2f);}return null;};}function saveUpdates(_0x47ef60){return function(_0x4af0c0){if(_0x4af0c0){return _0x4af0c0[_0x576e('0x17')](_0x47ef60)[_0x576e('0x18')](function(_0xc27e4b){return _0xc27e4b;});}return null;};}function removeEntity(_0x40f85d){return function(_0x555c8f){if(_0x555c8f){return _0x555c8f['destroy']()[_0x576e('0x18')](function(){var _0x5e7d11=_0x555c8f['get']({'plain':!![]});var _0x48c296='MailQueues';return db[_0x576e('0x19')][_0x576e('0x1a')]({'where':{'type':_0x48c296,'resourceId':_0x5e7d11['id']}})['then'](function(){return _0x555c8f;});})[_0x576e('0x18')](function(){_0x40f85d[_0x576e('0x14')](0xcc)[_0x576e('0xe')]();});}};}function handleEntityNotFound(_0x259587){return function(_0x12b538){if(!_0x12b538){_0x259587[_0x576e('0xd')](0x194);}return _0x12b538;};}function handleError(_0x303cae,_0x35decf){_0x35decf=_0x35decf||0x1f4;return function(_0x3c6238){logger[_0x576e('0x1b')](_0x3c6238[_0x576e('0x1c')]);if(_0x3c6238[_0x576e('0x1d')]){delete _0x3c6238[_0x576e('0x1d')];}_0x303cae[_0x576e('0x14')](_0x35decf)[_0x576e('0x1e')](_0x3c6238);};}exports[_0x576e('0x1f')]=function(_0x1f07a1,_0x43a4c8){var _0x4b7e53={};var _0x457e2a={'count':0x0,'rows':[]};var _0xa698fb=_[_0x576e('0x20')](db[_0x576e('0x21')][_0x576e('0x22')],function(_0x19b506){return{'name':_0x19b506[_0x576e('0x23')],'type':_0x19b506['type'][_0x576e('0x24')]};});_0x4b7e53=qs[_0x576e('0x25')](_0xa698fb,_0x1f07a1);var _0x172def={'where':_0x4b7e53[_0x576e('0x26')]};return db['MailQueue'][_0x576e('0x13')](_0x172def)[_0x576e('0x18')](function(_0x5276cb){_0x457e2a[_0x576e('0x13')]=_0x5276cb;_0x4b7e53[_0x576e('0x27')]=qs[_0x576e('0x27')](_0x1f07a1[_0x576e('0x28')]);return db[_0x576e('0x21')][_0x576e('0x29')](_0x4b7e53);})['then'](function(_0x1b15d8){_0x457e2a[_0x576e('0x2a')]=_0x1b15d8;return _0x457e2a;})[_0x576e('0x18')](respondWithFilteredResult(_0x43a4c8,_0x4b7e53))[_0x576e('0x2b')](handleError(_0x43a4c8,null));};exports['show']=function(_0x3df0f1,_0x7bf1f2){var _0x1b70fd={'raw':!![],'where':{'id':_0x3df0f1[_0x576e('0x2c')]['id']}},_0x585224={};_0x585224[_0x576e('0x2d')]=_[_0x576e('0x2e')](db['MailQueue'][_0x576e('0x22')]);_0x585224[_0x576e('0x28')]=_[_0x576e('0x2e')](_0x3df0f1['query']);_0x585224[_0x576e('0x2f')]=_[_0x576e('0x30')](_0x585224['model'],_0x585224[_0x576e('0x28')]);_0x1b70fd['attributes']=_[_0x576e('0x30')](_0x585224['model'],qs[_0x576e('0x31')](_0x3df0f1[_0x576e('0x28')]['fields']));_0x1b70fd[_0x576e('0x32')]=_0x1b70fd[_0x576e('0x32')][_0x576e('0x33')]?_0x1b70fd[_0x576e('0x32')]:_0x585224[_0x576e('0x2d')];if(_0x3df0f1[_0x576e('0x28')][_0x576e('0x34')]){_0x1b70fd[_0x576e('0x27')]=[{'all':!![]}];}_0x1b70fd=_[_0x576e('0x35')]({},_0x1b70fd,_0x3df0f1[_0x576e('0x36')]);return db[_0x576e('0x21')][_0x576e('0x37')](_0x1b70fd)[_0x576e('0x18')](handleEntityNotFound(_0x7bf1f2,null))[_0x576e('0x18')](respondWithResult(_0x7bf1f2,null))[_0x576e('0x2b')](handleError(_0x7bf1f2,null));};exports[_0x576e('0x38')]=function(_0x5a3dd6,_0x51d7a7){return db['MailQueue'][_0x576e('0x38')](_0x5a3dd6[_0x576e('0x39')],{})[_0x576e('0x18')](function(_0x5ab60d){var _0x3d689c=_0x5a3dd6['user'][_0x576e('0x3a')]({'plain':!![]});if(!_0x3d689c)throw new Error(_0x576e('0x3b'));if(_0x3d689c[_0x576e('0x3c')]===_0x576e('0x3d')){var _0x2baaeb=_0x5ab60d['get']({'plain':!![]});var _0x441a86=_0x576e('0x3e');return db[_0x576e('0x3f')][_0x576e('0x37')]({'where':{'name':_0x441a86,'userProfileId':_0x3d689c[_0x576e('0x40')]},'raw':!![]})[_0x576e('0x18')](function(_0xba8bc5){if(_0xba8bc5&&_0xba8bc5[_0x576e('0x41')]===0x0){return db[_0x576e('0x19')][_0x576e('0x38')]({'name':_0x2baaeb['name'],'resourceId':_0x2baaeb['id'],'type':_0xba8bc5['name'],'sectionId':_0xba8bc5['id']},{})['then'](function(){return _0x5ab60d;});}else{return _0x5ab60d;}})[_0x576e('0x2b')](function(_0x13eafd){logger['error'](_0x576e('0x42'),_0x13eafd);throw _0x13eafd;});}return _0x5ab60d;})[_0x576e('0x18')](respondWithResult(_0x51d7a7,0xc9))[_0x576e('0x2b')](handleError(_0x51d7a7,null));};exports[_0x576e('0x17')]=function(_0x52aa68,_0x47ebbc){if(_0x52aa68[_0x576e('0x39')]['id']){delete _0x52aa68[_0x576e('0x39')]['id'];}return db[_0x576e('0x21')]['find']({'where':{'id':_0x52aa68[_0x576e('0x2c')]['id']}})[_0x576e('0x18')](handleEntityNotFound(_0x47ebbc,null))[_0x576e('0x18')](saveUpdates(_0x52aa68[_0x576e('0x39')],null))['then'](respondWithResult(_0x47ebbc,null))['catch'](handleError(_0x47ebbc,null));};exports[_0x576e('0x1a')]=function(_0x477c24,_0x382bec){return db[_0x576e('0x21')]['find']({'where':{'id':_0x477c24['params']['id']}})['then'](handleEntityNotFound(_0x382bec,null))[_0x576e('0x18')](removeEntity(_0x382bec,null))['catch'](handleError(_0x382bec,null));};exports[_0x576e('0x43')]=function(_0x402f02,_0x425320){return db[_0x576e('0x21')][_0x576e('0x43')]()[_0x576e('0x18')](respondWithResult(_0x425320,null))['catch'](handleError(_0x425320,null));};exports[_0x576e('0x44')]=function(_0x1abeca,_0x4ac331){var _0x286d51={'raw':!![],'where':{}},_0x27f686={},_0x3eb255;return db[_0x576e('0x21')][_0x576e('0x45')]({'where':{'id':_0x1abeca[_0x576e('0x2c')]['id']}})[_0x576e('0x18')](handleEntityNotFound(_0x4ac331,null))[_0x576e('0x18')](function(_0x37db8b){if(_0x37db8b){_0x3eb255=_0x37db8b[_0x576e('0x3a')]({'plain':!![]});_0x27f686[_0x576e('0x2d')]=_['keys'](db['UserMailQueue']['rawAttributes']);_0x27f686[_0x576e('0x28')]=_[_0x576e('0x2e')](_0x1abeca[_0x576e('0x28')]);_0x27f686[_0x576e('0x2f')]=_[_0x576e('0x30')](_0x27f686['model'],_0x27f686['query']);_0x286d51[_0x576e('0x32')]=_[_0x576e('0x30')](_0x27f686['model'],qs['fields'](_0x1abeca['query'][_0x576e('0x31')]));_0x286d51[_0x576e('0x32')]=_0x286d51['attributes']['length']?_0x286d51[_0x576e('0x32')]:_0x27f686[_0x576e('0x2d')];if(!_0x1abeca[_0x576e('0x28')][_0x576e('0x46')](_0x576e('0x47'))){_0x286d51[_0x576e('0x12')]=qs[_0x576e('0x12')](_0x1abeca[_0x576e('0x28')]['limit']);_0x286d51[_0x576e('0x10')]=qs[_0x576e('0x10')](_0x1abeca[_0x576e('0x28')][_0x576e('0x10')]);}_0x286d51[_0x576e('0x48')]=qs[_0x576e('0x49')](_0x1abeca[_0x576e('0x28')][_0x576e('0x49')]);_0x286d51[_0x576e('0x26')]=qs[_0x576e('0x2f')](_[_0x576e('0x4a')](_0x1abeca[_0x576e('0x28')],_0x27f686[_0x576e('0x2f')]));_0x286d51[_0x576e('0x26')]['MailQueueId']=_0x37db8b['id'];if(_0x1abeca['query'][_0x576e('0x4b')]){_0x286d51[_0x576e('0x26')]=_[_0x576e('0x35')](_0x286d51['where'],{'$or':_['map'](_0x286d51['attributes'],function(_0x26afdd){var _0x500230={};_0x500230[_0x26afdd]={'$like':'%'+_0x1abeca[_0x576e('0x28')][_0x576e('0x4b')]+'%'};return _0x500230;})});}_0x286d51=_[_0x576e('0x35')]({},_0x286d51,_0x1abeca['options']);return db['UserMailQueue'][_0x576e('0x29')](_0x286d51);}})[_0x576e('0x18')](function(_0x1d0d4c){if(_0x1d0d4c){return db[_0x576e('0x4c')][_0x576e('0x4d')]({'where':{'id':_[_0x576e('0x20')](_0x1d0d4c,_0x576e('0x4e')),'role':'agent'},'attributes':['id',_0x576e('0x1d'),_0x576e('0x4f'),'updatedAt',_0x576e('0x50')]});}})[_0x576e('0x18')](function(_0x51bb55){if(_0x51bb55){return{'count':_0x51bb55[_0x576e('0x13')],'rows':_['map'](_0x51bb55[_0x576e('0x2a')],function(_0x4aa4a5){return{'membername':_0x4aa4a5['name'],'UserId':_0x4aa4a5['id'],'queue_name':_0x3eb255[_0x576e('0x1d')],'MailQueueId':_0x3eb255['id'],'interface':util[_0x576e('0x51')](_0x576e('0x52'),_0x576e('0x53'),_0x4aa4a5['name']),'penalty':0x0,'paused':_0x4aa4a5[_0x576e('0x4f')],'createdAt':_0x4aa4a5[_0x576e('0x50')],'updatedAt':_0x4aa4a5['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x576e('0x18')](respondWithFilteredResult(_0x4ac331,_0x286d51))[_0x576e('0x2b')](handleError(_0x4ac331,null));};exports[_0x576e('0x54')]=function(_0x2994b1,_0x195979){var _0x301aa5={};var _0x506b61={};var _0x5632f4;var _0x4e7f33;return db[_0x576e('0x21')][_0x576e('0x45')]({'where':{'id':_0x2994b1[_0x576e('0x2c')]['id']}})[_0x576e('0x18')](handleEntityNotFound(_0x195979,null))[_0x576e('0x18')](function(_0x597383){if(_0x597383){_0x5632f4=_0x597383;_0x506b61[_0x576e('0x2d')]=_[_0x576e('0x2e')](db[_0x576e('0x55')][_0x576e('0x22')]);_0x506b61['query']=_[_0x576e('0x2e')](_0x2994b1['query']);_0x506b61['filters']=_[_0x576e('0x30')](_0x506b61[_0x576e('0x2d')],_0x506b61[_0x576e('0x28')]);_0x301aa5[_0x576e('0x32')]=_['intersection'](_0x506b61[_0x576e('0x2d')],qs[_0x576e('0x31')](_0x2994b1['query'][_0x576e('0x31')]));_0x301aa5['attributes']=_0x301aa5['attributes'][_0x576e('0x33')]?_0x301aa5[_0x576e('0x32')]:_0x506b61[_0x576e('0x2d')];_0x301aa5[_0x576e('0x48')]=qs[_0x576e('0x49')](_0x2994b1['query'][_0x576e('0x49')]);_0x301aa5[_0x576e('0x26')]=qs[_0x576e('0x2f')](_[_0x576e('0x4a')](_0x2994b1['query'],_0x506b61[_0x576e('0x2f')]));if(_0x2994b1['query'][_0x576e('0x4b')]){_0x301aa5[_0x576e('0x26')]=_[_0x576e('0x35')](_0x301aa5[_0x576e('0x26')],{'$or':_[_0x576e('0x20')](_0x301aa5['attributes'],function(_0x593845){var _0x48663e={};_0x48663e[_0x593845]={'$like':'%'+_0x2994b1[_0x576e('0x28')][_0x576e('0x4b')]+'%'};return _0x48663e;})});}_0x301aa5=_['merge']({},_0x301aa5,_0x2994b1['options']);return _0x5632f4[_0x576e('0x54')](_0x301aa5);}})[_0x576e('0x18')](function(_0x15deff){if(_0x15deff){_0x4e7f33=_0x15deff[_0x576e('0x33')];if(!_0x2994b1[_0x576e('0x28')][_0x576e('0x46')](_0x576e('0x47'))){_0x301aa5[_0x576e('0x12')]=qs[_0x576e('0x12')](_0x2994b1['query']['limit']);_0x301aa5[_0x576e('0x10')]=qs['offset'](_0x2994b1[_0x576e('0x28')][_0x576e('0x10')]);}return _0x5632f4[_0x576e('0x54')](_0x301aa5);}})[_0x576e('0x18')](function(_0x54e035){if(_0x54e035){return _0x54e035?{'count':_0x4e7f33,'rows':_0x54e035}:null;}})[_0x576e('0x18')](respondWithResult(_0x195979,null))[_0x576e('0x2b')](handleError(_0x195979,null));};exports[_0x576e('0x56')]=function(_0x5e051f,_0x284523){var _0x37f25b=_0x5e051f['body']['ids'];return db[_0x576e('0x55')]['findAll']({'where':{'id':_0x37f25b},'attributes':['id'],'include':[{'model':db[_0x576e('0x4c')],'as':_0x576e('0x57'),'attributes':['id',_0x576e('0x1d'),_0x576e('0x58'),_0x576e('0x59'),_0x576e('0x5a')],'raw':!![]}]})[_0x576e('0x18')](function(_0x4e4c16){if(_0x4e4c16){var _0x234f79=_[_0x576e('0x5b')](_0x4e4c16,function(_0x2d7c1c){var _0x41a50f=_0x2d7c1c[_0x576e('0x3a')]({'plain':!![]});return _0x41a50f[_0x576e('0x57')];});return db[_0x576e('0x21')][_0x576e('0x37')]({'where':{'id':_0x5e051f[_0x576e('0x2c')]['id']}})[_0x576e('0x18')](function(_0x3fa1e4){return db[_0x576e('0x5c')]['transaction'](function(_0x34680b){return _0x3fa1e4[_0x576e('0x56')](_0x37f25b,{'transaction':_0x34680b})[_0x576e('0x18')](function(){return BPromise['each'](_0x234f79,function(_0x2e6526){return db[_0x576e('0x5d')]['findOrCreate']({'where':{'UserId':_0x2e6526['id'],'MailQueueId':_0x5e051f['params']['id']},'transaction':_0x34680b});});})[_0x576e('0x18')](function(){_0x234f79['forEach'](function(_0x366fab){socket[_0x576e('0x5e')]('userMailQueue:save',{'UserId':_0x366fab['id'],'MailQueueId':_0x3fa1e4['id']});});});});});}})[_0x576e('0x18')](respondWithStatusCode(_0x284523,null))[_0x576e('0x2b')](handleError(_0x284523,null));};exports[_0x576e('0x5f')]=function(_0x1ac0b6,_0x1f0cdf){return db[_0x576e('0x55')][_0x576e('0x29')]({'where':{'id':_0x1ac0b6[_0x576e('0x28')][_0x576e('0x60')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x576e('0x57'),'attributes':['id'],'raw':!![]}]})[_0x576e('0x18')](handleEntityNotFound(_0x1f0cdf,null))[_0x576e('0x18')](function(_0x9ad36d){var _0x3b91f1=_[_0x576e('0x20')](_0x9ad36d,'id');var _0x339440=[];var _0x235d0a=[];var _0x159a6c=squel[_0x576e('0x61')]();_0x159a6c['field'](_0x576e('0x62'))[_0x576e('0x63')](_0x576e('0x64'),'tq')[_0x576e('0x65')]('user_has_teams','ut',_0x576e('0x66'))[_0x576e('0x26')](_0x576e('0x67'),_0x1ac0b6[_0x576e('0x2c')]['id']);for(var _0x5808c2=0x0;_0x5808c2<_0x9ad36d[_0x576e('0x33')];_0x5808c2+=0x1){let _0x381574=_0x9ad36d[_0x5808c2];for(var _0x83173=0x0;_0x83173<_0x381574[_0x576e('0x57')][_0x576e('0x33')];_0x83173+=0x1){let _0x3f045b=_0x381574['Agents'][_0x83173];var _0x49ab8f=_0x159a6c[_0x576e('0x68')]();_0x49ab8f[_0x576e('0x26')](_0x576e('0x69'),_0x3f045b['id']);_0x235d0a[_0x576e('0x6a')](db[_0x576e('0x5c')]['query'](_0x49ab8f[_0x576e('0x6b')](),{'type':db[_0x576e('0x5c')][_0x576e('0x6c')][_0x576e('0x6d')]})[_0x576e('0x18')](function(_0x56270b){if(_0x56270b[_0x576e('0x33')]===0x1){return _0x3f045b['id'];}else{var _0x55b711=_['every'](_['map'](_0x56270b,'TeamId'),function(_0x28e0a6){return _[_0x576e('0x6e')](_0x3b91f1,_0x28e0a6);});if(_0x55b711){return _0x3f045b['id'];}}}));}}return BPromise[_0x576e('0x6f')](_0x235d0a)[_0x576e('0x18')](function(_0x32867e){_0x339440=_(_0x339440)['union'](_0x32867e)['compact']()[_0x576e('0x70')]();return db[_0x576e('0x21')][_0x576e('0x37')]({'where':{'id':_0x1ac0b6[_0x576e('0x2c')]['id']}})[_0x576e('0x18')](function(_0x11a930){return db[_0x576e('0x5c')][_0x576e('0x71')](function(_0x4a7f98){return _0x11a930[_0x576e('0x5f')](_0x1ac0b6[_0x576e('0x28')][_0x576e('0x60')],{'transaction':_0x4a7f98})[_0x576e('0x18')](function(){if(!_[_0x576e('0x72')](_0x339440)){return _0x11a930['removeAgents'](_0x339440,{'transaction':_0x4a7f98});}})[_0x576e('0x18')](function(){_0x339440[_0x576e('0x73')](function(_0x282f8e){socket[_0x576e('0x5e')](_0x576e('0x74'),{'UserId':_0x282f8e,'MailQueueId':_0x11a930['id']});});});});});});})[_0x576e('0x18')](respondWithStatusCode(_0x1f0cdf,null))['catch'](handleError(_0x1f0cdf,null));};exports[_0x576e('0x75')]=function(_0x2ac20a,_0xe7cd79){return db[_0x576e('0x21')][_0x576e('0x37')]({'where':{'id':_0x2ac20a[_0x576e('0x2c')]['id']}})['then'](handleEntityNotFound(_0xe7cd79,null))[_0x576e('0x18')](function(_0x3a7b7b){if(_0x3a7b7b){return _0x3a7b7b['addAgents'](_0x2ac20a[_0x576e('0x39')][_0x576e('0x60')],_[_0x576e('0x76')](_0x2ac20a['body'],[_0x576e('0x60'),'id'])||{})[_0x576e('0x77')](function(_0x4991a2){for(var _0x306355=0x0;_0x306355<_0x2ac20a[_0x576e('0x39')][_0x576e('0x60')][_0x576e('0x33')];_0x306355+=0x1){socket[_0x576e('0x5e')](_0x576e('0x78'),{'UserId':Number(_0x2ac20a[_0x576e('0x39')][_0x576e('0x60')][_0x306355]),'MailQueueId':Number(_0x2ac20a[_0x576e('0x2c')]['id'])});}return _0x4991a2;});}})[_0x576e('0x18')](respondWithResult(_0xe7cd79,null))[_0x576e('0x2b')](handleError(_0xe7cd79,null));};exports[_0x576e('0x79')]=function(_0x568578,_0x496023){return db[_0x576e('0x21')][_0x576e('0x37')]({'where':{'id':_0x568578[_0x576e('0x2c')]['id']}})[_0x576e('0x18')](handleEntityNotFound(_0x496023,null))[_0x576e('0x18')](function(_0x5934e5){if(_0x5934e5){return _0x5934e5[_0x576e('0x79')](_0x568578[_0x576e('0x28')][_0x576e('0x60')])[_0x576e('0x18')](function(){if(_[_0x576e('0x7a')](_0x568578[_0x576e('0x28')][_0x576e('0x60')])){for(var _0x217479=0x0;_0x217479<_0x568578[_0x576e('0x28')]['ids'][_0x576e('0x33')];_0x217479+=0x1){socket[_0x576e('0x5e')]('userMailQueue:remove',{'UserId':Number(_0x568578[_0x576e('0x28')][_0x576e('0x60')][_0x217479]),'MailQueueId':Number(_0x568578[_0x576e('0x2c')]['id'])});}}else{socket[_0x576e('0x5e')]('userMailQueue:remove',{'UserId':Number(_0x568578[_0x576e('0x28')][_0x576e('0x60')]),'MailQueueId':Number(_0x568578[_0x576e('0x2c')]['id'])});}});}})[_0x576e('0x18')](respondWithStatusCode(_0x496023,null))[_0x576e('0x2b')](handleError(_0x496023,null));};exports[_0x576e('0x7b')]=function(_0x32f147,_0x28242c){var _0x39ccd4={};var _0x5b1cac={};var _0x2eda06;var _0x12f4db;return db[_0x576e('0x21')]['findOne']({'where':{'id':_0x32f147[_0x576e('0x2c')]['id']}})['then'](handleEntityNotFound(_0x28242c,null))[_0x576e('0x18')](function(_0x130a7d){if(_0x130a7d){_0x2eda06=_0x130a7d;_0x5b1cac['model']=_[_0x576e('0x2e')](db[_0x576e('0x4c')][_0x576e('0x22')]);_0x5b1cac[_0x576e('0x28')]=_[_0x576e('0x2e')](_0x32f147[_0x576e('0x28')]);_0x5b1cac[_0x576e('0x2f')]=_[_0x576e('0x30')](_0x5b1cac['model'],_0x5b1cac[_0x576e('0x28')]);_0x39ccd4[_0x576e('0x32')]=_[_0x576e('0x30')](_0x5b1cac['model'],qs['fields'](_0x32f147[_0x576e('0x28')][_0x576e('0x31')]));_0x39ccd4[_0x576e('0x32')]=_0x39ccd4[_0x576e('0x32')][_0x576e('0x33')]?_0x39ccd4[_0x576e('0x32')]:_0x5b1cac[_0x576e('0x2d')];_0x39ccd4[_0x576e('0x48')]=qs[_0x576e('0x49')](_0x32f147[_0x576e('0x28')][_0x576e('0x49')]);_0x39ccd4[_0x576e('0x26')]=qs[_0x576e('0x2f')](_['pick'](_0x32f147['query'],_0x5b1cac[_0x576e('0x2f')]));if(_0x32f147['query']['filter']){_0x39ccd4['where']=_[_0x576e('0x35')](_0x39ccd4[_0x576e('0x26')],{'$or':_['map'](_0x39ccd4[_0x576e('0x32')],function(_0x5eaa9a){var _0x23b476={};_0x23b476[_0x5eaa9a]={'$like':'%'+_0x32f147[_0x576e('0x28')]['filter']+'%'};return _0x23b476;})});}_0x39ccd4=_[_0x576e('0x35')]({},_0x39ccd4,_0x32f147[_0x576e('0x36')]);return _0x2eda06[_0x576e('0x7b')](_0x39ccd4);}})[_0x576e('0x18')](function(_0x187dcd){if(_0x187dcd){_0x12f4db=_0x187dcd[_0x576e('0x33')];if(!_0x32f147[_0x576e('0x28')][_0x576e('0x46')](_0x576e('0x47'))){_0x39ccd4['limit']=qs['limit'](_0x32f147[_0x576e('0x28')]['limit']);_0x39ccd4[_0x576e('0x10')]=qs['offset'](_0x32f147[_0x576e('0x28')][_0x576e('0x10')]);}return _0x2eda06[_0x576e('0x7b')](_0x39ccd4);}})[_0x576e('0x18')](function(_0x38cc8c){if(_0x38cc8c){return _0x38cc8c?{'count':_0x12f4db,'rows':_0x38cc8c}:null;}})[_0x576e('0x18')](respondWithResult(_0x28242c,null))[_0x576e('0x2b')](handleError(_0x28242c,null));}; \ No newline at end of file +var _0x7dc5=['removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','value','removeAgents','userMailQueue:remove','addAgents','spread','isArray','getAgents','bluebird','squel','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','status','end','undefined','offset','Content-Range','json','then','destroy','get','MailQueues','UserProfileResource','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','getOptions','where','count','include','query','findAll','rows','catch','show','params','keys','MailQueue','intersection','model','attributes','fields','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','describe','getMembers','findOne','filters','hasOwnProperty','nolimit','limit','order','sort','pick','MailQueueId','filter','merge','UserMailQueue','UserId','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save'];(function(_0x4619ea,_0x29b561){var _0x1b403f=function(_0x553190){while(--_0x553190){_0x4619ea['push'](_0x4619ea['shift']());}};_0x1b403f(++_0x29b561);}(_0x7dc5,0x90));var _0x57dc=function(_0x3a3758,_0x4dd8cf){_0x3a3758=_0x3a3758-0x0;var _0x1a9234=_0x7dc5[_0x3a3758];return _0x1a9234;};'use strict';var BPromise=require(_0x57dc('0x0'));var util=require('util');var _=require('lodash');var squel=require(_0x57dc('0x1'));var Redis=require('ioredis');var qs=require(_0x57dc('0x2'));var logger=require(_0x57dc('0x3'))('api');var config=require('../../config/environment');var db=require(_0x57dc('0x4'))['db'];config[_0x57dc('0x5')]=_[_0x57dc('0x6')](config[_0x57dc('0x5')],{'host':_0x57dc('0x7'),'port':0x18eb});var socket=require(_0x57dc('0x8'))(new Redis(config['redis']));require(_0x57dc('0x9'))['register'](socket);function respondWithStatusCode(_0x46be58,_0x34f1f0){_0x34f1f0=_0x34f1f0||0xcc;return function(_0x437c98){if(_0x437c98){return _0x46be58['sendStatus'](_0x34f1f0);}return _0x46be58[_0x57dc('0xa')](_0x34f1f0)[_0x57dc('0xb')]();};}function respondWithResult(_0x20555b,_0x6db873){_0x6db873=_0x6db873||0xc8;return function(_0x6183e4){if(_0x6183e4){return _0x20555b[_0x57dc('0xa')](_0x6db873)['json'](_0x6183e4);}};}function respondWithFilteredResult(_0x4eec2b,_0x106a0c){return function(_0x202771){if(_0x202771){var _0x3226b8=typeof _0x106a0c['offset']===_0x57dc('0xc')&&typeof _0x106a0c['limit']==='undefined';var _0x45773f=_0x202771['count'];var _0x28e419=_0x3226b8?0x0:_0x106a0c['offset'];var _0x297481=_0x3226b8?_0x202771['count']:_0x106a0c[_0x57dc('0xd')]+_0x106a0c['limit'];var _0xeef558;if(_0x297481>=_0x45773f){_0x297481=_0x45773f;_0xeef558=0xc8;}else{_0xeef558=0xce;}_0x4eec2b[_0x57dc('0xa')](_0xeef558);return _0x4eec2b['set'](_0x57dc('0xe'),_0x28e419+'-'+_0x297481+'/'+_0x45773f)[_0x57dc('0xf')](_0x202771);}return null;};}function saveUpdates(_0x2d8d34){return function(_0x63629d){if(_0x63629d){return _0x63629d['update'](_0x2d8d34)[_0x57dc('0x10')](function(_0x537d85){return _0x537d85;});}return null;};}function removeEntity(_0x396533){return function(_0x16183e){if(_0x16183e){return _0x16183e[_0x57dc('0x11')]()['then'](function(){var _0x3efe4b=_0x16183e[_0x57dc('0x12')]({'plain':!![]});var _0x854348=_0x57dc('0x13');return db[_0x57dc('0x14')][_0x57dc('0x11')]({'where':{'type':_0x854348,'resourceId':_0x3efe4b['id']}})[_0x57dc('0x10')](function(){return _0x16183e;});})[_0x57dc('0x10')](function(){_0x396533[_0x57dc('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x440a4e){return function(_0x11599a){if(!_0x11599a){_0x440a4e[_0x57dc('0x15')](0x194);}return _0x11599a;};}function handleError(_0x4fd52d,_0x35798c){_0x35798c=_0x35798c||0x1f4;return function(_0x3f8570){logger[_0x57dc('0x16')](_0x3f8570[_0x57dc('0x17')]);if(_0x3f8570[_0x57dc('0x18')]){delete _0x3f8570[_0x57dc('0x18')];}_0x4fd52d[_0x57dc('0xa')](_0x35798c)['send'](_0x3f8570);};}exports['index']=function(_0x15767e,_0x49ef3a){var _0x34c39e={};var _0x53dbfc={'count':0x0,'rows':[]};var _0x24bafe=_[_0x57dc('0x19')](db['MailQueue'][_0x57dc('0x1a')],function(_0x2eb8d5){return{'name':_0x2eb8d5[_0x57dc('0x1b')],'type':_0x2eb8d5[_0x57dc('0x1c')]['key']};});_0x34c39e=qs[_0x57dc('0x1d')](_0x24bafe,_0x15767e);var _0x5b637a={'where':_0x34c39e[_0x57dc('0x1e')]};return db['MailQueue'][_0x57dc('0x1f')](_0x5b637a)[_0x57dc('0x10')](function(_0x41eca3){_0x53dbfc[_0x57dc('0x1f')]=_0x41eca3;_0x34c39e['include']=qs[_0x57dc('0x20')](_0x15767e[_0x57dc('0x21')]);return db['MailQueue'][_0x57dc('0x22')](_0x34c39e);})[_0x57dc('0x10')](function(_0x52b116){_0x53dbfc[_0x57dc('0x23')]=_0x52b116;return _0x53dbfc;})['then'](respondWithFilteredResult(_0x49ef3a,_0x34c39e))[_0x57dc('0x24')](handleError(_0x49ef3a,null));};exports[_0x57dc('0x25')]=function(_0x50da8b,_0x55469e){var _0x221b07={'raw':!![],'where':{'id':_0x50da8b[_0x57dc('0x26')]['id']}},_0x204703={};_0x204703['model']=_[_0x57dc('0x27')](db[_0x57dc('0x28')]['rawAttributes']);_0x204703[_0x57dc('0x21')]=_[_0x57dc('0x27')](_0x50da8b[_0x57dc('0x21')]);_0x204703['filters']=_[_0x57dc('0x29')](_0x204703[_0x57dc('0x2a')],_0x204703[_0x57dc('0x21')]);_0x221b07[_0x57dc('0x2b')]=_[_0x57dc('0x29')](_0x204703[_0x57dc('0x2a')],qs[_0x57dc('0x2c')](_0x50da8b[_0x57dc('0x21')][_0x57dc('0x2c')]));_0x221b07[_0x57dc('0x2b')]=_0x221b07['attributes'][_0x57dc('0x2d')]?_0x221b07[_0x57dc('0x2b')]:_0x204703[_0x57dc('0x2a')];if(_0x50da8b[_0x57dc('0x21')]['includeAll']){_0x221b07[_0x57dc('0x20')]=[{'all':!![]}];}_0x221b07=_['merge']({},_0x221b07,_0x50da8b[_0x57dc('0x2e')]);return db[_0x57dc('0x28')][_0x57dc('0x2f')](_0x221b07)[_0x57dc('0x10')](handleEntityNotFound(_0x55469e,null))[_0x57dc('0x10')](respondWithResult(_0x55469e,null))[_0x57dc('0x24')](handleError(_0x55469e,null));};exports[_0x57dc('0x30')]=function(_0x427af8,_0x3e4bca){return db['MailQueue'][_0x57dc('0x30')](_0x427af8[_0x57dc('0x31')],{})[_0x57dc('0x10')](function(_0x57a893){var _0x5acdb5=_0x427af8[_0x57dc('0x32')][_0x57dc('0x12')]({'plain':!![]});if(!_0x5acdb5)throw new Error(_0x57dc('0x33'));if(_0x5acdb5[_0x57dc('0x34')]===_0x57dc('0x32')){var _0x4f8bcb=_0x57a893[_0x57dc('0x12')]({'plain':!![]});var _0x50a900=_0x57dc('0x13');return db[_0x57dc('0x35')][_0x57dc('0x2f')]({'where':{'name':_0x50a900,'userProfileId':_0x5acdb5[_0x57dc('0x36')]},'raw':!![]})[_0x57dc('0x10')](function(_0x3d91a0){if(_0x3d91a0&&_0x3d91a0['autoAssociation']===0x0){return db[_0x57dc('0x14')]['create']({'name':_0x4f8bcb[_0x57dc('0x18')],'resourceId':_0x4f8bcb['id'],'type':_0x3d91a0['name'],'sectionId':_0x3d91a0['id']},{})[_0x57dc('0x10')](function(){return _0x57a893;});}else{return _0x57a893;}})[_0x57dc('0x24')](function(_0x575376){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x575376);throw _0x575376;});}return _0x57a893;})[_0x57dc('0x10')](respondWithResult(_0x3e4bca,0xc9))[_0x57dc('0x24')](handleError(_0x3e4bca,null));};exports['update']=function(_0x150167,_0x631dcb){if(_0x150167[_0x57dc('0x31')]['id']){delete _0x150167[_0x57dc('0x31')]['id'];}return db[_0x57dc('0x28')]['find']({'where':{'id':_0x150167[_0x57dc('0x26')]['id']}})['then'](handleEntityNotFound(_0x631dcb,null))[_0x57dc('0x10')](saveUpdates(_0x150167[_0x57dc('0x31')],null))[_0x57dc('0x10')](respondWithResult(_0x631dcb,null))['catch'](handleError(_0x631dcb,null));};exports[_0x57dc('0x11')]=function(_0x248594,_0x357245){return db['MailQueue'][_0x57dc('0x2f')]({'where':{'id':_0x248594[_0x57dc('0x26')]['id']}})[_0x57dc('0x10')](handleEntityNotFound(_0x357245,null))[_0x57dc('0x10')](removeEntity(_0x357245,null))['catch'](handleError(_0x357245,null));};exports[_0x57dc('0x37')]=function(_0x45b93d,_0x5590c6){return db['MailQueue']['describe']()[_0x57dc('0x10')](respondWithResult(_0x5590c6,null))[_0x57dc('0x24')](handleError(_0x5590c6,null));};exports[_0x57dc('0x38')]=function(_0x4ab347,_0x2f88e3){var _0x569c27={'raw':!![],'where':{}},_0x224725={},_0x534a86;return db[_0x57dc('0x28')][_0x57dc('0x39')]({'where':{'id':_0x4ab347['params']['id']}})['then'](handleEntityNotFound(_0x2f88e3,null))[_0x57dc('0x10')](function(_0x5212b4){if(_0x5212b4){_0x534a86=_0x5212b4[_0x57dc('0x12')]({'plain':!![]});_0x224725[_0x57dc('0x2a')]=_[_0x57dc('0x27')](db['UserMailQueue'][_0x57dc('0x1a')]);_0x224725[_0x57dc('0x21')]=_[_0x57dc('0x27')](_0x4ab347[_0x57dc('0x21')]);_0x224725[_0x57dc('0x3a')]=_[_0x57dc('0x29')](_0x224725['model'],_0x224725[_0x57dc('0x21')]);_0x569c27[_0x57dc('0x2b')]=_['intersection'](_0x224725[_0x57dc('0x2a')],qs['fields'](_0x4ab347[_0x57dc('0x21')][_0x57dc('0x2c')]));_0x569c27[_0x57dc('0x2b')]=_0x569c27[_0x57dc('0x2b')]['length']?_0x569c27[_0x57dc('0x2b')]:_0x224725[_0x57dc('0x2a')];if(!_0x4ab347[_0x57dc('0x21')][_0x57dc('0x3b')](_0x57dc('0x3c'))){_0x569c27[_0x57dc('0x3d')]=qs[_0x57dc('0x3d')](_0x4ab347[_0x57dc('0x21')]['limit']);_0x569c27['offset']=qs['offset'](_0x4ab347[_0x57dc('0x21')][_0x57dc('0xd')]);}_0x569c27[_0x57dc('0x3e')]=qs['sort'](_0x4ab347[_0x57dc('0x21')][_0x57dc('0x3f')]);_0x569c27['where']=qs['filters'](_[_0x57dc('0x40')](_0x4ab347[_0x57dc('0x21')],_0x224725[_0x57dc('0x3a')]));_0x569c27['where'][_0x57dc('0x41')]=_0x5212b4['id'];if(_0x4ab347[_0x57dc('0x21')][_0x57dc('0x42')]){_0x569c27['where']=_['merge'](_0x569c27[_0x57dc('0x1e')],{'$or':_[_0x57dc('0x19')](_0x569c27[_0x57dc('0x2b')],function(_0x2f3b3a){var _0xf84740={};_0xf84740[_0x2f3b3a]={'$like':'%'+_0x4ab347[_0x57dc('0x21')][_0x57dc('0x42')]+'%'};return _0xf84740;})});}_0x569c27=_[_0x57dc('0x43')]({},_0x569c27,_0x4ab347[_0x57dc('0x2e')]);return db[_0x57dc('0x44')]['findAll'](_0x569c27);}})[_0x57dc('0x10')](function(_0x468ebf){if(_0x468ebf){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x468ebf,_0x57dc('0x45')),'role':'agent'},'attributes':['id',_0x57dc('0x18'),_0x57dc('0x46'),_0x57dc('0x47'),_0x57dc('0x48')]});}})[_0x57dc('0x10')](function(_0x5ecdf9){if(_0x5ecdf9){return{'count':_0x5ecdf9[_0x57dc('0x1f')],'rows':_[_0x57dc('0x19')](_0x5ecdf9['rows'],function(_0x3b8321){return{'membername':_0x3b8321[_0x57dc('0x18')],'UserId':_0x3b8321['id'],'queue_name':_0x534a86['name'],'MailQueueId':_0x534a86['id'],'interface':util[_0x57dc('0x49')](_0x57dc('0x4a'),_0x57dc('0x4b'),_0x3b8321[_0x57dc('0x18')]),'penalty':0x0,'paused':_0x3b8321[_0x57dc('0x46')],'createdAt':_0x3b8321[_0x57dc('0x48')],'updatedAt':_0x3b8321[_0x57dc('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x57dc('0x10')](respondWithFilteredResult(_0x2f88e3,_0x569c27))[_0x57dc('0x24')](handleError(_0x2f88e3,null));};exports[_0x57dc('0x4c')]=function(_0x20eb5d,_0x1b98ac){var _0x2fe865={};var _0x1aa17a={};var _0x32599e;var _0x39c754;return db[_0x57dc('0x28')][_0x57dc('0x39')]({'where':{'id':_0x20eb5d[_0x57dc('0x26')]['id']}})[_0x57dc('0x10')](handleEntityNotFound(_0x1b98ac,null))['then'](function(_0x455090){if(_0x455090){_0x32599e=_0x455090;_0x1aa17a[_0x57dc('0x2a')]=_['keys'](db[_0x57dc('0x4d')]['rawAttributes']);_0x1aa17a[_0x57dc('0x21')]=_['keys'](_0x20eb5d[_0x57dc('0x21')]);_0x1aa17a[_0x57dc('0x3a')]=_['intersection'](_0x1aa17a['model'],_0x1aa17a[_0x57dc('0x21')]);_0x2fe865[_0x57dc('0x2b')]=_[_0x57dc('0x29')](_0x1aa17a[_0x57dc('0x2a')],qs[_0x57dc('0x2c')](_0x20eb5d[_0x57dc('0x21')][_0x57dc('0x2c')]));_0x2fe865[_0x57dc('0x2b')]=_0x2fe865[_0x57dc('0x2b')][_0x57dc('0x2d')]?_0x2fe865[_0x57dc('0x2b')]:_0x1aa17a[_0x57dc('0x2a')];_0x2fe865['order']=qs[_0x57dc('0x3f')](_0x20eb5d[_0x57dc('0x21')]['sort']);_0x2fe865[_0x57dc('0x1e')]=qs[_0x57dc('0x3a')](_[_0x57dc('0x40')](_0x20eb5d[_0x57dc('0x21')],_0x1aa17a[_0x57dc('0x3a')]));if(_0x20eb5d[_0x57dc('0x21')][_0x57dc('0x42')]){_0x2fe865['where']=_[_0x57dc('0x43')](_0x2fe865[_0x57dc('0x1e')],{'$or':_[_0x57dc('0x19')](_0x2fe865[_0x57dc('0x2b')],function(_0x492525){var _0xe26605={};_0xe26605[_0x492525]={'$like':'%'+_0x20eb5d['query'][_0x57dc('0x42')]+'%'};return _0xe26605;})});}_0x2fe865=_[_0x57dc('0x43')]({},_0x2fe865,_0x20eb5d[_0x57dc('0x2e')]);return _0x32599e['getTeams'](_0x2fe865);}})[_0x57dc('0x10')](function(_0x14a3fc){if(_0x14a3fc){_0x39c754=_0x14a3fc[_0x57dc('0x2d')];if(!_0x20eb5d['query'][_0x57dc('0x3b')](_0x57dc('0x3c'))){_0x2fe865['limit']=qs[_0x57dc('0x3d')](_0x20eb5d['query'][_0x57dc('0x3d')]);_0x2fe865[_0x57dc('0xd')]=qs[_0x57dc('0xd')](_0x20eb5d['query'][_0x57dc('0xd')]);}return _0x32599e[_0x57dc('0x4c')](_0x2fe865);}})[_0x57dc('0x10')](function(_0x4ad380){if(_0x4ad380){return _0x4ad380?{'count':_0x39c754,'rows':_0x4ad380}:null;}})[_0x57dc('0x10')](respondWithResult(_0x1b98ac,null))['catch'](handleError(_0x1b98ac,null));};exports[_0x57dc('0x4e')]=function(_0xd1362e,_0x53fd94){var _0x1b0c06=_0xd1362e[_0x57dc('0x31')][_0x57dc('0x4f')];return db[_0x57dc('0x4d')][_0x57dc('0x22')]({'where':{'id':_0x1b0c06},'attributes':['id'],'include':[{'model':db[_0x57dc('0x50')],'as':_0x57dc('0x51'),'attributes':['id','name',_0x57dc('0x52'),'voicePause',_0x57dc('0x53')],'raw':!![]}]})[_0x57dc('0x10')](function(_0x176ec5){if(_0x176ec5){var _0xba8669=_[_0x57dc('0x54')](_0x176ec5,function(_0x3b6de0){var _0x5efb48=_0x3b6de0[_0x57dc('0x12')]({'plain':!![]});return _0x5efb48[_0x57dc('0x51')];});return db[_0x57dc('0x28')][_0x57dc('0x2f')]({'where':{'id':_0xd1362e['params']['id']}})[_0x57dc('0x10')](function(_0x3b5c61){return db[_0x57dc('0x55')][_0x57dc('0x56')](function(_0x4cdb5b){return _0x3b5c61[_0x57dc('0x4e')](_0x1b0c06,{'transaction':_0x4cdb5b})['then'](function(){return BPromise[_0x57dc('0x57')](_0xba8669,function(_0x152703){return db['UserMailQueue'][_0x57dc('0x58')]({'where':{'UserId':_0x152703['id'],'MailQueueId':_0xd1362e[_0x57dc('0x26')]['id']},'transaction':_0x4cdb5b});});})['then'](function(){_0xba8669[_0x57dc('0x59')](function(_0x14ac2d){socket[_0x57dc('0x5a')](_0x57dc('0x5b'),{'UserId':_0x14ac2d['id'],'MailQueueId':_0x3b5c61['id']});});});});});}})['then'](respondWithStatusCode(_0x53fd94,null))[_0x57dc('0x24')](handleError(_0x53fd94,null));};exports[_0x57dc('0x5c')]=function(_0x4296d2,_0x13b11d){return db['Team']['findAll']({'where':{'id':_0x4296d2[_0x57dc('0x21')][_0x57dc('0x4f')]},'attributes':['id'],'include':[{'model':db[_0x57dc('0x50')],'as':_0x57dc('0x51'),'attributes':['id'],'raw':!![]}]})[_0x57dc('0x10')](handleEntityNotFound(_0x13b11d,null))[_0x57dc('0x10')](function(_0x5618d7){var _0x364111=_[_0x57dc('0x19')](_0x5618d7,'id');var _0x402308=[];var _0x1cc8e2=[];var _0x343f45=squel[_0x57dc('0x5d')]();_0x343f45[_0x57dc('0x5e')](_0x57dc('0x5f'))[_0x57dc('0x60')](_0x57dc('0x61'),'tq')[_0x57dc('0x62')](_0x57dc('0x63'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x57dc('0x64'),_0x4296d2[_0x57dc('0x26')]['id']);for(var _0x34cdba=0x0;_0x34cdba<_0x5618d7[_0x57dc('0x2d')];_0x34cdba+=0x1){let _0x165aaf=_0x5618d7[_0x34cdba];for(var _0xfb681d=0x0;_0xfb681d<_0x165aaf[_0x57dc('0x51')][_0x57dc('0x2d')];_0xfb681d+=0x1){let _0x164dba=_0x165aaf[_0x57dc('0x51')][_0xfb681d];var _0x46eba7=_0x343f45[_0x57dc('0x65')]();_0x46eba7[_0x57dc('0x1e')](_0x57dc('0x66'),_0x164dba['id']);_0x1cc8e2[_0x57dc('0x67')](db[_0x57dc('0x55')][_0x57dc('0x21')](_0x46eba7[_0x57dc('0x68')](),{'type':db[_0x57dc('0x55')]['QueryTypes'][_0x57dc('0x69')]})[_0x57dc('0x10')](function(_0x166bca){if(_0x166bca[_0x57dc('0x2d')]===0x1){return _0x164dba['id'];}else{var _0x4f5d11=_[_0x57dc('0x6a')](_['map'](_0x166bca,_0x57dc('0x6b')),function(_0x2e904f){return _[_0x57dc('0x6c')](_0x364111,_0x2e904f);});if(_0x4f5d11){return _0x164dba['id'];}}}));}}return BPromise[_0x57dc('0x6d')](_0x1cc8e2)[_0x57dc('0x10')](function(_0xa1cd87){_0x402308=_(_0x402308)[_0x57dc('0x6e')](_0xa1cd87)['compact']()[_0x57dc('0x6f')]();return db[_0x57dc('0x28')][_0x57dc('0x2f')]({'where':{'id':_0x4296d2[_0x57dc('0x26')]['id']}})[_0x57dc('0x10')](function(_0x24300c){return db[_0x57dc('0x55')]['transaction'](function(_0x27de3c){return _0x24300c['removeTeams'](_0x4296d2['query']['ids'],{'transaction':_0x27de3c})[_0x57dc('0x10')](function(){if(!_['isEmpty'](_0x402308)){return _0x24300c[_0x57dc('0x70')](_0x402308,{'transaction':_0x27de3c});}})[_0x57dc('0x10')](function(){_0x402308[_0x57dc('0x59')](function(_0x1b2f9c){socket[_0x57dc('0x5a')](_0x57dc('0x71'),{'UserId':_0x1b2f9c,'MailQueueId':_0x24300c['id']});});});});});});})[_0x57dc('0x10')](respondWithStatusCode(_0x13b11d,null))[_0x57dc('0x24')](handleError(_0x13b11d,null));};exports['addAgents']=function(_0x2af5ad,_0x3bd407){return db['MailQueue'][_0x57dc('0x2f')]({'where':{'id':_0x2af5ad[_0x57dc('0x26')]['id']}})[_0x57dc('0x10')](handleEntityNotFound(_0x3bd407,null))[_0x57dc('0x10')](function(_0x5a2aa7){if(_0x5a2aa7){return _0x5a2aa7[_0x57dc('0x72')](_0x2af5ad[_0x57dc('0x31')]['ids'],_['omit'](_0x2af5ad[_0x57dc('0x31')],['ids','id'])||{})[_0x57dc('0x73')](function(_0x258286){for(var _0x536367=0x0;_0x536367<_0x2af5ad[_0x57dc('0x31')]['ids'][_0x57dc('0x2d')];_0x536367+=0x1){socket[_0x57dc('0x5a')](_0x57dc('0x5b'),{'UserId':Number(_0x2af5ad[_0x57dc('0x31')][_0x57dc('0x4f')][_0x536367]),'MailQueueId':Number(_0x2af5ad[_0x57dc('0x26')]['id'])});}return _0x258286;});}})[_0x57dc('0x10')](respondWithResult(_0x3bd407,null))['catch'](handleError(_0x3bd407,null));};exports['removeAgents']=function(_0x5d95e2,_0x256813){return db[_0x57dc('0x28')]['find']({'where':{'id':_0x5d95e2[_0x57dc('0x26')]['id']}})[_0x57dc('0x10')](handleEntityNotFound(_0x256813,null))['then'](function(_0x4b81ee){if(_0x4b81ee){return _0x4b81ee[_0x57dc('0x70')](_0x5d95e2[_0x57dc('0x21')][_0x57dc('0x4f')])[_0x57dc('0x10')](function(){if(_[_0x57dc('0x74')](_0x5d95e2['query']['ids'])){for(var _0x5e5e72=0x0;_0x5e5e72<_0x5d95e2[_0x57dc('0x21')][_0x57dc('0x4f')]['length'];_0x5e5e72+=0x1){socket['emit'](_0x57dc('0x71'),{'UserId':Number(_0x5d95e2[_0x57dc('0x21')][_0x57dc('0x4f')][_0x5e5e72]),'MailQueueId':Number(_0x5d95e2['params']['id'])});}}else{socket[_0x57dc('0x5a')](_0x57dc('0x71'),{'UserId':Number(_0x5d95e2[_0x57dc('0x21')][_0x57dc('0x4f')]),'MailQueueId':Number(_0x5d95e2['params']['id'])});}});}})[_0x57dc('0x10')](respondWithStatusCode(_0x256813,null))[_0x57dc('0x24')](handleError(_0x256813,null));};exports['getAgents']=function(_0x18e6ec,_0x38ca2e){var _0x5c95c4={};var _0x94a427={};var _0x46df8d;var _0x58554c;return db[_0x57dc('0x28')][_0x57dc('0x39')]({'where':{'id':_0x18e6ec[_0x57dc('0x26')]['id']}})[_0x57dc('0x10')](handleEntityNotFound(_0x38ca2e,null))[_0x57dc('0x10')](function(_0x189cce){if(_0x189cce){_0x46df8d=_0x189cce;_0x94a427[_0x57dc('0x2a')]=_[_0x57dc('0x27')](db[_0x57dc('0x50')]['rawAttributes']);_0x94a427[_0x57dc('0x21')]=_[_0x57dc('0x27')](_0x18e6ec['query']);_0x94a427[_0x57dc('0x3a')]=_[_0x57dc('0x29')](_0x94a427[_0x57dc('0x2a')],_0x94a427['query']);_0x5c95c4['attributes']=_[_0x57dc('0x29')](_0x94a427['model'],qs[_0x57dc('0x2c')](_0x18e6ec[_0x57dc('0x21')][_0x57dc('0x2c')]));_0x5c95c4['attributes']=_0x5c95c4[_0x57dc('0x2b')]['length']?_0x5c95c4[_0x57dc('0x2b')]:_0x94a427[_0x57dc('0x2a')];_0x5c95c4[_0x57dc('0x3e')]=qs[_0x57dc('0x3f')](_0x18e6ec[_0x57dc('0x21')][_0x57dc('0x3f')]);_0x5c95c4[_0x57dc('0x1e')]=qs[_0x57dc('0x3a')](_[_0x57dc('0x40')](_0x18e6ec[_0x57dc('0x21')],_0x94a427[_0x57dc('0x3a')]));if(_0x18e6ec[_0x57dc('0x21')][_0x57dc('0x42')]){_0x5c95c4['where']=_[_0x57dc('0x43')](_0x5c95c4[_0x57dc('0x1e')],{'$or':_[_0x57dc('0x19')](_0x5c95c4[_0x57dc('0x2b')],function(_0x2f3a0b){var _0x37fc58={};_0x37fc58[_0x2f3a0b]={'$like':'%'+_0x18e6ec['query']['filter']+'%'};return _0x37fc58;})});}_0x5c95c4=_[_0x57dc('0x43')]({},_0x5c95c4,_0x18e6ec[_0x57dc('0x2e')]);return _0x46df8d[_0x57dc('0x75')](_0x5c95c4);}})[_0x57dc('0x10')](function(_0x5c5688){if(_0x5c5688){_0x58554c=_0x5c5688[_0x57dc('0x2d')];if(!_0x18e6ec[_0x57dc('0x21')][_0x57dc('0x3b')](_0x57dc('0x3c'))){_0x5c95c4[_0x57dc('0x3d')]=qs['limit'](_0x18e6ec[_0x57dc('0x21')][_0x57dc('0x3d')]);_0x5c95c4[_0x57dc('0xd')]=qs[_0x57dc('0xd')](_0x18e6ec['query']['offset']);}return _0x46df8d[_0x57dc('0x75')](_0x5c95c4);}})[_0x57dc('0x10')](function(_0x42f36a){if(_0x42f36a){return _0x42f36a?{'count':_0x58554c,'rows':_0x42f36a}:null;}})[_0x57dc('0x10')](respondWithResult(_0x38ca2e,null))[_0x57dc('0x24')](handleError(_0x38ca2e,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 93af3d4..ad9fb53 100644 --- a/server/api/mailQueue/mailQueue.events.js +++ b/server/api/mailQueue/mailQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6da=['setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','MailQueue'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xf6da,0x1c8));var _0xaf6d=function(_0x4959ca,_0x568f2d){_0x4959ca=_0x4959ca-0x0;var _0x31a3fe=_0xf6da[_0x4959ca];return _0x31a3fe;};'use strict';var EventEmitter=require(_0xaf6d('0x0'));var MailQueue=require(_0xaf6d('0x1'))['db'][_0xaf6d('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xaf6d('0x3')](0x0);var events={'afterCreate':_0xaf6d('0x4'),'afterUpdate':'update','afterDestroy':_0xaf6d('0x5')};function emitEvent(_0x5e3164){return function(_0x977dd8,_0x356c20,_0x54c6a0){MailQueueEvents['emit'](_0x5e3164+':'+_0x977dd8['id'],_0x977dd8);MailQueueEvents[_0xaf6d('0x6')](_0x5e3164,_0x977dd8);_0x54c6a0(null);};}for(var e in events){if(events[_0xaf6d('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xaf6d('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x4f75=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','save'];(function(_0x4deff,_0x42c328){var _0x440123=function(_0x2d7dde){while(--_0x2d7dde){_0x4deff['push'](_0x4deff['shift']());}};_0x440123(++_0x42c328);}(_0x4f75,0x164));var _0x54f7=function(_0x1ade94,_0x240455){_0x1ade94=_0x1ade94-0x0;var _0xbf29aa=_0x4f75[_0x1ade94];return _0xbf29aa;};'use strict';var EventEmitter=require(_0x54f7('0x0'));var MailQueue=require(_0x54f7('0x1'))['db'][_0x54f7('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x54f7('0x3'),'afterUpdate':_0x54f7('0x4'),'afterDestroy':_0x54f7('0x5')};function emitEvent(_0x476b7a){return function(_0xdf7011,_0x51366e,_0x2528c2){MailQueueEvents[_0x54f7('0x6')](_0x476b7a+':'+_0xdf7011['id'],_0xdf7011);MailQueueEvents[_0x54f7('0x6')](_0x476b7a,_0xdf7011);_0x2528c2(null);};}for(var e in events){if(events[_0x54f7('0x7')](e)){var event=events[e];MailQueue[_0x54f7('0x8')](e,emitEvent(event));}}module[_0x54f7('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index f636cc7..bedc4df 100644 --- a/server/api/mailQueue/mailQueue.model.js +++ b/server/api/mailQueue/mailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ae4=['path','../../config/environment','exports','define','MailQueue','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x3ae4,0x191));var _0x43ae=function(_0x2364a2,_0x5c9194){_0x2364a2=_0x2364a2-0x0;var _0x5d72e0=_0x3ae4[_0x2364a2];return _0x5d72e0;};'use strict';var _=require(_0x43ae('0x0'));var util=require(_0x43ae('0x1'));var logger=require(_0x43ae('0x2'))(_0x43ae('0x3'));var moment=require(_0x43ae('0x4'));var BPromise=require('bluebird');var rp=require(_0x43ae('0x5'));var fs=require('fs');var path=require(_0x43ae('0x6'));var rimraf=require('rimraf');var config=require(_0x43ae('0x7'));var attributes=require('./mailQueue.attributes');module[_0x43ae('0x8')]=function(_0x10cbe4,_0x1af3d5){return _0x10cbe4[_0x43ae('0x9')](_0x43ae('0xa'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0172=['util','bluebird','request-promise','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash'];(function(_0x45a541,_0x55e3c9){var _0x27cae8=function(_0x2648dd){while(--_0x2648dd){_0x45a541['push'](_0x45a541['shift']());}};_0x27cae8(++_0x55e3c9);}(_0x0172,0xf1));var _0x2017=function(_0x3bb75e,_0x4f9e49){_0x3bb75e=_0x3bb75e-0x0;var _0x818544=_0x0172[_0x3bb75e];return _0x818544;};'use strict';var _=require(_0x2017('0x0'));var util=require(_0x2017('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2017('0x2'));var rp=require(_0x2017('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2017('0x4'));var config=require(_0x2017('0x5'));var attributes=require(_0x2017('0x6'));module[_0x2017('0x7')]=function(_0x2f0b4a,_0x3ae857){return _0x2f0b4a[_0x2017('0x8')](_0x2017('0x9'),attributes,{'tableName':_0x2017('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 9c47288..133ddca 100644 --- a/server/api/mailQueue/mailQueue.rpc.js +++ b/server/api/mailQueue/mailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c75=['message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','map','model','include','find','ShowMailQueue','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./mailQueue.socket','register','request','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','MailQueue,\x20%s,\x20%s'];(function(_0x1e5971,_0x5dbf16){var _0x1d4474=function(_0x1be729){while(--_0x1be729){_0x1e5971['push'](_0x1e5971['shift']());}};_0x1d4474(++_0x5dbf16);}(_0x1c75,0xf4));var _0x51c7=function(_0x241c21,_0x11b64b){_0x241c21=_0x241c21-0x0;var _0x1ffb9e=_0x1c75[_0x241c21];return _0x1ffb9e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x51c7('0x0'));var rs=require(_0x51c7('0x1'));var fs=require('fs');var Redis=require(_0x51c7('0x2'));var db=require(_0x51c7('0x3'))['db'];var utils=require(_0x51c7('0x4'));var logger=require('../../config/logger')(_0x51c7('0x5'));var config=require('../../config/environment');var jayson=require(_0x51c7('0x6'));var client=jayson['client'][_0x51c7('0x7')]({'port':0x232a});config[_0x51c7('0x8')]=_[_0x51c7('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x51c7('0xa'))(new Redis(config[_0x51c7('0x8')]));require(_0x51c7('0xb'))[_0x51c7('0xc')](socket);function respondWithRpcPromise(_0x457754,_0x24bd16,_0x59c875){return new BPromise(function(_0x178427,_0x35b294){return client[_0x51c7('0xd')](_0x457754,_0x59c875)[_0x51c7('0xe')](function(_0x26e274){logger[_0x51c7('0xf')]('MailQueue,\x20%s,\x20%s',_0x24bd16,_0x51c7('0x10'));logger[_0x51c7('0x11')](_0x51c7('0x12'),_0x24bd16,_0x51c7('0x10'),JSON[_0x51c7('0x13')](_0x26e274));if(_0x26e274[_0x51c7('0x14')]){if(_0x26e274[_0x51c7('0x14')]['code']===0x1f4){logger[_0x51c7('0x14')](_0x51c7('0x15'),_0x24bd16,_0x26e274['error'][_0x51c7('0x16')]);return _0x35b294(_0x26e274[_0x51c7('0x14')][_0x51c7('0x16')]);}logger['error'](_0x51c7('0x15'),_0x24bd16,_0x26e274[_0x51c7('0x14')][_0x51c7('0x16')]);return _0x178427(_0x26e274[_0x51c7('0x14')][_0x51c7('0x16')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x24bd16,'request\x20sent');_0x178427(_0x26e274[_0x51c7('0x17')][_0x51c7('0x16')]);}})[_0x51c7('0x18')](function(_0x3a0f0b){logger['error'](_0x51c7('0x15'),_0x24bd16,_0x3a0f0b);_0x35b294(_0x3a0f0b);});});}exports[_0x51c7('0x19')]=function(_0x300abf){var _0x1fe376=this;return new Promise(function(_0x357ede,_0x529384){return db[_0x51c7('0x1a')][_0x51c7('0x1b')]({'raw':_0x300abf[_0x51c7('0x1c')]?_0x300abf[_0x51c7('0x1c')][_0x51c7('0x1d')]===undefined?!![]:![]:!![],'where':_0x300abf[_0x51c7('0x1c')]?_0x300abf['options'][_0x51c7('0x1e')]||null:null,'attributes':_0x300abf[_0x51c7('0x1c')]?_0x300abf[_0x51c7('0x1c')][_0x51c7('0x1f')]||null:null,'limit':_0x300abf[_0x51c7('0x1c')]?_0x300abf[_0x51c7('0x1c')][_0x51c7('0x20')]||null:null,'include':_0x300abf[_0x51c7('0x1c')]?_0x300abf[_0x51c7('0x1c')]['include']?_[_0x51c7('0x21')](_0x300abf[_0x51c7('0x1c')]['include'],function(_0x512290){return{'model':db[_0x512290[_0x51c7('0x22')]],'as':_0x512290['as'],'attributes':_0x512290[_0x51c7('0x1f')],'include':_0x512290[_0x51c7('0x23')]?_[_0x51c7('0x21')](_0x512290[_0x51c7('0x23')],function(_0x2dfac6){return{'model':db[_0x2dfac6[_0x51c7('0x22')]],'as':_0x2dfac6['as'],'attributes':_0x2dfac6[_0x51c7('0x1f')],'include':_0x2dfac6[_0x51c7('0x23')]?_['map'](_0x2dfac6['include'],function(_0x35d329){return{'model':db[_0x35d329[_0x51c7('0x22')]],'as':_0x35d329['as'],'attributes':_0x35d329[_0x51c7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x51c7('0xe')](function(_0x4f7481){logger[_0x51c7('0xf')](_0x51c7('0x19'),_0x300abf);logger[_0x51c7('0x11')]('GetMailQueue',_0x300abf,JSON[_0x51c7('0x13')](_0x4f7481));_0x357ede(_0x4f7481);})['catch'](function(_0x1c10d3){logger[_0x51c7('0x14')](_0x51c7('0x19'),_0x1c10d3[_0x51c7('0x16')],_0x300abf);_0x529384(_0x1fe376[_0x51c7('0x14')](0x1f4,_0x1c10d3[_0x51c7('0x16')]));});});};exports['ShowMailQueue']=function(_0x2560a3){var _0x47c059=this;return new Promise(function(_0x3d95ac,_0x5edb43){return db[_0x51c7('0x1a')][_0x51c7('0x24')]({'raw':_0x2560a3['options']?_0x2560a3[_0x51c7('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2560a3[_0x51c7('0x1c')]?_0x2560a3[_0x51c7('0x1c')]['where']||null:null,'attributes':_0x2560a3[_0x51c7('0x1c')]?_0x2560a3['options'][_0x51c7('0x1f')]||null:null,'include':_0x2560a3[_0x51c7('0x1c')]?_0x2560a3[_0x51c7('0x1c')][_0x51c7('0x23')]?_[_0x51c7('0x21')](_0x2560a3[_0x51c7('0x1c')][_0x51c7('0x23')],function(_0x30f375){return{'model':db[_0x30f375[_0x51c7('0x22')]],'as':_0x30f375['as'],'attributes':_0x30f375[_0x51c7('0x1f')],'include':_0x30f375[_0x51c7('0x23')]?_[_0x51c7('0x21')](_0x30f375[_0x51c7('0x23')],function(_0x86b356){return{'model':db[_0x86b356['model']],'as':_0x86b356['as'],'attributes':_0x86b356['attributes'],'include':_0x86b356[_0x51c7('0x23')]?_[_0x51c7('0x21')](_0x86b356[_0x51c7('0x23')],function(_0x350629){return{'model':db[_0x350629[_0x51c7('0x22')]],'as':_0x350629['as'],'attributes':_0x350629[_0x51c7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x51c7('0xe')](function(_0x31a0a6){logger[_0x51c7('0xf')](_0x51c7('0x25'),_0x2560a3);logger[_0x51c7('0x11')](_0x51c7('0x25'),_0x2560a3,JSON[_0x51c7('0x13')](_0x31a0a6));_0x3d95ac(_0x31a0a6);})[_0x51c7('0x18')](function(_0x1f27c6){logger[_0x51c7('0x14')]('ShowMailQueue',_0x1f27c6[_0x51c7('0x16')],_0x2560a3);_0x5edb43(_0x47c059[_0x51c7('0x14')](0x1f4,_0x1f27c6['message']));});});}; \ No newline at end of file +var _0xadb2=['attributes','find','where','ShowMailQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','localhost','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailQueue','MailQueue','findAll','options','raw','include','map','model'];(function(_0x23c6f2,_0x4e033c){var _0x4c270b=function(_0x4913f0){while(--_0x4913f0){_0x23c6f2['push'](_0x23c6f2['shift']());}};_0x4c270b(++_0x4e033c);}(_0xadb2,0x15a));var _0x2adb=function(_0x116994,_0x25a5ca){_0x116994=_0x116994-0x0;var _0x4f3791=_0xadb2[_0x116994];return _0x4f3791;};'use strict';var _=require(_0x2adb('0x0'));var util=require(_0x2adb('0x1'));var moment=require(_0x2adb('0x2'));var BPromise=require(_0x2adb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2adb('0x4'));var db=require(_0x2adb('0x5'))['db'];var utils=require(_0x2adb('0x6'));var logger=require(_0x2adb('0x7'))('rpc');var config=require(_0x2adb('0x8'));var jayson=require(_0x2adb('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x2adb('0xa')]=_['defaults'](config['redis'],{'host':_0x2adb('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2adb('0xa')]));require(_0x2adb('0xc'))[_0x2adb('0xd')](socket);function respondWithRpcPromise(_0x569a63,_0x47e8ff,_0x474d6b){return new BPromise(function(_0x302a93,_0x356697){return client[_0x2adb('0xe')](_0x569a63,_0x474d6b)[_0x2adb('0xf')](function(_0x5c9a88){logger[_0x2adb('0x10')](_0x2adb('0x11'),_0x47e8ff,_0x2adb('0x12'));logger[_0x2adb('0x13')](_0x2adb('0x14'),_0x47e8ff,_0x2adb('0x12'),JSON[_0x2adb('0x15')](_0x5c9a88));if(_0x5c9a88[_0x2adb('0x16')]){if(_0x5c9a88[_0x2adb('0x16')][_0x2adb('0x17')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x47e8ff,_0x5c9a88[_0x2adb('0x16')]['message']);return _0x356697(_0x5c9a88[_0x2adb('0x16')]['message']);}logger['error']('MailQueue,\x20%s,\x20%s',_0x47e8ff,_0x5c9a88[_0x2adb('0x16')]['message']);return _0x302a93(_0x5c9a88[_0x2adb('0x16')][_0x2adb('0x18')]);}else{logger[_0x2adb('0x10')]('MailQueue,\x20%s,\x20%s',_0x47e8ff,'request\x20sent');_0x302a93(_0x5c9a88['result']['message']);}})[_0x2adb('0x19')](function(_0x2a4a3a){logger[_0x2adb('0x16')]('MailQueue,\x20%s,\x20%s',_0x47e8ff,_0x2a4a3a);_0x356697(_0x2a4a3a);});});}exports[_0x2adb('0x1a')]=function(_0x403231){var _0x2bbd20=this;return new Promise(function(_0x480ce5,_0x1b535c){return db[_0x2adb('0x1b')][_0x2adb('0x1c')]({'raw':_0x403231[_0x2adb('0x1d')]?_0x403231[_0x2adb('0x1d')][_0x2adb('0x1e')]===undefined?!![]:![]:!![],'where':_0x403231['options']?_0x403231[_0x2adb('0x1d')]['where']||null:null,'attributes':_0x403231['options']?_0x403231['options']['attributes']||null:null,'limit':_0x403231[_0x2adb('0x1d')]?_0x403231[_0x2adb('0x1d')]['limit']||null:null,'include':_0x403231['options']?_0x403231[_0x2adb('0x1d')][_0x2adb('0x1f')]?_[_0x2adb('0x20')](_0x403231['options'][_0x2adb('0x1f')],function(_0x322ecd){return{'model':db[_0x322ecd[_0x2adb('0x21')]],'as':_0x322ecd['as'],'attributes':_0x322ecd[_0x2adb('0x22')],'include':_0x322ecd['include']?_[_0x2adb('0x20')](_0x322ecd[_0x2adb('0x1f')],function(_0x3225fd){return{'model':db[_0x3225fd[_0x2adb('0x21')]],'as':_0x3225fd['as'],'attributes':_0x3225fd[_0x2adb('0x22')],'include':_0x3225fd[_0x2adb('0x1f')]?_[_0x2adb('0x20')](_0x3225fd[_0x2adb('0x1f')],function(_0x5110d2){return{'model':db[_0x5110d2[_0x2adb('0x21')]],'as':_0x5110d2['as'],'attributes':_0x5110d2[_0x2adb('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2adb('0xf')](function(_0x2e6e17){logger['info']('GetMailQueue',_0x403231);logger[_0x2adb('0x13')](_0x2adb('0x1a'),_0x403231,JSON[_0x2adb('0x15')](_0x2e6e17));_0x480ce5(_0x2e6e17);})['catch'](function(_0x57ec65){logger[_0x2adb('0x16')](_0x2adb('0x1a'),_0x57ec65[_0x2adb('0x18')],_0x403231);_0x1b535c(_0x2bbd20['error'](0x1f4,_0x57ec65['message']));});});};exports['ShowMailQueue']=function(_0x148eef){var _0x149aef=this;return new Promise(function(_0x1d025b,_0x8ee4dc){return db['MailQueue'][_0x2adb('0x23')]({'raw':_0x148eef['options']?_0x148eef[_0x2adb('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x148eef[_0x2adb('0x1d')]?_0x148eef[_0x2adb('0x1d')][_0x2adb('0x24')]||null:null,'attributes':_0x148eef[_0x2adb('0x1d')]?_0x148eef[_0x2adb('0x1d')][_0x2adb('0x22')]||null:null,'include':_0x148eef[_0x2adb('0x1d')]?_0x148eef[_0x2adb('0x1d')]['include']?_[_0x2adb('0x20')](_0x148eef[_0x2adb('0x1d')][_0x2adb('0x1f')],function(_0x483166){return{'model':db[_0x483166[_0x2adb('0x21')]],'as':_0x483166['as'],'attributes':_0x483166[_0x2adb('0x22')],'include':_0x483166['include']?_['map'](_0x483166[_0x2adb('0x1f')],function(_0x37a09e){return{'model':db[_0x37a09e[_0x2adb('0x21')]],'as':_0x37a09e['as'],'attributes':_0x37a09e[_0x2adb('0x22')],'include':_0x37a09e[_0x2adb('0x1f')]?_['map'](_0x37a09e[_0x2adb('0x1f')],function(_0x717290){return{'model':db[_0x717290[_0x2adb('0x21')]],'as':_0x717290['as'],'attributes':_0x717290['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x295eae){logger[_0x2adb('0x10')](_0x2adb('0x25'),_0x148eef);logger[_0x2adb('0x13')]('ShowMailQueue',_0x148eef,JSON[_0x2adb('0x15')](_0x295eae));_0x1d025b(_0x295eae);})[_0x2adb('0x19')](function(_0x49211b){logger[_0x2adb('0x16')](_0x2adb('0x25'),_0x49211b[_0x2adb('0x18')],_0x148eef);_0x8ee4dc(_0x149aef['error'](0x1f4,_0x49211b[_0x2adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 6f30dca..0a2b196 100644 --- a/server/api/mailQueue/mailQueue.socket.js +++ b/server/api/mailQueue/mailQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0381=['removeListener','length','mailQueue:','./mailQueue.events','remove','update','emit'];(function(_0x3344da,_0x1e7c74){var _0x1b0a2a=function(_0x229eb9){while(--_0x229eb9){_0x3344da['push'](_0x3344da['shift']());}};_0x1b0a2a(++_0x1e7c74);}(_0x0381,0x13e));var _0x1038=function(_0x460033,_0x23a271){_0x460033=_0x460033-0x0;var _0x2283da=_0x0381[_0x460033];return _0x2283da;};'use strict';var MailQueueEvents=require(_0x1038('0x0'));var events=['save',_0x1038('0x1'),_0x1038('0x2')];function createListener(_0x446505,_0xd452b){return function(_0x24dd40){_0xd452b[_0x1038('0x3')](_0x446505,_0x24dd40);};}function removeListener(_0x4de1e6,_0x211443){return function(){MailQueueEvents[_0x1038('0x4')](_0x4de1e6,_0x211443);};}exports['register']=function(_0x683150){for(var _0x3239f2=0x0,_0x3b1803=events[_0x1038('0x5')];_0x3239f2<_0x3b1803;_0x3239f2++){var _0x41334e=events[_0x3239f2];var _0x6e7e40=createListener(_0x1038('0x6')+_0x41334e,_0x683150);MailQueueEvents['on'](_0x41334e,_0x6e7e40);}}; \ No newline at end of file +var _0x16d8=['removeListener','register','./mailQueue.events','save','update','emit'];(function(_0x6595a7,_0x1be709){var _0x22bb82=function(_0x1219e0){while(--_0x1219e0){_0x6595a7['push'](_0x6595a7['shift']());}};_0x22bb82(++_0x1be709);}(_0x16d8,0x176));var _0x816d=function(_0x69fd69,_0xc2ca41){_0x69fd69=_0x69fd69-0x0;var _0x33a678=_0x16d8[_0x69fd69];return _0x33a678;};'use strict';var MailQueueEvents=require(_0x816d('0x0'));var events=[_0x816d('0x1'),'remove',_0x816d('0x2')];function createListener(_0x5aea4a,_0x3b8b97){return function(_0x3326bf){_0x3b8b97[_0x816d('0x3')](_0x5aea4a,_0x3326bf);};}function removeListener(_0xb8581a,_0x3d38e3){return function(){MailQueueEvents[_0x816d('0x4')](_0xb8581a,_0x3d38e3);};}exports[_0x816d('0x5')]=function(_0x5f0ccf){for(var _0x5486d0=0x0,_0x18d8e5=events['length'];_0x5486d0<_0x18d8e5;_0x5486d0++){var _0x44349f=events[_0x5486d0];var _0x6a8901=createListener('mailQueue:'+_0x44349f,_0x5f0ccf);MailQueueEvents['on'](_0x44349f,_0x6a8901);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index a094b32..251904f 100644 --- a/server/api/mailQueueReport/index.js +++ b/server/api/mailQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f69=['/describe','isAuthenticated','describe','/:id','show','post','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','index'];(function(_0x5dc9bc,_0x394f06){var _0x50a2be=function(_0x1c9972){while(--_0x1c9972){_0x5dc9bc['push'](_0x5dc9bc['shift']());}};_0x50a2be(++_0x394f06);}(_0x6f69,0xa9));var _0x96f6=function(_0x5ce10f,_0x22f956){_0x5ce10f=_0x5ce10f-0x0;var _0x198731=_0x6f69[_0x5ce10f];return _0x198731;};'use strict';var multer=require(_0x96f6('0x0'));var util=require('util');var path=require(_0x96f6('0x1'));var timeout=require(_0x96f6('0x2'));var express=require(_0x96f6('0x3'));var router=express[_0x96f6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x96f6('0x5'));var interaction=require(_0x96f6('0x6'));var config=require(_0x96f6('0x7'));var controller=require(_0x96f6('0x8'));router[_0x96f6('0x9')]('/',auth['isAuthenticated'](),controller[_0x96f6('0xa')]);router[_0x96f6('0x9')](_0x96f6('0xb'),auth[_0x96f6('0xc')](),controller[_0x96f6('0xd')]);router[_0x96f6('0x9')](_0x96f6('0xe'),auth[_0x96f6('0xc')](),controller[_0x96f6('0xf')]);router[_0x96f6('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x96f6('0xe'),auth[_0x96f6('0xc')](),controller[_0x96f6('0x11')]);router[_0x96f6('0x12')](_0x96f6('0xe'),auth[_0x96f6('0xc')](),controller[_0x96f6('0x13')]);module['exports']=router; \ No newline at end of file +var _0x7457=['update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','put'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x7457,0x6e));var _0x7745=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x7457[_0x20589d];return _0x422de9;};'use strict';var multer=require(_0x7745('0x0'));var util=require(_0x7745('0x1'));var path=require(_0x7745('0x2'));var timeout=require(_0x7745('0x3'));var express=require(_0x7745('0x4'));var router=express['Router']();var fs_extra=require(_0x7745('0x5'));var auth=require(_0x7745('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0x7745('0x7')]('/',auth[_0x7745('0x8')](),controller[_0x7745('0x9')]);router['get'](_0x7745('0xa'),auth[_0x7745('0x8')](),controller[_0x7745('0xb')]);router['get'](_0x7745('0xc'),auth['isAuthenticated'](),controller[_0x7745('0xd')]);router[_0x7745('0xe')]('/',auth[_0x7745('0x8')](),controller['create']);router[_0x7745('0xf')](_0x7745('0xc'),auth['isAuthenticated'](),controller[_0x7745('0x10')]);router[_0x7745('0x11')](_0x7745('0xc'),auth[_0x7745('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 6b3068a..ac8603a 100644 --- a/server/api/mailQueueReport/mailQueueReport.attributes.js +++ b/server/api/mailQueueReport/mailQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb59d=['STRING','DATE','moment','sequelize','exports'];(function(_0x88ab0f,_0x247cb6){var _0x486fe=function(_0x1e4136){while(--_0x1e4136){_0x88ab0f['push'](_0x88ab0f['shift']());}};_0x486fe(++_0x247cb6);}(_0xb59d,0xc0));var _0xdb59=function(_0x11f98c,_0x131c65){_0x11f98c=_0x11f98c-0x0;var _0x4af131=_0xb59d[_0x11f98c];return _0x4af131;};'use strict';var moment=require(_0xdb59('0x0'));var Sequelize=require(_0xdb59('0x1'));module[_0xdb59('0x2')]={'uniqueid':{'type':Sequelize[_0xdb59('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xdb59('0x3')]},'joinAt':{'type':Sequelize[_0xdb59('0x4')]},'leaveAt':{'type':Sequelize[_0xdb59('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xdb59('0x4')]},'reason':{'type':Sequelize[_0xdb59('0x3')]}}; \ No newline at end of file +var _0x0a88=['STRING','DATE','moment','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0a88,0x7a));var _0x80a8=function(_0x1fc4e2,_0x493c3b){_0x1fc4e2=_0x1fc4e2-0x0;var _0x2ba184=_0x0a88[_0x1fc4e2];return _0x2ba184;};'use strict';var moment=require(_0x80a8('0x0'));var Sequelize=require(_0x80a8('0x1'));module[_0x80a8('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x80a8('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x80a8('0x4')]},'exitAt':{'type':Sequelize[_0x80a8('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index dd94e1e..ecfb7a4 100644 --- a/server/api/mailQueueReport/mailQueueReport.controller.js +++ b/server/api/mailQueueReport/mailQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bd0=['model','name','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','MailQueueReport','findAll','rows','show','keys','length','includeAll','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x29d518,_0x3900d4){var _0xf74a70=function(_0x48cca6){while(--_0x48cca6){_0x29d518['push'](_0x29d518['shift']());}};_0xf74a70(++_0x3900d4);}(_0x7bd0,0x111));var _0x07bd=function(_0x174a72,_0x46034c){_0x174a72=_0x174a72-0x0;var _0x32cecd=_0x7bd0[_0x174a72];return _0x32cecd;};'use strict';var emlformat=require(_0x07bd('0x0'));var rimraf=require(_0x07bd('0x1'));var zipdir=require(_0x07bd('0x2'));var jsonpatch=require(_0x07bd('0x3'));var rp=require(_0x07bd('0x4'));var moment=require(_0x07bd('0x5'));var BPromise=require(_0x07bd('0x6'));var Mustache=require(_0x07bd('0x7'));var util=require('util');var path=require(_0x07bd('0x8'));var sox=require(_0x07bd('0x9'));var csv=require(_0x07bd('0xa'));var ejs=require(_0x07bd('0xb'));var fs=require('fs');var fs_extra=require(_0x07bd('0xc'));var _=require(_0x07bd('0xd'));var squel=require(_0x07bd('0xe'));var crypto=require('crypto');var jsforce=require(_0x07bd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x07bd('0xa'));var querystring=require(_0x07bd('0x10'));var Papa=require(_0x07bd('0x11'));var Redis=require('ioredis');var authService=require(_0x07bd('0x12'));var qs=require(_0x07bd('0x13'));var as=require(_0x07bd('0x14'));var hardwareService=require(_0x07bd('0x15'));var logger=require('../../config/logger')(_0x07bd('0x16'));var utils=require(_0x07bd('0x17'));var config=require(_0x07bd('0x18'));var licenseUtil=require(_0x07bd('0x19'));var db=require(_0x07bd('0x1a'))['db'];function respondWithStatusCode(_0x1eff6c,_0x10aa2e){_0x10aa2e=_0x10aa2e||0xcc;return function(_0x2b8409){if(_0x2b8409){return _0x1eff6c['sendStatus'](_0x10aa2e);}return _0x1eff6c['status'](_0x10aa2e)[_0x07bd('0x1b')]();};}function respondWithResult(_0x3fe523,_0x1c59c2){_0x1c59c2=_0x1c59c2||0xc8;return function(_0x247f3f){if(_0x247f3f){return _0x3fe523[_0x07bd('0x1c')](_0x1c59c2)[_0x07bd('0x1d')](_0x247f3f);}};}function respondWithFilteredResult(_0x2c9166,_0x49d962){return function(_0x418444){if(_0x418444){var _0x505839=typeof _0x49d962[_0x07bd('0x1e')]===_0x07bd('0x1f')&&typeof _0x49d962[_0x07bd('0x20')]===_0x07bd('0x1f');var _0x8aa645=_0x418444['count'];var _0x3f9f0b=_0x505839?0x0:_0x49d962[_0x07bd('0x1e')];var _0x4948f4=_0x505839?_0x418444[_0x07bd('0x21')]:_0x49d962[_0x07bd('0x1e')]+_0x49d962[_0x07bd('0x20')];var _0x2fcc59;if(_0x4948f4>=_0x8aa645){_0x4948f4=_0x8aa645;_0x2fcc59=0xc8;}else{_0x2fcc59=0xce;}_0x2c9166[_0x07bd('0x1c')](_0x2fcc59);return _0x2c9166[_0x07bd('0x22')](_0x07bd('0x23'),_0x3f9f0b+'-'+_0x4948f4+'/'+_0x8aa645)[_0x07bd('0x1d')](_0x418444);}return null;};}function patchUpdates(_0x29a52e){return function(_0x50109f){try{jsonpatch[_0x07bd('0x24')](_0x50109f,_0x29a52e,!![]);}catch(_0x227807){return BPromise[_0x07bd('0x25')](_0x227807);}return _0x50109f[_0x07bd('0x26')]();};}function saveUpdates(_0x16d0e6,_0x47bd50){return function(_0x4c673a){if(_0x4c673a){return _0x4c673a[_0x07bd('0x27')](_0x16d0e6)['then'](function(_0x2b0dee){return _0x2b0dee;});}return null;};}function removeEntity(_0x480c9c,_0x50bd12){return function(_0x4165bc){if(_0x4165bc){return _0x4165bc[_0x07bd('0x28')]()[_0x07bd('0x29')](function(){_0x480c9c[_0x07bd('0x1c')](0xcc)[_0x07bd('0x1b')]();});}};}function handleEntityNotFound(_0x43cbc8,_0x557042){return function(_0x180b43){if(!_0x180b43){_0x43cbc8[_0x07bd('0x2a')](0x194);}return _0x180b43;};}function handleError(_0x3db9d0,_0x2a7202){_0x2a7202=_0x2a7202||0x1f4;return function(_0x12ce26){logger[_0x07bd('0x2b')](_0x12ce26['stack']);if(_0x12ce26['name']){delete _0x12ce26['name'];}_0x3db9d0[_0x07bd('0x1c')](_0x2a7202)[_0x07bd('0x2c')](_0x12ce26);};}exports[_0x07bd('0x2d')]=function(_0x51efa8,_0x1a3aa9){var _0x400cc0={},_0x253dc0={},_0x46ed12={'count':0x0,'rows':[]};var _0x3f9424=_[_0x07bd('0x2e')](db['MailQueueReport'][_0x07bd('0x2f')],function(_0x20cc94){return{'name':_0x20cc94[_0x07bd('0x30')],'type':_0x20cc94[_0x07bd('0x31')][_0x07bd('0x32')]};});_0x253dc0[_0x07bd('0x33')]=_[_0x07bd('0x2e')](_0x3f9424,_0x07bd('0x34'));_0x253dc0['query']=_['keys'](_0x51efa8[_0x07bd('0x35')]);_0x253dc0[_0x07bd('0x36')]=_[_0x07bd('0x37')](_0x253dc0['model'],_0x253dc0[_0x07bd('0x35')]);_0x400cc0[_0x07bd('0x38')]=_[_0x07bd('0x37')](_0x253dc0['model'],qs['fields'](_0x51efa8[_0x07bd('0x35')][_0x07bd('0x39')]));_0x400cc0[_0x07bd('0x38')]=_0x400cc0[_0x07bd('0x38')]['length']?_0x400cc0[_0x07bd('0x38')]:_0x253dc0[_0x07bd('0x33')];if(!_0x51efa8[_0x07bd('0x35')]['hasOwnProperty'](_0x07bd('0x3a'))){_0x400cc0[_0x07bd('0x20')]=qs['limit'](_0x51efa8[_0x07bd('0x35')][_0x07bd('0x20')]);_0x400cc0[_0x07bd('0x1e')]=qs[_0x07bd('0x1e')](_0x51efa8['query']['offset']);}_0x400cc0[_0x07bd('0x3b')]=qs['sort'](_0x51efa8[_0x07bd('0x35')][_0x07bd('0x3c')]);_0x400cc0[_0x07bd('0x3d')]=qs[_0x07bd('0x36')](_[_0x07bd('0x3e')](_0x51efa8[_0x07bd('0x35')],_0x253dc0[_0x07bd('0x36')]),_0x3f9424);if(_0x51efa8[_0x07bd('0x35')][_0x07bd('0x3f')]){_0x400cc0[_0x07bd('0x3d')]=_[_0x07bd('0x40')](_0x400cc0[_0x07bd('0x3d')],{'$or':_[_0x07bd('0x2e')](_0x3f9424,function(_0x51e8e2){if(_0x51e8e2[_0x07bd('0x31')]!==_0x07bd('0x41')){var _0x220a8e={};_0x220a8e[_0x51e8e2[_0x07bd('0x34')]]={'$like':'%'+_0x51efa8['query'][_0x07bd('0x3f')]+'%'};return _0x220a8e;}})});}_0x400cc0=_[_0x07bd('0x40')]({},_0x400cc0,_0x51efa8[_0x07bd('0x42')]);var _0x408a0a={'where':_0x400cc0[_0x07bd('0x3d')]};return db['MailQueueReport']['count'](_0x408a0a)[_0x07bd('0x29')](function(_0x88e174){_0x46ed12[_0x07bd('0x21')]=_0x88e174;if(_0x51efa8[_0x07bd('0x35')]['includeAll']){_0x400cc0[_0x07bd('0x43')]=[{'all':!![]}];}return db[_0x07bd('0x44')][_0x07bd('0x45')](_0x400cc0);})[_0x07bd('0x29')](function(_0x318b7c){_0x46ed12[_0x07bd('0x46')]=_0x318b7c;return _0x46ed12;})[_0x07bd('0x29')](respondWithFilteredResult(_0x1a3aa9,_0x400cc0))['catch'](handleError(_0x1a3aa9,null));};exports[_0x07bd('0x47')]=function(_0x7b1042,_0x33389b){var _0x3a5827={'raw':!![],'where':{'id':_0x7b1042['params']['id']}},_0x418f26={};_0x418f26[_0x07bd('0x33')]=_[_0x07bd('0x48')](db[_0x07bd('0x44')][_0x07bd('0x2f')]);_0x418f26[_0x07bd('0x35')]=_['keys'](_0x7b1042[_0x07bd('0x35')]);_0x418f26[_0x07bd('0x36')]=_[_0x07bd('0x37')](_0x418f26[_0x07bd('0x33')],_0x418f26['query']);_0x3a5827['attributes']=_[_0x07bd('0x37')](_0x418f26[_0x07bd('0x33')],qs[_0x07bd('0x39')](_0x7b1042[_0x07bd('0x35')][_0x07bd('0x39')]));_0x3a5827[_0x07bd('0x38')]=_0x3a5827[_0x07bd('0x38')][_0x07bd('0x49')]?_0x3a5827[_0x07bd('0x38')]:_0x418f26['model'];if(_0x7b1042['query'][_0x07bd('0x4a')]){_0x3a5827[_0x07bd('0x43')]=[{'all':!![]}];}_0x3a5827=_[_0x07bd('0x40')]({},_0x3a5827,_0x7b1042[_0x07bd('0x42')]);return db[_0x07bd('0x44')][_0x07bd('0x4b')](_0x3a5827)['then'](handleEntityNotFound(_0x33389b,null))[_0x07bd('0x29')](respondWithResult(_0x33389b,null))[_0x07bd('0x4c')](handleError(_0x33389b,null));};exports[_0x07bd('0x4d')]=function(_0x39823e,_0x7755e2){return db[_0x07bd('0x44')]['create'](_0x39823e[_0x07bd('0x4e')],{})[_0x07bd('0x29')](respondWithResult(_0x7755e2,0xc9))[_0x07bd('0x4c')](handleError(_0x7755e2,null));};exports[_0x07bd('0x27')]=function(_0x1d05ad,_0xc96a7d){if(_0x1d05ad[_0x07bd('0x4e')]['id']){delete _0x1d05ad[_0x07bd('0x4e')]['id'];}return db[_0x07bd('0x44')][_0x07bd('0x4b')]({'where':{'id':_0x1d05ad[_0x07bd('0x4f')]['id']}})[_0x07bd('0x29')](handleEntityNotFound(_0xc96a7d,null))['then'](saveUpdates(_0x1d05ad[_0x07bd('0x4e')],null))[_0x07bd('0x29')](respondWithResult(_0xc96a7d,null))[_0x07bd('0x4c')](handleError(_0xc96a7d,null));};exports['destroy']=function(_0x51c9f4,_0x1e7a6e){return db['MailQueueReport'][_0x07bd('0x4b')]({'where':{'id':_0x51c9f4[_0x07bd('0x4f')]['id']}})[_0x07bd('0x29')](handleEntityNotFound(_0x1e7a6e,null))[_0x07bd('0x29')](removeEntity(_0x1e7a6e,null))[_0x07bd('0x4c')](handleError(_0x1e7a6e,null));};exports[_0x07bd('0x50')]=function(_0x2cadbb,_0x157eb4){return db['MailQueueReport'][_0x07bd('0x50')]()[_0x07bd('0x29')](respondWithResult(_0x157eb4,null))[_0x07bd('0x4c')](handleError(_0x157eb4,null));}; \ No newline at end of file +var _0x8f4c=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','merge','options','MailQueueReport','includeAll','include','findAll','catch','show','params','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x479f17,_0x3ddb13){var _0xba4508=function(_0x21eb51){while(--_0x21eb51){_0x479f17['push'](_0x479f17['shift']());}};_0xba4508(++_0x3ddb13);}(_0x8f4c,0x113));var _0xc8f4=function(_0x2185f9,_0x14aeb8){_0x2185f9=_0x2185f9-0x0;var _0x64f64d=_0x8f4c[_0x2185f9];return _0x64f64d;};'use strict';var emlformat=require(_0xc8f4('0x0'));var rimraf=require(_0xc8f4('0x1'));var zipdir=require(_0xc8f4('0x2'));var jsonpatch=require(_0xc8f4('0x3'));var rp=require(_0xc8f4('0x4'));var moment=require(_0xc8f4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc8f4('0x6'));var util=require(_0xc8f4('0x7'));var path=require(_0xc8f4('0x8'));var sox=require('sox');var csv=require(_0xc8f4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc8f4('0xa'));var crypto=require('crypto');var jsforce=require(_0xc8f4('0xb'));var deskjs=require(_0xc8f4('0xc'));var toCsv=require(_0xc8f4('0x9'));var querystring=require(_0xc8f4('0xd'));var Papa=require(_0xc8f4('0xe'));var Redis=require('ioredis');var authService=require(_0xc8f4('0xf'));var qs=require(_0xc8f4('0x10'));var as=require(_0xc8f4('0x11'));var hardwareService=require(_0xc8f4('0x12'));var logger=require('../../config/logger')(_0xc8f4('0x13'));var utils=require('../../config/utils');var config=require(_0xc8f4('0x14'));var licenseUtil=require(_0xc8f4('0x15'));var db=require(_0xc8f4('0x16'))['db'];function respondWithStatusCode(_0x729f8f,_0x39b785){_0x39b785=_0x39b785||0xcc;return function(_0x4e31cf){if(_0x4e31cf){return _0x729f8f[_0xc8f4('0x17')](_0x39b785);}return _0x729f8f[_0xc8f4('0x18')](_0x39b785)[_0xc8f4('0x19')]();};}function respondWithResult(_0x14bc11,_0x1dcee5){_0x1dcee5=_0x1dcee5||0xc8;return function(_0x411c5c){if(_0x411c5c){return _0x14bc11['status'](_0x1dcee5)[_0xc8f4('0x1a')](_0x411c5c);}};}function respondWithFilteredResult(_0x2c7bc1,_0x1518a6){return function(_0x46ac15){if(_0x46ac15){var _0x22c08a=typeof _0x1518a6['offset']===_0xc8f4('0x1b')&&typeof _0x1518a6['limit']==='undefined';var _0x14bc02=_0x46ac15[_0xc8f4('0x1c')];var _0x108076=_0x22c08a?0x0:_0x1518a6[_0xc8f4('0x1d')];var _0x4763c1=_0x22c08a?_0x46ac15[_0xc8f4('0x1c')]:_0x1518a6[_0xc8f4('0x1d')]+_0x1518a6[_0xc8f4('0x1e')];var _0x1982bb;if(_0x4763c1>=_0x14bc02){_0x4763c1=_0x14bc02;_0x1982bb=0xc8;}else{_0x1982bb=0xce;}_0x2c7bc1[_0xc8f4('0x18')](_0x1982bb);return _0x2c7bc1[_0xc8f4('0x1f')](_0xc8f4('0x20'),_0x108076+'-'+_0x4763c1+'/'+_0x14bc02)[_0xc8f4('0x1a')](_0x46ac15);}return null;};}function patchUpdates(_0x5f3264){return function(_0x378f56){try{jsonpatch[_0xc8f4('0x21')](_0x378f56,_0x5f3264,!![]);}catch(_0x29e52d){return BPromise[_0xc8f4('0x22')](_0x29e52d);}return _0x378f56[_0xc8f4('0x23')]();};}function saveUpdates(_0x3b42ee,_0xaeee7d){return function(_0x43eb57){if(_0x43eb57){return _0x43eb57['update'](_0x3b42ee)[_0xc8f4('0x24')](function(_0x205c41){return _0x205c41;});}return null;};}function removeEntity(_0x3195ff,_0x1d159e){return function(_0x5d54a9){if(_0x5d54a9){return _0x5d54a9[_0xc8f4('0x25')]()['then'](function(){_0x3195ff[_0xc8f4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x177a44,_0x3dd717){return function(_0x5c94c6){if(!_0x5c94c6){_0x177a44[_0xc8f4('0x17')](0x194);}return _0x5c94c6;};}function handleError(_0x21062f,_0x11f766){_0x11f766=_0x11f766||0x1f4;return function(_0x2fa052){logger['error'](_0x2fa052[_0xc8f4('0x26')]);if(_0x2fa052[_0xc8f4('0x27')]){delete _0x2fa052['name'];}_0x21062f[_0xc8f4('0x18')](_0x11f766)[_0xc8f4('0x28')](_0x2fa052);};}exports[_0xc8f4('0x29')]=function(_0x1b70bc,_0x24bef0){var _0x385e41={},_0x4a25da={},_0x45f972={'count':0x0,'rows':[]};var _0x24bb78=_[_0xc8f4('0x2a')](db['MailQueueReport'][_0xc8f4('0x2b')],function(_0x3a4b1b){return{'name':_0x3a4b1b['fieldName'],'type':_0x3a4b1b['type']['key']};});_0x4a25da[_0xc8f4('0x2c')]=_[_0xc8f4('0x2a')](_0x24bb78,_0xc8f4('0x27'));_0x4a25da[_0xc8f4('0x2d')]=_[_0xc8f4('0x2e')](_0x1b70bc[_0xc8f4('0x2d')]);_0x4a25da[_0xc8f4('0x2f')]=_[_0xc8f4('0x30')](_0x4a25da['model'],_0x4a25da[_0xc8f4('0x2d')]);_0x385e41[_0xc8f4('0x31')]=_[_0xc8f4('0x30')](_0x4a25da['model'],qs[_0xc8f4('0x32')](_0x1b70bc[_0xc8f4('0x2d')]['fields']));_0x385e41[_0xc8f4('0x31')]=_0x385e41[_0xc8f4('0x31')][_0xc8f4('0x33')]?_0x385e41['attributes']:_0x4a25da[_0xc8f4('0x2c')];if(!_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x34')]('nolimit')){_0x385e41[_0xc8f4('0x1e')]=qs[_0xc8f4('0x1e')](_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x1e')]);_0x385e41[_0xc8f4('0x1d')]=qs[_0xc8f4('0x1d')](_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x1d')]);}_0x385e41[_0xc8f4('0x35')]=qs[_0xc8f4('0x36')](_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x36')]);_0x385e41[_0xc8f4('0x37')]=qs[_0xc8f4('0x2f')](_[_0xc8f4('0x38')](_0x1b70bc[_0xc8f4('0x2d')],_0x4a25da['filters']),_0x24bb78);if(_0x1b70bc[_0xc8f4('0x2d')]['filter']){_0x385e41[_0xc8f4('0x37')]=_['merge'](_0x385e41[_0xc8f4('0x37')],{'$or':_[_0xc8f4('0x2a')](_0x24bb78,function(_0x7ef69a){if(_0x7ef69a[_0xc8f4('0x39')]!==_0xc8f4('0x3a')){var _0x724060={};_0x724060[_0x7ef69a[_0xc8f4('0x27')]]={'$like':'%'+_0x1b70bc['query'][_0xc8f4('0x3b')]+'%'};return _0x724060;}})});}_0x385e41=_[_0xc8f4('0x3c')]({},_0x385e41,_0x1b70bc[_0xc8f4('0x3d')]);var _0x14ce2e={'where':_0x385e41['where']};return db[_0xc8f4('0x3e')][_0xc8f4('0x1c')](_0x14ce2e)[_0xc8f4('0x24')](function(_0x1d0b2d){_0x45f972[_0xc8f4('0x1c')]=_0x1d0b2d;if(_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x3f')]){_0x385e41[_0xc8f4('0x40')]=[{'all':!![]}];}return db[_0xc8f4('0x3e')][_0xc8f4('0x41')](_0x385e41);})[_0xc8f4('0x24')](function(_0xd56415){_0x45f972['rows']=_0xd56415;return _0x45f972;})[_0xc8f4('0x24')](respondWithFilteredResult(_0x24bef0,_0x385e41))[_0xc8f4('0x42')](handleError(_0x24bef0,null));};exports[_0xc8f4('0x43')]=function(_0x275f4a,_0x588ff9){var _0x49da16={'raw':!![],'where':{'id':_0x275f4a[_0xc8f4('0x44')]['id']}},_0x413a55={};_0x413a55['model']=_[_0xc8f4('0x2e')](db[_0xc8f4('0x3e')]['rawAttributes']);_0x413a55['query']=_[_0xc8f4('0x2e')](_0x275f4a[_0xc8f4('0x2d')]);_0x413a55[_0xc8f4('0x2f')]=_[_0xc8f4('0x30')](_0x413a55[_0xc8f4('0x2c')],_0x413a55[_0xc8f4('0x2d')]);_0x49da16['attributes']=_['intersection'](_0x413a55[_0xc8f4('0x2c')],qs[_0xc8f4('0x32')](_0x275f4a[_0xc8f4('0x2d')]['fields']));_0x49da16['attributes']=_0x49da16['attributes']['length']?_0x49da16['attributes']:_0x413a55[_0xc8f4('0x2c')];if(_0x275f4a[_0xc8f4('0x2d')][_0xc8f4('0x3f')]){_0x49da16[_0xc8f4('0x40')]=[{'all':!![]}];}_0x49da16=_[_0xc8f4('0x3c')]({},_0x49da16,_0x275f4a[_0xc8f4('0x3d')]);return db['MailQueueReport'][_0xc8f4('0x45')](_0x49da16)[_0xc8f4('0x24')](handleEntityNotFound(_0x588ff9,null))['then'](respondWithResult(_0x588ff9,null))['catch'](handleError(_0x588ff9,null));};exports[_0xc8f4('0x46')]=function(_0x82a5e,_0x3ca0d6){return db[_0xc8f4('0x3e')]['create'](_0x82a5e['body'],{})[_0xc8f4('0x24')](respondWithResult(_0x3ca0d6,0xc9))[_0xc8f4('0x42')](handleError(_0x3ca0d6,null));};exports[_0xc8f4('0x47')]=function(_0x2bc4db,_0x141f81){if(_0x2bc4db[_0xc8f4('0x48')]['id']){delete _0x2bc4db['body']['id'];}return db['MailQueueReport'][_0xc8f4('0x45')]({'where':{'id':_0x2bc4db[_0xc8f4('0x44')]['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x141f81,null))[_0xc8f4('0x24')](saveUpdates(_0x2bc4db[_0xc8f4('0x48')],null))[_0xc8f4('0x24')](respondWithResult(_0x141f81,null))[_0xc8f4('0x42')](handleError(_0x141f81,null));};exports[_0xc8f4('0x25')]=function(_0x3d9d67,_0x5b4035){return db['MailQueueReport'][_0xc8f4('0x45')]({'where':{'id':_0x3d9d67[_0xc8f4('0x44')]['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x5b4035,null))[_0xc8f4('0x24')](removeEntity(_0x5b4035,null))[_0xc8f4('0x42')](handleError(_0x5b4035,null));};exports[_0xc8f4('0x49')]=function(_0x4715f3,_0x36c304){return db[_0xc8f4('0x3e')][_0xc8f4('0x49')]()[_0xc8f4('0x24')](respondWithResult(_0x36c304,null))[_0xc8f4('0x42')](handleError(_0x36c304,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index c8dc342..cfe287c 100644 --- a/server/api/mailQueueReport/mailQueueReport.model.js +++ b/server/api/mailQueueReport/mailQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ab1=['rimraf','../../config/environment','define','MailQueueReport','uniqueid','util','api','moment','bluebird'];(function(_0x3cd368,_0x367ccf){var _0x2e7d2e=function(_0x495adf){while(--_0x495adf){_0x3cd368['push'](_0x3cd368['shift']());}};_0x2e7d2e(++_0x367ccf);}(_0x6ab1,0x12e));var _0x16ab=function(_0x176d14,_0x3984ea){_0x176d14=_0x176d14-0x0;var _0x89522c=_0x6ab1[_0x176d14];return _0x89522c;};'use strict';var _=require('lodash');var util=require(_0x16ab('0x0'));var logger=require('../../config/logger')(_0x16ab('0x1'));var moment=require(_0x16ab('0x2'));var BPromise=require(_0x16ab('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x16ab('0x4'));var config=require(_0x16ab('0x5'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x16cf39,_0x55e304){return _0x16cf39[_0x16ab('0x6')](_0x16ab('0x7'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x16ab('0x8'),'fields':[_0x16ab('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb040=['uniqueid','lodash','../../config/logger','api','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0x2cb825,_0x2d6557){var _0x1eafef=function(_0x51cc6c){while(--_0x51cc6c){_0x2cb825['push'](_0x2cb825['shift']());}};_0x1eafef(++_0x2d6557);}(_0xb040,0x156));var _0x0b04=function(_0x7d44f9,_0x3dceee){_0x7d44f9=_0x7d44f9-0x0;var _0x4f47e8=_0xb040[_0x7d44f9];return _0x4f47e8;};'use strict';var _=require(_0x0b04('0x0'));var util=require('util');var logger=require(_0x0b04('0x1'))(_0x0b04('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b04('0x3'));var rimraf=require(_0x0b04('0x4'));var config=require(_0x0b04('0x5'));var attributes=require(_0x0b04('0x6'));module[_0x0b04('0x7')]=function(_0x5d4942,_0x4607c7){return _0x5d4942[_0x0b04('0x8')](_0x0b04('0x9'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0b04('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 0188563..7788f91 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['error','code','message','request\x20sent','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailQueueReport,\x20%s,\x20%s','debug','stringify'];(function(_0x1ed587,_0x4dfe9b){var _0x40a3cb=function(_0x172ef0){while(--_0x172ef0){_0x1ed587['push'](_0x1ed587['shift']());}};_0x40a3cb(++_0x4dfe9b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x27b340,_0x23510a){_0x27b340=_0x27b340-0x0;var _0x541364=_0x5f2f[_0x27b340];return _0x541364;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x47acfc){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger['debug'](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x47acfc));_0x4ff59b(_0x47acfc);})[_0xf5f2('0x16')](function(_0x39c024){logger[_0xf5f2('0x11')]('CreateMailQueueReport',_0x39c024[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x39c024[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x1d')]=function(_0x287ad5){var _0x5bdf4a=this;return new Promise(function(_0x529f07,_0x5f1124){return db[_0xf5f2('0x18')][_0xf5f2('0x1e')](_0x287ad5[_0xf5f2('0x1a')],{'raw':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')]['where']||null:null,'attributes':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null,'limit':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null})['then'](function(_0x53cb96){logger[_0xf5f2('0xd')](_0xf5f2('0x1d'),_0x287ad5);logger[_0xf5f2('0xf')]('UpdateMailQueueReport',_0x287ad5,JSON['stringify'](_0x53cb96));_0x529f07(_0x53cb96);})[_0xf5f2('0x16')](function(_0x50b8a2){logger[_0xf5f2('0x11')](_0xf5f2('0x1d'),_0x50b8a2[_0xf5f2('0x13')],_0x287ad5);_0x5f1124(_0x5bdf4a['error'](0x1f4,_0x50b8a2['message']));});});}; \ No newline at end of file +var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x23ec06,_0x561142){var _0x2831d4=function(_0x3802bc){while(--_0x3802bc){_0x23ec06['push'](_0x23ec06['shift']());}};_0x2831d4(++_0x561142);}(_0x2ef3,0xba));var _0x32ef=function(_0x373213,_0x2d7cbf){_0x373213=_0x373213-0x0;var _0x47d558=_0x2ef3[_0x373213];return _0x47d558;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index b8c6f03..0295d38 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x422652,_0x41415e){var _0x74cc16=function(_0x5a6163){while(--_0x5a6163){_0x422652['push'](_0x422652['shift']());}};_0x74cc16(++_0x41415e);}(_0x70e0,0x17b));var _0x070e=function(_0x3afefb,_0x51ad15){_0x3afefb=_0x3afefb-0x0;var _0x3ac47f=_0x70e0[_0x3afefb];return _0x3ac47f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x366799,_0x830474){var _0x27a56e=function(_0x3b51f7){while(--_0x3b51f7){_0x366799['push'](_0x366799['shift']());}};_0x27a56e(++_0x830474);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x19babd,_0x1d4ef7){_0x19babd=_0x19babd-0x0;var _0x314eaf=_0xcb91[_0x19babd];return _0x314eaf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 3383765..8bee767 100644 --- a/server/api/mailServerIn/mailServerIn.attributes.js +++ b/server/api/mailServerIn/mailServerIn.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e07=['sequelize','exports','STRING','INTEGER','BOOLEAN','INBOX'];(function(_0x377c15,_0xaa48e4){var _0x1e0e18=function(_0x18daac){while(--_0x18daac){_0x377c15['push'](_0x377c15['shift']());}};_0x1e0e18(++_0xaa48e4);}(_0x6e07,0xa2));var _0x76e0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6e07[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x76e0('0x0'));module[_0x76e0('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x76e0('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x76e0('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x76e0('0x3')]},'tls':{'type':Sequelize[_0x76e0('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x76e0('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x76e0('0x2')]},'modernAuthentication':{'type':Sequelize[_0x76e0('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x42ec=['INBOX','INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x4a3fb1,_0x88a609){var _0x41fda0=function(_0x19c024){while(--_0x19c024){_0x4a3fb1['push'](_0x4a3fb1['shift']());}};_0x41fda0(++_0x88a609);}(_0x42ec,0x1e8));var _0xc42e=function(_0x159c66,_0x23a8d3){_0x159c66=_0x159c66-0x0;var _0x1d2cb8=_0x42ec[_0x159c66];return _0x1d2cb8;};'use strict';var Sequelize=require(_0xc42e('0x0'));module[_0xc42e('0x1')]={'description':{'type':Sequelize[_0xc42e('0x2')]},'host':{'type':Sequelize[_0xc42e('0x2')]},'authentication':{'type':Sequelize[_0xc42e('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc42e('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xc42e('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xc42e('0x2')],'defaultValue':_0xc42e('0x4')},'connTimeout':{'type':Sequelize[_0xc42e('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xc42e('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index d437d3a..a34cfb6 100644 --- a/server/api/mailServerIn/mailServerIn.model.js +++ b/server/api/mailServerIn/mailServerIn.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd0d=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util'];(function(_0x28a20d,_0x35f020){var _0x1a3ef3=function(_0x10b347){while(--_0x10b347){_0x28a20d['push'](_0x28a20d['shift']());}};_0x1a3ef3(++_0x35f020);}(_0xfd0d,0x1be));var _0xdfd0=function(_0xbdde76,_0x4d460d){_0xbdde76=_0xbdde76-0x0;var _0x713dd9=_0xfd0d[_0xbdde76];return _0x713dd9;};'use strict';var _=require(_0xdfd0('0x0'));var util=require(_0xdfd0('0x1'));var logger=require(_0xdfd0('0x2'))(_0xdfd0('0x3'));var moment=require(_0xdfd0('0x4'));var BPromise=require(_0xdfd0('0x5'));var rp=require(_0xdfd0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdfd0('0x7'));var config=require(_0xdfd0('0x8'));var attributes=require(_0xdfd0('0x9'));module[_0xdfd0('0xa')]=function(_0x2ae131,_0x46ac3f){return _0x2ae131[_0xdfd0('0xb')](_0xdfd0('0xc'),attributes,{'tableName':_0xdfd0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd587=['define','MailServerIn','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0xd587,0x7b));var _0x7d58=function(_0xa8443d,_0x1a6b6f){_0xa8443d=_0xa8443d-0x0;var _0x24ef8f=_0xd587[_0xa8443d];return _0x24ef8f;};'use strict';var _=require(_0x7d58('0x0'));var util=require(_0x7d58('0x1'));var logger=require(_0x7d58('0x2'))(_0x7d58('0x3'));var moment=require(_0x7d58('0x4'));var BPromise=require(_0x7d58('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7d58('0x6'));var config=require(_0x7d58('0x7'));var attributes=require('./mailServerIn.attributes');module[_0x7d58('0x8')]=function(_0x5b43db,_0x1e6047){return _0x5b43db[_0x7d58('0x9')](_0x7d58('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 5e6e0e2..15f477b 100644 --- a/server/api/mailServerIn/mailServerIn.rpc.js +++ b/server/api/mailServerIn/mailServerIn.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffdc=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','GetMailServerIn','debug','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x33f1e2,_0x2111bb){var _0x581421=function(_0x3a2628){while(--_0x3a2628){_0x33f1e2['push'](_0x33f1e2['shift']());}};_0x581421(++_0x2111bb);}(_0xffdc,0x7f));var _0xcffd=function(_0x4aa5c2,_0x35cf13){_0x4aa5c2=_0x4aa5c2-0x0;var _0xb8c19a=_0xffdc[_0x4aa5c2];return _0xb8c19a;};'use strict';var _=require(_0xcffd('0x0'));var util=require(_0xcffd('0x1'));var moment=require('moment');var BPromise=require(_0xcffd('0x2'));var rs=require(_0xcffd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcffd('0x4'))['db'];var utils=require(_0xcffd('0x5'));var logger=require(_0xcffd('0x6'))(_0xcffd('0x7'));var config=require(_0xcffd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcffd('0x9')][_0xcffd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12e830,_0x5b14be,_0x199df3){return new BPromise(function(_0x463334,_0x552fa7){return client[_0xcffd('0xb')](_0x12e830,_0x199df3)[_0xcffd('0xc')](function(_0x5dec7e){logger[_0xcffd('0xd')](_0xcffd('0xe'),_0x5b14be,_0xcffd('0xf'));logger['debug'](_0xcffd('0x10'),_0x5b14be,_0xcffd('0xf'),JSON[_0xcffd('0x11')](_0x5dec7e));if(_0x5dec7e[_0xcffd('0x12')]){if(_0x5dec7e['error']['code']===0x1f4){logger[_0xcffd('0x12')](_0xcffd('0xe'),_0x5b14be,_0x5dec7e[_0xcffd('0x12')]['message']);return _0x552fa7(_0x5dec7e[_0xcffd('0x12')]['message']);}logger['error'](_0xcffd('0xe'),_0x5b14be,_0x5dec7e[_0xcffd('0x12')]['message']);return _0x463334(_0x5dec7e[_0xcffd('0x12')][_0xcffd('0x13')]);}else{logger[_0xcffd('0xd')](_0xcffd('0xe'),_0x5b14be,'request\x20sent');_0x463334(_0x5dec7e['result'][_0xcffd('0x13')]);}})[_0xcffd('0x14')](function(_0x1da405){logger[_0xcffd('0x12')](_0xcffd('0xe'),_0x5b14be,_0x1da405);_0x552fa7(_0x1da405);});});}exports['GetMailServerIn']=function(_0x4216c4){var _0x5c3701=this;return new Promise(function(_0x18e9e1,_0x33c713){return db[_0xcffd('0x15')][_0xcffd('0x16')]({'raw':_0x4216c4[_0xcffd('0x17')]?_0x4216c4[_0xcffd('0x17')][_0xcffd('0x18')]===undefined?!![]:![]:!![],'where':_0x4216c4[_0xcffd('0x17')]?_0x4216c4['options'][_0xcffd('0x19')]||null:null,'attributes':_0x4216c4[_0xcffd('0x17')]?_0x4216c4[_0xcffd('0x17')][_0xcffd('0x1a')]||null:null,'limit':_0x4216c4[_0xcffd('0x17')]?_0x4216c4[_0xcffd('0x17')][_0xcffd('0x1b')]||null:null,'include':_0x4216c4['options']?_0x4216c4['options'][_0xcffd('0x1c')]?_[_0xcffd('0x1d')](_0x4216c4[_0xcffd('0x17')][_0xcffd('0x1c')],function(_0x3c3839){return{'model':db[_0x3c3839[_0xcffd('0x1e')]],'as':_0x3c3839['as'],'attributes':_0x3c3839[_0xcffd('0x1a')],'include':_0x3c3839[_0xcffd('0x1c')]?_[_0xcffd('0x1d')](_0x3c3839[_0xcffd('0x1c')],function(_0x37185d){return{'model':db[_0x37185d[_0xcffd('0x1e')]],'as':_0x37185d['as'],'attributes':_0x37185d['attributes'],'include':_0x37185d[_0xcffd('0x1c')]?_[_0xcffd('0x1d')](_0x37185d[_0xcffd('0x1c')],function(_0x547bdb){return{'model':db[_0x547bdb[_0xcffd('0x1e')]],'as':_0x547bdb['as'],'attributes':_0x547bdb[_0xcffd('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xcffd('0xc')](function(_0x5d0859){logger['info'](_0xcffd('0x1f'),_0x4216c4);logger[_0xcffd('0x20')]('GetMailServerIn',_0x4216c4,JSON[_0xcffd('0x11')](_0x5d0859));_0x18e9e1(_0x5d0859);})[_0xcffd('0x14')](function(_0x5a97cf){logger[_0xcffd('0x12')](_0xcffd('0x1f'),_0x5a97cf['message'],_0x4216c4);_0x33c713(_0x5c3701['error'](0x1f4,_0x5a97cf[_0xcffd('0x13')]));});});}; \ No newline at end of file +var _0x95b9=['request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetMailServerIn','findAll','options','where','attributes','include','map','model','debug','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x272a88,_0x57e586){var _0x5c71c4=function(_0x8151b3){while(--_0x8151b3){_0x272a88['push'](_0x272a88['shift']());}};_0x5c71c4(++_0x57e586);}(_0x95b9,0x10c));var _0x995b=function(_0x3f2a83,_0x55800a){_0x3f2a83=_0x3f2a83-0x0;var _0xf415cd=_0x95b9[_0x3f2a83];return _0xf415cd;};'use strict';var _=require(_0x995b('0x0'));var util=require(_0x995b('0x1'));var moment=require('moment');var BPromise=require(_0x995b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x995b('0x3'));var db=require(_0x995b('0x4'))['db'];var utils=require(_0x995b('0x5'));var logger=require(_0x995b('0x6'))(_0x995b('0x7'));var config=require('../../config/environment');var jayson=require(_0x995b('0x8'));var client=jayson[_0x995b('0x9')][_0x995b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x288eab,_0x3bdc1a,_0x416c0c){return new BPromise(function(_0x240a63,_0x409d1d){return client[_0x995b('0xb')](_0x288eab,_0x416c0c)[_0x995b('0xc')](function(_0x6893b0){logger[_0x995b('0xd')](_0x995b('0xe'),_0x3bdc1a,_0x995b('0xf'));logger['debug'](_0x995b('0x10'),_0x3bdc1a,_0x995b('0xf'),JSON[_0x995b('0x11')](_0x6893b0));if(_0x6893b0[_0x995b('0x12')]){if(_0x6893b0[_0x995b('0x12')]['code']===0x1f4){logger[_0x995b('0x12')]('MailServerIn,\x20%s,\x20%s',_0x3bdc1a,_0x6893b0[_0x995b('0x12')][_0x995b('0x13')]);return _0x409d1d(_0x6893b0[_0x995b('0x12')][_0x995b('0x13')]);}logger[_0x995b('0x12')](_0x995b('0xe'),_0x3bdc1a,_0x6893b0[_0x995b('0x12')][_0x995b('0x13')]);return _0x240a63(_0x6893b0[_0x995b('0x12')][_0x995b('0x13')]);}else{logger['info'](_0x995b('0xe'),_0x3bdc1a,'request\x20sent');_0x240a63(_0x6893b0[_0x995b('0x14')][_0x995b('0x13')]);}})['catch'](function(_0x5a5e70){logger[_0x995b('0x12')]('MailServerIn,\x20%s,\x20%s',_0x3bdc1a,_0x5a5e70);_0x409d1d(_0x5a5e70);});});}exports[_0x995b('0x15')]=function(_0x154f5b){var _0x1ee38f=this;return new Promise(function(_0x3ad787,_0x109d2e){return db['MailServerIn'][_0x995b('0x16')]({'raw':_0x154f5b[_0x995b('0x17')]?_0x154f5b[_0x995b('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x154f5b[_0x995b('0x17')]?_0x154f5b['options'][_0x995b('0x18')]||null:null,'attributes':_0x154f5b['options']?_0x154f5b[_0x995b('0x17')][_0x995b('0x19')]||null:null,'limit':_0x154f5b[_0x995b('0x17')]?_0x154f5b['options']['limit']||null:null,'include':_0x154f5b['options']?_0x154f5b[_0x995b('0x17')][_0x995b('0x1a')]?_[_0x995b('0x1b')](_0x154f5b[_0x995b('0x17')]['include'],function(_0x1fc8f8){return{'model':db[_0x1fc8f8[_0x995b('0x1c')]],'as':_0x1fc8f8['as'],'attributes':_0x1fc8f8[_0x995b('0x19')],'include':_0x1fc8f8['include']?_[_0x995b('0x1b')](_0x1fc8f8[_0x995b('0x1a')],function(_0x5dbcf8){return{'model':db[_0x5dbcf8[_0x995b('0x1c')]],'as':_0x5dbcf8['as'],'attributes':_0x5dbcf8[_0x995b('0x19')],'include':_0x5dbcf8['include']?_['map'](_0x5dbcf8[_0x995b('0x1a')],function(_0x5b183d){return{'model':db[_0x5b183d['model']],'as':_0x5b183d['as'],'attributes':_0x5b183d['attributes']};}):[]};}):[]};}):[]:[]})[_0x995b('0xc')](function(_0x168954){logger[_0x995b('0xd')](_0x995b('0x15'),_0x154f5b);logger[_0x995b('0x1d')]('GetMailServerIn',_0x154f5b,JSON[_0x995b('0x11')](_0x168954));_0x3ad787(_0x168954);})[_0x995b('0x1e')](function(_0x151e05){logger[_0x995b('0x12')](_0x995b('0x15'),_0x151e05[_0x995b('0x13')],_0x154f5b);_0x109d2e(_0x1ee38f[_0x995b('0x12')](0x1f4,_0x151e05[_0x995b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index e1fd81b..2add850 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x7a54,0x106));var _0x47a5=function(_0x215c44,_0x14838a){_0x215c44=_0x215c44-0x0;var _0x52c175=_0x7a54[_0x215c44];return _0x52c175;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index f9f3abf..5d3bd55 100644 --- a/server/api/mailServerOut/mailServerOut.attributes.js +++ b/server/api/mailServerOut/mailServerOut.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ec6=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x495e9f,_0x1b1d80){var _0xb249d2=function(_0x3db4e4){while(--_0x3db4e4){_0x495e9f['push'](_0x495e9f['shift']());}};_0xb249d2(++_0x1b1d80);}(_0x5ec6,0x7f));var _0x65ec=function(_0x55cfd5,_0x166a60){_0x55cfd5=_0x55cfd5-0x0;var _0x503827=_0x5ec6[_0x55cfd5];return _0x503827;};'use strict';var Sequelize=require(_0x65ec('0x0'));module[_0x65ec('0x1')]={'description':{'type':Sequelize[_0x65ec('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x65ec('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x65ec('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x65ec('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x65ec('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x9354=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x311a08,_0x5f58c5){var _0x3337c3=function(_0x359e0c){while(--_0x359e0c){_0x311a08['push'](_0x311a08['shift']());}};_0x3337c3(++_0x5f58c5);}(_0x9354,0x96));var _0x4935=function(_0x5a77fb,_0x2d2d59){_0x5a77fb=_0x5a77fb-0x0;var _0x6ca4fb=_0x9354[_0x5a77fb];return _0x6ca4fb;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'description':{'type':Sequelize[_0x4935('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x4935('0x1')]},'pass':{'type':Sequelize[_0x4935('0x1')]},'port':{'type':Sequelize[_0x4935('0x2')]},'secure':{'type':Sequelize[_0x4935('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x4935('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x4935('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 7939753..0ec9661 100644 --- a/server/api/mailServerOut/mailServerOut.controller.js +++ b/server/api/mailServerOut/mailServerOut.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5281=['model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','includeAll','include','MailServerOut','findAll','rows','catch','find','create','body','params','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','count','offset','limit','status','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type'];(function(_0xfb19ff,_0x1a17c2){var _0x3c8900=function(_0x577719){while(--_0x577719){_0xfb19ff['push'](_0xfb19ff['shift']());}};_0x3c8900(++_0x1a17c2);}(_0x5281,0x1bd));var _0x1528=function(_0x5e650e,_0x1841d6){_0x5e650e=_0x5e650e-0x0;var _0x53fab6=_0x5281[_0x5e650e];return _0x53fab6;};'use strict';var emlformat=require(_0x1528('0x0'));var rimraf=require(_0x1528('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1528('0x2'));var rp=require('request-promise');var moment=require(_0x1528('0x3'));var BPromise=require(_0x1528('0x4'));var Mustache=require('mustache');var util=require(_0x1528('0x5'));var path=require(_0x1528('0x6'));var sox=require(_0x1528('0x7'));var csv=require(_0x1528('0x8'));var ejs=require(_0x1528('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1528('0xa'));var squel=require(_0x1528('0xb'));var crypto=require(_0x1528('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1528('0x8'));var querystring=require(_0x1528('0xd'));var Papa=require('papaparse');var Redis=require(_0x1528('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x1528('0xf'));var as=require(_0x1528('0x10'));var hardwareService=require(_0x1528('0x11'));var logger=require(_0x1528('0x12'))(_0x1528('0x13'));var utils=require(_0x1528('0x14'));var config=require(_0x1528('0x15'));var licenseUtil=require(_0x1528('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f5054,_0x485aaf){_0x485aaf=_0x485aaf||0xcc;return function(_0x5a0659){if(_0x5a0659){return _0x5f5054[_0x1528('0x17')](_0x485aaf);}return _0x5f5054['status'](_0x485aaf)['end']();};}function respondWithResult(_0x4d37d0,_0x30e963){_0x30e963=_0x30e963||0xc8;return function(_0xa314af){if(_0xa314af){return _0x4d37d0['status'](_0x30e963)[_0x1528('0x18')](_0xa314af);}};}function respondWithFilteredResult(_0x272bc9,_0x24d03d){return function(_0x204409){if(_0x204409){var _0x4ea6a1=typeof _0x24d03d['offset']==='undefined'&&typeof _0x24d03d['limit']==='undefined';var _0x3cc1b3=_0x204409[_0x1528('0x19')];var _0x11bf51=_0x4ea6a1?0x0:_0x24d03d[_0x1528('0x1a')];var _0x339abc=_0x4ea6a1?_0x204409[_0x1528('0x19')]:_0x24d03d['offset']+_0x24d03d[_0x1528('0x1b')];var _0x3c5898;if(_0x339abc>=_0x3cc1b3){_0x339abc=_0x3cc1b3;_0x3c5898=0xc8;}else{_0x3c5898=0xce;}_0x272bc9[_0x1528('0x1c')](_0x3c5898);return _0x272bc9['set'](_0x1528('0x1d'),_0x11bf51+'-'+_0x339abc+'/'+_0x3cc1b3)['json'](_0x204409);}return null;};}function patchUpdates(_0x19cf09){return function(_0x189413){try{jsonpatch[_0x1528('0x1e')](_0x189413,_0x19cf09,!![]);}catch(_0x4b7b0e){return BPromise[_0x1528('0x1f')](_0x4b7b0e);}return _0x189413[_0x1528('0x20')]();};}function saveUpdates(_0x4e1d5f,_0x396aad){return function(_0x60720a){if(_0x60720a){return _0x60720a[_0x1528('0x21')](_0x4e1d5f)[_0x1528('0x22')](function(_0x4249ef){return _0x4249ef;});}return null;};}function removeEntity(_0x5522c9,_0xb2005c){return function(_0x183c7d){if(_0x183c7d){return _0x183c7d[_0x1528('0x23')]()[_0x1528('0x22')](function(){_0x5522c9[_0x1528('0x1c')](0xcc)[_0x1528('0x24')]();});}};}function handleEntityNotFound(_0x45aa8b,_0x250981){return function(_0x2c28a1){if(!_0x2c28a1){_0x45aa8b['sendStatus'](0x194);}return _0x2c28a1;};}function handleError(_0x326666,_0x4babd3){_0x4babd3=_0x4babd3||0x1f4;return function(_0x40fd8f){logger[_0x1528('0x25')](_0x40fd8f[_0x1528('0x26')]);if(_0x40fd8f[_0x1528('0x27')]){delete _0x40fd8f[_0x1528('0x27')];}_0x326666[_0x1528('0x1c')](_0x4babd3)[_0x1528('0x28')](_0x40fd8f);};}exports['index']=function(_0x13a00a,_0x18d049){var _0x54cb15={},_0x3cb79b={},_0x4cf9f0={'count':0x0,'rows':[]};var _0x2145fe=_[_0x1528('0x29')](db['MailServerOut'][_0x1528('0x2a')],function(_0x52cf86){return{'name':_0x52cf86[_0x1528('0x2b')],'type':_0x52cf86[_0x1528('0x2c')]['key']};});_0x3cb79b[_0x1528('0x2d')]=_[_0x1528('0x29')](_0x2145fe,_0x1528('0x27'));_0x3cb79b[_0x1528('0x2e')]=_[_0x1528('0x2f')](_0x13a00a[_0x1528('0x2e')]);_0x3cb79b[_0x1528('0x30')]=_[_0x1528('0x31')](_0x3cb79b[_0x1528('0x2d')],_0x3cb79b[_0x1528('0x2e')]);_0x54cb15['attributes']=_[_0x1528('0x31')](_0x3cb79b['model'],qs[_0x1528('0x32')](_0x13a00a['query'][_0x1528('0x32')]));_0x54cb15[_0x1528('0x33')]=_0x54cb15[_0x1528('0x33')][_0x1528('0x34')]?_0x54cb15[_0x1528('0x33')]:_0x3cb79b[_0x1528('0x2d')];if(!_0x13a00a[_0x1528('0x2e')][_0x1528('0x35')]('nolimit')){_0x54cb15[_0x1528('0x1b')]=qs[_0x1528('0x1b')](_0x13a00a[_0x1528('0x2e')][_0x1528('0x1b')]);_0x54cb15[_0x1528('0x1a')]=qs[_0x1528('0x1a')](_0x13a00a[_0x1528('0x2e')][_0x1528('0x1a')]);}_0x54cb15[_0x1528('0x36')]=qs['sort'](_0x13a00a[_0x1528('0x2e')]['sort']);_0x54cb15[_0x1528('0x37')]=qs[_0x1528('0x30')](_['pick'](_0x13a00a[_0x1528('0x2e')],_0x3cb79b['filters']),_0x2145fe);if(_0x13a00a[_0x1528('0x2e')][_0x1528('0x38')]){_0x54cb15[_0x1528('0x37')]=_['merge'](_0x54cb15[_0x1528('0x37')],{'$or':_[_0x1528('0x29')](_0x2145fe,function(_0x8cc4a5){if(_0x8cc4a5[_0x1528('0x2c')]!==_0x1528('0x39')){var _0x121423={};_0x121423[_0x8cc4a5[_0x1528('0x27')]]={'$like':'%'+_0x13a00a[_0x1528('0x2e')]['filter']+'%'};return _0x121423;}})});}_0x54cb15=_[_0x1528('0x3a')]({},_0x54cb15,_0x13a00a[_0x1528('0x3b')]);var _0x282ac4={'where':_0x54cb15[_0x1528('0x37')]};return db['MailServerOut'][_0x1528('0x19')](_0x282ac4)[_0x1528('0x22')](function(_0x1a8aa3){_0x4cf9f0[_0x1528('0x19')]=_0x1a8aa3;if(_0x13a00a['query'][_0x1528('0x3c')]){_0x54cb15[_0x1528('0x3d')]=[{'all':!![]}];}return db[_0x1528('0x3e')][_0x1528('0x3f')](_0x54cb15);})[_0x1528('0x22')](function(_0x5e01a1){_0x4cf9f0[_0x1528('0x40')]=_0x5e01a1;return _0x4cf9f0;})[_0x1528('0x22')](respondWithFilteredResult(_0x18d049,_0x54cb15))[_0x1528('0x41')](handleError(_0x18d049,null));};exports['show']=function(_0x4b8546,_0x5158e3){var _0x5c49e0={'raw':!![],'where':{'id':_0x4b8546['params']['id']}},_0x13ebd0={};_0x13ebd0[_0x1528('0x2d')]=_[_0x1528('0x2f')](db[_0x1528('0x3e')][_0x1528('0x2a')]);_0x13ebd0[_0x1528('0x2e')]=_[_0x1528('0x2f')](_0x4b8546['query']);_0x13ebd0[_0x1528('0x30')]=_[_0x1528('0x31')](_0x13ebd0[_0x1528('0x2d')],_0x13ebd0['query']);_0x5c49e0['attributes']=_[_0x1528('0x31')](_0x13ebd0['model'],qs[_0x1528('0x32')](_0x4b8546['query'][_0x1528('0x32')]));_0x5c49e0[_0x1528('0x33')]=_0x5c49e0[_0x1528('0x33')][_0x1528('0x34')]?_0x5c49e0[_0x1528('0x33')]:_0x13ebd0[_0x1528('0x2d')];if(_0x4b8546['query']['includeAll']){_0x5c49e0[_0x1528('0x3d')]=[{'all':!![]}];}_0x5c49e0=_[_0x1528('0x3a')]({},_0x5c49e0,_0x4b8546['options']);return db['MailServerOut'][_0x1528('0x42')](_0x5c49e0)[_0x1528('0x22')](handleEntityNotFound(_0x5158e3,null))[_0x1528('0x22')](respondWithResult(_0x5158e3,null))['catch'](handleError(_0x5158e3,null));};exports[_0x1528('0x43')]=function(_0x43fba4,_0x47ee89){return db[_0x1528('0x3e')][_0x1528('0x43')](_0x43fba4[_0x1528('0x44')],{})[_0x1528('0x22')](respondWithResult(_0x47ee89,0xc9))[_0x1528('0x41')](handleError(_0x47ee89,null));};exports[_0x1528('0x21')]=function(_0x5ebbbb,_0x588704){if(_0x5ebbbb[_0x1528('0x44')]['id']){delete _0x5ebbbb['body']['id'];}return db['MailServerOut'][_0x1528('0x42')]({'where':{'id':_0x5ebbbb[_0x1528('0x45')]['id']}})['then'](handleEntityNotFound(_0x588704,null))[_0x1528('0x22')](saveUpdates(_0x5ebbbb[_0x1528('0x44')],null))['then'](respondWithResult(_0x588704,null))[_0x1528('0x41')](handleError(_0x588704,null));};exports['destroy']=function(_0x53b633,_0x5c281b){return db['MailServerOut']['find']({'where':{'id':_0x53b633['params']['id']}})['then'](handleEntityNotFound(_0x5c281b,null))[_0x1528('0x22')](removeEntity(_0x5c281b,null))[_0x1528('0x41')](handleError(_0x5c281b,null));}; \ No newline at end of file +var _0x9962=['attributes','intersection','fields','query','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','keys','length','include','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','filters'];(function(_0x47b844,_0x53fdf3){var _0xcad6a3=function(_0x1bbc62){while(--_0x1bbc62){_0x47b844['push'](_0x47b844['shift']());}};_0xcad6a3(++_0x53fdf3);}(_0x9962,0x14c));var _0x2996=function(_0x283600,_0xc67998){_0x283600=_0x283600-0x0;var _0x6cf4c6=_0x9962[_0x283600];return _0x6cf4c6;};'use strict';var emlformat=require(_0x2996('0x0'));var rimraf=require(_0x2996('0x1'));var zipdir=require(_0x2996('0x2'));var jsonpatch=require(_0x2996('0x3'));var rp=require(_0x2996('0x4'));var moment=require(_0x2996('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2996('0x6'));var util=require(_0x2996('0x7'));var path=require(_0x2996('0x8'));var sox=require(_0x2996('0x9'));var csv=require('to-csv');var ejs=require(_0x2996('0xa'));var fs=require('fs');var fs_extra=require(_0x2996('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2996('0xc'));var jsforce=require(_0x2996('0xd'));var deskjs=require(_0x2996('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2996('0xf'));var Papa=require('papaparse');var Redis=require(_0x2996('0x10'));var authService=require(_0x2996('0x11'));var qs=require(_0x2996('0x12'));var as=require(_0x2996('0x13'));var hardwareService=require(_0x2996('0x14'));var logger=require(_0x2996('0x15'))(_0x2996('0x16'));var utils=require(_0x2996('0x17'));var config=require(_0x2996('0x18'));var licenseUtil=require(_0x2996('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ea355,_0xf6f478){_0xf6f478=_0xf6f478||0xcc;return function(_0x37c3bf){if(_0x37c3bf){return _0x1ea355['sendStatus'](_0xf6f478);}return _0x1ea355[_0x2996('0x1a')](_0xf6f478)['end']();};}function respondWithResult(_0x3332e3,_0x238d84){_0x238d84=_0x238d84||0xc8;return function(_0x580bfd){if(_0x580bfd){return _0x3332e3[_0x2996('0x1a')](_0x238d84)[_0x2996('0x1b')](_0x580bfd);}};}function respondWithFilteredResult(_0x5d820d,_0x1b91db){return function(_0xaa5f69){if(_0xaa5f69){var _0x18a8b3=typeof _0x1b91db[_0x2996('0x1c')]===_0x2996('0x1d')&&typeof _0x1b91db['limit']==='undefined';var _0x23b0ca=_0xaa5f69[_0x2996('0x1e')];var _0x491ee5=_0x18a8b3?0x0:_0x1b91db['offset'];var _0x97def2=_0x18a8b3?_0xaa5f69[_0x2996('0x1e')]:_0x1b91db[_0x2996('0x1c')]+_0x1b91db[_0x2996('0x1f')];var _0x45a5f2;if(_0x97def2>=_0x23b0ca){_0x97def2=_0x23b0ca;_0x45a5f2=0xc8;}else{_0x45a5f2=0xce;}_0x5d820d['status'](_0x45a5f2);return _0x5d820d[_0x2996('0x20')](_0x2996('0x21'),_0x491ee5+'-'+_0x97def2+'/'+_0x23b0ca)[_0x2996('0x1b')](_0xaa5f69);}return null;};}function patchUpdates(_0x42bc4f){return function(_0x5246db){try{jsonpatch[_0x2996('0x22')](_0x5246db,_0x42bc4f,!![]);}catch(_0x16f75b){return BPromise['reject'](_0x16f75b);}return _0x5246db[_0x2996('0x23')]();};}function saveUpdates(_0x4b9cce,_0x2e10db){return function(_0x3bd60d){if(_0x3bd60d){return _0x3bd60d[_0x2996('0x24')](_0x4b9cce)[_0x2996('0x25')](function(_0xa64dc2){return _0xa64dc2;});}return null;};}function removeEntity(_0x57d9da,_0x866a77){return function(_0x1c4f3b){if(_0x1c4f3b){return _0x1c4f3b[_0x2996('0x26')]()[_0x2996('0x25')](function(){_0x57d9da[_0x2996('0x1a')](0xcc)[_0x2996('0x27')]();});}};}function handleEntityNotFound(_0x15fbd0,_0x328aba){return function(_0xf54a9e){if(!_0xf54a9e){_0x15fbd0[_0x2996('0x28')](0x194);}return _0xf54a9e;};}function handleError(_0x579c9f,_0x25ac54){_0x25ac54=_0x25ac54||0x1f4;return function(_0x2410ca){logger['error'](_0x2410ca[_0x2996('0x29')]);if(_0x2410ca[_0x2996('0x2a')]){delete _0x2410ca[_0x2996('0x2a')];}_0x579c9f[_0x2996('0x1a')](_0x25ac54)[_0x2996('0x2b')](_0x2410ca);};}exports[_0x2996('0x2c')]=function(_0x5a2e92,_0x47b2f6){var _0x2fbe28={},_0x437fe9={},_0x48b840={'count':0x0,'rows':[]};var _0x475a94=_[_0x2996('0x2d')](db[_0x2996('0x2e')][_0x2996('0x2f')],function(_0x28d6bc){return{'name':_0x28d6bc[_0x2996('0x30')],'type':_0x28d6bc[_0x2996('0x31')][_0x2996('0x32')]};});_0x437fe9[_0x2996('0x33')]=_[_0x2996('0x2d')](_0x475a94,_0x2996('0x2a'));_0x437fe9['query']=_['keys'](_0x5a2e92['query']);_0x437fe9[_0x2996('0x34')]=_['intersection'](_0x437fe9['model'],_0x437fe9['query']);_0x2fbe28[_0x2996('0x35')]=_[_0x2996('0x36')](_0x437fe9[_0x2996('0x33')],qs[_0x2996('0x37')](_0x5a2e92[_0x2996('0x38')]['fields']));_0x2fbe28[_0x2996('0x35')]=_0x2fbe28[_0x2996('0x35')]['length']?_0x2fbe28['attributes']:_0x437fe9['model'];if(!_0x5a2e92[_0x2996('0x38')][_0x2996('0x39')](_0x2996('0x3a'))){_0x2fbe28['limit']=qs[_0x2996('0x1f')](_0x5a2e92[_0x2996('0x38')][_0x2996('0x1f')]);_0x2fbe28[_0x2996('0x1c')]=qs[_0x2996('0x1c')](_0x5a2e92[_0x2996('0x38')]['offset']);}_0x2fbe28['order']=qs['sort'](_0x5a2e92['query'][_0x2996('0x3b')]);_0x2fbe28['where']=qs[_0x2996('0x34')](_[_0x2996('0x3c')](_0x5a2e92[_0x2996('0x38')],_0x437fe9['filters']),_0x475a94);if(_0x5a2e92[_0x2996('0x38')][_0x2996('0x3d')]){_0x2fbe28[_0x2996('0x3e')]=_[_0x2996('0x3f')](_0x2fbe28[_0x2996('0x3e')],{'$or':_[_0x2996('0x2d')](_0x475a94,function(_0x678e67){if(_0x678e67[_0x2996('0x31')]!==_0x2996('0x40')){var _0x368e03={};_0x368e03[_0x678e67[_0x2996('0x2a')]]={'$like':'%'+_0x5a2e92[_0x2996('0x38')][_0x2996('0x3d')]+'%'};return _0x368e03;}})});}_0x2fbe28=_[_0x2996('0x3f')]({},_0x2fbe28,_0x5a2e92[_0x2996('0x41')]);var _0x4d40ed={'where':_0x2fbe28[_0x2996('0x3e')]};return db['MailServerOut'][_0x2996('0x1e')](_0x4d40ed)[_0x2996('0x25')](function(_0x674cf8){_0x48b840['count']=_0x674cf8;if(_0x5a2e92['query'][_0x2996('0x42')]){_0x2fbe28['include']=[{'all':!![]}];}return db['MailServerOut'][_0x2996('0x43')](_0x2fbe28);})['then'](function(_0x33ecca){_0x48b840['rows']=_0x33ecca;return _0x48b840;})[_0x2996('0x25')](respondWithFilteredResult(_0x47b2f6,_0x2fbe28))[_0x2996('0x44')](handleError(_0x47b2f6,null));};exports[_0x2996('0x45')]=function(_0x113150,_0x5f046c){var _0x398774={'raw':!![],'where':{'id':_0x113150['params']['id']}},_0x7aa346={};_0x7aa346[_0x2996('0x33')]=_[_0x2996('0x46')](db[_0x2996('0x2e')][_0x2996('0x2f')]);_0x7aa346[_0x2996('0x38')]=_[_0x2996('0x46')](_0x113150['query']);_0x7aa346[_0x2996('0x34')]=_[_0x2996('0x36')](_0x7aa346[_0x2996('0x33')],_0x7aa346[_0x2996('0x38')]);_0x398774[_0x2996('0x35')]=_[_0x2996('0x36')](_0x7aa346[_0x2996('0x33')],qs[_0x2996('0x37')](_0x113150[_0x2996('0x38')][_0x2996('0x37')]));_0x398774[_0x2996('0x35')]=_0x398774[_0x2996('0x35')][_0x2996('0x47')]?_0x398774[_0x2996('0x35')]:_0x7aa346['model'];if(_0x113150['query'][_0x2996('0x42')]){_0x398774[_0x2996('0x48')]=[{'all':!![]}];}_0x398774=_[_0x2996('0x3f')]({},_0x398774,_0x113150[_0x2996('0x41')]);return db[_0x2996('0x2e')][_0x2996('0x49')](_0x398774)['then'](handleEntityNotFound(_0x5f046c,null))[_0x2996('0x25')](respondWithResult(_0x5f046c,null))[_0x2996('0x44')](handleError(_0x5f046c,null));};exports[_0x2996('0x4a')]=function(_0x2ea0bb,_0x43d70b){return db[_0x2996('0x2e')][_0x2996('0x4a')](_0x2ea0bb['body'],{})[_0x2996('0x25')](respondWithResult(_0x43d70b,0xc9))[_0x2996('0x44')](handleError(_0x43d70b,null));};exports[_0x2996('0x24')]=function(_0x57865f,_0x2e5918){if(_0x57865f[_0x2996('0x4b')]['id']){delete _0x57865f[_0x2996('0x4b')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x57865f['params']['id']}})[_0x2996('0x25')](handleEntityNotFound(_0x2e5918,null))[_0x2996('0x25')](saveUpdates(_0x57865f[_0x2996('0x4b')],null))['then'](respondWithResult(_0x2e5918,null))[_0x2996('0x44')](handleError(_0x2e5918,null));};exports[_0x2996('0x26')]=function(_0x5eb0e8,_0x1c5b6a){return db[_0x2996('0x2e')]['find']({'where':{'id':_0x5eb0e8[_0x2996('0x4c')]['id']}})[_0x2996('0x25')](handleEntityNotFound(_0x1c5b6a,null))['then'](removeEntity(_0x1c5b6a,null))[_0x2996('0x44')](handleError(_0x1c5b6a,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 4d6490b..d9dec8b 100644 --- a/server/api/mailServerOut/mailServerOut.model.js +++ b/server/api/mailServerOut/mailServerOut.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10e8=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x10e8,0xf7));var _0x810e=function(_0x5d690a,_0xa48366){_0x5d690a=_0x5d690a-0x0;var _0x442e15=_0x10e8[_0x5d690a];return _0x442e15;};'use strict';var _=require('lodash');var util=require(_0x810e('0x0'));var logger=require('../../config/logger')(_0x810e('0x1'));var moment=require(_0x810e('0x2'));var BPromise=require(_0x810e('0x3'));var rp=require(_0x810e('0x4'));var fs=require('fs');var path=require(_0x810e('0x5'));var rimraf=require(_0x810e('0x6'));var config=require(_0x810e('0x7'));var attributes=require(_0x810e('0x8'));module[_0x810e('0x9')]=function(_0x3a4c68,_0x80bbb7){return _0x3a4c68[_0x810e('0xa')](_0x810e('0xb'),attributes,{'tableName':_0x810e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3e7=['rimraf','../../config/environment','./mailServerOut.attributes','exports','define','mail_servers_out','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x4182a9,_0x240de4){var _0x4dc355=function(_0x1bc7dd){while(--_0x1bc7dd){_0x4182a9['push'](_0x4182a9['shift']());}};_0x4dc355(++_0x240de4);}(_0xc3e7,0x11a));var _0x7c3e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xc3e7[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x7c3e('0x0'));var util=require(_0x7c3e('0x1'));var logger=require(_0x7c3e('0x2'))('api');var moment=require(_0x7c3e('0x3'));var BPromise=require('bluebird');var rp=require(_0x7c3e('0x4'));var fs=require('fs');var path=require(_0x7c3e('0x5'));var rimraf=require(_0x7c3e('0x6'));var config=require(_0x7c3e('0x7'));var attributes=require(_0x7c3e('0x8'));module[_0x7c3e('0x9')]=function(_0x2c35e3,_0x2a6cb6){return _0x2c35e3[_0x7c3e('0xa')]('MailServerOut',attributes,{'tableName':_0x7c3e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index e4a6f8a..888a119 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x47cc1d,_0x293b02){var _0x271678=function(_0x230278){while(--_0x230278){_0x47cc1d['push'](_0x47cc1d['shift']());}};_0x271678(++_0x293b02);}(_0xdb28,0x106));var _0x8db2=function(_0x139c04,_0x47d915){_0x139c04=_0x139c04-0x0;var _0x1243fb=_0xdb28[_0x139c04];return _0x1243fb;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x50d7fd,_0x30cd62){var _0x512b17=function(_0x305414){while(--_0x305414){_0x50d7fd['push'](_0x50d7fd['shift']());}};_0x512b17(++_0x30cd62);}(_0xadb5,0xad));var _0x5adb=function(_0x2117d7,_0x4930d3){_0x2117d7=_0x2117d7-0x0;var _0x1ea535=_0xadb5[_0x2117d7];return _0x1ea535;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 8f1eb4b..f072af3 100644 --- a/server/api/mailSubstatus/index.js +++ b/server/api/mailSubstatus/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x914a=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x4b9878,_0x32fe17){var _0x14808b=function(_0x259a54){while(--_0x259a54){_0x4b9878['push'](_0x4b9878['shift']());}};_0x14808b(++_0x32fe17);}(_0x914a,0xb0));var _0xa914=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0x914a[_0x49d19d];return _0x4ebef1;};'use strict';var multer=require(_0xa914('0x0'));var util=require('util');var path=require(_0xa914('0x1'));var timeout=require(_0xa914('0x2'));var express=require(_0xa914('0x3'));var router=express['Router']();var fs_extra=require(_0xa914('0x4'));var auth=require(_0xa914('0x5'));var interaction=require(_0xa914('0x6'));var config=require(_0xa914('0x7'));var controller=require(_0xa914('0x8'));router[_0xa914('0x9')]('/',auth['isAuthenticated'](),controller[_0xa914('0xa')]);router[_0xa914('0x9')](_0xa914('0xb'),auth[_0xa914('0xc')](),controller[_0xa914('0xd')]);router[_0xa914('0x9')](_0xa914('0xe'),auth[_0xa914('0xc')](),controller[_0xa914('0xf')]);router[_0xa914('0x10')]('/',auth[_0xa914('0xc')](),controller[_0xa914('0x11')]);router[_0xa914('0x12')]('/:id',auth[_0xa914('0xc')](),controller['update']);router[_0xa914('0x13')](_0xa914('0xe'),auth[_0xa914('0xc')](),controller[_0xa914('0x14')]);module[_0xa914('0x15')]=router; \ No newline at end of file +var _0x2366=['../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','/:id','post','create','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xab31ff,_0x3d4023){var _0x39dad9=function(_0x25e095){while(--_0x25e095){_0xab31ff['push'](_0xab31ff['shift']());}};_0x39dad9(++_0x3d4023);}(_0x2366,0x189));var _0x6236=function(_0x3f8ca7,_0x1cfd75){_0x3f8ca7=_0x3f8ca7-0x0;var _0x2ef97e=_0x2366[_0x3f8ca7];return _0x2ef97e;};'use strict';var multer=require(_0x6236('0x0'));var util=require(_0x6236('0x1'));var path=require(_0x6236('0x2'));var timeout=require('connect-timeout');var express=require(_0x6236('0x3'));var router=express[_0x6236('0x4')]();var fs_extra=require(_0x6236('0x5'));var auth=require(_0x6236('0x6'));var interaction=require(_0x6236('0x7'));var config=require(_0x6236('0x8'));var controller=require(_0x6236('0x9'));router[_0x6236('0xa')]('/',auth[_0x6236('0xb')](),controller['index']);router[_0x6236('0xa')](_0x6236('0xc'),auth[_0x6236('0xb')](),controller[_0x6236('0xd')]);router[_0x6236('0xa')](_0x6236('0xe'),auth[_0x6236('0xb')](),controller['show']);router[_0x6236('0xf')]('/',auth['isAuthenticated'](),controller[_0x6236('0x10')]);router['put']('/:id',auth[_0x6236('0xb')](),controller[_0x6236('0x11')]);router[_0x6236('0x12')](_0x6236('0xe'),auth[_0x6236('0xb')](),controller['destroy']);module[_0x6236('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 6139275..ac8f3aa 100644 --- a/server/api/mailSubstatus/mailSubstatus.attributes.js +++ b/server/api/mailSubstatus/mailSubstatus.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9fd4=['sequelize','exports','STRING','name'];(function(_0x595013,_0x65a215){var _0x2a29e3=function(_0x307bf8){while(--_0x307bf8){_0x595013['push'](_0x595013['shift']());}};_0x2a29e3(++_0x65a215);}(_0x9fd4,0x16c));var _0x49fd=function(_0x3c13b1,_0x1c975a){_0x3c13b1=_0x3c13b1-0x0;var _0x48c4b5=_0x9fd4[_0x3c13b1];return _0x48c4b5;};'use strict';var Sequelize=require(_0x49fd('0x0'));module[_0x49fd('0x1')]={'name':{'type':Sequelize[_0x49fd('0x2')],'unique':_0x49fd('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x49fd('0x2')]}}; \ No newline at end of file +var _0xc03e=['sequelize','name'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0xc03e,0x15a));var _0xec03=function(_0x2dce9f,_0x1d1880){_0x2dce9f=_0x2dce9f-0x0;var _0x1cd454=_0xc03e[_0x2dce9f];return _0x1cd454;};'use strict';var Sequelize=require(_0xec03('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xec03('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 81fec05..df48563 100644 --- a/server/api/mailSubstatus/mailSubstatus.controller.js +++ b/server/api/mailSubstatus/mailSubstatus.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21a5=['merge','options','includeAll','include','rows','show','params','rawAttributes','length','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','status','set','apply','update','destroy','then','stack','name','index','MailSubstatus','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x21a5,0x17b));var _0x521a=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0x21a5[_0x59162a];return _0x35e50d;};'use strict';var emlformat=require(_0x521a('0x0'));var rimraf=require(_0x521a('0x1'));var zipdir=require(_0x521a('0x2'));var jsonpatch=require(_0x521a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x521a('0x4'));var Mustache=require('mustache');var util=require(_0x521a('0x5'));var path=require(_0x521a('0x6'));var sox=require(_0x521a('0x7'));var csv=require(_0x521a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x521a('0x9'));var _=require('lodash');var squel=require(_0x521a('0xa'));var crypto=require(_0x521a('0xb'));var jsforce=require(_0x521a('0xc'));var deskjs=require(_0x521a('0xd'));var toCsv=require(_0x521a('0x8'));var querystring=require(_0x521a('0xe'));var Papa=require(_0x521a('0xf'));var Redis=require(_0x521a('0x10'));var authService=require(_0x521a('0x11'));var qs=require(_0x521a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x521a('0x13'));var logger=require('../../config/logger')(_0x521a('0x14'));var utils=require(_0x521a('0x15'));var config=require(_0x521a('0x16'));var licenseUtil=require(_0x521a('0x17'));var db=require(_0x521a('0x18'))['db'];function respondWithStatusCode(_0x28387b,_0x1c8974){_0x1c8974=_0x1c8974||0xcc;return function(_0x1543cf){if(_0x1543cf){return _0x28387b[_0x521a('0x19')](_0x1c8974);}return _0x28387b['status'](_0x1c8974)[_0x521a('0x1a')]();};}function respondWithResult(_0x2067f9,_0x2e1c46){_0x2e1c46=_0x2e1c46||0xc8;return function(_0x281905){if(_0x281905){return _0x2067f9['status'](_0x2e1c46)[_0x521a('0x1b')](_0x281905);}};}function respondWithFilteredResult(_0x503f86,_0x1b3e1b){return function(_0x76988e){if(_0x76988e){var _0x1a5080=typeof _0x1b3e1b[_0x521a('0x1c')]===_0x521a('0x1d')&&typeof _0x1b3e1b['limit']===_0x521a('0x1d');var _0x1f2071=_0x76988e[_0x521a('0x1e')];var _0x1c531b=_0x1a5080?0x0:_0x1b3e1b[_0x521a('0x1c')];var _0x1d9179=_0x1a5080?_0x76988e[_0x521a('0x1e')]:_0x1b3e1b[_0x521a('0x1c')]+_0x1b3e1b['limit'];var _0x13f3d9;if(_0x1d9179>=_0x1f2071){_0x1d9179=_0x1f2071;_0x13f3d9=0xc8;}else{_0x13f3d9=0xce;}_0x503f86[_0x521a('0x1f')](_0x13f3d9);return _0x503f86[_0x521a('0x20')]('Content-Range',_0x1c531b+'-'+_0x1d9179+'/'+_0x1f2071)[_0x521a('0x1b')](_0x76988e);}return null;};}function patchUpdates(_0x229a1a){return function(_0x41acc7){try{jsonpatch[_0x521a('0x21')](_0x41acc7,_0x229a1a,!![]);}catch(_0x27756e){return BPromise['reject'](_0x27756e);}return _0x41acc7['save']();};}function saveUpdates(_0x563ca8,_0x40051e){return function(_0x175fed){if(_0x175fed){return _0x175fed[_0x521a('0x22')](_0x563ca8)['then'](function(_0x3038a9){return _0x3038a9;});}return null;};}function removeEntity(_0x5b0488,_0x5753fb){return function(_0x2238e5){if(_0x2238e5){return _0x2238e5[_0x521a('0x23')]()[_0x521a('0x24')](function(){_0x5b0488[_0x521a('0x1f')](0xcc)[_0x521a('0x1a')]();});}};}function handleEntityNotFound(_0x2b756f,_0x364edc){return function(_0x22073b){if(!_0x22073b){_0x2b756f[_0x521a('0x19')](0x194);}return _0x22073b;};}function handleError(_0x4ada07,_0x30c045){_0x30c045=_0x30c045||0x1f4;return function(_0x19d481){logger['error'](_0x19d481[_0x521a('0x25')]);if(_0x19d481[_0x521a('0x26')]){delete _0x19d481[_0x521a('0x26')];}_0x4ada07[_0x521a('0x1f')](_0x30c045)['send'](_0x19d481);};}exports[_0x521a('0x27')]=function(_0x511d00,_0x1fa153){var _0x3e0d72={},_0x4c8e29={},_0x110ac6={'count':0x0,'rows':[]};var _0x3ae97b=_['map'](db[_0x521a('0x28')]['rawAttributes'],function(_0x517172){return{'name':_0x517172[_0x521a('0x29')],'type':_0x517172[_0x521a('0x2a')]['key']};});_0x4c8e29[_0x521a('0x2b')]=_[_0x521a('0x2c')](_0x3ae97b,_0x521a('0x26'));_0x4c8e29[_0x521a('0x2d')]=_[_0x521a('0x2e')](_0x511d00[_0x521a('0x2d')]);_0x4c8e29[_0x521a('0x2f')]=_[_0x521a('0x30')](_0x4c8e29[_0x521a('0x2b')],_0x4c8e29[_0x521a('0x2d')]);_0x3e0d72[_0x521a('0x31')]=_[_0x521a('0x30')](_0x4c8e29[_0x521a('0x2b')],qs['fields'](_0x511d00[_0x521a('0x2d')][_0x521a('0x32')]));_0x3e0d72[_0x521a('0x31')]=_0x3e0d72['attributes']['length']?_0x3e0d72[_0x521a('0x31')]:_0x4c8e29[_0x521a('0x2b')];if(!_0x511d00[_0x521a('0x2d')][_0x521a('0x33')](_0x521a('0x34'))){_0x3e0d72['limit']=qs[_0x521a('0x35')](_0x511d00['query']['limit']);_0x3e0d72['offset']=qs[_0x521a('0x1c')](_0x511d00[_0x521a('0x2d')][_0x521a('0x1c')]);}_0x3e0d72[_0x521a('0x36')]=qs[_0x521a('0x37')](_0x511d00[_0x521a('0x2d')]['sort']);_0x3e0d72[_0x521a('0x38')]=qs[_0x521a('0x2f')](_[_0x521a('0x39')](_0x511d00['query'],_0x4c8e29[_0x521a('0x2f')]),_0x3ae97b);if(_0x511d00['query'][_0x521a('0x3a')]){_0x3e0d72[_0x521a('0x38')]=_[_0x521a('0x3b')](_0x3e0d72[_0x521a('0x38')],{'$or':_[_0x521a('0x2c')](_0x3ae97b,function(_0x4bcb39){if(_0x4bcb39[_0x521a('0x2a')]!=='VIRTUAL'){var _0x28e4c4={};_0x28e4c4[_0x4bcb39[_0x521a('0x26')]]={'$like':'%'+_0x511d00[_0x521a('0x2d')]['filter']+'%'};return _0x28e4c4;}})});}_0x3e0d72=_[_0x521a('0x3b')]({},_0x3e0d72,_0x511d00[_0x521a('0x3c')]);var _0x58c4b5={'where':_0x3e0d72[_0x521a('0x38')]};return db[_0x521a('0x28')][_0x521a('0x1e')](_0x58c4b5)[_0x521a('0x24')](function(_0x1ebf9e){_0x110ac6['count']=_0x1ebf9e;if(_0x511d00['query'][_0x521a('0x3d')]){_0x3e0d72[_0x521a('0x3e')]=[{'all':!![]}];}return db[_0x521a('0x28')]['findAll'](_0x3e0d72);})[_0x521a('0x24')](function(_0x49c07a){_0x110ac6[_0x521a('0x3f')]=_0x49c07a;return _0x110ac6;})[_0x521a('0x24')](respondWithFilteredResult(_0x1fa153,_0x3e0d72))['catch'](handleError(_0x1fa153,null));};exports[_0x521a('0x40')]=function(_0x4c1428,_0x414137){var _0x533f8f={'raw':!![],'where':{'id':_0x4c1428[_0x521a('0x41')]['id']}},_0xf736c9={};_0xf736c9[_0x521a('0x2b')]=_[_0x521a('0x2e')](db[_0x521a('0x28')][_0x521a('0x42')]);_0xf736c9['query']=_[_0x521a('0x2e')](_0x4c1428[_0x521a('0x2d')]);_0xf736c9[_0x521a('0x2f')]=_[_0x521a('0x30')](_0xf736c9[_0x521a('0x2b')],_0xf736c9[_0x521a('0x2d')]);_0x533f8f['attributes']=_[_0x521a('0x30')](_0xf736c9['model'],qs[_0x521a('0x32')](_0x4c1428[_0x521a('0x2d')]['fields']));_0x533f8f[_0x521a('0x31')]=_0x533f8f[_0x521a('0x31')][_0x521a('0x43')]?_0x533f8f[_0x521a('0x31')]:_0xf736c9[_0x521a('0x2b')];if(_0x4c1428[_0x521a('0x2d')][_0x521a('0x3d')]){_0x533f8f[_0x521a('0x3e')]=[{'all':!![]}];}_0x533f8f=_['merge']({},_0x533f8f,_0x4c1428[_0x521a('0x3c')]);return db['MailSubstatus'][_0x521a('0x44')](_0x533f8f)[_0x521a('0x24')](handleEntityNotFound(_0x414137,null))['then'](respondWithResult(_0x414137,null))[_0x521a('0x45')](handleError(_0x414137,null));};exports[_0x521a('0x46')]=function(_0x2ba74f,_0x2a395a){return db['MailSubstatus'][_0x521a('0x46')](_0x2ba74f[_0x521a('0x47')],{})['then'](respondWithResult(_0x2a395a,0xc9))['catch'](handleError(_0x2a395a,null));};exports[_0x521a('0x22')]=function(_0x525d10,_0x45e967){if(_0x525d10[_0x521a('0x47')]['id']){delete _0x525d10['body']['id'];}return db[_0x521a('0x28')]['find']({'where':{'id':_0x525d10[_0x521a('0x41')]['id']}})['then'](handleEntityNotFound(_0x45e967,null))[_0x521a('0x24')](saveUpdates(_0x525d10[_0x521a('0x47')],null))[_0x521a('0x24')](respondWithResult(_0x45e967,null))['catch'](handleError(_0x45e967,null));};exports[_0x521a('0x23')]=function(_0x5cc1ff,_0x16f13a){return db[_0x521a('0x28')][_0x521a('0x44')]({'where':{'id':_0x5cc1ff['params']['id']}})[_0x521a('0x24')](handleEntityNotFound(_0x16f13a,null))[_0x521a('0x24')](removeEntity(_0x16f13a,null))[_0x521a('0x45')](handleError(_0x16f13a,null));};exports[_0x521a('0x48')]=function(_0x4d4dc6,_0x726fb3){return db[_0x521a('0x28')][_0x521a('0x48')]()[_0x521a('0x24')](respondWithResult(_0x726fb3,null))[_0x521a('0x45')](handleError(_0x726fb3,null));}; \ No newline at end of file +var _0xf5f8=['bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','undefined','count','limit','status','set','Content-Range','save','update','then','destroy','error','name','send','MailSubstatus','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','keys','includeAll','include','find','create','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xf5f8,0x1c9));var _0x8f5f=function(_0x34a071,_0x56392){_0x34a071=_0x34a071-0x0;var _0x11649b=_0xf5f8[_0x34a071];return _0x11649b;};'use strict';var emlformat=require(_0x8f5f('0x0'));var rimraf=require(_0x8f5f('0x1'));var zipdir=require(_0x8f5f('0x2'));var jsonpatch=require(_0x8f5f('0x3'));var rp=require('request-promise');var moment=require(_0x8f5f('0x4'));var BPromise=require(_0x8f5f('0x5'));var Mustache=require(_0x8f5f('0x6'));var util=require(_0x8f5f('0x7'));var path=require(_0x8f5f('0x8'));var sox=require(_0x8f5f('0x9'));var csv=require('to-csv');var ejs=require(_0x8f5f('0xa'));var fs=require('fs');var fs_extra=require(_0x8f5f('0xb'));var _=require('lodash');var squel=require(_0x8f5f('0xc'));var crypto=require('crypto');var jsforce=require(_0x8f5f('0xd'));var deskjs=require(_0x8f5f('0xe'));var toCsv=require(_0x8f5f('0xf'));var querystring=require(_0x8f5f('0x10'));var Papa=require(_0x8f5f('0x11'));var Redis=require(_0x8f5f('0x12'));var authService=require(_0x8f5f('0x13'));var qs=require(_0x8f5f('0x14'));var as=require(_0x8f5f('0x15'));var hardwareService=require(_0x8f5f('0x16'));var logger=require(_0x8f5f('0x17'))(_0x8f5f('0x18'));var utils=require(_0x8f5f('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8f5f('0x1a'))['db'];function respondWithStatusCode(_0x1f5b31,_0x19de3f){_0x19de3f=_0x19de3f||0xcc;return function(_0x3d959e){if(_0x3d959e){return _0x1f5b31[_0x8f5f('0x1b')](_0x19de3f);}return _0x1f5b31['status'](_0x19de3f)[_0x8f5f('0x1c')]();};}function respondWithResult(_0xead25d,_0x20e8d9){_0x20e8d9=_0x20e8d9||0xc8;return function(_0x8a200b){if(_0x8a200b){return _0xead25d['status'](_0x20e8d9)[_0x8f5f('0x1d')](_0x8a200b);}};}function respondWithFilteredResult(_0x2e4bb1,_0x47fe7c){return function(_0x398a74){if(_0x398a74){var _0x187934=typeof _0x47fe7c['offset']===_0x8f5f('0x1e')&&typeof _0x47fe7c['limit']==='undefined';var _0x15727a=_0x398a74[_0x8f5f('0x1f')];var _0x3d4680=_0x187934?0x0:_0x47fe7c['offset'];var _0x2eea3e=_0x187934?_0x398a74['count']:_0x47fe7c['offset']+_0x47fe7c[_0x8f5f('0x20')];var _0x58b170;if(_0x2eea3e>=_0x15727a){_0x2eea3e=_0x15727a;_0x58b170=0xc8;}else{_0x58b170=0xce;}_0x2e4bb1[_0x8f5f('0x21')](_0x58b170);return _0x2e4bb1[_0x8f5f('0x22')](_0x8f5f('0x23'),_0x3d4680+'-'+_0x2eea3e+'/'+_0x15727a)[_0x8f5f('0x1d')](_0x398a74);}return null;};}function patchUpdates(_0x10f9cb){return function(_0x3a30ff){try{jsonpatch['apply'](_0x3a30ff,_0x10f9cb,!![]);}catch(_0x15088e){return BPromise['reject'](_0x15088e);}return _0x3a30ff[_0x8f5f('0x24')]();};}function saveUpdates(_0x151c3f,_0x22362e){return function(_0x2bcd47){if(_0x2bcd47){return _0x2bcd47[_0x8f5f('0x25')](_0x151c3f)[_0x8f5f('0x26')](function(_0x31b334){return _0x31b334;});}return null;};}function removeEntity(_0x2337b,_0x70c954){return function(_0x100c80){if(_0x100c80){return _0x100c80[_0x8f5f('0x27')]()[_0x8f5f('0x26')](function(){_0x2337b[_0x8f5f('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x274d74,_0x4e4bff){return function(_0xdb1730){if(!_0xdb1730){_0x274d74[_0x8f5f('0x1b')](0x194);}return _0xdb1730;};}function handleError(_0x1198cc,_0x1f2bb5){_0x1f2bb5=_0x1f2bb5||0x1f4;return function(_0x3eb487){logger[_0x8f5f('0x28')](_0x3eb487['stack']);if(_0x3eb487[_0x8f5f('0x29')]){delete _0x3eb487[_0x8f5f('0x29')];}_0x1198cc[_0x8f5f('0x21')](_0x1f2bb5)[_0x8f5f('0x2a')](_0x3eb487);};}exports['index']=function(_0x577648,_0x1c6912){var _0x5646ec={},_0x47966f={},_0x301303={'count':0x0,'rows':[]};var _0x582d0f=_['map'](db[_0x8f5f('0x2b')][_0x8f5f('0x2c')],function(_0x5eb578){return{'name':_0x5eb578[_0x8f5f('0x2d')],'type':_0x5eb578[_0x8f5f('0x2e')][_0x8f5f('0x2f')]};});_0x47966f[_0x8f5f('0x30')]=_[_0x8f5f('0x31')](_0x582d0f,_0x8f5f('0x29'));_0x47966f[_0x8f5f('0x32')]=_['keys'](_0x577648[_0x8f5f('0x32')]);_0x47966f[_0x8f5f('0x33')]=_['intersection'](_0x47966f[_0x8f5f('0x30')],_0x47966f[_0x8f5f('0x32')]);_0x5646ec[_0x8f5f('0x34')]=_[_0x8f5f('0x35')](_0x47966f[_0x8f5f('0x30')],qs[_0x8f5f('0x36')](_0x577648[_0x8f5f('0x32')]['fields']));_0x5646ec[_0x8f5f('0x34')]=_0x5646ec[_0x8f5f('0x34')][_0x8f5f('0x37')]?_0x5646ec[_0x8f5f('0x34')]:_0x47966f[_0x8f5f('0x30')];if(!_0x577648[_0x8f5f('0x32')]['hasOwnProperty'](_0x8f5f('0x38'))){_0x5646ec['limit']=qs[_0x8f5f('0x20')](_0x577648['query'][_0x8f5f('0x20')]);_0x5646ec[_0x8f5f('0x39')]=qs[_0x8f5f('0x39')](_0x577648['query'][_0x8f5f('0x39')]);}_0x5646ec[_0x8f5f('0x3a')]=qs[_0x8f5f('0x3b')](_0x577648[_0x8f5f('0x32')][_0x8f5f('0x3b')]);_0x5646ec[_0x8f5f('0x3c')]=qs[_0x8f5f('0x33')](_[_0x8f5f('0x3d')](_0x577648[_0x8f5f('0x32')],_0x47966f['filters']),_0x582d0f);if(_0x577648['query'][_0x8f5f('0x3e')]){_0x5646ec['where']=_[_0x8f5f('0x3f')](_0x5646ec[_0x8f5f('0x3c')],{'$or':_[_0x8f5f('0x31')](_0x582d0f,function(_0x8aa0fb){if(_0x8aa0fb[_0x8f5f('0x2e')]!==_0x8f5f('0x40')){var _0x55ab43={};_0x55ab43[_0x8aa0fb[_0x8f5f('0x29')]]={'$like':'%'+_0x577648[_0x8f5f('0x32')][_0x8f5f('0x3e')]+'%'};return _0x55ab43;}})});}_0x5646ec=_[_0x8f5f('0x3f')]({},_0x5646ec,_0x577648[_0x8f5f('0x41')]);var _0x5abb6f={'where':_0x5646ec[_0x8f5f('0x3c')]};return db[_0x8f5f('0x2b')][_0x8f5f('0x1f')](_0x5abb6f)['then'](function(_0x3fa9c9){_0x301303[_0x8f5f('0x1f')]=_0x3fa9c9;if(_0x577648[_0x8f5f('0x32')]['includeAll']){_0x5646ec['include']=[{'all':!![]}];}return db[_0x8f5f('0x2b')][_0x8f5f('0x42')](_0x5646ec);})[_0x8f5f('0x26')](function(_0x536345){_0x301303[_0x8f5f('0x43')]=_0x536345;return _0x301303;})[_0x8f5f('0x26')](respondWithFilteredResult(_0x1c6912,_0x5646ec))['catch'](handleError(_0x1c6912,null));};exports[_0x8f5f('0x44')]=function(_0x922119,_0x1240a1){var _0x5ce421={'raw':!![],'where':{'id':_0x922119[_0x8f5f('0x45')]['id']}},_0x404c70={};_0x404c70[_0x8f5f('0x30')]=_[_0x8f5f('0x46')](db[_0x8f5f('0x2b')][_0x8f5f('0x2c')]);_0x404c70[_0x8f5f('0x32')]=_[_0x8f5f('0x46')](_0x922119[_0x8f5f('0x32')]);_0x404c70[_0x8f5f('0x33')]=_[_0x8f5f('0x35')](_0x404c70['model'],_0x404c70[_0x8f5f('0x32')]);_0x5ce421[_0x8f5f('0x34')]=_[_0x8f5f('0x35')](_0x404c70[_0x8f5f('0x30')],qs[_0x8f5f('0x36')](_0x922119['query'][_0x8f5f('0x36')]));_0x5ce421[_0x8f5f('0x34')]=_0x5ce421['attributes'][_0x8f5f('0x37')]?_0x5ce421['attributes']:_0x404c70['model'];if(_0x922119['query'][_0x8f5f('0x47')]){_0x5ce421[_0x8f5f('0x48')]=[{'all':!![]}];}_0x5ce421=_[_0x8f5f('0x3f')]({},_0x5ce421,_0x922119[_0x8f5f('0x41')]);return db['MailSubstatus'][_0x8f5f('0x49')](_0x5ce421)['then'](handleEntityNotFound(_0x1240a1,null))['then'](respondWithResult(_0x1240a1,null))['catch'](handleError(_0x1240a1,null));};exports[_0x8f5f('0x4a')]=function(_0x33d20e,_0x11d575){return db['MailSubstatus'][_0x8f5f('0x4a')](_0x33d20e['body'],{})[_0x8f5f('0x26')](respondWithResult(_0x11d575,0xc9))[_0x8f5f('0x4b')](handleError(_0x11d575,null));};exports['update']=function(_0x5ab6d7,_0xd093d2){if(_0x5ab6d7['body']['id']){delete _0x5ab6d7[_0x8f5f('0x4c')]['id'];}return db[_0x8f5f('0x2b')][_0x8f5f('0x49')]({'where':{'id':_0x5ab6d7[_0x8f5f('0x45')]['id']}})[_0x8f5f('0x26')](handleEntityNotFound(_0xd093d2,null))[_0x8f5f('0x26')](saveUpdates(_0x5ab6d7[_0x8f5f('0x4c')],null))[_0x8f5f('0x26')](respondWithResult(_0xd093d2,null))[_0x8f5f('0x4b')](handleError(_0xd093d2,null));};exports[_0x8f5f('0x27')]=function(_0x443ca1,_0x9a107d){return db['MailSubstatus']['find']({'where':{'id':_0x443ca1[_0x8f5f('0x45')]['id']}})[_0x8f5f('0x26')](handleEntityNotFound(_0x9a107d,null))['then'](removeEntity(_0x9a107d,null))[_0x8f5f('0x4b')](handleError(_0x9a107d,null));};exports['describe']=function(_0x53ed2c,_0x1ad571){return db[_0x8f5f('0x2b')]['describe']()[_0x8f5f('0x26')](respondWithResult(_0x1ad571,null))['catch'](handleError(_0x1ad571,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 9e8b021..3864165 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7822=['../../mysqldb','MailSubstatus','setMaxListeners','emit','hasOwnProperty','hook','exports','events'];(function(_0x3fb226,_0x3236fa){var _0x1dd9d9=function(_0x4b1841){while(--_0x4b1841){_0x3fb226['push'](_0x3fb226['shift']());}};_0x1dd9d9(++_0x3236fa);}(_0x7822,0x7f));var _0x2782=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7822[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x2782('0x0'));var MailSubstatus=require(_0x2782('0x1'))['db'][_0x2782('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x2782('0x3')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x3057fa){return function(_0x39db2c,_0x2aa1f8,_0x960f83){MailSubstatusEvents[_0x2782('0x4')](_0x3057fa+':'+_0x39db2c['id'],_0x39db2c);MailSubstatusEvents[_0x2782('0x4')](_0x3057fa,_0x39db2c);_0x960f83(null);};}for(var e in events){if(events[_0x2782('0x5')](e)){var event=events[e];MailSubstatus[_0x2782('0x6')](e,emitEvent(event));}}module[_0x2782('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x93a6=['emit','hook','exports'];(function(_0x2c2289,_0x1ddd5e){var _0xc2d91d=function(_0x36221f){while(--_0x36221f){_0x2c2289['push'](_0x2c2289['shift']());}};_0xc2d91d(++_0x1ddd5e);}(_0x93a6,0x153));var _0x693a=function(_0x43f19b,_0x3f825c){_0x43f19b=_0x43f19b-0x0;var _0x1e53d5=_0x93a6[_0x43f19b];return _0x1e53d5;};'use strict';var EventEmitter=require('events');var MailSubstatus=require('../../mysqldb')['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x5295e7){return function(_0x390ea6,_0x191011,_0xc532cc){MailSubstatusEvents[_0x693a('0x0')](_0x5295e7+':'+_0x390ea6['id'],_0x390ea6);MailSubstatusEvents[_0x693a('0x0')](_0x5295e7,_0x390ea6);_0xc532cc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x693a('0x1')](e,emitEvent(event));}}module[_0x693a('0x2')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index ee438c9..eefc738 100644 --- a/server/api/mailSubstatus/mailSubstatus.model.js +++ b/server/api/mailSubstatus/mailSubstatus.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0e8=['then','./mailSubstatus.attributes','exports','models','define','MailSubstatus','Condition','name','mailSubstatus'];(function(_0x1d5820,_0x2813fa){var _0x1a0346=function(_0x499a60){while(--_0x499a60){_0x1d5820['push'](_0x1d5820['shift']());}};_0x1a0346(++_0x2813fa);}(_0xd0e8,0x64));var _0x8d0e=function(_0x5eae85,_0x3bb2db){_0x5eae85=_0x5eae85-0x0;var _0x4fd30f=_0xd0e8[_0x5eae85];return _0x4fd30f;};'use strict';var attributes=require(_0x8d0e('0x0'));module[_0x8d0e('0x1')]=function(_0x277834){var _0x7f03e4=_0x277834[_0x8d0e('0x2')];return _0x277834[_0x8d0e('0x3')](_0x8d0e('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x293397,_0x142773,_0x3b2863){return _0x7f03e4[_0x8d0e('0x5')]['update']({'value':_0x293397[_0x8d0e('0x6')]},{'where':{'field':_0x8d0e('0x7'),'value':_0x293397['_previousDataValues'][_0x8d0e('0x6')]}})[_0x8d0e('0x8')](function(){_0x3b2863();})['catch'](function(_0x27b48d){_0x3b2863(_0x27b48d);});}}});}; \ No newline at end of file +var _0x61bd=['models','define','mail_substatuses','Condition','update','name','_previousDataValues','then','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x61bd,0x1ef));var _0xd61b=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0x61bd[_0x44a64f];return _0x52024b;};'use strict';var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x10283f){var _0x1474f2=_0x10283f[_0xd61b('0x0')];return _0x10283f[_0xd61b('0x1')]('MailSubstatus',attributes,{'tableName':_0xd61b('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1023a9,_0x488060,_0x31c4a8){return _0x1474f2[_0xd61b('0x3')][_0xd61b('0x4')]({'value':_0x1023a9[_0xd61b('0x5')]},{'where':{'field':'mailSubstatus','value':_0x1023a9[_0xd61b('0x6')][_0xd61b('0x5')]}})[_0xd61b('0x7')](function(){_0x31c4a8();})[_0xd61b('0x8')](function(_0x2a70d0){_0x31c4a8(_0x2a70d0);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index cf935e1..d119b5c 100644 --- a/server/api/mailSubstatus/mailSubstatus.rpc.js +++ b/server/api/mailSubstatus/mailSubstatus.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0706=['rpc','../../config/environment','jayson/promise','client','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1a2625,_0x533673){var _0x5281df=function(_0x429912){while(--_0x429912){_0x1a2625['push'](_0x1a2625['shift']());}};_0x5281df(++_0x533673);}(_0x0706,0x1dc));var _0x6070=function(_0x21e16e,_0x3a052b){_0x21e16e=_0x21e16e-0x0;var _0x1a29de=_0x0706[_0x21e16e];return _0x1a29de;};'use strict';var _=require('lodash');var util=require(_0x6070('0x0'));var moment=require(_0x6070('0x1'));var BPromise=require(_0x6070('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6070('0x3'));var db=require(_0x6070('0x4'))['db'];var utils=require(_0x6070('0x5'));var logger=require(_0x6070('0x6'))(_0x6070('0x7'));var config=require(_0x6070('0x8'));var jayson=require(_0x6070('0x9'));var client=jayson[_0x6070('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5abd06,_0x86ec15,_0x59d5da){return new BPromise(function(_0x53fcd9,_0x2134f5){return client['request'](_0x5abd06,_0x59d5da)[_0x6070('0xb')](function(_0x274731){logger[_0x6070('0xc')](_0x6070('0xd'),_0x86ec15,_0x6070('0xe'));logger[_0x6070('0xf')](_0x6070('0x10'),_0x86ec15,_0x6070('0xe'),JSON[_0x6070('0x11')](_0x274731));if(_0x274731[_0x6070('0x12')]){if(_0x274731[_0x6070('0x12')][_0x6070('0x13')]===0x1f4){logger['error'](_0x6070('0xd'),_0x86ec15,_0x274731[_0x6070('0x12')]['message']);return _0x2134f5(_0x274731[_0x6070('0x12')][_0x6070('0x14')]);}logger[_0x6070('0x12')](_0x6070('0xd'),_0x86ec15,_0x274731[_0x6070('0x12')][_0x6070('0x14')]);return _0x53fcd9(_0x274731[_0x6070('0x12')][_0x6070('0x14')]);}else{logger[_0x6070('0xc')](_0x6070('0xd'),_0x86ec15,'request\x20sent');_0x53fcd9(_0x274731[_0x6070('0x15')][_0x6070('0x14')]);}})[_0x6070('0x16')](function(_0x4e5c28){logger[_0x6070('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x86ec15,_0x4e5c28);_0x2134f5(_0x4e5c28);});});} \ No newline at end of file +var _0x623e=['MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0x623e,0x182));var _0xe623=function(_0x2ca82a,_0x1e2f7e){_0x2ca82a=_0x2ca82a-0x0;var _0x5435ad=_0x623e[_0x2ca82a];return _0x5435ad;};'use strict';var _=require(_0xe623('0x0'));var util=require('util');var moment=require(_0xe623('0x1'));var BPromise=require(_0xe623('0x2'));var rs=require(_0xe623('0x3'));var fs=require('fs');var Redis=require(_0xe623('0x4'));var db=require(_0xe623('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe623('0x6'));var jayson=require(_0xe623('0x7'));var client=jayson['client'][_0xe623('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54ca27,_0x5114e5,_0xc6fa45){return new BPromise(function(_0xeb9cf0,_0x4602cf){return client[_0xe623('0x9')](_0x54ca27,_0xc6fa45)[_0xe623('0xa')](function(_0x27bc25){logger[_0xe623('0xb')](_0xe623('0xc'),_0x5114e5,_0xe623('0xd'));logger['debug'](_0xe623('0xe'),_0x5114e5,_0xe623('0xd'),JSON[_0xe623('0xf')](_0x27bc25));if(_0x27bc25[_0xe623('0x10')]){if(_0x27bc25[_0xe623('0x10')][_0xe623('0x11')]===0x1f4){logger[_0xe623('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x5114e5,_0x27bc25[_0xe623('0x10')]['message']);return _0x4602cf(_0x27bc25[_0xe623('0x10')]['message']);}logger[_0xe623('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x5114e5,_0x27bc25[_0xe623('0x10')][_0xe623('0x12')]);return _0xeb9cf0(_0x27bc25[_0xe623('0x10')]['message']);}else{logger['info'](_0xe623('0xc'),_0x5114e5,_0xe623('0xd'));_0xeb9cf0(_0x27bc25['result']['message']);}})[_0xe623('0x13')](function(_0x31f27b){logger[_0xe623('0x10')](_0xe623('0xc'),_0x5114e5,_0x31f27b);_0x4602cf(_0x31f27b);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 8d735de..0f54f98 100644 --- a/server/api/mailTransferReport/index.js +++ b/server/api/mailTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbea7=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2b8515,_0x52b639){var _0x1861f8=function(_0x2dab58){while(--_0x2dab58){_0x2b8515['push'](_0x2b8515['shift']());}};_0x1861f8(++_0x52b639);}(_0xbea7,0xc4));var _0x7bea=function(_0x385385,_0x353e1b){_0x385385=_0x385385-0x0;var _0x4a2334=_0xbea7[_0x385385];return _0x4a2334;};'use strict';var multer=require(_0x7bea('0x0'));var util=require(_0x7bea('0x1'));var path=require(_0x7bea('0x2'));var timeout=require(_0x7bea('0x3'));var express=require(_0x7bea('0x4'));var router=express[_0x7bea('0x5')]();var fs_extra=require(_0x7bea('0x6'));var auth=require(_0x7bea('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7bea('0x8'));var controller=require(_0x7bea('0x9'));router[_0x7bea('0xa')]('/',auth[_0x7bea('0xb')](),controller['index']);router['get'](_0x7bea('0xc'),auth['isAuthenticated'](),controller[_0x7bea('0xd')]);router['get'](_0x7bea('0xe'),auth[_0x7bea('0xb')](),controller['show']);router[_0x7bea('0xf')]('/',auth[_0x7bea('0xb')](),controller[_0x7bea('0x10')]);router[_0x7bea('0x11')](_0x7bea('0xe'),auth[_0x7bea('0xb')](),controller[_0x7bea('0x12')]);router[_0x7bea('0x13')](_0x7bea('0xe'),auth[_0x7bea('0xb')](),controller[_0x7bea('0x14')]);module[_0x7bea('0x15')]=router; \ No newline at end of file +var _0xab7b=['../../config/environment','./mailTransferReport.controller','get','index','/describe','isAuthenticated','describe','show','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0xf8da14,_0x49b2f2){var _0x61d88c=function(_0x23c987){while(--_0x23c987){_0xf8da14['push'](_0xf8da14['shift']());}};_0x61d88c(++_0x49b2f2);}(_0xab7b,0x67));var _0xbab7=function(_0x30a640,_0x300254){_0x30a640=_0x30a640-0x0;var _0x21f6b4=_0xab7b[_0x30a640];return _0x21f6b4;};'use strict';var multer=require(_0xbab7('0x0'));var util=require(_0xbab7('0x1'));var path=require(_0xbab7('0x2'));var timeout=require(_0xbab7('0x3'));var express=require(_0xbab7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbab7('0x5'));var interaction=require(_0xbab7('0x6'));var config=require(_0xbab7('0x7'));var controller=require(_0xbab7('0x8'));router[_0xbab7('0x9')]('/',auth['isAuthenticated'](),controller[_0xbab7('0xa')]);router[_0xbab7('0x9')](_0xbab7('0xb'),auth[_0xbab7('0xc')](),controller[_0xbab7('0xd')]);router['get']('/:id',auth[_0xbab7('0xc')](),controller[_0xbab7('0xe')]);router['post']('/',auth[_0xbab7('0xc')](),controller[_0xbab7('0xf')]);router[_0xbab7('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xbab7('0x11')]);router[_0xbab7('0x12')](_0xbab7('0x13'),auth[_0xbab7('0xc')](),controller[_0xbab7('0x14')]);module[_0xbab7('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index a5fc0e2..37e23a2 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x1d94d1,_0x347bb8){var _0x23c397=function(_0x489441){while(--_0x489441){_0x1d94d1['push'](_0x1d94d1['shift']());}};_0x23c397(++_0x347bb8);}(_0x34e8,0x12c));var _0x834e=function(_0x28934,_0x311721){_0x28934=_0x28934-0x0;var _0x436cf0=_0x34e8[_0x28934];return _0x436cf0;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4bdd56,_0x219c46){var _0x5c1151=function(_0x34a036){while(--_0x34a036){_0x4bdd56['push'](_0x4bdd56['shift']());}};_0x5c1151(++_0x219c46);}(_0x008c,0x188));var _0xc008=function(_0x27c151,_0x52c49b){_0x27c151=_0x27c151-0x0;var _0x5c4bf9=_0x008c[_0x27c151];return _0x5c4bf9;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index c40f870..8fc4def 100644 --- a/server/api/mailTransferReport/mailTransferReport.controller.js +++ b/server/api/mailTransferReport/mailTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x43e6=['end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','keys','query','model','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','MailTransferReport','includeAll','findAll','catch','params','intersection','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x2f2a0d,_0x5d1976){var _0x823f5e=function(_0x5c42d5){while(--_0x5c42d5){_0x2f2a0d['push'](_0x2f2a0d['shift']());}};_0x823f5e(++_0x5d1976);}(_0x43e6,0x10b));var _0x643e=function(_0x17f32c,_0x287558){_0x17f32c=_0x17f32c-0x0;var _0x5087a4=_0x43e6[_0x17f32c];return _0x5087a4;};'use strict';var emlformat=require(_0x643e('0x0'));var rimraf=require(_0x643e('0x1'));var zipdir=require(_0x643e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x643e('0x3'));var moment=require(_0x643e('0x4'));var BPromise=require(_0x643e('0x5'));var Mustache=require(_0x643e('0x6'));var util=require('util');var path=require(_0x643e('0x7'));var sox=require(_0x643e('0x8'));var csv=require(_0x643e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x643e('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x643e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x643e('0x9'));var querystring=require(_0x643e('0xc'));var Papa=require(_0x643e('0xd'));var Redis=require(_0x643e('0xe'));var authService=require(_0x643e('0xf'));var qs=require(_0x643e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x643e('0x11'));var logger=require(_0x643e('0x12'))(_0x643e('0x13'));var utils=require(_0x643e('0x14'));var config=require(_0x643e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x643e('0x16'))['db'];function respondWithStatusCode(_0x2cb46e,_0x4f72f0){_0x4f72f0=_0x4f72f0||0xcc;return function(_0x11b074){if(_0x11b074){return _0x2cb46e[_0x643e('0x17')](_0x4f72f0);}return _0x2cb46e[_0x643e('0x18')](_0x4f72f0)[_0x643e('0x19')]();};}function respondWithResult(_0x49a6ca,_0x1f7f30){_0x1f7f30=_0x1f7f30||0xc8;return function(_0x379628){if(_0x379628){return _0x49a6ca[_0x643e('0x18')](_0x1f7f30)[_0x643e('0x1a')](_0x379628);}};}function respondWithFilteredResult(_0x62aaf5,_0x127ddd){return function(_0x237fdb){if(_0x237fdb){var _0x402d14=typeof _0x127ddd[_0x643e('0x1b')]===_0x643e('0x1c')&&typeof _0x127ddd[_0x643e('0x1d')]===_0x643e('0x1c');var _0x3af253=_0x237fdb[_0x643e('0x1e')];var _0x5d9c1a=_0x402d14?0x0:_0x127ddd[_0x643e('0x1b')];var _0x13fad0=_0x402d14?_0x237fdb[_0x643e('0x1e')]:_0x127ddd['offset']+_0x127ddd['limit'];var _0x98fa40;if(_0x13fad0>=_0x3af253){_0x13fad0=_0x3af253;_0x98fa40=0xc8;}else{_0x98fa40=0xce;}_0x62aaf5['status'](_0x98fa40);return _0x62aaf5[_0x643e('0x1f')](_0x643e('0x20'),_0x5d9c1a+'-'+_0x13fad0+'/'+_0x3af253)[_0x643e('0x1a')](_0x237fdb);}return null;};}function patchUpdates(_0x251d28){return function(_0x351513){try{jsonpatch['apply'](_0x351513,_0x251d28,!![]);}catch(_0x4de299){return BPromise[_0x643e('0x21')](_0x4de299);}return _0x351513[_0x643e('0x22')]();};}function saveUpdates(_0x3718d0,_0x3ed410){return function(_0x330022){if(_0x330022){return _0x330022[_0x643e('0x23')](_0x3718d0)[_0x643e('0x24')](function(_0x4fd0ad){return _0x4fd0ad;});}return null;};}function removeEntity(_0x5ba2a1,_0x17f91d){return function(_0x395bb7){if(_0x395bb7){return _0x395bb7[_0x643e('0x25')]()[_0x643e('0x24')](function(){_0x5ba2a1[_0x643e('0x18')](0xcc)[_0x643e('0x19')]();});}};}function handleEntityNotFound(_0x1bfae3,_0x200a61){return function(_0x4f1c0e){if(!_0x4f1c0e){_0x1bfae3['sendStatus'](0x194);}return _0x4f1c0e;};}function handleError(_0x59f67c,_0x5aebf1){_0x5aebf1=_0x5aebf1||0x1f4;return function(_0x4a8bb4){logger[_0x643e('0x26')](_0x4a8bb4[_0x643e('0x27')]);if(_0x4a8bb4[_0x643e('0x28')]){delete _0x4a8bb4[_0x643e('0x28')];}_0x59f67c[_0x643e('0x18')](_0x5aebf1)[_0x643e('0x29')](_0x4a8bb4);};}exports[_0x643e('0x2a')]=function(_0x1c4dad,_0x2bb8fc){var _0x4f6ae4={},_0x5de6a7={},_0x1cf27d={'count':0x0,'rows':[]};var _0x11aad6=_[_0x643e('0x2b')](db['MailTransferReport']['rawAttributes'],function(_0x4a7c20){return{'name':_0x4a7c20[_0x643e('0x2c')],'type':_0x4a7c20[_0x643e('0x2d')][_0x643e('0x2e')]};});_0x5de6a7['model']=_[_0x643e('0x2b')](_0x11aad6,'name');_0x5de6a7['query']=_[_0x643e('0x2f')](_0x1c4dad[_0x643e('0x30')]);_0x5de6a7['filters']=_['intersection'](_0x5de6a7[_0x643e('0x31')],_0x5de6a7['query']);_0x4f6ae4[_0x643e('0x32')]=_['intersection'](_0x5de6a7[_0x643e('0x31')],qs[_0x643e('0x33')](_0x1c4dad[_0x643e('0x30')][_0x643e('0x33')]));_0x4f6ae4[_0x643e('0x32')]=_0x4f6ae4[_0x643e('0x32')]['length']?_0x4f6ae4['attributes']:_0x5de6a7[_0x643e('0x31')];if(!_0x1c4dad['query'][_0x643e('0x34')](_0x643e('0x35'))){_0x4f6ae4[_0x643e('0x1d')]=qs[_0x643e('0x1d')](_0x1c4dad[_0x643e('0x30')][_0x643e('0x1d')]);_0x4f6ae4['offset']=qs[_0x643e('0x1b')](_0x1c4dad[_0x643e('0x30')]['offset']);}_0x4f6ae4[_0x643e('0x36')]=qs['sort'](_0x1c4dad['query']['sort']);_0x4f6ae4[_0x643e('0x37')]=qs[_0x643e('0x38')](_[_0x643e('0x39')](_0x1c4dad['query'],_0x5de6a7[_0x643e('0x38')]),_0x11aad6);if(_0x1c4dad[_0x643e('0x30')][_0x643e('0x3a')]){_0x4f6ae4[_0x643e('0x37')]=_[_0x643e('0x3b')](_0x4f6ae4[_0x643e('0x37')],{'$or':_['map'](_0x11aad6,function(_0xf06dd7){if(_0xf06dd7['type']!==_0x643e('0x3c')){var _0x2d7f26={};_0x2d7f26[_0xf06dd7[_0x643e('0x28')]]={'$like':'%'+_0x1c4dad[_0x643e('0x30')][_0x643e('0x3a')]+'%'};return _0x2d7f26;}})});}_0x4f6ae4=_[_0x643e('0x3b')]({},_0x4f6ae4,_0x1c4dad[_0x643e('0x3d')]);var _0x45d07f={'where':_0x4f6ae4[_0x643e('0x37')]};return db[_0x643e('0x3e')][_0x643e('0x1e')](_0x45d07f)[_0x643e('0x24')](function(_0x27b4c9){_0x1cf27d['count']=_0x27b4c9;if(_0x1c4dad[_0x643e('0x30')][_0x643e('0x3f')]){_0x4f6ae4['include']=[{'all':!![]}];}return db['MailTransferReport'][_0x643e('0x40')](_0x4f6ae4);})['then'](function(_0x4c9d67){_0x1cf27d['rows']=_0x4c9d67;return _0x1cf27d;})['then'](respondWithFilteredResult(_0x2bb8fc,_0x4f6ae4))[_0x643e('0x41')](handleError(_0x2bb8fc,null));};exports['show']=function(_0x13a658,_0x2d8e12){var _0x12ebef={'raw':!![],'where':{'id':_0x13a658[_0x643e('0x42')]['id']}},_0x3c3a01={};_0x3c3a01[_0x643e('0x31')]=_[_0x643e('0x2f')](db[_0x643e('0x3e')]['rawAttributes']);_0x3c3a01[_0x643e('0x30')]=_[_0x643e('0x2f')](_0x13a658['query']);_0x3c3a01[_0x643e('0x38')]=_[_0x643e('0x43')](_0x3c3a01[_0x643e('0x31')],_0x3c3a01[_0x643e('0x30')]);_0x12ebef[_0x643e('0x32')]=_[_0x643e('0x43')](_0x3c3a01['model'],qs[_0x643e('0x33')](_0x13a658['query']['fields']));_0x12ebef[_0x643e('0x32')]=_0x12ebef['attributes'][_0x643e('0x44')]?_0x12ebef[_0x643e('0x32')]:_0x3c3a01[_0x643e('0x31')];if(_0x13a658['query']['includeAll']){_0x12ebef['include']=[{'all':!![]}];}_0x12ebef=_[_0x643e('0x3b')]({},_0x12ebef,_0x13a658[_0x643e('0x3d')]);return db['MailTransferReport'][_0x643e('0x45')](_0x12ebef)[_0x643e('0x24')](handleEntityNotFound(_0x2d8e12,null))[_0x643e('0x24')](respondWithResult(_0x2d8e12,null))[_0x643e('0x41')](handleError(_0x2d8e12,null));};exports[_0x643e('0x46')]=function(_0x21a85a,_0x2e8f81){return db[_0x643e('0x3e')][_0x643e('0x46')](_0x21a85a[_0x643e('0x47')],{})[_0x643e('0x24')](respondWithResult(_0x2e8f81,0xc9))[_0x643e('0x41')](handleError(_0x2e8f81,null));};exports[_0x643e('0x23')]=function(_0xa06916,_0x2e173d){if(_0xa06916['body']['id']){delete _0xa06916['body']['id'];}return db['MailTransferReport'][_0x643e('0x45')]({'where':{'id':_0xa06916['params']['id']}})[_0x643e('0x24')](handleEntityNotFound(_0x2e173d,null))[_0x643e('0x24')](saveUpdates(_0xa06916[_0x643e('0x47')],null))[_0x643e('0x24')](respondWithResult(_0x2e173d,null))[_0x643e('0x41')](handleError(_0x2e173d,null));};exports[_0x643e('0x25')]=function(_0x341643,_0xe073d){return db[_0x643e('0x3e')][_0x643e('0x45')]({'where':{'id':_0x341643[_0x643e('0x42')]['id']}})[_0x643e('0x24')](handleEntityNotFound(_0xe073d,null))[_0x643e('0x24')](removeEntity(_0xe073d,null))[_0x643e('0x41')](handleError(_0xe073d,null));};exports['describe']=function(_0x629337,_0x5eddc8){return db[_0x643e('0x3e')][_0x643e('0x48')]()[_0x643e('0x24')](respondWithResult(_0x5eddc8,null))[_0x643e('0x41')](handleError(_0x5eddc8,null));}; \ No newline at end of file +var _0xcfaf=['request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','VIRTUAL','filter','merge','options','findAll','catch','show','params','attributes','includeAll','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch'];(function(_0x1cd329,_0x22b232){var _0x921a9c=function(_0x501a32){while(--_0x501a32){_0x1cd329['push'](_0x1cd329['shift']());}};_0x921a9c(++_0x22b232);}(_0xcfaf,0x125));var _0xfcfa=function(_0x911604,_0x51fc61){_0x911604=_0x911604-0x0;var _0x1ed6a8=_0xcfaf[_0x911604];return _0x1ed6a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfcfa('0x0'));var zipdir=require(_0xfcfa('0x1'));var jsonpatch=require(_0xfcfa('0x2'));var rp=require(_0xfcfa('0x3'));var moment=require('moment');var BPromise=require(_0xfcfa('0x4'));var Mustache=require(_0xfcfa('0x5'));var util=require(_0xfcfa('0x6'));var path=require(_0xfcfa('0x7'));var sox=require(_0xfcfa('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcfa('0x9'));var _=require(_0xfcfa('0xa'));var squel=require(_0xfcfa('0xb'));var crypto=require('crypto');var jsforce=require(_0xfcfa('0xc'));var deskjs=require(_0xfcfa('0xd'));var toCsv=require(_0xfcfa('0xe'));var querystring=require('querystring');var Papa=require(_0xfcfa('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfcfa('0x10'));var as=require(_0xfcfa('0x11'));var hardwareService=require(_0xfcfa('0x12'));var logger=require(_0xfcfa('0x13'))('api');var utils=require(_0xfcfa('0x14'));var config=require(_0xfcfa('0x15'));var licenseUtil=require(_0xfcfa('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5aaadd,_0x31ef86){_0x31ef86=_0x31ef86||0xcc;return function(_0xe52004){if(_0xe52004){return _0x5aaadd['sendStatus'](_0x31ef86);}return _0x5aaadd[_0xfcfa('0x17')](_0x31ef86)[_0xfcfa('0x18')]();};}function respondWithResult(_0x2ba7ba,_0x2965d8){_0x2965d8=_0x2965d8||0xc8;return function(_0x3e5dbb){if(_0x3e5dbb){return _0x2ba7ba[_0xfcfa('0x17')](_0x2965d8)[_0xfcfa('0x19')](_0x3e5dbb);}};}function respondWithFilteredResult(_0x97dc17,_0x4bbb01){return function(_0x194458){if(_0x194458){var _0x20972f=typeof _0x4bbb01[_0xfcfa('0x1a')]===_0xfcfa('0x1b')&&typeof _0x4bbb01[_0xfcfa('0x1c')]==='undefined';var _0x592b33=_0x194458[_0xfcfa('0x1d')];var _0x20cabf=_0x20972f?0x0:_0x4bbb01['offset'];var _0x528892=_0x20972f?_0x194458['count']:_0x4bbb01[_0xfcfa('0x1a')]+_0x4bbb01[_0xfcfa('0x1c')];var _0x5a9498;if(_0x528892>=_0x592b33){_0x528892=_0x592b33;_0x5a9498=0xc8;}else{_0x5a9498=0xce;}_0x97dc17[_0xfcfa('0x17')](_0x5a9498);return _0x97dc17['set'](_0xfcfa('0x1e'),_0x20cabf+'-'+_0x528892+'/'+_0x592b33)['json'](_0x194458);}return null;};}function patchUpdates(_0x55e8b8){return function(_0x575490){try{jsonpatch[_0xfcfa('0x1f')](_0x575490,_0x55e8b8,!![]);}catch(_0x227af3){return BPromise['reject'](_0x227af3);}return _0x575490[_0xfcfa('0x20')]();};}function saveUpdates(_0x599b3b,_0x1ad878){return function(_0x4b6a09){if(_0x4b6a09){return _0x4b6a09[_0xfcfa('0x21')](_0x599b3b)['then'](function(_0x206591){return _0x206591;});}return null;};}function removeEntity(_0x153c93,_0x2a26fc){return function(_0x449661){if(_0x449661){return _0x449661[_0xfcfa('0x22')]()[_0xfcfa('0x23')](function(){_0x153c93[_0xfcfa('0x17')](0xcc)[_0xfcfa('0x18')]();});}};}function handleEntityNotFound(_0xd981d2,_0x2b8346){return function(_0x3dc34e){if(!_0x3dc34e){_0xd981d2[_0xfcfa('0x24')](0x194);}return _0x3dc34e;};}function handleError(_0x1f185e,_0x25def2){_0x25def2=_0x25def2||0x1f4;return function(_0x1e49d3){logger[_0xfcfa('0x25')](_0x1e49d3[_0xfcfa('0x26')]);if(_0x1e49d3['name']){delete _0x1e49d3[_0xfcfa('0x27')];}_0x1f185e[_0xfcfa('0x17')](_0x25def2)[_0xfcfa('0x28')](_0x1e49d3);};}exports[_0xfcfa('0x29')]=function(_0x4a4532,_0x27ab76){var _0x19ebfc={},_0x3713fa={},_0x3f08b5={'count':0x0,'rows':[]};var _0x912433=_[_0xfcfa('0x2a')](db[_0xfcfa('0x2b')][_0xfcfa('0x2c')],function(_0x1b4e81){return{'name':_0x1b4e81[_0xfcfa('0x2d')],'type':_0x1b4e81[_0xfcfa('0x2e')]['key']};});_0x3713fa[_0xfcfa('0x2f')]=_[_0xfcfa('0x2a')](_0x912433,_0xfcfa('0x27'));_0x3713fa[_0xfcfa('0x30')]=_[_0xfcfa('0x31')](_0x4a4532[_0xfcfa('0x30')]);_0x3713fa[_0xfcfa('0x32')]=_['intersection'](_0x3713fa[_0xfcfa('0x2f')],_0x3713fa[_0xfcfa('0x30')]);_0x19ebfc['attributes']=_[_0xfcfa('0x33')](_0x3713fa['model'],qs[_0xfcfa('0x34')](_0x4a4532[_0xfcfa('0x30')][_0xfcfa('0x34')]));_0x19ebfc['attributes']=_0x19ebfc['attributes'][_0xfcfa('0x35')]?_0x19ebfc['attributes']:_0x3713fa[_0xfcfa('0x2f')];if(!_0x4a4532[_0xfcfa('0x30')][_0xfcfa('0x36')](_0xfcfa('0x37'))){_0x19ebfc[_0xfcfa('0x1c')]=qs[_0xfcfa('0x1c')](_0x4a4532[_0xfcfa('0x30')][_0xfcfa('0x1c')]);_0x19ebfc[_0xfcfa('0x1a')]=qs[_0xfcfa('0x1a')](_0x4a4532['query']['offset']);}_0x19ebfc[_0xfcfa('0x38')]=qs['sort'](_0x4a4532['query']['sort']);_0x19ebfc[_0xfcfa('0x39')]=qs[_0xfcfa('0x32')](_[_0xfcfa('0x3a')](_0x4a4532[_0xfcfa('0x30')],_0x3713fa[_0xfcfa('0x32')]),_0x912433);if(_0x4a4532[_0xfcfa('0x30')]['filter']){_0x19ebfc[_0xfcfa('0x39')]=_['merge'](_0x19ebfc[_0xfcfa('0x39')],{'$or':_[_0xfcfa('0x2a')](_0x912433,function(_0x3a6fd2){if(_0x3a6fd2[_0xfcfa('0x2e')]!==_0xfcfa('0x3b')){var _0x27a0e3={};_0x27a0e3[_0x3a6fd2[_0xfcfa('0x27')]]={'$like':'%'+_0x4a4532['query'][_0xfcfa('0x3c')]+'%'};return _0x27a0e3;}})});}_0x19ebfc=_[_0xfcfa('0x3d')]({},_0x19ebfc,_0x4a4532[_0xfcfa('0x3e')]);var _0xa0bb28={'where':_0x19ebfc[_0xfcfa('0x39')]};return db['MailTransferReport']['count'](_0xa0bb28)['then'](function(_0x2ee4dd){_0x3f08b5[_0xfcfa('0x1d')]=_0x2ee4dd;if(_0x4a4532['query']['includeAll']){_0x19ebfc['include']=[{'all':!![]}];}return db['MailTransferReport'][_0xfcfa('0x3f')](_0x19ebfc);})['then'](function(_0x144c4e){_0x3f08b5['rows']=_0x144c4e;return _0x3f08b5;})[_0xfcfa('0x23')](respondWithFilteredResult(_0x27ab76,_0x19ebfc))[_0xfcfa('0x40')](handleError(_0x27ab76,null));};exports[_0xfcfa('0x41')]=function(_0x1cc78a,_0x22fa48){var _0x117679={'raw':!![],'where':{'id':_0x1cc78a[_0xfcfa('0x42')]['id']}},_0x466c18={};_0x466c18[_0xfcfa('0x2f')]=_[_0xfcfa('0x31')](db[_0xfcfa('0x2b')][_0xfcfa('0x2c')]);_0x466c18[_0xfcfa('0x30')]=_['keys'](_0x1cc78a[_0xfcfa('0x30')]);_0x466c18['filters']=_[_0xfcfa('0x33')](_0x466c18[_0xfcfa('0x2f')],_0x466c18['query']);_0x117679[_0xfcfa('0x43')]=_[_0xfcfa('0x33')](_0x466c18['model'],qs[_0xfcfa('0x34')](_0x1cc78a[_0xfcfa('0x30')][_0xfcfa('0x34')]));_0x117679[_0xfcfa('0x43')]=_0x117679[_0xfcfa('0x43')]['length']?_0x117679[_0xfcfa('0x43')]:_0x466c18[_0xfcfa('0x2f')];if(_0x1cc78a['query'][_0xfcfa('0x44')]){_0x117679[_0xfcfa('0x45')]=[{'all':!![]}];}_0x117679=_[_0xfcfa('0x3d')]({},_0x117679,_0x1cc78a[_0xfcfa('0x3e')]);return db['MailTransferReport'][_0xfcfa('0x46')](_0x117679)[_0xfcfa('0x23')](handleEntityNotFound(_0x22fa48,null))[_0xfcfa('0x23')](respondWithResult(_0x22fa48,null))[_0xfcfa('0x40')](handleError(_0x22fa48,null));};exports[_0xfcfa('0x47')]=function(_0x29c11d,_0x5edd8b){return db[_0xfcfa('0x2b')][_0xfcfa('0x47')](_0x29c11d['body'],{})[_0xfcfa('0x23')](respondWithResult(_0x5edd8b,0xc9))[_0xfcfa('0x40')](handleError(_0x5edd8b,null));};exports[_0xfcfa('0x21')]=function(_0x107943,_0x398154){if(_0x107943[_0xfcfa('0x48')]['id']){delete _0x107943[_0xfcfa('0x48')]['id'];}return db[_0xfcfa('0x2b')][_0xfcfa('0x46')]({'where':{'id':_0x107943[_0xfcfa('0x42')]['id']}})[_0xfcfa('0x23')](handleEntityNotFound(_0x398154,null))['then'](saveUpdates(_0x107943['body'],null))[_0xfcfa('0x23')](respondWithResult(_0x398154,null))[_0xfcfa('0x40')](handleError(_0x398154,null));};exports[_0xfcfa('0x22')]=function(_0x321104,_0x2cfdbe){return db['MailTransferReport'][_0xfcfa('0x46')]({'where':{'id':_0x321104['params']['id']}})[_0xfcfa('0x23')](handleEntityNotFound(_0x2cfdbe,null))[_0xfcfa('0x23')](removeEntity(_0x2cfdbe,null))[_0xfcfa('0x40')](handleError(_0x2cfdbe,null));};exports['describe']=function(_0x1b0294,_0x25c4fc){return db['MailTransferReport'][_0xfcfa('0x49')]()[_0xfcfa('0x23')](respondWithResult(_0x25c4fc,null))[_0xfcfa('0x40')](handleError(_0x25c4fc,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index b109bfb..b311950 100644 --- a/server/api/mailTransferReport/mailTransferReport.model.js +++ b/server/api/mailTransferReport/mailTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77d9=['MailTransferReport','report_mail_transfer','uniqueid','moment','bluebird','path','rimraf','./mailTransferReport.attributes','exports'];(function(_0xfea4e1,_0x5283ea){var _0x3d3f0b=function(_0x4b7cee){while(--_0x4b7cee){_0xfea4e1['push'](_0xfea4e1['shift']());}};_0x3d3f0b(++_0x5283ea);}(_0x77d9,0x159));var _0x977d=function(_0x386bf3,_0x39de2f){_0x386bf3=_0x386bf3-0x0;var _0x4e8eb5=_0x77d9[_0x386bf3];return _0x4e8eb5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x977d('0x0'));var BPromise=require(_0x977d('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x977d('0x2'));var rimraf=require(_0x977d('0x3'));var config=require('../../config/environment');var attributes=require(_0x977d('0x4'));module[_0x977d('0x5')]=function(_0x4852b4,_0x35a1bd){return _0x4852b4['define'](_0x977d('0x6'),attributes,{'tableName':_0x977d('0x7'),'paranoid':![],'indexes':[{'name':_0x977d('0x8'),'fields':[_0x977d('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3677=['path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x1c20d3,_0x3aebd7){var _0x32b552=function(_0x38f542){while(--_0x38f542){_0x1c20d3['push'](_0x1c20d3['shift']());}};_0x32b552(++_0x3aebd7);}(_0x3677,0x1e9));var _0x7367=function(_0x104740,_0x29c6a7){_0x104740=_0x104740-0x0;var _0x26fe57=_0x3677[_0x104740];return _0x26fe57;};'use strict';var _=require(_0x7367('0x0'));var util=require(_0x7367('0x1'));var logger=require(_0x7367('0x2'))(_0x7367('0x3'));var moment=require('moment');var BPromise=require(_0x7367('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7367('0x5'));var rimraf=require(_0x7367('0x6'));var config=require(_0x7367('0x7'));var attributes=require(_0x7367('0x8'));module[_0x7367('0x9')]=function(_0x58c26d,_0x564d9b){return _0x58c26d['define'](_0x7367('0xa'),attributes,{'tableName':_0x7367('0xb'),'paranoid':![],'indexes':[{'name':_0x7367('0xc'),'fields':[_0x7367('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 9d359c2..04757c7 100644 --- a/server/api/mailTransferReport/mailTransferReport.rpc.js +++ b/server/api/mailTransferReport/mailTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10ab=['jayson/promise','client','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0x10ab,0x1dc));var _0xb10a=function(_0xf8f6f1,_0x551483){_0xf8f6f1=_0xf8f6f1-0x0;var _0x51db61=_0x10ab[_0xf8f6f1];return _0x51db61;};'use strict';var _=require(_0xb10a('0x0'));var util=require(_0xb10a('0x1'));var moment=require(_0xb10a('0x2'));var BPromise=require(_0xb10a('0x3'));var rs=require(_0xb10a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb10a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb10a('0x6'))(_0xb10a('0x7'));var config=require('../../config/environment');var jayson=require(_0xb10a('0x8'));var client=jayson[_0xb10a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ddd1d,_0x1798c5,_0x3fe14e){return new BPromise(function(_0x4c6228,_0x396ae9){return client['request'](_0x5ddd1d,_0x3fe14e)[_0xb10a('0xa')](function(_0x4aa4cb){logger[_0xb10a('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x1798c5,_0xb10a('0xc'));logger[_0xb10a('0xd')](_0xb10a('0xe'),_0x1798c5,'request\x20sent',JSON[_0xb10a('0xf')](_0x4aa4cb));if(_0x4aa4cb[_0xb10a('0x10')]){if(_0x4aa4cb[_0xb10a('0x10')][_0xb10a('0x11')]===0x1f4){logger[_0xb10a('0x10')](_0xb10a('0x12'),_0x1798c5,_0x4aa4cb[_0xb10a('0x10')][_0xb10a('0x13')]);return _0x396ae9(_0x4aa4cb[_0xb10a('0x10')][_0xb10a('0x13')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x1798c5,_0x4aa4cb['error']['message']);return _0x4c6228(_0x4aa4cb['error'][_0xb10a('0x13')]);}else{logger[_0xb10a('0xb')](_0xb10a('0x12'),_0x1798c5,_0xb10a('0xc'));_0x4c6228(_0x4aa4cb[_0xb10a('0x14')][_0xb10a('0x13')]);}})[_0xb10a('0x15')](function(_0x2a4fb4){logger['error'](_0xb10a('0x12'),_0x1798c5,_0x2a4fb4);_0x396ae9(_0x2a4fb4);});});} \ No newline at end of file +var _0x20bf=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5eb250,_0x10e901){var _0xdab1b2=function(_0x5131fe){while(--_0x5131fe){_0x5eb250['push'](_0x5eb250['shift']());}};_0xdab1b2(++_0x10e901);}(_0x20bf,0x1c6));var _0xf20b=function(_0x35f271,_0x23c908){_0x35f271=_0x35f271-0x0;var _0x2d32bf=_0x20bf[_0x35f271];return _0x2d32bf;};'use strict';var _=require(_0xf20b('0x0'));var util=require(_0xf20b('0x1'));var moment=require(_0xf20b('0x2'));var BPromise=require(_0xf20b('0x3'));var rs=require(_0xf20b('0x4'));var fs=require('fs');var Redis=require(_0xf20b('0x5'));var db=require(_0xf20b('0x6'))['db'];var utils=require(_0xf20b('0x7'));var logger=require(_0xf20b('0x8'))(_0xf20b('0x9'));var config=require(_0xf20b('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x407104,_0x49d919,_0x3eac27){return new BPromise(function(_0x6aa791,_0x20128a){return client['request'](_0x407104,_0x3eac27)[_0xf20b('0xb')](function(_0x12e892){logger[_0xf20b('0xc')](_0xf20b('0xd'),_0x49d919,_0xf20b('0xe'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x49d919,_0xf20b('0xe'),JSON['stringify'](_0x12e892));if(_0x12e892[_0xf20b('0xf')]){if(_0x12e892[_0xf20b('0xf')][_0xf20b('0x10')]===0x1f4){logger[_0xf20b('0xf')](_0xf20b('0xd'),_0x49d919,_0x12e892['error'][_0xf20b('0x11')]);return _0x20128a(_0x12e892[_0xf20b('0xf')]['message']);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x49d919,_0x12e892[_0xf20b('0xf')][_0xf20b('0x11')]);return _0x6aa791(_0x12e892[_0xf20b('0xf')][_0xf20b('0x11')]);}else{logger[_0xf20b('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x49d919,_0xf20b('0xe'));_0x6aa791(_0x12e892[_0xf20b('0x12')][_0xf20b('0x11')]);}})[_0xf20b('0x13')](function(_0x5b58d2){logger['error'](_0xf20b('0xd'),_0x49d919,_0x5b58d2);_0x20128a(_0x5b58d2);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index e56b6af..a6fac05 100644 --- a/server/api/memberReport/index.js +++ b/server/api/memberReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa1b9=['./memberReport.controller','get','isAuthenticated','index','/describe','show','post','put','delete','/:id','destroy','util','path','connect-timeout','express'];(function(_0x1e41ba,_0x455a21){var _0x201d61=function(_0x4c1ba2){while(--_0x4c1ba2){_0x1e41ba['push'](_0x1e41ba['shift']());}};_0x201d61(++_0x455a21);}(_0xa1b9,0xdd));var _0x9a1b=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa1b9[_0x2763f2];return _0x3ef471;};'use strict';var multer=require('multer');var util=require(_0x9a1b('0x0'));var path=require(_0x9a1b('0x1'));var timeout=require(_0x9a1b('0x2'));var express=require(_0x9a1b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9a1b('0x4'));router[_0x9a1b('0x5')]('/',auth[_0x9a1b('0x6')](),controller[_0x9a1b('0x7')]);router[_0x9a1b('0x5')](_0x9a1b('0x8'),auth[_0x9a1b('0x6')](),controller['describe']);router[_0x9a1b('0x5')]('/:id',auth[_0x9a1b('0x6')](),controller[_0x9a1b('0x9')]);router[_0x9a1b('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9a1b('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9a1b('0xc')](_0x9a1b('0xd'),auth[_0x9a1b('0x6')](),controller[_0x9a1b('0xe')]);module['exports']=router; \ No newline at end of file +var _0x4699=['put','update','delete','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','/describe','describe','/:id','create'];(function(_0x20b2f8,_0x32dc96){var _0xf77d1c=function(_0x409ddf){while(--_0x409ddf){_0x20b2f8['push'](_0x20b2f8['shift']());}};_0xf77d1c(++_0x32dc96);}(_0x4699,0x8c));var _0x9469=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4699[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9469('0x0'));var util=require(_0x9469('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9469('0x2')]();var fs_extra=require(_0x9469('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9469('0x4'));var config=require(_0x9469('0x5'));var controller=require(_0x9469('0x6'));router[_0x9469('0x7')]('/',auth[_0x9469('0x8')](),controller['index']);router[_0x9469('0x7')](_0x9469('0x9'),auth[_0x9469('0x8')](),controller[_0x9469('0xa')]);router[_0x9469('0x7')](_0x9469('0xb'),auth[_0x9469('0x8')](),controller['show']);router['post']('/',auth[_0x9469('0x8')](),controller[_0x9469('0xc')]);router[_0x9469('0xd')](_0x9469('0xb'),auth[_0x9469('0x8')](),controller[_0x9469('0xe')]);router[_0x9469('0xf')](_0x9469('0xb'),auth[_0x9469('0x8')](),controller['destroy']);module[_0x9469('0x10')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 85c4882..5a4b563 100644 --- a/server/api/memberReport/memberReport.attributes.js +++ b/server/api/memberReport/memberReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bab=['talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2bab,0x188));var _0xb2ba=function(_0x4784f5,_0x1b8d8f){_0x4784f5=_0x4784f5-0x0;var _0x2f6700=_0x2bab[_0x4784f5];return _0x2f6700;};'use strict';var Sequelize=require(_0xb2ba('0x0'));var moment=require(_0xb2ba('0x1'));module[_0xb2ba('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb2ba('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0xb2ba('0x4'),'comment':_0xb2ba('0x5')},'duration':{'type':Sequelize[_0xb2ba('0x6')]},'enterAt':{'type':Sequelize[_0xb2ba('0x7')]},'exitAt':{'type':Sequelize[_0xb2ba('0x7')],'set':function(_0x62262c){var _0x5db3cb=moment(_0x62262c);var _0x116ad8=moment(this[_0xb2ba('0x8')](_0xb2ba('0x9')));var _0x507e6=_0x5db3cb['diff'](_0x116ad8,'seconds');this[_0xb2ba('0xa')](_0xb2ba('0xb'),_0x62262c);this['setDataValue'](_0xb2ba('0xc'),_0x507e6>=0x0?_0x507e6:null);}},'data1':{'type':Sequelize[_0xb2ba('0x3')],'comment':_0xb2ba('0xd')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xb2ba('0x3')],'comment':_0xb2ba('0xe')},'data4':{'type':Sequelize[_0xb2ba('0x3')],'comment':_0xb2ba('0xf')},'data5':{'type':Sequelize[_0xb2ba('0x3')],'comment':_0xb2ba('0x10')},'role':{'type':Sequelize[_0xb2ba('0x3')]},'internal':{'type':Sequelize[_0xb2ba('0x6')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4d72=['exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','seconds','setDataValue'];(function(_0xf7cd98,_0x458cca){var _0x5d8d0e=function(_0x4873ba){while(--_0x4873ba){_0xf7cd98['push'](_0xf7cd98['shift']());}};_0x5d8d0e(++_0x458cca);}(_0x4d72,0x147));var _0x24d7=function(_0x38049c,_0x7516ac){_0x38049c=_0x38049c-0x0;var _0xa4ab99=_0x4d72[_0x38049c];return _0xa4ab99;};'use strict';var Sequelize=require(_0x24d7('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0x24d7('0x1')]},'membername':{'type':Sequelize[_0x24d7('0x1')]},'interface':{'type':Sequelize[_0x24d7('0x1')]},'type':{'type':Sequelize[_0x24d7('0x1')],'defaultValue':_0x24d7('0x2'),'comment':_0x24d7('0x3')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x24d7('0x4')]},'exitAt':{'type':Sequelize[_0x24d7('0x4')],'set':function(_0x806ff4){var _0x45741a=moment(_0x806ff4);var _0x4c5928=moment(this[_0x24d7('0x5')](_0x24d7('0x6')));var _0x43d430=_0x45741a['diff'](_0x4c5928,_0x24d7('0x7'));this[_0x24d7('0x8')](_0x24d7('0x9'),_0x806ff4);this[_0x24d7('0x8')](_0x24d7('0xa'),_0x43d430>=0x0?_0x43d430:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x24d7('0xb')},'data2':{'type':Sequelize[_0x24d7('0x1')],'comment':_0x24d7('0xc')},'data3':{'type':Sequelize[_0x24d7('0x1')],'comment':_0x24d7('0xd')},'data4':{'type':Sequelize['STRING'],'comment':_0x24d7('0xe')},'data5':{'type':Sequelize[_0x24d7('0x1')],'comment':_0x24d7('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x24d7('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 0f80a0d..c6a498e 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x55ca,0x126));var _0xa55c=function(_0x9adcd6,_0x36278b){_0x9adcd6=_0x9adcd6-0x0;var _0xdf8ff2=_0x55ca[_0x9adcd6];return _0xdf8ff2;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file +var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x55ca,0x126));var _0xa55c=function(_0x3bc04d,_0x28ab50){_0x3bc04d=_0x3bc04d-0x0;var _0x2a543b=_0x55ca[_0x3bc04d];return _0x2a543b;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 8325e35..837a527 100644 --- a/server/api/memberReport/memberReport.model.js +++ b/server/api/memberReport/memberReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb33=['exports','define','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','moment','rimraf','../../config/environment','./memberReport.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb33,0xf0));var _0x3eb3=function(_0xc0adaf,_0x3fc686){_0xc0adaf=_0xc0adaf-0x0;var _0x27538b=_0xeb33[_0xc0adaf];return _0x27538b;};'use strict';var _=require(_0x3eb3('0x0'));var util=require(_0x3eb3('0x1'));var logger=require(_0x3eb3('0x2'))('api');var moment=require(_0x3eb3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3eb3('0x4'));var config=require(_0x3eb3('0x5'));var attributes=require(_0x3eb3('0x6'));module[_0x3eb3('0x7')]=function(_0x5e7622,_0x2ef074){return _0x5e7622[_0x3eb3('0x8')]('MemberReport',attributes,{'tableName':_0x3eb3('0x9'),'paranoid':![],'indexes':[{'name':_0x3eb3('0xa'),'fields':[_0x3eb3('0xb'),_0x3eb3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9030=['define','report_member','membername','interface','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0x9030,0x121));var _0x0903=function(_0xd80019,_0x43dc8c){_0xd80019=_0xd80019-0x0;var _0x3b87d2=_0x9030[_0xd80019];return _0x3b87d2;};'use strict';var _=require(_0x0903('0x0'));var util=require(_0x0903('0x1'));var logger=require(_0x0903('0x2'))(_0x0903('0x3'));var moment=require('moment');var BPromise=require(_0x0903('0x4'));var rp=require(_0x0903('0x5'));var fs=require('fs');var path=require(_0x0903('0x6'));var rimraf=require(_0x0903('0x7'));var config=require(_0x0903('0x8'));var attributes=require(_0x0903('0x9'));module[_0x0903('0xa')]=function(_0x43d608,_0x439dff){return _0x43d608[_0x0903('0xb')]('MemberReport',attributes,{'tableName':_0x0903('0xc'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x0903('0xd'),_0x0903('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 988eacb..e27b413 100644 --- a/server/api/memberReport/memberReport.rpc.js +++ b/server/api/memberReport/memberReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48e3=['result','GetMemberReport','options','raw','where','limit','map','include','model','attributes','catch','CreateMemberReport','MemberReport','create','body','UpdateMemberReport','update','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x48e3,0xe9));var _0x348e=function(_0x42bb12,_0x5dc7d1){_0x42bb12=_0x42bb12-0x0;var _0x147a28=_0x48e3[_0x42bb12];return _0x147a28;};'use strict';var _=require(_0x348e('0x0'));var util=require(_0x348e('0x1'));var moment=require('moment');var BPromise=require(_0x348e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x348e('0x3'))['db'];var utils=require(_0x348e('0x4'));var logger=require(_0x348e('0x5'))(_0x348e('0x6'));var config=require('../../config/environment');var jayson=require(_0x348e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13b150,_0x5afaa1,_0x5919ce){return new BPromise(function(_0x33295b,_0x5d908f){return client[_0x348e('0x8')](_0x13b150,_0x5919ce)[_0x348e('0x9')](function(_0x16ec91){logger[_0x348e('0xa')](_0x348e('0xb'),_0x5afaa1,_0x348e('0xc'));logger[_0x348e('0xd')](_0x348e('0xe'),_0x5afaa1,_0x348e('0xc'),JSON[_0x348e('0xf')](_0x16ec91));if(_0x16ec91[_0x348e('0x10')]){if(_0x16ec91[_0x348e('0x10')][_0x348e('0x11')]===0x1f4){logger[_0x348e('0x10')]('MemberReport,\x20%s,\x20%s',_0x5afaa1,_0x16ec91[_0x348e('0x10')][_0x348e('0x12')]);return _0x5d908f(_0x16ec91[_0x348e('0x10')]['message']);}logger[_0x348e('0x10')](_0x348e('0xb'),_0x5afaa1,_0x16ec91[_0x348e('0x10')][_0x348e('0x12')]);return _0x33295b(_0x16ec91[_0x348e('0x10')]['message']);}else{logger['info'](_0x348e('0xb'),_0x5afaa1,_0x348e('0xc'));_0x33295b(_0x16ec91[_0x348e('0x13')][_0x348e('0x12')]);}})['catch'](function(_0x378442){logger['error'](_0x348e('0xb'),_0x5afaa1,_0x378442);_0x5d908f(_0x378442);});});}exports[_0x348e('0x14')]=function(_0x409ea8){var _0x57a6fa=this;return new Promise(function(_0x2326bc,_0x548e17){return db['MemberReport']['findAll']({'raw':_0x409ea8[_0x348e('0x15')]?_0x409ea8[_0x348e('0x15')][_0x348e('0x16')]===undefined?!![]:![]:!![],'where':_0x409ea8[_0x348e('0x15')]?_0x409ea8[_0x348e('0x15')][_0x348e('0x17')]||null:null,'attributes':_0x409ea8[_0x348e('0x15')]?_0x409ea8[_0x348e('0x15')]['attributes']||null:null,'limit':_0x409ea8['options']?_0x409ea8[_0x348e('0x15')][_0x348e('0x18')]||null:null,'include':_0x409ea8[_0x348e('0x15')]?_0x409ea8[_0x348e('0x15')]['include']?_[_0x348e('0x19')](_0x409ea8[_0x348e('0x15')][_0x348e('0x1a')],function(_0x4a5a84){return{'model':db[_0x4a5a84[_0x348e('0x1b')]],'as':_0x4a5a84['as'],'attributes':_0x4a5a84[_0x348e('0x1c')],'include':_0x4a5a84[_0x348e('0x1a')]?_['map'](_0x4a5a84[_0x348e('0x1a')],function(_0x845e7f){return{'model':db[_0x845e7f[_0x348e('0x1b')]],'as':_0x845e7f['as'],'attributes':_0x845e7f['attributes'],'include':_0x845e7f[_0x348e('0x1a')]?_[_0x348e('0x19')](_0x845e7f[_0x348e('0x1a')],function(_0x23bed7){return{'model':db[_0x23bed7['model']],'as':_0x23bed7['as'],'attributes':_0x23bed7[_0x348e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x348e('0x9')](function(_0x13eabb){logger[_0x348e('0xa')](_0x348e('0x14'),_0x409ea8);logger[_0x348e('0xd')](_0x348e('0x14'),_0x409ea8,JSON['stringify'](_0x13eabb));_0x2326bc(_0x13eabb);})[_0x348e('0x1d')](function(_0xcf7f99){logger['error'](_0x348e('0x14'),_0xcf7f99[_0x348e('0x12')],_0x409ea8);_0x548e17(_0x57a6fa['error'](0x1f4,_0xcf7f99[_0x348e('0x12')]));});});};exports[_0x348e('0x1e')]=function(_0x4b6dc4){var _0x408641=this;return new Promise(function(_0x369740,_0x2f909d){return db[_0x348e('0x1f')][_0x348e('0x20')](_0x4b6dc4[_0x348e('0x21')],{'raw':_0x4b6dc4[_0x348e('0x15')]?_0x4b6dc4['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x191ccd){logger[_0x348e('0xa')](_0x348e('0x1e'),_0x4b6dc4);logger['debug'](_0x348e('0x1e'),_0x4b6dc4,JSON['stringify'](_0x191ccd));_0x369740(_0x191ccd);})['catch'](function(_0x251b0e){logger[_0x348e('0x10')](_0x348e('0x1e'),_0x251b0e[_0x348e('0x12')],_0x4b6dc4);_0x2f909d(_0x408641['error'](0x1f4,_0x251b0e[_0x348e('0x12')]));});});};exports[_0x348e('0x22')]=function(_0x1742f9){var _0x990733=this;return new Promise(function(_0x445c30,_0x3a3b2c){return db[_0x348e('0x1f')][_0x348e('0x23')](_0x1742f9['body'],{'raw':_0x1742f9['options']?_0x1742f9[_0x348e('0x15')][_0x348e('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1742f9[_0x348e('0x15')]?_0x1742f9[_0x348e('0x15')][_0x348e('0x17')]||null:null,'attributes':_0x1742f9[_0x348e('0x15')]?_0x1742f9['options'][_0x348e('0x1c')]||null:null,'limit':_0x1742f9[_0x348e('0x15')]?_0x1742f9[_0x348e('0x15')]['limit']||null:null})[_0x348e('0x9')](function(_0xca0c30){logger[_0x348e('0xa')](_0x348e('0x22'),_0x1742f9);logger[_0x348e('0xd')](_0x348e('0x22'),_0x1742f9,JSON[_0x348e('0xf')](_0xca0c30));_0x445c30(_0xca0c30);})['catch'](function(_0x37a7e7){logger[_0x348e('0x10')]('UpdateMemberReport',_0x37a7e7[_0x348e('0x12')],_0x1742f9);_0x3a3b2c(_0x990733[_0x348e('0x10')](0x1f4,_0x37a7e7[_0x348e('0x12')]));});});}; \ No newline at end of file +var _0xb7b6=['where','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MemberReport,\x20%s,\x20%s','message','catch','GetMemberReport','MemberReport','findAll','options','raw','limit','include','map','model','attributes','info','CreateMemberReport','UpdateMemberReport','update','body'];(function(_0x121adf,_0x2bfc7a){var _0x3cf508=function(_0x33d257){while(--_0x33d257){_0x121adf['push'](_0x121adf['shift']());}};_0x3cf508(++_0x2bfc7a);}(_0xb7b6,0x15f));var _0x6b7b=function(_0x5be51b,_0x284a57){_0x5be51b=_0x5be51b-0x0;var _0x17ce3b=_0xb7b6[_0x5be51b];return _0x17ce3b;};'use strict';var _=require(_0x6b7b('0x0'));var util=require(_0x6b7b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b7b('0x2'));var fs=require('fs');var Redis=require(_0x6b7b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6b7b('0x4'));var logger=require(_0x6b7b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6b7b('0x6'));var client=jayson[_0x6b7b('0x7')][_0x6b7b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xff519e,_0x24359f,_0x483b9c){return new BPromise(function(_0x49a6c8,_0x2bb86d){return client[_0x6b7b('0x9')](_0xff519e,_0x483b9c)[_0x6b7b('0xa')](function(_0x115f2d){logger['info']('MemberReport,\x20%s,\x20%s',_0x24359f,'request\x20sent');logger[_0x6b7b('0xb')](_0x6b7b('0xc'),_0x24359f,_0x6b7b('0xd'),JSON[_0x6b7b('0xe')](_0x115f2d));if(_0x115f2d[_0x6b7b('0xf')]){if(_0x115f2d[_0x6b7b('0xf')]['code']===0x1f4){logger[_0x6b7b('0xf')](_0x6b7b('0x10'),_0x24359f,_0x115f2d['error'][_0x6b7b('0x11')]);return _0x2bb86d(_0x115f2d[_0x6b7b('0xf')]['message']);}logger[_0x6b7b('0xf')]('MemberReport,\x20%s,\x20%s',_0x24359f,_0x115f2d[_0x6b7b('0xf')][_0x6b7b('0x11')]);return _0x49a6c8(_0x115f2d[_0x6b7b('0xf')]['message']);}else{logger['info'](_0x6b7b('0x10'),_0x24359f,'request\x20sent');_0x49a6c8(_0x115f2d['result'][_0x6b7b('0x11')]);}})[_0x6b7b('0x12')](function(_0x4ef35b){logger[_0x6b7b('0xf')](_0x6b7b('0x10'),_0x24359f,_0x4ef35b);_0x2bb86d(_0x4ef35b);});});}exports[_0x6b7b('0x13')]=function(_0x41f48e){var _0x51b01f=this;return new Promise(function(_0x3d025c,_0x2036ec){return db[_0x6b7b('0x14')][_0x6b7b('0x15')]({'raw':_0x41f48e[_0x6b7b('0x16')]?_0x41f48e[_0x6b7b('0x16')][_0x6b7b('0x17')]===undefined?!![]:![]:!![],'where':_0x41f48e[_0x6b7b('0x16')]?_0x41f48e['options']['where']||null:null,'attributes':_0x41f48e[_0x6b7b('0x16')]?_0x41f48e['options']['attributes']||null:null,'limit':_0x41f48e['options']?_0x41f48e['options'][_0x6b7b('0x18')]||null:null,'include':_0x41f48e[_0x6b7b('0x16')]?_0x41f48e['options'][_0x6b7b('0x19')]?_[_0x6b7b('0x1a')](_0x41f48e['options'][_0x6b7b('0x19')],function(_0x1d3c69){return{'model':db[_0x1d3c69[_0x6b7b('0x1b')]],'as':_0x1d3c69['as'],'attributes':_0x1d3c69[_0x6b7b('0x1c')],'include':_0x1d3c69[_0x6b7b('0x19')]?_[_0x6b7b('0x1a')](_0x1d3c69[_0x6b7b('0x19')],function(_0x6edf){return{'model':db[_0x6edf[_0x6b7b('0x1b')]],'as':_0x6edf['as'],'attributes':_0x6edf[_0x6b7b('0x1c')],'include':_0x6edf[_0x6b7b('0x19')]?_[_0x6b7b('0x1a')](_0x6edf[_0x6b7b('0x19')],function(_0x2fc275){return{'model':db[_0x2fc275[_0x6b7b('0x1b')]],'as':_0x2fc275['as'],'attributes':_0x2fc275['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3120a3){logger[_0x6b7b('0x1d')](_0x6b7b('0x13'),_0x41f48e);logger['debug'](_0x6b7b('0x13'),_0x41f48e,JSON['stringify'](_0x3120a3));_0x3d025c(_0x3120a3);})[_0x6b7b('0x12')](function(_0x3117db){logger[_0x6b7b('0xf')](_0x6b7b('0x13'),_0x3117db['message'],_0x41f48e);_0x2036ec(_0x51b01f['error'](0x1f4,_0x3117db[_0x6b7b('0x11')]));});});};exports[_0x6b7b('0x1e')]=function(_0x3622e0){var _0x3ee2b6=this;return new Promise(function(_0x4f70e3,_0xef8922){return db[_0x6b7b('0x14')]['create'](_0x3622e0['body'],{'raw':_0x3622e0[_0x6b7b('0x16')]?_0x3622e0[_0x6b7b('0x16')][_0x6b7b('0x17')]===undefined?!![]:![]:!![]})[_0x6b7b('0xa')](function(_0x48e25b){logger['info'](_0x6b7b('0x1e'),_0x3622e0);logger[_0x6b7b('0xb')]('CreateMemberReport',_0x3622e0,JSON[_0x6b7b('0xe')](_0x48e25b));_0x4f70e3(_0x48e25b);})[_0x6b7b('0x12')](function(_0x2ae633){logger[_0x6b7b('0xf')](_0x6b7b('0x1e'),_0x2ae633['message'],_0x3622e0);_0xef8922(_0x3ee2b6[_0x6b7b('0xf')](0x1f4,_0x2ae633[_0x6b7b('0x11')]));});});};exports[_0x6b7b('0x1f')]=function(_0x5a1086){var _0x29e3e1=this;return new Promise(function(_0x1175dd,_0x5bb0f8){return db['MemberReport'][_0x6b7b('0x20')](_0x5a1086[_0x6b7b('0x21')],{'raw':_0x5a1086[_0x6b7b('0x16')]?_0x5a1086[_0x6b7b('0x16')][_0x6b7b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a1086['options']?_0x5a1086[_0x6b7b('0x16')][_0x6b7b('0x22')]||null:null,'attributes':_0x5a1086[_0x6b7b('0x16')]?_0x5a1086[_0x6b7b('0x16')][_0x6b7b('0x1c')]||null:null,'limit':_0x5a1086[_0x6b7b('0x16')]?_0x5a1086[_0x6b7b('0x16')][_0x6b7b('0x18')]||null:null})[_0x6b7b('0xa')](function(_0x49b593){logger[_0x6b7b('0x1d')](_0x6b7b('0x1f'),_0x5a1086);logger[_0x6b7b('0xb')](_0x6b7b('0x1f'),_0x5a1086,JSON[_0x6b7b('0xe')](_0x49b593));_0x1175dd(_0x49b593);})[_0x6b7b('0x12')](function(_0x28ba67){logger['error'](_0x6b7b('0x1f'),_0x28ba67[_0x6b7b('0x11')],_0x5a1086);_0x5bb0f8(_0x29e3e1[_0x6b7b('0xf')](0x1f4,_0x28ba67[_0x6b7b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 63f32e1..736ee5b 100644 --- a/server/api/migration/index.js +++ b/server/api/migration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x647c=['../../components/interaction/service','../../config/environment','get','index','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x35268e,_0x4acfd1){var _0x28ba11=function(_0x34f637){while(--_0x34f637){_0x35268e['push'](_0x35268e['shift']());}};_0x28ba11(++_0x4acfd1);}(_0x647c,0x1d3));var _0xc647=function(_0x31aaeb,_0x6194ef){_0x31aaeb=_0x31aaeb-0x0;var _0x2e97da=_0x647c[_0x31aaeb];return _0x2e97da;};'use strict';var multer=require(_0xc647('0x0'));var util=require('util');var path=require(_0xc647('0x1'));var timeout=require(_0xc647('0x2'));var express=require('express');var router=express[_0xc647('0x3')]();var fs_extra=require(_0xc647('0x4'));var auth=require(_0xc647('0x5'));var interaction=require(_0xc647('0x6'));var config=require(_0xc647('0x7'));var controller=require('./migration.controller');router[_0xc647('0x8')]('/',controller[_0xc647('0x9')]);module[_0xc647('0xa')]=router; \ No newline at end of file +var _0xdf70=['../../config/environment','./migration.controller','index','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x1def7a,_0x1d1b1d){var _0x403ea4=function(_0x590995){while(--_0x590995){_0x1def7a['push'](_0x1def7a['shift']());}};_0x403ea4(++_0x1d1b1d);}(_0xdf70,0x86));var _0x0df7=function(_0x45a09d,_0xec4b22){_0x45a09d=_0x45a09d-0x0;var _0x5a646f=_0xdf70[_0x45a09d];return _0x5a646f;};'use strict';var multer=require(_0x0df7('0x0'));var util=require(_0x0df7('0x1'));var path=require(_0x0df7('0x2'));var timeout=require('connect-timeout');var express=require(_0x0df7('0x3'));var router=express[_0x0df7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0df7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0df7('0x6'));var controller=require(_0x0df7('0x7'));router['get']('/',controller[_0x0df7('0x8')]);module[_0x0df7('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index d3b5ba6..2ca90ea 100644 --- a/server/api/migration/migration.attributes.js +++ b/server/api/migration/migration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d5d=['exports','STRING','version','sequelize'];(function(_0x567d04,_0x3d13a1){var _0x58ee79=function(_0x4c5548){while(--_0x4c5548){_0x567d04['push'](_0x567d04['shift']());}};_0x58ee79(++_0x3d13a1);}(_0x5d5d,0xf3));var _0xd5d5=function(_0x54a0b5,_0x5618d6){_0x54a0b5=_0x54a0b5-0x0;var _0x3d3eca=_0x5d5d[_0x54a0b5];return _0x3d3eca;};'use strict';var Sequelize=require(_0xd5d5('0x0'));module[_0xd5d5('0x1')]={'version':{'type':Sequelize[_0xd5d5('0x2')],'unique':_0xd5d5('0x3')}}; \ No newline at end of file +var _0xc0fa=['STRING','sequelize'];(function(_0x3628de,_0x4a491f){var _0x1a8a1e=function(_0xbe5041){while(--_0xbe5041){_0x3628de['push'](_0x3628de['shift']());}};_0x1a8a1e(++_0x4a491f);}(_0xc0fa,0x13d));var _0xac0f=function(_0x2fd1e5,_0x1932f3){_0x2fd1e5=_0x2fd1e5-0x0;var _0x1d1d22=_0xc0fa[_0x2fd1e5];return _0x1d1d22;};'use strict';var Sequelize=require(_0xac0f('0x0'));module['exports']={'version':{'type':Sequelize[_0xac0f('0x1')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index b75f934..7e39e7e 100644 --- a/server/api/migration/migration.controller.js +++ b/server/api/migration/migration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9849=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','end','error','stack','name','index','map'];(function(_0x1aab74,_0x38a57b){var _0x396af2=function(_0x1c2e0d){while(--_0x1c2e0d){_0x1aab74['push'](_0x1aab74['shift']());}};_0x396af2(++_0x38a57b);}(_0x9849,0x1a2));var _0x9984=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x9849[_0xd1d19a];return _0x52a79d;};'use strict';var emlformat=require(_0x9984('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9984('0x1'));var jsonpatch=require(_0x9984('0x2'));var rp=require(_0x9984('0x3'));var moment=require(_0x9984('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9984('0x5'));var path=require(_0x9984('0x6'));var sox=require(_0x9984('0x7'));var csv=require(_0x9984('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9984('0x9'));var _=require(_0x9984('0xa'));var squel=require(_0x9984('0xb'));var crypto=require(_0x9984('0xc'));var jsforce=require(_0x9984('0xd'));var deskjs=require(_0x9984('0xe'));var toCsv=require(_0x9984('0x8'));var querystring=require(_0x9984('0xf'));var Papa=require(_0x9984('0x10'));var Redis=require(_0x9984('0x11'));var authService=require(_0x9984('0x12'));var qs=require(_0x9984('0x13'));var as=require(_0x9984('0x14'));var hardwareService=require(_0x9984('0x15'));var logger=require(_0x9984('0x16'))(_0x9984('0x17'));var utils=require('../../config/utils');var config=require(_0x9984('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e9d04,_0x100695){_0x100695=_0x100695||0xcc;return function(_0x14adec){if(_0x14adec){return _0x2e9d04[_0x9984('0x19')](_0x100695);}return _0x2e9d04[_0x9984('0x1a')](_0x100695)['end']();};}function respondWithResult(_0x5edc5f,_0x299fac){_0x299fac=_0x299fac||0xc8;return function(_0x1dcfa4){if(_0x1dcfa4){return _0x5edc5f['status'](_0x299fac)[_0x9984('0x1b')](_0x1dcfa4);}};}function respondWithFilteredResult(_0x511c42,_0x308d27){return function(_0x11219a){if(_0x11219a){var _0x29e2d9=typeof _0x308d27[_0x9984('0x1c')]===_0x9984('0x1d')&&typeof _0x308d27['limit']===_0x9984('0x1d');var _0xeda05f=_0x11219a[_0x9984('0x1e')];var _0x247546=_0x29e2d9?0x0:_0x308d27[_0x9984('0x1c')];var _0xf9e5be=_0x29e2d9?_0x11219a[_0x9984('0x1e')]:_0x308d27['offset']+_0x308d27[_0x9984('0x1f')];var _0x565680;if(_0xf9e5be>=_0xeda05f){_0xf9e5be=_0xeda05f;_0x565680=0xc8;}else{_0x565680=0xce;}_0x511c42['status'](_0x565680);return _0x511c42[_0x9984('0x20')](_0x9984('0x21'),_0x247546+'-'+_0xf9e5be+'/'+_0xeda05f)[_0x9984('0x1b')](_0x11219a);}return null;};}function patchUpdates(_0x3f307f){return function(_0x2d81f9){try{jsonpatch[_0x9984('0x22')](_0x2d81f9,_0x3f307f,!![]);}catch(_0x3e4686){return BPromise['reject'](_0x3e4686);}return _0x2d81f9['save']();};}function saveUpdates(_0x352fdd,_0x36a213){return function(_0x19942f){if(_0x19942f){return _0x19942f[_0x9984('0x23')](_0x352fdd)[_0x9984('0x24')](function(_0x330fb4){return _0x330fb4;});}return null;};}function removeEntity(_0x37132a,_0x15812c){return function(_0x55bacb){if(_0x55bacb){return _0x55bacb[_0x9984('0x25')]()[_0x9984('0x24')](function(){_0x37132a[_0x9984('0x1a')](0xcc)[_0x9984('0x26')]();});}};}function handleEntityNotFound(_0x5a514b,_0x22e042){return function(_0x5b0552){if(!_0x5b0552){_0x5a514b[_0x9984('0x19')](0x194);}return _0x5b0552;};}function handleError(_0x579533,_0x257d3e){_0x257d3e=_0x257d3e||0x1f4;return function(_0x494da7){logger[_0x9984('0x27')](_0x494da7[_0x9984('0x28')]);if(_0x494da7[_0x9984('0x29')]){delete _0x494da7[_0x9984('0x29')];}_0x579533[_0x9984('0x1a')](_0x257d3e)['send'](_0x494da7);};}exports[_0x9984('0x2a')]=function(_0x154a4d,_0x495175){var _0x4f31ae={},_0x474236={},_0x38416c={'count':0x0,'rows':[]};var _0x19ffc4=_[_0x9984('0x2b')](db['Migration'][_0x9984('0x2c')],function(_0x34627c){return{'name':_0x34627c[_0x9984('0x2d')],'type':_0x34627c[_0x9984('0x2e')][_0x9984('0x2f')]};});_0x474236[_0x9984('0x30')]=_[_0x9984('0x2b')](_0x19ffc4,_0x9984('0x29'));_0x474236[_0x9984('0x31')]=_[_0x9984('0x32')](_0x154a4d[_0x9984('0x31')]);_0x474236[_0x9984('0x33')]=_[_0x9984('0x34')](_0x474236[_0x9984('0x30')],_0x474236[_0x9984('0x31')]);_0x4f31ae[_0x9984('0x35')]=_[_0x9984('0x34')](_0x474236['model'],qs[_0x9984('0x36')](_0x154a4d[_0x9984('0x31')][_0x9984('0x36')]));_0x4f31ae[_0x9984('0x35')]=_0x4f31ae[_0x9984('0x35')][_0x9984('0x37')]?_0x4f31ae[_0x9984('0x35')]:_0x474236[_0x9984('0x30')];if(!_0x154a4d[_0x9984('0x31')][_0x9984('0x38')]('nolimit')){_0x4f31ae[_0x9984('0x1f')]=qs[_0x9984('0x1f')](_0x154a4d[_0x9984('0x31')][_0x9984('0x1f')]);_0x4f31ae[_0x9984('0x1c')]=qs[_0x9984('0x1c')](_0x154a4d[_0x9984('0x31')][_0x9984('0x1c')]);}_0x4f31ae[_0x9984('0x39')]=qs[_0x9984('0x3a')](_0x154a4d['query'][_0x9984('0x3a')]);_0x4f31ae[_0x9984('0x3b')]=qs['filters'](_['pick'](_0x154a4d[_0x9984('0x31')],_0x474236['filters']),_0x19ffc4);if(_0x154a4d[_0x9984('0x31')][_0x9984('0x3c')]){_0x4f31ae[_0x9984('0x3b')]=_[_0x9984('0x3d')](_0x4f31ae[_0x9984('0x3b')],{'$or':_[_0x9984('0x2b')](_0x19ffc4,function(_0x248227){if(_0x248227[_0x9984('0x2e')]!==_0x9984('0x3e')){var _0xe6865f={};_0xe6865f[_0x248227['name']]={'$like':'%'+_0x154a4d['query'][_0x9984('0x3c')]+'%'};return _0xe6865f;}})});}_0x4f31ae=_['merge']({},_0x4f31ae,_0x154a4d['options']);var _0x39e293={'where':_0x4f31ae[_0x9984('0x3b')]};return db['Migration'][_0x9984('0x1e')](_0x39e293)[_0x9984('0x24')](function(_0x35916b){_0x38416c['count']=_0x35916b;if(_0x154a4d[_0x9984('0x31')]['includeAll']){_0x4f31ae[_0x9984('0x3f')]=[{'all':!![]}];}return db['Migration'][_0x9984('0x40')](_0x4f31ae);})['then'](function(_0x56145a){_0x38416c[_0x9984('0x41')]=_0x56145a;return _0x38416c;})['then'](respondWithFilteredResult(_0x495175,_0x4f31ae))['catch'](handleError(_0x495175,null));}; \ No newline at end of file +var _0x6c4e=['includeAll','include','findAll','catch','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','Migration','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6c4e,0x158));var _0xe6c4=function(_0x4f1cb2,_0x238923){_0x4f1cb2=_0x4f1cb2-0x0;var _0x423bad=_0x6c4e[_0x4f1cb2];return _0x423bad;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe6c4('0x0'));var jsonpatch=require(_0xe6c4('0x1'));var rp=require(_0xe6c4('0x2'));var moment=require(_0xe6c4('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe6c4('0x4'));var path=require(_0xe6c4('0x5'));var sox=require(_0xe6c4('0x6'));var csv=require(_0xe6c4('0x7'));var ejs=require(_0xe6c4('0x8'));var fs=require('fs');var fs_extra=require(_0xe6c4('0x9'));var _=require(_0xe6c4('0xa'));var squel=require(_0xe6c4('0xb'));var crypto=require('crypto');var jsforce=require(_0xe6c4('0xc'));var deskjs=require(_0xe6c4('0xd'));var toCsv=require(_0xe6c4('0x7'));var querystring=require(_0xe6c4('0xe'));var Papa=require(_0xe6c4('0xf'));var Redis=require(_0xe6c4('0x10'));var authService=require(_0xe6c4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe6c4('0x12'));var hardwareService=require(_0xe6c4('0x13'));var logger=require('../../config/logger')(_0xe6c4('0x14'));var utils=require(_0xe6c4('0x15'));var config=require(_0xe6c4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe6c4('0x17'))['db'];function respondWithStatusCode(_0x23e5a2,_0x490cf7){_0x490cf7=_0x490cf7||0xcc;return function(_0x38f657){if(_0x38f657){return _0x23e5a2[_0xe6c4('0x18')](_0x490cf7);}return _0x23e5a2[_0xe6c4('0x19')](_0x490cf7)['end']();};}function respondWithResult(_0x682e63,_0x1ae583){_0x1ae583=_0x1ae583||0xc8;return function(_0x5b5293){if(_0x5b5293){return _0x682e63[_0xe6c4('0x19')](_0x1ae583)[_0xe6c4('0x1a')](_0x5b5293);}};}function respondWithFilteredResult(_0x3609aa,_0x28202f){return function(_0xd8a68b){if(_0xd8a68b){var _0x197f75=typeof _0x28202f['offset']===_0xe6c4('0x1b')&&typeof _0x28202f[_0xe6c4('0x1c')]===_0xe6c4('0x1b');var _0x33b8b5=_0xd8a68b[_0xe6c4('0x1d')];var _0x5b781c=_0x197f75?0x0:_0x28202f[_0xe6c4('0x1e')];var _0x3bb505=_0x197f75?_0xd8a68b[_0xe6c4('0x1d')]:_0x28202f[_0xe6c4('0x1e')]+_0x28202f[_0xe6c4('0x1c')];var _0x5cef99;if(_0x3bb505>=_0x33b8b5){_0x3bb505=_0x33b8b5;_0x5cef99=0xc8;}else{_0x5cef99=0xce;}_0x3609aa[_0xe6c4('0x19')](_0x5cef99);return _0x3609aa[_0xe6c4('0x1f')](_0xe6c4('0x20'),_0x5b781c+'-'+_0x3bb505+'/'+_0x33b8b5)[_0xe6c4('0x1a')](_0xd8a68b);}return null;};}function patchUpdates(_0x5e5545){return function(_0xca5295){try{jsonpatch[_0xe6c4('0x21')](_0xca5295,_0x5e5545,!![]);}catch(_0x2ecc75){return BPromise[_0xe6c4('0x22')](_0x2ecc75);}return _0xca5295[_0xe6c4('0x23')]();};}function saveUpdates(_0x1259bf,_0x4a0135){return function(_0x1f8824){if(_0x1f8824){return _0x1f8824[_0xe6c4('0x24')](_0x1259bf)[_0xe6c4('0x25')](function(_0x4fe22e){return _0x4fe22e;});}return null;};}function removeEntity(_0x4102db,_0x378cb5){return function(_0x8dcfc5){if(_0x8dcfc5){return _0x8dcfc5['destroy']()[_0xe6c4('0x25')](function(){_0x4102db[_0xe6c4('0x19')](0xcc)[_0xe6c4('0x26')]();});}};}function handleEntityNotFound(_0x494d75,_0x344edb){return function(_0x3d6722){if(!_0x3d6722){_0x494d75['sendStatus'](0x194);}return _0x3d6722;};}function handleError(_0x5cfc64,_0x29e5d7){_0x29e5d7=_0x29e5d7||0x1f4;return function(_0x52e225){logger[_0xe6c4('0x27')](_0x52e225[_0xe6c4('0x28')]);if(_0x52e225['name']){delete _0x52e225[_0xe6c4('0x29')];}_0x5cfc64[_0xe6c4('0x19')](_0x29e5d7)[_0xe6c4('0x2a')](_0x52e225);};}exports[_0xe6c4('0x2b')]=function(_0x3f5e33,_0x26d84b){var _0x2468ec={},_0x25f056={},_0x523242={'count':0x0,'rows':[]};var _0x1b97b5=_['map'](db[_0xe6c4('0x2c')]['rawAttributes'],function(_0x102957){return{'name':_0x102957['fieldName'],'type':_0x102957[_0xe6c4('0x2d')][_0xe6c4('0x2e')]};});_0x25f056[_0xe6c4('0x2f')]=_[_0xe6c4('0x30')](_0x1b97b5,_0xe6c4('0x29'));_0x25f056['query']=_[_0xe6c4('0x31')](_0x3f5e33[_0xe6c4('0x32')]);_0x25f056[_0xe6c4('0x33')]=_[_0xe6c4('0x34')](_0x25f056[_0xe6c4('0x2f')],_0x25f056[_0xe6c4('0x32')]);_0x2468ec[_0xe6c4('0x35')]=_[_0xe6c4('0x34')](_0x25f056[_0xe6c4('0x2f')],qs[_0xe6c4('0x36')](_0x3f5e33[_0xe6c4('0x32')][_0xe6c4('0x36')]));_0x2468ec[_0xe6c4('0x35')]=_0x2468ec[_0xe6c4('0x35')][_0xe6c4('0x37')]?_0x2468ec[_0xe6c4('0x35')]:_0x25f056[_0xe6c4('0x2f')];if(!_0x3f5e33[_0xe6c4('0x32')][_0xe6c4('0x38')]('nolimit')){_0x2468ec[_0xe6c4('0x1c')]=qs[_0xe6c4('0x1c')](_0x3f5e33['query'][_0xe6c4('0x1c')]);_0x2468ec[_0xe6c4('0x1e')]=qs[_0xe6c4('0x1e')](_0x3f5e33[_0xe6c4('0x32')][_0xe6c4('0x1e')]);}_0x2468ec[_0xe6c4('0x39')]=qs[_0xe6c4('0x3a')](_0x3f5e33['query'][_0xe6c4('0x3a')]);_0x2468ec[_0xe6c4('0x3b')]=qs['filters'](_[_0xe6c4('0x3c')](_0x3f5e33[_0xe6c4('0x32')],_0x25f056['filters']),_0x1b97b5);if(_0x3f5e33['query'][_0xe6c4('0x3d')]){_0x2468ec[_0xe6c4('0x3b')]=_[_0xe6c4('0x3e')](_0x2468ec['where'],{'$or':_[_0xe6c4('0x30')](_0x1b97b5,function(_0x3eb078){if(_0x3eb078['type']!=='VIRTUAL'){var _0xf5ca2={};_0xf5ca2[_0x3eb078[_0xe6c4('0x29')]]={'$like':'%'+_0x3f5e33[_0xe6c4('0x32')][_0xe6c4('0x3d')]+'%'};return _0xf5ca2;}})});}_0x2468ec=_['merge']({},_0x2468ec,_0x3f5e33[_0xe6c4('0x3f')]);var _0x2c4cee={'where':_0x2468ec[_0xe6c4('0x3b')]};return db['Migration'][_0xe6c4('0x1d')](_0x2c4cee)['then'](function(_0x5e89c4){_0x523242['count']=_0x5e89c4;if(_0x3f5e33[_0xe6c4('0x32')][_0xe6c4('0x40')]){_0x2468ec[_0xe6c4('0x41')]=[{'all':!![]}];}return db['Migration'][_0xe6c4('0x42')](_0x2468ec);})[_0xe6c4('0x25')](function(_0x8660bc){_0x523242['rows']=_0x8660bc;return _0x523242;})['then'](respondWithFilteredResult(_0x26d84b,_0x2468ec))[_0xe6c4('0x43')](handleError(_0x26d84b,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index ea9ced0..57a9954 100644 --- a/server/api/migration/migration.model.js +++ b/server/api/migration/migration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4559=['migrations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','Migration'];(function(_0x5aac04,_0x584048){var _0x5280ae=function(_0x5ea3dd){while(--_0x5ea3dd){_0x5aac04['push'](_0x5aac04['shift']());}};_0x5280ae(++_0x584048);}(_0x4559,0xbc));var _0x9455=function(_0x56a061,_0x53fb1b){_0x56a061=_0x56a061-0x0;var _0x105fa0=_0x4559[_0x56a061];return _0x105fa0;};'use strict';var _=require('lodash');var util=require(_0x9455('0x0'));var logger=require(_0x9455('0x1'))(_0x9455('0x2'));var moment=require(_0x9455('0x3'));var BPromise=require(_0x9455('0x4'));var rp=require(_0x9455('0x5'));var fs=require('fs');var path=require(_0x9455('0x6'));var rimraf=require(_0x9455('0x7'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module['exports']=function(_0x24b776,_0x2569e1){return _0x24b776[_0x9455('0x8')](_0x9455('0x9'),attributes,{'tableName':_0x9455('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce08=['rimraf','../../config/environment','./migration.attributes','exports','Migration','migrations','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x510ecb,_0x1a4075){var _0x43b1e3=function(_0x41fcf3){while(--_0x41fcf3){_0x510ecb['push'](_0x510ecb['shift']());}};_0x43b1e3(++_0x1a4075);}(_0xce08,0xd6));var _0x8ce0=function(_0xe0f2ee,_0x4cb3fd){_0xe0f2ee=_0xe0f2ee-0x0;var _0x1d9ac5=_0xce08[_0xe0f2ee];return _0x1d9ac5;};'use strict';var _=require(_0x8ce0('0x0'));var util=require('util');var logger=require(_0x8ce0('0x1'))(_0x8ce0('0x2'));var moment=require(_0x8ce0('0x3'));var BPromise=require(_0x8ce0('0x4'));var rp=require(_0x8ce0('0x5'));var fs=require('fs');var path=require(_0x8ce0('0x6'));var rimraf=require(_0x8ce0('0x7'));var config=require(_0x8ce0('0x8'));var attributes=require(_0x8ce0('0x9'));module[_0x8ce0('0xa')]=function(_0x6767a1,_0x1cdc7d){return _0x6767a1['define'](_0x8ce0('0xb'),attributes,{'tableName':_0x8ce0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 392cf2f..7310809 100644 --- a/server/api/migration/migration.rpc.js +++ b/server/api/migration/migration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ce3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0x3d30a9,_0x4da997){var _0x3efb9a=function(_0x5b7579){while(--_0x5b7579){_0x3d30a9['push'](_0x3d30a9['shift']());}};_0x3efb9a(++_0x4da997);}(_0x8ce3,0xc3));var _0x38ce=function(_0x4e291f,_0x202c9){_0x4e291f=_0x4e291f-0x0;var _0x3b2d52=_0x8ce3[_0x4e291f];return _0x3b2d52;};'use strict';var _=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var moment=require('moment');var BPromise=require(_0x38ce('0x2'));var rs=require(_0x38ce('0x3'));var fs=require('fs');var Redis=require(_0x38ce('0x4'));var db=require(_0x38ce('0x5'))['db'];var utils=require(_0x38ce('0x6'));var logger=require(_0x38ce('0x7'))(_0x38ce('0x8'));var config=require(_0x38ce('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x38ce('0xa')][_0x38ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58074c,_0x262b13,_0xbe7332){return new BPromise(function(_0x3f8011,_0x482955){return client[_0x38ce('0xc')](_0x58074c,_0xbe7332)['then'](function(_0x725d27){logger['info'](_0x38ce('0xd'),_0x262b13,_0x38ce('0xe'));logger[_0x38ce('0xf')](_0x38ce('0x10'),_0x262b13,_0x38ce('0xe'),JSON[_0x38ce('0x11')](_0x725d27));if(_0x725d27[_0x38ce('0x12')]){if(_0x725d27[_0x38ce('0x12')][_0x38ce('0x13')]===0x1f4){logger[_0x38ce('0x12')](_0x38ce('0xd'),_0x262b13,_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);return _0x482955(_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);}logger[_0x38ce('0x12')]('Migration,\x20%s,\x20%s',_0x262b13,_0x725d27['error'][_0x38ce('0x14')]);return _0x3f8011(_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);}else{logger['info'](_0x38ce('0xd'),_0x262b13,'request\x20sent');_0x3f8011(_0x725d27[_0x38ce('0x15')][_0x38ce('0x14')]);}})['catch'](function(_0x5fc115){logger[_0x38ce('0x12')](_0x38ce('0xd'),_0x262b13,_0x5fc115);_0x482955(_0x5fc115);});});} \ No newline at end of file +var _0xf81a=['info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x240859,_0x19b70f){var _0x19aad1=function(_0x328e5b){while(--_0x328e5b){_0x240859['push'](_0x240859['shift']());}};_0x19aad1(++_0x19b70f);}(_0xf81a,0x16b));var _0xaf81=function(_0x5e8e91,_0x289fcb){_0x5e8e91=_0x5e8e91-0x0;var _0x27fcd9=_0xf81a[_0x5e8e91];return _0x27fcd9;};'use strict';var _=require(_0xaf81('0x0'));var util=require(_0xaf81('0x1'));var moment=require(_0xaf81('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf81('0x3'));var fs=require('fs');var Redis=require(_0xaf81('0x4'));var db=require(_0xaf81('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaf81('0x6'))(_0xaf81('0x7'));var config=require('../../config/environment');var jayson=require(_0xaf81('0x8'));var client=jayson[_0xaf81('0x9')][_0xaf81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cfd36,_0x268973,_0x365b31){return new BPromise(function(_0x4c3052,_0x3f0ac8){return client[_0xaf81('0xb')](_0x5cfd36,_0x365b31)[_0xaf81('0xc')](function(_0x3efaaf){logger['info'](_0xaf81('0xd'),_0x268973,_0xaf81('0xe'));logger[_0xaf81('0xf')](_0xaf81('0x10'),_0x268973,_0xaf81('0xe'),JSON[_0xaf81('0x11')](_0x3efaaf));if(_0x3efaaf['error']){if(_0x3efaaf['error'][_0xaf81('0x12')]===0x1f4){logger['error'](_0xaf81('0xd'),_0x268973,_0x3efaaf[_0xaf81('0x13')][_0xaf81('0x14')]);return _0x3f0ac8(_0x3efaaf[_0xaf81('0x13')]['message']);}logger[_0xaf81('0x13')](_0xaf81('0xd'),_0x268973,_0x3efaaf[_0xaf81('0x13')][_0xaf81('0x14')]);return _0x4c3052(_0x3efaaf[_0xaf81('0x13')]['message']);}else{logger[_0xaf81('0x15')](_0xaf81('0xd'),_0x268973,'request\x20sent');_0x4c3052(_0x3efaaf[_0xaf81('0x16')][_0xaf81('0x14')]);}})[_0xaf81('0x17')](function(_0x508df4){logger[_0xaf81('0x13')](_0xaf81('0xd'),_0x268973,_0x508df4);_0x3f0ac8(_0x508df4);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index a60ed50..9df8a97 100644 --- a/server/api/network/index.js +++ b/server/api/network/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc76e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./network.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer','util'];(function(_0x907688,_0x32632c){var _0x585ded=function(_0x4df53b){while(--_0x4df53b){_0x907688['push'](_0x907688['shift']());}};_0x585ded(++_0x32632c);}(_0xc76e,0x10c));var _0xec76=function(_0x31436d,_0x2bab95){_0x31436d=_0x31436d-0x0;var _0x401b4b=_0xc76e[_0x31436d];return _0x401b4b;};'use strict';var multer=require(_0xec76('0x0'));var util=require(_0xec76('0x1'));var path=require(_0xec76('0x2'));var timeout=require(_0xec76('0x3'));var express=require(_0xec76('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xec76('0x5'));var interaction=require(_0xec76('0x6'));var config=require('../../config/environment');var controller=require(_0xec76('0x7'));router['get']('/',auth[_0xec76('0x8')](),controller[_0xec76('0x9')]);router[_0xec76('0xa')](_0xec76('0xb'),auth[_0xec76('0x8')](),controller[_0xec76('0xc')]);router[_0xec76('0xd')]('/',auth[_0xec76('0x8')](),controller[_0xec76('0xe')]);router['put'](_0xec76('0xb'),auth[_0xec76('0x8')](),controller['update']);router[_0xec76('0xf')](_0xec76('0xb'),auth['isAuthenticated'](),controller[_0xec76('0x10')]);module[_0xec76('0x11')]=router; \ No newline at end of file +var _0x110e=['Router','fs-extra','../../components/auth/service','isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x2f50ab,_0x4dfe90){var _0x1e9b19=function(_0x4c4ab3){while(--_0x4c4ab3){_0x2f50ab['push'](_0x2f50ab['shift']());}};_0x1e9b19(++_0x4dfe90);}(_0x110e,0x68));var _0xe110=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x110e[_0x36884e];return _0x1cc367;};'use strict';var multer=require(_0xe110('0x0'));var util=require(_0xe110('0x1'));var path=require('path');var timeout=require(_0xe110('0x2'));var express=require(_0xe110('0x3'));var router=express[_0xe110('0x4')]();var fs_extra=require(_0xe110('0x5'));var auth=require(_0xe110('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./network.controller');router['get']('/',auth[_0xe110('0x7')](),controller['index']);router[_0xe110('0x8')](_0xe110('0x9'),auth[_0xe110('0x7')](),controller[_0xe110('0xa')]);router[_0xe110('0xb')]('/',auth[_0xe110('0x7')](),controller[_0xe110('0xc')]);router[_0xe110('0xd')](_0xe110('0x9'),auth['isAuthenticated'](),controller[_0xe110('0xe')]);router[_0xe110('0xf')]('/:id',auth[_0xe110('0x7')](),controller[_0xe110('0x10')]);module[_0xe110('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index da3a07e..c9410c1 100644 --- a/server/api/network/network.attributes.js +++ b/server/api/network/network.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc88a=['externip','turn','STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc88a,0x14f));var _0xac88=function(_0x43ddb9,_0x4fe5ae){_0x43ddb9=_0x43ddb9-0x0;var _0x5e17fd=_0xc88a[_0x43ddb9];return _0x5e17fd;};'use strict';var Sequelize=require('sequelize');module[_0xac88('0x0')]={'type':{'type':Sequelize['ENUM']('localnet',_0xac88('0x1'),'stun',_0xac88('0x2'))},'value':{'type':Sequelize[_0xac88('0x3')]},'username':{'type':Sequelize[_0xac88('0x3')]},'password':{'type':Sequelize[_0xac88('0x3')]}}; \ No newline at end of file +var _0xff85=['stun','turn','STRING','sequelize','exports','ENUM','externip'];(function(_0x11301e,_0x538902){var _0x31b463=function(_0xa69c78){while(--_0xa69c78){_0x11301e['push'](_0x11301e['shift']());}};_0x31b463(++_0x538902);}(_0xff85,0x9d));var _0x5ff8=function(_0x117cd5,_0x186753){_0x117cd5=_0x117cd5-0x0;var _0x20778f=_0xff85[_0x117cd5];return _0x20778f;};'use strict';var Sequelize=require(_0x5ff8('0x0'));module[_0x5ff8('0x1')]={'type':{'type':Sequelize[_0x5ff8('0x2')]('localnet',_0x5ff8('0x3'),_0x5ff8('0x4'),_0x5ff8('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x5ff8('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index b06df23..f7af4fd 100644 --- a/server/api/network/network.controller.js +++ b/server/api/network/network.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5933=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','body','toUpperCase','readFileSync','join','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','create','root','server/files/templates/network.ejs','toLowerCase','chan_sip.so','catch','STUN','/etc/asterisk/sip_xcally_%s.conf','destroy','format','util','path','ejs','lodash','api','../../config/environment','../../mysqldb','http','request','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','undefined','count','set','Content-Range','update','then','end','stack','name','send','index','map','Network','fieldName','type','key','model','query'];(function(_0x4e0be9,_0xe12d9c){var _0x117ccf=function(_0x5c45f3){while(--_0x5c45f3){_0x4e0be9['push'](_0x4e0be9['shift']());}};_0x117ccf(++_0xe12d9c);}(_0x5933,0x1d7));var _0x3593=function(_0x262428,_0x4698f0){_0x262428=_0x262428-0x0;var _0x30a3d7=_0x5933[_0x262428];return _0x30a3d7;};'use strict';var util=require(_0x3593('0x0'));var path=require(_0x3593('0x1'));var ejs=require(_0x3593('0x2'));var fs=require('fs');var _=require(_0x3593('0x3'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x3593('0x4'));var config=require(_0x3593('0x5'));var db=require(_0x3593('0x6'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x3593('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3ee2dd,_0x588d08,_0x2f8dc2,_0x2e3369){return new Promise(function(_0x4b6392,_0x1e36d0){var _0x9d2486=_0x2e3369||client;return _0x9d2486[_0x3593('0x8')](_0x3ee2dd,_0x2f8dc2)['then'](function(_0x5998b0){logger[_0x3593('0x9')](_0x3593('0xa'),_0x588d08,_0x3593('0xb'));logger['debug'](_0x3593('0xc'),_0x588d08,_0x3593('0xb'),JSON[_0x3593('0xd')](_0x5998b0));if(_0x5998b0['error']){if(_0x5998b0[_0x3593('0xe')][_0x3593('0xf')]===0x1f4){logger[_0x3593('0xe')](_0x3593('0xa'),_0x588d08,_0x5998b0[_0x3593('0xe')][_0x3593('0x10')]);return _0x1e36d0(_0x5998b0['error'][_0x3593('0x10')]);}logger[_0x3593('0xe')](_0x3593('0xa'),_0x588d08,_0x5998b0['error'][_0x3593('0x10')]);return _0x4b6392(_0x5998b0[_0x3593('0xe')][_0x3593('0x10')]);}else{logger[_0x3593('0x9')](_0x3593('0xa'),_0x588d08,'request\x20sent');_0x4b6392(_0x5998b0[_0x3593('0x11')][_0x3593('0x10')]);}})['catch'](function(_0x365f8e){logger[_0x3593('0xe')](_0x3593('0xa'),_0x588d08,_0x365f8e);_0x1e36d0(_0x365f8e);});});}function respondWithResult(_0x416dcc,_0x3cb095){_0x3cb095=_0x3cb095||0xc8;return function(_0x273e8d){if(_0x273e8d){return _0x416dcc[_0x3593('0x12')](_0x3cb095)[_0x3593('0x13')](_0x273e8d);}};}function respondWithFilteredResult(_0x400bc0,_0x5d665e){return function(_0x8cd3b4){if(_0x8cd3b4){var _0x505f01=typeof _0x5d665e[_0x3593('0x14')]==='undefined'&&typeof _0x5d665e['limit']===_0x3593('0x15');var _0x3671c4=_0x8cd3b4[_0x3593('0x16')];var _0x2dfbcc=_0x505f01?0x0:_0x5d665e['offset'];var _0x37a14e=_0x505f01?_0x8cd3b4['count']:_0x5d665e[_0x3593('0x14')]+_0x5d665e['limit'];var _0x4b7fe1;if(_0x37a14e>=_0x3671c4){_0x37a14e=_0x3671c4;_0x4b7fe1=0xc8;}else{_0x4b7fe1=0xce;}_0x400bc0[_0x3593('0x12')](_0x4b7fe1);return _0x400bc0[_0x3593('0x17')](_0x3593('0x18'),_0x2dfbcc+'-'+_0x37a14e+'/'+_0x3671c4)[_0x3593('0x13')](_0x8cd3b4);}return null;};}function saveUpdates(_0x2edff8){return function(_0x43ba03){if(_0x43ba03){return _0x43ba03[_0x3593('0x19')](_0x2edff8)[_0x3593('0x1a')](function(_0x1a1f2e){return _0x1a1f2e;});}return null;};}function removeEntity(_0x4f3179){return function(_0x368d1b){if(_0x368d1b){return _0x368d1b['destroy']()[_0x3593('0x1a')](function(){_0x4f3179['status'](0xcc)[_0x3593('0x1b')]();});}};}function handleEntityNotFound(_0x2f4e49){return function(_0x31724f){if(!_0x31724f){_0x2f4e49['sendStatus'](0x194);}return _0x31724f;};}function handleError(_0x11ad5c,_0x1d5dca){_0x1d5dca=_0x1d5dca||0x1f4;return function(_0x182b8d){logger['error'](_0x182b8d[_0x3593('0x1c')]);if(_0x182b8d['name']){delete _0x182b8d[_0x3593('0x1d')];}_0x11ad5c[_0x3593('0x12')](_0x1d5dca)[_0x3593('0x1e')](_0x182b8d);};}exports[_0x3593('0x1f')]=function(_0x5b0ba2,_0x397920){var _0x1d91fd={},_0x3d3ffe={},_0x4c0eaa={'count':0x0,'rows':[]};var _0x557a83=_[_0x3593('0x20')](db[_0x3593('0x21')]['rawAttributes'],function(_0x1ce8c9){return{'name':_0x1ce8c9[_0x3593('0x22')],'type':_0x1ce8c9[_0x3593('0x23')][_0x3593('0x24')]};});_0x3d3ffe[_0x3593('0x25')]=_['map'](_0x557a83,_0x3593('0x1d'));_0x3d3ffe[_0x3593('0x26')]=_[_0x3593('0x27')](_0x5b0ba2[_0x3593('0x26')]);_0x3d3ffe[_0x3593('0x28')]=_[_0x3593('0x29')](_0x3d3ffe[_0x3593('0x25')],_0x3d3ffe[_0x3593('0x26')]);_0x1d91fd['attributes']=_['intersection'](_0x3d3ffe[_0x3593('0x25')],qs[_0x3593('0x2a')](_0x5b0ba2[_0x3593('0x26')][_0x3593('0x2a')]));_0x1d91fd[_0x3593('0x2b')]=_0x1d91fd['attributes'][_0x3593('0x2c')]?_0x1d91fd[_0x3593('0x2b')]:_0x3d3ffe[_0x3593('0x25')];if(!_0x5b0ba2['query'][_0x3593('0x2d')](_0x3593('0x2e'))){_0x1d91fd[_0x3593('0x2f')]=qs[_0x3593('0x2f')](_0x5b0ba2['query'][_0x3593('0x2f')]);_0x1d91fd[_0x3593('0x14')]=qs[_0x3593('0x14')](_0x5b0ba2['query'][_0x3593('0x14')]);}_0x1d91fd[_0x3593('0x30')]=qs[_0x3593('0x31')](_0x5b0ba2[_0x3593('0x26')]['sort']);_0x1d91fd[_0x3593('0x32')]=qs[_0x3593('0x28')](_[_0x3593('0x33')](_0x5b0ba2[_0x3593('0x26')],_0x3d3ffe[_0x3593('0x28')]),_0x557a83);if(_0x5b0ba2[_0x3593('0x26')]['filter']){_0x1d91fd[_0x3593('0x32')]=_['merge'](_0x1d91fd[_0x3593('0x32')],{'$or':_[_0x3593('0x20')](_0x557a83,function(_0x390063){if(_0x390063[_0x3593('0x23')]!==_0x3593('0x34')){var _0x3d66ac={};_0x3d66ac[_0x390063[_0x3593('0x1d')]]={'$like':'%'+_0x5b0ba2['query'][_0x3593('0x35')]+'%'};return _0x3d66ac;}})});}_0x1d91fd=_['merge']({},_0x1d91fd,_0x5b0ba2[_0x3593('0x36')]);var _0x3186bd={'where':_0x1d91fd['where']};return db[_0x3593('0x21')][_0x3593('0x16')](_0x3186bd)[_0x3593('0x1a')](function(_0xd22bba){_0x4c0eaa[_0x3593('0x16')]=_0xd22bba;if(_0x5b0ba2[_0x3593('0x26')][_0x3593('0x37')]){_0x1d91fd[_0x3593('0x38')]=[{'all':!![]}];}return db[_0x3593('0x21')][_0x3593('0x39')](_0x1d91fd);})['then'](function(_0x319001){_0x4c0eaa[_0x3593('0x3a')]=_0x319001;return _0x4c0eaa;})['then'](respondWithFilteredResult(_0x397920,_0x1d91fd))['catch'](handleError(_0x397920,null));};exports['show']=function(_0x1c48bc,_0x52d632){var _0x7efcc={'raw':!![],'where':{'id':_0x1c48bc[_0x3593('0x3b')]['id']}},_0x2d7e6e={};_0x2d7e6e['model']=_['keys'](db[_0x3593('0x21')]['rawAttributes']);_0x2d7e6e[_0x3593('0x26')]=_['keys'](_0x1c48bc[_0x3593('0x26')]);_0x2d7e6e['filters']=_[_0x3593('0x29')](_0x2d7e6e[_0x3593('0x25')],_0x2d7e6e[_0x3593('0x26')]);_0x7efcc[_0x3593('0x2b')]=_[_0x3593('0x29')](_0x2d7e6e[_0x3593('0x25')],qs[_0x3593('0x2a')](_0x1c48bc['query'][_0x3593('0x2a')]));_0x7efcc['attributes']=_0x7efcc['attributes'][_0x3593('0x2c')]?_0x7efcc['attributes']:_0x2d7e6e[_0x3593('0x25')];if(_0x1c48bc[_0x3593('0x26')][_0x3593('0x37')]){_0x7efcc[_0x3593('0x38')]=[{'all':!![]}];}_0x7efcc=_['merge']({},_0x7efcc,_0x1c48bc[_0x3593('0x36')]);return db['Network'][_0x3593('0x3c')](_0x7efcc)[_0x3593('0x1a')](handleEntityNotFound(_0x52d632,null))[_0x3593('0x1a')](respondWithResult(_0x52d632,null))['catch'](handleError(_0x52d632,null));};exports['create']=function(_0x402f82,_0x328542){var _0x3bc199;return db[_0x3593('0x21')]['create'](_0x402f82[_0x3593('0x3d')],{'raw':!![]})[_0x3593('0x1a')](function(_0x1e9509){_0x3bc199=_0x1e9509;return db[_0x3593('0x21')][_0x3593('0x39')]({'where':{'type':_0x402f82['body'][_0x3593('0x23')]},'raw':!![]});})[_0x3593('0x1a')](function(_0x1b2581){if(_0x3bc199[_0x3593('0x23')][_0x3593('0x3e')]()=='STUN'){var _0x3fc711=fs[_0x3593('0x3f')](path[_0x3593('0x40')](config['root'],_0x3593('0x41')),'utf8');var _0x20b88c=ejs[_0x3593('0x42')](_0x3fc711,{'networks':_0x1b2581||[]});fs[_0x3593('0x43')](_0x3593('0x44'),_0x20b88c);return respondWithRpcPromise(_0x3593('0x45'),'create',{'module':_0x3593('0x46')});}else if(_0x3bc199[_0x3593('0x23')][_0x3593('0x3e')]()==_0x3593('0x47')){var _0x2dba47=fs['readFileSync'](path[_0x3593('0x40')](config['root'],_0x3593('0x48')),_0x3593('0x49'));var _0x21f3d0=ejs[_0x3593('0x42')](_0x2dba47,{'networks':_0x1b2581||[]});fs['writeFileSync'](_0x3593('0x4a'),_0x21f3d0);return respondWithRpcPromise('Reload',_0x3593('0x4b'),{'module':_0x3593('0x46')});}else{var _0x30b1c8=fs[_0x3593('0x3f')](path[_0x3593('0x40')](config[_0x3593('0x4c')],_0x3593('0x4d')),'utf8');var _0x5f4d8b=ejs[_0x3593('0x42')](_0x30b1c8,{'networks':_0x1b2581||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x402f82[_0x3593('0x3d')][_0x3593('0x23')][_0x3593('0x4e')]()),_0x5f4d8b);return respondWithRpcPromise('Reload',_0x3593('0x4b'),{'module':_0x3593('0x4f')});}})[_0x3593('0x1a')](function(){return _0x3bc199;})[_0x3593('0x1a')](respondWithResult(_0x328542,0xc9))[_0x3593('0x50')](handleError(_0x328542,null));};exports[_0x3593('0x19')]=function(_0x3f01fc,_0x13c279){var _0x1bb303;return db['Network'][_0x3593('0x3c')]({'where':{'id':_0x3f01fc[_0x3593('0x3b')]['id']}})[_0x3593('0x1a')](handleEntityNotFound(_0x13c279,null))[_0x3593('0x1a')](saveUpdates(_0x3f01fc['body'],null))[_0x3593('0x1a')](function(_0x3dc5e8){if(_0x3dc5e8){_0x1bb303=_0x3dc5e8;return db['Network'][_0x3593('0x39')]({'where':{'type':_0x1bb303['type']},'raw':!![]});}return null;})['then'](function(_0x4d6cd5){if(_0x1bb303[_0x3593('0x23')][_0x3593('0x3e')]()==_0x3593('0x51')){var _0x3fca68=fs[_0x3593('0x3f')](path['join'](config[_0x3593('0x4c')],_0x3593('0x41')),'utf8');var _0x48ed10=ejs[_0x3593('0x42')](_0x3fca68,{'networks':_0x4d6cd5||[]});fs[_0x3593('0x43')](_0x3593('0x44'),_0x48ed10);return respondWithRpcPromise(_0x3593('0x45'),_0x3593('0x19'),{'module':_0x3593('0x46')});}else if(_0x1bb303[_0x3593('0x23')][_0x3593('0x3e')]()==_0x3593('0x47')){var _0x53a329=fs[_0x3593('0x3f')](path[_0x3593('0x40')](config['root'],_0x3593('0x48')),'utf8');var _0x16d58d=ejs[_0x3593('0x42')](_0x53a329,{'networks':_0x4d6cd5||[]});fs[_0x3593('0x43')](_0x3593('0x4a'),_0x16d58d);return respondWithRpcPromise(_0x3593('0x45'),_0x3593('0x19'),{'module':_0x3593('0x46')});}else{var _0x33ac92=fs[_0x3593('0x3f')](path[_0x3593('0x40')](config[_0x3593('0x4c')],_0x3593('0x4d')),_0x3593('0x49'));var _0xffa986=ejs[_0x3593('0x42')](_0x33ac92,{'networks':_0x4d6cd5||[]});fs[_0x3593('0x43')](util['format'](_0x3593('0x52'),_0x3f01fc['body']['type']['toLowerCase']()),_0xffa986);return respondWithRpcPromise(_0x3593('0x45'),_0x3593('0x19'),{'module':_0x3593('0x4f')});}})[_0x3593('0x1a')](function(_0x2cbe9d){if(_0x2cbe9d){return _0x1bb303;}return null;})[_0x3593('0x1a')](respondWithResult(_0x13c279,null))[_0x3593('0x50')](handleError(_0x13c279,null));};exports['destroy']=function(_0x1a6b28,_0x1fdaf0){var _0x25458e;return db['Network'][_0x3593('0x3c')]({'where':{'id':_0x1a6b28[_0x3593('0x3b')]['id']}})[_0x3593('0x1a')](function(_0x422ad1){_0x25458e=_0x422ad1;return _0x422ad1;})[_0x3593('0x1a')](handleEntityNotFound(_0x1fdaf0,null))[_0x3593('0x1a')](removeEntity(_0x1fdaf0,null))[_0x3593('0x1a')](function(){if(_0x25458e){return db[_0x3593('0x21')][_0x3593('0x39')]({'where':{'type':_0x25458e[_0x3593('0x23')]},'raw':!![]});}})[_0x3593('0x1a')](function(_0x5957ae){if(_0x25458e[_0x3593('0x23')][_0x3593('0x3e')]()==_0x3593('0x51')){var _0x2764ff=fs['readFileSync'](path['join'](config[_0x3593('0x4c')],_0x3593('0x41')),_0x3593('0x49'));var _0x564abe=ejs[_0x3593('0x42')](_0x2764ff,{'networks':_0x5957ae||[]});fs[_0x3593('0x43')](_0x3593('0x44'),_0x564abe);return respondWithRpcPromise(_0x3593('0x45'),_0x3593('0x53'),{'module':_0x3593('0x46')});}else if(_0x25458e['type'][_0x3593('0x3e')]()==_0x3593('0x47')){var _0x2e068f=fs[_0x3593('0x3f')](path['join'](config['root'],'server/files/templates/turn_multiple.ejs'),_0x3593('0x49'));var _0x18ded6=ejs['render'](_0x2e068f,{'networks':_0x5957ae||[]});fs[_0x3593('0x43')](_0x3593('0x4a'),_0x18ded6);return respondWithRpcPromise(_0x3593('0x45'),_0x3593('0x53'),{'module':_0x3593('0x46')});}else{var _0x8c24e0=fs[_0x3593('0x3f')](path[_0x3593('0x40')](config['root'],_0x3593('0x4d')),_0x3593('0x49'));var _0x2fc032=ejs['render'](_0x8c24e0,{'networks':_0x5957ae||[]});fs[_0x3593('0x43')](util[_0x3593('0x54')](_0x3593('0x52'),_0x25458e['type'][_0x3593('0x4e')]()),_0x2fc032);return respondWithRpcPromise(_0x3593('0x45'),_0x3593('0x53'),{'module':_0x3593('0x4f')});}})[_0x3593('0x50')](handleError(_0x1fdaf0,null));}; \ No newline at end of file +var _0x3c7a=['server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','root','server/files/templates/turn_multiple.ejs','readFileSync','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','STUN','/etc/asterisk/turn_xcally.conf','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','status','json','offset','limit','undefined','count','set','update','destroy','end','name','send','index','map','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','Network','includeAll','include','catch','show','params','rawAttributes','find','create','findAll','body','toUpperCase','join'];(function(_0x4d674b,_0x176474){var _0x535a1f=function(_0xac7726){while(--_0xac7726){_0x4d674b['push'](_0x4d674b['shift']());}};_0x535a1f(++_0x176474);}(_0x3c7a,0x166));var _0xa3c7=function(_0x55205b,_0x5757d3){_0x55205b=_0x55205b-0x0;var _0x28d7c4=_0x3c7a[_0x55205b];return _0x28d7c4;};'use strict';var util=require(_0xa3c7('0x0'));var path=require(_0xa3c7('0x1'));var ejs=require(_0xa3c7('0x2'));var fs=require('fs');var _=require(_0xa3c7('0x3'));var qs=require(_0xa3c7('0x4'));var logger=require(_0xa3c7('0x5'))(_0xa3c7('0x6'));var config=require(_0xa3c7('0x7'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa3c7('0x8'));var client=jayson[_0xa3c7('0x9')][_0xa3c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bad3,_0x1fab66,_0x1f4b38,_0x1665f2){return new Promise(function(_0x596bbd,_0x11c121){var _0x314a41=_0x1665f2||client;return _0x314a41[_0xa3c7('0xb')](_0x25bad3,_0x1f4b38)[_0xa3c7('0xc')](function(_0x2b1229){logger['info'](_0xa3c7('0xd'),_0x1fab66,_0xa3c7('0xe'));logger[_0xa3c7('0xf')](_0xa3c7('0x10'),_0x1fab66,_0xa3c7('0xe'),JSON[_0xa3c7('0x11')](_0x2b1229));if(_0x2b1229[_0xa3c7('0x12')]){if(_0x2b1229['error'][_0xa3c7('0x13')]===0x1f4){logger[_0xa3c7('0x12')](_0xa3c7('0xd'),_0x1fab66,_0x2b1229[_0xa3c7('0x12')][_0xa3c7('0x14')]);return _0x11c121(_0x2b1229[_0xa3c7('0x12')]['message']);}logger[_0xa3c7('0x12')](_0xa3c7('0xd'),_0x1fab66,_0x2b1229['error']['message']);return _0x596bbd(_0x2b1229[_0xa3c7('0x12')][_0xa3c7('0x14')]);}else{logger[_0xa3c7('0x15')](_0xa3c7('0xd'),_0x1fab66,_0xa3c7('0xe'));_0x596bbd(_0x2b1229['result'][_0xa3c7('0x14')]);}})['catch'](function(_0x495f64){logger[_0xa3c7('0x12')]('Network,\x20%s,\x20%s',_0x1fab66,_0x495f64);_0x11c121(_0x495f64);});});}function respondWithResult(_0x2e3a4d,_0xf324bc){_0xf324bc=_0xf324bc||0xc8;return function(_0x139fb0){if(_0x139fb0){return _0x2e3a4d[_0xa3c7('0x16')](_0xf324bc)[_0xa3c7('0x17')](_0x139fb0);}};}function respondWithFilteredResult(_0x3f69fe,_0x3aa983){return function(_0x310ecb){if(_0x310ecb){var _0x29842b=typeof _0x3aa983[_0xa3c7('0x18')]==='undefined'&&typeof _0x3aa983[_0xa3c7('0x19')]===_0xa3c7('0x1a');var _0xd7f32d=_0x310ecb[_0xa3c7('0x1b')];var _0x3322ee=_0x29842b?0x0:_0x3aa983[_0xa3c7('0x18')];var _0x4c10bc=_0x29842b?_0x310ecb[_0xa3c7('0x1b')]:_0x3aa983[_0xa3c7('0x18')]+_0x3aa983[_0xa3c7('0x19')];var _0x40315a;if(_0x4c10bc>=_0xd7f32d){_0x4c10bc=_0xd7f32d;_0x40315a=0xc8;}else{_0x40315a=0xce;}_0x3f69fe['status'](_0x40315a);return _0x3f69fe[_0xa3c7('0x1c')]('Content-Range',_0x3322ee+'-'+_0x4c10bc+'/'+_0xd7f32d)[_0xa3c7('0x17')](_0x310ecb);}return null;};}function saveUpdates(_0x222584){return function(_0x1ab376){if(_0x1ab376){return _0x1ab376[_0xa3c7('0x1d')](_0x222584)[_0xa3c7('0xc')](function(_0x1e7b3e){return _0x1e7b3e;});}return null;};}function removeEntity(_0x57771e){return function(_0x3e4c40){if(_0x3e4c40){return _0x3e4c40[_0xa3c7('0x1e')]()[_0xa3c7('0xc')](function(){_0x57771e['status'](0xcc)[_0xa3c7('0x1f')]();});}};}function handleEntityNotFound(_0x55c5d0){return function(_0x577a37){if(!_0x577a37){_0x55c5d0['sendStatus'](0x194);}return _0x577a37;};}function handleError(_0xcc8110,_0x4b1386){_0x4b1386=_0x4b1386||0x1f4;return function(_0x496ed0){logger[_0xa3c7('0x12')](_0x496ed0['stack']);if(_0x496ed0['name']){delete _0x496ed0[_0xa3c7('0x20')];}_0xcc8110[_0xa3c7('0x16')](_0x4b1386)[_0xa3c7('0x21')](_0x496ed0);};}exports[_0xa3c7('0x22')]=function(_0x2177fb,_0x4b9752){var _0xa0cd6e={},_0x23c5fa={},_0x20adcd={'count':0x0,'rows':[]};var _0x1edcaf=_[_0xa3c7('0x23')](db['Network']['rawAttributes'],function(_0x4e33cd){return{'name':_0x4e33cd[_0xa3c7('0x24')],'type':_0x4e33cd[_0xa3c7('0x25')]['key']};});_0x23c5fa[_0xa3c7('0x26')]=_['map'](_0x1edcaf,_0xa3c7('0x20'));_0x23c5fa[_0xa3c7('0x27')]=_[_0xa3c7('0x28')](_0x2177fb[_0xa3c7('0x27')]);_0x23c5fa['filters']=_[_0xa3c7('0x29')](_0x23c5fa['model'],_0x23c5fa[_0xa3c7('0x27')]);_0xa0cd6e['attributes']=_['intersection'](_0x23c5fa[_0xa3c7('0x26')],qs[_0xa3c7('0x2a')](_0x2177fb[_0xa3c7('0x27')][_0xa3c7('0x2a')]));_0xa0cd6e[_0xa3c7('0x2b')]=_0xa0cd6e['attributes'][_0xa3c7('0x2c')]?_0xa0cd6e[_0xa3c7('0x2b')]:_0x23c5fa[_0xa3c7('0x26')];if(!_0x2177fb[_0xa3c7('0x27')][_0xa3c7('0x2d')](_0xa3c7('0x2e'))){_0xa0cd6e[_0xa3c7('0x19')]=qs[_0xa3c7('0x19')](_0x2177fb['query'][_0xa3c7('0x19')]);_0xa0cd6e[_0xa3c7('0x18')]=qs[_0xa3c7('0x18')](_0x2177fb['query']['offset']);}_0xa0cd6e[_0xa3c7('0x2f')]=qs[_0xa3c7('0x30')](_0x2177fb['query']['sort']);_0xa0cd6e[_0xa3c7('0x31')]=qs['filters'](_['pick'](_0x2177fb[_0xa3c7('0x27')],_0x23c5fa[_0xa3c7('0x32')]),_0x1edcaf);if(_0x2177fb[_0xa3c7('0x27')][_0xa3c7('0x33')]){_0xa0cd6e[_0xa3c7('0x31')]=_[_0xa3c7('0x34')](_0xa0cd6e[_0xa3c7('0x31')],{'$or':_[_0xa3c7('0x23')](_0x1edcaf,function(_0x3e151c){if(_0x3e151c['type']!=='VIRTUAL'){var _0x13ecc3={};_0x13ecc3[_0x3e151c[_0xa3c7('0x20')]]={'$like':'%'+_0x2177fb['query']['filter']+'%'};return _0x13ecc3;}})});}_0xa0cd6e=_[_0xa3c7('0x34')]({},_0xa0cd6e,_0x2177fb[_0xa3c7('0x35')]);var _0x4a77c4={'where':_0xa0cd6e[_0xa3c7('0x31')]};return db[_0xa3c7('0x36')]['count'](_0x4a77c4)[_0xa3c7('0xc')](function(_0x1c5c56){_0x20adcd[_0xa3c7('0x1b')]=_0x1c5c56;if(_0x2177fb[_0xa3c7('0x27')][_0xa3c7('0x37')]){_0xa0cd6e[_0xa3c7('0x38')]=[{'all':!![]}];}return db[_0xa3c7('0x36')]['findAll'](_0xa0cd6e);})[_0xa3c7('0xc')](function(_0x230bc2){_0x20adcd['rows']=_0x230bc2;return _0x20adcd;})[_0xa3c7('0xc')](respondWithFilteredResult(_0x4b9752,_0xa0cd6e))[_0xa3c7('0x39')](handleError(_0x4b9752,null));};exports[_0xa3c7('0x3a')]=function(_0x2089e8,_0x5698bf){var _0x1bdbc5={'raw':!![],'where':{'id':_0x2089e8[_0xa3c7('0x3b')]['id']}},_0x4cca40={};_0x4cca40['model']=_[_0xa3c7('0x28')](db[_0xa3c7('0x36')][_0xa3c7('0x3c')]);_0x4cca40[_0xa3c7('0x27')]=_[_0xa3c7('0x28')](_0x2089e8['query']);_0x4cca40[_0xa3c7('0x32')]=_[_0xa3c7('0x29')](_0x4cca40[_0xa3c7('0x26')],_0x4cca40[_0xa3c7('0x27')]);_0x1bdbc5[_0xa3c7('0x2b')]=_[_0xa3c7('0x29')](_0x4cca40['model'],qs[_0xa3c7('0x2a')](_0x2089e8[_0xa3c7('0x27')][_0xa3c7('0x2a')]));_0x1bdbc5[_0xa3c7('0x2b')]=_0x1bdbc5[_0xa3c7('0x2b')]['length']?_0x1bdbc5['attributes']:_0x4cca40[_0xa3c7('0x26')];if(_0x2089e8[_0xa3c7('0x27')]['includeAll']){_0x1bdbc5[_0xa3c7('0x38')]=[{'all':!![]}];}_0x1bdbc5=_[_0xa3c7('0x34')]({},_0x1bdbc5,_0x2089e8[_0xa3c7('0x35')]);return db[_0xa3c7('0x36')][_0xa3c7('0x3d')](_0x1bdbc5)[_0xa3c7('0xc')](handleEntityNotFound(_0x5698bf,null))[_0xa3c7('0xc')](respondWithResult(_0x5698bf,null))['catch'](handleError(_0x5698bf,null));};exports[_0xa3c7('0x3e')]=function(_0x1b4ff1,_0x5541b5){var _0x11b15a;return db[_0xa3c7('0x36')][_0xa3c7('0x3e')](_0x1b4ff1['body'],{'raw':!![]})[_0xa3c7('0xc')](function(_0x510db6){_0x11b15a=_0x510db6;return db[_0xa3c7('0x36')][_0xa3c7('0x3f')]({'where':{'type':_0x1b4ff1[_0xa3c7('0x40')][_0xa3c7('0x25')]},'raw':!![]});})[_0xa3c7('0xc')](function(_0x3c55fc){if(_0x11b15a[_0xa3c7('0x25')][_0xa3c7('0x41')]()=='STUN'){var _0x32b394=fs['readFileSync'](path[_0xa3c7('0x42')](config['root'],_0xa3c7('0x43')),_0xa3c7('0x44'));var _0x5183c2=ejs[_0xa3c7('0x45')](_0x32b394,{'networks':_0x3c55fc||[]});fs[_0xa3c7('0x46')](_0xa3c7('0x47'),_0x5183c2);return respondWithRpcPromise(_0xa3c7('0x48'),_0xa3c7('0x3e'),{'module':_0xa3c7('0x49')});}else if(_0x11b15a[_0xa3c7('0x25')][_0xa3c7('0x41')]()==_0xa3c7('0x4a')){var _0x5495c5=fs['readFileSync'](path[_0xa3c7('0x42')](config[_0xa3c7('0x4b')],_0xa3c7('0x4c')),_0xa3c7('0x44'));var _0x2ab81a=ejs[_0xa3c7('0x45')](_0x5495c5,{'networks':_0x3c55fc||[]});fs[_0xa3c7('0x46')]('/etc/asterisk/turn_xcally.conf',_0x2ab81a);return respondWithRpcPromise('Reload',_0xa3c7('0x3e'),{'module':_0xa3c7('0x49')});}else{var _0x173b63=fs[_0xa3c7('0x4d')](path[_0xa3c7('0x42')](config['root'],_0xa3c7('0x4e')),_0xa3c7('0x44'));var _0x589ff7=ejs[_0xa3c7('0x45')](_0x173b63,{'networks':_0x3c55fc||[]});fs['writeFileSync'](util[_0xa3c7('0x4f')](_0xa3c7('0x50'),_0x1b4ff1[_0xa3c7('0x40')][_0xa3c7('0x25')][_0xa3c7('0x51')]()),_0x589ff7);return respondWithRpcPromise('Reload',_0xa3c7('0x3e'),{'module':_0xa3c7('0x52')});}})[_0xa3c7('0xc')](function(){return _0x11b15a;})[_0xa3c7('0xc')](respondWithResult(_0x5541b5,0xc9))['catch'](handleError(_0x5541b5,null));};exports['update']=function(_0xb8ac65,_0x3fe1ef){var _0x5c27f4;return db['Network'][_0xa3c7('0x3d')]({'where':{'id':_0xb8ac65[_0xa3c7('0x3b')]['id']}})[_0xa3c7('0xc')](handleEntityNotFound(_0x3fe1ef,null))[_0xa3c7('0xc')](saveUpdates(_0xb8ac65[_0xa3c7('0x40')],null))[_0xa3c7('0xc')](function(_0x27f64c){if(_0x27f64c){_0x5c27f4=_0x27f64c;return db['Network'][_0xa3c7('0x3f')]({'where':{'type':_0x5c27f4['type']},'raw':!![]});}return null;})[_0xa3c7('0xc')](function(_0x46f56f){if(_0x5c27f4[_0xa3c7('0x25')]['toUpperCase']()==_0xa3c7('0x53')){var _0x14a777=fs[_0xa3c7('0x4d')](path[_0xa3c7('0x42')](config[_0xa3c7('0x4b')],'server/files/templates/stun_multiple.ejs'),_0xa3c7('0x44'));var _0x5035cb=ejs[_0xa3c7('0x45')](_0x14a777,{'networks':_0x46f56f||[]});fs[_0xa3c7('0x46')]('/etc/asterisk/stun_xcally.conf',_0x5035cb);return respondWithRpcPromise('Reload',_0xa3c7('0x1d'),{'module':_0xa3c7('0x49')});}else if(_0x5c27f4[_0xa3c7('0x25')][_0xa3c7('0x41')]()==_0xa3c7('0x4a')){var _0x12de01=fs[_0xa3c7('0x4d')](path[_0xa3c7('0x42')](config['root'],'server/files/templates/turn_multiple.ejs'),_0xa3c7('0x44'));var _0x1968de=ejs[_0xa3c7('0x45')](_0x12de01,{'networks':_0x46f56f||[]});fs['writeFileSync'](_0xa3c7('0x54'),_0x1968de);return respondWithRpcPromise(_0xa3c7('0x48'),'update',{'module':_0xa3c7('0x49')});}else{var _0x30be1d=fs[_0xa3c7('0x4d')](path[_0xa3c7('0x42')](config[_0xa3c7('0x4b')],_0xa3c7('0x4e')),_0xa3c7('0x44'));var _0x3bbaf7=ejs[_0xa3c7('0x45')](_0x30be1d,{'networks':_0x46f56f||[]});fs[_0xa3c7('0x46')](util[_0xa3c7('0x4f')]('/etc/asterisk/sip_xcally_%s.conf',_0xb8ac65[_0xa3c7('0x40')][_0xa3c7('0x25')]['toLowerCase']()),_0x3bbaf7);return respondWithRpcPromise(_0xa3c7('0x48'),_0xa3c7('0x1d'),{'module':_0xa3c7('0x52')});}})['then'](function(_0x3ca3f8){if(_0x3ca3f8){return _0x5c27f4;}return null;})[_0xa3c7('0xc')](respondWithResult(_0x3fe1ef,null))[_0xa3c7('0x39')](handleError(_0x3fe1ef,null));};exports[_0xa3c7('0x1e')]=function(_0x345954,_0x474f98){var _0x548558;return db[_0xa3c7('0x36')][_0xa3c7('0x3d')]({'where':{'id':_0x345954[_0xa3c7('0x3b')]['id']}})[_0xa3c7('0xc')](function(_0x4cb0bb){_0x548558=_0x4cb0bb;return _0x4cb0bb;})[_0xa3c7('0xc')](handleEntityNotFound(_0x474f98,null))['then'](removeEntity(_0x474f98,null))[_0xa3c7('0xc')](function(){if(_0x548558){return db[_0xa3c7('0x36')][_0xa3c7('0x3f')]({'where':{'type':_0x548558['type']},'raw':!![]});}})[_0xa3c7('0xc')](function(_0x418869){if(_0x548558[_0xa3c7('0x25')][_0xa3c7('0x41')]()==_0xa3c7('0x53')){var _0x5a9247=fs[_0xa3c7('0x4d')](path[_0xa3c7('0x42')](config['root'],_0xa3c7('0x43')),_0xa3c7('0x44'));var _0x180458=ejs[_0xa3c7('0x45')](_0x5a9247,{'networks':_0x418869||[]});fs[_0xa3c7('0x46')](_0xa3c7('0x47'),_0x180458);return respondWithRpcPromise('Reload',_0xa3c7('0x1e'),{'module':_0xa3c7('0x49')});}else if(_0x548558[_0xa3c7('0x25')][_0xa3c7('0x41')]()==_0xa3c7('0x4a')){var _0x3fcc74=fs[_0xa3c7('0x4d')](path[_0xa3c7('0x42')](config[_0xa3c7('0x4b')],'server/files/templates/turn_multiple.ejs'),_0xa3c7('0x44'));var _0x253a4a=ejs[_0xa3c7('0x45')](_0x3fcc74,{'networks':_0x418869||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x253a4a);return respondWithRpcPromise(_0xa3c7('0x48'),_0xa3c7('0x1e'),{'module':_0xa3c7('0x49')});}else{var _0x3e4136=fs[_0xa3c7('0x4d')](path[_0xa3c7('0x42')](config[_0xa3c7('0x4b')],_0xa3c7('0x4e')),'utf8');var _0x55b0a8=ejs[_0xa3c7('0x45')](_0x3e4136,{'networks':_0x418869||[]});fs[_0xa3c7('0x46')](util[_0xa3c7('0x4f')](_0xa3c7('0x50'),_0x548558[_0xa3c7('0x25')]['toLowerCase']()),_0x55b0a8);return respondWithRpcPromise(_0xa3c7('0x48'),_0xa3c7('0x1e'),{'module':_0xa3c7('0x52')});}})[_0xa3c7('0x39')](handleError(_0x474f98,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 61ea787..9db74f5 100644 --- a/server/api/network/network.model.js +++ b/server/api/network/network.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x180f=['../../config/environment','./network.attributes','network','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x21f8a8,_0x1d7071){var _0x21d3d5=function(_0x4ee4b4){while(--_0x4ee4b4){_0x21f8a8['push'](_0x21f8a8['shift']());}};_0x21d3d5(++_0x1d7071);}(_0x180f,0xf3));var _0xf180=function(_0x54c10d,_0x2f2251){_0x54c10d=_0x54c10d-0x0;var _0x1fa703=_0x180f[_0x54c10d];return _0x1fa703;};'use strict';var _=require(_0xf180('0x0'));var util=require(_0xf180('0x1'));var logger=require('../../config/logger')(_0xf180('0x2'));var moment=require(_0xf180('0x3'));var BPromise=require('bluebird');var rp=require(_0xf180('0x4'));var fs=require('fs');var path=require(_0xf180('0x5'));var rimraf=require(_0xf180('0x6'));var config=require(_0xf180('0x7'));var attributes=require(_0xf180('0x8'));module['exports']=function(_0x2ef675,_0x3c6552){return _0x2ef675['define']('Network',attributes,{'tableName':_0xf180('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b73=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','Network','network','util'];(function(_0x37bacd,_0x58d74a){var _0x56fbda=function(_0x2a9f39){while(--_0x2a9f39){_0x37bacd['push'](_0x37bacd['shift']());}};_0x56fbda(++_0x58d74a);}(_0x1b73,0x1d5));var _0x31b7=function(_0x2cf3e3,_0x5c309f){_0x2cf3e3=_0x2cf3e3-0x0;var _0x3f42ef=_0x1b73[_0x2cf3e3];return _0x3f42ef;};'use strict';var _=require('lodash');var util=require(_0x31b7('0x0'));var logger=require(_0x31b7('0x1'))(_0x31b7('0x2'));var moment=require(_0x31b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x31b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x31b7('0x5'));var config=require(_0x31b7('0x6'));var attributes=require('./network.attributes');module[_0x31b7('0x7')]=function(_0x3d058f,_0x15c31e){return _0x3d058f['define'](_0x31b7('0x8'),attributes,{'tableName':_0x31b7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index cea95f3..f49aa7b 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x3414c5,_0x52e9b3){_0x3414c5=_0x3414c5-0x0;var _0x1be7c0=_0x7a54[_0x3414c5];return _0x1be7c0;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x414741,_0x1bb451){var _0x24f5d6=function(_0x39e146){while(--_0x39e146){_0x414741['push'](_0x414741['shift']());}};_0x24f5d6(++_0x1bb451);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 1ea0387..5290f53 100644 --- a/server/api/openchannelAccount/index.js +++ b/server/api/openchannelAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x958a=['index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getInteractions','create','post','addDisposition','notify','addApplications','/:id/users','addAgents','send','put','update','/:id','delete','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0x958a,0x128));var _0xa958=function(_0x3a1194,_0x6a211f){_0x3a1194=_0x3a1194-0x0;var _0x173e3a=_0x958a[_0x3a1194];return _0x173e3a;};'use strict';var multer=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var path=require('path');var timeout=require(_0xa958('0x2'));var express=require(_0xa958('0x3'));var router=express[_0xa958('0x4')]();var fs_extra=require(_0xa958('0x5'));var auth=require(_0xa958('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa958('0x7'));var controller=require('./openchannelAccount.controller');router[_0xa958('0x8')]('/',auth[_0xa958('0x9')](),controller[_0xa958('0xa')]);router[_0xa958('0x8')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0xc')]);router['get']('/:id',auth[_0xa958('0x9')](),controller[_0xa958('0xd')]);router[_0xa958('0x8')](_0xa958('0xe'),auth[_0xa958('0x9')](),controller[_0xa958('0xf')]);router[_0xa958('0x8')](_0xa958('0x10'),auth[_0xa958('0x9')](),controller[_0xa958('0x11')]);router[_0xa958('0x8')](_0xa958('0x12'),auth[_0xa958('0x9')](),controller['getApplications']);router['get']('/:id/interactions',auth[_0xa958('0x9')](),controller[_0xa958('0x13')]);router[_0xa958('0x8')]('/:id/users',auth[_0xa958('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xa958('0x14')]);router[_0xa958('0x15')](_0xa958('0xe'),auth[_0xa958('0x9')](),controller[_0xa958('0x16')]);router[_0xa958('0x15')](_0xa958('0x10'),auth[_0xa958('0x9')](),controller['addAnswer']);router[_0xa958('0x15')]('/:id/notify',controller[_0xa958('0x17')]);router[_0xa958('0x15')]('/:id/applications',auth[_0xa958('0x9')](),controller[_0xa958('0x18')]);router[_0xa958('0x15')](_0xa958('0x19'),auth[_0xa958('0x9')](),controller[_0xa958('0x1a')]);router['post']('/:id/send',auth[_0xa958('0x9')](),controller[_0xa958('0x1b')]);router[_0xa958('0x1c')]('/:id',auth[_0xa958('0x9')](),controller[_0xa958('0x1d')]);router['delete'](_0xa958('0x1e'),auth[_0xa958('0x9')](),controller['destroy']);router['delete'](_0xa958('0xe'),auth[_0xa958('0x9')](),controller['removeDispositions']);router[_0xa958('0x1f')](_0xa958('0x10'),auth[_0xa958('0x9')](),controller[_0xa958('0x20')]);router[_0xa958('0x1f')](_0xa958('0x19'),auth['isAuthenticated'](),controller[_0xa958('0x21')]);module['exports']=router; \ No newline at end of file +var _0x236c=['notify','addAgents','/:id/send','send','put','/:id','delete','destroy','removeDispositions','/:id/canned_answers','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getInteractions','/:id/users','post','addDisposition','/:id/notify'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x236c,0x155));var _0xc236=function(_0x1b6e0f,_0x11fd9a){_0x1b6e0f=_0x1b6e0f-0x0;var _0x1d9fac=_0x236c[_0x1b6e0f];return _0x1d9fac;};'use strict';var multer=require(_0xc236('0x0'));var util=require('util');var path=require(_0xc236('0x1'));var timeout=require(_0xc236('0x2'));var express=require(_0xc236('0x3'));var router=express[_0xc236('0x4')]();var fs_extra=require(_0xc236('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc236('0x6'));var config=require(_0xc236('0x7'));var controller=require(_0xc236('0x8'));router[_0xc236('0x9')]('/',auth[_0xc236('0xa')](),controller[_0xc236('0xb')]);router['get'](_0xc236('0xc'),auth[_0xc236('0xa')](),controller['describe']);router['get']('/:id',auth[_0xc236('0xa')](),controller['show']);router[_0xc236('0x9')](_0xc236('0xd'),auth[_0xc236('0xa')](),controller[_0xc236('0xe')]);router[_0xc236('0x9')]('/:id/canned_answers',auth[_0xc236('0xa')](),controller[_0xc236('0xf')]);router['get'](_0xc236('0x10'),auth[_0xc236('0xa')](),controller['getApplications']);router[_0xc236('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc236('0x11')]);router[_0xc236('0x9')](_0xc236('0x12'),auth[_0xc236('0xa')](),controller['getAgents']);router[_0xc236('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc236('0x13')](_0xc236('0xd'),auth[_0xc236('0xa')](),controller[_0xc236('0x14')]);router[_0xc236('0x13')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0xc236('0x13')](_0xc236('0x15'),controller[_0xc236('0x16')]);router['post'](_0xc236('0x10'),auth['isAuthenticated'](),controller['addApplications']);router[_0xc236('0x13')](_0xc236('0x12'),auth[_0xc236('0xa')](),controller[_0xc236('0x17')]);router[_0xc236('0x13')](_0xc236('0x18'),auth[_0xc236('0xa')](),controller[_0xc236('0x19')]);router[_0xc236('0x1a')](_0xc236('0x1b'),auth[_0xc236('0xa')](),controller['update']);router[_0xc236('0x1c')](_0xc236('0x1b'),auth[_0xc236('0xa')](),controller[_0xc236('0x1d')]);router[_0xc236('0x1c')](_0xc236('0xd'),auth[_0xc236('0xa')](),controller[_0xc236('0x1e')]);router[_0xc236('0x1c')](_0xc236('0x1f'),auth[_0xc236('0xa')](),controller['removeAnswers']);router[_0xc236('0x1c')](_0xc236('0x12'),auth[_0xc236('0xa')](),controller[_0xc236('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index fbff2ce..ba896b1 100644 --- a/server/api/openchannelAccount/openchannelAccount.attributes.js +++ b/server/api/openchannelAccount/openchannelAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27b5=['generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x1474b5,_0x4e7e48){var _0x27b85c=function(_0x2ae70c){while(--_0x2ae70c){_0x1474b5['push'](_0x1474b5['shift']());}};_0x27b85c(++_0x4e7e48);}(_0x27b5,0x106));var _0x527b=function(_0x46f3f8,_0x12c74b){_0x46f3f8=_0x46f3f8-0x0;var _0xbc57cd=_0x27b5[_0x46f3f8];return _0xbc57cd;};'use strict';var Sequelize=require(_0x527b('0x0'));var rs=require(_0x527b('0x1'));module[_0x527b('0x2')]={'name':{'type':Sequelize[_0x527b('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x527b('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x527b('0x4')]();}},'replyUri':{'type':Sequelize[_0x527b('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x527b('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x527b('0x5')],'defaultValue':function(){return _0x527b('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x527b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x527b('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x527b('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x527b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x527b('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x527b('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x527b('0xa'),'set':function(_0xd24715){if(!_0xd24715)this[_0x527b('0xb')](_0x527b('0xc'),null);this['setDataValue'](_0x527b('0xd'),_0xd24715);}}}; \ No newline at end of file +var _0x2807=['randomstring','exports','STRING','name','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2807,0x197));var _0x7280=function(_0x3ea343,_0x168e7e){_0x3ea343=_0x3ea343-0x0;var _0x1ae8e5=_0x2807[_0x3ea343];return _0x1ae8e5;};'use strict';var Sequelize=require(_0x7280('0x0'));var rs=require(_0x7280('0x1'));module[_0x7280('0x2')]={'name':{'type':Sequelize[_0x7280('0x3')],'unique':_0x7280('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x7280('0x3')]},'token':{'type':Sequelize[_0x7280('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x7280('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x7280('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x7280('0x5');}},'notificationSound':{'type':Sequelize[_0x7280('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7280('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7280('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x7280('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7280('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7280('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7280('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7280('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x7280('0x6')],'defaultValue':![],'comment':_0x7280('0x8'),'set':function(_0xd17dd4){if(!_0xd17dd4)this['setDataValue'](_0x7280('0x9'),null);this[_0x7280('0xa')](_0x7280('0xb'),_0xd17dd4);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index be9a2c6..e482a1b 100644 --- a/server/api/openchannelAccount/openchannelAccount.controller.js +++ b/server/api/openchannelAccount/openchannelAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc838=['to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./openchannelAccount.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','result','catch','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','get','OpenchannelAccounts','UserProfileResource','end','send','index','Pause','map','OpenchannelAccount','rawAttributes','fieldName','key','model','name','filters','intersection','query','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','show','params','mandatoryDispositionPause','keys','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','OpenchannelAccountId','getDispositions','findOne','Disposition','hasOwnProperty','nolimit','rows','removeDispositions','CannedAnswer','removeAnswers','ids','notify','openchannel','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','firstName','messageId','interaction','created','autoclose','push','close','*,*,*,*','UserId','agent','queueId','OpenchannelQueue','unshift','queue','waitForTheAssignedQueue','Start','EventManager','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','tag','findAll','addAgents','omit','spread','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x22b5e1,_0x82aa40){var _0x317f1b=function(_0x49c8a8){while(--_0x49c8a8){_0x22b5e1['push'](_0x22b5e1['shift']());}};_0x317f1b(++_0x82aa40);}(_0xc838,0xbd));var _0x8c83=function(_0x56649f,_0xec00f0){_0x56649f=_0x56649f-0x0;var _0x20d203=_0xc838[_0x56649f];return _0x20d203;};'use strict';var emlformat=require(_0x8c83('0x0'));var rimraf=require(_0x8c83('0x1'));var zipdir=require(_0x8c83('0x2'));var jsonpatch=require(_0x8c83('0x3'));var rp=require(_0x8c83('0x4'));var moment=require(_0x8c83('0x5'));var BPromise=require(_0x8c83('0x6'));var Mustache=require(_0x8c83('0x7'));var util=require(_0x8c83('0x8'));var path=require(_0x8c83('0x9'));var sox=require(_0x8c83('0xa'));var csv=require(_0x8c83('0xb'));var ejs=require(_0x8c83('0xc'));var fs=require('fs');var fs_extra=require(_0x8c83('0xd'));var _=require(_0x8c83('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8c83('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8c83('0xb'));var querystring=require(_0x8c83('0x10'));var Papa=require(_0x8c83('0x11'));var Redis=require(_0x8c83('0x12'));var authService=require(_0x8c83('0x13'));var qs=require(_0x8c83('0x14'));var as=require(_0x8c83('0x15'));var hardwareService=require(_0x8c83('0x16'));var logger=require(_0x8c83('0x17'))(_0x8c83('0x18'));var utils=require(_0x8c83('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x8c83('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8c83('0x1b')](config['redis'],{'host':_0x8c83('0x1c'),'port':0x18eb});var socket=require(_0x8c83('0x1d'))(new Redis(config[_0x8c83('0x1e')]));require(_0x8c83('0x1f'))[_0x8c83('0x20')](socket);var jayson=require(_0x8c83('0x21'));var client=jayson[_0x8c83('0x22')][_0x8c83('0x23')]({'port':0x232c});var client9002=jayson[_0x8c83('0x22')][_0x8c83('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x573b7d,_0x2b4027,_0x3d82ca,_0x52d916){return new BPromise(function(_0x593c97,_0x40bc0d){var _0x4e3da8=_0x52d916||client;return _0x4e3da8[_0x8c83('0x24')](_0x573b7d,_0x3d82ca)['then'](function(_0x47d076){logger[_0x8c83('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x2b4027,_0x8c83('0x26'));logger[_0x8c83('0x27')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x2b4027,'request\x20sent',JSON[_0x8c83('0x28')](_0x47d076));if(_0x47d076[_0x8c83('0x29')]){if(_0x47d076['error'][_0x8c83('0x2a')]===0x1f4){logger[_0x8c83('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x2b4027,_0x47d076[_0x8c83('0x29')]['message']);return _0x40bc0d(_0x47d076[_0x8c83('0x29')][_0x8c83('0x2b')]);}logger[_0x8c83('0x29')](_0x8c83('0x2c'),_0x2b4027,_0x47d076[_0x8c83('0x29')]['message']);return _0x593c97(_0x47d076['error'][_0x8c83('0x2b')]);}else{logger[_0x8c83('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x2b4027,'request\x20sent');_0x593c97(_0x47d076[_0x8c83('0x2d')][_0x8c83('0x2b')]);}})[_0x8c83('0x2e')](function(_0x5034e1){logger[_0x8c83('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x2b4027,_0x5034e1);_0x40bc0d(_0x5034e1);});});}function respondWithStatusCode(_0x7fb65e,_0xc5d97d){_0xc5d97d=_0xc5d97d||0xcc;return function(_0x29b5d8){if(_0x29b5d8){return _0x7fb65e[_0x8c83('0x2f')](_0xc5d97d);}return _0x7fb65e[_0x8c83('0x30')](_0xc5d97d)['end']();};}function respondWithResult(_0x4d8ff8,_0x4d728e){_0x4d728e=_0x4d728e||0xc8;return function(_0x41d7be){if(_0x41d7be){return _0x4d8ff8[_0x8c83('0x30')](_0x4d728e)['json'](_0x41d7be);}};}function respondWithFilteredResult(_0x106f71,_0x12419a){return function(_0x142201){if(_0x142201){var _0x596ff0=typeof _0x12419a['offset']===_0x8c83('0x31')&&typeof _0x12419a['limit']===_0x8c83('0x31');var _0x126a65=_0x142201[_0x8c83('0x32')];var _0x178056=_0x596ff0?0x0:_0x12419a[_0x8c83('0x33')];var _0x748adb=_0x596ff0?_0x142201['count']:_0x12419a[_0x8c83('0x33')]+_0x12419a[_0x8c83('0x34')];var _0x4c9bca;if(_0x748adb>=_0x126a65){_0x748adb=_0x126a65;_0x4c9bca=0xc8;}else{_0x4c9bca=0xce;}_0x106f71[_0x8c83('0x30')](_0x4c9bca);return _0x106f71[_0x8c83('0x35')](_0x8c83('0x36'),_0x178056+'-'+_0x748adb+'/'+_0x126a65)[_0x8c83('0x37')](_0x142201);}return null;};}function patchUpdates(_0x2d24d8){return function(_0x1ab732){try{jsonpatch[_0x8c83('0x38')](_0x1ab732,_0x2d24d8,!![]);}catch(_0x5aec21){return BPromise[_0x8c83('0x39')](_0x5aec21);}return _0x1ab732[_0x8c83('0x3a')]();};}function saveUpdates(_0x400049,_0x5f416f){return function(_0xd0128){if(_0xd0128){return _0xd0128[_0x8c83('0x3b')](_0x400049)['then'](function(_0xc32a7d){return _0xc32a7d;});}return null;};}function removeEntity(_0x2a5223,_0xfd797d){return function(_0x30cb61){if(_0x30cb61){return _0x30cb61[_0x8c83('0x3c')]()[_0x8c83('0x3d')](function(){var _0xa7663=_0x30cb61[_0x8c83('0x3e')]({'plain':!![]});var _0x2b5b06=_0x8c83('0x3f');return db[_0x8c83('0x40')][_0x8c83('0x3c')]({'where':{'type':_0x2b5b06,'resourceId':_0xa7663['id']}})['then'](function(){return _0x30cb61;});})['then'](function(){_0x2a5223[_0x8c83('0x30')](0xcc)[_0x8c83('0x41')]();});}};}function handleEntityNotFound(_0x1a18fb,_0x154afc){return function(_0x467c6f){if(!_0x467c6f){_0x1a18fb['sendStatus'](0x194);}return _0x467c6f;};}function handleError(_0x571d5f,_0x3a200c){_0x3a200c=_0x3a200c||0x1f4;return function(_0x4347d6){logger[_0x8c83('0x29')](_0x4347d6['stack']);if(_0x4347d6['name']){delete _0x4347d6['name'];}_0x571d5f['status'](_0x3a200c)[_0x8c83('0x42')](_0x4347d6);};}exports[_0x8c83('0x43')]=function(_0xd63a66,_0xbc83f8){var _0x2bc261={'include':[{'model':db[_0x8c83('0x44')],'as':'mandatoryDispositionPause'}]},_0x1b0041={},_0x1e9867={'count':0x0,'rows':[]};var _0x5bfea5=_[_0x8c83('0x45')](db[_0x8c83('0x46')][_0x8c83('0x47')],function(_0x4908b0){return{'name':_0x4908b0[_0x8c83('0x48')],'type':_0x4908b0['type'][_0x8c83('0x49')]};});_0x1b0041[_0x8c83('0x4a')]=_['map'](_0x5bfea5,_0x8c83('0x4b'));_0x1b0041['query']=_['keys'](_0xd63a66['query']);_0x1b0041[_0x8c83('0x4c')]=_[_0x8c83('0x4d')](_0x1b0041[_0x8c83('0x4a')],_0x1b0041[_0x8c83('0x4e')]);_0x2bc261[_0x8c83('0x4f')]=_[_0x8c83('0x4d')](_0x1b0041[_0x8c83('0x4a')],qs['fields'](_0xd63a66['query'][_0x8c83('0x50')]));_0x2bc261[_0x8c83('0x4f')]=_0x2bc261[_0x8c83('0x4f')][_0x8c83('0x51')]?_0x2bc261[_0x8c83('0x4f')]:_0x1b0041[_0x8c83('0x4a')];if(!_0xd63a66[_0x8c83('0x4e')]['hasOwnProperty']('nolimit')){_0x2bc261[_0x8c83('0x34')]=qs[_0x8c83('0x34')](_0xd63a66[_0x8c83('0x4e')][_0x8c83('0x34')]);_0x2bc261[_0x8c83('0x33')]=qs[_0x8c83('0x33')](_0xd63a66[_0x8c83('0x4e')][_0x8c83('0x33')]);}_0x2bc261[_0x8c83('0x52')]=qs[_0x8c83('0x53')](_0xd63a66['query']['sort']);_0x2bc261[_0x8c83('0x54')]=qs[_0x8c83('0x4c')](_[_0x8c83('0x55')](_0xd63a66['query'],_0x1b0041[_0x8c83('0x4c')]),_0x5bfea5);if(_0xd63a66[_0x8c83('0x4e')][_0x8c83('0x56')]){_0x2bc261['where']=_['merge'](_0x2bc261['where'],{'$or':_[_0x8c83('0x45')](_0x5bfea5,function(_0x501eee){if(_0x501eee['type']!==_0x8c83('0x57')){var _0x4f2aea={};_0x4f2aea[_0x501eee[_0x8c83('0x4b')]]={'$like':'%'+_0xd63a66[_0x8c83('0x4e')][_0x8c83('0x56')]+'%'};return _0x4f2aea;}})});}_0x2bc261=_[_0x8c83('0x58')]({},_0x2bc261,_0xd63a66['options']);var _0x5d8f9f={'where':_0x2bc261[_0x8c83('0x54')]};return db[_0x8c83('0x46')][_0x8c83('0x32')](_0x5d8f9f)['then'](function(_0x2900c1){_0x1e9867['count']=_0x2900c1;if(_0xd63a66[_0x8c83('0x4e')][_0x8c83('0x59')]){_0x2bc261[_0x8c83('0x5a')]=[{'all':!![]}];}return db[_0x8c83('0x46')]['findAll'](_0x2bc261);})[_0x8c83('0x3d')](function(_0x5830b5){_0x1e9867['rows']=_0x5830b5;return _0x1e9867;})[_0x8c83('0x3d')](respondWithFilteredResult(_0xbc83f8,_0x2bc261))[_0x8c83('0x2e')](handleError(_0xbc83f8,null));};exports[_0x8c83('0x5b')]=function(_0x3cf250,_0x5548a2){var _0x1a9019={'raw':![],'where':{'id':_0x3cf250[_0x8c83('0x5c')]['id']},'include':[{'model':db[_0x8c83('0x44')],'as':_0x8c83('0x5d')}]},_0x3cb313={};_0x3cb313[_0x8c83('0x4a')]=_[_0x8c83('0x5e')](db[_0x8c83('0x46')]['rawAttributes']);_0x3cb313[_0x8c83('0x4e')]=_['keys'](_0x3cf250[_0x8c83('0x4e')]);_0x3cb313[_0x8c83('0x4c')]=_['intersection'](_0x3cb313['model'],_0x3cb313[_0x8c83('0x4e')]);_0x1a9019[_0x8c83('0x4f')]=_['intersection'](_0x3cb313['model'],qs[_0x8c83('0x50')](_0x3cf250[_0x8c83('0x4e')]['fields']));_0x1a9019[_0x8c83('0x4f')]=_0x1a9019[_0x8c83('0x4f')][_0x8c83('0x51')]?_0x1a9019['attributes']:_0x3cb313[_0x8c83('0x4a')];if(_0x3cf250[_0x8c83('0x4e')][_0x8c83('0x59')]){_0x1a9019['include']=[{'all':!![]}];}_0x1a9019=_[_0x8c83('0x58')]({},_0x1a9019,_0x3cf250[_0x8c83('0x5f')]);return db[_0x8c83('0x46')][_0x8c83('0x60')](_0x1a9019)[_0x8c83('0x3d')](handleEntityNotFound(_0x5548a2,null))[_0x8c83('0x3d')](respondWithResult(_0x5548a2,null))['catch'](handleError(_0x5548a2,null));};exports['create']=function(_0xafe4df,_0xaf3a1e){return db[_0x8c83('0x46')][_0x8c83('0x61')](_0xafe4df[_0x8c83('0x62')],{})[_0x8c83('0x3d')](function(_0x1cda02){var _0x403967=_0xafe4df[_0x8c83('0x63')]['get']({'plain':!![]});if(!_0x403967)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x403967[_0x8c83('0x64')]===_0x8c83('0x63')){var _0x30ff01=_0x1cda02[_0x8c83('0x3e')]({'plain':!![]});var _0x2e7286=_0x8c83('0x3f');return db[_0x8c83('0x65')][_0x8c83('0x60')]({'where':{'name':_0x2e7286,'userProfileId':_0x403967[_0x8c83('0x66')]},'raw':!![]})[_0x8c83('0x3d')](function(_0x5ab5c1){if(_0x5ab5c1&&_0x5ab5c1[_0x8c83('0x67')]===0x0){return db[_0x8c83('0x40')][_0x8c83('0x61')]({'name':_0x30ff01[_0x8c83('0x4b')],'resourceId':_0x30ff01['id'],'type':_0x5ab5c1[_0x8c83('0x4b')],'sectionId':_0x5ab5c1['id']},{})[_0x8c83('0x3d')](function(){return _0x1cda02;});}else{return _0x1cda02;}})[_0x8c83('0x2e')](function(_0x31130c){logger[_0x8c83('0x29')](_0x8c83('0x68'),_0x31130c);throw _0x31130c;});}return _0x1cda02;})['then'](respondWithResult(_0xaf3a1e,0xc9))[_0x8c83('0x2e')](handleError(_0xaf3a1e,null));};exports['update']=function(_0x2270a9,_0x11aa71){if(_0x2270a9[_0x8c83('0x62')]['id']){delete _0x2270a9['body']['id'];}return db[_0x8c83('0x46')][_0x8c83('0x60')]({'where':{'id':_0x2270a9['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x8c83('0x3d')](handleEntityNotFound(_0x11aa71,null))['then'](saveUpdates(_0x2270a9[_0x8c83('0x62')],null))[_0x8c83('0x3d')](respondWithResult(_0x11aa71,null))['catch'](handleError(_0x11aa71,null));};exports['destroy']=function(_0x521666,_0x4b15d9){return db[_0x8c83('0x46')]['find']({'where':{'id':_0x521666['params']['id']}})[_0x8c83('0x3d')](handleEntityNotFound(_0x4b15d9,null))[_0x8c83('0x3d')](removeEntity(_0x4b15d9,null))['catch'](handleError(_0x4b15d9,null));};exports[_0x8c83('0x69')]=function(_0x25ab22,_0x1ee5bf){return db['OpenchannelAccount'][_0x8c83('0x69')]()[_0x8c83('0x3d')](respondWithResult(_0x1ee5bf,null))[_0x8c83('0x2e')](handleError(_0x1ee5bf,null));};exports['addDisposition']=function(_0x20f67e,_0x4d6905,_0x39af25){if(_0x20f67e[_0x8c83('0x62')]['id']){delete _0x20f67e[_0x8c83('0x62')]['id'];}return db[_0x8c83('0x46')]['find']({'where':{'id':_0x20f67e['params']['id']}})[_0x8c83('0x3d')](handleEntityNotFound(_0x4d6905,null))[_0x8c83('0x3d')](function(_0x4169b9){if(_0x4169b9){_0x20f67e['body'][_0x8c83('0x6a')]=_0x4169b9['id'];return db['Disposition'][_0x8c83('0x61')](_0x20f67e[_0x8c83('0x62')]);}})[_0x8c83('0x3d')](respondWithResult(_0x4d6905,null))[_0x8c83('0x2e')](handleError(_0x4d6905,null));};exports[_0x8c83('0x6b')]=function(_0x495248,_0x23f737,_0x3e957b){var _0xed6125={'raw':![],'where':{}};var _0x50b9d0={};var _0x52ce5a={'count':0x0,'rows':[]};return db[_0x8c83('0x46')][_0x8c83('0x6c')]({'where':{'id':_0x495248['params']['id']}})[_0x8c83('0x3d')](handleEntityNotFound(_0x23f737,null))['then'](function(_0x36953b){if(_0x36953b){_0x50b9d0[_0x8c83('0x4a')]=_[_0x8c83('0x5e')](db[_0x8c83('0x6d')]['rawAttributes']);_0x50b9d0['query']=_[_0x8c83('0x5e')](_0x495248['query']);_0x50b9d0[_0x8c83('0x4c')]=_['intersection'](_0x50b9d0['model'],_0x50b9d0[_0x8c83('0x4e')]);_0xed6125[_0x8c83('0x4f')]=_['intersection'](_0x50b9d0['model'],qs[_0x8c83('0x50')](_0x495248[_0x8c83('0x4e')]['fields']));_0xed6125[_0x8c83('0x4f')]=_0xed6125[_0x8c83('0x4f')][_0x8c83('0x51')]?_0xed6125[_0x8c83('0x4f')]:_0x50b9d0[_0x8c83('0x4a')];if(!_0x495248[_0x8c83('0x4e')][_0x8c83('0x6e')](_0x8c83('0x6f'))){_0xed6125[_0x8c83('0x34')]=qs[_0x8c83('0x34')](_0x495248[_0x8c83('0x4e')][_0x8c83('0x34')]);_0xed6125[_0x8c83('0x33')]=qs[_0x8c83('0x33')](_0x495248[_0x8c83('0x4e')][_0x8c83('0x33')]);}_0xed6125[_0x8c83('0x52')]=qs['sort'](_0x495248[_0x8c83('0x4e')]['sort']);_0xed6125[_0x8c83('0x54')]=qs['filters'](_[_0x8c83('0x55')](_0x495248[_0x8c83('0x4e')],_0x50b9d0[_0x8c83('0x4c')]));_0xed6125[_0x8c83('0x54')][_0x8c83('0x6a')]=_0x36953b['id'];if(_0x495248[_0x8c83('0x4e')]['filter']){_0xed6125[_0x8c83('0x54')]=_[_0x8c83('0x58')](_0xed6125['where'],{'$or':_[_0x8c83('0x45')](_0xed6125[_0x8c83('0x4f')],function(_0x4a8ab1){var _0x10fe62={};_0x10fe62[_0x4a8ab1]={'$like':'%'+_0x495248[_0x8c83('0x4e')][_0x8c83('0x56')]+'%'};return _0x10fe62;})});}_0xed6125=_[_0x8c83('0x58')]({},_0xed6125,_0x495248[_0x8c83('0x5f')]);return db[_0x8c83('0x6d')][_0x8c83('0x32')]({'where':_0xed6125['where']})[_0x8c83('0x3d')](function(_0x33b38d){_0x52ce5a[_0x8c83('0x32')]=_0x33b38d;if(_0x495248[_0x8c83('0x4e')][_0x8c83('0x59')]){_0xed6125[_0x8c83('0x5a')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0xed6125);})[_0x8c83('0x3d')](function(_0xee91c7){_0x52ce5a[_0x8c83('0x70')]=_0xee91c7;return _0x52ce5a;});}})[_0x8c83('0x3d')](respondWithFilteredResult(_0x23f737,_0xed6125))['catch'](handleError(_0x23f737,null));};exports[_0x8c83('0x71')]=function(_0x581205,_0x54bc6d,_0x90929){return db[_0x8c83('0x46')][_0x8c83('0x60')]({'where':{'id':_0x581205[_0x8c83('0x5c')]['id']}})[_0x8c83('0x3d')](handleEntityNotFound(_0x54bc6d,null))['then'](function(_0xf0e944){if(_0xf0e944){return _0xf0e944[_0x8c83('0x71')](_0x581205['query']['ids']);}})[_0x8c83('0x3d')](respondWithStatusCode(_0x54bc6d,null))[_0x8c83('0x2e')](handleError(_0x54bc6d,null));};exports['addAnswer']=function(_0x2d0647,_0x47952f,_0xa8daa0){if(_0x2d0647[_0x8c83('0x62')]['id']){delete _0x2d0647['body']['id'];}return db[_0x8c83('0x46')][_0x8c83('0x60')]({'where':{'id':_0x2d0647['params']['id']}})[_0x8c83('0x3d')](handleEntityNotFound(_0x47952f,null))[_0x8c83('0x3d')](function(_0x114126){if(_0x114126){_0x2d0647[_0x8c83('0x62')][_0x8c83('0x6a')]=_0x114126['id'];return db['CannedAnswer']['create'](_0x2d0647[_0x8c83('0x62')]);}})[_0x8c83('0x3d')](respondWithResult(_0x47952f,null))[_0x8c83('0x2e')](handleError(_0x47952f,null));};exports['getAnswers']=function(_0x539895,_0xcceb39,_0xf036e0){var _0x199741={'raw':![],'where':{}};var _0x32302f={};var _0x5a56b5={'count':0x0,'rows':[]};return db[_0x8c83('0x46')][_0x8c83('0x6c')]({'where':{'id':_0x539895[_0x8c83('0x5c')]['id']}})[_0x8c83('0x3d')](handleEntityNotFound(_0xcceb39,null))[_0x8c83('0x3d')](function(_0x4ceb71){if(_0x4ceb71){_0x32302f['model']=_[_0x8c83('0x5e')](db[_0x8c83('0x72')][_0x8c83('0x47')]);_0x32302f[_0x8c83('0x4e')]=_[_0x8c83('0x5e')](_0x539895[_0x8c83('0x4e')]);_0x32302f[_0x8c83('0x4c')]=_[_0x8c83('0x4d')](_0x32302f['model'],_0x32302f[_0x8c83('0x4e')]);_0x199741['attributes']=_[_0x8c83('0x4d')](_0x32302f[_0x8c83('0x4a')],qs[_0x8c83('0x50')](_0x539895[_0x8c83('0x4e')][_0x8c83('0x50')]));_0x199741[_0x8c83('0x4f')]=_0x199741[_0x8c83('0x4f')][_0x8c83('0x51')]?_0x199741['attributes']:_0x32302f[_0x8c83('0x4a')];if(!_0x539895[_0x8c83('0x4e')][_0x8c83('0x6e')](_0x8c83('0x6f'))){_0x199741[_0x8c83('0x34')]=qs[_0x8c83('0x34')](_0x539895[_0x8c83('0x4e')][_0x8c83('0x34')]);_0x199741[_0x8c83('0x33')]=qs[_0x8c83('0x33')](_0x539895[_0x8c83('0x4e')][_0x8c83('0x33')]);}_0x199741[_0x8c83('0x52')]=qs['sort'](_0x539895[_0x8c83('0x4e')][_0x8c83('0x53')]);_0x199741[_0x8c83('0x54')]=qs[_0x8c83('0x4c')](_[_0x8c83('0x55')](_0x539895[_0x8c83('0x4e')],_0x32302f[_0x8c83('0x4c')]));_0x199741[_0x8c83('0x54')][_0x8c83('0x6a')]=_0x4ceb71['id'];if(_0x539895['query']['filter']){_0x199741[_0x8c83('0x54')]=_['merge'](_0x199741[_0x8c83('0x54')],{'$or':_[_0x8c83('0x45')](_0x199741[_0x8c83('0x4f')],function(_0x4614e3){var _0x101bfb={};_0x101bfb[_0x4614e3]={'$like':'%'+_0x539895[_0x8c83('0x4e')][_0x8c83('0x56')]+'%'};return _0x101bfb;})});}_0x199741=_['merge']({},_0x199741,_0x539895[_0x8c83('0x5f')]);return db[_0x8c83('0x72')]['count']({'where':_0x199741[_0x8c83('0x54')]})[_0x8c83('0x3d')](function(_0x2d58b7){_0x5a56b5[_0x8c83('0x32')]=_0x2d58b7;if(_0x539895[_0x8c83('0x4e')]['includeAll']){_0x199741[_0x8c83('0x5a')]=[{'all':!![]}];}return db[_0x8c83('0x72')]['findAll'](_0x199741);})['then'](function(_0x39d0c7){_0x5a56b5[_0x8c83('0x70')]=_0x39d0c7;return _0x5a56b5;});}})['then'](respondWithFilteredResult(_0xcceb39,_0x199741))['catch'](handleError(_0xcceb39,null));};exports[_0x8c83('0x73')]=function(_0x3ddbfe,_0x51bd82,_0x55be5b){return db['OpenchannelAccount'][_0x8c83('0x60')]({'where':{'id':_0x3ddbfe[_0x8c83('0x5c')]['id']}})[_0x8c83('0x3d')](handleEntityNotFound(_0x51bd82,null))['then'](function(_0x3348f9){if(_0x3348f9){return _0x3348f9['removeAnswers'](_0x3ddbfe[_0x8c83('0x4e')][_0x8c83('0x74')]);}})[_0x8c83('0x3d')](respondWithStatusCode(_0x51bd82,null))[_0x8c83('0x2e')](handleError(_0x51bd82,null));};exports[_0x8c83('0x75')]=function(_0x138b90,_0x59ea86,_0x4e87b4){var _0x368f80={'body':_0x138b90[_0x8c83('0x62')],'channel':_0x8c83('0x76')};var _0x131ca1=[];var _0x1b378a=[];var _0xf7375b={};var _0x5078e3=![];return db['CmContact'][_0x8c83('0x69')]()[_0x8c83('0x3d')](function(_0x176be4){if(!_0x176be4){throw new db['Sequelize'][(_0x8c83('0x77'))](_0x8c83('0x78'));}_0x131ca1=_[_0x8c83('0x79')](_[_0x8c83('0x5e')](_0x176be4),[_0x8c83('0x7a'),_0x8c83('0x7b')]);_0x1b378a=_[_0x8c83('0x79')](_[_0x8c83('0x5e')](_0x176be4),['createdAt','updatedAt','CompanyId',_0x8c83('0x7c')]);if(_0x138b90['body']['id']){delete _0x138b90[_0x8c83('0x62')]['id'];}if(_[_0x8c83('0x7d')](_0x138b90[_0x8c83('0x62')][_0x8c83('0x7e')])){throw new db[(_0x8c83('0x7f'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x138b90[_0x8c83('0x62')][_0x8c83('0x62')])||_0x138b90['body'][_0x8c83('0x62')]===''){throw new db['Sequelize'][(_0x8c83('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x138b90[_0x8c83('0x62')][_0x8c83('0x80')])){throw new db[(_0x8c83('0x7f'))][(_0x8c83('0x77'))](_0x8c83('0x81')+_0x1b378a);}if(!_['includes'](_0x1b378a,_0x138b90[_0x8c83('0x62')][_0x8c83('0x80')])){throw new db[(_0x8c83('0x7f'))][(_0x8c83('0x77'))](_0x8c83('0x82')+_0x1b378a);}_0xf7375b[_0x138b90[_0x8c83('0x62')][_0x8c83('0x80')]]=_0x138b90[_0x8c83('0x62')][_0x8c83('0x7e')];})['then'](function(){return db[_0x8c83('0x46')][_0x8c83('0x60')]({'where':{'id':_0x138b90[_0x8c83('0x5c')]['id']},'include':[{'model':db[_0x8c83('0x83')],'as':_0x8c83('0x84'),'include':[{'model':db[_0x8c83('0x85')],'as':_0x8c83('0x86'),'where':_0xf7375b,'limit':0x1,'order':[[_0x8c83('0x7b'),_0x8c83('0x87')]]}]},{'model':db[_0x8c83('0x88')],'as':_0x8c83('0x89')}]});})[_0x8c83('0x3d')](handleEntityNotFound(_0x59ea86,null))[_0x8c83('0x3d')](function(_0xec1da0){if(_0xec1da0&&_0xec1da0[_0x8c83('0x84')]){_0x368f80[_0x8c83('0x8a')]=_0xec1da0;_0x368f80[_0x8c83('0x8b')]=_0xec1da0['Applications'];_0x368f80[_0x8c83('0x8c')]=_0xec1da0['List'];_0x368f80[_0x8c83('0x8b')]=_[_0x8c83('0x8d')](_0x368f80[_0x8c83('0x8b')],[_0x8c83('0x8e')],[_0x8c83('0x8f')]);if(_0x368f80['account']['Applications']){delete _0x368f80['account']['Applications'];}if(_0x368f80[_0x8c83('0x8a')][_0x8c83('0x84')]&&_0x368f80[_0x8c83('0x8a')][_0x8c83('0x84')][_0x8c83('0x86')][_0x8c83('0x51')]){return _0x368f80[_0x8c83('0x8a')][_0x8c83('0x84')][_0x8c83('0x86')][0x0];}var _0x4e352b=_[_0x8c83('0x1b')](_0x138b90['body'],{'firstName':_0x138b90[_0x8c83('0x62')][_0x8c83('0x7e')],'ListId':_0xec1da0[_0x8c83('0x7c')]});_0x4e352b[_0x138b90[_0x8c83('0x62')][_0x8c83('0x80')]]=_0x138b90[_0x8c83('0x62')][_0x8c83('0x7e')];return db[_0x8c83('0x85')][_0x8c83('0x61')](_0x4e352b,{'fields':_0x131ca1,'raw':!![]});}})[_0x8c83('0x3d')](handleEntityNotFound(_0x59ea86,null))[_0x8c83('0x3d')](function(_0x57e4d5){_0x368f80[_0x8c83('0x90')]=_0x57e4d5;if(_0x57e4d5){var _0x391309={'ContactId':_0x57e4d5['id'],'OpenchannelAccountId':_0x138b90[_0x8c83('0x5c')]['id'],'from':(_0x57e4d5['firstName']||'')+'\x20'+(_0x57e4d5[_0x8c83('0x91')]||'')};var _0x208ebd={'OpenchannelAccountId':_0x138b90[_0x8c83('0x5c')]['id'],'closed':![]};if(_0x138b90[_0x8c83('0x62')][_0x8c83('0x92')]){_0x208ebd[_0x8c83('0x92')]=_0x138b90[_0x8c83('0x62')]['threadId'];return db[_0x8c83('0x93')][_0x8c83('0x60')]({'where':_0x208ebd})[_0x8c83('0x3d')](function(_0x246715){if(_0x246715){return[_0x246715,![]];}_0x391309[_0x8c83('0x92')]=_0x138b90[_0x8c83('0x62')][_0x8c83('0x92')];_0x391309['externalUrl']=_0x138b90['body'][_0x8c83('0x94')];return db['OpenchannelInteraction']['create'](_0x391309)[_0x8c83('0x3d')](function(_0x4490e6){return[_0x4490e6,!![]];});});}else{_0x208ebd[_0x8c83('0x92')]=null;}_0x208ebd[_0x8c83('0x95')]=_0x57e4d5['id'];return db[_0x8c83('0x93')][_0x8c83('0x60')]({'where':_0x208ebd})[_0x8c83('0x3d')](function(_0x3d76ac){if(_0x3d76ac){return[_0x3d76ac,![]];}return db[_0x8c83('0x93')][_0x8c83('0x61')](_0x391309)[_0x8c83('0x3d')](function(_0x462333){return[_0x462333,!![]];});});}})['spread'](function(_0x330d16,_0xfd2fff){if(_0x330d16){_0x5078e3=_0xfd2fff;if(!_0xfd2fff){var _0x21cc3c={'from':(_0x368f80['contact'][_0x8c83('0x96')]||'')+'\x20'+(_0x368f80[_0x8c83('0x90')][_0x8c83('0x91')]||'')};if(_0x138b90[_0x8c83('0x62')][_0x8c83('0x92')]&&_0x138b90[_0x8c83('0x62')][_0x8c83('0x97')]&&_0x138b90['body'][_0x8c83('0x92')]!=_0x138b90[_0x8c83('0x62')]['messageId']){_0x21cc3c[_0x8c83('0x92')]=_0x138b90[_0x8c83('0x62')][_0x8c83('0x97')];}return _0x330d16[_0x8c83('0x3b')](_0x21cc3c);}else{return _0x330d16;}}})[_0x8c83('0x3d')](function(_0x257f48){_0x368f80[_0x8c83('0x98')]=_0x257f48[_0x8c83('0x3e')]({'plain':!![]});_0x368f80[_0x8c83('0x98')][_0x8c83('0x99')]=_0x5078e3;if(_0x368f80[_0x8c83('0x98')][_0x8c83('0x99')]){if(_0x368f80['account'][_0x8c83('0x9a')]){_0x368f80[_0x8c83('0x8b')][_0x8c83('0x9b')]({'id':0x0,'priority':_0x368f80['applications'][_0x8c83('0x51')]+0x1,'app':_0x8c83('0x9c'),'appdata':'unmanaged','interval':_0x8c83('0x9d')});}}return db['OpenchannelMessage'][_0x8c83('0x61')]({'body':_0x138b90[_0x8c83('0x62')][_0x8c83('0x62')],'OpenchannelAccountId':_0x138b90[_0x8c83('0x5c')]['id'],'OpenchannelInteractionId':_0x257f48['id'],'direction':'in','ContactId':_0x368f80['contact']['id'],'AttachmentId':_0x138b90[_0x8c83('0x62')]['AttachmentId']});})[_0x8c83('0x3d')](function(_0x993100){_0x368f80['message']=_0x993100;if(!_0x368f80[_0x8c83('0x98')]['UserId'])return;return db['User'][_0x8c83('0x60')]({'attributes':['id',_0x8c83('0x4b')],'where':{'id':_0x368f80[_0x8c83('0x98')][_0x8c83('0x9e')]}});})[_0x8c83('0x3d')](function(_0x3fad7d){if(_0x3fad7d){_0x368f80[_0x8c83('0x8b')]['unshift']({'id':0x0,'priority':0x0,'app':_0x8c83('0x9f'),'appdata':_0x3fad7d[_0x8c83('0x4b')]+','+(_0x368f80[_0x8c83('0x8a')]['waitForTheAssignedAgent']||0xa),'interval':_0x8c83('0x9d')});}if(!_0x368f80[_0x8c83('0x98')][_0x8c83('0xa0')])return;return db[_0x8c83('0xa1')]['find']({'attributes':['id',_0x8c83('0x4b')],'where':{'id':_0x368f80['interaction'][_0x8c83('0xa0')]}});})['then'](function(_0x54096e){if(_0x54096e){_0x368f80[_0x8c83('0x8b')][_0x8c83('0xa2')]({'id':0x0,'priority':0x1,'app':_0x8c83('0xa3'),'appdata':_0x54096e[_0x8c83('0x4b')]+','+(_0x368f80[_0x8c83('0x8a')][_0x8c83('0xa4')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x8c83('0xa5'),'startRouting',_0x368f80);})[_0x8c83('0x3d')](function(_0x1d04ec){respondWithRpcPromise('EventManager',_0x8c83('0xa6'),{'event':_0x8c83('0x75'),'message':_0x1d04ec},client9002);return _0x1d04ec;})[_0x8c83('0x3d')](respondWithResult(_0x59ea86,null))['catch'](handleError(_0x59ea86,null));};exports[_0x8c83('0xa7')]=function(_0x57c720,_0x25829f){var _0x7e5ee8=_0x57c720['params']['id'];var _0xa39425=_0x57c720[_0x8c83('0x62')];var _0x59f2d0=0xc8;var _0x3ab85d=null;return db[_0x8c83('0xa8')]['transaction']({'isolationLevel':db[_0x8c83('0xa8')][_0x8c83('0xa9')][_0x8c83('0xaa')][_0x8c83('0xab')]},function(_0xd6f94a){return db['OpenchannelAccount'][_0x8c83('0x6c')]({'where':{'id':_0x7e5ee8},'transaction':_0xd6f94a})[_0x8c83('0x3d')](function(_0x42c353){if(_0x42c353){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x7e5ee8},'transaction':_0xd6f94a})[_0x8c83('0x3d')](function(){var _0x4196f9=_['map'](_0xa39425,function(_0x3d0dbb){_0x3d0dbb['OpenchannelAccountId']=_0x7e5ee8;return _0x3d0dbb;});return db[_0x8c83('0x88')][_0x8c83('0xac')](_0x4196f9,{'transaction':_0xd6f94a});});}else{_0x59f2d0=0x194;_0x3ab85d=[];}});})['then'](function(){if(_0x59f2d0!==0x194){return db[_0x8c83('0x88')][_0x8c83('0xad')]({'where':{'OpenchannelAccountId':_0x7e5ee8},'order':'priority'})['then'](function(_0x39512a){_0x3ab85d=_0x39512a;});}})[_0x8c83('0x2e')](function(_0x51397b){_0x59f2d0=0x1f4;logger['error'](_0x51397b[_0x8c83('0xae')]);if(_0x51397b[_0x8c83('0x4b')]){delete _0x51397b[_0x8c83('0x4b')];}_0x3ab85d=_0x51397b;})[_0x8c83('0xaf')](function(){if(_0x3ab85d===null){_0x25829f[_0x8c83('0x2f')](_0x59f2d0);}else{if(_0x59f2d0===0x1f4){_0x25829f[_0x8c83('0x30')](_0x59f2d0)['send'](_0x3ab85d);}else{_0x25829f['status'](_0x59f2d0)['json'](_0x3ab85d);}}});};exports['getApplications']=function(_0x8b1958,_0x4cec20,_0x25e87c){var _0xcc9fca={};var _0x4b1a3c={};var _0x5a352f;var _0x369cc8;return db['OpenchannelAccount'][_0x8c83('0x6c')]({'where':{'id':_0x8b1958[_0x8c83('0x5c')]['id']}})[_0x8c83('0x3d')](handleEntityNotFound(_0x4cec20,null))[_0x8c83('0x3d')](function(_0x3f6eeb){if(_0x3f6eeb){_0x5a352f=_0x3f6eeb;_0x4b1a3c['model']=_[_0x8c83('0x5e')](db['OpenchannelApplication']['rawAttributes']);_0x4b1a3c[_0x8c83('0x4e')]=_[_0x8c83('0x5e')](_0x8b1958[_0x8c83('0x4e')]);_0x4b1a3c[_0x8c83('0x4c')]=_[_0x8c83('0x4d')](_0x4b1a3c[_0x8c83('0x4a')],_0x4b1a3c[_0x8c83('0x4e')]);_0xcc9fca[_0x8c83('0x4f')]=_[_0x8c83('0x4d')](_0x4b1a3c[_0x8c83('0x4a')],qs[_0x8c83('0x50')](_0x8b1958[_0x8c83('0x4e')][_0x8c83('0x50')]));_0xcc9fca[_0x8c83('0x4f')]=_0xcc9fca[_0x8c83('0x4f')]['length']?_0xcc9fca['attributes']:_0x4b1a3c[_0x8c83('0x4a')];_0xcc9fca['order']=qs[_0x8c83('0x53')](_0x8b1958['query'][_0x8c83('0x53')]);_0xcc9fca[_0x8c83('0x54')]=qs['filters'](_[_0x8c83('0x55')](_0x8b1958[_0x8c83('0x4e')],_0x4b1a3c['filters']));if(_0x8b1958[_0x8c83('0x4e')]['filter']){_0xcc9fca[_0x8c83('0x54')]=_[_0x8c83('0x58')](_0xcc9fca[_0x8c83('0x54')],{'$or':_[_0x8c83('0x45')](_0xcc9fca['attributes'],function(_0x48d860){var _0x50733b={};_0x50733b[_0x48d860]={'$like':'%'+_0x8b1958[_0x8c83('0x4e')][_0x8c83('0x56')]+'%'};return _0x50733b;})});}_0xcc9fca=_[_0x8c83('0x58')]({},_0xcc9fca,_0x8b1958[_0x8c83('0x5f')]);return _0x5a352f[_0x8c83('0xb0')](_0xcc9fca);}})[_0x8c83('0x3d')](function(_0x51b036){if(_0x51b036){_0x369cc8=_0x51b036['length'];if(!_0x8b1958[_0x8c83('0x4e')][_0x8c83('0x6e')](_0x8c83('0x6f'))){_0xcc9fca['limit']=qs[_0x8c83('0x34')](_0x8b1958[_0x8c83('0x4e')][_0x8c83('0x34')]);_0xcc9fca[_0x8c83('0x33')]=qs['offset'](_0x8b1958[_0x8c83('0x4e')][_0x8c83('0x33')]);}return _0x5a352f[_0x8c83('0xb0')](_0xcc9fca);}})[_0x8c83('0x3d')](function(_0x1ef23d){if(_0x1ef23d){return _0x1ef23d?{'count':_0x369cc8,'rows':_0x1ef23d}:null;}})[_0x8c83('0x3d')](respondWithResult(_0x4cec20,null))[_0x8c83('0x2e')](handleError(_0x4cec20,null));};exports[_0x8c83('0xb1')]=function(_0x31f6c1,_0x66f85d,_0x5205ef){var _0x9c508c={'raw':![],'where':{}};var _0x282764={};var _0x57e34b={'count':0x0,'rows':[]};return db[_0x8c83('0x46')][_0x8c83('0x6c')]({'where':{'id':_0x31f6c1['params']['id']}})['then'](handleEntityNotFound(_0x66f85d,null))[_0x8c83('0x3d')](function(_0x50351f){if(_0x50351f){_0x282764[_0x8c83('0x4a')]=_[_0x8c83('0x5e')](db['OpenchannelInteraction'][_0x8c83('0x47')]);_0x282764['query']=_['keys'](_0x31f6c1['query']);_0x282764[_0x8c83('0x4c')]=_[_0x8c83('0x4d')](_0x282764['model'],_0x282764[_0x8c83('0x4e')]);_0x9c508c[_0x8c83('0x4f')]=_[_0x8c83('0x4d')](_0x282764[_0x8c83('0x4a')],qs[_0x8c83('0x50')](_0x31f6c1[_0x8c83('0x4e')]['fields']));_0x9c508c[_0x8c83('0x4f')]=_0x9c508c[_0x8c83('0x4f')]['length']?_0x9c508c[_0x8c83('0x4f')]:_0x282764[_0x8c83('0x4a')];if(!_0x31f6c1[_0x8c83('0x4e')][_0x8c83('0x6e')]('nolimit')){_0x9c508c[_0x8c83('0x34')]=qs['limit'](_0x31f6c1[_0x8c83('0x4e')]['limit']);_0x9c508c[_0x8c83('0x33')]=qs[_0x8c83('0x33')](_0x31f6c1['query'][_0x8c83('0x33')]);}_0x9c508c[_0x8c83('0x52')]=qs[_0x8c83('0x53')](_0x31f6c1[_0x8c83('0x4e')][_0x8c83('0x53')]);_0x9c508c[_0x8c83('0x54')]=qs['filters'](_[_0x8c83('0x55')](_0x31f6c1[_0x8c83('0x4e')],_0x282764[_0x8c83('0x4c')]));_0x9c508c[_0x8c83('0x54')][_0x8c83('0x6a')]=_0x50351f['id'];if(_0x31f6c1[_0x8c83('0x4e')][_0x8c83('0x56')]){_0x9c508c[_0x8c83('0x54')]=_['merge'](_0x9c508c[_0x8c83('0x54')],{'$or':_['map'](_0x9c508c[_0x8c83('0x4f')],function(_0x558713){var _0x2664f8={};_0x2664f8[_0x558713]={'$like':'%'+_0x31f6c1[_0x8c83('0x4e')][_0x8c83('0x56')]+'%'};return _0x2664f8;})});}_0x9c508c=_['merge']({},_0x9c508c,_0x31f6c1[_0x8c83('0x5f')]);return db[_0x8c83('0x93')][_0x8c83('0x32')]({'where':_0x9c508c[_0x8c83('0x54')]})[_0x8c83('0x3d')](function(_0x400b46){_0x57e34b[_0x8c83('0x32')]=_0x400b46;if(_0x31f6c1['query'][_0x8c83('0x59')]){_0x9c508c[_0x8c83('0x5a')]=[{'model':db[_0x8c83('0x85')],'as':_0x8c83('0xb2'),'required':![]},{'model':db[_0x8c83('0xb3')],'as':_0x8c83('0xb4'),'attributes':[_0x8c83('0x4b'),_0x8c83('0xb5'),_0x8c83('0xb6')],'required':![]},{'model':db[_0x8c83('0xb7')],'as':_0x8c83('0xb8'),'attributes':['id',_0x8c83('0x4b'),'color'],'where':_0x31f6c1[_0x8c83('0x4e')][_0x8c83('0xb9')]?{'id':_0x31f6c1[_0x8c83('0x4e')][_0x8c83('0xb9')]}:undefined,'required':_0x31f6c1[_0x8c83('0x4e')][_0x8c83('0xb9')]?!![]:![]}];}return db[_0x8c83('0x93')][_0x8c83('0xba')](_0x9c508c);})['then'](function(_0x1e3958){_0x57e34b['rows']=_0x1e3958;return _0x57e34b;});}})[_0x8c83('0x3d')](respondWithFilteredResult(_0x66f85d,_0x9c508c))['catch'](handleError(_0x66f85d,null));};exports[_0x8c83('0xbb')]=function(_0x2b0218,_0x2b6195,_0x2c17a3){return db[_0x8c83('0x46')]['find']({'where':{'id':_0x2b0218[_0x8c83('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2b6195,null))[_0x8c83('0x3d')](function(_0x2d7847){if(_0x2d7847){return _0x2d7847[_0x8c83('0xbb')](_0x2b0218[_0x8c83('0x62')][_0x8c83('0x74')],_[_0x8c83('0xbc')](_0x2b0218['body'],[_0x8c83('0x74'),'id'])||{})[_0x8c83('0xbd')](function(_0x3e7e54){for(var _0x13d39f=0x0;_0x13d39f<_0x2b0218[_0x8c83('0x62')]['ids'][_0x8c83('0x51')];_0x13d39f+=0x1){socket['emit'](_0x8c83('0xbe'),{'UserId':Number(_0x2b0218[_0x8c83('0x62')][_0x8c83('0x74')][_0x13d39f]),'OpenchannelAccountId':Number(_0x2b0218['params']['id'])});}return _0x3e7e54;});}})[_0x8c83('0x3d')](respondWithResult(_0x2b6195,null))[_0x8c83('0x2e')](handleError(_0x2b6195,null));};exports[_0x8c83('0xbf')]=function(_0x4ecadb,_0x2a9993,_0x6fddd7){return db[_0x8c83('0x46')][_0x8c83('0x60')]({'where':{'id':_0x4ecadb[_0x8c83('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2a9993,null))[_0x8c83('0x3d')](function(_0x228219){if(_0x228219){return _0x228219[_0x8c83('0xbf')](_0x4ecadb['query'][_0x8c83('0x74')])[_0x8c83('0x3d')](function(){if(_[_0x8c83('0xc0')](_0x4ecadb[_0x8c83('0x4e')][_0x8c83('0x74')])){for(var _0x5c3ad7=0x0;_0x5c3ad7<_0x4ecadb['query'][_0x8c83('0x74')][_0x8c83('0x51')];_0x5c3ad7+=0x1){socket[_0x8c83('0xc1')](_0x8c83('0xc2'),{'UserId':Number(_0x4ecadb['query'][_0x8c83('0x74')][_0x5c3ad7]),'OpenchannelAccountId':Number(_0x4ecadb[_0x8c83('0x5c')]['id'])});}}else{socket[_0x8c83('0xc1')]('userOpenchannelAccount:remove',{'UserId':Number(_0x4ecadb[_0x8c83('0x4e')][_0x8c83('0x74')]),'OpenchannelAccountId':Number(_0x4ecadb[_0x8c83('0x5c')]['id'])});}});}})[_0x8c83('0x3d')](respondWithStatusCode(_0x2a9993,null))[_0x8c83('0x2e')](handleError(_0x2a9993,null));};exports[_0x8c83('0xc3')]=function(_0x4ff407,_0x360558,_0x397455){var _0x183db1={};var _0x39ee93={};var _0x113e27;var _0x2c28eb;return db['OpenchannelAccount'][_0x8c83('0x6c')]({'where':{'id':_0x4ff407['params']['id']}})[_0x8c83('0x3d')](handleEntityNotFound(_0x360558,null))[_0x8c83('0x3d')](function(_0x3f2ffb){if(_0x3f2ffb){_0x113e27=_0x3f2ffb;_0x39ee93[_0x8c83('0x4a')]=_[_0x8c83('0x5e')](db[_0x8c83('0xb3')][_0x8c83('0x47')]);_0x39ee93['query']=_[_0x8c83('0x5e')](_0x4ff407['query']);_0x39ee93[_0x8c83('0x4c')]=_[_0x8c83('0x4d')](_0x39ee93[_0x8c83('0x4a')],_0x39ee93[_0x8c83('0x4e')]);_0x183db1[_0x8c83('0x4f')]=_[_0x8c83('0x4d')](_0x39ee93[_0x8c83('0x4a')],qs[_0x8c83('0x50')](_0x4ff407[_0x8c83('0x4e')]['fields']));_0x183db1[_0x8c83('0x4f')]=_0x183db1[_0x8c83('0x4f')][_0x8c83('0x51')]?_0x183db1[_0x8c83('0x4f')]:_0x39ee93[_0x8c83('0x4a')];_0x183db1['order']=qs[_0x8c83('0x53')](_0x4ff407[_0x8c83('0x4e')][_0x8c83('0x53')]);_0x183db1[_0x8c83('0x54')]=qs['filters'](_[_0x8c83('0x55')](_0x4ff407[_0x8c83('0x4e')],_0x39ee93[_0x8c83('0x4c')]));if(_0x4ff407[_0x8c83('0x4e')][_0x8c83('0x56')]){_0x183db1[_0x8c83('0x54')]=_[_0x8c83('0x58')](_0x183db1['where'],{'$or':_[_0x8c83('0x45')](_0x183db1['attributes'],function(_0x16f7a7){var _0x1f28eb={};_0x1f28eb[_0x16f7a7]={'$like':'%'+_0x4ff407[_0x8c83('0x4e')]['filter']+'%'};return _0x1f28eb;})});}_0x183db1=_[_0x8c83('0x58')]({},_0x183db1,_0x4ff407['options']);return _0x113e27[_0x8c83('0xc3')](_0x183db1);}})[_0x8c83('0x3d')](function(_0xe97b83){if(_0xe97b83){_0x2c28eb=_0xe97b83[_0x8c83('0x51')];if(!_0x4ff407[_0x8c83('0x4e')]['hasOwnProperty'](_0x8c83('0x6f'))){_0x183db1[_0x8c83('0x34')]=qs[_0x8c83('0x34')](_0x4ff407[_0x8c83('0x4e')][_0x8c83('0x34')]);_0x183db1['offset']=qs[_0x8c83('0x33')](_0x4ff407[_0x8c83('0x4e')][_0x8c83('0x33')]);}return _0x113e27[_0x8c83('0xc3')](_0x183db1);}})[_0x8c83('0x3d')](function(_0x2b9927){if(_0x2b9927){return _0x2b9927?{'count':_0x2c28eb,'rows':_0x2b9927}:null;}})[_0x8c83('0x3d')](respondWithResult(_0x360558,null))[_0x8c83('0x2e')](handleError(_0x360558,null));};exports[_0x8c83('0x42')]=function(_0xc8b063,_0x5e71ad,_0x3a8a03){var _0x4652f5,_0x3e9189,_0x2cd77f;if(_[_0x8c83('0x7d')](_0xc8b063[_0x8c83('0x62')][_0x8c83('0x62')])||_0xc8b063['body']['body']===''){throw new db[(_0x8c83('0x7f'))][(_0x8c83('0x77'))](_0x8c83('0xc4'));}if(_[_0x8c83('0x7d')](_0xc8b063[_0x8c83('0x62')]['to'])){}_0x4652f5=_0xc8b063[_0x8c83('0x62')]['to'];return db[_0x8c83('0x46')][_0x8c83('0x6c')]({'where':{'id':_0xc8b063['params']['id']}})[_0x8c83('0x3d')](handleEntityNotFound(_0x5e71ad,null))[_0x8c83('0x3d')](function(_0xc42b49){if(_0xc42b49){return db[_0x8c83('0x46')]['find']({'where':{'id':_0xc42b49['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x8c83('0x85')],'as':'Contacts','where':{[_0xc42b49[_0x8c83('0x80')]]:_0x4652f5},'limit':0x1,'order':[[_0x8c83('0x7b'),'DESC']]}]}]})[_0x8c83('0x3d')](handleEntityNotFound(_0x5e71ad,null))[_0x8c83('0x3d')](function(_0x4d6729){if(_0x4d6729&&_0x4d6729[_0x8c83('0x84')]){_0x3e9189=_0x4d6729[_0x8c83('0x3e')]({'plain':!![]});if(_0x3e9189[_0x8c83('0x84')]&&_0x3e9189['List'][_0x8c83('0x86')][_0x8c83('0x51')]){return _0x3e9189['List'][_0x8c83('0x86')][0x0];}return db[_0x8c83('0x85')][_0x8c83('0x61')](_['defaults'](_0xc8b063[_0x8c83('0x62')],{'firstName':_0x4652f5,[_0x4d6729[_0x8c83('0x80')]]:_0x4652f5,'phone':_0x4652f5,'ListId':_0x3e9189['ListId']}));}})[_0x8c83('0x3d')](handleEntityNotFound(_0x5e71ad,null))['then'](function(_0x44afa5){if(_0x44afa5){_0x2cd77f=_0x44afa5;return db['OpenchannelInteraction'][_0x8c83('0x60')]({'where':{'ContactId':_0x2cd77f['id'],'closed':![],'OpenchannelAccountId':_0x3e9189['id']}})[_0x8c83('0x3d')](function(_0x1c6c83){if(_0x1c6c83){return[_0x1c6c83,![]];}return db[_0x8c83('0x93')][_0x8c83('0x61')]({'UserId':_0xc8b063[_0x8c83('0x63')]['id'],'ContactId':_0x2cd77f['id'],'OpenchannelAccountId':_0x3e9189['id'],'lastMsgDirection':_0x8c83('0xc5'),'firstMsgDirection':'out','Messages':[_[_0x8c83('0x58')](_0xc8b063[_0x8c83('0x62')],{'read':![],'body':_0xc8b063[_0x8c83('0x62')][_0x8c83('0x62')],'OpenchannelAccountId':_0x3e9189['id'],'UserId':_0xc8b063[_0x8c83('0x63')]['id'],'ContactId':_0x2cd77f['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x8c83('0xc6')}]})[_0x8c83('0x3d')](function(_0x324195){return[_0x324195,!![]];});});}})['spread'](function(_0x4b7ca9,_0x26395b){if(_0x26395b){return _0x4b7ca9;}return db['OpenchannelMessage'][_0x8c83('0x61')](_[_0x8c83('0x58')](_0xc8b063['body'],{'read':![],'body':_0xc8b063['body'][_0x8c83('0x62')],'OpenchannelAccountId':_0x3e9189['id'],'OpenchannelInteractionId':_0x4b7ca9['id'],'UserId':_0xc8b063['user']['id'],'ContactId':_0x2cd77f['id']}))['then'](function(_0x5002b5){_0x4b7ca9[_0x8c83('0xc7')][_0x8c83('0xc6')]=[];_0x4b7ca9[_0x8c83('0xc7')][_0x8c83('0xc6')][_0x8c83('0x9b')](_0x5002b5[_0x8c83('0xc7')]);return _0x4b7ca9;});});}})[_0x8c83('0x3d')](respondWithResult(_0x5e71ad,null))[_0x8c83('0x2e')](handleError(_0x5e71ad,null));}; \ No newline at end of file +var _0xff22=['*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','OpenchannelQueue','queueId','queue','waitForTheAssignedQueue','Start','EventManager','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','dataValues','Messages','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','update','destroy','get','OpenchannelAccounts','stack','name','send','index','Pause','map','OpenchannelAccount','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','mandatoryDispositionPause','keys','length','create','body','user','role','UserProfileSection','find','autoAssociation','UserProfileResource','describe','OpenchannelAccountId','Disposition','getDispositions','pick','removeDispositions','ids','CannedAnswer','findOne','rows','removeAnswers','notify','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','applications','list','orderBy','priority','asc','account','CmContact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created','push','close'];(function(_0x45cb28,_0x583de8){var _0x14b612=function(_0x145aa8){while(--_0x145aa8){_0x45cb28['push'](_0x45cb28['shift']());}};_0x14b612(++_0x583de8);}(_0xff22,0x1a0));var _0x2ff2=function(_0x580b3f,_0x1868fa){_0x580b3f=_0x580b3f-0x0;var _0x659700=_0xff22[_0x580b3f];return _0x659700;};'use strict';var emlformat=require(_0x2ff2('0x0'));var rimraf=require(_0x2ff2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ff2('0x2'));var rp=require(_0x2ff2('0x3'));var moment=require(_0x2ff2('0x4'));var BPromise=require(_0x2ff2('0x5'));var Mustache=require(_0x2ff2('0x6'));var util=require(_0x2ff2('0x7'));var path=require(_0x2ff2('0x8'));var sox=require(_0x2ff2('0x9'));var csv=require(_0x2ff2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ff2('0xb'));var _=require(_0x2ff2('0xc'));var squel=require(_0x2ff2('0xd'));var crypto=require(_0x2ff2('0xe'));var jsforce=require(_0x2ff2('0xf'));var deskjs=require(_0x2ff2('0x10'));var toCsv=require(_0x2ff2('0xa'));var querystring=require('querystring');var Papa=require(_0x2ff2('0x11'));var Redis=require(_0x2ff2('0x12'));var authService=require(_0x2ff2('0x13'));var qs=require(_0x2ff2('0x14'));var as=require(_0x2ff2('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2ff2('0x16'));var config=require(_0x2ff2('0x17'));var licenseUtil=require(_0x2ff2('0x18'));var db=require(_0x2ff2('0x19'))['db'];config[_0x2ff2('0x1a')]=_[_0x2ff2('0x1b')](config[_0x2ff2('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x2ff2('0x1c'))(new Redis(config[_0x2ff2('0x1a')]));require(_0x2ff2('0x1d'))[_0x2ff2('0x1e')](socket);var jayson=require(_0x2ff2('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x2ff2('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x401f66,_0x383aba,_0x1a7adb,_0x45dc41){return new BPromise(function(_0x15c2af,_0x2f2476){var _0xca38d7=_0x45dc41||client;return _0xca38d7['request'](_0x401f66,_0x1a7adb)[_0x2ff2('0x21')](function(_0x598e53){logger[_0x2ff2('0x22')](_0x2ff2('0x23'),_0x383aba,_0x2ff2('0x24'));logger[_0x2ff2('0x25')](_0x2ff2('0x26'),_0x383aba,_0x2ff2('0x24'),JSON[_0x2ff2('0x27')](_0x598e53));if(_0x598e53[_0x2ff2('0x28')]){if(_0x598e53[_0x2ff2('0x28')]['code']===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x383aba,_0x598e53['error'][_0x2ff2('0x29')]);return _0x2f2476(_0x598e53['error'][_0x2ff2('0x29')]);}logger['error'](_0x2ff2('0x23'),_0x383aba,_0x598e53['error']['message']);return _0x15c2af(_0x598e53[_0x2ff2('0x28')][_0x2ff2('0x29')]);}else{logger[_0x2ff2('0x22')](_0x2ff2('0x23'),_0x383aba,_0x2ff2('0x24'));_0x15c2af(_0x598e53[_0x2ff2('0x2a')]['message']);}})['catch'](function(_0x26e395){logger[_0x2ff2('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0x383aba,_0x26e395);_0x2f2476(_0x26e395);});});}function respondWithStatusCode(_0x2d6b12,_0x9efdcd){_0x9efdcd=_0x9efdcd||0xcc;return function(_0x248742){if(_0x248742){return _0x2d6b12[_0x2ff2('0x2b')](_0x9efdcd);}return _0x2d6b12[_0x2ff2('0x2c')](_0x9efdcd)[_0x2ff2('0x2d')]();};}function respondWithResult(_0x126b80,_0x8cdbb7){_0x8cdbb7=_0x8cdbb7||0xc8;return function(_0x5e3dec){if(_0x5e3dec){return _0x126b80[_0x2ff2('0x2c')](_0x8cdbb7)['json'](_0x5e3dec);}};}function respondWithFilteredResult(_0x1e1957,_0x49b954){return function(_0x354dff){if(_0x354dff){var _0x4e33e0=typeof _0x49b954[_0x2ff2('0x2e')]===_0x2ff2('0x2f')&&typeof _0x49b954[_0x2ff2('0x30')]===_0x2ff2('0x2f');var _0x116f9d=_0x354dff[_0x2ff2('0x31')];var _0x5f0e29=_0x4e33e0?0x0:_0x49b954[_0x2ff2('0x2e')];var _0x4d9af9=_0x4e33e0?_0x354dff['count']:_0x49b954['offset']+_0x49b954[_0x2ff2('0x30')];var _0x4b4995;if(_0x4d9af9>=_0x116f9d){_0x4d9af9=_0x116f9d;_0x4b4995=0xc8;}else{_0x4b4995=0xce;}_0x1e1957[_0x2ff2('0x2c')](_0x4b4995);return _0x1e1957['set']('Content-Range',_0x5f0e29+'-'+_0x4d9af9+'/'+_0x116f9d)[_0x2ff2('0x32')](_0x354dff);}return null;};}function patchUpdates(_0x482d6a){return function(_0x4abc99){try{jsonpatch[_0x2ff2('0x33')](_0x4abc99,_0x482d6a,!![]);}catch(_0x12a6a2){return BPromise[_0x2ff2('0x34')](_0x12a6a2);}return _0x4abc99['save']();};}function saveUpdates(_0x216451,_0x4192b5){return function(_0x3601bc){if(_0x3601bc){return _0x3601bc[_0x2ff2('0x35')](_0x216451)[_0x2ff2('0x21')](function(_0x3d8f5b){return _0x3d8f5b;});}return null;};}function removeEntity(_0x201805,_0x2d45d5){return function(_0xf4533d){if(_0xf4533d){return _0xf4533d[_0x2ff2('0x36')]()['then'](function(){var _0xc0de70=_0xf4533d[_0x2ff2('0x37')]({'plain':!![]});var _0x283cd1=_0x2ff2('0x38');return db['UserProfileResource'][_0x2ff2('0x36')]({'where':{'type':_0x283cd1,'resourceId':_0xc0de70['id']}})[_0x2ff2('0x21')](function(){return _0xf4533d;});})[_0x2ff2('0x21')](function(){_0x201805[_0x2ff2('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aa782,_0x7cc4ae){return function(_0x1e39da){if(!_0x1e39da){_0x5aa782[_0x2ff2('0x2b')](0x194);}return _0x1e39da;};}function handleError(_0x5a757f,_0x4f4547){_0x4f4547=_0x4f4547||0x1f4;return function(_0x2cf5f8){logger[_0x2ff2('0x28')](_0x2cf5f8[_0x2ff2('0x39')]);if(_0x2cf5f8['name']){delete _0x2cf5f8[_0x2ff2('0x3a')];}_0x5a757f[_0x2ff2('0x2c')](_0x4f4547)[_0x2ff2('0x3b')](_0x2cf5f8);};}exports[_0x2ff2('0x3c')]=function(_0x36b9c8,_0x857d96){var _0x203085={'include':[{'model':db[_0x2ff2('0x3d')],'as':'mandatoryDispositionPause'}]},_0x3fd022={},_0x31b105={'count':0x0,'rows':[]};var _0x18e7a4=_[_0x2ff2('0x3e')](db[_0x2ff2('0x3f')][_0x2ff2('0x40')],function(_0x4436c0){return{'name':_0x4436c0[_0x2ff2('0x41')],'type':_0x4436c0[_0x2ff2('0x42')]['key']};});_0x3fd022[_0x2ff2('0x43')]=_[_0x2ff2('0x3e')](_0x18e7a4,'name');_0x3fd022[_0x2ff2('0x44')]=_['keys'](_0x36b9c8[_0x2ff2('0x44')]);_0x3fd022['filters']=_[_0x2ff2('0x45')](_0x3fd022['model'],_0x3fd022[_0x2ff2('0x44')]);_0x203085[_0x2ff2('0x46')]=_[_0x2ff2('0x45')](_0x3fd022[_0x2ff2('0x43')],qs[_0x2ff2('0x47')](_0x36b9c8[_0x2ff2('0x44')][_0x2ff2('0x47')]));_0x203085[_0x2ff2('0x46')]=_0x203085[_0x2ff2('0x46')]['length']?_0x203085[_0x2ff2('0x46')]:_0x3fd022['model'];if(!_0x36b9c8[_0x2ff2('0x44')][_0x2ff2('0x48')](_0x2ff2('0x49'))){_0x203085[_0x2ff2('0x30')]=qs[_0x2ff2('0x30')](_0x36b9c8[_0x2ff2('0x44')][_0x2ff2('0x30')]);_0x203085[_0x2ff2('0x2e')]=qs['offset'](_0x36b9c8[_0x2ff2('0x44')][_0x2ff2('0x2e')]);}_0x203085[_0x2ff2('0x4a')]=qs[_0x2ff2('0x4b')](_0x36b9c8[_0x2ff2('0x44')][_0x2ff2('0x4b')]);_0x203085[_0x2ff2('0x4c')]=qs['filters'](_['pick'](_0x36b9c8['query'],_0x3fd022[_0x2ff2('0x4d')]),_0x18e7a4);if(_0x36b9c8[_0x2ff2('0x44')][_0x2ff2('0x4e')]){_0x203085[_0x2ff2('0x4c')]=_[_0x2ff2('0x4f')](_0x203085['where'],{'$or':_[_0x2ff2('0x3e')](_0x18e7a4,function(_0x502990){if(_0x502990[_0x2ff2('0x42')]!==_0x2ff2('0x50')){var _0x381479={};_0x381479[_0x502990['name']]={'$like':'%'+_0x36b9c8[_0x2ff2('0x44')]['filter']+'%'};return _0x381479;}})});}_0x203085=_[_0x2ff2('0x4f')]({},_0x203085,_0x36b9c8[_0x2ff2('0x51')]);var _0x3d3529={'where':_0x203085[_0x2ff2('0x4c')]};return db['OpenchannelAccount']['count'](_0x3d3529)[_0x2ff2('0x21')](function(_0xb22fb0){_0x31b105['count']=_0xb22fb0;if(_0x36b9c8[_0x2ff2('0x44')][_0x2ff2('0x52')]){_0x203085[_0x2ff2('0x53')]=[{'all':!![]}];}return db[_0x2ff2('0x3f')][_0x2ff2('0x54')](_0x203085);})[_0x2ff2('0x21')](function(_0x1e7bb5){_0x31b105['rows']=_0x1e7bb5;return _0x31b105;})[_0x2ff2('0x21')](respondWithFilteredResult(_0x857d96,_0x203085))[_0x2ff2('0x55')](handleError(_0x857d96,null));};exports[_0x2ff2('0x56')]=function(_0x312c98,_0x1cc1f2){var _0x34b462={'raw':![],'where':{'id':_0x312c98[_0x2ff2('0x57')]['id']},'include':[{'model':db[_0x2ff2('0x3d')],'as':_0x2ff2('0x58')}]},_0x4b333f={};_0x4b333f[_0x2ff2('0x43')]=_[_0x2ff2('0x59')](db[_0x2ff2('0x3f')][_0x2ff2('0x40')]);_0x4b333f[_0x2ff2('0x44')]=_[_0x2ff2('0x59')](_0x312c98['query']);_0x4b333f[_0x2ff2('0x4d')]=_['intersection'](_0x4b333f['model'],_0x4b333f[_0x2ff2('0x44')]);_0x34b462[_0x2ff2('0x46')]=_[_0x2ff2('0x45')](_0x4b333f[_0x2ff2('0x43')],qs[_0x2ff2('0x47')](_0x312c98[_0x2ff2('0x44')]['fields']));_0x34b462[_0x2ff2('0x46')]=_0x34b462['attributes'][_0x2ff2('0x5a')]?_0x34b462[_0x2ff2('0x46')]:_0x4b333f[_0x2ff2('0x43')];if(_0x312c98[_0x2ff2('0x44')][_0x2ff2('0x52')]){_0x34b462[_0x2ff2('0x53')]=[{'all':!![]}];}_0x34b462=_[_0x2ff2('0x4f')]({},_0x34b462,_0x312c98[_0x2ff2('0x51')]);return db[_0x2ff2('0x3f')]['find'](_0x34b462)['then'](handleEntityNotFound(_0x1cc1f2,null))[_0x2ff2('0x21')](respondWithResult(_0x1cc1f2,null))[_0x2ff2('0x55')](handleError(_0x1cc1f2,null));};exports[_0x2ff2('0x5b')]=function(_0x12a0e6,_0x52685e){return db['OpenchannelAccount'][_0x2ff2('0x5b')](_0x12a0e6[_0x2ff2('0x5c')],{})[_0x2ff2('0x21')](function(_0x336cba){var _0x1b2bae=_0x12a0e6[_0x2ff2('0x5d')][_0x2ff2('0x37')]({'plain':!![]});if(!_0x1b2bae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b2bae[_0x2ff2('0x5e')]===_0x2ff2('0x5d')){var _0x247e3f=_0x336cba[_0x2ff2('0x37')]({'plain':!![]});var _0x4c495e=_0x2ff2('0x38');return db[_0x2ff2('0x5f')][_0x2ff2('0x60')]({'where':{'name':_0x4c495e,'userProfileId':_0x1b2bae['userProfileId']},'raw':!![]})['then'](function(_0x525467){if(_0x525467&&_0x525467[_0x2ff2('0x61')]===0x0){return db[_0x2ff2('0x62')][_0x2ff2('0x5b')]({'name':_0x247e3f[_0x2ff2('0x3a')],'resourceId':_0x247e3f['id'],'type':_0x525467['name'],'sectionId':_0x525467['id']},{})[_0x2ff2('0x21')](function(){return _0x336cba;});}else{return _0x336cba;}})[_0x2ff2('0x55')](function(_0x7fb3b2){logger[_0x2ff2('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7fb3b2);throw _0x7fb3b2;});}return _0x336cba;})[_0x2ff2('0x21')](respondWithResult(_0x52685e,0xc9))[_0x2ff2('0x55')](handleError(_0x52685e,null));};exports['update']=function(_0xa2cd19,_0x14e01c){if(_0xa2cd19[_0x2ff2('0x5c')]['id']){delete _0xa2cd19[_0x2ff2('0x5c')]['id'];}return db['OpenchannelAccount'][_0x2ff2('0x60')]({'where':{'id':_0xa2cd19[_0x2ff2('0x57')]['id']},'include':[{'model':db[_0x2ff2('0x3d')],'as':_0x2ff2('0x58')}]})[_0x2ff2('0x21')](handleEntityNotFound(_0x14e01c,null))[_0x2ff2('0x21')](saveUpdates(_0xa2cd19['body'],null))[_0x2ff2('0x21')](respondWithResult(_0x14e01c,null))[_0x2ff2('0x55')](handleError(_0x14e01c,null));};exports['destroy']=function(_0x3ad493,_0x5b2a94){return db[_0x2ff2('0x3f')]['find']({'where':{'id':_0x3ad493[_0x2ff2('0x57')]['id']}})['then'](handleEntityNotFound(_0x5b2a94,null))[_0x2ff2('0x21')](removeEntity(_0x5b2a94,null))[_0x2ff2('0x55')](handleError(_0x5b2a94,null));};exports[_0x2ff2('0x63')]=function(_0x44384f,_0x262ec6){return db[_0x2ff2('0x3f')]['describe']()[_0x2ff2('0x21')](respondWithResult(_0x262ec6,null))['catch'](handleError(_0x262ec6,null));};exports['addDisposition']=function(_0x3ac3ce,_0x1f38aa,_0x16d330){if(_0x3ac3ce['body']['id']){delete _0x3ac3ce['body']['id'];}return db[_0x2ff2('0x3f')]['find']({'where':{'id':_0x3ac3ce[_0x2ff2('0x57')]['id']}})[_0x2ff2('0x21')](handleEntityNotFound(_0x1f38aa,null))[_0x2ff2('0x21')](function(_0x3fd5b9){if(_0x3fd5b9){_0x3ac3ce[_0x2ff2('0x5c')][_0x2ff2('0x64')]=_0x3fd5b9['id'];return db[_0x2ff2('0x65')]['create'](_0x3ac3ce[_0x2ff2('0x5c')]);}})[_0x2ff2('0x21')](respondWithResult(_0x1f38aa,null))[_0x2ff2('0x55')](handleError(_0x1f38aa,null));};exports[_0x2ff2('0x66')]=function(_0x3c9433,_0x259cbd,_0x214ea1){var _0x24caf8={'raw':![],'where':{}};var _0x511c3b={};var _0x5caa2b={'count':0x0,'rows':[]};return db[_0x2ff2('0x3f')]['findOne']({'where':{'id':_0x3c9433[_0x2ff2('0x57')]['id']}})[_0x2ff2('0x21')](handleEntityNotFound(_0x259cbd,null))['then'](function(_0x12eb5c){if(_0x12eb5c){_0x511c3b[_0x2ff2('0x43')]=_['keys'](db['Disposition'][_0x2ff2('0x40')]);_0x511c3b[_0x2ff2('0x44')]=_[_0x2ff2('0x59')](_0x3c9433['query']);_0x511c3b[_0x2ff2('0x4d')]=_[_0x2ff2('0x45')](_0x511c3b[_0x2ff2('0x43')],_0x511c3b[_0x2ff2('0x44')]);_0x24caf8[_0x2ff2('0x46')]=_[_0x2ff2('0x45')](_0x511c3b[_0x2ff2('0x43')],qs[_0x2ff2('0x47')](_0x3c9433[_0x2ff2('0x44')]['fields']));_0x24caf8[_0x2ff2('0x46')]=_0x24caf8[_0x2ff2('0x46')]['length']?_0x24caf8[_0x2ff2('0x46')]:_0x511c3b[_0x2ff2('0x43')];if(!_0x3c9433['query'][_0x2ff2('0x48')](_0x2ff2('0x49'))){_0x24caf8['limit']=qs[_0x2ff2('0x30')](_0x3c9433[_0x2ff2('0x44')][_0x2ff2('0x30')]);_0x24caf8[_0x2ff2('0x2e')]=qs[_0x2ff2('0x2e')](_0x3c9433['query'][_0x2ff2('0x2e')]);}_0x24caf8[_0x2ff2('0x4a')]=qs['sort'](_0x3c9433[_0x2ff2('0x44')][_0x2ff2('0x4b')]);_0x24caf8[_0x2ff2('0x4c')]=qs[_0x2ff2('0x4d')](_[_0x2ff2('0x67')](_0x3c9433[_0x2ff2('0x44')],_0x511c3b[_0x2ff2('0x4d')]));_0x24caf8[_0x2ff2('0x4c')][_0x2ff2('0x64')]=_0x12eb5c['id'];if(_0x3c9433[_0x2ff2('0x44')][_0x2ff2('0x4e')]){_0x24caf8[_0x2ff2('0x4c')]=_[_0x2ff2('0x4f')](_0x24caf8[_0x2ff2('0x4c')],{'$or':_[_0x2ff2('0x3e')](_0x24caf8['attributes'],function(_0x53b810){var _0x3a0e2f={};_0x3a0e2f[_0x53b810]={'$like':'%'+_0x3c9433['query'][_0x2ff2('0x4e')]+'%'};return _0x3a0e2f;})});}_0x24caf8=_[_0x2ff2('0x4f')]({},_0x24caf8,_0x3c9433[_0x2ff2('0x51')]);return db[_0x2ff2('0x65')][_0x2ff2('0x31')]({'where':_0x24caf8[_0x2ff2('0x4c')]})[_0x2ff2('0x21')](function(_0x578628){_0x5caa2b[_0x2ff2('0x31')]=_0x578628;if(_0x3c9433['query'][_0x2ff2('0x52')]){_0x24caf8['include']=[{'all':!![]}];}return db[_0x2ff2('0x65')][_0x2ff2('0x54')](_0x24caf8);})[_0x2ff2('0x21')](function(_0x545dcb){_0x5caa2b['rows']=_0x545dcb;return _0x5caa2b;});}})[_0x2ff2('0x21')](respondWithFilteredResult(_0x259cbd,_0x24caf8))[_0x2ff2('0x55')](handleError(_0x259cbd,null));};exports[_0x2ff2('0x68')]=function(_0x4a7d1f,_0x4d18f4,_0x48f6a3){return db[_0x2ff2('0x3f')][_0x2ff2('0x60')]({'where':{'id':_0x4a7d1f[_0x2ff2('0x57')]['id']}})['then'](handleEntityNotFound(_0x4d18f4,null))['then'](function(_0x529bbc){if(_0x529bbc){return _0x529bbc[_0x2ff2('0x68')](_0x4a7d1f[_0x2ff2('0x44')][_0x2ff2('0x69')]);}})[_0x2ff2('0x21')](respondWithStatusCode(_0x4d18f4,null))[_0x2ff2('0x55')](handleError(_0x4d18f4,null));};exports['addAnswer']=function(_0x520906,_0x533d26,_0x662700){if(_0x520906[_0x2ff2('0x5c')]['id']){delete _0x520906[_0x2ff2('0x5c')]['id'];}return db['OpenchannelAccount'][_0x2ff2('0x60')]({'where':{'id':_0x520906['params']['id']}})[_0x2ff2('0x21')](handleEntityNotFound(_0x533d26,null))[_0x2ff2('0x21')](function(_0x27ffc2){if(_0x27ffc2){_0x520906[_0x2ff2('0x5c')][_0x2ff2('0x64')]=_0x27ffc2['id'];return db[_0x2ff2('0x6a')][_0x2ff2('0x5b')](_0x520906[_0x2ff2('0x5c')]);}})[_0x2ff2('0x21')](respondWithResult(_0x533d26,null))['catch'](handleError(_0x533d26,null));};exports['getAnswers']=function(_0x3e24ca,_0x55e428,_0x45f315){var _0x31d38f={'raw':![],'where':{}};var _0x5b757b={};var _0x32edc4={'count':0x0,'rows':[]};return db[_0x2ff2('0x3f')][_0x2ff2('0x6b')]({'where':{'id':_0x3e24ca['params']['id']}})['then'](handleEntityNotFound(_0x55e428,null))['then'](function(_0x2b9b52){if(_0x2b9b52){_0x5b757b['model']=_[_0x2ff2('0x59')](db[_0x2ff2('0x6a')][_0x2ff2('0x40')]);_0x5b757b[_0x2ff2('0x44')]=_['keys'](_0x3e24ca[_0x2ff2('0x44')]);_0x5b757b[_0x2ff2('0x4d')]=_[_0x2ff2('0x45')](_0x5b757b['model'],_0x5b757b[_0x2ff2('0x44')]);_0x31d38f['attributes']=_[_0x2ff2('0x45')](_0x5b757b['model'],qs['fields'](_0x3e24ca[_0x2ff2('0x44')][_0x2ff2('0x47')]));_0x31d38f[_0x2ff2('0x46')]=_0x31d38f[_0x2ff2('0x46')][_0x2ff2('0x5a')]?_0x31d38f[_0x2ff2('0x46')]:_0x5b757b[_0x2ff2('0x43')];if(!_0x3e24ca[_0x2ff2('0x44')][_0x2ff2('0x48')](_0x2ff2('0x49'))){_0x31d38f[_0x2ff2('0x30')]=qs[_0x2ff2('0x30')](_0x3e24ca[_0x2ff2('0x44')][_0x2ff2('0x30')]);_0x31d38f[_0x2ff2('0x2e')]=qs[_0x2ff2('0x2e')](_0x3e24ca[_0x2ff2('0x44')][_0x2ff2('0x2e')]);}_0x31d38f[_0x2ff2('0x4a')]=qs[_0x2ff2('0x4b')](_0x3e24ca[_0x2ff2('0x44')][_0x2ff2('0x4b')]);_0x31d38f[_0x2ff2('0x4c')]=qs[_0x2ff2('0x4d')](_['pick'](_0x3e24ca[_0x2ff2('0x44')],_0x5b757b[_0x2ff2('0x4d')]));_0x31d38f[_0x2ff2('0x4c')][_0x2ff2('0x64')]=_0x2b9b52['id'];if(_0x3e24ca[_0x2ff2('0x44')][_0x2ff2('0x4e')]){_0x31d38f[_0x2ff2('0x4c')]=_[_0x2ff2('0x4f')](_0x31d38f[_0x2ff2('0x4c')],{'$or':_[_0x2ff2('0x3e')](_0x31d38f[_0x2ff2('0x46')],function(_0x5cf6c2){var _0x13297c={};_0x13297c[_0x5cf6c2]={'$like':'%'+_0x3e24ca[_0x2ff2('0x44')][_0x2ff2('0x4e')]+'%'};return _0x13297c;})});}_0x31d38f=_[_0x2ff2('0x4f')]({},_0x31d38f,_0x3e24ca[_0x2ff2('0x51')]);return db['CannedAnswer']['count']({'where':_0x31d38f[_0x2ff2('0x4c')]})['then'](function(_0x45a7fd){_0x32edc4[_0x2ff2('0x31')]=_0x45a7fd;if(_0x3e24ca[_0x2ff2('0x44')][_0x2ff2('0x52')]){_0x31d38f['include']=[{'all':!![]}];}return db[_0x2ff2('0x6a')][_0x2ff2('0x54')](_0x31d38f);})[_0x2ff2('0x21')](function(_0xb4fb0f){_0x32edc4[_0x2ff2('0x6c')]=_0xb4fb0f;return _0x32edc4;});}})[_0x2ff2('0x21')](respondWithFilteredResult(_0x55e428,_0x31d38f))[_0x2ff2('0x55')](handleError(_0x55e428,null));};exports[_0x2ff2('0x6d')]=function(_0x343487,_0x5b4c25,_0x1ad4ee){return db[_0x2ff2('0x3f')][_0x2ff2('0x60')]({'where':{'id':_0x343487[_0x2ff2('0x57')]['id']}})['then'](handleEntityNotFound(_0x5b4c25,null))['then'](function(_0x453a0d){if(_0x453a0d){return _0x453a0d['removeAnswers'](_0x343487[_0x2ff2('0x44')][_0x2ff2('0x69')]);}})[_0x2ff2('0x21')](respondWithStatusCode(_0x5b4c25,null))[_0x2ff2('0x55')](handleError(_0x5b4c25,null));};exports[_0x2ff2('0x6e')]=function(_0x4f0f9f,_0x5c0805,_0x5cb4c1){var _0x2a5ccb={'body':_0x4f0f9f[_0x2ff2('0x5c')],'channel':'openchannel'};var _0x1f40d5=[];var _0x1ff945=[];var _0x14ff82={};var _0x43d404=![];return db['CmContact'][_0x2ff2('0x63')]()['then'](function(_0x149973){if(!_0x149973){throw new db[(_0x2ff2('0x6f'))]['ValidationError'](_0x2ff2('0x70'));}_0x1f40d5=_[_0x2ff2('0x71')](_[_0x2ff2('0x59')](_0x149973),[_0x2ff2('0x72'),_0x2ff2('0x73')]);_0x1ff945=_['difference'](_[_0x2ff2('0x59')](_0x149973),['createdAt',_0x2ff2('0x73'),_0x2ff2('0x74'),_0x2ff2('0x75')]);if(_0x4f0f9f[_0x2ff2('0x5c')]['id']){delete _0x4f0f9f[_0x2ff2('0x5c')]['id'];}if(_[_0x2ff2('0x76')](_0x4f0f9f[_0x2ff2('0x5c')][_0x2ff2('0x77')])){throw new db[(_0x2ff2('0x6f'))][(_0x2ff2('0x78'))](_0x2ff2('0x79'));}if(_[_0x2ff2('0x76')](_0x4f0f9f['body'][_0x2ff2('0x5c')])||_0x4f0f9f['body']['body']===''){throw new db[(_0x2ff2('0x6f'))][(_0x2ff2('0x78'))](_0x2ff2('0x7a'));}if(_[_0x2ff2('0x76')](_0x4f0f9f['body'][_0x2ff2('0x7b')])){throw new db[(_0x2ff2('0x6f'))][(_0x2ff2('0x78'))](_0x2ff2('0x7c')+_0x1ff945);}if(!_['includes'](_0x1ff945,_0x4f0f9f[_0x2ff2('0x5c')]['mapKey'])){throw new db[(_0x2ff2('0x6f'))][(_0x2ff2('0x78'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1ff945);}_0x14ff82[_0x4f0f9f[_0x2ff2('0x5c')][_0x2ff2('0x7b')]]=_0x4f0f9f[_0x2ff2('0x5c')][_0x2ff2('0x77')];})[_0x2ff2('0x21')](function(){return db['OpenchannelAccount'][_0x2ff2('0x60')]({'where':{'id':_0x4f0f9f[_0x2ff2('0x57')]['id']},'include':[{'model':db[_0x2ff2('0x7d')],'as':_0x2ff2('0x7e'),'include':[{'model':db['CmContact'],'as':_0x2ff2('0x7f'),'where':_0x14ff82,'limit':0x1,'order':[['updatedAt',_0x2ff2('0x80')]]}]},{'model':db[_0x2ff2('0x81')],'as':_0x2ff2('0x82')}]});})[_0x2ff2('0x21')](handleEntityNotFound(_0x5c0805,null))[_0x2ff2('0x21')](function(_0x2f0c7d){if(_0x2f0c7d&&_0x2f0c7d[_0x2ff2('0x7e')]){_0x2a5ccb['account']=_0x2f0c7d;_0x2a5ccb[_0x2ff2('0x83')]=_0x2f0c7d[_0x2ff2('0x82')];_0x2a5ccb[_0x2ff2('0x84')]=_0x2f0c7d[_0x2ff2('0x7e')];_0x2a5ccb[_0x2ff2('0x83')]=_[_0x2ff2('0x85')](_0x2a5ccb[_0x2ff2('0x83')],[_0x2ff2('0x86')],[_0x2ff2('0x87')]);if(_0x2a5ccb[_0x2ff2('0x88')][_0x2ff2('0x82')]){delete _0x2a5ccb[_0x2ff2('0x88')]['Applications'];}if(_0x2a5ccb['account']['List']&&_0x2a5ccb[_0x2ff2('0x88')]['List']['Contacts'][_0x2ff2('0x5a')]){return _0x2a5ccb[_0x2ff2('0x88')][_0x2ff2('0x7e')]['Contacts'][0x0];}var _0x4d4c7e=_['defaults'](_0x4f0f9f[_0x2ff2('0x5c')],{'firstName':_0x4f0f9f['body'][_0x2ff2('0x77')],'ListId':_0x2f0c7d['ListId']});_0x4d4c7e[_0x4f0f9f[_0x2ff2('0x5c')][_0x2ff2('0x7b')]]=_0x4f0f9f[_0x2ff2('0x5c')][_0x2ff2('0x77')];return db[_0x2ff2('0x89')]['create'](_0x4d4c7e,{'fields':_0x1f40d5,'raw':!![]});}})[_0x2ff2('0x21')](handleEntityNotFound(_0x5c0805,null))['then'](function(_0x3c7886){_0x2a5ccb['contact']=_0x3c7886;if(_0x3c7886){var _0xd54d={'ContactId':_0x3c7886['id'],'OpenchannelAccountId':_0x4f0f9f[_0x2ff2('0x57')]['id'],'from':(_0x3c7886[_0x2ff2('0x8a')]||'')+'\x20'+(_0x3c7886[_0x2ff2('0x8b')]||'')};var _0x145633={'OpenchannelAccountId':_0x4f0f9f['params']['id'],'closed':![]};if(_0x4f0f9f['body'][_0x2ff2('0x8c')]){_0x145633['threadId']=_0x4f0f9f[_0x2ff2('0x5c')][_0x2ff2('0x8c')];return db[_0x2ff2('0x8d')][_0x2ff2('0x60')]({'where':_0x145633})[_0x2ff2('0x21')](function(_0xb1c06c){if(_0xb1c06c){return[_0xb1c06c,![]];}_0xd54d[_0x2ff2('0x8c')]=_0x4f0f9f[_0x2ff2('0x5c')][_0x2ff2('0x8c')];_0xd54d[_0x2ff2('0x8e')]=_0x4f0f9f[_0x2ff2('0x5c')][_0x2ff2('0x8e')];return db[_0x2ff2('0x8d')][_0x2ff2('0x5b')](_0xd54d)[_0x2ff2('0x21')](function(_0x2afa98){return[_0x2afa98,!![]];});});}else{_0x145633[_0x2ff2('0x8c')]=null;}_0x145633[_0x2ff2('0x8f')]=_0x3c7886['id'];return db['OpenchannelInteraction'][_0x2ff2('0x60')]({'where':_0x145633})['then'](function(_0x4424b5){if(_0x4424b5){return[_0x4424b5,![]];}return db[_0x2ff2('0x8d')]['create'](_0xd54d)['then'](function(_0x2bca73){return[_0x2bca73,!![]];});});}})[_0x2ff2('0x90')](function(_0x46dae2,_0x1a95f4){if(_0x46dae2){_0x43d404=_0x1a95f4;if(!_0x1a95f4){var _0x4f9afd={'from':(_0x2a5ccb[_0x2ff2('0x91')][_0x2ff2('0x8a')]||'')+'\x20'+(_0x2a5ccb[_0x2ff2('0x91')][_0x2ff2('0x8b')]||'')};if(_0x4f0f9f['body']['threadId']&&_0x4f0f9f[_0x2ff2('0x5c')][_0x2ff2('0x92')]&&_0x4f0f9f[_0x2ff2('0x5c')]['threadId']!=_0x4f0f9f[_0x2ff2('0x5c')][_0x2ff2('0x92')]){_0x4f9afd[_0x2ff2('0x8c')]=_0x4f0f9f['body'][_0x2ff2('0x92')];}return _0x46dae2[_0x2ff2('0x35')](_0x4f9afd);}else{return _0x46dae2;}}})[_0x2ff2('0x21')](function(_0x44710b){_0x2a5ccb['interaction']=_0x44710b[_0x2ff2('0x37')]({'plain':!![]});_0x2a5ccb[_0x2ff2('0x93')][_0x2ff2('0x94')]=_0x43d404;if(_0x2a5ccb[_0x2ff2('0x93')]['created']){if(_0x2a5ccb[_0x2ff2('0x88')]['autoclose']){_0x2a5ccb[_0x2ff2('0x83')][_0x2ff2('0x95')]({'id':0x0,'priority':_0x2a5ccb[_0x2ff2('0x83')][_0x2ff2('0x5a')]+0x1,'app':_0x2ff2('0x96'),'appdata':'unmanaged','interval':_0x2ff2('0x97')});}}return db[_0x2ff2('0x98')][_0x2ff2('0x5b')]({'body':_0x4f0f9f[_0x2ff2('0x5c')]['body'],'OpenchannelAccountId':_0x4f0f9f[_0x2ff2('0x57')]['id'],'OpenchannelInteractionId':_0x44710b['id'],'direction':'in','ContactId':_0x2a5ccb[_0x2ff2('0x91')]['id'],'AttachmentId':_0x4f0f9f[_0x2ff2('0x5c')][_0x2ff2('0x99')]});})[_0x2ff2('0x21')](function(_0xba45de){_0x2a5ccb['message']=_0xba45de;if(!_0x2a5ccb[_0x2ff2('0x93')][_0x2ff2('0x9a')])return;return db[_0x2ff2('0x9b')][_0x2ff2('0x60')]({'attributes':['id',_0x2ff2('0x3a')],'where':{'id':_0x2a5ccb[_0x2ff2('0x93')]['UserId']}});})['then'](function(_0xc7b532){if(_0xc7b532){_0x2a5ccb[_0x2ff2('0x83')][_0x2ff2('0x9c')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xc7b532[_0x2ff2('0x3a')]+','+(_0x2a5ccb[_0x2ff2('0x88')]['waitForTheAssignedAgent']||0xa),'interval':_0x2ff2('0x97')});}if(!_0x2a5ccb[_0x2ff2('0x93')]['queueId'])return;return db[_0x2ff2('0x9d')][_0x2ff2('0x60')]({'attributes':['id',_0x2ff2('0x3a')],'where':{'id':_0x2a5ccb[_0x2ff2('0x93')][_0x2ff2('0x9e')]}});})['then'](function(_0x6370f0){if(_0x6370f0){_0x2a5ccb[_0x2ff2('0x83')][_0x2ff2('0x9c')]({'id':0x0,'priority':0x1,'app':_0x2ff2('0x9f'),'appdata':_0x6370f0['name']+','+(_0x2a5ccb[_0x2ff2('0x88')][_0x2ff2('0xa0')]||0x12c),'interval':_0x2ff2('0x97')});}return respondWithRpcPromise(_0x2ff2('0xa1'),'startRouting',_0x2a5ccb);})[_0x2ff2('0x21')](function(_0x1e6781){respondWithRpcPromise(_0x2ff2('0xa2'),_0x2ff2('0xa2'),{'event':_0x2ff2('0x6e'),'message':_0x1e6781},client9002);return _0x1e6781;})[_0x2ff2('0x21')](respondWithResult(_0x5c0805,null))[_0x2ff2('0x55')](handleError(_0x5c0805,null));};exports['addApplications']=function(_0x31fab8,_0x681ea4){var _0x2689c3=_0x31fab8[_0x2ff2('0x57')]['id'];var _0x289a9b=_0x31fab8[_0x2ff2('0x5c')];var _0xdaaf09=0xc8;var _0x129c6a=null;return db[_0x2ff2('0xa3')][_0x2ff2('0xa4')]({'isolationLevel':db[_0x2ff2('0xa3')][_0x2ff2('0xa5')]['ISOLATION_LEVELS'][_0x2ff2('0xa6')]},function(_0x12dde7){return db['OpenchannelAccount'][_0x2ff2('0x6b')]({'where':{'id':_0x2689c3},'transaction':_0x12dde7})[_0x2ff2('0x21')](function(_0x213f55){if(_0x213f55){return db[_0x2ff2('0x81')]['destroy']({'where':{'OpenchannelAccountId':_0x2689c3},'transaction':_0x12dde7})[_0x2ff2('0x21')](function(){var _0x3dcf68=_[_0x2ff2('0x3e')](_0x289a9b,function(_0x42e3d8){_0x42e3d8[_0x2ff2('0x64')]=_0x2689c3;return _0x42e3d8;});return db[_0x2ff2('0x81')][_0x2ff2('0xa7')](_0x3dcf68,{'transaction':_0x12dde7});});}else{_0xdaaf09=0x194;_0x129c6a=[];}});})[_0x2ff2('0x21')](function(){if(_0xdaaf09!==0x194){return db[_0x2ff2('0x81')][_0x2ff2('0xa8')]({'where':{'OpenchannelAccountId':_0x2689c3},'order':_0x2ff2('0x86')})['then'](function(_0x24cb95){_0x129c6a=_0x24cb95;});}})[_0x2ff2('0x55')](function(_0x21b678){_0xdaaf09=0x1f4;logger[_0x2ff2('0x28')](_0x21b678[_0x2ff2('0x39')]);if(_0x21b678['name']){delete _0x21b678[_0x2ff2('0x3a')];}_0x129c6a=_0x21b678;})[_0x2ff2('0xa9')](function(){if(_0x129c6a===null){_0x681ea4[_0x2ff2('0x2b')](_0xdaaf09);}else{if(_0xdaaf09===0x1f4){_0x681ea4[_0x2ff2('0x2c')](_0xdaaf09)[_0x2ff2('0x3b')](_0x129c6a);}else{_0x681ea4[_0x2ff2('0x2c')](_0xdaaf09)['json'](_0x129c6a);}}});};exports[_0x2ff2('0xaa')]=function(_0x2ff050,_0x48d8e9,_0x14c308){var _0x3f3b41={};var _0x1b2176={};var _0x1757c7;var _0x7c347;return db[_0x2ff2('0x3f')][_0x2ff2('0x6b')]({'where':{'id':_0x2ff050['params']['id']}})[_0x2ff2('0x21')](handleEntityNotFound(_0x48d8e9,null))[_0x2ff2('0x21')](function(_0x42e352){if(_0x42e352){_0x1757c7=_0x42e352;_0x1b2176[_0x2ff2('0x43')]=_['keys'](db[_0x2ff2('0x81')][_0x2ff2('0x40')]);_0x1b2176['query']=_[_0x2ff2('0x59')](_0x2ff050['query']);_0x1b2176[_0x2ff2('0x4d')]=_[_0x2ff2('0x45')](_0x1b2176[_0x2ff2('0x43')],_0x1b2176[_0x2ff2('0x44')]);_0x3f3b41[_0x2ff2('0x46')]=_[_0x2ff2('0x45')](_0x1b2176[_0x2ff2('0x43')],qs[_0x2ff2('0x47')](_0x2ff050[_0x2ff2('0x44')][_0x2ff2('0x47')]));_0x3f3b41['attributes']=_0x3f3b41[_0x2ff2('0x46')]['length']?_0x3f3b41[_0x2ff2('0x46')]:_0x1b2176['model'];_0x3f3b41[_0x2ff2('0x4a')]=qs[_0x2ff2('0x4b')](_0x2ff050[_0x2ff2('0x44')][_0x2ff2('0x4b')]);_0x3f3b41['where']=qs[_0x2ff2('0x4d')](_[_0x2ff2('0x67')](_0x2ff050['query'],_0x1b2176[_0x2ff2('0x4d')]));if(_0x2ff050[_0x2ff2('0x44')][_0x2ff2('0x4e')]){_0x3f3b41['where']=_['merge'](_0x3f3b41[_0x2ff2('0x4c')],{'$or':_[_0x2ff2('0x3e')](_0x3f3b41[_0x2ff2('0x46')],function(_0x48e02f){var _0x577ac3={};_0x577ac3[_0x48e02f]={'$like':'%'+_0x2ff050[_0x2ff2('0x44')][_0x2ff2('0x4e')]+'%'};return _0x577ac3;})});}_0x3f3b41=_[_0x2ff2('0x4f')]({},_0x3f3b41,_0x2ff050[_0x2ff2('0x51')]);return _0x1757c7['getApplications'](_0x3f3b41);}})[_0x2ff2('0x21')](function(_0x5be92a){if(_0x5be92a){_0x7c347=_0x5be92a[_0x2ff2('0x5a')];if(!_0x2ff050[_0x2ff2('0x44')][_0x2ff2('0x48')](_0x2ff2('0x49'))){_0x3f3b41['limit']=qs[_0x2ff2('0x30')](_0x2ff050[_0x2ff2('0x44')]['limit']);_0x3f3b41['offset']=qs['offset'](_0x2ff050[_0x2ff2('0x44')]['offset']);}return _0x1757c7[_0x2ff2('0xaa')](_0x3f3b41);}})[_0x2ff2('0x21')](function(_0x344110){if(_0x344110){return _0x344110?{'count':_0x7c347,'rows':_0x344110}:null;}})[_0x2ff2('0x21')](respondWithResult(_0x48d8e9,null))['catch'](handleError(_0x48d8e9,null));};exports[_0x2ff2('0xab')]=function(_0x4adaf8,_0x5121f3,_0x252c48){var _0x317cfe={'raw':![],'where':{}};var _0x4df228={};var _0x131375={'count':0x0,'rows':[]};return db[_0x2ff2('0x3f')]['findOne']({'where':{'id':_0x4adaf8[_0x2ff2('0x57')]['id']}})[_0x2ff2('0x21')](handleEntityNotFound(_0x5121f3,null))[_0x2ff2('0x21')](function(_0x1b0e09){if(_0x1b0e09){_0x4df228[_0x2ff2('0x43')]=_['keys'](db[_0x2ff2('0x8d')][_0x2ff2('0x40')]);_0x4df228['query']=_[_0x2ff2('0x59')](_0x4adaf8['query']);_0x4df228['filters']=_[_0x2ff2('0x45')](_0x4df228[_0x2ff2('0x43')],_0x4df228[_0x2ff2('0x44')]);_0x317cfe[_0x2ff2('0x46')]=_['intersection'](_0x4df228['model'],qs[_0x2ff2('0x47')](_0x4adaf8[_0x2ff2('0x44')][_0x2ff2('0x47')]));_0x317cfe[_0x2ff2('0x46')]=_0x317cfe[_0x2ff2('0x46')][_0x2ff2('0x5a')]?_0x317cfe[_0x2ff2('0x46')]:_0x4df228[_0x2ff2('0x43')];if(!_0x4adaf8[_0x2ff2('0x44')][_0x2ff2('0x48')](_0x2ff2('0x49'))){_0x317cfe[_0x2ff2('0x30')]=qs[_0x2ff2('0x30')](_0x4adaf8[_0x2ff2('0x44')][_0x2ff2('0x30')]);_0x317cfe[_0x2ff2('0x2e')]=qs[_0x2ff2('0x2e')](_0x4adaf8[_0x2ff2('0x44')][_0x2ff2('0x2e')]);}_0x317cfe[_0x2ff2('0x4a')]=qs[_0x2ff2('0x4b')](_0x4adaf8[_0x2ff2('0x44')][_0x2ff2('0x4b')]);_0x317cfe['where']=qs[_0x2ff2('0x4d')](_[_0x2ff2('0x67')](_0x4adaf8[_0x2ff2('0x44')],_0x4df228[_0x2ff2('0x4d')]));_0x317cfe[_0x2ff2('0x4c')]['OpenchannelAccountId']=_0x1b0e09['id'];if(_0x4adaf8[_0x2ff2('0x44')][_0x2ff2('0x4e')]){_0x317cfe['where']=_['merge'](_0x317cfe[_0x2ff2('0x4c')],{'$or':_[_0x2ff2('0x3e')](_0x317cfe[_0x2ff2('0x46')],function(_0x518b88){var _0x56b9c9={};_0x56b9c9[_0x518b88]={'$like':'%'+_0x4adaf8[_0x2ff2('0x44')][_0x2ff2('0x4e')]+'%'};return _0x56b9c9;})});}_0x317cfe=_[_0x2ff2('0x4f')]({},_0x317cfe,_0x4adaf8[_0x2ff2('0x51')]);return db['OpenchannelInteraction'][_0x2ff2('0x31')]({'where':_0x317cfe[_0x2ff2('0x4c')]})[_0x2ff2('0x21')](function(_0x466e70){_0x131375['count']=_0x466e70;if(_0x4adaf8['query'][_0x2ff2('0x52')]){_0x317cfe[_0x2ff2('0x53')]=[{'model':db[_0x2ff2('0x89')],'as':_0x2ff2('0xac'),'required':![]},{'model':db[_0x2ff2('0x9b')],'as':_0x2ff2('0xad'),'attributes':[_0x2ff2('0x3a'),_0x2ff2('0xae'),'internal'],'required':![]},{'model':db[_0x2ff2('0xaf')],'as':_0x2ff2('0xb0'),'attributes':['id',_0x2ff2('0x3a'),_0x2ff2('0xb1')],'where':_0x4adaf8[_0x2ff2('0x44')][_0x2ff2('0xb2')]?{'id':_0x4adaf8[_0x2ff2('0x44')][_0x2ff2('0xb2')]}:undefined,'required':_0x4adaf8[_0x2ff2('0x44')][_0x2ff2('0xb2')]?!![]:![]}];}return db[_0x2ff2('0x8d')]['findAll'](_0x317cfe);})[_0x2ff2('0x21')](function(_0x1a355d){_0x131375['rows']=_0x1a355d;return _0x131375;});}})[_0x2ff2('0x21')](respondWithFilteredResult(_0x5121f3,_0x317cfe))[_0x2ff2('0x55')](handleError(_0x5121f3,null));};exports[_0x2ff2('0xb3')]=function(_0x2eda78,_0x446f7a,_0x43e717){return db[_0x2ff2('0x3f')][_0x2ff2('0x60')]({'where':{'id':_0x2eda78['params']['id']}})['then'](handleEntityNotFound(_0x446f7a,null))[_0x2ff2('0x21')](function(_0x5ace94){if(_0x5ace94){return _0x5ace94[_0x2ff2('0xb3')](_0x2eda78[_0x2ff2('0x5c')][_0x2ff2('0x69')],_['omit'](_0x2eda78[_0x2ff2('0x5c')],[_0x2ff2('0x69'),'id'])||{})[_0x2ff2('0x90')](function(_0x37630d){for(var _0x3eb266=0x0;_0x3eb266<_0x2eda78[_0x2ff2('0x5c')][_0x2ff2('0x69')][_0x2ff2('0x5a')];_0x3eb266+=0x1){socket[_0x2ff2('0xb4')](_0x2ff2('0xb5'),{'UserId':Number(_0x2eda78[_0x2ff2('0x5c')][_0x2ff2('0x69')][_0x3eb266]),'OpenchannelAccountId':Number(_0x2eda78[_0x2ff2('0x57')]['id'])});}return _0x37630d;});}})['then'](respondWithResult(_0x446f7a,null))[_0x2ff2('0x55')](handleError(_0x446f7a,null));};exports['removeAgents']=function(_0xb3bde0,_0x3aaf9f,_0x48dd7c){return db['OpenchannelAccount']['find']({'where':{'id':_0xb3bde0['params']['id']}})['then'](handleEntityNotFound(_0x3aaf9f,null))[_0x2ff2('0x21')](function(_0x1ae9b0){if(_0x1ae9b0){return _0x1ae9b0[_0x2ff2('0xb6')](_0xb3bde0['query']['ids'])['then'](function(){if(_[_0x2ff2('0xb7')](_0xb3bde0['query'][_0x2ff2('0x69')])){for(var _0x185cac=0x0;_0x185cac<_0xb3bde0[_0x2ff2('0x44')][_0x2ff2('0x69')]['length'];_0x185cac+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0xb3bde0[_0x2ff2('0x44')]['ids'][_0x185cac]),'OpenchannelAccountId':Number(_0xb3bde0['params']['id'])});}}else{socket[_0x2ff2('0xb4')](_0x2ff2('0xb8'),{'UserId':Number(_0xb3bde0[_0x2ff2('0x44')][_0x2ff2('0x69')]),'OpenchannelAccountId':Number(_0xb3bde0[_0x2ff2('0x57')]['id'])});}});}})[_0x2ff2('0x21')](respondWithStatusCode(_0x3aaf9f,null))[_0x2ff2('0x55')](handleError(_0x3aaf9f,null));};exports[_0x2ff2('0xb9')]=function(_0x2233f9,_0x56f2de,_0x23e279){var _0x1b060e={};var _0x3d0077={};var _0x4813b2;var _0x4866c1;return db[_0x2ff2('0x3f')][_0x2ff2('0x6b')]({'where':{'id':_0x2233f9[_0x2ff2('0x57')]['id']}})['then'](handleEntityNotFound(_0x56f2de,null))[_0x2ff2('0x21')](function(_0x2899a8){if(_0x2899a8){_0x4813b2=_0x2899a8;_0x3d0077[_0x2ff2('0x43')]=_[_0x2ff2('0x59')](db[_0x2ff2('0x9b')][_0x2ff2('0x40')]);_0x3d0077['query']=_[_0x2ff2('0x59')](_0x2233f9[_0x2ff2('0x44')]);_0x3d0077['filters']=_[_0x2ff2('0x45')](_0x3d0077[_0x2ff2('0x43')],_0x3d0077[_0x2ff2('0x44')]);_0x1b060e[_0x2ff2('0x46')]=_[_0x2ff2('0x45')](_0x3d0077[_0x2ff2('0x43')],qs[_0x2ff2('0x47')](_0x2233f9[_0x2ff2('0x44')][_0x2ff2('0x47')]));_0x1b060e['attributes']=_0x1b060e[_0x2ff2('0x46')][_0x2ff2('0x5a')]?_0x1b060e['attributes']:_0x3d0077[_0x2ff2('0x43')];_0x1b060e[_0x2ff2('0x4a')]=qs[_0x2ff2('0x4b')](_0x2233f9[_0x2ff2('0x44')][_0x2ff2('0x4b')]);_0x1b060e[_0x2ff2('0x4c')]=qs[_0x2ff2('0x4d')](_[_0x2ff2('0x67')](_0x2233f9['query'],_0x3d0077[_0x2ff2('0x4d')]));if(_0x2233f9[_0x2ff2('0x44')][_0x2ff2('0x4e')]){_0x1b060e[_0x2ff2('0x4c')]=_['merge'](_0x1b060e['where'],{'$or':_[_0x2ff2('0x3e')](_0x1b060e[_0x2ff2('0x46')],function(_0x22a6a1){var _0xe236bf={};_0xe236bf[_0x22a6a1]={'$like':'%'+_0x2233f9[_0x2ff2('0x44')][_0x2ff2('0x4e')]+'%'};return _0xe236bf;})});}_0x1b060e=_[_0x2ff2('0x4f')]({},_0x1b060e,_0x2233f9['options']);return _0x4813b2['getAgents'](_0x1b060e);}})[_0x2ff2('0x21')](function(_0xd3bc04){if(_0xd3bc04){_0x4866c1=_0xd3bc04['length'];if(!_0x2233f9[_0x2ff2('0x44')][_0x2ff2('0x48')]('nolimit')){_0x1b060e[_0x2ff2('0x30')]=qs[_0x2ff2('0x30')](_0x2233f9['query']['limit']);_0x1b060e[_0x2ff2('0x2e')]=qs[_0x2ff2('0x2e')](_0x2233f9[_0x2ff2('0x44')][_0x2ff2('0x2e')]);}return _0x4813b2['getAgents'](_0x1b060e);}})[_0x2ff2('0x21')](function(_0x4d2276){if(_0x4d2276){return _0x4d2276?{'count':_0x4866c1,'rows':_0x4d2276}:null;}})[_0x2ff2('0x21')](respondWithResult(_0x56f2de,null))['catch'](handleError(_0x56f2de,null));};exports[_0x2ff2('0x3b')]=function(_0x139dbc,_0x2d41ae,_0x546526){var _0x5a7248,_0x45e81c,_0x33a155;if(_[_0x2ff2('0x76')](_0x139dbc[_0x2ff2('0x5c')][_0x2ff2('0x5c')])||_0x139dbc[_0x2ff2('0x5c')]['body']===''){throw new db[(_0x2ff2('0x6f'))][(_0x2ff2('0x78'))](_0x2ff2('0x7a'));}if(_[_0x2ff2('0x76')](_0x139dbc[_0x2ff2('0x5c')]['to'])){}_0x5a7248=_0x139dbc[_0x2ff2('0x5c')]['to'];return db[_0x2ff2('0x3f')][_0x2ff2('0x6b')]({'where':{'id':_0x139dbc[_0x2ff2('0x57')]['id']}})['then'](handleEntityNotFound(_0x2d41ae,null))[_0x2ff2('0x21')](function(_0x955bc6){if(_0x955bc6){return db[_0x2ff2('0x3f')][_0x2ff2('0x60')]({'where':{'id':_0x955bc6['id']},'include':[{'model':db[_0x2ff2('0x7d')],'as':'List','include':[{'model':db[_0x2ff2('0x89')],'as':_0x2ff2('0x7f'),'where':{[_0x955bc6['mapKey']]:_0x5a7248},'limit':0x1,'order':[['updatedAt',_0x2ff2('0x80')]]}]}]})[_0x2ff2('0x21')](handleEntityNotFound(_0x2d41ae,null))[_0x2ff2('0x21')](function(_0x3dd8a6){if(_0x3dd8a6&&_0x3dd8a6[_0x2ff2('0x7e')]){_0x45e81c=_0x3dd8a6[_0x2ff2('0x37')]({'plain':!![]});if(_0x45e81c[_0x2ff2('0x7e')]&&_0x45e81c[_0x2ff2('0x7e')]['Contacts']['length']){return _0x45e81c[_0x2ff2('0x7e')][_0x2ff2('0x7f')][0x0];}return db[_0x2ff2('0x89')][_0x2ff2('0x5b')](_[_0x2ff2('0x1b')](_0x139dbc['body'],{'firstName':_0x5a7248,[_0x3dd8a6[_0x2ff2('0x7b')]]:_0x5a7248,'phone':_0x5a7248,'ListId':_0x45e81c[_0x2ff2('0x75')]}));}})['then'](handleEntityNotFound(_0x2d41ae,null))[_0x2ff2('0x21')](function(_0x5bd8b0){if(_0x5bd8b0){_0x33a155=_0x5bd8b0;return db[_0x2ff2('0x8d')][_0x2ff2('0x60')]({'where':{'ContactId':_0x33a155['id'],'closed':![],'OpenchannelAccountId':_0x45e81c['id']}})['then'](function(_0xe8f9ba){if(_0xe8f9ba){return[_0xe8f9ba,![]];}return db['OpenchannelInteraction'][_0x2ff2('0x5b')]({'UserId':_0x139dbc['user']['id'],'ContactId':_0x33a155['id'],'OpenchannelAccountId':_0x45e81c['id'],'lastMsgDirection':_0x2ff2('0xba'),'firstMsgDirection':_0x2ff2('0xba'),'Messages':[_[_0x2ff2('0x4f')](_0x139dbc[_0x2ff2('0x5c')],{'read':![],'body':_0x139dbc[_0x2ff2('0x5c')][_0x2ff2('0x5c')],'OpenchannelAccountId':_0x45e81c['id'],'UserId':_0x139dbc['user']['id'],'ContactId':_0x33a155['id']})]},{'include':[{'model':db[_0x2ff2('0x98')],'as':'Messages'}]})[_0x2ff2('0x21')](function(_0x2dd857){return[_0x2dd857,!![]];});});}})['spread'](function(_0x505439,_0x4eabc9){if(_0x4eabc9){return _0x505439;}return db[_0x2ff2('0x98')][_0x2ff2('0x5b')](_['merge'](_0x139dbc[_0x2ff2('0x5c')],{'read':![],'body':_0x139dbc[_0x2ff2('0x5c')][_0x2ff2('0x5c')],'OpenchannelAccountId':_0x45e81c['id'],'OpenchannelInteractionId':_0x505439['id'],'UserId':_0x139dbc['user']['id'],'ContactId':_0x33a155['id']}))['then'](function(_0x39fb44){_0x505439[_0x2ff2('0xbb')][_0x2ff2('0xbc')]=[];_0x505439[_0x2ff2('0xbb')][_0x2ff2('0xbc')][_0x2ff2('0x95')](_0x39fb44[_0x2ff2('0xbb')]);return _0x505439;});});}})[_0x2ff2('0x21')](respondWithResult(_0x2d41ae,null))[_0x2ff2('0x55')](handleError(_0x2d41ae,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index ece3688..aaff35b 100644 --- a/server/api/openchannelAccount/openchannelAccount.events.js +++ b/server/api/openchannelAccount/openchannelAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','update','emit'];(function(_0x5a1a51,_0x144c79){var _0x47edd7=function(_0x2259bb){while(--_0x2259bb){_0x5a1a51['push'](_0x5a1a51['shift']());}};_0x47edd7(++_0x144c79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var OpenchannelAccount=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){OpenchannelAccountEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);OpenchannelAccountEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];OpenchannelAccount[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x41bb=['../../mysqldb','setMaxListeners','update','remove','emit','events'];(function(_0x1a62d2,_0x4dfece){var _0x3ee9db=function(_0x454904){while(--_0x454904){_0x1a62d2['push'](_0x1a62d2['shift']());}};_0x3ee9db(++_0x4dfece);}(_0x41bb,0xc5));var _0xb41b=function(_0xf94701,_0x2b537f){_0xf94701=_0xf94701-0x0;var _0x548e0f=_0x41bb[_0xf94701];return _0x548e0f;};'use strict';var EventEmitter=require(_0xb41b('0x0'));var OpenchannelAccount=require(_0xb41b('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb41b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb41b('0x3'),'afterDestroy':_0xb41b('0x4')};function emitEvent(_0x148333){return function(_0x448c8e,_0x4ee21b,_0x12cea3){OpenchannelAccountEvents[_0xb41b('0x5')](_0x148333+':'+_0x448c8e['id'],_0x448c8e);OpenchannelAccountEvents[_0xb41b('0x5')](_0x148333,_0x448c8e);_0x12cea3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 8f99dfc..76e611c 100644 --- a/server/api/openchannelAccount/openchannelAccount.model.js +++ b/server/api/openchannelAccount/openchannelAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x39f44f,_0x3a91e3){var _0x9c6575=function(_0x1d3066){while(--_0x1d3066){_0x39f44f['push'](_0x39f44f['shift']());}};_0x9c6575(++_0x3a91e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2175d3,_0x50255a){var _0x131fc5=function(_0x3433fb){while(--_0x3433fb){_0x2175d3['push'](_0x2175d3['shift']());}};_0x131fc5(++_0x50255a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index d8e7462..5d8545d 100644 --- a/server/api/openchannelAccount/openchannelAccount.rpc.js +++ b/server/api/openchannelAccount/openchannelAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed3c=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','localhost','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment'];(function(_0x3064fc,_0x32afc6){var _0x26f3a5=function(_0x532042){while(--_0x532042){_0x3064fc['push'](_0x3064fc['shift']());}};_0x26f3a5(++_0x32afc6);}(_0xed3c,0x1a6));var _0xced3=function(_0x592d77,_0x5267ed){_0x592d77=_0x592d77-0x0;var _0x4b905d=_0xed3c[_0x592d77];return _0x4b905d;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));var BPromise=require(_0xced3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced3('0x4'));var db=require(_0xced3('0x5'))['db'];var utils=require(_0xced3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xced3('0x7'));var jayson=require(_0xced3('0x8'));var client=jayson[_0xced3('0x9')][_0xced3('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xced3('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0xced3('0xc')](socket);function respondWithRpcPromise(_0x321c42,_0x3e5a04,_0x12612f){return new BPromise(function(_0x1cb639,_0x5934b2){return client[_0xced3('0xd')](_0x321c42,_0x12612f)[_0xced3('0xe')](function(_0x3da0ff){logger['info'](_0xced3('0xf'),_0x3e5a04,_0xced3('0x10'));logger[_0xced3('0x11')](_0xced3('0x12'),_0x3e5a04,_0xced3('0x10'),JSON[_0xced3('0x13')](_0x3da0ff));if(_0x3da0ff[_0xced3('0x14')]){if(_0x3da0ff['error'][_0xced3('0x15')]===0x1f4){logger['error'](_0xced3('0xf'),_0x3e5a04,_0x3da0ff[_0xced3('0x14')][_0xced3('0x16')]);return _0x5934b2(_0x3da0ff[_0xced3('0x14')]['message']);}logger[_0xced3('0x14')](_0xced3('0xf'),_0x3e5a04,_0x3da0ff['error'][_0xced3('0x16')]);return _0x1cb639(_0x3da0ff[_0xced3('0x14')][_0xced3('0x16')]);}else{logger[_0xced3('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x3e5a04,_0xced3('0x10'));_0x1cb639(_0x3da0ff['result'][_0xced3('0x16')]);}})[_0xced3('0x18')](function(_0x32c402){logger[_0xced3('0x14')](_0xced3('0xf'),_0x3e5a04,_0x32c402);_0x5934b2(_0x32c402);});});} \ No newline at end of file +var _0x6f2f=['socket.io-emitter','./openchannelAccount.socket','register','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost'];(function(_0x26ae1a,_0x11822e){var _0x383023=function(_0x2af671){while(--_0x2af671){_0x26ae1a['push'](_0x26ae1a['shift']());}};_0x383023(++_0x11822e);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x6f2f[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0xf6f2('0x0'));var util=require(_0xf6f2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6f2('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf6f2('0x3'))(_0xf6f2('0x4'));var config=require(_0xf6f2('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf6f2('0x6')]({'port':0x232a});config[_0xf6f2('0x7')]=_[_0xf6f2('0x8')](config[_0xf6f2('0x7')],{'host':_0xf6f2('0x9'),'port':0x18eb});var socket=require(_0xf6f2('0xa'))(new Redis(config[_0xf6f2('0x7')]));require(_0xf6f2('0xb'))[_0xf6f2('0xc')](socket);function respondWithRpcPromise(_0x17ffd2,_0x55a260,_0x109271){return new BPromise(function(_0x266c6e,_0x2a4325){return client[_0xf6f2('0xd')](_0x17ffd2,_0x109271)['then'](function(_0x4ca76a){logger['info'](_0xf6f2('0xe'),_0x55a260,_0xf6f2('0xf'));logger[_0xf6f2('0x10')](_0xf6f2('0x11'),_0x55a260,_0xf6f2('0xf'),JSON[_0xf6f2('0x12')](_0x4ca76a));if(_0x4ca76a['error']){if(_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x14')]===0x1f4){logger[_0xf6f2('0x13')](_0xf6f2('0xe'),_0x55a260,_0x4ca76a[_0xf6f2('0x13')]['message']);return _0x2a4325(_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x15')]);}logger[_0xf6f2('0x13')](_0xf6f2('0xe'),_0x55a260,_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x15')]);return _0x266c6e(_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x15')]);}else{logger[_0xf6f2('0x16')](_0xf6f2('0xe'),_0x55a260,_0xf6f2('0xf'));_0x266c6e(_0x4ca76a[_0xf6f2('0x17')][_0xf6f2('0x15')]);}})[_0xf6f2('0x18')](function(_0xb05611){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x55a260,_0xb05611);_0x2a4325(_0xb05611);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 5089bef..7158baa 100644 --- a/server/api/openchannelAccount/openchannelAccount.socket.js +++ b/server/api/openchannelAccount/openchannelAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa12=['register','openchannelAccount:','./openchannelAccount.events','save','update','removeListener'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xfa12,0x1b2));var _0x2fa1=function(_0x5d3676,_0x24edeb){_0x5d3676=_0x5d3676-0x0;var _0x504f5b=_0xfa12[_0x5d3676];return _0x504f5b;};'use strict';var OpenchannelAccountEvents=require(_0x2fa1('0x0'));var events=[_0x2fa1('0x1'),'remove',_0x2fa1('0x2')];function createListener(_0x1d3d90,_0x1abe62){return function(_0x877ea9){_0x1abe62['emit'](_0x1d3d90,_0x877ea9);};}function removeListener(_0x2022bf,_0x358fe1){return function(){OpenchannelAccountEvents[_0x2fa1('0x3')](_0x2022bf,_0x358fe1);};}exports[_0x2fa1('0x4')]=function(_0x4d61b0){for(var _0x166949=0x0,_0x25b233=events['length'];_0x166949<_0x25b233;_0x166949++){var _0x3449c3=events[_0x166949];var _0x30a897=createListener(_0x2fa1('0x5')+_0x3449c3,_0x4d61b0);OpenchannelAccountEvents['on'](_0x3449c3,_0x30a897);}}; \ No newline at end of file +var _0x4198=['openchannelAccount:','./openchannelAccount.events','remove','update','emit','removeListener','register','length'];(function(_0x24426e,_0x1da83f){var _0x25130c=function(_0x2170e2){while(--_0x2170e2){_0x24426e['push'](_0x24426e['shift']());}};_0x25130c(++_0x1da83f);}(_0x4198,0x69));var _0x8419=function(_0x29e5bd,_0xc40aa4){_0x29e5bd=_0x29e5bd-0x0;var _0x2a56a1=_0x4198[_0x29e5bd];return _0x2a56a1;};'use strict';var OpenchannelAccountEvents=require(_0x8419('0x0'));var events=['save',_0x8419('0x1'),_0x8419('0x2')];function createListener(_0x29612a,_0x1e7a2f){return function(_0x182359){_0x1e7a2f[_0x8419('0x3')](_0x29612a,_0x182359);};}function removeListener(_0x1eaff0,_0xc19396){return function(){OpenchannelAccountEvents[_0x8419('0x4')](_0x1eaff0,_0xc19396);};}exports[_0x8419('0x5')]=function(_0x502e00){for(var _0x1f5bfe=0x0,_0x839abf=events[_0x8419('0x6')];_0x1f5bfe<_0x839abf;_0x1f5bfe++){var _0x2043cd=events[_0x1f5bfe];var _0x45c2b5=createListener(_0x8419('0x7')+_0x2043cd,_0x502e00);OpenchannelAccountEvents['on'](_0x2043cd,_0x45c2b5);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index d250370..2bdc1b9 100644 --- a/server/api/openchannelApplication/index.js +++ b/server/api/openchannelApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed3a=['get','/:id','isAuthenticated','show','post','create','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./openchannelApplication.controller'];(function(_0x4137ce,_0x3b7c0d){var _0x2bbd00=function(_0x32b1d2){while(--_0x32b1d2){_0x4137ce['push'](_0x4137ce['shift']());}};_0x2bbd00(++_0x3b7c0d);}(_0xed3a,0x107));var _0xaed3=function(_0x69fe7b,_0x54ff0e){_0x69fe7b=_0x69fe7b-0x0;var _0x283612=_0xed3a[_0x69fe7b];return _0x283612;};'use strict';var multer=require('multer');var util=require(_0xaed3('0x0'));var path=require(_0xaed3('0x1'));var timeout=require(_0xaed3('0x2'));var express=require(_0xaed3('0x3'));var router=express['Router']();var fs_extra=require(_0xaed3('0x4'));var auth=require(_0xaed3('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaed3('0x6'));router[_0xaed3('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xaed3('0x7')](_0xaed3('0x8'),auth[_0xaed3('0x9')](),controller[_0xaed3('0xa')]);router[_0xaed3('0xb')]('/',auth[_0xaed3('0x9')](),controller[_0xaed3('0xc')]);router['put'](_0xaed3('0x8'),auth[_0xaed3('0x9')](),controller['update']);router[_0xaed3('0xd')](_0xaed3('0x8'),auth[_0xaed3('0x9')](),controller[_0xaed3('0xe')]);module['exports']=router; \ No newline at end of file +var _0xa554=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','index','/:id','isAuthenticated','post','put','update','destroy','exports','util','connect-timeout','express'];(function(_0x2200c3,_0x4bc3de){var _0x249217=function(_0x530339){while(--_0x530339){_0x2200c3['push'](_0x2200c3['shift']());}};_0x249217(++_0x4bc3de);}(_0xa554,0xb1));var _0x4a55=function(_0x3e2d1c,_0x26a2b5){_0x3e2d1c=_0x3e2d1c-0x0;var _0x2d0908=_0xa554[_0x3e2d1c];return _0x2d0908;};'use strict';var multer=require('multer');var util=require(_0x4a55('0x0'));var path=require('path');var timeout=require(_0x4a55('0x1'));var express=require(_0x4a55('0x2'));var router=express[_0x4a55('0x3')]();var fs_extra=require(_0x4a55('0x4'));var auth=require(_0x4a55('0x5'));var interaction=require(_0x4a55('0x6'));var config=require(_0x4a55('0x7'));var controller=require(_0x4a55('0x8'));router[_0x4a55('0x9')]('/',auth['isAuthenticated'](),controller[_0x4a55('0xa')]);router[_0x4a55('0x9')](_0x4a55('0xb'),auth[_0x4a55('0xc')](),controller['show']);router[_0x4a55('0xd')]('/',auth[_0x4a55('0xc')](),controller['create']);router[_0x4a55('0xe')](_0x4a55('0xb'),auth[_0x4a55('0xc')](),controller[_0x4a55('0xf')]);router['delete'](_0x4a55('0xb'),auth[_0x4a55('0xc')](),controller[_0x4a55('0x10')]);module[_0x4a55('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 91095bd..de5b617 100644 --- a/server/api/openchannelApplication/openchannelApplication.attributes.js +++ b/server/api/openchannelApplication/openchannelApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2e8=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x5e1d7a,_0x1af140){var _0x68a9f4=function(_0x122656){while(--_0x122656){_0x5e1d7a['push'](_0x5e1d7a['shift']());}};_0x68a9f4(++_0x1af140);}(_0xb2e8,0x1a6));var _0x8b2e=function(_0x1b2350,_0x99852e){_0x1b2350=_0x1b2350-0x0;var _0x416138=_0xb2e8[_0x1b2350];return _0x416138;};'use strict';var Sequelize=require(_0x8b2e('0x0'));module[_0x8b2e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x8b2e('0x2')],'allowNull':![],'defaultValue':_0x8b2e('0x3')},'appdata':{'type':Sequelize[_0x8b2e('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8b2e('0x2')],'defaultValue':_0x8b2e('0x5')}}; \ No newline at end of file +var _0xa6a9=['STRING','TEXT','*,*,*,*','exports'];(function(_0x4093bb,_0x12d5d8){var _0x349327=function(_0x405b7a){while(--_0x405b7a){_0x4093bb['push'](_0x4093bb['shift']());}};_0x349327(++_0x12d5d8);}(_0xa6a9,0xd3));var _0x9a6a=function(_0x2c18a8,_0x24eaa5){_0x2c18a8=_0x2c18a8-0x0;var _0x1e009a=_0xa6a9[_0x2c18a8];return _0x1e009a;};'use strict';var Sequelize=require('sequelize');module[_0x9a6a('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9a6a('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9a6a('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9a6a('0x1')],'defaultValue':_0x9a6a('0x3')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index ddb8e59..5e6accc 100644 --- a/server/api/openchannelApplication/openchannelApplication.controller.js +++ b/server/api/openchannelApplication/openchannelApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe16=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','name','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','map','options','OpenchannelApplication','includeAll','include','findAll','show','params','catch','create','body','find'];(function(_0x3f43ef,_0x4c2ba9){var _0x20af43=function(_0x17fb2b){while(--_0x17fb2b){_0x3f43ef['push'](_0x3f43ef['shift']());}};_0x20af43(++_0x4c2ba9);}(_0xfe16,0x10c));var _0x6fe1=function(_0x2c33cc,_0x93ad40){_0x2c33cc=_0x2c33cc-0x0;var _0x592c93=_0xfe16[_0x2c33cc];return _0x592c93;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6fe1('0x0'));var zipdir=require(_0x6fe1('0x1'));var jsonpatch=require(_0x6fe1('0x2'));var rp=require(_0x6fe1('0x3'));var moment=require('moment');var BPromise=require(_0x6fe1('0x4'));var Mustache=require(_0x6fe1('0x5'));var util=require('util');var path=require(_0x6fe1('0x6'));var sox=require('sox');var csv=require(_0x6fe1('0x7'));var ejs=require(_0x6fe1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6fe1('0x9'));var crypto=require(_0x6fe1('0xa'));var jsforce=require(_0x6fe1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6fe1('0x7'));var querystring=require(_0x6fe1('0xc'));var Papa=require(_0x6fe1('0xd'));var Redis=require(_0x6fe1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6fe1('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6fe1('0x10'))(_0x6fe1('0x11'));var utils=require(_0x6fe1('0x12'));var config=require(_0x6fe1('0x13'));var licenseUtil=require(_0x6fe1('0x14'));var db=require(_0x6fe1('0x15'))['db'];function respondWithStatusCode(_0x176260,_0x47ef37){_0x47ef37=_0x47ef37||0xcc;return function(_0x16509e){if(_0x16509e){return _0x176260['sendStatus'](_0x47ef37);}return _0x176260['status'](_0x47ef37)[_0x6fe1('0x16')]();};}function respondWithResult(_0x80996c,_0x218967){_0x218967=_0x218967||0xc8;return function(_0x446b07){if(_0x446b07){return _0x80996c[_0x6fe1('0x17')](_0x218967)[_0x6fe1('0x18')](_0x446b07);}};}function respondWithFilteredResult(_0x41fd67,_0x493243){return function(_0x2478c1){if(_0x2478c1){var _0x3b7619=typeof _0x493243[_0x6fe1('0x19')]==='undefined'&&typeof _0x493243[_0x6fe1('0x1a')]===_0x6fe1('0x1b');var _0x5230af=_0x2478c1[_0x6fe1('0x1c')];var _0x3ace2f=_0x3b7619?0x0:_0x493243[_0x6fe1('0x19')];var _0x4f3c33=_0x3b7619?_0x2478c1[_0x6fe1('0x1c')]:_0x493243[_0x6fe1('0x19')]+_0x493243['limit'];var _0x3b75da;if(_0x4f3c33>=_0x5230af){_0x4f3c33=_0x5230af;_0x3b75da=0xc8;}else{_0x3b75da=0xce;}_0x41fd67[_0x6fe1('0x17')](_0x3b75da);return _0x41fd67[_0x6fe1('0x1d')](_0x6fe1('0x1e'),_0x3ace2f+'-'+_0x4f3c33+'/'+_0x5230af)[_0x6fe1('0x18')](_0x2478c1);}return null;};}function patchUpdates(_0x3bb0df){return function(_0x1309a7){try{jsonpatch[_0x6fe1('0x1f')](_0x1309a7,_0x3bb0df,!![]);}catch(_0x402d70){return BPromise[_0x6fe1('0x20')](_0x402d70);}return _0x1309a7[_0x6fe1('0x21')]();};}function saveUpdates(_0x2b12c9,_0x3a9c3a){return function(_0x4d0d4b){if(_0x4d0d4b){return _0x4d0d4b[_0x6fe1('0x22')](_0x2b12c9)['then'](function(_0x538c78){return _0x538c78;});}return null;};}function removeEntity(_0x4c3773,_0x34cb93){return function(_0x183c8f){if(_0x183c8f){return _0x183c8f[_0x6fe1('0x23')]()[_0x6fe1('0x24')](function(){_0x4c3773['status'](0xcc)[_0x6fe1('0x16')]();});}};}function handleEntityNotFound(_0x1f375f,_0x5ddbe2){return function(_0x344a0c){if(!_0x344a0c){_0x1f375f[_0x6fe1('0x25')](0x194);}return _0x344a0c;};}function handleError(_0x48ee2f,_0x4081d9){_0x4081d9=_0x4081d9||0x1f4;return function(_0x36c2f9){logger['error'](_0x36c2f9['stack']);if(_0x36c2f9[_0x6fe1('0x26')]){delete _0x36c2f9['name'];}_0x48ee2f[_0x6fe1('0x17')](_0x4081d9)['send'](_0x36c2f9);};}exports['index']=function(_0x2a8d5c,_0x2e1705){var _0x528092={},_0x2781fb={},_0x558aa2={'count':0x0,'rows':[]};var _0x13132f=_['map'](db['OpenchannelApplication']['rawAttributes'],function(_0x4c30c4){return{'name':_0x4c30c4[_0x6fe1('0x27')],'type':_0x4c30c4[_0x6fe1('0x28')]['key']};});_0x2781fb[_0x6fe1('0x29')]=_['map'](_0x13132f,'name');_0x2781fb[_0x6fe1('0x2a')]=_[_0x6fe1('0x2b')](_0x2a8d5c[_0x6fe1('0x2a')]);_0x2781fb[_0x6fe1('0x2c')]=_[_0x6fe1('0x2d')](_0x2781fb[_0x6fe1('0x29')],_0x2781fb[_0x6fe1('0x2a')]);_0x528092[_0x6fe1('0x2e')]=_[_0x6fe1('0x2d')](_0x2781fb[_0x6fe1('0x29')],qs['fields'](_0x2a8d5c[_0x6fe1('0x2a')][_0x6fe1('0x2f')]));_0x528092['attributes']=_0x528092['attributes'][_0x6fe1('0x30')]?_0x528092['attributes']:_0x2781fb[_0x6fe1('0x29')];if(!_0x2a8d5c['query']['hasOwnProperty'](_0x6fe1('0x31'))){_0x528092[_0x6fe1('0x1a')]=qs[_0x6fe1('0x1a')](_0x2a8d5c[_0x6fe1('0x2a')][_0x6fe1('0x1a')]);_0x528092[_0x6fe1('0x19')]=qs['offset'](_0x2a8d5c[_0x6fe1('0x2a')][_0x6fe1('0x19')]);}_0x528092['order']=qs['sort'](_0x2a8d5c[_0x6fe1('0x2a')][_0x6fe1('0x32')]);_0x528092[_0x6fe1('0x33')]=qs[_0x6fe1('0x2c')](_[_0x6fe1('0x34')](_0x2a8d5c['query'],_0x2781fb[_0x6fe1('0x2c')]),_0x13132f);if(_0x2a8d5c['query'][_0x6fe1('0x35')]){_0x528092[_0x6fe1('0x33')]=_[_0x6fe1('0x36')](_0x528092['where'],{'$or':_[_0x6fe1('0x37')](_0x13132f,function(_0x23765a){if(_0x23765a['type']!=='VIRTUAL'){var _0x5d2ea0={};_0x5d2ea0[_0x23765a[_0x6fe1('0x26')]]={'$like':'%'+_0x2a8d5c[_0x6fe1('0x2a')][_0x6fe1('0x35')]+'%'};return _0x5d2ea0;}})});}_0x528092=_[_0x6fe1('0x36')]({},_0x528092,_0x2a8d5c[_0x6fe1('0x38')]);var _0x2b683d={'where':_0x528092[_0x6fe1('0x33')]};return db[_0x6fe1('0x39')][_0x6fe1('0x1c')](_0x2b683d)[_0x6fe1('0x24')](function(_0x525b99){_0x558aa2[_0x6fe1('0x1c')]=_0x525b99;if(_0x2a8d5c[_0x6fe1('0x2a')][_0x6fe1('0x3a')]){_0x528092[_0x6fe1('0x3b')]=[{'all':!![]}];}return db[_0x6fe1('0x39')][_0x6fe1('0x3c')](_0x528092);})['then'](function(_0x23432e){_0x558aa2['rows']=_0x23432e;return _0x558aa2;})['then'](respondWithFilteredResult(_0x2e1705,_0x528092))['catch'](handleError(_0x2e1705,null));};exports[_0x6fe1('0x3d')]=function(_0x4aedef,_0x23573a){var _0x18a80e={'raw':!![],'where':{'id':_0x4aedef[_0x6fe1('0x3e')]['id']}},_0x4ee7c7={};_0x4ee7c7[_0x6fe1('0x29')]=_[_0x6fe1('0x2b')](db[_0x6fe1('0x39')]['rawAttributes']);_0x4ee7c7[_0x6fe1('0x2a')]=_[_0x6fe1('0x2b')](_0x4aedef['query']);_0x4ee7c7[_0x6fe1('0x2c')]=_[_0x6fe1('0x2d')](_0x4ee7c7[_0x6fe1('0x29')],_0x4ee7c7['query']);_0x18a80e[_0x6fe1('0x2e')]=_[_0x6fe1('0x2d')](_0x4ee7c7[_0x6fe1('0x29')],qs['fields'](_0x4aedef['query'][_0x6fe1('0x2f')]));_0x18a80e[_0x6fe1('0x2e')]=_0x18a80e[_0x6fe1('0x2e')][_0x6fe1('0x30')]?_0x18a80e[_0x6fe1('0x2e')]:_0x4ee7c7['model'];if(_0x4aedef[_0x6fe1('0x2a')][_0x6fe1('0x3a')]){_0x18a80e[_0x6fe1('0x3b')]=[{'all':!![]}];}_0x18a80e=_[_0x6fe1('0x36')]({},_0x18a80e,_0x4aedef[_0x6fe1('0x38')]);return db['OpenchannelApplication']['find'](_0x18a80e)['then'](handleEntityNotFound(_0x23573a,null))[_0x6fe1('0x24')](respondWithResult(_0x23573a,null))[_0x6fe1('0x3f')](handleError(_0x23573a,null));};exports['create']=function(_0x564bc7,_0x366ee0){return db[_0x6fe1('0x39')][_0x6fe1('0x40')](_0x564bc7[_0x6fe1('0x41')],{})[_0x6fe1('0x24')](respondWithResult(_0x366ee0,0xc9))[_0x6fe1('0x3f')](handleError(_0x366ee0,null));};exports[_0x6fe1('0x22')]=function(_0x1570be,_0x475ce7){if(_0x1570be[_0x6fe1('0x41')]['id']){delete _0x1570be[_0x6fe1('0x41')]['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x1570be[_0x6fe1('0x3e')]['id']}})[_0x6fe1('0x24')](handleEntityNotFound(_0x475ce7,null))['then'](saveUpdates(_0x1570be[_0x6fe1('0x41')],null))[_0x6fe1('0x24')](respondWithResult(_0x475ce7,null))[_0x6fe1('0x3f')](handleError(_0x475ce7,null));};exports[_0x6fe1('0x23')]=function(_0x34054d,_0x4c872c){return db['OpenchannelApplication'][_0x6fe1('0x42')]({'where':{'id':_0x34054d['params']['id']}})[_0x6fe1('0x24')](handleEntityNotFound(_0x4c872c,null))['then'](removeEntity(_0x4c872c,null))[_0x6fe1('0x3f')](handleError(_0x4c872c,null));}; \ No newline at end of file +var _0xe40f=['undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','OpenchannelApplication','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','rows','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset'];(function(_0x48ca09,_0x23f419){var _0x52403e=function(_0x2cb656){while(--_0x2cb656){_0x48ca09['push'](_0x48ca09['shift']());}};_0x52403e(++_0x23f419);}(_0xe40f,0x14b));var _0xfe40=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xe40f[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xfe40('0x0'));var rimraf=require(_0xfe40('0x1'));var zipdir=require(_0xfe40('0x2'));var jsonpatch=require(_0xfe40('0x3'));var rp=require(_0xfe40('0x4'));var moment=require(_0xfe40('0x5'));var BPromise=require(_0xfe40('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfe40('0x7'));var sox=require(_0xfe40('0x8'));var csv=require(_0xfe40('0x9'));var ejs=require(_0xfe40('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe40('0xb'));var squel=require(_0xfe40('0xc'));var crypto=require(_0xfe40('0xd'));var jsforce=require(_0xfe40('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfe40('0xf'));var Papa=require(_0xfe40('0x10'));var Redis=require(_0xfe40('0x11'));var authService=require(_0xfe40('0x12'));var qs=require(_0xfe40('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe40('0x14'));var logger=require('../../config/logger')(_0xfe40('0x15'));var utils=require('../../config/utils');var config=require(_0xfe40('0x16'));var licenseUtil=require(_0xfe40('0x17'));var db=require(_0xfe40('0x18'))['db'];function respondWithStatusCode(_0x28218c,_0x468688){_0x468688=_0x468688||0xcc;return function(_0x19f607){if(_0x19f607){return _0x28218c[_0xfe40('0x19')](_0x468688);}return _0x28218c['status'](_0x468688)[_0xfe40('0x1a')]();};}function respondWithResult(_0x479207,_0x26c951){_0x26c951=_0x26c951||0xc8;return function(_0x54037a){if(_0x54037a){return _0x479207['status'](_0x26c951)[_0xfe40('0x1b')](_0x54037a);}};}function respondWithFilteredResult(_0x473303,_0x3b806f){return function(_0x50b727){if(_0x50b727){var _0x30eda3=typeof _0x3b806f[_0xfe40('0x1c')]===_0xfe40('0x1d')&&typeof _0x3b806f['limit']===_0xfe40('0x1d');var _0x55573e=_0x50b727['count'];var _0x42ad51=_0x30eda3?0x0:_0x3b806f[_0xfe40('0x1c')];var _0x403071=_0x30eda3?_0x50b727[_0xfe40('0x1e')]:_0x3b806f[_0xfe40('0x1c')]+_0x3b806f[_0xfe40('0x1f')];var _0xdb7e3f;if(_0x403071>=_0x55573e){_0x403071=_0x55573e;_0xdb7e3f=0xc8;}else{_0xdb7e3f=0xce;}_0x473303[_0xfe40('0x20')](_0xdb7e3f);return _0x473303[_0xfe40('0x21')](_0xfe40('0x22'),_0x42ad51+'-'+_0x403071+'/'+_0x55573e)[_0xfe40('0x1b')](_0x50b727);}return null;};}function patchUpdates(_0x320997){return function(_0x584ccb){try{jsonpatch[_0xfe40('0x23')](_0x584ccb,_0x320997,!![]);}catch(_0x4f0c56){return BPromise[_0xfe40('0x24')](_0x4f0c56);}return _0x584ccb[_0xfe40('0x25')]();};}function saveUpdates(_0x352b4c,_0xc557ec){return function(_0x391175){if(_0x391175){return _0x391175[_0xfe40('0x26')](_0x352b4c)[_0xfe40('0x27')](function(_0x215e2f){return _0x215e2f;});}return null;};}function removeEntity(_0x236665,_0x4152a0){return function(_0x36eed7){if(_0x36eed7){return _0x36eed7[_0xfe40('0x28')]()[_0xfe40('0x27')](function(){_0x236665[_0xfe40('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8851aa,_0x4c145b){return function(_0x2c4a0c){if(!_0x2c4a0c){_0x8851aa[_0xfe40('0x19')](0x194);}return _0x2c4a0c;};}function handleError(_0x5731b4,_0x1438e5){_0x1438e5=_0x1438e5||0x1f4;return function(_0x1d25de){logger[_0xfe40('0x29')](_0x1d25de[_0xfe40('0x2a')]);if(_0x1d25de[_0xfe40('0x2b')]){delete _0x1d25de['name'];}_0x5731b4['status'](_0x1438e5)[_0xfe40('0x2c')](_0x1d25de);};}exports['index']=function(_0xd3cf83,_0x59d05b){var _0x440152={},_0x1444dc={},_0x1e080e={'count':0x0,'rows':[]};var _0x41e948=_[_0xfe40('0x2d')](db[_0xfe40('0x2e')][_0xfe40('0x2f')],function(_0x382377){return{'name':_0x382377['fieldName'],'type':_0x382377[_0xfe40('0x30')]['key']};});_0x1444dc[_0xfe40('0x31')]=_[_0xfe40('0x2d')](_0x41e948,_0xfe40('0x2b'));_0x1444dc[_0xfe40('0x32')]=_[_0xfe40('0x33')](_0xd3cf83[_0xfe40('0x32')]);_0x1444dc[_0xfe40('0x34')]=_[_0xfe40('0x35')](_0x1444dc[_0xfe40('0x31')],_0x1444dc['query']);_0x440152[_0xfe40('0x36')]=_[_0xfe40('0x35')](_0x1444dc[_0xfe40('0x31')],qs[_0xfe40('0x37')](_0xd3cf83['query'][_0xfe40('0x37')]));_0x440152[_0xfe40('0x36')]=_0x440152[_0xfe40('0x36')][_0xfe40('0x38')]?_0x440152[_0xfe40('0x36')]:_0x1444dc['model'];if(!_0xd3cf83[_0xfe40('0x32')]['hasOwnProperty'](_0xfe40('0x39'))){_0x440152[_0xfe40('0x1f')]=qs[_0xfe40('0x1f')](_0xd3cf83[_0xfe40('0x32')][_0xfe40('0x1f')]);_0x440152[_0xfe40('0x1c')]=qs[_0xfe40('0x1c')](_0xd3cf83[_0xfe40('0x32')][_0xfe40('0x1c')]);}_0x440152['order']=qs[_0xfe40('0x3a')](_0xd3cf83[_0xfe40('0x32')]['sort']);_0x440152[_0xfe40('0x3b')]=qs['filters'](_[_0xfe40('0x3c')](_0xd3cf83['query'],_0x1444dc[_0xfe40('0x34')]),_0x41e948);if(_0xd3cf83[_0xfe40('0x32')][_0xfe40('0x3d')]){_0x440152['where']=_[_0xfe40('0x3e')](_0x440152[_0xfe40('0x3b')],{'$or':_[_0xfe40('0x2d')](_0x41e948,function(_0x5af02b){if(_0x5af02b[_0xfe40('0x30')]!==_0xfe40('0x3f')){var _0x19e127={};_0x19e127[_0x5af02b[_0xfe40('0x2b')]]={'$like':'%'+_0xd3cf83[_0xfe40('0x32')]['filter']+'%'};return _0x19e127;}})});}_0x440152=_[_0xfe40('0x3e')]({},_0x440152,_0xd3cf83['options']);var _0x3a3322={'where':_0x440152[_0xfe40('0x3b')]};return db['OpenchannelApplication'][_0xfe40('0x1e')](_0x3a3322)[_0xfe40('0x27')](function(_0x31be78){_0x1e080e['count']=_0x31be78;if(_0xd3cf83[_0xfe40('0x32')]['includeAll']){_0x440152[_0xfe40('0x40')]=[{'all':!![]}];}return db[_0xfe40('0x2e')]['findAll'](_0x440152);})[_0xfe40('0x27')](function(_0x1b64b8){_0x1e080e[_0xfe40('0x41')]=_0x1b64b8;return _0x1e080e;})[_0xfe40('0x27')](respondWithFilteredResult(_0x59d05b,_0x440152))['catch'](handleError(_0x59d05b,null));};exports['show']=function(_0x348013,_0x5318aa){var _0x46b5fa={'raw':!![],'where':{'id':_0x348013[_0xfe40('0x42')]['id']}},_0x1ae65e={};_0x1ae65e[_0xfe40('0x31')]=_[_0xfe40('0x33')](db[_0xfe40('0x2e')][_0xfe40('0x2f')]);_0x1ae65e[_0xfe40('0x32')]=_[_0xfe40('0x33')](_0x348013[_0xfe40('0x32')]);_0x1ae65e[_0xfe40('0x34')]=_['intersection'](_0x1ae65e[_0xfe40('0x31')],_0x1ae65e[_0xfe40('0x32')]);_0x46b5fa[_0xfe40('0x36')]=_[_0xfe40('0x35')](_0x1ae65e[_0xfe40('0x31')],qs[_0xfe40('0x37')](_0x348013[_0xfe40('0x32')][_0xfe40('0x37')]));_0x46b5fa[_0xfe40('0x36')]=_0x46b5fa[_0xfe40('0x36')][_0xfe40('0x38')]?_0x46b5fa['attributes']:_0x1ae65e[_0xfe40('0x31')];if(_0x348013[_0xfe40('0x32')]['includeAll']){_0x46b5fa['include']=[{'all':!![]}];}_0x46b5fa=_[_0xfe40('0x3e')]({},_0x46b5fa,_0x348013[_0xfe40('0x43')]);return db[_0xfe40('0x2e')][_0xfe40('0x44')](_0x46b5fa)[_0xfe40('0x27')](handleEntityNotFound(_0x5318aa,null))[_0xfe40('0x27')](respondWithResult(_0x5318aa,null))[_0xfe40('0x45')](handleError(_0x5318aa,null));};exports[_0xfe40('0x46')]=function(_0x4d2dd2,_0x37dd3e){return db['OpenchannelApplication'][_0xfe40('0x46')](_0x4d2dd2['body'],{})[_0xfe40('0x27')](respondWithResult(_0x37dd3e,0xc9))['catch'](handleError(_0x37dd3e,null));};exports[_0xfe40('0x26')]=function(_0x53355d,_0x24f392){if(_0x53355d[_0xfe40('0x47')]['id']){delete _0x53355d[_0xfe40('0x47')]['id'];}return db[_0xfe40('0x2e')][_0xfe40('0x44')]({'where':{'id':_0x53355d[_0xfe40('0x42')]['id']}})[_0xfe40('0x27')](handleEntityNotFound(_0x24f392,null))[_0xfe40('0x27')](saveUpdates(_0x53355d[_0xfe40('0x47')],null))[_0xfe40('0x27')](respondWithResult(_0x24f392,null))[_0xfe40('0x45')](handleError(_0x24f392,null));};exports[_0xfe40('0x28')]=function(_0x27f6e1,_0x4e3668){return db[_0xfe40('0x2e')][_0xfe40('0x44')]({'where':{'id':_0x27f6e1[_0xfe40('0x42')]['id']}})[_0xfe40('0x27')](handleEntityNotFound(_0x4e3668,null))[_0xfe40('0x27')](removeEntity(_0x4e3668,null))[_0xfe40('0x45')](handleError(_0x4e3668,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 62cb620..e5bedb3 100644 --- a/server/api/openchannelApplication/openchannelApplication.model.js +++ b/server/api/openchannelApplication/openchannelApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ee1=['exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelApplication.attributes'];(function(_0x5a1a51,_0x144c79){var _0x47edd7=function(_0x2259bb){while(--_0x2259bb){_0x5a1a51['push'](_0x5a1a51['shift']());}};_0x47edd7(++_0x144c79);}(_0x4ee1,0xae));var _0x14ee=function(_0x539b21,_0x64130d){_0x539b21=_0x539b21-0x0;var _0x32aa4b=_0x4ee1[_0x539b21];return _0x32aa4b;};'use strict';var _=require('lodash');var util=require(_0x14ee('0x0'));var logger=require(_0x14ee('0x1'))(_0x14ee('0x2'));var moment=require(_0x14ee('0x3'));var BPromise=require(_0x14ee('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x14ee('0x5'));var rimraf=require(_0x14ee('0x6'));var config=require('../../config/environment');var attributes=require(_0x14ee('0x7'));module[_0x14ee('0x8')]=function(_0x255ee4,_0xd9f80b){return _0x255ee4[_0x14ee('0x9')](_0x14ee('0xa'),attributes,{'tableName':_0x14ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x14ee('0xc'),'collate':_0x14ee('0xd')});}; \ No newline at end of file +var _0xa152=['openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0xa152,0x161));var _0x2a15=function(_0xad0839,_0x3e37a1){_0xad0839=_0xad0839-0x0;var _0x5b82cc=_0xa152[_0xad0839];return _0x5b82cc;};'use strict';var _=require(_0x2a15('0x0'));var util=require(_0x2a15('0x1'));var logger=require(_0x2a15('0x2'))(_0x2a15('0x3'));var moment=require(_0x2a15('0x4'));var BPromise=require('bluebird');var rp=require(_0x2a15('0x5'));var fs=require('fs');var path=require(_0x2a15('0x6'));var rimraf=require(_0x2a15('0x7'));var config=require(_0x2a15('0x8'));var attributes=require(_0x2a15('0x9'));module[_0x2a15('0xa')]=function(_0x541f59,_0x1d4afd){return _0x541f59['define']('OpenchannelApplication',attributes,{'tableName':_0x2a15('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2a15('0xc'),'collate':_0x2a15('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 28d567b..64c1413 100644 --- a/server/api/openchannelApplication/openchannelApplication.rpc.js +++ b/server/api/openchannelApplication/openchannelApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x611f=['body','options','where','limit','UpdateOpenchannelApplication','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelApplication','update'];(function(_0x344c81,_0x518bc5){var _0x21cc15=function(_0x109928){while(--_0x109928){_0x344c81['push'](_0x344c81['shift']());}};_0x21cc15(++_0x518bc5);}(_0x611f,0x15a));var _0xf611=function(_0x23d472,_0x149d1a){_0x23d472=_0x23d472-0x0;var _0x18a907=_0x611f[_0x23d472];return _0x18a907;};'use strict';var _=require(_0xf611('0x0'));var util=require(_0xf611('0x1'));var moment=require('moment');var BPromise=require(_0xf611('0x2'));var rs=require(_0xf611('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf611('0x4'))['db'];var utils=require(_0xf611('0x5'));var logger=require(_0xf611('0x6'))(_0xf611('0x7'));var config=require(_0xf611('0x8'));var jayson=require(_0xf611('0x9'));var client=jayson['client'][_0xf611('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x355baa,_0x45047b,_0x4f0f8a){return new BPromise(function(_0x38cf9f,_0x39279f){return client[_0xf611('0xb')](_0x355baa,_0x4f0f8a)[_0xf611('0xc')](function(_0x3ae966){logger[_0xf611('0xd')](_0xf611('0xe'),_0x45047b,_0xf611('0xf'));logger[_0xf611('0x10')](_0xf611('0x11'),_0x45047b,_0xf611('0xf'),JSON[_0xf611('0x12')](_0x3ae966));if(_0x3ae966[_0xf611('0x13')]){if(_0x3ae966['error'][_0xf611('0x14')]===0x1f4){logger[_0xf611('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x45047b,_0x3ae966[_0xf611('0x13')][_0xf611('0x15')]);return _0x39279f(_0x3ae966[_0xf611('0x13')][_0xf611('0x15')]);}logger['error'](_0xf611('0xe'),_0x45047b,_0x3ae966[_0xf611('0x13')][_0xf611('0x15')]);return _0x38cf9f(_0x3ae966[_0xf611('0x13')]['message']);}else{logger[_0xf611('0xd')](_0xf611('0xe'),_0x45047b,_0xf611('0xf'));_0x38cf9f(_0x3ae966[_0xf611('0x16')][_0xf611('0x15')]);}})[_0xf611('0x17')](function(_0x1eb6a9){logger[_0xf611('0x13')](_0xf611('0xe'),_0x45047b,_0x1eb6a9);_0x39279f(_0x1eb6a9);});});}exports['UpdateOpenchannelApplication']=function(_0x1b7fc5){var _0x58b547=this;return new Promise(function(_0xf08f7f,_0x36dd17){return db[_0xf611('0x18')][_0xf611('0x19')](_0x1b7fc5[_0xf611('0x1a')],{'raw':_0x1b7fc5['options']?_0x1b7fc5[_0xf611('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7fc5[_0xf611('0x1b')]?_0x1b7fc5[_0xf611('0x1b')][_0xf611('0x1c')]||null:null,'attributes':_0x1b7fc5[_0xf611('0x1b')]?_0x1b7fc5[_0xf611('0x1b')]['attributes']||null:null,'limit':_0x1b7fc5[_0xf611('0x1b')]?_0x1b7fc5[_0xf611('0x1b')][_0xf611('0x1d')]||null:null})['then'](function(_0x153202){logger[_0xf611('0xd')]('UpdateOpenchannelApplication',_0x1b7fc5);logger[_0xf611('0x10')](_0xf611('0x1e'),_0x1b7fc5,JSON[_0xf611('0x12')](_0x153202));_0xf08f7f(_0x153202);})[_0xf611('0x17')](function(_0x44d903){logger[_0xf611('0x13')](_0xf611('0x1e'),_0x44d903['message'],_0x1b7fc5);_0x36dd17(_0x58b547[_0xf611('0x13')](0x1f4,_0x44d903[_0xf611('0x15')]));});});}; \ No newline at end of file +var _0x880e=['rpc','../../config/environment','jayson/promise','request','then','info','OpenchannelApplication,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3be8a4,_0x580c92){var _0x439efa=function(_0x333fb8){while(--_0x333fb8){_0x3be8a4['push'](_0x3be8a4['shift']());}};_0x439efa(++_0x580c92);}(_0x880e,0x9b));var _0xe880=function(_0x1d1963,_0x32cc0e){_0x1d1963=_0x1d1963-0x0;var _0x3f58bb=_0x880e[_0x1d1963];return _0x3f58bb;};'use strict';var _=require(_0xe880('0x0'));var util=require(_0xe880('0x1'));var moment=require('moment');var BPromise=require(_0xe880('0x2'));var rs=require(_0xe880('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe880('0x4'))['db'];var utils=require(_0xe880('0x5'));var logger=require(_0xe880('0x6'))(_0xe880('0x7'));var config=require(_0xe880('0x8'));var jayson=require(_0xe880('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19dccb,_0x33fae3,_0x3b4d1f){return new BPromise(function(_0x4f1c4d,_0x168425){return client[_0xe880('0xa')](_0x19dccb,_0x3b4d1f)[_0xe880('0xb')](function(_0x4560f3){logger[_0xe880('0xc')](_0xe880('0xd'),_0x33fae3,'request\x20sent');logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x33fae3,'request\x20sent',JSON['stringify'](_0x4560f3));if(_0x4560f3[_0xe880('0xe')]){if(_0x4560f3[_0xe880('0xe')][_0xe880('0xf')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x33fae3,_0x4560f3[_0xe880('0xe')][_0xe880('0x10')]);return _0x168425(_0x4560f3[_0xe880('0xe')][_0xe880('0x10')]);}logger[_0xe880('0xe')](_0xe880('0xd'),_0x33fae3,_0x4560f3[_0xe880('0xe')][_0xe880('0x10')]);return _0x4f1c4d(_0x4560f3[_0xe880('0xe')][_0xe880('0x10')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x33fae3,_0xe880('0x11'));_0x4f1c4d(_0x4560f3[_0xe880('0x12')][_0xe880('0x10')]);}})[_0xe880('0x13')](function(_0x4b4721){logger[_0xe880('0xe')](_0xe880('0xd'),_0x33fae3,_0x4b4721);_0x168425(_0x4b4721);});});}exports[_0xe880('0x14')]=function(_0x4ffa88){var _0x5162f4=this;return new Promise(function(_0x4789de,_0x506a79){return db[_0xe880('0x15')][_0xe880('0x16')](_0x4ffa88['body'],{'raw':_0x4ffa88[_0xe880('0x17')]?_0x4ffa88[_0xe880('0x17')][_0xe880('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ffa88['options']?_0x4ffa88[_0xe880('0x17')][_0xe880('0x19')]||null:null,'attributes':_0x4ffa88[_0xe880('0x17')]?_0x4ffa88[_0xe880('0x17')]['attributes']||null:null,'limit':_0x4ffa88[_0xe880('0x17')]?_0x4ffa88[_0xe880('0x17')]['limit']||null:null})[_0xe880('0xb')](function(_0x5b6100){logger[_0xe880('0xc')](_0xe880('0x14'),_0x4ffa88);logger['debug']('UpdateOpenchannelApplication',_0x4ffa88,JSON[_0xe880('0x1a')](_0x5b6100));_0x4789de(_0x5b6100);})[_0xe880('0x13')](function(_0x3723be){logger[_0xe880('0xe')](_0xe880('0x14'),_0x3723be[_0xe880('0x10')],_0x4ffa88);_0x506a79(_0x5162f4['error'](0x1f4,_0x3723be[_0xe880('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 09e92ee..62d1dd4 100644 --- a/server/api/openchannelInteraction/index.js +++ b/server/api/openchannelInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f13=['openchannel','openchannelinteraction:addtags','addTags','put','/:id','openchannelinteraction:update','update','openchannelinteraction:destroy','delete','removeTags','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','describe','isAuthenticated','download','create','post','addMessage','/:id/tags','tracked'];(function(_0x769fb3,_0x19639c){var _0x429de9=function(_0x24bd53){while(--_0x24bd53){_0x769fb3['push'](_0x769fb3['shift']());}};_0x429de9(++_0x19639c);}(_0x3f13,0xe4));var _0x33f1=function(_0x49b03b,_0x1d203c){_0x49b03b=_0x49b03b-0x0;var _0x4b4847=_0x3f13[_0x49b03b];return _0x4b4847;};'use strict';var multer=require(_0x33f1('0x0'));var util=require('util');var path=require(_0x33f1('0x1'));var timeout=require(_0x33f1('0x2'));var express=require('express');var router=express[_0x33f1('0x3')]();var fs_extra=require(_0x33f1('0x4'));var auth=require(_0x33f1('0x5'));var interaction=require(_0x33f1('0x6'));var config=require(_0x33f1('0x7'));var controller=require(_0x33f1('0x8'));router[_0x33f1('0x9')]('/',auth['isAuthenticated'](),controller[_0x33f1('0xa')]);router['get'](_0x33f1('0xb'),auth['isAuthenticated'](),controller[_0x33f1('0xc')]);router[_0x33f1('0x9')]('/:id',auth[_0x33f1('0xd')](),controller['show']);router[_0x33f1('0x9')]('/:id/messages',auth[_0x33f1('0xd')](),controller['getMessages']);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x33f1('0xe')]);router['post']('/',auth[_0x33f1('0xd')](),controller[_0x33f1('0xf')]);router[_0x33f1('0x10')]('/:id/messages',auth[_0x33f1('0xd')](),controller[_0x33f1('0x11')]);router[_0x33f1('0x10')](_0x33f1('0x12'),auth[_0x33f1('0xd')](),interaction[_0x33f1('0x13')](_0x33f1('0x14'),_0x33f1('0x15')),controller[_0x33f1('0x16')]);router[_0x33f1('0x17')](_0x33f1('0x18'),auth['isAuthenticated'](),interaction[_0x33f1('0x13')]('openchannel',_0x33f1('0x19')),controller[_0x33f1('0x1a')]);router['delete'](_0x33f1('0x18'),auth['isAuthenticated'](),interaction['tracked']('openchannel',_0x33f1('0x1b')),controller['destroy']);router[_0x33f1('0x1c')](_0x33f1('0x12'),auth['isAuthenticated'](),controller[_0x33f1('0x1d')]);module[_0x33f1('0x1e')]=router; \ No newline at end of file +var _0xf344=['openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','delete','/:id','destroy','/:id/tags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id/messages','getMessages','post','create','addMessage','tracked'];(function(_0x5241d6,_0x4c8185){var _0x1885d5=function(_0x47d297){while(--_0x47d297){_0x5241d6['push'](_0x5241d6['shift']());}};_0x1885d5(++_0x4c8185);}(_0xf344,0x13e));var _0x4f34=function(_0x498cad,_0x5b5137){_0x498cad=_0x498cad-0x0;var _0x31f4c8=_0xf344[_0x498cad];return _0x31f4c8;};'use strict';var multer=require(_0x4f34('0x0'));var util=require(_0x4f34('0x1'));var path=require(_0x4f34('0x2'));var timeout=require(_0x4f34('0x3'));var express=require(_0x4f34('0x4'));var router=express[_0x4f34('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4f34('0x6'));var interaction=require(_0x4f34('0x7'));var config=require(_0x4f34('0x8'));var controller=require('./openchannelInteraction.controller');router[_0x4f34('0x9')]('/',auth[_0x4f34('0xa')](),controller['index']);router[_0x4f34('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x4f34('0xb')]);router['get']('/:id',auth[_0x4f34('0xa')](),controller['show']);router['get'](_0x4f34('0xc'),auth[_0x4f34('0xa')](),controller[_0x4f34('0xd')]);router[_0x4f34('0x9')]('/:id/download',auth[_0x4f34('0xa')](),controller['download']);router[_0x4f34('0xe')]('/',auth[_0x4f34('0xa')](),controller[_0x4f34('0xf')]);router[_0x4f34('0xe')](_0x4f34('0xc'),auth[_0x4f34('0xa')](),controller[_0x4f34('0x10')]);router[_0x4f34('0xe')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x4f34('0x11')](_0x4f34('0x12'),_0x4f34('0x13')),controller[_0x4f34('0x14')]);router['put']('/:id',auth[_0x4f34('0xa')](),interaction[_0x4f34('0x11')]('openchannel',_0x4f34('0x15')),controller[_0x4f34('0x16')]);router[_0x4f34('0x17')](_0x4f34('0x18'),auth[_0x4f34('0xa')](),interaction[_0x4f34('0x11')]('openchannel','openchannelinteraction:destroy'),controller[_0x4f34('0x19')]);router[_0x4f34('0x17')](_0x4f34('0x1a'),auth['isAuthenticated'](),controller['removeTags']);module[_0x4f34('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 8cada50..827e620 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.attributes.js +++ b/server/api/openchannelInteraction/openchannelInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb16f=['sequelize','exports','BOOLEAN','STRING','ENUM','INTEGER'];(function(_0x18a817,_0x41bcc0){var _0x57d27b=function(_0x450280){while(--_0x450280){_0x18a817['push'](_0x18a817['shift']());}};_0x57d27b(++_0x41bcc0);}(_0xb16f,0xf6));var _0xfb16=function(_0x4e82ff,_0x3cbf4b){_0x4e82ff=_0x4e82ff-0x0;var _0x495205=_0xb16f[_0x4e82ff];return _0x495205;};'use strict';var Sequelize=require(_0xfb16('0x0'));module[_0xfb16('0x1')]={'closed':{'type':Sequelize[_0xfb16('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xfb16('0x3')]},'secondDisposition':{'type':Sequelize[_0xfb16('0x3')]},'thirdDisposition':{'type':Sequelize[_0xfb16('0x3')]},'note':{'type':Sequelize[_0xfb16('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xfb16('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xfb16('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xfb16('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xfb16('0x5')]}}; \ No newline at end of file +var _0x457b=['exports','DATE','STRING','ENUM','out','BOOLEAN','sequelize'];(function(_0x1f49da,_0x1bf4d9){var _0x18c221=function(_0x146eef){while(--_0x146eef){_0x1f49da['push'](_0x1f49da['shift']());}};_0x18c221(++_0x1bf4d9);}(_0x457b,0xca));var _0xb457=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x457b[_0x32d457];return _0x338386;};'use strict';var Sequelize=require(_0xb457('0x0'));module[_0xb457('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb457('0x2')]},'disposition':{'type':Sequelize[_0xb457('0x3')]},'secondDisposition':{'type':Sequelize[_0xb457('0x3')]},'thirdDisposition':{'type':Sequelize[_0xb457('0x3')]},'note':{'type':Sequelize[_0xb457('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xb457('0x3')]},'externalUrl':{'type':Sequelize[_0xb457('0x3')]},'lastMsgAt':{'type':Sequelize[_0xb457('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xb457('0x4')]('in',_0xb457('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xb457('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xb457('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xb457('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 1404ae0..d855346 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.controller.js +++ b/server/api/openchannelInteraction/openchannelInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa0c3=['count','set','Content-Range','update','then','destroy','sendStatus','stack','name','index','map','OpenchannelInteraction','rawAttributes','fieldName','key','findAll','openchannel','query','user','show','type','from','params','filters','intersection','model','attributes','fields','length','include','merge','options','find','create','body','catch','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','keys','nolimit','order','sort','where','OpenchannelInteractionId','filter','$gte','format','includeAll','setTags','spread','Tag','color','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','attachments','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','secret','read','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','createdAt','closed','closedAt','toString','disposition','threadId','Public','Private','basename','existsSync','pipe','createWriteStream','YYYY-MM-DD\x20HH:mm:ss','out','System','renderFile','views','transcript-','.pdf','createPdfFromHTML','download','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','ejs','lodash','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','end','json','offset','limit','undefined'];(function(_0x224094,_0x30093b){var _0xa304c3=function(_0x361c0a){while(--_0x361c0a){_0x224094['push'](_0x224094['shift']());}};_0xa304c3(++_0x30093b);}(_0xa0c3,0x1f1));var _0x3a0c=function(_0x83c5ed,_0x39a350){_0x83c5ed=_0x83c5ed-0x0;var _0x1cc3e0=_0xa0c3[_0x83c5ed];return _0x1cc3e0;};'use strict';var rimraf=require(_0x3a0c('0x0'));var zipdir=require(_0x3a0c('0x1'));var moment=require(_0x3a0c('0x2'));var util=require(_0x3a0c('0x3'));var path=require('path');var ejs=require(_0x3a0c('0x4'));var fs=require('fs');var _=require(_0x3a0c('0x5'));var Redis=require('ioredis');var interaction=require(_0x3a0c('0x6'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x3a0c('0x7'))(_0x3a0c('0x8'));var config=require(_0x3a0c('0x9'));var db=require(_0x3a0c('0xa'))['db'];config[_0x3a0c('0xb')]=_[_0x3a0c('0xc')](config[_0x3a0c('0xb')],{'host':_0x3a0c('0xd'),'port':0x18eb});var socket=require(_0x3a0c('0xe'))(new Redis(config[_0x3a0c('0xb')]));require(_0x3a0c('0xf'))[_0x3a0c('0x10')](socket);function respondWithStatusCode(_0x3f725b,_0xd2a632){_0xd2a632=_0xd2a632||0xcc;return function(_0x4ae10e){if(_0x4ae10e){return _0x3f725b['sendStatus'](_0xd2a632);}return _0x3f725b[_0x3a0c('0x11')](_0xd2a632)[_0x3a0c('0x12')]();};}function respondWithResult(_0x16b9e4,_0x50df19){_0x50df19=_0x50df19||0xc8;return function(_0x1fa2a3){if(_0x1fa2a3){return _0x16b9e4['status'](_0x50df19)[_0x3a0c('0x13')](_0x1fa2a3);}};}function respondWithFilteredResult(_0x11bda3,_0x331136){return function(_0x3b7284){if(_0x3b7284){var _0x1d3140=typeof _0x331136[_0x3a0c('0x14')]==='undefined'&&typeof _0x331136[_0x3a0c('0x15')]===_0x3a0c('0x16');var _0x4ab5f7=_0x3b7284['count'];var _0x4f5d1b=_0x1d3140?0x0:_0x331136[_0x3a0c('0x14')];var _0x41d80e=_0x1d3140?_0x3b7284[_0x3a0c('0x17')]:_0x331136[_0x3a0c('0x14')]+_0x331136[_0x3a0c('0x15')];var _0x35f1cb;if(_0x41d80e>=_0x4ab5f7){_0x41d80e=_0x4ab5f7;_0x35f1cb=0xc8;}else{_0x35f1cb=0xce;}_0x11bda3['status'](_0x35f1cb);return _0x11bda3[_0x3a0c('0x18')](_0x3a0c('0x19'),_0x4f5d1b+'-'+_0x41d80e+'/'+_0x4ab5f7)[_0x3a0c('0x13')](_0x3b7284);}return null;};}function saveUpdates(_0x2e89e4){return function(_0x4d3bde){if(_0x4d3bde){return _0x4d3bde[_0x3a0c('0x1a')](_0x2e89e4)[_0x3a0c('0x1b')](function(_0x246f9b){return _0x246f9b;});}return null;};}function removeEntity(_0x4b003d){return function(_0xb89d02){if(_0xb89d02){return _0xb89d02[_0x3a0c('0x1c')]()[_0x3a0c('0x1b')](function(){_0x4b003d[_0x3a0c('0x11')](0xcc)[_0x3a0c('0x12')]();});}};}function handleEntityNotFound(_0x178772){return function(_0x2fd283){if(!_0x2fd283){_0x178772[_0x3a0c('0x1d')](0x194);}return _0x2fd283;};}function handleError(_0x4f9a20,_0x122edd){_0x122edd=_0x122edd||0x1f4;return function(_0x2b63dd){logger['error'](_0x2b63dd[_0x3a0c('0x1e')]);if(_0x2b63dd[_0x3a0c('0x1f')]){delete _0x2b63dd[_0x3a0c('0x1f')];}_0x4f9a20['status'](_0x122edd)['send'](_0x2b63dd);};}exports[_0x3a0c('0x20')]=function(_0x6d2372,_0x5701b7){var _0x256f9c={};var _0x4942e0=_[_0x3a0c('0x21')](db[_0x3a0c('0x22')][_0x3a0c('0x23')],function(_0x3916f7){return{'name':_0x3916f7[_0x3a0c('0x24')],'type':_0x3916f7['type'][_0x3a0c('0x25')]};});_0x256f9c=qs['getOptions'](_0x4942e0,_0x6d2372);return interaction[_0x3a0c('0x26')](_0x3a0c('0x27'),_0x6d2372[_0x3a0c('0x28')],_0x6d2372[_0x3a0c('0x29')],_0x256f9c,_0x4942e0)[_0x3a0c('0x1b')](respondWithFilteredResult(_0x5701b7,_0x256f9c))['catch'](handleError(_0x5701b7,null));};exports[_0x3a0c('0x2a')]=function(_0x3c9d0a,_0x5febb5){var _0x549c80={};if(_0x3c9d0a[_0x3a0c('0x28')]['type']&&_0x3c9d0a['query'][_0x3a0c('0x2b')]===_0x3a0c('0x2c')){_0x549c80[_0x3a0c('0x2c')]=_0x3c9d0a['params']['id'];}else{_0x549c80['id']=_0x3c9d0a[_0x3a0c('0x2d')]['id'];}var _0x1d817a={'raw':![],'where':_0x549c80},_0x425acf={};_0x425acf['model']=_['keys'](db[_0x3a0c('0x22')]['rawAttributes']);_0x425acf[_0x3a0c('0x28')]=_['keys'](_0x3c9d0a[_0x3a0c('0x28')]);_0x425acf[_0x3a0c('0x2e')]=_[_0x3a0c('0x2f')](_0x425acf[_0x3a0c('0x30')],_0x425acf['query']);_0x1d817a[_0x3a0c('0x31')]=_[_0x3a0c('0x2f')](_0x425acf[_0x3a0c('0x30')],qs[_0x3a0c('0x32')](_0x3c9d0a['query'][_0x3a0c('0x32')]));_0x1d817a[_0x3a0c('0x31')]=_0x1d817a[_0x3a0c('0x31')][_0x3a0c('0x33')]?_0x1d817a['attributes']:_0x425acf['model'];if(_0x3c9d0a['query']['includeAll']){_0x1d817a[_0x3a0c('0x34')]=[{'all':!![]}];}_0x1d817a=_[_0x3a0c('0x35')]({},_0x1d817a,_0x3c9d0a[_0x3a0c('0x36')]);return db['OpenchannelInteraction'][_0x3a0c('0x37')](_0x1d817a)[_0x3a0c('0x1b')](handleEntityNotFound(_0x5febb5,null))[_0x3a0c('0x1b')](respondWithResult(_0x5febb5,null))['catch'](handleError(_0x5febb5,null));};exports[_0x3a0c('0x38')]=function(_0x5b6833,_0x6790b3){return db[_0x3a0c('0x22')][_0x3a0c('0x38')](_0x5b6833[_0x3a0c('0x39')],{})[_0x3a0c('0x1b')](respondWithResult(_0x6790b3,0xc9))[_0x3a0c('0x3a')](handleError(_0x6790b3,null));};exports['update']=function(_0x41a812,_0x4a7838){if(_0x41a812['body']['id']){delete _0x41a812[_0x3a0c('0x39')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x41a812[_0x3a0c('0x2d')]['id']}})[_0x3a0c('0x1b')](handleEntityNotFound(_0x4a7838,null))[_0x3a0c('0x1b')](saveUpdates(_0x41a812[_0x3a0c('0x39')],null))[_0x3a0c('0x1b')](respondWithResult(_0x4a7838,null))['catch'](handleError(_0x4a7838,null));};exports[_0x3a0c('0x1c')]=function(_0x5dbe58,_0x4d3554){return db[_0x3a0c('0x22')][_0x3a0c('0x37')]({'where':{'id':_0x5dbe58[_0x3a0c('0x2d')]['id']}})[_0x3a0c('0x1b')](handleEntityNotFound(_0x4d3554,null))['then'](removeEntity(_0x4d3554,null))[_0x3a0c('0x3a')](handleError(_0x4d3554,null));};exports[_0x3a0c('0x3b')]=function(_0x1eef8a,_0x136fde){return db[_0x3a0c('0x22')][_0x3a0c('0x3b')]()[_0x3a0c('0x1b')](respondWithResult(_0x136fde,null))[_0x3a0c('0x3a')](handleError(_0x136fde,null));};exports[_0x3a0c('0x3c')]=function(_0x236e38,_0x3a95b5){return db[_0x3a0c('0x3d')][_0x3a0c('0x37')]({'where':{'id':_0x236e38['params']['id']}})[_0x3a0c('0x1b')](handleEntityNotFound(_0x3a95b5,null))['then'](function(_0x33ce2e){if(_0x33ce2e){return _0x33ce2e[_0x3a0c('0x3c')](_0x236e38[_0x3a0c('0x39')][_0x3a0c('0x3e')],_[_0x3a0c('0x3f')](_0x236e38['body'],[_0x3a0c('0x3e'),'id'])||{});}})[_0x3a0c('0x1b')](respondWithResult(_0x3a95b5,null))[_0x3a0c('0x3a')](handleError(_0x3a95b5,null));};exports[_0x3a0c('0x40')]=function(_0x69cb5e,_0x3d7d74){var _0x3d5f67={'raw':![],'where':{}};var _0x1055eb={};var _0x5ba889={'count':0x0,'rows':[]};return db[_0x3a0c('0x22')]['findOne']({'where':{'id':_0x69cb5e[_0x3a0c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x3d7d74,null))[_0x3a0c('0x1b')](function(_0x59e554){if(_0x59e554){_0x1055eb[_0x3a0c('0x30')]=_[_0x3a0c('0x41')](db[_0x3a0c('0x3d')][_0x3a0c('0x23')]);_0x1055eb[_0x3a0c('0x28')]=_[_0x3a0c('0x41')](_0x69cb5e[_0x3a0c('0x28')]);_0x1055eb[_0x3a0c('0x2e')]=_[_0x3a0c('0x2f')](_0x1055eb[_0x3a0c('0x30')],_0x1055eb['query']);_0x3d5f67['attributes']=_[_0x3a0c('0x2f')](_0x1055eb['model'],qs[_0x3a0c('0x32')](_0x69cb5e[_0x3a0c('0x28')][_0x3a0c('0x32')]));_0x3d5f67[_0x3a0c('0x31')]=_0x3d5f67[_0x3a0c('0x31')][_0x3a0c('0x33')]?_0x3d5f67[_0x3a0c('0x31')]:_0x1055eb[_0x3a0c('0x30')];if(!_0x69cb5e['query']['hasOwnProperty'](_0x3a0c('0x42'))){_0x3d5f67[_0x3a0c('0x15')]=qs['limit'](_0x69cb5e[_0x3a0c('0x28')]['limit']);_0x3d5f67['offset']=qs[_0x3a0c('0x14')](_0x69cb5e[_0x3a0c('0x28')][_0x3a0c('0x14')]);}_0x3d5f67[_0x3a0c('0x43')]=qs[_0x3a0c('0x44')](_0x69cb5e['query'][_0x3a0c('0x44')]);_0x3d5f67[_0x3a0c('0x45')]=qs['filters'](_['pick'](_0x69cb5e[_0x3a0c('0x28')],_0x1055eb['filters']));_0x3d5f67[_0x3a0c('0x45')][_0x3a0c('0x46')]=_0x59e554['id'];if(_0x69cb5e[_0x3a0c('0x28')]['filter']){_0x3d5f67[_0x3a0c('0x45')]=_[_0x3a0c('0x35')](_0x3d5f67['where'],{'$or':_[_0x3a0c('0x21')](_0x3d5f67[_0x3a0c('0x31')],function(_0x25bb01){var _0xfabd4f={};_0xfabd4f[_0x25bb01]={'$like':'%'+_0x69cb5e[_0x3a0c('0x28')][_0x3a0c('0x47')]+'%'};return _0xfabd4f;})});}if(_0x69cb5e['query'][_0x3a0c('0x48')]){var _0x11e91e=_0x69cb5e[_0x3a0c('0x28')][_0x3a0c('0x48')]['split'](',');var _0x4034f6={};_0x4034f6[_0x11e91e[0x0]]={'$gte':moment(_0x11e91e[0x1])[_0x3a0c('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3d5f67[_0x3a0c('0x45')]=_[_0x3a0c('0x35')](_0x3d5f67[_0x3a0c('0x45')],_0x4034f6);}_0x3d5f67=_[_0x3a0c('0x35')]({},_0x3d5f67,_0x69cb5e['options']);return db[_0x3a0c('0x3d')]['count']({'where':_0x3d5f67[_0x3a0c('0x45')]})[_0x3a0c('0x1b')](function(_0x553583){_0x5ba889[_0x3a0c('0x17')]=_0x553583;if(_0x69cb5e[_0x3a0c('0x28')][_0x3a0c('0x4a')]){_0x3d5f67[_0x3a0c('0x34')]=[{'all':!![]}];}return db[_0x3a0c('0x3d')][_0x3a0c('0x26')](_0x3d5f67);})[_0x3a0c('0x1b')](function(_0x4916ef){_0x5ba889['rows']=_0x4916ef;return _0x5ba889;});}})[_0x3a0c('0x1b')](respondWithFilteredResult(_0x3d7d74,_0x3d5f67))[_0x3a0c('0x3a')](handleError(_0x3d7d74,null));};exports['addTags']=function(_0x352667,_0x16be75){return db[_0x3a0c('0x22')]['find']({'where':{'id':_0x352667[_0x3a0c('0x2d')]['id']}})[_0x3a0c('0x1b')](handleEntityNotFound(_0x16be75,null))['then'](function(_0x117ac8){if(_0x117ac8){return _0x117ac8[_0x3a0c('0x4b')](_0x352667['body']['ids'],_[_0x3a0c('0x3f')](_0x352667[_0x3a0c('0x39')],['ids','id'])||{})[_0x3a0c('0x4c')](function(){return db[_0x3a0c('0x4d')][_0x3a0c('0x26')]({'attributes':['id',_0x3a0c('0x1f'),_0x3a0c('0x4e')],'where':{'id':_0x352667[_0x3a0c('0x39')][_0x3a0c('0x3e')]}});})[_0x3a0c('0x1b')](function(_0x5fe4f4){socket['emit'](_0x3a0c('0x4f'),{'id':Number(_0x352667[_0x3a0c('0x2d')]['id']),'tags':_0x5fe4f4||[]});return{'id':Number(_0x352667['params']['id']),'tags':_0x5fe4f4||[]};});}})[_0x3a0c('0x1b')](respondWithResult(_0x16be75,null))['catch'](handleError(_0x16be75,null));};exports[_0x3a0c('0x50')]=function(_0x2928e6,_0x275387){return db[_0x3a0c('0x22')]['find']({'where':{'id':_0x2928e6[_0x3a0c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x275387,null))[_0x3a0c('0x1b')](function(_0xa263a7){if(_0xa263a7){return _0xa263a7[_0x3a0c('0x50')](_0x2928e6[_0x3a0c('0x28')][_0x3a0c('0x3e')]);}})['then'](respondWithStatusCode(_0x275387,null))['catch'](handleError(_0x275387,null));};exports['download']=function(_0xc7202e,_0x4a5ec2){var _0x22df77=moment()[_0x3a0c('0x51')]()['toString']();var _0x4e0bd3=path[_0x3a0c('0x52')](config[_0x3a0c('0x53')],_0x3a0c('0x54'),_0x3a0c('0x55'),'tmp');var _0x57544c=path['join'](config[_0x3a0c('0x53')],'server',_0x3a0c('0x55'),_0x3a0c('0x56'));var _0x21b9bc=path[_0x3a0c('0x52')](_0x4e0bd3,_0x22df77);var _0x51fc1f=util[_0x3a0c('0x49')]('transcript-%d-%s.zip',_0xc7202e[_0x3a0c('0x2d')]['id'],_0x22df77);var _0x2c738d=path[_0x3a0c('0x52')](_0x4e0bd3,_0x51fc1f);var _0xa4d968=[];_0xa4d968[_0x3a0c('0x57')]({'model':db[_0x3a0c('0x58')],'as':_0x3a0c('0x58'),'attributes':['id',_0x3a0c('0x59')],'raw':!![]});_0xa4d968[_0x3a0c('0x57')]({'model':db[_0x3a0c('0x5a')],'as':_0x3a0c('0x5b'),'attributes':['id',_0x3a0c('0x5c'),_0x3a0c('0x5d')],'raw':!![]});if(_0xc7202e['query'][_0x3a0c('0x56')]){_0xa4d968['push']({'model':db[_0x3a0c('0x5e')],'as':_0x3a0c('0x5e'),'raw':!![]});}var _0x4191f3=[{'model':db[_0x3a0c('0x3d')],'as':_0x3a0c('0x5f'),'attributes':['id',_0x3a0c('0x39'),'createdAt',_0x3a0c('0x60'),_0x3a0c('0x61'),_0x3a0c('0x62')],'include':_0xa4d968}];_0x4191f3['push']({'model':db[_0x3a0c('0x63')],'as':_0x3a0c('0x64'),'attributes':['id',_0x3a0c('0x1f')]});_0x4191f3['push']({'model':db['User'],'as':_0x3a0c('0x65'),'attributes':['id','fullname']});return db[_0x3a0c('0x22')][_0x3a0c('0x37')]({'where':{'id':_0xc7202e[_0x3a0c('0x2d')]['id']},'include':_0x4191f3})[_0x3a0c('0x1b')](handleEntityNotFound(_0x4a5ec2,null))[_0x3a0c('0x1b')](function(_0x3a715e){if(_0x3a715e){var _0x3ec046=_0x3a715e[_0x3a0c('0x66')]({'plain':!![]});fs[_0x3a0c('0x67')](_0x21b9bc);var _0x4ef640={'channel':_0x3a0c('0x68'),'account':_0x3ec046[_0x3a0c('0x64')][_0x3a0c('0x1f')],'agent':_0x3ec046['Owner']?_0x3ec046[_0x3a0c('0x65')]['fullname']:_0x3a0c('0x69'),'createdAt':moment(_0x3ec046[_0x3a0c('0x6a')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x3ec046[_0x3a0c('0x6b')]?moment(_0x3ec046[_0x3a0c('0x6c')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x3a0c('0x6d')]():'','disposition':_0x3ec046[_0x3a0c('0x6e')],'visibility':_0x3ec046[_0x3a0c('0x6f')]?_0x3a0c('0x70'):_0x3a0c('0x71'),'messages':_(_0x3ec046['Messages'])[_0x3a0c('0x47')]({'secret':![]})['map'](function(_0x4d39a3){if(_0x4d39a3[_0x3a0c('0x5e')]){var _0x48b16e=path[_0x3a0c('0x52')](_0x57544c,_0x4d39a3[_0x3a0c('0x5e')][_0x3a0c('0x72')]);if(fs[_0x3a0c('0x73')](_0x48b16e)){fs['createReadStream'](_0x48b16e)[_0x3a0c('0x74')](fs[_0x3a0c('0x75')](path[_0x3a0c('0x52')](_0x21b9bc,_0x4d39a3['Attachment'][_0x3a0c('0x72')])));}}return{'date':moment(_0x4d39a3[_0x3a0c('0x6a')])[_0x3a0c('0x49')](_0x3a0c('0x76'))['toString'](),'sender':_0x4d39a3['direction']===_0x3a0c('0x77')?_0x4d39a3['User']?_0x4d39a3['User'][_0x3a0c('0x59')]:_0x3a0c('0x78'):_0x4d39a3[_0x3a0c('0x5b')][_0x3a0c('0x5c')]+(_0x4d39a3[_0x3a0c('0x5b')][_0x3a0c('0x5d')]?'\x20'+_0x4d39a3[_0x3a0c('0x5b')][_0x3a0c('0x5d')]:''),'body':_0x4d39a3[_0x3a0c('0x5e')]?_0x4d39a3['Attachment'][_0x3a0c('0x72')]:_0x4d39a3[_0x3a0c('0x39')],'direction':_0x4d39a3[_0x3a0c('0x60')]===_0x3a0c('0x77')?'A':'C','secret':_0x4d39a3[_0x3a0c('0x61')],'read':_0x4d39a3['read'],'attachment':_0x4d39a3['Attachment']};})['value']()};return ejs[_0x3a0c('0x79')](path[_0x3a0c('0x52')](config[_0x3a0c('0x53')],_0x3a0c('0x54'),_0x3a0c('0x7a'),'downloadInteraction.ejs'),{'interaction':_0x4ef640})['then'](function(_0x3d0da1){var _0x5c4418=path[_0x3a0c('0x52')](_0x21b9bc,_0x3a0c('0x7b')+_0x3ec046['id']+'-'+_0x22df77+_0x3a0c('0x7c'));var _0x5b4667={'path':_0x5c4418,'channel':'Openchannel','interactionId':_0x3ec046['id']};return pdf[_0x3a0c('0x7d')](_0x3d0da1,_0x5b4667);})[_0x3a0c('0x1b')](function(){return new Promise(function(_0x2561a0,_0x5a6d1e){zipdir(_0x21b9bc,{'saveTo':_0x2c738d},function(_0x1e1d35,_0x10686d){if(_0x1e1d35)return _0x5a6d1e(_0x1e1d35);return _0x2561a0(_0x10686d);});})[_0x3a0c('0x1b')](function(){return new Promise(function(_0x3bf07e,_0x156bfa){rimraf(_0x21b9bc,function(_0x47e68c){if(_0x47e68c)_0x156bfa(_0x47e68c);return _0x3bf07e();});});})[_0x3a0c('0x1b')](function(){return _0x4a5ec2[_0x3a0c('0x7e')](_0x2c738d,_0x51fc1f,function(_0x27b263){if(_0x27b263){logger[_0x3a0c('0x7f')](_0x3a0c('0x80'),_0x27b263);}else{fs[_0x3a0c('0x81')](_0x2c738d);}});});});}else{return _0x4a5ec2[_0x3a0c('0x1d')](0xc8);}})[_0x3a0c('0x3a')](handleError(_0x4a5ec2,null));}; \ No newline at end of file +var _0xe0e2=['findAll','color','emit','openchannelInteractionTags:save','removeTags','unix','toString','server','files','tmp','join','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','secret','read','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','threadId','pipe','createWriteStream','basename','System','direction','out','value','renderFile','root','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','zip-dir','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','sendStatus','end','status','offset','undefined','limit','count','set','json','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','getOptions','openchannel','query','catch','from','params','model','keys','OpenchannelInteraction','filters','intersection','fields','length','include','options','create','body','find','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','findOne','attributes','nolimit','order','sort','pick','where','OpenchannelInteractionId','filter','$gte','split','format','merge','includeAll','rows','setTags','spread','Tag'];(function(_0x17c959,_0x435685){var _0x32e06b=function(_0x1e8e4a){while(--_0x1e8e4a){_0x17c959['push'](_0x17c959['shift']());}};_0x32e06b(++_0x435685);}(_0xe0e2,0x131));var _0x2e0e=function(_0x4ed9ef,_0x381176){_0x4ed9ef=_0x4ed9ef-0x0;var _0x2bb85b=_0xe0e2[_0x4ed9ef];return _0x2bb85b;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x2e0e('0x0'));var moment=require('moment');var util=require(_0x2e0e('0x1'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2e0e('0x2'));var Redis=require(_0x2e0e('0x3'));var interaction=require(_0x2e0e('0x4'));var qs=require(_0x2e0e('0x5'));var pdf=require(_0x2e0e('0x6'));var logger=require(_0x2e0e('0x7'))(_0x2e0e('0x8'));var config=require(_0x2e0e('0x9'));var db=require(_0x2e0e('0xa'))['db'];config[_0x2e0e('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2e0e('0xc'))(new Redis(config['redis']));require(_0x2e0e('0xd'))['register'](socket);function respondWithStatusCode(_0x2cf118,_0x4573d9){_0x4573d9=_0x4573d9||0xcc;return function(_0x2e7d1b){if(_0x2e7d1b){return _0x2cf118[_0x2e0e('0xe')](_0x4573d9);}return _0x2cf118['status'](_0x4573d9)[_0x2e0e('0xf')]();};}function respondWithResult(_0x11fbea,_0x5909be){_0x5909be=_0x5909be||0xc8;return function(_0x9cc549){if(_0x9cc549){return _0x11fbea[_0x2e0e('0x10')](_0x5909be)['json'](_0x9cc549);}};}function respondWithFilteredResult(_0x48b63a,_0x2709ce){return function(_0x16c555){if(_0x16c555){var _0x59bc07=typeof _0x2709ce[_0x2e0e('0x11')]===_0x2e0e('0x12')&&typeof _0x2709ce[_0x2e0e('0x13')]===_0x2e0e('0x12');var _0x2ffcab=_0x16c555['count'];var _0x536aa8=_0x59bc07?0x0:_0x2709ce[_0x2e0e('0x11')];var _0x2a8fbe=_0x59bc07?_0x16c555[_0x2e0e('0x14')]:_0x2709ce[_0x2e0e('0x11')]+_0x2709ce[_0x2e0e('0x13')];var _0x568655;if(_0x2a8fbe>=_0x2ffcab){_0x2a8fbe=_0x2ffcab;_0x568655=0xc8;}else{_0x568655=0xce;}_0x48b63a['status'](_0x568655);return _0x48b63a[_0x2e0e('0x15')]('Content-Range',_0x536aa8+'-'+_0x2a8fbe+'/'+_0x2ffcab)[_0x2e0e('0x16')](_0x16c555);}return null;};}function saveUpdates(_0x5dc2b5){return function(_0x546f63){if(_0x546f63){return _0x546f63[_0x2e0e('0x17')](_0x5dc2b5)['then'](function(_0x228d18){return _0x228d18;});}return null;};}function removeEntity(_0x36140a){return function(_0x797d67){if(_0x797d67){return _0x797d67[_0x2e0e('0x18')]()[_0x2e0e('0x19')](function(){_0x36140a[_0x2e0e('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11b607){return function(_0x13594e){if(!_0x13594e){_0x11b607[_0x2e0e('0xe')](0x194);}return _0x13594e;};}function handleError(_0x105649,_0x401251){_0x401251=_0x401251||0x1f4;return function(_0x359f89){logger[_0x2e0e('0x1a')](_0x359f89[_0x2e0e('0x1b')]);if(_0x359f89[_0x2e0e('0x1c')]){delete _0x359f89[_0x2e0e('0x1c')];}_0x105649[_0x2e0e('0x10')](_0x401251)[_0x2e0e('0x1d')](_0x359f89);};}exports['index']=function(_0x3c854c,_0x82a1c3){var _0x2d4a99={};var _0xac69d4=_[_0x2e0e('0x1e')](db['OpenchannelInteraction'][_0x2e0e('0x1f')],function(_0xe2f01b){return{'name':_0xe2f01b[_0x2e0e('0x20')],'type':_0xe2f01b[_0x2e0e('0x21')]['key']};});_0x2d4a99=qs[_0x2e0e('0x22')](_0xac69d4,_0x3c854c);return interaction['findAll'](_0x2e0e('0x23'),_0x3c854c[_0x2e0e('0x24')],_0x3c854c['user'],_0x2d4a99,_0xac69d4)[_0x2e0e('0x19')](respondWithFilteredResult(_0x82a1c3,_0x2d4a99))[_0x2e0e('0x25')](handleError(_0x82a1c3,null));};exports['show']=function(_0x3b2f12,_0x5297db){var _0x4802e0={};if(_0x3b2f12[_0x2e0e('0x24')][_0x2e0e('0x21')]&&_0x3b2f12['query'][_0x2e0e('0x21')]===_0x2e0e('0x26')){_0x4802e0[_0x2e0e('0x26')]=_0x3b2f12[_0x2e0e('0x27')]['id'];}else{_0x4802e0['id']=_0x3b2f12[_0x2e0e('0x27')]['id'];}var _0x2dfa30={'raw':![],'where':_0x4802e0},_0x4503d5={};_0x4503d5[_0x2e0e('0x28')]=_[_0x2e0e('0x29')](db[_0x2e0e('0x2a')][_0x2e0e('0x1f')]);_0x4503d5[_0x2e0e('0x24')]=_[_0x2e0e('0x29')](_0x3b2f12['query']);_0x4503d5[_0x2e0e('0x2b')]=_[_0x2e0e('0x2c')](_0x4503d5[_0x2e0e('0x28')],_0x4503d5['query']);_0x2dfa30['attributes']=_[_0x2e0e('0x2c')](_0x4503d5[_0x2e0e('0x28')],qs[_0x2e0e('0x2d')](_0x3b2f12[_0x2e0e('0x24')]['fields']));_0x2dfa30['attributes']=_0x2dfa30['attributes'][_0x2e0e('0x2e')]?_0x2dfa30['attributes']:_0x4503d5[_0x2e0e('0x28')];if(_0x3b2f12[_0x2e0e('0x24')]['includeAll']){_0x2dfa30[_0x2e0e('0x2f')]=[{'all':!![]}];}_0x2dfa30=_['merge']({},_0x2dfa30,_0x3b2f12[_0x2e0e('0x30')]);return db['OpenchannelInteraction']['find'](_0x2dfa30)[_0x2e0e('0x19')](handleEntityNotFound(_0x5297db,null))[_0x2e0e('0x19')](respondWithResult(_0x5297db,null))[_0x2e0e('0x25')](handleError(_0x5297db,null));};exports['create']=function(_0x43c3a7,_0x22880d){return db[_0x2e0e('0x2a')][_0x2e0e('0x31')](_0x43c3a7['body'],{})[_0x2e0e('0x19')](respondWithResult(_0x22880d,0xc9))['catch'](handleError(_0x22880d,null));};exports['update']=function(_0x4ff698,_0x423e27){if(_0x4ff698[_0x2e0e('0x32')]['id']){delete _0x4ff698[_0x2e0e('0x32')]['id'];}return db['OpenchannelInteraction'][_0x2e0e('0x33')]({'where':{'id':_0x4ff698[_0x2e0e('0x27')]['id']}})[_0x2e0e('0x19')](handleEntityNotFound(_0x423e27,null))[_0x2e0e('0x19')](saveUpdates(_0x4ff698[_0x2e0e('0x32')],null))[_0x2e0e('0x19')](respondWithResult(_0x423e27,null))['catch'](handleError(_0x423e27,null));};exports[_0x2e0e('0x18')]=function(_0xd3bc5b,_0x43777f){return db[_0x2e0e('0x2a')][_0x2e0e('0x33')]({'where':{'id':_0xd3bc5b[_0x2e0e('0x27')]['id']}})[_0x2e0e('0x19')](handleEntityNotFound(_0x43777f,null))[_0x2e0e('0x19')](removeEntity(_0x43777f,null))[_0x2e0e('0x25')](handleError(_0x43777f,null));};exports[_0x2e0e('0x34')]=function(_0x40be95,_0x326881){return db[_0x2e0e('0x2a')][_0x2e0e('0x34')]()['then'](respondWithResult(_0x326881,null))[_0x2e0e('0x25')](handleError(_0x326881,null));};exports['addMessage']=function(_0x2bc1fe,_0x997f6c){return db[_0x2e0e('0x35')][_0x2e0e('0x33')]({'where':{'id':_0x2bc1fe[_0x2e0e('0x27')]['id']}})[_0x2e0e('0x19')](handleEntityNotFound(_0x997f6c,null))[_0x2e0e('0x19')](function(_0x40019f){if(_0x40019f){return _0x40019f[_0x2e0e('0x36')](_0x2bc1fe[_0x2e0e('0x32')][_0x2e0e('0x37')],_[_0x2e0e('0x38')](_0x2bc1fe[_0x2e0e('0x32')],[_0x2e0e('0x37'),'id'])||{});}})[_0x2e0e('0x19')](respondWithResult(_0x997f6c,null))[_0x2e0e('0x25')](handleError(_0x997f6c,null));};exports[_0x2e0e('0x39')]=function(_0x19b534,_0xa3b6e6){var _0x205d4b={'raw':![],'where':{}};var _0x4d06d2={};var _0x2f8421={'count':0x0,'rows':[]};return db[_0x2e0e('0x2a')][_0x2e0e('0x3a')]({'where':{'id':_0x19b534[_0x2e0e('0x27')]['id']}})['then'](handleEntityNotFound(_0xa3b6e6,null))[_0x2e0e('0x19')](function(_0x22de3f){if(_0x22de3f){_0x4d06d2[_0x2e0e('0x28')]=_[_0x2e0e('0x29')](db[_0x2e0e('0x35')][_0x2e0e('0x1f')]);_0x4d06d2[_0x2e0e('0x24')]=_[_0x2e0e('0x29')](_0x19b534[_0x2e0e('0x24')]);_0x4d06d2['filters']=_[_0x2e0e('0x2c')](_0x4d06d2[_0x2e0e('0x28')],_0x4d06d2['query']);_0x205d4b[_0x2e0e('0x3b')]=_[_0x2e0e('0x2c')](_0x4d06d2[_0x2e0e('0x28')],qs[_0x2e0e('0x2d')](_0x19b534[_0x2e0e('0x24')][_0x2e0e('0x2d')]));_0x205d4b[_0x2e0e('0x3b')]=_0x205d4b[_0x2e0e('0x3b')][_0x2e0e('0x2e')]?_0x205d4b[_0x2e0e('0x3b')]:_0x4d06d2[_0x2e0e('0x28')];if(!_0x19b534[_0x2e0e('0x24')]['hasOwnProperty'](_0x2e0e('0x3c'))){_0x205d4b[_0x2e0e('0x13')]=qs[_0x2e0e('0x13')](_0x19b534[_0x2e0e('0x24')][_0x2e0e('0x13')]);_0x205d4b[_0x2e0e('0x11')]=qs['offset'](_0x19b534[_0x2e0e('0x24')][_0x2e0e('0x11')]);}_0x205d4b[_0x2e0e('0x3d')]=qs[_0x2e0e('0x3e')](_0x19b534[_0x2e0e('0x24')][_0x2e0e('0x3e')]);_0x205d4b['where']=qs['filters'](_[_0x2e0e('0x3f')](_0x19b534['query'],_0x4d06d2[_0x2e0e('0x2b')]));_0x205d4b[_0x2e0e('0x40')][_0x2e0e('0x41')]=_0x22de3f['id'];if(_0x19b534[_0x2e0e('0x24')]['filter']){_0x205d4b[_0x2e0e('0x40')]=_['merge'](_0x205d4b[_0x2e0e('0x40')],{'$or':_[_0x2e0e('0x1e')](_0x205d4b['attributes'],function(_0x34badd){var _0x9b33cc={};_0x9b33cc[_0x34badd]={'$like':'%'+_0x19b534[_0x2e0e('0x24')][_0x2e0e('0x42')]+'%'};return _0x9b33cc;})});}if(_0x19b534[_0x2e0e('0x24')][_0x2e0e('0x43')]){var _0x55a767=_0x19b534[_0x2e0e('0x24')]['$gte'][_0x2e0e('0x44')](',');var _0x4b6e7d={};_0x4b6e7d[_0x55a767[0x0]]={'$gte':moment(_0x55a767[0x1])[_0x2e0e('0x45')]('YYYY-MM-DD\x20HH:mm:ss')};_0x205d4b[_0x2e0e('0x40')]=_['merge'](_0x205d4b[_0x2e0e('0x40')],_0x4b6e7d);}_0x205d4b=_[_0x2e0e('0x46')]({},_0x205d4b,_0x19b534['options']);return db[_0x2e0e('0x35')][_0x2e0e('0x14')]({'where':_0x205d4b[_0x2e0e('0x40')]})['then'](function(_0x4ff74f){_0x2f8421[_0x2e0e('0x14')]=_0x4ff74f;if(_0x19b534[_0x2e0e('0x24')][_0x2e0e('0x47')]){_0x205d4b['include']=[{'all':!![]}];}return db[_0x2e0e('0x35')]['findAll'](_0x205d4b);})[_0x2e0e('0x19')](function(_0x401f4b){_0x2f8421[_0x2e0e('0x48')]=_0x401f4b;return _0x2f8421;});}})[_0x2e0e('0x19')](respondWithFilteredResult(_0xa3b6e6,_0x205d4b))[_0x2e0e('0x25')](handleError(_0xa3b6e6,null));};exports['addTags']=function(_0x5ce50f,_0x548ace){return db[_0x2e0e('0x2a')]['find']({'where':{'id':_0x5ce50f[_0x2e0e('0x27')]['id']}})[_0x2e0e('0x19')](handleEntityNotFound(_0x548ace,null))[_0x2e0e('0x19')](function(_0x35169b){if(_0x35169b){return _0x35169b[_0x2e0e('0x49')](_0x5ce50f[_0x2e0e('0x32')][_0x2e0e('0x37')],_['omit'](_0x5ce50f[_0x2e0e('0x32')],['ids','id'])||{})[_0x2e0e('0x4a')](function(){return db[_0x2e0e('0x4b')][_0x2e0e('0x4c')]({'attributes':['id',_0x2e0e('0x1c'),_0x2e0e('0x4d')],'where':{'id':_0x5ce50f[_0x2e0e('0x32')][_0x2e0e('0x37')]}});})[_0x2e0e('0x19')](function(_0x50ca60){socket[_0x2e0e('0x4e')](_0x2e0e('0x4f'),{'id':Number(_0x5ce50f[_0x2e0e('0x27')]['id']),'tags':_0x50ca60||[]});return{'id':Number(_0x5ce50f['params']['id']),'tags':_0x50ca60||[]};});}})[_0x2e0e('0x19')](respondWithResult(_0x548ace,null))[_0x2e0e('0x25')](handleError(_0x548ace,null));};exports[_0x2e0e('0x50')]=function(_0x2dcf7c,_0x4d7a12){return db[_0x2e0e('0x2a')]['find']({'where':{'id':_0x2dcf7c[_0x2e0e('0x27')]['id']}})[_0x2e0e('0x19')](handleEntityNotFound(_0x4d7a12,null))['then'](function(_0x599975){if(_0x599975){return _0x599975[_0x2e0e('0x50')](_0x2dcf7c[_0x2e0e('0x24')]['ids']);}})[_0x2e0e('0x19')](respondWithStatusCode(_0x4d7a12,null))['catch'](handleError(_0x4d7a12,null));};exports['download']=function(_0x41f562,_0x136f54){var _0x127412=moment()[_0x2e0e('0x51')]()[_0x2e0e('0x52')]();var _0x313283=path['join'](config['root'],_0x2e0e('0x53'),_0x2e0e('0x54'),_0x2e0e('0x55'));var _0x5a1901=path[_0x2e0e('0x56')](config['root'],_0x2e0e('0x53'),_0x2e0e('0x54'),'attachments');var _0x28dfe6=path['join'](_0x313283,_0x127412);var _0x2fcc18=util['format']('transcript-%d-%s.zip',_0x41f562[_0x2e0e('0x27')]['id'],_0x127412);var _0x10e15b=path[_0x2e0e('0x56')](_0x313283,_0x2fcc18);var _0xa19c6d=[];_0xa19c6d[_0x2e0e('0x57')]({'model':db['User'],'as':_0x2e0e('0x58'),'attributes':['id',_0x2e0e('0x59')],'raw':!![]});_0xa19c6d[_0x2e0e('0x57')]({'model':db[_0x2e0e('0x5a')],'as':_0x2e0e('0x5b'),'attributes':['id',_0x2e0e('0x5c'),_0x2e0e('0x5d')],'raw':!![]});if(_0x41f562[_0x2e0e('0x24')]['attachments']){_0xa19c6d[_0x2e0e('0x57')]({'model':db['Attachment'],'as':_0x2e0e('0x5e'),'raw':!![]});}var _0x1f5d7f=[{'model':db['OpenchannelMessage'],'as':_0x2e0e('0x5f'),'attributes':['id',_0x2e0e('0x32'),_0x2e0e('0x60'),'direction',_0x2e0e('0x61'),_0x2e0e('0x62')],'include':_0xa19c6d}];_0x1f5d7f[_0x2e0e('0x57')]({'model':db[_0x2e0e('0x63')],'as':_0x2e0e('0x64'),'attributes':['id',_0x2e0e('0x1c')]});_0x1f5d7f[_0x2e0e('0x57')]({'model':db[_0x2e0e('0x58')],'as':_0x2e0e('0x65'),'attributes':['id',_0x2e0e('0x59')]});return db[_0x2e0e('0x2a')][_0x2e0e('0x33')]({'where':{'id':_0x41f562[_0x2e0e('0x27')]['id']},'include':_0x1f5d7f})['then'](handleEntityNotFound(_0x136f54,null))[_0x2e0e('0x19')](function(_0x1f6873){if(_0x1f6873){var _0x4d5a8a=_0x1f6873[_0x2e0e('0x66')]({'plain':!![]});fs[_0x2e0e('0x67')](_0x28dfe6);var _0x2b16f7={'channel':_0x2e0e('0x68'),'account':_0x4d5a8a[_0x2e0e('0x64')][_0x2e0e('0x1c')],'agent':_0x4d5a8a[_0x2e0e('0x65')]?_0x4d5a8a[_0x2e0e('0x65')]['fullname']:_0x2e0e('0x69'),'createdAt':moment(_0x4d5a8a['createdAt'])[_0x2e0e('0x45')](_0x2e0e('0x6a'))[_0x2e0e('0x52')](),'closedAt':_0x4d5a8a[_0x2e0e('0x6b')]?moment(_0x4d5a8a[_0x2e0e('0x6c')])[_0x2e0e('0x45')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2e0e('0x52')]():'','disposition':_0x4d5a8a[_0x2e0e('0x6d')],'visibility':_0x4d5a8a[_0x2e0e('0x6e')]?'Public':'Private','messages':_(_0x4d5a8a[_0x2e0e('0x5f')])[_0x2e0e('0x42')]({'secret':![]})[_0x2e0e('0x1e')](function(_0x590a26){if(_0x590a26['Attachment']){var _0x209cc6=path['join'](_0x5a1901,_0x590a26[_0x2e0e('0x5e')]['basename']);if(fs['existsSync'](_0x209cc6)){fs['createReadStream'](_0x209cc6)[_0x2e0e('0x6f')](fs[_0x2e0e('0x70')](path[_0x2e0e('0x56')](_0x28dfe6,_0x590a26['Attachment'][_0x2e0e('0x71')])));}}return{'date':moment(_0x590a26[_0x2e0e('0x60')])[_0x2e0e('0x45')](_0x2e0e('0x6a'))[_0x2e0e('0x52')](),'sender':_0x590a26['direction']==='out'?_0x590a26[_0x2e0e('0x58')]?_0x590a26[_0x2e0e('0x58')]['fullname']:_0x2e0e('0x72'):_0x590a26[_0x2e0e('0x5b')][_0x2e0e('0x5c')]+(_0x590a26[_0x2e0e('0x5b')][_0x2e0e('0x5d')]?'\x20'+_0x590a26['Contact']['lastName']:''),'body':_0x590a26['Attachment']?_0x590a26[_0x2e0e('0x5e')][_0x2e0e('0x71')]:_0x590a26[_0x2e0e('0x32')],'direction':_0x590a26[_0x2e0e('0x73')]===_0x2e0e('0x74')?'A':'C','secret':_0x590a26['secret'],'read':_0x590a26[_0x2e0e('0x62')],'attachment':_0x590a26['Attachment']};})[_0x2e0e('0x75')]()};return ejs[_0x2e0e('0x76')](path[_0x2e0e('0x56')](config[_0x2e0e('0x77')],'server','views',_0x2e0e('0x78')),{'interaction':_0x2b16f7})[_0x2e0e('0x19')](function(_0x35a0f6){var _0x32a52a=path[_0x2e0e('0x56')](_0x28dfe6,_0x2e0e('0x79')+_0x4d5a8a['id']+'-'+_0x127412+_0x2e0e('0x7a'));var _0x54f6a1={'path':_0x32a52a,'channel':_0x2e0e('0x68'),'interactionId':_0x4d5a8a['id']};return pdf[_0x2e0e('0x7b')](_0x35a0f6,_0x54f6a1);})['then'](function(){return new Promise(function(_0x45df47,_0x42c106){zipdir(_0x28dfe6,{'saveTo':_0x10e15b},function(_0x911bfc,_0xd485e7){if(_0x911bfc)return _0x42c106(_0x911bfc);return _0x45df47(_0xd485e7);});})[_0x2e0e('0x19')](function(){return new Promise(function(_0x5674b9,_0x3b3b38){rimraf(_0x28dfe6,function(_0x2a11b5){if(_0x2a11b5)_0x3b3b38(_0x2a11b5);return _0x5674b9();});});})[_0x2e0e('0x19')](function(){return _0x136f54[_0x2e0e('0x7c')](_0x10e15b,_0x2fcc18,function(_0x1f5a1e){if(_0x1f5a1e){logger[_0x2e0e('0x1a')](_0x2e0e('0x7d'),_0x1f5a1e);}else{fs[_0x2e0e('0x7e')](_0x10e15b);}});});});}else{return _0x136f54[_0x2e0e('0xe')](0xc8);}})[_0x2e0e('0x25')](handleError(_0x136f54,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 0d4664e..456501b 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.events.js +++ b/server/api/openchannelInteraction/openchannelInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b24=['unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','save','remove','getUsers','map','findAll','then','setDataValue'];(function(_0x25889e,_0x6e08a){var _0x435308=function(_0x1bd99b){while(--_0x1bd99b){_0x25889e['push'](_0x25889e['shift']());}};_0x435308(++_0x6e08a);}(_0x8b24,0x10f));var _0x48b2=function(_0x3f3b53,_0x28c90d){_0x3f3b53=_0x3f3b53-0x0;var _0x48dace=_0x8b24[_0x3f3b53];return _0x48dace;};'use strict';var EventEmitter=require(_0x48b2('0x0'));var OpenchannelInteraction=require(_0x48b2('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x48b2('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x48b2('0x2'),'afterUpdate':'update','afterDestroy':_0x48b2('0x3')};function emitEvent(_0x26c986){return function(_0x2efd22,_0x5eddf0,_0x5b1094){_0x2efd22[_0x48b2('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x43b86e){_0x2efd22['setDataValue']('Users',_0x43b86e[_0x48b2('0x5')](function(_0x281652){return{'id':_0x281652['id']};}));return OpenchannelMessage[_0x48b2('0x6')]({'where':{'OpenchannelInteractionId':_0x2efd22['id'],'direction':'in','read':![]},'raw':!![]});})[_0x48b2('0x7')](function(_0x5d7fb8){_0x2efd22[_0x48b2('0x8')](_0x48b2('0x9'),_0x5d7fb8[_0x48b2('0xa')]);OpenchannelInteractionEvents['emit'](_0x26c986+':'+_0x2efd22['id'],_0x2efd22);OpenchannelInteractionEvents[_0x48b2('0xb')](_0x26c986,_0x2efd22);_0x5b1094(null);})[_0x48b2('0xc')](_0x5b1094(null));};}for(var e in events){if(events[_0x48b2('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0xc932=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','catch'];(function(_0x54b749,_0x45913f){var _0x5a1b77=function(_0x462b04){while(--_0x462b04){_0x54b749['push'](_0x54b749['shift']());}};_0x5a1b77(++_0x45913f);}(_0xc932,0xa5));var _0x2c93=function(_0x113e32,_0x5339f0){_0x113e32=_0x113e32-0x0;var _0x4ff939=_0xc932[_0x113e32];return _0x4ff939;};'use strict';var EventEmitter=require(_0x2c93('0x0'));var OpenchannelInteraction=require(_0x2c93('0x1'))['db'][_0x2c93('0x2')];var OpenchannelMessage=require(_0x2c93('0x1'))['db'][_0x2c93('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x2c93('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2c93('0x5'),'afterDestroy':'remove'};function emitEvent(_0x40ef4b){return function(_0x31cddb,_0x53f840,_0x4d3f99){_0x31cddb[_0x2c93('0x6')]({'attributes':['id'],'raw':!![]})[_0x2c93('0x7')](function(_0x113e78){_0x31cddb['setDataValue'](_0x2c93('0x8'),_0x113e78[_0x2c93('0x9')](function(_0x4d4d9e){return{'id':_0x4d4d9e['id']};}));return OpenchannelMessage[_0x2c93('0xa')]({'where':{'OpenchannelInteractionId':_0x31cddb['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2337c3){_0x31cddb[_0x2c93('0xb')](_0x2c93('0xc'),_0x2337c3['length']);OpenchannelInteractionEvents[_0x2c93('0xd')](_0x40ef4b+':'+_0x31cddb['id'],_0x31cddb);OpenchannelInteractionEvents[_0x2c93('0xd')](_0x40ef4b,_0x31cddb);_0x4d3f99(null);})[_0x2c93('0xe')](_0x4d3f99(null));};}for(var e in events){if(events[_0x2c93('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x2c93('0x10')](e,emitEvent(event));}}module[_0x2c93('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index bd6adba..543837c 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.model.js +++ b/server/api/openchannelInteraction/openchannelInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x08af=['changed','closedAt','lodash','util','api','bluebird','request-promise','path','rimraf','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x08af,0x1c2));var _0xf08a=function(_0x548483,_0x5e53ab){_0x548483=_0x548483-0x0;var _0x53afbd=_0x08af[_0x548483];return _0x53afbd;};'use strict';var _=require(_0xf08a('0x0'));var util=require(_0xf08a('0x1'));var logger=require('../../config/logger')(_0xf08a('0x2'));var moment=require('moment');var BPromise=require(_0xf08a('0x3'));var rp=require(_0xf08a('0x4'));var fs=require('fs');var path=require(_0xf08a('0x5'));var rimraf=require(_0xf08a('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x14ab52,_0x1671bc){return _0x14ab52[_0xf08a('0x7')](_0xf08a('0x8'),attributes,{'tableName':_0xf08a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf08a('0xa'),'collate':_0xf08a('0xb'),'hooks':{'beforeUpdate':function(_0x50d443,_0x7aaf98,_0xeb1e64){if(_0x50d443[_0xf08a('0xc')]('closed')){_0x50d443[_0xf08a('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0xeb1e64(null,_0x50d443);}}});}; \ No newline at end of file +var _0x36f3=['../../config/environment','exports','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5a0b5d,_0x573027){var _0x583ff7=function(_0x8b2a63){while(--_0x8b2a63){_0x5a0b5d['push'](_0x5a0b5d['shift']());}};_0x583ff7(++_0x573027);}(_0x36f3,0xe6));var _0x336f=function(_0x153afb,_0x2573a2){_0x153afb=_0x153afb-0x0;var _0x28a67e=_0x36f3[_0x153afb];return _0x28a67e;};'use strict';var _=require('lodash');var util=require(_0x336f('0x0'));var logger=require(_0x336f('0x1'))(_0x336f('0x2'));var moment=require(_0x336f('0x3'));var BPromise=require(_0x336f('0x4'));var rp=require(_0x336f('0x5'));var fs=require('fs');var path=require(_0x336f('0x6'));var rimraf=require(_0x336f('0x7'));var config=require(_0x336f('0x8'));var attributes=require('./openchannelInteraction.attributes');module[_0x336f('0x9')]=function(_0x267661,_0xf85f24){return _0x267661['define']('OpenchannelInteraction',attributes,{'tableName':_0x336f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x336f('0xb'),'collate':_0x336f('0xc'),'hooks':{'beforeUpdate':function(_0xf34284,_0x3c5f5a,_0x176178){if(_0xf34284[_0x336f('0xd')](_0x336f('0xe'))){_0xf34284['closedAt']=moment()[_0x336f('0xf')](_0x336f('0x10'));}_0x176178(null,_0xf34284);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 8374c34..a6fb0f9 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.rpc.js +++ b/server/api/openchannelInteraction/openchannelInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44d8=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateOpenchannelInteraction','options','raw','attributes','limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','body','ids','omit','AddTags','lodash','util','moment','bluebird','ioredis'];(function(_0x524c4f,_0x2d1842){var _0x4656cb=function(_0xef5a42){while(--_0xef5a42){_0x524c4f['push'](_0x524c4f['shift']());}};_0x4656cb(++_0x2d1842);}(_0x44d8,0x1d4));var _0x844d=function(_0x4bbab0,_0xdfbcc9){_0x4bbab0=_0x4bbab0-0x0;var _0x2e9560=_0x44d8[_0x4bbab0];return _0x2e9560;};'use strict';var _=require(_0x844d('0x0'));var util=require(_0x844d('0x1'));var moment=require(_0x844d('0x2'));var BPromise=require(_0x844d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x844d('0x4'));var db=require(_0x844d('0x5'))['db'];var utils=require(_0x844d('0x6'));var logger=require(_0x844d('0x7'))(_0x844d('0x8'));var config=require(_0x844d('0x9'));var jayson=require(_0x844d('0xa'));var client=jayson[_0x844d('0xb')][_0x844d('0xc')]({'port':0x232a});config[_0x844d('0xd')]=_['defaults'](config[_0x844d('0xd')],{'host':_0x844d('0xe'),'port':0x18eb});var socket=require(_0x844d('0xf'))(new Redis(config[_0x844d('0xd')]));require(_0x844d('0x10'))[_0x844d('0x11')](socket);function respondWithRpcPromise(_0x4a4f15,_0x20055d,_0x3408cf){return new BPromise(function(_0x44e829,_0x305a24){return client[_0x844d('0x12')](_0x4a4f15,_0x3408cf)[_0x844d('0x13')](function(_0x2af4a8){logger[_0x844d('0x14')](_0x844d('0x15'),_0x20055d,'request\x20sent');logger[_0x844d('0x16')](_0x844d('0x17'),_0x20055d,_0x844d('0x18'),JSON[_0x844d('0x19')](_0x2af4a8));if(_0x2af4a8[_0x844d('0x1a')]){if(_0x2af4a8['error']['code']===0x1f4){logger[_0x844d('0x1a')](_0x844d('0x15'),_0x20055d,_0x2af4a8[_0x844d('0x1a')][_0x844d('0x1b')]);return _0x305a24(_0x2af4a8[_0x844d('0x1a')][_0x844d('0x1b')]);}logger['error'](_0x844d('0x15'),_0x20055d,_0x2af4a8[_0x844d('0x1a')][_0x844d('0x1b')]);return _0x44e829(_0x2af4a8[_0x844d('0x1a')]['message']);}else{logger['info'](_0x844d('0x15'),_0x20055d,_0x844d('0x18'));_0x44e829(_0x2af4a8[_0x844d('0x1c')]['message']);}})[_0x844d('0x1d')](function(_0x85cc8a){logger[_0x844d('0x1a')](_0x844d('0x15'),_0x20055d,_0x85cc8a);_0x305a24(_0x85cc8a);});});}exports[_0x844d('0x1e')]=function(_0x43e40c){var _0x205030=this;return new Promise(function(_0x2c4307,_0x4320c1){return db['OpenchannelInteraction']['update'](_0x43e40c['body'],{'raw':_0x43e40c['options']?_0x43e40c[_0x844d('0x1f')][_0x844d('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43e40c['options']?_0x43e40c[_0x844d('0x1f')]['where']||null:null,'attributes':_0x43e40c[_0x844d('0x1f')]?_0x43e40c[_0x844d('0x1f')][_0x844d('0x21')]||null:null,'limit':_0x43e40c[_0x844d('0x1f')]?_0x43e40c[_0x844d('0x1f')][_0x844d('0x22')]||null:null})[_0x844d('0x13')](function(_0x4d15a3){logger['info'](_0x844d('0x1e'),_0x43e40c);logger[_0x844d('0x16')](_0x844d('0x1e'),_0x43e40c,JSON[_0x844d('0x19')](_0x4d15a3));_0x2c4307(_0x4d15a3);})[_0x844d('0x1d')](function(_0x4eb3d8){logger['error'](_0x844d('0x1e'),_0x4eb3d8[_0x844d('0x1b')],_0x43e40c);_0x4320c1(_0x205030['error'](0x1f4,_0x4eb3d8[_0x844d('0x1b')]));});});};exports[_0x844d('0x23')]=function(_0x90a871){return new Promise(function(_0x10e972,_0x1d3ced){return db[_0x844d('0x24')][_0x844d('0x25')]({'where':_0x90a871[_0x844d('0x1f')]?_0x90a871['options']['where']||null:null})['then'](function(_0x56aead){if(_0x56aead){return _0x56aead[_0x844d('0x26')](_0x90a871[_0x844d('0x27')][_0x844d('0x28')],_[_0x844d('0x29')](_0x90a871[_0x844d('0x27')],[_0x844d('0x28'),'id'])||{});}})['spread'](function(_0x303166){logger['info'](_0x844d('0x2a'),_0x90a871);logger['debug']('AddTags',_0x90a871,JSON[_0x844d('0x19')](_0x303166));_0x10e972(_0x303166);})[_0x844d('0x1d')](function(_0xc8795b){logger[_0x844d('0x1a')](_0x844d('0x2a'),_0xc8795b['message'],_0x90a871);_0x1d3ced(_this[_0x844d('0x1a')](0x1f4,_0xc8795b[_0x844d('0x1b')]));});});}; \ No newline at end of file +var _0xd39d=['AddTags','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelInteraction','update','raw','options','where','limit','debug','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','addTags','ids','body'];(function(_0x296086,_0x2b0bdd){var _0x550565=function(_0x1a1440){while(--_0x1a1440){_0x296086['push'](_0x296086['shift']());}};_0x550565(++_0x2b0bdd);}(_0xd39d,0x99));var _0xdd39=function(_0x2170e3,_0x39d8c4){_0x2170e3=_0x2170e3-0x0;var _0x4b1363=_0xd39d[_0x2170e3];return _0x4b1363;};'use strict';var _=require(_0xdd39('0x0'));var util=require(_0xdd39('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd39('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd39('0x3'));var logger=require(_0xdd39('0x4'))(_0xdd39('0x5'));var config=require(_0xdd39('0x6'));var jayson=require(_0xdd39('0x7'));var client=jayson['client'][_0xdd39('0x8')]({'port':0x232a});config[_0xdd39('0x9')]=_[_0xdd39('0xa')](config[_0xdd39('0x9')],{'host':_0xdd39('0xb'),'port':0x18eb});var socket=require(_0xdd39('0xc'))(new Redis(config['redis']));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x116b1a,_0x52f892,_0x3a5721){return new BPromise(function(_0x3d545f,_0x3f4879){return client['request'](_0x116b1a,_0x3a5721)[_0xdd39('0xd')](function(_0x1f3223){logger[_0xdd39('0xe')](_0xdd39('0xf'),_0x52f892,_0xdd39('0x10'));logger['debug'](_0xdd39('0x11'),_0x52f892,_0xdd39('0x10'),JSON[_0xdd39('0x12')](_0x1f3223));if(_0x1f3223[_0xdd39('0x13')]){if(_0x1f3223[_0xdd39('0x13')][_0xdd39('0x14')]===0x1f4){logger['error'](_0xdd39('0xf'),_0x52f892,_0x1f3223[_0xdd39('0x13')]['message']);return _0x3f4879(_0x1f3223['error']['message']);}logger[_0xdd39('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x52f892,_0x1f3223[_0xdd39('0x13')][_0xdd39('0x15')]);return _0x3d545f(_0x1f3223[_0xdd39('0x13')][_0xdd39('0x15')]);}else{logger['info'](_0xdd39('0xf'),_0x52f892,_0xdd39('0x10'));_0x3d545f(_0x1f3223[_0xdd39('0x16')]['message']);}})[_0xdd39('0x17')](function(_0x34fe2e){logger[_0xdd39('0x13')](_0xdd39('0xf'),_0x52f892,_0x34fe2e);_0x3f4879(_0x34fe2e);});});}exports['UpdateOpenchannelInteraction']=function(_0x2b5752){var _0x3f2ff2=this;return new Promise(function(_0x32b68b,_0x38d33f){return db[_0xdd39('0x18')][_0xdd39('0x19')](_0x2b5752['body'],{'raw':_0x2b5752['options']?_0x2b5752['options'][_0xdd39('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b5752[_0xdd39('0x1b')]?_0x2b5752[_0xdd39('0x1b')][_0xdd39('0x1c')]||null:null,'attributes':_0x2b5752[_0xdd39('0x1b')]?_0x2b5752[_0xdd39('0x1b')]['attributes']||null:null,'limit':_0x2b5752[_0xdd39('0x1b')]?_0x2b5752[_0xdd39('0x1b')][_0xdd39('0x1d')]||null:null})['then'](function(_0x3a3090){logger[_0xdd39('0xe')]('UpdateOpenchannelInteraction',_0x2b5752);logger[_0xdd39('0x1e')](_0xdd39('0x1f'),_0x2b5752,JSON[_0xdd39('0x12')](_0x3a3090));_0x32b68b(_0x3a3090);})[_0xdd39('0x17')](function(_0x2a8313){logger[_0xdd39('0x13')](_0xdd39('0x1f'),_0x2a8313[_0xdd39('0x15')],_0x2b5752);_0x38d33f(_0x3f2ff2[_0xdd39('0x13')](0x1f4,_0x2a8313['message']));});});};exports[_0xdd39('0x20')]=function(_0x5bb64e){return new Promise(function(_0x12792c,_0x3fa4f3){return db[_0xdd39('0x18')][_0xdd39('0x21')]({'where':_0x5bb64e[_0xdd39('0x1b')]?_0x5bb64e[_0xdd39('0x1b')][_0xdd39('0x1c')]||null:null})[_0xdd39('0xd')](function(_0x284740){if(_0x284740){return _0x284740[_0xdd39('0x22')](_0x5bb64e['body'][_0xdd39('0x23')],_['omit'](_0x5bb64e[_0xdd39('0x24')],[_0xdd39('0x23'),'id'])||{});}})['spread'](function(_0x297bb8){logger[_0xdd39('0xe')](_0xdd39('0x25'),_0x5bb64e);logger[_0xdd39('0x1e')](_0xdd39('0x25'),_0x5bb64e,JSON[_0xdd39('0x12')](_0x297bb8));_0x12792c(_0x297bb8);})[_0xdd39('0x17')](function(_0x261eca){logger[_0xdd39('0x13')](_0xdd39('0x25'),_0x261eca['message'],_0x5bb64e);_0x3fa4f3(_this[_0xdd39('0x13')](0x1f4,_0x261eca[_0xdd39('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index b1917ff..f4df700 100644 --- a/server/api/openchannelInteraction/openchannelInteraction.socket.js +++ b/server/api/openchannelInteraction/openchannelInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9a8=['./openchannelInteraction.events','save','remove','update','emit','removeListener','register','length','openchannelInteraction:'];(function(_0x43ac17,_0x136057){var _0x44ee42=function(_0x1adf5d){while(--_0x1adf5d){_0x43ac17['push'](_0x43ac17['shift']());}};_0x44ee42(++_0x136057);}(_0xb9a8,0xe1));var _0x8b9a=function(_0x4c27f6,_0x4ef343){_0x4c27f6=_0x4c27f6-0x0;var _0x5823a4=_0xb9a8[_0x4c27f6];return _0x5823a4;};'use strict';var OpenchannelInteractionEvents=require(_0x8b9a('0x0'));var events=[_0x8b9a('0x1'),_0x8b9a('0x2'),_0x8b9a('0x3')];function createListener(_0x3714f7,_0xe2766e){return function(_0x42a972){_0xe2766e[_0x8b9a('0x4')](_0x3714f7,_0x42a972);};}function removeListener(_0x70ea1d,_0x2e53a7){return function(){OpenchannelInteractionEvents[_0x8b9a('0x5')](_0x70ea1d,_0x2e53a7);};}exports[_0x8b9a('0x6')]=function(_0x5d54e5){for(var _0xc0b1ca=0x0,_0x1d6cbb=events[_0x8b9a('0x7')];_0xc0b1ca<_0x1d6cbb;_0xc0b1ca++){var _0x440a7c=events[_0xc0b1ca];var _0x30b954=createListener(_0x8b9a('0x8')+_0x440a7c,_0x5d54e5);OpenchannelInteractionEvents['on'](_0x440a7c,_0x30b954);}}; \ No newline at end of file +var _0x3b21=['emit','removeListener','length','openchannelInteraction:','./openchannelInteraction.events','update'];(function(_0xdb5808,_0x58c067){var _0x111072=function(_0x3c3f27){while(--_0x3c3f27){_0xdb5808['push'](_0xdb5808['shift']());}};_0x111072(++_0x58c067);}(_0x3b21,0x11e));var _0x13b2=function(_0x3a86d1,_0x2f07cd){_0x3a86d1=_0x3a86d1-0x0;var _0x3b91ff=_0x3b21[_0x3a86d1];return _0x3b91ff;};'use strict';var OpenchannelInteractionEvents=require(_0x13b2('0x0'));var events=['save','remove',_0x13b2('0x1')];function createListener(_0x200bc7,_0x226b7a){return function(_0x1d8cbf){_0x226b7a[_0x13b2('0x2')](_0x200bc7,_0x1d8cbf);};}function removeListener(_0x2a340b,_0x3bf2c0){return function(){OpenchannelInteractionEvents[_0x13b2('0x3')](_0x2a340b,_0x3bf2c0);};}exports['register']=function(_0x3ce594){for(var _0x133b19=0x0,_0x455d43=events[_0x13b2('0x4')];_0x133b19<_0x455d43;_0x133b19++){var _0x4060fe=events[_0x133b19];var _0x5e9d59=createListener(_0x13b2('0x5')+_0x4060fe,_0x3ce594);OpenchannelInteractionEvents['on'](_0x4060fe,_0x5e9d59);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 13086d0..01b52db 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x56ef51,_0x381d1e){var _0x46f6d8=function(_0x496f5e){while(--_0x496f5e){_0x56ef51['push'](_0x56ef51['shift']());}};_0x46f6d8(++_0x381d1e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index b399979..84c079e 100644 --- a/server/api/openchannelMessage/openchannelMessage.attributes.js +++ b/server/api/openchannelMessage/openchannelMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c3d=['TEXT','medium','BOOLEAN','out','DATE','STRING','exports'];(function(_0x427cb5,_0x2e802e){var _0x391427=function(_0x4aea72){while(--_0x4aea72){_0x427cb5['push'](_0x427cb5['shift']());}};_0x391427(++_0x2e802e);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x23346c,_0x524fb6){_0x23346c=_0x23346c-0x0;var _0x13d53d=_0x1c3d[_0x23346c];return _0x13d53d;};'use strict';var Sequelize=require('sequelize');module[_0xd1c3('0x0')]={'body':{'type':Sequelize[_0xd1c3('0x1')](_0xd1c3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd1c3('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd1c3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xd1c3('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd1c3('0x5')]},'providerName':{'type':Sequelize[_0xd1c3('0x6')]},'providerResponse':{'type':Sequelize[_0xd1c3('0x1')]}}; \ No newline at end of file +var _0x65c9=['exports','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT','sequelize'];(function(_0x13fcd2,_0x4765b5){var _0x205d2a=function(_0x22472d){while(--_0x22472d){_0x13fcd2['push'](_0x13fcd2['shift']());}};_0x205d2a(++_0x4765b5);}(_0x65c9,0x182));var _0x965c=function(_0x5f4b51,_0x4f5510){_0x5f4b51=_0x5f4b51-0x0;var _0x114f2b=_0x65c9[_0x5f4b51];return _0x114f2b;};'use strict';var Sequelize=require(_0x965c('0x0'));module[_0x965c('0x1')]={'body':{'type':Sequelize['TEXT'](_0x965c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x965c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x965c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x965c('0x4')]('in',_0x965c('0x5')),'defaultValue':_0x965c('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x965c('0x6')]},'providerName':{'type':Sequelize[_0x965c('0x7')]},'providerResponse':{'type':Sequelize[_0x965c('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 042b368..f8a6779 100644 --- a/server/api/openchannelMessage/openchannelMessage.controller.js +++ b/server/api/openchannelMessage/openchannelMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f2e=['moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./openchannelMessage.socket','register','jayson/promise','client','http','then','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','params','create','body','find','describe','openchannel-interactions','accept','openchannel','read','UserId','agent','get','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','format','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','internal','SIP/%s','rejectmessage','zip-dir','fast-json-patch','request-promise'];(function(_0x48930e,_0x1c7baa){var _0x16d2d1=function(_0x1c3d37){while(--_0x1c3d37){_0x48930e['push'](_0x48930e['shift']());}};_0x16d2d1(++_0x1c7baa);}(_0x1f2e,0x82));var _0xe1f2=function(_0x19445d,_0x455431){_0x19445d=_0x19445d-0x0;var _0xdf7adc=_0x1f2e[_0x19445d];return _0xdf7adc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe1f2('0x0'));var jsonpatch=require(_0xe1f2('0x1'));var rp=require(_0xe1f2('0x2'));var moment=require(_0xe1f2('0x3'));var BPromise=require(_0xe1f2('0x4'));var Mustache=require('mustache');var util=require(_0xe1f2('0x5'));var path=require(_0xe1f2('0x6'));var sox=require(_0xe1f2('0x7'));var csv=require(_0xe1f2('0x8'));var ejs=require(_0xe1f2('0x9'));var fs=require('fs');var fs_extra=require(_0xe1f2('0xa'));var _=require(_0xe1f2('0xb'));var squel=require(_0xe1f2('0xc'));var crypto=require(_0xe1f2('0xd'));var jsforce=require(_0xe1f2('0xe'));var deskjs=require(_0xe1f2('0xf'));var toCsv=require(_0xe1f2('0x8'));var querystring=require(_0xe1f2('0x10'));var Papa=require(_0xe1f2('0x11'));var Redis=require(_0xe1f2('0x12'));var authService=require(_0xe1f2('0x13'));var qs=require(_0xe1f2('0x14'));var as=require(_0xe1f2('0x15'));var hardwareService=require(_0xe1f2('0x16'));var logger=require(_0xe1f2('0x17'))(_0xe1f2('0x18'));var utils=require(_0xe1f2('0x19'));var config=require(_0xe1f2('0x1a'));var licenseUtil=require(_0xe1f2('0x1b'));var db=require(_0xe1f2('0x1c'))['db'];config['redis']=_[_0xe1f2('0x1d')](config[_0xe1f2('0x1e')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe1f2('0x1e')]));require(_0xe1f2('0x1f'))[_0xe1f2('0x20')](socket);var jayson=require(_0xe1f2('0x21'));var client=jayson[_0xe1f2('0x22')][_0xe1f2('0x23')]({'port':0x232c});var client9002=jayson[_0xe1f2('0x22')][_0xe1f2('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x511525,_0x39f1c5,_0xe3afac,_0x59a152){return new BPromise(function(_0x57d44d,_0x197974){var _0x3b9376=_0x59a152||client;return _0x3b9376['request'](_0x511525,_0xe3afac)[_0xe1f2('0x24')](function(_0x49b15e){logger['info'](_0xe1f2('0x25'),_0x39f1c5,'request\x20sent');logger[_0xe1f2('0x26')](_0xe1f2('0x27'),_0x39f1c5,_0xe1f2('0x28'),JSON[_0xe1f2('0x29')](_0x49b15e));if(_0x49b15e['error']){if(_0x49b15e[_0xe1f2('0x2a')][_0xe1f2('0x2b')]===0x1f4){logger['error'](_0xe1f2('0x25'),_0x39f1c5,_0x49b15e[_0xe1f2('0x2a')]['message']);return _0x197974(_0x49b15e[_0xe1f2('0x2a')][_0xe1f2('0x2c')]);}logger[_0xe1f2('0x2a')](_0xe1f2('0x25'),_0x39f1c5,_0x49b15e['error'][_0xe1f2('0x2c')]);return _0x57d44d(_0x49b15e['error'][_0xe1f2('0x2c')]);}else{logger[_0xe1f2('0x2d')](_0xe1f2('0x25'),_0x39f1c5,'request\x20sent');_0x57d44d(_0x49b15e['result']['message']);}})[_0xe1f2('0x2e')](function(_0x2a5db3){logger[_0xe1f2('0x2a')](_0xe1f2('0x25'),_0x39f1c5,_0x2a5db3);_0x197974(_0x2a5db3);});});}function respondWithStatusCode(_0x14df5a,_0x39f4b7){_0x39f4b7=_0x39f4b7||0xcc;return function(_0x4eba44){if(_0x4eba44){return _0x14df5a[_0xe1f2('0x2f')](_0x39f4b7);}return _0x14df5a[_0xe1f2('0x30')](_0x39f4b7)['end']();};}function respondWithResult(_0x330a4f,_0x369371){_0x369371=_0x369371||0xc8;return function(_0x510114){if(_0x510114){return _0x330a4f[_0xe1f2('0x30')](_0x369371)[_0xe1f2('0x31')](_0x510114);}};}function respondWithFilteredResult(_0x46d2d0,_0xb9cb73){return function(_0x2fb0c4){if(_0x2fb0c4){var _0xb7d474=typeof _0xb9cb73[_0xe1f2('0x32')]===_0xe1f2('0x33')&&typeof _0xb9cb73['limit']===_0xe1f2('0x33');var _0x3313e7=_0x2fb0c4[_0xe1f2('0x34')];var _0x12e188=_0xb7d474?0x0:_0xb9cb73[_0xe1f2('0x32')];var _0x5c38c1=_0xb7d474?_0x2fb0c4[_0xe1f2('0x34')]:_0xb9cb73[_0xe1f2('0x32')]+_0xb9cb73[_0xe1f2('0x35')];var _0x1b8584;if(_0x5c38c1>=_0x3313e7){_0x5c38c1=_0x3313e7;_0x1b8584=0xc8;}else{_0x1b8584=0xce;}_0x46d2d0['status'](_0x1b8584);return _0x46d2d0[_0xe1f2('0x36')](_0xe1f2('0x37'),_0x12e188+'-'+_0x5c38c1+'/'+_0x3313e7)[_0xe1f2('0x31')](_0x2fb0c4);}return null;};}function patchUpdates(_0x3ca437){return function(_0x19fe6a){try{jsonpatch[_0xe1f2('0x38')](_0x19fe6a,_0x3ca437,!![]);}catch(_0xed855e){return BPromise[_0xe1f2('0x39')](_0xed855e);}return _0x19fe6a[_0xe1f2('0x3a')]();};}function saveUpdates(_0x50bb78,_0x2d042e){return function(_0x142a3b){if(_0x142a3b){return _0x142a3b[_0xe1f2('0x3b')](_0x50bb78)[_0xe1f2('0x24')](function(_0x320d51){return _0x320d51;});}return null;};}function removeEntity(_0x3ac8fd,_0x196739){return function(_0x3b3dfb){if(_0x3b3dfb){return _0x3b3dfb[_0xe1f2('0x3c')]()[_0xe1f2('0x24')](function(){_0x3ac8fd[_0xe1f2('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dc7ad,_0x46f77b){return function(_0x17d937){if(!_0x17d937){_0x3dc7ad[_0xe1f2('0x2f')](0x194);}return _0x17d937;};}function handleError(_0x300049,_0x269152){_0x269152=_0x269152||0x1f4;return function(_0x3bc299){logger[_0xe1f2('0x2a')](_0x3bc299['stack']);if(_0x3bc299[_0xe1f2('0x3d')]){delete _0x3bc299[_0xe1f2('0x3d')];}_0x300049[_0xe1f2('0x30')](_0x269152)[_0xe1f2('0x3e')](_0x3bc299);};}exports[_0xe1f2('0x3f')]=function(_0x2a2413,_0x504bea){var _0xd00b26={},_0x1de0d0={},_0xfd5edc={'count':0x0,'rows':[]};var _0x1f256e=_[_0xe1f2('0x40')](db[_0xe1f2('0x41')][_0xe1f2('0x42')],function(_0x3c2692){return{'name':_0x3c2692[_0xe1f2('0x43')],'type':_0x3c2692[_0xe1f2('0x44')][_0xe1f2('0x45')]};});_0x1de0d0[_0xe1f2('0x46')]=_['map'](_0x1f256e,_0xe1f2('0x3d'));_0x1de0d0[_0xe1f2('0x47')]=_[_0xe1f2('0x48')](_0x2a2413[_0xe1f2('0x47')]);_0x1de0d0[_0xe1f2('0x49')]=_[_0xe1f2('0x4a')](_0x1de0d0[_0xe1f2('0x46')],_0x1de0d0[_0xe1f2('0x47')]);_0xd00b26['attributes']=_[_0xe1f2('0x4a')](_0x1de0d0[_0xe1f2('0x46')],qs[_0xe1f2('0x4b')](_0x2a2413[_0xe1f2('0x47')][_0xe1f2('0x4b')]));_0xd00b26[_0xe1f2('0x4c')]=_0xd00b26[_0xe1f2('0x4c')][_0xe1f2('0x4d')]?_0xd00b26[_0xe1f2('0x4c')]:_0x1de0d0[_0xe1f2('0x46')];if(!_0x2a2413[_0xe1f2('0x47')][_0xe1f2('0x4e')](_0xe1f2('0x4f'))){_0xd00b26[_0xe1f2('0x35')]=qs[_0xe1f2('0x35')](_0x2a2413[_0xe1f2('0x47')][_0xe1f2('0x35')]);_0xd00b26[_0xe1f2('0x32')]=qs[_0xe1f2('0x32')](_0x2a2413[_0xe1f2('0x47')][_0xe1f2('0x32')]);}_0xd00b26['order']=qs[_0xe1f2('0x50')](_0x2a2413[_0xe1f2('0x47')][_0xe1f2('0x50')]);_0xd00b26[_0xe1f2('0x51')]=qs[_0xe1f2('0x49')](_[_0xe1f2('0x52')](_0x2a2413[_0xe1f2('0x47')],_0x1de0d0[_0xe1f2('0x49')]),_0x1f256e);if(_0x2a2413[_0xe1f2('0x47')]['filter']){_0xd00b26[_0xe1f2('0x51')]=_[_0xe1f2('0x53')](_0xd00b26['where'],{'$or':_[_0xe1f2('0x40')](_0x1f256e,function(_0x415986){if(_0x415986['type']!==_0xe1f2('0x54')){var _0x22c988={};_0x22c988[_0x415986[_0xe1f2('0x3d')]]={'$like':'%'+_0x2a2413['query'][_0xe1f2('0x55')]+'%'};return _0x22c988;}})});}_0xd00b26=_[_0xe1f2('0x53')]({},_0xd00b26,_0x2a2413['options']);var _0x261c7a={'where':_0xd00b26[_0xe1f2('0x51')]};return db['OpenchannelMessage'][_0xe1f2('0x34')](_0x261c7a)[_0xe1f2('0x24')](function(_0x52ab0f){_0xfd5edc[_0xe1f2('0x34')]=_0x52ab0f;if(_0x2a2413[_0xe1f2('0x47')][_0xe1f2('0x56')]){_0xd00b26[_0xe1f2('0x57')]=[{'all':!![]}];}return db[_0xe1f2('0x41')]['findAll'](_0xd00b26);})[_0xe1f2('0x24')](function(_0x54d5ae){_0xfd5edc['rows']=_0x54d5ae;return _0xfd5edc;})['then'](respondWithFilteredResult(_0x504bea,_0xd00b26))[_0xe1f2('0x2e')](handleError(_0x504bea,null));};exports['show']=function(_0x224a2f,_0x5df0ab){var _0x4d1206={'raw':!![],'where':{'id':_0x224a2f[_0xe1f2('0x58')]['id']}},_0x566285={};_0x566285['model']=_[_0xe1f2('0x48')](db[_0xe1f2('0x41')][_0xe1f2('0x42')]);_0x566285[_0xe1f2('0x47')]=_[_0xe1f2('0x48')](_0x224a2f[_0xe1f2('0x47')]);_0x566285['filters']=_[_0xe1f2('0x4a')](_0x566285[_0xe1f2('0x46')],_0x566285[_0xe1f2('0x47')]);_0x4d1206[_0xe1f2('0x4c')]=_[_0xe1f2('0x4a')](_0x566285[_0xe1f2('0x46')],qs[_0xe1f2('0x4b')](_0x224a2f['query']['fields']));_0x4d1206[_0xe1f2('0x4c')]=_0x4d1206[_0xe1f2('0x4c')][_0xe1f2('0x4d')]?_0x4d1206[_0xe1f2('0x4c')]:_0x566285['model'];if(_0x224a2f[_0xe1f2('0x47')][_0xe1f2('0x56')]){_0x4d1206[_0xe1f2('0x57')]=[{'all':!![]}];}_0x4d1206=_[_0xe1f2('0x53')]({},_0x4d1206,_0x224a2f['options']);return db['OpenchannelMessage']['find'](_0x4d1206)['then'](handleEntityNotFound(_0x5df0ab,null))[_0xe1f2('0x24')](respondWithResult(_0x5df0ab,null))[_0xe1f2('0x2e')](handleError(_0x5df0ab,null));};exports[_0xe1f2('0x59')]=function(_0x4e37b2,_0x419123){return db['OpenchannelMessage']['create'](_0x4e37b2[_0xe1f2('0x5a')],{})[_0xe1f2('0x24')](respondWithResult(_0x419123,0xc9))[_0xe1f2('0x2e')](handleError(_0x419123,null));};exports[_0xe1f2('0x3b')]=function(_0x1bc178,_0x2023af){if(_0x1bc178[_0xe1f2('0x5a')]['id']){delete _0x1bc178[_0xe1f2('0x5a')]['id'];}return db[_0xe1f2('0x41')][_0xe1f2('0x5b')]({'where':{'id':_0x1bc178[_0xe1f2('0x58')]['id']}})['then'](handleEntityNotFound(_0x2023af,null))[_0xe1f2('0x24')](saveUpdates(_0x1bc178[_0xe1f2('0x5a')],null))[_0xe1f2('0x24')](respondWithResult(_0x2023af,null))[_0xe1f2('0x2e')](handleError(_0x2023af,null));};exports[_0xe1f2('0x3c')]=function(_0x10d415,_0x529846){return db[_0xe1f2('0x41')][_0xe1f2('0x5b')]({'where':{'id':_0x10d415['params']['id']}})[_0xe1f2('0x24')](handleEntityNotFound(_0x529846,null))['then'](removeEntity(_0x529846,null))[_0xe1f2('0x2e')](handleError(_0x529846,null));};exports[_0xe1f2('0x5c')]=function(_0x4eaab8,_0x1eb69e){return db[_0xe1f2('0x41')][_0xe1f2('0x5c')]()[_0xe1f2('0x24')](respondWithResult(_0x1eb69e,null))[_0xe1f2('0x2e')](handleError(_0x1eb69e,null));};var interaction_log=require(_0xe1f2('0x17'))(_0xe1f2('0x5d'));exports[_0xe1f2('0x5e')]=function(_0x40cb51,_0x2ad90d,_0x1c1daa){var _0x596179={'agent':{},'channel':_0xe1f2('0x5f')};if(_0x40cb51[_0xe1f2('0x5a')]['id']){delete _0x40cb51[_0xe1f2('0x5a')]['id'];}_0x40cb51[_0xe1f2('0x5a')][_0xe1f2('0x60')]=!![];_0x40cb51[_0xe1f2('0x5a')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x40cb51[_0xe1f2('0x5a')][_0xe1f2('0x61')]=_0x40cb51['body']['UserId']||_0x40cb51['user']['id'];_0x596179[_0xe1f2('0x62')]['id']=_0x40cb51[_0xe1f2('0x5a')][_0xe1f2('0x61')];return db[_0xe1f2('0x41')][_0xe1f2('0x5b')]({'where':{'id':_0x40cb51[_0xe1f2('0x58')]['id'],'UserId':null}})[_0xe1f2('0x24')](handleEntityNotFound(_0x2ad90d,null))['then'](saveUpdates(_0x40cb51['body'],null))[_0xe1f2('0x24')](function(_0x36729e){if(_0x36729e){_0x596179[_0xe1f2('0x2c')]=_0x36729e[_0xe1f2('0x63')]({'plain':!![]});return db['OpenchannelInteraction'][_0xe1f2('0x5b')]({'where':{'id':_0x36729e['OpenchannelInteractionId']}});}return null;})[_0xe1f2('0x24')](handleEntityNotFound(_0x2ad90d,null))['then'](function(_0x5d70f0){if(_0x5d70f0){return _0x5d70f0[_0xe1f2('0x3b')]({'UserId':_0x40cb51[_0xe1f2('0x5a')][_0xe1f2('0x61')],'read1stAt':_['isNil'](_0x5d70f0[_0xe1f2('0x64')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xe1f2('0x24')](function(_0x389484){if(_0x389484){_0x596179[_0xe1f2('0x65')]=_0x389484[_0xe1f2('0x63')]({'plain':!![]});interaction_log[_0xe1f2('0x2d')](_0xe1f2('0x66'),_0x40cb51[_0xe1f2('0x67')]['id'],_0x40cb51[_0xe1f2('0x67')]['name'],_0x40cb51[_0xe1f2('0x67')][_0xe1f2('0x68')],_0x596179[_0xe1f2('0x65')]['id'],_0x40cb51[_0xe1f2('0x5a')]?JSON[_0xe1f2('0x29')](_0x40cb51[_0xe1f2('0x5a')]):_0xe1f2('0x69'));return respondWithRpcPromise(_0xe1f2('0x6a'),'acceptMessage',_0x596179);}return null;})['then'](function(_0x4fb70a){var _0x1893bb=_0xe1f2('0x6b')+_0x4fb70a[_0xe1f2('0x2c')][_0xe1f2('0x6c')];return db[_0xe1f2('0x6d')][_0xe1f2('0x47')](_0x1893bb,{'type':db[_0xe1f2('0x6e')][_0xe1f2('0x6f')][_0xe1f2('0x70')],'raw':!![]})[_0xe1f2('0x24')](function(_0x4a5fa7){return _0x4a5fa7;});})['then'](function(_0xf96f96){if(_0xf96f96){_0x596179[_0xe1f2('0x2c')][_0xe1f2('0x71')]=_0xf96f96[0x0];if(!_0x40cb51[_0xe1f2('0x5a')]['UserId'])return;return db[_0xe1f2('0x72')][_0xe1f2('0x5b')]({'where':{'id':_0x40cb51[_0xe1f2('0x5a')][_0xe1f2('0x61')],'role':_0xe1f2('0x62')},'attributes':['id',_0xe1f2('0x3d'),_0xe1f2('0x73'),_0xe1f2('0x74'),'internal'],'raw':!![]});}return null;})[_0xe1f2('0x24')](function(_0x59287f){if(!_0x59287f)return null;_0x596179[_0xe1f2('0x2c')][_0xe1f2('0x62')]=_0x59287f;return _0x596179;})[_0xe1f2('0x24')](function(_0xdbf0f0){if(_0xdbf0f0){if(_0x40cb51[_0xe1f2('0x5a')][_0xe1f2('0x75')]){_0x596179[_0xe1f2('0x2c')][_0xe1f2('0x76')]=util[_0xe1f2('0x77')]('SIP/%s',_0x40cb51[_0xe1f2('0x67')][_0xe1f2('0x3d')]);_0x596179[_0xe1f2('0x2c')][_0xe1f2('0x78')]=_0x596179[_0xe1f2('0x78')];_0x596179['message'][_0xe1f2('0x79')]=_0x596179[_0xe1f2('0x78')];_0x596179[_0xe1f2('0x2c')][_0xe1f2('0x7a')]='accept';return respondWithRpcPromise(_0xe1f2('0x7b'),'EventManager',{'event':_0xe1f2('0x7c'),'message':_0x596179[_0xe1f2('0x2c')]},client9002)[_0xe1f2('0x24')](function(){return _0x596179;});}return _0x596179;}return null;})['then'](respondWithResult(_0x2ad90d,null))[_0xe1f2('0x2e')](handleError(_0x2ad90d,null));};var interaction_log=require(_0xe1f2('0x17'))(_0xe1f2('0x5d'));exports[_0xe1f2('0x39')]=function(_0x139e3e,_0x426f84,_0x1a9a1f){var _0x395a87={'agent':{},'channel':_0xe1f2('0x5f')};if(_0x139e3e[_0xe1f2('0x5a')]['id']){delete _0x139e3e[_0xe1f2('0x5a')]['id'];}_0x139e3e[_0xe1f2('0x5a')]['UserId']=_0x139e3e[_0xe1f2('0x5a')][_0xe1f2('0x61')]||_0x139e3e['user']['id'];_0x395a87['agent']['id']=_0x139e3e[_0xe1f2('0x5a')][_0xe1f2('0x61')];return db['OpenchannelMessage']['find']({'where':{'id':_0x139e3e['params']['id'],'UserId':null}})[_0xe1f2('0x24')](handleEntityNotFound(_0x426f84,null))[_0xe1f2('0x24')](function(_0x52b317){if(_0x52b317){_0x395a87[_0xe1f2('0x2c')]=_0x52b317[_0xe1f2('0x63')]({'plain':!![]});return db[_0xe1f2('0x7d')][_0xe1f2('0x5b')]({'where':{'id':_0x52b317[_0xe1f2('0x7e')]}});}return null;})[_0xe1f2('0x24')](handleEntityNotFound(_0x426f84,null))[_0xe1f2('0x24')](function(_0xdb112a){if(_0xdb112a){_0x395a87[_0xe1f2('0x65')]=_0xdb112a[_0xe1f2('0x63')]({'plain':!![]});interaction_log['info'](_0xe1f2('0x7f'),_0x139e3e[_0xe1f2('0x67')]['id'],_0x139e3e[_0xe1f2('0x67')]['name'],_0x139e3e[_0xe1f2('0x67')][_0xe1f2('0x68')],_0x395a87[_0xe1f2('0x65')]['id'],_0x139e3e[_0xe1f2('0x5a')]?JSON[_0xe1f2('0x29')](_0x139e3e['body']):_0xe1f2('0x69'));return respondWithRpcPromise(_0xe1f2('0x80'),_0xe1f2('0x81'),_0x395a87);}return null;})[_0xe1f2('0x24')](function(_0x29c598){var _0x540e63=_0xe1f2('0x6b')+_0x29c598[_0xe1f2('0x2c')]['ContactId'];return db[_0xe1f2('0x6d')]['query'](_0x540e63,{'type':db[_0xe1f2('0x6e')][_0xe1f2('0x6f')][_0xe1f2('0x70')],'raw':!![]})[_0xe1f2('0x24')](function(_0x51796a){return _0x51796a;});})[_0xe1f2('0x24')](function(_0x16ca01){if(_0x16ca01){_0x395a87[_0xe1f2('0x2c')]['contact']=_0x16ca01[0x0];if(!_0x139e3e[_0xe1f2('0x5a')][_0xe1f2('0x61')])return;return db[_0xe1f2('0x72')]['find']({'where':{'id':_0x139e3e['body']['UserId'],'role':_0xe1f2('0x62')},'attributes':['id',_0xe1f2('0x3d'),_0xe1f2('0x73'),_0xe1f2('0x74'),_0xe1f2('0x82')],'raw':!![]});}return null;})[_0xe1f2('0x24')](function(_0x5e7cd3){if(!_0x5e7cd3)return null;_0x395a87[_0xe1f2('0x2c')][_0xe1f2('0x62')]=_0x5e7cd3;return _0x395a87;})[_0xe1f2('0x24')](function(_0x3e0424){if(_0x3e0424){_0x3e0424[_0xe1f2('0x2c')][_0xe1f2('0x76')]=util['format'](_0xe1f2('0x83'),_0x139e3e[_0xe1f2('0x67')][_0xe1f2('0x3d')]);_0x3e0424[_0xe1f2('0x2c')][_0xe1f2('0x78')]=_0x395a87[_0xe1f2('0x78')];_0x3e0424[_0xe1f2('0x2c')][_0xe1f2('0x79')]=_0x395a87[_0xe1f2('0x78')];_0x3e0424[_0xe1f2('0x2c')][_0xe1f2('0x7a')]='reject';respondWithRpcPromise(_0xe1f2('0x7b'),'EventManager',{'event':_0xe1f2('0x84'),'message':_0x3e0424[_0xe1f2('0x2c')]},client9002);return _0x395a87;}return null;})[_0xe1f2('0x24')](respondWithResult(_0x426f84,null))[_0xe1f2('0x2e')](handleError(_0x426f84,null));}; \ No newline at end of file +var _0x50a1=['interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','openchannel-interactions','get','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','QueryTypes','SELECT','internal','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','name','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','OpenchannelMessage','findAll','rows','show','params','keys','find','create','body','update','describe','../../config/logger','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt'];(function(_0x48a0e1,_0x5f3d46){var _0x935781=function(_0xf2e6ea){while(--_0xf2e6ea){_0x48a0e1['push'](_0x48a0e1['shift']());}};_0x935781(++_0x5f3d46);}(_0x50a1,0x9a));var _0x150a=function(_0x148e52,_0x1939ee){_0x148e52=_0x148e52-0x0;var _0x52b2b9=_0x50a1[_0x148e52];return _0x52b2b9;};'use strict';var emlformat=require(_0x150a('0x0'));var rimraf=require(_0x150a('0x1'));var zipdir=require(_0x150a('0x2'));var jsonpatch=require(_0x150a('0x3'));var rp=require(_0x150a('0x4'));var moment=require('moment');var BPromise=require(_0x150a('0x5'));var Mustache=require(_0x150a('0x6'));var util=require(_0x150a('0x7'));var path=require('path');var sox=require(_0x150a('0x8'));var csv=require(_0x150a('0x9'));var ejs=require(_0x150a('0xa'));var fs=require('fs');var fs_extra=require(_0x150a('0xb'));var _=require('lodash');var squel=require(_0x150a('0xc'));var crypto=require(_0x150a('0xd'));var jsforce=require(_0x150a('0xe'));var deskjs=require(_0x150a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x150a('0x10'));var Papa=require(_0x150a('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x150a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x150a('0x13'));var config=require(_0x150a('0x14'));var licenseUtil=require(_0x150a('0x15'));var db=require(_0x150a('0x16'))['db'];config[_0x150a('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x150a('0x18'))(new Redis(config['redis']));require(_0x150a('0x19'))[_0x150a('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x150a('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x150a('0x1b')][_0x150a('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x230e5b,_0x47da31,_0x46abda,_0x3b79b3){return new BPromise(function(_0x305d1f,_0x3a438b){var _0x9d1f27=_0x3b79b3||client;return _0x9d1f27[_0x150a('0x1d')](_0x230e5b,_0x46abda)[_0x150a('0x1e')](function(_0x5a977f){logger[_0x150a('0x1f')](_0x150a('0x20'),_0x47da31,_0x150a('0x21'));logger[_0x150a('0x22')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x47da31,_0x150a('0x21'),JSON[_0x150a('0x23')](_0x5a977f));if(_0x5a977f[_0x150a('0x24')]){if(_0x5a977f[_0x150a('0x24')][_0x150a('0x25')]===0x1f4){logger['error'](_0x150a('0x20'),_0x47da31,_0x5a977f[_0x150a('0x24')][_0x150a('0x26')]);return _0x3a438b(_0x5a977f[_0x150a('0x24')][_0x150a('0x26')]);}logger['error'](_0x150a('0x20'),_0x47da31,_0x5a977f[_0x150a('0x24')]['message']);return _0x305d1f(_0x5a977f['error']['message']);}else{logger[_0x150a('0x1f')](_0x150a('0x20'),_0x47da31,_0x150a('0x21'));_0x305d1f(_0x5a977f['result'][_0x150a('0x26')]);}})[_0x150a('0x27')](function(_0x37ae78){logger[_0x150a('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x47da31,_0x37ae78);_0x3a438b(_0x37ae78);});});}function respondWithStatusCode(_0x39a0d7,_0x2801e1){_0x2801e1=_0x2801e1||0xcc;return function(_0x1bdc68){if(_0x1bdc68){return _0x39a0d7[_0x150a('0x28')](_0x2801e1);}return _0x39a0d7[_0x150a('0x29')](_0x2801e1)[_0x150a('0x2a')]();};}function respondWithResult(_0x33cca8,_0x573666){_0x573666=_0x573666||0xc8;return function(_0x23a965){if(_0x23a965){return _0x33cca8[_0x150a('0x29')](_0x573666)[_0x150a('0x2b')](_0x23a965);}};}function respondWithFilteredResult(_0x2d6207,_0x439309){return function(_0x2fb206){if(_0x2fb206){var _0x40e6c4=typeof _0x439309[_0x150a('0x2c')]===_0x150a('0x2d')&&typeof _0x439309[_0x150a('0x2e')]===_0x150a('0x2d');var _0x38c2bc=_0x2fb206[_0x150a('0x2f')];var _0x40234d=_0x40e6c4?0x0:_0x439309[_0x150a('0x2c')];var _0x1c1020=_0x40e6c4?_0x2fb206['count']:_0x439309['offset']+_0x439309['limit'];var _0x3f3dd0;if(_0x1c1020>=_0x38c2bc){_0x1c1020=_0x38c2bc;_0x3f3dd0=0xc8;}else{_0x3f3dd0=0xce;}_0x2d6207[_0x150a('0x29')](_0x3f3dd0);return _0x2d6207[_0x150a('0x30')](_0x150a('0x31'),_0x40234d+'-'+_0x1c1020+'/'+_0x38c2bc)[_0x150a('0x2b')](_0x2fb206);}return null;};}function patchUpdates(_0x1544c9){return function(_0x4ca707){try{jsonpatch[_0x150a('0x32')](_0x4ca707,_0x1544c9,!![]);}catch(_0x4c3571){return BPromise[_0x150a('0x33')](_0x4c3571);}return _0x4ca707[_0x150a('0x34')]();};}function saveUpdates(_0x143082,_0x504047){return function(_0x157f2d){if(_0x157f2d){return _0x157f2d['update'](_0x143082)[_0x150a('0x1e')](function(_0x5b39a7){return _0x5b39a7;});}return null;};}function removeEntity(_0x5dc364,_0xb4e801){return function(_0x4170d6){if(_0x4170d6){return _0x4170d6[_0x150a('0x35')]()[_0x150a('0x1e')](function(){_0x5dc364[_0x150a('0x29')](0xcc)[_0x150a('0x2a')]();});}};}function handleEntityNotFound(_0xf1aa3,_0x3fbcde){return function(_0x5a6924){if(!_0x5a6924){_0xf1aa3[_0x150a('0x28')](0x194);}return _0x5a6924;};}function handleError(_0x2755c3,_0x1f03a4){_0x1f03a4=_0x1f03a4||0x1f4;return function(_0x5e2b90){logger['error'](_0x5e2b90['stack']);if(_0x5e2b90[_0x150a('0x36')]){delete _0x5e2b90[_0x150a('0x36')];}_0x2755c3[_0x150a('0x29')](_0x1f03a4)['send'](_0x5e2b90);};}exports[_0x150a('0x37')]=function(_0x28650b,_0x455c59){var _0x2cdb2a={},_0x2b58db={},_0x5704e7={'count':0x0,'rows':[]};var _0x2e79a9=_[_0x150a('0x38')](db['OpenchannelMessage'][_0x150a('0x39')],function(_0x5e0238){return{'name':_0x5e0238[_0x150a('0x3a')],'type':_0x5e0238['type'][_0x150a('0x3b')]};});_0x2b58db[_0x150a('0x3c')]=_[_0x150a('0x38')](_0x2e79a9,_0x150a('0x36'));_0x2b58db[_0x150a('0x3d')]=_['keys'](_0x28650b[_0x150a('0x3d')]);_0x2b58db[_0x150a('0x3e')]=_[_0x150a('0x3f')](_0x2b58db[_0x150a('0x3c')],_0x2b58db['query']);_0x2cdb2a[_0x150a('0x40')]=_[_0x150a('0x3f')](_0x2b58db[_0x150a('0x3c')],qs[_0x150a('0x41')](_0x28650b[_0x150a('0x3d')][_0x150a('0x41')]));_0x2cdb2a[_0x150a('0x40')]=_0x2cdb2a[_0x150a('0x40')][_0x150a('0x42')]?_0x2cdb2a[_0x150a('0x40')]:_0x2b58db[_0x150a('0x3c')];if(!_0x28650b[_0x150a('0x3d')][_0x150a('0x43')](_0x150a('0x44'))){_0x2cdb2a[_0x150a('0x2e')]=qs[_0x150a('0x2e')](_0x28650b[_0x150a('0x3d')]['limit']);_0x2cdb2a['offset']=qs[_0x150a('0x2c')](_0x28650b['query']['offset']);}_0x2cdb2a['order']=qs[_0x150a('0x45')](_0x28650b[_0x150a('0x3d')][_0x150a('0x45')]);_0x2cdb2a[_0x150a('0x46')]=qs[_0x150a('0x3e')](_[_0x150a('0x47')](_0x28650b[_0x150a('0x3d')],_0x2b58db[_0x150a('0x3e')]),_0x2e79a9);if(_0x28650b[_0x150a('0x3d')][_0x150a('0x48')]){_0x2cdb2a[_0x150a('0x46')]=_[_0x150a('0x49')](_0x2cdb2a['where'],{'$or':_['map'](_0x2e79a9,function(_0x1df1fc){if(_0x1df1fc[_0x150a('0x4a')]!=='VIRTUAL'){var _0x165665={};_0x165665[_0x1df1fc[_0x150a('0x36')]]={'$like':'%'+_0x28650b[_0x150a('0x3d')][_0x150a('0x48')]+'%'};return _0x165665;}})});}_0x2cdb2a=_[_0x150a('0x49')]({},_0x2cdb2a,_0x28650b[_0x150a('0x4b')]);var _0x16b163={'where':_0x2cdb2a[_0x150a('0x46')]};return db['OpenchannelMessage'][_0x150a('0x2f')](_0x16b163)[_0x150a('0x1e')](function(_0x3e3689){_0x5704e7[_0x150a('0x2f')]=_0x3e3689;if(_0x28650b[_0x150a('0x3d')][_0x150a('0x4c')]){_0x2cdb2a[_0x150a('0x4d')]=[{'all':!![]}];}return db[_0x150a('0x4e')][_0x150a('0x4f')](_0x2cdb2a);})['then'](function(_0x345800){_0x5704e7[_0x150a('0x50')]=_0x345800;return _0x5704e7;})[_0x150a('0x1e')](respondWithFilteredResult(_0x455c59,_0x2cdb2a))[_0x150a('0x27')](handleError(_0x455c59,null));};exports[_0x150a('0x51')]=function(_0x346084,_0x2c25ad){var _0x4ef82b={'raw':!![],'where':{'id':_0x346084[_0x150a('0x52')]['id']}},_0x210fba={};_0x210fba[_0x150a('0x3c')]=_['keys'](db['OpenchannelMessage']['rawAttributes']);_0x210fba[_0x150a('0x3d')]=_[_0x150a('0x53')](_0x346084['query']);_0x210fba['filters']=_['intersection'](_0x210fba[_0x150a('0x3c')],_0x210fba[_0x150a('0x3d')]);_0x4ef82b[_0x150a('0x40')]=_['intersection'](_0x210fba['model'],qs[_0x150a('0x41')](_0x346084[_0x150a('0x3d')][_0x150a('0x41')]));_0x4ef82b[_0x150a('0x40')]=_0x4ef82b[_0x150a('0x40')][_0x150a('0x42')]?_0x4ef82b[_0x150a('0x40')]:_0x210fba[_0x150a('0x3c')];if(_0x346084[_0x150a('0x3d')][_0x150a('0x4c')]){_0x4ef82b['include']=[{'all':!![]}];}_0x4ef82b=_[_0x150a('0x49')]({},_0x4ef82b,_0x346084[_0x150a('0x4b')]);return db[_0x150a('0x4e')][_0x150a('0x54')](_0x4ef82b)[_0x150a('0x1e')](handleEntityNotFound(_0x2c25ad,null))['then'](respondWithResult(_0x2c25ad,null))[_0x150a('0x27')](handleError(_0x2c25ad,null));};exports[_0x150a('0x55')]=function(_0x56d082,_0x46765a){return db[_0x150a('0x4e')][_0x150a('0x55')](_0x56d082[_0x150a('0x56')],{})[_0x150a('0x1e')](respondWithResult(_0x46765a,0xc9))[_0x150a('0x27')](handleError(_0x46765a,null));};exports[_0x150a('0x57')]=function(_0x3bd2c9,_0x2088c0){if(_0x3bd2c9[_0x150a('0x56')]['id']){delete _0x3bd2c9[_0x150a('0x56')]['id'];}return db[_0x150a('0x4e')][_0x150a('0x54')]({'where':{'id':_0x3bd2c9['params']['id']}})[_0x150a('0x1e')](handleEntityNotFound(_0x2088c0,null))['then'](saveUpdates(_0x3bd2c9[_0x150a('0x56')],null))[_0x150a('0x1e')](respondWithResult(_0x2088c0,null))[_0x150a('0x27')](handleError(_0x2088c0,null));};exports[_0x150a('0x35')]=function(_0x4f644e,_0x1482cf){return db[_0x150a('0x4e')][_0x150a('0x54')]({'where':{'id':_0x4f644e[_0x150a('0x52')]['id']}})[_0x150a('0x1e')](handleEntityNotFound(_0x1482cf,null))['then'](removeEntity(_0x1482cf,null))[_0x150a('0x27')](handleError(_0x1482cf,null));};exports[_0x150a('0x58')]=function(_0x56d554,_0x3583f8){return db['OpenchannelMessage'][_0x150a('0x58')]()['then'](respondWithResult(_0x3583f8,null))[_0x150a('0x27')](handleError(_0x3583f8,null));};var interaction_log=require(_0x150a('0x59'))('openchannel-interactions');exports[_0x150a('0x5a')]=function(_0x11625a,_0x38d1b0,_0xbd549c){var _0x546356={'agent':{},'channel':_0x150a('0x5b')};if(_0x11625a[_0x150a('0x56')]['id']){delete _0x11625a[_0x150a('0x56')]['id'];}_0x11625a['body'][_0x150a('0x5c')]=!![];_0x11625a[_0x150a('0x56')]['readAt']=moment()[_0x150a('0x5d')](_0x150a('0x5e'));_0x11625a['body'][_0x150a('0x5f')]=_0x11625a[_0x150a('0x56')][_0x150a('0x5f')]||_0x11625a[_0x150a('0x60')]['id'];_0x546356[_0x150a('0x61')]['id']=_0x11625a[_0x150a('0x56')]['UserId'];return db[_0x150a('0x4e')]['find']({'where':{'id':_0x11625a[_0x150a('0x52')]['id'],'UserId':null}})[_0x150a('0x1e')](handleEntityNotFound(_0x38d1b0,null))[_0x150a('0x1e')](saveUpdates(_0x11625a[_0x150a('0x56')],null))['then'](function(_0x97156e){if(_0x97156e){_0x546356['message']=_0x97156e['get']({'plain':!![]});return db[_0x150a('0x62')][_0x150a('0x54')]({'where':{'id':_0x97156e[_0x150a('0x63')]}});}return null;})[_0x150a('0x1e')](handleEntityNotFound(_0x38d1b0,null))[_0x150a('0x1e')](function(_0x2a7211){if(_0x2a7211){return _0x2a7211[_0x150a('0x57')]({'UserId':_0x11625a[_0x150a('0x56')][_0x150a('0x5f')],'read1stAt':_[_0x150a('0x64')](_0x2a7211[_0x150a('0x65')])?moment()[_0x150a('0x5d')](_0x150a('0x5e')):undefined});}return null;})[_0x150a('0x1e')](function(_0x19904a){if(_0x19904a){_0x546356[_0x150a('0x66')]=_0x19904a['get']({'plain':!![]});interaction_log[_0x150a('0x1f')](_0x150a('0x67'),_0x11625a[_0x150a('0x60')]['id'],_0x11625a['user'][_0x150a('0x36')],_0x11625a[_0x150a('0x60')]['role'],_0x546356[_0x150a('0x66')]['id'],_0x11625a['body']?JSON[_0x150a('0x23')](_0x11625a[_0x150a('0x56')]):_0x150a('0x68'));return respondWithRpcPromise(_0x150a('0x69'),_0x150a('0x6a'),_0x546356);}return null;})[_0x150a('0x1e')](function(_0x3f2cdd){var _0x526d67=_0x150a('0x6b')+_0x3f2cdd[_0x150a('0x26')]['ContactId'];return db['sequelize'][_0x150a('0x3d')](_0x526d67,{'type':db[_0x150a('0x6c')]['QueryTypes']['SELECT'],'raw':!![]})[_0x150a('0x1e')](function(_0x4335f9){return _0x4335f9;});})[_0x150a('0x1e')](function(_0x2cadc0){if(_0x2cadc0){_0x546356[_0x150a('0x26')][_0x150a('0x6d')]=_0x2cadc0[0x0];if(!_0x11625a['body'][_0x150a('0x5f')])return;return db[_0x150a('0x6e')][_0x150a('0x54')]({'where':{'id':_0x11625a[_0x150a('0x56')][_0x150a('0x5f')],'role':_0x150a('0x61')},'attributes':['id',_0x150a('0x36'),_0x150a('0x6f'),_0x150a('0x70'),'internal'],'raw':!![]});}return null;})[_0x150a('0x1e')](function(_0x18b82d){if(!_0x18b82d)return null;_0x546356[_0x150a('0x26')][_0x150a('0x61')]=_0x18b82d;return _0x546356;})[_0x150a('0x1e')](function(_0x5fa988){if(_0x5fa988){if(_0x11625a[_0x150a('0x56')][_0x150a('0x71')]){_0x546356[_0x150a('0x26')][_0x150a('0x72')]=util[_0x150a('0x5d')](_0x150a('0x73'),_0x11625a[_0x150a('0x60')][_0x150a('0x36')]);_0x546356[_0x150a('0x26')]['channel']=_0x546356[_0x150a('0x74')];_0x546356[_0x150a('0x26')][_0x150a('0x75')]=_0x546356[_0x150a('0x74')];_0x546356[_0x150a('0x26')][_0x150a('0x76')]=_0x150a('0x5a');return respondWithRpcPromise(_0x150a('0x77'),_0x150a('0x77'),{'event':'acceptmessage','message':_0x546356['message']},client9002)[_0x150a('0x1e')](function(){return _0x546356;});}return _0x546356;}return null;})[_0x150a('0x1e')](respondWithResult(_0x38d1b0,null))[_0x150a('0x27')](handleError(_0x38d1b0,null));};var interaction_log=require('../../config/logger')(_0x150a('0x78'));exports[_0x150a('0x33')]=function(_0x4f01d3,_0xaefb75,_0x1187ab){var _0x5c2a7={'agent':{},'channel':_0x150a('0x5b')};if(_0x4f01d3[_0x150a('0x56')]['id']){delete _0x4f01d3['body']['id'];}_0x4f01d3[_0x150a('0x56')][_0x150a('0x5f')]=_0x4f01d3['body'][_0x150a('0x5f')]||_0x4f01d3[_0x150a('0x60')]['id'];_0x5c2a7['agent']['id']=_0x4f01d3[_0x150a('0x56')][_0x150a('0x5f')];return db[_0x150a('0x4e')][_0x150a('0x54')]({'where':{'id':_0x4f01d3['params']['id'],'UserId':null}})[_0x150a('0x1e')](handleEntityNotFound(_0xaefb75,null))[_0x150a('0x1e')](function(_0x5dc14e){if(_0x5dc14e){_0x5c2a7[_0x150a('0x26')]=_0x5dc14e['get']({'plain':!![]});return db[_0x150a('0x62')][_0x150a('0x54')]({'where':{'id':_0x5dc14e[_0x150a('0x63')]}});}return null;})[_0x150a('0x1e')](handleEntityNotFound(_0xaefb75,null))[_0x150a('0x1e')](function(_0x4719f4){if(_0x4719f4){_0x5c2a7[_0x150a('0x66')]=_0x4719f4[_0x150a('0x79')]({'plain':!![]});interaction_log[_0x150a('0x1f')](_0x150a('0x7a'),_0x4f01d3[_0x150a('0x60')]['id'],_0x4f01d3[_0x150a('0x60')][_0x150a('0x36')],_0x4f01d3[_0x150a('0x60')]['role'],_0x5c2a7[_0x150a('0x66')]['id'],_0x4f01d3[_0x150a('0x56')]?JSON[_0x150a('0x23')](_0x4f01d3[_0x150a('0x56')]):_0x150a('0x68'));return respondWithRpcPromise('RejectMessage',_0x150a('0x7b'),_0x5c2a7);}return null;})['then'](function(_0x441c93){var _0x61c103=_0x150a('0x6b')+_0x441c93['message'][_0x150a('0x7c')];return db['sequelize'][_0x150a('0x3d')](_0x61c103,{'type':db[_0x150a('0x6c')][_0x150a('0x7d')][_0x150a('0x7e')],'raw':!![]})[_0x150a('0x1e')](function(_0x9e8260){return _0x9e8260;});})[_0x150a('0x1e')](function(_0x431898){if(_0x431898){_0x5c2a7[_0x150a('0x26')][_0x150a('0x6d')]=_0x431898[0x0];if(!_0x4f01d3['body'][_0x150a('0x5f')])return;return db[_0x150a('0x6e')][_0x150a('0x54')]({'where':{'id':_0x4f01d3[_0x150a('0x56')][_0x150a('0x5f')],'role':_0x150a('0x61')},'attributes':['id','name',_0x150a('0x6f'),'email',_0x150a('0x7f')],'raw':!![]});}return null;})[_0x150a('0x1e')](function(_0x46b8bd){if(!_0x46b8bd)return null;_0x5c2a7['message'][_0x150a('0x61')]=_0x46b8bd;return _0x5c2a7;})[_0x150a('0x1e')](function(_0x10aae4){if(_0x10aae4){_0x10aae4[_0x150a('0x26')][_0x150a('0x72')]=util['format'](_0x150a('0x73'),_0x4f01d3[_0x150a('0x60')][_0x150a('0x36')]);_0x10aae4[_0x150a('0x26')]['channel']=_0x5c2a7['channel'];_0x10aae4['message'][_0x150a('0x75')]=_0x5c2a7[_0x150a('0x74')];_0x10aae4[_0x150a('0x26')]['event']='reject';respondWithRpcPromise(_0x150a('0x77'),_0x150a('0x77'),{'event':'rejectmessage','message':_0x10aae4[_0x150a('0x26')]},client9002);return _0x5c2a7;}return null;})[_0x150a('0x1e')](respondWithResult(_0xaefb75,null))[_0x150a('0x27')](handleError(_0xaefb75,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index a86c4a1..af7fb5e 100644 --- a/server/api/openchannelMessage/openchannelMessage.events.js +++ b/server/api/openchannelMessage/openchannelMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc507=['exports','events','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x3d11be,_0x1b9a8c){var _0x4b657b=function(_0x4a96f2){while(--_0x4a96f2){_0x3d11be['push'](_0x3d11be['shift']());}};_0x4b657b(++_0x1b9a8c);}(_0xc507,0xb0));var _0x7c50=function(_0x2a9f4,_0x25c14a){_0x2a9f4=_0x2a9f4-0x0;var _0x3c39e0=_0xc507[_0x2a9f4];return _0x3c39e0;};'use strict';var EventEmitter=require(_0x7c50('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x7c50('0x1')](0x0);var events={'afterCreate':_0x7c50('0x2'),'afterUpdate':_0x7c50('0x3'),'afterDestroy':'remove'};function emitEvent(_0x240ee5){return function(_0x2f3b76,_0x43206d,_0xfef065){OpenchannelMessageEvents['emit'](_0x240ee5+':'+_0x2f3b76['id'],_0x2f3b76);OpenchannelMessageEvents[_0x7c50('0x4')](_0x240ee5,_0x2f3b76);_0xfef065(null);};}for(var e in events){if(events[_0x7c50('0x5')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x7c50('0x6')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x6792=['OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x56f2c4,_0x2ee197){var _0x93292c=function(_0xc51c49){while(--_0xc51c49){_0x56f2c4['push'](_0x56f2c4['shift']());}};_0x93292c(++_0x2ee197);}(_0x6792,0x1e9));var _0x2679=function(_0xc27adb,_0x2d616f){_0xc27adb=_0xc27adb-0x0;var _0x4c8f33=_0x6792[_0xc27adb];return _0x4c8f33;};'use strict';var EventEmitter=require(_0x2679('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x2679('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x2679('0x2')](0x0);var events={'afterCreate':_0x2679('0x3'),'afterUpdate':_0x2679('0x4'),'afterDestroy':_0x2679('0x5')};function emitEvent(_0x3f1337){return function(_0x4e53ab,_0x4a805d,_0x45c984){OpenchannelMessageEvents[_0x2679('0x6')](_0x3f1337+':'+_0x4e53ab['id'],_0x4e53ab);OpenchannelMessageEvents[_0x2679('0x6')](_0x3f1337,_0x4e53ab);_0x45c984(null);};}for(var e in events){if(events[_0x2679('0x7')](e)){var event=events[e];OpenchannelMessage[_0x2679('0x8')](e,emitEvent(event));}}module[_0x2679('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 77ad17f..ba0f45d 100644 --- a/server/api/openchannelMessage/openchannelMessage.model.js +++ b/server/api/openchannelMessage/openchannelMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b8e=['exports','define','OpenchannelMessage','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','findOne','OpenchannelInteractionId','update','createdAt','catch','error','out','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId','Interactions','keys','replyUri','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','Contact','POST','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','OpenchannelInteraction','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path','./openchannelMessage.attributes'];(function(_0x5cf913,_0xb24fb3){var _0x17e551=function(_0x5f1139){while(--_0x5f1139){_0x5cf913['push'](_0x5cf913['shift']());}};_0x17e551(++_0xb24fb3);}(_0x0b8e,0x166));var _0xe0b8=function(_0x1b79dc,_0x13eda1){_0x1b79dc=_0x1b79dc-0x0;var _0x3fc312=_0x0b8e[_0x1b79dc];return _0x3fc312;};'use strict';var _=require(_0xe0b8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe0b8('0x1'));var moment=require('moment');var BPromise=require(_0xe0b8('0x2'));var rp=require(_0xe0b8('0x3'));var fs=require('fs');var path=require(_0xe0b8('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe0b8('0x5'));module[_0xe0b8('0x6')]=function(_0x54b1a8,_0x19997a){return _0x54b1a8[_0xe0b8('0x7')](_0xe0b8('0x8'),attributes,{'tableName':_0xe0b8('0x9'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0xe0b8('0xa')],'type':_0xe0b8('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x34bf65,_0x34a5e8,_0x240833){var _0x412fa4=_0x54b1a8[_0xe0b8('0xc')];var _0xb0cd5e=_0x34bf65[_0xe0b8('0xd')]({'plain':!![]});if(_0xb0cd5e[_0xe0b8('0xe')][_0xe0b8('0xf')]()==='in'||_0xb0cd5e['direction']['toLowerCase']()==='out'&&!_0xb0cd5e[_0xe0b8('0x10')]&&!_[_0xe0b8('0x11')](_0xb0cd5e[_0xe0b8('0x12')])){_0x412fa4['OpenchannelInteraction'][_0xe0b8('0x13')]({'where':{'id':_0xb0cd5e[_0xe0b8('0x14')]}})['then'](function(_0xd2804c){if(_0xd2804c){_0xd2804c[_0xe0b8('0x15')]({'lastMsgAt':_0xb0cd5e[_0xe0b8('0x16')],'lastMsgDirection':_0xb0cd5e[_0xe0b8('0xe')][_0xe0b8('0xf')]()});}})[_0xe0b8('0x17')](function(_0x4d59f0){console[_0xe0b8('0x18')](_0x4d59f0);});}if(_0xb0cd5e[_0xe0b8('0xe')]===_0xe0b8('0x19')&&!_0xb0cd5e[_0xe0b8('0x10')]){var _0x72dec7;_0x412fa4[_0xe0b8('0x1a')][_0xe0b8('0x1b')]()[_0xe0b8('0x1c')](function(_0x3e47e4){return _0x412fa4[_0xe0b8('0x1d')][_0xe0b8('0x1e')]({'where':{'id':_0xb0cd5e[_0xe0b8('0x1f')]},'include':[{'model':_0x412fa4['OpenchannelInteraction'],'as':_0xe0b8('0x20'),'where':{'id':_0xb0cd5e[_0xe0b8('0x14')]},'limit':0x1,'include':[{'model':_0x412fa4[_0xe0b8('0x1a')],'as':'Contact','attributes':_[_0xe0b8('0x21')](_0x3e47e4)}]}]});})['then'](function(_0xbca20f){_0x72dec7=_0xbca20f[_0xe0b8('0xd')]({'plain':!![]});if(_0x72dec7&&_0x72dec7[_0xe0b8('0x22')]){logger[_0xe0b8('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0xe0b8('0x24'),util[_0xe0b8('0x25')](_0xe0b8('0x26'),_0xb0cd5e['id'],_0x72dec7[_0xe0b8('0x22')]));if(_0x72dec7[_0xe0b8('0x20')]&&_0x72dec7[_0xe0b8('0x20')][_0xe0b8('0x27')]){_0xb0cd5e['Interaction']=_[_0xe0b8('0x28')](_0x72dec7[_0xe0b8('0x20')][0x0],'Contact');_0xb0cd5e[_0xe0b8('0x29')]=_0x72dec7[_0xe0b8('0x20')][0x0][_0xe0b8('0x29')];}var _0x34a5e8={'method':_0xe0b8('0x2a'),'uri':encodeURI(_0x72dec7[_0xe0b8('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x34a5e8['method']){case'GET':_0x34a5e8['qs']=_0xb0cd5e;break;case'POST':_0x34a5e8[_0xe0b8('0xa')]=_0xb0cd5e;break;}return rp(_0x34a5e8)[_0xe0b8('0x1c')](function(_0x4ca159){logger['info'](_0xe0b8('0x2b'),_0xe0b8('0x24'),util[_0xe0b8('0x25')](_0xe0b8('0x2c'),_0xb0cd5e['id'],_0x72dec7[_0xe0b8('0x22')]));if(_0x4ca159[_0xe0b8('0xa')][_0xe0b8('0x2d')]&&_0x4ca159['body'][_0xe0b8('0x2d')]!=_0xb0cd5e[_0xe0b8('0x2e')][_0xe0b8('0x2d')]){return _0x412fa4[_0xe0b8('0x2f')][_0xe0b8('0x15')]({'threadId':_0x4ca159[_0xe0b8('0xa')][_0xe0b8('0x2d')]},{'where':{'id':_0xb0cd5e[_0xe0b8('0x2e')]['id']}});}else{return;}})['then'](function(){return _0x34bf65[_0xe0b8('0x15')]({'read':!![]});})[_0xe0b8('0x17')](function(_0x48e587){logger[_0xe0b8('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0xe0b8('0x24'),util[_0xe0b8('0x30')](_0x48e587,{'showHidden':![],'depth':null}));_0x240833();});}else{_0x240833();}})[_0xe0b8('0x31')](function(){_0x240833();});}else{_0x240833();}}},'charset':_0xe0b8('0x32'),'collate':_0xe0b8('0x33')});}; \ No newline at end of file +var _0xddae=['path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','FULLTEXT','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','secret','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','get','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','Contact','method','GET','POST','body','info','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','inspect','utf8mb4','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1af1e1,_0x37bc24){var _0x5f3450=function(_0x1dc6fd){while(--_0x1dc6fd){_0x1af1e1['push'](_0x1af1e1['shift']());}};_0x5f3450(++_0x37bc24);}(_0xddae,0x1d7));var _0xedda=function(_0x5959eb,_0x50d43c){_0x5959eb=_0x5959eb-0x0;var _0x21f0b2=_0xddae[_0x5959eb];return _0x21f0b2;};'use strict';var _=require(_0xedda('0x0'));var util=require(_0xedda('0x1'));var logger=require('../../config/logger')(_0xedda('0x2'));var moment=require(_0xedda('0x3'));var BPromise=require(_0xedda('0x4'));var rp=require(_0xedda('0x5'));var fs=require('fs');var path=require(_0xedda('0x6'));var rimraf=require(_0xedda('0x7'));var config=require(_0xedda('0x8'));var attributes=require(_0xedda('0x9'));module[_0xedda('0xa')]=function(_0x193dda,_0xce5cb9){return _0x193dda[_0xedda('0xb')](_0xedda('0xc'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xedda('0xd'),'fields':['body'],'type':_0xedda('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2459cb,_0xd07edc,_0x2d657e){var _0x140b2b=_0x193dda['models'];var _0x3a1963=_0x2459cb['get']({'plain':!![]});if(_0x3a1963[_0xedda('0xf')][_0xedda('0x10')]()==='in'||_0x3a1963[_0xedda('0xf')]['toLowerCase']()===_0xedda('0x11')&&!_0x3a1963['secret']&&!_[_0xedda('0x12')](_0x3a1963[_0xedda('0x13')])){_0x140b2b[_0xedda('0x14')][_0xedda('0x15')]({'where':{'id':_0x3a1963[_0xedda('0x16')]}})[_0xedda('0x17')](function(_0x5b22f6){if(_0x5b22f6){_0x5b22f6[_0xedda('0x18')]({'lastMsgAt':_0x3a1963[_0xedda('0x19')],'lastMsgDirection':_0x3a1963['direction'][_0xedda('0x10')]()});}})[_0xedda('0x1a')](function(_0x40bd3e){console['error'](_0x40bd3e);});}if(_0x3a1963['direction']===_0xedda('0x11')&&!_0x3a1963[_0xedda('0x1b')]){var _0x5ac419;_0x140b2b[_0xedda('0x1c')][_0xedda('0x1d')]()[_0xedda('0x17')](function(_0x31cc21){return _0x140b2b[_0xedda('0x1e')]['find']({'where':{'id':_0x3a1963[_0xedda('0x1f')]},'include':[{'model':_0x140b2b['OpenchannelInteraction'],'as':_0xedda('0x20'),'where':{'id':_0x3a1963[_0xedda('0x16')]},'limit':0x1,'include':[{'model':_0x140b2b[_0xedda('0x1c')],'as':'Contact','attributes':_['keys'](_0x31cc21)}]}]});})[_0xedda('0x17')](function(_0x49f3c7){_0x5ac419=_0x49f3c7[_0xedda('0x21')]({'plain':!![]});if(_0x5ac419&&_0x5ac419[_0xedda('0x22')]){logger['info'](_0xedda('0x23'),'afterCreate',util[_0xedda('0x24')](_0xedda('0x25'),_0x3a1963['id'],_0x5ac419[_0xedda('0x22')]));if(_0x5ac419[_0xedda('0x20')]&&_0x5ac419[_0xedda('0x20')][_0xedda('0x26')]){_0x3a1963[_0xedda('0x27')]=_[_0xedda('0x28')](_0x5ac419[_0xedda('0x20')][0x0],_0xedda('0x29'));_0x3a1963['Contact']=_0x5ac419[_0xedda('0x20')][0x0][_0xedda('0x29')];}var _0xd07edc={'method':'POST','uri':encodeURI(_0x5ac419[_0xedda('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0xd07edc[_0xedda('0x2a')]){case _0xedda('0x2b'):_0xd07edc['qs']=_0x3a1963;break;case _0xedda('0x2c'):_0xd07edc[_0xedda('0x2d')]=_0x3a1963;break;}return rp(_0xd07edc)[_0xedda('0x17')](function(_0x5bdc2e){logger[_0xedda('0x2e')](_0xedda('0x23'),_0xedda('0x2f'),util['format'](_0xedda('0x30'),_0x3a1963['id'],_0x5ac419[_0xedda('0x22')]));if(_0x5bdc2e['body'][_0xedda('0x31')]&&_0x5bdc2e['body'][_0xedda('0x31')]!=_0x3a1963['Interaction'][_0xedda('0x31')]){return _0x140b2b[_0xedda('0x14')]['update']({'threadId':_0x5bdc2e[_0xedda('0x2d')][_0xedda('0x31')]},{'where':{'id':_0x3a1963[_0xedda('0x27')]['id']}});}else{return;}})[_0xedda('0x17')](function(){return _0x2459cb[_0xedda('0x18')]({'read':!![]});})[_0xedda('0x1a')](function(_0x2de437){logger[_0xedda('0x32')](_0xedda('0x23'),_0xedda('0x2f'),util[_0xedda('0x33')](_0x2de437,{'showHidden':![],'depth':null}));_0x2d657e();});}else{_0x2d657e();}})['finally'](function(){_0x2d657e();});}else{_0x2d657e();}}},'charset':_0xedda('0x34'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 9cb6e73..4f0e9bf 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0xfbac0b,_0x20b38b){var _0x14e054=function(_0x5ef004){while(--_0x5ef004){_0xfbac0b['push'](_0xfbac0b['shift']());}};_0x14e054(++_0x20b38b);}(_0x2ef3,0xba));var _0x32ef=function(_0x181bfb,_0x1d380d){_0x181bfb=_0x181bfb-0x0;var _0x5e55d5=_0x2ef3[_0x181bfb];return _0x5e55d5;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file +var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x139d35,_0x342ca3){var _0x3970a1=function(_0x429126){while(--_0x429126){_0x139d35['push'](_0x139d35['shift']());}};_0x3970a1(++_0x342ca3);}(_0x2ef3,0xba));var _0x32ef=function(_0x2fde4d,_0x30c4c8){_0x2fde4d=_0x2fde4d-0x0;var _0xe4b6e7=_0x2ef3[_0x2fde4d];return _0xe4b6e7;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 21efa73..c038719 100644 --- a/server/api/openchannelMessage/openchannelMessage.socket.js +++ b/server/api/openchannelMessage/openchannelMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd59=['remove','update','emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save'];(function(_0x1b667e,_0x3868c3){var _0x3f597e=function(_0x5f3550){while(--_0x5f3550){_0x1b667e['push'](_0x1b667e['shift']());}};_0x3f597e(++_0x3868c3);}(_0xcd59,0x14b));var _0x9cd5=function(_0x16c1d9,_0x2a1270){_0x16c1d9=_0x16c1d9-0x0;var _0x85293b=_0xcd59[_0x16c1d9];return _0x85293b;};'use strict';var OpenchannelMessageEvents=require(_0x9cd5('0x0'));var events=[_0x9cd5('0x1'),_0x9cd5('0x2'),_0x9cd5('0x3')];function createListener(_0x271070,_0x302b21){return function(_0x4b93b9){_0x302b21[_0x9cd5('0x4')](_0x271070,_0x4b93b9);};}function removeListener(_0x191236,_0xf96efa){return function(){OpenchannelMessageEvents[_0x9cd5('0x5')](_0x191236,_0xf96efa);};}exports[_0x9cd5('0x6')]=function(_0x2db192){for(var _0x46277c=0x0,_0x2cd19a=events[_0x9cd5('0x7')];_0x46277c<_0x2cd19a;_0x46277c++){var _0x3f888f=events[_0x46277c];var _0x545407=createListener(_0x9cd5('0x8')+_0x3f888f,_0x2db192);OpenchannelMessageEvents['on'](_0x3f888f,_0x545407);}}; \ No newline at end of file +var _0xa676=['removeListener','register','length','./openchannelMessage.events','save','remove','update','emit'];(function(_0x2bdaee,_0x2a6f29){var _0x549abf=function(_0x4f6abd){while(--_0x4f6abd){_0x2bdaee['push'](_0x2bdaee['shift']());}};_0x549abf(++_0x2a6f29);}(_0xa676,0x15b));var _0x6a67=function(_0x2fb25c,_0x528eec){_0x2fb25c=_0x2fb25c-0x0;var _0x2cc27a=_0xa676[_0x2fb25c];return _0x2cc27a;};'use strict';var OpenchannelMessageEvents=require(_0x6a67('0x0'));var events=[_0x6a67('0x1'),_0x6a67('0x2'),_0x6a67('0x3')];function createListener(_0x4b4a92,_0x39cae7){return function(_0x4cbc3a){_0x39cae7[_0x6a67('0x4')](_0x4b4a92,_0x4cbc3a);};}function removeListener(_0xc9c82c,_0x126217){return function(){OpenchannelMessageEvents[_0x6a67('0x5')](_0xc9c82c,_0x126217);};}exports[_0x6a67('0x6')]=function(_0x203032){for(var _0x2c33b6=0x0,_0x367af9=events[_0x6a67('0x7')];_0x2c33b6<_0x367af9;_0x2c33b6++){var _0xa3467c=events[_0x2c33b6];var _0x3c8493=createListener('openchannelMessage:'+_0xa3467c,_0x203032);OpenchannelMessageEvents['on'](_0xa3467c,_0x3c8493);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index df8b539..5a5f93f 100644 --- a/server/api/openchannelQueue/index.js +++ b/server/api/openchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9719=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams'];(function(_0x32ebe0,_0x1bd3df){var _0x249d23=function(_0x4475df){while(--_0x4475df){_0x32ebe0['push'](_0x32ebe0['shift']());}};_0x249d23(++_0x1bd3df);}(_0x9719,0x145));var _0x9971=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9719[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x9971('0x0'));var util=require(_0x9971('0x1'));var path=require(_0x9971('0x2'));var timeout=require('connect-timeout');var express=require(_0x9971('0x3'));var router=express[_0x9971('0x4')]();var fs_extra=require(_0x9971('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9971('0x6'));var config=require(_0x9971('0x7'));var controller=require(_0x9971('0x8'));router[_0x9971('0x9')]('/',auth['isAuthenticated'](),controller[_0x9971('0xa')]);router[_0x9971('0x9')]('/describe',auth[_0x9971('0xb')](),controller[_0x9971('0xc')]);router['get'](_0x9971('0xd'),auth[_0x9971('0xb')](),controller[_0x9971('0xe')]);router['get'](_0x9971('0xf'),auth[_0x9971('0xb')](),controller[_0x9971('0x10')]);router[_0x9971('0x9')](_0x9971('0x11'),auth[_0x9971('0xb')](),controller['getTeams']);router[_0x9971('0x9')](_0x9971('0x12'),auth[_0x9971('0xb')](),controller[_0x9971('0x13')]);router[_0x9971('0x14')]('/',auth[_0x9971('0xb')](),controller[_0x9971('0x15')]);router[_0x9971('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x9971('0x16')]);router[_0x9971('0x14')](_0x9971('0x12'),auth[_0x9971('0xb')](),controller['addAgents']);router['put'](_0x9971('0xd'),auth[_0x9971('0xb')](),controller[_0x9971('0x17')]);router[_0x9971('0x18')]('/:id',auth[_0x9971('0xb')](),controller[_0x9971('0x19')]);router[_0x9971('0x18')](_0x9971('0x11'),auth[_0x9971('0xb')](),controller[_0x9971('0x1a')]);router['delete'](_0x9971('0x12'),auth[_0x9971('0xb')](),controller[_0x9971('0x1b')]);module[_0x9971('0x1c')]=router; \ No newline at end of file +var _0x4e47=['../../config/environment','./openchannelQueue.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x13fdfe,_0x48cd76){var _0x901de3=function(_0x179da4){while(--_0x179da4){_0x13fdfe['push'](_0x13fdfe['shift']());}};_0x901de3(++_0x48cd76);}(_0x4e47,0x1bd));var _0x74e4=function(_0x382d27,_0x1cfe15){_0x382d27=_0x382d27-0x0;var _0x109f07=_0x4e47[_0x382d27];return _0x109f07;};'use strict';var multer=require(_0x74e4('0x0'));var util=require('util');var path=require(_0x74e4('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x74e4('0x2'));var auth=require(_0x74e4('0x3'));var interaction=require(_0x74e4('0x4'));var config=require(_0x74e4('0x5'));var controller=require(_0x74e4('0x6'));router[_0x74e4('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x74e4('0x8'),auth[_0x74e4('0x9')](),controller[_0x74e4('0xa')]);router[_0x74e4('0x7')](_0x74e4('0xb'),auth[_0x74e4('0x9')](),controller[_0x74e4('0xc')]);router[_0x74e4('0x7')](_0x74e4('0xd'),auth['isAuthenticated'](),controller[_0x74e4('0xe')]);router['get'](_0x74e4('0xf'),auth[_0x74e4('0x9')](),controller[_0x74e4('0x10')]);router[_0x74e4('0x7')](_0x74e4('0x11'),auth[_0x74e4('0x9')](),controller[_0x74e4('0x12')]);router[_0x74e4('0x13')]('/',auth[_0x74e4('0x9')](),controller[_0x74e4('0x14')]);router['post'](_0x74e4('0xf'),auth[_0x74e4('0x9')](),controller[_0x74e4('0x15')]);router[_0x74e4('0x13')](_0x74e4('0x11'),auth[_0x74e4('0x9')](),controller[_0x74e4('0x16')]);router[_0x74e4('0x17')]('/:id',auth[_0x74e4('0x9')](),controller[_0x74e4('0x18')]);router[_0x74e4('0x19')]('/:id',auth[_0x74e4('0x9')](),controller[_0x74e4('0x1a')]);router[_0x74e4('0x19')](_0x74e4('0xf'),auth[_0x74e4('0x9')](),controller[_0x74e4('0x1b')]);router[_0x74e4('0x19')]('/:id/users',auth[_0x74e4('0x9')](),controller[_0x74e4('0x1c')]);module[_0x74e4('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 95631ad..0aa3316 100644 --- a/server/api/openchannelQueue/openchannelQueue.attributes.js +++ b/server/api/openchannelQueue/openchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c91=['ENUM','rrmemory','beepall','exports','STRING','name','INTEGER'];(function(_0x5673c6,_0xc302ec){var _0x130bd9=function(_0x1653f5){while(--_0x1653f5){_0x5673c6['push'](_0x5673c6['shift']());}};_0x130bd9(++_0xc302ec);}(_0x9c91,0x1bc));var _0x19c9=function(_0x538aa7,_0x27ff37){_0x538aa7=_0x538aa7-0x0;var _0x40e51e=_0x9c91[_0x538aa7];return _0x40e51e;};'use strict';var Sequelize=require('sequelize');module[_0x19c9('0x0')]={'name':{'type':Sequelize[_0x19c9('0x1')],'unique':_0x19c9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x19c9('0x1')]},'timeout':{'type':Sequelize[_0x19c9('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x19c9('0x4')](_0x19c9('0x5'),_0x19c9('0x6'),'roundrobin')}}; \ No newline at end of file +var _0xf9c2=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','INTEGER'];(function(_0xb3fc14,_0x3d14ab){var _0x54a70b=function(_0x498815){while(--_0x498815){_0xb3fc14['push'](_0xb3fc14['shift']());}};_0x54a70b(++_0x3d14ab);}(_0xf9c2,0x14d));var _0x2f9c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf9c2[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x2f9c('0x0')]={'name':{'type':Sequelize[_0x2f9c('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2f9c('0x1')]},'timeout':{'type':Sequelize[_0x2f9c('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2f9c('0x3')](_0x2f9c('0x4'),_0x2f9c('0x5'),_0x2f9c('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index bc4de53..559b7f7 100644 --- a/server/api/openchannelQueue/openchannelQueue.controller.js +++ b/server/api/openchannelQueue/openchannelQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70c6=['toString','QueryTypes','SELECT','every','TeamId','union','value','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','emit','removeAgents','isArray','getAgents','order','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','key','include','query','findAll','rows','show','model','keys','filters','attributes','intersection','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','hasOwnProperty','nolimit','sort','pick','where','OpenchannelQueueId','map','filter','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','addTeams','ids','Agents','flatMap','sequelize','transaction','each','findOrCreate','userOpenchannelQueue:save','removeTeams','field','tq.TeamId','from','team_has_openchannel_queues','OpenchannelQueueId\x20=\x20?','push'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x70c6,0x85));var _0x670c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x70c6[_0x4565bf];return _0x5610ba;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x670c('0x0'));var squel=require(_0x670c('0x1'));var Redis=require(_0x670c('0x2'));var qs=require(_0x670c('0x3'));var logger=require(_0x670c('0x4'))(_0x670c('0x5'));var config=require('../../config/environment');var db=require(_0x670c('0x6'))['db'];config['redis']=_['defaults'](config[_0x670c('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x670c('0x8'))(new Redis(config[_0x670c('0x7')]));require(_0x670c('0x9'))[_0x670c('0xa')](socket);function respondWithStatusCode(_0x175e27,_0x494973){_0x494973=_0x494973||0xcc;return function(_0x4e6de6){if(_0x4e6de6){return _0x175e27[_0x670c('0xb')](_0x494973);}return _0x175e27['status'](_0x494973)[_0x670c('0xc')]();};}function respondWithResult(_0x443b4d,_0x14ca12){_0x14ca12=_0x14ca12||0xc8;return function(_0x821bb2){if(_0x821bb2){return _0x443b4d[_0x670c('0xd')](_0x14ca12)[_0x670c('0xe')](_0x821bb2);}};}function respondWithFilteredResult(_0x2f8090,_0x13c2a5){return function(_0x4b2be2){if(_0x4b2be2){var _0x238f0b=typeof _0x13c2a5[_0x670c('0xf')]===_0x670c('0x10')&&typeof _0x13c2a5[_0x670c('0x11')]===_0x670c('0x10');var _0x614b2b=_0x4b2be2[_0x670c('0x12')];var _0x23d728=_0x238f0b?0x0:_0x13c2a5[_0x670c('0xf')];var _0x3c279a=_0x238f0b?_0x4b2be2[_0x670c('0x12')]:_0x13c2a5[_0x670c('0xf')]+_0x13c2a5['limit'];var _0x201d70;if(_0x3c279a>=_0x614b2b){_0x3c279a=_0x614b2b;_0x201d70=0xc8;}else{_0x201d70=0xce;}_0x2f8090[_0x670c('0xd')](_0x201d70);return _0x2f8090['set']('Content-Range',_0x23d728+'-'+_0x3c279a+'/'+_0x614b2b)[_0x670c('0xe')](_0x4b2be2);}return null;};}function saveUpdates(_0x5dac75){return function(_0xe9aa06){if(_0xe9aa06){return _0xe9aa06[_0x670c('0x13')](_0x5dac75)[_0x670c('0x14')](function(_0x58ea7b){return _0x58ea7b;});}return null;};}function removeEntity(_0x5c3932){return function(_0x1503b0){if(_0x1503b0){return _0x1503b0[_0x670c('0x15')]()[_0x670c('0x14')](function(){var _0x474b84=_0x1503b0[_0x670c('0x16')]({'plain':!![]});var _0x25af81=_0x670c('0x17');return db[_0x670c('0x18')][_0x670c('0x15')]({'where':{'type':_0x25af81,'resourceId':_0x474b84['id']}})[_0x670c('0x14')](function(){return _0x1503b0;});})[_0x670c('0x14')](function(){_0x5c3932[_0x670c('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3472db){return function(_0xc16a13){if(!_0xc16a13){_0x3472db[_0x670c('0xb')](0x194);}return _0xc16a13;};}function handleError(_0x19c6e7,_0x4b8308){_0x4b8308=_0x4b8308||0x1f4;return function(_0x1ccb4e){logger[_0x670c('0x19')](_0x1ccb4e[_0x670c('0x1a')]);if(_0x1ccb4e[_0x670c('0x1b')]){delete _0x1ccb4e[_0x670c('0x1b')];}_0x19c6e7[_0x670c('0xd')](_0x4b8308)[_0x670c('0x1c')](_0x1ccb4e);};}exports[_0x670c('0x1d')]=function(_0x2bc942,_0x4bb69e){var _0x80c618={};var _0x357c4b={'count':0x0,'rows':[]};var _0x59b866=_['map'](db[_0x670c('0x1e')][_0x670c('0x1f')],function(_0x581b93){return{'name':_0x581b93[_0x670c('0x20')],'type':_0x581b93[_0x670c('0x21')][_0x670c('0x22')]};});_0x80c618=qs['getOptions'](_0x59b866,_0x2bc942);var _0x667d6d={'where':_0x80c618['where']};return db['OpenchannelQueue'][_0x670c('0x12')](_0x667d6d)[_0x670c('0x14')](function(_0x42ad0c){_0x357c4b[_0x670c('0x12')]=_0x42ad0c;_0x80c618[_0x670c('0x23')]=qs[_0x670c('0x23')](_0x2bc942[_0x670c('0x24')]);return db[_0x670c('0x1e')][_0x670c('0x25')](_0x80c618);})['then'](function(_0x3c9448){_0x357c4b[_0x670c('0x26')]=_0x3c9448;return _0x357c4b;})[_0x670c('0x14')](respondWithFilteredResult(_0x4bb69e,_0x80c618))['catch'](handleError(_0x4bb69e,null));};exports[_0x670c('0x27')]=function(_0x176e6b,_0x4f4dcf){var _0x266118={'raw':!![],'where':{'id':_0x176e6b['params']['id']}},_0x51752c={};_0x51752c[_0x670c('0x28')]=_[_0x670c('0x29')](db[_0x670c('0x1e')][_0x670c('0x1f')]);_0x51752c['query']=_['keys'](_0x176e6b[_0x670c('0x24')]);_0x51752c[_0x670c('0x2a')]=_['intersection'](_0x51752c['model'],_0x51752c[_0x670c('0x24')]);_0x266118[_0x670c('0x2b')]=_[_0x670c('0x2c')](_0x51752c[_0x670c('0x28')],qs[_0x670c('0x2d')](_0x176e6b[_0x670c('0x24')]['fields']));_0x266118[_0x670c('0x2b')]=_0x266118[_0x670c('0x2b')][_0x670c('0x2e')]?_0x266118[_0x670c('0x2b')]:_0x51752c[_0x670c('0x28')];if(_0x176e6b[_0x670c('0x24')][_0x670c('0x2f')]){_0x266118['include']=[{'all':!![]}];}_0x266118=_[_0x670c('0x30')]({},_0x266118,_0x176e6b[_0x670c('0x31')]);return db[_0x670c('0x1e')][_0x670c('0x32')](_0x266118)[_0x670c('0x14')](handleEntityNotFound(_0x4f4dcf,null))[_0x670c('0x14')](respondWithResult(_0x4f4dcf,null))['catch'](handleError(_0x4f4dcf,null));};exports[_0x670c('0x33')]=function(_0x161979,_0x5564e0){return db[_0x670c('0x1e')]['create'](_0x161979[_0x670c('0x34')],{})[_0x670c('0x14')](function(_0x3e7afa){var _0x204a3d=_0x161979[_0x670c('0x35')][_0x670c('0x16')]({'plain':!![]});if(!_0x204a3d)throw new Error(_0x670c('0x36'));if(_0x204a3d[_0x670c('0x37')]===_0x670c('0x35')){var _0x322e41=_0x3e7afa[_0x670c('0x16')]({'plain':!![]});var _0x57f8b9=_0x670c('0x17');return db['UserProfileSection'][_0x670c('0x32')]({'where':{'name':_0x57f8b9,'userProfileId':_0x204a3d[_0x670c('0x38')]},'raw':!![]})[_0x670c('0x14')](function(_0x255e8b){if(_0x255e8b&&_0x255e8b['autoAssociation']===0x0){return db[_0x670c('0x18')]['create']({'name':_0x322e41[_0x670c('0x1b')],'resourceId':_0x322e41['id'],'type':_0x255e8b[_0x670c('0x1b')],'sectionId':_0x255e8b['id']},{})[_0x670c('0x14')](function(){return _0x3e7afa;});}else{return _0x3e7afa;}})[_0x670c('0x39')](function(_0x17c443){logger['error'](_0x670c('0x3a'),_0x17c443);throw _0x17c443;});}return _0x3e7afa;})['then'](respondWithResult(_0x5564e0,0xc9))[_0x670c('0x39')](handleError(_0x5564e0,null));};exports['update']=function(_0x43d823,_0x399c87){if(_0x43d823[_0x670c('0x34')]['id']){delete _0x43d823[_0x670c('0x34')]['id'];}return db['OpenchannelQueue'][_0x670c('0x32')]({'where':{'id':_0x43d823[_0x670c('0x3b')]['id']}})[_0x670c('0x14')](handleEntityNotFound(_0x399c87,null))[_0x670c('0x14')](saveUpdates(_0x43d823[_0x670c('0x34')],null))['then'](respondWithResult(_0x399c87,null))[_0x670c('0x39')](handleError(_0x399c87,null));};exports[_0x670c('0x15')]=function(_0x252e2d,_0x40029a){return db[_0x670c('0x1e')]['find']({'where':{'id':_0x252e2d[_0x670c('0x3b')]['id']}})[_0x670c('0x14')](handleEntityNotFound(_0x40029a,null))['then'](removeEntity(_0x40029a,null))['catch'](handleError(_0x40029a,null));};exports['describe']=function(_0x3c4337,_0x2c6bc9){return db[_0x670c('0x1e')][_0x670c('0x3c')]()[_0x670c('0x14')](respondWithResult(_0x2c6bc9,null))['catch'](handleError(_0x2c6bc9,null));};exports[_0x670c('0x3d')]=function(_0x202f31,_0xbf4f95){var _0x4a9882={'raw':!![],'where':{}},_0x455887={},_0x278332;return db[_0x670c('0x1e')]['findOne']({'where':{'id':_0x202f31[_0x670c('0x3b')]['id']}})[_0x670c('0x14')](handleEntityNotFound(_0xbf4f95,null))['then'](function(_0x4de176){if(_0x4de176){_0x278332=_0x4de176[_0x670c('0x16')]({'plain':!![]});_0x455887[_0x670c('0x28')]=_[_0x670c('0x29')](db['UserOpenchannelQueue'][_0x670c('0x1f')]);_0x455887[_0x670c('0x24')]=_['keys'](_0x202f31['query']);_0x455887[_0x670c('0x2a')]=_[_0x670c('0x2c')](_0x455887[_0x670c('0x28')],_0x455887[_0x670c('0x24')]);_0x4a9882[_0x670c('0x2b')]=_[_0x670c('0x2c')](_0x455887[_0x670c('0x28')],qs[_0x670c('0x2d')](_0x202f31[_0x670c('0x24')][_0x670c('0x2d')]));_0x4a9882[_0x670c('0x2b')]=_0x4a9882['attributes'][_0x670c('0x2e')]?_0x4a9882[_0x670c('0x2b')]:_0x455887[_0x670c('0x28')];if(!_0x202f31[_0x670c('0x24')][_0x670c('0x3e')](_0x670c('0x3f'))){_0x4a9882[_0x670c('0x11')]=qs['limit'](_0x202f31[_0x670c('0x24')][_0x670c('0x11')]);_0x4a9882['offset']=qs[_0x670c('0xf')](_0x202f31[_0x670c('0x24')][_0x670c('0xf')]);}_0x4a9882['order']=qs[_0x670c('0x40')](_0x202f31[_0x670c('0x24')][_0x670c('0x40')]);_0x4a9882['where']=qs[_0x670c('0x2a')](_[_0x670c('0x41')](_0x202f31[_0x670c('0x24')],_0x455887[_0x670c('0x2a')]));_0x4a9882[_0x670c('0x42')][_0x670c('0x43')]=_0x4de176['id'];if(_0x202f31[_0x670c('0x24')]['filter']){_0x4a9882[_0x670c('0x42')]=_[_0x670c('0x30')](_0x4a9882[_0x670c('0x42')],{'$or':_[_0x670c('0x44')](_0x4a9882[_0x670c('0x2b')],function(_0x5e5fb5){var _0x1d92a0={};_0x1d92a0[_0x5e5fb5]={'$like':'%'+_0x202f31[_0x670c('0x24')][_0x670c('0x45')]+'%'};return _0x1d92a0;})});}_0x4a9882=_['merge']({},_0x4a9882,_0x202f31['options']);return db[_0x670c('0x46')][_0x670c('0x25')](_0x4a9882);}})['then'](function(_0x1fc989){if(_0x1fc989){return db[_0x670c('0x47')][_0x670c('0x48')]({'where':{'id':_['map'](_0x1fc989,_0x670c('0x49')),'role':_0x670c('0x4a')},'attributes':['id','name',_0x670c('0x4b'),_0x670c('0x4c'),_0x670c('0x4d')]});}})[_0x670c('0x14')](function(_0x2d2f30){if(_0x2d2f30){return{'count':_0x2d2f30['count'],'rows':_[_0x670c('0x44')](_0x2d2f30['rows'],function(_0x45241e){return{'membername':_0x45241e['name'],'UserId':_0x45241e['id'],'queue_name':_0x278332[_0x670c('0x1b')],'OpenchannelQueueId':_0x278332['id'],'interface':util[_0x670c('0x4e')]('%s/%s',_0x670c('0x4f'),_0x45241e[_0x670c('0x1b')]),'penalty':0x0,'paused':_0x45241e['openchannelPause'],'createdAt':_0x45241e[_0x670c('0x4d')],'updatedAt':_0x45241e[_0x670c('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x670c('0x14')](respondWithFilteredResult(_0xbf4f95,_0x4a9882))[_0x670c('0x39')](handleError(_0xbf4f95,null));};exports[_0x670c('0x50')]=function(_0x2045a4,_0x1c946b){var _0x4f1043={};var _0x494a0e={};var _0x35b441;var _0x1f5582;return db[_0x670c('0x1e')][_0x670c('0x51')]({'where':{'id':_0x2045a4[_0x670c('0x3b')]['id']}})[_0x670c('0x14')](handleEntityNotFound(_0x1c946b,null))['then'](function(_0x381a31){if(_0x381a31){_0x35b441=_0x381a31;_0x494a0e[_0x670c('0x28')]=_[_0x670c('0x29')](db[_0x670c('0x52')][_0x670c('0x1f')]);_0x494a0e[_0x670c('0x24')]=_[_0x670c('0x29')](_0x2045a4[_0x670c('0x24')]);_0x494a0e['filters']=_[_0x670c('0x2c')](_0x494a0e['model'],_0x494a0e[_0x670c('0x24')]);_0x4f1043[_0x670c('0x2b')]=_[_0x670c('0x2c')](_0x494a0e['model'],qs[_0x670c('0x2d')](_0x2045a4['query'][_0x670c('0x2d')]));_0x4f1043[_0x670c('0x2b')]=_0x4f1043['attributes'][_0x670c('0x2e')]?_0x4f1043[_0x670c('0x2b')]:_0x494a0e[_0x670c('0x28')];_0x4f1043['order']=qs[_0x670c('0x40')](_0x2045a4[_0x670c('0x24')][_0x670c('0x40')]);_0x4f1043[_0x670c('0x42')]=qs[_0x670c('0x2a')](_['pick'](_0x2045a4['query'],_0x494a0e[_0x670c('0x2a')]));if(_0x2045a4[_0x670c('0x24')][_0x670c('0x45')]){_0x4f1043[_0x670c('0x42')]=_[_0x670c('0x30')](_0x4f1043['where'],{'$or':_[_0x670c('0x44')](_0x4f1043['attributes'],function(_0x29ed99){var _0x5348d3={};_0x5348d3[_0x29ed99]={'$like':'%'+_0x2045a4[_0x670c('0x24')][_0x670c('0x45')]+'%'};return _0x5348d3;})});}_0x4f1043=_[_0x670c('0x30')]({},_0x4f1043,_0x2045a4['options']);return _0x35b441[_0x670c('0x50')](_0x4f1043);}})[_0x670c('0x14')](function(_0x2cbd5c){if(_0x2cbd5c){_0x1f5582=_0x2cbd5c['length'];if(!_0x2045a4[_0x670c('0x24')][_0x670c('0x3e')]('nolimit')){_0x4f1043[_0x670c('0x11')]=qs['limit'](_0x2045a4[_0x670c('0x24')][_0x670c('0x11')]);_0x4f1043[_0x670c('0xf')]=qs[_0x670c('0xf')](_0x2045a4[_0x670c('0x24')][_0x670c('0xf')]);}return _0x35b441[_0x670c('0x50')](_0x4f1043);}})[_0x670c('0x14')](function(_0x2d9cad){if(_0x2d9cad){return _0x2d9cad?{'count':_0x1f5582,'rows':_0x2d9cad}:null;}})[_0x670c('0x14')](respondWithResult(_0x1c946b,null))[_0x670c('0x39')](handleError(_0x1c946b,null));};exports[_0x670c('0x53')]=function(_0x7346c6,_0x8957df){var _0x1ca3fb=_0x7346c6[_0x670c('0x34')][_0x670c('0x54')];return db[_0x670c('0x52')][_0x670c('0x25')]({'where':{'id':_0x1ca3fb},'attributes':['id'],'include':[{'model':db[_0x670c('0x47')],'as':_0x670c('0x55'),'attributes':['id',_0x670c('0x1b'),'online','voicePause','interface'],'raw':!![]}]})[_0x670c('0x14')](function(_0x27c9c4){if(_0x27c9c4){var _0x4d1257=_[_0x670c('0x56')](_0x27c9c4,function(_0x22e315){var _0xe11cdd=_0x22e315[_0x670c('0x16')]({'plain':!![]});return _0xe11cdd[_0x670c('0x55')];});return db[_0x670c('0x1e')]['find']({'where':{'id':_0x7346c6['params']['id']}})[_0x670c('0x14')](function(_0x1d6a6a){return db[_0x670c('0x57')][_0x670c('0x58')](function(_0x4556e1){return _0x1d6a6a['addTeams'](_0x1ca3fb,{'transaction':_0x4556e1})[_0x670c('0x14')](function(){return BPromise[_0x670c('0x59')](_0x4d1257,function(_0x44c528){return db[_0x670c('0x46')][_0x670c('0x5a')]({'where':{'UserId':_0x44c528['id'],'OpenchannelQueueId':_0x7346c6[_0x670c('0x3b')]['id']},'transaction':_0x4556e1});});})[_0x670c('0x14')](function(){_0x4d1257['forEach'](function(_0x48726b){socket['emit'](_0x670c('0x5b'),{'UserId':_0x48726b['id'],'OpenchannelQueueId':_0x1d6a6a['id']});});});});});}})[_0x670c('0x14')](respondWithStatusCode(_0x8957df,null))[_0x670c('0x39')](handleError(_0x8957df,null));};exports[_0x670c('0x5c')]=function(_0x2de3de,_0x3c55d8){return db[_0x670c('0x52')][_0x670c('0x25')]({'where':{'id':_0x2de3de[_0x670c('0x24')][_0x670c('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x670c('0x55'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3c55d8,null))[_0x670c('0x14')](function(_0x458c5b){var _0x859e1c=_['map'](_0x458c5b,'id');var _0x50bdb7=[];var _0x2e3e45=[];var _0x5343f7=squel['select']();_0x5343f7[_0x670c('0x5d')](_0x670c('0x5e'))[_0x670c('0x5f')](_0x670c('0x60'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x670c('0x42')](_0x670c('0x61'),_0x2de3de[_0x670c('0x3b')]['id']);for(var _0x2185e7=0x0;_0x2185e7<_0x458c5b[_0x670c('0x2e')];_0x2185e7+=0x1){let _0x2985c8=_0x458c5b[_0x2185e7];for(var _0xa6d733=0x0;_0xa6d733<_0x2985c8[_0x670c('0x55')]['length'];_0xa6d733+=0x1){let _0x3fdaca=_0x2985c8[_0x670c('0x55')][_0xa6d733];var _0x6bca70=_0x5343f7['clone']();_0x6bca70[_0x670c('0x42')]('ut.UserId\x20=\x20?',_0x3fdaca['id']);_0x2e3e45[_0x670c('0x62')](db[_0x670c('0x57')][_0x670c('0x24')](_0x6bca70[_0x670c('0x63')](),{'type':db[_0x670c('0x57')][_0x670c('0x64')][_0x670c('0x65')]})['then'](function(_0x1e307c){if(_0x1e307c[_0x670c('0x2e')]===0x1){return _0x3fdaca['id'];}else{var _0x30f41a=_[_0x670c('0x66')](_[_0x670c('0x44')](_0x1e307c,_0x670c('0x67')),function(_0x48d19b){return _['includes'](_0x859e1c,_0x48d19b);});if(_0x30f41a){return _0x3fdaca['id'];}}}));}}return BPromise['all'](_0x2e3e45)[_0x670c('0x14')](function(_0x3341b9){_0x50bdb7=_(_0x50bdb7)[_0x670c('0x68')](_0x3341b9)['compact']()[_0x670c('0x69')]();return db[_0x670c('0x1e')][_0x670c('0x32')]({'where':{'id':_0x2de3de[_0x670c('0x3b')]['id']}})[_0x670c('0x14')](function(_0x169fd5){return db[_0x670c('0x57')][_0x670c('0x58')](function(_0x5d67cd){return _0x169fd5[_0x670c('0x5c')](_0x2de3de[_0x670c('0x24')][_0x670c('0x54')],{'transaction':_0x5d67cd})[_0x670c('0x14')](function(){if(!_[_0x670c('0x6a')](_0x50bdb7)){return _0x169fd5['removeAgents'](_0x50bdb7,{'transaction':_0x5d67cd});}})['then'](function(){_0x50bdb7['forEach'](function(_0x1bf87d){socket['emit'](_0x670c('0x6b'),{'UserId':_0x1bf87d,'OpenchannelQueueId':_0x169fd5['id']});});});});});});})['then'](respondWithStatusCode(_0x3c55d8,null))['catch'](handleError(_0x3c55d8,null));};exports[_0x670c('0x6c')]=function(_0x3f7ee0,_0x33093c){return db['OpenchannelQueue'][_0x670c('0x32')]({'where':{'id':_0x3f7ee0[_0x670c('0x3b')]['id']}})[_0x670c('0x14')](handleEntityNotFound(_0x33093c,null))[_0x670c('0x14')](function(_0x1cc6e5){if(_0x1cc6e5){return _0x1cc6e5[_0x670c('0x6c')](_0x3f7ee0[_0x670c('0x34')]['ids'],_[_0x670c('0x6d')](_0x3f7ee0[_0x670c('0x34')],['ids','id'])||{})[_0x670c('0x6e')](function(_0x383bfd){for(var _0x23a2cc=0x0;_0x23a2cc<_0x3f7ee0['body'][_0x670c('0x54')]['length'];_0x23a2cc+=0x1){socket[_0x670c('0x6f')](_0x670c('0x5b'),{'UserId':Number(_0x3f7ee0[_0x670c('0x34')][_0x670c('0x54')][_0x23a2cc]),'OpenchannelQueueId':Number(_0x3f7ee0['params']['id'])});}return _0x383bfd;});}})['then'](respondWithResult(_0x33093c,null))[_0x670c('0x39')](handleError(_0x33093c,null));};exports['removeAgents']=function(_0x5eb68f,_0x47c060){return db[_0x670c('0x1e')]['find']({'where':{'id':_0x5eb68f[_0x670c('0x3b')]['id']}})[_0x670c('0x14')](handleEntityNotFound(_0x47c060,null))[_0x670c('0x14')](function(_0x57ad27){if(_0x57ad27){return _0x57ad27[_0x670c('0x70')](_0x5eb68f[_0x670c('0x24')][_0x670c('0x54')])[_0x670c('0x14')](function(){if(_[_0x670c('0x71')](_0x5eb68f[_0x670c('0x24')][_0x670c('0x54')])){for(var _0x2836ee=0x0;_0x2836ee<_0x5eb68f[_0x670c('0x24')][_0x670c('0x54')][_0x670c('0x2e')];_0x2836ee+=0x1){socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x5eb68f[_0x670c('0x24')]['ids'][_0x2836ee]),'OpenchannelQueueId':Number(_0x5eb68f['params']['id'])});}}else{socket[_0x670c('0x6f')](_0x670c('0x6b'),{'UserId':Number(_0x5eb68f[_0x670c('0x24')]['ids']),'OpenchannelQueueId':Number(_0x5eb68f[_0x670c('0x3b')]['id'])});}});}})['then'](respondWithStatusCode(_0x47c060,null))['catch'](handleError(_0x47c060,null));};exports[_0x670c('0x72')]=function(_0x57626f,_0x2c2b10){var _0x43955d={};var _0x431a44={};var _0x20d880;var _0x30666a;return db[_0x670c('0x1e')]['findOne']({'where':{'id':_0x57626f[_0x670c('0x3b')]['id']}})[_0x670c('0x14')](handleEntityNotFound(_0x2c2b10,null))[_0x670c('0x14')](function(_0x4ab066){if(_0x4ab066){_0x20d880=_0x4ab066;_0x431a44[_0x670c('0x28')]=_[_0x670c('0x29')](db['User'][_0x670c('0x1f')]);_0x431a44[_0x670c('0x24')]=_[_0x670c('0x29')](_0x57626f['query']);_0x431a44[_0x670c('0x2a')]=_[_0x670c('0x2c')](_0x431a44[_0x670c('0x28')],_0x431a44[_0x670c('0x24')]);_0x43955d[_0x670c('0x2b')]=_[_0x670c('0x2c')](_0x431a44[_0x670c('0x28')],qs[_0x670c('0x2d')](_0x57626f['query'][_0x670c('0x2d')]));_0x43955d[_0x670c('0x2b')]=_0x43955d['attributes'][_0x670c('0x2e')]?_0x43955d[_0x670c('0x2b')]:_0x431a44[_0x670c('0x28')];_0x43955d[_0x670c('0x73')]=qs['sort'](_0x57626f['query']['sort']);_0x43955d[_0x670c('0x42')]=qs[_0x670c('0x2a')](_[_0x670c('0x41')](_0x57626f[_0x670c('0x24')],_0x431a44['filters']));if(_0x57626f['query'][_0x670c('0x45')]){_0x43955d['where']=_[_0x670c('0x30')](_0x43955d[_0x670c('0x42')],{'$or':_[_0x670c('0x44')](_0x43955d[_0x670c('0x2b')],function(_0x23800b){var _0x3839e4={};_0x3839e4[_0x23800b]={'$like':'%'+_0x57626f[_0x670c('0x24')]['filter']+'%'};return _0x3839e4;})});}_0x43955d=_['merge']({},_0x43955d,_0x57626f['options']);return _0x20d880[_0x670c('0x72')](_0x43955d);}})[_0x670c('0x14')](function(_0x371d96){if(_0x371d96){_0x30666a=_0x371d96['length'];if(!_0x57626f[_0x670c('0x24')][_0x670c('0x3e')](_0x670c('0x3f'))){_0x43955d[_0x670c('0x11')]=qs[_0x670c('0x11')](_0x57626f[_0x670c('0x24')]['limit']);_0x43955d[_0x670c('0xf')]=qs[_0x670c('0xf')](_0x57626f[_0x670c('0x24')]['offset']);}return _0x20d880['getAgents'](_0x43955d);}})[_0x670c('0x14')](function(_0x1955ff){if(_0x1955ff){return _0x1955ff?{'count':_0x30666a,'rows':_0x1955ff}:null;}})['then'](respondWithResult(_0x2c2b10,null))['catch'](handleError(_0x2c2b10,null));}; \ No newline at end of file +var _0x0959=['squel','ioredis','../../components/parsers/qs','../../config/logger','api','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','offset','undefined','count','update','then','destroy','get','OpenchannelQueues','status','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','key','where','include','query','findAll','rows','catch','show','params','keys','filters','attributes','intersection','fields','length','model','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','hasOwnProperty','limit','order','sort','pick','OpenchannelQueueId','filter','UserOpenchannelQueue','User','map','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','nolimit','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeAgents','addAgents','spread','isArray','userOpenchannelQueue:remove','getAgents','util'];(function(_0x5055d4,_0x43f055){var _0x343b85=function(_0x556edc){while(--_0x556edc){_0x5055d4['push'](_0x5055d4['shift']());}};_0x343b85(++_0x43f055);}(_0x0959,0x164));var _0x9095=function(_0x2062e3,_0x9e7949){_0x2062e3=_0x2062e3-0x0;var _0x2612e6=_0x0959[_0x2062e3];return _0x2612e6;};'use strict';var BPromise=require('bluebird');var util=require(_0x9095('0x0'));var _=require('lodash');var squel=require(_0x9095('0x1'));var Redis=require(_0x9095('0x2'));var qs=require(_0x9095('0x3'));var logger=require(_0x9095('0x4'))(_0x9095('0x5'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x9095('0x6')]=_['defaults'](config[_0x9095('0x6')],{'host':_0x9095('0x7'),'port':0x18eb});var socket=require(_0x9095('0x8'))(new Redis(config['redis']));require(_0x9095('0x9'))[_0x9095('0xa')](socket);function respondWithStatusCode(_0x124658,_0x129f87){_0x129f87=_0x129f87||0xcc;return function(_0x338dc6){if(_0x338dc6){return _0x124658[_0x9095('0xb')](_0x129f87);}return _0x124658['status'](_0x129f87)[_0x9095('0xc')]();};}function respondWithResult(_0x4c1bfd,_0x46083d){_0x46083d=_0x46083d||0xc8;return function(_0x4b4e56){if(_0x4b4e56){return _0x4c1bfd['status'](_0x46083d)['json'](_0x4b4e56);}};}function respondWithFilteredResult(_0x148311,_0x23d471){return function(_0xd0e59d){if(_0xd0e59d){var _0x431147=typeof _0x23d471[_0x9095('0xd')]===_0x9095('0xe')&&typeof _0x23d471['limit']===_0x9095('0xe');var _0x3bee82=_0xd0e59d[_0x9095('0xf')];var _0x23fc36=_0x431147?0x0:_0x23d471[_0x9095('0xd')];var _0x265987=_0x431147?_0xd0e59d['count']:_0x23d471['offset']+_0x23d471['limit'];var _0x3a5ce5;if(_0x265987>=_0x3bee82){_0x265987=_0x3bee82;_0x3a5ce5=0xc8;}else{_0x3a5ce5=0xce;}_0x148311['status'](_0x3a5ce5);return _0x148311['set']('Content-Range',_0x23fc36+'-'+_0x265987+'/'+_0x3bee82)['json'](_0xd0e59d);}return null;};}function saveUpdates(_0x572f5a){return function(_0x38decb){if(_0x38decb){return _0x38decb[_0x9095('0x10')](_0x572f5a)[_0x9095('0x11')](function(_0x197dc6){return _0x197dc6;});}return null;};}function removeEntity(_0x4b4a4c){return function(_0x50866c){if(_0x50866c){return _0x50866c[_0x9095('0x12')]()[_0x9095('0x11')](function(){var _0x5cbebc=_0x50866c[_0x9095('0x13')]({'plain':!![]});var _0x499d08=_0x9095('0x14');return db['UserProfileResource'][_0x9095('0x12')]({'where':{'type':_0x499d08,'resourceId':_0x5cbebc['id']}})[_0x9095('0x11')](function(){return _0x50866c;});})['then'](function(){_0x4b4a4c[_0x9095('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x192254){return function(_0x3634d5){if(!_0x3634d5){_0x192254[_0x9095('0xb')](0x194);}return _0x3634d5;};}function handleError(_0x4076cf,_0x39de5c){_0x39de5c=_0x39de5c||0x1f4;return function(_0x577b0a){logger[_0x9095('0x16')](_0x577b0a[_0x9095('0x17')]);if(_0x577b0a[_0x9095('0x18')]){delete _0x577b0a[_0x9095('0x18')];}_0x4076cf[_0x9095('0x15')](_0x39de5c)[_0x9095('0x19')](_0x577b0a);};}exports[_0x9095('0x1a')]=function(_0x9af4b5,_0x44829f){var _0x25359a={};var _0xec634a={'count':0x0,'rows':[]};var _0x5a560b=_['map'](db[_0x9095('0x1b')][_0x9095('0x1c')],function(_0x21ba5a){return{'name':_0x21ba5a[_0x9095('0x1d')],'type':_0x21ba5a[_0x9095('0x1e')][_0x9095('0x1f')]};});_0x25359a=qs['getOptions'](_0x5a560b,_0x9af4b5);var _0x23cd94={'where':_0x25359a[_0x9095('0x20')]};return db[_0x9095('0x1b')][_0x9095('0xf')](_0x23cd94)[_0x9095('0x11')](function(_0x2e665a){_0xec634a[_0x9095('0xf')]=_0x2e665a;_0x25359a[_0x9095('0x21')]=qs[_0x9095('0x21')](_0x9af4b5[_0x9095('0x22')]);return db[_0x9095('0x1b')][_0x9095('0x23')](_0x25359a);})['then'](function(_0x5cd6b0){_0xec634a[_0x9095('0x24')]=_0x5cd6b0;return _0xec634a;})['then'](respondWithFilteredResult(_0x44829f,_0x25359a))[_0x9095('0x25')](handleError(_0x44829f,null));};exports[_0x9095('0x26')]=function(_0x205e98,_0x3ff61b){var _0x28fb0d={'raw':!![],'where':{'id':_0x205e98[_0x9095('0x27')]['id']}},_0x2bf9d8={};_0x2bf9d8['model']=_[_0x9095('0x28')](db[_0x9095('0x1b')]['rawAttributes']);_0x2bf9d8['query']=_[_0x9095('0x28')](_0x205e98['query']);_0x2bf9d8[_0x9095('0x29')]=_['intersection'](_0x2bf9d8['model'],_0x2bf9d8[_0x9095('0x22')]);_0x28fb0d[_0x9095('0x2a')]=_[_0x9095('0x2b')](_0x2bf9d8['model'],qs['fields'](_0x205e98[_0x9095('0x22')][_0x9095('0x2c')]));_0x28fb0d[_0x9095('0x2a')]=_0x28fb0d['attributes'][_0x9095('0x2d')]?_0x28fb0d['attributes']:_0x2bf9d8[_0x9095('0x2e')];if(_0x205e98[_0x9095('0x22')]['includeAll']){_0x28fb0d[_0x9095('0x21')]=[{'all':!![]}];}_0x28fb0d=_[_0x9095('0x2f')]({},_0x28fb0d,_0x205e98[_0x9095('0x30')]);return db['OpenchannelQueue'][_0x9095('0x31')](_0x28fb0d)[_0x9095('0x11')](handleEntityNotFound(_0x3ff61b,null))[_0x9095('0x11')](respondWithResult(_0x3ff61b,null))[_0x9095('0x25')](handleError(_0x3ff61b,null));};exports[_0x9095('0x32')]=function(_0x3bcfa3,_0x505d4e){return db[_0x9095('0x1b')][_0x9095('0x32')](_0x3bcfa3[_0x9095('0x33')],{})['then'](function(_0xf9aa92){var _0x44745f=_0x3bcfa3['user'][_0x9095('0x13')]({'plain':!![]});if(!_0x44745f)throw new Error(_0x9095('0x34'));if(_0x44745f['role']==='user'){var _0x3916db=_0xf9aa92[_0x9095('0x13')]({'plain':!![]});var _0x27c7cd=_0x9095('0x14');return db['UserProfileSection']['find']({'where':{'name':_0x27c7cd,'userProfileId':_0x44745f[_0x9095('0x35')]},'raw':!![]})[_0x9095('0x11')](function(_0x4c41dd){if(_0x4c41dd&&_0x4c41dd[_0x9095('0x36')]===0x0){return db[_0x9095('0x37')][_0x9095('0x32')]({'name':_0x3916db[_0x9095('0x18')],'resourceId':_0x3916db['id'],'type':_0x4c41dd[_0x9095('0x18')],'sectionId':_0x4c41dd['id']},{})[_0x9095('0x11')](function(){return _0xf9aa92;});}else{return _0xf9aa92;}})[_0x9095('0x25')](function(_0x110920){logger[_0x9095('0x16')](_0x9095('0x38'),_0x110920);throw _0x110920;});}return _0xf9aa92;})[_0x9095('0x11')](respondWithResult(_0x505d4e,0xc9))[_0x9095('0x25')](handleError(_0x505d4e,null));};exports[_0x9095('0x10')]=function(_0x6e5d57,_0x56c649){if(_0x6e5d57[_0x9095('0x33')]['id']){delete _0x6e5d57[_0x9095('0x33')]['id'];}return db['OpenchannelQueue'][_0x9095('0x31')]({'where':{'id':_0x6e5d57['params']['id']}})[_0x9095('0x11')](handleEntityNotFound(_0x56c649,null))[_0x9095('0x11')](saveUpdates(_0x6e5d57[_0x9095('0x33')],null))[_0x9095('0x11')](respondWithResult(_0x56c649,null))['catch'](handleError(_0x56c649,null));};exports[_0x9095('0x12')]=function(_0x5ec74c,_0xa24fc2){return db[_0x9095('0x1b')][_0x9095('0x31')]({'where':{'id':_0x5ec74c[_0x9095('0x27')]['id']}})[_0x9095('0x11')](handleEntityNotFound(_0xa24fc2,null))[_0x9095('0x11')](removeEntity(_0xa24fc2,null))[_0x9095('0x25')](handleError(_0xa24fc2,null));};exports[_0x9095('0x39')]=function(_0x52b9fd,_0x1eaaba){return db[_0x9095('0x1b')]['describe']()[_0x9095('0x11')](respondWithResult(_0x1eaaba,null))[_0x9095('0x25')](handleError(_0x1eaaba,null));};exports['getMembers']=function(_0x5e5d0f,_0x1ffb24){var _0x59fb58={'raw':!![],'where':{}},_0x2551af={},_0x4390f2;return db[_0x9095('0x1b')]['findOne']({'where':{'id':_0x5e5d0f['params']['id']}})[_0x9095('0x11')](handleEntityNotFound(_0x1ffb24,null))[_0x9095('0x11')](function(_0x13942d){if(_0x13942d){_0x4390f2=_0x13942d[_0x9095('0x13')]({'plain':!![]});_0x2551af[_0x9095('0x2e')]=_[_0x9095('0x28')](db['UserOpenchannelQueue'][_0x9095('0x1c')]);_0x2551af[_0x9095('0x22')]=_[_0x9095('0x28')](_0x5e5d0f['query']);_0x2551af[_0x9095('0x29')]=_[_0x9095('0x2b')](_0x2551af['model'],_0x2551af[_0x9095('0x22')]);_0x59fb58[_0x9095('0x2a')]=_[_0x9095('0x2b')](_0x2551af[_0x9095('0x2e')],qs['fields'](_0x5e5d0f[_0x9095('0x22')][_0x9095('0x2c')]));_0x59fb58[_0x9095('0x2a')]=_0x59fb58[_0x9095('0x2a')][_0x9095('0x2d')]?_0x59fb58[_0x9095('0x2a')]:_0x2551af['model'];if(!_0x5e5d0f['query'][_0x9095('0x3a')]('nolimit')){_0x59fb58['limit']=qs[_0x9095('0x3b')](_0x5e5d0f[_0x9095('0x22')][_0x9095('0x3b')]);_0x59fb58[_0x9095('0xd')]=qs['offset'](_0x5e5d0f[_0x9095('0x22')][_0x9095('0xd')]);}_0x59fb58[_0x9095('0x3c')]=qs[_0x9095('0x3d')](_0x5e5d0f[_0x9095('0x22')][_0x9095('0x3d')]);_0x59fb58[_0x9095('0x20')]=qs['filters'](_[_0x9095('0x3e')](_0x5e5d0f[_0x9095('0x22')],_0x2551af[_0x9095('0x29')]));_0x59fb58[_0x9095('0x20')][_0x9095('0x3f')]=_0x13942d['id'];if(_0x5e5d0f[_0x9095('0x22')][_0x9095('0x40')]){_0x59fb58[_0x9095('0x20')]=_[_0x9095('0x2f')](_0x59fb58['where'],{'$or':_['map'](_0x59fb58[_0x9095('0x2a')],function(_0x397010){var _0x412e6e={};_0x412e6e[_0x397010]={'$like':'%'+_0x5e5d0f['query']['filter']+'%'};return _0x412e6e;})});}_0x59fb58=_['merge']({},_0x59fb58,_0x5e5d0f['options']);return db[_0x9095('0x41')]['findAll'](_0x59fb58);}})[_0x9095('0x11')](function(_0x1aaf7d){if(_0x1aaf7d){return db[_0x9095('0x42')]['findAndCountAll']({'where':{'id':_[_0x9095('0x43')](_0x1aaf7d,'UserId'),'role':'agent'},'attributes':['id',_0x9095('0x18'),_0x9095('0x44'),_0x9095('0x45'),_0x9095('0x46')]});}})[_0x9095('0x11')](function(_0x33d483){if(_0x33d483){return{'count':_0x33d483['count'],'rows':_['map'](_0x33d483[_0x9095('0x24')],function(_0x3bed73){return{'membername':_0x3bed73['name'],'UserId':_0x3bed73['id'],'queue_name':_0x4390f2['name'],'OpenchannelQueueId':_0x4390f2['id'],'interface':util[_0x9095('0x47')](_0x9095('0x48'),_0x9095('0x49'),_0x3bed73[_0x9095('0x18')]),'penalty':0x0,'paused':_0x3bed73[_0x9095('0x44')],'createdAt':_0x3bed73[_0x9095('0x46')],'updatedAt':_0x3bed73[_0x9095('0x45')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9095('0x11')](respondWithFilteredResult(_0x1ffb24,_0x59fb58))[_0x9095('0x25')](handleError(_0x1ffb24,null));};exports[_0x9095('0x4a')]=function(_0x3d1175,_0x47da6c){var _0x38bfa8={};var _0x59fcb5={};var _0x1d8ee0;var _0x21f1f3;return db[_0x9095('0x1b')][_0x9095('0x4b')]({'where':{'id':_0x3d1175['params']['id']}})[_0x9095('0x11')](handleEntityNotFound(_0x47da6c,null))[_0x9095('0x11')](function(_0x2e5bda){if(_0x2e5bda){_0x1d8ee0=_0x2e5bda;_0x59fcb5[_0x9095('0x2e')]=_[_0x9095('0x28')](db[_0x9095('0x4c')][_0x9095('0x1c')]);_0x59fcb5['query']=_[_0x9095('0x28')](_0x3d1175[_0x9095('0x22')]);_0x59fcb5[_0x9095('0x29')]=_[_0x9095('0x2b')](_0x59fcb5['model'],_0x59fcb5['query']);_0x38bfa8['attributes']=_[_0x9095('0x2b')](_0x59fcb5[_0x9095('0x2e')],qs[_0x9095('0x2c')](_0x3d1175[_0x9095('0x22')][_0x9095('0x2c')]));_0x38bfa8[_0x9095('0x2a')]=_0x38bfa8[_0x9095('0x2a')][_0x9095('0x2d')]?_0x38bfa8[_0x9095('0x2a')]:_0x59fcb5[_0x9095('0x2e')];_0x38bfa8['order']=qs[_0x9095('0x3d')](_0x3d1175['query']['sort']);_0x38bfa8['where']=qs[_0x9095('0x29')](_[_0x9095('0x3e')](_0x3d1175['query'],_0x59fcb5[_0x9095('0x29')]));if(_0x3d1175[_0x9095('0x22')][_0x9095('0x40')]){_0x38bfa8[_0x9095('0x20')]=_[_0x9095('0x2f')](_0x38bfa8[_0x9095('0x20')],{'$or':_['map'](_0x38bfa8[_0x9095('0x2a')],function(_0x539123){var _0x1ecc0d={};_0x1ecc0d[_0x539123]={'$like':'%'+_0x3d1175[_0x9095('0x22')][_0x9095('0x40')]+'%'};return _0x1ecc0d;})});}_0x38bfa8=_[_0x9095('0x2f')]({},_0x38bfa8,_0x3d1175[_0x9095('0x30')]);return _0x1d8ee0[_0x9095('0x4a')](_0x38bfa8);}})[_0x9095('0x11')](function(_0x4a6a3b){if(_0x4a6a3b){_0x21f1f3=_0x4a6a3b['length'];if(!_0x3d1175['query']['hasOwnProperty'](_0x9095('0x4d'))){_0x38bfa8['limit']=qs[_0x9095('0x3b')](_0x3d1175[_0x9095('0x22')][_0x9095('0x3b')]);_0x38bfa8[_0x9095('0xd')]=qs[_0x9095('0xd')](_0x3d1175[_0x9095('0x22')][_0x9095('0xd')]);}return _0x1d8ee0['getTeams'](_0x38bfa8);}})[_0x9095('0x11')](function(_0x30383e){if(_0x30383e){return _0x30383e?{'count':_0x21f1f3,'rows':_0x30383e}:null;}})['then'](respondWithResult(_0x47da6c,null))[_0x9095('0x25')](handleError(_0x47da6c,null));};exports['addTeams']=function(_0x2e3064,_0x8b6942){var _0x129f40=_0x2e3064[_0x9095('0x33')][_0x9095('0x4e')];return db[_0x9095('0x4c')][_0x9095('0x23')]({'where':{'id':_0x129f40},'attributes':['id'],'include':[{'model':db[_0x9095('0x42')],'as':_0x9095('0x4f'),'attributes':['id',_0x9095('0x18'),_0x9095('0x50'),_0x9095('0x51'),_0x9095('0x52')],'raw':!![]}]})[_0x9095('0x11')](function(_0x4f6ae1){if(_0x4f6ae1){var _0x5f36ac=_[_0x9095('0x53')](_0x4f6ae1,function(_0x92b3a9){var _0x3958ac=_0x92b3a9[_0x9095('0x13')]({'plain':!![]});return _0x3958ac['Agents'];});return db['OpenchannelQueue']['find']({'where':{'id':_0x2e3064[_0x9095('0x27')]['id']}})['then'](function(_0xecc74f){return db[_0x9095('0x54')][_0x9095('0x55')](function(_0x554c16){return _0xecc74f[_0x9095('0x56')](_0x129f40,{'transaction':_0x554c16})[_0x9095('0x11')](function(){return BPromise[_0x9095('0x57')](_0x5f36ac,function(_0x21a6c3){return db[_0x9095('0x41')][_0x9095('0x58')]({'where':{'UserId':_0x21a6c3['id'],'OpenchannelQueueId':_0x2e3064[_0x9095('0x27')]['id']},'transaction':_0x554c16});});})['then'](function(){_0x5f36ac[_0x9095('0x59')](function(_0x117ca1){socket[_0x9095('0x5a')](_0x9095('0x5b'),{'UserId':_0x117ca1['id'],'OpenchannelQueueId':_0xecc74f['id']});});});});});}})[_0x9095('0x11')](respondWithStatusCode(_0x8b6942,null))['catch'](handleError(_0x8b6942,null));};exports[_0x9095('0x5c')]=function(_0x48df71,_0x5e5d8e){return db[_0x9095('0x4c')][_0x9095('0x23')]({'where':{'id':_0x48df71['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x9095('0x42')],'as':_0x9095('0x4f'),'attributes':['id'],'raw':!![]}]})[_0x9095('0x11')](handleEntityNotFound(_0x5e5d8e,null))['then'](function(_0x26e908){var _0xeb3adb=_[_0x9095('0x43')](_0x26e908,'id');var _0x52c829=[];var _0x42140c=[];var _0x4fa1bb=squel[_0x9095('0x5d')]();_0x4fa1bb[_0x9095('0x5e')](_0x9095('0x5f'))[_0x9095('0x60')](_0x9095('0x61'),'tq')[_0x9095('0x62')](_0x9095('0x63'),'ut',_0x9095('0x64'))[_0x9095('0x20')]('OpenchannelQueueId\x20=\x20?',_0x48df71['params']['id']);for(var _0x19ea7f=0x0;_0x19ea7f<_0x26e908['length'];_0x19ea7f+=0x1){let _0x54a93d=_0x26e908[_0x19ea7f];for(var _0x2a48c0=0x0;_0x2a48c0<_0x54a93d['Agents']['length'];_0x2a48c0+=0x1){let _0xec45e9=_0x54a93d[_0x9095('0x4f')][_0x2a48c0];var _0xe21cce=_0x4fa1bb[_0x9095('0x65')]();_0xe21cce[_0x9095('0x20')](_0x9095('0x66'),_0xec45e9['id']);_0x42140c[_0x9095('0x67')](db['sequelize'][_0x9095('0x22')](_0xe21cce[_0x9095('0x68')](),{'type':db['sequelize'][_0x9095('0x69')][_0x9095('0x6a')]})[_0x9095('0x11')](function(_0x36b1c7){if(_0x36b1c7[_0x9095('0x2d')]===0x1){return _0xec45e9['id'];}else{var _0x17273a=_[_0x9095('0x6b')](_[_0x9095('0x43')](_0x36b1c7,_0x9095('0x6c')),function(_0x380bed){return _[_0x9095('0x6d')](_0xeb3adb,_0x380bed);});if(_0x17273a){return _0xec45e9['id'];}}}));}}return BPromise['all'](_0x42140c)[_0x9095('0x11')](function(_0x1dacf4){_0x52c829=_(_0x52c829)[_0x9095('0x6e')](_0x1dacf4)[_0x9095('0x6f')]()[_0x9095('0x70')]();return db['OpenchannelQueue'][_0x9095('0x31')]({'where':{'id':_0x48df71[_0x9095('0x27')]['id']}})[_0x9095('0x11')](function(_0x1f7a90){return db[_0x9095('0x54')][_0x9095('0x55')](function(_0x419dee){return _0x1f7a90[_0x9095('0x5c')](_0x48df71[_0x9095('0x22')][_0x9095('0x4e')],{'transaction':_0x419dee})[_0x9095('0x11')](function(){if(!_['isEmpty'](_0x52c829)){return _0x1f7a90[_0x9095('0x71')](_0x52c829,{'transaction':_0x419dee});}})[_0x9095('0x11')](function(){_0x52c829[_0x9095('0x59')](function(_0x3ac09c){socket[_0x9095('0x5a')]('userOpenchannelQueue:remove',{'UserId':_0x3ac09c,'OpenchannelQueueId':_0x1f7a90['id']});});});});});});})[_0x9095('0x11')](respondWithStatusCode(_0x5e5d8e,null))[_0x9095('0x25')](handleError(_0x5e5d8e,null));};exports[_0x9095('0x72')]=function(_0x4b94d0,_0x5f17bb){return db[_0x9095('0x1b')][_0x9095('0x31')]({'where':{'id':_0x4b94d0[_0x9095('0x27')]['id']}})[_0x9095('0x11')](handleEntityNotFound(_0x5f17bb,null))[_0x9095('0x11')](function(_0x3607cf){if(_0x3607cf){return _0x3607cf[_0x9095('0x72')](_0x4b94d0['body'][_0x9095('0x4e')],_['omit'](_0x4b94d0[_0x9095('0x33')],[_0x9095('0x4e'),'id'])||{})[_0x9095('0x73')](function(_0x31c46f){for(var _0xe6cdcb=0x0;_0xe6cdcb<_0x4b94d0[_0x9095('0x33')][_0x9095('0x4e')][_0x9095('0x2d')];_0xe6cdcb+=0x1){socket[_0x9095('0x5a')](_0x9095('0x5b'),{'UserId':Number(_0x4b94d0[_0x9095('0x33')][_0x9095('0x4e')][_0xe6cdcb]),'OpenchannelQueueId':Number(_0x4b94d0[_0x9095('0x27')]['id'])});}return _0x31c46f;});}})[_0x9095('0x11')](respondWithResult(_0x5f17bb,null))['catch'](handleError(_0x5f17bb,null));};exports['removeAgents']=function(_0x313208,_0x61223d){return db[_0x9095('0x1b')]['find']({'where':{'id':_0x313208[_0x9095('0x27')]['id']}})['then'](handleEntityNotFound(_0x61223d,null))[_0x9095('0x11')](function(_0x2b11c3){if(_0x2b11c3){return _0x2b11c3[_0x9095('0x71')](_0x313208['query']['ids'])[_0x9095('0x11')](function(){if(_[_0x9095('0x74')](_0x313208[_0x9095('0x22')][_0x9095('0x4e')])){for(var _0x528585=0x0;_0x528585<_0x313208['query'][_0x9095('0x4e')][_0x9095('0x2d')];_0x528585+=0x1){socket[_0x9095('0x5a')](_0x9095('0x75'),{'UserId':Number(_0x313208['query'][_0x9095('0x4e')][_0x528585]),'OpenchannelQueueId':Number(_0x313208['params']['id'])});}}else{socket[_0x9095('0x5a')](_0x9095('0x75'),{'UserId':Number(_0x313208[_0x9095('0x22')]['ids']),'OpenchannelQueueId':Number(_0x313208[_0x9095('0x27')]['id'])});}});}})[_0x9095('0x11')](respondWithStatusCode(_0x61223d,null))['catch'](handleError(_0x61223d,null));};exports[_0x9095('0x76')]=function(_0xa582bc,_0xb1c1ec){var _0x46b0f7={};var _0x3fee3b={};var _0x46564a;var _0x352613;return db[_0x9095('0x1b')][_0x9095('0x4b')]({'where':{'id':_0xa582bc[_0x9095('0x27')]['id']}})[_0x9095('0x11')](handleEntityNotFound(_0xb1c1ec,null))[_0x9095('0x11')](function(_0x470fed){if(_0x470fed){_0x46564a=_0x470fed;_0x3fee3b[_0x9095('0x2e')]=_['keys'](db[_0x9095('0x42')][_0x9095('0x1c')]);_0x3fee3b[_0x9095('0x22')]=_[_0x9095('0x28')](_0xa582bc['query']);_0x3fee3b[_0x9095('0x29')]=_[_0x9095('0x2b')](_0x3fee3b[_0x9095('0x2e')],_0x3fee3b[_0x9095('0x22')]);_0x46b0f7[_0x9095('0x2a')]=_[_0x9095('0x2b')](_0x3fee3b[_0x9095('0x2e')],qs[_0x9095('0x2c')](_0xa582bc[_0x9095('0x22')][_0x9095('0x2c')]));_0x46b0f7['attributes']=_0x46b0f7[_0x9095('0x2a')][_0x9095('0x2d')]?_0x46b0f7[_0x9095('0x2a')]:_0x3fee3b['model'];_0x46b0f7[_0x9095('0x3c')]=qs['sort'](_0xa582bc[_0x9095('0x22')]['sort']);_0x46b0f7[_0x9095('0x20')]=qs['filters'](_[_0x9095('0x3e')](_0xa582bc[_0x9095('0x22')],_0x3fee3b['filters']));if(_0xa582bc[_0x9095('0x22')][_0x9095('0x40')]){_0x46b0f7[_0x9095('0x20')]=_['merge'](_0x46b0f7[_0x9095('0x20')],{'$or':_[_0x9095('0x43')](_0x46b0f7['attributes'],function(_0x1bf03c){var _0x224ab6={};_0x224ab6[_0x1bf03c]={'$like':'%'+_0xa582bc['query'][_0x9095('0x40')]+'%'};return _0x224ab6;})});}_0x46b0f7=_[_0x9095('0x2f')]({},_0x46b0f7,_0xa582bc[_0x9095('0x30')]);return _0x46564a[_0x9095('0x76')](_0x46b0f7);}})[_0x9095('0x11')](function(_0x37a230){if(_0x37a230){_0x352613=_0x37a230['length'];if(!_0xa582bc[_0x9095('0x22')][_0x9095('0x3a')](_0x9095('0x4d'))){_0x46b0f7[_0x9095('0x3b')]=qs[_0x9095('0x3b')](_0xa582bc[_0x9095('0x22')][_0x9095('0x3b')]);_0x46b0f7[_0x9095('0xd')]=qs[_0x9095('0xd')](_0xa582bc[_0x9095('0x22')]['offset']);}return _0x46564a[_0x9095('0x76')](_0x46b0f7);}})['then'](function(_0x529fb9){if(_0x529fb9){return _0x529fb9?{'count':_0x352613,'rows':_0x529fb9}:null;}})[_0x9095('0x11')](respondWithResult(_0xb1c1ec,null))[_0x9095('0x25')](handleError(_0xb1c1ec,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index b4bb610..71b3dc5 100644 --- a/server/api/openchannelQueue/openchannelQueue.events.js +++ b/server/api/openchannelQueue/openchannelQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5396=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x14aed4,_0x2a2467){var _0x4c7317=function(_0x3b5b6e){while(--_0x3b5b6e){_0x14aed4['push'](_0x14aed4['shift']());}};_0x4c7317(++_0x2a2467);}(_0x5396,0x101));var _0x6539=function(_0x3be589,_0x3514b8){_0x3be589=_0x3be589-0x0;var _0x4683b2=_0x5396[_0x3be589];return _0x4683b2;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x6539('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x6539('0x1')](0x0);var events={'afterCreate':_0x6539('0x2'),'afterUpdate':_0x6539('0x3'),'afterDestroy':_0x6539('0x4')};function emitEvent(_0x2e59ee){return function(_0x4e78ed,_0x226028,_0x19b6a0){OpenchannelQueueEvents[_0x6539('0x5')](_0x2e59ee+':'+_0x4e78ed['id'],_0x4e78ed);OpenchannelQueueEvents[_0x6539('0x5')](_0x2e59ee,_0x4e78ed);_0x19b6a0(null);};}for(var e in events){if(events[_0x6539('0x6')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x6539('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xd35c=['../../mysqldb','OpenchannelQueue','save','remove','emit','hook','exports','events'];(function(_0x586fc3,_0x36e4f8){var _0x2eed73=function(_0x205b1b){while(--_0x205b1b){_0x586fc3['push'](_0x586fc3['shift']());}};_0x2eed73(++_0x36e4f8);}(_0xd35c,0x8f));var _0xcd35=function(_0x3fc13f,_0x30f32b){_0x3fc13f=_0x3fc13f-0x0;var _0x98b72f=_0xd35c[_0x3fc13f];return _0x98b72f;};'use strict';var EventEmitter=require(_0xcd35('0x0'));var OpenchannelQueue=require(_0xcd35('0x1'))['db'][_0xcd35('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcd35('0x3'),'afterUpdate':'update','afterDestroy':_0xcd35('0x4')};function emitEvent(_0x5a9497){return function(_0x54bc90,_0x54c33d,_0x46d24c){OpenchannelQueueEvents['emit'](_0x5a9497+':'+_0x54bc90['id'],_0x54bc90);OpenchannelQueueEvents[_0xcd35('0x5')](_0x5a9497,_0x54bc90);_0x46d24c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xcd35('0x6')](e,emitEvent(event));}}module[_0xcd35('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 341b285..f32e587 100644 --- a/server/api/openchannelQueue/openchannelQueue.model.js +++ b/server/api/openchannelQueue/openchannelQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1488=['rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','util','../../config/logger','path'];(function(_0x140558,_0x212c11){var _0x1fce28=function(_0x3b47e){while(--_0x3b47e){_0x140558['push'](_0x140558['shift']());}};_0x1fce28(++_0x212c11);}(_0x1488,0x1c5));var _0x8148=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0x1488[_0x290fa6];return _0x47f1f3;};'use strict';var _=require('lodash');var util=require(_0x8148('0x0'));var logger=require(_0x8148('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8148('0x2'));var rimraf=require(_0x8148('0x3'));var config=require(_0x8148('0x4'));var attributes=require(_0x8148('0x5'));module[_0x8148('0x6')]=function(_0x281a17,_0x2e7084){return _0x281a17[_0x8148('0x7')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xebc0=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','openchannel_queues','lodash','util','api','moment'];(function(_0x5124cd,_0x59a835){var _0x3b04ca=function(_0x158313){while(--_0x158313){_0x5124cd['push'](_0x5124cd['shift']());}};_0x3b04ca(++_0x59a835);}(_0xebc0,0x1b6));var _0x0ebc=function(_0xed547c,_0x27b852){_0xed547c=_0xed547c-0x0;var _0xaaf46b=_0xebc0[_0xed547c];return _0xaaf46b;};'use strict';var _=require(_0x0ebc('0x0'));var util=require(_0x0ebc('0x1'));var logger=require('../../config/logger')(_0x0ebc('0x2'));var moment=require(_0x0ebc('0x3'));var BPromise=require(_0x0ebc('0x4'));var rp=require(_0x0ebc('0x5'));var fs=require('fs');var path=require(_0x0ebc('0x6'));var rimraf=require(_0x0ebc('0x7'));var config=require(_0x0ebc('0x8'));var attributes=require(_0x0ebc('0x9'));module[_0x0ebc('0xa')]=function(_0x1e39ae,_0x2ba16c){return _0x1e39ae['define'](_0x0ebc('0xb'),attributes,{'tableName':_0x0ebc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 6b40bf8..faf9319 100644 --- a/server/api/openchannelQueue/openchannelQueue.rpc.js +++ b/server/api/openchannelQueue/openchannelQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x004d=['client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetOpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','catch','ShowOpenchannelQueue','OpenchannelQueue','where','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x2a932d,_0x2cb90c){var _0x52cc41=function(_0x300266){while(--_0x300266){_0x2a932d['push'](_0x2a932d['shift']());}};_0x52cc41(++_0x2cb90c);}(_0x004d,0x179));var _0xd004=function(_0x1dac48,_0x244fbd){_0x1dac48=_0x1dac48-0x0;var _0x599cd8=_0x004d[_0x1dac48];return _0x599cd8;};'use strict';var _=require(_0xd004('0x0'));var util=require(_0xd004('0x1'));var moment=require(_0xd004('0x2'));var BPromise=require(_0xd004('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd004('0x4'));var db=require(_0xd004('0x5'))['db'];var utils=require(_0xd004('0x6'));var logger=require(_0xd004('0x7'))(_0xd004('0x8'));var config=require('../../config/environment');var jayson=require(_0xd004('0x9'));var client=jayson[_0xd004('0xa')][_0xd004('0xb')]({'port':0x232a});config[_0xd004('0xc')]=_[_0xd004('0xd')](config['redis'],{'host':_0xd004('0xe'),'port':0x18eb});var socket=require(_0xd004('0xf'))(new Redis(config[_0xd004('0xc')]));require(_0xd004('0x10'))[_0xd004('0x11')](socket);function respondWithRpcPromise(_0x27b9da,_0x38b636,_0x23829e){return new BPromise(function(_0x3160d6,_0x198a55){return client[_0xd004('0x12')](_0x27b9da,_0x23829e)[_0xd004('0x13')](function(_0x34790c){logger['info'](_0xd004('0x14'),_0x38b636,_0xd004('0x15'));logger['debug'](_0xd004('0x16'),_0x38b636,_0xd004('0x15'),JSON[_0xd004('0x17')](_0x34790c));if(_0x34790c[_0xd004('0x18')]){if(_0x34790c[_0xd004('0x18')][_0xd004('0x19')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x38b636,_0x34790c['error']['message']);return _0x198a55(_0x34790c['error'][_0xd004('0x1a')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x38b636,_0x34790c['error'][_0xd004('0x1a')]);return _0x3160d6(_0x34790c['error'][_0xd004('0x1a')]);}else{logger[_0xd004('0x1b')](_0xd004('0x14'),_0x38b636,'request\x20sent');_0x3160d6(_0x34790c[_0xd004('0x1c')][_0xd004('0x1a')]);}})['catch'](function(_0x2f0348){logger[_0xd004('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x38b636,_0x2f0348);_0x198a55(_0x2f0348);});});}exports[_0xd004('0x1d')]=function(_0x4454e2){var _0x4c0896=this;return new Promise(function(_0x1344fc,_0x1a8832){return db['OpenchannelQueue'][_0xd004('0x1e')]({'raw':_0x4454e2[_0xd004('0x1f')]?_0x4454e2['options'][_0xd004('0x20')]===undefined?!![]:![]:!![],'where':_0x4454e2['options']?_0x4454e2[_0xd004('0x1f')]['where']||null:null,'attributes':_0x4454e2[_0xd004('0x1f')]?_0x4454e2[_0xd004('0x1f')][_0xd004('0x21')]||null:null,'limit':_0x4454e2[_0xd004('0x1f')]?_0x4454e2[_0xd004('0x1f')][_0xd004('0x22')]||null:null,'include':_0x4454e2[_0xd004('0x1f')]?_0x4454e2['options'][_0xd004('0x23')]?_[_0xd004('0x24')](_0x4454e2[_0xd004('0x1f')][_0xd004('0x23')],function(_0x93646d){return{'model':db[_0x93646d['model']],'as':_0x93646d['as'],'attributes':_0x93646d[_0xd004('0x21')],'include':_0x93646d[_0xd004('0x23')]?_[_0xd004('0x24')](_0x93646d[_0xd004('0x23')],function(_0x273284){return{'model':db[_0x273284[_0xd004('0x25')]],'as':_0x273284['as'],'attributes':_0x273284[_0xd004('0x21')],'include':_0x273284[_0xd004('0x23')]?_[_0xd004('0x24')](_0x273284[_0xd004('0x23')],function(_0x5be7c2){return{'model':db[_0x5be7c2[_0xd004('0x25')]],'as':_0x5be7c2['as'],'attributes':_0x5be7c2[_0xd004('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd004('0x13')](function(_0x23b7f7){logger['info']('GetOpenchannelQueue',_0x4454e2);logger['debug']('GetOpenchannelQueue',_0x4454e2,JSON[_0xd004('0x17')](_0x23b7f7));_0x1344fc(_0x23b7f7);})[_0xd004('0x26')](function(_0x464064){logger['error'](_0xd004('0x1d'),_0x464064[_0xd004('0x1a')],_0x4454e2);_0x1a8832(_0x4c0896[_0xd004('0x18')](0x1f4,_0x464064[_0xd004('0x1a')]));});});};exports[_0xd004('0x27')]=function(_0x5ab850){var _0x5d1041=this;return new Promise(function(_0x524546,_0x29382a){return db[_0xd004('0x28')]['find']({'raw':_0x5ab850[_0xd004('0x1f')]?_0x5ab850[_0xd004('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x5ab850['options']?_0x5ab850[_0xd004('0x1f')][_0xd004('0x29')]||null:null,'attributes':_0x5ab850[_0xd004('0x1f')]?_0x5ab850[_0xd004('0x1f')][_0xd004('0x21')]||null:null,'include':_0x5ab850['options']?_0x5ab850[_0xd004('0x1f')][_0xd004('0x23')]?_[_0xd004('0x24')](_0x5ab850['options'][_0xd004('0x23')],function(_0x6de8f5){return{'model':db[_0x6de8f5[_0xd004('0x25')]],'as':_0x6de8f5['as'],'attributes':_0x6de8f5['attributes'],'include':_0x6de8f5['include']?_[_0xd004('0x24')](_0x6de8f5['include'],function(_0x1bf5a8){return{'model':db[_0x1bf5a8[_0xd004('0x25')]],'as':_0x1bf5a8['as'],'attributes':_0x1bf5a8['attributes'],'include':_0x1bf5a8[_0xd004('0x23')]?_[_0xd004('0x24')](_0x1bf5a8[_0xd004('0x23')],function(_0x2a4a2a){return{'model':db[_0x2a4a2a[_0xd004('0x25')]],'as':_0x2a4a2a['as'],'attributes':_0x2a4a2a['attributes']};}):[]};}):[]};}):[]:[]})[_0xd004('0x13')](function(_0x5c27d6){logger['info']('ShowOpenchannelQueue',_0x5ab850);logger[_0xd004('0x2a')](_0xd004('0x27'),_0x5ab850,JSON[_0xd004('0x17')](_0x5c27d6));_0x524546(_0x5c27d6);})[_0xd004('0x26')](function(_0x5f2acb){logger[_0xd004('0x18')](_0xd004('0x27'),_0x5f2acb['message'],_0x5ab850);_0x29382a(_0x5d1041[_0xd004('0x18')](0x1f4,_0x5f2acb[_0xd004('0x1a')]));});});}; \ No newline at end of file +var _0xd11c=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelQueue,\x20%s,\x20%s','message','catch','OpenchannelQueue','raw','where','options','attributes','limit','include','map','model','GetOpenchannelQueue','ShowOpenchannelQueue','find'];(function(_0x5ed789,_0x1c99cf){var _0x2c07d8=function(_0x4d73a7){while(--_0x4d73a7){_0x5ed789['push'](_0x5ed789['shift']());}};_0x2c07d8(++_0x1c99cf);}(_0xd11c,0x197));var _0xcd11=function(_0x3b481b,_0x4b0e9a){_0x3b481b=_0x3b481b-0x0;var _0x156c5d=_0xd11c[_0x3b481b];return _0x156c5d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcd11('0x0'));var BPromise=require(_0xcd11('0x1'));var rs=require(_0xcd11('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd11('0x3'))['db'];var utils=require(_0xcd11('0x4'));var logger=require(_0xcd11('0x5'))(_0xcd11('0x6'));var config=require(_0xcd11('0x7'));var jayson=require(_0xcd11('0x8'));var client=jayson['client'][_0xcd11('0x9')]({'port':0x232a});config[_0xcd11('0xa')]=_[_0xcd11('0xb')](config['redis'],{'host':_0xcd11('0xc'),'port':0x18eb});var socket=require(_0xcd11('0xd'))(new Redis(config[_0xcd11('0xa')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2cd3de,_0x11970a,_0xa608af){return new BPromise(function(_0x546e75,_0x5c6f66){return client['request'](_0x2cd3de,_0xa608af)[_0xcd11('0xe')](function(_0x463952){logger[_0xcd11('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x11970a,_0xcd11('0x10'));logger[_0xcd11('0x11')](_0xcd11('0x12'),_0x11970a,_0xcd11('0x10'),JSON[_0xcd11('0x13')](_0x463952));if(_0x463952['error']){if(_0x463952['error'][_0xcd11('0x14')]===0x1f4){logger[_0xcd11('0x15')](_0xcd11('0x16'),_0x11970a,_0x463952[_0xcd11('0x15')][_0xcd11('0x17')]);return _0x5c6f66(_0x463952[_0xcd11('0x15')]['message']);}logger['error'](_0xcd11('0x16'),_0x11970a,_0x463952[_0xcd11('0x15')][_0xcd11('0x17')]);return _0x546e75(_0x463952[_0xcd11('0x15')][_0xcd11('0x17')]);}else{logger[_0xcd11('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x11970a,'request\x20sent');_0x546e75(_0x463952['result'][_0xcd11('0x17')]);}})[_0xcd11('0x18')](function(_0x67ef8a){logger['error'](_0xcd11('0x16'),_0x11970a,_0x67ef8a);_0x5c6f66(_0x67ef8a);});});}exports['GetOpenchannelQueue']=function(_0x327f3c){var _0xd5a744=this;return new Promise(function(_0x1e3679,_0xebd785){return db[_0xcd11('0x19')]['findAll']({'raw':_0x327f3c['options']?_0x327f3c['options'][_0xcd11('0x1a')]===undefined?!![]:![]:!![],'where':_0x327f3c['options']?_0x327f3c['options'][_0xcd11('0x1b')]||null:null,'attributes':_0x327f3c[_0xcd11('0x1c')]?_0x327f3c[_0xcd11('0x1c')][_0xcd11('0x1d')]||null:null,'limit':_0x327f3c[_0xcd11('0x1c')]?_0x327f3c[_0xcd11('0x1c')][_0xcd11('0x1e')]||null:null,'include':_0x327f3c[_0xcd11('0x1c')]?_0x327f3c[_0xcd11('0x1c')][_0xcd11('0x1f')]?_[_0xcd11('0x20')](_0x327f3c[_0xcd11('0x1c')][_0xcd11('0x1f')],function(_0x1acaf8){return{'model':db[_0x1acaf8[_0xcd11('0x21')]],'as':_0x1acaf8['as'],'attributes':_0x1acaf8[_0xcd11('0x1d')],'include':_0x1acaf8['include']?_['map'](_0x1acaf8[_0xcd11('0x1f')],function(_0xde8cb6){return{'model':db[_0xde8cb6[_0xcd11('0x21')]],'as':_0xde8cb6['as'],'attributes':_0xde8cb6[_0xcd11('0x1d')],'include':_0xde8cb6[_0xcd11('0x1f')]?_['map'](_0xde8cb6[_0xcd11('0x1f')],function(_0x4f74ad){return{'model':db[_0x4f74ad[_0xcd11('0x21')]],'as':_0x4f74ad['as'],'attributes':_0x4f74ad[_0xcd11('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcd11('0xe')](function(_0x2fc643){logger[_0xcd11('0xf')](_0xcd11('0x22'),_0x327f3c);logger[_0xcd11('0x11')](_0xcd11('0x22'),_0x327f3c,JSON[_0xcd11('0x13')](_0x2fc643));_0x1e3679(_0x2fc643);})['catch'](function(_0x5b414f){logger[_0xcd11('0x15')]('GetOpenchannelQueue',_0x5b414f['message'],_0x327f3c);_0xebd785(_0xd5a744[_0xcd11('0x15')](0x1f4,_0x5b414f[_0xcd11('0x17')]));});});};exports[_0xcd11('0x23')]=function(_0x2c9724){var _0x3ddf9e=this;return new Promise(function(_0x22da5e,_0x27957d){return db[_0xcd11('0x19')][_0xcd11('0x24')]({'raw':_0x2c9724[_0xcd11('0x1c')]?_0x2c9724[_0xcd11('0x1c')][_0xcd11('0x1a')]===undefined?!![]:![]:!![],'where':_0x2c9724[_0xcd11('0x1c')]?_0x2c9724[_0xcd11('0x1c')][_0xcd11('0x1b')]||null:null,'attributes':_0x2c9724[_0xcd11('0x1c')]?_0x2c9724[_0xcd11('0x1c')][_0xcd11('0x1d')]||null:null,'include':_0x2c9724[_0xcd11('0x1c')]?_0x2c9724[_0xcd11('0x1c')][_0xcd11('0x1f')]?_[_0xcd11('0x20')](_0x2c9724['options'][_0xcd11('0x1f')],function(_0x10b26b){return{'model':db[_0x10b26b[_0xcd11('0x21')]],'as':_0x10b26b['as'],'attributes':_0x10b26b[_0xcd11('0x1d')],'include':_0x10b26b[_0xcd11('0x1f')]?_['map'](_0x10b26b[_0xcd11('0x1f')],function(_0x5b8e6d){return{'model':db[_0x5b8e6d[_0xcd11('0x21')]],'as':_0x5b8e6d['as'],'attributes':_0x5b8e6d[_0xcd11('0x1d')],'include':_0x5b8e6d['include']?_[_0xcd11('0x20')](_0x5b8e6d[_0xcd11('0x1f')],function(_0x191571){return{'model':db[_0x191571[_0xcd11('0x21')]],'as':_0x191571['as'],'attributes':_0x191571[_0xcd11('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcd11('0xe')](function(_0x2308c8){logger[_0xcd11('0xf')](_0xcd11('0x23'),_0x2c9724);logger['debug']('ShowOpenchannelQueue',_0x2c9724,JSON[_0xcd11('0x13')](_0x2308c8));_0x22da5e(_0x2308c8);})[_0xcd11('0x18')](function(_0x3f4904){logger[_0xcd11('0x15')](_0xcd11('0x23'),_0x3f4904['message'],_0x2c9724);_0x27957d(_0x3ddf9e['error'](0x1f4,_0x3f4904[_0xcd11('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index ccfa117..14ce420 100644 --- a/server/api/openchannelQueue/openchannelQueue.socket.js +++ b/server/api/openchannelQueue/openchannelQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa37f=['openchannelQueue:','save','remove','update','emit','removeListener','register','length'];(function(_0x48ac81,_0x552b5f){var _0x55960a=function(_0x5b0906){while(--_0x5b0906){_0x48ac81['push'](_0x48ac81['shift']());}};_0x55960a(++_0x552b5f);}(_0xa37f,0xd9));var _0xfa37=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa37f[_0x321bb2];return _0x9c12ed;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xfa37('0x0'),_0xfa37('0x1'),_0xfa37('0x2')];function createListener(_0x2aa0f3,_0x5166f9){return function(_0x31221a){_0x5166f9[_0xfa37('0x3')](_0x2aa0f3,_0x31221a);};}function removeListener(_0x206653,_0x151ed7){return function(){OpenchannelQueueEvents[_0xfa37('0x4')](_0x206653,_0x151ed7);};}exports[_0xfa37('0x5')]=function(_0x500f9e){for(var _0x59fbe3=0x0,_0x567174=events[_0xfa37('0x6')];_0x59fbe3<_0x567174;_0x59fbe3++){var _0x558aab=events[_0x59fbe3];var _0x42408c=createListener(_0xfa37('0x7')+_0x558aab,_0x500f9e);OpenchannelQueueEvents['on'](_0x558aab,_0x42408c);}}; \ No newline at end of file +var _0x58ce=['length','openchannelQueue:','save','remove','update','emit','removeListener'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x58ce,0xdb));var _0xe58c=function(_0x36dbeb,_0x6805bb){_0x36dbeb=_0x36dbeb-0x0;var _0x31eb3c=_0x58ce[_0x36dbeb];return _0x31eb3c;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xe58c('0x0'),_0xe58c('0x1'),_0xe58c('0x2')];function createListener(_0x161ca7,_0x4709a8){return function(_0x2ecd93){_0x4709a8[_0xe58c('0x3')](_0x161ca7,_0x2ecd93);};}function removeListener(_0x36bba4,_0x57ca5d){return function(){OpenchannelQueueEvents[_0xe58c('0x4')](_0x36bba4,_0x57ca5d);};}exports['register']=function(_0x39af99){for(var _0x416a63=0x0,_0x3fa2ee=events[_0xe58c('0x5')];_0x416a63<_0x3fa2ee;_0x416a63++){var _0x55ddd3=events[_0x416a63];var _0x13e2de=createListener(_0xe58c('0x6')+_0x55ddd3,_0x39af99);OpenchannelQueueEvents['on'](_0x55ddd3,_0x13e2de);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 9d33c9e..1fbcdbb 100644 --- a/server/api/openchannelQueueReport/index.js +++ b/server/api/openchannelQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae2f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','describe','/:id','show','post','put','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xae2f,0x8c));var _0xfae2=function(_0xe4bb3d,_0x21e87e){_0xe4bb3d=_0xe4bb3d-0x0;var _0xd9e51=_0xae2f[_0xe4bb3d];return _0xd9e51;};'use strict';var multer=require(_0xfae2('0x0'));var util=require(_0xfae2('0x1'));var path=require('path');var timeout=require(_0xfae2('0x2'));var express=require(_0xfae2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfae2('0x4'));var interaction=require(_0xfae2('0x5'));var config=require(_0xfae2('0x6'));var controller=require(_0xfae2('0x7'));router[_0xfae2('0x8')]('/',auth[_0xfae2('0x9')](),controller['index']);router[_0xfae2('0x8')]('/describe',auth[_0xfae2('0x9')](),controller[_0xfae2('0xa')]);router[_0xfae2('0x8')](_0xfae2('0xb'),auth[_0xfae2('0x9')](),controller[_0xfae2('0xc')]);router[_0xfae2('0xd')]('/',auth[_0xfae2('0x9')](),controller['create']);router[_0xfae2('0xe')](_0xfae2('0xb'),auth[_0xfae2('0x9')](),controller[_0xfae2('0xf')]);router[_0xfae2('0x10')](_0xfae2('0xb'),auth[_0xfae2('0x9')](),controller['destroy']);module[_0xfae2('0x11')]=router; \ No newline at end of file +var _0xcd0e=['../../config/environment','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x6f1031,_0x3c0a6f){var _0x4e1b8d=function(_0x159882){while(--_0x159882){_0x6f1031['push'](_0x6f1031['shift']());}};_0x4e1b8d(++_0x3c0a6f);}(_0xcd0e,0x72));var _0xecd0=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xcd0e[_0x376b45];return _0x2341b3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xecd0('0x0'));var timeout=require('connect-timeout');var express=require(_0xecd0('0x1'));var router=express[_0xecd0('0x2')]();var fs_extra=require(_0xecd0('0x3'));var auth=require(_0xecd0('0x4'));var interaction=require(_0xecd0('0x5'));var config=require(_0xecd0('0x6'));var controller=require('./openchannelQueueReport.controller');router[_0xecd0('0x7')]('/',auth['isAuthenticated'](),controller[_0xecd0('0x8')]);router[_0xecd0('0x7')](_0xecd0('0x9'),auth[_0xecd0('0xa')](),controller['describe']);router[_0xecd0('0x7')](_0xecd0('0xb'),auth[_0xecd0('0xa')](),controller[_0xecd0('0xc')]);router[_0xecd0('0xd')]('/',auth[_0xecd0('0xa')](),controller[_0xecd0('0xe')]);router[_0xecd0('0xf')](_0xecd0('0xb'),auth[_0xecd0('0xa')](),controller[_0xecd0('0x10')]);router[_0xecd0('0x11')]('/:id',auth[_0xecd0('0xa')](),controller[_0xecd0('0x12')]);module[_0xecd0('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 9916cb2..e98681f 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf69=['DATE','STRING','moment','sequelize'];(function(_0x37573b,_0x182a26){var _0x4006ae=function(_0x4f72eb){while(--_0x4f72eb){_0x37573b['push'](_0x37573b['shift']());}};_0x4006ae(++_0x182a26);}(_0xdf69,0xf6));var _0x9df6=function(_0x47709f,_0x55b28d){_0x47709f=_0x47709f-0x0;var _0x3e2b50=_0xdf69[_0x47709f];return _0x3e2b50;};'use strict';var moment=require(_0x9df6('0x0'));var Sequelize=require(_0x9df6('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9df6('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9df6('0x2')]},'reason':{'type':Sequelize[_0x9df6('0x3')]}}; \ No newline at end of file +var _0xf9f9=['moment','sequelize','exports','DATE'];(function(_0x531d15,_0x599af5){var _0x271a18=function(_0x31284d){while(--_0x31284d){_0x531d15['push'](_0x531d15['shift']());}};_0x271a18(++_0x599af5);}(_0xf9f9,0x90));var _0x9f9f=function(_0x2e3699,_0x1a1c24){_0x2e3699=_0x2e3699-0x0;var _0x448307=_0xf9f9[_0x2e3699];return _0x448307;};'use strict';var moment=require(_0x9f9f('0x0'));var Sequelize=require(_0x9f9f('0x1'));module[_0x9f9f('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x9f9f('0x3')]},'leaveAt':{'type':Sequelize[_0x9f9f('0x3')]},'acceptAt':{'type':Sequelize[_0x9f9f('0x3')]},'exitAt':{'type':Sequelize[_0x9f9f('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 572910e..3b2eef8 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x226a=['OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','params','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x226a,0x183));var _0xa226=function(_0x4a93bb,_0x495404){_0x4a93bb=_0x4a93bb-0x0;var _0x208468=_0x226a[_0x4a93bb];return _0x208468;};'use strict';var emlformat=require(_0xa226('0x0'));var rimraf=require(_0xa226('0x1'));var zipdir=require(_0xa226('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa226('0x3'));var moment=require(_0xa226('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa226('0x5'));var csv=require('to-csv');var ejs=require(_0xa226('0x6'));var fs=require('fs');var fs_extra=require(_0xa226('0x7'));var _=require(_0xa226('0x8'));var squel=require(_0xa226('0x9'));var crypto=require(_0xa226('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa226('0xb'));var querystring=require('querystring');var Papa=require(_0xa226('0xc'));var Redis=require('ioredis');var authService=require(_0xa226('0xd'));var qs=require(_0xa226('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa226('0xf'))(_0xa226('0x10'));var utils=require(_0xa226('0x11'));var config=require(_0xa226('0x12'));var licenseUtil=require(_0xa226('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ade82,_0x2bfab3){_0x2bfab3=_0x2bfab3||0xcc;return function(_0x23029a){if(_0x23029a){return _0x1ade82[_0xa226('0x14')](_0x2bfab3);}return _0x1ade82[_0xa226('0x15')](_0x2bfab3)[_0xa226('0x16')]();};}function respondWithResult(_0x6a605e,_0x586fb0){_0x586fb0=_0x586fb0||0xc8;return function(_0x41ce2e){if(_0x41ce2e){return _0x6a605e['status'](_0x586fb0)[_0xa226('0x17')](_0x41ce2e);}};}function respondWithFilteredResult(_0x292ee7,_0x2b8d11){return function(_0x444c02){if(_0x444c02){var _0xb7d65a=typeof _0x2b8d11['offset']==='undefined'&&typeof _0x2b8d11[_0xa226('0x18')]===_0xa226('0x19');var _0x3e2363=_0x444c02['count'];var _0x537d58=_0xb7d65a?0x0:_0x2b8d11[_0xa226('0x1a')];var _0x589cc2=_0xb7d65a?_0x444c02['count']:_0x2b8d11['offset']+_0x2b8d11[_0xa226('0x18')];var _0x5c1fb7;if(_0x589cc2>=_0x3e2363){_0x589cc2=_0x3e2363;_0x5c1fb7=0xc8;}else{_0x5c1fb7=0xce;}_0x292ee7[_0xa226('0x15')](_0x5c1fb7);return _0x292ee7['set'](_0xa226('0x1b'),_0x537d58+'-'+_0x589cc2+'/'+_0x3e2363)['json'](_0x444c02);}return null;};}function patchUpdates(_0x4bc798){return function(_0x1f087e){try{jsonpatch[_0xa226('0x1c')](_0x1f087e,_0x4bc798,!![]);}catch(_0x6b477f){return BPromise[_0xa226('0x1d')](_0x6b477f);}return _0x1f087e['save']();};}function saveUpdates(_0x24161a,_0x297aad){return function(_0x585982){if(_0x585982){return _0x585982[_0xa226('0x1e')](_0x24161a)[_0xa226('0x1f')](function(_0x47ff2a){return _0x47ff2a;});}return null;};}function removeEntity(_0x18f5dd,_0x422d99){return function(_0x33bc1a){if(_0x33bc1a){return _0x33bc1a[_0xa226('0x20')]()[_0xa226('0x1f')](function(){_0x18f5dd[_0xa226('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35d4d1,_0x495fad){return function(_0x55c837){if(!_0x55c837){_0x35d4d1[_0xa226('0x14')](0x194);}return _0x55c837;};}function handleError(_0x5b0fec,_0x52348e){_0x52348e=_0x52348e||0x1f4;return function(_0x4cbbfb){logger[_0xa226('0x21')](_0x4cbbfb[_0xa226('0x22')]);if(_0x4cbbfb[_0xa226('0x23')]){delete _0x4cbbfb[_0xa226('0x23')];}_0x5b0fec[_0xa226('0x15')](_0x52348e)[_0xa226('0x24')](_0x4cbbfb);};}exports[_0xa226('0x25')]=function(_0x34116e,_0xeeed91){var _0x30a502={},_0x181c77={},_0x41f574={'count':0x0,'rows':[]};var _0x4f5ebe=_[_0xa226('0x26')](db[_0xa226('0x27')][_0xa226('0x28')],function(_0x405cbe){return{'name':_0x405cbe[_0xa226('0x29')],'type':_0x405cbe[_0xa226('0x2a')][_0xa226('0x2b')]};});_0x181c77[_0xa226('0x2c')]=_[_0xa226('0x26')](_0x4f5ebe,_0xa226('0x23'));_0x181c77[_0xa226('0x2d')]=_[_0xa226('0x2e')](_0x34116e[_0xa226('0x2d')]);_0x181c77['filters']=_[_0xa226('0x2f')](_0x181c77['model'],_0x181c77[_0xa226('0x2d')]);_0x30a502[_0xa226('0x30')]=_[_0xa226('0x2f')](_0x181c77[_0xa226('0x2c')],qs[_0xa226('0x31')](_0x34116e['query']['fields']));_0x30a502[_0xa226('0x30')]=_0x30a502[_0xa226('0x30')]['length']?_0x30a502[_0xa226('0x30')]:_0x181c77['model'];if(!_0x34116e[_0xa226('0x2d')][_0xa226('0x32')](_0xa226('0x33'))){_0x30a502['limit']=qs['limit'](_0x34116e[_0xa226('0x2d')][_0xa226('0x18')]);_0x30a502[_0xa226('0x1a')]=qs[_0xa226('0x1a')](_0x34116e[_0xa226('0x2d')][_0xa226('0x1a')]);}_0x30a502[_0xa226('0x34')]=qs[_0xa226('0x35')](_0x34116e['query'][_0xa226('0x35')]);_0x30a502[_0xa226('0x36')]=qs[_0xa226('0x37')](_[_0xa226('0x38')](_0x34116e[_0xa226('0x2d')],_0x181c77[_0xa226('0x37')]),_0x4f5ebe);if(_0x34116e[_0xa226('0x2d')][_0xa226('0x39')]){_0x30a502[_0xa226('0x36')]=_[_0xa226('0x3a')](_0x30a502['where'],{'$or':_['map'](_0x4f5ebe,function(_0x5ad472){if(_0x5ad472[_0xa226('0x2a')]!==_0xa226('0x3b')){var _0x2658a4={};_0x2658a4[_0x5ad472[_0xa226('0x23')]]={'$like':'%'+_0x34116e['query'][_0xa226('0x39')]+'%'};return _0x2658a4;}})});}_0x30a502=_[_0xa226('0x3a')]({},_0x30a502,_0x34116e[_0xa226('0x3c')]);var _0x40fac0={'where':_0x30a502[_0xa226('0x36')]};return db[_0xa226('0x27')]['count'](_0x40fac0)[_0xa226('0x1f')](function(_0x4f95c4){_0x41f574[_0xa226('0x3d')]=_0x4f95c4;if(_0x34116e[_0xa226('0x2d')][_0xa226('0x3e')]){_0x30a502['include']=[{'all':!![]}];}return db[_0xa226('0x27')]['findAll'](_0x30a502);})['then'](function(_0x302d00){_0x41f574[_0xa226('0x3f')]=_0x302d00;return _0x41f574;})[_0xa226('0x1f')](respondWithFilteredResult(_0xeeed91,_0x30a502))['catch'](handleError(_0xeeed91,null));};exports['show']=function(_0x533100,_0x1bbd42){var _0x336dca={'raw':!![],'where':{'id':_0x533100[_0xa226('0x40')]['id']}},_0x469e0e={};_0x469e0e[_0xa226('0x2c')]=_[_0xa226('0x2e')](db[_0xa226('0x27')][_0xa226('0x28')]);_0x469e0e[_0xa226('0x2d')]=_[_0xa226('0x2e')](_0x533100[_0xa226('0x2d')]);_0x469e0e['filters']=_[_0xa226('0x2f')](_0x469e0e['model'],_0x469e0e['query']);_0x336dca['attributes']=_[_0xa226('0x2f')](_0x469e0e['model'],qs[_0xa226('0x31')](_0x533100['query'][_0xa226('0x31')]));_0x336dca['attributes']=_0x336dca[_0xa226('0x30')]['length']?_0x336dca['attributes']:_0x469e0e[_0xa226('0x2c')];if(_0x533100[_0xa226('0x2d')][_0xa226('0x3e')]){_0x336dca[_0xa226('0x41')]=[{'all':!![]}];}_0x336dca=_[_0xa226('0x3a')]({},_0x336dca,_0x533100[_0xa226('0x3c')]);return db[_0xa226('0x27')][_0xa226('0x42')](_0x336dca)['then'](handleEntityNotFound(_0x1bbd42,null))['then'](respondWithResult(_0x1bbd42,null))[_0xa226('0x43')](handleError(_0x1bbd42,null));};exports[_0xa226('0x44')]=function(_0x35ddc9,_0x404ba5){return db[_0xa226('0x27')][_0xa226('0x44')](_0x35ddc9['body'],{})[_0xa226('0x1f')](respondWithResult(_0x404ba5,0xc9))[_0xa226('0x43')](handleError(_0x404ba5,null));};exports[_0xa226('0x1e')]=function(_0x26ef58,_0x125b7e){if(_0x26ef58[_0xa226('0x45')]['id']){delete _0x26ef58[_0xa226('0x45')]['id'];}return db[_0xa226('0x27')][_0xa226('0x42')]({'where':{'id':_0x26ef58[_0xa226('0x40')]['id']}})[_0xa226('0x1f')](handleEntityNotFound(_0x125b7e,null))['then'](saveUpdates(_0x26ef58[_0xa226('0x45')],null))[_0xa226('0x1f')](respondWithResult(_0x125b7e,null))['catch'](handleError(_0x125b7e,null));};exports[_0xa226('0x20')]=function(_0x31216b,_0x5594fe){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x31216b['params']['id']}})[_0xa226('0x1f')](handleEntityNotFound(_0x5594fe,null))[_0xa226('0x1f')](removeEntity(_0x5594fe,null))['catch'](handleError(_0x5594fe,null));};exports[_0xa226('0x46')]=function(_0x2522a3,_0xb567b1){return db[_0xa226('0x27')][_0xa226('0x46')]()[_0xa226('0x1f')](respondWithResult(_0xb567b1,null))['catch'](handleError(_0xb567b1,null));}; \ No newline at end of file +var _0x805c=['offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','map','rawAttributes','fieldName','key','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','OpenchannelQueueReport','findAll','rows','catch','show','params','length','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x805c,0x1df));var _0xc805=function(_0x43862b,_0x52c6e6){_0x43862b=_0x43862b-0x0;var _0x37f62f=_0x805c[_0x43862b];return _0x37f62f;};'use strict';var emlformat=require(_0xc805('0x0'));var rimraf=require(_0xc805('0x1'));var zipdir=require(_0xc805('0x2'));var jsonpatch=require(_0xc805('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc805('0x4'));var csv=require(_0xc805('0x5'));var ejs=require(_0xc805('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc805('0x7'));var crypto=require('crypto');var jsforce=require(_0xc805('0x8'));var deskjs=require(_0xc805('0x9'));var toCsv=require(_0xc805('0x5'));var querystring=require(_0xc805('0xa'));var Papa=require(_0xc805('0xb'));var Redis=require(_0xc805('0xc'));var authService=require(_0xc805('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xc805('0xe'));var hardwareService=require(_0xc805('0xf'));var logger=require('../../config/logger')(_0xc805('0x10'));var utils=require(_0xc805('0x11'));var config=require(_0xc805('0x12'));var licenseUtil=require(_0xc805('0x13'));var db=require(_0xc805('0x14'))['db'];function respondWithStatusCode(_0x700ffd,_0x4ef948){_0x4ef948=_0x4ef948||0xcc;return function(_0x39811c){if(_0x39811c){return _0x700ffd[_0xc805('0x15')](_0x4ef948);}return _0x700ffd[_0xc805('0x16')](_0x4ef948)[_0xc805('0x17')]();};}function respondWithResult(_0x4cca93,_0x5bee39){_0x5bee39=_0x5bee39||0xc8;return function(_0x3b3e05){if(_0x3b3e05){return _0x4cca93['status'](_0x5bee39)[_0xc805('0x18')](_0x3b3e05);}};}function respondWithFilteredResult(_0x3bc135,_0x279654){return function(_0x255651){if(_0x255651){var _0x18a629=typeof _0x279654[_0xc805('0x19')]===_0xc805('0x1a')&&typeof _0x279654[_0xc805('0x1b')]===_0xc805('0x1a');var _0x315325=_0x255651['count'];var _0x1f9c48=_0x18a629?0x0:_0x279654[_0xc805('0x19')];var _0x5b907b=_0x18a629?_0x255651[_0xc805('0x1c')]:_0x279654['offset']+_0x279654[_0xc805('0x1b')];var _0x1de937;if(_0x5b907b>=_0x315325){_0x5b907b=_0x315325;_0x1de937=0xc8;}else{_0x1de937=0xce;}_0x3bc135[_0xc805('0x16')](_0x1de937);return _0x3bc135[_0xc805('0x1d')](_0xc805('0x1e'),_0x1f9c48+'-'+_0x5b907b+'/'+_0x315325)[_0xc805('0x18')](_0x255651);}return null;};}function patchUpdates(_0x5b1351){return function(_0x5e3bc0){try{jsonpatch[_0xc805('0x1f')](_0x5e3bc0,_0x5b1351,!![]);}catch(_0x45fc33){return BPromise['reject'](_0x45fc33);}return _0x5e3bc0['save']();};}function saveUpdates(_0x4841bd,_0x3b3cbe){return function(_0x330b74){if(_0x330b74){return _0x330b74[_0xc805('0x20')](_0x4841bd)[_0xc805('0x21')](function(_0x3e5af9){return _0x3e5af9;});}return null;};}function removeEntity(_0x2e7dcd,_0x47e4c9){return function(_0xd090fe){if(_0xd090fe){return _0xd090fe[_0xc805('0x22')]()[_0xc805('0x21')](function(){_0x2e7dcd[_0xc805('0x16')](0xcc)[_0xc805('0x17')]();});}};}function handleEntityNotFound(_0xfaae85,_0x51720a){return function(_0x55c69a){if(!_0x55c69a){_0xfaae85[_0xc805('0x15')](0x194);}return _0x55c69a;};}function handleError(_0x13d813,_0x23db32){_0x23db32=_0x23db32||0x1f4;return function(_0x40ba7d){logger[_0xc805('0x23')](_0x40ba7d[_0xc805('0x24')]);if(_0x40ba7d[_0xc805('0x25')]){delete _0x40ba7d['name'];}_0x13d813[_0xc805('0x16')](_0x23db32)['send'](_0x40ba7d);};}exports['index']=function(_0x26e2a8,_0x1cb301){var _0x235d00={},_0x4598df={},_0x5ed052={'count':0x0,'rows':[]};var _0x1a4c7a=_[_0xc805('0x26')](db['OpenchannelQueueReport'][_0xc805('0x27')],function(_0x3ac8ac){return{'name':_0x3ac8ac[_0xc805('0x28')],'type':_0x3ac8ac['type'][_0xc805('0x29')]};});_0x4598df['model']=_[_0xc805('0x26')](_0x1a4c7a,_0xc805('0x25'));_0x4598df['query']=_[_0xc805('0x2a')](_0x26e2a8['query']);_0x4598df[_0xc805('0x2b')]=_[_0xc805('0x2c')](_0x4598df[_0xc805('0x2d')],_0x4598df[_0xc805('0x2e')]);_0x235d00[_0xc805('0x2f')]=_[_0xc805('0x2c')](_0x4598df['model'],qs[_0xc805('0x30')](_0x26e2a8['query'][_0xc805('0x30')]));_0x235d00[_0xc805('0x2f')]=_0x235d00['attributes']['length']?_0x235d00[_0xc805('0x2f')]:_0x4598df[_0xc805('0x2d')];if(!_0x26e2a8[_0xc805('0x2e')][_0xc805('0x31')](_0xc805('0x32'))){_0x235d00[_0xc805('0x1b')]=qs[_0xc805('0x1b')](_0x26e2a8['query'][_0xc805('0x1b')]);_0x235d00[_0xc805('0x19')]=qs[_0xc805('0x19')](_0x26e2a8[_0xc805('0x2e')]['offset']);}_0x235d00['order']=qs[_0xc805('0x33')](_0x26e2a8[_0xc805('0x2e')]['sort']);_0x235d00[_0xc805('0x34')]=qs[_0xc805('0x2b')](_[_0xc805('0x35')](_0x26e2a8[_0xc805('0x2e')],_0x4598df[_0xc805('0x2b')]),_0x1a4c7a);if(_0x26e2a8['query'][_0xc805('0x36')]){_0x235d00['where']=_[_0xc805('0x37')](_0x235d00['where'],{'$or':_[_0xc805('0x26')](_0x1a4c7a,function(_0x10520a){if(_0x10520a[_0xc805('0x38')]!==_0xc805('0x39')){var _0x1bdb06={};_0x1bdb06[_0x10520a[_0xc805('0x25')]]={'$like':'%'+_0x26e2a8[_0xc805('0x2e')]['filter']+'%'};return _0x1bdb06;}})});}_0x235d00=_[_0xc805('0x37')]({},_0x235d00,_0x26e2a8['options']);var _0x2f0328={'where':_0x235d00[_0xc805('0x34')]};return db['OpenchannelQueueReport'][_0xc805('0x1c')](_0x2f0328)[_0xc805('0x21')](function(_0x20d47c){_0x5ed052[_0xc805('0x1c')]=_0x20d47c;if(_0x26e2a8[_0xc805('0x2e')][_0xc805('0x3a')]){_0x235d00['include']=[{'all':!![]}];}return db[_0xc805('0x3b')][_0xc805('0x3c')](_0x235d00);})[_0xc805('0x21')](function(_0x239d83){_0x5ed052[_0xc805('0x3d')]=_0x239d83;return _0x5ed052;})['then'](respondWithFilteredResult(_0x1cb301,_0x235d00))[_0xc805('0x3e')](handleError(_0x1cb301,null));};exports[_0xc805('0x3f')]=function(_0x30f4e1,_0x4d6f28){var _0x25bbed={'raw':!![],'where':{'id':_0x30f4e1[_0xc805('0x40')]['id']}},_0x29433a={};_0x29433a['model']=_[_0xc805('0x2a')](db[_0xc805('0x3b')][_0xc805('0x27')]);_0x29433a[_0xc805('0x2e')]=_['keys'](_0x30f4e1['query']);_0x29433a[_0xc805('0x2b')]=_[_0xc805('0x2c')](_0x29433a[_0xc805('0x2d')],_0x29433a[_0xc805('0x2e')]);_0x25bbed[_0xc805('0x2f')]=_[_0xc805('0x2c')](_0x29433a[_0xc805('0x2d')],qs[_0xc805('0x30')](_0x30f4e1[_0xc805('0x2e')][_0xc805('0x30')]));_0x25bbed[_0xc805('0x2f')]=_0x25bbed[_0xc805('0x2f')][_0xc805('0x41')]?_0x25bbed[_0xc805('0x2f')]:_0x29433a[_0xc805('0x2d')];if(_0x30f4e1['query']['includeAll']){_0x25bbed[_0xc805('0x42')]=[{'all':!![]}];}_0x25bbed=_[_0xc805('0x37')]({},_0x25bbed,_0x30f4e1[_0xc805('0x43')]);return db[_0xc805('0x3b')][_0xc805('0x44')](_0x25bbed)[_0xc805('0x21')](handleEntityNotFound(_0x4d6f28,null))[_0xc805('0x21')](respondWithResult(_0x4d6f28,null))[_0xc805('0x3e')](handleError(_0x4d6f28,null));};exports['create']=function(_0x2e8237,_0x561cf2){return db['OpenchannelQueueReport'][_0xc805('0x45')](_0x2e8237[_0xc805('0x46')],{})[_0xc805('0x21')](respondWithResult(_0x561cf2,0xc9))[_0xc805('0x3e')](handleError(_0x561cf2,null));};exports['update']=function(_0x56b99a,_0x2cec5d){if(_0x56b99a['body']['id']){delete _0x56b99a[_0xc805('0x46')]['id'];}return db[_0xc805('0x3b')][_0xc805('0x44')]({'where':{'id':_0x56b99a[_0xc805('0x40')]['id']}})[_0xc805('0x21')](handleEntityNotFound(_0x2cec5d,null))[_0xc805('0x21')](saveUpdates(_0x56b99a[_0xc805('0x46')],null))[_0xc805('0x21')](respondWithResult(_0x2cec5d,null))[_0xc805('0x3e')](handleError(_0x2cec5d,null));};exports['destroy']=function(_0x14c264,_0x5617d2){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x14c264[_0xc805('0x40')]['id']}})[_0xc805('0x21')](handleEntityNotFound(_0x5617d2,null))[_0xc805('0x21')](removeEntity(_0x5617d2,null))[_0xc805('0x3e')](handleError(_0x5617d2,null));};exports[_0xc805('0x47')]=function(_0x2d376c,_0x2a3315){return db[_0xc805('0x3b')][_0xc805('0x47')]()['then'](respondWithResult(_0x2a3315,null))[_0xc805('0x3e')](handleError(_0x2a3315,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 274cade..c6152dc 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x28fb62,_0xf8544a){var _0x4ec302=function(_0x52fe85){while(--_0x52fe85){_0x28fb62['push'](_0x28fb62['shift']());}};_0x4ec302(++_0xf8544a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xc4aa[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x12f2c1,_0x432e79){var _0x5d5f93=function(_0x2be6df){while(--_0x2be6df){_0x12f2c1['push'](_0x12f2c1['shift']());}};_0x5d5f93(++_0x432e79);}(_0x326f,0xd1));var _0xf326=function(_0x35674d,_0x2909e2){_0x35674d=_0x35674d-0x0;var _0x218453=_0x326f[_0x35674d];return _0x218453;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 0381c29..87ea87b 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe511=['info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','then','UpdateOpenchannelQueueReport','update','where','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xe511,0x16f));var _0x1e51=function(_0x1894e7,_0x1253e6){_0x1894e7=_0x1894e7-0x0;var _0x5e857f=_0xe511[_0x1894e7];return _0x5e857f;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var moment=require('moment');var BPromise=require(_0x1e51('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e51('0x3'));var db=require(_0x1e51('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e51('0x5'))(_0x1e51('0x6'));var config=require(_0x1e51('0x7'));var jayson=require(_0x1e51('0x8'));var client=jayson['client'][_0x1e51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21ed6b,_0x5c4590,_0x4fa2ba){return new BPromise(function(_0x394ad8,_0x133021){return client['request'](_0x21ed6b,_0x4fa2ba)['then'](function(_0x658941){logger[_0x1e51('0xa')](_0x1e51('0xb'),_0x5c4590,_0x1e51('0xc'));logger[_0x1e51('0xd')](_0x1e51('0xe'),_0x5c4590,'request\x20sent',JSON[_0x1e51('0xf')](_0x658941));if(_0x658941[_0x1e51('0x10')]){if(_0x658941[_0x1e51('0x10')][_0x1e51('0x11')]===0x1f4){logger[_0x1e51('0x10')](_0x1e51('0xb'),_0x5c4590,_0x658941['error'][_0x1e51('0x12')]);return _0x133021(_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);}logger[_0x1e51('0x10')](_0x1e51('0xb'),_0x5c4590,_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);return _0x394ad8(_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);}else{logger[_0x1e51('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5c4590,_0x1e51('0xc'));_0x394ad8(_0x658941[_0x1e51('0x13')][_0x1e51('0x12')]);}})['catch'](function(_0xa3b410){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x5c4590,_0xa3b410);_0x133021(_0xa3b410);});});}exports[_0x1e51('0x14')]=function(_0x27dcad){var _0x40ae4c=this;return new Promise(function(_0x4785a5,_0x4d1aae){return db[_0x1e51('0x15')]['create'](_0x27dcad[_0x1e51('0x16')],{'raw':_0x27dcad['options']?_0x27dcad[_0x1e51('0x17')][_0x1e51('0x18')]===undefined?!![]:![]:!![]})[_0x1e51('0x19')](function(_0x183a95){logger['info']('CreateOpenchannelQueueReport',_0x27dcad);logger['debug']('CreateOpenchannelQueueReport',_0x27dcad,JSON[_0x1e51('0xf')](_0x183a95));_0x4785a5(_0x183a95);})['catch'](function(_0x3f7340){logger[_0x1e51('0x10')](_0x1e51('0x14'),_0x3f7340[_0x1e51('0x12')],_0x27dcad);_0x4d1aae(_0x40ae4c[_0x1e51('0x10')](0x1f4,_0x3f7340[_0x1e51('0x12')]));});});};exports[_0x1e51('0x1a')]=function(_0x461d3d){var _0x4bcdd3=this;return new Promise(function(_0x4d04c0,_0x43f5c5){return db[_0x1e51('0x15')][_0x1e51('0x1b')](_0x461d3d[_0x1e51('0x16')],{'raw':_0x461d3d['options']?_0x461d3d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x461d3d[_0x1e51('0x17')]?_0x461d3d[_0x1e51('0x17')][_0x1e51('0x1c')]||null:null,'attributes':_0x461d3d['options']?_0x461d3d[_0x1e51('0x17')]['attributes']||null:null,'limit':_0x461d3d['options']?_0x461d3d[_0x1e51('0x17')]['limit']||null:null})[_0x1e51('0x19')](function(_0x1eb79f){logger['info'](_0x1e51('0x1a'),_0x461d3d);logger[_0x1e51('0xd')](_0x1e51('0x1a'),_0x461d3d,JSON[_0x1e51('0xf')](_0x1eb79f));_0x4d04c0(_0x1eb79f);})['catch'](function(_0x4cf046){logger['error'](_0x1e51('0x1a'),_0x4cf046[_0x1e51('0x12')],_0x461d3d);_0x43f5c5(_0x4bcdd3[_0x1e51('0x10')](0x1f4,_0x4cf046[_0x1e51('0x12')]));});});}; \ No newline at end of file +var _0xccde=['limit','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','CreateOpenchannelQueueReport','create','body','options','raw','debug','catch','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes'];(function(_0x462926,_0x549149){var _0x1c995f=function(_0x2dc80b){while(--_0x2dc80b){_0x462926['push'](_0x462926['shift']());}};_0x1c995f(++_0x549149);}(_0xccde,0x1e1));var _0xeccd=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0xccde[_0x368bba];return _0x409f8f;};'use strict';var _=require(_0xeccd('0x0'));var util=require('util');var moment=require(_0xeccd('0x1'));var BPromise=require('bluebird');var rs=require(_0xeccd('0x2'));var fs=require('fs');var Redis=require(_0xeccd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xeccd('0x4'))(_0xeccd('0x5'));var config=require(_0xeccd('0x6'));var jayson=require(_0xeccd('0x7'));var client=jayson[_0xeccd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x338742,_0x130f1c,_0x1b622f){return new BPromise(function(_0x1eebfb,_0x4b068e){return client[_0xeccd('0x9')](_0x338742,_0x1b622f)[_0xeccd('0xa')](function(_0x9dccd){logger[_0xeccd('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x130f1c,'request\x20sent');logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x130f1c,_0xeccd('0xc'),JSON[_0xeccd('0xd')](_0x9dccd));if(_0x9dccd[_0xeccd('0xe')]){if(_0x9dccd[_0xeccd('0xe')][_0xeccd('0xf')]===0x1f4){logger['error'](_0xeccd('0x10'),_0x130f1c,_0x9dccd[_0xeccd('0xe')][_0xeccd('0x11')]);return _0x4b068e(_0x9dccd[_0xeccd('0xe')][_0xeccd('0x11')]);}logger[_0xeccd('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x130f1c,_0x9dccd['error'][_0xeccd('0x11')]);return _0x1eebfb(_0x9dccd[_0xeccd('0xe')][_0xeccd('0x11')]);}else{logger[_0xeccd('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x130f1c,_0xeccd('0xc'));_0x1eebfb(_0x9dccd[_0xeccd('0x12')]['message']);}})['catch'](function(_0x42e47e){logger[_0xeccd('0xe')](_0xeccd('0x10'),_0x130f1c,_0x42e47e);_0x4b068e(_0x42e47e);});});}exports[_0xeccd('0x13')]=function(_0xb0fad7){var _0x360d25=this;return new Promise(function(_0x466d98,_0x17596a){return db['OpenchannelQueueReport'][_0xeccd('0x14')](_0xb0fad7[_0xeccd('0x15')],{'raw':_0xb0fad7[_0xeccd('0x16')]?_0xb0fad7[_0xeccd('0x16')][_0xeccd('0x17')]===undefined?!![]:![]:!![]})[_0xeccd('0xa')](function(_0x508439){logger['info']('CreateOpenchannelQueueReport',_0xb0fad7);logger[_0xeccd('0x18')]('CreateOpenchannelQueueReport',_0xb0fad7,JSON[_0xeccd('0xd')](_0x508439));_0x466d98(_0x508439);})[_0xeccd('0x19')](function(_0x54083d){logger[_0xeccd('0xe')]('CreateOpenchannelQueueReport',_0x54083d[_0xeccd('0x11')],_0xb0fad7);_0x17596a(_0x360d25[_0xeccd('0xe')](0x1f4,_0x54083d[_0xeccd('0x11')]));});});};exports[_0xeccd('0x1a')]=function(_0x16e97a){var _0x5c4672=this;return new Promise(function(_0x4bc387,_0x560659){return db[_0xeccd('0x1b')][_0xeccd('0x1c')](_0x16e97a[_0xeccd('0x15')],{'raw':_0x16e97a[_0xeccd('0x16')]?_0x16e97a['options'][_0xeccd('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16e97a[_0xeccd('0x16')]?_0x16e97a[_0xeccd('0x16')][_0xeccd('0x1d')]||null:null,'attributes':_0x16e97a['options']?_0x16e97a[_0xeccd('0x16')][_0xeccd('0x1e')]||null:null,'limit':_0x16e97a[_0xeccd('0x16')]?_0x16e97a[_0xeccd('0x16')][_0xeccd('0x1f')]||null:null})[_0xeccd('0xa')](function(_0x2ea699){logger[_0xeccd('0xb')](_0xeccd('0x1a'),_0x16e97a);logger['debug'](_0xeccd('0x1a'),_0x16e97a,JSON['stringify'](_0x2ea699));_0x4bc387(_0x2ea699);})[_0xeccd('0x19')](function(_0x1817b7){logger[_0xeccd('0xe')](_0xeccd('0x1a'),_0x1817b7[_0xeccd('0x11')],_0x16e97a);_0x560659(_0x5c4672[_0xeccd('0xe')](0x1f4,_0x1817b7[_0xeccd('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 96f19cc..a8ff357 100644 --- a/server/api/openchannelTransferReport/index.js +++ b/server/api/openchannelTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a4a=['create','put','delete','/:id','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','show','post'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2a4a,0x113));var _0xa2a4=function(_0x20f897,_0x38582f){_0x20f897=_0x20f897-0x0;var _0x4cc564=_0x2a4a[_0x20f897];return _0x4cc564;};'use strict';var multer=require(_0xa2a4('0x0'));var util=require('util');var path=require(_0xa2a4('0x1'));var timeout=require(_0xa2a4('0x2'));var express=require(_0xa2a4('0x3'));var router=express[_0xa2a4('0x4')]();var fs_extra=require(_0xa2a4('0x5'));var auth=require(_0xa2a4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa2a4('0x7'));var controller=require('./openchannelTransferReport.controller');router[_0xa2a4('0x8')]('/',auth[_0xa2a4('0x9')](),controller['index']);router[_0xa2a4('0x8')]('/describe',auth[_0xa2a4('0x9')](),controller[_0xa2a4('0xa')]);router[_0xa2a4('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xa2a4('0xb')]);router[_0xa2a4('0xc')]('/',auth[_0xa2a4('0x9')](),controller[_0xa2a4('0xd')]);router[_0xa2a4('0xe')]('/:id',auth[_0xa2a4('0x9')](),controller['update']);router[_0xa2a4('0xf')](_0xa2a4('0x10'),auth[_0xa2a4('0x9')](),controller[_0xa2a4('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa35b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','/describe','/:id','isAuthenticated','show','put','update','delete','destroy','multer','path','express'];(function(_0x1a6399,_0x437d38){var _0x3a42d1=function(_0xeacda1){while(--_0xeacda1){_0x1a6399['push'](_0x1a6399['shift']());}};_0x3a42d1(++_0x437d38);}(_0xa35b,0x179));var _0xba35=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa35b[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xba35('0x0'));var util=require('util');var path=require(_0xba35('0x1'));var timeout=require('connect-timeout');var express=require(_0xba35('0x2'));var router=express[_0xba35('0x3')]();var fs_extra=require(_0xba35('0x4'));var auth=require(_0xba35('0x5'));var interaction=require(_0xba35('0x6'));var config=require(_0xba35('0x7'));var controller=require(_0xba35('0x8'));router[_0xba35('0x9')]('/',auth['isAuthenticated'](),controller[_0xba35('0xa')]);router[_0xba35('0x9')](_0xba35('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xba35('0x9')](_0xba35('0xc'),auth[_0xba35('0xd')](),controller[_0xba35('0xe')]);router['post']('/',auth[_0xba35('0xd')](),controller['create']);router[_0xba35('0xf')](_0xba35('0xc'),auth[_0xba35('0xd')](),controller[_0xba35('0x10')]);router[_0xba35('0x11')](_0xba35('0xc'),auth[_0xba35('0xd')](),controller[_0xba35('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 8726901..dc7511d 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x4ab99b,_0x504499){var _0x2a0636=function(_0x49a743){while(--_0x49a743){_0x4ab99b['push'](_0x4ab99b['shift']());}};_0x2a0636(++_0x504499);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x58efa6,_0x2c00bd){_0x58efa6=_0x58efa6-0x0;var _0x5d643c=_0xcb91[_0x58efa6];return _0x5d643c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xb43b,0x1b2));var _0xbb43=function(_0x876a7d,_0x3fdd08){_0x876a7d=_0x876a7d-0x0;var _0x5a374e=_0xb43b[_0x876a7d];return _0x5a374e;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index a4de6cb..1938e4d 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0821=['fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','options','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes'];(function(_0x58ef12,_0x1eb1ee){var _0x5810d4=function(_0x354b36){while(--_0x354b36){_0x58ef12['push'](_0x58ef12['shift']());}};_0x5810d4(++_0x1eb1ee);}(_0x0821,0x186));var _0x1082=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x0821[_0x2b10c6];return _0x3789d2;};'use strict';var emlformat=require(_0x1082('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1082('0x1'));var jsonpatch=require(_0x1082('0x2'));var rp=require(_0x1082('0x3'));var moment=require(_0x1082('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1082('0x5'));var util=require('util');var path=require(_0x1082('0x6'));var sox=require(_0x1082('0x7'));var csv=require(_0x1082('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1082('0x9'));var squel=require('squel');var crypto=require(_0x1082('0xa'));var jsforce=require(_0x1082('0xb'));var deskjs=require(_0x1082('0xc'));var toCsv=require(_0x1082('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1082('0xd'));var as=require(_0x1082('0xe'));var hardwareService=require(_0x1082('0xf'));var logger=require(_0x1082('0x10'))(_0x1082('0x11'));var utils=require(_0x1082('0x12'));var config=require(_0x1082('0x13'));var licenseUtil=require(_0x1082('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b845e,_0x24b86e){_0x24b86e=_0x24b86e||0xcc;return function(_0x5c9425){if(_0x5c9425){return _0x5b845e[_0x1082('0x15')](_0x24b86e);}return _0x5b845e[_0x1082('0x16')](_0x24b86e)[_0x1082('0x17')]();};}function respondWithResult(_0x228264,_0x555f40){_0x555f40=_0x555f40||0xc8;return function(_0x19f19d){if(_0x19f19d){return _0x228264[_0x1082('0x16')](_0x555f40)[_0x1082('0x18')](_0x19f19d);}};}function respondWithFilteredResult(_0x474ebc,_0x4b69ae){return function(_0x3866dc){if(_0x3866dc){var _0x5855f5=typeof _0x4b69ae[_0x1082('0x19')]===_0x1082('0x1a')&&typeof _0x4b69ae['limit']==='undefined';var _0x5c3cb8=_0x3866dc[_0x1082('0x1b')];var _0x9c8bbc=_0x5855f5?0x0:_0x4b69ae[_0x1082('0x19')];var _0x298650=_0x5855f5?_0x3866dc[_0x1082('0x1b')]:_0x4b69ae[_0x1082('0x19')]+_0x4b69ae[_0x1082('0x1c')];var _0x33bafb;if(_0x298650>=_0x5c3cb8){_0x298650=_0x5c3cb8;_0x33bafb=0xc8;}else{_0x33bafb=0xce;}_0x474ebc['status'](_0x33bafb);return _0x474ebc[_0x1082('0x1d')](_0x1082('0x1e'),_0x9c8bbc+'-'+_0x298650+'/'+_0x5c3cb8)[_0x1082('0x18')](_0x3866dc);}return null;};}function patchUpdates(_0x218e9b){return function(_0x15dca4){try{jsonpatch['apply'](_0x15dca4,_0x218e9b,!![]);}catch(_0x3583c2){return BPromise['reject'](_0x3583c2);}return _0x15dca4[_0x1082('0x1f')]();};}function saveUpdates(_0x116466,_0xfad60e){return function(_0x3decf2){if(_0x3decf2){return _0x3decf2[_0x1082('0x20')](_0x116466)[_0x1082('0x21')](function(_0x31cf48){return _0x31cf48;});}return null;};}function removeEntity(_0x4acf9f,_0x5aa991){return function(_0x198323){if(_0x198323){return _0x198323[_0x1082('0x22')]()[_0x1082('0x21')](function(){_0x4acf9f[_0x1082('0x16')](0xcc)[_0x1082('0x17')]();});}};}function handleEntityNotFound(_0x4c1e97,_0x207719){return function(_0x619aa3){if(!_0x619aa3){_0x4c1e97[_0x1082('0x15')](0x194);}return _0x619aa3;};}function handleError(_0x1a5582,_0x9167a8){_0x9167a8=_0x9167a8||0x1f4;return function(_0x192d7d){logger['error'](_0x192d7d[_0x1082('0x23')]);if(_0x192d7d[_0x1082('0x24')]){delete _0x192d7d[_0x1082('0x24')];}_0x1a5582[_0x1082('0x16')](_0x9167a8)[_0x1082('0x25')](_0x192d7d);};}exports[_0x1082('0x26')]=function(_0x42993d,_0x5e4c43){var _0x5364e9={},_0x327b33={},_0x1e98ea={'count':0x0,'rows':[]};var _0x4dd962=_[_0x1082('0x27')](db[_0x1082('0x28')][_0x1082('0x29')],function(_0x2dcac0){return{'name':_0x2dcac0[_0x1082('0x2a')],'type':_0x2dcac0[_0x1082('0x2b')][_0x1082('0x2c')]};});_0x327b33[_0x1082('0x2d')]=_[_0x1082('0x27')](_0x4dd962,_0x1082('0x24'));_0x327b33['query']=_[_0x1082('0x2e')](_0x42993d[_0x1082('0x2f')]);_0x327b33[_0x1082('0x30')]=_['intersection'](_0x327b33[_0x1082('0x2d')],_0x327b33['query']);_0x5364e9[_0x1082('0x31')]=_[_0x1082('0x32')](_0x327b33[_0x1082('0x2d')],qs[_0x1082('0x33')](_0x42993d[_0x1082('0x2f')][_0x1082('0x33')]));_0x5364e9['attributes']=_0x5364e9[_0x1082('0x31')][_0x1082('0x34')]?_0x5364e9['attributes']:_0x327b33[_0x1082('0x2d')];if(!_0x42993d[_0x1082('0x2f')][_0x1082('0x35')](_0x1082('0x36'))){_0x5364e9[_0x1082('0x1c')]=qs[_0x1082('0x1c')](_0x42993d[_0x1082('0x2f')][_0x1082('0x1c')]);_0x5364e9[_0x1082('0x19')]=qs[_0x1082('0x19')](_0x42993d[_0x1082('0x2f')][_0x1082('0x19')]);}_0x5364e9[_0x1082('0x37')]=qs[_0x1082('0x38')](_0x42993d[_0x1082('0x2f')][_0x1082('0x38')]);_0x5364e9[_0x1082('0x39')]=qs['filters'](_[_0x1082('0x3a')](_0x42993d[_0x1082('0x2f')],_0x327b33[_0x1082('0x30')]),_0x4dd962);if(_0x42993d[_0x1082('0x2f')][_0x1082('0x3b')]){_0x5364e9[_0x1082('0x39')]=_[_0x1082('0x3c')](_0x5364e9[_0x1082('0x39')],{'$or':_[_0x1082('0x27')](_0x4dd962,function(_0x248d79){if(_0x248d79['type']!==_0x1082('0x3d')){var _0x29c08b={};_0x29c08b[_0x248d79[_0x1082('0x24')]]={'$like':'%'+_0x42993d[_0x1082('0x2f')][_0x1082('0x3b')]+'%'};return _0x29c08b;}})});}_0x5364e9=_[_0x1082('0x3c')]({},_0x5364e9,_0x42993d['options']);var _0x4f6839={'where':_0x5364e9[_0x1082('0x39')]};return db[_0x1082('0x28')][_0x1082('0x1b')](_0x4f6839)[_0x1082('0x21')](function(_0x516dd1){_0x1e98ea[_0x1082('0x1b')]=_0x516dd1;if(_0x42993d['query'][_0x1082('0x3e')]){_0x5364e9['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x1082('0x3f')](_0x5364e9);})[_0x1082('0x21')](function(_0xb7a40c){_0x1e98ea[_0x1082('0x40')]=_0xb7a40c;return _0x1e98ea;})[_0x1082('0x21')](respondWithFilteredResult(_0x5e4c43,_0x5364e9))['catch'](handleError(_0x5e4c43,null));};exports[_0x1082('0x41')]=function(_0x532cff,_0x430692){var _0x5c0f1e={'raw':!![],'where':{'id':_0x532cff[_0x1082('0x42')]['id']}},_0x50369b={};_0x50369b[_0x1082('0x2d')]=_[_0x1082('0x2e')](db['OpenchannelTransferReport'][_0x1082('0x29')]);_0x50369b[_0x1082('0x2f')]=_[_0x1082('0x2e')](_0x532cff[_0x1082('0x2f')]);_0x50369b[_0x1082('0x30')]=_[_0x1082('0x32')](_0x50369b[_0x1082('0x2d')],_0x50369b[_0x1082('0x2f')]);_0x5c0f1e[_0x1082('0x31')]=_[_0x1082('0x32')](_0x50369b['model'],qs[_0x1082('0x33')](_0x532cff[_0x1082('0x2f')][_0x1082('0x33')]));_0x5c0f1e[_0x1082('0x31')]=_0x5c0f1e['attributes'][_0x1082('0x34')]?_0x5c0f1e[_0x1082('0x31')]:_0x50369b[_0x1082('0x2d')];if(_0x532cff['query'][_0x1082('0x3e')]){_0x5c0f1e['include']=[{'all':!![]}];}_0x5c0f1e=_[_0x1082('0x3c')]({},_0x5c0f1e,_0x532cff[_0x1082('0x43')]);return db['OpenchannelTransferReport'][_0x1082('0x44')](_0x5c0f1e)[_0x1082('0x21')](handleEntityNotFound(_0x430692,null))[_0x1082('0x21')](respondWithResult(_0x430692,null))[_0x1082('0x45')](handleError(_0x430692,null));};exports[_0x1082('0x46')]=function(_0x12cac6,_0x10517a){return db[_0x1082('0x28')][_0x1082('0x46')](_0x12cac6['body'],{})[_0x1082('0x21')](respondWithResult(_0x10517a,0xc9))[_0x1082('0x45')](handleError(_0x10517a,null));};exports[_0x1082('0x20')]=function(_0x2844bf,_0x349878){if(_0x2844bf[_0x1082('0x47')]['id']){delete _0x2844bf[_0x1082('0x47')]['id'];}return db['OpenchannelTransferReport'][_0x1082('0x44')]({'where':{'id':_0x2844bf[_0x1082('0x42')]['id']}})['then'](handleEntityNotFound(_0x349878,null))['then'](saveUpdates(_0x2844bf[_0x1082('0x47')],null))[_0x1082('0x21')](respondWithResult(_0x349878,null))[_0x1082('0x45')](handleError(_0x349878,null));};exports[_0x1082('0x22')]=function(_0x3aa614,_0x41ee8b){return db[_0x1082('0x28')][_0x1082('0x44')]({'where':{'id':_0x3aa614[_0x1082('0x42')]['id']}})[_0x1082('0x21')](handleEntityNotFound(_0x41ee8b,null))['then'](removeEntity(_0x41ee8b,null))[_0x1082('0x45')](handleError(_0x41ee8b,null));};exports['describe']=function(_0x66a432,_0x5378c0){return db[_0x1082('0x28')]['describe']()['then'](respondWithResult(_0x5378c0,null))[_0x1082('0x45')](handleError(_0x5378c0,null));}; \ No newline at end of file +var _0xabc0=['status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','OpenchannelTransferReport','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','filter','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','body','catch','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0xbdf50f,_0x277212){var _0x214d84=function(_0x3b173e){while(--_0x3b173e){_0xbdf50f['push'](_0xbdf50f['shift']());}};_0x214d84(++_0x277212);}(_0xabc0,0x17b));var _0x0abc=function(_0x2b07a0,_0x4e6f3e){_0x2b07a0=_0x2b07a0-0x0;var _0x347209=_0xabc0[_0x2b07a0];return _0x347209;};'use strict';var emlformat=require(_0x0abc('0x0'));var rimraf=require(_0x0abc('0x1'));var zipdir=require(_0x0abc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0abc('0x3'));var moment=require(_0x0abc('0x4'));var BPromise=require(_0x0abc('0x5'));var Mustache=require(_0x0abc('0x6'));var util=require(_0x0abc('0x7'));var path=require(_0x0abc('0x8'));var sox=require(_0x0abc('0x9'));var csv=require(_0x0abc('0xa'));var ejs=require(_0x0abc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0abc('0xc'));var squel=require(_0x0abc('0xd'));var crypto=require(_0x0abc('0xe'));var jsforce=require(_0x0abc('0xf'));var deskjs=require(_0x0abc('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0abc('0x11'));var Papa=require(_0x0abc('0x12'));var Redis=require(_0x0abc('0x13'));var authService=require(_0x0abc('0x14'));var qs=require(_0x0abc('0x15'));var as=require(_0x0abc('0x16'));var hardwareService=require(_0x0abc('0x17'));var logger=require(_0x0abc('0x18'))(_0x0abc('0x19'));var utils=require(_0x0abc('0x1a'));var config=require(_0x0abc('0x1b'));var licenseUtil=require(_0x0abc('0x1c'));var db=require(_0x0abc('0x1d'))['db'];function respondWithStatusCode(_0x29799c,_0x1e76d3){_0x1e76d3=_0x1e76d3||0xcc;return function(_0x52a58a){if(_0x52a58a){return _0x29799c[_0x0abc('0x1e')](_0x1e76d3);}return _0x29799c[_0x0abc('0x1f')](_0x1e76d3)['end']();};}function respondWithResult(_0x253094,_0xd18dbb){_0xd18dbb=_0xd18dbb||0xc8;return function(_0x2bcc8b){if(_0x2bcc8b){return _0x253094[_0x0abc('0x1f')](_0xd18dbb)['json'](_0x2bcc8b);}};}function respondWithFilteredResult(_0x3ea0de,_0x37d746){return function(_0x3bf264){if(_0x3bf264){var _0x53d0f1=typeof _0x37d746[_0x0abc('0x20')]===_0x0abc('0x21')&&typeof _0x37d746[_0x0abc('0x22')]===_0x0abc('0x21');var _0xb0852a=_0x3bf264['count'];var _0x56beae=_0x53d0f1?0x0:_0x37d746[_0x0abc('0x20')];var _0x2b2a48=_0x53d0f1?_0x3bf264[_0x0abc('0x23')]:_0x37d746['offset']+_0x37d746['limit'];var _0x1c2ae3;if(_0x2b2a48>=_0xb0852a){_0x2b2a48=_0xb0852a;_0x1c2ae3=0xc8;}else{_0x1c2ae3=0xce;}_0x3ea0de[_0x0abc('0x1f')](_0x1c2ae3);return _0x3ea0de['set'](_0x0abc('0x24'),_0x56beae+'-'+_0x2b2a48+'/'+_0xb0852a)[_0x0abc('0x25')](_0x3bf264);}return null;};}function patchUpdates(_0x5c88d2){return function(_0x2c7da0){try{jsonpatch['apply'](_0x2c7da0,_0x5c88d2,!![]);}catch(_0x9f143f){return BPromise[_0x0abc('0x26')](_0x9f143f);}return _0x2c7da0[_0x0abc('0x27')]();};}function saveUpdates(_0x306f6c,_0x2906a4){return function(_0xd6d2f1){if(_0xd6d2f1){return _0xd6d2f1[_0x0abc('0x28')](_0x306f6c)[_0x0abc('0x29')](function(_0x337c10){return _0x337c10;});}return null;};}function removeEntity(_0x3ead19,_0x45ff3d){return function(_0x4259dd){if(_0x4259dd){return _0x4259dd[_0x0abc('0x2a')]()['then'](function(){_0x3ead19[_0x0abc('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a5a70,_0x19f09f){return function(_0x459d71){if(!_0x459d71){_0x3a5a70[_0x0abc('0x1e')](0x194);}return _0x459d71;};}function handleError(_0x4b2172,_0x438ad5){_0x438ad5=_0x438ad5||0x1f4;return function(_0x247270){logger[_0x0abc('0x2b')](_0x247270[_0x0abc('0x2c')]);if(_0x247270['name']){delete _0x247270[_0x0abc('0x2d')];}_0x4b2172[_0x0abc('0x1f')](_0x438ad5)[_0x0abc('0x2e')](_0x247270);};}exports[_0x0abc('0x2f')]=function(_0x2f97f3,_0x3daa91){var _0x34a8c0={},_0x5b4bf0={},_0x551e81={'count':0x0,'rows':[]};var _0x38c13f=_['map'](db[_0x0abc('0x30')]['rawAttributes'],function(_0x3cddd3){return{'name':_0x3cddd3[_0x0abc('0x31')],'type':_0x3cddd3[_0x0abc('0x32')][_0x0abc('0x33')]};});_0x5b4bf0[_0x0abc('0x34')]=_['map'](_0x38c13f,_0x0abc('0x2d'));_0x5b4bf0['query']=_[_0x0abc('0x35')](_0x2f97f3[_0x0abc('0x36')]);_0x5b4bf0[_0x0abc('0x37')]=_[_0x0abc('0x38')](_0x5b4bf0[_0x0abc('0x34')],_0x5b4bf0[_0x0abc('0x36')]);_0x34a8c0['attributes']=_['intersection'](_0x5b4bf0[_0x0abc('0x34')],qs[_0x0abc('0x39')](_0x2f97f3[_0x0abc('0x36')][_0x0abc('0x39')]));_0x34a8c0[_0x0abc('0x3a')]=_0x34a8c0[_0x0abc('0x3a')][_0x0abc('0x3b')]?_0x34a8c0[_0x0abc('0x3a')]:_0x5b4bf0[_0x0abc('0x34')];if(!_0x2f97f3[_0x0abc('0x36')][_0x0abc('0x3c')](_0x0abc('0x3d'))){_0x34a8c0['limit']=qs['limit'](_0x2f97f3['query'][_0x0abc('0x22')]);_0x34a8c0['offset']=qs[_0x0abc('0x20')](_0x2f97f3[_0x0abc('0x36')][_0x0abc('0x20')]);}_0x34a8c0['order']=qs[_0x0abc('0x3e')](_0x2f97f3[_0x0abc('0x36')][_0x0abc('0x3e')]);_0x34a8c0[_0x0abc('0x3f')]=qs[_0x0abc('0x37')](_[_0x0abc('0x40')](_0x2f97f3['query'],_0x5b4bf0['filters']),_0x38c13f);if(_0x2f97f3[_0x0abc('0x36')]['filter']){_0x34a8c0[_0x0abc('0x3f')]=_[_0x0abc('0x41')](_0x34a8c0[_0x0abc('0x3f')],{'$or':_[_0x0abc('0x42')](_0x38c13f,function(_0x52cacf){if(_0x52cacf[_0x0abc('0x32')]!==_0x0abc('0x43')){var _0x586e44={};_0x586e44[_0x52cacf[_0x0abc('0x2d')]]={'$like':'%'+_0x2f97f3[_0x0abc('0x36')][_0x0abc('0x44')]+'%'};return _0x586e44;}})});}_0x34a8c0=_['merge']({},_0x34a8c0,_0x2f97f3[_0x0abc('0x45')]);var _0x14783f={'where':_0x34a8c0[_0x0abc('0x3f')]};return db['OpenchannelTransferReport'][_0x0abc('0x23')](_0x14783f)[_0x0abc('0x29')](function(_0x4a260a){_0x551e81['count']=_0x4a260a;if(_0x2f97f3['query']['includeAll']){_0x34a8c0[_0x0abc('0x46')]=[{'all':!![]}];}return db[_0x0abc('0x30')][_0x0abc('0x47')](_0x34a8c0);})[_0x0abc('0x29')](function(_0x1b95a5){_0x551e81[_0x0abc('0x48')]=_0x1b95a5;return _0x551e81;})['then'](respondWithFilteredResult(_0x3daa91,_0x34a8c0))['catch'](handleError(_0x3daa91,null));};exports[_0x0abc('0x49')]=function(_0x5ed0a5,_0x4f6159){var _0x16d4ac={'raw':!![],'where':{'id':_0x5ed0a5[_0x0abc('0x4a')]['id']}},_0x5a6e6e={};_0x5a6e6e[_0x0abc('0x34')]=_[_0x0abc('0x35')](db['OpenchannelTransferReport'][_0x0abc('0x4b')]);_0x5a6e6e[_0x0abc('0x36')]=_[_0x0abc('0x35')](_0x5ed0a5['query']);_0x5a6e6e[_0x0abc('0x37')]=_['intersection'](_0x5a6e6e[_0x0abc('0x34')],_0x5a6e6e[_0x0abc('0x36')]);_0x16d4ac['attributes']=_['intersection'](_0x5a6e6e[_0x0abc('0x34')],qs[_0x0abc('0x39')](_0x5ed0a5['query'][_0x0abc('0x39')]));_0x16d4ac[_0x0abc('0x3a')]=_0x16d4ac[_0x0abc('0x3a')][_0x0abc('0x3b')]?_0x16d4ac[_0x0abc('0x3a')]:_0x5a6e6e[_0x0abc('0x34')];if(_0x5ed0a5[_0x0abc('0x36')][_0x0abc('0x4c')]){_0x16d4ac['include']=[{'all':!![]}];}_0x16d4ac=_['merge']({},_0x16d4ac,_0x5ed0a5[_0x0abc('0x45')]);return db[_0x0abc('0x30')][_0x0abc('0x4d')](_0x16d4ac)[_0x0abc('0x29')](handleEntityNotFound(_0x4f6159,null))[_0x0abc('0x29')](respondWithResult(_0x4f6159,null))['catch'](handleError(_0x4f6159,null));};exports[_0x0abc('0x4e')]=function(_0x2e934d,_0x995a65){return db['OpenchannelTransferReport'][_0x0abc('0x4e')](_0x2e934d[_0x0abc('0x4f')],{})[_0x0abc('0x29')](respondWithResult(_0x995a65,0xc9))[_0x0abc('0x50')](handleError(_0x995a65,null));};exports[_0x0abc('0x28')]=function(_0x4e5689,_0x21f7cd){if(_0x4e5689['body']['id']){delete _0x4e5689['body']['id'];}return db[_0x0abc('0x30')]['find']({'where':{'id':_0x4e5689['params']['id']}})[_0x0abc('0x29')](handleEntityNotFound(_0x21f7cd,null))[_0x0abc('0x29')](saveUpdates(_0x4e5689['body'],null))['then'](respondWithResult(_0x21f7cd,null))[_0x0abc('0x50')](handleError(_0x21f7cd,null));};exports[_0x0abc('0x2a')]=function(_0x2e9978,_0x4ecc3d){return db[_0x0abc('0x30')]['find']({'where':{'id':_0x2e9978[_0x0abc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ecc3d,null))[_0x0abc('0x29')](removeEntity(_0x4ecc3d,null))[_0x0abc('0x50')](handleError(_0x4ecc3d,null));};exports['describe']=function(_0x5edd91,_0x20df4e){return db[_0x0abc('0x30')][_0x0abc('0x51')]()[_0x0abc('0x29')](respondWithResult(_0x20df4e,null))[_0x0abc('0x50')](handleError(_0x20df4e,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index fdfa5ce..2b64e35 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.model.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba6a=['path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','bluebird'];(function(_0x24d149,_0x3c46d8){var _0x45273f=function(_0x2c6dc7){while(--_0x2c6dc7){_0x24d149['push'](_0x24d149['shift']());}};_0x45273f(++_0x3c46d8);}(_0xba6a,0x14c));var _0xaba6=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xba6a[_0x51c819];return _0x15c5d2;};'use strict';var _=require(_0xaba6('0x0'));var util=require(_0xaba6('0x1'));var logger=require(_0xaba6('0x2'))('api');var moment=require('moment');var BPromise=require(_0xaba6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaba6('0x4'));var rimraf=require(_0xaba6('0x5'));var config=require(_0xaba6('0x6'));var attributes=require(_0xaba6('0x7'));module[_0xaba6('0x8')]=function(_0x12d6fd,_0x27217f){return _0x12d6fd[_0xaba6('0x9')](_0xaba6('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xaba6('0xb'),'fields':[_0xaba6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf93d=['OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','./openchannelTransferReport.attributes','exports','define'];(function(_0x86c3a7,_0xfed69c){var _0x4ff309=function(_0x4a9196){while(--_0x4a9196){_0x86c3a7['push'](_0x86c3a7['shift']());}};_0x4ff309(++_0xfed69c);}(_0xf93d,0x16b));var _0xdf93=function(_0x32acce,_0x1c050f){_0x32acce=_0x32acce-0x0;var _0x582c25=_0xf93d[_0x32acce];return _0x582c25;};'use strict';var _=require(_0xdf93('0x0'));var util=require('util');var logger=require(_0xdf93('0x1'))('api');var moment=require(_0xdf93('0x2'));var BPromise=require(_0xdf93('0x3'));var rp=require(_0xdf93('0x4'));var fs=require('fs');var path=require(_0xdf93('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdf93('0x6'));module[_0xdf93('0x7')]=function(_0x847185,_0x2b7a78){return _0x847185[_0xdf93('0x8')](_0xdf93('0x9'),attributes,{'tableName':_0xdf93('0xa'),'paranoid':![],'indexes':[{'name':_0xdf93('0xb'),'fields':[_0xdf93('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 4044ef5..cac55b9 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0dee=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x1f385d,_0x27affc){var _0x3cc3fc=function(_0xe10103){while(--_0xe10103){_0x1f385d['push'](_0x1f385d['shift']());}};_0x3cc3fc(++_0x27affc);}(_0x0dee,0xf7));var _0xe0de=function(_0x1227bb,_0x1f63ee){_0x1227bb=_0x1227bb-0x0;var _0x5d7d1e=_0x0dee[_0x1227bb];return _0x5d7d1e;};'use strict';var _=require(_0xe0de('0x0'));var util=require(_0xe0de('0x1'));var moment=require('moment');var BPromise=require(_0xe0de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0de('0x3'));var db=require(_0xe0de('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe0de('0x5'))(_0xe0de('0x6'));var config=require(_0xe0de('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe0de('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe1fd9,_0x5e5250,_0x349fd2){return new BPromise(function(_0x5b644c,_0x25818f){return client['request'](_0xfe1fd9,_0x349fd2)[_0xe0de('0x9')](function(_0x4a5ecd){logger[_0xe0de('0xa')](_0xe0de('0xb'),_0x5e5250,_0xe0de('0xc'));logger[_0xe0de('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x5e5250,_0xe0de('0xc'),JSON[_0xe0de('0xe')](_0x4a5ecd));if(_0x4a5ecd[_0xe0de('0xf')]){if(_0x4a5ecd[_0xe0de('0xf')]['code']===0x1f4){logger['error'](_0xe0de('0xb'),_0x5e5250,_0x4a5ecd[_0xe0de('0xf')]['message']);return _0x25818f(_0x4a5ecd['error'][_0xe0de('0x10')]);}logger[_0xe0de('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5e5250,_0x4a5ecd['error']['message']);return _0x5b644c(_0x4a5ecd['error'][_0xe0de('0x10')]);}else{logger[_0xe0de('0xa')](_0xe0de('0xb'),_0x5e5250,_0xe0de('0xc'));_0x5b644c(_0x4a5ecd[_0xe0de('0x11')][_0xe0de('0x10')]);}})[_0xe0de('0x12')](function(_0x2d8c3d){logger[_0xe0de('0xf')](_0xe0de('0xb'),_0x5e5250,_0x2d8c3d);_0x25818f(_0x2d8c3d);});});} \ No newline at end of file +var _0x83d3=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelTransferReport,\x20%s,\x20%s','message','result'];(function(_0xd2647a,_0x581573){var _0x1587cc=function(_0x11790c){while(--_0x11790c){_0xd2647a['push'](_0xd2647a['shift']());}};_0x1587cc(++_0x581573);}(_0x83d3,0x17c));var _0x383d=function(_0x1f97e8,_0x445a4a){_0x1f97e8=_0x1f97e8-0x0;var _0x1ed77c=_0x83d3[_0x1f97e8];return _0x1ed77c;};'use strict';var _=require(_0x383d('0x0'));var util=require(_0x383d('0x1'));var moment=require(_0x383d('0x2'));var BPromise=require(_0x383d('0x3'));var rs=require(_0x383d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x383d('0x5'))['db'];var utils=require(_0x383d('0x6'));var logger=require(_0x383d('0x7'))(_0x383d('0x8'));var config=require('../../config/environment');var jayson=require(_0x383d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xbc074b,_0x2c3cab,_0x360bee){return new BPromise(function(_0x5641df,_0x303c1d){return client['request'](_0xbc074b,_0x360bee)['then'](function(_0x221079){logger[_0x383d('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3cab,_0x383d('0xb'));logger[_0x383d('0xc')](_0x383d('0xd'),_0x2c3cab,_0x383d('0xb'),JSON[_0x383d('0xe')](_0x221079));if(_0x221079[_0x383d('0xf')]){if(_0x221079['error']['code']===0x1f4){logger['error'](_0x383d('0x10'),_0x2c3cab,_0x221079['error'][_0x383d('0x11')]);return _0x303c1d(_0x221079[_0x383d('0xf')][_0x383d('0x11')]);}logger[_0x383d('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3cab,_0x221079['error'][_0x383d('0x11')]);return _0x5641df(_0x221079['error'][_0x383d('0x11')]);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3cab,_0x383d('0xb'));_0x5641df(_0x221079[_0x383d('0x12')]['message']);}})['catch'](function(_0x11c1f9){logger[_0x383d('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3cab,_0x11c1f9);_0x303c1d(_0x11c1f9);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 0f0feed..3802f41 100644 --- a/server/api/pause/index.js +++ b/server/api/pause/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x59b9=['destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','post','put','/:id','delete'];(function(_0x11703d,_0x3de17c){var _0x35f695=function(_0x26ffb3){while(--_0x26ffb3){_0x11703d['push'](_0x11703d['shift']());}};_0x35f695(++_0x3de17c);}(_0x59b9,0x1f2));var _0x959b=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x59b9[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0x959b('0x0'));var util=require('util');var path=require(_0x959b('0x1'));var timeout=require('connect-timeout');var express=require(_0x959b('0x2'));var router=express[_0x959b('0x3')]();var fs_extra=require(_0x959b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x959b('0x5'));var config=require(_0x959b('0x6'));var controller=require(_0x959b('0x7'));router[_0x959b('0x8')]('/',auth[_0x959b('0x9')](),controller['index']);router[_0x959b('0x8')]('/:id',auth[_0x959b('0x9')](),controller['show']);router[_0x959b('0xa')]('/',auth[_0x959b('0x9')](),controller['create']);router[_0x959b('0xb')](_0x959b('0xc'),auth[_0x959b('0x9')](),controller['update']);router[_0x959b('0xd')]('/:id',auth[_0x959b('0x9')](),controller[_0x959b('0xe')]);module[_0x959b('0xf')]=router; \ No newline at end of file +var _0xcd20=['./pause.controller','get','isAuthenticated','/:id','show','post','put','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0xcd20,0xf9));var _0x0cd2=function(_0x2730ad,_0x4d247d){_0x2730ad=_0x2730ad-0x0;var _0x1d4363=_0xcd20[_0x2730ad];return _0x1d4363;};'use strict';var multer=require('multer');var util=require(_0x0cd2('0x0'));var path=require(_0x0cd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x0cd2('0x2'));var router=express['Router']();var fs_extra=require(_0x0cd2('0x3'));var auth=require(_0x0cd2('0x4'));var interaction=require(_0x0cd2('0x5'));var config=require(_0x0cd2('0x6'));var controller=require(_0x0cd2('0x7'));router[_0x0cd2('0x8')]('/',auth[_0x0cd2('0x9')](),controller['index']);router[_0x0cd2('0x8')](_0x0cd2('0xa'),auth[_0x0cd2('0x9')](),controller[_0x0cd2('0xb')]);router[_0x0cd2('0xc')]('/',auth[_0x0cd2('0x9')](),controller['create']);router[_0x0cd2('0xd')](_0x0cd2('0xa'),auth[_0x0cd2('0x9')](),controller['update']);router['delete'](_0x0cd2('0xa'),auth['isAuthenticated'](),controller[_0x0cd2('0xe')]);module[_0x0cd2('0xf')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 39e7a38..1ae02ac 100644 --- a/server/api/pause/pause.attributes.js +++ b/server/api/pause/pause.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa247=['STRING','sequelize','name'];(function(_0x5a671f,_0x4b1d7c){var _0x3454ac=function(_0x195478){while(--_0x195478){_0x5a671f['push'](_0x5a671f['shift']());}};_0x3454ac(++_0x4b1d7c);}(_0xa247,0x169));var _0x7a24=function(_0x180b3a,_0x2492ae){_0x180b3a=_0x180b3a-0x0;var _0x108683=_0xa247[_0x180b3a];return _0x108683;};'use strict';var Sequelize=require(_0x7a24('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x7a24('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x7a24('0x2')]}}; \ No newline at end of file +var _0xf60c=['sequelize','exports','STRING','name'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xf60c,0x88));var _0xcf60=function(_0x595777,_0x5668a2){_0x595777=_0x595777-0x0;var _0x4c8105=_0xf60c[_0x595777];return _0x4c8105;};'use strict';var Sequelize=require(_0xcf60('0x0'));module[_0xcf60('0x1')]={'name':{'type':Sequelize[_0xcf60('0x2')],'unique':_0xcf60('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index dd494af..bc8773d 100644 --- a/server/api/pause/pause.controller.js +++ b/server/api/pause/pause.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd81c=['then','get','UserProfileResource','end','error','stack','name','index','Pause','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','rows','show','params','length','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x282dbc,_0x531810){var _0x2911ad=function(_0x590d99){while(--_0x590d99){_0x282dbc['push'](_0x282dbc['shift']());}};_0x2911ad(++_0x531810);}(_0xd81c,0xe1));var _0xcd81=function(_0x2e6345,_0x1c3a9a){_0x2e6345=_0x2e6345-0x0;var _0x2d381f=_0xd81c[_0x2e6345];return _0x2d381f;};'use strict';var emlformat=require(_0xcd81('0x0'));var rimraf=require(_0xcd81('0x1'));var zipdir=require(_0xcd81('0x2'));var jsonpatch=require(_0xcd81('0x3'));var rp=require(_0xcd81('0x4'));var moment=require(_0xcd81('0x5'));var BPromise=require(_0xcd81('0x6'));var Mustache=require('mustache');var util=require(_0xcd81('0x7'));var path=require(_0xcd81('0x8'));var sox=require(_0xcd81('0x9'));var csv=require(_0xcd81('0xa'));var ejs=require(_0xcd81('0xb'));var fs=require('fs');var fs_extra=require(_0xcd81('0xc'));var _=require(_0xcd81('0xd'));var squel=require('squel');var crypto=require(_0xcd81('0xe'));var jsforce=require(_0xcd81('0xf'));var deskjs=require(_0xcd81('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcd81('0x11'));var Papa=require(_0xcd81('0x12'));var Redis=require('ioredis');var authService=require(_0xcd81('0x13'));var qs=require(_0xcd81('0x14'));var as=require(_0xcd81('0x15'));var hardwareService=require(_0xcd81('0x16'));var logger=require(_0xcd81('0x17'))(_0xcd81('0x18'));var utils=require(_0xcd81('0x19'));var config=require(_0xcd81('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd81('0x1b'))['db'];function respondWithStatusCode(_0x2e7034,_0x441c7b){_0x441c7b=_0x441c7b||0xcc;return function(_0x594502){if(_0x594502){return _0x2e7034[_0xcd81('0x1c')](_0x441c7b);}return _0x2e7034[_0xcd81('0x1d')](_0x441c7b)['end']();};}function respondWithResult(_0x52d1d0,_0x5b09a3){_0x5b09a3=_0x5b09a3||0xc8;return function(_0x2b9aa8){if(_0x2b9aa8){return _0x52d1d0[_0xcd81('0x1d')](_0x5b09a3)[_0xcd81('0x1e')](_0x2b9aa8);}};}function respondWithFilteredResult(_0x5953db,_0x16a5b5){return function(_0x4cde9a){if(_0x4cde9a){var _0x236e45=typeof _0x16a5b5[_0xcd81('0x1f')]===_0xcd81('0x20')&&typeof _0x16a5b5[_0xcd81('0x21')]===_0xcd81('0x20');var _0x293524=_0x4cde9a[_0xcd81('0x22')];var _0xe1ecca=_0x236e45?0x0:_0x16a5b5[_0xcd81('0x1f')];var _0xa3ccf=_0x236e45?_0x4cde9a['count']:_0x16a5b5[_0xcd81('0x1f')]+_0x16a5b5[_0xcd81('0x21')];var _0xd0ea2a;if(_0xa3ccf>=_0x293524){_0xa3ccf=_0x293524;_0xd0ea2a=0xc8;}else{_0xd0ea2a=0xce;}_0x5953db['status'](_0xd0ea2a);return _0x5953db[_0xcd81('0x23')](_0xcd81('0x24'),_0xe1ecca+'-'+_0xa3ccf+'/'+_0x293524)[_0xcd81('0x1e')](_0x4cde9a);}return null;};}function patchUpdates(_0x262f2f){return function(_0x57386e){try{jsonpatch[_0xcd81('0x25')](_0x57386e,_0x262f2f,!![]);}catch(_0x480f16){return BPromise[_0xcd81('0x26')](_0x480f16);}return _0x57386e[_0xcd81('0x27')]();};}function saveUpdates(_0x3abb53,_0x34470f){return function(_0x539bcf){if(_0x539bcf){return _0x539bcf[_0xcd81('0x28')](_0x3abb53)['then'](function(_0x5ce7af){return _0x5ce7af;});}return null;};}function removeEntity(_0x2e64b2,_0x483ba1){return function(_0x3851a3){if(_0x3851a3){return _0x3851a3[_0xcd81('0x29')]()[_0xcd81('0x2a')](function(){var _0x861660=_0x3851a3[_0xcd81('0x2b')]({'plain':!![]});var _0x5caf39='Pauses';return db[_0xcd81('0x2c')][_0xcd81('0x29')]({'where':{'type':_0x5caf39,'resourceId':_0x861660['id']}})['then'](function(){return _0x3851a3;});})[_0xcd81('0x2a')](function(){_0x2e64b2[_0xcd81('0x1d')](0xcc)[_0xcd81('0x2d')]();});}};}function handleEntityNotFound(_0x3cec70,_0x25fad7){return function(_0x3f052b){if(!_0x3f052b){_0x3cec70[_0xcd81('0x1c')](0x194);}return _0x3f052b;};}function handleError(_0x2601e0,_0x279171){_0x279171=_0x279171||0x1f4;return function(_0x4cfe13){logger[_0xcd81('0x2e')](_0x4cfe13[_0xcd81('0x2f')]);if(_0x4cfe13[_0xcd81('0x30')]){delete _0x4cfe13['name'];}_0x2601e0[_0xcd81('0x1d')](_0x279171)['send'](_0x4cfe13);};}exports[_0xcd81('0x31')]=function(_0x4df55d,_0x48a739){var _0x2ceef3={},_0x4059bb={},_0x52e295={'count':0x0,'rows':[]};var _0x5eee25=_['map'](db[_0xcd81('0x32')][_0xcd81('0x33')],function(_0x161864){return{'name':_0x161864[_0xcd81('0x34')],'type':_0x161864['type'][_0xcd81('0x35')]};});_0x4059bb[_0xcd81('0x36')]=_[_0xcd81('0x37')](_0x5eee25,_0xcd81('0x30'));_0x4059bb[_0xcd81('0x38')]=_[_0xcd81('0x39')](_0x4df55d[_0xcd81('0x38')]);_0x4059bb[_0xcd81('0x3a')]=_[_0xcd81('0x3b')](_0x4059bb[_0xcd81('0x36')],_0x4059bb[_0xcd81('0x38')]);_0x2ceef3[_0xcd81('0x3c')]=_['intersection'](_0x4059bb[_0xcd81('0x36')],qs[_0xcd81('0x3d')](_0x4df55d['query'][_0xcd81('0x3d')]));_0x2ceef3[_0xcd81('0x3c')]=_0x2ceef3['attributes']['length']?_0x2ceef3[_0xcd81('0x3c')]:_0x4059bb[_0xcd81('0x36')];if(!_0x4df55d[_0xcd81('0x38')][_0xcd81('0x3e')](_0xcd81('0x3f'))){_0x2ceef3[_0xcd81('0x21')]=qs[_0xcd81('0x21')](_0x4df55d[_0xcd81('0x38')][_0xcd81('0x21')]);_0x2ceef3[_0xcd81('0x1f')]=qs[_0xcd81('0x1f')](_0x4df55d['query']['offset']);}_0x2ceef3[_0xcd81('0x40')]=qs[_0xcd81('0x41')](_0x4df55d[_0xcd81('0x38')][_0xcd81('0x41')]);_0x2ceef3[_0xcd81('0x42')]=qs['filters'](_['pick'](_0x4df55d[_0xcd81('0x38')],_0x4059bb['filters']),_0x5eee25);if(_0x4df55d[_0xcd81('0x38')]['filter']){_0x2ceef3[_0xcd81('0x42')]=_[_0xcd81('0x43')](_0x2ceef3[_0xcd81('0x42')],{'$or':_[_0xcd81('0x37')](_0x5eee25,function(_0x3f05e1){if(_0x3f05e1[_0xcd81('0x44')]!==_0xcd81('0x45')){var _0x4130ac={};_0x4130ac[_0x3f05e1[_0xcd81('0x30')]]={'$like':'%'+_0x4df55d[_0xcd81('0x38')][_0xcd81('0x46')]+'%'};return _0x4130ac;}})});}_0x2ceef3=_[_0xcd81('0x43')]({},_0x2ceef3,_0x4df55d[_0xcd81('0x47')]);var _0x1665ca={'where':_0x2ceef3[_0xcd81('0x42')]};return db[_0xcd81('0x32')][_0xcd81('0x22')](_0x1665ca)['then'](function(_0x38b397){_0x52e295[_0xcd81('0x22')]=_0x38b397;if(_0x4df55d['query'][_0xcd81('0x48')]){_0x2ceef3[_0xcd81('0x49')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x2ceef3);})['then'](function(_0xd538b9){_0x52e295[_0xcd81('0x4a')]=_0xd538b9;return _0x52e295;})['then'](respondWithFilteredResult(_0x48a739,_0x2ceef3))['catch'](handleError(_0x48a739,null));};exports[_0xcd81('0x4b')]=function(_0x4626a5,_0x220bcc){var _0x593c24={'raw':!![],'where':{'id':_0x4626a5[_0xcd81('0x4c')]['id']}},_0x18e289={};_0x18e289[_0xcd81('0x36')]=_[_0xcd81('0x39')](db[_0xcd81('0x32')]['rawAttributes']);_0x18e289['query']=_[_0xcd81('0x39')](_0x4626a5['query']);_0x18e289[_0xcd81('0x3a')]=_[_0xcd81('0x3b')](_0x18e289[_0xcd81('0x36')],_0x18e289['query']);_0x593c24[_0xcd81('0x3c')]=_[_0xcd81('0x3b')](_0x18e289['model'],qs[_0xcd81('0x3d')](_0x4626a5[_0xcd81('0x38')][_0xcd81('0x3d')]));_0x593c24[_0xcd81('0x3c')]=_0x593c24[_0xcd81('0x3c')][_0xcd81('0x4d')]?_0x593c24[_0xcd81('0x3c')]:_0x18e289['model'];if(_0x4626a5[_0xcd81('0x38')]['includeAll']){_0x593c24[_0xcd81('0x49')]=[{'all':!![]}];}_0x593c24=_['merge']({},_0x593c24,_0x4626a5[_0xcd81('0x47')]);return db[_0xcd81('0x32')]['find'](_0x593c24)['then'](handleEntityNotFound(_0x220bcc,null))[_0xcd81('0x2a')](respondWithResult(_0x220bcc,null))[_0xcd81('0x4e')](handleError(_0x220bcc,null));};exports['create']=function(_0x4686d6,_0x7677a1){return db[_0xcd81('0x32')][_0xcd81('0x4f')](_0x4686d6[_0xcd81('0x50')],{})['then'](function(_0x30bd55){var _0x139fb0=_0x4686d6[_0xcd81('0x51')]['get']({'plain':!![]});if(!_0x139fb0)throw new Error(_0xcd81('0x52'));if(_0x139fb0[_0xcd81('0x53')]===_0xcd81('0x51')){var _0x300db9=_0x30bd55[_0xcd81('0x2b')]({'plain':!![]});var _0xcd9a77=_0xcd81('0x54');return db[_0xcd81('0x55')][_0xcd81('0x56')]({'where':{'name':_0xcd9a77,'userProfileId':_0x139fb0[_0xcd81('0x57')]},'raw':!![]})[_0xcd81('0x2a')](function(_0x142b35){if(_0x142b35&&_0x142b35['autoAssociation']===0x0){return db[_0xcd81('0x2c')]['create']({'name':_0x300db9['name'],'resourceId':_0x300db9['id'],'type':_0x142b35[_0xcd81('0x30')],'sectionId':_0x142b35['id']},{})[_0xcd81('0x2a')](function(){return _0x30bd55;});}else{return _0x30bd55;}})[_0xcd81('0x4e')](function(_0x3823ed){logger[_0xcd81('0x2e')](_0xcd81('0x58'),_0x3823ed);throw _0x3823ed;});}return _0x30bd55;})[_0xcd81('0x2a')](respondWithResult(_0x7677a1,0xc9))[_0xcd81('0x4e')](handleError(_0x7677a1,null));};exports[_0xcd81('0x28')]=function(_0x223bf5,_0x296753){if(_0x223bf5[_0xcd81('0x50')]['id']){delete _0x223bf5[_0xcd81('0x50')]['id'];}return db[_0xcd81('0x32')][_0xcd81('0x56')]({'where':{'id':_0x223bf5['params']['id']}})[_0xcd81('0x2a')](handleEntityNotFound(_0x296753,null))[_0xcd81('0x2a')](saveUpdates(_0x223bf5[_0xcd81('0x50')],null))[_0xcd81('0x2a')](respondWithResult(_0x296753,null))[_0xcd81('0x4e')](handleError(_0x296753,null));};exports[_0xcd81('0x29')]=function(_0x3356a8,_0x43d15d){return db[_0xcd81('0x32')]['find']({'where':{'id':_0x3356a8['params']['id']}})[_0xcd81('0x2a')](handleEntityNotFound(_0x43d15d,null))['then'](removeEntity(_0x43d15d,null))[_0xcd81('0x4e')](handleError(_0x43d15d,null));}; \ No newline at end of file +var _0xb2b5=['status','offset','undefined','limit','Content-Range','apply','reject','save','then','destroy','get','Pauses','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','count','includeAll','rows','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x49a1a0,_0x48f776){var _0x518a4f=function(_0x313633){while(--_0x313633){_0x49a1a0['push'](_0x49a1a0['shift']());}};_0x518a4f(++_0x48f776);}(_0xb2b5,0x119));var _0x5b2b=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xb2b5[_0x5f09c5];return _0x426ad9;};'use strict';var emlformat=require(_0x5b2b('0x0'));var rimraf=require(_0x5b2b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5b2b('0x2'));var rp=require(_0x5b2b('0x3'));var moment=require(_0x5b2b('0x4'));var BPromise=require(_0x5b2b('0x5'));var Mustache=require(_0x5b2b('0x6'));var util=require(_0x5b2b('0x7'));var path=require('path');var sox=require(_0x5b2b('0x8'));var csv=require(_0x5b2b('0x9'));var ejs=require(_0x5b2b('0xa'));var fs=require('fs');var fs_extra=require(_0x5b2b('0xb'));var _=require(_0x5b2b('0xc'));var squel=require(_0x5b2b('0xd'));var crypto=require('crypto');var jsforce=require(_0x5b2b('0xe'));var deskjs=require(_0x5b2b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5b2b('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b2b('0x11'));var logger=require(_0x5b2b('0x12'))('api');var utils=require(_0x5b2b('0x13'));var config=require(_0x5b2b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b2b('0x15'))['db'];function respondWithStatusCode(_0x54f421,_0x28fd27){_0x28fd27=_0x28fd27||0xcc;return function(_0x860996){if(_0x860996){return _0x54f421[_0x5b2b('0x16')](_0x28fd27);}return _0x54f421[_0x5b2b('0x17')](_0x28fd27)['end']();};}function respondWithResult(_0x1554ed,_0xb80f5f){_0xb80f5f=_0xb80f5f||0xc8;return function(_0x56b670){if(_0x56b670){return _0x1554ed['status'](_0xb80f5f)['json'](_0x56b670);}};}function respondWithFilteredResult(_0x2317d0,_0x48edcc){return function(_0x159087){if(_0x159087){var _0x3dc415=typeof _0x48edcc[_0x5b2b('0x18')]===_0x5b2b('0x19')&&typeof _0x48edcc[_0x5b2b('0x1a')]===_0x5b2b('0x19');var _0x5cf48d=_0x159087['count'];var _0x1f875d=_0x3dc415?0x0:_0x48edcc[_0x5b2b('0x18')];var _0x1cf52e=_0x3dc415?_0x159087['count']:_0x48edcc[_0x5b2b('0x18')]+_0x48edcc[_0x5b2b('0x1a')];var _0x5e7612;if(_0x1cf52e>=_0x5cf48d){_0x1cf52e=_0x5cf48d;_0x5e7612=0xc8;}else{_0x5e7612=0xce;}_0x2317d0[_0x5b2b('0x17')](_0x5e7612);return _0x2317d0['set'](_0x5b2b('0x1b'),_0x1f875d+'-'+_0x1cf52e+'/'+_0x5cf48d)['json'](_0x159087);}return null;};}function patchUpdates(_0x1502e1){return function(_0x578d19){try{jsonpatch[_0x5b2b('0x1c')](_0x578d19,_0x1502e1,!![]);}catch(_0x1f96ec){return BPromise[_0x5b2b('0x1d')](_0x1f96ec);}return _0x578d19[_0x5b2b('0x1e')]();};}function saveUpdates(_0x5c4dfb,_0x55269b){return function(_0x3c8944){if(_0x3c8944){return _0x3c8944['update'](_0x5c4dfb)[_0x5b2b('0x1f')](function(_0x4bff1e){return _0x4bff1e;});}return null;};}function removeEntity(_0xc680f4,_0xe74d4b){return function(_0x465d67){if(_0x465d67){return _0x465d67[_0x5b2b('0x20')]()['then'](function(){var _0x45c14b=_0x465d67[_0x5b2b('0x21')]({'plain':!![]});var _0x500925=_0x5b2b('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x500925,'resourceId':_0x45c14b['id']}})[_0x5b2b('0x1f')](function(){return _0x465d67;});})['then'](function(){_0xc680f4[_0x5b2b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54c00b,_0x4b2993){return function(_0x3afad7){if(!_0x3afad7){_0x54c00b[_0x5b2b('0x16')](0x194);}return _0x3afad7;};}function handleError(_0x206e3c,_0x55bfa0){_0x55bfa0=_0x55bfa0||0x1f4;return function(_0x56945b){logger[_0x5b2b('0x23')](_0x56945b[_0x5b2b('0x24')]);if(_0x56945b[_0x5b2b('0x25')]){delete _0x56945b[_0x5b2b('0x25')];}_0x206e3c[_0x5b2b('0x17')](_0x55bfa0)[_0x5b2b('0x26')](_0x56945b);};}exports[_0x5b2b('0x27')]=function(_0x1882a9,_0x37a597){var _0x545f6f={},_0x2d9cd8={},_0x4970d8={'count':0x0,'rows':[]};var _0x50715b=_[_0x5b2b('0x28')](db[_0x5b2b('0x29')][_0x5b2b('0x2a')],function(_0x33d392){return{'name':_0x33d392[_0x5b2b('0x2b')],'type':_0x33d392[_0x5b2b('0x2c')]['key']};});_0x2d9cd8[_0x5b2b('0x2d')]=_[_0x5b2b('0x28')](_0x50715b,'name');_0x2d9cd8['query']=_[_0x5b2b('0x2e')](_0x1882a9[_0x5b2b('0x2f')]);_0x2d9cd8[_0x5b2b('0x30')]=_[_0x5b2b('0x31')](_0x2d9cd8[_0x5b2b('0x2d')],_0x2d9cd8[_0x5b2b('0x2f')]);_0x545f6f['attributes']=_[_0x5b2b('0x31')](_0x2d9cd8['model'],qs[_0x5b2b('0x32')](_0x1882a9[_0x5b2b('0x2f')][_0x5b2b('0x32')]));_0x545f6f['attributes']=_0x545f6f['attributes'][_0x5b2b('0x33')]?_0x545f6f[_0x5b2b('0x34')]:_0x2d9cd8[_0x5b2b('0x2d')];if(!_0x1882a9[_0x5b2b('0x2f')][_0x5b2b('0x35')](_0x5b2b('0x36'))){_0x545f6f['limit']=qs[_0x5b2b('0x1a')](_0x1882a9[_0x5b2b('0x2f')][_0x5b2b('0x1a')]);_0x545f6f[_0x5b2b('0x18')]=qs[_0x5b2b('0x18')](_0x1882a9[_0x5b2b('0x2f')][_0x5b2b('0x18')]);}_0x545f6f['order']=qs[_0x5b2b('0x37')](_0x1882a9[_0x5b2b('0x2f')][_0x5b2b('0x37')]);_0x545f6f['where']=qs[_0x5b2b('0x30')](_['pick'](_0x1882a9[_0x5b2b('0x2f')],_0x2d9cd8[_0x5b2b('0x30')]),_0x50715b);if(_0x1882a9['query'][_0x5b2b('0x38')]){_0x545f6f[_0x5b2b('0x39')]=_[_0x5b2b('0x3a')](_0x545f6f['where'],{'$or':_['map'](_0x50715b,function(_0x2541ac){if(_0x2541ac[_0x5b2b('0x2c')]!==_0x5b2b('0x3b')){var _0xe111fa={};_0xe111fa[_0x2541ac[_0x5b2b('0x25')]]={'$like':'%'+_0x1882a9['query'][_0x5b2b('0x38')]+'%'};return _0xe111fa;}})});}_0x545f6f=_[_0x5b2b('0x3a')]({},_0x545f6f,_0x1882a9[_0x5b2b('0x3c')]);var _0x50a9f8={'where':_0x545f6f[_0x5b2b('0x39')]};return db['Pause'][_0x5b2b('0x3d')](_0x50a9f8)['then'](function(_0x1b464a){_0x4970d8['count']=_0x1b464a;if(_0x1882a9[_0x5b2b('0x2f')][_0x5b2b('0x3e')]){_0x545f6f['include']=[{'all':!![]}];}return db[_0x5b2b('0x29')]['findAll'](_0x545f6f);})['then'](function(_0x545955){_0x4970d8[_0x5b2b('0x3f')]=_0x545955;return _0x4970d8;})[_0x5b2b('0x1f')](respondWithFilteredResult(_0x37a597,_0x545f6f))['catch'](handleError(_0x37a597,null));};exports[_0x5b2b('0x40')]=function(_0x47b719,_0x3ae5fd){var _0x26692e={'raw':!![],'where':{'id':_0x47b719[_0x5b2b('0x41')]['id']}},_0x2fba92={};_0x2fba92['model']=_[_0x5b2b('0x2e')](db[_0x5b2b('0x29')][_0x5b2b('0x2a')]);_0x2fba92[_0x5b2b('0x2f')]=_['keys'](_0x47b719[_0x5b2b('0x2f')]);_0x2fba92[_0x5b2b('0x30')]=_[_0x5b2b('0x31')](_0x2fba92[_0x5b2b('0x2d')],_0x2fba92[_0x5b2b('0x2f')]);_0x26692e[_0x5b2b('0x34')]=_['intersection'](_0x2fba92[_0x5b2b('0x2d')],qs['fields'](_0x47b719[_0x5b2b('0x2f')][_0x5b2b('0x32')]));_0x26692e[_0x5b2b('0x34')]=_0x26692e[_0x5b2b('0x34')][_0x5b2b('0x33')]?_0x26692e['attributes']:_0x2fba92[_0x5b2b('0x2d')];if(_0x47b719[_0x5b2b('0x2f')][_0x5b2b('0x3e')]){_0x26692e['include']=[{'all':!![]}];}_0x26692e=_[_0x5b2b('0x3a')]({},_0x26692e,_0x47b719[_0x5b2b('0x3c')]);return db[_0x5b2b('0x29')][_0x5b2b('0x42')](_0x26692e)[_0x5b2b('0x1f')](handleEntityNotFound(_0x3ae5fd,null))['then'](respondWithResult(_0x3ae5fd,null))[_0x5b2b('0x43')](handleError(_0x3ae5fd,null));};exports[_0x5b2b('0x44')]=function(_0x2ef3b5,_0x47e29c){return db['Pause']['create'](_0x2ef3b5['body'],{})[_0x5b2b('0x1f')](function(_0x50daee){var _0x1effcc=_0x2ef3b5[_0x5b2b('0x45')][_0x5b2b('0x21')]({'plain':!![]});if(!_0x1effcc)throw new Error(_0x5b2b('0x46'));if(_0x1effcc[_0x5b2b('0x47')]==='user'){var _0x4698e7=_0x50daee[_0x5b2b('0x21')]({'plain':!![]});var _0x8672cb=_0x5b2b('0x22');return db[_0x5b2b('0x48')][_0x5b2b('0x42')]({'where':{'name':_0x8672cb,'userProfileId':_0x1effcc['userProfileId']},'raw':!![]})[_0x5b2b('0x1f')](function(_0x2eb2e5){if(_0x2eb2e5&&_0x2eb2e5['autoAssociation']===0x0){return db[_0x5b2b('0x49')][_0x5b2b('0x44')]({'name':_0x4698e7[_0x5b2b('0x25')],'resourceId':_0x4698e7['id'],'type':_0x2eb2e5['name'],'sectionId':_0x2eb2e5['id']},{})[_0x5b2b('0x1f')](function(){return _0x50daee;});}else{return _0x50daee;}})[_0x5b2b('0x43')](function(_0x44361e){logger[_0x5b2b('0x23')](_0x5b2b('0x4a'),_0x44361e);throw _0x44361e;});}return _0x50daee;})[_0x5b2b('0x1f')](respondWithResult(_0x47e29c,0xc9))['catch'](handleError(_0x47e29c,null));};exports['update']=function(_0x41f3aa,_0x56ca4e){if(_0x41f3aa[_0x5b2b('0x4b')]['id']){delete _0x41f3aa['body']['id'];}return db['Pause']['find']({'where':{'id':_0x41f3aa[_0x5b2b('0x41')]['id']}})[_0x5b2b('0x1f')](handleEntityNotFound(_0x56ca4e,null))[_0x5b2b('0x1f')](saveUpdates(_0x41f3aa[_0x5b2b('0x4b')],null))[_0x5b2b('0x1f')](respondWithResult(_0x56ca4e,null))['catch'](handleError(_0x56ca4e,null));};exports[_0x5b2b('0x20')]=function(_0x4ba363,_0x3445d3){return db['Pause'][_0x5b2b('0x42')]({'where':{'id':_0x4ba363[_0x5b2b('0x41')]['id']}})[_0x5b2b('0x1f')](handleEntityNotFound(_0x3445d3,null))[_0x5b2b('0x1f')](removeEntity(_0x3445d3,null))[_0x5b2b('0x43')](handleError(_0x3445d3,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 165b3c1..e9d26db 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['tools_pauses','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x4584f2,_0x3b51c7){var _0x355852=function(_0x547cf2){while(--_0x547cf2){_0x4584f2['push'](_0x4584f2['shift']());}};_0x355852(++_0x3b51c7);}(_0x326f,0xd1));var _0xf326=function(_0x154fae,_0x1417cf){_0x154fae=_0x154fae-0x0;var _0x156133=_0x326f[_0x154fae];return _0x156133;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index c9b261e..b9e3307 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x2c6a77,_0x72ce5){var _0x51fbc9=function(_0x3d5807){while(--_0x3d5807){_0x2c6a77['push'](_0x2c6a77['shift']());}};_0x51fbc9(++_0x72ce5);}(_0x7a54,0x106));var _0x47a5=function(_0x377fb6,_0x243e91){_0x377fb6=_0x377fb6-0x0;var _0x42857c=_0x7a54[_0x377fb6];return _0x42857c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x4b4273,_0x2bb788){var _0x30c659=function(_0xd96591){while(--_0xd96591){_0x4b4273['push'](_0x4b4273['shift']());}};_0x30c659(++_0x2bb788);}(_0x7a54,0x106));var _0x47a5=function(_0x322ac0,_0x41419d){_0x322ac0=_0x322ac0-0x0;var _0x5626f1=_0x7a54[_0x322ac0];return _0x5626f1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 6aac0d3..4b3197c 100644 --- a/server/api/plugin/index.js +++ b/server/api/plugin/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6737=['diskStorage','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','upload','webhookPost','put','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','isAuthenticated','index','/:id','show','get','download'];(function(_0x1cf19b,_0x2cf67e){var _0x2236b4=function(_0x20b3f8){while(--_0x20b3f8){_0x1cf19b['push'](_0x1cf19b['shift']());}};_0x2236b4(++_0x2cf67e);}(_0x6737,0xe2));var _0x7673=function(_0x78e7e6,_0x1b0e38){_0x78e7e6=_0x78e7e6-0x0;var _0x193d5d=_0x6737[_0x78e7e6];return _0x193d5d;};'use strict';var multer=require('multer');var util=require(_0x7673('0x0'));var path=require(_0x7673('0x1'));var timeout=require('connect-timeout');var express=require(_0x7673('0x2'));var router=express[_0x7673('0x3')]();var fs_extra=require(_0x7673('0x4'));var auth=require(_0x7673('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7673('0x6'));var controller=require(_0x7673('0x7'));router['get']('/',auth[_0x7673('0x8')](),controller[_0x7673('0x9')]);router['get']('/webhook',controller['webhookGet']);router['get'](_0x7673('0xa'),auth['isAuthenticated'](),controller[_0x7673('0xb')]);router[_0x7673('0xc')]('/:id/download',auth[_0x7673('0x8')](),controller[_0x7673('0xd')]);var upload=multer({'storage':multer[_0x7673('0xe')]({'destination':function(_0x4d40ce,_0x49fcb2,_0x3ca258){_0x3ca258(null,path['join'](config[_0x7673('0xf')],_0x7673('0x10')));},'filename':function(_0x38090f,_0x451c87,_0x41d6bd){_0x451c87[_0x7673('0x11')]=_0x451c87[_0x7673('0x11')][_0x7673('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x41d6bd(null,util[_0x7673('0x13')](_0x7673('0x14'),path['basename'](_0x451c87[_0x7673('0x11')],path[_0x7673('0x15')](_0x451c87[_0x7673('0x11')])),Date[_0x7673('0x16')](),path[_0x7673('0x15')](_0x451c87[_0x7673('0x11')])));}})});router[_0x7673('0x17')]('/',upload['single']('file'),controller[_0x7673('0x18')]);router[_0x7673('0x17')]('/webhook',controller[_0x7673('0x19')]);router[_0x7673('0x1a')]('/:id',auth[_0x7673('0x8')](),controller[_0x7673('0x1b')]);router[_0x7673('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x7673('0x1c')]);module[_0x7673('0x1d')]=router; \ No newline at end of file +var _0xd2ea=['./plugin.controller','get','isAuthenticated','/webhook','webhookGet','/:id','download','diskStorage','root','server/files/plugins','originalname','replace','extname','now','post','single','file','upload','webhookPost','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1f5e4a,_0x16111e){var _0x380da7=function(_0x49dbbb){while(--_0x49dbbb){_0x1f5e4a['push'](_0x1f5e4a['shift']());}};_0x380da7(++_0x16111e);}(_0xd2ea,0x15f));var _0xad2e=function(_0x1e3d15,_0x3b376c){_0x1e3d15=_0x1e3d15-0x0;var _0x2a7888=_0xd2ea[_0x1e3d15];return _0x2a7888;};'use strict';var multer=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var path=require(_0xad2e('0x2'));var timeout=require(_0xad2e('0x3'));var express=require(_0xad2e('0x4'));var router=express['Router']();var fs_extra=require(_0xad2e('0x5'));var auth=require(_0xad2e('0x6'));var interaction=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var controller=require(_0xad2e('0x9'));router[_0xad2e('0xa')]('/',auth[_0xad2e('0xb')](),controller['index']);router[_0xad2e('0xa')](_0xad2e('0xc'),controller[_0xad2e('0xd')]);router['get'](_0xad2e('0xe'),auth[_0xad2e('0xb')](),controller['show']);router[_0xad2e('0xa')]('/:id/download',auth[_0xad2e('0xb')](),controller[_0xad2e('0xf')]);var upload=multer({'storage':multer[_0xad2e('0x10')]({'destination':function(_0x24c5da,_0x489f25,_0x7df3c6){_0x7df3c6(null,path['join'](config[_0xad2e('0x11')],_0xad2e('0x12')));},'filename':function(_0x433696,_0x42e2f2,_0x59a342){_0x42e2f2[_0xad2e('0x13')]=_0x42e2f2['originalname'][_0xad2e('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59a342(null,util['format']('%s-%s%s',path['basename'](_0x42e2f2['originalname'],path[_0xad2e('0x15')](_0x42e2f2[_0xad2e('0x13')])),Date[_0xad2e('0x16')](),path[_0xad2e('0x15')](_0x42e2f2[_0xad2e('0x13')])));}})});router[_0xad2e('0x17')]('/',upload[_0xad2e('0x18')](_0xad2e('0x19')),controller[_0xad2e('0x1a')]);router[_0xad2e('0x17')](_0xad2e('0xc'),controller[_0xad2e('0x1b')]);router[_0xad2e('0x1c')](_0xad2e('0xe'),auth[_0xad2e('0xb')](),controller['update']);router[_0xad2e('0x1d')](_0xad2e('0xe'),auth['isAuthenticated'](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 3438510..b0dd04c 100644 --- a/server/api/plugin/plugin.attributes.js +++ b/server/api/plugin/plugin.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c1e=['always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','html','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly'];(function(_0x267d8d,_0xe90f65){var _0x11a98f=function(_0x5703c9){while(--_0x5703c9){_0x267d8d['push'](_0x267d8d['shift']());}};_0x11a98f(++_0xe90f65);}(_0x8c1e,0xde));var _0xe8c1=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x8c1e[_0x5627e1];return _0x2f013f;};'use strict';var Sequelize=require(_0xe8c1('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xe8c1('0x1'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xe8c1('0x2')]},'path':{'type':Sequelize[_0xe8c1('0x3')],'comment':_0xe8c1('0x4')},'active':{'type':Sequelize[_0xe8c1('0x5')],'defaultValue':0x0,'comment':_0xe8c1('0x6')},'sidebar':{'type':Sequelize['ENUM'](_0xe8c1('0x7'),_0xe8c1('0x8'),_0xe8c1('0x9'),'never'),'defaultValue':_0xe8c1('0x9'),'comment':_0xe8c1('0xa')},'icon':{'type':Sequelize[_0xe8c1('0x3')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xe8c1('0x3')]},'scriptName':{'type':Sequelize[_0xe8c1('0x3')]},'scriptPath':{'type':Sequelize[_0xe8c1('0x3')]}}; \ No newline at end of file +var _0x8f05=['html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8f05,0x1cb));var _0x58f0=function(_0x2ac723,_0x28ce70){_0x2ac723=_0x2ac723-0x0;var _0x3a8802=_0x8f05[_0x2ac723];return _0x3a8802;};'use strict';var Sequelize=require(_0x58f0('0x0'));module[_0x58f0('0x1')]={'name':{'type':Sequelize[_0x58f0('0x2')]},'type':{'type':Sequelize['ENUM'](_0x58f0('0x3'),'script')},'description':{'type':Sequelize[_0x58f0('0x4')]},'version':{'type':Sequelize[_0x58f0('0x4')]},'path':{'type':Sequelize['STRING'],'comment':_0x58f0('0x5')},'active':{'type':Sequelize[_0x58f0('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0x58f0('0x7'),_0x58f0('0x8'),_0x58f0('0x9')),'defaultValue':'always','comment':_0x58f0('0xa')},'icon':{'type':Sequelize[_0x58f0('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x58f0('0x2')]},'scriptPath':{'type':Sequelize[_0x58f0('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 6617148..f674960 100644 --- a/server/api/plugin/plugin.controller.js +++ b/server/api/plugin/plugin.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5e2=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','Plugins','error','stack','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','include','findAll','rows','show','params','includeAll','options','catch','download','find','join','root','%s.zip','basename','createWriteStream','zip','code','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','close','format','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','user','UserProfileSection','userProfileId','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','zip-dir','request-promise','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','extract-zip','rimraf','archiver','../../components/auth/service'];(function(_0x4dd9ca,_0x53b8d8){var _0x5ed4b8=function(_0x182ae1){while(--_0x182ae1){_0x4dd9ca['push'](_0x4dd9ca['shift']());}};_0x5ed4b8(++_0x53b8d8);}(_0xe5e2,0x144));var _0x2e5e=function(_0x52b6f8,_0x56fabe){_0x52b6f8=_0x52b6f8-0x0;var _0x5d6a12=_0xe5e2[_0x52b6f8];return _0x5d6a12;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2e5e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2e5e('0x1'));var moment=require('moment');var BPromise=require(_0x2e5e('0x2'));var Mustache=require('mustache');var util=require(_0x2e5e('0x3'));var path=require(_0x2e5e('0x4'));var sox=require(_0x2e5e('0x5'));var csv=require('to-csv');var ejs=require(_0x2e5e('0x6'));var fs=require('fs');var fs_extra=require(_0x2e5e('0x7'));var _=require('lodash');var squel=require(_0x2e5e('0x8'));var crypto=require(_0x2e5e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x2e5e('0xa'));var toCsv=require(_0x2e5e('0xb'));var querystring=require(_0x2e5e('0xc'));var Papa=require(_0x2e5e('0xd'));var extract=require(_0x2e5e('0xe'));var rimraf=require(_0x2e5e('0xf'));var archiver=require(_0x2e5e('0x10'));var Redis=require('ioredis');var authService=require(_0x2e5e('0x11'));var qs=require(_0x2e5e('0x12'));var as=require(_0x2e5e('0x13'));var hardwareService=require(_0x2e5e('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x2e5e('0x15'));var config=require(_0x2e5e('0x16'));var licenseUtil=require(_0x2e5e('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2e5e('0x18')](config[_0x2e5e('0x19')],{'host':_0x2e5e('0x1a'),'port':0x18eb});var socket=require(_0x2e5e('0x1b'))(new Redis(config[_0x2e5e('0x19')]));require(_0x2e5e('0x1c'))[_0x2e5e('0x1d')](socket);function respondWithStatusCode(_0x50c1be,_0x4231f5){_0x4231f5=_0x4231f5||0xcc;return function(_0x50efcc){if(_0x50efcc){return _0x50c1be[_0x2e5e('0x1e')](_0x4231f5);}return _0x50c1be['status'](_0x4231f5)[_0x2e5e('0x1f')]();};}function respondWithResult(_0x4512dc,_0x209c56){_0x209c56=_0x209c56||0xc8;return function(_0x13a6e4){if(_0x13a6e4){return _0x4512dc[_0x2e5e('0x20')](_0x209c56)[_0x2e5e('0x21')](_0x13a6e4);}};}function respondWithFilteredResult(_0x4d15c0,_0x3029c9){return function(_0x39b731){if(_0x39b731){var _0xe75ac3=typeof _0x3029c9['offset']===_0x2e5e('0x22')&&typeof _0x3029c9[_0x2e5e('0x23')]===_0x2e5e('0x22');var _0x235070=_0x39b731[_0x2e5e('0x24')];var _0x5869a4=_0xe75ac3?0x0:_0x3029c9[_0x2e5e('0x25')];var _0x586ab1=_0xe75ac3?_0x39b731[_0x2e5e('0x24')]:_0x3029c9['offset']+_0x3029c9[_0x2e5e('0x23')];var _0x1dcb7d;if(_0x586ab1>=_0x235070){_0x586ab1=_0x235070;_0x1dcb7d=0xc8;}else{_0x1dcb7d=0xce;}_0x4d15c0[_0x2e5e('0x20')](_0x1dcb7d);return _0x4d15c0[_0x2e5e('0x26')]('Content-Range',_0x5869a4+'-'+_0x586ab1+'/'+_0x235070)[_0x2e5e('0x21')](_0x39b731);}return null;};}function patchUpdates(_0x3515be){return function(_0x344c81){try{jsonpatch[_0x2e5e('0x27')](_0x344c81,_0x3515be,!![]);}catch(_0x1efb69){return BPromise[_0x2e5e('0x28')](_0x1efb69);}return _0x344c81[_0x2e5e('0x29')]();};}function saveUpdates(_0xdac78,_0x5b5cd7){return function(_0x18fb13){if(_0x18fb13){return _0x18fb13[_0x2e5e('0x2a')](_0xdac78)[_0x2e5e('0x2b')](function(_0x40bd1f){return _0x40bd1f;});}return null;};}function removeEntity(_0x56383a,_0xcdc2e){return function(_0x350c0f){if(_0x350c0f){return _0x350c0f[_0x2e5e('0x2c')]()[_0x2e5e('0x2b')](function(){var _0x195efe=_0x350c0f[_0x2e5e('0x2d')]({'plain':!![]});var _0x43bce3=_0x2e5e('0x2e');return db['UserProfileResource'][_0x2e5e('0x2c')]({'where':{'type':_0x43bce3,'resourceId':_0x195efe['id']}})['then'](function(){return _0x350c0f;});})[_0x2e5e('0x2b')](function(){_0x56383a[_0x2e5e('0x20')](0xcc)[_0x2e5e('0x1f')]();});}};}function handleEntityNotFound(_0x21d01b,_0x1690b6){return function(_0x52cdb2){if(!_0x52cdb2){_0x21d01b[_0x2e5e('0x1e')](0x194);}return _0x52cdb2;};}function handleError(_0x557091,_0x5e3e1e){_0x5e3e1e=_0x5e3e1e||0x1f4;return function(_0x147bcb){logger[_0x2e5e('0x2f')](_0x147bcb[_0x2e5e('0x30')]);if(_0x147bcb['name']){delete _0x147bcb['name'];}_0x557091[_0x2e5e('0x20')](_0x5e3e1e)[_0x2e5e('0x31')](_0x147bcb);};}exports[_0x2e5e('0x32')]=function(_0x14fa81,_0x139e13){var _0x2c8a9c={},_0x7c898={},_0x17bf75={'count':0x0,'rows':[]};var _0x2c472e=_[_0x2e5e('0x33')](db[_0x2e5e('0x34')][_0x2e5e('0x35')],function(_0x5ab5cd){return{'name':_0x5ab5cd[_0x2e5e('0x36')],'type':_0x5ab5cd[_0x2e5e('0x37')][_0x2e5e('0x38')]};});_0x7c898[_0x2e5e('0x39')]=_[_0x2e5e('0x33')](_0x2c472e,_0x2e5e('0x3a'));_0x7c898[_0x2e5e('0x3b')]=_[_0x2e5e('0x3c')](_0x14fa81['query']);_0x7c898['filters']=_['intersection'](_0x7c898['model'],_0x7c898[_0x2e5e('0x3b')]);_0x2c8a9c[_0x2e5e('0x3d')]=_[_0x2e5e('0x3e')](_0x7c898[_0x2e5e('0x39')],qs[_0x2e5e('0x3f')](_0x14fa81[_0x2e5e('0x3b')]['fields']));_0x2c8a9c[_0x2e5e('0x3d')]=_0x2c8a9c[_0x2e5e('0x3d')][_0x2e5e('0x40')]?_0x2c8a9c[_0x2e5e('0x3d')]:_0x7c898[_0x2e5e('0x39')];if(!_0x14fa81['query'][_0x2e5e('0x41')]('nolimit')){_0x2c8a9c[_0x2e5e('0x23')]=qs[_0x2e5e('0x23')](_0x14fa81[_0x2e5e('0x3b')][_0x2e5e('0x23')]);_0x2c8a9c[_0x2e5e('0x25')]=qs[_0x2e5e('0x25')](_0x14fa81[_0x2e5e('0x3b')][_0x2e5e('0x25')]);}_0x2c8a9c[_0x2e5e('0x42')]=qs[_0x2e5e('0x43')](_0x14fa81[_0x2e5e('0x3b')][_0x2e5e('0x43')]);_0x2c8a9c[_0x2e5e('0x44')]=qs[_0x2e5e('0x45')](_[_0x2e5e('0x46')](_0x14fa81[_0x2e5e('0x3b')],_0x7c898[_0x2e5e('0x45')]),_0x2c472e);if(_0x14fa81['query'][_0x2e5e('0x47')]){_0x2c8a9c['where']=_['merge'](_0x2c8a9c[_0x2e5e('0x44')],{'$or':_[_0x2e5e('0x33')](_0x2c472e,function(_0x425a31){if(_0x425a31[_0x2e5e('0x37')]!==_0x2e5e('0x48')){var _0x3a9a6b={};_0x3a9a6b[_0x425a31[_0x2e5e('0x3a')]]={'$like':'%'+_0x14fa81[_0x2e5e('0x3b')][_0x2e5e('0x47')]+'%'};return _0x3a9a6b;}})});}_0x2c8a9c=_[_0x2e5e('0x49')]({},_0x2c8a9c,_0x14fa81['options']);var _0x168c5a={'where':_0x2c8a9c['where']};return db[_0x2e5e('0x34')][_0x2e5e('0x24')](_0x168c5a)[_0x2e5e('0x2b')](function(_0x386b06){_0x17bf75[_0x2e5e('0x24')]=_0x386b06;if(_0x14fa81[_0x2e5e('0x3b')]['includeAll']){_0x2c8a9c[_0x2e5e('0x4a')]=[{'all':!![]}];}return db[_0x2e5e('0x34')][_0x2e5e('0x4b')](_0x2c8a9c);})[_0x2e5e('0x2b')](function(_0x403b0c){_0x17bf75[_0x2e5e('0x4c')]=_0x403b0c;return _0x17bf75;})[_0x2e5e('0x2b')](respondWithFilteredResult(_0x139e13,_0x2c8a9c))['catch'](handleError(_0x139e13,null));};exports[_0x2e5e('0x4d')]=function(_0x413927,_0x996a48){var _0xf82975={'raw':!![],'where':{'id':_0x413927[_0x2e5e('0x4e')]['id']}},_0x24c3b7={};_0x24c3b7['model']=_[_0x2e5e('0x3c')](db[_0x2e5e('0x34')][_0x2e5e('0x35')]);_0x24c3b7['query']=_[_0x2e5e('0x3c')](_0x413927[_0x2e5e('0x3b')]);_0x24c3b7[_0x2e5e('0x45')]=_['intersection'](_0x24c3b7[_0x2e5e('0x39')],_0x24c3b7[_0x2e5e('0x3b')]);_0xf82975[_0x2e5e('0x3d')]=_['intersection'](_0x24c3b7[_0x2e5e('0x39')],qs[_0x2e5e('0x3f')](_0x413927[_0x2e5e('0x3b')][_0x2e5e('0x3f')]));_0xf82975[_0x2e5e('0x3d')]=_0xf82975[_0x2e5e('0x3d')][_0x2e5e('0x40')]?_0xf82975[_0x2e5e('0x3d')]:_0x24c3b7[_0x2e5e('0x39')];if(_0x413927[_0x2e5e('0x3b')][_0x2e5e('0x4f')]){_0xf82975['include']=[{'all':!![]}];}_0xf82975=_['merge']({},_0xf82975,_0x413927[_0x2e5e('0x50')]);return db[_0x2e5e('0x34')]['find'](_0xf82975)[_0x2e5e('0x2b')](handleEntityNotFound(_0x996a48,null))[_0x2e5e('0x2b')](respondWithResult(_0x996a48,null))[_0x2e5e('0x51')](handleError(_0x996a48,null));};exports[_0x2e5e('0x52')]=function(_0x8d6432,_0x272ee3,_0x448aa6){return db['Plugin'][_0x2e5e('0x53')]({'where':{'id':_0x8d6432[_0x2e5e('0x4e')]['id']},'attributes':['name','path'],'raw':!![]})['then'](handleEntityNotFound(_0x272ee3,null))[_0x2e5e('0x2b')](function(_0x2148c3){if(_0x2148c3){var _0x180ca7=path[_0x2e5e('0x54')](config[_0x2e5e('0x55')],'server/files/plugins',util['format'](_0x2e5e('0x56'),path[_0x2e5e('0x57')](_0x2148c3[_0x2e5e('0x4')])));var _0x177321=fs[_0x2e5e('0x58')](_0x180ca7);var _0x5be21d=archiver(_0x2e5e('0x59'),{'zlib':{'level':0x9}});_0x5be21d['on']('warning',function(_0x4d8a32){if(_0x4d8a32[_0x2e5e('0x5a')]===_0x2e5e('0x5b')){logger[_0x2e5e('0x2f')](_0x4d8a32);}else{throw new db['Sequelize'][(_0x2e5e('0x5c'))](_0x2e5e('0x5d'));}});_0x5be21d['on']('error',function(_0xd33d6e){throw new db[(_0x2e5e('0x5e'))]['Error'](_0x2e5e('0x5d'));});_0x5be21d[_0x2e5e('0x5f')](_0x177321);_0x5be21d[_0x2e5e('0x60')](_0x2e5e('0x61'),{'cwd':path[_0x2e5e('0x54')](config[_0x2e5e('0x55')],_0x2e5e('0x62'),path[_0x2e5e('0x63')](_0x2148c3['path'])),'ignore':[path[_0x2e5e('0x54')](path[_0x2e5e('0x57')](_0x2148c3[_0x2e5e('0x4')]),_0x2e5e('0x64')),path[_0x2e5e('0x54')](path[_0x2e5e('0x57')](_0x2148c3[_0x2e5e('0x4')]),_0x2e5e('0x65'))],'nodir':!![]})['finalize']();_0x177321['on'](_0x2e5e('0x66'),function(){if(!fs['existsSync'](_0x180ca7)){throw new db[(_0x2e5e('0x5e'))]['Error']('Plugin\x20not\x20found');}return _0x272ee3[_0x2e5e('0x52')](_0x180ca7,util[_0x2e5e('0x67')](_0x2e5e('0x56'),path[_0x2e5e('0x57')](_0x2148c3[_0x2e5e('0x4')])),function(_0x3c8354){if(_0x3c8354){throw new db[(_0x2e5e('0x5e'))]['Error'](_0x2e5e('0x68'));}fs['unlinkSync'](_0x180ca7);logger[_0x2e5e('0x69')](_0x2e5e('0x6a'));logger[_0x2e5e('0x69')]('Temporary\x20file\x20removed');});});}return null;})[_0x2e5e('0x51')](handleError(_0x272ee3,null));};exports[_0x2e5e('0x6b')]=function(_0x9637d5,_0x2bcca2,_0x17690d){var _0x682688=path[_0x2e5e('0x57')](_0x9637d5[_0x2e5e('0x6c')][_0x2e5e('0x6d')],path[_0x2e5e('0x6e')](_0x9637d5[_0x2e5e('0x6c')][_0x2e5e('0x6d')]));var _0x1b4642=path[_0x2e5e('0x54')](config[_0x2e5e('0x55')],_0x2e5e('0x62'),_0x9637d5[_0x2e5e('0x6c')]['filename']);var _0x1827bf=path['join'](config[_0x2e5e('0x55')],_0x2e5e('0x62'),_0x682688);logger[_0x2e5e('0x69')]('Plugin\x20upload\x20filepath:\x20%s',_0x1b4642);logger['info'](_0x2e5e('0x6f'),_0x1827bf);try{fs['chmodSync'](_0x1b4642,parseInt('0777',0x8));extract(_0x1b4642,{'dir':_0x1827bf},function(_0x380894){if(_0x380894){logger[_0x2e5e('0x2f')](_0x380894);handleError(_0x380894,!![]);};var _0x4dc439=fs[_0x2e5e('0x70')](_0x1827bf);if(_0x4dc439['length']>0x1){removeReferences(_0x1b4642,_0x1827bf);logger[_0x2e5e('0x2f')](_0x2e5e('0x71'));return _0x17690d(new Error(_0x2e5e('0x71')));}var _0x44b901=fs[_0x2e5e('0x72')](path['join'](_0x1827bf,_0x4dc439[0x0]));if(_0x44b901['isFile']()){removeReferences(_0x1b4642,_0x1827bf);logger[_0x2e5e('0x2f')](_0x2e5e('0x71'));return _0x17690d(new Error(_0x2e5e('0x71')));}if(_0x44b901[_0x2e5e('0x73')]()){var _0x1827e3=fs[_0x2e5e('0x70')](path[_0x2e5e('0x54')](_0x1827bf,_0x4dc439[0x0]));if(_0x1827e3['length']===0x0){removeReferences(_0x1b4642,_0x1827bf);logger[_0x2e5e('0x2f')](_0x2e5e('0x71'));return _0x17690d(new Error(_0x2e5e('0x71')));}var _0x1b8ee8=_0x1827e3[_0x2e5e('0x74')](function(_0x3b5458){return _0x3b5458===_0x2e5e('0x75');});if(!_0x1b8ee8){return _0x17690d(new Error(_0x2e5e('0x76')));}var _0x4df30=fs[_0x2e5e('0x77')](path[_0x2e5e('0x54')](_0x1827bf,_0x4dc439[0x0],_0x2e5e('0x75')));var _0x5a174d=JSON[_0x2e5e('0x78')](_0x4df30);if(_0x2e5e('0x22')==typeof _0x5a174d['name']){return _0x17690d(new Error(_0x2e5e('0x79')));}if(_0x2e5e('0x22')==typeof _0x5a174d['type']){return _0x17690d(new Error(_0x2e5e('0x7a')));}if('undefined'==typeof _0x5a174d[_0x2e5e('0x7b')]){return _0x17690d(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x2e5e('0x22')==typeof _0x5a174d[_0x2e5e('0x7c')]){return _0x17690d(new Error(_0x2e5e('0x7d')));}if(_0x5a174d[_0x2e5e('0x37')]===_0x2e5e('0x7e')){if(_0x2e5e('0x22')==typeof _0x5a174d[_0x2e5e('0x7c')][_0x2e5e('0x7f')]){return _0x17690d(new Error(_0x2e5e('0x80')));}if(_0x2e5e('0x22')==typeof _0x5a174d[_0x2e5e('0x7c')][_0x2e5e('0x7f')][_0x2e5e('0x81')]&&_0x2e5e('0x22')==typeof _0x5a174d[_0x2e5e('0x7c')][_0x2e5e('0x7f')][_0x2e5e('0x82')]){return _0x17690d(new Error(_0x2e5e('0x83')));}}else if(_0x5a174d[_0x2e5e('0x37')]===_0x2e5e('0x84')){if(_0x2e5e('0x22')==typeof _0x5a174d['parameters'][_0x2e5e('0x85')]){return _0x17690d(new Error(_0x2e5e('0x86')));}if(_0x2e5e('0x22')==typeof _0x5a174d['parameters'][_0x2e5e('0x87')]){return _0x17690d(new Error(_0x2e5e('0x88')));}}else{return _0x17690d(new Error(_0x2e5e('0x89')));}var _0x1a3e3e=_0x5a174d['name'];var _0x3a5a6e=_0x5a174d[_0x2e5e('0x8a')];var _0xdfb07=_0x5a174d[_0x2e5e('0x37')];var _0x5247fd=_0x5a174d[_0x2e5e('0x8b')]?_0x5a174d['sidebar']:'always';var _0xa8e386=_0x5a174d[_0x2e5e('0x8c')]?_0x5a174d[_0x2e5e('0x8c')]:_0x2e5e('0x8d');var _0x35936b='';var _0x38b23e='';var _0x2cef37='';var _0x34003e='';var _0x2e8d8f=_0x5a174d[_0x2e5e('0x7b')];if(_0xdfb07===_0x2e5e('0x7e')){if(_0x2e5e('0x22')!=typeof _0x5a174d[_0x2e5e('0x7c')][_0x2e5e('0x7f')][_0x2e5e('0x81')]){var _0x271209=_0x5a174d[_0x2e5e('0x7c')]['views'][_0x2e5e('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x2e5e('0x8e')](_0x271209)){_0x35936b=path[_0x2e5e('0x54')](_0x2e5e('0x8f'),_0x682688,_0x4dc439[0x0],_0x271209);}else{_0x35936b=_0x271209;}}else{logger[_0x2e5e('0x69')](_0x2e5e('0x90'));}if(_0x2e5e('0x22')!=typeof _0x5a174d[_0x2e5e('0x7c')]['views'][_0x2e5e('0x82')]){var _0x2c9c5e=_0x5a174d[_0x2e5e('0x7c')]['views'][_0x2e5e('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x2e5e('0x8e')](_0x2c9c5e)){_0x38b23e=path[_0x2e5e('0x54')](_0x2e5e('0x8f'),_0x682688,_0x4dc439[0x0],_0x2c9c5e);}else{_0x38b23e=_0x2c9c5e;}}else{logger[_0x2e5e('0x69')](_0x2e5e('0x91'));}}else if(_0xdfb07===_0x2e5e('0x84')){_0x2cef37=_0x5a174d[_0x2e5e('0x7c')][_0x2e5e('0x85')];_0x34003e=_0x5a174d[_0x2e5e('0x7c')][_0x2e5e('0x87')];if(_0x2e5e('0x22')!=typeof _0x5a174d[_0x2e5e('0x7c')]['views']){if(_0x2e5e('0x22')!=typeof _0x5a174d[_0x2e5e('0x7c')][_0x2e5e('0x7f')][_0x2e5e('0x81')]){var _0x271209=_0x5a174d['parameters'][_0x2e5e('0x7f')][_0x2e5e('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x2e5e('0x8e')](_0x271209)){_0x35936b=path[_0x2e5e('0x54')](_0x2e5e('0x8f'),_0x682688,_0x4dc439[0x0],_0x271209);}else{_0x35936b=_0x271209;}}if(_0x2e5e('0x22')!=typeof _0x5a174d['parameters'][_0x2e5e('0x7f')][_0x2e5e('0x82')]){var _0x2c9c5e=_0x5a174d[_0x2e5e('0x7c')][_0x2e5e('0x7f')][_0x2e5e('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x2e5e('0x8e')](_0x2c9c5e)){_0x38b23e=path['join']('plugins',_0x682688,_0x4dc439[0x0],_0x2c9c5e);}else{_0x38b23e=_0x2c9c5e;}}}}var _0x54c48c={'name':_0x1a3e3e,'description':_0x3a5a6e,'path':path['join'](_0x682688,_0x4dc439[0x0]),'type':_0xdfb07,'sidebar':_0x5247fd,'icon':_0xa8e386,'adminUrl':_0x35936b,'agentUrl':_0x38b23e,'scriptName':_0x2cef37,'scriptPath':_0x34003e,'version':_0x2e8d8f};removeReferences(_0x1b4642,null);return db[_0x2e5e('0x34')][_0x2e5e('0x92')](_0x54c48c)[_0x2e5e('0x2b')](function(_0xa1aa2b){var _0xbc332e={'role':_0x9637d5[_0x2e5e('0x93')]['role'],'userProfileId':_0x9637d5['body']['userProfileId']};if(!_0xbc332e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbc332e[_0x2e5e('0x94')]===_0x2e5e('0x95')){var _0x5ca5dd=_0xa1aa2b[_0x2e5e('0x2d')]({'plain':!![]});return db[_0x2e5e('0x96')][_0x2e5e('0x53')]({'where':{'name':_0x2e5e('0x2e'),'userProfileId':_0xbc332e[_0x2e5e('0x97')]},'raw':!![]})[_0x2e5e('0x2b')](function(_0x4e0dd8){if(_0x4e0dd8&&_0x4e0dd8['autoAssociation']===0x0){return db['UserProfileResource'][_0x2e5e('0x92')]({'name':_0x5ca5dd[_0x2e5e('0x3a')],'resourceId':_0x5ca5dd['id'],'type':_0x4e0dd8[_0x2e5e('0x3a')],'sectionId':_0x4e0dd8['id']},{})['then'](function(){return _0xa1aa2b;});}else{return _0xa1aa2b;}})[_0x2e5e('0x51')](function(_0x75808e){logger[_0x2e5e('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x75808e);throw _0x75808e;});}return _0xa1aa2b;})['then'](respondWithResult(_0x2bcca2,null))[_0x2e5e('0x51')](handleError(_0x2bcca2,null));}});}catch(_0x246120){_0x2bcca2['status'](0x1f4)[_0x2e5e('0x31')](_0x246120);}};function removeReferences(_0x845a06,_0x5ca7ac){try{if(_0x845a06){fs[_0x2e5e('0x98')](_0x845a06);logger[_0x2e5e('0x69')](_0x2e5e('0x99'));}if(_0x5ca7ac){rimraf(_0x5ca7ac,function(){});logger[_0x2e5e('0x69')](_0x2e5e('0x9a'));}}catch(_0x13e803){logger[_0x2e5e('0x2f')](_0x13e803);}}exports[_0x2e5e('0x2a')]=function(_0x1f5c23,_0x51cc36,_0x231eb6){return db['Plugin'][_0x2e5e('0x53')]({'where':{'id':_0x1f5c23['params']['id']}})[_0x2e5e('0x2b')](handleEntityNotFound(_0x51cc36,null))[_0x2e5e('0x2b')](saveUpdates(_0x1f5c23[_0x2e5e('0x93')],null))[_0x2e5e('0x2b')](respondWithResult(_0x51cc36,null))[_0x2e5e('0x51')](handleError(_0x51cc36,null));};exports[_0x2e5e('0x9b')]=function(_0x1c289b,_0x12c536,_0x3634b1){return db[_0x2e5e('0x34')][_0x2e5e('0x53')]({'where':{'id':_0x1c289b[_0x2e5e('0x4e')]['id']}})[_0x2e5e('0x2b')](function(_0x4150ae){if(_0x4150ae){return _0x4150ae[_0x2e5e('0x2c')]();}})[_0x2e5e('0x2b')](function(_0x2fd056){rimraf(path['join'](config['root'],_0x2e5e('0x62'),path[_0x2e5e('0x63')](_0x2fd056['path'])),function(){});return _0x2fd056;})[_0x2e5e('0x2b')](handleEntityNotFound(_0x12c536,null))['then'](respondWithStatusCode(_0x12c536,null))[_0x2e5e('0x51')](handleError(_0x12c536,null));};exports['webhookGet']=function(_0x410d0b,_0x49cd0d,_0x13902f){return BPromise[_0x2e5e('0x9c')]()[_0x2e5e('0x2b')](function(){if(!_0x410d0b['query'][_0x2e5e('0x4')]){throw new Error(_0x2e5e('0x9d'));}if(!_0x410d0b[_0x2e5e('0x3b')][_0x2e5e('0x9e')]){throw new Error(_0x2e5e('0x9f'));}var _0x4d23ab=_0x410d0b[_0x2e5e('0x3b')][_0x2e5e('0xa0')]?_0x410d0b[_0x2e5e('0x3b')][_0x2e5e('0xa0')]+':'+_0x410d0b[_0x2e5e('0x3b')]['port']:_0x2e5e('0xa1')+_0x410d0b['query'][_0x2e5e('0x9e')];var _0x15ed32=_0x410d0b[_0x2e5e('0x3b')][_0x2e5e('0x21')]?_0x410d0b[_0x2e5e('0x3b')][_0x2e5e('0x21')]:!![];var _0x23f5ed=_0x410d0b['query'][_0x2e5e('0xa2')]?_0x410d0b[_0x2e5e('0x3b')]['encoding']:null;var _0x261db1={'method':_0x410d0b[_0x2e5e('0xa3')],'uri':util[_0x2e5e('0x67')](_0x2e5e('0xa4'),_0x4d23ab,_0x410d0b[_0x2e5e('0x3b')][_0x2e5e('0x4')]),'json':_0x15ed32,'resolveWithFullResponse':!![],'encoding':_0x23f5ed,'qs':_0x410d0b[_0x2e5e('0x3b')]};if(_0x410d0b[_0x2e5e('0xa5')]){_0x261db1[_0x2e5e('0xa5')]=_0x410d0b[_0x2e5e('0xa5')];if(_0x261db1[_0x2e5e('0xa5')]['content-length']){delete _0x261db1[_0x2e5e('0xa5')][_0x2e5e('0xa6')];}}if(_0x261db1[_0x2e5e('0xa5')][_0x2e5e('0xa7')]){delete _0x261db1[_0x2e5e('0xa5')][_0x2e5e('0xa7')];}return rp(_0x261db1);})[_0x2e5e('0x2b')](function(_0x273c49){if(_0x273c49){_0x49cd0d[_0x2e5e('0x26')](_0x273c49[_0x2e5e('0xa5')]);logger[_0x2e5e('0x69')](_0x273c49['body']);if(_[_0x2e5e('0xa8')](_0x410d0b[_0x2e5e('0x3b')][_0x2e5e('0x4')],_0x2e5e('0x52'))&&_0x273c49[_0x2e5e('0xa9')]==0x1f4){return _0x49cd0d['sendStatus'](_0x273c49[_0x2e5e('0xa9')]);}else{return _0x49cd0d[_0x2e5e('0x20')](_0x273c49[_0x2e5e('0xa9')])[_0x2e5e('0x31')](_0x273c49[_0x2e5e('0x93')]);}}else{return _0x49cd0d[_0x2e5e('0x1e')](0xc8);}})[_0x2e5e('0x51')](handleError(_0x49cd0d,null));};exports[_0x2e5e('0xaa')]=function(_0x43bfcf,_0x1248bc,_0x140e16){return BPromise['resolve']()['then'](function(){if(!_0x43bfcf['query'][_0x2e5e('0x4')]){throw new Error(_0x2e5e('0x9d'));}if(!_0x43bfcf[_0x2e5e('0x3b')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x1f72a8=_0x43bfcf[_0x2e5e('0x3b')]['hostname']?_0x43bfcf[_0x2e5e('0x3b')]['hostname']+':'+_0x43bfcf[_0x2e5e('0x3b')][_0x2e5e('0x9e')]:_0x2e5e('0xa1')+_0x43bfcf[_0x2e5e('0x3b')][_0x2e5e('0x9e')];var _0xd4b789=_0x43bfcf['query'][_0x2e5e('0x21')]?_0x43bfcf['query']['json']:!![];var _0x14fe73=_0x43bfcf[_0x2e5e('0x3b')][_0x2e5e('0xa2')]?_0x43bfcf[_0x2e5e('0x3b')][_0x2e5e('0xa2')]:null;var _0x4c05cf={'method':_0x43bfcf[_0x2e5e('0xa3')],'uri':util['format'](_0x2e5e('0xa4'),_0x1f72a8,_0x43bfcf['query']['path']),'json':_0xd4b789,'resolveWithFullResponse':!![],'encoding':_0x14fe73,'body':_0x43bfcf[_0x2e5e('0x93')]};if(_0x43bfcf['headers']){_0x4c05cf[_0x2e5e('0xa5')]=_0x43bfcf['headers'];if(_0x4c05cf[_0x2e5e('0xa5')]['content-length']){delete _0x4c05cf[_0x2e5e('0xa5')][_0x2e5e('0xa6')];}}if(_0x4c05cf[_0x2e5e('0xa5')][_0x2e5e('0xa7')]){delete _0x4c05cf[_0x2e5e('0xa5')][_0x2e5e('0xa7')];}return rp(_0x4c05cf);})['then'](function(_0x52abca){if(_0x52abca){_0x1248bc[_0x2e5e('0x26')](_0x52abca[_0x2e5e('0xa5')]);logger[_0x2e5e('0x69')](_0x52abca['body']);return _0x1248bc[_0x2e5e('0x20')](_0x52abca[_0x2e5e('0xa9')])[_0x2e5e('0x31')](_0x52abca[_0x2e5e('0x93')]);}else{return _0x1248bc['sendStatus'](0xc8);}})[_0x2e5e('0x51')](handleError(_0x1248bc,null));}; \ No newline at end of file +var _0xc721=['resolve','content-length','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./plugin.socket','sendStatus','offset','undefined','limit','count','status','set','json','apply','reject','then','destroy','get','Plugins','UserProfileResource','end','stack','name','send','index','map','Plugin','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','params','find','catch','download','join','server/files/plugins','format','createWriteStream','zip','warning','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','error','Error','pipe','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','filename','extname','file','root','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','scriptName','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Extracted\x20folder\x20removed','update','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-type','endsWith','statusCode'];(function(_0x4a23a9,_0x17a2c0){var _0x18c27f=function(_0x3414e3){while(--_0x3414e3){_0x4a23a9['push'](_0x4a23a9['shift']());}};_0x18c27f(++_0x17a2c0);}(_0xc721,0x14a));var _0x1c72=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc721[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1c72('0x0'));var rimraf=require(_0x1c72('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c72('0x2'));var rp=require(_0x1c72('0x3'));var moment=require(_0x1c72('0x4'));var BPromise=require(_0x1c72('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1c72('0x6'));var sox=require(_0x1c72('0x7'));var csv=require(_0x1c72('0x8'));var ejs=require(_0x1c72('0x9'));var fs=require('fs');var fs_extra=require(_0x1c72('0xa'));var _=require(_0x1c72('0xb'));var squel=require('squel');var crypto=require(_0x1c72('0xc'));var jsforce=require(_0x1c72('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1c72('0x8'));var querystring=require(_0x1c72('0xe'));var Papa=require(_0x1c72('0xf'));var extract=require(_0x1c72('0x10'));var rimraf=require(_0x1c72('0x1'));var archiver=require(_0x1c72('0x11'));var Redis=require(_0x1c72('0x12'));var authService=require(_0x1c72('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1c72('0x14'));var hardwareService=require(_0x1c72('0x15'));var logger=require(_0x1c72('0x16'))('api');var utils=require(_0x1c72('0x17'));var config=require(_0x1c72('0x18'));var licenseUtil=require(_0x1c72('0x19'));var db=require('../../mysqldb')['db'];config[_0x1c72('0x1a')]=_[_0x1c72('0x1b')](config[_0x1c72('0x1a')],{'host':_0x1c72('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c72('0x1a')]));require(_0x1c72('0x1d'))['register'](socket);function respondWithStatusCode(_0x3db6b6,_0x410e34){_0x410e34=_0x410e34||0xcc;return function(_0x44eadd){if(_0x44eadd){return _0x3db6b6[_0x1c72('0x1e')](_0x410e34);}return _0x3db6b6['status'](_0x410e34)['end']();};}function respondWithResult(_0x2ad7d6,_0x528a22){_0x528a22=_0x528a22||0xc8;return function(_0x5ebbd1){if(_0x5ebbd1){return _0x2ad7d6['status'](_0x528a22)['json'](_0x5ebbd1);}};}function respondWithFilteredResult(_0x26c5e4,_0xad161c){return function(_0x96579a){if(_0x96579a){var _0x21f439=typeof _0xad161c[_0x1c72('0x1f')]===_0x1c72('0x20')&&typeof _0xad161c[_0x1c72('0x21')]==='undefined';var _0x4fd7fb=_0x96579a[_0x1c72('0x22')];var _0x4654bb=_0x21f439?0x0:_0xad161c[_0x1c72('0x1f')];var _0x207c22=_0x21f439?_0x96579a[_0x1c72('0x22')]:_0xad161c[_0x1c72('0x1f')]+_0xad161c[_0x1c72('0x21')];var _0xe34a97;if(_0x207c22>=_0x4fd7fb){_0x207c22=_0x4fd7fb;_0xe34a97=0xc8;}else{_0xe34a97=0xce;}_0x26c5e4[_0x1c72('0x23')](_0xe34a97);return _0x26c5e4[_0x1c72('0x24')]('Content-Range',_0x4654bb+'-'+_0x207c22+'/'+_0x4fd7fb)[_0x1c72('0x25')](_0x96579a);}return null;};}function patchUpdates(_0x17c461){return function(_0x23b163){try{jsonpatch[_0x1c72('0x26')](_0x23b163,_0x17c461,!![]);}catch(_0x4fe5e6){return BPromise[_0x1c72('0x27')](_0x4fe5e6);}return _0x23b163['save']();};}function saveUpdates(_0x4b6a58,_0x47ace1){return function(_0x31fb38){if(_0x31fb38){return _0x31fb38['update'](_0x4b6a58)[_0x1c72('0x28')](function(_0x281453){return _0x281453;});}return null;};}function removeEntity(_0x9bbeac,_0x1e6e1c){return function(_0x33e501){if(_0x33e501){return _0x33e501[_0x1c72('0x29')]()[_0x1c72('0x28')](function(){var _0x40a39a=_0x33e501[_0x1c72('0x2a')]({'plain':!![]});var _0x3d64d9=_0x1c72('0x2b');return db[_0x1c72('0x2c')][_0x1c72('0x29')]({'where':{'type':_0x3d64d9,'resourceId':_0x40a39a['id']}})['then'](function(){return _0x33e501;});})[_0x1c72('0x28')](function(){_0x9bbeac['status'](0xcc)[_0x1c72('0x2d')]();});}};}function handleEntityNotFound(_0x257faf,_0x322f65){return function(_0x217ffa){if(!_0x217ffa){_0x257faf[_0x1c72('0x1e')](0x194);}return _0x217ffa;};}function handleError(_0x352c1c,_0x423a8f){_0x423a8f=_0x423a8f||0x1f4;return function(_0x12b0e5){logger['error'](_0x12b0e5[_0x1c72('0x2e')]);if(_0x12b0e5['name']){delete _0x12b0e5[_0x1c72('0x2f')];}_0x352c1c[_0x1c72('0x23')](_0x423a8f)[_0x1c72('0x30')](_0x12b0e5);};}exports[_0x1c72('0x31')]=function(_0xb0236d,_0xe9161e){var _0x82419f={},_0x2335a1={},_0x473f5e={'count':0x0,'rows':[]};var _0x258373=_[_0x1c72('0x32')](db[_0x1c72('0x33')][_0x1c72('0x34')],function(_0x1902cf){return{'name':_0x1902cf['fieldName'],'type':_0x1902cf[_0x1c72('0x35')]['key']};});_0x2335a1[_0x1c72('0x36')]=_[_0x1c72('0x32')](_0x258373,_0x1c72('0x2f'));_0x2335a1[_0x1c72('0x37')]=_[_0x1c72('0x38')](_0xb0236d[_0x1c72('0x37')]);_0x2335a1[_0x1c72('0x39')]=_[_0x1c72('0x3a')](_0x2335a1[_0x1c72('0x36')],_0x2335a1[_0x1c72('0x37')]);_0x82419f[_0x1c72('0x3b')]=_[_0x1c72('0x3a')](_0x2335a1[_0x1c72('0x36')],qs[_0x1c72('0x3c')](_0xb0236d[_0x1c72('0x37')][_0x1c72('0x3c')]));_0x82419f[_0x1c72('0x3b')]=_0x82419f['attributes'][_0x1c72('0x3d')]?_0x82419f[_0x1c72('0x3b')]:_0x2335a1[_0x1c72('0x36')];if(!_0xb0236d[_0x1c72('0x37')][_0x1c72('0x3e')](_0x1c72('0x3f'))){_0x82419f[_0x1c72('0x21')]=qs[_0x1c72('0x21')](_0xb0236d['query'][_0x1c72('0x21')]);_0x82419f['offset']=qs[_0x1c72('0x1f')](_0xb0236d[_0x1c72('0x37')][_0x1c72('0x1f')]);}_0x82419f[_0x1c72('0x40')]=qs[_0x1c72('0x41')](_0xb0236d[_0x1c72('0x37')][_0x1c72('0x41')]);_0x82419f['where']=qs['filters'](_['pick'](_0xb0236d[_0x1c72('0x37')],_0x2335a1[_0x1c72('0x39')]),_0x258373);if(_0xb0236d[_0x1c72('0x37')][_0x1c72('0x42')]){_0x82419f[_0x1c72('0x43')]=_[_0x1c72('0x44')](_0x82419f['where'],{'$or':_[_0x1c72('0x32')](_0x258373,function(_0x46064a){if(_0x46064a[_0x1c72('0x35')]!==_0x1c72('0x45')){var _0x5b2c11={};_0x5b2c11[_0x46064a[_0x1c72('0x2f')]]={'$like':'%'+_0xb0236d['query']['filter']+'%'};return _0x5b2c11;}})});}_0x82419f=_[_0x1c72('0x44')]({},_0x82419f,_0xb0236d[_0x1c72('0x46')]);var _0x53ff83={'where':_0x82419f[_0x1c72('0x43')]};return db[_0x1c72('0x33')][_0x1c72('0x22')](_0x53ff83)['then'](function(_0x4d1055){_0x473f5e[_0x1c72('0x22')]=_0x4d1055;if(_0xb0236d[_0x1c72('0x37')][_0x1c72('0x47')]){_0x82419f[_0x1c72('0x48')]=[{'all':!![]}];}return db[_0x1c72('0x33')][_0x1c72('0x49')](_0x82419f);})[_0x1c72('0x28')](function(_0x7f98a9){_0x473f5e['rows']=_0x7f98a9;return _0x473f5e;})['then'](respondWithFilteredResult(_0xe9161e,_0x82419f))['catch'](handleError(_0xe9161e,null));};exports['show']=function(_0x473310,_0xbdc105){var _0x4d8a8a={'raw':!![],'where':{'id':_0x473310[_0x1c72('0x4a')]['id']}},_0xd664d5={};_0xd664d5['model']=_[_0x1c72('0x38')](db[_0x1c72('0x33')]['rawAttributes']);_0xd664d5['query']=_[_0x1c72('0x38')](_0x473310[_0x1c72('0x37')]);_0xd664d5[_0x1c72('0x39')]=_['intersection'](_0xd664d5[_0x1c72('0x36')],_0xd664d5[_0x1c72('0x37')]);_0x4d8a8a['attributes']=_[_0x1c72('0x3a')](_0xd664d5[_0x1c72('0x36')],qs[_0x1c72('0x3c')](_0x473310[_0x1c72('0x37')]['fields']));_0x4d8a8a[_0x1c72('0x3b')]=_0x4d8a8a[_0x1c72('0x3b')][_0x1c72('0x3d')]?_0x4d8a8a['attributes']:_0xd664d5[_0x1c72('0x36')];if(_0x473310[_0x1c72('0x37')][_0x1c72('0x47')]){_0x4d8a8a[_0x1c72('0x48')]=[{'all':!![]}];}_0x4d8a8a=_[_0x1c72('0x44')]({},_0x4d8a8a,_0x473310[_0x1c72('0x46')]);return db[_0x1c72('0x33')][_0x1c72('0x4b')](_0x4d8a8a)['then'](handleEntityNotFound(_0xbdc105,null))[_0x1c72('0x28')](respondWithResult(_0xbdc105,null))[_0x1c72('0x4c')](handleError(_0xbdc105,null));};exports[_0x1c72('0x4d')]=function(_0x3e8b3c,_0x1c49d3,_0x53d292){return db[_0x1c72('0x33')][_0x1c72('0x4b')]({'where':{'id':_0x3e8b3c[_0x1c72('0x4a')]['id']},'attributes':[_0x1c72('0x2f'),_0x1c72('0x6')],'raw':!![]})[_0x1c72('0x28')](handleEntityNotFound(_0x1c49d3,null))['then'](function(_0x31e3b8){if(_0x31e3b8){var _0x13e68f=path[_0x1c72('0x4e')](config['root'],_0x1c72('0x4f'),util[_0x1c72('0x50')]('%s.zip',path['basename'](_0x31e3b8[_0x1c72('0x6')])));var _0x19c68b=fs[_0x1c72('0x51')](_0x13e68f);var _0x184a57=archiver(_0x1c72('0x52'),{'zlib':{'level':0x9}});_0x184a57['on'](_0x1c72('0x53'),function(_0x43e08e){if(_0x43e08e['code']===_0x1c72('0x54')){logger['error'](_0x43e08e);}else{throw new db[(_0x1c72('0x55'))]['Error'](_0x1c72('0x56'));}});_0x184a57['on'](_0x1c72('0x57'),function(_0x38fc8f){throw new db[(_0x1c72('0x55'))][(_0x1c72('0x58'))](_0x1c72('0x56'));});_0x184a57[_0x1c72('0x59')](_0x19c68b);_0x184a57['glob']('**/*',{'cwd':path[_0x1c72('0x4e')](config['root'],_0x1c72('0x4f'),path[_0x1c72('0x5a')](_0x31e3b8[_0x1c72('0x6')])),'ignore':[path[_0x1c72('0x4e')](path[_0x1c72('0x5b')](_0x31e3b8[_0x1c72('0x6')]),_0x1c72('0x5c')),path['join'](path['basename'](_0x31e3b8[_0x1c72('0x6')]),_0x1c72('0x5d'))],'nodir':!![]})[_0x1c72('0x5e')]();_0x19c68b['on'](_0x1c72('0x5f'),function(){if(!fs['existsSync'](_0x13e68f)){throw new db[(_0x1c72('0x55'))]['Error'](_0x1c72('0x60'));}return _0x1c49d3[_0x1c72('0x4d')](_0x13e68f,util[_0x1c72('0x50')]('%s.zip',path[_0x1c72('0x5b')](_0x31e3b8[_0x1c72('0x6')])),function(_0x4bde80){if(_0x4bde80){throw new db[(_0x1c72('0x55'))][(_0x1c72('0x58'))](_0x1c72('0x61'));}fs[_0x1c72('0x62')](_0x13e68f);logger[_0x1c72('0x63')](_0x1c72('0x64'));logger[_0x1c72('0x63')]('Temporary\x20file\x20removed');});});}return null;})[_0x1c72('0x4c')](handleError(_0x1c49d3,null));};exports[_0x1c72('0x65')]=function(_0x103ecf,_0x52e439,_0x4b708c){var _0x42ccd4=path[_0x1c72('0x5b')](_0x103ecf['file'][_0x1c72('0x66')],path[_0x1c72('0x67')](_0x103ecf[_0x1c72('0x68')]['filename']));var _0x5087f2=path[_0x1c72('0x4e')](config[_0x1c72('0x69')],'server/files/plugins',_0x103ecf[_0x1c72('0x68')][_0x1c72('0x66')]);var _0x28eca6=path[_0x1c72('0x4e')](config['root'],_0x1c72('0x4f'),_0x42ccd4);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x5087f2);logger['info'](_0x1c72('0x6a'),_0x28eca6);try{fs[_0x1c72('0x6b')](_0x5087f2,parseInt('0777',0x8));extract(_0x5087f2,{'dir':_0x28eca6},function(_0xa9ddd1){if(_0xa9ddd1){logger[_0x1c72('0x57')](_0xa9ddd1);handleError(_0xa9ddd1,!![]);};var _0x35aec4=fs[_0x1c72('0x6c')](_0x28eca6);if(_0x35aec4[_0x1c72('0x3d')]>0x1){removeReferences(_0x5087f2,_0x28eca6);logger[_0x1c72('0x57')](_0x1c72('0x6d'));return _0x4b708c(new Error(_0x1c72('0x6d')));}var _0x53077a=fs[_0x1c72('0x6e')](path[_0x1c72('0x4e')](_0x28eca6,_0x35aec4[0x0]));if(_0x53077a[_0x1c72('0x6f')]()){removeReferences(_0x5087f2,_0x28eca6);logger[_0x1c72('0x57')](_0x1c72('0x6d'));return _0x4b708c(new Error(_0x1c72('0x6d')));}if(_0x53077a[_0x1c72('0x70')]()){var _0x480073=fs[_0x1c72('0x6c')](path[_0x1c72('0x4e')](_0x28eca6,_0x35aec4[0x0]));if(_0x480073[_0x1c72('0x3d')]===0x0){removeReferences(_0x5087f2,_0x28eca6);logger[_0x1c72('0x57')](_0x1c72('0x6d'));return _0x4b708c(new Error(_0x1c72('0x6d')));}var _0x3f28e1=_0x480073[_0x1c72('0x71')](function(_0x5480e6){return _0x5480e6===_0x1c72('0x72');});if(!_0x3f28e1){return _0x4b708c(new Error(_0x1c72('0x73')));}var _0x149179=fs[_0x1c72('0x74')](path['join'](_0x28eca6,_0x35aec4[0x0],'manifest.json'));var _0x3a4068=JSON['parse'](_0x149179);if(_0x1c72('0x20')==typeof _0x3a4068[_0x1c72('0x2f')]){return _0x4b708c(new Error(_0x1c72('0x75')));}if(_0x1c72('0x20')==typeof _0x3a4068[_0x1c72('0x35')]){return _0x4b708c(new Error(_0x1c72('0x76')));}if(_0x1c72('0x20')==typeof _0x3a4068[_0x1c72('0x77')]){return _0x4b708c(new Error(_0x1c72('0x78')));}if('undefined'==typeof _0x3a4068['parameters']){return _0x4b708c(new Error(_0x1c72('0x79')));}if(_0x3a4068[_0x1c72('0x35')]===_0x1c72('0x7a')){if('undefined'==typeof _0x3a4068[_0x1c72('0x7b')][_0x1c72('0x7c')]){return _0x4b708c(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x1c72('0x20')==typeof _0x3a4068['parameters'][_0x1c72('0x7c')][_0x1c72('0x7d')]&&_0x1c72('0x20')==typeof _0x3a4068[_0x1c72('0x7b')]['views'][_0x1c72('0x7e')]){return _0x4b708c(new Error(_0x1c72('0x7f')));}}else if(_0x3a4068[_0x1c72('0x35')]===_0x1c72('0x80')){if(_0x1c72('0x20')==typeof _0x3a4068['parameters']['scriptName']){return _0x4b708c(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x3a4068[_0x1c72('0x7b')][_0x1c72('0x81')]){return _0x4b708c(new Error(_0x1c72('0x82')));}}else{return _0x4b708c(new Error(_0x1c72('0x83')));}var _0x5d8494=_0x3a4068[_0x1c72('0x2f')];var _0xc2c842=_0x3a4068['description'];var _0x2278c0=_0x3a4068[_0x1c72('0x35')];var _0x4ca690=_0x3a4068[_0x1c72('0x84')]?_0x3a4068['sidebar']:'always';var _0x4356cc=_0x3a4068[_0x1c72('0x85')]?_0x3a4068[_0x1c72('0x85')]:_0x1c72('0x86');var _0xad2add='';var _0x4c29f0='';var _0x2364f1='';var _0x4c0b2f='';var _0x4f9e39=_0x3a4068[_0x1c72('0x77')];if(_0x2278c0===_0x1c72('0x7a')){if(_0x1c72('0x20')!=typeof _0x3a4068[_0x1c72('0x7b')][_0x1c72('0x7c')][_0x1c72('0x7d')]){var _0x470f3c=_0x3a4068['parameters']['views'][_0x1c72('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x1c72('0x87')](_0x470f3c)){_0xad2add=path[_0x1c72('0x4e')](_0x1c72('0x88'),_0x42ccd4,_0x35aec4[0x0],_0x470f3c);}else{_0xad2add=_0x470f3c;}}else{logger[_0x1c72('0x63')](_0x1c72('0x89'));}if(_0x1c72('0x20')!=typeof _0x3a4068[_0x1c72('0x7b')][_0x1c72('0x7c')][_0x1c72('0x7e')]){var _0x3ceacd=_0x3a4068['parameters']['views'][_0x1c72('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x1c72('0x87')](_0x3ceacd)){_0x4c29f0=path[_0x1c72('0x4e')](_0x1c72('0x88'),_0x42ccd4,_0x35aec4[0x0],_0x3ceacd);}else{_0x4c29f0=_0x3ceacd;}}else{logger[_0x1c72('0x63')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x2278c0===_0x1c72('0x80')){_0x2364f1=_0x3a4068['parameters'][_0x1c72('0x8a')];_0x4c0b2f=_0x3a4068[_0x1c72('0x7b')][_0x1c72('0x81')];if(_0x1c72('0x20')!=typeof _0x3a4068['parameters'][_0x1c72('0x7c')]){if('undefined'!=typeof _0x3a4068['parameters'][_0x1c72('0x7c')]['admin']){var _0x470f3c=_0x3a4068[_0x1c72('0x7b')][_0x1c72('0x7c')][_0x1c72('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x1c72('0x87')](_0x470f3c)){_0xad2add=path[_0x1c72('0x4e')](_0x1c72('0x88'),_0x42ccd4,_0x35aec4[0x0],_0x470f3c);}else{_0xad2add=_0x470f3c;}}if(_0x1c72('0x20')!=typeof _0x3a4068['parameters'][_0x1c72('0x7c')][_0x1c72('0x7e')]){var _0x3ceacd=_0x3a4068[_0x1c72('0x7b')][_0x1c72('0x7c')][_0x1c72('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x1c72('0x87')](_0x3ceacd)){_0x4c29f0=path[_0x1c72('0x4e')]('plugins',_0x42ccd4,_0x35aec4[0x0],_0x3ceacd);}else{_0x4c29f0=_0x3ceacd;}}}}var _0x484eb0={'name':_0x5d8494,'description':_0xc2c842,'path':path[_0x1c72('0x4e')](_0x42ccd4,_0x35aec4[0x0]),'type':_0x2278c0,'sidebar':_0x4ca690,'icon':_0x4356cc,'adminUrl':_0xad2add,'agentUrl':_0x4c29f0,'scriptName':_0x2364f1,'scriptPath':_0x4c0b2f,'version':_0x4f9e39};removeReferences(_0x5087f2,null);return db[_0x1c72('0x33')][_0x1c72('0x8b')](_0x484eb0)[_0x1c72('0x28')](function(_0x8bc378){var _0x397586={'role':_0x103ecf[_0x1c72('0x8c')][_0x1c72('0x8d')],'userProfileId':_0x103ecf[_0x1c72('0x8c')]['userProfileId']};if(!_0x397586)throw new Error(_0x1c72('0x8e'));if(_0x397586[_0x1c72('0x8d')]===_0x1c72('0x8f')){var _0x36b1db=_0x8bc378[_0x1c72('0x2a')]({'plain':!![]});return db['UserProfileSection'][_0x1c72('0x4b')]({'where':{'name':'Plugins','userProfileId':_0x397586[_0x1c72('0x90')]},'raw':!![]})[_0x1c72('0x28')](function(_0x39c31a){if(_0x39c31a&&_0x39c31a[_0x1c72('0x91')]===0x0){return db[_0x1c72('0x2c')]['create']({'name':_0x36b1db[_0x1c72('0x2f')],'resourceId':_0x36b1db['id'],'type':_0x39c31a['name'],'sectionId':_0x39c31a['id']},{})[_0x1c72('0x28')](function(){return _0x8bc378;});}else{return _0x8bc378;}})[_0x1c72('0x4c')](function(_0x1b319d){logger[_0x1c72('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b319d);throw _0x1b319d;});}return _0x8bc378;})[_0x1c72('0x28')](respondWithResult(_0x52e439,null))[_0x1c72('0x4c')](handleError(_0x52e439,null));}});}catch(_0x2e0ed0){_0x52e439[_0x1c72('0x23')](0x1f4)[_0x1c72('0x30')](_0x2e0ed0);}};function removeReferences(_0x4e786a,_0x44e4b6){try{if(_0x4e786a){fs['unlinkSync'](_0x4e786a);logger[_0x1c72('0x63')]('Zip\x20archive\x20removed');}if(_0x44e4b6){rimraf(_0x44e4b6,function(){});logger[_0x1c72('0x63')](_0x1c72('0x92'));}}catch(_0x1c41f3){logger[_0x1c72('0x57')](_0x1c41f3);}}exports[_0x1c72('0x93')]=function(_0x1546bb,_0x34a158,_0x48717c){return db[_0x1c72('0x33')][_0x1c72('0x4b')]({'where':{'id':_0x1546bb[_0x1c72('0x4a')]['id']}})['then'](handleEntityNotFound(_0x34a158,null))[_0x1c72('0x28')](saveUpdates(_0x1546bb['body'],null))[_0x1c72('0x28')](respondWithResult(_0x34a158,null))[_0x1c72('0x4c')](handleError(_0x34a158,null));};exports[_0x1c72('0x94')]=function(_0x2fc317,_0x4770ab,_0x45f5d7){return db[_0x1c72('0x33')][_0x1c72('0x4b')]({'where':{'id':_0x2fc317[_0x1c72('0x4a')]['id']}})[_0x1c72('0x28')](function(_0x2c11ab){if(_0x2c11ab){return _0x2c11ab[_0x1c72('0x29')]();}})[_0x1c72('0x28')](function(_0x1e933c){rimraf(path['join'](config[_0x1c72('0x69')],'server/files/plugins',path[_0x1c72('0x5a')](_0x1e933c[_0x1c72('0x6')])),function(){});return _0x1e933c;})[_0x1c72('0x28')](handleEntityNotFound(_0x4770ab,null))['then'](respondWithStatusCode(_0x4770ab,null))['catch'](handleError(_0x4770ab,null));};exports[_0x1c72('0x95')]=function(_0x2c5cd6,_0x5142b5,_0x54b469){return BPromise['resolve']()[_0x1c72('0x28')](function(){if(!_0x2c5cd6[_0x1c72('0x37')][_0x1c72('0x6')]){throw new Error(_0x1c72('0x96'));}if(!_0x2c5cd6[_0x1c72('0x37')][_0x1c72('0x97')]){throw new Error(_0x1c72('0x98'));}var _0x4311d2=_0x2c5cd6['query'][_0x1c72('0x99')]?_0x2c5cd6[_0x1c72('0x37')][_0x1c72('0x99')]+':'+_0x2c5cd6[_0x1c72('0x37')]['port']:_0x1c72('0x9a')+_0x2c5cd6[_0x1c72('0x37')]['port'];var _0x240cb1=_0x2c5cd6[_0x1c72('0x37')][_0x1c72('0x25')]?_0x2c5cd6[_0x1c72('0x37')][_0x1c72('0x25')]:!![];var _0x52dab4=_0x2c5cd6[_0x1c72('0x37')]['encoding']?_0x2c5cd6[_0x1c72('0x37')][_0x1c72('0x9b')]:null;var _0x297cf1={'method':_0x2c5cd6[_0x1c72('0x9c')],'uri':util[_0x1c72('0x50')](_0x1c72('0x9d'),_0x4311d2,_0x2c5cd6['query'][_0x1c72('0x6')]),'json':_0x240cb1,'resolveWithFullResponse':!![],'encoding':_0x52dab4,'qs':_0x2c5cd6['query']};if(_0x2c5cd6[_0x1c72('0x9e')]){_0x297cf1[_0x1c72('0x9e')]=_0x2c5cd6[_0x1c72('0x9e')];if(_0x297cf1[_0x1c72('0x9e')]['content-length']){delete _0x297cf1['headers']['content-length'];}}if(_0x297cf1['headers'][_0x1c72('0x9f')]){delete _0x297cf1[_0x1c72('0x9e')]['content-type'];}return rp(_0x297cf1);})[_0x1c72('0x28')](function(_0x186737){if(_0x186737){_0x5142b5['set'](_0x186737[_0x1c72('0x9e')]);logger['info'](_0x186737[_0x1c72('0x8c')]);if(_[_0x1c72('0xa0')](_0x2c5cd6['query']['path'],_0x1c72('0x4d'))&&_0x186737[_0x1c72('0xa1')]==0x1f4){return _0x5142b5[_0x1c72('0x1e')](_0x186737['statusCode']);}else{return _0x5142b5[_0x1c72('0x23')](_0x186737['statusCode'])[_0x1c72('0x30')](_0x186737[_0x1c72('0x8c')]);}}else{return _0x5142b5['sendStatus'](0xc8);}})[_0x1c72('0x4c')](handleError(_0x5142b5,null));};exports['webhookPost']=function(_0x578bec,_0x11696f,_0x503176){return BPromise[_0x1c72('0xa2')]()['then'](function(){if(!_0x578bec['query'][_0x1c72('0x6')]){throw new Error(_0x1c72('0x96'));}if(!_0x578bec[_0x1c72('0x37')][_0x1c72('0x97')]){throw new Error(_0x1c72('0x98'));}var _0x505391=_0x578bec[_0x1c72('0x37')][_0x1c72('0x99')]?_0x578bec[_0x1c72('0x37')][_0x1c72('0x99')]+':'+_0x578bec[_0x1c72('0x37')][_0x1c72('0x97')]:_0x1c72('0x9a')+_0x578bec[_0x1c72('0x37')]['port'];var _0x18dccb=_0x578bec['query'][_0x1c72('0x25')]?_0x578bec[_0x1c72('0x37')]['json']:!![];var _0x445e46=_0x578bec[_0x1c72('0x37')][_0x1c72('0x9b')]?_0x578bec[_0x1c72('0x37')][_0x1c72('0x9b')]:null;var _0x19b4e8={'method':_0x578bec[_0x1c72('0x9c')],'uri':util[_0x1c72('0x50')](_0x1c72('0x9d'),_0x505391,_0x578bec[_0x1c72('0x37')][_0x1c72('0x6')]),'json':_0x18dccb,'resolveWithFullResponse':!![],'encoding':_0x445e46,'body':_0x578bec['body']};if(_0x578bec[_0x1c72('0x9e')]){_0x19b4e8['headers']=_0x578bec[_0x1c72('0x9e')];if(_0x19b4e8[_0x1c72('0x9e')]['content-length']){delete _0x19b4e8[_0x1c72('0x9e')][_0x1c72('0xa3')];}}if(_0x19b4e8[_0x1c72('0x9e')][_0x1c72('0x9f')]){delete _0x19b4e8[_0x1c72('0x9e')][_0x1c72('0x9f')];}return rp(_0x19b4e8);})[_0x1c72('0x28')](function(_0x19af8c){if(_0x19af8c){_0x11696f[_0x1c72('0x24')](_0x19af8c[_0x1c72('0x9e')]);logger[_0x1c72('0x63')](_0x19af8c['body']);return _0x11696f[_0x1c72('0x23')](_0x19af8c[_0x1c72('0xa1')])[_0x1c72('0x30')](_0x19af8c[_0x1c72('0x8c')]);}else{return _0x11696f[_0x1c72('0x1e')](0xc8);}})[_0x1c72('0x4c')](handleError(_0x11696f,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index ddcf14d..c0c597b 100644 --- a/server/api/plugin/plugin.events.js +++ b/server/api/plugin/plugin.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x975b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','Plugin'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x975b,0x1c9));var _0xb975=function(_0x345673,_0xcbfb72){_0x345673=_0x345673-0x0;var _0x288132=_0x975b[_0x345673];return _0x288132;};'use strict';var EventEmitter=require(_0xb975('0x0'));var Plugin=require(_0xb975('0x1'))['db'][_0xb975('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xb975('0x3')](0x0);var events={'afterCreate':_0xb975('0x4'),'afterUpdate':_0xb975('0x5'),'afterDestroy':_0xb975('0x6')};function emitEvent(_0x5e662b){return function(_0xa92c72,_0xfb173,_0x2007e4){PluginEvents[_0xb975('0x7')](_0x5e662b+':'+_0xa92c72['id'],_0xa92c72);PluginEvents[_0xb975('0x7')](_0x5e662b,_0xa92c72);_0x2007e4(null);};}for(var e in events){if(events[_0xb975('0x8')](e)){var event=events[e];Plugin[_0xb975('0x9')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0xe558=['hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2da24d,_0x3de812){var _0x8c442f=function(_0x558a6f){while(--_0x558a6f){_0x2da24d['push'](_0x2da24d['shift']());}};_0x8c442f(++_0x3de812);}(_0xe558,0x70));var _0x8e55=function(_0x532b5a,_0xb851c2){_0x532b5a=_0x532b5a-0x0;var _0x36818c=_0xe558[_0x532b5a];return _0x36818c;};'use strict';var EventEmitter=require(_0x8e55('0x0'));var Plugin=require(_0x8e55('0x1'))['db'][_0x8e55('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x8e55('0x3')](0x0);var events={'afterCreate':_0x8e55('0x4'),'afterUpdate':_0x8e55('0x5'),'afterDestroy':_0x8e55('0x6')};function emitEvent(_0x3a5285){return function(_0x28c870,_0x5bc807,_0xf125cc){PluginEvents[_0x8e55('0x7')](_0x3a5285+':'+_0x28c870['id'],_0x28c870);PluginEvents[_0x8e55('0x7')](_0x3a5285,_0x28c870);_0xf125cc(null);};}for(var e in events){if(events[_0x8e55('0x8')](e)){var event=events[e];Plugin[_0x8e55('0x9')](e,emitEvent(event));}}module[_0x8e55('0xa')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 9b0f6b7..dd6a22b 100644 --- a/server/api/plugin/plugin.model.js +++ b/server/api/plugin/plugin.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x85d0=['rimraf','../../config/environment','exports','define','Plugin','moment','bluebird','request-promise','path'];(function(_0x388eea,_0x340518){var _0x4a175b=function(_0x595f94){while(--_0x595f94){_0x388eea['push'](_0x388eea['shift']());}};_0x4a175b(++_0x340518);}(_0x85d0,0x164));var _0x085d=function(_0x1c8d28,_0x1776a2){_0x1c8d28=_0x1c8d28-0x0;var _0xdb4832=_0x85d0[_0x1c8d28];return _0xdb4832;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x085d('0x0'));var BPromise=require(_0x085d('0x1'));var rp=require(_0x085d('0x2'));var fs=require('fs');var path=require(_0x085d('0x3'));var rimraf=require(_0x085d('0x4'));var config=require(_0x085d('0x5'));var attributes=require('./plugin.attributes');module[_0x085d('0x6')]=function(_0x5c917f,_0x364f09){return _0x5c917f[_0x085d('0x7')](_0x085d('0x8'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8758=['request-promise','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','moment','bluebird'];(function(_0x18a313,_0x54020e){var _0x44ac80=function(_0xf53027){while(--_0xf53027){_0x18a313['push'](_0x18a313['shift']());}};_0x44ac80(++_0x54020e);}(_0x8758,0x19b));var _0x8875=function(_0x5b3d53,_0x4d2b95){_0x5b3d53=_0x5b3d53-0x0;var _0x494105=_0x8758[_0x5b3d53];return _0x494105;};'use strict';var _=require(_0x8875('0x0'));var util=require(_0x8875('0x1'));var logger=require(_0x8875('0x2'))('api');var moment=require(_0x8875('0x3'));var BPromise=require(_0x8875('0x4'));var rp=require(_0x8875('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8875('0x6'));var config=require(_0x8875('0x7'));var attributes=require(_0x8875('0x8'));module[_0x8875('0x9')]=function(_0x41995b,_0x374a60){return _0x41995b[_0x8875('0xa')](_0x8875('0xb'),attributes,{'tableName':_0x8875('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 8097218..d4b37a4 100644 --- a/server/api/plugin/plugin.rpc.js +++ b/server/api/plugin/plugin.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b9e=['error','code','message','Plugin,\x20%s,\x20%s','catch','CreatePlugin','create','body','options','raw','debug','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x9b9e,0x10c));var _0xe9b9=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9b9e[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xe9b9('0x0'));var util=require(_0xe9b9('0x1'));var moment=require(_0xe9b9('0x2'));var BPromise=require(_0xe9b9('0x3'));var rs=require(_0xe9b9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9b9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9b9('0x6'))('rpc');var config=require(_0xe9b9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe9b9('0x8')][_0xe9b9('0x9')]({'port':0x232a});config[_0xe9b9('0xa')]=_[_0xe9b9('0xb')](config[_0xe9b9('0xa')],{'host':_0xe9b9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe9b9('0xa')]));require(_0xe9b9('0xd'))[_0xe9b9('0xe')](socket);function respondWithRpcPromise(_0x54867e,_0x5be607,_0x3c52a1){return new BPromise(function(_0x4a70bb,_0x350575){return client[_0xe9b9('0xf')](_0x54867e,_0x3c52a1)[_0xe9b9('0x10')](function(_0x520086){logger[_0xe9b9('0x11')]('Plugin,\x20%s,\x20%s',_0x5be607,'request\x20sent');logger['debug'](_0xe9b9('0x12'),_0x5be607,_0xe9b9('0x13'),JSON['stringify'](_0x520086));if(_0x520086['error']){if(_0x520086[_0xe9b9('0x14')][_0xe9b9('0x15')]===0x1f4){logger[_0xe9b9('0x14')]('Plugin,\x20%s,\x20%s',_0x5be607,_0x520086[_0xe9b9('0x14')]['message']);return _0x350575(_0x520086[_0xe9b9('0x14')][_0xe9b9('0x16')]);}logger[_0xe9b9('0x14')]('Plugin,\x20%s,\x20%s',_0x5be607,_0x520086[_0xe9b9('0x14')][_0xe9b9('0x16')]);return _0x4a70bb(_0x520086[_0xe9b9('0x14')][_0xe9b9('0x16')]);}else{logger['info'](_0xe9b9('0x17'),_0x5be607,_0xe9b9('0x13'));_0x4a70bb(_0x520086['result']['message']);}})[_0xe9b9('0x18')](function(_0x2a0043){logger['error'](_0xe9b9('0x17'),_0x5be607,_0x2a0043);_0x350575(_0x2a0043);});});}exports[_0xe9b9('0x19')]=function(_0x2e0a57){var _0x140ee0=this;return new Promise(function(_0x43b0d7,_0x21df1d){return db['Plugin'][_0xe9b9('0x1a')](_0x2e0a57[_0xe9b9('0x1b')],{'raw':_0x2e0a57[_0xe9b9('0x1c')]?_0x2e0a57[_0xe9b9('0x1c')][_0xe9b9('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x649bf8){logger['info'](_0xe9b9('0x19'),_0x2e0a57);logger[_0xe9b9('0x1e')](_0xe9b9('0x19'),_0x2e0a57,JSON[_0xe9b9('0x1f')](_0x649bf8));_0x43b0d7(_0x649bf8);})['catch'](function(_0x213e2e){logger['error'](_0xe9b9('0x19'),_0x213e2e['message'],_0x2e0a57);_0x21df1d(_0x140ee0[_0xe9b9('0x14')](0x1f4,_0x213e2e['message']));});});}; \ No newline at end of file +var _0x25a8=['body','options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','CreatePlugin','create'];(function(_0x478087,_0x109fb2){var _0x54bff1=function(_0x4589b3){while(--_0x4589b3){_0x478087['push'](_0x478087['shift']());}};_0x54bff1(++_0x109fb2);}(_0x25a8,0x177));var _0x825a=function(_0x26a792,_0x94d0f){_0x26a792=_0x26a792-0x0;var _0x4471b6=_0x25a8[_0x26a792];return _0x4471b6;};'use strict';var _=require(_0x825a('0x0'));var util=require(_0x825a('0x1'));var moment=require(_0x825a('0x2'));var BPromise=require('bluebird');var rs=require(_0x825a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x825a('0x4'))['db'];var utils=require(_0x825a('0x5'));var logger=require(_0x825a('0x6'))(_0x825a('0x7'));var config=require(_0x825a('0x8'));var jayson=require(_0x825a('0x9'));var client=jayson['client'][_0x825a('0xa')]({'port':0x232a});config[_0x825a('0xb')]=_['defaults'](config[_0x825a('0xb')],{'host':_0x825a('0xc'),'port':0x18eb});var socket=require(_0x825a('0xd'))(new Redis(config[_0x825a('0xb')]));require(_0x825a('0xe'))[_0x825a('0xf')](socket);function respondWithRpcPromise(_0x1ab8a6,_0x3b6f70,_0x303ae8){return new BPromise(function(_0x29e50e,_0x2da7ee){return client[_0x825a('0x10')](_0x1ab8a6,_0x303ae8)[_0x825a('0x11')](function(_0x416334){logger[_0x825a('0x12')](_0x825a('0x13'),_0x3b6f70,_0x825a('0x14'));logger[_0x825a('0x15')]('Plugin,\x20%s,\x20%s,\x20%s',_0x3b6f70,_0x825a('0x14'),JSON[_0x825a('0x16')](_0x416334));if(_0x416334[_0x825a('0x17')]){if(_0x416334[_0x825a('0x17')]['code']===0x1f4){logger['error'](_0x825a('0x13'),_0x3b6f70,_0x416334[_0x825a('0x17')][_0x825a('0x18')]);return _0x2da7ee(_0x416334[_0x825a('0x17')][_0x825a('0x18')]);}logger[_0x825a('0x17')](_0x825a('0x13'),_0x3b6f70,_0x416334[_0x825a('0x17')]['message']);return _0x29e50e(_0x416334[_0x825a('0x17')][_0x825a('0x18')]);}else{logger[_0x825a('0x12')](_0x825a('0x13'),_0x3b6f70,_0x825a('0x14'));_0x29e50e(_0x416334['result'][_0x825a('0x18')]);}})[_0x825a('0x19')](function(_0x6f4b60){logger[_0x825a('0x17')]('Plugin,\x20%s,\x20%s',_0x3b6f70,_0x6f4b60);_0x2da7ee(_0x6f4b60);});});}exports[_0x825a('0x1a')]=function(_0x218b86){var _0x476871=this;return new Promise(function(_0x263e20,_0x6e9bdc){return db['Plugin'][_0x825a('0x1b')](_0x218b86[_0x825a('0x1c')],{'raw':_0x218b86['options']?_0x218b86[_0x825a('0x1d')][_0x825a('0x1e')]===undefined?!![]:![]:!![]})[_0x825a('0x11')](function(_0x27c27d){logger['info'](_0x825a('0x1a'),_0x218b86);logger[_0x825a('0x15')](_0x825a('0x1a'),_0x218b86,JSON[_0x825a('0x16')](_0x27c27d));_0x263e20(_0x27c27d);})[_0x825a('0x19')](function(_0x3a3b6d){logger[_0x825a('0x17')](_0x825a('0x1a'),_0x3a3b6d[_0x825a('0x18')],_0x218b86);_0x6e9bdc(_0x476871[_0x825a('0x17')](0x1f4,_0x3a3b6d[_0x825a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 5f2e2db..0dada48 100644 --- a/server/api/plugin/plugin.socket.js +++ b/server/api/plugin/plugin.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa668=['emit','removeListener','register','length','plugin:','./plugin.events','save','update'];(function(_0x51a9b6,_0x1fdadc){var _0x5a0e49=function(_0x41a5a3){while(--_0x41a5a3){_0x51a9b6['push'](_0x51a9b6['shift']());}};_0x5a0e49(++_0x1fdadc);}(_0xa668,0x12d));var _0x8a66=function(_0x32de2a,_0x5e9e2e){_0x32de2a=_0x32de2a-0x0;var _0x29e4b5=_0xa668[_0x32de2a];return _0x29e4b5;};'use strict';var PluginEvents=require(_0x8a66('0x0'));var events=[_0x8a66('0x1'),'remove',_0x8a66('0x2')];function createListener(_0x41859b,_0x456ea0){return function(_0x2c7cfa){_0x456ea0[_0x8a66('0x3')](_0x41859b,_0x2c7cfa);};}function removeListener(_0x4aabec,_0x41b33d){return function(){PluginEvents[_0x8a66('0x4')](_0x4aabec,_0x41b33d);};}exports[_0x8a66('0x5')]=function(_0x3709ef){for(var _0x11d70f=0x0,_0x579a65=events[_0x8a66('0x6')];_0x11d70f<_0x579a65;_0x11d70f++){var _0x33c8ea=events[_0x11d70f];var _0x458e21=createListener(_0x8a66('0x7')+_0x33c8ea,_0x3709ef);PluginEvents['on'](_0x33c8ea,_0x458e21);}}; \ No newline at end of file +var _0xe0b8=['remove','update','removeListener','register','plugin:','./plugin.events'];(function(_0x5cbe90,_0x5059fa){var _0x1b1c6e=function(_0x15bccb){while(--_0x15bccb){_0x5cbe90['push'](_0x5cbe90['shift']());}};_0x1b1c6e(++_0x5059fa);}(_0xe0b8,0xdd));var _0x8e0b=function(_0x3a793e,_0x2636a8){_0x3a793e=_0x3a793e-0x0;var _0x2fde36=_0xe0b8[_0x3a793e];return _0x2fde36;};'use strict';var PluginEvents=require(_0x8e0b('0x0'));var events=['save',_0x8e0b('0x1'),_0x8e0b('0x2')];function createListener(_0x40aeac,_0x4f7a95){return function(_0x4f9eda){_0x4f7a95['emit'](_0x40aeac,_0x4f9eda);};}function removeListener(_0x3bebb3,_0x5da12c){return function(){PluginEvents[_0x8e0b('0x3')](_0x3bebb3,_0x5da12c);};}exports[_0x8e0b('0x4')]=function(_0x314732){for(var _0x5e6fa2=0x0,_0x30ba53=events['length'];_0x5e6fa2<_0x30ba53;_0x5e6fa2++){var _0x28243a=events[_0x5e6fa2];var _0x541e3d=createListener(_0x8e0b('0x5')+_0x28243a,_0x314732);PluginEvents['on'](_0x28243a,_0x541e3d);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index aed8727..ccf82ad 100644 --- a/server/api/pm2/index.js +++ b/server/api/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x5706e4,_0x202c69){var _0x1315eb=function(_0x250a36){while(--_0x250a36){_0x5706e4['push'](_0x5706e4['shift']());}};_0x1315eb(++_0x202c69);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x29ccea,_0xc9f9c5){var _0x58fc22=function(_0x90abab){while(--_0x90abab){_0x29ccea['push'](_0x29ccea['shift']());}};_0x58fc22(++_0xc9f9c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index c155d94..c5073e1 100644 --- a/server/api/pm2/pm2.controller.js +++ b/server/api/pm2/pm2.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbec5=['Unknown\x20id','lodash','../../config/pm2','api','path','child_process','exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','index','list','then','reject','express','motion2','catch','show','create','body','join','../../files/plugins','script','cwd','dirname','chdir','start','dump','restart','hasOwnProperty','params','destroy'];(function(_0x4c894b,_0x54fa91){var _0x490258=function(_0x145534){while(--_0x145534){_0x4c894b['push'](_0x4c894b['shift']());}};_0x490258(++_0x54fa91);}(_0xbec5,0xe5));var _0x5bec=function(_0x47adb8,_0x591ccc){_0x47adb8=_0x47adb8-0x0;var _0x4689a8=_0xbec5[_0x47adb8];return _0x4689a8;};'use strict';var _=require(_0x5bec('0x0'));var pm2=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var path=require(_0x5bec('0x3'));var exec=require(_0x5bec('0x4'))[_0x5bec('0x5')];var BPromise=require(_0x5bec('0x6'));function handleEntityNotFound(_0x4ee982,_0x1f8933){return function(_0x376cdb){if(!_0x376cdb){_0x4ee982[_0x5bec('0x7')](0x194);;}return _0x376cdb;};}function respondWithResult(_0x4aaac6,_0x3ed67a){_0x3ed67a=_0x3ed67a||0xc8;return function(_0x28a427){if(_0x28a427){return _0x4aaac6[_0x5bec('0x8')](_0x3ed67a)[_0x5bec('0x9')](_0x28a427);}return null;};}function handleError(_0x43d96e,_0x302aae){_0x302aae=_0x302aae||0x1f4;return function(_0x6406a1){logger[_0x5bec('0xa')](_0x6406a1['stack']);if(_0x6406a1[_0x5bec('0xb')]){delete _0x6406a1['name'];}_0x43d96e[_0x5bec('0x8')](_0x302aae)[_0x5bec('0xc')](_0x6406a1);};}function execChildProcess(){return new BPromise(function(_0x117162,_0x4a5482){exec(_0x5bec('0xd'),function(_0x18fa47,_0x16226b,_0x57ffc4){logger[_0x5bec('0xe')](_0x16226b);logger[_0x5bec('0xe')](_0x57ffc4);if(_0x18fa47){logger['error'](_0x18fa47);return _0x4a5482(_0x18fa47);}return _0x117162(_0x16226b);});});}exports[_0x5bec('0xf')]=function(_0xaa984d,_0x35393a){return pm2[_0x5bec('0x10')]()[_0x5bec('0x11')](function(_0xcd6d90){if(_0xcd6d90){var _0x24dcd6=_[_0x5bec('0x12')](_0xcd6d90,function(_0x259588){return _0x259588[_0x5bec('0xb')]===_0x5bec('0x13')||_0x259588[_0x5bec('0xb')]===_0x5bec('0x14');});return{'rows':_0x24dcd6,'count':_0x24dcd6['length']};}return null;})['then'](respondWithResult(_0x35393a,null))[_0x5bec('0x15')](handleError(_0x35393a,null));};exports[_0x5bec('0x16')]=function(_0x31ad9c,_0x1771e7){return pm2['describe'](_0x31ad9c['params']['id'])[_0x5bec('0x11')](respondWithResult(_0x1771e7,null))[_0x5bec('0x11')](handleEntityNotFound(_0x1771e7,null))['catch'](handleError(_0x1771e7,null));};exports[_0x5bec('0x17')]=function(_0xa7e223,_0x32a846){if(_0xa7e223[_0x5bec('0x18')]['name']&&_0xa7e223[_0x5bec('0x18')]['script']){var _0x191c0f=path[_0x5bec('0x19')](__dirname,_0x5bec('0x1a'),_0xa7e223[_0x5bec('0x18')][_0x5bec('0x1b')]);var _0x5e154e=process[_0x5bec('0x1c')]();process['chdir'](path[_0x5bec('0x1d')](_0x191c0f));return execChildProcess()[_0x5bec('0x11')](function(_0x5b2636){process[_0x5bec('0x1e')](_0x5e154e);return pm2[_0x5bec('0x1f')]({'name':_0xa7e223['body'][_0x5bec('0xb')],'script':_0x191c0f});})[_0x5bec('0x11')](function(_0x43d460){pm2[_0x5bec('0x20')]();return _0x43d460[0x0];})[_0x5bec('0x11')](respondWithResult(_0x32a846,0xc9))[_0x5bec('0x15')](handleError(_0x32a846,null));}else{return _0x32a846[_0x5bec('0x8')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x2961bd,_0x2cdd2f){if(_0x2961bd[_0x5bec('0x18')]['id']){delete _0x2961bd['body']['id'];}var _0x2b3b2c={'online':_0x5bec('0x21'),'stopped':'stop'};if(_0x2b3b2c[_0x5bec('0x22')](_0x2961bd[_0x5bec('0x18')]['status'])){return pm2[_0x2b3b2c[_0x2961bd['body'][_0x5bec('0x8')]]](_0x2961bd[_0x5bec('0x23')]['id'])[_0x5bec('0x11')](respondWithResult(_0x2cdd2f,0xc8))[_0x5bec('0x15')](handleError(_0x2cdd2f,null));}else{return _0x2cdd2f[_0x5bec('0x8')](0x1f4)[_0x5bec('0xc')]({'message':'Unknown\x20status'});}};exports[_0x5bec('0x24')]=function(_0x59b5b6,_0x45863b){if(_0x59b5b6[_0x5bec('0x18')]['id']){delete _0x59b5b6[_0x5bec('0x18')]['id'];}if(_0x59b5b6[_0x5bec('0x23')]['id']){return pm2['delete'](_0x59b5b6[_0x5bec('0x23')]['id'])[_0x5bec('0x11')](function(_0xfc7d41){pm2['dump']();return _0xfc7d41[0x0];})[_0x5bec('0x11')](respondWithResult(_0x45863b,null))['catch'](handleError(_0x45863b,null));}else{return _0x45863b[_0x5bec('0x8')](0x1f4)[_0x5bec('0xc')]({'message':_0x5bec('0x25')});}}; \ No newline at end of file +var _0x1d2d=['reject','express','motion2','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','params','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','exec','sendStatus','json','error','stack','name','status','send','npm\x20install','info','index','list','then'];(function(_0x727b1c,_0x172057){var _0x5323f4=function(_0x251c70){while(--_0x251c70){_0x727b1c['push'](_0x727b1c['shift']());}};_0x5323f4(++_0x172057);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x3a401f,_0xcce8e9){_0x3a401f=_0x3a401f-0x0;var _0x826393=_0x1d2d[_0x3a401f];return _0x826393;};'use strict';var _=require(_0xd1d2('0x0'));var pm2=require(_0xd1d2('0x1'));var logger=require(_0xd1d2('0x2'))(_0xd1d2('0x3'));var path=require(_0xd1d2('0x4'));var exec=require('child_process')[_0xd1d2('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x5d3fac,_0x3caa72){return function(_0x2bfabc){if(!_0x2bfabc){_0x5d3fac[_0xd1d2('0x6')](0x194);;}return _0x2bfabc;};}function respondWithResult(_0x269613,_0x2f930d){_0x2f930d=_0x2f930d||0xc8;return function(_0x353dbd){if(_0x353dbd){return _0x269613['status'](_0x2f930d)[_0xd1d2('0x7')](_0x353dbd);}return null;};}function handleError(_0x21bc28,_0x35735f){_0x35735f=_0x35735f||0x1f4;return function(_0x37ff2a){logger[_0xd1d2('0x8')](_0x37ff2a[_0xd1d2('0x9')]);if(_0x37ff2a[_0xd1d2('0xa')]){delete _0x37ff2a[_0xd1d2('0xa')];}_0x21bc28[_0xd1d2('0xb')](_0x35735f)[_0xd1d2('0xc')](_0x37ff2a);};}function execChildProcess(){return new BPromise(function(_0x900ec,_0x227d7f){exec(_0xd1d2('0xd'),function(_0x5b21f4,_0x41fcb5,_0x1f49ed){logger[_0xd1d2('0xe')](_0x41fcb5);logger[_0xd1d2('0xe')](_0x1f49ed);if(_0x5b21f4){logger[_0xd1d2('0x8')](_0x5b21f4);return _0x227d7f(_0x5b21f4);}return _0x900ec(_0x41fcb5);});});}exports[_0xd1d2('0xf')]=function(_0x2df8a5,_0x31dc84){return pm2[_0xd1d2('0x10')]()[_0xd1d2('0x11')](function(_0x4cf702){if(_0x4cf702){var _0x2e7fec=_[_0xd1d2('0x12')](_0x4cf702,function(_0x3476f8){return _0x3476f8['name']===_0xd1d2('0x13')||_0x3476f8[_0xd1d2('0xa')]===_0xd1d2('0x14');});return{'rows':_0x2e7fec,'count':_0x2e7fec[_0xd1d2('0x15')]};}return null;})[_0xd1d2('0x11')](respondWithResult(_0x31dc84,null))[_0xd1d2('0x16')](handleError(_0x31dc84,null));};exports[_0xd1d2('0x17')]=function(_0x57f2f9,_0x539d5a){return pm2[_0xd1d2('0x18')](_0x57f2f9['params']['id'])[_0xd1d2('0x11')](respondWithResult(_0x539d5a,null))[_0xd1d2('0x11')](handleEntityNotFound(_0x539d5a,null))[_0xd1d2('0x16')](handleError(_0x539d5a,null));};exports[_0xd1d2('0x19')]=function(_0x4ab386,_0x4f1201){if(_0x4ab386[_0xd1d2('0x1a')]['name']&&_0x4ab386['body'][_0xd1d2('0x1b')]){var _0x27e26b=path[_0xd1d2('0x1c')](__dirname,_0xd1d2('0x1d'),_0x4ab386['body'][_0xd1d2('0x1b')]);var _0xbb4d27=process[_0xd1d2('0x1e')]();process['chdir'](path['dirname'](_0x27e26b));return execChildProcess()[_0xd1d2('0x11')](function(_0x3a1078){process[_0xd1d2('0x1f')](_0xbb4d27);return pm2[_0xd1d2('0x20')]({'name':_0x4ab386[_0xd1d2('0x1a')][_0xd1d2('0xa')],'script':_0x27e26b});})[_0xd1d2('0x11')](function(_0x5df4af){pm2[_0xd1d2('0x21')]();return _0x5df4af[0x0];})[_0xd1d2('0x11')](respondWithResult(_0x4f1201,0xc9))[_0xd1d2('0x16')](handleError(_0x4f1201,null));}else{return _0x4f1201[_0xd1d2('0xb')](0x1f4)[_0xd1d2('0xc')]({'message':_0xd1d2('0x22')});}};exports[_0xd1d2('0x23')]=function(_0x34faf7,_0xe6ef3c){if(_0x34faf7[_0xd1d2('0x1a')]['id']){delete _0x34faf7[_0xd1d2('0x1a')]['id'];}var _0x4e1bc2={'online':'restart','stopped':_0xd1d2('0x24')};if(_0x4e1bc2[_0xd1d2('0x25')](_0x34faf7[_0xd1d2('0x1a')][_0xd1d2('0xb')])){return pm2[_0x4e1bc2[_0x34faf7[_0xd1d2('0x1a')]['status']]](_0x34faf7[_0xd1d2('0x26')]['id'])[_0xd1d2('0x11')](respondWithResult(_0xe6ef3c,0xc8))[_0xd1d2('0x16')](handleError(_0xe6ef3c,null));}else{return _0xe6ef3c['status'](0x1f4)[_0xd1d2('0xc')]({'message':_0xd1d2('0x27')});}};exports[_0xd1d2('0x28')]=function(_0x56557d,_0x419db7){if(_0x56557d[_0xd1d2('0x1a')]['id']){delete _0x56557d[_0xd1d2('0x1a')]['id'];}if(_0x56557d[_0xd1d2('0x26')]['id']){return pm2[_0xd1d2('0x29')](_0x56557d[_0xd1d2('0x26')]['id'])[_0xd1d2('0x11')](function(_0x322f50){pm2[_0xd1d2('0x21')]();return _0x322f50[0x0];})[_0xd1d2('0x11')](respondWithResult(_0x419db7,null))[_0xd1d2('0x16')](handleError(_0x419db7,null));}else{return _0x419db7[_0xd1d2('0xb')](0x1f4)[_0xd1d2('0xc')]({'message':_0xd1d2('0x2a')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 2ed7479..adb4f5f 100644 --- a/server/api/realtime/index.js +++ b/server/api/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b93=['express','Router','./realtime.controller','get','getAgents','/queues','exports'];(function(_0x8af54b,_0x280be5){var _0x27d8f0=function(_0x559734){while(--_0x559734){_0x8af54b['push'](_0x8af54b['shift']());}};_0x27d8f0(++_0x280be5);}(_0x0b93,0x103));var _0x30b9=function(_0x1341ee,_0x2ce5c0){_0x1341ee=_0x1341ee-0x0;var _0x24f3c5=_0x0b93[_0x1341ee];return _0x24f3c5;};'use strict';var express=require(_0x30b9('0x0'));var router=express[_0x30b9('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x30b9('0x2'));router[_0x30b9('0x3')]('/agents',auth['isAuthenticated'](),controller[_0x30b9('0x4')]);router[_0x30b9('0x3')](_0x30b9('0x5'),auth['isAuthenticated'](),controller['getQueues']);module[_0x30b9('0x6')]=router; \ No newline at end of file +var _0x6f2e=['../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getQueues','exports','express','Router'];(function(_0x556017,_0x5bcd93){var _0x525b7e=function(_0x2f13d6){while(--_0x2f13d6){_0x556017['push'](_0x556017['shift']());}};_0x525b7e(++_0x5bcd93);}(_0x6f2e,0x8e));var _0xe6f2=function(_0x1674a9,_0x51a843){_0x1674a9=_0x1674a9-0x0;var _0x2bf67b=_0x6f2e[_0x1674a9];return _0x2bf67b;};'use strict';var express=require(_0xe6f2('0x0'));var router=express[_0xe6f2('0x1')]();var auth=require(_0xe6f2('0x2'));var controller=require(_0xe6f2('0x3'));router[_0xe6f2('0x4')](_0xe6f2('0x5'),auth[_0xe6f2('0x6')](),controller['getAgents']);router[_0xe6f2('0x4')]('/queues',auth[_0xe6f2('0x6')](),controller[_0xe6f2('0x7')]);module[_0xe6f2('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index edafe0b..30cec5f 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb27f=['pick','catch','getQueues','startCase','name','voice','outbound','dialActive','dialMethod','fields','QueueCampaigns','filter','UserProfile','getRealtimeQueues','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','limit','undefined','count','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','join','order','getAgentIdsByQueues','getRealtimeAgents','getSortedAgentsIdsByStatus','length','map','User','rawAttributes','fieldName','type','key','role','getOptions','raw','push','sequelize','literal','FIELD(id,','forEach','*pause','Pause','where','merge','user','userProfileId','Agents','agent','online','extraQueryConditions','assign','getResources','findAndCountAll','rows','find','filterAgentAttributes','talking','voiceStatus','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields'];(function(_0x37f02e,_0x24e12d){var _0x546b92=function(_0x410325){while(--_0x410325){_0x37f02e['push'](_0x37f02e['shift']());}};_0x546b92(++_0x24e12d);}(_0xb27f,0x116));var _0xfb27=function(_0x62a5e3,_0x4c3238){_0x62a5e3=_0x62a5e3-0x0;var _0x383e85=_0xb27f[_0x62a5e3];return _0x383e85;};'use strict';var _=require('lodash');var util=require('util');var rta=require(_0xfb27('0x0'));var rtq=require(_0xfb27('0x1'));var qs=require(_0xfb27('0x2'));var utils=require(_0xfb27('0x3'));var db=require(_0xfb27('0x4'))['db'];var APIBadRequestError=require(_0xfb27('0x5'))[_0xfb27('0x6')];var APIHandleError=require(_0xfb27('0x5'))[_0xfb27('0x7')];function respondWithFilteredResult(_0x44fe00,_0x279223){return function(_0x5c4653){if(_0x5c4653){var _0x259c11=typeof _0x279223[_0xfb27('0x8')]==='undefined'&&typeof _0x279223[_0xfb27('0x9')]===_0xfb27('0xa');var _0x32fc99=_0x5c4653[_0xfb27('0xb')];var _0x5de7b5=_0x259c11?0x0:_0x279223[_0xfb27('0x8')];var _0x4842b1=_0x259c11?_0x5c4653[_0xfb27('0xb')]:_0x279223[_0xfb27('0x8')]+_0x279223['limit'];var _0x16f2c6;if(_0x4842b1>=_0x32fc99){_0x4842b1=_0x32fc99;_0x16f2c6=0xc8;}else{_0x16f2c6=0xce;}_0x44fe00[_0xfb27('0xc')](_0x16f2c6);return _0x44fe00[_0xfb27('0xd')](_0xfb27('0xe'),_0x5de7b5+'-'+_0x4842b1+'/'+_0x32fc99)[_0xfb27('0xf')](_0x5c4653);}return null;};}exports[_0xfb27('0x10')]=function(_0x2de11c,_0xd3d0da){var _0x345f2f={'count':0x0,'rows':[]};var _0x1b5cf8={};var _0xa0e47c;var _0x4c7f2d=utils[_0xfb27('0x11')]();var _0x37a7aa;var _0x42f7e6;var _0x2d0aa7=_0x2de11c[_0xfb27('0x12')][_0xfb27('0x13')];var _0x49bfd2=_0x2de11c[_0xfb27('0x12')][_0xfb27('0x14')];var _0x4f27d5=_0x2de11c[_0xfb27('0x12')]['pauseTypeFilter'];var _0x483a53=_0x49bfd2===_0xfb27('0x15')||_0x49bfd2==='*pause'?!![]:![];var _0xb7b8ff=[];var _0x3002de;var _0x2a6ec0;Promise[_0xfb27('0x16')]()[_0xfb27('0x17')](function(){if(_0x2de11c[_0xfb27('0x12')][_0xfb27('0x18')]){if(!utils[_0xfb27('0x19')](_0x2de11c[_0xfb27('0x12')]['channel'])){throw new APIBadRequestError(util[_0xfb27('0x1a')](_0xfb27('0x1b'),_0x2de11c[_0xfb27('0x12')][_0xfb27('0x18')]));}_0xa0e47c=_0x2de11c[_0xfb27('0x12')][_0xfb27('0x18')][_0xfb27('0x1c')]();}if(!_0x2de11c['query'][_0xfb27('0x1d')]||!_0x2de11c[_0xfb27('0x12')][_0xfb27('0x1d')]['includes'](_0xfb27('0x1e'))){_0x2de11c[_0xfb27('0x12')]['sort']=rta[_0xfb27('0x1f')](_0x2de11c[_0xfb27('0x12')][_0xfb27('0x1d')]);return;}var _0x1bd6ff=rta[_0xfb27('0x20')](_0x2de11c[_0xfb27('0x12')][_0xfb27('0x1d')]);_0x2de11c[_0xfb27('0x12')]['sort']=_0x1bd6ff['fields'][_0xfb27('0x21')](',');_0x3002de=_0x1bd6ff[_0xfb27('0x22')];})[_0xfb27('0x17')](function(){if(!_0x2d0aa7){return[];}return rta[_0xfb27('0x23')](_0x2d0aa7,_0xa0e47c);})['then'](function(_0x5317bc){_0xb7b8ff=_0x5317bc;return rta[_0xfb27('0x24')]();})[_0xfb27('0x17')](function(_0x3d2f05){_0x42f7e6=_0x3d2f05['rows'];if((!_0x49bfd2||_0x483a53)&&!_0x3002de){return _0xb7b8ff;}if(_0x3002de&&!_0x49bfd2){return rta[_0xfb27('0x25')](_0x42f7e6,_0xb7b8ff,_0x3002de);}else{return rta['getAgentIdsByStatus'](_0x42f7e6,_0xb7b8ff,_0x49bfd2);}})['then'](function(_0x1860ad){_0xb7b8ff=_0x1860ad;var _0x14699e=![];if(_0xb7b8ff[_0xfb27('0x26')]===0x0){if(_0x2d0aa7||_0x49bfd2){_0x14699e=!![];}if(_0x483a53){_0x14699e=![];}}if(_0x14699e){return _0x345f2f;}var _0x4857da=_[_0xfb27('0x27')](db[_0xfb27('0x28')][_0xfb27('0x29')],function(_0x4a02a1){return{'name':_0x4a02a1[_0xfb27('0x2a')],'type':_0x4a02a1[_0xfb27('0x2b')][_0xfb27('0x2c')]};});_0x2de11c[_0xfb27('0x12')][_0xfb27('0x2d')]='agent';_0x1b5cf8=qs[_0xfb27('0x2e')](_0x4857da,_0x2de11c);_0x1b5cf8[_0xfb27('0x2f')]=!![];var _0x30e0c0=[];if(_0xb7b8ff['length']>0x0){_0x30e0c0[_0xfb27('0x30')]({'id':{'$in':_0xb7b8ff}});if(_0x3002de&&!_0x49bfd2){_0x2a6ec0=[db[_0xfb27('0x31')][_0xfb27('0x32')](_0xfb27('0x33')+_0xb7b8ff+')')];_0x1b5cf8[_0xfb27('0x22')]=_0x2a6ec0;}}if(_0x483a53){_0x4c7f2d[_0xfb27('0x34')](function(_0x34e46c){var _0x110d72=!![];if(_0x49bfd2===_0xfb27('0x35')&&_0xa0e47c!==_0x34e46c){_0x110d72=![];}_0x30e0c0[_0xfb27('0x30')]({[_0x34e46c+_0xfb27('0x36')]:_0x110d72});});if(_0x4f27d5){_0x30e0c0[_0xfb27('0x30')]({'pauseType':_0x4f27d5});}}else if(_0x49bfd2){_0x4c7f2d['forEach'](function(_0x5512c7){_0x30e0c0[_0xfb27('0x30')]({[_0x5512c7+'Pause']:![]});});}_0x1b5cf8[_0xfb27('0x37')]=_[_0xfb27('0x38')](_0x1b5cf8['where'],{'$and':_0x30e0c0});if(_0x2de11c[_0xfb27('0x39')][_0xfb27('0x2d')]===_0xfb27('0x39')){var _0x1a6e5b={'params':{'id':_0x2de11c[_0xfb27('0x39')][_0xfb27('0x3a')]},'query':{'section':_0xfb27('0x3b'),'role':_0xfb27('0x3c'),'raw':!![],'ids':_0xb7b8ff,'customSorting':_0x2a6ec0}};if(_0x2de11c[_0xfb27('0x12')]['online']){_0x1a6e5b[_0xfb27('0x12')][_0xfb27('0x3d')]=!![];}if(_0x483a53){_0x1a6e5b[_0xfb27('0x12')][_0xfb27('0x3e')]=_0x30e0c0;}_0x1a6e5b[_0xfb27('0x12')]=Object[_0xfb27('0x3f')](_0x1a6e5b[_0xfb27('0x12')],_0x2de11c[_0xfb27('0x12')]);return db['UserProfile'][_0xfb27('0x40')](_0x1a6e5b);}return db['User'][_0xfb27('0x41')](_0x1b5cf8);})[_0xfb27('0x17')](function(_0x15c857){_0x345f2f[_0xfb27('0xb')]=_0x15c857[_0xfb27('0xb')];_0x37a7aa=_0x15c857[_0xfb27('0x42')];return _0x37a7aa[_0xfb27('0x27')](function(_0x787fbc){var _0x1d138e=_[_0xfb27('0x43')](_0x42f7e6,['id',_0x787fbc['id']]);if(_0x1d138e){var _0x172abc=rta[_0xfb27('0x44')](_0x1d138e);_[_0xfb27('0x38')](_0x787fbc,_0x172abc);}_0x787fbc['globalStatus']=rta['getAgentStatus'](_0x787fbc);if(_0x787fbc['globalStatus']['includes'](_0xfb27('0x15'))){_0x4c7f2d[_0xfb27('0x34')](function(_0x3ade31){if(_0x787fbc[_0x3ade31+'Pause']){if(_0x3ade31==='voice'){if(_0x787fbc['voiceStatus']!==_0xfb27('0x45')){_0x787fbc[_0xfb27('0x46')]=_0xfb27('0x15');}}else{_0x787fbc[_0x3ade31+_0xfb27('0x47')]='pause';}}});}return _0x787fbc;});})[_0xfb27('0x17')](function(_0x1b5698){if(!_0x3002de||_0x2a6ec0){return _0x1b5698;}return rta[_0xfb27('0x48')](_0x1b5698,_0x3002de);})[_0xfb27('0x17')](function(_0x5578a3){var _0x1fac76=rta[_0xfb27('0x49')]();_0x345f2f['rows']=_0x5578a3[_0xfb27('0x27')](function(_0x6ffb9a){return _[_0xfb27('0x4a')](_0x6ffb9a,_0x1fac76);});return _0x345f2f;})[_0xfb27('0x17')](respondWithFilteredResult(_0xd3d0da,_0x1b5cf8))[_0xfb27('0x4b')](APIHandleError(_0xd3d0da));};exports[_0xfb27('0x4c')]=function(_0x3d5e71,_0x1170f0){var _0x2b61ca={'count':0x0,'rows':[]};var _0x4c8eb2={};var _0x5bae2c;var _0x4381b6;var _0x531ca9;Promise[_0xfb27('0x16')]()[_0xfb27('0x17')](function(){if(_0x3d5e71['query'][_0xfb27('0x18')]){if(!utils[_0xfb27('0x19')](_0x3d5e71[_0xfb27('0x12')][_0xfb27('0x18')])){throw new APIBadRequestError(util['format'](_0xfb27('0x1b'),_0x3d5e71[_0xfb27('0x12')]['channel']));}_0x5bae2c=_0x3d5e71[_0xfb27('0x12')]['channel']['toLowerCase']();}var _0x43cf7f=_[_0xfb27('0x4d')](_0x5bae2c)+'Queue';var _0x13572f=_[_0xfb27('0x27')](db[_0x43cf7f][_0xfb27('0x29')],function(_0xbcb3b0){return{'name':_0xbcb3b0[_0xfb27('0x2a')],'type':_0xbcb3b0[_0xfb27('0x2b')][_0xfb27('0x2c')]};});if(!_0x3d5e71['query']['fields']){var _0x16afe1=['id',_0xfb27('0x4e')];if(_0x5bae2c===_0xfb27('0x4f')){_0x16afe1['push'](_0xfb27('0x2b'));if(_0x3d5e71[_0xfb27('0x12')][_0xfb27('0x2b')]===_0xfb27('0x50')){_0x16afe1[_0xfb27('0x30')]([_0xfb27('0x51'),_0xfb27('0x52')]);}}_0x3d5e71['query'][_0xfb27('0x53')]=_0x16afe1[_0xfb27('0x21')](',');}_0x4c8eb2=qs[_0xfb27('0x2e')](_0x13572f,_0x3d5e71);if(_0x3d5e71[_0xfb27('0x39')]['role']===_0xfb27('0x39')){var _0x50cdbd={'params':{'id':_0x3d5e71[_0xfb27('0x39')]['userProfileId']},'query':{'section':_0x5bae2c===_0xfb27('0x4f')&&_0x3d5e71['query'][_0xfb27('0x2b')]===_0xfb27('0x50')?_0xfb27('0x54'):_[_0xfb27('0x4d')](_0x5bae2c)+'Queues','type':_0x3d5e71[_0xfb27('0x12')][_0xfb27('0x2b')],'nolimit':!![],'sort':_0xfb27('0x4e'),'filter':_0x3d5e71[_0xfb27('0x12')][_0xfb27('0x55')]}};_0x50cdbd[_0xfb27('0x12')]=Object['assign'](_0x50cdbd[_0xfb27('0x12')],_0x3d5e71[_0xfb27('0x12')]);delete _0x50cdbd[_0xfb27('0x12')]['id'];return db[_0xfb27('0x56')]['getResources'](_0x50cdbd);}return db[_0x43cf7f]['findAndCountAll'](_0x4c8eb2);})[_0xfb27('0x17')](function(_0x1889d1){_0x2b61ca[_0xfb27('0xb')]=_0x1889d1['count'];_0x4381b6=_0x1889d1[_0xfb27('0x42')];return rtq[_0xfb27('0x57')](_0x3d5e71,_0x5bae2c);})[_0xfb27('0x17')](function(_0x5ccc2c){_0x531ca9=_0x5ccc2c[_0xfb27('0x42')];return rtq['initializeQueues'](_0x4381b6,_0x531ca9,_0x5bae2c,_0x3d5e71[_0xfb27('0x12')][_0xfb27('0x2b')]);})[_0xfb27('0x17')](function(_0x3b86d1){_0x2b61ca[_0xfb27('0x42')]=_0x3b86d1;return _0x2b61ca;})['then'](respondWithFilteredResult(_0x1170f0,_0x4c8eb2))[_0xfb27('0x4b')](APIHandleError(_0x1170f0));}; \ No newline at end of file +var _0xae5d=['../../errors/api','APIBadRequestError','handleError','offset','undefined','limit','status','set','json','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','then','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','globalStatus','sort','validateSortParameter','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','sequelize','literal','FIELD(id,','forEach','push','Pause','merge','where','user','userProfileId','Agents','online','assign','UserProfile','getResources','findAndCountAll','count','find','filterAgentAttributes','includes','voiceStatus','talking','pick','catch','getQueues','startCase','Queue','name','voice','outbound','dialActive','dialMethod','QueueCampaigns','filter','getRealtimeQueues','lodash','util','../../components/realtime/queues','../../components/parsers/qs','../../mysqldb'];(function(_0x2c7806,_0x42e5bb){var _0x42563b=function(_0x54110d){while(--_0x54110d){_0x2c7806['push'](_0x2c7806['shift']());}};_0x42563b(++_0x42e5bb);}(_0xae5d,0x1f3));var _0xdae5=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0xae5d[_0x2a56ad];return _0x425175;};'use strict';var _=require(_0xdae5('0x0'));var util=require(_0xdae5('0x1'));var rta=require('../../components/realtime/agents');var rtq=require(_0xdae5('0x2'));var qs=require(_0xdae5('0x3'));var utils=require('../../config/utils');var db=require(_0xdae5('0x4'))['db'];var APIBadRequestError=require(_0xdae5('0x5'))[_0xdae5('0x6')];var APIHandleError=require(_0xdae5('0x5'))[_0xdae5('0x7')];function respondWithFilteredResult(_0x2e3eb6,_0x1107a0){return function(_0x3cacef){if(_0x3cacef){var _0x4abfa0=typeof _0x1107a0[_0xdae5('0x8')]===_0xdae5('0x9')&&typeof _0x1107a0[_0xdae5('0xa')]===_0xdae5('0x9');var _0x4fc048=_0x3cacef['count'];var _0x2d79c4=_0x4abfa0?0x0:_0x1107a0[_0xdae5('0x8')];var _0x24281e=_0x4abfa0?_0x3cacef['count']:_0x1107a0[_0xdae5('0x8')]+_0x1107a0[_0xdae5('0xa')];var _0x1b315e;if(_0x24281e>=_0x4fc048){_0x24281e=_0x4fc048;_0x1b315e=0xc8;}else{_0x1b315e=0xce;}_0x2e3eb6[_0xdae5('0xb')](_0x1b315e);return _0x2e3eb6[_0xdae5('0xc')]('Content-Range',_0x2d79c4+'-'+_0x24281e+'/'+_0x4fc048)[_0xdae5('0xd')](_0x3cacef);}return null;};}exports['getAgents']=function(_0x1262fe,_0x2e288f){var _0x47e53c={'count':0x0,'rows':[]};var _0x133274={};var _0x5ad5a8;var _0x212f47=utils[_0xdae5('0xe')]();var _0x207d46;var _0x5d1fec;var _0x171603=_0x1262fe[_0xdae5('0xf')][_0xdae5('0x10')];var _0x126de8=_0x1262fe['query'][_0xdae5('0x11')];var _0x5a5d36=_0x1262fe[_0xdae5('0xf')][_0xdae5('0x12')];var _0x5ab974=_0x126de8===_0xdae5('0x13')||_0x126de8===_0xdae5('0x14')?!![]:![];var _0x534a99=[];var _0x56e92b;var _0x1b5636;Promise[_0xdae5('0x15')]()[_0xdae5('0x16')](function(){if(_0x1262fe['query'][_0xdae5('0x17')]){if(!utils[_0xdae5('0x18')](_0x1262fe[_0xdae5('0xf')][_0xdae5('0x17')])){throw new APIBadRequestError(util['format'](_0xdae5('0x19'),_0x1262fe[_0xdae5('0xf')][_0xdae5('0x17')]));}_0x5ad5a8=_0x1262fe[_0xdae5('0xf')]['channel'][_0xdae5('0x1a')]();}if(!_0x1262fe[_0xdae5('0xf')]['sort']||!_0x1262fe[_0xdae5('0xf')]['sort']['includes'](_0xdae5('0x1b'))){_0x1262fe[_0xdae5('0xf')][_0xdae5('0x1c')]=rta[_0xdae5('0x1d')](_0x1262fe['query']['sort']);return;}var _0x24e74d=rta['getUpdatedSortOptions'](_0x1262fe[_0xdae5('0xf')]['sort']);_0x1262fe[_0xdae5('0xf')][_0xdae5('0x1c')]=_0x24e74d[_0xdae5('0x1e')][_0xdae5('0x1f')](',');_0x56e92b=_0x24e74d[_0xdae5('0x20')];})[_0xdae5('0x16')](function(){if(!_0x171603){return[];}return rta[_0xdae5('0x21')](_0x171603,_0x5ad5a8);})[_0xdae5('0x16')](function(_0x41d8d4){_0x534a99=_0x41d8d4;return rta[_0xdae5('0x22')]();})[_0xdae5('0x16')](function(_0x446b3f){_0x5d1fec=_0x446b3f[_0xdae5('0x23')];if((!_0x126de8||_0x5ab974)&&!_0x56e92b){return _0x534a99;}if(_0x56e92b&&!_0x126de8){return rta[_0xdae5('0x24')](_0x5d1fec,_0x534a99,_0x56e92b);}else{return rta[_0xdae5('0x25')](_0x5d1fec,_0x534a99,_0x126de8);}})[_0xdae5('0x16')](function(_0x49a5a1){_0x534a99=_0x49a5a1;var _0x17f57b=![];if(_0x534a99[_0xdae5('0x26')]===0x0){if(_0x171603||_0x126de8){_0x17f57b=!![];}if(_0x5ab974){_0x17f57b=![];}}if(_0x17f57b){return _0x47e53c;}var _0x37b817=_[_0xdae5('0x27')](db[_0xdae5('0x28')][_0xdae5('0x29')],function(_0x2a3640){return{'name':_0x2a3640[_0xdae5('0x2a')],'type':_0x2a3640[_0xdae5('0x2b')][_0xdae5('0x2c')]};});_0x1262fe[_0xdae5('0xf')][_0xdae5('0x2d')]=_0xdae5('0x2e');_0x133274=qs[_0xdae5('0x2f')](_0x37b817,_0x1262fe);_0x133274[_0xdae5('0x30')]=!![];var _0x2e4a67=[];if(_0x534a99[_0xdae5('0x26')]>0x0){_0x2e4a67['push']({'id':{'$in':_0x534a99}});if(_0x56e92b&&!_0x126de8){_0x1b5636=[db[_0xdae5('0x31')][_0xdae5('0x32')](_0xdae5('0x33')+_0x534a99+')')];_0x133274['order']=_0x1b5636;}}if(_0x5ab974){_0x212f47[_0xdae5('0x34')](function(_0x39490b){var _0x5d3686=!![];if(_0x126de8==='*pause'&&_0x5ad5a8!==_0x39490b){_0x5d3686=![];}_0x2e4a67[_0xdae5('0x35')]({[_0x39490b+_0xdae5('0x36')]:_0x5d3686});});if(_0x5a5d36){_0x2e4a67[_0xdae5('0x35')]({'pauseType':_0x5a5d36});}}else if(_0x126de8){_0x212f47[_0xdae5('0x34')](function(_0x13aa33){_0x2e4a67[_0xdae5('0x35')]({[_0x13aa33+'Pause']:![]});});}_0x133274['where']=_[_0xdae5('0x37')](_0x133274[_0xdae5('0x38')],{'$and':_0x2e4a67});if(_0x1262fe[_0xdae5('0x39')][_0xdae5('0x2d')]===_0xdae5('0x39')){var _0x252935={'params':{'id':_0x1262fe[_0xdae5('0x39')][_0xdae5('0x3a')]},'query':{'section':_0xdae5('0x3b'),'role':_0xdae5('0x2e'),'raw':!![],'ids':_0x534a99,'customSorting':_0x1b5636}};if(_0x1262fe[_0xdae5('0xf')][_0xdae5('0x3c')]){_0x252935[_0xdae5('0xf')][_0xdae5('0x3c')]=!![];}if(_0x5ab974){_0x252935[_0xdae5('0xf')]['extraQueryConditions']=_0x2e4a67;}_0x252935[_0xdae5('0xf')]=Object[_0xdae5('0x3d')](_0x252935['query'],_0x1262fe['query']);return db[_0xdae5('0x3e')][_0xdae5('0x3f')](_0x252935);}return db[_0xdae5('0x28')][_0xdae5('0x40')](_0x133274);})[_0xdae5('0x16')](function(_0x3b1a63){_0x47e53c[_0xdae5('0x41')]=_0x3b1a63[_0xdae5('0x41')];_0x207d46=_0x3b1a63[_0xdae5('0x23')];return _0x207d46['map'](function(_0x42fe75){var _0x1b378b=_[_0xdae5('0x42')](_0x5d1fec,['id',_0x42fe75['id']]);if(_0x1b378b){var _0x4f7407=rta[_0xdae5('0x43')](_0x1b378b);_['merge'](_0x42fe75,_0x4f7407);}_0x42fe75[_0xdae5('0x1b')]=rta['getAgentStatus'](_0x42fe75);if(_0x42fe75[_0xdae5('0x1b')][_0xdae5('0x44')](_0xdae5('0x13'))){_0x212f47[_0xdae5('0x34')](function(_0x24a384){if(_0x42fe75[_0x24a384+'Pause']){if(_0x24a384==='voice'){if(_0x42fe75[_0xdae5('0x45')]!==_0xdae5('0x46')){_0x42fe75[_0xdae5('0x45')]=_0xdae5('0x13');}}else{_0x42fe75[_0x24a384+'Status']='pause';}}});}return _0x42fe75;});})['then'](function(_0x33a7bd){if(!_0x56e92b||_0x1b5636){return _0x33a7bd;}return rta['sortAgentsByStatus'](_0x33a7bd,_0x56e92b);})[_0xdae5('0x16')](function(_0x4ca336){var _0x16354b=rta['getRealtimeAgentsQueryFields']();_0x47e53c[_0xdae5('0x23')]=_0x4ca336[_0xdae5('0x27')](function(_0x4940e8){return _[_0xdae5('0x47')](_0x4940e8,_0x16354b);});return _0x47e53c;})[_0xdae5('0x16')](respondWithFilteredResult(_0x2e288f,_0x133274))[_0xdae5('0x48')](APIHandleError(_0x2e288f));};exports[_0xdae5('0x49')]=function(_0x91e360,_0x12907d){var _0x199396={'count':0x0,'rows':[]};var _0xaa19c4={};var _0x4e1164;var _0x58ab47;var _0x1f9800;Promise[_0xdae5('0x15')]()[_0xdae5('0x16')](function(){if(_0x91e360['query'][_0xdae5('0x17')]){if(!utils[_0xdae5('0x18')](_0x91e360[_0xdae5('0xf')]['channel'])){throw new APIBadRequestError(util['format'](_0xdae5('0x19'),_0x91e360[_0xdae5('0xf')][_0xdae5('0x17')]));}_0x4e1164=_0x91e360[_0xdae5('0xf')][_0xdae5('0x17')]['toLowerCase']();}var _0x211a55=_[_0xdae5('0x4a')](_0x4e1164)+_0xdae5('0x4b');var _0x34c9cb=_[_0xdae5('0x27')](db[_0x211a55][_0xdae5('0x29')],function(_0x571212){return{'name':_0x571212[_0xdae5('0x2a')],'type':_0x571212[_0xdae5('0x2b')][_0xdae5('0x2c')]};});if(!_0x91e360[_0xdae5('0xf')][_0xdae5('0x1e')]){var _0xf2587a=['id',_0xdae5('0x4c')];if(_0x4e1164===_0xdae5('0x4d')){_0xf2587a[_0xdae5('0x35')](_0xdae5('0x2b'));if(_0x91e360[_0xdae5('0xf')]['type']===_0xdae5('0x4e')){_0xf2587a['push']([_0xdae5('0x4f'),_0xdae5('0x50')]);}}_0x91e360[_0xdae5('0xf')][_0xdae5('0x1e')]=_0xf2587a['join'](',');}_0xaa19c4=qs[_0xdae5('0x2f')](_0x34c9cb,_0x91e360);if(_0x91e360['user'][_0xdae5('0x2d')]===_0xdae5('0x39')){var _0xdfa7={'params':{'id':_0x91e360[_0xdae5('0x39')][_0xdae5('0x3a')]},'query':{'section':_0x4e1164===_0xdae5('0x4d')&&_0x91e360[_0xdae5('0xf')][_0xdae5('0x2b')]===_0xdae5('0x4e')?_0xdae5('0x51'):_[_0xdae5('0x4a')](_0x4e1164)+'Queues','type':_0x91e360[_0xdae5('0xf')][_0xdae5('0x2b')],'nolimit':!![],'sort':'name','filter':_0x91e360['query'][_0xdae5('0x52')]}};_0xdfa7['query']=Object[_0xdae5('0x3d')](_0xdfa7[_0xdae5('0xf')],_0x91e360['query']);delete _0xdfa7[_0xdae5('0xf')]['id'];return db[_0xdae5('0x3e')][_0xdae5('0x3f')](_0xdfa7);}return db[_0x211a55][_0xdae5('0x40')](_0xaa19c4);})[_0xdae5('0x16')](function(_0x46fc40){_0x199396[_0xdae5('0x41')]=_0x46fc40[_0xdae5('0x41')];_0x58ab47=_0x46fc40[_0xdae5('0x23')];return rtq[_0xdae5('0x53')](_0x91e360,_0x4e1164);})['then'](function(_0x261381){_0x1f9800=_0x261381[_0xdae5('0x23')];return rtq['initializeQueues'](_0x58ab47,_0x1f9800,_0x4e1164,_0x91e360[_0xdae5('0xf')]['type']);})[_0xdae5('0x16')](function(_0x5536a0){_0x199396[_0xdae5('0x23')]=_0x5536a0;return _0x199396;})[_0xdae5('0x16')](respondWithFilteredResult(_0x12907d,_0xaa19c4))[_0xdae5('0x48')](APIHandleError(_0x12907d));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 36b56cf..c14d822 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4f9728,_0x335ce6){var _0xc35c31=function(_0x555abc){while(--_0x555abc){_0x4f9728['push'](_0x4f9728['shift']());}};_0xc35c31(++_0x335ce6);}(_0x70e0,0x17b));var _0x070e=function(_0xd2b92a,_0x3470d3){_0xd2b92a=_0xd2b92a-0x0;var _0x10e859=_0x70e0[_0xd2b92a];return _0x10e859;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xc5c9ac,_0x57c492){var _0x3f4606=function(_0x2aa448){while(--_0x2aa448){_0xc5c9ac['push'](_0xc5c9ac['shift']());}};_0x3f4606(++_0x57c492);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 2771b5e..0e12f39 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.attributes.js +++ b/server/api/reportAgentPreview/reportAgentPreview.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x482d=['DATE','INTEGER','STRING'];(function(_0x97c6ea,_0x4cffce){var _0x2d7f50=function(_0x54010e){while(--_0x54010e){_0x97c6ea['push'](_0x97c6ea['shift']());}};_0x2d7f50(++_0x4cffce);}(_0x482d,0x16c));var _0xd482=function(_0x3d0c38,_0x1efd38){_0x3d0c38=_0x3d0c38-0x0;var _0x27e4af=_0x482d[_0x3d0c38];return _0x27e4af;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0xd482('0x0')](0x2)},'statedesc':{'type':Sequelize[_0xd482('0x1')]},'scheduledat':{'type':Sequelize[_0xd482('0x2')]},'uniqueid':{'type':Sequelize[_0xd482('0x1')]},'starttime':{'type':Sequelize[_0xd482('0x2')]},'responsetime':{'type':Sequelize[_0xd482('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xd482('0x1')]},'campaigntype':{'type':Sequelize[_0xd482('0x1')]},'membername':{'type':Sequelize[_0xd482('0x1')]}}; \ No newline at end of file +var _0x0b3d=['DATE','STRING','sequelize','INTEGER'];(function(_0x418432,_0x537680){var _0x3023a9=function(_0x1c42d0){while(--_0x1c42d0){_0x418432['push'](_0x418432['shift']());}};_0x3023a9(++_0x537680);}(_0x0b3d,0x76));var _0xd0b3=function(_0x573325,_0x2f2fa5){_0x573325=_0x573325-0x0;var _0x1987bb=_0x0b3d[_0x573325];return _0x1987bb;};'use strict';var Sequelize=require(_0xd0b3('0x0'));module['exports']={'state':{'type':Sequelize[_0xd0b3('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xd0b3('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd0b3('0x2')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xd0b3('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xd0b3('0x3')]},'membername':{'type':Sequelize[_0xd0b3('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 44b7abf..95b5e84 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.model.js +++ b/server/api/reportAgentPreview/reportAgentPreview.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x275d=['request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','lodash','util','api','moment','bluebird'];(function(_0x53be66,_0x9ec3be){var _0x9e5520=function(_0x5c4742){while(--_0x5c4742){_0x53be66['push'](_0x53be66['shift']());}};_0x9e5520(++_0x9ec3be);}(_0x275d,0x126));var _0xd275=function(_0x204ad4,_0x502841){_0x204ad4=_0x204ad4-0x0;var _0x50675f=_0x275d[_0x204ad4];return _0x50675f;};'use strict';var _=require(_0xd275('0x0'));var util=require(_0xd275('0x1'));var logger=require('../../config/logger')(_0xd275('0x2'));var moment=require(_0xd275('0x3'));var BPromise=require(_0xd275('0x4'));var rp=require(_0xd275('0x5'));var fs=require('fs');var path=require(_0xd275('0x6'));var rimraf=require(_0xd275('0x7'));var config=require(_0xd275('0x8'));var attributes=require(_0xd275('0x9'));module['exports']=function(_0x5a2c12,_0x474316){return _0x5a2c12[_0xd275('0xa')](_0xd275('0xb'),attributes,{'tableName':_0xd275('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff9c=['moment','request-promise','path','../../config/environment','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0xff9c,0x15d));var _0xcff9=function(_0x38d082,_0x17c03c){_0x38d082=_0x38d082-0x0;var _0xfc4cb9=_0xff9c[_0x38d082];return _0xfc4cb9;};'use strict';var _=require(_0xcff9('0x0'));var util=require(_0xcff9('0x1'));var logger=require(_0xcff9('0x2'))('api');var moment=require(_0xcff9('0x3'));var BPromise=require('bluebird');var rp=require(_0xcff9('0x4'));var fs=require('fs');var path=require(_0xcff9('0x5'));var rimraf=require('rimraf');var config=require(_0xcff9('0x6'));var attributes=require('./reportAgentPreview.attributes');module[_0xcff9('0x7')]=function(_0x4c5e91,_0x45f64){return _0x4c5e91[_0xcff9('0x8')](_0xcff9('0x9'),attributes,{'tableName':_0xcff9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index dbeedde..9b08506 100644 --- a/server/api/reportAgentPreview/reportAgentPreview.rpc.js +++ b/server/api/reportAgentPreview/reportAgentPreview.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6708=['jayson/promise','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','CreateReportAgentPreview','ReportAgentPreview','body','options','then','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x48881b,_0x2e62bb){var _0x1c2b1d=function(_0x194519){while(--_0x194519){_0x48881b['push'](_0x48881b['shift']());}};_0x1c2b1d(++_0x2e62bb);}(_0x6708,0x1ec));var _0x8670=function(_0x143e9c,_0x2fecc0){_0x143e9c=_0x143e9c-0x0;var _0x10266d=_0x6708[_0x143e9c];return _0x10266d;};'use strict';var _=require(_0x8670('0x0'));var util=require('util');var moment=require(_0x8670('0x1'));var BPromise=require('bluebird');var rs=require(_0x8670('0x2'));var fs=require('fs');var Redis=require(_0x8670('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8670('0x4'));var logger=require(_0x8670('0x5'))(_0x8670('0x6'));var config=require(_0x8670('0x7'));var jayson=require(_0x8670('0x8'));var client=jayson[_0x8670('0x9')][_0x8670('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32be40,_0x344399,_0x543429){return new BPromise(function(_0x42a2db,_0x3c513e){return client[_0x8670('0xb')](_0x32be40,_0x543429)['then'](function(_0x1a816d){logger[_0x8670('0xc')](_0x8670('0xd'),_0x344399,_0x8670('0xe'));logger[_0x8670('0xf')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x344399,_0x8670('0xe'),JSON[_0x8670('0x10')](_0x1a816d));if(_0x1a816d['error']){if(_0x1a816d[_0x8670('0x11')]['code']===0x1f4){logger[_0x8670('0x11')](_0x8670('0xd'),_0x344399,_0x1a816d[_0x8670('0x11')][_0x8670('0x12')]);return _0x3c513e(_0x1a816d[_0x8670('0x11')][_0x8670('0x12')]);}logger['error'](_0x8670('0xd'),_0x344399,_0x1a816d[_0x8670('0x11')][_0x8670('0x12')]);return _0x42a2db(_0x1a816d['error']['message']);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x344399,_0x8670('0xe'));_0x42a2db(_0x1a816d[_0x8670('0x13')][_0x8670('0x12')]);}})['catch'](function(_0x3686be){logger[_0x8670('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x344399,_0x3686be);_0x3c513e(_0x3686be);});});}exports[_0x8670('0x14')]=function(_0x22951c){var _0x399772=this;return new Promise(function(_0xcf37e3,_0x525e03){return db[_0x8670('0x15')]['create'](_0x22951c[_0x8670('0x16')],{'raw':_0x22951c[_0x8670('0x17')]?_0x22951c['options']['raw']===undefined?!![]:![]:!![]})[_0x8670('0x18')](function(_0x39be9f){logger[_0x8670('0xc')]('CreateReportAgentPreview',_0x22951c);logger['debug'](_0x8670('0x14'),_0x22951c,JSON['stringify'](_0x39be9f));_0xcf37e3(_0x39be9f);})['catch'](function(_0x4df2f3){logger['error'](_0x8670('0x14'),_0x4df2f3[_0x8670('0x12')],_0x22951c);_0x525e03(_0x399772['error'](0x1f4,_0x4df2f3[_0x8670('0x12')]));});});}; \ No newline at end of file +var _0x3182=['http','request','then','info','request\x20sent','debug','stringify','error','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','CreateReportAgentPreview','create','body','options','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x53a7a8,_0xed2bff){var _0x555f71=function(_0x48e696){while(--_0x48e696){_0x53a7a8['push'](_0x53a7a8['shift']());}};_0x555f71(++_0xed2bff);}(_0x3182,0x1d2));var _0x2318=function(_0x307545,_0x3bfc2f){_0x307545=_0x307545-0x0;var _0x5d4f36=_0x3182[_0x307545];return _0x5d4f36;};'use strict';var _=require('lodash');var util=require(_0x2318('0x0'));var moment=require(_0x2318('0x1'));var BPromise=require(_0x2318('0x2'));var rs=require(_0x2318('0x3'));var fs=require('fs');var Redis=require(_0x2318('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2318('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2318('0x6'));var jayson=require(_0x2318('0x7'));var client=jayson[_0x2318('0x8')][_0x2318('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ab872,_0xfc75dc,_0x13af7e){return new BPromise(function(_0x58c67,_0x58bbac){return client[_0x2318('0xa')](_0x3ab872,_0x13af7e)[_0x2318('0xb')](function(_0x30c47b){logger[_0x2318('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0xfc75dc,_0x2318('0xd'));logger[_0x2318('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0xfc75dc,'request\x20sent',JSON[_0x2318('0xf')](_0x30c47b));if(_0x30c47b[_0x2318('0x10')]){if(_0x30c47b[_0x2318('0x10')]['code']===0x1f4){logger[_0x2318('0x10')](_0x2318('0x11'),_0xfc75dc,_0x30c47b[_0x2318('0x10')]['message']);return _0x58bbac(_0x30c47b[_0x2318('0x10')][_0x2318('0x12')]);}logger['error'](_0x2318('0x11'),_0xfc75dc,_0x30c47b['error'][_0x2318('0x12')]);return _0x58c67(_0x30c47b['error'][_0x2318('0x12')]);}else{logger[_0x2318('0xc')](_0x2318('0x11'),_0xfc75dc,_0x2318('0xd'));_0x58c67(_0x30c47b[_0x2318('0x13')][_0x2318('0x12')]);}})[_0x2318('0x14')](function(_0x24d930){logger['error'](_0x2318('0x11'),_0xfc75dc,_0x24d930);_0x58bbac(_0x24d930);});});}exports[_0x2318('0x15')]=function(_0x488ab7){var _0x336d7b=this;return new Promise(function(_0x3c032c,_0x5090c8){return db['ReportAgentPreview'][_0x2318('0x16')](_0x488ab7[_0x2318('0x17')],{'raw':_0x488ab7[_0x2318('0x18')]?_0x488ab7[_0x2318('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x2318('0xb')](function(_0x55519f){logger[_0x2318('0xc')]('CreateReportAgentPreview',_0x488ab7);logger[_0x2318('0xe')](_0x2318('0x15'),_0x488ab7,JSON[_0x2318('0xf')](_0x55519f));_0x3c032c(_0x55519f);})[_0x2318('0x14')](function(_0x5e8a66){logger['error']('CreateReportAgentPreview',_0x5e8a66[_0x2318('0x12')],_0x488ab7);_0x5090c8(_0x336d7b[_0x2318('0x10')](0x1f4,_0x5e8a66[_0x2318('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 0332bb3..d3b0a2f 100644 --- a/server/api/rpc/index.js +++ b/server/api/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c40=['/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/trunks','/campaigns','campaigns','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','path','Router','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','get'];(function(_0x5e238b,_0x17ae49){var _0x389bea=function(_0x3cc1c1){while(--_0x3cc1c1){_0x5e238b['push'](_0x5e238b['shift']());}};_0x389bea(++_0x17ae49);}(_0x8c40,0x171));var _0x08c4=function(_0x150deb,_0x2383ba){_0x150deb=_0x150deb-0x0;var _0x5d5bfb=_0x8c40[_0x150deb];return _0x5d5bfb;};'use strict';var multer=require(_0x08c4('0x0'));var util=require(_0x08c4('0x1'));var path=require(_0x08c4('0x2'));var express=require('express');var router=express[_0x08c4('0x3')]();var auth=require(_0x08c4('0x4'));var controller=require(_0x08c4('0x5'));router['get'](_0x08c4('0x6'),auth[_0x08c4('0x7')](),controller[_0x08c4('0x8')]);router['get'](_0x08c4('0x9'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0x08c4('0xa')](_0x08c4('0xb'),auth[_0x08c4('0x7')](),controller[_0x08c4('0xc')]);router['get']('/voice/queues',auth[_0x08c4('0x7')](),controller[_0x08c4('0xd')]);router[_0x08c4('0xa')](_0x08c4('0xe'),auth[_0x08c4('0x7')](),controller[_0x08c4('0xf')]);router[_0x08c4('0xa')]('/mail/queues',auth[_0x08c4('0x7')](),controller['mailQueues']);router[_0x08c4('0xa')]('/mail/accounts',auth[_0x08c4('0x7')](),controller[_0x08c4('0x10')]);router['get']('/openchannel/queues',auth[_0x08c4('0x7')](),controller[_0x08c4('0x11')]);router[_0x08c4('0xa')](_0x08c4('0x12'),auth[_0x08c4('0x7')](),controller[_0x08c4('0x13')]);router[_0x08c4('0xa')](_0x08c4('0x14'),auth[_0x08c4('0x7')](),controller[_0x08c4('0x15')]);router['get'](_0x08c4('0x16'),auth[_0x08c4('0x7')](),controller['faxQueues']);router['get']('/voice/queues/preview/:id',auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0x08c4('0xa')](_0x08c4('0x17'),auth[_0x08c4('0x7')](),controller['voiceQueuesChannels']);router['get'](_0x08c4('0x18'),auth['isAuthenticated'](),controller[_0x08c4('0x19')]);router[_0x08c4('0xa')](_0x08c4('0x1a'),auth['isAuthenticated'](),controller[_0x08c4('0x1b')]);router[_0x08c4('0xa')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x08c4('0x7')](),controller[_0x08c4('0x1c')]);router[_0x08c4('0xa')](_0x08c4('0x1d'),auth[_0x08c4('0x7')](),controller[_0x08c4('0x1e')]);router[_0x08c4('0x1f')]('/voice/queues/:id',auth[_0x08c4('0x7')](),controller['updateVoiceQueue']);router[_0x08c4('0xa')]('/outbound',auth['isAuthenticated'](),controller['outbound']);router[_0x08c4('0xa')]('/outbound/channels',auth[_0x08c4('0x7')](),controller[_0x08c4('0x20')]);router[_0x08c4('0xa')](_0x08c4('0x21'),auth[_0x08c4('0x7')](),controller[_0x08c4('0x22')]);router[_0x08c4('0x1f')](_0x08c4('0x23'),auth[_0x08c4('0x7')](),controller[_0x08c4('0x24')]);router[_0x08c4('0xa')]('/telephones',auth[_0x08c4('0x7')](),controller['telephones']);router['get'](_0x08c4('0x25'),auth['isAuthenticated'](),controller['trunks']);router['get'](_0x08c4('0x26'),auth[_0x08c4('0x7')](),controller[_0x08c4('0x27')]);router['get']('/fax/accounts',auth['isAuthenticated'](),controller[_0x08c4('0x28')]);router['get']('/chat/queues/waitinginteractions',auth[_0x08c4('0x7')](),controller[_0x08c4('0x29')]);router['get'](_0x08c4('0x2a'),auth['isAuthenticated'](),controller[_0x08c4('0x2b')]);router[_0x08c4('0xa')](_0x08c4('0x2c'),auth['isAuthenticated'](),controller[_0x08c4('0x2d')]);router[_0x08c4('0xa')](_0x08c4('0x2e'),auth['isAuthenticated'](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x08c4('0xa')](_0x08c4('0x2f'),auth['isAuthenticated'](),controller[_0x08c4('0x30')]);router['get'](_0x08c4('0x31'),auth['isAuthenticated'](),controller[_0x08c4('0x32')]);router[_0x08c4('0xa')](_0x08c4('0x33'),auth[_0x08c4('0x7')](),controller[_0x08c4('0x34')]);router[_0x08c4('0x35')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller[_0x08c4('0x36')]('mail'));router['get']('/mail/queues/:id',auth['isAuthenticated'](),controller['showMailQueues']);router[_0x08c4('0x35')](_0x08c4('0x37'),auth[_0x08c4('0x7')](),controller[_0x08c4('0x36')](_0x08c4('0x38')));router[_0x08c4('0xa')](_0x08c4('0x39'),auth[_0x08c4('0x7')](),controller[_0x08c4('0x3a')]);router[_0x08c4('0x35')](_0x08c4('0x3b'),auth[_0x08c4('0x7')](),controller[_0x08c4('0x36')](_0x08c4('0x3c')));router['get'](_0x08c4('0x3d'),auth['isAuthenticated'](),controller[_0x08c4('0x3e')]);router[_0x08c4('0x35')](_0x08c4('0x3f'),auth['isAuthenticated'](),controller['queueNotify'](_0x08c4('0x40')));router[_0x08c4('0xa')](_0x08c4('0x41'),auth[_0x08c4('0x7')](),controller[_0x08c4('0x42')]);router[_0x08c4('0x35')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0x08c4('0x36')](_0x08c4('0x43')));router[_0x08c4('0x35')](_0x08c4('0x44'),auth[_0x08c4('0x7')](),controller[_0x08c4('0x36')](_0x08c4('0x45')));router[_0x08c4('0xa')](_0x08c4('0x46'),auth[_0x08c4('0x7')](),controller[_0x08c4('0x47')]);router['get'](_0x08c4('0x48'),auth[_0x08c4('0x7')](),controller[_0x08c4('0x49')]);router['post'](_0x08c4('0x4a'),auth[_0x08c4('0x7')](),controller[_0x08c4('0x4b')]);module['exports']=router; \ No newline at end of file +var _0xe7c9=['/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/accounts','mailAccounts','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','outboundChannels','agents','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','chat','/chat/queues/:id','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe7c9,0x14b));var _0x9e7c=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xe7c9[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0x9e7c('0x0'));var util=require(_0x9e7c('0x1'));var path=require(_0x9e7c('0x2'));var express=require(_0x9e7c('0x3'));var router=express[_0x9e7c('0x4')]();var auth=require(_0x9e7c('0x5'));var controller=require(_0x9e7c('0x6'));router[_0x9e7c('0x7')](_0x9e7c('0x8'),auth[_0x9e7c('0x9')](),controller['voiceChannels']);router['get']('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0x9e7c('0xa')]);router[_0x9e7c('0x7')](_0x9e7c('0xb'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0xc')]);router[_0x9e7c('0x7')](_0x9e7c('0xd'),auth['isAuthenticated'](),controller[_0x9e7c('0xe')]);router[_0x9e7c('0x7')](_0x9e7c('0xf'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x10')]);router['get']('/mail/queues',auth['isAuthenticated'](),controller['mailQueues']);router[_0x9e7c('0x7')](_0x9e7c('0x11'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x12')]);router[_0x9e7c('0x7')]('/openchannel/queues',auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x13')]);router[_0x9e7c('0x7')]('/sms/queues',auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x14')]);router['get'](_0x9e7c('0x15'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x16')]);router['get'](_0x9e7c('0x17'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x18')]);router['get'](_0x9e7c('0x19'),auth['isAuthenticated'](),controller[_0x9e7c('0x1a')]);router['get'](_0x9e7c('0x1b'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x1c')]);router[_0x9e7c('0x7')](_0x9e7c('0x1d'),auth['isAuthenticated'](),controller[_0x9e7c('0x1e')]);router[_0x9e7c('0x7')](_0x9e7c('0x1f'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x20')]);router[_0x9e7c('0x7')](_0x9e7c('0x21'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x9e7c('0x7')](_0x9e7c('0x22'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x23')]);router[_0x9e7c('0x24')]('/voice/queues/:id',auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x25')]);router[_0x9e7c('0x7')]('/outbound',auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x26')]);router[_0x9e7c('0x7')]('/outbound/channels',auth['isAuthenticated'](),controller[_0x9e7c('0x27')]);router[_0x9e7c('0x7')]('/agents',auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x28')]);router[_0x9e7c('0x24')](_0x9e7c('0x29'),auth['isAuthenticated'](),controller['agentCapacity']);router['get'](_0x9e7c('0x2a'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x2b')]);router[_0x9e7c('0x7')](_0x9e7c('0x2c'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x2d')]);router[_0x9e7c('0x7')](_0x9e7c('0x2e'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x2f')]);router[_0x9e7c('0x7')](_0x9e7c('0x30'),auth[_0x9e7c('0x9')](),controller['faxAccounts']);router[_0x9e7c('0x7')](_0x9e7c('0x31'),auth['isAuthenticated'](),controller[_0x9e7c('0x32')]);router['get'](_0x9e7c('0x33'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x34')]);router[_0x9e7c('0x7')](_0x9e7c('0x35'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x36')]);router[_0x9e7c('0x7')](_0x9e7c('0x37'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x38')]);router[_0x9e7c('0x7')](_0x9e7c('0x39'),auth[_0x9e7c('0x9')](),controller['smsQueuesWaitingInteractions']);router[_0x9e7c('0x7')](_0x9e7c('0x3a'),auth['isAuthenticated'](),controller[_0x9e7c('0x3b')]);router[_0x9e7c('0x7')](_0x9e7c('0x3c'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x3d')]);router[_0x9e7c('0x3e')](_0x9e7c('0x3f'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x40')](_0x9e7c('0x41')));router[_0x9e7c('0x7')](_0x9e7c('0x42'),auth[_0x9e7c('0x9')](),controller['showMailQueues']);router[_0x9e7c('0x3e')]('/chat/queues/:id/notify',auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x40')](_0x9e7c('0x43')));router[_0x9e7c('0x7')](_0x9e7c('0x44'),auth['isAuthenticated'](),controller['showChatQueues']);router[_0x9e7c('0x3e')](_0x9e7c('0x45'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x40')]('fax'));router[_0x9e7c('0x7')](_0x9e7c('0x46'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x47')]);router[_0x9e7c('0x3e')](_0x9e7c('0x48'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x40')](_0x9e7c('0x49')));router['get'](_0x9e7c('0x4a'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x4b')]);router['post'](_0x9e7c('0x4c'),auth[_0x9e7c('0x9')](),controller['queueNotify'](_0x9e7c('0x4d')));router[_0x9e7c('0x3e')](_0x9e7c('0x4e'),auth['isAuthenticated'](),controller[_0x9e7c('0x40')](_0x9e7c('0x4f')));router[_0x9e7c('0x7')](_0x9e7c('0x50'),auth[_0x9e7c('0x9')](),controller['showSmsQueues']);router[_0x9e7c('0x7')](_0x9e7c('0x51'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x52')]);router[_0x9e7c('0x3e')](_0x9e7c('0x53'),auth[_0x9e7c('0x9')](),controller[_0x9e7c('0x54')]);module[_0x9e7c('0x55')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index a861ff4..e3b4768 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x4e79c2,_0x20f578){var _0x348467=function(_0x3a5986){while(--_0x3a5986){_0x4e79c2['push'](_0x4e79c2['shift']());}};_0x348467(++_0x20f578);}(_0xe706,0xa3));var _0x6e70=function(_0x446970,_0x2e8abc){_0x446970=_0x446970-0x0;var _0xccb49a=_0xe706[_0x446970];return _0xccb49a;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file +var _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x2c6f32,_0x5eb233){var _0x48326e=function(_0x225c7d){while(--_0x225c7d){_0x2c6f32['push'](_0x2c6f32['shift']());}};_0x48326e(++_0x5eb233);}(_0xe706,0xa3));var _0x6e70=function(_0x5bc27a,_0x32e2d1){_0x5bc27a=_0x5bc27a-0x0;var _0x2c8a4d=_0xe706[_0x5bc27a];return _0x2c8a4d;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 7127b97..c0ca56a 100644 --- a/server/api/schedule/index.js +++ b/server/api/schedule/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbe8=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','index','get','/:id','show','/:id/run','isAuthenticated','post','put','update','delete','destroy','exports','multer','util'];(function(_0x31bd8b,_0x56fa02){var _0x1506e4=function(_0x51e54d){while(--_0x51e54d){_0x31bd8b['push'](_0x31bd8b['shift']());}};_0x1506e4(++_0x56fa02);}(_0xcbe8,0x18d));var _0x8cbe=function(_0xa11539,_0x10a9d3){_0xa11539=_0xa11539-0x0;var _0xbe0b9a=_0xcbe8[_0xa11539];return _0xbe0b9a;};'use strict';var multer=require(_0x8cbe('0x0'));var util=require(_0x8cbe('0x1'));var path=require('path');var timeout=require(_0x8cbe('0x2'));var express=require('express');var router=express[_0x8cbe('0x3')]();var fs_extra=require(_0x8cbe('0x4'));var auth=require(_0x8cbe('0x5'));var interaction=require(_0x8cbe('0x6'));var config=require(_0x8cbe('0x7'));var controller=require(_0x8cbe('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x8cbe('0x9')]);router[_0x8cbe('0xa')](_0x8cbe('0xb'),auth['isAuthenticated'](),controller[_0x8cbe('0xc')]);router[_0x8cbe('0xa')](_0x8cbe('0xd'),auth[_0x8cbe('0xe')](),controller['run']);router[_0x8cbe('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8cbe('0x10')](_0x8cbe('0xb'),auth['isAuthenticated'](),controller[_0x8cbe('0x11')]);router[_0x8cbe('0x12')](_0x8cbe('0xb'),auth[_0x8cbe('0xe')](),controller[_0x8cbe('0x13')]);module[_0x8cbe('0x14')]=router; \ No newline at end of file +var _0xe217=['util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./schedule.controller','index','get','isAuthenticated','show','/:id/run','run','post','create','put','/:id','destroy','exports','multer'];(function(_0x196346,_0xabe496){var _0x8548b5=function(_0x10f8f4){while(--_0x10f8f4){_0x196346['push'](_0x196346['shift']());}};_0x8548b5(++_0xabe496);}(_0xe217,0x1cd));var _0x7e21=function(_0x327d30,_0x4fe81c){_0x327d30=_0x327d30-0x0;var _0x5121f9=_0xe217[_0x327d30];return _0x5121f9;};'use strict';var multer=require(_0x7e21('0x0'));var util=require(_0x7e21('0x1'));var path=require(_0x7e21('0x2'));var timeout=require(_0x7e21('0x3'));var express=require(_0x7e21('0x4'));var router=express[_0x7e21('0x5')]();var fs_extra=require(_0x7e21('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7e21('0x7'));var controller=require(_0x7e21('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7e21('0x9')]);router[_0x7e21('0xa')]('/:id',auth[_0x7e21('0xb')](),controller[_0x7e21('0xc')]);router[_0x7e21('0xa')](_0x7e21('0xd'),auth[_0x7e21('0xb')](),controller[_0x7e21('0xe')]);router[_0x7e21('0xf')]('/',auth[_0x7e21('0xb')](),controller[_0x7e21('0x10')]);router[_0x7e21('0x11')](_0x7e21('0x12'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7e21('0x12'),auth['isAuthenticated'](),controller[_0x7e21('0x13')]);module[_0x7e21('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 55f1fef..2b07032 100644 --- a/server/api/schedule/schedule.attributes.js +++ b/server/api/schedule/schedule.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2844=['exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','months','weeks','days','hours','minutes','csv','pdf','default','TEXT'];(function(_0x3bd931,_0x205695){var _0x2744e0=function(_0x37ce87){while(--_0x37ce87){_0x3bd931['push'](_0x3bd931['shift']());}};_0x2744e0(++_0x205695);}(_0x2844,0xaa));var _0x4284=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x2844[_0xb0f7c3];return _0x28ea68;};'use strict';var Sequelize=require('sequelize');module[_0x4284('0x0')]={'name':{'type':Sequelize[_0x4284('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4284('0x1')]},'active':{'type':Sequelize[_0x4284('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4284('0x3')},'startAt':{'type':Sequelize[_0x4284('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x4284('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x4284('0x5')](_0x4284('0x6'),_0x4284('0x7'),_0x4284('0x8'),_0x4284('0x9'),_0x4284('0xa'),_0x4284('0xb'),_0x4284('0xc')),'allowNull':![],'defaultValue':_0x4284('0xa')},'output':{'type':Sequelize[_0x4284('0x5')](_0x4284('0xd'),_0x4284('0xe'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x4284('0x5')]('custom',_0x4284('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x4284('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x4284('0x1')]},'cc':{'type':Sequelize[_0x4284('0x10')]},'bcc':{'type':Sequelize[_0x4284('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x4284('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x20a7=['ENUM','years','quarters','weeks','days','csv','pdf','xlsx','custom','BOOLEAN','TEXT','sequelize','exports','STRING','DATE'];(function(_0x5d1a82,_0x2b1fb0){var _0x42dbac=function(_0x3bb4b0){while(--_0x3bb4b0){_0x5d1a82['push'](_0x5d1a82['shift']());}};_0x42dbac(++_0x2b1fb0);}(_0x20a7,0x1af));var _0x720a=function(_0x394ea8,_0x141623){_0x394ea8=_0x394ea8-0x0;var _0x4e1b48=_0x20a7[_0x394ea8];return _0x4e1b48;};'use strict';var Sequelize=require(_0x720a('0x0'));module[_0x720a('0x1')]={'name':{'type':Sequelize[_0x720a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x720a('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x720a('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x720a('0x4')](_0x720a('0x5'),_0x720a('0x6'),'months',_0x720a('0x7'),_0x720a('0x8'),'hours','minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x720a('0x4')](_0x720a('0x9'),_0x720a('0xa'),_0x720a('0xb')),'allowNull':![],'defaultValue':_0x720a('0x9')},'type':{'type':Sequelize[_0x720a('0x4')](_0x720a('0xc'),'default'),'allowNull':![],'defaultValue':_0x720a('0xc')},'sendMail':{'type':Sequelize[_0x720a('0xd')],'defaultValue':![]},'email':{'type':Sequelize[_0x720a('0x2')]},'cc':{'type':Sequelize[_0x720a('0xe')]},'bcc':{'type':Sequelize[_0x720a('0xe')]},'sendIfEmpty':{'type':Sequelize[_0x720a('0xd')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 3cf566e..a439117 100644 --- a/server/api/schedule/schedule.controller.js +++ b/server/api/schedule/schedule.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa04b=['update','then','destroy','Scheduler','UserProfileResource','sendStatus','stack','name','send','index','map','Schedule','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','error','run','../../config/schedule','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','save'];(function(_0x43da39,_0x35bb58){var _0x54959e=function(_0x23ba2e){while(--_0x23ba2e){_0x43da39['push'](_0x43da39['shift']());}};_0x54959e(++_0x35bb58);}(_0xa04b,0x12e));var _0xba04=function(_0x157f6f,_0x140aa5){_0x157f6f=_0x157f6f-0x0;var _0x3ddb2d=_0xa04b[_0x157f6f];return _0x3ddb2d;};'use strict';var emlformat=require(_0xba04('0x0'));var rimraf=require(_0xba04('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba04('0x2'));var rp=require(_0xba04('0x3'));var moment=require(_0xba04('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xba04('0x5'));var path=require(_0xba04('0x6'));var sox=require(_0xba04('0x7'));var csv=require(_0xba04('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba04('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xba04('0xa'));var jsforce=require(_0xba04('0xb'));var deskjs=require(_0xba04('0xc'));var toCsv=require('to-csv');var querystring=require(_0xba04('0xd'));var Papa=require(_0xba04('0xe'));var Redis=require(_0xba04('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xba04('0x10'));var as=require(_0xba04('0x11'));var hardwareService=require(_0xba04('0x12'));var logger=require(_0xba04('0x13'))('api');var utils=require(_0xba04('0x14'));var config=require(_0xba04('0x15'));var licenseUtil=require(_0xba04('0x16'));var db=require(_0xba04('0x17'))['db'];function respondWithStatusCode(_0x417eec,_0x569e81){_0x569e81=_0x569e81||0xcc;return function(_0x3578cd){if(_0x3578cd){return _0x417eec['sendStatus'](_0x569e81);}return _0x417eec[_0xba04('0x18')](_0x569e81)[_0xba04('0x19')]();};}function respondWithResult(_0x5e6ece,_0x593058){_0x593058=_0x593058||0xc8;return function(_0x2ad405){if(_0x2ad405){return _0x5e6ece[_0xba04('0x18')](_0x593058)[_0xba04('0x1a')](_0x2ad405);}};}function respondWithFilteredResult(_0x1dc407,_0x14e501){return function(_0x18466e){if(_0x18466e){var _0xc8c54e=typeof _0x14e501[_0xba04('0x1b')]===_0xba04('0x1c')&&typeof _0x14e501['limit']===_0xba04('0x1c');var _0x23075b=_0x18466e[_0xba04('0x1d')];var _0x36453d=_0xc8c54e?0x0:_0x14e501['offset'];var _0x1cb82c=_0xc8c54e?_0x18466e[_0xba04('0x1d')]:_0x14e501['offset']+_0x14e501['limit'];var _0x1ef2fc;if(_0x1cb82c>=_0x23075b){_0x1cb82c=_0x23075b;_0x1ef2fc=0xc8;}else{_0x1ef2fc=0xce;}_0x1dc407[_0xba04('0x18')](_0x1ef2fc);return _0x1dc407[_0xba04('0x1e')](_0xba04('0x1f'),_0x36453d+'-'+_0x1cb82c+'/'+_0x23075b)[_0xba04('0x1a')](_0x18466e);}return null;};}function patchUpdates(_0x39eda8){return function(_0x3c5e0a){try{jsonpatch[_0xba04('0x20')](_0x3c5e0a,_0x39eda8,!![]);}catch(_0x12d76f){return BPromise['reject'](_0x12d76f);}return _0x3c5e0a[_0xba04('0x21')]();};}function saveUpdates(_0xfe7957,_0x12cb3f){return function(_0x229d80){if(_0x229d80){return _0x229d80[_0xba04('0x22')](_0xfe7957)[_0xba04('0x23')](function(_0x2f910c){return _0x2f910c;});}return null;};}function removeEntity(_0x3664fe,_0x322abb){return function(_0x51e46c){if(_0x51e46c){return _0x51e46c[_0xba04('0x24')]()['then'](function(){var _0x19e3e7=_0x51e46c['get']({'plain':!![]});var _0x3c4d31=_0xba04('0x25');return db[_0xba04('0x26')][_0xba04('0x24')]({'where':{'type':_0x3c4d31,'resourceId':_0x19e3e7['id']}})[_0xba04('0x23')](function(){return _0x51e46c;});})[_0xba04('0x23')](function(){_0x3664fe['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12da03,_0x5d9e48){return function(_0x49083c){if(!_0x49083c){_0x12da03[_0xba04('0x27')](0x194);}return _0x49083c;};}function handleError(_0x308c1a,_0x35fb3d){_0x35fb3d=_0x35fb3d||0x1f4;return function(_0x1ccfef){logger['error'](_0x1ccfef[_0xba04('0x28')]);if(_0x1ccfef[_0xba04('0x29')]){delete _0x1ccfef[_0xba04('0x29')];}_0x308c1a[_0xba04('0x18')](_0x35fb3d)[_0xba04('0x2a')](_0x1ccfef);};}exports[_0xba04('0x2b')]=function(_0x5e04ba,_0x3c5861){var _0x6958={},_0x306b23={},_0x42dcd2={'count':0x0,'rows':[]};var _0x2b4584=_[_0xba04('0x2c')](db[_0xba04('0x2d')][_0xba04('0x2e')],function(_0x52949c){return{'name':_0x52949c['fieldName'],'type':_0x52949c[_0xba04('0x2f')][_0xba04('0x30')]};});_0x306b23[_0xba04('0x31')]=_['map'](_0x2b4584,_0xba04('0x29'));_0x306b23[_0xba04('0x32')]=_[_0xba04('0x33')](_0x5e04ba[_0xba04('0x32')]);_0x306b23[_0xba04('0x34')]=_[_0xba04('0x35')](_0x306b23[_0xba04('0x31')],_0x306b23['query']);_0x6958[_0xba04('0x36')]=_[_0xba04('0x35')](_0x306b23[_0xba04('0x31')],qs[_0xba04('0x37')](_0x5e04ba[_0xba04('0x32')][_0xba04('0x37')]));_0x6958[_0xba04('0x36')]=_0x6958[_0xba04('0x36')]['length']?_0x6958['attributes']:_0x306b23[_0xba04('0x31')];if(!_0x5e04ba[_0xba04('0x32')][_0xba04('0x38')](_0xba04('0x39'))){_0x6958['limit']=qs[_0xba04('0x3a')](_0x5e04ba[_0xba04('0x32')]['limit']);_0x6958[_0xba04('0x1b')]=qs[_0xba04('0x1b')](_0x5e04ba[_0xba04('0x32')]['offset']);}_0x6958[_0xba04('0x3b')]=qs[_0xba04('0x3c')](_0x5e04ba[_0xba04('0x32')][_0xba04('0x3c')]);_0x6958[_0xba04('0x3d')]=qs[_0xba04('0x34')](_['pick'](_0x5e04ba[_0xba04('0x32')],_0x306b23['filters']),_0x2b4584);if(_0x5e04ba[_0xba04('0x32')][_0xba04('0x3e')]){_0x6958[_0xba04('0x3d')]=_[_0xba04('0x3f')](_0x6958[_0xba04('0x3d')],{'$or':_['map'](_0x2b4584,function(_0x2568ae){if(_0x2568ae[_0xba04('0x2f')]!==_0xba04('0x40')){var _0x2d63f9={};_0x2d63f9[_0x2568ae[_0xba04('0x29')]]={'$like':'%'+_0x5e04ba[_0xba04('0x32')][_0xba04('0x3e')]+'%'};return _0x2d63f9;}})});}_0x6958=_[_0xba04('0x3f')]({},_0x6958,_0x5e04ba[_0xba04('0x41')]);var _0x57d850={'where':_0x6958[_0xba04('0x3d')]};return db['Schedule']['count'](_0x57d850)[_0xba04('0x23')](function(_0x361960){_0x42dcd2[_0xba04('0x1d')]=_0x361960;if(_0x5e04ba[_0xba04('0x32')][_0xba04('0x42')]){_0x6958[_0xba04('0x43')]=[{'all':!![]}];}return db['Schedule'][_0xba04('0x44')](_0x6958);})[_0xba04('0x23')](function(_0x17d104){_0x42dcd2['rows']=_0x17d104;return _0x42dcd2;})[_0xba04('0x23')](respondWithFilteredResult(_0x3c5861,_0x6958))['catch'](handleError(_0x3c5861,null));};exports[_0xba04('0x45')]=function(_0x4c66cf,_0x43928a){var _0x4e1dab={'raw':![],'where':{'id':_0x4c66cf[_0xba04('0x46')]['id']}},_0xbca2c7={};_0xbca2c7['model']=_[_0xba04('0x33')](db['Schedule']['rawAttributes']);_0xbca2c7[_0xba04('0x32')]=_['keys'](_0x4c66cf['query']);_0xbca2c7[_0xba04('0x34')]=_['intersection'](_0xbca2c7[_0xba04('0x31')],_0xbca2c7[_0xba04('0x32')]);_0x4e1dab[_0xba04('0x36')]=_['intersection'](_0xbca2c7[_0xba04('0x31')],qs[_0xba04('0x37')](_0x4c66cf[_0xba04('0x32')][_0xba04('0x37')]));_0x4e1dab[_0xba04('0x36')]=_0x4e1dab[_0xba04('0x36')]['length']?_0x4e1dab[_0xba04('0x36')]:_0xbca2c7[_0xba04('0x31')];if(_0x4c66cf[_0xba04('0x32')]['includeAll']){_0x4e1dab['include']=[{'all':!![]}];}_0x4e1dab=_[_0xba04('0x3f')]({},_0x4e1dab,_0x4c66cf[_0xba04('0x41')]);return db['Schedule'][_0xba04('0x47')](_0x4e1dab)[_0xba04('0x23')](handleEntityNotFound(_0x43928a,null))['then'](respondWithResult(_0x43928a,null))[_0xba04('0x48')](handleError(_0x43928a,null));};exports[_0xba04('0x49')]=function(_0x4ee1b6,_0xad8f89){return db[_0xba04('0x2d')][_0xba04('0x49')](_0x4ee1b6[_0xba04('0x4a')],{})[_0xba04('0x23')](function(_0x197401){var _0xcaf351=_0x4ee1b6[_0xba04('0x4b')][_0xba04('0x4c')]({'plain':!![]});if(!_0xcaf351)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xcaf351[_0xba04('0x4d')]===_0xba04('0x4b')){var _0x467ed5=_0x197401[_0xba04('0x4c')]({'plain':!![]});var _0x4717d6=_0xba04('0x25');return db[_0xba04('0x4e')]['find']({'where':{'name':_0x4717d6,'userProfileId':_0xcaf351[_0xba04('0x4f')]},'raw':!![]})[_0xba04('0x23')](function(_0x191442){if(_0x191442&&_0x191442[_0xba04('0x50')]===0x0){return db['UserProfileResource'][_0xba04('0x49')]({'name':_0x467ed5[_0xba04('0x29')],'resourceId':_0x467ed5['id'],'type':_0x191442[_0xba04('0x29')],'sectionId':_0x191442['id']},{})['then'](function(){return _0x197401;});}else{return _0x197401;}})['catch'](function(_0x1a65ff){logger[_0xba04('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a65ff);throw _0x1a65ff;});}return _0x197401;})[_0xba04('0x23')](respondWithResult(_0xad8f89,0xc9))[_0xba04('0x48')](handleError(_0xad8f89,null));};exports[_0xba04('0x22')]=function(_0xe6399d,_0x3be390){if(_0xe6399d['body']['id']){delete _0xe6399d[_0xba04('0x4a')]['id'];}return db[_0xba04('0x2d')][_0xba04('0x47')]({'where':{'id':_0xe6399d[_0xba04('0x46')]['id']}})[_0xba04('0x23')](handleEntityNotFound(_0x3be390,null))['then'](saveUpdates(_0xe6399d[_0xba04('0x4a')],null))[_0xba04('0x23')](respondWithResult(_0x3be390,null))['catch'](handleError(_0x3be390,null));};exports[_0xba04('0x24')]=function(_0xd27b41,_0x2d7857){return db['Schedule']['find']({'where':{'id':_0xd27b41[_0xba04('0x46')]['id']}})['then'](handleEntityNotFound(_0x2d7857,null))['then'](removeEntity(_0x2d7857,null))['catch'](handleError(_0x2d7857,null));};exports[_0xba04('0x52')]=function(_0x27cd96,_0x12e5ca,_0x2dd540){var _0x4a3ebd=require(_0xba04('0x53'));return db[_0xba04('0x2d')][_0xba04('0x47')]({'where':{'id':_0x27cd96[_0xba04('0x46')]['id']},'raw':!![]})[_0xba04('0x23')](handleEntityNotFound(_0x12e5ca,null))[_0xba04('0x23')](function(){_0x4a3ebd['run'](_0x27cd96[_0xba04('0x46')]['id']);})[_0xba04('0x23')](respondWithStatusCode(_0x12e5ca,null))['catch'](handleError(_0x12e5ca,null));}; \ No newline at end of file +var _0x03f4=['key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','rows','show','params','Schedule','find','catch','create','body','role','UserProfileSection','userProfileId','autoAssociation','run','../../config/schedule','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','type'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x03f4,0xce));var _0x403f=function(_0xc3519a,_0x2bf606){_0xc3519a=_0xc3519a-0x0;var _0x1eda04=_0x03f4[_0xc3519a];return _0x1eda04;};'use strict';var emlformat=require(_0x403f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x403f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x403f('0x2'));var moment=require('moment');var BPromise=require(_0x403f('0x3'));var Mustache=require(_0x403f('0x4'));var util=require(_0x403f('0x5'));var path=require('path');var sox=require(_0x403f('0x6'));var csv=require(_0x403f('0x7'));var ejs=require(_0x403f('0x8'));var fs=require('fs');var fs_extra=require(_0x403f('0x9'));var _=require(_0x403f('0xa'));var squel=require(_0x403f('0xb'));var crypto=require(_0x403f('0xc'));var jsforce=require(_0x403f('0xd'));var deskjs=require(_0x403f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x403f('0xf'));var Papa=require('papaparse');var Redis=require(_0x403f('0x10'));var authService=require(_0x403f('0x11'));var qs=require(_0x403f('0x12'));var as=require(_0x403f('0x13'));var hardwareService=require(_0x403f('0x14'));var logger=require(_0x403f('0x15'))(_0x403f('0x16'));var utils=require(_0x403f('0x17'));var config=require(_0x403f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x403f('0x19'))['db'];function respondWithStatusCode(_0x11b06d,_0x8a85a0){_0x8a85a0=_0x8a85a0||0xcc;return function(_0xed4e75){if(_0xed4e75){return _0x11b06d['sendStatus'](_0x8a85a0);}return _0x11b06d[_0x403f('0x1a')](_0x8a85a0)[_0x403f('0x1b')]();};}function respondWithResult(_0x40ff07,_0x4a7e5c){_0x4a7e5c=_0x4a7e5c||0xc8;return function(_0x48f6b9){if(_0x48f6b9){return _0x40ff07['status'](_0x4a7e5c)[_0x403f('0x1c')](_0x48f6b9);}};}function respondWithFilteredResult(_0x2d3184,_0x510b79){return function(_0xf11dcd){if(_0xf11dcd){var _0x4a6853=typeof _0x510b79[_0x403f('0x1d')]===_0x403f('0x1e')&&typeof _0x510b79['limit']==='undefined';var _0x5914c2=_0xf11dcd[_0x403f('0x1f')];var _0x5da64b=_0x4a6853?0x0:_0x510b79['offset'];var _0x4ae3d2=_0x4a6853?_0xf11dcd[_0x403f('0x1f')]:_0x510b79[_0x403f('0x1d')]+_0x510b79[_0x403f('0x20')];var _0x39681c;if(_0x4ae3d2>=_0x5914c2){_0x4ae3d2=_0x5914c2;_0x39681c=0xc8;}else{_0x39681c=0xce;}_0x2d3184[_0x403f('0x1a')](_0x39681c);return _0x2d3184[_0x403f('0x21')](_0x403f('0x22'),_0x5da64b+'-'+_0x4ae3d2+'/'+_0x5914c2)[_0x403f('0x1c')](_0xf11dcd);}return null;};}function patchUpdates(_0x1661d8){return function(_0x1dde88){try{jsonpatch[_0x403f('0x23')](_0x1dde88,_0x1661d8,!![]);}catch(_0x3dc4a7){return BPromise['reject'](_0x3dc4a7);}return _0x1dde88[_0x403f('0x24')]();};}function saveUpdates(_0x3e93d1,_0x3825af){return function(_0x46ff78){if(_0x46ff78){return _0x46ff78[_0x403f('0x25')](_0x3e93d1)[_0x403f('0x26')](function(_0x5c33bf){return _0x5c33bf;});}return null;};}function removeEntity(_0x2e4fe6,_0x2977aa){return function(_0x21500c){if(_0x21500c){return _0x21500c[_0x403f('0x27')]()[_0x403f('0x26')](function(){var _0x52523c=_0x21500c[_0x403f('0x28')]({'plain':!![]});var _0x562462=_0x403f('0x29');return db[_0x403f('0x2a')][_0x403f('0x27')]({'where':{'type':_0x562462,'resourceId':_0x52523c['id']}})[_0x403f('0x26')](function(){return _0x21500c;});})[_0x403f('0x26')](function(){_0x2e4fe6[_0x403f('0x1a')](0xcc)[_0x403f('0x1b')]();});}};}function handleEntityNotFound(_0x42aee9,_0x2de6d5){return function(_0x3db145){if(!_0x3db145){_0x42aee9[_0x403f('0x2b')](0x194);}return _0x3db145;};}function handleError(_0x50c688,_0x3a1585){_0x3a1585=_0x3a1585||0x1f4;return function(_0x55e20d){logger[_0x403f('0x2c')](_0x55e20d[_0x403f('0x2d')]);if(_0x55e20d[_0x403f('0x2e')]){delete _0x55e20d[_0x403f('0x2e')];}_0x50c688[_0x403f('0x1a')](_0x3a1585)[_0x403f('0x2f')](_0x55e20d);};}exports[_0x403f('0x30')]=function(_0x1c7f41,_0x306dbb){var _0x5793eb={},_0x55cb5d={},_0x386611={'count':0x0,'rows':[]};var _0x3a9a4b=_[_0x403f('0x31')](db['Schedule']['rawAttributes'],function(_0x16af04){return{'name':_0x16af04[_0x403f('0x32')],'type':_0x16af04[_0x403f('0x33')][_0x403f('0x34')]};});_0x55cb5d[_0x403f('0x35')]=_['map'](_0x3a9a4b,_0x403f('0x2e'));_0x55cb5d['query']=_[_0x403f('0x36')](_0x1c7f41[_0x403f('0x37')]);_0x55cb5d['filters']=_[_0x403f('0x38')](_0x55cb5d[_0x403f('0x35')],_0x55cb5d[_0x403f('0x37')]);_0x5793eb[_0x403f('0x39')]=_[_0x403f('0x38')](_0x55cb5d[_0x403f('0x35')],qs[_0x403f('0x3a')](_0x1c7f41['query'][_0x403f('0x3a')]));_0x5793eb[_0x403f('0x39')]=_0x5793eb['attributes'][_0x403f('0x3b')]?_0x5793eb['attributes']:_0x55cb5d['model'];if(!_0x1c7f41['query'][_0x403f('0x3c')](_0x403f('0x3d'))){_0x5793eb[_0x403f('0x20')]=qs[_0x403f('0x20')](_0x1c7f41[_0x403f('0x37')][_0x403f('0x20')]);_0x5793eb[_0x403f('0x1d')]=qs[_0x403f('0x1d')](_0x1c7f41['query'][_0x403f('0x1d')]);}_0x5793eb[_0x403f('0x3e')]=qs[_0x403f('0x3f')](_0x1c7f41['query']['sort']);_0x5793eb['where']=qs[_0x403f('0x40')](_[_0x403f('0x41')](_0x1c7f41[_0x403f('0x37')],_0x55cb5d['filters']),_0x3a9a4b);if(_0x1c7f41[_0x403f('0x37')][_0x403f('0x42')]){_0x5793eb[_0x403f('0x43')]=_[_0x403f('0x44')](_0x5793eb[_0x403f('0x43')],{'$or':_['map'](_0x3a9a4b,function(_0x4ae18c){if(_0x4ae18c[_0x403f('0x33')]!=='VIRTUAL'){var _0x17f0f4={};_0x17f0f4[_0x4ae18c['name']]={'$like':'%'+_0x1c7f41[_0x403f('0x37')][_0x403f('0x42')]+'%'};return _0x17f0f4;}})});}_0x5793eb=_['merge']({},_0x5793eb,_0x1c7f41[_0x403f('0x45')]);var _0x30da2b={'where':_0x5793eb[_0x403f('0x43')]};return db['Schedule'][_0x403f('0x1f')](_0x30da2b)[_0x403f('0x26')](function(_0x24c37e){_0x386611[_0x403f('0x1f')]=_0x24c37e;if(_0x1c7f41[_0x403f('0x37')][_0x403f('0x46')]){_0x5793eb[_0x403f('0x47')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x5793eb);})[_0x403f('0x26')](function(_0x5d8101){_0x386611[_0x403f('0x48')]=_0x5d8101;return _0x386611;})[_0x403f('0x26')](respondWithFilteredResult(_0x306dbb,_0x5793eb))['catch'](handleError(_0x306dbb,null));};exports[_0x403f('0x49')]=function(_0x52901b,_0x2346e3){var _0xc31c98={'raw':![],'where':{'id':_0x52901b[_0x403f('0x4a')]['id']}},_0x51b7eb={};_0x51b7eb[_0x403f('0x35')]=_[_0x403f('0x36')](db[_0x403f('0x4b')]['rawAttributes']);_0x51b7eb[_0x403f('0x37')]=_[_0x403f('0x36')](_0x52901b[_0x403f('0x37')]);_0x51b7eb[_0x403f('0x40')]=_['intersection'](_0x51b7eb['model'],_0x51b7eb[_0x403f('0x37')]);_0xc31c98[_0x403f('0x39')]=_[_0x403f('0x38')](_0x51b7eb[_0x403f('0x35')],qs[_0x403f('0x3a')](_0x52901b['query'][_0x403f('0x3a')]));_0xc31c98[_0x403f('0x39')]=_0xc31c98[_0x403f('0x39')]['length']?_0xc31c98[_0x403f('0x39')]:_0x51b7eb['model'];if(_0x52901b[_0x403f('0x37')][_0x403f('0x46')]){_0xc31c98['include']=[{'all':!![]}];}_0xc31c98=_[_0x403f('0x44')]({},_0xc31c98,_0x52901b[_0x403f('0x45')]);return db[_0x403f('0x4b')][_0x403f('0x4c')](_0xc31c98)[_0x403f('0x26')](handleEntityNotFound(_0x2346e3,null))[_0x403f('0x26')](respondWithResult(_0x2346e3,null))[_0x403f('0x4d')](handleError(_0x2346e3,null));};exports['create']=function(_0x2febdd,_0x1b9101){return db[_0x403f('0x4b')][_0x403f('0x4e')](_0x2febdd[_0x403f('0x4f')],{})[_0x403f('0x26')](function(_0x5d12e6){var _0x224f2f=_0x2febdd['user'][_0x403f('0x28')]({'plain':!![]});if(!_0x224f2f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x224f2f[_0x403f('0x50')]==='user'){var _0x46d865=_0x5d12e6[_0x403f('0x28')]({'plain':!![]});var _0xd3da08=_0x403f('0x29');return db[_0x403f('0x51')][_0x403f('0x4c')]({'where':{'name':_0xd3da08,'userProfileId':_0x224f2f[_0x403f('0x52')]},'raw':!![]})[_0x403f('0x26')](function(_0x3bb965){if(_0x3bb965&&_0x3bb965[_0x403f('0x53')]===0x0){return db['UserProfileResource'][_0x403f('0x4e')]({'name':_0x46d865['name'],'resourceId':_0x46d865['id'],'type':_0x3bb965[_0x403f('0x2e')],'sectionId':_0x3bb965['id']},{})[_0x403f('0x26')](function(){return _0x5d12e6;});}else{return _0x5d12e6;}})[_0x403f('0x4d')](function(_0xa24407){logger[_0x403f('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa24407);throw _0xa24407;});}return _0x5d12e6;})[_0x403f('0x26')](respondWithResult(_0x1b9101,0xc9))['catch'](handleError(_0x1b9101,null));};exports[_0x403f('0x25')]=function(_0x431708,_0x3679de){if(_0x431708['body']['id']){delete _0x431708['body']['id'];}return db[_0x403f('0x4b')][_0x403f('0x4c')]({'where':{'id':_0x431708[_0x403f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3679de,null))[_0x403f('0x26')](saveUpdates(_0x431708[_0x403f('0x4f')],null))[_0x403f('0x26')](respondWithResult(_0x3679de,null))['catch'](handleError(_0x3679de,null));};exports[_0x403f('0x27')]=function(_0x5c101b,_0x3e71e6){return db[_0x403f('0x4b')][_0x403f('0x4c')]({'where':{'id':_0x5c101b[_0x403f('0x4a')]['id']}})[_0x403f('0x26')](handleEntityNotFound(_0x3e71e6,null))[_0x403f('0x26')](removeEntity(_0x3e71e6,null))[_0x403f('0x4d')](handleError(_0x3e71e6,null));};exports[_0x403f('0x54')]=function(_0x2616de,_0xf94f68,_0x5584b4){var _0x4b8e07=require(_0x403f('0x55'));return db[_0x403f('0x4b')]['find']({'where':{'id':_0x2616de['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0xf94f68,null))[_0x403f('0x26')](function(){_0x4b8e07[_0x403f('0x54')](_0x2616de[_0x403f('0x4a')]['id']);})[_0x403f('0x26')](respondWithStatusCode(_0xf94f68,null))[_0x403f('0x4d')](handleError(_0xf94f68,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index f9e9be9..97c1f69 100644 --- a/server/api/schedule/schedule.model.js +++ b/server/api/schedule/schedule.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x101a=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./schedule.attributes','Schedule'];(function(_0x80e225,_0x5b47cd){var _0x3c3129=function(_0x5db1e9){while(--_0x5db1e9){_0x80e225['push'](_0x80e225['shift']());}};_0x3c3129(++_0x5b47cd);}(_0x101a,0xaa));var _0xa101=function(_0x23a5b3,_0x4d36ac){_0x23a5b3=_0x23a5b3-0x0;var _0x1e2575=_0x101a[_0x23a5b3];return _0x1e2575;};'use strict';var _=require(_0xa101('0x0'));var util=require(_0xa101('0x1'));var logger=require(_0xa101('0x2'))(_0xa101('0x3'));var moment=require(_0xa101('0x4'));var BPromise=require(_0xa101('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa101('0x6'));var config=require(_0xa101('0x7'));var attributes=require(_0xa101('0x8'));module['exports']=function(_0x188557,_0x566b9b){return _0x188557['define'](_0xa101('0x9'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddbe=['tools_schedules','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','Schedule'];(function(_0x450fd7,_0x32e322){var _0x58c67e=function(_0xe3829a){while(--_0xe3829a){_0x450fd7['push'](_0x450fd7['shift']());}};_0x58c67e(++_0x32e322);}(_0xddbe,0x139));var _0xeddb=function(_0xe92a5f,_0x3084b3){_0xe92a5f=_0xe92a5f-0x0;var _0x2dbbd7=_0xddbe[_0xe92a5f];return _0x2dbbd7;};'use strict';var _=require(_0xeddb('0x0'));var util=require('util');var logger=require(_0xeddb('0x1'))(_0xeddb('0x2'));var moment=require('moment');var BPromise=require(_0xeddb('0x3'));var rp=require(_0xeddb('0x4'));var fs=require('fs');var path=require(_0xeddb('0x5'));var rimraf=require(_0xeddb('0x6'));var config=require(_0xeddb('0x7'));var attributes=require(_0xeddb('0x8'));module[_0xeddb('0x9')]=function(_0x19d8bf,_0x3c2abb){return _0x19d8bf['define'](_0xeddb('0xa'),attributes,{'tableName':_0xeddb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 7e55038..bef53c2 100644 --- a/server/api/schedule/schedule.rpc.js +++ b/server/api/schedule/schedule.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe439=['request\x20sent','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','Schedule,\x20%s,\x20%s'];(function(_0x3839e2,_0x11240e){var _0x2c6539=function(_0xb00edb){while(--_0xb00edb){_0x3839e2['push'](_0x3839e2['shift']());}};_0x2c6539(++_0x11240e);}(_0xe439,0x1c8));var _0x9e43=function(_0x563193,_0x3189bc){_0x563193=_0x563193-0x0;var _0x5bb6d4=_0xe439[_0x563193];return _0x5bb6d4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9e43('0x0'));var BPromise=require(_0x9e43('0x1'));var rs=require(_0x9e43('0x2'));var fs=require('fs');var Redis=require(_0x9e43('0x3'));var db=require(_0x9e43('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e43('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9e43('0x6'));var client=jayson[_0x9e43('0x7')][_0x9e43('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34cc96,_0x3d0c23,_0x223f70){return new BPromise(function(_0x48af4b,_0x97fb42){return client[_0x9e43('0x9')](_0x34cc96,_0x223f70)['then'](function(_0x1b5244){logger[_0x9e43('0xa')](_0x9e43('0xb'),_0x3d0c23,_0x9e43('0xc'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x3d0c23,_0x9e43('0xc'),JSON[_0x9e43('0xd')](_0x1b5244));if(_0x1b5244[_0x9e43('0xe')]){if(_0x1b5244[_0x9e43('0xe')][_0x9e43('0xf')]===0x1f4){logger[_0x9e43('0xe')](_0x9e43('0xb'),_0x3d0c23,_0x1b5244[_0x9e43('0xe')][_0x9e43('0x10')]);return _0x97fb42(_0x1b5244['error'][_0x9e43('0x10')]);}logger[_0x9e43('0xe')](_0x9e43('0xb'),_0x3d0c23,_0x1b5244[_0x9e43('0xe')][_0x9e43('0x10')]);return _0x48af4b(_0x1b5244['error'][_0x9e43('0x10')]);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x3d0c23,_0x9e43('0xc'));_0x48af4b(_0x1b5244['result'][_0x9e43('0x10')]);}})[_0x9e43('0x11')](function(_0xfc4eb8){logger['error'](_0x9e43('0xb'),_0x3d0c23,_0xfc4eb8);_0x97fb42(_0xfc4eb8);});});} \ No newline at end of file +var _0x9ee2=['http','request','then','info','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error','code','Schedule,\x20%s,\x20%s','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise'];(function(_0x49d19d,_0x245cf5){var _0x4ebef1=function(_0xf0a4e6){while(--_0xf0a4e6){_0x49d19d['push'](_0x49d19d['shift']());}};_0x4ebef1(++_0x245cf5);}(_0x9ee2,0x13c));var _0x29ee=function(_0x40ff3c,_0x1c6580){_0x40ff3c=_0x40ff3c-0x0;var _0x16e888=_0x9ee2[_0x40ff3c];return _0x16e888;};'use strict';var _=require(_0x29ee('0x0'));var util=require(_0x29ee('0x1'));var moment=require(_0x29ee('0x2'));var BPromise=require(_0x29ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x29ee('0x4'));var db=require(_0x29ee('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x29ee('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x29ee('0x7'));var client=jayson['client'][_0x29ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x266dcf,_0x536e92,_0x473d11){return new BPromise(function(_0x4c5d7d,_0x2a85a3){return client[_0x29ee('0x9')](_0x266dcf,_0x473d11)[_0x29ee('0xa')](function(_0x5d60a0){logger[_0x29ee('0xb')]('Schedule,\x20%s,\x20%s',_0x536e92,_0x29ee('0xc'));logger['debug'](_0x29ee('0xd'),_0x536e92,_0x29ee('0xc'),JSON['stringify'](_0x5d60a0));if(_0x5d60a0[_0x29ee('0xe')]){if(_0x5d60a0[_0x29ee('0xe')][_0x29ee('0xf')]===0x1f4){logger['error'](_0x29ee('0x10'),_0x536e92,_0x5d60a0[_0x29ee('0xe')]['message']);return _0x2a85a3(_0x5d60a0[_0x29ee('0xe')][_0x29ee('0x11')]);}logger['error'](_0x29ee('0x10'),_0x536e92,_0x5d60a0[_0x29ee('0xe')][_0x29ee('0x11')]);return _0x4c5d7d(_0x5d60a0[_0x29ee('0xe')][_0x29ee('0x11')]);}else{logger[_0x29ee('0xb')]('Schedule,\x20%s,\x20%s',_0x536e92,'request\x20sent');_0x4c5d7d(_0x5d60a0['result'][_0x29ee('0x11')]);}})['catch'](function(_0x51af0c){logger['error'](_0x29ee('0x10'),_0x536e92,_0x51af0c);_0x2a85a3(_0x51af0c);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 8c11d26..19262d5 100644 --- a/server/api/screenRecording/index.js +++ b/server/api/screenRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeeb6=['/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index'];(function(_0x29ee11,_0x4e0657){var _0x2ff846=function(_0x251cd3){while(--_0x251cd3){_0x29ee11['push'](_0x29ee11['shift']());}};_0x2ff846(++_0x4e0657);}(_0xeeb6,0x1eb));var _0x6eeb=function(_0x123f82,_0x4bbfef){_0x123f82=_0x123f82-0x0;var _0x679f43=_0xeeb6[_0x123f82];return _0x679f43;};'use strict';var multer=require(_0x6eeb('0x0'));var util=require(_0x6eeb('0x1'));var path=require(_0x6eeb('0x2'));var timeout=require(_0x6eeb('0x3'));var express=require(_0x6eeb('0x4'));var router=express[_0x6eeb('0x5')]();var fs_extra=require(_0x6eeb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6eeb('0x7'));var config=require(_0x6eeb('0x8'));var controller=require(_0x6eeb('0x9'));router[_0x6eeb('0xa')]('/',auth[_0x6eeb('0xb')](),controller[_0x6eeb('0xc')]);router[_0x6eeb('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x6eeb('0xa')](_0x6eeb('0xd'),auth[_0x6eeb('0xb')](),controller[_0x6eeb('0xe')]);router['get'](_0x6eeb('0xf'),auth[_0x6eeb('0xb')](),controller[_0x6eeb('0x10')]);router[_0x6eeb('0x11')]('/',auth[_0x6eeb('0xb')](),controller[_0x6eeb('0x12')]);router[_0x6eeb('0x13')](_0x6eeb('0xd'),auth['isAuthenticated'](),controller[_0x6eeb('0x14')]);router[_0x6eeb('0x15')](_0x6eeb('0xd'),auth[_0x6eeb('0xb')](),controller[_0x6eeb('0x16')]);module[_0x6eeb('0x17')]=router; \ No newline at end of file +var _0x9cbc=['delete','exports','multer','path','connect-timeout','Router','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','put','update'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x9cbc,0x17c));var _0xc9cb=function(_0x6eb02d,_0x20bdf5){_0x6eb02d=_0x6eb02d-0x0;var _0xb756de=_0x9cbc[_0x6eb02d];return _0xb756de;};'use strict';var multer=require(_0xc9cb('0x0'));var util=require('util');var path=require(_0xc9cb('0x1'));var timeout=require(_0xc9cb('0x2'));var express=require('express');var router=express[_0xc9cb('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc9cb('0x4'));var controller=require(_0xc9cb('0x5'));router[_0xc9cb('0x6')]('/',auth[_0xc9cb('0x7')](),controller[_0xc9cb('0x8')]);router[_0xc9cb('0x6')](_0xc9cb('0x9'),auth[_0xc9cb('0x7')](),controller[_0xc9cb('0xa')]);router[_0xc9cb('0x6')](_0xc9cb('0xb'),auth['isAuthenticated'](),controller[_0xc9cb('0xc')]);router[_0xc9cb('0x6')](_0xc9cb('0xd'),auth[_0xc9cb('0x7')](),controller[_0xc9cb('0xe')]);router[_0xc9cb('0xf')]('/',auth[_0xc9cb('0x7')](),controller[_0xc9cb('0x10')]);router[_0xc9cb('0x11')](_0xc9cb('0xb'),auth['isAuthenticated'](),controller[_0xc9cb('0x12')]);router[_0xc9cb('0x13')](_0xc9cb('0xb'),auth[_0xc9cb('0x7')](),controller['destroy']);module[_0xc9cb('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 1e2edfa..17433dc 100644 --- a/server/api/screenRecording/screenRecording.attributes.js +++ b/server/api/screenRecording/screenRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc692=['setDataValue','INTEGER','startedAt','duration','DATE','format','toString','closedAt','MM-DD-YYYY\x20HH:mm','createdAt','updatedAt','sequelize','moment','path','VIRTUAL','getDataValue','value','extname','STRING','replace'];(function(_0x3bcf9e,_0x148a5d){var _0x1bb37c=function(_0xcaf5da){while(--_0xcaf5da){_0x3bcf9e['push'](_0x3bcf9e['shift']());}};_0x1bb37c(++_0x148a5d);}(_0xc692,0x15f));var _0x2c69=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xc692[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require(_0x2c69('0x0'));var moment=require(_0x2c69('0x1'));var path=require(_0x2c69('0x2'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0x2c69('0x3')],'get':function(){return this[_0x2c69('0x4')](_0x2c69('0x5'))?path[_0x2c69('0x6')](this[_0x2c69('0x4')](_0x2c69('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x2c69('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x2c69('0x7')],'set':function(_0x4da70c){var _0x5c1260=_0x4da70c[_0x2c69('0x8')](/\\/g,'/');this[_0x2c69('0x9')](_0x2c69('0x5'),_0x5c1260);}},'rating':{'type':Sequelize[_0x2c69('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x2c69('0xa')],'set':function(_0x131313){this['setDataValue'](_0x2c69('0xb'),moment()['subtract'](_0x131313,'ms'));this[_0x2c69('0x9')]('closedAt',moment());this[_0x2c69('0x9')](_0x2c69('0xc'),_0x131313);}},'startedAt':{'type':Sequelize[_0x2c69('0xd')],'get':function(){return moment(this[_0x2c69('0x4')](_0x2c69('0xb')))[_0x2c69('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x2c69('0xf')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x2c69('0x4')](_0x2c69('0x10')))[_0x2c69('0xe')](_0x2c69('0x11'))[_0x2c69('0xf')]();}},'createdAt':{'type':Sequelize[_0x2c69('0xd')],'get':function(){return moment(this['getDataValue'](_0x2c69('0x12')))['format']('MM-DD-YYYY\x20HH:mm')[_0x2c69('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x2c69('0x4')](_0x2c69('0x13')))['format']('MM-DD-YYYY\x20HH:mm')[_0x2c69('0xf')]();}}}; \ No newline at end of file +var _0x6017=['MM-DD-YYYY\x20HH:mm','toString','createdAt','sequelize','moment','path','exports','VIRTUAL','value','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','subtract','duration','DATE','format'];(function(_0x2bf04c,_0xe5d3d9){var _0x4c081a=function(_0x320851){while(--_0x320851){_0x2bf04c['push'](_0x2bf04c['shift']());}};_0x4c081a(++_0xe5d3d9);}(_0x6017,0xae));var _0x7601=function(_0x4f6431,_0x26390b){_0x4f6431=_0x4f6431-0x0;var _0x120d3e=_0x6017[_0x4f6431];return _0x120d3e;};'use strict';var Sequelize=require(_0x7601('0x0'));var moment=require(_0x7601('0x1'));var path=require(_0x7601('0x2'));var config=require('../../config/environment');module[_0x7601('0x3')]={'format':{'type':Sequelize[_0x7601('0x4')],'get':function(){return this['getDataValue'](_0x7601('0x5'))?path['extname'](this[_0x7601('0x6')]('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7601('0x7')]},'value':{'type':Sequelize[_0x7601('0x7')],'set':function(_0xcb5ed9){var _0x34a36d=_0xcb5ed9[_0x7601('0x8')](/\\/g,'/');this[_0x7601('0x9')]('value',_0x34a36d);}},'rating':{'type':Sequelize[_0x7601('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x7601('0xa')],'set':function(_0xd3a338){this['setDataValue'](_0x7601('0xb'),moment()[_0x7601('0xc')](_0xd3a338,'ms'));this[_0x7601('0x9')]('closedAt',moment());this[_0x7601('0x9')](_0x7601('0xd'),_0xd3a338);}},'startedAt':{'type':Sequelize[_0x7601('0xe')],'get':function(){return moment(this[_0x7601('0x6')](_0x7601('0xb')))[_0x7601('0xf')](_0x7601('0x10'))[_0x7601('0x11')]();}},'closedAt':{'type':Sequelize[_0x7601('0xe')],'get':function(){return moment(this[_0x7601('0x6')]('closedAt'))[_0x7601('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x7601('0x11')]();}},'createdAt':{'type':Sequelize[_0x7601('0xe')],'get':function(){return moment(this[_0x7601('0x6')](_0x7601('0x12')))[_0x7601('0xf')](_0x7601('0x10'))[_0x7601('0x11')]();}},'updatedAt':{'type':Sequelize[_0x7601('0xe')],'get':function(){return moment(this[_0x7601('0x6')]('updatedAt'))[_0x7601('0xf')](_0x7601('0x10'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 1836012..c406637 100644 --- a/server/api/screenRecording/screenRecording.controller.js +++ b/server/api/screenRecording/screenRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dfd=['../../components/encryptor','uniqueid','join','%s.cypher','existsSync','decryptFile','secrets','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','stack','name','send','index','ScreenRecording','fieldName','key','model','map','format','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','length','catch','create','body','duration','createdAt','closedAt','value','find','describe','download'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd7df('0x0'));var rimraf=require(_0xd7df('0x1'));var zipdir=require(_0xd7df('0x2'));var jsonpatch=require(_0xd7df('0x3'));var rp=require(_0xd7df('0x4'));var moment=require(_0xd7df('0x5'));var BPromise=require(_0xd7df('0x6'));var Mustache=require(_0xd7df('0x7'));var util=require(_0xd7df('0x8'));var path=require(_0xd7df('0x9'));var sox=require(_0xd7df('0xa'));var csv=require(_0xd7df('0xb'));var ejs=require(_0xd7df('0xc'));var fs=require('fs');var fs_extra=require(_0xd7df('0xd'));var _=require(_0xd7df('0xe'));var squel=require(_0xd7df('0xf'));var crypto=require(_0xd7df('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xd7df('0x11'));var toCsv=require(_0xd7df('0xb'));var querystring=require(_0xd7df('0x12'));var Papa=require(_0xd7df('0x13'));var Redis=require('ioredis');var authService=require(_0xd7df('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd7df('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7df('0x16'))(_0xd7df('0x17'));var utils=require(_0xd7df('0x18'));var config=require(_0xd7df('0x19'));var licenseUtil=require(_0xd7df('0x1a'));var db=require(_0xd7df('0x1b'))['db'];function respondWithStatusCode(_0x2e8187,_0x3da618){_0x3da618=_0x3da618||0xcc;return function(_0x7ba3c){if(_0x7ba3c){return _0x2e8187[_0xd7df('0x1c')](_0x3da618);}return _0x2e8187[_0xd7df('0x1d')](_0x3da618)[_0xd7df('0x1e')]();};}function respondWithResult(_0xe1595f,_0x196632){_0x196632=_0x196632||0xc8;return function(_0x3b2559){if(_0x3b2559){return _0xe1595f[_0xd7df('0x1d')](_0x196632)[_0xd7df('0x1f')](_0x3b2559);}};}function respondWithFilteredResult(_0x57b8be,_0x4c5cf){return function(_0x23cdbc){if(_0x23cdbc){var _0x513b13=typeof _0x4c5cf[_0xd7df('0x20')]===_0xd7df('0x21')&&typeof _0x4c5cf['limit']===_0xd7df('0x21');var _0x30ee65=_0x23cdbc[_0xd7df('0x22')];var _0x5210e5=_0x513b13?0x0:_0x4c5cf[_0xd7df('0x20')];var _0x471621=_0x513b13?_0x23cdbc[_0xd7df('0x22')]:_0x4c5cf['offset']+_0x4c5cf[_0xd7df('0x23')];var _0x20dc3e;if(_0x471621>=_0x30ee65){_0x471621=_0x30ee65;_0x20dc3e=0xc8;}else{_0x20dc3e=0xce;}_0x57b8be[_0xd7df('0x1d')](_0x20dc3e);return _0x57b8be['set'](_0xd7df('0x24'),_0x5210e5+'-'+_0x471621+'/'+_0x30ee65)['json'](_0x23cdbc);}return null;};}function patchUpdates(_0x225e33){return function(_0x5ab737){try{jsonpatch[_0xd7df('0x25')](_0x5ab737,_0x225e33,!![]);}catch(_0x342b54){return BPromise[_0xd7df('0x26')](_0x342b54);}return _0x5ab737['save']();};}function saveUpdates(_0xc50077,_0x502ae8){return function(_0x44079b){if(_0x44079b){return _0x44079b[_0xd7df('0x27')](_0xc50077)[_0xd7df('0x28')](function(_0x29f354){return _0x29f354;});}return null;};}function removeEntity(_0x1c774b,_0xa80cbf){return function(_0x1e3bf3){if(_0x1e3bf3){return _0x1e3bf3['destroy']()['then'](function(){_0x1c774b[_0xd7df('0x1d')](0xcc)[_0xd7df('0x1e')]();});}};}function handleEntityNotFound(_0x26047f,_0x459f11){return function(_0x13f190){if(!_0x13f190){_0x26047f[_0xd7df('0x1c')](0x194);}return _0x13f190;};}function handleError(_0x373359,_0x2b6fde){_0x2b6fde=_0x2b6fde||0x1f4;return function(_0x163904){logger['error'](_0x163904[_0xd7df('0x29')]);if(_0x163904[_0xd7df('0x2a')]){delete _0x163904[_0xd7df('0x2a')];}_0x373359[_0xd7df('0x1d')](_0x2b6fde)[_0xd7df('0x2b')](_0x163904);};}exports[_0xd7df('0x2c')]=function(_0x3f78fa,_0x36de76){var _0x5195cf={},_0x4ba779={},_0x52b56a={'count':0x0,'rows':[]};var _0x58584d=_['map'](db[_0xd7df('0x2d')]['rawAttributes'],function(_0xd366b){return{'name':_0xd366b[_0xd7df('0x2e')],'type':_0xd366b['type'][_0xd7df('0x2f')]};});_0x4ba779[_0xd7df('0x30')]=_['differenceBy'](_[_0xd7df('0x31')](_0x58584d,_0xd7df('0x2a')),[_0xd7df('0x32')]);_0x4ba779[_0xd7df('0x33')]=_[_0xd7df('0x34')](_0x3f78fa[_0xd7df('0x33')]);_0x4ba779['filters']=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],_0x4ba779[_0xd7df('0x33')]);_0x5195cf[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5195cf[_0xd7df('0x36')]=_0x5195cf[_0xd7df('0x36')]['length']?_0x5195cf['attributes']:_0x4ba779[_0xd7df('0x30')];if(!_0x3f78fa['query'][_0xd7df('0x38')](_0xd7df('0x39'))){_0x5195cf[_0xd7df('0x23')]=qs[_0xd7df('0x23')](_0x3f78fa['query']['limit']);_0x5195cf['offset']=qs[_0xd7df('0x20')](_0x3f78fa[_0xd7df('0x33')]['offset']);}_0x5195cf[_0xd7df('0x3a')]=qs[_0xd7df('0x3b')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3b')]);_0x5195cf['where']=qs[_0xd7df('0x3c')](_[_0xd7df('0x3d')](_0x3f78fa['query'],_0x4ba779[_0xd7df('0x3c')]),_0x58584d);if(_0x3f78fa['query'][_0xd7df('0x3e')]){_0x5195cf[_0xd7df('0x3f')]=_[_0xd7df('0x40')](_0x5195cf['where'],{'$or':_[_0xd7df('0x31')](_0x58584d,function(_0x2a7252){if(_0x2a7252[_0xd7df('0x41')]!==_0xd7df('0x42')){var _0x54ea42={};_0x54ea42[_0x2a7252[_0xd7df('0x2a')]]={'$like':'%'+_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3e')]+'%'};return _0x54ea42;}})});}_0x5195cf=_['merge']({},_0x5195cf,_0x3f78fa[_0xd7df('0x43')]);var _0x207852={'where':_0x5195cf[_0xd7df('0x3f')]};return db['ScreenRecording'][_0xd7df('0x22')](_0x207852)[_0xd7df('0x28')](function(_0x4910cb){_0x52b56a['count']=_0x4910cb;if(_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5195cf[_0xd7df('0x45')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x5195cf);})[_0xd7df('0x28')](function(_0x4ebdbe){_0x52b56a[_0xd7df('0x46')]=_0x4ebdbe;return _0x52b56a;})['then'](respondWithFilteredResult(_0x36de76,_0x5195cf))['catch'](handleError(_0x36de76,null));};exports[_0xd7df('0x47')]=function(_0x579d0f,_0x18ef10){var _0x5302f4={'raw':![],'where':{'id':_0x579d0f[_0xd7df('0x48')]['id']}},_0xad2d69={};_0xad2d69[_0xd7df('0x30')]=_[_0xd7df('0x34')](db[_0xd7df('0x2d')][_0xd7df('0x49')]);_0xad2d69[_0xd7df('0x33')]=_['keys'](_0x579d0f[_0xd7df('0x33')]);_0xad2d69['filters']=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],_0xad2d69[_0xd7df('0x33')]);_0x5302f4[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x579d0f[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5302f4['attributes']=_0x5302f4[_0xd7df('0x36')][_0xd7df('0x4a')]?_0x5302f4['attributes']:_0xad2d69['model'];if(_0x579d0f[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5302f4[_0xd7df('0x45')]=[{'all':!![]}];}_0x5302f4=_['merge']({},_0x5302f4,_0x579d0f['options']);return db[_0xd7df('0x2d')]['find'](_0x5302f4)[_0xd7df('0x28')](handleEntityNotFound(_0x18ef10,null))[_0xd7df('0x28')](respondWithResult(_0x18ef10,null))[_0xd7df('0x4b')](handleError(_0x18ef10,null));};exports[_0xd7df('0x4c')]=function(_0x1838aa,_0x28c13f){return db[_0xd7df('0x2d')][_0xd7df('0x4c')](_0x1838aa[_0xd7df('0x4d')],{})[_0xd7df('0x28')](respondWithResult(_0x28c13f,0xc9))[_0xd7df('0x4b')](handleError(_0x28c13f,null));};exports[_0xd7df('0x27')]=function(_0x54222c,_0x1f2f99){if(_0x54222c[_0xd7df('0x4d')]['id']){delete _0x54222c[_0xd7df('0x4d')]['id'];}delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x4e')];delete _0x54222c['body'][_0xd7df('0x4f')];delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x50')];delete _0x54222c['body'][_0xd7df('0x51')];return db['ScreenRecording'][_0xd7df('0x52')]({'where':{'id':_0x54222c[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](handleEntityNotFound(_0x1f2f99,null))[_0xd7df('0x28')](saveUpdates(_0x54222c[_0xd7df('0x4d')],null))['then'](respondWithResult(_0x1f2f99,null))['catch'](handleError(_0x1f2f99,null));};exports['describe']=function(_0xe4b221,_0x4a6cf5){return db[_0xd7df('0x2d')][_0xd7df('0x53')]()[_0xd7df('0x28')](respondWithResult(_0x4a6cf5,null))[_0xd7df('0x4b')](handleError(_0x4a6cf5,null));};exports[_0xd7df('0x54')]=function(_0x418da,_0xf72803,_0xb054d7){var _0x453876=require(_0xd7df('0x55'));var _0x382d11=![];var _0x327365={};if(_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]&&_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]==='uniqueid'){_0x327365[_0xd7df('0x56')]=_0x418da[_0xd7df('0x48')]['id'];}else{_0x327365['id']=_0x418da['params']['id'];}return db['ScreenRecording'][_0xd7df('0x52')]({'where':_0x327365,'attributes':['id','value'],'raw':!![]})[_0xd7df('0x28')](handleEntityNotFound(_0xf72803,null))['then'](function(_0x1f34c2){if(_0x1f34c2){var _0x28151a=path[_0xd7df('0x57')](config['root'],'server/files/screen_recordings',_0x1f34c2['value']);var _0x3666ba=util[_0xd7df('0x32')](_0xd7df('0x58'),_0x28151a);if(fs[_0xd7df('0x59')](_0x3666ba)){_0x382d11=!![];return _0x453876[_0xd7df('0x5a')](_0x3666ba,_0x28151a,config[_0xd7df('0x5b')]['recording'])[_0xd7df('0x28')](function(){return _0x1f34c2;});}return _0x1f34c2;}})[_0xd7df('0x28')](function(_0x35204f){if(_0x35204f){var _0x25d187=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x35204f[_0xd7df('0x51')]);if(!fs[_0xd7df('0x59')](_0x25d187)){throw new db[(_0xd7df('0x5e'))][(_0xd7df('0x5f'))](_0xd7df('0x60'));}if(_0x35204f[_0xd7df('0x61')]){return _0xf72803[_0xd7df('0x54')](_0x25d187,_0x35204f[_0xd7df('0x61')]+path[_0xd7df('0x62')](_0x25d187),function(){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}else{return _0xf72803[_0xd7df('0x54')](_0x25d187,function(_0x3f2775){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}}})[_0xd7df('0x4b')](function(_0x393a3a){if(_0x393a3a[_0xd7df('0x64')]===_0xd7df('0x60')){_0xf72803[_0xd7df('0x1d')](0x194)[_0xd7df('0x2b')]('Not\x20found');}else{return handleError(_0xf72803,null);}});};exports['destroy']=function(_0x327402,_0x28f550){return db[_0xd7df('0x2d')]['find']({'where':{'id':_0x327402[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](function(_0x1e87aa){if(_[_0xd7df('0x65')](_0x1e87aa)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1e87aa;})[_0xd7df('0x28')](function(_0x20ad50){var _0xb06a56=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x20ad50[_0xd7df('0x51')]);logger[_0xd7df('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0xb06a56);if(!_[_0xd7df('0x65')](_0x20ad50[_0xd7df('0x51')])&&fs['existsSync'](_0xb06a56)){logger['info']('File:\x20\x22'+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}_0xb06a56=_0xb06a56+_0xd7df('0x69');if(!_[_0xd7df('0x65')](_0x20ad50['value'])&&fs[_0xd7df('0x59')](_0xb06a56)){logger[_0xd7df('0x66')](_0xd7df('0x6a')+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}return _0x20ad50;})[_0xd7df('0x28')](function(_0x4124b8){if(!_0x4124b8)throw new InternalError();return _0x4124b8['destroy']();})['then'](function(){_0x28f550[_0xd7df('0x1d')](0xcc)['end']();})[_0xd7df('0x4b')](handleError(_0x28f550,null));}; \ No newline at end of file +var _0xac31=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','then','includeAll','findAll','rows','catch','params','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher'];(function(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0xac31,0xca));var _0x1ac3=function(_0x1037b8,_0x41a5c5){_0x1037b8=_0x1037b8-0x0;var _0x35d9fb=_0xac31[_0x1037b8];return _0x35d9fb;};'use strict';var emlformat=require(_0x1ac3('0x0'));var rimraf=require(_0x1ac3('0x1'));var zipdir=require(_0x1ac3('0x2'));var jsonpatch=require(_0x1ac3('0x3'));var rp=require(_0x1ac3('0x4'));var moment=require(_0x1ac3('0x5'));var BPromise=require(_0x1ac3('0x6'));var Mustache=require('mustache');var util=require(_0x1ac3('0x7'));var path=require(_0x1ac3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ac3('0x9'));var fs=require('fs');var fs_extra=require(_0x1ac3('0xa'));var _=require(_0x1ac3('0xb'));var squel=require(_0x1ac3('0xc'));var crypto=require(_0x1ac3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1ac3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1ac3('0xf'));var Papa=require(_0x1ac3('0x10'));var Redis=require(_0x1ac3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1ac3('0x12'));var as=require(_0x1ac3('0x13'));var hardwareService=require(_0x1ac3('0x14'));var logger=require(_0x1ac3('0x15'))(_0x1ac3('0x16'));var utils=require(_0x1ac3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1ac3('0x18'));var db=require(_0x1ac3('0x19'))['db'];function respondWithStatusCode(_0x2eeabf,_0x2338b9){_0x2338b9=_0x2338b9||0xcc;return function(_0x50d3b6){if(_0x50d3b6){return _0x2eeabf[_0x1ac3('0x1a')](_0x2338b9);}return _0x2eeabf[_0x1ac3('0x1b')](_0x2338b9)[_0x1ac3('0x1c')]();};}function respondWithResult(_0x2def9f,_0x53cc35){_0x53cc35=_0x53cc35||0xc8;return function(_0x24bb5e){if(_0x24bb5e){return _0x2def9f[_0x1ac3('0x1b')](_0x53cc35)['json'](_0x24bb5e);}};}function respondWithFilteredResult(_0x29a7b3,_0x1f9641){return function(_0x38b52a){if(_0x38b52a){var _0x51f1e4=typeof _0x1f9641[_0x1ac3('0x1d')]===_0x1ac3('0x1e')&&typeof _0x1f9641[_0x1ac3('0x1f')]==='undefined';var _0x195683=_0x38b52a['count'];var _0x291616=_0x51f1e4?0x0:_0x1f9641[_0x1ac3('0x1d')];var _0x20091d=_0x51f1e4?_0x38b52a[_0x1ac3('0x20')]:_0x1f9641[_0x1ac3('0x1d')]+_0x1f9641['limit'];var _0x136e73;if(_0x20091d>=_0x195683){_0x20091d=_0x195683;_0x136e73=0xc8;}else{_0x136e73=0xce;}_0x29a7b3[_0x1ac3('0x1b')](_0x136e73);return _0x29a7b3[_0x1ac3('0x21')](_0x1ac3('0x22'),_0x291616+'-'+_0x20091d+'/'+_0x195683)['json'](_0x38b52a);}return null;};}function patchUpdates(_0x48d18a){return function(_0x2879d8){try{jsonpatch[_0x1ac3('0x23')](_0x2879d8,_0x48d18a,!![]);}catch(_0x14070b){return BPromise[_0x1ac3('0x24')](_0x14070b);}return _0x2879d8[_0x1ac3('0x25')]();};}function saveUpdates(_0x319988,_0x23b767){return function(_0x10912a){if(_0x10912a){return _0x10912a[_0x1ac3('0x26')](_0x319988)['then'](function(_0x1e277f){return _0x1e277f;});}return null;};}function removeEntity(_0x231b7f,_0x4b19f2){return function(_0x2b5182){if(_0x2b5182){return _0x2b5182[_0x1ac3('0x27')]()['then'](function(){_0x231b7f[_0x1ac3('0x1b')](0xcc)[_0x1ac3('0x1c')]();});}};}function handleEntityNotFound(_0x145486,_0x2dfdb7){return function(_0x10db3d){if(!_0x10db3d){_0x145486['sendStatus'](0x194);}return _0x10db3d;};}function handleError(_0x5a2ab2,_0x503a64){_0x503a64=_0x503a64||0x1f4;return function(_0x528807){logger['error'](_0x528807[_0x1ac3('0x28')]);if(_0x528807['name']){delete _0x528807[_0x1ac3('0x29')];}_0x5a2ab2[_0x1ac3('0x1b')](_0x503a64)[_0x1ac3('0x2a')](_0x528807);};}exports[_0x1ac3('0x2b')]=function(_0x4b3d3c,_0x61441d){var _0x541da0={},_0x2ddd73={},_0x4000b0={'count':0x0,'rows':[]};var _0x440aed=_[_0x1ac3('0x2c')](db[_0x1ac3('0x2d')][_0x1ac3('0x2e')],function(_0x9c17c2){return{'name':_0x9c17c2['fieldName'],'type':_0x9c17c2[_0x1ac3('0x2f')][_0x1ac3('0x30')]};});_0x2ddd73[_0x1ac3('0x31')]=_[_0x1ac3('0x32')](_['map'](_0x440aed,_0x1ac3('0x29')),[_0x1ac3('0x33')]);_0x2ddd73[_0x1ac3('0x34')]=_[_0x1ac3('0x35')](_0x4b3d3c[_0x1ac3('0x34')]);_0x2ddd73['filters']=_[_0x1ac3('0x36')](_0x2ddd73[_0x1ac3('0x31')],_0x2ddd73[_0x1ac3('0x34')]);_0x541da0[_0x1ac3('0x37')]=_[_0x1ac3('0x36')](_0x2ddd73[_0x1ac3('0x31')],qs['fields'](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x38')]));_0x541da0[_0x1ac3('0x37')]=_0x541da0[_0x1ac3('0x37')]['length']?_0x541da0[_0x1ac3('0x37')]:_0x2ddd73[_0x1ac3('0x31')];if(!_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x39')](_0x1ac3('0x3a'))){_0x541da0[_0x1ac3('0x1f')]=qs[_0x1ac3('0x1f')](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x1f')]);_0x541da0['offset']=qs[_0x1ac3('0x1d')](_0x4b3d3c[_0x1ac3('0x34')]['offset']);}_0x541da0[_0x1ac3('0x3b')]=qs[_0x1ac3('0x3c')](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x3c')]);_0x541da0[_0x1ac3('0x3d')]=qs[_0x1ac3('0x3e')](_[_0x1ac3('0x3f')](_0x4b3d3c[_0x1ac3('0x34')],_0x2ddd73['filters']),_0x440aed);if(_0x4b3d3c[_0x1ac3('0x34')]['filter']){_0x541da0[_0x1ac3('0x3d')]=_[_0x1ac3('0x40')](_0x541da0[_0x1ac3('0x3d')],{'$or':_[_0x1ac3('0x2c')](_0x440aed,function(_0x3141ae){if(_0x3141ae[_0x1ac3('0x2f')]!=='VIRTUAL'){var _0x3b5c1c={};_0x3b5c1c[_0x3141ae[_0x1ac3('0x29')]]={'$like':'%'+_0x4b3d3c[_0x1ac3('0x34')]['filter']+'%'};return _0x3b5c1c;}})});}_0x541da0=_[_0x1ac3('0x40')]({},_0x541da0,_0x4b3d3c[_0x1ac3('0x41')]);var _0x5cec6b={'where':_0x541da0[_0x1ac3('0x3d')]};return db[_0x1ac3('0x2d')][_0x1ac3('0x20')](_0x5cec6b)[_0x1ac3('0x42')](function(_0x466a45){_0x4000b0[_0x1ac3('0x20')]=_0x466a45;if(_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x43')]){_0x541da0['include']=[{'all':!![]}];}return db[_0x1ac3('0x2d')][_0x1ac3('0x44')](_0x541da0);})[_0x1ac3('0x42')](function(_0x254a77){_0x4000b0[_0x1ac3('0x45')]=_0x254a77;return _0x4000b0;})[_0x1ac3('0x42')](respondWithFilteredResult(_0x61441d,_0x541da0))[_0x1ac3('0x46')](handleError(_0x61441d,null));};exports['show']=function(_0x4edc4d,_0x2c2099){var _0x3f60ca={'raw':![],'where':{'id':_0x4edc4d[_0x1ac3('0x47')]['id']}},_0x4972d1={};_0x4972d1[_0x1ac3('0x31')]=_['keys'](db[_0x1ac3('0x2d')]['rawAttributes']);_0x4972d1[_0x1ac3('0x34')]=_[_0x1ac3('0x35')](_0x4edc4d[_0x1ac3('0x34')]);_0x4972d1[_0x1ac3('0x3e')]=_['intersection'](_0x4972d1[_0x1ac3('0x31')],_0x4972d1[_0x1ac3('0x34')]);_0x3f60ca[_0x1ac3('0x37')]=_[_0x1ac3('0x36')](_0x4972d1[_0x1ac3('0x31')],qs['fields'](_0x4edc4d[_0x1ac3('0x34')][_0x1ac3('0x38')]));_0x3f60ca[_0x1ac3('0x37')]=_0x3f60ca[_0x1ac3('0x37')]['length']?_0x3f60ca[_0x1ac3('0x37')]:_0x4972d1[_0x1ac3('0x31')];if(_0x4edc4d[_0x1ac3('0x34')][_0x1ac3('0x43')]){_0x3f60ca['include']=[{'all':!![]}];}_0x3f60ca=_[_0x1ac3('0x40')]({},_0x3f60ca,_0x4edc4d[_0x1ac3('0x41')]);return db[_0x1ac3('0x2d')][_0x1ac3('0x48')](_0x3f60ca)['then'](handleEntityNotFound(_0x2c2099,null))[_0x1ac3('0x42')](respondWithResult(_0x2c2099,null))['catch'](handleError(_0x2c2099,null));};exports[_0x1ac3('0x49')]=function(_0x10bcaf,_0x2e3347){return db[_0x1ac3('0x2d')][_0x1ac3('0x49')](_0x10bcaf[_0x1ac3('0x4a')],{})[_0x1ac3('0x42')](respondWithResult(_0x2e3347,0xc9))['catch'](handleError(_0x2e3347,null));};exports['update']=function(_0xe8f33c,_0x249c2d){if(_0xe8f33c[_0x1ac3('0x4a')]['id']){delete _0xe8f33c['body']['id'];}delete _0xe8f33c['body']['duration'];delete _0xe8f33c[_0x1ac3('0x4a')][_0x1ac3('0x4b')];delete _0xe8f33c['body'][_0x1ac3('0x4c')];delete _0xe8f33c[_0x1ac3('0x4a')][_0x1ac3('0x4d')];return db[_0x1ac3('0x2d')]['find']({'where':{'id':_0xe8f33c['params']['id']}})[_0x1ac3('0x42')](handleEntityNotFound(_0x249c2d,null))[_0x1ac3('0x42')](saveUpdates(_0xe8f33c['body'],null))[_0x1ac3('0x42')](respondWithResult(_0x249c2d,null))['catch'](handleError(_0x249c2d,null));};exports['describe']=function(_0x2d628d,_0x220dd0){return db['ScreenRecording'][_0x1ac3('0x4e')]()['then'](respondWithResult(_0x220dd0,null))[_0x1ac3('0x46')](handleError(_0x220dd0,null));};exports[_0x1ac3('0x4f')]=function(_0x3586b9,_0x3a0320,_0x34ad43){var _0x40e9c7=require(_0x1ac3('0x50'));var _0x331374=![];var _0xeb7e49={};if(_0x3586b9[_0x1ac3('0x34')][_0x1ac3('0x2f')]&&_0x3586b9['query']['type']===_0x1ac3('0x51')){_0xeb7e49[_0x1ac3('0x51')]=_0x3586b9[_0x1ac3('0x47')]['id'];}else{_0xeb7e49['id']=_0x3586b9[_0x1ac3('0x47')]['id'];}return db[_0x1ac3('0x2d')][_0x1ac3('0x48')]({'where':_0xeb7e49,'attributes':['id',_0x1ac3('0x4d')],'raw':!![]})[_0x1ac3('0x42')](handleEntityNotFound(_0x3a0320,null))[_0x1ac3('0x42')](function(_0x3149f6){if(_0x3149f6){var _0x541bba=path[_0x1ac3('0x52')](config[_0x1ac3('0x53')],_0x1ac3('0x54'),_0x3149f6[_0x1ac3('0x4d')]);var _0x20c195=util['format'](_0x1ac3('0x55'),_0x541bba);if(fs[_0x1ac3('0x56')](_0x20c195)){_0x331374=!![];return _0x40e9c7['decryptFile'](_0x20c195,_0x541bba,config['secrets']['recording'])[_0x1ac3('0x42')](function(){return _0x3149f6;});}return _0x3149f6;}})[_0x1ac3('0x42')](function(_0x2a1f66){if(_0x2a1f66){var _0x5ad546=path[_0x1ac3('0x52')](config['root'],'server/files/screen_recordings',_0x2a1f66['value']);if(!fs['existsSync'](_0x5ad546)){throw new db[(_0x1ac3('0x57'))][(_0x1ac3('0x58'))](_0x1ac3('0x59'));}if(_0x2a1f66[_0x1ac3('0x5a')]){return _0x3a0320[_0x1ac3('0x4f')](_0x5ad546,_0x2a1f66['filename']+path[_0x1ac3('0x5b')](_0x5ad546),function(){if(_0x331374){fs[_0x1ac3('0x5c')](_0x5ad546);}});}else{return _0x3a0320['download'](_0x5ad546,function(_0x2bcb4b){if(_0x331374){fs[_0x1ac3('0x5c')](_0x5ad546);}});}}})[_0x1ac3('0x46')](function(_0x2e79b2){if(_0x2e79b2[_0x1ac3('0x5d')]==='ScreenRecording\x20not\x20found'){_0x3a0320[_0x1ac3('0x1b')](0x194)[_0x1ac3('0x2a')](_0x1ac3('0x5e'));}else{return handleError(_0x3a0320,null);}});};exports[_0x1ac3('0x27')]=function(_0x4cfa04,_0x19407a){return db[_0x1ac3('0x2d')][_0x1ac3('0x48')]({'where':{'id':_0x4cfa04[_0x1ac3('0x47')]['id']}})[_0x1ac3('0x42')](function(_0x1ac283){if(_['isNil'](_0x1ac283)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1ac283;})['then'](function(_0x582fe2){var _0x3b930b=path['join'](config[_0x1ac3('0x53')],_0x1ac3('0x54'),_0x582fe2[_0x1ac3('0x4d')]);logger[_0x1ac3('0x5f')](_0x1ac3('0x60'),_0x3b930b);if(!_[_0x1ac3('0x61')](_0x582fe2['value'])&&fs[_0x1ac3('0x56')](_0x3b930b)){logger[_0x1ac3('0x5f')](_0x1ac3('0x62')+_0x3b930b+_0x1ac3('0x63'));fs['unlinkSync'](_0x3b930b);}_0x3b930b=_0x3b930b+_0x1ac3('0x64');if(!_[_0x1ac3('0x61')](_0x582fe2[_0x1ac3('0x4d')])&&fs[_0x1ac3('0x56')](_0x3b930b)){logger[_0x1ac3('0x5f')]('File:\x20\x22'+_0x3b930b+_0x1ac3('0x63'));fs['unlinkSync'](_0x3b930b);}return _0x582fe2;})['then'](function(_0x402507){if(!_0x402507)throw new InternalError();return _0x402507[_0x1ac3('0x27')]();})[_0x1ac3('0x42')](function(){_0x19407a[_0x1ac3('0x1b')](0xcc)[_0x1ac3('0x1c')]();})[_0x1ac3('0x46')](handleError(_0x19407a,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index dd7a1b4..b7fbc35 100644 --- a/server/api/screenRecording/screenRecording.model.js +++ b/server/api/screenRecording/screenRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6db=['bluebird','request-promise','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api'];(function(_0x292423,_0x1759b7){var _0x2801cb=function(_0x23c821){while(--_0x23c821){_0x292423['push'](_0x292423['shift']());}};_0x2801cb(++_0x1759b7);}(_0xa6db,0x182));var _0xba6d=function(_0x5a54ad,_0x183dc5){_0x5a54ad=_0x5a54ad-0x0;var _0x43a3c5=_0xa6db[_0x5a54ad];return _0x43a3c5;};'use strict';var _=require(_0xba6d('0x0'));var util=require(_0xba6d('0x1'));var logger=require(_0xba6d('0x2'))(_0xba6d('0x3'));var moment=require('moment');var BPromise=require(_0xba6d('0x4'));var rp=require(_0xba6d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xba6d('0x6'));var attributes=require(_0xba6d('0x7'));module[_0xba6d('0x8')]=function(_0x478909,_0x293ff3){return _0x478909[_0xba6d('0x9')](_0xba6d('0xa'),attributes,{'tableName':_0xba6d('0xb'),'paranoid':![],'indexes':[{'name':_0xba6d('0xc'),'fields':[_0xba6d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe66f=['exports','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./screenRecording.attributes'];(function(_0xccf82,_0x2a9ba8){var _0x42ba83=function(_0xb0f4df){while(--_0xb0f4df){_0xccf82['push'](_0xccf82['shift']());}};_0x42ba83(++_0x2a9ba8);}(_0xe66f,0xf2));var _0xfe66=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xe66f[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xfe66('0x0'));var util=require(_0xfe66('0x1'));var logger=require(_0xfe66('0x2'))(_0xfe66('0x3'));var moment=require(_0xfe66('0x4'));var BPromise=require(_0xfe66('0x5'));var rp=require(_0xfe66('0x6'));var fs=require('fs');var path=require(_0xfe66('0x7'));var rimraf=require(_0xfe66('0x8'));var config=require('../../config/environment');var attributes=require(_0xfe66('0x9'));module[_0xfe66('0xa')]=function(_0x469600,_0x22d4be){return _0x469600['define'](_0xfe66('0xb'),attributes,{'tableName':_0xfe66('0xc'),'paranoid':![],'indexes':[{'name':_0xfe66('0xd'),'fields':[_0xfe66('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index e32575d..2831f54 100644 --- a/server/api/screenRecording/screenRecording.rpc.js +++ b/server/api/screenRecording/screenRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45aa=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x45aa,0x165));var _0xa45a=function(_0xb13dfb,_0x2279f2){_0xb13dfb=_0xb13dfb-0x0;var _0x5ad8cb=_0x45aa[_0xb13dfb];return _0x5ad8cb;};'use strict';var _=require(_0xa45a('0x0'));var util=require(_0xa45a('0x1'));var moment=require(_0xa45a('0x2'));var BPromise=require(_0xa45a('0x3'));var rs=require(_0xa45a('0x4'));var fs=require('fs');var Redis=require(_0xa45a('0x5'));var db=require(_0xa45a('0x6'))['db'];var utils=require(_0xa45a('0x7'));var logger=require(_0xa45a('0x8'))(_0xa45a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa45a('0xa')][_0xa45a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x556324,_0x4b922f,_0x4be386){return new BPromise(function(_0x57aaf0,_0x3b2617){return client[_0xa45a('0xc')](_0x556324,_0x4be386)[_0xa45a('0xd')](function(_0x435ac7){logger['info'](_0xa45a('0xe'),_0x4b922f,_0xa45a('0xf'));logger[_0xa45a('0x10')](_0xa45a('0x11'),_0x4b922f,_0xa45a('0xf'),JSON[_0xa45a('0x12')](_0x435ac7));if(_0x435ac7[_0xa45a('0x13')]){if(_0x435ac7['error'][_0xa45a('0x14')]===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x4b922f,_0x435ac7['error'][_0xa45a('0x15')]);return _0x3b2617(_0x435ac7[_0xa45a('0x13')]['message']);}logger[_0xa45a('0x13')](_0xa45a('0xe'),_0x4b922f,_0x435ac7[_0xa45a('0x13')][_0xa45a('0x15')]);return _0x57aaf0(_0x435ac7[_0xa45a('0x13')][_0xa45a('0x15')]);}else{logger[_0xa45a('0x16')](_0xa45a('0xe'),_0x4b922f,_0xa45a('0xf'));_0x57aaf0(_0x435ac7['result'][_0xa45a('0x15')]);}})[_0xa45a('0x17')](function(_0x537868){logger[_0xa45a('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x4b922f,_0x537868);_0x3b2617(_0x537868);});});} \ No newline at end of file +var _0x2296=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','info'];(function(_0x421649,_0x3bc1f3){var _0x48176b=function(_0xf57c15){while(--_0xf57c15){_0x421649['push'](_0x421649['shift']());}};_0x48176b(++_0x3bc1f3);}(_0x2296,0x121));var _0x6229=function(_0x14c770,_0x129972){_0x14c770=_0x14c770-0x0;var _0x31a0f1=_0x2296[_0x14c770];return _0x31a0f1;};'use strict';var _=require(_0x6229('0x0'));var util=require(_0x6229('0x1'));var moment=require('moment');var BPromise=require(_0x6229('0x2'));var rs=require(_0x6229('0x3'));var fs=require('fs');var Redis=require(_0x6229('0x4'));var db=require(_0x6229('0x5'))['db'];var utils=require(_0x6229('0x6'));var logger=require('../../config/logger')(_0x6229('0x7'));var config=require(_0x6229('0x8'));var jayson=require(_0x6229('0x9'));var client=jayson[_0x6229('0xa')][_0x6229('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x523562,_0x422d27,_0x436062){return new BPromise(function(_0x3d53b1,_0x3fc1c6){return client[_0x6229('0xc')](_0x523562,_0x436062)[_0x6229('0xd')](function(_0xf7be09){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x422d27,_0x6229('0xe'));logger[_0x6229('0xf')](_0x6229('0x10'),_0x422d27,_0x6229('0xe'),JSON[_0x6229('0x11')](_0xf7be09));if(_0xf7be09['error']){if(_0xf7be09[_0x6229('0x12')][_0x6229('0x13')]===0x1f4){logger[_0x6229('0x12')](_0x6229('0x14'),_0x422d27,_0xf7be09[_0x6229('0x12')][_0x6229('0x15')]);return _0x3fc1c6(_0xf7be09[_0x6229('0x12')][_0x6229('0x15')]);}logger['error'](_0x6229('0x14'),_0x422d27,_0xf7be09[_0x6229('0x12')][_0x6229('0x15')]);return _0x3d53b1(_0xf7be09['error'][_0x6229('0x15')]);}else{logger[_0x6229('0x16')](_0x6229('0x14'),_0x422d27,_0x6229('0xe'));_0x3d53b1(_0xf7be09[_0x6229('0x17')][_0x6229('0x15')]);}})['catch'](function(_0x112cf5){logger['error'](_0x6229('0x14'),_0x422d27,_0x112cf5);_0x3fc1c6(_0x112cf5);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 08c8925..90b2211 100644 --- a/server/api/setting/index.js +++ b/server/api/setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ac1=['/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','format','%s%s','extname','originalname','single','file','addLogo','join','server/files/images/logos/','logologin','post','addLogoLogin','root','preferred','favicon','addFavicon','/:id','update','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','getDate','show','/:id/logo'];(function(_0x515df7,_0x27dfba){var _0x26b275=function(_0x542723){while(--_0x542723){_0x515df7['push'](_0x515df7['shift']());}};_0x26b275(++_0x27dfba);}(_0x0ac1,0x1b5));var _0x10ac=function(_0x2c55a8,_0x486225){_0x2c55a8=_0x2c55a8-0x0;var _0x224e2a=_0x0ac1[_0x2c55a8];return _0x224e2a;};'use strict';var multer=require(_0x10ac('0x0'));var util=require(_0x10ac('0x1'));var path=require(_0x10ac('0x2'));var timeout=require('connect-timeout');var express=require(_0x10ac('0x3'));var router=express['Router']();var fs_extra=require(_0x10ac('0x4'));var auth=require(_0x10ac('0x5'));var interaction=require(_0x10ac('0x6'));var config=require(_0x10ac('0x7'));var controller=require(_0x10ac('0x8'));router[_0x10ac('0x9')]('/',auth[_0x10ac('0xa')](),controller['index']);router['get']('/now',controller[_0x10ac('0xb')]);router[_0x10ac('0x9')]('/:id',controller[_0x10ac('0xc')]);router[_0x10ac('0x9')](_0x10ac('0xd'),controller['getLogo']);router[_0x10ac('0x9')](_0x10ac('0xe'),controller[_0x10ac('0xf')]);router[_0x10ac('0x9')](_0x10ac('0x10'),controller[_0x10ac('0x11')]);router[_0x10ac('0x9')](_0x10ac('0x12'),controller[_0x10ac('0x13')]);router[_0x10ac('0x9')](_0x10ac('0x14'),controller['getFavicon']);var upload=multer({'storage':multer[_0x10ac('0x15')]({'destination':function(_0x335bb9,_0x56a73f,_0x2ed5eb){_0x2ed5eb(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x1ed8b9,_0x3cabf9,_0x34eeda){_0x34eeda(null,util[_0x10ac('0x16')](_0x10ac('0x17'),'logo',path[_0x10ac('0x18')](_0x3cabf9[_0x10ac('0x19')])));}})});router['post'](_0x10ac('0xd'),upload[_0x10ac('0x1a')](_0x10ac('0x1b')),controller[_0x10ac('0x1c')]);var upload=multer({'storage':multer[_0x10ac('0x15')]({'destination':function(_0x331a4d,_0xeaf709,_0x242c0f){_0x242c0f(null,path[_0x10ac('0x1d')](config['root'],_0x10ac('0x1e')));},'filename':function(_0x23584a,_0x367667,_0x1cbba7){_0x1cbba7(null,util['format'](_0x10ac('0x17'),_0x10ac('0x1f'),path[_0x10ac('0x18')](_0x367667[_0x10ac('0x19')])));}})});router[_0x10ac('0x20')](_0x10ac('0xe'),upload[_0x10ac('0x1a')](_0x10ac('0x1b')),controller[_0x10ac('0x21')]);var upload=multer({'storage':multer[_0x10ac('0x15')]({'destination':function(_0x3b711a,_0x91c369,_0x55d943){_0x55d943(null,path[_0x10ac('0x1d')](config[_0x10ac('0x22')],_0x10ac('0x1e')));},'filename':function(_0x4c56ef,_0x2ba2c8,_0x1f6137){_0x1f6137(null,util['format'](_0x10ac('0x17'),_0x10ac('0x23'),path['extname'](_0x2ba2c8[_0x10ac('0x19')])));}})});router['post'](_0x10ac('0x12'),upload[_0x10ac('0x1a')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0x10ac('0x15')]({'destination':function(_0x360173,_0x1c6af9,_0x5ad64b){_0x5ad64b(null,path[_0x10ac('0x1d')](config[_0x10ac('0x22')],_0x10ac('0x1e')));},'filename':function(_0x4ef857,_0x4bb114,_0x5f0dc8){_0x5f0dc8(null,util['format'](_0x10ac('0x17'),_0x10ac('0x24'),path[_0x10ac('0x18')](_0x4bb114[_0x10ac('0x19')])));}})});router[_0x10ac('0x20')](_0x10ac('0x14'),upload[_0x10ac('0x1a')](_0x10ac('0x1b')),controller[_0x10ac('0x25')]);router['put'](_0x10ac('0x26'),auth['isAuthenticated'](),controller[_0x10ac('0x27')]);module[_0x10ac('0x28')]=router; \ No newline at end of file +var _0xdc57=['post','single','file','addLogo','join','server/files/images/logos/','logologin','/:id/logo_login','addLogoLogin','preferred','favicon','/:id/favicon','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','isAuthenticated','index','get','getDate','/:id','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','diskStorage','root','format','%s%s','logo','extname','originalname'];(function(_0x16fe01,_0x5039e1){var _0x56c48a=function(_0x419884){while(--_0x419884){_0x16fe01['push'](_0x16fe01['shift']());}};_0x56c48a(++_0x5039e1);}(_0xdc57,0xa4));var _0x7dc5=function(_0x335883,_0x9d2955){_0x335883=_0x335883-0x0;var _0x28e6e2=_0xdc57[_0x335883];return _0x28e6e2;};'use strict';var multer=require(_0x7dc5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7dc5('0x1'));var express=require(_0x7dc5('0x2'));var router=express['Router']();var fs_extra=require(_0x7dc5('0x3'));var auth=require(_0x7dc5('0x4'));var interaction=require(_0x7dc5('0x5'));var config=require('../../config/environment');var controller=require(_0x7dc5('0x6'));router['get']('/',auth[_0x7dc5('0x7')](),controller[_0x7dc5('0x8')]);router[_0x7dc5('0x9')]('/now',controller[_0x7dc5('0xa')]);router[_0x7dc5('0x9')](_0x7dc5('0xb'),controller['show']);router[_0x7dc5('0x9')](_0x7dc5('0xc'),controller[_0x7dc5('0xd')]);router[_0x7dc5('0x9')]('/:id/logo_login',controller[_0x7dc5('0xe')]);router[_0x7dc5('0x9')](_0x7dc5('0xf'),controller[_0x7dc5('0x10')]);router[_0x7dc5('0x9')](_0x7dc5('0x11'),controller[_0x7dc5('0x12')]);router[_0x7dc5('0x9')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer[_0x7dc5('0x13')]({'destination':function(_0x3da973,_0x334704,_0x399c47){_0x399c47(null,path['join'](config[_0x7dc5('0x14')],'server/files/images/logos/'));},'filename':function(_0x13cb97,_0x206639,_0x4d8fbc){_0x4d8fbc(null,util[_0x7dc5('0x15')](_0x7dc5('0x16'),_0x7dc5('0x17'),path[_0x7dc5('0x18')](_0x206639[_0x7dc5('0x19')])));}})});router[_0x7dc5('0x1a')]('/:id/logo',upload[_0x7dc5('0x1b')](_0x7dc5('0x1c')),controller[_0x7dc5('0x1d')]);var upload=multer({'storage':multer[_0x7dc5('0x13')]({'destination':function(_0x42729f,_0x144604,_0x4247c1){_0x4247c1(null,path[_0x7dc5('0x1e')](config[_0x7dc5('0x14')],_0x7dc5('0x1f')));},'filename':function(_0x16ffe6,_0x51b79e,_0x3f0a0f){_0x3f0a0f(null,util['format'](_0x7dc5('0x16'),_0x7dc5('0x20'),path['extname'](_0x51b79e['originalname'])));}})});router['post'](_0x7dc5('0x21'),upload[_0x7dc5('0x1b')](_0x7dc5('0x1c')),controller[_0x7dc5('0x22')]);var upload=multer({'storage':multer[_0x7dc5('0x13')]({'destination':function(_0x261f94,_0x4401a4,_0x1f1198){_0x1f1198(null,path['join'](config[_0x7dc5('0x14')],'server/files/images/logos/'));},'filename':function(_0x468d04,_0x55832d,_0x2a5615){_0x2a5615(null,util[_0x7dc5('0x15')]('%s%s',_0x7dc5('0x23'),path[_0x7dc5('0x18')](_0x55832d['originalname'])));}})});router[_0x7dc5('0x1a')]('/:id/preferred',upload[_0x7dc5('0x1b')](_0x7dc5('0x1c')),controller['addPreferred']);var upload=multer({'storage':multer[_0x7dc5('0x13')]({'destination':function(_0x3e0a24,_0x2a6cfc,_0x2b94dd){_0x2b94dd(null,path[_0x7dc5('0x1e')](config[_0x7dc5('0x14')],'server/files/images/logos/'));},'filename':function(_0x42a4e6,_0xa9ab81,_0x5d7c8e){_0x5d7c8e(null,util[_0x7dc5('0x15')](_0x7dc5('0x16'),_0x7dc5('0x24'),path[_0x7dc5('0x18')](_0xa9ab81[_0x7dc5('0x19')])));}})});router['post'](_0x7dc5('0x25'),upload['single']('file'),controller['addFavicon']);router['put'](_0x7dc5('0xb'),auth[_0x7dc5('0x7')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 87f0822..8ffd786 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7abd=['UNSIGNED','sequelize','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7abd,0xe7));var _0xd7ab=function(_0x9884e3,_0x34a043){_0x9884e3=_0x9884e3-0x0;var _0x6e3ec=_0x7abd[_0x9884e3];return _0x6e3ec;};'use strict';var Sequelize=require(_0xd7ab('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xd7ab('0x1')](0xb),'unique':_0xd7ab('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xd7ab('0x1')](0xb),'unique':_0xd7ab('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xd7ab('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xd7ab('0x4')],'defaultValue':_0xd7ab('0x5')},'logo':{'type':Sequelize[_0xd7ab('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xd7ab('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xd7ab('0x4')]},'turnaddr':{'type':Sequelize[_0xd7ab('0x4')]},'turnusername':{'type':Sequelize[_0xd7ab('0x4')]},'turnpassword':{'type':Sequelize[_0xd7ab('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xd7ab('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xd7ab('0x7')},'enableEmailPreview':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xd7ab('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xd7ab('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xd7ab('0x4')],'defaultValue':_0xd7ab('0x8')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xd7ab('0x4')]},'defaultPreferred':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xd7ab('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0xd7ab('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xd7ab('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xd7ab('0x4')]},'defaultFavicon':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xd7ab('0x1')]},'transcribeRegion':{'type':Sequelize[_0xd7ab('0x4')]},'sentiment':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xd7ab('0x1')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd7ab('0x4')]},'bucket':{'type':Sequelize[_0xd7ab('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xd7ab('0x1')](0x2)[_0xd7ab('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xd7ab('0x1')](0x2)[_0xd7ab('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0xd7ab('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xd7ab('0x1')](0x2)[_0xd7ab('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xd7ab('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xd7ab('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xd7ab('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xd7ab('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xd7ab('0x1')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0xd7ab('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xd7ab('0x1')],'defaultValue':0x14},'filterFullName':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x74d8=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','min_internal','INTEGER','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x4e8359,_0x182dcf){var _0x424f81=function(_0x5b43c8){while(--_0x5b43c8){_0x4e8359['push'](_0x4e8359['shift']());}};_0x424f81(++_0x182dcf);}(_0x74d8,0xb7));var _0x874d=function(_0x5ec37e,_0x283e87){_0x5ec37e=_0x5ec37e-0x0;var _0x1ff514=_0x74d8[_0x5ec37e];return _0x1ff514;};'use strict';var Sequelize=require(_0x874d('0x0'));module[_0x874d('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x874d('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x874d('0x3')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x874d('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x874d('0x4')],'defaultValue':_0x874d('0x5')},'logo':{'type':Sequelize[_0x874d('0x4')]},'defaultLogo':{'type':Sequelize[_0x874d('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x874d('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x874d('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x874d('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x874d('0x4')]},'turnusername':{'type':Sequelize[_0x874d('0x4')]},'turnpassword':{'type':Sequelize[_0x874d('0x4')]},'pageTitle':{'type':Sequelize[_0x874d('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x874d('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x874d('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x874d('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x874d('0x4')],'defaultValue':_0x874d('0x7')},'enableEmailPreview':{'type':Sequelize[_0x874d('0x6')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x874d('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x874d('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x874d('0x4')],'defaultValue':_0x874d('0x8')},'chatTimeout':{'type':Sequelize[_0x874d('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x874d('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x874d('0x4')]},'defaultPreferred':{'type':Sequelize[_0x874d('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x874d('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x874d('0x3')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x874d('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x874d('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x874d('0x3')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x874d('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x874d('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0x874d('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x874d('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x874d('0x3')]},'sentimentRegion':{'type':Sequelize[_0x874d('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x874d('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x874d('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x874d('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x874d('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x874d('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x874d('0x3')](0x2)[_0x874d('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x874d('0x3')](0x2)[_0x874d('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x874d('0x3')](0x2)[_0x874d('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x874d('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x874d('0x3')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x874d('0x3')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x874d('0x3')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x874d('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x874d('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x874d('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x874d('0x3')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x874d('0x3')],'defaultValue':0x14},'filterFullName':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index f2890c9..a4f1eb8 100644 --- a/server/api/setting/setting.controller.js +++ b/server/api/setting/setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2636=['name','send','index','map','Setting','rawAttributes','fieldName','key','keys','query','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','params','includeAll','find','body','addLogo','file','logo','filename','addLogoLogin','loginLogo','getLicense','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','upperFirst','Sequelize','ValidationError','download','getLogoLogin','server/files/images/logos','defaultLogo','default_loginLogo.svg','default','custom','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','destroy','end','stack'];(function(_0x3b7e6f,_0x1565b5){var _0x4873c3=function(_0x3f0ac6){while(--_0x3f0ac6){_0x3b7e6f['push'](_0x3b7e6f['shift']());}};_0x4873c3(++_0x1565b5);}(_0x2636,0x1c0));var _0x6263=function(_0x2acb4e,_0x5a5e3c){_0x2acb4e=_0x2acb4e-0x0;var _0x382cdb=_0x2636[_0x2acb4e];return _0x382cdb;};'use strict';var emlformat=require(_0x6263('0x0'));var rimraf=require(_0x6263('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6263('0x2'));var BPromise=require(_0x6263('0x3'));var Mustache=require(_0x6263('0x4'));var util=require('util');var path=require(_0x6263('0x5'));var sox=require(_0x6263('0x6'));var csv=require(_0x6263('0x7'));var ejs=require(_0x6263('0x8'));var fs=require('fs');var fs_extra=require(_0x6263('0x9'));var _=require(_0x6263('0xa'));var squel=require(_0x6263('0xb'));var crypto=require(_0x6263('0xc'));var jsforce=require(_0x6263('0xd'));var deskjs=require(_0x6263('0xe'));var toCsv=require(_0x6263('0x7'));var querystring=require('querystring');var Papa=require(_0x6263('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6263('0x10'));var as=require(_0x6263('0x11'));var hardwareService=require(_0x6263('0x12'));var logger=require('../../config/logger')(_0x6263('0x13'));var utils=require(_0x6263('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6263('0x15'));var db=require(_0x6263('0x16'))['db'];var jayson=require(_0x6263('0x17'));var client=jayson[_0x6263('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x486550,_0x1dd344,_0x4b2f1c,_0x3984a1){return new BPromise(function(_0x23252d,_0x5c9ee0){var _0x2afec8=_0x3984a1||client;return _0x2afec8[_0x6263('0x19')](_0x486550,_0x4b2f1c)[_0x6263('0x1a')](function(_0x45c180){logger['info'](_0x6263('0x1b'),_0x1dd344,'request\x20sent');logger[_0x6263('0x1c')](_0x6263('0x1d'),_0x1dd344,_0x6263('0x1e'),JSON['stringify'](_0x45c180));if(_0x45c180[_0x6263('0x1f')]){if(_0x45c180['error'][_0x6263('0x20')]===0x1f4){logger[_0x6263('0x1f')]('Setting,\x20%s,\x20%s',_0x1dd344,_0x45c180[_0x6263('0x1f')]['message']);return _0x5c9ee0(_0x45c180['error'][_0x6263('0x21')]);}logger['error']('Setting,\x20%s,\x20%s',_0x1dd344,_0x45c180[_0x6263('0x1f')][_0x6263('0x21')]);return _0x23252d(_0x45c180[_0x6263('0x1f')][_0x6263('0x21')]);}else{logger[_0x6263('0x22')](_0x6263('0x1b'),_0x1dd344,_0x6263('0x1e'));_0x23252d(_0x45c180[_0x6263('0x23')][_0x6263('0x21')]);}})[_0x6263('0x24')](function(_0x1f7716){logger[_0x6263('0x1f')](_0x6263('0x1b'),_0x1dd344,_0x1f7716);_0x5c9ee0(_0x1f7716);});});}function respondWithStatusCode(_0x2a9bd9,_0x3d0add){_0x3d0add=_0x3d0add||0xcc;return function(_0x1255d3){if(_0x1255d3){return _0x2a9bd9[_0x6263('0x25')](_0x3d0add);}return _0x2a9bd9[_0x6263('0x26')](_0x3d0add)['end']();};}function respondWithResult(_0x188923,_0x2c013e){_0x2c013e=_0x2c013e||0xc8;return function(_0x2839fe){if(_0x2839fe){return _0x188923[_0x6263('0x26')](_0x2c013e)[_0x6263('0x27')](_0x2839fe);}};}function respondWithFilteredResult(_0x30742b,_0x380412){return function(_0x5e47f6){if(_0x5e47f6){var _0x3c25b3=typeof _0x380412['offset']===_0x6263('0x28')&&typeof _0x380412[_0x6263('0x29')]==='undefined';var _0x12aee9=_0x5e47f6['count'];var _0x1fd602=_0x3c25b3?0x0:_0x380412[_0x6263('0x2a')];var _0x2c8187=_0x3c25b3?_0x5e47f6[_0x6263('0x2b')]:_0x380412['offset']+_0x380412[_0x6263('0x29')];var _0x1e5011;if(_0x2c8187>=_0x12aee9){_0x2c8187=_0x12aee9;_0x1e5011=0xc8;}else{_0x1e5011=0xce;}_0x30742b[_0x6263('0x26')](_0x1e5011);return _0x30742b['set'](_0x6263('0x2c'),_0x1fd602+'-'+_0x2c8187+'/'+_0x12aee9)['json'](_0x5e47f6);}return null;};}function patchUpdates(_0x6596d7){return function(_0x318ce2){try{jsonpatch[_0x6263('0x2d')](_0x318ce2,_0x6596d7,!![]);}catch(_0x5162e7){return BPromise[_0x6263('0x2e')](_0x5162e7);}return _0x318ce2[_0x6263('0x2f')]();};}function saveUpdates(_0x15017b,_0xedd263){return function(_0x129fc9){if(_0x129fc9){return _0x129fc9[_0x6263('0x30')](_0x15017b)[_0x6263('0x1a')](function(_0x1b447d){return _0x1b447d;});}return null;};}function removeEntity(_0x11e773,_0x519475){return function(_0x445d7d){if(_0x445d7d){return _0x445d7d[_0x6263('0x31')]()[_0x6263('0x1a')](function(){_0x11e773[_0x6263('0x26')](0xcc)[_0x6263('0x32')]();});}};}function handleEntityNotFound(_0x175c18,_0x38c4dd){return function(_0x302c08){if(!_0x302c08){_0x175c18[_0x6263('0x25')](0x194);}return _0x302c08;};}function handleError(_0x3c2a66,_0x5af27b){_0x5af27b=_0x5af27b||0x1f4;return function(_0x328ad3){logger[_0x6263('0x1f')](_0x328ad3[_0x6263('0x33')]);if(_0x328ad3[_0x6263('0x34')]){delete _0x328ad3[_0x6263('0x34')];}_0x3c2a66[_0x6263('0x26')](_0x5af27b)[_0x6263('0x35')](_0x328ad3);};}exports[_0x6263('0x36')]=function(_0xb515fd,_0x326981){var _0x889e88={},_0x35378b={},_0x187247={'count':0x0,'rows':[]};var _0x577d41=_[_0x6263('0x37')](db[_0x6263('0x38')][_0x6263('0x39')],function(_0x312a57){return{'name':_0x312a57[_0x6263('0x3a')],'type':_0x312a57['type'][_0x6263('0x3b')]};});_0x35378b['model']=_['map'](_0x577d41,'name');_0x35378b['query']=_[_0x6263('0x3c')](_0xb515fd[_0x6263('0x3d')]);_0x35378b['filters']=_['intersection'](_0x35378b['model'],_0x35378b[_0x6263('0x3d')]);_0x889e88[_0x6263('0x3e')]=_[_0x6263('0x3f')](_0x35378b['model'],qs['fields'](_0xb515fd[_0x6263('0x3d')][_0x6263('0x40')]));_0x889e88[_0x6263('0x3e')]=_0x889e88[_0x6263('0x3e')][_0x6263('0x41')]?_0x889e88['attributes']:_0x35378b[_0x6263('0x42')];if(!_0xb515fd[_0x6263('0x3d')][_0x6263('0x43')](_0x6263('0x44'))){_0x889e88[_0x6263('0x29')]=qs[_0x6263('0x29')](_0xb515fd[_0x6263('0x3d')][_0x6263('0x29')]);_0x889e88[_0x6263('0x2a')]=qs[_0x6263('0x2a')](_0xb515fd[_0x6263('0x3d')][_0x6263('0x2a')]);}_0x889e88[_0x6263('0x45')]=qs[_0x6263('0x46')](_0xb515fd[_0x6263('0x3d')][_0x6263('0x46')]);_0x889e88[_0x6263('0x47')]=qs[_0x6263('0x48')](_[_0x6263('0x49')](_0xb515fd['query'],_0x35378b[_0x6263('0x48')]),_0x577d41);if(_0xb515fd[_0x6263('0x3d')][_0x6263('0x4a')]){_0x889e88['where']=_[_0x6263('0x4b')](_0x889e88[_0x6263('0x47')],{'$or':_[_0x6263('0x37')](_0x577d41,function(_0x149403){if(_0x149403['type']!=='VIRTUAL'){var _0x35159c={};_0x35159c[_0x149403['name']]={'$like':'%'+_0xb515fd['query'][_0x6263('0x4a')]+'%'};return _0x35159c;}})});}_0x889e88=_[_0x6263('0x4b')]({},_0x889e88,_0xb515fd[_0x6263('0x4c')]);var _0x5c2164={'where':_0x889e88['where']};return db[_0x6263('0x38')][_0x6263('0x2b')](_0x5c2164)[_0x6263('0x1a')](function(_0x547abc){_0x187247[_0x6263('0x2b')]=_0x547abc;if(_0xb515fd[_0x6263('0x3d')]['includeAll']){_0x889e88[_0x6263('0x4d')]=[{'all':!![]}];}return db[_0x6263('0x38')][_0x6263('0x4e')](_0x889e88);})[_0x6263('0x1a')](function(_0x3a345e){_0x187247[_0x6263('0x4f')]=_0x3a345e;return _0x187247;})[_0x6263('0x1a')](respondWithFilteredResult(_0x326981,_0x889e88))[_0x6263('0x24')](handleError(_0x326981,null));};exports['show']=function(_0x5ec10c,_0x58b3cb){var _0xdf089e={'raw':![],'where':{'id':_0x5ec10c[_0x6263('0x50')]['id']}},_0x59c3c0={};_0x59c3c0[_0x6263('0x42')]=_[_0x6263('0x3c')](db[_0x6263('0x38')][_0x6263('0x39')]);_0x59c3c0[_0x6263('0x3d')]=_[_0x6263('0x3c')](_0x5ec10c['query']);_0x59c3c0[_0x6263('0x48')]=_[_0x6263('0x3f')](_0x59c3c0[_0x6263('0x42')],_0x59c3c0[_0x6263('0x3d')]);_0xdf089e[_0x6263('0x3e')]=_[_0x6263('0x3f')](_0x59c3c0[_0x6263('0x42')],qs[_0x6263('0x40')](_0x5ec10c[_0x6263('0x3d')][_0x6263('0x40')]));_0xdf089e[_0x6263('0x3e')]=_0xdf089e[_0x6263('0x3e')]['length']?_0xdf089e[_0x6263('0x3e')]:_0x59c3c0[_0x6263('0x42')];if(_0x5ec10c[_0x6263('0x3d')][_0x6263('0x51')]){_0xdf089e[_0x6263('0x4d')]=[{'all':!![]}];}_0xdf089e=_[_0x6263('0x4b')]({},_0xdf089e,_0x5ec10c[_0x6263('0x4c')]);return db[_0x6263('0x38')][_0x6263('0x52')](_0xdf089e)[_0x6263('0x1a')](handleEntityNotFound(_0x58b3cb,null))['then'](respondWithResult(_0x58b3cb,null))[_0x6263('0x24')](handleError(_0x58b3cb,null));};exports[_0x6263('0x30')]=function(_0x5a7835,_0x498ab1){if(_0x5a7835[_0x6263('0x53')]['id']){delete _0x5a7835[_0x6263('0x53')]['id'];}return db[_0x6263('0x38')][_0x6263('0x52')]({'where':{'id':_0x5a7835['params']['id']}})[_0x6263('0x1a')](handleEntityNotFound(_0x498ab1,null))[_0x6263('0x1a')](saveUpdates(_0x5a7835[_0x6263('0x53')],null))[_0x6263('0x1a')](respondWithResult(_0x498ab1,null))[_0x6263('0x24')](handleError(_0x498ab1,null));};exports[_0x6263('0x54')]=function(_0xdb3614,_0x1113ad,_0x45a1b4){if(_0xdb3614[_0x6263('0x55')]&&_0xdb3614[_0x6263('0x55')]['filename']){_0xdb3614[_0x6263('0x53')][_0x6263('0x56')]=_0xdb3614[_0x6263('0x55')][_0x6263('0x57')];}return db['Setting'][_0x6263('0x52')]({'where':{'id':_0xdb3614[_0x6263('0x50')]['id']}})[_0x6263('0x1a')](handleEntityNotFound(_0x1113ad,null))[_0x6263('0x1a')](saveUpdates(_0xdb3614[_0x6263('0x53')],null))[_0x6263('0x1a')](respondWithResult(_0x1113ad,null))['catch'](handleError(_0x1113ad,null));};exports[_0x6263('0x58')]=function(_0x5e9cf1,_0x27c5f9,_0x316b28){if(_0x5e9cf1[_0x6263('0x55')]&&_0x5e9cf1['file'][_0x6263('0x57')]){_0x5e9cf1['body'][_0x6263('0x59')]=_0x5e9cf1[_0x6263('0x55')][_0x6263('0x57')];}return db[_0x6263('0x38')][_0x6263('0x52')]({'where':{'id':_0x5e9cf1[_0x6263('0x50')]['id']}})[_0x6263('0x1a')](handleEntityNotFound(_0x27c5f9,null))[_0x6263('0x1a')](saveUpdates(_0x5e9cf1[_0x6263('0x53')],null))['then'](respondWithResult(_0x27c5f9,null))[_0x6263('0x24')](handleError(_0x27c5f9,null));};var utilLicense=require(_0x6263('0x15'));exports['getLogo']=function(_0x7ea463,_0x54d4e4,_0x274663){var _0x37505d='server/files/images/logos';var _0xddc159={'custom':![]};return utilLicense[_0x6263('0x5a')]()[_0x6263('0x1a')](function(_0x44a897){if(_0x44a897){_0xddc159=_0x44a897;}return db[_0x6263('0x38')][_0x6263('0x52')]({'where':{'id':_0x7ea463[_0x6263('0x50')]['id']},'attributes':[_0x6263('0x56'),'loginLogo',_0x6263('0x5b'),_0x6263('0x5c'),'defaultLogo',_0x6263('0x5d'),_0x6263('0x5e'),_0x6263('0x5f')],'raw':!![]});})[_0x6263('0x1a')](handleEntityNotFound(_0x54d4e4,null))['then'](function(_0x320549){if(_0x320549){var _0x33e043=_0x320549['logo']&&fs[_0x6263('0x60')](path[_0x6263('0x61')](config[_0x6263('0x62')],_0x37505d,_[_0x6263('0x63')](_0x320549[_0x6263('0x56')])))?path['join'](config[_0x6263('0x62')],_0x37505d,_[_0x6263('0x63')](_0x320549['logo'])):path[_0x6263('0x61')](config['root'],_0x37505d,_['toLower'](_0x6263('0x64')));var _0xf96ef2='default'+_[_0x6263('0x65')](_0x6263('0x56'));if(_0x320549[_0xf96ef2]||!_0xddc159['custom']){_0x33e043=path[_0x6263('0x61')](config[_0x6263('0x62')],_0x37505d,_[_0x6263('0x63')](_0x6263('0x64')));}if(!fs[_0x6263('0x60')](_0x33e043)){throw new db[(_0x6263('0x66'))][(_0x6263('0x67'))](_[_0x6263('0x65')](_0x6263('0x56'))+'\x20not\x20found');}return _0x54d4e4[_0x6263('0x68')](_0x33e043);}})['catch'](handleError(_0x54d4e4,null));};var utilLicense=require(_0x6263('0x15'));exports[_0x6263('0x69')]=function(_0x4f2bca,_0x2aec77,_0x2f4e47){var _0x1d84ae=_0x6263('0x6a');var _0x29eccf={'custom':![]};return utilLicense[_0x6263('0x5a')]()['then'](function(_0xc529b3){if(_0xc529b3){_0x29eccf=_0xc529b3;}return db[_0x6263('0x38')]['find']({'where':{'id':_0x4f2bca[_0x6263('0x50')]['id']},'attributes':['logo',_0x6263('0x59'),_0x6263('0x5b'),_0x6263('0x5c'),_0x6263('0x6b'),_0x6263('0x5d'),_0x6263('0x5e'),_0x6263('0x5f')],'raw':!![]});})[_0x6263('0x1a')](handleEntityNotFound(_0x2aec77,null))[_0x6263('0x1a')](function(_0x4b0329){if(_0x4b0329){var _0x3888f6=_0x4b0329[_0x6263('0x59')]&&fs[_0x6263('0x60')](path[_0x6263('0x61')](config[_0x6263('0x62')],_0x1d84ae,_['toLower'](_0x4b0329[_0x6263('0x59')])))?path[_0x6263('0x61')](config['root'],_0x1d84ae,_['toLower'](_0x4b0329['loginLogo'])):path[_0x6263('0x61')](config[_0x6263('0x62')],_0x1d84ae,_['toLower'](_0x6263('0x6c')));var _0x5640ee=_0x6263('0x6d')+_[_0x6263('0x65')](_0x6263('0x59'));if(_0x4b0329[_0x5640ee]||!_0x29eccf[_0x6263('0x6e')]){_0x3888f6=path[_0x6263('0x61')](config[_0x6263('0x62')],_0x1d84ae,_[_0x6263('0x63')]('default_loginLogo.svg'));}if(!fs[_0x6263('0x60')](_0x3888f6)){throw new db[(_0x6263('0x66'))]['ValidationError'](_[_0x6263('0x65')](_0x6263('0x59'))+_0x6263('0x6f'));}return _0x2aec77['download'](_0x3888f6);}})[_0x6263('0x24')](handleError(_0x2aec77,null));};exports[_0x6263('0x70')]=function(_0x375ba5,_0x20aa28){return db[_0x6263('0x38')][_0x6263('0x52')]({'where':{'id':_0x375ba5[_0x6263('0x50')]['id']},'attributes':[_0x6263('0x71')]})[_0x6263('0x1a')](respondWithResult(_0x20aa28,null))[_0x6263('0x24')](handleError(_0x20aa28,null));};exports[_0x6263('0x72')]=function(_0x2a5e79,_0x1182c1,_0x50788d){if(_0x2a5e79['file']&&_0x2a5e79[_0x6263('0x55')][_0x6263('0x57')]){_0x2a5e79['body']['preferred']=_0x2a5e79['file'][_0x6263('0x57')];}return db[_0x6263('0x38')][_0x6263('0x52')]({'where':{'id':_0x2a5e79['params']['id']}})[_0x6263('0x1a')](handleEntityNotFound(_0x1182c1,null))[_0x6263('0x1a')](saveUpdates(_0x2a5e79[_0x6263('0x53')],null))[_0x6263('0x1a')](respondWithResult(_0x1182c1,null))[_0x6263('0x24')](handleError(_0x1182c1,null));};var utilLicense=require(_0x6263('0x15'));exports[_0x6263('0x73')]=function(_0x5baf41,_0x49b34e,_0x9f2b77){var _0x449d3d=_0x6263('0x6a');var _0x4b2d7a={'custom':![]};return utilLicense[_0x6263('0x5a')]()['then'](function(_0x5f0664){if(_0x5f0664){_0x4b2d7a=_0x5f0664;}return db['Setting'][_0x6263('0x52')]({'where':{'id':_0x5baf41[_0x6263('0x50')]['id']},'attributes':['logo',_0x6263('0x59'),'preferred',_0x6263('0x5c'),_0x6263('0x6b'),'defaultLoginLogo',_0x6263('0x5e'),'defaultFavicon'],'raw':!![]});})[_0x6263('0x1a')](handleEntityNotFound(_0x49b34e,null))['then'](function(_0x21659b){if(_0x21659b){var _0x3eb1d7=_0x21659b[_0x6263('0x5b')]&&fs[_0x6263('0x60')](path[_0x6263('0x61')](config[_0x6263('0x62')],_0x449d3d,_[_0x6263('0x63')](_0x21659b[_0x6263('0x5b')])))?path[_0x6263('0x61')](config[_0x6263('0x62')],_0x449d3d,_[_0x6263('0x63')](_0x21659b[_0x6263('0x5b')])):path[_0x6263('0x61')](config[_0x6263('0x62')],_0x449d3d,_[_0x6263('0x63')](_0x6263('0x74')));var _0x322570='default'+_[_0x6263('0x65')](_0x6263('0x5b'));if(_0x21659b[_0x322570]||!_0x4b2d7a[_0x6263('0x6e')]||!_0x4b2d7a[_0x6263('0x5b')]){_0x3eb1d7=path[_0x6263('0x61')](config[_0x6263('0x62')],_0x449d3d,_[_0x6263('0x63')](_0x6263('0x74')));}if(!fs[_0x6263('0x60')](_0x3eb1d7)){throw new db[(_0x6263('0x66'))][(_0x6263('0x67'))](_['upperFirst'](_0x6263('0x5b'))+_0x6263('0x6f'));}return _0x49b34e[_0x6263('0x68')](_0x3eb1d7);}})['catch'](handleError(_0x49b34e,null));};exports[_0x6263('0x75')]=function(_0x1ec67f,_0x4d91a9,_0x223f43){if(_0x1ec67f['file']&&_0x1ec67f[_0x6263('0x55')][_0x6263('0x57')]){_0x1ec67f[_0x6263('0x53')][_0x6263('0x5c')]=_0x1ec67f[_0x6263('0x55')][_0x6263('0x57')];}return db[_0x6263('0x38')][_0x6263('0x52')]({'where':{'id':_0x1ec67f[_0x6263('0x50')]['id']}})[_0x6263('0x1a')](handleEntityNotFound(_0x4d91a9,null))[_0x6263('0x1a')](saveUpdates(_0x1ec67f['body'],null))[_0x6263('0x1a')](respondWithResult(_0x4d91a9,null))['catch'](handleError(_0x4d91a9,null));};var utilLicense=require('../../config/license/util');exports[_0x6263('0x76')]=function(_0x5fd0f,_0x4753ad,_0x2abdc7){var _0x5b421a=_0x6263('0x6a');var _0x4be20a={'custom':![]};return utilLicense[_0x6263('0x5a')]()['then'](function(_0x3380fd){if(_0x3380fd){_0x4be20a=_0x3380fd;}return db[_0x6263('0x38')][_0x6263('0x52')]({'where':{'id':_0x5fd0f['params']['id']},'attributes':[_0x6263('0x56'),_0x6263('0x59'),_0x6263('0x5b'),_0x6263('0x5c'),'defaultLogo',_0x6263('0x5d'),_0x6263('0x5e'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x4753ad,null))[_0x6263('0x1a')](function(_0xf46cb4){if(_0xf46cb4){var _0x2ee1b0=_0xf46cb4[_0x6263('0x5c')]&&fs['existsSync'](path[_0x6263('0x61')](config[_0x6263('0x62')],_0x5b421a,_['toLower'](_0xf46cb4[_0x6263('0x5c')])))?path[_0x6263('0x61')](config[_0x6263('0x62')],_0x5b421a,_['toLower'](_0xf46cb4['favicon'])):path[_0x6263('0x61')](config[_0x6263('0x62')],_0x5b421a,_[_0x6263('0x63')](_0x6263('0x77')));var _0x1b5b4b=_0x6263('0x6d')+_['upperFirst']('favicon');if(_0xf46cb4[_0x1b5b4b]||!_0x4be20a[_0x6263('0x6e')]){_0x2ee1b0=path[_0x6263('0x61')](config[_0x6263('0x62')],_0x5b421a,_[_0x6263('0x63')](_0x6263('0x77')));}if(!fs[_0x6263('0x60')](_0x2ee1b0)){throw new db[(_0x6263('0x66'))]['ValidationError'](_[_0x6263('0x65')](_0x6263('0x5c'))+_0x6263('0x6f'));}return _0x4753ad[_0x6263('0x68')](_0x2ee1b0);}})['catch'](handleError(_0x4753ad,null));};exports[_0x6263('0x78')]=function(_0x26a1ec,_0x24cc57){var _0x28139c={'offset':moment()['utcOffset']()};_0x28139c[_0x6263('0x79')]=moment()[_0x6263('0x7a')](_0x28139c[_0x6263('0x2a')])[_0x6263('0x7b')](_0x6263('0x7c'));return _0x24cc57[_0x6263('0x26')](0xc8)[_0x6263('0x35')](_0x28139c);}; \ No newline at end of file +var _0x5183=['limit','count','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','map','Setting','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','find','body','addLogo','file','filename','logo','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','Sequelize','ValidationError','upperFirst','getLogoLogin','defaultLogo','custom','default_loginLogo.svg','\x20not\x20found','download','gdpr','securePassword','addPreferred','preferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','request','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined'];(function(_0x24a3b2,_0x30b370){var _0x1ecf2e=function(_0xfe5cee){while(--_0xfe5cee){_0x24a3b2['push'](_0x24a3b2['shift']());}};_0x1ecf2e(++_0x30b370);}(_0x5183,0x13e));var _0x3518=function(_0x183a36,_0xdc24a1){_0x183a36=_0x183a36-0x0;var _0x4efcd9=_0x5183[_0x183a36];return _0x4efcd9;};'use strict';var emlformat=require(_0x3518('0x0'));var rimraf=require(_0x3518('0x1'));var zipdir=require(_0x3518('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3518('0x3'));var BPromise=require(_0x3518('0x4'));var Mustache=require(_0x3518('0x5'));var util=require(_0x3518('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3518('0x7'));var ejs=require(_0x3518('0x8'));var fs=require('fs');var fs_extra=require(_0x3518('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3518('0xa'));var deskjs=require(_0x3518('0xb'));var toCsv=require(_0x3518('0x7'));var querystring=require('querystring');var Papa=require(_0x3518('0xc'));var Redis=require('ioredis');var authService=require(_0x3518('0xd'));var qs=require(_0x3518('0xe'));var as=require(_0x3518('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3518('0x10'))(_0x3518('0x11'));var utils=require('../../config/utils');var config=require(_0x3518('0x12'));var licenseUtil=require(_0x3518('0x13'));var db=require(_0x3518('0x14'))['db'];var jayson=require(_0x3518('0x15'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x7f5c5a,_0x44db57,_0x1fee8a,_0x47e192){return new BPromise(function(_0x563507,_0x4593cd){var _0x29d2e5=_0x47e192||client;return _0x29d2e5[_0x3518('0x16')](_0x7f5c5a,_0x1fee8a)['then'](function(_0xcd8688){logger[_0x3518('0x17')](_0x3518('0x18'),_0x44db57,_0x3518('0x19'));logger['debug'](_0x3518('0x1a'),_0x44db57,'request\x20sent',JSON[_0x3518('0x1b')](_0xcd8688));if(_0xcd8688['error']){if(_0xcd8688[_0x3518('0x1c')][_0x3518('0x1d')]===0x1f4){logger['error'](_0x3518('0x18'),_0x44db57,_0xcd8688[_0x3518('0x1c')][_0x3518('0x1e')]);return _0x4593cd(_0xcd8688[_0x3518('0x1c')][_0x3518('0x1e')]);}logger['error'](_0x3518('0x18'),_0x44db57,_0xcd8688['error'][_0x3518('0x1e')]);return _0x563507(_0xcd8688[_0x3518('0x1c')][_0x3518('0x1e')]);}else{logger['info'](_0x3518('0x18'),_0x44db57,_0x3518('0x19'));_0x563507(_0xcd8688[_0x3518('0x1f')][_0x3518('0x1e')]);}})[_0x3518('0x20')](function(_0x4a13c8){logger[_0x3518('0x1c')](_0x3518('0x18'),_0x44db57,_0x4a13c8);_0x4593cd(_0x4a13c8);});});}function respondWithStatusCode(_0x421c2e,_0x3082a7){_0x3082a7=_0x3082a7||0xcc;return function(_0x253f98){if(_0x253f98){return _0x421c2e[_0x3518('0x21')](_0x3082a7);}return _0x421c2e[_0x3518('0x22')](_0x3082a7)[_0x3518('0x23')]();};}function respondWithResult(_0x8baad6,_0x440920){_0x440920=_0x440920||0xc8;return function(_0x19577c){if(_0x19577c){return _0x8baad6[_0x3518('0x22')](_0x440920)[_0x3518('0x24')](_0x19577c);}};}function respondWithFilteredResult(_0x77f693,_0x319d89){return function(_0x428b25){if(_0x428b25){var _0xc3cab2=typeof _0x319d89[_0x3518('0x25')]===_0x3518('0x26')&&typeof _0x319d89[_0x3518('0x27')]===_0x3518('0x26');var _0x123230=_0x428b25[_0x3518('0x28')];var _0x369d58=_0xc3cab2?0x0:_0x319d89['offset'];var _0x5009e3=_0xc3cab2?_0x428b25[_0x3518('0x28')]:_0x319d89[_0x3518('0x25')]+_0x319d89['limit'];var _0xfb34d7;if(_0x5009e3>=_0x123230){_0x5009e3=_0x123230;_0xfb34d7=0xc8;}else{_0xfb34d7=0xce;}_0x77f693[_0x3518('0x22')](_0xfb34d7);return _0x77f693['set'](_0x3518('0x29'),_0x369d58+'-'+_0x5009e3+'/'+_0x123230)['json'](_0x428b25);}return null;};}function patchUpdates(_0x242fae){return function(_0x550c64){try{jsonpatch[_0x3518('0x2a')](_0x550c64,_0x242fae,!![]);}catch(_0x8dc64b){return BPromise[_0x3518('0x2b')](_0x8dc64b);}return _0x550c64[_0x3518('0x2c')]();};}function saveUpdates(_0xf5ad75,_0x3e7d29){return function(_0x47dd60){if(_0x47dd60){return _0x47dd60[_0x3518('0x2d')](_0xf5ad75)['then'](function(_0x2f3634){return _0x2f3634;});}return null;};}function removeEntity(_0x1a6ebe,_0x313be1){return function(_0x69275b){if(_0x69275b){return _0x69275b[_0x3518('0x2e')]()[_0x3518('0x2f')](function(){_0x1a6ebe[_0x3518('0x22')](0xcc)[_0x3518('0x23')]();});}};}function handleEntityNotFound(_0xd557ab,_0x12cf0a){return function(_0x16e28b){if(!_0x16e28b){_0xd557ab[_0x3518('0x21')](0x194);}return _0x16e28b;};}function handleError(_0x1c4495,_0x4e2a20){_0x4e2a20=_0x4e2a20||0x1f4;return function(_0x43b574){logger[_0x3518('0x1c')](_0x43b574[_0x3518('0x30')]);if(_0x43b574[_0x3518('0x31')]){delete _0x43b574[_0x3518('0x31')];}_0x1c4495[_0x3518('0x22')](_0x4e2a20)[_0x3518('0x32')](_0x43b574);};}exports['index']=function(_0x24d918,_0x202328){var _0x23260a={},_0x1eb308={},_0x54bab9={'count':0x0,'rows':[]};var _0x4cfa8c=_[_0x3518('0x33')](db[_0x3518('0x34')][_0x3518('0x35')],function(_0x3f8845){return{'name':_0x3f8845['fieldName'],'type':_0x3f8845[_0x3518('0x36')][_0x3518('0x37')]};});_0x1eb308[_0x3518('0x38')]=_[_0x3518('0x33')](_0x4cfa8c,_0x3518('0x31'));_0x1eb308['query']=_[_0x3518('0x39')](_0x24d918[_0x3518('0x3a')]);_0x1eb308[_0x3518('0x3b')]=_[_0x3518('0x3c')](_0x1eb308[_0x3518('0x38')],_0x1eb308[_0x3518('0x3a')]);_0x23260a[_0x3518('0x3d')]=_[_0x3518('0x3c')](_0x1eb308[_0x3518('0x38')],qs['fields'](_0x24d918[_0x3518('0x3a')][_0x3518('0x3e')]));_0x23260a[_0x3518('0x3d')]=_0x23260a['attributes'][_0x3518('0x3f')]?_0x23260a[_0x3518('0x3d')]:_0x1eb308['model'];if(!_0x24d918['query'][_0x3518('0x40')](_0x3518('0x41'))){_0x23260a[_0x3518('0x27')]=qs[_0x3518('0x27')](_0x24d918[_0x3518('0x3a')][_0x3518('0x27')]);_0x23260a['offset']=qs[_0x3518('0x25')](_0x24d918[_0x3518('0x3a')][_0x3518('0x25')]);}_0x23260a[_0x3518('0x42')]=qs['sort'](_0x24d918[_0x3518('0x3a')][_0x3518('0x43')]);_0x23260a[_0x3518('0x44')]=qs[_0x3518('0x3b')](_[_0x3518('0x45')](_0x24d918[_0x3518('0x3a')],_0x1eb308[_0x3518('0x3b')]),_0x4cfa8c);if(_0x24d918[_0x3518('0x3a')][_0x3518('0x46')]){_0x23260a[_0x3518('0x44')]=_[_0x3518('0x47')](_0x23260a[_0x3518('0x44')],{'$or':_['map'](_0x4cfa8c,function(_0x5e965e){if(_0x5e965e[_0x3518('0x36')]!=='VIRTUAL'){var _0x52df96={};_0x52df96[_0x5e965e['name']]={'$like':'%'+_0x24d918[_0x3518('0x3a')][_0x3518('0x46')]+'%'};return _0x52df96;}})});}_0x23260a=_[_0x3518('0x47')]({},_0x23260a,_0x24d918[_0x3518('0x48')]);var _0x3bdf9b={'where':_0x23260a['where']};return db[_0x3518('0x34')]['count'](_0x3bdf9b)[_0x3518('0x2f')](function(_0x1cdd74){_0x54bab9['count']=_0x1cdd74;if(_0x24d918['query'][_0x3518('0x49')]){_0x23260a[_0x3518('0x4a')]=[{'all':!![]}];}return db[_0x3518('0x34')][_0x3518('0x4b')](_0x23260a);})['then'](function(_0x760d9b){_0x54bab9[_0x3518('0x4c')]=_0x760d9b;return _0x54bab9;})['then'](respondWithFilteredResult(_0x202328,_0x23260a))[_0x3518('0x20')](handleError(_0x202328,null));};exports['show']=function(_0x2972c9,_0x3e8236){var _0x5efb90={'raw':![],'where':{'id':_0x2972c9[_0x3518('0x4d')]['id']}},_0x1c2506={};_0x1c2506['model']=_['keys'](db[_0x3518('0x34')][_0x3518('0x35')]);_0x1c2506[_0x3518('0x3a')]=_[_0x3518('0x39')](_0x2972c9['query']);_0x1c2506[_0x3518('0x3b')]=_[_0x3518('0x3c')](_0x1c2506[_0x3518('0x38')],_0x1c2506[_0x3518('0x3a')]);_0x5efb90[_0x3518('0x3d')]=_[_0x3518('0x3c')](_0x1c2506[_0x3518('0x38')],qs['fields'](_0x2972c9[_0x3518('0x3a')][_0x3518('0x3e')]));_0x5efb90['attributes']=_0x5efb90[_0x3518('0x3d')][_0x3518('0x3f')]?_0x5efb90[_0x3518('0x3d')]:_0x1c2506['model'];if(_0x2972c9[_0x3518('0x3a')][_0x3518('0x49')]){_0x5efb90['include']=[{'all':!![]}];}_0x5efb90=_['merge']({},_0x5efb90,_0x2972c9[_0x3518('0x48')]);return db['Setting'][_0x3518('0x4e')](_0x5efb90)['then'](handleEntityNotFound(_0x3e8236,null))[_0x3518('0x2f')](respondWithResult(_0x3e8236,null))[_0x3518('0x20')](handleError(_0x3e8236,null));};exports[_0x3518('0x2d')]=function(_0x5572f7,_0x23dfc1){if(_0x5572f7['body']['id']){delete _0x5572f7[_0x3518('0x4f')]['id'];}return db['Setting'][_0x3518('0x4e')]({'where':{'id':_0x5572f7['params']['id']}})[_0x3518('0x2f')](handleEntityNotFound(_0x23dfc1,null))[_0x3518('0x2f')](saveUpdates(_0x5572f7[_0x3518('0x4f')],null))[_0x3518('0x2f')](respondWithResult(_0x23dfc1,null))[_0x3518('0x20')](handleError(_0x23dfc1,null));};exports[_0x3518('0x50')]=function(_0xbc202e,_0x354a5a,_0x25e97b){if(_0xbc202e[_0x3518('0x51')]&&_0xbc202e[_0x3518('0x51')][_0x3518('0x52')]){_0xbc202e[_0x3518('0x4f')][_0x3518('0x53')]=_0xbc202e[_0x3518('0x51')]['filename'];}return db[_0x3518('0x34')]['find']({'where':{'id':_0xbc202e[_0x3518('0x4d')]['id']}})[_0x3518('0x2f')](handleEntityNotFound(_0x354a5a,null))[_0x3518('0x2f')](saveUpdates(_0xbc202e[_0x3518('0x4f')],null))[_0x3518('0x2f')](respondWithResult(_0x354a5a,null))[_0x3518('0x20')](handleError(_0x354a5a,null));};exports['addLogoLogin']=function(_0x40b3cf,_0x1e0c08,_0x3befa1){if(_0x40b3cf[_0x3518('0x51')]&&_0x40b3cf['file'][_0x3518('0x52')]){_0x40b3cf['body'][_0x3518('0x54')]=_0x40b3cf[_0x3518('0x51')][_0x3518('0x52')];}return db[_0x3518('0x34')][_0x3518('0x4e')]({'where':{'id':_0x40b3cf[_0x3518('0x4d')]['id']}})[_0x3518('0x2f')](handleEntityNotFound(_0x1e0c08,null))[_0x3518('0x2f')](saveUpdates(_0x40b3cf[_0x3518('0x4f')],null))['then'](respondWithResult(_0x1e0c08,null))['catch'](handleError(_0x1e0c08,null));};var utilLicense=require(_0x3518('0x13'));exports[_0x3518('0x55')]=function(_0x14ea33,_0x336440,_0x3bfe1c){var _0x41981a=_0x3518('0x56');var _0x363531={'custom':![]};return utilLicense[_0x3518('0x57')]()['then'](function(_0x199cb1){if(_0x199cb1){_0x363531=_0x199cb1;}return db[_0x3518('0x34')][_0x3518('0x4e')]({'where':{'id':_0x14ea33[_0x3518('0x4d')]['id']},'attributes':[_0x3518('0x53'),_0x3518('0x54'),'preferred',_0x3518('0x58'),'defaultLogo',_0x3518('0x59'),_0x3518('0x5a'),_0x3518('0x5b')],'raw':!![]});})[_0x3518('0x2f')](handleEntityNotFound(_0x336440,null))['then'](function(_0x83550a){if(_0x83550a){var _0x5c0c6f=_0x83550a['logo']&&fs[_0x3518('0x5c')](path[_0x3518('0x5d')](config[_0x3518('0x5e')],_0x41981a,_[_0x3518('0x5f')](_0x83550a[_0x3518('0x53')])))?path[_0x3518('0x5d')](config[_0x3518('0x5e')],_0x41981a,_[_0x3518('0x5f')](_0x83550a[_0x3518('0x53')])):path[_0x3518('0x5d')](config[_0x3518('0x5e')],_0x41981a,_['toLower'](_0x3518('0x60')));var _0x3ce6ac=_0x3518('0x61')+_['upperFirst'](_0x3518('0x53'));if(_0x83550a[_0x3ce6ac]||!_0x363531['custom']){_0x5c0c6f=path['join'](config[_0x3518('0x5e')],_0x41981a,_[_0x3518('0x5f')](_0x3518('0x60')));}if(!fs['existsSync'](_0x5c0c6f)){throw new db[(_0x3518('0x62'))][(_0x3518('0x63'))](_[_0x3518('0x64')](_0x3518('0x53'))+'\x20not\x20found');}return _0x336440['download'](_0x5c0c6f);}})[_0x3518('0x20')](handleError(_0x336440,null));};var utilLicense=require(_0x3518('0x13'));exports[_0x3518('0x65')]=function(_0x57e6cc,_0xdb81d9,_0x544b49){var _0x147db5=_0x3518('0x56');var _0x1e7d2b={'custom':![]};return utilLicense['getLicense']()[_0x3518('0x2f')](function(_0x23b485){if(_0x23b485){_0x1e7d2b=_0x23b485;}return db[_0x3518('0x34')]['find']({'where':{'id':_0x57e6cc[_0x3518('0x4d')]['id']},'attributes':[_0x3518('0x53'),'loginLogo','preferred','favicon',_0x3518('0x66'),_0x3518('0x59'),'defaultPreferred',_0x3518('0x5b')],'raw':!![]});})['then'](handleEntityNotFound(_0xdb81d9,null))[_0x3518('0x2f')](function(_0x29ca7f){if(_0x29ca7f){var _0x1c7043=_0x29ca7f['loginLogo']&&fs[_0x3518('0x5c')](path[_0x3518('0x5d')](config[_0x3518('0x5e')],_0x147db5,_[_0x3518('0x5f')](_0x29ca7f[_0x3518('0x54')])))?path[_0x3518('0x5d')](config[_0x3518('0x5e')],_0x147db5,_[_0x3518('0x5f')](_0x29ca7f['loginLogo'])):path['join'](config[_0x3518('0x5e')],_0x147db5,_[_0x3518('0x5f')]('default_loginLogo.svg'));var _0x10e150=_0x3518('0x61')+_[_0x3518('0x64')](_0x3518('0x54'));if(_0x29ca7f[_0x10e150]||!_0x1e7d2b[_0x3518('0x67')]){_0x1c7043=path[_0x3518('0x5d')](config[_0x3518('0x5e')],_0x147db5,_[_0x3518('0x5f')](_0x3518('0x68')));}if(!fs[_0x3518('0x5c')](_0x1c7043)){throw new db[(_0x3518('0x62'))][(_0x3518('0x63'))](_[_0x3518('0x64')](_0x3518('0x54'))+_0x3518('0x69'));}return _0xdb81d9[_0x3518('0x6a')](_0x1c7043);}})[_0x3518('0x20')](handleError(_0xdb81d9,null));};exports[_0x3518('0x6b')]=function(_0xb5fbc7,_0x209925){return db[_0x3518('0x34')]['find']({'where':{'id':_0xb5fbc7[_0x3518('0x4d')]['id']},'attributes':[_0x3518('0x6c')]})[_0x3518('0x2f')](respondWithResult(_0x209925,null))[_0x3518('0x20')](handleError(_0x209925,null));};exports[_0x3518('0x6d')]=function(_0x2fa817,_0x30742b,_0x454272){if(_0x2fa817[_0x3518('0x51')]&&_0x2fa817[_0x3518('0x51')][_0x3518('0x52')]){_0x2fa817[_0x3518('0x4f')][_0x3518('0x6e')]=_0x2fa817[_0x3518('0x51')][_0x3518('0x52')];}return db['Setting'][_0x3518('0x4e')]({'where':{'id':_0x2fa817[_0x3518('0x4d')]['id']}})[_0x3518('0x2f')](handleEntityNotFound(_0x30742b,null))[_0x3518('0x2f')](saveUpdates(_0x2fa817[_0x3518('0x4f')],null))['then'](respondWithResult(_0x30742b,null))[_0x3518('0x20')](handleError(_0x30742b,null));};var utilLicense=require(_0x3518('0x13'));exports[_0x3518('0x6f')]=function(_0x3264e0,_0xf1cfed,_0x2b45d7){var _0x3fa00b=_0x3518('0x56');var _0x307f44={'custom':![]};return utilLicense['getLicense']()[_0x3518('0x2f')](function(_0x2943f9){if(_0x2943f9){_0x307f44=_0x2943f9;}return db[_0x3518('0x34')][_0x3518('0x4e')]({'where':{'id':_0x3264e0[_0x3518('0x4d')]['id']},'attributes':[_0x3518('0x53'),_0x3518('0x54'),'preferred',_0x3518('0x58'),'defaultLogo',_0x3518('0x59'),_0x3518('0x5a'),_0x3518('0x5b')],'raw':!![]});})['then'](handleEntityNotFound(_0xf1cfed,null))[_0x3518('0x2f')](function(_0xa617f){if(_0xa617f){var _0x5863e4=_0xa617f[_0x3518('0x6e')]&&fs[_0x3518('0x5c')](path[_0x3518('0x5d')](config[_0x3518('0x5e')],_0x3fa00b,_[_0x3518('0x5f')](_0xa617f[_0x3518('0x6e')])))?path[_0x3518('0x5d')](config[_0x3518('0x5e')],_0x3fa00b,_[_0x3518('0x5f')](_0xa617f[_0x3518('0x6e')])):path[_0x3518('0x5d')](config[_0x3518('0x5e')],_0x3fa00b,_['toLower']('default_preferred.png'));var _0x5938a6='default'+_[_0x3518('0x64')](_0x3518('0x6e'));if(_0xa617f[_0x5938a6]||!_0x307f44[_0x3518('0x67')]||!_0x307f44[_0x3518('0x6e')]){_0x5863e4=path['join'](config['root'],_0x3fa00b,_['toLower'](_0x3518('0x70')));}if(!fs['existsSync'](_0x5863e4)){throw new db[(_0x3518('0x62'))][(_0x3518('0x63'))](_[_0x3518('0x64')](_0x3518('0x6e'))+_0x3518('0x69'));}return _0xf1cfed[_0x3518('0x6a')](_0x5863e4);}})[_0x3518('0x20')](handleError(_0xf1cfed,null));};exports[_0x3518('0x71')]=function(_0x21d0c6,_0x47644a,_0x2f66ec){if(_0x21d0c6[_0x3518('0x51')]&&_0x21d0c6[_0x3518('0x51')][_0x3518('0x52')]){_0x21d0c6[_0x3518('0x4f')][_0x3518('0x58')]=_0x21d0c6[_0x3518('0x51')][_0x3518('0x52')];}return db[_0x3518('0x34')][_0x3518('0x4e')]({'where':{'id':_0x21d0c6[_0x3518('0x4d')]['id']}})[_0x3518('0x2f')](handleEntityNotFound(_0x47644a,null))[_0x3518('0x2f')](saveUpdates(_0x21d0c6[_0x3518('0x4f')],null))[_0x3518('0x2f')](respondWithResult(_0x47644a,null))['catch'](handleError(_0x47644a,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x1e3561,_0x12f34c,_0x1e7229){var _0x2501dd=_0x3518('0x56');var _0x9053e={'custom':![]};return utilLicense[_0x3518('0x57')]()['then'](function(_0xab93ea){if(_0xab93ea){_0x9053e=_0xab93ea;}return db[_0x3518('0x34')]['find']({'where':{'id':_0x1e3561[_0x3518('0x4d')]['id']},'attributes':['logo',_0x3518('0x54'),'preferred',_0x3518('0x58'),_0x3518('0x66'),_0x3518('0x59'),_0x3518('0x5a'),_0x3518('0x5b')],'raw':!![]});})['then'](handleEntityNotFound(_0x12f34c,null))[_0x3518('0x2f')](function(_0x3ded56){if(_0x3ded56){var _0x347428=_0x3ded56[_0x3518('0x58')]&&fs[_0x3518('0x5c')](path[_0x3518('0x5d')](config[_0x3518('0x5e')],_0x2501dd,_[_0x3518('0x5f')](_0x3ded56[_0x3518('0x58')])))?path[_0x3518('0x5d')](config[_0x3518('0x5e')],_0x2501dd,_[_0x3518('0x5f')](_0x3ded56[_0x3518('0x58')])):path[_0x3518('0x5d')](config[_0x3518('0x5e')],_0x2501dd,_[_0x3518('0x5f')](_0x3518('0x72')));var _0x45d887=_0x3518('0x61')+_['upperFirst'](_0x3518('0x58'));if(_0x3ded56[_0x45d887]||!_0x9053e[_0x3518('0x67')]){_0x347428=path['join'](config[_0x3518('0x5e')],_0x2501dd,_[_0x3518('0x5f')](_0x3518('0x72')));}if(!fs['existsSync'](_0x347428)){throw new db[(_0x3518('0x62'))][(_0x3518('0x63'))](_[_0x3518('0x64')]('favicon')+_0x3518('0x69'));}return _0x12f34c[_0x3518('0x6a')](_0x347428);}})[_0x3518('0x20')](handleError(_0x12f34c,null));};exports[_0x3518('0x73')]=function(_0x18a8a9,_0x3be09b){var _0x36ed68={'offset':moment()[_0x3518('0x74')]()};_0x36ed68['now']=moment()['utcOffset'](_0x36ed68[_0x3518('0x25')])[_0x3518('0x75')](_0x3518('0x76'));return _0x3be09b['status'](0xc8)[_0x3518('0x32')](_0x36ed68);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index f90cb50..6044690 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0xdb8d98,_0x1ca505){var _0x1d39fe=function(_0x285e6f){while(--_0x285e6f){_0xdb8d98['push'](_0xdb8d98['shift']());}};_0x1d39fe(++_0x1ca505);}(_0xedd9,0xfc));var _0x9edd=function(_0x59706a,_0x59e628){_0x59706a=_0x59706a-0x0;var _0x3a8e8b=_0xedd9[_0x59706a];return _0x3a8e8b;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0xa064b6,_0x47ae1c){var _0x26eb9d=function(_0x111ac3){while(--_0x111ac3){_0xa064b6['push'](_0xa064b6['shift']());}};_0x26eb9d(++_0x47ae1c);}(_0x34e8,0x12c));var _0x834e=function(_0x10bf9f,_0x199e01){_0x10bf9f=_0x10bf9f-0x0;var _0x5974c8=_0x34e8[_0x10bf9f];return _0x5974c8;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index d657259..ef78595 100644 --- a/server/api/setting/setting.rpc.js +++ b/server/api/setting/setting.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57c6=['request','then','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowSetting','Setting','find','options','where','include','map','model','attributes','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1cf05e,_0x32aab9){var _0xfba324=function(_0x2e479d){while(--_0x2e479d){_0x1cf05e['push'](_0x1cf05e['shift']());}};_0xfba324(++_0x32aab9);}(_0x57c6,0x1b5));var _0x657c=function(_0xc00b74,_0xccb10d){_0xc00b74=_0xc00b74-0x0;var _0xa991c5=_0x57c6[_0xc00b74];return _0xa991c5;};'use strict';var _=require(_0x657c('0x0'));var util=require(_0x657c('0x1'));var moment=require(_0x657c('0x2'));var BPromise=require(_0x657c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x657c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x657c('0x5'));var logger=require('../../config/logger')(_0x657c('0x6'));var config=require(_0x657c('0x7'));var jayson=require(_0x657c('0x8'));var client=jayson[_0x657c('0x9')][_0x657c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c7d0e,_0x268e03,_0x3ff09c){return new BPromise(function(_0x1898f9,_0x51a0ab){return client[_0x657c('0xb')](_0x4c7d0e,_0x3ff09c)[_0x657c('0xc')](function(_0x269c75){logger['info'](_0x657c('0xd'),_0x268e03,'request\x20sent');logger[_0x657c('0xe')](_0x657c('0xf'),_0x268e03,_0x657c('0x10'),JSON[_0x657c('0x11')](_0x269c75));if(_0x269c75[_0x657c('0x12')]){if(_0x269c75[_0x657c('0x12')][_0x657c('0x13')]===0x1f4){logger[_0x657c('0x12')](_0x657c('0xd'),_0x268e03,_0x269c75[_0x657c('0x12')][_0x657c('0x14')]);return _0x51a0ab(_0x269c75[_0x657c('0x12')][_0x657c('0x14')]);}logger[_0x657c('0x12')](_0x657c('0xd'),_0x268e03,_0x269c75['error']['message']);return _0x1898f9(_0x269c75[_0x657c('0x12')]['message']);}else{logger['info'](_0x657c('0xd'),_0x268e03,'request\x20sent');_0x1898f9(_0x269c75[_0x657c('0x15')][_0x657c('0x14')]);}})['catch'](function(_0x168b3f){logger['error'](_0x657c('0xd'),_0x268e03,_0x168b3f);_0x51a0ab(_0x168b3f);});});}exports[_0x657c('0x16')]=function(_0x551f66){var _0x3c049b=this;return new Promise(function(_0xe8af27,_0x19f0f0){return db[_0x657c('0x17')][_0x657c('0x18')]({'raw':_0x551f66['options']?_0x551f66[_0x657c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x551f66[_0x657c('0x19')]?_0x551f66['options'][_0x657c('0x1a')]||null:null,'attributes':_0x551f66[_0x657c('0x19')]?_0x551f66[_0x657c('0x19')]['attributes']||null:null,'include':_0x551f66[_0x657c('0x19')]?_0x551f66[_0x657c('0x19')][_0x657c('0x1b')]?_['map'](_0x551f66[_0x657c('0x19')]['include'],function(_0x3f31d5){return{'model':db[_0x3f31d5['model']],'as':_0x3f31d5['as'],'attributes':_0x3f31d5['attributes'],'include':_0x3f31d5[_0x657c('0x1b')]?_[_0x657c('0x1c')](_0x3f31d5[_0x657c('0x1b')],function(_0x3abc02){return{'model':db[_0x3abc02[_0x657c('0x1d')]],'as':_0x3abc02['as'],'attributes':_0x3abc02[_0x657c('0x1e')],'include':_0x3abc02[_0x657c('0x1b')]?_['map'](_0x3abc02[_0x657c('0x1b')],function(_0x2cea56){return{'model':db[_0x2cea56[_0x657c('0x1d')]],'as':_0x2cea56['as'],'attributes':_0x2cea56[_0x657c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x657c('0xc')](function(_0x2e9c34){logger['info'](_0x657c('0x16'),_0x551f66);logger[_0x657c('0xe')]('ShowSetting',_0x551f66,JSON[_0x657c('0x11')](_0x2e9c34));_0xe8af27(_0x2e9c34);})[_0x657c('0x1f')](function(_0x47f06e){logger[_0x657c('0x12')](_0x657c('0x16'),_0x47f06e[_0x657c('0x14')],_0x551f66);_0x19f0f0(_0x3c049b[_0x657c('0x12')](0x1f4,_0x47f06e[_0x657c('0x14')]));});});}; \ No newline at end of file +var _0x34d9=['find','options','where','attributes','include','model','map','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSetting','Setting'];(function(_0x3ae1a9,_0x3f6243){var _0x36b7e4=function(_0x5b1fea){while(--_0x5b1fea){_0x3ae1a9['push'](_0x3ae1a9['shift']());}};_0x36b7e4(++_0x3f6243);}(_0x34d9,0x180));var _0x934d=function(_0x223113,_0x4fdd61){_0x223113=_0x223113-0x0;var _0x46c672=_0x34d9[_0x223113];return _0x46c672;};'use strict';var _=require(_0x934d('0x0'));var util=require(_0x934d('0x1'));var moment=require(_0x934d('0x2'));var BPromise=require(_0x934d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x934d('0x4'))['db'];var utils=require(_0x934d('0x5'));var logger=require('../../config/logger')(_0x934d('0x6'));var config=require('../../config/environment');var jayson=require(_0x934d('0x7'));var client=jayson['client'][_0x934d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x73aabe,_0xe0fc59,_0x21b41c){return new BPromise(function(_0x546555,_0x4de58a){return client[_0x934d('0x9')](_0x73aabe,_0x21b41c)[_0x934d('0xa')](function(_0x2417b0){logger[_0x934d('0xb')](_0x934d('0xc'),_0xe0fc59,_0x934d('0xd'));logger[_0x934d('0xe')](_0x934d('0xf'),_0xe0fc59,_0x934d('0xd'),JSON['stringify'](_0x2417b0));if(_0x2417b0[_0x934d('0x10')]){if(_0x2417b0[_0x934d('0x10')][_0x934d('0x11')]===0x1f4){logger[_0x934d('0x10')](_0x934d('0xc'),_0xe0fc59,_0x2417b0['error'][_0x934d('0x12')]);return _0x4de58a(_0x2417b0[_0x934d('0x10')][_0x934d('0x12')]);}logger[_0x934d('0x10')](_0x934d('0xc'),_0xe0fc59,_0x2417b0[_0x934d('0x10')][_0x934d('0x12')]);return _0x546555(_0x2417b0['error']['message']);}else{logger[_0x934d('0xb')]('Setting,\x20%s,\x20%s',_0xe0fc59,_0x934d('0xd'));_0x546555(_0x2417b0['result'][_0x934d('0x12')]);}})[_0x934d('0x13')](function(_0x5a2448){logger[_0x934d('0x10')](_0x934d('0xc'),_0xe0fc59,_0x5a2448);_0x4de58a(_0x5a2448);});});}exports[_0x934d('0x14')]=function(_0x5ec3d3){var _0x89f539=this;return new Promise(function(_0x532615,_0x42a9e0){return db[_0x934d('0x15')][_0x934d('0x16')]({'raw':_0x5ec3d3[_0x934d('0x17')]?_0x5ec3d3[_0x934d('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5ec3d3[_0x934d('0x17')]?_0x5ec3d3[_0x934d('0x17')][_0x934d('0x18')]||null:null,'attributes':_0x5ec3d3[_0x934d('0x17')]?_0x5ec3d3['options'][_0x934d('0x19')]||null:null,'include':_0x5ec3d3['options']?_0x5ec3d3['options'][_0x934d('0x1a')]?_['map'](_0x5ec3d3[_0x934d('0x17')][_0x934d('0x1a')],function(_0x2617cf){return{'model':db[_0x2617cf[_0x934d('0x1b')]],'as':_0x2617cf['as'],'attributes':_0x2617cf['attributes'],'include':_0x2617cf[_0x934d('0x1a')]?_[_0x934d('0x1c')](_0x2617cf[_0x934d('0x1a')],function(_0x52af28){return{'model':db[_0x52af28[_0x934d('0x1b')]],'as':_0x52af28['as'],'attributes':_0x52af28['attributes'],'include':_0x52af28[_0x934d('0x1a')]?_[_0x934d('0x1c')](_0x52af28[_0x934d('0x1a')],function(_0x39b352){return{'model':db[_0x39b352[_0x934d('0x1b')]],'as':_0x39b352['as'],'attributes':_0x39b352[_0x934d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x934d('0xa')](function(_0x566f93){logger['info'](_0x934d('0x14'),_0x5ec3d3);logger[_0x934d('0xe')](_0x934d('0x14'),_0x5ec3d3,JSON['stringify'](_0x566f93));_0x532615(_0x566f93);})[_0x934d('0x13')](function(_0x5be30e){logger[_0x934d('0x10')](_0x934d('0x14'),_0x5be30e[_0x934d('0x12')],_0x5ec3d3);_0x42a9e0(_0x89f539[_0x934d('0x10')](0x1f4,_0x5be30e['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 0870449..a5bfa1d 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x2bc2d0,_0x141c6b){var _0x50490e=function(_0x2c22ed){while(--_0x2c22ed){_0x2bc2d0['push'](_0x2bc2d0['shift']());}};_0x50490e(++_0x141c6b);}(_0x7a54,0x106));var _0x47a5=function(_0x7c229b,_0x2977a4){_0x7c229b=_0x7c229b-0x0;var _0x489010=_0x7a54[_0x7c229b];return _0x489010;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file +var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x4e2542,_0x506ad0){var _0x2256ab=function(_0x2684b){while(--_0x2684b){_0x4e2542['push'](_0x4e2542['shift']());}};_0x2256ab(++_0x506ad0);}(_0x7a54,0x106));var _0x47a5=function(_0x42e2ec,_0x8bf7f9){_0x42e2ec=_0x42e2ec-0x0;var _0x295a19=_0x7a54[_0x42e2ec];return _0x295a19;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index ff900d4..c0387a1 100644 --- a/server/api/smsAccount/smsAccount.attributes.js +++ b/server/api/smsAccount/smsAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3da8=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','ENUM','twilio','skebby','clicksend','plivo','clickatell','bandwidth','infobip','intelepeer','BOOLEAN'];(function(_0x12b7c7,_0x573818){var _0x506215=function(_0x316b7b){while(--_0x316b7b){_0x12b7c7['push'](_0x12b7c7['shift']());}};_0x506215(++_0x573818);}(_0x3da8,0x18f));var _0x83da=function(_0x408e6d,_0x44a53a){_0x408e6d=_0x408e6d-0x0;var _0x250536=_0x3da8[_0x408e6d];return _0x250536;};'use strict';var Sequelize=require(_0x83da('0x0'));var rs=require(_0x83da('0x1'));module[_0x83da('0x2')]={'name':{'type':Sequelize[_0x83da('0x3')],'unique':_0x83da('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x83da('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x83da('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x83da('0x3')]},'type':{'type':Sequelize[_0x83da('0x5')](_0x83da('0x6'),_0x83da('0x7'),'connectel',_0x83da('0x8'),_0x83da('0x9'),_0x83da('0xa'),_0x83da('0xb'),'csc',_0x83da('0xc'),_0x83da('0xd'))},'accountSid':{'type':Sequelize[_0x83da('0x3')]},'authId':{'type':Sequelize[_0x83da('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x83da('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x83da('0x3')]},'password':{'type':Sequelize[_0x83da('0x3')]},'apiKey':{'type':Sequelize[_0x83da('0x3')]},'applicationId':{'type':Sequelize[_0x83da('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x83da('0x3')]},'deliveryReport':{'type':Sequelize[_0x83da('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x83da('0x3')]},'notificationTemplate':{'type':Sequelize[_0x83da('0xf')],'defaultValue':function(){return _0x83da('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x83da('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x83da('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x83da('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x83da('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x83da('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x83da('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x83da('0xe')],'defaultValue':![],'comment':_0x83da('0x13'),'set':function(_0x2b345b){if(!_0x2b345b)this[_0x83da('0x14')](_0x83da('0x15'),null);this[_0x83da('0x14')](_0x83da('0x16'),_0x2b345b);}}}; \ No newline at end of file +var _0x650f=['skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x650f,0x198));var _0xf650=function(_0x454af0,_0x518e07){_0x454af0=_0x454af0-0x0;var _0x519c0c=_0x650f[_0x454af0];return _0x519c0c;};'use strict';var Sequelize=require(_0xf650('0x0'));var rs=require(_0xf650('0x1'));module[_0xf650('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xf650('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xf650('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xf650('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf650('0x5')]();}},'phone':{'type':Sequelize[_0xf650('0x4')]},'type':{'type':Sequelize['ENUM']('twilio',_0xf650('0x6'),_0xf650('0x7'),_0xf650('0x8'),_0xf650('0x9'),_0xf650('0xa'),_0xf650('0xb'),_0xf650('0xc'),'infobip','intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xf650('0x4')]},'authToken':{'type':Sequelize[_0xf650('0x4')]},'smsMethod':{'type':Sequelize[_0xf650('0xd')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xf650('0x4')]},'applicationId':{'type':Sequelize[_0xf650('0x4')]},'accountId':{'type':Sequelize[_0xf650('0x4')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xf650('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xf650('0x4')]},'notificationTemplate':{'type':Sequelize[_0xf650('0xf')],'defaultValue':function(){return _0xf650('0x10');}},'notificationSound':{'type':Sequelize[_0xf650('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf650('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf650('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf650('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf650('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf650('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xf650('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf650('0x11')],'comment':_0xf650('0x12')},'mandatoryDisposition':{'type':Sequelize[_0xf650('0xe')],'defaultValue':![],'comment':_0xf650('0x13'),'set':function(_0x473f06){if(!_0x473f06)this[_0xf650('0x14')](_0xf650('0x15'),null);this[_0xf650('0x14')](_0xf650('0x16'),_0x473f06);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index cf21bfe..d3d6860 100644 --- a/server/api/smsAccount/smsAccount.controller.js +++ b/server/api/smsAccount/smsAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e4d=['List','out','SmsMessage','Messages','dataValues','push','skebby_dispatch_id','statusInt','requestid','status_code','message_id','groupName','DELIVERED','redif','inspect','clicksend','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','removeAgents','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsAccount.socket','register','jayson/promise','client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','get','SmsAccounts','UserProfileResource','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','show','params','rawAttributes','length','includeAll','find','catch','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','applications','asc','Applications','account','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','mobile','twilio','From','Body','messageId','MessageSid','skebby','from','sender','connectel','plivo','Text','MessageUUID','infobip','results','text','csc','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','CmList','ListId','Contacts','DESC','list','omit','contact','SmsInteraction','spread','created','autoclose','close','unmanaged','interaction','ContactId','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','receiveMessage','entity\x20found','Content-Type','text/xml','\x0a','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Tag','Tags','color','tag','to\x20is\x20mandatory'];(function(_0x28c913,_0x196782){var _0x7f3b3a=function(_0x2160dd){while(--_0x2160dd){_0x28c913['push'](_0x28c913['shift']());}};_0x7f3b3a(++_0x196782);}(_0x0e4d,0x106));var _0xd0e4=function(_0x54278d,_0xbc7eae){_0x54278d=_0x54278d-0x0;var _0x372d20=_0x0e4d[_0x54278d];return _0x372d20;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd0e4('0x0'));var jsonpatch=require(_0xd0e4('0x1'));var rp=require(_0xd0e4('0x2'));var moment=require(_0xd0e4('0x3'));var BPromise=require(_0xd0e4('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd0e4('0x5'));var sox=require(_0xd0e4('0x6'));var csv=require(_0xd0e4('0x7'));var ejs=require(_0xd0e4('0x8'));var fs=require('fs');var fs_extra=require(_0xd0e4('0x9'));var _=require(_0xd0e4('0xa'));var squel=require(_0xd0e4('0xb'));var crypto=require(_0xd0e4('0xc'));var jsforce=require(_0xd0e4('0xd'));var deskjs=require(_0xd0e4('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd0e4('0xf'));var Papa=require(_0xd0e4('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd0e4('0x11'))(_0xd0e4('0x12'));var utils=require(_0xd0e4('0x13'));var config=require(_0xd0e4('0x14'));var licenseUtil=require(_0xd0e4('0x15'));var db=require(_0xd0e4('0x16'))['db'];config['redis']=_[_0xd0e4('0x17')](config[_0xd0e4('0x18')],{'host':_0xd0e4('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd0e4('0x18')]));require(_0xd0e4('0x1a'))[_0xd0e4('0x1b')](socket);var jayson=require(_0xd0e4('0x1c'));var client=jayson[_0xd0e4('0x1d')][_0xd0e4('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x2ebf91,_0x1cb681,_0x3406f5,_0x80bebb){return new BPromise(function(_0x1d4cb6,_0x52a69b){var _0x434de4=_0x80bebb||client;return _0x434de4['request'](_0x2ebf91,_0x3406f5)[_0xd0e4('0x1f')](function(_0x94b1dc){logger[_0xd0e4('0x20')](_0xd0e4('0x21'),_0x1cb681,_0xd0e4('0x22'));logger[_0xd0e4('0x23')](_0xd0e4('0x24'),_0x1cb681,'request\x20sent',JSON[_0xd0e4('0x25')](_0x94b1dc));if(_0x94b1dc[_0xd0e4('0x26')]){if(_0x94b1dc[_0xd0e4('0x26')][_0xd0e4('0x27')]===0x1f4){logger[_0xd0e4('0x26')](_0xd0e4('0x21'),_0x1cb681,_0x94b1dc[_0xd0e4('0x26')][_0xd0e4('0x28')]);return _0x52a69b(_0x94b1dc[_0xd0e4('0x26')]['message']);}logger['error'](_0xd0e4('0x21'),_0x1cb681,_0x94b1dc[_0xd0e4('0x26')][_0xd0e4('0x28')]);return _0x1d4cb6(_0x94b1dc[_0xd0e4('0x26')][_0xd0e4('0x28')]);}else{logger[_0xd0e4('0x20')](_0xd0e4('0x21'),_0x1cb681,'request\x20sent');_0x1d4cb6(_0x94b1dc[_0xd0e4('0x29')]['message']);}})['catch'](function(_0x1af3c7){logger[_0xd0e4('0x26')](_0xd0e4('0x21'),_0x1cb681,_0x1af3c7);_0x52a69b(_0x1af3c7);});});}function respondWithStatusCode(_0x29851b,_0xdb0608){_0xdb0608=_0xdb0608||0xcc;return function(_0x1df575){if(_0x1df575){return _0x29851b['sendStatus'](_0xdb0608);}return _0x29851b['status'](_0xdb0608)[_0xd0e4('0x2a')]();};}function respondWithResult(_0x3297ab,_0x199be3){_0x199be3=_0x199be3||0xc8;return function(_0xe6a3e3){if(_0xe6a3e3){return _0x3297ab[_0xd0e4('0x2b')](_0x199be3)[_0xd0e4('0x2c')](_0xe6a3e3);}};}function respondWithFilteredResult(_0x5932c3,_0xe7fb17){return function(_0x18bfb8){if(_0x18bfb8){var _0x1f693e=typeof _0xe7fb17[_0xd0e4('0x2d')]==='undefined'&&typeof _0xe7fb17[_0xd0e4('0x2e')]==='undefined';var _0x490049=_0x18bfb8[_0xd0e4('0x2f')];var _0x1cd8f1=_0x1f693e?0x0:_0xe7fb17[_0xd0e4('0x2d')];var _0x2325df=_0x1f693e?_0x18bfb8[_0xd0e4('0x2f')]:_0xe7fb17['offset']+_0xe7fb17[_0xd0e4('0x2e')];var _0x48ccf5;if(_0x2325df>=_0x490049){_0x2325df=_0x490049;_0x48ccf5=0xc8;}else{_0x48ccf5=0xce;}_0x5932c3[_0xd0e4('0x2b')](_0x48ccf5);return _0x5932c3[_0xd0e4('0x30')](_0xd0e4('0x31'),_0x1cd8f1+'-'+_0x2325df+'/'+_0x490049)[_0xd0e4('0x2c')](_0x18bfb8);}return null;};}function patchUpdates(_0x2a5953){return function(_0x1c6356){try{jsonpatch[_0xd0e4('0x32')](_0x1c6356,_0x2a5953,!![]);}catch(_0x11fd3a){return BPromise[_0xd0e4('0x33')](_0x11fd3a);}return _0x1c6356[_0xd0e4('0x34')]();};}function saveUpdates(_0x156553,_0x4958e0){return function(_0x27581f){if(_0x27581f){return _0x27581f[_0xd0e4('0x35')](_0x156553)[_0xd0e4('0x1f')](function(_0x3db1eb){return _0x3db1eb;});}return null;};}function removeEntity(_0x47dd35,_0x3756a5){return function(_0x523502){if(_0x523502){return _0x523502['destroy']()['then'](function(){var _0x421dfb=_0x523502[_0xd0e4('0x36')]({'plain':!![]});var _0x11def1=_0xd0e4('0x37');return db[_0xd0e4('0x38')]['destroy']({'where':{'type':_0x11def1,'resourceId':_0x421dfb['id']}})['then'](function(){return _0x523502;});})[_0xd0e4('0x1f')](function(){_0x47dd35['status'](0xcc)[_0xd0e4('0x2a')]();});}};}function handleEntityNotFound(_0x46034f,_0x2a8a10){return function(_0x5e3012){if(!_0x5e3012){_0x46034f[_0xd0e4('0x39')](0x194);}return _0x5e3012;};}function handleError(_0x12f7ad,_0x351535){_0x351535=_0x351535||0x1f4;return function(_0x52682a){logger[_0xd0e4('0x26')](_0x52682a['stack']);if(_0x52682a[_0xd0e4('0x3a')]){delete _0x52682a[_0xd0e4('0x3a')];}_0x12f7ad[_0xd0e4('0x2b')](_0x351535)[_0xd0e4('0x3b')](_0x52682a);};}exports[_0xd0e4('0x3c')]=function(_0x26a5ab,_0x567059){var _0x256b87={'include':[{'model':db[_0xd0e4('0x3d')],'as':_0xd0e4('0x3e')}]},_0x519215={},_0xa62e2c={'count':0x0,'rows':[]};var _0x273077=_[_0xd0e4('0x3f')](db[_0xd0e4('0x40')]['rawAttributes'],function(_0x2af761){return{'name':_0x2af761[_0xd0e4('0x41')],'type':_0x2af761[_0xd0e4('0x42')][_0xd0e4('0x43')]};});_0x519215[_0xd0e4('0x44')]=_[_0xd0e4('0x3f')](_0x273077,'name');_0x519215[_0xd0e4('0x45')]=_[_0xd0e4('0x46')](_0x26a5ab[_0xd0e4('0x45')]);_0x519215[_0xd0e4('0x47')]=_['intersection'](_0x519215['model'],_0x519215['query']);_0x256b87[_0xd0e4('0x48')]=_[_0xd0e4('0x49')](_0x519215[_0xd0e4('0x44')],qs[_0xd0e4('0x4a')](_0x26a5ab[_0xd0e4('0x45')]['fields']));_0x256b87[_0xd0e4('0x48')]=_0x256b87[_0xd0e4('0x48')]['length']?_0x256b87[_0xd0e4('0x48')]:_0x519215['model'];if(!_0x26a5ab[_0xd0e4('0x45')][_0xd0e4('0x4b')](_0xd0e4('0x4c'))){_0x256b87[_0xd0e4('0x2e')]=qs[_0xd0e4('0x2e')](_0x26a5ab['query'][_0xd0e4('0x2e')]);_0x256b87['offset']=qs[_0xd0e4('0x2d')](_0x26a5ab['query'][_0xd0e4('0x2d')]);}_0x256b87[_0xd0e4('0x4d')]=qs[_0xd0e4('0x4e')](_0x26a5ab[_0xd0e4('0x45')]['sort']);_0x256b87[_0xd0e4('0x4f')]=qs['filters'](_[_0xd0e4('0x50')](_0x26a5ab['query'],_0x519215[_0xd0e4('0x47')]),_0x273077);if(_0x26a5ab[_0xd0e4('0x45')]['filter']){_0x256b87[_0xd0e4('0x4f')]=_[_0xd0e4('0x51')](_0x256b87['where'],{'$or':_[_0xd0e4('0x3f')](_0x273077,function(_0x1fa05a){if(_0x1fa05a['type']!==_0xd0e4('0x52')){var _0xa3a2f5={};_0xa3a2f5[_0x1fa05a[_0xd0e4('0x3a')]]={'$like':'%'+_0x26a5ab[_0xd0e4('0x45')][_0xd0e4('0x53')]+'%'};return _0xa3a2f5;}})});}_0x256b87=_[_0xd0e4('0x51')]({},_0x256b87,_0x26a5ab[_0xd0e4('0x54')]);var _0x31aef3={'where':_0x256b87[_0xd0e4('0x4f')]};return db[_0xd0e4('0x40')][_0xd0e4('0x2f')](_0x31aef3)[_0xd0e4('0x1f')](function(_0x567f55){_0xa62e2c['count']=_0x567f55;if(_0x26a5ab[_0xd0e4('0x45')]['includeAll']){_0x256b87[_0xd0e4('0x55')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x256b87);})[_0xd0e4('0x1f')](function(_0x56a2ef){_0xa62e2c['rows']=_0x56a2ef;return _0xa62e2c;})[_0xd0e4('0x1f')](respondWithFilteredResult(_0x567059,_0x256b87))['catch'](handleError(_0x567059,null));};exports[_0xd0e4('0x56')]=function(_0x4ce3e1,_0x43cec2){var _0x2db588={'raw':![],'where':{'id':_0x4ce3e1[_0xd0e4('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xd0e4('0x3e')}]},_0x18c326={};_0x18c326[_0xd0e4('0x44')]=_[_0xd0e4('0x46')](db[_0xd0e4('0x40')][_0xd0e4('0x58')]);_0x18c326[_0xd0e4('0x45')]=_['keys'](_0x4ce3e1[_0xd0e4('0x45')]);_0x18c326['filters']=_[_0xd0e4('0x49')](_0x18c326[_0xd0e4('0x44')],_0x18c326[_0xd0e4('0x45')]);_0x2db588[_0xd0e4('0x48')]=_['intersection'](_0x18c326[_0xd0e4('0x44')],qs[_0xd0e4('0x4a')](_0x4ce3e1[_0xd0e4('0x45')][_0xd0e4('0x4a')]));_0x2db588['attributes']=_0x2db588[_0xd0e4('0x48')][_0xd0e4('0x59')]?_0x2db588[_0xd0e4('0x48')]:_0x18c326[_0xd0e4('0x44')];if(_0x4ce3e1[_0xd0e4('0x45')][_0xd0e4('0x5a')]){_0x2db588['include']=[{'all':!![]}];}_0x2db588=_[_0xd0e4('0x51')]({},_0x2db588,_0x4ce3e1[_0xd0e4('0x54')]);return db[_0xd0e4('0x40')][_0xd0e4('0x5b')](_0x2db588)[_0xd0e4('0x1f')](handleEntityNotFound(_0x43cec2,null))[_0xd0e4('0x1f')](respondWithResult(_0x43cec2,null))[_0xd0e4('0x5c')](handleError(_0x43cec2,null));};exports[_0xd0e4('0x5d')]=function(_0x19bb81,_0x336fda){return db[_0xd0e4('0x40')][_0xd0e4('0x5d')](_0x19bb81[_0xd0e4('0x5e')],{})['then'](function(_0x36b1e9){var _0x1e8227=_0x19bb81[_0xd0e4('0x5f')][_0xd0e4('0x36')]({'plain':!![]});if(!_0x1e8227)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e8227[_0xd0e4('0x60')]===_0xd0e4('0x5f')){var _0x437796=_0x36b1e9['get']({'plain':!![]});var _0x387bba=_0xd0e4('0x37');return db[_0xd0e4('0x61')]['find']({'where':{'name':_0x387bba,'userProfileId':_0x1e8227['userProfileId']},'raw':!![]})[_0xd0e4('0x1f')](function(_0x13816b){if(_0x13816b&&_0x13816b[_0xd0e4('0x62')]===0x0){return db['UserProfileResource'][_0xd0e4('0x5d')]({'name':_0x437796[_0xd0e4('0x3a')],'resourceId':_0x437796['id'],'type':_0x13816b[_0xd0e4('0x3a')],'sectionId':_0x13816b['id']},{})[_0xd0e4('0x1f')](function(){return _0x36b1e9;});}else{return _0x36b1e9;}})['catch'](function(_0x3ac04e){logger[_0xd0e4('0x26')](_0xd0e4('0x63'),_0x3ac04e);throw _0x3ac04e;});}return _0x36b1e9;})['then'](respondWithResult(_0x336fda,0xc9))[_0xd0e4('0x5c')](handleError(_0x336fda,null));};exports['update']=function(_0x208fd9,_0x18d43d){if(_0x208fd9[_0xd0e4('0x5e')]['id']){delete _0x208fd9['body']['id'];}return db[_0xd0e4('0x40')][_0xd0e4('0x5b')]({'where':{'id':_0x208fd9[_0xd0e4('0x57')]['id']},'include':[{'model':db[_0xd0e4('0x3d')],'as':_0xd0e4('0x3e')}]})[_0xd0e4('0x1f')](handleEntityNotFound(_0x18d43d,null))[_0xd0e4('0x1f')](saveUpdates(_0x208fd9['body'],null))[_0xd0e4('0x1f')](respondWithResult(_0x18d43d,null))[_0xd0e4('0x5c')](handleError(_0x18d43d,null));};exports[_0xd0e4('0x64')]=function(_0x34cd0d,_0x5d76ac){return db[_0xd0e4('0x40')][_0xd0e4('0x5b')]({'where':{'id':_0x34cd0d['params']['id']}})[_0xd0e4('0x1f')](handleEntityNotFound(_0x5d76ac,null))[_0xd0e4('0x1f')](removeEntity(_0x5d76ac,null))['catch'](handleError(_0x5d76ac,null));};exports[_0xd0e4('0x65')]=function(_0x4f8f98,_0x92bf92){return db[_0xd0e4('0x40')][_0xd0e4('0x65')]()[_0xd0e4('0x1f')](respondWithResult(_0x92bf92,null))['catch'](handleError(_0x92bf92,null));};exports[_0xd0e4('0x66')]=function(_0x40813c,_0x88b57d,_0x3e4243){if(_0x40813c[_0xd0e4('0x5e')]['id']){delete _0x40813c[_0xd0e4('0x5e')]['id'];}return db['SmsAccount'][_0xd0e4('0x5b')]({'where':{'id':_0x40813c[_0xd0e4('0x57')]['id']}})[_0xd0e4('0x1f')](handleEntityNotFound(_0x88b57d,null))[_0xd0e4('0x1f')](function(_0x596847){if(_0x596847){_0x40813c[_0xd0e4('0x5e')][_0xd0e4('0x67')]=_0x596847['id'];return db[_0xd0e4('0x68')]['create'](_0x40813c[_0xd0e4('0x5e')]);}})['then'](respondWithResult(_0x88b57d,null))[_0xd0e4('0x5c')](handleError(_0x88b57d,null));};exports[_0xd0e4('0x69')]=function(_0x1f4fa3,_0x4e41ce,_0x49e80c){var _0x384630={'raw':![],'where':{}};var _0x2530bd={};var _0x5328db={'count':0x0,'rows':[]};return db[_0xd0e4('0x40')][_0xd0e4('0x6a')]({'where':{'id':_0x1f4fa3[_0xd0e4('0x57')]['id']}})[_0xd0e4('0x1f')](handleEntityNotFound(_0x4e41ce,null))[_0xd0e4('0x1f')](function(_0x23614e){if(_0x23614e){_0x2530bd[_0xd0e4('0x44')]=_[_0xd0e4('0x46')](db[_0xd0e4('0x68')][_0xd0e4('0x58')]);_0x2530bd[_0xd0e4('0x45')]=_[_0xd0e4('0x46')](_0x1f4fa3['query']);_0x2530bd[_0xd0e4('0x47')]=_[_0xd0e4('0x49')](_0x2530bd[_0xd0e4('0x44')],_0x2530bd[_0xd0e4('0x45')]);_0x384630[_0xd0e4('0x48')]=_[_0xd0e4('0x49')](_0x2530bd[_0xd0e4('0x44')],qs[_0xd0e4('0x4a')](_0x1f4fa3['query']['fields']));_0x384630[_0xd0e4('0x48')]=_0x384630[_0xd0e4('0x48')]['length']?_0x384630[_0xd0e4('0x48')]:_0x2530bd[_0xd0e4('0x44')];if(!_0x1f4fa3['query'][_0xd0e4('0x4b')]('nolimit')){_0x384630['limit']=qs[_0xd0e4('0x2e')](_0x1f4fa3[_0xd0e4('0x45')][_0xd0e4('0x2e')]);_0x384630[_0xd0e4('0x2d')]=qs[_0xd0e4('0x2d')](_0x1f4fa3[_0xd0e4('0x45')][_0xd0e4('0x2d')]);}_0x384630[_0xd0e4('0x4d')]=qs['sort'](_0x1f4fa3[_0xd0e4('0x45')]['sort']);_0x384630[_0xd0e4('0x4f')]=qs[_0xd0e4('0x47')](_[_0xd0e4('0x50')](_0x1f4fa3[_0xd0e4('0x45')],_0x2530bd[_0xd0e4('0x47')]));_0x384630[_0xd0e4('0x4f')][_0xd0e4('0x67')]=_0x23614e['id'];if(_0x1f4fa3[_0xd0e4('0x45')][_0xd0e4('0x53')]){_0x384630[_0xd0e4('0x4f')]=_['merge'](_0x384630[_0xd0e4('0x4f')],{'$or':_[_0xd0e4('0x3f')](_0x384630[_0xd0e4('0x48')],function(_0x5deca2){var _0x1752ae={};_0x1752ae[_0x5deca2]={'$like':'%'+_0x1f4fa3['query'][_0xd0e4('0x53')]+'%'};return _0x1752ae;})});}_0x384630=_['merge']({},_0x384630,_0x1f4fa3['options']);return db['Disposition']['count']({'where':_0x384630[_0xd0e4('0x4f')]})[_0xd0e4('0x1f')](function(_0x1c39d2){_0x5328db['count']=_0x1c39d2;if(_0x1f4fa3[_0xd0e4('0x45')][_0xd0e4('0x5a')]){_0x384630[_0xd0e4('0x55')]=[{'all':!![]}];}return db[_0xd0e4('0x68')][_0xd0e4('0x6b')](_0x384630);})['then'](function(_0xee06c3){_0x5328db[_0xd0e4('0x6c')]=_0xee06c3;return _0x5328db;});}})[_0xd0e4('0x1f')](respondWithFilteredResult(_0x4e41ce,_0x384630))[_0xd0e4('0x5c')](handleError(_0x4e41ce,null));};exports['removeDispositions']=function(_0xa364b3,_0x5c9a52,_0x357310){return db['SmsAccount'][_0xd0e4('0x5b')]({'where':{'id':_0xa364b3[_0xd0e4('0x57')]['id']}})['then'](handleEntityNotFound(_0x5c9a52,null))['then'](function(_0x2371ab){if(_0x2371ab){return _0x2371ab[_0xd0e4('0x6d')](_0xa364b3[_0xd0e4('0x45')][_0xd0e4('0x6e')]);}})[_0xd0e4('0x1f')](respondWithStatusCode(_0x5c9a52,null))['catch'](handleError(_0x5c9a52,null));};exports[_0xd0e4('0x6f')]=function(_0x5603de,_0x30aa2f,_0x4bbce6){if(_0x5603de[_0xd0e4('0x5e')]['id']){delete _0x5603de['body']['id'];}return db[_0xd0e4('0x40')][_0xd0e4('0x5b')]({'where':{'id':_0x5603de[_0xd0e4('0x57')]['id']}})[_0xd0e4('0x1f')](handleEntityNotFound(_0x30aa2f,null))[_0xd0e4('0x1f')](function(_0x4332ca){if(_0x4332ca){_0x5603de['body'][_0xd0e4('0x67')]=_0x4332ca['id'];return db[_0xd0e4('0x70')][_0xd0e4('0x5d')](_0x5603de[_0xd0e4('0x5e')]);}})['then'](respondWithResult(_0x30aa2f,null))[_0xd0e4('0x5c')](handleError(_0x30aa2f,null));};exports[_0xd0e4('0x71')]=function(_0xed205b,_0x4123b4,_0x44b3fc){var _0x144c61={'raw':![],'where':{}};var _0x34a42a={};var _0xb8b4fa={'count':0x0,'rows':[]};return db[_0xd0e4('0x40')]['findOne']({'where':{'id':_0xed205b[_0xd0e4('0x57')]['id']}})[_0xd0e4('0x1f')](handleEntityNotFound(_0x4123b4,null))[_0xd0e4('0x1f')](function(_0x51629f){if(_0x51629f){_0x34a42a['model']=_[_0xd0e4('0x46')](db[_0xd0e4('0x70')][_0xd0e4('0x58')]);_0x34a42a[_0xd0e4('0x45')]=_[_0xd0e4('0x46')](_0xed205b['query']);_0x34a42a[_0xd0e4('0x47')]=_['intersection'](_0x34a42a['model'],_0x34a42a[_0xd0e4('0x45')]);_0x144c61[_0xd0e4('0x48')]=_[_0xd0e4('0x49')](_0x34a42a[_0xd0e4('0x44')],qs[_0xd0e4('0x4a')](_0xed205b[_0xd0e4('0x45')][_0xd0e4('0x4a')]));_0x144c61[_0xd0e4('0x48')]=_0x144c61[_0xd0e4('0x48')][_0xd0e4('0x59')]?_0x144c61[_0xd0e4('0x48')]:_0x34a42a['model'];if(!_0xed205b[_0xd0e4('0x45')][_0xd0e4('0x4b')](_0xd0e4('0x4c'))){_0x144c61[_0xd0e4('0x2e')]=qs['limit'](_0xed205b[_0xd0e4('0x45')][_0xd0e4('0x2e')]);_0x144c61[_0xd0e4('0x2d')]=qs[_0xd0e4('0x2d')](_0xed205b['query'][_0xd0e4('0x2d')]);}_0x144c61[_0xd0e4('0x4d')]=qs[_0xd0e4('0x4e')](_0xed205b[_0xd0e4('0x45')]['sort']);_0x144c61[_0xd0e4('0x4f')]=qs['filters'](_[_0xd0e4('0x50')](_0xed205b[_0xd0e4('0x45')],_0x34a42a[_0xd0e4('0x47')]));_0x144c61[_0xd0e4('0x4f')][_0xd0e4('0x67')]=_0x51629f['id'];if(_0xed205b['query'][_0xd0e4('0x53')]){_0x144c61[_0xd0e4('0x4f')]=_['merge'](_0x144c61[_0xd0e4('0x4f')],{'$or':_[_0xd0e4('0x3f')](_0x144c61[_0xd0e4('0x48')],function(_0x4abfaa){var _0x5d5a9d={};_0x5d5a9d[_0x4abfaa]={'$like':'%'+_0xed205b[_0xd0e4('0x45')][_0xd0e4('0x53')]+'%'};return _0x5d5a9d;})});}_0x144c61=_[_0xd0e4('0x51')]({},_0x144c61,_0xed205b['options']);return db['CannedAnswer'][_0xd0e4('0x2f')]({'where':_0x144c61[_0xd0e4('0x4f')]})[_0xd0e4('0x1f')](function(_0x121919){_0xb8b4fa['count']=_0x121919;if(_0xed205b['query'][_0xd0e4('0x5a')]){_0x144c61[_0xd0e4('0x55')]=[{'all':!![]}];}return db[_0xd0e4('0x70')][_0xd0e4('0x6b')](_0x144c61);})[_0xd0e4('0x1f')](function(_0x69ad72){_0xb8b4fa[_0xd0e4('0x6c')]=_0x69ad72;return _0xb8b4fa;});}})[_0xd0e4('0x1f')](respondWithFilteredResult(_0x4123b4,_0x144c61))[_0xd0e4('0x5c')](handleError(_0x4123b4,null));};exports[_0xd0e4('0x72')]=function(_0x252a93,_0x56e5ce,_0x1708f0){return db[_0xd0e4('0x40')]['find']({'where':{'id':_0x252a93['params']['id']}})['then'](handleEntityNotFound(_0x56e5ce,null))[_0xd0e4('0x1f')](function(_0x2469f7){if(_0x2469f7){return _0x2469f7['removeAnswers'](_0x252a93[_0xd0e4('0x45')]['ids']);}})[_0xd0e4('0x1f')](respondWithStatusCode(_0x56e5ce,null))[_0xd0e4('0x5c')](handleError(_0x56e5ce,null));};exports[_0xd0e4('0x73')]=function(_0x586194,_0x1e8f51,_0x40d2a7){var _0x127896={'channel':_0xd0e4('0x74')};var _0x54b491=[];var _0x4f3eed=[];var _0x423e78={};return db[_0xd0e4('0x40')][_0xd0e4('0x5b')]({'where':{'id':_0x586194['params']['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0xd0e4('0x1f')](handleEntityNotFound(_0x1e8f51,null))[_0xd0e4('0x1f')](function(_0x4985af){_0x127896['account']=_0x4985af;_0x127896[_0xd0e4('0x75')]=_['orderBy'](_0x4985af['Applications'],['priority'],[_0xd0e4('0x76')]);if(_0x127896['account'][_0xd0e4('0x77')]){delete _0x127896[_0xd0e4('0x78')][_0xd0e4('0x77')];}return db[_0xd0e4('0x79')]['describe']();})[_0xd0e4('0x1f')](function(_0x351cba){if(!_0x351cba){throw new db[(_0xd0e4('0x7a'))][(_0xd0e4('0x7b'))]('no\x20available\x20attributes');}_0x54b491=_[_0xd0e4('0x7c')](_['keys'](_0x351cba),[_0xd0e4('0x7d'),_0xd0e4('0x7e')]);_0x4f3eed=_[_0xd0e4('0x7c')](_[_0xd0e4('0x46')](_0x351cba),[_0xd0e4('0x7d'),_0xd0e4('0x7e'),'CompanyId','ListId']);_0x127896[_0xd0e4('0x5e')]={'mapKey':_0xd0e4('0x7f')};if(_0x127896[_0xd0e4('0x78')]['type']){switch(_0x127896[_0xd0e4('0x78')][_0xd0e4('0x42')]){case _0xd0e4('0x80'):_0x127896[_0xd0e4('0x5e')]['from']=_0x586194[_0xd0e4('0x5e')][_0xd0e4('0x81')];_0x127896['body'][_0xd0e4('0x5e')]=_0x586194[_0xd0e4('0x5e')][_0xd0e4('0x82')];_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x83')]=_0x586194[_0xd0e4('0x5e')][_0xd0e4('0x84')];break;case _0xd0e4('0x85'):_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x86')]='+'+_0x586194[_0xd0e4('0x5e')][_0xd0e4('0x87')];_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x5e')]=_0x586194['body']['text'];break;case _0xd0e4('0x88'):_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x86')]=_0x586194[_0xd0e4('0x5e')][_0xd0e4('0x86')];_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x5e')]=_0x586194[_0xd0e4('0x5e')]['message'];break;case'clicksend':_0x127896['body'][_0xd0e4('0x86')]=_0x586194['body'][_0xd0e4('0x86')];_0x127896[_0xd0e4('0x5e')]['body']=_0x586194[_0xd0e4('0x5e')][_0xd0e4('0x5e')];_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x83')]=_0x586194[_0xd0e4('0x5e')]['message_id'];break;case _0xd0e4('0x89'):_0x127896['body'][_0xd0e4('0x86')]=_0x586194[_0xd0e4('0x5e')]['From'];_0x127896['body']['body']=_0x586194[_0xd0e4('0x5e')][_0xd0e4('0x8a')];_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x83')]=_0x586194[_0xd0e4('0x5e')][_0xd0e4('0x8b')];break;case _0xd0e4('0x8c'):_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x86')]='+'+_0x586194[_0xd0e4('0x5e')][_0xd0e4('0x8d')][0x0][_0xd0e4('0x86')];_0x127896['body'][_0xd0e4('0x5e')]=_0x586194[_0xd0e4('0x5e')]['results'][0x0][_0xd0e4('0x8e')];_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x83')]=_0x586194[_0xd0e4('0x5e')][_0xd0e4('0x8d')][0x0]['messageId'];break;case _0xd0e4('0x8f'):_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x86')]=_0x586194['body']['originatingAddress'];_0x127896['body'][_0xd0e4('0x5e')]=_0x586194['body']['segmentedMessage'][_0xd0e4('0x28')];break;case _0xd0e4('0x90'):_0x127896['body'][_0xd0e4('0x86')]=_0x586194[_0xd0e4('0x5e')][_0xd0e4('0x91')];_0x127896['body'][_0xd0e4('0x5e')]=_0x586194[_0xd0e4('0x5e')][_0xd0e4('0x8e')];_0x127896['body'][_0xd0e4('0x83')]=_0x586194['body'][_0xd0e4('0x92')];break;case _0xd0e4('0x93'):_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x83')]=_0x586194[_0xd0e4('0x5e')][0x0]['message']['id'];_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x86')]=_0x586194[_0xd0e4('0x5e')][0x0][_0xd0e4('0x28')][_0xd0e4('0x86')];_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x5e')]=_0x586194['body'][0x0]['message']['text'];break;case _0xd0e4('0x94'):_0x127896['body'][_0xd0e4('0x86')]=_0x586194['body'][_0xd0e4('0x86')];_0x127896['body'][_0xd0e4('0x5e')]=_0x586194[_0xd0e4('0x5e')][_0xd0e4('0x28')];_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x83')]=_0x586194[_0xd0e4('0x5e')][_0xd0e4('0x95')];break;}}if(_0x127896[_0xd0e4('0x5e')]['id']){delete _0x127896[_0xd0e4('0x5e')]['id'];}if(_[_0xd0e4('0x96')](_0x127896['body'][_0xd0e4('0x86')])){throw new db[(_0xd0e4('0x7a'))]['ValidationError'](_0xd0e4('0x97'));}if(_['isNil'](_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x5e')])||_0x127896[_0xd0e4('0x5e')]['body']===''){throw new db[(_0xd0e4('0x7a'))][(_0xd0e4('0x7b'))](_0xd0e4('0x98'));}if(_['isNil'](_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x99')])){throw new db[(_0xd0e4('0x7a'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4f3eed);}if(!_['includes'](_0x4f3eed,_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x99')])){throw new db[(_0xd0e4('0x7a'))][(_0xd0e4('0x7b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4f3eed);}_0x423e78[_0x127896[_0xd0e4('0x5e')]['mapKey']]=_0x127896['body']['from'];return db[_0xd0e4('0x9a')][_0xd0e4('0x5b')]({'where':{'id':_0x127896[_0xd0e4('0x78')][_0xd0e4('0x9b')]},'include':[{'model':db['CmContact'],'as':_0xd0e4('0x9c'),'where':_0x423e78,'limit':0x1,'order':[['updatedAt',_0xd0e4('0x9d')]]}]});})[_0xd0e4('0x1f')](handleEntityNotFound(_0x1e8f51,null))['then'](function(_0x22a1b8){if(_0x22a1b8){_0x127896[_0xd0e4('0x9e')]=_[_0xd0e4('0x9f')](_0x22a1b8,['Contacts']);if(_0x22a1b8[_0xd0e4('0x9c')][_0xd0e4('0x59')]){return _0x22a1b8[_0xd0e4('0x9c')][0x0];}var _0x4b78db=_[_0xd0e4('0x17')](_0x127896['body'],{'firstName':_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x86')],'ListId':_0x22a1b8['id']});_0x4b78db[_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x99')]]=_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x86')];return db[_0xd0e4('0x79')][_0xd0e4('0x5d')](_0x4b78db,{'fields':_0x54b491,'raw':!![]});}})[_0xd0e4('0x1f')](handleEntityNotFound(_0x1e8f51,null))[_0xd0e4('0x1f')](function(_0x53bd6e){if(_0x53bd6e){_0x127896[_0xd0e4('0xa0')]=_0x53bd6e;var _0x10c260={'ContactId':_0x53bd6e['id'],'phone':_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x86')],'SmsAccountId':_0x586194[_0xd0e4('0x57')]['id']};var _0x369959={'ContactId':_0x53bd6e['id'],'SmsAccountId':_0x586194[_0xd0e4('0x57')]['id'],'closed':![]};return db[_0xd0e4('0xa1')]['find']({'where':_0x369959})[_0xd0e4('0x1f')](function(_0x1eef2e){if(_0x1eef2e){return[_0x1eef2e,![]];}return db['SmsInteraction'][_0xd0e4('0x5d')](_0x10c260)[_0xd0e4('0x1f')](function(_0x1c94a0){return[_0x1c94a0,!![]];});});}})[_0xd0e4('0xa2')](function(_0x4a3fba,_0x2684c9){_0x127896['interaction']=_0x4a3fba[_0xd0e4('0x36')]({'plain':!![]});_0x127896['interaction'][_0xd0e4('0xa3')]=![];if(_0x2684c9){if(_0x127896['account'][_0xd0e4('0xa4')]){_0x127896[_0xd0e4('0x75')]['push']({'id':0x0,'priority':_0x127896[_0xd0e4('0x75')][_0xd0e4('0x59')]+0x1,'app':_0xd0e4('0xa5'),'appdata':_0xd0e4('0xa6'),'interval':'*,*,*,*'});}_0x127896[_0xd0e4('0xa7')][_0xd0e4('0xa3')]=!![];}return db['SmsMessage'][_0xd0e4('0x5d')]({'phone':_0x127896['body'][_0xd0e4('0x86')],'messageId':_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x83')],'body':_0x127896[_0xd0e4('0x5e')][_0xd0e4('0x5e')],'SmsAccountId':_0x586194['params']['id'],'SmsInteractionId':_0x4a3fba['id'],'direction':'in','ContactId':_0x4a3fba[_0xd0e4('0xa8')],'AttachmentId':_0x127896[_0xd0e4('0x5e')][_0xd0e4('0xa9')]});})[_0xd0e4('0x1f')](function(_0xd036){_0x127896['message']=_0xd036;if(!_0x127896[_0xd0e4('0xa7')][_0xd0e4('0xaa')])return;return db[_0xd0e4('0xab')][_0xd0e4('0x5b')]({'attributes':['id',_0xd0e4('0x3a')],'where':{'id':_0x127896[_0xd0e4('0xa7')][_0xd0e4('0xaa')]}});})[_0xd0e4('0x1f')](function(_0x2bd81b){if(_0x2bd81b){_0x127896[_0xd0e4('0x75')]['unshift']({'id':0x0,'priority':0x0,'app':_0xd0e4('0xac'),'appdata':_0x2bd81b[_0xd0e4('0x3a')]+','+(_0x127896['account'][_0xd0e4('0xad')]||0xa),'interval':_0xd0e4('0xae')});}if(!_0x127896[_0xd0e4('0xa7')][_0xd0e4('0xaf')])return;return db[_0xd0e4('0xb0')]['find']({'attributes':['id',_0xd0e4('0x3a')],'where':{'id':_0x127896[_0xd0e4('0xa7')][_0xd0e4('0xaf')]}});})[_0xd0e4('0x1f')](function(_0x36881c){if(_0x36881c){_0x127896[_0xd0e4('0x75')]['unshift']({'id':0x0,'priority':0x1,'app':_0xd0e4('0xb1'),'appdata':_0x36881c[_0xd0e4('0x3a')]+','+(_0x127896[_0xd0e4('0x78')][_0xd0e4('0xb2')]||0x12c),'interval':_0xd0e4('0xae')});}return respondWithRpcPromise(_0xd0e4('0xb3'),'startRouting',_0x127896);})[_0xd0e4('0x1f')](function(_0x267141){if(_0x267141){var _0x23600a=0xc8;var _0x131cd2=_0xd0e4('0xb4');logger[_0xd0e4('0x20')](_0xd0e4('0x24'),_0x131cd2,_0x23600a,_0xd0e4('0xb5'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x131cd2,_0x23600a,_0xd0e4('0xb5'),JSON[_0xd0e4('0x25')](_0x267141));if(_0x127896['account']['type']==='twilio'){return _0x1e8f51['status'](_0x23600a)['set'](_0xd0e4('0xb6'),_0xd0e4('0xb7'))[_0xd0e4('0x3b')](_0xd0e4('0xb8'));}else{return _0x1e8f51[_0xd0e4('0x2b')](_0x23600a)[_0xd0e4('0x2c')](_0x267141);}}})[_0xd0e4('0x5c')](handleError(_0x1e8f51,null));};exports[_0xd0e4('0xb9')]=function(_0x3797ff,_0x28b461){var _0x1be5b8=_0x3797ff[_0xd0e4('0x57')]['id'];var _0x14e53f=_0x3797ff[_0xd0e4('0x5e')];var _0x24793b=0xc8;var _0x3c88ef=null;return db['sequelize'][_0xd0e4('0xba')]({'isolationLevel':db['sequelize'][_0xd0e4('0xbb')][_0xd0e4('0xbc')][_0xd0e4('0xbd')]},function(_0x126da3){return db['SmsAccount'][_0xd0e4('0x6a')]({'where':{'id':_0x1be5b8},'transaction':_0x126da3})[_0xd0e4('0x1f')](function(_0x5b5f74){if(_0x5b5f74){return db[_0xd0e4('0xbe')]['destroy']({'where':{'SmsAccountId':_0x1be5b8},'transaction':_0x126da3})[_0xd0e4('0x1f')](function(){var _0x51482d=_['map'](_0x14e53f,function(_0x2aa774){_0x2aa774[_0xd0e4('0x67')]=_0x1be5b8;return _0x2aa774;});return db[_0xd0e4('0xbe')][_0xd0e4('0xbf')](_0x51482d,{'transaction':_0x126da3});});}else{_0x24793b=0x194;_0x3c88ef=[];}});})[_0xd0e4('0x1f')](function(){if(_0x24793b!==0x194){return db[_0xd0e4('0xbe')][_0xd0e4('0xc0')]({'where':{'SmsAccountId':_0x1be5b8},'order':'priority'})['then'](function(_0x39cbe3){_0x3c88ef=_0x39cbe3;});}})[_0xd0e4('0x5c')](function(_0x212263){_0x24793b=0x1f4;logger[_0xd0e4('0x26')](_0x212263['stack']);if(_0x212263[_0xd0e4('0x3a')]){delete _0x212263[_0xd0e4('0x3a')];}_0x3c88ef=_0x212263;})[_0xd0e4('0xc1')](function(){if(_0x3c88ef===null){_0x28b461[_0xd0e4('0x39')](_0x24793b);}else{if(_0x24793b===0x1f4){_0x28b461[_0xd0e4('0x2b')](_0x24793b)[_0xd0e4('0x3b')](_0x3c88ef);}else{_0x28b461[_0xd0e4('0x2b')](_0x24793b)['json'](_0x3c88ef);}}});};exports[_0xd0e4('0xc2')]=function(_0x4c6b71,_0x325aa9,_0x347429){var _0x23fa0c={};var _0x2937f0={};var _0x57e4b8;var _0x4cb103;return db['SmsAccount'][_0xd0e4('0x6a')]({'where':{'id':_0x4c6b71['params']['id']}})[_0xd0e4('0x1f')](handleEntityNotFound(_0x325aa9,null))['then'](function(_0x713e52){if(_0x713e52){_0x57e4b8=_0x713e52;_0x2937f0[_0xd0e4('0x44')]=_['keys'](db['SmsApplication'][_0xd0e4('0x58')]);_0x2937f0[_0xd0e4('0x45')]=_[_0xd0e4('0x46')](_0x4c6b71['query']);_0x2937f0[_0xd0e4('0x47')]=_[_0xd0e4('0x49')](_0x2937f0['model'],_0x2937f0[_0xd0e4('0x45')]);_0x23fa0c['attributes']=_[_0xd0e4('0x49')](_0x2937f0[_0xd0e4('0x44')],qs[_0xd0e4('0x4a')](_0x4c6b71[_0xd0e4('0x45')]['fields']));_0x23fa0c[_0xd0e4('0x48')]=_0x23fa0c[_0xd0e4('0x48')][_0xd0e4('0x59')]?_0x23fa0c[_0xd0e4('0x48')]:_0x2937f0[_0xd0e4('0x44')];_0x23fa0c[_0xd0e4('0x4d')]=qs['sort'](_0x4c6b71[_0xd0e4('0x45')][_0xd0e4('0x4e')]);_0x23fa0c[_0xd0e4('0x4f')]=qs[_0xd0e4('0x47')](_[_0xd0e4('0x50')](_0x4c6b71[_0xd0e4('0x45')],_0x2937f0[_0xd0e4('0x47')]));if(_0x4c6b71[_0xd0e4('0x45')][_0xd0e4('0x53')]){_0x23fa0c['where']=_[_0xd0e4('0x51')](_0x23fa0c[_0xd0e4('0x4f')],{'$or':_[_0xd0e4('0x3f')](_0x23fa0c[_0xd0e4('0x48')],function(_0x47a5b1){var _0x3c8a4b={};_0x3c8a4b[_0x47a5b1]={'$like':'%'+_0x4c6b71[_0xd0e4('0x45')][_0xd0e4('0x53')]+'%'};return _0x3c8a4b;})});}_0x23fa0c=_[_0xd0e4('0x51')]({},_0x23fa0c,_0x4c6b71[_0xd0e4('0x54')]);return _0x57e4b8['getApplications'](_0x23fa0c);}})['then'](function(_0x50ca39){if(_0x50ca39){_0x4cb103=_0x50ca39[_0xd0e4('0x59')];if(!_0x4c6b71[_0xd0e4('0x45')]['hasOwnProperty'](_0xd0e4('0x4c'))){_0x23fa0c[_0xd0e4('0x2e')]=qs[_0xd0e4('0x2e')](_0x4c6b71[_0xd0e4('0x45')]['limit']);_0x23fa0c[_0xd0e4('0x2d')]=qs[_0xd0e4('0x2d')](_0x4c6b71[_0xd0e4('0x45')][_0xd0e4('0x2d')]);}return _0x57e4b8[_0xd0e4('0xc2')](_0x23fa0c);}})[_0xd0e4('0x1f')](function(_0x41b295){if(_0x41b295){return _0x41b295?{'count':_0x4cb103,'rows':_0x41b295}:null;}})[_0xd0e4('0x1f')](respondWithResult(_0x325aa9,null))[_0xd0e4('0x5c')](handleError(_0x325aa9,null));};exports[_0xd0e4('0xc3')]=function(_0x3709cd,_0x241178,_0x23f194){var _0x2f71b5={'raw':![],'where':{}};var _0x4e827b={};var _0x43333f={'count':0x0,'rows':[]};return db[_0xd0e4('0x40')]['findOne']({'where':{'id':_0x3709cd[_0xd0e4('0x57')]['id']}})[_0xd0e4('0x1f')](handleEntityNotFound(_0x241178,null))[_0xd0e4('0x1f')](function(_0x323487){if(_0x323487){_0x4e827b[_0xd0e4('0x44')]=_[_0xd0e4('0x46')](db[_0xd0e4('0xa1')]['rawAttributes']);_0x4e827b[_0xd0e4('0x45')]=_[_0xd0e4('0x46')](_0x3709cd[_0xd0e4('0x45')]);_0x4e827b['filters']=_[_0xd0e4('0x49')](_0x4e827b['model'],_0x4e827b['query']);_0x2f71b5['attributes']=_[_0xd0e4('0x49')](_0x4e827b[_0xd0e4('0x44')],qs[_0xd0e4('0x4a')](_0x3709cd[_0xd0e4('0x45')][_0xd0e4('0x4a')]));_0x2f71b5['attributes']=_0x2f71b5[_0xd0e4('0x48')]['length']?_0x2f71b5[_0xd0e4('0x48')]:_0x4e827b[_0xd0e4('0x44')];if(!_0x3709cd['query'][_0xd0e4('0x4b')]('nolimit')){_0x2f71b5['limit']=qs[_0xd0e4('0x2e')](_0x3709cd[_0xd0e4('0x45')][_0xd0e4('0x2e')]);_0x2f71b5[_0xd0e4('0x2d')]=qs[_0xd0e4('0x2d')](_0x3709cd[_0xd0e4('0x45')]['offset']);}_0x2f71b5[_0xd0e4('0x4d')]=qs['sort'](_0x3709cd[_0xd0e4('0x45')][_0xd0e4('0x4e')]);_0x2f71b5[_0xd0e4('0x4f')]=qs[_0xd0e4('0x47')](_['pick'](_0x3709cd['query'],_0x4e827b['filters']));_0x2f71b5[_0xd0e4('0x4f')][_0xd0e4('0x67')]=_0x323487['id'];if(_0x3709cd[_0xd0e4('0x45')][_0xd0e4('0x53')]){_0x2f71b5[_0xd0e4('0x4f')]=_[_0xd0e4('0x51')](_0x2f71b5[_0xd0e4('0x4f')],{'$or':_[_0xd0e4('0x3f')](_0x2f71b5[_0xd0e4('0x48')],function(_0x1215a6){var _0x38d8f9={};_0x38d8f9[_0x1215a6]={'$like':'%'+_0x3709cd[_0xd0e4('0x45')][_0xd0e4('0x53')]+'%'};return _0x38d8f9;})});}_0x2f71b5=_[_0xd0e4('0x51')]({},_0x2f71b5,_0x3709cd[_0xd0e4('0x54')]);return db[_0xd0e4('0xa1')][_0xd0e4('0x2f')]({'where':_0x2f71b5[_0xd0e4('0x4f')]})[_0xd0e4('0x1f')](function(_0x51a611){_0x43333f[_0xd0e4('0x2f')]=_0x51a611;if(_0x3709cd[_0xd0e4('0x45')][_0xd0e4('0x5a')]){_0x2f71b5[_0xd0e4('0x55')]=[{'model':db[_0xd0e4('0x79')],'as':_0xd0e4('0xc4'),'required':![]},{'model':db[_0xd0e4('0xab')],'as':'Owner','attributes':['name','fullname','internal'],'required':![]},{'model':db[_0xd0e4('0xc5')],'as':_0xd0e4('0xc6'),'attributes':['id','name',_0xd0e4('0xc7')],'where':_0x3709cd[_0xd0e4('0x45')][_0xd0e4('0xc8')]?{'id':_0x3709cd[_0xd0e4('0x45')][_0xd0e4('0xc8')]}:undefined,'required':_0x3709cd['query'][_0xd0e4('0xc8')]?!![]:![]}];}return db[_0xd0e4('0xa1')][_0xd0e4('0x6b')](_0x2f71b5);})['then'](function(_0x53fd94){_0x43333f[_0xd0e4('0x6c')]=_0x53fd94;return _0x43333f;});}})[_0xd0e4('0x1f')](respondWithFilteredResult(_0x241178,_0x2f71b5))[_0xd0e4('0x5c')](handleError(_0x241178,null));};exports[_0xd0e4('0x3b')]=function(_0x111d03,_0x497169,_0x57c3ea){var _0x1327d1,_0x3cbbef,_0x324268;if(_[_0xd0e4('0x96')](_0x111d03[_0xd0e4('0x5e')][_0xd0e4('0x5e')])||_0x111d03[_0xd0e4('0x5e')][_0xd0e4('0x5e')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd0e4('0x96')](_0x111d03[_0xd0e4('0x5e')]['to'])){throw new db[(_0xd0e4('0x7a'))][(_0xd0e4('0x7b'))](_0xd0e4('0xc9'));}_0x1327d1=_0x111d03['body']['to'];return db[_0xd0e4('0x40')][_0xd0e4('0x5b')]({'where':{'id':_0x111d03[_0xd0e4('0x57')]['id']},'include':[{'model':db['CmList'],'as':_0xd0e4('0xca'),'include':[{'model':db[_0xd0e4('0x79')],'as':_0xd0e4('0x9c'),'where':{'mobile':_0x1327d1},'limit':0x1,'order':[[_0xd0e4('0x7e'),_0xd0e4('0x9d')]]}]}]})['then'](handleEntityNotFound(_0x497169,null))['then'](function(_0x517a96){if(_0x517a96&&_0x517a96[_0xd0e4('0xca')]){_0x3cbbef=_0x517a96['get']({'plain':!![]});if(_0x3cbbef[_0xd0e4('0xca')]&&_0x3cbbef['List'][_0xd0e4('0x9c')][_0xd0e4('0x59')]){return _0x3cbbef[_0xd0e4('0xca')][_0xd0e4('0x9c')][0x0];}return db[_0xd0e4('0x79')][_0xd0e4('0x5d')](_[_0xd0e4('0x17')](_0x111d03[_0xd0e4('0x5e')],{'firstName':_0x1327d1,'mobile':_0x1327d1,'phone':_0x1327d1,'ListId':_0x3cbbef[_0xd0e4('0x9b')]}));}})[_0xd0e4('0x1f')](handleEntityNotFound(_0x497169,null))[_0xd0e4('0x1f')](function(_0x3f4c76){if(_0x3f4c76){_0x324268=_0x3f4c76;return db['SmsInteraction'][_0xd0e4('0x5b')]({'where':{'ContactId':_0x324268['id'],'closed':![],'SmsAccountId':_0x3cbbef['id']}})[_0xd0e4('0x1f')](function(_0x3d892e){if(_0x3d892e){return[_0x3d892e,![]];}return db[_0xd0e4('0xa1')][_0xd0e4('0x5d')]({'UserId':_0x111d03[_0xd0e4('0x5f')]['id'],'ContactId':_0x324268['id'],'SmsAccountId':_0x3cbbef['id'],'phone':_0x1327d1,'firstMsgDirection':_0xd0e4('0xcb'),'Messages':[_[_0xd0e4('0x51')](_0x111d03[_0xd0e4('0x5e')],{'read':![],'body':_0x111d03[_0xd0e4('0x5e')][_0xd0e4('0x5e')],'phone':_0x1327d1,'SmsAccountId':_0x3cbbef['id'],'UserId':_0x111d03[_0xd0e4('0x5f')]['id'],'ContactId':_0x324268['id']})]},{'include':[{'model':db[_0xd0e4('0xcc')],'as':_0xd0e4('0xcd')}]})[_0xd0e4('0x1f')](function(_0x383970){return[_0x383970,!![]];});});}})[_0xd0e4('0xa2')](function(_0x3739c8,_0x248593){if(_0x248593){return _0x3739c8;}return db[_0xd0e4('0xcc')][_0xd0e4('0x5d')](_[_0xd0e4('0x51')](_0x111d03[_0xd0e4('0x5e')],{'read':![],'body':_0x111d03['body'][_0xd0e4('0x5e')],'phone':_0x1327d1,'SmsAccountId':_0x3cbbef['id'],'SmsInteractionId':_0x3739c8['id'],'UserId':_0x111d03[_0xd0e4('0x5f')]['id'],'ContactId':_0x324268['id']}))[_0xd0e4('0x1f')](function(_0x2ac84a){_0x3739c8[_0xd0e4('0xce')][_0xd0e4('0xcd')]=[];_0x3739c8[_0xd0e4('0xce')][_0xd0e4('0xcd')][_0xd0e4('0xcf')](_0x2ac84a[_0xd0e4('0xce')]);return _0x3739c8;});})['then'](respondWithResult(_0x497169,null))[_0xd0e4('0x5c')](handleError(_0x497169,null));};exports[_0xd0e4('0x2b')]=function(_0x10e24c,_0x3fb090,_0x3a6224){if(_0x10e24c['body']['id']){delete _0x10e24c[_0xd0e4('0x5e')]['id'];}var _0x3a4079,_0x16b8e3,_0xbf78c6;return db[_0xd0e4('0x40')][_0xd0e4('0x5b')]({'where':{'id':_0x10e24c[_0xd0e4('0x57')]['id']}})[_0xd0e4('0x1f')](handleEntityNotFound(_0x3fb090,null))[_0xd0e4('0x1f')](function(_0x55e330){if(_0x55e330){_0xbf78c6=_0x55e330;logger[_0xd0e4('0x23')](_0xd0e4('0x24'),_0xd0e4('0x2b'),'received\x20delivery\x20report\x20from',_0x55e330[_0xd0e4('0x42')],util['inspect'](_0x10e24c[_0xd0e4('0x5e')],{'showHidden':![],'depth':null}));switch(_0x55e330['type']){case _0xd0e4('0x85'):if(_0x10e24c[_0xd0e4('0x5e')][_0xd0e4('0xd0')]&&_0x10e24c[_0xd0e4('0x5e')][_0xd0e4('0x2b')]){_0x16b8e3=_0x10e24c[_0xd0e4('0x5e')]['status'];return db[_0xd0e4('0xcc')]['find']({'where':{'messageId':_0x10e24c[_0xd0e4('0x5e')][_0xd0e4('0xd0')]}});}break;case _0xd0e4('0x88'):if(_0x10e24c[_0xd0e4('0x5e')]['requestid']&&_0x10e24c[_0xd0e4('0x5e')][_0xd0e4('0xd1')]){_0x16b8e3=_0x10e24c[_0xd0e4('0x5e')][_0xd0e4('0xd1')];return db['SmsMessage'][_0xd0e4('0x5b')]({'where':{'messageId':_0x10e24c[_0xd0e4('0x5e')][_0xd0e4('0xd2')]}});}break;case'clicksend':if(_0x10e24c[_0xd0e4('0x5e')]['message_id']&&_0x10e24c[_0xd0e4('0x5e')]['status_code']){_0x16b8e3=_0x10e24c[_0xd0e4('0x5e')][_0xd0e4('0xd3')];return db[_0xd0e4('0xcc')]['find']({'where':{'messageId':_0x10e24c[_0xd0e4('0x5e')][_0xd0e4('0xd4')]}});}break;case'infobip':var _0x3cd984=_0x10e24c['body'][_0xd0e4('0x8d')][0x0];if(_0x3cd984[_0xd0e4('0x83')]&&_0x3cd984[_0xd0e4('0x2b')][_0xd0e4('0xd5')]===_0xd0e4('0xd6')){_0x16b8e3=_0x3cd984[_0xd0e4('0x2b')][_0xd0e4('0xd5')];return db[_0xd0e4('0xcc')][_0xd0e4('0x5b')]({'where':{'messageId':_0x3cd984[_0xd0e4('0x83')]}});}break;case _0xd0e4('0x90'):if(_0x10e24c[_0xd0e4('0x5e')][_0xd0e4('0x83')]&&_0x10e24c[_0xd0e4('0x5e')]['status']){_0x16b8e3=_0x10e24c[_0xd0e4('0x5e')][_0xd0e4('0x2b')];return db[_0xd0e4('0xcc')][_0xd0e4('0x5b')]({'where':{'messageId':_0x10e24c[_0xd0e4('0x5e')][_0xd0e4('0x83')]}});}break;case'bandwidth':if(_0x10e24c[_0xd0e4('0x5e')][0x0][_0xd0e4('0x28')]['id']){_0x16b8e3=_0x10e24c[_0xd0e4('0x5e')][0x0][_0xd0e4('0x42')];return db[_0xd0e4('0xcc')][_0xd0e4('0x5b')]({'where':{'messageId':_0x10e24c[_0xd0e4('0x5e')][0x0][_0xd0e4('0x28')]['id']}});}break;case _0xd0e4('0x94'):if(_0x10e24c[_0xd0e4('0x5e')]['redif']&&_0x10e24c[_0xd0e4('0x5e')][_0xd0e4('0x2b')]){_0x16b8e3=_0x10e24c[_0xd0e4('0x5e')][_0xd0e4('0x2b')];return db[_0xd0e4('0xcc')][_0xd0e4('0x5b')]({'where':{'messageId':_0x10e24c[_0xd0e4('0x5e')][_0xd0e4('0xd7')]}});}break;}}})['then'](handleEntityNotFound(_0x3fb090,null))[_0xd0e4('0x1f')](function(_0x5816a9){if(_0x5816a9){_0x3a4079=_0x5816a9;switch(_0xbf78c6['type']){case _0xd0e4('0x85'):if(_0x16b8e3===_0xd0e4('0xd6')){return _0x3a4079[_0xd0e4('0x35')]({'read':!![]});}else{logger[_0xd0e4('0x26')](_0xd0e4('0x24'),'status','skebby',util[_0xd0e4('0xd8')](_0x10e24c[_0xd0e4('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd0e4('0x88'):if(_0x16b8e3==='1'){return _0x3a4079['update']({'read':!![]});}else{logger[_0xd0e4('0x26')](_0xd0e4('0x24'),_0xd0e4('0x2b'),_0xd0e4('0x85'),util[_0xd0e4('0xd8')](_0x10e24c[_0xd0e4('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd0e4('0xd9'):if(!_0x10e24c['body'][_0xd0e4('0xda')]&&_0x16b8e3>=0xc8&&_0x16b8e3<=0xce){return _0x3a4079[_0xd0e4('0x35')]({'read':!![]});}else{logger[_0xd0e4('0x26')](_0xd0e4('0x24'),_0xd0e4('0x2b'),'clicksend',util[_0xd0e4('0xd8')](_0x10e24c[_0xd0e4('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd0e4('0x8c'):var _0x31fc1f=_0x10e24c[_0xd0e4('0x5e')]['results'][0x0];if(_0x31fc1f['status']['groupName']===_0xd0e4('0xd6')){return _0x3a4079[_0xd0e4('0x35')]({'read':!![]});}else{logger[_0xd0e4('0x26')](_0xd0e4('0x24'),_0xd0e4('0x2b'),_0xd0e4('0x8c'),util[_0xd0e4('0xd8')](_0x10e24c[_0xd0e4('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd0e4('0x90'):if(_0x16b8e3==_0xd0e4('0xdb')||_0x16b8e3==_0xd0e4('0xdc')){return _0x3a4079[_0xd0e4('0x35')]({'read':!![]});}else{logger[_0xd0e4('0x26')](_0xd0e4('0x24'),_0xd0e4('0x2b'),_0xd0e4('0x90'),util['inspect'](_0x10e24c[_0xd0e4('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd0e4('0x93'):if(_0x16b8e3==_0xd0e4('0xdd')){return _0x3a4079['update']({'read':!![]});}else{logger[_0xd0e4('0x26')](_0xd0e4('0x24'),_0xd0e4('0x2b'),_0xd0e4('0x93'),util['inspect'](_0x10e24c['body'],{'showHidden':![],'depth':null}));}break;case _0xd0e4('0x94'):if(_0x16b8e3===_0xd0e4('0xde')||_0x16b8e3===_0xd0e4('0xdf')){return _0x3a4079[_0xd0e4('0x35')]({'read':!![]});}else{logger[_0xd0e4('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd0e4('0x2b'),_0xd0e4('0x94'),util[_0xd0e4('0xd8')](_0x10e24c[_0xd0e4('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x3a4079;}})[_0xd0e4('0x1f')](respondWithResult(_0x3fb090,null))[_0xd0e4('0x5c')](handleError(_0x3fb090,null));};exports['statusGet']=function(_0x1c6152,_0x1ab9f5,_0x4db5fc){var _0x441113,_0xbf84d8,_0x20de07;return db[_0xd0e4('0x40')][_0xd0e4('0x5b')]({'where':{'id':_0x1c6152[_0xd0e4('0x57')]['id']}})[_0xd0e4('0x1f')](handleEntityNotFound(_0x1ab9f5,null))[_0xd0e4('0x1f')](function(_0x395f31){if(_0x395f31){_0x20de07=_0x395f31;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd0e4('0x2b'),_0xd0e4('0xe0'),_0x395f31['type'],util[_0xd0e4('0xd8')](_0x1c6152[_0xd0e4('0x45')],{'showHidden':![],'depth':null}));switch(_0x395f31[_0xd0e4('0x42')]){case'csc':if(_0x1c6152[_0xd0e4('0x45')][_0xd0e4('0xe1')]&&_0x1c6152[_0xd0e4('0x45')][_0xd0e4('0xe2')]){_0xbf84d8=_0x1c6152[_0xd0e4('0x45')][_0xd0e4('0xe2')];return db[_0xd0e4('0xcc')][_0xd0e4('0x5b')]({'where':{'messageId':_0x1c6152['query']['message-id']}});}break;}}})[_0xd0e4('0x1f')](handleEntityNotFound(_0x1ab9f5,null))[_0xd0e4('0x1f')](function(_0x4b089b){if(_0x4b089b){_0x441113=_0x4b089b;switch(_0x20de07[_0xd0e4('0x42')]){case _0xd0e4('0x8f'):if(_0xbf84d8==='2'||_0xbf84d8==='6'){return _0x441113[_0xd0e4('0x35')]({'read':!![]});}else{logger[_0xd0e4('0x26')](_0xd0e4('0x24'),'status',_0xd0e4('0x8f'),util[_0xd0e4('0xd8')](_0x1c6152[_0xd0e4('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x441113;}})[_0xd0e4('0x1f')](respondWithResult(_0x1ab9f5,null))[_0xd0e4('0x5c')](handleError(_0x1ab9f5,null));};exports[_0xd0e4('0xe3')]=function(_0x5bd662,_0xc6921b,_0x4c08e0){return db[_0xd0e4('0x40')][_0xd0e4('0x5b')]({'where':{'id':_0x5bd662[_0xd0e4('0x57')]['id']}})[_0xd0e4('0x1f')](handleEntityNotFound(_0xc6921b,null))['then'](function(_0x45ae28){if(_0x45ae28){return _0x45ae28[_0xd0e4('0xe3')](_0x5bd662[_0xd0e4('0x5e')][_0xd0e4('0x6e')],_[_0xd0e4('0x9f')](_0x5bd662[_0xd0e4('0x5e')],[_0xd0e4('0x6e'),'id'])||{})[_0xd0e4('0xa2')](function(_0x3b56d9){for(var _0x44320c=0x0;_0x44320c<_0x5bd662['body'][_0xd0e4('0x6e')][_0xd0e4('0x59')];_0x44320c+=0x1){socket[_0xd0e4('0xe4')]('userSmsAccount:save',{'UserId':Number(_0x5bd662[_0xd0e4('0x5e')][_0xd0e4('0x6e')][_0x44320c]),'SmsAccountId':Number(_0x5bd662[_0xd0e4('0x57')]['id'])});}return _0x3b56d9;});}})[_0xd0e4('0x1f')](respondWithResult(_0xc6921b,null))[_0xd0e4('0x5c')](handleError(_0xc6921b,null));};exports[_0xd0e4('0xe5')]=function(_0x5dc468,_0x435f1c,_0x2b3925){return db[_0xd0e4('0x40')][_0xd0e4('0x5b')]({'where':{'id':_0x5dc468[_0xd0e4('0x57')]['id']}})['then'](handleEntityNotFound(_0x435f1c,null))[_0xd0e4('0x1f')](function(_0x3c24ac){if(_0x3c24ac){return _0x3c24ac[_0xd0e4('0xe5')](_0x5dc468[_0xd0e4('0x45')]['ids'])[_0xd0e4('0x1f')](function(){if(_[_0xd0e4('0xe6')](_0x5dc468[_0xd0e4('0x45')][_0xd0e4('0x6e')])){for(var _0x2e5c41=0x0;_0x2e5c41<_0x5dc468[_0xd0e4('0x45')]['ids'][_0xd0e4('0x59')];_0x2e5c41+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x5dc468[_0xd0e4('0x45')][_0xd0e4('0x6e')][_0x2e5c41]),'SmsAccountId':Number(_0x5dc468[_0xd0e4('0x57')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x5dc468[_0xd0e4('0x45')][_0xd0e4('0x6e')]),'SmsAccountId':Number(_0x5dc468[_0xd0e4('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x435f1c,null))[_0xd0e4('0x5c')](handleError(_0x435f1c,null));};exports[_0xd0e4('0xe7')]=function(_0x30ca5d,_0x2fd64b,_0x5c8e49){var _0x439f9a={};var _0x548a3a={};var _0x5aad91;var _0x348560;return db[_0xd0e4('0x40')][_0xd0e4('0x6a')]({'where':{'id':_0x30ca5d['params']['id']}})[_0xd0e4('0x1f')](handleEntityNotFound(_0x2fd64b,null))[_0xd0e4('0x1f')](function(_0x38d0c0){if(_0x38d0c0){_0x5aad91=_0x38d0c0;_0x548a3a[_0xd0e4('0x44')]=_['keys'](db[_0xd0e4('0xab')]['rawAttributes']);_0x548a3a[_0xd0e4('0x45')]=_[_0xd0e4('0x46')](_0x30ca5d['query']);_0x548a3a['filters']=_[_0xd0e4('0x49')](_0x548a3a[_0xd0e4('0x44')],_0x548a3a['query']);_0x439f9a[_0xd0e4('0x48')]=_['intersection'](_0x548a3a['model'],qs[_0xd0e4('0x4a')](_0x30ca5d['query'][_0xd0e4('0x4a')]));_0x439f9a['attributes']=_0x439f9a[_0xd0e4('0x48')][_0xd0e4('0x59')]?_0x439f9a[_0xd0e4('0x48')]:_0x548a3a[_0xd0e4('0x44')];_0x439f9a[_0xd0e4('0x4d')]=qs[_0xd0e4('0x4e')](_0x30ca5d[_0xd0e4('0x45')][_0xd0e4('0x4e')]);_0x439f9a[_0xd0e4('0x4f')]=qs[_0xd0e4('0x47')](_[_0xd0e4('0x50')](_0x30ca5d[_0xd0e4('0x45')],_0x548a3a[_0xd0e4('0x47')]));if(_0x30ca5d[_0xd0e4('0x45')]['filter']){_0x439f9a[_0xd0e4('0x4f')]=_[_0xd0e4('0x51')](_0x439f9a[_0xd0e4('0x4f')],{'$or':_[_0xd0e4('0x3f')](_0x439f9a['attributes'],function(_0xef6a0b){var _0x45afb7={};_0x45afb7[_0xef6a0b]={'$like':'%'+_0x30ca5d[_0xd0e4('0x45')][_0xd0e4('0x53')]+'%'};return _0x45afb7;})});}_0x439f9a=_[_0xd0e4('0x51')]({},_0x439f9a,_0x30ca5d[_0xd0e4('0x54')]);return _0x5aad91[_0xd0e4('0xe7')](_0x439f9a);}})['then'](function(_0x59f928){if(_0x59f928){_0x348560=_0x59f928[_0xd0e4('0x59')];if(!_0x30ca5d['query'][_0xd0e4('0x4b')](_0xd0e4('0x4c'))){_0x439f9a[_0xd0e4('0x2e')]=qs[_0xd0e4('0x2e')](_0x30ca5d[_0xd0e4('0x45')][_0xd0e4('0x2e')]);_0x439f9a[_0xd0e4('0x2d')]=qs[_0xd0e4('0x2d')](_0x30ca5d[_0xd0e4('0x45')][_0xd0e4('0x2d')]);}return _0x5aad91[_0xd0e4('0xe7')](_0x439f9a);}})[_0xd0e4('0x1f')](function(_0x5bb938){if(_0x5bb938){return _0x5bb938?{'count':_0x348560,'rows':_0x5bb938}:null;}})[_0xd0e4('0x1f')](respondWithResult(_0x2fd64b,null))['catch'](handleError(_0x2fd64b,null));}; \ No newline at end of file +var _0x03c8=['tag','List','out','SmsMessage','Messages','dataValues','inspect','skebby','skebby_dispatch_id','statusInt','clicksend','status_code','infobip','groupName','redif','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','end','json','offset','undefined','limit','status','set','apply','reject','save','update','destroy','get','SmsAccounts','stack','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','SmsAccount','count','includeAll','include','findAll','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','SmsAccountId','CannedAnswer','options','removeAnswers','notify','sms','Applications','account','applications','orderBy','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','text','connectel','message_id','plivo','Text','results','csc','segmentedMessage','clickatell','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','DESC','list','omit','SmsInteraction','spread','interaction','autoclose','push','close','*,*,*,*','UserId','User','waitForTheAssignedAgent','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','\x0a','addApplications','sequelize','Transaction','READ_COMMITTED','SmsApplication','findAndCountAll','send','getApplications','getInteractions','fullname','Tag','color'];(function(_0x5146f4,_0x1133d9){var _0x4fcd55=function(_0x3c64b5){while(--_0x3c64b5){_0x5146f4['push'](_0x5146f4['shift']());}};_0x4fcd55(++_0x1133d9);}(_0x03c8,0x1d1));var _0x803c=function(_0x53094b,_0x42b4c9){_0x53094b=_0x53094b-0x0;var _0xf2ac70=_0x03c8[_0x53094b];return _0xf2ac70;};'use strict';var emlformat=require(_0x803c('0x0'));var rimraf=require(_0x803c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x803c('0x2'));var rp=require('request-promise');var moment=require(_0x803c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x803c('0x4'));var util=require(_0x803c('0x5'));var path=require('path');var sox=require(_0x803c('0x6'));var csv=require(_0x803c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x803c('0x8'));var _=require(_0x803c('0x9'));var squel=require(_0x803c('0xa'));var crypto=require(_0x803c('0xb'));var jsforce=require(_0x803c('0xc'));var deskjs=require(_0x803c('0xd'));var toCsv=require(_0x803c('0x7'));var querystring=require('querystring');var Papa=require(_0x803c('0xe'));var Redis=require(_0x803c('0xf'));var authService=require(_0x803c('0x10'));var qs=require(_0x803c('0x11'));var as=require(_0x803c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x803c('0x13'));var utils=require(_0x803c('0x14'));var config=require(_0x803c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x803c('0x16'))['db'];config[_0x803c('0x17')]=_[_0x803c('0x18')](config[_0x803c('0x17')],{'host':_0x803c('0x19'),'port':0x18eb});var socket=require(_0x803c('0x1a'))(new Redis(config['redis']));require(_0x803c('0x1b'))[_0x803c('0x1c')](socket);var jayson=require(_0x803c('0x1d'));var client=jayson[_0x803c('0x1e')]['http']({'port':0x232c});function respondWithRpcPromise(_0x25b9e5,_0x3e9d05,_0x2c0661,_0x456fcf){return new BPromise(function(_0x2ac3a7,_0x5704df){var _0x577a8a=_0x456fcf||client;return _0x577a8a[_0x803c('0x1f')](_0x25b9e5,_0x2c0661)[_0x803c('0x20')](function(_0x290c10){logger[_0x803c('0x21')](_0x803c('0x22'),_0x3e9d05,_0x803c('0x23'));logger[_0x803c('0x24')](_0x803c('0x25'),_0x3e9d05,_0x803c('0x23'),JSON[_0x803c('0x26')](_0x290c10));if(_0x290c10[_0x803c('0x27')]){if(_0x290c10['error'][_0x803c('0x28')]===0x1f4){logger[_0x803c('0x27')](_0x803c('0x22'),_0x3e9d05,_0x290c10[_0x803c('0x27')][_0x803c('0x29')]);return _0x5704df(_0x290c10[_0x803c('0x27')][_0x803c('0x29')]);}logger['error'](_0x803c('0x22'),_0x3e9d05,_0x290c10['error'][_0x803c('0x29')]);return _0x2ac3a7(_0x290c10[_0x803c('0x27')][_0x803c('0x29')]);}else{logger[_0x803c('0x21')](_0x803c('0x22'),_0x3e9d05,_0x803c('0x23'));_0x2ac3a7(_0x290c10['result']['message']);}})['catch'](function(_0x4b43ac){logger['error'](_0x803c('0x22'),_0x3e9d05,_0x4b43ac);_0x5704df(_0x4b43ac);});});}function respondWithStatusCode(_0x500e22,_0xc4f3da){_0xc4f3da=_0xc4f3da||0xcc;return function(_0x54eaa2){if(_0x54eaa2){return _0x500e22[_0x803c('0x2a')](_0xc4f3da);}return _0x500e22['status'](_0xc4f3da)[_0x803c('0x2b')]();};}function respondWithResult(_0x22f50e,_0x5c3a92){_0x5c3a92=_0x5c3a92||0xc8;return function(_0x27b54a){if(_0x27b54a){return _0x22f50e['status'](_0x5c3a92)[_0x803c('0x2c')](_0x27b54a);}};}function respondWithFilteredResult(_0x24c5d2,_0x35642b){return function(_0x50674c){if(_0x50674c){var _0x3ed09c=typeof _0x35642b[_0x803c('0x2d')]===_0x803c('0x2e')&&typeof _0x35642b[_0x803c('0x2f')]===_0x803c('0x2e');var _0x37baf0=_0x50674c['count'];var _0x245ae4=_0x3ed09c?0x0:_0x35642b['offset'];var _0x50e560=_0x3ed09c?_0x50674c['count']:_0x35642b[_0x803c('0x2d')]+_0x35642b[_0x803c('0x2f')];var _0xbd6298;if(_0x50e560>=_0x37baf0){_0x50e560=_0x37baf0;_0xbd6298=0xc8;}else{_0xbd6298=0xce;}_0x24c5d2[_0x803c('0x30')](_0xbd6298);return _0x24c5d2[_0x803c('0x31')]('Content-Range',_0x245ae4+'-'+_0x50e560+'/'+_0x37baf0)[_0x803c('0x2c')](_0x50674c);}return null;};}function patchUpdates(_0x1453c4){return function(_0x267253){try{jsonpatch[_0x803c('0x32')](_0x267253,_0x1453c4,!![]);}catch(_0x22c8ad){return BPromise[_0x803c('0x33')](_0x22c8ad);}return _0x267253[_0x803c('0x34')]();};}function saveUpdates(_0x2cffb2,_0x5590f8){return function(_0x5ab10a){if(_0x5ab10a){return _0x5ab10a[_0x803c('0x35')](_0x2cffb2)[_0x803c('0x20')](function(_0x28e345){return _0x28e345;});}return null;};}function removeEntity(_0x412d1d,_0x75b994){return function(_0x3a343c){if(_0x3a343c){return _0x3a343c[_0x803c('0x36')]()[_0x803c('0x20')](function(){var _0x4667d5=_0x3a343c[_0x803c('0x37')]({'plain':!![]});var _0x2b86dc=_0x803c('0x38');return db['UserProfileResource'][_0x803c('0x36')]({'where':{'type':_0x2b86dc,'resourceId':_0x4667d5['id']}})[_0x803c('0x20')](function(){return _0x3a343c;});})[_0x803c('0x20')](function(){_0x412d1d[_0x803c('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7a7b1,_0x47d3e1){return function(_0x42aaab){if(!_0x42aaab){_0x7a7b1[_0x803c('0x2a')](0x194);}return _0x42aaab;};}function handleError(_0x20ed05,_0x312c51){_0x312c51=_0x312c51||0x1f4;return function(_0x1bdaa7){logger['error'](_0x1bdaa7[_0x803c('0x39')]);if(_0x1bdaa7[_0x803c('0x3a')]){delete _0x1bdaa7[_0x803c('0x3a')];}_0x20ed05['status'](_0x312c51)['send'](_0x1bdaa7);};}exports[_0x803c('0x3b')]=function(_0x668d3b,_0x32e5a0){var _0x418bab={'include':[{'model':db[_0x803c('0x3c')],'as':_0x803c('0x3d')}]},_0x3f6978={},_0x4f4461={'count':0x0,'rows':[]};var _0xfe724b=_[_0x803c('0x3e')](db['SmsAccount'][_0x803c('0x3f')],function(_0x5b22d7){return{'name':_0x5b22d7[_0x803c('0x40')],'type':_0x5b22d7[_0x803c('0x41')][_0x803c('0x42')]};});_0x3f6978[_0x803c('0x43')]=_[_0x803c('0x3e')](_0xfe724b,_0x803c('0x3a'));_0x3f6978[_0x803c('0x44')]=_[_0x803c('0x45')](_0x668d3b[_0x803c('0x44')]);_0x3f6978[_0x803c('0x46')]=_[_0x803c('0x47')](_0x3f6978[_0x803c('0x43')],_0x3f6978[_0x803c('0x44')]);_0x418bab[_0x803c('0x48')]=_[_0x803c('0x47')](_0x3f6978['model'],qs[_0x803c('0x49')](_0x668d3b['query']['fields']));_0x418bab['attributes']=_0x418bab[_0x803c('0x48')][_0x803c('0x4a')]?_0x418bab[_0x803c('0x48')]:_0x3f6978[_0x803c('0x43')];if(!_0x668d3b['query'][_0x803c('0x4b')](_0x803c('0x4c'))){_0x418bab['limit']=qs[_0x803c('0x2f')](_0x668d3b[_0x803c('0x44')][_0x803c('0x2f')]);_0x418bab[_0x803c('0x2d')]=qs[_0x803c('0x2d')](_0x668d3b[_0x803c('0x44')][_0x803c('0x2d')]);}_0x418bab[_0x803c('0x4d')]=qs[_0x803c('0x4e')](_0x668d3b[_0x803c('0x44')][_0x803c('0x4e')]);_0x418bab[_0x803c('0x4f')]=qs[_0x803c('0x46')](_[_0x803c('0x50')](_0x668d3b[_0x803c('0x44')],_0x3f6978[_0x803c('0x46')]),_0xfe724b);if(_0x668d3b[_0x803c('0x44')][_0x803c('0x51')]){_0x418bab[_0x803c('0x4f')]=_[_0x803c('0x52')](_0x418bab[_0x803c('0x4f')],{'$or':_[_0x803c('0x3e')](_0xfe724b,function(_0x58a52e){if(_0x58a52e[_0x803c('0x41')]!==_0x803c('0x53')){var _0x166fe2={};_0x166fe2[_0x58a52e[_0x803c('0x3a')]]={'$like':'%'+_0x668d3b['query'][_0x803c('0x51')]+'%'};return _0x166fe2;}})});}_0x418bab=_[_0x803c('0x52')]({},_0x418bab,_0x668d3b['options']);var _0x598343={'where':_0x418bab[_0x803c('0x4f')]};return db[_0x803c('0x54')][_0x803c('0x55')](_0x598343)[_0x803c('0x20')](function(_0x57012e){_0x4f4461[_0x803c('0x55')]=_0x57012e;if(_0x668d3b['query'][_0x803c('0x56')]){_0x418bab[_0x803c('0x57')]=[{'all':!![]}];}return db['SmsAccount'][_0x803c('0x58')](_0x418bab);})[_0x803c('0x20')](function(_0x272604){_0x4f4461['rows']=_0x272604;return _0x4f4461;})[_0x803c('0x20')](respondWithFilteredResult(_0x32e5a0,_0x418bab))['catch'](handleError(_0x32e5a0,null));};exports[_0x803c('0x59')]=function(_0x17601a,_0xe829ad){var _0x3fba5e={'raw':![],'where':{'id':_0x17601a['params']['id']},'include':[{'model':db[_0x803c('0x3c')],'as':'mandatoryDispositionPause'}]},_0xcf6e25={};_0xcf6e25[_0x803c('0x43')]=_[_0x803c('0x45')](db['SmsAccount'][_0x803c('0x3f')]);_0xcf6e25[_0x803c('0x44')]=_[_0x803c('0x45')](_0x17601a[_0x803c('0x44')]);_0xcf6e25[_0x803c('0x46')]=_[_0x803c('0x47')](_0xcf6e25[_0x803c('0x43')],_0xcf6e25[_0x803c('0x44')]);_0x3fba5e[_0x803c('0x48')]=_['intersection'](_0xcf6e25[_0x803c('0x43')],qs[_0x803c('0x49')](_0x17601a[_0x803c('0x44')]['fields']));_0x3fba5e[_0x803c('0x48')]=_0x3fba5e['attributes'][_0x803c('0x4a')]?_0x3fba5e[_0x803c('0x48')]:_0xcf6e25[_0x803c('0x43')];if(_0x17601a[_0x803c('0x44')]['includeAll']){_0x3fba5e['include']=[{'all':!![]}];}_0x3fba5e=_[_0x803c('0x52')]({},_0x3fba5e,_0x17601a['options']);return db['SmsAccount']['find'](_0x3fba5e)[_0x803c('0x20')](handleEntityNotFound(_0xe829ad,null))[_0x803c('0x20')](respondWithResult(_0xe829ad,null))['catch'](handleError(_0xe829ad,null));};exports[_0x803c('0x5a')]=function(_0xd70d43,_0x4f5241){return db[_0x803c('0x54')][_0x803c('0x5a')](_0xd70d43[_0x803c('0x5b')],{})[_0x803c('0x20')](function(_0x3c9238){var _0x57cbd9=_0xd70d43[_0x803c('0x5c')][_0x803c('0x37')]({'plain':!![]});if(!_0x57cbd9)throw new Error(_0x803c('0x5d'));if(_0x57cbd9['role']===_0x803c('0x5c')){var _0xe82b87=_0x3c9238[_0x803c('0x37')]({'plain':!![]});var _0x17a122=_0x803c('0x38');return db[_0x803c('0x5e')][_0x803c('0x5f')]({'where':{'name':_0x17a122,'userProfileId':_0x57cbd9[_0x803c('0x60')]},'raw':!![]})[_0x803c('0x20')](function(_0x386efc){if(_0x386efc&&_0x386efc['autoAssociation']===0x0){return db[_0x803c('0x61')]['create']({'name':_0xe82b87[_0x803c('0x3a')],'resourceId':_0xe82b87['id'],'type':_0x386efc[_0x803c('0x3a')],'sectionId':_0x386efc['id']},{})[_0x803c('0x20')](function(){return _0x3c9238;});}else{return _0x3c9238;}})[_0x803c('0x62')](function(_0xc1fd13){logger[_0x803c('0x27')](_0x803c('0x63'),_0xc1fd13);throw _0xc1fd13;});}return _0x3c9238;})[_0x803c('0x20')](respondWithResult(_0x4f5241,0xc9))['catch'](handleError(_0x4f5241,null));};exports[_0x803c('0x35')]=function(_0x51b3be,_0x4a4603){if(_0x51b3be['body']['id']){delete _0x51b3be[_0x803c('0x5b')]['id'];}return db[_0x803c('0x54')][_0x803c('0x5f')]({'where':{'id':_0x51b3be[_0x803c('0x64')]['id']},'include':[{'model':db[_0x803c('0x3c')],'as':_0x803c('0x3d')}]})[_0x803c('0x20')](handleEntityNotFound(_0x4a4603,null))['then'](saveUpdates(_0x51b3be[_0x803c('0x5b')],null))[_0x803c('0x20')](respondWithResult(_0x4a4603,null))[_0x803c('0x62')](handleError(_0x4a4603,null));};exports['destroy']=function(_0x26e5df,_0x444136){return db[_0x803c('0x54')][_0x803c('0x5f')]({'where':{'id':_0x26e5df[_0x803c('0x64')]['id']}})[_0x803c('0x20')](handleEntityNotFound(_0x444136,null))['then'](removeEntity(_0x444136,null))[_0x803c('0x62')](handleError(_0x444136,null));};exports[_0x803c('0x65')]=function(_0x2f033a,_0x6b2dd7){return db['SmsAccount'][_0x803c('0x65')]()['then'](respondWithResult(_0x6b2dd7,null))['catch'](handleError(_0x6b2dd7,null));};exports['addDisposition']=function(_0x1d6591,_0x3b0828,_0x51df74){if(_0x1d6591[_0x803c('0x5b')]['id']){delete _0x1d6591[_0x803c('0x5b')]['id'];}return db[_0x803c('0x54')][_0x803c('0x5f')]({'where':{'id':_0x1d6591['params']['id']}})[_0x803c('0x20')](handleEntityNotFound(_0x3b0828,null))['then'](function(_0x36fc55){if(_0x36fc55){_0x1d6591[_0x803c('0x5b')]['SmsAccountId']=_0x36fc55['id'];return db[_0x803c('0x66')][_0x803c('0x5a')](_0x1d6591['body']);}})[_0x803c('0x20')](respondWithResult(_0x3b0828,null))['catch'](handleError(_0x3b0828,null));};exports[_0x803c('0x67')]=function(_0x321e80,_0x39b364,_0x5b0ada){var _0x5939e5={'raw':![],'where':{}};var _0x5ae486={};var _0x4c0f66={'count':0x0,'rows':[]};return db[_0x803c('0x54')][_0x803c('0x68')]({'where':{'id':_0x321e80[_0x803c('0x64')]['id']}})[_0x803c('0x20')](handleEntityNotFound(_0x39b364,null))[_0x803c('0x20')](function(_0x30df44){if(_0x30df44){_0x5ae486[_0x803c('0x43')]=_['keys'](db[_0x803c('0x66')][_0x803c('0x3f')]);_0x5ae486[_0x803c('0x44')]=_[_0x803c('0x45')](_0x321e80[_0x803c('0x44')]);_0x5ae486[_0x803c('0x46')]=_[_0x803c('0x47')](_0x5ae486[_0x803c('0x43')],_0x5ae486['query']);_0x5939e5[_0x803c('0x48')]=_[_0x803c('0x47')](_0x5ae486[_0x803c('0x43')],qs[_0x803c('0x49')](_0x321e80['query'][_0x803c('0x49')]));_0x5939e5['attributes']=_0x5939e5[_0x803c('0x48')][_0x803c('0x4a')]?_0x5939e5[_0x803c('0x48')]:_0x5ae486['model'];if(!_0x321e80[_0x803c('0x44')]['hasOwnProperty'](_0x803c('0x4c'))){_0x5939e5[_0x803c('0x2f')]=qs[_0x803c('0x2f')](_0x321e80[_0x803c('0x44')][_0x803c('0x2f')]);_0x5939e5[_0x803c('0x2d')]=qs[_0x803c('0x2d')](_0x321e80[_0x803c('0x44')][_0x803c('0x2d')]);}_0x5939e5['order']=qs[_0x803c('0x4e')](_0x321e80[_0x803c('0x44')][_0x803c('0x4e')]);_0x5939e5[_0x803c('0x4f')]=qs[_0x803c('0x46')](_[_0x803c('0x50')](_0x321e80[_0x803c('0x44')],_0x5ae486[_0x803c('0x46')]));_0x5939e5[_0x803c('0x4f')]['SmsAccountId']=_0x30df44['id'];if(_0x321e80[_0x803c('0x44')][_0x803c('0x51')]){_0x5939e5[_0x803c('0x4f')]=_[_0x803c('0x52')](_0x5939e5[_0x803c('0x4f')],{'$or':_[_0x803c('0x3e')](_0x5939e5['attributes'],function(_0x4bc926){var _0x2f40b0={};_0x2f40b0[_0x4bc926]={'$like':'%'+_0x321e80['query'][_0x803c('0x51')]+'%'};return _0x2f40b0;})});}_0x5939e5=_[_0x803c('0x52')]({},_0x5939e5,_0x321e80['options']);return db[_0x803c('0x66')][_0x803c('0x55')]({'where':_0x5939e5[_0x803c('0x4f')]})[_0x803c('0x20')](function(_0x22210c){_0x4c0f66[_0x803c('0x55')]=_0x22210c;if(_0x321e80[_0x803c('0x44')][_0x803c('0x56')]){_0x5939e5['include']=[{'all':!![]}];}return db[_0x803c('0x66')][_0x803c('0x58')](_0x5939e5);})[_0x803c('0x20')](function(_0x256908){_0x4c0f66[_0x803c('0x69')]=_0x256908;return _0x4c0f66;});}})['then'](respondWithFilteredResult(_0x39b364,_0x5939e5))[_0x803c('0x62')](handleError(_0x39b364,null));};exports[_0x803c('0x6a')]=function(_0x3a3eb7,_0x3050ca,_0x387e09){return db[_0x803c('0x54')][_0x803c('0x5f')]({'where':{'id':_0x3a3eb7[_0x803c('0x64')]['id']}})[_0x803c('0x20')](handleEntityNotFound(_0x3050ca,null))[_0x803c('0x20')](function(_0x2a247a){if(_0x2a247a){return _0x2a247a['removeDispositions'](_0x3a3eb7[_0x803c('0x44')][_0x803c('0x6b')]);}})[_0x803c('0x20')](respondWithStatusCode(_0x3050ca,null))[_0x803c('0x62')](handleError(_0x3050ca,null));};exports[_0x803c('0x6c')]=function(_0x20fe2d,_0x57f2f6,_0x4f20b8){if(_0x20fe2d['body']['id']){delete _0x20fe2d['body']['id'];}return db[_0x803c('0x54')][_0x803c('0x5f')]({'where':{'id':_0x20fe2d['params']['id']}})[_0x803c('0x20')](handleEntityNotFound(_0x57f2f6,null))[_0x803c('0x20')](function(_0x2e7c77){if(_0x2e7c77){_0x20fe2d[_0x803c('0x5b')][_0x803c('0x6d')]=_0x2e7c77['id'];return db[_0x803c('0x6e')][_0x803c('0x5a')](_0x20fe2d['body']);}})[_0x803c('0x20')](respondWithResult(_0x57f2f6,null))['catch'](handleError(_0x57f2f6,null));};exports['getAnswers']=function(_0x51ac9f,_0x5a3652,_0x2d2ffc){var _0x393ea4={'raw':![],'where':{}};var _0x328fc1={};var _0x2f4ae1={'count':0x0,'rows':[]};return db[_0x803c('0x54')][_0x803c('0x68')]({'where':{'id':_0x51ac9f[_0x803c('0x64')]['id']}})[_0x803c('0x20')](handleEntityNotFound(_0x5a3652,null))[_0x803c('0x20')](function(_0x5c5c2b){if(_0x5c5c2b){_0x328fc1[_0x803c('0x43')]=_[_0x803c('0x45')](db[_0x803c('0x6e')]['rawAttributes']);_0x328fc1[_0x803c('0x44')]=_[_0x803c('0x45')](_0x51ac9f[_0x803c('0x44')]);_0x328fc1[_0x803c('0x46')]=_['intersection'](_0x328fc1[_0x803c('0x43')],_0x328fc1[_0x803c('0x44')]);_0x393ea4[_0x803c('0x48')]=_[_0x803c('0x47')](_0x328fc1[_0x803c('0x43')],qs['fields'](_0x51ac9f[_0x803c('0x44')][_0x803c('0x49')]));_0x393ea4['attributes']=_0x393ea4[_0x803c('0x48')][_0x803c('0x4a')]?_0x393ea4['attributes']:_0x328fc1[_0x803c('0x43')];if(!_0x51ac9f[_0x803c('0x44')][_0x803c('0x4b')]('nolimit')){_0x393ea4[_0x803c('0x2f')]=qs[_0x803c('0x2f')](_0x51ac9f[_0x803c('0x44')]['limit']);_0x393ea4[_0x803c('0x2d')]=qs[_0x803c('0x2d')](_0x51ac9f[_0x803c('0x44')][_0x803c('0x2d')]);}_0x393ea4[_0x803c('0x4d')]=qs['sort'](_0x51ac9f['query']['sort']);_0x393ea4[_0x803c('0x4f')]=qs[_0x803c('0x46')](_[_0x803c('0x50')](_0x51ac9f[_0x803c('0x44')],_0x328fc1[_0x803c('0x46')]));_0x393ea4['where']['SmsAccountId']=_0x5c5c2b['id'];if(_0x51ac9f[_0x803c('0x44')]['filter']){_0x393ea4[_0x803c('0x4f')]=_[_0x803c('0x52')](_0x393ea4['where'],{'$or':_[_0x803c('0x3e')](_0x393ea4[_0x803c('0x48')],function(_0x233211){var _0x4bf507={};_0x4bf507[_0x233211]={'$like':'%'+_0x51ac9f['query'][_0x803c('0x51')]+'%'};return _0x4bf507;})});}_0x393ea4=_[_0x803c('0x52')]({},_0x393ea4,_0x51ac9f[_0x803c('0x6f')]);return db[_0x803c('0x6e')]['count']({'where':_0x393ea4[_0x803c('0x4f')]})[_0x803c('0x20')](function(_0x513b9d){_0x2f4ae1[_0x803c('0x55')]=_0x513b9d;if(_0x51ac9f['query'][_0x803c('0x56')]){_0x393ea4[_0x803c('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x803c('0x58')](_0x393ea4);})[_0x803c('0x20')](function(_0x401162){_0x2f4ae1[_0x803c('0x69')]=_0x401162;return _0x2f4ae1;});}})['then'](respondWithFilteredResult(_0x5a3652,_0x393ea4))[_0x803c('0x62')](handleError(_0x5a3652,null));};exports[_0x803c('0x70')]=function(_0x262c35,_0x1162b9,_0x1d3448){return db[_0x803c('0x54')][_0x803c('0x5f')]({'where':{'id':_0x262c35[_0x803c('0x64')]['id']}})['then'](handleEntityNotFound(_0x1162b9,null))[_0x803c('0x20')](function(_0xe58f55){if(_0xe58f55){return _0xe58f55[_0x803c('0x70')](_0x262c35[_0x803c('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x1162b9,null))[_0x803c('0x62')](handleError(_0x1162b9,null));};exports[_0x803c('0x71')]=function(_0x4e7ec3,_0x4b1c3c,_0x362ac6){var _0x3ab8e2={'channel':_0x803c('0x72')};var _0x5d37c2=[];var _0x5535e9=[];var _0x5643f4={};return db['SmsAccount']['find']({'where':{'id':_0x4e7ec3['params']['id']},'include':[{'model':db['SmsApplication'],'as':_0x803c('0x73')}]})['then'](handleEntityNotFound(_0x4b1c3c,null))['then'](function(_0x4cf435){_0x3ab8e2[_0x803c('0x74')]=_0x4cf435;_0x3ab8e2[_0x803c('0x75')]=_[_0x803c('0x76')](_0x4cf435[_0x803c('0x73')],['priority'],[_0x803c('0x77')]);if(_0x3ab8e2['account']['Applications']){delete _0x3ab8e2[_0x803c('0x74')]['Applications'];}return db['CmContact'][_0x803c('0x65')]();})[_0x803c('0x20')](function(_0x30853a){if(!_0x30853a){throw new db[(_0x803c('0x78'))][(_0x803c('0x79'))](_0x803c('0x7a'));}_0x5d37c2=_[_0x803c('0x7b')](_['keys'](_0x30853a),[_0x803c('0x7c'),_0x803c('0x7d')]);_0x5535e9=_[_0x803c('0x7b')](_[_0x803c('0x45')](_0x30853a),[_0x803c('0x7c'),_0x803c('0x7d'),'CompanyId',_0x803c('0x7e')]);_0x3ab8e2[_0x803c('0x5b')]={'mapKey':_0x803c('0x7f')};if(_0x3ab8e2[_0x803c('0x74')][_0x803c('0x41')]){switch(_0x3ab8e2[_0x803c('0x74')][_0x803c('0x41')]){case _0x803c('0x80'):_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x81')]=_0x4e7ec3[_0x803c('0x5b')][_0x803c('0x82')];_0x3ab8e2['body'][_0x803c('0x5b')]=_0x4e7ec3[_0x803c('0x5b')][_0x803c('0x83')];_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x84')]=_0x4e7ec3['body'][_0x803c('0x85')];break;case'skebby':_0x3ab8e2['body'][_0x803c('0x81')]='+'+_0x4e7ec3[_0x803c('0x5b')]['sender'];_0x3ab8e2[_0x803c('0x5b')]['body']=_0x4e7ec3[_0x803c('0x5b')][_0x803c('0x86')];break;case _0x803c('0x87'):_0x3ab8e2['body'][_0x803c('0x81')]=_0x4e7ec3[_0x803c('0x5b')][_0x803c('0x81')];_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x5b')]=_0x4e7ec3[_0x803c('0x5b')]['message'];break;case'clicksend':_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x81')]=_0x4e7ec3[_0x803c('0x5b')][_0x803c('0x81')];_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x5b')]=_0x4e7ec3[_0x803c('0x5b')][_0x803c('0x5b')];_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x84')]=_0x4e7ec3['body'][_0x803c('0x88')];break;case _0x803c('0x89'):_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x81')]=_0x4e7ec3['body'][_0x803c('0x82')];_0x3ab8e2['body'][_0x803c('0x5b')]=_0x4e7ec3['body'][_0x803c('0x8a')];_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x84')]=_0x4e7ec3['body']['MessageUUID'];break;case'infobip':_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x81')]='+'+_0x4e7ec3[_0x803c('0x5b')][_0x803c('0x8b')][0x0][_0x803c('0x81')];_0x3ab8e2['body'][_0x803c('0x5b')]=_0x4e7ec3[_0x803c('0x5b')][_0x803c('0x8b')][0x0]['text'];_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x84')]=_0x4e7ec3['body'][_0x803c('0x8b')][0x0][_0x803c('0x84')];break;case _0x803c('0x8c'):_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x81')]=_0x4e7ec3['body']['originatingAddress'];_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x5b')]=_0x4e7ec3[_0x803c('0x5b')][_0x803c('0x8d')][_0x803c('0x29')];break;case _0x803c('0x8e'):_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x81')]=_0x4e7ec3[_0x803c('0x5b')]['fromNumber'];_0x3ab8e2[_0x803c('0x5b')]['body']=_0x4e7ec3[_0x803c('0x5b')][_0x803c('0x86')];_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x84')]=_0x4e7ec3[_0x803c('0x5b')][_0x803c('0x8f')];break;case _0x803c('0x90'):_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x84')]=_0x4e7ec3[_0x803c('0x5b')][0x0][_0x803c('0x29')]['id'];_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x81')]=_0x4e7ec3[_0x803c('0x5b')][0x0]['message'][_0x803c('0x81')];_0x3ab8e2['body']['body']=_0x4e7ec3['body'][0x0][_0x803c('0x29')][_0x803c('0x86')];break;case _0x803c('0x91'):_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x81')]=_0x4e7ec3[_0x803c('0x5b')][_0x803c('0x81')];_0x3ab8e2['body'][_0x803c('0x5b')]=_0x4e7ec3['body'][_0x803c('0x29')];_0x3ab8e2['body'][_0x803c('0x84')]=_0x4e7ec3[_0x803c('0x5b')]['refid'];break;}}if(_0x3ab8e2[_0x803c('0x5b')]['id']){delete _0x3ab8e2[_0x803c('0x5b')]['id'];}if(_[_0x803c('0x92')](_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x81')])){throw new db[(_0x803c('0x78'))]['ValidationError'](_0x803c('0x93'));}if(_[_0x803c('0x92')](_0x3ab8e2['body'][_0x803c('0x5b')])||_0x3ab8e2[_0x803c('0x5b')]['body']===''){throw new db[(_0x803c('0x78'))][(_0x803c('0x79'))](_0x803c('0x94'));}if(_[_0x803c('0x92')](_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x95')])){throw new db[(_0x803c('0x78'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5535e9);}if(!_['includes'](_0x5535e9,_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x95')])){throw new db[(_0x803c('0x78'))][(_0x803c('0x79'))](_0x803c('0x96')+_0x5535e9);}_0x5643f4[_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x95')]]=_0x3ab8e2[_0x803c('0x5b')]['from'];return db['CmList'][_0x803c('0x5f')]({'where':{'id':_0x3ab8e2['account'][_0x803c('0x7e')]},'include':[{'model':db[_0x803c('0x97')],'as':_0x803c('0x98'),'where':_0x5643f4,'limit':0x1,'order':[[_0x803c('0x7d'),_0x803c('0x99')]]}]});})[_0x803c('0x20')](handleEntityNotFound(_0x4b1c3c,null))[_0x803c('0x20')](function(_0x2bf847){if(_0x2bf847){_0x3ab8e2[_0x803c('0x9a')]=_[_0x803c('0x9b')](_0x2bf847,[_0x803c('0x98')]);if(_0x2bf847[_0x803c('0x98')][_0x803c('0x4a')]){return _0x2bf847[_0x803c('0x98')][0x0];}var _0x1f908e=_[_0x803c('0x18')](_0x3ab8e2[_0x803c('0x5b')],{'firstName':_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x81')],'ListId':_0x2bf847['id']});_0x1f908e[_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x95')]]=_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x81')];return db['CmContact'][_0x803c('0x5a')](_0x1f908e,{'fields':_0x5d37c2,'raw':!![]});}})['then'](handleEntityNotFound(_0x4b1c3c,null))[_0x803c('0x20')](function(_0x20cf44){if(_0x20cf44){_0x3ab8e2['contact']=_0x20cf44;var _0x3fc18a={'ContactId':_0x20cf44['id'],'phone':_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x81')],'SmsAccountId':_0x4e7ec3['params']['id']};var _0x421e59={'ContactId':_0x20cf44['id'],'SmsAccountId':_0x4e7ec3[_0x803c('0x64')]['id'],'closed':![]};return db[_0x803c('0x9c')][_0x803c('0x5f')]({'where':_0x421e59})[_0x803c('0x20')](function(_0xc467a3){if(_0xc467a3){return[_0xc467a3,![]];}return db['SmsInteraction'][_0x803c('0x5a')](_0x3fc18a)[_0x803c('0x20')](function(_0x25262c){return[_0x25262c,!![]];});});}})[_0x803c('0x9d')](function(_0x415d68,_0x59395d){_0x3ab8e2[_0x803c('0x9e')]=_0x415d68[_0x803c('0x37')]({'plain':!![]});_0x3ab8e2[_0x803c('0x9e')]['created']=![];if(_0x59395d){if(_0x3ab8e2[_0x803c('0x74')][_0x803c('0x9f')]){_0x3ab8e2[_0x803c('0x75')][_0x803c('0xa0')]({'id':0x0,'priority':_0x3ab8e2[_0x803c('0x75')][_0x803c('0x4a')]+0x1,'app':_0x803c('0xa1'),'appdata':'unmanaged','interval':_0x803c('0xa2')});}_0x3ab8e2[_0x803c('0x9e')]['created']=!![];}return db['SmsMessage'][_0x803c('0x5a')]({'phone':_0x3ab8e2['body'][_0x803c('0x81')],'messageId':_0x3ab8e2[_0x803c('0x5b')][_0x803c('0x84')],'body':_0x3ab8e2['body']['body'],'SmsAccountId':_0x4e7ec3[_0x803c('0x64')]['id'],'SmsInteractionId':_0x415d68['id'],'direction':'in','ContactId':_0x415d68['ContactId'],'AttachmentId':_0x3ab8e2[_0x803c('0x5b')]['AttachmentId']});})[_0x803c('0x20')](function(_0x72eaac){_0x3ab8e2[_0x803c('0x29')]=_0x72eaac;if(!_0x3ab8e2['interaction'][_0x803c('0xa3')])return;return db[_0x803c('0xa4')][_0x803c('0x5f')]({'attributes':['id','name'],'where':{'id':_0x3ab8e2['interaction'][_0x803c('0xa3')]}});})[_0x803c('0x20')](function(_0x5ee6d5){if(_0x5ee6d5){_0x3ab8e2[_0x803c('0x75')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5ee6d5[_0x803c('0x3a')]+','+(_0x3ab8e2[_0x803c('0x74')][_0x803c('0xa5')]||0xa),'interval':_0x803c('0xa2')});}if(!_0x3ab8e2[_0x803c('0x9e')][_0x803c('0xa6')])return;return db[_0x803c('0xa7')][_0x803c('0x5f')]({'attributes':['id','name'],'where':{'id':_0x3ab8e2['interaction']['queueId']}});})[_0x803c('0x20')](function(_0x1a5f70){if(_0x1a5f70){_0x3ab8e2[_0x803c('0x75')]['unshift']({'id':0x0,'priority':0x1,'app':_0x803c('0xa8'),'appdata':_0x1a5f70[_0x803c('0x3a')]+','+(_0x3ab8e2[_0x803c('0x74')][_0x803c('0xa9')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x803c('0xaa'),'startRouting',_0x3ab8e2);})['then'](function(_0x4330e5){if(_0x4330e5){var _0xa2f4c9=0xc8;var _0x5cfefa=_0x803c('0xab');logger[_0x803c('0x21')](_0x803c('0x25'),_0x5cfefa,_0xa2f4c9,'entity\x20found');logger[_0x803c('0x24')](_0x803c('0xac'),_0x5cfefa,_0xa2f4c9,_0x803c('0xad'),JSON[_0x803c('0x26')](_0x4330e5));if(_0x3ab8e2[_0x803c('0x74')][_0x803c('0x41')]===_0x803c('0x80')){return _0x4b1c3c[_0x803c('0x30')](_0xa2f4c9)['set'](_0x803c('0xae'),_0x803c('0xaf'))['send'](_0x803c('0xb0'));}else{return _0x4b1c3c[_0x803c('0x30')](_0xa2f4c9)[_0x803c('0x2c')](_0x4330e5);}}})['catch'](handleError(_0x4b1c3c,null));};exports[_0x803c('0xb1')]=function(_0x51ec6d,_0x17712a){var _0x22cac3=_0x51ec6d['params']['id'];var _0x58f6c0=_0x51ec6d['body'];var _0x1e6e61=0xc8;var _0x3cf3d5=null;return db[_0x803c('0xb2')]['transaction']({'isolationLevel':db[_0x803c('0xb2')][_0x803c('0xb3')]['ISOLATION_LEVELS'][_0x803c('0xb4')]},function(_0x60a74f){return db['SmsAccount']['findOne']({'where':{'id':_0x22cac3},'transaction':_0x60a74f})[_0x803c('0x20')](function(_0x39cff7){if(_0x39cff7){return db[_0x803c('0xb5')][_0x803c('0x36')]({'where':{'SmsAccountId':_0x22cac3},'transaction':_0x60a74f})[_0x803c('0x20')](function(){var _0xc5874b=_[_0x803c('0x3e')](_0x58f6c0,function(_0x2ba41a){_0x2ba41a[_0x803c('0x6d')]=_0x22cac3;return _0x2ba41a;});return db[_0x803c('0xb5')]['bulkCreate'](_0xc5874b,{'transaction':_0x60a74f});});}else{_0x1e6e61=0x194;_0x3cf3d5=[];}});})[_0x803c('0x20')](function(){if(_0x1e6e61!==0x194){return db['SmsApplication'][_0x803c('0xb6')]({'where':{'SmsAccountId':_0x22cac3},'order':'priority'})[_0x803c('0x20')](function(_0x4715e5){_0x3cf3d5=_0x4715e5;});}})[_0x803c('0x62')](function(_0x4e7056){_0x1e6e61=0x1f4;logger[_0x803c('0x27')](_0x4e7056[_0x803c('0x39')]);if(_0x4e7056['name']){delete _0x4e7056['name'];}_0x3cf3d5=_0x4e7056;})['finally'](function(){if(_0x3cf3d5===null){_0x17712a[_0x803c('0x2a')](_0x1e6e61);}else{if(_0x1e6e61===0x1f4){_0x17712a['status'](_0x1e6e61)[_0x803c('0xb7')](_0x3cf3d5);}else{_0x17712a[_0x803c('0x30')](_0x1e6e61)[_0x803c('0x2c')](_0x3cf3d5);}}});};exports[_0x803c('0xb8')]=function(_0x123136,_0x139eaa,_0x56a961){var _0x2a0e9b={};var _0x2ce9f4={};var _0x35e249;var _0x47d94f;return db[_0x803c('0x54')][_0x803c('0x68')]({'where':{'id':_0x123136[_0x803c('0x64')]['id']}})[_0x803c('0x20')](handleEntityNotFound(_0x139eaa,null))[_0x803c('0x20')](function(_0x44466f){if(_0x44466f){_0x35e249=_0x44466f;_0x2ce9f4[_0x803c('0x43')]=_[_0x803c('0x45')](db[_0x803c('0xb5')]['rawAttributes']);_0x2ce9f4[_0x803c('0x44')]=_[_0x803c('0x45')](_0x123136['query']);_0x2ce9f4[_0x803c('0x46')]=_[_0x803c('0x47')](_0x2ce9f4[_0x803c('0x43')],_0x2ce9f4[_0x803c('0x44')]);_0x2a0e9b['attributes']=_[_0x803c('0x47')](_0x2ce9f4[_0x803c('0x43')],qs[_0x803c('0x49')](_0x123136[_0x803c('0x44')]['fields']));_0x2a0e9b['attributes']=_0x2a0e9b[_0x803c('0x48')][_0x803c('0x4a')]?_0x2a0e9b['attributes']:_0x2ce9f4[_0x803c('0x43')];_0x2a0e9b[_0x803c('0x4d')]=qs['sort'](_0x123136[_0x803c('0x44')][_0x803c('0x4e')]);_0x2a0e9b['where']=qs['filters'](_[_0x803c('0x50')](_0x123136[_0x803c('0x44')],_0x2ce9f4[_0x803c('0x46')]));if(_0x123136[_0x803c('0x44')][_0x803c('0x51')]){_0x2a0e9b[_0x803c('0x4f')]=_[_0x803c('0x52')](_0x2a0e9b[_0x803c('0x4f')],{'$or':_['map'](_0x2a0e9b[_0x803c('0x48')],function(_0xabb3a4){var _0x4349d9={};_0x4349d9[_0xabb3a4]={'$like':'%'+_0x123136[_0x803c('0x44')][_0x803c('0x51')]+'%'};return _0x4349d9;})});}_0x2a0e9b=_[_0x803c('0x52')]({},_0x2a0e9b,_0x123136[_0x803c('0x6f')]);return _0x35e249[_0x803c('0xb8')](_0x2a0e9b);}})['then'](function(_0x29a301){if(_0x29a301){_0x47d94f=_0x29a301[_0x803c('0x4a')];if(!_0x123136[_0x803c('0x44')]['hasOwnProperty'](_0x803c('0x4c'))){_0x2a0e9b[_0x803c('0x2f')]=qs['limit'](_0x123136[_0x803c('0x44')][_0x803c('0x2f')]);_0x2a0e9b[_0x803c('0x2d')]=qs[_0x803c('0x2d')](_0x123136[_0x803c('0x44')]['offset']);}return _0x35e249[_0x803c('0xb8')](_0x2a0e9b);}})[_0x803c('0x20')](function(_0x539b3e){if(_0x539b3e){return _0x539b3e?{'count':_0x47d94f,'rows':_0x539b3e}:null;}})[_0x803c('0x20')](respondWithResult(_0x139eaa,null))['catch'](handleError(_0x139eaa,null));};exports[_0x803c('0xb9')]=function(_0x1c9eed,_0x4a7c8d,_0x2aebec){var _0x3a7c5a={'raw':![],'where':{}};var _0x47c2eb={};var _0x1d4618={'count':0x0,'rows':[]};return db[_0x803c('0x54')]['findOne']({'where':{'id':_0x1c9eed['params']['id']}})['then'](handleEntityNotFound(_0x4a7c8d,null))['then'](function(_0x4c0eea){if(_0x4c0eea){_0x47c2eb[_0x803c('0x43')]=_['keys'](db[_0x803c('0x9c')][_0x803c('0x3f')]);_0x47c2eb[_0x803c('0x44')]=_[_0x803c('0x45')](_0x1c9eed[_0x803c('0x44')]);_0x47c2eb[_0x803c('0x46')]=_['intersection'](_0x47c2eb[_0x803c('0x43')],_0x47c2eb[_0x803c('0x44')]);_0x3a7c5a['attributes']=_[_0x803c('0x47')](_0x47c2eb['model'],qs[_0x803c('0x49')](_0x1c9eed['query'][_0x803c('0x49')]));_0x3a7c5a[_0x803c('0x48')]=_0x3a7c5a['attributes']['length']?_0x3a7c5a[_0x803c('0x48')]:_0x47c2eb['model'];if(!_0x1c9eed[_0x803c('0x44')][_0x803c('0x4b')](_0x803c('0x4c'))){_0x3a7c5a[_0x803c('0x2f')]=qs['limit'](_0x1c9eed['query']['limit']);_0x3a7c5a['offset']=qs[_0x803c('0x2d')](_0x1c9eed['query'][_0x803c('0x2d')]);}_0x3a7c5a[_0x803c('0x4d')]=qs[_0x803c('0x4e')](_0x1c9eed[_0x803c('0x44')]['sort']);_0x3a7c5a[_0x803c('0x4f')]=qs[_0x803c('0x46')](_[_0x803c('0x50')](_0x1c9eed[_0x803c('0x44')],_0x47c2eb[_0x803c('0x46')]));_0x3a7c5a[_0x803c('0x4f')][_0x803c('0x6d')]=_0x4c0eea['id'];if(_0x1c9eed['query']['filter']){_0x3a7c5a[_0x803c('0x4f')]=_[_0x803c('0x52')](_0x3a7c5a[_0x803c('0x4f')],{'$or':_['map'](_0x3a7c5a[_0x803c('0x48')],function(_0x5c413e){var _0x459ff4={};_0x459ff4[_0x5c413e]={'$like':'%'+_0x1c9eed['query'][_0x803c('0x51')]+'%'};return _0x459ff4;})});}_0x3a7c5a=_[_0x803c('0x52')]({},_0x3a7c5a,_0x1c9eed[_0x803c('0x6f')]);return db[_0x803c('0x9c')]['count']({'where':_0x3a7c5a[_0x803c('0x4f')]})['then'](function(_0x4d9d02){_0x1d4618[_0x803c('0x55')]=_0x4d9d02;if(_0x1c9eed[_0x803c('0x44')][_0x803c('0x56')]){_0x3a7c5a['include']=[{'model':db[_0x803c('0x97')],'as':'Contact','required':![]},{'model':db[_0x803c('0xa4')],'as':'Owner','attributes':[_0x803c('0x3a'),_0x803c('0xba'),'internal'],'required':![]},{'model':db[_0x803c('0xbb')],'as':'Tags','attributes':['id',_0x803c('0x3a'),_0x803c('0xbc')],'where':_0x1c9eed[_0x803c('0x44')]['tag']?{'id':_0x1c9eed[_0x803c('0x44')][_0x803c('0xbd')]}:undefined,'required':_0x1c9eed[_0x803c('0x44')][_0x803c('0xbd')]?!![]:![]}];}return db[_0x803c('0x9c')][_0x803c('0x58')](_0x3a7c5a);})[_0x803c('0x20')](function(_0xef9c37){_0x1d4618[_0x803c('0x69')]=_0xef9c37;return _0x1d4618;});}})[_0x803c('0x20')](respondWithFilteredResult(_0x4a7c8d,_0x3a7c5a))[_0x803c('0x62')](handleError(_0x4a7c8d,null));};exports[_0x803c('0xb7')]=function(_0x1d1a86,_0x2a0ad3,_0x249bb3){var _0x2cf0a1,_0x552279,_0x47b937;if(_[_0x803c('0x92')](_0x1d1a86['body'][_0x803c('0x5b')])||_0x1d1a86[_0x803c('0x5b')]['body']===''){throw new db[(_0x803c('0x78'))]['ValidationError'](_0x803c('0x94'));}if(_['isNil'](_0x1d1a86[_0x803c('0x5b')]['to'])){throw new db[(_0x803c('0x78'))][(_0x803c('0x79'))]('to\x20is\x20mandatory');}_0x2cf0a1=_0x1d1a86['body']['to'];return db[_0x803c('0x54')]['find']({'where':{'id':_0x1d1a86[_0x803c('0x64')]['id']},'include':[{'model':db['CmList'],'as':_0x803c('0xbe'),'include':[{'model':db[_0x803c('0x97')],'as':_0x803c('0x98'),'where':{'mobile':_0x2cf0a1},'limit':0x1,'order':[[_0x803c('0x7d'),_0x803c('0x99')]]}]}]})[_0x803c('0x20')](handleEntityNotFound(_0x2a0ad3,null))[_0x803c('0x20')](function(_0x1d60b5){if(_0x1d60b5&&_0x1d60b5[_0x803c('0xbe')]){_0x552279=_0x1d60b5[_0x803c('0x37')]({'plain':!![]});if(_0x552279[_0x803c('0xbe')]&&_0x552279[_0x803c('0xbe')][_0x803c('0x98')][_0x803c('0x4a')]){return _0x552279['List'][_0x803c('0x98')][0x0];}return db[_0x803c('0x97')][_0x803c('0x5a')](_[_0x803c('0x18')](_0x1d1a86[_0x803c('0x5b')],{'firstName':_0x2cf0a1,'mobile':_0x2cf0a1,'phone':_0x2cf0a1,'ListId':_0x552279[_0x803c('0x7e')]}));}})['then'](handleEntityNotFound(_0x2a0ad3,null))[_0x803c('0x20')](function(_0x30d922){if(_0x30d922){_0x47b937=_0x30d922;return db[_0x803c('0x9c')]['find']({'where':{'ContactId':_0x47b937['id'],'closed':![],'SmsAccountId':_0x552279['id']}})[_0x803c('0x20')](function(_0x1995cc){if(_0x1995cc){return[_0x1995cc,![]];}return db['SmsInteraction']['create']({'UserId':_0x1d1a86['user']['id'],'ContactId':_0x47b937['id'],'SmsAccountId':_0x552279['id'],'phone':_0x2cf0a1,'firstMsgDirection':_0x803c('0xbf'),'Messages':[_['merge'](_0x1d1a86['body'],{'read':![],'body':_0x1d1a86[_0x803c('0x5b')]['body'],'phone':_0x2cf0a1,'SmsAccountId':_0x552279['id'],'UserId':_0x1d1a86[_0x803c('0x5c')]['id'],'ContactId':_0x47b937['id']})]},{'include':[{'model':db[_0x803c('0xc0')],'as':_0x803c('0xc1')}]})[_0x803c('0x20')](function(_0x566c2b){return[_0x566c2b,!![]];});});}})['spread'](function(_0x377f53,_0x525917){if(_0x525917){return _0x377f53;}return db[_0x803c('0xc0')][_0x803c('0x5a')](_[_0x803c('0x52')](_0x1d1a86[_0x803c('0x5b')],{'read':![],'body':_0x1d1a86[_0x803c('0x5b')][_0x803c('0x5b')],'phone':_0x2cf0a1,'SmsAccountId':_0x552279['id'],'SmsInteractionId':_0x377f53['id'],'UserId':_0x1d1a86['user']['id'],'ContactId':_0x47b937['id']}))[_0x803c('0x20')](function(_0x32c846){_0x377f53['dataValues'][_0x803c('0xc1')]=[];_0x377f53[_0x803c('0xc2')][_0x803c('0xc1')]['push'](_0x32c846[_0x803c('0xc2')]);return _0x377f53;});})[_0x803c('0x20')](respondWithResult(_0x2a0ad3,null))[_0x803c('0x62')](handleError(_0x2a0ad3,null));};exports['status']=function(_0x16d5a2,_0x20ae9a,_0x584688){if(_0x16d5a2[_0x803c('0x5b')]['id']){delete _0x16d5a2[_0x803c('0x5b')]['id'];}var _0x542220,_0x28547f,_0x23711c;return db[_0x803c('0x54')]['find']({'where':{'id':_0x16d5a2[_0x803c('0x64')]['id']}})[_0x803c('0x20')](handleEntityNotFound(_0x20ae9a,null))['then'](function(_0x33d168){if(_0x33d168){_0x23711c=_0x33d168;logger[_0x803c('0x24')](_0x803c('0x25'),_0x803c('0x30'),'received\x20delivery\x20report\x20from',_0x33d168[_0x803c('0x41')],util[_0x803c('0xc3')](_0x16d5a2['body'],{'showHidden':![],'depth':null}));switch(_0x33d168[_0x803c('0x41')]){case _0x803c('0xc4'):if(_0x16d5a2[_0x803c('0x5b')]['skebby_dispatch_id']&&_0x16d5a2[_0x803c('0x5b')][_0x803c('0x30')]){_0x28547f=_0x16d5a2[_0x803c('0x5b')][_0x803c('0x30')];return db[_0x803c('0xc0')][_0x803c('0x5f')]({'where':{'messageId':_0x16d5a2[_0x803c('0x5b')][_0x803c('0xc5')]}});}break;case _0x803c('0x87'):if(_0x16d5a2[_0x803c('0x5b')]['requestid']&&_0x16d5a2[_0x803c('0x5b')][_0x803c('0xc6')]){_0x28547f=_0x16d5a2['body'][_0x803c('0xc6')];return db[_0x803c('0xc0')]['find']({'where':{'messageId':_0x16d5a2[_0x803c('0x5b')]['requestid']}});}break;case _0x803c('0xc7'):if(_0x16d5a2[_0x803c('0x5b')][_0x803c('0x88')]&&_0x16d5a2[_0x803c('0x5b')][_0x803c('0xc8')]){_0x28547f=_0x16d5a2['body'][_0x803c('0xc8')];return db[_0x803c('0xc0')]['find']({'where':{'messageId':_0x16d5a2[_0x803c('0x5b')][_0x803c('0x88')]}});}break;case _0x803c('0xc9'):var _0x384433=_0x16d5a2['body'][_0x803c('0x8b')][0x0];if(_0x384433[_0x803c('0x84')]&&_0x384433['status'][_0x803c('0xca')]==='DELIVERED'){_0x28547f=_0x384433[_0x803c('0x30')][_0x803c('0xca')];return db[_0x803c('0xc0')][_0x803c('0x5f')]({'where':{'messageId':_0x384433['messageId']}});}break;case _0x803c('0x8e'):if(_0x16d5a2[_0x803c('0x5b')]['messageId']&&_0x16d5a2[_0x803c('0x5b')][_0x803c('0x30')]){_0x28547f=_0x16d5a2[_0x803c('0x5b')][_0x803c('0x30')];return db[_0x803c('0xc0')][_0x803c('0x5f')]({'where':{'messageId':_0x16d5a2[_0x803c('0x5b')]['messageId']}});}break;case'bandwidth':if(_0x16d5a2[_0x803c('0x5b')][0x0][_0x803c('0x29')]['id']){_0x28547f=_0x16d5a2['body'][0x0][_0x803c('0x41')];return db['SmsMessage'][_0x803c('0x5f')]({'where':{'messageId':_0x16d5a2[_0x803c('0x5b')][0x0]['message']['id']}});}break;case _0x803c('0x91'):if(_0x16d5a2[_0x803c('0x5b')][_0x803c('0xcb')]&&_0x16d5a2[_0x803c('0x5b')][_0x803c('0x30')]){_0x28547f=_0x16d5a2[_0x803c('0x5b')][_0x803c('0x30')];return db[_0x803c('0xc0')][_0x803c('0x5f')]({'where':{'messageId':_0x16d5a2['body'][_0x803c('0xcb')]}});}break;}}})['then'](handleEntityNotFound(_0x20ae9a,null))[_0x803c('0x20')](function(_0x2b9392){if(_0x2b9392){_0x542220=_0x2b9392;switch(_0x23711c[_0x803c('0x41')]){case'skebby':if(_0x28547f===_0x803c('0xcc')){return _0x542220[_0x803c('0x35')]({'read':!![]});}else{logger[_0x803c('0x27')](_0x803c('0x25'),_0x803c('0x30'),_0x803c('0xc4'),util['inspect'](_0x16d5a2[_0x803c('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x803c('0x87'):if(_0x28547f==='1'){return _0x542220[_0x803c('0x35')]({'read':!![]});}else{logger[_0x803c('0x27')](_0x803c('0x25'),_0x803c('0x30'),_0x803c('0xc4'),util[_0x803c('0xc3')](_0x16d5a2['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x16d5a2['body'][_0x803c('0xcd')]&&_0x28547f>=0xc8&&_0x28547f<=0xce){return _0x542220[_0x803c('0x35')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x803c('0xc7'),util[_0x803c('0xc3')](_0x16d5a2[_0x803c('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x803c('0xc9'):var _0x4d1670=_0x16d5a2[_0x803c('0x5b')]['results'][0x0];if(_0x4d1670[_0x803c('0x30')][_0x803c('0xca')]===_0x803c('0xcc')){return _0x542220[_0x803c('0x35')]({'read':!![]});}else{logger['error'](_0x803c('0x25'),'status',_0x803c('0xc9'),util[_0x803c('0xc3')](_0x16d5a2[_0x803c('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x803c('0x8e'):if(_0x28547f==_0x803c('0xce')||_0x28547f==_0x803c('0xcf')){return _0x542220['update']({'read':!![]});}else{logger[_0x803c('0x27')](_0x803c('0x25'),_0x803c('0x30'),'clickatell',util[_0x803c('0xc3')](_0x16d5a2[_0x803c('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x803c('0x90'):if(_0x28547f==_0x803c('0xd0')){return _0x542220[_0x803c('0x35')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status','bandwidth',util['inspect'](_0x16d5a2[_0x803c('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x803c('0x91'):if(_0x28547f==='DELIVRD'||_0x28547f==='ACCEPTD'){return _0x542220[_0x803c('0x35')]({'read':!![]});}else{logger[_0x803c('0x27')](_0x803c('0x25'),_0x803c('0x30'),'intelepeer',util[_0x803c('0xc3')](_0x16d5a2[_0x803c('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x542220;}})[_0x803c('0x20')](respondWithResult(_0x20ae9a,null))['catch'](handleError(_0x20ae9a,null));};exports['statusGet']=function(_0x4b6264,_0x3a9c37,_0x4026aa){var _0x53b6dd,_0x85de4e,_0x59aa1d;return db['SmsAccount'][_0x803c('0x5f')]({'where':{'id':_0x4b6264[_0x803c('0x64')]['id']}})[_0x803c('0x20')](handleEntityNotFound(_0x3a9c37,null))[_0x803c('0x20')](function(_0x268abd){if(_0x268abd){_0x59aa1d=_0x268abd;logger[_0x803c('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x803c('0xd1'),_0x268abd[_0x803c('0x41')],util[_0x803c('0xc3')](_0x4b6264[_0x803c('0x44')],{'showHidden':![],'depth':null}));switch(_0x268abd[_0x803c('0x41')]){case'csc':if(_0x4b6264[_0x803c('0x44')][_0x803c('0xd2')]&&_0x4b6264[_0x803c('0x44')][_0x803c('0xd3')]){_0x85de4e=_0x4b6264[_0x803c('0x44')][_0x803c('0xd3')];return db[_0x803c('0xc0')][_0x803c('0x5f')]({'where':{'messageId':_0x4b6264['query'][_0x803c('0xd2')]}});}break;}}})[_0x803c('0x20')](handleEntityNotFound(_0x3a9c37,null))[_0x803c('0x20')](function(_0x143d38){if(_0x143d38){_0x53b6dd=_0x143d38;switch(_0x59aa1d['type']){case'csc':if(_0x85de4e==='2'||_0x85de4e==='6'){return _0x53b6dd['update']({'read':!![]});}else{logger[_0x803c('0x27')](_0x803c('0x25'),_0x803c('0x30'),_0x803c('0x8c'),util[_0x803c('0xc3')](_0x4b6264['query'],{'showHidden':![],'depth':null}));};break;}return _0x53b6dd;}})[_0x803c('0x20')](respondWithResult(_0x3a9c37,null))[_0x803c('0x62')](handleError(_0x3a9c37,null));};exports[_0x803c('0xd4')]=function(_0x20d0e1,_0x46ddbf,_0xa4e595){return db[_0x803c('0x54')][_0x803c('0x5f')]({'where':{'id':_0x20d0e1['params']['id']}})[_0x803c('0x20')](handleEntityNotFound(_0x46ddbf,null))[_0x803c('0x20')](function(_0x3d905d){if(_0x3d905d){return _0x3d905d['addAgents'](_0x20d0e1['body'][_0x803c('0x6b')],_[_0x803c('0x9b')](_0x20d0e1[_0x803c('0x5b')],[_0x803c('0x6b'),'id'])||{})[_0x803c('0x9d')](function(_0x43ece1){for(var _0x29cddc=0x0;_0x29cddc<_0x20d0e1[_0x803c('0x5b')][_0x803c('0x6b')][_0x803c('0x4a')];_0x29cddc+=0x1){socket[_0x803c('0xd5')](_0x803c('0xd6'),{'UserId':Number(_0x20d0e1[_0x803c('0x5b')][_0x803c('0x6b')][_0x29cddc]),'SmsAccountId':Number(_0x20d0e1['params']['id'])});}return _0x43ece1;});}})['then'](respondWithResult(_0x46ddbf,null))[_0x803c('0x62')](handleError(_0x46ddbf,null));};exports[_0x803c('0xd7')]=function(_0x2d4c62,_0x46b8cb,_0x4dc4b0){return db[_0x803c('0x54')]['find']({'where':{'id':_0x2d4c62[_0x803c('0x64')]['id']}})[_0x803c('0x20')](handleEntityNotFound(_0x46b8cb,null))[_0x803c('0x20')](function(_0x5b4121){if(_0x5b4121){return _0x5b4121[_0x803c('0xd7')](_0x2d4c62['query'][_0x803c('0x6b')])['then'](function(){if(_['isArray'](_0x2d4c62[_0x803c('0x44')][_0x803c('0x6b')])){for(var _0x2dae59=0x0;_0x2dae59<_0x2d4c62[_0x803c('0x44')]['ids'][_0x803c('0x4a')];_0x2dae59+=0x1){socket[_0x803c('0xd5')](_0x803c('0xd8'),{'UserId':Number(_0x2d4c62[_0x803c('0x44')][_0x803c('0x6b')][_0x2dae59]),'SmsAccountId':Number(_0x2d4c62['params']['id'])});}}else{socket[_0x803c('0xd5')]('userSmsAccount:remove',{'UserId':Number(_0x2d4c62[_0x803c('0x44')]['ids']),'SmsAccountId':Number(_0x2d4c62[_0x803c('0x64')]['id'])});}});}})[_0x803c('0x20')](respondWithStatusCode(_0x46b8cb,null))['catch'](handleError(_0x46b8cb,null));};exports[_0x803c('0xd9')]=function(_0xb1a199,_0x47b706,_0x23aa1b){var _0x3491d8={};var _0x3df97f={};var _0x166e12;var _0xaa3685;return db[_0x803c('0x54')][_0x803c('0x68')]({'where':{'id':_0xb1a199[_0x803c('0x64')]['id']}})[_0x803c('0x20')](handleEntityNotFound(_0x47b706,null))[_0x803c('0x20')](function(_0x54fc58){if(_0x54fc58){_0x166e12=_0x54fc58;_0x3df97f[_0x803c('0x43')]=_[_0x803c('0x45')](db[_0x803c('0xa4')][_0x803c('0x3f')]);_0x3df97f[_0x803c('0x44')]=_[_0x803c('0x45')](_0xb1a199[_0x803c('0x44')]);_0x3df97f[_0x803c('0x46')]=_[_0x803c('0x47')](_0x3df97f[_0x803c('0x43')],_0x3df97f['query']);_0x3491d8[_0x803c('0x48')]=_[_0x803c('0x47')](_0x3df97f[_0x803c('0x43')],qs[_0x803c('0x49')](_0xb1a199[_0x803c('0x44')][_0x803c('0x49')]));_0x3491d8['attributes']=_0x3491d8[_0x803c('0x48')][_0x803c('0x4a')]?_0x3491d8[_0x803c('0x48')]:_0x3df97f[_0x803c('0x43')];_0x3491d8[_0x803c('0x4d')]=qs[_0x803c('0x4e')](_0xb1a199['query']['sort']);_0x3491d8[_0x803c('0x4f')]=qs[_0x803c('0x46')](_[_0x803c('0x50')](_0xb1a199[_0x803c('0x44')],_0x3df97f[_0x803c('0x46')]));if(_0xb1a199[_0x803c('0x44')][_0x803c('0x51')]){_0x3491d8[_0x803c('0x4f')]=_['merge'](_0x3491d8[_0x803c('0x4f')],{'$or':_['map'](_0x3491d8[_0x803c('0x48')],function(_0x2ecc02){var _0x3bcb54={};_0x3bcb54[_0x2ecc02]={'$like':'%'+_0xb1a199[_0x803c('0x44')][_0x803c('0x51')]+'%'};return _0x3bcb54;})});}_0x3491d8=_[_0x803c('0x52')]({},_0x3491d8,_0xb1a199[_0x803c('0x6f')]);return _0x166e12['getAgents'](_0x3491d8);}})['then'](function(_0x4355f3){if(_0x4355f3){_0xaa3685=_0x4355f3['length'];if(!_0xb1a199['query']['hasOwnProperty'](_0x803c('0x4c'))){_0x3491d8[_0x803c('0x2f')]=qs['limit'](_0xb1a199[_0x803c('0x44')][_0x803c('0x2f')]);_0x3491d8['offset']=qs[_0x803c('0x2d')](_0xb1a199[_0x803c('0x44')][_0x803c('0x2d')]);}return _0x166e12[_0x803c('0xd9')](_0x3491d8);}})[_0x803c('0x20')](function(_0x449421){if(_0x449421){return _0x449421?{'count':_0xaa3685,'rows':_0x449421}:null;}})[_0x803c('0x20')](respondWithResult(_0x47b706,null))[_0x803c('0x62')](handleError(_0x47b706,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index c359250..f30052c 100644 --- a/server/api/smsAccount/smsAccount.events.js +++ b/server/api/smsAccount/smsAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x873f=['exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x480c5e,_0x5aa0c3){var _0x14aeb3=function(_0x2cf6cb){while(--_0x2cf6cb){_0x480c5e['push'](_0x480c5e['shift']());}};_0x14aeb3(++_0x5aa0c3);}(_0x873f,0x1ae));var _0xf873=function(_0x10bf01,_0xe342f){_0x10bf01=_0x10bf01-0x0;var _0x3016b7=_0x873f[_0x10bf01];return _0x3016b7;};'use strict';var EventEmitter=require(_0xf873('0x0'));var SmsAccount=require(_0xf873('0x1'))['db'][_0xf873('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xf873('0x3')](0x0);var events={'afterCreate':_0xf873('0x4'),'afterUpdate':_0xf873('0x5'),'afterDestroy':_0xf873('0x6')};function emitEvent(_0x1e124e){return function(_0xf8e4a2,_0x44bd8f,_0x3572ed){SmsAccountEvents[_0xf873('0x7')](_0x1e124e+':'+_0xf8e4a2['id'],_0xf8e4a2);SmsAccountEvents['emit'](_0x1e124e,_0xf8e4a2);_0x3572ed(null);};}for(var e in events){if(events[_0xf873('0x8')](e)){var event=events[e];SmsAccount[_0xf873('0x9')](e,emitEvent(event));}}module[_0xf873('0xa')]=SmsAccountEvents; \ No newline at end of file +var _0x3fb4=['hasOwnProperty','exports','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit'];(function(_0x1601ad,_0x4e4a92){var _0x3973aa=function(_0x39f34d){while(--_0x39f34d){_0x1601ad['push'](_0x1601ad['shift']());}};_0x3973aa(++_0x4e4a92);}(_0x3fb4,0x122));var _0x43fb=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x3fb4[_0x31ced5];return _0x10d9e5;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x43fb('0x0'))['db'][_0x43fb('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x43fb('0x2')](0x0);var events={'afterCreate':_0x43fb('0x3'),'afterUpdate':_0x43fb('0x4'),'afterDestroy':_0x43fb('0x5')};function emitEvent(_0x413aa4){return function(_0x543d8c,_0x2410bc,_0x56910b){SmsAccountEvents['emit'](_0x413aa4+':'+_0x543d8c['id'],_0x543d8c);SmsAccountEvents[_0x43fb('0x6')](_0x413aa4,_0x543d8c);_0x56910b(null);};}for(var e in events){if(events[_0x43fb('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x43fb('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 0237162..f79655b 100644 --- a/server/api/smsAccount/smsAccount.model.js +++ b/server/api/smsAccount/smsAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf36e=['define','sms_accounts','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./smsAccount.attributes'];(function(_0x523774,_0xb74fab){var _0x5eb5da=function(_0x2c14a7){while(--_0x2c14a7){_0x523774['push'](_0x523774['shift']());}};_0x5eb5da(++_0xb74fab);}(_0xf36e,0x1a6));var _0xef36=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf36e[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xef36('0x0'));var logger=require(_0xef36('0x1'))(_0xef36('0x2'));var moment=require(_0xef36('0x3'));var BPromise=require(_0xef36('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef36('0x5'));var rimraf=require('rimraf');var config=require(_0xef36('0x6'));var attributes=require(_0xef36('0x7'));module['exports']=function(_0xfc84ce,_0x353e39){return _0xfc84ce[_0xef36('0x8')]('SmsAccount',attributes,{'tableName':_0xef36('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef96=['../../config/environment','exports','define','sms_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x2064c8,_0x168039){var _0x23af73=function(_0x2a2d10){while(--_0x2a2d10){_0x2064c8['push'](_0x2064c8['shift']());}};_0x23af73(++_0x168039);}(_0xef96,0xac));var _0x6ef9=function(_0x3b4745,_0x2813ec){_0x3b4745=_0x3b4745-0x0;var _0x391fe1=_0xef96[_0x3b4745];return _0x391fe1;};'use strict';var _=require(_0x6ef9('0x0'));var util=require(_0x6ef9('0x1'));var logger=require(_0x6ef9('0x2'))(_0x6ef9('0x3'));var moment=require(_0x6ef9('0x4'));var BPromise=require('bluebird');var rp=require(_0x6ef9('0x5'));var fs=require('fs');var path=require(_0x6ef9('0x6'));var rimraf=require(_0x6ef9('0x7'));var config=require(_0x6ef9('0x8'));var attributes=require('./smsAccount.attributes');module[_0x6ef9('0x9')]=function(_0x2a2a3d,_0x506713){return _0x2a2a3d[_0x6ef9('0xa')]('SmsAccount',attributes,{'tableName':_0x6ef9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 18da606..8c8ce76 100644 --- a/server/api/smsAccount/smsAccount.rpc.js +++ b/server/api/smsAccount/smsAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3723=['raw','attributes','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./smsAccount.socket','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','SmsAccount,\x20%s,\x20%s','error','message','info','result','ShowSmsAccount','SmsAccount','find','options'];(function(_0x554ccd,_0x4b2662){var _0xa7aafb=function(_0x1fdf2a){while(--_0x1fdf2a){_0x554ccd['push'](_0x554ccd['shift']());}};_0xa7aafb(++_0x4b2662);}(_0x3723,0x72));var _0x3372=function(_0x11604b,_0x4a45e7){_0x11604b=_0x11604b-0x0;var _0x2845b1=_0x3723[_0x11604b];return _0x2845b1;};'use strict';var _=require(_0x3372('0x0'));var util=require(_0x3372('0x1'));var moment=require(_0x3372('0x2'));var BPromise=require(_0x3372('0x3'));var rs=require(_0x3372('0x4'));var fs=require('fs');var Redis=require(_0x3372('0x5'));var db=require(_0x3372('0x6'))['db'];var utils=require(_0x3372('0x7'));var logger=require('../../config/logger')(_0x3372('0x8'));var config=require(_0x3372('0x9'));var jayson=require(_0x3372('0xa'));var client=jayson[_0x3372('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x3372('0xc')],{'host':_0x3372('0xd'),'port':0x18eb});var socket=require(_0x3372('0xe'))(new Redis(config['redis']));require(_0x3372('0xf'))['register'](socket);function respondWithRpcPromise(_0x2935bc,_0x5dc372,_0x541b33){return new BPromise(function(_0x63bada,_0x4cdc5b){return client['request'](_0x2935bc,_0x541b33)['then'](function(_0xc7d712){logger['info']('SmsAccount,\x20%s,\x20%s',_0x5dc372,'request\x20sent');logger[_0x3372('0x10')](_0x3372('0x11'),_0x5dc372,_0x3372('0x12'),JSON[_0x3372('0x13')](_0xc7d712));if(_0xc7d712['error']){if(_0xc7d712['error'][_0x3372('0x14')]===0x1f4){logger['error'](_0x3372('0x15'),_0x5dc372,_0xc7d712[_0x3372('0x16')][_0x3372('0x17')]);return _0x4cdc5b(_0xc7d712[_0x3372('0x16')][_0x3372('0x17')]);}logger[_0x3372('0x16')]('SmsAccount,\x20%s,\x20%s',_0x5dc372,_0xc7d712[_0x3372('0x16')][_0x3372('0x17')]);return _0x63bada(_0xc7d712['error'][_0x3372('0x17')]);}else{logger[_0x3372('0x18')]('SmsAccount,\x20%s,\x20%s',_0x5dc372,_0x3372('0x12'));_0x63bada(_0xc7d712[_0x3372('0x19')][_0x3372('0x17')]);}})['catch'](function(_0x2b3e99){logger[_0x3372('0x16')]('SmsAccount,\x20%s,\x20%s',_0x5dc372,_0x2b3e99);_0x4cdc5b(_0x2b3e99);});});}exports[_0x3372('0x1a')]=function(_0x26143a){var _0x4ce1c0=this;return new Promise(function(_0x2da810,_0x194ab6){return db[_0x3372('0x1b')][_0x3372('0x1c')]({'raw':_0x26143a['options']?_0x26143a[_0x3372('0x1d')][_0x3372('0x1e')]===undefined?!![]:![]:!![],'where':_0x26143a['options']?_0x26143a['options']['where']||null:null,'attributes':_0x26143a[_0x3372('0x1d')]?_0x26143a[_0x3372('0x1d')][_0x3372('0x1f')]||null:null,'include':_0x26143a['options']?_0x26143a[_0x3372('0x1d')][_0x3372('0x20')]?_[_0x3372('0x21')](_0x26143a['options'][_0x3372('0x20')],function(_0x4fb5eb){return{'model':db[_0x4fb5eb['model']],'as':_0x4fb5eb['as'],'attributes':_0x4fb5eb[_0x3372('0x1f')],'include':_0x4fb5eb[_0x3372('0x20')]?_[_0x3372('0x21')](_0x4fb5eb[_0x3372('0x20')],function(_0x21b26b){return{'model':db[_0x21b26b[_0x3372('0x22')]],'as':_0x21b26b['as'],'attributes':_0x21b26b[_0x3372('0x1f')],'include':_0x21b26b[_0x3372('0x20')]?_[_0x3372('0x21')](_0x21b26b[_0x3372('0x20')],function(_0x324581){return{'model':db[_0x324581[_0x3372('0x22')]],'as':_0x324581['as'],'attributes':_0x324581['attributes']};}):[]};}):[]};}):[]:[]})[_0x3372('0x23')](function(_0x1f0a4c){logger['info']('ShowSmsAccount',_0x26143a);logger['debug'](_0x3372('0x1a'),_0x26143a,JSON[_0x3372('0x13')](_0x1f0a4c));_0x2da810(_0x1f0a4c);})['catch'](function(_0x34056c){logger[_0x3372('0x16')](_0x3372('0x1a'),_0x34056c[_0x3372('0x17')],_0x26143a);_0x194ab6(_0x4ce1c0[_0x3372('0x16')](0x1f4,_0x34056c[_0x3372('0x17')]));});});}; \ No newline at end of file +var _0x75d2=['SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','find','options','raw','include','map','attributes','model','then','ShowSmsAccount','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x75d2,0x11b));var _0x275d=function(_0x5b077b,_0x50b707){_0x5b077b=_0x5b077b-0x0;var _0x16faf7=_0x75d2[_0x5b077b];return _0x16faf7;};'use strict';var _=require('lodash');var util=require(_0x275d('0x0'));var moment=require(_0x275d('0x1'));var BPromise=require('bluebird');var rs=require(_0x275d('0x2'));var fs=require('fs');var Redis=require(_0x275d('0x3'));var db=require(_0x275d('0x4'))['db'];var utils=require(_0x275d('0x5'));var logger=require(_0x275d('0x6'))(_0x275d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x275d('0x8')][_0x275d('0x9')]({'port':0x232a});config[_0x275d('0xa')]=_['defaults'](config[_0x275d('0xa')],{'host':_0x275d('0xb'),'port':0x18eb});var socket=require(_0x275d('0xc'))(new Redis(config['redis']));require(_0x275d('0xd'))['register'](socket);function respondWithRpcPromise(_0x3c65ed,_0x19c779,_0x1f21a6){return new BPromise(function(_0x3b8501,_0x344654){return client['request'](_0x3c65ed,_0x1f21a6)['then'](function(_0x5b1d20){logger['info'](_0x275d('0xe'),_0x19c779,'request\x20sent');logger[_0x275d('0xf')](_0x275d('0x10'),_0x19c779,_0x275d('0x11'),JSON[_0x275d('0x12')](_0x5b1d20));if(_0x5b1d20[_0x275d('0x13')]){if(_0x5b1d20[_0x275d('0x13')][_0x275d('0x14')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x19c779,_0x5b1d20['error']['message']);return _0x344654(_0x5b1d20[_0x275d('0x13')][_0x275d('0x15')]);}logger[_0x275d('0x13')](_0x275d('0xe'),_0x19c779,_0x5b1d20[_0x275d('0x13')][_0x275d('0x15')]);return _0x3b8501(_0x5b1d20[_0x275d('0x13')][_0x275d('0x15')]);}else{logger[_0x275d('0x16')](_0x275d('0xe'),_0x19c779,_0x275d('0x11'));_0x3b8501(_0x5b1d20['result'][_0x275d('0x15')]);}})[_0x275d('0x17')](function(_0xe8495f){logger[_0x275d('0x13')](_0x275d('0xe'),_0x19c779,_0xe8495f);_0x344654(_0xe8495f);});});}exports['ShowSmsAccount']=function(_0x53ceb4){var _0x3c199b=this;return new Promise(function(_0x2f5881,_0x1b0e95){return db['SmsAccount'][_0x275d('0x18')]({'raw':_0x53ceb4[_0x275d('0x19')]?_0x53ceb4['options'][_0x275d('0x1a')]===undefined?!![]:![]:!![],'where':_0x53ceb4['options']?_0x53ceb4['options']['where']||null:null,'attributes':_0x53ceb4[_0x275d('0x19')]?_0x53ceb4[_0x275d('0x19')]['attributes']||null:null,'include':_0x53ceb4['options']?_0x53ceb4[_0x275d('0x19')][_0x275d('0x1b')]?_[_0x275d('0x1c')](_0x53ceb4[_0x275d('0x19')][_0x275d('0x1b')],function(_0x1fac64){return{'model':db[_0x1fac64['model']],'as':_0x1fac64['as'],'attributes':_0x1fac64[_0x275d('0x1d')],'include':_0x1fac64[_0x275d('0x1b')]?_[_0x275d('0x1c')](_0x1fac64[_0x275d('0x1b')],function(_0x3850d9){return{'model':db[_0x3850d9[_0x275d('0x1e')]],'as':_0x3850d9['as'],'attributes':_0x3850d9[_0x275d('0x1d')],'include':_0x3850d9[_0x275d('0x1b')]?_[_0x275d('0x1c')](_0x3850d9[_0x275d('0x1b')],function(_0x1c03a0){return{'model':db[_0x1c03a0[_0x275d('0x1e')]],'as':_0x1c03a0['as'],'attributes':_0x1c03a0[_0x275d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x275d('0x1f')](function(_0x33daac){logger['info'](_0x275d('0x20'),_0x53ceb4);logger[_0x275d('0xf')](_0x275d('0x20'),_0x53ceb4,JSON['stringify'](_0x33daac));_0x2f5881(_0x33daac);})[_0x275d('0x17')](function(_0x39595d){logger[_0x275d('0x13')](_0x275d('0x20'),_0x39595d[_0x275d('0x15')],_0x53ceb4);_0x1b0e95(_0x3c199b[_0x275d('0x13')](0x1f4,_0x39595d[_0x275d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index bcc3657..49430db 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 940c4a7..16f65c7 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x363063,_0x4397c3){var _0x43d394=function(_0x1ca0cd){while(--_0x1ca0cd){_0x363063['push'](_0x363063['shift']());}};_0x43d394(++_0x4397c3);}(_0x55ca,0x126));var _0xa55c=function(_0x1d8a5d,_0x59a110){_0x1d8a5d=_0x1d8a5d-0x0;var _0x54d59f=_0x55ca[_0x1d8a5d];return _0x54d59f;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file +var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x403220,_0x51111e){var _0x365652=function(_0x46f00f){while(--_0x46f00f){_0x403220['push'](_0x403220['shift']());}};_0x365652(++_0x51111e);}(_0xedd9,0xfc));var _0x9edd=function(_0x4e45da,_0x55441c){_0x4e45da=_0x4e45da-0x0;var _0x23be8e=_0xedd9[_0x4e45da];return _0x23be8e;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 1a684b9..2e778c1 100644 --- a/server/api/smsApplication/smsApplication.attributes.js +++ b/server/api/smsApplication/smsApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7923=['INTEGER','STRING','noop','TEXT','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7923,0x9a));var _0x3792=function(_0x1957ff,_0x4d79c2){_0x1957ff=_0x1957ff-0x0;var _0x380061=_0x7923[_0x1957ff];return _0x380061;};'use strict';var Sequelize=require('sequelize');module[_0x3792('0x0')]={'priority':{'type':Sequelize[_0x3792('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3792('0x2')],'allowNull':![],'defaultValue':_0x3792('0x3')},'appdata':{'type':Sequelize[_0x3792('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x92d8=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x50bb8d,_0x4745e5){var _0x1c619f=function(_0x1036bf){while(--_0x1036bf){_0x50bb8d['push'](_0x50bb8d['shift']());}};_0x1c619f(++_0x4745e5);}(_0x92d8,0x1df));var _0x892d=function(_0x29dd31,_0x22cdec){_0x29dd31=_0x29dd31-0x0;var _0x1898cd=_0x92d8[_0x29dd31];return _0x1898cd;};'use strict';var Sequelize=require('sequelize');module[_0x892d('0x0')]={'priority':{'type':Sequelize[_0x892d('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x892d('0x2')],'allowNull':![],'defaultValue':_0x892d('0x3')},'appdata':{'type':Sequelize[_0x892d('0x4')]()},'description':{'type':Sequelize[_0x892d('0x2')]},'interval':{'type':Sequelize[_0x892d('0x2')],'defaultValue':_0x892d('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 987c509..92359dd 100644 --- a/server/api/smsApplication/smsApplication.controller.js +++ b/server/api/smsApplication/smsApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf581=['where','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','create','body','update','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','SmsApplication','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge'];(function(_0x4f385f,_0x2c6e4a){var _0x243611=function(_0x38c24d){while(--_0x38c24d){_0x4f385f['push'](_0x4f385f['shift']());}};_0x243611(++_0x2c6e4a);}(_0xf581,0x152));var _0x1f58=function(_0x141f1b,_0x5a0aa6){_0x141f1b=_0x141f1b-0x0;var _0x2f771b=_0xf581[_0x141f1b];return _0x2f771b;};'use strict';var emlformat=require(_0x1f58('0x0'));var rimraf=require(_0x1f58('0x1'));var zipdir=require(_0x1f58('0x2'));var jsonpatch=require(_0x1f58('0x3'));var rp=require(_0x1f58('0x4'));var moment=require(_0x1f58('0x5'));var BPromise=require(_0x1f58('0x6'));var Mustache=require(_0x1f58('0x7'));var util=require('util');var path=require('path');var sox=require(_0x1f58('0x8'));var csv=require(_0x1f58('0x9'));var ejs=require(_0x1f58('0xa'));var fs=require('fs');var fs_extra=require(_0x1f58('0xb'));var _=require(_0x1f58('0xc'));var squel=require(_0x1f58('0xd'));var crypto=require(_0x1f58('0xe'));var jsforce=require(_0x1f58('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1f58('0x9'));var querystring=require(_0x1f58('0x10'));var Papa=require(_0x1f58('0x11'));var Redis=require('ioredis');var authService=require(_0x1f58('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1f58('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f58('0x14'))(_0x1f58('0x15'));var utils=require(_0x1f58('0x16'));var config=require(_0x1f58('0x17'));var licenseUtil=require(_0x1f58('0x18'));var db=require(_0x1f58('0x19'))['db'];function respondWithStatusCode(_0x45729f,_0x40289b){_0x40289b=_0x40289b||0xcc;return function(_0x5415e9){if(_0x5415e9){return _0x45729f[_0x1f58('0x1a')](_0x40289b);}return _0x45729f[_0x1f58('0x1b')](_0x40289b)[_0x1f58('0x1c')]();};}function respondWithResult(_0x3c017d,_0x58844a){_0x58844a=_0x58844a||0xc8;return function(_0xe2e496){if(_0xe2e496){return _0x3c017d[_0x1f58('0x1b')](_0x58844a)[_0x1f58('0x1d')](_0xe2e496);}};}function respondWithFilteredResult(_0x46b467,_0x155e71){return function(_0x4f9644){if(_0x4f9644){var _0x44ea16=typeof _0x155e71['offset']===_0x1f58('0x1e')&&typeof _0x155e71['limit']===_0x1f58('0x1e');var _0x33d26b=_0x4f9644[_0x1f58('0x1f')];var _0x4904d3=_0x44ea16?0x0:_0x155e71[_0x1f58('0x20')];var _0x9c69f5=_0x44ea16?_0x4f9644[_0x1f58('0x1f')]:_0x155e71[_0x1f58('0x20')]+_0x155e71['limit'];var _0x5606d0;if(_0x9c69f5>=_0x33d26b){_0x9c69f5=_0x33d26b;_0x5606d0=0xc8;}else{_0x5606d0=0xce;}_0x46b467[_0x1f58('0x1b')](_0x5606d0);return _0x46b467[_0x1f58('0x21')](_0x1f58('0x22'),_0x4904d3+'-'+_0x9c69f5+'/'+_0x33d26b)[_0x1f58('0x1d')](_0x4f9644);}return null;};}function patchUpdates(_0x5c5933){return function(_0x3497f2){try{jsonpatch[_0x1f58('0x23')](_0x3497f2,_0x5c5933,!![]);}catch(_0x12bc5d){return BPromise[_0x1f58('0x24')](_0x12bc5d);}return _0x3497f2[_0x1f58('0x25')]();};}function saveUpdates(_0x23068b,_0x48e923){return function(_0x51ebbb){if(_0x51ebbb){return _0x51ebbb['update'](_0x23068b)[_0x1f58('0x26')](function(_0x25e063){return _0x25e063;});}return null;};}function removeEntity(_0x232014,_0x3249ff){return function(_0x516833){if(_0x516833){return _0x516833[_0x1f58('0x27')]()['then'](function(){_0x232014[_0x1f58('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46a1db,_0xf4393f){return function(_0x2e742e){if(!_0x2e742e){_0x46a1db[_0x1f58('0x1a')](0x194);}return _0x2e742e;};}function handleError(_0x2a2772,_0x3986bb){_0x3986bb=_0x3986bb||0x1f4;return function(_0x25dce1){logger[_0x1f58('0x28')](_0x25dce1[_0x1f58('0x29')]);if(_0x25dce1[_0x1f58('0x2a')]){delete _0x25dce1[_0x1f58('0x2a')];}_0x2a2772['status'](_0x3986bb)[_0x1f58('0x2b')](_0x25dce1);};}exports[_0x1f58('0x2c')]=function(_0x38e0ed,_0x1d4769){var _0x4b51d8={},_0x29d3a9={},_0x16c86e={'count':0x0,'rows':[]};var _0x2a4ef4=_['map'](db[_0x1f58('0x2d')][_0x1f58('0x2e')],function(_0x14c5ce){return{'name':_0x14c5ce[_0x1f58('0x2f')],'type':_0x14c5ce[_0x1f58('0x30')][_0x1f58('0x31')]};});_0x29d3a9[_0x1f58('0x32')]=_[_0x1f58('0x33')](_0x2a4ef4,_0x1f58('0x2a'));_0x29d3a9[_0x1f58('0x34')]=_[_0x1f58('0x35')](_0x38e0ed[_0x1f58('0x34')]);_0x29d3a9[_0x1f58('0x36')]=_['intersection'](_0x29d3a9[_0x1f58('0x32')],_0x29d3a9['query']);_0x4b51d8[_0x1f58('0x37')]=_[_0x1f58('0x38')](_0x29d3a9[_0x1f58('0x32')],qs[_0x1f58('0x39')](_0x38e0ed['query'][_0x1f58('0x39')]));_0x4b51d8[_0x1f58('0x37')]=_0x4b51d8['attributes'][_0x1f58('0x3a')]?_0x4b51d8[_0x1f58('0x37')]:_0x29d3a9[_0x1f58('0x32')];if(!_0x38e0ed['query'][_0x1f58('0x3b')](_0x1f58('0x3c'))){_0x4b51d8[_0x1f58('0x3d')]=qs[_0x1f58('0x3d')](_0x38e0ed[_0x1f58('0x34')][_0x1f58('0x3d')]);_0x4b51d8[_0x1f58('0x20')]=qs[_0x1f58('0x20')](_0x38e0ed[_0x1f58('0x34')]['offset']);}_0x4b51d8[_0x1f58('0x3e')]=qs[_0x1f58('0x3f')](_0x38e0ed[_0x1f58('0x34')][_0x1f58('0x3f')]);_0x4b51d8['where']=qs[_0x1f58('0x36')](_[_0x1f58('0x40')](_0x38e0ed[_0x1f58('0x34')],_0x29d3a9[_0x1f58('0x36')]),_0x2a4ef4);if(_0x38e0ed[_0x1f58('0x34')][_0x1f58('0x41')]){_0x4b51d8['where']=_[_0x1f58('0x42')](_0x4b51d8[_0x1f58('0x43')],{'$or':_[_0x1f58('0x33')](_0x2a4ef4,function(_0xe34361){if(_0xe34361['type']!==_0x1f58('0x44')){var _0x1ffcfd={};_0x1ffcfd[_0xe34361[_0x1f58('0x2a')]]={'$like':'%'+_0x38e0ed['query']['filter']+'%'};return _0x1ffcfd;}})});}_0x4b51d8=_[_0x1f58('0x42')]({},_0x4b51d8,_0x38e0ed[_0x1f58('0x45')]);var _0x308284={'where':_0x4b51d8['where']};return db[_0x1f58('0x2d')][_0x1f58('0x1f')](_0x308284)[_0x1f58('0x26')](function(_0x2d2914){_0x16c86e[_0x1f58('0x1f')]=_0x2d2914;if(_0x38e0ed[_0x1f58('0x34')]['includeAll']){_0x4b51d8[_0x1f58('0x46')]=[{'all':!![]}];}return db[_0x1f58('0x2d')][_0x1f58('0x47')](_0x4b51d8);})['then'](function(_0x4d5577){_0x16c86e[_0x1f58('0x48')]=_0x4d5577;return _0x16c86e;})[_0x1f58('0x26')](respondWithFilteredResult(_0x1d4769,_0x4b51d8))[_0x1f58('0x49')](handleError(_0x1d4769,null));};exports[_0x1f58('0x4a')]=function(_0x477cd8,_0x388dfe){var _0x4e1e7d={'raw':!![],'where':{'id':_0x477cd8['params']['id']}},_0xbcb83b={};_0xbcb83b[_0x1f58('0x32')]=_[_0x1f58('0x35')](db[_0x1f58('0x2d')][_0x1f58('0x2e')]);_0xbcb83b[_0x1f58('0x34')]=_['keys'](_0x477cd8['query']);_0xbcb83b['filters']=_[_0x1f58('0x38')](_0xbcb83b[_0x1f58('0x32')],_0xbcb83b[_0x1f58('0x34')]);_0x4e1e7d[_0x1f58('0x37')]=_[_0x1f58('0x38')](_0xbcb83b[_0x1f58('0x32')],qs[_0x1f58('0x39')](_0x477cd8[_0x1f58('0x34')]['fields']));_0x4e1e7d['attributes']=_0x4e1e7d[_0x1f58('0x37')][_0x1f58('0x3a')]?_0x4e1e7d[_0x1f58('0x37')]:_0xbcb83b[_0x1f58('0x32')];if(_0x477cd8[_0x1f58('0x34')][_0x1f58('0x4b')]){_0x4e1e7d['include']=[{'all':!![]}];}_0x4e1e7d=_[_0x1f58('0x42')]({},_0x4e1e7d,_0x477cd8['options']);return db[_0x1f58('0x2d')]['find'](_0x4e1e7d)[_0x1f58('0x26')](handleEntityNotFound(_0x388dfe,null))[_0x1f58('0x26')](respondWithResult(_0x388dfe,null))[_0x1f58('0x49')](handleError(_0x388dfe,null));};exports[_0x1f58('0x4c')]=function(_0x3db527,_0x74df93){return db[_0x1f58('0x2d')][_0x1f58('0x4c')](_0x3db527[_0x1f58('0x4d')],{})[_0x1f58('0x26')](respondWithResult(_0x74df93,0xc9))[_0x1f58('0x49')](handleError(_0x74df93,null));};exports[_0x1f58('0x4e')]=function(_0x2dba4a,_0x2edf11){if(_0x2dba4a[_0x1f58('0x4d')]['id']){delete _0x2dba4a[_0x1f58('0x4d')]['id'];}return db[_0x1f58('0x2d')][_0x1f58('0x4f')]({'where':{'id':_0x2dba4a[_0x1f58('0x50')]['id']}})[_0x1f58('0x26')](handleEntityNotFound(_0x2edf11,null))['then'](saveUpdates(_0x2dba4a[_0x1f58('0x4d')],null))[_0x1f58('0x26')](respondWithResult(_0x2edf11,null))[_0x1f58('0x49')](handleError(_0x2edf11,null));};exports[_0x1f58('0x27')]=function(_0x5558e1,_0x53c46b){return db[_0x1f58('0x2d')][_0x1f58('0x4f')]({'where':{'id':_0x5558e1[_0x1f58('0x50')]['id']}})[_0x1f58('0x26')](handleEntityNotFound(_0x53c46b,null))[_0x1f58('0x26')](removeEntity(_0x53c46b,null))['catch'](handleError(_0x53c46b,null));}; \ No newline at end of file +var _0xf7cc=['limit','count','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x3d8251,_0x435dbf){var _0x2ed649=function(_0x229898){while(--_0x229898){_0x3d8251['push'](_0x3d8251['shift']());}};_0x2ed649(++_0x435dbf);}(_0xf7cc,0x167));var _0xcf7c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xf7cc[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcf7c('0x0'));var zipdir=require(_0xcf7c('0x1'));var jsonpatch=require(_0xcf7c('0x2'));var rp=require(_0xcf7c('0x3'));var moment=require(_0xcf7c('0x4'));var BPromise=require(_0xcf7c('0x5'));var Mustache=require('mustache');var util=require(_0xcf7c('0x6'));var path=require(_0xcf7c('0x7'));var sox=require('sox');var csv=require(_0xcf7c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf7c('0x9'));var _=require('lodash');var squel=require(_0xcf7c('0xa'));var crypto=require(_0xcf7c('0xb'));var jsforce=require(_0xcf7c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcf7c('0x8'));var querystring=require(_0xcf7c('0xd'));var Papa=require(_0xcf7c('0xe'));var Redis=require(_0xcf7c('0xf'));var authService=require(_0xcf7c('0x10'));var qs=require(_0xcf7c('0x11'));var as=require(_0xcf7c('0x12'));var hardwareService=require(_0xcf7c('0x13'));var logger=require(_0xcf7c('0x14'))(_0xcf7c('0x15'));var utils=require(_0xcf7c('0x16'));var config=require(_0xcf7c('0x17'));var licenseUtil=require(_0xcf7c('0x18'));var db=require(_0xcf7c('0x19'))['db'];function respondWithStatusCode(_0x3a09a1,_0x47cbf3){_0x47cbf3=_0x47cbf3||0xcc;return function(_0x5b3248){if(_0x5b3248){return _0x3a09a1[_0xcf7c('0x1a')](_0x47cbf3);}return _0x3a09a1[_0xcf7c('0x1b')](_0x47cbf3)['end']();};}function respondWithResult(_0x2fe120,_0x1badfe){_0x1badfe=_0x1badfe||0xc8;return function(_0x2d852a){if(_0x2d852a){return _0x2fe120[_0xcf7c('0x1b')](_0x1badfe)[_0xcf7c('0x1c')](_0x2d852a);}};}function respondWithFilteredResult(_0xc8c43e,_0x513f20){return function(_0x2d422e){if(_0x2d422e){var _0x52af23=typeof _0x513f20[_0xcf7c('0x1d')]===_0xcf7c('0x1e')&&typeof _0x513f20[_0xcf7c('0x1f')]==='undefined';var _0x1c525d=_0x2d422e[_0xcf7c('0x20')];var _0x593307=_0x52af23?0x0:_0x513f20[_0xcf7c('0x1d')];var _0x4202f4=_0x52af23?_0x2d422e['count']:_0x513f20[_0xcf7c('0x1d')]+_0x513f20[_0xcf7c('0x1f')];var _0x5d400e;if(_0x4202f4>=_0x1c525d){_0x4202f4=_0x1c525d;_0x5d400e=0xc8;}else{_0x5d400e=0xce;}_0xc8c43e[_0xcf7c('0x1b')](_0x5d400e);return _0xc8c43e[_0xcf7c('0x21')](_0xcf7c('0x22'),_0x593307+'-'+_0x4202f4+'/'+_0x1c525d)['json'](_0x2d422e);}return null;};}function patchUpdates(_0x21fb2c){return function(_0x541412){try{jsonpatch[_0xcf7c('0x23')](_0x541412,_0x21fb2c,!![]);}catch(_0x47e7b2){return BPromise[_0xcf7c('0x24')](_0x47e7b2);}return _0x541412['save']();};}function saveUpdates(_0x35b3fb,_0x28b517){return function(_0x4cab9c){if(_0x4cab9c){return _0x4cab9c[_0xcf7c('0x25')](_0x35b3fb)['then'](function(_0x59b0c1){return _0x59b0c1;});}return null;};}function removeEntity(_0x3e300b,_0x1f7fef){return function(_0x30f94a){if(_0x30f94a){return _0x30f94a[_0xcf7c('0x26')]()[_0xcf7c('0x27')](function(){_0x3e300b['status'](0xcc)[_0xcf7c('0x28')]();});}};}function handleEntityNotFound(_0x1de6b2,_0x34c4a1){return function(_0x23a25f){if(!_0x23a25f){_0x1de6b2['sendStatus'](0x194);}return _0x23a25f;};}function handleError(_0x37e033,_0x5e3cbe){_0x5e3cbe=_0x5e3cbe||0x1f4;return function(_0x54b692){logger[_0xcf7c('0x29')](_0x54b692[_0xcf7c('0x2a')]);if(_0x54b692[_0xcf7c('0x2b')]){delete _0x54b692[_0xcf7c('0x2b')];}_0x37e033[_0xcf7c('0x1b')](_0x5e3cbe)[_0xcf7c('0x2c')](_0x54b692);};}exports[_0xcf7c('0x2d')]=function(_0x26af32,_0x505e99){var _0x9e44ba={},_0xe296b8={},_0x348d0d={'count':0x0,'rows':[]};var _0x186ff2=_[_0xcf7c('0x2e')](db[_0xcf7c('0x2f')][_0xcf7c('0x30')],function(_0x44b122){return{'name':_0x44b122[_0xcf7c('0x31')],'type':_0x44b122[_0xcf7c('0x32')][_0xcf7c('0x33')]};});_0xe296b8[_0xcf7c('0x34')]=_['map'](_0x186ff2,'name');_0xe296b8[_0xcf7c('0x35')]=_[_0xcf7c('0x36')](_0x26af32[_0xcf7c('0x35')]);_0xe296b8[_0xcf7c('0x37')]=_[_0xcf7c('0x38')](_0xe296b8[_0xcf7c('0x34')],_0xe296b8[_0xcf7c('0x35')]);_0x9e44ba[_0xcf7c('0x39')]=_[_0xcf7c('0x38')](_0xe296b8[_0xcf7c('0x34')],qs['fields'](_0x26af32[_0xcf7c('0x35')][_0xcf7c('0x3a')]));_0x9e44ba['attributes']=_0x9e44ba[_0xcf7c('0x39')][_0xcf7c('0x3b')]?_0x9e44ba['attributes']:_0xe296b8[_0xcf7c('0x34')];if(!_0x26af32[_0xcf7c('0x35')][_0xcf7c('0x3c')](_0xcf7c('0x3d'))){_0x9e44ba[_0xcf7c('0x1f')]=qs[_0xcf7c('0x1f')](_0x26af32['query'][_0xcf7c('0x1f')]);_0x9e44ba['offset']=qs[_0xcf7c('0x1d')](_0x26af32['query']['offset']);}_0x9e44ba[_0xcf7c('0x3e')]=qs[_0xcf7c('0x3f')](_0x26af32[_0xcf7c('0x35')][_0xcf7c('0x3f')]);_0x9e44ba['where']=qs['filters'](_[_0xcf7c('0x40')](_0x26af32[_0xcf7c('0x35')],_0xe296b8[_0xcf7c('0x37')]),_0x186ff2);if(_0x26af32[_0xcf7c('0x35')][_0xcf7c('0x41')]){_0x9e44ba['where']=_[_0xcf7c('0x42')](_0x9e44ba['where'],{'$or':_[_0xcf7c('0x2e')](_0x186ff2,function(_0x2e407a){if(_0x2e407a[_0xcf7c('0x32')]!==_0xcf7c('0x43')){var _0x42725d={};_0x42725d[_0x2e407a[_0xcf7c('0x2b')]]={'$like':'%'+_0x26af32['query'][_0xcf7c('0x41')]+'%'};return _0x42725d;}})});}_0x9e44ba=_['merge']({},_0x9e44ba,_0x26af32[_0xcf7c('0x44')]);var _0x120159={'where':_0x9e44ba['where']};return db[_0xcf7c('0x2f')][_0xcf7c('0x20')](_0x120159)[_0xcf7c('0x27')](function(_0x3154ef){_0x348d0d[_0xcf7c('0x20')]=_0x3154ef;if(_0x26af32[_0xcf7c('0x35')]['includeAll']){_0x9e44ba[_0xcf7c('0x45')]=[{'all':!![]}];}return db[_0xcf7c('0x2f')][_0xcf7c('0x46')](_0x9e44ba);})[_0xcf7c('0x27')](function(_0x3aef57){_0x348d0d['rows']=_0x3aef57;return _0x348d0d;})['then'](respondWithFilteredResult(_0x505e99,_0x9e44ba))[_0xcf7c('0x47')](handleError(_0x505e99,null));};exports[_0xcf7c('0x48')]=function(_0x316822,_0x3a73d5){var _0x5df8c3={'raw':!![],'where':{'id':_0x316822[_0xcf7c('0x49')]['id']}},_0x313bf5={};_0x313bf5['model']=_['keys'](db['SmsApplication'][_0xcf7c('0x30')]);_0x313bf5[_0xcf7c('0x35')]=_[_0xcf7c('0x36')](_0x316822['query']);_0x313bf5[_0xcf7c('0x37')]=_[_0xcf7c('0x38')](_0x313bf5[_0xcf7c('0x34')],_0x313bf5[_0xcf7c('0x35')]);_0x5df8c3['attributes']=_[_0xcf7c('0x38')](_0x313bf5[_0xcf7c('0x34')],qs[_0xcf7c('0x3a')](_0x316822['query']['fields']));_0x5df8c3[_0xcf7c('0x39')]=_0x5df8c3[_0xcf7c('0x39')][_0xcf7c('0x3b')]?_0x5df8c3[_0xcf7c('0x39')]:_0x313bf5[_0xcf7c('0x34')];if(_0x316822[_0xcf7c('0x35')][_0xcf7c('0x4a')]){_0x5df8c3['include']=[{'all':!![]}];}_0x5df8c3=_['merge']({},_0x5df8c3,_0x316822[_0xcf7c('0x44')]);return db['SmsApplication']['find'](_0x5df8c3)[_0xcf7c('0x27')](handleEntityNotFound(_0x3a73d5,null))[_0xcf7c('0x27')](respondWithResult(_0x3a73d5,null))[_0xcf7c('0x47')](handleError(_0x3a73d5,null));};exports[_0xcf7c('0x4b')]=function(_0x136c76,_0x695b80){return db[_0xcf7c('0x2f')][_0xcf7c('0x4b')](_0x136c76['body'],{})[_0xcf7c('0x27')](respondWithResult(_0x695b80,0xc9))[_0xcf7c('0x47')](handleError(_0x695b80,null));};exports[_0xcf7c('0x25')]=function(_0x317b07,_0x2c1013){if(_0x317b07[_0xcf7c('0x4c')]['id']){delete _0x317b07['body']['id'];}return db[_0xcf7c('0x2f')]['find']({'where':{'id':_0x317b07[_0xcf7c('0x49')]['id']}})['then'](handleEntityNotFound(_0x2c1013,null))[_0xcf7c('0x27')](saveUpdates(_0x317b07['body'],null))[_0xcf7c('0x27')](respondWithResult(_0x2c1013,null))['catch'](handleError(_0x2c1013,null));};exports['destroy']=function(_0x2a265c,_0x557db0){return db[_0xcf7c('0x2f')][_0xcf7c('0x4d')]({'where':{'id':_0x2a265c[_0xcf7c('0x49')]['id']}})[_0xcf7c('0x27')](handleEntityNotFound(_0x557db0,null))[_0xcf7c('0x27')](removeEntity(_0x557db0,null))[_0xcf7c('0x47')](handleError(_0x557db0,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index fc03661..7613406 100644 --- a/server/api/smsApplication/smsApplication.model.js +++ b/server/api/smsApplication/smsApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46cc=['utf8mb4','util','../../config/logger','moment','bluebird','request-promise','path','./smsApplication.attributes','exports','define','SmsApplication','sms_applications'];(function(_0x532acd,_0x14e2ce){var _0x9e2ebf=function(_0x37268f){while(--_0x37268f){_0x532acd['push'](_0x532acd['shift']());}};_0x9e2ebf(++_0x14e2ce);}(_0x46cc,0xc1));var _0xc46c=function(_0x6620b8,_0x8b3d5e){_0x6620b8=_0x6620b8-0x0;var _0x33de50=_0x46cc[_0x6620b8];return _0x33de50;};'use strict';var _=require('lodash');var util=require(_0xc46c('0x0'));var logger=require(_0xc46c('0x1'))('api');var moment=require(_0xc46c('0x2'));var BPromise=require(_0xc46c('0x3'));var rp=require(_0xc46c('0x4'));var fs=require('fs');var path=require(_0xc46c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc46c('0x6'));module[_0xc46c('0x7')]=function(_0x127348,_0x43cb95){return _0x127348[_0xc46c('0x8')](_0xc46c('0x9'),attributes,{'tableName':_0xc46c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc46c('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x14f5=['./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','util','api','moment','bluebird','path','rimraf'];(function(_0x4ff0db,_0x19bfeb){var _0x379db2=function(_0x31af20){while(--_0x31af20){_0x4ff0db['push'](_0x4ff0db['shift']());}};_0x379db2(++_0x19bfeb);}(_0x14f5,0xae));var _0x514f=function(_0x6aaa69,_0x4457b5){_0x6aaa69=_0x6aaa69-0x0;var _0x25359f=_0x14f5[_0x6aaa69];return _0x25359f;};'use strict';var _=require('lodash');var util=require(_0x514f('0x0'));var logger=require('../../config/logger')(_0x514f('0x1'));var moment=require(_0x514f('0x2'));var BPromise=require(_0x514f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x514f('0x4'));var rimraf=require(_0x514f('0x5'));var config=require('../../config/environment');var attributes=require(_0x514f('0x6'));module[_0x514f('0x7')]=function(_0xc2ca56,_0x434452){return _0xc2ca56[_0x514f('0x8')](_0x514f('0x9'),attributes,{'tableName':_0x514f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x514f('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 522f90b..530833b 100644 --- a/server/api/smsApplication/smsApplication.rpc.js +++ b/server/api/smsApplication/smsApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e94=['rpc','jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x517e42,_0x53cf21){var _0x429dbd=function(_0x1e9be2){while(--_0x1e9be2){_0x517e42['push'](_0x517e42['shift']());}};_0x429dbd(++_0x53cf21);}(_0x3e94,0x67));var _0x43e9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3e94[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x43e9('0x0'));var util=require(_0x43e9('0x1'));var moment=require('moment');var BPromise=require(_0x43e9('0x2'));var rs=require(_0x43e9('0x3'));var fs=require('fs');var Redis=require(_0x43e9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x43e9('0x5'));var logger=require(_0x43e9('0x6'))(_0x43e9('0x7'));var config=require('../../config/environment');var jayson=require(_0x43e9('0x8'));var client=jayson['client'][_0x43e9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b35f1,_0x1183a0,_0x2989fe){return new BPromise(function(_0x287aaf,_0x510ee7){return client[_0x43e9('0xa')](_0x4b35f1,_0x2989fe)[_0x43e9('0xb')](function(_0x43d6e8){logger[_0x43e9('0xc')](_0x43e9('0xd'),_0x1183a0,_0x43e9('0xe'));logger[_0x43e9('0xf')](_0x43e9('0x10'),_0x1183a0,_0x43e9('0xe'),JSON['stringify'](_0x43d6e8));if(_0x43d6e8[_0x43e9('0x11')]){if(_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x12')]===0x1f4){logger['error'](_0x43e9('0xd'),_0x1183a0,_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x13')]);return _0x510ee7(_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x13')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x1183a0,_0x43d6e8[_0x43e9('0x11')]['message']);return _0x287aaf(_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x13')]);}else{logger[_0x43e9('0xc')](_0x43e9('0xd'),_0x1183a0,_0x43e9('0xe'));_0x287aaf(_0x43d6e8[_0x43e9('0x14')][_0x43e9('0x13')]);}})[_0x43e9('0x15')](function(_0x3f7164){logger[_0x43e9('0x11')](_0x43e9('0xd'),_0x1183a0,_0x3f7164);_0x510ee7(_0x3f7164);});});} \ No newline at end of file +var _0xcac2=['SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','info','debug'];(function(_0x20dee6,_0x2d3179){var _0x592fd1=function(_0x52eb7c){while(--_0x52eb7c){_0x20dee6['push'](_0x20dee6['shift']());}};_0x592fd1(++_0x2d3179);}(_0xcac2,0x1e8));var _0x2cac=function(_0x3f7c66,_0x1e6bb4){_0x3f7c66=_0x3f7c66-0x0;var _0x6e91e4=_0xcac2[_0x3f7c66];return _0x6e91e4;};'use strict';var _=require(_0x2cac('0x0'));var util=require(_0x2cac('0x1'));var moment=require(_0x2cac('0x2'));var BPromise=require('bluebird');var rs=require(_0x2cac('0x3'));var fs=require('fs');var Redis=require(_0x2cac('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2cac('0x5'));var jayson=require(_0x2cac('0x6'));var client=jayson[_0x2cac('0x7')][_0x2cac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f996c,_0x703f11,_0x1920cf){return new BPromise(function(_0x56b4f9,_0x5df249){return client[_0x2cac('0x9')](_0x2f996c,_0x1920cf)['then'](function(_0x361260){logger[_0x2cac('0xa')]('SmsApplication,\x20%s,\x20%s',_0x703f11,'request\x20sent');logger[_0x2cac('0xb')](_0x2cac('0xc'),_0x703f11,'request\x20sent',JSON[_0x2cac('0xd')](_0x361260));if(_0x361260['error']){if(_0x361260[_0x2cac('0xe')][_0x2cac('0xf')]===0x1f4){logger[_0x2cac('0xe')](_0x2cac('0x10'),_0x703f11,_0x361260[_0x2cac('0xe')]['message']);return _0x5df249(_0x361260[_0x2cac('0xe')][_0x2cac('0x11')]);}logger['error'](_0x2cac('0x10'),_0x703f11,_0x361260[_0x2cac('0xe')][_0x2cac('0x11')]);return _0x56b4f9(_0x361260['error'][_0x2cac('0x11')]);}else{logger[_0x2cac('0xa')](_0x2cac('0x10'),_0x703f11,'request\x20sent');_0x56b4f9(_0x361260[_0x2cac('0x12')][_0x2cac('0x11')]);}})[_0x2cac('0x13')](function(_0x4d4646){logger['error'](_0x2cac('0x10'),_0x703f11,_0x4d4646);_0x5df249(_0x4d4646);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index fd1f7d9..c894e2f 100644 --- a/server/api/smsInteraction/index.js +++ b/server/api/smsInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3423=['/:id','/:id/messages','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','put','delete','smsinteraction:destroy','destroy','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x576d8a,_0x2d7bde){var _0x3dc3ef=function(_0xc76758){while(--_0xc76758){_0x576d8a['push'](_0x576d8a['shift']());}};_0x3dc3ef(++_0x2d7bde);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3342('0x0'));var timeout=require(_0x3342('0x1'));var express=require(_0x3342('0x2'));var router=express[_0x3342('0x3')]();var fs_extra=require(_0x3342('0x4'));var auth=require(_0x3342('0x5'));var interaction=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var controller=require(_0x3342('0x8'));router[_0x3342('0x9')]('/',auth[_0x3342('0xa')](),controller[_0x3342('0xb')]);router[_0x3342('0x9')](_0x3342('0xc'),auth[_0x3342('0xa')](),controller[_0x3342('0xd')]);router[_0x3342('0x9')](_0x3342('0xe'),auth[_0x3342('0xa')](),controller['show']);router['get'](_0x3342('0xf'),auth['isAuthenticated'](),controller['getMessages']);router['get']('/:id/download',auth[_0x3342('0xa')](),controller[_0x3342('0x10')]);router['post']('/',auth[_0x3342('0xa')](),controller['create']);router[_0x3342('0x11')](_0x3342('0xf'),auth['isAuthenticated'](),controller[_0x3342('0x12')]);router[_0x3342('0x11')](_0x3342('0x13'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x16')),controller['addTags']);router[_0x3342('0x17')](_0x3342('0xe'),auth['isAuthenticated'](),interaction[_0x3342('0x14')](_0x3342('0x15'),'smsinteraction:update'),controller['update']);router[_0x3342('0x18')](_0x3342('0xe'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x19')),controller[_0x3342('0x1a')]);router[_0x3342('0x18')](_0x3342('0x13'),auth['isAuthenticated'](),controller[_0x3342('0x1b')]);module[_0x3342('0x1c')]=router; \ No newline at end of file +var _0xd4a2=['isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','create','post','addMessage','/:id/tags','sms','addTags','put','update','tracked','removeTags','exports','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsInteraction.controller','get'];(function(_0x5aeda7,_0x74556a){var _0x122f8a=function(_0x38d083){while(--_0x38d083){_0x5aeda7['push'](_0x5aeda7['shift']());}};_0x122f8a(++_0x74556a);}(_0xd4a2,0x173));var _0x2d4a=function(_0x37c4b4,_0x2d86ab){_0x37c4b4=_0x37c4b4-0x0;var _0x7a3912=_0xd4a2[_0x37c4b4];return _0x7a3912;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0x6')](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0x6')](_0x2d4a('0xd'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x2d4a('0xf')]);router['post']('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x10')]);router[_0x2d4a('0x11')](_0x2d4a('0xd'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x12')]);router[_0x2d4a('0x11')](_0x2d4a('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0x2d4a('0x14'),'smsinteraction:addtags'),controller[_0x2d4a('0x15')]);router[_0x2d4a('0x16')](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),interaction['tracked'](_0x2d4a('0x14'),'smsinteraction:update'),controller[_0x2d4a('0x17')]);router['delete'](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),interaction[_0x2d4a('0x18')](_0x2d4a('0x14'),'smsinteraction:destroy'),controller['destroy']);router['delete'](_0x2d4a('0x13'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x19')]);module[_0x2d4a('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 0be0c27..e192a68 100644 --- a/server/api/smsInteraction/smsInteraction.attributes.js +++ b/server/api/smsInteraction/smsInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa4d=['sequelize','moment','BOOLEAN','STRING','DATE','ENUM','out','INTEGER'];(function(_0x153779,_0x265041){var _0x2feda9=function(_0x47557a){while(--_0x47557a){_0x153779['push'](_0x153779['shift']());}};_0x2feda9(++_0x265041);}(_0xfa4d,0x90));var _0xdfa4=function(_0x36e3a4,_0xf39410){_0x36e3a4=_0x36e3a4-0x0;var _0x32f43e=_0xfa4d[_0x36e3a4];return _0x32f43e;};'use strict';var Sequelize=require(_0xdfa4('0x0'));var moment=require(_0xdfa4('0x1'));module['exports']={'closed':{'type':Sequelize[_0xdfa4('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xdfa4('0x3')]},'note':{'type':Sequelize[_0xdfa4('0x3')]},'phone':{'type':Sequelize[_0xdfa4('0x3')]},'read1stAt':{'type':Sequelize[_0xdfa4('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xdfa4('0x5')]('in',_0xdfa4('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdfa4('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xdfa4('0x5')]('in',_0xdfa4('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xdfa4('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xdfa4('0x7')]}}; \ No newline at end of file +var _0x6dc0=['BOOLEAN','INTEGER','sequelize','moment','exports','DATE','STRING','out','ENUM'];(function(_0x661397,_0xd43638){var _0x17b371=function(_0x279c3d){while(--_0x279c3d){_0x661397['push'](_0x661397['shift']());}};_0x17b371(++_0xd43638);}(_0x6dc0,0xb6));var _0x06dc=function(_0x43e26f,_0x158102){_0x43e26f=_0x43e26f-0x0;var _0x15cba6=_0x6dc0[_0x43e26f];return _0x15cba6;};'use strict';var Sequelize=require(_0x06dc('0x0'));var moment=require(_0x06dc('0x1'));module[_0x06dc('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x06dc('0x3')]},'disposition':{'type':Sequelize[_0x06dc('0x4')]},'secondDisposition':{'type':Sequelize[_0x06dc('0x4')]},'thirdDisposition':{'type':Sequelize[_0x06dc('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x06dc('0x4')]},'read1stAt':{'type':Sequelize[_0x06dc('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x06dc('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x06dc('0x6')]('in',_0x06dc('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x06dc('0x7')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x06dc('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index e9967b4..905872c 100644 --- a/server/api/smsInteraction/smsInteraction.controller.js +++ b/server/api/smsInteraction/smsInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaae2=['rawAttributes','fieldName','type','key','findAll','sms','query','user','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','catch','create','body','find','destroy','addMessage','ids','getMessages','findOne','SmsMessage','hasOwnProperty','nolimit','order','sort','where','pick','SmsInteractionId','map','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','merge','count','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','tmp','transcript-%d-%s.zip','User','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','push','SmsAccount','Account','fullname','mkdirSync','Sms','Owner','N.A.','toString','closed','closedAt','disposition','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','path','ejs','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','./smsInteraction.socket','register','status','end','json','undefined','limit','offset','set','Content-Range','update','then','sendStatus','error','stack','name','index','SmsInteraction'];(function(_0x45521d,_0x169dfe){var _0x24f9ed=function(_0x54a0e4){while(--_0x54a0e4){_0x45521d['push'](_0x45521d['shift']());}};_0x24f9ed(++_0x169dfe);}(_0xaae2,0xcc));var _0x2aae=function(_0x9b959e,_0x3da2f1){_0x9b959e=_0x9b959e-0x0;var _0x8bc212=_0xaae2[_0x9b959e];return _0x8bc212;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0x2aae('0x0'));var ejs=require(_0x2aae('0x1'));var fs=require('fs');var _=require(_0x2aae('0x2'));var Redis=require(_0x2aae('0x3'));var interaction=require('../../components/interaction/service');var qs=require(_0x2aae('0x4'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x2aae('0x5'));var config=require(_0x2aae('0x6'));var db=require(_0x2aae('0x7'))['db'];config[_0x2aae('0x8')]=_[_0x2aae('0x9')](config[_0x2aae('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2aae('0x8')]));require(_0x2aae('0xa'))[_0x2aae('0xb')](socket);function respondWithStatusCode(_0x9be2eb,_0x2193a7){_0x2193a7=_0x2193a7||0xcc;return function(_0x2ccecf){if(_0x2ccecf){return _0x9be2eb['sendStatus'](_0x2193a7);}return _0x9be2eb[_0x2aae('0xc')](_0x2193a7)[_0x2aae('0xd')]();};}function respondWithResult(_0x35f9ee,_0x318e56){_0x318e56=_0x318e56||0xc8;return function(_0x565e07){if(_0x565e07){return _0x35f9ee[_0x2aae('0xc')](_0x318e56)[_0x2aae('0xe')](_0x565e07);}};}function respondWithFilteredResult(_0x5abb32,_0x5bb4f2){return function(_0x33bbaf){if(_0x33bbaf){var _0xe45275=typeof _0x5bb4f2['offset']===_0x2aae('0xf')&&typeof _0x5bb4f2[_0x2aae('0x10')]===_0x2aae('0xf');var _0x4aa7a9=_0x33bbaf['count'];var _0x4d74d3=_0xe45275?0x0:_0x5bb4f2[_0x2aae('0x11')];var _0x7cb588=_0xe45275?_0x33bbaf['count']:_0x5bb4f2[_0x2aae('0x11')]+_0x5bb4f2[_0x2aae('0x10')];var _0x53b274;if(_0x7cb588>=_0x4aa7a9){_0x7cb588=_0x4aa7a9;_0x53b274=0xc8;}else{_0x53b274=0xce;}_0x5abb32[_0x2aae('0xc')](_0x53b274);return _0x5abb32[_0x2aae('0x12')](_0x2aae('0x13'),_0x4d74d3+'-'+_0x7cb588+'/'+_0x4aa7a9)[_0x2aae('0xe')](_0x33bbaf);}return null;};}function saveUpdates(_0x4319c7){return function(_0x103a89){if(_0x103a89){return _0x103a89[_0x2aae('0x14')](_0x4319c7)[_0x2aae('0x15')](function(_0x2cd2cd){return _0x2cd2cd;});}return null;};}function removeEntity(_0x42fdaf){return function(_0x4a16fb){if(_0x4a16fb){return _0x4a16fb['destroy']()[_0x2aae('0x15')](function(){_0x42fdaf['status'](0xcc)[_0x2aae('0xd')]();});}};}function handleEntityNotFound(_0xd0092b){return function(_0x111379){if(!_0x111379){_0xd0092b[_0x2aae('0x16')](0x194);}return _0x111379;};}function handleError(_0x2a63cf,_0x519122){_0x519122=_0x519122||0x1f4;return function(_0x598a98){logger[_0x2aae('0x17')](_0x598a98[_0x2aae('0x18')]);if(_0x598a98['name']){delete _0x598a98[_0x2aae('0x19')];}_0x2a63cf[_0x2aae('0xc')](_0x519122)['send'](_0x598a98);};}exports[_0x2aae('0x1a')]=function(_0x2e759b,_0x30c170){var _0x2c7364={};var _0x535493=_['map'](db[_0x2aae('0x1b')][_0x2aae('0x1c')],function(_0x47621a){return{'name':_0x47621a[_0x2aae('0x1d')],'type':_0x47621a[_0x2aae('0x1e')][_0x2aae('0x1f')]};});_0x2c7364=qs['getOptions'](_0x535493,_0x2e759b);return interaction[_0x2aae('0x20')](_0x2aae('0x21'),_0x2e759b[_0x2aae('0x22')],_0x2e759b[_0x2aae('0x23')],_0x2c7364,_0x535493)['then'](respondWithFilteredResult(_0x30c170,_0x2c7364))['catch'](handleError(_0x30c170,null));};exports[_0x2aae('0x24')]=function(_0x29e5ed,_0x384faf){var _0x366b58={'raw':![],'where':{'id':_0x29e5ed[_0x2aae('0x25')]['id']}},_0x32dfb7={};_0x32dfb7[_0x2aae('0x26')]=_[_0x2aae('0x27')](db[_0x2aae('0x1b')][_0x2aae('0x1c')]);_0x32dfb7['query']=_['keys'](_0x29e5ed[_0x2aae('0x22')]);_0x32dfb7[_0x2aae('0x28')]=_[_0x2aae('0x29')](_0x32dfb7[_0x2aae('0x26')],_0x32dfb7['query']);_0x366b58[_0x2aae('0x2a')]=_[_0x2aae('0x29')](_0x32dfb7['model'],qs[_0x2aae('0x2b')](_0x29e5ed[_0x2aae('0x22')]['fields']));_0x366b58[_0x2aae('0x2a')]=_0x366b58['attributes'][_0x2aae('0x2c')]?_0x366b58[_0x2aae('0x2a')]:_0x32dfb7['model'];if(_0x29e5ed[_0x2aae('0x22')][_0x2aae('0x2d')]){_0x366b58['include']=[{'all':!![]}];}_0x366b58=_['merge']({},_0x366b58,_0x29e5ed['options']);return db[_0x2aae('0x1b')]['find'](_0x366b58)['then'](handleEntityNotFound(_0x384faf,null))[_0x2aae('0x15')](respondWithResult(_0x384faf,null))[_0x2aae('0x2e')](handleError(_0x384faf,null));};exports['create']=function(_0x295452,_0xbcbd98){return db[_0x2aae('0x1b')][_0x2aae('0x2f')](_0x295452['body'],{})[_0x2aae('0x15')](respondWithResult(_0xbcbd98,0xc9))[_0x2aae('0x2e')](handleError(_0xbcbd98,null));};exports[_0x2aae('0x14')]=function(_0x1aad6e,_0x314155){if(_0x1aad6e['body']['id']){delete _0x1aad6e[_0x2aae('0x30')]['id'];}return db[_0x2aae('0x1b')][_0x2aae('0x31')]({'where':{'id':_0x1aad6e[_0x2aae('0x25')]['id']}})['then'](handleEntityNotFound(_0x314155,null))[_0x2aae('0x15')](saveUpdates(_0x1aad6e['body'],null))[_0x2aae('0x15')](respondWithResult(_0x314155,null))[_0x2aae('0x2e')](handleError(_0x314155,null));};exports[_0x2aae('0x32')]=function(_0x3bed01,_0x4fe329){return db[_0x2aae('0x1b')][_0x2aae('0x31')]({'where':{'id':_0x3bed01['params']['id']}})['then'](handleEntityNotFound(_0x4fe329,null))[_0x2aae('0x15')](removeEntity(_0x4fe329,null))[_0x2aae('0x2e')](handleError(_0x4fe329,null));};exports['describe']=function(_0x4d9e9f,_0x2bcfac){return db[_0x2aae('0x1b')]['describe']()[_0x2aae('0x15')](respondWithResult(_0x2bcfac,null))[_0x2aae('0x2e')](handleError(_0x2bcfac,null));};exports[_0x2aae('0x33')]=function(_0x53d61b,_0x2c9a12){return db['SmsMessage']['find']({'where':{'id':_0x53d61b[_0x2aae('0x25')]['id']}})[_0x2aae('0x15')](handleEntityNotFound(_0x2c9a12,null))[_0x2aae('0x15')](function(_0xb316b0){if(_0xb316b0){return _0xb316b0[_0x2aae('0x33')](_0x53d61b[_0x2aae('0x30')][_0x2aae('0x34')],_['omit'](_0x53d61b[_0x2aae('0x30')],['ids','id'])||{});}})['then'](respondWithResult(_0x2c9a12,null))[_0x2aae('0x2e')](handleError(_0x2c9a12,null));};exports[_0x2aae('0x35')]=function(_0x213bec,_0x58f6fc){var _0x272642={'raw':![],'where':{}};var _0x4d8ecc={};var _0x410438={'count':0x0,'rows':[]};return db[_0x2aae('0x1b')][_0x2aae('0x36')]({'where':{'id':_0x213bec['params']['id']}})[_0x2aae('0x15')](handleEntityNotFound(_0x58f6fc,null))[_0x2aae('0x15')](function(_0x86cd1c){if(_0x86cd1c){_0x4d8ecc[_0x2aae('0x26')]=_[_0x2aae('0x27')](db[_0x2aae('0x37')][_0x2aae('0x1c')]);_0x4d8ecc[_0x2aae('0x22')]=_[_0x2aae('0x27')](_0x213bec[_0x2aae('0x22')]);_0x4d8ecc['filters']=_[_0x2aae('0x29')](_0x4d8ecc[_0x2aae('0x26')],_0x4d8ecc[_0x2aae('0x22')]);_0x272642[_0x2aae('0x2a')]=_['intersection'](_0x4d8ecc[_0x2aae('0x26')],qs['fields'](_0x213bec['query'][_0x2aae('0x2b')]));_0x272642[_0x2aae('0x2a')]=_0x272642['attributes'][_0x2aae('0x2c')]?_0x272642[_0x2aae('0x2a')]:_0x4d8ecc['model'];if(!_0x213bec[_0x2aae('0x22')][_0x2aae('0x38')](_0x2aae('0x39'))){_0x272642[_0x2aae('0x10')]=qs[_0x2aae('0x10')](_0x213bec['query'][_0x2aae('0x10')]);_0x272642[_0x2aae('0x11')]=qs['offset'](_0x213bec['query'][_0x2aae('0x11')]);}_0x272642[_0x2aae('0x3a')]=qs['sort'](_0x213bec[_0x2aae('0x22')][_0x2aae('0x3b')]);_0x272642[_0x2aae('0x3c')]=qs[_0x2aae('0x28')](_[_0x2aae('0x3d')](_0x213bec[_0x2aae('0x22')],_0x4d8ecc[_0x2aae('0x28')]));_0x272642[_0x2aae('0x3c')][_0x2aae('0x3e')]=_0x86cd1c['id'];if(_0x213bec[_0x2aae('0x22')]['filter']){_0x272642[_0x2aae('0x3c')]=_['merge'](_0x272642[_0x2aae('0x3c')],{'$or':_[_0x2aae('0x3f')](_0x272642[_0x2aae('0x2a')],function(_0xaeeb48){var _0x463319={};_0x463319[_0xaeeb48]={'$like':'%'+_0x213bec[_0x2aae('0x22')][_0x2aae('0x40')]+'%'};return _0x463319;})});}if(_0x213bec[_0x2aae('0x22')][_0x2aae('0x41')]){var _0xd6170a=_0x213bec['query']['$gte'][_0x2aae('0x42')](',');var _0x38e305={};_0x38e305[_0xd6170a[0x0]]={'$gte':moment(_0xd6170a[0x1])[_0x2aae('0x43')](_0x2aae('0x44'))};_0x272642[_0x2aae('0x3c')]=_[_0x2aae('0x45')](_0x272642[_0x2aae('0x3c')],_0x38e305);}_0x272642=_[_0x2aae('0x45')]({},_0x272642,_0x213bec['options']);return db[_0x2aae('0x37')][_0x2aae('0x46')]({'where':_0x272642[_0x2aae('0x3c')]})['then'](function(_0x49327b){_0x410438[_0x2aae('0x46')]=_0x49327b;if(_0x213bec[_0x2aae('0x22')]['includeAll']){_0x272642['include']=[{'all':!![]}];}return db[_0x2aae('0x37')][_0x2aae('0x20')](_0x272642);})[_0x2aae('0x15')](function(_0x109f71){_0x410438['rows']=_0x109f71;return _0x410438;});}})[_0x2aae('0x15')](respondWithFilteredResult(_0x58f6fc,_0x272642))[_0x2aae('0x2e')](handleError(_0x58f6fc,null));};exports['addTags']=function(_0x53ac80,_0x3fb647){return db[_0x2aae('0x1b')][_0x2aae('0x31')]({'where':{'id':_0x53ac80[_0x2aae('0x25')]['id']}})[_0x2aae('0x15')](handleEntityNotFound(_0x3fb647,null))[_0x2aae('0x15')](function(_0x5b6e9d){if(_0x5b6e9d){return _0x5b6e9d[_0x2aae('0x47')](_0x53ac80[_0x2aae('0x30')][_0x2aae('0x34')],_['omit'](_0x53ac80[_0x2aae('0x30')],[_0x2aae('0x34'),'id'])||{})[_0x2aae('0x48')](function(){return db[_0x2aae('0x49')]['findAll']({'attributes':['id','name',_0x2aae('0x4a')],'where':{'id':_0x53ac80[_0x2aae('0x30')][_0x2aae('0x34')]}});})[_0x2aae('0x15')](function(_0x515546){socket[_0x2aae('0x4b')](_0x2aae('0x4c'),{'id':Number(_0x53ac80['params']['id']),'tags':_0x515546||[]});return{'id':Number(_0x53ac80[_0x2aae('0x25')]['id']),'tags':_0x515546||[]};});}})[_0x2aae('0x15')](respondWithResult(_0x3fb647,null))[_0x2aae('0x2e')](handleError(_0x3fb647,null));};exports['removeTags']=function(_0x457645,_0x446f0d){return db[_0x2aae('0x1b')]['find']({'where':{'id':_0x457645[_0x2aae('0x25')]['id']}})[_0x2aae('0x15')](handleEntityNotFound(_0x446f0d,null))[_0x2aae('0x15')](function(_0x57eb08){if(_0x57eb08){return _0x57eb08[_0x2aae('0x4d')](_0x457645[_0x2aae('0x22')]['ids']);}})[_0x2aae('0x15')](respondWithStatusCode(_0x446f0d,null))[_0x2aae('0x2e')](handleError(_0x446f0d,null));};exports[_0x2aae('0x4e')]=function(_0xb4564,_0x3ee5fe){var _0x4396d5=moment()[_0x2aae('0x4f')]()['toString']();var _0x45ff57=path[_0x2aae('0x50')](config[_0x2aae('0x51')],_0x2aae('0x52'),'files',_0x2aae('0x53'));var _0x17f004=path['join'](_0x45ff57,_0x4396d5);var _0x303806=util['format'](_0x2aae('0x54'),_0xb4564['params']['id'],_0x4396d5);var _0x4a6f0d=path[_0x2aae('0x50')](_0x45ff57,_0x303806);var _0x1d60cb=[];_0x1d60cb['push']({'model':db[_0x2aae('0x55')],'as':_0x2aae('0x55'),'attributes':['id','fullname'],'raw':!![]});_0x1d60cb['push']({'model':db['CmContact'],'as':_0x2aae('0x56'),'attributes':['id',_0x2aae('0x57'),_0x2aae('0x58')],'raw':!![]});var _0x2d0907=[{'model':db['SmsMessage'],'as':_0x2aae('0x59'),'attributes':['id',_0x2aae('0x30'),_0x2aae('0x5a'),_0x2aae('0x5b'),_0x2aae('0x5c'),_0x2aae('0x5d')],'include':_0x1d60cb}];_0x2d0907[_0x2aae('0x5e')]({'model':db[_0x2aae('0x5f')],'as':_0x2aae('0x60'),'attributes':['id',_0x2aae('0x19')]});_0x2d0907[_0x2aae('0x5e')]({'model':db[_0x2aae('0x55')],'as':'Owner','attributes':['id',_0x2aae('0x61')]});return db[_0x2aae('0x1b')][_0x2aae('0x31')]({'where':{'id':_0xb4564[_0x2aae('0x25')]['id']},'include':_0x2d0907})['then'](handleEntityNotFound(_0x3ee5fe,null))['then'](function(_0x2d2a8d){if(_0x2d2a8d){var _0x870002=_0x2d2a8d['get']({'plain':!![]});fs[_0x2aae('0x62')](_0x17f004);var _0x312447={'channel':_0x2aae('0x63'),'account':_0x870002['Account'][_0x2aae('0x19')],'agent':_0x870002[_0x2aae('0x64')]?_0x870002[_0x2aae('0x64')]['fullname']:_0x2aae('0x65'),'createdAt':moment(_0x870002[_0x2aae('0x5a')])[_0x2aae('0x43')](_0x2aae('0x44'))[_0x2aae('0x66')](),'closedAt':_0x870002[_0x2aae('0x67')]?moment(_0x870002[_0x2aae('0x68')])[_0x2aae('0x43')](_0x2aae('0x44'))['toString']():'','disposition':_0x870002[_0x2aae('0x69')],'messages':_(_0x870002[_0x2aae('0x59')])[_0x2aae('0x40')]({'secret':![]})[_0x2aae('0x3f')](function(_0x313f93){return{'date':moment(_0x313f93[_0x2aae('0x5a')])[_0x2aae('0x43')](_0x2aae('0x44'))[_0x2aae('0x66')](),'sender':_0x313f93[_0x2aae('0x5b')]===_0x2aae('0x6a')?_0x313f93[_0x2aae('0x55')]?_0x313f93['User']['fullname']:_0x2aae('0x6b'):_0x313f93[_0x2aae('0x56')]['firstName']+(_0x313f93['Contact'][_0x2aae('0x58')]?'\x20'+_0x313f93[_0x2aae('0x56')][_0x2aae('0x58')]:''),'body':_0x313f93['body'],'direction':_0x313f93[_0x2aae('0x5b')]===_0x2aae('0x6a')?'A':'C','secret':_0x313f93[_0x2aae('0x5c')],'read':_0x313f93[_0x2aae('0x5d')]};})['value']()};return ejs[_0x2aae('0x6c')](path[_0x2aae('0x50')](config[_0x2aae('0x51')],_0x2aae('0x52'),_0x2aae('0x6d'),_0x2aae('0x6e')),{'interaction':_0x312447})[_0x2aae('0x15')](function(_0x383cc0){var _0x3cc803=path[_0x2aae('0x50')](_0x17f004,_0x2aae('0x6f')+_0x870002['id']+'-'+_0x4396d5+_0x2aae('0x70'));var _0x442731={'path':_0x3cc803,'channel':'Sms','interactionId':_0x870002['id']};return pdf['createPdfFromHTML'](_0x383cc0,_0x442731);})[_0x2aae('0x15')](function(){return new BPromise(function(_0x69169b,_0x14a2d9){zipdir(_0x17f004,{'saveTo':_0x4a6f0d},function(_0xdffa30,_0x55a1b6){if(_0xdffa30)return _0x14a2d9(_0xdffa30);return _0x69169b(_0x55a1b6);});})[_0x2aae('0x15')](function(){return new BPromise(function(_0x4a0e74,_0x392267){rimraf(_0x17f004,function(_0x5a9bae){if(_0x5a9bae)_0x392267(_0x5a9bae);return _0x4a0e74();});});})[_0x2aae('0x15')](function(){return _0x3ee5fe[_0x2aae('0x4e')](_0x4a6f0d,_0x303806,function(_0x442d76){if(_0x442d76){console[_0x2aae('0x71')](_0x2aae('0x72'),_0x442d76);}else{fs[_0x2aae('0x73')](_0x4a6f0d);}});});});}else{return _0x3ee5fe['sendStatus'](0xc8);}})['catch'](handleError(_0x3ee5fe,null));}; \ No newline at end of file +var _0xa8e1=['rows','addTags','findAll','emit','smsInteractionTags:save','removeTags','download','unix','server','files','join','format','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','Messages','createdAt','direction','secret','Account','Owner','get','mkdirSync','Sms','toString','closed','closedAt','out','System','firstName','lastName','value','renderFile','root','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','undefined','offset','limit','set','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','key','getOptions','sms','query','catch','params','model','keys','SmsInteraction','filters','intersection','fields','attributes','includeAll','options','find','create','body','describe','ids','omit','getMessages','findOne','SmsMessage','length','hasOwnProperty','order','sort','where','pick','SmsInteractionId','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','count','include'];(function(_0x3a0ae8,_0x33b3ac){var _0x30d886=function(_0x195906){while(--_0x195906){_0x3a0ae8['push'](_0x3a0ae8['shift']());}};_0x30d886(++_0x33b3ac);}(_0xa8e1,0x11c));var _0x1a8e=function(_0x4d8666,_0x2ff19d){_0x4d8666=_0x4d8666-0x0;var _0x37175b=_0xa8e1[_0x4d8666];return _0x37175b;};'use strict';var rimraf=require(_0x1a8e('0x0'));var zipdir=require(_0x1a8e('0x1'));var moment=require(_0x1a8e('0x2'));var BPromise=require(_0x1a8e('0x3'));var util=require(_0x1a8e('0x4'));var path=require(_0x1a8e('0x5'));var ejs=require(_0x1a8e('0x6'));var fs=require('fs');var _=require(_0x1a8e('0x7'));var Redis=require('ioredis');var interaction=require(_0x1a8e('0x8'));var qs=require(_0x1a8e('0x9'));var pdf=require(_0x1a8e('0xa'));var logger=require(_0x1a8e('0xb'))(_0x1a8e('0xc'));var config=require(_0x1a8e('0xd'));var db=require(_0x1a8e('0xe'))['db'];config[_0x1a8e('0xf')]=_[_0x1a8e('0x10')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1a8e('0x11'))(new Redis(config[_0x1a8e('0xf')]));require(_0x1a8e('0x12'))[_0x1a8e('0x13')](socket);function respondWithStatusCode(_0x36fb4b,_0x32a12e){_0x32a12e=_0x32a12e||0xcc;return function(_0x403cc2){if(_0x403cc2){return _0x36fb4b[_0x1a8e('0x14')](_0x32a12e);}return _0x36fb4b[_0x1a8e('0x15')](_0x32a12e)['end']();};}function respondWithResult(_0x5c1570,_0x8b9c6){_0x8b9c6=_0x8b9c6||0xc8;return function(_0x1a7004){if(_0x1a7004){return _0x5c1570['status'](_0x8b9c6)[_0x1a8e('0x16')](_0x1a7004);}};}function respondWithFilteredResult(_0xc6d56e,_0x59585b){return function(_0x4e9865){if(_0x4e9865){var _0x1945c9=typeof _0x59585b['offset']===_0x1a8e('0x17')&&typeof _0x59585b['limit']===_0x1a8e('0x17');var _0xe12722=_0x4e9865['count'];var _0x5017c9=_0x1945c9?0x0:_0x59585b['offset'];var _0x3b4fa7=_0x1945c9?_0x4e9865['count']:_0x59585b[_0x1a8e('0x18')]+_0x59585b[_0x1a8e('0x19')];var _0x7af9ee;if(_0x3b4fa7>=_0xe12722){_0x3b4fa7=_0xe12722;_0x7af9ee=0xc8;}else{_0x7af9ee=0xce;}_0xc6d56e[_0x1a8e('0x15')](_0x7af9ee);return _0xc6d56e[_0x1a8e('0x1a')]('Content-Range',_0x5017c9+'-'+_0x3b4fa7+'/'+_0xe12722)[_0x1a8e('0x16')](_0x4e9865);}return null;};}function saveUpdates(_0x339f28){return function(_0x27c300){if(_0x27c300){return _0x27c300[_0x1a8e('0x1b')](_0x339f28)[_0x1a8e('0x1c')](function(_0x243a51){return _0x243a51;});}return null;};}function removeEntity(_0x459509){return function(_0x249f87){if(_0x249f87){return _0x249f87[_0x1a8e('0x1d')]()[_0x1a8e('0x1c')](function(){_0x459509[_0x1a8e('0x15')](0xcc)[_0x1a8e('0x1e')]();});}};}function handleEntityNotFound(_0x43d02e){return function(_0x92cb0a){if(!_0x92cb0a){_0x43d02e[_0x1a8e('0x14')](0x194);}return _0x92cb0a;};}function handleError(_0x40bb8b,_0x403c70){_0x403c70=_0x403c70||0x1f4;return function(_0x428ca9){logger['error'](_0x428ca9[_0x1a8e('0x1f')]);if(_0x428ca9[_0x1a8e('0x20')]){delete _0x428ca9[_0x1a8e('0x20')];}_0x40bb8b[_0x1a8e('0x15')](_0x403c70)[_0x1a8e('0x21')](_0x428ca9);};}exports[_0x1a8e('0x22')]=function(_0x45402f,_0x582e81){var _0x4057d1={};var _0x526aeb=_[_0x1a8e('0x23')](db['SmsInteraction'][_0x1a8e('0x24')],function(_0x114f2b){return{'name':_0x114f2b[_0x1a8e('0x25')],'type':_0x114f2b['type'][_0x1a8e('0x26')]};});_0x4057d1=qs[_0x1a8e('0x27')](_0x526aeb,_0x45402f);return interaction['findAll'](_0x1a8e('0x28'),_0x45402f[_0x1a8e('0x29')],_0x45402f['user'],_0x4057d1,_0x526aeb)[_0x1a8e('0x1c')](respondWithFilteredResult(_0x582e81,_0x4057d1))[_0x1a8e('0x2a')](handleError(_0x582e81,null));};exports['show']=function(_0x8cacc9,_0x2cd279){var _0x2b63e4={'raw':![],'where':{'id':_0x8cacc9[_0x1a8e('0x2b')]['id']}},_0x4ba097={};_0x4ba097[_0x1a8e('0x2c')]=_[_0x1a8e('0x2d')](db[_0x1a8e('0x2e')][_0x1a8e('0x24')]);_0x4ba097[_0x1a8e('0x29')]=_['keys'](_0x8cacc9['query']);_0x4ba097[_0x1a8e('0x2f')]=_[_0x1a8e('0x30')](_0x4ba097[_0x1a8e('0x2c')],_0x4ba097[_0x1a8e('0x29')]);_0x2b63e4['attributes']=_[_0x1a8e('0x30')](_0x4ba097['model'],qs[_0x1a8e('0x31')](_0x8cacc9[_0x1a8e('0x29')]['fields']));_0x2b63e4[_0x1a8e('0x32')]=_0x2b63e4[_0x1a8e('0x32')]['length']?_0x2b63e4[_0x1a8e('0x32')]:_0x4ba097['model'];if(_0x8cacc9[_0x1a8e('0x29')][_0x1a8e('0x33')]){_0x2b63e4['include']=[{'all':!![]}];}_0x2b63e4=_['merge']({},_0x2b63e4,_0x8cacc9[_0x1a8e('0x34')]);return db[_0x1a8e('0x2e')][_0x1a8e('0x35')](_0x2b63e4)[_0x1a8e('0x1c')](handleEntityNotFound(_0x2cd279,null))[_0x1a8e('0x1c')](respondWithResult(_0x2cd279,null))['catch'](handleError(_0x2cd279,null));};exports[_0x1a8e('0x36')]=function(_0x29b77f,_0x5ea4dc){return db[_0x1a8e('0x2e')]['create'](_0x29b77f[_0x1a8e('0x37')],{})[_0x1a8e('0x1c')](respondWithResult(_0x5ea4dc,0xc9))[_0x1a8e('0x2a')](handleError(_0x5ea4dc,null));};exports['update']=function(_0x2e89b8,_0xed7b32){if(_0x2e89b8[_0x1a8e('0x37')]['id']){delete _0x2e89b8[_0x1a8e('0x37')]['id'];}return db[_0x1a8e('0x2e')]['find']({'where':{'id':_0x2e89b8[_0x1a8e('0x2b')]['id']}})['then'](handleEntityNotFound(_0xed7b32,null))[_0x1a8e('0x1c')](saveUpdates(_0x2e89b8[_0x1a8e('0x37')],null))[_0x1a8e('0x1c')](respondWithResult(_0xed7b32,null))[_0x1a8e('0x2a')](handleError(_0xed7b32,null));};exports['destroy']=function(_0x357024,_0x47d7de){return db[_0x1a8e('0x2e')][_0x1a8e('0x35')]({'where':{'id':_0x357024[_0x1a8e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x47d7de,null))['then'](removeEntity(_0x47d7de,null))['catch'](handleError(_0x47d7de,null));};exports[_0x1a8e('0x38')]=function(_0x4f3ded,_0xfdd560){return db[_0x1a8e('0x2e')][_0x1a8e('0x38')]()[_0x1a8e('0x1c')](respondWithResult(_0xfdd560,null))[_0x1a8e('0x2a')](handleError(_0xfdd560,null));};exports['addMessage']=function(_0x45163d,_0x2ad097){return db['SmsMessage']['find']({'where':{'id':_0x45163d[_0x1a8e('0x2b')]['id']}})[_0x1a8e('0x1c')](handleEntityNotFound(_0x2ad097,null))[_0x1a8e('0x1c')](function(_0x51e35e){if(_0x51e35e){return _0x51e35e['addMessage'](_0x45163d[_0x1a8e('0x37')][_0x1a8e('0x39')],_[_0x1a8e('0x3a')](_0x45163d['body'],[_0x1a8e('0x39'),'id'])||{});}})['then'](respondWithResult(_0x2ad097,null))[_0x1a8e('0x2a')](handleError(_0x2ad097,null));};exports[_0x1a8e('0x3b')]=function(_0x262fd5,_0x8ce5c3){var _0x4d90d1={'raw':![],'where':{}};var _0x279a9d={};var _0x1e9483={'count':0x0,'rows':[]};return db[_0x1a8e('0x2e')][_0x1a8e('0x3c')]({'where':{'id':_0x262fd5[_0x1a8e('0x2b')]['id']}})[_0x1a8e('0x1c')](handleEntityNotFound(_0x8ce5c3,null))[_0x1a8e('0x1c')](function(_0x2f4b1d){if(_0x2f4b1d){_0x279a9d[_0x1a8e('0x2c')]=_[_0x1a8e('0x2d')](db[_0x1a8e('0x3d')][_0x1a8e('0x24')]);_0x279a9d['query']=_['keys'](_0x262fd5[_0x1a8e('0x29')]);_0x279a9d['filters']=_[_0x1a8e('0x30')](_0x279a9d[_0x1a8e('0x2c')],_0x279a9d['query']);_0x4d90d1['attributes']=_[_0x1a8e('0x30')](_0x279a9d[_0x1a8e('0x2c')],qs['fields'](_0x262fd5['query']['fields']));_0x4d90d1['attributes']=_0x4d90d1[_0x1a8e('0x32')][_0x1a8e('0x3e')]?_0x4d90d1[_0x1a8e('0x32')]:_0x279a9d[_0x1a8e('0x2c')];if(!_0x262fd5[_0x1a8e('0x29')][_0x1a8e('0x3f')]('nolimit')){_0x4d90d1[_0x1a8e('0x19')]=qs['limit'](_0x262fd5[_0x1a8e('0x29')][_0x1a8e('0x19')]);_0x4d90d1[_0x1a8e('0x18')]=qs[_0x1a8e('0x18')](_0x262fd5[_0x1a8e('0x29')][_0x1a8e('0x18')]);}_0x4d90d1[_0x1a8e('0x40')]=qs[_0x1a8e('0x41')](_0x262fd5[_0x1a8e('0x29')]['sort']);_0x4d90d1[_0x1a8e('0x42')]=qs[_0x1a8e('0x2f')](_[_0x1a8e('0x43')](_0x262fd5['query'],_0x279a9d['filters']));_0x4d90d1[_0x1a8e('0x42')][_0x1a8e('0x44')]=_0x2f4b1d['id'];if(_0x262fd5[_0x1a8e('0x29')][_0x1a8e('0x45')]){_0x4d90d1['where']=_[_0x1a8e('0x46')](_0x4d90d1[_0x1a8e('0x42')],{'$or':_[_0x1a8e('0x23')](_0x4d90d1['attributes'],function(_0x20eca4){var _0x3484d2={};_0x3484d2[_0x20eca4]={'$like':'%'+_0x262fd5[_0x1a8e('0x29')][_0x1a8e('0x45')]+'%'};return _0x3484d2;})});}if(_0x262fd5[_0x1a8e('0x29')][_0x1a8e('0x47')]){var _0x3793cc=_0x262fd5[_0x1a8e('0x29')][_0x1a8e('0x47')][_0x1a8e('0x48')](',');var _0xfa2e0f={};_0xfa2e0f[_0x3793cc[0x0]]={'$gte':moment(_0x3793cc[0x1])['format'](_0x1a8e('0x49'))};_0x4d90d1[_0x1a8e('0x42')]=_[_0x1a8e('0x46')](_0x4d90d1[_0x1a8e('0x42')],_0xfa2e0f);}_0x4d90d1=_['merge']({},_0x4d90d1,_0x262fd5['options']);return db[_0x1a8e('0x3d')][_0x1a8e('0x4a')]({'where':_0x4d90d1[_0x1a8e('0x42')]})['then'](function(_0x595332){_0x1e9483[_0x1a8e('0x4a')]=_0x595332;if(_0x262fd5[_0x1a8e('0x29')]['includeAll']){_0x4d90d1[_0x1a8e('0x4b')]=[{'all':!![]}];}return db[_0x1a8e('0x3d')]['findAll'](_0x4d90d1);})['then'](function(_0x16d926){_0x1e9483[_0x1a8e('0x4c')]=_0x16d926;return _0x1e9483;});}})['then'](respondWithFilteredResult(_0x8ce5c3,_0x4d90d1))[_0x1a8e('0x2a')](handleError(_0x8ce5c3,null));};exports[_0x1a8e('0x4d')]=function(_0x1236e8,_0x3faa0d){return db['SmsInteraction'][_0x1a8e('0x35')]({'where':{'id':_0x1236e8['params']['id']}})[_0x1a8e('0x1c')](handleEntityNotFound(_0x3faa0d,null))['then'](function(_0x18e027){if(_0x18e027){return _0x18e027['setTags'](_0x1236e8['body'][_0x1a8e('0x39')],_[_0x1a8e('0x3a')](_0x1236e8['body'],[_0x1a8e('0x39'),'id'])||{})['spread'](function(){return db['Tag'][_0x1a8e('0x4e')]({'attributes':['id',_0x1a8e('0x20'),'color'],'where':{'id':_0x1236e8[_0x1a8e('0x37')]['ids']}});})[_0x1a8e('0x1c')](function(_0x262e33){socket[_0x1a8e('0x4f')](_0x1a8e('0x50'),{'id':Number(_0x1236e8[_0x1a8e('0x2b')]['id']),'tags':_0x262e33||[]});return{'id':Number(_0x1236e8[_0x1a8e('0x2b')]['id']),'tags':_0x262e33||[]};});}})[_0x1a8e('0x1c')](respondWithResult(_0x3faa0d,null))[_0x1a8e('0x2a')](handleError(_0x3faa0d,null));};exports[_0x1a8e('0x51')]=function(_0x3ed92d,_0x31ed1b){return db[_0x1a8e('0x2e')][_0x1a8e('0x35')]({'where':{'id':_0x3ed92d[_0x1a8e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x31ed1b,null))[_0x1a8e('0x1c')](function(_0x1485ef){if(_0x1485ef){return _0x1485ef[_0x1a8e('0x51')](_0x3ed92d['query'][_0x1a8e('0x39')]);}})[_0x1a8e('0x1c')](respondWithStatusCode(_0x31ed1b,null))[_0x1a8e('0x2a')](handleError(_0x31ed1b,null));};exports[_0x1a8e('0x52')]=function(_0x4f835f,_0x230a9d){var _0x46de78=moment()[_0x1a8e('0x53')]()['toString']();var _0x3a93f4=path['join'](config['root'],_0x1a8e('0x54'),_0x1a8e('0x55'),'tmp');var _0x4859f1=path[_0x1a8e('0x56')](_0x3a93f4,_0x46de78);var _0x128abe=util[_0x1a8e('0x57')](_0x1a8e('0x58'),_0x4f835f[_0x1a8e('0x2b')]['id'],_0x46de78);var _0x16371d=path[_0x1a8e('0x56')](_0x3a93f4,_0x128abe);var _0x4ed3e4=[];_0x4ed3e4['push']({'model':db[_0x1a8e('0x59')],'as':_0x1a8e('0x59'),'attributes':['id',_0x1a8e('0x5a')],'raw':!![]});_0x4ed3e4[_0x1a8e('0x5b')]({'model':db[_0x1a8e('0x5c')],'as':_0x1a8e('0x5d'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x58b9d1=[{'model':db['SmsMessage'],'as':_0x1a8e('0x5e'),'attributes':['id',_0x1a8e('0x37'),_0x1a8e('0x5f'),_0x1a8e('0x60'),_0x1a8e('0x61'),'read'],'include':_0x4ed3e4}];_0x58b9d1['push']({'model':db['SmsAccount'],'as':_0x1a8e('0x62'),'attributes':['id','name']});_0x58b9d1[_0x1a8e('0x5b')]({'model':db[_0x1a8e('0x59')],'as':_0x1a8e('0x63'),'attributes':['id',_0x1a8e('0x5a')]});return db[_0x1a8e('0x2e')][_0x1a8e('0x35')]({'where':{'id':_0x4f835f[_0x1a8e('0x2b')]['id']},'include':_0x58b9d1})[_0x1a8e('0x1c')](handleEntityNotFound(_0x230a9d,null))[_0x1a8e('0x1c')](function(_0x4c9d41){if(_0x4c9d41){var _0x13fcc7=_0x4c9d41[_0x1a8e('0x64')]({'plain':!![]});fs[_0x1a8e('0x65')](_0x4859f1);var _0x56461d={'channel':_0x1a8e('0x66'),'account':_0x13fcc7[_0x1a8e('0x62')][_0x1a8e('0x20')],'agent':_0x13fcc7[_0x1a8e('0x63')]?_0x13fcc7[_0x1a8e('0x63')][_0x1a8e('0x5a')]:'N.A.','createdAt':moment(_0x13fcc7[_0x1a8e('0x5f')])[_0x1a8e('0x57')](_0x1a8e('0x49'))[_0x1a8e('0x67')](),'closedAt':_0x13fcc7[_0x1a8e('0x68')]?moment(_0x13fcc7[_0x1a8e('0x69')])['format'](_0x1a8e('0x49'))['toString']():'','disposition':_0x13fcc7['disposition'],'messages':_(_0x13fcc7[_0x1a8e('0x5e')])[_0x1a8e('0x45')]({'secret':![]})['map'](function(_0x494adc){return{'date':moment(_0x494adc[_0x1a8e('0x5f')])[_0x1a8e('0x57')](_0x1a8e('0x49'))[_0x1a8e('0x67')](),'sender':_0x494adc[_0x1a8e('0x60')]===_0x1a8e('0x6a')?_0x494adc[_0x1a8e('0x59')]?_0x494adc[_0x1a8e('0x59')][_0x1a8e('0x5a')]:_0x1a8e('0x6b'):_0x494adc[_0x1a8e('0x5d')][_0x1a8e('0x6c')]+(_0x494adc[_0x1a8e('0x5d')]['lastName']?'\x20'+_0x494adc[_0x1a8e('0x5d')][_0x1a8e('0x6d')]:''),'body':_0x494adc[_0x1a8e('0x37')],'direction':_0x494adc[_0x1a8e('0x60')]===_0x1a8e('0x6a')?'A':'C','secret':_0x494adc['secret'],'read':_0x494adc['read']};})[_0x1a8e('0x6e')]()};return ejs[_0x1a8e('0x6f')](path[_0x1a8e('0x56')](config[_0x1a8e('0x70')],'server',_0x1a8e('0x71'),_0x1a8e('0x72')),{'interaction':_0x56461d})[_0x1a8e('0x1c')](function(_0x4c55b1){var _0x137b84=path['join'](_0x4859f1,_0x1a8e('0x73')+_0x13fcc7['id']+'-'+_0x46de78+_0x1a8e('0x74'));var _0x3411b5={'path':_0x137b84,'channel':_0x1a8e('0x66'),'interactionId':_0x13fcc7['id']};return pdf[_0x1a8e('0x75')](_0x4c55b1,_0x3411b5);})['then'](function(){return new BPromise(function(_0x2bfbe0,_0x3fd877){zipdir(_0x4859f1,{'saveTo':_0x16371d},function(_0x24ffef,_0x507155){if(_0x24ffef)return _0x3fd877(_0x24ffef);return _0x2bfbe0(_0x507155);});})[_0x1a8e('0x1c')](function(){return new BPromise(function(_0x10c8ed,_0x39bf36){rimraf(_0x4859f1,function(_0x2a135a){if(_0x2a135a)_0x39bf36(_0x2a135a);return _0x10c8ed();});});})[_0x1a8e('0x1c')](function(){return _0x230a9d[_0x1a8e('0x52')](_0x16371d,_0x128abe,function(_0x5b5a22){if(_0x5b5a22){console[_0x1a8e('0x76')](_0x1a8e('0x77'),_0x5b5a22);}else{fs['unlinkSync'](_0x16371d);}});});});}else{return _0x230a9d[_0x1a8e('0x14')](0xc8);}})[_0x1a8e('0x2a')](handleError(_0x230a9d,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 186b24e..bf9654a 100644 --- a/server/api/smsInteraction/smsInteraction.events.js +++ b/server/api/smsInteraction/smsInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfef3=['setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','SmsInteraction','SmsMessage','setMaxListeners','update','remove','getUsers','then'];(function(_0xfb44ad,_0x3ca47d){var _0x224ff6=function(_0x400f7c){while(--_0x400f7c){_0xfb44ad['push'](_0xfb44ad['shift']());}};_0x224ff6(++_0x3ca47d);}(_0xfef3,0x118));var _0x3fef=function(_0x1554e2,_0x4efeec){_0x1554e2=_0x1554e2-0x0;var _0x51aa70=_0xfef3[_0x1554e2];return _0x51aa70;};'use strict';var EventEmitter=require(_0x3fef('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x3fef('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x3fef('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x3fef('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3fef('0x4'),'afterDestroy':_0x3fef('0x5')};function emitEvent(_0x538f28){return function(_0x2f88b8,_0x1351b1,_0x5dd9fb){_0x2f88b8[_0x3fef('0x6')]({'attributes':['id'],'raw':!![]})[_0x3fef('0x7')](function(_0x800850){_0x2f88b8[_0x3fef('0x8')](_0x3fef('0x9'),_0x800850[_0x3fef('0xa')](function(_0x356ad8){return{'id':_0x356ad8['id']};}));return SmsMessage[_0x3fef('0xb')]({'where':{'SmsInteractionId':_0x2f88b8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3fef('0x7')](function(_0x307586){_0x2f88b8[_0x3fef('0x8')](_0x3fef('0xc'),_0x307586[_0x3fef('0xd')]);SmsInteractionEvents[_0x3fef('0xe')](_0x538f28+':'+_0x2f88b8['id'],_0x2f88b8);SmsInteractionEvents['emit'](_0x538f28,_0x2f88b8);_0x5dd9fb(null);})[_0x3fef('0xf')](_0x5dd9fb(null));};}for(var e in events){if(events[_0x3fef('0x10')](e)){var event=events[e];SmsInteraction[_0x3fef('0x11')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0xd7d1=['SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x120647,_0x5ab0d0){var _0x3f7cba=function(_0x122d9f){while(--_0x122d9f){_0x120647['push'](_0x120647['shift']());}};_0x3f7cba(++_0x5ab0d0);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x252263,_0x473062){_0x252263=_0x252263-0x0;var _0x14e7e6=_0xd7d1[_0x252263];return _0x14e7e6;};'use strict';var EventEmitter=require(_0x1d7d('0x0'));var SmsInteraction=require(_0x1d7d('0x1'))['db'][_0x1d7d('0x2')];var SmsMessage=require(_0x1d7d('0x1'))['db'][_0x1d7d('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x1d7d('0x4')](0x0);var events={'afterCreate':_0x1d7d('0x5'),'afterUpdate':_0x1d7d('0x6'),'afterDestroy':_0x1d7d('0x7')};function emitEvent(_0x1adb6b){return function(_0x3c0839,_0x1a2564,_0x14b2b9){_0x3c0839['getUsers']({'attributes':['id'],'raw':!![]})[_0x1d7d('0x8')](function(_0x1aa456){_0x3c0839[_0x1d7d('0x9')](_0x1d7d('0xa'),_0x1aa456[_0x1d7d('0xb')](function(_0x268732){return{'id':_0x268732['id']};}));return SmsMessage[_0x1d7d('0xc')]({'where':{'SmsInteractionId':_0x3c0839['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1d7d('0x8')](function(_0x1ad06f){_0x3c0839[_0x1d7d('0x9')](_0x1d7d('0xd'),_0x1ad06f['length']);SmsInteractionEvents[_0x1d7d('0xe')](_0x1adb6b+':'+_0x3c0839['id'],_0x3c0839);SmsInteractionEvents['emit'](_0x1adb6b,_0x3c0839);_0x14b2b9(null);})[_0x1d7d('0xf')](_0x14b2b9(null));};}for(var e in events){if(events[_0x1d7d('0x10')](e)){var event=events[e];SmsInteraction[_0x1d7d('0x11')](e,emitEvent(event));}}module[_0x1d7d('0x12')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 12c5c3f..59f703d 100644 --- a/server/api/smsInteraction/smsInteraction.model.js +++ b/server/api/smsInteraction/smsInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20f6=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','closed','closedAt'];(function(_0x484a7c,_0x460993){var _0x343b68=function(_0x4dd486){while(--_0x4dd486){_0x484a7c['push'](_0x484a7c['shift']());}};_0x343b68(++_0x460993);}(_0x20f6,0x9b));var _0x620f=function(_0x360164,_0x44bdbf){_0x360164=_0x360164-0x0;var _0x5f327f=_0x20f6[_0x360164];return _0x5f327f;};'use strict';var _=require(_0x620f('0x0'));var util=require(_0x620f('0x1'));var logger=require(_0x620f('0x2'))(_0x620f('0x3'));var moment=require('moment');var BPromise=require(_0x620f('0x4'));var rp=require(_0x620f('0x5'));var fs=require('fs');var path=require(_0x620f('0x6'));var rimraf=require(_0x620f('0x7'));var config=require(_0x620f('0x8'));var attributes=require(_0x620f('0x9'));module[_0x620f('0xa')]=function(_0x589e13,_0x56c091){return _0x589e13[_0x620f('0xb')](_0x620f('0xc'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x548a8a,_0x38d044,_0x17c128){if(_0x548a8a['changed'](_0x620f('0xd'))){_0x548a8a[_0x620f('0xe')]=moment()[_0x620f('0xf')](_0x620f('0x10'));}_0x17c128(null,_0x548a8a);}}});}; \ No newline at end of file +var _0x1f4f=['exports','define','SmsInteraction','sms_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./smsInteraction.attributes'];(function(_0x33ce13,_0x3ac5b3){var _0x22dada=function(_0x202568){while(--_0x202568){_0x33ce13['push'](_0x33ce13['shift']());}};_0x22dada(++_0x3ac5b3);}(_0x1f4f,0x7f));var _0xf1f4=function(_0x554c93,_0x33c4e8){_0x554c93=_0x554c93-0x0;var _0x1602bd=_0x1f4f[_0x554c93];return _0x1602bd;};'use strict';var _=require(_0xf1f4('0x0'));var util=require(_0xf1f4('0x1'));var logger=require('../../config/logger')(_0xf1f4('0x2'));var moment=require(_0xf1f4('0x3'));var BPromise=require(_0xf1f4('0x4'));var rp=require(_0xf1f4('0x5'));var fs=require('fs');var path=require(_0xf1f4('0x6'));var rimraf=require(_0xf1f4('0x7'));var config=require('../../config/environment');var attributes=require(_0xf1f4('0x8'));module[_0xf1f4('0x9')]=function(_0x1f5993,_0x3ebc68){return _0x1f5993[_0xf1f4('0xa')](_0xf1f4('0xb'),attributes,{'tableName':_0xf1f4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4118e7,_0x375e5c,_0x24b6ea){if(_0x4118e7[_0xf1f4('0xd')](_0xf1f4('0xe'))){_0x4118e7['closedAt']=moment()[_0xf1f4('0xf')](_0xf1f4('0x10'));}_0x24b6ea(null,_0x4118e7);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 60d6983..79f56e9 100644 --- a/server/api/smsInteraction/smsInteraction.rpc.js +++ b/server/api/smsInteraction/smsInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba6a=['register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','catch','ids','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x50efdf,_0x4b4758){var _0x75c70=function(_0x864432){while(--_0x864432){_0x50efdf['push'](_0x50efdf['shift']());}};_0x75c70(++_0x4b4758);}(_0xba6a,0x1c7));var _0xaba6=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0xba6a[_0x57d13b];return _0x467696;};'use strict';var _=require('lodash');var util=require(_0xaba6('0x0'));var moment=require(_0xaba6('0x1'));var BPromise=require('bluebird');var rs=require(_0xaba6('0x2'));var fs=require('fs');var Redis=require(_0xaba6('0x3'));var db=require(_0xaba6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaba6('0x5'))(_0xaba6('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaba6('0x7')][_0xaba6('0x8')]({'port':0x232a});config[_0xaba6('0x9')]=_[_0xaba6('0xa')](config[_0xaba6('0x9')],{'host':_0xaba6('0xb'),'port':0x18eb});var socket=require(_0xaba6('0xc'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0xaba6('0xd')](socket);function respondWithRpcPromise(_0x665ab,_0x26e8a4,_0x5e81c8){return new BPromise(function(_0x207f4b,_0x5b13f5){return client['request'](_0x665ab,_0x5e81c8)[_0xaba6('0xe')](function(_0x4bbeaf){logger[_0xaba6('0xf')](_0xaba6('0x10'),_0x26e8a4,_0xaba6('0x11'));logger[_0xaba6('0x12')](_0xaba6('0x13'),_0x26e8a4,'request\x20sent',JSON[_0xaba6('0x14')](_0x4bbeaf));if(_0x4bbeaf[_0xaba6('0x15')]){if(_0x4bbeaf[_0xaba6('0x15')][_0xaba6('0x16')]===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x26e8a4,_0x4bbeaf[_0xaba6('0x15')][_0xaba6('0x17')]);return _0x5b13f5(_0x4bbeaf[_0xaba6('0x15')]['message']);}logger[_0xaba6('0x15')](_0xaba6('0x10'),_0x26e8a4,_0x4bbeaf[_0xaba6('0x15')]['message']);return _0x207f4b(_0x4bbeaf[_0xaba6('0x15')][_0xaba6('0x17')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x26e8a4,_0xaba6('0x11'));_0x207f4b(_0x4bbeaf['result'][_0xaba6('0x17')]);}})['catch'](function(_0x48ed4b){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x26e8a4,_0x48ed4b);_0x5b13f5(_0x48ed4b);});});}exports[_0xaba6('0x18')]=function(_0x9f41e){var _0x4c5e17=this;return new Promise(function(_0x321fce,_0x11b334){return db[_0xaba6('0x19')][_0xaba6('0x1a')](_0x9f41e[_0xaba6('0x1b')],{'raw':_0x9f41e[_0xaba6('0x1c')]?_0x9f41e[_0xaba6('0x1c')][_0xaba6('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9f41e[_0xaba6('0x1c')]?_0x9f41e['options'][_0xaba6('0x1e')]||null:null,'attributes':_0x9f41e[_0xaba6('0x1c')]?_0x9f41e[_0xaba6('0x1c')]['attributes']||null:null,'limit':_0x9f41e['options']?_0x9f41e['options'][_0xaba6('0x1f')]||null:null})['then'](function(_0x47856f){logger[_0xaba6('0xf')](_0xaba6('0x18'),_0x9f41e);logger[_0xaba6('0x12')](_0xaba6('0x18'),_0x9f41e,JSON['stringify'](_0x47856f));_0x321fce(_0x47856f);})[_0xaba6('0x20')](function(_0xd588d6){logger[_0xaba6('0x15')](_0xaba6('0x18'),_0xd588d6[_0xaba6('0x17')],_0x9f41e);_0x11b334(_0x4c5e17[_0xaba6('0x15')](0x1f4,_0xd588d6['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x164847){return new Promise(function(_0x55e25b,_0x7c26b8){return db[_0xaba6('0x19')]['find']({'where':_0x164847[_0xaba6('0x1c')]?_0x164847[_0xaba6('0x1c')][_0xaba6('0x1e')]||null:null})[_0xaba6('0xe')](function(_0x3f143d){if(_0x3f143d){return _0x3f143d['addTags'](_0x164847['body']['ids'],_['omit'](_0x164847['body'],[_0xaba6('0x21'),'id'])||{});}})[_0xaba6('0x22')](function(_0x5c5ea8){logger[_0xaba6('0xf')](_0xaba6('0x23'),_0x164847);logger['debug']('AddTags',_0x164847,JSON['stringify'](_0x5c5ea8));_0x55e25b(_0x5c5ea8);})[_0xaba6('0x20')](function(_0x55b457){logger['error'](_0xaba6('0x23'),_0x55b457[_0xaba6('0x17')],_0x164847);_0x7c26b8(_this[_0xaba6('0x15')](0x1f4,_0x55b457['message']));});});}; \ No newline at end of file +var _0x23af=['result','catch','UpdateSmsInteraction','SmsInteraction','options','raw','where','attributes','limit','debug','AddTagsToSmsInteraction','find','body','ids','omit','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','./smsInteraction.socket','register','request','then','info','request\x20sent','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message'];(function(_0x37e50f,_0x4bf02c){var _0xe7dfff=function(_0x223680){while(--_0x223680){_0x37e50f['push'](_0x37e50f['shift']());}};_0xe7dfff(++_0x4bf02c);}(_0x23af,0x197));var _0xf23a=function(_0x1337c1,_0x84e63e){_0x1337c1=_0x1337c1-0x0;var _0x3b5924=_0x23af[_0x1337c1];return _0x3b5924;};'use strict';var _=require(_0xf23a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf23a('0x1'));var rs=require(_0xf23a('0x2'));var fs=require('fs');var Redis=require(_0xf23a('0x3'));var db=require(_0xf23a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf23a('0x5'))(_0xf23a('0x6'));var config=require(_0xf23a('0x7'));var jayson=require(_0xf23a('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xf23a('0x9')]=_['defaults'](config[_0xf23a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xf23a('0xa'))(new Redis(config[_0xf23a('0x9')]));require(_0xf23a('0xb'))[_0xf23a('0xc')](socket);function respondWithRpcPromise(_0x1f0713,_0x351ed3,_0x4b6eda){return new BPromise(function(_0x40be6c,_0x138bde){return client[_0xf23a('0xd')](_0x1f0713,_0x4b6eda)[_0xf23a('0xe')](function(_0x1a4819){logger[_0xf23a('0xf')]('SmsInteraction,\x20%s,\x20%s',_0x351ed3,'request\x20sent');logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x351ed3,_0xf23a('0x10'),JSON[_0xf23a('0x11')](_0x1a4819));if(_0x1a4819[_0xf23a('0x12')]){if(_0x1a4819[_0xf23a('0x12')][_0xf23a('0x13')]===0x1f4){logger['error'](_0xf23a('0x14'),_0x351ed3,_0x1a4819[_0xf23a('0x12')][_0xf23a('0x15')]);return _0x138bde(_0x1a4819[_0xf23a('0x12')]['message']);}logger[_0xf23a('0x12')](_0xf23a('0x14'),_0x351ed3,_0x1a4819[_0xf23a('0x12')][_0xf23a('0x15')]);return _0x40be6c(_0x1a4819['error'][_0xf23a('0x15')]);}else{logger[_0xf23a('0xf')](_0xf23a('0x14'),_0x351ed3,_0xf23a('0x10'));_0x40be6c(_0x1a4819[_0xf23a('0x16')][_0xf23a('0x15')]);}})[_0xf23a('0x17')](function(_0x456867){logger[_0xf23a('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x351ed3,_0x456867);_0x138bde(_0x456867);});});}exports[_0xf23a('0x18')]=function(_0x103b37){var _0x19b964=this;return new Promise(function(_0x464b53,_0x5c7f53){return db[_0xf23a('0x19')]['update'](_0x103b37['body'],{'raw':_0x103b37[_0xf23a('0x1a')]?_0x103b37[_0xf23a('0x1a')][_0xf23a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x103b37[_0xf23a('0x1a')]?_0x103b37[_0xf23a('0x1a')][_0xf23a('0x1c')]||null:null,'attributes':_0x103b37[_0xf23a('0x1a')]?_0x103b37[_0xf23a('0x1a')][_0xf23a('0x1d')]||null:null,'limit':_0x103b37['options']?_0x103b37[_0xf23a('0x1a')][_0xf23a('0x1e')]||null:null})['then'](function(_0x47cba1){logger[_0xf23a('0xf')](_0xf23a('0x18'),_0x103b37);logger[_0xf23a('0x1f')](_0xf23a('0x18'),_0x103b37,JSON['stringify'](_0x47cba1));_0x464b53(_0x47cba1);})[_0xf23a('0x17')](function(_0x8b363){logger[_0xf23a('0x12')]('UpdateSmsInteraction',_0x8b363[_0xf23a('0x15')],_0x103b37);_0x5c7f53(_0x19b964[_0xf23a('0x12')](0x1f4,_0x8b363['message']));});});};exports[_0xf23a('0x20')]=function(_0x1df3c4){return new Promise(function(_0x9d759e,_0x4c472d){return db[_0xf23a('0x19')][_0xf23a('0x21')]({'where':_0x1df3c4['options']?_0x1df3c4['options'][_0xf23a('0x1c')]||null:null})['then'](function(_0x35317a){if(_0x35317a){return _0x35317a['addTags'](_0x1df3c4[_0xf23a('0x22')][_0xf23a('0x23')],_[_0xf23a('0x24')](_0x1df3c4['body'],['ids','id'])||{});}})[_0xf23a('0x25')](function(_0x8a6ae8){logger[_0xf23a('0xf')](_0xf23a('0x26'),_0x1df3c4);logger[_0xf23a('0x1f')](_0xf23a('0x26'),_0x1df3c4,JSON[_0xf23a('0x11')](_0x8a6ae8));_0x9d759e(_0x8a6ae8);})[_0xf23a('0x17')](function(_0xb7face){logger[_0xf23a('0x12')](_0xf23a('0x26'),_0xb7face[_0xf23a('0x15')],_0x1df3c4);_0x4c472d(_this[_0xf23a('0x12')](0x1f4,_0xb7face[_0xf23a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 6324ff5..57dd4bf 100644 --- a/server/api/smsInteraction/smsInteraction.socket.js +++ b/server/api/smsInteraction/smsInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44ec=['removeListener','register','length','smsInteraction:','./smsInteraction.events','save','remove','emit'];(function(_0x381606,_0x53382c){var _0x31c4ca=function(_0x310493){while(--_0x310493){_0x381606['push'](_0x381606['shift']());}};_0x31c4ca(++_0x53382c);}(_0x44ec,0xfc));var _0xc44e=function(_0x26b034,_0x5a0893){_0x26b034=_0x26b034-0x0;var _0x3bdd88=_0x44ec[_0x26b034];return _0x3bdd88;};'use strict';var SmsInteractionEvents=require(_0xc44e('0x0'));var events=[_0xc44e('0x1'),_0xc44e('0x2'),'update'];function createListener(_0x3eb987,_0x2726d4){return function(_0x3eed35){_0x2726d4[_0xc44e('0x3')](_0x3eb987,_0x3eed35);};}function removeListener(_0x45774c,_0x1c0c18){return function(){SmsInteractionEvents[_0xc44e('0x4')](_0x45774c,_0x1c0c18);};}exports[_0xc44e('0x5')]=function(_0x2528e8){for(var _0x4c89d4=0x0,_0x4e9101=events[_0xc44e('0x6')];_0x4c89d4<_0x4e9101;_0x4c89d4++){var _0x54ffa7=events[_0x4c89d4];var _0x3839ec=createListener(_0xc44e('0x7')+_0x54ffa7,_0x2528e8);SmsInteractionEvents['on'](_0x54ffa7,_0x3839ec);}}; \ No newline at end of file +var _0x3729=['register','save','remove','emit','removeListener'];(function(_0x298064,_0x1d2bfb){var _0x2512ea=function(_0x3e5b28){while(--_0x3e5b28){_0x298064['push'](_0x298064['shift']());}};_0x2512ea(++_0x1d2bfb);}(_0x3729,0xe2));var _0x9372=function(_0x4d0f36,_0x4cc3e6){_0x4d0f36=_0x4d0f36-0x0;var _0x2fdd31=_0x3729[_0x4d0f36];return _0x2fdd31;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x9372('0x0'),_0x9372('0x1'),'update'];function createListener(_0x53584d,_0x29c62d){return function(_0x4d023e){_0x29c62d[_0x9372('0x2')](_0x53584d,_0x4d023e);};}function removeListener(_0x58b040,_0x131f24){return function(){SmsInteractionEvents[_0x9372('0x3')](_0x58b040,_0x131f24);};}exports[_0x9372('0x4')]=function(_0x234af4){for(var _0x4d1f89=0x0,_0x5911c3=events['length'];_0x4d1f89<_0x5911c3;_0x4d1f89++){var _0x5057fa=events[_0x4d1f89];var _0x1c9e6d=createListener('smsInteraction:'+_0x5057fa,_0x234af4);SmsInteractionEvents['on'](_0x5057fa,_0x1c9e6d);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 824cc27..be7e967 100644 --- a/server/api/smsMessage/index.js +++ b/server/api/smsMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8ee=['describe','/:id','show','tracked','sms','smsmessage:create','create','post','status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','/describe'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0xc8ee,0xcb));var _0xec8e=function(_0x58493a,_0x40a51d){_0x58493a=_0x58493a-0x0;var _0x41ffa7=_0xc8ee[_0x58493a];return _0x41ffa7;};'use strict';var multer=require(_0xec8e('0x0'));var util=require(_0xec8e('0x1'));var path=require(_0xec8e('0x2'));var timeout=require(_0xec8e('0x3'));var express=require(_0xec8e('0x4'));var router=express[_0xec8e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xec8e('0x6'));var interaction=require(_0xec8e('0x7'));var config=require(_0xec8e('0x8'));var controller=require(_0xec8e('0x9'));router['get']('/',auth[_0xec8e('0xa')](),controller[_0xec8e('0xb')]);router[_0xec8e('0xc')](_0xec8e('0xd'),auth[_0xec8e('0xa')](),controller[_0xec8e('0xe')]);router[_0xec8e('0xc')](_0xec8e('0xf'),auth[_0xec8e('0xa')](),controller[_0xec8e('0x10')]);router['post']('/',auth[_0xec8e('0xa')](),interaction[_0xec8e('0x11')](_0xec8e('0x12'),_0xec8e('0x13')),controller[_0xec8e('0x14')]);router[_0xec8e('0x15')]('/:id/status',controller[_0xec8e('0x16')]);router[_0xec8e('0x17')](_0xec8e('0xf'),auth[_0xec8e('0xa')](),controller['update']);router['put'](_0xec8e('0x18'),auth['isAuthenticated'](),controller[_0xec8e('0x19')]);router[_0xec8e('0x17')](_0xec8e('0x1a'),auth[_0xec8e('0xa')](),controller[_0xec8e('0x1b')]);router[_0xec8e('0x1c')]('/:id',auth[_0xec8e('0xa')](),controller[_0xec8e('0x1d')]);module[_0xec8e('0x1e')]=router; \ No newline at end of file +var _0xc659=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','describe','/:id','sms','create','post','/:id/status','status','update','put','/:id/accept','accept','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x29aefc,_0x4dcf53){var _0x11be36=function(_0x3d472a){while(--_0x3d472a){_0x29aefc['push'](_0x29aefc['shift']());}};_0x11be36(++_0x4dcf53);}(_0xc659,0x12f));var _0x9c65=function(_0xe7cc0c,_0x193265){_0xe7cc0c=_0xe7cc0c-0x0;var _0x1b6bad=_0xc659[_0xe7cc0c];return _0x1b6bad;};'use strict';var multer=require(_0x9c65('0x0'));var util=require(_0x9c65('0x1'));var path=require(_0x9c65('0x2'));var timeout=require(_0x9c65('0x3'));var express=require(_0x9c65('0x4'));var router=express[_0x9c65('0x5')]();var fs_extra=require(_0x9c65('0x6'));var auth=require(_0x9c65('0x7'));var interaction=require(_0x9c65('0x8'));var config=require(_0x9c65('0x9'));var controller=require(_0x9c65('0xa'));router[_0x9c65('0xb')]('/',auth[_0x9c65('0xc')](),controller[_0x9c65('0xd')]);router[_0x9c65('0xb')]('/describe',auth[_0x9c65('0xc')](),controller[_0x9c65('0xe')]);router[_0x9c65('0xb')](_0x9c65('0xf'),auth[_0x9c65('0xc')](),controller['show']);router['post']('/',auth[_0x9c65('0xc')](),interaction['tracked'](_0x9c65('0x10'),'smsmessage:create'),controller[_0x9c65('0x11')]);router[_0x9c65('0x12')](_0x9c65('0x13'),controller[_0x9c65('0x14')]);router['put'](_0x9c65('0xf'),auth[_0x9c65('0xc')](),controller[_0x9c65('0x15')]);router[_0x9c65('0x16')](_0x9c65('0x17'),auth[_0x9c65('0xc')](),controller[_0x9c65('0x18')]);router[_0x9c65('0x16')]('/:id/reject',auth[_0x9c65('0xc')](),controller['reject']);router[_0x9c65('0x19')](_0x9c65('0xf'),auth[_0x9c65('0xc')](),controller[_0x9c65('0x1a')]);module[_0x9c65('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 8a287c3..ebc06ea 100644 --- a/server/api/smsMessage/smsMessage.attributes.js +++ b/server/api/smsMessage/smsMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed92=['medium','BOOLEAN','ENUM','out','STRING','DATE','exports','TEXT'];(function(_0x156417,_0x15b771){var _0x4d42b1=function(_0x36f462){while(--_0x36f462){_0x156417['push'](_0x156417['shift']());}};_0x4d42b1(++_0x15b771);}(_0xed92,0x166));var _0x2ed9=function(_0x22d562,_0x5261f7){_0x22d562=_0x22d562-0x0;var _0x53d1f2=_0xed92[_0x22d562];return _0x53d1f2;};'use strict';var Sequelize=require('sequelize');module[_0x2ed9('0x0')]={'body':{'type':Sequelize[_0x2ed9('0x1')](_0x2ed9('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2ed9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2ed9('0x4')]('in',_0x2ed9('0x5')),'defaultValue':_0x2ed9('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x2ed9('0x6')](0xbe)},'phone':{'type':Sequelize[_0x2ed9('0x6')]},'readAt':{'type':Sequelize[_0x2ed9('0x7')]},'secret':{'type':Sequelize[_0x2ed9('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x2ed9('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9348=['sequelize','exports','TEXT','medium','BOOLEAN','out','STRING','DATE'];(function(_0x423fcd,_0x48135e){var _0x2dc5ed=function(_0x36d87d){while(--_0x36d87d){_0x423fcd['push'](_0x423fcd['shift']());}};_0x2dc5ed(++_0x48135e);}(_0x9348,0x160));var _0x8934=function(_0x31a81b,_0x1c7d4e){_0x31a81b=_0x31a81b-0x0;var _0x1eb560=_0x9348[_0x31a81b];return _0x1eb560;};'use strict';var Sequelize=require(_0x8934('0x0'));module[_0x8934('0x1')]={'body':{'type':Sequelize[_0x8934('0x2')](_0x8934('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8934('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8934('0x5')),'defaultValue':_0x8934('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8934('0x6')](0xbe)},'phone':{'type':Sequelize[_0x8934('0x6')]},'readAt':{'type':Sequelize[_0x8934('0x7')]},'secret':{'type':Sequelize[_0x8934('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8934('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 2d8e652..c6e8e12 100644 --- a/server/api/smsMessage/smsMessage.controller.js +++ b/server/api/smsMessage/smsMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c7a=['redis','http','client','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','end','status','undefined','offset','limit','Content-Range','json','apply','reject','update','destroy','name','send','index','map','SmsMessage','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','params','rawAttributes','intersection','create','body','catch','find','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','SmsInteractionId','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','agent','fullname','email','internal','manual','channel','motionChannel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','ContactId','interface','SIP/%s','SmsAccount','SmsAccountId','inspect','MessageSid','twilio','plivo','MessageUUID','messageId','sent','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','results','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost'];(function(_0x4db46b,_0xadcb1a){var _0x565be8=function(_0x5d2e50){while(--_0x5d2e50){_0x4db46b['push'](_0x4db46b['shift']());}};_0x565be8(++_0xadcb1a);}(_0x8c7a,0x197));var _0xa8c7=function(_0x290531,_0x30e461){_0x290531=_0x290531-0x0;var _0x61b8c0=_0x8c7a[_0x290531];return _0x61b8c0;};'use strict';var emlformat=require(_0xa8c7('0x0'));var rimraf=require(_0xa8c7('0x1'));var zipdir=require(_0xa8c7('0x2'));var jsonpatch=require(_0xa8c7('0x3'));var rp=require(_0xa8c7('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa8c7('0x5'));var path=require(_0xa8c7('0x6'));var sox=require(_0xa8c7('0x7'));var csv=require(_0xa8c7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa8c7('0x9'));var _=require(_0xa8c7('0xa'));var squel=require(_0xa8c7('0xb'));var crypto=require(_0xa8c7('0xc'));var jsforce=require(_0xa8c7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa8c7('0x8'));var querystring=require(_0xa8c7('0xe'));var Papa=require(_0xa8c7('0xf'));var Redis=require(_0xa8c7('0x10'));var authService=require(_0xa8c7('0x11'));var qs=require(_0xa8c7('0x12'));var as=require(_0xa8c7('0x13'));var hardwareService=require(_0xa8c7('0x14'));var logger=require(_0xa8c7('0x15'))(_0xa8c7('0x16'));var utils=require(_0xa8c7('0x17'));var config=require(_0xa8c7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa8c7('0x19'))['db'];config['redis']=_[_0xa8c7('0x1a')](config['redis'],{'host':_0xa8c7('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa8c7('0x1c')]));require('./smsMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xa8c7('0x1d')]({'port':0x232c});var client9002=jayson[_0xa8c7('0x1e')][_0xa8c7('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x74add8,_0x1dfa8f,_0x58b824,_0x3aa062){return new BPromise(function(_0x5d82b6,_0x5f30e2){var _0x1b5514=_0x3aa062||client;return _0x1b5514['request'](_0x74add8,_0x58b824)[_0xa8c7('0x1f')](function(_0x4a6db0){logger[_0xa8c7('0x20')](_0xa8c7('0x21'),_0x1dfa8f,_0xa8c7('0x22'));logger[_0xa8c7('0x23')](_0xa8c7('0x24'),_0x1dfa8f,_0xa8c7('0x22'),JSON[_0xa8c7('0x25')](_0x4a6db0));if(_0x4a6db0['error']){if(_0x4a6db0['error']['code']===0x1f4){logger[_0xa8c7('0x26')](_0xa8c7('0x21'),_0x1dfa8f,_0x4a6db0[_0xa8c7('0x26')]['message']);return _0x5f30e2(_0x4a6db0['error'][_0xa8c7('0x27')]);}logger['error'](_0xa8c7('0x21'),_0x1dfa8f,_0x4a6db0[_0xa8c7('0x26')]['message']);return _0x5d82b6(_0x4a6db0['error'][_0xa8c7('0x27')]);}else{logger['info'](_0xa8c7('0x21'),_0x1dfa8f,_0xa8c7('0x22'));_0x5d82b6(_0x4a6db0[_0xa8c7('0x28')][_0xa8c7('0x27')]);}})['catch'](function(_0x384a8d){logger[_0xa8c7('0x26')](_0xa8c7('0x21'),_0x1dfa8f,_0x384a8d);_0x5f30e2(_0x384a8d);});});}function respondWithStatusCode(_0x26c23d,_0x218a48){_0x218a48=_0x218a48||0xcc;return function(_0x387627){if(_0x387627){return _0x26c23d[_0xa8c7('0x29')](_0x218a48);}return _0x26c23d['status'](_0x218a48)[_0xa8c7('0x2a')]();};}function respondWithResult(_0x2cb8b2,_0x1239ea){_0x1239ea=_0x1239ea||0xc8;return function(_0x1c2232){if(_0x1c2232){return _0x2cb8b2[_0xa8c7('0x2b')](_0x1239ea)['json'](_0x1c2232);}};}function respondWithFilteredResult(_0x1161d7,_0x5d2c4b){return function(_0x3bc365){if(_0x3bc365){var _0x1aaf4a=typeof _0x5d2c4b['offset']===_0xa8c7('0x2c')&&typeof _0x5d2c4b['limit']===_0xa8c7('0x2c');var _0x15edd7=_0x3bc365['count'];var _0x344e96=_0x1aaf4a?0x0:_0x5d2c4b[_0xa8c7('0x2d')];var _0x35216d=_0x1aaf4a?_0x3bc365['count']:_0x5d2c4b[_0xa8c7('0x2d')]+_0x5d2c4b[_0xa8c7('0x2e')];var _0x586e5f;if(_0x35216d>=_0x15edd7){_0x35216d=_0x15edd7;_0x586e5f=0xc8;}else{_0x586e5f=0xce;}_0x1161d7[_0xa8c7('0x2b')](_0x586e5f);return _0x1161d7['set'](_0xa8c7('0x2f'),_0x344e96+'-'+_0x35216d+'/'+_0x15edd7)[_0xa8c7('0x30')](_0x3bc365);}return null;};}function patchUpdates(_0x3d16c5){return function(_0x1e8154){try{jsonpatch[_0xa8c7('0x31')](_0x1e8154,_0x3d16c5,!![]);}catch(_0x320ee2){return BPromise[_0xa8c7('0x32')](_0x320ee2);}return _0x1e8154['save']();};}function saveUpdates(_0x1a6e4e,_0x258c3a){return function(_0x2f097b){if(_0x2f097b){return _0x2f097b[_0xa8c7('0x33')](_0x1a6e4e)[_0xa8c7('0x1f')](function(_0xf16e8d){return _0xf16e8d;});}return null;};}function removeEntity(_0x4cecdf,_0x2250e7){return function(_0x474a05){if(_0x474a05){return _0x474a05[_0xa8c7('0x34')]()[_0xa8c7('0x1f')](function(){_0x4cecdf[_0xa8c7('0x2b')](0xcc)[_0xa8c7('0x2a')]();});}};}function handleEntityNotFound(_0x585028,_0x14833c){return function(_0x423a28){if(!_0x423a28){_0x585028[_0xa8c7('0x29')](0x194);}return _0x423a28;};}function handleError(_0x592474,_0x534ba7){_0x534ba7=_0x534ba7||0x1f4;return function(_0x3ec927){logger[_0xa8c7('0x26')](_0x3ec927['stack']);if(_0x3ec927[_0xa8c7('0x35')]){delete _0x3ec927['name'];}_0x592474[_0xa8c7('0x2b')](_0x534ba7)[_0xa8c7('0x36')](_0x3ec927);};}exports[_0xa8c7('0x37')]=function(_0x7c0990,_0x177b55){var _0x56e252={},_0x7b0db8={},_0x5b11e7={'count':0x0,'rows':[]};var _0x170af6=_[_0xa8c7('0x38')](db[_0xa8c7('0x39')]['rawAttributes'],function(_0x4eb706){return{'name':_0x4eb706[_0xa8c7('0x3a')],'type':_0x4eb706[_0xa8c7('0x3b')][_0xa8c7('0x3c')]};});_0x7b0db8[_0xa8c7('0x3d')]=_[_0xa8c7('0x38')](_0x170af6,_0xa8c7('0x35'));_0x7b0db8[_0xa8c7('0x3e')]=_[_0xa8c7('0x3f')](_0x7c0990[_0xa8c7('0x3e')]);_0x7b0db8[_0xa8c7('0x40')]=_['intersection'](_0x7b0db8[_0xa8c7('0x3d')],_0x7b0db8['query']);_0x56e252[_0xa8c7('0x41')]=_['intersection'](_0x7b0db8[_0xa8c7('0x3d')],qs[_0xa8c7('0x42')](_0x7c0990['query']['fields']));_0x56e252['attributes']=_0x56e252['attributes'][_0xa8c7('0x43')]?_0x56e252[_0xa8c7('0x41')]:_0x7b0db8[_0xa8c7('0x3d')];if(!_0x7c0990[_0xa8c7('0x3e')]['hasOwnProperty'](_0xa8c7('0x44'))){_0x56e252['limit']=qs[_0xa8c7('0x2e')](_0x7c0990['query'][_0xa8c7('0x2e')]);_0x56e252[_0xa8c7('0x2d')]=qs[_0xa8c7('0x2d')](_0x7c0990[_0xa8c7('0x3e')][_0xa8c7('0x2d')]);}_0x56e252[_0xa8c7('0x45')]=qs[_0xa8c7('0x46')](_0x7c0990[_0xa8c7('0x3e')]['sort']);_0x56e252[_0xa8c7('0x47')]=qs[_0xa8c7('0x40')](_[_0xa8c7('0x48')](_0x7c0990[_0xa8c7('0x3e')],_0x7b0db8[_0xa8c7('0x40')]),_0x170af6);if(_0x7c0990[_0xa8c7('0x3e')][_0xa8c7('0x49')]){_0x56e252[_0xa8c7('0x47')]=_[_0xa8c7('0x4a')](_0x56e252[_0xa8c7('0x47')],{'$or':_[_0xa8c7('0x38')](_0x170af6,function(_0x3a4f82){if(_0x3a4f82[_0xa8c7('0x3b')]!==_0xa8c7('0x4b')){var _0x51b450={};_0x51b450[_0x3a4f82[_0xa8c7('0x35')]]={'$like':'%'+_0x7c0990[_0xa8c7('0x3e')][_0xa8c7('0x49')]+'%'};return _0x51b450;}})});}_0x56e252=_['merge']({},_0x56e252,_0x7c0990[_0xa8c7('0x4c')]);var _0x1bbb13={'where':_0x56e252[_0xa8c7('0x47')]};return db['SmsMessage'][_0xa8c7('0x4d')](_0x1bbb13)[_0xa8c7('0x1f')](function(_0x4ad90e){_0x5b11e7[_0xa8c7('0x4d')]=_0x4ad90e;if(_0x7c0990[_0xa8c7('0x3e')][_0xa8c7('0x4e')]){_0x56e252[_0xa8c7('0x4f')]=[{'all':!![]}];}return db['SmsMessage'][_0xa8c7('0x50')](_0x56e252);})[_0xa8c7('0x1f')](function(_0x252f8f){_0x5b11e7[_0xa8c7('0x51')]=_0x252f8f;return _0x5b11e7;})[_0xa8c7('0x1f')](respondWithFilteredResult(_0x177b55,_0x56e252))['catch'](handleError(_0x177b55,null));};exports['show']=function(_0x16acad,_0x10e149){var _0x65331c={'raw':!![],'where':{'id':_0x16acad[_0xa8c7('0x52')]['id']}},_0x4a3fbe={};_0x4a3fbe[_0xa8c7('0x3d')]=_[_0xa8c7('0x3f')](db['SmsMessage'][_0xa8c7('0x53')]);_0x4a3fbe['query']=_[_0xa8c7('0x3f')](_0x16acad['query']);_0x4a3fbe[_0xa8c7('0x40')]=_[_0xa8c7('0x54')](_0x4a3fbe[_0xa8c7('0x3d')],_0x4a3fbe['query']);_0x65331c[_0xa8c7('0x41')]=_[_0xa8c7('0x54')](_0x4a3fbe[_0xa8c7('0x3d')],qs['fields'](_0x16acad[_0xa8c7('0x3e')][_0xa8c7('0x42')]));_0x65331c[_0xa8c7('0x41')]=_0x65331c[_0xa8c7('0x41')][_0xa8c7('0x43')]?_0x65331c[_0xa8c7('0x41')]:_0x4a3fbe[_0xa8c7('0x3d')];if(_0x16acad[_0xa8c7('0x3e')][_0xa8c7('0x4e')]){_0x65331c[_0xa8c7('0x4f')]=[{'all':!![]}];}_0x65331c=_[_0xa8c7('0x4a')]({},_0x65331c,_0x16acad[_0xa8c7('0x4c')]);return db[_0xa8c7('0x39')]['find'](_0x65331c)[_0xa8c7('0x1f')](handleEntityNotFound(_0x10e149,null))[_0xa8c7('0x1f')](respondWithResult(_0x10e149,null))['catch'](handleError(_0x10e149,null));};exports[_0xa8c7('0x55')]=function(_0x2e9ac9,_0x18792b){return db[_0xa8c7('0x39')][_0xa8c7('0x55')](_0x2e9ac9[_0xa8c7('0x56')],{})[_0xa8c7('0x1f')](respondWithResult(_0x18792b,0xc9))[_0xa8c7('0x57')](handleError(_0x18792b,null));};exports[_0xa8c7('0x33')]=function(_0x1943e3,_0x17ce05){if(_0x1943e3[_0xa8c7('0x56')]['id']){delete _0x1943e3[_0xa8c7('0x56')]['id'];}return db['SmsMessage'][_0xa8c7('0x58')]({'where':{'id':_0x1943e3[_0xa8c7('0x52')]['id']}})[_0xa8c7('0x1f')](handleEntityNotFound(_0x17ce05,null))[_0xa8c7('0x1f')](saveUpdates(_0x1943e3['body'],null))[_0xa8c7('0x1f')](respondWithResult(_0x17ce05,null))[_0xa8c7('0x57')](handleError(_0x17ce05,null));};exports['destroy']=function(_0x2492b1,_0x521e1d){return db['SmsMessage'][_0xa8c7('0x58')]({'where':{'id':_0x2492b1[_0xa8c7('0x52')]['id']}})[_0xa8c7('0x1f')](handleEntityNotFound(_0x521e1d,null))[_0xa8c7('0x1f')](removeEntity(_0x521e1d,null))['catch'](handleError(_0x521e1d,null));};exports[_0xa8c7('0x59')]=function(_0x231427,_0x5011b1){return db[_0xa8c7('0x39')][_0xa8c7('0x59')]()[_0xa8c7('0x1f')](respondWithResult(_0x5011b1,null))[_0xa8c7('0x57')](handleError(_0x5011b1,null));};var interaction_log=require('../../config/logger')(_0xa8c7('0x5a'));exports[_0xa8c7('0x5b')]=function(_0x3cccd5,_0x4906bb,_0x25d4d6){var _0x27b386={'agent':{},'channel':_0xa8c7('0x5c')};if(_0x3cccd5['body']['id']){delete _0x3cccd5['body']['id'];}_0x3cccd5[_0xa8c7('0x56')][_0xa8c7('0x5d')]=!![];_0x3cccd5[_0xa8c7('0x56')][_0xa8c7('0x5e')]=moment()[_0xa8c7('0x5f')](_0xa8c7('0x60'));_0x3cccd5[_0xa8c7('0x56')]['UserId']=_0x3cccd5[_0xa8c7('0x56')][_0xa8c7('0x61')]||_0x3cccd5[_0xa8c7('0x62')]['id'];_0x27b386['agent']['id']=_0x3cccd5[_0xa8c7('0x56')]['UserId'];return db['SmsMessage'][_0xa8c7('0x58')]({'where':{'id':_0x3cccd5[_0xa8c7('0x52')]['id'],'UserId':null}})[_0xa8c7('0x1f')](handleEntityNotFound(_0x4906bb,null))[_0xa8c7('0x1f')](saveUpdates(_0x3cccd5['body'],null))[_0xa8c7('0x1f')](function(_0x522810){if(_0x522810){_0x27b386[_0xa8c7('0x27')]=_0x522810[_0xa8c7('0x63')]({'plain':!![]});return db[_0xa8c7('0x64')][_0xa8c7('0x58')]({'where':{'id':_0x522810[_0xa8c7('0x65')]}});}return null;})[_0xa8c7('0x1f')](handleEntityNotFound(_0x4906bb,null))[_0xa8c7('0x1f')](function(_0x4406b0){if(_0x4406b0){return _0x4406b0[_0xa8c7('0x33')]({'UserId':_0x3cccd5['body'][_0xa8c7('0x61')],'read1stAt':_['isNil'](_0x4406b0['read1stAt'])?moment()[_0xa8c7('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x3f446b){if(_0x3f446b){_0x27b386[_0xa8c7('0x66')]=_0x3f446b[_0xa8c7('0x63')]({'plain':!![]});interaction_log[_0xa8c7('0x20')](_0xa8c7('0x67'),_0x3cccd5[_0xa8c7('0x62')]['id'],_0x3cccd5[_0xa8c7('0x62')][_0xa8c7('0x35')],_0x3cccd5[_0xa8c7('0x62')][_0xa8c7('0x68')],_0x27b386[_0xa8c7('0x66')]['id'],_0x3cccd5['body']?JSON[_0xa8c7('0x25')](_0x3cccd5['body']):_0xa8c7('0x69'));return respondWithRpcPromise(_0xa8c7('0x6a'),_0xa8c7('0x6b'),_0x27b386);}return null;})[_0xa8c7('0x1f')](function(_0xc7efb2){var _0x116001=_0xa8c7('0x6c')+_0xc7efb2[_0xa8c7('0x27')]['ContactId'];return db[_0xa8c7('0x6d')][_0xa8c7('0x3e')](_0x116001,{'type':db[_0xa8c7('0x6e')]['QueryTypes'][_0xa8c7('0x6f')],'raw':!![]})[_0xa8c7('0x1f')](function(_0x36f633){return _0x36f633;});})['then'](function(_0x2e5436){if(_0x2e5436){_0x27b386[_0xa8c7('0x27')][_0xa8c7('0x70')]=_0x2e5436[0x0];if(!_0x3cccd5['body'][_0xa8c7('0x61')])return;return db[_0xa8c7('0x71')][_0xa8c7('0x58')]({'where':{'id':_0x3cccd5['body']['UserId'],'role':_0xa8c7('0x72')},'attributes':['id',_0xa8c7('0x35'),_0xa8c7('0x73'),_0xa8c7('0x74'),_0xa8c7('0x75')],'raw':!![]});}return null;})[_0xa8c7('0x1f')](function(_0x31e989){if(!_0x31e989)return null;_0x27b386[_0xa8c7('0x27')][_0xa8c7('0x72')]=_0x31e989;return _0x27b386;})[_0xa8c7('0x1f')](function(_0x1402ac){if(_0x1402ac){if(_0x3cccd5[_0xa8c7('0x56')][_0xa8c7('0x76')]){_0x27b386[_0xa8c7('0x27')]['interface']=util[_0xa8c7('0x5f')]('SIP/%s',_0x3cccd5['user'][_0xa8c7('0x35')]);_0x27b386[_0xa8c7('0x27')][_0xa8c7('0x77')]=_0x27b386[_0xa8c7('0x77')];_0x27b386[_0xa8c7('0x27')][_0xa8c7('0x78')]=_0x27b386['channel'];_0x27b386[_0xa8c7('0x27')][_0xa8c7('0x79')]='accept';return respondWithRpcPromise(_0xa8c7('0x7a'),'EventManager',{'event':_0xa8c7('0x7b'),'message':_0x27b386[_0xa8c7('0x27')]},client9002)[_0xa8c7('0x1f')](function(){return _0x27b386;});}return _0x27b386;}return null;})[_0xa8c7('0x1f')](respondWithResult(_0x4906bb,null))[_0xa8c7('0x57')](handleError(_0x4906bb,null));};var interaction_log=require(_0xa8c7('0x15'))(_0xa8c7('0x5a'));exports[_0xa8c7('0x32')]=function(_0x12bf10,_0x82a146,_0x9406f0){var _0xf5cc93={'agent':{},'channel':_0xa8c7('0x5c')};if(_0x12bf10[_0xa8c7('0x56')]['id']){delete _0x12bf10[_0xa8c7('0x56')]['id'];}_0x12bf10[_0xa8c7('0x56')][_0xa8c7('0x61')]=_0x12bf10[_0xa8c7('0x56')][_0xa8c7('0x61')]||_0x12bf10['user']['id'];_0xf5cc93['agent']['id']=_0x12bf10[_0xa8c7('0x56')][_0xa8c7('0x61')];return db[_0xa8c7('0x39')][_0xa8c7('0x58')]({'where':{'id':_0x12bf10[_0xa8c7('0x52')]['id'],'UserId':null}})[_0xa8c7('0x1f')](handleEntityNotFound(_0x82a146,null))[_0xa8c7('0x1f')](function(_0x2483a8){if(_0x2483a8){_0xf5cc93[_0xa8c7('0x27')]=_0x2483a8[_0xa8c7('0x63')]({'plain':!![]});return db[_0xa8c7('0x64')]['find']({'where':{'id':_0x2483a8[_0xa8c7('0x65')]}});}return null;})[_0xa8c7('0x1f')](handleEntityNotFound(_0x82a146,null))[_0xa8c7('0x1f')](function(_0x4bcc48){if(_0x4bcc48){_0xf5cc93[_0xa8c7('0x66')]=_0x4bcc48['get']({'plain':!![]});interaction_log[_0xa8c7('0x20')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x12bf10[_0xa8c7('0x62')]['id'],_0x12bf10[_0xa8c7('0x62')][_0xa8c7('0x35')],_0x12bf10['user'][_0xa8c7('0x68')],_0xf5cc93[_0xa8c7('0x66')]['id'],_0x12bf10[_0xa8c7('0x56')]?JSON[_0xa8c7('0x25')](_0x12bf10[_0xa8c7('0x56')]):'null');return respondWithRpcPromise(_0xa8c7('0x7c'),_0xa8c7('0x7d'),_0xf5cc93);}return null;})[_0xa8c7('0x1f')](function(_0x118abb){var _0x4e3e0f=_0xa8c7('0x6c')+_0x118abb[_0xa8c7('0x27')][_0xa8c7('0x7e')];return db[_0xa8c7('0x6d')][_0xa8c7('0x3e')](_0x4e3e0f,{'type':db[_0xa8c7('0x6e')]['QueryTypes'][_0xa8c7('0x6f')],'raw':!![]})[_0xa8c7('0x1f')](function(_0x1c9558){return _0x1c9558;});})[_0xa8c7('0x1f')](function(_0x12b55c){if(_0x12b55c){_0xf5cc93[_0xa8c7('0x27')][_0xa8c7('0x70')]=_0x12b55c[0x0];if(!_0x12bf10[_0xa8c7('0x56')][_0xa8c7('0x61')])return;return db[_0xa8c7('0x71')][_0xa8c7('0x58')]({'where':{'id':_0x12bf10[_0xa8c7('0x56')]['UserId'],'role':_0xa8c7('0x72')},'attributes':['id',_0xa8c7('0x35'),_0xa8c7('0x73'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x2a60c5){if(!_0x2a60c5)return null;_0xf5cc93[_0xa8c7('0x27')][_0xa8c7('0x72')]=_0x2a60c5;return _0xf5cc93;})[_0xa8c7('0x1f')](function(_0x47d824){if(_0x47d824){_0x47d824[_0xa8c7('0x27')][_0xa8c7('0x7f')]=util[_0xa8c7('0x5f')](_0xa8c7('0x80'),_0x12bf10[_0xa8c7('0x62')][_0xa8c7('0x35')]);_0x47d824['message'][_0xa8c7('0x77')]=_0xf5cc93['channel'];_0x47d824[_0xa8c7('0x27')][_0xa8c7('0x78')]=_0xf5cc93[_0xa8c7('0x77')];_0x47d824['message']['event']=_0xa8c7('0x32');respondWithRpcPromise('EventManager',_0xa8c7('0x7a'),{'event':'rejectmessage','message':_0x47d824[_0xa8c7('0x27')]},client9002);return _0xf5cc93;}return null;})['then'](respondWithResult(_0x82a146,null))[_0xa8c7('0x57')](handleError(_0x82a146,null));};exports[_0xa8c7('0x2b')]=function(_0x46e64f,_0x444843,_0x27148c){if(_0x46e64f[_0xa8c7('0x56')]['id']){delete _0x46e64f[_0xa8c7('0x56')]['id'];}var _0x174be8;return db[_0xa8c7('0x39')][_0xa8c7('0x58')]({'where':{'id':_0x46e64f[_0xa8c7('0x52')]['id']}})[_0xa8c7('0x1f')](handleEntityNotFound(_0x444843,null))[_0xa8c7('0x1f')](function(_0x3389a7){if(_0x3389a7){_0x174be8=_0x3389a7;return db[_0xa8c7('0x81')][_0xa8c7('0x58')]({'where':{'id':_0x3389a7[_0xa8c7('0x82')]}});}})[_0xa8c7('0x1f')](handleEntityNotFound(_0x444843,null))[_0xa8c7('0x1f')](function(_0x3e611b){if(_0x3e611b){logger[_0xa8c7('0x23')](_0xa8c7('0x24'),_0xa8c7('0x2b'),'received\x20delivery\x20report\x20from',_0x3e611b['type'],util[_0xa8c7('0x83')](_0x46e64f['body'],{'showHidden':![],'depth':null}));switch(_0x3e611b[_0xa8c7('0x3b')]){case'twilio':if(_0x46e64f[_0xa8c7('0x56')][_0xa8c7('0x84')]&&_0x46e64f[_0xa8c7('0x56')][_0xa8c7('0x84')]===_0x174be8['messageId']){return _0x174be8['update']({'read':!![]});}else{logger[_0xa8c7('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa8c7('0x2b'),_0xa8c7('0x85'),util[_0xa8c7('0x83')](_0x46e64f[_0xa8c7('0x56')],{'showHidden':![],'depth':null}));}break;case _0xa8c7('0x86'):if(_0x46e64f[_0xa8c7('0x56')][_0xa8c7('0x87')]&&_0x46e64f[_0xa8c7('0x56')][_0xa8c7('0x87')]===_0x174be8[_0xa8c7('0x88')]&&_['indexOf']([_0xa8c7('0x89'),'delivered'],_0x46e64f[_0xa8c7('0x56')][_0xa8c7('0x8a')])>=0x0){return _0x174be8[_0xa8c7('0x33')]({'read':!![]});}else{logger[_0xa8c7('0x26')](_0xa8c7('0x8b'),_0xa8c7('0x2b'),_0xa8c7('0x8c'),util[_0xa8c7('0x83')](_0x46e64f['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x1270d6=_0x46e64f[_0xa8c7('0x56')][_0xa8c7('0x8d')][0x0];if(_0x1270d6[_0xa8c7('0x2b')][_0xa8c7('0x8e')]===_0xa8c7('0x8f')){return _0x174be8['update']({'read':!![]});}else{logger[_0xa8c7('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xa8c7('0x90'),util['inspect'](_0x46e64f[_0xa8c7('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x174be8;}})[_0xa8c7('0x1f')](respondWithResult(_0x444843,null))[_0xa8c7('0x57')](handleError(_0x444843,null));}; \ No newline at end of file +var _0xd0f5=['pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','find','create','body','params','describe','sms-interactions','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','interface','SIP/%s','motionChannel','channel','event','accept','EventManager','acceptmessage','reject','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','messageId','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','save','update','destroy','stack','name','send','SmsMessage','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where'];(function(_0x127ba9,_0x22b632){var _0x16499e=function(_0x356beb){while(--_0x356beb){_0x127ba9['push'](_0x127ba9['shift']());}};_0x16499e(++_0x22b632);}(_0xd0f5,0xda));var _0x5d0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0f5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5d0f('0x0'));var rimraf=require(_0x5d0f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5d0f('0x2'));var rp=require(_0x5d0f('0x3'));var moment=require(_0x5d0f('0x4'));var BPromise=require(_0x5d0f('0x5'));var Mustache=require(_0x5d0f('0x6'));var util=require(_0x5d0f('0x7'));var path=require(_0x5d0f('0x8'));var sox=require(_0x5d0f('0x9'));var csv=require('to-csv');var ejs=require(_0x5d0f('0xa'));var fs=require('fs');var fs_extra=require(_0x5d0f('0xb'));var _=require('lodash');var squel=require(_0x5d0f('0xc'));var crypto=require(_0x5d0f('0xd'));var jsforce=require(_0x5d0f('0xe'));var deskjs=require(_0x5d0f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5d0f('0x10'));var Papa=require(_0x5d0f('0x11'));var Redis=require(_0x5d0f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5d0f('0x13'));var as=require(_0x5d0f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d0f('0x15'))(_0x5d0f('0x16'));var utils=require('../../config/utils');var config=require(_0x5d0f('0x17'));var licenseUtil=require(_0x5d0f('0x18'));var db=require(_0x5d0f('0x19'))['db'];config[_0x5d0f('0x1a')]=_['defaults'](config['redis'],{'host':_0x5d0f('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d0f('0x1a')]));require(_0x5d0f('0x1c'))[_0x5d0f('0x1d')](socket);var jayson=require(_0x5d0f('0x1e'));var client=jayson[_0x5d0f('0x1f')][_0x5d0f('0x20')]({'port':0x232c});var client9002=jayson[_0x5d0f('0x1f')][_0x5d0f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2ba72a,_0x1d7fda,_0x100b97,_0x5cb37a){return new BPromise(function(_0x47c318,_0x35ed91){var _0xd618b=_0x5cb37a||client;return _0xd618b[_0x5d0f('0x21')](_0x2ba72a,_0x100b97)[_0x5d0f('0x22')](function(_0x47a362){logger[_0x5d0f('0x23')](_0x5d0f('0x24'),_0x1d7fda,_0x5d0f('0x25'));logger[_0x5d0f('0x26')](_0x5d0f('0x27'),_0x1d7fda,_0x5d0f('0x25'),JSON[_0x5d0f('0x28')](_0x47a362));if(_0x47a362[_0x5d0f('0x29')]){if(_0x47a362['error'][_0x5d0f('0x2a')]===0x1f4){logger[_0x5d0f('0x29')](_0x5d0f('0x24'),_0x1d7fda,_0x47a362[_0x5d0f('0x29')][_0x5d0f('0x2b')]);return _0x35ed91(_0x47a362[_0x5d0f('0x29')][_0x5d0f('0x2b')]);}logger[_0x5d0f('0x29')]('SmsMessage,\x20%s,\x20%s',_0x1d7fda,_0x47a362['error'][_0x5d0f('0x2b')]);return _0x47c318(_0x47a362[_0x5d0f('0x29')]['message']);}else{logger[_0x5d0f('0x23')](_0x5d0f('0x24'),_0x1d7fda,_0x5d0f('0x25'));_0x47c318(_0x47a362['result'][_0x5d0f('0x2b')]);}})[_0x5d0f('0x2c')](function(_0x50a23e){logger[_0x5d0f('0x29')](_0x5d0f('0x24'),_0x1d7fda,_0x50a23e);_0x35ed91(_0x50a23e);});});}function respondWithStatusCode(_0x1f4af5,_0x1be7ae){_0x1be7ae=_0x1be7ae||0xcc;return function(_0x34985a){if(_0x34985a){return _0x1f4af5[_0x5d0f('0x2d')](_0x1be7ae);}return _0x1f4af5[_0x5d0f('0x2e')](_0x1be7ae)[_0x5d0f('0x2f')]();};}function respondWithResult(_0x16fcf8,_0x1facaf){_0x1facaf=_0x1facaf||0xc8;return function(_0x107612){if(_0x107612){return _0x16fcf8[_0x5d0f('0x2e')](_0x1facaf)['json'](_0x107612);}};}function respondWithFilteredResult(_0x3886f8,_0x53c8cf){return function(_0x2a2c0e){if(_0x2a2c0e){var _0x422e63=typeof _0x53c8cf['offset']===_0x5d0f('0x30')&&typeof _0x53c8cf[_0x5d0f('0x31')]===_0x5d0f('0x30');var _0x527cc4=_0x2a2c0e[_0x5d0f('0x32')];var _0x2ad5b5=_0x422e63?0x0:_0x53c8cf['offset'];var _0x422db7=_0x422e63?_0x2a2c0e[_0x5d0f('0x32')]:_0x53c8cf[_0x5d0f('0x33')]+_0x53c8cf[_0x5d0f('0x31')];var _0x418d38;if(_0x422db7>=_0x527cc4){_0x422db7=_0x527cc4;_0x418d38=0xc8;}else{_0x418d38=0xce;}_0x3886f8['status'](_0x418d38);return _0x3886f8['set'](_0x5d0f('0x34'),_0x2ad5b5+'-'+_0x422db7+'/'+_0x527cc4)[_0x5d0f('0x35')](_0x2a2c0e);}return null;};}function patchUpdates(_0x13207d){return function(_0x34f84b){try{jsonpatch[_0x5d0f('0x36')](_0x34f84b,_0x13207d,!![]);}catch(_0x5ec223){return BPromise['reject'](_0x5ec223);}return _0x34f84b[_0x5d0f('0x37')]();};}function saveUpdates(_0x230fe7,_0x5a1e36){return function(_0x5f039d){if(_0x5f039d){return _0x5f039d[_0x5d0f('0x38')](_0x230fe7)[_0x5d0f('0x22')](function(_0x1deb01){return _0x1deb01;});}return null;};}function removeEntity(_0x631bd7,_0x5b68c6){return function(_0x34ca83){if(_0x34ca83){return _0x34ca83[_0x5d0f('0x39')]()[_0x5d0f('0x22')](function(){_0x631bd7[_0x5d0f('0x2e')](0xcc)[_0x5d0f('0x2f')]();});}};}function handleEntityNotFound(_0x406013,_0x287431){return function(_0x15e812){if(!_0x15e812){_0x406013[_0x5d0f('0x2d')](0x194);}return _0x15e812;};}function handleError(_0x2455af,_0x3b2e11){_0x3b2e11=_0x3b2e11||0x1f4;return function(_0x56f5a2){logger[_0x5d0f('0x29')](_0x56f5a2[_0x5d0f('0x3a')]);if(_0x56f5a2[_0x5d0f('0x3b')]){delete _0x56f5a2['name'];}_0x2455af['status'](_0x3b2e11)[_0x5d0f('0x3c')](_0x56f5a2);};}exports['index']=function(_0x51ad2b,_0x396cd0){var _0x1f1441={},_0x5dbe8f={},_0x42ca3a={'count':0x0,'rows':[]};var _0x190c0e=_['map'](db[_0x5d0f('0x3d')][_0x5d0f('0x3e')],function(_0x2d9f46){return{'name':_0x2d9f46[_0x5d0f('0x3f')],'type':_0x2d9f46[_0x5d0f('0x40')][_0x5d0f('0x41')]};});_0x5dbe8f['model']=_[_0x5d0f('0x42')](_0x190c0e,_0x5d0f('0x3b'));_0x5dbe8f[_0x5d0f('0x43')]=_[_0x5d0f('0x44')](_0x51ad2b[_0x5d0f('0x43')]);_0x5dbe8f['filters']=_[_0x5d0f('0x45')](_0x5dbe8f[_0x5d0f('0x46')],_0x5dbe8f[_0x5d0f('0x43')]);_0x1f1441[_0x5d0f('0x47')]=_[_0x5d0f('0x45')](_0x5dbe8f[_0x5d0f('0x46')],qs['fields'](_0x51ad2b['query'][_0x5d0f('0x48')]));_0x1f1441[_0x5d0f('0x47')]=_0x1f1441[_0x5d0f('0x47')][_0x5d0f('0x49')]?_0x1f1441[_0x5d0f('0x47')]:_0x5dbe8f['model'];if(!_0x51ad2b['query'][_0x5d0f('0x4a')]('nolimit')){_0x1f1441[_0x5d0f('0x31')]=qs[_0x5d0f('0x31')](_0x51ad2b[_0x5d0f('0x43')][_0x5d0f('0x31')]);_0x1f1441[_0x5d0f('0x33')]=qs['offset'](_0x51ad2b[_0x5d0f('0x43')][_0x5d0f('0x33')]);}_0x1f1441[_0x5d0f('0x4b')]=qs[_0x5d0f('0x4c')](_0x51ad2b[_0x5d0f('0x43')]['sort']);_0x1f1441[_0x5d0f('0x4d')]=qs['filters'](_[_0x5d0f('0x4e')](_0x51ad2b['query'],_0x5dbe8f['filters']),_0x190c0e);if(_0x51ad2b['query'][_0x5d0f('0x4f')]){_0x1f1441[_0x5d0f('0x4d')]=_[_0x5d0f('0x50')](_0x1f1441['where'],{'$or':_[_0x5d0f('0x42')](_0x190c0e,function(_0x16e726){if(_0x16e726[_0x5d0f('0x40')]!==_0x5d0f('0x51')){var _0x123b84={};_0x123b84[_0x16e726[_0x5d0f('0x3b')]]={'$like':'%'+_0x51ad2b['query']['filter']+'%'};return _0x123b84;}})});}_0x1f1441=_[_0x5d0f('0x50')]({},_0x1f1441,_0x51ad2b[_0x5d0f('0x52')]);var _0x2c5bd1={'where':_0x1f1441['where']};return db[_0x5d0f('0x3d')][_0x5d0f('0x32')](_0x2c5bd1)[_0x5d0f('0x22')](function(_0x445148){_0x42ca3a[_0x5d0f('0x32')]=_0x445148;if(_0x51ad2b[_0x5d0f('0x43')][_0x5d0f('0x53')]){_0x1f1441[_0x5d0f('0x54')]=[{'all':!![]}];}return db[_0x5d0f('0x3d')][_0x5d0f('0x55')](_0x1f1441);})[_0x5d0f('0x22')](function(_0x5caa1d){_0x42ca3a['rows']=_0x5caa1d;return _0x42ca3a;})['then'](respondWithFilteredResult(_0x396cd0,_0x1f1441))[_0x5d0f('0x2c')](handleError(_0x396cd0,null));};exports['show']=function(_0x32daf7,_0x37f9b1){var _0x4e009a={'raw':!![],'where':{'id':_0x32daf7['params']['id']}},_0x147074={};_0x147074[_0x5d0f('0x46')]=_[_0x5d0f('0x44')](db[_0x5d0f('0x3d')]['rawAttributes']);_0x147074[_0x5d0f('0x43')]=_[_0x5d0f('0x44')](_0x32daf7[_0x5d0f('0x43')]);_0x147074['filters']=_[_0x5d0f('0x45')](_0x147074['model'],_0x147074[_0x5d0f('0x43')]);_0x4e009a[_0x5d0f('0x47')]=_[_0x5d0f('0x45')](_0x147074[_0x5d0f('0x46')],qs[_0x5d0f('0x48')](_0x32daf7[_0x5d0f('0x43')]['fields']));_0x4e009a['attributes']=_0x4e009a['attributes'][_0x5d0f('0x49')]?_0x4e009a[_0x5d0f('0x47')]:_0x147074[_0x5d0f('0x46')];if(_0x32daf7['query'][_0x5d0f('0x53')]){_0x4e009a[_0x5d0f('0x54')]=[{'all':!![]}];}_0x4e009a=_[_0x5d0f('0x50')]({},_0x4e009a,_0x32daf7[_0x5d0f('0x52')]);return db[_0x5d0f('0x3d')][_0x5d0f('0x56')](_0x4e009a)[_0x5d0f('0x22')](handleEntityNotFound(_0x37f9b1,null))[_0x5d0f('0x22')](respondWithResult(_0x37f9b1,null))[_0x5d0f('0x2c')](handleError(_0x37f9b1,null));};exports['create']=function(_0x5f5820,_0x55a865){return db[_0x5d0f('0x3d')][_0x5d0f('0x57')](_0x5f5820['body'],{})['then'](respondWithResult(_0x55a865,0xc9))['catch'](handleError(_0x55a865,null));};exports['update']=function(_0x21eadd,_0x4c05fc){if(_0x21eadd[_0x5d0f('0x58')]['id']){delete _0x21eadd[_0x5d0f('0x58')]['id'];}return db[_0x5d0f('0x3d')][_0x5d0f('0x56')]({'where':{'id':_0x21eadd['params']['id']}})[_0x5d0f('0x22')](handleEntityNotFound(_0x4c05fc,null))['then'](saveUpdates(_0x21eadd[_0x5d0f('0x58')],null))[_0x5d0f('0x22')](respondWithResult(_0x4c05fc,null))['catch'](handleError(_0x4c05fc,null));};exports[_0x5d0f('0x39')]=function(_0x25bf32,_0x145af9){return db['SmsMessage'][_0x5d0f('0x56')]({'where':{'id':_0x25bf32[_0x5d0f('0x59')]['id']}})[_0x5d0f('0x22')](handleEntityNotFound(_0x145af9,null))[_0x5d0f('0x22')](removeEntity(_0x145af9,null))[_0x5d0f('0x2c')](handleError(_0x145af9,null));};exports['describe']=function(_0x426557,_0x1ebf87){return db[_0x5d0f('0x3d')][_0x5d0f('0x5a')]()[_0x5d0f('0x22')](respondWithResult(_0x1ebf87,null))[_0x5d0f('0x2c')](handleError(_0x1ebf87,null));};var interaction_log=require(_0x5d0f('0x15'))(_0x5d0f('0x5b'));exports['accept']=function(_0x4d7075,_0x1e39de,_0x200c85){var _0x5351de={'agent':{},'channel':'sms'};if(_0x4d7075[_0x5d0f('0x58')]['id']){delete _0x4d7075[_0x5d0f('0x58')]['id'];}_0x4d7075[_0x5d0f('0x58')][_0x5d0f('0x5c')]=!![];_0x4d7075['body']['readAt']=moment()[_0x5d0f('0x5d')](_0x5d0f('0x5e'));_0x4d7075[_0x5d0f('0x58')][_0x5d0f('0x5f')]=_0x4d7075[_0x5d0f('0x58')]['UserId']||_0x4d7075[_0x5d0f('0x60')]['id'];_0x5351de[_0x5d0f('0x61')]['id']=_0x4d7075['body'][_0x5d0f('0x5f')];return db['SmsMessage']['find']({'where':{'id':_0x4d7075[_0x5d0f('0x59')]['id'],'UserId':null}})[_0x5d0f('0x22')](handleEntityNotFound(_0x1e39de,null))['then'](saveUpdates(_0x4d7075[_0x5d0f('0x58')],null))[_0x5d0f('0x22')](function(_0x401cf7){if(_0x401cf7){_0x5351de['message']=_0x401cf7[_0x5d0f('0x62')]({'plain':!![]});return db[_0x5d0f('0x63')]['find']({'where':{'id':_0x401cf7[_0x5d0f('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x1e39de,null))[_0x5d0f('0x22')](function(_0x320d15){if(_0x320d15){return _0x320d15[_0x5d0f('0x38')]({'UserId':_0x4d7075[_0x5d0f('0x58')][_0x5d0f('0x5f')],'read1stAt':_[_0x5d0f('0x65')](_0x320d15[_0x5d0f('0x66')])?moment()[_0x5d0f('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5d0f('0x22')](function(_0x19ef20){if(_0x19ef20){_0x5351de[_0x5d0f('0x67')]=_0x19ef20['get']({'plain':!![]});interaction_log['info'](_0x5d0f('0x68'),_0x4d7075['user']['id'],_0x4d7075[_0x5d0f('0x60')][_0x5d0f('0x3b')],_0x4d7075['user']['role'],_0x5351de[_0x5d0f('0x67')]['id'],_0x4d7075[_0x5d0f('0x58')]?JSON['stringify'](_0x4d7075[_0x5d0f('0x58')]):_0x5d0f('0x69'));return respondWithRpcPromise('AcceptMessage',_0x5d0f('0x6a'),_0x5351de);}return null;})[_0x5d0f('0x22')](function(_0x308723){var _0x354331=_0x5d0f('0x6b')+_0x308723[_0x5d0f('0x2b')][_0x5d0f('0x6c')];return db[_0x5d0f('0x6d')]['query'](_0x354331,{'type':db[_0x5d0f('0x6e')][_0x5d0f('0x6f')][_0x5d0f('0x70')],'raw':!![]})[_0x5d0f('0x22')](function(_0x6a1b11){return _0x6a1b11;});})[_0x5d0f('0x22')](function(_0x3368e0){if(_0x3368e0){_0x5351de[_0x5d0f('0x2b')]['contact']=_0x3368e0[0x0];if(!_0x4d7075[_0x5d0f('0x58')]['UserId'])return;return db['User'][_0x5d0f('0x56')]({'where':{'id':_0x4d7075['body']['UserId'],'role':_0x5d0f('0x61')},'attributes':['id',_0x5d0f('0x3b'),_0x5d0f('0x71'),_0x5d0f('0x72'),_0x5d0f('0x73')],'raw':!![]});}return null;})[_0x5d0f('0x22')](function(_0x3377a2){if(!_0x3377a2)return null;_0x5351de[_0x5d0f('0x2b')]['agent']=_0x3377a2;return _0x5351de;})[_0x5d0f('0x22')](function(_0x16dd6e){if(_0x16dd6e){if(_0x4d7075[_0x5d0f('0x58')]['manual']){_0x5351de[_0x5d0f('0x2b')][_0x5d0f('0x74')]=util['format'](_0x5d0f('0x75'),_0x4d7075[_0x5d0f('0x60')][_0x5d0f('0x3b')]);_0x5351de[_0x5d0f('0x2b')]['channel']=_0x5351de['channel'];_0x5351de[_0x5d0f('0x2b')][_0x5d0f('0x76')]=_0x5351de[_0x5d0f('0x77')];_0x5351de[_0x5d0f('0x2b')][_0x5d0f('0x78')]=_0x5d0f('0x79');return respondWithRpcPromise(_0x5d0f('0x7a'),_0x5d0f('0x7a'),{'event':_0x5d0f('0x7b'),'message':_0x5351de[_0x5d0f('0x2b')]},client9002)[_0x5d0f('0x22')](function(){return _0x5351de;});}return _0x5351de;}return null;})[_0x5d0f('0x22')](respondWithResult(_0x1e39de,null))[_0x5d0f('0x2c')](handleError(_0x1e39de,null));};var interaction_log=require('../../config/logger')(_0x5d0f('0x5b'));exports[_0x5d0f('0x7c')]=function(_0x2f9f9d,_0x238030,_0x4f6fb2){var _0x40cbd4={'agent':{},'channel':_0x5d0f('0x7d')};if(_0x2f9f9d[_0x5d0f('0x58')]['id']){delete _0x2f9f9d[_0x5d0f('0x58')]['id'];}_0x2f9f9d[_0x5d0f('0x58')][_0x5d0f('0x5f')]=_0x2f9f9d[_0x5d0f('0x58')][_0x5d0f('0x5f')]||_0x2f9f9d['user']['id'];_0x40cbd4[_0x5d0f('0x61')]['id']=_0x2f9f9d[_0x5d0f('0x58')][_0x5d0f('0x5f')];return db[_0x5d0f('0x3d')][_0x5d0f('0x56')]({'where':{'id':_0x2f9f9d['params']['id'],'UserId':null}})[_0x5d0f('0x22')](handleEntityNotFound(_0x238030,null))[_0x5d0f('0x22')](function(_0x2ac3e0){if(_0x2ac3e0){_0x40cbd4['message']=_0x2ac3e0[_0x5d0f('0x62')]({'plain':!![]});return db['SmsInteraction'][_0x5d0f('0x56')]({'where':{'id':_0x2ac3e0['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x238030,null))['then'](function(_0x41d38e){if(_0x41d38e){_0x40cbd4['interaction']=_0x41d38e[_0x5d0f('0x62')]({'plain':!![]});interaction_log[_0x5d0f('0x23')](_0x5d0f('0x7e'),_0x2f9f9d['user']['id'],_0x2f9f9d[_0x5d0f('0x60')][_0x5d0f('0x3b')],_0x2f9f9d[_0x5d0f('0x60')]['role'],_0x40cbd4[_0x5d0f('0x67')]['id'],_0x2f9f9d[_0x5d0f('0x58')]?JSON[_0x5d0f('0x28')](_0x2f9f9d['body']):_0x5d0f('0x69'));return respondWithRpcPromise(_0x5d0f('0x7f'),_0x5d0f('0x80'),_0x40cbd4);}return null;})['then'](function(_0x4adc2b){var _0x18ccad=_0x5d0f('0x6b')+_0x4adc2b[_0x5d0f('0x2b')][_0x5d0f('0x6c')];return db[_0x5d0f('0x6d')][_0x5d0f('0x43')](_0x18ccad,{'type':db[_0x5d0f('0x6e')]['QueryTypes'][_0x5d0f('0x70')],'raw':!![]})['then'](function(_0x1f1dac){return _0x1f1dac;});})[_0x5d0f('0x22')](function(_0x496741){if(_0x496741){_0x40cbd4[_0x5d0f('0x2b')]['contact']=_0x496741[0x0];if(!_0x2f9f9d['body'][_0x5d0f('0x5f')])return;return db[_0x5d0f('0x81')][_0x5d0f('0x56')]({'where':{'id':_0x2f9f9d['body'][_0x5d0f('0x5f')],'role':_0x5d0f('0x61')},'attributes':['id',_0x5d0f('0x3b'),'fullname','email',_0x5d0f('0x73')],'raw':!![]});}return null;})['then'](function(_0x1e12d8){if(!_0x1e12d8)return null;_0x40cbd4['message'][_0x5d0f('0x61')]=_0x1e12d8;return _0x40cbd4;})['then'](function(_0x583806){if(_0x583806){_0x583806['message'][_0x5d0f('0x74')]=util['format'](_0x5d0f('0x75'),_0x2f9f9d[_0x5d0f('0x60')][_0x5d0f('0x3b')]);_0x583806[_0x5d0f('0x2b')][_0x5d0f('0x77')]=_0x40cbd4['channel'];_0x583806[_0x5d0f('0x2b')][_0x5d0f('0x76')]=_0x40cbd4[_0x5d0f('0x77')];_0x583806[_0x5d0f('0x2b')][_0x5d0f('0x78')]='reject';respondWithRpcPromise(_0x5d0f('0x7a'),_0x5d0f('0x7a'),{'event':_0x5d0f('0x82'),'message':_0x583806[_0x5d0f('0x2b')]},client9002);return _0x40cbd4;}return null;})[_0x5d0f('0x22')](respondWithResult(_0x238030,null))[_0x5d0f('0x2c')](handleError(_0x238030,null));};exports[_0x5d0f('0x2e')]=function(_0xe0207d,_0x22d4ea,_0x55307f){if(_0xe0207d[_0x5d0f('0x58')]['id']){delete _0xe0207d[_0x5d0f('0x58')]['id'];}var _0x335ca9;return db[_0x5d0f('0x3d')][_0x5d0f('0x56')]({'where':{'id':_0xe0207d[_0x5d0f('0x59')]['id']}})['then'](handleEntityNotFound(_0x22d4ea,null))[_0x5d0f('0x22')](function(_0xd2ba22){if(_0xd2ba22){_0x335ca9=_0xd2ba22;return db[_0x5d0f('0x83')]['find']({'where':{'id':_0xd2ba22[_0x5d0f('0x84')]}});}})[_0x5d0f('0x22')](handleEntityNotFound(_0x22d4ea,null))[_0x5d0f('0x22')](function(_0x325117){if(_0x325117){logger[_0x5d0f('0x26')](_0x5d0f('0x27'),_0x5d0f('0x2e'),_0x5d0f('0x85'),_0x325117['type'],util[_0x5d0f('0x86')](_0xe0207d[_0x5d0f('0x58')],{'showHidden':![],'depth':null}));switch(_0x325117['type']){case'twilio':if(_0xe0207d[_0x5d0f('0x58')]['MessageSid']&&_0xe0207d[_0x5d0f('0x58')]['MessageSid']===_0x335ca9['messageId']){return _0x335ca9['update']({'read':!![]});}else{logger[_0x5d0f('0x29')](_0x5d0f('0x87'),'status',_0x5d0f('0x88'),util[_0x5d0f('0x86')](_0xe0207d[_0x5d0f('0x58')],{'showHidden':![],'depth':null}));}break;case _0x5d0f('0x89'):if(_0xe0207d['body'][_0x5d0f('0x8a')]&&_0xe0207d[_0x5d0f('0x58')]['MessageUUID']===_0x335ca9[_0x5d0f('0x8b')]&&_[_0x5d0f('0x8c')]([_0x5d0f('0x8d'),_0x5d0f('0x8e')],_0xe0207d[_0x5d0f('0x58')][_0x5d0f('0x8f')])>=0x0){return _0x335ca9['update']({'read':!![]});}else{logger[_0x5d0f('0x29')](_0x5d0f('0x87'),_0x5d0f('0x2e'),_0x5d0f('0x90'),util[_0x5d0f('0x86')](_0xe0207d[_0x5d0f('0x58')],{'showHidden':![],'depth':null}));}break;case _0x5d0f('0x91'):var _0x15b0c2=_0xe0207d[_0x5d0f('0x58')][_0x5d0f('0x92')][0x0];if(_0x15b0c2[_0x5d0f('0x2e')][_0x5d0f('0x93')]==='DELIVERED'){return _0x335ca9[_0x5d0f('0x38')]({'read':!![]});}else{logger[_0x5d0f('0x29')](_0x5d0f('0x87'),_0x5d0f('0x2e'),_0x5d0f('0x91'),util[_0x5d0f('0x86')](_0xe0207d[_0x5d0f('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x335ca9;}})['then'](respondWithResult(_0x22d4ea,null))[_0x5d0f('0x2c')](handleError(_0x22d4ea,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 0265ea0..220adda 100644 --- a/server/api/smsMessage/smsMessage.events.js +++ b/server/api/smsMessage/smsMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0324=['save','update','remove','emit','hook','events','SmsMessage'];(function(_0xc7f23c,_0x2be758){var _0x4b4def=function(_0x1b3aab){while(--_0x1b3aab){_0xc7f23c['push'](_0xc7f23c['shift']());}};_0x4b4def(++_0x2be758);}(_0x0324,0x108));var _0x4032=function(_0x3089ef,_0x24afea){_0x3089ef=_0x3089ef-0x0;var _0x3ff75b=_0x0324[_0x3089ef];return _0x3ff75b;};'use strict';var EventEmitter=require(_0x4032('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x4032('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4032('0x2'),'afterUpdate':_0x4032('0x3'),'afterDestroy':_0x4032('0x4')};function emitEvent(_0x211399){return function(_0x27526d,_0x2317b9,_0x5193b7){SmsMessageEvents['emit'](_0x211399+':'+_0x27526d['id'],_0x27526d);SmsMessageEvents[_0x4032('0x5')](_0x211399,_0x27526d);_0x5193b7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x4032('0x6')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x013b=['remove','emit','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0x2e9e4c,_0x75a582){var _0x1d21e5=function(_0x6f4537){while(--_0x6f4537){_0x2e9e4c['push'](_0x2e9e4c['shift']());}};_0x1d21e5(++_0x75a582);}(_0x013b,0xe0));var _0xb013=function(_0x5f55b5,_0x372ef9){_0x5f55b5=_0x5f55b5-0x0;var _0x489ba1=_0x013b[_0x5f55b5];return _0x489ba1;};'use strict';var EventEmitter=require(_0xb013('0x0'));var SmsMessage=require(_0xb013('0x1'))['db'][_0xb013('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xb013('0x3')](0x0);var events={'afterCreate':_0xb013('0x4'),'afterUpdate':_0xb013('0x5'),'afterDestroy':_0xb013('0x6')};function emitEvent(_0x216439){return function(_0x55c185,_0xea6c5a,_0x227626){SmsMessageEvents[_0xb013('0x7')](_0x216439+':'+_0x55c185['id'],_0x55c185);SmsMessageEvents[_0xb013('0x7')](_0x216439,_0x55c185);_0x227626(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xb013('0x8')](e,emitEvent(event));}}module[_0xb013('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 25c7e24..d1d6546 100644 --- a/server/api/smsMessage/smsMessage.model.js +++ b/server/api/smsMessage/smsMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e31=['messages','create','remote','/status?token=','token','sid','update','error','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','&password=','password','GET','split','sms','POST','user_key','total_sent','deliveryReport','read','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','format','Basic\x20%s','toString','http_code','queued_count','head','data','message_id','clickSend','/api/sms/messages/','%s:%s','authId','base64','message_uuid','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','keys','sort','length','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','intelepeer','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','isNil','SmsInteraction','findOne','SmsInteractionId','then','createdAt','catch','SmsAccount','find','type','twilio','accountSid','authToken','phone'];(function(_0x5b1c9c,_0x47981a){var _0x977fd3=function(_0x41e449){while(--_0x41e449){_0x5b1c9c['push'](_0x5b1c9c['shift']());}};_0x977fd3(++_0x47981a);}(_0x1e31,0x14e));var _0x11e3=function(_0x8c3829,_0x5a1f2a){_0x8c3829=_0x8c3829-0x0;var _0x1bdaf7=_0x1e31[_0x8c3829];return _0x1bdaf7;};'use strict';var _=require(_0x11e3('0x0'));var util=require(_0x11e3('0x1'));var logger=require(_0x11e3('0x2'))('api');var moment=require(_0x11e3('0x3'));var BPromise=require(_0x11e3('0x4'));var rp=require(_0x11e3('0x5'));var fs=require('fs');var path=require(_0x11e3('0x6'));var rimraf=require(_0x11e3('0x7'));var config=require(_0x11e3('0x8'));var attributes=require(_0x11e3('0x9'));module['exports']=function(_0x1c4494,_0x417a4d){return _0x1c4494[_0x11e3('0xa')](_0x11e3('0xb'),attributes,{'tableName':_0x11e3('0xc'),'paranoid':![],'indexes':[{'name':_0x11e3('0xd'),'fields':[_0x11e3('0xd')]},{'name':_0x11e3('0xe'),'fields':[_0x11e3('0xf')],'type':_0x11e3('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x123478,_0x24da0,_0x2fa8db){var _0x182e64=_0x1c4494[_0x11e3('0x11')];var _0x338c07=_0x123478['get']({'plain':!![]});if(_0x338c07[_0x11e3('0x12')]['toLowerCase']()==='in'||_0x338c07['direction'][_0x11e3('0x13')]()===_0x11e3('0x14')&&!_0x338c07['secret']&&!_[_0x11e3('0x15')](_0x338c07['UserId'])&&!_[_0x11e3('0x15')](_0x338c07['SmsInteractionId'])){_0x182e64[_0x11e3('0x16')][_0x11e3('0x17')]({'where':{'id':_0x338c07[_0x11e3('0x18')]}})[_0x11e3('0x19')](function(_0x589804){if(_0x589804){_0x589804['update']({'lastMsgAt':_0x338c07[_0x11e3('0x1a')],'lastMsgDirection':_0x338c07[_0x11e3('0x12')][_0x11e3('0x13')]()});}})[_0x11e3('0x1b')](function(_0x1a63e3){console['error'](_0x1a63e3);});}if(_0x338c07[_0x11e3('0x12')]===_0x11e3('0x14')&&!_0x338c07['secret']){var _0x36f4d3;_0x182e64[_0x11e3('0x1c')][_0x11e3('0x1d')]({'where':{'id':_0x338c07['SmsAccountId']},'raw':!![]})[_0x11e3('0x19')](function(_0x2e9134){_0x36f4d3=_0x2e9134;if(_0x36f4d3&&_0x36f4d3['type']){switch(_0x36f4d3[_0x11e3('0x1e')]){case _0x11e3('0x1f'):var _0x37a9ed=require(_0x11e3('0x1f'));if(_0x36f4d3[_0x11e3('0x20')]&&_0x36f4d3[_0x11e3('0x21')]&&_0x36f4d3[_0x11e3('0x22')]){var _0x590b5b=new _0x37a9ed(_0x36f4d3[_0x11e3('0x20')],_0x36f4d3[_0x11e3('0x21')]);_0x590b5b[_0x11e3('0x23')][_0x11e3('0x24')]({'body':_0x338c07[_0x11e3('0xf')],'to':_0x338c07[_0x11e3('0x22')],'from':_0x36f4d3[_0x11e3('0x22')],'statusCallback':_0x36f4d3[_0x11e3('0x25')]+'/api/sms/messages/'+_0x338c07['id']+_0x11e3('0x26')+_0x36f4d3[_0x11e3('0x27')]})[_0x11e3('0x19')](function(_0x512873){if(_0x512873[_0x11e3('0x28')]){return _0x123478[_0x11e3('0x29')]({'messageId':_0x512873['sid']});}})['catch'](function(_0x4d0df1){logger[_0x11e3('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x11e3('0x2b'),_0x11e3('0x1f'),util[_0x11e3('0x2c')](_0x4d0df1,{'showHidden':![],'depth':null}));});}else{logger[_0x11e3('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x11e3('0x2b'),_0x11e3('0x1f'),_0x11e3('0x2d'));}break;case _0x11e3('0x2e'):var _0x3c94c3=_0x11e3('0x2f');if(_0x36f4d3[_0x11e3('0x30')]&&_0x36f4d3['password']){var _0x2be1c5={'recipient':[_0x338c07[_0x11e3('0x22')]],'message':_0x338c07[_0x11e3('0xf')],'message_type':_0x36f4d3[_0x11e3('0x31')]};if(_0x36f4d3['smsMethod']&&_0x36f4d3['smsMethod']!=='SI'){_0x2be1c5[_0x11e3('0x32')]=_0x36f4d3[_0x11e3('0x22')];}var _0x327266={'url':_0x3c94c3+_0x11e3('0x33')+_0x36f4d3[_0x11e3('0x30')]+_0x11e3('0x34')+_0x36f4d3[_0x11e3('0x35')],'method':_0x11e3('0x36')};rp(_0x327266)[_0x11e3('0x19')](function(_0x90f407){var _0x593739=_0x90f407[_0x11e3('0x37')](';');var _0x482fc1={'user_key':_0x593739[0x0],'session_key':_0x593739[0x1]};_0x327266={'url':_0x3c94c3+_0x11e3('0x38'),'method':_0x11e3('0x39'),'headers':{'user_key':_0x482fc1[_0x11e3('0x3a')],'Session_key':_0x482fc1['session_key']},'json':!![],'body':_0x2be1c5};return rp(_0x327266);})[_0x11e3('0x19')](function(_0x1727b7){if(_0x1727b7[_0x11e3('0x3b')]>=0x1){var _0x242f9f={'messageId':_0x1727b7['internal_order_id']};if(_0x36f4d3[_0x11e3('0x31')]!=='GP'||!_0x36f4d3[_0x11e3('0x3c')]){_0x242f9f[_0x11e3('0x3d')]=!![];}return _0x123478[_0x11e3('0x29')](_0x242f9f);}else{return logger[_0x11e3('0x2a')](_0x11e3('0x3e'),_0x11e3('0x2b'),'skebby',util[_0x11e3('0x2c')](_0x1727b7,{'showHidden':![],'depth':null}));}})[_0x11e3('0x1b')](function(_0x55720c){return logger['error'](_0x11e3('0x3e'),_0x11e3('0x2b'),_0x11e3('0x2e'),util[_0x11e3('0x2c')](_0x55720c,{'showHidden':![],'depth':null}));});}else{logger[_0x11e3('0x2a')](_0x11e3('0x3e'),'afterCreate','skebby',_0x11e3('0x3f'));}break;case _0x11e3('0x40'):if(_0x36f4d3[_0x11e3('0x21')]){var _0x2a0470={'recipient':_0x338c07[_0x11e3('0x22')],'message':_0x338c07[_0x11e3('0xf')],'sender':_0x36f4d3[_0x11e3('0x41')]||_0x36f4d3['phone'],'authorization':_0x36f4d3['authToken']};var _0x24da0={'method':_0x11e3('0x39'),'uri':_0x11e3('0x42'),'body':_0x2a0470,'json':!![]};rp(_0x24da0)[_0x11e3('0x19')](function(_0x194ce0){var _0x3d69ab={'messageId':_0x194ce0[_0x11e3('0x43')]};if(!_0x36f4d3[_0x11e3('0x3c')]){_0x3d69ab[_0x11e3('0x3d')]=!![];}return _0x123478[_0x11e3('0x29')](_0x3d69ab);})[_0x11e3('0x1b')](function(_0x74bb9b){logger[_0x11e3('0x2a')](_0x11e3('0x3e'),'afterCreate','connectel',util[_0x11e3('0x2c')](_0x74bb9b,{'showHidden':![],'depth':null}));});}else{logger[_0x11e3('0x2a')](_0x11e3('0x3e'),'afterCreate',_0x11e3('0x40'),'Missing\x20parameters:\x20authToken');}break;case _0x11e3('0x44'):if(_0x36f4d3[_0x11e3('0x30')]&&_0x36f4d3[_0x11e3('0x35')]){var _0x2a0470={'messages':[{'source':'xCALLY\x20Motion','to':_0x338c07[_0x11e3('0x22')],'body':_0x338c07[_0x11e3('0xf')],'from':_0x36f4d3[_0x11e3('0x41')]||_0x36f4d3[_0x11e3('0x22')]}]};var _0x1d303a=util['format']('%s:%s',_0x36f4d3['username'],_0x36f4d3[_0x11e3('0x35')]);var _0x24da0={'method':_0x11e3('0x39'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x2a0470,'headers':{'Authorization':util[_0x11e3('0x45')](_0x11e3('0x46'),new Buffer(_0x1d303a)[_0x11e3('0x47')]('base64'))},'json':!![]};rp(_0x24da0)[_0x11e3('0x19')](function(_0x592ec8){if(_0x592ec8['http_code']>=0xc8&&_0x592ec8[_0x11e3('0x48')]<=0xce){if(_0x592ec8['data']&&_0x592ec8['data'][_0x11e3('0x49')]>0x0){var _0xad872b=_[_0x11e3('0x4a')](_0x592ec8[_0x11e3('0x4b')][_0x11e3('0x23')]);var _0x80b73={'messageId':_0xad872b[_0x11e3('0x4c')]};if(!_0x36f4d3[_0x11e3('0x3c')]){_0x80b73['read']=!![];}return _0x123478[_0x11e3('0x29')](_0x80b73);}else{logger[_0x11e3('0x2a')](_0x11e3('0x3e'),_0x11e3('0x2b'),_0x11e3('0x4d'),util[_0x11e3('0x2c')](_0x592ec8,{'showHidden':![],'depth':null}));}}else{logger[_0x11e3('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x11e3('0x4d'),util[_0x11e3('0x2c')](_0x592ec8,{'showHidden':![],'depth':null}));}})[_0x11e3('0x1b')](function(_0x149812){logger[_0x11e3('0x2a')](_0x11e3('0x3e'),_0x11e3('0x2b'),_0x11e3('0x4d'),util[_0x11e3('0x2c')](_0x149812,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x11e3('0x3e'),_0x11e3('0x2b'),_0x11e3('0x4d'),'Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x36f4d3['authId']&&_0x36f4d3[_0x11e3('0x21')]){var _0x2a0470={'dst':_0x338c07[_0x11e3('0x22')],'text':_0x338c07[_0x11e3('0xf')],'src':_0x36f4d3['senderString']||_0x36f4d3[_0x11e3('0x22')],'url':_0x36f4d3[_0x11e3('0x25')]+_0x11e3('0x4e')+_0x338c07['id']+_0x11e3('0x26')+_0x36f4d3[_0x11e3('0x27')]};var _0x1d303a=util['format'](_0x11e3('0x4f'),_0x36f4d3[_0x11e3('0x50')],_0x36f4d3['authToken']);var _0x24da0={'method':_0x11e3('0x39'),'uri':util[_0x11e3('0x45')]('https://api.plivo.com/v1/Account/%s/Message/',_0x36f4d3[_0x11e3('0x50')]),'body':_0x2a0470,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x1d303a)[_0x11e3('0x47')](_0x11e3('0x51')))},'json':!![]};rp(_0x24da0)[_0x11e3('0x19')](function(_0x1e6c7f){var _0x1600c2={'messageId':_0x1e6c7f[_0x11e3('0x52')][0x0]};return _0x123478[_0x11e3('0x29')](_0x1600c2);})[_0x11e3('0x1b')](function(_0x596631){logger['error'](_0x11e3('0x3e'),'afterCreate','plivo',util['inspect'](_0x596631,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x11e3('0x3e'),_0x11e3('0x2b'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x36f4d3['username']&&_0x36f4d3[_0x11e3('0x35')]){if(_0x36f4d3[_0x11e3('0x53')]){var _0x588269={'method':_0x11e3('0x39'),'uri':_0x36f4d3['baseUrl']+_0x11e3('0x54'),'body':{'username':_0x36f4d3[_0x11e3('0x30')],'password':_0x36f4d3['password']},'json':!![]};return rp(_0x588269)[_0x11e3('0x19')](function(_0xf6ce0b){var _0x35af98={'method':_0x11e3('0x39'),'uri':_0x36f4d3[_0x11e3('0x53')]+_0x11e3('0x55'),'body':{'messages':[{'from':_0x36f4d3[_0x11e3('0x22')],'destinations':[{'to':_0x338c07[_0x11e3('0x22')]}],'text':_0x338c07[_0x11e3('0xf')],'notifyUrl':_0x36f4d3[_0x11e3('0x25')]+_0x11e3('0x4e')+_0x338c07['id']+_0x11e3('0x26')+_0x36f4d3['token'],'notifyContentType':'application/json','callbackData':_0x36f4d3[_0x11e3('0x22')]+';'+_0x338c07[_0x11e3('0xf')]}]},'headers':{'Authorization':_0x11e3('0x56')+_0xf6ce0b[_0x11e3('0x27')]},'json':!![]};return rp(_0x35af98)[_0x11e3('0x19')](function(_0x2a7340){if(_0x2a7340[_0x11e3('0x23')]){var _0x47ef14={'messageId':_0x2a7340['messages'][0x0]['messageId']};if(!_0x36f4d3[_0x11e3('0x3c')]){_0x47ef14[_0x11e3('0x3d')]=!![];}return _0x123478[_0x11e3('0x29')](_0x47ef14);}else{return logger[_0x11e3('0x2a')](_0x11e3('0x3e'),_0x11e3('0x2b'),'infobip',util[_0x11e3('0x2c')](_0x2a7340,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x29e3f9){return logger[_0x11e3('0x2a')](_0x11e3('0x3e'),_0x11e3('0x2b'),'infobip',util[_0x11e3('0x2c')](_0x29e3f9,{'showHidden':![],'depth':null}));});}else{logger[_0x11e3('0x2a')](_0x11e3('0x3e'),_0x11e3('0x2b'),_0x11e3('0x57'),_0x11e3('0x58'));}}else{logger[_0x11e3('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x11e3('0x2b'),_0x11e3('0x57'),_0x11e3('0x3f'));}break;case'csc':var _0x368dd0=require(_0x11e3('0x59'));if(_0x36f4d3[_0x11e3('0x5a')]){var _0x16dd6a={};_0x16dd6a[_0x11e3('0x5b')]=_0x36f4d3[_0x11e3('0x30')];_0x16dd6a[_0x11e3('0x22')]=_0x338c07['phone'];_0x16dd6a[_0x11e3('0x32')]=_0x36f4d3[_0x11e3('0x22')];_0x16dd6a[_0x11e3('0x5c')]=_0x338c07[_0x11e3('0xf')];_0x16dd6a[_0x11e3('0x5d')]=+new Date();var _0x5059b4='';var _0x424dba='';var _0x34957e=Object[_0x11e3('0x5e')](_0x16dd6a);_0x34957e[_0x11e3('0x5f')]();for(var _0x17e574=0x0;_0x17e574<_0x34957e[_0x11e3('0x60')];_0x17e574++){if(_0x5059b4!=''){_0x5059b4+='&';}_0x5059b4+=_0x34957e[_0x17e574]+'='+encodeURIComponent(_0x16dd6a[_0x34957e[_0x17e574]]);_0x424dba+=_0x16dd6a[_0x34957e[_0x17e574]];}_0x424dba+=_0x36f4d3[_0x11e3('0x5a')];_0x424dba=_0x368dd0['createHash']('md5')[_0x11e3('0x29')](_0x424dba)['digest'](_0x11e3('0x61'));if(_0x5059b4!==''){_0x5059b4+='&';}_0x5059b4+=_0x11e3('0x62')+_0x424dba;var _0x327266={'method':_0x11e3('0x36'),'uri':_0x36f4d3[_0x11e3('0x53')]+_0x11e3('0x63')+_0x5059b4,'json':!![]};return rp(_0x327266)[_0x11e3('0x19')](function(_0x4cec42){var _0x51a4ef=Object[_0x11e3('0x5e')](_0x4cec42);if(_0x4cec42[_0x51a4ef[0x0]][_0x11e3('0x2a')]&&parseInt(_0x4cec42[_0x51a4ef[0x0]]['error'])===0x0){var _0x10d1f4={'messageId':_0x4cec42[_0x51a4ef[0x0]][_0x11e3('0x64')]};if(!_0x36f4d3[_0x11e3('0x3c')]){_0x10d1f4[_0x11e3('0x3d')]=!![];}return _0x123478[_0x11e3('0x29')](_0x10d1f4);}else{return logger[_0x11e3('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x11e3('0x65'),util[_0x11e3('0x2c')](_0x4cec42[_0x11e3('0x2a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x514476){return logger[_0x11e3('0x2a')](_0x11e3('0x3e'),_0x11e3('0x2b'),_0x11e3('0x65'),util[_0x11e3('0x2c')](_0x514476,{'showHidden':![],'depth':null}));});}else{logger[_0x11e3('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',_0x11e3('0x66'));}break;case'clickatell':if(_0x36f4d3['apiKey']){var _0x3ebac0={'method':_0x11e3('0x39'),'uri':_0x11e3('0x67'),'headers':{'Authorization':_0x36f4d3[_0x11e3('0x5a')]},'body':{'content':_0x338c07[_0x11e3('0xf')],'to':[_0x338c07['phone']],'from':_0x36f4d3[_0x11e3('0x22')],'binary':![],'clientMessageId':_0x11e3('0x68'),'charset':_0x11e3('0x69')},'json':!![]};rp(_0x3ebac0)[_0x11e3('0x19')](function(_0x221aa3){if(!_0x221aa3[_0x11e3('0x2a')]){var _0xd554e5={'messageId':_0x221aa3['messages'][0x0][_0x11e3('0x6a')]};if(!_0x36f4d3[_0x11e3('0x3c')]){_0xd554e5[_0x11e3('0x3d')]=!![];}return _0x123478['update'](_0xd554e5);}else{return logger[_0x11e3('0x2a')](_0x11e3('0x3e'),_0x11e3('0x2b'),_0x11e3('0x6b'),util[_0x11e3('0x2c')](_0x221aa3[_0x11e3('0x2a')],{'showHidden':![],'depth':null}));}})[_0x11e3('0x1b')](function(_0x1cd71c){return logger[_0x11e3('0x2a')](_0x11e3('0x3e'),_0x11e3('0x2b'),_0x11e3('0x6b'),util[_0x11e3('0x2c')](_0x1cd71c,{'showHidden':![],'depth':null}));});}else{logger[_0x11e3('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x11e3('0x6b'),'Missing\x20parameters:\x20apiKey');}break;case _0x11e3('0x6c'):if(_0x36f4d3['username']&&_0x36f4d3['password']){var _0x1d303a=util[_0x11e3('0x45')](_0x11e3('0x4f'),_0x36f4d3[_0x11e3('0x30')],_0x36f4d3['password']);var _0x24da0={'method':'POST','uri':_0x11e3('0x6d')+_0x36f4d3[_0x11e3('0x6e')]+_0x11e3('0x6f'),'body':{'to':[_0x338c07[_0x11e3('0x22')]],'text':_0x338c07['body'],'from':_0x36f4d3['phone'],'applicationId':_0x36f4d3['applicationId']},'headers':{'Authorization':util[_0x11e3('0x45')](_0x11e3('0x46'),new Buffer(_0x1d303a)['toString'](_0x11e3('0x51')))},'json':!![]};rp(_0x24da0)[_0x11e3('0x19')](function(_0x2d78d2){if(_0x2d78d2['id']){var _0x171dac={'messageId':_0x2d78d2['id']};return _0x123478[_0x11e3('0x29')](_0x171dac);}else{logger[_0x11e3('0x2a')](_0x11e3('0x3e'),'afterCreate','bandwidth',util[_0x11e3('0x2c')](_0x2d78d2,{'showHidden':![],'depth':null}));}})['catch'](function(_0x306a9b){logger['error'](_0x11e3('0x3e'),'afterCreate',_0x11e3('0x6c'),util[_0x11e3('0x2c')](_0x306a9b,{'showHidden':![],'depth':null}));});}else{logger[_0x11e3('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x11e3('0x6c'),_0x11e3('0x3f'));}break;case'intelepeer':if(_0x36f4d3[_0x11e3('0x5a')]){var _0x328255={};var _0x327266={'method':_0x11e3('0x39'),'uri':_0x11e3('0x70'),'headers':{'Authorization':_0x11e3('0x71')+_0x36f4d3[_0x11e3('0x5a')],'Content-Type':_0x11e3('0x72')},'body':{'from':_0x36f4d3[_0x11e3('0x22')],'to':_0x338c07[_0x11e3('0x22')],'text':_0x338c07[_0x11e3('0xf')]},'json':!![]};return rp(_0x327266)[_0x11e3('0x19')](function(_0x50879f){if(_0x50879f[_0x11e3('0x73')]==0xca){_0x328255[_0x11e3('0x74')]=_0x50879f;var _0x427f28={'method':'POST','uri':_0x11e3('0x75'),'headers':{'Authorization':'Bearer\x20'+_0x36f4d3[_0x11e3('0x5a')],'Content-Type':_0x11e3('0x72')},'body':{'refid':_0x328255[_0x11e3('0x74')][_0x11e3('0x76')]},'json':!![]};return rp(_0x427f28)[_0x11e3('0x19')](function(_0x550167){_0x328255['status']=_0x550167;var _0x17498e={'messageId':_0x328255['message'][_0x11e3('0x76')],'read':!![]};return _0x123478[_0x11e3('0x29')](_0x17498e);});}else{return logger[_0x11e3('0x2a')](_0x11e3('0x3e'),_0x11e3('0x2b'),_0x11e3('0x77'),util['inspect'](_0x50879f,{'showHidden':![],'depth':null}));}})[_0x11e3('0x1b')](function(_0x551c32){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x11e3('0x77'),util[_0x11e3('0x2c')](_0x551c32,{'showHidden':![],'depth':null}));});}else{return logger[_0x11e3('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x11e3('0x2b'),'intelepeer',_0x11e3('0x78'));}break;}}})['finally'](function(){_0x2fa8db();});}else{_0x2fa8db();}}},'charset':_0x11e3('0x79'),'collate':_0x11e3('0x7a')});}; \ No newline at end of file +var _0x629d=['smsMethod','sender','login?username=','&password=','GET','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','username','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','timestamp','keys','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path','./smsMessage.attributes','exports','define','sms_messages','messageId','body','FULLTEXT','get','UserId','isNil','SmsInteractionId','SmsInteraction','findOne','update','createdAt','direction','toLowerCase','catch','error','out','secret','SmsAccount','find','SmsAccountId','then','type','authToken','messages','create','phone','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','inspect','skebby','password'];(function(_0x2850c0,_0x1363a7){var _0x21e830=function(_0x3ec70a){while(--_0x3ec70a){_0x2850c0['push'](_0x2850c0['shift']());}};_0x21e830(++_0x1363a7);}(_0x629d,0x146));var _0xd629=function(_0x4c4d9c,_0x5bd0eb){_0x4c4d9c=_0x4c4d9c-0x0;var _0x5063fb=_0x629d[_0x4c4d9c];return _0x5063fb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd629('0x0'))(_0xd629('0x1'));var moment=require(_0xd629('0x2'));var BPromise=require(_0xd629('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd629('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd629('0x5'));module[_0xd629('0x6')]=function(_0x18e183,_0x4aa0b9){return _0x18e183[_0xd629('0x7')]('SmsMessage',attributes,{'tableName':_0xd629('0x8'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xd629('0x9')]},{'name':'fti_sms_messages','fields':[_0xd629('0xa')],'type':_0xd629('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x367609,_0x8156c0,_0xd2e078){var _0xfbc908=_0x18e183['models'];var _0x22e448=_0x367609[_0xd629('0xc')]({'plain':!![]});if(_0x22e448['direction']['toLowerCase']()==='in'||_0x22e448['direction']['toLowerCase']()==='out'&&!_0x22e448['secret']&&!_['isNil'](_0x22e448[_0xd629('0xd')])&&!_[_0xd629('0xe')](_0x22e448[_0xd629('0xf')])){_0xfbc908[_0xd629('0x10')][_0xd629('0x11')]({'where':{'id':_0x22e448[_0xd629('0xf')]}})['then'](function(_0x2962a5){if(_0x2962a5){_0x2962a5[_0xd629('0x12')]({'lastMsgAt':_0x22e448[_0xd629('0x13')],'lastMsgDirection':_0x22e448[_0xd629('0x14')][_0xd629('0x15')]()});}})[_0xd629('0x16')](function(_0x2f3a2f){console[_0xd629('0x17')](_0x2f3a2f);});}if(_0x22e448['direction']===_0xd629('0x18')&&!_0x22e448[_0xd629('0x19')]){var _0x20ec4e;_0xfbc908[_0xd629('0x1a')][_0xd629('0x1b')]({'where':{'id':_0x22e448[_0xd629('0x1c')]},'raw':!![]})[_0xd629('0x1d')](function(_0x160c75){_0x20ec4e=_0x160c75;if(_0x20ec4e&&_0x20ec4e[_0xd629('0x1e')]){switch(_0x20ec4e[_0xd629('0x1e')]){case'twilio':var _0x276537=require('twilio');if(_0x20ec4e['accountSid']&&_0x20ec4e[_0xd629('0x1f')]&&_0x20ec4e['phone']){var _0xe169e3=new _0x276537(_0x20ec4e['accountSid'],_0x20ec4e['authToken']);_0xe169e3[_0xd629('0x20')][_0xd629('0x21')]({'body':_0x22e448[_0xd629('0xa')],'to':_0x22e448[_0xd629('0x22')],'from':_0x20ec4e['phone'],'statusCallback':_0x20ec4e[_0xd629('0x23')]+_0xd629('0x24')+_0x22e448['id']+_0xd629('0x25')+_0x20ec4e[_0xd629('0x26')]})[_0xd629('0x1d')](function(_0x5a13b9){if(_0x5a13b9[_0xd629('0x27')]){return _0x367609[_0xd629('0x12')]({'messageId':_0x5a13b9[_0xd629('0x27')]});}})[_0xd629('0x16')](function(_0x50a3ab){logger[_0xd629('0x17')](_0xd629('0x28'),_0xd629('0x29'),_0xd629('0x2a'),util[_0xd629('0x2b')](_0x50a3ab,{'showHidden':![],'depth':null}));});}else{logger[_0xd629('0x17')](_0xd629('0x28'),_0xd629('0x29'),_0xd629('0x2a'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xd629('0x2c'):var _0x5723b7='https://api.skebby.it/API/v1.0/REST/';if(_0x20ec4e['username']&&_0x20ec4e[_0xd629('0x2d')]){var _0x25cad4={'recipient':[_0x22e448[_0xd629('0x22')]],'message':_0x22e448['body'],'message_type':_0x20ec4e['smsMethod']};if(_0x20ec4e[_0xd629('0x2e')]&&_0x20ec4e[_0xd629('0x2e')]!=='SI'){_0x25cad4[_0xd629('0x2f')]=_0x20ec4e[_0xd629('0x22')];}var _0x351906={'url':_0x5723b7+_0xd629('0x30')+_0x20ec4e['username']+_0xd629('0x31')+_0x20ec4e['password'],'method':_0xd629('0x32')};rp(_0x351906)['then'](function(_0x4fd56f){var _0xd8780c=_0x4fd56f['split'](';');var _0x1c3a76={'user_key':_0xd8780c[0x0],'session_key':_0xd8780c[0x1]};_0x351906={'url':_0x5723b7+_0xd629('0x33'),'method':_0xd629('0x34'),'headers':{'user_key':_0x1c3a76[_0xd629('0x35')],'Session_key':_0x1c3a76[_0xd629('0x36')]},'json':!![],'body':_0x25cad4};return rp(_0x351906);})['then'](function(_0x523315){if(_0x523315[_0xd629('0x37')]>=0x1){var _0x407eac={'messageId':_0x523315[_0xd629('0x38')]};if(_0x20ec4e[_0xd629('0x2e')]!=='GP'||!_0x20ec4e[_0xd629('0x39')]){_0x407eac[_0xd629('0x3a')]=!![];}return _0x367609['update'](_0x407eac);}else{return logger[_0xd629('0x17')](_0xd629('0x28'),_0xd629('0x29'),_0xd629('0x2c'),util['inspect'](_0x523315,{'showHidden':![],'depth':null}));}})[_0xd629('0x16')](function(_0x53988a){return logger[_0xd629('0x17')](_0xd629('0x28'),_0xd629('0x29'),_0xd629('0x2c'),util[_0xd629('0x2b')](_0x53988a,{'showHidden':![],'depth':null}));});}else{logger[_0xd629('0x17')](_0xd629('0x28'),_0xd629('0x29'),_0xd629('0x2c'),_0xd629('0x3b'));}break;case'connectel':if(_0x20ec4e['authToken']){var _0x547148={'recipient':_0x22e448['phone'],'message':_0x22e448[_0xd629('0xa')],'sender':_0x20ec4e[_0xd629('0x3c')]||_0x20ec4e['phone'],'authorization':_0x20ec4e['authToken']};var _0x8156c0={'method':_0xd629('0x34'),'uri':_0xd629('0x3d'),'body':_0x547148,'json':!![]};rp(_0x8156c0)[_0xd629('0x1d')](function(_0x120e2d){var _0x5570e0={'messageId':_0x120e2d[_0xd629('0x3e')]};if(!_0x20ec4e[_0xd629('0x39')]){_0x5570e0[_0xd629('0x3a')]=!![];}return _0x367609[_0xd629('0x12')](_0x5570e0);})['catch'](function(_0x8d624b){logger[_0xd629('0x17')](_0xd629('0x28'),'afterCreate',_0xd629('0x3f'),util[_0xd629('0x2b')](_0x8d624b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd629('0x28'),_0xd629('0x29'),'connectel',_0xd629('0x40'));}break;case'clicksend':if(_0x20ec4e[_0xd629('0x41')]&&_0x20ec4e[_0xd629('0x2d')]){var _0x547148={'messages':[{'source':_0xd629('0x42'),'to':_0x22e448['phone'],'body':_0x22e448[_0xd629('0xa')],'from':_0x20ec4e[_0xd629('0x3c')]||_0x20ec4e[_0xd629('0x22')]}]};var _0x4ff287=util[_0xd629('0x43')](_0xd629('0x44'),_0x20ec4e[_0xd629('0x41')],_0x20ec4e[_0xd629('0x2d')]);var _0x8156c0={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x547148,'headers':{'Authorization':util[_0xd629('0x43')](_0xd629('0x45'),new Buffer(_0x4ff287)[_0xd629('0x46')](_0xd629('0x47')))},'json':!![]};rp(_0x8156c0)[_0xd629('0x1d')](function(_0x9761f2){if(_0x9761f2['http_code']>=0xc8&&_0x9761f2[_0xd629('0x48')]<=0xce){if(_0x9761f2[_0xd629('0x49')]&&_0x9761f2[_0xd629('0x49')][_0xd629('0x4a')]>0x0){var _0xa22853=_[_0xd629('0x4b')](_0x9761f2[_0xd629('0x49')]['messages']);var _0x5d7a8e={'messageId':_0xa22853[_0xd629('0x4c')]};if(!_0x20ec4e[_0xd629('0x39')]){_0x5d7a8e[_0xd629('0x3a')]=!![];}return _0x367609['update'](_0x5d7a8e);}else{logger[_0xd629('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd629('0x29'),_0xd629('0x4d'),util['inspect'](_0x9761f2,{'showHidden':![],'depth':null}));}}else{logger[_0xd629('0x17')](_0xd629('0x28'),_0xd629('0x29'),_0xd629('0x4d'),util['inspect'](_0x9761f2,{'showHidden':![],'depth':null}));}})[_0xd629('0x16')](function(_0x2992eb){logger['error'](_0xd629('0x28'),_0xd629('0x29'),'clickSend',util[_0xd629('0x2b')](_0x2992eb,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd629('0x29'),_0xd629('0x4d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xd629('0x4e'):if(_0x20ec4e['authId']&&_0x20ec4e['authToken']){var _0x547148={'dst':_0x22e448[_0xd629('0x22')],'text':_0x22e448[_0xd629('0xa')],'src':_0x20ec4e[_0xd629('0x3c')]||_0x20ec4e[_0xd629('0x22')],'url':_0x20ec4e[_0xd629('0x23')]+_0xd629('0x24')+_0x22e448['id']+_0xd629('0x25')+_0x20ec4e[_0xd629('0x26')]};var _0x4ff287=util['format'](_0xd629('0x44'),_0x20ec4e[_0xd629('0x4f')],_0x20ec4e[_0xd629('0x1f')]);var _0x8156c0={'method':_0xd629('0x34'),'uri':util['format'](_0xd629('0x50'),_0x20ec4e[_0xd629('0x4f')]),'body':_0x547148,'headers':{'Authorization':util['format'](_0xd629('0x45'),new Buffer(_0x4ff287)['toString'](_0xd629('0x47')))},'json':!![]};rp(_0x8156c0)[_0xd629('0x1d')](function(_0xb6a6b3){var _0x6f2c83={'messageId':_0xb6a6b3[_0xd629('0x51')][0x0]};return _0x367609[_0xd629('0x12')](_0x6f2c83);})[_0xd629('0x16')](function(_0x7a4d36){logger[_0xd629('0x17')](_0xd629('0x28'),_0xd629('0x29'),_0xd629('0x4e'),util['inspect'](_0x7a4d36,{'showHidden':![],'depth':null}));});}else{logger[_0xd629('0x17')](_0xd629('0x28'),_0xd629('0x29'),'plivo',_0xd629('0x52'));}break;case'infobip':if(_0x20ec4e[_0xd629('0x41')]&&_0x20ec4e['password']){if(_0x20ec4e[_0xd629('0x53')]){var _0x393d84={'method':_0xd629('0x34'),'uri':_0x20ec4e[_0xd629('0x53')]+_0xd629('0x54'),'body':{'username':_0x20ec4e['username'],'password':_0x20ec4e[_0xd629('0x2d')]},'json':!![]};return rp(_0x393d84)[_0xd629('0x1d')](function(_0x52a317){var _0x203e28={'method':_0xd629('0x34'),'uri':_0x20ec4e[_0xd629('0x53')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x20ec4e[_0xd629('0x22')],'destinations':[{'to':_0x22e448[_0xd629('0x22')]}],'text':_0x22e448[_0xd629('0xa')],'notifyUrl':_0x20ec4e[_0xd629('0x23')]+_0xd629('0x24')+_0x22e448['id']+_0xd629('0x25')+_0x20ec4e['token'],'notifyContentType':_0xd629('0x55'),'callbackData':_0x20ec4e[_0xd629('0x22')]+';'+_0x22e448['body']}]},'headers':{'Authorization':_0xd629('0x56')+_0x52a317[_0xd629('0x26')]},'json':!![]};return rp(_0x203e28)['then'](function(_0x427683){if(_0x427683[_0xd629('0x20')]){var _0x4fdc8e={'messageId':_0x427683[_0xd629('0x20')][0x0]['messageId']};if(!_0x20ec4e['deliveryReport']){_0x4fdc8e[_0xd629('0x3a')]=!![];}return _0x367609[_0xd629('0x12')](_0x4fdc8e);}else{return logger[_0xd629('0x17')](_0xd629('0x28'),_0xd629('0x29'),_0xd629('0x57'),util[_0xd629('0x2b')](_0x427683,{'showHidden':![],'depth':null}));}});})['catch'](function(_0xc350){return logger[_0xd629('0x17')](_0xd629('0x28'),_0xd629('0x29'),_0xd629('0x57'),util['inspect'](_0xc350,{'showHidden':![],'depth':null}));});}else{logger[_0xd629('0x17')](_0xd629('0x28'),_0xd629('0x29'),_0xd629('0x57'),_0xd629('0x58'));}}else{logger[_0xd629('0x17')](_0xd629('0x28'),'afterCreate',_0xd629('0x57'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xd629('0x59'):var _0x405bfd=require(_0xd629('0x5a'));if(_0x20ec4e[_0xd629('0x5b')]){var _0x410b56={};_0x410b56[_0xd629('0x5c')]=_0x20ec4e[_0xd629('0x41')];_0x410b56[_0xd629('0x22')]=_0x22e448[_0xd629('0x22')];_0x410b56[_0xd629('0x2f')]=_0x20ec4e['phone'];_0x410b56['text']=_0x22e448[_0xd629('0xa')];_0x410b56[_0xd629('0x5d')]=+new Date();var _0x324819='';var _0x358fb7='';var _0x3e79f7=Object[_0xd629('0x5e')](_0x410b56);_0x3e79f7['sort']();for(var _0x252383=0x0;_0x252383<_0x3e79f7[_0xd629('0x5f')];_0x252383++){if(_0x324819!=''){_0x324819+='&';}_0x324819+=_0x3e79f7[_0x252383]+'='+encodeURIComponent(_0x410b56[_0x3e79f7[_0x252383]]);_0x358fb7+=_0x410b56[_0x3e79f7[_0x252383]];}_0x358fb7+=_0x20ec4e['apiKey'];_0x358fb7=_0x405bfd[_0xd629('0x60')](_0xd629('0x61'))[_0xd629('0x12')](_0x358fb7)[_0xd629('0x62')](_0xd629('0x63'));if(_0x324819!==''){_0x324819+='&';}_0x324819+=_0xd629('0x64')+_0x358fb7;var _0x351906={'method':'GET','uri':_0x20ec4e['baseUrl']+_0xd629('0x65')+_0x324819,'json':!![]};return rp(_0x351906)['then'](function(_0x262330){var _0x249f92=Object[_0xd629('0x5e')](_0x262330);if(_0x262330[_0x249f92[0x0]][_0xd629('0x17')]&&parseInt(_0x262330[_0x249f92[0x0]][_0xd629('0x17')])===0x0){var _0x14b4b6={'messageId':_0x262330[_0x249f92[0x0]][_0xd629('0x66')]};if(!_0x20ec4e['deliveryReport']){_0x14b4b6[_0xd629('0x3a')]=!![];}return _0x367609[_0xd629('0x12')](_0x14b4b6);}else{return logger[_0xd629('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd629('0x29'),_0xd629('0x59'),util[_0xd629('0x2b')](_0x262330[_0xd629('0x17')],{'showHidden':![],'depth':null}));}})[_0xd629('0x16')](function(_0x1eadbb){return logger[_0xd629('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd629('0x29'),_0xd629('0x59'),util[_0xd629('0x2b')](_0x1eadbb,{'showHidden':![],'depth':null}));});}else{logger[_0xd629('0x17')](_0xd629('0x28'),_0xd629('0x29'),'csc',_0xd629('0x67'));}break;case _0xd629('0x68'):if(_0x20ec4e[_0xd629('0x5b')]){var _0x278395={'method':'POST','uri':_0xd629('0x69'),'headers':{'Authorization':_0x20ec4e[_0xd629('0x5b')]},'body':{'content':_0x22e448[_0xd629('0xa')],'to':[_0x22e448[_0xd629('0x22')]],'from':_0x20ec4e[_0xd629('0x22')],'binary':![],'clientMessageId':_0xd629('0x6a'),'charset':_0xd629('0x6b')},'json':!![]};rp(_0x278395)[_0xd629('0x1d')](function(_0x5201b0){if(!_0x5201b0[_0xd629('0x17')]){var _0x1d3243={'messageId':_0x5201b0[_0xd629('0x20')][0x0][_0xd629('0x6c')]};if(!_0x20ec4e[_0xd629('0x39')]){_0x1d3243['read']=!![];}return _0x367609[_0xd629('0x12')](_0x1d3243);}else{return logger[_0xd629('0x17')](_0xd629('0x28'),'afterCreate',_0xd629('0x68'),util[_0xd629('0x2b')](_0x5201b0[_0xd629('0x17')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x26c416){return logger[_0xd629('0x17')](_0xd629('0x28'),_0xd629('0x29'),_0xd629('0x68'),util[_0xd629('0x2b')](_0x26c416,{'showHidden':![],'depth':null}));});}else{logger[_0xd629('0x17')](_0xd629('0x28'),_0xd629('0x29'),_0xd629('0x68'),_0xd629('0x67'));}break;case _0xd629('0x6d'):if(_0x20ec4e['username']&&_0x20ec4e[_0xd629('0x2d')]){var _0x4ff287=util['format'](_0xd629('0x44'),_0x20ec4e[_0xd629('0x41')],_0x20ec4e[_0xd629('0x2d')]);var _0x8156c0={'method':_0xd629('0x34'),'uri':_0xd629('0x6e')+_0x20ec4e[_0xd629('0x6f')]+_0xd629('0x70'),'body':{'to':[_0x22e448[_0xd629('0x22')]],'text':_0x22e448[_0xd629('0xa')],'from':_0x20ec4e[_0xd629('0x22')],'applicationId':_0x20ec4e[_0xd629('0x71')]},'headers':{'Authorization':util[_0xd629('0x43')](_0xd629('0x45'),new Buffer(_0x4ff287)[_0xd629('0x46')](_0xd629('0x47')))},'json':!![]};rp(_0x8156c0)[_0xd629('0x1d')](function(_0x4451e2){if(_0x4451e2['id']){var _0x2f8cd7={'messageId':_0x4451e2['id']};return _0x367609[_0xd629('0x12')](_0x2f8cd7);}else{logger['error'](_0xd629('0x28'),'afterCreate',_0xd629('0x6d'),util[_0xd629('0x2b')](_0x4451e2,{'showHidden':![],'depth':null}));}})[_0xd629('0x16')](function(_0x3c1215){logger['error'](_0xd629('0x28'),_0xd629('0x29'),_0xd629('0x6d'),util[_0xd629('0x2b')](_0x3c1215,{'showHidden':![],'depth':null}));});}else{logger[_0xd629('0x17')](_0xd629('0x28'),'afterCreate','bandwidth',_0xd629('0x3b'));}break;case _0xd629('0x72'):if(_0x20ec4e[_0xd629('0x5b')]){var _0x5eb616={};var _0x351906={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xd629('0x73')+_0x20ec4e['apiKey'],'Content-Type':_0xd629('0x55')},'body':{'from':_0x20ec4e[_0xd629('0x22')],'to':_0x22e448['phone'],'text':_0x22e448[_0xd629('0xa')]},'json':!![]};return rp(_0x351906)[_0xd629('0x1d')](function(_0x24c081){if(_0x24c081['code']==0xca){_0x5eb616[_0xd629('0x74')]=_0x24c081;var _0x15f4a6={'method':_0xd629('0x34'),'uri':_0xd629('0x75'),'headers':{'Authorization':'Bearer\x20'+_0x20ec4e[_0xd629('0x5b')],'Content-Type':_0xd629('0x55')},'body':{'refid':_0x5eb616['message'][_0xd629('0x76')]},'json':!![]};return rp(_0x15f4a6)['then'](function(_0xe067bd){_0x5eb616[_0xd629('0x77')]=_0xe067bd;var _0x635de3={'messageId':_0x5eb616[_0xd629('0x74')][_0xd629('0x76')],'read':!![]};return _0x367609['update'](_0x635de3);});}else{return logger[_0xd629('0x17')](_0xd629('0x28'),_0xd629('0x29'),'intelepeer',util[_0xd629('0x2b')](_0x24c081,{'showHidden':![],'depth':null}));}})[_0xd629('0x16')](function(_0x3e6b2b){return logger['error'](_0xd629('0x28'),_0xd629('0x29'),_0xd629('0x72'),util[_0xd629('0x2b')](_0x3e6b2b,{'showHidden':![],'depth':null}));});}else{return logger[_0xd629('0x17')](_0xd629('0x28'),_0xd629('0x29'),_0xd629('0x72'),_0xd629('0x78'));}break;}}})[_0xd629('0x79')](function(){_0xd2e078();});}else{_0xd2e078();}}},'charset':_0xd629('0x7a'),'collate':_0xd629('0x7b')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index ce334bb..2deb974 100644 --- a/server/api/smsMessage/smsMessage.rpc.js +++ b/server/api/smsMessage/smsMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x03c2=['SmsMessage','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','redis','defaults','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateSmsMessage'];(function(_0x3e6209,_0x45a299){var _0x4b07bf=function(_0x5de0b1){while(--_0x5de0b1){_0x3e6209['push'](_0x3e6209['shift']());}};_0x4b07bf(++_0x45a299);}(_0x03c2,0x14e));var _0x203c=function(_0x30424b,_0xcce167){_0x30424b=_0x30424b-0x0;var _0x3c575c=_0x03c2[_0x30424b];return _0x3c575c;};'use strict';var _=require(_0x203c('0x0'));var util=require(_0x203c('0x1'));var moment=require(_0x203c('0x2'));var BPromise=require(_0x203c('0x3'));var rs=require(_0x203c('0x4'));var fs=require('fs');var Redis=require(_0x203c('0x5'));var db=require(_0x203c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x203c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x203c('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x203c('0x9')]=_[_0x203c('0xa')](config[_0x203c('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x203c('0xb'))(new Redis(config[_0x203c('0x9')]));require('./smsMessage.socket')[_0x203c('0xc')](socket);function respondWithRpcPromise(_0x1760b3,_0x4bd23f,_0x421870){return new BPromise(function(_0x57e4a0,_0x4c3abe){return client[_0x203c('0xd')](_0x1760b3,_0x421870)[_0x203c('0xe')](function(_0x2dd23a){logger[_0x203c('0xf')](_0x203c('0x10'),_0x4bd23f,'request\x20sent');logger[_0x203c('0x11')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4bd23f,_0x203c('0x12'),JSON[_0x203c('0x13')](_0x2dd23a));if(_0x2dd23a[_0x203c('0x14')]){if(_0x2dd23a[_0x203c('0x14')][_0x203c('0x15')]===0x1f4){logger[_0x203c('0x14')](_0x203c('0x10'),_0x4bd23f,_0x2dd23a[_0x203c('0x14')][_0x203c('0x16')]);return _0x4c3abe(_0x2dd23a[_0x203c('0x14')]['message']);}logger[_0x203c('0x14')](_0x203c('0x10'),_0x4bd23f,_0x2dd23a[_0x203c('0x14')][_0x203c('0x16')]);return _0x57e4a0(_0x2dd23a['error']['message']);}else{logger['info'](_0x203c('0x10'),_0x4bd23f,_0x203c('0x12'));_0x57e4a0(_0x2dd23a[_0x203c('0x17')]['message']);}})[_0x203c('0x18')](function(_0x388e89){logger[_0x203c('0x14')]('SmsMessage,\x20%s,\x20%s',_0x4bd23f,_0x388e89);_0x4c3abe(_0x388e89);});});}exports[_0x203c('0x19')]=function(_0x5bf422){var _0x14377b=this;return new Promise(function(_0x2d3142,_0x478603){return db[_0x203c('0x1a')][_0x203c('0x1b')](_0x5bf422[_0x203c('0x1c')],{'raw':_0x5bf422[_0x203c('0x1d')]?_0x5bf422[_0x203c('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x203c('0xe')](function(_0xbd1164){logger['info']('CreateSmsMessage',_0x5bf422);logger[_0x203c('0x11')](_0x203c('0x19'),_0x5bf422,JSON['stringify'](_0xbd1164));_0x2d3142(_0xbd1164);})[_0x203c('0x18')](function(_0x7e6b7){logger[_0x203c('0x14')](_0x203c('0x19'),_0x7e6b7[_0x203c('0x16')],_0x5bf422);_0x478603(_0x14377b[_0x203c('0x14')](0x1f4,_0x7e6b7[_0x203c('0x16')]));});});}; \ No newline at end of file +var _0xf98b=['stringify','error','code','message','result','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s'];(function(_0x46a0f8,_0x2d54c0){var _0x49e6fe=function(_0x3bfe8f){while(--_0x3bfe8f){_0x46a0f8['push'](_0x46a0f8['shift']());}};_0x49e6fe(++_0x2d54c0);}(_0xf98b,0x18c));var _0xbf98=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xf98b[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0xbf98('0x0'));var util=require(_0xbf98('0x1'));var moment=require(_0xbf98('0x2'));var BPromise=require(_0xbf98('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf98('0x4'));var db=require(_0xbf98('0x5'))['db'];var utils=require(_0xbf98('0x6'));var logger=require(_0xbf98('0x7'))(_0xbf98('0x8'));var config=require(_0xbf98('0x9'));var jayson=require(_0xbf98('0xa'));var client=jayson['client'][_0xbf98('0xb')]({'port':0x232a});config[_0xbf98('0xc')]=_[_0xbf98('0xd')](config[_0xbf98('0xc')],{'host':_0xbf98('0xe'),'port':0x18eb});var socket=require(_0xbf98('0xf'))(new Redis(config['redis']));require(_0xbf98('0x10'))['register'](socket);function respondWithRpcPromise(_0x148cfe,_0x31d525,_0x9bf643){return new BPromise(function(_0x4b45f7,_0x18fceb){return client[_0xbf98('0x11')](_0x148cfe,_0x9bf643)[_0xbf98('0x12')](function(_0x3e27ff){logger[_0xbf98('0x13')](_0xbf98('0x14'),_0x31d525,_0xbf98('0x15'));logger[_0xbf98('0x16')](_0xbf98('0x17'),_0x31d525,_0xbf98('0x15'),JSON[_0xbf98('0x18')](_0x3e27ff));if(_0x3e27ff[_0xbf98('0x19')]){if(_0x3e27ff['error'][_0xbf98('0x1a')]===0x1f4){logger['error'](_0xbf98('0x14'),_0x31d525,_0x3e27ff[_0xbf98('0x19')][_0xbf98('0x1b')]);return _0x18fceb(_0x3e27ff[_0xbf98('0x19')][_0xbf98('0x1b')]);}logger['error'](_0xbf98('0x14'),_0x31d525,_0x3e27ff[_0xbf98('0x19')][_0xbf98('0x1b')]);return _0x4b45f7(_0x3e27ff[_0xbf98('0x19')]['message']);}else{logger['info'](_0xbf98('0x14'),_0x31d525,_0xbf98('0x15'));_0x4b45f7(_0x3e27ff[_0xbf98('0x1c')][_0xbf98('0x1b')]);}})['catch'](function(_0x4ef0cd){logger['error'](_0xbf98('0x14'),_0x31d525,_0x4ef0cd);_0x18fceb(_0x4ef0cd);});});}exports[_0xbf98('0x1d')]=function(_0x39ab01){var _0x3e0125=this;return new Promise(function(_0x2b533b,_0x47f48f){return db[_0xbf98('0x1e')][_0xbf98('0x1f')](_0x39ab01[_0xbf98('0x20')],{'raw':_0x39ab01['options']?_0x39ab01[_0xbf98('0x21')][_0xbf98('0x22')]===undefined?!![]:![]:!![]})[_0xbf98('0x12')](function(_0x257847){logger[_0xbf98('0x13')](_0xbf98('0x1d'),_0x39ab01);logger[_0xbf98('0x16')](_0xbf98('0x1d'),_0x39ab01,JSON[_0xbf98('0x18')](_0x257847));_0x2b533b(_0x257847);})['catch'](function(_0x2ce710){logger['error'](_0xbf98('0x1d'),_0x2ce710[_0xbf98('0x1b')],_0x39ab01);_0x47f48f(_0x3e0125[_0xbf98('0x19')](0x1f4,_0x2ce710[_0xbf98('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 04628ab..f984c7c 100644 --- a/server/api/smsMessage/smsMessage.socket.js +++ b/server/api/smsMessage/smsMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5323=['save','update','emit','removeListener','length','./smsMessage.events'];(function(_0x4de1be,_0xec7b2b){var _0x445570=function(_0x169521){while(--_0x169521){_0x4de1be['push'](_0x4de1be['shift']());}};_0x445570(++_0xec7b2b);}(_0x5323,0x15b));var _0x3532=function(_0x24d298,_0x13198b){_0x24d298=_0x24d298-0x0;var _0x452663=_0x5323[_0x24d298];return _0x452663;};'use strict';var SmsMessageEvents=require(_0x3532('0x0'));var events=[_0x3532('0x1'),'remove',_0x3532('0x2')];function createListener(_0x9807d2,_0x5e7578){return function(_0xe1e309){_0x5e7578[_0x3532('0x3')](_0x9807d2,_0xe1e309);};}function removeListener(_0x5199dd,_0x199065){return function(){SmsMessageEvents[_0x3532('0x4')](_0x5199dd,_0x199065);};}exports['register']=function(_0x95fe97){for(var _0x4f739e=0x0,_0x2b11dd=events[_0x3532('0x5')];_0x4f739e<_0x2b11dd;_0x4f739e++){var _0xc04d9e=events[_0x4f739e];var _0x1af38e=createListener('smsMessage:'+_0xc04d9e,_0x95fe97);SmsMessageEvents['on'](_0xc04d9e,_0x1af38e);}}; \ No newline at end of file +var _0xb00f=['emit','removeListener','register','length','smsMessage:','./smsMessage.events','save','remove','update'];(function(_0x5ae7df,_0x1e55c3){var _0x58a29d=function(_0x1d99d2){while(--_0x1d99d2){_0x5ae7df['push'](_0x5ae7df['shift']());}};_0x58a29d(++_0x1e55c3);}(_0xb00f,0xe6));var _0xfb00=function(_0x4018ee,_0x22fe3d){_0x4018ee=_0x4018ee-0x0;var _0x472a2d=_0xb00f[_0x4018ee];return _0x472a2d;};'use strict';var SmsMessageEvents=require(_0xfb00('0x0'));var events=[_0xfb00('0x1'),_0xfb00('0x2'),_0xfb00('0x3')];function createListener(_0x3691b8,_0x349849){return function(_0x5a751e){_0x349849[_0xfb00('0x4')](_0x3691b8,_0x5a751e);};}function removeListener(_0x52f129,_0x342512){return function(){SmsMessageEvents[_0xfb00('0x5')](_0x52f129,_0x342512);};}exports[_0xfb00('0x6')]=function(_0x32ea9e){for(var _0x5afed6=0x0,_0x3f1352=events[_0xfb00('0x7')];_0x5afed6<_0x3f1352;_0x5afed6++){var _0x50b7f0=events[_0x5afed6];var _0x1e0b79=createListener(_0xfb00('0x8')+_0x50b7f0,_0x32ea9e);SmsMessageEvents['on'](_0x50b7f0,_0x1e0b79);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 305498b..615940b 100644 --- a/server/api/smsQueue/index.js +++ b/server/api/smsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d1d=['/:id/users','post','create','addTeams','addAgents','put','/:id','update','delete','destroy','/:id/teams','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams'];(function(_0x561771,_0x554760){var _0x54d16e=function(_0x381c1f){while(--_0x381c1f){_0x561771['push'](_0x561771['shift']());}};_0x54d16e(++_0x554760);}(_0x6d1d,0xce));var _0xd6d1=function(_0x5f603,_0x5b6622){_0x5f603=_0x5f603-0x0;var _0x31dc1b=_0x6d1d[_0x5f603];return _0x31dc1b;};'use strict';var multer=require(_0xd6d1('0x0'));var util=require(_0xd6d1('0x1'));var path=require(_0xd6d1('0x2'));var timeout=require(_0xd6d1('0x3'));var express=require(_0xd6d1('0x4'));var router=express['Router']();var fs_extra=require(_0xd6d1('0x5'));var auth=require(_0xd6d1('0x6'));var interaction=require(_0xd6d1('0x7'));var config=require(_0xd6d1('0x8'));var controller=require('./smsQueue.controller');router[_0xd6d1('0x9')]('/',auth[_0xd6d1('0xa')](),controller[_0xd6d1('0xb')]);router[_0xd6d1('0x9')](_0xd6d1('0xc'),auth[_0xd6d1('0xa')](),controller[_0xd6d1('0xd')]);router[_0xd6d1('0x9')]('/:id',auth[_0xd6d1('0xa')](),controller[_0xd6d1('0xe')]);router[_0xd6d1('0x9')](_0xd6d1('0xf'),auth[_0xd6d1('0xa')](),controller[_0xd6d1('0x10')]);router[_0xd6d1('0x9')]('/:id/teams',auth[_0xd6d1('0xa')](),controller[_0xd6d1('0x11')]);router['get'](_0xd6d1('0x12'),auth[_0xd6d1('0xa')](),controller['getAgents']);router[_0xd6d1('0x13')]('/',auth[_0xd6d1('0xa')](),controller[_0xd6d1('0x14')]);router['post']('/:id/teams',auth[_0xd6d1('0xa')](),controller[_0xd6d1('0x15')]);router[_0xd6d1('0x13')](_0xd6d1('0x12'),auth['isAuthenticated'](),controller[_0xd6d1('0x16')]);router[_0xd6d1('0x17')](_0xd6d1('0x18'),auth[_0xd6d1('0xa')](),controller[_0xd6d1('0x19')]);router[_0xd6d1('0x1a')](_0xd6d1('0x18'),auth[_0xd6d1('0xa')](),controller[_0xd6d1('0x1b')]);router[_0xd6d1('0x1a')](_0xd6d1('0x1c'),auth[_0xd6d1('0xa')](),controller[_0xd6d1('0x1d')]);router[_0xd6d1('0x1a')](_0xd6d1('0x12'),auth[_0xd6d1('0xa')](),controller[_0xd6d1('0x1e')]);module[_0xd6d1('0x1f')]=router; \ No newline at end of file +var _0x0c8b=['removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','/:id','show','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete','destroy','removeTeams'];(function(_0x10213e,_0x9c65f0){var _0x2af929=function(_0x588e75){while(--_0x588e75){_0x10213e['push'](_0x10213e['shift']());}};_0x2af929(++_0x9c65f0);}(_0x0c8b,0x65));var _0xb0c8=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x0c8b[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0xb0c8('0x0'));var util=require(_0xb0c8('0x1'));var path=require(_0xb0c8('0x2'));var timeout=require(_0xb0c8('0x3'));var express=require(_0xb0c8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb0c8('0x5'));var interaction=require(_0xb0c8('0x6'));var config=require('../../config/environment');var controller=require(_0xb0c8('0x7'));router[_0xb0c8('0x8')]('/',auth[_0xb0c8('0x9')](),controller['index']);router[_0xb0c8('0x8')]('/describe',auth[_0xb0c8('0x9')](),controller['describe']);router[_0xb0c8('0x8')](_0xb0c8('0xa'),auth[_0xb0c8('0x9')](),controller[_0xb0c8('0xb')]);router[_0xb0c8('0x8')]('/:id/members',auth[_0xb0c8('0x9')](),controller['getMembers']);router[_0xb0c8('0x8')](_0xb0c8('0xc'),auth[_0xb0c8('0x9')](),controller[_0xb0c8('0xd')]);router['get'](_0xb0c8('0xe'),auth[_0xb0c8('0x9')](),controller[_0xb0c8('0xf')]);router[_0xb0c8('0x10')]('/',auth[_0xb0c8('0x9')](),controller[_0xb0c8('0x11')]);router[_0xb0c8('0x10')](_0xb0c8('0xc'),auth[_0xb0c8('0x9')](),controller[_0xb0c8('0x12')]);router[_0xb0c8('0x10')](_0xb0c8('0xe'),auth[_0xb0c8('0x9')](),controller['addAgents']);router[_0xb0c8('0x13')](_0xb0c8('0xa'),auth[_0xb0c8('0x9')](),controller[_0xb0c8('0x14')]);router[_0xb0c8('0x15')](_0xb0c8('0xa'),auth['isAuthenticated'](),controller[_0xb0c8('0x16')]);router[_0xb0c8('0x15')](_0xb0c8('0xc'),auth[_0xb0c8('0x9')](),controller[_0xb0c8('0x17')]);router[_0xb0c8('0x15')](_0xb0c8('0xe'),auth['isAuthenticated'](),controller[_0xb0c8('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 56b88af..f2396e8 100644 --- a/server/api/smsQueue/smsQueue.attributes.js +++ b/server/api/smsQueue/smsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x26bd=['sequelize','STRING','name','INTEGER','ENUM','beepall'];(function(_0x33a551,_0x1967c6){var _0x216432=function(_0x5975fd){while(--_0x5975fd){_0x33a551['push'](_0x33a551['shift']());}};_0x216432(++_0x1967c6);}(_0x26bd,0x108));var _0xd26b=function(_0x52538b,_0xc2fabe){_0x52538b=_0x52538b-0x0;var _0x5ebbe3=_0x26bd[_0x52538b];return _0x5ebbe3;};'use strict';var Sequelize=require(_0xd26b('0x0'));module['exports']={'name':{'type':Sequelize[_0xd26b('0x1')],'unique':_0xd26b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd26b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd26b('0x4')]('rrmemory',_0xd26b('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x62cb=['STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize','exports'];(function(_0x29cb9b,_0x247dd1){var _0x544ff3=function(_0x5919b2){while(--_0x5919b2){_0x29cb9b['push'](_0x29cb9b['shift']());}};_0x544ff3(++_0x247dd1);}(_0x62cb,0x10e));var _0xb62c=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x62cb[_0x1deb03];return _0x189fe7;};'use strict';var Sequelize=require(_0xb62c('0x0'));module[_0xb62c('0x1')]={'name':{'type':Sequelize[_0xb62c('0x2')],'unique':_0xb62c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb62c('0x2')]},'timeout':{'type':Sequelize[_0xb62c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb62c('0x5')](_0xb62c('0x6'),_0xb62c('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 08ac6b7..5162d65 100644 --- a/server/api/smsQueue/smsQueue.controller.js +++ b/server/api/smsQueue/smsQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['transaction','addTeams','each','findOrCreate','userSmsQueue:save','removeTeams','Team','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','QueryTypes','SELECT','every','includes','all','compact','isEmpty','forEach','userSmsQueue:remove','addAgents','omit','emit','removeAgents','isArray','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','then','get','SmsQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','SmsQueue','include','rows','catch','show','params','model','query','intersection','fields','attributes','includeAll','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','limit','order','sort','filters','pick','filter','User','UserId','createdAt','format','%s/%s','smsPause','getTeams','keys','nolimit','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize'];(function(_0x5ab048,_0x1f792c){var _0x177cb5=function(_0x39c06f){while(--_0x39c06f){_0x5ab048['push'](_0x5ab048['shift']());}};_0x177cb5(++_0x1f792c);}(_0x7a54,0x106));var _0x47a5=function(_0x31cda3,_0x771a){_0x31cda3=_0x31cda3-0x0;var _0x3e1a03=_0x7a54[_0x31cda3];return _0x3e1a03;};'use strict';var BPromise=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var squel=require('squel');var Redis=require(_0x47a5('0x3'));var qs=require(_0x47a5('0x4'));var logger=require('../../config/logger')(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var db=require(_0x47a5('0x7'))['db'];config[_0x47a5('0x8')]=_[_0x47a5('0x9')](config['redis'],{'host':_0x47a5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x8')]));require(_0x47a5('0xb'))['register'](socket);function respondWithStatusCode(_0x194fb0,_0x5077f3){_0x5077f3=_0x5077f3||0xcc;return function(_0x5d90b3){if(_0x5d90b3){return _0x194fb0['sendStatus'](_0x5077f3);}return _0x194fb0[_0x47a5('0xc')](_0x5077f3)[_0x47a5('0xd')]();};}function respondWithResult(_0x5e31dd,_0x2eb0dd){_0x2eb0dd=_0x2eb0dd||0xc8;return function(_0x49e844){if(_0x49e844){return _0x5e31dd['status'](_0x2eb0dd)[_0x47a5('0xe')](_0x49e844);}};}function respondWithFilteredResult(_0x69e4d4,_0x2f399b){return function(_0x250fad){if(_0x250fad){var _0xd612dd=typeof _0x2f399b[_0x47a5('0xf')]===_0x47a5('0x10')&&typeof _0x2f399b['limit']===_0x47a5('0x10');var _0x221b54=_0x250fad[_0x47a5('0x11')];var _0x711793=_0xd612dd?0x0:_0x2f399b[_0x47a5('0xf')];var _0x620ee9=_0xd612dd?_0x250fad[_0x47a5('0x11')]:_0x2f399b[_0x47a5('0xf')]+_0x2f399b['limit'];var _0x362359;if(_0x620ee9>=_0x221b54){_0x620ee9=_0x221b54;_0x362359=0xc8;}else{_0x362359=0xce;}_0x69e4d4[_0x47a5('0xc')](_0x362359);return _0x69e4d4[_0x47a5('0x12')](_0x47a5('0x13'),_0x711793+'-'+_0x620ee9+'/'+_0x221b54)[_0x47a5('0xe')](_0x250fad);}return null;};}function saveUpdates(_0x574af6){return function(_0x549de3){if(_0x549de3){return _0x549de3[_0x47a5('0x14')](_0x574af6)['then'](function(_0x5247fd){return _0x5247fd;});}return null;};}function removeEntity(_0x423a81){return function(_0xaf70a6){if(_0xaf70a6){return _0xaf70a6[_0x47a5('0x15')]()[_0x47a5('0x16')](function(){var _0x477b1d=_0xaf70a6[_0x47a5('0x17')]({'plain':!![]});var _0x2763d6=_0x47a5('0x18');return db[_0x47a5('0x19')]['destroy']({'where':{'type':_0x2763d6,'resourceId':_0x477b1d['id']}})[_0x47a5('0x16')](function(){return _0xaf70a6;});})[_0x47a5('0x16')](function(){_0x423a81['status'](0xcc)[_0x47a5('0xd')]();});}};}function handleEntityNotFound(_0x1f03f7){return function(_0x36874d){if(!_0x36874d){_0x1f03f7['sendStatus'](0x194);}return _0x36874d;};}function handleError(_0xb8ae6c,_0x2f142b){_0x2f142b=_0x2f142b||0x1f4;return function(_0x23db32){logger[_0x47a5('0x1a')](_0x23db32['stack']);if(_0x23db32[_0x47a5('0x1b')]){delete _0x23db32[_0x47a5('0x1b')];}_0xb8ae6c['status'](_0x2f142b)[_0x47a5('0x1c')](_0x23db32);};}exports[_0x47a5('0x1d')]=function(_0x4437f1,_0x129ce5){var _0x3abd6a={};var _0x50bf17={'count':0x0,'rows':[]};var _0x53078a=_[_0x47a5('0x1e')](db['SmsQueue'][_0x47a5('0x1f')],function(_0x5b6c4e){return{'name':_0x5b6c4e[_0x47a5('0x20')],'type':_0x5b6c4e[_0x47a5('0x21')][_0x47a5('0x22')]};});_0x3abd6a=qs[_0x47a5('0x23')](_0x53078a,_0x4437f1);var _0x21f296={'where':_0x3abd6a[_0x47a5('0x24')]};return db[_0x47a5('0x25')][_0x47a5('0x11')](_0x21f296)[_0x47a5('0x16')](function(_0x361bfa){_0x50bf17[_0x47a5('0x11')]=_0x361bfa;_0x3abd6a[_0x47a5('0x26')]=qs[_0x47a5('0x26')](_0x4437f1['query']);return db[_0x47a5('0x25')]['findAll'](_0x3abd6a);})[_0x47a5('0x16')](function(_0x9ac908){_0x50bf17[_0x47a5('0x27')]=_0x9ac908;return _0x50bf17;})['then'](respondWithFilteredResult(_0x129ce5,_0x3abd6a))[_0x47a5('0x28')](handleError(_0x129ce5,null));};exports[_0x47a5('0x29')]=function(_0x39b50b,_0x1f1c68){var _0x51cc81={'raw':!![],'where':{'id':_0x39b50b[_0x47a5('0x2a')]['id']}},_0x50d875={};_0x50d875[_0x47a5('0x2b')]=_['keys'](db['SmsQueue'][_0x47a5('0x1f')]);_0x50d875[_0x47a5('0x2c')]=_['keys'](_0x39b50b[_0x47a5('0x2c')]);_0x50d875['filters']=_[_0x47a5('0x2d')](_0x50d875[_0x47a5('0x2b')],_0x50d875['query']);_0x51cc81['attributes']=_[_0x47a5('0x2d')](_0x50d875['model'],qs[_0x47a5('0x2e')](_0x39b50b[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x51cc81['attributes']=_0x51cc81[_0x47a5('0x2f')]['length']?_0x51cc81['attributes']:_0x50d875[_0x47a5('0x2b')];if(_0x39b50b['query'][_0x47a5('0x30')]){_0x51cc81['include']=[{'all':!![]}];}_0x51cc81=_[_0x47a5('0x31')]({},_0x51cc81,_0x39b50b[_0x47a5('0x32')]);return db[_0x47a5('0x25')][_0x47a5('0x33')](_0x51cc81)[_0x47a5('0x16')](handleEntityNotFound(_0x1f1c68,null))[_0x47a5('0x16')](respondWithResult(_0x1f1c68,null))[_0x47a5('0x28')](handleError(_0x1f1c68,null));};exports[_0x47a5('0x34')]=function(_0x1a0d23,_0x4caed5){return db[_0x47a5('0x25')][_0x47a5('0x34')](_0x1a0d23['body'],{})[_0x47a5('0x16')](function(_0x2bf53d){var _0x1d4348=_0x1a0d23['user'][_0x47a5('0x17')]({'plain':!![]});if(!_0x1d4348)throw new Error(_0x47a5('0x35'));if(_0x1d4348['role']===_0x47a5('0x36')){var _0x19218a=_0x2bf53d['get']({'plain':!![]});var _0x55c5eb='SmsQueues';return db[_0x47a5('0x37')]['find']({'where':{'name':_0x55c5eb,'userProfileId':_0x1d4348[_0x47a5('0x38')]},'raw':!![]})[_0x47a5('0x16')](function(_0x301a85){if(_0x301a85&&_0x301a85[_0x47a5('0x39')]===0x0){return db[_0x47a5('0x19')][_0x47a5('0x34')]({'name':_0x19218a[_0x47a5('0x1b')],'resourceId':_0x19218a['id'],'type':_0x301a85[_0x47a5('0x1b')],'sectionId':_0x301a85['id']},{})[_0x47a5('0x16')](function(){return _0x2bf53d;});}else{return _0x2bf53d;}})[_0x47a5('0x28')](function(_0x280500){logger[_0x47a5('0x1a')](_0x47a5('0x3a'),_0x280500);throw _0x280500;});}return _0x2bf53d;})['then'](respondWithResult(_0x4caed5,0xc9))[_0x47a5('0x28')](handleError(_0x4caed5,null));};exports[_0x47a5('0x14')]=function(_0x331474,_0x23bd8d){if(_0x331474['body']['id']){delete _0x331474[_0x47a5('0x3b')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x331474['params']['id']}})['then'](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x16')](saveUpdates(_0x331474['body'],null))[_0x47a5('0x16')](respondWithResult(_0x23bd8d,null))[_0x47a5('0x28')](handleError(_0x23bd8d,null));};exports[_0x47a5('0x15')]=function(_0x494526,_0x3805fd){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x494526['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3805fd,null))['then'](removeEntity(_0x3805fd,null))[_0x47a5('0x28')](handleError(_0x3805fd,null));};exports[_0x47a5('0x3c')]=function(_0x188614,_0xd75ca3){return db[_0x47a5('0x25')][_0x47a5('0x3c')]()[_0x47a5('0x16')](respondWithResult(_0xd75ca3,null))[_0x47a5('0x28')](handleError(_0xd75ca3,null));};exports[_0x47a5('0x3d')]=function(_0x162fa0,_0x24ecb1){var _0x3c3ebf={'raw':!![],'where':{}},_0xe28d76={},_0x3574d4;return db[_0x47a5('0x25')][_0x47a5('0x3e')]({'where':{'id':_0x162fa0['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x24ecb1,null))[_0x47a5('0x16')](function(_0x49eab1){if(_0x49eab1){_0x3574d4=_0x49eab1['get']({'plain':!![]});_0xe28d76[_0x47a5('0x2b')]=_['keys'](db[_0x47a5('0x3f')][_0x47a5('0x1f')]);_0xe28d76['query']=_['keys'](_0x162fa0[_0x47a5('0x2c')]);_0xe28d76['filters']=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],_0xe28d76[_0x47a5('0x2c')]);_0x3c3ebf[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x162fa0['query']['fields']));_0x3c3ebf[_0x47a5('0x2f')]=_0x3c3ebf[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x3c3ebf[_0x47a5('0x2f')]:_0xe28d76[_0x47a5('0x2b')];if(!_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x41')]('nolimit')){_0x3c3ebf[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x162fa0[_0x47a5('0x2c')]['limit']);_0x3c3ebf[_0x47a5('0xf')]=qs['offset'](_0x162fa0[_0x47a5('0x2c')][_0x47a5('0xf')]);}_0x3c3ebf[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x162fa0['query'][_0x47a5('0x44')]);_0x3c3ebf[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_[_0x47a5('0x46')](_0x162fa0[_0x47a5('0x2c')],_0xe28d76[_0x47a5('0x45')]));_0x3c3ebf[_0x47a5('0x24')]['SmsQueueId']=_0x49eab1['id'];if(_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x3c3ebf[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x3c3ebf[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x3c3ebf['attributes'],function(_0x1ad6a9){var _0x245a15={};_0x245a15[_0x1ad6a9]={'$like':'%'+_0x162fa0[_0x47a5('0x2c')]['filter']+'%'};return _0x245a15;})});}_0x3c3ebf=_[_0x47a5('0x31')]({},_0x3c3ebf,_0x162fa0[_0x47a5('0x32')]);return db[_0x47a5('0x3f')]['findAll'](_0x3c3ebf);}})['then'](function(_0x274e38){if(_0x274e38){return db[_0x47a5('0x48')]['findAndCountAll']({'where':{'id':_['map'](_0x274e38,_0x47a5('0x49')),'role':'agent'},'attributes':['id',_0x47a5('0x1b'),'smsPause','updatedAt',_0x47a5('0x4a')]});}})[_0x47a5('0x16')](function(_0x53eedf){if(_0x53eedf){return{'count':_0x53eedf[_0x47a5('0x11')],'rows':_[_0x47a5('0x1e')](_0x53eedf['rows'],function(_0x5b6127){return{'membername':_0x5b6127[_0x47a5('0x1b')],'UserId':_0x5b6127['id'],'queue_name':_0x3574d4[_0x47a5('0x1b')],'SmsQueueId':_0x3574d4['id'],'interface':util[_0x47a5('0x4b')](_0x47a5('0x4c'),'SIP',_0x5b6127[_0x47a5('0x1b')]),'penalty':0x0,'paused':_0x5b6127[_0x47a5('0x4d')],'createdAt':_0x5b6127[_0x47a5('0x4a')],'updatedAt':_0x5b6127['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x47a5('0x16')](respondWithFilteredResult(_0x24ecb1,_0x3c3ebf))['catch'](handleError(_0x24ecb1,null));};exports[_0x47a5('0x4e')]=function(_0x470da6,_0x943a15){var _0x1c485b={};var _0x3603b7={};var _0x4966af;var _0x144af9;return db['SmsQueue']['findOne']({'where':{'id':_0x470da6['params']['id']}})['then'](handleEntityNotFound(_0x943a15,null))[_0x47a5('0x16')](function(_0x6cd4ea){if(_0x6cd4ea){_0x4966af=_0x6cd4ea;_0x3603b7[_0x47a5('0x2b')]=_['keys'](db['Team'][_0x47a5('0x1f')]);_0x3603b7[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x470da6[_0x47a5('0x2c')]);_0x3603b7[_0x47a5('0x45')]=_['intersection'](_0x3603b7[_0x47a5('0x2b')],_0x3603b7['query']);_0x1c485b[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0x3603b7['model'],qs[_0x47a5('0x2e')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x1c485b[_0x47a5('0x2f')]=_0x1c485b[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x1c485b[_0x47a5('0x2f')]:_0x3603b7[_0x47a5('0x2b')];_0x1c485b['order']=qs[_0x47a5('0x44')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x44')]);_0x1c485b[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x470da6[_0x47a5('0x2c')],_0x3603b7[_0x47a5('0x45')]));if(_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x1c485b[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x1c485b[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x1c485b[_0x47a5('0x2f')],function(_0x44cb90){var _0x1d56f3={};_0x1d56f3[_0x44cb90]={'$like':'%'+_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x1d56f3;})});}_0x1c485b=_[_0x47a5('0x31')]({},_0x1c485b,_0x470da6[_0x47a5('0x32')]);return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x284fb8){if(_0x284fb8){_0x144af9=_0x284fb8[_0x47a5('0x40')];if(!_0x470da6['query'][_0x47a5('0x41')](_0x47a5('0x50'))){_0x1c485b[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x470da6['query'][_0x47a5('0x42')]);_0x1c485b['offset']=qs[_0x47a5('0xf')](_0x470da6['query'][_0x47a5('0xf')]);}return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x2f27c3){if(_0x2f27c3){return _0x2f27c3?{'count':_0x144af9,'rows':_0x2f27c3}:null;}})[_0x47a5('0x16')](respondWithResult(_0x943a15,null))['catch'](handleError(_0x943a15,null));};exports['addTeams']=function(_0x4b8084,_0x4164a3){var _0x2b1303=_0x4b8084[_0x47a5('0x3b')][_0x47a5('0x51')];return db['Team'][_0x47a5('0x52')]({'where':{'id':_0x2b1303},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id',_0x47a5('0x1b'),_0x47a5('0x54'),_0x47a5('0x55'),_0x47a5('0x56')],'raw':!![]}]})[_0x47a5('0x16')](function(_0x4618a0){if(_0x4618a0){var _0xc69a68=_[_0x47a5('0x57')](_0x4618a0,function(_0x463e5e){var _0x49d3dc=_0x463e5e[_0x47a5('0x17')]({'plain':!![]});return _0x49d3dc['Agents'];});return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x4b8084[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x40e584){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x448981){return _0x40e584[_0x47a5('0x5a')](_0x2b1303,{'transaction':_0x448981})[_0x47a5('0x16')](function(){return BPromise[_0x47a5('0x5b')](_0xc69a68,function(_0x1f07ac){return db[_0x47a5('0x3f')][_0x47a5('0x5c')]({'where':{'UserId':_0x1f07ac['id'],'SmsQueueId':_0x4b8084[_0x47a5('0x2a')]['id']},'transaction':_0x448981});});})['then'](function(){_0xc69a68['forEach'](function(_0x5ccc89){socket['emit'](_0x47a5('0x5d'),{'UserId':_0x5ccc89['id'],'SmsQueueId':_0x40e584['id']});});});});});}})[_0x47a5('0x16')](respondWithStatusCode(_0x4164a3,null))['catch'](handleError(_0x4164a3,null));};exports[_0x47a5('0x5e')]=function(_0x44dda2,_0x1baa5a){return db[_0x47a5('0x5f')][_0x47a5('0x52')]({'where':{'id':_0x44dda2[_0x47a5('0x2c')][_0x47a5('0x51')]},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id'],'raw':!![]}]})[_0x47a5('0x16')](handleEntityNotFound(_0x1baa5a,null))[_0x47a5('0x16')](function(_0x5e5f16){var _0x18fa31=_[_0x47a5('0x1e')](_0x5e5f16,'id');var _0x420671=[];var _0x4f35ff=[];var _0x340846=squel[_0x47a5('0x60')]();_0x340846[_0x47a5('0x61')]('tq.TeamId')[_0x47a5('0x62')]('team_has_sms_queues','tq')['join'](_0x47a5('0x63'),'ut',_0x47a5('0x64'))[_0x47a5('0x24')](_0x47a5('0x65'),_0x44dda2[_0x47a5('0x2a')]['id']);for(var _0xea50f3=0x0;_0xea50f3<_0x5e5f16['length'];_0xea50f3+=0x1){let _0x592322=_0x5e5f16[_0xea50f3];for(var _0x3e0dbd=0x0;_0x3e0dbd<_0x592322['Agents'][_0x47a5('0x40')];_0x3e0dbd+=0x1){let _0x3fffd1=_0x592322[_0x47a5('0x53')][_0x3e0dbd];var _0xb16bdd=_0x340846['clone']();_0xb16bdd[_0x47a5('0x24')]('ut.UserId\x20=\x20?',_0x3fffd1['id']);_0x4f35ff['push'](db[_0x47a5('0x58')][_0x47a5('0x2c')](_0xb16bdd['toString'](),{'type':db[_0x47a5('0x58')][_0x47a5('0x66')][_0x47a5('0x67')]})['then'](function(_0x280372){if(_0x280372['length']===0x1){return _0x3fffd1['id'];}else{var _0x2307da=_[_0x47a5('0x68')](_[_0x47a5('0x1e')](_0x280372,'TeamId'),function(_0x2e0af1){return _[_0x47a5('0x69')](_0x18fa31,_0x2e0af1);});if(_0x2307da){return _0x3fffd1['id'];}}}));}}return BPromise[_0x47a5('0x6a')](_0x4f35ff)['then'](function(_0x3525e7){_0x420671=_(_0x420671)['union'](_0x3525e7)[_0x47a5('0x6b')]()['value']();return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x44dda2[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x51738b){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x23c393){return _0x51738b[_0x47a5('0x5e')](_0x44dda2[_0x47a5('0x2c')]['ids'],{'transaction':_0x23c393})['then'](function(){if(!_[_0x47a5('0x6c')](_0x420671)){return _0x51738b['removeAgents'](_0x420671,{'transaction':_0x23c393});}})[_0x47a5('0x16')](function(){_0x420671[_0x47a5('0x6d')](function(_0x216402){socket['emit'](_0x47a5('0x6e'),{'UserId':_0x216402,'SmsQueueId':_0x51738b['id']});});});});});});})[_0x47a5('0x16')](respondWithStatusCode(_0x1baa5a,null))['catch'](handleError(_0x1baa5a,null));};exports[_0x47a5('0x6f')]=function(_0x8a9dea,_0x19acfa){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x8a9dea['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x19acfa,null))[_0x47a5('0x16')](function(_0x48e7f3){if(_0x48e7f3){return _0x48e7f3[_0x47a5('0x6f')](_0x8a9dea[_0x47a5('0x3b')]['ids'],_[_0x47a5('0x70')](_0x8a9dea[_0x47a5('0x3b')],[_0x47a5('0x51'),'id'])||{})['spread'](function(_0x3f2ad9){for(var _0x59b4a5=0x0;_0x59b4a5<_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x47a5('0x40')];_0x59b4a5+=0x1){socket[_0x47a5('0x71')]('userSmsQueue:save',{'UserId':Number(_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x59b4a5]),'SmsQueueId':Number(_0x8a9dea[_0x47a5('0x2a')]['id'])});}return _0x3f2ad9;});}})[_0x47a5('0x16')](respondWithResult(_0x19acfa,null))[_0x47a5('0x28')](handleError(_0x19acfa,null));};exports[_0x47a5('0x72')]=function(_0x49b76a,_0x3eb5c1){return db['SmsQueue']['find']({'where':{'id':_0x49b76a[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3eb5c1,null))[_0x47a5('0x16')](function(_0x96fb22){if(_0x96fb22){return _0x96fb22[_0x47a5('0x72')](_0x49b76a['query'][_0x47a5('0x51')])[_0x47a5('0x16')](function(){if(_[_0x47a5('0x73')](_0x49b76a[_0x47a5('0x2c')]['ids'])){for(var _0x240db9=0x0;_0x240db9<_0x49b76a['query'][_0x47a5('0x51')][_0x47a5('0x40')];_0x240db9+=0x1){socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a[_0x47a5('0x2c')][_0x47a5('0x51')][_0x240db9]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}}else{socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a['query'][_0x47a5('0x51')]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3eb5c1,null))[_0x47a5('0x28')](handleError(_0x3eb5c1,null));};exports[_0x47a5('0x74')]=function(_0x6d6a5,_0x5b85cd){var _0x4bf1f5={};var _0x126bb1={};var _0x3d7371;var _0x47fbb6;return db['SmsQueue'][_0x47a5('0x3e')]({'where':{'id':_0x6d6a5[_0x47a5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x16')](function(_0x269ff6){if(_0x269ff6){_0x3d7371=_0x269ff6;_0x126bb1['model']=_[_0x47a5('0x4f')](db[_0x47a5('0x48')][_0x47a5('0x1f')]);_0x126bb1[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x6d6a5[_0x47a5('0x2c')]);_0x126bb1['filters']=_['intersection'](_0x126bb1['model'],_0x126bb1[_0x47a5('0x2c')]);_0x4bf1f5[_0x47a5('0x2f')]=_['intersection'](_0x126bb1[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x4bf1f5[_0x47a5('0x2f')]=_0x4bf1f5['attributes'][_0x47a5('0x40')]?_0x4bf1f5['attributes']:_0x126bb1['model'];_0x4bf1f5['order']=qs[_0x47a5('0x44')](_0x6d6a5['query'][_0x47a5('0x44')]);_0x4bf1f5[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x6d6a5[_0x47a5('0x2c')],_0x126bb1[_0x47a5('0x45')]));if(_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x4bf1f5[_0x47a5('0x24')]=_['merge'](_0x4bf1f5[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x4bf1f5['attributes'],function(_0x42ba59){var _0x419870={};_0x419870[_0x42ba59]={'$like':'%'+_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x419870;})});}_0x4bf1f5=_[_0x47a5('0x31')]({},_0x4bf1f5,_0x6d6a5[_0x47a5('0x32')]);return _0x3d7371['getAgents'](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x2e418d){if(_0x2e418d){_0x47fbb6=_0x2e418d['length'];if(!_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x41')](_0x47a5('0x50'))){_0x4bf1f5[_0x47a5('0x42')]=qs['limit'](_0x6d6a5['query']['limit']);_0x4bf1f5['offset']=qs[_0x47a5('0xf')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0xf')]);}return _0x3d7371[_0x47a5('0x74')](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x6bc37b){if(_0x6bc37b){return _0x6bc37b?{'count':_0x47fbb6,'rows':_0x6bc37b}:null;}})[_0x47a5('0x16')](respondWithResult(_0x5b85cd,null))[_0x47a5('0x28')](handleError(_0x5b85cd,null));}; \ No newline at end of file +var _0x5f2f=['redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','map','SmsQueue','rawAttributes','type','key','getOptions','where','include','findAll','rows','show','params','model','keys','query','filters','intersection','attributes','fields','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','field','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','sequelize','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api'];(function(_0x25023b,_0x383839){var _0x48b984=function(_0x3d3258){while(--_0x3d3258){_0x25023b['push'](_0x25023b['shift']());}};_0x48b984(++_0x383839);}(_0x5f2f,0x73));var _0xf5f2=function(_0x40d7b6,_0x299c45){_0x40d7b6=_0x40d7b6-0x0;var _0x203f97=_0x5f2f[_0x40d7b6];return _0x203f97;};'use strict';var BPromise=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var squel=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var qs=require(_0xf5f2('0x5'));var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xf5f2('0x8')]=_[_0xf5f2('0x9')](config[_0xf5f2('0x8')],{'host':_0xf5f2('0xa'),'port':0x18eb});var socket=require(_0xf5f2('0xb'))(new Redis(config[_0xf5f2('0x8')]));require('./smsQueue.socket')[_0xf5f2('0xc')](socket);function respondWithStatusCode(_0x46cd9c,_0x2ec345){_0x2ec345=_0x2ec345||0xcc;return function(_0x56a69f){if(_0x56a69f){return _0x46cd9c[_0xf5f2('0xd')](_0x2ec345);}return _0x46cd9c[_0xf5f2('0xe')](_0x2ec345)[_0xf5f2('0xf')]();};}function respondWithResult(_0x4e0e6b,_0x977a59){_0x977a59=_0x977a59||0xc8;return function(_0x4ebbbe){if(_0x4ebbbe){return _0x4e0e6b['status'](_0x977a59)[_0xf5f2('0x10')](_0x4ebbbe);}};}function respondWithFilteredResult(_0x151aba,_0x4b78cd){return function(_0x336f6b){if(_0x336f6b){var _0x14b51f=typeof _0x4b78cd[_0xf5f2('0x11')]===_0xf5f2('0x12')&&typeof _0x4b78cd[_0xf5f2('0x13')]===_0xf5f2('0x12');var _0x5c01b8=_0x336f6b[_0xf5f2('0x14')];var _0xea612c=_0x14b51f?0x0:_0x4b78cd[_0xf5f2('0x11')];var _0x1c1a5c=_0x14b51f?_0x336f6b[_0xf5f2('0x14')]:_0x4b78cd['offset']+_0x4b78cd[_0xf5f2('0x13')];var _0x286197;if(_0x1c1a5c>=_0x5c01b8){_0x1c1a5c=_0x5c01b8;_0x286197=0xc8;}else{_0x286197=0xce;}_0x151aba[_0xf5f2('0xe')](_0x286197);return _0x151aba[_0xf5f2('0x15')](_0xf5f2('0x16'),_0xea612c+'-'+_0x1c1a5c+'/'+_0x5c01b8)[_0xf5f2('0x10')](_0x336f6b);}return null;};}function saveUpdates(_0xdb61b3){return function(_0x395a5a){if(_0x395a5a){return _0x395a5a[_0xf5f2('0x17')](_0xdb61b3)[_0xf5f2('0x18')](function(_0x20fccd){return _0x20fccd;});}return null;};}function removeEntity(_0x28e097){return function(_0x4ff59b){if(_0x4ff59b){return _0x4ff59b[_0xf5f2('0x19')]()[_0xf5f2('0x18')](function(){var _0x626999=_0x4ff59b[_0xf5f2('0x1a')]({'plain':!![]});var _0x56acc5=_0xf5f2('0x1b');return db[_0xf5f2('0x1c')]['destroy']({'where':{'type':_0x56acc5,'resourceId':_0x626999['id']}})['then'](function(){return _0x4ff59b;});})[_0xf5f2('0x18')](function(){_0x28e097[_0xf5f2('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45b74f){return function(_0x170042){if(!_0x170042){_0x45b74f[_0xf5f2('0xd')](0x194);}return _0x170042;};}function handleError(_0x39c024,_0x36f1cb){_0x36f1cb=_0x36f1cb||0x1f4;return function(_0x4c691a){logger[_0xf5f2('0x1d')](_0x4c691a[_0xf5f2('0x1e')]);if(_0x4c691a[_0xf5f2('0x1f')]){delete _0x4c691a[_0xf5f2('0x1f')];}_0x39c024[_0xf5f2('0xe')](_0x36f1cb)['send'](_0x4c691a);};}exports['index']=function(_0x5f1124,_0x3f79d5){var _0x13da6f={};var _0x1a5bb3={'count':0x0,'rows':[]};var _0xf6c58d=_[_0xf5f2('0x20')](db[_0xf5f2('0x21')][_0xf5f2('0x22')],function(_0x294414){return{'name':_0x294414['fieldName'],'type':_0x294414[_0xf5f2('0x23')][_0xf5f2('0x24')]};});_0x13da6f=qs[_0xf5f2('0x25')](_0xf6c58d,_0x5f1124);var _0x31bfcb={'where':_0x13da6f[_0xf5f2('0x26')]};return db[_0xf5f2('0x21')]['count'](_0x31bfcb)['then'](function(_0x22c826){_0x1a5bb3[_0xf5f2('0x14')]=_0x22c826;_0x13da6f[_0xf5f2('0x27')]=qs['include'](_0x5f1124['query']);return db[_0xf5f2('0x21')][_0xf5f2('0x28')](_0x13da6f);})[_0xf5f2('0x18')](function(_0x153924){_0x1a5bb3[_0xf5f2('0x29')]=_0x153924;return _0x1a5bb3;})['then'](respondWithFilteredResult(_0x3f79d5,_0x13da6f))['catch'](handleError(_0x3f79d5,null));};exports[_0xf5f2('0x2a')]=function(_0x4e19cb,_0xb744b9){var _0x58a4df={'raw':!![],'where':{'id':_0x4e19cb[_0xf5f2('0x2b')]['id']}},_0x45b643={};_0x45b643[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x21')][_0xf5f2('0x22')]);_0x45b643[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x4e19cb['query']);_0x45b643[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x45b643[_0xf5f2('0x2c')],_0x45b643[_0xf5f2('0x2e')]);_0x58a4df[_0xf5f2('0x31')]=_[_0xf5f2('0x30')](_0x45b643[_0xf5f2('0x2c')],qs['fields'](_0x4e19cb[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x58a4df['attributes']=_0x58a4df[_0xf5f2('0x31')]['length']?_0x58a4df[_0xf5f2('0x31')]:_0x45b643[_0xf5f2('0x2c')];if(_0x4e19cb[_0xf5f2('0x2e')][_0xf5f2('0x33')]){_0x58a4df['include']=[{'all':!![]}];}_0x58a4df=_['merge']({},_0x58a4df,_0x4e19cb[_0xf5f2('0x34')]);return db[_0xf5f2('0x21')][_0xf5f2('0x35')](_0x58a4df)['then'](handleEntityNotFound(_0xb744b9,null))[_0xf5f2('0x18')](respondWithResult(_0xb744b9,null))['catch'](handleError(_0xb744b9,null));};exports[_0xf5f2('0x36')]=function(_0x566c47,_0x46f464){return db[_0xf5f2('0x21')]['create'](_0x566c47[_0xf5f2('0x37')],{})[_0xf5f2('0x18')](function(_0x5a4441){var _0x35f738=_0x566c47['user']['get']({'plain':!![]});if(!_0x35f738)throw new Error(_0xf5f2('0x38'));if(_0x35f738[_0xf5f2('0x39')]===_0xf5f2('0x3a')){var _0x2d4400=_0x5a4441[_0xf5f2('0x1a')]({'plain':!![]});var _0xe62b57=_0xf5f2('0x1b');return db['UserProfileSection'][_0xf5f2('0x35')]({'where':{'name':_0xe62b57,'userProfileId':_0x35f738[_0xf5f2('0x3b')]},'raw':!![]})['then'](function(_0xc6a1ae){if(_0xc6a1ae&&_0xc6a1ae[_0xf5f2('0x3c')]===0x0){return db[_0xf5f2('0x1c')][_0xf5f2('0x36')]({'name':_0x2d4400[_0xf5f2('0x1f')],'resourceId':_0x2d4400['id'],'type':_0xc6a1ae[_0xf5f2('0x1f')],'sectionId':_0xc6a1ae['id']},{})[_0xf5f2('0x18')](function(){return _0x5a4441;});}else{return _0x5a4441;}})[_0xf5f2('0x3d')](function(_0x574f24){logger[_0xf5f2('0x1d')](_0xf5f2('0x3e'),_0x574f24);throw _0x574f24;});}return _0x5a4441;})[_0xf5f2('0x18')](respondWithResult(_0x46f464,0xc9))['catch'](handleError(_0x46f464,null));};exports['update']=function(_0x59eb00,_0x76d21b){if(_0x59eb00[_0xf5f2('0x37')]['id']){delete _0x59eb00['body']['id'];}return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x59eb00[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x76d21b,null))[_0xf5f2('0x18')](saveUpdates(_0x59eb00[_0xf5f2('0x37')],null))[_0xf5f2('0x18')](respondWithResult(_0x76d21b,null))[_0xf5f2('0x3d')](handleError(_0x76d21b,null));};exports[_0xf5f2('0x19')]=function(_0x106062,_0x444317){return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x106062[_0xf5f2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x444317,null))[_0xf5f2('0x18')](removeEntity(_0x444317,null))['catch'](handleError(_0x444317,null));};exports[_0xf5f2('0x3f')]=function(_0xc04f44,_0x218def){return db[_0xf5f2('0x21')][_0xf5f2('0x3f')]()[_0xf5f2('0x18')](respondWithResult(_0x218def,null))['catch'](handleError(_0x218def,null));};exports[_0xf5f2('0x40')]=function(_0x2e7193,_0x1c1497){var _0x29b108={'raw':!![],'where':{}},_0x12124d={},_0x10753a;return db[_0xf5f2('0x21')][_0xf5f2('0x41')]({'where':{'id':_0x2e7193['params']['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x1c1497,null))[_0xf5f2('0x18')](function(_0x45db9a){if(_0x45db9a){_0x10753a=_0x45db9a['get']({'plain':!![]});_0x12124d[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x42')]['rawAttributes']);_0x12124d['query']=_[_0xf5f2('0x2d')](_0x2e7193[_0xf5f2('0x2e')]);_0x12124d['filters']=_[_0xf5f2('0x30')](_0x12124d['model'],_0x12124d[_0xf5f2('0x2e')]);_0x29b108['attributes']=_[_0xf5f2('0x30')](_0x12124d['model'],qs[_0xf5f2('0x32')](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x29b108[_0xf5f2('0x31')]=_0x29b108['attributes'][_0xf5f2('0x43')]?_0x29b108[_0xf5f2('0x31')]:_0x12124d['model'];if(!_0x2e7193['query'][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x29b108['limit']=qs[_0xf5f2('0x13')](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x13')]);_0x29b108[_0xf5f2('0x11')]=qs['offset'](_0x2e7193['query'][_0xf5f2('0x11')]);}_0x29b108[_0xf5f2('0x46')]=qs['sort'](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x29b108[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_[_0xf5f2('0x48')](_0x2e7193[_0xf5f2('0x2e')],_0x12124d[_0xf5f2('0x2f')]));_0x29b108['where']['SmsQueueId']=_0x45db9a['id'];if(_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x29b108[_0xf5f2('0x26')]=_[_0xf5f2('0x4a')](_0x29b108[_0xf5f2('0x26')],{'$or':_['map'](_0x29b108[_0xf5f2('0x31')],function(_0x20ba91){var _0x18b124={};_0x18b124[_0x20ba91]={'$like':'%'+_0x2e7193['query'][_0xf5f2('0x49')]+'%'};return _0x18b124;})});}_0x29b108=_['merge']({},_0x29b108,_0x2e7193[_0xf5f2('0x34')]);return db[_0xf5f2('0x42')][_0xf5f2('0x28')](_0x29b108);}})[_0xf5f2('0x18')](function(_0x4afa4d){if(_0x4afa4d){return db['User'][_0xf5f2('0x4b')]({'where':{'id':_['map'](_0x4afa4d,_0xf5f2('0x4c')),'role':_0xf5f2('0x4d')},'attributes':['id','name',_0xf5f2('0x4e'),_0xf5f2('0x4f'),_0xf5f2('0x50')]});}})['then'](function(_0x397b99){if(_0x397b99){return{'count':_0x397b99[_0xf5f2('0x14')],'rows':_[_0xf5f2('0x20')](_0x397b99[_0xf5f2('0x29')],function(_0x51fa7e){return{'membername':_0x51fa7e[_0xf5f2('0x1f')],'UserId':_0x51fa7e['id'],'queue_name':_0x10753a['name'],'SmsQueueId':_0x10753a['id'],'interface':util[_0xf5f2('0x51')](_0xf5f2('0x52'),_0xf5f2('0x53'),_0x51fa7e[_0xf5f2('0x1f')]),'penalty':0x0,'paused':_0x51fa7e[_0xf5f2('0x4e')],'createdAt':_0x51fa7e['createdAt'],'updatedAt':_0x51fa7e[_0xf5f2('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf5f2('0x18')](respondWithFilteredResult(_0x1c1497,_0x29b108))[_0xf5f2('0x3d')](handleError(_0x1c1497,null));};exports[_0xf5f2('0x54')]=function(_0x2c5733,_0x5359b5){var _0x31e16b={};var _0x5ee6bc={};var _0x4c96ee;var _0xd4f6ef;return db['SmsQueue'][_0xf5f2('0x41')]({'where':{'id':_0x2c5733[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5359b5,null))[_0xf5f2('0x18')](function(_0x5767fc){if(_0x5767fc){_0x4c96ee=_0x5767fc;_0x5ee6bc[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x55')][_0xf5f2('0x22')]);_0x5ee6bc[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x2c5733[_0xf5f2('0x2e')]);_0x5ee6bc['filters']=_[_0xf5f2('0x30')](_0x5ee6bc[_0xf5f2('0x2c')],_0x5ee6bc[_0xf5f2('0x2e')]);_0x31e16b[_0xf5f2('0x31')]=_['intersection'](_0x5ee6bc[_0xf5f2('0x2c')],qs['fields'](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x31e16b['attributes']=_0x31e16b[_0xf5f2('0x31')][_0xf5f2('0x43')]?_0x31e16b[_0xf5f2('0x31')]:_0x5ee6bc[_0xf5f2('0x2c')];_0x31e16b[_0xf5f2('0x46')]=qs['sort'](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x31e16b[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_[_0xf5f2('0x48')](_0x2c5733[_0xf5f2('0x2e')],_0x5ee6bc['filters']));if(_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x31e16b['where']=_[_0xf5f2('0x4a')](_0x31e16b[_0xf5f2('0x26')],{'$or':_[_0xf5f2('0x20')](_0x31e16b['attributes'],function(_0x551cc9){var _0x4f3df6={};_0x4f3df6[_0x551cc9]={'$like':'%'+_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x49')]+'%'};return _0x4f3df6;})});}_0x31e16b=_[_0xf5f2('0x4a')]({},_0x31e16b,_0x2c5733[_0xf5f2('0x34')]);return _0x4c96ee[_0xf5f2('0x54')](_0x31e16b);}})['then'](function(_0x278b76){if(_0x278b76){_0xd4f6ef=_0x278b76[_0xf5f2('0x43')];if(!_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x31e16b[_0xf5f2('0x13')]=qs[_0xf5f2('0x13')](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x13')]);_0x31e16b[_0xf5f2('0x11')]=qs[_0xf5f2('0x11')](_0x2c5733['query']['offset']);}return _0x4c96ee['getTeams'](_0x31e16b);}})[_0xf5f2('0x18')](function(_0xafba8e){if(_0xafba8e){return _0xafba8e?{'count':_0xd4f6ef,'rows':_0xafba8e}:null;}})[_0xf5f2('0x18')](respondWithResult(_0x5359b5,null))[_0xf5f2('0x3d')](handleError(_0x5359b5,null));};exports[_0xf5f2('0x56')]=function(_0x5c6959,_0x9d943f){var _0x43c732=_0x5c6959[_0xf5f2('0x37')][_0xf5f2('0x57')];return db[_0xf5f2('0x55')]['findAll']({'where':{'id':_0x43c732},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x58')],'as':_0xf5f2('0x59'),'attributes':['id','name',_0xf5f2('0x5a'),_0xf5f2('0x5b'),_0xf5f2('0x5c')],'raw':!![]}]})[_0xf5f2('0x18')](function(_0x588434){if(_0x588434){var _0x40b36e=_[_0xf5f2('0x5d')](_0x588434,function(_0x19602d){var _0x2adeb4=_0x19602d[_0xf5f2('0x1a')]({'plain':!![]});return _0x2adeb4['Agents'];});return db['SmsQueue'][_0xf5f2('0x35')]({'where':{'id':_0x5c6959[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](function(_0xe3ea1e){return db['sequelize']['transaction'](function(_0x16048e){return _0xe3ea1e['addTeams'](_0x43c732,{'transaction':_0x16048e})['then'](function(){return BPromise['each'](_0x40b36e,function(_0x57cb18){return db[_0xf5f2('0x42')][_0xf5f2('0x5e')]({'where':{'UserId':_0x57cb18['id'],'SmsQueueId':_0x5c6959[_0xf5f2('0x2b')]['id']},'transaction':_0x16048e});});})[_0xf5f2('0x18')](function(){_0x40b36e[_0xf5f2('0x5f')](function(_0x9f941e){socket[_0xf5f2('0x60')](_0xf5f2('0x61'),{'UserId':_0x9f941e['id'],'SmsQueueId':_0xe3ea1e['id']});});});});});}})[_0xf5f2('0x18')](respondWithStatusCode(_0x9d943f,null))[_0xf5f2('0x3d')](handleError(_0x9d943f,null));};exports[_0xf5f2('0x62')]=function(_0x2afeac,_0x1ba503){return db[_0xf5f2('0x55')][_0xf5f2('0x28')]({'where':{'id':_0x2afeac[_0xf5f2('0x2e')][_0xf5f2('0x57')]},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf5f2('0x18')](handleEntityNotFound(_0x1ba503,null))[_0xf5f2('0x18')](function(_0x21043b){var _0x2811ad=_[_0xf5f2('0x20')](_0x21043b,'id');var _0x308220=[];var _0x16491c=[];var _0xcf48eb=squel['select']();_0xcf48eb[_0xf5f2('0x63')]('tq.TeamId')['from']('team_has_sms_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf5f2('0x26')](_0xf5f2('0x64'),_0x2afeac[_0xf5f2('0x2b')]['id']);for(var _0x375bc9=0x0;_0x375bc9<_0x21043b[_0xf5f2('0x43')];_0x375bc9+=0x1){let _0x3cf857=_0x21043b[_0x375bc9];for(var _0x5dc63f=0x0;_0x5dc63f<_0x3cf857['Agents'][_0xf5f2('0x43')];_0x5dc63f+=0x1){let _0x578a22=_0x3cf857[_0xf5f2('0x59')][_0x5dc63f];var _0x186fdd=_0xcf48eb['clone']();_0x186fdd['where'](_0xf5f2('0x65'),_0x578a22['id']);_0x16491c[_0xf5f2('0x66')](db['sequelize'][_0xf5f2('0x2e')](_0x186fdd[_0xf5f2('0x67')](),{'type':db['sequelize'][_0xf5f2('0x68')][_0xf5f2('0x69')]})[_0xf5f2('0x18')](function(_0x4c1678){if(_0x4c1678[_0xf5f2('0x43')]===0x1){return _0x578a22['id'];}else{var _0xc28adc=_[_0xf5f2('0x6a')](_[_0xf5f2('0x20')](_0x4c1678,_0xf5f2('0x6b')),function(_0x3e0288){return _[_0xf5f2('0x6c')](_0x2811ad,_0x3e0288);});if(_0xc28adc){return _0x578a22['id'];}}}));}}return BPromise[_0xf5f2('0x6d')](_0x16491c)[_0xf5f2('0x18')](function(_0x3a6f60){_0x308220=_(_0x308220)[_0xf5f2('0x6e')](_0x3a6f60)[_0xf5f2('0x6f')]()[_0xf5f2('0x70')]();return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x2afeac[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](function(_0x29a9d4){return db[_0xf5f2('0x71')][_0xf5f2('0x72')](function(_0x800f42){return _0x29a9d4['removeTeams'](_0x2afeac[_0xf5f2('0x2e')][_0xf5f2('0x57')],{'transaction':_0x800f42})['then'](function(){if(!_[_0xf5f2('0x73')](_0x308220)){return _0x29a9d4[_0xf5f2('0x74')](_0x308220,{'transaction':_0x800f42});}})['then'](function(){_0x308220[_0xf5f2('0x5f')](function(_0x2f54eb){socket[_0xf5f2('0x60')]('userSmsQueue:remove',{'UserId':_0x2f54eb,'SmsQueueId':_0x29a9d4['id']});});});});});});})['then'](respondWithStatusCode(_0x1ba503,null))[_0xf5f2('0x3d')](handleError(_0x1ba503,null));};exports[_0xf5f2('0x75')]=function(_0x213ade,_0x5ba275){return db['SmsQueue'][_0xf5f2('0x35')]({'where':{'id':_0x213ade[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5ba275,null))['then'](function(_0x4cde64){if(_0x4cde64){return _0x4cde64['addAgents'](_0x213ade['body']['ids'],_[_0xf5f2('0x76')](_0x213ade['body'],[_0xf5f2('0x57'),'id'])||{})[_0xf5f2('0x77')](function(_0xec3c35){for(var _0x43a167=0x0;_0x43a167<_0x213ade[_0xf5f2('0x37')][_0xf5f2('0x57')][_0xf5f2('0x43')];_0x43a167+=0x1){socket[_0xf5f2('0x60')](_0xf5f2('0x61'),{'UserId':Number(_0x213ade[_0xf5f2('0x37')][_0xf5f2('0x57')][_0x43a167]),'SmsQueueId':Number(_0x213ade[_0xf5f2('0x2b')]['id'])});}return _0xec3c35;});}})[_0xf5f2('0x18')](respondWithResult(_0x5ba275,null))['catch'](handleError(_0x5ba275,null));};exports[_0xf5f2('0x74')]=function(_0x2a4fed,_0x5783e2){return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x2a4fed['params']['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5783e2,null))[_0xf5f2('0x18')](function(_0x281f61){if(_0x281f61){return _0x281f61['removeAgents'](_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')])['then'](function(){if(_[_0xf5f2('0x78')](_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')])){for(var _0x517aa8=0x0;_0x517aa8<_0x2a4fed[_0xf5f2('0x2e')]['ids'][_0xf5f2('0x43')];_0x517aa8+=0x1){socket['emit'](_0xf5f2('0x79'),{'UserId':Number(_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')][_0x517aa8]),'SmsQueueId':Number(_0x2a4fed[_0xf5f2('0x2b')]['id'])});}}else{socket['emit'](_0xf5f2('0x79'),{'UserId':Number(_0x2a4fed['query']['ids']),'SmsQueueId':Number(_0x2a4fed['params']['id'])});}});}})[_0xf5f2('0x18')](respondWithStatusCode(_0x5783e2,null))[_0xf5f2('0x3d')](handleError(_0x5783e2,null));};exports['getAgents']=function(_0x3c8a1b,_0x15025d){var _0x35790b={};var _0x3962b2={};var _0x28873e;var _0x1fc5ae;return db['SmsQueue'][_0xf5f2('0x41')]({'where':{'id':_0x3c8a1b[_0xf5f2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x15025d,null))[_0xf5f2('0x18')](function(_0x19cbff){if(_0x19cbff){_0x28873e=_0x19cbff;_0x3962b2['model']=_[_0xf5f2('0x2d')](db[_0xf5f2('0x58')][_0xf5f2('0x22')]);_0x3962b2[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x3c8a1b[_0xf5f2('0x2e')]);_0x3962b2['filters']=_[_0xf5f2('0x30')](_0x3962b2[_0xf5f2('0x2c')],_0x3962b2[_0xf5f2('0x2e')]);_0x35790b[_0xf5f2('0x31')]=_[_0xf5f2('0x30')](_0x3962b2[_0xf5f2('0x2c')],qs[_0xf5f2('0x32')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x35790b['attributes']=_0x35790b[_0xf5f2('0x31')][_0xf5f2('0x43')]?_0x35790b[_0xf5f2('0x31')]:_0x3962b2[_0xf5f2('0x2c')];_0x35790b[_0xf5f2('0x46')]=qs[_0xf5f2('0x47')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x35790b[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_['pick'](_0x3c8a1b['query'],_0x3962b2[_0xf5f2('0x2f')]));if(_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x35790b[_0xf5f2('0x26')]=_['merge'](_0x35790b[_0xf5f2('0x26')],{'$or':_[_0xf5f2('0x20')](_0x35790b[_0xf5f2('0x31')],function(_0x3d7f53){var _0x456a1e={};_0x456a1e[_0x3d7f53]={'$like':'%'+_0x3c8a1b['query'][_0xf5f2('0x49')]+'%'};return _0x456a1e;})});}_0x35790b=_[_0xf5f2('0x4a')]({},_0x35790b,_0x3c8a1b['options']);return _0x28873e[_0xf5f2('0x7a')](_0x35790b);}})[_0xf5f2('0x18')](function(_0x2563fa){if(_0x2563fa){_0x1fc5ae=_0x2563fa[_0xf5f2('0x43')];if(!_0x3c8a1b['query'][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x35790b[_0xf5f2('0x13')]=qs['limit'](_0x3c8a1b['query'][_0xf5f2('0x13')]);_0x35790b[_0xf5f2('0x11')]=qs[_0xf5f2('0x11')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x11')]);}return _0x28873e[_0xf5f2('0x7a')](_0x35790b);}})['then'](function(_0x39dee8){if(_0x39dee8){return _0x39dee8?{'count':_0x1fc5ae,'rows':_0x39dee8}:null;}})['then'](respondWithResult(_0x15025d,null))[_0xf5f2('0x3d')](handleError(_0x15025d,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 7da0aa0..9d454bc 100644 --- a/server/api/smsQueue/smsQueue.events.js +++ b/server/api/smsQueue/smsQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x524b=['update','remove','emit','hasOwnProperty','hook','exports','events','SmsQueue','setMaxListeners','save'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x524b,0xa6));var _0xb524=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x524b[_0xaa1b3e];return _0x454d7d;};'use strict';var EventEmitter=require(_0xb524('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xb524('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb524('0x2')](0x0);var events={'afterCreate':_0xb524('0x3'),'afterUpdate':_0xb524('0x4'),'afterDestroy':_0xb524('0x5')};function emitEvent(_0x40c010){return function(_0xa5151f,_0x6eded9,_0x686524){SmsQueueEvents[_0xb524('0x6')](_0x40c010+':'+_0xa5151f['id'],_0xa5151f);SmsQueueEvents[_0xb524('0x6')](_0x40c010,_0xa5151f);_0x686524(null);};}for(var e in events){if(events[_0xb524('0x7')](e)){var event=events[e];SmsQueue[_0xb524('0x8')](e,emitEvent(event));}}module[_0xb524('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0x8625=['emit','hasOwnProperty','exports','events','SmsQueue','setMaxListeners','save','update','remove'];(function(_0x364b32,_0x4dec35){var _0x3f3ea0=function(_0x1911a8){while(--_0x1911a8){_0x364b32['push'](_0x364b32['shift']());}};_0x3f3ea0(++_0x4dec35);}(_0x8625,0x1d7));var _0x5862=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0x8625[_0x57d13b];return _0x467696;};'use strict';var EventEmitter=require(_0x5862('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x5862('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x5862('0x2')](0x0);var events={'afterCreate':_0x5862('0x3'),'afterUpdate':_0x5862('0x4'),'afterDestroy':_0x5862('0x5')};function emitEvent(_0x2d2671){return function(_0x5daf83,_0x59c894,_0x2e7327){SmsQueueEvents[_0x5862('0x6')](_0x2d2671+':'+_0x5daf83['id'],_0x5daf83);SmsQueueEvents['emit'](_0x2d2671,_0x5daf83);_0x2e7327(null);};}for(var e in events){if(events[_0x5862('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x5862('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index a947719..b9ea05b 100644 --- a/server/api/smsQueue/smsQueue.model.js +++ b/server/api/smsQueue/smsQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c69=['moment','request-promise','path','./smsQueue.attributes','exports','SmsQueue','sms_queues','util','../../config/logger','api'];(function(_0x1a3eef,_0x3569f6){var _0x17c388=function(_0x538c2e){while(--_0x538c2e){_0x1a3eef['push'](_0x1a3eef['shift']());}};_0x17c388(++_0x3569f6);}(_0x4c69,0x165));var _0x94c6=function(_0x3c9cf9,_0x20efbe){_0x3c9cf9=_0x3c9cf9-0x0;var _0x5f35f7=_0x4c69[_0x3c9cf9];return _0x5f35f7;};'use strict';var _=require('lodash');var util=require(_0x94c6('0x0'));var logger=require(_0x94c6('0x1'))(_0x94c6('0x2'));var moment=require(_0x94c6('0x3'));var BPromise=require('bluebird');var rp=require(_0x94c6('0x4'));var fs=require('fs');var path=require(_0x94c6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x94c6('0x6'));module[_0x94c6('0x7')]=function(_0x3ae6a3,_0x57a183){return _0x3ae6a3['define'](_0x94c6('0x8'),attributes,{'tableName':_0x94c6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe709=['request-promise','path','../../config/environment','exports','define','lodash','../../config/logger','api','moment','bluebird'];(function(_0x425b80,_0x4cf0bd){var _0x25750c=function(_0x4bad7e){while(--_0x4bad7e){_0x425b80['push'](_0x425b80['shift']());}};_0x25750c(++_0x4cf0bd);}(_0xe709,0x1c7));var _0x9e70=function(_0x1a8961,_0x227cd9){_0x1a8961=_0x1a8961-0x0;var _0x3f56f8=_0xe709[_0x1a8961];return _0x3f56f8;};'use strict';var _=require(_0x9e70('0x0'));var util=require('util');var logger=require(_0x9e70('0x1'))(_0x9e70('0x2'));var moment=require(_0x9e70('0x3'));var BPromise=require(_0x9e70('0x4'));var rp=require(_0x9e70('0x5'));var fs=require('fs');var path=require(_0x9e70('0x6'));var rimraf=require('rimraf');var config=require(_0x9e70('0x7'));var attributes=require('./smsQueue.attributes');module[_0x9e70('0x8')]=function(_0x4434fc,_0x297c3c){return _0x4434fc[_0x9e70('0x9')]('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 9b356dc..4b05944 100644 --- a/server/api/smsQueue/smsQueue.rpc.js +++ b/server/api/smsQueue/smsQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2281=['request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','message','result','GetSmsQueue','SmsQueue','findAll','options','raw','attributes','map','include','model','stringify','ShowSmsQueue','find','where','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./smsQueue.socket','register'];(function(_0x3a889d,_0x5ecb2e){var _0x26cedb=function(_0x347d80){while(--_0x347d80){_0x3a889d['push'](_0x3a889d['shift']());}};_0x26cedb(++_0x5ecb2e);}(_0x2281,0xef));var _0x1228=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2281[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x1228('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1228('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1228('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1228('0x3'))(_0x1228('0x4'));var config=require(_0x1228('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1228('0x6')][_0x1228('0x7')]({'port':0x232a});config[_0x1228('0x8')]=_[_0x1228('0x9')](config[_0x1228('0x8')],{'host':_0x1228('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1228('0xb'))[_0x1228('0xc')](socket);function respondWithRpcPromise(_0x3b3ad5,_0xfe75b3,_0x406895){return new BPromise(function(_0x5d5219,_0x3c7fe7){return client[_0x1228('0xd')](_0x3b3ad5,_0x406895)[_0x1228('0xe')](function(_0x1c3343){logger[_0x1228('0xf')](_0x1228('0x10'),_0xfe75b3,_0x1228('0x11'));logger[_0x1228('0x12')](_0x1228('0x13'),_0xfe75b3,_0x1228('0x11'),JSON['stringify'](_0x1c3343));if(_0x1c3343[_0x1228('0x14')]){if(_0x1c3343[_0x1228('0x14')]['code']===0x1f4){logger['error'](_0x1228('0x10'),_0xfe75b3,_0x1c3343[_0x1228('0x14')][_0x1228('0x15')]);return _0x3c7fe7(_0x1c3343[_0x1228('0x14')][_0x1228('0x15')]);}logger[_0x1228('0x14')](_0x1228('0x10'),_0xfe75b3,_0x1c3343[_0x1228('0x14')][_0x1228('0x15')]);return _0x5d5219(_0x1c3343[_0x1228('0x14')][_0x1228('0x15')]);}else{logger[_0x1228('0xf')](_0x1228('0x10'),_0xfe75b3,_0x1228('0x11'));_0x5d5219(_0x1c3343[_0x1228('0x16')][_0x1228('0x15')]);}})['catch'](function(_0x1cd1c1){logger[_0x1228('0x14')]('SmsQueue,\x20%s,\x20%s',_0xfe75b3,_0x1cd1c1);_0x3c7fe7(_0x1cd1c1);});});}exports[_0x1228('0x17')]=function(_0x5a1b9a){var _0x421a0b=this;return new Promise(function(_0x222681,_0xef3c4e){return db[_0x1228('0x18')][_0x1228('0x19')]({'raw':_0x5a1b9a[_0x1228('0x1a')]?_0x5a1b9a['options'][_0x1228('0x1b')]===undefined?!![]:![]:!![],'where':_0x5a1b9a[_0x1228('0x1a')]?_0x5a1b9a['options']['where']||null:null,'attributes':_0x5a1b9a[_0x1228('0x1a')]?_0x5a1b9a[_0x1228('0x1a')][_0x1228('0x1c')]||null:null,'limit':_0x5a1b9a[_0x1228('0x1a')]?_0x5a1b9a['options']['limit']||null:null,'include':_0x5a1b9a['options']?_0x5a1b9a[_0x1228('0x1a')]['include']?_[_0x1228('0x1d')](_0x5a1b9a['options'][_0x1228('0x1e')],function(_0x55d092){return{'model':db[_0x55d092[_0x1228('0x1f')]],'as':_0x55d092['as'],'attributes':_0x55d092[_0x1228('0x1c')],'include':_0x55d092[_0x1228('0x1e')]?_[_0x1228('0x1d')](_0x55d092['include'],function(_0x24723a){return{'model':db[_0x24723a['model']],'as':_0x24723a['as'],'attributes':_0x24723a['attributes'],'include':_0x24723a[_0x1228('0x1e')]?_[_0x1228('0x1d')](_0x24723a['include'],function(_0x173cb7){return{'model':db[_0x173cb7[_0x1228('0x1f')]],'as':_0x173cb7['as'],'attributes':_0x173cb7[_0x1228('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x286827){logger['info']('GetSmsQueue',_0x5a1b9a);logger[_0x1228('0x12')]('GetSmsQueue',_0x5a1b9a,JSON[_0x1228('0x20')](_0x286827));_0x222681(_0x286827);})['catch'](function(_0x444251){logger[_0x1228('0x14')](_0x1228('0x17'),_0x444251[_0x1228('0x15')],_0x5a1b9a);_0xef3c4e(_0x421a0b['error'](0x1f4,_0x444251[_0x1228('0x15')]));});});};exports[_0x1228('0x21')]=function(_0x2a4ceb){var _0x5717bc=this;return new Promise(function(_0x162c5f,_0x4c0d4d){return db[_0x1228('0x18')][_0x1228('0x22')]({'raw':_0x2a4ceb[_0x1228('0x1a')]?_0x2a4ceb[_0x1228('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2a4ceb['options']?_0x2a4ceb[_0x1228('0x1a')][_0x1228('0x23')]||null:null,'attributes':_0x2a4ceb['options']?_0x2a4ceb['options'][_0x1228('0x1c')]||null:null,'include':_0x2a4ceb['options']?_0x2a4ceb[_0x1228('0x1a')][_0x1228('0x1e')]?_[_0x1228('0x1d')](_0x2a4ceb[_0x1228('0x1a')]['include'],function(_0x316a90){return{'model':db[_0x316a90[_0x1228('0x1f')]],'as':_0x316a90['as'],'attributes':_0x316a90[_0x1228('0x1c')],'include':_0x316a90[_0x1228('0x1e')]?_[_0x1228('0x1d')](_0x316a90[_0x1228('0x1e')],function(_0x5567b2){return{'model':db[_0x5567b2[_0x1228('0x1f')]],'as':_0x5567b2['as'],'attributes':_0x5567b2[_0x1228('0x1c')],'include':_0x5567b2[_0x1228('0x1e')]?_[_0x1228('0x1d')](_0x5567b2[_0x1228('0x1e')],function(_0x47b965){return{'model':db[_0x47b965['model']],'as':_0x47b965['as'],'attributes':_0x47b965[_0x1228('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1228('0xe')](function(_0x44373f){logger[_0x1228('0xf')](_0x1228('0x21'),_0x2a4ceb);logger[_0x1228('0x12')]('ShowSmsQueue',_0x2a4ceb,JSON[_0x1228('0x20')](_0x44373f));_0x162c5f(_0x44373f);})['catch'](function(_0x3c4a1e){logger[_0x1228('0x14')](_0x1228('0x21'),_0x3c4a1e[_0x1228('0x15')],_0x2a4ceb);_0x4c0d4d(_0x5717bc['error'](0x1f4,_0x3c4a1e[_0x1228('0x15')]));});});}; \ No newline at end of file +var _0xbd67=['debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','limit','include','map','model','attributes','find','where','then','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','info','SmsQueue,\x20%s,\x20%s'];(function(_0x290436,_0x4c7480){var _0x561192=function(_0x36cb93){while(--_0x36cb93){_0x290436['push'](_0x290436['shift']());}};_0x561192(++_0x4c7480);}(_0xbd67,0x1cf));var _0x7bd6=function(_0x378b4,_0x5ca7fa){_0x378b4=_0x378b4-0x0;var _0x11d07b=_0xbd67[_0x378b4];return _0x11d07b;};'use strict';var _=require(_0x7bd6('0x0'));var util=require(_0x7bd6('0x1'));var moment=require(_0x7bd6('0x2'));var BPromise=require(_0x7bd6('0x3'));var rs=require(_0x7bd6('0x4'));var fs=require('fs');var Redis=require(_0x7bd6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7bd6('0x6'));var logger=require(_0x7bd6('0x7'))(_0x7bd6('0x8'));var config=require(_0x7bd6('0x9'));var jayson=require(_0x7bd6('0xa'));var client=jayson[_0x7bd6('0xb')][_0x7bd6('0xc')]({'port':0x232a});config['redis']=_[_0x7bd6('0xd')](config[_0x7bd6('0xe')],{'host':_0x7bd6('0xf'),'port':0x18eb});var socket=require(_0x7bd6('0x10'))(new Redis(config['redis']));require(_0x7bd6('0x11'))[_0x7bd6('0x12')](socket);function respondWithRpcPromise(_0x22dd8d,_0x338159,_0x52c8f3){return new BPromise(function(_0x30c63e,_0x4b19c1){return client['request'](_0x22dd8d,_0x52c8f3)['then'](function(_0x1fbcca){logger[_0x7bd6('0x13')](_0x7bd6('0x14'),_0x338159,'request\x20sent');logger[_0x7bd6('0x15')](_0x7bd6('0x16'),_0x338159,'request\x20sent',JSON[_0x7bd6('0x17')](_0x1fbcca));if(_0x1fbcca['error']){if(_0x1fbcca['error'][_0x7bd6('0x18')]===0x1f4){logger[_0x7bd6('0x19')](_0x7bd6('0x14'),_0x338159,_0x1fbcca[_0x7bd6('0x19')][_0x7bd6('0x1a')]);return _0x4b19c1(_0x1fbcca[_0x7bd6('0x19')][_0x7bd6('0x1a')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x338159,_0x1fbcca[_0x7bd6('0x19')]['message']);return _0x30c63e(_0x1fbcca[_0x7bd6('0x19')]['message']);}else{logger['info'](_0x7bd6('0x14'),_0x338159,_0x7bd6('0x1b'));_0x30c63e(_0x1fbcca[_0x7bd6('0x1c')][_0x7bd6('0x1a')]);}})[_0x7bd6('0x1d')](function(_0xdcf122){logger['error'](_0x7bd6('0x14'),_0x338159,_0xdcf122);_0x4b19c1(_0xdcf122);});});}exports[_0x7bd6('0x1e')]=function(_0x1591b1){var _0x2aeba5=this;return new Promise(function(_0x36d5d9,_0x57aa4){return db[_0x7bd6('0x1f')][_0x7bd6('0x20')]({'raw':_0x1591b1['options']?_0x1591b1[_0x7bd6('0x21')][_0x7bd6('0x22')]===undefined?!![]:![]:!![],'where':_0x1591b1[_0x7bd6('0x21')]?_0x1591b1[_0x7bd6('0x21')]['where']||null:null,'attributes':_0x1591b1[_0x7bd6('0x21')]?_0x1591b1[_0x7bd6('0x21')]['attributes']||null:null,'limit':_0x1591b1[_0x7bd6('0x21')]?_0x1591b1[_0x7bd6('0x21')][_0x7bd6('0x23')]||null:null,'include':_0x1591b1['options']?_0x1591b1[_0x7bd6('0x21')][_0x7bd6('0x24')]?_[_0x7bd6('0x25')](_0x1591b1[_0x7bd6('0x21')][_0x7bd6('0x24')],function(_0x3b722e){return{'model':db[_0x3b722e[_0x7bd6('0x26')]],'as':_0x3b722e['as'],'attributes':_0x3b722e[_0x7bd6('0x27')],'include':_0x3b722e[_0x7bd6('0x24')]?_['map'](_0x3b722e[_0x7bd6('0x24')],function(_0x6176ee){return{'model':db[_0x6176ee['model']],'as':_0x6176ee['as'],'attributes':_0x6176ee[_0x7bd6('0x27')],'include':_0x6176ee[_0x7bd6('0x24')]?_[_0x7bd6('0x25')](_0x6176ee['include'],function(_0x5022e0){return{'model':db[_0x5022e0['model']],'as':_0x5022e0['as'],'attributes':_0x5022e0[_0x7bd6('0x27')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x234d6c){logger[_0x7bd6('0x13')](_0x7bd6('0x1e'),_0x1591b1);logger[_0x7bd6('0x15')](_0x7bd6('0x1e'),_0x1591b1,JSON[_0x7bd6('0x17')](_0x234d6c));_0x36d5d9(_0x234d6c);})['catch'](function(_0x56f751){logger[_0x7bd6('0x19')](_0x7bd6('0x1e'),_0x56f751[_0x7bd6('0x1a')],_0x1591b1);_0x57aa4(_0x2aeba5[_0x7bd6('0x19')](0x1f4,_0x56f751['message']));});});};exports['ShowSmsQueue']=function(_0x486cad){var _0x4e38ee=this;return new Promise(function(_0x3fe13e,_0x2a7f22){return db['SmsQueue'][_0x7bd6('0x28')]({'raw':_0x486cad[_0x7bd6('0x21')]?_0x486cad[_0x7bd6('0x21')][_0x7bd6('0x22')]===undefined?!![]:![]:!![],'where':_0x486cad[_0x7bd6('0x21')]?_0x486cad[_0x7bd6('0x21')][_0x7bd6('0x29')]||null:null,'attributes':_0x486cad[_0x7bd6('0x21')]?_0x486cad[_0x7bd6('0x21')][_0x7bd6('0x27')]||null:null,'include':_0x486cad[_0x7bd6('0x21')]?_0x486cad[_0x7bd6('0x21')]['include']?_[_0x7bd6('0x25')](_0x486cad['options'][_0x7bd6('0x24')],function(_0x3df931){return{'model':db[_0x3df931['model']],'as':_0x3df931['as'],'attributes':_0x3df931[_0x7bd6('0x27')],'include':_0x3df931[_0x7bd6('0x24')]?_[_0x7bd6('0x25')](_0x3df931['include'],function(_0x2dba1c){return{'model':db[_0x2dba1c['model']],'as':_0x2dba1c['as'],'attributes':_0x2dba1c[_0x7bd6('0x27')],'include':_0x2dba1c['include']?_['map'](_0x2dba1c[_0x7bd6('0x24')],function(_0xc2dd0e){return{'model':db[_0xc2dd0e['model']],'as':_0xc2dd0e['as'],'attributes':_0xc2dd0e[_0x7bd6('0x27')]};}):[]};}):[]};}):[]:[]})[_0x7bd6('0x2a')](function(_0xa9b209){logger[_0x7bd6('0x13')](_0x7bd6('0x2b'),_0x486cad);logger['debug'](_0x7bd6('0x2b'),_0x486cad,JSON[_0x7bd6('0x17')](_0xa9b209));_0x3fe13e(_0xa9b209);})['catch'](function(_0x319674){logger[_0x7bd6('0x19')](_0x7bd6('0x2b'),_0x319674[_0x7bd6('0x1a')],_0x486cad);_0x2a7f22(_0x4e38ee[_0x7bd6('0x19')](0x1f4,_0x319674[_0x7bd6('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 5bf967b..fa30506 100644 --- a/server/api/smsQueue/smsQueue.socket.js +++ b/server/api/smsQueue/smsQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f3f=['removeListener','register','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x182ccb,_0x35b47b){var _0x2e908c=function(_0x12b5f0){while(--_0x12b5f0){_0x182ccb['push'](_0x182ccb['shift']());}};_0x2e908c(++_0x35b47b);}(_0x0f3f,0xc0));var _0xf0f3=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x0f3f[_0x5c351c];return _0x26f3b3;};'use strict';var SmsQueueEvents=require(_0xf0f3('0x0'));var events=[_0xf0f3('0x1'),_0xf0f3('0x2'),_0xf0f3('0x3')];function createListener(_0x32cb4f,_0x4ac9b2){return function(_0x540f5a){_0x4ac9b2['emit'](_0x32cb4f,_0x540f5a);};}function removeListener(_0xa6aecd,_0x58736b){return function(){SmsQueueEvents[_0xf0f3('0x4')](_0xa6aecd,_0x58736b);};}exports[_0xf0f3('0x5')]=function(_0xa44546){for(var _0x921b60=0x0,_0x143603=events['length'];_0x921b60<_0x143603;_0x921b60++){var _0x340d78=events[_0x921b60];var _0x4a1b5f=createListener(_0xf0f3('0x6')+_0x340d78,_0xa44546);SmsQueueEvents['on'](_0x340d78,_0x4a1b5f);}}; \ No newline at end of file +var _0x896c=['register','length','./smsQueue.events','update','emit'];(function(_0x3b3d5f,_0x3a98ed){var _0x4d907e=function(_0x10de51){while(--_0x10de51){_0x3b3d5f['push'](_0x3b3d5f['shift']());}};_0x4d907e(++_0x3a98ed);}(_0x896c,0x13d));var _0xc896=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0x896c[_0x19159a];return _0xa677f4;};'use strict';var SmsQueueEvents=require(_0xc896('0x0'));var events=['save','remove',_0xc896('0x1')];function createListener(_0x3e8b81,_0x18d947){return function(_0x366c61){_0x18d947[_0xc896('0x2')](_0x3e8b81,_0x366c61);};}function removeListener(_0x4c1ae7,_0x1aa754){return function(){SmsQueueEvents['removeListener'](_0x4c1ae7,_0x1aa754);};}exports[_0xc896('0x3')]=function(_0x1b7335){for(var _0x1c52dc=0x0,_0x5ef5dc=events[_0xc896('0x4')];_0x1c52dc<_0x5ef5dc;_0x1c52dc++){var _0x31432d=events[_0x1c52dc];var _0x1e3541=createListener('smsQueue:'+_0x31432d,_0x1b7335);SmsQueueEvents['on'](_0x31432d,_0x1e3541);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 5dfefa0..95aad20 100644 --- a/server/api/smsQueueReport/index.js +++ b/server/api/smsQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bd8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','delete','destroy'];(function(_0x2351f6,_0x27fa26){var _0x27af1f=function(_0x23a6e6){while(--_0x23a6e6){_0x2351f6['push'](_0x2351f6['shift']());}};_0x27af1f(++_0x27fa26);}(_0x2bd8,0x130));var _0x82bd=function(_0x4bb3a2,_0x29029a){_0x4bb3a2=_0x4bb3a2-0x0;var _0x324e5f=_0x2bd8[_0x4bb3a2];return _0x324e5f;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')]('/',auth[_0x82bd('0xa')](),controller['index']);router[_0x82bd('0x9')](_0x82bd('0xb'),auth[_0x82bd('0xa')](),controller[_0x82bd('0xc')]);router['get'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x82bd('0xa')](),controller['create']);router['put'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x82bd('0xe')](_0x82bd('0xd'),auth['isAuthenticated'](),controller[_0x82bd('0xf')]);module['exports']=router; \ No newline at end of file +var _0x91e6=['./smsQueueReport.controller','get','isAuthenticated','/describe','show','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1f0e90,_0x4455a7){var _0x583357=function(_0x2df8ae){while(--_0x2df8ae){_0x1f0e90['push'](_0x1f0e90['shift']());}};_0x583357(++_0x4455a7);}(_0x91e6,0x123));var _0x691e=function(_0x147103,_0x356002){_0x147103=_0x147103-0x0;var _0x214a46=_0x91e6[_0x147103];return _0x214a46;};'use strict';var multer=require(_0x691e('0x0'));var util=require(_0x691e('0x1'));var path=require(_0x691e('0x2'));var timeout=require(_0x691e('0x3'));var express=require(_0x691e('0x4'));var router=express[_0x691e('0x5')]();var fs_extra=require(_0x691e('0x6'));var auth=require(_0x691e('0x7'));var interaction=require(_0x691e('0x8'));var config=require('../../config/environment');var controller=require(_0x691e('0x9'));router[_0x691e('0xa')]('/',auth[_0x691e('0xb')](),controller['index']);router[_0x691e('0xa')](_0x691e('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x691e('0xa')]('/:id',auth[_0x691e('0xb')](),controller[_0x691e('0xd')]);router[_0x691e('0xe')]('/',auth[_0x691e('0xb')](),controller['create']);router[_0x691e('0xf')](_0x691e('0x10'),auth[_0x691e('0xb')](),controller[_0x691e('0x11')]);router[_0x691e('0x12')]('/:id',auth[_0x691e('0xb')](),controller['destroy']);module[_0x691e('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 79467d0..f41f985 100644 --- a/server/api/smsQueueReport/smsQueueReport.attributes.js +++ b/server/api/smsQueueReport/smsQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x172d=['DATE','moment','sequelize','STRING'];(function(_0x32753a,_0x313eff){var _0x5cc638=function(_0x87e14c){while(--_0x87e14c){_0x32753a['push'](_0x32753a['shift']());}};_0x5cc638(++_0x313eff);}(_0x172d,0x115));var _0xd172=function(_0x58d8d7,_0x108377){_0x58d8d7=_0x58d8d7-0x0;var _0x339d20=_0x172d[_0x58d8d7];return _0x339d20;};'use strict';var moment=require(_0xd172('0x0'));var Sequelize=require(_0xd172('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xd172('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd172('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd172('0x3')]},'acceptAt':{'type':Sequelize[_0xd172('0x3')]},'exitAt':{'type':Sequelize[_0xd172('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa1b4=['moment','sequelize','exports','STRING','DATE'];(function(_0x1c36a8,_0x49c835){var _0xb622c5=function(_0x24f4f3){while(--_0x24f4f3){_0x1c36a8['push'](_0x1c36a8['shift']());}};_0xb622c5(++_0x49c835);}(_0xa1b4,0xff));var _0x4a1b=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0xa1b4[_0x2555d0];return _0x3bb486;};'use strict';var moment=require(_0x4a1b('0x0'));var Sequelize=require(_0x4a1b('0x1'));module[_0x4a1b('0x2')]={'uniqueid':{'type':Sequelize[_0x4a1b('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x4a1b('0x4')]},'acceptAt':{'type':Sequelize[_0x4a1b('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x4a1b('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 52f15de..61a744d 100644 --- a/server/api/smsQueueReport/smsQueueReport.controller.js +++ b/server/api/smsQueueReport/smsQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39fb=['nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','SmsQueueReport','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','sendStatus','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x5aaf01,_0x1092c5){var _0x3d62bf=function(_0x3a3975){while(--_0x3a3975){_0x5aaf01['push'](_0x5aaf01['shift']());}};_0x3d62bf(++_0x1092c5);}(_0x39fb,0xb1));var _0xb39f=function(_0x4148e0,_0x1e9ceb){_0x4148e0=_0x4148e0-0x0;var _0x26af68=_0x39fb[_0x4148e0];return _0x26af68;};'use strict';var emlformat=require(_0xb39f('0x0'));var rimraf=require(_0xb39f('0x1'));var zipdir=require(_0xb39f('0x2'));var jsonpatch=require(_0xb39f('0x3'));var rp=require(_0xb39f('0x4'));var moment=require(_0xb39f('0x5'));var BPromise=require(_0xb39f('0x6'));var Mustache=require(_0xb39f('0x7'));var util=require(_0xb39f('0x8'));var path=require('path');var sox=require(_0xb39f('0x9'));var csv=require(_0xb39f('0xa'));var ejs=require(_0xb39f('0xb'));var fs=require('fs');var fs_extra=require(_0xb39f('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb39f('0xd'));var jsforce=require(_0xb39f('0xe'));var deskjs=require(_0xb39f('0xf'));var toCsv=require(_0xb39f('0xa'));var querystring=require('querystring');var Papa=require(_0xb39f('0x10'));var Redis=require(_0xb39f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb39f('0x12'));var as=require(_0xb39f('0x13'));var hardwareService=require(_0xb39f('0x14'));var logger=require('../../config/logger')(_0xb39f('0x15'));var utils=require(_0xb39f('0x16'));var config=require(_0xb39f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb39f('0x18'))['db'];function respondWithStatusCode(_0x341a0d,_0x220790){_0x220790=_0x220790||0xcc;return function(_0x5a2f6b){if(_0x5a2f6b){return _0x341a0d['sendStatus'](_0x220790);}return _0x341a0d['status'](_0x220790)[_0xb39f('0x19')]();};}function respondWithResult(_0x2fc48a,_0x262539){_0x262539=_0x262539||0xc8;return function(_0x33267c){if(_0x33267c){return _0x2fc48a[_0xb39f('0x1a')](_0x262539)[_0xb39f('0x1b')](_0x33267c);}};}function respondWithFilteredResult(_0x2a1ca0,_0x3c3be9){return function(_0x30d979){if(_0x30d979){var _0x47c9b2=typeof _0x3c3be9['offset']===_0xb39f('0x1c')&&typeof _0x3c3be9[_0xb39f('0x1d')]===_0xb39f('0x1c');var _0x3cad9a=_0x30d979[_0xb39f('0x1e')];var _0x30699e=_0x47c9b2?0x0:_0x3c3be9[_0xb39f('0x1f')];var _0x3a379a=_0x47c9b2?_0x30d979[_0xb39f('0x1e')]:_0x3c3be9['offset']+_0x3c3be9[_0xb39f('0x1d')];var _0x4d0983;if(_0x3a379a>=_0x3cad9a){_0x3a379a=_0x3cad9a;_0x4d0983=0xc8;}else{_0x4d0983=0xce;}_0x2a1ca0[_0xb39f('0x1a')](_0x4d0983);return _0x2a1ca0[_0xb39f('0x20')](_0xb39f('0x21'),_0x30699e+'-'+_0x3a379a+'/'+_0x3cad9a)[_0xb39f('0x1b')](_0x30d979);}return null;};}function patchUpdates(_0x2c3fde){return function(_0x6a3fba){try{jsonpatch[_0xb39f('0x22')](_0x6a3fba,_0x2c3fde,!![]);}catch(_0x2f476c){return BPromise[_0xb39f('0x23')](_0x2f476c);}return _0x6a3fba['save']();};}function saveUpdates(_0x6c1c0a,_0x4be0af){return function(_0x5b8cdd){if(_0x5b8cdd){return _0x5b8cdd['update'](_0x6c1c0a)[_0xb39f('0x24')](function(_0x38983f){return _0x38983f;});}return null;};}function removeEntity(_0xa04edd,_0x1cfccc){return function(_0x266572){if(_0x266572){return _0x266572[_0xb39f('0x25')]()[_0xb39f('0x24')](function(){_0xa04edd[_0xb39f('0x1a')](0xcc)[_0xb39f('0x19')]();});}};}function handleEntityNotFound(_0x1c66e2,_0xa31679){return function(_0x21e2e5){if(!_0x21e2e5){_0x1c66e2[_0xb39f('0x26')](0x194);}return _0x21e2e5;};}function handleError(_0x12683b,_0x7d535a){_0x7d535a=_0x7d535a||0x1f4;return function(_0x5e3873){logger['error'](_0x5e3873[_0xb39f('0x27')]);if(_0x5e3873[_0xb39f('0x28')]){delete _0x5e3873['name'];}_0x12683b[_0xb39f('0x1a')](_0x7d535a)['send'](_0x5e3873);};}exports['index']=function(_0x4dcccd,_0x57a81f){var _0x209bc9={},_0x137f8c={},_0x1d9b16={'count':0x0,'rows':[]};var _0x2a5bbe=_[_0xb39f('0x29')](db['SmsQueueReport'][_0xb39f('0x2a')],function(_0x14fff5){return{'name':_0x14fff5[_0xb39f('0x2b')],'type':_0x14fff5[_0xb39f('0x2c')][_0xb39f('0x2d')]};});_0x137f8c[_0xb39f('0x2e')]=_[_0xb39f('0x29')](_0x2a5bbe,_0xb39f('0x28'));_0x137f8c[_0xb39f('0x2f')]=_[_0xb39f('0x30')](_0x4dcccd[_0xb39f('0x2f')]);_0x137f8c['filters']=_['intersection'](_0x137f8c['model'],_0x137f8c[_0xb39f('0x2f')]);_0x209bc9[_0xb39f('0x31')]=_[_0xb39f('0x32')](_0x137f8c[_0xb39f('0x2e')],qs[_0xb39f('0x33')](_0x4dcccd[_0xb39f('0x2f')][_0xb39f('0x33')]));_0x209bc9[_0xb39f('0x31')]=_0x209bc9[_0xb39f('0x31')][_0xb39f('0x34')]?_0x209bc9[_0xb39f('0x31')]:_0x137f8c[_0xb39f('0x2e')];if(!_0x4dcccd[_0xb39f('0x2f')][_0xb39f('0x35')](_0xb39f('0x36'))){_0x209bc9[_0xb39f('0x1d')]=qs['limit'](_0x4dcccd[_0xb39f('0x2f')]['limit']);_0x209bc9[_0xb39f('0x1f')]=qs[_0xb39f('0x1f')](_0x4dcccd[_0xb39f('0x2f')][_0xb39f('0x1f')]);}_0x209bc9[_0xb39f('0x37')]=qs['sort'](_0x4dcccd[_0xb39f('0x2f')][_0xb39f('0x38')]);_0x209bc9[_0xb39f('0x39')]=qs[_0xb39f('0x3a')](_[_0xb39f('0x3b')](_0x4dcccd[_0xb39f('0x2f')],_0x137f8c[_0xb39f('0x3a')]),_0x2a5bbe);if(_0x4dcccd[_0xb39f('0x2f')]['filter']){_0x209bc9[_0xb39f('0x39')]=_[_0xb39f('0x3c')](_0x209bc9[_0xb39f('0x39')],{'$or':_[_0xb39f('0x29')](_0x2a5bbe,function(_0x5c01ff){if(_0x5c01ff['type']!==_0xb39f('0x3d')){var _0x4ae2e2={};_0x4ae2e2[_0x5c01ff[_0xb39f('0x28')]]={'$like':'%'+_0x4dcccd[_0xb39f('0x2f')][_0xb39f('0x3e')]+'%'};return _0x4ae2e2;}})});}_0x209bc9=_[_0xb39f('0x3c')]({},_0x209bc9,_0x4dcccd[_0xb39f('0x3f')]);var _0x500256={'where':_0x209bc9[_0xb39f('0x39')]};return db['SmsQueueReport'][_0xb39f('0x1e')](_0x500256)['then'](function(_0x1f237a){_0x1d9b16[_0xb39f('0x1e')]=_0x1f237a;if(_0x4dcccd[_0xb39f('0x2f')][_0xb39f('0x40')]){_0x209bc9[_0xb39f('0x41')]=[{'all':!![]}];}return db[_0xb39f('0x42')][_0xb39f('0x43')](_0x209bc9);})[_0xb39f('0x24')](function(_0x20f627){_0x1d9b16[_0xb39f('0x44')]=_0x20f627;return _0x1d9b16;})[_0xb39f('0x24')](respondWithFilteredResult(_0x57a81f,_0x209bc9))[_0xb39f('0x45')](handleError(_0x57a81f,null));};exports[_0xb39f('0x46')]=function(_0x469078,_0x533a6e){var _0x3c80a6={'raw':!![],'where':{'id':_0x469078[_0xb39f('0x47')]['id']}},_0x4184f8={};_0x4184f8[_0xb39f('0x2e')]=_[_0xb39f('0x30')](db[_0xb39f('0x42')][_0xb39f('0x2a')]);_0x4184f8[_0xb39f('0x2f')]=_[_0xb39f('0x30')](_0x469078['query']);_0x4184f8[_0xb39f('0x3a')]=_[_0xb39f('0x32')](_0x4184f8['model'],_0x4184f8[_0xb39f('0x2f')]);_0x3c80a6[_0xb39f('0x31')]=_[_0xb39f('0x32')](_0x4184f8['model'],qs[_0xb39f('0x33')](_0x469078[_0xb39f('0x2f')][_0xb39f('0x33')]));_0x3c80a6[_0xb39f('0x31')]=_0x3c80a6[_0xb39f('0x31')][_0xb39f('0x34')]?_0x3c80a6[_0xb39f('0x31')]:_0x4184f8[_0xb39f('0x2e')];if(_0x469078[_0xb39f('0x2f')][_0xb39f('0x40')]){_0x3c80a6[_0xb39f('0x41')]=[{'all':!![]}];}_0x3c80a6=_[_0xb39f('0x3c')]({},_0x3c80a6,_0x469078[_0xb39f('0x3f')]);return db[_0xb39f('0x42')][_0xb39f('0x48')](_0x3c80a6)[_0xb39f('0x24')](handleEntityNotFound(_0x533a6e,null))[_0xb39f('0x24')](respondWithResult(_0x533a6e,null))[_0xb39f('0x45')](handleError(_0x533a6e,null));};exports[_0xb39f('0x49')]=function(_0xe1ed67,_0x4b625c){return db[_0xb39f('0x42')][_0xb39f('0x49')](_0xe1ed67[_0xb39f('0x4a')],{})[_0xb39f('0x24')](respondWithResult(_0x4b625c,0xc9))['catch'](handleError(_0x4b625c,null));};exports[_0xb39f('0x4b')]=function(_0x55a2fb,_0x43e2df){if(_0x55a2fb[_0xb39f('0x4a')]['id']){delete _0x55a2fb[_0xb39f('0x4a')]['id'];}return db[_0xb39f('0x42')][_0xb39f('0x48')]({'where':{'id':_0x55a2fb[_0xb39f('0x47')]['id']}})[_0xb39f('0x24')](handleEntityNotFound(_0x43e2df,null))[_0xb39f('0x24')](saveUpdates(_0x55a2fb['body'],null))[_0xb39f('0x24')](respondWithResult(_0x43e2df,null))[_0xb39f('0x45')](handleError(_0x43e2df,null));};exports[_0xb39f('0x25')]=function(_0x859ef3,_0x3fc2e7){return db[_0xb39f('0x42')][_0xb39f('0x48')]({'where':{'id':_0x859ef3['params']['id']}})[_0xb39f('0x24')](handleEntityNotFound(_0x3fc2e7,null))[_0xb39f('0x24')](removeEntity(_0x3fc2e7,null))[_0xb39f('0x45')](handleError(_0x3fc2e7,null));};exports['describe']=function(_0x308d29,_0x393c2e){return db[_0xb39f('0x42')][_0xb39f('0x4c')]()['then'](respondWithResult(_0x393c2e,null))[_0xb39f('0x45')](handleError(_0x393c2e,null));}; \ No newline at end of file +var _0x4698=['rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','filter','includeAll','include','rows','catch','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','offset','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SmsQueueReport'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x4698,0x1d9));var _0x8469=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x4698[_0x2cfb58];return _0xd99951;};'use strict';var emlformat=require(_0x8469('0x0'));var rimraf=require(_0x8469('0x1'));var zipdir=require(_0x8469('0x2'));var jsonpatch=require(_0x8469('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8469('0x4'));var Mustache=require(_0x8469('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8469('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8469('0x7'));var _=require(_0x8469('0x8'));var squel=require(_0x8469('0x9'));var crypto=require(_0x8469('0xa'));var jsforce=require(_0x8469('0xb'));var deskjs=require(_0x8469('0xc'));var toCsv=require(_0x8469('0xd'));var querystring=require(_0x8469('0xe'));var Papa=require(_0x8469('0xf'));var Redis=require(_0x8469('0x10'));var authService=require(_0x8469('0x11'));var qs=require(_0x8469('0x12'));var as=require(_0x8469('0x13'));var hardwareService=require(_0x8469('0x14'));var logger=require(_0x8469('0x15'))('api');var utils=require(_0x8469('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8469('0x17'));var db=require(_0x8469('0x18'))['db'];function respondWithStatusCode(_0x303879,_0x334d1a){_0x334d1a=_0x334d1a||0xcc;return function(_0x6cad9c){if(_0x6cad9c){return _0x303879[_0x8469('0x19')](_0x334d1a);}return _0x303879[_0x8469('0x1a')](_0x334d1a)[_0x8469('0x1b')]();};}function respondWithResult(_0x224a88,_0x5c7e25){_0x5c7e25=_0x5c7e25||0xc8;return function(_0xc05a30){if(_0xc05a30){return _0x224a88[_0x8469('0x1a')](_0x5c7e25)['json'](_0xc05a30);}};}function respondWithFilteredResult(_0x473645,_0xfe90db){return function(_0x4d5784){if(_0x4d5784){var _0x16f4fd=typeof _0xfe90db['offset']===_0x8469('0x1c')&&typeof _0xfe90db['limit']===_0x8469('0x1c');var _0x2f7452=_0x4d5784['count'];var _0x23b15a=_0x16f4fd?0x0:_0xfe90db[_0x8469('0x1d')];var _0x1a1556=_0x16f4fd?_0x4d5784[_0x8469('0x1e')]:_0xfe90db[_0x8469('0x1d')]+_0xfe90db[_0x8469('0x1f')];var _0x494098;if(_0x1a1556>=_0x2f7452){_0x1a1556=_0x2f7452;_0x494098=0xc8;}else{_0x494098=0xce;}_0x473645[_0x8469('0x1a')](_0x494098);return _0x473645['set'](_0x8469('0x20'),_0x23b15a+'-'+_0x1a1556+'/'+_0x2f7452)['json'](_0x4d5784);}return null;};}function patchUpdates(_0x5bc1d5){return function(_0x3b77d2){try{jsonpatch[_0x8469('0x21')](_0x3b77d2,_0x5bc1d5,!![]);}catch(_0x173c85){return BPromise[_0x8469('0x22')](_0x173c85);}return _0x3b77d2[_0x8469('0x23')]();};}function saveUpdates(_0x45b15d,_0x510071){return function(_0x3dab84){if(_0x3dab84){return _0x3dab84[_0x8469('0x24')](_0x45b15d)[_0x8469('0x25')](function(_0x497b31){return _0x497b31;});}return null;};}function removeEntity(_0x7e23e6,_0x2331bd){return function(_0x3cf74f){if(_0x3cf74f){return _0x3cf74f[_0x8469('0x26')]()[_0x8469('0x25')](function(){_0x7e23e6[_0x8469('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ee6e2,_0x4e2f45){return function(_0x2bdf5c){if(!_0x2bdf5c){_0x2ee6e2['sendStatus'](0x194);}return _0x2bdf5c;};}function handleError(_0x3d85dc,_0x528d36){_0x528d36=_0x528d36||0x1f4;return function(_0xf24d6b){logger[_0x8469('0x27')](_0xf24d6b[_0x8469('0x28')]);if(_0xf24d6b[_0x8469('0x29')]){delete _0xf24d6b[_0x8469('0x29')];}_0x3d85dc['status'](_0x528d36)['send'](_0xf24d6b);};}exports[_0x8469('0x2a')]=function(_0xc300d5,_0x49a98e){var _0x1fd729={},_0x20b5c9={},_0x5b8143={'count':0x0,'rows':[]};var _0x53e02e=_[_0x8469('0x2b')](db[_0x8469('0x2c')][_0x8469('0x2d')],function(_0x250922){return{'name':_0x250922[_0x8469('0x2e')],'type':_0x250922[_0x8469('0x2f')][_0x8469('0x30')]};});_0x20b5c9[_0x8469('0x31')]=_['map'](_0x53e02e,_0x8469('0x29'));_0x20b5c9[_0x8469('0x32')]=_[_0x8469('0x33')](_0xc300d5[_0x8469('0x32')]);_0x20b5c9['filters']=_[_0x8469('0x34')](_0x20b5c9[_0x8469('0x31')],_0x20b5c9[_0x8469('0x32')]);_0x1fd729[_0x8469('0x35')]=_[_0x8469('0x34')](_0x20b5c9[_0x8469('0x31')],qs[_0x8469('0x36')](_0xc300d5[_0x8469('0x32')][_0x8469('0x36')]));_0x1fd729[_0x8469('0x35')]=_0x1fd729[_0x8469('0x35')]['length']?_0x1fd729[_0x8469('0x35')]:_0x20b5c9[_0x8469('0x31')];if(!_0xc300d5[_0x8469('0x32')][_0x8469('0x37')](_0x8469('0x38'))){_0x1fd729['limit']=qs[_0x8469('0x1f')](_0xc300d5[_0x8469('0x32')]['limit']);_0x1fd729[_0x8469('0x1d')]=qs['offset'](_0xc300d5[_0x8469('0x32')][_0x8469('0x1d')]);}_0x1fd729[_0x8469('0x39')]=qs[_0x8469('0x3a')](_0xc300d5['query']['sort']);_0x1fd729[_0x8469('0x3b')]=qs['filters'](_[_0x8469('0x3c')](_0xc300d5['query'],_0x20b5c9[_0x8469('0x3d')]),_0x53e02e);if(_0xc300d5[_0x8469('0x32')]['filter']){_0x1fd729[_0x8469('0x3b')]=_[_0x8469('0x3e')](_0x1fd729[_0x8469('0x3b')],{'$or':_[_0x8469('0x2b')](_0x53e02e,function(_0x5157da){if(_0x5157da[_0x8469('0x2f')]!=='VIRTUAL'){var _0x2fa14={};_0x2fa14[_0x5157da['name']]={'$like':'%'+_0xc300d5[_0x8469('0x32')][_0x8469('0x3f')]+'%'};return _0x2fa14;}})});}_0x1fd729=_[_0x8469('0x3e')]({},_0x1fd729,_0xc300d5['options']);var _0x423b69={'where':_0x1fd729['where']};return db[_0x8469('0x2c')][_0x8469('0x1e')](_0x423b69)[_0x8469('0x25')](function(_0x50645d){_0x5b8143['count']=_0x50645d;if(_0xc300d5[_0x8469('0x32')][_0x8469('0x40')]){_0x1fd729[_0x8469('0x41')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x1fd729);})[_0x8469('0x25')](function(_0x10addf){_0x5b8143[_0x8469('0x42')]=_0x10addf;return _0x5b8143;})[_0x8469('0x25')](respondWithFilteredResult(_0x49a98e,_0x1fd729))[_0x8469('0x43')](handleError(_0x49a98e,null));};exports['show']=function(_0x20938c,_0x4ef70f){var _0x225113={'raw':!![],'where':{'id':_0x20938c[_0x8469('0x44')]['id']}},_0x43a09e={};_0x43a09e[_0x8469('0x31')]=_[_0x8469('0x33')](db[_0x8469('0x2c')][_0x8469('0x2d')]);_0x43a09e['query']=_[_0x8469('0x33')](_0x20938c['query']);_0x43a09e[_0x8469('0x3d')]=_[_0x8469('0x34')](_0x43a09e[_0x8469('0x31')],_0x43a09e['query']);_0x225113['attributes']=_[_0x8469('0x34')](_0x43a09e['model'],qs[_0x8469('0x36')](_0x20938c[_0x8469('0x32')][_0x8469('0x36')]));_0x225113[_0x8469('0x35')]=_0x225113[_0x8469('0x35')][_0x8469('0x45')]?_0x225113[_0x8469('0x35')]:_0x43a09e[_0x8469('0x31')];if(_0x20938c[_0x8469('0x32')][_0x8469('0x40')]){_0x225113[_0x8469('0x41')]=[{'all':!![]}];}_0x225113=_['merge']({},_0x225113,_0x20938c['options']);return db[_0x8469('0x2c')][_0x8469('0x46')](_0x225113)['then'](handleEntityNotFound(_0x4ef70f,null))['then'](respondWithResult(_0x4ef70f,null))['catch'](handleError(_0x4ef70f,null));};exports['create']=function(_0x832728,_0x508bd3){return db[_0x8469('0x2c')][_0x8469('0x47')](_0x832728['body'],{})[_0x8469('0x25')](respondWithResult(_0x508bd3,0xc9))[_0x8469('0x43')](handleError(_0x508bd3,null));};exports[_0x8469('0x24')]=function(_0x4ed299,_0x4c3b88){if(_0x4ed299['body']['id']){delete _0x4ed299[_0x8469('0x48')]['id'];}return db[_0x8469('0x2c')][_0x8469('0x46')]({'where':{'id':_0x4ed299[_0x8469('0x44')]['id']}})[_0x8469('0x25')](handleEntityNotFound(_0x4c3b88,null))[_0x8469('0x25')](saveUpdates(_0x4ed299[_0x8469('0x48')],null))['then'](respondWithResult(_0x4c3b88,null))['catch'](handleError(_0x4c3b88,null));};exports[_0x8469('0x26')]=function(_0x32e4b,_0x166eb4){return db[_0x8469('0x2c')][_0x8469('0x46')]({'where':{'id':_0x32e4b[_0x8469('0x44')]['id']}})[_0x8469('0x25')](handleEntityNotFound(_0x166eb4,null))[_0x8469('0x25')](removeEntity(_0x166eb4,null))[_0x8469('0x43')](handleError(_0x166eb4,null));};exports[_0x8469('0x49')]=function(_0x39cdb8,_0x55c2d7){return db[_0x8469('0x2c')][_0x8469('0x49')]()[_0x8469('0x25')](respondWithResult(_0x55c2d7,null))['catch'](handleError(_0x55c2d7,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 8a86231..fcf8f09 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x57df15,_0x478a86){var _0x168805=function(_0x4357e5){while(--_0x4357e5){_0x57df15['push'](_0x57df15['shift']());}};_0x168805(++_0x478a86);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x3f0f15,_0x443b6b){var _0x108711=function(_0xf28b96){while(--_0xf28b96){_0x3f0f15['push'](_0x3f0f15['shift']());}};_0x108711(++_0x443b6b);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index cd2f753..08dcfe1 100644 --- a/server/api/smsQueueReport/smsQueueReport.rpc.js +++ b/server/api/smsQueueReport/smsQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa914=['SmsQueueReport,\x20%s,\x20%s','message','request\x20sent','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','debug','UpdateSmsQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x7261e6,_0x3e3bf7){var _0x20d5ed=function(_0x522641){while(--_0x522641){_0x7261e6['push'](_0x7261e6['shift']());}};_0x20d5ed(++_0x3e3bf7);}(_0xa914,0x97));var _0x4a91=function(_0x2264e1,_0x4c5c1c){_0x2264e1=_0x2264e1-0x0;var _0x508ab2=_0xa914[_0x2264e1];return _0x508ab2;};'use strict';var _=require(_0x4a91('0x0'));var util=require(_0x4a91('0x1'));var moment=require(_0x4a91('0x2'));var BPromise=require(_0x4a91('0x3'));var rs=require(_0x4a91('0x4'));var fs=require('fs');var Redis=require(_0x4a91('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a91('0x6'));var logger=require(_0x4a91('0x7'))('rpc');var config=require(_0x4a91('0x8'));var jayson=require(_0x4a91('0x9'));var client=jayson[_0x4a91('0xa')][_0x4a91('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x545c76,_0x25f4c7,_0x2d5999){return new BPromise(function(_0x2047fc,_0x2a3cfd){return client[_0x4a91('0xc')](_0x545c76,_0x2d5999)[_0x4a91('0xd')](function(_0x3208be){logger[_0x4a91('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x25f4c7,'request\x20sent');logger['debug'](_0x4a91('0xf'),_0x25f4c7,'request\x20sent',JSON[_0x4a91('0x10')](_0x3208be));if(_0x3208be['error']){if(_0x3208be[_0x4a91('0x11')][_0x4a91('0x12')]===0x1f4){logger['error'](_0x4a91('0x13'),_0x25f4c7,_0x3208be[_0x4a91('0x11')]['message']);return _0x2a3cfd(_0x3208be[_0x4a91('0x11')][_0x4a91('0x14')]);}logger[_0x4a91('0x11')](_0x4a91('0x13'),_0x25f4c7,_0x3208be[_0x4a91('0x11')][_0x4a91('0x14')]);return _0x2047fc(_0x3208be[_0x4a91('0x11')][_0x4a91('0x14')]);}else{logger['info'](_0x4a91('0x13'),_0x25f4c7,_0x4a91('0x15'));_0x2047fc(_0x3208be['result'][_0x4a91('0x14')]);}})[_0x4a91('0x16')](function(_0x643b90){logger['error'](_0x4a91('0x13'),_0x25f4c7,_0x643b90);_0x2a3cfd(_0x643b90);});});}exports[_0x4a91('0x17')]=function(_0x3f910b){var _0x42d8f5=this;return new Promise(function(_0x212f52,_0xffda32){return db[_0x4a91('0x18')][_0x4a91('0x19')](_0x3f910b[_0x4a91('0x1a')],{'raw':_0x3f910b[_0x4a91('0x1b')]?_0x3f910b[_0x4a91('0x1b')][_0x4a91('0x1c')]===undefined?!![]:![]:!![]})[_0x4a91('0xd')](function(_0x29e75f){logger[_0x4a91('0xe')](_0x4a91('0x17'),_0x3f910b);logger[_0x4a91('0x1d')](_0x4a91('0x17'),_0x3f910b,JSON[_0x4a91('0x10')](_0x29e75f));_0x212f52(_0x29e75f);})[_0x4a91('0x16')](function(_0x2d4671){logger['error'](_0x4a91('0x17'),_0x2d4671[_0x4a91('0x14')],_0x3f910b);_0xffda32(_0x42d8f5[_0x4a91('0x11')](0x1f4,_0x2d4671[_0x4a91('0x14')]));});});};exports[_0x4a91('0x1e')]=function(_0x25baac){var _0x4993ec=this;return new Promise(function(_0x139716,_0x4dc770){return db[_0x4a91('0x18')][_0x4a91('0x1f')](_0x25baac[_0x4a91('0x1a')],{'raw':_0x25baac[_0x4a91('0x1b')]?_0x25baac[_0x4a91('0x1b')][_0x4a91('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25baac[_0x4a91('0x1b')]?_0x25baac[_0x4a91('0x1b')]['where']||null:null,'attributes':_0x25baac[_0x4a91('0x1b')]?_0x25baac[_0x4a91('0x1b')][_0x4a91('0x20')]||null:null,'limit':_0x25baac[_0x4a91('0x1b')]?_0x25baac[_0x4a91('0x1b')][_0x4a91('0x21')]||null:null})[_0x4a91('0xd')](function(_0x2d60ec){logger[_0x4a91('0xe')](_0x4a91('0x1e'),_0x25baac);logger[_0x4a91('0x1d')]('UpdateSmsQueueReport',_0x25baac,JSON['stringify'](_0x2d60ec));_0x139716(_0x2d60ec);})['catch'](function(_0x7ce5c9){logger[_0x4a91('0x11')](_0x4a91('0x1e'),_0x7ce5c9[_0x4a91('0x14')],_0x25baac);_0x4dc770(_0x4993ec[_0x4a91('0x11')](0x1f4,_0x7ce5c9[_0x4a91('0x14')]));});});}; \ No newline at end of file +var _0x43af=['request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','update','where','attributes','limit','UpdateSmsQueueReport','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x43af,0x174));var _0xf43a=function(_0x5c3e87,_0x2494b2){_0x5c3e87=_0x5c3e87-0x0;var _0x4d328d=_0x43af[_0x5c3e87];return _0x4d328d;};'use strict';var _=require('lodash');var util=require(_0xf43a('0x0'));var moment=require(_0xf43a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf43a('0x2'))['db'];var utils=require(_0xf43a('0x3'));var logger=require(_0xf43a('0x4'))(_0xf43a('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf43a('0x6')][_0xf43a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x56e115,_0x41fbe1,_0x2a9d9c){return new BPromise(function(_0x1cf3ec,_0x27a2a7){return client[_0xf43a('0x8')](_0x56e115,_0x2a9d9c)[_0xf43a('0x9')](function(_0x237d34){logger[_0xf43a('0xa')](_0xf43a('0xb'),_0x41fbe1,_0xf43a('0xc'));logger[_0xf43a('0xd')](_0xf43a('0xe'),_0x41fbe1,_0xf43a('0xc'),JSON[_0xf43a('0xf')](_0x237d34));if(_0x237d34[_0xf43a('0x10')]){if(_0x237d34[_0xf43a('0x10')][_0xf43a('0x11')]===0x1f4){logger[_0xf43a('0x10')](_0xf43a('0xb'),_0x41fbe1,_0x237d34[_0xf43a('0x10')][_0xf43a('0x12')]);return _0x27a2a7(_0x237d34[_0xf43a('0x10')][_0xf43a('0x12')]);}logger[_0xf43a('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x41fbe1,_0x237d34[_0xf43a('0x10')][_0xf43a('0x12')]);return _0x1cf3ec(_0x237d34['error'][_0xf43a('0x12')]);}else{logger['info'](_0xf43a('0xb'),_0x41fbe1,_0xf43a('0xc'));_0x1cf3ec(_0x237d34[_0xf43a('0x13')][_0xf43a('0x12')]);}})[_0xf43a('0x14')](function(_0x5c7bd5){logger[_0xf43a('0x10')](_0xf43a('0xb'),_0x41fbe1,_0x5c7bd5);_0x27a2a7(_0x5c7bd5);});});}exports[_0xf43a('0x15')]=function(_0x4b36b7){var _0x3ce6b4=this;return new Promise(function(_0x5ca603,_0x2b1f42){return db[_0xf43a('0x16')][_0xf43a('0x17')](_0x4b36b7[_0xf43a('0x18')],{'raw':_0x4b36b7[_0xf43a('0x19')]?_0x4b36b7[_0xf43a('0x19')][_0xf43a('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x39379e){logger[_0xf43a('0xa')](_0xf43a('0x15'),_0x4b36b7);logger[_0xf43a('0xd')](_0xf43a('0x15'),_0x4b36b7,JSON[_0xf43a('0xf')](_0x39379e));_0x5ca603(_0x39379e);})[_0xf43a('0x14')](function(_0x22a449){logger[_0xf43a('0x10')](_0xf43a('0x15'),_0x22a449[_0xf43a('0x12')],_0x4b36b7);_0x2b1f42(_0x3ce6b4[_0xf43a('0x10')](0x1f4,_0x22a449['message']));});});};exports['UpdateSmsQueueReport']=function(_0x42cbec){var _0x7182cf=this;return new Promise(function(_0x45a8a5,_0x45365b){return db[_0xf43a('0x16')][_0xf43a('0x1b')](_0x42cbec[_0xf43a('0x18')],{'raw':_0x42cbec[_0xf43a('0x19')]?_0x42cbec[_0xf43a('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42cbec['options']?_0x42cbec[_0xf43a('0x19')][_0xf43a('0x1c')]||null:null,'attributes':_0x42cbec['options']?_0x42cbec[_0xf43a('0x19')][_0xf43a('0x1d')]||null:null,'limit':_0x42cbec[_0xf43a('0x19')]?_0x42cbec[_0xf43a('0x19')][_0xf43a('0x1e')]||null:null})[_0xf43a('0x9')](function(_0xcf342f){logger[_0xf43a('0xa')](_0xf43a('0x1f'),_0x42cbec);logger[_0xf43a('0xd')]('UpdateSmsQueueReport',_0x42cbec,JSON['stringify'](_0xcf342f));_0x45a8a5(_0xcf342f);})['catch'](function(_0x137df5){logger[_0xf43a('0x10')](_0xf43a('0x1f'),_0x137df5[_0xf43a('0x12')],_0x42cbec);_0x45365b(_0x7182cf[_0xf43a('0x10')](0x1f4,_0x137df5['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index c12b529..0ed78ea 100644 --- a/server/api/smsTransferReport/index.js +++ b/server/api/smsTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab86=['../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3bb21a,_0x353b56){var _0x5f3983=function(_0x334b13){while(--_0x334b13){_0x3bb21a['push'](_0x3bb21a['shift']());}};_0x5f3983(++_0x353b56);}(_0xab86,0x13e));var _0x6ab8=function(_0xc1e0c8,_0x26969a){_0xc1e0c8=_0xc1e0c8-0x0;var _0xf8b981=_0xab86[_0xc1e0c8];return _0xf8b981;};'use strict';var multer=require(_0x6ab8('0x0'));var util=require(_0x6ab8('0x1'));var path=require(_0x6ab8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6ab8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ab8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ab8('0x5'));var controller=require(_0x6ab8('0x6'));router[_0x6ab8('0x7')]('/',auth[_0x6ab8('0x8')](),controller[_0x6ab8('0x9')]);router[_0x6ab8('0x7')](_0x6ab8('0xa'),auth[_0x6ab8('0x8')](),controller[_0x6ab8('0xb')]);router[_0x6ab8('0x7')](_0x6ab8('0xc'),auth[_0x6ab8('0x8')](),controller[_0x6ab8('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6ab8('0xe')]);router['put'](_0x6ab8('0xc'),auth[_0x6ab8('0x8')](),controller[_0x6ab8('0xf')]);router['delete'](_0x6ab8('0xc'),auth[_0x6ab8('0x8')](),controller['destroy']);module[_0x6ab8('0x10')]=router; \ No newline at end of file +var _0x0bde=['create','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x4726d1,_0x4ea575){var _0x5e7b04=function(_0x23421c){while(--_0x23421c){_0x4726d1['push'](_0x4726d1['shift']());}};_0x5e7b04(++_0x4ea575);}(_0x0bde,0xe7));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0xe0bd('0x0'));var path=require('path');var timeout=require(_0xe0bd('0x1'));var express=require(_0xe0bd('0x2'));var router=express[_0xe0bd('0x3')]();var fs_extra=require(_0xe0bd('0x4'));var auth=require(_0xe0bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe0bd('0x6'));var controller=require(_0xe0bd('0x7'));router[_0xe0bd('0x8')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xa')]);router[_0xe0bd('0x8')](_0xe0bd('0xb'),auth['isAuthenticated'](),controller[_0xe0bd('0xc')]);router[_0xe0bd('0x8')](_0xe0bd('0xd'),auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xe')]);router[_0xe0bd('0xf')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe0bd('0x11')]);router['delete']('/:id',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 3db97b6..7cc3fca 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x498334,_0x27b6fe){var _0x13bb70=function(_0x4087b1){while(--_0x4087b1){_0x498334['push'](_0x498334['shift']());}};_0x13bb70(++_0x27b6fe);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4cdeee,_0x4ecf19){_0x4cdeee=_0x4cdeee-0x0;var _0x359dac=_0xb43b[_0x4cdeee];return _0x359dac;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3fc66d,_0x598f92){var _0x320427=function(_0xfff24b){while(--_0xfff24b){_0x3fc66d['push'](_0x3fc66d['shift']());}};_0x320427(++_0x598f92);}(_0xaa88,0x137));var _0x8aa8=function(_0xb5fc3e,_0x234703){_0xb5fc3e=_0xb5fc3e-0x0;var _0x2efc3c=_0xaa88[_0xb5fc3e];return _0x2efc3c;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index afce1de..c9ac481 100644 --- a/server/api/smsTransferReport/smsTransferReport.controller.js +++ b/server/api/smsTransferReport/smsTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f77=['fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','end','status','json','undefined','limit','count','offset','set','apply','reject','then','sendStatus','stack','name','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','includeAll','create','update','body','destroy','find','describe','eml-format','rimraf','zip-dir'];(function(_0x10249f,_0x3af1bc){var _0x4fe5b2=function(_0x5094a9){while(--_0x5094a9){_0x10249f['push'](_0x10249f['shift']());}};_0x4fe5b2(++_0x3af1bc);}(_0x2f77,0x16a));var _0x72f7=function(_0x535c80,_0x4a4e71){_0x535c80=_0x535c80-0x0;var _0x57a4d9=_0x2f77[_0x535c80];return _0x57a4d9;};'use strict';var emlformat=require(_0x72f7('0x0'));var rimraf=require(_0x72f7('0x1'));var zipdir=require(_0x72f7('0x2'));var jsonpatch=require(_0x72f7('0x3'));var rp=require(_0x72f7('0x4'));var moment=require(_0x72f7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x72f7('0x6'));var util=require(_0x72f7('0x7'));var path=require(_0x72f7('0x8'));var sox=require(_0x72f7('0x9'));var csv=require(_0x72f7('0xa'));var ejs=require(_0x72f7('0xb'));var fs=require('fs');var fs_extra=require(_0x72f7('0xc'));var _=require(_0x72f7('0xd'));var squel=require('squel');var crypto=require(_0x72f7('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x72f7('0xa'));var querystring=require(_0x72f7('0xf'));var Papa=require('papaparse');var Redis=require(_0x72f7('0x10'));var authService=require(_0x72f7('0x11'));var qs=require(_0x72f7('0x12'));var as=require(_0x72f7('0x13'));var hardwareService=require(_0x72f7('0x14'));var logger=require('../../config/logger')(_0x72f7('0x15'));var utils=require('../../config/utils');var config=require(_0x72f7('0x16'));var licenseUtil=require(_0x72f7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x587d6f,_0x402b6f){_0x402b6f=_0x402b6f||0xcc;return function(_0x3b98b1){if(_0x3b98b1){return _0x587d6f['sendStatus'](_0x402b6f);}return _0x587d6f['status'](_0x402b6f)[_0x72f7('0x18')]();};}function respondWithResult(_0x1e6116,_0x22b91f){_0x22b91f=_0x22b91f||0xc8;return function(_0x5b2002){if(_0x5b2002){return _0x1e6116[_0x72f7('0x19')](_0x22b91f)[_0x72f7('0x1a')](_0x5b2002);}};}function respondWithFilteredResult(_0x17d6ba,_0xe662cc){return function(_0x34e6b8){if(_0x34e6b8){var _0x4dcaec=typeof _0xe662cc['offset']===_0x72f7('0x1b')&&typeof _0xe662cc[_0x72f7('0x1c')]===_0x72f7('0x1b');var _0x654400=_0x34e6b8[_0x72f7('0x1d')];var _0xca1775=_0x4dcaec?0x0:_0xe662cc['offset'];var _0x67aebe=_0x4dcaec?_0x34e6b8[_0x72f7('0x1d')]:_0xe662cc[_0x72f7('0x1e')]+_0xe662cc[_0x72f7('0x1c')];var _0x5b9e1f;if(_0x67aebe>=_0x654400){_0x67aebe=_0x654400;_0x5b9e1f=0xc8;}else{_0x5b9e1f=0xce;}_0x17d6ba[_0x72f7('0x19')](_0x5b9e1f);return _0x17d6ba[_0x72f7('0x1f')]('Content-Range',_0xca1775+'-'+_0x67aebe+'/'+_0x654400)['json'](_0x34e6b8);}return null;};}function patchUpdates(_0x100f82){return function(_0x2b781c){try{jsonpatch[_0x72f7('0x20')](_0x2b781c,_0x100f82,!![]);}catch(_0x536abd){return BPromise[_0x72f7('0x21')](_0x536abd);}return _0x2b781c['save']();};}function saveUpdates(_0x1b95dd,_0x52dff8){return function(_0x3c11cf){if(_0x3c11cf){return _0x3c11cf['update'](_0x1b95dd)[_0x72f7('0x22')](function(_0xc6ef1f){return _0xc6ef1f;});}return null;};}function removeEntity(_0x40e416,_0xe84b88){return function(_0x4256c3){if(_0x4256c3){return _0x4256c3['destroy']()[_0x72f7('0x22')](function(){_0x40e416['status'](0xcc)[_0x72f7('0x18')]();});}};}function handleEntityNotFound(_0x1e736a,_0x353fab){return function(_0xdea1b9){if(!_0xdea1b9){_0x1e736a[_0x72f7('0x23')](0x194);}return _0xdea1b9;};}function handleError(_0x37dc6f,_0x183e54){_0x183e54=_0x183e54||0x1f4;return function(_0x32fd8b){logger['error'](_0x32fd8b[_0x72f7('0x24')]);if(_0x32fd8b[_0x72f7('0x25')]){delete _0x32fd8b['name'];}_0x37dc6f[_0x72f7('0x19')](_0x183e54)['send'](_0x32fd8b);};}exports[_0x72f7('0x26')]=function(_0x32f24d,_0x10439d){var _0xbf705e={},_0x9d409c={},_0x29d320={'count':0x0,'rows':[]};var _0x320281=_[_0x72f7('0x27')](db[_0x72f7('0x28')][_0x72f7('0x29')],function(_0x545e04){return{'name':_0x545e04[_0x72f7('0x2a')],'type':_0x545e04[_0x72f7('0x2b')][_0x72f7('0x2c')]};});_0x9d409c['model']=_['map'](_0x320281,_0x72f7('0x25'));_0x9d409c['query']=_[_0x72f7('0x2d')](_0x32f24d[_0x72f7('0x2e')]);_0x9d409c[_0x72f7('0x2f')]=_[_0x72f7('0x30')](_0x9d409c[_0x72f7('0x31')],_0x9d409c['query']);_0xbf705e[_0x72f7('0x32')]=_[_0x72f7('0x30')](_0x9d409c[_0x72f7('0x31')],qs[_0x72f7('0x33')](_0x32f24d['query']['fields']));_0xbf705e['attributes']=_0xbf705e['attributes'][_0x72f7('0x34')]?_0xbf705e[_0x72f7('0x32')]:_0x9d409c[_0x72f7('0x31')];if(!_0x32f24d[_0x72f7('0x2e')]['hasOwnProperty'](_0x72f7('0x35'))){_0xbf705e['limit']=qs[_0x72f7('0x1c')](_0x32f24d[_0x72f7('0x2e')][_0x72f7('0x1c')]);_0xbf705e[_0x72f7('0x1e')]=qs['offset'](_0x32f24d[_0x72f7('0x2e')][_0x72f7('0x1e')]);}_0xbf705e[_0x72f7('0x36')]=qs[_0x72f7('0x37')](_0x32f24d[_0x72f7('0x2e')]['sort']);_0xbf705e[_0x72f7('0x38')]=qs[_0x72f7('0x2f')](_[_0x72f7('0x39')](_0x32f24d['query'],_0x9d409c['filters']),_0x320281);if(_0x32f24d[_0x72f7('0x2e')][_0x72f7('0x3a')]){_0xbf705e[_0x72f7('0x38')]=_[_0x72f7('0x3b')](_0xbf705e[_0x72f7('0x38')],{'$or':_[_0x72f7('0x27')](_0x320281,function(_0x4ab9bb){if(_0x4ab9bb[_0x72f7('0x2b')]!=='VIRTUAL'){var _0x19712e={};_0x19712e[_0x4ab9bb['name']]={'$like':'%'+_0x32f24d[_0x72f7('0x2e')][_0x72f7('0x3a')]+'%'};return _0x19712e;}})});}_0xbf705e=_[_0x72f7('0x3b')]({},_0xbf705e,_0x32f24d[_0x72f7('0x3c')]);var _0x5ac217={'where':_0xbf705e['where']};return db[_0x72f7('0x28')]['count'](_0x5ac217)['then'](function(_0x213db3){_0x29d320[_0x72f7('0x1d')]=_0x213db3;if(_0x32f24d[_0x72f7('0x2e')]['includeAll']){_0xbf705e[_0x72f7('0x3d')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x72f7('0x3e')](_0xbf705e);})['then'](function(_0x357a97){_0x29d320['rows']=_0x357a97;return _0x29d320;})['then'](respondWithFilteredResult(_0x10439d,_0xbf705e))[_0x72f7('0x3f')](handleError(_0x10439d,null));};exports[_0x72f7('0x40')]=function(_0x4f4d8f,_0x389ac4){var _0x597224={'raw':!![],'where':{'id':_0x4f4d8f[_0x72f7('0x41')]['id']}},_0x1bf75a={};_0x1bf75a[_0x72f7('0x31')]=_[_0x72f7('0x2d')](db['SmsTransferReport']['rawAttributes']);_0x1bf75a[_0x72f7('0x2e')]=_[_0x72f7('0x2d')](_0x4f4d8f['query']);_0x1bf75a[_0x72f7('0x2f')]=_['intersection'](_0x1bf75a[_0x72f7('0x31')],_0x1bf75a['query']);_0x597224[_0x72f7('0x32')]=_[_0x72f7('0x30')](_0x1bf75a[_0x72f7('0x31')],qs['fields'](_0x4f4d8f[_0x72f7('0x2e')][_0x72f7('0x33')]));_0x597224['attributes']=_0x597224[_0x72f7('0x32')][_0x72f7('0x34')]?_0x597224[_0x72f7('0x32')]:_0x1bf75a[_0x72f7('0x31')];if(_0x4f4d8f[_0x72f7('0x2e')][_0x72f7('0x42')]){_0x597224[_0x72f7('0x3d')]=[{'all':!![]}];}_0x597224=_[_0x72f7('0x3b')]({},_0x597224,_0x4f4d8f[_0x72f7('0x3c')]);return db[_0x72f7('0x28')]['find'](_0x597224)[_0x72f7('0x22')](handleEntityNotFound(_0x389ac4,null))[_0x72f7('0x22')](respondWithResult(_0x389ac4,null))[_0x72f7('0x3f')](handleError(_0x389ac4,null));};exports[_0x72f7('0x43')]=function(_0x21744b,_0xb1127a){return db['SmsTransferReport'][_0x72f7('0x43')](_0x21744b['body'],{})[_0x72f7('0x22')](respondWithResult(_0xb1127a,0xc9))['catch'](handleError(_0xb1127a,null));};exports[_0x72f7('0x44')]=function(_0x13b20a,_0xfa845c){if(_0x13b20a[_0x72f7('0x45')]['id']){delete _0x13b20a[_0x72f7('0x45')]['id'];}return db[_0x72f7('0x28')]['find']({'where':{'id':_0x13b20a['params']['id']}})[_0x72f7('0x22')](handleEntityNotFound(_0xfa845c,null))[_0x72f7('0x22')](saveUpdates(_0x13b20a[_0x72f7('0x45')],null))[_0x72f7('0x22')](respondWithResult(_0xfa845c,null))[_0x72f7('0x3f')](handleError(_0xfa845c,null));};exports[_0x72f7('0x46')]=function(_0x5b4852,_0x3b3461){return db[_0x72f7('0x28')][_0x72f7('0x47')]({'where':{'id':_0x5b4852[_0x72f7('0x41')]['id']}})[_0x72f7('0x22')](handleEntityNotFound(_0x3b3461,null))['then'](removeEntity(_0x3b3461,null))[_0x72f7('0x3f')](handleError(_0x3b3461,null));};exports[_0x72f7('0x48')]=function(_0x239c39,_0x4686b9){return db['SmsTransferReport']['describe']()[_0x72f7('0x22')](respondWithResult(_0x4686b9,null))[_0x72f7('0x3f')](handleError(_0x4686b9,null));}; \ No newline at end of file +var _0x515b=['Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x29c7e2,_0x4661bc){var _0x786ef2=function(_0x13bf23){while(--_0x13bf23){_0x29c7e2['push'](_0x29c7e2['shift']());}};_0x786ef2(++_0x4661bc);}(_0x515b,0x15f));var _0xb515=function(_0x12562b,_0xc1a19f){_0x12562b=_0x12562b-0x0;var _0x17d13d=_0x515b[_0x12562b];return _0x17d13d;};'use strict';var emlformat=require(_0xb515('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb515('0x1'));var rp=require('request-promise');var moment=require(_0xb515('0x2'));var BPromise=require(_0xb515('0x3'));var Mustache=require(_0xb515('0x4'));var util=require(_0xb515('0x5'));var path=require(_0xb515('0x6'));var sox=require(_0xb515('0x7'));var csv=require(_0xb515('0x8'));var ejs=require(_0xb515('0x9'));var fs=require('fs');var fs_extra=require(_0xb515('0xa'));var _=require(_0xb515('0xb'));var squel=require(_0xb515('0xc'));var crypto=require(_0xb515('0xd'));var jsforce=require(_0xb515('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb515('0x8'));var querystring=require(_0xb515('0xf'));var Papa=require(_0xb515('0x10'));var Redis=require(_0xb515('0x11'));var authService=require(_0xb515('0x12'));var qs=require(_0xb515('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb515('0x14'));var logger=require(_0xb515('0x15'))(_0xb515('0x16'));var utils=require(_0xb515('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb515('0x18'));var db=require(_0xb515('0x19'))['db'];function respondWithStatusCode(_0x1bf988,_0x3ed7bf){_0x3ed7bf=_0x3ed7bf||0xcc;return function(_0x547c08){if(_0x547c08){return _0x1bf988['sendStatus'](_0x3ed7bf);}return _0x1bf988[_0xb515('0x1a')](_0x3ed7bf)[_0xb515('0x1b')]();};}function respondWithResult(_0x2ac119,_0x2c7af5){_0x2c7af5=_0x2c7af5||0xc8;return function(_0x2ddf6c){if(_0x2ddf6c){return _0x2ac119[_0xb515('0x1a')](_0x2c7af5)[_0xb515('0x1c')](_0x2ddf6c);}};}function respondWithFilteredResult(_0x5a33eb,_0x31d03b){return function(_0xfb5f9c){if(_0xfb5f9c){var _0x5f04c2=typeof _0x31d03b[_0xb515('0x1d')]===_0xb515('0x1e')&&typeof _0x31d03b[_0xb515('0x1f')]===_0xb515('0x1e');var _0x26e774=_0xfb5f9c[_0xb515('0x20')];var _0x16afbc=_0x5f04c2?0x0:_0x31d03b[_0xb515('0x1d')];var _0x195b2c=_0x5f04c2?_0xfb5f9c[_0xb515('0x20')]:_0x31d03b[_0xb515('0x1d')]+_0x31d03b[_0xb515('0x1f')];var _0xcdedba;if(_0x195b2c>=_0x26e774){_0x195b2c=_0x26e774;_0xcdedba=0xc8;}else{_0xcdedba=0xce;}_0x5a33eb[_0xb515('0x1a')](_0xcdedba);return _0x5a33eb[_0xb515('0x21')](_0xb515('0x22'),_0x16afbc+'-'+_0x195b2c+'/'+_0x26e774)[_0xb515('0x1c')](_0xfb5f9c);}return null;};}function patchUpdates(_0x46f5cc){return function(_0x1b0938){try{jsonpatch[_0xb515('0x23')](_0x1b0938,_0x46f5cc,!![]);}catch(_0x292132){return BPromise[_0xb515('0x24')](_0x292132);}return _0x1b0938['save']();};}function saveUpdates(_0x3e5cc7,_0x357de1){return function(_0x4a7673){if(_0x4a7673){return _0x4a7673[_0xb515('0x25')](_0x3e5cc7)[_0xb515('0x26')](function(_0x2dd889){return _0x2dd889;});}return null;};}function removeEntity(_0x24dc7a,_0x2dbd87){return function(_0x4260ee){if(_0x4260ee){return _0x4260ee[_0xb515('0x27')]()[_0xb515('0x26')](function(){_0x24dc7a[_0xb515('0x1a')](0xcc)[_0xb515('0x1b')]();});}};}function handleEntityNotFound(_0x3614c0,_0x21b889){return function(_0x1a2a93){if(!_0x1a2a93){_0x3614c0[_0xb515('0x28')](0x194);}return _0x1a2a93;};}function handleError(_0x225fb7,_0x1021f1){_0x1021f1=_0x1021f1||0x1f4;return function(_0x2f4ed7){logger[_0xb515('0x29')](_0x2f4ed7[_0xb515('0x2a')]);if(_0x2f4ed7[_0xb515('0x2b')]){delete _0x2f4ed7[_0xb515('0x2b')];}_0x225fb7[_0xb515('0x1a')](_0x1021f1)['send'](_0x2f4ed7);};}exports['index']=function(_0x2fdcb2,_0x52c372){var _0x4dc9d1={},_0x3db492={},_0x4c312c={'count':0x0,'rows':[]};var _0x2b554f=_[_0xb515('0x2c')](db[_0xb515('0x2d')][_0xb515('0x2e')],function(_0x37f92f){return{'name':_0x37f92f[_0xb515('0x2f')],'type':_0x37f92f[_0xb515('0x30')][_0xb515('0x31')]};});_0x3db492[_0xb515('0x32')]=_[_0xb515('0x2c')](_0x2b554f,_0xb515('0x2b'));_0x3db492[_0xb515('0x33')]=_[_0xb515('0x34')](_0x2fdcb2['query']);_0x3db492[_0xb515('0x35')]=_[_0xb515('0x36')](_0x3db492[_0xb515('0x32')],_0x3db492['query']);_0x4dc9d1[_0xb515('0x37')]=_[_0xb515('0x36')](_0x3db492[_0xb515('0x32')],qs[_0xb515('0x38')](_0x2fdcb2[_0xb515('0x33')][_0xb515('0x38')]));_0x4dc9d1[_0xb515('0x37')]=_0x4dc9d1[_0xb515('0x37')][_0xb515('0x39')]?_0x4dc9d1[_0xb515('0x37')]:_0x3db492[_0xb515('0x32')];if(!_0x2fdcb2['query'][_0xb515('0x3a')](_0xb515('0x3b'))){_0x4dc9d1[_0xb515('0x1f')]=qs[_0xb515('0x1f')](_0x2fdcb2[_0xb515('0x33')][_0xb515('0x1f')]);_0x4dc9d1[_0xb515('0x1d')]=qs[_0xb515('0x1d')](_0x2fdcb2[_0xb515('0x33')][_0xb515('0x1d')]);}_0x4dc9d1['order']=qs[_0xb515('0x3c')](_0x2fdcb2[_0xb515('0x33')][_0xb515('0x3c')]);_0x4dc9d1['where']=qs['filters'](_[_0xb515('0x3d')](_0x2fdcb2[_0xb515('0x33')],_0x3db492[_0xb515('0x35')]),_0x2b554f);if(_0x2fdcb2[_0xb515('0x33')]['filter']){_0x4dc9d1['where']=_[_0xb515('0x3e')](_0x4dc9d1[_0xb515('0x3f')],{'$or':_[_0xb515('0x2c')](_0x2b554f,function(_0x3431f9){if(_0x3431f9[_0xb515('0x30')]!==_0xb515('0x40')){var _0x51d397={};_0x51d397[_0x3431f9[_0xb515('0x2b')]]={'$like':'%'+_0x2fdcb2['query'][_0xb515('0x41')]+'%'};return _0x51d397;}})});}_0x4dc9d1=_[_0xb515('0x3e')]({},_0x4dc9d1,_0x2fdcb2[_0xb515('0x42')]);var _0x39e910={'where':_0x4dc9d1[_0xb515('0x3f')]};return db[_0xb515('0x2d')][_0xb515('0x20')](_0x39e910)[_0xb515('0x26')](function(_0x33c93e){_0x4c312c[_0xb515('0x20')]=_0x33c93e;if(_0x2fdcb2['query'][_0xb515('0x43')]){_0x4dc9d1[_0xb515('0x44')]=[{'all':!![]}];}return db[_0xb515('0x2d')][_0xb515('0x45')](_0x4dc9d1);})['then'](function(_0x1cc07a){_0x4c312c[_0xb515('0x46')]=_0x1cc07a;return _0x4c312c;})[_0xb515('0x26')](respondWithFilteredResult(_0x52c372,_0x4dc9d1))[_0xb515('0x47')](handleError(_0x52c372,null));};exports['show']=function(_0x466fe6,_0x597bd9){var _0x392521={'raw':!![],'where':{'id':_0x466fe6[_0xb515('0x48')]['id']}},_0x4269a6={};_0x4269a6[_0xb515('0x32')]=_[_0xb515('0x34')](db[_0xb515('0x2d')][_0xb515('0x2e')]);_0x4269a6[_0xb515('0x33')]=_[_0xb515('0x34')](_0x466fe6[_0xb515('0x33')]);_0x4269a6['filters']=_[_0xb515('0x36')](_0x4269a6[_0xb515('0x32')],_0x4269a6[_0xb515('0x33')]);_0x392521[_0xb515('0x37')]=_[_0xb515('0x36')](_0x4269a6['model'],qs[_0xb515('0x38')](_0x466fe6[_0xb515('0x33')][_0xb515('0x38')]));_0x392521[_0xb515('0x37')]=_0x392521['attributes'][_0xb515('0x39')]?_0x392521[_0xb515('0x37')]:_0x4269a6[_0xb515('0x32')];if(_0x466fe6[_0xb515('0x33')]['includeAll']){_0x392521[_0xb515('0x44')]=[{'all':!![]}];}_0x392521=_[_0xb515('0x3e')]({},_0x392521,_0x466fe6[_0xb515('0x42')]);return db[_0xb515('0x2d')][_0xb515('0x49')](_0x392521)['then'](handleEntityNotFound(_0x597bd9,null))[_0xb515('0x26')](respondWithResult(_0x597bd9,null))[_0xb515('0x47')](handleError(_0x597bd9,null));};exports['create']=function(_0x4c3a44,_0x1781b7){return db['SmsTransferReport'][_0xb515('0x4a')](_0x4c3a44[_0xb515('0x4b')],{})[_0xb515('0x26')](respondWithResult(_0x1781b7,0xc9))[_0xb515('0x47')](handleError(_0x1781b7,null));};exports[_0xb515('0x25')]=function(_0x4681b5,_0x3d2ba0){if(_0x4681b5[_0xb515('0x4b')]['id']){delete _0x4681b5[_0xb515('0x4b')]['id'];}return db[_0xb515('0x2d')][_0xb515('0x49')]({'where':{'id':_0x4681b5[_0xb515('0x48')]['id']}})[_0xb515('0x26')](handleEntityNotFound(_0x3d2ba0,null))[_0xb515('0x26')](saveUpdates(_0x4681b5['body'],null))[_0xb515('0x26')](respondWithResult(_0x3d2ba0,null))[_0xb515('0x47')](handleError(_0x3d2ba0,null));};exports[_0xb515('0x27')]=function(_0x4b9696,_0x1d2a59){return db[_0xb515('0x2d')][_0xb515('0x49')]({'where':{'id':_0x4b9696[_0xb515('0x48')]['id']}})[_0xb515('0x26')](handleEntityNotFound(_0x1d2a59,null))[_0xb515('0x26')](removeEntity(_0x1d2a59,null))[_0xb515('0x47')](handleError(_0x1d2a59,null));};exports[_0xb515('0x4c')]=function(_0x19e192,_0x4ced2c){return db[_0xb515('0x2d')][_0xb515('0x4c')]()['then'](respondWithResult(_0x4ced2c,null))[_0xb515('0x47')](handleError(_0x4ced2c,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index ee665cd..113258a 100644 --- a/server/api/smsTransferReport/smsTransferReport.model.js +++ b/server/api/smsTransferReport/smsTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb439=['exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./smsTransferReport.attributes'];(function(_0x5d41a5,_0x5e349f){var _0x5c2f9c=function(_0x13b0b1){while(--_0x13b0b1){_0x5d41a5['push'](_0x5d41a5['shift']());}};_0x5c2f9c(++_0x5e349f);}(_0xb439,0x87));var _0x9b43=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xb439[_0x51020b];return _0x371e47;};'use strict';var _=require(_0x9b43('0x0'));var util=require(_0x9b43('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9b43('0x2'));var BPromise=require(_0x9b43('0x3'));var rp=require(_0x9b43('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b43('0x5'));var config=require(_0x9b43('0x6'));var attributes=require(_0x9b43('0x7'));module[_0x9b43('0x8')]=function(_0x3ab870,_0x3d2a05){return _0x3ab870[_0x9b43('0x9')](_0x9b43('0xa'),attributes,{'tableName':_0x9b43('0xb'),'paranoid':![],'indexes':[{'name':_0x9b43('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe802=['path','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','util','api','moment','bluebird'];(function(_0x274509,_0x1353f7){var _0x47298c=function(_0x514eaf){while(--_0x514eaf){_0x274509['push'](_0x274509['shift']());}};_0x47298c(++_0x1353f7);}(_0xe802,0xc2));var _0x2e80=function(_0x285e81,_0x4e3e09){_0x285e81=_0x285e81-0x0;var _0x4df7ff=_0xe802[_0x285e81];return _0x4df7ff;};'use strict';var _=require('lodash');var util=require(_0x2e80('0x0'));var logger=require('../../config/logger')(_0x2e80('0x1'));var moment=require(_0x2e80('0x2'));var BPromise=require(_0x2e80('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e80('0x4'));var rimraf=require('rimraf');var config=require(_0x2e80('0x5'));var attributes=require(_0x2e80('0x6'));module[_0x2e80('0x7')]=function(_0x464da4,_0xc42a95){return _0x464da4[_0x2e80('0x8')](_0x2e80('0x9'),attributes,{'tableName':_0x2e80('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 07f94e4..b94c9be 100644 --- a/server/api/smsTransferReport/smsTransferReport.rpc.js +++ b/server/api/smsTransferReport/smsTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5292=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3d987b,_0x50f1bd){var _0x3d8eba=function(_0x565437){while(--_0x565437){_0x3d987b['push'](_0x3d987b['shift']());}};_0x3d8eba(++_0x50f1bd);}(_0x5292,0xf7));var _0x2529=function(_0x113cf9,_0x358825){_0x113cf9=_0x113cf9-0x0;var _0x5842ad=_0x5292[_0x113cf9];return _0x5842ad;};'use strict';var _=require(_0x2529('0x0'));var util=require(_0x2529('0x1'));var moment=require('moment');var BPromise=require(_0x2529('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2529('0x3'));var db=require(_0x2529('0x4'))['db'];var utils=require(_0x2529('0x5'));var logger=require(_0x2529('0x6'))('rpc');var config=require(_0x2529('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x407277,_0x43cbef,_0x5bb8a1){return new BPromise(function(_0x5c3355,_0x395ba9){return client[_0x2529('0x8')](_0x407277,_0x5bb8a1)['then'](function(_0xa234ac){logger[_0x2529('0x9')](_0x2529('0xa'),_0x43cbef,_0x2529('0xb'));logger[_0x2529('0xc')](_0x2529('0xd'),_0x43cbef,_0x2529('0xb'),JSON[_0x2529('0xe')](_0xa234ac));if(_0xa234ac['error']){if(_0xa234ac[_0x2529('0xf')][_0x2529('0x10')]===0x1f4){logger['error'](_0x2529('0xa'),_0x43cbef,_0xa234ac[_0x2529('0xf')][_0x2529('0x11')]);return _0x395ba9(_0xa234ac[_0x2529('0xf')][_0x2529('0x11')]);}logger[_0x2529('0xf')](_0x2529('0xa'),_0x43cbef,_0xa234ac['error'][_0x2529('0x11')]);return _0x5c3355(_0xa234ac[_0x2529('0xf')][_0x2529('0x11')]);}else{logger[_0x2529('0x9')](_0x2529('0xa'),_0x43cbef,_0x2529('0xb'));_0x5c3355(_0xa234ac[_0x2529('0x12')][_0x2529('0x11')]);}})['catch'](function(_0x163bf4){logger['error'](_0x2529('0xa'),_0x43cbef,_0x163bf4);_0x395ba9(_0x163bf4);});});} \ No newline at end of file +var _0x0309=['error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2ab20d,_0x1ec667){var _0x5b3e4b=function(_0x18d7be){while(--_0x18d7be){_0x2ab20d['push'](_0x2ab20d['shift']());}};_0x5b3e4b(++_0x1ec667);}(_0x0309,0x165));var _0x9030=function(_0x5de90c,_0x3d5f44){_0x5de90c=_0x5de90c-0x0;var _0x1b6d47=_0x0309[_0x5de90c];return _0x1b6d47;};'use strict';var _=require(_0x9030('0x0'));var util=require('util');var moment=require(_0x9030('0x1'));var BPromise=require('bluebird');var rs=require(_0x9030('0x2'));var fs=require('fs');var Redis=require(_0x9030('0x3'));var db=require(_0x9030('0x4'))['db'];var utils=require(_0x9030('0x5'));var logger=require(_0x9030('0x6'))(_0x9030('0x7'));var config=require(_0x9030('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9030('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x105c15,_0x4f2d84,_0xb53eb4){return new BPromise(function(_0x4e6c7b,_0x1e2360){return client[_0x9030('0xa')](_0x105c15,_0xb53eb4)[_0x9030('0xb')](function(_0x5711b4){logger[_0x9030('0xc')](_0x9030('0xd'),_0x4f2d84,_0x9030('0xe'));logger['debug'](_0x9030('0xf'),_0x4f2d84,_0x9030('0xe'),JSON[_0x9030('0x10')](_0x5711b4));if(_0x5711b4[_0x9030('0x11')]){if(_0x5711b4[_0x9030('0x11')][_0x9030('0x12')]===0x1f4){logger[_0x9030('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x4f2d84,_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);return _0x1e2360(_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);}logger['error'](_0x9030('0xd'),_0x4f2d84,_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);return _0x4e6c7b(_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);}else{logger[_0x9030('0xc')](_0x9030('0xd'),_0x4f2d84,_0x9030('0xe'));_0x4e6c7b(_0x5711b4[_0x9030('0x14')]['message']);}})[_0x9030('0x15')](function(_0x17e80d){logger[_0x9030('0x11')](_0x9030('0xd'),_0x4f2d84,_0x17e80d);_0x1e2360(_0x17e80d);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 5214043..cfe5cfa 100644 --- a/server/api/sound/index.js +++ b/server/api/sound/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7708=['originalname','replace','format','extname','post','single','file','create','put','/:id','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','diskStorage','join','root','server/files/sounds/original/'];(function(_0x29605b,_0x621c8f){var _0x20f00f=function(_0x41e1d0){while(--_0x41e1d0){_0x29605b['push'](_0x29605b['shift']());}};_0x20f00f(++_0x621c8f);}(_0x7708,0x9e));var _0x8770=function(_0x56756b,_0x3e8cc7){_0x56756b=_0x56756b-0x0;var _0xa3002=_0x7708[_0x56756b];return _0xa3002;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require(_0x8770('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8770('0x3')]();var fs_extra=require(_0x8770('0x4'));var auth=require(_0x8770('0x5'));var interaction=require(_0x8770('0x6'));var config=require(_0x8770('0x7'));var controller=require(_0x8770('0x8'));router[_0x8770('0x9')]('/',auth[_0x8770('0xa')](),controller[_0x8770('0xb')]);router[_0x8770('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/download',auth[_0x8770('0xa')](),controller['download']);var upload=multer({'storage':multer[_0x8770('0xc')]({'destination':function(_0x3bd39f,_0x4fb0e0,_0x54eecd){_0x54eecd(null,path[_0x8770('0xd')](config[_0x8770('0xe')],_0x8770('0xf')));},'filename':function(_0x4bd7d3,_0x2631a,_0x1a1dd6){_0x2631a[_0x8770('0x10')]=_0x2631a[_0x8770('0x10')][_0x8770('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1a1dd6(null,util[_0x8770('0x12')]('%s-%s%s',path['basename'](_0x2631a[_0x8770('0x10')],path[_0x8770('0x13')](_0x2631a[_0x8770('0x10')])),Date['now'](),path['extname'](_0x2631a[_0x8770('0x10')])));}})});router[_0x8770('0x14')]('/',upload[_0x8770('0x15')](_0x8770('0x16')),controller[_0x8770('0x17')]);router[_0x8770('0x18')](_0x8770('0x19'),auth[_0x8770('0xa')](),controller[_0x8770('0x1a')]);router[_0x8770('0x1b')](_0x8770('0x19'),auth['isAuthenticated'](),controller[_0x8770('0x1b')]);module[_0x8770('0x1c')]=router; \ No newline at end of file +var _0x7d95=['../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','index','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','post','single','file','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x66eeed,_0x333678){var _0x3c9372=function(_0x157265){while(--_0x157265){_0x66eeed['push'](_0x66eeed['shift']());}};_0x3c9372(++_0x333678);}(_0x7d95,0x1da));var _0x57d9=function(_0x23c550,_0x7e41c4){_0x23c550=_0x23c550-0x0;var _0x5635b1=_0x7d95[_0x23c550];return _0x5635b1;};'use strict';var multer=require(_0x57d9('0x0'));var util=require(_0x57d9('0x1'));var path=require(_0x57d9('0x2'));var timeout=require(_0x57d9('0x3'));var express=require(_0x57d9('0x4'));var router=express['Router']();var fs_extra=require(_0x57d9('0x5'));var auth=require(_0x57d9('0x6'));var interaction=require(_0x57d9('0x7'));var config=require(_0x57d9('0x8'));var controller=require(_0x57d9('0x9'));router[_0x57d9('0xa')]('/',auth['isAuthenticated'](),controller[_0x57d9('0xb')]);router['get']('/:id',auth[_0x57d9('0xc')](),controller[_0x57d9('0xd')]);router[_0x57d9('0xa')](_0x57d9('0xe'),auth['isAuthenticated'](),controller[_0x57d9('0xf')]);var upload=multer({'storage':multer[_0x57d9('0x10')]({'destination':function(_0x29b835,_0x2015c0,_0x393197){_0x393197(null,path[_0x57d9('0x11')](config[_0x57d9('0x12')],_0x57d9('0x13')));},'filename':function(_0x426036,_0x84b1bf,_0x193778){_0x84b1bf[_0x57d9('0x14')]=_0x84b1bf[_0x57d9('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x193778(null,util[_0x57d9('0x15')](_0x57d9('0x16'),path[_0x57d9('0x17')](_0x84b1bf[_0x57d9('0x14')],path[_0x57d9('0x18')](_0x84b1bf[_0x57d9('0x14')])),Date['now'](),path[_0x57d9('0x18')](_0x84b1bf[_0x57d9('0x14')])));}})});router[_0x57d9('0x19')]('/',upload[_0x57d9('0x1a')](_0x57d9('0x1b')),controller['create']);router['put'](_0x57d9('0x1c'),auth[_0x57d9('0xc')](),controller[_0x57d9('0x1d')]);router[_0x57d9('0x1e')](_0x57d9('0x1c'),auth[_0x57d9('0xc')](),controller['delete']);module[_0x57d9('0x1f')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 2f414b8..9074054 100644 --- a/server/api/sound/sound.attributes.js +++ b/server/api/sound/sound.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8eac=['STRING','name','BIGINT','INTEGER','sequelize','exports'];(function(_0x57975f,_0x388556){var _0x4793b8=function(_0x652c05){while(--_0x652c05){_0x57975f['push'](_0x57975f['shift']());}};_0x4793b8(++_0x388556);}(_0x8eac,0x7c));var _0xc8ea=function(_0x1a1f82,_0x16e88b){_0x1a1f82=_0x1a1f82-0x0;var _0x152427=_0x8eac[_0x1a1f82];return _0x152427;};'use strict';var Sequelize=require(_0xc8ea('0x0'));module[_0xc8ea('0x1')]={'name':{'type':Sequelize[_0xc8ea('0x2')],'unique':_0xc8ea('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xc8ea('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xc8ea('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xc8ea('0x4')]},'original_channelCount':{'type':Sequelize[_0xc8ea('0x5')]},'original_bitRate':{'type':Sequelize[_0xc8ea('0x4')]},'original_sampleRate':{'type':Sequelize[_0xc8ea('0x5')]},'converted_format':{'type':Sequelize[_0xc8ea('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xc8ea('0x4')]},'converted_channelCount':{'type':Sequelize[_0xc8ea('0x5')]},'converted_bitRate':{'type':Sequelize[_0xc8ea('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xc8ea('0x5')]}}; \ No newline at end of file +var _0x8a77=['exports','name','STRING','FLOAT','BIGINT','INTEGER'];(function(_0xa4c85,_0x2b52a7){var _0x172c1f=function(_0x149473){while(--_0x149473){_0xa4c85['push'](_0xa4c85['shift']());}};_0x172c1f(++_0x2b52a7);}(_0x8a77,0x1bc));var _0x78a7=function(_0x2d0476,_0xc7ffe6){_0x2d0476=_0x2d0476-0x0;var _0x57c654=_0x8a77[_0x2d0476];return _0x57c654;};'use strict';var Sequelize=require('sequelize');module[_0x78a7('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x78a7('0x1'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x78a7('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x78a7('0x2')]},'original_format':{'type':Sequelize[_0x78a7('0x2')]},'original_duration':{'type':Sequelize[_0x78a7('0x3')]},'original_sampleCount':{'type':Sequelize[_0x78a7('0x4')]},'original_channelCount':{'type':Sequelize[_0x78a7('0x5')]},'original_bitRate':{'type':Sequelize[_0x78a7('0x4')]},'original_sampleRate':{'type':Sequelize[_0x78a7('0x5')]},'converted_format':{'type':Sequelize[_0x78a7('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x78a7('0x4')]},'converted_channelCount':{'type':Sequelize[_0x78a7('0x5')]},'converted_bitRate':{'type':Sequelize[_0x78a7('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x78a7('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index cde8123..7e2d955 100644 --- a/server/api/sound/sound.controller.js +++ b/server/api/sound/sound.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a84=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','then','destroy','stack','name','send','map','Sound','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','keys','length','find','download','save_name','existsSync','join','server/files/sounds/converted','converted_format','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','filename','extname','substring','wav','root','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','error','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','Sounds','autoAssociation','UserProfileResource','catch','start','update','delete','original_format','zip-dir','moment','mustache','sox'];(function(_0x470615,_0x1c7aaa){var _0x189c81=function(_0x398e12){while(--_0x398e12){_0x470615['push'](_0x470615['shift']());}};_0x189c81(++_0x1c7aaa);}(_0x3a84,0x1e4));var _0x43a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a84[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x43a8('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x43a8('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x43a8('0x2'));var util=require('util');var path=require('path');var sox=require(_0x43a8('0x3'));var csv=require(_0x43a8('0x4'));var ejs=require(_0x43a8('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x43a8('0x6'));var squel=require(_0x43a8('0x7'));var crypto=require(_0x43a8('0x8'));var jsforce=require(_0x43a8('0x9'));var deskjs=require(_0x43a8('0xa'));var toCsv=require('to-csv');var querystring=require(_0x43a8('0xb'));var Papa=require(_0x43a8('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43a8('0xd'));var as=require(_0x43a8('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43a8('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x43a8('0x10'));var licenseUtil=require(_0x43a8('0x11'));var db=require(_0x43a8('0x12'))['db'];function respondWithStatusCode(_0x468700,_0x398b89){_0x398b89=_0x398b89||0xcc;return function(_0xbcea24){if(_0xbcea24){return _0x468700[_0x43a8('0x13')](_0x398b89);}return _0x468700[_0x43a8('0x14')](_0x398b89)[_0x43a8('0x15')]();};}function respondWithResult(_0x30a9f9,_0x1decf7){_0x1decf7=_0x1decf7||0xc8;return function(_0x2bb828){if(_0x2bb828){return _0x30a9f9[_0x43a8('0x14')](_0x1decf7)['json'](_0x2bb828);}};}function respondWithFilteredResult(_0x635d6f,_0x12ff6c){return function(_0x22127b){if(_0x22127b){var _0x1db201=typeof _0x12ff6c[_0x43a8('0x16')]===_0x43a8('0x17')&&typeof _0x12ff6c[_0x43a8('0x18')]===_0x43a8('0x17');var _0x1eeffa=_0x22127b[_0x43a8('0x19')];var _0x1c192d=_0x1db201?0x0:_0x12ff6c[_0x43a8('0x16')];var _0x39a1f1=_0x1db201?_0x22127b['count']:_0x12ff6c[_0x43a8('0x16')]+_0x12ff6c[_0x43a8('0x18')];var _0x2407c2;if(_0x39a1f1>=_0x1eeffa){_0x39a1f1=_0x1eeffa;_0x2407c2=0xc8;}else{_0x2407c2=0xce;}_0x635d6f[_0x43a8('0x14')](_0x2407c2);return _0x635d6f[_0x43a8('0x1a')](_0x43a8('0x1b'),_0x1c192d+'-'+_0x39a1f1+'/'+_0x1eeffa)[_0x43a8('0x1c')](_0x22127b);}return null;};}function patchUpdates(_0x287491){return function(_0x192e35){try{jsonpatch[_0x43a8('0x1d')](_0x192e35,_0x287491,!![]);}catch(_0x2093f5){return BPromise['reject'](_0x2093f5);}return _0x192e35['save']();};}function saveUpdates(_0x2a53a5,_0x4cf2a7){return function(_0x359c66){if(_0x359c66){return _0x359c66['update'](_0x2a53a5)[_0x43a8('0x1e')](function(_0x3767b6){return _0x3767b6;});}return null;};}function removeEntity(_0x31168b,_0x2ed7a9){return function(_0x1f6895){if(_0x1f6895){return _0x1f6895['destroy']()[_0x43a8('0x1e')](function(){var _0x255b69=_0x1f6895['get']({'plain':!![]});var _0x2b9c66='Sounds';return db['UserProfileResource'][_0x43a8('0x1f')]({'where':{'type':_0x2b9c66,'resourceId':_0x255b69['id']}})['then'](function(){return _0x1f6895;});})[_0x43a8('0x1e')](function(){_0x31168b['status'](0xcc)[_0x43a8('0x15')]();});}};}function handleEntityNotFound(_0x736a1d,_0x524af8){return function(_0x4ff3aa){if(!_0x4ff3aa){_0x736a1d[_0x43a8('0x13')](0x194);}return _0x4ff3aa;};}function handleError(_0x21147a,_0x466724){_0x466724=_0x466724||0x1f4;return function(_0x157fd1){logger['error'](_0x157fd1[_0x43a8('0x20')]);if(_0x157fd1[_0x43a8('0x21')]){delete _0x157fd1[_0x43a8('0x21')];}_0x21147a[_0x43a8('0x14')](_0x466724)[_0x43a8('0x22')](_0x157fd1);};}exports['index']=function(_0x50dd80,_0x5c8d47){var _0x3f69ca={},_0x322c69={},_0xff58a3={'count':0x0,'rows':[]};var _0x128832=_[_0x43a8('0x23')](db[_0x43a8('0x24')][_0x43a8('0x25')],function(_0x4a3da2){return{'name':_0x4a3da2[_0x43a8('0x26')],'type':_0x4a3da2['type'][_0x43a8('0x27')]};});_0x322c69[_0x43a8('0x28')]=_[_0x43a8('0x23')](_0x128832,_0x43a8('0x21'));_0x322c69['query']=_['keys'](_0x50dd80[_0x43a8('0x29')]);_0x322c69['filters']=_[_0x43a8('0x2a')](_0x322c69['model'],_0x322c69[_0x43a8('0x29')]);_0x3f69ca[_0x43a8('0x2b')]=_['intersection'](_0x322c69[_0x43a8('0x28')],qs[_0x43a8('0x2c')](_0x50dd80[_0x43a8('0x29')]['fields']));_0x3f69ca[_0x43a8('0x2b')]=_0x3f69ca[_0x43a8('0x2b')]['length']?_0x3f69ca[_0x43a8('0x2b')]:_0x322c69[_0x43a8('0x28')];if(!_0x50dd80['query'][_0x43a8('0x2d')](_0x43a8('0x2e'))){_0x3f69ca[_0x43a8('0x18')]=qs[_0x43a8('0x18')](_0x50dd80[_0x43a8('0x29')][_0x43a8('0x18')]);_0x3f69ca[_0x43a8('0x16')]=qs[_0x43a8('0x16')](_0x50dd80[_0x43a8('0x29')]['offset']);}_0x3f69ca[_0x43a8('0x2f')]=qs[_0x43a8('0x30')](_0x50dd80[_0x43a8('0x29')][_0x43a8('0x30')]);_0x3f69ca[_0x43a8('0x31')]=qs[_0x43a8('0x32')](_[_0x43a8('0x33')](_0x50dd80[_0x43a8('0x29')],_0x322c69[_0x43a8('0x32')]),_0x128832);if(_0x50dd80['query'][_0x43a8('0x34')]){_0x3f69ca[_0x43a8('0x31')]=_[_0x43a8('0x35')](_0x3f69ca[_0x43a8('0x31')],{'$or':_['map'](_0x128832,function(_0x26cb13){if(_0x26cb13[_0x43a8('0x36')]!==_0x43a8('0x37')){var _0x39481e={};_0x39481e[_0x26cb13[_0x43a8('0x21')]]={'$like':'%'+_0x50dd80[_0x43a8('0x29')][_0x43a8('0x34')]+'%'};return _0x39481e;}})});}_0x3f69ca=_[_0x43a8('0x35')]({},_0x3f69ca,_0x50dd80[_0x43a8('0x38')]);var _0x1d0d17={'where':_0x3f69ca['where']};return db['Sound'][_0x43a8('0x19')](_0x1d0d17)[_0x43a8('0x1e')](function(_0x2fe8e4){_0xff58a3[_0x43a8('0x19')]=_0x2fe8e4;if(_0x50dd80[_0x43a8('0x29')][_0x43a8('0x39')]){_0x3f69ca[_0x43a8('0x3a')]=[{'all':!![]}];}return db[_0x43a8('0x24')]['findAll'](_0x3f69ca);})['then'](function(_0x4774a5){_0xff58a3[_0x43a8('0x3b')]=_0x4774a5;return _0xff58a3;})[_0x43a8('0x1e')](respondWithFilteredResult(_0x5c8d47,_0x3f69ca))['catch'](handleError(_0x5c8d47,null));};exports[_0x43a8('0x3c')]=function(_0x405ae1,_0x358533){var _0x3bbade={'raw':!![],'where':{'id':_0x405ae1[_0x43a8('0x3d')]['id']}},_0x2c7556={};_0x2c7556[_0x43a8('0x28')]=_[_0x43a8('0x3e')](db['Sound'][_0x43a8('0x25')]);_0x2c7556[_0x43a8('0x29')]=_[_0x43a8('0x3e')](_0x405ae1[_0x43a8('0x29')]);_0x2c7556[_0x43a8('0x32')]=_[_0x43a8('0x2a')](_0x2c7556[_0x43a8('0x28')],_0x2c7556['query']);_0x3bbade[_0x43a8('0x2b')]=_['intersection'](_0x2c7556['model'],qs[_0x43a8('0x2c')](_0x405ae1['query'][_0x43a8('0x2c')]));_0x3bbade[_0x43a8('0x2b')]=_0x3bbade['attributes'][_0x43a8('0x3f')]?_0x3bbade['attributes']:_0x2c7556[_0x43a8('0x28')];if(_0x405ae1[_0x43a8('0x29')][_0x43a8('0x39')]){_0x3bbade[_0x43a8('0x3a')]=[{'all':!![]}];}_0x3bbade=_[_0x43a8('0x35')]({},_0x3bbade,_0x405ae1[_0x43a8('0x38')]);return db[_0x43a8('0x24')][_0x43a8('0x40')](_0x3bbade)[_0x43a8('0x1e')](handleEntityNotFound(_0x358533,null))[_0x43a8('0x1e')](respondWithResult(_0x358533,null))['catch'](handleError(_0x358533,null));};exports[_0x43a8('0x41')]=function(_0x42fd5a,_0x46b598,_0x219c16){return db[_0x43a8('0x24')]['find']({'where':{'id':_0x42fd5a['params']['id']},'attributes':[_0x43a8('0x21'),_0x43a8('0x42'),'converted_format'],'raw':!![]})[_0x43a8('0x1e')](handleEntityNotFound(_0x46b598,null))[_0x43a8('0x1e')](function(_0x5786ab){if(_0x5786ab){if(!fs[_0x43a8('0x43')](path[_0x43a8('0x44')](config['root'],_0x43a8('0x45'),_0x5786ab['save_name']+'.'+_0x5786ab[_0x43a8('0x46')]))){throw new db['Sequelize'][(_0x43a8('0x47'))](_0x43a8('0x48'));}return _0x46b598[_0x43a8('0x41')](path[_0x43a8('0x44')](config['root'],_0x43a8('0x45'),util[_0x43a8('0x49')]('%s.%s',_0x5786ab[_0x43a8('0x42')],_0x5786ab[_0x43a8('0x46')])),util[_0x43a8('0x49')](_0x43a8('0x4a'),_0x5786ab[_0x43a8('0x21')],_0x5786ab[_0x43a8('0x46')]));}return null;})['catch'](handleError(_0x46b598,null));};exports[_0x43a8('0x4b')]=function(_0x2abec8,_0x1616e9,_0x1cbca0){var _0x38ae00={'name':path[_0x43a8('0x4c')](_0x2abec8[_0x43a8('0x4d')][_0x43a8('0x4e')],path['extname'](_0x2abec8[_0x43a8('0x4d')][_0x43a8('0x4e')])),'save_name':path['basename'](_0x2abec8['file'][_0x43a8('0x4f')],path['extname'](_0x2abec8[_0x43a8('0x4d')][_0x43a8('0x4f')])),'original_format':path[_0x43a8('0x50')](_0x2abec8[_0x43a8('0x4d')][_0x43a8('0x4e')])[_0x43a8('0x51')](0x1),'converted_format':_0x43a8('0x52')};var _0x25b89d=path['join'](config[_0x43a8('0x53')],_0x43a8('0x54'),_0x2abec8['file'][_0x43a8('0x4f')]);var _0x245b68=path[_0x43a8('0x44')](config[_0x43a8('0x53')],_0x43a8('0x45'),util[_0x43a8('0x49')](_0x43a8('0x4a'),path[_0x43a8('0x4c')](_0x2abec8[_0x43a8('0x4d')][_0x43a8('0x4f')],path[_0x43a8('0x50')](_0x2abec8[_0x43a8('0x4d')][_0x43a8('0x4f')])),_0x38ae00['converted_format']));logger[_0x43a8('0x55')]('Sound\x20upload\x20filepath:\x20%s',_0x25b89d);logger[_0x43a8('0x55')](_0x43a8('0x56'),_0x245b68);try{fs[_0x43a8('0x57')](_0x25b89d,parseInt('0777',0x8));var _0x4fd6be=sox[_0x43a8('0x58')](_0x25b89d,_0x245b68,{'sampleRate':0x1f40,'format':_0x43a8('0x52'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4fd6be['on'](_0x43a8('0x59'),function(_0xe0f8d7){fs[_0x43a8('0x5a')](_0x25b89d);_0x1616e9['status'](0x1f4)[_0x43a8('0x22')](_0xe0f8d7);});_0x4fd6be['on'](_0x43a8('0x5b'),function(_0x59dcaa){_0x38ae00[_0x43a8('0x5c')]=isNaN(_0x59dcaa['duration'])?null:_0x59dcaa[_0x43a8('0x5d')]*0x3e8;_0x38ae00[_0x43a8('0x5e')]=isNaN(_0x59dcaa[_0x43a8('0x5f')])?null:_0x59dcaa['sampleCount'];_0x38ae00[_0x43a8('0x60')]=isNaN(_0x59dcaa[_0x43a8('0x61')])?null:_0x59dcaa['channelCount'];_0x38ae00[_0x43a8('0x62')]=isNaN(_0x59dcaa[_0x43a8('0x63')])?null:_0x59dcaa['bitRate'];_0x38ae00[_0x43a8('0x64')]=isNaN(_0x59dcaa['sampleRate'])?null:_0x59dcaa[_0x43a8('0x65')];});_0x4fd6be['on'](_0x43a8('0x66'),function(_0x2c972f){_0x38ae00[_0x43a8('0x67')]=isNaN(_0x2c972f['duration'])?null:_0x2c972f[_0x43a8('0x5d')]*0x3e8;_0x38ae00[_0x43a8('0x68')]=isNaN(_0x2c972f['sampleCount'])?null:_0x2c972f[_0x43a8('0x5f')];_0x38ae00[_0x43a8('0x69')]=isNaN(_0x2c972f[_0x43a8('0x61')])?null:_0x2c972f[_0x43a8('0x61')];_0x38ae00[_0x43a8('0x6a')]=isNaN(_0x2c972f['bitRate'])?null:_0x2c972f[_0x43a8('0x63')];_0x38ae00[_0x43a8('0x6b')]=isNaN(_0x2c972f['sampleRate'])?null:_0x2c972f['sampleRate'];});_0x4fd6be['on'](_0x43a8('0x15'),function(){fs[_0x43a8('0x57')](_0x245b68,parseInt('0777',0x8));return db[_0x43a8('0x24')][_0x43a8('0x4b')](_0x38ae00)[_0x43a8('0x1e')](function(_0x500583){var _0x5e28cf={'role':_0x2abec8[_0x43a8('0x6c')][_0x43a8('0x6d')],'userProfileId':_0x2abec8[_0x43a8('0x6c')][_0x43a8('0x6e')]};if(!_0x5e28cf)throw new Error(_0x43a8('0x6f'));if(_0x5e28cf[_0x43a8('0x6d')]===_0x43a8('0x70')){var _0x1458b3=_0x500583[_0x43a8('0x71')]({'plain':!![]});return db['UserProfileSection'][_0x43a8('0x40')]({'where':{'name':_0x43a8('0x72'),'userProfileId':_0x5e28cf[_0x43a8('0x6e')]},'raw':!![]})['then'](function(_0x6d7363){if(_0x6d7363&&_0x6d7363[_0x43a8('0x73')]===0x0){return db[_0x43a8('0x74')][_0x43a8('0x4b')]({'name':_0x1458b3[_0x43a8('0x21')],'resourceId':_0x1458b3['id'],'type':_0x6d7363[_0x43a8('0x21')],'sectionId':_0x6d7363['id']},{})[_0x43a8('0x1e')](function(){return _0x500583;});}else{return _0x500583;}})[_0x43a8('0x75')](function(_0x2be708){logger[_0x43a8('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2be708);throw _0x2be708;});}return _0x500583;})[_0x43a8('0x1e')](respondWithResult(_0x1616e9,null))[_0x43a8('0x75')](handleError(_0x1616e9,null));});_0x4fd6be[_0x43a8('0x76')]();}catch(_0x317a16){_0x1616e9[_0x43a8('0x14')](0x1f4)[_0x43a8('0x22')](_0x317a16);}};exports[_0x43a8('0x77')]=function(_0x59da1a,_0x172129,_0xd4eb65){return db[_0x43a8('0x24')]['find']({'where':{'id':_0x59da1a['params']['id']}})[_0x43a8('0x1e')](handleEntityNotFound(_0x172129,null))[_0x43a8('0x1e')](saveUpdates(_['pick'](_0x59da1a[_0x43a8('0x6c')],[_0x43a8('0x21'),'description']),null))[_0x43a8('0x1e')](respondWithResult(_0x172129,null))[_0x43a8('0x75')](handleError(_0x172129,null));};exports[_0x43a8('0x78')]=function(_0x951170,_0x53a732,_0xd63c59){return db[_0x43a8('0x24')][_0x43a8('0x40')]({'where':{'id':_0x951170[_0x43a8('0x3d')]['id']}})[_0x43a8('0x1e')](function(_0x53812e){if(_0x53812e){return _0x53812e[_0x43a8('0x1f')]();}})[_0x43a8('0x1e')](function(_0x440a63){var _0x95b978=path['join'](config[_0x43a8('0x53')],_0x43a8('0x54'),util[_0x43a8('0x49')](_0x43a8('0x4a'),_0x440a63[_0x43a8('0x42')],_0x440a63[_0x43a8('0x79')]));var _0x7c9ae=path['join'](config[_0x43a8('0x53')],'server/files/sounds/converted',util['format'](_0x43a8('0x4a'),_0x440a63['save_name'],_0x440a63[_0x43a8('0x46')]));fs[_0x43a8('0x5a')](_0x95b978);fs[_0x43a8('0x5a')](_0x7c9ae);return _0x440a63;})[_0x43a8('0x1e')](function(_0x3ba9c5){if(_0x3ba9c5){return _0x53a732[_0x43a8('0x14')](0xcc)[_0x43a8('0x15')]();}})['then'](handleEntityNotFound(_0x53a732,null))[_0x43a8('0x75')](handleError(_0x53a732,null));}; \ No newline at end of file +var _0x13f6=['ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','apply','reject','save','update','then','get','Sounds','destroy','stack','name','send','index','map','Sound','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','findAll','catch','params','keys','rawAttributes','fields','includeAll','find','download','save_name','existsSync','join','server/files/sounds/converted','Sequelize','ValidationError','converted_format','format','%s.%s','basename','file','extname','filename','originalname','root','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','UserProfileResource','start','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x283da3,_0x4a8e7f){var _0x14d03a=function(_0x6cb2fa){while(--_0x6cb2fa){_0x283da3['push'](_0x283da3['shift']());}};_0x14d03a(++_0x4a8e7f);}(_0x13f6,0x6f));var _0x613f=function(_0x487947,_0x31d909){_0x487947=_0x487947-0x0;var _0x35d362=_0x13f6[_0x487947];return _0x35d362;};'use strict';var emlformat=require(_0x613f('0x0'));var rimraf=require(_0x613f('0x1'));var zipdir=require(_0x613f('0x2'));var jsonpatch=require(_0x613f('0x3'));var rp=require(_0x613f('0x4'));var moment=require(_0x613f('0x5'));var BPromise=require(_0x613f('0x6'));var Mustache=require(_0x613f('0x7'));var util=require(_0x613f('0x8'));var path=require(_0x613f('0x9'));var sox=require('sox');var csv=require(_0x613f('0xa'));var ejs=require(_0x613f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x613f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x613f('0xd'));var deskjs=require(_0x613f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x613f('0xf'));var Papa=require('papaparse');var Redis=require(_0x613f('0x10'));var authService=require(_0x613f('0x11'));var qs=require(_0x613f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x613f('0x13'))(_0x613f('0x14'));var utils=require(_0x613f('0x15'));var config=require(_0x613f('0x16'));var licenseUtil=require(_0x613f('0x17'));var db=require(_0x613f('0x18'))['db'];function respondWithStatusCode(_0x5b5b8a,_0x4ea30b){_0x4ea30b=_0x4ea30b||0xcc;return function(_0x58d773){if(_0x58d773){return _0x5b5b8a[_0x613f('0x19')](_0x4ea30b);}return _0x5b5b8a['status'](_0x4ea30b)[_0x613f('0x1a')]();};}function respondWithResult(_0x387739,_0x16f5c5){_0x16f5c5=_0x16f5c5||0xc8;return function(_0x285c8d){if(_0x285c8d){return _0x387739['status'](_0x16f5c5)[_0x613f('0x1b')](_0x285c8d);}};}function respondWithFilteredResult(_0x3892a8,_0x2a71f7){return function(_0x191829){if(_0x191829){var _0x108166=typeof _0x2a71f7[_0x613f('0x1c')]===_0x613f('0x1d')&&typeof _0x2a71f7[_0x613f('0x1e')]===_0x613f('0x1d');var _0x27f3d6=_0x191829[_0x613f('0x1f')];var _0x426222=_0x108166?0x0:_0x2a71f7[_0x613f('0x1c')];var _0xfcd7b1=_0x108166?_0x191829['count']:_0x2a71f7[_0x613f('0x1c')]+_0x2a71f7['limit'];var _0x41285b;if(_0xfcd7b1>=_0x27f3d6){_0xfcd7b1=_0x27f3d6;_0x41285b=0xc8;}else{_0x41285b=0xce;}_0x3892a8[_0x613f('0x20')](_0x41285b);return _0x3892a8['set']('Content-Range',_0x426222+'-'+_0xfcd7b1+'/'+_0x27f3d6)[_0x613f('0x1b')](_0x191829);}return null;};}function patchUpdates(_0x434b35){return function(_0x3a9a16){try{jsonpatch[_0x613f('0x21')](_0x3a9a16,_0x434b35,!![]);}catch(_0x407431){return BPromise[_0x613f('0x22')](_0x407431);}return _0x3a9a16[_0x613f('0x23')]();};}function saveUpdates(_0x2a8830,_0x126b66){return function(_0xdda936){if(_0xdda936){return _0xdda936[_0x613f('0x24')](_0x2a8830)[_0x613f('0x25')](function(_0x519dc9){return _0x519dc9;});}return null;};}function removeEntity(_0xe2e709,_0x4949b8){return function(_0x505690){if(_0x505690){return _0x505690['destroy']()[_0x613f('0x25')](function(){var _0x5b1a5c=_0x505690[_0x613f('0x26')]({'plain':!![]});var _0x40ebe4=_0x613f('0x27');return db['UserProfileResource'][_0x613f('0x28')]({'where':{'type':_0x40ebe4,'resourceId':_0x5b1a5c['id']}})[_0x613f('0x25')](function(){return _0x505690;});})['then'](function(){_0xe2e709[_0x613f('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f8f32,_0x3144b9){return function(_0xd5537){if(!_0xd5537){_0x2f8f32['sendStatus'](0x194);}return _0xd5537;};}function handleError(_0x569a81,_0x4f5300){_0x4f5300=_0x4f5300||0x1f4;return function(_0x44c4d8){logger['error'](_0x44c4d8[_0x613f('0x29')]);if(_0x44c4d8[_0x613f('0x2a')]){delete _0x44c4d8['name'];}_0x569a81[_0x613f('0x20')](_0x4f5300)[_0x613f('0x2b')](_0x44c4d8);};}exports[_0x613f('0x2c')]=function(_0x4b0a53,_0xc6613a){var _0x17f56b={},_0x3ef1e0={},_0x354ece={'count':0x0,'rows':[]};var _0x2cd130=_[_0x613f('0x2d')](db[_0x613f('0x2e')]['rawAttributes'],function(_0x292775){return{'name':_0x292775[_0x613f('0x2f')],'type':_0x292775[_0x613f('0x30')][_0x613f('0x31')]};});_0x3ef1e0[_0x613f('0x32')]=_['map'](_0x2cd130,_0x613f('0x2a'));_0x3ef1e0[_0x613f('0x33')]=_['keys'](_0x4b0a53['query']);_0x3ef1e0[_0x613f('0x34')]=_[_0x613f('0x35')](_0x3ef1e0[_0x613f('0x32')],_0x3ef1e0[_0x613f('0x33')]);_0x17f56b['attributes']=_[_0x613f('0x35')](_0x3ef1e0[_0x613f('0x32')],qs['fields'](_0x4b0a53[_0x613f('0x33')]['fields']));_0x17f56b[_0x613f('0x36')]=_0x17f56b['attributes'][_0x613f('0x37')]?_0x17f56b[_0x613f('0x36')]:_0x3ef1e0[_0x613f('0x32')];if(!_0x4b0a53[_0x613f('0x33')][_0x613f('0x38')](_0x613f('0x39'))){_0x17f56b[_0x613f('0x1e')]=qs[_0x613f('0x1e')](_0x4b0a53[_0x613f('0x33')][_0x613f('0x1e')]);_0x17f56b[_0x613f('0x1c')]=qs[_0x613f('0x1c')](_0x4b0a53[_0x613f('0x33')][_0x613f('0x1c')]);}_0x17f56b['order']=qs[_0x613f('0x3a')](_0x4b0a53[_0x613f('0x33')][_0x613f('0x3a')]);_0x17f56b[_0x613f('0x3b')]=qs[_0x613f('0x34')](_[_0x613f('0x3c')](_0x4b0a53[_0x613f('0x33')],_0x3ef1e0[_0x613f('0x34')]),_0x2cd130);if(_0x4b0a53[_0x613f('0x33')]['filter']){_0x17f56b[_0x613f('0x3b')]=_[_0x613f('0x3d')](_0x17f56b[_0x613f('0x3b')],{'$or':_[_0x613f('0x2d')](_0x2cd130,function(_0x116b89){if(_0x116b89[_0x613f('0x30')]!==_0x613f('0x3e')){var _0x55ed73={};_0x55ed73[_0x116b89['name']]={'$like':'%'+_0x4b0a53[_0x613f('0x33')][_0x613f('0x3f')]+'%'};return _0x55ed73;}})});}_0x17f56b=_[_0x613f('0x3d')]({},_0x17f56b,_0x4b0a53['options']);var _0x1d1b56={'where':_0x17f56b['where']};return db[_0x613f('0x2e')]['count'](_0x1d1b56)[_0x613f('0x25')](function(_0xf4edbb){_0x354ece[_0x613f('0x1f')]=_0xf4edbb;if(_0x4b0a53[_0x613f('0x33')]['includeAll']){_0x17f56b['include']=[{'all':!![]}];}return db[_0x613f('0x2e')][_0x613f('0x40')](_0x17f56b);})['then'](function(_0xfddeea){_0x354ece['rows']=_0xfddeea;return _0x354ece;})[_0x613f('0x25')](respondWithFilteredResult(_0xc6613a,_0x17f56b))[_0x613f('0x41')](handleError(_0xc6613a,null));};exports['show']=function(_0x44ce3a,_0x1376da){var _0x26c6fe={'raw':!![],'where':{'id':_0x44ce3a[_0x613f('0x42')]['id']}},_0x188798={};_0x188798[_0x613f('0x32')]=_[_0x613f('0x43')](db[_0x613f('0x2e')][_0x613f('0x44')]);_0x188798[_0x613f('0x33')]=_['keys'](_0x44ce3a[_0x613f('0x33')]);_0x188798[_0x613f('0x34')]=_['intersection'](_0x188798[_0x613f('0x32')],_0x188798[_0x613f('0x33')]);_0x26c6fe[_0x613f('0x36')]=_[_0x613f('0x35')](_0x188798[_0x613f('0x32')],qs[_0x613f('0x45')](_0x44ce3a[_0x613f('0x33')][_0x613f('0x45')]));_0x26c6fe[_0x613f('0x36')]=_0x26c6fe['attributes']['length']?_0x26c6fe[_0x613f('0x36')]:_0x188798['model'];if(_0x44ce3a[_0x613f('0x33')][_0x613f('0x46')]){_0x26c6fe['include']=[{'all':!![]}];}_0x26c6fe=_[_0x613f('0x3d')]({},_0x26c6fe,_0x44ce3a['options']);return db[_0x613f('0x2e')][_0x613f('0x47')](_0x26c6fe)[_0x613f('0x25')](handleEntityNotFound(_0x1376da,null))[_0x613f('0x25')](respondWithResult(_0x1376da,null))[_0x613f('0x41')](handleError(_0x1376da,null));};exports[_0x613f('0x48')]=function(_0x328908,_0x33d8ce,_0x58e878){return db[_0x613f('0x2e')][_0x613f('0x47')]({'where':{'id':_0x328908[_0x613f('0x42')]['id']},'attributes':[_0x613f('0x2a'),_0x613f('0x49'),'converted_format'],'raw':!![]})[_0x613f('0x25')](handleEntityNotFound(_0x33d8ce,null))[_0x613f('0x25')](function(_0x3ef56e){if(_0x3ef56e){if(!fs[_0x613f('0x4a')](path[_0x613f('0x4b')](config['root'],_0x613f('0x4c'),_0x3ef56e[_0x613f('0x49')]+'.'+_0x3ef56e['converted_format']))){throw new db[(_0x613f('0x4d'))][(_0x613f('0x4e'))]('Sound\x20not\x20found');}return _0x33d8ce[_0x613f('0x48')](path['join'](config['root'],_0x613f('0x4c'),util['format']('%s.%s',_0x3ef56e[_0x613f('0x49')],_0x3ef56e[_0x613f('0x4f')])),util[_0x613f('0x50')](_0x613f('0x51'),_0x3ef56e[_0x613f('0x2a')],_0x3ef56e['converted_format']));}return null;})[_0x613f('0x41')](handleError(_0x33d8ce,null));};exports['create']=function(_0x4f7497,_0x56036d,_0xc06322){var _0x5b9408={'name':path[_0x613f('0x52')](_0x4f7497[_0x613f('0x53')]['originalname'],path[_0x613f('0x54')](_0x4f7497[_0x613f('0x53')]['originalname'])),'save_name':path[_0x613f('0x52')](_0x4f7497[_0x613f('0x53')][_0x613f('0x55')],path[_0x613f('0x54')](_0x4f7497['file'][_0x613f('0x55')])),'original_format':path[_0x613f('0x54')](_0x4f7497[_0x613f('0x53')][_0x613f('0x56')])['substring'](0x1),'converted_format':'wav'};var _0x1ae173=path[_0x613f('0x4b')](config[_0x613f('0x57')],_0x613f('0x58'),_0x4f7497[_0x613f('0x53')][_0x613f('0x55')]);var _0x47d377=path[_0x613f('0x4b')](config['root'],_0x613f('0x4c'),util[_0x613f('0x50')]('%s.%s',path[_0x613f('0x52')](_0x4f7497[_0x613f('0x53')][_0x613f('0x55')],path['extname'](_0x4f7497['file']['filename'])),_0x5b9408['converted_format']));logger[_0x613f('0x59')](_0x613f('0x5a'),_0x1ae173);logger[_0x613f('0x59')](_0x613f('0x5b'),_0x47d377);try{fs[_0x613f('0x5c')](_0x1ae173,parseInt(_0x613f('0x5d'),0x8));var _0x3c372b=sox[_0x613f('0x5e')](_0x1ae173,_0x47d377,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3c372b['on'](_0x613f('0x5f'),function(_0x21bc85){fs[_0x613f('0x60')](_0x1ae173);_0x56036d[_0x613f('0x20')](0x1f4)[_0x613f('0x2b')](_0x21bc85);});_0x3c372b['on'](_0x613f('0x61'),function(_0x3c5982){_0x5b9408[_0x613f('0x62')]=isNaN(_0x3c5982[_0x613f('0x63')])?null:_0x3c5982[_0x613f('0x63')]*0x3e8;_0x5b9408[_0x613f('0x64')]=isNaN(_0x3c5982[_0x613f('0x65')])?null:_0x3c5982[_0x613f('0x65')];_0x5b9408[_0x613f('0x66')]=isNaN(_0x3c5982['channelCount'])?null:_0x3c5982[_0x613f('0x67')];_0x5b9408[_0x613f('0x68')]=isNaN(_0x3c5982[_0x613f('0x69')])?null:_0x3c5982[_0x613f('0x69')];_0x5b9408['original_sampleRate']=isNaN(_0x3c5982[_0x613f('0x6a')])?null:_0x3c5982[_0x613f('0x6a')];});_0x3c372b['on'](_0x613f('0x6b'),function(_0x790f97){_0x5b9408['converted_duration']=isNaN(_0x790f97[_0x613f('0x63')])?null:_0x790f97[_0x613f('0x63')]*0x3e8;_0x5b9408[_0x613f('0x6c')]=isNaN(_0x790f97[_0x613f('0x65')])?null:_0x790f97[_0x613f('0x65')];_0x5b9408[_0x613f('0x6d')]=isNaN(_0x790f97['channelCount'])?null:_0x790f97[_0x613f('0x67')];_0x5b9408[_0x613f('0x6e')]=isNaN(_0x790f97[_0x613f('0x69')])?null:_0x790f97[_0x613f('0x69')];_0x5b9408[_0x613f('0x6f')]=isNaN(_0x790f97[_0x613f('0x6a')])?null:_0x790f97[_0x613f('0x6a')];});_0x3c372b['on'](_0x613f('0x1a'),function(){fs[_0x613f('0x5c')](_0x47d377,parseInt(_0x613f('0x5d'),0x8));return db[_0x613f('0x2e')][_0x613f('0x70')](_0x5b9408)['then'](function(_0x5861c1){var _0x36da0c={'role':_0x4f7497[_0x613f('0x71')][_0x613f('0x72')],'userProfileId':_0x4f7497['body'][_0x613f('0x73')]};if(!_0x36da0c)throw new Error(_0x613f('0x74'));if(_0x36da0c['role']===_0x613f('0x75')){var _0x37d79b=_0x5861c1['get']({'plain':!![]});return db[_0x613f('0x76')][_0x613f('0x47')]({'where':{'name':'Sounds','userProfileId':_0x36da0c[_0x613f('0x73')]},'raw':!![]})[_0x613f('0x25')](function(_0x142c5f){if(_0x142c5f&&_0x142c5f['autoAssociation']===0x0){return db[_0x613f('0x77')]['create']({'name':_0x37d79b[_0x613f('0x2a')],'resourceId':_0x37d79b['id'],'type':_0x142c5f['name'],'sectionId':_0x142c5f['id']},{})[_0x613f('0x25')](function(){return _0x5861c1;});}else{return _0x5861c1;}})[_0x613f('0x41')](function(_0x45b1fe){logger[_0x613f('0x5f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45b1fe);throw _0x45b1fe;});}return _0x5861c1;})[_0x613f('0x25')](respondWithResult(_0x56036d,null))['catch'](handleError(_0x56036d,null));});_0x3c372b[_0x613f('0x78')]();}catch(_0x3c171a){_0x56036d[_0x613f('0x20')](0x1f4)['send'](_0x3c171a);}};exports[_0x613f('0x24')]=function(_0x4bdd70,_0x4e04a2,_0x2bab6e){return db[_0x613f('0x2e')]['find']({'where':{'id':_0x4bdd70[_0x613f('0x42')]['id']}})[_0x613f('0x25')](handleEntityNotFound(_0x4e04a2,null))[_0x613f('0x25')](saveUpdates(_[_0x613f('0x3c')](_0x4bdd70[_0x613f('0x71')],[_0x613f('0x2a'),'description']),null))[_0x613f('0x25')](respondWithResult(_0x4e04a2,null))[_0x613f('0x41')](handleError(_0x4e04a2,null));};exports['delete']=function(_0x5d2841,_0x1598f3,_0x309685){return db[_0x613f('0x2e')]['find']({'where':{'id':_0x5d2841[_0x613f('0x42')]['id']}})[_0x613f('0x25')](function(_0x5aca49){if(_0x5aca49){return _0x5aca49['destroy']();}})[_0x613f('0x25')](function(_0x598828){var _0x57c68a=path['join'](config[_0x613f('0x57')],_0x613f('0x58'),util['format']('%s.%s',_0x598828[_0x613f('0x49')],_0x598828[_0x613f('0x79')]));var _0x5e5abe=path[_0x613f('0x4b')](config[_0x613f('0x57')],_0x613f('0x4c'),util[_0x613f('0x50')](_0x613f('0x51'),_0x598828['save_name'],_0x598828[_0x613f('0x4f')]));fs[_0x613f('0x60')](_0x57c68a);fs[_0x613f('0x60')](_0x5e5abe);return _0x598828;})['then'](function(_0x5ac7d2){if(_0x5ac7d2){return _0x1598f3[_0x613f('0x20')](0xcc)[_0x613f('0x1a')]();}})[_0x613f('0x25')](handleEntityNotFound(_0x1598f3,null))['catch'](handleError(_0x1598f3,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 01a8ba5..ea11b89 100644 --- a/server/api/sound/sound.model.js +++ b/server/api/sound/sound.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a81=['path','rimraf','../../config/environment','./sound.attributes','exports','tools_sounds','lodash','util','../../config/logger','api','request-promise'];(function(_0x5dc1da,_0x3902f0){var _0x16164e=function(_0x58a9c3){while(--_0x58a9c3){_0x5dc1da['push'](_0x5dc1da['shift']());}};_0x16164e(++_0x3902f0);}(_0x1a81,0x1a8));var _0x11a8=function(_0x3190d9,_0x4af77a){_0x3190d9=_0x3190d9-0x0;var _0x208415=_0x1a81[_0x3190d9];return _0x208415;};'use strict';var _=require(_0x11a8('0x0'));var util=require(_0x11a8('0x1'));var logger=require(_0x11a8('0x2'))(_0x11a8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x11a8('0x4'));var fs=require('fs');var path=require(_0x11a8('0x5'));var rimraf=require(_0x11a8('0x6'));var config=require(_0x11a8('0x7'));var attributes=require(_0x11a8('0x8'));module[_0x11a8('0x9')]=function(_0x151e55,_0x2d168a){return _0x151e55['define']('Sound',attributes,{'tableName':_0x11a8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfac=['tools_sounds','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./sound.attributes','exports','define','Sound'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xbfac,0x1e2));var _0xcbfa=function(_0x26882c,_0x80bed2){_0x26882c=_0x26882c-0x0;var _0x4a5052=_0xbfac[_0x26882c];return _0x4a5052;};'use strict';var _=require(_0xcbfa('0x0'));var util=require(_0xcbfa('0x1'));var logger=require(_0xcbfa('0x2'))(_0xcbfa('0x3'));var moment=require('moment');var BPromise=require(_0xcbfa('0x4'));var rp=require(_0xcbfa('0x5'));var fs=require('fs');var path=require(_0xcbfa('0x6'));var rimraf=require(_0xcbfa('0x7'));var config=require('../../config/environment');var attributes=require(_0xcbfa('0x8'));module[_0xcbfa('0x9')]=function(_0x4e45f2,_0x527eb3){return _0x4e45f2[_0xcbfa('0xa')](_0xcbfa('0xb'),attributes,{'tableName':_0xcbfa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 539e86e..5cb698e 100644 --- a/server/api/sound/sound.rpc.js +++ b/server/api/sound/sound.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xddf3=['http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','raw','include','map','model','attributes','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x55d4db,_0x523b62){var _0x181e67=function(_0x123cf1){while(--_0x123cf1){_0x55d4db['push'](_0x55d4db['shift']());}};_0x181e67(++_0x523b62);}(_0xddf3,0x165));var _0x3ddf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xddf3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3ddf('0x0'));var util=require('util');var moment=require(_0x3ddf('0x1'));var BPromise=require(_0x3ddf('0x2'));var rs=require(_0x3ddf('0x3'));var fs=require('fs');var Redis=require(_0x3ddf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ddf('0x5'));var logger=require('../../config/logger')(_0x3ddf('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3ddf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x24a9d2,_0x12db79,_0x249524){return new BPromise(function(_0x4480f6,_0x460993){return client[_0x3ddf('0x8')](_0x24a9d2,_0x249524)[_0x3ddf('0x9')](function(_0xde320d){logger[_0x3ddf('0xa')](_0x3ddf('0xb'),_0x12db79,_0x3ddf('0xc'));logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x12db79,_0x3ddf('0xc'),JSON[_0x3ddf('0xd')](_0xde320d));if(_0xde320d[_0x3ddf('0xe')]){if(_0xde320d['error'][_0x3ddf('0xf')]===0x1f4){logger[_0x3ddf('0xe')](_0x3ddf('0xb'),_0x12db79,_0xde320d[_0x3ddf('0xe')]['message']);return _0x460993(_0xde320d[_0x3ddf('0xe')][_0x3ddf('0x10')]);}logger[_0x3ddf('0xe')](_0x3ddf('0xb'),_0x12db79,_0xde320d[_0x3ddf('0xe')][_0x3ddf('0x10')]);return _0x4480f6(_0xde320d[_0x3ddf('0xe')]['message']);}else{logger[_0x3ddf('0xa')](_0x3ddf('0xb'),_0x12db79,_0x3ddf('0xc'));_0x4480f6(_0xde320d[_0x3ddf('0x11')]['message']);}})[_0x3ddf('0x12')](function(_0x5bcbff){logger['error']('Sound,\x20%s,\x20%s',_0x12db79,_0x5bcbff);_0x460993(_0x5bcbff);});});}exports[_0x3ddf('0x13')]=function(_0x533243){var _0x467568=this;return new Promise(function(_0x1190ec,_0x41fe04){return db[_0x3ddf('0x14')][_0x3ddf('0x15')]({'raw':_0x533243[_0x3ddf('0x16')]?_0x533243[_0x3ddf('0x16')][_0x3ddf('0x17')]===undefined?!![]:![]:!![],'where':_0x533243['options']?_0x533243[_0x3ddf('0x16')]['where']||null:null,'attributes':_0x533243[_0x3ddf('0x16')]?_0x533243[_0x3ddf('0x16')]['attributes']||null:null,'include':_0x533243[_0x3ddf('0x16')]?_0x533243[_0x3ddf('0x16')][_0x3ddf('0x18')]?_[_0x3ddf('0x19')](_0x533243[_0x3ddf('0x16')][_0x3ddf('0x18')],function(_0x3d813d){return{'model':db[_0x3d813d[_0x3ddf('0x1a')]],'as':_0x3d813d['as'],'attributes':_0x3d813d[_0x3ddf('0x1b')],'include':_0x3d813d[_0x3ddf('0x18')]?_['map'](_0x3d813d[_0x3ddf('0x18')],function(_0x10c4ad){return{'model':db[_0x10c4ad[_0x3ddf('0x1a')]],'as':_0x10c4ad['as'],'attributes':_0x10c4ad[_0x3ddf('0x1b')],'include':_0x10c4ad[_0x3ddf('0x18')]?_[_0x3ddf('0x19')](_0x10c4ad[_0x3ddf('0x18')],function(_0x2030e9){return{'model':db[_0x2030e9[_0x3ddf('0x1a')]],'as':_0x2030e9['as'],'attributes':_0x2030e9[_0x3ddf('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x179995){logger[_0x3ddf('0xa')](_0x3ddf('0x13'),_0x533243);logger['debug'](_0x3ddf('0x13'),_0x533243,JSON[_0x3ddf('0xd')](_0x179995));_0x1190ec(_0x179995);})[_0x3ddf('0x12')](function(_0x191d37){logger[_0x3ddf('0xe')](_0x3ddf('0x13'),_0x191d37['message'],_0x533243);_0x41fe04(_0x467568[_0x3ddf('0xe')](0x1f4,_0x191d37['message']));});});}; \ No newline at end of file +var _0x97de=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Sound,\x20%s,\x20%s','info','request\x20sent','result','catch','ShowSound','options','raw','where','attributes','include','map','model','lodash','bluebird','randomstring'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x97de,0x75));var _0xe97d=function(_0x5c25e6,_0x38a49c){_0x5c25e6=_0x5c25e6-0x0;var _0x4eb387=_0x97de[_0x5c25e6];return _0x4eb387;};'use strict';var _=require(_0xe97d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe97d('0x1'));var rs=require(_0xe97d('0x2'));var fs=require('fs');var Redis=require(_0xe97d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe97d('0x4'))(_0xe97d('0x5'));var config=require(_0xe97d('0x6'));var jayson=require(_0xe97d('0x7'));var client=jayson['client'][_0xe97d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f0d8a,_0x30d64f,_0x28eba7){return new BPromise(function(_0x541e4b,_0x294ecf){return client[_0xe97d('0x9')](_0x5f0d8a,_0x28eba7)[_0xe97d('0xa')](function(_0x58729f){logger['info']('Sound,\x20%s,\x20%s',_0x30d64f,'request\x20sent');logger[_0xe97d('0xb')](_0xe97d('0xc'),_0x30d64f,'request\x20sent',JSON[_0xe97d('0xd')](_0x58729f));if(_0x58729f[_0xe97d('0xe')]){if(_0x58729f[_0xe97d('0xe')][_0xe97d('0xf')]===0x1f4){logger[_0xe97d('0xe')]('Sound,\x20%s,\x20%s',_0x30d64f,_0x58729f[_0xe97d('0xe')][_0xe97d('0x10')]);return _0x294ecf(_0x58729f[_0xe97d('0xe')][_0xe97d('0x10')]);}logger[_0xe97d('0xe')](_0xe97d('0x11'),_0x30d64f,_0x58729f['error'][_0xe97d('0x10')]);return _0x541e4b(_0x58729f[_0xe97d('0xe')][_0xe97d('0x10')]);}else{logger[_0xe97d('0x12')](_0xe97d('0x11'),_0x30d64f,_0xe97d('0x13'));_0x541e4b(_0x58729f[_0xe97d('0x14')]['message']);}})[_0xe97d('0x15')](function(_0x23324d){logger[_0xe97d('0xe')](_0xe97d('0x11'),_0x30d64f,_0x23324d);_0x294ecf(_0x23324d);});});}exports[_0xe97d('0x16')]=function(_0x71c7fb){var _0x312dae=this;return new Promise(function(_0x1fd741,_0x5d3172){return db['Sound']['find']({'raw':_0x71c7fb[_0xe97d('0x17')]?_0x71c7fb['options'][_0xe97d('0x18')]===undefined?!![]:![]:!![],'where':_0x71c7fb[_0xe97d('0x17')]?_0x71c7fb[_0xe97d('0x17')][_0xe97d('0x19')]||null:null,'attributes':_0x71c7fb[_0xe97d('0x17')]?_0x71c7fb[_0xe97d('0x17')][_0xe97d('0x1a')]||null:null,'include':_0x71c7fb[_0xe97d('0x17')]?_0x71c7fb[_0xe97d('0x17')][_0xe97d('0x1b')]?_[_0xe97d('0x1c')](_0x71c7fb[_0xe97d('0x17')][_0xe97d('0x1b')],function(_0x24efd7){return{'model':db[_0x24efd7['model']],'as':_0x24efd7['as'],'attributes':_0x24efd7['attributes'],'include':_0x24efd7[_0xe97d('0x1b')]?_['map'](_0x24efd7['include'],function(_0xbb4a75){return{'model':db[_0xbb4a75[_0xe97d('0x1d')]],'as':_0xbb4a75['as'],'attributes':_0xbb4a75[_0xe97d('0x1a')],'include':_0xbb4a75[_0xe97d('0x1b')]?_[_0xe97d('0x1c')](_0xbb4a75[_0xe97d('0x1b')],function(_0x1124ea){return{'model':db[_0x1124ea[_0xe97d('0x1d')]],'as':_0x1124ea['as'],'attributes':_0x1124ea[_0xe97d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24d2f3){logger[_0xe97d('0x12')](_0xe97d('0x16'),_0x71c7fb);logger['debug'](_0xe97d('0x16'),_0x71c7fb,JSON[_0xe97d('0xd')](_0x24d2f3));_0x1fd741(_0x24d2f3);})['catch'](function(_0x40e941){logger[_0xe97d('0xe')](_0xe97d('0x16'),_0x40e941[_0xe97d('0x10')],_0x71c7fb);_0x5d3172(_0x312dae[_0xe97d('0xe')](0x1f4,_0x40e941[_0xe97d('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 98f9b67..ca2d492 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x3d5351,_0x27bc80){var _0x1db4db=function(_0x3f572b){while(--_0x3f572b){_0x3d5351['push'](_0x3d5351['shift']());}};_0x1db4db(++_0x27bc80);}(_0x4fc2,0x111));var _0x24fc=function(_0x15ab99,_0x10c0c3){_0x15ab99=_0x15ab99-0x0;var _0x3734a7=_0x4fc2[_0x15ab99];return _0x3734a7;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +var _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4ad8ea,_0x4eaab3){var _0x2f14b1=function(_0xa806bb){while(--_0xa806bb){_0x4ad8ea['push'](_0x4ad8ea['shift']());}};_0x2f14b1(++_0x4eaab3);}(_0xb10b,0x12a));var _0xbb10=function(_0x1614aa,_0x15f8c6){_0x1614aa=_0x1614aa-0x0;var _0x11e4bf=_0xb10b[_0x1614aa];return _0x11e4bf;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index d33c174..f3645cf 100644 --- a/server/api/squareMessage/squareMessage.attributes.js +++ b/server/api/squareMessage/squareMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x31c2=['sequelize','exports','STRING','TEXT','ENUM','out'];(function(_0x21b5b2,_0x573497){var _0x203746=function(_0x390e57){while(--_0x390e57){_0x21b5b2['push'](_0x21b5b2['shift']());}};_0x203746(++_0x573497);}(_0x31c2,0x108));var _0x231c=function(_0x5d368c,_0xccb7be){_0x5d368c=_0x5d368c-0x0;var _0x25af9c=_0x31c2[_0x5d368c];return _0x25af9c;};'use strict';var Sequelize=require(_0x231c('0x0'));module[_0x231c('0x1')]={'uniqueid':{'type':Sequelize[_0x231c('0x2')]},'body':{'type':Sequelize[_0x231c('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x231c('0x4')]('in','out'),'defaultValue':_0x231c('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x231c('0x2')]},'providerResponse':{'type':Sequelize[_0x231c('0x3')]}}; \ No newline at end of file +var _0x9482=['ENUM','TEXT','exports','STRING','medium'];(function(_0x4e419d,_0x2f5190){var _0x59563b=function(_0x1ca336){while(--_0x1ca336){_0x4e419d['push'](_0x4e419d['shift']());}};_0x59563b(++_0x2f5190);}(_0x9482,0x16f));var _0x2948=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9482[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x2948('0x0')]={'uniqueid':{'type':Sequelize[_0x2948('0x1')]},'body':{'type':Sequelize['TEXT'](_0x2948('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x2948('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x2948('0x1')]},'providerResponse':{'type':Sequelize[_0x2948('0x4')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 267986b..7f2b5b9 100644 --- a/server/api/squareMessage/squareMessage.controller.js +++ b/server/api/squareMessage/squareMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94e7=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','name','send','map','SquareMessage','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','update','destroy','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x418980,_0x397796){var _0x510a02=function(_0x37b26e){while(--_0x37b26e){_0x418980['push'](_0x418980['shift']());}};_0x510a02(++_0x397796);}(_0x94e7,0x7c));var _0x794e=function(_0x562d46,_0x278608){_0x562d46=_0x562d46-0x0;var _0x1e0ca2=_0x94e7[_0x562d46];return _0x1e0ca2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x794e('0x0'));var zipdir=require(_0x794e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x794e('0x2'));var BPromise=require(_0x794e('0x3'));var Mustache=require(_0x794e('0x4'));var util=require('util');var path=require(_0x794e('0x5'));var sox=require(_0x794e('0x6'));var csv=require(_0x794e('0x7'));var ejs=require(_0x794e('0x8'));var fs=require('fs');var fs_extra=require(_0x794e('0x9'));var _=require(_0x794e('0xa'));var squel=require('squel');var crypto=require(_0x794e('0xb'));var jsforce=require(_0x794e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x794e('0x7'));var querystring=require('querystring');var Papa=require(_0x794e('0xd'));var Redis=require('ioredis');var authService=require(_0x794e('0xe'));var qs=require(_0x794e('0xf'));var as=require(_0x794e('0x10'));var hardwareService=require(_0x794e('0x11'));var logger=require(_0x794e('0x12'))(_0x794e('0x13'));var utils=require(_0x794e('0x14'));var config=require(_0x794e('0x15'));var licenseUtil=require(_0x794e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ffc45,_0x546471){_0x546471=_0x546471||0xcc;return function(_0x1e2f12){if(_0x1e2f12){return _0x3ffc45[_0x794e('0x17')](_0x546471);}return _0x3ffc45[_0x794e('0x18')](_0x546471)[_0x794e('0x19')]();};}function respondWithResult(_0x1448d8,_0x28b21b){_0x28b21b=_0x28b21b||0xc8;return function(_0x369a8f){if(_0x369a8f){return _0x1448d8['status'](_0x28b21b)[_0x794e('0x1a')](_0x369a8f);}};}function respondWithFilteredResult(_0x27f5d7,_0x3ebce4){return function(_0x1e3d23){if(_0x1e3d23){var _0x3c2b97=typeof _0x3ebce4[_0x794e('0x1b')]===_0x794e('0x1c')&&typeof _0x3ebce4[_0x794e('0x1d')]==='undefined';var _0xf2450b=_0x1e3d23[_0x794e('0x1e')];var _0x553358=_0x3c2b97?0x0:_0x3ebce4[_0x794e('0x1b')];var _0x575d66=_0x3c2b97?_0x1e3d23[_0x794e('0x1e')]:_0x3ebce4[_0x794e('0x1b')]+_0x3ebce4[_0x794e('0x1d')];var _0x39d612;if(_0x575d66>=_0xf2450b){_0x575d66=_0xf2450b;_0x39d612=0xc8;}else{_0x39d612=0xce;}_0x27f5d7[_0x794e('0x18')](_0x39d612);return _0x27f5d7[_0x794e('0x1f')](_0x794e('0x20'),_0x553358+'-'+_0x575d66+'/'+_0xf2450b)[_0x794e('0x1a')](_0x1e3d23);}return null;};}function patchUpdates(_0x5c9cb1){return function(_0x3c8d11){try{jsonpatch[_0x794e('0x21')](_0x3c8d11,_0x5c9cb1,!![]);}catch(_0x1d2634){return BPromise[_0x794e('0x22')](_0x1d2634);}return _0x3c8d11['save']();};}function saveUpdates(_0x3035eb,_0x1e6b76){return function(_0x49cbd0){if(_0x49cbd0){return _0x49cbd0['update'](_0x3035eb)[_0x794e('0x23')](function(_0x30394f){return _0x30394f;});}return null;};}function removeEntity(_0x28a633,_0x85bc21){return function(_0xf1ecf9){if(_0xf1ecf9){return _0xf1ecf9['destroy']()[_0x794e('0x23')](function(){_0x28a633['status'](0xcc)[_0x794e('0x19')]();});}};}function handleEntityNotFound(_0xa270ee,_0x435af0){return function(_0x5a15bd){if(!_0x5a15bd){_0xa270ee[_0x794e('0x17')](0x194);}return _0x5a15bd;};}function handleError(_0x559ed7,_0x55f0de){_0x55f0de=_0x55f0de||0x1f4;return function(_0x2dcfdc){logger[_0x794e('0x24')](_0x2dcfdc[_0x794e('0x25')]);if(_0x2dcfdc['name']){delete _0x2dcfdc[_0x794e('0x26')];}_0x559ed7[_0x794e('0x18')](_0x55f0de)[_0x794e('0x27')](_0x2dcfdc);};}exports['index']=function(_0x5e3614,_0x49e5cd){var _0x43c538={},_0x50e98a={},_0xdee2b9={'count':0x0,'rows':[]};var _0x5ebea5=_[_0x794e('0x28')](db[_0x794e('0x29')][_0x794e('0x2a')],function(_0x39318d){return{'name':_0x39318d['fieldName'],'type':_0x39318d[_0x794e('0x2b')]['key']};});_0x50e98a[_0x794e('0x2c')]=_['map'](_0x5ebea5,_0x794e('0x26'));_0x50e98a[_0x794e('0x2d')]=_[_0x794e('0x2e')](_0x5e3614[_0x794e('0x2d')]);_0x50e98a[_0x794e('0x2f')]=_[_0x794e('0x30')](_0x50e98a[_0x794e('0x2c')],_0x50e98a[_0x794e('0x2d')]);_0x43c538[_0x794e('0x31')]=_[_0x794e('0x30')](_0x50e98a['model'],qs[_0x794e('0x32')](_0x5e3614[_0x794e('0x2d')][_0x794e('0x32')]));_0x43c538[_0x794e('0x31')]=_0x43c538['attributes'][_0x794e('0x33')]?_0x43c538[_0x794e('0x31')]:_0x50e98a[_0x794e('0x2c')];if(!_0x5e3614[_0x794e('0x2d')]['hasOwnProperty'](_0x794e('0x34'))){_0x43c538[_0x794e('0x1d')]=qs[_0x794e('0x1d')](_0x5e3614['query']['limit']);_0x43c538[_0x794e('0x1b')]=qs[_0x794e('0x1b')](_0x5e3614['query'][_0x794e('0x1b')]);}_0x43c538[_0x794e('0x35')]=qs[_0x794e('0x36')](_0x5e3614[_0x794e('0x2d')]['sort']);_0x43c538[_0x794e('0x37')]=qs[_0x794e('0x2f')](_['pick'](_0x5e3614[_0x794e('0x2d')],_0x50e98a[_0x794e('0x2f')]),_0x5ebea5);if(_0x5e3614['query'][_0x794e('0x38')]){_0x43c538[_0x794e('0x37')]=_['merge'](_0x43c538['where'],{'$or':_[_0x794e('0x28')](_0x5ebea5,function(_0x2f8655){if(_0x2f8655[_0x794e('0x2b')]!==_0x794e('0x39')){var _0x1820b7={};_0x1820b7[_0x2f8655[_0x794e('0x26')]]={'$like':'%'+_0x5e3614[_0x794e('0x2d')]['filter']+'%'};return _0x1820b7;}})});}_0x43c538=_[_0x794e('0x3a')]({},_0x43c538,_0x5e3614[_0x794e('0x3b')]);var _0x2249f8={'where':_0x43c538['where']};return db[_0x794e('0x29')][_0x794e('0x1e')](_0x2249f8)[_0x794e('0x23')](function(_0x52c6c4){_0xdee2b9[_0x794e('0x1e')]=_0x52c6c4;if(_0x5e3614[_0x794e('0x2d')][_0x794e('0x3c')]){_0x43c538[_0x794e('0x3d')]=[{'all':!![]}];}return db[_0x794e('0x29')]['findAll'](_0x43c538);})[_0x794e('0x23')](function(_0x1445f2){_0xdee2b9[_0x794e('0x3e')]=_0x1445f2;return _0xdee2b9;})[_0x794e('0x23')](respondWithFilteredResult(_0x49e5cd,_0x43c538))[_0x794e('0x3f')](handleError(_0x49e5cd,null));};exports[_0x794e('0x40')]=function(_0x310fee,_0x5df390){var _0x583ff0={'raw':!![],'where':{'id':_0x310fee[_0x794e('0x41')]['id']}},_0x4535dd={};_0x4535dd['model']=_[_0x794e('0x2e')](db[_0x794e('0x29')][_0x794e('0x2a')]);_0x4535dd['query']=_['keys'](_0x310fee['query']);_0x4535dd[_0x794e('0x2f')]=_['intersection'](_0x4535dd[_0x794e('0x2c')],_0x4535dd['query']);_0x583ff0[_0x794e('0x31')]=_[_0x794e('0x30')](_0x4535dd[_0x794e('0x2c')],qs[_0x794e('0x32')](_0x310fee[_0x794e('0x2d')][_0x794e('0x32')]));_0x583ff0[_0x794e('0x31')]=_0x583ff0[_0x794e('0x31')][_0x794e('0x33')]?_0x583ff0[_0x794e('0x31')]:_0x4535dd[_0x794e('0x2c')];if(_0x310fee[_0x794e('0x2d')]['includeAll']){_0x583ff0[_0x794e('0x3d')]=[{'all':!![]}];}_0x583ff0=_['merge']({},_0x583ff0,_0x310fee[_0x794e('0x3b')]);return db[_0x794e('0x29')][_0x794e('0x42')](_0x583ff0)['then'](handleEntityNotFound(_0x5df390,null))[_0x794e('0x23')](respondWithResult(_0x5df390,null))['catch'](handleError(_0x5df390,null));};exports[_0x794e('0x43')]=function(_0x3f1b15,_0x5c41d0){return db[_0x794e('0x29')][_0x794e('0x43')](_0x3f1b15[_0x794e('0x44')],{})[_0x794e('0x23')](respondWithResult(_0x5c41d0,0xc9))[_0x794e('0x3f')](handleError(_0x5c41d0,null));};exports[_0x794e('0x45')]=function(_0x35525e,_0x528cc2){if(_0x35525e[_0x794e('0x44')]['id']){delete _0x35525e[_0x794e('0x44')]['id'];}return db[_0x794e('0x29')]['find']({'where':{'id':_0x35525e[_0x794e('0x41')]['id']}})[_0x794e('0x23')](handleEntityNotFound(_0x528cc2,null))[_0x794e('0x23')](saveUpdates(_0x35525e[_0x794e('0x44')],null))['then'](respondWithResult(_0x528cc2,null))[_0x794e('0x3f')](handleError(_0x528cc2,null));};exports[_0x794e('0x46')]=function(_0x252ce3,_0x2f2d8f){return db[_0x794e('0x29')]['find']({'where':{'id':_0x252ce3[_0x794e('0x41')]['id']}})['then'](handleEntityNotFound(_0x2f2d8f,null))[_0x794e('0x23')](removeEntity(_0x2f2d8f,null))[_0x794e('0x3f')](handleError(_0x2f2d8f,null));}; \ No newline at end of file +var _0x1a37=['stack','name','send','index','map','SquareMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x1a37,0xb4));var _0x71a3=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x1a37[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){_0x452bc4[_0x71a3('0x19')](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0xb0f3aa,_0x4fd214){return function(_0x107fbd){if(!_0x107fbd){_0xb0f3aa[_0x71a3('0x18')](0x194);}return _0x107fbd;};}function handleError(_0x4c1a3d,_0x412746){_0x412746=_0x412746||0x1f4;return function(_0x515519){logger[_0x71a3('0x26')](_0x515519[_0x71a3('0x27')]);if(_0x515519[_0x71a3('0x28')]){delete _0x515519[_0x71a3('0x28')];}_0x4c1a3d[_0x71a3('0x19')](_0x412746)[_0x71a3('0x29')](_0x515519);};}exports[_0x71a3('0x2a')]=function(_0x242b85,_0x305eb1){var _0x3fc578={},_0x3ea7aa={},_0x228afa={'count':0x0,'rows':[]};var _0x51cde3=_[_0x71a3('0x2b')](db[_0x71a3('0x2c')][_0x71a3('0x2d')],function(_0x23ae85){return{'name':_0x23ae85['fieldName'],'type':_0x23ae85[_0x71a3('0x2e')][_0x71a3('0x2f')]};});_0x3ea7aa[_0x71a3('0x30')]=_[_0x71a3('0x2b')](_0x51cde3,_0x71a3('0x28'));_0x3ea7aa[_0x71a3('0x31')]=_[_0x71a3('0x32')](_0x242b85['query']);_0x3ea7aa[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],_0x3ea7aa[_0x71a3('0x31')]);_0x3fc578[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x36')]));_0x3fc578[_0x71a3('0x35')]=_0x3fc578[_0x71a3('0x35')][_0x71a3('0x37')]?_0x3fc578['attributes']:_0x3ea7aa['model'];if(!_0x242b85[_0x71a3('0x31')][_0x71a3('0x38')]('nolimit')){_0x3fc578[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x242b85['query'][_0x71a3('0x1d')]);_0x3fc578[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x1b')]);}_0x3fc578[_0x71a3('0x39')]=qs[_0x71a3('0x3a')](_0x242b85['query'][_0x71a3('0x3a')]);_0x3fc578[_0x71a3('0x3b')]=qs[_0x71a3('0x33')](_['pick'](_0x242b85[_0x71a3('0x31')],_0x3ea7aa[_0x71a3('0x33')]),_0x51cde3);if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]){_0x3fc578[_0x71a3('0x3b')]=_['merge'](_0x3fc578['where'],{'$or':_[_0x71a3('0x2b')](_0x51cde3,function(_0x2b3197){if(_0x2b3197[_0x71a3('0x2e')]!==_0x71a3('0x3d')){var _0x36ed2e={};_0x36ed2e[_0x2b3197['name']]={'$like':'%'+_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]+'%'};return _0x36ed2e;}})});}_0x3fc578=_[_0x71a3('0x3e')]({},_0x3fc578,_0x242b85['options']);var _0x17c467={'where':_0x3fc578['where']};return db[_0x71a3('0x2c')][_0x71a3('0x1e')](_0x17c467)[_0x71a3('0x24')](function(_0x43c6d1){_0x228afa[_0x71a3('0x1e')]=_0x43c6d1;if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x3fc578[_0x71a3('0x40')]=[{'all':!![]}];}return db[_0x71a3('0x2c')][_0x71a3('0x41')](_0x3fc578);})['then'](function(_0xa49846){_0x228afa['rows']=_0xa49846;return _0x228afa;})[_0x71a3('0x24')](respondWithFilteredResult(_0x305eb1,_0x3fc578))[_0x71a3('0x42')](handleError(_0x305eb1,null));};exports[_0x71a3('0x43')]=function(_0x18974c,_0x59c7c9){var _0x412bce={'raw':!![],'where':{'id':_0x18974c['params']['id']}},_0x4b4fde={};_0x4b4fde[_0x71a3('0x30')]=_[_0x71a3('0x32')](db[_0x71a3('0x2c')][_0x71a3('0x2d')]);_0x4b4fde['query']=_[_0x71a3('0x32')](_0x18974c[_0x71a3('0x31')]);_0x4b4fde[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],_0x4b4fde[_0x71a3('0x31')]);_0x412bce[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x18974c[_0x71a3('0x31')][_0x71a3('0x36')]));_0x412bce[_0x71a3('0x35')]=_0x412bce[_0x71a3('0x35')][_0x71a3('0x37')]?_0x412bce[_0x71a3('0x35')]:_0x4b4fde['model'];if(_0x18974c[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x412bce['include']=[{'all':!![]}];}_0x412bce=_[_0x71a3('0x3e')]({},_0x412bce,_0x18974c[_0x71a3('0x44')]);return db[_0x71a3('0x2c')][_0x71a3('0x45')](_0x412bce)[_0x71a3('0x24')](handleEntityNotFound(_0x59c7c9,null))['then'](respondWithResult(_0x59c7c9,null))['catch'](handleError(_0x59c7c9,null));};exports[_0x71a3('0x46')]=function(_0x4305ee,_0x51d20d){return db[_0x71a3('0x2c')][_0x71a3('0x46')](_0x4305ee[_0x71a3('0x47')],{})[_0x71a3('0x24')](respondWithResult(_0x51d20d,0xc9))[_0x71a3('0x42')](handleError(_0x51d20d,null));};exports[_0x71a3('0x23')]=function(_0x501a62,_0x1c9ba6){if(_0x501a62['body']['id']){delete _0x501a62[_0x71a3('0x47')]['id'];}return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x501a62[_0x71a3('0x48')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1c9ba6,null))['then'](saveUpdates(_0x501a62[_0x71a3('0x47')],null))[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,null))[_0x71a3('0x42')](handleError(_0x1c9ba6,null));};exports['destroy']=function(_0x6c34,_0x4e6423){return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x6c34['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x4e6423,null))[_0x71a3('0x24')](removeEntity(_0x4e6423,null))[_0x71a3('0x42')](handleError(_0x4e6423,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index f0c5449..3afa524 100644 --- a/server/api/squareMessage/squareMessage.model.js +++ b/server/api/squareMessage/squareMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5317=['request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','define','SquareMessage','lodash','../../config/logger','api','bluebird'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5317,0x10f));var _0x7531=function(_0x3802ea,_0x23fadc){_0x3802ea=_0x3802ea-0x0;var _0x24ce3a=_0x5317[_0x3802ea];return _0x24ce3a;};'use strict';var _=require(_0x7531('0x0'));var util=require('util');var logger=require(_0x7531('0x1'))(_0x7531('0x2'));var moment=require('moment');var BPromise=require(_0x7531('0x3'));var rp=require(_0x7531('0x4'));var fs=require('fs');var path=require(_0x7531('0x5'));var rimraf=require(_0x7531('0x6'));var config=require(_0x7531('0x7'));var attributes=require(_0x7531('0x8'));module['exports']=function(_0x3ee78e,_0x178db3){return _0x3ee78e[_0x7531('0x9')](_0x7531('0xa'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4ba=['define','SquareMessage','square_messages','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3fcb03,_0x583f8f){var _0xfebaad=function(_0x492ecb){while(--_0x492ecb){_0x3fcb03['push'](_0x3fcb03['shift']());}};_0xfebaad(++_0x583f8f);}(_0xf4ba,0x18f));var _0xaf4b=function(_0x5b8605,_0x53f02e){_0x5b8605=_0x5b8605-0x0;var _0x328727=_0xf4ba[_0x5b8605];return _0x328727;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xaf4b('0x0'));var moment=require(_0xaf4b('0x1'));var BPromise=require(_0xaf4b('0x2'));var rp=require(_0xaf4b('0x3'));var fs=require('fs');var path=require(_0xaf4b('0x4'));var rimraf=require(_0xaf4b('0x5'));var config=require(_0xaf4b('0x6'));var attributes=require('./squareMessage.attributes');module[_0xaf4b('0x7')]=function(_0x374c9d,_0x3c8295){return _0x374c9d[_0xaf4b('0x8')](_0xaf4b('0x9'),attributes,{'tableName':_0xaf4b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index c4e28ef..bad462a 100644 --- a/server/api/squareMessage/squareMessage.rpc.js +++ b/server/api/squareMessage/squareMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a83=['debug','stringify','error','code','message','catch','CreateSquareMessage','create','body','options','raw','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x2e6912,_0xe09d6d){var _0x348ec8=function(_0x43e2e7){while(--_0x43e2e7){_0x2e6912['push'](_0x2e6912['shift']());}};_0x348ec8(++_0xe09d6d);}(_0x4a83,0x18b));var _0x34a8=function(_0x55b19f,_0x268075){_0x55b19f=_0x55b19f-0x0;var _0x391271=_0x4a83[_0x55b19f];return _0x391271;};'use strict';var _=require(_0x34a8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x34a8('0x1'));var rs=require(_0x34a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34a8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x34a8('0x4'))('rpc');var config=require(_0x34a8('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x34a8('0x6')][_0x34a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x581541,_0x2592a1,_0x5e4c85){return new BPromise(function(_0xd43ca6,_0x17295b){return client[_0x34a8('0x8')](_0x581541,_0x5e4c85)[_0x34a8('0x9')](function(_0x3ff516){logger[_0x34a8('0xa')](_0x34a8('0xb'),_0x2592a1,_0x34a8('0xc'));logger[_0x34a8('0xd')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x2592a1,_0x34a8('0xc'),JSON[_0x34a8('0xe')](_0x3ff516));if(_0x3ff516[_0x34a8('0xf')]){if(_0x3ff516[_0x34a8('0xf')][_0x34a8('0x10')]===0x1f4){logger[_0x34a8('0xf')]('SquareMessage,\x20%s,\x20%s',_0x2592a1,_0x3ff516[_0x34a8('0xf')][_0x34a8('0x11')]);return _0x17295b(_0x3ff516[_0x34a8('0xf')]['message']);}logger['error'](_0x34a8('0xb'),_0x2592a1,_0x3ff516['error'][_0x34a8('0x11')]);return _0xd43ca6(_0x3ff516[_0x34a8('0xf')][_0x34a8('0x11')]);}else{logger[_0x34a8('0xa')](_0x34a8('0xb'),_0x2592a1,_0x34a8('0xc'));_0xd43ca6(_0x3ff516['result'][_0x34a8('0x11')]);}})[_0x34a8('0x12')](function(_0x2c8c2a){logger[_0x34a8('0xf')](_0x34a8('0xb'),_0x2592a1,_0x2c8c2a);_0x17295b(_0x2c8c2a);});});}exports[_0x34a8('0x13')]=function(_0x27aa92){var _0x5a248c=this;return new Promise(function(_0x1acaeb,_0x2d1a8f){return db['SquareMessage'][_0x34a8('0x14')](_0x27aa92[_0x34a8('0x15')],{'raw':_0x27aa92[_0x34a8('0x16')]?_0x27aa92[_0x34a8('0x16')][_0x34a8('0x17')]===undefined?!![]:![]:!![]})[_0x34a8('0x9')](function(_0x22ec48){logger['info'](_0x34a8('0x13'),_0x27aa92);logger['debug'](_0x34a8('0x13'),_0x27aa92,JSON[_0x34a8('0xe')](_0x22ec48));_0x1acaeb(_0x22ec48);})[_0x34a8('0x12')](function(_0x356fe9){logger[_0x34a8('0xf')](_0x34a8('0x13'),_0x356fe9[_0x34a8('0x11')],_0x27aa92);_0x2d1a8f(_0x5a248c[_0x34a8('0xf')](0x1f4,_0x356fe9['message']));});});}; \ No newline at end of file +var _0x4e45=['code','error','message','CreateSquareMessage','create','body','options','raw','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x45f284,_0x3c08b0){var _0x5c5b32=function(_0x319ebe){while(--_0x319ebe){_0x45f284['push'](_0x45f284['shift']());}};_0x5c5b32(++_0x3c08b0);}(_0x4e45,0x1a9));var _0x54e4=function(_0x522717,_0x146d4d){_0x522717=_0x522717-0x0;var _0x4bf0e4=_0x4e45[_0x522717];return _0x4bf0e4;};'use strict';var _=require(_0x54e4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x54e4('0x1'));var fs=require('fs');var Redis=require(_0x54e4('0x2'));var db=require(_0x54e4('0x3'))['db'];var utils=require(_0x54e4('0x4'));var logger=require(_0x54e4('0x5'))(_0x54e4('0x6'));var config=require('../../config/environment');var jayson=require(_0x54e4('0x7'));var client=jayson[_0x54e4('0x8')][_0x54e4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39c981,_0x44dedc,_0x1e210b){return new BPromise(function(_0x27a711,_0xbce13d){return client[_0x54e4('0xa')](_0x39c981,_0x1e210b)[_0x54e4('0xb')](function(_0x252dc0){logger[_0x54e4('0xc')](_0x54e4('0xd'),_0x44dedc,'request\x20sent');logger['debug'](_0x54e4('0xe'),_0x44dedc,_0x54e4('0xf'),JSON[_0x54e4('0x10')](_0x252dc0));if(_0x252dc0['error']){if(_0x252dc0['error'][_0x54e4('0x11')]===0x1f4){logger[_0x54e4('0x12')](_0x54e4('0xd'),_0x44dedc,_0x252dc0[_0x54e4('0x12')]['message']);return _0xbce13d(_0x252dc0[_0x54e4('0x12')][_0x54e4('0x13')]);}logger[_0x54e4('0x12')](_0x54e4('0xd'),_0x44dedc,_0x252dc0[_0x54e4('0x12')][_0x54e4('0x13')]);return _0x27a711(_0x252dc0[_0x54e4('0x12')][_0x54e4('0x13')]);}else{logger[_0x54e4('0xc')]('SquareMessage,\x20%s,\x20%s',_0x44dedc,_0x54e4('0xf'));_0x27a711(_0x252dc0['result']['message']);}})['catch'](function(_0x57d2e4){logger[_0x54e4('0x12')]('SquareMessage,\x20%s,\x20%s',_0x44dedc,_0x57d2e4);_0xbce13d(_0x57d2e4);});});}exports[_0x54e4('0x14')]=function(_0x3e0901){var _0x2df43a=this;return new Promise(function(_0x580324,_0x567240){return db['SquareMessage'][_0x54e4('0x15')](_0x3e0901[_0x54e4('0x16')],{'raw':_0x3e0901[_0x54e4('0x17')]?_0x3e0901['options'][_0x54e4('0x18')]===undefined?!![]:![]:!![]})[_0x54e4('0xb')](function(_0x4ec3f8){logger[_0x54e4('0xc')]('CreateSquareMessage',_0x3e0901);logger['debug'](_0x54e4('0x14'),_0x3e0901,JSON['stringify'](_0x4ec3f8));_0x580324(_0x4ec3f8);})[_0x54e4('0x19')](function(_0x193e53){logger['error'](_0x54e4('0x14'),_0x193e53[_0x54e4('0x13')],_0x3e0901);_0x567240(_0x2df43a['error'](0x1f4,_0x193e53[_0x54e4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 3ef39b2..08d82a9 100644 --- a/server/api/squareOdbc/index.js +++ b/server/api/squareOdbc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b7e=['isAuthenticated','show','/:id/test','15s','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index','/:id'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0x0b7e,0x163));var _0xe0b7=function(_0x21b32d,_0x5f319c){_0x21b32d=_0x21b32d-0x0;var _0x4816d9=_0x0b7e[_0x21b32d];return _0x4816d9;};'use strict';var multer=require('multer');var util=require(_0xe0b7('0x0'));var path=require(_0xe0b7('0x1'));var timeout=require(_0xe0b7('0x2'));var express=require(_0xe0b7('0x3'));var router=express[_0xe0b7('0x4')]();var fs_extra=require(_0xe0b7('0x5'));var auth=require(_0xe0b7('0x6'));var interaction=require(_0xe0b7('0x7'));var config=require(_0xe0b7('0x8'));var controller=require(_0xe0b7('0x9'));router[_0xe0b7('0xa')]('/',auth['isAuthenticated'](),controller[_0xe0b7('0xb')]);router[_0xe0b7('0xa')](_0xe0b7('0xc'),auth[_0xe0b7('0xd')](),controller[_0xe0b7('0xe')]);router[_0xe0b7('0xa')](_0xe0b7('0xf'),auth[_0xe0b7('0xd')](),timeout(_0xe0b7('0x10')),controller['test']);router[_0xe0b7('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b7('0x12')]);router[_0xe0b7('0x13')]('/:id',auth[_0xe0b7('0xd')](),controller['update']);router[_0xe0b7('0x14')](_0xe0b7('0xc'),auth[_0xe0b7('0xd')](),controller[_0xe0b7('0x15')]);module[_0xe0b7('0x16')]=router; \ No newline at end of file +var _0xc9bb=['isAuthenticated','/:id','show','/:id/test','test','create','put','delete','destroy','exports','multer','util','express','fs-extra','../../config/environment','./squareOdbc.controller','get'];(function(_0x8cb2f9,_0x2b8706){var _0x164887=function(_0x1812cc){while(--_0x1812cc){_0x8cb2f9['push'](_0x8cb2f9['shift']());}};_0x164887(++_0x2b8706);}(_0xc9bb,0xb4));var _0xbc9b=function(_0x308408,_0x37d440){_0x308408=_0x308408-0x0;var _0x9dc073=_0xc9bb[_0x308408];return _0x9dc073;};'use strict';var multer=require(_0xbc9b('0x0'));var util=require(_0xbc9b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbc9b('0x2'));var router=express['Router']();var fs_extra=require(_0xbc9b('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbc9b('0x4'));var controller=require(_0xbc9b('0x5'));router[_0xbc9b('0x6')]('/',auth[_0xbc9b('0x7')](),controller['index']);router[_0xbc9b('0x6')](_0xbc9b('0x8'),auth[_0xbc9b('0x7')](),controller[_0xbc9b('0x9')]);router[_0xbc9b('0x6')](_0xbc9b('0xa'),auth['isAuthenticated'](),timeout('15s'),controller[_0xbc9b('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbc9b('0xc')]);router[_0xbc9b('0xd')](_0xbc9b('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xbc9b('0xe')]('/:id',auth[_0xbc9b('0x7')](),controller[_0xbc9b('0xf')]);module[_0xbc9b('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 2b69ee9..f88dbdd 100644 --- a/server/api/squareOdbc/squareOdbc.attributes.js +++ b/server/api/squareOdbc/squareOdbc.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc7ad=['exports','STRING','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc7ad,0x134));var _0xdc7a=function(_0x31fc54,_0x2641bd){_0x31fc54=_0x31fc54-0x0;var _0x4ef558=_0xc7ad[_0x31fc54];return _0x4ef558;};'use strict';var Sequelize=require(_0xdc7a('0x0'));module[_0xdc7a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xdc7a('0x2')]},'description':{'type':Sequelize[_0xdc7a('0x2')]}}; \ No newline at end of file +var _0xf838=['sequelize','exports','STRING','name'];(function(_0x556e1c,_0x429f20){var _0xc32840=function(_0x4125f1){while(--_0x4125f1){_0x556e1c['push'](_0x556e1c['shift']());}};_0xc32840(++_0x429f20);}(_0xf838,0x14c));var _0x8f83=function(_0x57eb4f,_0x418cd4){_0x57eb4f=_0x57eb4f-0x0;var _0x77d82f=_0xf838[_0x57eb4f];return _0x77d82f;};'use strict';var Sequelize=require(_0x8f83('0x0'));module[_0x8f83('0x1')]={'name':{'type':Sequelize[_0x8f83('0x2')],'unique':_0x8f83('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x8f83('0x2')]},'description':{'type':Sequelize[_0x8f83('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index b3070a9..ebfc8dd 100644 --- a/server/api/squareOdbc/squareOdbc.controller.js +++ b/server/api/squareOdbc/squareOdbc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6934=['VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','dsn','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','end','error','stack','name','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0x478414,_0xcf142d){var _0x5eb6b9=function(_0x10e6fe){while(--_0x10e6fe){_0x478414['push'](_0x478414['shift']());}};_0x5eb6b9(++_0xcf142d);}(_0x6934,0x17a));var _0x4693=function(_0x20244e,_0xfdbcb2){_0x20244e=_0x20244e-0x0;var _0x4fa6de=_0x6934[_0x20244e];return _0x4fa6de;};'use strict';var emlformat=require(_0x4693('0x0'));var rimraf=require(_0x4693('0x1'));var zipdir=require(_0x4693('0x2'));var jsonpatch=require(_0x4693('0x3'));var rp=require('request-promise');var moment=require(_0x4693('0x4'));var BPromise=require(_0x4693('0x5'));var Mustache=require(_0x4693('0x6'));var util=require(_0x4693('0x7'));var path=require('path');var sox=require(_0x4693('0x8'));var csv=require(_0x4693('0x9'));var ejs=require(_0x4693('0xa'));var fs=require('fs');var fs_extra=require(_0x4693('0xb'));var _=require('lodash');var squel=require(_0x4693('0xc'));var crypto=require(_0x4693('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4693('0xe'));var toCsv=require(_0x4693('0x9'));var querystring=require('querystring');var Papa=require(_0x4693('0xf'));var Redis=require(_0x4693('0x10'));var authService=require(_0x4693('0x11'));var qs=require(_0x4693('0x12'));var as=require(_0x4693('0x13'));var hardwareService=require(_0x4693('0x14'));var logger=require(_0x4693('0x15'))(_0x4693('0x16'));var utils=require(_0x4693('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53402f,_0x1fcd34){_0x1fcd34=_0x1fcd34||0xcc;return function(_0x41a1f9){if(_0x41a1f9){return _0x53402f[_0x4693('0x18')](_0x1fcd34);}return _0x53402f['status'](_0x1fcd34)['end']();};}function respondWithResult(_0x3d45b2,_0x179dee){_0x179dee=_0x179dee||0xc8;return function(_0x3109c7){if(_0x3109c7){return _0x3d45b2[_0x4693('0x19')](_0x179dee)[_0x4693('0x1a')](_0x3109c7);}};}function respondWithFilteredResult(_0x350f13,_0x516e04){return function(_0x4c408f){if(_0x4c408f){var _0x1c780a=typeof _0x516e04[_0x4693('0x1b')]===_0x4693('0x1c')&&typeof _0x516e04['limit']===_0x4693('0x1c');var _0x2be0f9=_0x4c408f[_0x4693('0x1d')];var _0x29eb6d=_0x1c780a?0x0:_0x516e04[_0x4693('0x1b')];var _0x191d51=_0x1c780a?_0x4c408f[_0x4693('0x1d')]:_0x516e04[_0x4693('0x1b')]+_0x516e04[_0x4693('0x1e')];var _0x2f25f3;if(_0x191d51>=_0x2be0f9){_0x191d51=_0x2be0f9;_0x2f25f3=0xc8;}else{_0x2f25f3=0xce;}_0x350f13[_0x4693('0x19')](_0x2f25f3);return _0x350f13['set'](_0x4693('0x1f'),_0x29eb6d+'-'+_0x191d51+'/'+_0x2be0f9)[_0x4693('0x1a')](_0x4c408f);}return null;};}function patchUpdates(_0x8d7b26){return function(_0x148a6c){try{jsonpatch[_0x4693('0x20')](_0x148a6c,_0x8d7b26,!![]);}catch(_0x444490){return BPromise[_0x4693('0x21')](_0x444490);}return _0x148a6c[_0x4693('0x22')]();};}function saveUpdates(_0x1d831e,_0x552f35){return function(_0x9d171){if(_0x9d171){return _0x9d171[_0x4693('0x23')](_0x1d831e)['then'](function(_0x3f13ec){return _0x3f13ec;});}return null;};}function removeEntity(_0x137829,_0x3cd922){return function(_0x2fed8b){if(_0x2fed8b){return _0x2fed8b[_0x4693('0x24')]()[_0x4693('0x25')](function(){var _0x13018c=_0x2fed8b[_0x4693('0x26')]({'plain':!![]});var _0x2ab6b5='ODBC';return db[_0x4693('0x27')][_0x4693('0x24')]({'where':{'type':_0x2ab6b5,'resourceId':_0x13018c['id']}})[_0x4693('0x25')](function(){return _0x2fed8b;});})[_0x4693('0x25')](function(){_0x137829['status'](0xcc)[_0x4693('0x28')]();});}};}function handleEntityNotFound(_0x4068b0,_0x4ac231){return function(_0x21adf6){if(!_0x21adf6){_0x4068b0[_0x4693('0x18')](0x194);}return _0x21adf6;};}function handleError(_0x430a8c,_0x5319bb){_0x5319bb=_0x5319bb||0x1f4;return function(_0x7f28f0){logger[_0x4693('0x29')](_0x7f28f0[_0x4693('0x2a')]);if(_0x7f28f0[_0x4693('0x2b')]){delete _0x7f28f0[_0x4693('0x2b')];}_0x430a8c['status'](_0x5319bb)['send'](_0x7f28f0);};}exports[_0x4693('0x2c')]=function(_0x1a2f6a,_0x341739){var _0x32dcb1={},_0x378c6b={},_0x42d5e6={'count':0x0,'rows':[]};var _0x1c6a1d=_[_0x4693('0x2d')](db[_0x4693('0x2e')][_0x4693('0x2f')],function(_0x1b1d8a){return{'name':_0x1b1d8a[_0x4693('0x30')],'type':_0x1b1d8a[_0x4693('0x31')][_0x4693('0x32')]};});_0x378c6b[_0x4693('0x33')]=_[_0x4693('0x2d')](_0x1c6a1d,_0x4693('0x2b'));_0x378c6b[_0x4693('0x34')]=_[_0x4693('0x35')](_0x1a2f6a[_0x4693('0x34')]);_0x378c6b['filters']=_[_0x4693('0x36')](_0x378c6b[_0x4693('0x33')],_0x378c6b[_0x4693('0x34')]);_0x32dcb1['attributes']=_[_0x4693('0x36')](_0x378c6b[_0x4693('0x33')],qs[_0x4693('0x37')](_0x1a2f6a[_0x4693('0x34')][_0x4693('0x37')]));_0x32dcb1['attributes']=_0x32dcb1[_0x4693('0x38')][_0x4693('0x39')]?_0x32dcb1[_0x4693('0x38')]:_0x378c6b['model'];if(!_0x1a2f6a[_0x4693('0x34')][_0x4693('0x3a')](_0x4693('0x3b'))){_0x32dcb1[_0x4693('0x1e')]=qs[_0x4693('0x1e')](_0x1a2f6a['query']['limit']);_0x32dcb1[_0x4693('0x1b')]=qs[_0x4693('0x1b')](_0x1a2f6a['query'][_0x4693('0x1b')]);}_0x32dcb1[_0x4693('0x3c')]=qs[_0x4693('0x3d')](_0x1a2f6a['query']['sort']);_0x32dcb1[_0x4693('0x3e')]=qs[_0x4693('0x3f')](_[_0x4693('0x40')](_0x1a2f6a[_0x4693('0x34')],_0x378c6b[_0x4693('0x3f')]),_0x1c6a1d);if(_0x1a2f6a['query'][_0x4693('0x41')]){_0x32dcb1['where']=_[_0x4693('0x42')](_0x32dcb1[_0x4693('0x3e')],{'$or':_[_0x4693('0x2d')](_0x1c6a1d,function(_0x368f6b){if(_0x368f6b[_0x4693('0x31')]!==_0x4693('0x43')){var _0x3445a5={};_0x3445a5[_0x368f6b['name']]={'$like':'%'+_0x1a2f6a[_0x4693('0x34')][_0x4693('0x41')]+'%'};return _0x3445a5;}})});}_0x32dcb1=_[_0x4693('0x42')]({},_0x32dcb1,_0x1a2f6a[_0x4693('0x44')]);var _0x2c4dd0={'where':_0x32dcb1['where']};return db[_0x4693('0x2e')][_0x4693('0x1d')](_0x2c4dd0)[_0x4693('0x25')](function(_0x423f26){_0x42d5e6['count']=_0x423f26;if(_0x1a2f6a[_0x4693('0x34')][_0x4693('0x45')]){_0x32dcb1[_0x4693('0x46')]=[{'all':!![]}];}return db[_0x4693('0x2e')][_0x4693('0x47')](_0x32dcb1);})['then'](function(_0x1511f5){_0x42d5e6[_0x4693('0x48')]=_0x1511f5;return _0x42d5e6;})[_0x4693('0x25')](respondWithFilteredResult(_0x341739,_0x32dcb1))[_0x4693('0x49')](handleError(_0x341739,null));};exports[_0x4693('0x4a')]=function(_0x970454,_0x2e46d6){var _0x58c2e8={'raw':!![],'where':{'id':_0x970454['params']['id']}},_0x5ccea0={};_0x5ccea0[_0x4693('0x33')]=_['keys'](db[_0x4693('0x2e')][_0x4693('0x2f')]);_0x5ccea0[_0x4693('0x34')]=_['keys'](_0x970454['query']);_0x5ccea0[_0x4693('0x3f')]=_[_0x4693('0x36')](_0x5ccea0[_0x4693('0x33')],_0x5ccea0[_0x4693('0x34')]);_0x58c2e8['attributes']=_[_0x4693('0x36')](_0x5ccea0[_0x4693('0x33')],qs[_0x4693('0x37')](_0x970454['query']['fields']));_0x58c2e8[_0x4693('0x38')]=_0x58c2e8['attributes']['length']?_0x58c2e8[_0x4693('0x38')]:_0x5ccea0[_0x4693('0x33')];if(_0x970454[_0x4693('0x34')][_0x4693('0x45')]){_0x58c2e8[_0x4693('0x46')]=[{'all':!![]}];}_0x58c2e8=_[_0x4693('0x42')]({},_0x58c2e8,_0x970454[_0x4693('0x44')]);return db[_0x4693('0x2e')][_0x4693('0x4b')](_0x58c2e8)[_0x4693('0x25')](handleEntityNotFound(_0x2e46d6,null))[_0x4693('0x25')](respondWithResult(_0x2e46d6,null))[_0x4693('0x49')](handleError(_0x2e46d6,null));};exports[_0x4693('0x4c')]=function(_0x4db94c,_0x25c923){return db[_0x4693('0x2e')]['create'](_0x4db94c[_0x4693('0x4d')],{})['then'](function(_0xc7a031){var _0x919558=_0x4db94c[_0x4693('0x4e')][_0x4693('0x26')]({'plain':!![]});if(!_0x919558)throw new Error(_0x4693('0x4f'));if(_0x919558[_0x4693('0x50')]===_0x4693('0x4e')){var _0x449717=_0xc7a031[_0x4693('0x26')]({'plain':!![]});var _0x34c110=_0x4693('0x51');return db['UserProfileSection'][_0x4693('0x4b')]({'where':{'name':_0x34c110,'userProfileId':_0x919558[_0x4693('0x52')]},'raw':!![]})[_0x4693('0x25')](function(_0xb93840){if(_0xb93840&&_0xb93840[_0x4693('0x53')]===0x0){return db[_0x4693('0x27')]['create']({'name':_0x449717[_0x4693('0x2b')],'resourceId':_0x449717['id'],'type':_0xb93840[_0x4693('0x2b')],'sectionId':_0xb93840['id']},{})['then'](function(){return _0xc7a031;});}else{return _0xc7a031;}})[_0x4693('0x49')](function(_0x13da59){logger[_0x4693('0x29')](_0x4693('0x54'),_0x13da59);throw _0x13da59;});}return _0xc7a031;})[_0x4693('0x25')](respondWithResult(_0x25c923,0xc9))['catch'](handleError(_0x25c923,null));};exports['update']=function(_0xcaddbd,_0x50780d){if(_0xcaddbd[_0x4693('0x4d')]['id']){delete _0xcaddbd[_0x4693('0x4d')]['id'];}return db[_0x4693('0x2e')][_0x4693('0x4b')]({'where':{'id':_0xcaddbd[_0x4693('0x55')]['id']}})[_0x4693('0x25')](handleEntityNotFound(_0x50780d,null))[_0x4693('0x25')](saveUpdates(_0xcaddbd[_0x4693('0x4d')],null))[_0x4693('0x25')](respondWithResult(_0x50780d,null))['catch'](handleError(_0x50780d,null));};exports[_0x4693('0x24')]=function(_0x108459,_0x25395f){return db[_0x4693('0x2e')][_0x4693('0x4b')]({'where':{'id':_0x108459['params']['id']}})[_0x4693('0x25')](handleEntityNotFound(_0x25395f,null))[_0x4693('0x25')](removeEntity(_0x25395f,null))['catch'](handleError(_0x25395f,null));};exports[_0x4693('0x56')]=function(_0x44f473,_0x419e2b,_0x5170dc){var _0x534f96;return db['SquareOdbc']['find']({'where':{'id':_0x44f473['params']['id']},'attributes':['id','dsn']})[_0x4693('0x25')](handleEntityNotFound(_0x419e2b,null))[_0x4693('0x25')](function(_0x911ae){if(_0x911ae){var _0x2cfe31=require('odbc')();_0x2cfe31['openSync'](_0x911ae[_0x4693('0x57')]);_0x2cfe31[_0x4693('0x58')]();return _0x911ae;}})[_0x4693('0x25')](respondWithResult(_0x419e2b,null))[_0x4693('0x49')](handleError(_0x419e2b,null));}; \ No newline at end of file +var _0x8d1a=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','dsn','openSync','closeSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','get','ODBC','UserProfileResource','destroy','sendStatus','error','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','show','params','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x266ddc,_0x45aa52){var _0x39c1d7=function(_0x4cd07c){while(--_0x4cd07c){_0x266ddc['push'](_0x266ddc['shift']());}};_0x39c1d7(++_0x45aa52);}(_0x8d1a,0x1ba));var _0xa8d1=function(_0x1859c3,_0x175a95){_0x1859c3=_0x1859c3-0x0;var _0x4557ad=_0x8d1a[_0x1859c3];return _0x4557ad;};'use strict';var emlformat=require(_0xa8d1('0x0'));var rimraf=require(_0xa8d1('0x1'));var zipdir=require(_0xa8d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa8d1('0x3'));var moment=require('moment');var BPromise=require(_0xa8d1('0x4'));var Mustache=require(_0xa8d1('0x5'));var util=require(_0xa8d1('0x6'));var path=require(_0xa8d1('0x7'));var sox=require('sox');var csv=require(_0xa8d1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa8d1('0x9'));var _=require(_0xa8d1('0xa'));var squel=require(_0xa8d1('0xb'));var crypto=require(_0xa8d1('0xc'));var jsforce=require(_0xa8d1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa8d1('0x8'));var querystring=require(_0xa8d1('0xe'));var Papa=require(_0xa8d1('0xf'));var Redis=require(_0xa8d1('0x10'));var authService=require(_0xa8d1('0x11'));var qs=require(_0xa8d1('0x12'));var as=require(_0xa8d1('0x13'));var hardwareService=require(_0xa8d1('0x14'));var logger=require(_0xa8d1('0x15'))(_0xa8d1('0x16'));var utils=require('../../config/utils');var config=require(_0xa8d1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa8d1('0x18'))['db'];function respondWithStatusCode(_0x47ed76,_0x4ffea7){_0x4ffea7=_0x4ffea7||0xcc;return function(_0x139d5a){if(_0x139d5a){return _0x47ed76['sendStatus'](_0x4ffea7);}return _0x47ed76[_0xa8d1('0x19')](_0x4ffea7)[_0xa8d1('0x1a')]();};}function respondWithResult(_0x1b3932,_0x206b8c){_0x206b8c=_0x206b8c||0xc8;return function(_0xa53382){if(_0xa53382){return _0x1b3932['status'](_0x206b8c)[_0xa8d1('0x1b')](_0xa53382);}};}function respondWithFilteredResult(_0x2202e9,_0x4707a3){return function(_0x5b1345){if(_0x5b1345){var _0x44347a=typeof _0x4707a3[_0xa8d1('0x1c')]===_0xa8d1('0x1d')&&typeof _0x4707a3[_0xa8d1('0x1e')]===_0xa8d1('0x1d');var _0x4c5292=_0x5b1345[_0xa8d1('0x1f')];var _0x5da8da=_0x44347a?0x0:_0x4707a3['offset'];var _0xd71d33=_0x44347a?_0x5b1345[_0xa8d1('0x1f')]:_0x4707a3[_0xa8d1('0x1c')]+_0x4707a3[_0xa8d1('0x1e')];var _0x4177ff;if(_0xd71d33>=_0x4c5292){_0xd71d33=_0x4c5292;_0x4177ff=0xc8;}else{_0x4177ff=0xce;}_0x2202e9[_0xa8d1('0x19')](_0x4177ff);return _0x2202e9[_0xa8d1('0x20')](_0xa8d1('0x21'),_0x5da8da+'-'+_0xd71d33+'/'+_0x4c5292)[_0xa8d1('0x1b')](_0x5b1345);}return null;};}function patchUpdates(_0x464669){return function(_0x1d4eb4){try{jsonpatch[_0xa8d1('0x22')](_0x1d4eb4,_0x464669,!![]);}catch(_0x330993){return BPromise['reject'](_0x330993);}return _0x1d4eb4['save']();};}function saveUpdates(_0x32d7c5,_0x454788){return function(_0x2c4ef7){if(_0x2c4ef7){return _0x2c4ef7['update'](_0x32d7c5)[_0xa8d1('0x23')](function(_0x3c5337){return _0x3c5337;});}return null;};}function removeEntity(_0x5b5cd4,_0x214a66){return function(_0x20f1db){if(_0x20f1db){return _0x20f1db['destroy']()['then'](function(){var _0x234953=_0x20f1db[_0xa8d1('0x24')]({'plain':!![]});var _0x7d1b90=_0xa8d1('0x25');return db[_0xa8d1('0x26')][_0xa8d1('0x27')]({'where':{'type':_0x7d1b90,'resourceId':_0x234953['id']}})[_0xa8d1('0x23')](function(){return _0x20f1db;});})['then'](function(){_0x5b5cd4[_0xa8d1('0x19')](0xcc)[_0xa8d1('0x1a')]();});}};}function handleEntityNotFound(_0x1a52db,_0x1ebd96){return function(_0x5aefbf){if(!_0x5aefbf){_0x1a52db[_0xa8d1('0x28')](0x194);}return _0x5aefbf;};}function handleError(_0x301522,_0x2c236c){_0x2c236c=_0x2c236c||0x1f4;return function(_0x2d396d){logger[_0xa8d1('0x29')](_0x2d396d[_0xa8d1('0x2a')]);if(_0x2d396d[_0xa8d1('0x2b')]){delete _0x2d396d[_0xa8d1('0x2b')];}_0x301522[_0xa8d1('0x19')](_0x2c236c)[_0xa8d1('0x2c')](_0x2d396d);};}exports['index']=function(_0x5325a5,_0x122dd7){var _0x4094ca={},_0x3dc1ea={},_0x546deb={'count':0x0,'rows':[]};var _0x38b934=_[_0xa8d1('0x2d')](db[_0xa8d1('0x2e')][_0xa8d1('0x2f')],function(_0x1a0dcc){return{'name':_0x1a0dcc[_0xa8d1('0x30')],'type':_0x1a0dcc[_0xa8d1('0x31')][_0xa8d1('0x32')]};});_0x3dc1ea[_0xa8d1('0x33')]=_[_0xa8d1('0x2d')](_0x38b934,_0xa8d1('0x2b'));_0x3dc1ea[_0xa8d1('0x34')]=_[_0xa8d1('0x35')](_0x5325a5[_0xa8d1('0x34')]);_0x3dc1ea[_0xa8d1('0x36')]=_[_0xa8d1('0x37')](_0x3dc1ea[_0xa8d1('0x33')],_0x3dc1ea['query']);_0x4094ca[_0xa8d1('0x38')]=_[_0xa8d1('0x37')](_0x3dc1ea[_0xa8d1('0x33')],qs[_0xa8d1('0x39')](_0x5325a5[_0xa8d1('0x34')]['fields']));_0x4094ca[_0xa8d1('0x38')]=_0x4094ca[_0xa8d1('0x38')][_0xa8d1('0x3a')]?_0x4094ca[_0xa8d1('0x38')]:_0x3dc1ea[_0xa8d1('0x33')];if(!_0x5325a5[_0xa8d1('0x34')]['hasOwnProperty'](_0xa8d1('0x3b'))){_0x4094ca[_0xa8d1('0x1e')]=qs['limit'](_0x5325a5[_0xa8d1('0x34')][_0xa8d1('0x1e')]);_0x4094ca[_0xa8d1('0x1c')]=qs[_0xa8d1('0x1c')](_0x5325a5['query'][_0xa8d1('0x1c')]);}_0x4094ca[_0xa8d1('0x3c')]=qs['sort'](_0x5325a5[_0xa8d1('0x34')][_0xa8d1('0x3d')]);_0x4094ca[_0xa8d1('0x3e')]=qs[_0xa8d1('0x36')](_[_0xa8d1('0x3f')](_0x5325a5[_0xa8d1('0x34')],_0x3dc1ea[_0xa8d1('0x36')]),_0x38b934);if(_0x5325a5['query']['filter']){_0x4094ca[_0xa8d1('0x3e')]=_[_0xa8d1('0x40')](_0x4094ca[_0xa8d1('0x3e')],{'$or':_[_0xa8d1('0x2d')](_0x38b934,function(_0x4ac0c3){if(_0x4ac0c3[_0xa8d1('0x31')]!==_0xa8d1('0x41')){var _0x4d6514={};_0x4d6514[_0x4ac0c3[_0xa8d1('0x2b')]]={'$like':'%'+_0x5325a5[_0xa8d1('0x34')][_0xa8d1('0x42')]+'%'};return _0x4d6514;}})});}_0x4094ca=_[_0xa8d1('0x40')]({},_0x4094ca,_0x5325a5[_0xa8d1('0x43')]);var _0x305ef9={'where':_0x4094ca['where']};return db[_0xa8d1('0x2e')]['count'](_0x305ef9)['then'](function(_0x584172){_0x546deb[_0xa8d1('0x1f')]=_0x584172;if(_0x5325a5[_0xa8d1('0x34')]['includeAll']){_0x4094ca[_0xa8d1('0x44')]=[{'all':!![]}];}return db[_0xa8d1('0x2e')]['findAll'](_0x4094ca);})['then'](function(_0x286053){_0x546deb[_0xa8d1('0x45')]=_0x286053;return _0x546deb;})[_0xa8d1('0x23')](respondWithFilteredResult(_0x122dd7,_0x4094ca))['catch'](handleError(_0x122dd7,null));};exports[_0xa8d1('0x46')]=function(_0x43a040,_0x3ef864){var _0x392fed={'raw':!![],'where':{'id':_0x43a040[_0xa8d1('0x47')]['id']}},_0xe12bf1={};_0xe12bf1[_0xa8d1('0x33')]=_[_0xa8d1('0x35')](db[_0xa8d1('0x2e')][_0xa8d1('0x2f')]);_0xe12bf1[_0xa8d1('0x34')]=_[_0xa8d1('0x35')](_0x43a040[_0xa8d1('0x34')]);_0xe12bf1[_0xa8d1('0x36')]=_[_0xa8d1('0x37')](_0xe12bf1['model'],_0xe12bf1[_0xa8d1('0x34')]);_0x392fed['attributes']=_['intersection'](_0xe12bf1['model'],qs[_0xa8d1('0x39')](_0x43a040[_0xa8d1('0x34')]['fields']));_0x392fed['attributes']=_0x392fed['attributes'][_0xa8d1('0x3a')]?_0x392fed[_0xa8d1('0x38')]:_0xe12bf1[_0xa8d1('0x33')];if(_0x43a040[_0xa8d1('0x34')][_0xa8d1('0x48')]){_0x392fed[_0xa8d1('0x44')]=[{'all':!![]}];}_0x392fed=_[_0xa8d1('0x40')]({},_0x392fed,_0x43a040[_0xa8d1('0x43')]);return db[_0xa8d1('0x2e')][_0xa8d1('0x49')](_0x392fed)[_0xa8d1('0x23')](handleEntityNotFound(_0x3ef864,null))[_0xa8d1('0x23')](respondWithResult(_0x3ef864,null))[_0xa8d1('0x4a')](handleError(_0x3ef864,null));};exports[_0xa8d1('0x4b')]=function(_0x5251f4,_0x33b401){return db['SquareOdbc']['create'](_0x5251f4[_0xa8d1('0x4c')],{})[_0xa8d1('0x23')](function(_0x4dedd1){var _0x397cfe=_0x5251f4[_0xa8d1('0x4d')]['get']({'plain':!![]});if(!_0x397cfe)throw new Error(_0xa8d1('0x4e'));if(_0x397cfe[_0xa8d1('0x4f')]==='user'){var _0x564973=_0x4dedd1['get']({'plain':!![]});var _0x15231b=_0xa8d1('0x25');return db['UserProfileSection'][_0xa8d1('0x49')]({'where':{'name':_0x15231b,'userProfileId':_0x397cfe[_0xa8d1('0x50')]},'raw':!![]})[_0xa8d1('0x23')](function(_0x257aa1){if(_0x257aa1&&_0x257aa1[_0xa8d1('0x51')]===0x0){return db['UserProfileResource'][_0xa8d1('0x4b')]({'name':_0x564973['name'],'resourceId':_0x564973['id'],'type':_0x257aa1['name'],'sectionId':_0x257aa1['id']},{})[_0xa8d1('0x23')](function(){return _0x4dedd1;});}else{return _0x4dedd1;}})['catch'](function(_0x4c5d41){logger['error'](_0xa8d1('0x52'),_0x4c5d41);throw _0x4c5d41;});}return _0x4dedd1;})[_0xa8d1('0x23')](respondWithResult(_0x33b401,0xc9))[_0xa8d1('0x4a')](handleError(_0x33b401,null));};exports[_0xa8d1('0x53')]=function(_0x49c313,_0x3ef8cc){if(_0x49c313[_0xa8d1('0x4c')]['id']){delete _0x49c313['body']['id'];}return db[_0xa8d1('0x2e')]['find']({'where':{'id':_0x49c313[_0xa8d1('0x47')]['id']}})['then'](handleEntityNotFound(_0x3ef8cc,null))[_0xa8d1('0x23')](saveUpdates(_0x49c313[_0xa8d1('0x4c')],null))[_0xa8d1('0x23')](respondWithResult(_0x3ef8cc,null))['catch'](handleError(_0x3ef8cc,null));};exports['destroy']=function(_0x52474f,_0x21d41e){return db['SquareOdbc']['find']({'where':{'id':_0x52474f[_0xa8d1('0x47')]['id']}})[_0xa8d1('0x23')](handleEntityNotFound(_0x21d41e,null))[_0xa8d1('0x23')](removeEntity(_0x21d41e,null))['catch'](handleError(_0x21d41e,null));};exports['test']=function(_0x3514d5,_0x818f3e,_0x2ec2ef){var _0x481764;return db[_0xa8d1('0x2e')][_0xa8d1('0x49')]({'where':{'id':_0x3514d5[_0xa8d1('0x47')]['id']},'attributes':['id',_0xa8d1('0x54')]})['then'](handleEntityNotFound(_0x818f3e,null))[_0xa8d1('0x23')](function(_0x171647){if(_0x171647){var _0x3439ed=require('odbc')();_0x3439ed[_0xa8d1('0x55')](_0x171647[_0xa8d1('0x54')]);_0x3439ed[_0xa8d1('0x56')]();return _0x171647;}})[_0xa8d1('0x23')](respondWithResult(_0x818f3e,null))[_0xa8d1('0x4a')](handleError(_0x818f3e,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 36c9732..d05587a 100644 --- a/server/api/squareOdbc/squareOdbc.model.js +++ b/server/api/squareOdbc/squareOdbc.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc537=['define','SquareOdbc','lodash','api','moment','bluebird','path','../../config/environment','./squareOdbc.attributes','exports'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xc537,0x17e));var _0x7c53=function(_0xa64f6,_0xe5781d){_0xa64f6=_0xa64f6-0x0;var _0x16300f=_0xc537[_0xa64f6];return _0x16300f;};'use strict';var _=require(_0x7c53('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7c53('0x1'));var moment=require(_0x7c53('0x2'));var BPromise=require(_0x7c53('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c53('0x4'));var rimraf=require('rimraf');var config=require(_0x7c53('0x5'));var attributes=require(_0x7c53('0x6'));module[_0x7c53('0x7')]=function(_0x7daa8c,_0x5c6082){return _0x7daa8c[_0x7c53('0x8')](_0x7c53('0x9'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdf6=['rimraf','../../config/environment','exports','define','square_odbc','util','../../config/logger','api','moment','bluebird','path'];(function(_0x2b5a76,_0x49ccb4){var _0x5515dc=function(_0x1d9a5f){while(--_0x1d9a5f){_0x2b5a76['push'](_0x2b5a76['shift']());}};_0x5515dc(++_0x49ccb4);}(_0xbdf6,0x1d3));var _0x6bdf=function(_0x21abbc,_0x5c79db){_0x21abbc=_0x21abbc-0x0;var _0x3e5883=_0xbdf6[_0x21abbc];return _0x3e5883;};'use strict';var _=require('lodash');var util=require(_0x6bdf('0x0'));var logger=require(_0x6bdf('0x1'))(_0x6bdf('0x2'));var moment=require(_0x6bdf('0x3'));var BPromise=require(_0x6bdf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6bdf('0x5'));var rimraf=require(_0x6bdf('0x6'));var config=require(_0x6bdf('0x7'));var attributes=require('./squareOdbc.attributes');module[_0x6bdf('0x8')]=function(_0x5c471d,_0x371940){return _0x5c471d[_0x6bdf('0x9')]('SquareOdbc',attributes,{'tableName':_0x6bdf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index c8baba7..9ae3cba 100644 --- a/server/api/squareOdbc/squareOdbc.rpc.js +++ b/server/api/squareOdbc/squareOdbc.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48b4=['map','model','ShowSquareOdbc','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','message','catch','SquareOdbc','find','options','attributes','include'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x48b4,0xf4));var _0x448b=function(_0x14320d,_0x1e3877){_0x14320d=_0x14320d-0x0;var _0x5302a7=_0x48b4[_0x14320d];return _0x5302a7;};'use strict';var _=require(_0x448b('0x0'));var util=require('util');var moment=require(_0x448b('0x1'));var BPromise=require(_0x448b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x448b('0x3'));var db=require(_0x448b('0x4'))['db'];var utils=require(_0x448b('0x5'));var logger=require(_0x448b('0x6'))(_0x448b('0x7'));var config=require('../../config/environment');var jayson=require(_0x448b('0x8'));var client=jayson[_0x448b('0x9')][_0x448b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d03e5,_0x250e5c,_0x21c4a3){return new BPromise(function(_0x1178bd,_0x266de7){return client[_0x448b('0xb')](_0x1d03e5,_0x21c4a3)[_0x448b('0xc')](function(_0x1a27e2){logger[_0x448b('0xd')](_0x448b('0xe'),_0x250e5c,_0x448b('0xf'));logger[_0x448b('0x10')](_0x448b('0x11'),_0x250e5c,_0x448b('0xf'),JSON['stringify'](_0x1a27e2));if(_0x1a27e2[_0x448b('0x12')]){if(_0x1a27e2['error']['code']===0x1f4){logger[_0x448b('0x12')](_0x448b('0xe'),_0x250e5c,_0x1a27e2['error'][_0x448b('0x13')]);return _0x266de7(_0x1a27e2[_0x448b('0x12')][_0x448b('0x13')]);}logger[_0x448b('0x12')](_0x448b('0xe'),_0x250e5c,_0x1a27e2['error']['message']);return _0x1178bd(_0x1a27e2[_0x448b('0x12')][_0x448b('0x13')]);}else{logger[_0x448b('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x250e5c,_0x448b('0xf'));_0x1178bd(_0x1a27e2['result'][_0x448b('0x13')]);}})[_0x448b('0x14')](function(_0x403a3b){logger['error'](_0x448b('0xe'),_0x250e5c,_0x403a3b);_0x266de7(_0x403a3b);});});}exports['ShowSquareOdbc']=function(_0x311228){var _0x2dd6f1=this;return new Promise(function(_0x5333d7,_0x1355da){return db[_0x448b('0x15')][_0x448b('0x16')]({'raw':_0x311228[_0x448b('0x17')]?_0x311228['options']['raw']===undefined?!![]:![]:!![],'where':_0x311228[_0x448b('0x17')]?_0x311228['options']['where']||null:null,'attributes':_0x311228[_0x448b('0x17')]?_0x311228[_0x448b('0x17')][_0x448b('0x18')]||null:null,'include':_0x311228[_0x448b('0x17')]?_0x311228[_0x448b('0x17')][_0x448b('0x19')]?_[_0x448b('0x1a')](_0x311228['options'][_0x448b('0x19')],function(_0x1ae4eb){return{'model':db[_0x1ae4eb[_0x448b('0x1b')]],'as':_0x1ae4eb['as'],'attributes':_0x1ae4eb[_0x448b('0x18')],'include':_0x1ae4eb[_0x448b('0x19')]?_[_0x448b('0x1a')](_0x1ae4eb['include'],function(_0x5dc845){return{'model':db[_0x5dc845[_0x448b('0x1b')]],'as':_0x5dc845['as'],'attributes':_0x5dc845[_0x448b('0x18')],'include':_0x5dc845[_0x448b('0x19')]?_[_0x448b('0x1a')](_0x5dc845[_0x448b('0x19')],function(_0x503b7b){return{'model':db[_0x503b7b['model']],'as':_0x503b7b['as'],'attributes':_0x503b7b[_0x448b('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dce1f){logger[_0x448b('0xd')](_0x448b('0x1c'),_0x311228);logger[_0x448b('0x10')](_0x448b('0x1c'),_0x311228,JSON[_0x448b('0x1d')](_0x3dce1f));_0x5333d7(_0x3dce1f);})['catch'](function(_0x2c5dce){logger[_0x448b('0x12')](_0x448b('0x1c'),_0x2c5dce['message'],_0x311228);_0x1355da(_0x2dd6f1[_0x448b('0x12')](0x1f4,_0x2c5dce[_0x448b('0x13')]));});});}; \ No newline at end of file +var _0xe17f=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareOdbc','find','options','where','attributes','include','map','model','lodash'];(function(_0x104e21,_0x2ea86f){var _0x605b37=function(_0x580fce){while(--_0x580fce){_0x104e21['push'](_0x104e21['shift']());}};_0x605b37(++_0x2ea86f);}(_0xe17f,0x12b));var _0xfe17=function(_0x57b11d,_0x207df6){_0x57b11d=_0x57b11d-0x0;var _0x3c9c53=_0xe17f[_0x57b11d];return _0x3c9c53;};'use strict';var _=require(_0xfe17('0x0'));var util=require('util');var moment=require(_0xfe17('0x1'));var BPromise=require(_0xfe17('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe17('0x3'));var db=require(_0xfe17('0x4'))['db'];var utils=require(_0xfe17('0x5'));var logger=require(_0xfe17('0x6'))(_0xfe17('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xfe17('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47f82f,_0x44a568,_0x434f6f){return new BPromise(function(_0x54b97c,_0x317efb){return client[_0xfe17('0x9')](_0x47f82f,_0x434f6f)[_0xfe17('0xa')](function(_0x395cc8){logger[_0xfe17('0xb')](_0xfe17('0xc'),_0x44a568,'request\x20sent');logger[_0xfe17('0xd')](_0xfe17('0xe'),_0x44a568,_0xfe17('0xf'),JSON[_0xfe17('0x10')](_0x395cc8));if(_0x395cc8[_0xfe17('0x11')]){if(_0x395cc8[_0xfe17('0x11')][_0xfe17('0x12')]===0x1f4){logger[_0xfe17('0x11')](_0xfe17('0xc'),_0x44a568,_0x395cc8[_0xfe17('0x11')]['message']);return _0x317efb(_0x395cc8['error'][_0xfe17('0x13')]);}logger['error'](_0xfe17('0xc'),_0x44a568,_0x395cc8[_0xfe17('0x11')][_0xfe17('0x13')]);return _0x54b97c(_0x395cc8['error']['message']);}else{logger[_0xfe17('0xb')](_0xfe17('0xc'),_0x44a568,_0xfe17('0xf'));_0x54b97c(_0x395cc8[_0xfe17('0x14')][_0xfe17('0x13')]);}})[_0xfe17('0x15')](function(_0x56ba40){logger[_0xfe17('0x11')](_0xfe17('0xc'),_0x44a568,_0x56ba40);_0x317efb(_0x56ba40);});});}exports['ShowSquareOdbc']=function(_0xee59ce){var _0x1dfc2f=this;return new Promise(function(_0x3a396e,_0x597ca4){return db[_0xfe17('0x16')][_0xfe17('0x17')]({'raw':_0xee59ce[_0xfe17('0x18')]?_0xee59ce[_0xfe17('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xee59ce[_0xfe17('0x18')]?_0xee59ce[_0xfe17('0x18')][_0xfe17('0x19')]||null:null,'attributes':_0xee59ce[_0xfe17('0x18')]?_0xee59ce['options'][_0xfe17('0x1a')]||null:null,'include':_0xee59ce['options']?_0xee59ce[_0xfe17('0x18')][_0xfe17('0x1b')]?_[_0xfe17('0x1c')](_0xee59ce[_0xfe17('0x18')][_0xfe17('0x1b')],function(_0x5140d5){return{'model':db[_0x5140d5[_0xfe17('0x1d')]],'as':_0x5140d5['as'],'attributes':_0x5140d5[_0xfe17('0x1a')],'include':_0x5140d5[_0xfe17('0x1b')]?_[_0xfe17('0x1c')](_0x5140d5[_0xfe17('0x1b')],function(_0x5f5332){return{'model':db[_0x5f5332['model']],'as':_0x5f5332['as'],'attributes':_0x5f5332['attributes'],'include':_0x5f5332[_0xfe17('0x1b')]?_[_0xfe17('0x1c')](_0x5f5332[_0xfe17('0x1b')],function(_0x5e5f76){return{'model':db[_0x5e5f76[_0xfe17('0x1d')]],'as':_0x5e5f76['as'],'attributes':_0x5e5f76[_0xfe17('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38e9b9){logger[_0xfe17('0xb')]('ShowSquareOdbc',_0xee59ce);logger[_0xfe17('0xd')]('ShowSquareOdbc',_0xee59ce,JSON[_0xfe17('0x10')](_0x38e9b9));_0x3a396e(_0x38e9b9);})[_0xfe17('0x15')](function(_0x6c0324){logger[_0xfe17('0x11')]('ShowSquareOdbc',_0x6c0324[_0xfe17('0x13')],_0xee59ce);_0x597ca4(_0x1dfc2f['error'](0x1f4,_0x6c0324['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 2e5c674..f0f1e7f 100644 --- a/server/api/squareProject/index.js +++ b/server/api/squareProject/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b64=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer'];(function(_0x4d4c4f,_0x2428fc){var _0x141c93=function(_0x9d2db5){while(--_0x9d2db5){_0x4d4c4f['push'](_0x4d4c4f['shift']());}};_0x141c93(++_0x2428fc);}(_0x2b64,0x167));var _0x42b6=function(_0x1cfba1,_0xceafc){_0x1cfba1=_0x1cfba1-0x0;var _0x4fd6aa=_0x2b64[_0x1cfba1];return _0x4fd6aa;};'use strict';var multer=require(_0x42b6('0x0'));var util=require(_0x42b6('0x1'));var path=require(_0x42b6('0x2'));var timeout=require(_0x42b6('0x3'));var express=require(_0x42b6('0x4'));var router=express[_0x42b6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x42b6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x42b6('0x7'));var controller=require(_0x42b6('0x8'));router[_0x42b6('0x9')]('/',auth[_0x42b6('0xa')](),controller[_0x42b6('0xb')]);router['get']('/:id',auth[_0x42b6('0xa')](),controller[_0x42b6('0xc')]);router[_0x42b6('0xd')]('/',auth[_0x42b6('0xa')](),controller[_0x42b6('0xe')]);router[_0x42b6('0xf')](_0x42b6('0x10'),auth['isAuthenticated'](),controller[_0x42b6('0x11')]);router[_0x42b6('0x12')]('/:id',auth[_0x42b6('0xa')](),controller[_0x42b6('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0619=['/:id','post','create','put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./squareProject.controller','get','isAuthenticated','index'];(function(_0xa430f0,_0x29985d){var _0x2f2425=function(_0x34cbed){while(--_0x34cbed){_0xa430f0['push'](_0xa430f0['shift']());}};_0x2f2425(++_0x29985d);}(_0x0619,0x1d1));var _0x9061=function(_0x2434dd,_0x39a1f4){_0x2434dd=_0x2434dd-0x0;var _0x134bc7=_0x0619[_0x2434dd];return _0x134bc7;};'use strict';var multer=require(_0x9061('0x0'));var util=require(_0x9061('0x1'));var path=require('path');var timeout=require(_0x9061('0x2'));var express=require(_0x9061('0x3'));var router=express[_0x9061('0x4')]();var fs_extra=require(_0x9061('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9061('0x6'));var controller=require(_0x9061('0x7'));router[_0x9061('0x8')]('/',auth[_0x9061('0x9')](),controller[_0x9061('0xa')]);router['get'](_0x9061('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x9061('0xc')]('/',auth[_0x9061('0x9')](),controller[_0x9061('0xd')]);router[_0x9061('0xe')](_0x9061('0xb'),auth[_0x9061('0x9')](),controller['update']);router[_0x9061('0xf')](_0x9061('0xb'),auth['isAuthenticated'](),controller[_0x9061('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 006c26b..2293c17 100644 --- a/server/api/squareProject/squareProject.attributes.js +++ b/server/api/squareProject/squareProject.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b87=['name','TEXT','getDataValue','preproduction','toString','utf8','BLOB','long','production','DATE','sequelize','exports','STRING'];(function(_0x92ef08,_0x1c7caa){var _0x452787=function(_0x51800a){while(--_0x51800a){_0x92ef08['push'](_0x92ef08['shift']());}};_0x452787(++_0x1c7caa);}(_0x2b87,0x72));var _0x72b8=function(_0x46f135,_0x4bc81a){_0x46f135=_0x46f135-0x0;var _0x56a52c=_0x2b87[_0x46f135];return _0x56a52c;};'use strict';var Sequelize=require(_0x72b8('0x0'));module[_0x72b8('0x1')]={'name':{'type':Sequelize[_0x72b8('0x2')],'unique':_0x72b8('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x72b8('0x4')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x72b8('0x5')](_0x72b8('0x6'))){return this[_0x72b8('0x5')]('preproduction')[_0x72b8('0x7')](_0x72b8('0x8'));}}},'production':{'type':Sequelize[_0x72b8('0x9')](_0x72b8('0xa')),'get':function(){if(this['getDataValue'](_0x72b8('0xb'))){return this[_0x72b8('0x5')](_0x72b8('0xb'))[_0x72b8('0x7')](_0x72b8('0x8'));}}},'savedAt':{'type':Sequelize[_0x72b8('0xc')]},'publishedAt':{'type':Sequelize[_0x72b8('0xc')]}}; \ No newline at end of file +var _0x4ba3=['toString','DATE','sequelize','exports','STRING','TEXT','BLOB','long','getDataValue','utf8','production'];(function(_0x340756,_0xad31ae){var _0x2ef745=function(_0x59ffde){while(--_0x59ffde){_0x340756['push'](_0x340756['shift']());}};_0x2ef745(++_0xad31ae);}(_0x4ba3,0xe9));var _0x34ba=function(_0x17d7e,_0x52bcfb){_0x17d7e=_0x17d7e-0x0;var _0x22dbca=_0x4ba3[_0x17d7e];return _0x22dbca;};'use strict';var Sequelize=require(_0x34ba('0x0'));module[_0x34ba('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x34ba('0x2')]},'notes':{'type':Sequelize[_0x34ba('0x3')]},'preproduction':{'type':Sequelize[_0x34ba('0x4')](_0x34ba('0x5')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x34ba('0x6')]('preproduction')['toString'](_0x34ba('0x7'));}}},'production':{'type':Sequelize[_0x34ba('0x4')](_0x34ba('0x5')),'get':function(){if(this[_0x34ba('0x6')](_0x34ba('0x8'))){return this[_0x34ba('0x6')](_0x34ba('0x8'))[_0x34ba('0x9')]('utf8');}}},'savedAt':{'type':Sequelize[_0x34ba('0xa')]},'publishedAt':{'type':Sequelize[_0x34ba('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 79c163a..f0f9d8a 100644 --- a/server/api/squareProject/squareProject.controller.js +++ b/server/api/squareProject/squareProject.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ae7=['keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','production','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./squareProject.socket','register','status','json','offset','limit','undefined','count','set','update','destroy','then','get','publish','agi','stringify','end','error','stack','name','send','index','map','SquareProject','fieldName','type','key','model','query'];(function(_0x55172c,_0x521972){var _0x59b506=function(_0x3138da){while(--_0x3138da){_0x55172c['push'](_0x55172c['shift']());}};_0x59b506(++_0x521972);}(_0x4ae7,0x185));var _0x74ae=function(_0x1e58ce,_0x5120f9){_0x1e58ce=_0x1e58ce-0x0;var _0x1e3bf4=_0x4ae7[_0x1e58ce];return _0x1e3bf4;};'use strict';var _=require(_0x74ae('0x0'));var Redis=require(_0x74ae('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x74ae('0x2'))(_0x74ae('0x3'));var config=require(_0x74ae('0x4'));var db=require(_0x74ae('0x5'))['db'];config[_0x74ae('0x6')]=_['defaults'](config[_0x74ae('0x6')],{'host':_0x74ae('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x74ae('0x6')]));require(_0x74ae('0x8'))[_0x74ae('0x9')](socket);function respondWithResult(_0xc10be3,_0x28a2e6){_0x28a2e6=_0x28a2e6||0xc8;return function(_0x238dc3){if(_0x238dc3){return _0xc10be3[_0x74ae('0xa')](_0x28a2e6)[_0x74ae('0xb')](_0x238dc3);}};}function respondWithFilteredResult(_0x12bf56,_0x593fc1){return function(_0x47be8d){if(_0x47be8d){var _0x4fd783=typeof _0x593fc1[_0x74ae('0xc')]==='undefined'&&typeof _0x593fc1[_0x74ae('0xd')]===_0x74ae('0xe');var _0x521b0=_0x47be8d[_0x74ae('0xf')];var _0x42faaf=_0x4fd783?0x0:_0x593fc1[_0x74ae('0xc')];var _0x56f6fc=_0x4fd783?_0x47be8d[_0x74ae('0xf')]:_0x593fc1[_0x74ae('0xc')]+_0x593fc1[_0x74ae('0xd')];var _0x3e4695;if(_0x56f6fc>=_0x521b0){_0x56f6fc=_0x521b0;_0x3e4695=0xc8;}else{_0x3e4695=0xce;}_0x12bf56[_0x74ae('0xa')](_0x3e4695);return _0x12bf56[_0x74ae('0x10')]('Content-Range',_0x42faaf+'-'+_0x56f6fc+'/'+_0x521b0)[_0x74ae('0xb')](_0x47be8d);}return null;};}function saveUpdates(_0x45b3c4){return function(_0x45a900){if(_0x45a900){return _0x45a900[_0x74ae('0x11')](_0x45b3c4)['then'](function(_0x5ad5bc){return _0x5ad5bc;});}return null;};}function removeEntity(_0x22ebc8){return function(_0x9541b1){if(_0x9541b1){return _0x9541b1[_0x74ae('0x12')]()[_0x74ae('0x13')](function(){var _0x5d8022=_0x9541b1[_0x74ae('0x14')]({'plain':!![]});var _0x407af1='SquareProjects';return db['UserProfileResource'][_0x74ae('0x12')]({'where':{'type':_0x407af1,'resourceId':_0x5d8022['id']}})[_0x74ae('0x13')](function(){return _0x9541b1;});})['then'](function(){var _0x259670=new Redis(config[_0x74ae('0x6')]);_0x259670[_0x74ae('0x15')](_0x74ae('0x16'),JSON[_0x74ae('0x17')]({'id':_0x9541b1['id'],'deleted':!![]}));})[_0x74ae('0x13')](function(){_0x22ebc8[_0x74ae('0xa')](0xcc)[_0x74ae('0x18')]();});}};}function handleEntityNotFound(_0x383885){return function(_0x4c8279){if(!_0x4c8279){_0x383885['sendStatus'](0x194);}return _0x4c8279;};}function handleError(_0x30af82,_0xbe64d2){_0xbe64d2=_0xbe64d2||0x1f4;return function(_0x2b618b){logger[_0x74ae('0x19')](_0x2b618b[_0x74ae('0x1a')]);if(_0x2b618b['name']){delete _0x2b618b[_0x74ae('0x1b')];}_0x30af82[_0x74ae('0xa')](_0xbe64d2)[_0x74ae('0x1c')](_0x2b618b);};}exports[_0x74ae('0x1d')]=function(_0x32327c,_0x4a88f9){var _0x22763c={},_0x5ce285={},_0x4f7349={'count':0x0,'rows':[]};var _0x373a22=_[_0x74ae('0x1e')](db[_0x74ae('0x1f')]['rawAttributes'],function(_0x302f15){return{'name':_0x302f15[_0x74ae('0x20')],'type':_0x302f15[_0x74ae('0x21')][_0x74ae('0x22')]};});_0x5ce285[_0x74ae('0x23')]=_[_0x74ae('0x1e')](_0x373a22,'name');_0x5ce285[_0x74ae('0x24')]=_[_0x74ae('0x25')](_0x32327c[_0x74ae('0x24')]);_0x5ce285[_0x74ae('0x26')]=_['intersection'](_0x5ce285['model'],_0x5ce285[_0x74ae('0x24')]);_0x22763c[_0x74ae('0x27')]=_[_0x74ae('0x28')](_0x5ce285[_0x74ae('0x23')],qs[_0x74ae('0x29')](_0x32327c['query'][_0x74ae('0x29')]));_0x22763c[_0x74ae('0x27')]=_0x22763c[_0x74ae('0x27')][_0x74ae('0x2a')]?_0x22763c[_0x74ae('0x27')]:_0x5ce285[_0x74ae('0x23')];if(!_0x32327c['query'][_0x74ae('0x2b')](_0x74ae('0x2c'))){_0x22763c[_0x74ae('0xd')]=qs[_0x74ae('0xd')](_0x32327c['query'][_0x74ae('0xd')]);_0x22763c[_0x74ae('0xc')]=qs['offset'](_0x32327c[_0x74ae('0x24')][_0x74ae('0xc')]);}_0x22763c[_0x74ae('0x2d')]=qs[_0x74ae('0x2e')](_0x32327c[_0x74ae('0x24')][_0x74ae('0x2e')]);_0x22763c[_0x74ae('0x2f')]=qs[_0x74ae('0x26')](_[_0x74ae('0x30')](_0x32327c[_0x74ae('0x24')],_0x5ce285[_0x74ae('0x26')]),_0x373a22);if(_0x32327c[_0x74ae('0x24')][_0x74ae('0x31')]){_0x22763c[_0x74ae('0x2f')]=_[_0x74ae('0x32')](_0x22763c[_0x74ae('0x2f')],{'$or':_[_0x74ae('0x1e')](_0x373a22,function(_0x475806){if(_0x475806[_0x74ae('0x21')]!==_0x74ae('0x33')){var _0x138de7={};_0x138de7[_0x475806[_0x74ae('0x1b')]]={'$like':'%'+_0x32327c[_0x74ae('0x24')][_0x74ae('0x31')]+'%'};return _0x138de7;}})});}_0x22763c=_['merge']({},_0x22763c,_0x32327c[_0x74ae('0x34')]);var _0x5c8e04={'where':_0x22763c[_0x74ae('0x2f')]};return db['SquareProject']['count'](_0x5c8e04)[_0x74ae('0x13')](function(_0x9b2c10){_0x4f7349[_0x74ae('0xf')]=_0x9b2c10;if(_0x32327c['query'][_0x74ae('0x35')]){_0x22763c[_0x74ae('0x36')]=[{'all':!![]}];}return db[_0x74ae('0x1f')][_0x74ae('0x37')](_0x22763c);})[_0x74ae('0x13')](function(_0x1c1a2e){_0x4f7349[_0x74ae('0x38')]=_0x1c1a2e;return _0x4f7349;})[_0x74ae('0x13')](respondWithFilteredResult(_0x4a88f9,_0x22763c))[_0x74ae('0x39')](handleError(_0x4a88f9,null));};exports[_0x74ae('0x3a')]=function(_0x35e667,_0x437bc7){var _0xe992c9={'raw':![],'where':{'id':_0x35e667['params']['id']}},_0x248081={};_0x248081['model']=_[_0x74ae('0x25')](db['SquareProject']['rawAttributes']);_0x248081[_0x74ae('0x24')]=_[_0x74ae('0x25')](_0x35e667[_0x74ae('0x24')]);_0x248081['filters']=_[_0x74ae('0x28')](_0x248081[_0x74ae('0x23')],_0x248081['query']);_0xe992c9[_0x74ae('0x27')]=_[_0x74ae('0x28')](_0x248081[_0x74ae('0x23')],qs[_0x74ae('0x29')](_0x35e667['query']['fields']));_0xe992c9[_0x74ae('0x27')]=_0xe992c9['attributes'][_0x74ae('0x2a')]?_0xe992c9[_0x74ae('0x27')]:_0x248081['model'];if(_0x35e667[_0x74ae('0x24')][_0x74ae('0x35')]){_0xe992c9[_0x74ae('0x36')]=[{'all':!![]}];}_0xe992c9=_['merge']({},_0xe992c9,_0x35e667[_0x74ae('0x34')]);return db[_0x74ae('0x1f')][_0x74ae('0x3b')](_0xe992c9)[_0x74ae('0x13')](handleEntityNotFound(_0x437bc7,null))[_0x74ae('0x13')](respondWithResult(_0x437bc7,null))[_0x74ae('0x39')](handleError(_0x437bc7,null));};exports[_0x74ae('0x3c')]=function(_0x44b89a,_0x4939d6){return db[_0x74ae('0x1f')][_0x74ae('0x3c')](_0x44b89a[_0x74ae('0x3d')],{})[_0x74ae('0x13')](function(_0x383819){var _0x462d6e=_0x44b89a[_0x74ae('0x3e')][_0x74ae('0x14')]({'plain':!![]});if(!_0x462d6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x462d6e[_0x74ae('0x3f')]===_0x74ae('0x3e')){var _0x72b1ca=_0x383819['get']({'plain':!![]});var _0x1b6aea='SquareProjects';return db[_0x74ae('0x40')][_0x74ae('0x3b')]({'where':{'name':_0x1b6aea,'userProfileId':_0x462d6e[_0x74ae('0x41')]},'raw':!![]})[_0x74ae('0x13')](function(_0x35b882){if(_0x35b882&&_0x35b882[_0x74ae('0x42')]===0x0){return db[_0x74ae('0x43')]['create']({'name':_0x72b1ca[_0x74ae('0x1b')],'resourceId':_0x72b1ca['id'],'type':_0x35b882[_0x74ae('0x1b')],'sectionId':_0x35b882['id']},{})[_0x74ae('0x13')](function(){return _0x383819;});}else{return _0x383819;}})['catch'](function(_0x3b5956){logger[_0x74ae('0x19')](_0x74ae('0x44'),_0x3b5956);throw _0x3b5956;});}return _0x383819;})['then'](respondWithResult(_0x4939d6,0xc9))[_0x74ae('0x39')](handleError(_0x4939d6,null));};exports[_0x74ae('0x11')]=function(_0x3e9641,_0x2e3414){if(_0x3e9641[_0x74ae('0x3d')]['id']){delete _0x3e9641[_0x74ae('0x3d')]['id'];}return db[_0x74ae('0x1f')][_0x74ae('0x3b')]({'where':{'id':_0x3e9641[_0x74ae('0x45')]['id']}})[_0x74ae('0x13')](handleEntityNotFound(_0x2e3414,null))['then'](saveUpdates(_0x3e9641[_0x74ae('0x3d')],null))[_0x74ae('0x13')](function(_0x269ef2){if(!_0x269ef2)return;var _0x1e3637=_0x269ef2[_0x74ae('0x14')]({'plain':!![]});return _0x1e3637;})[_0x74ae('0x13')](function(_0x1497d8){var _0x592031=new Redis(config[_0x74ae('0x6')]);_0x592031[_0x74ae('0x15')]('agi',JSON[_0x74ae('0x17')](_[_0x74ae('0x30')](_0x1497d8,['id',_0x74ae('0x1b'),_0x74ae('0x46')])));return _0x1497d8;})[_0x74ae('0x13')](respondWithResult(_0x2e3414,null))['catch'](handleError(_0x2e3414,null));};exports['destroy']=function(_0x4db117,_0x3fa9eb){return db['SquareProject'][_0x74ae('0x3b')]({'where':{'id':_0x4db117[_0x74ae('0x45')]['id']}})[_0x74ae('0x13')](handleEntityNotFound(_0x3fa9eb,null))['then'](removeEntity(_0x3fa9eb,null))[_0x74ae('0x39')](handleError(_0x3fa9eb,null));}; \ No newline at end of file +var _0x4c8b=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','publish','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','register','status','offset','undefined','limit','count','Content-Range','update','then','destroy','SquareProjects','UserProfileResource','agi','stringify','end','sendStatus','error','stack','name','index','map','fieldName','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','include','SquareProject','catch','show','params','keys','rawAttributes','length','includeAll','options','find','create'];(function(_0x443bdd,_0x517654){var _0x3a1e48=function(_0x3a7e26){while(--_0x3a7e26){_0x443bdd['push'](_0x443bdd['shift']());}};_0x3a1e48(++_0x517654);}(_0x4c8b,0x119));var _0xb4c8=function(_0x15a503,_0x2bab1f){_0x15a503=_0x15a503-0x0;var _0x15b099=_0x4c8b[_0x15a503];return _0x15b099;};'use strict';var _=require(_0xb4c8('0x0'));var Redis=require(_0xb4c8('0x1'));var qs=require(_0xb4c8('0x2'));var logger=require(_0xb4c8('0x3'))(_0xb4c8('0x4'));var config=require('../../config/environment');var db=require(_0xb4c8('0x5'))['db'];config['redis']=_['defaults'](config[_0xb4c8('0x6')],{'host':_0xb4c8('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb4c8('0x6')]));require('./squareProject.socket')[_0xb4c8('0x8')](socket);function respondWithResult(_0x29f78b,_0x4708b9){_0x4708b9=_0x4708b9||0xc8;return function(_0x1421c5){if(_0x1421c5){return _0x29f78b[_0xb4c8('0x9')](_0x4708b9)['json'](_0x1421c5);}};}function respondWithFilteredResult(_0x7aa06,_0x2c15ca){return function(_0x1f2058){if(_0x1f2058){var _0x4b5e7d=typeof _0x2c15ca[_0xb4c8('0xa')]===_0xb4c8('0xb')&&typeof _0x2c15ca[_0xb4c8('0xc')]===_0xb4c8('0xb');var _0x13e377=_0x1f2058[_0xb4c8('0xd')];var _0x4eecf6=_0x4b5e7d?0x0:_0x2c15ca[_0xb4c8('0xa')];var _0x63516d=_0x4b5e7d?_0x1f2058[_0xb4c8('0xd')]:_0x2c15ca[_0xb4c8('0xa')]+_0x2c15ca[_0xb4c8('0xc')];var _0x164471;if(_0x63516d>=_0x13e377){_0x63516d=_0x13e377;_0x164471=0xc8;}else{_0x164471=0xce;}_0x7aa06[_0xb4c8('0x9')](_0x164471);return _0x7aa06['set'](_0xb4c8('0xe'),_0x4eecf6+'-'+_0x63516d+'/'+_0x13e377)['json'](_0x1f2058);}return null;};}function saveUpdates(_0x42c132){return function(_0x50c2e6){if(_0x50c2e6){return _0x50c2e6[_0xb4c8('0xf')](_0x42c132)[_0xb4c8('0x10')](function(_0x144072){return _0x144072;});}return null;};}function removeEntity(_0x3a044d){return function(_0xc5d952){if(_0xc5d952){return _0xc5d952[_0xb4c8('0x11')]()[_0xb4c8('0x10')](function(){var _0x44a322=_0xc5d952['get']({'plain':!![]});var _0x593121=_0xb4c8('0x12');return db[_0xb4c8('0x13')][_0xb4c8('0x11')]({'where':{'type':_0x593121,'resourceId':_0x44a322['id']}})['then'](function(){return _0xc5d952;});})[_0xb4c8('0x10')](function(){var _0x163d67=new Redis(config[_0xb4c8('0x6')]);_0x163d67['publish'](_0xb4c8('0x14'),JSON[_0xb4c8('0x15')]({'id':_0xc5d952['id'],'deleted':!![]}));})[_0xb4c8('0x10')](function(){_0x3a044d[_0xb4c8('0x9')](0xcc)[_0xb4c8('0x16')]();});}};}function handleEntityNotFound(_0x45eca0){return function(_0xa8c388){if(!_0xa8c388){_0x45eca0[_0xb4c8('0x17')](0x194);}return _0xa8c388;};}function handleError(_0x2887e6,_0x6ba55b){_0x6ba55b=_0x6ba55b||0x1f4;return function(_0x5d7572){logger[_0xb4c8('0x18')](_0x5d7572[_0xb4c8('0x19')]);if(_0x5d7572['name']){delete _0x5d7572[_0xb4c8('0x1a')];}_0x2887e6[_0xb4c8('0x9')](_0x6ba55b)['send'](_0x5d7572);};}exports[_0xb4c8('0x1b')]=function(_0x30aed3,_0x2916b8){var _0x3a6e82={},_0x18b809={},_0x38fbc5={'count':0x0,'rows':[]};var _0x3b3d87=_[_0xb4c8('0x1c')](db['SquareProject']['rawAttributes'],function(_0x33996d){return{'name':_0x33996d[_0xb4c8('0x1d')],'type':_0x33996d['type'][_0xb4c8('0x1e')]};});_0x18b809[_0xb4c8('0x1f')]=_[_0xb4c8('0x1c')](_0x3b3d87,_0xb4c8('0x1a'));_0x18b809[_0xb4c8('0x20')]=_['keys'](_0x30aed3[_0xb4c8('0x20')]);_0x18b809['filters']=_['intersection'](_0x18b809[_0xb4c8('0x1f')],_0x18b809[_0xb4c8('0x20')]);_0x3a6e82['attributes']=_[_0xb4c8('0x21')](_0x18b809[_0xb4c8('0x1f')],qs['fields'](_0x30aed3[_0xb4c8('0x20')][_0xb4c8('0x22')]));_0x3a6e82[_0xb4c8('0x23')]=_0x3a6e82[_0xb4c8('0x23')]['length']?_0x3a6e82['attributes']:_0x18b809[_0xb4c8('0x1f')];if(!_0x30aed3['query'][_0xb4c8('0x24')](_0xb4c8('0x25'))){_0x3a6e82[_0xb4c8('0xc')]=qs['limit'](_0x30aed3[_0xb4c8('0x20')][_0xb4c8('0xc')]);_0x3a6e82[_0xb4c8('0xa')]=qs['offset'](_0x30aed3['query'][_0xb4c8('0xa')]);}_0x3a6e82[_0xb4c8('0x26')]=qs[_0xb4c8('0x27')](_0x30aed3[_0xb4c8('0x20')][_0xb4c8('0x27')]);_0x3a6e82[_0xb4c8('0x28')]=qs[_0xb4c8('0x29')](_[_0xb4c8('0x2a')](_0x30aed3[_0xb4c8('0x20')],_0x18b809[_0xb4c8('0x29')]),_0x3b3d87);if(_0x30aed3[_0xb4c8('0x20')][_0xb4c8('0x2b')]){_0x3a6e82['where']=_[_0xb4c8('0x2c')](_0x3a6e82['where'],{'$or':_[_0xb4c8('0x1c')](_0x3b3d87,function(_0x3d2213){if(_0x3d2213[_0xb4c8('0x2d')]!==_0xb4c8('0x2e')){var _0x18f450={};_0x18f450[_0x3d2213['name']]={'$like':'%'+_0x30aed3[_0xb4c8('0x20')]['filter']+'%'};return _0x18f450;}})});}_0x3a6e82=_['merge']({},_0x3a6e82,_0x30aed3['options']);var _0x4e6086={'where':_0x3a6e82[_0xb4c8('0x28')]};return db['SquareProject']['count'](_0x4e6086)[_0xb4c8('0x10')](function(_0x53dfb3){_0x38fbc5[_0xb4c8('0xd')]=_0x53dfb3;if(_0x30aed3[_0xb4c8('0x20')]['includeAll']){_0x3a6e82[_0xb4c8('0x2f')]=[{'all':!![]}];}return db[_0xb4c8('0x30')]['findAll'](_0x3a6e82);})[_0xb4c8('0x10')](function(_0x20c576){_0x38fbc5['rows']=_0x20c576;return _0x38fbc5;})[_0xb4c8('0x10')](respondWithFilteredResult(_0x2916b8,_0x3a6e82))[_0xb4c8('0x31')](handleError(_0x2916b8,null));};exports[_0xb4c8('0x32')]=function(_0x48116f,_0x5a63ab){var _0x308c69={'raw':![],'where':{'id':_0x48116f[_0xb4c8('0x33')]['id']}},_0xfc540e={};_0xfc540e[_0xb4c8('0x1f')]=_[_0xb4c8('0x34')](db[_0xb4c8('0x30')][_0xb4c8('0x35')]);_0xfc540e[_0xb4c8('0x20')]=_['keys'](_0x48116f['query']);_0xfc540e[_0xb4c8('0x29')]=_[_0xb4c8('0x21')](_0xfc540e[_0xb4c8('0x1f')],_0xfc540e[_0xb4c8('0x20')]);_0x308c69[_0xb4c8('0x23')]=_[_0xb4c8('0x21')](_0xfc540e[_0xb4c8('0x1f')],qs['fields'](_0x48116f['query'][_0xb4c8('0x22')]));_0x308c69[_0xb4c8('0x23')]=_0x308c69['attributes'][_0xb4c8('0x36')]?_0x308c69[_0xb4c8('0x23')]:_0xfc540e[_0xb4c8('0x1f')];if(_0x48116f['query'][_0xb4c8('0x37')]){_0x308c69['include']=[{'all':!![]}];}_0x308c69=_[_0xb4c8('0x2c')]({},_0x308c69,_0x48116f[_0xb4c8('0x38')]);return db[_0xb4c8('0x30')][_0xb4c8('0x39')](_0x308c69)[_0xb4c8('0x10')](handleEntityNotFound(_0x5a63ab,null))[_0xb4c8('0x10')](respondWithResult(_0x5a63ab,null))[_0xb4c8('0x31')](handleError(_0x5a63ab,null));};exports[_0xb4c8('0x3a')]=function(_0x1b3107,_0x2075a4){return db[_0xb4c8('0x30')][_0xb4c8('0x3a')](_0x1b3107['body'],{})[_0xb4c8('0x10')](function(_0x5a0816){var _0x3ef99e=_0x1b3107['user'][_0xb4c8('0x3b')]({'plain':!![]});if(!_0x3ef99e)throw new Error(_0xb4c8('0x3c'));if(_0x3ef99e[_0xb4c8('0x3d')]===_0xb4c8('0x3e')){var _0x565a09=_0x5a0816[_0xb4c8('0x3b')]({'plain':!![]});var _0x3f7562=_0xb4c8('0x12');return db[_0xb4c8('0x3f')][_0xb4c8('0x39')]({'where':{'name':_0x3f7562,'userProfileId':_0x3ef99e['userProfileId']},'raw':!![]})[_0xb4c8('0x10')](function(_0x327cce){if(_0x327cce&&_0x327cce['autoAssociation']===0x0){return db[_0xb4c8('0x13')][_0xb4c8('0x3a')]({'name':_0x565a09[_0xb4c8('0x1a')],'resourceId':_0x565a09['id'],'type':_0x327cce[_0xb4c8('0x1a')],'sectionId':_0x327cce['id']},{})['then'](function(){return _0x5a0816;});}else{return _0x5a0816;}})[_0xb4c8('0x31')](function(_0x59db89){logger[_0xb4c8('0x18')](_0xb4c8('0x40'),_0x59db89);throw _0x59db89;});}return _0x5a0816;})[_0xb4c8('0x10')](respondWithResult(_0x2075a4,0xc9))[_0xb4c8('0x31')](handleError(_0x2075a4,null));};exports[_0xb4c8('0xf')]=function(_0x2226a8,_0x9ed270){if(_0x2226a8[_0xb4c8('0x41')]['id']){delete _0x2226a8['body']['id'];}return db[_0xb4c8('0x30')][_0xb4c8('0x39')]({'where':{'id':_0x2226a8[_0xb4c8('0x33')]['id']}})['then'](handleEntityNotFound(_0x9ed270,null))[_0xb4c8('0x10')](saveUpdates(_0x2226a8[_0xb4c8('0x41')],null))['then'](function(_0x28105f){if(!_0x28105f)return;var _0x40e8ad=_0x28105f[_0xb4c8('0x3b')]({'plain':!![]});return _0x40e8ad;})[_0xb4c8('0x10')](function(_0x4df766){var _0x452514=new Redis(config['redis']);_0x452514[_0xb4c8('0x42')]('agi',JSON[_0xb4c8('0x15')](_[_0xb4c8('0x2a')](_0x4df766,['id','name',_0xb4c8('0x43')])));return _0x4df766;})[_0xb4c8('0x10')](respondWithResult(_0x9ed270,null))[_0xb4c8('0x31')](handleError(_0x9ed270,null));};exports[_0xb4c8('0x11')]=function(_0xa11f7c,_0x37cfd2){return db['SquareProject'][_0xb4c8('0x39')]({'where':{'id':_0xa11f7c[_0xb4c8('0x33')]['id']}})[_0xb4c8('0x10')](handleEntityNotFound(_0x37cfd2,null))[_0xb4c8('0x10')](removeEntity(_0x37cfd2,null))[_0xb4c8('0x31')](handleError(_0x37cfd2,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index b2e990a..c270c47 100644 --- a/server/api/squareProject/squareProject.events.js +++ b/server/api/squareProject/squareProject.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b49=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x6b49,0x102));var _0x96b4=function(_0x9b3efc,_0x577a0d){_0x9b3efc=_0x9b3efc-0x0;var _0x200f05=_0x6b49[_0x9b3efc];return _0x200f05;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x96b4('0x0'))['db'][_0x96b4('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x96b4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x96b4('0x3'),'afterDestroy':_0x96b4('0x4')};function emitEvent(_0x21b98b){return function(_0x36a4ab,_0x33862e,_0x134be4){SquareProjectEvents[_0x96b4('0x5')](_0x21b98b+':'+_0x36a4ab['id'],_0x36a4ab);SquareProjectEvents[_0x96b4('0x5')](_0x21b98b,_0x36a4ab);_0x134be4(null);};}for(var e in events){if(events[_0x96b4('0x6')](e)){var event=events[e];SquareProject[_0x96b4('0x7')](e,emitEvent(event));}}module[_0x96b4('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xf875=['emit','hook','exports','events','SquareProject','setMaxListeners','save','update','remove'];(function(_0x4bbcc1,_0x594e19){var _0x34435b=function(_0x124582){while(--_0x124582){_0x4bbcc1['push'](_0x4bbcc1['shift']());}};_0x34435b(++_0x594e19);}(_0xf875,0x9c));var _0x5f87=function(_0x19c475,_0x5d3305){_0x19c475=_0x19c475-0x0;var _0x35176d=_0xf875[_0x19c475];return _0x35176d;};'use strict';var EventEmitter=require(_0x5f87('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x5f87('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x5f87('0x2')](0x0);var events={'afterCreate':_0x5f87('0x3'),'afterUpdate':_0x5f87('0x4'),'afterDestroy':_0x5f87('0x5')};function emitEvent(_0x1f2b29){return function(_0xd22cd1,_0x27094c,_0x225ab7){SquareProjectEvents[_0x5f87('0x6')](_0x1f2b29+':'+_0xd22cd1['id'],_0xd22cd1);SquareProjectEvents[_0x5f87('0x6')](_0x1f2b29,_0xd22cd1);_0x225ab7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x5f87('0x7')](e,emitEvent(event));}}module[_0x5f87('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 5273f49..f1e5f9e 100644 --- a/server/api/squareProject/squareProject.model.js +++ b/server/api/squareProject/squareProject.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1851=['SquareProject','square_projects','changed','preproduction','savedAt','production','format','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./squareProject.attributes','exports','define'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x1851,0x6d));var _0x1185=function(_0x48bdeb,_0x165e0c){_0x48bdeb=_0x48bdeb-0x0;var _0x378dfc=_0x1851[_0x48bdeb];return _0x378dfc;};'use strict';var _=require('lodash');var util=require(_0x1185('0x0'));var logger=require(_0x1185('0x1'))(_0x1185('0x2'));var moment=require(_0x1185('0x3'));var BPromise=require('bluebird');var rp=require(_0x1185('0x4'));var fs=require('fs');var path=require(_0x1185('0x5'));var rimraf=require('rimraf');var config=require(_0x1185('0x6'));var attributes=require(_0x1185('0x7'));module[_0x1185('0x8')]=function(_0x29da93,_0x567e4b){return _0x29da93[_0x1185('0x9')](_0x1185('0xa'),attributes,{'tableName':_0x1185('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42a91d,_0xa68b3f,_0xd01147){if(_0x42a91d[_0x1185('0xc')](_0x1185('0xd'))){_0x42a91d[_0x1185('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x42a91d[_0x1185('0xc')](_0x1185('0xf'))){_0x42a91d['publishedAt']=moment()[_0x1185('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0xd01147(null,_0x42a91d);}}});}; \ No newline at end of file +var _0xa782=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareProject','square_projects','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util'];(function(_0x4ecb58,_0x233093){var _0x578d45=function(_0x35ba88){while(--_0x35ba88){_0x4ecb58['push'](_0x4ecb58['shift']());}};_0x578d45(++_0x233093);}(_0xa782,0xb2));var _0x2a78=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xa782[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x2a78('0x0'));var util=require(_0x2a78('0x1'));var logger=require(_0x2a78('0x2'))(_0x2a78('0x3'));var moment=require(_0x2a78('0x4'));var BPromise=require(_0x2a78('0x5'));var rp=require(_0x2a78('0x6'));var fs=require('fs');var path=require(_0x2a78('0x7'));var rimraf=require(_0x2a78('0x8'));var config=require(_0x2a78('0x9'));var attributes=require('./squareProject.attributes');module[_0x2a78('0xa')]=function(_0xe1e284,_0x1f8fbb){return _0xe1e284[_0x2a78('0xb')](_0x2a78('0xc'),attributes,{'tableName':_0x2a78('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xa5c989,_0x39b661,_0x2b1623){if(_0xa5c989[_0x2a78('0xe')]('preproduction')){_0xa5c989[_0x2a78('0xf')]=moment()[_0x2a78('0x10')](_0x2a78('0x11'));}if(_0xa5c989[_0x2a78('0xe')](_0x2a78('0x12'))){_0xa5c989[_0x2a78('0x13')]=moment()[_0x2a78('0x10')](_0x2a78('0x11'));}_0x2b1623(null,_0xa5c989);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index a8419d1..d6349f5 100644 --- a/server/api/squareProject/squareProject.rpc.js +++ b/server/api/squareProject/squareProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9688=['defaults','redis','localhost','socket.io-emitter','register','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','limit','include','model','map','info','debug','stringify','error','message','find','ShowSquareProject','ioredis','../../config/logger','../../config/environment'];(function(_0x2aba2a,_0x45115d){var _0x51fb60=function(_0x3dae16){while(--_0x3dae16){_0x2aba2a['push'](_0x2aba2a['shift']());}};_0x51fb60(++_0x45115d);}(_0x9688,0xb3));var _0x8968=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x9688[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var Redis=require(_0x8968('0x0'));var db=require('../../mysqldb')['db'];var logger=require(_0x8968('0x1'))('rpc');var config=require(_0x8968('0x2'));config['redis']=_[_0x8968('0x3')](config[_0x8968('0x4')],{'host':_0x8968('0x5'),'port':0x18eb});var socket=require(_0x8968('0x6'))(new Redis(config['redis']));require('./squareProject.socket')[_0x8968('0x7')](socket);exports[_0x8968('0x8')]=function(_0x1c2ebe){var _0x57873b=this;return new Promise(function(_0xd93507,_0x81d15f){return db[_0x8968('0x9')][_0x8968('0xa')]({'raw':_0x1c2ebe['options']?_0x1c2ebe[_0x8968('0xb')][_0x8968('0xc')]===undefined?!![]:![]:!![],'where':_0x1c2ebe[_0x8968('0xb')]?_0x1c2ebe['options'][_0x8968('0xd')]||null:null,'attributes':_0x1c2ebe[_0x8968('0xb')]?_0x1c2ebe['options'][_0x8968('0xe')]||null:null,'limit':_0x1c2ebe[_0x8968('0xb')]?_0x1c2ebe[_0x8968('0xb')][_0x8968('0xf')]||null:null,'include':_0x1c2ebe['options']?_0x1c2ebe[_0x8968('0xb')][_0x8968('0x10')]?_['map'](_0x1c2ebe[_0x8968('0xb')][_0x8968('0x10')],function(_0x181a1b){return{'model':db[_0x181a1b[_0x8968('0x11')]],'as':_0x181a1b['as'],'attributes':_0x181a1b[_0x8968('0xe')],'include':_0x181a1b[_0x8968('0x10')]?_[_0x8968('0x12')](_0x181a1b[_0x8968('0x10')],function(_0x5c40cf){return{'model':db[_0x5c40cf[_0x8968('0x11')]],'as':_0x5c40cf['as'],'attributes':_0x5c40cf['attributes'],'include':_0x5c40cf[_0x8968('0x10')]?_[_0x8968('0x12')](_0x5c40cf[_0x8968('0x10')],function(_0x161ab5){return{'model':db[_0x161ab5['model']],'as':_0x161ab5['as'],'attributes':_0x161ab5[_0x8968('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x274751){logger[_0x8968('0x13')](_0x8968('0x8'),_0x1c2ebe);logger[_0x8968('0x14')](_0x8968('0x8'),_0x1c2ebe,JSON[_0x8968('0x15')](_0x274751));_0xd93507(_0x274751);})['catch'](function(_0x1723bf){logger[_0x8968('0x16')](_0x8968('0x8'),_0x1723bf[_0x8968('0x17')],_0x1c2ebe);_0x81d15f(_0x57873b['error'](0x1f4,_0x1723bf[_0x8968('0x17')]));});});};exports['ShowSquareProject']=function(_0x1ad5bf){var _0x8b4e18=this;return new Promise(function(_0x23d255,_0xa2e955){return db['SquareProject'][_0x8968('0x18')]({'raw':_0x1ad5bf[_0x8968('0xb')]?_0x1ad5bf['options']['raw']===undefined?!![]:![]:!![],'where':_0x1ad5bf[_0x8968('0xb')]?_0x1ad5bf[_0x8968('0xb')][_0x8968('0xd')]||null:null,'attributes':_0x1ad5bf[_0x8968('0xb')]?_0x1ad5bf[_0x8968('0xb')]['attributes']||null:null,'include':_0x1ad5bf[_0x8968('0xb')]?_0x1ad5bf[_0x8968('0xb')][_0x8968('0x10')]?_[_0x8968('0x12')](_0x1ad5bf[_0x8968('0xb')][_0x8968('0x10')],function(_0x58a1d6){return{'model':db[_0x58a1d6['model']],'as':_0x58a1d6['as'],'attributes':_0x58a1d6[_0x8968('0xe')],'include':_0x58a1d6[_0x8968('0x10')]?_[_0x8968('0x12')](_0x58a1d6[_0x8968('0x10')],function(_0x41d228){return{'model':db[_0x41d228[_0x8968('0x11')]],'as':_0x41d228['as'],'attributes':_0x41d228[_0x8968('0xe')],'include':_0x41d228['include']?_[_0x8968('0x12')](_0x41d228[_0x8968('0x10')],function(_0x3db3de){return{'model':db[_0x3db3de[_0x8968('0x11')]],'as':_0x3db3de['as'],'attributes':_0x3db3de[_0x8968('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f0580){logger[_0x8968('0x13')]('ShowSquareProject',_0x1ad5bf);logger[_0x8968('0x14')](_0x8968('0x19'),_0x1ad5bf,JSON['stringify'](_0x5f0580));_0x23d255(_0x5f0580);})['catch'](function(_0x3e71e2){logger[_0x8968('0x16')](_0x8968('0x19'),_0x3e71e2[_0x8968('0x17')],_0x1ad5bf);_0xa2e955(_0x8b4e18[_0x8968('0x16')](0x1f4,_0x3e71e2[_0x8968('0x17')]));});});}; \ No newline at end of file +var _0xe8d5=['where','attributes','include','map','model','then','info','debug','catch','message','error','find','ShowSquareProject','stringify','lodash','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','./squareProject.socket','register','GetSquareProjects','SquareProject','options','raw'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe8d5,0x101));var _0x5e8d=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xe8d5[_0x342700];return _0x53406f;};'use strict';var _=require(_0x5e8d('0x0'));var Redis=require('ioredis');var db=require(_0x5e8d('0x1'))['db'];var logger=require(_0x5e8d('0x2'))(_0x5e8d('0x3'));var config=require(_0x5e8d('0x4'));config[_0x5e8d('0x5')]=_[_0x5e8d('0x6')](config[_0x5e8d('0x5')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5e8d('0x5')]));require(_0x5e8d('0x7'))[_0x5e8d('0x8')](socket);exports[_0x5e8d('0x9')]=function(_0x58c60a){var _0x231256=this;return new Promise(function(_0xaa4493,_0x38432f){return db[_0x5e8d('0xa')]['findAll']({'raw':_0x58c60a[_0x5e8d('0xb')]?_0x58c60a[_0x5e8d('0xb')][_0x5e8d('0xc')]===undefined?!![]:![]:!![],'where':_0x58c60a['options']?_0x58c60a[_0x5e8d('0xb')][_0x5e8d('0xd')]||null:null,'attributes':_0x58c60a[_0x5e8d('0xb')]?_0x58c60a['options'][_0x5e8d('0xe')]||null:null,'limit':_0x58c60a[_0x5e8d('0xb')]?_0x58c60a['options']['limit']||null:null,'include':_0x58c60a[_0x5e8d('0xb')]?_0x58c60a[_0x5e8d('0xb')][_0x5e8d('0xf')]?_[_0x5e8d('0x10')](_0x58c60a[_0x5e8d('0xb')][_0x5e8d('0xf')],function(_0x3c7114){return{'model':db[_0x3c7114[_0x5e8d('0x11')]],'as':_0x3c7114['as'],'attributes':_0x3c7114[_0x5e8d('0xe')],'include':_0x3c7114[_0x5e8d('0xf')]?_[_0x5e8d('0x10')](_0x3c7114[_0x5e8d('0xf')],function(_0x20af10){return{'model':db[_0x20af10[_0x5e8d('0x11')]],'as':_0x20af10['as'],'attributes':_0x20af10[_0x5e8d('0xe')],'include':_0x20af10['include']?_[_0x5e8d('0x10')](_0x20af10[_0x5e8d('0xf')],function(_0x59dcb6){return{'model':db[_0x59dcb6[_0x5e8d('0x11')]],'as':_0x59dcb6['as'],'attributes':_0x59dcb6['attributes']};}):[]};}):[]};}):[]:[]})[_0x5e8d('0x12')](function(_0x4217d9){logger[_0x5e8d('0x13')](_0x5e8d('0x9'),_0x58c60a);logger[_0x5e8d('0x14')](_0x5e8d('0x9'),_0x58c60a,JSON['stringify'](_0x4217d9));_0xaa4493(_0x4217d9);})[_0x5e8d('0x15')](function(_0x1bcccd){logger['error']('GetSquareProjects',_0x1bcccd[_0x5e8d('0x16')],_0x58c60a);_0x38432f(_0x231256[_0x5e8d('0x17')](0x1f4,_0x1bcccd[_0x5e8d('0x16')]));});});};exports['ShowSquareProject']=function(_0x3a2ac1){var _0x2aece7=this;return new Promise(function(_0x1e9aa8,_0x42f67a){return db[_0x5e8d('0xa')][_0x5e8d('0x18')]({'raw':_0x3a2ac1[_0x5e8d('0xb')]?_0x3a2ac1[_0x5e8d('0xb')][_0x5e8d('0xc')]===undefined?!![]:![]:!![],'where':_0x3a2ac1['options']?_0x3a2ac1['options'][_0x5e8d('0xd')]||null:null,'attributes':_0x3a2ac1[_0x5e8d('0xb')]?_0x3a2ac1[_0x5e8d('0xb')][_0x5e8d('0xe')]||null:null,'include':_0x3a2ac1[_0x5e8d('0xb')]?_0x3a2ac1[_0x5e8d('0xb')][_0x5e8d('0xf')]?_['map'](_0x3a2ac1[_0x5e8d('0xb')][_0x5e8d('0xf')],function(_0x3badba){return{'model':db[_0x3badba[_0x5e8d('0x11')]],'as':_0x3badba['as'],'attributes':_0x3badba['attributes'],'include':_0x3badba[_0x5e8d('0xf')]?_[_0x5e8d('0x10')](_0x3badba[_0x5e8d('0xf')],function(_0x417715){return{'model':db[_0x417715['model']],'as':_0x417715['as'],'attributes':_0x417715['attributes'],'include':_0x417715[_0x5e8d('0xf')]?_[_0x5e8d('0x10')](_0x417715[_0x5e8d('0xf')],function(_0xc9b9c7){return{'model':db[_0xc9b9c7[_0x5e8d('0x11')]],'as':_0xc9b9c7['as'],'attributes':_0xc9b9c7[_0x5e8d('0xe')]};}):[]};}):[]};}):[]:[]})[_0x5e8d('0x12')](function(_0x48dc4c){logger[_0x5e8d('0x13')](_0x5e8d('0x19'),_0x3a2ac1);logger[_0x5e8d('0x14')](_0x5e8d('0x19'),_0x3a2ac1,JSON[_0x5e8d('0x1a')](_0x48dc4c));_0x1e9aa8(_0x48dc4c);})['catch'](function(_0xac3094){logger['error'](_0x5e8d('0x19'),_0xac3094['message'],_0x3a2ac1);_0x42f67a(_0x2aece7['error'](0x1f4,_0xac3094[_0x5e8d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index e524bdb..cf66987 100644 --- a/server/api/squareProject/squareProject.socket.js +++ b/server/api/squareProject/squareProject.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52af=['emit','register','length','squareProject:','./squareProject.events','update'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x52af,0x11e));var _0xf52a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x52af[_0x57b54c];return _0x59cc19;};'use strict';var SquareProjectEvents=require(_0xf52a('0x0'));var events=['save','remove',_0xf52a('0x1')];function createListener(_0x3229dc,_0x343f22){return function(_0x3ae6ad){_0x343f22[_0xf52a('0x2')](_0x3229dc,_0x3ae6ad);};}function removeListener(_0x2a9088,_0x2425e4){return function(){SquareProjectEvents['removeListener'](_0x2a9088,_0x2425e4);};}exports[_0xf52a('0x3')]=function(_0x47ea48){for(var _0x38185b=0x0,_0x3cc59c=events[_0xf52a('0x4')];_0x38185b<_0x3cc59c;_0x38185b++){var _0x27ac24=events[_0x38185b];var _0x3001ff=createListener(_0xf52a('0x5')+_0x27ac24,_0x47ea48);SquareProjectEvents['on'](_0x27ac24,_0x3001ff);}}; \ No newline at end of file +var _0xecb7=['emit','removeListener','register','squareProject:','./squareProject.events','save','remove','update'];(function(_0x7a3d34,_0x4ec2fe){var _0x56f88e=function(_0xd03ab7){while(--_0xd03ab7){_0x7a3d34['push'](_0x7a3d34['shift']());}};_0x56f88e(++_0x4ec2fe);}(_0xecb7,0xfc));var _0x7ecb=function(_0x541014,_0x1d48da){_0x541014=_0x541014-0x0;var _0x907761=_0xecb7[_0x541014];return _0x907761;};'use strict';var SquareProjectEvents=require(_0x7ecb('0x0'));var events=[_0x7ecb('0x1'),_0x7ecb('0x2'),_0x7ecb('0x3')];function createListener(_0x424414,_0x12c983){return function(_0x1027bb){_0x12c983[_0x7ecb('0x4')](_0x424414,_0x1027bb);};}function removeListener(_0x33a702,_0x35b284){return function(){SquareProjectEvents[_0x7ecb('0x5')](_0x33a702,_0x35b284);};}exports[_0x7ecb('0x6')]=function(_0x5808d9){for(var _0x3b2b26=0x0,_0x46e381=events['length'];_0x3b2b26<_0x46e381;_0x3b2b26++){var _0x601c5b=events[_0x3b2b26];var _0x20e379=createListener(_0x7ecb('0x7')+_0x601c5b,_0x5808d9);SquareProjectEvents['on'](_0x601c5b,_0x20e379);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index e8ab8e3..cb41db9 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x146042,_0x118faf){var _0x4d428b=function(_0x5d9431){while(--_0x5d9431){_0x146042['push'](_0x146042['shift']());}};_0x4d428b(++_0x118faf);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file +var _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x529f9b,_0xd9c490){var _0xa93f50=function(_0x145e81){while(--_0x145e81){_0x529f9b['push'](_0x529f9b['shift']());}};_0xa93f50(++_0xd9c490);}(_0x5fc3,0xa8));var _0x35fc=function(_0x16337a,_0x4789a1){_0x16337a=_0x16337a-0x0;var _0x422365=_0x5fc3[_0x16337a];return _0x422365;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 2db1c12..982c395 100644 --- a/server/api/squareRecording/squareRecording.attributes.js +++ b/server/api/squareRecording/squareRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['VIRTUAL','savePath','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x17cccf,_0x4bc109){var _0x36f8f1=function(_0x2421e1){while(--_0x2421e1){_0x17cccf['push'](_0x17cccf['shift']());}};_0x36f8f1(++_0x4bc109);}(_0x8ef6,0xf2));var _0x68ef=function(_0x25f7d8,_0x21c2a1){_0x25f7d8=_0x25f7d8-0x0;var _0x1e0ca5=_0x8ef6[_0x25f7d8];return _0x1e0ca5;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'uniqueid':{'type':Sequelize[_0x68ef('0x2')]},'callerid':{'type':Sequelize[_0x68ef('0x2')]},'calleridname':{'type':Sequelize[_0x68ef('0x2')]},'context':{'type':Sequelize[_0x68ef('0x2')]},'extension':{'type':Sequelize[_0x68ef('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x68ef('0x2')]},'dnid':{'type':Sequelize[_0x68ef('0x2')]},'projectName':{'type':Sequelize[_0x68ef('0x2')]},'saveName':{'type':Sequelize[_0x68ef('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x68ef('0x3')],'get':function(){var _0x4740e8='';var _0x2de776=this['getDataValue'](_0x68ef('0x4'));if(_0x2de776){_0x4740e8=_0x2de776[_0x68ef('0x5')](_0x2de776[_0x68ef('0x6')]('.'));}return _0x4740e8;}}}; \ No newline at end of file +var _0x326f=['getDataValue','sequelize','STRING','VIRTUAL'];(function(_0xa037a9,_0x1a82b8){var _0x44e03b=function(_0x16efc7){while(--_0x16efc7){_0xa037a9['push'](_0xa037a9['shift']());}};_0x44e03b(++_0x1a82b8);}(_0x326f,0xd1));var _0xf326=function(_0x4444c7,_0x5abd68){_0x4444c7=_0x4444c7-0x0;var _0x1e5c75=_0x326f[_0x4444c7];return _0x1e5c75;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xf326('0x1')]},'calleridname':{'type':Sequelize[_0xf326('0x1')]},'context':{'type':Sequelize[_0xf326('0x1')]},'extension':{'type':Sequelize[_0xf326('0x1')]},'priority':{'type':Sequelize[_0xf326('0x1')]},'accountcode':{'type':Sequelize[_0xf326('0x1')]},'dnid':{'type':Sequelize[_0xf326('0x1')]},'projectName':{'type':Sequelize[_0xf326('0x1')]},'saveName':{'type':Sequelize[_0xf326('0x1')]},'filename':{'type':Sequelize[_0xf326('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xf326('0x2')],'get':function(){var _0x3851eb='';var _0x165f95=this[_0xf326('0x3')]('savePath');if(_0x165f95){_0x3851eb=_0x165f95['substring'](_0x165f95['lastIndexOf']('.'));}return _0x3851eb;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index ad8c0a7..b3c36df 100644 --- a/server/api/squareRecording/squareRecording.controller.js +++ b/server/api/squareRecording/squareRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x314d=['download','../../components/encryptor','savePath','format','%s.cypher','decryptFile','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','Not\x20found','Entity\x20not\x20found','info','isNil','unlinkSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','SquareRecording','model','map','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','rows','catch','show','params','rawAttributes','fields','find','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x314d,0xcf));var _0xd314=function(_0x25a36c,_0x325726){_0x25a36c=_0x25a36c-0x0;var _0x13cb6f=_0x314d[_0x25a36c];return _0x13cb6f;};'use strict';var emlformat=require(_0xd314('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd314('0x1'));var rp=require(_0xd314('0x2'));var moment=require(_0xd314('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd314('0x4'));var util=require('util');var path=require(_0xd314('0x5'));var sox=require(_0xd314('0x6'));var csv=require(_0xd314('0x7'));var ejs=require(_0xd314('0x8'));var fs=require('fs');var fs_extra=require(_0xd314('0x9'));var _=require(_0xd314('0xa'));var squel=require(_0xd314('0xb'));var crypto=require(_0xd314('0xc'));var jsforce=require(_0xd314('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd314('0x7'));var querystring=require(_0xd314('0xe'));var Papa=require(_0xd314('0xf'));var Redis=require(_0xd314('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd314('0x11'));var logger=require('../../config/logger')(_0xd314('0x12'));var utils=require(_0xd314('0x13'));var config=require(_0xd314('0x14'));var licenseUtil=require(_0xd314('0x15'));var db=require(_0xd314('0x16'))['db'];function respondWithStatusCode(_0x2838f,_0x4e2c9c){_0x4e2c9c=_0x4e2c9c||0xcc;return function(_0x1a1bae){if(_0x1a1bae){return _0x2838f[_0xd314('0x17')](_0x4e2c9c);}return _0x2838f[_0xd314('0x18')](_0x4e2c9c)[_0xd314('0x19')]();};}function respondWithResult(_0x5ac0c9,_0x113477){_0x113477=_0x113477||0xc8;return function(_0x5ab71a){if(_0x5ab71a){return _0x5ac0c9[_0xd314('0x18')](_0x113477)[_0xd314('0x1a')](_0x5ab71a);}};}function respondWithFilteredResult(_0x5c1a2b,_0x122462){return function(_0x2726c0){if(_0x2726c0){var _0x45579c=typeof _0x122462[_0xd314('0x1b')]===_0xd314('0x1c')&&typeof _0x122462[_0xd314('0x1d')]==='undefined';var _0x52c636=_0x2726c0[_0xd314('0x1e')];var _0x2e57d6=_0x45579c?0x0:_0x122462[_0xd314('0x1b')];var _0x222393=_0x45579c?_0x2726c0[_0xd314('0x1e')]:_0x122462['offset']+_0x122462[_0xd314('0x1d')];var _0x13ba57;if(_0x222393>=_0x52c636){_0x222393=_0x52c636;_0x13ba57=0xc8;}else{_0x13ba57=0xce;}_0x5c1a2b[_0xd314('0x18')](_0x13ba57);return _0x5c1a2b[_0xd314('0x1f')](_0xd314('0x20'),_0x2e57d6+'-'+_0x222393+'/'+_0x52c636)[_0xd314('0x1a')](_0x2726c0);}return null;};}function patchUpdates(_0x5acb4b){return function(_0x161683){try{jsonpatch[_0xd314('0x21')](_0x161683,_0x5acb4b,!![]);}catch(_0x92d613){return BPromise[_0xd314('0x22')](_0x92d613);}return _0x161683['save']();};}function saveUpdates(_0x2a6809,_0x103d45){return function(_0x4dbc4f){if(_0x4dbc4f){return _0x4dbc4f['update'](_0x2a6809)['then'](function(_0x14edec){return _0x14edec;});}return null;};}function removeEntity(_0x58630c,_0xed3071){return function(_0x294691){if(_0x294691){return _0x294691[_0xd314('0x23')]()[_0xd314('0x24')](function(){_0x58630c[_0xd314('0x18')](0xcc)[_0xd314('0x19')]();});}};}function handleEntityNotFound(_0x1b36ca,_0x2cd717){return function(_0x45ebd4){if(!_0x45ebd4){_0x1b36ca['sendStatus'](0x194);}return _0x45ebd4;};}function handleError(_0x3e7542,_0x12bed7){_0x12bed7=_0x12bed7||0x1f4;return function(_0x46e0ed){logger[_0xd314('0x25')](_0x46e0ed[_0xd314('0x26')]);if(_0x46e0ed[_0xd314('0x27')]){delete _0x46e0ed[_0xd314('0x27')];}_0x3e7542[_0xd314('0x18')](_0x12bed7)[_0xd314('0x28')](_0x46e0ed);};}exports[_0xd314('0x29')]=function(_0x385c0a,_0x1dd77a){var _0x1bad35={},_0x3f9754={},_0x447709={'count':0x0,'rows':[]};var _0xc05ab2=_['map'](db[_0xd314('0x2a')]['rawAttributes'],function(_0xfcd36e){return{'name':_0xfcd36e['fieldName'],'type':_0xfcd36e['type']['key']};});_0x3f9754[_0xd314('0x2b')]=_[_0xd314('0x2c')](_0xc05ab2,_0xd314('0x27'));_0x3f9754['query']=_[_0xd314('0x2d')](_0x385c0a[_0xd314('0x2e')]);_0x3f9754[_0xd314('0x2f')]=_['intersection'](_0x3f9754[_0xd314('0x2b')],_0x3f9754[_0xd314('0x2e')]);_0x1bad35[_0xd314('0x30')]=_[_0xd314('0x31')](_0x3f9754[_0xd314('0x2b')],qs['fields'](_0x385c0a['query']['fields']));_0x1bad35[_0xd314('0x30')]=_0x1bad35[_0xd314('0x30')][_0xd314('0x32')]?_0x1bad35[_0xd314('0x30')]:_0x3f9754[_0xd314('0x2b')];if(!_0x385c0a[_0xd314('0x2e')][_0xd314('0x33')](_0xd314('0x34'))){_0x1bad35[_0xd314('0x1d')]=qs[_0xd314('0x1d')](_0x385c0a[_0xd314('0x2e')][_0xd314('0x1d')]);_0x1bad35[_0xd314('0x1b')]=qs[_0xd314('0x1b')](_0x385c0a['query'][_0xd314('0x1b')]);}_0x1bad35[_0xd314('0x35')]=qs[_0xd314('0x36')](_0x385c0a['query'][_0xd314('0x36')]);_0x1bad35['where']=qs[_0xd314('0x2f')](_[_0xd314('0x37')](_0x385c0a[_0xd314('0x2e')],_0x3f9754[_0xd314('0x2f')]),_0xc05ab2);if(_0x385c0a[_0xd314('0x2e')][_0xd314('0x38')]){_0x1bad35[_0xd314('0x39')]=_[_0xd314('0x3a')](_0x1bad35[_0xd314('0x39')],{'$or':_[_0xd314('0x2c')](_0xc05ab2,function(_0x4bfd31){if(_0x4bfd31[_0xd314('0x3b')]!=='VIRTUAL'){var _0x322c9f={};_0x322c9f[_0x4bfd31[_0xd314('0x27')]]={'$like':'%'+_0x385c0a[_0xd314('0x2e')][_0xd314('0x38')]+'%'};return _0x322c9f;}})});}_0x1bad35=_[_0xd314('0x3a')]({},_0x1bad35,_0x385c0a[_0xd314('0x3c')]);var _0x5a267c={'where':_0x1bad35['where']};return db[_0xd314('0x2a')][_0xd314('0x1e')](_0x5a267c)[_0xd314('0x24')](function(_0x4b965b){_0x447709['count']=_0x4b965b;if(_0x385c0a[_0xd314('0x2e')][_0xd314('0x3d')]){_0x1bad35[_0xd314('0x3e')]=[{'all':!![]}];}return db[_0xd314('0x2a')]['findAll'](_0x1bad35);})['then'](function(_0x4d3f92){_0x447709[_0xd314('0x3f')]=_0x4d3f92;return _0x447709;})[_0xd314('0x24')](respondWithFilteredResult(_0x1dd77a,_0x1bad35))[_0xd314('0x40')](handleError(_0x1dd77a,null));};exports[_0xd314('0x41')]=function(_0x3ad64b,_0x52387f){var _0x5b86cc={'raw':!![],'where':{'id':_0x3ad64b[_0xd314('0x42')]['id']}},_0x5dc8d8={};_0x5dc8d8['model']=_[_0xd314('0x2d')](db[_0xd314('0x2a')][_0xd314('0x43')]);_0x5dc8d8[_0xd314('0x2e')]=_[_0xd314('0x2d')](_0x3ad64b[_0xd314('0x2e')]);_0x5dc8d8[_0xd314('0x2f')]=_[_0xd314('0x31')](_0x5dc8d8[_0xd314('0x2b')],_0x5dc8d8[_0xd314('0x2e')]);_0x5b86cc['attributes']=_[_0xd314('0x31')](_0x5dc8d8[_0xd314('0x2b')],qs[_0xd314('0x44')](_0x3ad64b[_0xd314('0x2e')][_0xd314('0x44')]));_0x5b86cc[_0xd314('0x30')]=_0x5b86cc[_0xd314('0x30')]['length']?_0x5b86cc['attributes']:_0x5dc8d8[_0xd314('0x2b')];if(_0x3ad64b['query'][_0xd314('0x3d')]){_0x5b86cc['include']=[{'all':!![]}];}_0x5b86cc=_['merge']({},_0x5b86cc,_0x3ad64b['options']);return db[_0xd314('0x2a')][_0xd314('0x45')](_0x5b86cc)['then'](handleEntityNotFound(_0x52387f,null))['then'](respondWithResult(_0x52387f,null))['catch'](handleError(_0x52387f,null));};exports[_0xd314('0x46')]=function(_0x4954f6,_0x1853e8){return db['SquareRecording'][_0xd314('0x46')](_0x4954f6['body'],{})[_0xd314('0x24')](respondWithResult(_0x1853e8,0xc9))[_0xd314('0x40')](handleError(_0x1853e8,null));};exports['update']=function(_0x5047c4,_0xb5cd5c){if(_0x5047c4[_0xd314('0x47')]['id']){delete _0x5047c4[_0xd314('0x47')]['id'];}return db[_0xd314('0x2a')]['find']({'where':{'id':_0x5047c4[_0xd314('0x42')]['id']}})[_0xd314('0x24')](handleEntityNotFound(_0xb5cd5c,null))[_0xd314('0x24')](saveUpdates(_0x5047c4[_0xd314('0x47')],null))['then'](respondWithResult(_0xb5cd5c,null))[_0xd314('0x40')](handleError(_0xb5cd5c,null));};exports[_0xd314('0x48')]=function(_0x29ddaf,_0x51fa39,_0x5872a8){var _0x2a7626=require(_0xd314('0x49'));var _0x19c394=![];var _0x2a071e={};if(_0x29ddaf[_0xd314('0x2e')][_0xd314('0x3b')]&&_0x29ddaf['query'][_0xd314('0x3b')]==='uniqueid'){_0x2a071e['uniqueid']=_0x29ddaf[_0xd314('0x42')]['id'];}else{_0x2a071e['id']=_0x29ddaf[_0xd314('0x42')]['id'];}return db['SquareRecording'][_0xd314('0x45')]({'where':_0x2a071e,'attributes':['id',_0xd314('0x4a'),'filename'],'raw':!![]})[_0xd314('0x24')](handleEntityNotFound(_0x51fa39,null))['then'](function(_0x11a6cd){if(_0x11a6cd){var _0x5b4676=_0x11a6cd[_0xd314('0x4a')];var _0x3e8897=util[_0xd314('0x4b')](_0xd314('0x4c'),_0x5b4676);if(fs['existsSync'](_0x3e8897)){_0x19c394=!![];return _0x2a7626[_0xd314('0x4d')](_0x3e8897,_0x5b4676,config['secrets'][_0xd314('0x4e')])['then'](function(){return _0x11a6cd;});}return _0x11a6cd;}})[_0xd314('0x24')](function(_0x5e6605){if(_0x5e6605){var _0x60070a=_0x5e6605[_0xd314('0x4a')];if(!fs[_0xd314('0x4f')](_0x60070a)){throw new db[(_0xd314('0x50'))][(_0xd314('0x51'))](_0xd314('0x52'));}if(_0x5e6605[_0xd314('0x53')]){return _0x51fa39[_0xd314('0x48')](_0x60070a,_0x5e6605[_0xd314('0x53')]+path[_0xd314('0x54')](_0x60070a),function(){if(_0x19c394){fs[_0xd314('0x55')](_0x60070a);}});}else{return _0x51fa39[_0xd314('0x48')](_0x60070a,function(_0x5acd14){if(_0x19c394){fs[_0xd314('0x55')](_0x60070a);}});}}})[_0xd314('0x40')](function(_0x44d569){if(_0x44d569['message']==='SquareRecording\x20not\x20found'){_0x51fa39[_0xd314('0x18')](0x194)[_0xd314('0x28')](_0xd314('0x56'));}else{return handleError(_0x51fa39,null);}});};exports[_0xd314('0x23')]=function(_0x2cb220,_0x88b9b5){return db['SquareRecording']['find']({'where':{'id':_0x2cb220[_0xd314('0x42')]['id']}})[_0xd314('0x24')](function(_0x5eafef){if(_['isNil'](_0x5eafef)){throw new ReferenceError(_0xd314('0x57'));}return _0x5eafef;})[_0xd314('0x24')](function(_0x27cd93){var _0x336de2=_0x27cd93[_0xd314('0x4a')];logger[_0xd314('0x58')]('cancellazione\x20fisica\x20documento\x20%s',_0x336de2);if(!_[_0xd314('0x59')](_0x27cd93[_0xd314('0x4a')])&&fs[_0xd314('0x4f')](_0x336de2)){logger[_0xd314('0x58')]('File:\x20\x22'+_0x336de2+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd314('0x5a')](_0x336de2);}_0x336de2=_0x336de2+'.cypher';if(!_[_0xd314('0x59')](_0x27cd93[_0xd314('0x4a')])&&fs[_0xd314('0x4f')](_0x336de2)){logger[_0xd314('0x58')](_0xd314('0x5b')+_0x336de2+_0xd314('0x5c'));fs['unlinkSync'](_0x336de2);}return _0x27cd93;})[_0xd314('0x24')](function(_0x2ac354){if(!_0x2ac354)throw new InternalError();return _0x2ac354[_0xd314('0x23')]();})[_0xd314('0x24')](function(){_0x88b9b5[_0xd314('0x18')](0xcc)[_0xd314('0x19')]();})[_0xd314('0x40')](handleError(_0x88b9b5,null));}; \ No newline at end of file +var _0xb0a7=['download','uniqueid','savePath','filename','format','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','extname','unlink','SquareRecording\x20not\x20found','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','unlinkSync','.cypher','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','fast-json-patch','moment','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit','count','set','Content-Range','reject','update','destroy','then','sendStatus','error','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','SquareRecording','findAll','rows','params','keys','length','includeAll','include','find','create','body','catch'];(function(_0x2ffb19,_0x4599a7){var _0x2100d5=function(_0x48f36f){while(--_0x48f36f){_0x2ffb19['push'](_0x2ffb19['shift']());}};_0x2100d5(++_0x4599a7);}(_0xb0a7,0x73));var _0x7b0a=function(_0x1c4fee,_0x4a81e1){_0x1c4fee=_0x1c4fee-0x0;var _0x4fdb8c=_0xb0a7[_0x1c4fee];return _0x4fdb8c;};'use strict';var emlformat=require(_0x7b0a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b0a('0x1'));var jsonpatch=require(_0x7b0a('0x2'));var rp=require('request-promise');var moment=require(_0x7b0a('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7b0a('0x4'));var ejs=require(_0x7b0a('0x5'));var fs=require('fs');var fs_extra=require(_0x7b0a('0x6'));var _=require('lodash');var squel=require(_0x7b0a('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7b0a('0x8'));var toCsv=require(_0x7b0a('0x4'));var querystring=require(_0x7b0a('0x9'));var Papa=require(_0x7b0a('0xa'));var Redis=require(_0x7b0a('0xb'));var authService=require(_0x7b0a('0xc'));var qs=require(_0x7b0a('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b0a('0xe'));var logger=require(_0x7b0a('0xf'))(_0x7b0a('0x10'));var utils=require(_0x7b0a('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x7b0a('0x12'));var db=require(_0x7b0a('0x13'))['db'];function respondWithStatusCode(_0x27af54,_0x25c6c3){_0x25c6c3=_0x25c6c3||0xcc;return function(_0x86d0ad){if(_0x86d0ad){return _0x27af54['sendStatus'](_0x25c6c3);}return _0x27af54[_0x7b0a('0x14')](_0x25c6c3)[_0x7b0a('0x15')]();};}function respondWithResult(_0x1ccf19,_0x18864c){_0x18864c=_0x18864c||0xc8;return function(_0x4615a4){if(_0x4615a4){return _0x1ccf19[_0x7b0a('0x14')](_0x18864c)['json'](_0x4615a4);}};}function respondWithFilteredResult(_0x59d756,_0x592a0b){return function(_0x4e8c15){if(_0x4e8c15){var _0x5d5436=typeof _0x592a0b[_0x7b0a('0x16')]==='undefined'&&typeof _0x592a0b[_0x7b0a('0x17')]==='undefined';var _0x2cfa3f=_0x4e8c15[_0x7b0a('0x18')];var _0x294fb1=_0x5d5436?0x0:_0x592a0b[_0x7b0a('0x16')];var _0x1cc6d0=_0x5d5436?_0x4e8c15['count']:_0x592a0b[_0x7b0a('0x16')]+_0x592a0b[_0x7b0a('0x17')];var _0x46fc28;if(_0x1cc6d0>=_0x2cfa3f){_0x1cc6d0=_0x2cfa3f;_0x46fc28=0xc8;}else{_0x46fc28=0xce;}_0x59d756[_0x7b0a('0x14')](_0x46fc28);return _0x59d756[_0x7b0a('0x19')](_0x7b0a('0x1a'),_0x294fb1+'-'+_0x1cc6d0+'/'+_0x2cfa3f)['json'](_0x4e8c15);}return null;};}function patchUpdates(_0x4be08e){return function(_0x469acb){try{jsonpatch['apply'](_0x469acb,_0x4be08e,!![]);}catch(_0x1b1090){return BPromise[_0x7b0a('0x1b')](_0x1b1090);}return _0x469acb['save']();};}function saveUpdates(_0xefbfa8,_0x1d15c9){return function(_0x11841d){if(_0x11841d){return _0x11841d[_0x7b0a('0x1c')](_0xefbfa8)['then'](function(_0x237b66){return _0x237b66;});}return null;};}function removeEntity(_0x5243f5,_0xbf1ffa){return function(_0x23f951){if(_0x23f951){return _0x23f951[_0x7b0a('0x1d')]()[_0x7b0a('0x1e')](function(){_0x5243f5[_0x7b0a('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47d35a,_0x706429){return function(_0x43b9e5){if(!_0x43b9e5){_0x47d35a[_0x7b0a('0x1f')](0x194);}return _0x43b9e5;};}function handleError(_0x5a667b,_0x2290fb){_0x2290fb=_0x2290fb||0x1f4;return function(_0x3daf16){logger[_0x7b0a('0x20')](_0x3daf16['stack']);if(_0x3daf16[_0x7b0a('0x21')]){delete _0x3daf16[_0x7b0a('0x21')];}_0x5a667b['status'](_0x2290fb)[_0x7b0a('0x22')](_0x3daf16);};}exports['index']=function(_0x1ffea3,_0x373b70){var _0x4eaee3={},_0x4da44f={},_0x1ef514={'count':0x0,'rows':[]};var _0x5eef35=_[_0x7b0a('0x23')](db['SquareRecording'][_0x7b0a('0x24')],function(_0x579801){return{'name':_0x579801[_0x7b0a('0x25')],'type':_0x579801[_0x7b0a('0x26')][_0x7b0a('0x27')]};});_0x4da44f[_0x7b0a('0x28')]=_[_0x7b0a('0x23')](_0x5eef35,_0x7b0a('0x21'));_0x4da44f[_0x7b0a('0x29')]=_['keys'](_0x1ffea3[_0x7b0a('0x29')]);_0x4da44f[_0x7b0a('0x2a')]=_['intersection'](_0x4da44f[_0x7b0a('0x28')],_0x4da44f[_0x7b0a('0x29')]);_0x4eaee3[_0x7b0a('0x2b')]=_[_0x7b0a('0x2c')](_0x4da44f[_0x7b0a('0x28')],qs[_0x7b0a('0x2d')](_0x1ffea3[_0x7b0a('0x29')][_0x7b0a('0x2d')]));_0x4eaee3[_0x7b0a('0x2b')]=_0x4eaee3[_0x7b0a('0x2b')]['length']?_0x4eaee3['attributes']:_0x4da44f[_0x7b0a('0x28')];if(!_0x1ffea3['query'][_0x7b0a('0x2e')](_0x7b0a('0x2f'))){_0x4eaee3['limit']=qs[_0x7b0a('0x17')](_0x1ffea3[_0x7b0a('0x29')][_0x7b0a('0x17')]);_0x4eaee3[_0x7b0a('0x16')]=qs[_0x7b0a('0x16')](_0x1ffea3['query']['offset']);}_0x4eaee3[_0x7b0a('0x30')]=qs[_0x7b0a('0x31')](_0x1ffea3['query'][_0x7b0a('0x31')]);_0x4eaee3['where']=qs[_0x7b0a('0x2a')](_[_0x7b0a('0x32')](_0x1ffea3[_0x7b0a('0x29')],_0x4da44f[_0x7b0a('0x2a')]),_0x5eef35);if(_0x1ffea3[_0x7b0a('0x29')][_0x7b0a('0x33')]){_0x4eaee3[_0x7b0a('0x34')]=_['merge'](_0x4eaee3[_0x7b0a('0x34')],{'$or':_[_0x7b0a('0x23')](_0x5eef35,function(_0x55a4fc){if(_0x55a4fc['type']!=='VIRTUAL'){var _0x5ec4ef={};_0x5ec4ef[_0x55a4fc[_0x7b0a('0x21')]]={'$like':'%'+_0x1ffea3['query'][_0x7b0a('0x33')]+'%'};return _0x5ec4ef;}})});}_0x4eaee3=_[_0x7b0a('0x35')]({},_0x4eaee3,_0x1ffea3[_0x7b0a('0x36')]);var _0x68fb78={'where':_0x4eaee3[_0x7b0a('0x34')]};return db['SquareRecording']['count'](_0x68fb78)[_0x7b0a('0x1e')](function(_0x21de8c){_0x1ef514[_0x7b0a('0x18')]=_0x21de8c;if(_0x1ffea3[_0x7b0a('0x29')]['includeAll']){_0x4eaee3['include']=[{'all':!![]}];}return db[_0x7b0a('0x37')][_0x7b0a('0x38')](_0x4eaee3);})[_0x7b0a('0x1e')](function(_0x568144){_0x1ef514[_0x7b0a('0x39')]=_0x568144;return _0x1ef514;})[_0x7b0a('0x1e')](respondWithFilteredResult(_0x373b70,_0x4eaee3))['catch'](handleError(_0x373b70,null));};exports['show']=function(_0x31f7e6,_0x1eb7ad){var _0x5bbe0b={'raw':!![],'where':{'id':_0x31f7e6[_0x7b0a('0x3a')]['id']}},_0x463dac={};_0x463dac[_0x7b0a('0x28')]=_[_0x7b0a('0x3b')](db[_0x7b0a('0x37')]['rawAttributes']);_0x463dac['query']=_[_0x7b0a('0x3b')](_0x31f7e6['query']);_0x463dac['filters']=_['intersection'](_0x463dac[_0x7b0a('0x28')],_0x463dac[_0x7b0a('0x29')]);_0x5bbe0b[_0x7b0a('0x2b')]=_[_0x7b0a('0x2c')](_0x463dac[_0x7b0a('0x28')],qs[_0x7b0a('0x2d')](_0x31f7e6['query']['fields']));_0x5bbe0b[_0x7b0a('0x2b')]=_0x5bbe0b[_0x7b0a('0x2b')][_0x7b0a('0x3c')]?_0x5bbe0b['attributes']:_0x463dac[_0x7b0a('0x28')];if(_0x31f7e6[_0x7b0a('0x29')][_0x7b0a('0x3d')]){_0x5bbe0b[_0x7b0a('0x3e')]=[{'all':!![]}];}_0x5bbe0b=_['merge']({},_0x5bbe0b,_0x31f7e6[_0x7b0a('0x36')]);return db[_0x7b0a('0x37')][_0x7b0a('0x3f')](_0x5bbe0b)[_0x7b0a('0x1e')](handleEntityNotFound(_0x1eb7ad,null))[_0x7b0a('0x1e')](respondWithResult(_0x1eb7ad,null))['catch'](handleError(_0x1eb7ad,null));};exports[_0x7b0a('0x40')]=function(_0xd937c6,_0x255019){return db[_0x7b0a('0x37')][_0x7b0a('0x40')](_0xd937c6[_0x7b0a('0x41')],{})[_0x7b0a('0x1e')](respondWithResult(_0x255019,0xc9))[_0x7b0a('0x42')](handleError(_0x255019,null));};exports['update']=function(_0x2dcb92,_0x1b779a){if(_0x2dcb92[_0x7b0a('0x41')]['id']){delete _0x2dcb92[_0x7b0a('0x41')]['id'];}return db[_0x7b0a('0x37')][_0x7b0a('0x3f')]({'where':{'id':_0x2dcb92['params']['id']}})[_0x7b0a('0x1e')](handleEntityNotFound(_0x1b779a,null))['then'](saveUpdates(_0x2dcb92[_0x7b0a('0x41')],null))[_0x7b0a('0x1e')](respondWithResult(_0x1b779a,null))['catch'](handleError(_0x1b779a,null));};exports[_0x7b0a('0x43')]=function(_0x1a143d,_0x2b80bc,_0x5e48ba){var _0x2b3408=require('../../components/encryptor');var _0x5bf70c=![];var _0x591443={};if(_0x1a143d[_0x7b0a('0x29')][_0x7b0a('0x26')]&&_0x1a143d[_0x7b0a('0x29')][_0x7b0a('0x26')]==='uniqueid'){_0x591443[_0x7b0a('0x44')]=_0x1a143d[_0x7b0a('0x3a')]['id'];}else{_0x591443['id']=_0x1a143d['params']['id'];}return db['SquareRecording']['find']({'where':_0x591443,'attributes':['id',_0x7b0a('0x45'),_0x7b0a('0x46')],'raw':!![]})[_0x7b0a('0x1e')](handleEntityNotFound(_0x2b80bc,null))[_0x7b0a('0x1e')](function(_0x440f08){if(_0x440f08){var _0x3c2fc9=_0x440f08['savePath'];var _0x465768=util[_0x7b0a('0x47')](_0x7b0a('0x48'),_0x3c2fc9);if(fs['existsSync'](_0x465768)){_0x5bf70c=!![];return _0x2b3408[_0x7b0a('0x49')](_0x465768,_0x3c2fc9,config[_0x7b0a('0x4a')][_0x7b0a('0x4b')])[_0x7b0a('0x1e')](function(){return _0x440f08;});}return _0x440f08;}})[_0x7b0a('0x1e')](function(_0x5de790){if(_0x5de790){var _0x271894=_0x5de790[_0x7b0a('0x45')];if(!fs[_0x7b0a('0x4c')](_0x271894)){throw new db[(_0x7b0a('0x4d'))][(_0x7b0a('0x4e'))]('SquareRecording\x20not\x20found');}if(_0x5de790[_0x7b0a('0x46')]){return _0x2b80bc[_0x7b0a('0x43')](_0x271894,_0x5de790[_0x7b0a('0x46')]+path[_0x7b0a('0x4f')](_0x271894),function(){if(_0x5bf70c){fs[_0x7b0a('0x50')](_0x271894);}});}else{return _0x2b80bc[_0x7b0a('0x43')](_0x271894,function(_0x4bd29d){if(_0x5bf70c){fs[_0x7b0a('0x50')](_0x271894);}});}}})[_0x7b0a('0x42')](function(_0xafa890){if(_0xafa890['message']===_0x7b0a('0x51')){_0x2b80bc[_0x7b0a('0x14')](0x194)[_0x7b0a('0x22')](_0x7b0a('0x52'));}else{return handleError(_0x2b80bc,null);}});};exports['destroy']=function(_0x401a99,_0x58319d){return db['SquareRecording']['find']({'where':{'id':_0x401a99['params']['id']}})[_0x7b0a('0x1e')](function(_0x1b797d){if(_['isNil'](_0x1b797d)){throw new ReferenceError(_0x7b0a('0x53'));}return _0x1b797d;})[_0x7b0a('0x1e')](function(_0x30c6d2){var _0x182867=_0x30c6d2[_0x7b0a('0x45')];logger[_0x7b0a('0x54')](_0x7b0a('0x55'),_0x182867);if(!_['isNil'](_0x30c6d2['savePath'])&&fs[_0x7b0a('0x4c')](_0x182867)){logger[_0x7b0a('0x54')]('File:\x20\x22'+_0x182867+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x7b0a('0x56')](_0x182867);}_0x182867=_0x182867+_0x7b0a('0x57');if(!_[_0x7b0a('0x58')](_0x30c6d2[_0x7b0a('0x45')])&&fs['existsSync'](_0x182867)){logger['info'](_0x7b0a('0x59')+_0x182867+_0x7b0a('0x5a'));fs[_0x7b0a('0x56')](_0x182867);}return _0x30c6d2;})[_0x7b0a('0x1e')](function(_0x257a9e){if(!_0x257a9e)throw new InternalError();return _0x257a9e[_0x7b0a('0x1d')]();})[_0x7b0a('0x1e')](function(){_0x58319d[_0x7b0a('0x14')](0xcc)[_0x7b0a('0x15')]();})[_0x7b0a('0x42')](handleError(_0x58319d,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index c7a4115..1d916ba 100644 --- a/server/api/squareRecording/squareRecording.model.js +++ b/server/api/squareRecording/squareRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe785=['util','api','moment','bluebird','request-promise','../../config/environment','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash'];(function(_0x4199c3,_0x3d2223){var _0x3ccdab=function(_0x496206){while(--_0x496206){_0x4199c3['push'](_0x4199c3['shift']());}};_0x3ccdab(++_0x3d2223);}(_0xe785,0x128));var _0x5e78=function(_0x3a2a20,_0x48e10a){_0x3a2a20=_0x3a2a20-0x0;var _0x366ec2=_0xe785[_0x3a2a20];return _0x366ec2;};'use strict';var _=require(_0x5e78('0x0'));var util=require(_0x5e78('0x1'));var logger=require('../../config/logger')(_0x5e78('0x2'));var moment=require(_0x5e78('0x3'));var BPromise=require(_0x5e78('0x4'));var rp=require(_0x5e78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e78('0x6'));var attributes=require(_0x5e78('0x7'));module[_0x5e78('0x8')]=function(_0x135552,_0x502114){return _0x135552['define'](_0x5e78('0x9'),attributes,{'tableName':_0x5e78('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47a1=['SquareRecording','square_recordings','lodash','api','bluebird','request-promise','rimraf','../../config/environment','./squareRecording.attributes','exports','define'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0x47a1,0xbd));var _0x147a=function(_0x1183f0,_0x5ab12d){_0x1183f0=_0x1183f0-0x0;var _0x410094=_0x47a1[_0x1183f0];return _0x410094;};'use strict';var _=require(_0x147a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x147a('0x1'));var moment=require('moment');var BPromise=require(_0x147a('0x2'));var rp=require(_0x147a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x147a('0x4'));var config=require(_0x147a('0x5'));var attributes=require(_0x147a('0x6'));module[_0x147a('0x7')]=function(_0x31373d,_0x57e7a2){return _0x31373d[_0x147a('0x8')](_0x147a('0x9'),attributes,{'tableName':_0x147a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 0332105..86becc7 100644 --- a/server/api/squareRecording/squareRecording.rpc.js +++ b/server/api/squareRecording/squareRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a55=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareRecording','SquareRecording','body','options','lodash','util','bluebird'];(function(_0x4207f4,_0x1f778b){var _0x29a621=function(_0xa6f5b7){while(--_0xa6f5b7){_0x4207f4['push'](_0x4207f4['shift']());}};_0x29a621(++_0x1f778b);}(_0x7a55,0x183));var _0x57a5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a55[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x57a5('0x0'));var util=require(_0x57a5('0x1'));var moment=require('moment');var BPromise=require(_0x57a5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57a5('0x3'))['db'];var utils=require(_0x57a5('0x4'));var logger=require(_0x57a5('0x5'))(_0x57a5('0x6'));var config=require(_0x57a5('0x7'));var jayson=require(_0x57a5('0x8'));var client=jayson['client'][_0x57a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc7dc65,_0x4bf392,_0x393524){return new BPromise(function(_0x3121f9,_0x5eb15b){return client[_0x57a5('0xa')](_0xc7dc65,_0x393524)[_0x57a5('0xb')](function(_0x3bcc41){logger[_0x57a5('0xc')](_0x57a5('0xd'),_0x4bf392,_0x57a5('0xe'));logger[_0x57a5('0xf')](_0x57a5('0x10'),_0x4bf392,_0x57a5('0xe'),JSON[_0x57a5('0x11')](_0x3bcc41));if(_0x3bcc41['error']){if(_0x3bcc41[_0x57a5('0x12')]['code']===0x1f4){logger[_0x57a5('0x12')](_0x57a5('0xd'),_0x4bf392,_0x3bcc41[_0x57a5('0x12')]['message']);return _0x5eb15b(_0x3bcc41[_0x57a5('0x12')][_0x57a5('0x13')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x4bf392,_0x3bcc41[_0x57a5('0x12')][_0x57a5('0x13')]);return _0x3121f9(_0x3bcc41[_0x57a5('0x12')][_0x57a5('0x13')]);}else{logger[_0x57a5('0xc')](_0x57a5('0xd'),_0x4bf392,_0x57a5('0xe'));_0x3121f9(_0x3bcc41[_0x57a5('0x14')][_0x57a5('0x13')]);}})[_0x57a5('0x15')](function(_0x43fbdf){logger['error'](_0x57a5('0xd'),_0x4bf392,_0x43fbdf);_0x5eb15b(_0x43fbdf);});});}exports[_0x57a5('0x16')]=function(_0x4c9ffb){var _0x1fcebf=this;return new Promise(function(_0x2e472a,_0x1f3a18){return db[_0x57a5('0x17')]['create'](_0x4c9ffb[_0x57a5('0x18')],{'raw':_0x4c9ffb['options']?_0x4c9ffb[_0x57a5('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x787cc4){logger['info'](_0x57a5('0x16'),_0x4c9ffb);logger[_0x57a5('0xf')](_0x57a5('0x16'),_0x4c9ffb,JSON[_0x57a5('0x11')](_0x787cc4));_0x2e472a(_0x787cc4);})[_0x57a5('0x15')](function(_0x558014){logger[_0x57a5('0x12')](_0x57a5('0x16'),_0x558014[_0x57a5('0x13')],_0x4c9ffb);_0x1f3a18(_0x1fcebf[_0x57a5('0x12')](0x1f4,_0x558014[_0x57a5('0x13')]));});});}; \ No newline at end of file +var _0x64d1=['info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareRecording','SquareRecording','create','options','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x82a34b,_0x468442){var _0x45313b=function(_0xc2f535){while(--_0xc2f535){_0x82a34b['push'](_0x82a34b['shift']());}};_0x45313b(++_0x468442);}(_0x64d1,0x76));var _0x164d=function(_0x1ebe90,_0x5d29fc){_0x1ebe90=_0x1ebe90-0x0;var _0x447c82=_0x64d1[_0x1ebe90];return _0x447c82;};'use strict';var _=require(_0x164d('0x0'));var util=require(_0x164d('0x1'));var moment=require(_0x164d('0x2'));var BPromise=require(_0x164d('0x3'));var rs=require(_0x164d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x164d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x164d('0x6'))(_0x164d('0x7'));var config=require(_0x164d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x164d('0x9')][_0x164d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x363162,_0x3c9e60,_0x4560b1){return new BPromise(function(_0x446b81,_0x1ea72f){return client[_0x164d('0xb')](_0x363162,_0x4560b1)['then'](function(_0x441916){logger[_0x164d('0xc')](_0x164d('0xd'),_0x3c9e60,_0x164d('0xe'));logger[_0x164d('0xf')](_0x164d('0x10'),_0x3c9e60,_0x164d('0xe'),JSON[_0x164d('0x11')](_0x441916));if(_0x441916[_0x164d('0x12')]){if(_0x441916[_0x164d('0x12')][_0x164d('0x13')]===0x1f4){logger[_0x164d('0x12')]('SquareRecording,\x20%s,\x20%s',_0x3c9e60,_0x441916[_0x164d('0x12')][_0x164d('0x14')]);return _0x1ea72f(_0x441916['error'][_0x164d('0x14')]);}logger[_0x164d('0x12')](_0x164d('0xd'),_0x3c9e60,_0x441916[_0x164d('0x12')][_0x164d('0x14')]);return _0x446b81(_0x441916['error'][_0x164d('0x14')]);}else{logger[_0x164d('0xc')](_0x164d('0xd'),_0x3c9e60,'request\x20sent');_0x446b81(_0x441916['result'][_0x164d('0x14')]);}})[_0x164d('0x15')](function(_0x34b48b){logger[_0x164d('0x12')](_0x164d('0xd'),_0x3c9e60,_0x34b48b);_0x1ea72f(_0x34b48b);});});}exports[_0x164d('0x16')]=function(_0x4e93ef){var _0x4a50db=this;return new Promise(function(_0x4073de,_0x336df3){return db[_0x164d('0x17')][_0x164d('0x18')](_0x4e93ef['body'],{'raw':_0x4e93ef['options']?_0x4e93ef[_0x164d('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x206abd){logger[_0x164d('0xc')]('CreateSquareRecording',_0x4e93ef);logger[_0x164d('0xf')]('CreateSquareRecording',_0x4e93ef,JSON[_0x164d('0x11')](_0x206abd));_0x4073de(_0x206abd);})['catch'](function(_0x453d36){logger['error'](_0x164d('0x16'),_0x453d36[_0x164d('0x14')],_0x4e93ef);_0x336df3(_0x4a50db[_0x164d('0x12')](0x1f4,_0x453d36['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index b2fb041..4e38d41 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x51364d,_0x116f5e){var _0x112f75=function(_0x4d3d58){while(--_0x4d3d58){_0x51364d['push'](_0x51364d['shift']());}};_0x112f75(++_0x116f5e);}(_0xe706,0xa3));var _0x6e70=function(_0x20a137,_0x4d9549){_0x20a137=_0x20a137-0x0;var _0x3dc414=_0xe706[_0x20a137];return _0x3dc414;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x340916,_0x2b1417){var _0x489be0=function(_0x43a51a){while(--_0x43a51a){_0x340916['push'](_0x340916['shift']());}};_0x489be0(++_0x2b1417);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index e19eeb4..2171575 100644 --- a/server/api/squareReport/squareReport.attributes.js +++ b/server/api/squareReport/squareReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x40ff=['BOOLEAN','exports','STRING'];(function(_0x5e89d8,_0x30a21a){var _0x5c1153=function(_0x2dcba0){while(--_0x2dcba0){_0x5e89d8['push'](_0x5e89d8['shift']());}};_0x5c1153(++_0x30a21a);}(_0x40ff,0xd0));var _0xf40f=function(_0x533efc,_0xfd5f95){_0x533efc=_0x533efc-0x0;var _0x5749e0=_0x40ff[_0x533efc];return _0x5749e0;};'use strict';var Sequelize=require('sequelize');module[_0xf40f('0x0')]={'network':{'type':Sequelize[_0xf40f('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xf40f('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf40f('0x1')]},'version':{'type':Sequelize[_0xf40f('0x1')]},'callerid':{'type':Sequelize[_0xf40f('0x1')]},'calleridname':{'type':Sequelize[_0xf40f('0x1')]},'callingpres':{'type':Sequelize[_0xf40f('0x1')]},'callingani2':{'type':Sequelize[_0xf40f('0x1')]},'callington':{'type':Sequelize[_0xf40f('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xf40f('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xf40f('0x1')]},'extension':{'type':Sequelize[_0xf40f('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xf40f('0x1')]},'accountcode':{'type':Sequelize[_0xf40f('0x1')]},'threadid':{'type':Sequelize[_0xf40f('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xf40f('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xd893=['DATE','sequelize','exports','STRING'];(function(_0x328de1,_0x2a5cd7){var _0x49bd14=function(_0xc889aa){while(--_0xc889aa){_0x328de1['push'](_0x328de1['shift']());}};_0x49bd14(++_0x2a5cd7);}(_0xd893,0xf1));var _0x3d89=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd893[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x3d89('0x0'));module[_0x3d89('0x1')]={'network':{'type':Sequelize[_0x3d89('0x2')]},'network_script':{'type':Sequelize[_0x3d89('0x2')]},'request':{'type':Sequelize[_0x3d89('0x2')]},'channel':{'type':Sequelize[_0x3d89('0x2')]},'language':{'type':Sequelize[_0x3d89('0x2')]},'type':{'type':Sequelize[_0x3d89('0x2')]},'uniqueid':{'type':Sequelize[_0x3d89('0x2')]},'version':{'type':Sequelize[_0x3d89('0x2')]},'callerid':{'type':Sequelize[_0x3d89('0x2')]},'calleridname':{'type':Sequelize[_0x3d89('0x2')]},'callingpres':{'type':Sequelize[_0x3d89('0x2')]},'callingani2':{'type':Sequelize[_0x3d89('0x2')]},'callington':{'type':Sequelize[_0x3d89('0x2')]},'callingtns':{'type':Sequelize[_0x3d89('0x2')]},'dnid':{'type':Sequelize[_0x3d89('0x2')]},'rdnis':{'type':Sequelize[_0x3d89('0x2')]},'context':{'type':Sequelize[_0x3d89('0x2')]},'extension':{'type':Sequelize[_0x3d89('0x2')]},'priority':{'type':Sequelize[_0x3d89('0x2')]},'enhanced':{'type':Sequelize[_0x3d89('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x3d89('0x2')]},'project_name':{'type':Sequelize[_0x3d89('0x2')]},'joinAt':{'type':Sequelize[_0x3d89('0x3')]},'leaveAt':{'type':Sequelize[_0x3d89('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index d57dd38..a652bcd 100644 --- a/server/api/squareReport/squareReport.controller.js +++ b/server/api/squareReport/squareReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc183=['count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','SquareReport','includeAll','include','findAll','rows','params','rawAttributes','length','catch','create','body','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc183,0x1a3));var _0x3c18=function(_0x4f6baa,_0x492e18){_0x4f6baa=_0x4f6baa-0x0;var _0x57bc39=_0xc183[_0x4f6baa];return _0x57bc39;};'use strict';var emlformat=require(_0x3c18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3c18('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c18('0x2'));var moment=require('moment');var BPromise=require(_0x3c18('0x3'));var Mustache=require(_0x3c18('0x4'));var util=require(_0x3c18('0x5'));var path=require(_0x3c18('0x6'));var sox=require(_0x3c18('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c18('0x8'));var squel=require(_0x3c18('0x9'));var crypto=require(_0x3c18('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3c18('0xb'));var toCsv=require(_0x3c18('0xc'));var querystring=require(_0x3c18('0xd'));var Papa=require(_0x3c18('0xe'));var Redis=require(_0x3c18('0xf'));var authService=require(_0x3c18('0x10'));var qs=require(_0x3c18('0x11'));var as=require(_0x3c18('0x12'));var hardwareService=require(_0x3c18('0x13'));var logger=require(_0x3c18('0x14'))(_0x3c18('0x15'));var utils=require('../../config/utils');var config=require(_0x3c18('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3c18('0x17'))['db'];function respondWithStatusCode(_0x205e59,_0x3bb6bb){_0x3bb6bb=_0x3bb6bb||0xcc;return function(_0xefccfb){if(_0xefccfb){return _0x205e59[_0x3c18('0x18')](_0x3bb6bb);}return _0x205e59[_0x3c18('0x19')](_0x3bb6bb)[_0x3c18('0x1a')]();};}function respondWithResult(_0x576b94,_0x2c8d34){_0x2c8d34=_0x2c8d34||0xc8;return function(_0x48757c){if(_0x48757c){return _0x576b94[_0x3c18('0x19')](_0x2c8d34)[_0x3c18('0x1b')](_0x48757c);}};}function respondWithFilteredResult(_0x156a98,_0x1428c4){return function(_0x661dee){if(_0x661dee){var _0xbaa691=typeof _0x1428c4[_0x3c18('0x1c')]===_0x3c18('0x1d')&&typeof _0x1428c4[_0x3c18('0x1e')]===_0x3c18('0x1d');var _0x3adb3e=_0x661dee['count'];var _0x283131=_0xbaa691?0x0:_0x1428c4['offset'];var _0xe4984e=_0xbaa691?_0x661dee[_0x3c18('0x1f')]:_0x1428c4[_0x3c18('0x1c')]+_0x1428c4[_0x3c18('0x1e')];var _0x484815;if(_0xe4984e>=_0x3adb3e){_0xe4984e=_0x3adb3e;_0x484815=0xc8;}else{_0x484815=0xce;}_0x156a98[_0x3c18('0x19')](_0x484815);return _0x156a98['set'](_0x3c18('0x20'),_0x283131+'-'+_0xe4984e+'/'+_0x3adb3e)[_0x3c18('0x1b')](_0x661dee);}return null;};}function patchUpdates(_0xb44dfc){return function(_0x333b98){try{jsonpatch[_0x3c18('0x21')](_0x333b98,_0xb44dfc,!![]);}catch(_0x9e3146){return BPromise[_0x3c18('0x22')](_0x9e3146);}return _0x333b98[_0x3c18('0x23')]();};}function saveUpdates(_0x1862fe,_0x3563b2){return function(_0x3e8a68){if(_0x3e8a68){return _0x3e8a68[_0x3c18('0x24')](_0x1862fe)[_0x3c18('0x25')](function(_0x125555){return _0x125555;});}return null;};}function removeEntity(_0x2d4696,_0x3667b1){return function(_0x5c36d2){if(_0x5c36d2){return _0x5c36d2[_0x3c18('0x26')]()[_0x3c18('0x25')](function(){_0x2d4696[_0x3c18('0x19')](0xcc)[_0x3c18('0x1a')]();});}};}function handleEntityNotFound(_0x63ccf3,_0x3f27fb){return function(_0x62723e){if(!_0x62723e){_0x63ccf3[_0x3c18('0x18')](0x194);}return _0x62723e;};}function handleError(_0x2d61e1,_0x1b4525){_0x1b4525=_0x1b4525||0x1f4;return function(_0x1ba22d){logger[_0x3c18('0x27')](_0x1ba22d[_0x3c18('0x28')]);if(_0x1ba22d[_0x3c18('0x29')]){delete _0x1ba22d[_0x3c18('0x29')];}_0x2d61e1[_0x3c18('0x19')](_0x1b4525)[_0x3c18('0x2a')](_0x1ba22d);};}exports[_0x3c18('0x2b')]=function(_0x1986d9,_0x339e10){var _0x11a0f7={},_0x571af8={},_0xfc7a3f={'count':0x0,'rows':[]};var _0x238180=_[_0x3c18('0x2c')](db['SquareReport']['rawAttributes'],function(_0x3bf44c){return{'name':_0x3bf44c[_0x3c18('0x2d')],'type':_0x3bf44c[_0x3c18('0x2e')]['key']};});_0x571af8[_0x3c18('0x2f')]=_[_0x3c18('0x2c')](_0x238180,_0x3c18('0x29'));_0x571af8[_0x3c18('0x30')]=_[_0x3c18('0x31')](_0x1986d9[_0x3c18('0x30')]);_0x571af8[_0x3c18('0x32')]=_[_0x3c18('0x33')](_0x571af8['model'],_0x571af8[_0x3c18('0x30')]);_0x11a0f7[_0x3c18('0x34')]=_[_0x3c18('0x33')](_0x571af8[_0x3c18('0x2f')],qs[_0x3c18('0x35')](_0x1986d9[_0x3c18('0x30')][_0x3c18('0x35')]));_0x11a0f7[_0x3c18('0x34')]=_0x11a0f7['attributes']['length']?_0x11a0f7[_0x3c18('0x34')]:_0x571af8[_0x3c18('0x2f')];if(!_0x1986d9['query'][_0x3c18('0x36')]('nolimit')){_0x11a0f7[_0x3c18('0x1e')]=qs[_0x3c18('0x1e')](_0x1986d9[_0x3c18('0x30')][_0x3c18('0x1e')]);_0x11a0f7[_0x3c18('0x1c')]=qs[_0x3c18('0x1c')](_0x1986d9[_0x3c18('0x30')][_0x3c18('0x1c')]);}_0x11a0f7[_0x3c18('0x37')]=qs[_0x3c18('0x38')](_0x1986d9['query']['sort']);_0x11a0f7[_0x3c18('0x39')]=qs[_0x3c18('0x32')](_[_0x3c18('0x3a')](_0x1986d9['query'],_0x571af8['filters']),_0x238180);if(_0x1986d9[_0x3c18('0x30')]['filter']){_0x11a0f7[_0x3c18('0x39')]=_['merge'](_0x11a0f7[_0x3c18('0x39')],{'$or':_[_0x3c18('0x2c')](_0x238180,function(_0x1a28ba){if(_0x1a28ba['type']!==_0x3c18('0x3b')){var _0x2ec7c2={};_0x2ec7c2[_0x1a28ba[_0x3c18('0x29')]]={'$like':'%'+_0x1986d9[_0x3c18('0x30')][_0x3c18('0x3c')]+'%'};return _0x2ec7c2;}})});}_0x11a0f7=_[_0x3c18('0x3d')]({},_0x11a0f7,_0x1986d9[_0x3c18('0x3e')]);var _0x3de990={'where':_0x11a0f7['where']};return db[_0x3c18('0x3f')][_0x3c18('0x1f')](_0x3de990)[_0x3c18('0x25')](function(_0x113bc6){_0xfc7a3f[_0x3c18('0x1f')]=_0x113bc6;if(_0x1986d9[_0x3c18('0x30')][_0x3c18('0x40')]){_0x11a0f7[_0x3c18('0x41')]=[{'all':!![]}];}return db[_0x3c18('0x3f')][_0x3c18('0x42')](_0x11a0f7);})[_0x3c18('0x25')](function(_0x51dfeb){_0xfc7a3f[_0x3c18('0x43')]=_0x51dfeb;return _0xfc7a3f;})[_0x3c18('0x25')](respondWithFilteredResult(_0x339e10,_0x11a0f7))['catch'](handleError(_0x339e10,null));};exports['show']=function(_0x1e82bb,_0xdae858){var _0x14102f={'raw':!![],'where':{'id':_0x1e82bb[_0x3c18('0x44')]['id']}},_0x166c4c={};_0x166c4c[_0x3c18('0x2f')]=_[_0x3c18('0x31')](db['SquareReport'][_0x3c18('0x45')]);_0x166c4c['query']=_['keys'](_0x1e82bb['query']);_0x166c4c[_0x3c18('0x32')]=_['intersection'](_0x166c4c[_0x3c18('0x2f')],_0x166c4c[_0x3c18('0x30')]);_0x14102f[_0x3c18('0x34')]=_[_0x3c18('0x33')](_0x166c4c[_0x3c18('0x2f')],qs[_0x3c18('0x35')](_0x1e82bb[_0x3c18('0x30')]['fields']));_0x14102f['attributes']=_0x14102f['attributes'][_0x3c18('0x46')]?_0x14102f[_0x3c18('0x34')]:_0x166c4c[_0x3c18('0x2f')];if(_0x1e82bb[_0x3c18('0x30')][_0x3c18('0x40')]){_0x14102f[_0x3c18('0x41')]=[{'all':!![]}];}_0x14102f=_[_0x3c18('0x3d')]({},_0x14102f,_0x1e82bb[_0x3c18('0x3e')]);return db[_0x3c18('0x3f')]['find'](_0x14102f)[_0x3c18('0x25')](handleEntityNotFound(_0xdae858,null))[_0x3c18('0x25')](respondWithResult(_0xdae858,null))[_0x3c18('0x47')](handleError(_0xdae858,null));};exports['create']=function(_0x122a80,_0x3fc31d){return db[_0x3c18('0x3f')][_0x3c18('0x48')](_0x122a80[_0x3c18('0x49')],{})[_0x3c18('0x25')](respondWithResult(_0x3fc31d,0xc9))[_0x3c18('0x47')](handleError(_0x3fc31d,null));};exports['update']=function(_0x42c84b,_0x3c0c8d){if(_0x42c84b[_0x3c18('0x49')]['id']){delete _0x42c84b[_0x3c18('0x49')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x42c84b[_0x3c18('0x44')]['id']}})[_0x3c18('0x25')](handleEntityNotFound(_0x3c0c8d,null))['then'](saveUpdates(_0x42c84b[_0x3c18('0x49')],null))[_0x3c18('0x25')](respondWithResult(_0x3c0c8d,null))['catch'](handleError(_0x3c0c8d,null));};exports[_0x3c18('0x26')]=function(_0x2c860a,_0x475c38){return db['SquareReport']['find']({'where':{'id':_0x2c860a[_0x3c18('0x44')]['id']}})[_0x3c18('0x25')](handleEntityNotFound(_0x475c38,null))[_0x3c18('0x25')](removeEntity(_0x475c38,null))[_0x3c18('0x47')](handleError(_0x475c38,null));};exports[_0x3c18('0x4a')]=function(_0x4007e1,_0x529a82){return db[_0x3c18('0x3f')][_0x3c18('0x4a')]()[_0x3c18('0x25')](respondWithResult(_0x529a82,null))[_0x3c18('0x47')](handleError(_0x529a82,null));}; \ No newline at end of file +var _0xc0a5=['includeAll','include','findAll','catch','show','params','keys','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','SquareReport'];(function(_0x2c8dc5,_0x4432b8){var _0x50d8f0=function(_0x338caa){while(--_0x338caa){_0x2c8dc5['push'](_0x2c8dc5['shift']());}};_0x50d8f0(++_0x4432b8);}(_0xc0a5,0xf4));var _0x5c0a=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xc0a5[_0x12fc8d];return _0x3f9d04;};'use strict';var emlformat=require(_0x5c0a('0x0'));var rimraf=require(_0x5c0a('0x1'));var zipdir=require(_0x5c0a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c0a('0x3'));var moment=require(_0x5c0a('0x4'));var BPromise=require(_0x5c0a('0x5'));var Mustache=require(_0x5c0a('0x6'));var util=require(_0x5c0a('0x7'));var path=require(_0x5c0a('0x8'));var sox=require('sox');var csv=require(_0x5c0a('0x9'));var ejs=require(_0x5c0a('0xa'));var fs=require('fs');var fs_extra=require(_0x5c0a('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5c0a('0xc'));var deskjs=require(_0x5c0a('0xd'));var toCsv=require(_0x5c0a('0x9'));var querystring=require(_0x5c0a('0xe'));var Papa=require(_0x5c0a('0xf'));var Redis=require(_0x5c0a('0x10'));var authService=require(_0x5c0a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5c0a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5c0a('0x13'));var utils=require('../../config/utils');var config=require(_0x5c0a('0x14'));var licenseUtil=require(_0x5c0a('0x15'));var db=require(_0x5c0a('0x16'))['db'];function respondWithStatusCode(_0x300f71,_0x481edf){_0x481edf=_0x481edf||0xcc;return function(_0x2c29c1){if(_0x2c29c1){return _0x300f71[_0x5c0a('0x17')](_0x481edf);}return _0x300f71[_0x5c0a('0x18')](_0x481edf)['end']();};}function respondWithResult(_0x35202e,_0x5d8bcd){_0x5d8bcd=_0x5d8bcd||0xc8;return function(_0x27c9d9){if(_0x27c9d9){return _0x35202e[_0x5c0a('0x18')](_0x5d8bcd)[_0x5c0a('0x19')](_0x27c9d9);}};}function respondWithFilteredResult(_0x46b8ae,_0x1332e2){return function(_0x4b20a7){if(_0x4b20a7){var _0x52b247=typeof _0x1332e2[_0x5c0a('0x1a')]===_0x5c0a('0x1b')&&typeof _0x1332e2[_0x5c0a('0x1c')]===_0x5c0a('0x1b');var _0x5cb130=_0x4b20a7[_0x5c0a('0x1d')];var _0x3b7be0=_0x52b247?0x0:_0x1332e2['offset'];var _0x4c15df=_0x52b247?_0x4b20a7[_0x5c0a('0x1d')]:_0x1332e2[_0x5c0a('0x1a')]+_0x1332e2[_0x5c0a('0x1c')];var _0x2793bd;if(_0x4c15df>=_0x5cb130){_0x4c15df=_0x5cb130;_0x2793bd=0xc8;}else{_0x2793bd=0xce;}_0x46b8ae[_0x5c0a('0x18')](_0x2793bd);return _0x46b8ae[_0x5c0a('0x1e')](_0x5c0a('0x1f'),_0x3b7be0+'-'+_0x4c15df+'/'+_0x5cb130)[_0x5c0a('0x19')](_0x4b20a7);}return null;};}function patchUpdates(_0x25e397){return function(_0x29a29e){try{jsonpatch[_0x5c0a('0x20')](_0x29a29e,_0x25e397,!![]);}catch(_0x424fdd){return BPromise[_0x5c0a('0x21')](_0x424fdd);}return _0x29a29e[_0x5c0a('0x22')]();};}function saveUpdates(_0x9d9466,_0x13cc00){return function(_0x50ee31){if(_0x50ee31){return _0x50ee31['update'](_0x9d9466)[_0x5c0a('0x23')](function(_0x25e479){return _0x25e479;});}return null;};}function removeEntity(_0x29006f,_0x48f790){return function(_0x365e05){if(_0x365e05){return _0x365e05[_0x5c0a('0x24')]()['then'](function(){_0x29006f[_0x5c0a('0x18')](0xcc)[_0x5c0a('0x25')]();});}};}function handleEntityNotFound(_0x33304a,_0x560c6c){return function(_0x519396){if(!_0x519396){_0x33304a[_0x5c0a('0x17')](0x194);}return _0x519396;};}function handleError(_0x52f18,_0x42070a){_0x42070a=_0x42070a||0x1f4;return function(_0x300fb7){logger[_0x5c0a('0x26')](_0x300fb7[_0x5c0a('0x27')]);if(_0x300fb7[_0x5c0a('0x28')]){delete _0x300fb7[_0x5c0a('0x28')];}_0x52f18[_0x5c0a('0x18')](_0x42070a)[_0x5c0a('0x29')](_0x300fb7);};}exports[_0x5c0a('0x2a')]=function(_0x5165fe,_0x65c992){var _0x2dc446={},_0x1557d9={},_0x390d7d={'count':0x0,'rows':[]};var _0x92573a=_[_0x5c0a('0x2b')](db['SquareReport'][_0x5c0a('0x2c')],function(_0x536adf){return{'name':_0x536adf[_0x5c0a('0x2d')],'type':_0x536adf[_0x5c0a('0x2e')][_0x5c0a('0x2f')]};});_0x1557d9[_0x5c0a('0x30')]=_[_0x5c0a('0x2b')](_0x92573a,_0x5c0a('0x28'));_0x1557d9['query']=_['keys'](_0x5165fe[_0x5c0a('0x31')]);_0x1557d9[_0x5c0a('0x32')]=_['intersection'](_0x1557d9[_0x5c0a('0x30')],_0x1557d9[_0x5c0a('0x31')]);_0x2dc446[_0x5c0a('0x33')]=_[_0x5c0a('0x34')](_0x1557d9[_0x5c0a('0x30')],qs[_0x5c0a('0x35')](_0x5165fe['query']['fields']));_0x2dc446['attributes']=_0x2dc446['attributes'][_0x5c0a('0x36')]?_0x2dc446[_0x5c0a('0x33')]:_0x1557d9[_0x5c0a('0x30')];if(!_0x5165fe['query'][_0x5c0a('0x37')](_0x5c0a('0x38'))){_0x2dc446[_0x5c0a('0x1c')]=qs[_0x5c0a('0x1c')](_0x5165fe['query'][_0x5c0a('0x1c')]);_0x2dc446[_0x5c0a('0x1a')]=qs['offset'](_0x5165fe['query'][_0x5c0a('0x1a')]);}_0x2dc446[_0x5c0a('0x39')]=qs[_0x5c0a('0x3a')](_0x5165fe['query']['sort']);_0x2dc446[_0x5c0a('0x3b')]=qs[_0x5c0a('0x32')](_[_0x5c0a('0x3c')](_0x5165fe['query'],_0x1557d9[_0x5c0a('0x32')]),_0x92573a);if(_0x5165fe[_0x5c0a('0x31')][_0x5c0a('0x3d')]){_0x2dc446['where']=_[_0x5c0a('0x3e')](_0x2dc446[_0x5c0a('0x3b')],{'$or':_[_0x5c0a('0x2b')](_0x92573a,function(_0x56d72c){if(_0x56d72c[_0x5c0a('0x2e')]!=='VIRTUAL'){var _0x349a3a={};_0x349a3a[_0x56d72c[_0x5c0a('0x28')]]={'$like':'%'+_0x5165fe[_0x5c0a('0x31')][_0x5c0a('0x3d')]+'%'};return _0x349a3a;}})});}_0x2dc446=_[_0x5c0a('0x3e')]({},_0x2dc446,_0x5165fe['options']);var _0x5322b={'where':_0x2dc446[_0x5c0a('0x3b')]};return db[_0x5c0a('0x3f')]['count'](_0x5322b)[_0x5c0a('0x23')](function(_0x1d6039){_0x390d7d[_0x5c0a('0x1d')]=_0x1d6039;if(_0x5165fe['query'][_0x5c0a('0x40')]){_0x2dc446[_0x5c0a('0x41')]=[{'all':!![]}];}return db[_0x5c0a('0x3f')][_0x5c0a('0x42')](_0x2dc446);})['then'](function(_0x104f5e){_0x390d7d['rows']=_0x104f5e;return _0x390d7d;})[_0x5c0a('0x23')](respondWithFilteredResult(_0x65c992,_0x2dc446))[_0x5c0a('0x43')](handleError(_0x65c992,null));};exports[_0x5c0a('0x44')]=function(_0x4ee03a,_0x5d1e6b){var _0x1b638b={'raw':!![],'where':{'id':_0x4ee03a[_0x5c0a('0x45')]['id']}},_0x1c4861={};_0x1c4861[_0x5c0a('0x30')]=_[_0x5c0a('0x46')](db[_0x5c0a('0x3f')][_0x5c0a('0x2c')]);_0x1c4861[_0x5c0a('0x31')]=_[_0x5c0a('0x46')](_0x4ee03a[_0x5c0a('0x31')]);_0x1c4861[_0x5c0a('0x32')]=_['intersection'](_0x1c4861[_0x5c0a('0x30')],_0x1c4861[_0x5c0a('0x31')]);_0x1b638b[_0x5c0a('0x33')]=_[_0x5c0a('0x34')](_0x1c4861[_0x5c0a('0x30')],qs[_0x5c0a('0x35')](_0x4ee03a[_0x5c0a('0x31')][_0x5c0a('0x35')]));_0x1b638b[_0x5c0a('0x33')]=_0x1b638b[_0x5c0a('0x33')][_0x5c0a('0x36')]?_0x1b638b[_0x5c0a('0x33')]:_0x1c4861[_0x5c0a('0x30')];if(_0x4ee03a[_0x5c0a('0x31')][_0x5c0a('0x40')]){_0x1b638b[_0x5c0a('0x41')]=[{'all':!![]}];}_0x1b638b=_['merge']({},_0x1b638b,_0x4ee03a[_0x5c0a('0x47')]);return db[_0x5c0a('0x3f')][_0x5c0a('0x48')](_0x1b638b)['then'](handleEntityNotFound(_0x5d1e6b,null))[_0x5c0a('0x23')](respondWithResult(_0x5d1e6b,null))['catch'](handleError(_0x5d1e6b,null));};exports['create']=function(_0x344ff0,_0x102e6a){return db[_0x5c0a('0x3f')][_0x5c0a('0x49')](_0x344ff0[_0x5c0a('0x4a')],{})['then'](respondWithResult(_0x102e6a,0xc9))[_0x5c0a('0x43')](handleError(_0x102e6a,null));};exports[_0x5c0a('0x4b')]=function(_0x27bc4a,_0x2d1c8a){if(_0x27bc4a['body']['id']){delete _0x27bc4a['body']['id'];}return db[_0x5c0a('0x3f')][_0x5c0a('0x48')]({'where':{'id':_0x27bc4a[_0x5c0a('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d1c8a,null))[_0x5c0a('0x23')](saveUpdates(_0x27bc4a[_0x5c0a('0x4a')],null))[_0x5c0a('0x23')](respondWithResult(_0x2d1c8a,null))[_0x5c0a('0x43')](handleError(_0x2d1c8a,null));};exports[_0x5c0a('0x24')]=function(_0x519f81,_0x4e44be){return db[_0x5c0a('0x3f')][_0x5c0a('0x48')]({'where':{'id':_0x519f81['params']['id']}})['then'](handleEntityNotFound(_0x4e44be,null))[_0x5c0a('0x23')](removeEntity(_0x4e44be,null))[_0x5c0a('0x43')](handleError(_0x4e44be,null));};exports[_0x5c0a('0x4c')]=function(_0x1fb322,_0xa83abb){return db[_0x5c0a('0x3f')]['describe']()[_0x5c0a('0x23')](respondWithResult(_0xa83abb,null))[_0x5c0a('0x43')](handleError(_0xa83abb,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 4569f60..515cd36 100644 --- a/server/api/squareReport/squareReport.model.js +++ b/server/api/squareReport/squareReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd800=['define','SquareReport','report_square','uniqueid','leaveAt','lodash','util','moment','request-promise','path','rimraf','exports'];(function(_0x415590,_0x3404cb){var _0x1203bd=function(_0x273c72){while(--_0x273c72){_0x415590['push'](_0x415590['shift']());}};_0x1203bd(++_0x3404cb);}(_0xd800,0x185));var _0x0d80=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xd800[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x0d80('0x0'));var util=require(_0x0d80('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0d80('0x2'));var BPromise=require('bluebird');var rp=require(_0x0d80('0x3'));var fs=require('fs');var path=require(_0x0d80('0x4'));var rimraf=require(_0x0d80('0x5'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0x0d80('0x6')]=function(_0x4e11d6,_0x230f8a){return _0x4e11d6[_0x0d80('0x7')](_0x0d80('0x8'),attributes,{'tableName':_0x0d80('0x9'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x0d80('0xa'),'project_name']},{'name':_0x0d80('0xb'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2b7d=['api','bluebird','path','rimraf','../../config/environment','exports','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger'];(function(_0x54f5ab,_0x3ff783){var _0x1ad24c=function(_0xce5282){while(--_0xce5282){_0x54f5ab['push'](_0x54f5ab['shift']());}};_0x1ad24c(++_0x3ff783);}(_0x2b7d,0xde));var _0xd2b7=function(_0x31aa4c,_0x342e3b){_0x31aa4c=_0x31aa4c-0x0;var _0x32630c=_0x2b7d[_0x31aa4c];return _0x32630c;};'use strict';var _=require(_0xd2b7('0x0'));var util=require(_0xd2b7('0x1'));var logger=require(_0xd2b7('0x2'))(_0xd2b7('0x3'));var moment=require('moment');var BPromise=require(_0xd2b7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2b7('0x5'));var rimraf=require(_0xd2b7('0x6'));var config=require(_0xd2b7('0x7'));var attributes=require('./squareReport.attributes');module[_0xd2b7('0x8')]=function(_0x5cdaef,_0x49d489){return _0x5cdaef['define'](_0xd2b7('0x9'),attributes,{'tableName':_0xd2b7('0xa'),'paranoid':![],'indexes':[{'name':_0xd2b7('0xb'),'fields':[_0xd2b7('0xc'),_0xd2b7('0xd')]},{'name':'leaveAt','fields':[_0xd2b7('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 25784bf..21ac856 100644 --- a/server/api/squareReport/squareReport.rpc.js +++ b/server/api/squareReport/squareReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f02=['UpdateSquareReport','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','body','options','raw','update','attributes','limit'];(function(_0x25ba6a,_0x4422d6){var _0x1be09a=function(_0x308e7b){while(--_0x308e7b){_0x25ba6a['push'](_0x25ba6a['shift']());}};_0x1be09a(++_0x4422d6);}(_0x2f02,0x156));var _0x22f0=function(_0x4d7707,_0x9784ca){_0x4d7707=_0x4d7707-0x0;var _0x5d3421=_0x2f02[_0x4d7707];return _0x5d3421;};'use strict';var _=require(_0x22f0('0x0'));var util=require('util');var moment=require(_0x22f0('0x1'));var BPromise=require(_0x22f0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22f0('0x3'))['db'];var utils=require(_0x22f0('0x4'));var logger=require(_0x22f0('0x5'))(_0x22f0('0x6'));var config=require('../../config/environment');var jayson=require(_0x22f0('0x7'));var client=jayson[_0x22f0('0x8')][_0x22f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ab38b,_0x45b013,_0x5230df){return new BPromise(function(_0x1ccef3,_0x5369e6){return client[_0x22f0('0xa')](_0x3ab38b,_0x5230df)[_0x22f0('0xb')](function(_0x19724f){logger[_0x22f0('0xc')](_0x22f0('0xd'),_0x45b013,_0x22f0('0xe'));logger[_0x22f0('0xf')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x45b013,_0x22f0('0xe'),JSON[_0x22f0('0x10')](_0x19724f));if(_0x19724f[_0x22f0('0x11')]){if(_0x19724f[_0x22f0('0x11')][_0x22f0('0x12')]===0x1f4){logger[_0x22f0('0x11')](_0x22f0('0xd'),_0x45b013,_0x19724f[_0x22f0('0x11')][_0x22f0('0x13')]);return _0x5369e6(_0x19724f[_0x22f0('0x11')]['message']);}logger['error'](_0x22f0('0xd'),_0x45b013,_0x19724f[_0x22f0('0x11')][_0x22f0('0x13')]);return _0x1ccef3(_0x19724f[_0x22f0('0x11')][_0x22f0('0x13')]);}else{logger[_0x22f0('0xc')](_0x22f0('0xd'),_0x45b013,'request\x20sent');_0x1ccef3(_0x19724f[_0x22f0('0x14')][_0x22f0('0x13')]);}})[_0x22f0('0x15')](function(_0x231d06){logger[_0x22f0('0x11')](_0x22f0('0xd'),_0x45b013,_0x231d06);_0x5369e6(_0x231d06);});});}exports[_0x22f0('0x16')]=function(_0x467c2b){var _0x33a615=this;return new Promise(function(_0x59413e,_0x5cc498){return db[_0x22f0('0x17')]['create'](_0x467c2b[_0x22f0('0x18')],{'raw':_0x467c2b[_0x22f0('0x19')]?_0x467c2b[_0x22f0('0x19')][_0x22f0('0x1a')]===undefined?!![]:![]:!![]})[_0x22f0('0xb')](function(_0x30dd2e){logger[_0x22f0('0xc')](_0x22f0('0x16'),_0x467c2b);logger[_0x22f0('0xf')]('CreateSquareReport',_0x467c2b,JSON[_0x22f0('0x10')](_0x30dd2e));_0x59413e(_0x30dd2e);})[_0x22f0('0x15')](function(_0x36bbce){logger[_0x22f0('0x11')]('CreateSquareReport',_0x36bbce[_0x22f0('0x13')],_0x467c2b);_0x5cc498(_0x33a615[_0x22f0('0x11')](0x1f4,_0x36bbce[_0x22f0('0x13')]));});});};exports['UpdateSquareReport']=function(_0x39f81c){var _0x4f6f51=this;return new Promise(function(_0x3873ec,_0xcd91dc){return db[_0x22f0('0x17')][_0x22f0('0x1b')](_0x39f81c[_0x22f0('0x18')],{'raw':_0x39f81c[_0x22f0('0x19')]?_0x39f81c['options'][_0x22f0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39f81c[_0x22f0('0x19')]?_0x39f81c[_0x22f0('0x19')]['where']||null:null,'attributes':_0x39f81c[_0x22f0('0x19')]?_0x39f81c[_0x22f0('0x19')][_0x22f0('0x1c')]||null:null,'limit':_0x39f81c[_0x22f0('0x19')]?_0x39f81c[_0x22f0('0x19')][_0x22f0('0x1d')]||null:null})[_0x22f0('0xb')](function(_0x367408){logger[_0x22f0('0xc')](_0x22f0('0x1e'),_0x39f81c);logger[_0x22f0('0xf')](_0x22f0('0x1e'),_0x39f81c,JSON['stringify'](_0x367408));_0x3873ec(_0x367408);})[_0x22f0('0x15')](function(_0x1abf1b){logger[_0x22f0('0x11')]('UpdateSquareReport',_0x1abf1b['message'],_0x39f81c);_0xcd91dc(_0x4f6f51['error'](0x1f4,_0x1abf1b[_0x22f0('0x13')]));});});}; \ No newline at end of file +var _0xde42=['body','options','raw','CreateSquareReport','UpdateSquareReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','SquareReport','create'];(function(_0x41f319,_0x15fe1c){var _0x1a71cf=function(_0x711d7b){while(--_0x711d7b){_0x41f319['push'](_0x41f319['shift']());}};_0x1a71cf(++_0x15fe1c);}(_0xde42,0x95));var _0x2de4=function(_0x22ee31,_0x352943){_0x22ee31=_0x22ee31-0x0;var _0x134eb2=_0xde42[_0x22ee31];return _0x134eb2;};'use strict';var _=require(_0x2de4('0x0'));var util=require(_0x2de4('0x1'));var moment=require(_0x2de4('0x2'));var BPromise=require(_0x2de4('0x3'));var rs=require(_0x2de4('0x4'));var fs=require('fs');var Redis=require(_0x2de4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2de4('0x6'));var logger=require('../../config/logger')(_0x2de4('0x7'));var config=require(_0x2de4('0x8'));var jayson=require(_0x2de4('0x9'));var client=jayson[_0x2de4('0xa')][_0x2de4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f1d87,_0x1c5aca,_0x37829a){return new BPromise(function(_0x548aad,_0x26ddbe){return client[_0x2de4('0xc')](_0x2f1d87,_0x37829a)[_0x2de4('0xd')](function(_0x2191fc){logger[_0x2de4('0xe')](_0x2de4('0xf'),_0x1c5aca,_0x2de4('0x10'));logger[_0x2de4('0x11')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x1c5aca,_0x2de4('0x10'),JSON[_0x2de4('0x12')](_0x2191fc));if(_0x2191fc[_0x2de4('0x13')]){if(_0x2191fc['error'][_0x2de4('0x14')]===0x1f4){logger[_0x2de4('0x13')](_0x2de4('0xf'),_0x1c5aca,_0x2191fc[_0x2de4('0x13')][_0x2de4('0x15')]);return _0x26ddbe(_0x2191fc[_0x2de4('0x13')]['message']);}logger['error'](_0x2de4('0xf'),_0x1c5aca,_0x2191fc[_0x2de4('0x13')]['message']);return _0x548aad(_0x2191fc[_0x2de4('0x13')]['message']);}else{logger[_0x2de4('0xe')]('SquareReport,\x20%s,\x20%s',_0x1c5aca,_0x2de4('0x10'));_0x548aad(_0x2191fc[_0x2de4('0x16')]['message']);}})[_0x2de4('0x17')](function(_0x2b0b43){logger[_0x2de4('0x13')](_0x2de4('0xf'),_0x1c5aca,_0x2b0b43);_0x26ddbe(_0x2b0b43);});});}exports['CreateSquareReport']=function(_0x73c4d1){var _0x52b7da=this;return new Promise(function(_0x9e2aa8,_0x2f01d3){return db[_0x2de4('0x18')][_0x2de4('0x19')](_0x73c4d1[_0x2de4('0x1a')],{'raw':_0x73c4d1[_0x2de4('0x1b')]?_0x73c4d1[_0x2de4('0x1b')][_0x2de4('0x1c')]===undefined?!![]:![]:!![]})[_0x2de4('0xd')](function(_0x140a3c){logger[_0x2de4('0xe')](_0x2de4('0x1d'),_0x73c4d1);logger[_0x2de4('0x11')]('CreateSquareReport',_0x73c4d1,JSON[_0x2de4('0x12')](_0x140a3c));_0x9e2aa8(_0x140a3c);})['catch'](function(_0x17a5d1){logger[_0x2de4('0x13')](_0x2de4('0x1d'),_0x17a5d1[_0x2de4('0x15')],_0x73c4d1);_0x2f01d3(_0x52b7da[_0x2de4('0x13')](0x1f4,_0x17a5d1[_0x2de4('0x15')]));});});};exports[_0x2de4('0x1e')]=function(_0x16d9ae){var _0x222f5d=this;return new Promise(function(_0xe312a0,_0x1487f1){return db['SquareReport'][_0x2de4('0x1f')](_0x16d9ae['body'],{'raw':_0x16d9ae['options']?_0x16d9ae[_0x2de4('0x1b')][_0x2de4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16d9ae[_0x2de4('0x1b')]?_0x16d9ae[_0x2de4('0x1b')][_0x2de4('0x20')]||null:null,'attributes':_0x16d9ae['options']?_0x16d9ae[_0x2de4('0x1b')][_0x2de4('0x21')]||null:null,'limit':_0x16d9ae[_0x2de4('0x1b')]?_0x16d9ae[_0x2de4('0x1b')][_0x2de4('0x22')]||null:null})['then'](function(_0x574847){logger['info'](_0x2de4('0x1e'),_0x16d9ae);logger[_0x2de4('0x11')](_0x2de4('0x1e'),_0x16d9ae,JSON[_0x2de4('0x12')](_0x574847));_0xe312a0(_0x574847);})[_0x2de4('0x17')](function(_0x586cb4){logger[_0x2de4('0x13')](_0x2de4('0x1e'),_0x586cb4[_0x2de4('0x15')],_0x16d9ae);_0x1487f1(_0x222f5d[_0x2de4('0x13')](0x1f4,_0x586cb4[_0x2de4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index ab12a31..2ed3feb 100644 --- a/server/api/squareReportDetail/index.js +++ b/server/api/squareReportDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd171=['isAuthenticated','describe','show','post','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','/describe'];(function(_0x4c0d12,_0x2fbdef){var _0x338274=function(_0x82b073){while(--_0x82b073){_0x4c0d12['push'](_0x4c0d12['shift']());}};_0x338274(++_0x2fbdef);}(_0xd171,0x1c2));var _0x1d17=function(_0x194801,_0x147ece){_0x194801=_0x194801-0x0;var _0x18c56c=_0xd171[_0x194801];return _0x18c56c;};'use strict';var multer=require(_0x1d17('0x0'));var util=require(_0x1d17('0x1'));var path=require(_0x1d17('0x2'));var timeout=require(_0x1d17('0x3'));var express=require(_0x1d17('0x4'));var router=express['Router']();var fs_extra=require(_0x1d17('0x5'));var auth=require(_0x1d17('0x6'));var interaction=require(_0x1d17('0x7'));var config=require(_0x1d17('0x8'));var controller=require(_0x1d17('0x9'));router[_0x1d17('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1d17('0xb'),auth[_0x1d17('0xc')](),controller[_0x1d17('0xd')]);router[_0x1d17('0xa')]('/:id',auth[_0x1d17('0xc')](),controller[_0x1d17('0xe')]);router[_0x1d17('0xf')]('/',auth[_0x1d17('0xc')](),controller['create']);router[_0x1d17('0x10')](_0x1d17('0x11'),auth[_0x1d17('0xc')](),controller['update']);router[_0x1d17('0x12')](_0x1d17('0x11'),auth[_0x1d17('0xc')](),controller[_0x1d17('0x13')]);module[_0x1d17('0x14')]=router; \ No newline at end of file +var _0xde59=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get'];(function(_0x59a0c8,_0x35ef3a){var _0x491613=function(_0x349107){while(--_0x349107){_0x59a0c8['push'](_0x59a0c8['shift']());}};_0x491613(++_0x35ef3a);}(_0xde59,0x136));var _0x9de5=function(_0x4809b6,_0x4fb9a8){_0x4809b6=_0x4809b6-0x0;var _0x55e95f=_0xde59[_0x4809b6];return _0x55e95f;};'use strict';var multer=require(_0x9de5('0x0'));var util=require(_0x9de5('0x1'));var path=require(_0x9de5('0x2'));var timeout=require(_0x9de5('0x3'));var express=require(_0x9de5('0x4'));var router=express[_0x9de5('0x5')]();var fs_extra=require(_0x9de5('0x6'));var auth=require(_0x9de5('0x7'));var interaction=require(_0x9de5('0x8'));var config=require(_0x9de5('0x9'));var controller=require(_0x9de5('0xa'));router[_0x9de5('0xb')]('/',auth[_0x9de5('0xc')](),controller[_0x9de5('0xd')]);router['get'](_0x9de5('0xe'),auth[_0x9de5('0xc')](),controller[_0x9de5('0xf')]);router[_0x9de5('0xb')](_0x9de5('0x10'),auth['isAuthenticated'](),controller[_0x9de5('0x11')]);router[_0x9de5('0x12')]('/',auth[_0x9de5('0xc')](),controller[_0x9de5('0x13')]);router[_0x9de5('0x14')](_0x9de5('0x10'),auth[_0x9de5('0xc')](),controller['update']);router['delete'](_0x9de5('0x10'),auth[_0x9de5('0xc')](),controller[_0x9de5('0x15')]);module[_0x9de5('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index a0986cc..bbf071f 100644 --- a/server/api/squareReportDetail/squareReportDetail.attributes.js +++ b/server/api/squareReportDetail/squareReportDetail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb872=['STRING','TEXT','exports'];(function(_0x148130,_0x2eb3a9){var _0xc90398=function(_0x2128ce){while(--_0x2128ce){_0x148130['push'](_0x148130['shift']());}};_0xc90398(++_0x2eb3a9);}(_0xb872,0x16d));var _0x2b87=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb872[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x2b87('0x0')]={'uniqueid':{'type':Sequelize[_0x2b87('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x2b87('0x1')]},'data':{'type':Sequelize[_0x2b87('0x2')]},'project_name':{'type':Sequelize[_0x2b87('0x1')]},'callerid':{'type':Sequelize[_0x2b87('0x1')]}}; \ No newline at end of file +var _0xb164=['STRING','TEXT','sequelize'];(function(_0x1ed6ec,_0x4e0e41){var _0x4ee0f5=function(_0x1c00f0){while(--_0x1c00f0){_0x1ed6ec['push'](_0x1ed6ec['shift']());}};_0x4ee0f5(++_0x4e0e41);}(_0xb164,0x86));var _0x4b16=function(_0x225c4b,_0x45d0e9){_0x225c4b=_0x225c4b-0x0;var _0x3305b1=_0xb164[_0x225c4b];return _0x3305b1;};'use strict';var Sequelize=require(_0x4b16('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x4b16('0x1')]},'application':{'type':Sequelize[_0x4b16('0x1')]},'data':{'type':Sequelize[_0x4b16('0x2')]},'project_name':{'type':Sequelize[_0x4b16('0x1')]},'callerid':{'type':Sequelize[_0x4b16('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 21dad7c..320412c 100644 --- a/server/api/squareReportDetail/squareReportDetail.controller.js +++ b/server/api/squareReportDetail/squareReportDetail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8efc=['update','then','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','SquareDetailsReport','includeAll','include','rows','catch','params','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save'];(function(_0x32f9c6,_0x357629){var _0x2c90ea=function(_0x2c29a4){while(--_0x2c29a4){_0x32f9c6['push'](_0x32f9c6['shift']());}};_0x2c90ea(++_0x357629);}(_0x8efc,0xb3));var _0xc8ef=function(_0x20714a,_0x7de591){_0x20714a=_0x20714a-0x0;var _0x15e877=_0x8efc[_0x20714a];return _0x15e877;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc8ef('0x0'));var zipdir=require(_0xc8ef('0x1'));var jsonpatch=require(_0xc8ef('0x2'));var rp=require(_0xc8ef('0x3'));var moment=require('moment');var BPromise=require(_0xc8ef('0x4'));var Mustache=require(_0xc8ef('0x5'));var util=require(_0xc8ef('0x6'));var path=require('path');var sox=require(_0xc8ef('0x7'));var csv=require(_0xc8ef('0x8'));var ejs=require(_0xc8ef('0x9'));var fs=require('fs');var fs_extra=require(_0xc8ef('0xa'));var _=require('lodash');var squel=require(_0xc8ef('0xb'));var crypto=require(_0xc8ef('0xc'));var jsforce=require(_0xc8ef('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc8ef('0x8'));var querystring=require(_0xc8ef('0xe'));var Papa=require(_0xc8ef('0xf'));var Redis=require(_0xc8ef('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc8ef('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc8ef('0x12'));var logger=require(_0xc8ef('0x13'))(_0xc8ef('0x14'));var utils=require(_0xc8ef('0x15'));var config=require(_0xc8ef('0x16'));var licenseUtil=require(_0xc8ef('0x17'));var db=require(_0xc8ef('0x18'))['db'];function respondWithStatusCode(_0x1c6744,_0xb90ed0){_0xb90ed0=_0xb90ed0||0xcc;return function(_0x15669b){if(_0x15669b){return _0x1c6744[_0xc8ef('0x19')](_0xb90ed0);}return _0x1c6744[_0xc8ef('0x1a')](_0xb90ed0)[_0xc8ef('0x1b')]();};}function respondWithResult(_0x2337a0,_0x8ba6d2){_0x8ba6d2=_0x8ba6d2||0xc8;return function(_0x1799ae){if(_0x1799ae){return _0x2337a0[_0xc8ef('0x1a')](_0x8ba6d2)[_0xc8ef('0x1c')](_0x1799ae);}};}function respondWithFilteredResult(_0x2c3bbf,_0x3f5636){return function(_0x175003){if(_0x175003){var _0x45eb4b=typeof _0x3f5636['offset']===_0xc8ef('0x1d')&&typeof _0x3f5636[_0xc8ef('0x1e')]===_0xc8ef('0x1d');var _0x374982=_0x175003[_0xc8ef('0x1f')];var _0x28eed6=_0x45eb4b?0x0:_0x3f5636[_0xc8ef('0x20')];var _0x262768=_0x45eb4b?_0x175003[_0xc8ef('0x1f')]:_0x3f5636[_0xc8ef('0x20')]+_0x3f5636['limit'];var _0x8edf4;if(_0x262768>=_0x374982){_0x262768=_0x374982;_0x8edf4=0xc8;}else{_0x8edf4=0xce;}_0x2c3bbf['status'](_0x8edf4);return _0x2c3bbf[_0xc8ef('0x21')]('Content-Range',_0x28eed6+'-'+_0x262768+'/'+_0x374982)[_0xc8ef('0x1c')](_0x175003);}return null;};}function patchUpdates(_0x4ff970){return function(_0x32f5f3){try{jsonpatch[_0xc8ef('0x22')](_0x32f5f3,_0x4ff970,!![]);}catch(_0x45635b){return BPromise[_0xc8ef('0x23')](_0x45635b);}return _0x32f5f3[_0xc8ef('0x24')]();};}function saveUpdates(_0x4c57e3,_0x3cf7b2){return function(_0x3ee862){if(_0x3ee862){return _0x3ee862[_0xc8ef('0x25')](_0x4c57e3)['then'](function(_0x23dd8d){return _0x23dd8d;});}return null;};}function removeEntity(_0x57555c,_0x5678b3){return function(_0x5f2456){if(_0x5f2456){return _0x5f2456['destroy']()[_0xc8ef('0x26')](function(){_0x57555c[_0xc8ef('0x1a')](0xcc)[_0xc8ef('0x1b')]();});}};}function handleEntityNotFound(_0xeb24e4,_0xfabe48){return function(_0x319c09){if(!_0x319c09){_0xeb24e4[_0xc8ef('0x19')](0x194);}return _0x319c09;};}function handleError(_0x39c0b5,_0xf713fc){_0xf713fc=_0xf713fc||0x1f4;return function(_0x2bf902){logger[_0xc8ef('0x27')](_0x2bf902[_0xc8ef('0x28')]);if(_0x2bf902[_0xc8ef('0x29')]){delete _0x2bf902[_0xc8ef('0x29')];}_0x39c0b5['status'](_0xf713fc)[_0xc8ef('0x2a')](_0x2bf902);};}exports[_0xc8ef('0x2b')]=function(_0x522500,_0x57fb2c){var _0x45ba07={},_0x522685={},_0xe5e45b={'count':0x0,'rows':[]};var _0x5ccd10=_[_0xc8ef('0x2c')](db['SquareDetailsReport'][_0xc8ef('0x2d')],function(_0x405be9){return{'name':_0x405be9['fieldName'],'type':_0x405be9['type'][_0xc8ef('0x2e')]};});_0x522685[_0xc8ef('0x2f')]=_['map'](_0x5ccd10,_0xc8ef('0x29'));_0x522685[_0xc8ef('0x30')]=_[_0xc8ef('0x31')](_0x522500[_0xc8ef('0x30')]);_0x522685[_0xc8ef('0x32')]=_[_0xc8ef('0x33')](_0x522685[_0xc8ef('0x2f')],_0x522685[_0xc8ef('0x30')]);_0x45ba07[_0xc8ef('0x34')]=_[_0xc8ef('0x33')](_0x522685[_0xc8ef('0x2f')],qs[_0xc8ef('0x35')](_0x522500['query'][_0xc8ef('0x35')]));_0x45ba07[_0xc8ef('0x34')]=_0x45ba07[_0xc8ef('0x34')][_0xc8ef('0x36')]?_0x45ba07['attributes']:_0x522685[_0xc8ef('0x2f')];if(!_0x522500[_0xc8ef('0x30')]['hasOwnProperty'](_0xc8ef('0x37'))){_0x45ba07[_0xc8ef('0x1e')]=qs['limit'](_0x522500['query'][_0xc8ef('0x1e')]);_0x45ba07[_0xc8ef('0x20')]=qs[_0xc8ef('0x20')](_0x522500['query']['offset']);}_0x45ba07[_0xc8ef('0x38')]=qs[_0xc8ef('0x39')](_0x522500[_0xc8ef('0x30')][_0xc8ef('0x39')]);_0x45ba07[_0xc8ef('0x3a')]=qs['filters'](_[_0xc8ef('0x3b')](_0x522500[_0xc8ef('0x30')],_0x522685[_0xc8ef('0x32')]),_0x5ccd10);if(_0x522500[_0xc8ef('0x30')][_0xc8ef('0x3c')]){_0x45ba07[_0xc8ef('0x3a')]=_['merge'](_0x45ba07[_0xc8ef('0x3a')],{'$or':_[_0xc8ef('0x2c')](_0x5ccd10,function(_0x5b0b6d){if(_0x5b0b6d['type']!=='VIRTUAL'){var _0x5e3a17={};_0x5e3a17[_0x5b0b6d[_0xc8ef('0x29')]]={'$like':'%'+_0x522500['query'][_0xc8ef('0x3c')]+'%'};return _0x5e3a17;}})});}_0x45ba07=_[_0xc8ef('0x3d')]({},_0x45ba07,_0x522500[_0xc8ef('0x3e')]);var _0x48398c={'where':_0x45ba07[_0xc8ef('0x3a')]};return db[_0xc8ef('0x3f')][_0xc8ef('0x1f')](_0x48398c)[_0xc8ef('0x26')](function(_0x5439c9){_0xe5e45b[_0xc8ef('0x1f')]=_0x5439c9;if(_0x522500[_0xc8ef('0x30')][_0xc8ef('0x40')]){_0x45ba07[_0xc8ef('0x41')]=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x45ba07);})[_0xc8ef('0x26')](function(_0x20647f){_0xe5e45b[_0xc8ef('0x42')]=_0x20647f;return _0xe5e45b;})[_0xc8ef('0x26')](respondWithFilteredResult(_0x57fb2c,_0x45ba07))[_0xc8ef('0x43')](handleError(_0x57fb2c,null));};exports['show']=function(_0x5ebcd3,_0x3e8bab){var _0x551e04={'raw':!![],'where':{'id':_0x5ebcd3[_0xc8ef('0x44')]['id']}},_0xa6ce01={};_0xa6ce01[_0xc8ef('0x2f')]=_['keys'](db[_0xc8ef('0x3f')][_0xc8ef('0x2d')]);_0xa6ce01['query']=_[_0xc8ef('0x31')](_0x5ebcd3['query']);_0xa6ce01[_0xc8ef('0x32')]=_[_0xc8ef('0x33')](_0xa6ce01[_0xc8ef('0x2f')],_0xa6ce01['query']);_0x551e04[_0xc8ef('0x34')]=_['intersection'](_0xa6ce01[_0xc8ef('0x2f')],qs[_0xc8ef('0x35')](_0x5ebcd3[_0xc8ef('0x30')][_0xc8ef('0x35')]));_0x551e04[_0xc8ef('0x34')]=_0x551e04[_0xc8ef('0x34')][_0xc8ef('0x36')]?_0x551e04['attributes']:_0xa6ce01['model'];if(_0x5ebcd3[_0xc8ef('0x30')][_0xc8ef('0x40')]){_0x551e04[_0xc8ef('0x41')]=[{'all':!![]}];}_0x551e04=_[_0xc8ef('0x3d')]({},_0x551e04,_0x5ebcd3[_0xc8ef('0x3e')]);return db['SquareDetailsReport'][_0xc8ef('0x45')](_0x551e04)[_0xc8ef('0x26')](handleEntityNotFound(_0x3e8bab,null))[_0xc8ef('0x26')](respondWithResult(_0x3e8bab,null))[_0xc8ef('0x43')](handleError(_0x3e8bab,null));};exports['create']=function(_0x48b1cc,_0xc00911){return db[_0xc8ef('0x3f')]['create'](_0x48b1cc[_0xc8ef('0x46')],{})['then'](respondWithResult(_0xc00911,0xc9))[_0xc8ef('0x43')](handleError(_0xc00911,null));};exports['update']=function(_0x3dbb7a,_0x331faa){if(_0x3dbb7a[_0xc8ef('0x46')]['id']){delete _0x3dbb7a[_0xc8ef('0x46')]['id'];}return db[_0xc8ef('0x3f')][_0xc8ef('0x45')]({'where':{'id':_0x3dbb7a[_0xc8ef('0x44')]['id']}})[_0xc8ef('0x26')](handleEntityNotFound(_0x331faa,null))['then'](saveUpdates(_0x3dbb7a[_0xc8ef('0x46')],null))[_0xc8ef('0x26')](respondWithResult(_0x331faa,null))['catch'](handleError(_0x331faa,null));};exports['destroy']=function(_0xe997a,_0x485be5){return db[_0xc8ef('0x3f')]['find']({'where':{'id':_0xe997a[_0xc8ef('0x44')]['id']}})['then'](handleEntityNotFound(_0x485be5,null))[_0xc8ef('0x26')](removeEntity(_0x485be5,null))[_0xc8ef('0x43')](handleError(_0x485be5,null));};exports[_0xc8ef('0x47')]=function(_0x2b4098,_0xbb4078){return db['SquareDetailsReport'][_0xc8ef('0x47')]()[_0xc8ef('0x26')](respondWithResult(_0xbb4078,null))[_0xc8ef('0x43')](handleError(_0xbb4078,null));}; \ No newline at end of file +var _0x4744=['../../config/logger','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','params','includeAll','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1d95b4,_0x2d27d3){var _0x1ff6ab=function(_0x2a33d8){while(--_0x2a33d8){_0x1d95b4['push'](_0x1d95b4['shift']());}};_0x1ff6ab(++_0x2d27d3);}(_0x4744,0x1be));var _0x4474=function(_0x463d7f,_0xeaebcf){_0x463d7f=_0x463d7f-0x0;var _0x3dfc4e=_0x4744[_0x463d7f];return _0x3dfc4e;};'use strict';var emlformat=require(_0x4474('0x0'));var rimraf=require(_0x4474('0x1'));var zipdir=require(_0x4474('0x2'));var jsonpatch=require(_0x4474('0x3'));var rp=require(_0x4474('0x4'));var moment=require(_0x4474('0x5'));var BPromise=require(_0x4474('0x6'));var Mustache=require(_0x4474('0x7'));var util=require(_0x4474('0x8'));var path=require(_0x4474('0x9'));var sox=require(_0x4474('0xa'));var csv=require(_0x4474('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4474('0xc'));var _=require(_0x4474('0xd'));var squel=require(_0x4474('0xe'));var crypto=require('crypto');var jsforce=require(_0x4474('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4474('0xb'));var querystring=require(_0x4474('0x10'));var Papa=require(_0x4474('0x11'));var Redis=require('ioredis');var authService=require(_0x4474('0x12'));var qs=require(_0x4474('0x13'));var as=require(_0x4474('0x14'));var hardwareService=require(_0x4474('0x15'));var logger=require(_0x4474('0x16'))('api');var utils=require(_0x4474('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4474('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcef6d9,_0x2fbdd4){_0x2fbdd4=_0x2fbdd4||0xcc;return function(_0x302c1b){if(_0x302c1b){return _0xcef6d9['sendStatus'](_0x2fbdd4);}return _0xcef6d9[_0x4474('0x19')](_0x2fbdd4)[_0x4474('0x1a')]();};}function respondWithResult(_0x55ef55,_0x10fb5a){_0x10fb5a=_0x10fb5a||0xc8;return function(_0x7ec614){if(_0x7ec614){return _0x55ef55[_0x4474('0x19')](_0x10fb5a)[_0x4474('0x1b')](_0x7ec614);}};}function respondWithFilteredResult(_0x210987,_0x720f68){return function(_0x349976){if(_0x349976){var _0x4e9ff9=typeof _0x720f68[_0x4474('0x1c')]===_0x4474('0x1d')&&typeof _0x720f68['limit']===_0x4474('0x1d');var _0x1794d4=_0x349976[_0x4474('0x1e')];var _0xc764c7=_0x4e9ff9?0x0:_0x720f68[_0x4474('0x1c')];var _0x24fa90=_0x4e9ff9?_0x349976[_0x4474('0x1e')]:_0x720f68[_0x4474('0x1c')]+_0x720f68[_0x4474('0x1f')];var _0xb9756d;if(_0x24fa90>=_0x1794d4){_0x24fa90=_0x1794d4;_0xb9756d=0xc8;}else{_0xb9756d=0xce;}_0x210987[_0x4474('0x19')](_0xb9756d);return _0x210987[_0x4474('0x20')](_0x4474('0x21'),_0xc764c7+'-'+_0x24fa90+'/'+_0x1794d4)[_0x4474('0x1b')](_0x349976);}return null;};}function patchUpdates(_0x1e391b){return function(_0x40b755){try{jsonpatch[_0x4474('0x22')](_0x40b755,_0x1e391b,!![]);}catch(_0x569a5a){return BPromise[_0x4474('0x23')](_0x569a5a);}return _0x40b755[_0x4474('0x24')]();};}function saveUpdates(_0x4574ce,_0x186abf){return function(_0x5f0e00){if(_0x5f0e00){return _0x5f0e00[_0x4474('0x25')](_0x4574ce)[_0x4474('0x26')](function(_0x4307ea){return _0x4307ea;});}return null;};}function removeEntity(_0x5cd07b,_0x4cb2ef){return function(_0x5255ed){if(_0x5255ed){return _0x5255ed[_0x4474('0x27')]()[_0x4474('0x26')](function(){_0x5cd07b[_0x4474('0x19')](0xcc)[_0x4474('0x1a')]();});}};}function handleEntityNotFound(_0x53b460,_0x4e60e1){return function(_0x54815f){if(!_0x54815f){_0x53b460['sendStatus'](0x194);}return _0x54815f;};}function handleError(_0x594ea5,_0x3f245f){_0x3f245f=_0x3f245f||0x1f4;return function(_0x2eb385){logger[_0x4474('0x28')](_0x2eb385[_0x4474('0x29')]);if(_0x2eb385[_0x4474('0x2a')]){delete _0x2eb385[_0x4474('0x2a')];}_0x594ea5[_0x4474('0x19')](_0x3f245f)[_0x4474('0x2b')](_0x2eb385);};}exports[_0x4474('0x2c')]=function(_0x4b0be6,_0x43d513){var _0x3d8eab={},_0x36d8a8={},_0x1b2d8d={'count':0x0,'rows':[]};var _0xbfb313=_[_0x4474('0x2d')](db[_0x4474('0x2e')][_0x4474('0x2f')],function(_0x2b4b7a){return{'name':_0x2b4b7a[_0x4474('0x30')],'type':_0x2b4b7a[_0x4474('0x31')][_0x4474('0x32')]};});_0x36d8a8[_0x4474('0x33')]=_[_0x4474('0x2d')](_0xbfb313,'name');_0x36d8a8['query']=_[_0x4474('0x34')](_0x4b0be6['query']);_0x36d8a8[_0x4474('0x35')]=_[_0x4474('0x36')](_0x36d8a8[_0x4474('0x33')],_0x36d8a8[_0x4474('0x37')]);_0x3d8eab[_0x4474('0x38')]=_[_0x4474('0x36')](_0x36d8a8[_0x4474('0x33')],qs[_0x4474('0x39')](_0x4b0be6['query'][_0x4474('0x39')]));_0x3d8eab[_0x4474('0x38')]=_0x3d8eab[_0x4474('0x38')][_0x4474('0x3a')]?_0x3d8eab[_0x4474('0x38')]:_0x36d8a8['model'];if(!_0x4b0be6['query'][_0x4474('0x3b')](_0x4474('0x3c'))){_0x3d8eab[_0x4474('0x1f')]=qs[_0x4474('0x1f')](_0x4b0be6['query'][_0x4474('0x1f')]);_0x3d8eab['offset']=qs[_0x4474('0x1c')](_0x4b0be6[_0x4474('0x37')][_0x4474('0x1c')]);}_0x3d8eab[_0x4474('0x3d')]=qs[_0x4474('0x3e')](_0x4b0be6[_0x4474('0x37')][_0x4474('0x3e')]);_0x3d8eab[_0x4474('0x3f')]=qs[_0x4474('0x35')](_[_0x4474('0x40')](_0x4b0be6[_0x4474('0x37')],_0x36d8a8[_0x4474('0x35')]),_0xbfb313);if(_0x4b0be6[_0x4474('0x37')][_0x4474('0x41')]){_0x3d8eab[_0x4474('0x3f')]=_[_0x4474('0x42')](_0x3d8eab['where'],{'$or':_[_0x4474('0x2d')](_0xbfb313,function(_0x42054b){if(_0x42054b['type']!=='VIRTUAL'){var _0x4cf963={};_0x4cf963[_0x42054b[_0x4474('0x2a')]]={'$like':'%'+_0x4b0be6[_0x4474('0x37')][_0x4474('0x41')]+'%'};return _0x4cf963;}})});}_0x3d8eab=_[_0x4474('0x42')]({},_0x3d8eab,_0x4b0be6[_0x4474('0x43')]);var _0x5c040c={'where':_0x3d8eab['where']};return db['SquareDetailsReport']['count'](_0x5c040c)[_0x4474('0x26')](function(_0x42a37c){_0x1b2d8d['count']=_0x42a37c;if(_0x4b0be6[_0x4474('0x37')]['includeAll']){_0x3d8eab['include']=[{'all':!![]}];}return db[_0x4474('0x2e')][_0x4474('0x44')](_0x3d8eab);})['then'](function(_0x813e34){_0x1b2d8d[_0x4474('0x45')]=_0x813e34;return _0x1b2d8d;})['then'](respondWithFilteredResult(_0x43d513,_0x3d8eab))[_0x4474('0x46')](handleError(_0x43d513,null));};exports['show']=function(_0x545725,_0x596a04){var _0x231a86={'raw':!![],'where':{'id':_0x545725[_0x4474('0x47')]['id']}},_0x2f8cd1={};_0x2f8cd1['model']=_[_0x4474('0x34')](db['SquareDetailsReport'][_0x4474('0x2f')]);_0x2f8cd1['query']=_[_0x4474('0x34')](_0x545725[_0x4474('0x37')]);_0x2f8cd1['filters']=_[_0x4474('0x36')](_0x2f8cd1[_0x4474('0x33')],_0x2f8cd1[_0x4474('0x37')]);_0x231a86['attributes']=_[_0x4474('0x36')](_0x2f8cd1['model'],qs['fields'](_0x545725[_0x4474('0x37')]['fields']));_0x231a86[_0x4474('0x38')]=_0x231a86[_0x4474('0x38')][_0x4474('0x3a')]?_0x231a86['attributes']:_0x2f8cd1[_0x4474('0x33')];if(_0x545725[_0x4474('0x37')][_0x4474('0x48')]){_0x231a86[_0x4474('0x49')]=[{'all':!![]}];}_0x231a86=_[_0x4474('0x42')]({},_0x231a86,_0x545725[_0x4474('0x43')]);return db['SquareDetailsReport']['find'](_0x231a86)[_0x4474('0x26')](handleEntityNotFound(_0x596a04,null))[_0x4474('0x26')](respondWithResult(_0x596a04,null))[_0x4474('0x46')](handleError(_0x596a04,null));};exports[_0x4474('0x4a')]=function(_0x39946b,_0x341648){return db[_0x4474('0x2e')][_0x4474('0x4a')](_0x39946b[_0x4474('0x4b')],{})[_0x4474('0x26')](respondWithResult(_0x341648,0xc9))['catch'](handleError(_0x341648,null));};exports[_0x4474('0x25')]=function(_0x27c13f,_0x252991){if(_0x27c13f[_0x4474('0x4b')]['id']){delete _0x27c13f['body']['id'];}return db['SquareDetailsReport'][_0x4474('0x4c')]({'where':{'id':_0x27c13f[_0x4474('0x47')]['id']}})[_0x4474('0x26')](handleEntityNotFound(_0x252991,null))[_0x4474('0x26')](saveUpdates(_0x27c13f['body'],null))['then'](respondWithResult(_0x252991,null))[_0x4474('0x46')](handleError(_0x252991,null));};exports[_0x4474('0x27')]=function(_0x29d11f,_0x185f50){return db[_0x4474('0x2e')][_0x4474('0x4c')]({'where':{'id':_0x29d11f[_0x4474('0x47')]['id']}})[_0x4474('0x26')](handleEntityNotFound(_0x185f50,null))['then'](removeEntity(_0x185f50,null))[_0x4474('0x46')](handleError(_0x185f50,null));};exports[_0x4474('0x4d')]=function(_0x15b9be,_0x456dce){return db[_0x4474('0x2e')]['describe']()[_0x4474('0x26')](respondWithResult(_0x456dce,null))[_0x4474('0x46')](handleError(_0x456dce,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index a555461..597ac65 100644 --- a/server/api/squareReportDetail/squareReportDetail.model.js +++ b/server/api/squareReportDetail/squareReportDetail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5ce=['report_square_details','util','../../config/logger','api','moment','bluebird','path','rimraf','./squareReportDetail.attributes','exports','SquareDetailsReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe5ce,0xa6));var _0xee5c=function(_0x291e9e,_0x2af7c3){_0x291e9e=_0x291e9e-0x0;var _0x78d755=_0xe5ce[_0x291e9e];return _0x78d755;};'use strict';var _=require('lodash');var util=require(_0xee5c('0x0'));var logger=require(_0xee5c('0x1'))(_0xee5c('0x2'));var moment=require(_0xee5c('0x3'));var BPromise=require(_0xee5c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee5c('0x5'));var rimraf=require(_0xee5c('0x6'));var config=require('../../config/environment');var attributes=require(_0xee5c('0x7'));module[_0xee5c('0x8')]=function(_0x1a9301,_0x46beb0){return _0x1a9301['define'](_0xee5c('0x9'),attributes,{'tableName':_0xee5c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa148=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','SquareDetailsReport','report_square_details','lodash'];(function(_0x8d5d75,_0x13b968){var _0x183dfc=function(_0x1a22ff){while(--_0x1a22ff){_0x8d5d75['push'](_0x8d5d75['shift']());}};_0x183dfc(++_0x13b968);}(_0xa148,0x1eb));var _0x8a14=function(_0xf01078,_0x3c27fa){_0xf01078=_0xf01078-0x0;var _0x264bc1=_0xa148[_0xf01078];return _0x264bc1;};'use strict';var _=require(_0x8a14('0x0'));var util=require(_0x8a14('0x1'));var logger=require(_0x8a14('0x2'))(_0x8a14('0x3'));var moment=require(_0x8a14('0x4'));var BPromise=require(_0x8a14('0x5'));var rp=require(_0x8a14('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a14('0x7'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0x8a14('0x8')]=function(_0x5accd5,_0x3ec5d7){return _0x5accd5[_0x8a14('0x9')](_0x8a14('0xa'),attributes,{'tableName':_0x8a14('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index f9bf0d3..b366613 100644 --- a/server/api/squareReportDetail/squareReportDetail.rpc.js +++ b/server/api/squareReportDetail/squareReportDetail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9348=['result','SquareDetailsReport','create','body','options','then','CreateSquareDetailsReport','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x22e3a7,_0xf0ae6d){var _0x199399=function(_0x3ff4c8){while(--_0x3ff4c8){_0x22e3a7['push'](_0x22e3a7['shift']());}};_0x199399(++_0xf0ae6d);}(_0x9348,0x10d));var _0x8934=function(_0x3d631a,_0x4d7d2d){_0x3d631a=_0x3d631a-0x0;var _0x5b8ee6=_0x9348[_0x3d631a];return _0x5b8ee6;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var moment=require(_0x8934('0x2'));var BPromise=require(_0x8934('0x3'));var rs=require(_0x8934('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8934('0x5'))['db'];var utils=require(_0x8934('0x6'));var logger=require('../../config/logger')(_0x8934('0x7'));var config=require(_0x8934('0x8'));var jayson=require(_0x8934('0x9'));var client=jayson[_0x8934('0xa')][_0x8934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ee9b9,_0x512f30,_0x284a62){return new BPromise(function(_0x3734c5,_0x1c7f03){return client['request'](_0x3ee9b9,_0x284a62)['then'](function(_0x5ec16d){logger['info'](_0x8934('0xc'),_0x512f30,'request\x20sent');logger[_0x8934('0xd')](_0x8934('0xe'),_0x512f30,_0x8934('0xf'),JSON[_0x8934('0x10')](_0x5ec16d));if(_0x5ec16d[_0x8934('0x11')]){if(_0x5ec16d[_0x8934('0x11')][_0x8934('0x12')]===0x1f4){logger[_0x8934('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x512f30,_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);return _0x1c7f03(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0x5ec16d['error'][_0x8934('0x13')]);return _0x3734c5(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}else{logger[_0x8934('0x14')](_0x8934('0xc'),_0x512f30,_0x8934('0xf'));_0x3734c5(_0x5ec16d[_0x8934('0x15')][_0x8934('0x13')]);}})['catch'](function(_0xb86bc9){logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0xb86bc9);_0x1c7f03(_0xb86bc9);});});}exports['CreateSquareDetailsReport']=function(_0x47f25e){var _0x597eed=this;return new Promise(function(_0x2ff9ce,_0x51f9ed){return db[_0x8934('0x16')][_0x8934('0x17')](_0x47f25e[_0x8934('0x18')],{'raw':_0x47f25e[_0x8934('0x19')]?_0x47f25e[_0x8934('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8934('0x1a')](function(_0x5ae49f){logger[_0x8934('0x14')](_0x8934('0x1b'),_0x47f25e);logger[_0x8934('0xd')](_0x8934('0x1b'),_0x47f25e,JSON[_0x8934('0x10')](_0x5ae49f));_0x2ff9ce(_0x5ae49f);})[_0x8934('0x1c')](function(_0x36fe20){logger['error'](_0x8934('0x1b'),_0x36fe20[_0x8934('0x13')],_0x47f25e);_0x51f9ed(_0x597eed[_0x8934('0x11')](0x1f4,_0x36fe20[_0x8934('0x13')]));});});}; \ No newline at end of file +var _0xe820=['raw','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSquareDetailsReport','SquareDetailsReport','create','body','options'];(function(_0x3c81d9,_0x3f7a75){var _0x55ac59=function(_0x4bde5a){while(--_0x4bde5a){_0x3c81d9['push'](_0x3c81d9['shift']());}};_0x55ac59(++_0x3f7a75);}(_0xe820,0xd2));var _0x0e82=function(_0x1c94c5,_0x391128){_0x1c94c5=_0x1c94c5-0x0;var _0x39ec19=_0xe820[_0x1c94c5];return _0x39ec19;};'use strict';var _=require(_0x0e82('0x0'));var util=require('util');var moment=require(_0x0e82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e82('0x2'));var db=require(_0x0e82('0x3'))['db'];var utils=require(_0x0e82('0x4'));var logger=require('../../config/logger')(_0x0e82('0x5'));var config=require('../../config/environment');var jayson=require(_0x0e82('0x6'));var client=jayson[_0x0e82('0x7')][_0x0e82('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x328b32,_0x2a0f9b,_0x55f277){return new BPromise(function(_0x10013b,_0x33c8a2){return client[_0x0e82('0x9')](_0x328b32,_0x55f277)[_0x0e82('0xa')](function(_0x3b7792){logger['info'](_0x0e82('0xb'),_0x2a0f9b,_0x0e82('0xc'));logger[_0x0e82('0xd')](_0x0e82('0xe'),_0x2a0f9b,_0x0e82('0xc'),JSON[_0x0e82('0xf')](_0x3b7792));if(_0x3b7792[_0x0e82('0x10')]){if(_0x3b7792['error'][_0x0e82('0x11')]===0x1f4){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x3b7792[_0x0e82('0x10')][_0x0e82('0x12')]);return _0x33c8a2(_0x3b7792[_0x0e82('0x10')]['message']);}logger[_0x0e82('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x2a0f9b,_0x3b7792['error'][_0x0e82('0x12')]);return _0x10013b(_0x3b7792['error']['message']);}else{logger['info'](_0x0e82('0xb'),_0x2a0f9b,'request\x20sent');_0x10013b(_0x3b7792['result'][_0x0e82('0x12')]);}})['catch'](function(_0x319303){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x319303);_0x33c8a2(_0x319303);});});}exports[_0x0e82('0x13')]=function(_0x53622b){var _0x25ac21=this;return new Promise(function(_0x310aac,_0x3a3ddf){return db[_0x0e82('0x14')][_0x0e82('0x15')](_0x53622b[_0x0e82('0x16')],{'raw':_0x53622b[_0x0e82('0x17')]?_0x53622b[_0x0e82('0x17')][_0x0e82('0x18')]===undefined?!![]:![]:!![]})[_0x0e82('0xa')](function(_0x5903c){logger['info']('CreateSquareDetailsReport',_0x53622b);logger[_0x0e82('0xd')](_0x0e82('0x13'),_0x53622b,JSON[_0x0e82('0xf')](_0x5903c));_0x310aac(_0x5903c);})[_0x0e82('0x19')](function(_0xd48046){logger[_0x0e82('0x10')](_0x0e82('0x13'),_0xd48046[_0x0e82('0x12')],_0x53622b);_0x3a3ddf(_0x25ac21['error'](0x1f4,_0xd48046[_0x0e82('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 4df3e69..e16f982 100644 --- a/server/api/system/index.js +++ b/server/api/system/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb8a=['./system.controller','isAuthenticated','/process/:pid/kill','killProcess','express','Router','../../components/auth/service'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xeb8a,0x19a));var _0xaeb8=function(_0x4a658e,_0x1cabd0){_0x4a658e=_0x4a658e-0x0;var _0x48cdee=_0xeb8a[_0x4a658e];return _0x48cdee;};'use strict';var express=require(_0xaeb8('0x0'));var router=express[_0xaeb8('0x1')]();var auth=require(_0xaeb8('0x2'));var controller=require(_0xaeb8('0x3'));router['get']('/',auth[_0xaeb8('0x4')](),controller['index']);router['get'](_0xaeb8('0x5'),auth['isAuthenticated'](),controller[_0xaeb8('0x6')]);module['exports']=router; \ No newline at end of file +var _0x186e=['isAuthenticated','killProcess','exports','express','Router','../../components/auth/service','./system.controller','get','index','/process/:pid/kill'];(function(_0x4067ac,_0x363603){var _0x53d74d=function(_0x492ad4){while(--_0x492ad4){_0x4067ac['push'](_0x4067ac['shift']());}};_0x53d74d(++_0x363603);}(_0x186e,0xb7));var _0xe186=function(_0xd7b801,_0x131442){_0xd7b801=_0xd7b801-0x0;var _0x5059be=_0x186e[_0xd7b801];return _0x5059be;};'use strict';var express=require(_0xe186('0x0'));var router=express[_0xe186('0x1')]();var auth=require(_0xe186('0x2'));var controller=require(_0xe186('0x3'));router[_0xe186('0x4')]('/',auth['isAuthenticated'](),controller[_0xe186('0x5')]);router[_0xe186('0x4')](_0xe186('0x6'),auth[_0xe186('0x7')](),controller[_0xe186('0x8')]);module[_0xe186('0x9')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 37c39d1..65980c7 100644 --- a/server/api/system/system.controller.js +++ b/server/api/system/system.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83a7=['catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','split','length','indexOf','params','kill','pid','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','getAllData','then','json'];(function(_0x272fed,_0x3d7138){var _0x3c983e=function(_0x569a61){while(--_0x569a61){_0x272fed['push'](_0x272fed['shift']());}};_0x3c983e(++_0x3d7138);}(_0x83a7,0x7c));var _0x783a=function(_0x54531d,_0x2700c8){_0x54531d=_0x54531d-0x0;var _0x2c730c=_0x83a7[_0x54531d];return _0x2c730c;};'use strict';var info=require(_0x783a('0x0'));var exec=require(_0x783a('0x1'))[_0x783a('0x2')];var logger=require(_0x783a('0x3'))(_0x783a('0x4'));var util=require(_0x783a('0x5'));var BPromise=require(_0x783a('0x6'));var _=require(_0x783a('0x7'));function handleError(_0x46e339,_0x39671e,_0x5cbc8b){_0x39671e=_0x39671e||0x1f4;return function(_0xaa97ff){logger['error'](_0x783a('0x8'),_0x5cbc8b,_0x39671e,util['inspect'](_0xaa97ff,{'showHidden':![],'depth':null}));delete _0xaa97ff[_0x783a('0x9')];_0x46e339[_0x783a('0xa')](_0x39671e)[_0x783a('0xb')](_0xaa97ff);};}exports[_0x783a('0xc')]=function(_0x455d98,_0x4c2a51){return info[_0x783a('0xd')]()[_0x783a('0xe')](function(_0x305d70){return _0x4c2a51[_0x783a('0xa')](0xc8)[_0x783a('0xf')](_0x305d70);})[_0x783a('0x10')](function(_0x255eab){return _0x4c2a51[_0x783a('0xa')](0x1f4)[_0x783a('0xf')](_0x255eab);});};exports[_0x783a('0x11')]=function(_0x8f5555,_0x295c79){var _0x3ff29c=[_0x783a('0x12')];return new BPromise(function(_0x5540ef,_0x287213){return exec(util[_0x783a('0x13')](_0x783a('0x14'),_0x8f5555['params']['pid']),function(_0x4cb781,_0x2ea549,_0x24abd6){if(_0x4cb781){return _0x287213(_0x4cb781);}return _0x5540ef(_0x2ea549);});})[_0x783a('0xe')](function(_0x130afc){var _0x13e643=![];var _0x83c4cd=_0x130afc[_0x783a('0x15')](/\n/);for(var _0x5bdce8=0x0,_0x51e4e2=_0x3ff29c[_0x783a('0x16')];_0x5bdce8<_0x51e4e2,_0x13e643===![];_0x5bdce8+=0x1){if(_0x130afc[_0x783a('0x17')](_0x3ff29c[_0x5bdce8])>=0x0){_0x13e643=!![];}}if(!_0x13e643){throw new Error(util[_0x783a('0x13')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x8f5555[_0x783a('0x18')]['pid']));}process[_0x783a('0x19')](_0x8f5555[_0x783a('0x18')][_0x783a('0x1a')],'SIGINT');return _0x295c79['status'](0xc8)[_0x783a('0xf')]({'message':util[_0x783a('0x13')](_0x783a('0x1b'),_0x8f5555[_0x783a('0x18')][_0x783a('0x1a')])});})['catch'](handleError(_0x295c79,null,_0x783a('0x11')));}; \ No newline at end of file +var _0xc574=['systeminformation','child_process','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','send','getAllData','then','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','status','killProcess'];(function(_0x2abdd0,_0x203be4){var _0x584742=function(_0x1ba469){while(--_0x1ba469){_0x2abdd0['push'](_0x2abdd0['shift']());}};_0x584742(++_0x203be4);}(_0xc574,0x1a9));var _0x4c57=function(_0x3ac4fd,_0x500cc4){_0x3ac4fd=_0x3ac4fd-0x0;var _0x505896=_0xc574[_0x3ac4fd];return _0x505896;};'use strict';var info=require(_0x4c57('0x0'));var exec=require(_0x4c57('0x1'))['exec'];var logger=require('../../config/logger')(_0x4c57('0x2'));var util=require(_0x4c57('0x3'));var BPromise=require(_0x4c57('0x4'));var _=require(_0x4c57('0x5'));function handleError(_0x12897a,_0x23a64d,_0x271833){_0x23a64d=_0x23a64d||0x1f4;return function(_0xef12f8){logger[_0x4c57('0x6')](_0x4c57('0x7'),_0x271833,_0x23a64d,util['inspect'](_0xef12f8,{'showHidden':![],'depth':null}));delete _0xef12f8[_0x4c57('0x8')];_0x12897a['status'](_0x23a64d)[_0x4c57('0x9')](_0xef12f8);};}exports['index']=function(_0x7be61c,_0x3c6012){return info[_0x4c57('0xa')]()[_0x4c57('0xb')](function(_0x1e4e47){return _0x3c6012['status'](0xc8)[_0x4c57('0xc')](_0x1e4e47);})[_0x4c57('0xd')](function(_0x5dbe92){return _0x3c6012['status'](0x1f4)[_0x4c57('0xc')](_0x5dbe92);});};exports['killProcess']=function(_0x218d80,_0x416a63){var _0x581a43=[_0x4c57('0xe')];return new BPromise(function(_0x267dd7,_0x324504){return exec(util[_0x4c57('0xf')](_0x4c57('0x10'),_0x218d80[_0x4c57('0x11')][_0x4c57('0x12')]),function(_0x4b0061,_0x47f0da,_0x43e177){if(_0x4b0061){return _0x324504(_0x4b0061);}return _0x267dd7(_0x47f0da);});})[_0x4c57('0xb')](function(_0xae8259){var _0x443416=![];var _0x3f6690=_0xae8259[_0x4c57('0x13')](/\n/);for(var _0x6e4da3=0x0,_0x3df254=_0x581a43['length'];_0x6e4da3<_0x3df254,_0x443416===![];_0x6e4da3+=0x1){if(_0xae8259[_0x4c57('0x14')](_0x581a43[_0x6e4da3])>=0x0){_0x443416=!![];}}if(!_0x443416){throw new Error(util['format'](_0x4c57('0x15'),_0x218d80['params'][_0x4c57('0x12')]));}process[_0x4c57('0x16')](_0x218d80[_0x4c57('0x11')][_0x4c57('0x12')],'SIGINT');return _0x416a63[_0x4c57('0x17')](0xc8)[_0x4c57('0xc')]({'message':util[_0x4c57('0xf')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x218d80['params'][_0x4c57('0x12')])});})[_0x4c57('0xd')](handleError(_0x416a63,null,_0x4c57('0x18')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index b5ef992..c42a5ff 100644 --- a/server/api/tag/index.js +++ b/server/api/tag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb458=['./tag.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','put','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1d211b,_0x475f3b){var _0x47c88b=function(_0x3126f5){while(--_0x3126f5){_0x1d211b['push'](_0x1d211b['shift']());}};_0x47c88b(++_0x475f3b);}(_0xb458,0x103));var _0x8b45=function(_0x115ac5,_0x24271a){_0x115ac5=_0x115ac5-0x0;var _0x2c13e6=_0xb458[_0x115ac5];return _0x2c13e6;};'use strict';var multer=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var path=require(_0x8b45('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8b45('0x3')]();var fs_extra=require(_0x8b45('0x4'));var auth=require(_0x8b45('0x5'));var interaction=require(_0x8b45('0x6'));var config=require('../../config/environment');var controller=require(_0x8b45('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8b45('0x8')]);router[_0x8b45('0x9')](_0x8b45('0xa'),auth[_0x8b45('0xb')](),controller[_0x8b45('0xc')]);router['get'](_0x8b45('0xd'),auth[_0x8b45('0xb')](),controller[_0x8b45('0xe')]);router[_0x8b45('0xf')]('/',auth[_0x8b45('0xb')](),controller['create']);router[_0x8b45('0x10')](_0x8b45('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8b45('0xb')](),controller[_0x8b45('0x11')]);module[_0x8b45('0x12')]=router; \ No newline at end of file +var _0xa8a8=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x1f063b,_0x321a3c){var _0x4d864b=function(_0x173dfe){while(--_0x173dfe){_0x1f063b['push'](_0x1f063b['shift']());}};_0x4d864b(++_0x321a3c);}(_0xa8a8,0xec));var _0x8a8a=function(_0x56d0f4,_0xfd5e32){_0x56d0f4=_0x56d0f4-0x0;var _0x17d0bc=_0xa8a8[_0x56d0f4];return _0x17d0bc;};'use strict';var multer=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var path=require(_0x8a8a('0x2'));var timeout=require(_0x8a8a('0x3'));var express=require('express');var router=express[_0x8a8a('0x4')]();var fs_extra=require(_0x8a8a('0x5'));var auth=require(_0x8a8a('0x6'));var interaction=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var controller=require(_0x8a8a('0x9'));router[_0x8a8a('0xa')]('/',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0xc')]);router[_0x8a8a('0xa')](_0x8a8a('0xd'),auth[_0x8a8a('0xb')](),controller[_0x8a8a('0xe')]);router[_0x8a8a('0xa')](_0x8a8a('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x8a8a('0x10')]('/',auth['isAuthenticated'](),controller[_0x8a8a('0x11')]);router[_0x8a8a('0x12')]('/:id',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0x13')]);router[_0x8a8a('0x14')]('/:id',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0x15')]);module[_0x8a8a('0x16')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 5bbdb34..c712d14 100644 --- a/server/api/tag/tag.attributes.js +++ b/server/api/tag/tag.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa958=['sequelize','STRING','name','#0091EA'];(function(_0x41397b,_0x481d0e){var _0x5f4677=function(_0x4a0b5b){while(--_0x4a0b5b){_0x41397b['push'](_0x41397b['shift']());}};_0x5f4677(++_0x481d0e);}(_0xa958,0x94));var _0x8a95=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xa958[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x8a95('0x0'));module['exports']={'name':{'type':Sequelize[_0x8a95('0x1')],'unique':_0x8a95('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8a95('0x1')],'defaultValue':_0x8a95('0x3')},'description':{'type':Sequelize[_0x8a95('0x1')]}}; \ No newline at end of file +var _0x1491=['STRING','name','#0091EA','sequelize','exports'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x1491,0x1b1));var _0x1149=function(_0x511ad6,_0x59a681){_0x511ad6=_0x511ad6-0x0;var _0x47dd81=_0x1491[_0x511ad6];return _0x47dd81;};'use strict';var Sequelize=require(_0x1149('0x0'));module[_0x1149('0x1')]={'name':{'type':Sequelize[_0x1149('0x2')],'unique':_0x1149('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x1149('0x4')},'description':{'type':Sequelize[_0x1149('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 168d156..3015a37 100644 --- a/server/api/tag/tag.controller.js +++ b/server/api/tag/tag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2d7=['length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','count','status','set','apply','reject','save','then','get','Tags','error','stack','name','send','map','Tag','fieldName','type','model','query','keys','intersection','attributes','fields'];(function(_0x5355ee,_0x49e4d0){var _0x35e48e=function(_0xa2e910){while(--_0xa2e910){_0x5355ee['push'](_0x5355ee['shift']());}};_0x35e48e(++_0x49e4d0);}(_0xb2d7,0x155));var _0x7b2d=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xb2d7[_0x2160a9];return _0xa88cf7;};'use strict';var emlformat=require(_0x7b2d('0x0'));var rimraf=require(_0x7b2d('0x1'));var zipdir=require(_0x7b2d('0x2'));var jsonpatch=require(_0x7b2d('0x3'));var rp=require(_0x7b2d('0x4'));var moment=require(_0x7b2d('0x5'));var BPromise=require(_0x7b2d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7b2d('0x7'));var sox=require(_0x7b2d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b2d('0x9'));var _=require(_0x7b2d('0xa'));var squel=require(_0x7b2d('0xb'));var crypto=require(_0x7b2d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7b2d('0xd'));var querystring=require(_0x7b2d('0xe'));var Papa=require(_0x7b2d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7b2d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b2d('0x11'))(_0x7b2d('0x12'));var utils=require('../../config/utils');var config=require(_0x7b2d('0x13'));var licenseUtil=require(_0x7b2d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bf844,_0x30952e){_0x30952e=_0x30952e||0xcc;return function(_0x35e0fe){if(_0x35e0fe){return _0x1bf844[_0x7b2d('0x15')](_0x30952e);}return _0x1bf844['status'](_0x30952e)['end']();};}function respondWithResult(_0x3df61a,_0x2ccc3c){_0x2ccc3c=_0x2ccc3c||0xc8;return function(_0x527db4){if(_0x527db4){return _0x3df61a['status'](_0x2ccc3c)[_0x7b2d('0x16')](_0x527db4);}};}function respondWithFilteredResult(_0x431a78,_0x46f590){return function(_0x2197aa){if(_0x2197aa){var _0x33fa2b=typeof _0x46f590[_0x7b2d('0x17')]===_0x7b2d('0x18')&&typeof _0x46f590[_0x7b2d('0x19')]===_0x7b2d('0x18');var _0x52b662=_0x2197aa['count'];var _0x1c08bc=_0x33fa2b?0x0:_0x46f590[_0x7b2d('0x17')];var _0x2e132f=_0x33fa2b?_0x2197aa[_0x7b2d('0x1a')]:_0x46f590[_0x7b2d('0x17')]+_0x46f590[_0x7b2d('0x19')];var _0x1c361f;if(_0x2e132f>=_0x52b662){_0x2e132f=_0x52b662;_0x1c361f=0xc8;}else{_0x1c361f=0xce;}_0x431a78[_0x7b2d('0x1b')](_0x1c361f);return _0x431a78[_0x7b2d('0x1c')]('Content-Range',_0x1c08bc+'-'+_0x2e132f+'/'+_0x52b662)[_0x7b2d('0x16')](_0x2197aa);}return null;};}function patchUpdates(_0x401dca){return function(_0x17f114){try{jsonpatch[_0x7b2d('0x1d')](_0x17f114,_0x401dca,!![]);}catch(_0x47503f){return BPromise[_0x7b2d('0x1e')](_0x47503f);}return _0x17f114[_0x7b2d('0x1f')]();};}function saveUpdates(_0x1e85b7,_0x480aeb){return function(_0x546924){if(_0x546924){return _0x546924['update'](_0x1e85b7)['then'](function(_0x33d34b){return _0x33d34b;});}return null;};}function removeEntity(_0x240a71,_0x160ca4){return function(_0x514495){if(_0x514495){return _0x514495['destroy']()[_0x7b2d('0x20')](function(){var _0x199215=_0x514495[_0x7b2d('0x21')]({'plain':!![]});var _0x2aa01d=_0x7b2d('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x2aa01d,'resourceId':_0x199215['id']}})[_0x7b2d('0x20')](function(){return _0x514495;});})[_0x7b2d('0x20')](function(){_0x240a71[_0x7b2d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43bb96,_0x7d3986){return function(_0xf4f5f2){if(!_0xf4f5f2){_0x43bb96[_0x7b2d('0x15')](0x194);}return _0xf4f5f2;};}function handleError(_0x3095ec,_0x202c98){_0x202c98=_0x202c98||0x1f4;return function(_0x559487){logger[_0x7b2d('0x23')](_0x559487[_0x7b2d('0x24')]);if(_0x559487[_0x7b2d('0x25')]){delete _0x559487[_0x7b2d('0x25')];}_0x3095ec[_0x7b2d('0x1b')](_0x202c98)[_0x7b2d('0x26')](_0x559487);};}exports['index']=function(_0x4bc234,_0x549779){var _0x4fa3dd={},_0x3737f2={},_0x5f2073={'count':0x0,'rows':[]};var _0x4909c1=_[_0x7b2d('0x27')](db[_0x7b2d('0x28')]['rawAttributes'],function(_0x556c3e){return{'name':_0x556c3e[_0x7b2d('0x29')],'type':_0x556c3e[_0x7b2d('0x2a')]['key']};});_0x3737f2[_0x7b2d('0x2b')]=_[_0x7b2d('0x27')](_0x4909c1,'name');_0x3737f2[_0x7b2d('0x2c')]=_[_0x7b2d('0x2d')](_0x4bc234[_0x7b2d('0x2c')]);_0x3737f2['filters']=_[_0x7b2d('0x2e')](_0x3737f2[_0x7b2d('0x2b')],_0x3737f2[_0x7b2d('0x2c')]);_0x4fa3dd[_0x7b2d('0x2f')]=_[_0x7b2d('0x2e')](_0x3737f2[_0x7b2d('0x2b')],qs[_0x7b2d('0x30')](_0x4bc234['query'][_0x7b2d('0x30')]));_0x4fa3dd[_0x7b2d('0x2f')]=_0x4fa3dd['attributes'][_0x7b2d('0x31')]?_0x4fa3dd['attributes']:_0x3737f2['model'];if(!_0x4bc234[_0x7b2d('0x2c')][_0x7b2d('0x32')]('nolimit')){_0x4fa3dd[_0x7b2d('0x19')]=qs[_0x7b2d('0x19')](_0x4bc234[_0x7b2d('0x2c')][_0x7b2d('0x19')]);_0x4fa3dd[_0x7b2d('0x17')]=qs[_0x7b2d('0x17')](_0x4bc234[_0x7b2d('0x2c')][_0x7b2d('0x17')]);}_0x4fa3dd[_0x7b2d('0x33')]=qs[_0x7b2d('0x34')](_0x4bc234[_0x7b2d('0x2c')]['sort']);_0x4fa3dd[_0x7b2d('0x35')]=qs[_0x7b2d('0x36')](_[_0x7b2d('0x37')](_0x4bc234[_0x7b2d('0x2c')],_0x3737f2['filters']),_0x4909c1);if(_0x4bc234[_0x7b2d('0x2c')][_0x7b2d('0x38')]){_0x4fa3dd[_0x7b2d('0x35')]=_['merge'](_0x4fa3dd[_0x7b2d('0x35')],{'$or':_[_0x7b2d('0x27')](_0x4909c1,function(_0x59f5d6){if(_0x59f5d6[_0x7b2d('0x2a')]!=='VIRTUAL'){var _0xc39b90={};_0xc39b90[_0x59f5d6[_0x7b2d('0x25')]]={'$like':'%'+_0x4bc234['query']['filter']+'%'};return _0xc39b90;}})});}_0x4fa3dd=_[_0x7b2d('0x39')]({},_0x4fa3dd,_0x4bc234['options']);var _0x32c9e2={'where':_0x4fa3dd[_0x7b2d('0x35')]};return db[_0x7b2d('0x28')]['count'](_0x32c9e2)['then'](function(_0x1c59e6){_0x5f2073['count']=_0x1c59e6;if(_0x4bc234[_0x7b2d('0x2c')][_0x7b2d('0x3a')]){_0x4fa3dd[_0x7b2d('0x3b')]=[{'all':!![]}];}return db[_0x7b2d('0x28')][_0x7b2d('0x3c')](_0x4fa3dd);})[_0x7b2d('0x20')](function(_0x3f2e7a){_0x5f2073[_0x7b2d('0x3d')]=_0x3f2e7a;return _0x5f2073;})['then'](respondWithFilteredResult(_0x549779,_0x4fa3dd))[_0x7b2d('0x3e')](handleError(_0x549779,null));};exports['show']=function(_0x2657a8,_0x6fd340){var _0x3bae87={'raw':!![],'where':{'id':_0x2657a8[_0x7b2d('0x3f')]['id']}},_0x2543a4={};_0x2543a4[_0x7b2d('0x2b')]=_[_0x7b2d('0x2d')](db[_0x7b2d('0x28')][_0x7b2d('0x40')]);_0x2543a4[_0x7b2d('0x2c')]=_[_0x7b2d('0x2d')](_0x2657a8[_0x7b2d('0x2c')]);_0x2543a4['filters']=_[_0x7b2d('0x2e')](_0x2543a4[_0x7b2d('0x2b')],_0x2543a4[_0x7b2d('0x2c')]);_0x3bae87['attributes']=_[_0x7b2d('0x2e')](_0x2543a4[_0x7b2d('0x2b')],qs['fields'](_0x2657a8['query'][_0x7b2d('0x30')]));_0x3bae87[_0x7b2d('0x2f')]=_0x3bae87[_0x7b2d('0x2f')][_0x7b2d('0x31')]?_0x3bae87[_0x7b2d('0x2f')]:_0x2543a4[_0x7b2d('0x2b')];if(_0x2657a8[_0x7b2d('0x2c')][_0x7b2d('0x3a')]){_0x3bae87[_0x7b2d('0x3b')]=[{'all':!![]}];}_0x3bae87=_[_0x7b2d('0x39')]({},_0x3bae87,_0x2657a8[_0x7b2d('0x41')]);return db[_0x7b2d('0x28')][_0x7b2d('0x42')](_0x3bae87)[_0x7b2d('0x20')](handleEntityNotFound(_0x6fd340,null))['then'](respondWithResult(_0x6fd340,null))[_0x7b2d('0x3e')](handleError(_0x6fd340,null));};exports['create']=function(_0x13139f,_0x3884d9){return db[_0x7b2d('0x28')]['create'](_0x13139f['body'],{})['then'](function(_0x344533){var _0x1f5f4f=_0x13139f[_0x7b2d('0x43')]['get']({'plain':!![]});if(!_0x1f5f4f)throw new Error(_0x7b2d('0x44'));if(_0x1f5f4f[_0x7b2d('0x45')]===_0x7b2d('0x43')){var _0x2b88d2=_0x344533[_0x7b2d('0x21')]({'plain':!![]});var _0x45de27=_0x7b2d('0x22');return db[_0x7b2d('0x46')][_0x7b2d('0x42')]({'where':{'name':_0x45de27,'userProfileId':_0x1f5f4f['userProfileId']},'raw':!![]})['then'](function(_0x4f5bad){if(_0x4f5bad&&_0x4f5bad[_0x7b2d('0x47')]===0x0){return db[_0x7b2d('0x48')][_0x7b2d('0x49')]({'name':_0x2b88d2[_0x7b2d('0x25')],'resourceId':_0x2b88d2['id'],'type':_0x4f5bad[_0x7b2d('0x25')],'sectionId':_0x4f5bad['id']},{})[_0x7b2d('0x20')](function(){return _0x344533;});}else{return _0x344533;}})[_0x7b2d('0x3e')](function(_0x1e7e2a){logger[_0x7b2d('0x23')](_0x7b2d('0x4a'),_0x1e7e2a);throw _0x1e7e2a;});}return _0x344533;})[_0x7b2d('0x20')](respondWithResult(_0x3884d9,0xc9))[_0x7b2d('0x3e')](handleError(_0x3884d9,null));};exports[_0x7b2d('0x4b')]=function(_0x1c3637,_0x21f802){if(_0x1c3637[_0x7b2d('0x4c')]['id']){delete _0x1c3637['body']['id'];}return db[_0x7b2d('0x28')][_0x7b2d('0x42')]({'where':{'id':_0x1c3637['params']['id']}})[_0x7b2d('0x20')](handleEntityNotFound(_0x21f802,null))[_0x7b2d('0x20')](saveUpdates(_0x1c3637[_0x7b2d('0x4c')],null))[_0x7b2d('0x20')](respondWithResult(_0x21f802,null))[_0x7b2d('0x3e')](handleError(_0x21f802,null));};exports['destroy']=function(_0x26bb20,_0x56a2f7){return db[_0x7b2d('0x28')]['find']({'where':{'id':_0x26bb20[_0x7b2d('0x3f')]['id']}})[_0x7b2d('0x20')](handleEntityNotFound(_0x56a2f7,null))[_0x7b2d('0x20')](removeEntity(_0x56a2f7,null))[_0x7b2d('0x3e')](handleError(_0x56a2f7,null));};exports[_0x7b2d('0x4d')]=function(_0x17cf19,_0x1e4676){return db[_0x7b2d('0x28')][_0x7b2d('0x4d')]()[_0x7b2d('0x20')](respondWithResult(_0x1e4676,null))['catch'](handleError(_0x1e4676,null));}; \ No newline at end of file +var _0x47dd=['length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','Tag','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','get','Tags','UserProfileResource','stack','name','send','index','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields'];(function(_0x243e78,_0x25de7a){var _0x3bebf2=function(_0x2ac963){while(--_0x2ac963){_0x243e78['push'](_0x243e78['shift']());}};_0x3bebf2(++_0x25de7a);}(_0x47dd,0x176));var _0xd47d=function(_0x378b4,_0x5ca7fa){_0x378b4=_0x378b4-0x0;var _0x11d07b=_0x47dd[_0x378b4];return _0x11d07b;};'use strict';var emlformat=require(_0xd47d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd47d('0x1'));var jsonpatch=require(_0xd47d('0x2'));var rp=require(_0xd47d('0x3'));var moment=require(_0xd47d('0x4'));var BPromise=require(_0xd47d('0x5'));var Mustache=require(_0xd47d('0x6'));var util=require(_0xd47d('0x7'));var path=require(_0xd47d('0x8'));var sox=require(_0xd47d('0x9'));var csv=require(_0xd47d('0xa'));var ejs=require(_0xd47d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd47d('0xc'));var squel=require(_0xd47d('0xd'));var crypto=require('crypto');var jsforce=require(_0xd47d('0xe'));var deskjs=require(_0xd47d('0xf'));var toCsv=require(_0xd47d('0xa'));var querystring=require(_0xd47d('0x10'));var Papa=require(_0xd47d('0x11'));var Redis=require(_0xd47d('0x12'));var authService=require(_0xd47d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd47d('0x14'));var logger=require(_0xd47d('0x15'))(_0xd47d('0x16'));var utils=require('../../config/utils');var config=require(_0xd47d('0x17'));var licenseUtil=require(_0xd47d('0x18'));var db=require(_0xd47d('0x19'))['db'];function respondWithStatusCode(_0x1f6260,_0x2c35c0){_0x2c35c0=_0x2c35c0||0xcc;return function(_0x5dcd10){if(_0x5dcd10){return _0x1f6260[_0xd47d('0x1a')](_0x2c35c0);}return _0x1f6260[_0xd47d('0x1b')](_0x2c35c0)[_0xd47d('0x1c')]();};}function respondWithResult(_0xdabd8,_0x422160){_0x422160=_0x422160||0xc8;return function(_0x24781e){if(_0x24781e){return _0xdabd8[_0xd47d('0x1b')](_0x422160)[_0xd47d('0x1d')](_0x24781e);}};}function respondWithFilteredResult(_0x4ad2a0,_0x4e2512){return function(_0x280b9a){if(_0x280b9a){var _0x372399=typeof _0x4e2512[_0xd47d('0x1e')]==='undefined'&&typeof _0x4e2512['limit']===_0xd47d('0x1f');var _0x24983e=_0x280b9a[_0xd47d('0x20')];var _0x499379=_0x372399?0x0:_0x4e2512[_0xd47d('0x1e')];var _0x377e4a=_0x372399?_0x280b9a[_0xd47d('0x20')]:_0x4e2512[_0xd47d('0x1e')]+_0x4e2512[_0xd47d('0x21')];var _0x1ddcc9;if(_0x377e4a>=_0x24983e){_0x377e4a=_0x24983e;_0x1ddcc9=0xc8;}else{_0x1ddcc9=0xce;}_0x4ad2a0['status'](_0x1ddcc9);return _0x4ad2a0[_0xd47d('0x22')]('Content-Range',_0x499379+'-'+_0x377e4a+'/'+_0x24983e)['json'](_0x280b9a);}return null;};}function patchUpdates(_0x167ff9){return function(_0x386380){try{jsonpatch['apply'](_0x386380,_0x167ff9,!![]);}catch(_0x20e3be){return BPromise[_0xd47d('0x23')](_0x20e3be);}return _0x386380[_0xd47d('0x24')]();};}function saveUpdates(_0x572b3b,_0x279bc5){return function(_0x2011ec){if(_0x2011ec){return _0x2011ec[_0xd47d('0x25')](_0x572b3b)[_0xd47d('0x26')](function(_0x5ee747){return _0x5ee747;});}return null;};}function removeEntity(_0xcde834,_0x32b7c1){return function(_0x4e7a5d){if(_0x4e7a5d){return _0x4e7a5d[_0xd47d('0x27')]()['then'](function(){var _0x203f41=_0x4e7a5d[_0xd47d('0x28')]({'plain':!![]});var _0x181853=_0xd47d('0x29');return db[_0xd47d('0x2a')][_0xd47d('0x27')]({'where':{'type':_0x181853,'resourceId':_0x203f41['id']}})[_0xd47d('0x26')](function(){return _0x4e7a5d;});})['then'](function(){_0xcde834[_0xd47d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x480b5a,_0x5c3254){return function(_0x2cb58c){if(!_0x2cb58c){_0x480b5a[_0xd47d('0x1a')](0x194);}return _0x2cb58c;};}function handleError(_0xe15999,_0x148e80){_0x148e80=_0x148e80||0x1f4;return function(_0x487851){logger['error'](_0x487851[_0xd47d('0x2b')]);if(_0x487851[_0xd47d('0x2c')]){delete _0x487851[_0xd47d('0x2c')];}_0xe15999[_0xd47d('0x1b')](_0x148e80)[_0xd47d('0x2d')](_0x487851);};}exports[_0xd47d('0x2e')]=function(_0x27cf86,_0x51dea3){var _0x183fff={},_0xc69bb5={},_0x16d9ea={'count':0x0,'rows':[]};var _0x11a707=_['map'](db['Tag'][_0xd47d('0x2f')],function(_0x41274b){return{'name':_0x41274b['fieldName'],'type':_0x41274b['type'][_0xd47d('0x30')]};});_0xc69bb5[_0xd47d('0x31')]=_['map'](_0x11a707,_0xd47d('0x2c'));_0xc69bb5['query']=_[_0xd47d('0x32')](_0x27cf86[_0xd47d('0x33')]);_0xc69bb5[_0xd47d('0x34')]=_[_0xd47d('0x35')](_0xc69bb5['model'],_0xc69bb5['query']);_0x183fff[_0xd47d('0x36')]=_[_0xd47d('0x35')](_0xc69bb5[_0xd47d('0x31')],qs[_0xd47d('0x37')](_0x27cf86[_0xd47d('0x33')]['fields']));_0x183fff['attributes']=_0x183fff[_0xd47d('0x36')][_0xd47d('0x38')]?_0x183fff[_0xd47d('0x36')]:_0xc69bb5[_0xd47d('0x31')];if(!_0x27cf86[_0xd47d('0x33')][_0xd47d('0x39')](_0xd47d('0x3a'))){_0x183fff[_0xd47d('0x21')]=qs['limit'](_0x27cf86[_0xd47d('0x33')]['limit']);_0x183fff[_0xd47d('0x1e')]=qs[_0xd47d('0x1e')](_0x27cf86[_0xd47d('0x33')][_0xd47d('0x1e')]);}_0x183fff['order']=qs[_0xd47d('0x3b')](_0x27cf86[_0xd47d('0x33')][_0xd47d('0x3b')]);_0x183fff[_0xd47d('0x3c')]=qs[_0xd47d('0x34')](_[_0xd47d('0x3d')](_0x27cf86['query'],_0xc69bb5[_0xd47d('0x34')]),_0x11a707);if(_0x27cf86[_0xd47d('0x33')]['filter']){_0x183fff[_0xd47d('0x3c')]=_[_0xd47d('0x3e')](_0x183fff[_0xd47d('0x3c')],{'$or':_['map'](_0x11a707,function(_0x1476da){if(_0x1476da[_0xd47d('0x3f')]!==_0xd47d('0x40')){var _0x1c4d75={};_0x1c4d75[_0x1476da['name']]={'$like':'%'+_0x27cf86['query'][_0xd47d('0x41')]+'%'};return _0x1c4d75;}})});}_0x183fff=_[_0xd47d('0x3e')]({},_0x183fff,_0x27cf86[_0xd47d('0x42')]);var _0x5f137e={'where':_0x183fff[_0xd47d('0x3c')]};return db[_0xd47d('0x43')][_0xd47d('0x20')](_0x5f137e)[_0xd47d('0x26')](function(_0x5cf69c){_0x16d9ea[_0xd47d('0x20')]=_0x5cf69c;if(_0x27cf86[_0xd47d('0x33')][_0xd47d('0x44')]){_0x183fff['include']=[{'all':!![]}];}return db['Tag'][_0xd47d('0x45')](_0x183fff);})[_0xd47d('0x26')](function(_0x4b45c2){_0x16d9ea[_0xd47d('0x46')]=_0x4b45c2;return _0x16d9ea;})[_0xd47d('0x26')](respondWithFilteredResult(_0x51dea3,_0x183fff))[_0xd47d('0x47')](handleError(_0x51dea3,null));};exports[_0xd47d('0x48')]=function(_0x3dc72f,_0x51610f){var _0x371544={'raw':!![],'where':{'id':_0x3dc72f[_0xd47d('0x49')]['id']}},_0x20ddf4={};_0x20ddf4[_0xd47d('0x31')]=_[_0xd47d('0x32')](db['Tag']['rawAttributes']);_0x20ddf4[_0xd47d('0x33')]=_['keys'](_0x3dc72f[_0xd47d('0x33')]);_0x20ddf4[_0xd47d('0x34')]=_[_0xd47d('0x35')](_0x20ddf4[_0xd47d('0x31')],_0x20ddf4['query']);_0x371544['attributes']=_[_0xd47d('0x35')](_0x20ddf4['model'],qs[_0xd47d('0x37')](_0x3dc72f[_0xd47d('0x33')]['fields']));_0x371544[_0xd47d('0x36')]=_0x371544[_0xd47d('0x36')][_0xd47d('0x38')]?_0x371544['attributes']:_0x20ddf4[_0xd47d('0x31')];if(_0x3dc72f[_0xd47d('0x33')][_0xd47d('0x44')]){_0x371544[_0xd47d('0x4a')]=[{'all':!![]}];}_0x371544=_[_0xd47d('0x3e')]({},_0x371544,_0x3dc72f[_0xd47d('0x42')]);return db[_0xd47d('0x43')][_0xd47d('0x4b')](_0x371544)[_0xd47d('0x26')](handleEntityNotFound(_0x51610f,null))[_0xd47d('0x26')](respondWithResult(_0x51610f,null))[_0xd47d('0x47')](handleError(_0x51610f,null));};exports[_0xd47d('0x4c')]=function(_0x5632e6,_0x1e3429){return db['Tag'][_0xd47d('0x4c')](_0x5632e6[_0xd47d('0x4d')],{})[_0xd47d('0x26')](function(_0x45ca16){var _0x13ee24=_0x5632e6[_0xd47d('0x4e')][_0xd47d('0x28')]({'plain':!![]});if(!_0x13ee24)throw new Error(_0xd47d('0x4f'));if(_0x13ee24[_0xd47d('0x50')]===_0xd47d('0x4e')){var _0x29c855=_0x45ca16[_0xd47d('0x28')]({'plain':!![]});var _0x82ee8c=_0xd47d('0x29');return db[_0xd47d('0x51')][_0xd47d('0x4b')]({'where':{'name':_0x82ee8c,'userProfileId':_0x13ee24[_0xd47d('0x52')]},'raw':!![]})[_0xd47d('0x26')](function(_0x5c4b6b){if(_0x5c4b6b&&_0x5c4b6b[_0xd47d('0x53')]===0x0){return db[_0xd47d('0x2a')][_0xd47d('0x4c')]({'name':_0x29c855['name'],'resourceId':_0x29c855['id'],'type':_0x5c4b6b[_0xd47d('0x2c')],'sectionId':_0x5c4b6b['id']},{})[_0xd47d('0x26')](function(){return _0x45ca16;});}else{return _0x45ca16;}})['catch'](function(_0x200b45){logger[_0xd47d('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x200b45);throw _0x200b45;});}return _0x45ca16;})[_0xd47d('0x26')](respondWithResult(_0x1e3429,0xc9))['catch'](handleError(_0x1e3429,null));};exports['update']=function(_0xe4277d,_0xc7af6e){if(_0xe4277d[_0xd47d('0x4d')]['id']){delete _0xe4277d[_0xd47d('0x4d')]['id'];}return db[_0xd47d('0x43')]['find']({'where':{'id':_0xe4277d[_0xd47d('0x49')]['id']}})[_0xd47d('0x26')](handleEntityNotFound(_0xc7af6e,null))[_0xd47d('0x26')](saveUpdates(_0xe4277d['body'],null))['then'](respondWithResult(_0xc7af6e,null))[_0xd47d('0x47')](handleError(_0xc7af6e,null));};exports[_0xd47d('0x27')]=function(_0x3b7087,_0x4973bd){return db[_0xd47d('0x43')]['find']({'where':{'id':_0x3b7087[_0xd47d('0x49')]['id']}})[_0xd47d('0x26')](handleEntityNotFound(_0x4973bd,null))[_0xd47d('0x26')](removeEntity(_0x4973bd,null))[_0xd47d('0x47')](handleError(_0x4973bd,null));};exports[_0xd47d('0x55')]=function(_0x317a4d,_0x2bcd6d){return db[_0xd47d('0x43')]['describe']()['then'](respondWithResult(_0x2bcd6d,null))[_0xd47d('0x47')](handleError(_0x2bcd6d,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 6140286..c545309 100644 --- a/server/api/tag/tag.model.js +++ b/server/api/tag/tag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cba=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','define','tools_tags','lodash'];(function(_0x20ab9f,_0x3b5533){var _0x2ac34e=function(_0x78a84b){while(--_0x78a84b){_0x20ab9f['push'](_0x20ab9f['shift']());}};_0x2ac34e(++_0x3b5533);}(_0x5cba,0xd0));var _0xa5cb=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x5cba[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xa5cb('0x0'));var util=require(_0xa5cb('0x1'));var logger=require(_0xa5cb('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa5cb('0x3'));var rp=require(_0xa5cb('0x4'));var fs=require('fs');var path=require(_0xa5cb('0x5'));var rimraf=require(_0xa5cb('0x6'));var config=require(_0xa5cb('0x7'));var attributes=require(_0xa5cb('0x8'));module['exports']=function(_0x44fe0a,_0x3f076c){return _0x44fe0a[_0xa5cb('0x9')]('Tag',attributes,{'tableName':_0xa5cb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81f1=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags'];(function(_0x5ad220,_0x27407e){var _0xdec77d=function(_0x58d736){while(--_0x58d736){_0x5ad220['push'](_0x5ad220['shift']());}};_0xdec77d(++_0x27407e);}(_0x81f1,0x16c));var _0x181f=function(_0x39458a,_0x30fd7c){_0x39458a=_0x39458a-0x0;var _0x6a3817=_0x81f1[_0x39458a];return _0x6a3817;};'use strict';var _=require(_0x181f('0x0'));var util=require(_0x181f('0x1'));var logger=require('../../config/logger')(_0x181f('0x2'));var moment=require(_0x181f('0x3'));var BPromise=require(_0x181f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x181f('0x5'));var rimraf=require(_0x181f('0x6'));var config=require(_0x181f('0x7'));var attributes=require(_0x181f('0x8'));module[_0x181f('0x9')]=function(_0x41a49a,_0x341e59){return _0x41a49a[_0x181f('0xa')](_0x181f('0xb'),attributes,{'tableName':_0x181f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 504518e..3deb7ee 100644 --- a/server/api/tag/tag.rpc.js +++ b/server/api/tag/tag.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Tag,\x20%s,\x20%s','message','catch','util'];(function(_0x4a05a7,_0x1d4d0e){var _0x206c80=function(_0x48e5d1){while(--_0x48e5d1){_0x4a05a7['push'](_0x4a05a7['shift']());}};_0x206c80(++_0x1d4d0e);}(_0xedd9,0xfc));var _0x9edd=function(_0x358fb5,_0x4407b8){_0x358fb5=_0x358fb5-0x0;var _0x4abfeb=_0xedd9[_0x358fb5];return _0x4abfeb;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('Tag,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('Tag,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +var _0x202c=['message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3bcc59,_0x194389){var _0x4f8f7e=function(_0x152ace){while(--_0x152ace){_0x3bcc59['push'](_0x3bcc59['shift']());}};_0x4f8f7e(++_0x194389);}(_0x202c,0x178));var _0xc202=function(_0x29588b,_0x582f54){_0x29588b=_0x29588b-0x0;var _0x1192bf=_0x202c[_0x29588b];return _0x1192bf;};'use strict';var _=require(_0xc202('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc202('0x1'));var rs=require(_0xc202('0x2'));var fs=require('fs');var Redis=require(_0xc202('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc202('0x4'));var logger=require(_0xc202('0x5'))(_0xc202('0x6'));var config=require(_0xc202('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc202('0x8')][_0xc202('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59563a,_0xc2b3eb,_0x574549){return new BPromise(function(_0x872c1a,_0x5978fe){return client[_0xc202('0xa')](_0x59563a,_0x574549)[_0xc202('0xb')](function(_0x36fcb7){logger[_0xc202('0xc')](_0xc202('0xd'),_0xc2b3eb,_0xc202('0xe'));logger[_0xc202('0xf')](_0xc202('0x10'),_0xc2b3eb,_0xc202('0xe'),JSON[_0xc202('0x11')](_0x36fcb7));if(_0x36fcb7[_0xc202('0x12')]){if(_0x36fcb7['error'][_0xc202('0x13')]===0x1f4){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);return _0x5978fe(_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);}logger['error'](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')]['message']);return _0x872c1a(_0x36fcb7['error']['message']);}else{logger[_0xc202('0xc')]('Tag,\x20%s,\x20%s',_0xc2b3eb,_0xc202('0xe'));_0x872c1a(_0x36fcb7['result'][_0xc202('0x14')]);}})[_0xc202('0x15')](function(_0x3018c8){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x3018c8);_0x5978fe(_0x3018c8);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index faf3991..e8fb324 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index e1dbb47..3a4f7f8 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['STRING','name'];(function(_0x5196f0,_0x57586f){var _0x5c462d=function(_0x330fad){while(--_0x330fad){_0x5196f0['push'](_0x5196f0['shift']());}};_0x5c462d(++_0x57586f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x104360,_0x4eea09){var _0x5580db=function(_0xa6de28){while(--_0xa6de28){_0x104360['push'](_0x104360['shift']());}};_0x5580db(++_0x4eea09);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 7c9b1df..cd08e6a 100644 --- a/server/api/team/team.controller.js +++ b/server/api/team/team.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d57=['catch','show','params','intersection','find','create','body','user','get','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','end','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','add','ids','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','transaction','through','QueueId','defaults','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','findAll','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','all','spread','removeAgents','Whatsapp','TeamVoicePrefix','rawAttributes','order','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','update','then','stack','name','send','index','map','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','Team','includeAll','include','rows'];(function(_0x5da4d8,_0x31cca6){var _0x354518=function(_0x1abe20){while(--_0x1abe20){_0x5da4d8['push'](_0x5da4d8['shift']());}};_0x354518(++_0x31cca6);}(_0x8d57,0x101));var _0x78d5=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x8d57[_0xbe200f];return _0x192597;};'use strict';var emlformat=require(_0x78d5('0x0'));var rimraf=require(_0x78d5('0x1'));var zipdir=require(_0x78d5('0x2'));var jsonpatch=require(_0x78d5('0x3'));var rp=require(_0x78d5('0x4'));var moment=require(_0x78d5('0x5'));var BPromise=require(_0x78d5('0x6'));var Mustache=require(_0x78d5('0x7'));var util=require(_0x78d5('0x8'));var path=require(_0x78d5('0x9'));var sox=require(_0x78d5('0xa'));var csv=require(_0x78d5('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x78d5('0xc'));var _=require('lodash');var squel=require(_0x78d5('0xd'));var crypto=require('crypto');var jsforce=require(_0x78d5('0xe'));var deskjs=require(_0x78d5('0xf'));var toCsv=require(_0x78d5('0xb'));var querystring=require(_0x78d5('0x10'));var Papa=require(_0x78d5('0x11'));var Redis=require(_0x78d5('0x12'));var authService=require(_0x78d5('0x13'));var qs=require(_0x78d5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x78d5('0x15'))(_0x78d5('0x16'));var utils=require('../../config/utils');var config=require(_0x78d5('0x17'));var licenseUtil=require(_0x78d5('0x18'));var db=require(_0x78d5('0x19'))['db'];config[_0x78d5('0x1a')]=_['defaults'](config['redis'],{'host':_0x78d5('0x1b'),'port':0x18eb});var socket=require(_0x78d5('0x1c'))(new Redis(config[_0x78d5('0x1a')]));require('./team.socket')[_0x78d5('0x1d')](socket);function respondWithStatusCode(_0x5c17b6,_0x196fae){_0x196fae=_0x196fae||0xcc;return function(_0x3f6e58){if(_0x3f6e58){return _0x5c17b6[_0x78d5('0x1e')](_0x196fae);}return _0x5c17b6['status'](_0x196fae)['end']();};}function respondWithResult(_0x111e6c,_0x177fea){_0x177fea=_0x177fea||0xc8;return function(_0x572f14){if(_0x572f14){return _0x111e6c[_0x78d5('0x1f')](_0x177fea)['json'](_0x572f14);}};}function respondWithFilteredResult(_0x177556,_0x2aaae5){return function(_0x59bd0d){if(_0x59bd0d){var _0x13baa0=typeof _0x2aaae5[_0x78d5('0x20')]===_0x78d5('0x21')&&typeof _0x2aaae5[_0x78d5('0x22')]===_0x78d5('0x21');var _0x3b3d14=_0x59bd0d[_0x78d5('0x23')];var _0x321f3d=_0x13baa0?0x0:_0x2aaae5[_0x78d5('0x20')];var _0x592f9c=_0x13baa0?_0x59bd0d[_0x78d5('0x23')]:_0x2aaae5[_0x78d5('0x20')]+_0x2aaae5[_0x78d5('0x22')];var _0x32e986;if(_0x592f9c>=_0x3b3d14){_0x592f9c=_0x3b3d14;_0x32e986=0xc8;}else{_0x32e986=0xce;}_0x177556[_0x78d5('0x1f')](_0x32e986);return _0x177556[_0x78d5('0x24')]('Content-Range',_0x321f3d+'-'+_0x592f9c+'/'+_0x3b3d14)[_0x78d5('0x25')](_0x59bd0d);}return null;};}function patchUpdates(_0x21eac6){return function(_0x195c83){try{jsonpatch[_0x78d5('0x26')](_0x195c83,_0x21eac6,!![]);}catch(_0x3a0c0e){return BPromise[_0x78d5('0x27')](_0x3a0c0e);}return _0x195c83['save']();};}function saveUpdates(_0x151fe7,_0x52f55b){return function(_0x287c87){if(_0x287c87){return _0x287c87[_0x78d5('0x28')](_0x151fe7)[_0x78d5('0x29')](function(_0x1fa24f){return _0x1fa24f;});}return null;};}function handleEntityNotFound(_0xbaf606,_0x35db12){return function(_0x4f9f85){if(!_0x4f9f85){_0xbaf606[_0x78d5('0x1e')](0x194);}return _0x4f9f85;};}function handleError(_0x42ce24,_0x1f01c6){_0x1f01c6=_0x1f01c6||0x1f4;return function(_0x2d0f98){logger['error'](_0x2d0f98[_0x78d5('0x2a')]);if(_0x2d0f98['name']){delete _0x2d0f98[_0x78d5('0x2b')];}_0x42ce24[_0x78d5('0x1f')](_0x1f01c6)[_0x78d5('0x2c')](_0x2d0f98);};}exports[_0x78d5('0x2d')]=function(_0x4285b2,_0xb609eb){var _0x13335e={},_0x12e105={},_0x4118e5={'count':0x0,'rows':[]};var _0x2a171e=_[_0x78d5('0x2e')](db['Team']['rawAttributes'],function(_0x411e89){return{'name':_0x411e89[_0x78d5('0x2f')],'type':_0x411e89[_0x78d5('0x30')]['key']};});_0x12e105[_0x78d5('0x31')]=_[_0x78d5('0x2e')](_0x2a171e,_0x78d5('0x2b'));_0x12e105[_0x78d5('0x32')]=_[_0x78d5('0x33')](_0x4285b2['query']);_0x12e105[_0x78d5('0x34')]=_['intersection'](_0x12e105[_0x78d5('0x31')],_0x12e105[_0x78d5('0x32')]);_0x13335e[_0x78d5('0x35')]=_['intersection'](_0x12e105[_0x78d5('0x31')],qs[_0x78d5('0x36')](_0x4285b2[_0x78d5('0x32')][_0x78d5('0x36')]));_0x13335e[_0x78d5('0x35')]=_0x13335e[_0x78d5('0x35')][_0x78d5('0x37')]?_0x13335e[_0x78d5('0x35')]:_0x12e105['model'];if(!_0x4285b2[_0x78d5('0x32')][_0x78d5('0x38')](_0x78d5('0x39'))){_0x13335e[_0x78d5('0x22')]=qs[_0x78d5('0x22')](_0x4285b2[_0x78d5('0x32')][_0x78d5('0x22')]);_0x13335e[_0x78d5('0x20')]=qs[_0x78d5('0x20')](_0x4285b2['query'][_0x78d5('0x20')]);}_0x13335e['order']=qs[_0x78d5('0x3a')](_0x4285b2[_0x78d5('0x32')][_0x78d5('0x3a')]);_0x13335e[_0x78d5('0x3b')]=qs['filters'](_[_0x78d5('0x3c')](_0x4285b2[_0x78d5('0x32')],_0x12e105[_0x78d5('0x34')]),_0x2a171e);if(_0x4285b2[_0x78d5('0x32')][_0x78d5('0x3d')]){_0x13335e[_0x78d5('0x3b')]=_['merge'](_0x13335e[_0x78d5('0x3b')],{'$or':_[_0x78d5('0x2e')](_0x2a171e,function(_0x2783f1){if(_0x2783f1[_0x78d5('0x30')]!==_0x78d5('0x3e')){var _0x30133c={};_0x30133c[_0x2783f1[_0x78d5('0x2b')]]={'$like':'%'+_0x4285b2[_0x78d5('0x32')][_0x78d5('0x3d')]+'%'};return _0x30133c;}})});}_0x13335e=_[_0x78d5('0x3f')]({},_0x13335e,_0x4285b2[_0x78d5('0x40')]);var _0x3f1e21={'where':_0x13335e['where']};return db[_0x78d5('0x41')][_0x78d5('0x23')](_0x3f1e21)[_0x78d5('0x29')](function(_0x368687){_0x4118e5['count']=_0x368687;if(_0x4285b2[_0x78d5('0x32')][_0x78d5('0x42')]){_0x13335e[_0x78d5('0x43')]=[{'all':!![]}];}return db[_0x78d5('0x41')]['findAll'](_0x13335e);})[_0x78d5('0x29')](function(_0x46b906){_0x4118e5[_0x78d5('0x44')]=_0x46b906;return _0x4118e5;})[_0x78d5('0x29')](respondWithFilteredResult(_0xb609eb,_0x13335e))[_0x78d5('0x45')](handleError(_0xb609eb,null));};exports[_0x78d5('0x46')]=function(_0x208699,_0x16acb0){var _0x44dd68={'raw':![],'where':{'id':_0x208699[_0x78d5('0x47')]['id']}},_0x208709={};_0x208709[_0x78d5('0x31')]=_['keys'](db[_0x78d5('0x41')]['rawAttributes']);_0x208709['query']=_['keys'](_0x208699[_0x78d5('0x32')]);_0x208709[_0x78d5('0x34')]=_[_0x78d5('0x48')](_0x208709[_0x78d5('0x31')],_0x208709[_0x78d5('0x32')]);_0x44dd68[_0x78d5('0x35')]=_[_0x78d5('0x48')](_0x208709[_0x78d5('0x31')],qs[_0x78d5('0x36')](_0x208699[_0x78d5('0x32')][_0x78d5('0x36')]));_0x44dd68[_0x78d5('0x35')]=_0x44dd68[_0x78d5('0x35')][_0x78d5('0x37')]?_0x44dd68[_0x78d5('0x35')]:_0x208709[_0x78d5('0x31')];if(_0x208699['query']['includeAll']){_0x44dd68[_0x78d5('0x43')]=[{'all':!![]}];}_0x44dd68=_[_0x78d5('0x3f')]({},_0x44dd68,_0x208699[_0x78d5('0x40')]);return db[_0x78d5('0x41')][_0x78d5('0x49')](_0x44dd68)[_0x78d5('0x29')](handleEntityNotFound(_0x16acb0,null))[_0x78d5('0x29')](respondWithResult(_0x16acb0,null))['catch'](handleError(_0x16acb0,null));};exports['create']=function(_0x2a8181,_0x2dddda){return db[_0x78d5('0x41')][_0x78d5('0x4a')](_0x2a8181[_0x78d5('0x4b')],{})[_0x78d5('0x29')](function(_0x54c762){var _0x1e874c=_0x2a8181[_0x78d5('0x4c')][_0x78d5('0x4d')]({'plain':!![]});if(!_0x1e874c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e874c[_0x78d5('0x4e')]==='user'){var _0x4e9c9b=_0x54c762[_0x78d5('0x4d')]({'plain':!![]});var _0xcaab45=_0x78d5('0x4f');return db[_0x78d5('0x50')][_0x78d5('0x49')]({'where':{'name':_0xcaab45,'userProfileId':_0x1e874c[_0x78d5('0x51')]},'raw':!![]})['then'](function(_0x397139){if(_0x397139&&_0x397139[_0x78d5('0x52')]===0x0){return db[_0x78d5('0x53')]['create']({'name':_0x4e9c9b[_0x78d5('0x2b')],'resourceId':_0x4e9c9b['id'],'type':_0x397139[_0x78d5('0x2b')],'sectionId':_0x397139['id']},{})[_0x78d5('0x29')](function(){return _0x54c762;});}else{return _0x54c762;}})[_0x78d5('0x45')](function(_0x3b03ec){logger[_0x78d5('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b03ec);throw _0x3b03ec;});}return _0x54c762;})[_0x78d5('0x29')](respondWithResult(_0x2dddda,0xc9))[_0x78d5('0x45')](handleError(_0x2dddda,null));};exports[_0x78d5('0x28')]=function(_0x5b1339,_0x165aa3){if(_0x5b1339['body']['id']){delete _0x5b1339[_0x78d5('0x4b')]['id'];}return db[_0x78d5('0x41')][_0x78d5('0x49')]({'where':{'id':_0x5b1339['params']['id']}})['then'](handleEntityNotFound(_0x165aa3,null))['then'](saveUpdates(_0x5b1339[_0x78d5('0x4b')],null))[_0x78d5('0x29')](respondWithResult(_0x165aa3,null))[_0x78d5('0x45')](handleError(_0x165aa3,null));};exports[_0x78d5('0x55')]=function(_0x22437b,_0x3b2361){var _0xc84cb6=_0x22437b[_0x78d5('0x47')]['id'];var _0x1427f5=[];return db[_0x78d5('0x56')]['transaction'](function(_0x4d98d8){var _0x3265c2=_0x78d5('0x57')+_0xc84cb6;return db[_0x78d5('0x56')][_0x78d5('0x32')](_0x3265c2,{'type':db['Sequelize'][_0x78d5('0x58')][_0x78d5('0x59')],'raw':!![],'transaction':_0x4d98d8})['then'](function(_0x5af20b){_0x1427f5=_[_0x78d5('0x2e')](_0x5af20b,function(_0x55f314){return Number(_0x55f314[_0x78d5('0x5a')]);});})['then'](function(){var _0x382467=_0x78d5('0x5b')+_0xc84cb6;return db[_0x78d5('0x56')]['query'](_0x382467,{'type':db[_0x78d5('0x5c')]['QueryTypes'][_0x78d5('0x59')],'raw':!![],'transaction':_0x4d98d8});})[_0x78d5('0x29')](function(_0x4001f7){var _0x2b778f=_[_0x78d5('0x2e')](_0x4001f7,function(_0x1da43c){return Number(_0x1da43c[_0x78d5('0x5d')]);});return db[_0x78d5('0x5e')][_0x78d5('0x55')]({'where':{'UserId':{'$in':_0x1427f5},'VoiceQueueId':{'$in':_0x2b778f}},'transaction':_0x4d98d8});})['then'](function(){var _0x5a2bab=_0x78d5('0x5f')+_0xc84cb6;return db[_0x78d5('0x56')][_0x78d5('0x32')](_0x5a2bab,{'type':db[_0x78d5('0x5c')][_0x78d5('0x58')][_0x78d5('0x59')],'raw':!![],'transaction':_0x4d98d8});})[_0x78d5('0x29')](function(_0x42b23e){var _0x184717=_['map'](_0x42b23e,function(_0x4a46ab){return Number(_0x4a46ab[_0x78d5('0x60')]);});return db['UserMailQueue'][_0x78d5('0x55')]({'where':{'UserId':{'$in':_0x1427f5},'MailQueueId':{'$in':_0x184717}},'transaction':_0x4d98d8});})[_0x78d5('0x29')](function(){var _0x2c48d6=_0x78d5('0x61')+_0xc84cb6;return db['sequelize'][_0x78d5('0x32')](_0x2c48d6,{'type':db[_0x78d5('0x5c')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x4d98d8});})['then'](function(_0x58fd94){var _0x26e3ad=_[_0x78d5('0x2e')](_0x58fd94,function(_0x50091a){return Number(_0x50091a[_0x78d5('0x62')]);});return db[_0x78d5('0x63')]['destroy']({'where':{'UserId':{'$in':_0x1427f5},'SmsQueueId':{'$in':_0x26e3ad}},'transaction':_0x4d98d8});})[_0x78d5('0x29')](function(){var _0x18d49a=_0x78d5('0x64')+_0xc84cb6;return db[_0x78d5('0x56')]['query'](_0x18d49a,{'type':db[_0x78d5('0x5c')][_0x78d5('0x58')]['SELECT'],'raw':!![],'transaction':_0x4d98d8});})[_0x78d5('0x29')](function(_0x4b3d0f){var _0x5ac60c=_[_0x78d5('0x2e')](_0x4b3d0f,function(_0x1e0895){return Number(_0x1e0895[_0x78d5('0x65')]);});return db[_0x78d5('0x66')][_0x78d5('0x55')]({'where':{'UserId':{'$in':_0x1427f5},'ChatQueueId':{'$in':_0x5ac60c}},'transaction':_0x4d98d8});})[_0x78d5('0x29')](function(){var _0x1c2b4b=_0x78d5('0x67')+_0xc84cb6;return db[_0x78d5('0x56')]['query'](_0x1c2b4b,{'type':db['Sequelize'][_0x78d5('0x58')][_0x78d5('0x59')],'raw':!![],'transaction':_0x4d98d8});})['then'](function(_0x1d4ebf){var _0x3eb359=_[_0x78d5('0x2e')](_0x1d4ebf,function(_0x2dd737){return Number(_0x2dd737[_0x78d5('0x68')]);});return db[_0x78d5('0x69')]['destroy']({'where':{'UserId':{'$in':_0x1427f5},'FaxQueueId':{'$in':_0x3eb359}},'transaction':_0x4d98d8});})[_0x78d5('0x29')](function(){var _0x4ba59e=_0x78d5('0x6a')+_0xc84cb6;return db[_0x78d5('0x56')][_0x78d5('0x32')](_0x4ba59e,{'type':db[_0x78d5('0x5c')][_0x78d5('0x58')]['SELECT'],'raw':!![],'transaction':_0x4d98d8});})['then'](function(_0x261064){var _0x3ac3c8=_['map'](_0x261064,function(_0x27e4a7){return Number(_0x27e4a7[_0x78d5('0x6b')]);});return db[_0x78d5('0x6c')][_0x78d5('0x55')]({'where':{'UserId':{'$in':_0x1427f5},'OpenchannelQueueId':{'$in':_0x3ac3c8}},'transaction':_0x4d98d8});})[_0x78d5('0x29')](function(){var _0x2a138d=_0x78d5('0x6d')+_0xc84cb6;return db['sequelize'][_0x78d5('0x32')](_0x2a138d,{'type':db[_0x78d5('0x5c')]['QueryTypes'][_0x78d5('0x59')],'raw':!![],'transaction':_0x4d98d8});})[_0x78d5('0x29')](function(_0x522a30){var _0xed1d39=_[_0x78d5('0x2e')](_0x522a30,function(_0x425652){return Number(_0x425652[_0x78d5('0x6e')]);});return db[_0x78d5('0x6f')][_0x78d5('0x55')]({'where':{'UserId':{'$in':_0x1427f5},'WhatsappQueueId':{'$in':_0xed1d39}},'transaction':_0x4d98d8});})['then'](function(){return db['TeamVoicePrefix'][_0x78d5('0x49')]({'where':{'TeamId':_0xc84cb6}});})[_0x78d5('0x29')](function(_0x1608e2){if(_0x1608e2===null){return;}return db[_0x78d5('0x70')][_0x78d5('0x55')]({'where':{'UserId':{'$in':_0x1427f5},'VoicePrefixId':_0x1608e2[_0x78d5('0x71')]},'transaction':_0x4d98d8});})[_0x78d5('0x29')](function(){return db[_0x78d5('0x41')][_0x78d5('0x55')]({'where':{'id':_0xc84cb6},'cascade':!![],'transaction':_0x4d98d8});})[_0x78d5('0x29')](function(_0xc0f486){if(_0xc0f486===0x0){_0x3b2361[_0x78d5('0x1e')](0x194);}else{return db[_0x78d5('0x53')]['destroy']({'where':{'type':_0x78d5('0x4f'),'resourceId':_0xc84cb6},'cascade':!![],'transaction':_0x4d98d8})['then'](function(){_0x3b2361['status'](0xcc)[_0x78d5('0x72')]();});}})['catch'](function(_0x283af5){_0x3b2361['status'](0x1f4)[_0x78d5('0x2c')](_0x283af5);});});};exports[_0x78d5('0x73')]=function(_0x31a916,_0x18a1d8,_0x487c83){return db[_0x78d5('0x41')][_0x78d5('0x74')]({'where':{'id':_0x31a916['params']['id']}})[_0x78d5('0x29')](handleEntityNotFound(_0x18a1d8,null))[_0x78d5('0x29')](function(_0x2cda0e){if(!_0x31a916[_0x78d5('0x32')][_0x78d5('0x75')]||!utils[_0x78d5('0x76')](_0x31a916[_0x78d5('0x32')][_0x78d5('0x75')])){throw new db[(_0x78d5('0x5c'))][(_0x78d5('0x77'))](_0x78d5('0x78'));}var _0x445580={};var _0x2379d1={};_0x2379d1[_0x78d5('0x31')]=_['keys'](db[_[_0x78d5('0x79')](_0x31a916[_0x78d5('0x32')][_0x78d5('0x75')][_0x78d5('0x7a')]())+_0x78d5('0x7b')]['rawAttributes']);_0x2379d1[_0x78d5('0x32')]=_[_0x78d5('0x33')](_0x31a916[_0x78d5('0x32')]);_0x2379d1['filters']=_[_0x78d5('0x48')](_0x2379d1[_0x78d5('0x31')],_0x2379d1[_0x78d5('0x32')]);_0x445580['attributes']=_[_0x78d5('0x48')](_0x2379d1[_0x78d5('0x31')],qs[_0x78d5('0x36')](_0x31a916[_0x78d5('0x32')][_0x78d5('0x36')]));_0x445580[_0x78d5('0x35')]=_0x445580['attributes'][_0x78d5('0x37')]?_0x445580[_0x78d5('0x35')]:_0x2379d1['model'];_0x445580[_0x78d5('0x22')]=qs['limit'](_0x31a916[_0x78d5('0x32')]['limit']);_0x445580['offset']=qs[_0x78d5('0x20')](_0x31a916[_0x78d5('0x32')]['offset']);_0x445580['order']=qs['sort'](_0x31a916[_0x78d5('0x32')][_0x78d5('0x3a')]);_0x445580['where']=qs[_0x78d5('0x34')](_[_0x78d5('0x3c')](_0x31a916['query'],_0x2379d1[_0x78d5('0x34')]));_0x445580=_[_0x78d5('0x3f')]({},_0x445580,_0x31a916[_0x78d5('0x40')]);return _0x2cda0e[_0x78d5('0x4d')+_[_0x78d5('0x79')](_0x31a916[_0x78d5('0x32')][_0x78d5('0x75')][_0x78d5('0x7a')]())+_0x78d5('0x7c')](_0x445580);})[_0x78d5('0x29')](respondWithResult(_0x18a1d8,null))['catch'](handleError(_0x18a1d8,null));};exports[_0x78d5('0x7d')]=function(_0x525ff5,_0x30609d,_0x370d81){return db[_0x78d5('0x41')][_0x78d5('0x74')]({'where':{'id':_0x525ff5[_0x78d5('0x47')]['id']}})[_0x78d5('0x29')](function(_0x1b8b53){if(_0x1b8b53){if(!_0x525ff5[_0x78d5('0x4b')][_0x78d5('0x75')]||!utils[_0x78d5('0x76')](_0x525ff5[_0x78d5('0x4b')][_0x78d5('0x75')])){throw new db[(_0x78d5('0x5c'))]['ValidationError'](_0x78d5('0x78'));}return _0x1b8b53[_0x78d5('0x7e')+_['capitalize'](_0x525ff5[_0x78d5('0x4b')][_0x78d5('0x75')][_0x78d5('0x7a')]())+'Queues'](_0x525ff5[_0x78d5('0x4b')][_0x78d5('0x7f')]);}return null;})[_0x78d5('0x29')](handleEntityNotFound(_0x30609d,null))[_0x78d5('0x29')](respondWithStatusCode(_0x30609d,null))['catch'](handleError(_0x30609d,null));};exports['removeQueues']=function(_0x2a16fe,_0x54bed4,_0x5db213){return db[_0x78d5('0x41')][_0x78d5('0x74')]({'where':{'id':_0x2a16fe['params']['id']}})[_0x78d5('0x29')](function(_0x2d90d0){if(_0x2d90d0){if(!_0x2a16fe[_0x78d5('0x32')]['channel']||!utils[_0x78d5('0x76')](_0x2a16fe[_0x78d5('0x32')]['channel'])){throw new db[(_0x78d5('0x5c'))][(_0x78d5('0x77'))](_0x78d5('0x78'));}return _0x2d90d0[_0x78d5('0x80')+_[_0x78d5('0x79')](_0x2a16fe[_0x78d5('0x32')][_0x78d5('0x75')][_0x78d5('0x7a')]())+'Queues'](_0x2a16fe[_0x78d5('0x32')][_0x78d5('0x7f')]);}return null;})['then'](handleEntityNotFound(_0x54bed4,null))['then'](respondWithStatusCode(_0x54bed4,null))[_0x78d5('0x45')](handleError(_0x54bed4,null));};exports[_0x78d5('0x81')]=function(_0x1d1091,_0x14555f){var _0xdbb079=_[_0x78d5('0x82')](_0x1d1091[_0x78d5('0x4b')][_0x78d5('0x7f')])?_0x1d1091[_0x78d5('0x4b')]['ids']:[_0x1d1091[_0x78d5('0x4b')][_0x78d5('0x7f')]];var _0x4e10a9=_0x1d1091['params']['id'];return db[_0x78d5('0x41')][_0x78d5('0x49')]({'where':{'id':_0x4e10a9}})['then'](handleEntityNotFound(_0x14555f,null))[_0x78d5('0x29')](function(_0x2e6be0){if(_0x2e6be0){var _0x55dd93=[_0x78d5('0x83'),_0x78d5('0x84'),_0x78d5('0x85'),_0x78d5('0x86'),_0x78d5('0x87'),_0x78d5('0x88'),'Whatsapp'];return db[_0x78d5('0x56')][_0x78d5('0x89')](function(_0x5e4764){var _0x27366=_['map'](_0x55dd93,function(_0x11c60e){var _0x47bacd={'attributes':['id',_0x78d5('0x2b')]};if(_0x11c60e===_0x78d5('0x83')){_0x47bacd[_0x78d5('0x8a')]={'attributes':['penalty']};}return _0x2e6be0[_0x78d5('0x4d')+_0x11c60e+_0x78d5('0x7c')](_0x47bacd)[_0x78d5('0x29')](function(_0x2ced4c){var _0x7e0562=_[_0x78d5('0x2e')](_0x2ced4c,function(_0x5deff5){var _0x44cf0f=_[_0x78d5('0x2e')](_0xdbb079,function(_0x1d06d9){var _0x5bbde9={'where':{'UserId':_0x1d06d9,[_0x11c60e+_0x78d5('0x8b')]:_0x5deff5['id']},'transaction':_0x5e4764};if(_0x11c60e===_0x78d5('0x83')){_0x5bbde9[_0x78d5('0x8c')]={'penalty':_0x5deff5[_0x78d5('0x8d')][_0x78d5('0x8e')]};}return db[_0x78d5('0x8f')+_0x11c60e+'Queue'][_0x78d5('0x90')](_0x5bbde9)[_0x78d5('0x29')](function(){socket[_0x78d5('0x91')]('user'+_0x11c60e+_0x78d5('0x92'),{'UserId':_0x1d06d9,[_0x11c60e+_0x78d5('0x8b')]:_0x5deff5['id']});if(_0x11c60e!==_0x78d5('0x83')){return;}return db[_0x78d5('0x8f')][_0x78d5('0x93')]({'where':{'id':_0xdbb079,'online':0x1},'attributes':['id',_0x78d5('0x2b'),_0x78d5('0x94'),_0x78d5('0x95'),_0x78d5('0x96')],'raw':!![]})[_0x78d5('0x29')](function(_0x1f4e9c){var _0x539e59=_[_0x78d5('0x2e')](_0x1f4e9c,function(_0x39deba){return db[_0x78d5('0x97')][_0x78d5('0x98')]({'membername':_0x39deba[_0x78d5('0x2b')],'UserId':_0x39deba['id'],'queue_name':_0x5deff5[_0x78d5('0x2b')],'VoiceQueueId':_0x5deff5['id'],'interface':_[_0x78d5('0x99')](_0x39deba['interface'])?util[_0x78d5('0x9a')]('SIP/%s',_0x39deba[_0x78d5('0x2b')]):_0x39deba['interface'],'paused':_0x39deba[_0x78d5('0x95')]||![],'penalty':_0x5deff5[_0x78d5('0x8d')]['penalty']},{'transaction':_0x5e4764});});return Promise['all'](_0x539e59);});});});return Promise[_0x78d5('0x9b')](_0x44cf0f);});return Promise[_0x78d5('0x9b')](_0x7e0562);})[_0x78d5('0x29')](function(){return db['TeamVoicePrefix'][_0x78d5('0x74')]({'where':{'teamId':_0x4e10a9}})['then'](function(_0x43d4c9){if(_0x43d4c9){var _0x2cad86=_[_0x78d5('0x2e')](_0xdbb079,function(_0x5c61b5){db['UserVoicePrefix'][_0x78d5('0x98')]({'UserId':_0x5c61b5,'VoicePrefixId':_0x43d4c9[_0x78d5('0x71')]});});return Promise[_0x78d5('0x9b')](_0x2cad86);}});});});return Promise[_0x78d5('0x9b')](_0x27366)[_0x78d5('0x29')](function(){return _0x2e6be0[_0x78d5('0x81')](_0xdbb079,{'transaction':_0x5e4764})[_0x78d5('0x9c')](function(_0x45549c){return _0x45549c;});});});}})[_0x78d5('0x29')](respondWithResult(_0x14555f,null))[_0x78d5('0x45')](handleError(_0x14555f,null));};exports[_0x78d5('0x9d')]=function(_0x5462b0,_0x3ca9fb){var _0x15f424=_[_0x78d5('0x82')](_0x5462b0[_0x78d5('0x32')][_0x78d5('0x7f')])?_0x5462b0[_0x78d5('0x32')][_0x78d5('0x7f')]:[_0x5462b0[_0x78d5('0x32')]['ids']];var _0x36a6cc=_0x5462b0[_0x78d5('0x47')]['id'];return db[_0x78d5('0x41')][_0x78d5('0x49')]({'where':{'id':_0x36a6cc}})[_0x78d5('0x29')](handleEntityNotFound(_0x3ca9fb,null))[_0x78d5('0x29')](function(_0x4f8e8a){if(_0x4f8e8a){var _0x463ec5=['Voice',_0x78d5('0x84'),_0x78d5('0x85'),_0x78d5('0x86'),_0x78d5('0x87'),_0x78d5('0x88'),_0x78d5('0x9e')];return db[_0x78d5('0x56')]['transaction'](function(_0x44f3f8){var _0x1c6863=_[_0x78d5('0x2e')](_0x463ec5,function(_0x50d0c3){var _0x4c22de={'attributes':['id',_0x78d5('0x2b')]};return _0x4f8e8a[_0x78d5('0x4d')+_0x50d0c3+_0x78d5('0x7c')](_0x4c22de)[_0x78d5('0x29')](function(_0x1f5724){var _0x52fa60=_[_0x78d5('0x2e')](_0x1f5724,function(_0x1e4e79){return _0x1e4e79[_0x78d5('0x9d')](_0x15f424,{'transaction':_0x44f3f8})[_0x78d5('0x29')](function(){var _0x23d88b=_['map'](_0x15f424,function(_0x4e259d){socket[_0x78d5('0x91')](_0x78d5('0x4c')+_0x50d0c3+'Queue:remove',{'UserId':Number(_0x4e259d),[_0x50d0c3+'QueueId']:_0x1e4e79['id']});if(_0x50d0c3!==_0x78d5('0x83')){return;}return db[_0x78d5('0x97')][_0x78d5('0x55')]({'where':{'VoiceQueueId':_0x1e4e79['id'],'UserId':_0x4e259d},'transaction':_0x44f3f8});});return Promise[_0x78d5('0x9b')](_0x23d88b);});});return Promise[_0x78d5('0x9b')](_0x52fa60);});});return Promise[_0x78d5('0x9b')](_0x1c6863)[_0x78d5('0x29')](function(){return _0x4f8e8a['removeAgents'](_0x15f424,{'transaction':_0x44f3f8});})[_0x78d5('0x29')](function(){return db[_0x78d5('0x9f')]['findOne']({'where':{'teamId':_0x36a6cc}})['then'](function(_0x8869d0){if(_0x8869d0){var _0x30959c=_[_0x78d5('0x2e')](_0x15f424,function(_0xf4dabc){db[_0x78d5('0x70')][_0x78d5('0x55')]({'where':{'UserId':_0xf4dabc,'VoicePrefixId':_0x8869d0[_0x78d5('0x71')]}});});return Promise[_0x78d5('0x9b')](_0x30959c);}});});});}})[_0x78d5('0x29')](respondWithStatusCode(_0x3ca9fb,null))[_0x78d5('0x45')](handleError(_0x3ca9fb,null));};exports['getAgents']=function(_0x117bcd,_0x553736,_0x32712a){var _0x3b6550={};var _0x958b7a={};var _0x668957;var _0x51e080;return db[_0x78d5('0x41')][_0x78d5('0x74')]({'where':{'id':_0x117bcd[_0x78d5('0x47')]['id']}})[_0x78d5('0x29')](handleEntityNotFound(_0x553736,null))[_0x78d5('0x29')](function(_0x57fe7f){if(_0x57fe7f){_0x668957=_0x57fe7f;_0x958b7a['model']=_[_0x78d5('0x33')](db[_0x78d5('0x8f')][_0x78d5('0xa0')]);_0x958b7a[_0x78d5('0x32')]=_[_0x78d5('0x33')](_0x117bcd['query']);_0x958b7a['filters']=_[_0x78d5('0x48')](_0x958b7a[_0x78d5('0x31')],_0x958b7a[_0x78d5('0x32')]);_0x3b6550[_0x78d5('0x35')]=_['intersection'](_0x958b7a['model'],qs[_0x78d5('0x36')](_0x117bcd[_0x78d5('0x32')][_0x78d5('0x36')]));_0x3b6550[_0x78d5('0x35')]=_0x3b6550[_0x78d5('0x35')]['length']?_0x3b6550[_0x78d5('0x35')]:_0x958b7a[_0x78d5('0x31')];_0x3b6550[_0x78d5('0xa1')]=qs['sort'](_0x117bcd[_0x78d5('0x32')]['sort']);_0x3b6550[_0x78d5('0x3b')]=qs[_0x78d5('0x34')](_[_0x78d5('0x3c')](_0x117bcd[_0x78d5('0x32')],_0x958b7a[_0x78d5('0x34')]));if(_0x117bcd[_0x78d5('0x32')][_0x78d5('0x3d')]){_0x3b6550[_0x78d5('0x3b')]=_[_0x78d5('0x3f')](_0x3b6550['where'],{'$or':_[_0x78d5('0x2e')](_0x3b6550[_0x78d5('0x35')],function(_0x3cd435){var _0x2574c9={};_0x2574c9[_0x3cd435]={'$like':'%'+_0x117bcd[_0x78d5('0x32')]['filter']+'%'};return _0x2574c9;})});}_0x3b6550=_['merge']({},_0x3b6550,_0x117bcd[_0x78d5('0x40')]);return _0x668957[_0x78d5('0xa2')](_0x3b6550);}})[_0x78d5('0x29')](function(_0x521d3f){if(_0x521d3f){_0x51e080=_0x521d3f[_0x78d5('0x37')];if(!_0x117bcd[_0x78d5('0x32')]['hasOwnProperty'](_0x78d5('0x39'))){_0x3b6550[_0x78d5('0x22')]=qs['limit'](_0x117bcd[_0x78d5('0x32')]['limit']);_0x3b6550[_0x78d5('0x20')]=qs['offset'](_0x117bcd['query'][_0x78d5('0x20')]);}return _0x668957['getAgents'](_0x3b6550);}})['then'](function(_0x5b4bda){if(_0x5b4bda){return _0x5b4bda?{'count':_0x51e080,'rows':_0x5b4bda}:null;}})[_0x78d5('0x29')](respondWithResult(_0x553736,null))['catch'](handleError(_0x553736,null));}; \ No newline at end of file +var _0x9a59=['stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','options','Team','then','includeAll','include','findAll','rows','catch','params','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','sequelize','Sequelize','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','VoiceQueueId','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','sendStatus','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','addQueues','add','removeQueues','remove','Queues','ids','addAgents','Voice','Chat','Mail','Sms','Openchannel','Whatsapp','transaction','through','penalty','QueueId','TeamVoiceQueue','User','Queue','findOrCreate','emit','Queue:save','online','voicePause','interface','upsert','isNil','SIP/%s','all','UserVoicePrefix','spread','isArray','Fax','Queue:remove','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./team.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','save','error'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0x9a59,0x73));var _0x99a5=function(_0x333135,_0x221706){_0x333135=_0x333135-0x0;var _0x2c0d55=_0x9a59[_0x333135];return _0x2c0d55;};'use strict';var emlformat=require(_0x99a5('0x0'));var rimraf=require(_0x99a5('0x1'));var zipdir=require(_0x99a5('0x2'));var jsonpatch=require(_0x99a5('0x3'));var rp=require(_0x99a5('0x4'));var moment=require(_0x99a5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x99a5('0x6'));var util=require('util');var path=require(_0x99a5('0x7'));var sox=require(_0x99a5('0x8'));var csv=require(_0x99a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x99a5('0xa'));var squel=require('squel');var crypto=require(_0x99a5('0xb'));var jsforce=require(_0x99a5('0xc'));var deskjs=require(_0x99a5('0xd'));var toCsv=require(_0x99a5('0x9'));var querystring=require(_0x99a5('0xe'));var Papa=require(_0x99a5('0xf'));var Redis=require(_0x99a5('0x10'));var authService=require(_0x99a5('0x11'));var qs=require(_0x99a5('0x12'));var as=require(_0x99a5('0x13'));var hardwareService=require(_0x99a5('0x14'));var logger=require(_0x99a5('0x15'))('api');var utils=require(_0x99a5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x99a5('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x99a5('0x18')](config[_0x99a5('0x19')],{'host':_0x99a5('0x1a'),'port':0x18eb});var socket=require(_0x99a5('0x1b'))(new Redis(config['redis']));require(_0x99a5('0x1c'))[_0x99a5('0x1d')](socket);function respondWithStatusCode(_0x3c78c1,_0x2235fe){_0x2235fe=_0x2235fe||0xcc;return function(_0x4f526d){if(_0x4f526d){return _0x3c78c1['sendStatus'](_0x2235fe);}return _0x3c78c1[_0x99a5('0x1e')](_0x2235fe)[_0x99a5('0x1f')]();};}function respondWithResult(_0x1d48ce,_0x4ee146){_0x4ee146=_0x4ee146||0xc8;return function(_0x33472d){if(_0x33472d){return _0x1d48ce[_0x99a5('0x1e')](_0x4ee146)[_0x99a5('0x20')](_0x33472d);}};}function respondWithFilteredResult(_0x2ae548,_0x11c329){return function(_0x4025a1){if(_0x4025a1){var _0x9bbc92=typeof _0x11c329[_0x99a5('0x21')]==='undefined'&&typeof _0x11c329[_0x99a5('0x22')]===_0x99a5('0x23');var _0x45e068=_0x4025a1['count'];var _0x4d1249=_0x9bbc92?0x0:_0x11c329[_0x99a5('0x21')];var _0x1696fa=_0x9bbc92?_0x4025a1[_0x99a5('0x24')]:_0x11c329[_0x99a5('0x21')]+_0x11c329['limit'];var _0x214f7f;if(_0x1696fa>=_0x45e068){_0x1696fa=_0x45e068;_0x214f7f=0xc8;}else{_0x214f7f=0xce;}_0x2ae548[_0x99a5('0x1e')](_0x214f7f);return _0x2ae548[_0x99a5('0x25')](_0x99a5('0x26'),_0x4d1249+'-'+_0x1696fa+'/'+_0x45e068)['json'](_0x4025a1);}return null;};}function patchUpdates(_0x193967){return function(_0x46086c){try{jsonpatch['apply'](_0x46086c,_0x193967,!![]);}catch(_0x4bdc7e){return BPromise['reject'](_0x4bdc7e);}return _0x46086c[_0x99a5('0x27')]();};}function saveUpdates(_0x273b88,_0x3878c4){return function(_0xd89f7){if(_0xd89f7){return _0xd89f7['update'](_0x273b88)['then'](function(_0x28d232){return _0x28d232;});}return null;};}function handleEntityNotFound(_0x3f3eec,_0x46520c){return function(_0x37d969){if(!_0x37d969){_0x3f3eec['sendStatus'](0x194);}return _0x37d969;};}function handleError(_0x1d227a,_0x36e529){_0x36e529=_0x36e529||0x1f4;return function(_0x3591c9){logger[_0x99a5('0x28')](_0x3591c9[_0x99a5('0x29')]);if(_0x3591c9[_0x99a5('0x2a')]){delete _0x3591c9[_0x99a5('0x2a')];}_0x1d227a['status'](_0x36e529)[_0x99a5('0x2b')](_0x3591c9);};}exports[_0x99a5('0x2c')]=function(_0x16aa4b,_0xf0ec8b){var _0x1cd8c2={},_0x322999={},_0x241bfd={'count':0x0,'rows':[]};var _0x1d586d=_[_0x99a5('0x2d')](db['Team'][_0x99a5('0x2e')],function(_0x18cd71){return{'name':_0x18cd71[_0x99a5('0x2f')],'type':_0x18cd71[_0x99a5('0x30')]['key']};});_0x322999['model']=_[_0x99a5('0x2d')](_0x1d586d,_0x99a5('0x2a'));_0x322999[_0x99a5('0x31')]=_[_0x99a5('0x32')](_0x16aa4b['query']);_0x322999[_0x99a5('0x33')]=_[_0x99a5('0x34')](_0x322999[_0x99a5('0x35')],_0x322999[_0x99a5('0x31')]);_0x1cd8c2[_0x99a5('0x36')]=_[_0x99a5('0x34')](_0x322999['model'],qs[_0x99a5('0x37')](_0x16aa4b[_0x99a5('0x31')][_0x99a5('0x37')]));_0x1cd8c2[_0x99a5('0x36')]=_0x1cd8c2[_0x99a5('0x36')][_0x99a5('0x38')]?_0x1cd8c2['attributes']:_0x322999[_0x99a5('0x35')];if(!_0x16aa4b['query'][_0x99a5('0x39')]('nolimit')){_0x1cd8c2[_0x99a5('0x22')]=qs[_0x99a5('0x22')](_0x16aa4b[_0x99a5('0x31')][_0x99a5('0x22')]);_0x1cd8c2[_0x99a5('0x21')]=qs[_0x99a5('0x21')](_0x16aa4b['query']['offset']);}_0x1cd8c2[_0x99a5('0x3a')]=qs['sort'](_0x16aa4b[_0x99a5('0x31')][_0x99a5('0x3b')]);_0x1cd8c2[_0x99a5('0x3c')]=qs[_0x99a5('0x33')](_[_0x99a5('0x3d')](_0x16aa4b['query'],_0x322999[_0x99a5('0x33')]),_0x1d586d);if(_0x16aa4b[_0x99a5('0x31')][_0x99a5('0x3e')]){_0x1cd8c2[_0x99a5('0x3c')]=_['merge'](_0x1cd8c2['where'],{'$or':_[_0x99a5('0x2d')](_0x1d586d,function(_0x303da6){if(_0x303da6['type']!=='VIRTUAL'){var _0x4449a={};_0x4449a[_0x303da6[_0x99a5('0x2a')]]={'$like':'%'+_0x16aa4b[_0x99a5('0x31')][_0x99a5('0x3e')]+'%'};return _0x4449a;}})});}_0x1cd8c2=_['merge']({},_0x1cd8c2,_0x16aa4b[_0x99a5('0x3f')]);var _0x494182={'where':_0x1cd8c2['where']};return db[_0x99a5('0x40')][_0x99a5('0x24')](_0x494182)[_0x99a5('0x41')](function(_0x13f0ae){_0x241bfd['count']=_0x13f0ae;if(_0x16aa4b['query'][_0x99a5('0x42')]){_0x1cd8c2[_0x99a5('0x43')]=[{'all':!![]}];}return db[_0x99a5('0x40')][_0x99a5('0x44')](_0x1cd8c2);})[_0x99a5('0x41')](function(_0x56b370){_0x241bfd[_0x99a5('0x45')]=_0x56b370;return _0x241bfd;})[_0x99a5('0x41')](respondWithFilteredResult(_0xf0ec8b,_0x1cd8c2))[_0x99a5('0x46')](handleError(_0xf0ec8b,null));};exports['show']=function(_0x48e42c,_0x1255cb){var _0x5cabd5={'raw':![],'where':{'id':_0x48e42c[_0x99a5('0x47')]['id']}},_0x37cdc0={};_0x37cdc0[_0x99a5('0x35')]=_['keys'](db[_0x99a5('0x40')][_0x99a5('0x2e')]);_0x37cdc0[_0x99a5('0x31')]=_[_0x99a5('0x32')](_0x48e42c[_0x99a5('0x31')]);_0x37cdc0[_0x99a5('0x33')]=_[_0x99a5('0x34')](_0x37cdc0[_0x99a5('0x35')],_0x37cdc0[_0x99a5('0x31')]);_0x5cabd5[_0x99a5('0x36')]=_[_0x99a5('0x34')](_0x37cdc0[_0x99a5('0x35')],qs[_0x99a5('0x37')](_0x48e42c[_0x99a5('0x31')][_0x99a5('0x37')]));_0x5cabd5[_0x99a5('0x36')]=_0x5cabd5['attributes'][_0x99a5('0x38')]?_0x5cabd5[_0x99a5('0x36')]:_0x37cdc0[_0x99a5('0x35')];if(_0x48e42c[_0x99a5('0x31')]['includeAll']){_0x5cabd5['include']=[{'all':!![]}];}_0x5cabd5=_[_0x99a5('0x48')]({},_0x5cabd5,_0x48e42c['options']);return db['Team'][_0x99a5('0x49')](_0x5cabd5)[_0x99a5('0x41')](handleEntityNotFound(_0x1255cb,null))['then'](respondWithResult(_0x1255cb,null))['catch'](handleError(_0x1255cb,null));};exports[_0x99a5('0x4a')]=function(_0x330e18,_0x29a101){return db[_0x99a5('0x40')][_0x99a5('0x4a')](_0x330e18[_0x99a5('0x4b')],{})[_0x99a5('0x41')](function(_0x1e79e2){var _0x1033a2=_0x330e18[_0x99a5('0x4c')]['get']({'plain':!![]});if(!_0x1033a2)throw new Error(_0x99a5('0x4d'));if(_0x1033a2[_0x99a5('0x4e')]===_0x99a5('0x4c')){var _0x17b22a=_0x1e79e2[_0x99a5('0x4f')]({'plain':!![]});var _0x206910=_0x99a5('0x50');return db['UserProfileSection'][_0x99a5('0x49')]({'where':{'name':_0x206910,'userProfileId':_0x1033a2[_0x99a5('0x51')]},'raw':!![]})['then'](function(_0x2cf110){if(_0x2cf110&&_0x2cf110[_0x99a5('0x52')]===0x0){return db[_0x99a5('0x53')][_0x99a5('0x4a')]({'name':_0x17b22a[_0x99a5('0x2a')],'resourceId':_0x17b22a['id'],'type':_0x2cf110[_0x99a5('0x2a')],'sectionId':_0x2cf110['id']},{})[_0x99a5('0x41')](function(){return _0x1e79e2;});}else{return _0x1e79e2;}})['catch'](function(_0x5ea02a){logger[_0x99a5('0x28')](_0x99a5('0x54'),_0x5ea02a);throw _0x5ea02a;});}return _0x1e79e2;})[_0x99a5('0x41')](respondWithResult(_0x29a101,0xc9))['catch'](handleError(_0x29a101,null));};exports[_0x99a5('0x55')]=function(_0x3d823a,_0x20ee75){if(_0x3d823a[_0x99a5('0x4b')]['id']){delete _0x3d823a[_0x99a5('0x4b')]['id'];}return db[_0x99a5('0x40')][_0x99a5('0x49')]({'where':{'id':_0x3d823a['params']['id']}})[_0x99a5('0x41')](handleEntityNotFound(_0x20ee75,null))[_0x99a5('0x41')](saveUpdates(_0x3d823a[_0x99a5('0x4b')],null))['then'](respondWithResult(_0x20ee75,null))[_0x99a5('0x46')](handleError(_0x20ee75,null));};exports[_0x99a5('0x56')]=function(_0x448fa3,_0x374964){var _0x2ea4d4=_0x448fa3[_0x99a5('0x47')]['id'];var _0x5abd51=[];return db['sequelize']['transaction'](function(_0xed09ef){var _0x279df0='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x2ea4d4;return db[_0x99a5('0x57')][_0x99a5('0x31')](_0x279df0,{'type':db[_0x99a5('0x58')]['QueryTypes'][_0x99a5('0x59')],'raw':!![],'transaction':_0xed09ef})[_0x99a5('0x41')](function(_0x197191){_0x5abd51=_[_0x99a5('0x2d')](_0x197191,function(_0xdb6b3b){return Number(_0xdb6b3b['UserId']);});})[_0x99a5('0x41')](function(){var _0x5faf48=_0x99a5('0x5a')+_0x2ea4d4;return db[_0x99a5('0x57')][_0x99a5('0x31')](_0x5faf48,{'type':db[_0x99a5('0x58')][_0x99a5('0x5b')][_0x99a5('0x59')],'raw':!![],'transaction':_0xed09ef});})[_0x99a5('0x41')](function(_0x3b3162){var _0x269c5f=_[_0x99a5('0x2d')](_0x3b3162,function(_0x4848ff){return Number(_0x4848ff[_0x99a5('0x5c')]);});return db['UserVoiceQueue'][_0x99a5('0x56')]({'where':{'UserId':{'$in':_0x5abd51},'VoiceQueueId':{'$in':_0x269c5f}},'transaction':_0xed09ef});})['then'](function(){var _0x52ee90='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2ea4d4;return db[_0x99a5('0x57')][_0x99a5('0x31')](_0x52ee90,{'type':db['Sequelize'][_0x99a5('0x5b')][_0x99a5('0x59')],'raw':!![],'transaction':_0xed09ef});})[_0x99a5('0x41')](function(_0x10e965){var _0x5ce3a1=_['map'](_0x10e965,function(_0x30202f){return Number(_0x30202f[_0x99a5('0x5d')]);});return db[_0x99a5('0x5e')]['destroy']({'where':{'UserId':{'$in':_0x5abd51},'MailQueueId':{'$in':_0x5ce3a1}},'transaction':_0xed09ef});})['then'](function(){var _0x28ed14=_0x99a5('0x5f')+_0x2ea4d4;return db[_0x99a5('0x57')][_0x99a5('0x31')](_0x28ed14,{'type':db[_0x99a5('0x58')]['QueryTypes'][_0x99a5('0x59')],'raw':!![],'transaction':_0xed09ef});})['then'](function(_0x5edf8b){var _0x465042=_[_0x99a5('0x2d')](_0x5edf8b,function(_0x1fadcb){return Number(_0x1fadcb[_0x99a5('0x60')]);});return db[_0x99a5('0x61')]['destroy']({'where':{'UserId':{'$in':_0x5abd51},'SmsQueueId':{'$in':_0x465042}},'transaction':_0xed09ef});})[_0x99a5('0x41')](function(){var _0x354c55='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2ea4d4;return db[_0x99a5('0x57')][_0x99a5('0x31')](_0x354c55,{'type':db[_0x99a5('0x58')]['QueryTypes'][_0x99a5('0x59')],'raw':!![],'transaction':_0xed09ef});})['then'](function(_0x17aec6){var _0x4f12d7=_[_0x99a5('0x2d')](_0x17aec6,function(_0x45b457){return Number(_0x45b457[_0x99a5('0x62')]);});return db[_0x99a5('0x63')][_0x99a5('0x56')]({'where':{'UserId':{'$in':_0x5abd51},'ChatQueueId':{'$in':_0x4f12d7}},'transaction':_0xed09ef});})[_0x99a5('0x41')](function(){var _0x853806='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2ea4d4;return db['sequelize'][_0x99a5('0x31')](_0x853806,{'type':db[_0x99a5('0x58')][_0x99a5('0x5b')]['SELECT'],'raw':!![],'transaction':_0xed09ef});})[_0x99a5('0x41')](function(_0x3221b1){var _0x5194cb=_[_0x99a5('0x2d')](_0x3221b1,function(_0x553174){return Number(_0x553174[_0x99a5('0x64')]);});return db[_0x99a5('0x65')]['destroy']({'where':{'UserId':{'$in':_0x5abd51},'FaxQueueId':{'$in':_0x5194cb}},'transaction':_0xed09ef});})[_0x99a5('0x41')](function(){var _0x49a2b3=_0x99a5('0x66')+_0x2ea4d4;return db[_0x99a5('0x57')][_0x99a5('0x31')](_0x49a2b3,{'type':db[_0x99a5('0x58')]['QueryTypes'][_0x99a5('0x59')],'raw':!![],'transaction':_0xed09ef});})[_0x99a5('0x41')](function(_0x2b16da){var _0x3365a4=_[_0x99a5('0x2d')](_0x2b16da,function(_0x584881){return Number(_0x584881[_0x99a5('0x67')]);});return db[_0x99a5('0x68')]['destroy']({'where':{'UserId':{'$in':_0x5abd51},'OpenchannelQueueId':{'$in':_0x3365a4}},'transaction':_0xed09ef});})[_0x99a5('0x41')](function(){var _0x38e0ff=_0x99a5('0x69')+_0x2ea4d4;return db['sequelize']['query'](_0x38e0ff,{'type':db[_0x99a5('0x58')][_0x99a5('0x5b')]['SELECT'],'raw':!![],'transaction':_0xed09ef});})[_0x99a5('0x41')](function(_0x1f3fcc){var _0x33ed40=_['map'](_0x1f3fcc,function(_0x35b028){return Number(_0x35b028[_0x99a5('0x6a')]);});return db[_0x99a5('0x6b')][_0x99a5('0x56')]({'where':{'UserId':{'$in':_0x5abd51},'WhatsappQueueId':{'$in':_0x33ed40}},'transaction':_0xed09ef});})[_0x99a5('0x41')](function(){return db[_0x99a5('0x6c')][_0x99a5('0x49')]({'where':{'TeamId':_0x2ea4d4}});})[_0x99a5('0x41')](function(_0x434127){if(_0x434127===null){return;}return db['UserVoicePrefix']['destroy']({'where':{'UserId':{'$in':_0x5abd51},'VoicePrefixId':_0x434127[_0x99a5('0x6d')]},'transaction':_0xed09ef});})['then'](function(){return db[_0x99a5('0x40')]['destroy']({'where':{'id':_0x2ea4d4},'cascade':!![],'transaction':_0xed09ef});})['then'](function(_0x3ee009){if(_0x3ee009===0x0){_0x374964[_0x99a5('0x6e')](0x194);}else{return db[_0x99a5('0x53')][_0x99a5('0x56')]({'where':{'type':_0x99a5('0x50'),'resourceId':_0x2ea4d4},'cascade':!![],'transaction':_0xed09ef})[_0x99a5('0x41')](function(){_0x374964[_0x99a5('0x1e')](0xcc)['end']();});}})[_0x99a5('0x46')](function(_0x364cdb){_0x374964[_0x99a5('0x1e')](0x1f4)[_0x99a5('0x2b')](_0x364cdb);});});};exports[_0x99a5('0x6f')]=function(_0x522f82,_0x3bfe0e,_0xf291e){return db[_0x99a5('0x40')][_0x99a5('0x70')]({'where':{'id':_0x522f82['params']['id']}})[_0x99a5('0x41')](handleEntityNotFound(_0x3bfe0e,null))[_0x99a5('0x41')](function(_0x544c39){if(!_0x522f82[_0x99a5('0x31')][_0x99a5('0x71')]||!utils[_0x99a5('0x72')](_0x522f82['query'][_0x99a5('0x71')])){throw new db[(_0x99a5('0x58'))][(_0x99a5('0x73'))](_0x99a5('0x74'));}var _0x152a76={};var _0x48389b={};_0x48389b[_0x99a5('0x35')]=_[_0x99a5('0x32')](db[_[_0x99a5('0x75')](_0x522f82[_0x99a5('0x31')][_0x99a5('0x71')][_0x99a5('0x76')]())+'Queue'][_0x99a5('0x2e')]);_0x48389b[_0x99a5('0x31')]=_[_0x99a5('0x32')](_0x522f82['query']);_0x48389b[_0x99a5('0x33')]=_[_0x99a5('0x34')](_0x48389b[_0x99a5('0x35')],_0x48389b[_0x99a5('0x31')]);_0x152a76[_0x99a5('0x36')]=_[_0x99a5('0x34')](_0x48389b[_0x99a5('0x35')],qs['fields'](_0x522f82['query'][_0x99a5('0x37')]));_0x152a76['attributes']=_0x152a76[_0x99a5('0x36')][_0x99a5('0x38')]?_0x152a76[_0x99a5('0x36')]:_0x48389b[_0x99a5('0x35')];_0x152a76[_0x99a5('0x22')]=qs[_0x99a5('0x22')](_0x522f82[_0x99a5('0x31')][_0x99a5('0x22')]);_0x152a76[_0x99a5('0x21')]=qs[_0x99a5('0x21')](_0x522f82[_0x99a5('0x31')][_0x99a5('0x21')]);_0x152a76[_0x99a5('0x3a')]=qs[_0x99a5('0x3b')](_0x522f82[_0x99a5('0x31')][_0x99a5('0x3b')]);_0x152a76['where']=qs[_0x99a5('0x33')](_[_0x99a5('0x3d')](_0x522f82[_0x99a5('0x31')],_0x48389b[_0x99a5('0x33')]));_0x152a76=_[_0x99a5('0x48')]({},_0x152a76,_0x522f82['options']);return _0x544c39[_0x99a5('0x4f')+_[_0x99a5('0x75')](_0x522f82[_0x99a5('0x31')]['channel'][_0x99a5('0x76')]())+'Queues'](_0x152a76);})[_0x99a5('0x41')](respondWithResult(_0x3bfe0e,null))[_0x99a5('0x46')](handleError(_0x3bfe0e,null));};exports[_0x99a5('0x77')]=function(_0x21c8c9,_0x110a52,_0x5f3d40){return db['Team'][_0x99a5('0x70')]({'where':{'id':_0x21c8c9['params']['id']}})[_0x99a5('0x41')](function(_0x24c0ad){if(_0x24c0ad){if(!_0x21c8c9[_0x99a5('0x4b')][_0x99a5('0x71')]||!utils[_0x99a5('0x72')](_0x21c8c9[_0x99a5('0x4b')]['channel'])){throw new db[(_0x99a5('0x58'))][(_0x99a5('0x73'))](_0x99a5('0x74'));}return _0x24c0ad[_0x99a5('0x78')+_[_0x99a5('0x75')](_0x21c8c9[_0x99a5('0x4b')]['channel'][_0x99a5('0x76')]())+'Queues'](_0x21c8c9[_0x99a5('0x4b')]['ids']);}return null;})['then'](handleEntityNotFound(_0x110a52,null))[_0x99a5('0x41')](respondWithStatusCode(_0x110a52,null))[_0x99a5('0x46')](handleError(_0x110a52,null));};exports[_0x99a5('0x79')]=function(_0x3a7ae3,_0x245461,_0x1d38f6){return db[_0x99a5('0x40')]['findOne']({'where':{'id':_0x3a7ae3[_0x99a5('0x47')]['id']}})[_0x99a5('0x41')](function(_0x58042e){if(_0x58042e){if(!_0x3a7ae3[_0x99a5('0x31')]['channel']||!utils[_0x99a5('0x72')](_0x3a7ae3[_0x99a5('0x31')][_0x99a5('0x71')])){throw new db[(_0x99a5('0x58'))][(_0x99a5('0x73'))]('Unknown\x20channel');}return _0x58042e[_0x99a5('0x7a')+_['capitalize'](_0x3a7ae3[_0x99a5('0x31')]['channel']['toLowerCase']())+_0x99a5('0x7b')](_0x3a7ae3['query'][_0x99a5('0x7c')]);}return null;})['then'](handleEntityNotFound(_0x245461,null))[_0x99a5('0x41')](respondWithStatusCode(_0x245461,null))[_0x99a5('0x46')](handleError(_0x245461,null));};exports[_0x99a5('0x7d')]=function(_0x1af98a,_0x1c50a2){var _0x3e44a4=_['isArray'](_0x1af98a[_0x99a5('0x4b')]['ids'])?_0x1af98a['body'][_0x99a5('0x7c')]:[_0x1af98a[_0x99a5('0x4b')][_0x99a5('0x7c')]];var _0x4fef67=_0x1af98a[_0x99a5('0x47')]['id'];return db['Team']['find']({'where':{'id':_0x4fef67}})['then'](handleEntityNotFound(_0x1c50a2,null))[_0x99a5('0x41')](function(_0x45cb1b){if(_0x45cb1b){var _0x29deea=[_0x99a5('0x7e'),_0x99a5('0x7f'),_0x99a5('0x80'),_0x99a5('0x81'),'Fax',_0x99a5('0x82'),_0x99a5('0x83')];return db[_0x99a5('0x57')][_0x99a5('0x84')](function(_0x3633da){var _0x7011aa=_[_0x99a5('0x2d')](_0x29deea,function(_0x398402){var _0x27726a={'attributes':['id',_0x99a5('0x2a')]};if(_0x398402==='Voice'){_0x27726a[_0x99a5('0x85')]={'attributes':[_0x99a5('0x86')]};}return _0x45cb1b['get'+_0x398402+_0x99a5('0x7b')](_0x27726a)['then'](function(_0x422eb2){var _0x200b69=_[_0x99a5('0x2d')](_0x422eb2,function(_0x2de853){var _0x544019=_[_0x99a5('0x2d')](_0x3e44a4,function(_0x11c5cc){var _0x5a1245={'where':{'UserId':_0x11c5cc,[_0x398402+_0x99a5('0x87')]:_0x2de853['id']},'transaction':_0x3633da};if(_0x398402===_0x99a5('0x7e')){_0x5a1245['defaults']={'penalty':_0x2de853[_0x99a5('0x88')][_0x99a5('0x86')]};}return db[_0x99a5('0x89')+_0x398402+_0x99a5('0x8a')][_0x99a5('0x8b')](_0x5a1245)[_0x99a5('0x41')](function(){socket[_0x99a5('0x8c')](_0x99a5('0x4c')+_0x398402+_0x99a5('0x8d'),{'UserId':_0x11c5cc,[_0x398402+'QueueId']:_0x2de853['id']});if(_0x398402!==_0x99a5('0x7e')){return;}return db['User'][_0x99a5('0x44')]({'where':{'id':_0x3e44a4,'online':0x1},'attributes':['id',_0x99a5('0x2a'),_0x99a5('0x8e'),_0x99a5('0x8f'),_0x99a5('0x90')],'raw':!![]})[_0x99a5('0x41')](function(_0x46bb2c){var _0x10357a=_[_0x99a5('0x2d')](_0x46bb2c,function(_0x25ee27){return db['UserVoiceQueueRt'][_0x99a5('0x91')]({'membername':_0x25ee27['name'],'UserId':_0x25ee27['id'],'queue_name':_0x2de853[_0x99a5('0x2a')],'VoiceQueueId':_0x2de853['id'],'interface':_[_0x99a5('0x92')](_0x25ee27[_0x99a5('0x90')])?util['format'](_0x99a5('0x93'),_0x25ee27['name']):_0x25ee27[_0x99a5('0x90')],'paused':_0x25ee27[_0x99a5('0x8f')]||![],'penalty':_0x2de853[_0x99a5('0x88')][_0x99a5('0x86')]},{'transaction':_0x3633da});});return Promise[_0x99a5('0x94')](_0x10357a);});});});return Promise[_0x99a5('0x94')](_0x544019);});return Promise[_0x99a5('0x94')](_0x200b69);})[_0x99a5('0x41')](function(){return db[_0x99a5('0x6c')][_0x99a5('0x70')]({'where':{'teamId':_0x4fef67}})[_0x99a5('0x41')](function(_0x2863e5){if(_0x2863e5){var _0x5653b1=_[_0x99a5('0x2d')](_0x3e44a4,function(_0x2f3d6f){db[_0x99a5('0x95')][_0x99a5('0x91')]({'UserId':_0x2f3d6f,'VoicePrefixId':_0x2863e5['VoicePrefixId']});});return Promise['all'](_0x5653b1);}});});});return Promise[_0x99a5('0x94')](_0x7011aa)['then'](function(){return _0x45cb1b[_0x99a5('0x7d')](_0x3e44a4,{'transaction':_0x3633da})[_0x99a5('0x96')](function(_0x4eeca9){return _0x4eeca9;});});});}})['then'](respondWithResult(_0x1c50a2,null))[_0x99a5('0x46')](handleError(_0x1c50a2,null));};exports['removeAgents']=function(_0x49b202,_0x4bca2d){var _0x1286a6=_[_0x99a5('0x97')](_0x49b202[_0x99a5('0x31')][_0x99a5('0x7c')])?_0x49b202[_0x99a5('0x31')][_0x99a5('0x7c')]:[_0x49b202[_0x99a5('0x31')][_0x99a5('0x7c')]];var _0x249f0e=_0x49b202[_0x99a5('0x47')]['id'];return db[_0x99a5('0x40')][_0x99a5('0x49')]({'where':{'id':_0x249f0e}})[_0x99a5('0x41')](handleEntityNotFound(_0x4bca2d,null))['then'](function(_0x4ff3b0){if(_0x4ff3b0){var _0x48ad7b=[_0x99a5('0x7e'),_0x99a5('0x7f'),_0x99a5('0x80'),_0x99a5('0x81'),_0x99a5('0x98'),_0x99a5('0x82'),_0x99a5('0x83')];return db['sequelize'][_0x99a5('0x84')](function(_0x3f75b1){var _0xd39843=_[_0x99a5('0x2d')](_0x48ad7b,function(_0x2af4c7){var _0x15bf92={'attributes':['id',_0x99a5('0x2a')]};return _0x4ff3b0[_0x99a5('0x4f')+_0x2af4c7+_0x99a5('0x7b')](_0x15bf92)[_0x99a5('0x41')](function(_0x5a945e){var _0x409e0e=_[_0x99a5('0x2d')](_0x5a945e,function(_0x349060){return _0x349060['removeAgents'](_0x1286a6,{'transaction':_0x3f75b1})[_0x99a5('0x41')](function(){var _0x235ce6=_[_0x99a5('0x2d')](_0x1286a6,function(_0xdf5a0a){socket[_0x99a5('0x8c')](_0x99a5('0x4c')+_0x2af4c7+_0x99a5('0x99'),{'UserId':Number(_0xdf5a0a),[_0x2af4c7+_0x99a5('0x87')]:_0x349060['id']});if(_0x2af4c7!==_0x99a5('0x7e')){return;}return db['UserVoiceQueueRt'][_0x99a5('0x56')]({'where':{'VoiceQueueId':_0x349060['id'],'UserId':_0xdf5a0a},'transaction':_0x3f75b1});});return Promise[_0x99a5('0x94')](_0x235ce6);});});return Promise[_0x99a5('0x94')](_0x409e0e);});});return Promise[_0x99a5('0x94')](_0xd39843)['then'](function(){return _0x4ff3b0[_0x99a5('0x9a')](_0x1286a6,{'transaction':_0x3f75b1});})[_0x99a5('0x41')](function(){return db['TeamVoicePrefix'][_0x99a5('0x70')]({'where':{'teamId':_0x249f0e}})[_0x99a5('0x41')](function(_0x3a8ded){if(_0x3a8ded){var _0x203fba=_['map'](_0x1286a6,function(_0x1aae38){db[_0x99a5('0x95')][_0x99a5('0x56')]({'where':{'UserId':_0x1aae38,'VoicePrefixId':_0x3a8ded[_0x99a5('0x6d')]}});});return Promise[_0x99a5('0x94')](_0x203fba);}});});});}})[_0x99a5('0x41')](respondWithStatusCode(_0x4bca2d,null))[_0x99a5('0x46')](handleError(_0x4bca2d,null));};exports['getAgents']=function(_0x413827,_0xe2c831,_0x306963){var _0x4d0bdf={};var _0x273317={};var _0x57f9d8;var _0x279adf;return db[_0x99a5('0x40')][_0x99a5('0x70')]({'where':{'id':_0x413827['params']['id']}})['then'](handleEntityNotFound(_0xe2c831,null))[_0x99a5('0x41')](function(_0x273f10){if(_0x273f10){_0x57f9d8=_0x273f10;_0x273317[_0x99a5('0x35')]=_['keys'](db[_0x99a5('0x89')]['rawAttributes']);_0x273317[_0x99a5('0x31')]=_[_0x99a5('0x32')](_0x413827[_0x99a5('0x31')]);_0x273317[_0x99a5('0x33')]=_[_0x99a5('0x34')](_0x273317[_0x99a5('0x35')],_0x273317['query']);_0x4d0bdf['attributes']=_['intersection'](_0x273317[_0x99a5('0x35')],qs[_0x99a5('0x37')](_0x413827['query'][_0x99a5('0x37')]));_0x4d0bdf[_0x99a5('0x36')]=_0x4d0bdf[_0x99a5('0x36')]['length']?_0x4d0bdf[_0x99a5('0x36')]:_0x273317['model'];_0x4d0bdf[_0x99a5('0x3a')]=qs[_0x99a5('0x3b')](_0x413827[_0x99a5('0x31')][_0x99a5('0x3b')]);_0x4d0bdf['where']=qs[_0x99a5('0x33')](_['pick'](_0x413827[_0x99a5('0x31')],_0x273317[_0x99a5('0x33')]));if(_0x413827[_0x99a5('0x31')][_0x99a5('0x3e')]){_0x4d0bdf[_0x99a5('0x3c')]=_[_0x99a5('0x48')](_0x4d0bdf['where'],{'$or':_['map'](_0x4d0bdf[_0x99a5('0x36')],function(_0x28f730){var _0x194f26={};_0x194f26[_0x28f730]={'$like':'%'+_0x413827[_0x99a5('0x31')][_0x99a5('0x3e')]+'%'};return _0x194f26;})});}_0x4d0bdf=_[_0x99a5('0x48')]({},_0x4d0bdf,_0x413827['options']);return _0x57f9d8[_0x99a5('0x9b')](_0x4d0bdf);}})['then'](function(_0x4cce35){if(_0x4cce35){_0x279adf=_0x4cce35['length'];if(!_0x413827[_0x99a5('0x31')][_0x99a5('0x39')]('nolimit')){_0x4d0bdf['limit']=qs[_0x99a5('0x22')](_0x413827[_0x99a5('0x31')][_0x99a5('0x22')]);_0x4d0bdf[_0x99a5('0x21')]=qs[_0x99a5('0x21')](_0x413827[_0x99a5('0x31')][_0x99a5('0x21')]);}return _0x57f9d8[_0x99a5('0x9b')](_0x4d0bdf);}})[_0x99a5('0x41')](function(_0x2ec60b){if(_0x2ec60b){return _0x2ec60b?{'count':_0x279adf,'rows':_0x2ec60b}:null;}})[_0x99a5('0x41')](respondWithResult(_0xe2c831,null))[_0x99a5('0x46')](handleError(_0xe2c831,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 78a67eb..4333395 100644 --- a/server/api/team/team.events.js +++ b/server/api/team/team.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde76=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners','update','remove'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0xde76,0x180));var _0x6de7=function(_0x216f54,_0x471e04){_0x216f54=_0x216f54-0x0;var _0x365f76=_0xde76[_0x216f54];return _0x365f76;};'use strict';var EventEmitter=require(_0x6de7('0x0'));var Team=require(_0x6de7('0x1'))['db'][_0x6de7('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x6de7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6de7('0x4'),'afterDestroy':_0x6de7('0x5')};function emitEvent(_0x525e0e){return function(_0x4be56b,_0x1a6455,_0x20c7f8){TeamEvents[_0x6de7('0x6')](_0x525e0e+':'+_0x4be56b['id'],_0x4be56b);TeamEvents['emit'](_0x525e0e,_0x4be56b);_0x20c7f8(null);};}for(var e in events){if(events[_0x6de7('0x7')](e)){var event=events[e];Team[_0x6de7('0x8')](e,emitEvent(event));}}module[_0x6de7('0x9')]=TeamEvents; \ No newline at end of file +var _0xcbd2=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','Team','setMaxListeners','update'];(function(_0x2e4cbf,_0x8763d3){var _0x52840f=function(_0x31b93f){while(--_0x31b93f){_0x2e4cbf['push'](_0x2e4cbf['shift']());}};_0x52840f(++_0x8763d3);}(_0xcbd2,0x1ea));var _0x2cbd=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0xcbd2[_0x4cc492];return _0x1f36b9;};'use strict';var EventEmitter=require(_0x2cbd('0x0'));var Team=require(_0x2cbd('0x1'))['db'][_0x2cbd('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x2cbd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2cbd('0x4'),'afterDestroy':_0x2cbd('0x5')};function emitEvent(_0x12eca4){return function(_0x39ea26,_0x3e2670,_0x1eac3f){TeamEvents['emit'](_0x12eca4+':'+_0x39ea26['id'],_0x39ea26);TeamEvents[_0x2cbd('0x6')](_0x12eca4,_0x39ea26);_0x1eac3f(null);};}for(var e in events){if(events[_0x2cbd('0x7')](e)){var event=events[e];Team[_0x2cbd('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index f8e94a3..16eba06 100644 --- a/server/api/team/team.model.js +++ b/server/api/team/team.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8ed=['Team','teams','Chat','Fax','Mail','Sms','Voice','resolve','map','all','lodash','./team.attributes','get','then','setDataValue','channel','catch','exports','define'];(function(_0x409477,_0x102af2){var _0x51e30f=function(_0x299d3c){while(--_0x299d3c){_0x409477['push'](_0x409477['shift']());}};_0x51e30f(++_0x102af2);}(_0xa8ed,0x1bf));var _0xda8e=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xa8ed[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0xda8e('0x0'));var attributes=require(_0xda8e('0x1'));function getQueuesByChannel(_0x5dcdfd,_0x143cc9){var _0x14fef6=_0xda8e('0x2')+_0x143cc9+'Queues';return _0x5dcdfd[_0x14fef6]()[_0xda8e('0x3')](function(_0x3915d2){return _['map'](_0x3915d2,function(_0x2c18c6){_0x2c18c6[_0xda8e('0x4')](_0xda8e('0x5'),_0x143cc9);return _0x2c18c6;});})[_0xda8e('0x6')](function(_0x9cc302){throw _0x9cc302;});}module[_0xda8e('0x7')]=function(_0x4531be){return _0x4531be[_0xda8e('0x8')](_0xda8e('0x9'),attributes,{'tableName':_0xda8e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x519941=this;var _0x2fed5e=[_0xda8e('0xb'),_0xda8e('0xc'),_0xda8e('0xd'),'Openchannel',_0xda8e('0xe'),_0xda8e('0xf'),'Whatsapp'];return Promise[_0xda8e('0x10')]()['then'](function(){var _0x3d5165=_[_0xda8e('0x11')](_0x2fed5e,function(_0x157f32){return getQueuesByChannel(_0x519941,_0x157f32);});return Promise[_0xda8e('0x12')](_0x3d5165);})[_0xda8e('0x6')](function(_0x27719e){throw _0x27719e;});}}});}; \ No newline at end of file +var _0x9090=['resolve','map','lodash','get','Queues','then','setDataValue','channel','catch','define','Chat','Fax','Mail','Voice','Whatsapp'];(function(_0x3eab55,_0x4d0bad){var _0x18be83=function(_0xcf90db){while(--_0xcf90db){_0x3eab55['push'](_0x3eab55['shift']());}};_0x18be83(++_0x4d0bad);}(_0x9090,0x13d));var _0x0909=function(_0xa53124,_0x5a03d7){_0xa53124=_0xa53124-0x0;var _0x557456=_0x9090[_0xa53124];return _0x557456;};'use strict';var _=require(_0x0909('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x52861d,_0x342385){var _0x42d3a5=_0x0909('0x1')+_0x342385+_0x0909('0x2');return _0x52861d[_0x42d3a5]()[_0x0909('0x3')](function(_0x417397){return _['map'](_0x417397,function(_0x242abc){_0x242abc[_0x0909('0x4')](_0x0909('0x5'),_0x342385);return _0x242abc;});})[_0x0909('0x6')](function(_0x48bce4){throw _0x48bce4;});}module['exports']=function(_0x3b9f26){return _0x3b9f26[_0x0909('0x7')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0xe9703a=this;var _0x353151=[_0x0909('0x8'),_0x0909('0x9'),_0x0909('0xa'),'Openchannel','Sms',_0x0909('0xb'),_0x0909('0xc')];return Promise[_0x0909('0xd')]()[_0x0909('0x3')](function(){var _0x43251d=_[_0x0909('0xe')](_0x353151,function(_0x3a47ed){return getQueuesByChannel(_0xe9703a,_0x3a47ed);});return Promise['all'](_0x43251d);})['catch'](function(_0x442d46){throw _0x442d46;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 57ecb47..9c02c5a 100644 --- a/server/api/team/team.rpc.js +++ b/server/api/team/team.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2d7=['redis','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','stringify','error','code','Team,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x340fc7,_0x12a901){var _0x586c93=function(_0xc3a679){while(--_0xc3a679){_0x340fc7['push'](_0x340fc7['shift']());}};_0x586c93(++_0x12a901);}(_0xf2d7,0xd3));var _0x7f2d=function(_0x26aed4,_0x2ee229){_0x26aed4=_0x26aed4-0x0;var _0x10d095=_0xf2d7[_0x26aed4];return _0x10d095;};'use strict';var _=require(_0x7f2d('0x0'));var util=require(_0x7f2d('0x1'));var moment=require(_0x7f2d('0x2'));var BPromise=require(_0x7f2d('0x3'));var rs=require(_0x7f2d('0x4'));var fs=require('fs');var Redis=require(_0x7f2d('0x5'));var db=require(_0x7f2d('0x6'))['db'];var utils=require(_0x7f2d('0x7'));var logger=require(_0x7f2d('0x8'))(_0x7f2d('0x9'));var config=require(_0x7f2d('0xa'));var jayson=require(_0x7f2d('0xb'));var client=jayson[_0x7f2d('0xc')]['http']({'port':0x232a});config[_0x7f2d('0xd')]=_['defaults'](config[_0x7f2d('0xd')],{'host':_0x7f2d('0xe'),'port':0x18eb});var socket=require(_0x7f2d('0xf'))(new Redis(config['redis']));require('./team.socket')[_0x7f2d('0x10')](socket);function respondWithRpcPromise(_0x3bb0fc,_0x36f540,_0x205de2){return new BPromise(function(_0x5157cb,_0x4577de){return client['request'](_0x3bb0fc,_0x205de2)[_0x7f2d('0x11')](function(_0x300a5d){logger[_0x7f2d('0x12')]('Team,\x20%s,\x20%s',_0x36f540,_0x7f2d('0x13'));logger[_0x7f2d('0x14')]('Team,\x20%s,\x20%s,\x20%s',_0x36f540,_0x7f2d('0x13'),JSON[_0x7f2d('0x15')](_0x300a5d));if(_0x300a5d[_0x7f2d('0x16')]){if(_0x300a5d[_0x7f2d('0x16')][_0x7f2d('0x17')]===0x1f4){logger[_0x7f2d('0x16')](_0x7f2d('0x18'),_0x36f540,_0x300a5d['error'][_0x7f2d('0x19')]);return _0x4577de(_0x300a5d[_0x7f2d('0x16')][_0x7f2d('0x19')]);}logger[_0x7f2d('0x16')]('Team,\x20%s,\x20%s',_0x36f540,_0x300a5d['error'][_0x7f2d('0x19')]);return _0x5157cb(_0x300a5d[_0x7f2d('0x16')][_0x7f2d('0x19')]);}else{logger[_0x7f2d('0x12')]('Team,\x20%s,\x20%s',_0x36f540,'request\x20sent');_0x5157cb(_0x300a5d[_0x7f2d('0x1a')][_0x7f2d('0x19')]);}})[_0x7f2d('0x1b')](function(_0x15dd90){logger[_0x7f2d('0x16')](_0x7f2d('0x18'),_0x36f540,_0x15dd90);_0x4577de(_0x15dd90);});});} \ No newline at end of file +var _0x8196=['redis','defaults','localhost','socket.io-emitter','info','debug','stringify','error','Team,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x584a03,_0x59e0c8){var _0x29d9c9=function(_0x27ea6f){while(--_0x27ea6f){_0x584a03['push'](_0x584a03['shift']());}};_0x29d9c9(++_0x59e0c8);}(_0x8196,0x174));var _0x6819=function(_0xb34471,_0x3f9c7c){_0xb34471=_0xb34471-0x0;var _0x5ea18a=_0x8196[_0xb34471];return _0x5ea18a;};'use strict';var _=require(_0x6819('0x0'));var util=require(_0x6819('0x1'));var moment=require(_0x6819('0x2'));var BPromise=require('bluebird');var rs=require(_0x6819('0x3'));var fs=require('fs');var Redis=require(_0x6819('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6819('0x5'));var logger=require(_0x6819('0x6'))(_0x6819('0x7'));var config=require(_0x6819('0x8'));var jayson=require(_0x6819('0x9'));var client=jayson[_0x6819('0xa')][_0x6819('0xb')]({'port':0x232a});config[_0x6819('0xc')]=_[_0x6819('0xd')](config['redis'],{'host':_0x6819('0xe'),'port':0x18eb});var socket=require(_0x6819('0xf'))(new Redis(config[_0x6819('0xc')]));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x81181d,_0x1896e6,_0x12945e){return new BPromise(function(_0x2a60ff,_0x2e2d9c){return client['request'](_0x81181d,_0x12945e)['then'](function(_0x17b160){logger[_0x6819('0x10')]('Team,\x20%s,\x20%s',_0x1896e6,'request\x20sent');logger[_0x6819('0x11')]('Team,\x20%s,\x20%s,\x20%s',_0x1896e6,'request\x20sent',JSON[_0x6819('0x12')](_0x17b160));if(_0x17b160['error']){if(_0x17b160['error']['code']===0x1f4){logger[_0x6819('0x13')](_0x6819('0x14'),_0x1896e6,_0x17b160[_0x6819('0x13')]['message']);return _0x2e2d9c(_0x17b160[_0x6819('0x13')]['message']);}logger[_0x6819('0x13')](_0x6819('0x14'),_0x1896e6,_0x17b160[_0x6819('0x13')]['message']);return _0x2a60ff(_0x17b160[_0x6819('0x13')][_0x6819('0x15')]);}else{logger[_0x6819('0x10')]('Team,\x20%s,\x20%s',_0x1896e6,'request\x20sent');_0x2a60ff(_0x17b160[_0x6819('0x16')][_0x6819('0x15')]);}})[_0x6819('0x17')](function(_0x585dd9){logger[_0x6819('0x13')](_0x6819('0x14'),_0x1896e6,_0x585dd9);_0x2e2d9c(_0x585dd9);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 7e4fd45..027616b 100644 --- a/server/api/team/team.socket.js +++ b/server/api/team/team.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4559=['update','emit','register','team:','save'];(function(_0x4b23be,_0x32964b){var _0x5ba2d8=function(_0xebdb49){while(--_0xebdb49){_0x4b23be['push'](_0x4b23be['shift']());}};_0x5ba2d8(++_0x32964b);}(_0x4559,0x18f));var _0x9455=function(_0x37e343,_0x5dbfea){_0x37e343=_0x37e343-0x0;var _0xf688dc=_0x4559[_0x37e343];return _0xf688dc;};'use strict';var TeamEvents=require('./team.events');var events=[_0x9455('0x0'),'remove',_0x9455('0x1')];function createListener(_0x23d5da,_0x162151){return function(_0x58888c){_0x162151[_0x9455('0x2')](_0x23d5da,_0x58888c);};}function removeListener(_0x273a17,_0x591b2d){return function(){TeamEvents['removeListener'](_0x273a17,_0x591b2d);};}exports[_0x9455('0x3')]=function(_0xee44aa){for(var _0x374563=0x0,_0x1bfcab=events['length'];_0x374563<_0x1bfcab;_0x374563++){var _0x596ee9=events[_0x374563];var _0xa1c2d6=createListener(_0x9455('0x4')+_0x596ee9,_0xee44aa);TeamEvents['on'](_0x596ee9,_0xa1c2d6);}}; \ No newline at end of file +var _0xccd7=['save','remove','update','emit','./team.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xccd7,0x185));var _0x7ccd=function(_0x37b3e5,_0x33b516){_0x37b3e5=_0x37b3e5-0x0;var _0x207f20=_0xccd7[_0x37b3e5];return _0x207f20;};'use strict';var TeamEvents=require(_0x7ccd('0x0'));var events=[_0x7ccd('0x1'),_0x7ccd('0x2'),_0x7ccd('0x3')];function createListener(_0x4a89c5,_0x5fc33c){return function(_0x27a82a){_0x5fc33c[_0x7ccd('0x4')](_0x4a89c5,_0x27a82a);};}function removeListener(_0x444498,_0x344a64){return function(){TeamEvents['removeListener'](_0x444498,_0x344a64);};}exports['register']=function(_0x165799){for(var _0x5c1788=0x0,_0x34ea24=events['length'];_0x5c1788<_0x34ea24;_0x5c1788++){var _0x22fad7=events[_0x5c1788];var _0x4ac450=createListener('team:'+_0x22fad7,_0x165799);TeamEvents['on'](_0x22fad7,_0x4ac450);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index c5c7d36..3f4377b 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x08e5=['exports','INTEGER','sequelize'];(function(_0x19b063,_0x30d9cb){var _0x502d6a=function(_0x391263){while(--_0x391263){_0x19b063['push'](_0x19b063['shift']());}};_0x502d6a(++_0x30d9cb);}(_0x08e5,0x1a9));var _0x508e=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x08e5[_0x32f7d7];return _0x133d09;};'use strict';var Sequelize=require(_0x508e('0x0'));module[_0x508e('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x508e('0x2')]}}; \ No newline at end of file +var _0x336a=['INTEGER','sequelize','exports'];(function(_0x4c8a2c,_0x3d6fe1){var _0x2b3443=function(_0x5bf11b){while(--_0x5bf11b){_0x4c8a2c['push'](_0x4c8a2c['shift']());}};_0x2b3443(++_0x3d6fe1);}(_0x336a,0xa3));var _0xa336=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x336a[_0x3e44fa];return _0x2a0aba;};'use strict';var Sequelize=require(_0xa336('0x0'));module[_0xa336('0x1')]={'TeamId':{'type':Sequelize[_0xa336('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index a69b898..8629224 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3264=['team_has_voice_prefixes','util','../../config/logger','api','moment','path','./teamVoicePrefix.attributes','exports','TeamVoicePrefix'];(function(_0x209fcd,_0x1ecccc){var _0x501d5e=function(_0x8d74fe){while(--_0x8d74fe){_0x209fcd['push'](_0x209fcd['shift']());}};_0x501d5e(++_0x1ecccc);}(_0x3264,0x7f));var _0x4326=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x3264[_0x166742];return _0xb7814a;};'use strict';var _=require('lodash');var util=require(_0x4326('0x0'));var logger=require(_0x4326('0x1'))(_0x4326('0x2'));var moment=require(_0x4326('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4326('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4326('0x5'));module[_0x4326('0x6')]=function(_0xed0465,_0x3f8d4e){return _0xed0465['define'](_0x4326('0x7'),attributes,{'tableName':_0x4326('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c66=['path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','api','moment','bluebird','request-promise'];(function(_0x334365,_0x373b4e){var _0x2d4dee=function(_0x218bd6){while(--_0x218bd6){_0x334365['push'](_0x334365['shift']());}};_0x2d4dee(++_0x373b4e);}(_0x3c66,0x8b));var _0x63c6=function(_0x289196,_0x58ea94){_0x289196=_0x289196-0x0;var _0x162c38=_0x3c66[_0x289196];return _0x162c38;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x63c6('0x0'));var moment=require(_0x63c6('0x1'));var BPromise=require(_0x63c6('0x2'));var rp=require(_0x63c6('0x3'));var fs=require('fs');var path=require(_0x63c6('0x4'));var rimraf=require(_0x63c6('0x5'));var config=require(_0x63c6('0x6'));var attributes=require(_0x63c6('0x7'));module[_0x63c6('0x8')]=function(_0x326a7b,_0x148dbc){return _0x326a7b[_0x63c6('0x9')]('TeamVoicePrefix',attributes,{'tableName':_0x63c6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 8fbc5cc..8c78799 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2bd0d7,_0x158fb3){var _0x3f3d78=function(_0x204a96){while(--_0x204a96){_0x2bd0d7['push'](_0x2bd0d7['shift']());}};_0x3f3d78(++_0x158fb3);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x514bd1,_0x25ea3e){var _0x58a281=function(_0x25567a){while(--_0x25567a){_0x514bd1['push'](_0x514bd1['shift']());}};_0x58a281(++_0x25ea3e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 537cb0d..d3f040b 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc44=['INTEGER','exports'];(function(_0x37c3b7,_0x4e8a41){var _0x446bcd=function(_0x175478){while(--_0x175478){_0x37c3b7['push'](_0x37c3b7['shift']());}};_0x446bcd(++_0x4e8a41);}(_0xbc44,0xff));var _0x4bc4=function(_0x5a3253,_0x56cd09){_0x5a3253=_0x5a3253-0x0;var _0x1465b8=_0xbc44[_0x5a3253];return _0x1465b8;};'use strict';var Sequelize=require('sequelize');module[_0x4bc4('0x0')]={'penalty':{'type':Sequelize[_0x4bc4('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x59b7=['exports','INTEGER','sequelize'];(function(_0x5b9792,_0x204d8b){var _0x4ddab8=function(_0x565b66){while(--_0x565b66){_0x5b9792['push'](_0x5b9792['shift']());}};_0x4ddab8(++_0x204d8b);}(_0x59b7,0xc5));var _0x759b=function(_0x524475,_0x95431c){_0x524475=_0x524475-0x0;var _0x47c529=_0x59b7[_0x524475];return _0x47c529;};'use strict';var Sequelize=require(_0x759b('0x0'));module[_0x759b('0x1')]={'penalty':{'type':Sequelize[_0x759b('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index e72a0b9..834d87e 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','lodash'];(function(_0x27a9cc,_0x1b1b55){var _0x412f06=function(_0x6edd42){while(--_0x6edd42){_0x27a9cc['push'](_0x27a9cc['shift']());}};_0x412f06(++_0x1b1b55);}(_0xb43b,0xbf));var _0xbb43=function(_0x57b19d,_0x4b297f){_0x57b19d=_0x57b19d-0x0;var _0xe3f7d8=_0xb43b[_0x57b19d];return _0xe3f7d8;};'use strict';var _=require(_0xbb43('0x0'));var util=require('util');var logger=require(_0xbb43('0x1'))(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require(_0xbb43('0x5'));var fs=require('fs');var path=require(_0xbb43('0x6'));var rimraf=require(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var attributes=require(_0xbb43('0x9'));module[_0xbb43('0xa')]=function(_0x2e55f3,_0x51e44e){return _0x2e55f3[_0xbb43('0xb')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4ba=['../../config/logger','api','moment','request-promise','../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','util'];(function(_0x4bc7dd,_0x4a6aa2){var _0x8a71a0=function(_0x249828){while(--_0x249828){_0x4bc7dd['push'](_0x4bc7dd['shift']());}};_0x8a71a0(++_0x4a6aa2);}(_0xa4ba,0x1b7));var _0xaa4b=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xa4ba[_0x4792c8];return _0x35edb1;};'use strict';var _=require('lodash');var util=require(_0xaa4b('0x0'));var logger=require(_0xaa4b('0x1'))(_0xaa4b('0x2'));var moment=require(_0xaa4b('0x3'));var BPromise=require('bluebird');var rp=require(_0xaa4b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaa4b('0x5'));var attributes=require(_0xaa4b('0x6'));module[_0xaa4b('0x7')]=function(_0x146035,_0x4809a9){return _0x146035[_0xaa4b('0x8')]('TeamVoiceQueue',attributes,{'tableName':_0xaa4b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 26e1dce..4a15301 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6c6=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf6c6,0x154));var _0x6f6c=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0xf6c6[_0x4e7d25];return _0x526fe6;};'use strict';var _=require('lodash');var util=require(_0x6f6c('0x0'));var moment=require('moment');var BPromise=require(_0x6f6c('0x1'));var rs=require(_0x6f6c('0x2'));var fs=require('fs');var Redis=require(_0x6f6c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f6c('0x4'));var logger=require(_0x6f6c('0x5'))(_0x6f6c('0x6'));var config=require('../../config/environment');var jayson=require(_0x6f6c('0x7'));var client=jayson[_0x6f6c('0x8')][_0x6f6c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40a1c0,_0x3feb60,_0x1999c6){return new BPromise(function(_0x3cb15a,_0x2ef627){return client[_0x6f6c('0xa')](_0x40a1c0,_0x1999c6)[_0x6f6c('0xb')](function(_0x44bb26){logger[_0x6f6c('0xc')](_0x6f6c('0xd'),_0x3feb60,_0x6f6c('0xe'));logger[_0x6f6c('0xf')](_0x6f6c('0x10'),_0x3feb60,_0x6f6c('0xe'),JSON[_0x6f6c('0x11')](_0x44bb26));if(_0x44bb26['error']){if(_0x44bb26[_0x6f6c('0x12')][_0x6f6c('0x13')]===0x1f4){logger['error'](_0x6f6c('0xd'),_0x3feb60,_0x44bb26[_0x6f6c('0x12')]['message']);return _0x2ef627(_0x44bb26['error'][_0x6f6c('0x14')]);}logger[_0x6f6c('0x12')](_0x6f6c('0xd'),_0x3feb60,_0x44bb26[_0x6f6c('0x12')]['message']);return _0x3cb15a(_0x44bb26['error'][_0x6f6c('0x14')]);}else{logger[_0x6f6c('0xc')](_0x6f6c('0xd'),_0x3feb60,_0x6f6c('0xe'));_0x3cb15a(_0x44bb26[_0x6f6c('0x15')][_0x6f6c('0x14')]);}})[_0x6f6c('0x16')](function(_0x282b7f){logger[_0x6f6c('0x12')](_0x6f6c('0xd'),_0x3feb60,_0x282b7f);_0x2ef627(_0x282b7f);});});} \ No newline at end of file +var _0x6da2=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','TeamVoiceQueue,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1a83f2,_0x4661bc){var _0x30d0ad=function(_0x3f4349){while(--_0x3f4349){_0x1a83f2['push'](_0x1a83f2['shift']());}};_0x30d0ad(++_0x4661bc);}(_0x6da2,0xe1));var _0x26da=function(_0x437ea9,_0x55c4cd){_0x437ea9=_0x437ea9-0x0;var _0x5c04b4=_0x6da2[_0x437ea9];return _0x5c04b4;};'use strict';var _=require(_0x26da('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x26da('0x1'));var rs=require(_0x26da('0x2'));var fs=require('fs');var Redis=require(_0x26da('0x3'));var db=require(_0x26da('0x4'))['db'];var utils=require(_0x26da('0x5'));var logger=require(_0x26da('0x6'))('rpc');var config=require(_0x26da('0x7'));var jayson=require(_0x26da('0x8'));var client=jayson['client'][_0x26da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21b52c,_0x57ec1a,_0x26c40b){return new BPromise(function(_0x29bcad,_0x2560be){return client[_0x26da('0xa')](_0x21b52c,_0x26c40b)[_0x26da('0xb')](function(_0x4c623a){logger[_0x26da('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x57ec1a,_0x26da('0xd'));logger['debug'](_0x26da('0xe'),_0x57ec1a,_0x26da('0xd'),JSON['stringify'](_0x4c623a));if(_0x4c623a['error']){if(_0x4c623a[_0x26da('0xf')][_0x26da('0x10')]===0x1f4){logger[_0x26da('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x57ec1a,_0x4c623a[_0x26da('0xf')][_0x26da('0x11')]);return _0x2560be(_0x4c623a[_0x26da('0xf')][_0x26da('0x11')]);}logger[_0x26da('0xf')](_0x26da('0x12'),_0x57ec1a,_0x4c623a[_0x26da('0xf')][_0x26da('0x11')]);return _0x29bcad(_0x4c623a[_0x26da('0xf')][_0x26da('0x11')]);}else{logger[_0x26da('0xc')](_0x26da('0x12'),_0x57ec1a,_0x26da('0xd'));_0x29bcad(_0x4c623a[_0x26da('0x13')][_0x26da('0x11')]);}})[_0x26da('0x14')](function(_0x343350){logger[_0x26da('0xf')](_0x26da('0x12'),_0x57ec1a,_0x343350);_0x2560be(_0x343350);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 38ac564..6c71954 100644 --- a/server/api/template/index.js +++ b/server/api/template/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1241=['../../config/environment','./template.controller','isAuthenticated','index','get','/:id','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x37e597,_0x3569a8){var _0x14fe81=function(_0x28e24f){while(--_0x28e24f){_0x37e597['push'](_0x37e597['shift']());}};_0x14fe81(++_0x3569a8);}(_0x1241,0xb4));var _0x1124=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1241[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1124('0x0'));var util=require('util');var path=require(_0x1124('0x1'));var timeout=require(_0x1124('0x2'));var express=require(_0x1124('0x3'));var router=express[_0x1124('0x4')]();var fs_extra=require(_0x1124('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1124('0x6'));var config=require(_0x1124('0x7'));var controller=require(_0x1124('0x8'));router['get']('/',auth[_0x1124('0x9')](),controller[_0x1124('0xa')]);router[_0x1124('0xb')](_0x1124('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x1124('0x9')](),controller['create']);router[_0x1124('0xd')](_0x1124('0xc'),auth[_0x1124('0x9')](),controller[_0x1124('0xe')]);router[_0x1124('0xf')](_0x1124('0xc'),auth['isAuthenticated'](),controller[_0x1124('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf29d=['isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','get'];(function(_0x2a979b,_0x3da6){var _0xf6ede1=function(_0x6d0b80){while(--_0x6d0b80){_0x2a979b['push'](_0x2a979b['shift']());}};_0xf6ede1(++_0x3da6);}(_0xf29d,0xc4));var _0xdf29=function(_0x1217b7,_0x14dfbc){_0x1217b7=_0x1217b7-0x0;var _0x331ddc=_0xf29d[_0x1217b7];return _0x331ddc;};'use strict';var multer=require(_0xdf29('0x0'));var util=require(_0xdf29('0x1'));var path=require('path');var timeout=require(_0xdf29('0x2'));var express=require(_0xdf29('0x3'));var router=express[_0xdf29('0x4')]();var fs_extra=require(_0xdf29('0x5'));var auth=require(_0xdf29('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./template.controller');router[_0xdf29('0x7')]('/',auth[_0xdf29('0x8')](),controller[_0xdf29('0x9')]);router['get'](_0xdf29('0xa'),auth[_0xdf29('0x8')](),controller[_0xdf29('0xb')]);router['post']('/',auth[_0xdf29('0x8')](),controller[_0xdf29('0xc')]);router[_0xdf29('0xd')](_0xdf29('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xdf29('0xe')](_0xdf29('0xa'),auth['isAuthenticated'](),controller[_0xdf29('0xf')]);module[_0xdf29('0x10')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 6bbc973..e4b5e6a 100644 --- a/server/api/template/template.attributes.js +++ b/server/api/template/template.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdcb5=['STRING','exports'];(function(_0x2f2bba,_0x3a62c2){var _0x55c530=function(_0x2305ad){while(--_0x2305ad){_0x2f2bba['push'](_0x2f2bba['shift']());}};_0x55c530(++_0x3a62c2);}(_0xdcb5,0xcd));var _0x5dcb=function(_0x1c319b,_0x5ae0bf){_0x1c319b=_0x1c319b-0x0;var _0x413206=_0xdcb5[_0x1c319b];return _0x413206;};'use strict';var Sequelize=require('sequelize');module[_0x5dcb('0x0')]={'name':{'type':Sequelize[_0x5dcb('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xfa2a=['STRING','TEXT','exports'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xfa2a,0x146));var _0xafa2=function(_0xa886d0,_0x33ece8){_0xa886d0=_0xa886d0-0x0;var _0x2bc1d2=_0xfa2a[_0xa886d0];return _0x2bc1d2;};'use strict';var Sequelize=require('sequelize');module[_0xafa2('0x0')]={'name':{'type':Sequelize[_0xafa2('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xafa2('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index b25610e..8ddf962 100644 --- a/server/api/template/template.controller.js +++ b/server/api/template/template.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf41c=['moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','Templates','stack','send','index','map','Template','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','UserProfileResource','name','error','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xf41c,0xa7));var _0xcf41=function(_0x884bee,_0x3c58bf){_0x884bee=_0x884bee-0x0;var _0x36cf30=_0xf41c[_0x884bee];return _0x36cf30;};'use strict';var emlformat=require(_0xcf41('0x0'));var rimraf=require(_0xcf41('0x1'));var zipdir=require(_0xcf41('0x2'));var jsonpatch=require(_0xcf41('0x3'));var rp=require(_0xcf41('0x4'));var moment=require(_0xcf41('0x5'));var BPromise=require(_0xcf41('0x6'));var Mustache=require(_0xcf41('0x7'));var util=require('util');var path=require(_0xcf41('0x8'));var sox=require(_0xcf41('0x9'));var csv=require(_0xcf41('0xa'));var ejs=require(_0xcf41('0xb'));var fs=require('fs');var fs_extra=require(_0xcf41('0xc'));var _=require(_0xcf41('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcf41('0xe'));var deskjs=require(_0xcf41('0xf'));var toCsv=require(_0xcf41('0xa'));var querystring=require(_0xcf41('0x10'));var Papa=require(_0xcf41('0x11'));var Redis=require(_0xcf41('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcf41('0x13'));var as=require(_0xcf41('0x14'));var hardwareService=require(_0xcf41('0x15'));var logger=require(_0xcf41('0x16'))(_0xcf41('0x17'));var utils=require(_0xcf41('0x18'));var config=require(_0xcf41('0x19'));var licenseUtil=require(_0xcf41('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f6a1b,_0x440f82){_0x440f82=_0x440f82||0xcc;return function(_0x3a44eb){if(_0x3a44eb){return _0x4f6a1b[_0xcf41('0x1b')](_0x440f82);}return _0x4f6a1b[_0xcf41('0x1c')](_0x440f82)[_0xcf41('0x1d')]();};}function respondWithResult(_0x2ad4f3,_0x49e09b){_0x49e09b=_0x49e09b||0xc8;return function(_0x292404){if(_0x292404){return _0x2ad4f3[_0xcf41('0x1c')](_0x49e09b)[_0xcf41('0x1e')](_0x292404);}};}function respondWithFilteredResult(_0x4dcf31,_0x493103){return function(_0x15c962){if(_0x15c962){var _0x5c760e=typeof _0x493103[_0xcf41('0x1f')]===_0xcf41('0x20')&&typeof _0x493103[_0xcf41('0x21')]==='undefined';var _0xf931ed=_0x15c962['count'];var _0xb17d5b=_0x5c760e?0x0:_0x493103['offset'];var _0x2a150c=_0x5c760e?_0x15c962[_0xcf41('0x22')]:_0x493103[_0xcf41('0x1f')]+_0x493103[_0xcf41('0x21')];var _0x23ae75;if(_0x2a150c>=_0xf931ed){_0x2a150c=_0xf931ed;_0x23ae75=0xc8;}else{_0x23ae75=0xce;}_0x4dcf31['status'](_0x23ae75);return _0x4dcf31[_0xcf41('0x23')](_0xcf41('0x24'),_0xb17d5b+'-'+_0x2a150c+'/'+_0xf931ed)[_0xcf41('0x1e')](_0x15c962);}return null;};}function patchUpdates(_0x423a47){return function(_0x307f2f){try{jsonpatch['apply'](_0x307f2f,_0x423a47,!![]);}catch(_0x367c95){return BPromise[_0xcf41('0x25')](_0x367c95);}return _0x307f2f[_0xcf41('0x26')]();};}function saveUpdates(_0x43fe44,_0x2c17c3){return function(_0x1a979a){if(_0x1a979a){return _0x1a979a[_0xcf41('0x27')](_0x43fe44)[_0xcf41('0x28')](function(_0x525cc4){return _0x525cc4;});}return null;};}function removeEntity(_0x40cff1,_0x1ef7c6){return function(_0x3b6244){if(_0x3b6244){return _0x3b6244[_0xcf41('0x29')]()[_0xcf41('0x28')](function(){var _0x1f5371=_0x3b6244['get']({'plain':!![]});var _0x3cb100=_0xcf41('0x2a');return db['UserProfileResource'][_0xcf41('0x29')]({'where':{'type':_0x3cb100,'resourceId':_0x1f5371['id']}})[_0xcf41('0x28')](function(){return _0x3b6244;});})[_0xcf41('0x28')](function(){_0x40cff1['status'](0xcc)[_0xcf41('0x1d')]();});}};}function handleEntityNotFound(_0x30d377,_0x314728){return function(_0x1bb6e7){if(!_0x1bb6e7){_0x30d377[_0xcf41('0x1b')](0x194);}return _0x1bb6e7;};}function handleError(_0x14e349,_0x2bd876){_0x2bd876=_0x2bd876||0x1f4;return function(_0x42ec37){logger['error'](_0x42ec37[_0xcf41('0x2b')]);if(_0x42ec37['name']){delete _0x42ec37['name'];}_0x14e349[_0xcf41('0x1c')](_0x2bd876)[_0xcf41('0x2c')](_0x42ec37);};}exports[_0xcf41('0x2d')]=function(_0x3b54cb,_0x1727b9){var _0x299e52={},_0x28e43d={},_0x57821c={'count':0x0,'rows':[]};var _0x1e206d=_[_0xcf41('0x2e')](db[_0xcf41('0x2f')][_0xcf41('0x30')],function(_0x4c2718){return{'name':_0x4c2718[_0xcf41('0x31')],'type':_0x4c2718[_0xcf41('0x32')][_0xcf41('0x33')]};});_0x28e43d['model']=_[_0xcf41('0x2e')](_0x1e206d,'name');_0x28e43d[_0xcf41('0x34')]=_[_0xcf41('0x35')](_0x3b54cb[_0xcf41('0x34')]);_0x28e43d[_0xcf41('0x36')]=_['intersection'](_0x28e43d[_0xcf41('0x37')],_0x28e43d[_0xcf41('0x34')]);_0x299e52['attributes']=_['intersection'](_0x28e43d[_0xcf41('0x37')],qs[_0xcf41('0x38')](_0x3b54cb[_0xcf41('0x34')][_0xcf41('0x38')]));_0x299e52[_0xcf41('0x39')]=_0x299e52['attributes'][_0xcf41('0x3a')]?_0x299e52[_0xcf41('0x39')]:_0x28e43d[_0xcf41('0x37')];if(!_0x3b54cb['query'][_0xcf41('0x3b')]('nolimit')){_0x299e52[_0xcf41('0x21')]=qs[_0xcf41('0x21')](_0x3b54cb[_0xcf41('0x34')]['limit']);_0x299e52[_0xcf41('0x1f')]=qs[_0xcf41('0x1f')](_0x3b54cb[_0xcf41('0x34')][_0xcf41('0x1f')]);}_0x299e52[_0xcf41('0x3c')]=qs[_0xcf41('0x3d')](_0x3b54cb['query'][_0xcf41('0x3d')]);_0x299e52[_0xcf41('0x3e')]=qs[_0xcf41('0x36')](_[_0xcf41('0x3f')](_0x3b54cb[_0xcf41('0x34')],_0x28e43d[_0xcf41('0x36')]),_0x1e206d);if(_0x3b54cb[_0xcf41('0x34')][_0xcf41('0x40')]){_0x299e52['where']=_[_0xcf41('0x41')](_0x299e52[_0xcf41('0x3e')],{'$or':_[_0xcf41('0x2e')](_0x1e206d,function(_0x57f8f1){if(_0x57f8f1[_0xcf41('0x32')]!==_0xcf41('0x42')){var _0x32d986={};_0x32d986[_0x57f8f1['name']]={'$like':'%'+_0x3b54cb[_0xcf41('0x34')][_0xcf41('0x40')]+'%'};return _0x32d986;}})});}_0x299e52=_[_0xcf41('0x41')]({},_0x299e52,_0x3b54cb['options']);var _0x151ab9={'where':_0x299e52[_0xcf41('0x3e')]};return db[_0xcf41('0x2f')][_0xcf41('0x22')](_0x151ab9)[_0xcf41('0x28')](function(_0xf730f2){_0x57821c[_0xcf41('0x22')]=_0xf730f2;if(_0x3b54cb['query'][_0xcf41('0x43')]){_0x299e52[_0xcf41('0x44')]=[{'all':!![]}];}return db['Template']['findAll'](_0x299e52);})[_0xcf41('0x28')](function(_0x2c2060){_0x57821c[_0xcf41('0x45')]=_0x2c2060;return _0x57821c;})['then'](respondWithFilteredResult(_0x1727b9,_0x299e52))[_0xcf41('0x46')](handleError(_0x1727b9,null));};exports[_0xcf41('0x47')]=function(_0x21d735,_0x5858f7){var _0x195991={'raw':!![],'where':{'id':_0x21d735[_0xcf41('0x48')]['id']}},_0x39da84={};_0x39da84[_0xcf41('0x37')]=_[_0xcf41('0x35')](db[_0xcf41('0x2f')][_0xcf41('0x30')]);_0x39da84[_0xcf41('0x34')]=_[_0xcf41('0x35')](_0x21d735[_0xcf41('0x34')]);_0x39da84[_0xcf41('0x36')]=_['intersection'](_0x39da84[_0xcf41('0x37')],_0x39da84[_0xcf41('0x34')]);_0x195991[_0xcf41('0x39')]=_[_0xcf41('0x49')](_0x39da84[_0xcf41('0x37')],qs[_0xcf41('0x38')](_0x21d735['query']['fields']));_0x195991[_0xcf41('0x39')]=_0x195991[_0xcf41('0x39')]['length']?_0x195991['attributes']:_0x39da84[_0xcf41('0x37')];if(_0x21d735[_0xcf41('0x34')][_0xcf41('0x43')]){_0x195991[_0xcf41('0x44')]=[{'all':!![]}];}_0x195991=_[_0xcf41('0x41')]({},_0x195991,_0x21d735['options']);return db['Template']['find'](_0x195991)[_0xcf41('0x28')](handleEntityNotFound(_0x5858f7,null))[_0xcf41('0x28')](respondWithResult(_0x5858f7,null))[_0xcf41('0x46')](handleError(_0x5858f7,null));};exports['create']=function(_0x22933b,_0x2afbfc){return db[_0xcf41('0x2f')][_0xcf41('0x4a')](_0x22933b[_0xcf41('0x4b')],{})['then'](function(_0x277d94){var _0x2cbf03=_0x22933b[_0xcf41('0x4c')]['get']({'plain':!![]});if(!_0x2cbf03)throw new Error(_0xcf41('0x4d'));if(_0x2cbf03[_0xcf41('0x4e')]==='user'){var _0x1b1c7f=_0x277d94[_0xcf41('0x4f')]({'plain':!![]});var _0x2f1941=_0xcf41('0x2a');return db[_0xcf41('0x50')]['find']({'where':{'name':_0x2f1941,'userProfileId':_0x2cbf03[_0xcf41('0x51')]},'raw':!![]})[_0xcf41('0x28')](function(_0x4c1814){if(_0x4c1814&&_0x4c1814['autoAssociation']===0x0){return db[_0xcf41('0x52')][_0xcf41('0x4a')]({'name':_0x1b1c7f[_0xcf41('0x53')],'resourceId':_0x1b1c7f['id'],'type':_0x4c1814[_0xcf41('0x53')],'sectionId':_0x4c1814['id']},{})[_0xcf41('0x28')](function(){return _0x277d94;});}else{return _0x277d94;}})[_0xcf41('0x46')](function(_0x1f6b40){logger[_0xcf41('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f6b40);throw _0x1f6b40;});}return _0x277d94;})[_0xcf41('0x28')](respondWithResult(_0x2afbfc,0xc9))[_0xcf41('0x46')](handleError(_0x2afbfc,null));};exports[_0xcf41('0x27')]=function(_0x3217c9,_0x56804d){if(_0x3217c9[_0xcf41('0x4b')]['id']){delete _0x3217c9[_0xcf41('0x4b')]['id'];}return db[_0xcf41('0x2f')][_0xcf41('0x55')]({'where':{'id':_0x3217c9[_0xcf41('0x48')]['id']}})[_0xcf41('0x28')](handleEntityNotFound(_0x56804d,null))[_0xcf41('0x28')](saveUpdates(_0x3217c9[_0xcf41('0x4b')],null))[_0xcf41('0x28')](respondWithResult(_0x56804d,null))['catch'](handleError(_0x56804d,null));};exports['destroy']=function(_0x438c99,_0x120f17){return db[_0xcf41('0x2f')][_0xcf41('0x55')]({'where':{'id':_0x438c99['params']['id']}})[_0xcf41('0x28')](handleEntityNotFound(_0x120f17,null))[_0xcf41('0x28')](removeEntity(_0x120f17,null))[_0xcf41('0x46')](handleError(_0x120f17,null));}; \ No newline at end of file +var _0xc94b=['Templates','stack','name','send','index','rawAttributes','type','key','query','filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','Template','includeAll','include','show','params','keys','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy'];(function(_0x3da1c5,_0x53f43f){var _0x20d262=function(_0x5b914f){while(--_0x5b914f){_0x3da1c5['push'](_0x3da1c5['shift']());}};_0x20d262(++_0x53f43f);}(_0xc94b,0x7f));var _0xbc94=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xc94b[_0x87b0ff];return _0x3bc0b2;};'use strict';var emlformat=require(_0xbc94('0x0'));var rimraf=require(_0xbc94('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbc94('0x2'));var rp=require(_0xbc94('0x3'));var moment=require(_0xbc94('0x4'));var BPromise=require(_0xbc94('0x5'));var Mustache=require(_0xbc94('0x6'));var util=require(_0xbc94('0x7'));var path=require(_0xbc94('0x8'));var sox=require(_0xbc94('0x9'));var csv=require(_0xbc94('0xa'));var ejs=require(_0xbc94('0xb'));var fs=require('fs');var fs_extra=require(_0xbc94('0xc'));var _=require(_0xbc94('0xd'));var squel=require(_0xbc94('0xe'));var crypto=require(_0xbc94('0xf'));var jsforce=require(_0xbc94('0x10'));var deskjs=require(_0xbc94('0x11'));var toCsv=require(_0xbc94('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbc94('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbc94('0x13'));var hardwareService=require(_0xbc94('0x14'));var logger=require(_0xbc94('0x15'))(_0xbc94('0x16'));var utils=require(_0xbc94('0x17'));var config=require(_0xbc94('0x18'));var licenseUtil=require(_0xbc94('0x19'));var db=require(_0xbc94('0x1a'))['db'];function respondWithStatusCode(_0x44d0a1,_0x365301){_0x365301=_0x365301||0xcc;return function(_0x1c581d){if(_0x1c581d){return _0x44d0a1[_0xbc94('0x1b')](_0x365301);}return _0x44d0a1[_0xbc94('0x1c')](_0x365301)[_0xbc94('0x1d')]();};}function respondWithResult(_0x536800,_0x2299a9){_0x2299a9=_0x2299a9||0xc8;return function(_0x34b7b7){if(_0x34b7b7){return _0x536800['status'](_0x2299a9)['json'](_0x34b7b7);}};}function respondWithFilteredResult(_0x11be22,_0x15e2a8){return function(_0x5a3aa5){if(_0x5a3aa5){var _0x368a13=typeof _0x15e2a8[_0xbc94('0x1e')]==='undefined'&&typeof _0x15e2a8[_0xbc94('0x1f')]===_0xbc94('0x20');var _0x176318=_0x5a3aa5[_0xbc94('0x21')];var _0x4b2dad=_0x368a13?0x0:_0x15e2a8[_0xbc94('0x1e')];var _0x1b9b12=_0x368a13?_0x5a3aa5[_0xbc94('0x21')]:_0x15e2a8[_0xbc94('0x1e')]+_0x15e2a8[_0xbc94('0x1f')];var _0x51abd4;if(_0x1b9b12>=_0x176318){_0x1b9b12=_0x176318;_0x51abd4=0xc8;}else{_0x51abd4=0xce;}_0x11be22[_0xbc94('0x1c')](_0x51abd4);return _0x11be22[_0xbc94('0x22')](_0xbc94('0x23'),_0x4b2dad+'-'+_0x1b9b12+'/'+_0x176318)[_0xbc94('0x24')](_0x5a3aa5);}return null;};}function patchUpdates(_0x1a0e68){return function(_0x191a23){try{jsonpatch[_0xbc94('0x25')](_0x191a23,_0x1a0e68,!![]);}catch(_0x318b45){return BPromise[_0xbc94('0x26')](_0x318b45);}return _0x191a23[_0xbc94('0x27')]();};}function saveUpdates(_0x4dbe18,_0x2a88bb){return function(_0xbe9cb2){if(_0xbe9cb2){return _0xbe9cb2[_0xbc94('0x28')](_0x4dbe18)[_0xbc94('0x29')](function(_0x2f137b){return _0x2f137b;});}return null;};}function removeEntity(_0x3b2883,_0x2232b6){return function(_0x4b317e){if(_0x4b317e){return _0x4b317e[_0xbc94('0x2a')]()[_0xbc94('0x29')](function(){var _0x498b38=_0x4b317e['get']({'plain':!![]});var _0x2190bc=_0xbc94('0x2b');return db['UserProfileResource'][_0xbc94('0x2a')]({'where':{'type':_0x2190bc,'resourceId':_0x498b38['id']}})[_0xbc94('0x29')](function(){return _0x4b317e;});})['then'](function(){_0x3b2883[_0xbc94('0x1c')](0xcc)[_0xbc94('0x1d')]();});}};}function handleEntityNotFound(_0x33a850,_0x164620){return function(_0x548e5e){if(!_0x548e5e){_0x33a850[_0xbc94('0x1b')](0x194);}return _0x548e5e;};}function handleError(_0x56b34a,_0x397795){_0x397795=_0x397795||0x1f4;return function(_0x59d0e0){logger['error'](_0x59d0e0[_0xbc94('0x2c')]);if(_0x59d0e0[_0xbc94('0x2d')]){delete _0x59d0e0['name'];}_0x56b34a[_0xbc94('0x1c')](_0x397795)[_0xbc94('0x2e')](_0x59d0e0);};}exports[_0xbc94('0x2f')]=function(_0x22363e,_0x2e2bfe){var _0x20a64d={},_0x2113b9={},_0x61b969={'count':0x0,'rows':[]};var _0x475192=_['map'](db['Template'][_0xbc94('0x30')],function(_0x1b6e10){return{'name':_0x1b6e10['fieldName'],'type':_0x1b6e10[_0xbc94('0x31')][_0xbc94('0x32')]};});_0x2113b9['model']=_['map'](_0x475192,_0xbc94('0x2d'));_0x2113b9[_0xbc94('0x33')]=_['keys'](_0x22363e['query']);_0x2113b9[_0xbc94('0x34')]=_[_0xbc94('0x35')](_0x2113b9['model'],_0x2113b9[_0xbc94('0x33')]);_0x20a64d['attributes']=_['intersection'](_0x2113b9['model'],qs['fields'](_0x22363e['query'][_0xbc94('0x36')]));_0x20a64d['attributes']=_0x20a64d[_0xbc94('0x37')]['length']?_0x20a64d[_0xbc94('0x37')]:_0x2113b9[_0xbc94('0x38')];if(!_0x22363e['query'][_0xbc94('0x39')](_0xbc94('0x3a'))){_0x20a64d[_0xbc94('0x1f')]=qs[_0xbc94('0x1f')](_0x22363e[_0xbc94('0x33')][_0xbc94('0x1f')]);_0x20a64d[_0xbc94('0x1e')]=qs[_0xbc94('0x1e')](_0x22363e[_0xbc94('0x33')][_0xbc94('0x1e')]);}_0x20a64d[_0xbc94('0x3b')]=qs[_0xbc94('0x3c')](_0x22363e[_0xbc94('0x33')][_0xbc94('0x3c')]);_0x20a64d[_0xbc94('0x3d')]=qs[_0xbc94('0x34')](_['pick'](_0x22363e[_0xbc94('0x33')],_0x2113b9[_0xbc94('0x34')]),_0x475192);if(_0x22363e['query'][_0xbc94('0x3e')]){_0x20a64d[_0xbc94('0x3d')]=_[_0xbc94('0x3f')](_0x20a64d[_0xbc94('0x3d')],{'$or':_[_0xbc94('0x40')](_0x475192,function(_0x234095){if(_0x234095['type']!==_0xbc94('0x41')){var _0x1ab986={};_0x1ab986[_0x234095[_0xbc94('0x2d')]]={'$like':'%'+_0x22363e[_0xbc94('0x33')][_0xbc94('0x3e')]+'%'};return _0x1ab986;}})});}_0x20a64d=_[_0xbc94('0x3f')]({},_0x20a64d,_0x22363e['options']);var _0x2d5932={'where':_0x20a64d[_0xbc94('0x3d')]};return db[_0xbc94('0x42')][_0xbc94('0x21')](_0x2d5932)[_0xbc94('0x29')](function(_0x555822){_0x61b969[_0xbc94('0x21')]=_0x555822;if(_0x22363e[_0xbc94('0x33')][_0xbc94('0x43')]){_0x20a64d[_0xbc94('0x44')]=[{'all':!![]}];}return db[_0xbc94('0x42')]['findAll'](_0x20a64d);})['then'](function(_0x548f94){_0x61b969['rows']=_0x548f94;return _0x61b969;})[_0xbc94('0x29')](respondWithFilteredResult(_0x2e2bfe,_0x20a64d))['catch'](handleError(_0x2e2bfe,null));};exports[_0xbc94('0x45')]=function(_0x16db52,_0xb56fa6){var _0x328bf2={'raw':!![],'where':{'id':_0x16db52[_0xbc94('0x46')]['id']}},_0x197080={};_0x197080[_0xbc94('0x38')]=_[_0xbc94('0x47')](db['Template']['rawAttributes']);_0x197080[_0xbc94('0x33')]=_[_0xbc94('0x47')](_0x16db52[_0xbc94('0x33')]);_0x197080[_0xbc94('0x34')]=_[_0xbc94('0x35')](_0x197080[_0xbc94('0x38')],_0x197080[_0xbc94('0x33')]);_0x328bf2[_0xbc94('0x37')]=_[_0xbc94('0x35')](_0x197080[_0xbc94('0x38')],qs[_0xbc94('0x36')](_0x16db52['query'][_0xbc94('0x36')]));_0x328bf2[_0xbc94('0x37')]=_0x328bf2[_0xbc94('0x37')]['length']?_0x328bf2[_0xbc94('0x37')]:_0x197080[_0xbc94('0x38')];if(_0x16db52[_0xbc94('0x33')][_0xbc94('0x43')]){_0x328bf2[_0xbc94('0x44')]=[{'all':!![]}];}_0x328bf2=_[_0xbc94('0x3f')]({},_0x328bf2,_0x16db52[_0xbc94('0x48')]);return db[_0xbc94('0x42')][_0xbc94('0x49')](_0x328bf2)[_0xbc94('0x29')](handleEntityNotFound(_0xb56fa6,null))['then'](respondWithResult(_0xb56fa6,null))[_0xbc94('0x4a')](handleError(_0xb56fa6,null));};exports[_0xbc94('0x4b')]=function(_0x41f296,_0x2a80e4){return db[_0xbc94('0x42')]['create'](_0x41f296['body'],{})[_0xbc94('0x29')](function(_0x1342ce){var _0xe2f9d5=_0x41f296[_0xbc94('0x4c')]['get']({'plain':!![]});if(!_0xe2f9d5)throw new Error(_0xbc94('0x4d'));if(_0xe2f9d5[_0xbc94('0x4e')]===_0xbc94('0x4c')){var _0x565857=_0x1342ce['get']({'plain':!![]});var _0x538203=_0xbc94('0x2b');return db[_0xbc94('0x4f')][_0xbc94('0x49')]({'where':{'name':_0x538203,'userProfileId':_0xe2f9d5[_0xbc94('0x50')]},'raw':!![]})[_0xbc94('0x29')](function(_0x33c9c7){if(_0x33c9c7&&_0x33c9c7[_0xbc94('0x51')]===0x0){return db[_0xbc94('0x52')][_0xbc94('0x4b')]({'name':_0x565857[_0xbc94('0x2d')],'resourceId':_0x565857['id'],'type':_0x33c9c7[_0xbc94('0x2d')],'sectionId':_0x33c9c7['id']},{})[_0xbc94('0x29')](function(){return _0x1342ce;});}else{return _0x1342ce;}})[_0xbc94('0x4a')](function(_0x3b2484){logger['error'](_0xbc94('0x53'),_0x3b2484);throw _0x3b2484;});}return _0x1342ce;})[_0xbc94('0x29')](respondWithResult(_0x2a80e4,0xc9))[_0xbc94('0x4a')](handleError(_0x2a80e4,null));};exports['update']=function(_0x59a580,_0x4dd011){if(_0x59a580[_0xbc94('0x54')]['id']){delete _0x59a580[_0xbc94('0x54')]['id'];}return db['Template'][_0xbc94('0x49')]({'where':{'id':_0x59a580[_0xbc94('0x46')]['id']}})['then'](handleEntityNotFound(_0x4dd011,null))[_0xbc94('0x29')](saveUpdates(_0x59a580[_0xbc94('0x54')],null))[_0xbc94('0x29')](respondWithResult(_0x4dd011,null))[_0xbc94('0x4a')](handleError(_0x4dd011,null));};exports[_0xbc94('0x2a')]=function(_0x3474cd,_0x15d47b){return db['Template'][_0xbc94('0x49')]({'where':{'id':_0x3474cd[_0xbc94('0x46')]['id']}})['then'](handleEntityNotFound(_0x15d47b,null))[_0xbc94('0x29')](removeEntity(_0x15d47b,null))['catch'](handleError(_0x15d47b,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 25eba3d..00d2b8f 100644 --- a/server/api/template/template.model.js +++ b/server/api/template/template.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd645=['rimraf','../../config/environment','./template.attributes','exports','tools_templates','../../config/logger','bluebird','request-promise','path'];(function(_0x20cae2,_0x378d30){var _0x32229b=function(_0x2eac7a){while(--_0x2eac7a){_0x20cae2['push'](_0x20cae2['shift']());}};_0x32229b(++_0x378d30);}(_0xd645,0x68));var _0x5d64=function(_0x314da8,_0x5aac22){_0x314da8=_0x314da8-0x0;var _0x4fd124=_0xd645[_0x314da8];return _0x4fd124;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5d64('0x0'))('api');var moment=require('moment');var BPromise=require(_0x5d64('0x1'));var rp=require(_0x5d64('0x2'));var fs=require('fs');var path=require(_0x5d64('0x3'));var rimraf=require(_0x5d64('0x4'));var config=require(_0x5d64('0x5'));var attributes=require(_0x5d64('0x6'));module[_0x5d64('0x7')]=function(_0x53f065,_0x32f4d4){return _0x53f065['define']('Template',attributes,{'tableName':_0x5d64('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9e3=['Template','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define'];(function(_0x37b6d2,_0x4672b5){var _0x323aa6=function(_0x420008){while(--_0x420008){_0x37b6d2['push'](_0x37b6d2['shift']());}};_0x323aa6(++_0x4672b5);}(_0xe9e3,0x105));var _0x3e9e=function(_0x38d657,_0x3522a1){_0x38d657=_0x38d657-0x0;var _0x1de063=_0xe9e3[_0x38d657];return _0x1de063;};'use strict';var _=require('lodash');var util=require(_0x3e9e('0x0'));var logger=require(_0x3e9e('0x1'))(_0x3e9e('0x2'));var moment=require(_0x3e9e('0x3'));var BPromise=require(_0x3e9e('0x4'));var rp=require(_0x3e9e('0x5'));var fs=require('fs');var path=require(_0x3e9e('0x6'));var rimraf=require(_0x3e9e('0x7'));var config=require(_0x3e9e('0x8'));var attributes=require(_0x3e9e('0x9'));module[_0x3e9e('0xa')]=function(_0x35f010,_0x210811){return _0x35f010[_0x3e9e('0xb')](_0x3e9e('0xc'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index ee33e7f..b0dd647 100644 --- a/server/api/template/template.rpc.js +++ b/server/api/template/template.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x78f0=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','error','code','message','result','GetTemplate','Template','findAll','options','raw','attributes','limit','include','map','model','debug','stringify','catch','lodash'];(function(_0x3ac8b2,_0x1cee01){var _0x5772b1=function(_0x4313cb){while(--_0x4313cb){_0x3ac8b2['push'](_0x3ac8b2['shift']());}};_0x5772b1(++_0x1cee01);}(_0x78f0,0x15d));var _0x078f=function(_0xca050b,_0x3e6f0a){_0xca050b=_0xca050b-0x0;var _0x1871a2=_0x78f0[_0xca050b];return _0x1871a2;};'use strict';var _=require(_0x078f('0x0'));var util=require(_0x078f('0x1'));var moment=require(_0x078f('0x2'));var BPromise=require(_0x078f('0x3'));var rs=require(_0x078f('0x4'));var fs=require('fs');var Redis=require(_0x078f('0x5'));var db=require(_0x078f('0x6'))['db'];var utils=require(_0x078f('0x7'));var logger=require('../../config/logger')(_0x078f('0x8'));var config=require(_0x078f('0x9'));var jayson=require(_0x078f('0xa'));var client=jayson[_0x078f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x728cfe,_0x205510,_0x4a7db3){return new BPromise(function(_0x2ef013,_0x1901e3){return client[_0x078f('0xc')](_0x728cfe,_0x4a7db3)[_0x078f('0xd')](function(_0x7e87f){logger[_0x078f('0xe')](_0x078f('0xf'),_0x205510,_0x078f('0x10'));logger['debug'](_0x078f('0x11'),_0x205510,_0x078f('0x10'),JSON['stringify'](_0x7e87f));if(_0x7e87f[_0x078f('0x12')]){if(_0x7e87f[_0x078f('0x12')][_0x078f('0x13')]===0x1f4){logger[_0x078f('0x12')]('Template,\x20%s,\x20%s',_0x205510,_0x7e87f['error'][_0x078f('0x14')]);return _0x1901e3(_0x7e87f[_0x078f('0x12')][_0x078f('0x14')]);}logger[_0x078f('0x12')]('Template,\x20%s,\x20%s',_0x205510,_0x7e87f[_0x078f('0x12')][_0x078f('0x14')]);return _0x2ef013(_0x7e87f['error'][_0x078f('0x14')]);}else{logger[_0x078f('0xe')](_0x078f('0xf'),_0x205510,_0x078f('0x10'));_0x2ef013(_0x7e87f[_0x078f('0x15')][_0x078f('0x14')]);}})['catch'](function(_0x56bad2){logger[_0x078f('0x12')](_0x078f('0xf'),_0x205510,_0x56bad2);_0x1901e3(_0x56bad2);});});}exports[_0x078f('0x16')]=function(_0x19a182){var _0x201560=this;return new Promise(function(_0x25bb2d,_0xb8af8c){return db[_0x078f('0x17')][_0x078f('0x18')]({'raw':_0x19a182[_0x078f('0x19')]?_0x19a182[_0x078f('0x19')][_0x078f('0x1a')]===undefined?!![]:![]:!![],'where':_0x19a182['options']?_0x19a182[_0x078f('0x19')]['where']||null:null,'attributes':_0x19a182['options']?_0x19a182[_0x078f('0x19')][_0x078f('0x1b')]||null:null,'limit':_0x19a182[_0x078f('0x19')]?_0x19a182[_0x078f('0x19')][_0x078f('0x1c')]||null:null,'include':_0x19a182[_0x078f('0x19')]?_0x19a182[_0x078f('0x19')][_0x078f('0x1d')]?_[_0x078f('0x1e')](_0x19a182['options'][_0x078f('0x1d')],function(_0x14ad5c){return{'model':db[_0x14ad5c[_0x078f('0x1f')]],'as':_0x14ad5c['as'],'attributes':_0x14ad5c['attributes'],'include':_0x14ad5c['include']?_[_0x078f('0x1e')](_0x14ad5c[_0x078f('0x1d')],function(_0x3d9d08){return{'model':db[_0x3d9d08[_0x078f('0x1f')]],'as':_0x3d9d08['as'],'attributes':_0x3d9d08[_0x078f('0x1b')],'include':_0x3d9d08[_0x078f('0x1d')]?_[_0x078f('0x1e')](_0x3d9d08['include'],function(_0x1f6596){return{'model':db[_0x1f6596[_0x078f('0x1f')]],'as':_0x1f6596['as'],'attributes':_0x1f6596['attributes']};}):[]};}):[]};}):[]:[]})[_0x078f('0xd')](function(_0x35304e){logger[_0x078f('0xe')](_0x078f('0x16'),_0x19a182);logger[_0x078f('0x20')](_0x078f('0x16'),_0x19a182,JSON[_0x078f('0x21')](_0x35304e));_0x25bb2d(_0x35304e);})[_0x078f('0x22')](function(_0x1f0ad6){logger[_0x078f('0x12')](_0x078f('0x16'),_0x1f0ad6[_0x078f('0x14')],_0x19a182);_0xb8af8c(_0x201560[_0x078f('0x12')](0x1f4,_0x1f0ad6[_0x078f('0x14')]));});});}; \ No newline at end of file +var _0x76e1=['error','code','message','result','catch','findAll','options','raw','limit','include','model','attributes','map','info','GetTemplate','debug','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','Template,\x20%s,\x20%s','Template,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x26b5cb,_0x15f879){var _0x3b2277=function(_0x12fe27){while(--_0x12fe27){_0x26b5cb['push'](_0x26b5cb['shift']());}};_0x3b2277(++_0x15f879);}(_0x76e1,0xb1));var _0x176e=function(_0x5828dd,_0xd096b){_0x5828dd=_0x5828dd-0x0;var _0x539cf6=_0x76e1[_0x5828dd];return _0x539cf6;};'use strict';var _=require('lodash');var util=require(_0x176e('0x0'));var moment=require(_0x176e('0x1'));var BPromise=require(_0x176e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x176e('0x3'));var db=require(_0x176e('0x4'))['db'];var utils=require(_0x176e('0x5'));var logger=require(_0x176e('0x6'))(_0x176e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x176e('0x8')][_0x176e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b20ed,_0x2e833f,_0x19d6ce){return new BPromise(function(_0x40cb2d,_0x38dea0){return client[_0x176e('0xa')](_0x1b20ed,_0x19d6ce)[_0x176e('0xb')](function(_0x50be43){logger['info'](_0x176e('0xc'),_0x2e833f,'request\x20sent');logger['debug'](_0x176e('0xd'),_0x2e833f,_0x176e('0xe'),JSON['stringify'](_0x50be43));if(_0x50be43['error']){if(_0x50be43[_0x176e('0xf')][_0x176e('0x10')]===0x1f4){logger[_0x176e('0xf')]('Template,\x20%s,\x20%s',_0x2e833f,_0x50be43[_0x176e('0xf')][_0x176e('0x11')]);return _0x38dea0(_0x50be43['error'][_0x176e('0x11')]);}logger[_0x176e('0xf')](_0x176e('0xc'),_0x2e833f,_0x50be43[_0x176e('0xf')]['message']);return _0x40cb2d(_0x50be43[_0x176e('0xf')][_0x176e('0x11')]);}else{logger['info'](_0x176e('0xc'),_0x2e833f,_0x176e('0xe'));_0x40cb2d(_0x50be43[_0x176e('0x12')][_0x176e('0x11')]);}})[_0x176e('0x13')](function(_0xf00583){logger[_0x176e('0xf')](_0x176e('0xc'),_0x2e833f,_0xf00583);_0x38dea0(_0xf00583);});});}exports['GetTemplate']=function(_0x2a1202){var _0x23332a=this;return new Promise(function(_0xc2cad3,_0x1b2dfe){return db['Template'][_0x176e('0x14')]({'raw':_0x2a1202[_0x176e('0x15')]?_0x2a1202['options'][_0x176e('0x16')]===undefined?!![]:![]:!![],'where':_0x2a1202[_0x176e('0x15')]?_0x2a1202[_0x176e('0x15')]['where']||null:null,'attributes':_0x2a1202[_0x176e('0x15')]?_0x2a1202['options']['attributes']||null:null,'limit':_0x2a1202[_0x176e('0x15')]?_0x2a1202[_0x176e('0x15')][_0x176e('0x17')]||null:null,'include':_0x2a1202[_0x176e('0x15')]?_0x2a1202[_0x176e('0x15')]['include']?_['map'](_0x2a1202[_0x176e('0x15')][_0x176e('0x18')],function(_0x1d9d61){return{'model':db[_0x1d9d61[_0x176e('0x19')]],'as':_0x1d9d61['as'],'attributes':_0x1d9d61[_0x176e('0x1a')],'include':_0x1d9d61[_0x176e('0x18')]?_[_0x176e('0x1b')](_0x1d9d61[_0x176e('0x18')],function(_0x29e52e){return{'model':db[_0x29e52e[_0x176e('0x19')]],'as':_0x29e52e['as'],'attributes':_0x29e52e[_0x176e('0x1a')],'include':_0x29e52e['include']?_[_0x176e('0x1b')](_0x29e52e[_0x176e('0x18')],function(_0xc62d37){return{'model':db[_0xc62d37[_0x176e('0x19')]],'as':_0xc62d37['as'],'attributes':_0xc62d37[_0x176e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x176e('0xb')](function(_0x2dec4d){logger[_0x176e('0x1c')](_0x176e('0x1d'),_0x2a1202);logger[_0x176e('0x1e')](_0x176e('0x1d'),_0x2a1202,JSON[_0x176e('0x1f')](_0x2dec4d));_0xc2cad3(_0x2dec4d);})[_0x176e('0x13')](function(_0x14d217){logger[_0x176e('0xf')](_0x176e('0x1d'),_0x14d217[_0x176e('0x11')],_0x2a1202);_0x1b2dfe(_0x23332a[_0x176e('0xf')](0x1f4,_0x14d217[_0x176e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 6d2cefe..6942543 100644 --- a/server/api/trigger/index.js +++ b/server/api/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b65=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','getAllConditions','getAnyConditions','/:id/actions','getActions','post','/:id/all_conditions','addAllCondition','addAnyCondition','addAction','put','update','delete','exports','multer','util','path'];(function(_0x25d774,_0xde2429){var _0x14c347=function(_0x5a6507){while(--_0x5a6507){_0x25d774['push'](_0x25d774['shift']());}};_0x14c347(++_0xde2429);}(_0x2b65,0x131));var _0x52b6=function(_0x532155,_0x110247){_0x532155=_0x532155-0x0;var _0x3f2619=_0x2b65[_0x532155];return _0x3f2619;};'use strict';var multer=require(_0x52b6('0x0'));var util=require(_0x52b6('0x1'));var path=require(_0x52b6('0x2'));var timeout=require(_0x52b6('0x3'));var express=require(_0x52b6('0x4'));var router=express[_0x52b6('0x5')]();var fs_extra=require(_0x52b6('0x6'));var auth=require(_0x52b6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x52b6('0x8'));var controller=require(_0x52b6('0x9'));router[_0x52b6('0xa')]('/',auth[_0x52b6('0xb')](),controller[_0x52b6('0xc')]);router[_0x52b6('0xa')](_0x52b6('0xd'),auth[_0x52b6('0xb')](),controller[_0x52b6('0xe')]);router[_0x52b6('0xa')]('/:id/all_conditions',auth[_0x52b6('0xb')](),controller[_0x52b6('0xf')]);router[_0x52b6('0xa')]('/:id/any_conditions',auth[_0x52b6('0xb')](),controller[_0x52b6('0x10')]);router[_0x52b6('0xa')](_0x52b6('0x11'),auth['isAuthenticated'](),controller[_0x52b6('0x12')]);router[_0x52b6('0x13')]('/',auth[_0x52b6('0xb')](),controller['create']);router[_0x52b6('0x13')](_0x52b6('0x14'),auth['isAuthenticated'](),controller[_0x52b6('0x15')]);router['post']('/:id/any_conditions',auth[_0x52b6('0xb')](),controller[_0x52b6('0x16')]);router[_0x52b6('0x13')](_0x52b6('0x11'),auth[_0x52b6('0xb')](),controller[_0x52b6('0x17')]);router[_0x52b6('0x18')](_0x52b6('0xd'),auth[_0x52b6('0xb')](),controller[_0x52b6('0x19')]);router[_0x52b6('0x1a')](_0x52b6('0xd'),auth[_0x52b6('0xb')](),controller['destroy']);module[_0x52b6('0x1b')]=router; \ No newline at end of file +var _0x6e5e=['../../config/environment','isAuthenticated','get','/:id','show','/:id/all_conditions','getActions','post','create','addAllCondition','addAnyCondition','/:id/actions','put','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x12464a,_0x57271a){var _0x51cb46=function(_0x45ff07){while(--_0x45ff07){_0x12464a['push'](_0x12464a['shift']());}};_0x51cb46(++_0x57271a);}(_0x6e5e,0x1de));var _0xe6e5=function(_0x31a9bd,_0x3c872e){_0x31a9bd=_0x31a9bd-0x0;var _0x3281db=_0x6e5e[_0x31a9bd];return _0x3281db;};'use strict';var multer=require(_0xe6e5('0x0'));var util=require(_0xe6e5('0x1'));var path=require('path');var timeout=require(_0xe6e5('0x2'));var express=require('express');var router=express[_0xe6e5('0x3')]();var fs_extra=require(_0xe6e5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe6e5('0x5'));var config=require(_0xe6e5('0x6'));var controller=require('./trigger.controller');router['get']('/',auth[_0xe6e5('0x7')](),controller['index']);router[_0xe6e5('0x8')](_0xe6e5('0x9'),auth[_0xe6e5('0x7')](),controller[_0xe6e5('0xa')]);router[_0xe6e5('0x8')](_0xe6e5('0xb'),auth[_0xe6e5('0x7')](),controller['getAllConditions']);router[_0xe6e5('0x8')]('/:id/any_conditions',auth[_0xe6e5('0x7')](),controller['getAnyConditions']);router[_0xe6e5('0x8')]('/:id/actions',auth[_0xe6e5('0x7')](),controller[_0xe6e5('0xc')]);router[_0xe6e5('0xd')]('/',auth['isAuthenticated'](),controller[_0xe6e5('0xe')]);router[_0xe6e5('0xd')](_0xe6e5('0xb'),auth[_0xe6e5('0x7')](),controller[_0xe6e5('0xf')]);router[_0xe6e5('0xd')]('/:id/any_conditions',auth[_0xe6e5('0x7')](),controller[_0xe6e5('0x10')]);router[_0xe6e5('0xd')](_0xe6e5('0x11'),auth[_0xe6e5('0x7')](),controller['addAction']);router[_0xe6e5('0x12')]('/:id',auth[_0xe6e5('0x7')](),controller['update']);router[_0xe6e5('0x13')](_0xe6e5('0x9'),auth[_0xe6e5('0x7')](),controller[_0xe6e5('0x14')]);module[_0xe6e5('0x15')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 14e09bf..96af17f 100644 --- a/server/api/trigger/trigger.attributes.js +++ b/server/api/trigger/trigger.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8571=['STRING','sequelize'];(function(_0x5d07ff,_0x1f976f){var _0x5226ad=function(_0x1653a4){while(--_0x1653a4){_0x5d07ff['push'](_0x5d07ff['shift']());}};_0x5226ad(++_0x1f976f);}(_0x8571,0x1e9));var _0x1857=function(_0x5cbaae,_0x1cd3c8){_0x5cbaae=_0x5cbaae-0x0;var _0x316831=_0x8571[_0x5cbaae];return _0x316831;};'use strict';var Sequelize=require(_0x1857('0x0'));module['exports']={'name':{'type':Sequelize[_0x1857('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1857('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xd843=['STRING','BOOLEAN','sequelize','exports'];(function(_0x56ddb3,_0x465ba8){var _0xd6a1bd=function(_0x1c2f57){while(--_0x1c2f57){_0x56ddb3['push'](_0x56ddb3['shift']());}};_0xd6a1bd(++_0x465ba8);}(_0xd843,0x11e));var _0x3d84=function(_0x614ef4,_0x28a060){_0x614ef4=_0x614ef4-0x0;var _0x35e8e2=_0xd843[_0x614ef4];return _0x35e8e2;};'use strict';var Sequelize=require(_0x3d84('0x0'));module[_0x3d84('0x1')]={'name':{'type':Sequelize[_0x3d84('0x2')]},'channel':{'type':Sequelize[_0x3d84('0x2')]},'description':{'type':Sequelize[_0x3d84('0x2')]},'status':{'type':Sequelize[_0x3d84('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 0e79a47..c28d131 100644 --- a/server/api/trigger/trigger.controller.js +++ b/server/api/trigger/trigger.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7816=['TriggerAllId','Condition','findOne','nolimit','getAllConditions','getAnyConditions','hasOwnProperty','addAction','TriggerId','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','stack','name','send','index','map','Trigger','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x7816,0x131));var _0x6781=function(_0x535a5b,_0x52fe21){_0x535a5b=_0x535a5b-0x0;var _0x1b0f2a=_0x7816[_0x535a5b];return _0x1b0f2a;};'use strict';var emlformat=require(_0x6781('0x0'));var rimraf=require(_0x6781('0x1'));var zipdir=require(_0x6781('0x2'));var jsonpatch=require(_0x6781('0x3'));var rp=require(_0x6781('0x4'));var moment=require('moment');var BPromise=require(_0x6781('0x5'));var Mustache=require('mustache');var util=require(_0x6781('0x6'));var path=require(_0x6781('0x7'));var sox=require(_0x6781('0x8'));var csv=require(_0x6781('0x9'));var ejs=require(_0x6781('0xa'));var fs=require('fs');var fs_extra=require(_0x6781('0xb'));var _=require(_0x6781('0xc'));var squel=require(_0x6781('0xd'));var crypto=require('crypto');var jsforce=require(_0x6781('0xe'));var deskjs=require(_0x6781('0xf'));var toCsv=require(_0x6781('0x9'));var querystring=require(_0x6781('0x10'));var Papa=require(_0x6781('0x11'));var Redis=require('ioredis');var authService=require(_0x6781('0x12'));var qs=require(_0x6781('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6781('0x14'));var logger=require(_0x6781('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6781('0x16'));var licenseUtil=require(_0x6781('0x17'));var db=require(_0x6781('0x18'))['db'];function respondWithStatusCode(_0x2abb24,_0x3f5567){_0x3f5567=_0x3f5567||0xcc;return function(_0x2d15be){if(_0x2d15be){return _0x2abb24[_0x6781('0x19')](_0x3f5567);}return _0x2abb24[_0x6781('0x1a')](_0x3f5567)[_0x6781('0x1b')]();};}function respondWithResult(_0x3a0095,_0x5deac5){_0x5deac5=_0x5deac5||0xc8;return function(_0x28ea8d){if(_0x28ea8d){return _0x3a0095[_0x6781('0x1a')](_0x5deac5)[_0x6781('0x1c')](_0x28ea8d);}};}function respondWithFilteredResult(_0x2fd34c,_0x15d489){return function(_0x1a06ab){if(_0x1a06ab){var _0x2c1c4d=typeof _0x15d489[_0x6781('0x1d')]===_0x6781('0x1e')&&typeof _0x15d489[_0x6781('0x1f')]==='undefined';var _0x13a60e=_0x1a06ab[_0x6781('0x20')];var _0x2ba703=_0x2c1c4d?0x0:_0x15d489[_0x6781('0x1d')];var _0x1e9360=_0x2c1c4d?_0x1a06ab['count']:_0x15d489[_0x6781('0x1d')]+_0x15d489[_0x6781('0x1f')];var _0x251c98;if(_0x1e9360>=_0x13a60e){_0x1e9360=_0x13a60e;_0x251c98=0xc8;}else{_0x251c98=0xce;}_0x2fd34c[_0x6781('0x1a')](_0x251c98);return _0x2fd34c[_0x6781('0x21')](_0x6781('0x22'),_0x2ba703+'-'+_0x1e9360+'/'+_0x13a60e)['json'](_0x1a06ab);}return null;};}function patchUpdates(_0x1811c9){return function(_0x315596){try{jsonpatch[_0x6781('0x23')](_0x315596,_0x1811c9,!![]);}catch(_0x6f4bdd){return BPromise[_0x6781('0x24')](_0x6f4bdd);}return _0x315596[_0x6781('0x25')]();};}function saveUpdates(_0x3b963c,_0x41c7ec){return function(_0x1fe9eb){if(_0x1fe9eb){return _0x1fe9eb[_0x6781('0x26')](_0x3b963c)[_0x6781('0x27')](function(_0x247665){return _0x247665;});}return null;};}function removeEntity(_0x149874,_0x2515ed){return function(_0x551fbd){if(_0x551fbd){return _0x551fbd[_0x6781('0x28')]()[_0x6781('0x27')](function(){var _0x2c1e34=_0x551fbd[_0x6781('0x29')]({'plain':!![]});var _0x53ebe0=_0x6781('0x2a');return db[_0x6781('0x2b')][_0x6781('0x28')]({'where':{'type':_0x53ebe0,'resourceId':_0x2c1e34['id']}})[_0x6781('0x27')](function(){return _0x551fbd;});})['then'](function(){_0x149874[_0x6781('0x1a')](0xcc)[_0x6781('0x1b')]();});}};}function handleEntityNotFound(_0x30148a,_0x3767f3){return function(_0x5dac29){if(!_0x5dac29){_0x30148a[_0x6781('0x19')](0x194);}return _0x5dac29;};}function handleError(_0x5d3bc3,_0x556ce0){_0x556ce0=_0x556ce0||0x1f4;return function(_0x3e4d57){logger['error'](_0x3e4d57[_0x6781('0x2c')]);if(_0x3e4d57[_0x6781('0x2d')]){delete _0x3e4d57['name'];}_0x5d3bc3[_0x6781('0x1a')](_0x556ce0)[_0x6781('0x2e')](_0x3e4d57);};}exports[_0x6781('0x2f')]=function(_0x183e9f,_0x3eec50){var _0x2f1997={},_0x41f26d={},_0x2f280e={'count':0x0,'rows':[]};var _0x2377a2=_[_0x6781('0x30')](db[_0x6781('0x31')][_0x6781('0x32')],function(_0x2b6b19){return{'name':_0x2b6b19[_0x6781('0x33')],'type':_0x2b6b19['type'][_0x6781('0x34')]};});_0x41f26d[_0x6781('0x35')]=_[_0x6781('0x30')](_0x2377a2,'name');_0x41f26d['query']=_[_0x6781('0x36')](_0x183e9f[_0x6781('0x37')]);_0x41f26d[_0x6781('0x38')]=_[_0x6781('0x39')](_0x41f26d[_0x6781('0x35')],_0x41f26d[_0x6781('0x37')]);_0x2f1997[_0x6781('0x3a')]=_[_0x6781('0x39')](_0x41f26d[_0x6781('0x35')],qs[_0x6781('0x3b')](_0x183e9f[_0x6781('0x37')]['fields']));_0x2f1997[_0x6781('0x3a')]=_0x2f1997[_0x6781('0x3a')][_0x6781('0x3c')]?_0x2f1997[_0x6781('0x3a')]:_0x41f26d['model'];if(!_0x183e9f['query']['hasOwnProperty']('nolimit')){_0x2f1997['limit']=qs[_0x6781('0x1f')](_0x183e9f['query']['limit']);_0x2f1997[_0x6781('0x1d')]=qs['offset'](_0x183e9f['query'][_0x6781('0x1d')]);}_0x2f1997[_0x6781('0x3d')]=qs[_0x6781('0x3e')](_0x183e9f[_0x6781('0x37')][_0x6781('0x3e')]);_0x2f1997[_0x6781('0x3f')]=qs[_0x6781('0x38')](_[_0x6781('0x40')](_0x183e9f[_0x6781('0x37')],_0x41f26d[_0x6781('0x38')]),_0x2377a2);if(_0x183e9f[_0x6781('0x37')]['filter']){_0x2f1997[_0x6781('0x3f')]=_[_0x6781('0x41')](_0x2f1997[_0x6781('0x3f')],{'$or':_[_0x6781('0x30')](_0x2377a2,function(_0x362a6e){if(_0x362a6e[_0x6781('0x42')]!==_0x6781('0x43')){var _0x5d4cf6={};_0x5d4cf6[_0x362a6e['name']]={'$like':'%'+_0x183e9f[_0x6781('0x37')][_0x6781('0x44')]+'%'};return _0x5d4cf6;}})});}_0x2f1997=_[_0x6781('0x41')]({},_0x2f1997,_0x183e9f[_0x6781('0x45')]);var _0x2c504e={'where':_0x2f1997[_0x6781('0x3f')]};return db[_0x6781('0x31')][_0x6781('0x20')](_0x2c504e)[_0x6781('0x27')](function(_0x5ae7f0){_0x2f280e[_0x6781('0x20')]=_0x5ae7f0;if(_0x183e9f[_0x6781('0x37')][_0x6781('0x46')]){_0x2f1997[_0x6781('0x47')]=[{'all':!![]}];}return db[_0x6781('0x31')][_0x6781('0x48')](_0x2f1997);})['then'](function(_0x2abaa2){_0x2f280e['rows']=_0x2abaa2;return _0x2f280e;})[_0x6781('0x27')](respondWithFilteredResult(_0x3eec50,_0x2f1997))[_0x6781('0x49')](handleError(_0x3eec50,null));};exports[_0x6781('0x4a')]=function(_0x1a167e,_0x4ae6b6){var _0x5030ef={'raw':![],'where':{'id':_0x1a167e[_0x6781('0x4b')]['id']}},_0x4803b6={};_0x4803b6[_0x6781('0x35')]=_[_0x6781('0x36')](db[_0x6781('0x31')][_0x6781('0x32')]);_0x4803b6[_0x6781('0x37')]=_[_0x6781('0x36')](_0x1a167e['query']);_0x4803b6[_0x6781('0x38')]=_[_0x6781('0x39')](_0x4803b6['model'],_0x4803b6[_0x6781('0x37')]);_0x5030ef[_0x6781('0x3a')]=_[_0x6781('0x39')](_0x4803b6[_0x6781('0x35')],qs[_0x6781('0x3b')](_0x1a167e[_0x6781('0x37')][_0x6781('0x3b')]));_0x5030ef['attributes']=_0x5030ef[_0x6781('0x3a')][_0x6781('0x3c')]?_0x5030ef[_0x6781('0x3a')]:_0x4803b6[_0x6781('0x35')];if(_0x1a167e[_0x6781('0x37')][_0x6781('0x46')]){_0x5030ef[_0x6781('0x47')]=[{'all':!![]}];}_0x5030ef=_['merge']({},_0x5030ef,_0x1a167e[_0x6781('0x45')]);return db[_0x6781('0x31')][_0x6781('0x4c')](_0x5030ef)[_0x6781('0x27')](handleEntityNotFound(_0x4ae6b6,null))[_0x6781('0x27')](respondWithResult(_0x4ae6b6,null))['catch'](handleError(_0x4ae6b6,null));};exports[_0x6781('0x4d')]=function(_0x4e7bad,_0x47d1e5){return db[_0x6781('0x31')][_0x6781('0x4d')](_0x4e7bad[_0x6781('0x4e')],{})[_0x6781('0x27')](function(_0x2b1949){var _0x4496a1=_0x4e7bad[_0x6781('0x4f')]['get']({'plain':!![]});if(!_0x4496a1)throw new Error(_0x6781('0x50'));if(_0x4496a1['role']===_0x6781('0x4f')){var _0x39aad1=_0x2b1949['get']({'plain':!![]});var _0x35947a=_0x6781('0x2a');return db[_0x6781('0x51')][_0x6781('0x4c')]({'where':{'name':_0x35947a,'userProfileId':_0x4496a1[_0x6781('0x52')]},'raw':!![]})['then'](function(_0x615ab0){if(_0x615ab0&&_0x615ab0[_0x6781('0x53')]===0x0){return db[_0x6781('0x2b')][_0x6781('0x4d')]({'name':_0x39aad1[_0x6781('0x2d')],'resourceId':_0x39aad1['id'],'type':_0x615ab0[_0x6781('0x2d')],'sectionId':_0x615ab0['id']},{})[_0x6781('0x27')](function(){return _0x2b1949;});}else{return _0x2b1949;}})[_0x6781('0x49')](function(_0x274268){logger[_0x6781('0x54')](_0x6781('0x55'),_0x274268);throw _0x274268;});}return _0x2b1949;})[_0x6781('0x27')](respondWithResult(_0x47d1e5,0xc9))[_0x6781('0x49')](handleError(_0x47d1e5,null));};exports[_0x6781('0x26')]=function(_0x2cada3,_0x53f76b){if(_0x2cada3[_0x6781('0x4e')]['id']){delete _0x2cada3[_0x6781('0x4e')]['id'];}return db[_0x6781('0x31')][_0x6781('0x4c')]({'where':{'id':_0x2cada3[_0x6781('0x4b')]['id']}})[_0x6781('0x27')](handleEntityNotFound(_0x53f76b,null))[_0x6781('0x27')](saveUpdates(_0x2cada3[_0x6781('0x4e')],null))[_0x6781('0x27')](respondWithResult(_0x53f76b,null))['catch'](handleError(_0x53f76b,null));};exports[_0x6781('0x28')]=function(_0x5160a9,_0x3d301c){return db[_0x6781('0x31')][_0x6781('0x4c')]({'where':{'id':_0x5160a9[_0x6781('0x4b')]['id']}})[_0x6781('0x27')](handleEntityNotFound(_0x3d301c,null))['then'](removeEntity(_0x3d301c,null))[_0x6781('0x49')](handleError(_0x3d301c,null));};exports[_0x6781('0x56')]=function(_0x30cf5b,_0x49d3cf,_0x323483){if(_0x30cf5b['body']['id']){delete _0x30cf5b[_0x6781('0x4e')]['id'];}return db[_0x6781('0x31')][_0x6781('0x4c')]({'where':{'id':_0x30cf5b[_0x6781('0x4b')]['id']}})[_0x6781('0x27')](handleEntityNotFound(_0x49d3cf,null))[_0x6781('0x27')](function(_0x296860){if(_0x296860){_0x30cf5b[_0x6781('0x4e')][_0x6781('0x57')]=_0x296860['id'];return db[_0x6781('0x58')][_0x6781('0x4d')](_0x30cf5b[_0x6781('0x4e')]);}})[_0x6781('0x27')](respondWithResult(_0x49d3cf,null))[_0x6781('0x49')](handleError(_0x49d3cf,null));};exports['addAnyCondition']=function(_0x23edc1,_0x5220f3,_0x1a2553){if(_0x23edc1['body']['id']){delete _0x23edc1['body']['id'];}return db[_0x6781('0x31')][_0x6781('0x4c')]({'where':{'id':_0x23edc1[_0x6781('0x4b')]['id']}})[_0x6781('0x27')](handleEntityNotFound(_0x5220f3,null))['then'](function(_0x31b548){if(_0x31b548){_0x23edc1[_0x6781('0x4e')]['TriggerAnyId']=_0x31b548['id'];return db['Condition'][_0x6781('0x4d')](_0x23edc1[_0x6781('0x4e')]);}})[_0x6781('0x27')](respondWithResult(_0x5220f3,null))[_0x6781('0x49')](handleError(_0x5220f3,null));};exports['getAllConditions']=function(_0x538ce0,_0x1fd4b9,_0xb53253){var _0x570462={};var _0x4c4ac7={};var _0x4074aa;var _0x2fd0d4;return db[_0x6781('0x31')][_0x6781('0x59')]({'where':{'id':_0x538ce0[_0x6781('0x4b')]['id']}})[_0x6781('0x27')](handleEntityNotFound(_0x1fd4b9,null))[_0x6781('0x27')](function(_0x243fc1){if(_0x243fc1){_0x4074aa=_0x243fc1;_0x4c4ac7[_0x6781('0x35')]=_['keys'](db['Condition']['rawAttributes']);_0x4c4ac7[_0x6781('0x37')]=_[_0x6781('0x36')](_0x538ce0[_0x6781('0x37')]);_0x4c4ac7[_0x6781('0x38')]=_[_0x6781('0x39')](_0x4c4ac7[_0x6781('0x35')],_0x4c4ac7[_0x6781('0x37')]);_0x570462[_0x6781('0x3a')]=_[_0x6781('0x39')](_0x4c4ac7[_0x6781('0x35')],qs[_0x6781('0x3b')](_0x538ce0[_0x6781('0x37')][_0x6781('0x3b')]));_0x570462[_0x6781('0x3a')]=_0x570462[_0x6781('0x3a')][_0x6781('0x3c')]?_0x570462[_0x6781('0x3a')]:_0x4c4ac7[_0x6781('0x35')];_0x570462[_0x6781('0x3d')]=qs['sort'](_0x538ce0['query'][_0x6781('0x3e')]);_0x570462['where']=qs[_0x6781('0x38')](_[_0x6781('0x40')](_0x538ce0[_0x6781('0x37')],_0x4c4ac7['filters']));if(_0x538ce0[_0x6781('0x37')][_0x6781('0x44')]){_0x570462['where']=_['merge'](_0x570462['where'],{'$or':_['map'](_0x570462[_0x6781('0x3a')],function(_0x2856a1){var _0x26dab9={};_0x26dab9[_0x2856a1]={'$like':'%'+_0x538ce0[_0x6781('0x37')][_0x6781('0x44')]+'%'};return _0x26dab9;})});}_0x570462=_[_0x6781('0x41')]({},_0x570462,_0x538ce0[_0x6781('0x45')]);return _0x4074aa['getAllConditions'](_0x570462);}})['then'](function(_0x581683){if(_0x581683){_0x2fd0d4=_0x581683['length'];if(!_0x538ce0[_0x6781('0x37')]['hasOwnProperty'](_0x6781('0x5a'))){_0x570462[_0x6781('0x1f')]=qs[_0x6781('0x1f')](_0x538ce0[_0x6781('0x37')][_0x6781('0x1f')]);_0x570462['offset']=qs[_0x6781('0x1d')](_0x538ce0['query']['offset']);}return _0x4074aa[_0x6781('0x5b')](_0x570462);}})[_0x6781('0x27')](function(_0x32bbe2){if(_0x32bbe2){return _0x32bbe2?{'count':_0x2fd0d4,'rows':_0x32bbe2}:null;}})[_0x6781('0x27')](respondWithResult(_0x1fd4b9,null))['catch'](handleError(_0x1fd4b9,null));};exports[_0x6781('0x5c')]=function(_0x4833d6,_0x5a72ba,_0x560bdf){var _0x4501c9={};var _0x576d3a={};var _0x502d67;var _0x396ea4;return db[_0x6781('0x31')]['findOne']({'where':{'id':_0x4833d6['params']['id']}})[_0x6781('0x27')](handleEntityNotFound(_0x5a72ba,null))['then'](function(_0x2af85b){if(_0x2af85b){_0x502d67=_0x2af85b;_0x576d3a[_0x6781('0x35')]=_[_0x6781('0x36')](db['Condition'][_0x6781('0x32')]);_0x576d3a[_0x6781('0x37')]=_['keys'](_0x4833d6[_0x6781('0x37')]);_0x576d3a['filters']=_[_0x6781('0x39')](_0x576d3a[_0x6781('0x35')],_0x576d3a[_0x6781('0x37')]);_0x4501c9[_0x6781('0x3a')]=_[_0x6781('0x39')](_0x576d3a[_0x6781('0x35')],qs[_0x6781('0x3b')](_0x4833d6['query']['fields']));_0x4501c9[_0x6781('0x3a')]=_0x4501c9[_0x6781('0x3a')][_0x6781('0x3c')]?_0x4501c9['attributes']:_0x576d3a[_0x6781('0x35')];_0x4501c9[_0x6781('0x3d')]=qs[_0x6781('0x3e')](_0x4833d6[_0x6781('0x37')][_0x6781('0x3e')]);_0x4501c9[_0x6781('0x3f')]=qs[_0x6781('0x38')](_[_0x6781('0x40')](_0x4833d6[_0x6781('0x37')],_0x576d3a[_0x6781('0x38')]));if(_0x4833d6[_0x6781('0x37')][_0x6781('0x44')]){_0x4501c9['where']=_[_0x6781('0x41')](_0x4501c9['where'],{'$or':_[_0x6781('0x30')](_0x4501c9['attributes'],function(_0xa4af28){var _0xe55f2c={};_0xe55f2c[_0xa4af28]={'$like':'%'+_0x4833d6[_0x6781('0x37')]['filter']+'%'};return _0xe55f2c;})});}_0x4501c9=_[_0x6781('0x41')]({},_0x4501c9,_0x4833d6[_0x6781('0x45')]);return _0x502d67['getAnyConditions'](_0x4501c9);}})['then'](function(_0x2afb02){if(_0x2afb02){_0x396ea4=_0x2afb02[_0x6781('0x3c')];if(!_0x4833d6['query'][_0x6781('0x5d')](_0x6781('0x5a'))){_0x4501c9[_0x6781('0x1f')]=qs[_0x6781('0x1f')](_0x4833d6['query'][_0x6781('0x1f')]);_0x4501c9[_0x6781('0x1d')]=qs[_0x6781('0x1d')](_0x4833d6[_0x6781('0x37')][_0x6781('0x1d')]);}return _0x502d67['getAnyConditions'](_0x4501c9);}})[_0x6781('0x27')](function(_0x2f323b){if(_0x2f323b){return _0x2f323b?{'count':_0x396ea4,'rows':_0x2f323b}:null;}})[_0x6781('0x27')](respondWithResult(_0x5a72ba,null))[_0x6781('0x49')](handleError(_0x5a72ba,null));};exports[_0x6781('0x5e')]=function(_0x2a28f0,_0x84dc8d,_0x1581cb){if(_0x2a28f0[_0x6781('0x4e')]['id']){delete _0x2a28f0[_0x6781('0x4e')]['id'];}return db[_0x6781('0x31')]['find']({'where':{'id':_0x2a28f0[_0x6781('0x4b')]['id']}})['then'](handleEntityNotFound(_0x84dc8d,null))[_0x6781('0x27')](function(_0x224d92){if(_0x224d92){_0x2a28f0[_0x6781('0x4e')][_0x6781('0x5f')]=_0x224d92['id'];return db['Action'][_0x6781('0x4d')](_0x2a28f0[_0x6781('0x4e')]);}})[_0x6781('0x27')](respondWithResult(_0x84dc8d,null))[_0x6781('0x49')](handleError(_0x84dc8d,null));};exports[_0x6781('0x60')]=function(_0x3fcb8f,_0x401e79,_0x3d480a){var _0x5362ba={};var _0x335b29={};var _0x430842;var _0x1dfc3e;return db['Trigger'][_0x6781('0x59')]({'where':{'id':_0x3fcb8f[_0x6781('0x4b')]['id']}})[_0x6781('0x27')](handleEntityNotFound(_0x401e79,null))[_0x6781('0x27')](function(_0x46a2ae){if(_0x46a2ae){_0x430842=_0x46a2ae;_0x335b29['model']=_[_0x6781('0x36')](db[_0x6781('0x61')]['rawAttributes']);_0x335b29[_0x6781('0x37')]=_[_0x6781('0x36')](_0x3fcb8f['query']);_0x335b29[_0x6781('0x38')]=_[_0x6781('0x39')](_0x335b29['model'],_0x335b29[_0x6781('0x37')]);_0x5362ba[_0x6781('0x3a')]=_[_0x6781('0x39')](_0x335b29[_0x6781('0x35')],qs['fields'](_0x3fcb8f['query'][_0x6781('0x3b')]));_0x5362ba[_0x6781('0x3a')]=_0x5362ba[_0x6781('0x3a')]['length']?_0x5362ba[_0x6781('0x3a')]:_0x335b29['model'];_0x5362ba[_0x6781('0x3d')]=qs[_0x6781('0x3e')](_0x3fcb8f['query'][_0x6781('0x3e')]);_0x5362ba['where']=qs[_0x6781('0x38')](_[_0x6781('0x40')](_0x3fcb8f[_0x6781('0x37')],_0x335b29[_0x6781('0x38')]));if(_0x3fcb8f['query']['filter']){_0x5362ba['where']=_[_0x6781('0x41')](_0x5362ba['where'],{'$or':_[_0x6781('0x30')](_0x5362ba['attributes'],function(_0x2ce294){var _0x1cabaa={};_0x1cabaa[_0x2ce294]={'$like':'%'+_0x3fcb8f[_0x6781('0x37')][_0x6781('0x44')]+'%'};return _0x1cabaa;})});}_0x5362ba=_[_0x6781('0x41')]({},_0x5362ba,_0x3fcb8f[_0x6781('0x45')]);return _0x430842['getActions'](_0x5362ba);}})['then'](function(_0x1d60e5){if(_0x1d60e5){_0x1dfc3e=_0x1d60e5[_0x6781('0x3c')];if(!_0x3fcb8f[_0x6781('0x37')][_0x6781('0x5d')]('nolimit')){_0x5362ba[_0x6781('0x1f')]=qs[_0x6781('0x1f')](_0x3fcb8f[_0x6781('0x37')][_0x6781('0x1f')]);_0x5362ba[_0x6781('0x1d')]=qs[_0x6781('0x1d')](_0x3fcb8f[_0x6781('0x37')][_0x6781('0x1d')]);}return _0x430842[_0x6781('0x60')](_0x5362ba);}})[_0x6781('0x27')](function(_0x4226d8){if(_0x4226d8){return _0x4226d8?{'count':_0x1dfc3e,'rows':_0x4226d8}:null;}})[_0x6781('0x27')](respondWithResult(_0x401e79,null))[_0x6781('0x49')](handleError(_0x401e79,null));}; \ No newline at end of file +var _0xf13a=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','Triggers','UserProfileResource','error','name','send','index','Trigger','rawAttributes','type','key','model','map','query','attributes','intersection','fields','order','sort','filters','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','length','filter','hasOwnProperty','getAnyConditions','nolimit','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x553176,_0x5881f3){var _0x39f579=function(_0x213f82){while(--_0x213f82){_0x553176['push'](_0x553176['shift']());}};_0x39f579(++_0x5881f3);}(_0xf13a,0x111));var _0xaf13=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0xf13a[_0xb99421];return _0x4b3ec7;};'use strict';var emlformat=require(_0xaf13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaf13('0x1'));var jsonpatch=require(_0xaf13('0x2'));var rp=require(_0xaf13('0x3'));var moment=require(_0xaf13('0x4'));var BPromise=require(_0xaf13('0x5'));var Mustache=require('mustache');var util=require(_0xaf13('0x6'));var path=require(_0xaf13('0x7'));var sox=require(_0xaf13('0x8'));var csv=require(_0xaf13('0x9'));var ejs=require(_0xaf13('0xa'));var fs=require('fs');var fs_extra=require(_0xaf13('0xb'));var _=require('lodash');var squel=require(_0xaf13('0xc'));var crypto=require(_0xaf13('0xd'));var jsforce=require(_0xaf13('0xe'));var deskjs=require(_0xaf13('0xf'));var toCsv=require(_0xaf13('0x9'));var querystring=require(_0xaf13('0x10'));var Papa=require(_0xaf13('0x11'));var Redis=require(_0xaf13('0x12'));var authService=require(_0xaf13('0x13'));var qs=require(_0xaf13('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf13('0x15'));var logger=require('../../config/logger')(_0xaf13('0x16'));var utils=require(_0xaf13('0x17'));var config=require(_0xaf13('0x18'));var licenseUtil=require(_0xaf13('0x19'));var db=require(_0xaf13('0x1a'))['db'];function respondWithStatusCode(_0x52dd61,_0x123931){_0x123931=_0x123931||0xcc;return function(_0x1ce889){if(_0x1ce889){return _0x52dd61['sendStatus'](_0x123931);}return _0x52dd61['status'](_0x123931)['end']();};}function respondWithResult(_0x35aab2,_0x13a976){_0x13a976=_0x13a976||0xc8;return function(_0x29edaf){if(_0x29edaf){return _0x35aab2[_0xaf13('0x1b')](_0x13a976)[_0xaf13('0x1c')](_0x29edaf);}};}function respondWithFilteredResult(_0xe6d4d,_0x518792){return function(_0x41a6aa){if(_0x41a6aa){var _0x3f26e0=typeof _0x518792[_0xaf13('0x1d')]==='undefined'&&typeof _0x518792[_0xaf13('0x1e')]===_0xaf13('0x1f');var _0x613ade=_0x41a6aa[_0xaf13('0x20')];var _0x3b593d=_0x3f26e0?0x0:_0x518792['offset'];var _0x1363a7=_0x3f26e0?_0x41a6aa[_0xaf13('0x20')]:_0x518792[_0xaf13('0x1d')]+_0x518792[_0xaf13('0x1e')];var _0x40cc74;if(_0x1363a7>=_0x613ade){_0x1363a7=_0x613ade;_0x40cc74=0xc8;}else{_0x40cc74=0xce;}_0xe6d4d['status'](_0x40cc74);return _0xe6d4d[_0xaf13('0x21')](_0xaf13('0x22'),_0x3b593d+'-'+_0x1363a7+'/'+_0x613ade)[_0xaf13('0x1c')](_0x41a6aa);}return null;};}function patchUpdates(_0x1f7ff3){return function(_0x1b5ca8){try{jsonpatch[_0xaf13('0x23')](_0x1b5ca8,_0x1f7ff3,!![]);}catch(_0x1c5411){return BPromise['reject'](_0x1c5411);}return _0x1b5ca8[_0xaf13('0x24')]();};}function saveUpdates(_0x19abf3,_0x27efb0){return function(_0x41d883){if(_0x41d883){return _0x41d883[_0xaf13('0x25')](_0x19abf3)[_0xaf13('0x26')](function(_0x3a5fac){return _0x3a5fac;});}return null;};}function removeEntity(_0x40dc90,_0x1bc497){return function(_0x40f78c){if(_0x40f78c){return _0x40f78c[_0xaf13('0x27')]()[_0xaf13('0x26')](function(){var _0xe6eafb=_0x40f78c[_0xaf13('0x28')]({'plain':!![]});var _0x48591a=_0xaf13('0x29');return db[_0xaf13('0x2a')][_0xaf13('0x27')]({'where':{'type':_0x48591a,'resourceId':_0xe6eafb['id']}})[_0xaf13('0x26')](function(){return _0x40f78c;});})['then'](function(){_0x40dc90[_0xaf13('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a758f,_0xaf6c38){return function(_0x16f73a){if(!_0x16f73a){_0x3a758f['sendStatus'](0x194);}return _0x16f73a;};}function handleError(_0xcfda8f,_0x286a95){_0x286a95=_0x286a95||0x1f4;return function(_0x4f63cb){logger[_0xaf13('0x2b')](_0x4f63cb['stack']);if(_0x4f63cb['name']){delete _0x4f63cb[_0xaf13('0x2c')];}_0xcfda8f[_0xaf13('0x1b')](_0x286a95)[_0xaf13('0x2d')](_0x4f63cb);};}exports[_0xaf13('0x2e')]=function(_0x502604,_0xbbba29){var _0x1d7ce={},_0x4f6ae7={},_0x510dec={'count':0x0,'rows':[]};var _0x42f939=_['map'](db[_0xaf13('0x2f')][_0xaf13('0x30')],function(_0x227dcf){return{'name':_0x227dcf['fieldName'],'type':_0x227dcf[_0xaf13('0x31')][_0xaf13('0x32')]};});_0x4f6ae7[_0xaf13('0x33')]=_[_0xaf13('0x34')](_0x42f939,_0xaf13('0x2c'));_0x4f6ae7[_0xaf13('0x35')]=_['keys'](_0x502604['query']);_0x4f6ae7['filters']=_['intersection'](_0x4f6ae7[_0xaf13('0x33')],_0x4f6ae7['query']);_0x1d7ce[_0xaf13('0x36')]=_[_0xaf13('0x37')](_0x4f6ae7[_0xaf13('0x33')],qs[_0xaf13('0x38')](_0x502604[_0xaf13('0x35')]['fields']));_0x1d7ce[_0xaf13('0x36')]=_0x1d7ce[_0xaf13('0x36')]['length']?_0x1d7ce[_0xaf13('0x36')]:_0x4f6ae7[_0xaf13('0x33')];if(!_0x502604[_0xaf13('0x35')]['hasOwnProperty']('nolimit')){_0x1d7ce[_0xaf13('0x1e')]=qs[_0xaf13('0x1e')](_0x502604[_0xaf13('0x35')][_0xaf13('0x1e')]);_0x1d7ce[_0xaf13('0x1d')]=qs[_0xaf13('0x1d')](_0x502604['query'][_0xaf13('0x1d')]);}_0x1d7ce[_0xaf13('0x39')]=qs[_0xaf13('0x3a')](_0x502604['query'][_0xaf13('0x3a')]);_0x1d7ce['where']=qs[_0xaf13('0x3b')](_[_0xaf13('0x3c')](_0x502604[_0xaf13('0x35')],_0x4f6ae7[_0xaf13('0x3b')]),_0x42f939);if(_0x502604['query']['filter']){_0x1d7ce[_0xaf13('0x3d')]=_[_0xaf13('0x3e')](_0x1d7ce[_0xaf13('0x3d')],{'$or':_[_0xaf13('0x34')](_0x42f939,function(_0x284b02){if(_0x284b02[_0xaf13('0x31')]!==_0xaf13('0x3f')){var _0xf2968b={};_0xf2968b[_0x284b02[_0xaf13('0x2c')]]={'$like':'%'+_0x502604[_0xaf13('0x35')]['filter']+'%'};return _0xf2968b;}})});}_0x1d7ce=_['merge']({},_0x1d7ce,_0x502604[_0xaf13('0x40')]);var _0x4da3de={'where':_0x1d7ce[_0xaf13('0x3d')]};return db[_0xaf13('0x2f')][_0xaf13('0x20')](_0x4da3de)[_0xaf13('0x26')](function(_0x26d61b){_0x510dec[_0xaf13('0x20')]=_0x26d61b;if(_0x502604[_0xaf13('0x35')][_0xaf13('0x41')]){_0x1d7ce[_0xaf13('0x42')]=[{'all':!![]}];}return db['Trigger'][_0xaf13('0x43')](_0x1d7ce);})[_0xaf13('0x26')](function(_0x16dd03){_0x510dec[_0xaf13('0x44')]=_0x16dd03;return _0x510dec;})[_0xaf13('0x26')](respondWithFilteredResult(_0xbbba29,_0x1d7ce))[_0xaf13('0x45')](handleError(_0xbbba29,null));};exports['show']=function(_0x4e9688,_0x4ff560){var _0x2c23bd={'raw':![],'where':{'id':_0x4e9688[_0xaf13('0x46')]['id']}},_0x40c277={};_0x40c277['model']=_[_0xaf13('0x47')](db[_0xaf13('0x2f')][_0xaf13('0x30')]);_0x40c277[_0xaf13('0x35')]=_['keys'](_0x4e9688[_0xaf13('0x35')]);_0x40c277[_0xaf13('0x3b')]=_['intersection'](_0x40c277[_0xaf13('0x33')],_0x40c277[_0xaf13('0x35')]);_0x2c23bd[_0xaf13('0x36')]=_[_0xaf13('0x37')](_0x40c277['model'],qs[_0xaf13('0x38')](_0x4e9688[_0xaf13('0x35')][_0xaf13('0x38')]));_0x2c23bd['attributes']=_0x2c23bd[_0xaf13('0x36')]['length']?_0x2c23bd[_0xaf13('0x36')]:_0x40c277[_0xaf13('0x33')];if(_0x4e9688[_0xaf13('0x35')][_0xaf13('0x41')]){_0x2c23bd[_0xaf13('0x42')]=[{'all':!![]}];}_0x2c23bd=_[_0xaf13('0x3e')]({},_0x2c23bd,_0x4e9688['options']);return db[_0xaf13('0x2f')]['find'](_0x2c23bd)['then'](handleEntityNotFound(_0x4ff560,null))[_0xaf13('0x26')](respondWithResult(_0x4ff560,null))[_0xaf13('0x45')](handleError(_0x4ff560,null));};exports[_0xaf13('0x48')]=function(_0x476e8c,_0x4c94ea){return db[_0xaf13('0x2f')][_0xaf13('0x48')](_0x476e8c[_0xaf13('0x49')],{})[_0xaf13('0x26')](function(_0x40df07){var _0x3a1297=_0x476e8c[_0xaf13('0x4a')][_0xaf13('0x28')]({'plain':!![]});if(!_0x3a1297)throw new Error(_0xaf13('0x4b'));if(_0x3a1297[_0xaf13('0x4c')]===_0xaf13('0x4a')){var _0x539404=_0x40df07['get']({'plain':!![]});var _0x554492=_0xaf13('0x29');return db['UserProfileSection'][_0xaf13('0x4d')]({'where':{'name':_0x554492,'userProfileId':_0x3a1297[_0xaf13('0x4e')]},'raw':!![]})[_0xaf13('0x26')](function(_0x522783){if(_0x522783&&_0x522783[_0xaf13('0x4f')]===0x0){return db[_0xaf13('0x2a')][_0xaf13('0x48')]({'name':_0x539404['name'],'resourceId':_0x539404['id'],'type':_0x522783['name'],'sectionId':_0x522783['id']},{})[_0xaf13('0x26')](function(){return _0x40df07;});}else{return _0x40df07;}})['catch'](function(_0x4d77eb){logger[_0xaf13('0x2b')](_0xaf13('0x50'),_0x4d77eb);throw _0x4d77eb;});}return _0x40df07;})['then'](respondWithResult(_0x4c94ea,0xc9))[_0xaf13('0x45')](handleError(_0x4c94ea,null));};exports[_0xaf13('0x25')]=function(_0x10e844,_0x1ff120){if(_0x10e844[_0xaf13('0x49')]['id']){delete _0x10e844[_0xaf13('0x49')]['id'];}return db[_0xaf13('0x2f')][_0xaf13('0x4d')]({'where':{'id':_0x10e844[_0xaf13('0x46')]['id']}})[_0xaf13('0x26')](handleEntityNotFound(_0x1ff120,null))['then'](saveUpdates(_0x10e844['body'],null))[_0xaf13('0x26')](respondWithResult(_0x1ff120,null))[_0xaf13('0x45')](handleError(_0x1ff120,null));};exports[_0xaf13('0x27')]=function(_0x25407b,_0x247df){return db[_0xaf13('0x2f')][_0xaf13('0x4d')]({'where':{'id':_0x25407b[_0xaf13('0x46')]['id']}})[_0xaf13('0x26')](handleEntityNotFound(_0x247df,null))[_0xaf13('0x26')](removeEntity(_0x247df,null))['catch'](handleError(_0x247df,null));};exports[_0xaf13('0x51')]=function(_0x1c5b6e,_0x2b4822,_0xedfa4b){if(_0x1c5b6e[_0xaf13('0x49')]['id']){delete _0x1c5b6e[_0xaf13('0x49')]['id'];}return db['Trigger']['find']({'where':{'id':_0x1c5b6e[_0xaf13('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b4822,null))['then'](function(_0x4814d7){if(_0x4814d7){_0x1c5b6e[_0xaf13('0x49')][_0xaf13('0x52')]=_0x4814d7['id'];return db[_0xaf13('0x53')][_0xaf13('0x48')](_0x1c5b6e[_0xaf13('0x49')]);}})[_0xaf13('0x26')](respondWithResult(_0x2b4822,null))[_0xaf13('0x45')](handleError(_0x2b4822,null));};exports[_0xaf13('0x54')]=function(_0x380daa,_0x444d6c,_0xec9be0){if(_0x380daa['body']['id']){delete _0x380daa[_0xaf13('0x49')]['id'];}return db[_0xaf13('0x2f')][_0xaf13('0x4d')]({'where':{'id':_0x380daa[_0xaf13('0x46')]['id']}})[_0xaf13('0x26')](handleEntityNotFound(_0x444d6c,null))['then'](function(_0x5e5187){if(_0x5e5187){_0x380daa['body'][_0xaf13('0x55')]=_0x5e5187['id'];return db[_0xaf13('0x53')][_0xaf13('0x48')](_0x380daa[_0xaf13('0x49')]);}})[_0xaf13('0x26')](respondWithResult(_0x444d6c,null))['catch'](handleError(_0x444d6c,null));};exports[_0xaf13('0x56')]=function(_0x13a81f,_0x1eae90,_0x5a0d58){var _0x30927c={};var _0x4f2632={};var _0x45ab1d;var _0x408b70;return db[_0xaf13('0x2f')][_0xaf13('0x57')]({'where':{'id':_0x13a81f[_0xaf13('0x46')]['id']}})['then'](handleEntityNotFound(_0x1eae90,null))[_0xaf13('0x26')](function(_0x339f11){if(_0x339f11){_0x45ab1d=_0x339f11;_0x4f2632[_0xaf13('0x33')]=_['keys'](db['Condition']['rawAttributes']);_0x4f2632['query']=_['keys'](_0x13a81f[_0xaf13('0x35')]);_0x4f2632['filters']=_[_0xaf13('0x37')](_0x4f2632[_0xaf13('0x33')],_0x4f2632[_0xaf13('0x35')]);_0x30927c[_0xaf13('0x36')]=_['intersection'](_0x4f2632[_0xaf13('0x33')],qs[_0xaf13('0x38')](_0x13a81f[_0xaf13('0x35')][_0xaf13('0x38')]));_0x30927c[_0xaf13('0x36')]=_0x30927c['attributes'][_0xaf13('0x58')]?_0x30927c[_0xaf13('0x36')]:_0x4f2632['model'];_0x30927c[_0xaf13('0x39')]=qs[_0xaf13('0x3a')](_0x13a81f[_0xaf13('0x35')]['sort']);_0x30927c['where']=qs['filters'](_[_0xaf13('0x3c')](_0x13a81f[_0xaf13('0x35')],_0x4f2632[_0xaf13('0x3b')]));if(_0x13a81f[_0xaf13('0x35')][_0xaf13('0x59')]){_0x30927c['where']=_['merge'](_0x30927c[_0xaf13('0x3d')],{'$or':_[_0xaf13('0x34')](_0x30927c[_0xaf13('0x36')],function(_0x2b2559){var _0x2fc514={};_0x2fc514[_0x2b2559]={'$like':'%'+_0x13a81f[_0xaf13('0x35')]['filter']+'%'};return _0x2fc514;})});}_0x30927c=_['merge']({},_0x30927c,_0x13a81f[_0xaf13('0x40')]);return _0x45ab1d[_0xaf13('0x56')](_0x30927c);}})['then'](function(_0x58f90c){if(_0x58f90c){_0x408b70=_0x58f90c['length'];if(!_0x13a81f[_0xaf13('0x35')][_0xaf13('0x5a')]('nolimit')){_0x30927c[_0xaf13('0x1e')]=qs[_0xaf13('0x1e')](_0x13a81f['query']['limit']);_0x30927c['offset']=qs[_0xaf13('0x1d')](_0x13a81f[_0xaf13('0x35')]['offset']);}return _0x45ab1d['getAllConditions'](_0x30927c);}})[_0xaf13('0x26')](function(_0x33e4ac){if(_0x33e4ac){return _0x33e4ac?{'count':_0x408b70,'rows':_0x33e4ac}:null;}})[_0xaf13('0x26')](respondWithResult(_0x1eae90,null))[_0xaf13('0x45')](handleError(_0x1eae90,null));};exports[_0xaf13('0x5b')]=function(_0x2fc9da,_0x30ecff,_0xbf4492){var _0x5124be={};var _0x4c9b33={};var _0x50800b;var _0x22af40;return db[_0xaf13('0x2f')][_0xaf13('0x57')]({'where':{'id':_0x2fc9da[_0xaf13('0x46')]['id']}})[_0xaf13('0x26')](handleEntityNotFound(_0x30ecff,null))['then'](function(_0x3f4b56){if(_0x3f4b56){_0x50800b=_0x3f4b56;_0x4c9b33[_0xaf13('0x33')]=_[_0xaf13('0x47')](db[_0xaf13('0x53')][_0xaf13('0x30')]);_0x4c9b33['query']=_['keys'](_0x2fc9da['query']);_0x4c9b33[_0xaf13('0x3b')]=_[_0xaf13('0x37')](_0x4c9b33[_0xaf13('0x33')],_0x4c9b33[_0xaf13('0x35')]);_0x5124be[_0xaf13('0x36')]=_['intersection'](_0x4c9b33['model'],qs[_0xaf13('0x38')](_0x2fc9da[_0xaf13('0x35')][_0xaf13('0x38')]));_0x5124be[_0xaf13('0x36')]=_0x5124be[_0xaf13('0x36')]['length']?_0x5124be[_0xaf13('0x36')]:_0x4c9b33[_0xaf13('0x33')];_0x5124be[_0xaf13('0x39')]=qs[_0xaf13('0x3a')](_0x2fc9da['query']['sort']);_0x5124be[_0xaf13('0x3d')]=qs[_0xaf13('0x3b')](_['pick'](_0x2fc9da[_0xaf13('0x35')],_0x4c9b33['filters']));if(_0x2fc9da[_0xaf13('0x35')][_0xaf13('0x59')]){_0x5124be[_0xaf13('0x3d')]=_['merge'](_0x5124be[_0xaf13('0x3d')],{'$or':_[_0xaf13('0x34')](_0x5124be[_0xaf13('0x36')],function(_0x3a0620){var _0x453cc3={};_0x453cc3[_0x3a0620]={'$like':'%'+_0x2fc9da['query'][_0xaf13('0x59')]+'%'};return _0x453cc3;})});}_0x5124be=_[_0xaf13('0x3e')]({},_0x5124be,_0x2fc9da[_0xaf13('0x40')]);return _0x50800b[_0xaf13('0x5b')](_0x5124be);}})[_0xaf13('0x26')](function(_0x525361){if(_0x525361){_0x22af40=_0x525361[_0xaf13('0x58')];if(!_0x2fc9da[_0xaf13('0x35')][_0xaf13('0x5a')](_0xaf13('0x5c'))){_0x5124be[_0xaf13('0x1e')]=qs[_0xaf13('0x1e')](_0x2fc9da[_0xaf13('0x35')][_0xaf13('0x1e')]);_0x5124be[_0xaf13('0x1d')]=qs['offset'](_0x2fc9da[_0xaf13('0x35')][_0xaf13('0x1d')]);}return _0x50800b['getAnyConditions'](_0x5124be);}})[_0xaf13('0x26')](function(_0x53a133){if(_0x53a133){return _0x53a133?{'count':_0x22af40,'rows':_0x53a133}:null;}})[_0xaf13('0x26')](respondWithResult(_0x30ecff,null))[_0xaf13('0x45')](handleError(_0x30ecff,null));};exports['addAction']=function(_0x5976a4,_0x553d5f,_0x4812b0){if(_0x5976a4[_0xaf13('0x49')]['id']){delete _0x5976a4[_0xaf13('0x49')]['id'];}return db[_0xaf13('0x2f')][_0xaf13('0x4d')]({'where':{'id':_0x5976a4[_0xaf13('0x46')]['id']}})[_0xaf13('0x26')](handleEntityNotFound(_0x553d5f,null))[_0xaf13('0x26')](function(_0x2c4a0a){if(_0x2c4a0a){_0x5976a4['body']['TriggerId']=_0x2c4a0a['id'];return db['Action']['create'](_0x5976a4['body']);}})[_0xaf13('0x26')](respondWithResult(_0x553d5f,null))[_0xaf13('0x45')](handleError(_0x553d5f,null));};exports['getActions']=function(_0x5ba463,_0xbc4e31,_0x68b33c){var _0x1710a7={};var _0x394642={};var _0x1f26b0;var _0xefa14e;return db[_0xaf13('0x2f')]['findOne']({'where':{'id':_0x5ba463['params']['id']}})['then'](handleEntityNotFound(_0xbc4e31,null))[_0xaf13('0x26')](function(_0x227e93){if(_0x227e93){_0x1f26b0=_0x227e93;_0x394642['model']=_[_0xaf13('0x47')](db[_0xaf13('0x5d')]['rawAttributes']);_0x394642[_0xaf13('0x35')]=_[_0xaf13('0x47')](_0x5ba463[_0xaf13('0x35')]);_0x394642['filters']=_['intersection'](_0x394642[_0xaf13('0x33')],_0x394642[_0xaf13('0x35')]);_0x1710a7[_0xaf13('0x36')]=_[_0xaf13('0x37')](_0x394642['model'],qs['fields'](_0x5ba463[_0xaf13('0x35')][_0xaf13('0x38')]));_0x1710a7[_0xaf13('0x36')]=_0x1710a7[_0xaf13('0x36')][_0xaf13('0x58')]?_0x1710a7[_0xaf13('0x36')]:_0x394642[_0xaf13('0x33')];_0x1710a7['order']=qs[_0xaf13('0x3a')](_0x5ba463[_0xaf13('0x35')]['sort']);_0x1710a7[_0xaf13('0x3d')]=qs[_0xaf13('0x3b')](_[_0xaf13('0x3c')](_0x5ba463[_0xaf13('0x35')],_0x394642[_0xaf13('0x3b')]));if(_0x5ba463[_0xaf13('0x35')][_0xaf13('0x59')]){_0x1710a7[_0xaf13('0x3d')]=_['merge'](_0x1710a7[_0xaf13('0x3d')],{'$or':_['map'](_0x1710a7[_0xaf13('0x36')],function(_0x370a01){var _0x1f844c={};_0x1f844c[_0x370a01]={'$like':'%'+_0x5ba463['query']['filter']+'%'};return _0x1f844c;})});}_0x1710a7=_[_0xaf13('0x3e')]({},_0x1710a7,_0x5ba463[_0xaf13('0x40')]);return _0x1f26b0[_0xaf13('0x5e')](_0x1710a7);}})[_0xaf13('0x26')](function(_0x592c51){if(_0x592c51){_0xefa14e=_0x592c51[_0xaf13('0x58')];if(!_0x5ba463[_0xaf13('0x35')][_0xaf13('0x5a')](_0xaf13('0x5c'))){_0x1710a7[_0xaf13('0x1e')]=qs['limit'](_0x5ba463[_0xaf13('0x35')][_0xaf13('0x1e')]);_0x1710a7['offset']=qs['offset'](_0x5ba463[_0xaf13('0x35')][_0xaf13('0x1d')]);}return _0x1f26b0[_0xaf13('0x5e')](_0x1710a7);}})['then'](function(_0x2fd633){if(_0x2fd633){return _0x2fd633?{'count':_0xefa14e,'rows':_0x2fd633}:null;}})['then'](respondWithResult(_0xbc4e31,null))[_0xaf13('0x45')](handleError(_0xbc4e31,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 7f0c199..824dee4 100644 --- a/server/api/trigger/trigger.model.js +++ b/server/api/trigger/trigger.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['tools_triggers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','Trigger'];(function(_0x1862a7,_0xb6d769){var _0x5dfb45=function(_0x5428af){while(--_0x5428af){_0x1862a7['push'](_0x1862a7['shift']());}};_0x5dfb45(++_0xb6d769);}(_0x34e8,0x12c));var _0x834e=function(_0x3d649b,_0x3cedb9){_0x3d649b=_0x3d649b-0x0;var _0x4df026=_0x34e8[_0x3d649b];return _0x4df026;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fed=['exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','request-promise','path','./trigger.attributes'];(function(_0x14ce5b,_0x7dd288){var _0x507e8d=function(_0x181a33){while(--_0x181a33){_0x14ce5b['push'](_0x14ce5b['shift']());}};_0x507e8d(++_0x7dd288);}(_0x2fed,0x7c));var _0xd2fe=function(_0x25f3e2,_0x547191){_0x25f3e2=_0x25f3e2-0x0;var _0x2051af=_0x2fed[_0x25f3e2];return _0x2051af;};'use strict';var _=require(_0xd2fe('0x0'));var util=require(_0xd2fe('0x1'));var logger=require(_0xd2fe('0x2'))(_0xd2fe('0x3'));var moment=require(_0xd2fe('0x4'));var BPromise=require('bluebird');var rp=require(_0xd2fe('0x5'));var fs=require('fs');var path=require(_0xd2fe('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd2fe('0x7'));module[_0xd2fe('0x8')]=function(_0xd85f89,_0x5be4d3){return _0xd85f89[_0xd2fe('0x9')](_0xd2fe('0xa'),attributes,{'tableName':_0xd2fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 79f3704..7a3ae7a 100644 --- a/server/api/trigger/trigger.rpc.js +++ b/server/api/trigger/trigger.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b4b=['model','then','debug','find','ShowTrigger','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x48995c,_0x36f429){var _0x555c2b=function(_0x4a8cd6){while(--_0x4a8cd6){_0x48995c['push'](_0x48995c['shift']());}};_0x555c2b(++_0x36f429);}(_0x0b4b,0x1ef));var _0xb0b4=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x0b4b[_0x231e16];return _0x570a7c;};'use strict';var _=require(_0xb0b4('0x0'));var util=require('util');var moment=require(_0xb0b4('0x1'));var BPromise=require('bluebird');var rs=require(_0xb0b4('0x2'));var fs=require('fs');var Redis=require(_0xb0b4('0x3'));var db=require(_0xb0b4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb0b4('0x5'))(_0xb0b4('0x6'));var config=require('../../config/environment');var jayson=require(_0xb0b4('0x7'));var client=jayson[_0xb0b4('0x8')][_0xb0b4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc6660,_0x24c0dc,_0x2d76df){return new BPromise(function(_0x9dad74,_0x38c60f){return client[_0xb0b4('0xa')](_0xc6660,_0x2d76df)['then'](function(_0x1d9b8d){logger[_0xb0b4('0xb')](_0xb0b4('0xc'),_0x24c0dc,_0xb0b4('0xd'));logger['debug'](_0xb0b4('0xe'),_0x24c0dc,_0xb0b4('0xd'),JSON[_0xb0b4('0xf')](_0x1d9b8d));if(_0x1d9b8d[_0xb0b4('0x10')]){if(_0x1d9b8d[_0xb0b4('0x10')][_0xb0b4('0x11')]===0x1f4){logger[_0xb0b4('0x10')](_0xb0b4('0xc'),_0x24c0dc,_0x1d9b8d['error'][_0xb0b4('0x12')]);return _0x38c60f(_0x1d9b8d[_0xb0b4('0x10')][_0xb0b4('0x12')]);}logger[_0xb0b4('0x10')](_0xb0b4('0xc'),_0x24c0dc,_0x1d9b8d['error'][_0xb0b4('0x12')]);return _0x9dad74(_0x1d9b8d[_0xb0b4('0x10')][_0xb0b4('0x12')]);}else{logger[_0xb0b4('0xb')](_0xb0b4('0xc'),_0x24c0dc,_0xb0b4('0xd'));_0x9dad74(_0x1d9b8d['result'][_0xb0b4('0x12')]);}})[_0xb0b4('0x13')](function(_0x1ad191){logger[_0xb0b4('0x10')](_0xb0b4('0xc'),_0x24c0dc,_0x1ad191);_0x38c60f(_0x1ad191);});});}exports[_0xb0b4('0x14')]=function(_0x262ad7){var _0x1cb622=this;return new Promise(function(_0x2a4f58,_0x3a19d6){return db[_0xb0b4('0x15')][_0xb0b4('0x16')]({'raw':_0x262ad7[_0xb0b4('0x17')]?_0x262ad7['options'][_0xb0b4('0x18')]===undefined?!![]:![]:!![],'where':_0x262ad7[_0xb0b4('0x17')]?_0x262ad7[_0xb0b4('0x17')][_0xb0b4('0x19')]||null:null,'attributes':_0x262ad7['options']?_0x262ad7['options'][_0xb0b4('0x1a')]||null:null,'limit':_0x262ad7[_0xb0b4('0x17')]?_0x262ad7['options'][_0xb0b4('0x1b')]||null:null,'include':_0x262ad7[_0xb0b4('0x17')]?_0x262ad7['options'][_0xb0b4('0x1c')]?_[_0xb0b4('0x1d')](_0x262ad7['options'][_0xb0b4('0x1c')],function(_0x50bc3c){return{'model':db[_0x50bc3c[_0xb0b4('0x1e')]],'as':_0x50bc3c['as'],'attributes':_0x50bc3c['attributes'],'include':_0x50bc3c[_0xb0b4('0x1c')]?_[_0xb0b4('0x1d')](_0x50bc3c[_0xb0b4('0x1c')],function(_0x71347){return{'model':db[_0x71347[_0xb0b4('0x1e')]],'as':_0x71347['as'],'attributes':_0x71347[_0xb0b4('0x1a')],'include':_0x71347['include']?_[_0xb0b4('0x1d')](_0x71347[_0xb0b4('0x1c')],function(_0x2afd68){return{'model':db[_0x2afd68[_0xb0b4('0x1e')]],'as':_0x2afd68['as'],'attributes':_0x2afd68[_0xb0b4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb0b4('0x1f')](function(_0x15d56b){logger['info'](_0xb0b4('0x14'),_0x262ad7);logger[_0xb0b4('0x20')](_0xb0b4('0x14'),_0x262ad7,JSON[_0xb0b4('0xf')](_0x15d56b));_0x2a4f58(_0x15d56b);})[_0xb0b4('0x13')](function(_0x559d6f){logger[_0xb0b4('0x10')]('GetTrigger',_0x559d6f[_0xb0b4('0x12')],_0x262ad7);_0x3a19d6(_0x1cb622[_0xb0b4('0x10')](0x1f4,_0x559d6f[_0xb0b4('0x12')]));});});};exports['ShowTrigger']=function(_0x3288a2){var _0x4b94a9=this;return new Promise(function(_0x1e4cc2,_0x444946){return db['Trigger'][_0xb0b4('0x21')]({'raw':_0x3288a2[_0xb0b4('0x17')]?_0x3288a2[_0xb0b4('0x17')][_0xb0b4('0x18')]===undefined?!![]:![]:!![],'where':_0x3288a2[_0xb0b4('0x17')]?_0x3288a2['options']['where']||null:null,'attributes':_0x3288a2[_0xb0b4('0x17')]?_0x3288a2[_0xb0b4('0x17')][_0xb0b4('0x1a')]||null:null,'include':_0x3288a2[_0xb0b4('0x17')]?_0x3288a2[_0xb0b4('0x17')][_0xb0b4('0x1c')]?_[_0xb0b4('0x1d')](_0x3288a2[_0xb0b4('0x17')]['include'],function(_0xf12fb7){return{'model':db[_0xf12fb7['model']],'as':_0xf12fb7['as'],'attributes':_0xf12fb7[_0xb0b4('0x1a')],'include':_0xf12fb7[_0xb0b4('0x1c')]?_[_0xb0b4('0x1d')](_0xf12fb7[_0xb0b4('0x1c')],function(_0x2feb2a){return{'model':db[_0x2feb2a[_0xb0b4('0x1e')]],'as':_0x2feb2a['as'],'attributes':_0x2feb2a[_0xb0b4('0x1a')],'include':_0x2feb2a[_0xb0b4('0x1c')]?_[_0xb0b4('0x1d')](_0x2feb2a['include'],function(_0x3e8199){return{'model':db[_0x3e8199[_0xb0b4('0x1e')]],'as':_0x3e8199['as'],'attributes':_0x3e8199[_0xb0b4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb0b4('0x1f')](function(_0x3b25c6){logger[_0xb0b4('0xb')]('ShowTrigger',_0x3288a2);logger[_0xb0b4('0x20')](_0xb0b4('0x22'),_0x3288a2,JSON['stringify'](_0x3b25c6));_0x1e4cc2(_0x3b25c6);})[_0xb0b4('0x13')](function(_0x91495f){logger[_0xb0b4('0x10')]('ShowTrigger',_0x91495f[_0xb0b4('0x12')],_0x3288a2);_0x444946(_0x4b94a9['error'](0x1f4,_0x91495f[_0xb0b4('0x12')]));});});}; \ No newline at end of file +var _0xa3e4=['request','then','info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrigger','Trigger','options','where','attributes','limit','include','map','model','ShowTrigger','find','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5964da,_0x2feebf){var _0x13fbaa=function(_0xf137a7){while(--_0xf137a7){_0x5964da['push'](_0x5964da['shift']());}};_0x13fbaa(++_0x2feebf);}(_0xa3e4,0x7f));var _0x4a3e=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0xa3e4[_0x1ab180];return _0xfb2c2d;};'use strict';var _=require(_0x4a3e('0x0'));var util=require(_0x4a3e('0x1'));var moment=require('moment');var BPromise=require(_0x4a3e('0x2'));var rs=require(_0x4a3e('0x3'));var fs=require('fs');var Redis=require(_0x4a3e('0x4'));var db=require(_0x4a3e('0x5'))['db'];var utils=require(_0x4a3e('0x6'));var logger=require(_0x4a3e('0x7'))(_0x4a3e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x14f005,_0x4f0e84,_0x3c1bc1){return new BPromise(function(_0x14db8,_0x469a67){return client[_0x4a3e('0x9')](_0x14f005,_0x3c1bc1)[_0x4a3e('0xa')](function(_0x44c6d4){logger[_0x4a3e('0xb')](_0x4a3e('0xc'),_0x4f0e84,'request\x20sent');logger[_0x4a3e('0xd')](_0x4a3e('0xe'),_0x4f0e84,_0x4a3e('0xf'),JSON[_0x4a3e('0x10')](_0x44c6d4));if(_0x44c6d4[_0x4a3e('0x11')]){if(_0x44c6d4[_0x4a3e('0x11')][_0x4a3e('0x12')]===0x1f4){logger[_0x4a3e('0x11')](_0x4a3e('0xc'),_0x4f0e84,_0x44c6d4[_0x4a3e('0x11')][_0x4a3e('0x13')]);return _0x469a67(_0x44c6d4[_0x4a3e('0x11')][_0x4a3e('0x13')]);}logger['error'](_0x4a3e('0xc'),_0x4f0e84,_0x44c6d4[_0x4a3e('0x11')]['message']);return _0x14db8(_0x44c6d4[_0x4a3e('0x11')]['message']);}else{logger[_0x4a3e('0xb')](_0x4a3e('0xc'),_0x4f0e84,_0x4a3e('0xf'));_0x14db8(_0x44c6d4[_0x4a3e('0x14')][_0x4a3e('0x13')]);}})[_0x4a3e('0x15')](function(_0x4c718a){logger[_0x4a3e('0x11')]('Trigger,\x20%s,\x20%s',_0x4f0e84,_0x4c718a);_0x469a67(_0x4c718a);});});}exports[_0x4a3e('0x16')]=function(_0x32e4fc){var _0x1bd780=this;return new Promise(function(_0x1beaf1,_0x2baf4a){return db[_0x4a3e('0x17')]['findAll']({'raw':_0x32e4fc[_0x4a3e('0x18')]?_0x32e4fc[_0x4a3e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x32e4fc[_0x4a3e('0x18')]?_0x32e4fc[_0x4a3e('0x18')][_0x4a3e('0x19')]||null:null,'attributes':_0x32e4fc['options']?_0x32e4fc['options'][_0x4a3e('0x1a')]||null:null,'limit':_0x32e4fc[_0x4a3e('0x18')]?_0x32e4fc[_0x4a3e('0x18')][_0x4a3e('0x1b')]||null:null,'include':_0x32e4fc[_0x4a3e('0x18')]?_0x32e4fc[_0x4a3e('0x18')][_0x4a3e('0x1c')]?_[_0x4a3e('0x1d')](_0x32e4fc[_0x4a3e('0x18')][_0x4a3e('0x1c')],function(_0x483634){return{'model':db[_0x483634['model']],'as':_0x483634['as'],'attributes':_0x483634[_0x4a3e('0x1a')],'include':_0x483634[_0x4a3e('0x1c')]?_[_0x4a3e('0x1d')](_0x483634[_0x4a3e('0x1c')],function(_0x569731){return{'model':db[_0x569731['model']],'as':_0x569731['as'],'attributes':_0x569731[_0x4a3e('0x1a')],'include':_0x569731['include']?_[_0x4a3e('0x1d')](_0x569731[_0x4a3e('0x1c')],function(_0x193e9f){return{'model':db[_0x193e9f[_0x4a3e('0x1e')]],'as':_0x193e9f['as'],'attributes':_0x193e9f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xe8b352){logger[_0x4a3e('0xb')](_0x4a3e('0x16'),_0x32e4fc);logger[_0x4a3e('0xd')](_0x4a3e('0x16'),_0x32e4fc,JSON[_0x4a3e('0x10')](_0xe8b352));_0x1beaf1(_0xe8b352);})[_0x4a3e('0x15')](function(_0x16a6ea){logger['error'](_0x4a3e('0x16'),_0x16a6ea[_0x4a3e('0x13')],_0x32e4fc);_0x2baf4a(_0x1bd780[_0x4a3e('0x11')](0x1f4,_0x16a6ea['message']));});});};exports[_0x4a3e('0x1f')]=function(_0x39c14d){var _0x37db6d=this;return new Promise(function(_0x304c6d,_0x509ada){return db['Trigger'][_0x4a3e('0x20')]({'raw':_0x39c14d['options']?_0x39c14d['options'][_0x4a3e('0x21')]===undefined?!![]:![]:!![],'where':_0x39c14d[_0x4a3e('0x18')]?_0x39c14d['options'][_0x4a3e('0x19')]||null:null,'attributes':_0x39c14d[_0x4a3e('0x18')]?_0x39c14d['options'][_0x4a3e('0x1a')]||null:null,'include':_0x39c14d[_0x4a3e('0x18')]?_0x39c14d[_0x4a3e('0x18')][_0x4a3e('0x1c')]?_['map'](_0x39c14d[_0x4a3e('0x18')][_0x4a3e('0x1c')],function(_0x2c11e5){return{'model':db[_0x2c11e5['model']],'as':_0x2c11e5['as'],'attributes':_0x2c11e5['attributes'],'include':_0x2c11e5[_0x4a3e('0x1c')]?_[_0x4a3e('0x1d')](_0x2c11e5['include'],function(_0x392d33){return{'model':db[_0x392d33[_0x4a3e('0x1e')]],'as':_0x392d33['as'],'attributes':_0x392d33[_0x4a3e('0x1a')],'include':_0x392d33['include']?_['map'](_0x392d33[_0x4a3e('0x1c')],function(_0x115118){return{'model':db[_0x115118[_0x4a3e('0x1e')]],'as':_0x115118['as'],'attributes':_0x115118[_0x4a3e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4a3e('0xa')](function(_0x3ac77a){logger[_0x4a3e('0xb')](_0x4a3e('0x1f'),_0x39c14d);logger[_0x4a3e('0xd')](_0x4a3e('0x1f'),_0x39c14d,JSON[_0x4a3e('0x10')](_0x3ac77a));_0x304c6d(_0x3ac77a);})[_0x4a3e('0x15')](function(_0x23e477){logger[_0x4a3e('0x11')](_0x4a3e('0x1f'),_0x23e477[_0x4a3e('0x13')],_0x39c14d);_0x509ada(_0x37db6d['error'](0x1f4,_0x23e477[_0x4a3e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 46f0ba8..5970027 100644 --- a/server/api/trunk/index.js +++ b/server/api/trunk/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4a4=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id','isAuthenticated','show','clone','create','put','update','destroy','exports','multer','express','Router'];(function(_0x580542,_0x1f56d6){var _0x2f7c7d=function(_0x27daaf){while(--_0x27daaf){_0x580542['push'](_0x580542['shift']());}};_0x2f7c7d(++_0x1f56d6);}(_0xc4a4,0xa8));var _0x4c4a=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xc4a4[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x4c4a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4c4a('0x1'));var router=express[_0x4c4a('0x2')]();var fs_extra=require(_0x4c4a('0x3'));var auth=require(_0x4c4a('0x4'));var interaction=require(_0x4c4a('0x5'));var config=require(_0x4c4a('0x6'));var controller=require(_0x4c4a('0x7'));router[_0x4c4a('0x8')]('/',auth['isAuthenticated'](),controller[_0x4c4a('0x9')]);router['get'](_0x4c4a('0xa'),auth[_0x4c4a('0xb')](),controller[_0x4c4a('0xc')]);router['post']('/:id/clone',auth[_0x4c4a('0xb')](),controller[_0x4c4a('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4c4a('0xe')]);router[_0x4c4a('0xf')](_0x4c4a('0xa'),auth[_0x4c4a('0xb')](),controller[_0x4c4a('0x10')]);router['delete'](_0x4c4a('0xa'),auth['isAuthenticated'](),controller[_0x4c4a('0x11')]);module[_0x4c4a('0x12')]=router; \ No newline at end of file +var _0xddcf=['/:id','post','/:id/clone','delete','destroy','exports','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index'];(function(_0x1bc5fe,_0x271978){var _0x441ec7=function(_0x382ec6){while(--_0x382ec6){_0x1bc5fe['push'](_0x1bc5fe['shift']());}};_0x441ec7(++_0x271978);}(_0xddcf,0x116));var _0xfddc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xddcf[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfddc('0x0'));var timeout=require('connect-timeout');var express=require(_0xfddc('0x1'));var router=express[_0xfddc('0x2')]();var fs_extra=require(_0xfddc('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfddc('0x4'));var config=require(_0xfddc('0x5'));var controller=require(_0xfddc('0x6'));router[_0xfddc('0x7')]('/',auth[_0xfddc('0x8')](),controller[_0xfddc('0x9')]);router[_0xfddc('0x7')](_0xfddc('0xa'),auth[_0xfddc('0x8')](),controller['show']);router[_0xfddc('0xb')](_0xfddc('0xc'),auth[_0xfddc('0x8')](),controller['clone']);router[_0xfddc('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfddc('0xd')]('/:id',auth[_0xfddc('0x8')](),controller[_0xfddc('0xe')]);module[_0xfddc('0xf')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 354fb15..79c7664 100644 --- a/server/api/trunk/trunk.attributes.js +++ b/server/api/trunk/trunk.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ae8=['active','passive','actpass','update,nonat','BOOLEAN','exports','user','peer','friend','STRING','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','nonat','update','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','yes','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','originate','uac','uas','pai','fingerprint','certificate'];(function(_0x17db8c,_0x33804e){var _0x2ba9d6=function(_0x2dce68){while(--_0x2dce68){_0x17db8c['push'](_0x17db8c['shift']());}};_0x2ba9d6(++_0x33804e);}(_0x5ae8,0x13d));var _0x85ae=function(_0x47146b,_0x179a47){_0x47146b=_0x47146b-0x0;var _0x227ed6=_0x5ae8[_0x47146b];return _0x227ed6;};'use strict';var Sequelize=require('sequelize');module[_0x85ae('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0x85ae('0x1'),_0x85ae('0x2')),'allowNull':![],'defaultValue':_0x85ae('0x3')},'context':{'type':Sequelize[_0x85ae('0x4')],'allowNull':![],'defaultValue':_0x85ae('0x5')},'callingpres':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x7'),_0x85ae('0x8'),_0x85ae('0x9'),_0x85ae('0xa'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x85ae('0xb'),_0x85ae('0xc'))},'deny':{'type':Sequelize[_0x85ae('0x4')]},'permit':{'type':Sequelize[_0x85ae('0x4')]},'secret':{'type':Sequelize[_0x85ae('0x4')]},'md5secret':{'type':Sequelize[_0x85ae('0x4')]},'remotesecret':{'type':Sequelize[_0x85ae('0x4')]},'transport':{'type':Sequelize[_0x85ae('0x4')],'defaultValue':_0x85ae('0xd'),'set':function(_0x1dac7c){this[_0x85ae('0xe')]('transport',_0x1dac7c?_0x1dac7c['join'](','):null);},'get':function(){return this[_0x85ae('0xf')](_0x85ae('0x10'))?this[_0x85ae('0xf')](_0x85ae('0x10'))[_0x85ae('0x11')](','):null;},'comment':_0x85ae('0x12')},'dtmfmode':{'type':Sequelize[_0x85ae('0x6')]('rfc2833',_0x85ae('0x13'),_0x85ae('0x14'),_0x85ae('0x15'),_0x85ae('0x16')),'defaultValue':_0x85ae('0x17')},'directmedia':{'type':Sequelize[_0x85ae('0x6')]('yes','no',_0x85ae('0x18'),_0x85ae('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x85ae('0x6')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x85ae('0x4')]},'directmediadeny':{'type':Sequelize[_0x85ae('0x4')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x85ae('0x1a'),'set':function(_0x1c6faf){this[_0x85ae('0xe')](_0x85ae('0x1b'),_0x1c6faf?_0x1c6faf[_0x85ae('0x1c')](','):null);},'get':function(){return this[_0x85ae('0xf')](_0x85ae('0x1b'))?this[_0x85ae('0xf')](_0x85ae('0x1b'))[_0x85ae('0x11')](','):null;},'comment':_0x85ae('0x1d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x85ae('0x4')]},'language':{'type':Sequelize[_0x85ae('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x85ae('0x4')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x85ae('0x4')],'defaultValue':_0x85ae('0x1e')},'allow':{'type':Sequelize[_0x85ae('0x4')],'allowNull':![],'defaultValue':_0x85ae('0x1f'),'set':function(_0x1a1575){this[_0x85ae('0xe')]('allow',_0x1a1575?_0x1a1575[_0x85ae('0x1c')](';'):_0x85ae('0x1f'));},'get':function(){return this[_0x85ae('0xf')](_0x85ae('0x20'))?this[_0x85ae('0xf')](_0x85ae('0x20'))[_0x85ae('0x11')](';'):null;},'comment':_0x85ae('0x21')},'autoframing':{'type':Sequelize['ENUM'](_0x85ae('0x22'),'no')},'insecure':{'type':Sequelize[_0x85ae('0x4')],'defaultValue':'port,invite','set':function(_0x8fb57f){this[_0x85ae('0xe')](_0x85ae('0x23'),_0x8fb57f?_0x8fb57f[_0x85ae('0x1c')](','):null);},'get':function(){return this[_0x85ae('0xf')](_0x85ae('0x23'))?this['getDataValue'](_0x85ae('0x23'))[_0x85ae('0x11')](','):null;},'comment':_0x85ae('0x24')},'trustrpid':{'type':Sequelize[_0x85ae('0x6')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x85ae('0x22'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x22'),'no','never')},'promiscredir':{'type':Sequelize[_0x85ae('0x6')]('yes','no')},'useclientcode':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x22'),'no')},'accountcode':{'type':Sequelize[_0x85ae('0x25')](0xb)},'setvar':{'type':Sequelize[_0x85ae('0x4')]},'callerid':{'type':Sequelize[_0x85ae('0x4')],'defaultValue':_0x85ae('0x26')},'amaflags':{'type':Sequelize[_0x85ae('0x4')]},'callcounter':{'type':Sequelize['ENUM'](_0x85ae('0x22'),'no'),'defaultValue':_0x85ae('0x22')},'busylevel':{'type':Sequelize[_0x85ae('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x22'),'no')},'allowsubscribe':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x22'),'no')},'allowtransfer':{'type':Sequelize[_0x85ae('0x6')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x22'),'no')},'subscribecontext':{'type':Sequelize[_0x85ae('0x4')]},'template':{'type':Sequelize[_0x85ae('0x4')]},'videosupport':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x22'),'no',_0x85ae('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x85ae('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x22'),'no')},'mailbox':{'type':Sequelize[_0x85ae('0x4')]},'session_timers':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x28'),'refuse',_0x85ae('0x29'))},'session_expires':{'type':Sequelize[_0x85ae('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x85ae('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x2a'),_0x85ae('0x2b')),'defaultValue':_0x85ae('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x85ae('0x4')]},'regexten':{'type':Sequelize[_0x85ae('0x4')]},'fromdomain':{'type':Sequelize[_0x85ae('0x4')]},'fromuser':{'type':Sequelize[_0x85ae('0x4')]},'port':{'type':Sequelize[_0x85ae('0x25')](0x5)},'qualify':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x22'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x85ae('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x85ae('0x4')]},'defaultuser':{'type':Sequelize[_0x85ae('0x4')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x85ae('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x85ae('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x85ae('0x6')]('yes','no',_0x85ae('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x85ae('0x4')]},'timert1':{'type':Sequelize[_0x85ae('0x25')](0xb)},'timerb':{'type':Sequelize[_0x85ae('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x85ae('0x4')]},'contactdeny':{'type':Sequelize[_0x85ae('0x4')]},'contactacl':{'type':Sequelize[_0x85ae('0x4')]},'unsolicited_mailbox':{'type':Sequelize[_0x85ae('0x4')]},'use_q850_reason':{'type':Sequelize[_0x85ae('0x4')]},'maxforwards':{'type':Sequelize[_0x85ae('0x25')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x85ae('0x22'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x22'),'no')},'force_avp':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x22'),'no')},'icesupport':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x22'),'no')},'dtlsenable':{'type':Sequelize[_0x85ae('0x6')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x22'),'no',_0x85ae('0x2d'),_0x85ae('0x2e'))},'dtlsrekey':{'type':Sequelize[_0x85ae('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x85ae('0x4')]},'dtlsprivatekey':{'type':Sequelize[_0x85ae('0x4')]},'dtlscipher':{'type':Sequelize[_0x85ae('0x4')]},'dtlscafile':{'type':Sequelize[_0x85ae('0x4')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0x85ae('0x2f'),_0x85ae('0x30'),_0x85ae('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x22'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x85ae('0x4')]},'call_limit':{'type':Sequelize[_0x85ae('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x22'),'no')},'subscribemwi':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x22'),'no')},'vmexten':{'type':Sequelize[_0x85ae('0x4')]},'mohinterpret':{'type':Sequelize[_0x85ae('0x4')]},'mohsuggest':{'type':Sequelize[_0x85ae('0x4')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x85ae('0x4')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x85ae('0x6')](_0x85ae('0x22'),'no','nonat',_0x85ae('0x19'),_0x85ae('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x85ae('0x4')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x85ae('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x85ae('0x4')],'defaultValue':'no'}}; \ No newline at end of file +var _0x44bd=['active','passive','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name','ENUM','user','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','inband','auto','rfc2833','nonat','update','yes','force_rport,comedia','nat','all','allow','join','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','INTEGER','accept','refuse','uac','uas','pai','fingerprint'];(function(_0x56081e,_0x28178d){var _0x489e03=function(_0x2c9525){while(--_0x2c9525){_0x56081e['push'](_0x56081e['shift']());}};_0x489e03(++_0x28178d);}(_0x44bd,0x119));var _0xd44b=function(_0x2c0a23,_0x5e7678){_0x2c0a23=_0x2c0a23-0x0;var _0x415df4=_0x44bd[_0x2c0a23];return _0x415df4;};'use strict';var Sequelize=require(_0xd44b('0x0'));module['exports']={'name':{'type':Sequelize[_0xd44b('0x1')],'allowNull':![],'unique':_0xd44b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd44b('0x3')]('friend',_0xd44b('0x4'),'peer'),'allowNull':![],'defaultValue':_0xd44b('0x5')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd44b('0x6')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0xd44b('0x7'),'ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED',_0xd44b('0x8'),_0xd44b('0x9'),_0xd44b('0xa'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xd44b('0x1')]},'secret':{'type':Sequelize[_0xd44b('0x1')]},'md5secret':{'type':Sequelize[_0xd44b('0x1')]},'remotesecret':{'type':Sequelize[_0xd44b('0x1')]},'transport':{'type':Sequelize[_0xd44b('0x1')],'defaultValue':'udp','set':function(_0x21a8be){this[_0xd44b('0xb')](_0xd44b('0xc'),_0x21a8be?_0x21a8be['join'](','):null);},'get':function(){return this[_0xd44b('0xd')]('transport')?this['getDataValue'](_0xd44b('0xc'))[_0xd44b('0xe')](','):null;},'comment':_0xd44b('0xf')},'dtmfmode':{'type':Sequelize[_0xd44b('0x3')]('rfc2833',_0xd44b('0x10'),'shortinfo',_0xd44b('0x11'),_0xd44b('0x12')),'defaultValue':_0xd44b('0x13')},'directmedia':{'type':Sequelize[_0xd44b('0x3')]('yes','no',_0xd44b('0x14'),_0xd44b('0x15'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd44b('0x3')](_0xd44b('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd44b('0x1')]},'directmediadeny':{'type':Sequelize[_0xd44b('0x1')]},'nat':{'type':Sequelize[_0xd44b('0x1')],'defaultValue':_0xd44b('0x17'),'set':function(_0x1acc9c){this[_0xd44b('0xb')](_0xd44b('0x18'),_0x1acc9c?_0x1acc9c['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0xd44b('0xd')](_0xd44b('0x18'))[_0xd44b('0xe')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xd44b('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xd44b('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd44b('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xd44b('0x19')},'allow':{'type':Sequelize[_0xd44b('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x554416){this['setDataValue'](_0xd44b('0x1a'),_0x554416?_0x554416[_0xd44b('0x1b')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xd44b('0xd')](_0xd44b('0x1a'))?this[_0xd44b('0xd')](_0xd44b('0x1a'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xd44b('0x16'),'no')},'insecure':{'type':Sequelize[_0xd44b('0x1')],'defaultValue':_0xd44b('0x1c'),'set':function(_0x32e2d8){this[_0xd44b('0xb')](_0xd44b('0x1d'),_0x32e2d8?_0x32e2d8[_0xd44b('0x1b')](','):null);},'get':function(){return this[_0xd44b('0xd')](_0xd44b('0x1d'))?this[_0xd44b('0xd')](_0xd44b('0x1d'))[_0xd44b('0xe')](','):null;},'comment':_0xd44b('0x1e')},'trustrpid':{'type':Sequelize[_0xd44b('0x3')](_0xd44b('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd44b('0x3')](_0xd44b('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd44b('0x3')]('yes','no',_0xd44b('0x1f'))},'promiscredir':{'type':Sequelize['ENUM'](_0xd44b('0x16'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xd44b('0x16'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xd44b('0x1')],'defaultValue':_0xd44b('0x20')},'amaflags':{'type':Sequelize[_0xd44b('0x1')]},'callcounter':{'type':Sequelize['ENUM'](_0xd44b('0x16'),'no'),'defaultValue':_0xd44b('0x16')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xd44b('0x3')](_0xd44b('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0xd44b('0x3')](_0xd44b('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0xd44b('0x3')](_0xd44b('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0xd44b('0x1')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0xd44b('0x16'),'no',_0xd44b('0x21')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd44b('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0xd44b('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0xd44b('0x23'),_0xd44b('0x24'),'originate')},'session_expires':{'type':Sequelize[_0xd44b('0x22')](0xb)},'session_minse':{'type':Sequelize[_0xd44b('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0xd44b('0x3')](_0xd44b('0x25'),_0xd44b('0x26')),'defaultValue':_0xd44b('0x26')},'t38pt_usertpsource':{'type':Sequelize[_0xd44b('0x1')]},'regexten':{'type':Sequelize[_0xd44b('0x1')]},'fromdomain':{'type':Sequelize[_0xd44b('0x1')]},'fromuser':{'type':Sequelize[_0xd44b('0x1')]},'port':{'type':Sequelize[_0xd44b('0x22')](0x5)},'qualify':{'type':Sequelize[_0xd44b('0x3')](_0xd44b('0x16'),'no'),'defaultValue':_0xd44b('0x16')},'keepalive':{'type':Sequelize[_0xd44b('0x22')](0xb)},'defaultip':{'type':Sequelize[_0xd44b('0x1')]},'defaultuser':{'type':Sequelize[_0xd44b('0x1')]},'rtptimeout':{'type':Sequelize[_0xd44b('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xd44b('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0xd44b('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd44b('0x1')]},'callbackextension':{'type':Sequelize[_0xd44b('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xd44b('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0xd44b('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0xd44b('0x1')]},'contactdeny':{'type':Sequelize[_0xd44b('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xd44b('0x1')]},'maxforwards':{'type':Sequelize[_0xd44b('0x22')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xd44b('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0xd44b('0x3')](_0xd44b('0x16'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xd44b('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0xd44b('0x3')](_0xd44b('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0xd44b('0x3')](_0xd44b('0x16'),'no',_0xd44b('0x28'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xd44b('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xd44b('0x1')]},'dtlscipher':{'type':Sequelize[_0xd44b('0x1')]},'dtlscafile':{'type':Sequelize[_0xd44b('0x1')]},'dtlscapath':{'type':Sequelize[_0xd44b('0x1')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xd44b('0x29'),_0xd44b('0x2a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd44b('0x1')]},'usereqphone':{'type':Sequelize[_0xd44b('0x3')](_0xd44b('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd44b('0x1')]},'recordofffeature':{'type':Sequelize[_0xd44b('0x1')]},'call_limit':{'type':Sequelize[_0xd44b('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xd44b('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0xd44b('0x3')](_0xd44b('0x16'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xd44b('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xd44b('0x1')],'defaultValue':_0xd44b('0x2b')},'canreinvite':{'type':Sequelize['ENUM'](_0xd44b('0x16'),'no',_0xd44b('0x14'),_0xd44b('0x15'),_0xd44b('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xd44b('0x1')]},'otherFields':{'type':Sequelize[_0xd44b('0x1')]},'active':{'type':Sequelize[_0xd44b('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 4e7b93d..5753054 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b3=['then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','clone','find','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request'];(function(_0x431ff8,_0x4085dd){var _0x84ccd4=function(_0x1fd1b5){while(--_0x1fd1b5){_0x431ff8['push'](_0x431ff8['shift']());}};_0x84ccd4(++_0x4085dd);}(_0xe5b3,0x133));var _0x3e5b=function(_0x200770,_0x4391ed){_0x200770=_0x200770-0x0;var _0x303db6=_0xe5b3[_0x200770];return _0x303db6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];var jayson=require(_0x3e5b('0x19'));var client=jayson[_0x3e5b('0x1a')][_0x3e5b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x405e70,_0x560010,_0x39a2a1,_0x5f2f9c){return new BPromise(function(_0x51a188,_0x4d71a3){var _0x3754e3=_0x5f2f9c||client;return _0x3754e3[_0x3e5b('0x1c')](_0x405e70,_0x39a2a1)[_0x3e5b('0x1d')](function(_0x4fb471){logger[_0x3e5b('0x1e')]('Trunk,\x20%s,\x20%s',_0x560010,'request\x20sent');logger[_0x3e5b('0x1f')](_0x3e5b('0x20'),_0x560010,'request\x20sent',JSON[_0x3e5b('0x21')](_0x4fb471));if(_0x4fb471[_0x3e5b('0x22')]){if(_0x4fb471['error'][_0x3e5b('0x23')]===0x1f4){logger[_0x3e5b('0x22')]('Trunk,\x20%s,\x20%s',_0x560010,_0x4fb471['error'][_0x3e5b('0x24')]);return _0x4d71a3(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);return _0x51a188(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}else{logger[_0x3e5b('0x1e')](_0x3e5b('0x25'),_0x560010,_0x3e5b('0x26'));_0x51a188(_0x4fb471[_0x3e5b('0x27')][_0x3e5b('0x24')]);}})['catch'](function(_0x433f9c){logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x433f9c);_0x4d71a3(_0x433f9c);});});}function respondWithStatusCode(_0x150674,_0x50039b){_0x50039b=_0x50039b||0xcc;return function(_0x1eb80f){if(_0x1eb80f){return _0x150674['sendStatus'](_0x50039b);}return _0x150674[_0x3e5b('0x28')](_0x50039b)[_0x3e5b('0x29')]();};}function respondWithResult(_0x4d5e61,_0x41b684){_0x41b684=_0x41b684||0xc8;return function(_0x2f6368){if(_0x2f6368){return _0x4d5e61[_0x3e5b('0x28')](_0x41b684)[_0x3e5b('0x2a')](_0x2f6368);}};}function respondWithFilteredResult(_0x3bb749,_0x26c7f2){return function(_0x160e87){if(_0x160e87){var _0x2ddf57=typeof _0x26c7f2['offset']===_0x3e5b('0x2b')&&typeof _0x26c7f2['limit']===_0x3e5b('0x2b');var _0x4fd64b=_0x160e87[_0x3e5b('0x2c')];var _0x1f6473=_0x2ddf57?0x0:_0x26c7f2[_0x3e5b('0x2d')];var _0x475b39=_0x2ddf57?_0x160e87[_0x3e5b('0x2c')]:_0x26c7f2[_0x3e5b('0x2d')]+_0x26c7f2[_0x3e5b('0x2e')];var _0x9c2123;if(_0x475b39>=_0x4fd64b){_0x475b39=_0x4fd64b;_0x9c2123=0xc8;}else{_0x9c2123=0xce;}_0x3bb749[_0x3e5b('0x28')](_0x9c2123);return _0x3bb749[_0x3e5b('0x2f')](_0x3e5b('0x30'),_0x1f6473+'-'+_0x475b39+'/'+_0x4fd64b)['json'](_0x160e87);}return null;};}function patchUpdates(_0x21bc10){return function(_0x1882aa){try{jsonpatch[_0x3e5b('0x31')](_0x1882aa,_0x21bc10,!![]);}catch(_0x2a14eb){return BPromise[_0x3e5b('0x32')](_0x2a14eb);}return _0x1882aa[_0x3e5b('0x33')]();};}function saveUpdates(_0x345927,_0x4c4e01){return function(_0x33f089){if(_0x33f089){return _0x33f089['update'](_0x345927)['then'](function(_0x32c6b0){return _0x32c6b0;});}return null;};}function removeEntity(_0x78d68a,_0x51ea0d){return function(_0x40e37d){if(_0x40e37d){return _0x40e37d[_0x3e5b('0x34')]()[_0x3e5b('0x1d')](function(){var _0x33e356=_0x40e37d[_0x3e5b('0x35')]({'plain':!![]});var _0x26f842=_0x3e5b('0x36');return db[_0x3e5b('0x37')][_0x3e5b('0x34')]({'where':{'type':_0x26f842,'resourceId':_0x33e356['id']}})[_0x3e5b('0x1d')](function(){return _0x40e37d;});})[_0x3e5b('0x1d')](function(){_0x78d68a[_0x3e5b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x141b7e,_0xec45c5){return function(_0x53caa2){if(!_0x53caa2){_0x141b7e['sendStatus'](0x194);}return _0x53caa2;};}function handleError(_0x471196,_0x56d7ef){_0x56d7ef=_0x56d7ef||0x1f4;return function(_0x2939da){logger[_0x3e5b('0x22')](_0x2939da[_0x3e5b('0x38')]);if(_0x2939da[_0x3e5b('0x39')]){delete _0x2939da['name'];}_0x471196[_0x3e5b('0x28')](_0x56d7ef)['send'](_0x2939da);};}exports[_0x3e5b('0x3a')]=function(_0x5ec841,_0x47f7c8){var _0x48f414={},_0x10c202={},_0x174ebf={'count':0x0,'rows':[]};var _0x2eaa30=_[_0x3e5b('0x3b')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')],function(_0x5466ac){return{'name':_0x5466ac['fieldName'],'type':_0x5466ac['type']['key']};});_0x10c202['model']=_['map'](_0x2eaa30,'name');_0x10c202[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x5ec841[_0x3e5b('0x3e')]);_0x10c202[_0x3e5b('0x40')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],_0x10c202[_0x3e5b('0x3e')]);_0x48f414[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x5ec841['query'][_0x3e5b('0x44')]));_0x48f414[_0x3e5b('0x43')]=_0x48f414[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x48f414[_0x3e5b('0x43')]:_0x10c202[_0x3e5b('0x42')];if(!_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x46')](_0x3e5b('0x47'))){_0x48f414[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x5ec841['query']['limit']);_0x48f414['offset']=qs['offset'](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x2d')]);}_0x48f414[_0x3e5b('0x48')]=qs[_0x3e5b('0x49')](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x49')]);_0x48f414[_0x3e5b('0x4a')]=qs[_0x3e5b('0x40')](_[_0x3e5b('0x4b')](_0x5ec841[_0x3e5b('0x3e')],_0x10c202['filters']),_0x2eaa30);if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x4c')]){_0x48f414[_0x3e5b('0x4a')]=_[_0x3e5b('0x4d')](_0x48f414[_0x3e5b('0x4a')],{'$or':_['map'](_0x2eaa30,function(_0x588ee7){if(_0x588ee7['type']!==_0x3e5b('0x4e')){var _0x20af6a={};_0x20af6a[_0x588ee7[_0x3e5b('0x39')]]={'$like':'%'+_0x5ec841['query']['filter']+'%'};return _0x20af6a;}})});}_0x48f414=_[_0x3e5b('0x4d')]({},_0x48f414,_0x5ec841[_0x3e5b('0x4f')]);var _0x123947={'where':_0x48f414['where']};return db['Trunk'][_0x3e5b('0x2c')](_0x123947)['then'](function(_0x14b62a){_0x174ebf[_0x3e5b('0x2c')]=_0x14b62a;if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x48f414[_0x3e5b('0x51')]=[{'all':!![]}];}return db[_0x3e5b('0x3c')][_0x3e5b('0x52')](_0x48f414);})[_0x3e5b('0x1d')](function(_0x339852){_0x174ebf['rows']=_0x339852;return _0x174ebf;})[_0x3e5b('0x1d')](respondWithFilteredResult(_0x47f7c8,_0x48f414))['catch'](handleError(_0x47f7c8,null));};exports[_0x3e5b('0x53')]=function(_0x2e7047,_0x26e11e){var _0x3d51fa={'raw':![],'where':{'id':_0x2e7047[_0x3e5b('0x54')]['id']}},_0x291e4d={};_0x291e4d[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x291e4d[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x2e7047[_0x3e5b('0x3e')]);_0x291e4d['filters']=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],_0x291e4d[_0x3e5b('0x3e')]);_0x3d51fa[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],qs['fields'](_0x2e7047[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x3d51fa[_0x3e5b('0x43')]=_0x3d51fa[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x3d51fa[_0x3e5b('0x43')]:_0x291e4d[_0x3e5b('0x42')];if(_0x2e7047[_0x3e5b('0x3e')]['includeAll']){_0x3d51fa[_0x3e5b('0x51')]=[{'all':!![]}];}_0x3d51fa=_['merge']({},_0x3d51fa,_0x2e7047['options']);return db[_0x3e5b('0x3c')]['find'](_0x3d51fa)[_0x3e5b('0x1d')](handleEntityNotFound(_0x26e11e,null))[_0x3e5b('0x1d')](respondWithResult(_0x26e11e,null))[_0x3e5b('0x55')](handleError(_0x26e11e,null));};exports[_0x3e5b('0x56')]=function(_0x4a492b,_0x5ddeee){var _0x545712={'where':{'id':_0x4a492b[_0x3e5b('0x54')]['id']}},_0x581b94={};_0x581b94[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x545712['attributes']=_['intersection'](_0x581b94[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x545712[_0x3e5b('0x43')]=_0x545712['attributes']['length']?_0x545712['attributes']:_0x581b94['model'];if(_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x545712[_0x3e5b('0x51')]=[{'all':!![]}];}_0x545712=_[_0x3e5b('0x4d')]({},_0x545712,_0x4a492b[_0x3e5b('0x4f')]);return db[_0x3e5b('0x3c')][_0x3e5b('0x57')](_0x545712)[_0x3e5b('0x1d')](handleEntityNotFound(_0x5ddeee,null))['then'](function(_0x285db6){if(_0x285db6){var _0x29897b=_0x285db6[_0x3e5b('0x35')]({'plain':!![]});_0x29897b=qs[_0x3e5b('0x58')](_0x29897b,['id',_0x3e5b('0x59'),'updatedAt']);_0x4a492b[_0x3e5b('0x5a')]=_['omit'](_0x4a492b[_0x3e5b('0x5a')],['id',_0x3e5b('0x59'),'updatedAt']);return db['Trunk']['create'](_[_0x3e5b('0x4d')](_0x29897b,_0x4a492b['body']),{'include':_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]?[{'all':!![]}]:undefined})[_0x3e5b('0x1d')](function(_0x40197c){var _0x14f187=_0x4a492b['user']['get']({'plain':!![]});if(!_0x14f187)throw new Error(_0x3e5b('0x5b'));if(_0x14f187[_0x3e5b('0x5c')]===_0x3e5b('0x5d')){var _0x4dfb45=_0x40197c[_0x3e5b('0x35')]({'plain':!![]});var _0x3c5293=_0x3e5b('0x36');return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3c5293,'userProfileId':_0x14f187[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x4a1ce3){if(_0x4a1ce3&&_0x4a1ce3[_0x3e5b('0x60')]===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x4dfb45[_0x3e5b('0x39')],'resourceId':_0x4dfb45['id'],'type':_0x4a1ce3[_0x3e5b('0x39')],'sectionId':_0x4a1ce3['id']},{})[_0x3e5b('0x1d')](function(){return _0x40197c;});}else{return _0x40197c;}})[_0x3e5b('0x55')](function(_0x2411c3){logger[_0x3e5b('0x22')](_0x3e5b('0x62'),_0x2411c3);throw _0x2411c3;});}return _0x40197c;});}})['then'](respondWithResult(_0x5ddeee,0xc9))[_0x3e5b('0x55')](handleError(_0x5ddeee,null));};exports[_0x3e5b('0x61')]=function(_0x5af305,_0x177144,_0x31ef31){var _0x561c78;return db['Trunk']['create'](_0x5af305[_0x3e5b('0x5a')],{'raw':!![]})[_0x3e5b('0x1d')](function(_0x498e6d){_0x561c78=_0x498e6d;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});})['then'](function(_0x3d3bf2){var _0x17f60f=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0x410c7a=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x40103e=ejs[_0x3e5b('0x69')](_0x17f60f,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x40103e);if(_0x561c78['registry']){var _0x590f0c=ejs[_0x3e5b('0x69')](_0x410c7a,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x590f0c);}})[_0x3e5b('0x1d')](function(){return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x61'),{'module':_0x3e5b('0x6d')});})[_0x3e5b('0x1d')](function(){var _0x9deb09=_0x5af305[_0x3e5b('0x5d')]['get']({'plain':!![]});if(!_0x9deb09)throw new Error(_0x3e5b('0x5b'));if(_0x9deb09[_0x3e5b('0x5c')]==='user'){var _0x577747=_0x561c78['get']({'plain':!![]});return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3e5b('0x36'),'userProfileId':_0x9deb09[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x1ba550){if(_0x1ba550&&_0x1ba550['autoAssociation']===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x577747['name'],'resourceId':_0x577747['id'],'type':_0x1ba550[_0x3e5b('0x39')],'sectionId':_0x1ba550['id']},{})['then'](function(){return _0x561c78;});}else{return _0x561c78;}})['catch'](function(_0x211e73){logger[_0x3e5b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211e73);throw _0x211e73;});}return _0x561c78;})[_0x3e5b('0x1d')](respondWithResult(_0x177144,0xc9))[_0x3e5b('0x55')](handleError(_0x177144,null));};exports['update']=function(_0x2e36af,_0x185640,_0x14baa9){var _0x1425eb;return db[_0x3e5b('0x3c')][_0x3e5b('0x57')]({'where':{'id':_0x2e36af['params']['id']}})['then'](handleEntityNotFound(_0x185640,null))[_0x3e5b('0x1d')](saveUpdates(_0x2e36af['body'],null))['then'](function(_0x25d3d8){if(_0x25d3d8){_0x1425eb=_0x25d3d8;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});}})['then'](function(_0x2e5fa3){if(_0x2e5fa3){var _0x4b8d19=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0xdf2677=fs['readFileSync'](path[_0x3e5b('0x64')](config['root'],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x58ccf3=ejs[_0x3e5b('0x69')](_0x4b8d19,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x58ccf3);var _0x5ad011=ejs[_0x3e5b('0x69')](_0xdf2677,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5ad011);return respondWithRpcPromise('Reload',_0x3e5b('0x6f'),{'module':_0x3e5b('0x6d')});}return null;})['then'](function(_0xd9d941){if(_0xd9d941){return _0x1425eb;}})[_0x3e5b('0x1d')](respondWithResult(_0x185640,null))[_0x3e5b('0x55')](handleError(_0x185640,null));};exports['destroy']=function(_0x3b3306,_0x30e079,_0x352f7e){var _0x1d7c05;return db['Trunk'][_0x3e5b('0x57')]({'where':{'id':_0x3b3306['params']['id']}})[_0x3e5b('0x1d')](handleEntityNotFound(_0x30e079,null))['then'](removeEntity(_0x30e079,null))[_0x3e5b('0x1d')](function(){return db[_0x3e5b('0x3c')]['findAll']({'raw':!![]});})[_0x3e5b('0x1d')](function(_0x2299b9){var _0x56ff9d=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),'utf8');var _0x53328b=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x3d1193=ejs['render'](_0x56ff9d,{'trunks':_0x2299b9});var _0x5d6aae=ejs[_0x3e5b('0x69')](_0x53328b,{'trunks':_0x2299b9});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x3d1193);fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5d6aae);return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x34'),{'module':_0x3e5b('0x6d')});})['catch'](handleError(_0x30e079,null));}; \ No newline at end of file +var _0xedd9=['body','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','create','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Trunk,\x20%s,\x20%s','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','Trunks','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','Trunk','findAll','rows','show','params','length','find','omit'];(function(_0xf2f344,_0x509cdc){var _0x3e99f8=function(_0x121308){while(--_0x121308){_0xf2f344['push'](_0xf2f344['shift']());}};_0x3e99f8(++_0x509cdc);}(_0xedd9,0xfc));var _0x9edd=function(_0x368003,_0x1a83ea){_0x368003=_0x368003-0x0;var _0x5f31f1=_0xedd9[_0x368003];return _0x5f31f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];var jayson=require(_0x9edd('0x18'));var client=jayson[_0x9edd('0x19')][_0x9edd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xfca576,_0xef5498,_0x47eb64,_0x176bfa){return new BPromise(function(_0x44fc7c,_0x891832){var _0x4d9a7=_0x176bfa||client;return _0x4d9a7[_0x9edd('0x1b')](_0xfca576,_0x47eb64)[_0x9edd('0x1c')](function(_0x1042aa){logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x9edd('0x1e'));logger[_0x9edd('0x1f')](_0x9edd('0x20'),_0xef5498,'request\x20sent',JSON[_0x9edd('0x21')](_0x1042aa));if(_0x1042aa[_0x9edd('0x22')]){if(_0x1042aa[_0x9edd('0x22')]['code']===0x1f4){logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')][_0x9edd('0x23')]);return _0x891832(_0x1042aa['error']['message']);}logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')]['message']);return _0x44fc7c(_0x1042aa['error'][_0x9edd('0x23')]);}else{logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,'request\x20sent');_0x44fc7c(_0x1042aa[_0x9edd('0x24')][_0x9edd('0x23')]);}})[_0x9edd('0x25')](function(_0x542172){logger[_0x9edd('0x22')](_0x9edd('0x26'),_0xef5498,_0x542172);_0x891832(_0x542172);});});}function respondWithStatusCode(_0x44a6c1,_0x2ca65f){_0x2ca65f=_0x2ca65f||0xcc;return function(_0x339a0d){if(_0x339a0d){return _0x44a6c1['sendStatus'](_0x2ca65f);}return _0x44a6c1[_0x9edd('0x27')](_0x2ca65f)[_0x9edd('0x28')]();};}function respondWithResult(_0x3a1ea5,_0x2f9f86){_0x2f9f86=_0x2f9f86||0xc8;return function(_0x310a4d){if(_0x310a4d){return _0x3a1ea5['status'](_0x2f9f86)['json'](_0x310a4d);}};}function respondWithFilteredResult(_0x3276ee,_0xfeca7b){return function(_0x8d67aa){if(_0x8d67aa){var _0x25e135=typeof _0xfeca7b[_0x9edd('0x29')]==='undefined'&&typeof _0xfeca7b['limit']===_0x9edd('0x2a');var _0x257a26=_0x8d67aa[_0x9edd('0x2b')];var _0x52746a=_0x25e135?0x0:_0xfeca7b[_0x9edd('0x29')];var _0x28cfae=_0x25e135?_0x8d67aa[_0x9edd('0x2b')]:_0xfeca7b[_0x9edd('0x29')]+_0xfeca7b['limit'];var _0x2155a1;if(_0x28cfae>=_0x257a26){_0x28cfae=_0x257a26;_0x2155a1=0xc8;}else{_0x2155a1=0xce;}_0x3276ee[_0x9edd('0x27')](_0x2155a1);return _0x3276ee[_0x9edd('0x2c')](_0x9edd('0x2d'),_0x52746a+'-'+_0x28cfae+'/'+_0x257a26)[_0x9edd('0x2e')](_0x8d67aa);}return null;};}function patchUpdates(_0x42e664){return function(_0x209aba){try{jsonpatch[_0x9edd('0x2f')](_0x209aba,_0x42e664,!![]);}catch(_0x19b6c1){return BPromise[_0x9edd('0x30')](_0x19b6c1);}return _0x209aba[_0x9edd('0x31')]();};}function saveUpdates(_0x138002,_0x6907a5){return function(_0xa55906){if(_0xa55906){return _0xa55906[_0x9edd('0x32')](_0x138002)['then'](function(_0x1453d2){return _0x1453d2;});}return null;};}function removeEntity(_0x259259,_0x267c74){return function(_0x5d1707){if(_0x5d1707){return _0x5d1707[_0x9edd('0x33')]()[_0x9edd('0x1c')](function(){var _0xde9b13=_0x5d1707[_0x9edd('0x34')]({'plain':!![]});var _0x21bc30=_0x9edd('0x35');return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'type':_0x21bc30,'resourceId':_0xde9b13['id']}})[_0x9edd('0x1c')](function(){return _0x5d1707;});})[_0x9edd('0x1c')](function(){_0x259259[_0x9edd('0x27')](0xcc)[_0x9edd('0x28')]();});}};}function handleEntityNotFound(_0x27eb7e,_0x14f780){return function(_0x5757fc){if(!_0x5757fc){_0x27eb7e[_0x9edd('0x37')](0x194);}return _0x5757fc;};}function handleError(_0x5ed62d,_0x968303){_0x968303=_0x968303||0x1f4;return function(_0x148630){logger[_0x9edd('0x22')](_0x148630[_0x9edd('0x38')]);if(_0x148630[_0x9edd('0x39')]){delete _0x148630['name'];}_0x5ed62d[_0x9edd('0x27')](_0x968303)[_0x9edd('0x3a')](_0x148630);};}exports[_0x9edd('0x3b')]=function(_0x38e9be,_0x1be77f){var _0x337e6c={},_0x5c0627={},_0x1cbbac={'count':0x0,'rows':[]};var _0x1ccee8=_[_0x9edd('0x3c')](db['Trunk'][_0x9edd('0x3d')],function(_0x56a228){return{'name':_0x56a228[_0x9edd('0x3e')],'type':_0x56a228['type'][_0x9edd('0x3f')]};});_0x5c0627[_0x9edd('0x40')]=_[_0x9edd('0x3c')](_0x1ccee8,'name');_0x5c0627[_0x9edd('0x41')]=_[_0x9edd('0x42')](_0x38e9be[_0x9edd('0x41')]);_0x5c0627['filters']=_[_0x9edd('0x43')](_0x5c0627['model'],_0x5c0627[_0x9edd('0x41')]);_0x337e6c[_0x9edd('0x44')]=_['intersection'](_0x5c0627[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x45')]));_0x337e6c['attributes']=_0x337e6c[_0x9edd('0x44')]['length']?_0x337e6c[_0x9edd('0x44')]:_0x5c0627[_0x9edd('0x40')];if(!_0x38e9be['query'][_0x9edd('0x46')]('nolimit')){_0x337e6c['limit']=qs[_0x9edd('0x47')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x47')]);_0x337e6c[_0x9edd('0x29')]=qs[_0x9edd('0x29')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x29')]);}_0x337e6c[_0x9edd('0x48')]=qs[_0x9edd('0x49')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x49')]);_0x337e6c[_0x9edd('0x4a')]=qs[_0x9edd('0x4b')](_[_0x9edd('0x4c')](_0x38e9be[_0x9edd('0x41')],_0x5c0627['filters']),_0x1ccee8);if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x4d')]){_0x337e6c[_0x9edd('0x4a')]=_[_0x9edd('0x4e')](_0x337e6c[_0x9edd('0x4a')],{'$or':_[_0x9edd('0x3c')](_0x1ccee8,function(_0x10d41e){if(_0x10d41e['type']!=='VIRTUAL'){var _0x4bc7a1={};_0x4bc7a1[_0x10d41e[_0x9edd('0x39')]]={'$like':'%'+_0x38e9be['query'][_0x9edd('0x4d')]+'%'};return _0x4bc7a1;}})});}_0x337e6c=_[_0x9edd('0x4e')]({},_0x337e6c,_0x38e9be[_0x9edd('0x4f')]);var _0x8db801={'where':_0x337e6c[_0x9edd('0x4a')]};return db['Trunk'][_0x9edd('0x2b')](_0x8db801)[_0x9edd('0x1c')](function(_0x40e33d){_0x1cbbac['count']=_0x40e33d;if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x50')]){_0x337e6c[_0x9edd('0x51')]=[{'all':!![]}];}return db[_0x9edd('0x52')][_0x9edd('0x53')](_0x337e6c);})[_0x9edd('0x1c')](function(_0x4d4f33){_0x1cbbac[_0x9edd('0x54')]=_0x4d4f33;return _0x1cbbac;})[_0x9edd('0x1c')](respondWithFilteredResult(_0x1be77f,_0x337e6c))['catch'](handleError(_0x1be77f,null));};exports[_0x9edd('0x55')]=function(_0x8d8701,_0x4bb324){var _0x2bd089={'raw':![],'where':{'id':_0x8d8701[_0x9edd('0x56')]['id']}},_0x8134cd={};_0x8134cd['model']=_[_0x9edd('0x42')](db[_0x9edd('0x52')][_0x9edd('0x3d')]);_0x8134cd[_0x9edd('0x41')]=_['keys'](_0x8d8701[_0x9edd('0x41')]);_0x8134cd[_0x9edd('0x4b')]=_[_0x9edd('0x43')](_0x8134cd['model'],_0x8134cd[_0x9edd('0x41')]);_0x2bd089[_0x9edd('0x44')]=_['intersection'](_0x8134cd[_0x9edd('0x40')],qs['fields'](_0x8d8701[_0x9edd('0x41')][_0x9edd('0x45')]));_0x2bd089[_0x9edd('0x44')]=_0x2bd089[_0x9edd('0x44')][_0x9edd('0x57')]?_0x2bd089[_0x9edd('0x44')]:_0x8134cd[_0x9edd('0x40')];if(_0x8d8701[_0x9edd('0x41')][_0x9edd('0x50')]){_0x2bd089[_0x9edd('0x51')]=[{'all':!![]}];}_0x2bd089=_[_0x9edd('0x4e')]({},_0x2bd089,_0x8d8701['options']);return db[_0x9edd('0x52')][_0x9edd('0x58')](_0x2bd089)[_0x9edd('0x1c')](handleEntityNotFound(_0x4bb324,null))['then'](respondWithResult(_0x4bb324,null))[_0x9edd('0x25')](handleError(_0x4bb324,null));};exports['clone']=function(_0x54d83d,_0x54ecfa){var _0x1348a7={'where':{'id':_0x54d83d[_0x9edd('0x56')]['id']}},_0x45f47c={};_0x45f47c[_0x9edd('0x40')]=_['keys'](db['Trunk']['rawAttributes']);_0x1348a7[_0x9edd('0x44')]=_[_0x9edd('0x43')](_0x45f47c[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x54d83d[_0x9edd('0x41')][_0x9edd('0x45')]));_0x1348a7[_0x9edd('0x44')]=_0x1348a7[_0x9edd('0x44')]['length']?_0x1348a7[_0x9edd('0x44')]:_0x45f47c['model'];if(_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]){_0x1348a7['include']=[{'all':!![]}];}_0x1348a7=_[_0x9edd('0x4e')]({},_0x1348a7,_0x54d83d[_0x9edd('0x4f')]);return db[_0x9edd('0x52')]['find'](_0x1348a7)[_0x9edd('0x1c')](handleEntityNotFound(_0x54ecfa,null))[_0x9edd('0x1c')](function(_0x430eb4){if(_0x430eb4){var _0x15ebfa=_0x430eb4[_0x9edd('0x34')]({'plain':!![]});_0x15ebfa=qs[_0x9edd('0x59')](_0x15ebfa,['id','createdAt','updatedAt']);_0x54d83d[_0x9edd('0x5a')]=_['omit'](_0x54d83d[_0x9edd('0x5a')],['id',_0x9edd('0x5b'),_0x9edd('0x5c')]);return db[_0x9edd('0x52')]['create'](_[_0x9edd('0x4e')](_0x15ebfa,_0x54d83d['body']),{'include':_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]?[{'all':!![]}]:undefined})[_0x9edd('0x1c')](function(_0x5ca123){var _0x2651a2=_0x54d83d['user'][_0x9edd('0x34')]({'plain':!![]});if(!_0x2651a2)throw new Error(_0x9edd('0x5d'));if(_0x2651a2['role']===_0x9edd('0x5e')){var _0x4a72d0=_0x5ca123[_0x9edd('0x34')]({'plain':!![]});var _0x134c9c=_0x9edd('0x35');return db['UserProfileSection'][_0x9edd('0x58')]({'where':{'name':_0x134c9c,'userProfileId':_0x2651a2[_0x9edd('0x5f')]},'raw':!![]})[_0x9edd('0x1c')](function(_0x2015fc){if(_0x2015fc&&_0x2015fc[_0x9edd('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x4a72d0[_0x9edd('0x39')],'resourceId':_0x4a72d0['id'],'type':_0x2015fc[_0x9edd('0x39')],'sectionId':_0x2015fc['id']},{})['then'](function(){return _0x5ca123;});}else{return _0x5ca123;}})['catch'](function(_0x52afd7){logger[_0x9edd('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52afd7);throw _0x52afd7;});}return _0x5ca123;});}})['then'](respondWithResult(_0x54ecfa,0xc9))[_0x9edd('0x25')](handleError(_0x54ecfa,null));};exports[_0x9edd('0x61')]=function(_0x589348,_0xb9ebeb,_0x11e082){var _0x34dff5;return db['Trunk'][_0x9edd('0x61')](_0x589348['body'],{'raw':!![]})[_0x9edd('0x1c')](function(_0x18d1a0){_0x34dff5=_0x18d1a0;return db['Trunk'][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x5c1746){var _0x2bd6d1=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/trunk.ejs'),_0x9edd('0x65'));var _0x58330c=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/registry.ejs'),_0x9edd('0x65'));var _0x286593=ejs[_0x9edd('0x66')](_0x2bd6d1,{'trunks':_0x5c1746||[]});fs[_0x9edd('0x67')](_0x9edd('0x68'),_0x286593);if(_0x34dff5[_0x9edd('0x69')]){var _0x3fa4a9=ejs['render'](_0x58330c,{'trunks':_0x5c1746||[]});fs['writeFileSync'](_0x9edd('0x6a'),_0x3fa4a9);}})[_0x9edd('0x1c')](function(){return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x61'),{'module':_0x9edd('0x6c')});})['then'](function(){var _0x2e40c8=_0x589348[_0x9edd('0x5e')][_0x9edd('0x34')]({'plain':!![]});if(!_0x2e40c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e40c8[_0x9edd('0x6d')]===_0x9edd('0x5e')){var _0x4b1c12=_0x34dff5[_0x9edd('0x34')]({'plain':!![]});return db[_0x9edd('0x6e')]['find']({'where':{'name':_0x9edd('0x35'),'userProfileId':_0x2e40c8[_0x9edd('0x5f')]},'raw':!![]})['then'](function(_0x3f08ac){if(_0x3f08ac&&_0x3f08ac['autoAssociation']===0x0){return db['UserProfileResource'][_0x9edd('0x61')]({'name':_0x4b1c12[_0x9edd('0x39')],'resourceId':_0x4b1c12['id'],'type':_0x3f08ac[_0x9edd('0x39')],'sectionId':_0x3f08ac['id']},{})['then'](function(){return _0x34dff5;});}else{return _0x34dff5;}})[_0x9edd('0x25')](function(_0x286e47){logger['error'](_0x9edd('0x6f'),_0x286e47);throw _0x286e47;});}return _0x34dff5;})[_0x9edd('0x1c')](respondWithResult(_0xb9ebeb,0xc9))[_0x9edd('0x25')](handleError(_0xb9ebeb,null));};exports[_0x9edd('0x32')]=function(_0x54ac71,_0x5e68db,_0x1129b7){var _0x5bb28c;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x54ac71[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x5e68db,null))[_0x9edd('0x1c')](saveUpdates(_0x54ac71[_0x9edd('0x5a')],null))[_0x9edd('0x1c')](function(_0x5a4d4b){if(_0x5a4d4b){_0x5bb28c=_0x5a4d4b;return db[_0x9edd('0x52')]['findAll']({'raw':!![]});}})[_0x9edd('0x1c')](function(_0x3c4db7){if(_0x3c4db7){var _0x2c7562=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),'utf8');var _0x25e3e7=fs[_0x9edd('0x62')](path['join'](config[_0x9edd('0x64')],_0x9edd('0x71')),'utf8');var _0x304e56=ejs[_0x9edd('0x66')](_0x2c7562,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_trunks.conf',_0x304e56);var _0x41cd76=ejs[_0x9edd('0x66')](_0x25e3e7,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x41cd76);return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});}return null;})[_0x9edd('0x1c')](function(_0x1a6d3d){if(_0x1a6d3d){return _0x5bb28c;}})[_0x9edd('0x1c')](respondWithResult(_0x5e68db,null))['catch'](handleError(_0x5e68db,null));};exports['destroy']=function(_0x49dc1d,_0x56d794,_0x388252){var _0x20762d;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x49dc1d[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x56d794,null))[_0x9edd('0x1c')](removeEntity(_0x56d794,null))[_0x9edd('0x1c')](function(){return db[_0x9edd('0x52')][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x4cfa99){var _0x367fc6=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),_0x9edd('0x65'));var _0x3d4890=fs[_0x9edd('0x62')](path['join'](config['root'],_0x9edd('0x71')),'utf8');var _0x35950b=ejs['render'](_0x367fc6,{'trunks':_0x4cfa99});var _0x21c35f=ejs[_0x9edd('0x66')](_0x3d4890,{'trunks':_0x4cfa99});fs['writeFileSync'](_0x9edd('0x68'),_0x35950b);fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x21c35f);return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x33'),{'module':_0x9edd('0x6c')});})[_0x9edd('0x25')](handleError(_0x56d794,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 2e385ef..23c7043 100644 --- a/server/api/trunk/trunk.model.js +++ b/server/api/trunk/trunk.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54cc=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','lodash','util','../../config/logger'];(function(_0x4deba2,_0x2e03e8){var _0x19f095=function(_0x2c0ffc){while(--_0x2c0ffc){_0x4deba2['push'](_0x4deba2['shift']());}};_0x19f095(++_0x2e03e8);}(_0x54cc,0xeb));var _0xc54c=function(_0x2b31ec,_0x1a7009){_0x2b31ec=_0x2b31ec-0x0;var _0x43f4fe=_0x54cc[_0x2b31ec];return _0x43f4fe;};'use strict';var _=require(_0xc54c('0x0'));var util=require(_0xc54c('0x1'));var logger=require(_0xc54c('0x2'))(_0xc54c('0x3'));var moment=require(_0xc54c('0x4'));var BPromise=require(_0xc54c('0x5'));var rp=require(_0xc54c('0x6'));var fs=require('fs');var path=require(_0xc54c('0x7'));var rimraf=require(_0xc54c('0x8'));var config=require(_0xc54c('0x9'));var attributes=require(_0xc54c('0xa'));module[_0xc54c('0xb')]=function(_0x134633,_0x13e843){return _0x134633['define'](_0xc54c('0xc'),attributes,{'tableName':_0xc54c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8727=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','lodash'];(function(_0x52e7c1,_0x5cd510){var _0x24544a=function(_0x75b9d1){while(--_0x75b9d1){_0x52e7c1['push'](_0x52e7c1['shift']());}};_0x24544a(++_0x5cd510);}(_0x8727,0xa7));var _0x7872=function(_0x162ee0,_0x291661){_0x162ee0=_0x162ee0-0x0;var _0x48fc5e=_0x8727[_0x162ee0];return _0x48fc5e;};'use strict';var _=require(_0x7872('0x0'));var util=require(_0x7872('0x1'));var logger=require(_0x7872('0x2'))(_0x7872('0x3'));var moment=require(_0x7872('0x4'));var BPromise=require(_0x7872('0x5'));var rp=require(_0x7872('0x6'));var fs=require('fs');var path=require(_0x7872('0x7'));var rimraf=require(_0x7872('0x8'));var config=require(_0x7872('0x9'));var attributes=require(_0x7872('0xa'));module[_0x7872('0xb')]=function(_0x4b1eff,_0x18ff4e){return _0x4b1eff[_0x7872('0xc')](_0x7872('0xd'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 1d87a68..2a0a683 100644 --- a/server/api/trunk/trunk.rpc.js +++ b/server/api/trunk/trunk.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc271=['info','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowTrunk','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','Trunk,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1aa617,_0x23271a){var _0x38653c=function(_0x1f17be){while(--_0x1f17be){_0x1aa617['push'](_0x1aa617['shift']());}};_0x38653c(++_0x23271a);}(_0xc271,0x165));var _0x1c27=function(_0x56280f,_0x1d1a15){_0x56280f=_0x56280f-0x0;var _0x3807f3=_0xc271[_0x56280f];return _0x3807f3;};'use strict';var _=require(_0x1c27('0x0'));var util=require(_0x1c27('0x1'));var moment=require(_0x1c27('0x2'));var BPromise=require(_0x1c27('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c27('0x4'));var db=require(_0x1c27('0x5'))['db'];var utils=require(_0x1c27('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1c27('0x7'));var jayson=require(_0x1c27('0x8'));var client=jayson['client'][_0x1c27('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b86dc,_0x344ab2,_0x31686a){return new BPromise(function(_0x21d843,_0x1304e0){return client[_0x1c27('0xa')](_0x4b86dc,_0x31686a)['then'](function(_0x15f054){logger['info'](_0x1c27('0xb'),_0x344ab2,_0x1c27('0xc'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x344ab2,_0x1c27('0xc'),JSON[_0x1c27('0xd')](_0x15f054));if(_0x15f054[_0x1c27('0xe')]){if(_0x15f054[_0x1c27('0xe')][_0x1c27('0xf')]===0x1f4){logger[_0x1c27('0xe')](_0x1c27('0xb'),_0x344ab2,_0x15f054[_0x1c27('0xe')][_0x1c27('0x10')]);return _0x1304e0(_0x15f054[_0x1c27('0xe')][_0x1c27('0x10')]);}logger['error'](_0x1c27('0xb'),_0x344ab2,_0x15f054[_0x1c27('0xe')][_0x1c27('0x10')]);return _0x21d843(_0x15f054[_0x1c27('0xe')]['message']);}else{logger[_0x1c27('0x11')](_0x1c27('0xb'),_0x344ab2,'request\x20sent');_0x21d843(_0x15f054[_0x1c27('0x12')][_0x1c27('0x10')]);}})[_0x1c27('0x13')](function(_0x237aec){logger[_0x1c27('0xe')](_0x1c27('0xb'),_0x344ab2,_0x237aec);_0x1304e0(_0x237aec);});});}exports[_0x1c27('0x14')]=function(_0x456db1){var _0x5a0397=this;return new Promise(function(_0x4eecdd,_0x2d3a60){return db[_0x1c27('0x15')][_0x1c27('0x16')]({'raw':_0x456db1[_0x1c27('0x17')]?_0x456db1[_0x1c27('0x17')][_0x1c27('0x18')]===undefined?!![]:![]:!![],'where':_0x456db1[_0x1c27('0x17')]?_0x456db1[_0x1c27('0x17')][_0x1c27('0x19')]||null:null,'attributes':_0x456db1['options']?_0x456db1[_0x1c27('0x17')][_0x1c27('0x1a')]||null:null,'limit':_0x456db1[_0x1c27('0x17')]?_0x456db1[_0x1c27('0x17')][_0x1c27('0x1b')]||null:null,'include':_0x456db1[_0x1c27('0x17')]?_0x456db1[_0x1c27('0x17')][_0x1c27('0x1c')]?_[_0x1c27('0x1d')](_0x456db1[_0x1c27('0x17')][_0x1c27('0x1c')],function(_0x227fd3){return{'model':db[_0x227fd3['model']],'as':_0x227fd3['as'],'attributes':_0x227fd3[_0x1c27('0x1a')],'include':_0x227fd3[_0x1c27('0x1c')]?_[_0x1c27('0x1d')](_0x227fd3[_0x1c27('0x1c')],function(_0x2e4622){return{'model':db[_0x2e4622[_0x1c27('0x1e')]],'as':_0x2e4622['as'],'attributes':_0x2e4622[_0x1c27('0x1a')],'include':_0x2e4622[_0x1c27('0x1c')]?_['map'](_0x2e4622[_0x1c27('0x1c')],function(_0x29029b){return{'model':db[_0x29029b[_0x1c27('0x1e')]],'as':_0x29029b['as'],'attributes':_0x29029b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b8f41){logger[_0x1c27('0x11')](_0x1c27('0x14'),_0x456db1);logger[_0x1c27('0x1f')](_0x1c27('0x14'),_0x456db1,JSON[_0x1c27('0xd')](_0x2b8f41));_0x4eecdd(_0x2b8f41);})['catch'](function(_0x1e3d74){logger[_0x1c27('0xe')]('GetTrunk',_0x1e3d74[_0x1c27('0x10')],_0x456db1);_0x2d3a60(_0x5a0397[_0x1c27('0xe')](0x1f4,_0x1e3d74['message']));});});};exports[_0x1c27('0x20')]=function(_0x4308d9){var _0x3c0f6f=this;return new Promise(function(_0x4444f0,_0x331ae1){return db[_0x1c27('0x15')]['find']({'raw':_0x4308d9['options']?_0x4308d9[_0x1c27('0x17')][_0x1c27('0x18')]===undefined?!![]:![]:!![],'where':_0x4308d9[_0x1c27('0x17')]?_0x4308d9[_0x1c27('0x17')]['where']||null:null,'attributes':_0x4308d9[_0x1c27('0x17')]?_0x4308d9[_0x1c27('0x17')][_0x1c27('0x1a')]||null:null,'include':_0x4308d9['options']?_0x4308d9[_0x1c27('0x17')][_0x1c27('0x1c')]?_[_0x1c27('0x1d')](_0x4308d9['options']['include'],function(_0x355f3c){return{'model':db[_0x355f3c[_0x1c27('0x1e')]],'as':_0x355f3c['as'],'attributes':_0x355f3c[_0x1c27('0x1a')],'include':_0x355f3c[_0x1c27('0x1c')]?_[_0x1c27('0x1d')](_0x355f3c[_0x1c27('0x1c')],function(_0x4552e2){return{'model':db[_0x4552e2[_0x1c27('0x1e')]],'as':_0x4552e2['as'],'attributes':_0x4552e2[_0x1c27('0x1a')],'include':_0x4552e2[_0x1c27('0x1c')]?_['map'](_0x4552e2['include'],function(_0x5ba484){return{'model':db[_0x5ba484[_0x1c27('0x1e')]],'as':_0x5ba484['as'],'attributes':_0x5ba484['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c27('0x21')](function(_0x593d48){logger[_0x1c27('0x11')](_0x1c27('0x20'),_0x4308d9);logger[_0x1c27('0x1f')](_0x1c27('0x20'),_0x4308d9,JSON[_0x1c27('0xd')](_0x593d48));_0x4444f0(_0x593d48);})['catch'](function(_0x329095){logger[_0x1c27('0xe')]('ShowTrunk',_0x329095[_0x1c27('0x10')],_0x4308d9);_0x331ae1(_0x3c0f6f[_0x1c27('0xe')](0x1f4,_0x329095[_0x1c27('0x10')]));});});}; \ No newline at end of file +var _0xc91a=['model','attributes','then','GetTrunk','ShowTrunk','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','Trunk','findAll','options','raw','where','include','map'];(function(_0x495fb9,_0x1ebf07){var _0x7efce6=function(_0x22f176){while(--_0x22f176){_0x495fb9['push'](_0x495fb9['shift']());}};_0x7efce6(++_0x1ebf07);}(_0xc91a,0x116));var _0xac91=function(_0x31c6bf,_0x315edd){_0x31c6bf=_0x31c6bf-0x0;var _0x175478=_0xc91a[_0x31c6bf];return _0x175478;};'use strict';var _=require(_0xac91('0x0'));var util=require(_0xac91('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xac91('0x2'));var fs=require('fs');var Redis=require(_0xac91('0x3'));var db=require(_0xac91('0x4'))['db'];var utils=require(_0xac91('0x5'));var logger=require(_0xac91('0x6'))(_0xac91('0x7'));var config=require('../../config/environment');var jayson=require(_0xac91('0x8'));var client=jayson[_0xac91('0x9')][_0xac91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3520ae,_0x2c9f76,_0x98e9d8){return new BPromise(function(_0x5332ed,_0x5208e3){return client[_0xac91('0xb')](_0x3520ae,_0x98e9d8)['then'](function(_0x516c57){logger[_0xac91('0xc')](_0xac91('0xd'),_0x2c9f76,_0xac91('0xe'));logger[_0xac91('0xf')]('Trunk,\x20%s,\x20%s,\x20%s',_0x2c9f76,_0xac91('0xe'),JSON[_0xac91('0x10')](_0x516c57));if(_0x516c57[_0xac91('0x11')]){if(_0x516c57['error']['code']===0x1f4){logger[_0xac91('0x11')](_0xac91('0xd'),_0x2c9f76,_0x516c57[_0xac91('0x11')][_0xac91('0x12')]);return _0x5208e3(_0x516c57[_0xac91('0x11')][_0xac91('0x12')]);}logger[_0xac91('0x11')](_0xac91('0xd'),_0x2c9f76,_0x516c57[_0xac91('0x11')]['message']);return _0x5332ed(_0x516c57[_0xac91('0x11')][_0xac91('0x12')]);}else{logger[_0xac91('0xc')](_0xac91('0xd'),_0x2c9f76,_0xac91('0xe'));_0x5332ed(_0x516c57[_0xac91('0x13')][_0xac91('0x12')]);}})[_0xac91('0x14')](function(_0xd50b2){logger[_0xac91('0x11')](_0xac91('0xd'),_0x2c9f76,_0xd50b2);_0x5208e3(_0xd50b2);});});}exports['GetTrunk']=function(_0x470f3b){var _0x170012=this;return new Promise(function(_0x557764,_0xbb96e3){return db[_0xac91('0x15')][_0xac91('0x16')]({'raw':_0x470f3b[_0xac91('0x17')]?_0x470f3b[_0xac91('0x17')][_0xac91('0x18')]===undefined?!![]:![]:!![],'where':_0x470f3b[_0xac91('0x17')]?_0x470f3b[_0xac91('0x17')][_0xac91('0x19')]||null:null,'attributes':_0x470f3b[_0xac91('0x17')]?_0x470f3b[_0xac91('0x17')]['attributes']||null:null,'limit':_0x470f3b['options']?_0x470f3b['options']['limit']||null:null,'include':_0x470f3b[_0xac91('0x17')]?_0x470f3b[_0xac91('0x17')][_0xac91('0x1a')]?_[_0xac91('0x1b')](_0x470f3b['options']['include'],function(_0x2f20c1){return{'model':db[_0x2f20c1[_0xac91('0x1c')]],'as':_0x2f20c1['as'],'attributes':_0x2f20c1[_0xac91('0x1d')],'include':_0x2f20c1[_0xac91('0x1a')]?_['map'](_0x2f20c1[_0xac91('0x1a')],function(_0x491b10){return{'model':db[_0x491b10['model']],'as':_0x491b10['as'],'attributes':_0x491b10['attributes'],'include':_0x491b10[_0xac91('0x1a')]?_[_0xac91('0x1b')](_0x491b10['include'],function(_0x2d6a1d){return{'model':db[_0x2d6a1d[_0xac91('0x1c')]],'as':_0x2d6a1d['as'],'attributes':_0x2d6a1d[_0xac91('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xac91('0x1e')](function(_0x3b534e){logger[_0xac91('0xc')](_0xac91('0x1f'),_0x470f3b);logger[_0xac91('0xf')](_0xac91('0x1f'),_0x470f3b,JSON[_0xac91('0x10')](_0x3b534e));_0x557764(_0x3b534e);})['catch'](function(_0x17b267){logger[_0xac91('0x11')](_0xac91('0x1f'),_0x17b267['message'],_0x470f3b);_0xbb96e3(_0x170012[_0xac91('0x11')](0x1f4,_0x17b267[_0xac91('0x12')]));});});};exports[_0xac91('0x20')]=function(_0x4c0a5a){var _0x179ec9=this;return new Promise(function(_0x44808e,_0xee605b){return db[_0xac91('0x15')][_0xac91('0x21')]({'raw':_0x4c0a5a[_0xac91('0x17')]?_0x4c0a5a[_0xac91('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4c0a5a[_0xac91('0x17')]?_0x4c0a5a['options'][_0xac91('0x19')]||null:null,'attributes':_0x4c0a5a['options']?_0x4c0a5a['options'][_0xac91('0x1d')]||null:null,'include':_0x4c0a5a[_0xac91('0x17')]?_0x4c0a5a[_0xac91('0x17')]['include']?_[_0xac91('0x1b')](_0x4c0a5a[_0xac91('0x17')][_0xac91('0x1a')],function(_0x134dea){return{'model':db[_0x134dea[_0xac91('0x1c')]],'as':_0x134dea['as'],'attributes':_0x134dea[_0xac91('0x1d')],'include':_0x134dea['include']?_[_0xac91('0x1b')](_0x134dea[_0xac91('0x1a')],function(_0x427f9d){return{'model':db[_0x427f9d['model']],'as':_0x427f9d['as'],'attributes':_0x427f9d[_0xac91('0x1d')],'include':_0x427f9d[_0xac91('0x1a')]?_[_0xac91('0x1b')](_0x427f9d[_0xac91('0x1a')],function(_0xcf3707){return{'model':db[_0xcf3707['model']],'as':_0xcf3707['as'],'attributes':_0xcf3707[_0xac91('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xac91('0x1e')](function(_0x5800eb){logger[_0xac91('0xc')]('ShowTrunk',_0x4c0a5a);logger[_0xac91('0xf')](_0xac91('0x20'),_0x4c0a5a,JSON[_0xac91('0x10')](_0x5800eb));_0x44808e(_0x5800eb);})[_0xac91('0x14')](function(_0x3b3573){logger[_0xac91('0x11')](_0xac91('0x20'),_0x3b3573[_0xac91('0x12')],_0x4c0a5a);_0xee605b(_0x179ec9[_0xac91('0x11')](0x1f4,_0x3b3573['message']));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index cb7efe2..3759363 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8580=['Router','../../components/auth/service','put','/:id','isAuthenticated','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8580,0xf0));var _0x0858=function(_0x18ef74,_0x103c49){_0x18ef74=_0x18ef74-0x0;var _0x2c5b3a=_0x8580[_0x18ef74];return _0x2c5b3a;};'use strict';var express=require('express');var router=express[_0x0858('0x0')]();var auth=require(_0x0858('0x1'));var controller=require('./user-setting.controller');router[_0x0858('0x2')](_0x0858('0x3'),auth[_0x0858('0x4')](),controller[_0x0858('0x5')]);module['exports']=router; \ No newline at end of file +var _0x9d1a=['../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','exports','express','Router'];(function(_0x1138bd,_0x173cec){var _0x1cadbe=function(_0x505930){while(--_0x505930){_0x1138bd['push'](_0x1138bd['shift']());}};_0x1cadbe(++_0x173cec);}(_0x9d1a,0x196));var _0xa9d1=function(_0x4053cf,_0x14397f){_0x4053cf=_0x4053cf-0x0;var _0x3bf960=_0x9d1a[_0x4053cf];return _0x3bf960;};'use strict';var express=require(_0xa9d1('0x0'));var router=express[_0xa9d1('0x1')]();var auth=require(_0xa9d1('0x2'));var controller=require(_0xa9d1('0x3'));router[_0xa9d1('0x4')](_0xa9d1('0x5'),auth[_0xa9d1('0x6')](),controller['update']);module[_0xa9d1('0x7')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 8d2b9ab..d067b4d 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04ef=['ENUM','BOOLEAN','TEXT','INTEGER','UserId','sequelize','error','warning','info','debug','exports'];(function(_0x5911f3,_0x234926){var _0x3eb7fc=function(_0x454606){while(--_0x454606){_0x5911f3['push'](_0x5911f3['shift']());}};_0x3eb7fc(++_0x234926);}(_0x04ef,0x118));var _0xf04e=function(_0xdc76ec,_0x1573ef){_0xdc76ec=_0xdc76ec-0x0;var _0x56a435=_0x04ef[_0xdc76ec];return _0x56a435;};'use strict';var Sequelize=require(_0xf04e('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xf04e('0x1'),_0xf04e('0x2'),_0xf04e('0x3'),_0xf04e('0x4')];module[_0xf04e('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0xf04e('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xf04e('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xf04e('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xf04e('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xf04e('0x9')],'unique':_0xf04e('0xa')}}; \ No newline at end of file +var _0xde4d=['debug','exports','DATE','INTEGER','sequelize','error','warning','info'];(function(_0x3fe9a0,_0x40f28a){var _0x1f4d8e=function(_0x5d8172){while(--_0x5d8172){_0x3fe9a0['push'](_0x3fe9a0['shift']());}};_0x1f4d8e(++_0x40f28a);}(_0xde4d,0x74));var _0xdde4=function(_0x1b5a79,_0x4c000b){_0x1b5a79=_0x1b5a79-0x0;var _0x37fdae=_0xde4d[_0x1b5a79];return _0x37fdae;};'use strict';var Sequelize=require(_0xdde4('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xdde4('0x1'),_0xdde4('0x2'),_0xdde4('0x3'),_0xdde4('0x4')];module[_0xdde4('0x5')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xdde4('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xdde4('0x7')],'unique':'UserId'}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 3a98e03..6d6cbed 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd52a=['UserSetting','find','then','body','ioredis','api','../../config/environment','../../mysqldb','redis','./user-setting.socket','register','json','update','sendStatus','name','status','send','user','role','Unauthorized','params','Invalid\x20user\x20setting\x20id'];(function(_0x115bdf,_0x4de32c){var _0x4c608e=function(_0x3b6da1){while(--_0x3b6da1){_0x115bdf['push'](_0x115bdf['shift']());}};_0x4c608e(++_0x4de32c);}(_0xd52a,0xca));var _0xad52=function(_0x299641,_0xf48107){_0x299641=_0x299641-0x0;var _0x2bd64c=_0xd52a[_0x299641];return _0x2bd64c;};'use strict';var _=require('lodash');var Redis=require(_0xad52('0x0'));var logger=require('../../config/logger')(_0xad52('0x1'));var config=require(_0xad52('0x2'));var db=require(_0xad52('0x3'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xad52('0x4')]));require(_0xad52('0x5'))[_0xad52('0x6')](socket);config[_0xad52('0x4')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});function respondWithResult(_0x1ad70b,_0x55f7a7){_0x55f7a7=_0x55f7a7||0xc8;return function(_0x23fc23){if(_0x23fc23){return _0x1ad70b['status'](_0x55f7a7)[_0xad52('0x7')](_0x23fc23);}};}function saveUpdates(_0x4244f3){return function(_0x48b175){if(_0x48b175){return _0x48b175[_0xad52('0x8')](_0x4244f3)['then'](function(_0x46fbc5){return _0x46fbc5;});}return null;};}function handleEntityNotFound(_0x5ab3d2){return function(_0x125d8a){if(!_0x125d8a){_0x5ab3d2[_0xad52('0x9')](0x194);}return _0x125d8a;};}function handleError(_0x2037fe,_0x119cdc){_0x119cdc=_0x119cdc||0x1f4;return function(_0x59e9e8){logger['error'](_0x59e9e8['stack']);if(_0x59e9e8[_0xad52('0xa')]){delete _0x59e9e8[_0xad52('0xa')];}_0x2037fe[_0xad52('0xb')](_0x119cdc)[_0xad52('0xc')](_0x59e9e8);};}exports[_0xad52('0x8')]=function(_0x230eaa,_0x16e0f7){if(_0x230eaa[_0xad52('0xd')][_0xad52('0xe')]!=='admin')throw new Error(_0xad52('0xf'));if(isNaN(Number(_0x230eaa[_0xad52('0x10')]['id'])))throw new Error(_0xad52('0x11'));return db[_0xad52('0x12')][_0xad52('0x13')]({'where':{'id':_0x230eaa[_0xad52('0x10')]['id']}})[_0xad52('0x14')](handleEntityNotFound(_0x16e0f7,null))[_0xad52('0x14')](saveUpdates(_0x230eaa[_0xad52('0x15')],null))['then'](respondWithResult(_0x16e0f7,null))['catch'](handleError(_0x16e0f7,null));}; \ No newline at end of file +var _0x7bae=['localhost','status','json','then','sendStatus','error','name','send','update','user','Unauthorized','params','Invalid\x20user\x20setting\x20id','find','body','catch','../../config/logger','api','../../mysqldb','redis','./user-setting.socket','register','defaults'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x7bae,0x13b));var _0xe7ba=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x7bae[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0xe7ba('0x0'))(_0xe7ba('0x1'));var config=require('../../config/environment');var db=require(_0xe7ba('0x2'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xe7ba('0x3')]));require(_0xe7ba('0x4'))[_0xe7ba('0x5')](socket);config[_0xe7ba('0x3')]=_[_0xe7ba('0x6')](config[_0xe7ba('0x3')],{'host':_0xe7ba('0x7'),'port':0x18eb});function respondWithResult(_0x3c5e59,_0x10b307){_0x10b307=_0x10b307||0xc8;return function(_0x34fb18){if(_0x34fb18){return _0x3c5e59[_0xe7ba('0x8')](_0x10b307)[_0xe7ba('0x9')](_0x34fb18);}};}function saveUpdates(_0x41c39d){return function(_0x1b2693){if(_0x1b2693){return _0x1b2693['update'](_0x41c39d)[_0xe7ba('0xa')](function(_0xe57e33){return _0xe57e33;});}return null;};}function handleEntityNotFound(_0x375ebb){return function(_0x276bc3){if(!_0x276bc3){_0x375ebb[_0xe7ba('0xb')](0x194);}return _0x276bc3;};}function handleError(_0x1672f0,_0x99a86f){_0x99a86f=_0x99a86f||0x1f4;return function(_0x448bcc){logger[_0xe7ba('0xc')](_0x448bcc['stack']);if(_0x448bcc[_0xe7ba('0xd')]){delete _0x448bcc['name'];}_0x1672f0[_0xe7ba('0x8')](_0x99a86f)[_0xe7ba('0xe')](_0x448bcc);};}exports[_0xe7ba('0xf')]=function(_0x17e4e6,_0x15d018){if(_0x17e4e6[_0xe7ba('0x10')]['role']!=='admin')throw new Error(_0xe7ba('0x11'));if(isNaN(Number(_0x17e4e6[_0xe7ba('0x12')]['id'])))throw new Error(_0xe7ba('0x13'));return db['UserSetting'][_0xe7ba('0x14')]({'where':{'id':_0x17e4e6['params']['id']}})['then'](handleEntityNotFound(_0x15d018,null))['then'](saveUpdates(_0x17e4e6[_0xe7ba('0x15')],null))['then'](respondWithResult(_0x15d018,null))[_0xe7ba('0x16')](handleError(_0x15d018,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 65b3244..2a81dcc 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4c=['hasOwnProperty','hook','exports','events','UserSetting','save','remove','emit'];(function(_0x444ff6,_0x4970ce){var _0x503a56=function(_0x5a830d){while(--_0x5a830d){_0x444ff6['push'](_0x444ff6['shift']());}};_0x503a56(++_0x4970ce);}(_0xac4c,0xe3));var _0xcac4=function(_0x456e01,_0x48ac19){_0x456e01=_0x456e01-0x0;var _0x19b14c=_0xac4c[_0x456e01];return _0x19b14c;};'use strict';var EventEmitter=require(_0xcac4('0x0'));var UserSetting=require('../../mysqldb')['db'][_0xcac4('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcac4('0x2'),'afterUpdate':'update','afterDestroy':_0xcac4('0x3')};function emitEvent(_0x2d1448){return function(_0x576eeb,_0x2daa45,_0x5c1e7f){UserSettingEvents[_0xcac4('0x4')](_0x2d1448+':'+_0x576eeb['id'],_0x576eeb);UserSettingEvents[_0xcac4('0x4')](_0x2d1448,_0x576eeb);_0x5c1e7f(null);};}for(var e in events){if(events[_0xcac4('0x5')](e)){var event=events[e];UserSetting[_0xcac4('0x6')](e,emitEvent(event));}}module[_0xcac4('0x7')]=UserSettingEvents; \ No newline at end of file +var _0x6fa8=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserSetting'];(function(_0x1268f4,_0x147117){var _0x2f1b05=function(_0x4d634d){while(--_0x4d634d){_0x1268f4['push'](_0x1268f4['shift']());}};_0x2f1b05(++_0x147117);}(_0x6fa8,0x1e3));var _0x86fa=function(_0x4da690,_0x12d136){_0x4da690=_0x4da690-0x0;var _0x263c53=_0x6fa8[_0x4da690];return _0x263c53;};'use strict';var EventEmitter=require(_0x86fa('0x0'));var UserSetting=require(_0x86fa('0x1'))['db'][_0x86fa('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x86fa('0x3')](0x0);var events={'afterCreate':_0x86fa('0x4'),'afterUpdate':'update','afterDestroy':_0x86fa('0x5')};function emitEvent(_0x53cdbb){return function(_0x339384,_0x5d5ee7,_0x1b698e){UserSettingEvents[_0x86fa('0x6')](_0x53cdbb+':'+_0x339384['id'],_0x339384);UserSettingEvents[_0x86fa('0x6')](_0x53cdbb,_0x339384);_0x1b698e(null);};}for(var e in events){if(events[_0x86fa('0x7')](e)){var event=events[e];UserSetting[_0x86fa('0x8')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 7528637..995b935 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3870=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','UserSetting','clientSideLoggingEnabled'];(function(_0x370c3a,_0x149062){var _0x26b535=function(_0x1ac16e){while(--_0x1ac16e){_0x370c3a['push'](_0x370c3a['shift']());}};_0x26b535(++_0x149062);}(_0x3870,0x146));var _0x0387=function(_0x12917c,_0x41b371){_0x12917c=_0x12917c-0x0;var _0x59b248=_0x3870[_0x12917c];return _0x59b248;};'use strict';var attributes=require(_0x0387('0x0'));module[_0x0387('0x1')]=function(_0x2a67ee){return _0x2a67ee['define'](_0x0387('0x2'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x310701){if(!_0x310701[_0x0387('0x3')])_0x310701['clientSideLoggingEnabledSince']=null;else if(_0x310701[_0x0387('0x4')]===null)_0x310701[_0x0387('0x4')]=new Date();}}});}; \ No newline at end of file +var _0xdca3=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','define'];(function(_0x4f083c,_0xb9bf2d){var _0x3ccd71=function(_0x37bea1){while(--_0x37bea1){_0x4f083c['push'](_0x4f083c['shift']());}};_0x3ccd71(++_0xb9bf2d);}(_0xdca3,0x64));var _0x3dca=function(_0x19a677,_0x427306){_0x19a677=_0x19a677-0x0;var _0x4d7858=_0xdca3[_0x19a677];return _0x4d7858;};'use strict';var attributes=require(_0x3dca('0x0'));module['exports']=function(_0x42da3c){return _0x42da3c[_0x3dca('0x1')](_0x3dca('0x2'),attributes,{'tableName':_0x3dca('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1754d1){if(!_0x1754d1[_0x3dca('0x4')])_0x1754d1[_0x3dca('0x5')]=null;else if(_0x1754d1[_0x3dca('0x5')]===null)_0x1754d1[_0x3dca('0x5')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 15caf28..ad3c16e 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa03f=['./user-setting.events','save','remove','update','user-setting:update','emit','user-setting:update:user-','UserId','register','length','user-setting:'];(function(_0x1653b1,_0x35b7d1){var _0x3e0b17=function(_0x5f21fc){while(--_0x5f21fc){_0x1653b1['push'](_0x1653b1['shift']());}};_0x3e0b17(++_0x35b7d1);}(_0xa03f,0x1ce));var _0xfa03=function(_0x44f4e8,_0x5aac22){_0x44f4e8=_0x44f4e8-0x0;var _0x526e71=_0xa03f[_0x44f4e8];return _0x526e71;};'use strict';var UserSettingEvents=require(_0xfa03('0x0'));var events=[_0xfa03('0x1'),_0xfa03('0x2'),_0xfa03('0x3')];function createListener(_0x4b3519,_0x1c2886){return function(_0x3b9633){_0x1c2886['emit'](_0x4b3519,_0x3b9633);if(_0x4b3519===_0xfa03('0x4')){_0x1c2886[_0xfa03('0x5')](_0xfa03('0x6')+_0x3b9633[_0xfa03('0x7')],_0x3b9633);}};}exports[_0xfa03('0x8')]=function(_0x391eed){for(var _0x1b1b93=0x0,_0x5bebce=events[_0xfa03('0x9')];_0x1b1b93<_0x5bebce;_0x1b1b93++){var _0xa6505f=events[_0x1b1b93];var _0x39b67b=createListener(_0xfa03('0xa')+_0xa6505f,_0x391eed);UserSettingEvents['on'](_0xa6505f,_0x39b67b);}}; \ No newline at end of file +var _0x4c50=['update','emit','user-setting:update','user-setting:update:user-','length','./user-setting.events','save'];(function(_0x2ea3a6,_0x473be1){var _0x4fbdcb=function(_0x4a2e2c){while(--_0x4a2e2c){_0x2ea3a6['push'](_0x2ea3a6['shift']());}};_0x4fbdcb(++_0x473be1);}(_0x4c50,0x1be));var _0x04c5=function(_0x2f8082,_0x4b858d){_0x2f8082=_0x2f8082-0x0;var _0x37cbb6=_0x4c50[_0x2f8082];return _0x37cbb6;};'use strict';var UserSettingEvents=require(_0x04c5('0x0'));var events=[_0x04c5('0x1'),'remove',_0x04c5('0x2')];function createListener(_0x5884ff,_0x37c46e){return function(_0x53b4ad){_0x37c46e[_0x04c5('0x3')](_0x5884ff,_0x53b4ad);if(_0x5884ff===_0x04c5('0x4')){_0x37c46e['emit'](_0x04c5('0x5')+_0x53b4ad['UserId'],_0x53b4ad);}};}exports['register']=function(_0x37c646){for(var _0xf595=0x0,_0x2e06ab=events[_0x04c5('0x6')];_0xf595<_0x2e06ab;_0xf595++){var _0x5217a8=events[_0xf595];var _0x39a449=createListener('user-setting:'+_0x5217a8,_0x37c646);UserSettingEvents['on'](_0x5217a8,_0x39a449);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 90e6252..a6f198d 100644 --- a/server/api/user/index.js +++ b/server/api/user/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a68=['getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/scheduled_calls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','join','server/files/images/','format','now','single','file','addAvatar','login','logout','/:id/pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','createApiKey','put','/:id/password','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/:id','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5a68,0x139));var _0x85a6=function(_0x4b3895,_0x204f64){_0x4b3895=_0x4b3895-0x0;var _0x5ccf48=_0x5a68[_0x4b3895];return _0x5ccf48;};'use strict';var multer=require('multer');var util=require(_0x85a6('0x0'));var path=require(_0x85a6('0x1'));var timeout=require(_0x85a6('0x2'));var express=require(_0x85a6('0x3'));var router=express[_0x85a6('0x4')]();var fs_extra=require(_0x85a6('0x5'));var auth=require(_0x85a6('0x6'));var interaction=require(_0x85a6('0x7'));var config=require('../../config/environment');var controller=require(_0x85a6('0x8'));router[_0x85a6('0x9')]('/',auth[_0x85a6('0xa')](),controller[_0x85a6('0xb')]);router[_0x85a6('0x9')](_0x85a6('0xc'),auth[_0x85a6('0xa')](),controller[_0x85a6('0xd')]);router['get'](_0x85a6('0xe'),auth[_0x85a6('0xa')](),controller[_0x85a6('0xf')]);router[_0x85a6('0x9')]('/presence',auth[_0x85a6('0xa')](),controller['getPresence']);router['get'](_0x85a6('0x10'),auth['isAuthenticated'](),controller['show']);router[_0x85a6('0x9')](_0x85a6('0x11'),controller['getAvatar']);router[_0x85a6('0x9')](_0x85a6('0x12'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x13')]);router[_0x85a6('0x9')](_0x85a6('0x14'),auth['isAuthenticated'](),controller[_0x85a6('0x15')]);router[_0x85a6('0x9')](_0x85a6('0x16'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x17')]);router['get']('/:id/queues_rt',auth['isAuthenticated'](),controller[_0x85a6('0x18')]);router['get'](_0x85a6('0x19'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x1a')]);router['get'](_0x85a6('0x1b'),auth[_0x85a6('0xa')](),controller['getRecordings']);router[_0x85a6('0x9')](_0x85a6('0x1c'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x1d')]);router[_0x85a6('0x9')](_0x85a6('0x1e'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x1f')]);router[_0x85a6('0x9')](_0x85a6('0x20'),auth['isAuthenticated'](),controller[_0x85a6('0x21')]);router[_0x85a6('0x9')](_0x85a6('0x22'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x23')]);router[_0x85a6('0x9')]('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0x85a6('0x24')]);router[_0x85a6('0x9')](_0x85a6('0x25'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x26')]);router[_0x85a6('0x9')](_0x85a6('0x27'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x28')]);router[_0x85a6('0x9')](_0x85a6('0x29'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x2a')]);router[_0x85a6('0x9')]('/:id/lists',auth[_0x85a6('0xa')](),controller[_0x85a6('0x2b')]);router[_0x85a6('0x9')](_0x85a6('0x2c'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x2d')]);router['get'](_0x85a6('0x2e'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x2f')]);router[_0x85a6('0x9')](_0x85a6('0x30'),auth[_0x85a6('0xa')](),controller['getFaxAccounts']);router[_0x85a6('0x9')]('/:id/mail_accounts',auth[_0x85a6('0xa')](),controller['getMailAccounts']);router[_0x85a6('0x9')](_0x85a6('0x31'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x32')]);router[_0x85a6('0x9')]('/:id/sms_accounts',auth[_0x85a6('0xa')](),controller['getSmsAccounts']);router['get'](_0x85a6('0x33'),auth['isAuthenticated'](),controller[_0x85a6('0x34')]);router[_0x85a6('0x9')]('/:id/whatsapp_accounts',auth[_0x85a6('0xa')](),controller[_0x85a6('0x35')]);router[_0x85a6('0x9')](_0x85a6('0x36'),auth[_0x85a6('0xa')](),controller['getScheduledCalls']);router[_0x85a6('0x9')](_0x85a6('0x37'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x38')]);router[_0x85a6('0x39')](_0x85a6('0x14'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x3a')]);router[_0x85a6('0x39')]('/',auth[_0x85a6('0xa')](),controller[_0x85a6('0x3b')]);router[_0x85a6('0x39')](_0x85a6('0x3c'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x3d')]);router[_0x85a6('0x39')](_0x85a6('0x16'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x3e')]);var upload=multer({'storage':multer[_0x85a6('0x3f')]({'destination':function(_0xa1d3d0,_0x2d7990,_0x4220f3){_0x4220f3(null,path[_0x85a6('0x40')](config['root'],_0x85a6('0x41')));},'filename':function(_0x1a03fb,_0x5852eb,_0x1b1d17){_0x1b1d17(null,util[_0x85a6('0x42')]('%s-%s',Date[_0x85a6('0x43')](),_0x5852eb['originalname']));}})});router[_0x85a6('0x39')]('/:id/avatar',upload[_0x85a6('0x44')](_0x85a6('0x45')),controller[_0x85a6('0x46')]);router[_0x85a6('0x39')]('/:id/login',auth[_0x85a6('0xa')](),controller[_0x85a6('0x47')]);router[_0x85a6('0x39')]('/:id/logout',auth[_0x85a6('0xa')](),controller[_0x85a6('0x48')]);router[_0x85a6('0x39')](_0x85a6('0x49'),auth[_0x85a6('0xa')](),controller['pause']);router[_0x85a6('0x39')](_0x85a6('0x4a'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x4b')]);router[_0x85a6('0x39')](_0x85a6('0x29'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x4c')]);router[_0x85a6('0x39')](_0x85a6('0x4d'),auth[_0x85a6('0xa')](),controller['addChatInteractions']);router['post'](_0x85a6('0x4e'),auth[_0x85a6('0xa')](),controller['addMailInteractions']);router[_0x85a6('0x39')](_0x85a6('0x4f'),auth['isAuthenticated'](),controller[_0x85a6('0x50')]);router[_0x85a6('0x39')](_0x85a6('0x51'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x52')]);router['post'](_0x85a6('0x53'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x54')]);router[_0x85a6('0x39')](_0x85a6('0x55'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x56')]);router['post'](_0x85a6('0x30'),auth['isAuthenticated'](),controller[_0x85a6('0x57')]);router[_0x85a6('0x39')](_0x85a6('0x58'),auth['isAuthenticated'](),controller[_0x85a6('0x59')]);router[_0x85a6('0x39')](_0x85a6('0x31'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x5a')]);router['post'](_0x85a6('0x5b'),auth[_0x85a6('0xa')](),controller['addSmsAccounts']);router[_0x85a6('0x39')]('/:id/chat_websites',auth[_0x85a6('0xa')](),controller[_0x85a6('0x5c')]);router[_0x85a6('0x39')](_0x85a6('0x5d'),auth['isAuthenticated'](),controller[_0x85a6('0x5e')]);router[_0x85a6('0x39')](_0x85a6('0x37'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x5f')]);router[_0x85a6('0x60')](_0x85a6('0x10'),auth[_0x85a6('0xa')](),controller['update']);router[_0x85a6('0x60')](_0x85a6('0x61'),auth['isAuthenticated'](),controller[_0x85a6('0x62')]);router['delete'](_0x85a6('0x16'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x63')]);router[_0x85a6('0x64')](_0x85a6('0x29'),auth['isAuthenticated'](),controller[_0x85a6('0x65')]);router[_0x85a6('0x64')](_0x85a6('0x10'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x66')]);router[_0x85a6('0x64')](_0x85a6('0x4d'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x67')]);router[_0x85a6('0x64')](_0x85a6('0x4e'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x68')]);router['delete'](_0x85a6('0x4f'),auth[_0x85a6('0xa')](),controller['removeFaxInteractions']);router[_0x85a6('0x64')]('/:id/sms_interactions',auth[_0x85a6('0xa')](),controller['removeSmsInteractions']);router[_0x85a6('0x64')](_0x85a6('0x53'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x69')]);router[_0x85a6('0x64')](_0x85a6('0x55'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x6a')]);router[_0x85a6('0x64')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x85a6('0x6b')]);router[_0x85a6('0x64')](_0x85a6('0x58'),auth[_0x85a6('0xa')](),controller['removeMailAccounts']);router[_0x85a6('0x64')](_0x85a6('0x31'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x6c')]);router['delete'](_0x85a6('0x5b'),auth[_0x85a6('0xa')](),controller['removeSmsAccounts']);router[_0x85a6('0x64')](_0x85a6('0x33'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x6d')]);router[_0x85a6('0x64')](_0x85a6('0x5d'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x6e')]);router[_0x85a6('0x64')](_0x85a6('0x37'),auth[_0x85a6('0xa')](),controller[_0x85a6('0x6f')]);router[_0x85a6('0x39')](_0x85a6('0x70'),auth['isAuthenticated'](),controller[_0x85a6('0x71')]);module['exports']=router; \ No newline at end of file +var _0xdb90=['addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','changePassword','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./user.controller','get','isAuthenticated','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','/create_many','addQueues','diskStorage','join','root','server/files/images/','format','now','originalname','/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/logout','logout','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts'];(function(_0x1e4de9,_0x2366a2){var _0x6ff6b8=function(_0x2785b4){while(--_0x2785b4){_0x1e4de9['push'](_0x1e4de9['shift']());}};_0x6ff6b8(++_0x2366a2);}(_0xdb90,0xf8));var _0x0db9=function(_0x4f3e33,_0x5704a8){_0x4f3e33=_0x4f3e33-0x0;var _0x1a070c=_0xdb90[_0x4f3e33];return _0x1a070c;};'use strict';var multer=require(_0x0db9('0x0'));var util=require(_0x0db9('0x1'));var path=require('path');var timeout=require(_0x0db9('0x2'));var express=require(_0x0db9('0x3'));var router=express[_0x0db9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0db9('0x5'));var config=require('../../config/environment');var controller=require(_0x0db9('0x6'));router[_0x0db9('0x7')]('/',auth[_0x0db9('0x8')](),controller['index']);router[_0x0db9('0x7')](_0x0db9('0x9'),auth[_0x0db9('0x8')](),controller[_0x0db9('0xa')]);router['get'](_0x0db9('0xb'),auth['isAuthenticated'](),controller[_0x0db9('0xc')]);router['get'](_0x0db9('0xd'),auth[_0x0db9('0x8')](),controller[_0x0db9('0xe')]);router[_0x0db9('0x7')](_0x0db9('0xf'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x10')]);router[_0x0db9('0x7')]('/:id/avatar',controller['getAvatar']);router[_0x0db9('0x7')](_0x0db9('0x11'),auth['isAuthenticated'](),controller[_0x0db9('0x12')]);router[_0x0db9('0x7')](_0x0db9('0x13'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x14')]);router[_0x0db9('0x7')](_0x0db9('0x15'),auth['isAuthenticated'](),controller[_0x0db9('0x16')]);router[_0x0db9('0x7')](_0x0db9('0x17'),auth[_0x0db9('0x8')](),controller['getVoiceQueuesRt']);router['get'](_0x0db9('0x18'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x19')]);router[_0x0db9('0x7')](_0x0db9('0x1a'),auth['isAuthenticated'](),controller['getRecordings']);router['get'](_0x0db9('0x1b'),auth['isAuthenticated'](),controller[_0x0db9('0x1c')]);router[_0x0db9('0x7')](_0x0db9('0x1d'),auth[_0x0db9('0x8')](),controller['getChatInteractions']);router[_0x0db9('0x7')](_0x0db9('0x1e'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x1f')]);router[_0x0db9('0x7')](_0x0db9('0x20'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x21')]);router[_0x0db9('0x7')](_0x0db9('0x22'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x23')]);router[_0x0db9('0x7')]('/:id/fax/interactions',auth[_0x0db9('0x8')](),controller[_0x0db9('0x24')]);router[_0x0db9('0x7')](_0x0db9('0x25'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x26')]);router[_0x0db9('0x7')](_0x0db9('0x27'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x28')]);router['get'](_0x0db9('0x29'),auth[_0x0db9('0x8')](),controller['getLists']);router[_0x0db9('0x7')]('/:id/agents',auth[_0x0db9('0x8')](),controller[_0x0db9('0x2a')]);router[_0x0db9('0x7')](_0x0db9('0x2b'),auth['isAuthenticated'](),controller[_0x0db9('0x2c')]);router[_0x0db9('0x7')](_0x0db9('0x2d'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x2e')]);router['get']('/:id/mail_accounts',auth[_0x0db9('0x8')](),controller[_0x0db9('0x2f')]);router[_0x0db9('0x7')](_0x0db9('0x30'),auth[_0x0db9('0x8')](),controller['getOpenchannelAccounts']);router[_0x0db9('0x7')](_0x0db9('0x31'),auth['isAuthenticated'](),controller[_0x0db9('0x32')]);router['get'](_0x0db9('0x33'),auth[_0x0db9('0x8')](),controller['getChatWebsites']);router[_0x0db9('0x7')](_0x0db9('0x34'),auth[_0x0db9('0x8')](),controller['getWhatsappAccounts']);router[_0x0db9('0x7')](_0x0db9('0x35'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x36')]);router[_0x0db9('0x7')](_0x0db9('0x37'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x38')]);router[_0x0db9('0x39')](_0x0db9('0x13'),auth['isAuthenticated'](),controller['addContacts']);router['post']('/',auth['isAuthenticated'](),controller[_0x0db9('0x3a')]);router[_0x0db9('0x39')](_0x0db9('0x3b'),auth[_0x0db9('0x8')](),controller['bulkCreate']);router[_0x0db9('0x39')]('/:id/queues',auth[_0x0db9('0x8')](),controller[_0x0db9('0x3c')]);var upload=multer({'storage':multer[_0x0db9('0x3d')]({'destination':function(_0x57cd1d,_0x194c86,_0x2b29fb){_0x2b29fb(null,path[_0x0db9('0x3e')](config[_0x0db9('0x3f')],_0x0db9('0x40')));},'filename':function(_0x42996e,_0x10f20c,_0x481bf){_0x481bf(null,util[_0x0db9('0x41')]('%s-%s',Date[_0x0db9('0x42')](),_0x10f20c[_0x0db9('0x43')]));}})});router[_0x0db9('0x39')](_0x0db9('0x44'),upload[_0x0db9('0x45')](_0x0db9('0x46')),controller[_0x0db9('0x47')]);router[_0x0db9('0x39')](_0x0db9('0x48'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x49')]);router[_0x0db9('0x39')](_0x0db9('0x4a'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x4b')]);router[_0x0db9('0x39')]('/:id/pause',auth[_0x0db9('0x8')](),controller[_0x0db9('0x4c')]);router['post'](_0x0db9('0x4d'),auth['isAuthenticated'](),controller[_0x0db9('0x4e')]);router[_0x0db9('0x39')]('/:id/teams',auth[_0x0db9('0x8')](),controller[_0x0db9('0x4f')]);router[_0x0db9('0x39')](_0x0db9('0x50'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x51')]);router[_0x0db9('0x39')](_0x0db9('0x52'),auth['isAuthenticated'](),controller[_0x0db9('0x53')]);router[_0x0db9('0x39')](_0x0db9('0x54'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x55')]);router[_0x0db9('0x39')](_0x0db9('0x56'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x57')]);router[_0x0db9('0x39')](_0x0db9('0x58'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x59')]);router['post'](_0x0db9('0x5a'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x5b')]);router['post'](_0x0db9('0x2d'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x5c')]);router[_0x0db9('0x39')](_0x0db9('0x5d'),auth[_0x0db9('0x8')](),controller['addMailAccounts']);router[_0x0db9('0x39')](_0x0db9('0x30'),auth[_0x0db9('0x8')](),controller['addOpenchannelAccounts']);router[_0x0db9('0x39')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x0db9('0x5e')]);router[_0x0db9('0x39')]('/:id/chat_websites',auth[_0x0db9('0x8')](),controller[_0x0db9('0x5f')]);router[_0x0db9('0x39')](_0x0db9('0x34'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x60')]);router[_0x0db9('0x39')](_0x0db9('0x37'),auth['isAuthenticated'](),controller[_0x0db9('0x61')]);router[_0x0db9('0x62')](_0x0db9('0xf'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x63')]);router[_0x0db9('0x62')]('/:id/password',auth[_0x0db9('0x8')](),controller[_0x0db9('0x64')]);router[_0x0db9('0x65')](_0x0db9('0x15'),auth['isAuthenticated'](),controller['removeQueues']);router[_0x0db9('0x65')](_0x0db9('0x27'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x66')]);router['delete'](_0x0db9('0xf'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x67')]);router[_0x0db9('0x65')](_0x0db9('0x50'),auth['isAuthenticated'](),controller[_0x0db9('0x68')]);router[_0x0db9('0x65')](_0x0db9('0x52'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x69')]);router[_0x0db9('0x65')]('/:id/fax_interactions',auth[_0x0db9('0x8')](),controller['removeFaxInteractions']);router[_0x0db9('0x65')](_0x0db9('0x56'),auth[_0x0db9('0x8')](),controller['removeSmsInteractions']);router['delete'](_0x0db9('0x58'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x6a')]);router[_0x0db9('0x65')](_0x0db9('0x5a'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x6b')]);router[_0x0db9('0x65')](_0x0db9('0x2d'),auth['isAuthenticated'](),controller[_0x0db9('0x6c')]);router[_0x0db9('0x65')](_0x0db9('0x5d'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x6d')]);router['delete']('/:id/openchannel_accounts',auth[_0x0db9('0x8')](),controller['removeOpenchannelAccounts']);router[_0x0db9('0x65')](_0x0db9('0x31'),auth['isAuthenticated'](),controller[_0x0db9('0x6e')]);router['delete'](_0x0db9('0x33'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x6f')]);router[_0x0db9('0x65')](_0x0db9('0x34'),auth[_0x0db9('0x8')](),controller[_0x0db9('0x70')]);router[_0x0db9('0x65')](_0x0db9('0x37'),auth[_0x0db9('0x8')](),controller['removeApiKey']);router[_0x0db9('0x39')]('/:id/messengerSoundNotification',auth['isAuthenticated'](),controller['messengerSoundNotification']);module[_0x0db9('0x71')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 7220f6a..a898292 100644 --- a/server/api/user/user.attributes.js +++ b/server/api/user/user.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f8f=['callerid','BOOLEAN','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','yes','never','\x22\x22\x20<>','accept','refuse','originate','uas','fingerprint','certificate','active','passive','actpass','nonat','update,nonat','DATE','TEXT','isArray','udp','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','dtlsverify','/etc/pki/tls/certs/motion.crt','permissions','map','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','lodash','exports','name','setDataValue','defaultuser','STRING','fullname','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','user','telephone','local','accountcode'];(function(_0x2784b0,_0x209f7a){var _0x218d16=function(_0x5388a9){while(--_0x5388a9){_0x2784b0['push'](_0x2784b0['shift']());}};_0x218d16(++_0x209f7a);}(_0x7f8f,0xa7));var _0xf7f8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7f8f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xf7f8('0x0'));var moment=require('moment');var util=require('util');var _=require(_0xf7f8('0x1'));module[_0xf7f8('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf7f8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x505b00){this[_0xf7f8('0x4')]('name',_0x505b00);this['setDataValue'](_0xf7f8('0x5'),_0x505b00);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':![],'set':function(_0x311166){this[_0xf7f8('0x4')](_0xf7f8('0x7'),_0x311166);this['setDataValue']('callerid',util[_0xf7f8('0x8')](_0xf7f8('0x9'),_0x311166,this[_0xf7f8('0xa')](_0xf7f8('0xb'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':![],'unique':_0xf7f8('0xc'),'validate':{'isEmail':!![]},'set':function(_0x28d220){if(_0x28d220){this[_0xf7f8('0x4')]('email',_0x28d220[_0xf7f8('0xd')]());}}},'role':{'type':Sequelize[_0xf7f8('0xe')]('admin',_0xf7f8('0xf'),'agent',_0xf7f8('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xf7f8('0x6')],'defaultValue':_0xf7f8('0x11')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xf7f8('0xb'),'set':function(_0x551afe){this['setDataValue'](_0xf7f8('0xb'),_0x551afe);this[_0xf7f8('0x4')](_0xf7f8('0x12'),_0x551afe);this[_0xf7f8('0x4')](_0xf7f8('0x13'),util[_0xf7f8('0x8')]('\x22%s\x22\x20<%s>',this[_0xf7f8('0xa')](_0xf7f8('0x7')),_0x551afe));}},'salt':{'type':Sequelize[_0xf7f8('0x6')]},'phone':{'type':Sequelize[_0xf7f8('0x6')]},'mobile':{'type':Sequelize[_0xf7f8('0x6')]},'address':{'type':Sequelize[_0xf7f8('0x6')]},'zipcode':{'type':Sequelize[_0xf7f8('0x6')]},'userpic':{'type':Sequelize[_0xf7f8('0x6')]},'city':{'type':Sequelize[_0xf7f8('0x6')]},'country':{'type':Sequelize[_0xf7f8('0x6')]},'online':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xf7f8('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xf7f8('0x16')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xf7f8('0x16')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xf7f8('0x16')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xf7f8('0x16')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xf7f8('0x16')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xf7f8('0x16')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xf7f8('0x16')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xf7f8('0x17')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xf7f8('0x16')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xf7f8('0x16')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xf7f8('0x16')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x18'),_0xf7f8('0xf'),_0xf7f8('0x19')),'allowNull':!![],'defaultValue':_0xf7f8('0x18')},'context':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![],'defaultValue':_0xf7f8('0x1a')},'callingpres':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x1b'),_0xf7f8('0x1c'),_0xf7f8('0x1d'),_0xf7f8('0x1e'),_0xf7f8('0x1f'),_0xf7f8('0x20'),_0xf7f8('0x21'),_0xf7f8('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'permit':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'transport':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![],'defaultValue':'udp','set':function(_0x200e53){this[_0xf7f8('0x4')](_0xf7f8('0x23'),_0x200e53?_0x200e53[_0xf7f8('0x24')](','):null);},'get':function(){return this[_0xf7f8('0xa')](_0xf7f8('0x23'))?this['getDataValue'](_0xf7f8('0x23'))[_0xf7f8('0x25')](','):null;},'comment':_0xf7f8('0x26')},'dtmfmode':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x27'),'info',_0xf7f8('0x28'),_0xf7f8('0x29'),_0xf7f8('0x2a')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM']('yes','no','nonat',_0xf7f8('0x2b'),_0xf7f8('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf7f8('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'nat':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![],'defaultValue':_0xf7f8('0x2d'),'set':function(_0x1cae60){this[_0xf7f8('0x4')]('nat',_0x1cae60?_0x1cae60[_0xf7f8('0x24')](','):null);},'get':function(){return this[_0xf7f8('0xa')]('nat')?this['getDataValue'](_0xf7f8('0x2e'))[_0xf7f8('0x25')](','):null;},'comment':_0xf7f8('0x2f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xf7f8('0x6')]},'pickupgroup':{'type':Sequelize[_0xf7f8('0x6')]},'namedpickupgroup':{'type':Sequelize[_0xf7f8('0x6')]},'language':{'type':Sequelize[_0xf7f8('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf7f8('0x6')]},'disallow':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':![],'defaultValue':_0xf7f8('0x30')},'allow':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':![],'defaultValue':_0xf7f8('0x31'),'set':function(_0x385499){this[_0xf7f8('0x4')](_0xf7f8('0x32'),_0x385499?_0x385499[_0xf7f8('0x24')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xf7f8('0xa')](_0xf7f8('0x32'))?this['getDataValue'](_0xf7f8('0x32'))['split'](';'):null;},'comment':_0xf7f8('0x33')},'autoframing':{'type':Sequelize[_0xf7f8('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![],'set':function(_0x5b4dbb){this[_0xf7f8('0x4')](_0xf7f8('0x34'),_0x5b4dbb?_0x5b4dbb[_0xf7f8('0x24')](','):null);},'get':function(){return this[_0xf7f8('0xa')](_0xf7f8('0x34'))?this['getDataValue'](_0xf7f8('0x34'))[_0xf7f8('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no',_0xf7f8('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xf7f8('0x16')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![],'defaultValue':_0xf7f8('0x37')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xf7f8('0xe')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xf7f8('0xe')]('yes','no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x38'),_0xf7f8('0x39'),_0xf7f8('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xf7f8('0x16')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xf7f8('0x16')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xf7f8('0xe')]('uac',_0xf7f8('0x3b')),'allowNull':!![],'defaultValue':_0xf7f8('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no'),'allowNull':!![],'defaultValue':_0xf7f8('0x35')},'keepalive':{'type':Sequelize[_0xf7f8('0x16')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xf7f8('0x16')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xf7f8('0x16')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xf7f8('0x16')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xf7f8('0x16')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xf7f8('0x16')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xf7f8('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xf7f8('0xe')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no',_0xf7f8('0x3c'),_0xf7f8('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0xf7f8('0x3e'),_0xf7f8('0x3f'),_0xf7f8('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xf7f8('0x16')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xf7f8('0x35'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no',_0xf7f8('0x41'),_0xf7f8('0x2b'),_0xf7f8('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xf7f8('0x6')]},'resetPasswordExpires':{'type':Sequelize[_0xf7f8('0x43')]},'passwordResetAt':{'type':Sequelize[_0xf7f8('0x43')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xf7f8('0x44')]},'showWebBar':{'type':Sequelize[_0xf7f8('0x16')],'defaultValue':0x0,'set':function(_0x1e5123){this[_0xf7f8('0x4')]('showWebBar',_0x1e5123);var _0x4308fb=this['get']({'plain':!![]});switch(_0x1e5123){case 0x0:case 0x1:var _0x7fee34=_0x4308fb[_0xf7f8('0x23')]?_[_0xf7f8('0x45')](_0x4308fb['transport'])?_0x4308fb['transport']['join']():_0x4308fb['transport']:_0xf7f8('0x46');if(_0x7fee34===_0xf7f8('0x47')){_0x7fee34='udp';}this['setDataValue'](_0xf7f8('0x23'),_0x7fee34);this[_0xf7f8('0x4')](_0xf7f8('0x48'),'no');this[_0xf7f8('0x4')](_0xf7f8('0x49'),null);this[_0xf7f8('0x4')](_0xf7f8('0x4a'),null);this[_0xf7f8('0x4')](_0xf7f8('0x4b'),null);this[_0xf7f8('0x4')](_0xf7f8('0x4c'),null);this[_0xf7f8('0x4')]('dtlsverify',null);this[_0xf7f8('0x4')](_0xf7f8('0x4d'),null);this[_0xf7f8('0x4')](_0xf7f8('0x4e'),null);this[_0xf7f8('0x4')](_0xf7f8('0x4f'),null);this[_0xf7f8('0x4')](_0xf7f8('0x50'),'no');break;case 0x2:this[_0xf7f8('0x4')](_0xf7f8('0x23'),'wss');this[_0xf7f8('0x4')]('encryption','yes');this[_0xf7f8('0x4')](_0xf7f8('0x49'),_0xf7f8('0x35'));this[_0xf7f8('0x4')](_0xf7f8('0x4a'),'yes');this[_0xf7f8('0x4')](_0xf7f8('0x4b'),_0xf7f8('0x35'));this[_0xf7f8('0x4')]('dtlsenable',_0xf7f8('0x35'));this[_0xf7f8('0x4')](_0xf7f8('0x51'),'no');this['setDataValue']('dtlssetup',_0xf7f8('0x40'));this[_0xf7f8('0x4')]('dtlscertfile',_0x4308fb[_0xf7f8('0x4e')]||_0xf7f8('0x52'));this[_0xf7f8('0x4')](_0xf7f8('0x4f'),_0x4308fb[_0xf7f8('0x4f')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0xf7f8('0x50'),_0xf7f8('0x35'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x5bcef6){this[_0xf7f8('0x4')](_0xf7f8('0x53'),_0x5bcef6?_0x5bcef6[_0xf7f8('0x24')](','):[]);},'get':function(){return this[_0xf7f8('0xa')](_0xf7f8('0x53'))?_[_0xf7f8('0x54')](this[_0xf7f8('0xa')](_0xf7f8('0x53'))[_0xf7f8('0x25')](','),function(_0x4d743a){return parseInt(_0x4d743a,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xf7f8('0x6')]},'phoneBarBusyNumber':{'type':Sequelize[_0xf7f8('0x6')]},'phoneBarUnconditional':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xf7f8('0x6')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xf7f8('0x16')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xf7f8('0xe')](_0xf7f8('0x35'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xf7f8('0x6')]},'phoneBarEnableJaws':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf7f8('0xa')]('phoneBarEnableScreenRecordingByAgent')?this[_0xf7f8('0xa')](_0xf7f8('0x55')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'interface':{'type':Sequelize[_0xf7f8('0x6')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xf7f8('0x6')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![],'set':function(_0x2a1e05){if(typeof _0x2a1e05===_0xf7f8('0x56')){var _0x5cf679=_0x2a1e05==='1'?!![]:_0x2a1e05==='0'?![]:_0x2a1e05==='true'?!![]:_0x2a1e05===_0xf7f8('0x57')?![]:![];this[_0xf7f8('0x4')](_0xf7f8('0x58'),_0x5cf679);}else{this[_0xf7f8('0x4')](_0xf7f8('0x58'),_0x2a1e05);}}},'blocked':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![],'set':function(_0x38fd8c){this[_0xf7f8('0x4')](_0xf7f8('0x59'),_0x38fd8c);if(_0x38fd8c===!![]){this[_0xf7f8('0x4')](_0xf7f8('0x5a'),moment());this[_0xf7f8('0x4')](_0xf7f8('0x5b'),0x0);}else{this[_0xf7f8('0x4')](_0xf7f8('0x5a'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xf7f8('0x16')](0x5)[_0xf7f8('0x5c')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xf7f8('0x16')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xf7f8('0x16')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xf7f8('0x16')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0xf7f8('0x14')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0xf7f8('0x16')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9b0a=['ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','refuse','originate','uac','uas','certificate','active','update,nonat','TEXT','showWebBar','get','force_avp','icesupport','dtlsenable','dtlsverify','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','encryption','avpf','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','internal','email','toLowerCase','admin','user','agent','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','ENUM','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN'];(function(_0x403f79,_0x47f0da){var _0x31c7ef=function(_0x1c9306){while(--_0x1c9306){_0x403f79['push'](_0x403f79['shift']());}};_0x31c7ef(++_0x47f0da);}(_0x9b0a,0x1b5));var _0xa9b0=function(_0x5b474c,_0x53a6e5){_0x5b474c=_0x5b474c-0x0;var _0x6f3112=_0x9b0a[_0x5b474c];return _0x6f3112;};'use strict';var Sequelize=require(_0xa9b0('0x0'));var moment=require(_0xa9b0('0x1'));var util=require(_0xa9b0('0x2'));var _=require('lodash');module[_0xa9b0('0x3')]={'name':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':![],'unique':_0xa9b0('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4c65ad){this[_0xa9b0('0x6')](_0xa9b0('0x5'),_0x4c65ad);this['setDataValue'](_0xa9b0('0x7'),_0x4c65ad);},'comment':_0xa9b0('0x8')},'fullname':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':![],'set':function(_0x41bb3c){this[_0xa9b0('0x6')](_0xa9b0('0x9'),_0x41bb3c);this['setDataValue'](_0xa9b0('0xa'),util[_0xa9b0('0xb')]('\x22%s\x22\x20<%s>',_0x41bb3c,this['getDataValue'](_0xa9b0('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':![],'unique':_0xa9b0('0xd'),'validate':{'isEmail':!![]},'set':function(_0x5400a1){if(_0x5400a1){this[_0xa9b0('0x6')](_0xa9b0('0xd'),_0x5400a1[_0xa9b0('0xe')]());}}},'role':{'type':Sequelize['ENUM'](_0xa9b0('0xf'),_0xa9b0('0x10'),_0xa9b0('0x11'),'telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xa9b0('0x4')],'defaultValue':_0xa9b0('0x12')},'internal':{'type':Sequelize[_0xa9b0('0x13')](0xb),'allowNull':![],'unique':'internal','set':function(_0x56b5b1){this[_0xa9b0('0x6')](_0xa9b0('0xc'),_0x56b5b1);this[_0xa9b0('0x6')](_0xa9b0('0x14'),_0x56b5b1);this[_0xa9b0('0x6')]('callerid',util[_0xa9b0('0xb')](_0xa9b0('0x15'),this[_0xa9b0('0x16')](_0xa9b0('0x9')),_0x56b5b1));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa9b0('0x4')]},'mobile':{'type':Sequelize[_0xa9b0('0x4')]},'address':{'type':Sequelize[_0xa9b0('0x4')]},'zipcode':{'type':Sequelize[_0xa9b0('0x4')]},'userpic':{'type':Sequelize[_0xa9b0('0x4')]},'city':{'type':Sequelize[_0xa9b0('0x4')]},'country':{'type':Sequelize[_0xa9b0('0x4')]},'online':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xa9b0('0x4')],'defaultValue':_0xa9b0('0x18')},'lastPauseAt':{'type':Sequelize[_0xa9b0('0x19')]},'chatCapacity':{'type':Sequelize[_0xa9b0('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xa9b0('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xa9b0('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xa9b0('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xa9b0('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xa9b0('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa9b0('0x1a')},'ipaddr':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xa9b0('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xa9b0('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xa9b0('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xa9b0('0x1b')](_0xa9b0('0x1c'),_0xa9b0('0x10'),_0xa9b0('0x1d')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize['ENUM'](_0xa9b0('0x1e'),_0xa9b0('0x1f'),_0xa9b0('0x20'),_0xa9b0('0x21'),_0xa9b0('0x22'),_0xa9b0('0x23'),'PROHIB_FAILED_SCREEN',_0xa9b0('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa9b0('0x25'),'set':function(_0x1330b7){this[_0xa9b0('0x6')]('transport',_0x1330b7?_0x1330b7[_0xa9b0('0x26')](','):null);},'get':function(){return this['getDataValue'](_0xa9b0('0x27'))?this[_0xa9b0('0x16')]('transport')['split'](','):null;},'comment':_0xa9b0('0x28')},'dtmfmode':{'type':Sequelize[_0xa9b0('0x1b')](_0xa9b0('0x29'),_0xa9b0('0x2a'),'shortinfo','inband',_0xa9b0('0x2b')),'allowNull':!![],'defaultValue':_0xa9b0('0x29')},'directmedia':{'type':Sequelize[_0xa9b0('0x1b')](_0xa9b0('0x2c'),'no',_0xa9b0('0x2d'),_0xa9b0('0x2e'),_0xa9b0('0x2f')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa9b0('0x30'),'set':function(_0x4fd9ea){this[_0xa9b0('0x6')]('nat',_0x4fd9ea?_0x4fd9ea[_0xa9b0('0x26')](','):null);},'get':function(){return this[_0xa9b0('0x16')](_0xa9b0('0x31'))?this[_0xa9b0('0x16')](_0xa9b0('0x31'))[_0xa9b0('0x32')](','):null;},'comment':_0xa9b0('0x33')},'callgroup':{'type':Sequelize[_0xa9b0('0x4')]},'namedcallgroup':{'type':Sequelize[_0xa9b0('0x4')]},'pickupgroup':{'type':Sequelize[_0xa9b0('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa9b0('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':![],'defaultValue':_0xa9b0('0x34'),'set':function(_0x1a1a4d){this[_0xa9b0('0x6')](_0xa9b0('0x35'),_0x1a1a4d?_0x1a1a4d[_0xa9b0('0x26')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xa9b0('0x16')](_0xa9b0('0x35'))?this[_0xa9b0('0x16')]('allow')[_0xa9b0('0x32')](';'):null;},'comment':_0xa9b0('0x36')},'autoframing':{'type':Sequelize['ENUM'](_0xa9b0('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![],'set':function(_0x1a5567){this[_0xa9b0('0x6')](_0xa9b0('0x37'),_0x1a5567?_0x1a5567[_0xa9b0('0x26')](','):null);},'get':function(){return this[_0xa9b0('0x16')](_0xa9b0('0x37'))?this[_0xa9b0('0x16')](_0xa9b0('0x37'))[_0xa9b0('0x32')](','):null;},'comment':_0xa9b0('0x38')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa9b0('0x1b')](_0xa9b0('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa9b0('0x1b')](_0xa9b0('0x2c'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xa9b0('0x1b')](_0xa9b0('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xa9b0('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xa9b0('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![],'defaultValue':_0xa9b0('0x39')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xa9b0('0x1b')](_0xa9b0('0x2c'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xa9b0('0x1b')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xa9b0('0x1b')](_0xa9b0('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xa9b0('0x1b')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xa9b0('0x1b')](_0xa9b0('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xa9b0('0x1b')]('yes','no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa9b0('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xa9b0('0x1b')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xa9b0('0x1b')]('accept',_0xa9b0('0x3a'),_0xa9b0('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xa9b0('0x3c'),_0xa9b0('0x3d')),'allowNull':!![],'defaultValue':_0xa9b0('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xa9b0('0x1b')](_0xa9b0('0x2c'),'no'),'allowNull':!![],'defaultValue':_0xa9b0('0x2c')},'keepalive':{'type':Sequelize[_0xa9b0('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xa9b0('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xa9b0('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xa9b0('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xa9b0('0x1b')](_0xa9b0('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xa9b0('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xa9b0('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xa9b0('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xa9b0('0x1b')](_0xa9b0('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xa9b0('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xa9b0('0x1b')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xa9b0('0x1b')](_0xa9b0('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xa9b0('0x1b')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xa9b0('0x1b')](_0xa9b0('0x2c'),'no','fingerprint',_0xa9b0('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xa9b0('0x1b')](_0xa9b0('0x3f'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xa9b0('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xa9b0('0x1b')](_0xa9b0('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xa9b0('0x1b')](_0xa9b0('0x2c'),'no',_0xa9b0('0x2d'),_0xa9b0('0x2e'),_0xa9b0('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xa9b0('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xa9b0('0x41')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x520ee0){this[_0xa9b0('0x6')](_0xa9b0('0x42'),_0x520ee0);var _0x58fe3c=this[_0xa9b0('0x43')]({'plain':!![]});switch(_0x520ee0){case 0x0:case 0x1:var _0x57a3e9=_0x58fe3c[_0xa9b0('0x27')]?_['isArray'](_0x58fe3c[_0xa9b0('0x27')])?_0x58fe3c['transport'][_0xa9b0('0x26')]():_0x58fe3c[_0xa9b0('0x27')]:_0xa9b0('0x25');if(_0x57a3e9==='wss'){_0x57a3e9=_0xa9b0('0x25');}this[_0xa9b0('0x6')](_0xa9b0('0x27'),_0x57a3e9);this['setDataValue']('encryption','no');this[_0xa9b0('0x6')]('avpf',null);this[_0xa9b0('0x6')](_0xa9b0('0x44'),null);this[_0xa9b0('0x6')](_0xa9b0('0x45'),null);this[_0xa9b0('0x6')](_0xa9b0('0x46'),null);this[_0xa9b0('0x6')](_0xa9b0('0x47'),null);this[_0xa9b0('0x6')]('dtlssetup',null);this[_0xa9b0('0x6')](_0xa9b0('0x48'),null);this[_0xa9b0('0x6')](_0xa9b0('0x49'),null);this[_0xa9b0('0x6')](_0xa9b0('0x4a'),'no');break;case 0x2:this['setDataValue']('transport',_0xa9b0('0x4b'));this['setDataValue'](_0xa9b0('0x4c'),_0xa9b0('0x2c'));this[_0xa9b0('0x6')](_0xa9b0('0x4d'),_0xa9b0('0x2c'));this['setDataValue']('force_avp',_0xa9b0('0x2c'));this[_0xa9b0('0x6')](_0xa9b0('0x45'),_0xa9b0('0x2c'));this['setDataValue'](_0xa9b0('0x46'),_0xa9b0('0x2c'));this['setDataValue']('dtlsverify','no');this[_0xa9b0('0x6')](_0xa9b0('0x4e'),_0xa9b0('0x4f'));this[_0xa9b0('0x6')](_0xa9b0('0x48'),_0x58fe3c[_0xa9b0('0x48')]||_0xa9b0('0x50'));this[_0xa9b0('0x6')]('dtlsprivatekey',_0x58fe3c[_0xa9b0('0x49')]||_0xa9b0('0x51'));this[_0xa9b0('0x6')](_0xa9b0('0x4a'),_0xa9b0('0x2c'));break;default:}}},'permissions':{'type':Sequelize[_0xa9b0('0x41')],'set':function(_0x253514){this[_0xa9b0('0x6')](_0xa9b0('0x52'),_0x253514?_0x253514[_0xa9b0('0x26')](','):[]);},'get':function(){return this[_0xa9b0('0x16')](_0xa9b0('0x52'))?_[_0xa9b0('0x53')](this[_0xa9b0('0x16')]('permissions')[_0xa9b0('0x32')](','),function(_0x122e0a){return parseInt(_0x122e0a,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xa9b0('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xa9b0('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xa9b0('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xa9b0('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xa9b0('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xa9b0('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xa9b0('0x54')],'get':function(){return this['getDataValue'](_0xa9b0('0x55'))?this[_0xa9b0('0x16')](_0xa9b0('0x55')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xa9b0('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![],'set':function(_0x4984ea){if(typeof _0x4984ea===_0xa9b0('0x56')){var _0x55ac58=_0x4984ea==='1'?!![]:_0x4984ea==='0'?![]:_0x4984ea===_0xa9b0('0x57')?!![]:_0x4984ea===_0xa9b0('0x58')?![]:![];this[_0xa9b0('0x6')](_0xa9b0('0x59'),_0x55ac58);}else{this['setDataValue'](_0xa9b0('0x59'),_0x4984ea);}}},'blocked':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![],'set':function(_0x50e93d){this[_0xa9b0('0x6')](_0xa9b0('0x5a'),_0x50e93d);if(_0x50e93d===!![]){this[_0xa9b0('0x6')](_0xa9b0('0x5b'),moment());this['setDataValue'](_0xa9b0('0x5c'),0x0);}else{this[_0xa9b0('0x6')](_0xa9b0('0x5b'),null);}}},'blockedAt':{'type':Sequelize[_0xa9b0('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xa9b0('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xa9b0('0x13')](0x5)[_0xa9b0('0x5d')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xa9b0('0x13')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xa9b0('0x13')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xa9b0('0x13')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xa9b0('0x13')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0xa9b0('0x17')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 8b42b28..bf9d255 100644 --- a/server/api/user/user.controller.js +++ b/server/api/user/user.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9432=['ChatOpenTabs','FaxOpenTabs','FAX','OpenchannelOpenTabs','createdAt','MailOpenTabs','WhatsappOpenTabs','WHATSAPP','concat','getContacts','findOne','CmList','List','Tags','color','tag','getQueues','keys','Queue','filters','intersection','model','fields','order','sort','pick','merge','Unknown\x20role','hasOwnProperty','nolimit','Queues','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','UserId','MailInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','login','phone','mobile','loginInPause','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','connection','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','resolve','logout','pause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','openchannelPause','whatsappPause','pauseType','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','addAgent','getDataValue','UserVoicePrefix','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','flattenDeep','removeAgent','Voice','TeamVoicePrefix','VoicePrefixId','getAgents','values','CmHopper','addChatInteractions','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','addFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','$and','$gt','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','CmContact','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','unknown','teams','queues','inbound','flatten','toString','lower','asc','desc','substring','uniqBy','getRealtimeAgents','offline','voiceStatus','unavailable','busy','slice','charAt','QueryTypes','select','ui.','InteractionId','ui.createdAt','ui.UserId\x20=\x20?','messengerSoundNotification','enabled','moment','util','path','lodash','squel','jayson/promise','../../components/auth/service','../../components/contacts','../../config/logger','api','../../config/environment','../../config/license/util','APIBadRequestError','APINotFoundError','../../errors/api','handleError','socket.io-emitter','redis','./user.socket','defaults','localhost','client','http','sendStatus','status','end','json','undefined','limit','count','offset','set','request','then','request\x20sent','debug','error','code','message','User,\x20%s,\x20%s','info','result','update','emit','userNotification:recalc:','destroy','get','role','admin','user','Agents','agent','telephone','filter','ignore','value','includes','find','name','UserProfileResource','stack','rawAttributes','fieldName','type','key','previousPasswords','resetPasswordToken','resetPasswordExpires','md5secret','index','getOptions','where','User','query','includeAll','include','true','UserSetting','userSetting','attributes','push','findAll','rows','openTabs','dataValues','sms','fax','mail','whatsapp','all','catch','show','params','options','chat','openchannel','body','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','password','max','min_internal','isNil','sequelize','SELECT','length','from','voicemail','mailbox','VoiceMail','email','permissions','102','103','113','104','105','106','107','108','100','111','114','115','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','Telephones','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','map','create','UserProfileSection','compact','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','validatePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','online','voicePause','interface','Unknown\x20channel','capitalize','toLowerCase','penalty','spread','QueueId','Queue:save','VoiceQueue','voice','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','isValidChannel','Queue:remove','addAvatar','userpic','file','filename','join','server/files/images/logos/default_profile.png','download','existsSync','root','server/files/images/','getOpenTabs'];(function(_0x580c04,_0x42fd95){var _0x58e173=function(_0x154cf8){while(--_0x154cf8){_0x580c04['push'](_0x580c04['shift']());}};_0x58e173(++_0x42fd95);}(_0x9432,0xc9));var _0x2943=function(_0x15c86a,_0xe9ffb2){_0x15c86a=_0x15c86a-0x0;var _0x5987ba=_0x9432[_0x15c86a];return _0x5987ba;};'use strict';var moment=require(_0x2943('0x0'));var util=require(_0x2943('0x1'));var path=require(_0x2943('0x2'));var fs=require('fs');var _=require(_0x2943('0x3'));var squel=require(_0x2943('0x4'));var Redis=require('ioredis');var jayson=require(_0x2943('0x5'));var authService=require(_0x2943('0x6'));var contacts=require(_0x2943('0x7'));var qs=require('../../components/parsers/qs');var rta=require('../../components/realtime/agents');var logger=require(_0x2943('0x8'))(_0x2943('0x9'));var utils=require('../../config/utils');var config=require(_0x2943('0xa'));var licenseUtil=require(_0x2943('0xb'));var APIBadRequestError=require('../../errors/api')[_0x2943('0xc')];var APINotFoundError=require('../../errors/api')[_0x2943('0xd')];var APIForbiddenError=require(_0x2943('0xe'))['APIForbiddenrror'];var APIHandleError=require(_0x2943('0xe'))[_0x2943('0xf')];var db=require('../../mysqldb')['db'];var socket=require(_0x2943('0x10'))(new Redis(config[_0x2943('0x11')]));require(_0x2943('0x12'))['register'](socket);config[_0x2943('0x11')]=_[_0x2943('0x13')](config[_0x2943('0x11')],{'host':_0x2943('0x14'),'port':0x18eb});var amiClient=jayson[_0x2943('0x15')][_0x2943('0x16')]({'port':0x232a});var values;function respondWithStatusCode(_0x5d9d9b,_0x34b850){_0x34b850=_0x34b850||0xcc;return function(_0x53b249){if(_0x53b249){return _0x5d9d9b[_0x2943('0x17')](_0x34b850);}return _0x5d9d9b[_0x2943('0x18')](_0x34b850)[_0x2943('0x19')]();};}function respondWithResult(_0x52eb9d,_0x2976da){_0x2976da=_0x2976da||0xc8;return function(_0x46d04b){if(_0x46d04b){return _0x52eb9d[_0x2943('0x18')](_0x2976da)[_0x2943('0x1a')](_0x46d04b);}};}function respondWithFilteredResult(_0x5765e9,_0x4a511f){return function(_0xb3dbb9){if(_0xb3dbb9){var _0x20a134=typeof _0x4a511f['offset']===_0x2943('0x1b')&&typeof _0x4a511f[_0x2943('0x1c')]===_0x2943('0x1b');var _0x1bf42d=_0xb3dbb9[_0x2943('0x1d')];var _0x6dab5=_0x20a134?0x0:_0x4a511f[_0x2943('0x1e')];var _0xa997e5=_0x20a134?_0xb3dbb9['count']:_0x4a511f['offset']+_0x4a511f[_0x2943('0x1c')];var _0x1ce174;if(_0xa997e5>=_0x1bf42d){_0xa997e5=_0x1bf42d;_0x1ce174=0xc8;}else{_0x1ce174=0xce;}_0x5765e9[_0x2943('0x18')](_0x1ce174);return _0x5765e9[_0x2943('0x1f')]('Content-Range',_0x6dab5+'-'+_0xa997e5+'/'+_0x1bf42d)[_0x2943('0x1a')](_0xb3dbb9);}return null;};}function respondWithRpcPromise(_0x31f2d7,_0x1e6c31,_0x2fe9f4,_0x32c404){return new Promise(function(_0x4dbea0,_0x28cc3c){var _0x26f36c=_0x32c404||amiClient;return _0x26f36c[_0x2943('0x20')](_0x31f2d7,_0x2fe9f4)[_0x2943('0x21')](function(_0x9922ed){logger['info']('User,\x20%s,\x20%s',_0x1e6c31,_0x2943('0x22'));logger[_0x2943('0x23')]('User,\x20%s,\x20%s,\x20%s',_0x1e6c31,'request\x20sent',JSON['stringify'](_0x9922ed));if(_0x9922ed[_0x2943('0x24')]){if(_0x9922ed['error'][_0x2943('0x25')]===0x1f4){logger[_0x2943('0x24')]('User,\x20%s,\x20%s',_0x1e6c31,_0x9922ed['error'][_0x2943('0x26')]);return _0x28cc3c(_0x9922ed['error'][_0x2943('0x26')]);}logger[_0x2943('0x24')](_0x2943('0x27'),_0x1e6c31,_0x9922ed[_0x2943('0x24')][_0x2943('0x26')]);return _0x4dbea0(_0x9922ed['error']['message']);}else{logger[_0x2943('0x28')]('User,\x20%s,\x20%s',_0x1e6c31,_0x2943('0x22'));_0x4dbea0(_0x9922ed[_0x2943('0x29')]['message']);}})['catch'](function(_0x23c5f6){logger[_0x2943('0x24')](_0x2943('0x27'),_0x1e6c31,_0x23c5f6);_0x28cc3c(_0x23c5f6);});});}function saveUpdates(_0x128885){return function(_0xaaf2c4){if(_0xaaf2c4){return _0xaaf2c4[_0x2943('0x2a')](_0x128885)[_0x2943('0x21')](function(_0x150cda){if(_0x150cda['role']==='agent'){socket[_0x2943('0x2b')](_0x2943('0x2c')+_0x150cda['id'],_0x150cda);}return _0x150cda;});}return null;};}function removeEntity(_0xe670cb,_0x373dac){return function(_0x2fb520){if(_0x2fb520){return _0x2fb520[_0x2943('0x2d')]({'transaction':_0x373dac})[_0x2943('0x21')](function(){var _0x41b9af=_0x2fb520[_0x2943('0x2e')]({'plain':!![]});if(_0x41b9af[_0x2943('0x2f')]===_0x2943('0x30'))return;var _0x12d12a=[{'name':'Users','value':_0x2943('0x31'),'ignore':!![]},{'name':_0x2943('0x32'),'value':_0x2943('0x33'),'ignore':![]},{'name':'Telephones','value':_0x2943('0x34'),'ignore':![]}];var _0x1210ec=_(_0x12d12a)[_0x2943('0x35')](_0x2943('0x36'))['map'](_0x2943('0x37'))[_0x2943('0x37')]();if(_[_0x2943('0x38')](_0x1210ec,_0x41b9af[_0x2943('0x2f')])){return;}var _0x231718=_[_0x2943('0x39')](_0x12d12a,['value',_0x41b9af[_0x2943('0x2f')]])[_0x2943('0x3a')];return db[_0x2943('0x3b')][_0x2943('0x2d')]({'where':{'type':_0x231718,'resourceId':_0x41b9af['id']},'transaction':_0x373dac})[_0x2943('0x21')](function(){return _0x2fb520;});})['then'](function(){_0xe670cb[_0x2943('0x18')](0xcc)[_0x2943('0x19')]();});}};}function handleEntityNotFound(_0x15afaf){return function(_0x35af25){if(!_0x35af25){_0x15afaf[_0x2943('0x17')](0x194);}return _0x35af25;};}function handleError(_0x3254c7,_0x2f9bf4){_0x2f9bf4=_0x2f9bf4||0x1f4;return function(_0xd0e126){logger[_0x2943('0x24')](_0xd0e126[_0x2943('0x3c')]);if(_0xd0e126[_0x2943('0x3a')]){delete _0xd0e126[_0x2943('0x3a')];}_0x3254c7[_0x2943('0x18')](_0x2f9bf4)['send'](_0xd0e126);};}function getUserAttributes(){return _(db['User'][_0x2943('0x3d')])['map'](function(_0x2f0e35){return{'name':_0x2f0e35[_0x2943('0x3e')],'type':_0x2f0e35[_0x2943('0x3f')][_0x2943('0x40')]};})[_0x2943('0x35')](function(_0x3b372b){return!['password','salt',_0x2943('0x41'),_0x2943('0x42'),_0x2943('0x43'),_0x2943('0x44')][_0x2943('0x38')](_0x3b372b[_0x2943('0x3a')]);})[_0x2943('0x37')]();}exports[_0x2943('0x45')]=function(_0x181bbd,_0x4f1607){var _0x27799c={},_0x14b2de={'count':0x0,'rows':[]};var _0x34bd9a=getUserAttributes();_0x27799c=qs[_0x2943('0x46')](_0x34bd9a,_0x181bbd);var _0x490e2a={'where':_0x27799c[_0x2943('0x47')]};return db[_0x2943('0x48')][_0x2943('0x1d')](_0x490e2a)['then'](function(_0x3f8cd8){_0x14b2de[_0x2943('0x1d')]=_0x3f8cd8;if(_0x181bbd[_0x2943('0x49')][_0x2943('0x4a')]){_0x27799c[_0x2943('0x4b')]=[{'all':!![]}];}if(_0x181bbd[_0x2943('0x49')]['userSetting']===_0x2943('0x4c')){_0x27799c[_0x2943('0x4b')]=[{'model':db[_0x2943('0x4d')],'as':_0x2943('0x4e')}];}if(!_[_0x2943('0x38')](_0x27799c[_0x2943('0x4f')],'id')){_0x27799c[_0x2943('0x4f')][_0x2943('0x50')]('id');}return db[_0x2943('0x48')][_0x2943('0x51')](_0x27799c);})[_0x2943('0x21')](function(_0xefb0f5){_0x14b2de[_0x2943('0x52')]=_0xefb0f5;if(_0x181bbd[_0x2943('0x49')][_0x2943('0x53')]===_0x2943('0x4c')){var _0x27e684=[];for(var _0x4d5b6d=0x0;_0x4d5b6d<_0x14b2de[_0x2943('0x52')]['length'];_0x4d5b6d++){_0x27e684[_0x2943('0x50')](get_open_tabs('chat',_0x14b2de[_0x2943('0x52')][_0x4d5b6d][_0x2943('0x54')]));_0x27e684[_0x2943('0x50')](get_open_tabs(_0x2943('0x55'),_0x14b2de['rows'][_0x4d5b6d][_0x2943('0x54')]));_0x27e684[_0x2943('0x50')](get_open_tabs(_0x2943('0x56'),_0x14b2de[_0x2943('0x52')][_0x4d5b6d][_0x2943('0x54')]));_0x27e684[_0x2943('0x50')](get_open_tabs(_0x2943('0x57'),_0x14b2de[_0x2943('0x52')][_0x4d5b6d][_0x2943('0x54')]));_0x27e684['push'](get_open_tabs('openchannel',_0x14b2de[_0x2943('0x52')][_0x4d5b6d][_0x2943('0x54')]));_0x27e684[_0x2943('0x50')](get_open_tabs(_0x2943('0x58'),_0x14b2de['rows'][_0x4d5b6d][_0x2943('0x54')]));}return Promise[_0x2943('0x59')](_0x27e684)[_0x2943('0x21')](function(){return _0x14b2de;});}else{return _0x14b2de;}})['then'](respondWithFilteredResult(_0x4f1607,_0x27799c))[_0x2943('0x5a')](handleError(_0x4f1607,null));};exports[_0x2943('0x5b')]=function(_0x10bd06,_0x426680){var _0x1e976b=getUserAttributes();_0x10bd06['query']['id']=_0x10bd06[_0x2943('0x5c')]['id'];var _0x373ceb=qs['getOptions'](_0x1e976b,_0x10bd06);if(_0x10bd06[_0x2943('0x49')]['includeAll']){_0x373ceb[_0x2943('0x4b')]=[{'all':!![]}];}if(_0x10bd06[_0x2943('0x49')]['userSetting']===_0x2943('0x4c')){_0x373ceb[_0x2943('0x4b')]=[{'model':db[_0x2943('0x4d')],'as':_0x2943('0x4e')}];}_0x373ceb=_['merge']({},_0x373ceb,_0x10bd06[_0x2943('0x5d')]);if(!_[_0x2943('0x38')](_0x373ceb['attributes'],'id')){_0x373ceb['attributes'][_0x2943('0x50')]('id');}return db[_0x2943('0x48')][_0x2943('0x39')](_0x373ceb)[_0x2943('0x21')](handleEntityNotFound(_0x426680,null))[_0x2943('0x21')](function(_0x40f805){var _0x58c383=[];values=_0x40f805;if(_0x10bd06[_0x2943('0x49')]['openTabs']==='true'){_0x58c383[_0x2943('0x50')](get_open_tabs(_0x2943('0x5e'),_0x40f805[_0x2943('0x54')]));_0x58c383[_0x2943('0x50')](get_open_tabs('sms',_0x40f805['dataValues']));_0x58c383[_0x2943('0x50')](get_open_tabs(_0x2943('0x5f'),_0x40f805[_0x2943('0x54')]));_0x58c383[_0x2943('0x50')](get_open_tabs(_0x2943('0x58'),_0x40f805[_0x2943('0x54')]));_0x58c383[_0x2943('0x50')](get_open_tabs(_0x2943('0x56'),_0x40f805['dataValues']));_0x58c383[_0x2943('0x50')](get_open_tabs(_0x2943('0x57'),_0x40f805[_0x2943('0x54')]));return Promise['all'](_0x58c383);}else{return values;}})[_0x2943('0x21')](function(){return values;})['then'](respondWithResult(_0x426680,null))['catch'](handleError(_0x426680,null));};exports[_0x2943('0x2a')]=function(_0x8a5209,_0x3e0a7f){if(_0x8a5209[_0x2943('0x60')]['id']){delete _0x8a5209['body']['id'];}delete _0x8a5209[_0x2943('0x60')][_0x2943('0x2f')];return db['User'][_0x2943('0x39')]({'where':{'id':_0x8a5209[_0x2943('0x5c')]['id']}})[_0x2943('0x21')](handleEntityNotFound(_0x3e0a7f,null))[_0x2943('0x21')](saveUpdates(_0x8a5209[_0x2943('0x60')],null))['then'](respondWithResult(_0x3e0a7f,null))[_0x2943('0x5a')](handleError(_0x3e0a7f,null));};exports[_0x2943('0x61')]=function(_0x113b78,_0x391515){return db[_0x2943('0x48')]['describe']()[_0x2943('0x21')](respondWithResult(_0x391515,null))[_0x2943('0x5a')](handleError(_0x391515,null));};exports[_0x2943('0x62')]=function(_0x1c1570,_0x1d38c0){return db[_0x2943('0x48')][_0x2943('0x39')]({'where':{'id':_0x1c1570['params']['id']}})['then'](handleEntityNotFound(_0x1d38c0,null))['then'](function(_0x59c0bb){if(_0x59c0bb){return _0x59c0bb[_0x2943('0x62')](_0x1c1570[_0x2943('0x60')][_0x2943('0x63')],_[_0x2943('0x64')](_0x1c1570['body'],[_0x2943('0x63'),'id'])||{});}})[_0x2943('0x21')](respondWithResult(_0x1d38c0,null))[_0x2943('0x5a')](handleError(_0x1d38c0,null));};function validateUser(_0x2a5cc1){return new Promise(function(_0x2dcb81,_0x11b6d0){if(_0x2a5cc1[_0x2943('0x65')])return _0x2dcb81(_0x2a5cc1);return db[_0x2943('0x66')][_0x2943('0x67')](0x1)[_0x2943('0x21')](function(_0x48c330){if(_0x48c330[_0x2943('0x68')])authService[_0x2943('0x69')](_0x2a5cc1[_0x2943('0x6a')]);db['User'][_0x2943('0x6b')](_0x2943('0x65'))['then'](function(_0x4b7137){if(_['isNil'](_0x4b7137)){_0x2a5cc1[_0x2943('0x65')]=_0x48c330[_0x2943('0x6c')]||0x1;return;}if(_[_0x2943('0x6d')](_0x48c330[_0x2943('0x6c')])||_0x48c330[_0x2943('0x6c')]===_0x4b7137){_0x2a5cc1[_0x2943('0x65')]=_0x4b7137+0x1;return;}if(_0x48c330[_0x2943('0x6c')]>_0x4b7137){_0x2a5cc1[_0x2943('0x65')]=_0x48c330[_0x2943('0x6c')];return;}return db[_0x2943('0x6e')][_0x2943('0x49')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x2943('0x6e')]['QueryTypes'][_0x2943('0x6f')]})[_0x2943('0x21')](function(_0x1bd79a){if(_0x1bd79a&&_0x1bd79a[_0x2943('0x70')]){for(var _0x4af38d=0x0,_0x5c73cd=_0x1bd79a[_0x2943('0x70')];_0x4af38d<_0x5c73cd&&_['isNil'](_0x2a5cc1[_0x2943('0x65')]);_0x4af38d++){if(_0x48c330['min_internal']<=_0x1bd79a[_0x4af38d][_0x2943('0x71')]){_0x2a5cc1[_0x2943('0x65')]=_0x1bd79a[_0x4af38d][_0x2943('0x71')];}else if(_0x48c330[_0x2943('0x6c')]>_0x1bd79a[_0x4af38d][_0x2943('0x71')]&&_0x48c330['min_internal']<=_0x1bd79a[_0x4af38d]['to']){_0x2a5cc1['internal']=_0x48c330[_0x2943('0x6c')];}}}if(_[_0x2943('0x6d')](_0x2a5cc1[_0x2943('0x65')])){_0x2a5cc1['internal']=_0x4b7137+0x1;}return _0x2dcb81(_0x2a5cc1);});});})[_0x2943('0x5a')](function(_0x5353c1){_0x11b6d0(_0x5353c1);});});}function updateUser(_0x487401){return new Promise(function(_0x2506c6,_0x5a27d6){try{if(_0x487401[_0x2943('0x72')]){_0x487401[_0x2943('0x73')]=_0x487401[_0x2943('0x65')];_0x487401[_0x2943('0x74')]={'mailbox':_0x487401[_0x2943('0x65')],'password':_0x487401[_0x2943('0x6a')],'fullname':_0x487401['fullname'],'email':_0x487401[_0x2943('0x75')]};}if(_0x487401[_0x2943('0x2f')]==='agent'){if(!_0x487401['permissions'])_0x487401[_0x2943('0x76')]=['101',_0x2943('0x77'),_0x2943('0x78'),_0x2943('0x79'),'110',_0x2943('0x7a'),_0x2943('0x7b'),_0x2943('0x7c'),_0x2943('0x7d'),_0x2943('0x7e'),'109',_0x2943('0x7f'),_0x2943('0x80'),_0x2943('0x81'),_0x2943('0x82')];}_0x2506c6(_0x487401);}catch(_0x1e82e2){_0x5a27d6(_0x1e82e2);}});}exports['create']=function(_0x53f28e,_0x42da78){if(_0x53f28e[_0x2943('0x31')][_0x2943('0x2f')]===_0x2943('0x33'))throw new Error('Unauthorized');if(_0x53f28e[_0x2943('0x60')][_0x2943('0x2f')]==='user'&&_0x53f28e[_0x2943('0x31')][_0x2943('0x2f')]!==_0x2943('0x30')){throw new Error(_0x2943('0x83'));}if(_0x53f28e[_0x2943('0x60')][_0x2943('0x2f')]===_0x2943('0x30')&&_0x53f28e[_0x2943('0x31')][_0x2943('0x2f')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x2943('0x84')]([_0x53f28e[_0x2943('0x60')]])[_0x2943('0x21')](function(){return validateUser(_0x53f28e[_0x2943('0x60')]);})[_0x2943('0x21')](function(_0xfb89c5){return updateUser(_0xfb89c5)['then'](function(_0x272fd1){if(_0x272fd1[_0x2943('0x2f')]==='admin'){_0x272fd1[_0x2943('0x85')]=_0x53f28e['user'][_0x2943('0x85')];delete _0x272fd1['userProfileId'];}return _0x272fd1;});})[_0x2943('0x21')](function(_0x56e3ec){return db['User']['create'](_0x56e3ec,{'include':[{'model':db[_0x2943('0x74')],'as':_0x2943('0x74')}]});})[_0x2943('0x21')](function(_0x3e3d03){if(_0x53f28e[_0x2943('0x60')][_0x2943('0x2f')]===_0x2943('0x31'))return _0x3e3d03;if(_0x53f28e[_0x2943('0x31')][_0x2943('0x2f')]!==_0x2943('0x31'))return _0x3e3d03;return db['UserProfileSection'][_0x2943('0x39')]({'where':{'name':_0x3e3d03[_0x2943('0x2f')]==='agent'?'Agents':_0x2943('0x86'),'userProfileId':_0x53f28e[_0x2943('0x31')][_0x2943('0x87')]},'raw':!![]})['then'](function(_0x5c4643){if(!_0x5c4643||_0x5c4643[_0x2943('0x88')]!=0x0)return _0x3e3d03;return db[_0x2943('0x3b')]['create']({'name':_0x3e3d03['name'],'resourceId':_0x3e3d03['id'],'type':_0x5c4643[_0x2943('0x3a')],'sectionId':_0x5c4643['id']},{})['then'](function(){return _0x3e3d03;});})[_0x2943('0x5a')](function(_0x4d6779){logger[_0x2943('0x24')](_0x2943('0x89'),_0x4d6779);throw _0x4d6779;});})[_0x2943('0x21')](respondWithResult(_0x42da78,0xc9))[_0x2943('0x5a')](handleError(_0x42da78,null));};exports[_0x2943('0x8a')]=function(_0x308a5c,_0x4e0187){var _0x41795d=_0x308a5c[_0x2943('0x60')];var _0xd3c1ef=[];if(_0x308a5c[_0x2943('0x31')][_0x2943('0x2f')]===_0x2943('0x33'))throw new Error(_0x2943('0x8b'));if(_[_0x2943('0x8c')](_0x41795d,[_0x2943('0x2f'),_0x2943('0x31')])&&_0x308a5c[_0x2943('0x31')]['role']!==_0x2943('0x30')){throw new Error(_0x2943('0x83'));}if(_[_0x2943('0x8c')](_0x41795d,[_0x2943('0x2f'),_0x2943('0x30')])&&_0x308a5c['user'][_0x2943('0x2f')]!==_0x2943('0x30')){throw new Error(_0x2943('0x8d'));}return licenseUtil[_0x2943('0x84')](_0x41795d)[_0x2943('0x21')](function(){return validateUser(_0x41795d[0x0]);})[_0x2943('0x21')](function(){for(var _0x3a6d96=0x1;_0x3a6d96<_0x41795d['length'];_0x3a6d96++){var _0x28ddba=_0x41795d[_0x3a6d96-0x1][_0x2943('0x65')];if(!_0x41795d[_0x3a6d96][_0x2943('0x65')])_0x41795d[_0x3a6d96]['internal']=_0x28ddba+0x1;_0xd3c1ef[_0x2943('0x50')](validateUser(_0x41795d[_0x3a6d96]));}return Promise['all'](_0xd3c1ef);})[_0x2943('0x21')](function(){_0xd3c1ef=[];for(var _0x4ace5d=0x0;_0x4ace5d<_0x41795d[_0x2943('0x70')];_0x4ace5d++){_0xd3c1ef['push'](updateUser(_0x41795d[_0x4ace5d]));}return Promise[_0x2943('0x59')](_0xd3c1ef);})[_0x2943('0x21')](function(){_0xd3c1ef=_0x41795d[_0x2943('0x8e')](function(_0x247545){return db['User'][_0x2943('0x8f')](_0x247545,{'include':[{'model':db[_0x2943('0x74')],'as':_0x2943('0x74')}]})[_0x2943('0x21')](function(_0x201395){_0x247545['id']=_0x201395['id'];return _0x247545;});});return Promise[_0x2943('0x59')](_0xd3c1ef);})[_0x2943('0x21')](function(_0x584b24){if(_0x308a5c[_0x2943('0x60')]['role']===_0x2943('0x31'))return _0x584b24;if(_0x308a5c[_0x2943('0x31')][_0x2943('0x2f')]!==_0x2943('0x31'))return _0x584b24;var _0x305743=_[_0x2943('0x8c')](_0x584b24,function(_0x52f3ed){return _0x52f3ed['role']==='agent'||_0x52f3ed[_0x2943('0x2f')]===_0x2943('0x34');});if(!_0x305743)return _0x584b24;return db[_0x2943('0x90')][_0x2943('0x51')]({'where':{'name':{'$or':[_0x2943('0x32'),'Telephones']},'userProfileId':_0x308a5c[_0x2943('0x31')][_0x2943('0x87')]},'raw':!![]})['then'](function(_0x4f1ff3){if(_['isEmpty'](_0x4f1ff3)||!_[_0x2943('0x8c')](_0x4f1ff3,['autoAssociation',0x0]))return _0x584b24;_0xd3c1ef=[];var _0x584239=_(_0x4f1ff3)['map'](function(_0x163754){if(_0x163754[_0x2943('0x88')]===0x1)return;return _0x163754[_0x2943('0x3a')]===_0x2943('0x32')?'agent':_0x2943('0x34');})[_0x2943('0x91')]()['value']();for(var _0x77d0ff=0x0;_0x77d0ff<_0x584b24[_0x2943('0x70')];_0x77d0ff++){if(!_[_0x2943('0x38')](_0x584239,_0x584b24[_0x77d0ff][_0x2943('0x2f')]))return;var _0x5064ea=_0x584b24[_0x77d0ff]['role']===_0x2943('0x33')?_0x2943('0x32'):'Telephones';_0xd3c1ef['push'](db['UserProfileResource']['create']({'name':_0x584b24[_0x77d0ff]['name'],'resourceId':_0x584b24[_0x77d0ff]['id'],'type':_0x5064ea,'sectionId':_[_0x2943('0x39')](_0x4f1ff3,[_0x2943('0x3a'),_0x5064ea])['id']},{}));}return Promise['all'](_0xd3c1ef);});})['then'](respondWithResult(_0x4e0187,0xc9))[_0x2943('0x5a')](handleError(_0x4e0187,null));};exports[_0x2943('0x92')]=function(_0x12b254,_0x100ae4){if(_0x12b254['body']['id']){delete _0x12b254[_0x2943('0x60')]['id'];}return db[_0x2943('0x48')][_0x2943('0x39')]({'where':{'id':_0x12b254[_0x2943('0x5c')]['id']}})['then'](function(_0xab0045){if(!_0xab0045)return null;if(_0xab0045['id']===_0x12b254[_0x2943('0x31')]['id']){if(!_0x12b254['body']['oldPassword']||!_0x12b254['body'][_0x2943('0x93')]){throw new db[(_0x2943('0x94'))][(_0x2943('0x95'))](_0x2943('0x96'));}if(!_0xab0045[_0x2943('0x97')](_0x12b254[_0x2943('0x60')][_0x2943('0x98')])){throw new db['Sequelize'][(_0x2943('0x95'))]('Wrong\x20credentials');}if(_0x12b254['body']['oldPassword']===_0x12b254[_0x2943('0x60')][_0x2943('0x93')]){throw new db[(_0x2943('0x94'))][(_0x2943('0x95'))](_0x2943('0x99'));}}else if(_0x12b254[_0x2943('0x31')][_0x2943('0x2f')]==='admin'){if(!_0x12b254[_0x2943('0x60')][_0x2943('0x93')]){throw new db[(_0x2943('0x94'))][(_0x2943('0x95'))](_0x2943('0x9a'));}}else if(_0x12b254[_0x2943('0x31')][_0x2943('0x2f')]===_0x2943('0x31')){if(!_0x12b254[_0x2943('0x60')]['newPassword']){throw new db[(_0x2943('0x94'))][(_0x2943('0x95'))](_0x2943('0x9a'));}if(_0xab0045['role']!==_0x2943('0x33')){throw new db['Sequelize']['ValidationError']('Unauthorized');}}else{throw new db['Sequelize']['ValidationError'](_0x2943('0x8b'));}return _0xab0045;})['then'](handleEntityNotFound(_0x100ae4,null))[_0x2943('0x21')](function(_0x1c6853){return db[_0x2943('0x66')]['findOne']({'attributes':['id',_0x2943('0x68'),_0x2943('0x9b'),'passwordHistoryLimit']})[_0x2943('0x21')](function(_0x123a8c){if(_0x123a8c['securePassword'])authService[_0x2943('0x69')](_0x12b254[_0x2943('0x60')][_0x2943('0x93')]);if(!_0x123a8c[_0x2943('0x9b')]||!_0x1c6853['previousPasswords'])return _0x1c6853;authService[_0x2943('0x9c')](_0x12b254['body']['newPassword'],_0x1c6853[_0x2943('0x41')],_0x123a8c[_0x2943('0x9d')]);return _0x1c6853;})['then'](saveUpdates({'password':_0x12b254[_0x2943('0x60')][_0x2943('0x93')],'passwordResetAt':_0x12b254[_0x2943('0x31')]['id']==_0x12b254[_0x2943('0x5c')]['id']?moment():null,'previousPasswords':authService[_0x2943('0x9e')](_0x12b254[_0x2943('0x60')][_0x2943('0x93')],_0x1c6853[_0x2943('0x41')])},null));})[_0x2943('0x21')](respondWithResult(_0x100ae4,null))[_0x2943('0x5a')](handleError(_0x100ae4,null));};exports[_0x2943('0x9f')]=function(_0x1e7a64,_0x472712){var _0x36e273=_0x1e7a64[_0x2943('0x60')][_0x2943('0xa0')];return db[_0x2943('0x48')][_0x2943('0x39')]({'where':{'id':_0x1e7a64[_0x2943('0x5c')]['id']},'attributes':['id',_0x2943('0x3a'),_0x2943('0x2f'),_0x2943('0xa1'),'loginInPause',_0x2943('0xa2'),_0x2943('0xa3')]})[_0x2943('0x21')](handleEntityNotFound(_0x472712,null))[_0x2943('0x21')](function(_0x2f2268){if(_0x2f2268){if(!utils['isValidChannel'](_0x36e273)){throw new db[(_0x2943('0x94'))][(_0x2943('0x95'))](_0x2943('0xa4'));}return _0x2f2268['add'+_[_0x2943('0xa5')](_0x36e273[_0x2943('0xa6')]())+'Queues'](_0x1e7a64[_0x2943('0x60')][_0x2943('0x63')],{'penalty':_0x1e7a64[_0x2943('0x60')][_0x2943('0xa7')]||0x0})[_0x2943('0xa8')](function(_0x4396cc){for(var _0x446a34=0x0;_0x446a34<_0x1e7a64[_0x2943('0x60')][_0x2943('0x63')]['length'];_0x446a34+=0x1){var _0x4f9efc={'UserId':Number(_0x1e7a64[_0x2943('0x5c')]['id'])};_0x4f9efc[_[_0x2943('0xa5')](_0x36e273[_0x2943('0xa6')]())+_0x2943('0xa9')]=Number(_0x1e7a64[_0x2943('0x60')]['ids'][_0x446a34]);socket['emit']('user'+_['capitalize'](_0x36e273['toLowerCase']())+_0x2943('0xaa'),_0x4f9efc);}return _0x4396cc;})['then'](function(){if(_0x36e273==='voice'){return db[_0x2943('0xab')][_0x2943('0x51')]({'where':{'id':_0x1e7a64[_0x2943('0x60')]['ids']||[]},'raw':!![],'attributes':['id',_0x2943('0x3a')]});}})[_0x2943('0x21')](function(_0x5396d1){var _0x4ec0f6=_0x2f2268[_0x2943('0x2e')]({'plain':!![]});var _0x14ee73=[];if(_0x36e273===_0x2943('0xac')&&_0x4ec0f6[_0x2943('0x2f')]==='agent'&&_0x4ec0f6['online']){for(let _0x4adf64=0x0;_0x4adf64<_0x5396d1[_0x2943('0x70')];_0x4adf64+=0x1){_0x14ee73['push']({'membername':_0x4ec0f6[_0x2943('0x3a')],'UserId':_0x4ec0f6['id'],'queue_name':_0x5396d1[_0x4adf64][_0x2943('0x3a')],'VoiceQueueId':_0x5396d1[_0x4adf64]['id'],'interface':_[_0x2943('0x6d')](_0x4ec0f6[_0x2943('0xa3')])?util[_0x2943('0xad')](_0x2943('0xae'),_0x4ec0f6[_0x2943('0x3a')]):_0x4ec0f6[_0x2943('0xa3')],'paused':_0x4ec0f6[_0x2943('0xa2')]||![],'penalty':_0x1e7a64[_0x2943('0x60')][_0x2943('0xa7')]||0x0});}return Promise[_0x2943('0x59')](_0x14ee73[_0x2943('0x8e')](function(_0x51c565){return db[_0x2943('0xaf')][_0x2943('0xb0')](_0x51c565);}));}return _0x2f2268;});}})[_0x2943('0x21')](respondWithStatusCode(_0x472712,null))[_0x2943('0x5a')](handleError(_0x472712,null));};exports[_0x2943('0xb1')]=function(_0x56bd5c,_0x50bbd6){var _0x1744ad,_0x167eef;return db[_0x2943('0x48')][_0x2943('0x39')]({'where':{'id':_0x56bd5c[_0x2943('0x5c')]['id']},'attributes':['id',_0x2943('0x3a'),_0x2943('0x2f')]})[_0x2943('0x21')](handleEntityNotFound(_0x50bbd6,null))[_0x2943('0x21')](function(_0x46b7a6){if(_0x46b7a6){_0x1744ad=_0x46b7a6;if(!_0x56bd5c[_0x2943('0x49')][_0x2943('0xa0')]||!utils[_0x2943('0xb2')](_0x56bd5c[_0x2943('0x49')][_0x2943('0xa0')])){throw new db[(_0x2943('0x94'))]['ValidationError']('Unknown\x20channel');}return _0x46b7a6['remove'+_[_0x2943('0xa5')](_0x56bd5c['query'][_0x2943('0xa0')][_0x2943('0xa6')]())+'Queues'](_0x56bd5c[_0x2943('0x49')][_0x2943('0x63')]);}})[_0x2943('0x21')](function(_0x286cbf){if(_['isArray'](_0x56bd5c[_0x2943('0x49')][_0x2943('0x63')])){for(var _0x339c00=0x0;_0x339c00<_0x56bd5c[_0x2943('0x49')][_0x2943('0x63')]['length'];_0x339c00+=0x1){_0x167eef={'UserId':Number(_0x56bd5c['params']['id'])};_0x167eef[_[_0x2943('0xa5')](_0x56bd5c[_0x2943('0x49')][_0x2943('0xa0')][_0x2943('0xa6')]())+_0x2943('0xa9')]=Number(_0x56bd5c[_0x2943('0x49')][_0x2943('0x63')][_0x339c00]);socket[_0x2943('0x2b')]('user'+_['capitalize'](_0x56bd5c[_0x2943('0x49')][_0x2943('0xa0')]['toLowerCase']())+_0x2943('0xb3'),_0x167eef);}}else{_0x167eef={'UserId':Number(_0x56bd5c[_0x2943('0x5c')]['id'])};_0x167eef[_[_0x2943('0xa5')](_0x56bd5c[_0x2943('0x49')]['channel'][_0x2943('0xa6')]())+_0x2943('0xa9')]=Number(_0x56bd5c['query'][_0x2943('0x63')]);socket[_0x2943('0x2b')](_0x2943('0x31')+_['capitalize'](_0x56bd5c['query'][_0x2943('0xa0')][_0x2943('0xa6')]())+_0x2943('0xb3'),_0x167eef);}return _0x286cbf;})[_0x2943('0x21')](function(){if(_0x56bd5c[_0x2943('0x49')]['channel']===_0x2943('0xac')){return db[_0x2943('0xaf')][_0x2943('0x2d')]({'where':{'UserId':_0x56bd5c['params']['id'],'VoiceQueueId':_0x56bd5c['query']['ids']},'individualHooks':!![]})[_0x2943('0x21')](function(){return _0x1744ad;});}return _0x1744ad;})[_0x2943('0x21')](respondWithStatusCode(_0x50bbd6,null))['catch'](handleError(_0x50bbd6,null));};exports[_0x2943('0xb4')]=function(_0x476842,_0x45ab8e){_0x476842['body'][_0x2943('0xb5')]=_0x476842[_0x2943('0xb6')][_0x2943('0xb7')];return db['User'][_0x2943('0x39')]({'where':{'id':_0x476842[_0x2943('0x5c')]['id']}})[_0x2943('0x21')](handleEntityNotFound(_0x45ab8e,null))[_0x2943('0x21')](saveUpdates(_0x476842[_0x2943('0x60')],null))['then'](respondWithResult(_0x45ab8e,null))[_0x2943('0x5a')](handleError(_0x45ab8e,null));};exports['getAvatar']=function(_0x1353a9,_0x49b8c5){var _0x4f6aec=path[_0x2943('0xb8')](config['root'],_0x2943('0xb9'));return db[_0x2943('0x48')][_0x2943('0x39')]({'where':{'id':_0x1353a9[_0x2943('0x5c')]['id']},'attributes':['id',_0x2943('0xb5')],'raw':!![]})[_0x2943('0x21')](handleEntityNotFound(_0x49b8c5,null))[_0x2943('0x21')](function(_0x4779fa){if(_0x4779fa){if(_[_0x2943('0x6d')](_0x4779fa[_0x2943('0xb5')])){return _0x49b8c5[_0x2943('0xba')](_0x4f6aec);}else{if(!fs[_0x2943('0xbb')](path['join'](config[_0x2943('0xbc')],_0x2943('0xbd'),_0x4779fa[_0x2943('0xb5')]))){return _0x49b8c5[_0x2943('0xba')](_0x4f6aec);}return _0x49b8c5['download'](path[_0x2943('0xb8')](config[_0x2943('0xbc')],'server/files/images/',_0x4779fa[_0x2943('0xb5')]));}}})['catch'](handleError(_0x49b8c5,null));};exports[_0x2943('0xbe')]=function(_0x443dca,_0x275ff6){return db[_0x2943('0x48')][_0x2943('0x39')]({'where':{'id':_0x443dca[_0x2943('0x5c')]['id']},'attributes':['id']})[_0x2943('0x21')](handleEntityNotFound(_0x275ff6,null))[_0x2943('0x21')](function(_0x37d351){var _0x53c1f7=[];values=_0x37d351[_0x2943('0x54')];_0x53c1f7[_0x2943('0x50')](get_open_tabs(_0x2943('0x5e'),_0x37d351[_0x2943('0x54')]));_0x53c1f7[_0x2943('0x50')](get_open_tabs(_0x2943('0x55'),_0x37d351[_0x2943('0x54')]));_0x53c1f7[_0x2943('0x50')](get_open_tabs(_0x2943('0x5f'),_0x37d351[_0x2943('0x54')]));_0x53c1f7[_0x2943('0x50')](get_open_tabs(_0x2943('0x58'),_0x37d351[_0x2943('0x54')]));_0x53c1f7[_0x2943('0x50')](get_open_tabs(_0x2943('0x56'),_0x37d351[_0x2943('0x54')]));_0x53c1f7[_0x2943('0x50')](get_open_tabs(_0x2943('0x57'),_0x37d351[_0x2943('0x54')]));return Promise[_0x2943('0x59')](_0x53c1f7);})[_0x2943('0x21')](function(_0x30c900){if(_0x30c900){var _0x318123=_[_0x2943('0x8e')](values[_0x2943('0xbf')],function(_0x587b73){return{'channel':'CHAT','id':_0x587b73['id'],'createdAt':_0x587b73['createdAt']};});var _0x1754e0=_[_0x2943('0x8e')](values[_0x2943('0xc0')],function(_0x39f924){return{'channel':_0x2943('0xc1'),'id':_0x39f924['id'],'createdAt':_0x39f924['createdAt']};});var _0x5927ed=_[_0x2943('0x8e')](values[_0x2943('0xc2')],function(_0x4ecc71){return{'channel':'OPENCHANNEL','id':_0x4ecc71['id'],'createdAt':_0x4ecc71[_0x2943('0xc3')]};});var _0x21dc93=_['map'](values[_0x2943('0xc4')],function(_0xbb672b){return{'channel':'MAIL','id':_0xbb672b['id'],'createdAt':_0xbb672b['createdAt']};});var _0x59b4fd=_[_0x2943('0x8e')](values['SmsOpenTabs'],function(_0x8d3614){return{'channel':'SMS','id':_0x8d3614['id'],'createdAt':_0x8d3614[_0x2943('0xc3')]};});var _0xee5f12=_['map'](values[_0x2943('0xc5')],function(_0x3d9b01){return{'channel':_0x2943('0xc6'),'id':_0x3d9b01['id'],'createdAt':_0x3d9b01['createdAt']};});var _0xccf8c1=_[_0x2943('0xc7')](_0x318123,_0x1754e0,_0x5927ed,_0x21dc93,_0x59b4fd,_0xee5f12);var _0x9d0128={'count':_0xccf8c1['length'],'rows':_0xccf8c1};return _0x9d0128;}else return null;})[_0x2943('0x21')](respondWithResult(_0x275ff6,null))[_0x2943('0x5a')](handleError(_0x275ff6,null));};exports[_0x2943('0xc8')]=function(_0x377600,_0x5796b2){var _0x591037={};return db[_0x2943('0x48')][_0x2943('0xc9')]({'where':{'id':_0x377600[_0x2943('0x5c')]['id']}})[_0x2943('0x21')](function(_0x3603f1){if(!_0x3603f1){throw new APINotFoundError(util[_0x2943('0xad')]('User\x20with\x20id\x20%s\x20not\x20found',_0x377600[_0x2943('0x5c')]['id']));}return contacts[_0x2943('0x61')]();})[_0x2943('0x21')](function(_0x28f668){_0x377600['query'][_0x2943('0x48')]=_0x377600[_0x2943('0x5c')]['id'];_0x591037=qs[_0x2943('0x46')](_0x28f668,_0x377600);if(_0x377600[_0x2943('0x49')]['hasOwnProperty'](_0x2943('0x4a'))){_0x591037[_0x2943('0x4b')]=[{'model':db[_0x2943('0xca')],'as':_0x2943('0xcb'),'required':![]},{'model':db['Tag'],'as':_0x2943('0xcc'),'attributes':['id','name',_0x2943('0xcd')],'where':_0x377600['query'][_0x2943('0xce')]?{'id':_0x377600['query']['tag']}:undefined,'required':_0x377600[_0x2943('0x49')][_0x2943('0xce')]?!![]:![]}];}return contacts['findAll'](_0x377600['query'],_0x377600[_0x2943('0x31')],_0x591037,_0x28f668);})['then'](respondWithFilteredResult(_0x5796b2,_0x591037))[_0x2943('0x5a')](APIHandleError(_0x5796b2));};exports[_0x2943('0xcf')]=function(_0x5e7f73,_0x140f42){var _0x1de3bf;var _0x372b1e={};var _0x3bb422;return db[_0x2943('0x48')][_0x2943('0xc9')]({'where':{'id':_0x5e7f73['params']['id']},'attributes':['id',_0x2943('0x3a'),_0x2943('0x2f')]})['then'](handleEntityNotFound(_0x140f42,null))[_0x2943('0x21')](function(_0x345ab1){if(!utils[_0x2943('0xb2')](_0x5e7f73['query'][_0x2943('0xa0')])){throw new db[(_0x2943('0x94'))]['ValidationError']('Unknown\x20channel');}_0x1de3bf=_0x345ab1;var _0x5d187b={};_0x5d187b['model']=_[_0x2943('0xd0')](db[_[_0x2943('0xa5')](_0x5e7f73['query']['channel'])+_0x2943('0xd1')][_0x2943('0x3d')]);_0x5d187b['query']=_[_0x2943('0xd0')](_0x5e7f73[_0x2943('0x49')]);_0x5d187b[_0x2943('0xd2')]=_[_0x2943('0xd3')](_0x5d187b[_0x2943('0xd4')],_0x5d187b[_0x2943('0x49')]);_0x372b1e[_0x2943('0x4f')]=_['intersection'](_0x5d187b['model'],qs['fields'](_0x5e7f73[_0x2943('0x49')][_0x2943('0xd5')]));_0x372b1e[_0x2943('0x4f')]=_0x372b1e[_0x2943('0x4f')][_0x2943('0x70')]?_0x372b1e['attributes']:_0x5d187b['model'];_0x372b1e[_0x2943('0xd6')]=qs[_0x2943('0xd7')](_0x5e7f73[_0x2943('0x49')][_0x2943('0xd7')]);_0x372b1e[_0x2943('0x47')]=qs[_0x2943('0xd2')](_[_0x2943('0xd8')](_0x5e7f73[_0x2943('0x49')],_0x5d187b[_0x2943('0xd2')]));if(_0x5e7f73[_0x2943('0x49')][_0x2943('0x35')]){_0x372b1e[_0x2943('0x47')]=_[_0x2943('0xd9')](_0x372b1e[_0x2943('0x47')],{'$or':_[_0x2943('0x8e')](_0x372b1e[_0x2943('0x4f')],function(_0x5026b1){var _0xb4bc3d={};_0xb4bc3d[_0x5026b1]={'$like':'%'+_0x5e7f73[_0x2943('0x49')][_0x2943('0x35')]+'%'};return _0xb4bc3d;})});}_0x372b1e=_['merge']({},_0x372b1e,_0x5e7f73[_0x2943('0x5d')]);switch(_0x1de3bf[_0x2943('0x2f')]){case _0x2943('0x30'):return db[_[_0x2943('0xa5')](_0x5e7f73[_0x2943('0x49')][_0x2943('0xa0')])+_0x2943('0xd1')][_0x2943('0x51')](_0x372b1e);case _0x2943('0x31'):case _0x2943('0x33'):return _0x1de3bf['get'+_[_0x2943('0xa5')](_0x5e7f73[_0x2943('0x49')][_0x2943('0xa0')])+'Queues'](_0x372b1e);default:throw new db[(_0x2943('0x94'))][(_0x2943('0x95'))](_0x2943('0xda'));}})['then'](function(_0x3053cd){_0x3bb422=_0x3053cd[_0x2943('0x70')];if(!_0x5e7f73[_0x2943('0x49')][_0x2943('0xdb')](_0x2943('0xdc'))){_0x372b1e[_0x2943('0x1c')]=qs['limit'](_0x5e7f73[_0x2943('0x49')]['limit']);_0x372b1e[_0x2943('0x1e')]=qs[_0x2943('0x1e')](_0x5e7f73['query'][_0x2943('0x1e')]);}switch(_0x1de3bf[_0x2943('0x2f')]){case _0x2943('0x30'):return db[_['capitalize'](_0x5e7f73[_0x2943('0x49')]['channel'])+'Queue'][_0x2943('0x51')](_0x372b1e);case _0x2943('0x31'):case _0x2943('0x33'):return _0x1de3bf['get'+_[_0x2943('0xa5')](_0x5e7f73[_0x2943('0x49')][_0x2943('0xa0')])+_0x2943('0xdd')](_0x372b1e);}})['then'](function(_0x3844e3){return{'count':_0x3bb422,'rows':_0x3844e3};})[_0x2943('0x21')](respondWithResult(_0x140f42,null))['catch'](handleError(_0x140f42,null));};exports['getVoiceQueuesRt']=function(_0x126fc8,_0x3f9a6e){var _0x1572ef={};var _0x591440={};var _0x391f18;var _0x21d04c;return db[_0x2943('0x48')][_0x2943('0xc9')]({'where':{'id':_0x126fc8[_0x2943('0x5c')]['id']}})[_0x2943('0x21')](handleEntityNotFound(_0x3f9a6e,null))[_0x2943('0x21')](function(_0x175144){if(_0x175144){_0x391f18=_0x175144;_0x591440[_0x2943('0xd4')]=_[_0x2943('0xd0')](db['UserVoiceQueueRt'][_0x2943('0x3d')]);_0x591440[_0x2943('0x49')]=_[_0x2943('0xd0')](_0x126fc8[_0x2943('0x49')]);_0x591440[_0x2943('0xd2')]=_[_0x2943('0xd3')](_0x591440['model'],_0x591440['query']);_0x1572ef['attributes']=_[_0x2943('0xd3')](_0x591440[_0x2943('0xd4')],qs[_0x2943('0xd5')](_0x126fc8['query'][_0x2943('0xd5')]));_0x1572ef['attributes']=_0x1572ef[_0x2943('0x4f')]['length']?_0x1572ef[_0x2943('0x4f')]:_0x591440[_0x2943('0xd4')];_0x1572ef['order']=qs[_0x2943('0xd7')](_0x126fc8[_0x2943('0x49')][_0x2943('0xd7')]);_0x1572ef['where']=qs[_0x2943('0xd2')](_[_0x2943('0xd8')](_0x126fc8['query'],_0x591440[_0x2943('0xd2')]));if(_0x126fc8[_0x2943('0x49')][_0x2943('0x35')]){_0x1572ef[_0x2943('0x47')]=_[_0x2943('0xd9')](_0x1572ef[_0x2943('0x47')],{'$or':_[_0x2943('0x8e')](_0x1572ef[_0x2943('0x4f')],function(_0x439d93){var _0x49d24a={};_0x49d24a[_0x439d93]={'$like':'%'+_0x126fc8['query'][_0x2943('0x35')]+'%'};return _0x49d24a;})});}_0x1572ef=_[_0x2943('0xd9')]({},_0x1572ef,_0x126fc8[_0x2943('0x5d')]);return _0x391f18[_0x2943('0xde')](_0x1572ef);}})[_0x2943('0x21')](function(_0x488c86){if(_0x488c86){_0x21d04c=_0x488c86['length'];if(!_0x126fc8['query'][_0x2943('0xdb')](_0x2943('0xdc'))){_0x1572ef[_0x2943('0x1c')]=qs[_0x2943('0x1c')](_0x126fc8[_0x2943('0x49')][_0x2943('0x1c')]);_0x1572ef['offset']=qs[_0x2943('0x1e')](_0x126fc8[_0x2943('0x49')][_0x2943('0x1e')]);}return _0x391f18['getVoiceQueuesRt'](_0x1572ef);}})[_0x2943('0x21')](function(_0x412792){if(_0x412792){return _0x412792?{'count':_0x21d04c,'rows':_0x412792}:null;}})['then'](respondWithResult(_0x3f9a6e,null))['catch'](handleError(_0x3f9a6e,null));};exports[_0x2943('0xdf')]=function(_0x51eb4b,_0x5a7f8a){var _0x198b82={};var _0xeb35ea={};var _0x464d4f;var _0x2a37a1;return db[_0x2943('0x48')][_0x2943('0xc9')]({'where':{'id':_0x51eb4b[_0x2943('0x5c')]['id']}})[_0x2943('0x21')](handleEntityNotFound(_0x5a7f8a,null))[_0x2943('0x21')](function(_0x5d65d4){if(_0x5d65d4){_0x464d4f=_0x5d65d4;_0xeb35ea[_0x2943('0xd4')]=_[_0x2943('0xd0')](db[_0x2943('0xe0')]['rawAttributes']);_0xeb35ea['query']=_[_0x2943('0xd0')](_0x51eb4b[_0x2943('0x49')]);_0xeb35ea[_0x2943('0xd2')]=_['intersection'](_0xeb35ea[_0x2943('0xd4')],_0xeb35ea[_0x2943('0x49')]);_0x198b82[_0x2943('0x4f')]=_[_0x2943('0xd3')](_0xeb35ea['model'],qs[_0x2943('0xd5')](_0x51eb4b[_0x2943('0x49')][_0x2943('0xd5')]));_0x198b82['attributes']=_0x198b82[_0x2943('0x4f')][_0x2943('0x70')]?_0x198b82['attributes']:_0xeb35ea[_0x2943('0xd4')];_0x198b82[_0x2943('0xd6')]=qs[_0x2943('0xd7')](_0x51eb4b[_0x2943('0x49')][_0x2943('0xd7')]);_0x198b82[_0x2943('0x47')]=qs[_0x2943('0xd2')](_[_0x2943('0xd8')](_0x51eb4b[_0x2943('0x49')],_0xeb35ea['filters']));if(_0x51eb4b[_0x2943('0x49')][_0x2943('0x35')]){_0x198b82[_0x2943('0x47')]=_[_0x2943('0xd9')](_0x198b82[_0x2943('0x47')],{'$or':_[_0x2943('0x8e')](_0x198b82[_0x2943('0x4f')],function(_0x12b5d6){var _0xfa5065={};_0xfa5065[_0x12b5d6]={'$like':'%'+_0x51eb4b[_0x2943('0x49')][_0x2943('0x35')]+'%'};return _0xfa5065;})});}_0x198b82=_[_0x2943('0xd9')]({},_0x198b82,_0x51eb4b[_0x2943('0x5d')]);return _0x464d4f['getGroups'](_0x198b82);}})[_0x2943('0x21')](function(_0x35f37f){if(_0x35f37f){_0x2a37a1=_0x35f37f[_0x2943('0x70')];if(!_0x51eb4b[_0x2943('0x49')][_0x2943('0xdb')]('nolimit')){_0x198b82[_0x2943('0x1c')]=qs[_0x2943('0x1c')](_0x51eb4b['query'][_0x2943('0x1c')]);_0x198b82[_0x2943('0x1e')]=qs[_0x2943('0x1e')](_0x51eb4b[_0x2943('0x49')]['offset']);}return _0x464d4f[_0x2943('0xdf')](_0x198b82);}})[_0x2943('0x21')](function(_0x835cb0){if(_0x835cb0){return _0x835cb0?{'count':_0x2a37a1,'rows':_0x835cb0}:null;}})[_0x2943('0x21')](respondWithResult(_0x5a7f8a,null))[_0x2943('0x5a')](handleError(_0x5a7f8a,null));};exports[_0x2943('0xe1')]=function(_0x424df3,_0x474a52){var _0x3e8e57={'raw':!![],'where':{}};var _0x26d4f1={};var _0x3fb09f={'count':0x0,'rows':[]};return db[_0x2943('0x48')][_0x2943('0xc9')]({'where':{'id':_0x424df3[_0x2943('0x5c')]['id']}})['then'](handleEntityNotFound(_0x474a52,null))['then'](function(_0x3be03a){if(_0x3be03a){_0x26d4f1[_0x2943('0xd4')]=_[_0x2943('0xd0')](db[_0x2943('0xe2')][_0x2943('0x3d')]);_0x26d4f1[_0x2943('0x49')]=_[_0x2943('0xd0')](_0x424df3['query']);_0x26d4f1[_0x2943('0xd2')]=_['intersection'](_0x26d4f1[_0x2943('0xd4')],_0x26d4f1[_0x2943('0x49')]);_0x3e8e57[_0x2943('0x4f')]=_[_0x2943('0xd3')](_0x26d4f1[_0x2943('0xd4')],qs[_0x2943('0xd5')](_0x424df3[_0x2943('0x49')][_0x2943('0xd5')]));_0x3e8e57['attributes']=_0x3e8e57[_0x2943('0x4f')][_0x2943('0x70')]?_0x3e8e57[_0x2943('0x4f')]:_0x26d4f1[_0x2943('0xd4')];if(!_0x424df3[_0x2943('0x49')]['hasOwnProperty'](_0x2943('0xdc'))){_0x3e8e57['limit']=qs[_0x2943('0x1c')](_0x424df3[_0x2943('0x49')][_0x2943('0x1c')]);_0x3e8e57['offset']=qs['offset'](_0x424df3[_0x2943('0x49')][_0x2943('0x1e')]);}_0x3e8e57[_0x2943('0xd6')]=qs[_0x2943('0xd7')](_0x424df3['query'][_0x2943('0xd7')]);_0x3e8e57[_0x2943('0x47')]=qs[_0x2943('0xd2')](_['pick'](_0x424df3[_0x2943('0x49')],_0x26d4f1[_0x2943('0xd2')]));_0x3e8e57[_0x2943('0x47')]['UserId']=_0x3be03a['id'];if(_0x424df3['query'][_0x2943('0x35')]){_0x3e8e57['where']=_[_0x2943('0xd9')](_0x3e8e57[_0x2943('0x47')],{'$or':_[_0x2943('0x8e')](_0x3e8e57[_0x2943('0x4f')],function(_0x23b00d){var _0x373abc={};_0x373abc[_0x23b00d]={'$like':'%'+_0x424df3['query'][_0x2943('0x35')]+'%'};return _0x373abc;})});}_0x3e8e57=_[_0x2943('0xd9')]({},_0x3e8e57,_0x424df3[_0x2943('0x5d')]);return db[_0x2943('0xe2')][_0x2943('0x1d')]({'where':_0x3e8e57['where']})[_0x2943('0x21')](function(_0x2e383d){_0x3fb09f['count']=_0x2e383d;if(_0x424df3[_0x2943('0x49')][_0x2943('0x4a')]){_0x3e8e57[_0x2943('0x4b')]=[{'all':!![]}];}return db[_0x2943('0xe2')][_0x2943('0x51')](_0x3e8e57);})[_0x2943('0x21')](function(_0x2ea884){_0x3fb09f[_0x2943('0x52')]=_0x2ea884;return _0x3fb09f;});}})[_0x2943('0x21')](respondWithFilteredResult(_0x474a52,_0x3e8e57))[_0x2943('0x5a')](handleError(_0x474a52,null));};exports['getScreenRecordings']=function(_0x5e8182,_0x2d564b){var _0x19c1d2={'raw':!![],'where':{}};var _0x3370fd={};var _0x2132af={'count':0x0,'rows':[]};return db[_0x2943('0x48')][_0x2943('0xc9')]({'where':{'id':_0x5e8182[_0x2943('0x5c')]['id']}})[_0x2943('0x21')](handleEntityNotFound(_0x2d564b,null))['then'](function(_0x58e690){if(_0x58e690){_0x3370fd['model']=_[_0x2943('0xd0')](db[_0x2943('0xe3')][_0x2943('0x3d')]);_0x3370fd['query']=_[_0x2943('0xd0')](_0x5e8182[_0x2943('0x49')]);_0x3370fd['filters']=_[_0x2943('0xd3')](_0x3370fd[_0x2943('0xd4')],_0x3370fd['query']);_0x19c1d2[_0x2943('0x4f')]=_[_0x2943('0xd3')](_0x3370fd[_0x2943('0xd4')],qs[_0x2943('0xd5')](_0x5e8182[_0x2943('0x49')]['fields']));_0x19c1d2[_0x2943('0x4f')]=_0x19c1d2[_0x2943('0x4f')][_0x2943('0x70')]?_0x19c1d2[_0x2943('0x4f')]:_0x3370fd[_0x2943('0xd4')];if(!_0x5e8182[_0x2943('0x49')]['hasOwnProperty'](_0x2943('0xdc'))){_0x19c1d2['limit']=qs[_0x2943('0x1c')](_0x5e8182['query'][_0x2943('0x1c')]);_0x19c1d2[_0x2943('0x1e')]=qs[_0x2943('0x1e')](_0x5e8182['query'][_0x2943('0x1e')]);}_0x19c1d2['order']=qs['sort'](_0x5e8182[_0x2943('0x49')][_0x2943('0xd7')]);_0x19c1d2[_0x2943('0x47')]=qs[_0x2943('0xd2')](_['pick'](_0x5e8182[_0x2943('0x49')],_0x3370fd[_0x2943('0xd2')]));_0x19c1d2[_0x2943('0x47')]['UserId']=_0x58e690['id'];if(_0x5e8182[_0x2943('0x49')][_0x2943('0x35')]){_0x19c1d2['where']=_[_0x2943('0xd9')](_0x19c1d2['where'],{'$or':_[_0x2943('0x8e')](_0x19c1d2[_0x2943('0x4f')],function(_0xb5abe0){var _0x532531={};_0x532531[_0xb5abe0]={'$like':'%'+_0x5e8182[_0x2943('0x49')][_0x2943('0x35')]+'%'};return _0x532531;})});}_0x19c1d2=_[_0x2943('0xd9')]({},_0x19c1d2,_0x5e8182[_0x2943('0x5d')]);return db['ScreenRecording']['count']({'where':_0x19c1d2[_0x2943('0x47')]})[_0x2943('0x21')](function(_0x3dde91){_0x2132af[_0x2943('0x1d')]=_0x3dde91;if(_0x5e8182['query'][_0x2943('0x4a')]){_0x19c1d2[_0x2943('0x4b')]=[{'all':!![]}];}return db[_0x2943('0xe3')]['findAll'](_0x19c1d2);})['then'](function(_0x3e5b8e){_0x2132af[_0x2943('0x52')]=_0x3e5b8e;return _0x2132af;});}})[_0x2943('0x21')](respondWithFilteredResult(_0x2d564b,_0x19c1d2))[_0x2943('0x5a')](handleError(_0x2d564b,null));};exports[_0x2943('0xe4')]=function(_0x909ac0,_0x2b8ffa){var _0x5c3c62={};var _0x340937={};var _0x246e61;var _0x4e65dc;return db[_0x2943('0x48')]['findOne']({'where':{'id':_0x909ac0['params']['id']}})[_0x2943('0x21')](handleEntityNotFound(_0x2b8ffa,null))['then'](function(_0x5f318f){if(_0x5f318f){_0x246e61=_0x5f318f;_0x340937[_0x2943('0xd4')]=_['keys'](db[_0x2943('0xe5')][_0x2943('0x3d')]);_0x340937['query']=_[_0x2943('0xd0')](_0x909ac0[_0x2943('0x49')]);_0x340937['filters']=_[_0x2943('0xd3')](_0x340937[_0x2943('0xd4')],_0x340937[_0x2943('0x49')]);_0x5c3c62[_0x2943('0x4f')]=_['intersection'](_0x340937[_0x2943('0xd4')],qs[_0x2943('0xd5')](_0x909ac0['query'][_0x2943('0xd5')]));_0x5c3c62[_0x2943('0x4f')]=_0x5c3c62[_0x2943('0x4f')][_0x2943('0x70')]?_0x5c3c62['attributes']:_0x340937[_0x2943('0xd4')];_0x5c3c62['order']=qs[_0x2943('0xd7')](_0x909ac0[_0x2943('0x49')][_0x2943('0xd7')]);_0x5c3c62['where']=qs[_0x2943('0xd2')](_[_0x2943('0xd8')](_0x909ac0['query'],_0x340937[_0x2943('0xd2')]));if(_0x909ac0['query'][_0x2943('0x35')]){_0x5c3c62['where']=_['merge'](_0x5c3c62['where'],{'$or':_['map'](_0x5c3c62[_0x2943('0x4f')],function(_0xae8f4d){var _0x45517e={};_0x45517e[_0xae8f4d]={'$like':'%'+_0x909ac0[_0x2943('0x49')][_0x2943('0x35')]+'%'};return _0x45517e;})});}_0x5c3c62=_[_0x2943('0xd9')]({},_0x5c3c62,_0x909ac0[_0x2943('0x5d')]);return _0x246e61['getChatInteractions'](_0x5c3c62);}})[_0x2943('0x21')](function(_0x52bc22){if(_0x52bc22){_0x4e65dc=_0x52bc22[_0x2943('0x70')];if(!_0x909ac0[_0x2943('0x49')][_0x2943('0xdb')]('nolimit')){_0x5c3c62[_0x2943('0x1c')]=qs[_0x2943('0x1c')](_0x909ac0['query'][_0x2943('0x1c')]);_0x5c3c62[_0x2943('0x1e')]=qs['offset'](_0x909ac0[_0x2943('0x49')]['offset']);}return _0x246e61[_0x2943('0xe4')](_0x5c3c62);}})['then'](function(_0x335d80){if(_0x335d80){return _0x335d80?{'count':_0x4e65dc,'rows':_0x335d80}:null;}})[_0x2943('0x21')](respondWithResult(_0x2b8ffa,null))['catch'](handleError(_0x2b8ffa,null));};exports[_0x2943('0xe6')]=function(_0x4579be,_0x20595a){var _0xfc597d={};var _0x32c7ce={};var _0x4a1b45;var _0x234d93;return db[_0x2943('0x48')][_0x2943('0xc9')]({'where':{'id':_0x4579be['params']['id']}})['then'](handleEntityNotFound(_0x20595a,null))[_0x2943('0x21')](function(_0xe4317d){if(_0xe4317d){_0x4a1b45=_0xe4317d;_0x32c7ce[_0x2943('0xd4')]=_[_0x2943('0xd0')](db[_0x2943('0xe7')][_0x2943('0x3d')]);_0x32c7ce['query']=_[_0x2943('0xd0')](_0x4579be[_0x2943('0x49')]);_0x32c7ce[_0x2943('0xd2')]=_[_0x2943('0xd3')](_0x32c7ce[_0x2943('0xd4')],_0x32c7ce[_0x2943('0x49')]);_0xfc597d[_0x2943('0x4f')]=_['intersection'](_0x32c7ce[_0x2943('0xd4')],qs[_0x2943('0xd5')](_0x4579be[_0x2943('0x49')][_0x2943('0xd5')]));_0xfc597d[_0x2943('0x4f')]=_0xfc597d[_0x2943('0x4f')][_0x2943('0x70')]?_0xfc597d[_0x2943('0x4f')]:_0x32c7ce[_0x2943('0xd4')];_0xfc597d[_0x2943('0xd6')]=qs['sort'](_0x4579be[_0x2943('0x49')]['sort']);_0xfc597d[_0x2943('0x47')]=qs[_0x2943('0xd2')](_[_0x2943('0xd8')](_0x4579be[_0x2943('0x49')],_0x32c7ce[_0x2943('0xd2')]));if(_0x4579be[_0x2943('0x49')][_0x2943('0x35')]){_0xfc597d[_0x2943('0x47')]=_[_0x2943('0xd9')](_0xfc597d[_0x2943('0x47')],{'$or':_['map'](_0xfc597d[_0x2943('0x4f')],function(_0x13b4bf){var _0x7a3b54={};_0x7a3b54[_0x13b4bf]={'$like':'%'+_0x4579be[_0x2943('0x49')][_0x2943('0x35')]+'%'};return _0x7a3b54;})});}_0xfc597d=_[_0x2943('0xd9')]({},_0xfc597d,_0x4579be['options']);return _0x4a1b45[_0x2943('0xe6')](_0xfc597d);}})[_0x2943('0x21')](function(_0x266536){if(_0x266536){_0x234d93=_0x266536[_0x2943('0x70')];if(!_0x4579be[_0x2943('0x49')]['hasOwnProperty']('nolimit')){_0xfc597d[_0x2943('0x1c')]=qs[_0x2943('0x1c')](_0x4579be['query'][_0x2943('0x1c')]);_0xfc597d[_0x2943('0x1e')]=qs[_0x2943('0x1e')](_0x4579be[_0x2943('0x49')][_0x2943('0x1e')]);}return _0x4a1b45['getOpenchannelInteractions'](_0xfc597d);}})[_0x2943('0x21')](function(_0x370685){if(_0x370685){return _0x370685?{'count':_0x234d93,'rows':_0x370685}:null;}})['then'](respondWithResult(_0x20595a,null))['catch'](handleError(_0x20595a,null));};exports[_0x2943('0xe8')]=function(_0x3d1620,_0x4e17f0){var _0x420dce={'raw':!![],'where':{}};var _0x1b4322={};var _0x1c98de={'count':0x0,'rows':[]};return db[_0x2943('0x48')]['findOne']({'where':{'id':_0x3d1620[_0x2943('0x5c')]['id']}})[_0x2943('0x21')](handleEntityNotFound(_0x4e17f0,null))[_0x2943('0x21')](function(_0xe3cc7e){if(_0xe3cc7e){_0x1b4322[_0x2943('0xd4')]=_[_0x2943('0xd0')](db['MailInteraction'][_0x2943('0x3d')]);_0x1b4322[_0x2943('0x49')]=_[_0x2943('0xd0')](_0x3d1620[_0x2943('0x49')]);_0x1b4322[_0x2943('0xd2')]=_['intersection'](_0x1b4322[_0x2943('0xd4')],_0x1b4322[_0x2943('0x49')]);_0x420dce[_0x2943('0x4f')]=_[_0x2943('0xd3')](_0x1b4322[_0x2943('0xd4')],qs[_0x2943('0xd5')](_0x3d1620[_0x2943('0x49')][_0x2943('0xd5')]));_0x420dce[_0x2943('0x4f')]=_0x420dce['attributes']['length']?_0x420dce[_0x2943('0x4f')]:_0x1b4322[_0x2943('0xd4')];if(!_0x3d1620['query'][_0x2943('0xdb')](_0x2943('0xdc'))){_0x420dce[_0x2943('0x1c')]=qs['limit'](_0x3d1620[_0x2943('0x49')]['limit']);_0x420dce[_0x2943('0x1e')]=qs[_0x2943('0x1e')](_0x3d1620['query']['offset']);}_0x420dce[_0x2943('0xd6')]=qs[_0x2943('0xd7')](_0x3d1620['query'][_0x2943('0xd7')]);_0x420dce['where']=qs[_0x2943('0xd2')](_[_0x2943('0xd8')](_0x3d1620['query'],_0x1b4322[_0x2943('0xd2')]));_0x420dce[_0x2943('0x47')][_0x2943('0xe9')]=_0xe3cc7e['id'];if(_0x3d1620[_0x2943('0x49')]['filter']){_0x420dce[_0x2943('0x47')]=_[_0x2943('0xd9')](_0x420dce[_0x2943('0x47')],{'$or':_['map'](_0x420dce[_0x2943('0x4f')],function(_0x11d60f){var _0x56cdc9={};_0x56cdc9[_0x11d60f]={'$like':'%'+_0x3d1620[_0x2943('0x49')]['filter']+'%'};return _0x56cdc9;})});}_0x420dce=_[_0x2943('0xd9')]({},_0x420dce,_0x3d1620[_0x2943('0x5d')]);return db['MailInteraction'][_0x2943('0x1d')]({'where':_0x420dce[_0x2943('0x47')]})['then'](function(_0x5b9976){_0x1c98de[_0x2943('0x1d')]=_0x5b9976;if(_0x3d1620[_0x2943('0x49')][_0x2943('0x4a')]){_0x420dce['include']=[{'all':!![]}];}return db[_0x2943('0xea')][_0x2943('0x51')](_0x420dce);})[_0x2943('0x21')](function(_0x1813bb){_0x1c98de[_0x2943('0x52')]=_0x1813bb;return _0x1c98de;});}})[_0x2943('0x21')](respondWithFilteredResult(_0x4e17f0,_0x420dce))[_0x2943('0x5a')](handleError(_0x4e17f0,null));};exports[_0x2943('0xeb')]=function(_0x5247cb,_0x375e19){var _0x4289fb={};var _0x57ca00={};var _0x53d05b;var _0x1f3884;return db[_0x2943('0x48')][_0x2943('0xc9')]({'where':{'id':_0x5247cb[_0x2943('0x5c')]['id']}})[_0x2943('0x21')](handleEntityNotFound(_0x375e19,null))[_0x2943('0x21')](function(_0x439f67){if(_0x439f67){_0x53d05b=_0x439f67;_0x57ca00[_0x2943('0xd4')]=_['keys'](db['SmsInteraction'][_0x2943('0x3d')]);_0x57ca00[_0x2943('0x49')]=_[_0x2943('0xd0')](_0x5247cb['query']);_0x57ca00[_0x2943('0xd2')]=_[_0x2943('0xd3')](_0x57ca00['model'],_0x57ca00['query']);_0x4289fb[_0x2943('0x4f')]=_[_0x2943('0xd3')](_0x57ca00[_0x2943('0xd4')],qs['fields'](_0x5247cb[_0x2943('0x49')]['fields']));_0x4289fb[_0x2943('0x4f')]=_0x4289fb[_0x2943('0x4f')]['length']?_0x4289fb[_0x2943('0x4f')]:_0x57ca00[_0x2943('0xd4')];_0x4289fb[_0x2943('0xd6')]=qs[_0x2943('0xd7')](_0x5247cb['query'][_0x2943('0xd7')]);_0x4289fb[_0x2943('0x47')]=qs[_0x2943('0xd2')](_[_0x2943('0xd8')](_0x5247cb[_0x2943('0x49')],_0x57ca00['filters']));if(_0x5247cb['query']['filter']){_0x4289fb[_0x2943('0x47')]=_['merge'](_0x4289fb['where'],{'$or':_[_0x2943('0x8e')](_0x4289fb['attributes'],function(_0x371fee){var _0x4a26ad={};_0x4a26ad[_0x371fee]={'$like':'%'+_0x5247cb[_0x2943('0x49')][_0x2943('0x35')]+'%'};return _0x4a26ad;})});}_0x4289fb=_[_0x2943('0xd9')]({},_0x4289fb,_0x5247cb[_0x2943('0x5d')]);return _0x53d05b[_0x2943('0xeb')](_0x4289fb);}})[_0x2943('0x21')](function(_0x357bc2){if(_0x357bc2){_0x1f3884=_0x357bc2[_0x2943('0x70')];if(!_0x5247cb[_0x2943('0x49')]['hasOwnProperty'](_0x2943('0xdc'))){_0x4289fb['limit']=qs[_0x2943('0x1c')](_0x5247cb[_0x2943('0x49')][_0x2943('0x1c')]);_0x4289fb[_0x2943('0x1e')]=qs['offset'](_0x5247cb['query'][_0x2943('0x1e')]);}return _0x53d05b[_0x2943('0xeb')](_0x4289fb);}})[_0x2943('0x21')](function(_0x5c9aa8){if(_0x5c9aa8){return _0x5c9aa8?{'count':_0x1f3884,'rows':_0x5c9aa8}:null;}})[_0x2943('0x21')](respondWithResult(_0x375e19,null))[_0x2943('0x5a')](handleError(_0x375e19,null));};exports[_0x2943('0xec')]=function(_0x142391,_0x4639e7){var _0x2a0464={};var _0x225756={};var _0x298a35;var _0x36edc8;return db['User'][_0x2943('0xc9')]({'where':{'id':_0x142391[_0x2943('0x5c')]['id']}})[_0x2943('0x21')](handleEntityNotFound(_0x4639e7,null))['then'](function(_0x195c25){if(_0x195c25){_0x298a35=_0x195c25;_0x225756[_0x2943('0xd4')]=_[_0x2943('0xd0')](db['FaxInteraction'][_0x2943('0x3d')]);_0x225756[_0x2943('0x49')]=_[_0x2943('0xd0')](_0x142391['query']);_0x225756[_0x2943('0xd2')]=_['intersection'](_0x225756['model'],_0x225756[_0x2943('0x49')]);_0x2a0464[_0x2943('0x4f')]=_[_0x2943('0xd3')](_0x225756[_0x2943('0xd4')],qs[_0x2943('0xd5')](_0x142391[_0x2943('0x49')][_0x2943('0xd5')]));_0x2a0464['attributes']=_0x2a0464[_0x2943('0x4f')][_0x2943('0x70')]?_0x2a0464[_0x2943('0x4f')]:_0x225756[_0x2943('0xd4')];_0x2a0464['order']=qs[_0x2943('0xd7')](_0x142391[_0x2943('0x49')][_0x2943('0xd7')]);_0x2a0464[_0x2943('0x47')]=qs['filters'](_[_0x2943('0xd8')](_0x142391['query'],_0x225756[_0x2943('0xd2')]));if(_0x142391[_0x2943('0x49')][_0x2943('0x35')]){_0x2a0464['where']=_[_0x2943('0xd9')](_0x2a0464[_0x2943('0x47')],{'$or':_[_0x2943('0x8e')](_0x2a0464['attributes'],function(_0x416660){var _0xf0cf60={};_0xf0cf60[_0x416660]={'$like':'%'+_0x142391[_0x2943('0x49')][_0x2943('0x35')]+'%'};return _0xf0cf60;})});}_0x2a0464=_[_0x2943('0xd9')]({},_0x2a0464,_0x142391[_0x2943('0x5d')]);return _0x298a35['getFaxInteractions'](_0x2a0464);}})['then'](function(_0x51042f){if(_0x51042f){_0x36edc8=_0x51042f[_0x2943('0x70')];if(!_0x142391[_0x2943('0x49')]['hasOwnProperty'](_0x2943('0xdc'))){_0x2a0464['limit']=qs['limit'](_0x142391['query'][_0x2943('0x1c')]);_0x2a0464[_0x2943('0x1e')]=qs[_0x2943('0x1e')](_0x142391[_0x2943('0x49')][_0x2943('0x1e')]);}return _0x298a35['getFaxInteractions'](_0x2a0464);}})['then'](function(_0x389a42){if(_0x389a42){return _0x389a42?{'count':_0x36edc8,'rows':_0x389a42}:null;}})['then'](respondWithResult(_0x4639e7,null))[_0x2943('0x5a')](handleError(_0x4639e7,null));};exports[_0x2943('0xed')]=function(_0x1ddaad,_0x4dd4a6){var _0xa9c94a={};var _0x20c2bb={};var _0x19006a;var _0xbdf964;return db['User'][_0x2943('0xc9')]({'where':{'id':_0x1ddaad[_0x2943('0x5c')]['id']}})[_0x2943('0x21')](handleEntityNotFound(_0x4dd4a6,null))['then'](function(_0x495a7e){if(_0x495a7e){_0x19006a=_0x495a7e;_0x20c2bb[_0x2943('0xd4')]=_[_0x2943('0xd0')](db['WhatsappInteraction'][_0x2943('0x3d')]);_0x20c2bb[_0x2943('0x49')]=_[_0x2943('0xd0')](_0x1ddaad[_0x2943('0x49')]);_0x20c2bb[_0x2943('0xd2')]=_[_0x2943('0xd3')](_0x20c2bb[_0x2943('0xd4')],_0x20c2bb['query']);_0xa9c94a['attributes']=_[_0x2943('0xd3')](_0x20c2bb[_0x2943('0xd4')],qs[_0x2943('0xd5')](_0x1ddaad[_0x2943('0x49')]['fields']));_0xa9c94a[_0x2943('0x4f')]=_0xa9c94a[_0x2943('0x4f')][_0x2943('0x70')]?_0xa9c94a[_0x2943('0x4f')]:_0x20c2bb[_0x2943('0xd4')];_0xa9c94a[_0x2943('0xd6')]=qs[_0x2943('0xd7')](_0x1ddaad[_0x2943('0x49')][_0x2943('0xd7')]);_0xa9c94a[_0x2943('0x47')]=qs[_0x2943('0xd2')](_[_0x2943('0xd8')](_0x1ddaad[_0x2943('0x49')],_0x20c2bb['filters']));if(_0x1ddaad[_0x2943('0x49')][_0x2943('0x35')]){_0xa9c94a[_0x2943('0x47')]=_[_0x2943('0xd9')](_0xa9c94a[_0x2943('0x47')],{'$or':_[_0x2943('0x8e')](_0xa9c94a[_0x2943('0x4f')],function(_0x4d4f2b){var _0xd55391={};_0xd55391[_0x4d4f2b]={'$like':'%'+_0x1ddaad['query'][_0x2943('0x35')]+'%'};return _0xd55391;})});}_0xa9c94a=_[_0x2943('0xd9')]({},_0xa9c94a,_0x1ddaad[_0x2943('0x5d')]);return _0x19006a[_0x2943('0xed')](_0xa9c94a);}})[_0x2943('0x21')](function(_0x1c6d88){if(_0x1c6d88){_0xbdf964=_0x1c6d88[_0x2943('0x70')];if(!_0x1ddaad[_0x2943('0x49')]['hasOwnProperty']('nolimit')){_0xa9c94a[_0x2943('0x1c')]=qs[_0x2943('0x1c')](_0x1ddaad['query']['limit']);_0xa9c94a[_0x2943('0x1e')]=qs[_0x2943('0x1e')](_0x1ddaad[_0x2943('0x49')][_0x2943('0x1e')]);}return _0x19006a[_0x2943('0xed')](_0xa9c94a);}})['then'](function(_0x48329e){if(_0x48329e){return _0x48329e?{'count':_0xbdf964,'rows':_0x48329e}:null;}})[_0x2943('0x21')](respondWithResult(_0x4dd4a6,null))[_0x2943('0x5a')](handleError(_0x4dd4a6,null));};exports[_0x2943('0xee')]=function(_0x3d9cdc,_0x1fd087,_0x4e62b2){var _0x2ec25b;var _0x12233f;var _0x2b5343;var _0x273c42=!_[_0x2943('0x6d')](_0x3d9cdc[_0x2943('0x5c')]['id'])?_0x3d9cdc[_0x2943('0x5c')]['id']:!_[_0x2943('0x6d')](_0x3d9cdc[_0x2943('0x31')]['id'])?_0x3d9cdc[_0x2943('0x31')]['id']:null;return db[_0x2943('0x48')][_0x2943('0x39')]({'where':{'id':_0x273c42,'role':{'$or':[_0x2943('0x30'),_0x2943('0x31'),'agent']}},'attributes':['id',_0x2943('0x3a'),_0x2943('0xef'),_0x2943('0xf0'),'role',_0x2943('0x65'),_0x2943('0xf1')]})[_0x2943('0x21')](function(_0x1c1b99){if(_0x1c1b99){if(_0x1c1b99[_0x2943('0x2f')]==='agent'){_0x2ec25b=_0x1c1b99;if(_0x3d9cdc[_0x2943('0x60')][_0x2943('0xa3')]){_0x2b5343=util[_0x2943('0xad')](_0x2943('0xf2'),_0x2ec25b[_0x3d9cdc[_0x2943('0x60')][_0x2943('0xa3')]]);}else if(_0x3d9cdc[_0x2943('0x60')][_0x2943('0xf3')]){_0x2b5343=util[_0x2943('0xad')](_0x2943('0xae'),_0x3d9cdc[_0x2943('0x60')]['intrf']);}else{_0x2b5343=util[_0x2943('0xad')](_0x2943('0xae'),_0x2ec25b[_0x2943('0x3a')]);}socket['to'](util[_0x2943('0xad')](_0x2943('0xf4'),_0x2ec25b[_0x2943('0x3a')]))[_0x2943('0x2b')](_0x2943('0xf5'),{'user':{'id':_0x2ec25b['id'],'name':_0x2ec25b['name']},'ip':_0x3d9cdc['headers']['x-forwarded-for']||_0x3d9cdc[_0x2943('0xf6')][_0x2943('0xf7')]||_0x3d9cdc['socket'][_0x2943('0xf7')]||_0x3d9cdc[_0x2943('0xf6')]['socket'][_0x2943('0xf7')]});return db[_0x2943('0xaf')]['destroy']({'where':{'membername':_0x2ec25b[_0x2943('0x3a')]},'individualHooks':!![]});}}else{throw new db[(_0x2943('0x94'))][(_0x2943('0x95'))](_0x2943('0xf8'));}})[_0x2943('0x21')](function(){if(_0x2ec25b){return _0x2ec25b[_0x2943('0xf9')]({'raw':!![]});}})[_0x2943('0x21')](function(_0x3b5802){if(_0x2ec25b){if(_0x3b5802){_0x12233f=_0x3b5802;if(_0x12233f['length']){var _0x3945db=_0x12233f[_0x2943('0x8e')](function(_0x3b099f){var _0x430d80={'membername':_0x2ec25b['name'],'UserId':_0x2ec25b['id'],'queue_name':_0x3b099f[_0x2943('0x3a')],'VoiceQueueId':_0x3b099f['id'],'interface':_0x2b5343,'paused':_0x2ec25b[_0x2943('0xf1')]||![],'penalty':_0x3b099f['UserVoiceQueue.penalty']||0x0};return db['UserVoiceQueueRt'][_0x2943('0xb0')](_0x430d80);});return Promise[_0x2943('0x59')](_0x3945db);}}}})[_0x2943('0x21')](function(){if(_0x2ec25b){return db[_0x2943('0xfa')]['findAll']({'where':{'membername':_0x2ec25b[_0x2943('0x3a')],'exitAt':null}});}})[_0x2943('0x21')](function(_0x584602){if(_0x2ec25b){var _0x17b5de=[];_0x584602[_0x2943('0xfb')](function(_0x30a15e){_0x17b5de[_0x2943('0x50')](_0x30a15e[_0x2943('0x2a')]({'exitAt':moment()[_0x2943('0xad')](_0x2943('0xfc'))}));});return Promise[_0x2943('0x59')](_0x17b5de);}})[_0x2943('0x21')](function(){if(_0x2ec25b){var _0x4e603f=[];var _0x169b28=[];var _0x37c85b=utils['getChannels']();var _0x15b68a={'membername':_0x2ec25b[_0x2943('0x3a')],'interface':_0x2b5343,'enterAt':moment()['format'](_0x2943('0xfc')),'role':_0x2ec25b['role'],'internal':_0x2ec25b[_0x2943('0x65')]};_0x37c85b['forEach'](function(_0x32faae){_0x4e603f[_0x2943('0x50')](_[_0x2943('0xd9')]({'channel':_0x32faae,'type':_0x2943('0xfd'),'data1':_0x3d9cdc[_0x2943('0x60')][_0x2943('0xfe')],'data2':_0x2b5343},_0x15b68a));if(_0x2ec25b[_0x2943('0xf1')]){_0x169b28[_0x2943('0x50')](_[_0x2943('0xd9')]({'channel':_0x32faae,'type':_0x2943('0xff'),'data1':_0x2943('0x100')},_0x15b68a));}});return db[_0x2943('0xfa')][_0x2943('0x8a')](_0x4e603f[_0x2943('0xc7')](_0x169b28),{'individualHooks':!![]});}})[_0x2943('0x21')](function(){if(_0x2ec25b){return _0x2ec25b[_0x2943('0x2a')]({'online':!![],'lastLoginAt':moment()[_0x2943('0xad')](_0x2943('0xfc')),'voicePause':_0x2ec25b[_0x2943('0xf1')]||![],'mailPause':_0x2ec25b[_0x2943('0xf1')]||![],'chatPause':_0x2ec25b[_0x2943('0xf1')]||![],'faxPause':_0x2ec25b[_0x2943('0xf1')]||![],'smsPause':_0x2ec25b[_0x2943('0xf1')]||![],'openchannelPause':_0x2ec25b['loginInPause']||![],'whatsappPause':_0x2ec25b[_0x2943('0xf1')]||![],'pauseType':_0x2ec25b['loginInPause']?_0x2943('0x100'):null,'interface':_0x2b5343,'lastPauseAt':moment()[_0x2943('0xad')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x2943('0x21')](function(_0xc696a1){if(_0x3d9cdc['isMiddleware']){return _0x4e62b2();}else{return Promise[_0x2943('0x101')](_0xc696a1)['then'](respondWithResult(_0x1fd087,null));}})[_0x2943('0x5a')](handleError(_0x1fd087,null));};exports[_0x2943('0x102')]=function(_0x5dfeb6,_0x33bc25){var _0x92cfa5;return db[_0x2943('0x48')][_0x2943('0x39')]({'where':{'id':_0x5dfeb6[_0x2943('0x5c')]['id'],'role':'agent'},'attributes':['id',_0x2943('0x3a'),_0x2943('0x2f')]})['then'](handleEntityNotFound(_0x33bc25,null))['then'](function(_0x2e39e7){if(_0x2e39e7){_0x92cfa5=_0x2e39e7;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x92cfa5[_0x2943('0x3a')]},'individualHooks':!![]});}})[_0x2943('0x21')](function(){return db[_0x2943('0xfa')][_0x2943('0x51')]({'where':{'membername':_0x92cfa5['name'],'exitAt':null}});})[_0x2943('0x21')](function(_0x4f74df){var _0x31138c=[];_0x4f74df['forEach'](function(_0x976424){_0x31138c[_0x2943('0x50')](_0x976424[_0x2943('0x2a')]({'exitAt':moment()[_0x2943('0xad')](_0x2943('0xfc'))}));});return Promise[_0x2943('0x59')](_0x31138c);})['then'](function(){return _0x92cfa5['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x2943('0x21')](respondWithResult(_0x33bc25,null))[_0x2943('0x5a')](handleError(_0x33bc25,null));};exports['pause']=function(_0x1cd693,_0x49e9cb){var _0x4e8ace;return db[_0x2943('0xaf')][_0x2943('0x2a')]({'paused':0x1},{'where':{'UserId':_0x1cd693[_0x2943('0x5c')]['id']},'individualHooks':!![]})['then'](function(){return db['User'][_0x2943('0x39')]({'where':{'id':_0x1cd693[_0x2943('0x5c')]['id'],'role':_0x2943('0x33')},'attributes':['id','name',_0x2943('0x2f'),'internal',_0x2943('0xa3'),_0x2943('0xa1')]});})[_0x2943('0x21')](handleEntityNotFound(_0x49e9cb,null))['then'](function(_0x257289){if(_0x257289){_0x4e8ace=_0x257289;return respondWithRpcPromise('QueuePause',_0x2943('0x103'),{'id':_0x4e8ace['id'],'name':_0x4e8ace[_0x2943('0x3a')],'pause':!![]});}})[_0x2943('0x21')](function(){if(_0x4e8ace){return db[_0x2943('0xfa')][_0x2943('0x51')]({'where':{'membername':_0x4e8ace[_0x2943('0x3a')],'type':'PAUSE','exitAt':null}});}})[_0x2943('0x21')](function(_0x40a894){if(_0x40a894['length']){var _0x28096f=moment()[_0x2943('0xad')](_0x2943('0xfc'));for(var _0x35507b=0x0,_0x514220=_0x40a894['length'];_0x35507b<_0x514220;_0x35507b++){_0x40a894[_0x35507b][_0x2943('0x104')]({'exitAt':_0x28096f});}}})[_0x2943('0x21')](function(){var _0x19c06f=[];var _0x57a35b=utils[_0x2943('0x105')]();_0x57a35b[_0x2943('0xfb')](function(_0x3009af){_0x19c06f[_0x2943('0x50')]({'channel':_0x3009af,'membername':_0x4e8ace[_0x2943('0x3a')],'interface':_[_0x2943('0x6d')](_0x4e8ace[_0x2943('0xa3')])?util[_0x2943('0xad')](_0x2943('0xae'),_0x4e8ace[_0x2943('0x3a')]):_0x4e8ace[_0x2943('0xa3')],'type':_0x2943('0xff'),'enterAt':moment()[_0x2943('0xad')](_0x2943('0xfc')),'data1':_0x1cd693[_0x2943('0x60')]['type']||'DEFAULT\x20PAUSE','role':_0x4e8ace[_0x2943('0x2f')],'internal':_0x4e8ace[_0x2943('0x65')]});});return db['MemberReport'][_0x2943('0x8a')](_0x19c06f,{'individualHooks':!![]});})[_0x2943('0x21')](function(){return _0x4e8ace[_0x2943('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1cd693[_0x2943('0x60')][_0x2943('0x3f')]||_0x2943('0x106'),'lastPauseAt':moment()[_0x2943('0xad')](_0x2943('0xfc'))});})[_0x2943('0x21')](respondWithResult(_0x49e9cb,null))['catch'](handleError(_0x49e9cb,null));};exports[_0x2943('0x107')]=function(_0x92579a,_0x9b1b34){if(_0x92579a[_0x2943('0x60')][_0x2943('0xa0')]&&!utils['isValidChannel'](_0x92579a['body'][_0x2943('0xa0')])){throw new APIBadRequestError(util[_0x2943('0xad')](_0x2943('0x108'),_0x92579a[_0x2943('0x60')][_0x2943('0xa0')]));}return db['User']['find']({'where':{'id':_0x92579a[_0x2943('0x5c')]['id']},'attributes':['id','name','role','internal','interface','online',_0x2943('0xa2'),_0x2943('0x109'),_0x2943('0x10a'),'faxPause',_0x2943('0x10b'),'smsPause',_0x2943('0x10c'),_0x2943('0x10d'),'lastPauseAt']})[_0x2943('0x21')](function(_0x1ff9f1){if(!_0x1ff9f1){throw new APINotFoundError(util[_0x2943('0xad')](_0x2943('0x10e'),_0x92579a['params']['id']));}return _0x1ff9f1[_0x2943('0x107')](_0x92579a['body'][_0x2943('0xa0')]);})[_0x2943('0x21')](respondWithResult(_0x9b1b34,null))['catch'](APIHandleError(_0x9b1b34));};exports[_0x2943('0x10f')]=function(_0x26e524,_0x151cd1){var _0x174067={};var _0x5a9b69={};var _0x1843cb;var _0x58245e;return db[_0x2943('0x48')][_0x2943('0xc9')]({'where':{'id':_0x26e524[_0x2943('0x5c')]['id']}})[_0x2943('0x21')](handleEntityNotFound(_0x151cd1,null))[_0x2943('0x21')](function(_0x56e10a){if(_0x56e10a){_0x1843cb=_0x56e10a;_0x5a9b69['model']=_[_0x2943('0xd0')](db[_0x2943('0x110')]['rawAttributes']);_0x5a9b69[_0x2943('0x49')]=_[_0x2943('0xd0')](_0x26e524[_0x2943('0x49')]);_0x5a9b69[_0x2943('0xd2')]=_[_0x2943('0xd3')](_0x5a9b69[_0x2943('0xd4')],_0x5a9b69[_0x2943('0x49')]);_0x174067[_0x2943('0x4f')]=_[_0x2943('0xd3')](_0x5a9b69[_0x2943('0xd4')],qs['fields'](_0x26e524['query'][_0x2943('0xd5')]));_0x174067[_0x2943('0x4f')]=_0x174067[_0x2943('0x4f')][_0x2943('0x70')]?_0x174067[_0x2943('0x4f')]:_0x5a9b69[_0x2943('0xd4')];_0x174067['order']=qs[_0x2943('0xd7')](_0x26e524[_0x2943('0x49')][_0x2943('0xd7')]);_0x174067['where']=qs[_0x2943('0xd2')](_[_0x2943('0xd8')](_0x26e524[_0x2943('0x49')],_0x5a9b69[_0x2943('0xd2')]));if(_0x26e524['query'][_0x2943('0x35')]){_0x174067['where']=_[_0x2943('0xd9')](_0x174067['where'],{'$or':_[_0x2943('0x8e')](_0x174067[_0x2943('0x4f')],function(_0x43c71c){var _0x2cb2a0={};_0x2cb2a0[_0x43c71c]={'$like':'%'+_0x26e524['query'][_0x2943('0x35')]+'%'};return _0x2cb2a0;})});}_0x174067=_[_0x2943('0xd9')]({},_0x174067,_0x26e524[_0x2943('0x5d')]);return _0x1843cb[_0x2943('0x10f')](_0x174067);}})[_0x2943('0x21')](function(_0x51371e){if(_0x51371e){_0x58245e=_0x51371e[_0x2943('0x70')];if(!_0x26e524['query'][_0x2943('0xdb')](_0x2943('0xdc'))){_0x174067['limit']=qs[_0x2943('0x1c')](_0x26e524[_0x2943('0x49')][_0x2943('0x1c')]);_0x174067[_0x2943('0x1e')]=qs['offset'](_0x26e524['query'][_0x2943('0x1e')]);}return _0x1843cb['getTeams'](_0x174067);}})[_0x2943('0x21')](function(_0x1872e8){if(_0x1872e8){return _0x1872e8?{'count':_0x58245e,'rows':_0x1872e8}:null;}})[_0x2943('0x21')](respondWithResult(_0x151cd1,null))[_0x2943('0x5a')](handleError(_0x151cd1,null));};exports[_0x2943('0x111')]=function(_0x206add,_0x5f0c1f){var _0x141960=_0x206add[_0x2943('0x5c')]['id'];var _0x358698=_0x206add[_0x2943('0x60')]?_0x206add[_0x2943('0x60')]['ids']:null;var _0x4a3045=[];return Promise['resolve']()[_0x2943('0x21')](function(){if(!_0x358698)throw new APIBadRequestError(_0x2943('0x112'));})[_0x2943('0x21')](function(){return db[_0x2943('0x48')][_0x2943('0xc9')]({'where':{'id':_0x141960}});})[_0x2943('0x21')](function(_0x48a5bf){if(!_0x48a5bf)throw new APINotFoundError(util['format'](_0x2943('0x10e'),_0x206add[_0x2943('0x5c')]['id']));return db[_0x2943('0x6e')][_0x2943('0x113')](function(_0x5e2f93){return _0x48a5bf[_0x2943('0x111')](_0x358698,{'transaction':_0x5e2f93})[_0x2943('0x21')](function(){return db['Team']['findAll']({'where':{'id':{'$in':_0x358698}}});})[_0x2943('0x21')](function(_0x585d44){var _0x352e35=_['map'](_0x585d44,function(_0x38dc43){return _0x38dc43[_0x2943('0x114')]();});return Promise[_0x2943('0x59')](_0x352e35);})[_0x2943('0x21')](function(_0x3b95cd){_0x4a3045=_['flattenDeep'](_0x3b95cd);var _0x2a5fab=_[_0x2943('0x8e')](_0x4a3045,function(_0x215a88){return _0x215a88[_0x2943('0x115')](_0x48a5bf['id'],{'transaction':_0x5e2f93});});return Promise[_0x2943('0x59')](_0x2a5fab);})[_0x2943('0x21')](function(){if(!_0x48a5bf[_0x2943('0xa1')])return;var _0x3e9cfc=_[_0x2943('0x35')](_0x4a3045,function(_0x3d5562){return _0x3d5562[_0x2943('0x116')]('channel')==='Voice';});var _0x52d33c=_[_0x2943('0x8e')](_0x3e9cfc,function(_0x436583){return db[_0x2943('0xaf')][_0x2943('0xb0')]({'membername':_0x48a5bf['name'],'UserId':_0x48a5bf['id'],'queue_name':_0x436583[_0x2943('0x3a')],'VoiceQueueId':_0x436583['id'],'interface':_[_0x2943('0x6d')](_0x48a5bf['interface'])?util[_0x2943('0xad')]('SIP/%s',_0x48a5bf[_0x2943('0x3a')]):_0x48a5bf[_0x2943('0xa3')],'paused':_0x48a5bf['voicePause']||![],'penalty':_0x48a5bf[_0x2943('0xa7')]},{'transaction':_0x5e2f93});});return Promise[_0x2943('0x59')](_0x52d33c);})[_0x2943('0x21')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x358698}}});})['then'](function(_0x492c27){var _0x455850=_[_0x2943('0x8e')](_0x492c27,function(_0x1a278c){return db[_0x2943('0x117')][_0x2943('0x8f')]({'UserId':_0x48a5bf['id'],'VoicePrefixId':_0x1a278c['VoicePrefixId']},{'transaction':_0x5e2f93});});return Promise[_0x2943('0x59')](_0x455850);});});})[_0x2943('0x21')](function(){for(var _0x489e3f=0x0;_0x489e3f<_0x4a3045['length'];_0x489e3f++){var _0x2a939d=_0x4a3045[_0x489e3f][_0x2943('0x116')](_0x2943('0xa0'));var _0x55ca83=_0x2a939d+_0x2943('0xa9');socket[_0x2943('0x2b')](_0x2943('0x31')+_0x2a939d+'Queue:save',{'UserId':_0x141960,['queueField']:_0x4a3045[_0x489e3f]['id']});}})[_0x2943('0x21')](respondWithStatusCode(_0x5f0c1f,null))['catch'](APIHandleError(_0x5f0c1f));};exports[_0x2943('0x118')]=function(_0x5bce98,_0x23a0e7){var _0x9cc047=_0x5bce98[_0x2943('0x5c')]['id'];var _0x5408c5=null;if(_0x5bce98['query'][_0x2943('0x63')]){_0x5408c5=_['isArray'](_0x5bce98[_0x2943('0x49')][_0x2943('0x63')])?_0x5bce98[_0x2943('0x49')][_0x2943('0x63')]:[_0x5bce98[_0x2943('0x49')]['ids']];}var _0x2d3791=[];return Promise[_0x2943('0x101')]()[_0x2943('0x21')](function(){if(!_0x5408c5)throw new APIBadRequestError(_0x2943('0x119'));})[_0x2943('0x21')](function(){return db['User'][_0x2943('0xc9')]({'where':{'id':_0x9cc047}});})[_0x2943('0x21')](function(_0x347c22){if(!_0x347c22)throw new APINotFoundError(util[_0x2943('0xad')](_0x2943('0x10e'),_0x5bce98[_0x2943('0x5c')]['id']));return db[_0x2943('0x6e')][_0x2943('0x113')](function(_0xe6fd01){return _0x347c22[_0x2943('0x118')](_0x5408c5,{'transaction':_0xe6fd01})[_0x2943('0x21')](function(){return db['Team'][_0x2943('0x51')]({'where':{'id':{'$in':_0x5408c5}}});})['then'](function(_0x1f2941){var _0x34aed1=_[_0x2943('0x8e')](_0x1f2941,function(_0x53ae35){return _0x53ae35[_0x2943('0x114')]();});return Promise['all'](_0x34aed1);})['then'](function(_0x23a392){_0x2d3791=_[_0x2943('0x11a')](_0x23a392);var _0x1b7b8f=_[_0x2943('0x8e')](_0x2d3791,function(_0x335a58){return _0x335a58[_0x2943('0x11b')](_0x347c22['id'],{'transaction':_0xe6fd01});});return Promise['all'](_0x1b7b8f);})[_0x2943('0x21')](function(){if(!_0x347c22['online'])return;var _0x159d6a=_[_0x2943('0x35')](_0x2d3791,function(_0x4b70f0){return _0x4b70f0['getDataValue'](_0x2943('0xa0'))===_0x2943('0x11c');});var _0x124637=_[_0x2943('0x8e')](_0x159d6a,function(_0x42e9da){return db[_0x2943('0xaf')]['destroy']({'where':{'VoiceQueueId':_0x42e9da['id'],'UserId':_0x347c22['id']},'transaction':_0xe6fd01});});return Promise['all'](_0x124637);})[_0x2943('0x21')](function(){return db[_0x2943('0x11d')][_0x2943('0x51')]({'where':{'teamId':{'$in':_0x5408c5}}});})[_0x2943('0x21')](function(_0x257391){var _0x5b38a4=_[_0x2943('0x8e')](_0x257391,function(_0x5dc1e2){return db[_0x2943('0x117')][_0x2943('0x2d')]({'where':{'UserId':_0x347c22['id'],'VoicePrefixId':_0x5dc1e2[_0x2943('0x11e')]}},{'transaction':_0xe6fd01});});return Promise[_0x2943('0x59')](_0x5b38a4);});});})['then'](function(){for(var _0x5c9a0b=0x0;_0x5c9a0b<_0x2d3791[_0x2943('0x70')];_0x5c9a0b++){var _0x5793a3=_0x2d3791[_0x5c9a0b]['getDataValue'](_0x2943('0xa0'));var _0x556a0e=_0x5793a3+_0x2943('0xa9');socket[_0x2943('0x2b')](_0x2943('0x31')+_0x5793a3+_0x2943('0xb3'),{'UserId':_0x9cc047,['queueField']:_0x2d3791[_0x5c9a0b]['id']});}})['then'](respondWithStatusCode(_0x23a0e7,null))['catch'](APIHandleError(_0x23a0e7));};exports['getLists']=function(_0x273e1a,_0xf6a78e){var _0x49969e={};var _0x5624e5={};var _0x43ba85;var _0x4a15ec;return db[_0x2943('0x48')][_0x2943('0xc9')]({'where':{'id':_0x273e1a[_0x2943('0x5c')]['id']}})['then'](handleEntityNotFound(_0xf6a78e,null))[_0x2943('0x21')](function(_0x120aa5){if(_0x120aa5){_0x43ba85=_0x120aa5;_0x5624e5[_0x2943('0xd4')]=_[_0x2943('0xd0')](db[_0x2943('0xca')][_0x2943('0x3d')]);_0x5624e5[_0x2943('0x49')]=_[_0x2943('0xd0')](_0x273e1a['query']);_0x5624e5[_0x2943('0xd2')]=_['intersection'](_0x5624e5[_0x2943('0xd4')],_0x5624e5[_0x2943('0x49')]);_0x49969e['attributes']=_['intersection'](_0x5624e5[_0x2943('0xd4')],qs[_0x2943('0xd5')](_0x273e1a[_0x2943('0x49')][_0x2943('0xd5')]));_0x49969e[_0x2943('0x4f')]=_0x49969e[_0x2943('0x4f')][_0x2943('0x70')]?_0x49969e['attributes']:_0x5624e5[_0x2943('0xd4')];_0x49969e[_0x2943('0xd6')]=qs[_0x2943('0xd7')](_0x273e1a[_0x2943('0x49')][_0x2943('0xd7')]);_0x49969e[_0x2943('0x47')]=qs['filters'](_['pick'](_0x273e1a[_0x2943('0x49')],_0x5624e5['filters']));if(_0x273e1a[_0x2943('0x49')][_0x2943('0x35')]){_0x49969e['where']=_[_0x2943('0xd9')](_0x49969e[_0x2943('0x47')],{'$or':_[_0x2943('0x8e')](_0x49969e['attributes'],function(_0x27fbda){var _0x5d86c1={};_0x5d86c1[_0x27fbda]={'$like':'%'+_0x273e1a['query'][_0x2943('0x35')]+'%'};return _0x5d86c1;})});}_0x49969e=_[_0x2943('0xd9')]({},_0x49969e,_0x273e1a[_0x2943('0x5d')]);return _0x43ba85['getLists'](_0x49969e);}})[_0x2943('0x21')](function(_0x289766){if(_0x289766){_0x4a15ec=_0x289766['length'];if(!_0x273e1a[_0x2943('0x49')][_0x2943('0xdb')]('nolimit')){_0x49969e[_0x2943('0x1c')]=qs[_0x2943('0x1c')](_0x273e1a[_0x2943('0x49')]['limit']);_0x49969e['offset']=qs['offset'](_0x273e1a[_0x2943('0x49')][_0x2943('0x1e')]);}return _0x43ba85['getLists'](_0x49969e);}})['then'](function(_0x2dab2f){if(_0x2dab2f){return _0x2dab2f?{'count':_0x4a15ec,'rows':_0x2dab2f}:null;}})[_0x2943('0x21')](respondWithResult(_0xf6a78e,null))['catch'](handleError(_0xf6a78e,null));};exports[_0x2943('0x11f')]=function(_0x5294e9,_0x4e2081){var _0x8ed0bc={};var _0x44964b={};var _0x627f69;return db[_0x2943('0x48')]['findOne']({'where':{'id':_0x5294e9[_0x2943('0x5c')]['id']}})[_0x2943('0x21')](handleEntityNotFound(_0x4e2081,null))[_0x2943('0x21')](function(_0x188805){if(_0x188805){_0x627f69=_0x188805;_0x44964b[_0x2943('0xd4')]=_['keys'](db[_0x2943('0x48')]['rawAttributes']);_0x44964b[_0x2943('0x49')]=_[_0x2943('0xd0')](_0x5294e9[_0x2943('0x49')]);_0x44964b[_0x2943('0xd2')]=_['intersection'](_0x44964b[_0x2943('0xd4')],_0x44964b[_0x2943('0x49')]);_0x8ed0bc['attributes']=_[_0x2943('0xd3')](_0x44964b[_0x2943('0xd4')],qs[_0x2943('0xd5')](_0x5294e9[_0x2943('0x49')][_0x2943('0xd5')]));_0x8ed0bc[_0x2943('0x4f')]=_0x8ed0bc[_0x2943('0x4f')][_0x2943('0x70')]?_0x8ed0bc[_0x2943('0x4f')]:_0x44964b[_0x2943('0xd4')];_0x8ed0bc[_0x2943('0xd6')]=qs[_0x2943('0xd7')](_0x5294e9[_0x2943('0x49')][_0x2943('0xd7')]);_0x8ed0bc[_0x2943('0x47')]=qs[_0x2943('0xd2')](_[_0x2943('0xd8')](_0x5294e9['query'],_0x44964b[_0x2943('0xd2')]));if(_0x5294e9[_0x2943('0x49')][_0x2943('0x35')]){_0x8ed0bc[_0x2943('0x47')]=_[_0x2943('0xd9')](_0x8ed0bc[_0x2943('0x47')],{'$or':_['map'](_0x8ed0bc[_0x2943('0x4f')],function(_0x3dcd0e){var _0x2c5dc8={};_0x2c5dc8[_0x3dcd0e]={'$like':'%'+_0x5294e9[_0x2943('0x49')][_0x2943('0x35')]+'%'};return _0x2c5dc8;})});}_0x8ed0bc[_0x2943('0xd4')]=db[_0x2943('0x48')];_0x8ed0bc['as']=_0x2943('0x32');_0x8ed0bc=_[_0x2943('0xd9')]({},_0x8ed0bc,_0x5294e9[_0x2943('0x5d')]);return _0x627f69['getVoiceQueues']({'include':[_0x8ed0bc]});}})['then'](function(_0x1acd20){if(_0x1acd20){var _0xb99b2f={},_0x2ca259=[];for(var _0x2f6f21=0x0;_0x2f6f21<_0x1acd20[_0x2943('0x70')];_0x2f6f21+=0x1){for(var _0x17dc2a=0x0,_0x56b115;_0x17dc2a<_0x1acd20[_0x2f6f21]['Agents'][_0x2943('0x70')];_0x17dc2a+=0x1){_0x56b115=_0x1acd20[_0x2f6f21][_0x2943('0x32')][_0x17dc2a][_0x2943('0x2e')]({'plain':!![]});_0xb99b2f[_0x56b115['id']]=_0x56b115;}}_0xb99b2f=_[_0x2943('0x120')](_0xb99b2f);for(var _0xbd88a9=qs['offset'](_0x5294e9[_0x2943('0x49')][_0x2943('0x1e')]);_0xbd88a9<_0xb99b2f[_0x2943('0x70')]&&_0x2ca259[_0x2943('0x70')]=_0x4b7d83){_0x107834=_0x4b7d83;_0x27688b=0xc8;}else{_0x27688b=0xce;}_0x4aabf4['status'](_0x27688b);return _0x4aabf4[_0x5aab('0x20')](_0x5aab('0x21'),_0x2cdc1b+'-'+_0x107834+'/'+_0x4b7d83)[_0x5aab('0x22')](_0x4d49d7);}return null;};}function respondWithRpcPromise(_0x3c450e,_0x371d05,_0x155027,_0x5d0184){return new Promise(function(_0x911007,_0x3f8349){var _0xe4670c=_0x5d0184||amiClient;return _0xe4670c['request'](_0x3c450e,_0x155027)[_0x5aab('0x23')](function(_0x3c5cbf){logger['info'](_0x5aab('0x24'),_0x371d05,_0x5aab('0x25'));logger['debug'](_0x5aab('0x26'),_0x371d05,_0x5aab('0x25'),JSON[_0x5aab('0x27')](_0x3c5cbf));if(_0x3c5cbf['error']){if(_0x3c5cbf[_0x5aab('0x28')]['code']===0x1f4){logger['error'](_0x5aab('0x24'),_0x371d05,_0x3c5cbf[_0x5aab('0x28')][_0x5aab('0x29')]);return _0x3f8349(_0x3c5cbf[_0x5aab('0x28')][_0x5aab('0x29')]);}logger['error'](_0x5aab('0x24'),_0x371d05,_0x3c5cbf[_0x5aab('0x28')][_0x5aab('0x29')]);return _0x911007(_0x3c5cbf[_0x5aab('0x28')][_0x5aab('0x29')]);}else{logger[_0x5aab('0x2a')]('User,\x20%s,\x20%s',_0x371d05,_0x5aab('0x25'));_0x911007(_0x3c5cbf[_0x5aab('0x2b')][_0x5aab('0x29')]);}})[_0x5aab('0x2c')](function(_0x4f8909){logger[_0x5aab('0x28')](_0x5aab('0x24'),_0x371d05,_0x4f8909);_0x3f8349(_0x4f8909);});});}function saveUpdates(_0x17d82d){return function(_0x341fa3){if(_0x341fa3){return _0x341fa3[_0x5aab('0x2d')](_0x17d82d)['then'](function(_0x27ec97){if(_0x27ec97[_0x5aab('0x2e')]==='agent'){socket['emit']('userNotification:recalc:'+_0x27ec97['id'],_0x27ec97);}return _0x27ec97;});}return null;};}function removeEntity(_0x294af5,_0x57cc50){return function(_0x3684a5){if(_0x3684a5){return _0x3684a5[_0x5aab('0x2f')]({'transaction':_0x57cc50})['then'](function(){var _0x56735b=_0x3684a5[_0x5aab('0x30')]({'plain':!![]});if(_0x56735b['role']===_0x5aab('0x31'))return;var _0x204a6e=[{'name':_0x5aab('0x32'),'value':_0x5aab('0x33'),'ignore':!![]},{'name':'Agents','value':_0x5aab('0x34'),'ignore':![]},{'name':_0x5aab('0x35'),'value':_0x5aab('0x36'),'ignore':![]}];var _0x5542ca=_(_0x204a6e)[_0x5aab('0x37')](_0x5aab('0x38'))[_0x5aab('0x39')](_0x5aab('0x3a'))[_0x5aab('0x3a')]();if(_[_0x5aab('0x3b')](_0x5542ca,_0x56735b['role'])){return;}var _0x4c9942=_[_0x5aab('0x3c')](_0x204a6e,['value',_0x56735b['role']])[_0x5aab('0x3d')];return db[_0x5aab('0x3e')][_0x5aab('0x2f')]({'where':{'type':_0x4c9942,'resourceId':_0x56735b['id']},'transaction':_0x57cc50})['then'](function(){return _0x3684a5;});})[_0x5aab('0x23')](function(){_0x294af5[_0x5aab('0x1a')](0xcc)[_0x5aab('0x1b')]();});}};}function handleEntityNotFound(_0x426542){return function(_0x2696c0){if(!_0x2696c0){_0x426542[_0x5aab('0x19')](0x194);}return _0x2696c0;};}function handleError(_0x5d4626,_0xe2df41){_0xe2df41=_0xe2df41||0x1f4;return function(_0xa2f855){logger[_0x5aab('0x28')](_0xa2f855[_0x5aab('0x3f')]);if(_0xa2f855[_0x5aab('0x3d')]){delete _0xa2f855['name'];}_0x5d4626[_0x5aab('0x1a')](_0xe2df41)['send'](_0xa2f855);};}function getUserAttributes(){return _(db[_0x5aab('0x40')][_0x5aab('0x41')])[_0x5aab('0x39')](function(_0x55af90){return{'name':_0x55af90[_0x5aab('0x42')],'type':_0x55af90[_0x5aab('0x43')][_0x5aab('0x44')]};})[_0x5aab('0x37')](function(_0x411946){return![_0x5aab('0x45'),_0x5aab('0x46'),_0x5aab('0x47'),_0x5aab('0x48'),_0x5aab('0x49'),_0x5aab('0x4a')]['includes'](_0x411946['name']);})[_0x5aab('0x3a')]();}exports[_0x5aab('0x4b')]=function(_0x40d7e3,_0x28b947){var _0x28d904={},_0x562b69={'count':0x0,'rows':[]};var _0x55e165=getUserAttributes();_0x28d904=qs[_0x5aab('0x4c')](_0x55e165,_0x40d7e3);var _0x499d14={'where':_0x28d904[_0x5aab('0x4d')]};return db[_0x5aab('0x40')][_0x5aab('0x1f')](_0x499d14)['then'](function(_0x13253c){_0x562b69[_0x5aab('0x1f')]=_0x13253c;if(_0x40d7e3[_0x5aab('0x4e')]['includeAll']){_0x28d904[_0x5aab('0x4f')]=[{'all':!![]}];}if(_0x40d7e3[_0x5aab('0x4e')][_0x5aab('0x50')]==='true'){_0x28d904[_0x5aab('0x4f')]=[{'model':db['UserSetting'],'as':'userSetting'}];}if(!_[_0x5aab('0x3b')](_0x28d904[_0x5aab('0x51')],'id')){_0x28d904[_0x5aab('0x51')][_0x5aab('0x52')]('id');}return db[_0x5aab('0x40')][_0x5aab('0x53')](_0x28d904);})[_0x5aab('0x23')](function(_0x276f15){_0x562b69[_0x5aab('0x54')]=_0x276f15;if(_0x40d7e3[_0x5aab('0x4e')][_0x5aab('0x55')]===_0x5aab('0x56')){var _0x43eb29=[];for(var _0x2804ab=0x0;_0x2804ab<_0x562b69[_0x5aab('0x54')][_0x5aab('0x57')];_0x2804ab++){_0x43eb29['push'](get_open_tabs(_0x5aab('0x58'),_0x562b69['rows'][_0x2804ab]['dataValues']));_0x43eb29['push'](get_open_tabs(_0x5aab('0x59'),_0x562b69[_0x5aab('0x54')][_0x2804ab][_0x5aab('0x5a')]));_0x43eb29[_0x5aab('0x52')](get_open_tabs(_0x5aab('0x5b'),_0x562b69[_0x5aab('0x54')][_0x2804ab]['dataValues']));_0x43eb29[_0x5aab('0x52')](get_open_tabs(_0x5aab('0x5c'),_0x562b69[_0x5aab('0x54')][_0x2804ab][_0x5aab('0x5a')]));_0x43eb29['push'](get_open_tabs(_0x5aab('0x5d'),_0x562b69[_0x5aab('0x54')][_0x2804ab][_0x5aab('0x5a')]));_0x43eb29[_0x5aab('0x52')](get_open_tabs('whatsapp',_0x562b69['rows'][_0x2804ab][_0x5aab('0x5a')]));}return Promise['all'](_0x43eb29)['then'](function(){return _0x562b69;});}else{return _0x562b69;}})['then'](respondWithFilteredResult(_0x28b947,_0x28d904))[_0x5aab('0x2c')](handleError(_0x28b947,null));};exports['show']=function(_0x56992f,_0x206951){var _0x1cb595=getUserAttributes();_0x56992f[_0x5aab('0x4e')]['id']=_0x56992f[_0x5aab('0x5e')]['id'];var _0x22e849=qs[_0x5aab('0x4c')](_0x1cb595,_0x56992f);if(_0x56992f[_0x5aab('0x4e')][_0x5aab('0x5f')]){_0x22e849[_0x5aab('0x4f')]=[{'all':!![]}];}if(_0x56992f[_0x5aab('0x4e')][_0x5aab('0x50')]===_0x5aab('0x56')){_0x22e849['include']=[{'model':db[_0x5aab('0x60')],'as':_0x5aab('0x50')}];}_0x22e849=_[_0x5aab('0x61')]({},_0x22e849,_0x56992f[_0x5aab('0x62')]);if(!_[_0x5aab('0x3b')](_0x22e849[_0x5aab('0x51')],'id')){_0x22e849['attributes'][_0x5aab('0x52')]('id');}return db['User'][_0x5aab('0x3c')](_0x22e849)[_0x5aab('0x23')](handleEntityNotFound(_0x206951,null))[_0x5aab('0x23')](function(_0x52d236){var _0x2591e2=[];values=_0x52d236;if(_0x56992f['query'][_0x5aab('0x55')]===_0x5aab('0x56')){_0x2591e2[_0x5aab('0x52')](get_open_tabs(_0x5aab('0x58'),_0x52d236['dataValues']));_0x2591e2[_0x5aab('0x52')](get_open_tabs('sms',_0x52d236['dataValues']));_0x2591e2['push'](get_open_tabs(_0x5aab('0x5d'),_0x52d236[_0x5aab('0x5a')]));_0x2591e2[_0x5aab('0x52')](get_open_tabs(_0x5aab('0x63'),_0x52d236['dataValues']));_0x2591e2[_0x5aab('0x52')](get_open_tabs(_0x5aab('0x5b'),_0x52d236[_0x5aab('0x5a')]));_0x2591e2[_0x5aab('0x52')](get_open_tabs(_0x5aab('0x5c'),_0x52d236['dataValues']));return Promise[_0x5aab('0x64')](_0x2591e2);}else{return values;}})['then'](function(){return values;})[_0x5aab('0x23')](respondWithResult(_0x206951,null))[_0x5aab('0x2c')](handleError(_0x206951,null));};exports[_0x5aab('0x2d')]=function(_0x1e9efb,_0x3ef00d){if(_0x1e9efb[_0x5aab('0x65')]['id']){delete _0x1e9efb[_0x5aab('0x65')]['id'];}delete _0x1e9efb[_0x5aab('0x65')][_0x5aab('0x2e')];return db[_0x5aab('0x40')][_0x5aab('0x3c')]({'where':{'id':_0x1e9efb[_0x5aab('0x5e')]['id']}})[_0x5aab('0x23')](handleEntityNotFound(_0x3ef00d,null))[_0x5aab('0x23')](saveUpdates(_0x1e9efb[_0x5aab('0x65')],null))[_0x5aab('0x23')](respondWithResult(_0x3ef00d,null))[_0x5aab('0x2c')](handleError(_0x3ef00d,null));};exports[_0x5aab('0x66')]=function(_0x75abba,_0x171603){return db[_0x5aab('0x40')]['describe']()['then'](respondWithResult(_0x171603,null))[_0x5aab('0x2c')](handleError(_0x171603,null));};exports[_0x5aab('0x67')]=function(_0x240b20,_0x52f88b){return db[_0x5aab('0x40')][_0x5aab('0x3c')]({'where':{'id':_0x240b20[_0x5aab('0x5e')]['id']}})[_0x5aab('0x23')](handleEntityNotFound(_0x52f88b,null))[_0x5aab('0x23')](function(_0x93779a){if(_0x93779a){return _0x93779a[_0x5aab('0x67')](_0x240b20['body'][_0x5aab('0x68')],_['omit'](_0x240b20[_0x5aab('0x65')],[_0x5aab('0x68'),'id'])||{});}})['then'](respondWithResult(_0x52f88b,null))[_0x5aab('0x2c')](handleError(_0x52f88b,null));};function validateUser(_0x57dabe){return new Promise(function(_0x129168,_0x178fb4){if(_0x57dabe[_0x5aab('0x69')])return _0x129168(_0x57dabe);return db[_0x5aab('0x6a')][_0x5aab('0x6b')](0x1)[_0x5aab('0x23')](function(_0x171de2){if(_0x171de2[_0x5aab('0x6c')])authService[_0x5aab('0x6d')](_0x57dabe[_0x5aab('0x45')]);db[_0x5aab('0x40')][_0x5aab('0x6e')]('internal')[_0x5aab('0x23')](function(_0x10662c){if(_[_0x5aab('0x6f')](_0x10662c)){_0x57dabe['internal']=_0x171de2['min_internal']||0x1;return;}if(_[_0x5aab('0x6f')](_0x171de2[_0x5aab('0x70')])||_0x171de2[_0x5aab('0x70')]===_0x10662c){_0x57dabe[_0x5aab('0x69')]=_0x10662c+0x1;return;}if(_0x171de2[_0x5aab('0x70')]>_0x10662c){_0x57dabe[_0x5aab('0x69')]=_0x171de2[_0x5aab('0x70')];return;}return db[_0x5aab('0x71')][_0x5aab('0x4e')](_0x5aab('0x72'),{'type':db[_0x5aab('0x71')][_0x5aab('0x73')][_0x5aab('0x74')]})[_0x5aab('0x23')](function(_0x6f9158){if(_0x6f9158&&_0x6f9158['length']){for(var _0x216826=0x0,_0x3242f3=_0x6f9158[_0x5aab('0x57')];_0x216826<_0x3242f3&&_[_0x5aab('0x6f')](_0x57dabe['internal']);_0x216826++){if(_0x171de2[_0x5aab('0x70')]<=_0x6f9158[_0x216826][_0x5aab('0x75')]){_0x57dabe[_0x5aab('0x69')]=_0x6f9158[_0x216826][_0x5aab('0x75')];}else if(_0x171de2['min_internal']>_0x6f9158[_0x216826][_0x5aab('0x75')]&&_0x171de2[_0x5aab('0x70')]<=_0x6f9158[_0x216826]['to']){_0x57dabe[_0x5aab('0x69')]=_0x171de2[_0x5aab('0x70')];}}}if(_['isNil'](_0x57dabe[_0x5aab('0x69')])){_0x57dabe[_0x5aab('0x69')]=_0x10662c+0x1;}return _0x129168(_0x57dabe);});});})['catch'](function(_0x50fabe){_0x178fb4(_0x50fabe);});});}function updateUser(_0x2b1e5d){return new Promise(function(_0x461cdf,_0x4701bb){try{if(_0x2b1e5d[_0x5aab('0x76')]){_0x2b1e5d['mailbox']=_0x2b1e5d['internal'];_0x2b1e5d[_0x5aab('0x77')]={'mailbox':_0x2b1e5d[_0x5aab('0x69')],'password':_0x2b1e5d['password'],'fullname':_0x2b1e5d[_0x5aab('0x78')],'email':_0x2b1e5d[_0x5aab('0x79')]};}if(_0x2b1e5d[_0x5aab('0x2e')]===_0x5aab('0x34')){if(!_0x2b1e5d[_0x5aab('0x7a')])_0x2b1e5d[_0x5aab('0x7a')]=[_0x5aab('0x7b'),_0x5aab('0x7c'),_0x5aab('0x7d'),'113',_0x5aab('0x7e'),_0x5aab('0x7f'),_0x5aab('0x80'),_0x5aab('0x81'),_0x5aab('0x82'),_0x5aab('0x83'),_0x5aab('0x84'),_0x5aab('0x85'),_0x5aab('0x86'),_0x5aab('0x87'),_0x5aab('0x88')];}_0x461cdf(_0x2b1e5d);}catch(_0x2b6570){_0x4701bb(_0x2b6570);}});}exports['create']=function(_0x257f62,_0xedf1e3){if(_0x257f62['user']['role']==='agent')throw new Error(_0x5aab('0x89'));if(_0x257f62[_0x5aab('0x65')][_0x5aab('0x2e')]===_0x5aab('0x33')&&_0x257f62[_0x5aab('0x33')][_0x5aab('0x2e')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x257f62[_0x5aab('0x65')]['role']===_0x5aab('0x31')&&_0x257f62[_0x5aab('0x33')]['role']!=='admin'){throw new Error(_0x5aab('0x8a'));}return licenseUtil[_0x5aab('0x8b')]([_0x257f62['body']])['then'](function(){return validateUser(_0x257f62[_0x5aab('0x65')]);})[_0x5aab('0x23')](function(_0x1cbaab){return updateUser(_0x1cbaab)[_0x5aab('0x23')](function(_0x11120a){if(_0x11120a[_0x5aab('0x2e')]==='admin'){_0x11120a[_0x5aab('0x8c')]=_0x257f62[_0x5aab('0x33')][_0x5aab('0x8c')];delete _0x11120a['userProfileId'];}return _0x11120a;});})[_0x5aab('0x23')](function(_0x1096bf){return db[_0x5aab('0x40')][_0x5aab('0x8d')](_0x1096bf,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})['then'](function(_0x5859a4){if(_0x257f62[_0x5aab('0x65')]['role']===_0x5aab('0x33'))return _0x5859a4;if(_0x257f62[_0x5aab('0x33')][_0x5aab('0x2e')]!=='user')return _0x5859a4;return db[_0x5aab('0x8e')][_0x5aab('0x3c')]({'where':{'name':_0x5859a4[_0x5aab('0x2e')]===_0x5aab('0x34')?'Agents':_0x5aab('0x35'),'userProfileId':_0x257f62['user']['userProfileId']},'raw':!![]})[_0x5aab('0x23')](function(_0x419275){if(!_0x419275||_0x419275['autoAssociation']!=0x0)return _0x5859a4;return db[_0x5aab('0x3e')][_0x5aab('0x8d')]({'name':_0x5859a4[_0x5aab('0x3d')],'resourceId':_0x5859a4['id'],'type':_0x419275[_0x5aab('0x3d')],'sectionId':_0x419275['id']},{})['then'](function(){return _0x5859a4;});})['catch'](function(_0x5dbad6){logger[_0x5aab('0x28')](_0x5aab('0x8f'),_0x5dbad6);throw _0x5dbad6;});})[_0x5aab('0x23')](respondWithResult(_0xedf1e3,0xc9))['catch'](handleError(_0xedf1e3,null));};exports['bulkCreate']=function(_0x152c43,_0xb25cb3){var _0x425622=_0x152c43[_0x5aab('0x65')];var _0x5e4c25=[];if(_0x152c43[_0x5aab('0x33')][_0x5aab('0x2e')]===_0x5aab('0x34'))throw new Error(_0x5aab('0x89'));if(_['some'](_0x425622,[_0x5aab('0x2e'),_0x5aab('0x33')])&&_0x152c43['user'][_0x5aab('0x2e')]!==_0x5aab('0x31')){throw new Error(_0x5aab('0x90'));}if(_[_0x5aab('0x91')](_0x425622,['role','admin'])&&_0x152c43[_0x5aab('0x33')][_0x5aab('0x2e')]!=='admin'){throw new Error(_0x5aab('0x92'));}return licenseUtil[_0x5aab('0x8b')](_0x425622)[_0x5aab('0x23')](function(){return validateUser(_0x425622[0x0]);})['then'](function(){for(var _0x1f7ec9=0x1;_0x1f7ec9<_0x425622['length'];_0x1f7ec9++){var _0xabb62f=_0x425622[_0x1f7ec9-0x1][_0x5aab('0x69')];if(!_0x425622[_0x1f7ec9][_0x5aab('0x69')])_0x425622[_0x1f7ec9][_0x5aab('0x69')]=_0xabb62f+0x1;_0x5e4c25[_0x5aab('0x52')](validateUser(_0x425622[_0x1f7ec9]));}return Promise[_0x5aab('0x64')](_0x5e4c25);})[_0x5aab('0x23')](function(){_0x5e4c25=[];for(var _0x553c16=0x0;_0x553c16<_0x425622[_0x5aab('0x57')];_0x553c16++){_0x5e4c25[_0x5aab('0x52')](updateUser(_0x425622[_0x553c16]));}return Promise[_0x5aab('0x64')](_0x5e4c25);})[_0x5aab('0x23')](function(){_0x5e4c25=_0x425622[_0x5aab('0x39')](function(_0x294044){return db[_0x5aab('0x40')][_0x5aab('0x8d')](_0x294044,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})['then'](function(_0x2ee573){_0x294044['id']=_0x2ee573['id'];return _0x294044;});});return Promise['all'](_0x5e4c25);})[_0x5aab('0x23')](function(_0x5439c9){if(_0x152c43[_0x5aab('0x65')][_0x5aab('0x2e')]===_0x5aab('0x33'))return _0x5439c9;if(_0x152c43['user'][_0x5aab('0x2e')]!==_0x5aab('0x33'))return _0x5439c9;var _0x514edb=_[_0x5aab('0x91')](_0x5439c9,function(_0x1e5d11){return _0x1e5d11[_0x5aab('0x2e')]===_0x5aab('0x34')||_0x1e5d11['role']==='telephone';});if(!_0x514edb)return _0x5439c9;return db[_0x5aab('0x8e')][_0x5aab('0x53')]({'where':{'name':{'$or':[_0x5aab('0x93'),_0x5aab('0x35')]},'userProfileId':_0x152c43[_0x5aab('0x33')][_0x5aab('0x94')]},'raw':!![]})[_0x5aab('0x23')](function(_0x2112fe){if(_[_0x5aab('0x95')](_0x2112fe)||!_['some'](_0x2112fe,[_0x5aab('0x96'),0x0]))return _0x5439c9;_0x5e4c25=[];var _0x5256d9=_(_0x2112fe)[_0x5aab('0x39')](function(_0x5b7ee7){if(_0x5b7ee7[_0x5aab('0x96')]===0x1)return;return _0x5b7ee7[_0x5aab('0x3d')]===_0x5aab('0x93')?_0x5aab('0x34'):_0x5aab('0x36');})[_0x5aab('0x97')]()['value']();for(var _0x15957c=0x0;_0x15957c<_0x5439c9[_0x5aab('0x57')];_0x15957c++){if(!_[_0x5aab('0x3b')](_0x5256d9,_0x5439c9[_0x15957c][_0x5aab('0x2e')]))return;var _0x540628=_0x5439c9[_0x15957c]['role']===_0x5aab('0x34')?'Agents':_0x5aab('0x35');_0x5e4c25[_0x5aab('0x52')](db[_0x5aab('0x3e')][_0x5aab('0x8d')]({'name':_0x5439c9[_0x15957c][_0x5aab('0x3d')],'resourceId':_0x5439c9[_0x15957c]['id'],'type':_0x540628,'sectionId':_[_0x5aab('0x3c')](_0x2112fe,[_0x5aab('0x3d'),_0x540628])['id']},{}));}return Promise[_0x5aab('0x64')](_0x5e4c25);});})[_0x5aab('0x23')](respondWithResult(_0xb25cb3,0xc9))['catch'](handleError(_0xb25cb3,null));};exports['changePassword']=function(_0x1f1ac4,_0x313583){if(_0x1f1ac4[_0x5aab('0x65')]['id']){delete _0x1f1ac4['body']['id'];}return db[_0x5aab('0x40')]['find']({'where':{'id':_0x1f1ac4['params']['id']}})['then'](function(_0x2d0786){if(!_0x2d0786)return null;if(_0x2d0786['id']===_0x1f1ac4[_0x5aab('0x33')]['id']){if(!_0x1f1ac4[_0x5aab('0x65')]['oldPassword']||!_0x1f1ac4['body'][_0x5aab('0x98')]){throw new db[(_0x5aab('0x99'))][(_0x5aab('0x9a'))](_0x5aab('0x9b'));}if(!_0x2d0786[_0x5aab('0x9c')](_0x1f1ac4[_0x5aab('0x65')][_0x5aab('0x9d')])){throw new db[(_0x5aab('0x99'))][(_0x5aab('0x9a'))]('Wrong\x20credentials');}if(_0x1f1ac4[_0x5aab('0x65')][_0x5aab('0x9d')]===_0x1f1ac4[_0x5aab('0x65')]['newPassword']){throw new db[(_0x5aab('0x99'))][(_0x5aab('0x9a'))](_0x5aab('0x9e'));}}else if(_0x1f1ac4[_0x5aab('0x33')]['role']===_0x5aab('0x31')){if(!_0x1f1ac4[_0x5aab('0x65')][_0x5aab('0x98')]){throw new db[(_0x5aab('0x99'))][(_0x5aab('0x9a'))](_0x5aab('0x9f'));}}else if(_0x1f1ac4['user'][_0x5aab('0x2e')]==='user'){if(!_0x1f1ac4[_0x5aab('0x65')][_0x5aab('0x98')]){throw new db['Sequelize']['ValidationError'](_0x5aab('0x9f'));}if(_0x2d0786[_0x5aab('0x2e')]!=='agent'){throw new db[(_0x5aab('0x99'))][(_0x5aab('0x9a'))](_0x5aab('0x89'));}}else{throw new db[(_0x5aab('0x99'))][(_0x5aab('0x9a'))](_0x5aab('0x89'));}return _0x2d0786;})[_0x5aab('0x23')](handleEntityNotFound(_0x313583,null))[_0x5aab('0x23')](function(_0x3ff98a){return db[_0x5aab('0x6a')][_0x5aab('0xa0')]({'attributes':['id','securePassword',_0x5aab('0xa1'),_0x5aab('0xa2')]})[_0x5aab('0x23')](function(_0x189305){if(_0x189305[_0x5aab('0x6c')])authService[_0x5aab('0x6d')](_0x1f1ac4[_0x5aab('0x65')]['newPassword']);if(!_0x189305[_0x5aab('0xa1')]||!_0x3ff98a[_0x5aab('0x47')])return _0x3ff98a;authService['validatePasswordHistory'](_0x1f1ac4[_0x5aab('0x65')][_0x5aab('0x98')],_0x3ff98a[_0x5aab('0x47')],_0x189305[_0x5aab('0xa2')]);return _0x3ff98a;})['then'](saveUpdates({'password':_0x1f1ac4[_0x5aab('0x65')]['newPassword'],'passwordResetAt':_0x1f1ac4['user']['id']==_0x1f1ac4[_0x5aab('0x5e')]['id']?moment():null,'previousPasswords':authService[_0x5aab('0xa3')](_0x1f1ac4['body'][_0x5aab('0x98')],_0x3ff98a[_0x5aab('0x47')])},null));})[_0x5aab('0x23')](respondWithResult(_0x313583,null))[_0x5aab('0x2c')](handleError(_0x313583,null));};exports[_0x5aab('0xa4')]=function(_0x44d3cc,_0x56b340){var _0x3426ba=_0x44d3cc['body'][_0x5aab('0xa5')];return db[_0x5aab('0x40')][_0x5aab('0x3c')]({'where':{'id':_0x44d3cc[_0x5aab('0x5e')]['id']},'attributes':['id',_0x5aab('0x3d'),_0x5aab('0x2e'),_0x5aab('0xa6'),_0x5aab('0xa7'),_0x5aab('0xa8'),_0x5aab('0xa9')]})[_0x5aab('0x23')](handleEntityNotFound(_0x56b340,null))[_0x5aab('0x23')](function(_0x55768e){if(_0x55768e){if(!utils[_0x5aab('0xaa')](_0x3426ba)){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x55768e[_0x5aab('0xab')+_[_0x5aab('0xac')](_0x3426ba[_0x5aab('0xad')]())+_0x5aab('0xae')](_0x44d3cc[_0x5aab('0x65')][_0x5aab('0x68')],{'penalty':_0x44d3cc['body'][_0x5aab('0xaf')]||0x0})[_0x5aab('0xb0')](function(_0x4e5d92){for(var _0x23b586=0x0;_0x23b586<_0x44d3cc[_0x5aab('0x65')][_0x5aab('0x68')][_0x5aab('0x57')];_0x23b586+=0x1){var _0x35af96={'UserId':Number(_0x44d3cc[_0x5aab('0x5e')]['id'])};_0x35af96[_[_0x5aab('0xac')](_0x3426ba[_0x5aab('0xad')]())+_0x5aab('0xb1')]=Number(_0x44d3cc[_0x5aab('0x65')]['ids'][_0x23b586]);socket['emit'](_0x5aab('0x33')+_[_0x5aab('0xac')](_0x3426ba[_0x5aab('0xad')]())+_0x5aab('0xb2'),_0x35af96);}return _0x4e5d92;})[_0x5aab('0x23')](function(){if(_0x3426ba===_0x5aab('0xb3')){return db[_0x5aab('0xb4')][_0x5aab('0x53')]({'where':{'id':_0x44d3cc[_0x5aab('0x65')][_0x5aab('0x68')]||[]},'raw':!![],'attributes':['id',_0x5aab('0x3d')]});}})[_0x5aab('0x23')](function(_0xc7fbad){var _0x5837c8=_0x55768e[_0x5aab('0x30')]({'plain':!![]});var _0x476746=[];if(_0x3426ba==='voice'&&_0x5837c8[_0x5aab('0x2e')]===_0x5aab('0x34')&&_0x5837c8[_0x5aab('0xa6')]){for(let _0x12c5e3=0x0;_0x12c5e3<_0xc7fbad[_0x5aab('0x57')];_0x12c5e3+=0x1){_0x476746['push']({'membername':_0x5837c8[_0x5aab('0x3d')],'UserId':_0x5837c8['id'],'queue_name':_0xc7fbad[_0x12c5e3]['name'],'VoiceQueueId':_0xc7fbad[_0x12c5e3]['id'],'interface':_[_0x5aab('0x6f')](_0x5837c8['interface'])?util[_0x5aab('0xb5')](_0x5aab('0xb6'),_0x5837c8[_0x5aab('0x3d')]):_0x5837c8[_0x5aab('0xa9')],'paused':_0x5837c8[_0x5aab('0xa8')]||![],'penalty':_0x44d3cc[_0x5aab('0x65')]['penalty']||0x0});}return Promise[_0x5aab('0x64')](_0x476746['map'](function(_0x271e71){return db[_0x5aab('0xb7')][_0x5aab('0xb8')](_0x271e71);}));}return _0x55768e;});}})[_0x5aab('0x23')](respondWithStatusCode(_0x56b340,null))['catch'](handleError(_0x56b340,null));};exports[_0x5aab('0xb9')]=function(_0x3b5a16,_0x3c32ab){var _0x3228ab,_0x270f03;return db['User'][_0x5aab('0x3c')]({'where':{'id':_0x3b5a16['params']['id']},'attributes':['id',_0x5aab('0x3d'),_0x5aab('0x2e')]})[_0x5aab('0x23')](handleEntityNotFound(_0x3c32ab,null))['then'](function(_0x422e43){if(_0x422e43){_0x3228ab=_0x422e43;if(!_0x3b5a16[_0x5aab('0x4e')][_0x5aab('0xa5')]||!utils['isValidChannel'](_0x3b5a16['query'][_0x5aab('0xa5')])){throw new db[(_0x5aab('0x99'))]['ValidationError']('Unknown\x20channel');}return _0x422e43[_0x5aab('0xba')+_[_0x5aab('0xac')](_0x3b5a16[_0x5aab('0x4e')][_0x5aab('0xa5')][_0x5aab('0xad')]())+_0x5aab('0xae')](_0x3b5a16['query']['ids']);}})['then'](function(_0x533bf3){if(_[_0x5aab('0xbb')](_0x3b5a16[_0x5aab('0x4e')][_0x5aab('0x68')])){for(var _0x3053f1=0x0;_0x3053f1<_0x3b5a16[_0x5aab('0x4e')][_0x5aab('0x68')][_0x5aab('0x57')];_0x3053f1+=0x1){_0x270f03={'UserId':Number(_0x3b5a16[_0x5aab('0x5e')]['id'])};_0x270f03[_['capitalize'](_0x3b5a16['query'][_0x5aab('0xa5')][_0x5aab('0xad')]())+_0x5aab('0xb1')]=Number(_0x3b5a16[_0x5aab('0x4e')]['ids'][_0x3053f1]);socket[_0x5aab('0xbc')](_0x5aab('0x33')+_[_0x5aab('0xac')](_0x3b5a16[_0x5aab('0x4e')][_0x5aab('0xa5')][_0x5aab('0xad')]())+_0x5aab('0xbd'),_0x270f03);}}else{_0x270f03={'UserId':Number(_0x3b5a16[_0x5aab('0x5e')]['id'])};_0x270f03[_['capitalize'](_0x3b5a16[_0x5aab('0x4e')][_0x5aab('0xa5')][_0x5aab('0xad')]())+'QueueId']=Number(_0x3b5a16[_0x5aab('0x4e')][_0x5aab('0x68')]);socket['emit']('user'+_[_0x5aab('0xac')](_0x3b5a16['query'][_0x5aab('0xa5')][_0x5aab('0xad')]())+_0x5aab('0xbd'),_0x270f03);}return _0x533bf3;})['then'](function(){if(_0x3b5a16['query']['channel']===_0x5aab('0xb3')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x3b5a16[_0x5aab('0x5e')]['id'],'VoiceQueueId':_0x3b5a16['query']['ids']},'individualHooks':!![]})[_0x5aab('0x23')](function(){return _0x3228ab;});}return _0x3228ab;})[_0x5aab('0x23')](respondWithStatusCode(_0x3c32ab,null))['catch'](handleError(_0x3c32ab,null));};exports[_0x5aab('0xbe')]=function(_0x49261f,_0x1164b0){_0x49261f[_0x5aab('0x65')][_0x5aab('0xbf')]=_0x49261f['file']['filename'];return db[_0x5aab('0x40')][_0x5aab('0x3c')]({'where':{'id':_0x49261f[_0x5aab('0x5e')]['id']}})[_0x5aab('0x23')](handleEntityNotFound(_0x1164b0,null))[_0x5aab('0x23')](saveUpdates(_0x49261f[_0x5aab('0x65')],null))[_0x5aab('0x23')](respondWithResult(_0x1164b0,null))['catch'](handleError(_0x1164b0,null));};exports[_0x5aab('0xc0')]=function(_0x23d556,_0xc7ce4e){var _0x433a7b=path[_0x5aab('0xc1')](config['root'],_0x5aab('0xc2'));return db[_0x5aab('0x40')][_0x5aab('0x3c')]({'where':{'id':_0x23d556[_0x5aab('0x5e')]['id']},'attributes':['id',_0x5aab('0xbf')],'raw':!![]})[_0x5aab('0x23')](handleEntityNotFound(_0xc7ce4e,null))[_0x5aab('0x23')](function(_0x11f6dd){if(_0x11f6dd){if(_[_0x5aab('0x6f')](_0x11f6dd[_0x5aab('0xbf')])){return _0xc7ce4e['download'](_0x433a7b);}else{if(!fs[_0x5aab('0xc3')](path['join'](config[_0x5aab('0xc4')],_0x5aab('0xc5'),_0x11f6dd[_0x5aab('0xbf')]))){return _0xc7ce4e['download'](_0x433a7b);}return _0xc7ce4e[_0x5aab('0xc6')](path['join'](config[_0x5aab('0xc4')],_0x5aab('0xc5'),_0x11f6dd[_0x5aab('0xbf')]));}}})[_0x5aab('0x2c')](handleError(_0xc7ce4e,null));};exports[_0x5aab('0xc7')]=function(_0x3f9d22,_0x33c06b){return db[_0x5aab('0x40')][_0x5aab('0x3c')]({'where':{'id':_0x3f9d22['params']['id']},'attributes':['id']})[_0x5aab('0x23')](handleEntityNotFound(_0x33c06b,null))[_0x5aab('0x23')](function(_0x5740b1){var _0x318840=[];values=_0x5740b1[_0x5aab('0x5a')];_0x318840[_0x5aab('0x52')](get_open_tabs('chat',_0x5740b1[_0x5aab('0x5a')]));_0x318840['push'](get_open_tabs(_0x5aab('0x59'),_0x5740b1[_0x5aab('0x5a')]));_0x318840[_0x5aab('0x52')](get_open_tabs(_0x5aab('0x5d'),_0x5740b1[_0x5aab('0x5a')]));_0x318840['push'](get_open_tabs(_0x5aab('0x63'),_0x5740b1['dataValues']));_0x318840['push'](get_open_tabs(_0x5aab('0x5b'),_0x5740b1[_0x5aab('0x5a')]));_0x318840[_0x5aab('0x52')](get_open_tabs(_0x5aab('0x5c'),_0x5740b1[_0x5aab('0x5a')]));return Promise[_0x5aab('0x64')](_0x318840);})['then'](function(_0x3ed932){if(_0x3ed932){var _0x451bdd=_[_0x5aab('0x39')](values[_0x5aab('0xc8')],function(_0x3d62e3){return{'channel':'CHAT','id':_0x3d62e3['id'],'createdAt':_0x3d62e3[_0x5aab('0xc9')]};});var _0x166fb2=_['map'](values[_0x5aab('0xca')],function(_0x2de657){return{'channel':_0x5aab('0xcb'),'id':_0x2de657['id'],'createdAt':_0x2de657[_0x5aab('0xc9')]};});var _0x489d28=_[_0x5aab('0x39')](values[_0x5aab('0xcc')],function(_0x4faac2){return{'channel':_0x5aab('0xcd'),'id':_0x4faac2['id'],'createdAt':_0x4faac2[_0x5aab('0xc9')]};});var _0x1cc1a8=_['map'](values[_0x5aab('0xce')],function(_0x5c1996){return{'channel':_0x5aab('0xcf'),'id':_0x5c1996['id'],'createdAt':_0x5c1996[_0x5aab('0xc9')]};});var _0x4fde34=_[_0x5aab('0x39')](values[_0x5aab('0xd0')],function(_0x1ddbde){return{'channel':_0x5aab('0xd1'),'id':_0x1ddbde['id'],'createdAt':_0x1ddbde[_0x5aab('0xc9')]};});var _0x184f48=_['map'](values[_0x5aab('0xd2')],function(_0x587a67){return{'channel':'WHATSAPP','id':_0x587a67['id'],'createdAt':_0x587a67[_0x5aab('0xc9')]};});var _0x26f17d=_[_0x5aab('0xd3')](_0x451bdd,_0x166fb2,_0x489d28,_0x1cc1a8,_0x4fde34,_0x184f48);var _0x3a928c={'count':_0x26f17d[_0x5aab('0x57')],'rows':_0x26f17d};return _0x3a928c;}else return null;})['then'](respondWithResult(_0x33c06b,null))['catch'](handleError(_0x33c06b,null));};exports[_0x5aab('0xd4')]=function(_0x5a79b5,_0x48eb8f){var _0x5b01eb={};return db['User'][_0x5aab('0xa0')]({'where':{'id':_0x5a79b5[_0x5aab('0x5e')]['id']}})['then'](function(_0x195e26){if(!_0x195e26){throw new APINotFoundError(util[_0x5aab('0xb5')](_0x5aab('0xd5'),_0x5a79b5[_0x5aab('0x5e')]['id']));}return contacts[_0x5aab('0x66')]();})[_0x5aab('0x23')](function(_0x25e369){_0x5a79b5[_0x5aab('0x4e')]['User']=_0x5a79b5[_0x5aab('0x5e')]['id'];_0x5b01eb=qs[_0x5aab('0x4c')](_0x25e369,_0x5a79b5);if(_0x5a79b5[_0x5aab('0x4e')][_0x5aab('0xd6')](_0x5aab('0x5f'))){_0x5b01eb['include']=[{'model':db[_0x5aab('0xd7')],'as':'List','required':![]},{'model':db[_0x5aab('0xd8')],'as':_0x5aab('0xd9'),'attributes':['id',_0x5aab('0x3d'),_0x5aab('0xda')],'where':_0x5a79b5['query'][_0x5aab('0xdb')]?{'id':_0x5a79b5['query'][_0x5aab('0xdb')]}:undefined,'required':_0x5a79b5[_0x5aab('0x4e')]['tag']?!![]:![]}];}return contacts[_0x5aab('0x53')](_0x5a79b5[_0x5aab('0x4e')],_0x5a79b5[_0x5aab('0x33')],_0x5b01eb,_0x25e369);})[_0x5aab('0x23')](respondWithFilteredResult(_0x48eb8f,_0x5b01eb))[_0x5aab('0x2c')](APIHandleError(_0x48eb8f));};exports['getQueues']=function(_0x476cad,_0x5c2e7f){var _0x39a6a0;var _0x3ebd23={};var _0x4acb33;return db['User'][_0x5aab('0xa0')]({'where':{'id':_0x476cad[_0x5aab('0x5e')]['id']},'attributes':['id',_0x5aab('0x3d'),_0x5aab('0x2e')]})[_0x5aab('0x23')](handleEntityNotFound(_0x5c2e7f,null))[_0x5aab('0x23')](function(_0xc6bfad){if(!utils[_0x5aab('0xaa')](_0x476cad[_0x5aab('0x4e')][_0x5aab('0xa5')])){throw new db[(_0x5aab('0x99'))]['ValidationError']('Unknown\x20channel');}_0x39a6a0=_0xc6bfad;var _0x2faa38={};_0x2faa38['model']=_['keys'](db[_['capitalize'](_0x476cad[_0x5aab('0x4e')]['channel'])+'Queue']['rawAttributes']);_0x2faa38['query']=_[_0x5aab('0xdc')](_0x476cad[_0x5aab('0x4e')]);_0x2faa38[_0x5aab('0xdd')]=_[_0x5aab('0xde')](_0x2faa38[_0x5aab('0xdf')],_0x2faa38[_0x5aab('0x4e')]);_0x3ebd23['attributes']=_[_0x5aab('0xde')](_0x2faa38[_0x5aab('0xdf')],qs['fields'](_0x476cad[_0x5aab('0x4e')][_0x5aab('0xe0')]));_0x3ebd23[_0x5aab('0x51')]=_0x3ebd23[_0x5aab('0x51')][_0x5aab('0x57')]?_0x3ebd23[_0x5aab('0x51')]:_0x2faa38[_0x5aab('0xdf')];_0x3ebd23[_0x5aab('0xe1')]=qs[_0x5aab('0xe2')](_0x476cad[_0x5aab('0x4e')][_0x5aab('0xe2')]);_0x3ebd23[_0x5aab('0x4d')]=qs[_0x5aab('0xdd')](_[_0x5aab('0xe3')](_0x476cad['query'],_0x2faa38[_0x5aab('0xdd')]));if(_0x476cad[_0x5aab('0x4e')][_0x5aab('0x37')]){_0x3ebd23['where']=_[_0x5aab('0x61')](_0x3ebd23[_0x5aab('0x4d')],{'$or':_[_0x5aab('0x39')](_0x3ebd23['attributes'],function(_0x2393d0){var _0x5506a5={};_0x5506a5[_0x2393d0]={'$like':'%'+_0x476cad[_0x5aab('0x4e')][_0x5aab('0x37')]+'%'};return _0x5506a5;})});}_0x3ebd23=_[_0x5aab('0x61')]({},_0x3ebd23,_0x476cad[_0x5aab('0x62')]);switch(_0x39a6a0[_0x5aab('0x2e')]){case _0x5aab('0x31'):return db[_['capitalize'](_0x476cad[_0x5aab('0x4e')]['channel'])+_0x5aab('0xe4')][_0x5aab('0x53')](_0x3ebd23);case'user':case _0x5aab('0x34'):return _0x39a6a0['get'+_[_0x5aab('0xac')](_0x476cad[_0x5aab('0x4e')][_0x5aab('0xa5')])+_0x5aab('0xae')](_0x3ebd23);default:throw new db['Sequelize']['ValidationError']('Unknown\x20role');}})[_0x5aab('0x23')](function(_0xc5d724){_0x4acb33=_0xc5d724['length'];if(!_0x476cad[_0x5aab('0x4e')]['hasOwnProperty']('nolimit')){_0x3ebd23[_0x5aab('0x1d')]=qs[_0x5aab('0x1d')](_0x476cad[_0x5aab('0x4e')]['limit']);_0x3ebd23['offset']=qs[_0x5aab('0x1c')](_0x476cad[_0x5aab('0x4e')][_0x5aab('0x1c')]);}switch(_0x39a6a0[_0x5aab('0x2e')]){case _0x5aab('0x31'):return db[_[_0x5aab('0xac')](_0x476cad['query'][_0x5aab('0xa5')])+'Queue'][_0x5aab('0x53')](_0x3ebd23);case _0x5aab('0x33'):case _0x5aab('0x34'):return _0x39a6a0[_0x5aab('0x30')+_[_0x5aab('0xac')](_0x476cad[_0x5aab('0x4e')][_0x5aab('0xa5')])+_0x5aab('0xae')](_0x3ebd23);}})[_0x5aab('0x23')](function(_0x40d83d){return{'count':_0x4acb33,'rows':_0x40d83d};})['then'](respondWithResult(_0x5c2e7f,null))['catch'](handleError(_0x5c2e7f,null));};exports[_0x5aab('0xe5')]=function(_0x1457e4,_0x3e8c4f){var _0x173a0c={};var _0x46d17f={};var _0x510c5c;var _0x295a02;return db[_0x5aab('0x40')]['findOne']({'where':{'id':_0x1457e4[_0x5aab('0x5e')]['id']}})[_0x5aab('0x23')](handleEntityNotFound(_0x3e8c4f,null))[_0x5aab('0x23')](function(_0x43709c){if(_0x43709c){_0x510c5c=_0x43709c;_0x46d17f[_0x5aab('0xdf')]=_[_0x5aab('0xdc')](db[_0x5aab('0xb7')][_0x5aab('0x41')]);_0x46d17f['query']=_[_0x5aab('0xdc')](_0x1457e4[_0x5aab('0x4e')]);_0x46d17f[_0x5aab('0xdd')]=_[_0x5aab('0xde')](_0x46d17f[_0x5aab('0xdf')],_0x46d17f[_0x5aab('0x4e')]);_0x173a0c[_0x5aab('0x51')]=_[_0x5aab('0xde')](_0x46d17f[_0x5aab('0xdf')],qs[_0x5aab('0xe0')](_0x1457e4[_0x5aab('0x4e')][_0x5aab('0xe0')]));_0x173a0c['attributes']=_0x173a0c['attributes'][_0x5aab('0x57')]?_0x173a0c[_0x5aab('0x51')]:_0x46d17f[_0x5aab('0xdf')];_0x173a0c[_0x5aab('0xe1')]=qs['sort'](_0x1457e4[_0x5aab('0x4e')][_0x5aab('0xe2')]);_0x173a0c[_0x5aab('0x4d')]=qs['filters'](_[_0x5aab('0xe3')](_0x1457e4[_0x5aab('0x4e')],_0x46d17f[_0x5aab('0xdd')]));if(_0x1457e4[_0x5aab('0x4e')]['filter']){_0x173a0c[_0x5aab('0x4d')]=_[_0x5aab('0x61')](_0x173a0c[_0x5aab('0x4d')],{'$or':_[_0x5aab('0x39')](_0x173a0c[_0x5aab('0x51')],function(_0x561b89){var _0xb4b044={};_0xb4b044[_0x561b89]={'$like':'%'+_0x1457e4['query'][_0x5aab('0x37')]+'%'};return _0xb4b044;})});}_0x173a0c=_[_0x5aab('0x61')]({},_0x173a0c,_0x1457e4[_0x5aab('0x62')]);return _0x510c5c[_0x5aab('0xe5')](_0x173a0c);}})[_0x5aab('0x23')](function(_0x544652){if(_0x544652){_0x295a02=_0x544652[_0x5aab('0x57')];if(!_0x1457e4['query']['hasOwnProperty'](_0x5aab('0xe6'))){_0x173a0c[_0x5aab('0x1d')]=qs[_0x5aab('0x1d')](_0x1457e4[_0x5aab('0x4e')][_0x5aab('0x1d')]);_0x173a0c[_0x5aab('0x1c')]=qs[_0x5aab('0x1c')](_0x1457e4[_0x5aab('0x4e')]['offset']);}return _0x510c5c[_0x5aab('0xe5')](_0x173a0c);}})[_0x5aab('0x23')](function(_0x9dc0c0){if(_0x9dc0c0){return _0x9dc0c0?{'count':_0x295a02,'rows':_0x9dc0c0}:null;}})[_0x5aab('0x23')](respondWithResult(_0x3e8c4f,null))[_0x5aab('0x2c')](handleError(_0x3e8c4f,null));};exports[_0x5aab('0xe7')]=function(_0x79d90e,_0x4662a9){var _0x5e20ea={};var _0x4eeedb={};var _0x533324;var _0x6134c0;return db[_0x5aab('0x40')][_0x5aab('0xa0')]({'where':{'id':_0x79d90e['params']['id']}})['then'](handleEntityNotFound(_0x4662a9,null))['then'](function(_0x12adf1){if(_0x12adf1){_0x533324=_0x12adf1;_0x4eeedb['model']=_[_0x5aab('0xdc')](db[_0x5aab('0xe8')][_0x5aab('0x41')]);_0x4eeedb[_0x5aab('0x4e')]=_[_0x5aab('0xdc')](_0x79d90e[_0x5aab('0x4e')]);_0x4eeedb[_0x5aab('0xdd')]=_[_0x5aab('0xde')](_0x4eeedb[_0x5aab('0xdf')],_0x4eeedb['query']);_0x5e20ea[_0x5aab('0x51')]=_['intersection'](_0x4eeedb[_0x5aab('0xdf')],qs[_0x5aab('0xe0')](_0x79d90e[_0x5aab('0x4e')][_0x5aab('0xe0')]));_0x5e20ea[_0x5aab('0x51')]=_0x5e20ea[_0x5aab('0x51')][_0x5aab('0x57')]?_0x5e20ea[_0x5aab('0x51')]:_0x4eeedb[_0x5aab('0xdf')];_0x5e20ea[_0x5aab('0xe1')]=qs[_0x5aab('0xe2')](_0x79d90e[_0x5aab('0x4e')]['sort']);_0x5e20ea[_0x5aab('0x4d')]=qs['filters'](_['pick'](_0x79d90e[_0x5aab('0x4e')],_0x4eeedb['filters']));if(_0x79d90e[_0x5aab('0x4e')][_0x5aab('0x37')]){_0x5e20ea['where']=_['merge'](_0x5e20ea['where'],{'$or':_[_0x5aab('0x39')](_0x5e20ea['attributes'],function(_0x127c99){var _0x425fbc={};_0x425fbc[_0x127c99]={'$like':'%'+_0x79d90e[_0x5aab('0x4e')][_0x5aab('0x37')]+'%'};return _0x425fbc;})});}_0x5e20ea=_[_0x5aab('0x61')]({},_0x5e20ea,_0x79d90e[_0x5aab('0x62')]);return _0x533324[_0x5aab('0xe7')](_0x5e20ea);}})[_0x5aab('0x23')](function(_0x184e30){if(_0x184e30){_0x6134c0=_0x184e30['length'];if(!_0x79d90e['query'][_0x5aab('0xd6')](_0x5aab('0xe6'))){_0x5e20ea[_0x5aab('0x1d')]=qs[_0x5aab('0x1d')](_0x79d90e[_0x5aab('0x4e')][_0x5aab('0x1d')]);_0x5e20ea[_0x5aab('0x1c')]=qs[_0x5aab('0x1c')](_0x79d90e[_0x5aab('0x4e')][_0x5aab('0x1c')]);}return _0x533324[_0x5aab('0xe7')](_0x5e20ea);}})[_0x5aab('0x23')](function(_0x1f14ed){if(_0x1f14ed){return _0x1f14ed?{'count':_0x6134c0,'rows':_0x1f14ed}:null;}})[_0x5aab('0x23')](respondWithResult(_0x4662a9,null))[_0x5aab('0x2c')](handleError(_0x4662a9,null));};exports[_0x5aab('0xe9')]=function(_0x4cbbcd,_0x6fa260){var _0x16b087={'raw':!![],'where':{}};var _0x2fbfc={};var _0x30bb32={'count':0x0,'rows':[]};return db[_0x5aab('0x40')][_0x5aab('0xa0')]({'where':{'id':_0x4cbbcd[_0x5aab('0x5e')]['id']}})['then'](handleEntityNotFound(_0x6fa260,null))[_0x5aab('0x23')](function(_0x5c7c67){if(_0x5c7c67){_0x2fbfc[_0x5aab('0xdf')]=_[_0x5aab('0xdc')](db[_0x5aab('0xea')][_0x5aab('0x41')]);_0x2fbfc[_0x5aab('0x4e')]=_[_0x5aab('0xdc')](_0x4cbbcd[_0x5aab('0x4e')]);_0x2fbfc[_0x5aab('0xdd')]=_[_0x5aab('0xde')](_0x2fbfc[_0x5aab('0xdf')],_0x2fbfc[_0x5aab('0x4e')]);_0x16b087[_0x5aab('0x51')]=_['intersection'](_0x2fbfc[_0x5aab('0xdf')],qs[_0x5aab('0xe0')](_0x4cbbcd[_0x5aab('0x4e')][_0x5aab('0xe0')]));_0x16b087[_0x5aab('0x51')]=_0x16b087['attributes'][_0x5aab('0x57')]?_0x16b087[_0x5aab('0x51')]:_0x2fbfc['model'];if(!_0x4cbbcd['query'][_0x5aab('0xd6')](_0x5aab('0xe6'))){_0x16b087['limit']=qs['limit'](_0x4cbbcd['query'][_0x5aab('0x1d')]);_0x16b087[_0x5aab('0x1c')]=qs[_0x5aab('0x1c')](_0x4cbbcd[_0x5aab('0x4e')][_0x5aab('0x1c')]);}_0x16b087['order']=qs[_0x5aab('0xe2')](_0x4cbbcd[_0x5aab('0x4e')]['sort']);_0x16b087['where']=qs['filters'](_[_0x5aab('0xe3')](_0x4cbbcd[_0x5aab('0x4e')],_0x2fbfc[_0x5aab('0xdd')]));_0x16b087[_0x5aab('0x4d')]['UserId']=_0x5c7c67['id'];if(_0x4cbbcd[_0x5aab('0x4e')][_0x5aab('0x37')]){_0x16b087[_0x5aab('0x4d')]=_[_0x5aab('0x61')](_0x16b087[_0x5aab('0x4d')],{'$or':_[_0x5aab('0x39')](_0x16b087['attributes'],function(_0x4f6418){var _0x47ebcc={};_0x47ebcc[_0x4f6418]={'$like':'%'+_0x4cbbcd['query'][_0x5aab('0x37')]+'%'};return _0x47ebcc;})});}_0x16b087=_[_0x5aab('0x61')]({},_0x16b087,_0x4cbbcd[_0x5aab('0x62')]);return db[_0x5aab('0xea')][_0x5aab('0x1f')]({'where':_0x16b087[_0x5aab('0x4d')]})['then'](function(_0xac5de1){_0x30bb32[_0x5aab('0x1f')]=_0xac5de1;if(_0x4cbbcd['query']['includeAll']){_0x16b087[_0x5aab('0x4f')]=[{'all':!![]}];}return db[_0x5aab('0xea')][_0x5aab('0x53')](_0x16b087);})[_0x5aab('0x23')](function(_0x19d92c){_0x30bb32['rows']=_0x19d92c;return _0x30bb32;});}})['then'](respondWithFilteredResult(_0x6fa260,_0x16b087))[_0x5aab('0x2c')](handleError(_0x6fa260,null));};exports[_0x5aab('0xeb')]=function(_0x2d7f01,_0x476e31){var _0x1e9ec2={'raw':!![],'where':{}};var _0x27eaa7={};var _0x4a3dc8={'count':0x0,'rows':[]};return db['User'][_0x5aab('0xa0')]({'where':{'id':_0x2d7f01[_0x5aab('0x5e')]['id']}})[_0x5aab('0x23')](handleEntityNotFound(_0x476e31,null))[_0x5aab('0x23')](function(_0x247e69){if(_0x247e69){_0x27eaa7[_0x5aab('0xdf')]=_[_0x5aab('0xdc')](db[_0x5aab('0xec')][_0x5aab('0x41')]);_0x27eaa7[_0x5aab('0x4e')]=_[_0x5aab('0xdc')](_0x2d7f01[_0x5aab('0x4e')]);_0x27eaa7[_0x5aab('0xdd')]=_[_0x5aab('0xde')](_0x27eaa7[_0x5aab('0xdf')],_0x27eaa7[_0x5aab('0x4e')]);_0x1e9ec2[_0x5aab('0x51')]=_[_0x5aab('0xde')](_0x27eaa7[_0x5aab('0xdf')],qs[_0x5aab('0xe0')](_0x2d7f01[_0x5aab('0x4e')][_0x5aab('0xe0')]));_0x1e9ec2[_0x5aab('0x51')]=_0x1e9ec2['attributes'][_0x5aab('0x57')]?_0x1e9ec2[_0x5aab('0x51')]:_0x27eaa7[_0x5aab('0xdf')];if(!_0x2d7f01['query'][_0x5aab('0xd6')](_0x5aab('0xe6'))){_0x1e9ec2[_0x5aab('0x1d')]=qs[_0x5aab('0x1d')](_0x2d7f01[_0x5aab('0x4e')][_0x5aab('0x1d')]);_0x1e9ec2['offset']=qs['offset'](_0x2d7f01[_0x5aab('0x4e')][_0x5aab('0x1c')]);}_0x1e9ec2[_0x5aab('0xe1')]=qs['sort'](_0x2d7f01[_0x5aab('0x4e')]['sort']);_0x1e9ec2[_0x5aab('0x4d')]=qs[_0x5aab('0xdd')](_[_0x5aab('0xe3')](_0x2d7f01[_0x5aab('0x4e')],_0x27eaa7[_0x5aab('0xdd')]));_0x1e9ec2[_0x5aab('0x4d')][_0x5aab('0xed')]=_0x247e69['id'];if(_0x2d7f01[_0x5aab('0x4e')][_0x5aab('0x37')]){_0x1e9ec2['where']=_[_0x5aab('0x61')](_0x1e9ec2['where'],{'$or':_[_0x5aab('0x39')](_0x1e9ec2[_0x5aab('0x51')],function(_0x2827ea){var _0x3767b3={};_0x3767b3[_0x2827ea]={'$like':'%'+_0x2d7f01[_0x5aab('0x4e')][_0x5aab('0x37')]+'%'};return _0x3767b3;})});}_0x1e9ec2=_[_0x5aab('0x61')]({},_0x1e9ec2,_0x2d7f01[_0x5aab('0x62')]);return db[_0x5aab('0xec')]['count']({'where':_0x1e9ec2[_0x5aab('0x4d')]})['then'](function(_0x118a21){_0x4a3dc8['count']=_0x118a21;if(_0x2d7f01[_0x5aab('0x4e')][_0x5aab('0x5f')]){_0x1e9ec2['include']=[{'all':!![]}];}return db[_0x5aab('0xec')][_0x5aab('0x53')](_0x1e9ec2);})['then'](function(_0x38e06a){_0x4a3dc8[_0x5aab('0x54')]=_0x38e06a;return _0x4a3dc8;});}})[_0x5aab('0x23')](respondWithFilteredResult(_0x476e31,_0x1e9ec2))[_0x5aab('0x2c')](handleError(_0x476e31,null));};exports[_0x5aab('0xee')]=function(_0x201688,_0x3eecf8){var _0x39a65e={};var _0x3fa10e={};var _0x1e5b22;var _0x27c8c5;return db[_0x5aab('0x40')][_0x5aab('0xa0')]({'where':{'id':_0x201688[_0x5aab('0x5e')]['id']}})[_0x5aab('0x23')](handleEntityNotFound(_0x3eecf8,null))[_0x5aab('0x23')](function(_0x21d565){if(_0x21d565){_0x1e5b22=_0x21d565;_0x3fa10e['model']=_[_0x5aab('0xdc')](db[_0x5aab('0xef')]['rawAttributes']);_0x3fa10e['query']=_[_0x5aab('0xdc')](_0x201688[_0x5aab('0x4e')]);_0x3fa10e[_0x5aab('0xdd')]=_['intersection'](_0x3fa10e['model'],_0x3fa10e[_0x5aab('0x4e')]);_0x39a65e[_0x5aab('0x51')]=_[_0x5aab('0xde')](_0x3fa10e[_0x5aab('0xdf')],qs[_0x5aab('0xe0')](_0x201688[_0x5aab('0x4e')][_0x5aab('0xe0')]));_0x39a65e[_0x5aab('0x51')]=_0x39a65e[_0x5aab('0x51')][_0x5aab('0x57')]?_0x39a65e[_0x5aab('0x51')]:_0x3fa10e[_0x5aab('0xdf')];_0x39a65e[_0x5aab('0xe1')]=qs['sort'](_0x201688['query'][_0x5aab('0xe2')]);_0x39a65e[_0x5aab('0x4d')]=qs[_0x5aab('0xdd')](_[_0x5aab('0xe3')](_0x201688[_0x5aab('0x4e')],_0x3fa10e['filters']));if(_0x201688[_0x5aab('0x4e')]['filter']){_0x39a65e[_0x5aab('0x4d')]=_[_0x5aab('0x61')](_0x39a65e['where'],{'$or':_[_0x5aab('0x39')](_0x39a65e[_0x5aab('0x51')],function(_0x123eda){var _0x39d56c={};_0x39d56c[_0x123eda]={'$like':'%'+_0x201688[_0x5aab('0x4e')][_0x5aab('0x37')]+'%'};return _0x39d56c;})});}_0x39a65e=_['merge']({},_0x39a65e,_0x201688['options']);return _0x1e5b22[_0x5aab('0xee')](_0x39a65e);}})[_0x5aab('0x23')](function(_0x18c6a2){if(_0x18c6a2){_0x27c8c5=_0x18c6a2['length'];if(!_0x201688['query'][_0x5aab('0xd6')](_0x5aab('0xe6'))){_0x39a65e[_0x5aab('0x1d')]=qs[_0x5aab('0x1d')](_0x201688[_0x5aab('0x4e')][_0x5aab('0x1d')]);_0x39a65e[_0x5aab('0x1c')]=qs[_0x5aab('0x1c')](_0x201688['query'][_0x5aab('0x1c')]);}return _0x1e5b22[_0x5aab('0xee')](_0x39a65e);}})['then'](function(_0x277bfb){if(_0x277bfb){return _0x277bfb?{'count':_0x27c8c5,'rows':_0x277bfb}:null;}})[_0x5aab('0x23')](respondWithResult(_0x3eecf8,null))['catch'](handleError(_0x3eecf8,null));};exports['getOpenchannelInteractions']=function(_0xf6d08b,_0x553a2c){var _0x1dd59d={};var _0x4905d3={};var _0xf803d8;var _0x4695d7;return db[_0x5aab('0x40')][_0x5aab('0xa0')]({'where':{'id':_0xf6d08b[_0x5aab('0x5e')]['id']}})['then'](handleEntityNotFound(_0x553a2c,null))[_0x5aab('0x23')](function(_0x587506){if(_0x587506){_0xf803d8=_0x587506;_0x4905d3['model']=_[_0x5aab('0xdc')](db[_0x5aab('0xf0')][_0x5aab('0x41')]);_0x4905d3[_0x5aab('0x4e')]=_['keys'](_0xf6d08b['query']);_0x4905d3[_0x5aab('0xdd')]=_['intersection'](_0x4905d3[_0x5aab('0xdf')],_0x4905d3[_0x5aab('0x4e')]);_0x1dd59d[_0x5aab('0x51')]=_[_0x5aab('0xde')](_0x4905d3['model'],qs[_0x5aab('0xe0')](_0xf6d08b[_0x5aab('0x4e')]['fields']));_0x1dd59d[_0x5aab('0x51')]=_0x1dd59d[_0x5aab('0x51')]['length']?_0x1dd59d['attributes']:_0x4905d3[_0x5aab('0xdf')];_0x1dd59d[_0x5aab('0xe1')]=qs[_0x5aab('0xe2')](_0xf6d08b[_0x5aab('0x4e')][_0x5aab('0xe2')]);_0x1dd59d[_0x5aab('0x4d')]=qs[_0x5aab('0xdd')](_[_0x5aab('0xe3')](_0xf6d08b[_0x5aab('0x4e')],_0x4905d3['filters']));if(_0xf6d08b[_0x5aab('0x4e')][_0x5aab('0x37')]){_0x1dd59d['where']=_[_0x5aab('0x61')](_0x1dd59d[_0x5aab('0x4d')],{'$or':_[_0x5aab('0x39')](_0x1dd59d[_0x5aab('0x51')],function(_0x4339b9){var _0xc3cc={};_0xc3cc[_0x4339b9]={'$like':'%'+_0xf6d08b['query'][_0x5aab('0x37')]+'%'};return _0xc3cc;})});}_0x1dd59d=_[_0x5aab('0x61')]({},_0x1dd59d,_0xf6d08b[_0x5aab('0x62')]);return _0xf803d8['getOpenchannelInteractions'](_0x1dd59d);}})[_0x5aab('0x23')](function(_0x3aeea9){if(_0x3aeea9){_0x4695d7=_0x3aeea9['length'];if(!_0xf6d08b[_0x5aab('0x4e')]['hasOwnProperty'](_0x5aab('0xe6'))){_0x1dd59d[_0x5aab('0x1d')]=qs[_0x5aab('0x1d')](_0xf6d08b[_0x5aab('0x4e')][_0x5aab('0x1d')]);_0x1dd59d[_0x5aab('0x1c')]=qs[_0x5aab('0x1c')](_0xf6d08b[_0x5aab('0x4e')]['offset']);}return _0xf803d8[_0x5aab('0xf1')](_0x1dd59d);}})[_0x5aab('0x23')](function(_0x488b98){if(_0x488b98){return _0x488b98?{'count':_0x4695d7,'rows':_0x488b98}:null;}})[_0x5aab('0x23')](respondWithResult(_0x553a2c,null))[_0x5aab('0x2c')](handleError(_0x553a2c,null));};exports[_0x5aab('0xf2')]=function(_0x4968af,_0x17d645){var _0x3cd0e3={'raw':!![],'where':{}};var _0x459de6={};var _0xe70b29={'count':0x0,'rows':[]};return db[_0x5aab('0x40')][_0x5aab('0xa0')]({'where':{'id':_0x4968af[_0x5aab('0x5e')]['id']}})[_0x5aab('0x23')](handleEntityNotFound(_0x17d645,null))[_0x5aab('0x23')](function(_0x4fc9e8){if(_0x4fc9e8){_0x459de6['model']=_[_0x5aab('0xdc')](db['MailInteraction']['rawAttributes']);_0x459de6['query']=_['keys'](_0x4968af['query']);_0x459de6[_0x5aab('0xdd')]=_[_0x5aab('0xde')](_0x459de6['model'],_0x459de6['query']);_0x3cd0e3['attributes']=_[_0x5aab('0xde')](_0x459de6[_0x5aab('0xdf')],qs[_0x5aab('0xe0')](_0x4968af['query'][_0x5aab('0xe0')]));_0x3cd0e3[_0x5aab('0x51')]=_0x3cd0e3[_0x5aab('0x51')][_0x5aab('0x57')]?_0x3cd0e3[_0x5aab('0x51')]:_0x459de6['model'];if(!_0x4968af['query'][_0x5aab('0xd6')](_0x5aab('0xe6'))){_0x3cd0e3[_0x5aab('0x1d')]=qs['limit'](_0x4968af[_0x5aab('0x4e')][_0x5aab('0x1d')]);_0x3cd0e3[_0x5aab('0x1c')]=qs[_0x5aab('0x1c')](_0x4968af[_0x5aab('0x4e')][_0x5aab('0x1c')]);}_0x3cd0e3['order']=qs[_0x5aab('0xe2')](_0x4968af[_0x5aab('0x4e')][_0x5aab('0xe2')]);_0x3cd0e3[_0x5aab('0x4d')]=qs[_0x5aab('0xdd')](_[_0x5aab('0xe3')](_0x4968af['query'],_0x459de6['filters']));_0x3cd0e3[_0x5aab('0x4d')][_0x5aab('0xed')]=_0x4fc9e8['id'];if(_0x4968af[_0x5aab('0x4e')][_0x5aab('0x37')]){_0x3cd0e3[_0x5aab('0x4d')]=_[_0x5aab('0x61')](_0x3cd0e3[_0x5aab('0x4d')],{'$or':_[_0x5aab('0x39')](_0x3cd0e3[_0x5aab('0x51')],function(_0x1c8258){var _0x3e8f95={};_0x3e8f95[_0x1c8258]={'$like':'%'+_0x4968af['query'][_0x5aab('0x37')]+'%'};return _0x3e8f95;})});}_0x3cd0e3=_[_0x5aab('0x61')]({},_0x3cd0e3,_0x4968af[_0x5aab('0x62')]);return db[_0x5aab('0xf3')]['count']({'where':_0x3cd0e3['where']})['then'](function(_0x5cf89c){_0xe70b29['count']=_0x5cf89c;if(_0x4968af['query'][_0x5aab('0x5f')]){_0x3cd0e3[_0x5aab('0x4f')]=[{'all':!![]}];}return db[_0x5aab('0xf3')][_0x5aab('0x53')](_0x3cd0e3);})[_0x5aab('0x23')](function(_0x2129f6){_0xe70b29[_0x5aab('0x54')]=_0x2129f6;return _0xe70b29;});}})[_0x5aab('0x23')](respondWithFilteredResult(_0x17d645,_0x3cd0e3))[_0x5aab('0x2c')](handleError(_0x17d645,null));};exports['getSmsInteractions']=function(_0x25ed16,_0xbacb5){var _0x5f4ca5={};var _0x51432f={};var _0x4a485e;var _0x562d26;return db[_0x5aab('0x40')][_0x5aab('0xa0')]({'where':{'id':_0x25ed16[_0x5aab('0x5e')]['id']}})[_0x5aab('0x23')](handleEntityNotFound(_0xbacb5,null))[_0x5aab('0x23')](function(_0x378cff){if(_0x378cff){_0x4a485e=_0x378cff;_0x51432f[_0x5aab('0xdf')]=_[_0x5aab('0xdc')](db[_0x5aab('0xf4')][_0x5aab('0x41')]);_0x51432f[_0x5aab('0x4e')]=_[_0x5aab('0xdc')](_0x25ed16[_0x5aab('0x4e')]);_0x51432f[_0x5aab('0xdd')]=_[_0x5aab('0xde')](_0x51432f[_0x5aab('0xdf')],_0x51432f[_0x5aab('0x4e')]);_0x5f4ca5[_0x5aab('0x51')]=_[_0x5aab('0xde')](_0x51432f[_0x5aab('0xdf')],qs['fields'](_0x25ed16[_0x5aab('0x4e')][_0x5aab('0xe0')]));_0x5f4ca5['attributes']=_0x5f4ca5[_0x5aab('0x51')][_0x5aab('0x57')]?_0x5f4ca5['attributes']:_0x51432f[_0x5aab('0xdf')];_0x5f4ca5[_0x5aab('0xe1')]=qs[_0x5aab('0xe2')](_0x25ed16[_0x5aab('0x4e')][_0x5aab('0xe2')]);_0x5f4ca5['where']=qs[_0x5aab('0xdd')](_['pick'](_0x25ed16[_0x5aab('0x4e')],_0x51432f['filters']));if(_0x25ed16[_0x5aab('0x4e')][_0x5aab('0x37')]){_0x5f4ca5['where']=_[_0x5aab('0x61')](_0x5f4ca5[_0x5aab('0x4d')],{'$or':_[_0x5aab('0x39')](_0x5f4ca5[_0x5aab('0x51')],function(_0x4f93a9){var _0x3c4aba={};_0x3c4aba[_0x4f93a9]={'$like':'%'+_0x25ed16[_0x5aab('0x4e')]['filter']+'%'};return _0x3c4aba;})});}_0x5f4ca5=_[_0x5aab('0x61')]({},_0x5f4ca5,_0x25ed16[_0x5aab('0x62')]);return _0x4a485e['getSmsInteractions'](_0x5f4ca5);}})['then'](function(_0x244975){if(_0x244975){_0x562d26=_0x244975[_0x5aab('0x57')];if(!_0x25ed16[_0x5aab('0x4e')][_0x5aab('0xd6')]('nolimit')){_0x5f4ca5['limit']=qs[_0x5aab('0x1d')](_0x25ed16[_0x5aab('0x4e')]['limit']);_0x5f4ca5[_0x5aab('0x1c')]=qs[_0x5aab('0x1c')](_0x25ed16[_0x5aab('0x4e')]['offset']);}return _0x4a485e['getSmsInteractions'](_0x5f4ca5);}})[_0x5aab('0x23')](function(_0x417d6e){if(_0x417d6e){return _0x417d6e?{'count':_0x562d26,'rows':_0x417d6e}:null;}})[_0x5aab('0x23')](respondWithResult(_0xbacb5,null))['catch'](handleError(_0xbacb5,null));};exports['getFaxInteractions']=function(_0x42e07d,_0x514c5b){var _0x4515ee={};var _0x43e4de={};var _0x36644c;var _0x3261a1;return db[_0x5aab('0x40')][_0x5aab('0xa0')]({'where':{'id':_0x42e07d['params']['id']}})[_0x5aab('0x23')](handleEntityNotFound(_0x514c5b,null))[_0x5aab('0x23')](function(_0x159288){if(_0x159288){_0x36644c=_0x159288;_0x43e4de[_0x5aab('0xdf')]=_['keys'](db[_0x5aab('0xf5')][_0x5aab('0x41')]);_0x43e4de[_0x5aab('0x4e')]=_['keys'](_0x42e07d[_0x5aab('0x4e')]);_0x43e4de[_0x5aab('0xdd')]=_['intersection'](_0x43e4de['model'],_0x43e4de[_0x5aab('0x4e')]);_0x4515ee[_0x5aab('0x51')]=_['intersection'](_0x43e4de[_0x5aab('0xdf')],qs[_0x5aab('0xe0')](_0x42e07d[_0x5aab('0x4e')][_0x5aab('0xe0')]));_0x4515ee['attributes']=_0x4515ee[_0x5aab('0x51')][_0x5aab('0x57')]?_0x4515ee[_0x5aab('0x51')]:_0x43e4de[_0x5aab('0xdf')];_0x4515ee[_0x5aab('0xe1')]=qs['sort'](_0x42e07d['query']['sort']);_0x4515ee[_0x5aab('0x4d')]=qs[_0x5aab('0xdd')](_[_0x5aab('0xe3')](_0x42e07d['query'],_0x43e4de[_0x5aab('0xdd')]));if(_0x42e07d['query'][_0x5aab('0x37')]){_0x4515ee[_0x5aab('0x4d')]=_[_0x5aab('0x61')](_0x4515ee['where'],{'$or':_[_0x5aab('0x39')](_0x4515ee['attributes'],function(_0x3979b0){var _0x593fb9={};_0x593fb9[_0x3979b0]={'$like':'%'+_0x42e07d[_0x5aab('0x4e')]['filter']+'%'};return _0x593fb9;})});}_0x4515ee=_[_0x5aab('0x61')]({},_0x4515ee,_0x42e07d[_0x5aab('0x62')]);return _0x36644c[_0x5aab('0xf6')](_0x4515ee);}})[_0x5aab('0x23')](function(_0x2a384b){if(_0x2a384b){_0x3261a1=_0x2a384b[_0x5aab('0x57')];if(!_0x42e07d[_0x5aab('0x4e')][_0x5aab('0xd6')]('nolimit')){_0x4515ee['limit']=qs[_0x5aab('0x1d')](_0x42e07d[_0x5aab('0x4e')]['limit']);_0x4515ee[_0x5aab('0x1c')]=qs[_0x5aab('0x1c')](_0x42e07d[_0x5aab('0x4e')][_0x5aab('0x1c')]);}return _0x36644c[_0x5aab('0xf6')](_0x4515ee);}})['then'](function(_0x29fd1f){if(_0x29fd1f){return _0x29fd1f?{'count':_0x3261a1,'rows':_0x29fd1f}:null;}})['then'](respondWithResult(_0x514c5b,null))[_0x5aab('0x2c')](handleError(_0x514c5b,null));};exports[_0x5aab('0xf7')]=function(_0x13e074,_0x3d9fdc){var _0x519fd5={};var _0x272293={};var _0x1e39e1;var _0xddb5c7;return db[_0x5aab('0x40')][_0x5aab('0xa0')]({'where':{'id':_0x13e074[_0x5aab('0x5e')]['id']}})[_0x5aab('0x23')](handleEntityNotFound(_0x3d9fdc,null))[_0x5aab('0x23')](function(_0x28cffe){if(_0x28cffe){_0x1e39e1=_0x28cffe;_0x272293[_0x5aab('0xdf')]=_[_0x5aab('0xdc')](db['WhatsappInteraction'][_0x5aab('0x41')]);_0x272293['query']=_[_0x5aab('0xdc')](_0x13e074[_0x5aab('0x4e')]);_0x272293['filters']=_[_0x5aab('0xde')](_0x272293['model'],_0x272293[_0x5aab('0x4e')]);_0x519fd5[_0x5aab('0x51')]=_[_0x5aab('0xde')](_0x272293['model'],qs[_0x5aab('0xe0')](_0x13e074[_0x5aab('0x4e')][_0x5aab('0xe0')]));_0x519fd5[_0x5aab('0x51')]=_0x519fd5[_0x5aab('0x51')][_0x5aab('0x57')]?_0x519fd5['attributes']:_0x272293[_0x5aab('0xdf')];_0x519fd5[_0x5aab('0xe1')]=qs[_0x5aab('0xe2')](_0x13e074['query'][_0x5aab('0xe2')]);_0x519fd5['where']=qs[_0x5aab('0xdd')](_[_0x5aab('0xe3')](_0x13e074['query'],_0x272293[_0x5aab('0xdd')]));if(_0x13e074[_0x5aab('0x4e')][_0x5aab('0x37')]){_0x519fd5[_0x5aab('0x4d')]=_[_0x5aab('0x61')](_0x519fd5[_0x5aab('0x4d')],{'$or':_[_0x5aab('0x39')](_0x519fd5[_0x5aab('0x51')],function(_0x206aee){var _0x598d02={};_0x598d02[_0x206aee]={'$like':'%'+_0x13e074['query'][_0x5aab('0x37')]+'%'};return _0x598d02;})});}_0x519fd5=_['merge']({},_0x519fd5,_0x13e074['options']);return _0x1e39e1['getWhatsappInteractions'](_0x519fd5);}})[_0x5aab('0x23')](function(_0x18b01e){if(_0x18b01e){_0xddb5c7=_0x18b01e[_0x5aab('0x57')];if(!_0x13e074['query']['hasOwnProperty'](_0x5aab('0xe6'))){_0x519fd5[_0x5aab('0x1d')]=qs[_0x5aab('0x1d')](_0x13e074[_0x5aab('0x4e')]['limit']);_0x519fd5[_0x5aab('0x1c')]=qs[_0x5aab('0x1c')](_0x13e074['query']['offset']);}return _0x1e39e1[_0x5aab('0xf7')](_0x519fd5);}})['then'](function(_0x403e83){if(_0x403e83){return _0x403e83?{'count':_0xddb5c7,'rows':_0x403e83}:null;}})['then'](respondWithResult(_0x3d9fdc,null))['catch'](handleError(_0x3d9fdc,null));};exports[_0x5aab('0xf8')]=function(_0x594707,_0x47eff7,_0x3d8a94){var _0x12f99e;var _0x2674a8;var _0x92dd46;var _0x48d3f4=!_[_0x5aab('0x6f')](_0x594707[_0x5aab('0x5e')]['id'])?_0x594707['params']['id']:!_[_0x5aab('0x6f')](_0x594707[_0x5aab('0x33')]['id'])?_0x594707[_0x5aab('0x33')]['id']:null;return db[_0x5aab('0x40')]['find']({'where':{'id':_0x48d3f4,'role':{'$or':[_0x5aab('0x31'),_0x5aab('0x33'),_0x5aab('0x34')]}},'attributes':['id',_0x5aab('0x3d'),_0x5aab('0xf9'),'mobile',_0x5aab('0x2e'),_0x5aab('0x69'),'loginInPause']})['then'](function(_0x56c486){if(_0x56c486){if(_0x56c486['role']===_0x5aab('0x34')){_0x12f99e=_0x56c486;if(_0x594707[_0x5aab('0x65')][_0x5aab('0xa9')]){_0x92dd46=util['format'](_0x5aab('0xfa'),_0x12f99e[_0x594707[_0x5aab('0x65')]['interface']]);}else if(_0x594707[_0x5aab('0x65')][_0x5aab('0xfb')]){_0x92dd46=util['format']('SIP/%s',_0x594707['body']['intrf']);}else{_0x92dd46=util[_0x5aab('0xb5')](_0x5aab('0xb6'),_0x12f99e['name']);}socket['to'](util[_0x5aab('0xb5')](_0x5aab('0xfc'),_0x12f99e[_0x5aab('0x3d')]))[_0x5aab('0xbc')]('user:forcelogout',{'user':{'id':_0x12f99e['id'],'name':_0x12f99e[_0x5aab('0x3d')]},'ip':_0x594707['headers'][_0x5aab('0xfd')]||_0x594707[_0x5aab('0xfe')]['remoteAddress']||_0x594707[_0x5aab('0xff')]['remoteAddress']||_0x594707[_0x5aab('0xfe')][_0x5aab('0xff')][_0x5aab('0x100')]});return db[_0x5aab('0xb7')][_0x5aab('0x2f')]({'where':{'membername':_0x12f99e[_0x5aab('0x3d')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x5aab('0x9a'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0x12f99e){return _0x12f99e[_0x5aab('0x101')]({'raw':!![]});}})[_0x5aab('0x23')](function(_0x5ae723){if(_0x12f99e){if(_0x5ae723){_0x2674a8=_0x5ae723;if(_0x2674a8[_0x5aab('0x57')]){var _0x1ac567=_0x2674a8[_0x5aab('0x39')](function(_0x1e017c){var _0x237fe1={'membername':_0x12f99e[_0x5aab('0x3d')],'UserId':_0x12f99e['id'],'queue_name':_0x1e017c['name'],'VoiceQueueId':_0x1e017c['id'],'interface':_0x92dd46,'paused':_0x12f99e[_0x5aab('0xa7')]||![],'penalty':_0x1e017c[_0x5aab('0x102')]||0x0};return db[_0x5aab('0xb7')][_0x5aab('0xb8')](_0x237fe1);});return Promise[_0x5aab('0x64')](_0x1ac567);}}}})[_0x5aab('0x23')](function(){if(_0x12f99e){return db[_0x5aab('0x103')][_0x5aab('0x53')]({'where':{'membername':_0x12f99e['name'],'exitAt':null}});}})[_0x5aab('0x23')](function(_0x27b4d1){if(_0x12f99e){var _0x5361f3=[];_0x27b4d1['forEach'](function(_0x1ba4a7){_0x5361f3[_0x5aab('0x52')](_0x1ba4a7['update']({'exitAt':moment()[_0x5aab('0xb5')](_0x5aab('0x104'))}));});return Promise['all'](_0x5361f3);}})['then'](function(){if(_0x12f99e){var _0x2ddd3a=[];var _0x34e96c=[];var _0xbf7b09=utils[_0x5aab('0x105')]();var _0xf5a219={'membername':_0x12f99e[_0x5aab('0x3d')],'interface':_0x92dd46,'enterAt':moment()[_0x5aab('0xb5')](_0x5aab('0x104')),'role':_0x12f99e['role'],'internal':_0x12f99e[_0x5aab('0x69')]};_0xbf7b09['forEach'](function(_0x15b0e7){_0x2ddd3a[_0x5aab('0x52')](_[_0x5aab('0x61')]({'channel':_0x15b0e7,'type':'LOGIN','data1':_0x594707[_0x5aab('0x65')][_0x5aab('0x106')],'data2':_0x92dd46},_0xf5a219));if(_0x12f99e[_0x5aab('0xa7')]){_0x34e96c['push'](_[_0x5aab('0x61')]({'channel':_0x15b0e7,'type':'PAUSE','data1':_0x5aab('0x107')},_0xf5a219));}});return db[_0x5aab('0x103')][_0x5aab('0x108')](_0x2ddd3a[_0x5aab('0xd3')](_0x34e96c),{'individualHooks':!![]});}})[_0x5aab('0x23')](function(){if(_0x12f99e){return _0x12f99e[_0x5aab('0x2d')]({'online':!![],'lastLoginAt':moment()[_0x5aab('0xb5')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x12f99e[_0x5aab('0xa7')]||![],'mailPause':_0x12f99e['loginInPause']||![],'chatPause':_0x12f99e[_0x5aab('0xa7')]||![],'faxPause':_0x12f99e[_0x5aab('0xa7')]||![],'smsPause':_0x12f99e[_0x5aab('0xa7')]||![],'openchannelPause':_0x12f99e['loginInPause']||![],'whatsappPause':_0x12f99e['loginInPause']||![],'pauseType':_0x12f99e['loginInPause']?_0x5aab('0x107'):null,'interface':_0x92dd46,'lastPauseAt':moment()[_0x5aab('0xb5')](_0x5aab('0x104'))});}})[_0x5aab('0x23')](function(_0xb08b2){if(_0x594707[_0x5aab('0x109')]){return _0x3d8a94();}else{return Promise[_0x5aab('0x10a')](_0xb08b2)[_0x5aab('0x23')](respondWithResult(_0x47eff7,null));}})[_0x5aab('0x2c')](handleError(_0x47eff7,null));};exports['logout']=function(_0xf16f1b,_0x57c863){var _0x51c37a;return db[_0x5aab('0x40')][_0x5aab('0x3c')]({'where':{'id':_0xf16f1b['params']['id'],'role':'agent'},'attributes':['id',_0x5aab('0x3d'),_0x5aab('0x2e')]})[_0x5aab('0x23')](handleEntityNotFound(_0x57c863,null))['then'](function(_0x1f1a39){if(_0x1f1a39){_0x51c37a=_0x1f1a39;return db[_0x5aab('0xb7')][_0x5aab('0x2f')]({'where':{'membername':_0x51c37a[_0x5aab('0x3d')]},'individualHooks':!![]});}})[_0x5aab('0x23')](function(){return db[_0x5aab('0x103')][_0x5aab('0x53')]({'where':{'membername':_0x51c37a['name'],'exitAt':null}});})[_0x5aab('0x23')](function(_0x480bc1){var _0x30a246=[];_0x480bc1[_0x5aab('0x10b')](function(_0x5ee500){_0x30a246[_0x5aab('0x52')](_0x5ee500[_0x5aab('0x2d')]({'exitAt':moment()[_0x5aab('0xb5')](_0x5aab('0x104'))}));});return Promise[_0x5aab('0x64')](_0x30a246);})['then'](function(){return _0x51c37a['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x5aab('0x23')](respondWithResult(_0x57c863,null))[_0x5aab('0x2c')](handleError(_0x57c863,null));};exports[_0x5aab('0x10c')]=function(_0x8e2f7f,_0x7ff268){var _0xe165c3;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x8e2f7f[_0x5aab('0x5e')]['id']},'individualHooks':!![]})['then'](function(){return db['User']['find']({'where':{'id':_0x8e2f7f[_0x5aab('0x5e')]['id'],'role':'agent'},'attributes':['id','name',_0x5aab('0x2e'),_0x5aab('0x69'),_0x5aab('0xa9'),_0x5aab('0xa6')]});})[_0x5aab('0x23')](handleEntityNotFound(_0x7ff268,null))[_0x5aab('0x23')](function(_0x616f32){if(_0x616f32){_0xe165c3=_0x616f32;return respondWithRpcPromise('QueuePause',_0x5aab('0x10c'),{'id':_0xe165c3['id'],'name':_0xe165c3[_0x5aab('0x3d')],'pause':!![]});}})[_0x5aab('0x23')](function(){if(_0xe165c3){return db[_0x5aab('0x103')][_0x5aab('0x53')]({'where':{'membername':_0xe165c3[_0x5aab('0x3d')],'type':_0x5aab('0x10d'),'exitAt':null}});}})[_0x5aab('0x23')](function(_0x1cd7db){if(_0x1cd7db[_0x5aab('0x57')]){var _0x338591=moment()[_0x5aab('0xb5')](_0x5aab('0x104'));for(var _0x16b865=0x0,_0x2672e4=_0x1cd7db['length'];_0x16b865<_0x2672e4;_0x16b865++){_0x1cd7db[_0x16b865][_0x5aab('0x10e')]({'exitAt':_0x338591});}}})[_0x5aab('0x23')](function(){var _0x4a5a75=[];var _0x240a5d=utils[_0x5aab('0x105')]();_0x240a5d[_0x5aab('0x10b')](function(_0x25c80a){_0x4a5a75['push']({'channel':_0x25c80a,'membername':_0xe165c3[_0x5aab('0x3d')],'interface':_[_0x5aab('0x6f')](_0xe165c3[_0x5aab('0xa9')])?util[_0x5aab('0xb5')](_0x5aab('0xb6'),_0xe165c3[_0x5aab('0x3d')]):_0xe165c3[_0x5aab('0xa9')],'type':_0x5aab('0x10d'),'enterAt':moment()[_0x5aab('0xb5')](_0x5aab('0x104')),'data1':_0x8e2f7f[_0x5aab('0x65')][_0x5aab('0x43')]||_0x5aab('0x10f'),'role':_0xe165c3['role'],'internal':_0xe165c3[_0x5aab('0x69')]});});return db[_0x5aab('0x103')][_0x5aab('0x108')](_0x4a5a75,{'individualHooks':!![]});})[_0x5aab('0x23')](function(){return _0xe165c3[_0x5aab('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x8e2f7f[_0x5aab('0x65')]['type']||_0x5aab('0x10f'),'lastPauseAt':moment()[_0x5aab('0xb5')](_0x5aab('0x104'))});})[_0x5aab('0x23')](respondWithResult(_0x7ff268,null))[_0x5aab('0x2c')](handleError(_0x7ff268,null));};exports['unpause']=function(_0x56829c,_0x15947a){if(_0x56829c[_0x5aab('0x65')][_0x5aab('0xa5')]&&!utils[_0x5aab('0xaa')](_0x56829c[_0x5aab('0x65')]['channel'])){throw new APIBadRequestError(util[_0x5aab('0xb5')](_0x5aab('0x110'),_0x56829c[_0x5aab('0x65')][_0x5aab('0xa5')]));}return db[_0x5aab('0x40')][_0x5aab('0x3c')]({'where':{'id':_0x56829c['params']['id']},'attributes':['id',_0x5aab('0x3d'),_0x5aab('0x2e'),_0x5aab('0x69'),_0x5aab('0xa9'),_0x5aab('0xa6'),_0x5aab('0xa8'),_0x5aab('0x111'),'chatPause',_0x5aab('0x112'),_0x5aab('0x113'),'smsPause',_0x5aab('0x114'),_0x5aab('0x115'),_0x5aab('0x116')]})['then'](function(_0x26c912){if(!_0x26c912){throw new APINotFoundError(util[_0x5aab('0xb5')](_0x5aab('0xd5'),_0x56829c['params']['id']));}return _0x26c912['unpause'](_0x56829c[_0x5aab('0x65')][_0x5aab('0xa5')]);})[_0x5aab('0x23')](respondWithResult(_0x15947a,null))[_0x5aab('0x2c')](APIHandleError(_0x15947a));};exports['getTeams']=function(_0x5a8d66,_0x1387b7){var _0x59e8c7={};var _0x14e968={};var _0x478cc9;var _0xea34ff;return db[_0x5aab('0x40')][_0x5aab('0xa0')]({'where':{'id':_0x5a8d66[_0x5aab('0x5e')]['id']}})[_0x5aab('0x23')](handleEntityNotFound(_0x1387b7,null))['then'](function(_0x9d9d28){if(_0x9d9d28){_0x478cc9=_0x9d9d28;_0x14e968[_0x5aab('0xdf')]=_['keys'](db[_0x5aab('0x117')][_0x5aab('0x41')]);_0x14e968['query']=_[_0x5aab('0xdc')](_0x5a8d66[_0x5aab('0x4e')]);_0x14e968[_0x5aab('0xdd')]=_[_0x5aab('0xde')](_0x14e968[_0x5aab('0xdf')],_0x14e968['query']);_0x59e8c7[_0x5aab('0x51')]=_[_0x5aab('0xde')](_0x14e968['model'],qs['fields'](_0x5a8d66[_0x5aab('0x4e')][_0x5aab('0xe0')]));_0x59e8c7[_0x5aab('0x51')]=_0x59e8c7['attributes'][_0x5aab('0x57')]?_0x59e8c7[_0x5aab('0x51')]:_0x14e968['model'];_0x59e8c7[_0x5aab('0xe1')]=qs[_0x5aab('0xe2')](_0x5a8d66[_0x5aab('0x4e')][_0x5aab('0xe2')]);_0x59e8c7['where']=qs[_0x5aab('0xdd')](_[_0x5aab('0xe3')](_0x5a8d66[_0x5aab('0x4e')],_0x14e968[_0x5aab('0xdd')]));if(_0x5a8d66[_0x5aab('0x4e')][_0x5aab('0x37')]){_0x59e8c7[_0x5aab('0x4d')]=_['merge'](_0x59e8c7[_0x5aab('0x4d')],{'$or':_[_0x5aab('0x39')](_0x59e8c7[_0x5aab('0x51')],function(_0x194d08){var _0x28aa91={};_0x28aa91[_0x194d08]={'$like':'%'+_0x5a8d66['query']['filter']+'%'};return _0x28aa91;})});}_0x59e8c7=_[_0x5aab('0x61')]({},_0x59e8c7,_0x5a8d66[_0x5aab('0x62')]);return _0x478cc9['getTeams'](_0x59e8c7);}})['then'](function(_0x5941b3){if(_0x5941b3){_0xea34ff=_0x5941b3[_0x5aab('0x57')];if(!_0x5a8d66[_0x5aab('0x4e')][_0x5aab('0xd6')]('nolimit')){_0x59e8c7[_0x5aab('0x1d')]=qs[_0x5aab('0x1d')](_0x5a8d66[_0x5aab('0x4e')]['limit']);_0x59e8c7[_0x5aab('0x1c')]=qs[_0x5aab('0x1c')](_0x5a8d66[_0x5aab('0x4e')][_0x5aab('0x1c')]);}return _0x478cc9[_0x5aab('0x118')](_0x59e8c7);}})[_0x5aab('0x23')](function(_0x5f2770){if(_0x5f2770){return _0x5f2770?{'count':_0xea34ff,'rows':_0x5f2770}:null;}})['then'](respondWithResult(_0x1387b7,null))[_0x5aab('0x2c')](handleError(_0x1387b7,null));};exports[_0x5aab('0x119')]=function(_0x146483,_0x1db317){var _0x224858=_0x146483[_0x5aab('0x5e')]['id'];var _0x2b0ef8=_0x146483[_0x5aab('0x65')]?_0x146483[_0x5aab('0x65')][_0x5aab('0x68')]:null;var _0x599ade=[];return Promise[_0x5aab('0x10a')]()[_0x5aab('0x23')](function(){if(!_0x2b0ef8)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db['User'][_0x5aab('0xa0')]({'where':{'id':_0x224858}});})['then'](function(_0x426b6a){if(!_0x426b6a)throw new APINotFoundError(util['format'](_0x5aab('0xd5'),_0x146483['params']['id']));return db[_0x5aab('0x71')][_0x5aab('0x11a')](function(_0x3a61d2){return _0x426b6a['addTeams'](_0x2b0ef8,{'transaction':_0x3a61d2})[_0x5aab('0x23')](function(){return db['Team']['findAll']({'where':{'id':{'$in':_0x2b0ef8}}});})['then'](function(_0x23414f){var _0x25669e=_[_0x5aab('0x39')](_0x23414f,function(_0x576ac0){return _0x576ac0[_0x5aab('0x11b')]();});return Promise[_0x5aab('0x64')](_0x25669e);})[_0x5aab('0x23')](function(_0x591acc){_0x599ade=_[_0x5aab('0x11c')](_0x591acc);var _0x2dd577=_[_0x5aab('0x39')](_0x599ade,function(_0x5e138f){return _0x5e138f[_0x5aab('0x11d')](_0x426b6a['id'],{'transaction':_0x3a61d2});});return Promise[_0x5aab('0x64')](_0x2dd577);})[_0x5aab('0x23')](function(){if(!_0x426b6a['online'])return;var _0x4f496d=_['filter'](_0x599ade,function(_0x3eb4e1){return _0x3eb4e1[_0x5aab('0x11e')](_0x5aab('0xa5'))==='Voice';});var _0x31991f=_[_0x5aab('0x39')](_0x4f496d,function(_0x370754){return db[_0x5aab('0xb7')][_0x5aab('0xb8')]({'membername':_0x426b6a[_0x5aab('0x3d')],'UserId':_0x426b6a['id'],'queue_name':_0x370754['name'],'VoiceQueueId':_0x370754['id'],'interface':_[_0x5aab('0x6f')](_0x426b6a['interface'])?util[_0x5aab('0xb5')](_0x5aab('0xb6'),_0x426b6a['name']):_0x426b6a[_0x5aab('0xa9')],'paused':_0x426b6a[_0x5aab('0xa8')]||![],'penalty':_0x426b6a[_0x5aab('0xaf')]},{'transaction':_0x3a61d2});});return Promise['all'](_0x31991f);})[_0x5aab('0x23')](function(){return db['TeamVoicePrefix'][_0x5aab('0x53')]({'where':{'teamId':{'$in':_0x2b0ef8}}});})[_0x5aab('0x23')](function(_0x774fb2){var _0x1b981a=_[_0x5aab('0x39')](_0x774fb2,function(_0x51903c){return db[_0x5aab('0x11f')][_0x5aab('0x8d')]({'UserId':_0x426b6a['id'],'VoicePrefixId':_0x51903c[_0x5aab('0x120')]},{'transaction':_0x3a61d2});});return Promise[_0x5aab('0x64')](_0x1b981a);});});})[_0x5aab('0x23')](function(){for(var _0x3a3bf8=0x0;_0x3a3bf8<_0x599ade[_0x5aab('0x57')];_0x3a3bf8++){var _0x10ee7d=_0x599ade[_0x3a3bf8]['getDataValue']('channel');var _0x57afdc=_0x10ee7d+_0x5aab('0xb1');socket['emit']('user'+_0x10ee7d+_0x5aab('0xb2'),{'UserId':_0x224858,['queueField']:_0x599ade[_0x3a3bf8]['id']});}})[_0x5aab('0x23')](respondWithStatusCode(_0x1db317,null))[_0x5aab('0x2c')](APIHandleError(_0x1db317));};exports[_0x5aab('0x121')]=function(_0x3b4785,_0x226cbd){var _0x32531f=_0x3b4785['params']['id'];var _0x47d6bf=null;if(_0x3b4785[_0x5aab('0x4e')][_0x5aab('0x68')]){_0x47d6bf=_[_0x5aab('0xbb')](_0x3b4785[_0x5aab('0x4e')][_0x5aab('0x68')])?_0x3b4785['query'][_0x5aab('0x68')]:[_0x3b4785[_0x5aab('0x4e')][_0x5aab('0x68')]];}var _0x13ba8b=[];return Promise['resolve']()[_0x5aab('0x23')](function(){if(!_0x47d6bf)throw new APIBadRequestError(_0x5aab('0x122'));})[_0x5aab('0x23')](function(){return db[_0x5aab('0x40')]['findOne']({'where':{'id':_0x32531f}});})[_0x5aab('0x23')](function(_0x483e64){if(!_0x483e64)throw new APINotFoundError(util[_0x5aab('0xb5')](_0x5aab('0xd5'),_0x3b4785[_0x5aab('0x5e')]['id']));return db[_0x5aab('0x71')]['transaction'](function(_0x384056){return _0x483e64[_0x5aab('0x121')](_0x47d6bf,{'transaction':_0x384056})[_0x5aab('0x23')](function(){return db['Team']['findAll']({'where':{'id':{'$in':_0x47d6bf}}});})[_0x5aab('0x23')](function(_0x24ad94){var _0x26d59d=_[_0x5aab('0x39')](_0x24ad94,function(_0x262be1){return _0x262be1[_0x5aab('0x11b')]();});return Promise[_0x5aab('0x64')](_0x26d59d);})[_0x5aab('0x23')](function(_0x95ba24){_0x13ba8b=_[_0x5aab('0x11c')](_0x95ba24);var _0x3c9371=_[_0x5aab('0x39')](_0x13ba8b,function(_0x15fed7){return _0x15fed7['removeAgent'](_0x483e64['id'],{'transaction':_0x384056});});return Promise['all'](_0x3c9371);})[_0x5aab('0x23')](function(){if(!_0x483e64[_0x5aab('0xa6')])return;var _0x5c0ac3=_['filter'](_0x13ba8b,function(_0x5f232f){return _0x5f232f['getDataValue'](_0x5aab('0xa5'))===_0x5aab('0x123');});var _0x55d7d0=_[_0x5aab('0x39')](_0x5c0ac3,function(_0x212ba4){return db[_0x5aab('0xb7')]['destroy']({'where':{'VoiceQueueId':_0x212ba4['id'],'UserId':_0x483e64['id']},'transaction':_0x384056});});return Promise[_0x5aab('0x64')](_0x55d7d0);})[_0x5aab('0x23')](function(){return db['TeamVoicePrefix'][_0x5aab('0x53')]({'where':{'teamId':{'$in':_0x47d6bf}}});})[_0x5aab('0x23')](function(_0x35fc6f){var _0x471721=_['map'](_0x35fc6f,function(_0x3dd953){return db[_0x5aab('0x11f')]['destroy']({'where':{'UserId':_0x483e64['id'],'VoicePrefixId':_0x3dd953[_0x5aab('0x120')]}},{'transaction':_0x384056});});return Promise[_0x5aab('0x64')](_0x471721);});});})[_0x5aab('0x23')](function(){for(var _0x40c3f4=0x0;_0x40c3f4<_0x13ba8b[_0x5aab('0x57')];_0x40c3f4++){var _0x1b0baa=_0x13ba8b[_0x40c3f4]['getDataValue'](_0x5aab('0xa5'));var _0x336553=_0x1b0baa+_0x5aab('0xb1');socket[_0x5aab('0xbc')](_0x5aab('0x33')+_0x1b0baa+_0x5aab('0xbd'),{'UserId':_0x32531f,['queueField']:_0x13ba8b[_0x40c3f4]['id']});}})[_0x5aab('0x23')](respondWithStatusCode(_0x226cbd,null))['catch'](APIHandleError(_0x226cbd));};exports[_0x5aab('0x124')]=function(_0x278e16,_0x427cf3){var _0x302f1a={};var _0x321182={};var _0x3454a2;var _0x4d028b;return db[_0x5aab('0x40')][_0x5aab('0xa0')]({'where':{'id':_0x278e16[_0x5aab('0x5e')]['id']}})[_0x5aab('0x23')](handleEntityNotFound(_0x427cf3,null))[_0x5aab('0x23')](function(_0x1d8298){if(_0x1d8298){_0x3454a2=_0x1d8298;_0x321182['model']=_[_0x5aab('0xdc')](db['CmList']['rawAttributes']);_0x321182[_0x5aab('0x4e')]=_[_0x5aab('0xdc')](_0x278e16[_0x5aab('0x4e')]);_0x321182[_0x5aab('0xdd')]=_[_0x5aab('0xde')](_0x321182['model'],_0x321182[_0x5aab('0x4e')]);_0x302f1a['attributes']=_['intersection'](_0x321182['model'],qs[_0x5aab('0xe0')](_0x278e16[_0x5aab('0x4e')][_0x5aab('0xe0')]));_0x302f1a[_0x5aab('0x51')]=_0x302f1a[_0x5aab('0x51')]['length']?_0x302f1a['attributes']:_0x321182[_0x5aab('0xdf')];_0x302f1a[_0x5aab('0xe1')]=qs[_0x5aab('0xe2')](_0x278e16[_0x5aab('0x4e')]['sort']);_0x302f1a[_0x5aab('0x4d')]=qs[_0x5aab('0xdd')](_[_0x5aab('0xe3')](_0x278e16[_0x5aab('0x4e')],_0x321182[_0x5aab('0xdd')]));if(_0x278e16[_0x5aab('0x4e')][_0x5aab('0x37')]){_0x302f1a[_0x5aab('0x4d')]=_[_0x5aab('0x61')](_0x302f1a['where'],{'$or':_['map'](_0x302f1a[_0x5aab('0x51')],function(_0xa8db33){var _0x3af418={};_0x3af418[_0xa8db33]={'$like':'%'+_0x278e16[_0x5aab('0x4e')][_0x5aab('0x37')]+'%'};return _0x3af418;})});}_0x302f1a=_[_0x5aab('0x61')]({},_0x302f1a,_0x278e16[_0x5aab('0x62')]);return _0x3454a2[_0x5aab('0x124')](_0x302f1a);}})[_0x5aab('0x23')](function(_0x31020f){if(_0x31020f){_0x4d028b=_0x31020f['length'];if(!_0x278e16[_0x5aab('0x4e')][_0x5aab('0xd6')](_0x5aab('0xe6'))){_0x302f1a[_0x5aab('0x1d')]=qs[_0x5aab('0x1d')](_0x278e16[_0x5aab('0x4e')][_0x5aab('0x1d')]);_0x302f1a['offset']=qs['offset'](_0x278e16[_0x5aab('0x4e')][_0x5aab('0x1c')]);}return _0x3454a2[_0x5aab('0x124')](_0x302f1a);}})[_0x5aab('0x23')](function(_0xf62b75){if(_0xf62b75){return _0xf62b75?{'count':_0x4d028b,'rows':_0xf62b75}:null;}})[_0x5aab('0x23')](respondWithResult(_0x427cf3,null))[_0x5aab('0x2c')](handleError(_0x427cf3,null));};exports[_0x5aab('0x125')]=function(_0xfb69ad,_0x35e771){var _0x5d0988={};var _0x4a47f6={};var _0x3b1a19;return db[_0x5aab('0x40')][_0x5aab('0xa0')]({'where':{'id':_0xfb69ad[_0x5aab('0x5e')]['id']}})[_0x5aab('0x23')](handleEntityNotFound(_0x35e771,null))[_0x5aab('0x23')](function(_0x2a8ca1){if(_0x2a8ca1){_0x3b1a19=_0x2a8ca1;_0x4a47f6['model']=_['keys'](db['User'][_0x5aab('0x41')]);_0x4a47f6[_0x5aab('0x4e')]=_[_0x5aab('0xdc')](_0xfb69ad['query']);_0x4a47f6['filters']=_['intersection'](_0x4a47f6[_0x5aab('0xdf')],_0x4a47f6['query']);_0x5d0988['attributes']=_[_0x5aab('0xde')](_0x4a47f6['model'],qs[_0x5aab('0xe0')](_0xfb69ad[_0x5aab('0x4e')][_0x5aab('0xe0')]));_0x5d0988[_0x5aab('0x51')]=_0x5d0988[_0x5aab('0x51')][_0x5aab('0x57')]?_0x5d0988[_0x5aab('0x51')]:_0x4a47f6[_0x5aab('0xdf')];_0x5d0988[_0x5aab('0xe1')]=qs[_0x5aab('0xe2')](_0xfb69ad['query'][_0x5aab('0xe2')]);_0x5d0988[_0x5aab('0x4d')]=qs[_0x5aab('0xdd')](_[_0x5aab('0xe3')](_0xfb69ad[_0x5aab('0x4e')],_0x4a47f6[_0x5aab('0xdd')]));if(_0xfb69ad['query'][_0x5aab('0x37')]){_0x5d0988[_0x5aab('0x4d')]=_['merge'](_0x5d0988['where'],{'$or':_[_0x5aab('0x39')](_0x5d0988[_0x5aab('0x51')],function(_0x480a40){var _0x30523a={};_0x30523a[_0x480a40]={'$like':'%'+_0xfb69ad[_0x5aab('0x4e')][_0x5aab('0x37')]+'%'};return _0x30523a;})});}_0x5d0988['model']=db[_0x5aab('0x40')];_0x5d0988['as']='Agents';_0x5d0988=_[_0x5aab('0x61')]({},_0x5d0988,_0xfb69ad[_0x5aab('0x62')]);return _0x3b1a19[_0x5aab('0x101')]({'include':[_0x5d0988]});}})[_0x5aab('0x23')](function(_0x1d97a9){if(_0x1d97a9){var _0x503fbf={},_0x333f65=[];for(var _0x5b960e=0x0;_0x5b960e<_0x1d97a9[_0x5aab('0x57')];_0x5b960e+=0x1){for(var _0x50ad07=0x0,_0x2bf96b;_0x50ad07<_0x1d97a9[_0x5b960e][_0x5aab('0x93')][_0x5aab('0x57')];_0x50ad07+=0x1){_0x2bf96b=_0x1d97a9[_0x5b960e][_0x5aab('0x93')][_0x50ad07][_0x5aab('0x30')]({'plain':!![]});_0x503fbf[_0x2bf96b['id']]=_0x2bf96b;}}_0x503fbf=_['values'](_0x503fbf);for(var _0x4a46e5=qs[_0x5aab('0x1c')](_0xfb69ad[_0x5aab('0x4e')][_0x5aab('0x1c')]);_0x4a46e5<_0x503fbf[_0x5aab('0x57')]&&_0x333f65[_0x5aab('0x57')]=_0x510b7a[_0x8564('0x4f')]){throw new Error(_0x8564('0x50'));}})[_0x8564('0x1f')](function(){if(_0x3f4996){return db[_0x8564('0x45')][_0x8564('0x51')]({'where':{'membername':_0x3f4996[_0x8564('0x23')]},'individualHooks':!![]});}})[_0x8564('0x1f')](function(){if(_0x3f4996){return _0x3f4996[_0x8564('0x52')]({'raw':!![]});}})[_0x8564('0x1f')](function(_0x14534f){if(_0x3f4996){if(_0x14534f){var _0x5dbaf8=[];_0x26924a=_0x14534f;if(_0x26924a['length']){for(var _0x4e07df=0x0;_0x4e07df<_0x26924a['length'];_0x4e07df++){_0x5dbaf8[_0x8564('0x2f')](db[_0x8564('0x45')][_0x8564('0x53')]({'membername':_0x3f4996[_0x8564('0x23')],'UserId':_0x3f4996['id'],'queue_name':_0x26924a[_0x4e07df][_0x8564('0x23')],'VoiceQueueId':_0x26924a[_0x4e07df]['id'],'interface':_0x1f7990,'paused':_0x3f4996[_0x8564('0x4a')]||![],'penalty':_0x26924a[_0x4e07df][_0x8564('0x54')]||0x0}));}return BPromise[_0x8564('0x47')](_0x5dbaf8);}}}})[_0x8564('0x1f')](function(){if(_0x3f4996){return db[_0x8564('0x29')][_0x8564('0x10')]({'where':{'membername':_0x3f4996[_0x8564('0x23')],'exitAt':null}});}})[_0x8564('0x1f')](function(_0x2c4871){if(_0x3f4996){if(_0x2c4871&&_0x2c4871[_0x8564('0x2c')]){var _0x15401b=[];_0x2c4871['forEach'](function(_0x229bc9){_0x15401b[_0x8564('0x2f')](_0x229bc9[_0x8564('0x28')]({'exitAt':moment()[_0x8564('0x26')](_0x8564('0x2b'))}));});return BPromise['all'](_0x15401b);}}})[_0x8564('0x1f')](function(){if(_0x3f4996){var _0x380293=[];var _0x5164d0=[];var _0x3ef2fe=utils[_0x8564('0x2e')]();var _0x4dd7b7={'membername':_0x3f4996[_0x8564('0x23')],'interface':_0x1f7990,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x3f4996[_0x8564('0x24')],'internal':_0x3f4996[_0x8564('0x25')]};_0x3ef2fe[_0x8564('0x46')](function(_0x5b3c22){_0x380293['push'](_['merge']({'channel':_0x5b3c22,'type':_0x8564('0x55'),'data1':_0x8564('0x56'),'data2':_0x1f7990},_0x4dd7b7));if(_0x3f4996[_0x8564('0x4a')]){_0x5164d0[_0x8564('0x2f')](_[_0x8564('0x57')]({'channel':_0x5b3c22,'type':_0x8564('0x2a'),'data1':_0x8564('0x58')},_0x4dd7b7));}});return db[_0x8564('0x29')]['bulkCreate'](_0x380293[_0x8564('0x59')](_0x5164d0),{'individualHooks':!![]});}})[_0x8564('0x1f')](function(){if(_0x3f4996){return _0x3f4996[_0x8564('0x28')]({'online':!![],'lastLoginAt':moment()[_0x8564('0x26')](_0x8564('0x2b')),'voicePause':_0x3f4996[_0x8564('0x4a')]||![],'mailPause':_0x3f4996[_0x8564('0x4a')]||![],'chatPause':_0x3f4996[_0x8564('0x4a')]||![],'faxPause':_0x3f4996[_0x8564('0x4a')]||![],'smsPause':_0x3f4996[_0x8564('0x4a')]||![],'openchannelPause':_0x3f4996[_0x8564('0x4a')]||![],'pauseType':_0x3f4996[_0x8564('0x4a')]?_0x8564('0x58'):null,'lastPauseAt':moment()[_0x8564('0x26')](_0x8564('0x2b')),'interface':_0x1f7990});}})[_0x8564('0x1f')](function(_0x233361){_0x19c3fd(_0x233361);})[_0x8564('0x1a')](function(_0x2dd4ce){_0x519d90(_0x4951dd[_0x8564('0x1b')](0x1f4,_0x2dd4ce[_0x8564('0x22')]));});});}; \ No newline at end of file +var _0x31f3=['name','internal','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','isNil','interface','type','DEFAULT\x20PAUSE','role','body','uniqueid','bulkCreate','catch','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','online','voicePause','mailPause','chatPause','openchannelPause','smsPause','whatsappPause','lastPauseAt','system','LogoutUser','findOne','destroy','push','all','LoginUser','mobile','phone','SIP/%s','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','loginInPause','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','../../config/logger','rpc','redis','socket.io-emitter','./user.socket','register','GetUser','User','findAll','options','raw','where','limit','map','model','include','attributes','then','stringify','error','message','ShowUser','PauseUser'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x31f3,0x17f));var _0x331f=function(_0x435150,_0x591cd9){_0x435150=_0x435150-0x0;var _0x13b3a4=_0x31f3[_0x435150];return _0x13b3a4;};'use strict';var _=require(_0x331f('0x0'));var util=require(_0x331f('0x1'));var moment=require(_0x331f('0x2'));var BPromise=require(_0x331f('0x3'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x331f('0x4'))(_0x331f('0x5'));var config=require('../../config/environment');config['redis']=_['defaults'](config[_0x331f('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x331f('0x7'))(new Redis(config[_0x331f('0x6')]));require(_0x331f('0x8'))[_0x331f('0x9')](socket);exports[_0x331f('0xa')]=function(_0x21a4b8){var _0x5003b3=this;return new Promise(function(_0x40e258,_0x570e54){return db[_0x331f('0xb')][_0x331f('0xc')]({'raw':_0x21a4b8[_0x331f('0xd')]?_0x21a4b8['options'][_0x331f('0xe')]===undefined?!![]:![]:!![],'where':_0x21a4b8[_0x331f('0xd')]?_0x21a4b8[_0x331f('0xd')][_0x331f('0xf')]||null:null,'attributes':_0x21a4b8[_0x331f('0xd')]?_0x21a4b8[_0x331f('0xd')]['attributes']||null:null,'limit':_0x21a4b8[_0x331f('0xd')]?_0x21a4b8[_0x331f('0xd')][_0x331f('0x10')]||null:null,'include':_0x21a4b8[_0x331f('0xd')]?_0x21a4b8['options']['include']?_[_0x331f('0x11')](_0x21a4b8[_0x331f('0xd')]['include'],function(_0x15b045){return{'model':db[_0x15b045[_0x331f('0x12')]],'as':_0x15b045['as'],'attributes':_0x15b045['attributes'],'include':_0x15b045[_0x331f('0x13')]?_[_0x331f('0x11')](_0x15b045[_0x331f('0x13')],function(_0xf9c931){return{'model':db[_0xf9c931[_0x331f('0x12')]],'as':_0xf9c931['as'],'attributes':_0xf9c931[_0x331f('0x14')],'include':_0xf9c931['include']?_[_0x331f('0x11')](_0xf9c931[_0x331f('0x13')],function(_0x5d851b){return{'model':db[_0x5d851b['model']],'as':_0x5d851b['as'],'attributes':_0x5d851b[_0x331f('0x14')]};}):[]};}):[]};}):[]:[]})[_0x331f('0x15')](function(_0x3b6dd4){logger['info'](_0x331f('0xa'),_0x21a4b8);logger['debug'](_0x331f('0xa'),_0x21a4b8,JSON[_0x331f('0x16')](_0x3b6dd4));_0x40e258(_0x3b6dd4);})['catch'](function(_0x564820){logger[_0x331f('0x17')]('GetUser',_0x564820[_0x331f('0x18')],_0x21a4b8);_0x570e54(_0x5003b3[_0x331f('0x17')](0x1f4,_0x564820[_0x331f('0x18')]));});});};exports[_0x331f('0x19')]=function(_0x14f5e5){var _0x8d4d2e=this;return new Promise(function(_0x426969,_0x238964){return db[_0x331f('0xb')]['find']({'raw':_0x14f5e5[_0x331f('0xd')]?_0x14f5e5[_0x331f('0xd')][_0x331f('0xe')]===undefined?!![]:![]:!![],'where':_0x14f5e5[_0x331f('0xd')]?_0x14f5e5[_0x331f('0xd')]['where']||null:null,'attributes':_0x14f5e5[_0x331f('0xd')]?_0x14f5e5['options'][_0x331f('0x14')]||null:null,'include':_0x14f5e5[_0x331f('0xd')]?_0x14f5e5[_0x331f('0xd')]['include']?_['map'](_0x14f5e5[_0x331f('0xd')][_0x331f('0x13')],function(_0x27dc37){return{'model':db[_0x27dc37[_0x331f('0x12')]],'as':_0x27dc37['as'],'attributes':_0x27dc37[_0x331f('0x14')],'include':_0x27dc37[_0x331f('0x13')]?_[_0x331f('0x11')](_0x27dc37[_0x331f('0x13')],function(_0x5a2db9){return{'model':db[_0x5a2db9[_0x331f('0x12')]],'as':_0x5a2db9['as'],'attributes':_0x5a2db9['attributes'],'include':_0x5a2db9['include']?_[_0x331f('0x11')](_0x5a2db9[_0x331f('0x13')],function(_0x32ed4e){return{'model':db[_0x32ed4e[_0x331f('0x12')]],'as':_0x32ed4e['as'],'attributes':_0x32ed4e[_0x331f('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48abd6){logger['info'](_0x331f('0x19'),_0x14f5e5);logger['debug'](_0x331f('0x19'),_0x14f5e5,JSON['stringify'](_0x48abd6));_0x426969(_0x48abd6);})['catch'](function(_0x5aaabe){logger['error'](_0x331f('0x19'),_0x5aaabe['message'],_0x14f5e5);_0x238964(_0x8d4d2e[_0x331f('0x17')](0x1f4,_0x5aaabe['message']));});});};exports[_0x331f('0x1a')]=function(_0x140da9){var _0x5728bc;return db[_0x331f('0xb')]['find']({'where':_0x140da9[_0x331f('0xd')][_0x331f('0xf')]||{},'attributes':['id',_0x331f('0x1b'),'role',_0x331f('0x1c'),'interface']})[_0x331f('0x15')](function(_0x3b9420){if(!_0x3b9420){throw new Error(util[_0x331f('0x1d')](_0x331f('0x1e'),_0x140da9[_0x331f('0x1f')]['id']));}_0x5728bc=_0x3b9420;return db[_0x331f('0x20')][_0x331f('0x21')]({'paused':0x1},{'where':{'UserId':_0x5728bc['id']},'individualHooks':!![]});})[_0x331f('0x15')](function(){return db[_0x331f('0x22')][_0x331f('0xc')]({'where':{'membername':_0x5728bc[_0x331f('0x1b')],'type':_0x331f('0x23'),'exitAt':null}});})[_0x331f('0x15')](function(_0x31b3fd){if(_0x31b3fd&&_0x31b3fd[_0x331f('0x24')]){var _0x26dae9=moment()[_0x331f('0x1d')](_0x331f('0x25'));for(var _0xe79bf6=0x0,_0x30db78=_0x31b3fd[_0x331f('0x24')];_0xe79bf6<_0x30db78;_0xe79bf6++){_0x31b3fd[_0xe79bf6]['updateAttributes']({'exitAt':_0x26dae9});}}})[_0x331f('0x15')](function(){var _0x4366cf=[];var _0x2ca2dc=utils[_0x331f('0x26')]();_0x2ca2dc[_0x331f('0x27')](function(_0x32897a){_0x4366cf['push']({'channel':_0x32897a,'membername':_0x5728bc[_0x331f('0x1b')],'interface':_[_0x331f('0x28')](_0x5728bc['interface'])?util[_0x331f('0x1d')]('SIP/%s',_0x5728bc[_0x331f('0x1b')]):_0x5728bc[_0x331f('0x29')],'type':'PAUSE','enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x140da9['body'][_0x331f('0x2a')]||_0x331f('0x2b'),'role':_0x5728bc[_0x331f('0x2c')],'internal':_0x5728bc[_0x331f('0x1c')],'uniqueid':_0x140da9[_0x331f('0x2d')][_0x331f('0x2e')]||null});});return db[_0x331f('0x22')][_0x331f('0x2f')](_0x4366cf,{'individualHooks':!![]});})[_0x331f('0x15')](function(){return _0x5728bc['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x140da9[_0x331f('0x2d')][_0x331f('0x2a')]||_0x331f('0x2b'),'lastPauseAt':moment()['format'](_0x331f('0x25'))});})[_0x331f('0x30')](function(_0x16d766){throw _0x16d766;});};exports['UnpauseUser']=function(_0x3bbdc8){return Promise['resolve']()['then'](function(){if(_0x3bbdc8[_0x331f('0x2d')][_0x331f('0x31')]&&!utils[_0x331f('0x32')](_0x3bbdc8['body']['channel'])){throw new Error(util['format'](_0x331f('0x33'),_0x3bbdc8[_0x331f('0x2d')]['channel']));}return db['User']['findOne']({'where':_0x3bbdc8[_0x331f('0xd')][_0x331f('0xf')]||{},'attributes':['id','name',_0x331f('0x2c'),'internal',_0x331f('0x29'),_0x331f('0x34'),_0x331f('0x35'),_0x331f('0x36'),_0x331f('0x37'),'faxPause',_0x331f('0x38'),_0x331f('0x39'),_0x331f('0x3a'),'pauseType',_0x331f('0x3b')]});})[_0x331f('0x15')](function(_0x2bbbb0){if(!_0x2bbbb0){throw new Error(util[_0x331f('0x1d')](_0x331f('0x1e'),_0x3bbdc8[_0x331f('0x1f')]['id']));}return _0x2bbbb0['unpause'](_0x3bbdc8['body'][_0x331f('0x31')],_0x331f('0x3c'));})[_0x331f('0x30')](function(_0x1f4c67){throw _0x1f4c67;});};exports[_0x331f('0x3d')]=function(_0x36ef5){var _0x58ecdd=this;return new Promise(function(_0x4d5f5b,_0xf29f85){var _0x262329;return db['User'][_0x331f('0x3e')]({'where':_0x36ef5[_0x331f('0xd')]['where']||{},'attributes':['id','name']})[_0x331f('0x15')](function(_0x38e0e2){if(_0x38e0e2){_0x262329=_0x38e0e2;return db[_0x331f('0x20')][_0x331f('0x3f')]({'where':{'membername':_0x262329[_0x331f('0x1b')]},'individualHooks':!![]});}})[_0x331f('0x15')](function(){if(_0x262329){return db['MemberReport']['findAll']({'where':{'membername':_0x262329[_0x331f('0x1b')],'exitAt':null}});}})[_0x331f('0x15')](function(_0x19ae39){if(_0x262329){if(_0x19ae39&&_0x19ae39[_0x331f('0x24')]){var _0x2576f9=[];_0x19ae39[_0x331f('0x27')](function(_0x3405fc){_0x2576f9[_0x331f('0x40')](_0x3405fc[_0x331f('0x21')]({'exitAt':moment()[_0x331f('0x1d')](_0x331f('0x25'))}));});return BPromise[_0x331f('0x41')](_0x2576f9);}}})[_0x331f('0x15')](function(){if(_0x262329){return _0x262329[_0x331f('0x21')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x331f('0x15')](function(_0x83b643){_0x4d5f5b(_0x83b643);})[_0x331f('0x30')](function(_0x4e01c5){_0xf29f85(_0x58ecdd['error'](0x1f4,_0x4e01c5[_0x331f('0x18')]));});});};exports[_0x331f('0x42')]=function(_0x3ebaee){var _0x389545=this;return new Promise(function(_0x3104a9,_0x5e1bd2){var _0x361c56;var _0x1e65aa;var _0x38482d;var _0x516655;return db[_0x331f('0xb')][_0x331f('0x3e')]({'where':_0x3ebaee[_0x331f('0xd')][_0x331f('0xf')]||{},'attributes':['id',_0x331f('0x1b'),_0x331f('0x2c'),_0x331f('0x43'),_0x331f('0x44'),_0x331f('0x1c'),'loginInPause','interface']})[_0x331f('0x15')](function(_0x2734da){if(_0x2734da){_0x361c56=_0x2734da;_0x516655=_0x3ebaee[_0x331f('0x2d')][_0x331f('0x29')]?_0x3ebaee[_0x331f('0x2d')][_0x331f('0x29')]:util[_0x331f('0x1d')](_0x331f('0x45'),_0x361c56['name']);return db[_0x331f('0xb')][_0x331f('0x46')]({'where':{'role':_0x331f('0x47'),'online':!![],'id':{'$ne':_0x361c56['id']}}});}})['then'](function(_0x3056e3){if(_0x3056e3){_0x38482d=_0x3056e3;return require('../../config/license/util')[_0x331f('0x48')]();}})['then'](function(_0x79aff){if(_0x79aff&&_0x79aff[_0x331f('0x49')]&&_0x38482d>=_0x79aff['agents']){throw new Error(_0x331f('0x4a'));}})[_0x331f('0x15')](function(){if(_0x361c56){return db['UserVoiceQueueRt'][_0x331f('0x3f')]({'where':{'membername':_0x361c56[_0x331f('0x1b')]},'individualHooks':!![]});}})[_0x331f('0x15')](function(){if(_0x361c56){return _0x361c56['getVoiceQueues']({'raw':!![]});}})[_0x331f('0x15')](function(_0x34ebac){if(_0x361c56){if(_0x34ebac){var _0x5a55a1=[];_0x1e65aa=_0x34ebac;if(_0x1e65aa[_0x331f('0x24')]){for(var _0x56ee0a=0x0;_0x56ee0a<_0x1e65aa[_0x331f('0x24')];_0x56ee0a++){_0x5a55a1[_0x331f('0x40')](db[_0x331f('0x20')][_0x331f('0x4b')]({'membername':_0x361c56[_0x331f('0x1b')],'UserId':_0x361c56['id'],'queue_name':_0x1e65aa[_0x56ee0a][_0x331f('0x1b')],'VoiceQueueId':_0x1e65aa[_0x56ee0a]['id'],'interface':_0x516655,'paused':_0x361c56[_0x331f('0x4c')]||![],'penalty':_0x1e65aa[_0x56ee0a]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x331f('0x41')](_0x5a55a1);}}}})[_0x331f('0x15')](function(){if(_0x361c56){return db['MemberReport']['findAll']({'where':{'membername':_0x361c56[_0x331f('0x1b')],'exitAt':null}});}})[_0x331f('0x15')](function(_0x1ee3e0){if(_0x361c56){if(_0x1ee3e0&&_0x1ee3e0[_0x331f('0x24')]){var _0x122dc3=[];_0x1ee3e0['forEach'](function(_0x4eeb9d){_0x122dc3[_0x331f('0x40')](_0x4eeb9d['update']({'exitAt':moment()['format'](_0x331f('0x25'))}));});return BPromise[_0x331f('0x41')](_0x122dc3);}}})[_0x331f('0x15')](function(){if(_0x361c56){var _0x372d0a=[];var _0x1cc29a=[];var _0x409d16=utils[_0x331f('0x26')]();var _0x49fc3c={'membername':_0x361c56['name'],'interface':_0x516655,'enterAt':moment()[_0x331f('0x1d')](_0x331f('0x25')),'role':_0x361c56[_0x331f('0x2c')],'internal':_0x361c56[_0x331f('0x1c')]};_0x409d16[_0x331f('0x27')](function(_0x3d13bb){_0x372d0a['push'](_[_0x331f('0x4d')]({'channel':_0x3d13bb,'type':_0x331f('0x4e'),'data1':_0x331f('0x4f'),'data2':_0x516655},_0x49fc3c));if(_0x361c56['loginInPause']){_0x1cc29a[_0x331f('0x40')](_[_0x331f('0x4d')]({'channel':_0x3d13bb,'type':_0x331f('0x23'),'data1':_0x331f('0x50')},_0x49fc3c));}});return db[_0x331f('0x22')][_0x331f('0x2f')](_0x372d0a[_0x331f('0x51')](_0x1cc29a),{'individualHooks':!![]});}})[_0x331f('0x15')](function(){if(_0x361c56){return _0x361c56[_0x331f('0x21')]({'online':!![],'lastLoginAt':moment()[_0x331f('0x1d')](_0x331f('0x25')),'voicePause':_0x361c56[_0x331f('0x4c')]||![],'mailPause':_0x361c56['loginInPause']||![],'chatPause':_0x361c56[_0x331f('0x4c')]||![],'faxPause':_0x361c56[_0x331f('0x4c')]||![],'smsPause':_0x361c56[_0x331f('0x4c')]||![],'openchannelPause':_0x361c56['loginInPause']||![],'pauseType':_0x361c56[_0x331f('0x4c')]?_0x331f('0x50'):null,'lastPauseAt':moment()[_0x331f('0x1d')](_0x331f('0x25')),'interface':_0x516655});}})[_0x331f('0x15')](function(_0x31c7e6){_0x3104a9(_0x31c7e6);})[_0x331f('0x30')](function(_0x57715b){_0x5e1bd2(_0x389545[_0x331f('0x17')](0x1f4,_0x57715b[_0x331f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 8850e30..9e4adb5 100644 --- a/server/api/user/user.socket.js +++ b/server/api/user/user.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6f0=['update','emit','removeListener','register','user:','save'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xc6f0,0x173));var _0x0c6f=function(_0x212478,_0x3d356b){_0x212478=_0x212478-0x0;var _0x15f106=_0xc6f0[_0x212478];return _0x15f106;};'use strict';var UserEvents=require('./user.events');var events=[_0x0c6f('0x0'),'remove',_0x0c6f('0x1')];function createListener(_0x18968b,_0xb24ab4){return function(_0x432685){_0xb24ab4[_0x0c6f('0x2')](_0x18968b,_0x432685);};}function removeListener(_0xc51b75,_0x2d6531){return function(){UserEvents[_0x0c6f('0x3')](_0xc51b75,_0x2d6531);};}exports[_0x0c6f('0x4')]=function(_0x5a83bd){for(var _0x46805a=0x0,_0x3ed229=events['length'];_0x46805a<_0x3ed229;_0x46805a++){var _0x2df0e2=events[_0x46805a];var _0x4bbdeb=createListener(_0x0c6f('0x5')+_0x2df0e2,_0x5a83bd);UserEvents['on'](_0x2df0e2,_0x4bbdeb);}}; \ No newline at end of file +var _0xcce3=['emit','removeListener','register','user:','./user.events','save','remove'];(function(_0x52a45c,_0x331b52){var _0x4ac4be=function(_0x3167dc){while(--_0x3167dc){_0x52a45c['push'](_0x52a45c['shift']());}};_0x4ac4be(++_0x331b52);}(_0xcce3,0x74));var _0x3cce=function(_0x529296,_0x1a6a23){_0x529296=_0x529296-0x0;var _0x1796bf=_0xcce3[_0x529296];return _0x1796bf;};'use strict';var UserEvents=require(_0x3cce('0x0'));var events=[_0x3cce('0x1'),_0x3cce('0x2'),'update'];function createListener(_0x1f2cfc,_0x4a8a10){return function(_0x2185d3){_0x4a8a10[_0x3cce('0x3')](_0x1f2cfc,_0x2185d3);};}function removeListener(_0x5c621e,_0x4c99d5){return function(){UserEvents[_0x3cce('0x4')](_0x5c621e,_0x4c99d5);};}exports[_0x3cce('0x5')]=function(_0x5c0468){for(var _0x5c3202=0x0,_0x54eb10=events['length'];_0x5c3202<_0x54eb10;_0x5c3202++){var _0x408e55=events[_0x5c3202];var _0x2bbe06=createListener(_0x3cce('0x6')+_0x408e55,_0x5c0468);UserEvents['on'](_0x408e55,_0x2bbe06);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index dbefb7d..f0fb9b2 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4bbb2f,_0x1d2540){var _0xd473a4=function(_0x3c6beb){while(--_0x3c6beb){_0x4bbb2f['push'](_0x4bbb2f['shift']());}};_0xd473a4(++_0x1d2540);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xbb6e65,_0x415e76){var _0x14d33a=function(_0x18b689){while(--_0x18b689){_0xbb6e65['push'](_0xbb6e65['shift']());}};_0x14d33a(++_0x415e76);}(_0x70e0,0x17b));var _0x070e=function(_0x4bbb9f,_0x339328){_0x4bbb9f=_0x4bbb9f-0x0;var _0x29eed1=_0x70e0[_0x4bbb9f];return _0x29eed1;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index e51af9b..ecfc88b 100644 --- a/server/api/userChatQueue/userChatQueue.attributes.js +++ b/server/api/userChatQueue/userChatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47c7=['INTEGER','sequelize'];(function(_0xd460e9,_0x1e013f){var _0x4fe630=function(_0x36e979){while(--_0x36e979){_0xd460e9['push'](_0xd460e9['shift']());}};_0x4fe630(++_0x1e013f);}(_0x47c7,0x1ab));var _0x747c=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x47c7[_0x2aea9e];return _0x430b92;};'use strict';var Sequelize=require(_0x747c('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x747c('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x88d0=['exports','INTEGER','sequelize'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x88d0,0x16d));var _0x088d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x88d0[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x088d('0x0'));module[_0x088d('0x1')]={'penalty':{'type':Sequelize[_0x088d('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 8e6c7e9..3fe7620 100644 --- a/server/api/userChatQueue/userChatQueue.model.js +++ b/server/api/userChatQueue/userChatQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x12cf=['bluebird','request-promise','rimraf','../../config/environment','exports','define','user_has_chat_queues','util','moment'];(function(_0x49f31e,_0x374632){var _0x5d3b12=function(_0xba57b9){while(--_0xba57b9){_0x49f31e['push'](_0x49f31e['shift']());}};_0x5d3b12(++_0x374632);}(_0x12cf,0x1c9));var _0xf12c=function(_0x301365,_0x2571e8){_0x301365=_0x301365-0x0;var _0x5f7496=_0x12cf[_0x301365];return _0x5f7496;};'use strict';var _=require('lodash');var util=require(_0xf12c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf12c('0x1'));var BPromise=require(_0xf12c('0x2'));var rp=require(_0xf12c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf12c('0x4'));var config=require(_0xf12c('0x5'));var attributes=require('./userChatQueue.attributes');module[_0xf12c('0x6')]=function(_0x55c9a5,_0xc2ff95){return _0x55c9a5[_0xf12c('0x7')]('UserChatQueue',attributes,{'tableName':_0xf12c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56bd=['path','rimraf','../../config/environment','./userChatQueue.attributes','exports','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x43eda9,_0x59d0f7){var _0x485783=function(_0x3a2d29){while(--_0x3a2d29){_0x43eda9['push'](_0x43eda9['shift']());}};_0x485783(++_0x59d0f7);}(_0x56bd,0xc9));var _0xd56b=function(_0x4fb680,_0x3dc44c){_0x4fb680=_0x4fb680-0x0;var _0x1bd64c=_0x56bd[_0x4fb680];return _0x1bd64c;};'use strict';var _=require(_0xd56b('0x0'));var util=require(_0xd56b('0x1'));var logger=require(_0xd56b('0x2'))(_0xd56b('0x3'));var moment=require(_0xd56b('0x4'));var BPromise=require(_0xd56b('0x5'));var rp=require(_0xd56b('0x6'));var fs=require('fs');var path=require(_0xd56b('0x7'));var rimraf=require(_0xd56b('0x8'));var config=require(_0xd56b('0x9'));var attributes=require(_0xd56b('0xa'));module[_0xd56b('0xb')]=function(_0x177b6e,_0x3a092c){return _0x177b6e['define']('UserChatQueue',attributes,{'tableName':_0xd56b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 8b1510d..6ecdeba 100644 --- a/server/api/userChatQueue/userChatQueue.rpc.js +++ b/server/api/userChatQueue/userChatQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc096=['client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1987b8,_0x7cc673){var _0x27e300=function(_0x2c9c83){while(--_0x2c9c83){_0x1987b8['push'](_0x1987b8['shift']());}};_0x27e300(++_0x7cc673);}(_0xc096,0xff));var _0x6c09=function(_0x503325,_0x24a407){_0x503325=_0x503325-0x0;var _0x452fff=_0xc096[_0x503325];return _0x452fff;};'use strict';var _=require(_0x6c09('0x0'));var util=require(_0x6c09('0x1'));var moment=require('moment');var BPromise=require(_0x6c09('0x2'));var rs=require(_0x6c09('0x3'));var fs=require('fs');var Redis=require(_0x6c09('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c09('0x5'));var logger=require(_0x6c09('0x6'))(_0x6c09('0x7'));var config=require(_0x6c09('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6c09('0x9')][_0x6c09('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38942f,_0x4c5d35,_0x54ebec){return new BPromise(function(_0x554b15,_0x5a3b3d){return client[_0x6c09('0xb')](_0x38942f,_0x54ebec)[_0x6c09('0xc')](function(_0xdf58cd){logger[_0x6c09('0xd')](_0x6c09('0xe'),_0x4c5d35,_0x6c09('0xf'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x4c5d35,_0x6c09('0xf'),JSON[_0x6c09('0x10')](_0xdf58cd));if(_0xdf58cd['error']){if(_0xdf58cd[_0x6c09('0x11')][_0x6c09('0x12')]===0x1f4){logger[_0x6c09('0x11')](_0x6c09('0xe'),_0x4c5d35,_0xdf58cd[_0x6c09('0x11')][_0x6c09('0x13')]);return _0x5a3b3d(_0xdf58cd[_0x6c09('0x11')]['message']);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x4c5d35,_0xdf58cd[_0x6c09('0x11')][_0x6c09('0x13')]);return _0x554b15(_0xdf58cd[_0x6c09('0x11')][_0x6c09('0x13')]);}else{logger[_0x6c09('0xd')](_0x6c09('0xe'),_0x4c5d35,'request\x20sent');_0x554b15(_0xdf58cd[_0x6c09('0x14')][_0x6c09('0x13')]);}})[_0x6c09('0x15')](function(_0x2c5aa6){logger['error'](_0x6c09('0xe'),_0x4c5d35,_0x2c5aa6);_0x5a3b3d(_0x2c5aa6);});});} \ No newline at end of file +var _0x247d=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x14c95b,_0x4acb8d){var _0x8f9fbb=function(_0x569f5c){while(--_0x569f5c){_0x14c95b['push'](_0x14c95b['shift']());}};_0x8f9fbb(++_0x4acb8d);}(_0x247d,0x18a));var _0xd247=function(_0x462755,_0x3024fd){_0x462755=_0x462755-0x0;var _0x18bc7d=_0x247d[_0x462755];return _0x18bc7d;};'use strict';var _=require(_0xd247('0x0'));var util=require(_0xd247('0x1'));var moment=require(_0xd247('0x2'));var BPromise=require('bluebird');var rs=require(_0xd247('0x3'));var fs=require('fs');var Redis=require(_0xd247('0x4'));var db=require(_0xd247('0x5'))['db'];var utils=require(_0xd247('0x6'));var logger=require(_0xd247('0x7'))(_0xd247('0x8'));var config=require('../../config/environment');var jayson=require(_0xd247('0x9'));var client=jayson['client'][_0xd247('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x534217,_0x320a13,_0x2183e1){return new BPromise(function(_0x175dc2,_0x461305){return client[_0xd247('0xb')](_0x534217,_0x2183e1)[_0xd247('0xc')](function(_0x203803){logger[_0xd247('0xd')](_0xd247('0xe'),_0x320a13,_0xd247('0xf'));logger['debug'](_0xd247('0x10'),_0x320a13,_0xd247('0xf'),JSON[_0xd247('0x11')](_0x203803));if(_0x203803['error']){if(_0x203803[_0xd247('0x12')]['code']===0x1f4){logger['error'](_0xd247('0xe'),_0x320a13,_0x203803[_0xd247('0x12')][_0xd247('0x13')]);return _0x461305(_0x203803[_0xd247('0x12')][_0xd247('0x13')]);}logger[_0xd247('0x12')](_0xd247('0xe'),_0x320a13,_0x203803['error'][_0xd247('0x13')]);return _0x175dc2(_0x203803[_0xd247('0x12')][_0xd247('0x13')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x320a13,_0xd247('0xf'));_0x175dc2(_0x203803[_0xd247('0x14')][_0xd247('0x13')]);}})['catch'](function(_0x5f46d3){logger[_0xd247('0x12')](_0xd247('0xe'),_0x320a13,_0x5f46d3);_0x461305(_0x5f46d3);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 5c363ca..72644ca 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x49a458,_0x2a23d8){var _0xf2762a=function(_0x4ba099){while(--_0x4ba099){_0x49a458['push'](_0x49a458['shift']());}};_0xf2762a(++_0x2a23d8);}(_0x70e0,0x17b));var _0x070e=function(_0x4778a5,_0x4873ab){_0x4778a5=_0x4778a5-0x0;var _0x492c2d=_0x70e0[_0x4778a5];return _0x492c2d;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x400545,_0x25af3b){var _0x55cd5b=function(_0x335d96){while(--_0x335d96){_0x400545['push'](_0x400545['shift']());}};_0x55cd5b(++_0x25af3b);}(_0xe706,0xa3));var _0x6e70=function(_0x432c36,_0x4082e8){_0x432c36=_0x432c36-0x0;var _0x3a14d0=_0xe706[_0x432c36];return _0x3a14d0;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 85a1cca..af51304 100644 --- a/server/api/userFaxQueue/userFaxQueue.attributes.js +++ b/server/api/userFaxQueue/userFaxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcae7=['STRING','sequelize','INTEGER'];(function(_0x1be869,_0x58cd8a){var _0x49a23f=function(_0x107011){while(--_0x107011){_0x1be869['push'](_0x1be869['shift']());}};_0x49a23f(++_0x58cd8a);}(_0xcae7,0x1d5));var _0x7cae=function(_0x152a03,_0x41a4fe){_0x152a03=_0x152a03-0x0;var _0x3ccbd0=_0xcae7[_0x152a03];return _0x3ccbd0;};'use strict';var Sequelize=require(_0x7cae('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7cae('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x7cae('0x2')]}}; \ No newline at end of file +var _0x78c6=['sequelize','exports','INTEGER','STRING'];(function(_0x54a832,_0x526108){var _0x344ea9=function(_0x484afe){while(--_0x484afe){_0x54a832['push'](_0x54a832['shift']());}};_0x344ea9(++_0x526108);}(_0x78c6,0x1d8));var _0x678c=function(_0x15ab28,_0x3385d8){_0x15ab28=_0x15ab28-0x0;var _0x2fcf19=_0x78c6[_0x15ab28];return _0x2fcf19;};'use strict';var Sequelize=require(_0x678c('0x0'));module[_0x678c('0x1')]={'penalty':{'type':Sequelize[_0x678c('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x678c('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x678c('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index e8df68c..c5e6a29 100644 --- a/server/api/userFaxQueue/userFaxQueue.model.js +++ b/server/api/userFaxQueue/userFaxQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3d8=['bluebird','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment'];(function(_0x19f28e,_0x513bec){var _0x151a97=function(_0x2762cc){while(--_0x2762cc){_0x19f28e['push'](_0x19f28e['shift']());}};_0x151a97(++_0x513bec);}(_0xc3d8,0x1e9));var _0x8c3d=function(_0x4edfaf,_0x225a98){_0x4edfaf=_0x4edfaf-0x0;var _0x524103=_0xc3d8[_0x4edfaf];return _0x524103;};'use strict';var _=require(_0x8c3d('0x0'));var util=require(_0x8c3d('0x1'));var logger=require(_0x8c3d('0x2'))(_0x8c3d('0x3'));var moment=require(_0x8c3d('0x4'));var BPromise=require(_0x8c3d('0x5'));var rp=require(_0x8c3d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c3d('0x7'));var config=require(_0x8c3d('0x8'));var attributes=require(_0x8c3d('0x9'));module[_0x8c3d('0xa')]=function(_0x477fe8,_0x5e98aa){return _0x477fe8['define'](_0x8c3d('0xb'),attributes,{'tableName':_0x8c3d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab9e=['bluebird','path','../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','moment'];(function(_0x32f9e6,_0x55ed80){var _0x11a5ea=function(_0x1862ab){while(--_0x1862ab){_0x32f9e6['push'](_0x32f9e6['shift']());}};_0x11a5ea(++_0x55ed80);}(_0xab9e,0x6a));var _0xeab9=function(_0x2c2954,_0x3cadf4){_0x2c2954=_0x2c2954-0x0;var _0x1e834e=_0xab9e[_0x2c2954];return _0x1e834e;};'use strict';var _=require(_0xeab9('0x0'));var util=require(_0xeab9('0x1'));var logger=require(_0xeab9('0x2'))('api');var moment=require(_0xeab9('0x3'));var BPromise=require(_0xeab9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeab9('0x5'));var rimraf=require('rimraf');var config=require(_0xeab9('0x6'));var attributes=require('./userFaxQueue.attributes');module[_0xeab9('0x7')]=function(_0x3a5e14,_0x2a399a){return _0x3a5e14[_0xeab9('0x8')](_0xeab9('0x9'),attributes,{'tableName':_0xeab9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 6166280..36dd364 100644 --- a/server/api/userFaxQueue/userFaxQueue.rpc.js +++ b/server/api/userFaxQueue/userFaxQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ba8=['request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0x1ba8,0xeb));var _0x81ba=function(_0x82d3ed,_0x469b57){_0x82d3ed=_0x82d3ed-0x0;var _0x2f3dde=_0x1ba8[_0x82d3ed];return _0x2f3dde;};'use strict';var _=require(_0x81ba('0x0'));var util=require(_0x81ba('0x1'));var moment=require(_0x81ba('0x2'));var BPromise=require(_0x81ba('0x3'));var rs=require(_0x81ba('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81ba('0x5'))['db'];var utils=require(_0x81ba('0x6'));var logger=require(_0x81ba('0x7'))(_0x81ba('0x8'));var config=require(_0x81ba('0x9'));var jayson=require(_0x81ba('0xa'));var client=jayson[_0x81ba('0xb')][_0x81ba('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x815366,_0x1b333a,_0x5866be){return new BPromise(function(_0x593681,_0x2b9986){return client[_0x81ba('0xd')](_0x815366,_0x5866be)[_0x81ba('0xe')](function(_0x4f68c4){logger['info'](_0x81ba('0xf'),_0x1b333a,'request\x20sent');logger[_0x81ba('0x10')](_0x81ba('0x11'),_0x1b333a,_0x81ba('0x12'),JSON[_0x81ba('0x13')](_0x4f68c4));if(_0x4f68c4[_0x81ba('0x14')]){if(_0x4f68c4[_0x81ba('0x14')][_0x81ba('0x15')]===0x1f4){logger['error'](_0x81ba('0xf'),_0x1b333a,_0x4f68c4[_0x81ba('0x14')][_0x81ba('0x16')]);return _0x2b9986(_0x4f68c4['error']['message']);}logger['error'](_0x81ba('0xf'),_0x1b333a,_0x4f68c4[_0x81ba('0x14')][_0x81ba('0x16')]);return _0x593681(_0x4f68c4['error']['message']);}else{logger['info'](_0x81ba('0xf'),_0x1b333a,_0x81ba('0x12'));_0x593681(_0x4f68c4['result'][_0x81ba('0x16')]);}})['catch'](function(_0x5bdddc){logger[_0x81ba('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x1b333a,_0x5bdddc);_0x2b9986(_0x5bdddc);});});} \ No newline at end of file +var _0xd46f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment'];(function(_0x12b40a,_0x2a06ae){var _0x4e549c=function(_0x1efd71){while(--_0x1efd71){_0x12b40a['push'](_0x12b40a['shift']());}};_0x4e549c(++_0x2a06ae);}(_0xd46f,0x15e));var _0xfd46=function(_0x3b812d,_0x1b9e62){_0x3b812d=_0x3b812d-0x0;var _0xaaa85d=_0xd46f[_0x3b812d];return _0xaaa85d;};'use strict';var _=require('lodash');var util=require(_0xfd46('0x0'));var moment=require(_0xfd46('0x1'));var BPromise=require('bluebird');var rs=require(_0xfd46('0x2'));var fs=require('fs');var Redis=require(_0xfd46('0x3'));var db=require(_0xfd46('0x4'))['db'];var utils=require(_0xfd46('0x5'));var logger=require(_0xfd46('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfd46('0x7'));var client=jayson[_0xfd46('0x8')][_0xfd46('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x206392,_0x2b4961,_0xff694){return new BPromise(function(_0x2278d3,_0xeda510){return client[_0xfd46('0xa')](_0x206392,_0xff694)[_0xfd46('0xb')](function(_0x1276c5){logger[_0xfd46('0xc')](_0xfd46('0xd'),_0x2b4961,'request\x20sent');logger[_0xfd46('0xe')](_0xfd46('0xf'),_0x2b4961,_0xfd46('0x10'),JSON[_0xfd46('0x11')](_0x1276c5));if(_0x1276c5[_0xfd46('0x12')]){if(_0x1276c5[_0xfd46('0x12')]['code']===0x1f4){logger[_0xfd46('0x12')](_0xfd46('0xd'),_0x2b4961,_0x1276c5['error'][_0xfd46('0x13')]);return _0xeda510(_0x1276c5[_0xfd46('0x12')][_0xfd46('0x13')]);}logger[_0xfd46('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x2b4961,_0x1276c5[_0xfd46('0x12')]['message']);return _0x2278d3(_0x1276c5[_0xfd46('0x12')][_0xfd46('0x13')]);}else{logger[_0xfd46('0xc')](_0xfd46('0xd'),_0x2b4961,'request\x20sent');_0x2278d3(_0x1276c5[_0xfd46('0x14')]['message']);}})[_0xfd46('0x15')](function(_0x262a49){logger['error'](_0xfd46('0xd'),_0x2b4961,_0x262a49);_0xeda510(_0x262a49);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 54a7b7a..4b0a98a 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3137a8,_0x213d4e){var _0x4c5b0b=function(_0x5c7d23){while(--_0x5c7d23){_0x3137a8['push'](_0x3137a8['shift']());}};_0x4c5b0b(++_0x213d4e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x205e56,_0x366e77){var _0x489d5d=function(_0x130a84){while(--_0x130a84){_0x205e56['push'](_0x205e56['shift']());}};_0x489d5d(++_0x366e77);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 8d07c54..aa62c05 100644 --- a/server/api/userMailQueue/userMailQueue.attributes.js +++ b/server/api/userMailQueue/userMailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9092=['INTEGER','sequelize','exports'];(function(_0x505c5b,_0x416c7b){var _0x1a15fe=function(_0x3225bf){while(--_0x3225bf){_0x505c5b['push'](_0x505c5b['shift']());}};_0x1a15fe(++_0x416c7b);}(_0x9092,0xa9));var _0x2909=function(_0xd2fbc6,_0x3b26ed){_0xd2fbc6=_0xd2fbc6-0x0;var _0x5e536f=_0x9092[_0xd2fbc6];return _0x5e536f;};'use strict';var Sequelize=require(_0x2909('0x0'));module[_0x2909('0x1')]={'penalty':{'type':Sequelize[_0x2909('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x038c=['sequelize','exports'];(function(_0x4c11d1,_0x30aef1){var _0xa4b5bc=function(_0x20a137){while(--_0x20a137){_0x4c11d1['push'](_0x4c11d1['shift']());}};_0xa4b5bc(++_0x30aef1);}(_0x038c,0x1c4));var _0xc038=function(_0x9aeed5,_0x5cd01f){_0x9aeed5=_0x9aeed5-0x0;var _0x4a469a=_0x038c[_0x9aeed5];return _0x4a469a;};'use strict';var Sequelize=require(_0xc038('0x0'));module[_0xc038('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index ea0a71c..0adbdca 100644 --- a/server/api/userMailQueue/userMailQueue.model.js +++ b/server/api/userMailQueue/userMailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb201=['UserMailQueue','user_has_mail_queues','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x27ccda,_0xe5d4a){var _0x1ddccd=function(_0x534c37){while(--_0x534c37){_0x27ccda['push'](_0x27ccda['shift']());}};_0x1ddccd(++_0xe5d4a);}(_0xb201,0x12e));var _0x1b20=function(_0x144514,_0x38c5d6){_0x144514=_0x144514-0x0;var _0x51863c=_0xb201[_0x144514];return _0x51863c;};'use strict';var _=require(_0x1b20('0x0'));var util=require('util');var logger=require(_0x1b20('0x1'))(_0x1b20('0x2'));var moment=require(_0x1b20('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b20('0x4'));var fs=require('fs');var path=require(_0x1b20('0x5'));var rimraf=require(_0x1b20('0x6'));var config=require(_0x1b20('0x7'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x382736,_0x36664c){return _0x382736['define'](_0x1b20('0x8'),attributes,{'tableName':_0x1b20('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6725=['define','UserMailQueue','user_has_mail_queues','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes'];(function(_0x5055b7,_0x15adad){var _0x289d45=function(_0x5b61e7){while(--_0x5b61e7){_0x5055b7['push'](_0x5055b7['shift']());}};_0x289d45(++_0x15adad);}(_0x6725,0x1cb));var _0x5672=function(_0x17406e,_0x332153){_0x17406e=_0x17406e-0x0;var _0x2185f5=_0x6725[_0x17406e];return _0x2185f5;};'use strict';var _=require(_0x5672('0x0'));var util=require(_0x5672('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5672('0x2'));var BPromise=require(_0x5672('0x3'));var rp=require(_0x5672('0x4'));var fs=require('fs');var path=require(_0x5672('0x5'));var rimraf=require(_0x5672('0x6'));var config=require(_0x5672('0x7'));var attributes=require(_0x5672('0x8'));module['exports']=function(_0x91b793,_0x19e2a1){return _0x91b793[_0x5672('0x9')](_0x5672('0xa'),attributes,{'tableName':_0x5672('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index a62ea09..973f5bd 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3b973d,_0x1c11a0){var _0x11162e=function(_0x18d770){while(--_0x18d770){_0x3b973d['push'](_0x3b973d['shift']());}};_0x11162e(++_0x1c11a0);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2e15b4,_0x2fc9a5){_0x2e15b4=_0x2e15b4-0x0;var _0x188c5b=_0x8ef6[_0x2e15b4];return _0x188c5b;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file +var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x1cb9,0x14e));var _0x91cb=function(_0x59af17,_0x2c620c){_0x59af17=_0x59af17-0x0;var _0x182e05=_0x1cb9[_0x59af17];return _0x182e05;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index dc46779..8df21af 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc4c=['multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports'];(function(_0x276fae,_0x1424c1){var _0x132c7e=function(_0x4bf08a){while(--_0x4bf08a){_0x276fae['push'](_0x276fae['shift']());}};_0x132c7e(++_0x1424c1);}(_0xfc4c,0x172));var _0xcfc4=function(_0x1af1a2,_0x1bc86a){_0x1af1a2=_0x1af1a2-0x0;var _0x24e9aa=_0xfc4c[_0x1af1a2];return _0x24e9aa;};'use strict';var multer=require(_0xcfc4('0x0'));var util=require('util');var path=require(_0xcfc4('0x1'));var timeout=require(_0xcfc4('0x2'));var express=require('express');var router=express[_0xcfc4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcfc4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcfc4('0x5'));var controller=require(_0xcfc4('0x6'));router[_0xcfc4('0x7')]('/',auth[_0xcfc4('0x8')](),controller['sendUserNotification']);module[_0xcfc4('0x9')]=router; \ No newline at end of file +var _0x42a2=['express','Router','fs-extra','../../components/auth/service','post','isAuthenticated','sendUserNotification','exports','util','path','connect-timeout'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x42a2,0x110));var _0x242a=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x42a2[_0x5a95fa];return _0x1a61b8;};'use strict';var multer=require('multer');var util=require(_0x242a('0x0'));var path=require(_0x242a('0x1'));var timeout=require(_0x242a('0x2'));var express=require(_0x242a('0x3'));var router=express[_0x242a('0x4')]();var fs_extra=require(_0x242a('0x5'));var auth=require(_0x242a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0x242a('0x7')]('/',auth[_0x242a('0x8')](),controller[_0x242a('0x9')]);module[_0x242a('0xa')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 4bdf5c7..e5947b2 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3e1=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xe3e1,0x87));var _0x1e3e=function(_0x2f52f1,_0x12fd5f){_0x2f52f1=_0x2f52f1-0x0;var _0x3b369e=_0xe3e1[_0x2f52f1];return _0x3b369e;};'use strict';var Sequelize=require(_0x1e3e('0x0'));module[_0x1e3e('0x1')]={'body':{'type':Sequelize[_0x1e3e('0x2')]},'senderName':{'type':Sequelize[_0x1e3e('0x3')]},'recipientsId':{'type':Sequelize[_0x1e3e('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x1e3e('0x4')]}}; \ No newline at end of file +var _0xe6bf=['BOOLEAN','exports','TEXT'];(function(_0x2a8c21,_0x163576){var _0x5f3061=function(_0x4dc8eb){while(--_0x4dc8eb){_0x2a8c21['push'](_0x2a8c21['shift']());}};_0x5f3061(++_0x163576);}(_0xe6bf,0x17b));var _0xfe6b=function(_0x54c42d,_0x23975d){_0x54c42d=_0x54c42d-0x0;var _0x16d161=_0xe6bf[_0x54c42d];return _0x16d161;};'use strict';var Sequelize=require('sequelize');module[_0xfe6b('0x0')]={'body':{'type':Sequelize[_0xfe6b('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0xfe6b('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xfe6b('0x2')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index c3cbd59..c7e7981 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ffc=['hasOwnProperty','text','Sequelize','ValidationError','view','Missing\x20\x27view\x27\x20parameter','recipients','Invalid\x20\x27recipients\x27\x20object','mailqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','senderName','recipientsDescription','isEmpty','beep','SenderId','recipientsId','join','UserNotification','create','forEach','recipient','userNotification:send','catch','findOne','html','TemplateId','Invalid\x20\x27TemplateId\x27\x20parameter','union','ids','queue','Queue','push','all','getAgents','map','rimraf','zip-dir','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','name','send','sendUserNotification','body'];(function(_0x1d1360,_0x2853bf){var _0x52ec85=function(_0x5856e7){while(--_0x5856e7){_0x1d1360['push'](_0x1d1360['shift']());}};_0x52ec85(++_0x2853bf);}(_0x1ffc,0x18a));var _0xc1ff=function(_0x4f8fee,_0x584996){_0x4f8fee=_0x4f8fee-0x0;var _0x80acf=_0x1ffc[_0x4f8fee];return _0x80acf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1ff('0x0'));var zipdir=require(_0xc1ff('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc1ff('0x2'));var moment=require(_0xc1ff('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc1ff('0x4'));var util=require('util');var path=require('path');var sox=require(_0xc1ff('0x5'));var csv=require('to-csv');var ejs=require(_0xc1ff('0x6'));var fs=require('fs');var fs_extra=require(_0xc1ff('0x7'));var _=require(_0xc1ff('0x8'));var squel=require('squel');var crypto=require(_0xc1ff('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc1ff('0xa'));var toCsv=require(_0xc1ff('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc1ff('0xc'));var authService=require(_0xc1ff('0xd'));var qs=require(_0xc1ff('0xe'));var as=require(_0xc1ff('0xf'));var hardwareService=require(_0xc1ff('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xc1ff('0x11'));var config=require(_0xc1ff('0x12'));var licenseUtil=require(_0xc1ff('0x13'));var db=require(_0xc1ff('0x14'))['db'];config[_0xc1ff('0x15')]=_[_0xc1ff('0x16')](config[_0xc1ff('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xc1ff('0x17'))(new Redis(config[_0xc1ff('0x15')]));require(_0xc1ff('0x18'))[_0xc1ff('0x19')](socket);function respondWithStatusCode(_0x1bfbf2,_0x558b64){_0x558b64=_0x558b64||0xcc;return function(_0x5c2d42){if(_0x5c2d42){return _0x1bfbf2[_0xc1ff('0x1a')](_0x558b64);}return _0x1bfbf2[_0xc1ff('0x1b')](_0x558b64)[_0xc1ff('0x1c')]();};}function respondWithResult(_0x9dba7f,_0x4eb6d2){_0x4eb6d2=_0x4eb6d2||0xc8;return function(_0x1783b4){if(_0x1783b4){return _0x9dba7f['status'](_0x4eb6d2)[_0xc1ff('0x1d')](_0x1783b4);}};}function respondWithFilteredResult(_0x4908d9,_0x510711){return function(_0x293a11){if(_0x293a11){var _0x21eac6=typeof _0x510711[_0xc1ff('0x1e')]==='undefined'&&typeof _0x510711[_0xc1ff('0x1f')]===_0xc1ff('0x20');var _0x5dab75=_0x293a11[_0xc1ff('0x21')];var _0x365826=_0x21eac6?0x0:_0x510711[_0xc1ff('0x1e')];var _0x1fecb1=_0x21eac6?_0x293a11[_0xc1ff('0x21')]:_0x510711[_0xc1ff('0x1e')]+_0x510711[_0xc1ff('0x1f')];var _0x12e93c;if(_0x1fecb1>=_0x5dab75){_0x1fecb1=_0x5dab75;_0x12e93c=0xc8;}else{_0x12e93c=0xce;}_0x4908d9[_0xc1ff('0x1b')](_0x12e93c);return _0x4908d9[_0xc1ff('0x22')](_0xc1ff('0x23'),_0x365826+'-'+_0x1fecb1+'/'+_0x5dab75)[_0xc1ff('0x1d')](_0x293a11);}return null;};}function patchUpdates(_0x4cb096){return function(_0x2cbd6b){try{jsonpatch[_0xc1ff('0x24')](_0x2cbd6b,_0x4cb096,!![]);}catch(_0x3e8636){return BPromise[_0xc1ff('0x25')](_0x3e8636);}return _0x2cbd6b['save']();};}function saveUpdates(_0x4e0e2a,_0x5c61ac){return function(_0x3fc611){if(_0x3fc611){return _0x3fc611[_0xc1ff('0x26')](_0x4e0e2a)['then'](function(_0x3f9210){return _0x3f9210;});}return null;};}function removeEntity(_0x5b209d,_0x362533){return function(_0x88cdbc){if(_0x88cdbc){return _0x88cdbc[_0xc1ff('0x27')]()[_0xc1ff('0x28')](function(){_0x5b209d[_0xc1ff('0x1b')](0xcc)[_0xc1ff('0x1c')]();});}};}function handleEntityNotFound(_0x2982ce,_0x142a5e){return function(_0x13cb49){if(!_0x13cb49){_0x2982ce[_0xc1ff('0x1a')](0x194);}return _0x13cb49;};}function handleError(_0x534381,_0x184c4f){_0x184c4f=_0x184c4f||0x1f4;return function(_0x320543){logger[_0xc1ff('0x29')](_0x320543['stack']);if(_0x320543[_0xc1ff('0x2a')]){delete _0x320543[_0xc1ff('0x2a')];}_0x534381[_0xc1ff('0x1b')](_0x184c4f)[_0xc1ff('0x2b')](_0x320543);};}exports[_0xc1ff('0x2c')]=function(_0x3246c4,_0x5a050e,_0x323d4c){if(!_0x3246c4[_0xc1ff('0x2d')][_0xc1ff('0x2e')](_0xc1ff('0x2f'))&&!_0x3246c4[_0xc1ff('0x2d')]['hasOwnProperty']('TemplateId')){throw new db[(_0xc1ff('0x30'))][(_0xc1ff('0x31'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x3246c4[_0xc1ff('0x2d')]['hasOwnProperty']('TemplateId')&&!_0x3246c4[_0xc1ff('0x2d')]['hasOwnProperty'](_0xc1ff('0x32'))){throw new db[(_0xc1ff('0x30'))][(_0xc1ff('0x31'))](_0xc1ff('0x33'));}if(!_0x3246c4[_0xc1ff('0x2d')]['hasOwnProperty'](_0xc1ff('0x34'))){throw new db['Sequelize'][(_0xc1ff('0x31'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x2dc8d1=JSON['parse'](_0x3246c4[_0xc1ff('0x2d')][_0xc1ff('0x34')]);}catch(_0x15b482){logger[_0xc1ff('0x29')](_0x15b482);throw new db[(_0xc1ff('0x30'))][(_0xc1ff('0x31'))](_0xc1ff('0x35'));}var _0x2be398=['chatqueue','faxqueue',_0xc1ff('0x36'),'openchannelqueue','smsqueue',_0xc1ff('0x37'),_0xc1ff('0x38'),_0xc1ff('0x39'),_0xc1ff('0x3a')];if(_[_0xc1ff('0x3b')](_0x2dc8d1,function(_0x406f36){return!_[_0xc1ff('0x3c')](_0x2be398,_0x406f36[_0xc1ff('0x3d')][_0xc1ff('0x3e')]());})){throw new db['Sequelize']['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x12e33a={};_0x12e33a[_0xc1ff('0x3f')]=_0x3246c4[_0xc1ff('0x2d')][_0xc1ff('0x2e')](_0xc1ff('0x3f'))?_0x3246c4[_0xc1ff('0x2d')][_0xc1ff('0x3f')]:_0x3246c4['user']['fullname'];_0x12e33a[_0xc1ff('0x40')]=_[_0xc1ff('0x41')](_0x3246c4['body'][_0xc1ff('0x40')])?null:_0x3246c4[_0xc1ff('0x2d')]['recipientsDescription'];_0x12e33a[_0xc1ff('0x42')]=_0x3246c4[_0xc1ff('0x2d')]['beep']||![];_0x12e33a[_0xc1ff('0x43')]=_0x3246c4[_0xc1ff('0x3a')]['id'];return getContent(_0x3246c4['body'])[_0xc1ff('0x28')](function(_0x578cc1){_0x12e33a['body']=_0x578cc1;return getRecipients(_0x2dc8d1);})[_0xc1ff('0x28')](function(_0x516d88){_0x12e33a[_0xc1ff('0x44')]=_['sortBy'](_0x516d88)[_0xc1ff('0x45')](',');return db['sequelize']['transaction'](function(_0x1d96de){return db[_0xc1ff('0x46')][_0xc1ff('0x47')](_0x12e33a,{'raw':!![],'transaction':_0x1d96de})['then'](function(_0x41205e){var _0x1961ad={'sender':_0x12e33a[_0xc1ff('0x3f')],'description':_0x12e33a[_0xc1ff('0x40')],'content':_0x12e33a[_0xc1ff('0x2d')],'beep':_0x12e33a[_0xc1ff('0x42')]};_0x516d88[_0xc1ff('0x48')](function(_0x13b87f){_0x1961ad[_0xc1ff('0x49')]=_0x13b87f;socket['emit'](_0xc1ff('0x4a'),_0x1961ad);});return _0x41205e;});});})['then'](respondWithResult(_0x5a050e,0xc9))[_0xc1ff('0x4b')](handleError(_0x5a050e,null));};function getContent(_0x5e3845){return new BPromise(function(_0x5f5863,_0x5cc49a){if(_0x5e3845[_0xc1ff('0x2f')]){_0x5f5863(_0x5e3845['text']);return;}return db['Template'][_0xc1ff('0x4c')]({'attributes':[_0xc1ff('0x4d')],'where':{'id':_0x5e3845[_0xc1ff('0x4e')]},'raw':!![]})[_0xc1ff('0x28')](function(_0x1583ad){if(!_0x1583ad)throw new db['Sequelize'][(_0xc1ff('0x31'))](_0xc1ff('0x4f'));var _0x3725f8=Mustache['render'](_0x1583ad[_0xc1ff('0x4d')],_0x5e3845[_0xc1ff('0x32')]);_0x5f5863(_0x3725f8);})[_0xc1ff('0x4b')](function(_0x5a4008){_0x5cc49a(_0x5a4008);});});}function getRecipients(_0x271618){return new BPromise(function(_0x33290c,_0x2e4e97){var _0x7f5586=[];var _0x534abe=[];_0x271618['forEach'](function(_0x3cad7d){var _0x11e46a=_['startCase'](_0x3cad7d[_0xc1ff('0x3d')][_0xc1ff('0x3e')]());if(_0x11e46a==='User'){_0x7f5586=_[_0xc1ff('0x50')](_0x7f5586,_0x3cad7d[_0xc1ff('0x51')]);}else{if(_[_0xc1ff('0x3c')](_0x11e46a,_0xc1ff('0x52')))_0x11e46a=_0x11e46a['replace'](_0xc1ff('0x52'),_0xc1ff('0x53'));_0x3cad7d[_0xc1ff('0x51')]['forEach'](function(_0x63ed28){_0x534abe[_0xc1ff('0x54')](getAgents(_0x11e46a,_0x63ed28));});}});return BPromise[_0xc1ff('0x55')](_0x534abe)[_0xc1ff('0x28')](function(_0x60b127){_0x7f5586=_['union'](_0x7f5586,_['flatten'](_0x60b127));_0x33290c(_0x7f5586);})['catch'](function(_0x4f7eed){_0x2e4e97(_0x4f7eed);});});}function getAgents(_0x2d1837,_0x5e41d4){return new BPromise(function(_0x594dcb,_0x272841){return db[_0x2d1837][_0xc1ff('0x4c')]({'where':{'id':_0x5e41d4}})[_0xc1ff('0x28')](function(_0x246214){return _0x246214[_0xc1ff('0x56')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2c753e){var _0x2023d1=_[_0xc1ff('0x57')](_0x2c753e,'id');_0x594dcb(_0x2023d1);});})[_0xc1ff('0x4b')](function(_0xbd3c9a){_0x272841(_0xbd3c9a);});});} \ No newline at end of file +var _0x05fa=['util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','redis','localhost','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','stack','name','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','UserNotification','forEach','recipient','userNotification:send','catch','Template','findOne','render','html','startCase','User','union','ids','replace','queue','Queue','all','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x34e220,_0x4085b4){var _0x2fa85c=function(_0x2a502e){while(--_0x2a502e){_0x34e220['push'](_0x34e220['shift']());}};_0x2fa85c(++_0x4085b4);}(_0x05fa,0x181));var _0xa05f=function(_0x55814d,_0x1668b8){_0x55814d=_0x55814d-0x0;var _0x54812e=_0x05fa[_0x55814d];return _0x54812e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa05f('0x0'));var zipdir=require(_0xa05f('0x1'));var jsonpatch=require(_0xa05f('0x2'));var rp=require(_0xa05f('0x3'));var moment=require(_0xa05f('0x4'));var BPromise=require(_0xa05f('0x5'));var Mustache=require(_0xa05f('0x6'));var util=require(_0xa05f('0x7'));var path=require(_0xa05f('0x8'));var sox=require(_0xa05f('0x9'));var csv=require(_0xa05f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa05f('0xb'));var squel=require(_0xa05f('0xc'));var crypto=require('crypto');var jsforce=require(_0xa05f('0xd'));var deskjs=require(_0xa05f('0xe'));var toCsv=require(_0xa05f('0xa'));var querystring=require(_0xa05f('0xf'));var Papa=require(_0xa05f('0x10'));var Redis=require(_0xa05f('0x11'));var authService=require(_0xa05f('0x12'));var qs=require(_0xa05f('0x13'));var as=require(_0xa05f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa05f('0x15'));var config=require(_0xa05f('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa05f('0x17')]=_['defaults'](config[_0xa05f('0x17')],{'host':_0xa05f('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa05f('0x17')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0xb6d30d,_0x2b8a32){_0x2b8a32=_0x2b8a32||0xcc;return function(_0x478635){if(_0x478635){return _0xb6d30d['sendStatus'](_0x2b8a32);}return _0xb6d30d[_0xa05f('0x19')](_0x2b8a32)[_0xa05f('0x1a')]();};}function respondWithResult(_0x4b5077,_0x5434d5){_0x5434d5=_0x5434d5||0xc8;return function(_0x25179b){if(_0x25179b){return _0x4b5077[_0xa05f('0x19')](_0x5434d5)['json'](_0x25179b);}};}function respondWithFilteredResult(_0x2847db,_0x47f05c){return function(_0x27209c){if(_0x27209c){var _0x223cf3=typeof _0x47f05c[_0xa05f('0x1b')]===_0xa05f('0x1c')&&typeof _0x47f05c[_0xa05f('0x1d')]===_0xa05f('0x1c');var _0x1d2418=_0x27209c[_0xa05f('0x1e')];var _0x32b88b=_0x223cf3?0x0:_0x47f05c[_0xa05f('0x1b')];var _0x249f65=_0x223cf3?_0x27209c[_0xa05f('0x1e')]:_0x47f05c[_0xa05f('0x1b')]+_0x47f05c[_0xa05f('0x1d')];var _0x121166;if(_0x249f65>=_0x1d2418){_0x249f65=_0x1d2418;_0x121166=0xc8;}else{_0x121166=0xce;}_0x2847db['status'](_0x121166);return _0x2847db[_0xa05f('0x1f')](_0xa05f('0x20'),_0x32b88b+'-'+_0x249f65+'/'+_0x1d2418)[_0xa05f('0x21')](_0x27209c);}return null;};}function patchUpdates(_0x52239d){return function(_0x413de9){try{jsonpatch['apply'](_0x413de9,_0x52239d,!![]);}catch(_0x289f2d){return BPromise[_0xa05f('0x22')](_0x289f2d);}return _0x413de9[_0xa05f('0x23')]();};}function saveUpdates(_0x4354fb,_0x3cd5c1){return function(_0x3444c3){if(_0x3444c3){return _0x3444c3[_0xa05f('0x24')](_0x4354fb)[_0xa05f('0x25')](function(_0x3f0a22){return _0x3f0a22;});}return null;};}function removeEntity(_0x24f78d,_0x55fd59){return function(_0x486239){if(_0x486239){return _0x486239[_0xa05f('0x26')]()[_0xa05f('0x25')](function(){_0x24f78d[_0xa05f('0x19')](0xcc)[_0xa05f('0x1a')]();});}};}function handleEntityNotFound(_0x471f65,_0x14d44a){return function(_0xe7f59d){if(!_0xe7f59d){_0x471f65[_0xa05f('0x27')](0x194);}return _0xe7f59d;};}function handleError(_0x527505,_0x1b4926){_0x1b4926=_0x1b4926||0x1f4;return function(_0x312614){logger[_0xa05f('0x28')](_0x312614[_0xa05f('0x29')]);if(_0x312614['name']){delete _0x312614[_0xa05f('0x2a')];}_0x527505[_0xa05f('0x19')](_0x1b4926)['send'](_0x312614);};}exports['sendUserNotification']=function(_0x59bf6c,_0x1daca8,_0x2ae1d1){if(!_0x59bf6c[_0xa05f('0x2b')][_0xa05f('0x2c')](_0xa05f('0x2d'))&&!_0x59bf6c[_0xa05f('0x2b')][_0xa05f('0x2c')](_0xa05f('0x2e'))){throw new db[(_0xa05f('0x2f'))][(_0xa05f('0x30'))](_0xa05f('0x31'));}else{if(_0x59bf6c['body']['hasOwnProperty'](_0xa05f('0x2e'))&&!_0x59bf6c[_0xa05f('0x2b')][_0xa05f('0x2c')](_0xa05f('0x32'))){throw new db[(_0xa05f('0x2f'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x59bf6c[_0xa05f('0x2b')][_0xa05f('0x2c')](_0xa05f('0x33'))){throw new db[(_0xa05f('0x2f'))]['ValidationError'](_0xa05f('0x34'));}else{try{var _0x3d7066=JSON[_0xa05f('0x35')](_0x59bf6c[_0xa05f('0x2b')][_0xa05f('0x33')]);}catch(_0x1fdaac){logger[_0xa05f('0x28')](_0x1fdaac);throw new db[(_0xa05f('0x2f'))][(_0xa05f('0x30'))](_0xa05f('0x36'));}var _0x56284e=[_0xa05f('0x37'),_0xa05f('0x38'),_0xa05f('0x39'),'openchannelqueue',_0xa05f('0x3a'),_0xa05f('0x3b'),_0xa05f('0x3c'),_0xa05f('0x3d'),_0xa05f('0x3e')];if(_[_0xa05f('0x3f')](_0x3d7066,function(_0x7decab){return!_[_0xa05f('0x40')](_0x56284e,_0x7decab[_0xa05f('0x41')][_0xa05f('0x42')]());})){throw new db[(_0xa05f('0x2f'))][(_0xa05f('0x30'))](_0xa05f('0x43'));}}}var _0x18da40={};_0x18da40[_0xa05f('0x44')]=_0x59bf6c[_0xa05f('0x2b')]['hasOwnProperty'](_0xa05f('0x44'))?_0x59bf6c[_0xa05f('0x2b')][_0xa05f('0x44')]:_0x59bf6c[_0xa05f('0x3e')][_0xa05f('0x45')];_0x18da40[_0xa05f('0x46')]=_[_0xa05f('0x47')](_0x59bf6c[_0xa05f('0x2b')][_0xa05f('0x46')])?null:_0x59bf6c[_0xa05f('0x2b')][_0xa05f('0x46')];_0x18da40[_0xa05f('0x48')]=_0x59bf6c['body'][_0xa05f('0x48')]||![];_0x18da40[_0xa05f('0x49')]=_0x59bf6c[_0xa05f('0x3e')]['id'];return getContent(_0x59bf6c[_0xa05f('0x2b')])[_0xa05f('0x25')](function(_0x304f94){_0x18da40[_0xa05f('0x2b')]=_0x304f94;return getRecipients(_0x3d7066);})[_0xa05f('0x25')](function(_0x32481b){_0x18da40[_0xa05f('0x4a')]=_[_0xa05f('0x4b')](_0x32481b)[_0xa05f('0x4c')](',');return db[_0xa05f('0x4d')]['transaction'](function(_0x2d1c7c){return db[_0xa05f('0x4e')]['create'](_0x18da40,{'raw':!![],'transaction':_0x2d1c7c})['then'](function(_0x1c74d8){var _0x230025={'sender':_0x18da40[_0xa05f('0x44')],'description':_0x18da40['recipientsDescription'],'content':_0x18da40[_0xa05f('0x2b')],'beep':_0x18da40[_0xa05f('0x48')]};_0x32481b[_0xa05f('0x4f')](function(_0x30618a){_0x230025[_0xa05f('0x50')]=_0x30618a;socket['emit'](_0xa05f('0x51'),_0x230025);});return _0x1c74d8;});});})[_0xa05f('0x25')](respondWithResult(_0x1daca8,0xc9))[_0xa05f('0x52')](handleError(_0x1daca8,null));};function getContent(_0x421fe2){return new BPromise(function(_0x2c4381,_0x1ed8ee){if(_0x421fe2[_0xa05f('0x2d')]){_0x2c4381(_0x421fe2[_0xa05f('0x2d')]);return;}return db[_0xa05f('0x53')][_0xa05f('0x54')]({'attributes':['html'],'where':{'id':_0x421fe2[_0xa05f('0x2e')]},'raw':!![]})[_0xa05f('0x25')](function(_0x361dab){if(!_0x361dab)throw new db[(_0xa05f('0x2f'))][(_0xa05f('0x30'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x361904=Mustache[_0xa05f('0x55')](_0x361dab[_0xa05f('0x56')],_0x421fe2[_0xa05f('0x32')]);_0x2c4381(_0x361904);})[_0xa05f('0x52')](function(_0x56e7a4){_0x1ed8ee(_0x56e7a4);});});}function getRecipients(_0x4eddc2){return new BPromise(function(_0xde3daa,_0x1d0605){var _0x2ee20f=[];var _0x46801f=[];_0x4eddc2['forEach'](function(_0x2103f5){var _0x3fa05a=_[_0xa05f('0x57')](_0x2103f5[_0xa05f('0x41')][_0xa05f('0x42')]());if(_0x3fa05a===_0xa05f('0x58')){_0x2ee20f=_[_0xa05f('0x59')](_0x2ee20f,_0x2103f5[_0xa05f('0x5a')]);}else{if(_[_0xa05f('0x40')](_0x3fa05a,'queue'))_0x3fa05a=_0x3fa05a[_0xa05f('0x5b')](_0xa05f('0x5c'),_0xa05f('0x5d'));_0x2103f5[_0xa05f('0x5a')][_0xa05f('0x4f')](function(_0x13e73c){_0x46801f['push'](getAgents(_0x3fa05a,_0x13e73c));});}});return BPromise[_0xa05f('0x5e')](_0x46801f)['then'](function(_0x123d2b){_0x2ee20f=_[_0xa05f('0x59')](_0x2ee20f,_[_0xa05f('0x5f')](_0x123d2b));_0xde3daa(_0x2ee20f);})[_0xa05f('0x52')](function(_0x56f59a){_0x1d0605(_0x56f59a);});});}function getAgents(_0x31ae77,_0x4f3738){return new BPromise(function(_0x318d39,_0x5b28ea){return db[_0x31ae77][_0xa05f('0x54')]({'where':{'id':_0x4f3738}})[_0xa05f('0x25')](function(_0x11ce64){return _0x11ce64[_0xa05f('0x60')]({'attributes':['id'],'raw':!![]})['then'](function(_0x100a23){var _0x343a87=_[_0xa05f('0x61')](_0x100a23,'id');_0x318d39(_0x343a87);});})[_0xa05f('0x52')](function(_0x33d402){_0x5b28ea(_0x33d402);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index b6b52ce..2df6260 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd728=['update','remove','emit','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x5ee843,_0x4c5c5a){var _0x50e683=function(_0x128cee){while(--_0x128cee){_0x5ee843['push'](_0x5ee843['shift']());}};_0x50e683(++_0x4c5c5a);}(_0xd728,0x18c));var _0x8d72=function(_0x2e8237,_0x2e82fa){_0x2e8237=_0x2e8237-0x0;var _0x10324b=_0xd728[_0x2e8237];return _0x10324b;};'use strict';var EventEmitter=require(_0x8d72('0x0'));var UserNotification=require(_0x8d72('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x8d72('0x2')](0x0);var events={'afterCreate':_0x8d72('0x3'),'afterUpdate':_0x8d72('0x4'),'afterDestroy':_0x8d72('0x5')};function emitEvent(_0x515aef){return function(_0x1aaf42,_0x199125,_0x42d202){UserNotificationEvents['emit'](_0x515aef+':'+_0x1aaf42['id'],_0x1aaf42);UserNotificationEvents[_0x8d72('0x6')](_0x515aef,_0x1aaf42);_0x42d202(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x8d72('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0xf509=['save','update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x4497b8,_0x2ce8b3){var _0x43a86f=function(_0x337cde){while(--_0x337cde){_0x4497b8['push'](_0x4497b8['shift']());}};_0x43a86f(++_0x2ce8b3);}(_0xf509,0x115));var _0x9f50=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0xf509[_0xd09668];return _0x68726;};'use strict';var EventEmitter=require(_0x9f50('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x9f50('0x1')](0x0);var events={'afterCreate':_0x9f50('0x2'),'afterUpdate':_0x9f50('0x3'),'afterDestroy':_0x9f50('0x4')};function emitEvent(_0x56ee64){return function(_0x9e69,_0x34bc76,_0x1f9e7f){UserNotificationEvents['emit'](_0x56ee64+':'+_0x9e69['id'],_0x9e69);UserNotificationEvents[_0x9f50('0x5')](_0x56ee64,_0x9e69);_0x1f9e7f(null);};}for(var e in events){if(events[_0x9f50('0x6')](e)){var event=events[e];UserNotification[_0x9f50('0x7')](e,emitEvent(event));}}module[_0x9f50('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 3db55a9..9fa02f4 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe96=['request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','userNotifications','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x152220,_0x38a858){var _0xcb20e2=function(_0x49cfdc){while(--_0x49cfdc){_0x152220['push'](_0x152220['shift']());}};_0xcb20e2(++_0x38a858);}(_0xbe96,0x1ec));var _0x6be9=function(_0x39a048,_0x865cc3){_0x39a048=_0x39a048-0x0;var _0xae44b9=_0xbe96[_0x39a048];return _0xae44b9;};'use strict';var _=require(_0x6be9('0x0'));var util=require(_0x6be9('0x1'));var logger=require(_0x6be9('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6be9('0x3'));var fs=require('fs');var path=require(_0x6be9('0x4'));var rimraf=require(_0x6be9('0x5'));var config=require(_0x6be9('0x6'));var attributes=require(_0x6be9('0x7'));module[_0x6be9('0x8')]=function(_0x1f0e15,_0x5beb55){return _0x1f0e15['define']('UserNotification',attributes,{'tableName':_0x6be9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6be9('0xa')});}; \ No newline at end of file +var _0xd90f=['rimraf','../../config/environment','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','path'];(function(_0x292a6f,_0x1413e4){var _0x3aefc4=function(_0x43a9bc){while(--_0x43a9bc){_0x292a6f['push'](_0x292a6f['shift']());}};_0x3aefc4(++_0x1413e4);}(_0xd90f,0x16f));var _0xfd90=function(_0x145479,_0x4a5bbe){_0x145479=_0x145479-0x0;var _0x3feb8f=_0xd90f[_0x145479];return _0x3feb8f;};'use strict';var _=require(_0xfd90('0x0'));var util=require('util');var logger=require(_0xfd90('0x1'))('api');var moment=require(_0xfd90('0x2'));var BPromise=require('bluebird');var rp=require(_0xfd90('0x3'));var fs=require('fs');var path=require(_0xfd90('0x4'));var rimraf=require(_0xfd90('0x5'));var config=require(_0xfd90('0x6'));var attributes=require('./userNotification.attributes');module['exports']=function(_0x539c9f,_0x1ab3be){return _0x539c9f[_0xfd90('0x7')](_0xfd90('0x8'),attributes,{'tableName':_0xfd90('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfd90('0xa'),'collate':_0xfd90('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index f1708e0..69916cd 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc59f=['stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5ad7d0,_0x5a0449){var _0x1df266=function(_0x2e5ddc){while(--_0x2e5ddc){_0x5ad7d0['push'](_0x5ad7d0['shift']());}};_0x1df266(++_0x5a0449);}(_0xc59f,0x69));var _0xfc59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc59f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfc59('0x0'));var util=require('util');var moment=require(_0xfc59('0x1'));var BPromise=require(_0xfc59('0x2'));var rs=require(_0xfc59('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfc59('0x4'));var logger=require(_0xfc59('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfc59('0x6'));var client=jayson[_0xfc59('0x7')][_0xfc59('0x8')]({'port':0x232a});config[_0xfc59('0x9')]=_[_0xfc59('0xa')](config['redis'],{'host':_0xfc59('0xb'),'port':0x18eb});var socket=require(_0xfc59('0xc'))(new Redis(config[_0xfc59('0x9')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x4c6adc,_0x5c483e,_0x2bef1d){return new BPromise(function(_0x4c089f,_0x51470f){return client[_0xfc59('0xd')](_0x4c6adc,_0x2bef1d)[_0xfc59('0xe')](function(_0x21f3cd){logger[_0xfc59('0xf')](_0xfc59('0x10'),_0x5c483e,'request\x20sent');logger[_0xfc59('0x11')](_0xfc59('0x12'),_0x5c483e,_0xfc59('0x13'),JSON[_0xfc59('0x14')](_0x21f3cd));if(_0x21f3cd[_0xfc59('0x15')]){if(_0x21f3cd[_0xfc59('0x15')][_0xfc59('0x16')]===0x1f4){logger[_0xfc59('0x15')](_0xfc59('0x10'),_0x5c483e,_0x21f3cd[_0xfc59('0x15')][_0xfc59('0x17')]);return _0x51470f(_0x21f3cd[_0xfc59('0x15')]['message']);}logger[_0xfc59('0x15')](_0xfc59('0x10'),_0x5c483e,_0x21f3cd['error']['message']);return _0x4c089f(_0x21f3cd[_0xfc59('0x15')][_0xfc59('0x17')]);}else{logger[_0xfc59('0xf')](_0xfc59('0x10'),_0x5c483e,_0xfc59('0x13'));_0x4c089f(_0x21f3cd['result']['message']);}})[_0xfc59('0x18')](function(_0x4b5efd){logger[_0xfc59('0x15')](_0xfc59('0x10'),_0x5c483e,_0x4b5efd);_0x51470f(_0x4b5efd);});});} \ No newline at end of file +var _0x6830=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x36e367,_0x14fd3f){var _0x496f69=function(_0x1a2519){while(--_0x1a2519){_0x36e367['push'](_0x36e367['shift']());}};_0x496f69(++_0x14fd3f);}(_0x6830,0xdb));var _0x0683=function(_0x373693,_0x22362f){_0x373693=_0x373693-0x0;var _0x261642=_0x6830[_0x373693];return _0x261642;};'use strict';var _=require(_0x0683('0x0'));var util=require(_0x0683('0x1'));var moment=require(_0x0683('0x2'));var BPromise=require(_0x0683('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0683('0x4'));var db=require(_0x0683('0x5'))['db'];var utils=require(_0x0683('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0683('0x7'));var jayson=require(_0x0683('0x8'));var client=jayson[_0x0683('0x9')][_0x0683('0xa')]({'port':0x232a});config['redis']=_[_0x0683('0xb')](config[_0x0683('0xc')],{'host':_0x0683('0xd'),'port':0x18eb});var socket=require(_0x0683('0xe'))(new Redis(config[_0x0683('0xc')]));require(_0x0683('0xf'))[_0x0683('0x10')](socket);function respondWithRpcPromise(_0x25fa57,_0x5310c9,_0x54b8cd){return new BPromise(function(_0x25af91,_0x293e0f){return client[_0x0683('0x11')](_0x25fa57,_0x54b8cd)[_0x0683('0x12')](function(_0x16bcf1){logger['info'](_0x0683('0x13'),_0x5310c9,'request\x20sent');logger[_0x0683('0x14')](_0x0683('0x15'),_0x5310c9,_0x0683('0x16'),JSON[_0x0683('0x17')](_0x16bcf1));if(_0x16bcf1[_0x0683('0x18')]){if(_0x16bcf1['error']['code']===0x1f4){logger[_0x0683('0x18')]('UserNotification,\x20%s,\x20%s',_0x5310c9,_0x16bcf1[_0x0683('0x18')]['message']);return _0x293e0f(_0x16bcf1[_0x0683('0x18')][_0x0683('0x19')]);}logger[_0x0683('0x18')]('UserNotification,\x20%s,\x20%s',_0x5310c9,_0x16bcf1[_0x0683('0x18')][_0x0683('0x19')]);return _0x25af91(_0x16bcf1[_0x0683('0x18')][_0x0683('0x19')]);}else{logger['info'](_0x0683('0x13'),_0x5310c9,_0x0683('0x16'));_0x25af91(_0x16bcf1[_0x0683('0x1a')][_0x0683('0x19')]);}})[_0x0683('0x1b')](function(_0x2e8a98){logger[_0x0683('0x18')](_0x0683('0x13'),_0x5310c9,_0x2e8a98);_0x293e0f(_0x2e8a98);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 4169f7e..28b220c 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x517b=['save','removeListener','length','userNotification:','./userNotification.events'];(function(_0x19e15b,_0x4ae0ee){var _0x3ed895=function(_0x36adb2){while(--_0x36adb2){_0x19e15b['push'](_0x19e15b['shift']());}};_0x3ed895(++_0x4ae0ee);}(_0x517b,0x180));var _0xb517=function(_0x9a7ea6,_0x1807a2){_0x9a7ea6=_0x9a7ea6-0x0;var _0x1c2040=_0x517b[_0x9a7ea6];return _0x1c2040;};'use strict';var UserNotificationEvents=require(_0xb517('0x0'));var events=[_0xb517('0x1'),'remove','update'];function createListener(_0x5236b0,_0x29c580){return function(_0x3daf6e){_0x29c580['emit'](_0x5236b0,_0x3daf6e);};}function removeListener(_0x2e9fc0,_0x2469f0){return function(){UserNotificationEvents[_0xb517('0x2')](_0x2e9fc0,_0x2469f0);};}exports['register']=function(_0x5be296){for(var _0x32c292=0x0,_0x516e01=events[_0xb517('0x3')];_0x32c292<_0x516e01;_0x32c292++){var _0x38e7bd=events[_0x32c292];var _0x45953f=createListener(_0xb517('0x4')+_0x38e7bd,_0x5be296);UserNotificationEvents['on'](_0x38e7bd,_0x45953f);}}; \ No newline at end of file +var _0xfb79=['./userNotification.events','remove','emit','removeListener','length','userNotification:'];(function(_0x315d32,_0x33485b){var _0x3ea98d=function(_0x4111ee){while(--_0x4111ee){_0x315d32['push'](_0x315d32['shift']());}};_0x3ea98d(++_0x33485b);}(_0xfb79,0x13e));var _0x9fb7=function(_0x23285f,_0x5529ce){_0x23285f=_0x23285f-0x0;var _0x1a5a34=_0xfb79[_0x23285f];return _0x1a5a34;};'use strict';var UserNotificationEvents=require(_0x9fb7('0x0'));var events=['save',_0x9fb7('0x1'),'update'];function createListener(_0x90e683,_0x466d83){return function(_0x53f158){_0x466d83[_0x9fb7('0x2')](_0x90e683,_0x53f158);};}function removeListener(_0xa332f3,_0x1b30b1){return function(){UserNotificationEvents[_0x9fb7('0x3')](_0xa332f3,_0x1b30b1);};}exports['register']=function(_0x282f15){for(var _0xc3e066=0x0,_0x28bf14=events[_0x9fb7('0x4')];_0xc3e066<_0x28bf14;_0xc3e066++){var _0x35ad21=events[_0xc3e066];var _0x14699f=createListener(_0x9fb7('0x5')+_0x35ad21,_0x282f15);UserNotificationEvents['on'](_0x35ad21,_0x14699f);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index e51e3e4..07e1b78 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1ba691,_0x59087e){var _0xa6091c=function(_0x17d848){while(--_0x17d848){_0x1ba691['push'](_0x1ba691['shift']());}};_0xa6091c(++_0x59087e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x51d803,_0x19833b){var _0x1db442=function(_0xac1dd9){while(--_0xac1dd9){_0x51d803['push'](_0x51d803['shift']());}};_0x1db442(++_0x19833b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0xcb91[_0x4067ac];return _0x53d74d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 3cee1f5..de35345 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3204=['exports','INTEGER','sequelize'];(function(_0x1d14c0,_0x172b90){var _0x3210a0=function(_0x1445c1){while(--_0x1445c1){_0x1d14c0['push'](_0x1d14c0['shift']());}};_0x3210a0(++_0x172b90);}(_0x3204,0x12e));var _0x4320=function(_0x44a79b,_0x3189b7){_0x44a79b=_0x44a79b-0x0;var _0x510c12=_0x3204[_0x44a79b];return _0x510c12;};'use strict';var Sequelize=require(_0x4320('0x0'));module[_0x4320('0x1')]={'penalty':{'type':Sequelize[_0x4320('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x79fc=['INTEGER','exports'];(function(_0x235a06,_0x3cf173){var _0x1978a5=function(_0x3d591b){while(--_0x3d591b){_0x235a06['push'](_0x235a06['shift']());}};_0x1978a5(++_0x3cf173);}(_0x79fc,0x1db));var _0xc79f=function(_0x36c174,_0xa233ec){_0x36c174=_0x36c174-0x0;var _0x4ec6c3=_0x79fc[_0x36c174];return _0x4ec6c3;};'use strict';var Sequelize=require('sequelize');module[_0xc79f('0x0')]={'penalty':{'type':Sequelize[_0xc79f('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 14e92ff..6d5e191 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bda=['api','bluebird','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util'];(function(_0x40a41b,_0x1bd593){var _0x362967=function(_0x9e6719){while(--_0x9e6719){_0x40a41b['push'](_0x40a41b['shift']());}};_0x362967(++_0x1bd593);}(_0x0bda,0xc4));var _0xa0bd=function(_0x54f776,_0x22f07d){_0x54f776=_0x54f776-0x0;var _0x5ea3d4=_0x0bda[_0x54f776];return _0x5ea3d4;};'use strict';var _=require(_0xa0bd('0x0'));var util=require(_0xa0bd('0x1'));var logger=require('../../config/logger')(_0xa0bd('0x2'));var moment=require('moment');var BPromise=require(_0xa0bd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0bd('0x4'));var rimraf=require(_0xa0bd('0x5'));var config=require(_0xa0bd('0x6'));var attributes=require(_0xa0bd('0x7'));module[_0xa0bd('0x8')]=function(_0x5b3fbe,_0x4e8364){return _0x5b3fbe['define'](_0xa0bd('0x9'),attributes,{'tableName':_0xa0bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ff4=['../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','request-promise','path','rimraf'];(function(_0xddf1d8,_0x1f2964){var _0x500ed9=function(_0x305777){while(--_0x305777){_0xddf1d8['push'](_0xddf1d8['shift']());}};_0x500ed9(++_0x1f2964);}(_0x0ff4,0x171));var _0x40ff=function(_0x46bfe1,_0x42d186){_0x46bfe1=_0x46bfe1-0x0;var _0x42c931=_0x0ff4[_0x46bfe1];return _0x42c931;};'use strict';var _=require(_0x40ff('0x0'));var util=require(_0x40ff('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x40ff('0x2'));var fs=require('fs');var path=require(_0x40ff('0x3'));var rimraf=require(_0x40ff('0x4'));var config=require(_0x40ff('0x5'));var attributes=require(_0x40ff('0x6'));module[_0x40ff('0x7')]=function(_0x5409e2,_0x346595){return _0x5409e2[_0x40ff('0x8')](_0x40ff('0x9'),attributes,{'tableName':_0x40ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 0906ebd..2c02c3a 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f56=['message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','UserOpenchannelQueue,\x20%s,\x20%s','error'];(function(_0xae0006,_0x3853f7){var _0x4e75e5=function(_0x37866c){while(--_0x37866c){_0xae0006['push'](_0xae0006['shift']());}};_0x4e75e5(++_0x3853f7);}(_0x2f56,0xbe));var _0x62f5=function(_0x5cc8b8,_0x314135){_0x5cc8b8=_0x5cc8b8-0x0;var _0x44e08f=_0x2f56[_0x5cc8b8];return _0x44e08f;};'use strict';var _=require(_0x62f5('0x0'));var util=require(_0x62f5('0x1'));var moment=require(_0x62f5('0x2'));var BPromise=require(_0x62f5('0x3'));var rs=require(_0x62f5('0x4'));var fs=require('fs');var Redis=require(_0x62f5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x62f5('0x6'));var logger=require(_0x62f5('0x7'))('rpc');var config=require(_0x62f5('0x8'));var jayson=require(_0x62f5('0x9'));var client=jayson[_0x62f5('0xa')][_0x62f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19148f,_0x18b782,_0x43b536){return new BPromise(function(_0x3915b6,_0x3bab04){return client[_0x62f5('0xc')](_0x19148f,_0x43b536)[_0x62f5('0xd')](function(_0x34d4e1){logger[_0x62f5('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x18b782,_0x62f5('0xf'));logger['debug'](_0x62f5('0x10'),_0x18b782,_0x62f5('0xf'),JSON[_0x62f5('0x11')](_0x34d4e1));if(_0x34d4e1['error']){if(_0x34d4e1['error']['code']===0x1f4){logger['error'](_0x62f5('0x12'),_0x18b782,_0x34d4e1[_0x62f5('0x13')]['message']);return _0x3bab04(_0x34d4e1[_0x62f5('0x13')][_0x62f5('0x14')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x18b782,_0x34d4e1[_0x62f5('0x13')]['message']);return _0x3915b6(_0x34d4e1[_0x62f5('0x13')][_0x62f5('0x14')]);}else{logger['info'](_0x62f5('0x12'),_0x18b782,_0x62f5('0xf'));_0x3915b6(_0x34d4e1['result'][_0x62f5('0x14')]);}})['catch'](function(_0x437a30){logger[_0x62f5('0x13')](_0x62f5('0x12'),_0x18b782,_0x437a30);_0x3bab04(_0x437a30);});});} \ No newline at end of file +var _0x8de2=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring'];(function(_0x3d6965,_0x366f4f){var _0x2c9b71=function(_0x4e5be5){while(--_0x4e5be5){_0x3d6965['push'](_0x3d6965['shift']());}};_0x2c9b71(++_0x366f4f);}(_0x8de2,0x97));var _0x28de=function(_0x468d57,_0x454592){_0x468d57=_0x468d57-0x0;var _0xec92fb=_0x8de2[_0x468d57];return _0xec92fb;};'use strict';var _=require(_0x28de('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x28de('0x1'));var rs=require(_0x28de('0x2'));var fs=require('fs');var Redis=require(_0x28de('0x3'));var db=require(_0x28de('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x28de('0x5'))(_0x28de('0x6'));var config=require(_0x28de('0x7'));var jayson=require(_0x28de('0x8'));var client=jayson[_0x28de('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x342097,_0x1b133b,_0x31ff63){return new BPromise(function(_0xc626c8,_0x5e9547){return client[_0x28de('0xa')](_0x342097,_0x31ff63)[_0x28de('0xb')](function(_0x40a0ff){logger[_0x28de('0xc')](_0x28de('0xd'),_0x1b133b,_0x28de('0xe'));logger[_0x28de('0xf')](_0x28de('0x10'),_0x1b133b,_0x28de('0xe'),JSON[_0x28de('0x11')](_0x40a0ff));if(_0x40a0ff[_0x28de('0x12')]){if(_0x40a0ff['error'][_0x28de('0x13')]===0x1f4){logger[_0x28de('0x12')](_0x28de('0xd'),_0x1b133b,_0x40a0ff[_0x28de('0x12')][_0x28de('0x14')]);return _0x5e9547(_0x40a0ff[_0x28de('0x12')][_0x28de('0x14')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x1b133b,_0x40a0ff[_0x28de('0x12')][_0x28de('0x14')]);return _0xc626c8(_0x40a0ff['error'][_0x28de('0x14')]);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x1b133b,_0x28de('0xe'));_0xc626c8(_0x40a0ff[_0x28de('0x15')][_0x28de('0x14')]);}})['catch'](function(_0x3cd992){logger['error'](_0x28de('0xd'),_0x1b133b,_0x3cd992);_0x5e9547(_0x3cd992);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index ad3e2f4..72258b6 100644 --- a/server/api/userProfile/index.js +++ b/server/api/userProfile/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x273e=['describe','/:id','show','/:id/sections','getSections','getResources','create','/:id/clone','clone','post','addSections','addResources','put','update','delete','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','../../components/auth/service','get','isAuthenticated','index','/describe'];(function(_0xb0a407,_0x336731){var _0x19bbc2=function(_0x5580e5){while(--_0x5580e5){_0xb0a407['push'](_0xb0a407['shift']());}};_0x19bbc2(++_0x336731);}(_0x273e,0x66));var _0xe273=function(_0x6e688e,_0x2fdda5){_0x6e688e=_0x6e688e-0x0;var _0x45eec5=_0x273e[_0x6e688e];return _0x45eec5;};'use strict';var multer=require(_0xe273('0x0'));var util=require(_0xe273('0x1'));var path=require(_0xe273('0x2'));var timeout=require(_0xe273('0x3'));var express=require(_0xe273('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe273('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfile.controller');router[_0xe273('0x6')]('/',auth[_0xe273('0x7')](),controller[_0xe273('0x8')]);router[_0xe273('0x6')](_0xe273('0x9'),auth[_0xe273('0x7')](),controller[_0xe273('0xa')]);router[_0xe273('0x6')](_0xe273('0xb'),auth[_0xe273('0x7')](),controller[_0xe273('0xc')]);router['get'](_0xe273('0xd'),auth[_0xe273('0x7')](),controller[_0xe273('0xe')]);router['get']('/:id/resources',auth[_0xe273('0x7')](),controller[_0xe273('0xf')]);router['post']('/',auth[_0xe273('0x7')](),controller[_0xe273('0x10')]);router['post'](_0xe273('0x11'),auth['isAuthenticated'](),controller[_0xe273('0x12')]);router[_0xe273('0x13')](_0xe273('0xd'),auth[_0xe273('0x7')](),controller[_0xe273('0x14')]);router[_0xe273('0x13')]('/:id/resources',auth[_0xe273('0x7')](),controller[_0xe273('0x15')]);router[_0xe273('0x16')](_0xe273('0xb'),auth[_0xe273('0x7')](),controller[_0xe273('0x17')]);router[_0xe273('0x18')](_0xe273('0xb'),auth[_0xe273('0x7')](),controller['destroy']);router['delete'](_0xe273('0xd'),auth[_0xe273('0x7')](),controller[_0xe273('0x19')]);router['delete']('/:id/resources',auth['isAuthenticated'](),controller[_0xe273('0x1a')]);module[_0xe273('0x1b')]=router; \ No newline at end of file +var _0xa0f3=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','/:id','show','getSections','post','create','/:id/clone','/:id/sections','/:id/resources','addResources','put','update','delete','destroy','removeResources','exports','multer'];(function(_0x3438e5,_0x549b1f){var _0x224aea=function(_0x34bcfe){while(--_0x34bcfe){_0x3438e5['push'](_0x3438e5['shift']());}};_0x224aea(++_0x549b1f);}(_0xa0f3,0x13e));var _0x3a0f=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa0f3[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x3a0f('0x0'));var util=require('util');var path=require(_0x3a0f('0x1'));var timeout=require(_0x3a0f('0x2'));var express=require(_0x3a0f('0x3'));var router=express[_0x3a0f('0x4')]();var fs_extra=require(_0x3a0f('0x5'));var auth=require(_0x3a0f('0x6'));var interaction=require(_0x3a0f('0x7'));var config=require(_0x3a0f('0x8'));var controller=require(_0x3a0f('0x9'));router[_0x3a0f('0xa')]('/',auth[_0x3a0f('0xb')](),controller[_0x3a0f('0xc')]);router[_0x3a0f('0xa')](_0x3a0f('0xd'),auth[_0x3a0f('0xb')](),controller['describe']);router[_0x3a0f('0xa')](_0x3a0f('0xe'),auth[_0x3a0f('0xb')](),controller[_0x3a0f('0xf')]);router[_0x3a0f('0xa')]('/:id/sections',auth[_0x3a0f('0xb')](),controller[_0x3a0f('0x10')]);router[_0x3a0f('0xa')]('/:id/resources',auth[_0x3a0f('0xb')](),controller['getResources']);router[_0x3a0f('0x11')]('/',auth[_0x3a0f('0xb')](),controller[_0x3a0f('0x12')]);router[_0x3a0f('0x11')](_0x3a0f('0x13'),auth[_0x3a0f('0xb')](),controller['clone']);router['post'](_0x3a0f('0x14'),auth[_0x3a0f('0xb')](),controller['addSections']);router[_0x3a0f('0x11')](_0x3a0f('0x15'),auth[_0x3a0f('0xb')](),controller[_0x3a0f('0x16')]);router[_0x3a0f('0x17')](_0x3a0f('0xe'),auth[_0x3a0f('0xb')](),controller[_0x3a0f('0x18')]);router[_0x3a0f('0x19')](_0x3a0f('0xe'),auth[_0x3a0f('0xb')](),controller[_0x3a0f('0x1a')]);router['delete'](_0x3a0f('0x14'),auth[_0x3a0f('0xb')](),controller['removeSections']);router[_0x3a0f('0x19')](_0x3a0f('0x15'),auth[_0x3a0f('0xb')](),controller[_0x3a0f('0x1b')]);module[_0x3a0f('0x1c')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 6e0c96c..5ce8161 100644 --- a/server/api/userProfile/userProfile.attributes.js +++ b/server/api/userProfile/userProfile.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x69d2=['sequelize','exports','STRING','name','join','getDataValue','crudPermissions','split','BOOLEAN'];(function(_0x3b696f,_0x16de59){var _0x1539c9=function(_0x3fe442){while(--_0x3fe442){_0x3b696f['push'](_0x3b696f['shift']());}};_0x1539c9(++_0x16de59);}(_0x69d2,0x99));var _0x269d=function(_0x1b97c6,_0x337ad0){_0x1b97c6=_0x1b97c6-0x0;var _0x243850=_0x69d2[_0x1b97c6];return _0x243850;};'use strict';var Sequelize=require(_0x269d('0x0'));module[_0x269d('0x1')]={'name':{'type':Sequelize[_0x269d('0x2')],'allowNull':![],'unique':_0x269d('0x3')},'crudPermissions':{'type':Sequelize[_0x269d('0x2')],'set':function(_0x511fdd){this['setDataValue']('crudPermissions',_0x511fdd?_0x511fdd[_0x269d('0x4')](''):[]);},'get':function(){return this[_0x269d('0x5')](_0x269d('0x6'))?this[_0x269d('0x5')]('crudPermissions')[_0x269d('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x269d('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x269d('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x269d('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x269d('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x269d('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x269d('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x269d('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa489=['setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','STRING','name'];(function(_0xe13624,_0x350368){var _0x2abc5a=function(_0x5e38e5){while(--_0x5e38e5){_0xe13624['push'](_0xe13624['shift']());}};_0x2abc5a(++_0x350368);}(_0xa489,0x192));var _0x9a48=function(_0x180ad0,_0x23031b){_0x180ad0=_0x180ad0-0x0;var _0x546a16=_0xa489[_0x180ad0];return _0x546a16;};'use strict';var Sequelize=require(_0x9a48('0x0'));module['exports']={'name':{'type':Sequelize[_0x9a48('0x1')],'allowNull':![],'unique':_0x9a48('0x2')},'crudPermissions':{'type':Sequelize[_0x9a48('0x1')],'set':function(_0x5a5c29){this[_0x9a48('0x3')](_0x9a48('0x4'),_0x5a5c29?_0x5a5c29[_0x9a48('0x5')](''):[]);},'get':function(){return this[_0x9a48('0x6')](_0x9a48('0x4'))?this['getDataValue']('crudPermissions')[_0x9a48('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x9a48('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x9a48('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x9a48('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x9a48('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x9a48('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x9a48('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x9a48('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index a1f5b25..96ec264 100644 --- a/server/api/userProfile/userProfile.controller.js +++ b/server/api/userProfile/userProfile.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x534e=['concat','autoAssociation','findOne','Dashboard','forEach','resourceId','Plugin','userProfileId','bulkCreate','get','removeResources','getResources','section','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','then','destroy','end','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','findAll','rows','catch','show','include','options','find','create','body','clone','includeAll','updatedAt','crudPermissions','omit','sequelize','transaction','UserProfileSection','each','UserProfileResource','createdAt','Resources','update','params','describe','sectionId','push','removeSections','ids','getSections','enabled','includes','subsections'];(function(_0x339dd4,_0x4c1563){var _0x10992f=function(_0x44a770){while(--_0x44a770){_0x339dd4['push'](_0x339dd4['shift']());}};_0x10992f(++_0x4c1563);}(_0x534e,0x16e));var _0xe534=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0x534e[_0x296897];return _0x2b44ab;};'use strict';var emlformat=require(_0xe534('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe534('0x1'));var jsonpatch=require(_0xe534('0x2'));var rp=require(_0xe534('0x3'));var moment=require(_0xe534('0x4'));var BPromise=require(_0xe534('0x5'));var Mustache=require(_0xe534('0x6'));var util=require(_0xe534('0x7'));var path=require(_0xe534('0x8'));var sox=require('sox');var csv=require(_0xe534('0x9'));var ejs=require(_0xe534('0xa'));var fs=require('fs');var fs_extra=require(_0xe534('0xb'));var _=require(_0xe534('0xc'));var squel=require('squel');var crypto=require(_0xe534('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe534('0xe'));var toCsv=require(_0xe534('0x9'));var querystring=require('querystring');var Papa=require(_0xe534('0xf'));var Redis=require(_0xe534('0x10'));var authService=require(_0xe534('0x11'));var qs=require(_0xe534('0x12'));var as=require(_0xe534('0x13'));var hardwareService=require(_0xe534('0x14'));var logger=require(_0xe534('0x15'))(_0xe534('0x16'));var utils=require('../../config/utils');var config=require(_0xe534('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe534('0x18'))['db'];config[_0xe534('0x19')]=_['defaults'](config[_0xe534('0x19')],{'host':_0xe534('0x1a'),'port':0x18eb});var socket=require(_0xe534('0x1b'))(new Redis(config[_0xe534('0x19')]));require('./userProfile.socket')[_0xe534('0x1c')](socket);function respondWithStatusCode(_0x3f0c50,_0x4eea54){_0x4eea54=_0x4eea54||0xcc;return function(_0x4693da){if(_0x4693da){return _0x3f0c50[_0xe534('0x1d')](_0x4eea54);}return _0x3f0c50[_0xe534('0x1e')](_0x4eea54)['end']();};}function respondWithResult(_0x256adf,_0x4d99b8){_0x4d99b8=_0x4d99b8||0xc8;return function(_0xcc1066){if(_0xcc1066){return _0x256adf['status'](_0x4d99b8)['json'](_0xcc1066);}};}function respondWithFilteredResult(_0x3cf0ce,_0x46c7bf){return function(_0x1f7bc5){if(_0x1f7bc5){var _0x2c5fd3=typeof _0x46c7bf[_0xe534('0x1f')]==='undefined'&&typeof _0x46c7bf[_0xe534('0x20')]===_0xe534('0x21');var _0x469db9=_0x1f7bc5[_0xe534('0x22')];var _0xa0f42c=_0x2c5fd3?0x0:_0x46c7bf['offset'];var _0x49bf5f=_0x2c5fd3?_0x1f7bc5['count']:_0x46c7bf[_0xe534('0x1f')]+_0x46c7bf[_0xe534('0x20')];var _0x5be0a2;if(_0x49bf5f>=_0x469db9){_0x49bf5f=_0x469db9;_0x5be0a2=0xc8;}else{_0x5be0a2=0xce;}_0x3cf0ce[_0xe534('0x1e')](_0x5be0a2);return _0x3cf0ce[_0xe534('0x23')](_0xe534('0x24'),_0xa0f42c+'-'+_0x49bf5f+'/'+_0x469db9)[_0xe534('0x25')](_0x1f7bc5);}return null;};}function patchUpdates(_0x5bd5a9){return function(_0x45f4a4){try{jsonpatch[_0xe534('0x26')](_0x45f4a4,_0x5bd5a9,!![]);}catch(_0x1136f8){return BPromise[_0xe534('0x27')](_0x1136f8);}return _0x45f4a4['save']();};}function saveUpdates(_0x54c39c,_0x50cf6f){return function(_0x563246){if(_0x563246){return _0x563246['update'](_0x54c39c)[_0xe534('0x28')](function(_0x4042b3){return _0x4042b3;});}return null;};}function removeEntity(_0x34129f,_0x386347){return function(_0x17c270){if(_0x17c270){return _0x17c270[_0xe534('0x29')]()['then'](function(){_0x34129f[_0xe534('0x1e')](0xcc)[_0xe534('0x2a')]();});}};}function handleEntityNotFound(_0x2020b0,_0x51401c){return function(_0x219e29){if(!_0x219e29){_0x2020b0[_0xe534('0x1d')](0x194);}return _0x219e29;};}function handleError(_0x1c449c,_0x3c172a){_0x3c172a=_0x3c172a||0x1f4;return function(_0x7cc7ea){logger[_0xe534('0x2b')](_0x7cc7ea[_0xe534('0x2c')]);if(_0x7cc7ea[_0xe534('0x2d')]){delete _0x7cc7ea[_0xe534('0x2d')];}_0x1c449c[_0xe534('0x1e')](_0x3c172a)[_0xe534('0x2e')](_0x7cc7ea);};}exports[_0xe534('0x2f')]=function(_0x2d4f6d,_0x550fee){var _0x55b9ab={},_0x542581={},_0x30355e={'count':0x0,'rows':[]};var _0x1375d3=_[_0xe534('0x30')](db[_0xe534('0x31')][_0xe534('0x32')],function(_0x417631){return{'name':_0x417631[_0xe534('0x33')],'type':_0x417631[_0xe534('0x34')][_0xe534('0x35')]};});_0x542581[_0xe534('0x36')]=_[_0xe534('0x30')](_0x1375d3,_0xe534('0x2d'));_0x542581[_0xe534('0x37')]=_[_0xe534('0x38')](_0x2d4f6d['query']);_0x542581['filters']=_[_0xe534('0x39')](_0x542581[_0xe534('0x36')],_0x542581[_0xe534('0x37')]);_0x55b9ab[_0xe534('0x3a')]=_[_0xe534('0x39')](_0x542581[_0xe534('0x36')],qs[_0xe534('0x3b')](_0x2d4f6d[_0xe534('0x37')][_0xe534('0x3b')]));_0x55b9ab[_0xe534('0x3a')]=_0x55b9ab[_0xe534('0x3a')][_0xe534('0x3c')]?_0x55b9ab['attributes']:_0x542581[_0xe534('0x36')];if(!_0x2d4f6d['query'][_0xe534('0x3d')]('nolimit')){_0x55b9ab[_0xe534('0x20')]=qs['limit'](_0x2d4f6d['query'][_0xe534('0x20')]);_0x55b9ab[_0xe534('0x1f')]=qs[_0xe534('0x1f')](_0x2d4f6d[_0xe534('0x37')][_0xe534('0x1f')]);}_0x55b9ab[_0xe534('0x3e')]=qs['sort'](_0x2d4f6d[_0xe534('0x37')][_0xe534('0x3f')]);_0x55b9ab['where']=qs[_0xe534('0x40')](_[_0xe534('0x41')](_0x2d4f6d[_0xe534('0x37')],_0x542581[_0xe534('0x40')]),_0x1375d3);if(_0x2d4f6d[_0xe534('0x37')][_0xe534('0x42')]){_0x55b9ab[_0xe534('0x43')]=_[_0xe534('0x44')](_0x55b9ab[_0xe534('0x43')],{'$or':_['map'](_0x1375d3,function(_0x58ef6e){if(_0x58ef6e[_0xe534('0x34')]!==_0xe534('0x45')){var _0x5e35cb={};_0x5e35cb[_0x58ef6e['name']]={'$like':'%'+_0x2d4f6d[_0xe534('0x37')][_0xe534('0x42')]+'%'};return _0x5e35cb;}})});}_0x55b9ab=_[_0xe534('0x44')]({},_0x55b9ab,_0x2d4f6d['options']);var _0x5b8273={'where':_0x55b9ab[_0xe534('0x43')]};return db[_0xe534('0x31')][_0xe534('0x22')](_0x5b8273)[_0xe534('0x28')](function(_0x5955eb){_0x30355e[_0xe534('0x22')]=_0x5955eb;if(_0x2d4f6d[_0xe534('0x37')]['includeAll']){_0x55b9ab['include']=[{'all':!![]}];}return db[_0xe534('0x31')][_0xe534('0x46')](_0x55b9ab);})['then'](function(_0x43bc28){_0x30355e[_0xe534('0x47')]=_0x43bc28;return _0x30355e;})[_0xe534('0x28')](respondWithFilteredResult(_0x550fee,_0x55b9ab))[_0xe534('0x48')](handleError(_0x550fee,null));};exports[_0xe534('0x49')]=function(_0x135ae8,_0x9d5623){var _0x58ba26={'raw':![],'where':{'id':_0x135ae8['params']['id']}},_0x22d51b={};_0x22d51b[_0xe534('0x36')]=_['keys'](db['UserProfile']['rawAttributes']);_0x22d51b[_0xe534('0x37')]=_[_0xe534('0x38')](_0x135ae8[_0xe534('0x37')]);_0x22d51b[_0xe534('0x40')]=_['intersection'](_0x22d51b[_0xe534('0x36')],_0x22d51b[_0xe534('0x37')]);_0x58ba26[_0xe534('0x3a')]=_['intersection'](_0x22d51b['model'],qs[_0xe534('0x3b')](_0x135ae8[_0xe534('0x37')][_0xe534('0x3b')]));_0x58ba26[_0xe534('0x3a')]=_0x58ba26[_0xe534('0x3a')][_0xe534('0x3c')]?_0x58ba26[_0xe534('0x3a')]:_0x22d51b[_0xe534('0x36')];if(_0x135ae8[_0xe534('0x37')]['includeAll']){_0x58ba26[_0xe534('0x4a')]=[{'all':!![]}];}_0x58ba26=_[_0xe534('0x44')]({},_0x58ba26,_0x135ae8[_0xe534('0x4b')]);return db['UserProfile'][_0xe534('0x4c')](_0x58ba26)[_0xe534('0x28')](handleEntityNotFound(_0x9d5623,null))['then'](respondWithResult(_0x9d5623,null))[_0xe534('0x48')](handleError(_0x9d5623,null));};exports[_0xe534('0x4d')]=function(_0x3748d0,_0xf98979){return db[_0xe534('0x31')]['create'](_0x3748d0[_0xe534('0x4e')],{})['then'](respondWithResult(_0xf98979,0xc9))['catch'](handleError(_0xf98979,null));};exports[_0xe534('0x4f')]=function(_0x290594,_0x4aa3ef){var _0x68dcc4={'where':{'id':_0x290594['params']['id']}},_0x199161={};_0x199161[_0xe534('0x36')]=_[_0xe534('0x38')](db[_0xe534('0x31')]['rawAttributes']);_0x68dcc4[_0xe534('0x3a')]=_['intersection'](_0x199161[_0xe534('0x36')],qs[_0xe534('0x3b')](_0x290594['query'][_0xe534('0x3b')]));_0x68dcc4[_0xe534('0x3a')]=_0x68dcc4['attributes'][_0xe534('0x3c')]?_0x68dcc4[_0xe534('0x3a')]:_0x199161['model'];if(_0x290594[_0xe534('0x37')][_0xe534('0x50')]){_0x68dcc4[_0xe534('0x4a')]=[{'all':!![]}];}_0x68dcc4=_['merge']({},_0x68dcc4,_0x290594[_0xe534('0x4b')]);return db[_0xe534('0x31')][_0xe534('0x4c')](_0x68dcc4)[_0xe534('0x28')](handleEntityNotFound(_0x4aa3ef,null))['then'](function(_0x411b6b){if(_0x411b6b){var _0x1d8abc=_0x411b6b['get']({'plain':!![]});_0x1d8abc=qs['omit'](_0x1d8abc,['id','createdAt',_0xe534('0x51'),_0xe534('0x52')]);_0x290594[_0xe534('0x4e')]=_[_0xe534('0x53')](_0x290594['body'],['id','createdAt',_0xe534('0x51')]);return db[_0xe534('0x54')][_0xe534('0x55')](function(_0x3be7f0){return db[_0xe534('0x31')][_0xe534('0x4d')](_[_0xe534('0x44')](_0x1d8abc,_0x290594[_0xe534('0x4e')]),{'include':_0x290594[_0xe534('0x37')][_0xe534('0x50')]?[{'all':!![]}]:undefined,'transaction':_0x3be7f0})[_0xe534('0x28')](function(_0x80da06){var _0x391372=_0x80da06['get']({'plain':!![]});return db[_0xe534('0x56')][_0xe534('0x46')]({'where':{'userProfileId':_0x290594['params']['id']},'raw':!![]})[_0xe534('0x28')](function(_0x47b3d6){if(_0x47b3d6){return BPromise[_0xe534('0x57')](_0x47b3d6,function(_0x28fbf9){return new BPromise(function(_0xa9a285,_0x2f912b){if(_0x28fbf9['autoAssociation']===null||_0x28fbf9['autoAssociation']===0x1)_0xa9a285(null);return db[_0xe534('0x58')][_0xe534('0x46')]({'where':{'sectionId':_0x28fbf9['id']},'raw':!![]})['then'](function(_0x55ddec){var _0x508e83=_[_0xe534('0x30')](_0x55ddec,function(_0x3bb9ab){return qs['omit'](_0x3bb9ab,['id','createdAt',_0xe534('0x51'),'sectionId']);});_0xa9a285(_0x508e83);})[_0xe534('0x48')](function(_0x52ecb7){_0x2f912b(_0x52ecb7);});})['then'](function(_0x260a6f){var _0x1960c3=qs[_0xe534('0x53')](_0x28fbf9,['id',_0xe534('0x59'),_0xe534('0x51')]);_0x1960c3['userProfileId']=_0x391372['id'];if(_0x260a6f)_0x1960c3[_0xe534('0x5a')]=_0x260a6f;return _0x1960c3;})[_0xe534('0x28')](function(_0x23ccd8){return db[_0xe534('0x56')]['create'](_0x23ccd8,{'include':[{'model':db[_0xe534('0x58')],'as':'Resources'}],'raw':!![],'transaction':_0x3be7f0});});})[_0xe534('0x28')](function(){return _0x391372;});}});});});}})[_0xe534('0x28')](respondWithResult(_0x4aa3ef,0xc9))['catch'](handleError(_0x4aa3ef,null));};exports[_0xe534('0x5b')]=function(_0x579d38,_0x2dee37){if(_0x579d38[_0xe534('0x4e')]['id']){delete _0x579d38['body']['id'];}return db[_0xe534('0x31')][_0xe534('0x4c')]({'where':{'id':_0x579d38['params']['id']}})['then'](handleEntityNotFound(_0x2dee37,null))[_0xe534('0x28')](saveUpdates(_0x579d38[_0xe534('0x4e')],null))[_0xe534('0x28')](respondWithResult(_0x2dee37,null))[_0xe534('0x48')](handleError(_0x2dee37,null));};exports[_0xe534('0x29')]=function(_0x26d90b,_0x2b20e4){return db['UserProfile'][_0xe534('0x4c')]({'where':{'id':_0x26d90b[_0xe534('0x5c')]['id']}})[_0xe534('0x28')](handleEntityNotFound(_0x2b20e4,null))[_0xe534('0x28')](removeEntity(_0x2b20e4,null))[_0xe534('0x48')](handleError(_0x2b20e4,null));};exports['describe']=function(_0x2df5d9,_0x5101bc){return db[_0xe534('0x31')][_0xe534('0x5d')]()[_0xe534('0x28')](respondWithResult(_0x5101bc,null))['catch'](handleError(_0x5101bc,null));};exports['addSections']=function(_0x3869e4,_0x43971e){var _0x32facc=_0x3869e4['body'];return db[_0xe534('0x31')][_0xe534('0x4c')]({'where':{'id':_0x3869e4[_0xe534('0x5c')]['id']}})[_0xe534('0x28')](handleEntityNotFound(_0x43971e,null))[_0xe534('0x28')](function(_0x7a001b){if(_0x7a001b){return db['sequelize'][_0xe534('0x55')](function(_0x370acb){return db[_0xe534('0x56')][_0xe534('0x29')]({'where':{'userProfileId':_0x3869e4['params']['id'],'sectionId':_['map'](_0x32facc,function(_0x343876){return _0x343876[_0xe534('0x5e')];})},'transaction':_0x370acb})['then'](function(){var _0x5901cc=_[_0xe534('0x30')](_0x32facc,function(_0x20d5df){_0x20d5df['userProfileId']=_0x3869e4[_0xe534('0x5c')]['id'];return _0x20d5df;});var _0x3a49e0=[];return BPromise[_0xe534('0x57')](_0x5901cc,function(_0x32f7ef){return db[_0xe534('0x56')][_0xe534('0x4d')](_0x32f7ef,{'include':[{'model':db['UserProfileResource'],'as':_0xe534('0x5a')}],'raw':!![],'transaction':_0x370acb})[_0xe534('0x28')](function(_0x1e480d){_0x3a49e0[_0xe534('0x5f')](_0x1e480d['get']({'plain':!![]}));});})[_0xe534('0x28')](function(){return _0x3a49e0;});});});}})['then'](function(_0x1afa9e){return _0x1afa9e;})[_0xe534('0x28')](respondWithResult(_0x43971e,null))[_0xe534('0x48')](handleError(_0x43971e,null));};exports[_0xe534('0x60')]=function(_0x46880f,_0x33e402){var _0x422baa;return db[_0xe534('0x31')][_0xe534('0x4c')]({'where':{'id':_0x46880f['params']['id']},'attributes':['id',_0xe534('0x2d')]})['then'](handleEntityNotFound(_0x33e402,null))[_0xe534('0x28')](function(_0x4ac967){if(_0x4ac967){_0x422baa=_0x4ac967;return db[_0xe534('0x56')]['destroy']({'where':{'userProfileId':_0x46880f['params']['id'],'sectionId':_0x46880f[_0xe534('0x37')][_0xe534('0x61')]}});}})[_0xe534('0x28')](function(){return _0x422baa;})[_0xe534('0x28')](respondWithStatusCode(_0x33e402,null))[_0xe534('0x48')](handleError(_0x33e402,null));};exports[_0xe534('0x62')]=function(_0x21985b,_0x4e0d4f){var _0x12d9eb=[];var _0x2dcc9d=[];return db[_0xe534('0x56')][_0xe534('0x46')]({'where':{'userProfileId':_0x21985b['params']['id']},'raw':!![]})[_0xe534('0x28')](function(_0x179995){_0x12d9eb=_[_0xe534('0x42')](_0x179995,function(_0x202bcd){return _0x202bcd[_0xe534('0x63')]===0x1||_[_0xe534('0x64')]([0x3eb,0x709],_0x202bcd[_0xe534('0x5e')]);});if(!_['isEmpty'](_0x12d9eb)){return _['map'](_0x12d9eb,function(_0x37e80d){return _0x37e80d['sectionId'];});}else{return;}})[_0xe534('0x28')](function(_0x59d0ac){if(_0x59d0ac)_0x2dcc9d=_0x59d0ac;if(_[_0xe534('0x64')](_0x2dcc9d,0x64)){var _0x834b4e=_['find'](_0x12d9eb,{'sectionId':0x64});return hasDefaultDashboard(_0x834b4e)[_0xe534('0x28')](function(_0x198feb){return _[_0xe534('0x30')](_0x12d9eb,function(_0xc786dd){if(_0xc786dd['sectionId']===0x64){_0xc786dd[_0xe534('0x65')]=_0x198feb;}return _0xc786dd;});});}else{return;}})['then'](function(_0x9521d8){if(_0x9521d8)_0x12d9eb=_0x9521d8;if(_[_0xe534('0x64')](_0x2dcc9d,0x3eb)){var _0x42640d=_[_0xe534('0x4c')](_0x12d9eb,{'sectionId':0x3eb});return getCustomDashboards(_0x42640d)[_0xe534('0x28')](function(_0x51d385){return _[_0xe534('0x30')](_0x12d9eb,function(_0xbf889e){if(_0x42640d['enabled']){if(_0xbf889e[_0xe534('0x5e')]===0x3eb){_0xbf889e[_0xe534('0x65')]=_0x51d385;}}else{if(_0xbf889e[_0xe534('0x5e')]===0x64){if(!_0xbf889e[_0xe534('0x65')]){_0xbf889e['subsections']=[];}_0xbf889e[_0xe534('0x65')]=_0xbf889e[_0xe534('0x65')][_0xe534('0x66')](_0x51d385);}}return _0xbf889e;});});}else{return;}})[_0xe534('0x28')](function(_0x2ce4c2){if(_0x2ce4c2)_0x12d9eb=_0x2ce4c2;if(_[_0xe534('0x64')](_0x2dcc9d,0x709)){var _0x130eb3=_[_0xe534('0x4c')](_0x12d9eb,{'sectionId':0x709});return getPlugins(_0x130eb3)['then'](function(_0x33b08e){if(_0x130eb3[_0xe534('0x63')]){return _['map'](_0x12d9eb,function(_0x1772a7){if(_0x1772a7[_0xe534('0x5e')]===0x709){_0x1772a7[_0xe534('0x65')]=_0x33b08e;}return _0x1772a7;});}else{var _0x23ca56={'sectionId':0x76c,'enabled':0x1,'subsections':_0x33b08e};var _0xe5aac2=_[_0xe534('0x30')](_0x12d9eb);_0xe5aac2[_0xe534('0x5f')](_0x23ca56);return _0xe5aac2;}});}else{return;}})[_0xe534('0x28')](function(_0x5b6bdd){if(_0x5b6bdd)_0x12d9eb=_0x5b6bdd;return _[_0xe534('0x42')](_0x12d9eb,[_0xe534('0x63'),0x1]);})[_0xe534('0x28')](respondWithResult(_0x4e0d4f,null))[_0xe534('0x48')](handleError(_0x4e0d4f,null));};function hasDefaultDashboard(_0x421122){var _0x5603d7=[0x65];return new BPromise(function(_0x478210,_0x229fa3){try{if(_0x421122[_0xe534('0x67')]){_0x478210(_0x5603d7);}else{return db[_0xe534('0x58')][_0xe534('0x68')]({'where':{'sectionId':_0x421122['id']},'raw':!![]})[_0xe534('0x28')](function(_0x24ae27){_0x24ae27?_0x478210(_0x5603d7):_0x478210();});}}catch(_0x214414){_0x229fa3(_0x214414);}});}function getCustomDashboards(_0x4f5a48){var _0x5787d1=[];return new BPromise(function(_0x41cad8,_0x41efe6){try{if(_0x4f5a48[_0xe534('0x67')]){return db[_0xe534('0x69')]['findAll']({'raw':!![]})[_0xe534('0x28')](function(_0x4affdd){_0x4affdd['forEach'](function(_0x2c4ca6){_0x5787d1[_0xe534('0x5f')](_0x2c4ca6['id']+0x1869f);});_0x41cad8(_0x5787d1);});}else{return db[_0xe534('0x58')]['findAll']({'where':{'sectionId':_0x4f5a48['id']},'raw':!![]})[_0xe534('0x28')](function(_0x388baf){_0x388baf[_0xe534('0x6a')](function(_0x442ba1){_0x5787d1[_0xe534('0x5f')](_0x442ba1[_0xe534('0x6b')]+0x1869f);});_0x41cad8(_0x5787d1);});}}catch(_0x1a24e2){_0x41efe6(_0x1a24e2);}});}function getPlugins(_0xca2c14){var _0x1d0887=[];return new BPromise(function(_0x453f07,_0x9fadd2){try{if(_0xca2c14['autoAssociation']){return db[_0xe534('0x6c')][_0xe534('0x46')]({'raw':!![]})[_0xe534('0x28')](function(_0x3f64c3){_0x3f64c3[_0xe534('0x6a')](function(_0x2ef2a3){_0x1d0887['push'](_0x2ef2a3['id']+0x15b38);});_0x453f07(_0x1d0887);});}else{return db[_0xe534('0x58')]['findAll']({'where':{'sectionId':_0xca2c14['id']},'raw':!![]})['then'](function(_0x511fa6){_0x511fa6[_0xe534('0x6a')](function(_0x56b3f6){_0x1d0887[_0xe534('0x5f')](_0x56b3f6[_0xe534('0x6b')]+0x15b38);});_0x453f07(_0x1d0887);});}}catch(_0x11b3b4){_0x9fadd2(_0x11b3b4);}});}exports['addResources']=function(_0x75e522,_0x5c3cf1){return db[_0xe534('0x31')][_0xe534('0x4c')]({'where':{'id':_0x75e522[_0xe534('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5c3cf1,null))[_0xe534('0x28')](function(_0x442448){if(_0x442448){return db[_0xe534('0x54')][_0xe534('0x55')](function(_0x3bfe76){return db[_0xe534('0x56')]['findAll']({'where':{'userProfileId':_0x75e522[_0xe534('0x5c')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x3b142c){if(_0x3b142c){return db[_0xe534('0x56')][_0xe534('0x29')]({'where':{'userProfileId':_0x75e522['params']['id'],'id':_[_0xe534('0x30')](_0x3b142c,function(_0x51fae3){return _0x51fae3['id'];})},'transaction':_0x3bfe76});}})['then'](function(_0x52798a){var _0x1b2ee7=_[_0xe534('0x30')](_0x75e522[_0xe534('0x4e')],function(_0x47ef99){_0x47ef99[_0xe534('0x6d')]=_0x75e522['params']['id'];return _0x47ef99;});return db[_0xe534('0x56')][_0xe534('0x6e')](_0x1b2ee7,{'raw':!![],'transaction':_0x3bfe76});})['then'](function(_0x5381bb){var _0x56a7f8=_[_0xe534('0x42')](_[_0xe534('0x30')](_0x5381bb,function(_0x57f504){return _0x57f504[_0xe534('0x6f')]({'plain':!![]});}),{'includeAll':![]});if(_0x56a7f8){return db[_0xe534('0x56')][_0xe534('0x46')]({'where':{'userProfileId':_0x75e522[_0xe534('0x5c')]['id'],'sectionId':_[_0xe534('0x30')](_0x56a7f8,function(_0x44b8c0){return _0x44b8c0['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0xe534('0x28')](function(_0x1760cb){var _0x10a266=_[_0xe534('0x30')](_0x75e522['body'],function(_0x3704f8){_0x3704f8[_0xe534('0x6d')]=_0x75e522[_0xe534('0x5c')]['id'];return _0x3704f8;});return db[_0xe534('0x58')]['bulkCreate'](_0x10a266,{'raw':!![],'transaction':_0x3bfe76});});}})[_0xe534('0x48')](handleError(_0x5c3cf1,null));});}})[_0xe534('0x28')](function(_0xb7207a){var _0x126a59=_[_0xe534('0x30')](_0xb7207a,function(_0x4a7e1b){return _0x4a7e1b[_0xe534('0x6f')]({'plain':!![]});});})[_0xe534('0x28')](respondWithResult(_0x5c3cf1,null))[_0xe534('0x48')](handleError(_0x5c3cf1,null));};exports[_0xe534('0x70')]=function(_0x231186,_0xa94642,_0x194a6a){return db[_0xe534('0x31')][_0xe534('0x4c')]({'where':{'id':_0x231186[_0xe534('0x5c')]['id']}})['then'](handleEntityNotFound(_0xa94642,null))[_0xe534('0x28')](function(_0x5385fe){if(_0x5385fe){return _0x5385fe[_0xe534('0x70')](_0x231186[_0xe534('0x37')][_0xe534('0x61')]);}})[_0xe534('0x28')](respondWithStatusCode(_0xa94642,null))[_0xe534('0x48')](handleError(_0xa94642,null));};exports[_0xe534('0x71')]=function(_0xb633c8,_0x415c30){var _0x5b3510={};if(!_0xb633c8['query'][_0xe534('0x72')])throw new Error('Missing\x20section\x20parameter');if(!_0xb633c8[_0xe534('0x37')][_0xe534('0x3d')](_0xe534('0x73'))){_0x5b3510[_0xe534('0x20')]=qs[_0xe534('0x20')](_0xb633c8['query'][_0xe534('0x20')]);_0x5b3510[_0xe534('0x1f')]=qs[_0xe534('0x1f')](_0xb633c8[_0xe534('0x37')][_0xe534('0x1f')]);}return db['UserProfile'][_0xe534('0x4c')]({'where':{'id':_0xb633c8['params']['id']}})[_0xe534('0x28')](function(_0x4a93e1){if(!_0x4a93e1)throw new Error(_0xe534('0x74')+_0xb633c8[_0xe534('0x5c')]['id']);return db[_0xe534('0x31')][_0xe534('0x71')](_0xb633c8);})[_0xe534('0x28')](respondWithFilteredResult(_0x415c30,_0x5b3510))[_0xe534('0x48')](handleError(_0x415c30,null));}; \ No newline at end of file +var _0x18d7=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','defaults','redis','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','index','map','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','UserProfile','include','findAll','rows','catch','params','includeAll','options','create','find','createdAt','crudPermissions','body','omit','transaction','get','UserProfileSection','each','autoAssociation','UserProfileResource','updatedAt','userProfileId','describe','addSections','sequelize','sectionId','Resources','push','removeSections','getSections','includes','isEmpty','subsections','concat','enabled','findOne','resourceId','Plugin','forEach','addResources','bulkCreate','removeResources','ids','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x1ab64f,_0x37ffbb){var _0x38c6bd=function(_0x11c8aa){while(--_0x11c8aa){_0x1ab64f['push'](_0x1ab64f['shift']());}};_0x38c6bd(++_0x37ffbb);}(_0x18d7,0x14d));var _0x718d=function(_0x386574,_0x4f92e9){_0x386574=_0x386574-0x0;var _0x1f8da8=_0x18d7[_0x386574];return _0x1f8da8;};'use strict';var emlformat=require(_0x718d('0x0'));var rimraf=require(_0x718d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x718d('0x2'));var rp=require(_0x718d('0x3'));var moment=require(_0x718d('0x4'));var BPromise=require(_0x718d('0x5'));var Mustache=require(_0x718d('0x6'));var util=require(_0x718d('0x7'));var path=require(_0x718d('0x8'));var sox=require(_0x718d('0x9'));var csv=require(_0x718d('0xa'));var ejs=require(_0x718d('0xb'));var fs=require('fs');var fs_extra=require(_0x718d('0xc'));var _=require(_0x718d('0xd'));var squel=require(_0x718d('0xe'));var crypto=require(_0x718d('0xf'));var jsforce=require(_0x718d('0x10'));var deskjs=require(_0x718d('0x11'));var toCsv=require(_0x718d('0xa'));var querystring=require('querystring');var Papa=require(_0x718d('0x12'));var Redis=require(_0x718d('0x13'));var authService=require(_0x718d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x718d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x718d('0x16'));var utils=require(_0x718d('0x17'));var config=require(_0x718d('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x718d('0x19')](config[_0x718d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x718d('0x1a')]));require('./userProfile.socket')[_0x718d('0x1b')](socket);function respondWithStatusCode(_0x3ec3d4,_0x1e0d32){_0x1e0d32=_0x1e0d32||0xcc;return function(_0x3db63f){if(_0x3db63f){return _0x3ec3d4[_0x718d('0x1c')](_0x1e0d32);}return _0x3ec3d4[_0x718d('0x1d')](_0x1e0d32)[_0x718d('0x1e')]();};}function respondWithResult(_0x33b166,_0x58c4fd){_0x58c4fd=_0x58c4fd||0xc8;return function(_0x2d5004){if(_0x2d5004){return _0x33b166[_0x718d('0x1d')](_0x58c4fd)[_0x718d('0x1f')](_0x2d5004);}};}function respondWithFilteredResult(_0x533134,_0x322a27){return function(_0x176bb1){if(_0x176bb1){var _0x52a0f5=typeof _0x322a27[_0x718d('0x20')]===_0x718d('0x21')&&typeof _0x322a27['limit']==='undefined';var _0x51ef04=_0x176bb1['count'];var _0x5395e8=_0x52a0f5?0x0:_0x322a27[_0x718d('0x20')];var _0x2c8592=_0x52a0f5?_0x176bb1[_0x718d('0x22')]:_0x322a27[_0x718d('0x20')]+_0x322a27[_0x718d('0x23')];var _0x1061af;if(_0x2c8592>=_0x51ef04){_0x2c8592=_0x51ef04;_0x1061af=0xc8;}else{_0x1061af=0xce;}_0x533134[_0x718d('0x1d')](_0x1061af);return _0x533134['set'](_0x718d('0x24'),_0x5395e8+'-'+_0x2c8592+'/'+_0x51ef04)[_0x718d('0x1f')](_0x176bb1);}return null;};}function patchUpdates(_0x2a6fe5){return function(_0x1744fd){try{jsonpatch[_0x718d('0x25')](_0x1744fd,_0x2a6fe5,!![]);}catch(_0x43ab78){return BPromise[_0x718d('0x26')](_0x43ab78);}return _0x1744fd[_0x718d('0x27')]();};}function saveUpdates(_0x4997b1,_0xf90f50){return function(_0x3619c1){if(_0x3619c1){return _0x3619c1[_0x718d('0x28')](_0x4997b1)[_0x718d('0x29')](function(_0xa2d396){return _0xa2d396;});}return null;};}function removeEntity(_0x5cbc81,_0x4233e0){return function(_0x43061e){if(_0x43061e){return _0x43061e[_0x718d('0x2a')]()['then'](function(){_0x5cbc81[_0x718d('0x1d')](0xcc)[_0x718d('0x1e')]();});}};}function handleEntityNotFound(_0x272ba2,_0x28088a){return function(_0x15cd5f){if(!_0x15cd5f){_0x272ba2[_0x718d('0x1c')](0x194);}return _0x15cd5f;};}function handleError(_0x7677cb,_0xfa7c0d){_0xfa7c0d=_0xfa7c0d||0x1f4;return function(_0x26dff2){logger[_0x718d('0x2b')](_0x26dff2[_0x718d('0x2c')]);if(_0x26dff2['name']){delete _0x26dff2['name'];}_0x7677cb[_0x718d('0x1d')](_0xfa7c0d)['send'](_0x26dff2);};}exports[_0x718d('0x2d')]=function(_0x2979a4,_0x3eeaf9){var _0x529ea4={},_0x1958e7={},_0x241e9f={'count':0x0,'rows':[]};var _0x2d56b2=_[_0x718d('0x2e')](db['UserProfile'][_0x718d('0x2f')],function(_0x2f4743){return{'name':_0x2f4743[_0x718d('0x30')],'type':_0x2f4743[_0x718d('0x31')][_0x718d('0x32')]};});_0x1958e7['model']=_['map'](_0x2d56b2,_0x718d('0x33'));_0x1958e7[_0x718d('0x34')]=_[_0x718d('0x35')](_0x2979a4[_0x718d('0x34')]);_0x1958e7[_0x718d('0x36')]=_[_0x718d('0x37')](_0x1958e7[_0x718d('0x38')],_0x1958e7[_0x718d('0x34')]);_0x529ea4[_0x718d('0x39')]=_[_0x718d('0x37')](_0x1958e7[_0x718d('0x38')],qs[_0x718d('0x3a')](_0x2979a4[_0x718d('0x34')]['fields']));_0x529ea4[_0x718d('0x39')]=_0x529ea4[_0x718d('0x39')][_0x718d('0x3b')]?_0x529ea4['attributes']:_0x1958e7[_0x718d('0x38')];if(!_0x2979a4[_0x718d('0x34')][_0x718d('0x3c')]('nolimit')){_0x529ea4[_0x718d('0x23')]=qs[_0x718d('0x23')](_0x2979a4[_0x718d('0x34')][_0x718d('0x23')]);_0x529ea4['offset']=qs[_0x718d('0x20')](_0x2979a4[_0x718d('0x34')][_0x718d('0x20')]);}_0x529ea4[_0x718d('0x3d')]=qs[_0x718d('0x3e')](_0x2979a4[_0x718d('0x34')][_0x718d('0x3e')]);_0x529ea4[_0x718d('0x3f')]=qs[_0x718d('0x36')](_['pick'](_0x2979a4[_0x718d('0x34')],_0x1958e7[_0x718d('0x36')]),_0x2d56b2);if(_0x2979a4[_0x718d('0x34')][_0x718d('0x40')]){_0x529ea4[_0x718d('0x3f')]=_[_0x718d('0x41')](_0x529ea4[_0x718d('0x3f')],{'$or':_['map'](_0x2d56b2,function(_0x166e85){if(_0x166e85[_0x718d('0x31')]!==_0x718d('0x42')){var _0x54c2d3={};_0x54c2d3[_0x166e85[_0x718d('0x33')]]={'$like':'%'+_0x2979a4[_0x718d('0x34')]['filter']+'%'};return _0x54c2d3;}})});}_0x529ea4=_[_0x718d('0x41')]({},_0x529ea4,_0x2979a4['options']);var _0xc9db70={'where':_0x529ea4[_0x718d('0x3f')]};return db[_0x718d('0x43')]['count'](_0xc9db70)[_0x718d('0x29')](function(_0x469149){_0x241e9f[_0x718d('0x22')]=_0x469149;if(_0x2979a4['query']['includeAll']){_0x529ea4[_0x718d('0x44')]=[{'all':!![]}];}return db[_0x718d('0x43')][_0x718d('0x45')](_0x529ea4);})[_0x718d('0x29')](function(_0x37666e){_0x241e9f[_0x718d('0x46')]=_0x37666e;return _0x241e9f;})[_0x718d('0x29')](respondWithFilteredResult(_0x3eeaf9,_0x529ea4))[_0x718d('0x47')](handleError(_0x3eeaf9,null));};exports['show']=function(_0x2649c3,_0x37efe0){var _0x5734bb={'raw':![],'where':{'id':_0x2649c3[_0x718d('0x48')]['id']}},_0x265091={};_0x265091['model']=_[_0x718d('0x35')](db[_0x718d('0x43')]['rawAttributes']);_0x265091[_0x718d('0x34')]=_[_0x718d('0x35')](_0x2649c3[_0x718d('0x34')]);_0x265091[_0x718d('0x36')]=_[_0x718d('0x37')](_0x265091[_0x718d('0x38')],_0x265091['query']);_0x5734bb['attributes']=_['intersection'](_0x265091[_0x718d('0x38')],qs[_0x718d('0x3a')](_0x2649c3[_0x718d('0x34')][_0x718d('0x3a')]));_0x5734bb['attributes']=_0x5734bb[_0x718d('0x39')][_0x718d('0x3b')]?_0x5734bb[_0x718d('0x39')]:_0x265091[_0x718d('0x38')];if(_0x2649c3[_0x718d('0x34')][_0x718d('0x49')]){_0x5734bb[_0x718d('0x44')]=[{'all':!![]}];}_0x5734bb=_[_0x718d('0x41')]({},_0x5734bb,_0x2649c3[_0x718d('0x4a')]);return db[_0x718d('0x43')]['find'](_0x5734bb)[_0x718d('0x29')](handleEntityNotFound(_0x37efe0,null))[_0x718d('0x29')](respondWithResult(_0x37efe0,null))[_0x718d('0x47')](handleError(_0x37efe0,null));};exports['create']=function(_0x4d1828,_0x114e8a){return db[_0x718d('0x43')][_0x718d('0x4b')](_0x4d1828['body'],{})['then'](respondWithResult(_0x114e8a,0xc9))[_0x718d('0x47')](handleError(_0x114e8a,null));};exports['clone']=function(_0x269122,_0x2a7bc2){var _0x465035={'where':{'id':_0x269122['params']['id']}},_0x11240a={};_0x11240a[_0x718d('0x38')]=_[_0x718d('0x35')](db[_0x718d('0x43')][_0x718d('0x2f')]);_0x465035[_0x718d('0x39')]=_[_0x718d('0x37')](_0x11240a[_0x718d('0x38')],qs[_0x718d('0x3a')](_0x269122[_0x718d('0x34')][_0x718d('0x3a')]));_0x465035[_0x718d('0x39')]=_0x465035[_0x718d('0x39')][_0x718d('0x3b')]?_0x465035[_0x718d('0x39')]:_0x11240a[_0x718d('0x38')];if(_0x269122[_0x718d('0x34')][_0x718d('0x49')]){_0x465035[_0x718d('0x44')]=[{'all':!![]}];}_0x465035=_[_0x718d('0x41')]({},_0x465035,_0x269122[_0x718d('0x4a')]);return db[_0x718d('0x43')][_0x718d('0x4c')](_0x465035)[_0x718d('0x29')](handleEntityNotFound(_0x2a7bc2,null))[_0x718d('0x29')](function(_0x5515ec){if(_0x5515ec){var _0x58a0bb=_0x5515ec['get']({'plain':!![]});_0x58a0bb=qs['omit'](_0x58a0bb,['id',_0x718d('0x4d'),'updatedAt',_0x718d('0x4e')]);_0x269122[_0x718d('0x4f')]=_[_0x718d('0x50')](_0x269122['body'],['id','createdAt','updatedAt']);return db['sequelize'][_0x718d('0x51')](function(_0x5924a8){return db['UserProfile'][_0x718d('0x4b')](_[_0x718d('0x41')](_0x58a0bb,_0x269122[_0x718d('0x4f')]),{'include':_0x269122[_0x718d('0x34')][_0x718d('0x49')]?[{'all':!![]}]:undefined,'transaction':_0x5924a8})['then'](function(_0x1dbd18){var _0x336727=_0x1dbd18[_0x718d('0x52')]({'plain':!![]});return db[_0x718d('0x53')][_0x718d('0x45')]({'where':{'userProfileId':_0x269122['params']['id']},'raw':!![]})[_0x718d('0x29')](function(_0x1bd43c){if(_0x1bd43c){return BPromise[_0x718d('0x54')](_0x1bd43c,function(_0x57f0c7){return new BPromise(function(_0xa7e290,_0x305718){if(_0x57f0c7['autoAssociation']===null||_0x57f0c7[_0x718d('0x55')]===0x1)_0xa7e290(null);return db[_0x718d('0x56')][_0x718d('0x45')]({'where':{'sectionId':_0x57f0c7['id']},'raw':!![]})[_0x718d('0x29')](function(_0x17c080){var _0x2b95c3=_[_0x718d('0x2e')](_0x17c080,function(_0x583adb){return qs[_0x718d('0x50')](_0x583adb,['id',_0x718d('0x4d'),_0x718d('0x57'),'sectionId']);});_0xa7e290(_0x2b95c3);})['catch'](function(_0x19e4a6){_0x305718(_0x19e4a6);});})['then'](function(_0x5ef9e9){var _0x31e9c3=qs['omit'](_0x57f0c7,['id',_0x718d('0x4d'),_0x718d('0x57')]);_0x31e9c3[_0x718d('0x58')]=_0x336727['id'];if(_0x5ef9e9)_0x31e9c3['Resources']=_0x5ef9e9;return _0x31e9c3;})[_0x718d('0x29')](function(_0x5731d1){return db[_0x718d('0x53')][_0x718d('0x4b')](_0x5731d1,{'include':[{'model':db[_0x718d('0x56')],'as':'Resources'}],'raw':!![],'transaction':_0x5924a8});});})[_0x718d('0x29')](function(){return _0x336727;});}});});});}})['then'](respondWithResult(_0x2a7bc2,0xc9))['catch'](handleError(_0x2a7bc2,null));};exports[_0x718d('0x28')]=function(_0x9bb521,_0xe873d){if(_0x9bb521[_0x718d('0x4f')]['id']){delete _0x9bb521[_0x718d('0x4f')]['id'];}return db[_0x718d('0x43')][_0x718d('0x4c')]({'where':{'id':_0x9bb521[_0x718d('0x48')]['id']}})[_0x718d('0x29')](handleEntityNotFound(_0xe873d,null))[_0x718d('0x29')](saveUpdates(_0x9bb521[_0x718d('0x4f')],null))[_0x718d('0x29')](respondWithResult(_0xe873d,null))[_0x718d('0x47')](handleError(_0xe873d,null));};exports[_0x718d('0x2a')]=function(_0x388589,_0x3dbed1){return db[_0x718d('0x43')]['find']({'where':{'id':_0x388589[_0x718d('0x48')]['id']}})[_0x718d('0x29')](handleEntityNotFound(_0x3dbed1,null))['then'](removeEntity(_0x3dbed1,null))[_0x718d('0x47')](handleError(_0x3dbed1,null));};exports[_0x718d('0x59')]=function(_0x3945b2,_0x356637){return db[_0x718d('0x43')][_0x718d('0x59')]()['then'](respondWithResult(_0x356637,null))[_0x718d('0x47')](handleError(_0x356637,null));};exports[_0x718d('0x5a')]=function(_0x391ec5,_0x3205da){var _0x565a5d=_0x391ec5[_0x718d('0x4f')];return db[_0x718d('0x43')][_0x718d('0x4c')]({'where':{'id':_0x391ec5[_0x718d('0x48')]['id']}})[_0x718d('0x29')](handleEntityNotFound(_0x3205da,null))[_0x718d('0x29')](function(_0x37e144){if(_0x37e144){return db[_0x718d('0x5b')]['transaction'](function(_0x39367e){return db[_0x718d('0x53')][_0x718d('0x2a')]({'where':{'userProfileId':_0x391ec5['params']['id'],'sectionId':_[_0x718d('0x2e')](_0x565a5d,function(_0x4365e9){return _0x4365e9[_0x718d('0x5c')];})},'transaction':_0x39367e})['then'](function(){var _0x3c1d6f=_[_0x718d('0x2e')](_0x565a5d,function(_0x183f18){_0x183f18[_0x718d('0x58')]=_0x391ec5[_0x718d('0x48')]['id'];return _0x183f18;});var _0x46e803=[];return BPromise[_0x718d('0x54')](_0x3c1d6f,function(_0x151284){return db[_0x718d('0x53')][_0x718d('0x4b')](_0x151284,{'include':[{'model':db[_0x718d('0x56')],'as':_0x718d('0x5d')}],'raw':!![],'transaction':_0x39367e})[_0x718d('0x29')](function(_0x1acf5d){_0x46e803[_0x718d('0x5e')](_0x1acf5d[_0x718d('0x52')]({'plain':!![]}));});})[_0x718d('0x29')](function(){return _0x46e803;});});});}})['then'](function(_0x46d1f3){return _0x46d1f3;})['then'](respondWithResult(_0x3205da,null))[_0x718d('0x47')](handleError(_0x3205da,null));};exports[_0x718d('0x5f')]=function(_0x1ae976,_0x343e61){var _0x2da15b;return db['UserProfile'][_0x718d('0x4c')]({'where':{'id':_0x1ae976[_0x718d('0x48')]['id']},'attributes':['id',_0x718d('0x33')]})[_0x718d('0x29')](handleEntityNotFound(_0x343e61,null))[_0x718d('0x29')](function(_0x3e7b46){if(_0x3e7b46){_0x2da15b=_0x3e7b46;return db[_0x718d('0x53')]['destroy']({'where':{'userProfileId':_0x1ae976[_0x718d('0x48')]['id'],'sectionId':_0x1ae976[_0x718d('0x34')]['ids']}});}})[_0x718d('0x29')](function(){return _0x2da15b;})[_0x718d('0x29')](respondWithStatusCode(_0x343e61,null))[_0x718d('0x47')](handleError(_0x343e61,null));};exports[_0x718d('0x60')]=function(_0x31b1cd,_0x17c7e8){var _0x5e8143=[];var _0x396d11=[];return db[_0x718d('0x53')][_0x718d('0x45')]({'where':{'userProfileId':_0x31b1cd[_0x718d('0x48')]['id']},'raw':!![]})['then'](function(_0x1b9202){_0x5e8143=_['filter'](_0x1b9202,function(_0x3cec3b){return _0x3cec3b['enabled']===0x1||_[_0x718d('0x61')]([0x3eb,0x709],_0x3cec3b[_0x718d('0x5c')]);});if(!_[_0x718d('0x62')](_0x5e8143)){return _['map'](_0x5e8143,function(_0x5b9766){return _0x5b9766[_0x718d('0x5c')];});}else{return;}})['then'](function(_0x4ccf89){if(_0x4ccf89)_0x396d11=_0x4ccf89;if(_[_0x718d('0x61')](_0x396d11,0x64)){var _0x43ebd7=_[_0x718d('0x4c')](_0x5e8143,{'sectionId':0x64});return hasDefaultDashboard(_0x43ebd7)['then'](function(_0x3d0380){return _[_0x718d('0x2e')](_0x5e8143,function(_0x1012f3){if(_0x1012f3[_0x718d('0x5c')]===0x64){_0x1012f3[_0x718d('0x63')]=_0x3d0380;}return _0x1012f3;});});}else{return;}})[_0x718d('0x29')](function(_0x3e45c8){if(_0x3e45c8)_0x5e8143=_0x3e45c8;if(_[_0x718d('0x61')](_0x396d11,0x3eb)){var _0x44fbfd=_[_0x718d('0x4c')](_0x5e8143,{'sectionId':0x3eb});return getCustomDashboards(_0x44fbfd)['then'](function(_0x120d39){return _[_0x718d('0x2e')](_0x5e8143,function(_0x2ee681){if(_0x44fbfd['enabled']){if(_0x2ee681[_0x718d('0x5c')]===0x3eb){_0x2ee681[_0x718d('0x63')]=_0x120d39;}}else{if(_0x2ee681[_0x718d('0x5c')]===0x64){if(!_0x2ee681[_0x718d('0x63')]){_0x2ee681[_0x718d('0x63')]=[];}_0x2ee681[_0x718d('0x63')]=_0x2ee681['subsections'][_0x718d('0x64')](_0x120d39);}}return _0x2ee681;});});}else{return;}})[_0x718d('0x29')](function(_0x2896c7){if(_0x2896c7)_0x5e8143=_0x2896c7;if(_['includes'](_0x396d11,0x709)){var _0x5dc64e=_['find'](_0x5e8143,{'sectionId':0x709});return getPlugins(_0x5dc64e)['then'](function(_0xcaab46){if(_0x5dc64e[_0x718d('0x65')]){return _[_0x718d('0x2e')](_0x5e8143,function(_0x11ca4f){if(_0x11ca4f[_0x718d('0x5c')]===0x709){_0x11ca4f[_0x718d('0x63')]=_0xcaab46;}return _0x11ca4f;});}else{var _0x39f250={'sectionId':0x76c,'enabled':0x1,'subsections':_0xcaab46};var _0x73674a=_[_0x718d('0x2e')](_0x5e8143);_0x73674a['push'](_0x39f250);return _0x73674a;}});}else{return;}})[_0x718d('0x29')](function(_0x4946d1){if(_0x4946d1)_0x5e8143=_0x4946d1;return _[_0x718d('0x40')](_0x5e8143,[_0x718d('0x65'),0x1]);})['then'](respondWithResult(_0x17c7e8,null))[_0x718d('0x47')](handleError(_0x17c7e8,null));};function hasDefaultDashboard(_0x435282){var _0x343e27=[0x65];return new BPromise(function(_0x141c94,_0x3fcb41){try{if(_0x435282[_0x718d('0x55')]){_0x141c94(_0x343e27);}else{return db[_0x718d('0x56')][_0x718d('0x66')]({'where':{'sectionId':_0x435282['id']},'raw':!![]})['then'](function(_0x56c7de){_0x56c7de?_0x141c94(_0x343e27):_0x141c94();});}}catch(_0x2aeef7){_0x3fcb41(_0x2aeef7);}});}function getCustomDashboards(_0x3dcde0){var _0x2bd18a=[];return new BPromise(function(_0xfe565b,_0x48ff4a){try{if(_0x3dcde0[_0x718d('0x55')]){return db['Dashboard'][_0x718d('0x45')]({'raw':!![]})[_0x718d('0x29')](function(_0xc7bba3){_0xc7bba3['forEach'](function(_0x20f149){_0x2bd18a['push'](_0x20f149['id']+0x1869f);});_0xfe565b(_0x2bd18a);});}else{return db['UserProfileResource'][_0x718d('0x45')]({'where':{'sectionId':_0x3dcde0['id']},'raw':!![]})[_0x718d('0x29')](function(_0x6edcdd){_0x6edcdd['forEach'](function(_0xb9cbfb){_0x2bd18a[_0x718d('0x5e')](_0xb9cbfb[_0x718d('0x67')]+0x1869f);});_0xfe565b(_0x2bd18a);});}}catch(_0x12a543){_0x48ff4a(_0x12a543);}});}function getPlugins(_0x2f17bb){var _0x509064=[];return new BPromise(function(_0x2495c1,_0x5087c9){try{if(_0x2f17bb['autoAssociation']){return db[_0x718d('0x68')][_0x718d('0x45')]({'raw':!![]})[_0x718d('0x29')](function(_0x47d150){_0x47d150['forEach'](function(_0x25aa81){_0x509064[_0x718d('0x5e')](_0x25aa81['id']+0x15b38);});_0x2495c1(_0x509064);});}else{return db[_0x718d('0x56')][_0x718d('0x45')]({'where':{'sectionId':_0x2f17bb['id']},'raw':!![]})[_0x718d('0x29')](function(_0x12d15e){_0x12d15e[_0x718d('0x69')](function(_0x11271b){_0x509064[_0x718d('0x5e')](_0x11271b['resourceId']+0x15b38);});_0x2495c1(_0x509064);});}}catch(_0x293627){_0x5087c9(_0x293627);}});}exports[_0x718d('0x6a')]=function(_0x3f2e1c,_0x5ea9d3){return db[_0x718d('0x43')][_0x718d('0x4c')]({'where':{'id':_0x3f2e1c[_0x718d('0x48')]['id']}})[_0x718d('0x29')](handleEntityNotFound(_0x5ea9d3,null))['then'](function(_0x3e2a08){if(_0x3e2a08){return db['sequelize'][_0x718d('0x51')](function(_0xc117ae){return db[_0x718d('0x53')][_0x718d('0x45')]({'where':{'userProfileId':_0x3f2e1c[_0x718d('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0x718d('0x29')](function(_0x509a4b){if(_0x509a4b){return db[_0x718d('0x53')][_0x718d('0x2a')]({'where':{'userProfileId':_0x3f2e1c[_0x718d('0x48')]['id'],'id':_[_0x718d('0x2e')](_0x509a4b,function(_0x2d6321){return _0x2d6321['id'];})},'transaction':_0xc117ae});}})[_0x718d('0x29')](function(_0xcd0b78){var _0x5dc5cf=_[_0x718d('0x2e')](_0x3f2e1c[_0x718d('0x4f')],function(_0x5a4d2f){_0x5a4d2f[_0x718d('0x58')]=_0x3f2e1c[_0x718d('0x48')]['id'];return _0x5a4d2f;});return db[_0x718d('0x53')][_0x718d('0x6b')](_0x5dc5cf,{'raw':!![],'transaction':_0xc117ae});})[_0x718d('0x29')](function(_0x200ed4){var _0x1a68e2=_[_0x718d('0x40')](_[_0x718d('0x2e')](_0x200ed4,function(_0x4996dc){return _0x4996dc['get']({'plain':!![]});}),{'includeAll':![]});if(_0x1a68e2){return db[_0x718d('0x53')][_0x718d('0x45')]({'where':{'userProfileId':_0x3f2e1c['params']['id'],'sectionId':_[_0x718d('0x2e')](_0x1a68e2,function(_0x1f5dbe){return _0x1f5dbe[_0x718d('0x5c')];})},'attributes':['id',_0x718d('0x5c')],'raw':!![]})[_0x718d('0x29')](function(_0x45562e){var _0x5d1890=_[_0x718d('0x2e')](_0x3f2e1c['body'],function(_0x362414){_0x362414[_0x718d('0x58')]=_0x3f2e1c[_0x718d('0x48')]['id'];return _0x362414;});return db['UserProfileResource']['bulkCreate'](_0x5d1890,{'raw':!![],'transaction':_0xc117ae});});}})[_0x718d('0x47')](handleError(_0x5ea9d3,null));});}})[_0x718d('0x29')](function(_0x5ca193){var _0x21687f=_[_0x718d('0x2e')](_0x5ca193,function(_0x347fb4){return _0x347fb4[_0x718d('0x52')]({'plain':!![]});});})[_0x718d('0x29')](respondWithResult(_0x5ea9d3,null))[_0x718d('0x47')](handleError(_0x5ea9d3,null));};exports['removeResources']=function(_0x4e3737,_0x54fe3c,_0x5275f6){return db[_0x718d('0x43')]['find']({'where':{'id':_0x4e3737['params']['id']}})[_0x718d('0x29')](handleEntityNotFound(_0x54fe3c,null))[_0x718d('0x29')](function(_0x4961d2){if(_0x4961d2){return _0x4961d2[_0x718d('0x6c')](_0x4e3737[_0x718d('0x34')][_0x718d('0x6d')]);}})[_0x718d('0x29')](respondWithStatusCode(_0x54fe3c,null))['catch'](handleError(_0x54fe3c,null));};exports['getResources']=function(_0x2bb00b,_0x171182){var _0x5ed48f={};if(!_0x2bb00b[_0x718d('0x34')][_0x718d('0x6e')])throw new Error(_0x718d('0x6f'));if(!_0x2bb00b[_0x718d('0x34')][_0x718d('0x3c')]('nolimit')){_0x5ed48f[_0x718d('0x23')]=qs[_0x718d('0x23')](_0x2bb00b['query'][_0x718d('0x23')]);_0x5ed48f[_0x718d('0x20')]=qs[_0x718d('0x20')](_0x2bb00b[_0x718d('0x34')]['offset']);}return db[_0x718d('0x43')][_0x718d('0x4c')]({'where':{'id':_0x2bb00b[_0x718d('0x48')]['id']}})[_0x718d('0x29')](function(_0x879579){if(!_0x879579)throw new Error(_0x718d('0x70')+_0x2bb00b[_0x718d('0x48')]['id']);return db[_0x718d('0x43')][_0x718d('0x71')](_0x2bb00b);})[_0x718d('0x29')](respondWithFilteredResult(_0x171182,_0x5ed48f))[_0x718d('0x47')](handleError(_0x171182,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 550b6aa..ac078e6 100644 --- a/server/api/userProfile/userProfile.events.js +++ b/server/api/userProfile/userProfile.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb0b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','save','update'];(function(_0x677d96,_0x20cbb9){var _0x34b1e2=function(_0x5c7aa9){while(--_0x5c7aa9){_0x677d96['push'](_0x677d96['shift']());}};_0x34b1e2(++_0x20cbb9);}(_0xfb0b,0x94));var _0xbfb0=function(_0x20345e,_0x33a384){_0x20345e=_0x20345e-0x0;var _0x33223f=_0xfb0b[_0x20345e];return _0x33223f;};'use strict';var EventEmitter=require(_0xbfb0('0x0'));var UserProfile=require(_0xbfb0('0x1'))['db'][_0xbfb0('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbfb0('0x3'),'afterUpdate':_0xbfb0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4adab6){return function(_0x299a7b,_0x4ac75d,_0x238a87){UserProfileEvents[_0xbfb0('0x5')](_0x4adab6+':'+_0x299a7b['id'],_0x299a7b);UserProfileEvents[_0xbfb0('0x5')](_0x4adab6,_0x299a7b);_0x238a87(null);};}for(var e in events){if(events[_0xbfb0('0x6')](e)){var event=events[e];UserProfile[_0xbfb0('0x7')](e,emitEvent(event));}}module[_0xbfb0('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x7919=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7919,0xeb));var _0x9791=function(_0x31286d,_0x1e2ec3){_0x31286d=_0x31286d-0x0;var _0x28eabe=_0x7919[_0x31286d];return _0x28eabe;};'use strict';var EventEmitter=require(_0x9791('0x0'));var UserProfile=require(_0x9791('0x1'))['db'][_0x9791('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x9791('0x3')](0x0);var events={'afterCreate':_0x9791('0x4'),'afterUpdate':_0x9791('0x5'),'afterDestroy':_0x9791('0x6')};function emitEvent(_0x54b9c0){return function(_0x13a1a5,_0x193919,_0x4b484f){UserProfileEvents[_0x9791('0x7')](_0x54b9c0+':'+_0x13a1a5['id'],_0x13a1a5);UserProfileEvents[_0x9791('0x7')](_0x54b9c0,_0x13a1a5);_0x4b484f(null);};}for(var e in events){if(events[_0x9791('0x8')](e)){var event=events[e];UserProfile[_0x9791('0x9')](e,emitEvent(event));}}module[_0x9791('0xa')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index a2a3086..a8cf09b 100644 --- a/server/api/userProfile/userProfile.model.js +++ b/server/api/userProfile/userProfile.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9029=['chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','VoiceQueues','QueueCampaigns','users','telephones','Users','admin','Agents','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','Reports','reportId','metrics','toUpperCase','slice','SELECT','ui.','from','user_has_','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','raw','mergeResources','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','params','all','ignore','length','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','where','merge','key','VIRTUAL','foreignKey','include','forEach','default','DefaultReports','CustomReports','count','rows','ids','customSorting','extraQueryConditions','includeAll','Tag','color','tag','ThroughTags','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','models','filter','value','findAll','associatedResources','map','catch','field','model','then','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','SquareRecording','parentSections','projectName','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','VoiceRecording','membername','User','role','agent','telephone','queue','VoiceQueue','musiconholds','VoiceMusicOnHold'];(function(_0x4ceae8,_0x43f6e3){var _0x270c69=function(_0x323226){while(--_0x323226){_0x4ceae8['push'](_0x4ceae8['shift']());}};_0x270c69(++_0x43f6e3);}(_0x9029,0x146));var _0x9902=function(_0x38b577,_0x153e7e){_0x38b577=_0x38b577-0x0;var _0x219d2c=_0x9029[_0x38b577];return _0x219d2c;};'use strict';var _=require(_0x9902('0x0'));var attributes=require(_0x9902('0x1'));var squel=require(_0x9902('0x2'));module['exports']=function(_0x1c39ba){var _0x2bb724=_0x1c39ba[_0x9902('0x3')];function _0x17206c(_0x58e03f,_0x440c61){return new Promise(function(_0x481e89,_0x4d1352){if(!_0x440c61)return _0x481e89(null);var _0x1e120c=_0x440c61['filter']?{[_0x440c61[_0x9902('0x4')]['field']]:_0x440c61[_0x9902('0x4')][_0x9902('0x5')]}:undefined;return _0x2bb724[_0x58e03f][_0x9902('0x6')]({'where':_0x1e120c,'raw':!![]})['then'](function(_0x4e9802){_0x440c61[_0x9902('0x7')]=_[_0x9902('0x8')](_0x4e9802,'id');_0x481e89(_0x440c61);})[_0x9902('0x9')](function(_0x824056){_0x4d1352(_0x824056);});});}function _0x1b3145(_0x532e90,_0xb89793){return new Promise(function(_0x2a9ed6,_0x57a3bb){var _0x414999=_0x532e90[_0x9902('0x4')]?{[_0x532e90[_0x9902('0x4')][_0x9902('0xa')]]:_0x532e90[_0x9902('0x4')]['value']}:undefined;return _0x2bb724[_0x532e90[_0x9902('0xb')]][_0x9902('0x6')]({'where':_0x414999,'raw':!![]})[_0x9902('0xc')](function(_0x1d7cd9){_0xb89793[_0x9902('0x7')]=_[_0x9902('0x8')](_0x1d7cd9,function(_0x1d29d3){return _0x1d29d3[_0x9902('0xd')];});_0x2a9ed6(_0xb89793);})['catch'](function(_0x21f6a7){_0x57a3bb(_0x21f6a7);});});}function _0x2c1066(_0x158a6d,_0xd14e87,_0x372a09){if(!_0xd14e87)return Promise[_0x9902('0xe')](null);return new Promise(function(_0x19a94e,_0x40fb44){return _0x2bb724[_0x9902('0xf')]['findAll']({'where':{'sectionId':_0xd14e87['id']},'raw':!![]})[_0x9902('0xc')](function(_0x5192f3){if(_0x158a6d[_0x9902('0xa')]&&_0x158a6d[_0x9902('0xa')]!=='id'){_0xd14e87[_0x9902('0x7')]=_[_0x9902('0x8')](_0x5192f3,function(_0x16f90a){return _0x16f90a[_0x158a6d['field']];});}else{if(_0x372a09===_0x9902('0x10')){_0xd14e87[_0x9902('0x7')]=_[_0x9902('0x8')](_0x5192f3,function(_0x4f1b33){return{'id':_0x4f1b33[_0x9902('0x11')],'type':_0x4f1b33[_0x9902('0x12')]};});}else{_0xd14e87['associatedResources']=_['map'](_0x5192f3,function(_0x4cc9c7){return _0x4cc9c7[_0x9902('0x11')];});}}_0x19a94e(_0xd14e87);})[_0x9902('0x9')](function(_0x9d365){_0x40fb44(_0x9d365);});});}function _0x3aafca(_0x751b15,_0x12fd50){var _0x2fd2f2={'parentSections':[]};switch(_0x751b15[_0x9902('0x13')]()){case _0x9902('0x14'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x16');break;case _0x9902('0x17'):_0x2fd2f2[_0x9902('0x15')]='SquareOdbc';break;case _0x9902('0x18'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x19');_0x2fd2f2[_0x9902('0x1a')]=[{'name':'SquareProjects','field':'name','foreignKey':_0x9902('0x1b')}];break;case'projects':_0x2fd2f2['childModel']='JscriptyProject';break;case _0x9902('0x1c'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x1d');_0x2fd2f2[_0x9902('0x1a')]=[{'name':_0x9902('0x1e'),'field':'id','foreignKey':_0x9902('0x1f')}];break;case _0x9902('0x20'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x21');break;case _0x9902('0x22'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x23');break;case _0x9902('0x24'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x25');break;case _0x9902('0x26'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x27');break;case _0x9902('0x28'):_0x2fd2f2['childModel']=_0x9902('0x29');break;case _0x9902('0x2a'):_0x2fd2f2['childModel']=_0x9902('0x2b');break;case _0x9902('0x2c'):_0x2fd2f2['childModel']=_0x9902('0x2d');break;case _0x9902('0x2e'):case'internalroutes':case _0x9902('0x2f'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x30');break;case _0x9902('0x31'):_0x2fd2f2['childModel']='VoiceContext';break;case _0x9902('0x32'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x33');break;case'voicerecordings':_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x34');_0x2fd2f2[_0x9902('0x1a')]=[{'name':'Agents','field':_0x9902('0xd'),'foreignKey':_0x9902('0x35'),'model':_0x9902('0x36'),'filter':{'field':_0x9902('0x37'),'value':[_0x9902('0x38')]}},{'name':'Telephones','field':_0x9902('0xd'),'foreignKey':_0x9902('0x35'),'model':'User','filter':{'field':'role','value':[_0x9902('0x39')]}},{'name':'VoiceQueues','field':'name','foreignKey':_0x9902('0x3a'),'model':_0x9902('0x3b'),'filter':{'field':_0x9902('0x12'),'value':['inbound']}},{'name':'QueueCampaigns','field':_0x9902('0xd'),'foreignKey':'queue','model':_0x9902('0x3b'),'filter':{'field':_0x9902('0x12'),'value':['outbound']}}];break;case _0x9902('0x3c'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x3d');break;case _0x9902('0x3e'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x3f');break;case _0x9902('0x40'):_0x2fd2f2['childModel']=_0x9902('0x41');break;case _0x9902('0x42'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x43');break;case'mailqueues':_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x44');break;case _0x9902('0x45'):_0x2fd2f2[_0x9902('0x15')]='MailAccount';break;case _0x9902('0x46'):_0x2fd2f2['childModel']='MailSubstatus';break;case _0x9902('0x47'):_0x2fd2f2['childModel']=_0x9902('0x48');break;case _0x9902('0x49'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x4a');break;case'smsqueues':_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x4b');break;case _0x9902('0x4c'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x4d');break;case _0x9902('0x4e'):_0x2fd2f2['childModel']=_0x9902('0x4f');break;case _0x9902('0x50'):_0x2fd2f2['childModel']=_0x9902('0x51');break;case _0x9902('0x52'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x53');break;case _0x9902('0x54'):case'queuecampaigns':_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x3b');if(_0x12fd50){_0x2fd2f2['parentSections']=[{'name':_0x9902('0x55')},{'name':_0x9902('0x56')}];}break;case _0x9902('0x57'):case'agents':case _0x9902('0x58'):_0x2fd2f2[_0x9902('0x15')]='User';if(_0x12fd50){_0x2fd2f2[_0x9902('0x1a')]=[{'name':_0x9902('0x59'),'filter':{'field':'role','value':[_0x9902('0x5a'),'user']},'ignore':!![]},{'name':_0x9902('0x5b')},{'name':_0x9902('0x5c')}];}break;case _0x9902('0x5d'):_0x2fd2f2['childModel']=_0x9902('0x5e');break;case _0x9902('0x5f'):_0x2fd2f2['childModel']=_0x9902('0x60');break;case'freshdeskaccounts':_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x61');break;case _0x9902('0x62'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x63');break;case _0x9902('0x64'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x65');break;case _0x9902('0x66'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x67');break;case'vtigeraccounts':_0x2fd2f2['childModel']='User';break;case _0x9902('0x68'):_0x2fd2f2[_0x9902('0x15')]='CannedAnswer';break;case'dispositions':_0x2fd2f2['childModel']=_0x9902('0x69');break;case _0x9902('0x6a'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x6b');break;case _0x9902('0x6c'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x6d');break;case _0x9902('0x6e'):_0x2fd2f2['childModel']=_0x9902('0x6f');break;case'scheduler':_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x70');break;case _0x9902('0x71'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x72');break;case'tags':_0x2fd2f2['childModel']='Tag';break;case _0x9902('0x73'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x74');break;case _0x9902('0x75'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x76');break;case _0x9902('0x77'):_0x2fd2f2[_0x9902('0x15')]=_0x9902('0x78');break;case _0x9902('0x79'):_0x2fd2f2['childModel']=_0x9902('0x7a');break;case _0x9902('0x7b'):_0x2fd2f2[_0x9902('0x15')]='Plugin';break;case _0x9902('0x7c'):_0x2fd2f2['childModel']=_0x9902('0x10');_0x2fd2f2['parentSections']=[{'name':_0x9902('0x7d'),'field':'id','foreignKey':_0x9902('0x7e')}];break;case _0x9902('0x7f'):_0x2fd2f2['childModel']='AnalyticMetric';break;}return _0x2fd2f2;}function _0x1b3960(_0x200246,_0x9e77c2){var _0x3d751c=_0x200246['charAt'](0x0)[_0x9902('0x80')]()+_0x200246[_0x9902('0x81')](0x1);var _0x2648b4={'type':_0x2bb724['Sequelize']['QueryTypes'][_0x9902('0x82')],'raw':!![]};return new Promise(function(_0x36310c,_0x12c4c3){var _0x19a847=squel['select']()[_0x9902('0xa')](_0x9902('0x83')+_0x3d751c+'InteractionId','id')[_0x9902('0xa')]('ui.createdAt')[_0x9902('0x84')](_0x9902('0x85')+_0x200246+'_interactions','ui')['where'](_0x9902('0x86'),_0x9e77c2['id']);return _0x2bb724[_0x9902('0x87')][_0x9902('0x88')](_0x19a847[_0x9902('0x89')](),_0x2648b4)[_0x9902('0xc')](function(_0x19f645){_0x9e77c2[_0x3d751c+_0x9902('0x8a')]=_0x19f645;_0x36310c(_0x19f645);})['catch'](function(_0x458fe3){_0x12c4c3(_0x458fe3);});});}return _0x1c39ba[_0x9902('0x8b')](_0x9902('0x8c'),attributes,{'tableName':_0x9902('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x24cf1b){var _0x1eb410=require(_0x9902('0x8e'));var _0x65b5b7={'raw':_0x24cf1b[_0x9902('0x88')][_0x9902('0x8f')],'where':{}};var _0x46c87d={};var _0x2b146e={'count':0x0,'rows':[]};var _0x29f713=_0x24cf1b['query']['section'];var _0x2321a3=_0x24cf1b[_0x9902('0x88')][_0x9902('0x90')]||![];var _0x4a0683=_0x3aafca(_0x29f713,_0x2321a3);if(!_0x4a0683[_0x9902('0x15')])throw new Error(_0x9902('0x91')+_0x29f713+'\x27');var _0x455050=[{'name':_0x29f713}];if(!_[_0x9902('0x92')](_0x4a0683[_0x9902('0x1a')]))_0x455050=_0x4a0683[_0x9902('0x1a')];var _0x3a5fd6=[];for(var _0x4b53e8=0x0;_0x4b53e8<_0x455050['length'];_0x4b53e8++){_0x3a5fd6[_0x9902('0x93')](_0x2bb724[_0x9902('0x94')][_0x9902('0x95')]({'where':{'userProfileId':_0x24cf1b[_0x9902('0x96')]['id'],'name':_0x455050[_0x4b53e8][_0x9902('0xd')]},'raw':!![]}));}return Promise[_0x9902('0x97')](_0x3a5fd6)[_0x9902('0xc')](function(_0x54cc1b){var _0x167296=_['filter'](_0x54cc1b,function(_0x2b4b79){return _0x2b4b79?_0x2b4b79:undefined;});var _0x2df428=_['filter'](_0x455050,[_0x9902('0x98'),!![]]);var _0x12201c=_[_0x9902('0x92')](_0x167296)&&_[_0x9902('0x92')](_0x2df428)?null:_['union'](_0x2df428,_0x167296);if(!_0x12201c)return null;var _0x41276c=[];for(var _0x30bdb5=0x0;_0x30bdb5<_0x12201c[_0x9902('0x99')];_0x30bdb5++){var _0x317ac2=_[_0x9902('0x95')](_0x455050,function(_0x1ffb72){return _0x12201c[_0x30bdb5]?_0x1ffb72[_0x9902('0xd')]===_0x12201c[_0x30bdb5][_0x9902('0xd')]:null;});if(_0x317ac2){if(_0x12201c[_0x30bdb5]['ignore']){_0x41276c[_0x9902('0x93')](_0x17206c(_0x4a0683['childModel'],_0x12201c[_0x30bdb5]));}else{if(!_0x12201c[_0x30bdb5][_0x9902('0x9a')]){_0x41276c[_0x9902('0x93')](_0x2c1066(_0x317ac2,_0x12201c[_0x30bdb5],_0x4a0683[_0x9902('0x15')]));}else{if(_0x317ac2[_0x9902('0xb')]){_0x41276c['push'](_0x1b3145(_0x317ac2,_0x12201c[_0x30bdb5]));}}}}}return Promise[_0x9902('0x97')](_0x41276c);})[_0x9902('0xc')](function(_0x30e085){var _0x1169e7=_0x30e085;var _0x1c29ee=null;if(_0x1169e7){_0x1c29ee=_0x1169e7[_0x9902('0x99')]===0x1?_0x1169e7[0x0]:null;}if(!_0x1c29ee&&!_0x1169e7)return _0x2b146e;var _0x58a60f=_0x2bb724[_0x4a0683[_0x9902('0x15')]][_0x9902('0x9b')];_0x46c87d[_0x9902('0xb')]=_['keys'](_0x58a60f);_0x46c87d[_0x9902('0x88')]=_[_0x9902('0x9c')](_0x24cf1b[_0x9902('0x88')]);_0x46c87d[_0x9902('0x9d')]=_[_0x9902('0x9e')](_0x46c87d['model'],_0x46c87d[_0x9902('0x88')]);_0x65b5b7[_0x9902('0x9f')]=_[_0x9902('0x9e')](_0x46c87d['model'],_0x1eb410[_0x9902('0xa0')](_0x24cf1b['query']['fields']));_0x65b5b7[_0x9902('0x9f')]=_0x65b5b7[_0x9902('0x9f')][_0x9902('0x99')]?_0x65b5b7[_0x9902('0x9f')]:_0x46c87d[_0x9902('0xb')];if(!_0x24cf1b[_0x9902('0x88')][_0x9902('0xa1')]('nolimit')){_0x65b5b7[_0x9902('0xa2')]=_0x1eb410[_0x9902('0xa2')](_0x24cf1b['query'][_0x9902('0xa2')]);_0x65b5b7[_0x9902('0xa3')]=_0x1eb410[_0x9902('0xa3')](_0x24cf1b[_0x9902('0x88')][_0x9902('0xa3')]);}_0x65b5b7[_0x9902('0xa4')]=_0x1eb410['sort'](_0x24cf1b[_0x9902('0x88')][_0x9902('0xa5')]);_0x65b5b7[_0x9902('0xa6')]=_0x1eb410[_0x9902('0x9d')](_['pick'](_0x24cf1b[_0x9902('0x88')],_0x46c87d[_0x9902('0x9d')]));if(_0x24cf1b['query']['filter']){_0x65b5b7['where']=_[_0x9902('0xa7')](_0x65b5b7[_0x9902('0xa6')],{'$or':_['map'](_0x58a60f,function(_0x148280){if(_0x148280['type'][_0x9902('0xa8')]!==_0x9902('0xa9')){var _0x12c7a3={};_0x12c7a3[_0x148280['field']]={'$like':'%'+_0x24cf1b[_0x9902('0x88')][_0x9902('0x4')]+'%'};return _0x12c7a3;}})});}var _0x4d0217=[];var _0x52c9c4=null;var _0x19a02b={};if(_0x1c29ee){_0x52c9c4=_['find'](_0x455050,['name',_0x1c29ee[_0x9902('0xd')]]);if(_0x52c9c4[_0x9902('0xa')]){_0x19a02b={};if(_0x4a0683['childModel']===_0x9902('0x10')){_0x19a02b[_0x52c9c4['foreignKey']]=_[_0x9902('0x8')](_0x1c29ee[_0x9902('0x7')],'id');}else{_0x19a02b[_0x52c9c4[_0x9902('0xaa')]]=_0x1c29ee[_0x9902('0x7')];}_0x4d0217[_0x9902('0x93')](_0x19a02b);}else{_0x65b5b7['where']['id']=_0x1c29ee[_0x9902('0x7')];}}else{for(var _0xc0999a=0x0;_0xc0999a<_0x1169e7[_0x9902('0x99')];_0xc0999a++){_0x52c9c4=_[_0x9902('0x95')](_0x455050,[_0x9902('0xd'),_0x1169e7[_0xc0999a][_0x9902('0xd')]]);if(_0x52c9c4[_0x9902('0xa')]){_0x19a02b={};_0x19a02b[_0x52c9c4[_0x9902('0xaa')]]=_0x1169e7[_0xc0999a]['associatedResources'];_0x4d0217[_0x9902('0x93')](_0x19a02b);}else{if(!_0x65b5b7[_0x9902('0xa6')]['id'])_0x65b5b7['where']['id']=[];_0x1169e7[_0xc0999a][_0x9902('0x7')]['forEach'](function(_0x215d79){_0x65b5b7[_0x9902('0xa6')]['id'][_0x9902('0x93')](_0x215d79);});}}}if(!_['isEmpty'](_0x4d0217)){_0x65b5b7['where']=_[_0x9902('0xa7')](_0x65b5b7['where'],{'$and':{'$or':_0x4d0217}});}_0x65b5b7=_[_0x9902('0xa7')]({},_0x65b5b7,_0x24cf1b['options']);if(_0x1c29ee&&!_0x1c29ee['autoAssociation']&&_0x4a0683[_0x9902('0x15')]===_0x9902('0x10')){if(_0x24cf1b[_0x9902('0x88')]['includeAll']){_0x65b5b7[_0x9902('0xab')]=[{'all':!![]}];}return _0x2bb724[_0x4a0683[_0x9902('0x15')]][_0x9902('0x6')](_0x65b5b7)[_0x9902('0xc')](function(_0x2dfebc){var _0x903702=[];_0x2dfebc[_0x9902('0xac')](function(_0x2737eb){var _0x379797;switch(_0x2737eb['reportType']){case _0x9902('0xad'):_0x379797=_[_0x9902('0x95')](_0x1c29ee[_0x9902('0x7')],function(_0xd2620b){return _0xd2620b['id']===_0x2737eb[_0x9902('0x7e')]&&_0xd2620b['type']===_0x9902('0xae');});break;case'custom':_0x379797=_[_0x9902('0x95')](_0x1c29ee[_0x9902('0x7')],function(_0x4e3402){return _0x4e3402['id']===_0x2737eb[_0x9902('0x7e')]&&_0x4e3402[_0x9902('0x12')]===_0x9902('0xaf');});break;}if(_0x379797)_0x903702[_0x9902('0x93')](_0x2737eb);});_0x2b146e[_0x9902('0xb0')]=_0x903702['length'];_0x2b146e[_0x9902('0xb1')]=_0x903702;return _0x2b146e;});}else{if(!_[_0x9902('0x92')](_0x24cf1b[_0x9902('0x88')][_0x9902('0xb2')])){_0x65b5b7[_0x9902('0xa6')]['id']=_0x65b5b7[_0x9902('0xa6')]['id']?_[_0x9902('0x9e')](_0x65b5b7['where']['id'],_0x24cf1b['query']['ids']):_0x24cf1b[_0x9902('0x88')]['ids'];if(_0x24cf1b['query'][_0x9902('0xb3')]){_0x65b5b7[_0x9902('0xa4')]=_0x24cf1b[_0x9902('0x88')][_0x9902('0xb3')];}}if(_0x24cf1b[_0x9902('0x88')][_0x9902('0xb4')]){_0x65b5b7[_0x9902('0xa6')]=_[_0x9902('0xa7')](_0x65b5b7[_0x9902('0xa6')],{'$and':_0x24cf1b['query'][_0x9902('0xb4')]});}return _0x2bb724[_0x4a0683[_0x9902('0x15')]][_0x9902('0xb0')]({'where':_0x65b5b7[_0x9902('0xa6')]})[_0x9902('0xc')](function(_0x39c205){_0x2b146e[_0x9902('0xb0')]=_0x39c205;if(_0x24cf1b[_0x9902('0x88')][_0x9902('0xb5')]){if(_0x4a0683[_0x9902('0x15')]===_0x9902('0x1d')){_0x65b5b7[_0x9902('0xab')]=[{'model':_0x2bb724[_0x9902('0xb6')],'as':'Tags','attributes':['id',_0x9902('0xd'),_0x9902('0xb7')],'required':_0x24cf1b['query'][_0x9902('0xb8')]?!![]:![]},{'model':_0x2bb724[_0x9902('0xb6')],'as':_0x9902('0xb9'),'attributes':['id',_0x9902('0xd'),_0x9902('0xb7')],'through':_0x24cf1b[_0x9902('0x88')][_0x9902('0xb8')]?{'attributes':[],'where':{'TagId':_0x24cf1b[_0x9902('0x88')][_0x9902('0xb8')]||undefined}}:{},'required':_0x24cf1b[_0x9902('0x88')][_0x9902('0xb8')]?!![]:![]}];}else{_0x65b5b7['include']=[{'all':!![]}];}}return _0x2bb724[_0x4a0683[_0x9902('0x15')]][_0x9902('0x6')](_0x65b5b7);})['then'](function(_0x4865ad){_0x2b146e[_0x9902('0xb1')]=_0x4865ad;if(_0x29f713==='Agents'&&_0x24cf1b[_0x9902('0x88')]['openTabs']===_0x9902('0xba')){var _0x21f7da=[];for(var _0x3cf8ec=0x0;_0x3cf8ec<_0x2b146e[_0x9902('0xb1')][_0x9902('0x99')];_0x3cf8ec++){_0x21f7da[_0x9902('0x93')](_0x1b3960(_0x9902('0xbb'),_0x2b146e[_0x9902('0xb1')][_0x3cf8ec][_0x9902('0xbc')]));_0x21f7da[_0x9902('0x93')](_0x1b3960(_0x9902('0xbd'),_0x2b146e[_0x9902('0xb1')][_0x3cf8ec][_0x9902('0xbc')]));_0x21f7da['push'](_0x1b3960(_0x9902('0xbe'),_0x2b146e[_0x9902('0xb1')][_0x3cf8ec][_0x9902('0xbc')]));_0x21f7da[_0x9902('0x93')](_0x1b3960(_0x9902('0xbf'),_0x2b146e[_0x9902('0xb1')][_0x3cf8ec][_0x9902('0xbc')]));_0x21f7da[_0x9902('0x93')](_0x1b3960(_0x9902('0xc0'),_0x2b146e[_0x9902('0xb1')][_0x3cf8ec][_0x9902('0xbc')]));_0x21f7da[_0x9902('0x93')](_0x1b3960(_0x9902('0xc1'),_0x2b146e[_0x9902('0xb1')][_0x3cf8ec][_0x9902('0xbc')]));}return Promise[_0x9902('0x97')](_0x21f7da)[_0x9902('0xc')](function(){return _0x2b146e;});}return _0x2b146e;});}});}}});}; \ No newline at end of file +var _0x3785=['query','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','autoAssociation','model','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','where','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','reportType','default','reportId','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','color','tag','ThroughTags','chat','dataValues','sms','fax','openchannel','lodash','./userProfile.attributes','filter','field','value','findAll','then','associatedResources','map','name','catch','resolve','UserProfileResource','AnalyticExtractedReport','type','resourceId','toLowerCase','squareprojects','childModel','odbc','squarerecordings','SquareRecording','projectName','projects','contacts','CmContact','parentSections','ListId','lists','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','User','role','Telephones','membername','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','users','agents','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','pauses','Pause','scheduler','Schedule','sounds','Tag','templates','Template','triggers','trunks','Trunk','variables','Plugin','extractedreports','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','OpenTabs','define','user_profiles','../../components/parsers/qs'];(function(_0x3bd430,_0x52dc94){var _0x45a902=function(_0x3bd504){while(--_0x3bd504){_0x3bd430['push'](_0x3bd430['shift']());}};_0x45a902(++_0x52dc94);}(_0x3785,0xeb));var _0x5378=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0x3785[_0x4de586];return _0x46baf5;};'use strict';var _=require(_0x5378('0x0'));var attributes=require(_0x5378('0x1'));var squel=require('squel');module['exports']=function(_0xd53d5e){var _0x2a797a=_0xd53d5e['models'];function _0x1e52ca(_0x2ff199,_0x51c67b){return new Promise(function(_0x4a80c0,_0x263d70){if(!_0x51c67b)return _0x4a80c0(null);var _0x489ce7=_0x51c67b[_0x5378('0x2')]?{[_0x51c67b['filter'][_0x5378('0x3')]]:_0x51c67b[_0x5378('0x2')][_0x5378('0x4')]}:undefined;return _0x2a797a[_0x2ff199][_0x5378('0x5')]({'where':_0x489ce7,'raw':!![]})[_0x5378('0x6')](function(_0x4aebae){_0x51c67b[_0x5378('0x7')]=_[_0x5378('0x8')](_0x4aebae,'id');_0x4a80c0(_0x51c67b);})['catch'](function(_0x300577){_0x263d70(_0x300577);});});}function _0x31057a(_0xc0829b,_0x5178e0){return new Promise(function(_0xd05da0,_0x382ca6){var _0x34b333=_0xc0829b[_0x5378('0x2')]?{[_0xc0829b['filter'][_0x5378('0x3')]]:_0xc0829b['filter']['value']}:undefined;return _0x2a797a[_0xc0829b['model']][_0x5378('0x5')]({'where':_0x34b333,'raw':!![]})[_0x5378('0x6')](function(_0x20f0ae){_0x5178e0[_0x5378('0x7')]=_[_0x5378('0x8')](_0x20f0ae,function(_0x17cec2){return _0x17cec2[_0x5378('0x9')];});_0xd05da0(_0x5178e0);})[_0x5378('0xa')](function(_0xbb2c2f){_0x382ca6(_0xbb2c2f);});});}function _0x30d636(_0x5b3a9c,_0x1af71b,_0x5772a2){if(!_0x1af71b)return Promise[_0x5378('0xb')](null);return new Promise(function(_0x1b9636,_0x506f0d){return _0x2a797a[_0x5378('0xc')][_0x5378('0x5')]({'where':{'sectionId':_0x1af71b['id']},'raw':!![]})[_0x5378('0x6')](function(_0x2f0853){if(_0x5b3a9c[_0x5378('0x3')]&&_0x5b3a9c[_0x5378('0x3')]!=='id'){_0x1af71b[_0x5378('0x7')]=_[_0x5378('0x8')](_0x2f0853,function(_0x2dbb2c){return _0x2dbb2c[_0x5b3a9c[_0x5378('0x3')]];});}else{if(_0x5772a2===_0x5378('0xd')){_0x1af71b[_0x5378('0x7')]=_[_0x5378('0x8')](_0x2f0853,function(_0x14869d){return{'id':_0x14869d['resourceId'],'type':_0x14869d[_0x5378('0xe')]};});}else{_0x1af71b['associatedResources']=_[_0x5378('0x8')](_0x2f0853,function(_0x1c537d){return _0x1c537d[_0x5378('0xf')];});}}_0x1b9636(_0x1af71b);})[_0x5378('0xa')](function(_0x2fcb11){_0x506f0d(_0x2fcb11);});});}function _0x119e44(_0x5813c9,_0x32901e){var _0x57720c={'parentSections':[]};switch(_0x5813c9[_0x5378('0x10')]()){case _0x5378('0x11'):_0x57720c[_0x5378('0x12')]='SquareProject';break;case _0x5378('0x13'):_0x57720c[_0x5378('0x12')]='SquareOdbc';break;case _0x5378('0x14'):_0x57720c[_0x5378('0x12')]=_0x5378('0x15');_0x57720c['parentSections']=[{'name':'SquareProjects','field':_0x5378('0x9'),'foreignKey':_0x5378('0x16')}];break;case _0x5378('0x17'):_0x57720c[_0x5378('0x12')]='JscriptyProject';break;case _0x5378('0x18'):_0x57720c[_0x5378('0x12')]=_0x5378('0x19');_0x57720c[_0x5378('0x1a')]=[{'name':'Lists','field':'id','foreignKey':_0x5378('0x1b')}];break;case _0x5378('0x1c'):_0x57720c[_0x5378('0x12')]='CmList';break;case _0x5378('0x1d'):_0x57720c['childModel']=_0x5378('0x1e');break;case'globalcustomfields':_0x57720c[_0x5378('0x12')]=_0x5378('0x1f');break;case _0x5378('0x20'):_0x57720c[_0x5378('0x12')]=_0x5378('0x21');break;case _0x5378('0x22'):_0x57720c[_0x5378('0x12')]=_0x5378('0x23');break;case'faxqueues':_0x57720c['childModel']='FaxQueue';break;case'faxaccounts':_0x57720c['childModel']='FaxAccount';break;case'inboundroutes':case'internalroutes':case _0x5378('0x24'):_0x57720c[_0x5378('0x12')]='VoiceExtension';break;case _0x5378('0x25'):_0x57720c[_0x5378('0x12')]=_0x5378('0x26');break;case _0x5378('0x27'):_0x57720c['childModel']=_0x5378('0x28');break;case _0x5378('0x29'):_0x57720c['childModel']=_0x5378('0x2a');_0x57720c[_0x5378('0x1a')]=[{'name':'Agents','field':_0x5378('0x9'),'foreignKey':'membername','model':_0x5378('0x2b'),'filter':{'field':_0x5378('0x2c'),'value':['agent']}},{'name':_0x5378('0x2d'),'field':_0x5378('0x9'),'foreignKey':_0x5378('0x2e'),'model':_0x5378('0x2b'),'filter':{'field':_0x5378('0x2c'),'value':[_0x5378('0x2f')]}},{'name':_0x5378('0x30'),'field':_0x5378('0x9'),'foreignKey':_0x5378('0x31'),'model':_0x5378('0x32'),'filter':{'field':_0x5378('0xe'),'value':['inbound']}},{'name':_0x5378('0x33'),'field':_0x5378('0x9'),'foreignKey':_0x5378('0x31'),'model':_0x5378('0x32'),'filter':{'field':_0x5378('0xe'),'value':['outbound']}}];break;case'musiconholds':_0x57720c[_0x5378('0x12')]=_0x5378('0x34');break;case _0x5378('0x35'):_0x57720c['childModel']=_0x5378('0x36');break;case _0x5378('0x37'):_0x57720c[_0x5378('0x12')]=_0x5378('0x38');break;case _0x5378('0x39'):_0x57720c[_0x5378('0x12')]=_0x5378('0x3a');break;case _0x5378('0x3b'):_0x57720c[_0x5378('0x12')]=_0x5378('0x3c');break;case _0x5378('0x3d'):_0x57720c['childModel']='MailAccount';break;case _0x5378('0x3e'):_0x57720c[_0x5378('0x12')]=_0x5378('0x3f');break;case _0x5378('0x40'):_0x57720c[_0x5378('0x12')]=_0x5378('0x41');break;case'openchannelaccounts':_0x57720c[_0x5378('0x12')]=_0x5378('0x42');break;case _0x5378('0x43'):_0x57720c[_0x5378('0x12')]=_0x5378('0x44');break;case'smsaccounts':_0x57720c[_0x5378('0x12')]=_0x5378('0x45');break;case _0x5378('0x46'):_0x57720c['childModel']=_0x5378('0x47');break;case _0x5378('0x48'):_0x57720c[_0x5378('0x12')]='WhatsappAccount';break;case _0x5378('0x49'):_0x57720c[_0x5378('0x12')]=_0x5378('0x4a');break;case _0x5378('0x4b'):case _0x5378('0x4c'):_0x57720c['childModel']='VoiceQueue';if(_0x32901e){_0x57720c['parentSections']=[{'name':_0x5378('0x30')},{'name':'QueueCampaigns'}];}break;case _0x5378('0x4d'):case _0x5378('0x4e'):case'telephones':_0x57720c[_0x5378('0x12')]=_0x5378('0x2b');if(_0x32901e){_0x57720c[_0x5378('0x1a')]=[{'name':'Users','filter':{'field':_0x5378('0x2c'),'value':[_0x5378('0x4f'),_0x5378('0x50')]},'ignore':!![]},{'name':_0x5378('0x51')},{'name':_0x5378('0x2d')}];}break;case _0x5378('0x52'):_0x57720c['childModel']=_0x5378('0x53');break;case _0x5378('0x54'):_0x57720c['childModel']=_0x5378('0x55');break;case'freshdeskaccounts':_0x57720c['childModel']=_0x5378('0x56');break;case _0x5378('0x57'):_0x57720c[_0x5378('0x12')]=_0x5378('0x58');break;case _0x5378('0x59'):_0x57720c[_0x5378('0x12')]=_0x5378('0x5a');break;case'zohoaccounts':_0x57720c[_0x5378('0x12')]=_0x5378('0x5b');break;case'vtigeraccounts':_0x57720c[_0x5378('0x12')]='User';break;case _0x5378('0x5c'):_0x57720c[_0x5378('0x12')]=_0x5378('0x5d');break;case _0x5378('0x5e'):_0x57720c['childModel']=_0x5378('0x5f');break;case _0x5378('0x60'):_0x57720c[_0x5378('0x12')]=_0x5378('0x61');break;case'intervals':_0x57720c[_0x5378('0x12')]='Interval';break;case _0x5378('0x62'):_0x57720c['childModel']=_0x5378('0x63');break;case _0x5378('0x64'):_0x57720c[_0x5378('0x12')]=_0x5378('0x65');break;case _0x5378('0x66'):_0x57720c[_0x5378('0x12')]='Sound';break;case'tags':_0x57720c[_0x5378('0x12')]=_0x5378('0x67');break;case _0x5378('0x68'):_0x57720c[_0x5378('0x12')]=_0x5378('0x69');break;case _0x5378('0x6a'):_0x57720c[_0x5378('0x12')]='Trigger';break;case _0x5378('0x6b'):_0x57720c[_0x5378('0x12')]=_0x5378('0x6c');break;case _0x5378('0x6d'):_0x57720c['childModel']='Variable';break;case'plugins':_0x57720c[_0x5378('0x12')]=_0x5378('0x6e');break;case _0x5378('0x6f'):_0x57720c[_0x5378('0x12')]=_0x5378('0xd');_0x57720c['parentSections']=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0x5378('0x70'):_0x57720c[_0x5378('0x12')]=_0x5378('0x71');break;}return _0x57720c;}function _0x1c771a(_0xe610c5,_0xa1d064){var _0x3d68a3=_0xe610c5[_0x5378('0x72')](0x0)[_0x5378('0x73')]()+_0xe610c5[_0x5378('0x74')](0x1);var _0x2122c8={'type':_0x2a797a[_0x5378('0x75')][_0x5378('0x76')][_0x5378('0x77')],'raw':!![]};return new Promise(function(_0x5e219c,_0x2b07ce){var _0xf79b19=squel['select']()['field'](_0x5378('0x78')+_0x3d68a3+_0x5378('0x79'),'id')[_0x5378('0x3')]('ui.createdAt')[_0x5378('0x7a')](_0x5378('0x7b')+_0xe610c5+_0x5378('0x7c'),'ui')['where'](_0x5378('0x7d'),_0xa1d064['id']);return _0x2a797a[_0x5378('0x7e')]['query'](_0xf79b19['toString'](),_0x2122c8)['then'](function(_0x409e92){_0xa1d064[_0x3d68a3+_0x5378('0x7f')]=_0x409e92;_0x5e219c(_0x409e92);})[_0x5378('0xa')](function(_0x15a885){_0x2b07ce(_0x15a885);});});}return _0xd53d5e[_0x5378('0x80')]('UserProfile',attributes,{'tableName':_0x5378('0x81'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x214b18){var _0x44a5bb=require(_0x5378('0x82'));var _0x74dbd1={'raw':_0x214b18[_0x5378('0x83')]['raw'],'where':{}};var _0x336023={};var _0x36342f={'count':0x0,'rows':[]};var _0x506c9e=_0x214b18[_0x5378('0x83')]['section'];var _0x246f38=_0x214b18[_0x5378('0x83')]['mergeResources']||![];var _0x40e5f9=_0x119e44(_0x506c9e,_0x246f38);if(!_0x40e5f9[_0x5378('0x12')])throw new Error('Invalid\x20section\x20\x27'+_0x506c9e+'\x27');var _0x4cdca1=[{'name':_0x506c9e}];if(!_[_0x5378('0x84')](_0x40e5f9[_0x5378('0x1a')]))_0x4cdca1=_0x40e5f9[_0x5378('0x1a')];var _0x3424cc=[];for(var _0x51d9b7=0x0;_0x51d9b7<_0x4cdca1[_0x5378('0x85')];_0x51d9b7++){_0x3424cc[_0x5378('0x86')](_0x2a797a[_0x5378('0x87')][_0x5378('0x88')]({'where':{'userProfileId':_0x214b18[_0x5378('0x89')]['id'],'name':_0x4cdca1[_0x51d9b7][_0x5378('0x9')]},'raw':!![]}));}return Promise[_0x5378('0x8a')](_0x3424cc)[_0x5378('0x6')](function(_0x2404fb){var _0x46ccbf=_[_0x5378('0x2')](_0x2404fb,function(_0x2dd6b3){return _0x2dd6b3?_0x2dd6b3:undefined;});var _0x208047=_[_0x5378('0x2')](_0x4cdca1,[_0x5378('0x8b'),!![]]);var _0x1ff864=_[_0x5378('0x84')](_0x46ccbf)&&_[_0x5378('0x84')](_0x208047)?null:_[_0x5378('0x8c')](_0x208047,_0x46ccbf);if(!_0x1ff864)return null;var _0x1c7d56=[];for(var _0x17f722=0x0;_0x17f722<_0x1ff864['length'];_0x17f722++){var _0x492116=_[_0x5378('0x88')](_0x4cdca1,function(_0x2945e7){return _0x1ff864[_0x17f722]?_0x2945e7[_0x5378('0x9')]===_0x1ff864[_0x17f722][_0x5378('0x9')]:null;});if(_0x492116){if(_0x1ff864[_0x17f722]['ignore']){_0x1c7d56[_0x5378('0x86')](_0x1e52ca(_0x40e5f9[_0x5378('0x12')],_0x1ff864[_0x17f722]));}else{if(!_0x1ff864[_0x17f722][_0x5378('0x8d')]){_0x1c7d56[_0x5378('0x86')](_0x30d636(_0x492116,_0x1ff864[_0x17f722],_0x40e5f9[_0x5378('0x12')]));}else{if(_0x492116[_0x5378('0x8e')]){_0x1c7d56['push'](_0x31057a(_0x492116,_0x1ff864[_0x17f722]));}}}}}return Promise[_0x5378('0x8a')](_0x1c7d56);})[_0x5378('0x6')](function(_0x4933cb){var _0x8a56b=_0x4933cb;var _0x3bbc98=null;if(_0x8a56b){_0x3bbc98=_0x8a56b[_0x5378('0x85')]===0x1?_0x8a56b[0x0]:null;}if(!_0x3bbc98&&!_0x8a56b)return _0x36342f;var _0x4850eb=_0x2a797a[_0x40e5f9[_0x5378('0x12')]][_0x5378('0x8f')];_0x336023[_0x5378('0x8e')]=_[_0x5378('0x90')](_0x4850eb);_0x336023[_0x5378('0x83')]=_[_0x5378('0x90')](_0x214b18[_0x5378('0x83')]);_0x336023[_0x5378('0x91')]=_[_0x5378('0x92')](_0x336023[_0x5378('0x8e')],_0x336023[_0x5378('0x83')]);_0x74dbd1[_0x5378('0x93')]=_['intersection'](_0x336023[_0x5378('0x8e')],_0x44a5bb[_0x5378('0x94')](_0x214b18[_0x5378('0x83')][_0x5378('0x94')]));_0x74dbd1[_0x5378('0x93')]=_0x74dbd1['attributes'][_0x5378('0x85')]?_0x74dbd1[_0x5378('0x93')]:_0x336023[_0x5378('0x8e')];if(!_0x214b18[_0x5378('0x83')][_0x5378('0x95')](_0x5378('0x96'))){_0x74dbd1[_0x5378('0x97')]=_0x44a5bb[_0x5378('0x97')](_0x214b18[_0x5378('0x83')][_0x5378('0x97')]);_0x74dbd1[_0x5378('0x98')]=_0x44a5bb[_0x5378('0x98')](_0x214b18[_0x5378('0x83')]['offset']);}_0x74dbd1[_0x5378('0x99')]=_0x44a5bb[_0x5378('0x9a')](_0x214b18[_0x5378('0x83')]['sort']);_0x74dbd1['where']=_0x44a5bb['filters'](_[_0x5378('0x9b')](_0x214b18[_0x5378('0x83')],_0x336023[_0x5378('0x91')]));if(_0x214b18['query'][_0x5378('0x2')]){_0x74dbd1[_0x5378('0x9c')]=_['merge'](_0x74dbd1[_0x5378('0x9c')],{'$or':_[_0x5378('0x8')](_0x4850eb,function(_0x1c350a){if(_0x1c350a[_0x5378('0xe')][_0x5378('0x9d')]!==_0x5378('0x9e')){var _0x4218af={};_0x4218af[_0x1c350a[_0x5378('0x3')]]={'$like':'%'+_0x214b18[_0x5378('0x83')][_0x5378('0x2')]+'%'};return _0x4218af;}})});}var _0x4450a2=[];var _0x252307=null;var _0x1aac54={};if(_0x3bbc98){_0x252307=_[_0x5378('0x88')](_0x4cdca1,['name',_0x3bbc98[_0x5378('0x9')]]);if(_0x252307[_0x5378('0x3')]){_0x1aac54={};if(_0x40e5f9[_0x5378('0x12')]==='AnalyticExtractedReport'){_0x1aac54[_0x252307['foreignKey']]=_[_0x5378('0x8')](_0x3bbc98['associatedResources'],'id');}else{_0x1aac54[_0x252307[_0x5378('0x9f')]]=_0x3bbc98['associatedResources'];}_0x4450a2[_0x5378('0x86')](_0x1aac54);}else{_0x74dbd1['where']['id']=_0x3bbc98[_0x5378('0x7')];}}else{for(var _0xc6f4ff=0x0;_0xc6f4ff<_0x8a56b[_0x5378('0x85')];_0xc6f4ff++){_0x252307=_[_0x5378('0x88')](_0x4cdca1,[_0x5378('0x9'),_0x8a56b[_0xc6f4ff][_0x5378('0x9')]]);if(_0x252307[_0x5378('0x3')]){_0x1aac54={};_0x1aac54[_0x252307[_0x5378('0x9f')]]=_0x8a56b[_0xc6f4ff][_0x5378('0x7')];_0x4450a2[_0x5378('0x86')](_0x1aac54);}else{if(!_0x74dbd1[_0x5378('0x9c')]['id'])_0x74dbd1[_0x5378('0x9c')]['id']=[];_0x8a56b[_0xc6f4ff]['associatedResources'][_0x5378('0xa0')](function(_0x4a2311){_0x74dbd1[_0x5378('0x9c')]['id'][_0x5378('0x86')](_0x4a2311);});}}}if(!_['isEmpty'](_0x4450a2)){_0x74dbd1['where']=_[_0x5378('0xa1')](_0x74dbd1[_0x5378('0x9c')],{'$and':{'$or':_0x4450a2}});}_0x74dbd1=_[_0x5378('0xa1')]({},_0x74dbd1,_0x214b18[_0x5378('0xa2')]);if(_0x3bbc98&&!_0x3bbc98[_0x5378('0x8d')]&&_0x40e5f9['childModel']===_0x5378('0xd')){if(_0x214b18['query'][_0x5378('0xa3')]){_0x74dbd1['include']=[{'all':!![]}];}return _0x2a797a[_0x40e5f9['childModel']][_0x5378('0x5')](_0x74dbd1)[_0x5378('0x6')](function(_0x182921){var _0x5badc3=[];_0x182921['forEach'](function(_0x503126){var _0x3caad0;switch(_0x503126[_0x5378('0xa4')]){case _0x5378('0xa5'):_0x3caad0=_[_0x5378('0x88')](_0x3bbc98[_0x5378('0x7')],function(_0x2dff63){return _0x2dff63['id']===_0x503126[_0x5378('0xa6')]&&_0x2dff63['type']===_0x5378('0xa7');});break;case _0x5378('0xa8'):_0x3caad0=_['find'](_0x3bbc98[_0x5378('0x7')],function(_0x1383df){return _0x1383df['id']===_0x503126[_0x5378('0xa6')]&&_0x1383df['type']===_0x5378('0xa9');});break;}if(_0x3caad0)_0x5badc3[_0x5378('0x86')](_0x503126);});_0x36342f[_0x5378('0xaa')]=_0x5badc3[_0x5378('0x85')];_0x36342f[_0x5378('0xab')]=_0x5badc3;return _0x36342f;});}else{if(!_[_0x5378('0x84')](_0x214b18['query'][_0x5378('0xac')])){_0x74dbd1['where']['id']=_0x74dbd1[_0x5378('0x9c')]['id']?_[_0x5378('0x92')](_0x74dbd1['where']['id'],_0x214b18[_0x5378('0x83')][_0x5378('0xac')]):_0x214b18[_0x5378('0x83')][_0x5378('0xac')];if(_0x214b18[_0x5378('0x83')][_0x5378('0xad')]){_0x74dbd1[_0x5378('0x99')]=_0x214b18['query'][_0x5378('0xad')];}}if(_0x214b18[_0x5378('0x83')][_0x5378('0xae')]){_0x74dbd1[_0x5378('0x9c')]=_['merge'](_0x74dbd1[_0x5378('0x9c')],{'$and':_0x214b18[_0x5378('0x83')][_0x5378('0xae')]});}return _0x2a797a[_0x40e5f9[_0x5378('0x12')]][_0x5378('0xaa')]({'where':_0x74dbd1['where']})[_0x5378('0x6')](function(_0x2c84fd){_0x36342f[_0x5378('0xaa')]=_0x2c84fd;if(_0x214b18[_0x5378('0x83')]['includeAll']){if(_0x40e5f9['childModel']==='CmContact'){_0x74dbd1['include']=[{'model':_0x2a797a['Tag'],'as':'Tags','attributes':['id',_0x5378('0x9'),_0x5378('0xaf')],'required':_0x214b18[_0x5378('0x83')][_0x5378('0xb0')]?!![]:![]},{'model':_0x2a797a['Tag'],'as':_0x5378('0xb1'),'attributes':['id',_0x5378('0x9'),_0x5378('0xaf')],'through':_0x214b18['query'][_0x5378('0xb0')]?{'attributes':[],'where':{'TagId':_0x214b18['query'][_0x5378('0xb0')]||undefined}}:{},'required':_0x214b18['query'][_0x5378('0xb0')]?!![]:![]}];}else{_0x74dbd1['include']=[{'all':!![]}];}}return _0x2a797a[_0x40e5f9['childModel']][_0x5378('0x5')](_0x74dbd1);})[_0x5378('0x6')](function(_0x17bde0){_0x36342f[_0x5378('0xab')]=_0x17bde0;if(_0x506c9e==='Agents'&&_0x214b18[_0x5378('0x83')]['openTabs']==='true'){var _0x379080=[];for(var _0x48bb22=0x0;_0x48bb22<_0x36342f[_0x5378('0xab')]['length'];_0x48bb22++){_0x379080[_0x5378('0x86')](_0x1c771a(_0x5378('0xb2'),_0x36342f[_0x5378('0xab')][_0x48bb22][_0x5378('0xb3')]));_0x379080['push'](_0x1c771a(_0x5378('0xb4'),_0x36342f[_0x5378('0xab')][_0x48bb22]['dataValues']));_0x379080[_0x5378('0x86')](_0x1c771a(_0x5378('0xb5'),_0x36342f['rows'][_0x48bb22][_0x5378('0xb3')]));_0x379080[_0x5378('0x86')](_0x1c771a('mail',_0x36342f[_0x5378('0xab')][_0x48bb22]['dataValues']));_0x379080[_0x5378('0x86')](_0x1c771a(_0x5378('0xb6'),_0x36342f[_0x5378('0xab')][_0x48bb22][_0x5378('0xb3')]));_0x379080[_0x5378('0x86')](_0x1c771a('whatsapp',_0x36342f[_0x5378('0xab')][_0x48bb22][_0x5378('0xb3')]));}return Promise['all'](_0x379080)[_0x5378('0x6')](function(){return _0x36342f;});}return _0x36342f;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index c471b08..11f3156 100644 --- a/server/api/userProfile/userProfile.rpc.js +++ b/server/api/userProfile/userProfile.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcaaf=['redis','defaults','localhost','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x58ecad,_0x3546ea){var _0x52edd6=function(_0x1ed58f){while(--_0x1ed58f){_0x58ecad['push'](_0x58ecad['shift']());}};_0x52edd6(++_0x3546ea);}(_0xcaaf,0x66));var _0xfcaa=function(_0x396973,_0x28c41b){_0x396973=_0x396973-0x0;var _0x528f3a=_0xcaaf[_0x396973];return _0x528f3a;};'use strict';var _=require(_0xfcaa('0x0'));var util=require('util');var moment=require(_0xfcaa('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfcaa('0x2'));var db=require(_0xfcaa('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfcaa('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfcaa('0x5'));var client=jayson[_0xfcaa('0x6')][_0xfcaa('0x7')]({'port':0x232a});config[_0xfcaa('0x8')]=_[_0xfcaa('0x9')](config[_0xfcaa('0x8')],{'host':_0xfcaa('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfcaa('0x8')]));require('./userProfile.socket')[_0xfcaa('0xb')](socket);function respondWithRpcPromise(_0x4bdec3,_0x101ac0,_0x593c04){return new BPromise(function(_0x586902,_0x345e39){return client['request'](_0x4bdec3,_0x593c04)[_0xfcaa('0xc')](function(_0x2e83f8){logger[_0xfcaa('0xd')](_0xfcaa('0xe'),_0x101ac0,_0xfcaa('0xf'));logger[_0xfcaa('0x10')](_0xfcaa('0x11'),_0x101ac0,_0xfcaa('0xf'),JSON['stringify'](_0x2e83f8));if(_0x2e83f8[_0xfcaa('0x12')]){if(_0x2e83f8[_0xfcaa('0x12')][_0xfcaa('0x13')]===0x1f4){logger[_0xfcaa('0x12')]('UserProfile,\x20%s,\x20%s',_0x101ac0,_0x2e83f8[_0xfcaa('0x12')][_0xfcaa('0x14')]);return _0x345e39(_0x2e83f8[_0xfcaa('0x12')][_0xfcaa('0x14')]);}logger['error'](_0xfcaa('0xe'),_0x101ac0,_0x2e83f8[_0xfcaa('0x12')][_0xfcaa('0x14')]);return _0x586902(_0x2e83f8['error'][_0xfcaa('0x14')]);}else{logger[_0xfcaa('0xd')]('UserProfile,\x20%s,\x20%s',_0x101ac0,_0xfcaa('0xf'));_0x586902(_0x2e83f8['result']['message']);}})[_0xfcaa('0x15')](function(_0x327f31){logger[_0xfcaa('0x12')](_0xfcaa('0xe'),_0x101ac0,_0x327f31);_0x345e39(_0x327f31);});});} \ No newline at end of file +var _0xfd50=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xfd50,0x178));var _0x0fd5=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xfd50[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require('lodash');var util=require(_0x0fd5('0x0'));var moment=require(_0x0fd5('0x1'));var BPromise=require(_0x0fd5('0x2'));var rs=require(_0x0fd5('0x3'));var fs=require('fs');var Redis=require(_0x0fd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0fd5('0x5'));var logger=require(_0x0fd5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0fd5('0x7'));var client=jayson[_0x0fd5('0x8')][_0x0fd5('0x9')]({'port':0x232a});config[_0x0fd5('0xa')]=_['defaults'](config[_0x0fd5('0xa')],{'host':_0x0fd5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0fd5('0xa')]));require(_0x0fd5('0xc'))[_0x0fd5('0xd')](socket);function respondWithRpcPromise(_0x4705b2,_0x39eda9,_0x1dfd3f){return new BPromise(function(_0x27bfa9,_0x4e4733){return client[_0x0fd5('0xe')](_0x4705b2,_0x1dfd3f)[_0x0fd5('0xf')](function(_0x47c900){logger[_0x0fd5('0x10')](_0x0fd5('0x11'),_0x39eda9,_0x0fd5('0x12'));logger[_0x0fd5('0x13')](_0x0fd5('0x14'),_0x39eda9,_0x0fd5('0x12'),JSON[_0x0fd5('0x15')](_0x47c900));if(_0x47c900['error']){if(_0x47c900['error'][_0x0fd5('0x16')]===0x1f4){logger['error'](_0x0fd5('0x11'),_0x39eda9,_0x47c900[_0x0fd5('0x17')][_0x0fd5('0x18')]);return _0x4e4733(_0x47c900[_0x0fd5('0x17')][_0x0fd5('0x18')]);}logger['error'](_0x0fd5('0x11'),_0x39eda9,_0x47c900[_0x0fd5('0x17')][_0x0fd5('0x18')]);return _0x27bfa9(_0x47c900[_0x0fd5('0x17')][_0x0fd5('0x18')]);}else{logger[_0x0fd5('0x10')]('UserProfile,\x20%s,\x20%s',_0x39eda9,_0x0fd5('0x12'));_0x27bfa9(_0x47c900[_0x0fd5('0x19')][_0x0fd5('0x18')]);}})[_0x0fd5('0x1a')](function(_0x1d86f4){logger['error'](_0x0fd5('0x11'),_0x39eda9,_0x1d86f4);_0x4e4733(_0x1d86f4);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index db60e04..0ca9195 100644 --- a/server/api/userProfile/userProfile.socket.js +++ b/server/api/userProfile/userProfile.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47c9=['remove','update','removeListener','register','length','userProfile:','./userProfile.events'];(function(_0x70ed70,_0x3007be){var _0x27924a=function(_0x55cc43){while(--_0x55cc43){_0x70ed70['push'](_0x70ed70['shift']());}};_0x27924a(++_0x3007be);}(_0x47c9,0xd8));var _0x947c=function(_0x3116b3,_0x3c4e3e){_0x3116b3=_0x3116b3-0x0;var _0xedacfd=_0x47c9[_0x3116b3];return _0xedacfd;};'use strict';var UserProfileEvents=require(_0x947c('0x0'));var events=['save',_0x947c('0x1'),_0x947c('0x2')];function createListener(_0x195634,_0x44960a){return function(_0xa6c41e){_0x44960a['emit'](_0x195634,_0xa6c41e);};}function removeListener(_0x442781,_0x945791){return function(){UserProfileEvents[_0x947c('0x3')](_0x442781,_0x945791);};}exports[_0x947c('0x4')]=function(_0x1f5b48){for(var _0x1c82c9=0x0,_0x383f81=events[_0x947c('0x5')];_0x1c82c9<_0x383f81;_0x1c82c9++){var _0x1e8e07=events[_0x1c82c9];var _0x4fb245=createListener(_0x947c('0x6')+_0x1e8e07,_0x1f5b48);UserProfileEvents['on'](_0x1e8e07,_0x4fb245);}}; \ No newline at end of file +var _0x5c66=['emit','removeListener','register','length','userProfile:','save','remove','update'];(function(_0x22b39b,_0x2b7d63){var _0x280e1d=function(_0xc74635){while(--_0xc74635){_0x22b39b['push'](_0x22b39b['shift']());}};_0x280e1d(++_0x2b7d63);}(_0x5c66,0x195));var _0x65c6=function(_0x15d5b3,_0x585132){_0x15d5b3=_0x15d5b3-0x0;var _0x3a9ac8=_0x5c66[_0x15d5b3];return _0x3a9ac8;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x65c6('0x0'),_0x65c6('0x1'),_0x65c6('0x2')];function createListener(_0x367e2e,_0x43dd93){return function(_0xf693e4){_0x43dd93[_0x65c6('0x3')](_0x367e2e,_0xf693e4);};}function removeListener(_0x3c8111,_0x1543b8){return function(){UserProfileEvents[_0x65c6('0x4')](_0x3c8111,_0x1543b8);};}exports[_0x65c6('0x5')]=function(_0x3bc8d2){for(var _0x4c262c=0x0,_0x48c55e=events[_0x65c6('0x6')];_0x4c262c<_0x48c55e;_0x4c262c++){var _0x452003=events[_0x4c262c];var _0x46ed4f=createListener(_0x65c6('0x7')+_0x452003,_0x3bc8d2);UserProfileEvents['on'](_0x452003,_0x46ed4f);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 61b5be6..cf88d72 100644 --- a/server/api/userProfileResource/index.js +++ b/server/api/userProfileResource/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdea5=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','describe','/:id','show','post','create'];(function(_0xba2053,_0x77543c){var _0x5c720e=function(_0x4bcfad){while(--_0x4bcfad){_0xba2053['push'](_0xba2053['shift']());}};_0x5c720e(++_0x77543c);}(_0xdea5,0x111));var _0x5dea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdea5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5dea('0x0'));var util=require(_0x5dea('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dea('0x2'));var router=express[_0x5dea('0x3')]();var fs_extra=require(_0x5dea('0x4'));var auth=require(_0x5dea('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5dea('0x6'));var controller=require(_0x5dea('0x7'));router[_0x5dea('0x8')]('/',auth[_0x5dea('0x9')](),controller['index']);router[_0x5dea('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x5dea('0xa')]);router[_0x5dea('0x8')](_0x5dea('0xb'),auth['isAuthenticated'](),controller[_0x5dea('0xc')]);router[_0x5dea('0xd')]('/',auth[_0x5dea('0x9')](),controller[_0x5dea('0xe')]);router['put'](_0x5dea('0xb'),auth[_0x5dea('0x9')](),controller['update']);router[_0x5dea('0xf')](_0x5dea('0xb'),auth['isAuthenticated'](),controller[_0x5dea('0x10')]);module[_0x5dea('0x11')]=router; \ No newline at end of file +var _0x4f66=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','/:id','show','post','put'];(function(_0x1aecbb,_0x181f46){var _0x3fc53d=function(_0x3f8071){while(--_0x3f8071){_0x1aecbb['push'](_0x1aecbb['shift']());}};_0x3fc53d(++_0x181f46);}(_0x4f66,0x1d2));var _0x64f6=function(_0x38f35e,_0x200556){_0x38f35e=_0x38f35e-0x0;var _0x37f6ef=_0x4f66[_0x38f35e];return _0x37f6ef;};'use strict';var multer=require(_0x64f6('0x0'));var util=require(_0x64f6('0x1'));var path=require(_0x64f6('0x2'));var timeout=require(_0x64f6('0x3'));var express=require(_0x64f6('0x4'));var router=express[_0x64f6('0x5')]();var fs_extra=require(_0x64f6('0x6'));var auth=require(_0x64f6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x64f6('0x8'));var controller=require(_0x64f6('0x9'));router['get']('/',auth[_0x64f6('0xa')](),controller[_0x64f6('0xb')]);router[_0x64f6('0xc')](_0x64f6('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x64f6('0xc')](_0x64f6('0xe'),auth['isAuthenticated'](),controller[_0x64f6('0xf')]);router[_0x64f6('0x10')]('/',auth[_0x64f6('0xa')](),controller['create']);router[_0x64f6('0x11')](_0x64f6('0xe'),auth['isAuthenticated'](),controller[_0x64f6('0x12')]);router[_0x64f6('0x13')](_0x64f6('0xe'),auth[_0x64f6('0xa')](),controller[_0x64f6('0x14')]);module[_0x64f6('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 3c995c5..7dc6191 100644 --- a/server/api/userProfileResource/userProfileResource.attributes.js +++ b/server/api/userProfileResource/userProfileResource.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62a0=['STRING','sequelize'];(function(_0x3a7870,_0x434d77){var _0x2be42b=function(_0x4082c5){while(--_0x4082c5){_0x3a7870['push'](_0x3a7870['shift']());}};_0x2be42b(++_0x434d77);}(_0x62a0,0xfb));var _0x062a=function(_0x4f4a9b,_0x2ec5eb){_0x4f4a9b=_0x4f4a9b-0x0;var _0x4bf31b=_0x62a0[_0x4f4a9b];return _0x4bf31b;};'use strict';var Sequelize=require(_0x062a('0x0'));module['exports']={'name':{'type':Sequelize[_0x062a('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x062a('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x1ef4=['exports','STRING','INTEGER'];(function(_0x166241,_0x227ee2){var _0x51fd00=function(_0x556fd9){while(--_0x556fd9){_0x166241['push'](_0x166241['shift']());}};_0x51fd00(++_0x227ee2);}(_0x1ef4,0xc9));var _0x41ef=function(_0x4ffead,_0x1d4e9b){_0x4ffead=_0x4ffead-0x0;var _0x31cefd=_0x1ef4[_0x4ffead];return _0x31cefd;};'use strict';var Sequelize=require('sequelize');module[_0x41ef('0x0')]={'name':{'type':Sequelize[_0x41ef('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x41ef('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 6514269..fd548f3 100644 --- a/server/api/userProfileResource/userProfileResource.controller.js +++ b/server/api/userProfileResource/userProfileResource.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x524e=['end','json','offset','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','UserProfileResource','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x1d1ac2,_0x45b5ba){var _0x2a1d7e=function(_0x409447){while(--_0x409447){_0x1d1ac2['push'](_0x1d1ac2['shift']());}};_0x2a1d7e(++_0x45b5ba);}(_0x524e,0x15e));var _0xe524=function(_0x35515b,_0x7a1693){_0x35515b=_0x35515b-0x0;var _0x5916a3=_0x524e[_0x35515b];return _0x5916a3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['UserProfileResource'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['create'](_0x3d7ab7[_0xe524('0x49')],{})['then'](respondWithResult(_0x33b1c8,0xc9))['catch'](handleError(_0x33b1c8,null));};exports[_0xe524('0x27')]=function(_0x59fe6b,_0x232cf0){if(_0x59fe6b[_0xe524('0x49')]['id']){delete _0x59fe6b['body']['id'];}return db[_0xe524('0x3e')]['find']({'where':{'id':_0x59fe6b['params']['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x232cf0,null))[_0xe524('0x3f')](saveUpdates(_0x59fe6b[_0xe524('0x49')],null))['then'](respondWithResult(_0x232cf0,null))['catch'](handleError(_0x232cf0,null));};exports['destroy']=function(_0x4e9c3b,_0x4f7a64){return db['UserProfileResource'][_0xe524('0x47')]({'where':{'id':_0x4e9c3b[_0xe524('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7a64,null))[_0xe524('0x3f')](removeEntity(_0x4f7a64,null))[_0xe524('0x44')](handleError(_0x4f7a64,null));};exports[_0xe524('0x4b')]=function(_0x208aa8,_0x2fa143){return db['UserProfileResource'][_0xe524('0x4b')]()[_0xe524('0x3f')](respondWithResult(_0x2fa143,null))[_0xe524('0x44')](handleError(_0x2fa143,null));}; \ No newline at end of file +var _0x687b=['options','include','findAll','rows','show','length','includeAll','merge','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0x687b,0x14a));var _0xb687=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0x687b[_0x5959c9];return _0x4ffcbc;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['UserProfileResource'][_0xb687('0x4b')](_0x40558a[_0xb687('0x4c')],{})[_0xb687('0x26')](respondWithResult(_0x4f3069,0xc9))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports['update']=function(_0x33a0b0,_0xfc4c5f){if(_0x33a0b0[_0xb687('0x4c')]['id']){delete _0x33a0b0[_0xb687('0x4c')]['id'];}return db['UserProfileResource']['find']({'where':{'id':_0x33a0b0[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0xfc4c5f,null))[_0xb687('0x26')](saveUpdates(_0x33a0b0['body'],null))['then'](respondWithResult(_0xfc4c5f,null))[_0xb687('0x4a')](handleError(_0xfc4c5f,null));};exports[_0xb687('0x27')]=function(_0xd5bdb7,_0x22e618){return db[_0xb687('0x2f')][_0xb687('0x49')]({'where':{'id':_0xd5bdb7[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x22e618,null))['then'](removeEntity(_0x22e618,null))[_0xb687('0x4a')](handleError(_0x22e618,null));};exports[_0xb687('0x4e')]=function(_0x2342f6,_0x4f5784){return db['UserProfileResource']['describe']()['then'](respondWithResult(_0x4f5784,null))[_0xb687('0x4a')](handleError(_0x4f5784,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 3859d69..1ca8b2d 100644 --- a/server/api/userProfileResource/userProfileResource.model.js +++ b/server/api/userProfileResource/userProfileResource.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x308b=['exports','define','UserProfileResource','compositeIndex','sectionId','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./userProfileResource.attributes'];(function(_0x15d26a,_0x230cc1){var _0x4a031f=function(_0x34d7a2){while(--_0x34d7a2){_0x15d26a['push'](_0x15d26a['shift']());}};_0x4a031f(++_0x230cc1);}(_0x308b,0x12b));var _0xb308=function(_0x22cc74,_0x56ee7d){_0x22cc74=_0x22cc74-0x0;var _0x4b6500=_0x308b[_0x22cc74];return _0x4b6500;};'use strict';var _=require(_0xb308('0x0'));var util=require(_0xb308('0x1'));var logger=require(_0xb308('0x2'))(_0xb308('0x3'));var moment=require(_0xb308('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb308('0x5'));var rimraf=require(_0xb308('0x6'));var config=require(_0xb308('0x7'));var attributes=require(_0xb308('0x8'));module[_0xb308('0x9')]=function(_0x547dc8,_0x2fc19e){return _0x547dc8[_0xb308('0xa')](_0xb308('0xb'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xb308('0xc'),'fields':['resourceId',_0xb308('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeddb=['sectionId','util','api','moment','bluebird','path','../../config/environment','./userProfileResource.attributes','UserProfileResource','user_profile_has_resources','resourceId'];(function(_0xbfc560,_0x311fba){var _0x47b022=function(_0x2cd37f){while(--_0x2cd37f){_0xbfc560['push'](_0xbfc560['shift']());}};_0x47b022(++_0x311fba);}(_0xeddb,0x161));var _0xbedd=function(_0x309385,_0x3ab38f){_0x309385=_0x309385-0x0;var _0x45b0f5=_0xeddb[_0x309385];return _0x45b0f5;};'use strict';var _=require('lodash');var util=require(_0xbedd('0x0'));var logger=require('../../config/logger')(_0xbedd('0x1'));var moment=require(_0xbedd('0x2'));var BPromise=require(_0xbedd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbedd('0x4'));var rimraf=require('rimraf');var config=require(_0xbedd('0x5'));var attributes=require(_0xbedd('0x6'));module['exports']=function(_0x1eec09,_0x186d02){return _0x1eec09['define'](_0xbedd('0x7'),attributes,{'tableName':_0xbedd('0x8'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xbedd('0x9'),_0xbedd('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 9d3bf86..6e7a48a 100644 --- a/server/api/userProfileResource/userProfileResource.rpc.js +++ b/server/api/userProfileResource/userProfileResource.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e20=['../../config/environment','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0x2e20,0x66));var _0x02e2=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0x2e20[_0x13b392];return _0x39db24;};'use strict';var _=require(_0x02e2('0x0'));var util=require(_0x02e2('0x1'));var moment=require(_0x02e2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02e2('0x3'));var db=require(_0x02e2('0x4'))['db'];var utils=require(_0x02e2('0x5'));var logger=require(_0x02e2('0x6'))(_0x02e2('0x7'));var config=require(_0x02e2('0x8'));var jayson=require(_0x02e2('0x9'));var client=jayson[_0x02e2('0xa')][_0x02e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x226930,_0x572d7f,_0x23a038){return new BPromise(function(_0x2095e4,_0x1f268c){return client['request'](_0x226930,_0x23a038)[_0x02e2('0xc')](function(_0x16c017){logger[_0x02e2('0xd')](_0x02e2('0xe'),_0x572d7f,_0x02e2('0xf'));logger[_0x02e2('0x10')](_0x02e2('0x11'),_0x572d7f,_0x02e2('0xf'),JSON['stringify'](_0x16c017));if(_0x16c017[_0x02e2('0x12')]){if(_0x16c017[_0x02e2('0x12')]['code']===0x1f4){logger['error'](_0x02e2('0xe'),_0x572d7f,_0x16c017[_0x02e2('0x12')][_0x02e2('0x13')]);return _0x1f268c(_0x16c017[_0x02e2('0x12')][_0x02e2('0x13')]);}logger['error'](_0x02e2('0xe'),_0x572d7f,_0x16c017['error'][_0x02e2('0x13')]);return _0x2095e4(_0x16c017['error']['message']);}else{logger['info'](_0x02e2('0xe'),_0x572d7f,_0x02e2('0xf'));_0x2095e4(_0x16c017[_0x02e2('0x14')][_0x02e2('0x13')]);}})[_0x02e2('0x15')](function(_0x41cacc){logger[_0x02e2('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x572d7f,_0x41cacc);_0x1f268c(_0x41cacc);});});} \ No newline at end of file +var _0x8f7d=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','UserProfileResource,\x20%s,\x20%s'];(function(_0x1588bc,_0x210237){var _0x24a65d=function(_0x189b5b){while(--_0x189b5b){_0x1588bc['push'](_0x1588bc['shift']());}};_0x24a65d(++_0x210237);}(_0x8f7d,0x7f));var _0xd8f7=function(_0x32428b,_0x5585ba){_0x32428b=_0x32428b-0x0;var _0x195736=_0x8f7d[_0x32428b];return _0x195736;};'use strict';var _=require(_0xd8f7('0x0'));var util=require(_0xd8f7('0x1'));var moment=require(_0xd8f7('0x2'));var BPromise=require(_0xd8f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8f7('0x4'));var db=require(_0xd8f7('0x5'))['db'];var utils=require(_0xd8f7('0x6'));var logger=require(_0xd8f7('0x7'))(_0xd8f7('0x8'));var config=require(_0xd8f7('0x9'));var jayson=require(_0xd8f7('0xa'));var client=jayson[_0xd8f7('0xb')][_0xd8f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x363c07,_0x106f78,_0x18d073){return new BPromise(function(_0x32ef09,_0x54af00){return client[_0xd8f7('0xd')](_0x363c07,_0x18d073)[_0xd8f7('0xe')](function(_0x47f1b5){logger[_0xd8f7('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x106f78,_0xd8f7('0x10'));logger[_0xd8f7('0x11')](_0xd8f7('0x12'),_0x106f78,_0xd8f7('0x10'),JSON['stringify'](_0x47f1b5));if(_0x47f1b5['error']){if(_0x47f1b5[_0xd8f7('0x13')][_0xd8f7('0x14')]===0x1f4){logger[_0xd8f7('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x106f78,_0x47f1b5[_0xd8f7('0x13')][_0xd8f7('0x15')]);return _0x54af00(_0x47f1b5['error'][_0xd8f7('0x15')]);}logger['error'](_0xd8f7('0x16'),_0x106f78,_0x47f1b5['error'][_0xd8f7('0x15')]);return _0x32ef09(_0x47f1b5['error'][_0xd8f7('0x15')]);}else{logger[_0xd8f7('0xf')](_0xd8f7('0x16'),_0x106f78,'request\x20sent');_0x32ef09(_0x47f1b5[_0xd8f7('0x17')][_0xd8f7('0x15')]);}})[_0xd8f7('0x18')](function(_0x23ea7c){logger[_0xd8f7('0x13')](_0xd8f7('0x16'),_0x106f78,_0x23ea7c);_0x54af00(_0x23ea7c);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 1b48278..f7aa232 100644 --- a/server/api/userProfileSection/index.js +++ b/server/api/userProfileSection/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a10=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy'];(function(_0x275f87,_0x3b2cc8){var _0x1e25d7=function(_0x14048c){while(--_0x14048c){_0x275f87['push'](_0x275f87['shift']());}};_0x1e25d7(++_0x3b2cc8);}(_0x1a10,0x151));var _0x01a1=function(_0x2456ac,_0x3c96b2){_0x2456ac=_0x2456ac-0x0;var _0x81cea7=_0x1a10[_0x2456ac];return _0x81cea7;};'use strict';var multer=require(_0x01a1('0x0'));var util=require('util');var path=require(_0x01a1('0x1'));var timeout=require(_0x01a1('0x2'));var express=require(_0x01a1('0x3'));var router=express[_0x01a1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x01a1('0x5'));var interaction=require(_0x01a1('0x6'));var config=require(_0x01a1('0x7'));var controller=require(_0x01a1('0x8'));router[_0x01a1('0x9')]('/',auth[_0x01a1('0xa')](),controller['index']);router[_0x01a1('0x9')](_0x01a1('0xb'),auth[_0x01a1('0xa')](),controller[_0x01a1('0xc')]);router[_0x01a1('0x9')](_0x01a1('0xd'),auth[_0x01a1('0xa')](),controller['show']);router[_0x01a1('0xe')]('/',auth[_0x01a1('0xa')](),controller[_0x01a1('0xf')]);router[_0x01a1('0x10')](_0x01a1('0xd'),auth[_0x01a1('0xa')](),controller[_0x01a1('0x11')]);router[_0x01a1('0x12')](_0x01a1('0xd'),auth['isAuthenticated'](),controller[_0x01a1('0x13')]);module[_0x01a1('0x14')]=router; \ No newline at end of file +var _0xe9a9=['create','put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x3777b2,_0x225bff){var _0x29fd4e=function(_0x20246e){while(--_0x20246e){_0x3777b2['push'](_0x3777b2['shift']());}};_0x29fd4e(++_0x225bff);}(_0xe9a9,0x122));var _0x9e9a=function(_0x5b5572,_0x5ce4bf){_0x5b5572=_0x5b5572-0x0;var _0x368ce4=_0xe9a9[_0x5b5572];return _0x368ce4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9e9a('0x0'));var timeout=require(_0x9e9a('0x1'));var express=require(_0x9e9a('0x2'));var router=express[_0x9e9a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9e9a('0x4'));var interaction=require(_0x9e9a('0x5'));var config=require(_0x9e9a('0x6'));var controller=require('./userProfileSection.controller');router[_0x9e9a('0x7')]('/',auth[_0x9e9a('0x8')](),controller[_0x9e9a('0x9')]);router[_0x9e9a('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x9e9a('0xa')]);router['get'](_0x9e9a('0xb'),auth['isAuthenticated'](),controller[_0x9e9a('0xc')]);router[_0x9e9a('0xd')]('/',auth['isAuthenticated'](),controller[_0x9e9a('0xe')]);router[_0x9e9a('0xf')](_0x9e9a('0xb'),auth[_0x9e9a('0x8')](),controller[_0x9e9a('0x10')]);router[_0x9e9a('0x11')]('/:id',auth[_0x9e9a('0x8')](),controller[_0x9e9a('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 9012c07..c82b356 100644 --- a/server/api/userProfileSection/userProfileSection.attributes.js +++ b/server/api/userProfileSection/userProfileSection.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2cf=['crudPermissions','join','getDataValue','exports','STRING','BOOLEAN'];(function(_0x14c3c1,_0x36cc75){var _0x2b8fdc=function(_0x4714a4){while(--_0x4714a4){_0x14c3c1['push'](_0x14c3c1['shift']());}};_0x2b8fdc(++_0x36cc75);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x18bfdb,_0x241d43){_0x18bfdb=_0x18bfdb-0x0;var _0x44334c=_0xe2cf[_0x18bfdb];return _0x44334c;};'use strict';var Sequelize=require('sequelize');module[_0xfe2c('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xfe2c('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xfe2c('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xfe2c('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xfe2c('0x1')],'set':function(_0x11b6b8){this['setDataValue'](_0xfe2c('0x3'),_0x11b6b8?_0x11b6b8[_0xfe2c('0x4')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0xfe2c('0x5')](_0xfe2c('0x3'))['split'](''):[];}}}; \ No newline at end of file +var _0x1eba=['join','getDataValue','split','sequelize','exports','STRING','INTEGER','setDataValue','crudPermissions'];(function(_0x447a1d,_0x4089b0){var _0x2cca6f=function(_0x10fb9a){while(--_0x10fb9a){_0x447a1d['push'](_0x447a1d['shift']());}};_0x2cca6f(++_0x4089b0);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x4cfc1d,_0x2c0927){_0x4cfc1d=_0x4cfc1d-0x0;var _0x1c01a0=_0x1eba[_0x4cfc1d];return _0x1c01a0;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'name':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xa1eb('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xa1eb('0x2')],'set':function(_0x34be5a){this[_0xa1eb('0x4')](_0xa1eb('0x5'),_0x34be5a?_0x34be5a[_0xa1eb('0x6')](''):[]);},'get':function(){return this[_0xa1eb('0x7')](_0xa1eb('0x5'))?this[_0xa1eb('0x7')](_0xa1eb('0x5'))[_0xa1eb('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index a388e51..3ca0985 100644 --- a/server/api/userProfileSection/userProfileSection.controller.js +++ b/server/api/userProfileSection/userProfileSection.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf68=['index','map','UserProfileSection','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','zip-dir','mustache','util','path','ejs','fs-extra','squel','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcf68,0x136));var _0x8cf6=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xcf68[_0x3b0731];return _0x4204d7;};'use strict';var emlformat=require(_0x8cf6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8cf6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8cf6('0x2'));var util=require(_0x8cf6('0x3'));var path=require(_0x8cf6('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8cf6('0x5'));var fs=require('fs');var fs_extra=require(_0x8cf6('0x6'));var _=require('lodash');var squel=require(_0x8cf6('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8cf6('0x8'));var toCsv=require(_0x8cf6('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8cf6('0xa'));var authService=require('../../components/auth/service');var qs=require(_0x8cf6('0xb'));var as=require(_0x8cf6('0xc'));var hardwareService=require(_0x8cf6('0xd'));var logger=require(_0x8cf6('0xe'))('api');var utils=require(_0x8cf6('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x8cf6('0x10'));var db=require(_0x8cf6('0x11'))['db'];function respondWithStatusCode(_0x1351eb,_0x1bcbdf){_0x1bcbdf=_0x1bcbdf||0xcc;return function(_0x17ff3f){if(_0x17ff3f){return _0x1351eb[_0x8cf6('0x12')](_0x1bcbdf);}return _0x1351eb[_0x8cf6('0x13')](_0x1bcbdf)[_0x8cf6('0x14')]();};}function respondWithResult(_0x2db173,_0x22b39e){_0x22b39e=_0x22b39e||0xc8;return function(_0x3f62d9){if(_0x3f62d9){return _0x2db173[_0x8cf6('0x13')](_0x22b39e)[_0x8cf6('0x15')](_0x3f62d9);}};}function respondWithFilteredResult(_0x3958a6,_0xa5a52d){return function(_0x1c544d){if(_0x1c544d){var _0x14acbc=typeof _0xa5a52d['offset']===_0x8cf6('0x16')&&typeof _0xa5a52d[_0x8cf6('0x17')]===_0x8cf6('0x16');var _0x40cffa=_0x1c544d['count'];var _0x4bc1ca=_0x14acbc?0x0:_0xa5a52d['offset'];var _0x3eacca=_0x14acbc?_0x1c544d[_0x8cf6('0x18')]:_0xa5a52d['offset']+_0xa5a52d[_0x8cf6('0x17')];var _0x233d06;if(_0x3eacca>=_0x40cffa){_0x3eacca=_0x40cffa;_0x233d06=0xc8;}else{_0x233d06=0xce;}_0x3958a6['status'](_0x233d06);return _0x3958a6[_0x8cf6('0x19')]('Content-Range',_0x4bc1ca+'-'+_0x3eacca+'/'+_0x40cffa)['json'](_0x1c544d);}return null;};}function patchUpdates(_0x23fffb){return function(_0x47e6b7){try{jsonpatch[_0x8cf6('0x1a')](_0x47e6b7,_0x23fffb,!![]);}catch(_0x735cb4){return BPromise[_0x8cf6('0x1b')](_0x735cb4);}return _0x47e6b7[_0x8cf6('0x1c')]();};}function saveUpdates(_0x3daf4d,_0x39f305){return function(_0x74f371){if(_0x74f371){return _0x74f371[_0x8cf6('0x1d')](_0x3daf4d)['then'](function(_0x27b990){return _0x27b990;});}return null;};}function removeEntity(_0x564e2b,_0x432c46){return function(_0x2ff8e9){if(_0x2ff8e9){return _0x2ff8e9[_0x8cf6('0x1e')]()[_0x8cf6('0x1f')](function(){_0x564e2b[_0x8cf6('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x83b956,_0x47804c){return function(_0x118e9e){if(!_0x118e9e){_0x83b956[_0x8cf6('0x12')](0x194);}return _0x118e9e;};}function handleError(_0x1d3402,_0x256c99){_0x256c99=_0x256c99||0x1f4;return function(_0x231ce4){logger[_0x8cf6('0x20')](_0x231ce4[_0x8cf6('0x21')]);if(_0x231ce4[_0x8cf6('0x22')]){delete _0x231ce4[_0x8cf6('0x22')];}_0x1d3402['status'](_0x256c99)['send'](_0x231ce4);};}exports[_0x8cf6('0x23')]=function(_0x2303da,_0x5beee8){var _0x1e6a97={},_0x5d7805={},_0x1398fe={'count':0x0,'rows':[]};var _0x3b2d1e=_[_0x8cf6('0x24')](db[_0x8cf6('0x25')]['rawAttributes'],function(_0xe6dd22){return{'name':_0xe6dd22['fieldName'],'type':_0xe6dd22[_0x8cf6('0x26')][_0x8cf6('0x27')]};});_0x5d7805[_0x8cf6('0x28')]=_['map'](_0x3b2d1e,_0x8cf6('0x22'));_0x5d7805[_0x8cf6('0x29')]=_[_0x8cf6('0x2a')](_0x2303da[_0x8cf6('0x29')]);_0x5d7805[_0x8cf6('0x2b')]=_[_0x8cf6('0x2c')](_0x5d7805[_0x8cf6('0x28')],_0x5d7805[_0x8cf6('0x29')]);_0x1e6a97['attributes']=_['intersection'](_0x5d7805['model'],qs[_0x8cf6('0x2d')](_0x2303da[_0x8cf6('0x29')][_0x8cf6('0x2d')]));_0x1e6a97[_0x8cf6('0x2e')]=_0x1e6a97['attributes'][_0x8cf6('0x2f')]?_0x1e6a97[_0x8cf6('0x2e')]:_0x5d7805['model'];if(!_0x2303da[_0x8cf6('0x29')][_0x8cf6('0x30')]('nolimit')){_0x1e6a97[_0x8cf6('0x17')]=qs['limit'](_0x2303da[_0x8cf6('0x29')][_0x8cf6('0x17')]);_0x1e6a97[_0x8cf6('0x31')]=qs[_0x8cf6('0x31')](_0x2303da['query']['offset']);}_0x1e6a97[_0x8cf6('0x32')]=qs['sort'](_0x2303da[_0x8cf6('0x29')][_0x8cf6('0x33')]);_0x1e6a97['where']=qs[_0x8cf6('0x2b')](_[_0x8cf6('0x34')](_0x2303da[_0x8cf6('0x29')],_0x5d7805[_0x8cf6('0x2b')]),_0x3b2d1e);if(_0x2303da[_0x8cf6('0x29')][_0x8cf6('0x35')]){_0x1e6a97['where']=_[_0x8cf6('0x36')](_0x1e6a97[_0x8cf6('0x37')],{'$or':_[_0x8cf6('0x24')](_0x3b2d1e,function(_0xc57a00){if(_0xc57a00[_0x8cf6('0x26')]!==_0x8cf6('0x38')){var _0x4c4b09={};_0x4c4b09[_0xc57a00['name']]={'$like':'%'+_0x2303da['query'][_0x8cf6('0x35')]+'%'};return _0x4c4b09;}})});}_0x1e6a97=_[_0x8cf6('0x36')]({},_0x1e6a97,_0x2303da[_0x8cf6('0x39')]);var _0x2175eb={'where':_0x1e6a97[_0x8cf6('0x37')]};return db[_0x8cf6('0x25')][_0x8cf6('0x18')](_0x2175eb)['then'](function(_0xc8df94){_0x1398fe[_0x8cf6('0x18')]=_0xc8df94;if(_0x2303da['query'][_0x8cf6('0x3a')]){_0x1e6a97['include']=[{'all':!![]}];}return db[_0x8cf6('0x25')][_0x8cf6('0x3b')](_0x1e6a97);})[_0x8cf6('0x1f')](function(_0x4abd1a){_0x1398fe[_0x8cf6('0x3c')]=_0x4abd1a;return _0x1398fe;})[_0x8cf6('0x1f')](respondWithFilteredResult(_0x5beee8,_0x1e6a97))[_0x8cf6('0x3d')](handleError(_0x5beee8,null));};exports[_0x8cf6('0x3e')]=function(_0x59d376,_0x583037){var _0x456b68={'raw':![],'where':{'id':_0x59d376['params']['id']}},_0x2158c0={};_0x2158c0[_0x8cf6('0x28')]=_[_0x8cf6('0x2a')](db[_0x8cf6('0x25')][_0x8cf6('0x3f')]);_0x2158c0[_0x8cf6('0x29')]=_[_0x8cf6('0x2a')](_0x59d376[_0x8cf6('0x29')]);_0x2158c0[_0x8cf6('0x2b')]=_['intersection'](_0x2158c0['model'],_0x2158c0[_0x8cf6('0x29')]);_0x456b68['attributes']=_['intersection'](_0x2158c0[_0x8cf6('0x28')],qs[_0x8cf6('0x2d')](_0x59d376['query'][_0x8cf6('0x2d')]));_0x456b68[_0x8cf6('0x2e')]=_0x456b68['attributes']['length']?_0x456b68[_0x8cf6('0x2e')]:_0x2158c0[_0x8cf6('0x28')];if(_0x59d376['query'][_0x8cf6('0x3a')]){_0x456b68['include']=[{'all':!![]}];}_0x456b68=_['merge']({},_0x456b68,_0x59d376[_0x8cf6('0x39')]);return db[_0x8cf6('0x25')][_0x8cf6('0x40')](_0x456b68)[_0x8cf6('0x1f')](handleEntityNotFound(_0x583037,null))[_0x8cf6('0x1f')](respondWithResult(_0x583037,null))[_0x8cf6('0x3d')](handleError(_0x583037,null));};exports[_0x8cf6('0x41')]=function(_0x4300fe,_0x35afbb){return db['UserProfileSection'][_0x8cf6('0x41')](_0x4300fe['body'],{})[_0x8cf6('0x1f')](respondWithResult(_0x35afbb,0xc9))['catch'](handleError(_0x35afbb,null));};exports['update']=function(_0x4acb79,_0x368a62){if(_0x4acb79[_0x8cf6('0x42')]['id']){delete _0x4acb79[_0x8cf6('0x42')]['id'];}return db[_0x8cf6('0x25')][_0x8cf6('0x40')]({'where':{'id':_0x4acb79[_0x8cf6('0x43')]['id']}})[_0x8cf6('0x1f')](handleEntityNotFound(_0x368a62,null))[_0x8cf6('0x1f')](saveUpdates(_0x4acb79[_0x8cf6('0x42')],null))[_0x8cf6('0x1f')](respondWithResult(_0x368a62,null))['catch'](handleError(_0x368a62,null));};exports['destroy']=function(_0x1d92dd,_0x2b10c0){return db[_0x8cf6('0x25')]['find']({'where':{'id':_0x1d92dd[_0x8cf6('0x43')]['id']}})[_0x8cf6('0x1f')](handleEntityNotFound(_0x2b10c0,null))['then'](removeEntity(_0x2b10c0,null))[_0x8cf6('0x3d')](handleError(_0x2b10c0,null));};exports[_0x8cf6('0x44')]=function(_0xef1654,_0x523612){return db[_0x8cf6('0x25')][_0x8cf6('0x44')]()['then'](respondWithResult(_0x523612,null))[_0x8cf6('0x3d')](handleError(_0x523612,null));}; \ No newline at end of file +var _0xcf91=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','UserProfileSection','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x3df223,_0x1740fc){var _0x562d11=function(_0x343009){while(--_0x343009){_0x3df223['push'](_0x3df223['shift']());}};_0x562d11(++_0x1740fc);}(_0xcf91,0x132));var _0x1cf9=function(_0xe74a5,_0x1e1ddc){_0xe74a5=_0xe74a5-0x0;var _0x595ea1=_0xcf91[_0xe74a5];return _0x595ea1;};'use strict';var emlformat=require(_0x1cf9('0x0'));var rimraf=require(_0x1cf9('0x1'));var zipdir=require(_0x1cf9('0x2'));var jsonpatch=require(_0x1cf9('0x3'));var rp=require(_0x1cf9('0x4'));var moment=require(_0x1cf9('0x5'));var BPromise=require(_0x1cf9('0x6'));var Mustache=require(_0x1cf9('0x7'));var util=require(_0x1cf9('0x8'));var path=require(_0x1cf9('0x9'));var sox=require(_0x1cf9('0xa'));var csv=require(_0x1cf9('0xb'));var ejs=require(_0x1cf9('0xc'));var fs=require('fs');var fs_extra=require(_0x1cf9('0xd'));var _=require(_0x1cf9('0xe'));var squel=require(_0x1cf9('0xf'));var crypto=require(_0x1cf9('0x10'));var jsforce=require(_0x1cf9('0x11'));var deskjs=require(_0x1cf9('0x12'));var toCsv=require(_0x1cf9('0xb'));var querystring=require(_0x1cf9('0x13'));var Papa=require(_0x1cf9('0x14'));var Redis=require('ioredis');var authService=require(_0x1cf9('0x15'));var qs=require(_0x1cf9('0x16'));var as=require(_0x1cf9('0x17'));var hardwareService=require(_0x1cf9('0x18'));var logger=require('../../config/logger')('api');var utils=require(_0x1cf9('0x19'));var config=require(_0x1cf9('0x1a'));var licenseUtil=require(_0x1cf9('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a8a59,_0x19ebf2){_0x19ebf2=_0x19ebf2||0xcc;return function(_0x4a08f4){if(_0x4a08f4){return _0x3a8a59[_0x1cf9('0x1c')](_0x19ebf2);}return _0x3a8a59[_0x1cf9('0x1d')](_0x19ebf2)[_0x1cf9('0x1e')]();};}function respondWithResult(_0x4e29be,_0x1aa290){_0x1aa290=_0x1aa290||0xc8;return function(_0x686545){if(_0x686545){return _0x4e29be['status'](_0x1aa290)[_0x1cf9('0x1f')](_0x686545);}};}function respondWithFilteredResult(_0x45696e,_0xf5cce5){return function(_0x522895){if(_0x522895){var _0x55da68=typeof _0xf5cce5[_0x1cf9('0x20')]==='undefined'&&typeof _0xf5cce5['limit']===_0x1cf9('0x21');var _0x284256=_0x522895[_0x1cf9('0x22')];var _0xab265c=_0x55da68?0x0:_0xf5cce5[_0x1cf9('0x20')];var _0x1830bc=_0x55da68?_0x522895[_0x1cf9('0x22')]:_0xf5cce5['offset']+_0xf5cce5[_0x1cf9('0x23')];var _0x2914a6;if(_0x1830bc>=_0x284256){_0x1830bc=_0x284256;_0x2914a6=0xc8;}else{_0x2914a6=0xce;}_0x45696e[_0x1cf9('0x1d')](_0x2914a6);return _0x45696e['set'](_0x1cf9('0x24'),_0xab265c+'-'+_0x1830bc+'/'+_0x284256)[_0x1cf9('0x1f')](_0x522895);}return null;};}function patchUpdates(_0x455a3e){return function(_0xea546b){try{jsonpatch[_0x1cf9('0x25')](_0xea546b,_0x455a3e,!![]);}catch(_0x3503ee){return BPromise[_0x1cf9('0x26')](_0x3503ee);}return _0xea546b['save']();};}function saveUpdates(_0x2fc7b7,_0x3d4840){return function(_0x2885c5){if(_0x2885c5){return _0x2885c5[_0x1cf9('0x27')](_0x2fc7b7)[_0x1cf9('0x28')](function(_0x11d039){return _0x11d039;});}return null;};}function removeEntity(_0x43b141,_0x1250a4){return function(_0x354013){if(_0x354013){return _0x354013[_0x1cf9('0x29')]()[_0x1cf9('0x28')](function(){_0x43b141[_0x1cf9('0x1d')](0xcc)[_0x1cf9('0x1e')]();});}};}function handleEntityNotFound(_0x2bc223,_0x323756){return function(_0x3172b6){if(!_0x3172b6){_0x2bc223[_0x1cf9('0x1c')](0x194);}return _0x3172b6;};}function handleError(_0x2de886,_0x62977e){_0x62977e=_0x62977e||0x1f4;return function(_0x34c1f0){logger[_0x1cf9('0x2a')](_0x34c1f0[_0x1cf9('0x2b')]);if(_0x34c1f0[_0x1cf9('0x2c')]){delete _0x34c1f0[_0x1cf9('0x2c')];}_0x2de886[_0x1cf9('0x1d')](_0x62977e)[_0x1cf9('0x2d')](_0x34c1f0);};}exports[_0x1cf9('0x2e')]=function(_0x23a668,_0x37d594){var _0x2f23bf={},_0x1a9737={},_0x4cbfec={'count':0x0,'rows':[]};var _0x55e7a2=_[_0x1cf9('0x2f')](db['UserProfileSection']['rawAttributes'],function(_0x5bd66d){return{'name':_0x5bd66d[_0x1cf9('0x30')],'type':_0x5bd66d[_0x1cf9('0x31')][_0x1cf9('0x32')]};});_0x1a9737[_0x1cf9('0x33')]=_['map'](_0x55e7a2,_0x1cf9('0x2c'));_0x1a9737[_0x1cf9('0x34')]=_[_0x1cf9('0x35')](_0x23a668[_0x1cf9('0x34')]);_0x1a9737['filters']=_[_0x1cf9('0x36')](_0x1a9737['model'],_0x1a9737[_0x1cf9('0x34')]);_0x2f23bf[_0x1cf9('0x37')]=_['intersection'](_0x1a9737[_0x1cf9('0x33')],qs[_0x1cf9('0x38')](_0x23a668[_0x1cf9('0x34')]['fields']));_0x2f23bf['attributes']=_0x2f23bf[_0x1cf9('0x37')][_0x1cf9('0x39')]?_0x2f23bf[_0x1cf9('0x37')]:_0x1a9737['model'];if(!_0x23a668[_0x1cf9('0x34')][_0x1cf9('0x3a')](_0x1cf9('0x3b'))){_0x2f23bf[_0x1cf9('0x23')]=qs[_0x1cf9('0x23')](_0x23a668['query'][_0x1cf9('0x23')]);_0x2f23bf['offset']=qs[_0x1cf9('0x20')](_0x23a668['query'][_0x1cf9('0x20')]);}_0x2f23bf['order']=qs[_0x1cf9('0x3c')](_0x23a668[_0x1cf9('0x34')][_0x1cf9('0x3c')]);_0x2f23bf[_0x1cf9('0x3d')]=qs[_0x1cf9('0x3e')](_[_0x1cf9('0x3f')](_0x23a668[_0x1cf9('0x34')],_0x1a9737[_0x1cf9('0x3e')]),_0x55e7a2);if(_0x23a668['query'][_0x1cf9('0x40')]){_0x2f23bf[_0x1cf9('0x3d')]=_['merge'](_0x2f23bf['where'],{'$or':_[_0x1cf9('0x2f')](_0x55e7a2,function(_0x4b6974){if(_0x4b6974[_0x1cf9('0x31')]!=='VIRTUAL'){var _0x142064={};_0x142064[_0x4b6974[_0x1cf9('0x2c')]]={'$like':'%'+_0x23a668[_0x1cf9('0x34')][_0x1cf9('0x40')]+'%'};return _0x142064;}})});}_0x2f23bf=_[_0x1cf9('0x41')]({},_0x2f23bf,_0x23a668[_0x1cf9('0x42')]);var _0x20d9ae={'where':_0x2f23bf[_0x1cf9('0x3d')]};return db[_0x1cf9('0x43')][_0x1cf9('0x22')](_0x20d9ae)[_0x1cf9('0x28')](function(_0x3d8638){_0x4cbfec[_0x1cf9('0x22')]=_0x3d8638;if(_0x23a668[_0x1cf9('0x34')]['includeAll']){_0x2f23bf[_0x1cf9('0x44')]=[{'all':!![]}];}return db[_0x1cf9('0x43')][_0x1cf9('0x45')](_0x2f23bf);})[_0x1cf9('0x28')](function(_0x31fbb0){_0x4cbfec[_0x1cf9('0x46')]=_0x31fbb0;return _0x4cbfec;})[_0x1cf9('0x28')](respondWithFilteredResult(_0x37d594,_0x2f23bf))[_0x1cf9('0x47')](handleError(_0x37d594,null));};exports[_0x1cf9('0x48')]=function(_0x302aa3,_0x261f0d){var _0x387524={'raw':![],'where':{'id':_0x302aa3[_0x1cf9('0x49')]['id']}},_0x30675a={};_0x30675a[_0x1cf9('0x33')]=_['keys'](db[_0x1cf9('0x43')][_0x1cf9('0x4a')]);_0x30675a[_0x1cf9('0x34')]=_[_0x1cf9('0x35')](_0x302aa3[_0x1cf9('0x34')]);_0x30675a['filters']=_[_0x1cf9('0x36')](_0x30675a[_0x1cf9('0x33')],_0x30675a[_0x1cf9('0x34')]);_0x387524[_0x1cf9('0x37')]=_[_0x1cf9('0x36')](_0x30675a[_0x1cf9('0x33')],qs[_0x1cf9('0x38')](_0x302aa3[_0x1cf9('0x34')][_0x1cf9('0x38')]));_0x387524[_0x1cf9('0x37')]=_0x387524[_0x1cf9('0x37')][_0x1cf9('0x39')]?_0x387524['attributes']:_0x30675a[_0x1cf9('0x33')];if(_0x302aa3[_0x1cf9('0x34')][_0x1cf9('0x4b')]){_0x387524[_0x1cf9('0x44')]=[{'all':!![]}];}_0x387524=_[_0x1cf9('0x41')]({},_0x387524,_0x302aa3[_0x1cf9('0x42')]);return db[_0x1cf9('0x43')]['find'](_0x387524)[_0x1cf9('0x28')](handleEntityNotFound(_0x261f0d,null))[_0x1cf9('0x28')](respondWithResult(_0x261f0d,null))[_0x1cf9('0x47')](handleError(_0x261f0d,null));};exports['create']=function(_0x48f598,_0x4b0c49){return db[_0x1cf9('0x43')][_0x1cf9('0x4c')](_0x48f598[_0x1cf9('0x4d')],{})['then'](respondWithResult(_0x4b0c49,0xc9))[_0x1cf9('0x47')](handleError(_0x4b0c49,null));};exports[_0x1cf9('0x27')]=function(_0x542518,_0x2cee3b){if(_0x542518[_0x1cf9('0x4d')]['id']){delete _0x542518[_0x1cf9('0x4d')]['id'];}return db['UserProfileSection'][_0x1cf9('0x4e')]({'where':{'id':_0x542518[_0x1cf9('0x49')]['id']}})['then'](handleEntityNotFound(_0x2cee3b,null))[_0x1cf9('0x28')](saveUpdates(_0x542518[_0x1cf9('0x4d')],null))['then'](respondWithResult(_0x2cee3b,null))[_0x1cf9('0x47')](handleError(_0x2cee3b,null));};exports[_0x1cf9('0x29')]=function(_0x40d95d,_0x5cfa79){return db[_0x1cf9('0x43')]['find']({'where':{'id':_0x40d95d[_0x1cf9('0x49')]['id']}})[_0x1cf9('0x28')](handleEntityNotFound(_0x5cfa79,null))['then'](removeEntity(_0x5cfa79,null))['catch'](handleError(_0x5cfa79,null));};exports['describe']=function(_0x226c9e,_0x37d69c){return db[_0x1cf9('0x43')][_0x1cf9('0x4f')]()['then'](respondWithResult(_0x37d69c,null))[_0x1cf9('0x47')](handleError(_0x37d69c,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 31eb773..98242df 100644 --- a/server/api/userProfileSection/userProfileSection.model.js +++ b/server/api/userProfileSection/userProfileSection.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd5b3=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./userProfileSection.attributes','exports','define','user_profile_has_sections','compositeIndex','sectionId','userProfileId'];(function(_0x5ce3c1,_0x2ab59b){var _0x585640=function(_0x44bacb){while(--_0x44bacb){_0x5ce3c1['push'](_0x5ce3c1['shift']());}};_0x585640(++_0x2ab59b);}(_0xd5b3,0xa5));var _0x3d5b=function(_0x1ebf73,_0x3aff0b){_0x1ebf73=_0x1ebf73-0x0;var _0x53ae85=_0xd5b3[_0x1ebf73];return _0x53ae85;};'use strict';var _=require(_0x3d5b('0x0'));var util=require(_0x3d5b('0x1'));var logger=require(_0x3d5b('0x2'))(_0x3d5b('0x3'));var moment=require(_0x3d5b('0x4'));var BPromise=require(_0x3d5b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d5b('0x6'));var rimraf=require(_0x3d5b('0x7'));var config=require('../../config/environment');var attributes=require(_0x3d5b('0x8'));module[_0x3d5b('0x9')]=function(_0x50a166,_0x5ab566){return _0x50a166[_0x3d5b('0xa')]('UserProfileSection',attributes,{'tableName':_0x3d5b('0xb'),'paranoid':![],'indexes':[{'name':_0x3d5b('0xc'),'fields':[_0x3d5b('0xd'),_0x3d5b('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd5d7=['path','rimraf','./userProfileSection.attributes','exports','define','user_profile_has_sections','compositeIndex','userProfileId','lodash','../../config/logger','bluebird','request-promise'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0xd5d7,0x8c));var _0x7d5d=function(_0x4c3bf7,_0x47cbc5){_0x4c3bf7=_0x4c3bf7-0x0;var _0x26d188=_0xd5d7[_0x4c3bf7];return _0x26d188;};'use strict';var _=require(_0x7d5d('0x0'));var util=require('util');var logger=require(_0x7d5d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7d5d('0x2'));var rp=require(_0x7d5d('0x3'));var fs=require('fs');var path=require(_0x7d5d('0x4'));var rimraf=require(_0x7d5d('0x5'));var config=require('../../config/environment');var attributes=require(_0x7d5d('0x6'));module[_0x7d5d('0x7')]=function(_0x562873,_0x4b9e32){return _0x562873[_0x7d5d('0x8')]('UserProfileSection',attributes,{'tableName':_0x7d5d('0x9'),'paranoid':![],'indexes':[{'name':_0x7d5d('0xa'),'fields':['sectionId',_0x7d5d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 7e23973..315f023 100644 --- a/server/api/userProfileSection/userProfileSection.rpc.js +++ b/server/api/userProfileSection/userProfileSection.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2649=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','moment'];(function(_0x51c7a0,_0xf518de){var _0x2602d7=function(_0x5c3538){while(--_0x5c3538){_0x51c7a0['push'](_0x51c7a0['shift']());}};_0x2602d7(++_0xf518de);}(_0x2649,0x133));var _0x9264=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x2649[_0x56916d];return _0x2b7f1f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9264('0x0'));var BPromise=require(_0x9264('0x1'));var rs=require(_0x9264('0x2'));var fs=require('fs');var Redis=require(_0x9264('0x3'));var db=require(_0x9264('0x4'))['db'];var utils=require(_0x9264('0x5'));var logger=require(_0x9264('0x6'))(_0x9264('0x7'));var config=require(_0x9264('0x8'));var jayson=require(_0x9264('0x9'));var client=jayson[_0x9264('0xa')][_0x9264('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ce4ef,_0x38fd75,_0x4c97c9){return new BPromise(function(_0x502d88,_0x156788){return client[_0x9264('0xc')](_0x5ce4ef,_0x4c97c9)[_0x9264('0xd')](function(_0x44b2a2){logger[_0x9264('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x38fd75,_0x9264('0xf'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x38fd75,_0x9264('0xf'),JSON[_0x9264('0x10')](_0x44b2a2));if(_0x44b2a2['error']){if(_0x44b2a2[_0x9264('0x11')][_0x9264('0x12')]===0x1f4){logger[_0x9264('0x11')](_0x9264('0x13'),_0x38fd75,_0x44b2a2[_0x9264('0x11')][_0x9264('0x14')]);return _0x156788(_0x44b2a2[_0x9264('0x11')][_0x9264('0x14')]);}logger[_0x9264('0x11')](_0x9264('0x13'),_0x38fd75,_0x44b2a2[_0x9264('0x11')][_0x9264('0x14')]);return _0x502d88(_0x44b2a2[_0x9264('0x11')][_0x9264('0x14')]);}else{logger[_0x9264('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x38fd75,_0x9264('0xf'));_0x502d88(_0x44b2a2[_0x9264('0x15')]['message']);}})['catch'](function(_0x5ee382){logger[_0x9264('0x11')](_0x9264('0x13'),_0x38fd75,_0x5ee382);_0x156788(_0x5ee382);});});} \ No newline at end of file +var _0xc25b=['UserProfileSection,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4c6cb,_0x183ca3){var _0x1035e3=function(_0x9746d2){while(--_0x9746d2){_0x4c6cb['push'](_0x4c6cb['shift']());}};_0x1035e3(++_0x183ca3);}(_0xc25b,0x12f));var _0xbc25=function(_0x3488fa,_0xf24b17){_0x3488fa=_0x3488fa-0x0;var _0x23e027=_0xc25b[_0x3488fa];return _0x23e027;};'use strict';var _=require(_0xbc25('0x0'));var util=require(_0xbc25('0x1'));var moment=require(_0xbc25('0x2'));var BPromise=require(_0xbc25('0x3'));var rs=require(_0xbc25('0x4'));var fs=require('fs');var Redis=require(_0xbc25('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbc25('0x6'))(_0xbc25('0x7'));var config=require(_0xbc25('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbc25('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x542d2f,_0x14dd13,_0x298a15){return new BPromise(function(_0x364b75,_0x4451d1){return client[_0xbc25('0xa')](_0x542d2f,_0x298a15)[_0xbc25('0xb')](function(_0x31522f){logger[_0xbc25('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x14dd13,_0xbc25('0xd'));logger['debug'](_0xbc25('0xe'),_0x14dd13,_0xbc25('0xd'),JSON[_0xbc25('0xf')](_0x31522f));if(_0x31522f[_0xbc25('0x10')]){if(_0x31522f[_0xbc25('0x10')]['code']===0x1f4){logger[_0xbc25('0x10')](_0xbc25('0x11'),_0x14dd13,_0x31522f[_0xbc25('0x10')][_0xbc25('0x12')]);return _0x4451d1(_0x31522f[_0xbc25('0x10')][_0xbc25('0x12')]);}logger[_0xbc25('0x10')](_0xbc25('0x11'),_0x14dd13,_0x31522f['error'][_0xbc25('0x12')]);return _0x364b75(_0x31522f[_0xbc25('0x10')][_0xbc25('0x12')]);}else{logger[_0xbc25('0xc')](_0xbc25('0x11'),_0x14dd13,'request\x20sent');_0x364b75(_0x31522f[_0xbc25('0x13')][_0xbc25('0x12')]);}})['catch'](function(_0x88e03b){logger[_0xbc25('0x10')](_0xbc25('0x11'),_0x14dd13,_0x88e03b);_0x4451d1(_0x88e03b);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 58c0cbc..44f22f2 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x24a219,_0x137acc){var _0x355061=function(_0x56f0c7){while(--_0x56f0c7){_0x24a219['push'](_0x24a219['shift']());}};_0x355061(++_0x137acc);}(_0x70e0,0x17b));var _0x070e=function(_0x480cf7,_0x9d8002){_0x480cf7=_0x480cf7-0x0;var _0x539ca2=_0x70e0[_0x480cf7];return _0x539ca2;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x38e5f0,_0x4fedd8){var _0x5b08dc=function(_0x321b77){while(--_0x321b77){_0x38e5f0['push'](_0x38e5f0['shift']());}};_0x5b08dc(++_0x4fedd8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 79379a2..a244c0f 100644 --- a/server/api/userSmsQueue/userSmsQueue.attributes.js +++ b/server/api/userSmsQueue/userSmsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb524=['INTEGER','exports'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0xb524,0xcd));var _0x4b52=function(_0x397044,_0x142bdc){_0x397044=_0x397044-0x0;var _0x56b040=_0xb524[_0x397044];return _0x56b040;};'use strict';var Sequelize=require('sequelize');module[_0x4b52('0x0')]={'penalty':{'type':Sequelize[_0x4b52('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x29ef=['INTEGER','sequelize','exports'];(function(_0x94887a,_0x16fb11){var _0x3acfc1=function(_0x3a88a1){while(--_0x3a88a1){_0x94887a['push'](_0x94887a['shift']());}};_0x3acfc1(++_0x16fb11);}(_0x29ef,0x196));var _0xf29e=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x29ef[_0x38537f];return _0x141e23;};'use strict';var Sequelize=require(_0xf29e('0x0'));module[_0xf29e('0x1')]={'penalty':{'type':Sequelize[_0xf29e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index e1ed0b0..7ff3587 100644 --- a/server/api/userSmsQueue/userSmsQueue.model.js +++ b/server/api/userSmsQueue/userSmsQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81c6=['UserSmsQueue','util','bluebird','request-promise','path','../../config/environment','./userSmsQueue.attributes','exports','define'];(function(_0x1c7e7d,_0x18f770){var _0x14be5d=function(_0x265011){while(--_0x265011){_0x1c7e7d['push'](_0x1c7e7d['shift']());}};_0x14be5d(++_0x18f770);}(_0x81c6,0x1d5));var _0x681c=function(_0x38841c,_0x1af0bf){_0x38841c=_0x38841c-0x0;var _0x500610=_0x81c6[_0x38841c];return _0x500610;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x681c('0x1'));var rp=require(_0x681c('0x2'));var fs=require('fs');var path=require(_0x681c('0x3'));var rimraf=require('rimraf');var config=require(_0x681c('0x4'));var attributes=require(_0x681c('0x5'));module[_0x681c('0x6')]=function(_0x1d31c8,_0x4ea522){return _0x1d31c8[_0x681c('0x7')](_0x681c('0x8'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f37=['lodash','util','api','request-promise','path','rimraf','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues'];(function(_0x2d98c6,_0x89828e){var _0x1081eb=function(_0x56a7be){while(--_0x56a7be){_0x2d98c6['push'](_0x2d98c6['shift']());}};_0x1081eb(++_0x89828e);}(_0x9f37,0xd1));var _0x79f3=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x9f37[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x79f3('0x0'));var util=require(_0x79f3('0x1'));var logger=require('../../config/logger')(_0x79f3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x79f3('0x3'));var fs=require('fs');var path=require(_0x79f3('0x4'));var rimraf=require(_0x79f3('0x5'));var config=require('../../config/environment');var attributes=require(_0x79f3('0x6'));module[_0x79f3('0x7')]=function(_0x594d87,_0x5db84b){return _0x594d87[_0x79f3('0x8')](_0x79f3('0x9'),attributes,{'tableName':_0x79f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 524d47a..e67c95c 100644 --- a/server/api/userSmsQueue/userSmsQueue.rpc.js +++ b/server/api/userSmsQueue/userSmsQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0299=['error','code','message','info','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x570300,_0x1c3780){var _0xd72c40=function(_0x5c5c08){while(--_0x5c5c08){_0x570300['push'](_0x570300['shift']());}};_0xd72c40(++_0x1c3780);}(_0x0299,0xed));var _0x9029=function(_0x5e840b,_0x48cd60){_0x5e840b=_0x5e840b-0x0;var _0x207e22=_0x0299[_0x5e840b];return _0x207e22;};'use strict';var _=require('lodash');var util=require(_0x9029('0x0'));var moment=require(_0x9029('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9029('0x2'));var db=require(_0x9029('0x3'))['db'];var utils=require(_0x9029('0x4'));var logger=require(_0x9029('0x5'))(_0x9029('0x6'));var config=require(_0x9029('0x7'));var jayson=require(_0x9029('0x8'));var client=jayson[_0x9029('0x9')][_0x9029('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45f9cb,_0x3a956c,_0x4096c3){return new BPromise(function(_0x4861ae,_0x59b5e0){return client[_0x9029('0xb')](_0x45f9cb,_0x4096c3)['then'](function(_0x45b049){logger['info'](_0x9029('0xc'),_0x3a956c,_0x9029('0xd'));logger['debug'](_0x9029('0xe'),_0x3a956c,_0x9029('0xd'),JSON['stringify'](_0x45b049));if(_0x45b049['error']){if(_0x45b049[_0x9029('0xf')][_0x9029('0x10')]===0x1f4){logger[_0x9029('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x3a956c,_0x45b049[_0x9029('0xf')]['message']);return _0x59b5e0(_0x45b049[_0x9029('0xf')]['message']);}logger['error'](_0x9029('0xc'),_0x3a956c,_0x45b049[_0x9029('0xf')]['message']);return _0x4861ae(_0x45b049['error'][_0x9029('0x11')]);}else{logger[_0x9029('0x12')](_0x9029('0xc'),_0x3a956c,_0x9029('0xd'));_0x4861ae(_0x45b049[_0x9029('0x13')][_0x9029('0x11')]);}})[_0x9029('0x14')](function(_0x5409eb){logger[_0x9029('0xf')](_0x9029('0xc'),_0x3a956c,_0x5409eb);_0x59b5e0(_0x5409eb);});});} \ No newline at end of file +var _0x48a6=['jayson/promise','client','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x3d7150,_0x5ae05d){var _0x56de79=function(_0x4ba5cb){while(--_0x4ba5cb){_0x3d7150['push'](_0x3d7150['shift']());}};_0x56de79(++_0x5ae05d);}(_0x48a6,0x83));var _0x648a=function(_0x59e21c,_0x4d77b9){_0x59e21c=_0x59e21c-0x0;var _0x199b4c=_0x48a6[_0x59e21c];return _0x199b4c;};'use strict';var _=require(_0x648a('0x0'));var util=require(_0x648a('0x1'));var moment=require(_0x648a('0x2'));var BPromise=require(_0x648a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x648a('0x4'));var db=require(_0x648a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x648a('0x6'))(_0x648a('0x7'));var config=require(_0x648a('0x8'));var jayson=require(_0x648a('0x9'));var client=jayson[_0x648a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4680a1,_0x493664,_0x3221a1){return new BPromise(function(_0x2e9dfb,_0x519d24){return client['request'](_0x4680a1,_0x3221a1)['then'](function(_0x1d72ed){logger[_0x648a('0xb')](_0x648a('0xc'),_0x493664,_0x648a('0xd'));logger[_0x648a('0xe')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x493664,'request\x20sent',JSON['stringify'](_0x1d72ed));if(_0x1d72ed['error']){if(_0x1d72ed[_0x648a('0xf')][_0x648a('0x10')]===0x1f4){logger[_0x648a('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x493664,_0x1d72ed[_0x648a('0xf')]['message']);return _0x519d24(_0x1d72ed[_0x648a('0xf')][_0x648a('0x11')]);}logger[_0x648a('0xf')](_0x648a('0xc'),_0x493664,_0x1d72ed[_0x648a('0xf')][_0x648a('0x11')]);return _0x2e9dfb(_0x1d72ed[_0x648a('0xf')][_0x648a('0x11')]);}else{logger['info'](_0x648a('0xc'),_0x493664,_0x648a('0xd'));_0x2e9dfb(_0x1d72ed[_0x648a('0x12')][_0x648a('0x11')]);}})[_0x648a('0x13')](function(_0x34fb2a){logger[_0x648a('0xf')](_0x648a('0xc'),_0x493664,_0x34fb2a);_0x519d24(_0x34fb2a);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index d359021..034c8ad 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaab7=['sequelize','exports','INTEGER'];(function(_0x1cbbd2,_0x4bcbec){var _0x2eb5f6=function(_0x221610){while(--_0x221610){_0x1cbbd2['push'](_0x1cbbd2['shift']());}};_0x2eb5f6(++_0x4bcbec);}(_0xaab7,0xdb));var _0x7aab=function(_0xd01fd6,_0x1d06c0){_0xd01fd6=_0xd01fd6-0x0;var _0x321793=_0xaab7[_0xd01fd6];return _0x321793;};'use strict';var Sequelize=require(_0x7aab('0x0'));module[_0x7aab('0x1')]={'UserId':{'type':Sequelize[_0x7aab('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x7aab('0x2')]}}; \ No newline at end of file +var _0xcc3a=['sequelize','INTEGER'];(function(_0x3c9fd4,_0x5c8ca6){var _0x2e9729=function(_0x349922){while(--_0x349922){_0x3c9fd4['push'](_0x3c9fd4['shift']());}};_0x2e9729(++_0x5c8ca6);}(_0xcc3a,0xd6));var _0xacc3=function(_0x193e28,_0x3dac1d){_0x193e28=_0x193e28-0x0;var _0x20ef59=_0xcc3a[_0x193e28];return _0x20ef59;};'use strict';var Sequelize=require(_0xacc3('0x0'));module['exports']={'UserId':{'type':Sequelize[_0xacc3('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index e82d88f..1dca2eb 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x521ca1,_0x3abaf7){var _0x466b28=function(_0x311c1b){while(--_0x311c1b){_0x521ca1['push'](_0x521ca1['shift']());}};_0x466b28(++_0x3abaf7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2293ef,_0x1f255c){var _0x2ec993=function(_0x28132a){while(--_0x28132a){_0x2293ef['push'](_0x2293ef['shift']());}};_0x2ec993(++_0x1f255c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 64c9669..599f424 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4a354b,_0x3256e5){var _0x5b28e3=function(_0x23c6db){while(--_0x23c6db){_0x4a354b['push'](_0x4a354b['shift']());}};_0x5b28e3(++_0x3256e5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1608cd,_0x288667){var _0xd2d143=function(_0x3c3e67){while(--_0x3c3e67){_0x1608cd['push'](_0x1608cd['shift']());}};_0xd2d143(++_0x288667);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 80ec146..8316471 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.attributes.js +++ b/server/api/userVoiceQueue/userVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cc5=['exports','INTEGER'];(function(_0x458a58,_0x2710e4){var _0x2cdf63=function(_0x215dd1){while(--_0x215dd1){_0x458a58['push'](_0x458a58['shift']());}};_0x2cdf63(++_0x2710e4);}(_0x1cc5,0x1c6));var _0x51cc=function(_0x460e20,_0x3ff2d0){_0x460e20=_0x460e20-0x0;var _0x4088a4=_0x1cc5[_0x460e20];return _0x4088a4;};'use strict';var Sequelize=require('sequelize');module[_0x51cc('0x0')]={'penalty':{'type':Sequelize[_0x51cc('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x56c7=['exports','INTEGER','sequelize'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x56c7,0x6e));var _0x756c=function(_0xc471d2,_0x26ab16){_0xc471d2=_0xc471d2-0x0;var _0x334c68=_0x56c7[_0xc471d2];return _0x334c68;};'use strict';var Sequelize=require(_0x756c('0x0'));module[_0x756c('0x1')]={'penalty':{'type':Sequelize[_0x756c('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 09d5640..e3a8870 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.model.js +++ b/server/api/userVoiceQueue/userVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x336e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash','util'];(function(_0x479612,_0x1f6250){var _0x506b23=function(_0x25e331){while(--_0x25e331){_0x479612['push'](_0x479612['shift']());}};_0x506b23(++_0x1f6250);}(_0x336e,0x1da));var _0xe336=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x336e[_0x17406a];return _0x1501ff;};'use strict';var _=require(_0xe336('0x0'));var util=require(_0xe336('0x1'));var logger=require(_0xe336('0x2'))(_0xe336('0x3'));var moment=require(_0xe336('0x4'));var BPromise=require(_0xe336('0x5'));var rp=require(_0xe336('0x6'));var fs=require('fs');var path=require(_0xe336('0x7'));var rimraf=require(_0xe336('0x8'));var config=require(_0xe336('0x9'));var attributes=require(_0xe336('0xa'));module[_0xe336('0xb')]=function(_0x207ea4,_0x1cb01d){return _0x207ea4[_0xe336('0xc')](_0xe336('0xd'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7559=['exports','define','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes'];(function(_0x1e8678,_0x2fe400){var _0x512abd=function(_0x3dc190){while(--_0x3dc190){_0x1e8678['push'](_0x1e8678['shift']());}};_0x512abd(++_0x2fe400);}(_0x7559,0x142));var _0x9755=function(_0x88cf95,_0x1d6c8e){_0x88cf95=_0x88cf95-0x0;var _0x449cbf=_0x7559[_0x88cf95];return _0x449cbf;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9755('0x0'));var moment=require(_0x9755('0x1'));var BPromise=require(_0x9755('0x2'));var rp=require(_0x9755('0x3'));var fs=require('fs');var path=require(_0x9755('0x4'));var rimraf=require(_0x9755('0x5'));var config=require(_0x9755('0x6'));var attributes=require(_0x9755('0x7'));module[_0x9755('0x8')]=function(_0x417b96,_0x5f38ef){return _0x417b96[_0x9755('0x9')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 81e66bc..c5fe530 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.rpc.js +++ b/server/api/userVoiceQueue/userVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca76=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x164e76,_0x4446cc){var _0x44e4b4=function(_0xec3ea1){while(--_0xec3ea1){_0x164e76['push'](_0x164e76['shift']());}};_0x44e4b4(++_0x4446cc);}(_0xca76,0x1b5));var _0x6ca7=function(_0x3223d6,_0x590106){_0x3223d6=_0x3223d6-0x0;var _0x294945=_0xca76[_0x3223d6];return _0x294945;};'use strict';var _=require(_0x6ca7('0x0'));var util=require(_0x6ca7('0x1'));var moment=require(_0x6ca7('0x2'));var BPromise=require(_0x6ca7('0x3'));var rs=require(_0x6ca7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ca7('0x5'))['db'];var utils=require(_0x6ca7('0x6'));var logger=require(_0x6ca7('0x7'))(_0x6ca7('0x8'));var config=require(_0x6ca7('0x9'));var jayson=require(_0x6ca7('0xa'));var client=jayson[_0x6ca7('0xb')][_0x6ca7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x110c67,_0xb380e5,_0x4fc5de){return new BPromise(function(_0x664f96,_0x32dad1){return client[_0x6ca7('0xd')](_0x110c67,_0x4fc5de)['then'](function(_0x218e46){logger[_0x6ca7('0xe')](_0x6ca7('0xf'),_0xb380e5,'request\x20sent');logger[_0x6ca7('0x10')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0xb380e5,_0x6ca7('0x11'),JSON[_0x6ca7('0x12')](_0x218e46));if(_0x218e46[_0x6ca7('0x13')]){if(_0x218e46[_0x6ca7('0x13')][_0x6ca7('0x14')]===0x1f4){logger[_0x6ca7('0x13')](_0x6ca7('0xf'),_0xb380e5,_0x218e46[_0x6ca7('0x13')][_0x6ca7('0x15')]);return _0x32dad1(_0x218e46[_0x6ca7('0x13')]['message']);}logger[_0x6ca7('0x13')](_0x6ca7('0xf'),_0xb380e5,_0x218e46[_0x6ca7('0x13')][_0x6ca7('0x15')]);return _0x664f96(_0x218e46[_0x6ca7('0x13')][_0x6ca7('0x15')]);}else{logger[_0x6ca7('0xe')](_0x6ca7('0xf'),_0xb380e5,_0x6ca7('0x11'));_0x664f96(_0x218e46[_0x6ca7('0x16')][_0x6ca7('0x15')]);}})['catch'](function(_0x3b9418){logger[_0x6ca7('0x13')](_0x6ca7('0xf'),_0xb380e5,_0x3b9418);_0x32dad1(_0x3b9418);});});} \ No newline at end of file +var _0xc9a1=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment'];(function(_0x3f6fa3,_0x1b0015){var _0x8be1e4=function(_0x4e68d2){while(--_0x4e68d2){_0x3f6fa3['push'](_0x3f6fa3['shift']());}};_0x8be1e4(++_0x1b0015);}(_0xc9a1,0x18a));var _0x1c9a=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xc9a1[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x1c9a('0x0'));var util=require('util');var moment=require(_0x1c9a('0x1'));var BPromise=require(_0x1c9a('0x2'));var rs=require(_0x1c9a('0x3'));var fs=require('fs');var Redis=require(_0x1c9a('0x4'));var db=require(_0x1c9a('0x5'))['db'];var utils=require(_0x1c9a('0x6'));var logger=require(_0x1c9a('0x7'))('rpc');var config=require(_0x1c9a('0x8'));var jayson=require(_0x1c9a('0x9'));var client=jayson[_0x1c9a('0xa')][_0x1c9a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26628c,_0x16d990,_0x5cf3b9){return new BPromise(function(_0x3869d8,_0x5e24da){return client['request'](_0x26628c,_0x5cf3b9)[_0x1c9a('0xc')](function(_0x55f90c){logger[_0x1c9a('0xd')](_0x1c9a('0xe'),_0x16d990,_0x1c9a('0xf'));logger['debug'](_0x1c9a('0x10'),_0x16d990,_0x1c9a('0xf'),JSON[_0x1c9a('0x11')](_0x55f90c));if(_0x55f90c[_0x1c9a('0x12')]){if(_0x55f90c[_0x1c9a('0x12')]['code']===0x1f4){logger['error'](_0x1c9a('0xe'),_0x16d990,_0x55f90c[_0x1c9a('0x12')]['message']);return _0x5e24da(_0x55f90c[_0x1c9a('0x12')][_0x1c9a('0x13')]);}logger['error'](_0x1c9a('0xe'),_0x16d990,_0x55f90c[_0x1c9a('0x12')]['message']);return _0x3869d8(_0x55f90c['error'][_0x1c9a('0x13')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x16d990,_0x1c9a('0xf'));_0x3869d8(_0x55f90c[_0x1c9a('0x14')]['message']);}})[_0x1c9a('0x15')](function(_0x14a4a0){logger[_0x1c9a('0x12')](_0x1c9a('0xe'),_0x16d990,_0x14a4a0);_0x5e24da(_0x14a4a0);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 1c9dba8..4c4937d 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x45447e,_0x330c46){var _0x5b304c=function(_0x2ffb79){while(--_0x2ffb79){_0x45447e['push'](_0x45447e['shift']());}};_0x5b304c(++_0x330c46);}(_0xedd9,0xfc));var _0x9edd=function(_0x1f3ae9,_0x52108e){_0x1f3ae9=_0x1f3ae9-0x0;var _0x27a594=_0xedd9[_0x1f3ae9];return _0x27a594;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4e962b,_0x57588d){var _0x5e32c6=function(_0x4d9fce){while(--_0x4d9fce){_0x4e962b['push'](_0x4e962b['shift']());}};_0x5e32c6(++_0x57588d);}(_0x70e0,0x17b));var _0x070e=function(_0x4ed5e9,_0x56796c){_0x4ed5e9=_0x4ed5e9-0x0;var _0x172356=_0x70e0[_0x4ed5e9];return _0x172356;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index ce99da3..8fad815 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e1f=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x316c42,_0x3391f0){var _0x2b38f7=function(_0x38d2cf){while(--_0x38d2cf){_0x316c42['push'](_0x316c42['shift']());}};_0x2b38f7(++_0x3391f0);}(_0x5e1f,0xde));var _0xf5e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e1f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf5e1('0x0'));module[_0xf5e1('0x1')]={'uniqueid':{'type':Sequelize[_0xf5e1('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xf5e1('0x3')},'membername':{'type':Sequelize[_0xf5e1('0x4')],'allowNull':![],'comment':_0xf5e1('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xf5e1('0x4')],'allowNull':![],'unique':_0xf5e1('0x5'),'comment':_0xf5e1('0x3')},'VoiceQueueId':{'type':Sequelize[_0xf5e1('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xf5e1('0x4')],'allowNull':![],'unique':_0xf5e1('0x5'),'comment':_0xf5e1('0x3')},'penalty':{'type':Sequelize[_0xf5e1('0x2')](0xb),'defaultValue':0x0,'comment':_0xf5e1('0x3')},'paused':{'type':Sequelize[_0xf5e1('0x2')](0xb),'defaultValue':0x0,'comment':_0xf5e1('0x3')}}; \ No newline at end of file +var _0x9d2b=['INTEGER','Required\x20by\x20Asterisk','queue_interface'];(function(_0x1bab1f,_0x1b51e8){var _0xeb960=function(_0x3199a6){while(--_0x3199a6){_0x1bab1f['push'](_0x1bab1f['shift']());}};_0xeb960(++_0x1b51e8);}(_0x9d2b,0x153));var _0xb9d2=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x9d2b[_0x37ffea];return _0x2e2615;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xb9d2('0x0')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xb9d2('0x1')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xb9d2('0x1')},'UserId':{'type':Sequelize[_0xb9d2('0x0')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb9d2('0x2'),'comment':_0xb9d2('0x1')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb9d2('0x2'),'comment':_0xb9d2('0x1')},'penalty':{'type':Sequelize[_0xb9d2('0x0')](0xb),'defaultValue':0x0,'comment':_0xb9d2('0x1')},'paused':{'type':Sequelize[_0xb9d2('0x0')](0xb),'defaultValue':0x0,'comment':_0xb9d2('0x1')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 6768176..6d9874f 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90ab=['setMaxListeners','update','remove','emit','hook','exports','UserVoiceQueueRt'];(function(_0x3fb150,_0x5e32ed){var _0x56f4a8=function(_0x57924c){while(--_0x57924c){_0x3fb150['push'](_0x3fb150['shift']());}};_0x56f4a8(++_0x5e32ed);}(_0x90ab,0xb5));var _0xb90a=function(_0x1d4d75,_0x48b6b4){_0x1d4d75=_0x1d4d75-0x0;var _0x11316d=_0x90ab[_0x1d4d75];return _0x11316d;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xb90a('0x0')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xb90a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb90a('0x2'),'afterDestroy':_0xb90a('0x3')};function emitEvent(_0x187421){return function(_0x1e45c9,_0x422dab,_0x1b50e9){UserVoiceQueueRtEvents[_0xb90a('0x4')](_0x187421+':'+_0x1e45c9['id'],_0x1e45c9);UserVoiceQueueRtEvents[_0xb90a('0x4')](_0x187421,_0x1e45c9);_0x1b50e9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xb90a('0x5')](e,emitEvent(event));}}module[_0xb90a('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xebc3=['remove','emit','hook','exports','events','UserVoiceQueueRt','setMaxListeners','save','update'];(function(_0x1f4159,_0x569eb5){var _0x421049=function(_0x2d8cc2){while(--_0x2d8cc2){_0x1f4159['push'](_0x1f4159['shift']());}};_0x421049(++_0x569eb5);}(_0xebc3,0x70));var _0x3ebc=function(_0x27ef68,_0xf7519e){_0x27ef68=_0x27ef68-0x0;var _0x4b97aa=_0xebc3[_0x27ef68];return _0x4b97aa;};'use strict';var EventEmitter=require(_0x3ebc('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x3ebc('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x3ebc('0x2')](0x0);var events={'afterCreate':_0x3ebc('0x3'),'afterUpdate':_0x3ebc('0x4'),'afterDestroy':_0x3ebc('0x5')};function emitEvent(_0x897d1d){return function(_0x3806aa,_0x1859ec,_0x2a9c19){UserVoiceQueueRtEvents[_0x3ebc('0x6')](_0x897d1d+':'+_0x3806aa['id'],_0x3806aa);UserVoiceQueueRtEvents['emit'](_0x897d1d,_0x3806aa);_0x2a9c19(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x3ebc('0x7')](e,emitEvent(event));}}module[_0x3ebc('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index b4bf16e..5fc92b6 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4af6=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash'];(function(_0x45d953,_0x4f72d5){var _0xc9b3e3=function(_0x1e5c0a){while(--_0x1e5c0a){_0x45d953['push'](_0x45d953['shift']());}};_0xc9b3e3(++_0x4f72d5);}(_0x4af6,0x151));var _0x64af=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4af6[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x64af('0x0'));var util=require(_0x64af('0x1'));var logger=require(_0x64af('0x2'))(_0x64af('0x3'));var moment=require('moment');var BPromise=require(_0x64af('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64af('0x5'));var rimraf=require(_0x64af('0x6'));var config=require(_0x64af('0x7'));var attributes=require(_0x64af('0x8'));module[_0x64af('0x9')]=function(_0x41f1a7,_0x467c90){return _0x41f1a7[_0x64af('0xa')](_0x64af('0xb'),attributes,{'tableName':_0x64af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbeb=['./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x379799,_0x4ccf16){var _0x46e431=function(_0x34bd4d){while(--_0x34bd4d){_0x379799['push'](_0x379799['shift']());}};_0x46e431(++_0x4ccf16);}(_0xbbeb,0xd5));var _0xbbbe=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0xbbeb[_0x58547b];return _0x1d3fd2;};'use strict';var _=require(_0xbbbe('0x0'));var util=require(_0xbbbe('0x1'));var logger=require(_0xbbbe('0x2'))(_0xbbbe('0x3'));var moment=require(_0xbbbe('0x4'));var BPromise=require(_0xbbbe('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbbe('0x6'));var rimraf=require('rimraf');var config=require(_0xbbbe('0x7'));var attributes=require(_0xbbbe('0x8'));module[_0xbbbe('0x9')]=function(_0x57cfef,_0x5a3767){return _0x57cfef[_0xbbbe('0xa')](_0xbbbe('0xb'),attributes,{'tableName':_0xbbbe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 34a5785..661b233 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f67=['catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','request','request\x20sent','debug','stringify','error','code','message','UserVoiceQueueRt,\x20%s,\x20%s','info'];(function(_0x2261b3,_0x17fc2){var _0x58f9cf=function(_0x1d62bc){while(--_0x1d62bc){_0x2261b3['push'](_0x2261b3['shift']());}};_0x58f9cf(++_0x17fc2);}(_0x9f67,0x1e0));var _0x79f6=function(_0x1c82f6,_0x2b4668){_0x1c82f6=_0x1c82f6-0x0;var _0x42594c=_0x9f67[_0x1c82f6];return _0x42594c;};'use strict';var _=require(_0x79f6('0x0'));var util=require(_0x79f6('0x1'));var moment=require(_0x79f6('0x2'));var BPromise=require(_0x79f6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79f6('0x4'));var db=require(_0x79f6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x79f6('0x6'));var config=require(_0x79f6('0x7'));var jayson=require(_0x79f6('0x8'));var client=jayson[_0x79f6('0x9')][_0x79f6('0xa')]({'port':0x232a});config[_0x79f6('0xb')]=_[_0x79f6('0xc')](config[_0x79f6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x79f6('0xd'))(new Redis(config['redis']));require(_0x79f6('0xe'))['register'](socket);function respondWithRpcPromise(_0x41b321,_0x54649e,_0x4134e4){return new BPromise(function(_0x631f05,_0xae5e37){return client[_0x79f6('0xf')](_0x41b321,_0x4134e4)['then'](function(_0x4e761b){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x54649e,_0x79f6('0x10'));logger[_0x79f6('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x54649e,_0x79f6('0x10'),JSON[_0x79f6('0x12')](_0x4e761b));if(_0x4e761b[_0x79f6('0x13')]){if(_0x4e761b[_0x79f6('0x13')][_0x79f6('0x14')]===0x1f4){logger[_0x79f6('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x54649e,_0x4e761b[_0x79f6('0x13')]['message']);return _0xae5e37(_0x4e761b[_0x79f6('0x13')][_0x79f6('0x15')]);}logger[_0x79f6('0x13')](_0x79f6('0x16'),_0x54649e,_0x4e761b[_0x79f6('0x13')][_0x79f6('0x15')]);return _0x631f05(_0x4e761b[_0x79f6('0x13')][_0x79f6('0x15')]);}else{logger[_0x79f6('0x17')](_0x79f6('0x16'),_0x54649e,_0x79f6('0x10'));_0x631f05(_0x4e761b['result'][_0x79f6('0x15')]);}})[_0x79f6('0x18')](function(_0x55e6c7){logger[_0x79f6('0x13')](_0x79f6('0x16'),_0x54649e,_0x55e6c7);_0xae5e37(_0x55e6c7);});});}exports[_0x79f6('0x19')]=function(_0x5ee2e8){var _0x491bb9=this;return new Promise(function(_0x1488b0,_0x2436b7){return db[_0x79f6('0x1a')][_0x79f6('0x1b')]({'raw':_0x5ee2e8[_0x79f6('0x1c')]?_0x5ee2e8['options']['raw']===undefined?!![]:![]:!![],'where':_0x5ee2e8[_0x79f6('0x1c')]?_0x5ee2e8[_0x79f6('0x1c')][_0x79f6('0x1d')]||null:null,'attributes':[[db[_0x79f6('0x1e')]['fn'](_0x79f6('0x1f'),db[_0x79f6('0x1e')]['fn']('IF',db[_0x79f6('0x1e')][_0x79f6('0x20')](_0x79f6('0x21')))),_0x79f6('0x22')]]})[_0x79f6('0x23')](function(_0x6b5f92){logger[_0x79f6('0x17')](_0x79f6('0x19'),_0x5ee2e8);logger[_0x79f6('0x11')](_0x79f6('0x19'),_0x5ee2e8,JSON[_0x79f6('0x12')](_0x6b5f92));_0x1488b0(_0x6b5f92);})[_0x79f6('0x18')](function(_0x5b4812){logger[_0x79f6('0x13')]('GetVoiceQueueRtPauses',_0x5b4812['message'],_0x5ee2e8);_0x2436b7(_0x491bb9['error'](0x1f4,_0x5b4812[_0x79f6('0x15')]));});});}; \ No newline at end of file +var _0x2c5d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','stringify','error','message','UserVoiceQueueRt,\x20%s,\x20%s','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x32a4fc,_0x8d7cff){var _0x120b8d=function(_0x3de990){while(--_0x3de990){_0x32a4fc['push'](_0x32a4fc['shift']());}};_0x120b8d(++_0x8d7cff);}(_0x2c5d,0xde));var _0xd2c5=function(_0x34f807,_0x3f9b45){_0x34f807=_0x34f807-0x0;var _0x570597=_0x2c5d[_0x34f807];return _0x570597;};'use strict';var _=require('lodash');var util=require(_0xd2c5('0x0'));var moment=require(_0xd2c5('0x1'));var BPromise=require(_0xd2c5('0x2'));var rs=require(_0xd2c5('0x3'));var fs=require('fs');var Redis=require(_0xd2c5('0x4'));var db=require(_0xd2c5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2c5('0x6'))(_0xd2c5('0x7'));var config=require(_0xd2c5('0x8'));var jayson=require(_0xd2c5('0x9'));var client=jayson[_0xd2c5('0xa')][_0xd2c5('0xb')]({'port':0x232a});config[_0xd2c5('0xc')]=_[_0xd2c5('0xd')](config[_0xd2c5('0xc')],{'host':_0xd2c5('0xe'),'port':0x18eb});var socket=require(_0xd2c5('0xf'))(new Redis(config[_0xd2c5('0xc')]));require('./userVoiceQueueRt.socket')[_0xd2c5('0x10')](socket);function respondWithRpcPromise(_0x46f1f0,_0x2d372f,_0xe7886){return new BPromise(function(_0x3430a7,_0x160dba){return client[_0xd2c5('0x11')](_0x46f1f0,_0xe7886)['then'](function(_0x40f637){logger[_0xd2c5('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2d372f,_0xd2c5('0x13'));logger[_0xd2c5('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x2d372f,_0xd2c5('0x13'),JSON[_0xd2c5('0x15')](_0x40f637));if(_0x40f637['error']){if(_0x40f637['error']['code']===0x1f4){logger[_0xd2c5('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2d372f,_0x40f637[_0xd2c5('0x16')][_0xd2c5('0x17')]);return _0x160dba(_0x40f637[_0xd2c5('0x16')][_0xd2c5('0x17')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2d372f,_0x40f637[_0xd2c5('0x16')]['message']);return _0x3430a7(_0x40f637[_0xd2c5('0x16')][_0xd2c5('0x17')]);}else{logger[_0xd2c5('0x12')](_0xd2c5('0x18'),_0x2d372f,_0xd2c5('0x13'));_0x3430a7(_0x40f637[_0xd2c5('0x19')][_0xd2c5('0x17')]);}})[_0xd2c5('0x1a')](function(_0x1bbd3d){logger[_0xd2c5('0x16')](_0xd2c5('0x18'),_0x2d372f,_0x1bbd3d);_0x160dba(_0x1bbd3d);});});}exports[_0xd2c5('0x1b')]=function(_0x7b3a0a){var _0x52f8ce=this;return new Promise(function(_0x27b1ee,_0x5630c0){return db[_0xd2c5('0x1c')][_0xd2c5('0x1d')]({'raw':_0x7b3a0a[_0xd2c5('0x1e')]?_0x7b3a0a[_0xd2c5('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x7b3a0a['options']?_0x7b3a0a[_0xd2c5('0x1e')][_0xd2c5('0x1f')]||null:null,'attributes':[[db[_0xd2c5('0x20')]['fn'](_0xd2c5('0x21'),db[_0xd2c5('0x20')]['fn']('IF',db[_0xd2c5('0x20')][_0xd2c5('0x22')](_0xd2c5('0x23')))),_0xd2c5('0x24')]]})[_0xd2c5('0x25')](function(_0x3cd251){logger[_0xd2c5('0x12')](_0xd2c5('0x1b'),_0x7b3a0a);logger[_0xd2c5('0x14')](_0xd2c5('0x1b'),_0x7b3a0a,JSON[_0xd2c5('0x15')](_0x3cd251));_0x27b1ee(_0x3cd251);})[_0xd2c5('0x1a')](function(_0xb021b6){logger[_0xd2c5('0x16')](_0xd2c5('0x1b'),_0xb021b6[_0xd2c5('0x17')],_0x7b3a0a);_0x5630c0(_0x52f8ce[_0xd2c5('0x16')](0x1f4,_0xb021b6['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 8b67a72..e9e82a4 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3981=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update','emit'];(function(_0x1ca890,_0x21d0d3){var _0x3f8e01=function(_0x4ff2e2){while(--_0x4ff2e2){_0x1ca890['push'](_0x1ca890['shift']());}};_0x3f8e01(++_0x21d0d3);}(_0x3981,0x144));var _0x1398=function(_0x242743,_0x4d49ed){_0x242743=_0x242743-0x0;var _0x1257e6=_0x3981[_0x242743];return _0x1257e6;};'use strict';var UserVoiceQueueRtEvents=require(_0x1398('0x0'));var events=['save',_0x1398('0x1'),_0x1398('0x2')];function createListener(_0x8739be,_0x1be1d9){return function(_0x1d39c3){_0x1be1d9[_0x1398('0x3')](_0x8739be,_0x1d39c3);};}function removeListener(_0x37fb2f,_0x2860af){return function(){UserVoiceQueueRtEvents[_0x1398('0x4')](_0x37fb2f,_0x2860af);};}exports[_0x1398('0x5')]=function(_0x199a50){for(var _0x5c5fe0=0x0,_0x216064=events[_0x1398('0x6')];_0x5c5fe0<_0x216064;_0x5c5fe0++){var _0x40e860=events[_0x5c5fe0];var _0x51dd7f=createListener(_0x1398('0x7')+_0x40e860,_0x199a50);UserVoiceQueueRtEvents['on'](_0x40e860,_0x51dd7f);}}; \ No newline at end of file +var _0x00cd=['./userVoiceQueueRt.events','save','remove','emit','register','length','userVoiceQueueRt:'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0x00cd,0xee));var _0xd00c=function(_0x260b48,_0x117977){_0x260b48=_0x260b48-0x0;var _0x3f730b=_0x00cd[_0x260b48];return _0x3f730b;};'use strict';var UserVoiceQueueRtEvents=require(_0xd00c('0x0'));var events=[_0xd00c('0x1'),_0xd00c('0x2'),'update'];function createListener(_0x4f7c2a,_0x209fc9){return function(_0x471a0d){_0x209fc9[_0xd00c('0x3')](_0x4f7c2a,_0x471a0d);};}function removeListener(_0x2291b2,_0x2187fa){return function(){UserVoiceQueueRtEvents['removeListener'](_0x2291b2,_0x2187fa);};}exports[_0xd00c('0x4')]=function(_0xbeac62){for(var _0x2eb6ca=0x0,_0x6af060=events[_0xd00c('0x5')];_0x2eb6ca<_0x6af060;_0x2eb6ca++){var _0x751801=events[_0x2eb6ca];var _0x40c5ad=createListener(_0xd00c('0x6')+_0x751801,_0xbeac62);UserVoiceQueueRtEvents['on'](_0x751801,_0x40c5ad);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 9af6b89..065395f 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x51b7e0,_0x19faca){var _0x41af83=function(_0x1fb051){while(--_0x1fb051){_0x51b7e0['push'](_0x51b7e0['shift']());}};_0x41af83(++_0x19faca);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x52b7b9,_0x43ed4b){var _0x5b5d30=function(_0x4a5b9c){while(--_0x4a5b9c){_0x52b7b9['push'](_0x52b7b9['shift']());}};_0x5b5d30(++_0x43ed4b);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 4ebfc85..7d0635f 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd859=['INTEGER'];(function(_0x5db308,_0x11dabd){var _0x327c6d=function(_0x2e77d5){while(--_0x2e77d5){_0x5db308['push'](_0x5db308['shift']());}};_0x327c6d(++_0x11dabd);}(_0xd859,0x189));var _0x9d85=function(_0x361a4d,_0x106561){_0x361a4d=_0x361a4d-0x0;var _0x4a7c9d=_0xd859[_0x361a4d];return _0x4a7c9d;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x9d85('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3fbd=['sequelize','INTEGER'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x3fbd,0x110));var _0xd3fb=function(_0x5ca65f,_0x5baac4){_0x5ca65f=_0x5ca65f-0x0;var _0x55b192=_0x3fbd[_0x5ca65f];return _0x55b192;};'use strict';var Sequelize=require(_0xd3fb('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xd3fb('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 759eb19..c891263 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2723=['rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','user_has_whatsapp_queues','util','../../config/logger','request-promise','path'];(function(_0x323c7e,_0x3d16ec){var _0x2b0f72=function(_0x5a2310){while(--_0x5a2310){_0x323c7e['push'](_0x323c7e['shift']());}};_0x2b0f72(++_0x3d16ec);}(_0x2723,0xec));var _0x3272=function(_0x24fece,_0x39e47b){_0x24fece=_0x24fece-0x0;var _0x110d14=_0x2723[_0x24fece];return _0x110d14;};'use strict';var _=require('lodash');var util=require(_0x3272('0x0'));var logger=require(_0x3272('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3272('0x2'));var fs=require('fs');var path=require(_0x3272('0x3'));var rimraf=require(_0x3272('0x4'));var config=require(_0x3272('0x5'));var attributes=require(_0x3272('0x6'));module[_0x3272('0x7')]=function(_0x4949bf,_0x23ad41){return _0x4949bf[_0x3272('0x8')]('UserWhatsappQueue',attributes,{'tableName':_0x3272('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xacef=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','user_has_whatsapp_queues','util'];(function(_0x3b0897,_0x2e2ff3){var _0x2b2989=function(_0x34c892){while(--_0x34c892){_0x3b0897['push'](_0x3b0897['shift']());}};_0x2b2989(++_0x2e2ff3);}(_0xacef,0x77));var _0xface=function(_0x518f49,_0x1e6452){_0x518f49=_0x518f49-0x0;var _0x1b0db4=_0xacef[_0x518f49];return _0x1b0db4;};'use strict';var _=require('lodash');var util=require(_0xface('0x0'));var logger=require(_0xface('0x1'))(_0xface('0x2'));var moment=require('moment');var BPromise=require(_0xface('0x3'));var rp=require(_0xface('0x4'));var fs=require('fs');var path=require(_0xface('0x5'));var rimraf=require(_0xface('0x6'));var config=require(_0xface('0x7'));var attributes=require(_0xface('0x8'));module['exports']=function(_0x47b2de,_0x1b0450){return _0x47b2de['define']('UserWhatsappQueue',attributes,{'tableName':_0xface('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 8ece3e0..7ef4d66 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8b5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x3af19a,_0x5e70e0){var _0x219a54=function(_0xbf0722){while(--_0xbf0722){_0x3af19a['push'](_0x3af19a['shift']());}};_0x219a54(++_0x5e70e0);}(_0xa8b5,0xbc));var _0x5a8b=function(_0x58b6ef,_0x3f735b){_0x58b6ef=_0x58b6ef-0x0;var _0x52bd12=_0xa8b5[_0x58b6ef];return _0x52bd12;};'use strict';var _=require(_0x5a8b('0x0'));var util=require('util');var moment=require(_0x5a8b('0x1'));var BPromise=require(_0x5a8b('0x2'));var rs=require(_0x5a8b('0x3'));var fs=require('fs');var Redis=require(_0x5a8b('0x4'));var db=require(_0x5a8b('0x5'))['db'];var utils=require(_0x5a8b('0x6'));var logger=require(_0x5a8b('0x7'))(_0x5a8b('0x8'));var config=require(_0x5a8b('0x9'));var jayson=require(_0x5a8b('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23a03d,_0x1aa133,_0x10efa8){return new BPromise(function(_0x3e841,_0x127378){return client['request'](_0x23a03d,_0x10efa8)['then'](function(_0x278a03){logger[_0x5a8b('0xb')](_0x5a8b('0xc'),_0x1aa133,_0x5a8b('0xd'));logger[_0x5a8b('0xe')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x1aa133,_0x5a8b('0xd'),JSON[_0x5a8b('0xf')](_0x278a03));if(_0x278a03[_0x5a8b('0x10')]){if(_0x278a03[_0x5a8b('0x10')][_0x5a8b('0x11')]===0x1f4){logger[_0x5a8b('0x10')](_0x5a8b('0xc'),_0x1aa133,_0x278a03['error'][_0x5a8b('0x12')]);return _0x127378(_0x278a03['error'][_0x5a8b('0x12')]);}logger[_0x5a8b('0x10')](_0x5a8b('0xc'),_0x1aa133,_0x278a03[_0x5a8b('0x10')][_0x5a8b('0x12')]);return _0x3e841(_0x278a03['error'][_0x5a8b('0x12')]);}else{logger[_0x5a8b('0xb')](_0x5a8b('0xc'),_0x1aa133,_0x5a8b('0xd'));_0x3e841(_0x278a03[_0x5a8b('0x13')][_0x5a8b('0x12')]);}})[_0x5a8b('0x14')](function(_0x3f79dd){logger[_0x5a8b('0x10')](_0x5a8b('0xc'),_0x1aa133,_0x3f79dd);_0x127378(_0x3f79dd);});});} \ No newline at end of file +var _0x7f3f=['../../config/utils','jayson/promise','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x33e18c,_0x4214ff){var _0x20d1c7=function(_0x2ec9ad){while(--_0x2ec9ad){_0x33e18c['push'](_0x33e18c['shift']());}};_0x20d1c7(++_0x4214ff);}(_0x7f3f,0x1ab));var _0xf7f3=function(_0x4566db,_0x5da9a1){_0x4566db=_0x4566db-0x0;var _0x3167e6=_0x7f3f[_0x4566db];return _0x3167e6;};'use strict';var _=require(_0xf7f3('0x0'));var util=require('util');var moment=require(_0xf7f3('0x1'));var BPromise=require(_0xf7f3('0x2'));var rs=require(_0xf7f3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7f3('0x4'))['db'];var utils=require(_0xf7f3('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf7f3('0x6'));var client=jayson['client'][_0xf7f3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x53db1a,_0x524614,_0x473084){return new BPromise(function(_0x27ab22,_0x426228){return client[_0xf7f3('0x8')](_0x53db1a,_0x473084)[_0xf7f3('0x9')](function(_0xbf9160){logger[_0xf7f3('0xa')](_0xf7f3('0xb'),_0x524614,_0xf7f3('0xc'));logger[_0xf7f3('0xd')](_0xf7f3('0xe'),_0x524614,_0xf7f3('0xc'),JSON['stringify'](_0xbf9160));if(_0xbf9160[_0xf7f3('0xf')]){if(_0xbf9160[_0xf7f3('0xf')][_0xf7f3('0x10')]===0x1f4){logger[_0xf7f3('0xf')](_0xf7f3('0xb'),_0x524614,_0xbf9160[_0xf7f3('0xf')][_0xf7f3('0x11')]);return _0x426228(_0xbf9160[_0xf7f3('0xf')][_0xf7f3('0x11')]);}logger[_0xf7f3('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x524614,_0xbf9160[_0xf7f3('0xf')][_0xf7f3('0x11')]);return _0x27ab22(_0xbf9160[_0xf7f3('0xf')][_0xf7f3('0x11')]);}else{logger[_0xf7f3('0xa')](_0xf7f3('0xb'),_0x524614,_0xf7f3('0xc'));_0x27ab22(_0xbf9160['result'][_0xf7f3('0x11')]);}})['catch'](function(_0x1daa90){logger[_0xf7f3('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x524614,_0x1daa90);_0x426228(_0x1daa90);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index edb694a..e4e385b 100644 --- a/server/api/variable/index.js +++ b/server/api/variable/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62c8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','path','Router','fs-extra'];(function(_0x290ede,_0x1a9bca){var _0x43bb89=function(_0x5d27b1){while(--_0x5d27b1){_0x290ede['push'](_0x290ede['shift']());}};_0x43bb89(++_0x1a9bca);}(_0x62c8,0x1ad));var _0x862c=function(_0x27f0d4,_0x201236){_0x27f0d4=_0x27f0d4-0x0;var _0x23876d=_0x62c8[_0x27f0d4];return _0x23876d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x862c('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x862c('0x1')]();var fs_extra=require(_0x862c('0x2'));var auth=require(_0x862c('0x3'));var interaction=require(_0x862c('0x4'));var config=require(_0x862c('0x5'));var controller=require(_0x862c('0x6'));router['get']('/',auth[_0x862c('0x7')](),controller[_0x862c('0x8')]);router[_0x862c('0x9')](_0x862c('0xa'),auth[_0x862c('0x7')](),controller[_0x862c('0xb')]);router[_0x862c('0xc')]('/',auth[_0x862c('0x7')](),controller[_0x862c('0xd')]);router[_0x862c('0xe')](_0x862c('0xa'),auth['isAuthenticated'](),controller[_0x862c('0xf')]);router[_0x862c('0x10')](_0x862c('0xa'),auth[_0x862c('0x7')](),controller[_0x862c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x17ba=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x348652,_0x1ab849){var _0x18a9ea=function(_0x3fd540){while(--_0x3fd540){_0x348652['push'](_0x348652['shift']());}};_0x18a9ea(++_0x1ab849);}(_0x17ba,0xab));var _0xa17b=function(_0x7c989f,_0x440a4c){_0x7c989f=_0x7c989f-0x0;var _0x817515=_0x17ba[_0x7c989f];return _0x817515;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var fs_extra=require(_0xa17b('0x5'));var auth=require(_0xa17b('0x6'));var interaction=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var controller=require(_0xa17b('0x9'));router[_0xa17b('0xa')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0xc')]);router[_0xa17b('0xa')](_0xa17b('0xd'),auth[_0xa17b('0xb')](),controller[_0xa17b('0xe')]);router[_0xa17b('0xf')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0x10')]);router[_0xa17b('0x11')]('/:id',auth[_0xa17b('0xb')](),controller[_0xa17b('0x12')]);router[_0xa17b('0x13')](_0xa17b('0xd'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x14')]);module[_0xa17b('0x15')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 2a6cfa1..922aa3a 100644 --- a/server/api/variable/variable.attributes.js +++ b/server/api/variable/variable.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffc1=['name','sequelize','STRING'];(function(_0x10155b,_0x268106){var _0x152cbd=function(_0x80c5c7){while(--_0x80c5c7){_0x10155b['push'](_0x10155b['shift']());}};_0x152cbd(++_0x268106);}(_0xffc1,0x1b4));var _0x1ffc=function(_0x41604c,_0x3fb07c){_0x41604c=_0x41604c-0x0;var _0x1ea71a=_0xffc1[_0x41604c];return _0x1ea71a;};'use strict';var Sequelize=require(_0x1ffc('0x0'));module['exports']={'name':{'type':Sequelize[_0x1ffc('0x1')],'unique':_0x1ffc('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1ffc('0x1')]}}; \ No newline at end of file +var _0xad3f=['exports','STRING','name'];(function(_0x44cc3e,_0x20fbbe){var _0x155472=function(_0x36604a){while(--_0x36604a){_0x44cc3e['push'](_0x44cc3e['shift']());}};_0x155472(++_0x20fbbe);}(_0xad3f,0x189));var _0xfad3=function(_0x290c73,_0x4995c0){_0x290c73=_0x290c73-0x0;var _0x18edb4=_0xad3f[_0x290c73];return _0x18edb4;};'use strict';var Sequelize=require('sequelize');module[_0xfad3('0x0')]={'name':{'type':Sequelize[_0xfad3('0x1')],'unique':_0xfad3('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfad3('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 40e776b..207ac39 100644 --- a/server/api/variable/variable.controller.js +++ b/server/api/variable/variable.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x71f7=['fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','Variable','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','get','Variables','UserProfileResource','destroy','error','stack','name','rawAttributes','type','key','map','query','intersection','model','attributes'];(function(_0x574de7,_0x24ce60){var _0x568f46=function(_0x516004){while(--_0x516004){_0x574de7['push'](_0x574de7['shift']());}};_0x568f46(++_0x24ce60);}(_0x71f7,0x6a));var _0x771f=function(_0x3be286,_0x42a0f6){_0x3be286=_0x3be286-0x0;var _0x529393=_0x71f7[_0x3be286];return _0x529393;};'use strict';var emlformat=require(_0x771f('0x0'));var rimraf=require(_0x771f('0x1'));var zipdir=require(_0x771f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x771f('0x3'));var BPromise=require(_0x771f('0x4'));var Mustache=require(_0x771f('0x5'));var util=require(_0x771f('0x6'));var path=require(_0x771f('0x7'));var sox=require('sox');var csv=require(_0x771f('0x8'));var ejs=require(_0x771f('0x9'));var fs=require('fs');var fs_extra=require(_0x771f('0xa'));var _=require(_0x771f('0xb'));var squel=require(_0x771f('0xc'));var crypto=require(_0x771f('0xd'));var jsforce=require(_0x771f('0xe'));var deskjs=require(_0x771f('0xf'));var toCsv=require(_0x771f('0x8'));var querystring=require(_0x771f('0x10'));var Papa=require('papaparse');var Redis=require(_0x771f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x771f('0x12'));var hardwareService=require(_0x771f('0x13'));var logger=require('../../config/logger')(_0x771f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x771f('0x15'))['db'];function respondWithStatusCode(_0x5964b7,_0x1073b8){_0x1073b8=_0x1073b8||0xcc;return function(_0x14ac7d){if(_0x14ac7d){return _0x5964b7[_0x771f('0x16')](_0x1073b8);}return _0x5964b7[_0x771f('0x17')](_0x1073b8)[_0x771f('0x18')]();};}function respondWithResult(_0x4bbcae,_0x295dad){_0x295dad=_0x295dad||0xc8;return function(_0x33b371){if(_0x33b371){return _0x4bbcae[_0x771f('0x17')](_0x295dad)[_0x771f('0x19')](_0x33b371);}};}function respondWithFilteredResult(_0x4ca19e,_0x1aa0bc){return function(_0x36ecc3){if(_0x36ecc3){var _0x4c92bd=typeof _0x1aa0bc[_0x771f('0x1a')]===_0x771f('0x1b')&&typeof _0x1aa0bc['limit']===_0x771f('0x1b');var _0x1457b5=_0x36ecc3[_0x771f('0x1c')];var _0x10f061=_0x4c92bd?0x0:_0x1aa0bc['offset'];var _0x3996cc=_0x4c92bd?_0x36ecc3[_0x771f('0x1c')]:_0x1aa0bc[_0x771f('0x1a')]+_0x1aa0bc[_0x771f('0x1d')];var _0x21aaf5;if(_0x3996cc>=_0x1457b5){_0x3996cc=_0x1457b5;_0x21aaf5=0xc8;}else{_0x21aaf5=0xce;}_0x4ca19e[_0x771f('0x17')](_0x21aaf5);return _0x4ca19e['set'](_0x771f('0x1e'),_0x10f061+'-'+_0x3996cc+'/'+_0x1457b5)[_0x771f('0x19')](_0x36ecc3);}return null;};}function patchUpdates(_0x1bf45f){return function(_0x15deee){try{jsonpatch[_0x771f('0x1f')](_0x15deee,_0x1bf45f,!![]);}catch(_0x52e7f0){return BPromise['reject'](_0x52e7f0);}return _0x15deee[_0x771f('0x20')]();};}function saveUpdates(_0x14c5ee,_0x3f9f42){return function(_0x4ade73){if(_0x4ade73){return _0x4ade73[_0x771f('0x21')](_0x14c5ee)[_0x771f('0x22')](function(_0x1f2b47){return _0x1f2b47;});}return null;};}function removeEntity(_0x4a2b53,_0x416bd1){return function(_0xe03af5){if(_0xe03af5){return _0xe03af5['destroy']()[_0x771f('0x22')](function(){var _0x48e936=_0xe03af5[_0x771f('0x23')]({'plain':!![]});var _0x381d38=_0x771f('0x24');return db[_0x771f('0x25')][_0x771f('0x26')]({'where':{'type':_0x381d38,'resourceId':_0x48e936['id']}})[_0x771f('0x22')](function(){return _0xe03af5;});})[_0x771f('0x22')](function(){_0x4a2b53[_0x771f('0x17')](0xcc)[_0x771f('0x18')]();});}};}function handleEntityNotFound(_0x2e8d46,_0x74d370){return function(_0x30c94b){if(!_0x30c94b){_0x2e8d46[_0x771f('0x16')](0x194);}return _0x30c94b;};}function handleError(_0x8ded7b,_0x270cab){_0x270cab=_0x270cab||0x1f4;return function(_0x1c96e1){logger[_0x771f('0x27')](_0x1c96e1[_0x771f('0x28')]);if(_0x1c96e1[_0x771f('0x29')]){delete _0x1c96e1[_0x771f('0x29')];}_0x8ded7b['status'](_0x270cab)['send'](_0x1c96e1);};}exports['index']=function(_0x413572,_0x249f0f){var _0x4650a7={},_0x341c5d={},_0x1ed525={'count':0x0,'rows':[]};var _0xb58a5b=_['map'](db['Variable'][_0x771f('0x2a')],function(_0x2402a5){return{'name':_0x2402a5['fieldName'],'type':_0x2402a5[_0x771f('0x2b')][_0x771f('0x2c')]};});_0x341c5d['model']=_[_0x771f('0x2d')](_0xb58a5b,_0x771f('0x29'));_0x341c5d['query']=_['keys'](_0x413572[_0x771f('0x2e')]);_0x341c5d['filters']=_[_0x771f('0x2f')](_0x341c5d[_0x771f('0x30')],_0x341c5d[_0x771f('0x2e')]);_0x4650a7[_0x771f('0x31')]=_['intersection'](_0x341c5d[_0x771f('0x30')],qs[_0x771f('0x32')](_0x413572['query']['fields']));_0x4650a7[_0x771f('0x31')]=_0x4650a7[_0x771f('0x31')][_0x771f('0x33')]?_0x4650a7[_0x771f('0x31')]:_0x341c5d[_0x771f('0x30')];if(!_0x413572[_0x771f('0x2e')][_0x771f('0x34')](_0x771f('0x35'))){_0x4650a7['limit']=qs['limit'](_0x413572[_0x771f('0x2e')]['limit']);_0x4650a7[_0x771f('0x1a')]=qs[_0x771f('0x1a')](_0x413572[_0x771f('0x2e')][_0x771f('0x1a')]);}_0x4650a7[_0x771f('0x36')]=qs[_0x771f('0x37')](_0x413572[_0x771f('0x2e')][_0x771f('0x37')]);_0x4650a7[_0x771f('0x38')]=qs[_0x771f('0x39')](_['pick'](_0x413572[_0x771f('0x2e')],_0x341c5d['filters']),_0xb58a5b);if(_0x413572[_0x771f('0x2e')][_0x771f('0x3a')]){_0x4650a7['where']=_[_0x771f('0x3b')](_0x4650a7[_0x771f('0x38')],{'$or':_[_0x771f('0x2d')](_0xb58a5b,function(_0x2bfb3d){if(_0x2bfb3d[_0x771f('0x2b')]!==_0x771f('0x3c')){var _0x3963c5={};_0x3963c5[_0x2bfb3d[_0x771f('0x29')]]={'$like':'%'+_0x413572[_0x771f('0x2e')][_0x771f('0x3a')]+'%'};return _0x3963c5;}})});}_0x4650a7=_[_0x771f('0x3b')]({},_0x4650a7,_0x413572[_0x771f('0x3d')]);var _0x3323fe={'where':_0x4650a7[_0x771f('0x38')]};return db[_0x771f('0x3e')][_0x771f('0x1c')](_0x3323fe)[_0x771f('0x22')](function(_0x58e141){_0x1ed525['count']=_0x58e141;if(_0x413572['query'][_0x771f('0x3f')]){_0x4650a7[_0x771f('0x40')]=[{'all':!![]}];}return db[_0x771f('0x3e')][_0x771f('0x41')](_0x4650a7);})['then'](function(_0x4cfa99){_0x1ed525[_0x771f('0x42')]=_0x4cfa99;return _0x1ed525;})[_0x771f('0x22')](respondWithFilteredResult(_0x249f0f,_0x4650a7))[_0x771f('0x43')](handleError(_0x249f0f,null));};exports[_0x771f('0x44')]=function(_0x40bac3,_0x18d9c0){var _0x469b23={'raw':!![],'where':{'id':_0x40bac3[_0x771f('0x45')]['id']}},_0x2d5a66={};_0x2d5a66[_0x771f('0x30')]=_['keys'](db[_0x771f('0x3e')]['rawAttributes']);_0x2d5a66[_0x771f('0x2e')]=_['keys'](_0x40bac3[_0x771f('0x2e')]);_0x2d5a66[_0x771f('0x39')]=_['intersection'](_0x2d5a66['model'],_0x2d5a66[_0x771f('0x2e')]);_0x469b23[_0x771f('0x31')]=_[_0x771f('0x2f')](_0x2d5a66[_0x771f('0x30')],qs[_0x771f('0x32')](_0x40bac3['query'][_0x771f('0x32')]));_0x469b23['attributes']=_0x469b23['attributes']['length']?_0x469b23[_0x771f('0x31')]:_0x2d5a66[_0x771f('0x30')];if(_0x40bac3[_0x771f('0x2e')]['includeAll']){_0x469b23[_0x771f('0x40')]=[{'all':!![]}];}_0x469b23=_[_0x771f('0x3b')]({},_0x469b23,_0x40bac3['options']);return db[_0x771f('0x3e')][_0x771f('0x46')](_0x469b23)[_0x771f('0x22')](handleEntityNotFound(_0x18d9c0,null))[_0x771f('0x22')](respondWithResult(_0x18d9c0,null))[_0x771f('0x43')](handleError(_0x18d9c0,null));};exports['create']=function(_0x47f607,_0xdae94e){return db['Variable'][_0x771f('0x47')](_0x47f607[_0x771f('0x48')],{})[_0x771f('0x22')](function(_0x476847){var _0x12dd4f=_0x47f607[_0x771f('0x49')][_0x771f('0x23')]({'plain':!![]});if(!_0x12dd4f)throw new Error(_0x771f('0x4a'));if(_0x12dd4f[_0x771f('0x4b')]===_0x771f('0x49')){var _0x4bdb75=_0x476847[_0x771f('0x23')]({'plain':!![]});var _0x38cbe2=_0x771f('0x24');return db[_0x771f('0x4c')][_0x771f('0x46')]({'where':{'name':_0x38cbe2,'userProfileId':_0x12dd4f['userProfileId']},'raw':!![]})[_0x771f('0x22')](function(_0x51ffb0){if(_0x51ffb0&&_0x51ffb0[_0x771f('0x4d')]===0x0){return db['UserProfileResource'][_0x771f('0x47')]({'name':_0x4bdb75[_0x771f('0x29')],'resourceId':_0x4bdb75['id'],'type':_0x51ffb0[_0x771f('0x29')],'sectionId':_0x51ffb0['id']},{})[_0x771f('0x22')](function(){return _0x476847;});}else{return _0x476847;}})['catch'](function(_0x3f8c9e){logger[_0x771f('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f8c9e);throw _0x3f8c9e;});}return _0x476847;})['then'](respondWithResult(_0xdae94e,0xc9))[_0x771f('0x43')](handleError(_0xdae94e,null));};exports[_0x771f('0x21')]=function(_0x556337,_0x19d52d){if(_0x556337[_0x771f('0x48')]['id']){delete _0x556337[_0x771f('0x48')]['id'];}return db[_0x771f('0x3e')][_0x771f('0x46')]({'where':{'id':_0x556337[_0x771f('0x45')]['id']}})[_0x771f('0x22')](handleEntityNotFound(_0x19d52d,null))['then'](saveUpdates(_0x556337[_0x771f('0x48')],null))[_0x771f('0x22')](respondWithResult(_0x19d52d,null))[_0x771f('0x43')](handleError(_0x19d52d,null));};exports['destroy']=function(_0x3e84b6,_0x1527a9){return db[_0x771f('0x3e')][_0x771f('0x46')]({'where':{'id':_0x3e84b6[_0x771f('0x45')]['id']}})['then'](handleEntityNotFound(_0x1527a9,null))[_0x771f('0x22')](removeEntity(_0x1527a9,null))[_0x771f('0x43')](handleError(_0x1527a9,null));}; \ No newline at end of file +var _0x781c=['query','keys','intersection','fields','attributes','length','nolimit','offset','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','role','Variables','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','end','error','stack','name','send','Variable','rawAttributes','type','model','map'];(function(_0x4c5e4d,_0x3d7857){var _0x5822bd=function(_0x1f26d5){while(--_0x1f26d5){_0x4c5e4d['push'](_0x4c5e4d['shift']());}};_0x5822bd(++_0x3d7857);}(_0x781c,0xc5));var _0xc781=function(_0x5979f9,_0x1ce132){_0x5979f9=_0x5979f9-0x0;var _0xb25ea1=_0x781c[_0x5979f9];return _0xb25ea1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc781('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc781('0x1'));var rp=require(_0xc781('0x2'));var moment=require('moment');var BPromise=require(_0xc781('0x3'));var Mustache=require(_0xc781('0x4'));var util=require(_0xc781('0x5'));var path=require(_0xc781('0x6'));var sox=require(_0xc781('0x7'));var csv=require(_0xc781('0x8'));var ejs=require(_0xc781('0x9'));var fs=require('fs');var fs_extra=require(_0xc781('0xa'));var _=require(_0xc781('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc781('0xc'));var toCsv=require(_0xc781('0x8'));var querystring=require(_0xc781('0xd'));var Papa=require(_0xc781('0xe'));var Redis=require(_0xc781('0xf'));var authService=require(_0xc781('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc781('0x11'));var utils=require(_0xc781('0x12'));var config=require(_0xc781('0x13'));var licenseUtil=require(_0xc781('0x14'));var db=require(_0xc781('0x15'))['db'];function respondWithStatusCode(_0x770318,_0x3e21f2){_0x3e21f2=_0x3e21f2||0xcc;return function(_0x27c51f){if(_0x27c51f){return _0x770318[_0xc781('0x16')](_0x3e21f2);}return _0x770318[_0xc781('0x17')](_0x3e21f2)['end']();};}function respondWithResult(_0x17d9dd,_0x3c8ea5){_0x3c8ea5=_0x3c8ea5||0xc8;return function(_0x1c4dac){if(_0x1c4dac){return _0x17d9dd['status'](_0x3c8ea5)['json'](_0x1c4dac);}};}function respondWithFilteredResult(_0x566f28,_0x21fdfc){return function(_0x3c744a){if(_0x3c744a){var _0x47ad9a=typeof _0x21fdfc['offset']===_0xc781('0x18')&&typeof _0x21fdfc[_0xc781('0x19')]==='undefined';var _0x46aa0e=_0x3c744a[_0xc781('0x1a')];var _0x253b34=_0x47ad9a?0x0:_0x21fdfc['offset'];var _0x31146b=_0x47ad9a?_0x3c744a[_0xc781('0x1a')]:_0x21fdfc['offset']+_0x21fdfc[_0xc781('0x19')];var _0x597504;if(_0x31146b>=_0x46aa0e){_0x31146b=_0x46aa0e;_0x597504=0xc8;}else{_0x597504=0xce;}_0x566f28[_0xc781('0x17')](_0x597504);return _0x566f28[_0xc781('0x1b')](_0xc781('0x1c'),_0x253b34+'-'+_0x31146b+'/'+_0x46aa0e)[_0xc781('0x1d')](_0x3c744a);}return null;};}function patchUpdates(_0xbc8da6){return function(_0x4fd5d7){try{jsonpatch['apply'](_0x4fd5d7,_0xbc8da6,!![]);}catch(_0x1a87a9){return BPromise[_0xc781('0x1e')](_0x1a87a9);}return _0x4fd5d7[_0xc781('0x1f')]();};}function saveUpdates(_0x43dbe1,_0x592961){return function(_0x12bf5a){if(_0x12bf5a){return _0x12bf5a[_0xc781('0x20')](_0x43dbe1)[_0xc781('0x21')](function(_0x1cf808){return _0x1cf808;});}return null;};}function removeEntity(_0x141aca,_0x43d99b){return function(_0x9ca049){if(_0x9ca049){return _0x9ca049[_0xc781('0x22')]()['then'](function(){var _0x38ee85=_0x9ca049[_0xc781('0x23')]({'plain':!![]});var _0x36a46d='Variables';return db['UserProfileResource'][_0xc781('0x22')]({'where':{'type':_0x36a46d,'resourceId':_0x38ee85['id']}})[_0xc781('0x21')](function(){return _0x9ca049;});})[_0xc781('0x21')](function(){_0x141aca['status'](0xcc)[_0xc781('0x24')]();});}};}function handleEntityNotFound(_0xe68702,_0x41e3d7){return function(_0x3f69a7){if(!_0x3f69a7){_0xe68702[_0xc781('0x16')](0x194);}return _0x3f69a7;};}function handleError(_0x51e2fc,_0x1890cb){_0x1890cb=_0x1890cb||0x1f4;return function(_0x391084){logger[_0xc781('0x25')](_0x391084[_0xc781('0x26')]);if(_0x391084[_0xc781('0x27')]){delete _0x391084[_0xc781('0x27')];}_0x51e2fc[_0xc781('0x17')](_0x1890cb)[_0xc781('0x28')](_0x391084);};}exports['index']=function(_0x29034b,_0x426391){var _0x45f5ad={},_0x541671={},_0x5dc519={'count':0x0,'rows':[]};var _0x4e9710=_['map'](db[_0xc781('0x29')][_0xc781('0x2a')],function(_0x2f503d){return{'name':_0x2f503d['fieldName'],'type':_0x2f503d[_0xc781('0x2b')]['key']};});_0x541671[_0xc781('0x2c')]=_[_0xc781('0x2d')](_0x4e9710,_0xc781('0x27'));_0x541671[_0xc781('0x2e')]=_[_0xc781('0x2f')](_0x29034b[_0xc781('0x2e')]);_0x541671['filters']=_[_0xc781('0x30')](_0x541671[_0xc781('0x2c')],_0x541671[_0xc781('0x2e')]);_0x45f5ad['attributes']=_[_0xc781('0x30')](_0x541671[_0xc781('0x2c')],qs[_0xc781('0x31')](_0x29034b[_0xc781('0x2e')]['fields']));_0x45f5ad['attributes']=_0x45f5ad[_0xc781('0x32')][_0xc781('0x33')]?_0x45f5ad[_0xc781('0x32')]:_0x541671[_0xc781('0x2c')];if(!_0x29034b[_0xc781('0x2e')]['hasOwnProperty'](_0xc781('0x34'))){_0x45f5ad[_0xc781('0x19')]=qs[_0xc781('0x19')](_0x29034b[_0xc781('0x2e')][_0xc781('0x19')]);_0x45f5ad['offset']=qs[_0xc781('0x35')](_0x29034b['query'][_0xc781('0x35')]);}_0x45f5ad[_0xc781('0x36')]=qs[_0xc781('0x37')](_0x29034b[_0xc781('0x2e')][_0xc781('0x37')]);_0x45f5ad['where']=qs[_0xc781('0x38')](_[_0xc781('0x39')](_0x29034b[_0xc781('0x2e')],_0x541671[_0xc781('0x38')]),_0x4e9710);if(_0x29034b['query'][_0xc781('0x3a')]){_0x45f5ad['where']=_[_0xc781('0x3b')](_0x45f5ad[_0xc781('0x3c')],{'$or':_['map'](_0x4e9710,function(_0x400ce4){if(_0x400ce4[_0xc781('0x2b')]!==_0xc781('0x3d')){var _0xd67f88={};_0xd67f88[_0x400ce4[_0xc781('0x27')]]={'$like':'%'+_0x29034b['query']['filter']+'%'};return _0xd67f88;}})});}_0x45f5ad=_['merge']({},_0x45f5ad,_0x29034b[_0xc781('0x3e')]);var _0x1aa930={'where':_0x45f5ad[_0xc781('0x3c')]};return db[_0xc781('0x29')][_0xc781('0x1a')](_0x1aa930)[_0xc781('0x21')](function(_0x2788ab){_0x5dc519[_0xc781('0x1a')]=_0x2788ab;if(_0x29034b[_0xc781('0x2e')][_0xc781('0x3f')]){_0x45f5ad['include']=[{'all':!![]}];}return db[_0xc781('0x29')][_0xc781('0x40')](_0x45f5ad);})['then'](function(_0x20eb38){_0x5dc519[_0xc781('0x41')]=_0x20eb38;return _0x5dc519;})[_0xc781('0x21')](respondWithFilteredResult(_0x426391,_0x45f5ad))[_0xc781('0x42')](handleError(_0x426391,null));};exports[_0xc781('0x43')]=function(_0x1a545e,_0x473e17){var _0x418258={'raw':!![],'where':{'id':_0x1a545e[_0xc781('0x44')]['id']}},_0x2fde90={};_0x2fde90[_0xc781('0x2c')]=_['keys'](db[_0xc781('0x29')][_0xc781('0x2a')]);_0x2fde90[_0xc781('0x2e')]=_[_0xc781('0x2f')](_0x1a545e[_0xc781('0x2e')]);_0x2fde90['filters']=_[_0xc781('0x30')](_0x2fde90[_0xc781('0x2c')],_0x2fde90['query']);_0x418258['attributes']=_[_0xc781('0x30')](_0x2fde90['model'],qs[_0xc781('0x31')](_0x1a545e[_0xc781('0x2e')]['fields']));_0x418258[_0xc781('0x32')]=_0x418258['attributes'][_0xc781('0x33')]?_0x418258[_0xc781('0x32')]:_0x2fde90[_0xc781('0x2c')];if(_0x1a545e[_0xc781('0x2e')][_0xc781('0x3f')]){_0x418258[_0xc781('0x45')]=[{'all':!![]}];}_0x418258=_[_0xc781('0x3b')]({},_0x418258,_0x1a545e[_0xc781('0x3e')]);return db['Variable'][_0xc781('0x46')](_0x418258)[_0xc781('0x21')](handleEntityNotFound(_0x473e17,null))[_0xc781('0x21')](respondWithResult(_0x473e17,null))[_0xc781('0x42')](handleError(_0x473e17,null));};exports[_0xc781('0x47')]=function(_0x422c12,_0x329f67){return db[_0xc781('0x29')][_0xc781('0x47')](_0x422c12[_0xc781('0x48')],{})[_0xc781('0x21')](function(_0x8397c9){var _0x4fa45c=_0x422c12[_0xc781('0x49')]['get']({'plain':!![]});if(!_0x4fa45c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fa45c[_0xc781('0x4a')]===_0xc781('0x49')){var _0x2bb85c=_0x8397c9[_0xc781('0x23')]({'plain':!![]});var _0x3fe90c=_0xc781('0x4b');return db[_0xc781('0x4c')]['find']({'where':{'name':_0x3fe90c,'userProfileId':_0x4fa45c[_0xc781('0x4d')]},'raw':!![]})[_0xc781('0x21')](function(_0x595e69){if(_0x595e69&&_0x595e69[_0xc781('0x4e')]===0x0){return db[_0xc781('0x4f')][_0xc781('0x47')]({'name':_0x2bb85c[_0xc781('0x27')],'resourceId':_0x2bb85c['id'],'type':_0x595e69[_0xc781('0x27')],'sectionId':_0x595e69['id']},{})[_0xc781('0x21')](function(){return _0x8397c9;});}else{return _0x8397c9;}})[_0xc781('0x42')](function(_0x25e332){logger[_0xc781('0x25')](_0xc781('0x50'),_0x25e332);throw _0x25e332;});}return _0x8397c9;})['then'](respondWithResult(_0x329f67,0xc9))[_0xc781('0x42')](handleError(_0x329f67,null));};exports[_0xc781('0x20')]=function(_0x56427f,_0x54491f){if(_0x56427f[_0xc781('0x48')]['id']){delete _0x56427f[_0xc781('0x48')]['id'];}return db[_0xc781('0x29')]['find']({'where':{'id':_0x56427f['params']['id']}})[_0xc781('0x21')](handleEntityNotFound(_0x54491f,null))[_0xc781('0x21')](saveUpdates(_0x56427f[_0xc781('0x48')],null))['then'](respondWithResult(_0x54491f,null))[_0xc781('0x42')](handleError(_0x54491f,null));};exports[_0xc781('0x22')]=function(_0x2be8d3,_0xa98d76){return db[_0xc781('0x29')][_0xc781('0x46')]({'where':{'id':_0x2be8d3[_0xc781('0x44')]['id']}})[_0xc781('0x21')](handleEntityNotFound(_0xa98d76,null))[_0xc781('0x21')](removeEntity(_0xa98d76,null))[_0xc781('0x42')](handleError(_0xa98d76,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index de282b6..71e1090 100644 --- a/server/api/variable/variable.model.js +++ b/server/api/variable/variable.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x270d=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash'];(function(_0x1593f9,_0x44bc54){var _0x34ca39=function(_0x2610c6){while(--_0x2610c6){_0x1593f9['push'](_0x1593f9['shift']());}};_0x34ca39(++_0x44bc54);}(_0x270d,0x16b));var _0xd270=function(_0x38944a,_0x34fdb4){_0x38944a=_0x38944a-0x0;var _0x4756f3=_0x270d[_0x38944a];return _0x4756f3;};'use strict';var _=require(_0xd270('0x0'));var util=require(_0xd270('0x1'));var logger=require(_0xd270('0x2'))('api');var moment=require(_0xd270('0x3'));var BPromise=require(_0xd270('0x4'));var rp=require(_0xd270('0x5'));var fs=require('fs');var path=require(_0xd270('0x6'));var rimraf=require(_0xd270('0x7'));var config=require(_0xd270('0x8'));var attributes=require(_0xd270('0x9'));module[_0xd270('0xa')]=function(_0x476c39,_0x1da41c){return _0x476c39[_0xd270('0xb')](_0xd270('0xc'),attributes,{'tableName':_0xd270('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26d1=['define','Variable','tools_variables','api','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes','exports'];(function(_0x29059d,_0x332387){var _0x4d5f08=function(_0x4a227c){while(--_0x4a227c){_0x29059d['push'](_0x29059d['shift']());}};_0x4d5f08(++_0x332387);}(_0x26d1,0x1ed));var _0x126d=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x26d1[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x126d('0x0'));var moment=require('moment');var BPromise=require(_0x126d('0x1'));var rp=require(_0x126d('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x126d('0x3'));var config=require(_0x126d('0x4'));var attributes=require(_0x126d('0x5'));module[_0x126d('0x6')]=function(_0x360c5a,_0x1710e0){return _0x360c5a[_0x126d('0x7')](_0x126d('0x8'),attributes,{'tableName':_0x126d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index f84e216..cbb6fcd 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x2ab350,_0x32859f){var _0x4acac=function(_0x58ddc6){while(--_0x58ddc6){_0x2ab350['push'](_0x2ab350['shift']());}};_0x4acac(++_0x32859f);}(_0x3e74,0x175));var _0x43e7=function(_0x319ce9,_0x49f867){_0x319ce9=_0x319ce9-0x0;var _0x324af2=_0x3e74[_0x319ce9];return _0x324af2;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file +var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x3694a0,_0x4151fa){var _0x36704c=function(_0x41a24e){while(--_0x41a24e){_0x3694a0['push'](_0x3694a0['shift']());}};_0x36704c(++_0x4151fa);}(_0x6aa7,0x178));var _0x76aa=function(_0x70ea71,_0xff9c0a){_0x70ea71=_0x70ea71-0x0;var _0x380d58=_0x6aa7[_0x70ea71];return _0x380d58;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 2ae342f..c1ae56b 100644 --- a/server/api/version/index.js +++ b/server/api/version/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1319=['exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/reset','reset','/pull','pull','/restart','restart','/migrations','migrations'];(function(_0x55e1d1,_0x3c9376){var _0x1165db=function(_0x5b0120){while(--_0x5b0120){_0x55e1d1['push'](_0x55e1d1['shift']());}};_0x1165db(++_0x3c9376);}(_0x1319,0xd9));var _0x9131=function(_0x1f675c,_0x10144e){_0x1f675c=_0x1f675c-0x0;var _0xf86fa4=_0x1319[_0x1f675c];return _0xf86fa4;};'use strict';var express=require(_0x9131('0x0'));var router=express[_0x9131('0x1')]();var auth=require(_0x9131('0x2'));var controller=require(_0x9131('0x3'));router[_0x9131('0x4')]('/',controller[_0x9131('0x5')]);router['get'](_0x9131('0x6'),auth[_0x9131('0x7')](),auth[_0x9131('0x8')](),controller['fetch']);router[_0x9131('0x4')](_0x9131('0x9'),auth[_0x9131('0x7')](),auth[_0x9131('0x8')](),controller[_0x9131('0xa')]);router[_0x9131('0x4')](_0x9131('0xb'),auth[_0x9131('0x7')](),auth[_0x9131('0x8')](),controller[_0x9131('0xc')]);router[_0x9131('0x4')](_0x9131('0xd'),auth[_0x9131('0x7')](),controller[_0x9131('0xe')]);router[_0x9131('0x4')](_0x9131('0xf'),controller[_0x9131('0x10')]);module[_0x9131('0x11')]=router; \ No newline at end of file +var _0x521f=['restart','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','fetch','/reset','canUpdate','reset','/pull','pull','/restart'];(function(_0x8461eb,_0x528b15){var _0x334d7f=function(_0x4dcf5a){while(--_0x4dcf5a){_0x8461eb['push'](_0x8461eb['shift']());}};_0x334d7f(++_0x528b15);}(_0x521f,0x1bd));var _0xf521=function(_0x62bd23,_0x1f06b4){_0x62bd23=_0x62bd23-0x0;var _0x5b2657=_0x521f[_0x62bd23];return _0x5b2657;};'use strict';var express=require(_0xf521('0x0'));var router=express[_0xf521('0x1')]();var auth=require(_0xf521('0x2'));var controller=require(_0xf521('0x3'));router[_0xf521('0x4')]('/',controller['index']);router[_0xf521('0x4')](_0xf521('0x5'),auth[_0xf521('0x6')](),auth['canUpdate'](),controller[_0xf521('0x7')]);router[_0xf521('0x4')](_0xf521('0x8'),auth[_0xf521('0x6')](),auth[_0xf521('0x9')](),controller[_0xf521('0xa')]);router['get'](_0xf521('0xb'),auth[_0xf521('0x6')](),auth['canUpdate'](),controller[_0xf521('0xc')]);router['get'](_0xf521('0xd'),auth[_0xf521('0x6')](),controller[_0xf521('0xe')]);router[_0xf521('0x4')]('/migrations',controller[_0xf521('0xf')]);module[_0xf521('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 5b2fe2a..d63c302 100644 --- a/server/api/version/version.controller.js +++ b/server/api/version/version.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f99=['json','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','length','replace','.js','push','sort','sequelize','Migration','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','then','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','exec','../../mysqldb','../../config/environment','update','simple-git','root','index','query','latest','fetch','tags','exports','version','status'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x4f99,0x152));var _0x94f9=function(_0x4c8800,_0x347854){_0x4c8800=_0x4c8800-0x0;var _0x5d085d=_0x4f99[_0x4c8800];return _0x5d085d;};'use strict';var Umzug=require(_0x94f9('0x0'));var path=require(_0x94f9('0x1'));var fs=require('fs');var _=require(_0x94f9('0x2'));var pkginfo=require(_0x94f9('0x3'))(module,'version');var compareVersions=require(_0x94f9('0x4'));var exec=require('child_process')[_0x94f9('0x5')];var db=require(_0x94f9('0x6'))['db'];var config=require(_0x94f9('0x7'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0x94f9('0x8'));var git=require(_0x94f9('0x9'))(config[_0x94f9('0xa')]);exports[_0x94f9('0xb')]=function(_0x3b3d75,_0xa3c8b3){var _0x524931={'current':module['exports']['version'],'phonebar':0x2};if(_0x3b3d75[_0x94f9('0xc')]&&_0x3b3d75[_0x94f9('0xc')][_0x94f9('0xd')]){return git[_0x94f9('0xe')]()[_0x94f9('0xf')](function(_0x51ba2e,_0x4a0b43){_0x524931[_0x94f9('0xd')]=(_0x51ba2e?module[_0x94f9('0x10')][_0x94f9('0x11')]:_0x4a0b43[_0x94f9('0xd')])||'2.0.0';return _0xa3c8b3[_0x94f9('0x12')](0xc8)[_0x94f9('0x13')](_0x524931);});}else{return _0xa3c8b3[_0x94f9('0x12')](0xc8)[_0x94f9('0x13')](_0x524931);}};exports[_0x94f9('0xe')]=function(_0x3c6ccc,_0xa3f89a){return git['fetch']([_0x94f9('0x14'),'master'],function(_0x5b49de){if(_0x5b49de){logger[_0x94f9('0x15')](_0x5b49de);return _0xa3f89a['status'](0x1f4)[_0x94f9('0x13')](_0x5b49de);}logger[_0x94f9('0x16')](_0x94f9('0x17'));return _0xa3f89a[_0x94f9('0x12')](0xc8)['json']({'output':_0x94f9('0x18')});});};exports['reset']=function(_0x4d7373,_0xfdb648){return git[_0x94f9('0x19')](['--hard',_0x94f9('0x1a')],function(_0x7ae0b2){if(_0x7ae0b2){logger[_0x94f9('0x15')](_0x7ae0b2);return _0xfdb648[_0x94f9('0x12')](0x1f4)[_0x94f9('0x13')](_0x7ae0b2);}logger[_0x94f9('0x16')](_0x94f9('0x1b'));return _0xfdb648[_0x94f9('0x12')](0xc8)[_0x94f9('0x13')]({'output':'git\x20reset\x20--hard'});});};exports[_0x94f9('0x1c')]=function(_0xc17214,_0x1a2127){exec(_0x94f9('0x1d'),function(_0x229814,_0x56001f,_0x5240d7){logger['info'](_0x56001f);logger[_0x94f9('0x16')](_0x5240d7);if(_0x229814){logger['error'](_0x229814);return _0x1a2127['status'](0x1f4)[_0x94f9('0x13')](_0x229814);}return _0x1a2127[_0x94f9('0x12')](0xc8)[_0x94f9('0x13')]({'output':_0x56001f});});};exports['restart']=function(_0x536d51,_0x184833){return pm2['restart'](_0x94f9('0x1e'))['then'](function(_0x1c3a37){logger['info'](_0x94f9('0x1f'),_0x1c3a37);return _0x184833[_0x94f9('0x12')](0xc8)[_0x94f9('0x13')]({'output':_0x94f9('0x20')});})[_0x94f9('0x21')](function(_0x3f7aab){logger['error'](_0x3f7aab);return _0x184833[_0x94f9('0x12')](0x1f4)[_0x94f9('0x13')](_0x3f7aab);});};exports[_0x94f9('0x22')]=function(_0x5cdf89,_0x310173){var _0x2320f9=fs[_0x94f9('0x23')](path['join'](config[_0x94f9('0xa')],_0x94f9('0x24'),_0x94f9('0x22')));var _0x51875a=[];for(var _0x18418f=0x0;_0x18418f<_0x2320f9[_0x94f9('0x25')];_0x18418f++){var _0x9dcabc=_0x2320f9[_0x18418f][_0x94f9('0x26')](_0x94f9('0x27'),'');if(compareVersions(module[_0x94f9('0x10')][_0x94f9('0x11')],_0x9dcabc)===-0x1){_0x51875a[_0x94f9('0x28')](_0x9dcabc);}}if(_0x51875a[_0x94f9('0x25')]){var _0x2d4b8f=_0x51875a[_0x94f9('0x29')](compareVersions);var _0x2052ee=new Umzug({'storage':_0x94f9('0x2a'),'storageOptions':{'model':db[_0x94f9('0x2b')],'modelName':_0x94f9('0x2b'),'columnName':_0x94f9('0x11')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db[_0x94f9('0x2a')]['constructor'],function(){throw new Error(_0x94f9('0x2c'));}],'path':path[_0x94f9('0x2d')](config[_0x94f9('0xa')],_0x94f9('0x24'),'migrations'),'pattern':/\.js$/}});_0x2052ee['up']({'migrations':_[_0x94f9('0x2e')](_0x2d4b8f,function(_0x4ec465){return _0x4ec465+_0x94f9('0x27');})})[_0x94f9('0x2f')](function(){return _0x310173['status'](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x94f9('0x10')][_0x94f9('0x11')]+_0x94f9('0x30')+_['last'](_0x2d4b8f),'migrations':_[_0x94f9('0x2d')](_0x2d4b8f)});})[_0x94f9('0x21')](function(_0x1746e3){if(_0x1746e3 instanceof db[_0x94f9('0x2a')][_0x94f9('0x31')]){return _0x310173[_0x94f9('0x12')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x310173[_0x94f9('0x12')](0x1f4)[_0x94f9('0x13')](_0x1746e3);}});}else{return _0x310173[_0x94f9('0x12')](0xc8)[_0x94f9('0x13')]({'output':_0x94f9('0x32')});}}; \ No newline at end of file +var _0xa9e3=['npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','length','replace','.js','push','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','join','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','compare-versions','exec','../../config/environment','update','root','index','exports','version','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull'];(function(_0x1d0b80,_0x41fc24){var _0x35d642=function(_0x4c2cb5){while(--_0x4c2cb5){_0x1d0b80['push'](_0x1d0b80['shift']());}};_0x35d642(++_0x41fc24);}(_0xa9e3,0x127));var _0x3a9e=function(_0x107af0,_0x4f8afc){_0x107af0=_0x107af0-0x0;var _0xd95779=_0xa9e3[_0x107af0];return _0xd95779;};'use strict';var Umzug=require(_0x3a9e('0x0'));var path=require(_0x3a9e('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,'version');var compareVersions=require(_0x3a9e('0x2'));var exec=require('child_process')[_0x3a9e('0x3')];var db=require('../../mysqldb')['db'];var config=require(_0x3a9e('0x4'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0x3a9e('0x5'));var git=require('simple-git')(config[_0x3a9e('0x6')]);exports[_0x3a9e('0x7')]=function(_0x288672,_0x3c595c){var _0x2ea55f={'current':module[_0x3a9e('0x8')][_0x3a9e('0x9')],'phonebar':0x2};if(_0x288672[_0x3a9e('0xa')]&&_0x288672[_0x3a9e('0xa')][_0x3a9e('0xb')]){return git[_0x3a9e('0xc')]()[_0x3a9e('0xd')](function(_0x49437b,_0x2dbe7a){_0x2ea55f[_0x3a9e('0xb')]=(_0x49437b?module['exports']['version']:_0x2dbe7a[_0x3a9e('0xb')])||_0x3a9e('0xe');return _0x3c595c[_0x3a9e('0xf')](0xc8)[_0x3a9e('0x10')](_0x2ea55f);});}else{return _0x3c595c[_0x3a9e('0xf')](0xc8)[_0x3a9e('0x10')](_0x2ea55f);}};exports[_0x3a9e('0xc')]=function(_0x346e99,_0x240133){return git[_0x3a9e('0xc')]([_0x3a9e('0x11'),_0x3a9e('0x12')],function(_0x53e2d1){if(_0x53e2d1){logger[_0x3a9e('0x13')](_0x53e2d1);return _0x240133[_0x3a9e('0xf')](0x1f4)[_0x3a9e('0x10')](_0x53e2d1);}logger[_0x3a9e('0x14')](_0x3a9e('0x15'));return _0x240133[_0x3a9e('0xf')](0xc8)[_0x3a9e('0x10')]({'output':_0x3a9e('0x16')});});};exports[_0x3a9e('0x17')]=function(_0x461ab6,_0x2fa20c){return git[_0x3a9e('0x17')]([_0x3a9e('0x18'),_0x3a9e('0x19')],function(_0x459e85){if(_0x459e85){logger['error'](_0x459e85);return _0x2fa20c[_0x3a9e('0xf')](0x1f4)[_0x3a9e('0x10')](_0x459e85);}logger[_0x3a9e('0x14')](_0x3a9e('0x1a'));return _0x2fa20c[_0x3a9e('0xf')](0xc8)[_0x3a9e('0x10')]({'output':_0x3a9e('0x1b')});});};exports[_0x3a9e('0x1c')]=function(_0x1f8d1a,_0x35d87d){exec(_0x3a9e('0x1d'),function(_0xaf5ad0,_0x1f0876,_0x54bc15){logger[_0x3a9e('0x14')](_0x1f0876);logger[_0x3a9e('0x14')](_0x54bc15);if(_0xaf5ad0){logger[_0x3a9e('0x13')](_0xaf5ad0);return _0x35d87d[_0x3a9e('0xf')](0x1f4)[_0x3a9e('0x10')](_0xaf5ad0);}return _0x35d87d[_0x3a9e('0xf')](0xc8)[_0x3a9e('0x10')]({'output':_0x1f0876});});};exports[_0x3a9e('0x1e')]=function(_0xe364c1,_0x367496){return pm2[_0x3a9e('0x1e')](_0x3a9e('0x1f'))[_0x3a9e('0x20')](function(_0x90bf20){logger['info'](_0x3a9e('0x21'),_0x90bf20);return _0x367496[_0x3a9e('0xf')](0xc8)['json']({'output':_0x3a9e('0x22')});})[_0x3a9e('0x23')](function(_0x4e44b6){logger[_0x3a9e('0x13')](_0x4e44b6);return _0x367496['status'](0x1f4)[_0x3a9e('0x10')](_0x4e44b6);});};exports[_0x3a9e('0x24')]=function(_0x1266ac,_0x3e845a){var _0x2c25d6=fs[_0x3a9e('0x25')](path['join'](config[_0x3a9e('0x6')],_0x3a9e('0x26'),_0x3a9e('0x24')));var _0x315d88=[];for(var _0x43a6f3=0x0;_0x43a6f3<_0x2c25d6[_0x3a9e('0x27')];_0x43a6f3++){var _0x5d06af=_0x2c25d6[_0x43a6f3][_0x3a9e('0x28')](_0x3a9e('0x29'),'');if(compareVersions(module[_0x3a9e('0x8')]['version'],_0x5d06af)===-0x1){_0x315d88[_0x3a9e('0x2a')](_0x5d06af);}}if(_0x315d88['length']){var _0x39e761=_0x315d88['sort'](compareVersions);var _0x2c93a0=new Umzug({'storage':_0x3a9e('0x2b'),'storageOptions':{'model':db[_0x3a9e('0x2c')],'modelName':_0x3a9e('0x2c'),'columnName':'version'},'migrations':{'params':[db[_0x3a9e('0x2b')][_0x3a9e('0x2d')](),db[_0x3a9e('0x2b')]['constructor'],function(){throw new Error(_0x3a9e('0x2e'));}],'path':path['join'](config[_0x3a9e('0x6')],_0x3a9e('0x26'),'migrations'),'pattern':/\.js$/}});_0x2c93a0['up']({'migrations':_[_0x3a9e('0x2f')](_0x39e761,function(_0x2a9846){return _0x2a9846+_0x3a9e('0x29');})})[_0x3a9e('0x20')](function(){return _0x3e845a[_0x3a9e('0xf')](0xc8)['json']({'output':_0x3a9e('0x30')+module[_0x3a9e('0x8')][_0x3a9e('0x9')]+_0x3a9e('0x31')+_[_0x3a9e('0x32')](_0x39e761),'migrations':_[_0x3a9e('0x33')](_0x39e761)});})[_0x3a9e('0x23')](function(_0x54c34d){if(_0x54c34d instanceof db[_0x3a9e('0x2b')][_0x3a9e('0x34')]){return _0x3e845a[_0x3a9e('0xf')](0xc8)[_0x3a9e('0x10')]({'output':_0x3a9e('0x35')});}else{return _0x3e845a[_0x3a9e('0xf')](0x1f4)[_0x3a9e('0x10')](_0x54c34d);}});}else{return _0x3e845a['status'](0xc8)[_0x3a9e('0x10')]({'output':_0x3a9e('0x35')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index b784481..64012d8 100644 --- a/server/api/voiceAgentReport/index.js +++ b/server/api/voiceAgentReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64fd=['./voiceAgentReport.controller','get','isAuthenticated','index','describe','/:id','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x144616,_0x1188de){var _0x100e2f=function(_0x35d543){while(--_0x35d543){_0x144616['push'](_0x144616['shift']());}};_0x100e2f(++_0x1188de);}(_0x64fd,0x107));var _0xd64f=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x64fd[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0xd64f('0x0'));var util=require(_0xd64f('0x1'));var path=require(_0xd64f('0x2'));var timeout=require(_0xd64f('0x3'));var express=require(_0xd64f('0x4'));var router=express[_0xd64f('0x5')]();var fs_extra=require(_0xd64f('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd64f('0x7'));router[_0xd64f('0x8')]('/',auth[_0xd64f('0x9')](),controller[_0xd64f('0xa')]);router['get']('/describe',auth[_0xd64f('0x9')](),controller[_0xd64f('0xb')]);router[_0xd64f('0x8')](_0xd64f('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xd64f('0x9')](),controller[_0xd64f('0xd')]);router[_0xd64f('0xe')](_0xd64f('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd64f('0xf')](_0xd64f('0xc'),auth[_0xd64f('0x9')](),controller[_0xd64f('0x10')]);module[_0xd64f('0x11')]=router; \ No newline at end of file +var _0x5813=['get','isAuthenticated','index','/:id','show','post','create','put','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x5813,0x13b));var _0x3581=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5813[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3581('0x0'));var util=require(_0x3581('0x1'));var path=require('path');var timeout=require(_0x3581('0x2'));var express=require(_0x3581('0x3'));var router=express[_0x3581('0x4')]();var fs_extra=require(_0x3581('0x5'));var auth=require(_0x3581('0x6'));var interaction=require(_0x3581('0x7'));var config=require(_0x3581('0x8'));var controller=require('./voiceAgentReport.controller');router[_0x3581('0x9')]('/',auth[_0x3581('0xa')](),controller[_0x3581('0xb')]);router['get']('/describe',auth[_0x3581('0xa')](),controller['describe']);router[_0x3581('0x9')](_0x3581('0xc'),auth['isAuthenticated'](),controller[_0x3581('0xd')]);router[_0x3581('0xe')]('/',auth['isAuthenticated'](),controller[_0x3581('0xf')]);router[_0x3581('0x10')]('/:id',auth[_0x3581('0xa')](),controller['update']);router[_0x3581('0x11')](_0x3581('0xc'),auth[_0x3581('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 659e3cb..bf1b6a9 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.attributes.js +++ b/server/api/voiceAgentReport/voiceAgentReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5eef=['FORWARD,\x20BLIND,\x20ATTENDED','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x2a8b39,_0x154fe3){var _0x547e12=function(_0x14cf6c){while(--_0x14cf6c){_0x2a8b39['push'](_0x2a8b39['shift']());}};_0x547e12(++_0x154fe3);}(_0x5eef,0x9c));var _0xf5ee=function(_0x55da64,_0x3d3172){_0x55da64=_0x55da64-0x0;var _0x55445f=_0x5eef[_0x55da64];return _0x55445f;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xf5ee('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf5ee('0x0')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xf5ee('0x0')]},'interface':{'type':Sequelize[_0xf5ee('0x0')]},'membername':{'type':Sequelize[_0xf5ee('0x0')]},'agentcalledAt':{'type':Sequelize[_0xf5ee('0x1')]},'agentconnectAt':{'type':Sequelize[_0xf5ee('0x1')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xf5ee('0x2')]},'agentcomplete':{'type':Sequelize[_0xf5ee('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xf5ee('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xf5ee('0x2')]},'agentacw':{'type':Sequelize[_0xf5ee('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf5ee('0x2')]},'reason':{'type':Sequelize[_0xf5ee('0x0')]},'lastevent':{'type':Sequelize[_0xf5ee('0x0')]},'channel':{'type':Sequelize[_0xf5ee('0x0')]},'channelstate':{'type':Sequelize[_0xf5ee('0x2')]},'channelstatedesc':{'type':Sequelize[_0xf5ee('0x0')]},'connectedlinenum':{'type':Sequelize[_0xf5ee('0x0')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf5ee('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xf5ee('0x0')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf5ee('0x0')]},'destchannel':{'type':Sequelize[_0xf5ee('0x0')]},'destchannelstate':{'type':Sequelize[_0xf5ee('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xf5ee('0x0')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xf5ee('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0xf5ee('0x0')]},'destconnectedlinename':{'type':Sequelize[_0xf5ee('0x0')]},'destlanguage':{'type':Sequelize[_0xf5ee('0x0')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf5ee('0x0')]},'destpriority':{'type':Sequelize[_0xf5ee('0x0')]},'destuniqueid':{'type':Sequelize[_0xf5ee('0x0')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xf5ee('0x0')]},'answeredelsewheremembername':{'type':Sequelize[_0xf5ee('0x0')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf5ee('0x0')],'comment':_0xf5ee('0x4')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xf5ee('0x0')]},'agententerreason':{'type':Sequelize[_0xf5ee('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb44a=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb44a,0x1c2));var _0xab44=function(_0x119629,_0x246787){_0x119629=_0x119629-0x0;var _0x49a771=_0xb44a[_0x119629];return _0x49a771;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xab44('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xab44('0x0')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xab44('0x0')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xab44('0x1')]},'agentconnectAt':{'type':Sequelize[_0xab44('0x1')]},'agentcompleteAt':{'type':Sequelize[_0xab44('0x1')]},'agentringnoanswerAt':{'type':Sequelize[_0xab44('0x1')]},'agentdumpAt':{'type':Sequelize[_0xab44('0x1')]},'holdtime':{'type':Sequelize[_0xab44('0x2')]},'agentcomplete':{'type':Sequelize[_0xab44('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xab44('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xab44('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xab44('0x2')]},'agentacw':{'type':Sequelize[_0xab44('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xab44('0x2')]},'reason':{'type':Sequelize[_0xab44('0x0')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xab44('0x0')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xab44('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xab44('0x0')]},'accountcode':{'type':Sequelize[_0xab44('0x0')]},'context':{'type':Sequelize[_0xab44('0x0')]},'exten':{'type':Sequelize[_0xab44('0x0')]},'priority':{'type':Sequelize[_0xab44('0x0')]},'destchannel':{'type':Sequelize[_0xab44('0x0')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xab44('0x0')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xab44('0x0')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xab44('0x0')]},'destaccountcode':{'type':Sequelize[_0xab44('0x0')]},'destcontext':{'type':Sequelize[_0xab44('0x0')]},'destexten':{'type':Sequelize[_0xab44('0x0')]},'destpriority':{'type':Sequelize[_0xab44('0x0')]},'destuniqueid':{'type':Sequelize[_0xab44('0x0')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xab44('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xab44('0x0')],'comment':_0xab44('0x4')},'transferexten':{'type':Sequelize[_0xab44('0x0')]},'transferuniqueid':{'type':Sequelize[_0xab44('0x0')]},'agententerreason':{'type':Sequelize[_0xab44('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 5bba056..5b1435c 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index b6934c6..fadd05d 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.model.js +++ b/server/api/voiceAgentReport/voiceAgentReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c88=['define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports'];(function(_0x5216e0,_0x4f8cb9){var _0x5b3f40=function(_0x30c832){while(--_0x30c832){_0x5216e0['push'](_0x5216e0['shift']());}};_0x5b3f40(++_0x4f8cb9);}(_0x1c88,0x1a9));var _0x81c8=function(_0x529abc,_0x17b97e){_0x529abc=_0x529abc-0x0;var _0x453afa=_0x1c88[_0x529abc];return _0x453afa;};'use strict';var _=require(_0x81c8('0x0'));var util=require('util');var logger=require(_0x81c8('0x1'))(_0x81c8('0x2'));var moment=require(_0x81c8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x81c8('0x4'));var rimraf=require(_0x81c8('0x5'));var config=require(_0x81c8('0x6'));var attributes=require(_0x81c8('0x7'));module[_0x81c8('0x8')]=function(_0x3e5721,_0x3f4e27){return _0x3e5721[_0x81c8('0x9')](_0x81c8('0xa'),attributes,{'tableName':_0x81c8('0xb'),'paranoid':![],'indexes':[{'fields':[_0x81c8('0xc'),_0x81c8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5b20=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash'];(function(_0x6c0123,_0x4c8d3b){var _0x5a87d2=function(_0x1ff614){while(--_0x1ff614){_0x6c0123['push'](_0x6c0123['shift']());}};_0x5a87d2(++_0x4c8d3b);}(_0x5b20,0x86));var _0x05b2=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x5b20[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x05b2('0x0'));var util=require(_0x05b2('0x1'));var logger=require(_0x05b2('0x2'))(_0x05b2('0x3'));var moment=require(_0x05b2('0x4'));var BPromise=require(_0x05b2('0x5'));var rp=require(_0x05b2('0x6'));var fs=require('fs');var path=require(_0x05b2('0x7'));var rimraf=require(_0x05b2('0x8'));var config=require(_0x05b2('0x9'));var attributes=require(_0x05b2('0xa'));module['exports']=function(_0x22e0e2,_0x83fd18){return _0x22e0e2['define'](_0x05b2('0xb'),attributes,{'tableName':_0x05b2('0xc'),'paranoid':![],'indexes':[{'fields':[_0x05b2('0xd'),_0x05b2('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index d9a7005..e0a68a9 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.rpc.js +++ b/server/api/voiceAgentReport/voiceAgentReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb861=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw','catch','UpdateVoiceAgentReport','update','body','attributes','util','bluebird'];(function(_0x56fe8d,_0x6d9fb0){var _0x35f14b=function(_0x29bb6e){while(--_0x29bb6e){_0x56fe8d['push'](_0x56fe8d['shift']());}};_0x35f14b(++_0x6d9fb0);}(_0xb861,0x148));var _0x1b86=function(_0x24cc72,_0x4dc73a){_0x24cc72=_0x24cc72-0x0;var _0xd49f1e=_0xb861[_0x24cc72];return _0xd49f1e;};'use strict';var _=require('lodash');var util=require(_0x1b86('0x0'));var moment=require('moment');var BPromise=require(_0x1b86('0x1'));var rs=require(_0x1b86('0x2'));var fs=require('fs');var Redis=require(_0x1b86('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b86('0x4'));var logger=require(_0x1b86('0x5'))(_0x1b86('0x6'));var config=require(_0x1b86('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1b86('0x8')][_0x1b86('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b91a4,_0x32d573,_0x506ced){return new BPromise(function(_0x3fde65,_0xefe364){return client[_0x1b86('0xa')](_0x5b91a4,_0x506ced)[_0x1b86('0xb')](function(_0x15b9bd){logger[_0x1b86('0xc')](_0x1b86('0xd'),_0x32d573,_0x1b86('0xe'));logger[_0x1b86('0xf')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x32d573,_0x1b86('0xe'),JSON[_0x1b86('0x10')](_0x15b9bd));if(_0x15b9bd[_0x1b86('0x11')]){if(_0x15b9bd[_0x1b86('0x11')][_0x1b86('0x12')]===0x1f4){logger[_0x1b86('0x11')](_0x1b86('0xd'),_0x32d573,_0x15b9bd['error'][_0x1b86('0x13')]);return _0xefe364(_0x15b9bd[_0x1b86('0x11')][_0x1b86('0x13')]);}logger[_0x1b86('0x11')](_0x1b86('0xd'),_0x32d573,_0x15b9bd[_0x1b86('0x11')]['message']);return _0x3fde65(_0x15b9bd[_0x1b86('0x11')][_0x1b86('0x13')]);}else{logger[_0x1b86('0xc')](_0x1b86('0xd'),_0x32d573,'request\x20sent');_0x3fde65(_0x15b9bd['result']['message']);}})['catch'](function(_0x3ae27f){logger['error'](_0x1b86('0xd'),_0x32d573,_0x3ae27f);_0xefe364(_0x3ae27f);});});}exports[_0x1b86('0x14')]=function(_0x395d34){var _0x2a639f=this;return new Promise(function(_0x505b8d,_0x524434){return db[_0x1b86('0x15')][_0x1b86('0x16')](_0x395d34['body'],{'raw':_0x395d34[_0x1b86('0x17')]?_0x395d34['options'][_0x1b86('0x18')]===undefined?!![]:![]:!![]})[_0x1b86('0xb')](function(_0x22b04b){logger[_0x1b86('0xc')](_0x1b86('0x14'),_0x395d34);logger[_0x1b86('0xf')](_0x1b86('0x14'),_0x395d34,JSON['stringify'](_0x22b04b));_0x505b8d(_0x22b04b);})[_0x1b86('0x19')](function(_0x1d32a0){logger[_0x1b86('0x11')](_0x1b86('0x14'),_0x1d32a0[_0x1b86('0x13')],_0x395d34);_0x524434(_0x2a639f['error'](0x1f4,_0x1d32a0[_0x1b86('0x13')]));});});};exports[_0x1b86('0x1a')]=function(_0x3d5f0e){var _0x2546b5=this;return new Promise(function(_0x3d0a4d,_0x29ae50){return db[_0x1b86('0x15')][_0x1b86('0x1b')](_0x3d5f0e[_0x1b86('0x1c')],{'raw':_0x3d5f0e[_0x1b86('0x17')]?_0x3d5f0e[_0x1b86('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d5f0e[_0x1b86('0x17')]?_0x3d5f0e[_0x1b86('0x17')]['where']||null:null,'attributes':_0x3d5f0e[_0x1b86('0x17')]?_0x3d5f0e['options'][_0x1b86('0x1d')]||null:null,'limit':_0x3d5f0e['options']?_0x3d5f0e['options']['limit']||null:null})[_0x1b86('0xb')](function(_0x130228){logger[_0x1b86('0xc')](_0x1b86('0x1a'),_0x3d5f0e);logger[_0x1b86('0xf')]('UpdateVoiceAgentReport',_0x3d5f0e,JSON[_0x1b86('0x10')](_0x130228));_0x3d0a4d(_0x130228);})[_0x1b86('0x19')](function(_0x3e1e8b){logger['error'](_0x1b86('0x1a'),_0x3e1e8b[_0x1b86('0x13')],_0x3d5f0e);_0x29ae50(_0x2546b5[_0x1b86('0x11')](0x1f4,_0x3e1e8b[_0x1b86('0x13')]));});});}; \ No newline at end of file +var _0x2ffa=['attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','where'];(function(_0xf99a59,_0x115b65){var _0x1011c6=function(_0x597520){while(--_0x597520){_0xf99a59['push'](_0xf99a59['shift']());}};_0x1011c6(++_0x115b65);}(_0x2ffa,0x1ed));var _0xa2ff=function(_0x15c9e9,_0x4d49c6){_0x15c9e9=_0x15c9e9-0x0;var _0x32874d=_0x2ffa[_0x15c9e9];return _0x32874d;};'use strict';var _=require(_0xa2ff('0x0'));var util=require(_0xa2ff('0x1'));var moment=require(_0xa2ff('0x2'));var BPromise=require(_0xa2ff('0x3'));var rs=require(_0xa2ff('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa2ff('0x5'))['db'];var utils=require(_0xa2ff('0x6'));var logger=require(_0xa2ff('0x7'))('rpc');var config=require(_0xa2ff('0x8'));var jayson=require(_0xa2ff('0x9'));var client=jayson[_0xa2ff('0xa')][_0xa2ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x291521,_0x2d22b0,_0x3af9e3){return new BPromise(function(_0x311e72,_0x12f1b8){return client[_0xa2ff('0xc')](_0x291521,_0x3af9e3)[_0xa2ff('0xd')](function(_0x5d90a2){logger[_0xa2ff('0xe')](_0xa2ff('0xf'),_0x2d22b0,'request\x20sent');logger[_0xa2ff('0x10')](_0xa2ff('0x11'),_0x2d22b0,_0xa2ff('0x12'),JSON['stringify'](_0x5d90a2));if(_0x5d90a2[_0xa2ff('0x13')]){if(_0x5d90a2[_0xa2ff('0x13')][_0xa2ff('0x14')]===0x1f4){logger[_0xa2ff('0x13')](_0xa2ff('0xf'),_0x2d22b0,_0x5d90a2[_0xa2ff('0x13')]['message']);return _0x12f1b8(_0x5d90a2[_0xa2ff('0x13')][_0xa2ff('0x15')]);}logger[_0xa2ff('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x2d22b0,_0x5d90a2[_0xa2ff('0x13')]['message']);return _0x311e72(_0x5d90a2['error'][_0xa2ff('0x15')]);}else{logger['info'](_0xa2ff('0xf'),_0x2d22b0,_0xa2ff('0x12'));_0x311e72(_0x5d90a2['result'][_0xa2ff('0x15')]);}})[_0xa2ff('0x16')](function(_0x4b40f5){logger[_0xa2ff('0x13')](_0xa2ff('0xf'),_0x2d22b0,_0x4b40f5);_0x12f1b8(_0x4b40f5);});});}exports[_0xa2ff('0x17')]=function(_0x37b04b){var _0x2bfca5=this;return new Promise(function(_0xdd9912,_0x4b8c25){return db[_0xa2ff('0x18')][_0xa2ff('0x19')](_0x37b04b[_0xa2ff('0x1a')],{'raw':_0x37b04b[_0xa2ff('0x1b')]?_0x37b04b[_0xa2ff('0x1b')][_0xa2ff('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x3fa0ef){logger[_0xa2ff('0xe')](_0xa2ff('0x17'),_0x37b04b);logger[_0xa2ff('0x10')]('CreateVoiceAgentReport',_0x37b04b,JSON['stringify'](_0x3fa0ef));_0xdd9912(_0x3fa0ef);})[_0xa2ff('0x16')](function(_0x2ff6ef){logger[_0xa2ff('0x13')](_0xa2ff('0x17'),_0x2ff6ef[_0xa2ff('0x15')],_0x37b04b);_0x4b8c25(_0x2bfca5[_0xa2ff('0x13')](0x1f4,_0x2ff6ef[_0xa2ff('0x15')]));});});};exports[_0xa2ff('0x1d')]=function(_0x5e7fd3){var _0x28cf5c=this;return new Promise(function(_0x3cca75,_0x169f74){return db[_0xa2ff('0x18')][_0xa2ff('0x1e')](_0x5e7fd3[_0xa2ff('0x1a')],{'raw':_0x5e7fd3[_0xa2ff('0x1b')]?_0x5e7fd3[_0xa2ff('0x1b')][_0xa2ff('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e7fd3['options']?_0x5e7fd3['options'][_0xa2ff('0x1f')]||null:null,'attributes':_0x5e7fd3[_0xa2ff('0x1b')]?_0x5e7fd3[_0xa2ff('0x1b')][_0xa2ff('0x20')]||null:null,'limit':_0x5e7fd3['options']?_0x5e7fd3[_0xa2ff('0x1b')][_0xa2ff('0x21')]||null:null})[_0xa2ff('0xd')](function(_0x2b6cdc){logger[_0xa2ff('0xe')](_0xa2ff('0x1d'),_0x5e7fd3);logger[_0xa2ff('0x10')](_0xa2ff('0x1d'),_0x5e7fd3,JSON[_0xa2ff('0x22')](_0x2b6cdc));_0x3cca75(_0x2b6cdc);})[_0xa2ff('0x16')](function(_0x6494f9){logger[_0xa2ff('0x13')](_0xa2ff('0x1d'),_0x6494f9[_0xa2ff('0x15')],_0x5e7fd3);_0x169f74(_0x28cf5c[_0xa2ff('0x13')](0x1f4,_0x6494f9[_0xa2ff('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 2f92bfb..7de7660 100644 --- a/server/api/voiceCallReport/index.js +++ b/server/api/voiceCallReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50a6=['create','/:id','update','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','index','get','/describe','isAuthenticated','show'];(function(_0x3f53bd,_0x2de31f){var _0x52ad37=function(_0x28b2ad){while(--_0x28b2ad){_0x3f53bd['push'](_0x3f53bd['shift']());}};_0x52ad37(++_0x2de31f);}(_0x50a6,0xa4));var _0x650a=function(_0x29ae80,_0x3579f1){_0x29ae80=_0x29ae80-0x0;var _0x5d6d71=_0x50a6[_0x29ae80];return _0x5d6d71;};'use strict';var multer=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x650a('0x2'));var router=express['Router']();var fs_extra=require(_0x650a('0x3'));var auth=require(_0x650a('0x4'));var interaction=require(_0x650a('0x5'));var config=require('../../config/environment');var controller=require(_0x650a('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x650a('0x7')]);router[_0x650a('0x8')](_0x650a('0x9'),auth[_0x650a('0xa')](),controller['describe']);router[_0x650a('0x8')]('/:id',auth[_0x650a('0xa')](),controller[_0x650a('0xb')]);router['post']('/',auth[_0x650a('0xa')](),controller[_0x650a('0xc')]);router['put'](_0x650a('0xd'),auth['isAuthenticated'](),controller[_0x650a('0xe')]);router['delete'](_0x650a('0xd'),auth['isAuthenticated'](),controller[_0x650a('0xf')]);module['exports']=router; \ No newline at end of file +var _0x207c=['/:id','show','post','isAuthenticated','create','put','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/describe','describe'];(function(_0x267c52,_0x3c0df3){var _0x46c47b=function(_0x3c3740){while(--_0x3c3740){_0x267c52['push'](_0x267c52['shift']());}};_0x46c47b(++_0x3c0df3);}(_0x207c,0x1e8));var _0xc207=function(_0x5e5f5a,_0x5cb19a){_0x5e5f5a=_0x5e5f5a-0x0;var _0x4141ae=_0x207c[_0x5e5f5a];return _0x4141ae;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./voiceCallReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc207('0x8')]);router[_0xc207('0x9')](_0xc207('0xa'),auth['isAuthenticated'](),controller[_0xc207('0xb')]);router[_0xc207('0x9')](_0xc207('0xc'),auth['isAuthenticated'](),controller[_0xc207('0xd')]);router[_0xc207('0xe')]('/',auth[_0xc207('0xf')](),controller[_0xc207('0x10')]);router[_0xc207('0x11')](_0xc207('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc207('0xc'),auth['isAuthenticated'](),controller[_0xc207('0x12')]);module[_0xc207('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 57fe775..115c526 100644 --- a/server/api/voiceCallReport/voiceCallReport.attributes.js +++ b/server/api/voiceCallReport/voiceCallReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97b2=['exports','STRING','ENUM','inbound','internal','inbound-fax','outbound-fax','TEXT','DATE','INTEGER','sequelize'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x97b2,0x1b7));var _0x297b=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x97b2[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0x297b('0x0'));module[_0x297b('0x1')]={'uniqueid':{'type':Sequelize[_0x297b('0x2')]},'type':{'type':Sequelize[_0x297b('0x3')](_0x297b('0x4'),_0x297b('0x5'),'outbound',_0x297b('0x6'),_0x297b('0x7'),'dialer')},'tag':{'type':Sequelize[_0x297b('0x2')]},'accountcode':{'type':Sequelize[_0x297b('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x297b('0x2')]},'channel':{'type':Sequelize[_0x297b('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x297b('0x2')]},'lastdata':{'type':Sequelize[_0x297b('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x297b('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x297b('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x297b('0xa')]},'mohtime':{'type':Sequelize[_0x297b('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x297b('0x2')]},'amaflags':{'type':Sequelize[_0x297b('0x2')]},'userfield':{'type':Sequelize[_0x297b('0x2')]},'userDisposition':{'type':Sequelize[_0x297b('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x297b('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x297b('0x2')]},'note':{'type':Sequelize[_0x297b('0x2')]},'prefix':{'type':Sequelize[_0x297b('0x2')]},'routeid':{'type':Sequelize[_0x297b('0xa')]},'sipcallid':{'type':Sequelize[_0x297b('0x2')]}}; \ No newline at end of file +var _0x2781=['outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal'];(function(_0x1304f0,_0x8f6237){var _0x383e8c=function(_0x4f8069){while(--_0x4f8069){_0x1304f0['push'](_0x1304f0['shift']());}};_0x383e8c(++_0x8f6237);}(_0x2781,0xe4));var _0x1278=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x2781[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0x1278('0x0'));module[_0x1278('0x1')]={'uniqueid':{'type':Sequelize[_0x1278('0x2')]},'type':{'type':Sequelize[_0x1278('0x3')](_0x1278('0x4'),_0x1278('0x5'),_0x1278('0x6'),_0x1278('0x7'),_0x1278('0x8'),_0x1278('0x9'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1278('0x2')]},'source':{'type':Sequelize[_0x1278('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x1278('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1278('0x2')]},'destinationchannel':{'type':Sequelize[_0x1278('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x1278('0xa')]},'starttime':{'type':Sequelize[_0x1278('0xb')]},'systemanswertime':{'type':Sequelize[_0x1278('0xb')]},'answertime':{'type':Sequelize[_0x1278('0xb')]},'endtime':{'type':Sequelize[_0x1278('0xb')]},'duration':{'type':Sequelize[_0x1278('0xc')]},'billableseconds':{'type':Sequelize[_0x1278('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1278('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x1278('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x1278('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x1278('0x2')]},'routeid':{'type':Sequelize[_0x1278('0xc')]},'sipcallid':{'type':Sequelize[_0x1278('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 47cfb01..9bb403a 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x216428,_0x5d20ea){var _0x313dd4=function(_0x447e0d){while(--_0x447e0d){_0x216428['push'](_0x216428['shift']());}};_0x313dd4(++_0x5d20ea);}(_0xadb5,0xad));var _0x5adb=function(_0x369f27,_0xc37f2f){_0x369f27=_0x369f27-0x0;var _0x5b2ff1=_0xadb5[_0x369f27];return _0x5b2ff1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file +var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0xa3c06b,_0x490f99){var _0x33aa1d=function(_0x23a88e){while(--_0x23a88e){_0xa3c06b['push'](_0xa3c06b['shift']());}};_0x33aa1d(++_0x490f99);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5ea122,_0x3756f4){_0x5ea122=_0x5ea122-0x0;var _0x345e2c=_0x5f2f[_0x5ea122];return _0x345e2c;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 4e249d9..df1047b 100644 --- a/server/api/voiceCallReport/voiceCallReport.model.js +++ b/server/api/voiceCallReport/voiceCallReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6afc=['report_call','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5e22be,_0x57e29a){var _0x1302da=function(_0x14fe66){while(--_0x14fe66){_0x5e22be['push'](_0x5e22be['shift']());}};_0x1302da(++_0x57e29a);}(_0x6afc,0xca));var _0xc6af=function(_0x48af9d,_0x789fe){_0x48af9d=_0x48af9d-0x0;var _0x3b98cc=_0x6afc[_0x48af9d];return _0x3b98cc;};'use strict';var _=require(_0xc6af('0x0'));var util=require(_0xc6af('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc6af('0x2'));var BPromise=require(_0xc6af('0x3'));var rp=require(_0xc6af('0x4'));var fs=require('fs');var path=require(_0xc6af('0x5'));var rimraf=require(_0xc6af('0x6'));var config=require(_0xc6af('0x7'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x152c2a,_0xaeaeb1){return _0x152c2a['define']('VoiceCallReport',attributes,{'tableName':_0xc6af('0x8'),'paranoid':![],'indexes':[{'fields':[_0xc6af('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9023=['moment','bluebird','request-promise','path','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x4a5e03,_0x430c11){var _0x21307c=function(_0x3d18f9){while(--_0x3d18f9){_0x4a5e03['push'](_0x4a5e03['shift']());}};_0x21307c(++_0x430c11);}(_0x9023,0x100));var _0x3902=function(_0x249423,_0x5ab7ec){_0x249423=_0x249423-0x0;var _0x55e5f1=_0x9023[_0x249423];return _0x55e5f1;};'use strict';var _=require(_0x3902('0x0'));var util=require(_0x3902('0x1'));var logger=require(_0x3902('0x2'))(_0x3902('0x3'));var moment=require(_0x3902('0x4'));var BPromise=require(_0x3902('0x5'));var rp=require(_0x3902('0x6'));var fs=require('fs');var path=require(_0x3902('0x7'));var rimraf=require('rimraf');var config=require(_0x3902('0x8'));var attributes=require(_0x3902('0x9'));module['exports']=function(_0x15dfca,_0x20cf1d){return _0x15dfca[_0x3902('0xa')](_0x3902('0xb'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x3902('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index c5a120e..adf21e8 100644 --- a/server/api/voiceCallReport/voiceCallReport.rpc.js +++ b/server/api/voiceCallReport/voiceCallReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8096=['body','UpdateVoiceCallReport','update','raw','lodash','util','moment','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','include','map','model','CreateVoiceCallReport','create'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8096,0x13f));var _0x6809=function(_0x1d91df,_0x5796d4){_0x1d91df=_0x1d91df-0x0;var _0x3b030c=_0x8096[_0x1d91df];return _0x3b030c;};'use strict';var _=require(_0x6809('0x0'));var util=require(_0x6809('0x1'));var moment=require(_0x6809('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6809('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6809('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6809('0x5'));var client=jayson[_0x6809('0x6')][_0x6809('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x454e53,_0x4b5661,_0x10a860){return new BPromise(function(_0x5494fa,_0xece402){return client[_0x6809('0x8')](_0x454e53,_0x10a860)[_0x6809('0x9')](function(_0x3638ec){logger[_0x6809('0xa')](_0x6809('0xb'),_0x4b5661,_0x6809('0xc'));logger[_0x6809('0xd')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x4b5661,_0x6809('0xc'),JSON[_0x6809('0xe')](_0x3638ec));if(_0x3638ec[_0x6809('0xf')]){if(_0x3638ec[_0x6809('0xf')]['code']===0x1f4){logger['error'](_0x6809('0xb'),_0x4b5661,_0x3638ec[_0x6809('0xf')][_0x6809('0x10')]);return _0xece402(_0x3638ec['error'][_0x6809('0x10')]);}logger[_0x6809('0xf')](_0x6809('0xb'),_0x4b5661,_0x3638ec['error'][_0x6809('0x10')]);return _0x5494fa(_0x3638ec[_0x6809('0xf')][_0x6809('0x10')]);}else{logger['info'](_0x6809('0xb'),_0x4b5661,_0x6809('0xc'));_0x5494fa(_0x3638ec[_0x6809('0x11')][_0x6809('0x10')]);}})[_0x6809('0x12')](function(_0xa727d6){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x4b5661,_0xa727d6);_0xece402(_0xa727d6);});});}exports[_0x6809('0x13')]=function(_0xc05130){var _0x1b7e60=this;return new Promise(function(_0x519bb1,_0x15f98f){return db[_0x6809('0x14')][_0x6809('0x15')]({'raw':_0xc05130[_0x6809('0x16')]?_0xc05130['options']['raw']===undefined?!![]:![]:!![],'where':_0xc05130[_0x6809('0x16')]?_0xc05130[_0x6809('0x16')][_0x6809('0x17')]||null:null,'attributes':_0xc05130[_0x6809('0x16')]?_0xc05130['options'][_0x6809('0x18')]||null:null,'limit':_0xc05130[_0x6809('0x16')]?_0xc05130[_0x6809('0x16')][_0x6809('0x19')]||null:null,'include':_0xc05130[_0x6809('0x16')]?_0xc05130[_0x6809('0x16')][_0x6809('0x1a')]?_[_0x6809('0x1b')](_0xc05130['options'][_0x6809('0x1a')],function(_0x464996){return{'model':db[_0x464996[_0x6809('0x1c')]],'as':_0x464996['as'],'attributes':_0x464996[_0x6809('0x18')],'include':_0x464996[_0x6809('0x1a')]?_[_0x6809('0x1b')](_0x464996[_0x6809('0x1a')],function(_0x1a762b){return{'model':db[_0x1a762b[_0x6809('0x1c')]],'as':_0x1a762b['as'],'attributes':_0x1a762b[_0x6809('0x18')],'include':_0x1a762b[_0x6809('0x1a')]?_[_0x6809('0x1b')](_0x1a762b[_0x6809('0x1a')],function(_0x36e162){return{'model':db[_0x36e162['model']],'as':_0x36e162['as'],'attributes':_0x36e162[_0x6809('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x983586){logger['info'](_0x6809('0x13'),_0xc05130);logger[_0x6809('0xd')](_0x6809('0x13'),_0xc05130,JSON[_0x6809('0xe')](_0x983586));_0x519bb1(_0x983586);})[_0x6809('0x12')](function(_0x185d38){logger[_0x6809('0xf')](_0x6809('0x13'),_0x185d38['message'],_0xc05130);_0x15f98f(_0x1b7e60[_0x6809('0xf')](0x1f4,_0x185d38[_0x6809('0x10')]));});});};exports[_0x6809('0x1d')]=function(_0xb8374d){var _0x49bb38=this;return new Promise(function(_0x34db00,_0x5c3e8b){return db[_0x6809('0x14')][_0x6809('0x1e')](_0xb8374d[_0x6809('0x1f')],{'raw':_0xb8374d[_0x6809('0x16')]?_0xb8374d[_0x6809('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x6809('0x9')](function(_0xa825e8){logger[_0x6809('0xa')](_0x6809('0x1d'),_0xb8374d);logger[_0x6809('0xd')](_0x6809('0x1d'),_0xb8374d,JSON[_0x6809('0xe')](_0xa825e8));_0x34db00(_0xa825e8);})[_0x6809('0x12')](function(_0x17b496){logger[_0x6809('0xf')](_0x6809('0x1d'),_0x17b496[_0x6809('0x10')],_0xb8374d);_0x5c3e8b(_0x49bb38[_0x6809('0xf')](0x1f4,_0x17b496[_0x6809('0x10')]));});});};exports[_0x6809('0x20')]=function(_0x5ca9ef){var _0x3a37da=this;return new Promise(function(_0x1075b3,_0x28a476){return db[_0x6809('0x14')][_0x6809('0x21')](_0x5ca9ef[_0x6809('0x1f')],{'raw':_0x5ca9ef[_0x6809('0x16')]?_0x5ca9ef['options'][_0x6809('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ca9ef[_0x6809('0x16')]?_0x5ca9ef[_0x6809('0x16')][_0x6809('0x17')]||null:null,'attributes':_0x5ca9ef[_0x6809('0x16')]?_0x5ca9ef[_0x6809('0x16')][_0x6809('0x18')]||null:null,'limit':_0x5ca9ef[_0x6809('0x16')]?_0x5ca9ef[_0x6809('0x16')][_0x6809('0x19')]||null:null})[_0x6809('0x9')](function(_0x216832){logger[_0x6809('0xa')](_0x6809('0x20'),_0x5ca9ef);logger[_0x6809('0xd')](_0x6809('0x20'),_0x5ca9ef,JSON[_0x6809('0xe')](_0x216832));_0x1075b3(_0x216832);})[_0x6809('0x12')](function(_0x358043){logger['error'](_0x6809('0x20'),_0x358043[_0x6809('0x10')],_0x5ca9ef);_0x28a476(_0x3a37da[_0x6809('0xf')](0x1f4,_0x358043[_0x6809('0x10')]));});});}; \ No newline at end of file +var _0xf084=['bluebird','rpc','../../config/environment','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','VoiceCallReport','findAll','options','raw','where','attributes','limit','map','include','model','GetVoiceCallReport','debug','catch','CreateVoiceCallReport','create','body','then','stringify','UpdateVoiceCallReport','util','moment'];(function(_0x514d52,_0x16f59f){var _0x211383=function(_0x3cc14d){while(--_0x3cc14d){_0x514d52['push'](_0x514d52['shift']());}};_0x211383(++_0x16f59f);}(_0xf084,0x1a2));var _0x4f08=function(_0x3362b3,_0x172f02){_0x3362b3=_0x3362b3-0x0;var _0x2f873c=_0xf084[_0x3362b3];return _0x2f873c;};'use strict';var _=require('lodash');var util=require(_0x4f08('0x0'));var moment=require(_0x4f08('0x1'));var BPromise=require(_0x4f08('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4f08('0x3'));var config=require(_0x4f08('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x4f08('0x5')][_0x4f08('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x275499,_0xa08b6c,_0x26d758){return new BPromise(function(_0x504c08,_0x1116bc){return client[_0x4f08('0x7')](_0x275499,_0x26d758)['then'](function(_0x4b97c3){logger[_0x4f08('0x8')](_0x4f08('0x9'),_0xa08b6c,_0x4f08('0xa'));logger['debug'](_0x4f08('0xb'),_0xa08b6c,_0x4f08('0xa'),JSON['stringify'](_0x4b97c3));if(_0x4b97c3[_0x4f08('0xc')]){if(_0x4b97c3[_0x4f08('0xc')][_0x4f08('0xd')]===0x1f4){logger[_0x4f08('0xc')](_0x4f08('0x9'),_0xa08b6c,_0x4b97c3[_0x4f08('0xc')][_0x4f08('0xe')]);return _0x1116bc(_0x4b97c3[_0x4f08('0xc')][_0x4f08('0xe')]);}logger['error'](_0x4f08('0x9'),_0xa08b6c,_0x4b97c3[_0x4f08('0xc')]['message']);return _0x504c08(_0x4b97c3['error'][_0x4f08('0xe')]);}else{logger['info'](_0x4f08('0x9'),_0xa08b6c,_0x4f08('0xa'));_0x504c08(_0x4b97c3[_0x4f08('0xf')][_0x4f08('0xe')]);}})['catch'](function(_0x4a7890){logger[_0x4f08('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0xa08b6c,_0x4a7890);_0x1116bc(_0x4a7890);});});}exports['GetVoiceCallReport']=function(_0x87013a){var _0x1aa29f=this;return new Promise(function(_0x1ee649,_0x6f279){return db[_0x4f08('0x10')][_0x4f08('0x11')]({'raw':_0x87013a[_0x4f08('0x12')]?_0x87013a[_0x4f08('0x12')][_0x4f08('0x13')]===undefined?!![]:![]:!![],'where':_0x87013a[_0x4f08('0x12')]?_0x87013a['options'][_0x4f08('0x14')]||null:null,'attributes':_0x87013a[_0x4f08('0x12')]?_0x87013a[_0x4f08('0x12')][_0x4f08('0x15')]||null:null,'limit':_0x87013a[_0x4f08('0x12')]?_0x87013a[_0x4f08('0x12')][_0x4f08('0x16')]||null:null,'include':_0x87013a[_0x4f08('0x12')]?_0x87013a[_0x4f08('0x12')]['include']?_[_0x4f08('0x17')](_0x87013a[_0x4f08('0x12')][_0x4f08('0x18')],function(_0x5a5baa){return{'model':db[_0x5a5baa['model']],'as':_0x5a5baa['as'],'attributes':_0x5a5baa['attributes'],'include':_0x5a5baa[_0x4f08('0x18')]?_[_0x4f08('0x17')](_0x5a5baa[_0x4f08('0x18')],function(_0x24efd3){return{'model':db[_0x24efd3['model']],'as':_0x24efd3['as'],'attributes':_0x24efd3[_0x4f08('0x15')],'include':_0x24efd3[_0x4f08('0x18')]?_[_0x4f08('0x17')](_0x24efd3['include'],function(_0x308646){return{'model':db[_0x308646[_0x4f08('0x19')]],'as':_0x308646['as'],'attributes':_0x308646[_0x4f08('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38b31b){logger['info'](_0x4f08('0x1a'),_0x87013a);logger[_0x4f08('0x1b')](_0x4f08('0x1a'),_0x87013a,JSON['stringify'](_0x38b31b));_0x1ee649(_0x38b31b);})[_0x4f08('0x1c')](function(_0x4d57e1){logger[_0x4f08('0xc')]('GetVoiceCallReport',_0x4d57e1['message'],_0x87013a);_0x6f279(_0x1aa29f[_0x4f08('0xc')](0x1f4,_0x4d57e1[_0x4f08('0xe')]));});});};exports[_0x4f08('0x1d')]=function(_0x37aca5){var _0x5331ca=this;return new Promise(function(_0x2ecfa5,_0x468116){return db[_0x4f08('0x10')][_0x4f08('0x1e')](_0x37aca5[_0x4f08('0x1f')],{'raw':_0x37aca5[_0x4f08('0x12')]?_0x37aca5[_0x4f08('0x12')][_0x4f08('0x13')]===undefined?!![]:![]:!![]})[_0x4f08('0x20')](function(_0x444ab1){logger[_0x4f08('0x8')]('CreateVoiceCallReport',_0x37aca5);logger['debug']('CreateVoiceCallReport',_0x37aca5,JSON[_0x4f08('0x21')](_0x444ab1));_0x2ecfa5(_0x444ab1);})[_0x4f08('0x1c')](function(_0x121613){logger[_0x4f08('0xc')](_0x4f08('0x1d'),_0x121613[_0x4f08('0xe')],_0x37aca5);_0x468116(_0x5331ca[_0x4f08('0xc')](0x1f4,_0x121613['message']));});});};exports[_0x4f08('0x22')]=function(_0x50eb7d){var _0x196c42=this;return new Promise(function(_0x2517ea,_0x54873){return db['VoiceCallReport']['update'](_0x50eb7d[_0x4f08('0x1f')],{'raw':_0x50eb7d['options']?_0x50eb7d[_0x4f08('0x12')][_0x4f08('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50eb7d['options']?_0x50eb7d['options'][_0x4f08('0x14')]||null:null,'attributes':_0x50eb7d[_0x4f08('0x12')]?_0x50eb7d['options']['attributes']||null:null,'limit':_0x50eb7d[_0x4f08('0x12')]?_0x50eb7d[_0x4f08('0x12')]['limit']||null:null})['then'](function(_0x3f58a3){logger[_0x4f08('0x8')]('UpdateVoiceCallReport',_0x50eb7d);logger[_0x4f08('0x1b')](_0x4f08('0x22'),_0x50eb7d,JSON[_0x4f08('0x21')](_0x3f58a3));_0x2517ea(_0x3f58a3);})[_0x4f08('0x1c')](function(_0x4810ea){logger[_0x4f08('0xc')](_0x4f08('0x22'),_0x4810ea[_0x4f08('0xe')],_0x50eb7d);_0x54873(_0x196c42[_0x4f08('0xc')](0x1f4,_0x4810ea['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index aecd383..037dead 100644 --- a/server/api/voiceChanSpy/index.js +++ b/server/api/voiceChanSpy/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe55f=['fs-extra','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','post','create','put','delete','destroy','exports','multer','util','path','Router'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe55f,0x1b6));var _0xfe55=function(_0x9d1d1f,_0x3d6e3f){_0x9d1d1f=_0x9d1d1f-0x0;var _0x19e276=_0xe55f[_0x9d1d1f];return _0x19e276;};'use strict';var multer=require(_0xfe55('0x0'));var util=require(_0xfe55('0x1'));var path=require(_0xfe55('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfe55('0x3')]();var fs_extra=require(_0xfe55('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfe55('0x5'));var controller=require(_0xfe55('0x6'));router[_0xfe55('0x7')]('/',auth[_0xfe55('0x8')](),controller[_0xfe55('0x9')]);router[_0xfe55('0x7')](_0xfe55('0xa'),auth[_0xfe55('0x8')](),controller['show']);router[_0xfe55('0xb')]('/',auth['isAuthenticated'](),controller[_0xfe55('0xc')]);router[_0xfe55('0xd')](_0xfe55('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xfe55('0xe')](_0xfe55('0xa'),auth[_0xfe55('0x8')](),controller[_0xfe55('0xf')]);module[_0xfe55('0x10')]=router; \ No newline at end of file +var _0xf2ff=['post','create','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3bcb39,_0x2e1bd0){var _0x158bc4=function(_0x5570d3){while(--_0x5570d3){_0x3bcb39['push'](_0x3bcb39['shift']());}};_0x158bc4(++_0x2e1bd0);}(_0xf2ff,0x1ec));var _0xff2f=function(_0x3ac16a,_0x52def3){_0x3ac16a=_0x3ac16a-0x0;var _0x457623=_0xf2ff[_0x3ac16a];return _0x457623;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xff2f('0x0'));var timeout=require('connect-timeout');var express=require(_0xff2f('0x1'));var router=express[_0xff2f('0x2')]();var fs_extra=require(_0xff2f('0x3'));var auth=require(_0xff2f('0x4'));var interaction=require(_0xff2f('0x5'));var config=require('../../config/environment');var controller=require(_0xff2f('0x6'));router[_0xff2f('0x7')]('/',auth[_0xff2f('0x8')](),controller[_0xff2f('0x9')]);router[_0xff2f('0x7')](_0xff2f('0xa'),auth['isAuthenticated'](),controller[_0xff2f('0xb')]);router[_0xff2f('0xc')]('/',auth[_0xff2f('0x8')](),controller[_0xff2f('0xd')]);router['put'](_0xff2f('0xa'),auth[_0xff2f('0x8')](),controller[_0xff2f('0xe')]);router[_0xff2f('0xf')](_0xff2f('0xa'),auth[_0xff2f('0x8')](),controller[_0xff2f('0x10')]);module[_0xff2f('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 5b307d4..b7ee7e6 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.attributes.js +++ b/server/api/voiceChanSpy/voiceChanSpy.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce6b=['setDataValue','options','join','split','BOOLEAN','STRING','name'];(function(_0x27be87,_0x1bda32){var _0x2ffba7=function(_0x1fce0f){while(--_0x1fce0f){_0x27be87['push'](_0x27be87['shift']());}};_0x2ffba7(++_0x1bda32);}(_0xce6b,0xe5));var _0xbce6=function(_0x4b823a,_0x439c65){_0x4b823a=_0x4b823a-0x0;var _0x10757e=_0xce6b[_0x4b823a];return _0x10757e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbce6('0x0')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xbce6('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0xbce6('0x0')],'set':function(_0x5a62ba){this[_0xbce6('0x2')](_0xbce6('0x3'),_0x5a62ba?_0x5a62ba[_0xbce6('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0xbce6('0x3'))?this['getDataValue']('options')[_0xbce6('0x5')](''):[];}},'auth':{'type':Sequelize[_0xbce6('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0xbce6('0x0')]},'record':{'type':Sequelize[_0xbce6('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xbce6('0x0')]},'description':{'type':Sequelize[_0xbce6('0x0')]}}; \ No newline at end of file +var _0x44c3=['getDataValue','split','BOOLEAN','exports','STRING','name','options','join'];(function(_0x2edef0,_0x1e0a79){var _0x52027d=function(_0x5b1b60){while(--_0x5b1b60){_0x2edef0['push'](_0x2edef0['shift']());}};_0x52027d(++_0x1e0a79);}(_0x44c3,0x7b));var _0x344c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x44c3[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x344c('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x344c('0x1')],'unique':_0x344c('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x344c('0x1')],'set':function(_0x17658f){this['setDataValue'](_0x344c('0x3'),_0x17658f?_0x17658f[_0x344c('0x4')](''):[]);},'get':function(){return this[_0x344c('0x5')](_0x344c('0x3'))?this[_0x344c('0x5')](_0x344c('0x3'))[_0x344c('0x6')](''):[];}},'auth':{'type':Sequelize[_0x344c('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x344c('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x344c('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 7bc0b8e..e0f54d9 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.controller.js +++ b/server/api/voiceChanSpy/voiceChanSpy.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2cc=['merge','VIRTUAL','includeAll','include','VoiceChanSpy','findAll','rows','show','params','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','ChanSpies','UserProfileResource','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter'];(function(_0x4b73d9,_0x1228ee){var _0x1df8b4=function(_0x58b778){while(--_0x58b778){_0x4b73d9['push'](_0x4b73d9['shift']());}};_0x1df8b4(++_0x1228ee);}(_0xe2cc,0x69));var _0xce2c=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xe2cc[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require(_0xce2c('0x0'));var rimraf=require(_0xce2c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xce2c('0x2'));var moment=require(_0xce2c('0x3'));var BPromise=require(_0xce2c('0x4'));var Mustache=require(_0xce2c('0x5'));var util=require(_0xce2c('0x6'));var path=require(_0xce2c('0x7'));var sox=require(_0xce2c('0x8'));var csv=require(_0xce2c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce2c('0xa'));var squel=require(_0xce2c('0xb'));var crypto=require(_0xce2c('0xc'));var jsforce=require(_0xce2c('0xd'));var deskjs=require(_0xce2c('0xe'));var toCsv=require(_0xce2c('0x9'));var querystring=require('querystring');var Papa=require(_0xce2c('0xf'));var Redis=require(_0xce2c('0x10'));var authService=require(_0xce2c('0x11'));var qs=require(_0xce2c('0x12'));var as=require(_0xce2c('0x13'));var hardwareService=require(_0xce2c('0x14'));var logger=require(_0xce2c('0x15'))(_0xce2c('0x16'));var utils=require(_0xce2c('0x17'));var config=require(_0xce2c('0x18'));var licenseUtil=require(_0xce2c('0x19'));var db=require(_0xce2c('0x1a'))['db'];function respondWithStatusCode(_0x2f3b17,_0x27928d){_0x27928d=_0x27928d||0xcc;return function(_0x2421f6){if(_0x2421f6){return _0x2f3b17['sendStatus'](_0x27928d);}return _0x2f3b17['status'](_0x27928d)[_0xce2c('0x1b')]();};}function respondWithResult(_0x57c898,_0x214c62){_0x214c62=_0x214c62||0xc8;return function(_0x179855){if(_0x179855){return _0x57c898[_0xce2c('0x1c')](_0x214c62)[_0xce2c('0x1d')](_0x179855);}};}function respondWithFilteredResult(_0x4873e6,_0xb99213){return function(_0x1c3046){if(_0x1c3046){var _0x146830=typeof _0xb99213[_0xce2c('0x1e')]===_0xce2c('0x1f')&&typeof _0xb99213[_0xce2c('0x20')]===_0xce2c('0x1f');var _0x561b9e=_0x1c3046[_0xce2c('0x21')];var _0x35bc08=_0x146830?0x0:_0xb99213[_0xce2c('0x1e')];var _0x151422=_0x146830?_0x1c3046[_0xce2c('0x21')]:_0xb99213['offset']+_0xb99213[_0xce2c('0x20')];var _0xcc8a80;if(_0x151422>=_0x561b9e){_0x151422=_0x561b9e;_0xcc8a80=0xc8;}else{_0xcc8a80=0xce;}_0x4873e6['status'](_0xcc8a80);return _0x4873e6['set'](_0xce2c('0x22'),_0x35bc08+'-'+_0x151422+'/'+_0x561b9e)[_0xce2c('0x1d')](_0x1c3046);}return null;};}function patchUpdates(_0x43ee21){return function(_0x2f409c){try{jsonpatch[_0xce2c('0x23')](_0x2f409c,_0x43ee21,!![]);}catch(_0x228bf3){return BPromise[_0xce2c('0x24')](_0x228bf3);}return _0x2f409c['save']();};}function saveUpdates(_0x30380e,_0xb8057b){return function(_0x399f67){if(_0x399f67){return _0x399f67[_0xce2c('0x25')](_0x30380e)[_0xce2c('0x26')](function(_0x1c8bb6){return _0x1c8bb6;});}return null;};}function removeEntity(_0x1e263d,_0x39880d){return function(_0x451e86){if(_0x451e86){return _0x451e86[_0xce2c('0x27')]()['then'](function(){var _0x452cfa=_0x451e86[_0xce2c('0x28')]({'plain':!![]});var _0x333471=_0xce2c('0x29');return db[_0xce2c('0x2a')][_0xce2c('0x27')]({'where':{'type':_0x333471,'resourceId':_0x452cfa['id']}})['then'](function(){return _0x451e86;});})[_0xce2c('0x26')](function(){_0x1e263d['status'](0xcc)[_0xce2c('0x1b')]();});}};}function handleEntityNotFound(_0x1aea2c,_0xbb1756){return function(_0x2b6ce6){if(!_0x2b6ce6){_0x1aea2c[_0xce2c('0x2b')](0x194);}return _0x2b6ce6;};}function handleError(_0x19846d,_0x253ca2){_0x253ca2=_0x253ca2||0x1f4;return function(_0x32caae){logger[_0xce2c('0x2c')](_0x32caae[_0xce2c('0x2d')]);if(_0x32caae[_0xce2c('0x2e')]){delete _0x32caae[_0xce2c('0x2e')];}_0x19846d[_0xce2c('0x1c')](_0x253ca2)['send'](_0x32caae);};}exports[_0xce2c('0x2f')]=function(_0xc2cff6,_0x472a5f){var _0x371a3b={},_0x1a057b={},_0x59b8cd={'count':0x0,'rows':[]};var _0x1d0bfd=_[_0xce2c('0x30')](db['VoiceChanSpy'][_0xce2c('0x31')],function(_0x1a2ae7){return{'name':_0x1a2ae7[_0xce2c('0x32')],'type':_0x1a2ae7[_0xce2c('0x33')][_0xce2c('0x34')]};});_0x1a057b['model']=_[_0xce2c('0x30')](_0x1d0bfd,'name');_0x1a057b[_0xce2c('0x35')]=_[_0xce2c('0x36')](_0xc2cff6['query']);_0x1a057b[_0xce2c('0x37')]=_[_0xce2c('0x38')](_0x1a057b[_0xce2c('0x39')],_0x1a057b[_0xce2c('0x35')]);_0x371a3b['attributes']=_[_0xce2c('0x38')](_0x1a057b[_0xce2c('0x39')],qs['fields'](_0xc2cff6[_0xce2c('0x35')][_0xce2c('0x3a')]));_0x371a3b[_0xce2c('0x3b')]=_0x371a3b[_0xce2c('0x3b')][_0xce2c('0x3c')]?_0x371a3b[_0xce2c('0x3b')]:_0x1a057b[_0xce2c('0x39')];if(!_0xc2cff6[_0xce2c('0x35')]['hasOwnProperty'](_0xce2c('0x3d'))){_0x371a3b[_0xce2c('0x20')]=qs['limit'](_0xc2cff6[_0xce2c('0x35')][_0xce2c('0x20')]);_0x371a3b[_0xce2c('0x1e')]=qs[_0xce2c('0x1e')](_0xc2cff6[_0xce2c('0x35')][_0xce2c('0x1e')]);}_0x371a3b[_0xce2c('0x3e')]=qs[_0xce2c('0x3f')](_0xc2cff6[_0xce2c('0x35')][_0xce2c('0x3f')]);_0x371a3b[_0xce2c('0x40')]=qs['filters'](_[_0xce2c('0x41')](_0xc2cff6[_0xce2c('0x35')],_0x1a057b[_0xce2c('0x37')]),_0x1d0bfd);if(_0xc2cff6[_0xce2c('0x35')][_0xce2c('0x42')]){_0x371a3b[_0xce2c('0x40')]=_[_0xce2c('0x43')](_0x371a3b[_0xce2c('0x40')],{'$or':_[_0xce2c('0x30')](_0x1d0bfd,function(_0x2a4775){if(_0x2a4775[_0xce2c('0x33')]!==_0xce2c('0x44')){var _0x45ab99={};_0x45ab99[_0x2a4775[_0xce2c('0x2e')]]={'$like':'%'+_0xc2cff6['query']['filter']+'%'};return _0x45ab99;}})});}_0x371a3b=_['merge']({},_0x371a3b,_0xc2cff6['options']);var _0x35f35f={'where':_0x371a3b[_0xce2c('0x40')]};return db['VoiceChanSpy']['count'](_0x35f35f)[_0xce2c('0x26')](function(_0x29a022){_0x59b8cd[_0xce2c('0x21')]=_0x29a022;if(_0xc2cff6[_0xce2c('0x35')][_0xce2c('0x45')]){_0x371a3b[_0xce2c('0x46')]=[{'all':!![]}];}return db[_0xce2c('0x47')][_0xce2c('0x48')](_0x371a3b);})['then'](function(_0x8bbc9a){_0x59b8cd[_0xce2c('0x49')]=_0x8bbc9a;return _0x59b8cd;})[_0xce2c('0x26')](respondWithFilteredResult(_0x472a5f,_0x371a3b))['catch'](handleError(_0x472a5f,null));};exports[_0xce2c('0x4a')]=function(_0x3b7223,_0x4cd90b){var _0x5e1127={'raw':![],'where':{'id':_0x3b7223[_0xce2c('0x4b')]['id']}},_0x22060b={};_0x22060b['model']=_['keys'](db['VoiceChanSpy'][_0xce2c('0x31')]);_0x22060b[_0xce2c('0x35')]=_['keys'](_0x3b7223[_0xce2c('0x35')]);_0x22060b[_0xce2c('0x37')]=_['intersection'](_0x22060b['model'],_0x22060b['query']);_0x5e1127[_0xce2c('0x3b')]=_['intersection'](_0x22060b[_0xce2c('0x39')],qs[_0xce2c('0x3a')](_0x3b7223['query'][_0xce2c('0x3a')]));_0x5e1127[_0xce2c('0x3b')]=_0x5e1127[_0xce2c('0x3b')][_0xce2c('0x3c')]?_0x5e1127['attributes']:_0x22060b[_0xce2c('0x39')];if(_0x3b7223[_0xce2c('0x35')][_0xce2c('0x45')]){_0x5e1127['include']=[{'all':!![]}];}_0x5e1127=_[_0xce2c('0x43')]({},_0x5e1127,_0x3b7223[_0xce2c('0x4c')]);return db['VoiceChanSpy'][_0xce2c('0x4d')](_0x5e1127)['then'](handleEntityNotFound(_0x4cd90b,null))[_0xce2c('0x26')](respondWithResult(_0x4cd90b,null))[_0xce2c('0x4e')](handleError(_0x4cd90b,null));};exports[_0xce2c('0x4f')]=function(_0x23fb2b,_0xff694f){return db[_0xce2c('0x47')]['create'](_0x23fb2b[_0xce2c('0x50')],{})[_0xce2c('0x26')](function(_0x4025af){var _0x2644c2=_0x23fb2b[_0xce2c('0x51')][_0xce2c('0x28')]({'plain':!![]});if(!_0x2644c2)throw new Error(_0xce2c('0x52'));if(_0x2644c2[_0xce2c('0x53')]===_0xce2c('0x51')){var _0x7b381f=_0x4025af[_0xce2c('0x28')]({'plain':!![]});var _0x29406c=_0xce2c('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x29406c,'userProfileId':_0x2644c2['userProfileId']},'raw':!![]})[_0xce2c('0x26')](function(_0x2d50c1){if(_0x2d50c1&&_0x2d50c1[_0xce2c('0x54')]===0x0){return db[_0xce2c('0x2a')][_0xce2c('0x4f')]({'name':_0x7b381f[_0xce2c('0x2e')],'resourceId':_0x7b381f['id'],'type':_0x2d50c1[_0xce2c('0x2e')],'sectionId':_0x2d50c1['id']},{})[_0xce2c('0x26')](function(){return _0x4025af;});}else{return _0x4025af;}})['catch'](function(_0xb420b0){logger['error'](_0xce2c('0x55'),_0xb420b0);throw _0xb420b0;});}return _0x4025af;})[_0xce2c('0x26')](respondWithResult(_0xff694f,0xc9))[_0xce2c('0x4e')](handleError(_0xff694f,null));};exports[_0xce2c('0x25')]=function(_0x52a479,_0x107429){if(_0x52a479[_0xce2c('0x50')]['id']){delete _0x52a479['body']['id'];}return db[_0xce2c('0x47')][_0xce2c('0x4d')]({'where':{'id':_0x52a479['params']['id']}})[_0xce2c('0x26')](handleEntityNotFound(_0x107429,null))[_0xce2c('0x26')](saveUpdates(_0x52a479[_0xce2c('0x50')],null))[_0xce2c('0x26')](respondWithResult(_0x107429,null))[_0xce2c('0x4e')](handleError(_0x107429,null));};exports[_0xce2c('0x27')]=function(_0xa33a8d,_0x47741a){return db[_0xce2c('0x47')]['find']({'where':{'id':_0xa33a8d[_0xce2c('0x4b')]['id']}})[_0xce2c('0x26')](handleEntityNotFound(_0x47741a,null))[_0xce2c('0x26')](removeEntity(_0x47741a,null))[_0xce2c('0x4e')](handleError(_0x47741a,null));}; \ No newline at end of file +var _0x2333=['keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','get','ChanSpies','then','error','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','type','model','map'];(function(_0xd17620,_0x2a3659){var _0x3a012f=function(_0x25a1e1){while(--_0x25a1e1){_0xd17620['push'](_0xd17620['shift']());}};_0x3a012f(++_0x2a3659);}(_0x2333,0x11a));var _0x3233=function(_0x1f4351,_0x870c9c){_0x1f4351=_0x1f4351-0x0;var _0x53c319=_0x2333[_0x1f4351];return _0x53c319;};'use strict';var emlformat=require(_0x3233('0x0'));var rimraf=require(_0x3233('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3233('0x2'));var moment=require(_0x3233('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3233('0x4'));var util=require(_0x3233('0x5'));var path=require(_0x3233('0x6'));var sox=require(_0x3233('0x7'));var csv=require(_0x3233('0x8'));var ejs=require(_0x3233('0x9'));var fs=require('fs');var fs_extra=require(_0x3233('0xa'));var _=require(_0x3233('0xb'));var squel=require(_0x3233('0xc'));var crypto=require(_0x3233('0xd'));var jsforce=require(_0x3233('0xe'));var deskjs=require(_0x3233('0xf'));var toCsv=require(_0x3233('0x8'));var querystring=require(_0x3233('0x10'));var Papa=require(_0x3233('0x11'));var Redis=require(_0x3233('0x12'));var authService=require(_0x3233('0x13'));var qs=require(_0x3233('0x14'));var as=require(_0x3233('0x15'));var hardwareService=require(_0x3233('0x16'));var logger=require(_0x3233('0x17'))('api');var utils=require(_0x3233('0x18'));var config=require(_0x3233('0x19'));var licenseUtil=require(_0x3233('0x1a'));var db=require(_0x3233('0x1b'))['db'];function respondWithStatusCode(_0xd59689,_0x18166d){_0x18166d=_0x18166d||0xcc;return function(_0x44ef5f){if(_0x44ef5f){return _0xd59689[_0x3233('0x1c')](_0x18166d);}return _0xd59689[_0x3233('0x1d')](_0x18166d)[_0x3233('0x1e')]();};}function respondWithResult(_0x428b44,_0x27e9fd){_0x27e9fd=_0x27e9fd||0xc8;return function(_0x7f5e07){if(_0x7f5e07){return _0x428b44['status'](_0x27e9fd)['json'](_0x7f5e07);}};}function respondWithFilteredResult(_0xc71f65,_0x26a41e){return function(_0x45fc24){if(_0x45fc24){var _0x5885a5=typeof _0x26a41e[_0x3233('0x1f')]===_0x3233('0x20')&&typeof _0x26a41e[_0x3233('0x21')]==='undefined';var _0x33f2e5=_0x45fc24[_0x3233('0x22')];var _0x55fa30=_0x5885a5?0x0:_0x26a41e[_0x3233('0x1f')];var _0x58420c=_0x5885a5?_0x45fc24[_0x3233('0x22')]:_0x26a41e['offset']+_0x26a41e['limit'];var _0x5a6f13;if(_0x58420c>=_0x33f2e5){_0x58420c=_0x33f2e5;_0x5a6f13=0xc8;}else{_0x5a6f13=0xce;}_0xc71f65[_0x3233('0x1d')](_0x5a6f13);return _0xc71f65['set'](_0x3233('0x23'),_0x55fa30+'-'+_0x58420c+'/'+_0x33f2e5)['json'](_0x45fc24);}return null;};}function patchUpdates(_0x305227){return function(_0x161855){try{jsonpatch[_0x3233('0x24')](_0x161855,_0x305227,!![]);}catch(_0x42d311){return BPromise['reject'](_0x42d311);}return _0x161855[_0x3233('0x25')]();};}function saveUpdates(_0x2a9dd9,_0x56fa5a){return function(_0x531cd8){if(_0x531cd8){return _0x531cd8[_0x3233('0x26')](_0x2a9dd9)['then'](function(_0x199c37){return _0x199c37;});}return null;};}function removeEntity(_0xa73f3e,_0x43227e){return function(_0x4c3875){if(_0x4c3875){return _0x4c3875[_0x3233('0x27')]()['then'](function(){var _0x33916b=_0x4c3875[_0x3233('0x28')]({'plain':!![]});var _0x56f216=_0x3233('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x56f216,'resourceId':_0x33916b['id']}})[_0x3233('0x2a')](function(){return _0x4c3875;});})[_0x3233('0x2a')](function(){_0xa73f3e['status'](0xcc)[_0x3233('0x1e')]();});}};}function handleEntityNotFound(_0x29fe7a,_0x27cec8){return function(_0x4251e9){if(!_0x4251e9){_0x29fe7a[_0x3233('0x1c')](0x194);}return _0x4251e9;};}function handleError(_0x5549d5,_0x43ae4b){_0x43ae4b=_0x43ae4b||0x1f4;return function(_0xd4171b){logger[_0x3233('0x2b')](_0xd4171b[_0x3233('0x2c')]);if(_0xd4171b[_0x3233('0x2d')]){delete _0xd4171b[_0x3233('0x2d')];}_0x5549d5[_0x3233('0x1d')](_0x43ae4b)[_0x3233('0x2e')](_0xd4171b);};}exports[_0x3233('0x2f')]=function(_0x5a35b5,_0x392e56){var _0xbcf692={},_0x559515={},_0x2c55f7={'count':0x0,'rows':[]};var _0x199098=_['map'](db[_0x3233('0x30')][_0x3233('0x31')],function(_0x54947b){return{'name':_0x54947b[_0x3233('0x32')],'type':_0x54947b[_0x3233('0x33')]['key']};});_0x559515[_0x3233('0x34')]=_[_0x3233('0x35')](_0x199098,'name');_0x559515['query']=_[_0x3233('0x36')](_0x5a35b5['query']);_0x559515[_0x3233('0x37')]=_[_0x3233('0x38')](_0x559515['model'],_0x559515[_0x3233('0x39')]);_0xbcf692[_0x3233('0x3a')]=_[_0x3233('0x38')](_0x559515[_0x3233('0x34')],qs[_0x3233('0x3b')](_0x5a35b5[_0x3233('0x39')]['fields']));_0xbcf692['attributes']=_0xbcf692[_0x3233('0x3a')][_0x3233('0x3c')]?_0xbcf692['attributes']:_0x559515[_0x3233('0x34')];if(!_0x5a35b5['query'][_0x3233('0x3d')](_0x3233('0x3e'))){_0xbcf692[_0x3233('0x21')]=qs['limit'](_0x5a35b5[_0x3233('0x39')][_0x3233('0x21')]);_0xbcf692[_0x3233('0x1f')]=qs['offset'](_0x5a35b5[_0x3233('0x39')][_0x3233('0x1f')]);}_0xbcf692[_0x3233('0x3f')]=qs[_0x3233('0x40')](_0x5a35b5[_0x3233('0x39')][_0x3233('0x40')]);_0xbcf692[_0x3233('0x41')]=qs[_0x3233('0x37')](_['pick'](_0x5a35b5[_0x3233('0x39')],_0x559515[_0x3233('0x37')]),_0x199098);if(_0x5a35b5['query'][_0x3233('0x42')]){_0xbcf692['where']=_[_0x3233('0x43')](_0xbcf692['where'],{'$or':_[_0x3233('0x35')](_0x199098,function(_0x18aba8){if(_0x18aba8[_0x3233('0x33')]!==_0x3233('0x44')){var _0x452e87={};_0x452e87[_0x18aba8['name']]={'$like':'%'+_0x5a35b5['query'][_0x3233('0x42')]+'%'};return _0x452e87;}})});}_0xbcf692=_['merge']({},_0xbcf692,_0x5a35b5[_0x3233('0x45')]);var _0x264320={'where':_0xbcf692[_0x3233('0x41')]};return db[_0x3233('0x30')][_0x3233('0x22')](_0x264320)[_0x3233('0x2a')](function(_0x49e8c8){_0x2c55f7[_0x3233('0x22')]=_0x49e8c8;if(_0x5a35b5[_0x3233('0x39')][_0x3233('0x46')]){_0xbcf692['include']=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0xbcf692);})[_0x3233('0x2a')](function(_0x7ed58b){_0x2c55f7[_0x3233('0x47')]=_0x7ed58b;return _0x2c55f7;})[_0x3233('0x2a')](respondWithFilteredResult(_0x392e56,_0xbcf692))['catch'](handleError(_0x392e56,null));};exports[_0x3233('0x48')]=function(_0x5250a1,_0xac255e){var _0x1fea90={'raw':![],'where':{'id':_0x5250a1[_0x3233('0x49')]['id']}},_0x4b5e4b={};_0x4b5e4b[_0x3233('0x34')]=_[_0x3233('0x36')](db[_0x3233('0x30')][_0x3233('0x31')]);_0x4b5e4b[_0x3233('0x39')]=_[_0x3233('0x36')](_0x5250a1[_0x3233('0x39')]);_0x4b5e4b[_0x3233('0x37')]=_['intersection'](_0x4b5e4b[_0x3233('0x34')],_0x4b5e4b[_0x3233('0x39')]);_0x1fea90[_0x3233('0x3a')]=_[_0x3233('0x38')](_0x4b5e4b[_0x3233('0x34')],qs[_0x3233('0x3b')](_0x5250a1[_0x3233('0x39')][_0x3233('0x3b')]));_0x1fea90[_0x3233('0x3a')]=_0x1fea90['attributes'][_0x3233('0x3c')]?_0x1fea90[_0x3233('0x3a')]:_0x4b5e4b[_0x3233('0x34')];if(_0x5250a1['query']['includeAll']){_0x1fea90[_0x3233('0x4a')]=[{'all':!![]}];}_0x1fea90=_[_0x3233('0x43')]({},_0x1fea90,_0x5250a1[_0x3233('0x45')]);return db[_0x3233('0x30')][_0x3233('0x4b')](_0x1fea90)[_0x3233('0x2a')](handleEntityNotFound(_0xac255e,null))[_0x3233('0x2a')](respondWithResult(_0xac255e,null))[_0x3233('0x4c')](handleError(_0xac255e,null));};exports[_0x3233('0x4d')]=function(_0x59deb1,_0x4aa692){return db[_0x3233('0x30')]['create'](_0x59deb1[_0x3233('0x4e')],{})[_0x3233('0x2a')](function(_0x35b744){var _0x59437f=_0x59deb1[_0x3233('0x4f')][_0x3233('0x28')]({'plain':!![]});if(!_0x59437f)throw new Error(_0x3233('0x50'));if(_0x59437f[_0x3233('0x51')]==='user'){var _0x42f333=_0x35b744[_0x3233('0x28')]({'plain':!![]});var _0x259de9=_0x3233('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x259de9,'userProfileId':_0x59437f[_0x3233('0x52')]},'raw':!![]})[_0x3233('0x2a')](function(_0x99b0e5){if(_0x99b0e5&&_0x99b0e5[_0x3233('0x53')]===0x0){return db['UserProfileResource'][_0x3233('0x4d')]({'name':_0x42f333['name'],'resourceId':_0x42f333['id'],'type':_0x99b0e5[_0x3233('0x2d')],'sectionId':_0x99b0e5['id']},{})[_0x3233('0x2a')](function(){return _0x35b744;});}else{return _0x35b744;}})[_0x3233('0x4c')](function(_0xdb6806){logger[_0x3233('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xdb6806);throw _0xdb6806;});}return _0x35b744;})[_0x3233('0x2a')](respondWithResult(_0x4aa692,0xc9))[_0x3233('0x4c')](handleError(_0x4aa692,null));};exports['update']=function(_0x13c2b4,_0xd061d7){if(_0x13c2b4[_0x3233('0x4e')]['id']){delete _0x13c2b4['body']['id'];}return db['VoiceChanSpy'][_0x3233('0x4b')]({'where':{'id':_0x13c2b4['params']['id']}})[_0x3233('0x2a')](handleEntityNotFound(_0xd061d7,null))['then'](saveUpdates(_0x13c2b4['body'],null))[_0x3233('0x2a')](respondWithResult(_0xd061d7,null))['catch'](handleError(_0xd061d7,null));};exports['destroy']=function(_0x4b1fa4,_0x22eeef){return db[_0x3233('0x30')][_0x3233('0x4b')]({'where':{'id':_0x4b1fa4[_0x3233('0x49')]['id']}})[_0x3233('0x2a')](handleEntityNotFound(_0x22eeef,null))['then'](removeEntity(_0x22eeef,null))[_0x3233('0x4c')](handleError(_0x22eeef,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 14226a0..5928c05 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.model.js +++ b/server/api/voiceChanSpy/voiceChanSpy.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8075=['models','VoiceChanSpy','voice_chanspy','then','length','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','format','%s%s','system','push','Set','CDR(type)=%s','merge','MixMonitor','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','record','StopMixMonitor','concat','internal','User','catch','exports'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0x8075,0x17e));var _0x5807=function(_0x59b019,_0x17f2c3){_0x59b019=_0x59b019-0x0;var _0x50aed3=_0x8075[_0x59b019];return _0x50aed3;};'use strict';var _=require(_0x5807('0x0'));var util=require(_0x5807('0x1'));var BPromise=require(_0x5807('0x2'));var attributes=require(_0x5807('0x3'));var getUserApplications=function(_0x1d5b5b,_0x11ce8b,_0x5e350c){var _0x5e90a6=0x1;var _0x46cd8c=[];var _0x6d3e9f={'context':_0x11ce8b['context']||'from-sip','exten':util[_0x5807('0x4')](_0x5807('0x5'),_0x1d5b5b['prefix'],_0x5e350c),'type':_0x5807('0x6'),'isApp':![],'ChanSpyId':_0x1d5b5b['id'],'UserId':_0x11ce8b['id']};_0x46cd8c[_0x5807('0x7')](_['merge']({'app':_0x5807('0x8'),'appdata':util[_0x5807('0x4')](_0x5807('0x9'),'chanspy'),'priority':_0x5e90a6++},_0x6d3e9f));if(_0x1d5b5b['record']){_0x46cd8c['push'](_[_0x5807('0xa')]({'app':_0x5807('0xb'),'appdata':util[_0x5807('0x4')]('${UNIQUEID}.%s,a',_0x1d5b5b[_0x5807('0xc')]),'priority':_0x5e90a6++},_0x6d3e9f));}if(_0x1d5b5b[_0x5807('0xd')]){_0x46cd8c[_0x5807('0x7')](_[_0x5807('0xa')]({'app':_0x5807('0xe'),'appdata':_0x1d5b5b['password'],'priority':_0x5e90a6++},_0x6d3e9f));}_0x46cd8c['push'](_[_0x5807('0xa')]({'app':_0x5807('0xf'),'appdata':util[_0x5807('0x4')](_0x5807('0x10'),_0x11ce8b[_0x5807('0x11')],_0x1d5b5b[_0x5807('0x12')]?_0x1d5b5b[_0x5807('0x12')]['join'](''):''),'priority':_0x5e90a6++},_0x6d3e9f));if(_0x1d5b5b[_0x5807('0x13')]){_0x46cd8c[_0x5807('0x7')](_[_0x5807('0xa')]({'app':_0x5807('0x14'),'priority':_0x5e90a6++},_0x6d3e9f));}return _0x46cd8c;};var getChanSpyApplications=function(_0x3c74d0,_0x58f27d){var _0x1e8433=[];for(var _0x5c9efb=0x0,_0x57b914=0x1;_0x5c9efb<_0x58f27d['length'];_0x5c9efb++,_0x57b914=0x1){_0x1e8433=_0x1e8433[_0x5807('0x15')](getUserApplications(_0x3c74d0,_0x58f27d[_0x5c9efb],_0x58f27d[_0x5c9efb]['internal']));if(_0x58f27d[_0x5c9efb][_0x5807('0x16')]!=_0x58f27d[_0x5c9efb][_0x5807('0x11')]){_0x1e8433=_0x1e8433[_0x5807('0x15')](getUserApplications(_0x3c74d0,_0x58f27d[_0x5c9efb],_0x58f27d[_0x5c9efb][_0x5807('0x11')]));}}return _0x1e8433;};var getChanSpyPromise=function(_0x7613a0,_0x237505){return new BPromise(function(_0x241c0b,_0x317d49){return _0x7613a0[_0x5807('0x17')]['findAll']({'attributes':['id','name','internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x3b0dbe){if(_0x3b0dbe){return _0x241c0b(getChanSpyApplications(_0x237505,_0x3b0dbe));}return _0x241c0b([]);})[_0x5807('0x18')](function(_0x54c49c){_0x317d49(_0x54c49c);});});};module[_0x5807('0x19')]=function(_0x354064,_0x2d4317){var _0x145575=_0x354064[_0x5807('0x1a')];return _0x354064['define'](_0x5807('0x1b'),attributes,{'tableName':_0x5807('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x146fd4,_0x2d7473,_0x571960){return getChanSpyPromise(_0x145575,_0x146fd4)[_0x5807('0x1d')](function(_0x10f3fd){if(_0x10f3fd&&_0x10f3fd[_0x5807('0x1e')]){return _0x145575[_0x5807('0x1f')][_0x5807('0x20')](_0x10f3fd);}})[_0x5807('0x1d')](function(){_0x571960();})[_0x5807('0x18')](function(_0x83e1da){_0x571960(_0x83e1da);});},'afterUpdate':function(_0x53bbb5,_0x21a857,_0x596afc){return _0x145575[_0x5807('0x1f')]['destroy']({'where':{'ChanSpyId':_0x53bbb5['id']}})[_0x5807('0x1d')](function(){return getChanSpyPromise(_0x145575,_0x53bbb5);})['then'](function(_0x316e6c){if(_0x316e6c&&_0x316e6c[_0x5807('0x1e')]){return _0x145575['VoiceExtension'][_0x5807('0x20')](_0x316e6c);}})[_0x5807('0x1d')](function(){_0x596afc();})[_0x5807('0x18')](function(_0x101f38){_0x596afc(_0x101f38);});},'afterDestroy':function(_0x4921c5,_0x19c118,_0x4e7106){return _0x145575[_0x5807('0x1f')][_0x5807('0x21')]({'where':{'ChanSpyId':_0x4921c5['id']}})[_0x5807('0x1d')](function(){_0x4e7106();})[_0x5807('0x18')](function(_0x69feb4){_0x4e7106(_0x69feb4);});}}});}; \ No newline at end of file +var _0x327e=['options','join','concat','internal','findAll','agent','exports','models','define','VoiceChanSpy','voice_chanspy','then','length','VoiceExtension','bulkCreate','catch','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','system','push','merge','Set','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name'];(function(_0x19865b,_0x279613){var _0x186b3a=function(_0xe8278a){while(--_0xe8278a){_0x19865b['push'](_0x19865b['shift']());}};_0x186b3a(++_0x279613);}(_0x327e,0xee));var _0xe327=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x327e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xe327('0x0'));var BPromise=require(_0xe327('0x1'));var attributes=require(_0xe327('0x2'));var getUserApplications=function(_0x2d0701,_0x131b2a,_0x5d4204){var _0x584e74=0x1;var _0x1c6e31=[];var _0x4409fc={'context':_0x131b2a[_0xe327('0x3')]||_0xe327('0x4'),'exten':util[_0xe327('0x5')]('%s%s',_0x2d0701['prefix'],_0x5d4204),'type':_0xe327('0x6'),'isApp':![],'ChanSpyId':_0x2d0701['id'],'UserId':_0x131b2a['id']};_0x1c6e31[_0xe327('0x7')](_[_0xe327('0x8')]({'app':_0xe327('0x9'),'appdata':util[_0xe327('0x5')]('CDR(type)=%s',_0xe327('0xa')),'priority':_0x584e74++},_0x4409fc));if(_0x2d0701[_0xe327('0xb')]){_0x1c6e31[_0xe327('0x7')](_[_0xe327('0x8')]({'app':_0xe327('0xc'),'appdata':util['format'](_0xe327('0xd'),_0x2d0701[_0xe327('0xe')]),'priority':_0x584e74++},_0x4409fc));}if(_0x2d0701[_0xe327('0xf')]){_0x1c6e31['push'](_[_0xe327('0x8')]({'app':_0xe327('0x10'),'appdata':_0x2d0701[_0xe327('0x11')],'priority':_0x584e74++},_0x4409fc));}_0x1c6e31['push'](_[_0xe327('0x8')]({'app':_0xe327('0x12'),'appdata':util['format'](_0xe327('0x13'),_0x131b2a[_0xe327('0x14')],_0x2d0701[_0xe327('0x15')]?_0x2d0701[_0xe327('0x15')][_0xe327('0x16')](''):''),'priority':_0x584e74++},_0x4409fc));if(_0x2d0701[_0xe327('0xb')]){_0x1c6e31['push'](_[_0xe327('0x8')]({'app':'StopMixMonitor','priority':_0x584e74++},_0x4409fc));}return _0x1c6e31;};var getChanSpyApplications=function(_0x17b937,_0x54f87c){var _0x1770e8=[];for(var _0x11dd1f=0x0,_0x595ffe=0x1;_0x11dd1f<_0x54f87c['length'];_0x11dd1f++,_0x595ffe=0x1){_0x1770e8=_0x1770e8[_0xe327('0x17')](getUserApplications(_0x17b937,_0x54f87c[_0x11dd1f],_0x54f87c[_0x11dd1f][_0xe327('0x18')]));if(_0x54f87c[_0x11dd1f]['internal']!=_0x54f87c[_0x11dd1f]['name']){_0x1770e8=_0x1770e8[_0xe327('0x17')](getUserApplications(_0x17b937,_0x54f87c[_0x11dd1f],_0x54f87c[_0x11dd1f][_0xe327('0x14')]));}}return _0x1770e8;};var getChanSpyPromise=function(_0xe598fe,_0x3f0e21){return new BPromise(function(_0x493c52,_0x3a641f){return _0xe598fe['User'][_0xe327('0x19')]({'attributes':['id','name',_0xe327('0x18')],'where':{'role':_0xe327('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x30b948){if(_0x30b948){return _0x493c52(getChanSpyApplications(_0x3f0e21,_0x30b948));}return _0x493c52([]);})['catch'](function(_0x1e65aa){_0x3a641f(_0x1e65aa);});});};module[_0xe327('0x1b')]=function(_0x2f19ee,_0x3fe37e){var _0x5ce551=_0x2f19ee[_0xe327('0x1c')];return _0x2f19ee[_0xe327('0x1d')](_0xe327('0x1e'),attributes,{'tableName':_0xe327('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a3859,_0x3e5d36,_0x2a2798){return getChanSpyPromise(_0x5ce551,_0x2a3859)[_0xe327('0x20')](function(_0x489c11){if(_0x489c11&&_0x489c11[_0xe327('0x21')]){return _0x5ce551[_0xe327('0x22')][_0xe327('0x23')](_0x489c11);}})[_0xe327('0x20')](function(){_0x2a2798();})[_0xe327('0x24')](function(_0x1e9f4b){_0x2a2798(_0x1e9f4b);});},'afterUpdate':function(_0x4b7f37,_0x4477f7,_0x36fd0c){return _0x5ce551[_0xe327('0x22')]['destroy']({'where':{'ChanSpyId':_0x4b7f37['id']}})[_0xe327('0x20')](function(){return getChanSpyPromise(_0x5ce551,_0x4b7f37);})[_0xe327('0x20')](function(_0x34a13f){if(_0x34a13f&&_0x34a13f[_0xe327('0x21')]){return _0x5ce551[_0xe327('0x22')][_0xe327('0x23')](_0x34a13f);}})[_0xe327('0x20')](function(){_0x36fd0c();})['catch'](function(_0x5bfe4f){_0x36fd0c(_0x5bfe4f);});},'afterDestroy':function(_0x2bdf1a,_0x4661dd,_0x4e394a){return _0x5ce551['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x2bdf1a['id']}})[_0xe327('0x20')](function(){_0x4e394a();})[_0xe327('0x24')](function(_0x3abf1a){_0x4e394a(_0x3abf1a);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index a0b20a6..40f10ad 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.rpc.js +++ b/server/api/voiceChanSpy/voiceChanSpy.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5fa=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment'];(function(_0x237f59,_0x3ea9ea){var _0x2f1f44=function(_0x43456f){while(--_0x43456f){_0x237f59['push'](_0x237f59['shift']());}};_0x2f1f44(++_0x3ea9ea);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x415657,_0x39092e){_0x415657=_0x415657-0x0;var _0x9607a1=_0xa5fa[_0x415657];return _0x9607a1;};'use strict';var _=require('lodash');var util=require(_0xaa5f('0x0'));var moment=require(_0xaa5f('0x1'));var BPromise=require(_0xaa5f('0x2'));var rs=require(_0xaa5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa5f('0x4'))['db'];var utils=require(_0xaa5f('0x5'));var logger=require('../../config/logger')(_0xaa5f('0x6'));var config=require(_0xaa5f('0x7'));var jayson=require(_0xaa5f('0x8'));var client=jayson[_0xaa5f('0x9')][_0xaa5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13b606,_0x302138,_0xc326df){return new BPromise(function(_0x74f64f,_0x3f550e){return client[_0xaa5f('0xb')](_0x13b606,_0xc326df)['then'](function(_0x1674c2){logger[_0xaa5f('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x302138,'request\x20sent');logger[_0xaa5f('0xd')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x302138,'request\x20sent',JSON[_0xaa5f('0xe')](_0x1674c2));if(_0x1674c2['error']){if(_0x1674c2[_0xaa5f('0xf')][_0xaa5f('0x10')]===0x1f4){logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1674c2[_0xaa5f('0xf')]['message']);return _0x3f550e(_0x1674c2[_0xaa5f('0xf')]['message']);}logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1674c2[_0xaa5f('0xf')][_0xaa5f('0x12')]);return _0x74f64f(_0x1674c2[_0xaa5f('0xf')]['message']);}else{logger['info'](_0xaa5f('0x11'),_0x302138,_0xaa5f('0x13'));_0x74f64f(_0x1674c2[_0xaa5f('0x14')][_0xaa5f('0x12')]);}})[_0xaa5f('0x15')](function(_0x1fa36a){logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1fa36a);_0x3f550e(_0x1fa36a);});});} \ No newline at end of file +var _0x1339=['info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x222a98,_0x5e7b6e){var _0x130daa=function(_0x25085d){while(--_0x25085d){_0x222a98['push'](_0x222a98['shift']());}};_0x130daa(++_0x5e7b6e);}(_0x1339,0x1ed));var _0x9133=function(_0x1cb4d0,_0x10d829){_0x1cb4d0=_0x1cb4d0-0x0;var _0x3d2382=_0x1339[_0x1cb4d0];return _0x3d2382;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9133('0x0'));var BPromise=require(_0x9133('0x1'));var rs=require(_0x9133('0x2'));var fs=require('fs');var Redis=require(_0x9133('0x3'));var db=require(_0x9133('0x4'))['db'];var utils=require(_0x9133('0x5'));var logger=require(_0x9133('0x6'))(_0x9133('0x7'));var config=require('../../config/environment');var jayson=require(_0x9133('0x8'));var client=jayson[_0x9133('0x9')][_0x9133('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x539af6,_0x2758e2,_0x334dcd){return new BPromise(function(_0x3059c4,_0x431a55){return client[_0x9133('0xb')](_0x539af6,_0x334dcd)[_0x9133('0xc')](function(_0x4294b7){logger[_0x9133('0xd')](_0x9133('0xe'),_0x2758e2,_0x9133('0xf'));logger['debug'](_0x9133('0x10'),_0x2758e2,_0x9133('0xf'),JSON[_0x9133('0x11')](_0x4294b7));if(_0x4294b7[_0x9133('0x12')]){if(_0x4294b7[_0x9133('0x12')][_0x9133('0x13')]===0x1f4){logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')]['message']);return _0x431a55(_0x4294b7['error'][_0x9133('0x14')]);}logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);return _0x3059c4(_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);}else{logger[_0x9133('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x2758e2,_0x9133('0xf'));_0x3059c4(_0x4294b7[_0x9133('0x15')]['message']);}})[_0x9133('0x16')](function(_0xa46eb1){logger[_0x9133('0x12')](_0x9133('0xe'),_0x2758e2,_0xa46eb1);_0x431a55(_0xa46eb1);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 2506ca9..2f435ec 100644 --- a/server/api/voiceContext/index.js +++ b/server/api/voiceContext/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce74=['create','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceContext.controller','get','/:id','post','isAuthenticated'];(function(_0x2f2bb0,_0x1b1672){var _0x53c263=function(_0x316829){while(--_0x316829){_0x2f2bb0['push'](_0x2f2bb0['shift']());}};_0x53c263(++_0x1b1672);}(_0xce74,0xa8));var _0x4ce7=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xce74[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x4ce7('0x0'));var util=require('util');var path=require(_0x4ce7('0x1'));var timeout=require(_0x4ce7('0x2'));var express=require(_0x4ce7('0x3'));var router=express[_0x4ce7('0x4')]();var fs_extra=require(_0x4ce7('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4ce7('0x6'));var controller=require(_0x4ce7('0x7'));router[_0x4ce7('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4ce7('0x8')](_0x4ce7('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x4ce7('0xa')]('/',auth[_0x4ce7('0xb')](),controller[_0x4ce7('0xc')]);router['put'](_0x4ce7('0x9'),auth[_0x4ce7('0xb')](),controller[_0x4ce7('0xd')]);router[_0x4ce7('0xe')]('/:id',auth[_0x4ce7('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x91ec=['get','/:id','create','put','update','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./voiceContext.controller','isAuthenticated','index'];(function(_0x3dc68d,_0x1c1951){var _0xdf7f94=function(_0x339428){while(--_0x339428){_0x3dc68d['push'](_0x3dc68d['shift']());}};_0xdf7f94(++_0x1c1951);}(_0x91ec,0x187));var _0xc91e=function(_0x3d61c9,_0x567914){_0x3d61c9=_0x3d61c9-0x0;var _0x16ccf3=_0x91ec[_0x3d61c9];return _0x16ccf3;};'use strict';var multer=require(_0xc91e('0x0'));var util=require(_0xc91e('0x1'));var path=require(_0xc91e('0x2'));var timeout=require(_0xc91e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc91e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc91e('0x5'));var controller=require(_0xc91e('0x6'));router['get']('/',auth[_0xc91e('0x7')](),controller[_0xc91e('0x8')]);router[_0xc91e('0x9')](_0xc91e('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xc91e('0x7')](),controller[_0xc91e('0xb')]);router[_0xc91e('0xc')](_0xc91e('0xa'),auth[_0xc91e('0x7')](),controller[_0xc91e('0xd')]);router[_0xc91e('0xe')](_0xc91e('0xa'),auth[_0xc91e('0x7')](),controller[_0xc91e('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index f7ad5cc..64ff6bd 100644 --- a/server/api/voiceContext/voiceContext.attributes.js +++ b/server/api/voiceContext/voiceContext.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05cc=['exports','STRING','name','BOOLEAN','sequelize'];(function(_0x5cc765,_0x3c0b4e){var _0x2924a8=function(_0x4696ee){while(--_0x4696ee){_0x5cc765['push'](_0x5cc765['shift']());}};_0x2924a8(++_0x3c0b4e);}(_0x05cc,0x1e9));var _0xc05c=function(_0x19b440,_0x1bfc47){_0x19b440=_0x19b440-0x0;var _0x500f14=_0x05cc[_0x19b440];return _0x500f14;};'use strict';var Sequelize=require(_0xc05c('0x0'));module[_0xc05c('0x1')]={'name':{'type':Sequelize[_0xc05c('0x2')],'unique':_0xc05c('0x3')},'description':{'type':Sequelize[_0xc05c('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xc05c('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1729=['exports'];(function(_0x23c34a,_0x24ef42){var _0xb8b1bb=function(_0x5ee729){while(--_0x5ee729){_0x23c34a['push'](_0x23c34a['shift']());}};_0xb8b1bb(++_0x24ef42);}(_0x1729,0x7c));var _0x9172=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x1729[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require('sequelize');module[_0x9172('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index c43151a..eccde82 100644 --- a/server/api/voiceContext/voiceContext.controller.js +++ b/server/api/voiceContext/voiceContext.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8781=['length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','params','find','create','body','root','server/files/templates/context.ejs','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','utf8','readFileSync','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','jayson/promise','client','request','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','get','UserProfileResource','end','stack','name','send','index','VoiceContext','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x8781,0x155));var _0x1878=function(_0x138ca5,_0x44b657){_0x138ca5=_0x138ca5-0x0;var _0x43cac7=_0x8781[_0x138ca5];return _0x43cac7;};'use strict';var emlformat=require(_0x1878('0x0'));var rimraf=require(_0x1878('0x1'));var zipdir=require(_0x1878('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1878('0x3'));var moment=require(_0x1878('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1878('0x5'));var util=require(_0x1878('0x6'));var path=require('path');var sox=require(_0x1878('0x7'));var csv=require(_0x1878('0x8'));var ejs=require(_0x1878('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1878('0xa'));var squel=require(_0x1878('0xb'));var crypto=require(_0x1878('0xc'));var jsforce=require(_0x1878('0xd'));var deskjs=require(_0x1878('0xe'));var toCsv=require(_0x1878('0x8'));var querystring=require(_0x1878('0xf'));var Papa=require(_0x1878('0x10'));var Redis=require(_0x1878('0x11'));var authService=require(_0x1878('0x12'));var qs=require(_0x1878('0x13'));var as=require(_0x1878('0x14'));var hardwareService=require(_0x1878('0x15'));var logger=require('../../config/logger')(_0x1878('0x16'));var utils=require('../../config/utils');var config=require(_0x1878('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1878('0x18'))['db'];var jayson=require(_0x1878('0x19'));var client=jayson[_0x1878('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e14b1,_0x81febd,_0x64c3a1,_0x3fd37a){return new BPromise(function(_0x4342ef,_0x37128a){var _0xf4a9f5=_0x3fd37a||client;return _0xf4a9f5[_0x1878('0x1b')](_0x2e14b1,_0x64c3a1)[_0x1878('0x1c')](function(_0x5b60c2){logger['info'](_0x1878('0x1d'),_0x81febd,'request\x20sent');logger[_0x1878('0x1e')](_0x1878('0x1f'),_0x81febd,_0x1878('0x20'),JSON[_0x1878('0x21')](_0x5b60c2));if(_0x5b60c2[_0x1878('0x22')]){if(_0x5b60c2[_0x1878('0x22')][_0x1878('0x23')]===0x1f4){logger[_0x1878('0x22')]('VoiceContext,\x20%s,\x20%s',_0x81febd,_0x5b60c2['error']['message']);return _0x37128a(_0x5b60c2[_0x1878('0x22')][_0x1878('0x24')]);}logger['error'](_0x1878('0x1d'),_0x81febd,_0x5b60c2['error'][_0x1878('0x24')]);return _0x4342ef(_0x5b60c2[_0x1878('0x22')]['message']);}else{logger[_0x1878('0x25')](_0x1878('0x1d'),_0x81febd,'request\x20sent');_0x4342ef(_0x5b60c2[_0x1878('0x26')][_0x1878('0x24')]);}})[_0x1878('0x27')](function(_0x1c772e){logger[_0x1878('0x22')](_0x1878('0x1d'),_0x81febd,_0x1c772e);_0x37128a(_0x1c772e);});});}function respondWithStatusCode(_0x55e7c7,_0x3c429e){_0x3c429e=_0x3c429e||0xcc;return function(_0x28cae0){if(_0x28cae0){return _0x55e7c7[_0x1878('0x28')](_0x3c429e);}return _0x55e7c7[_0x1878('0x29')](_0x3c429e)['end']();};}function respondWithResult(_0x43b334,_0x3b290c){_0x3b290c=_0x3b290c||0xc8;return function(_0x435b4f){if(_0x435b4f){return _0x43b334['status'](_0x3b290c)[_0x1878('0x2a')](_0x435b4f);}};}function respondWithFilteredResult(_0x144218,_0x4c9eb2){return function(_0x41d350){if(_0x41d350){var _0x2ef9fc=typeof _0x4c9eb2[_0x1878('0x2b')]===_0x1878('0x2c')&&typeof _0x4c9eb2['limit']==='undefined';var _0x3387a2=_0x41d350[_0x1878('0x2d')];var _0x352242=_0x2ef9fc?0x0:_0x4c9eb2['offset'];var _0x3035d1=_0x2ef9fc?_0x41d350[_0x1878('0x2d')]:_0x4c9eb2[_0x1878('0x2b')]+_0x4c9eb2[_0x1878('0x2e')];var _0x5e656f;if(_0x3035d1>=_0x3387a2){_0x3035d1=_0x3387a2;_0x5e656f=0xc8;}else{_0x5e656f=0xce;}_0x144218[_0x1878('0x29')](_0x5e656f);return _0x144218[_0x1878('0x2f')]('Content-Range',_0x352242+'-'+_0x3035d1+'/'+_0x3387a2)['json'](_0x41d350);}return null;};}function patchUpdates(_0x3c24b5){return function(_0x18de3f){try{jsonpatch[_0x1878('0x30')](_0x18de3f,_0x3c24b5,!![]);}catch(_0x5b8b6f){return BPromise[_0x1878('0x31')](_0x5b8b6f);}return _0x18de3f[_0x1878('0x32')]();};}function saveUpdates(_0x169fa8,_0x9f6053){return function(_0x4ef031){if(_0x4ef031){return _0x4ef031[_0x1878('0x33')](_0x169fa8)[_0x1878('0x1c')](function(_0x5de80a){return _0x5de80a;});}return null;};}function removeEntity(_0x5788f3,_0xabe0e5){return function(_0x5bddea){if(_0x5bddea){return _0x5bddea[_0x1878('0x34')]()[_0x1878('0x1c')](function(){var _0x1b58c1=_0x5bddea[_0x1878('0x35')]({'plain':!![]});var _0x28d6d4='Contexts';return db[_0x1878('0x36')][_0x1878('0x34')]({'where':{'type':_0x28d6d4,'resourceId':_0x1b58c1['id']}})[_0x1878('0x1c')](function(){return _0x5bddea;});})[_0x1878('0x1c')](function(){_0x5788f3[_0x1878('0x29')](0xcc)[_0x1878('0x37')]();});}};}function handleEntityNotFound(_0x55c682,_0x5f0365){return function(_0x53aac5){if(!_0x53aac5){_0x55c682[_0x1878('0x28')](0x194);}return _0x53aac5;};}function handleError(_0x25fe2a,_0x87cd3c){_0x87cd3c=_0x87cd3c||0x1f4;return function(_0x78ede5){logger[_0x1878('0x22')](_0x78ede5[_0x1878('0x38')]);if(_0x78ede5['name']){delete _0x78ede5[_0x1878('0x39')];}_0x25fe2a[_0x1878('0x29')](_0x87cd3c)[_0x1878('0x3a')](_0x78ede5);};}exports[_0x1878('0x3b')]=function(_0x2870ca,_0x497b6f){var _0x58def8={},_0x20dd93={},_0x4212fd={'count':0x0,'rows':[]};var _0x329fe4=_['map'](db[_0x1878('0x3c')][_0x1878('0x3d')],function(_0x6695df){return{'name':_0x6695df[_0x1878('0x3e')],'type':_0x6695df[_0x1878('0x3f')]['key']};});_0x20dd93['model']=_[_0x1878('0x40')](_0x329fe4,_0x1878('0x39'));_0x20dd93[_0x1878('0x41')]=_[_0x1878('0x42')](_0x2870ca['query']);_0x20dd93[_0x1878('0x43')]=_[_0x1878('0x44')](_0x20dd93[_0x1878('0x45')],_0x20dd93[_0x1878('0x41')]);_0x58def8[_0x1878('0x46')]=_[_0x1878('0x44')](_0x20dd93['model'],qs['fields'](_0x2870ca['query']['fields']));_0x58def8[_0x1878('0x46')]=_0x58def8[_0x1878('0x46')][_0x1878('0x47')]?_0x58def8[_0x1878('0x46')]:_0x20dd93[_0x1878('0x45')];if(!_0x2870ca[_0x1878('0x41')][_0x1878('0x48')](_0x1878('0x49'))){_0x58def8[_0x1878('0x2e')]=qs['limit'](_0x2870ca[_0x1878('0x41')][_0x1878('0x2e')]);_0x58def8[_0x1878('0x2b')]=qs['offset'](_0x2870ca[_0x1878('0x41')][_0x1878('0x2b')]);}_0x58def8['order']=qs[_0x1878('0x4a')](_0x2870ca[_0x1878('0x41')]['sort']);_0x58def8[_0x1878('0x4b')]=qs[_0x1878('0x43')](_[_0x1878('0x4c')](_0x2870ca['query'],_0x20dd93[_0x1878('0x43')]),_0x329fe4);if(_0x2870ca[_0x1878('0x41')][_0x1878('0x4d')]){_0x58def8[_0x1878('0x4b')]=_[_0x1878('0x4e')](_0x58def8[_0x1878('0x4b')],{'$or':_[_0x1878('0x40')](_0x329fe4,function(_0x253fa8){if(_0x253fa8['type']!==_0x1878('0x4f')){var _0x1cc2e5={};_0x1cc2e5[_0x253fa8['name']]={'$like':'%'+_0x2870ca[_0x1878('0x41')][_0x1878('0x4d')]+'%'};return _0x1cc2e5;}})});}_0x58def8=_['merge']({},_0x58def8,_0x2870ca[_0x1878('0x50')]);var _0x22b429={'where':_0x58def8[_0x1878('0x4b')]};return db['VoiceContext'][_0x1878('0x2d')](_0x22b429)[_0x1878('0x1c')](function(_0x4f236a){_0x4212fd[_0x1878('0x2d')]=_0x4f236a;if(_0x2870ca[_0x1878('0x41')][_0x1878('0x51')]){_0x58def8['include']=[{'all':!![]}];}return db[_0x1878('0x3c')][_0x1878('0x52')](_0x58def8);})[_0x1878('0x1c')](function(_0x28589f){_0x4212fd['rows']=_0x28589f;return _0x4212fd;})['then'](respondWithFilteredResult(_0x497b6f,_0x58def8))[_0x1878('0x27')](handleError(_0x497b6f,null));};exports['show']=function(_0x39df63,_0x543fb7){var _0x5815aa={'raw':![],'where':{'id':_0x39df63[_0x1878('0x53')]['id']}},_0x49942a={};_0x49942a[_0x1878('0x45')]=_[_0x1878('0x42')](db[_0x1878('0x3c')]['rawAttributes']);_0x49942a[_0x1878('0x41')]=_[_0x1878('0x42')](_0x39df63[_0x1878('0x41')]);_0x49942a[_0x1878('0x43')]=_[_0x1878('0x44')](_0x49942a[_0x1878('0x45')],_0x49942a[_0x1878('0x41')]);_0x5815aa[_0x1878('0x46')]=_['intersection'](_0x49942a[_0x1878('0x45')],qs['fields'](_0x39df63['query']['fields']));_0x5815aa[_0x1878('0x46')]=_0x5815aa[_0x1878('0x46')][_0x1878('0x47')]?_0x5815aa[_0x1878('0x46')]:_0x49942a[_0x1878('0x45')];if(_0x39df63['query'][_0x1878('0x51')]){_0x5815aa['include']=[{'all':!![]}];}_0x5815aa=_[_0x1878('0x4e')]({},_0x5815aa,_0x39df63[_0x1878('0x50')]);return db[_0x1878('0x3c')][_0x1878('0x54')](_0x5815aa)[_0x1878('0x1c')](handleEntityNotFound(_0x543fb7,null))[_0x1878('0x1c')](respondWithResult(_0x543fb7,null))[_0x1878('0x27')](handleError(_0x543fb7,null));};exports['create']=function(_0x566f72,_0x4f7dde,_0x218bcc){var _0x2a384d;return db[_0x1878('0x3c')][_0x1878('0x55')](_0x566f72[_0x1878('0x56')],{'raw':!![]})[_0x1878('0x1c')](function(_0x265c20){_0x2a384d=_0x265c20;return db[_0x1878('0x3c')][_0x1878('0x52')]({'raw':!![]});})[_0x1878('0x1c')](function(_0x3fbbfa){var _0x3af5a4=fs['readFileSync'](path['join'](config[_0x1878('0x57')],_0x1878('0x58')),'utf8');var _0x5559d9=ejs[_0x1878('0x59')](_0x3af5a4,{'contexts':_0x3fbbfa||[]});fs[_0x1878('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x5559d9);})[_0x1878('0x1c')](function(){return respondWithRpcPromise(_0x1878('0x5b'),_0x1878('0x55'),{'module':_0x1878('0x5c')});})[_0x1878('0x1c')](function(){var _0x5e877c=_0x566f72[_0x1878('0x5d')][_0x1878('0x35')]({'plain':!![]});if(!_0x5e877c)throw new Error(_0x1878('0x5e'));if(_0x5e877c['role']===_0x1878('0x5d')){var _0x3a662a=_0x2a384d[_0x1878('0x35')]({'plain':!![]});return db[_0x1878('0x5f')][_0x1878('0x54')]({'where':{'name':_0x1878('0x60'),'userProfileId':_0x5e877c[_0x1878('0x61')]},'raw':!![]})[_0x1878('0x1c')](function(_0x11a5f0){if(_0x11a5f0&&_0x11a5f0[_0x1878('0x62')]===0x0){return db[_0x1878('0x36')][_0x1878('0x55')]({'name':_0x3a662a[_0x1878('0x39')],'resourceId':_0x3a662a['id'],'type':_0x11a5f0[_0x1878('0x39')],'sectionId':_0x11a5f0['id']},{})['then'](function(){return _0x2a384d;});}else{return _0x2a384d;}})['catch'](function(_0x13c1ff){logger[_0x1878('0x22')](_0x1878('0x63'),_0x13c1ff);throw _0x13c1ff;});}return _0x2a384d;})[_0x1878('0x1c')](respondWithResult(_0x4f7dde,0xc9))[_0x1878('0x27')](handleError(_0x4f7dde,null));};exports[_0x1878('0x33')]=function(_0x1c7e18,_0xf83ee7,_0x3b739c){var _0x3e585a;return db[_0x1878('0x3c')]['find']({'where':{'id':_0x1c7e18[_0x1878('0x53')]['id']}})[_0x1878('0x1c')](handleEntityNotFound(_0xf83ee7,null))[_0x1878('0x1c')](saveUpdates(_0x1c7e18[_0x1878('0x56')],null))[_0x1878('0x1c')](function(_0x398e3f){if(_0x398e3f){_0x3e585a=_0x398e3f;return db[_0x1878('0x3c')]['findAll']({'raw':!![]});}})[_0x1878('0x1c')](function(_0x28e10f){var _0x476aaa=fs['readFileSync'](path[_0x1878('0x64')](config[_0x1878('0x57')],_0x1878('0x58')),_0x1878('0x65'));var _0x328ab9=ejs['render'](_0x476aaa,{'contexts':_0x28e10f||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x328ab9);})[_0x1878('0x1c')](function(){return respondWithRpcPromise('Reload',_0x1878('0x33'),{'module':'chan_sip.so'});})['then'](function(){return _0x3e585a;})[_0x1878('0x1c')](respondWithResult(_0xf83ee7,null))[_0x1878('0x27')](handleError(_0xf83ee7,null));};exports['destroy']=function(_0x4595f5,_0x2be4f2,_0x30eece){var _0x29fe56;return db[_0x1878('0x3c')][_0x1878('0x54')]({'where':{'id':_0x4595f5[_0x1878('0x53')]['id']}})[_0x1878('0x1c')](handleEntityNotFound(_0x2be4f2,null))[_0x1878('0x1c')](removeEntity(_0x2be4f2,null))['then'](function(){return db[_0x1878('0x3c')][_0x1878('0x52')]({'raw':!![]});})[_0x1878('0x1c')](function(_0x5ee230){var _0x24687d=fs[_0x1878('0x66')](path[_0x1878('0x64')](config[_0x1878('0x57')],_0x1878('0x58')),'utf8');var _0x46ab6c=ejs['render'](_0x24687d,{'contexts':_0x5ee230});fs[_0x1878('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x46ab6c);return respondWithRpcPromise(_0x1878('0x5b'),_0x1878('0x34'),{'module':_0x1878('0x5c')});})[_0x1878('0x27')](handleError(_0x2be4f2,null));}; \ No newline at end of file +var _0x0b56=['fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','destroy','get','Contexts','stack','name','map','VoiceContext','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','include','findAll','rows','rawAttributes','keys','options','find','create','body','join','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','readFileSync','render','rimraf','zip-dir','request-promise','bluebird','util','path','sox'];(function(_0x7f4695,_0x19826e){var _0x2caeb6=function(_0x42630c){while(--_0x42630c){_0x7f4695['push'](_0x7f4695['shift']());}};_0x2caeb6(++_0x19826e);}(_0x0b56,0x1f2));var _0x60b5=function(_0x265683,_0x9468d9){_0x265683=_0x265683-0x0;var _0x3f0cc9=_0x0b56[_0x265683];return _0x3f0cc9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x60b5('0x0'));var zipdir=require(_0x60b5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x60b5('0x2'));var moment=require('moment');var BPromise=require(_0x60b5('0x3'));var Mustache=require('mustache');var util=require(_0x60b5('0x4'));var path=require(_0x60b5('0x5'));var sox=require(_0x60b5('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x60b5('0x7'));var _=require(_0x60b5('0x8'));var squel=require(_0x60b5('0x9'));var crypto=require(_0x60b5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x60b5('0xb'));var toCsv=require(_0x60b5('0xc'));var querystring=require(_0x60b5('0xd'));var Papa=require('papaparse');var Redis=require(_0x60b5('0xe'));var authService=require(_0x60b5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x60b5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x60b5('0x11'))(_0x60b5('0x12'));var utils=require('../../config/utils');var config=require(_0x60b5('0x13'));var licenseUtil=require(_0x60b5('0x14'));var db=require(_0x60b5('0x15'))['db'];var jayson=require(_0x60b5('0x16'));var client=jayson[_0x60b5('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48dc4d,_0x31e54d,_0x186759,_0x272432){return new BPromise(function(_0x23ed9a,_0x59a7a7){var _0x2f280c=_0x272432||client;return _0x2f280c['request'](_0x48dc4d,_0x186759)[_0x60b5('0x18')](function(_0x1f6156){logger[_0x60b5('0x19')](_0x60b5('0x1a'),_0x31e54d,_0x60b5('0x1b'));logger[_0x60b5('0x1c')](_0x60b5('0x1d'),_0x31e54d,_0x60b5('0x1b'),JSON[_0x60b5('0x1e')](_0x1f6156));if(_0x1f6156[_0x60b5('0x1f')]){if(_0x1f6156['error'][_0x60b5('0x20')]===0x1f4){logger[_0x60b5('0x1f')](_0x60b5('0x1a'),_0x31e54d,_0x1f6156['error']['message']);return _0x59a7a7(_0x1f6156['error']['message']);}logger[_0x60b5('0x1f')](_0x60b5('0x1a'),_0x31e54d,_0x1f6156[_0x60b5('0x1f')]['message']);return _0x23ed9a(_0x1f6156['error'][_0x60b5('0x21')]);}else{logger[_0x60b5('0x19')](_0x60b5('0x1a'),_0x31e54d,_0x60b5('0x1b'));_0x23ed9a(_0x1f6156[_0x60b5('0x22')][_0x60b5('0x21')]);}})[_0x60b5('0x23')](function(_0x2618a6){logger[_0x60b5('0x1f')](_0x60b5('0x1a'),_0x31e54d,_0x2618a6);_0x59a7a7(_0x2618a6);});});}function respondWithStatusCode(_0x48df53,_0x3e66fa){_0x3e66fa=_0x3e66fa||0xcc;return function(_0x337bf6){if(_0x337bf6){return _0x48df53[_0x60b5('0x24')](_0x3e66fa);}return _0x48df53[_0x60b5('0x25')](_0x3e66fa)[_0x60b5('0x26')]();};}function respondWithResult(_0x6f6c83,_0x39fd25){_0x39fd25=_0x39fd25||0xc8;return function(_0x144e7f){if(_0x144e7f){return _0x6f6c83['status'](_0x39fd25)[_0x60b5('0x27')](_0x144e7f);}};}function respondWithFilteredResult(_0x215076,_0x2cc78e){return function(_0x235d7f){if(_0x235d7f){var _0x1fbd65=typeof _0x2cc78e['offset']==='undefined'&&typeof _0x2cc78e[_0x60b5('0x28')]===_0x60b5('0x29');var _0x187b9a=_0x235d7f[_0x60b5('0x2a')];var _0x4580a4=_0x1fbd65?0x0:_0x2cc78e['offset'];var _0x1e0264=_0x1fbd65?_0x235d7f[_0x60b5('0x2a')]:_0x2cc78e[_0x60b5('0x2b')]+_0x2cc78e[_0x60b5('0x28')];var _0x565a9c;if(_0x1e0264>=_0x187b9a){_0x1e0264=_0x187b9a;_0x565a9c=0xc8;}else{_0x565a9c=0xce;}_0x215076[_0x60b5('0x25')](_0x565a9c);return _0x215076['set'](_0x60b5('0x2c'),_0x4580a4+'-'+_0x1e0264+'/'+_0x187b9a)[_0x60b5('0x27')](_0x235d7f);}return null;};}function patchUpdates(_0x5bbd7d){return function(_0x477db3){try{jsonpatch[_0x60b5('0x2d')](_0x477db3,_0x5bbd7d,!![]);}catch(_0x2398e9){return BPromise[_0x60b5('0x2e')](_0x2398e9);}return _0x477db3[_0x60b5('0x2f')]();};}function saveUpdates(_0x4ce0cd,_0x52ff46){return function(_0xc7906e){if(_0xc7906e){return _0xc7906e[_0x60b5('0x30')](_0x4ce0cd)[_0x60b5('0x18')](function(_0x32d48d){return _0x32d48d;});}return null;};}function removeEntity(_0x287aef,_0x487eaa){return function(_0xac44e7){if(_0xac44e7){return _0xac44e7[_0x60b5('0x31')]()[_0x60b5('0x18')](function(){var _0x32501e=_0xac44e7[_0x60b5('0x32')]({'plain':!![]});var _0x42bb4c=_0x60b5('0x33');return db['UserProfileResource']['destroy']({'where':{'type':_0x42bb4c,'resourceId':_0x32501e['id']}})[_0x60b5('0x18')](function(){return _0xac44e7;});})[_0x60b5('0x18')](function(){_0x287aef[_0x60b5('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bc2ad,_0x1278b6){return function(_0x1d5674){if(!_0x1d5674){_0x2bc2ad[_0x60b5('0x24')](0x194);}return _0x1d5674;};}function handleError(_0x26fb86,_0x581047){_0x581047=_0x581047||0x1f4;return function(_0x502c37){logger[_0x60b5('0x1f')](_0x502c37[_0x60b5('0x34')]);if(_0x502c37[_0x60b5('0x35')]){delete _0x502c37[_0x60b5('0x35')];}_0x26fb86[_0x60b5('0x25')](_0x581047)['send'](_0x502c37);};}exports['index']=function(_0x411924,_0x5beeaa){var _0x5e6159={},_0x2d7c14={},_0x38ff30={'count':0x0,'rows':[]};var _0x10b724=_[_0x60b5('0x36')](db[_0x60b5('0x37')]['rawAttributes'],function(_0x397bff){return{'name':_0x397bff[_0x60b5('0x38')],'type':_0x397bff['type'][_0x60b5('0x39')]};});_0x2d7c14[_0x60b5('0x3a')]=_[_0x60b5('0x36')](_0x10b724,_0x60b5('0x35'));_0x2d7c14[_0x60b5('0x3b')]=_['keys'](_0x411924[_0x60b5('0x3b')]);_0x2d7c14[_0x60b5('0x3c')]=_[_0x60b5('0x3d')](_0x2d7c14[_0x60b5('0x3a')],_0x2d7c14[_0x60b5('0x3b')]);_0x5e6159[_0x60b5('0x3e')]=_['intersection'](_0x2d7c14[_0x60b5('0x3a')],qs['fields'](_0x411924[_0x60b5('0x3b')][_0x60b5('0x3f')]));_0x5e6159[_0x60b5('0x3e')]=_0x5e6159[_0x60b5('0x3e')][_0x60b5('0x40')]?_0x5e6159[_0x60b5('0x3e')]:_0x2d7c14['model'];if(!_0x411924[_0x60b5('0x3b')][_0x60b5('0x41')](_0x60b5('0x42'))){_0x5e6159[_0x60b5('0x28')]=qs[_0x60b5('0x28')](_0x411924[_0x60b5('0x3b')][_0x60b5('0x28')]);_0x5e6159[_0x60b5('0x2b')]=qs[_0x60b5('0x2b')](_0x411924[_0x60b5('0x3b')][_0x60b5('0x2b')]);}_0x5e6159['order']=qs[_0x60b5('0x43')](_0x411924[_0x60b5('0x3b')][_0x60b5('0x43')]);_0x5e6159[_0x60b5('0x44')]=qs[_0x60b5('0x3c')](_[_0x60b5('0x45')](_0x411924[_0x60b5('0x3b')],_0x2d7c14[_0x60b5('0x3c')]),_0x10b724);if(_0x411924['query']['filter']){_0x5e6159['where']=_[_0x60b5('0x46')](_0x5e6159[_0x60b5('0x44')],{'$or':_[_0x60b5('0x36')](_0x10b724,function(_0x331c1b){if(_0x331c1b[_0x60b5('0x47')]!==_0x60b5('0x48')){var _0x280861={};_0x280861[_0x331c1b[_0x60b5('0x35')]]={'$like':'%'+_0x411924[_0x60b5('0x3b')][_0x60b5('0x49')]+'%'};return _0x280861;}})});}_0x5e6159=_[_0x60b5('0x46')]({},_0x5e6159,_0x411924['options']);var _0x39a851={'where':_0x5e6159[_0x60b5('0x44')]};return db[_0x60b5('0x37')][_0x60b5('0x2a')](_0x39a851)['then'](function(_0x4de026){_0x38ff30['count']=_0x4de026;if(_0x411924['query']['includeAll']){_0x5e6159[_0x60b5('0x4a')]=[{'all':!![]}];}return db[_0x60b5('0x37')][_0x60b5('0x4b')](_0x5e6159);})['then'](function(_0x1c43ca){_0x38ff30[_0x60b5('0x4c')]=_0x1c43ca;return _0x38ff30;})[_0x60b5('0x18')](respondWithFilteredResult(_0x5beeaa,_0x5e6159))[_0x60b5('0x23')](handleError(_0x5beeaa,null));};exports['show']=function(_0x2b44f1,_0x10592d){var _0x123f41={'raw':![],'where':{'id':_0x2b44f1['params']['id']}},_0x40da66={};_0x40da66['model']=_['keys'](db[_0x60b5('0x37')][_0x60b5('0x4d')]);_0x40da66['query']=_[_0x60b5('0x4e')](_0x2b44f1[_0x60b5('0x3b')]);_0x40da66['filters']=_[_0x60b5('0x3d')](_0x40da66[_0x60b5('0x3a')],_0x40da66['query']);_0x123f41['attributes']=_[_0x60b5('0x3d')](_0x40da66[_0x60b5('0x3a')],qs[_0x60b5('0x3f')](_0x2b44f1[_0x60b5('0x3b')][_0x60b5('0x3f')]));_0x123f41[_0x60b5('0x3e')]=_0x123f41[_0x60b5('0x3e')]['length']?_0x123f41['attributes']:_0x40da66[_0x60b5('0x3a')];if(_0x2b44f1[_0x60b5('0x3b')]['includeAll']){_0x123f41['include']=[{'all':!![]}];}_0x123f41=_['merge']({},_0x123f41,_0x2b44f1[_0x60b5('0x4f')]);return db[_0x60b5('0x37')][_0x60b5('0x50')](_0x123f41)[_0x60b5('0x18')](handleEntityNotFound(_0x10592d,null))[_0x60b5('0x18')](respondWithResult(_0x10592d,null))[_0x60b5('0x23')](handleError(_0x10592d,null));};exports[_0x60b5('0x51')]=function(_0x309531,_0x400168,_0x4d836b){var _0x1bbe61;return db[_0x60b5('0x37')][_0x60b5('0x51')](_0x309531[_0x60b5('0x52')],{'raw':!![]})['then'](function(_0x4ce9cb){_0x1bbe61=_0x4ce9cb;return db[_0x60b5('0x37')][_0x60b5('0x4b')]({'raw':!![]});})[_0x60b5('0x18')](function(_0x5bffa4){var _0xdc5e08=fs['readFileSync'](path[_0x60b5('0x53')](config[_0x60b5('0x54')],_0x60b5('0x55')),_0x60b5('0x56'));var _0x181126=ejs['render'](_0xdc5e08,{'contexts':_0x5bffa4||[]});fs[_0x60b5('0x57')](_0x60b5('0x58'),_0x181126);})[_0x60b5('0x18')](function(){return respondWithRpcPromise(_0x60b5('0x59'),_0x60b5('0x51'),{'module':_0x60b5('0x5a')});})[_0x60b5('0x18')](function(){var _0x4253cb=_0x309531[_0x60b5('0x5b')][_0x60b5('0x32')]({'plain':!![]});if(!_0x4253cb)throw new Error(_0x60b5('0x5c'));if(_0x4253cb['role']==='user'){var _0x311496=_0x1bbe61[_0x60b5('0x32')]({'plain':!![]});return db[_0x60b5('0x5d')][_0x60b5('0x50')]({'where':{'name':'Contexts','userProfileId':_0x4253cb[_0x60b5('0x5e')]},'raw':!![]})[_0x60b5('0x18')](function(_0x3bca70){if(_0x3bca70&&_0x3bca70[_0x60b5('0x5f')]===0x0){return db[_0x60b5('0x60')][_0x60b5('0x51')]({'name':_0x311496[_0x60b5('0x35')],'resourceId':_0x311496['id'],'type':_0x3bca70[_0x60b5('0x35')],'sectionId':_0x3bca70['id']},{})[_0x60b5('0x18')](function(){return _0x1bbe61;});}else{return _0x1bbe61;}})[_0x60b5('0x23')](function(_0x2b75bc){logger[_0x60b5('0x1f')](_0x60b5('0x61'),_0x2b75bc);throw _0x2b75bc;});}return _0x1bbe61;})[_0x60b5('0x18')](respondWithResult(_0x400168,0xc9))['catch'](handleError(_0x400168,null));};exports[_0x60b5('0x30')]=function(_0x57b0ba,_0x4427dc,_0x3de9cb){var _0x5c6410;return db[_0x60b5('0x37')]['find']({'where':{'id':_0x57b0ba[_0x60b5('0x62')]['id']}})[_0x60b5('0x18')](handleEntityNotFound(_0x4427dc,null))[_0x60b5('0x18')](saveUpdates(_0x57b0ba[_0x60b5('0x52')],null))[_0x60b5('0x18')](function(_0x419062){if(_0x419062){_0x5c6410=_0x419062;return db[_0x60b5('0x37')]['findAll']({'raw':!![]});}})[_0x60b5('0x18')](function(_0x226b0d){var _0xabdbc7=fs[_0x60b5('0x63')](path[_0x60b5('0x53')](config[_0x60b5('0x54')],_0x60b5('0x55')),'utf8');var _0x32aeb0=ejs['render'](_0xabdbc7,{'contexts':_0x226b0d||[]});fs[_0x60b5('0x57')](_0x60b5('0x58'),_0x32aeb0);})[_0x60b5('0x18')](function(){return respondWithRpcPromise(_0x60b5('0x59'),_0x60b5('0x30'),{'module':_0x60b5('0x5a')});})[_0x60b5('0x18')](function(){return _0x5c6410;})[_0x60b5('0x18')](respondWithResult(_0x4427dc,null))[_0x60b5('0x23')](handleError(_0x4427dc,null));};exports['destroy']=function(_0x280938,_0x471fc1,_0x444371){var _0x216bb3;return db[_0x60b5('0x37')]['find']({'where':{'id':_0x280938[_0x60b5('0x62')]['id']}})[_0x60b5('0x18')](handleEntityNotFound(_0x471fc1,null))[_0x60b5('0x18')](removeEntity(_0x471fc1,null))['then'](function(){return db[_0x60b5('0x37')][_0x60b5('0x4b')]({'raw':!![]});})[_0x60b5('0x18')](function(_0x3193d0){var _0x44dfab=fs[_0x60b5('0x63')](path[_0x60b5('0x53')](config[_0x60b5('0x54')],_0x60b5('0x55')),_0x60b5('0x56'));var _0x56ff63=ejs[_0x60b5('0x64')](_0x44dfab,{'contexts':_0x3193d0});fs['writeFileSync'](_0x60b5('0x58'),_0x56ff63);return respondWithRpcPromise(_0x60b5('0x59'),_0x60b5('0x31'),{'module':_0x60b5('0x5a')});})[_0x60b5('0x23')](handleError(_0x471fc1,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index f7390ee..1c993a7 100644 --- a/server/api/voiceContext/voiceContext.model.js +++ b/server/api/voiceContext/voiceContext.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x901c=['voice_contexts','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceContext'];(function(_0x505a7d,_0x25e11f){var _0x17d880=function(_0x213c2){while(--_0x213c2){_0x505a7d['push'](_0x505a7d['shift']());}};_0x17d880(++_0x25e11f);}(_0x901c,0x15d));var _0xc901=function(_0x2b7f75,_0x5d40e2){_0x2b7f75=_0x2b7f75-0x0;var _0x3fb08e=_0x901c[_0x2b7f75];return _0x3fb08e;};'use strict';var _=require('lodash');var util=require(_0xc901('0x0'));var logger=require(_0xc901('0x1'))(_0xc901('0x2'));var moment=require('moment');var BPromise=require(_0xc901('0x3'));var rp=require(_0xc901('0x4'));var fs=require('fs');var path=require(_0xc901('0x5'));var rimraf=require(_0xc901('0x6'));var config=require(_0xc901('0x7'));var attributes=require('./voiceContext.attributes');module[_0xc901('0x8')]=function(_0xbcfead,_0x1f36cd){return _0xbcfead[_0xc901('0x9')](_0xc901('0xa'),attributes,{'tableName':_0xc901('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x355e=['request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','bluebird'];(function(_0x1df185,_0x30a732){var _0x19925d=function(_0x3b826b){while(--_0x3b826b){_0x1df185['push'](_0x1df185['shift']());}};_0x19925d(++_0x30a732);}(_0x355e,0xe6));var _0xe355=function(_0x17875c,_0x20f12f){_0x17875c=_0x17875c-0x0;var _0x9b46ef=_0x355e[_0x17875c];return _0x9b46ef;};'use strict';var _=require(_0xe355('0x0'));var util=require(_0xe355('0x1'));var logger=require(_0xe355('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe355('0x3'));var rp=require(_0xe355('0x4'));var fs=require('fs');var path=require(_0xe355('0x5'));var rimraf=require(_0xe355('0x6'));var config=require(_0xe355('0x7'));var attributes=require(_0xe355('0x8'));module[_0xe355('0x9')]=function(_0x1a16cc,_0x3fbdc3){return _0x1a16cc[_0xe355('0xa')](_0xe355('0xb'),attributes,{'tableName':_0xe355('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 3f507cc..99fced6 100644 --- a/server/api/voiceContext/voiceContext.rpc.js +++ b/server/api/voiceContext/voiceContext.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3077=['catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x3077,0x144));var _0x7307=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x3077[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0x7307('0x0'));var util=require('util');var moment=require(_0x7307('0x1'));var BPromise=require('bluebird');var rs=require(_0x7307('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7307('0x3'))['db'];var utils=require(_0x7307('0x4'));var logger=require(_0x7307('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c88b0,_0x1a69af,_0x3c8eac){return new BPromise(function(_0x1ccb64,_0x413b45){return client[_0x7307('0x6')](_0x3c88b0,_0x3c8eac)[_0x7307('0x7')](function(_0x3631aa){logger[_0x7307('0x8')](_0x7307('0x9'),_0x1a69af,_0x7307('0xa'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x1a69af,_0x7307('0xa'),JSON[_0x7307('0xb')](_0x3631aa));if(_0x3631aa[_0x7307('0xc')]){if(_0x3631aa[_0x7307('0xc')][_0x7307('0xd')]===0x1f4){logger[_0x7307('0xc')](_0x7307('0x9'),_0x1a69af,_0x3631aa[_0x7307('0xc')][_0x7307('0xe')]);return _0x413b45(_0x3631aa[_0x7307('0xc')][_0x7307('0xe')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x1a69af,_0x3631aa[_0x7307('0xc')]['message']);return _0x1ccb64(_0x3631aa[_0x7307('0xc')][_0x7307('0xe')]);}else{logger['info'](_0x7307('0x9'),_0x1a69af,'request\x20sent');_0x1ccb64(_0x3631aa[_0x7307('0xf')][_0x7307('0xe')]);}})[_0x7307('0x10')](function(_0x121dee){logger[_0x7307('0xc')]('VoiceContext,\x20%s,\x20%s',_0x1a69af,_0x121dee);_0x413b45(_0x121dee);});});} \ No newline at end of file +var _0x457b=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x4c4376,_0x104803){var _0x5755d2=function(_0xbc7be3){while(--_0xbc7be3){_0x4c4376['push'](_0x4c4376['shift']());}};_0x5755d2(++_0x104803);}(_0x457b,0xca));var _0xb457=function(_0x27c436,_0x283d5f){_0x27c436=_0x27c436-0x0;var _0x453a21=_0x457b[_0x27c436];return _0x453a21;};'use strict';var _=require(_0xb457('0x0'));var util=require(_0xb457('0x1'));var moment=require('moment');var BPromise=require(_0xb457('0x2'));var rs=require(_0xb457('0x3'));var fs=require('fs');var Redis=require(_0xb457('0x4'));var db=require(_0xb457('0x5'))['db'];var utils=require(_0xb457('0x6'));var logger=require('../../config/logger')(_0xb457('0x7'));var config=require(_0xb457('0x8'));var jayson=require(_0xb457('0x9'));var client=jayson[_0xb457('0xa')][_0xb457('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x523e05,_0x5b8ba2,_0x13632b){return new BPromise(function(_0x2182d6,_0x48388c){return client['request'](_0x523e05,_0x13632b)[_0xb457('0xc')](function(_0x3baee8){logger[_0xb457('0xd')](_0xb457('0xe'),_0x5b8ba2,_0xb457('0xf'));logger[_0xb457('0x10')](_0xb457('0x11'),_0x5b8ba2,_0xb457('0xf'),JSON[_0xb457('0x12')](_0x3baee8));if(_0x3baee8[_0xb457('0x13')]){if(_0x3baee8[_0xb457('0x13')][_0xb457('0x14')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x5b8ba2,_0x3baee8[_0xb457('0x13')][_0xb457('0x15')]);return _0x48388c(_0x3baee8[_0xb457('0x13')][_0xb457('0x15')]);}logger[_0xb457('0x13')]('VoiceContext,\x20%s,\x20%s',_0x5b8ba2,_0x3baee8['error'][_0xb457('0x15')]);return _0x2182d6(_0x3baee8[_0xb457('0x13')][_0xb457('0x15')]);}else{logger[_0xb457('0xd')]('VoiceContext,\x20%s,\x20%s',_0x5b8ba2,_0xb457('0xf'));_0x2182d6(_0x3baee8[_0xb457('0x16')][_0xb457('0x15')]);}})[_0xb457('0x17')](function(_0x250a02){logger[_0xb457('0x13')](_0xb457('0xe'),_0x5b8ba2,_0x250a02);_0x48388c(_0x250a02);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index ef848fc..2b5499f 100644 --- a/server/api/voiceDialReport/index.js +++ b/server/api/voiceDialReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f64=['destroy','path','express','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','get','/describe','/:id','show','post'];(function(_0x476017,_0x198f41){var _0x5bed12=function(_0x317957){while(--_0x317957){_0x476017['push'](_0x476017['shift']());}};_0x5bed12(++_0x198f41);}(_0x5f64,0x1eb));var _0x45f6=function(_0x7ad6cb,_0xffee6c){_0x7ad6cb=_0x7ad6cb-0x0;var _0x22a0ba=_0x5f64[_0x7ad6cb];return _0x22a0ba;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x45f6('0x0'));var timeout=require('connect-timeout');var express=require(_0x45f6('0x1'));var router=express['Router']();var fs_extra=require(_0x45f6('0x2'));var auth=require(_0x45f6('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x45f6('0x4'));var controller=require(_0x45f6('0x5'));router['get']('/',auth[_0x45f6('0x6')](),controller[_0x45f6('0x7')]);router[_0x45f6('0x8')](_0x45f6('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x45f6('0x8')](_0x45f6('0xa'),auth[_0x45f6('0x6')](),controller[_0x45f6('0xb')]);router[_0x45f6('0xc')]('/',auth[_0x45f6('0x6')](),controller['create']);router['put'](_0x45f6('0xa'),auth[_0x45f6('0x6')](),controller['update']);router['delete'](_0x45f6('0xa'),auth[_0x45f6('0x6')](),controller[_0x45f6('0xd')]);module['exports']=router; \ No newline at end of file +var _0x67b3=['/:id','post','create','put','update','delete','destroy','exports','multer','fs-extra','../../components/interaction/service','./voiceDialReport.controller','get','index','isAuthenticated','describe'];(function(_0x3aeb36,_0x312dc9){var _0xa2ef21=function(_0x50a46b){while(--_0x50a46b){_0x3aeb36['push'](_0x3aeb36['shift']());}};_0xa2ef21(++_0x312dc9);}(_0x67b3,0x98));var _0x367b=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0x67b3[_0x209fcd];return _0x501d5e;};'use strict';var multer=require(_0x367b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x367b('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x367b('0x2'));var config=require('../../config/environment');var controller=require(_0x367b('0x3'));router[_0x367b('0x4')]('/',auth['isAuthenticated'](),controller[_0x367b('0x5')]);router[_0x367b('0x4')]('/describe',auth[_0x367b('0x6')](),controller[_0x367b('0x7')]);router[_0x367b('0x4')](_0x367b('0x8'),auth[_0x367b('0x6')](),controller['show']);router[_0x367b('0x9')]('/',auth[_0x367b('0x6')](),controller[_0x367b('0xa')]);router[_0x367b('0xb')]('/:id',auth[_0x367b('0x6')](),controller[_0x367b('0xc')]);router[_0x367b('0xd')](_0x367b('0x8'),auth[_0x367b('0x6')](),controller[_0x367b('0xe')]);module[_0x367b('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 40dd789..68cae6a 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['DATE','sequelize','STRING','INTEGER'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x3e74,0x175));var _0x43e7=function(_0x5a96af,_0xae081f){_0x5a96af=_0x5a96af-0x0;var _0x261508=_0x3e74[_0x5a96af];return _0x261508;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x43e7('0x1')]},'channel':{'type':Sequelize[_0x43e7('0x1')]},'channelstate':{'type':Sequelize[_0x43e7('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43e7('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x43e7('0x1')]},'language':{'type':Sequelize[_0x43e7('0x1')]},'accountcode':{'type':Sequelize[_0x43e7('0x1')]},'context':{'type':Sequelize[_0x43e7('0x1')]},'exten':{'type':Sequelize[_0x43e7('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x43e7('0x1')]},'linkedid':{'type':Sequelize[_0x43e7('0x1')]},'destchannel':{'type':Sequelize[_0x43e7('0x1')]},'destchannelstate':{'type':Sequelize[_0x43e7('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x43e7('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x43e7('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x43e7('0x1')]},'destaccountcode':{'type':Sequelize[_0x43e7('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x43e7('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x43e7('0x1')]},'destlinkedid':{'type':Sequelize[_0x43e7('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x43e7('0x1')]},'starttime':{'type':Sequelize[_0x43e7('0x3')]},'answertime':{'type':Sequelize[_0x43e7('0x3')]},'endtime':{'type':Sequelize[_0x43e7('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x43e7('0x2')]},'duration':{'type':Sequelize[_0x43e7('0x2')]},'holdtime':{'type':Sequelize[_0x43e7('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x55ca=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x13303e,_0x2e3b8c){var _0x37ee00=function(_0x1f2e52){while(--_0x1f2e52){_0x13303e['push'](_0x13303e['shift']());}};_0x37ee00(++_0x2e3b8c);}(_0x55ca,0x126));var _0xa55c=function(_0x3b2397,_0x4d52e8){_0x3b2397=_0x3b2397-0x0;var _0x4a81ea=_0x55ca[_0x3b2397];return _0x4a81ea;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'calleridnum':{'type':Sequelize[_0xa55c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa55c('0x2')]},'connectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'language':{'type':Sequelize[_0xa55c('0x2')]},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'context':{'type':Sequelize[_0xa55c('0x2')]},'exten':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize[_0xa55c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xa55c('0x2')]},'destchannel':{'type':Sequelize[_0xa55c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'destlanguage':{'type':Sequelize[_0xa55c('0x2')]},'destaccountcode':{'type':Sequelize[_0xa55c('0x2')]},'destcontext':{'type':Sequelize[_0xa55c('0x2')]},'destexten':{'type':Sequelize[_0xa55c('0x2')]},'destpriority':{'type':Sequelize[_0xa55c('0x3')]},'destuniqueid':{'type':Sequelize[_0xa55c('0x2')]},'destlinkedid':{'type':Sequelize[_0xa55c('0x2')]},'dialstring':{'type':Sequelize[_0xa55c('0x2')]},'dialstatus':{'type':Sequelize[_0xa55c('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa55c('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xa55c('0x3')]},'holdtime':{'type':Sequelize[_0xa55c('0x3')]},'billableseconds':{'type':Sequelize[_0xa55c('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index c3cff4d..956babf 100644 --- a/server/api/voiceDialReport/voiceDialReport.controller.js +++ b/server/api/voiceDialReport/voiceDialReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84d6=['json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','pick','where','merge','filter','options','VoiceDialReport','includeAll','include','findAll','rows','catch','show','params','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x42930,_0x6d1f3a){var _0x177554=function(_0x9f7b9){while(--_0x9f7b9){_0x42930['push'](_0x42930['shift']());}};_0x177554(++_0x6d1f3a);}(_0x84d6,0x1a3));var _0x684d=function(_0x337cbd,_0x1dd3be){_0x337cbd=_0x337cbd-0x0;var _0x1efe17=_0x84d6[_0x337cbd];return _0x1efe17;};'use strict';var emlformat=require(_0x684d('0x0'));var rimraf=require(_0x684d('0x1'));var zipdir=require(_0x684d('0x2'));var jsonpatch=require(_0x684d('0x3'));var rp=require(_0x684d('0x4'));var moment=require('moment');var BPromise=require(_0x684d('0x5'));var Mustache=require(_0x684d('0x6'));var util=require('util');var path=require(_0x684d('0x7'));var sox=require(_0x684d('0x8'));var csv=require(_0x684d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x684d('0xa'));var _=require('lodash');var squel=require(_0x684d('0xb'));var crypto=require(_0x684d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x684d('0x9'));var querystring=require(_0x684d('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x684d('0xe'));var qs=require(_0x684d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x684d('0x10'));var logger=require(_0x684d('0x11'))(_0x684d('0x12'));var utils=require('../../config/utils');var config=require(_0x684d('0x13'));var licenseUtil=require(_0x684d('0x14'));var db=require(_0x684d('0x15'))['db'];function respondWithStatusCode(_0x446cc7,_0x4f25a6){_0x4f25a6=_0x4f25a6||0xcc;return function(_0x2b9cf9){if(_0x2b9cf9){return _0x446cc7[_0x684d('0x16')](_0x4f25a6);}return _0x446cc7[_0x684d('0x17')](_0x4f25a6)[_0x684d('0x18')]();};}function respondWithResult(_0x24c94c,_0x592c12){_0x592c12=_0x592c12||0xc8;return function(_0x1bbd7d){if(_0x1bbd7d){return _0x24c94c[_0x684d('0x17')](_0x592c12)[_0x684d('0x19')](_0x1bbd7d);}};}function respondWithFilteredResult(_0xd59ab5,_0xa49cea){return function(_0x217ae0){if(_0x217ae0){var _0x59c4c7=typeof _0xa49cea[_0x684d('0x1a')]===_0x684d('0x1b')&&typeof _0xa49cea['limit']==='undefined';var _0x3b218d=_0x217ae0[_0x684d('0x1c')];var _0x30a2a1=_0x59c4c7?0x0:_0xa49cea['offset'];var _0x3cdd00=_0x59c4c7?_0x217ae0[_0x684d('0x1c')]:_0xa49cea[_0x684d('0x1a')]+_0xa49cea['limit'];var _0x24d2ef;if(_0x3cdd00>=_0x3b218d){_0x3cdd00=_0x3b218d;_0x24d2ef=0xc8;}else{_0x24d2ef=0xce;}_0xd59ab5[_0x684d('0x17')](_0x24d2ef);return _0xd59ab5[_0x684d('0x1d')](_0x684d('0x1e'),_0x30a2a1+'-'+_0x3cdd00+'/'+_0x3b218d)[_0x684d('0x19')](_0x217ae0);}return null;};}function patchUpdates(_0x4d7cd4){return function(_0x492c5d){try{jsonpatch[_0x684d('0x1f')](_0x492c5d,_0x4d7cd4,!![]);}catch(_0x477ba7){return BPromise[_0x684d('0x20')](_0x477ba7);}return _0x492c5d[_0x684d('0x21')]();};}function saveUpdates(_0x3dc50b,_0x3c2447){return function(_0x5dd67a){if(_0x5dd67a){return _0x5dd67a[_0x684d('0x22')](_0x3dc50b)[_0x684d('0x23')](function(_0x53c122){return _0x53c122;});}return null;};}function removeEntity(_0x51481b,_0x53076d){return function(_0x2cb7ef){if(_0x2cb7ef){return _0x2cb7ef[_0x684d('0x24')]()['then'](function(){_0x51481b['status'](0xcc)[_0x684d('0x18')]();});}};}function handleEntityNotFound(_0x13f68c,_0x28e210){return function(_0x224b79){if(!_0x224b79){_0x13f68c[_0x684d('0x16')](0x194);}return _0x224b79;};}function handleError(_0x54909f,_0xe38506){_0xe38506=_0xe38506||0x1f4;return function(_0x4be588){logger[_0x684d('0x25')](_0x4be588[_0x684d('0x26')]);if(_0x4be588['name']){delete _0x4be588[_0x684d('0x27')];}_0x54909f[_0x684d('0x17')](_0xe38506)[_0x684d('0x28')](_0x4be588);};}exports[_0x684d('0x29')]=function(_0x207ae7,_0x251e16){var _0x1bd835={},_0x21d678={},_0x476fb5={'count':0x0,'rows':[]};var _0x3c8722=_[_0x684d('0x2a')](db['VoiceDialReport'][_0x684d('0x2b')],function(_0x4cbc73){return{'name':_0x4cbc73['fieldName'],'type':_0x4cbc73[_0x684d('0x2c')][_0x684d('0x2d')]};});_0x21d678['model']=_[_0x684d('0x2a')](_0x3c8722,_0x684d('0x27'));_0x21d678[_0x684d('0x2e')]=_[_0x684d('0x2f')](_0x207ae7[_0x684d('0x2e')]);_0x21d678[_0x684d('0x30')]=_[_0x684d('0x31')](_0x21d678['model'],_0x21d678[_0x684d('0x2e')]);_0x1bd835[_0x684d('0x32')]=_[_0x684d('0x31')](_0x21d678[_0x684d('0x33')],qs[_0x684d('0x34')](_0x207ae7['query'][_0x684d('0x34')]));_0x1bd835[_0x684d('0x32')]=_0x1bd835[_0x684d('0x32')][_0x684d('0x35')]?_0x1bd835[_0x684d('0x32')]:_0x21d678['model'];if(!_0x207ae7[_0x684d('0x2e')][_0x684d('0x36')](_0x684d('0x37'))){_0x1bd835[_0x684d('0x38')]=qs['limit'](_0x207ae7[_0x684d('0x2e')][_0x684d('0x38')]);_0x1bd835[_0x684d('0x1a')]=qs[_0x684d('0x1a')](_0x207ae7['query'][_0x684d('0x1a')]);}_0x1bd835[_0x684d('0x39')]=qs['sort'](_0x207ae7[_0x684d('0x2e')]['sort']);_0x1bd835['where']=qs[_0x684d('0x30')](_[_0x684d('0x3a')](_0x207ae7[_0x684d('0x2e')],_0x21d678[_0x684d('0x30')]),_0x3c8722);if(_0x207ae7[_0x684d('0x2e')]['filter']){_0x1bd835[_0x684d('0x3b')]=_[_0x684d('0x3c')](_0x1bd835['where'],{'$or':_[_0x684d('0x2a')](_0x3c8722,function(_0x252584){if(_0x252584[_0x684d('0x2c')]!=='VIRTUAL'){var _0x1ef2dc={};_0x1ef2dc[_0x252584[_0x684d('0x27')]]={'$like':'%'+_0x207ae7[_0x684d('0x2e')][_0x684d('0x3d')]+'%'};return _0x1ef2dc;}})});}_0x1bd835=_['merge']({},_0x1bd835,_0x207ae7[_0x684d('0x3e')]);var _0x49fbfa={'where':_0x1bd835[_0x684d('0x3b')]};return db[_0x684d('0x3f')][_0x684d('0x1c')](_0x49fbfa)[_0x684d('0x23')](function(_0x31cc07){_0x476fb5[_0x684d('0x1c')]=_0x31cc07;if(_0x207ae7['query'][_0x684d('0x40')]){_0x1bd835[_0x684d('0x41')]=[{'all':!![]}];}return db[_0x684d('0x3f')][_0x684d('0x42')](_0x1bd835);})['then'](function(_0x5d0b99){_0x476fb5[_0x684d('0x43')]=_0x5d0b99;return _0x476fb5;})[_0x684d('0x23')](respondWithFilteredResult(_0x251e16,_0x1bd835))[_0x684d('0x44')](handleError(_0x251e16,null));};exports[_0x684d('0x45')]=function(_0x433b8c,_0x4a0078){var _0x3dbc67={'raw':!![],'where':{'id':_0x433b8c[_0x684d('0x46')]['id']}},_0x17efd4={};_0x17efd4[_0x684d('0x33')]=_[_0x684d('0x2f')](db[_0x684d('0x3f')][_0x684d('0x2b')]);_0x17efd4[_0x684d('0x2e')]=_['keys'](_0x433b8c[_0x684d('0x2e')]);_0x17efd4['filters']=_[_0x684d('0x31')](_0x17efd4[_0x684d('0x33')],_0x17efd4[_0x684d('0x2e')]);_0x3dbc67['attributes']=_[_0x684d('0x31')](_0x17efd4[_0x684d('0x33')],qs[_0x684d('0x34')](_0x433b8c[_0x684d('0x2e')]['fields']));_0x3dbc67['attributes']=_0x3dbc67[_0x684d('0x32')]['length']?_0x3dbc67['attributes']:_0x17efd4[_0x684d('0x33')];if(_0x433b8c[_0x684d('0x2e')][_0x684d('0x40')]){_0x3dbc67['include']=[{'all':!![]}];}_0x3dbc67=_[_0x684d('0x3c')]({},_0x3dbc67,_0x433b8c[_0x684d('0x3e')]);return db['VoiceDialReport']['find'](_0x3dbc67)[_0x684d('0x23')](handleEntityNotFound(_0x4a0078,null))[_0x684d('0x23')](respondWithResult(_0x4a0078,null))[_0x684d('0x44')](handleError(_0x4a0078,null));};exports['create']=function(_0x50317c,_0x523074){return db[_0x684d('0x3f')]['create'](_0x50317c[_0x684d('0x47')],{})[_0x684d('0x23')](respondWithResult(_0x523074,0xc9))[_0x684d('0x44')](handleError(_0x523074,null));};exports[_0x684d('0x22')]=function(_0x374250,_0x2d38d8){if(_0x374250[_0x684d('0x47')]['id']){delete _0x374250[_0x684d('0x47')]['id'];}return db[_0x684d('0x3f')][_0x684d('0x48')]({'where':{'id':_0x374250[_0x684d('0x46')]['id']}})[_0x684d('0x23')](handleEntityNotFound(_0x2d38d8,null))[_0x684d('0x23')](saveUpdates(_0x374250[_0x684d('0x47')],null))['then'](respondWithResult(_0x2d38d8,null))[_0x684d('0x44')](handleError(_0x2d38d8,null));};exports[_0x684d('0x24')]=function(_0x53c941,_0x117ed6){return db[_0x684d('0x3f')][_0x684d('0x48')]({'where':{'id':_0x53c941[_0x684d('0x46')]['id']}})[_0x684d('0x23')](handleEntityNotFound(_0x117ed6,null))[_0x684d('0x23')](removeEntity(_0x117ed6,null))[_0x684d('0x44')](handleError(_0x117ed6,null));};exports[_0x684d('0x49')]=function(_0x5e4d52,_0x2bed9c){return db[_0x684d('0x3f')]['describe']()[_0x684d('0x23')](respondWithResult(_0x2bed9c,null))[_0x684d('0x44')](handleError(_0x2bed9c,null));}; \ No newline at end of file +var _0xb7b8=['json','apply','reject','update','then','stack','name','send','index','VoiceDialReport','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','limit','sort','where','merge','VIRTUAL','options','include','rows','catch','show','includeAll','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','set'];(function(_0x2237a0,_0x31031d){var _0x382009=function(_0x5bedaf){while(--_0x5bedaf){_0x2237a0['push'](_0x2237a0['shift']());}};_0x382009(++_0x31031d);}(_0xb7b8,0x74));var _0x8b7b=function(_0x548177,_0x5d2611){_0x548177=_0x548177-0x0;var _0x541f4e=_0xb7b8[_0x548177];return _0x541f4e;};'use strict';var emlformat=require(_0x8b7b('0x0'));var rimraf=require(_0x8b7b('0x1'));var zipdir=require(_0x8b7b('0x2'));var jsonpatch=require(_0x8b7b('0x3'));var rp=require('request-promise');var moment=require(_0x8b7b('0x4'));var BPromise=require(_0x8b7b('0x5'));var Mustache=require('mustache');var util=require(_0x8b7b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8b7b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8b7b('0x8'));var crypto=require(_0x8b7b('0x9'));var jsforce=require(_0x8b7b('0xa'));var deskjs=require(_0x8b7b('0xb'));var toCsv=require(_0x8b7b('0xc'));var querystring=require('querystring');var Papa=require(_0x8b7b('0xd'));var Redis=require(_0x8b7b('0xe'));var authService=require(_0x8b7b('0xf'));var qs=require(_0x8b7b('0x10'));var as=require(_0x8b7b('0x11'));var hardwareService=require(_0x8b7b('0x12'));var logger=require(_0x8b7b('0x13'))(_0x8b7b('0x14'));var utils=require(_0x8b7b('0x15'));var config=require(_0x8b7b('0x16'));var licenseUtil=require(_0x8b7b('0x17'));var db=require(_0x8b7b('0x18'))['db'];function respondWithStatusCode(_0x575b75,_0x1a0931){_0x1a0931=_0x1a0931||0xcc;return function(_0x9d46c){if(_0x9d46c){return _0x575b75[_0x8b7b('0x19')](_0x1a0931);}return _0x575b75['status'](_0x1a0931)[_0x8b7b('0x1a')]();};}function respondWithResult(_0x27e375,_0x272a6f){_0x272a6f=_0x272a6f||0xc8;return function(_0x455bf3){if(_0x455bf3){return _0x27e375[_0x8b7b('0x1b')](_0x272a6f)['json'](_0x455bf3);}};}function respondWithFilteredResult(_0x5b59c7,_0x47ae52){return function(_0x34b42d){if(_0x34b42d){var _0x13a284=typeof _0x47ae52['offset']===_0x8b7b('0x1c')&&typeof _0x47ae52['limit']==='undefined';var _0x595833=_0x34b42d[_0x8b7b('0x1d')];var _0x3ee2d=_0x13a284?0x0:_0x47ae52['offset'];var _0x9b4ea3=_0x13a284?_0x34b42d['count']:_0x47ae52[_0x8b7b('0x1e')]+_0x47ae52['limit'];var _0x58618d;if(_0x9b4ea3>=_0x595833){_0x9b4ea3=_0x595833;_0x58618d=0xc8;}else{_0x58618d=0xce;}_0x5b59c7['status'](_0x58618d);return _0x5b59c7[_0x8b7b('0x1f')]('Content-Range',_0x3ee2d+'-'+_0x9b4ea3+'/'+_0x595833)[_0x8b7b('0x20')](_0x34b42d);}return null;};}function patchUpdates(_0x817e24){return function(_0x2c4b71){try{jsonpatch[_0x8b7b('0x21')](_0x2c4b71,_0x817e24,!![]);}catch(_0x394fdb){return BPromise[_0x8b7b('0x22')](_0x394fdb);}return _0x2c4b71['save']();};}function saveUpdates(_0x31b21f,_0x4a1d36){return function(_0x39e45e){if(_0x39e45e){return _0x39e45e[_0x8b7b('0x23')](_0x31b21f)[_0x8b7b('0x24')](function(_0x76caa6){return _0x76caa6;});}return null;};}function removeEntity(_0xd2e0c9,_0x58a43f){return function(_0x32007e){if(_0x32007e){return _0x32007e['destroy']()[_0x8b7b('0x24')](function(){_0xd2e0c9[_0x8b7b('0x1b')](0xcc)[_0x8b7b('0x1a')]();});}};}function handleEntityNotFound(_0x451bad,_0x1d9166){return function(_0xd1cc31){if(!_0xd1cc31){_0x451bad['sendStatus'](0x194);}return _0xd1cc31;};}function handleError(_0x25f0eb,_0x16afe7){_0x16afe7=_0x16afe7||0x1f4;return function(_0x1d678a){logger['error'](_0x1d678a[_0x8b7b('0x25')]);if(_0x1d678a['name']){delete _0x1d678a[_0x8b7b('0x26')];}_0x25f0eb[_0x8b7b('0x1b')](_0x16afe7)[_0x8b7b('0x27')](_0x1d678a);};}exports[_0x8b7b('0x28')]=function(_0x3c875a,_0x14206f){var _0x3e701a={},_0x5b3d87={},_0x6d2cfe={'count':0x0,'rows':[]};var _0x31b7dc=_['map'](db[_0x8b7b('0x29')][_0x8b7b('0x2a')],function(_0x3c6922){return{'name':_0x3c6922[_0x8b7b('0x2b')],'type':_0x3c6922[_0x8b7b('0x2c')][_0x8b7b('0x2d')]};});_0x5b3d87[_0x8b7b('0x2e')]=_[_0x8b7b('0x2f')](_0x31b7dc,_0x8b7b('0x26'));_0x5b3d87['query']=_[_0x8b7b('0x30')](_0x3c875a['query']);_0x5b3d87[_0x8b7b('0x31')]=_['intersection'](_0x5b3d87[_0x8b7b('0x2e')],_0x5b3d87['query']);_0x3e701a['attributes']=_[_0x8b7b('0x32')](_0x5b3d87[_0x8b7b('0x2e')],qs[_0x8b7b('0x33')](_0x3c875a[_0x8b7b('0x34')][_0x8b7b('0x33')]));_0x3e701a['attributes']=_0x3e701a[_0x8b7b('0x35')][_0x8b7b('0x36')]?_0x3e701a[_0x8b7b('0x35')]:_0x5b3d87['model'];if(!_0x3c875a[_0x8b7b('0x34')][_0x8b7b('0x37')](_0x8b7b('0x38'))){_0x3e701a[_0x8b7b('0x39')]=qs[_0x8b7b('0x39')](_0x3c875a[_0x8b7b('0x34')][_0x8b7b('0x39')]);_0x3e701a[_0x8b7b('0x1e')]=qs[_0x8b7b('0x1e')](_0x3c875a[_0x8b7b('0x34')]['offset']);}_0x3e701a['order']=qs[_0x8b7b('0x3a')](_0x3c875a[_0x8b7b('0x34')][_0x8b7b('0x3a')]);_0x3e701a[_0x8b7b('0x3b')]=qs[_0x8b7b('0x31')](_['pick'](_0x3c875a[_0x8b7b('0x34')],_0x5b3d87[_0x8b7b('0x31')]),_0x31b7dc);if(_0x3c875a[_0x8b7b('0x34')]['filter']){_0x3e701a['where']=_[_0x8b7b('0x3c')](_0x3e701a['where'],{'$or':_['map'](_0x31b7dc,function(_0xced43f){if(_0xced43f[_0x8b7b('0x2c')]!==_0x8b7b('0x3d')){var _0x1604bd={};_0x1604bd[_0xced43f[_0x8b7b('0x26')]]={'$like':'%'+_0x3c875a['query']['filter']+'%'};return _0x1604bd;}})});}_0x3e701a=_['merge']({},_0x3e701a,_0x3c875a[_0x8b7b('0x3e')]);var _0x19e916={'where':_0x3e701a[_0x8b7b('0x3b')]};return db[_0x8b7b('0x29')][_0x8b7b('0x1d')](_0x19e916)[_0x8b7b('0x24')](function(_0x15170b){_0x6d2cfe[_0x8b7b('0x1d')]=_0x15170b;if(_0x3c875a['query']['includeAll']){_0x3e701a[_0x8b7b('0x3f')]=[{'all':!![]}];}return db[_0x8b7b('0x29')]['findAll'](_0x3e701a);})[_0x8b7b('0x24')](function(_0x5565e0){_0x6d2cfe[_0x8b7b('0x40')]=_0x5565e0;return _0x6d2cfe;})[_0x8b7b('0x24')](respondWithFilteredResult(_0x14206f,_0x3e701a))[_0x8b7b('0x41')](handleError(_0x14206f,null));};exports[_0x8b7b('0x42')]=function(_0x4a80bd,_0x7c93f0){var _0x3a7547={'raw':!![],'where':{'id':_0x4a80bd['params']['id']}},_0x477917={};_0x477917[_0x8b7b('0x2e')]=_['keys'](db['VoiceDialReport'][_0x8b7b('0x2a')]);_0x477917[_0x8b7b('0x34')]=_[_0x8b7b('0x30')](_0x4a80bd[_0x8b7b('0x34')]);_0x477917[_0x8b7b('0x31')]=_[_0x8b7b('0x32')](_0x477917[_0x8b7b('0x2e')],_0x477917['query']);_0x3a7547[_0x8b7b('0x35')]=_[_0x8b7b('0x32')](_0x477917[_0x8b7b('0x2e')],qs[_0x8b7b('0x33')](_0x4a80bd[_0x8b7b('0x34')][_0x8b7b('0x33')]));_0x3a7547[_0x8b7b('0x35')]=_0x3a7547[_0x8b7b('0x35')][_0x8b7b('0x36')]?_0x3a7547['attributes']:_0x477917[_0x8b7b('0x2e')];if(_0x4a80bd[_0x8b7b('0x34')][_0x8b7b('0x43')]){_0x3a7547[_0x8b7b('0x3f')]=[{'all':!![]}];}_0x3a7547=_[_0x8b7b('0x3c')]({},_0x3a7547,_0x4a80bd[_0x8b7b('0x3e')]);return db['VoiceDialReport'][_0x8b7b('0x44')](_0x3a7547)[_0x8b7b('0x24')](handleEntityNotFound(_0x7c93f0,null))[_0x8b7b('0x24')](respondWithResult(_0x7c93f0,null))['catch'](handleError(_0x7c93f0,null));};exports[_0x8b7b('0x45')]=function(_0x11a460,_0x25647d){return db['VoiceDialReport'][_0x8b7b('0x45')](_0x11a460[_0x8b7b('0x46')],{})[_0x8b7b('0x24')](respondWithResult(_0x25647d,0xc9))[_0x8b7b('0x41')](handleError(_0x25647d,null));};exports[_0x8b7b('0x23')]=function(_0x2b6cbf,_0x139407){if(_0x2b6cbf[_0x8b7b('0x46')]['id']){delete _0x2b6cbf['body']['id'];}return db[_0x8b7b('0x29')]['find']({'where':{'id':_0x2b6cbf[_0x8b7b('0x47')]['id']}})[_0x8b7b('0x24')](handleEntityNotFound(_0x139407,null))['then'](saveUpdates(_0x2b6cbf[_0x8b7b('0x46')],null))['then'](respondWithResult(_0x139407,null))['catch'](handleError(_0x139407,null));};exports[_0x8b7b('0x48')]=function(_0x28419a,_0x17e227){return db[_0x8b7b('0x29')][_0x8b7b('0x44')]({'where':{'id':_0x28419a[_0x8b7b('0x47')]['id']}})[_0x8b7b('0x24')](handleEntityNotFound(_0x17e227,null))['then'](removeEntity(_0x17e227,null))['catch'](handleError(_0x17e227,null));};exports[_0x8b7b('0x49')]=function(_0x4f9194,_0x3c76bd){return db[_0x8b7b('0x29')][_0x8b7b('0x49')]()[_0x8b7b('0x24')](respondWithResult(_0x3c76bd,null))[_0x8b7b('0x41')](handleError(_0x3c76bd,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 42ccf25..4d317e9 100644 --- a/server/api/voiceDialReport/voiceDialReport.model.js +++ b/server/api/voiceDialReport/voiceDialReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a21=['../../config/environment','./voiceDialReport.attributes','define','report_dial','uniqueid','util','api','moment','request-promise','path','rimraf'];(function(_0x5721d6,_0x180f81){var _0x1acf45=function(_0xb44bcb){while(--_0xb44bcb){_0x5721d6['push'](_0x5721d6['shift']());}};_0x1acf45(++_0x180f81);}(_0x0a21,0x9f));var _0x10a2=function(_0x591ff3,_0x5ac4d5){_0x591ff3=_0x591ff3-0x0;var _0x2ce654=_0x0a21[_0x591ff3];return _0x2ce654;};'use strict';var _=require('lodash');var util=require(_0x10a2('0x0'));var logger=require('../../config/logger')(_0x10a2('0x1'));var moment=require(_0x10a2('0x2'));var BPromise=require('bluebird');var rp=require(_0x10a2('0x3'));var fs=require('fs');var path=require(_0x10a2('0x4'));var rimraf=require(_0x10a2('0x5'));var config=require(_0x10a2('0x6'));var attributes=require(_0x10a2('0x7'));module['exports']=function(_0x41195e,_0x4d14d0){return _0x41195e[_0x10a2('0x8')]('VoiceDialReport',attributes,{'tableName':_0x10a2('0x9'),'paranoid':![],'indexes':[{'fields':[_0x10a2('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9d5d=['path','rimraf','./voiceDialReport.attributes','exports','define','report_dial','uniqueid','lodash','bluebird','request-promise'];(function(_0x5ef869,_0x20cb89){var _0x51d3cb=function(_0xfaa1d2){while(--_0xfaa1d2){_0x5ef869['push'](_0x5ef869['shift']());}};_0x51d3cb(++_0x20cb89);}(_0x9d5d,0x1dd));var _0xd9d5=function(_0xd126b8,_0x2b91c8){_0xd126b8=_0xd126b8-0x0;var _0x5043fa=_0x9d5d[_0xd126b8];return _0x5043fa;};'use strict';var _=require(_0xd9d5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd9d5('0x1'));var rp=require(_0xd9d5('0x2'));var fs=require('fs');var path=require(_0xd9d5('0x3'));var rimraf=require(_0xd9d5('0x4'));var config=require('../../config/environment');var attributes=require(_0xd9d5('0x5'));module[_0xd9d5('0x6')]=function(_0x419998,_0x49c462){return _0x419998[_0xd9d5('0x7')]('VoiceDialReport',attributes,{'tableName':_0xd9d5('0x8'),'paranoid':![],'indexes':[{'fields':[_0xd9d5('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 06ed9a0..f4c4adc 100644 --- a/server/api/voiceDialReport/voiceDialReport.rpc.js +++ b/server/api/voiceDialReport/voiceDialReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1109=['client','http','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateVoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','limit','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x2489c6,_0x4182c9){var _0x1bb1d6=function(_0x5c613f){while(--_0x5c613f){_0x2489c6['push'](_0x2489c6['shift']());}};_0x1bb1d6(++_0x4182c9);}(_0x1109,0x106));var _0x9110=function(_0x1aed01,_0x3b59f3){_0x1aed01=_0x1aed01-0x0;var _0x34ccb8=_0x1109[_0x1aed01];return _0x34ccb8;};'use strict';var _=require(_0x9110('0x0'));var util=require(_0x9110('0x1'));var moment=require(_0x9110('0x2'));var BPromise=require('bluebird');var rs=require(_0x9110('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9110('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9110('0x5'));var config=require(_0x9110('0x6'));var jayson=require(_0x9110('0x7'));var client=jayson[_0x9110('0x8')][_0x9110('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf4ebe4,_0x7ae71d,_0x48d243){return new BPromise(function(_0x179de0,_0x2812fa){return client['request'](_0xf4ebe4,_0x48d243)[_0x9110('0xa')](function(_0xf8803a){logger[_0x9110('0xb')](_0x9110('0xc'),_0x7ae71d,'request\x20sent');logger[_0x9110('0xd')](_0x9110('0xe'),_0x7ae71d,'request\x20sent',JSON[_0x9110('0xf')](_0xf8803a));if(_0xf8803a[_0x9110('0x10')]){if(_0xf8803a['error'][_0x9110('0x11')]===0x1f4){logger[_0x9110('0x10')](_0x9110('0xc'),_0x7ae71d,_0xf8803a[_0x9110('0x10')][_0x9110('0x12')]);return _0x2812fa(_0xf8803a[_0x9110('0x10')][_0x9110('0x12')]);}logger[_0x9110('0x10')](_0x9110('0xc'),_0x7ae71d,_0xf8803a['error'][_0x9110('0x12')]);return _0x179de0(_0xf8803a[_0x9110('0x10')][_0x9110('0x12')]);}else{logger[_0x9110('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x7ae71d,_0x9110('0x13'));_0x179de0(_0xf8803a[_0x9110('0x14')][_0x9110('0x12')]);}})[_0x9110('0x15')](function(_0x465f78){logger[_0x9110('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x7ae71d,_0x465f78);_0x2812fa(_0x465f78);});});}exports[_0x9110('0x16')]=function(_0x266935){var _0x2d883f=this;return new Promise(function(_0x21c1e0,_0x7bc810){return db['VoiceDialReport'][_0x9110('0x17')](_0x266935[_0x9110('0x18')],{'raw':_0x266935['options']?_0x266935[_0x9110('0x19')][_0x9110('0x1a')]===undefined?!![]:![]:!![]})[_0x9110('0xa')](function(_0x20c5bb){logger[_0x9110('0xb')](_0x9110('0x16'),_0x266935);logger[_0x9110('0xd')](_0x9110('0x16'),_0x266935,JSON[_0x9110('0xf')](_0x20c5bb));_0x21c1e0(_0x20c5bb);})['catch'](function(_0x2560be){logger['error'](_0x9110('0x16'),_0x2560be[_0x9110('0x12')],_0x266935);_0x7bc810(_0x2d883f[_0x9110('0x10')](0x1f4,_0x2560be[_0x9110('0x12')]));});});};exports[_0x9110('0x1b')]=function(_0xb637b4){var _0xbbd2c4=this;return new Promise(function(_0x1fbdff,_0x571611){return db['VoiceDialReport'][_0x9110('0x1c')](_0xb637b4[_0x9110('0x18')],{'raw':_0xb637b4['options']?_0xb637b4[_0x9110('0x19')][_0x9110('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb637b4[_0x9110('0x19')]?_0xb637b4['options']['where']||null:null,'attributes':_0xb637b4[_0x9110('0x19')]?_0xb637b4[_0x9110('0x19')]['attributes']||null:null,'limit':_0xb637b4[_0x9110('0x19')]?_0xb637b4[_0x9110('0x19')][_0x9110('0x1d')]||null:null})['then'](function(_0x39bbf0){logger[_0x9110('0xb')](_0x9110('0x1b'),_0xb637b4);logger[_0x9110('0xd')]('UpdateVoiceDialReport',_0xb637b4,JSON['stringify'](_0x39bbf0));_0x1fbdff(_0x39bbf0);})[_0x9110('0x15')](function(_0x3dedfe){logger[_0x9110('0x10')](_0x9110('0x1b'),_0x3dedfe[_0x9110('0x12')],_0xb637b4);_0x571611(_0xbbd2c4['error'](0x1f4,_0x3dedfe['message']));});});}; \ No newline at end of file +var _0x2b47=['info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','raw','UpdateVoiceDialReport','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then'];(function(_0x520481,_0x44fa8e){var _0x2e9eed=function(_0x58ec88){while(--_0x58ec88){_0x520481['push'](_0x520481['shift']());}};_0x2e9eed(++_0x44fa8e);}(_0x2b47,0x1d1));var _0x72b4=function(_0x180143,_0x523d84){_0x180143=_0x180143-0x0;var _0x9aa6ed=_0x2b47[_0x180143];return _0x9aa6ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x72b4('0x0'));var BPromise=require(_0x72b4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x72b4('0x2'));var db=require(_0x72b4('0x3'))['db'];var utils=require(_0x72b4('0x4'));var logger=require('../../config/logger')(_0x72b4('0x5'));var config=require('../../config/environment');var jayson=require(_0x72b4('0x6'));var client=jayson[_0x72b4('0x7')][_0x72b4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4163f7,_0x591a29,_0x3f37b9){return new BPromise(function(_0x212abf,_0x48ed3d){return client[_0x72b4('0x9')](_0x4163f7,_0x3f37b9)[_0x72b4('0xa')](function(_0x14ccee){logger[_0x72b4('0xb')](_0x72b4('0xc'),_0x591a29,_0x72b4('0xd'));logger[_0x72b4('0xe')](_0x72b4('0xf'),_0x591a29,_0x72b4('0xd'),JSON[_0x72b4('0x10')](_0x14ccee));if(_0x14ccee[_0x72b4('0x11')]){if(_0x14ccee[_0x72b4('0x11')][_0x72b4('0x12')]===0x1f4){logger['error'](_0x72b4('0xc'),_0x591a29,_0x14ccee[_0x72b4('0x11')][_0x72b4('0x13')]);return _0x48ed3d(_0x14ccee[_0x72b4('0x11')][_0x72b4('0x13')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x591a29,_0x14ccee[_0x72b4('0x11')][_0x72b4('0x13')]);return _0x212abf(_0x14ccee[_0x72b4('0x11')][_0x72b4('0x13')]);}else{logger[_0x72b4('0xb')](_0x72b4('0xc'),_0x591a29,_0x72b4('0xd'));_0x212abf(_0x14ccee[_0x72b4('0x14')][_0x72b4('0x13')]);}})[_0x72b4('0x15')](function(_0x5c9820){logger[_0x72b4('0x11')](_0x72b4('0xc'),_0x591a29,_0x5c9820);_0x48ed3d(_0x5c9820);});});}exports[_0x72b4('0x16')]=function(_0x4bb926){var _0xfcc363=this;return new Promise(function(_0x10acb0,_0x1edf57){return db[_0x72b4('0x17')][_0x72b4('0x18')](_0x4bb926['body'],{'raw':_0x4bb926[_0x72b4('0x19')]?_0x4bb926['options'][_0x72b4('0x1a')]===undefined?!![]:![]:!![]})[_0x72b4('0xa')](function(_0x7378c7){logger[_0x72b4('0xb')](_0x72b4('0x16'),_0x4bb926);logger[_0x72b4('0xe')](_0x72b4('0x16'),_0x4bb926,JSON['stringify'](_0x7378c7));_0x10acb0(_0x7378c7);})[_0x72b4('0x15')](function(_0x2840b4){logger['error'](_0x72b4('0x16'),_0x2840b4[_0x72b4('0x13')],_0x4bb926);_0x1edf57(_0xfcc363[_0x72b4('0x11')](0x1f4,_0x2840b4['message']));});});};exports[_0x72b4('0x1b')]=function(_0x2c9c45){var _0x3d7502=this;return new Promise(function(_0x3c28f8,_0x199f44){return db['VoiceDialReport']['update'](_0x2c9c45['body'],{'raw':_0x2c9c45[_0x72b4('0x19')]?_0x2c9c45['options'][_0x72b4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c9c45[_0x72b4('0x19')]?_0x2c9c45[_0x72b4('0x19')]['where']||null:null,'attributes':_0x2c9c45[_0x72b4('0x19')]?_0x2c9c45[_0x72b4('0x19')]['attributes']||null:null,'limit':_0x2c9c45['options']?_0x2c9c45[_0x72b4('0x19')]['limit']||null:null})[_0x72b4('0xa')](function(_0x111a9b){logger[_0x72b4('0xb')](_0x72b4('0x1b'),_0x2c9c45);logger[_0x72b4('0xe')](_0x72b4('0x1b'),_0x2c9c45,JSON['stringify'](_0x111a9b));_0x3c28f8(_0x111a9b);})[_0x72b4('0x15')](function(_0x365273){logger[_0x72b4('0x11')](_0x72b4('0x1b'),_0x365273[_0x72b4('0x13')],_0x2c9c45);_0x199f44(_0x3d7502['error'](0x1f4,_0x365273['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index fce40b9..171b15c 100644 --- a/server/api/voiceExtension/index.js +++ b/server/api/voiceExtension/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b95=['create','/:id/applications','addApplications','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./voiceExtension.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x28d06c,_0xf80378){var _0x594317=function(_0x4f0187){while(--_0x4f0187){_0x28d06c['push'](_0x28d06c['shift']());}};_0x594317(++_0xf80378);}(_0x9b95,0xf7));var _0x59b9=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9b95[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x59b9('0x0'));var util=require(_0x59b9('0x1'));var path=require('path');var timeout=require(_0x59b9('0x2'));var express=require(_0x59b9('0x3'));var router=express[_0x59b9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x59b9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x59b9('0x6'));router['get']('/',auth[_0x59b9('0x7')](),controller[_0x59b9('0x8')]);router[_0x59b9('0x9')](_0x59b9('0xa'),auth[_0x59b9('0x7')](),controller[_0x59b9('0xb')]);router[_0x59b9('0xc')]('/',auth[_0x59b9('0x7')](),controller[_0x59b9('0xd')]);router['post'](_0x59b9('0xe'),auth[_0x59b9('0x7')](),controller[_0x59b9('0xf')]);router[_0x59b9('0x10')](_0x59b9('0xa'),auth['isAuthenticated'](),controller[_0x59b9('0x11')]);router['delete'](_0x59b9('0xa'),auth['isAuthenticated'](),controller[_0x59b9('0x12')]);module[_0x59b9('0x13')]=router; \ No newline at end of file +var _0x10bd=['post','create','/:id/applications','addApplications','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceExtension.controller','get','index','isAuthenticated','show'];(function(_0x561ebe,_0x2335a0){var _0x62617c=function(_0x8304b8){while(--_0x8304b8){_0x561ebe['push'](_0x561ebe['shift']());}};_0x62617c(++_0x2335a0);}(_0x10bd,0x17f));var _0xd10b=function(_0x13d2ef,_0x22e4b5){_0x13d2ef=_0x13d2ef-0x0;var _0x2d859e=_0x10bd[_0x13d2ef];return _0x2d859e;};'use strict';var multer=require(_0xd10b('0x0'));var util=require(_0xd10b('0x1'));var path=require(_0xd10b('0x2'));var timeout=require(_0xd10b('0x3'));var express=require(_0xd10b('0x4'));var router=express[_0xd10b('0x5')]();var fs_extra=require(_0xd10b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd10b('0x7'));var config=require('../../config/environment');var controller=require(_0xd10b('0x8'));router[_0xd10b('0x9')]('/',auth['isAuthenticated'](),controller[_0xd10b('0xa')]);router['get']('/:id',auth[_0xd10b('0xb')](),controller[_0xd10b('0xc')]);router[_0xd10b('0xd')]('/',auth['isAuthenticated'](),controller[_0xd10b('0xe')]);router[_0xd10b('0xd')](_0xd10b('0xf'),auth[_0xd10b('0xb')](),controller[_0xd10b('0x10')]);router['put']('/:id',auth[_0xd10b('0xb')](),controller[_0xd10b('0x11')]);router[_0xd10b('0x12')](_0xd10b('0x13'),auth[_0xd10b('0xb')](),controller[_0xd10b('0x14')]);module[_0xd10b('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index fa11fd9..a78f483 100644 --- a/server/api/voiceExtension/voiceExtension.attributes.js +++ b/server/api/voiceExtension/voiceExtension.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbae4=['exports','compositeIndex','STRING','ENUM','inbound','outbound','inbound-fax','outbound-fax','system','any','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize'];(function(_0x36db65,_0x2b4af1){var _0x5bea6a=function(_0x513889){while(--_0x513889){_0x36db65['push'](_0x36db65['shift']());}};_0x5bea6a(++_0x2b4af1);}(_0xbae4,0x153));var _0x4bae=function(_0x444564,_0x56a452){_0x444564=_0x444564-0x0;var _0x2c58e3=_0xbae4[_0x444564];return _0x2c58e3;};'use strict';var Sequelize=require(_0x4bae('0x0'));module[_0x4bae('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4bae('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4bae('0x3')],'allowNull':![],'unique':_0x4bae('0x2')},'priority':{'type':Sequelize[_0x4bae('0x3')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x4bae('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4bae('0x3')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x4bae('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4bae('0x4')](_0x4bae('0x5'),_0x4bae('0x6'),'internal',_0x4bae('0x7'),_0x4bae('0x8'),_0x4bae('0x9'),_0x4bae('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x4bae('0x3')]},'interval':{'type':Sequelize[_0x4bae('0x3')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x4bae('0xb')]},'isApp':{'type':Sequelize[_0x4bae('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4bae('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x4bae('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0x4bae('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x4bae('0xb')]},'recordingFormat':{'type':Sequelize[_0x4bae('0x3')],'defaultValue':_0x4bae('0xd')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x4bae('0xe')],'get':function(_0x1a99e5){return this[_0x4bae('0xf')](_0x4bae('0x10'));}},'alias':{'type':Sequelize[_0x4bae('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0xf59b=['STRING','compositeIndex','ENUM','outbound','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue','exten','sequelize','exports'];(function(_0x5898be,_0x5a58dc){var _0x31756f=function(_0x5a1bef){while(--_0x5a1bef){_0x5898be['push'](_0x5898be['shift']());}};_0x31756f(++_0x5a58dc);}(_0xf59b,0x15e));var _0xbf59=function(_0x1d7d77,_0x2429c8){_0x1d7d77=_0x1d7d77-0x0;var _0x1451f4=_0xf59b[_0x1d7d77];return _0x1451f4;};'use strict';var Sequelize=require(_0xbf59('0x0'));module[_0xbf59('0x1')]={'context':{'type':Sequelize[_0xbf59('0x2')],'allowNull':![],'unique':_0xbf59('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xbf59('0x2')],'allowNull':![],'unique':_0xbf59('0x3')},'priority':{'type':Sequelize[_0xbf59('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xbf59('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xbf59('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xbf59('0x4')]('inbound',_0xbf59('0x5'),'internal',_0xbf59('0x6'),_0xbf59('0x7'),_0xbf59('0x8'),_0xbf59('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0xbf59('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbf59('0xa')},'IntervalId':{'type':Sequelize[_0xbf59('0xb')]},'isApp':{'type':Sequelize[_0xbf59('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xbf59('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xbf59('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xbf59('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xbf59('0xb')]},'recordingFormat':{'type':Sequelize[_0xbf59('0x2')],'defaultValue':_0xbf59('0xd')},'answer':{'type':Sequelize[_0xbf59('0xc')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1aa310){return this[_0xbf59('0xe')](_0xbf59('0xf'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 39b5734..700866c 100644 --- a/server/api/voiceExtension/voiceExtension.controller.js +++ b/server/api/voiceExtension/voiceExtension.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd17=['findOne','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','undefined','limit','offset','Content-Range','destroy','then','InboundRoutes','InternalRoutes','filter','ignore','map','value','type','find','UserProfileResource','error','stack','name','send','VoiceExtension','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','count','includeAll','include','rows','catch','show','params','rawAttributes','create','body','outbound','startsWith','exten','concat','user','get','inbound','OutboundRoutes','internal','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED'];(function(_0x4f487c,_0x312d09){var _0x5c4f31=function(_0x515efb){while(--_0x515efb){_0x4f487c['push'](_0x4f487c['shift']());}};_0x5c4f31(++_0x312d09);}(_0xcd17,0x17b));var _0x7cd1=function(_0x31c299,_0x2e0b8a){_0x31c299=_0x31c299-0x0;var _0x58f49a=_0xcd17[_0x31c299];return _0x58f49a;};'use strict';var _=require(_0x7cd1('0x0'));var Redis=require('ioredis');var qs=require(_0x7cd1('0x1'));var logger=require(_0x7cd1('0x2'))(_0x7cd1('0x3'));var config=require(_0x7cd1('0x4'));var db=require(_0x7cd1('0x5'))['db'];config[_0x7cd1('0x6')]=_['defaults'](config[_0x7cd1('0x6')],{'host':_0x7cd1('0x7'),'port':0x18eb});var socket=require(_0x7cd1('0x8'))(new Redis(config['redis']));require(_0x7cd1('0x9'))[_0x7cd1('0xa')](socket);function respondWithStatusCode(_0xb202d0,_0x42d251){_0x42d251=_0x42d251||0xcc;return function(_0x232943){if(_0x232943){return _0xb202d0[_0x7cd1('0xb')](_0x42d251);}return _0xb202d0[_0x7cd1('0xc')](_0x42d251)[_0x7cd1('0xd')]();};}function respondWithResult(_0x292678,_0x1937a5){_0x1937a5=_0x1937a5||0xc8;return function(_0x449fd0){if(_0x449fd0){return _0x292678[_0x7cd1('0xc')](_0x1937a5)[_0x7cd1('0xe')](_0x449fd0);}};}function respondWithFilteredResult(_0x5e75ea,_0x2528a7){return function(_0x4a3ba9){if(_0x4a3ba9){var _0x169b49=typeof _0x2528a7['offset']===_0x7cd1('0xf')&&typeof _0x2528a7[_0x7cd1('0x10')]===_0x7cd1('0xf');var _0x1c3dd2=_0x4a3ba9['count'];var _0x3034d0=_0x169b49?0x0:_0x2528a7[_0x7cd1('0x11')];var _0x30a842=_0x169b49?_0x4a3ba9['count']:_0x2528a7['offset']+_0x2528a7[_0x7cd1('0x10')];var _0x5021e4;if(_0x30a842>=_0x1c3dd2){_0x30a842=_0x1c3dd2;_0x5021e4=0xc8;}else{_0x5021e4=0xce;}_0x5e75ea[_0x7cd1('0xc')](_0x5021e4);return _0x5e75ea['set'](_0x7cd1('0x12'),_0x3034d0+'-'+_0x30a842+'/'+_0x1c3dd2)[_0x7cd1('0xe')](_0x4a3ba9);}return null;};}function removeEntity(_0x1afa32){return function(_0x145060){if(_0x145060){return _0x145060[_0x7cd1('0x13')]()[_0x7cd1('0x14')](function(){var _0x48f8b0=_0x145060['get']({'plain':!![]});var _0x5cf206=[{'name':_0x7cd1('0x15'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0x7cd1('0x16'),'value':'internal','ignore':![]}];var _0x32c55f=_(_0x5cf206)[_0x7cd1('0x17')](_0x7cd1('0x18'))[_0x7cd1('0x19')](_0x7cd1('0x1a'))[_0x7cd1('0x1a')]();if(_['includes'](_0x32c55f,_0x48f8b0[_0x7cd1('0x1b')])){return;}var _0x582a98=_[_0x7cd1('0x1c')](_0x5cf206,['value',_0x48f8b0[_0x7cd1('0x1b')]])['name'];return db[_0x7cd1('0x1d')][_0x7cd1('0x13')]({'where':{'type':_0x582a98,'resourceId':_0x48f8b0['id']}})[_0x7cd1('0x14')](function(){return _0x145060;});})['then'](function(){_0x1afa32[_0x7cd1('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17031f){return function(_0x3a9050){if(!_0x3a9050){_0x17031f[_0x7cd1('0xb')](0x194);}return _0x3a9050;};}function handleError(_0x60ced7,_0x2c44d6){_0x2c44d6=_0x2c44d6||0x1f4;return function(_0x2c6732){logger[_0x7cd1('0x1e')](_0x2c6732[_0x7cd1('0x1f')]);if(_0x2c6732[_0x7cd1('0x20')]){delete _0x2c6732['name'];}_0x60ced7[_0x7cd1('0xc')](_0x2c44d6)[_0x7cd1('0x21')](_0x2c6732);};}exports['index']=function(_0x2141e7,_0x275e31){var _0x1749de={},_0x49d78b={},_0x2547fd={'count':0x0,'rows':[]};var _0x5b6fc5=_[_0x7cd1('0x19')](db[_0x7cd1('0x22')]['rawAttributes'],function(_0x360b45){return{'name':_0x360b45[_0x7cd1('0x23')],'type':_0x360b45[_0x7cd1('0x1b')][_0x7cd1('0x24')]};});_0x49d78b[_0x7cd1('0x25')]=_[_0x7cd1('0x19')](_0x5b6fc5,'name');_0x49d78b[_0x7cd1('0x26')]=_['keys'](_0x2141e7[_0x7cd1('0x26')]);_0x49d78b['filters']=_[_0x7cd1('0x27')](_0x49d78b[_0x7cd1('0x25')],_0x49d78b[_0x7cd1('0x26')]);_0x1749de[_0x7cd1('0x28')]=_[_0x7cd1('0x27')](_0x49d78b[_0x7cd1('0x25')],qs['fields'](_0x2141e7[_0x7cd1('0x26')][_0x7cd1('0x29')]));_0x1749de['attributes']=_0x1749de[_0x7cd1('0x28')][_0x7cd1('0x2a')]?_0x1749de[_0x7cd1('0x28')]:_0x49d78b[_0x7cd1('0x25')];if(!_0x2141e7[_0x7cd1('0x26')][_0x7cd1('0x2b')](_0x7cd1('0x2c'))){_0x1749de[_0x7cd1('0x10')]=qs[_0x7cd1('0x10')](_0x2141e7[_0x7cd1('0x26')]['limit']);_0x1749de['offset']=qs[_0x7cd1('0x11')](_0x2141e7[_0x7cd1('0x26')][_0x7cd1('0x11')]);}_0x1749de[_0x7cd1('0x2d')]=qs[_0x7cd1('0x2e')](_0x2141e7[_0x7cd1('0x26')][_0x7cd1('0x2e')]);_0x1749de[_0x7cd1('0x2f')]=qs[_0x7cd1('0x30')](_[_0x7cd1('0x31')](_0x2141e7['query'],_0x49d78b[_0x7cd1('0x30')]),_0x5b6fc5);if(_0x2141e7[_0x7cd1('0x26')][_0x7cd1('0x17')]){_0x1749de['where']=_[_0x7cd1('0x32')](_0x1749de[_0x7cd1('0x2f')],{'$or':_[_0x7cd1('0x19')](_0x5b6fc5,function(_0x27b89a){if(_0x27b89a['type']!=='VIRTUAL'){var _0x3117b9={};_0x3117b9[_0x27b89a[_0x7cd1('0x20')]]={'$like':'%'+_0x2141e7['query']['filter']+'%'};return _0x3117b9;}})});}_0x1749de=_[_0x7cd1('0x32')]({},_0x1749de,_0x2141e7[_0x7cd1('0x33')]);var _0x47d454={'where':_0x1749de[_0x7cd1('0x2f')]};return db[_0x7cd1('0x22')][_0x7cd1('0x34')](_0x47d454)['then'](function(_0x193c8d){_0x2547fd[_0x7cd1('0x34')]=_0x193c8d;if(_0x2141e7[_0x7cd1('0x26')][_0x7cd1('0x35')]){_0x1749de[_0x7cd1('0x36')]=[{'all':!![]}];}return db[_0x7cd1('0x22')]['findAll'](_0x1749de);})[_0x7cd1('0x14')](function(_0x454cbf){_0x2547fd[_0x7cd1('0x37')]=_0x454cbf;return _0x2547fd;})[_0x7cd1('0x14')](respondWithFilteredResult(_0x275e31,_0x1749de))[_0x7cd1('0x38')](handleError(_0x275e31,null));};exports[_0x7cd1('0x39')]=function(_0x2987df,_0x4653c1){var _0x3e9b2f={'raw':![],'where':{'id':_0x2987df[_0x7cd1('0x3a')]['id']}},_0x5e4f09={};_0x5e4f09[_0x7cd1('0x25')]=_['keys'](db[_0x7cd1('0x22')][_0x7cd1('0x3b')]);_0x5e4f09[_0x7cd1('0x26')]=_['keys'](_0x2987df[_0x7cd1('0x26')]);_0x5e4f09['filters']=_[_0x7cd1('0x27')](_0x5e4f09[_0x7cd1('0x25')],_0x5e4f09[_0x7cd1('0x26')]);_0x3e9b2f[_0x7cd1('0x28')]=_[_0x7cd1('0x27')](_0x5e4f09[_0x7cd1('0x25')],qs[_0x7cd1('0x29')](_0x2987df['query'][_0x7cd1('0x29')]));_0x3e9b2f[_0x7cd1('0x28')]=_0x3e9b2f['attributes']['length']?_0x3e9b2f[_0x7cd1('0x28')]:_0x5e4f09[_0x7cd1('0x25')];if(_0x2987df[_0x7cd1('0x26')][_0x7cd1('0x35')]){_0x3e9b2f[_0x7cd1('0x36')]=[{'all':!![]}];}_0x3e9b2f=_[_0x7cd1('0x32')]({},_0x3e9b2f,_0x2987df['options']);return db['VoiceExtension']['find'](_0x3e9b2f)[_0x7cd1('0x14')](handleEntityNotFound(_0x4653c1,null))['then'](respondWithResult(_0x4653c1,null))[_0x7cd1('0x38')](handleError(_0x4653c1,null));};exports[_0x7cd1('0x13')]=function(_0x26a271,_0x120ec9){return db['VoiceExtension'][_0x7cd1('0x1c')]({'where':{'id':_0x26a271['params']['id']}})[_0x7cd1('0x14')](handleEntityNotFound(_0x120ec9,null))[_0x7cd1('0x14')](removeEntity(_0x120ec9,null))[_0x7cd1('0x38')](handleError(_0x120ec9,null));};exports[_0x7cd1('0x3c')]=function(_0xbdece6,_0x2eb1c3){if(_0xbdece6[_0x7cd1('0x3d')][_0x7cd1('0x1b')]===_0x7cd1('0x3e')&&!_[_0x7cd1('0x3f')](_0xbdece6[_0x7cd1('0x3d')][_0x7cd1('0x40')],'_')){_0xbdece6[_0x7cd1('0x3d')][_0x7cd1('0x40')]='_'[_0x7cd1('0x41')](_0xbdece6[_0x7cd1('0x3d')][_0x7cd1('0x40')]);}return db[_0x7cd1('0x22')][_0x7cd1('0x3c')](_0xbdece6[_0x7cd1('0x3d')],{'raw':![]})[_0x7cd1('0x14')](function(_0x13b634){var _0x2fdf50=_0xbdece6[_0x7cd1('0x42')][_0x7cd1('0x43')]({'plain':!![]});if(!_0x2fdf50)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fdf50['role']===_0x7cd1('0x42')){var _0x53f87d=_0x13b634[_0x7cd1('0x43')]({'plain':!![]});var _0x5cdcca=[{'name':_0x7cd1('0x15'),'value':_0x7cd1('0x44')},{'name':_0x7cd1('0x45'),'value':_0x7cd1('0x3e')},{'name':_0x7cd1('0x16'),'value':_0x7cd1('0x46')}];var _0x92ace7=_[_0x7cd1('0x1c')](_0x5cdcca,[_0x7cd1('0x1a'),_0x53f87d[_0x7cd1('0x1b')]])[_0x7cd1('0x20')];return db[_0x7cd1('0x47')]['find']({'where':{'name':_0x92ace7,'userProfileId':_0x2fdf50[_0x7cd1('0x48')]},'raw':!![]})[_0x7cd1('0x14')](function(_0x3d1ffb){if(_0x3d1ffb&&_0x3d1ffb[_0x7cd1('0x49')]===0x0){return db[_0x7cd1('0x1d')]['create']({'name':_0x53f87d[_0x7cd1('0x20')],'resourceId':_0x53f87d['id'],'type':_0x3d1ffb['name'],'sectionId':_0x3d1ffb['id']},{})[_0x7cd1('0x14')](function(){return _0x13b634;});}else{return _0x13b634;}})[_0x7cd1('0x38')](function(_0x1a2e61){logger[_0x7cd1('0x1e')](_0x7cd1('0x4a'),_0x1a2e61);throw _0x1a2e61;});}return _0x13b634;})[_0x7cd1('0x14')](respondWithResult(_0x2eb1c3,0xc9))[_0x7cd1('0x38')](handleError(_0x2eb1c3,null));};exports[_0x7cd1('0x4b')]=function(_0x47788c,_0x421752){if(_0x47788c[_0x7cd1('0x3d')]['id']){delete _0x47788c[_0x7cd1('0x3d')]['id'];}return db[_0x7cd1('0x22')][_0x7cd1('0x1c')]({'where':{'id':_0x47788c[_0x7cd1('0x3a')]['id']}})[_0x7cd1('0x14')](handleEntityNotFound(_0x421752,null))[_0x7cd1('0x14')](function(_0x5a8009){if(_0x5a8009){return db[_0x7cd1('0x22')][_0x7cd1('0x4b')](_[_0x7cd1('0x31')](_0x47788c[_0x7cd1('0x3d')],['exten',_0x7cd1('0x4c'),_0x7cd1('0x4d'),'recordingFormat',_0x7cd1('0x4e'),_0x7cd1('0x4f'),_0x7cd1('0x50')]),{'where':{'context':_0x5a8009[_0x7cd1('0x4c')],'exten':_0x5a8009['exten']},'individualHooks':!![]})[_0x7cd1('0x14')](function(_0x1a6e7b){return _0x1a6e7b;});}return null;})['then'](respondWithStatusCode(_0x421752,null))[_0x7cd1('0x38')](handleError(_0x421752,null));};exports[_0x7cd1('0x51')]=function(_0x1b9c16,_0xb57f8d){var _0x531b47=_0x1b9c16[_0x7cd1('0x3a')]['id'];var _0x23c094=_0x1b9c16['body'];var _0x1e069c=0xc8;var _0x28be3f=null;return db[_0x7cd1('0x52')]['transaction']({'isolationLevel':db[_0x7cd1('0x52')][_0x7cd1('0x53')][_0x7cd1('0x54')][_0x7cd1('0x55')]},function(_0x341381){return db[_0x7cd1('0x22')][_0x7cd1('0x56')]({'where':{'id':_0x531b47},'transaction':_0x341381})[_0x7cd1('0x14')](function(_0x4b896d){if(_0x4b896d){return db[_0x7cd1('0x22')]['destroy']({'where':{'VoiceExtensionId':_0x531b47},'transaction':_0x341381})[_0x7cd1('0x14')](function(){var _0x3a4d6c=_['map'](_0x23c094,function(_0x3edf37){_0x3edf37['VoiceExtensionId']=_0x531b47;_0x3edf37[_0x7cd1('0x57')]=!![];return _0x3edf37;});return _0x4b896d[_0x7cd1('0x58')](_0x3a4d6c);})['then'](function(_0x1d5a7f){return db[_0x7cd1('0x22')][_0x7cd1('0x59')](_0x1d5a7f,{'transaction':_0x341381});});}else{_0x1e069c=0x194;_0x28be3f=[];}});})[_0x7cd1('0x14')](function(){if(_0x1e069c!==0x194){return db[_0x7cd1('0x22')][_0x7cd1('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x531b47},'order':_0x7cd1('0x5b')})[_0x7cd1('0x14')](function(_0xd9d6ee){_0x28be3f=_0xd9d6ee;});}})[_0x7cd1('0x38')](function(_0x1b88be){_0x1e069c=0x1f4;logger[_0x7cd1('0x1e')](_0x1b88be[_0x7cd1('0x1f')]);if(_0x1b88be[_0x7cd1('0x20')]){delete _0x1b88be[_0x7cd1('0x20')];}_0x28be3f=_0x1b88be;})[_0x7cd1('0x5c')](function(){if(_0x28be3f===null){_0xb57f8d[_0x7cd1('0xb')](_0x1e069c);}else{if(_0x1e069c===0x1f4){_0xb57f8d[_0x7cd1('0xc')](_0x1e069c)[_0x7cd1('0x21')](_0x28be3f);}else{_0xb57f8d[_0x7cd1('0xc')](_0x1e069c)[_0x7cd1('0xe')](_0x28be3f);}}});}; \ No newline at end of file +var _0x3835=['where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','options','catch','create','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','OutboundRoutes','outbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','cutdigits','mandatoryDisposition','sequelize','transaction','Transaction','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','destroy','then','get','inbound','InternalRoutes','internal','filter','map','includes','type','find','value','name','UserProfileResource','error','stack','send','VoiceExtension','rawAttributes','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x1dd48a,_0x839bf1){var _0x379d7d=function(_0x1d3409){while(--_0x1d3409){_0x1dd48a['push'](_0x1dd48a['shift']());}};_0x379d7d(++_0x839bf1);}(_0x3835,0x1db));var _0x5383=function(_0x5d9c37,_0x518b93){_0x5d9c37=_0x5d9c37-0x0;var _0x1ba9eb=_0x3835[_0x5d9c37];return _0x1ba9eb;};'use strict';var _=require(_0x5383('0x0'));var Redis=require(_0x5383('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x5383('0x2'))('api');var config=require(_0x5383('0x3'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5383('0x4')](config[_0x5383('0x5')],{'host':_0x5383('0x6'),'port':0x18eb});var socket=require(_0x5383('0x7'))(new Redis(config[_0x5383('0x5')]));require('./voiceExtension.socket')[_0x5383('0x8')](socket);function respondWithStatusCode(_0x363cf8,_0x3bd32){_0x3bd32=_0x3bd32||0xcc;return function(_0x2a0e64){if(_0x2a0e64){return _0x363cf8[_0x5383('0x9')](_0x3bd32);}return _0x363cf8[_0x5383('0xa')](_0x3bd32)[_0x5383('0xb')]();};}function respondWithResult(_0x410ab4,_0x559eae){_0x559eae=_0x559eae||0xc8;return function(_0x3ce92a){if(_0x3ce92a){return _0x410ab4[_0x5383('0xa')](_0x559eae)[_0x5383('0xc')](_0x3ce92a);}};}function respondWithFilteredResult(_0x44dc97,_0x31b5e3){return function(_0x2a50b1){if(_0x2a50b1){var _0x18eacf=typeof _0x31b5e3[_0x5383('0xd')]===_0x5383('0xe')&&typeof _0x31b5e3['limit']===_0x5383('0xe');var _0x13801e=_0x2a50b1[_0x5383('0xf')];var _0x3022a0=_0x18eacf?0x0:_0x31b5e3[_0x5383('0xd')];var _0x129406=_0x18eacf?_0x2a50b1[_0x5383('0xf')]:_0x31b5e3[_0x5383('0xd')]+_0x31b5e3['limit'];var _0x53a7f7;if(_0x129406>=_0x13801e){_0x129406=_0x13801e;_0x53a7f7=0xc8;}else{_0x53a7f7=0xce;}_0x44dc97[_0x5383('0xa')](_0x53a7f7);return _0x44dc97['set']('Content-Range',_0x3022a0+'-'+_0x129406+'/'+_0x13801e)[_0x5383('0xc')](_0x2a50b1);}return null;};}function removeEntity(_0x548525){return function(_0x4ca797){if(_0x4ca797){return _0x4ca797[_0x5383('0x10')]()[_0x5383('0x11')](function(){var _0x196c93=_0x4ca797[_0x5383('0x12')]({'plain':!![]});var _0x35e228=[{'name':'InboundRoutes','value':_0x5383('0x13'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0x5383('0x14'),'value':_0x5383('0x15'),'ignore':![]}];var _0x4c1911=_(_0x35e228)[_0x5383('0x16')]('ignore')[_0x5383('0x17')]('value')['value']();if(_[_0x5383('0x18')](_0x4c1911,_0x196c93[_0x5383('0x19')])){return;}var _0x1e6b80=_[_0x5383('0x1a')](_0x35e228,[_0x5383('0x1b'),_0x196c93[_0x5383('0x19')]])[_0x5383('0x1c')];return db[_0x5383('0x1d')][_0x5383('0x10')]({'where':{'type':_0x1e6b80,'resourceId':_0x196c93['id']}})[_0x5383('0x11')](function(){return _0x4ca797;});})[_0x5383('0x11')](function(){_0x548525[_0x5383('0xa')](0xcc)[_0x5383('0xb')]();});}};}function handleEntityNotFound(_0x32ae53){return function(_0x5b1cc9){if(!_0x5b1cc9){_0x32ae53[_0x5383('0x9')](0x194);}return _0x5b1cc9;};}function handleError(_0x1bf8ab,_0x1387ac){_0x1387ac=_0x1387ac||0x1f4;return function(_0x34c8ae){logger[_0x5383('0x1e')](_0x34c8ae[_0x5383('0x1f')]);if(_0x34c8ae[_0x5383('0x1c')]){delete _0x34c8ae['name'];}_0x1bf8ab[_0x5383('0xa')](_0x1387ac)[_0x5383('0x20')](_0x34c8ae);};}exports['index']=function(_0x2ae80c,_0x2b8fb8){var _0xaf111c={},_0x106e31={},_0x39812d={'count':0x0,'rows':[]};var _0x149291=_[_0x5383('0x17')](db[_0x5383('0x21')][_0x5383('0x22')],function(_0x566980){return{'name':_0x566980['fieldName'],'type':_0x566980[_0x5383('0x19')][_0x5383('0x23')]};});_0x106e31[_0x5383('0x24')]=_[_0x5383('0x17')](_0x149291,_0x5383('0x1c'));_0x106e31['query']=_['keys'](_0x2ae80c[_0x5383('0x25')]);_0x106e31[_0x5383('0x26')]=_[_0x5383('0x27')](_0x106e31['model'],_0x106e31[_0x5383('0x25')]);_0xaf111c['attributes']=_[_0x5383('0x27')](_0x106e31[_0x5383('0x24')],qs[_0x5383('0x28')](_0x2ae80c[_0x5383('0x25')]['fields']));_0xaf111c[_0x5383('0x29')]=_0xaf111c[_0x5383('0x29')]['length']?_0xaf111c[_0x5383('0x29')]:_0x106e31[_0x5383('0x24')];if(!_0x2ae80c[_0x5383('0x25')][_0x5383('0x2a')](_0x5383('0x2b'))){_0xaf111c[_0x5383('0x2c')]=qs[_0x5383('0x2c')](_0x2ae80c['query'][_0x5383('0x2c')]);_0xaf111c[_0x5383('0xd')]=qs[_0x5383('0xd')](_0x2ae80c[_0x5383('0x25')][_0x5383('0xd')]);}_0xaf111c[_0x5383('0x2d')]=qs[_0x5383('0x2e')](_0x2ae80c[_0x5383('0x25')][_0x5383('0x2e')]);_0xaf111c[_0x5383('0x2f')]=qs['filters'](_[_0x5383('0x30')](_0x2ae80c['query'],_0x106e31[_0x5383('0x26')]),_0x149291);if(_0x2ae80c[_0x5383('0x25')][_0x5383('0x16')]){_0xaf111c['where']=_[_0x5383('0x31')](_0xaf111c['where'],{'$or':_[_0x5383('0x17')](_0x149291,function(_0x5a450b){if(_0x5a450b[_0x5383('0x19')]!==_0x5383('0x32')){var _0x39686a={};_0x39686a[_0x5a450b['name']]={'$like':'%'+_0x2ae80c[_0x5383('0x25')]['filter']+'%'};return _0x39686a;}})});}_0xaf111c=_['merge']({},_0xaf111c,_0x2ae80c['options']);var _0x1341a1={'where':_0xaf111c['where']};return db[_0x5383('0x21')][_0x5383('0xf')](_0x1341a1)['then'](function(_0xc322d6){_0x39812d[_0x5383('0xf')]=_0xc322d6;if(_0x2ae80c[_0x5383('0x25')][_0x5383('0x33')]){_0xaf111c[_0x5383('0x34')]=[{'all':!![]}];}return db[_0x5383('0x21')][_0x5383('0x35')](_0xaf111c);})['then'](function(_0x5ccfd6){_0x39812d[_0x5383('0x36')]=_0x5ccfd6;return _0x39812d;})[_0x5383('0x11')](respondWithFilteredResult(_0x2b8fb8,_0xaf111c))['catch'](handleError(_0x2b8fb8,null));};exports['show']=function(_0x289a7a,_0x430d79){var _0x16dace={'raw':![],'where':{'id':_0x289a7a[_0x5383('0x37')]['id']}},_0x17e933={};_0x17e933[_0x5383('0x24')]=_[_0x5383('0x38')](db[_0x5383('0x21')][_0x5383('0x22')]);_0x17e933[_0x5383('0x25')]=_['keys'](_0x289a7a[_0x5383('0x25')]);_0x17e933[_0x5383('0x26')]=_['intersection'](_0x17e933[_0x5383('0x24')],_0x17e933[_0x5383('0x25')]);_0x16dace[_0x5383('0x29')]=_[_0x5383('0x27')](_0x17e933[_0x5383('0x24')],qs[_0x5383('0x28')](_0x289a7a[_0x5383('0x25')][_0x5383('0x28')]));_0x16dace[_0x5383('0x29')]=_0x16dace[_0x5383('0x29')]['length']?_0x16dace[_0x5383('0x29')]:_0x17e933[_0x5383('0x24')];if(_0x289a7a[_0x5383('0x25')]['includeAll']){_0x16dace[_0x5383('0x34')]=[{'all':!![]}];}_0x16dace=_[_0x5383('0x31')]({},_0x16dace,_0x289a7a[_0x5383('0x39')]);return db[_0x5383('0x21')][_0x5383('0x1a')](_0x16dace)[_0x5383('0x11')](handleEntityNotFound(_0x430d79,null))[_0x5383('0x11')](respondWithResult(_0x430d79,null))['catch'](handleError(_0x430d79,null));};exports[_0x5383('0x10')]=function(_0x1c5a55,_0x2011ce){return db['VoiceExtension'][_0x5383('0x1a')]({'where':{'id':_0x1c5a55[_0x5383('0x37')]['id']}})[_0x5383('0x11')](handleEntityNotFound(_0x2011ce,null))[_0x5383('0x11')](removeEntity(_0x2011ce,null))[_0x5383('0x3a')](handleError(_0x2011ce,null));};exports[_0x5383('0x3b')]=function(_0x41658d,_0x41ce3b){if(_0x41658d[_0x5383('0x3c')][_0x5383('0x19')]==='outbound'&&!_['startsWith'](_0x41658d[_0x5383('0x3c')]['exten'],'_')){_0x41658d['body'][_0x5383('0x3d')]='_'[_0x5383('0x3e')](_0x41658d[_0x5383('0x3c')][_0x5383('0x3d')]);}return db[_0x5383('0x21')][_0x5383('0x3b')](_0x41658d[_0x5383('0x3c')],{'raw':![]})[_0x5383('0x11')](function(_0x594f31){var _0x7becd9=_0x41658d[_0x5383('0x3f')][_0x5383('0x12')]({'plain':!![]});if(!_0x7becd9)throw new Error(_0x5383('0x40'));if(_0x7becd9['role']==='user'){var _0x45abb6=_0x594f31[_0x5383('0x12')]({'plain':!![]});var _0x2cc25a=[{'name':'InboundRoutes','value':_0x5383('0x13')},{'name':_0x5383('0x41'),'value':_0x5383('0x42')},{'name':_0x5383('0x14'),'value':_0x5383('0x15')}];var _0x46809c=_[_0x5383('0x1a')](_0x2cc25a,[_0x5383('0x1b'),_0x45abb6[_0x5383('0x19')]])['name'];return db[_0x5383('0x43')][_0x5383('0x1a')]({'where':{'name':_0x46809c,'userProfileId':_0x7becd9[_0x5383('0x44')]},'raw':!![]})[_0x5383('0x11')](function(_0x5d0e04){if(_0x5d0e04&&_0x5d0e04[_0x5383('0x45')]===0x0){return db['UserProfileResource'][_0x5383('0x3b')]({'name':_0x45abb6[_0x5383('0x1c')],'resourceId':_0x45abb6['id'],'type':_0x5d0e04[_0x5383('0x1c')],'sectionId':_0x5d0e04['id']},{})[_0x5383('0x11')](function(){return _0x594f31;});}else{return _0x594f31;}})[_0x5383('0x3a')](function(_0x5ab3b5){logger['error'](_0x5383('0x46'),_0x5ab3b5);throw _0x5ab3b5;});}return _0x594f31;})[_0x5383('0x11')](respondWithResult(_0x41ce3b,0xc9))['catch'](handleError(_0x41ce3b,null));};exports[_0x5383('0x47')]=function(_0x1f4f58,_0x42f6d0){if(_0x1f4f58[_0x5383('0x3c')]['id']){delete _0x1f4f58[_0x5383('0x3c')]['id'];}return db[_0x5383('0x21')]['find']({'where':{'id':_0x1f4f58[_0x5383('0x37')]['id']}})['then'](handleEntityNotFound(_0x42f6d0,null))[_0x5383('0x11')](function(_0x1ae879){if(_0x1ae879){return db[_0x5383('0x21')][_0x5383('0x47')](_['pick'](_0x1f4f58[_0x5383('0x3c')],[_0x5383('0x3d'),_0x5383('0x48'),_0x5383('0x49'),'recordingFormat',_0x5383('0x4a'),_0x5383('0x4b'),'alias']),{'where':{'context':_0x1ae879[_0x5383('0x48')],'exten':_0x1ae879[_0x5383('0x3d')]},'individualHooks':!![]})['then'](function(_0x1e8f7b){return _0x1e8f7b;});}return null;})[_0x5383('0x11')](respondWithStatusCode(_0x42f6d0,null))[_0x5383('0x3a')](handleError(_0x42f6d0,null));};exports['addApplications']=function(_0x4fe1f5,_0x50f826){var _0x207746=_0x4fe1f5['params']['id'];var _0x17c7a9=_0x4fe1f5[_0x5383('0x3c')];var _0x29cbaf=0xc8;var _0x473b5d=null;return db[_0x5383('0x4c')][_0x5383('0x4d')]({'isolationLevel':db[_0x5383('0x4c')][_0x5383('0x4e')]['ISOLATION_LEVELS'][_0x5383('0x4f')]},function(_0x2f3d31){return db[_0x5383('0x21')][_0x5383('0x50')]({'where':{'id':_0x207746},'transaction':_0x2f3d31})[_0x5383('0x11')](function(_0x16c83d){if(_0x16c83d){return db['VoiceExtension'][_0x5383('0x10')]({'where':{'VoiceExtensionId':_0x207746},'transaction':_0x2f3d31})[_0x5383('0x11')](function(){var _0x223621=_['map'](_0x17c7a9,function(_0x163818){_0x163818[_0x5383('0x51')]=_0x207746;_0x163818['isApp']=!![];return _0x163818;});return _0x16c83d[_0x5383('0x52')](_0x223621);})[_0x5383('0x11')](function(_0x26231d){return db[_0x5383('0x21')][_0x5383('0x53')](_0x26231d,{'transaction':_0x2f3d31});});}else{_0x29cbaf=0x194;_0x473b5d=[];}});})[_0x5383('0x11')](function(){if(_0x29cbaf!==0x194){return db[_0x5383('0x21')][_0x5383('0x54')]({'where':{'isApp':!![],'VoiceExtensionId':_0x207746},'order':_0x5383('0x55')})[_0x5383('0x11')](function(_0x5c9abf){_0x473b5d=_0x5c9abf;});}})[_0x5383('0x3a')](function(_0xeb26e0){_0x29cbaf=0x1f4;logger['error'](_0xeb26e0[_0x5383('0x1f')]);if(_0xeb26e0[_0x5383('0x1c')]){delete _0xeb26e0['name'];}_0x473b5d=_0xeb26e0;})[_0x5383('0x56')](function(){if(_0x473b5d===null){_0x50f826[_0x5383('0x9')](_0x29cbaf);}else{if(_0x29cbaf===0x1f4){_0x50f826[_0x5383('0xa')](_0x29cbaf)['send'](_0x473b5d);}else{_0x50f826[_0x5383('0xa')](_0x29cbaf)['json'](_0x473b5d);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 39d8c7e..75f3d62 100644 --- a/server/api/voiceExtension/voiceExtension.events.js +++ b/server/api/voiceExtension/voiceExtension.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4005=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update'];(function(_0x131738,_0x8ff5e){var _0x2ac88f=function(_0x5b4db9){while(--_0x5b4db9){_0x131738['push'](_0x131738['shift']());}};_0x2ac88f(++_0x8ff5e);}(_0x4005,0x144));var _0x5400=function(_0x582b2f,_0x4767a5){_0x582b2f=_0x582b2f-0x0;var _0x336bc1=_0x4005[_0x582b2f];return _0x336bc1;};'use strict';var EventEmitter=require(_0x5400('0x0'));var VoiceExtension=require(_0x5400('0x1'))['db'][_0x5400('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x5400('0x3')](0x0);var events={'afterCreate':_0x5400('0x4'),'afterUpdate':_0x5400('0x5'),'afterDestroy':_0x5400('0x6')};function emitEvent(_0x504cc8){return function(_0x2d2c1c,_0x1719eb,_0xbe0b46){VoiceExtensionEvents[_0x5400('0x7')](_0x504cc8+':'+_0x2d2c1c['id'],_0x2d2c1c);VoiceExtensionEvents['emit'](_0x504cc8,_0x2d2c1c);_0xbe0b46(null);};}for(var e in events){if(events[_0x5400('0x8')](e)){var event=events[e];VoiceExtension[_0x5400('0x9')](e,emitEvent(event));}}module[_0x5400('0xa')]=VoiceExtensionEvents; \ No newline at end of file +var _0x71cd=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x20e6f6,_0x1f8eff){var _0x3ba8aa=function(_0x3d6043){while(--_0x3d6043){_0x20e6f6['push'](_0x20e6f6['shift']());}};_0x3ba8aa(++_0x1f8eff);}(_0x71cd,0x15c));var _0xd71c=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0x71cd[_0x1780f8];return _0x33a410;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xd71c('0x0'))['db'][_0xd71c('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xd71c('0x2')](0x0);var events={'afterCreate':_0xd71c('0x3'),'afterUpdate':_0xd71c('0x4'),'afterDestroy':_0xd71c('0x5')};function emitEvent(_0x523878){return function(_0x24a881,_0x293bbc,_0x37aa52){VoiceExtensionEvents[_0xd71c('0x6')](_0x523878+':'+_0x24a881['id'],_0x24a881);VoiceExtensionEvents[_0xd71c('0x6')](_0x523878,_0x24a881);_0x37aa52(null);};}for(var e in events){if(events[_0xd71c('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xd71c('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 34d4148..68d9636 100644 --- a/server/api/voiceExtension/voiceExtension.model.js +++ b/server/api/voiceExtension/voiceExtension.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x167e=['IntervalId','map','toLowerCase','tag','CDR(tag)=','ExecIf','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress',',${EXTEN},','outboundDial','appdata','priority','last','catch','define','voice_extensions','get','concat','Hangup','lodash','./voiceExtension.attributes','exports','models','Set','CDR(type)=','type','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','split','length','param','phone','prefix','join','options','none','replace','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','then','interval','*,*,*,*','intervals'];(function(_0x11fce4,_0x140020){var _0x3412e6=function(_0x55a637){while(--_0x55a637){_0x11fce4['push'](_0x11fce4['shift']());}};_0x3412e6(++_0x140020);}(_0x167e,0x10c));var _0xe167=function(_0x1c0ced,_0x52f067){_0x1c0ced=_0x1c0ced-0x0;var _0x2689ba=_0x167e[_0x1c0ced];return _0x2689ba;};'use strict';var _=require(_0xe167('0x0'));var attributes=require(_0xe167('0x1'));module[_0xe167('0x2')]=function(_0x9539b1){var _0x2d1911=_0x9539b1[_0xe167('0x3')];function _0x4bbc5d(_0x31d358){var _0x4b4e13=0x2;var _0x4014dd=[{'type':_0x31d358['type'],'app':_0xe167('0x4'),'appdata':_0xe167('0x5')+_0x31d358[_0xe167('0x6')],'context':_0x31d358[_0xe167('0x7')],'exten':_0x31d358[_0xe167('0x8')],'priority':_0x4b4e13++,'VoiceExtensionId':_0x31d358['id']},{'type':_0x31d358[_0xe167('0x6')],'app':_0x31d358[_0xe167('0x9')]?_0xe167('0x4'):_0xe167('0xa'),'appdata':_0x31d358['alias']?_0xe167('0xb')+_0x31d358['alias']:_0xe167('0xc'),'context':_0x31d358[_0xe167('0x7')],'exten':_0x31d358[_0xe167('0x8')],'priority':_0x4b4e13++,'VoiceExtensionId':_0x31d358['id']}];if(_0x31d358[_0xe167('0x6')]==='inbound'){_0x4014dd[_0xe167('0xd')]({'type':_0xe167('0xe'),'app':_0xe167('0x4'),'appdata':_0xe167('0xf')+_0x31d358['id'],'context':_0x31d358[_0xe167('0x7')],'exten':_0x31d358[_0xe167('0x8')],'priority':_0x4b4e13++,'VoiceExtensionId':_0x31d358['id']});}_0x4014dd[_0xe167('0xd')]({'type':_0x31d358[_0xe167('0x6')],'app':_0xe167('0x4'),'appdata':_0xe167('0x10'),'context':_0x31d358[_0xe167('0x7')],'exten':_0x31d358[_0xe167('0x8')],'priority':_0x4b4e13++,'VoiceExtensionId':_0x31d358['id']},{'type':_0x31d358[_0xe167('0x6')],'app':_0xe167('0x4'),'appdata':_0xe167('0x11'),'context':_0x31d358[_0xe167('0x7')],'exten':_0x31d358[_0xe167('0x8')],'priority':_0x4b4e13++,'VoiceExtensionId':_0x31d358['id']},{'type':_0x31d358[_0xe167('0x6')],'app':'Set','appdata':_0xe167('0x12'),'context':_0x31d358['context'],'exten':_0x31d358[_0xe167('0x8')],'priority':_0x4b4e13++,'VoiceExtensionId':_0x31d358['id']});return _0x4014dd;}function _0x163d3f(_0x18d7cd){var _0x239c64=0x2;var _0x4d18d9=[{'type':'outbound','app':_0xe167('0x4'),'appdata':'CDR(type)=outbound','context':_0x18d7cd[_0xe167('0x7')],'exten':_0x18d7cd['exten'],'priority':_0x239c64++,'VoiceExtensionId':_0x18d7cd['id']},{'type':_0xe167('0x13'),'app':_0x18d7cd[_0xe167('0x9')]?_0xe167('0x4'):_0xe167('0xa'),'appdata':_0x18d7cd[_0xe167('0x9')]?_0xe167('0xb')+_0x18d7cd[_0xe167('0x9')]:'No\x20alias\x20set','context':_0x18d7cd['context'],'exten':_0x18d7cd[_0xe167('0x8')],'priority':_0x239c64++,'VoiceExtensionId':_0x18d7cd['id']},{'type':'outbound','app':_0xe167('0x4'),'appdata':_0xe167('0x14')+(_0x18d7cd[_0xe167('0x15')]?_0xe167('0x16')+_0x18d7cd[_0xe167('0x15')]+'}':_0xe167('0x17')),'context':_0x18d7cd[_0xe167('0x7')],'exten':_0x18d7cd[_0xe167('0x8')],'priority':_0x239c64++,'VoiceExtensionId':_0x18d7cd['id']},{'type':_0xe167('0x13'),'app':'Set','appdata':_0xe167('0xf')+_0x18d7cd['id'],'context':_0x18d7cd['context'],'exten':_0x18d7cd[_0xe167('0x8')],'priority':_0x239c64++,'VoiceExtensionId':_0x18d7cd['id']},{'type':_0xe167('0x13'),'app':'ExecIf','appdata':_0xe167('0x18')+(_0x239c64+0x2)+'):Goto('+(_0x239c64+0x1)+')','context':_0x18d7cd[_0xe167('0x7')],'exten':_0x18d7cd[_0xe167('0x8')],'priority':_0x239c64++,'VoiceExtensionId':_0x18d7cd['id']},{'type':'outbound','app':_0xe167('0x4'),'appdata':_0x18d7cd[_0xe167('0x15')]?_0xe167('0x19')+_0x18d7cd[_0xe167('0x15')]+'}':_0xe167('0x1a'),'context':_0x18d7cd['context'],'exten':_0x18d7cd[_0xe167('0x8')],'priority':_0x239c64++,'VoiceExtensionId':_0x18d7cd['id']},{'type':'outbound','app':'Set','appdata':_0xe167('0x10'),'context':_0x18d7cd['context'],'exten':_0x18d7cd[_0xe167('0x8')],'priority':_0x239c64++,'VoiceExtensionId':_0x18d7cd['id']},{'type':_0xe167('0x13'),'app':_0xe167('0x4'),'appdata':_0xe167('0x11'),'context':_0x18d7cd[_0xe167('0x7')],'exten':_0x18d7cd[_0xe167('0x8')],'priority':_0x239c64++,'VoiceExtensionId':_0x18d7cd['id']},{'type':'outbound','app':_0xe167('0x4'),'appdata':_0xe167('0x12'),'context':_0x18d7cd['context'],'exten':_0x18d7cd[_0xe167('0x8')],'priority':_0x239c64++,'VoiceExtensionId':_0x18d7cd['id']},{'type':_0xe167('0x13'),'app':_0xe167('0x4'),'appdata':'outboundrouteid='+_0x18d7cd['id'],'context':_0x18d7cd[_0xe167('0x7')],'exten':_0x18d7cd[_0xe167('0x8')],'priority':_0x239c64++,'VoiceExtensionId':_0x18d7cd['id']}];if(_0x18d7cd[_0xe167('0x1b')](_0xe167('0x1c'))&&_0x18d7cd[_0xe167('0x1c')]!=='none'){_0x4d18d9[_0xe167('0xd')]({'type':_0xe167('0x13'),'app':_0xe167('0x4'),'appdata':_0xe167('0x1d'),'context':_0x18d7cd[_0xe167('0x7')],'exten':_0x18d7cd[_0xe167('0x8')],'priority':_0x239c64++,'VoiceExtensionId':_0x18d7cd['id']},{'type':_0xe167('0x13'),'app':_0xe167('0x4'),'appdata':_0xe167('0x1e')+_0x18d7cd[_0xe167('0x1c')]||_0xe167('0x1f'),'context':_0x18d7cd[_0xe167('0x7')],'exten':_0x18d7cd['exten'],'priority':_0x239c64++,'VoiceExtensionId':_0x18d7cd['id']});}return _0x4d18d9;}function _0x51ed81(_0x34caef,_0x22878c){var _0x224daa=[{'name':_0xe167('0x20'),'param':0x0},{'name':_0xe167('0x21'),'param':0x1},{'name':'options','param':0x2},{'name':_0xe167('0x22'),'param':0x3}];var _0x46a5e0={};var _0x351804=_0x22878c[_0xe167('0x23')](',');var _0x2d635c=[];for(var _0x37b0a6=0x0;_0x37b0a6<_0x224daa[_0xe167('0x24')];_0x37b0a6++){switch(_0x224daa[_0x37b0a6]['name']){case _0xe167('0x20'):_0x46a5e0[_0xe167('0x20')]=_0x351804[_0x224daa[_0x37b0a6][_0xe167('0x25')]][_0xe167('0x23')]('/')[0x1];_0x46a5e0[_0xe167('0x26')]=_0x351804[_0x224daa[_0x37b0a6][_0xe167('0x25')]]['split']('/')[0x2];_0x46a5e0[_0xe167('0x27')]=_0x46a5e0[_0xe167('0x26')]?_0x46a5e0[_0xe167('0x26')][_0xe167('0x23')]('$')[0x0]:undefined;_0x46a5e0['phone']=_0x34caef[_0xe167('0x15')]?(_0x46a5e0[_0xe167('0x27')]||'')+_0xe167('0x16')+_0x34caef[_0xe167('0x15')]+'}':(_0x46a5e0[_0xe167('0x27')]||'')+_0xe167('0x17');_0x2d635c[_0x224daa[_0x37b0a6][_0xe167('0x25')]]=['SIP',_0x46a5e0['trunk'],_0x46a5e0[_0xe167('0x26')]][_0xe167('0x28')]('/');break;case _0xe167('0x29'):_0x46a5e0['options']=_0x351804[_0x224daa[_0x37b0a6][_0xe167('0x25')]];if(_0x34caef[_0xe167('0x1c')]!==_0xe167('0x2a')){if(_0x46a5e0['options']['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x46a5e0[_0xe167('0x29')]+='U(xcally-mixmonitor-context)';}}else{_0x46a5e0['options']=_0x46a5e0['options'][_0xe167('0x2b')](_0xe167('0x2c'),'');}_0x2d635c[_0x224daa[_0x37b0a6][_0xe167('0x25')]]=_0x46a5e0['options'];break;default:_0x2d635c[_0x224daa[_0x37b0a6][_0xe167('0x25')]]=_0x351804[_0x224daa[_0x37b0a6][_0xe167('0x25')]];}}return _0x2d635c[_0xe167('0x28')](',');}function _0x5591c4(_0x531fba,_0xe93305,_0x2423e5){return new Promise(function(_0x2a7970,_0x2e7be2){var _0x56d55f=[];if(_[_0xe167('0x2d')](_0xe93305))return _0x2a7970(_0x56d55f);_0x2d1911[_0xe167('0x2e')][_0xe167('0x2f')]({'attributes':['id','interval','IntervalId'],'raw':!![]})[_0xe167('0x30')](function(_0x1196d6){for(var _0x41b94d=0x0,_0x4f5e75=0x0;_0x41b94d<_0xe93305[_0xe167('0x24')];_0x41b94d++,_0x4f5e75=0x0){var _0x4f810d=_0xe93305[_0x41b94d];var _0x5dea98=[];var _0x2dac9a=[];delete _0x4f810d['id'];if(_0x4f810d[_0xe167('0x31')]!==_0xe167('0x32')){_0x4f810d['intervals']=[_0x4f810d['interval']];}else{_0x4f810d[_0xe167('0x33')]=_0x4f810d[_0xe167('0x34')]?_[_0xe167('0x35')](_['filter'](_0x1196d6,{'IntervalId':_0x4f810d['IntervalId']}),_0xe167('0x31')):[];}_0x4f810d['context']=_0x531fba[_0xe167('0x7')];_0x4f810d[_0xe167('0x8')]=_0x531fba[_0xe167('0x8')];if(_0x4f810d['type'])_0x4f810d[_0xe167('0x6')]=_0x4f810d[_0xe167('0x6')][_0xe167('0x36')]();if(_0x531fba[_0xe167('0x6')]==='outbound'){if(_0x4f810d[_0xe167('0x1b')](_0xe167('0x37'))&&_0x4f810d[_0xe167('0x37')]&&_0x4f810d[_0xe167('0x37')]!=='--'){_0x5dea98[_0xe167('0xd')]({'type':_0x4f810d[_0xe167('0x6')][_0xe167('0x36')](),'app':_0xe167('0x4'),'appdata':_0xe167('0x38')+_0x4f810d[_0xe167('0x37')],'context':_0x531fba[_0xe167('0x7')],'exten':_0x531fba[_0xe167('0x8')],'priority':_0x4f810d[_0xe167('0x33')][_0xe167('0x24')]+_0x2423e5+_0x4f5e75++,'VoiceExtensionId':_0x531fba['id']});}_0x5dea98[_0xe167('0xd')]({'type':_0x4f810d['type']['toLowerCase'](),'app':_0xe167('0x39'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x4f810d['callerID']?_0xe167('0x3a')+_0x4f810d[_0xe167('0x3b')]+')':_0xe167('0x3c')),'context':_0x531fba[_0xe167('0x7')],'exten':_0x531fba[_0xe167('0x8')],'priority':_0x4f810d[_0xe167('0x33')][_0xe167('0x24')]+_0x2423e5+_0x4f5e75++,'VoiceExtensionId':_0x531fba['id']});}else{if(_0x4f810d[_0xe167('0x1b')](_0xe167('0x3d'))){if([_0xe167('0x3e'),_0xe167('0x3f')]['includes'](_0x4f810d['app'][_0xe167('0x36')]())&&_0x4f810d[_0xe167('0x40')]!==_0xe167('0x41')){if(_0x4f810d[_0xe167('0x3d')]){_0x5dea98[_0xe167('0xd')]({'type':_0x4f810d[_0xe167('0x6')][_0xe167('0x36')](),'app':_0xe167('0x39'),'appdata':_0xe167('0x42'),'context':_0x531fba[_0xe167('0x7')],'exten':_0x531fba[_0xe167('0x8')],'priority':_0x4f810d[_0xe167('0x33')][_0xe167('0x24')]+_0x2423e5+_0x4f5e75++,'VoiceExtensionId':_0x531fba['id']});_0x5dea98[_0xe167('0xd')]({'type':_0x4f810d[_0xe167('0x6')][_0xe167('0x36')](),'app':'Set','appdata':_0xe167('0x43'),'context':_0x531fba[_0xe167('0x7')],'exten':_0x531fba[_0xe167('0x8')],'priority':_0x4f810d[_0xe167('0x33')][_0xe167('0x24')]+_0x2423e5+_0x4f5e75++,'VoiceExtensionId':_0x531fba['id']});}else{_0x5dea98[_0xe167('0xd')]({'type':_0x4f810d[_0xe167('0x6')]['toLowerCase'](),'app':'ExecIf','appdata':_0xe167('0x44'),'context':_0x531fba[_0xe167('0x7')],'exten':_0x531fba[_0xe167('0x8')],'priority':_0x4f810d[_0xe167('0x33')][_0xe167('0x24')]+_0x2423e5+_0x4f5e75++,'VoiceExtensionId':_0x531fba['id']});_0x5dea98[_0xe167('0xd')]({'type':_0x4f810d[_0xe167('0x6')][_0xe167('0x36')](),'app':_0xe167('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x531fba[_0xe167('0x7')],'exten':_0x531fba[_0xe167('0x8')],'priority':_0x4f810d[_0xe167('0x33')][_0xe167('0x24')]+_0x2423e5+_0x4f5e75++,'VoiceExtensionId':_0x531fba['id']});}}}}for(var _0x200630=0x0;_0x200630<_0x4f810d[_0xe167('0x33')][_0xe167('0x24')];_0x200630++){var _0x22137b=_0x2423e5+_0x4f810d[_0xe167('0x33')][_0xe167('0x24')];var _0x5adc5d=_0x200630===_0x4f810d[_0xe167('0x33')]['length']-0x1?_0x2423e5+_0x5dea98[_0xe167('0x24')]+_0x2dac9a[_0xe167('0x24')]+0x2:_0x2423e5+_0x200630+0x1;_0x5dea98['splice'](_0x200630,0x0,{'type':_0x531fba[_0xe167('0x6')],'app':'GotoIfTime','appdata':_0x4f810d[_0xe167('0x33')][_0x200630]+'?'+_0x531fba[_0xe167('0x7')]+',${EXTEN},'+_0x22137b+':'+_0x531fba[_0xe167('0x7')]+_0xe167('0x45')+_0x5adc5d,'exten':_0x531fba[_0xe167('0x8')],'context':_0x531fba['context'],'priority':_0x2423e5+_0x200630,'VoiceExtensionId':_0x531fba['id']});}if(_0x4f810d[_0xe167('0x40')]===_0xe167('0x46')){_0x4f810d[_0xe167('0x47')]=_0x51ed81(_0x531fba,_0x4f810d[_0xe167('0x47')]);}if(_0x4f810d[_0xe167('0x40')]==='agi'){_0x5dea98['push']({'type':_0x4f810d[_0xe167('0x6')][_0xe167('0x36')](),'app':_0xe167('0x4'),'appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x531fba[_0xe167('0x7')],'exten':_0x531fba[_0xe167('0x8')],'priority':_0x4f810d[_0xe167('0x33')]['length']+_0x2423e5+_0x4f5e75++,'VoiceExtensionId':_0x531fba['id']});}_0x4f810d[_0xe167('0x48')]=_0x5dea98[_0xe167('0x24')]?_[_0xe167('0x49')](_0x5dea98)[_0xe167('0x48')]+0x1:_0x2423e5;_0x56d55f=_['concat'](_0x56d55f,_0x5dea98,[_0x4f810d],_0x2dac9a);_0x2423e5=_[_0xe167('0x49')](_0x56d55f)['priority']+0x1;}return _0x2a7970(_0x56d55f);})[_0xe167('0x4a')](function(_0xf07ff3){_0x2e7be2(_0xf07ff3);});});}return _0x9539b1[_0xe167('0x4b')]('VoiceExtension',attributes,{'tableName':_0xe167('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x445936){var _0x2a6abd=this[_0xe167('0x4d')]({'plain':!![]});var _0x5853eb=_0x2a6abd[_0xe167('0x6')]==='outbound'?_0x163d3f(_0x2a6abd):_0x4bbc5d(_0x2a6abd);return _0x5591c4(_0x2a6abd,_0x445936,_[_0xe167('0x49')](_0x5853eb)[_0xe167('0x48')]+0x1)[_0xe167('0x30')](function(_0x2cabb3){var _0x1015cb=_[_0xe167('0x4e')](_0x5853eb,_0x2cabb3);_0x1015cb[_0xe167('0xd')]({'type':_0x2a6abd[_0xe167('0x6')],'app':_0xe167('0x4f'),'exten':_0x2a6abd[_0xe167('0x8')],'context':_0x2a6abd[_0xe167('0x7')],'priority':_[_0xe167('0x49')](_0x1015cb)[_0xe167('0x48')]+0x1,'VoiceExtensionId':_0x2a6abd['id']});return _0x1015cb;});}}});}; \ No newline at end of file +var _0x5b89=['none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','timeout','options','url','split','length','name','trunk','param','phone','prefix','${EXTEN:','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','then','*,*,*,*','IntervalId','map','filter','toLowerCase','tag','intervals','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','hasOwnProperty','answer','playback','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','agi','priority','last','concat','catch','define','VoiceExtension','voice_extensions','Hangup','lodash','./voiceExtension.attributes','type','context','exten','alias','Set','NoOp','CDR(routeAlias)=','No\x20alias\x20set','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5b89,0xdd));var _0x95b8=function(_0x15f8ad,_0x5275c3){_0x15f8ad=_0x15f8ad-0x0;var _0xc0238a=_0x5b89[_0x15f8ad];return _0xc0238a;};'use strict';var _=require(_0x95b8('0x0'));var attributes=require(_0x95b8('0x1'));module['exports']=function(_0x299215){var _0x5b6e93=_0x299215['models'];function _0x568b69(_0x50ecdc){var _0x5615b5=0x2;var _0x3aba85=[{'type':_0x50ecdc[_0x95b8('0x2')],'app':'Set','appdata':'CDR(type)='+_0x50ecdc['type'],'context':_0x50ecdc[_0x95b8('0x3')],'exten':_0x50ecdc[_0x95b8('0x4')],'priority':_0x5615b5++,'VoiceExtensionId':_0x50ecdc['id']},{'type':_0x50ecdc['type'],'app':_0x50ecdc[_0x95b8('0x5')]?_0x95b8('0x6'):_0x95b8('0x7'),'appdata':_0x50ecdc[_0x95b8('0x5')]?_0x95b8('0x8')+_0x50ecdc[_0x95b8('0x5')]:_0x95b8('0x9'),'context':_0x50ecdc['context'],'exten':_0x50ecdc[_0x95b8('0x4')],'priority':_0x5615b5++,'VoiceExtensionId':_0x50ecdc['id']}];if(_0x50ecdc['type']==='inbound'){_0x3aba85[_0x95b8('0xa')]({'type':_0x95b8('0xb'),'app':_0x95b8('0x6'),'appdata':_0x95b8('0xc')+_0x50ecdc['id'],'context':_0x50ecdc[_0x95b8('0x3')],'exten':_0x50ecdc[_0x95b8('0x4')],'priority':_0x5615b5++,'VoiceExtensionId':_0x50ecdc['id']});}_0x3aba85['push']({'type':_0x50ecdc[_0x95b8('0x2')],'app':_0x95b8('0x6'),'appdata':_0x95b8('0xd'),'context':_0x50ecdc['context'],'exten':_0x50ecdc[_0x95b8('0x4')],'priority':_0x5615b5++,'VoiceExtensionId':_0x50ecdc['id']},{'type':_0x50ecdc['type'],'app':_0x95b8('0x6'),'appdata':_0x95b8('0xe'),'context':_0x50ecdc[_0x95b8('0x3')],'exten':_0x50ecdc[_0x95b8('0x4')],'priority':_0x5615b5++,'VoiceExtensionId':_0x50ecdc['id']},{'type':_0x50ecdc[_0x95b8('0x2')],'app':_0x95b8('0x6'),'appdata':_0x95b8('0xf'),'context':_0x50ecdc[_0x95b8('0x3')],'exten':_0x50ecdc[_0x95b8('0x4')],'priority':_0x5615b5++,'VoiceExtensionId':_0x50ecdc['id']});return _0x3aba85;}function _0x3cfb99(_0x53cea8){var _0x361baf=0x2;var _0x575cf6=[{'type':_0x95b8('0x10'),'app':_0x95b8('0x6'),'appdata':'CDR(type)=outbound','context':_0x53cea8[_0x95b8('0x3')],'exten':_0x53cea8[_0x95b8('0x4')],'priority':_0x361baf++,'VoiceExtensionId':_0x53cea8['id']},{'type':_0x95b8('0x10'),'app':_0x53cea8[_0x95b8('0x5')]?_0x95b8('0x6'):_0x95b8('0x7'),'appdata':_0x53cea8[_0x95b8('0x5')]?_0x95b8('0x8')+_0x53cea8['alias']:_0x95b8('0x9'),'context':_0x53cea8[_0x95b8('0x3')],'exten':_0x53cea8[_0x95b8('0x4')],'priority':_0x361baf++,'VoiceExtensionId':_0x53cea8['id']},{'type':'outbound','app':_0x95b8('0x6'),'appdata':_0x95b8('0x11')+(_0x53cea8[_0x95b8('0x12')]?'${EXTEN:'+_0x53cea8[_0x95b8('0x12')]+'}':_0x95b8('0x13')),'context':_0x53cea8[_0x95b8('0x3')],'exten':_0x53cea8[_0x95b8('0x4')],'priority':_0x361baf++,'VoiceExtensionId':_0x53cea8['id']},{'type':_0x95b8('0x10'),'app':_0x95b8('0x6'),'appdata':_0x95b8('0xc')+_0x53cea8['id'],'context':_0x53cea8[_0x95b8('0x3')],'exten':_0x53cea8[_0x95b8('0x4')],'priority':_0x361baf++,'VoiceExtensionId':_0x53cea8['id']},{'type':'outbound','app':_0x95b8('0x14'),'appdata':_0x95b8('0x15')+(_0x361baf+0x2)+'):Goto('+(_0x361baf+0x1)+')','context':_0x53cea8['context'],'exten':_0x53cea8[_0x95b8('0x4')],'priority':_0x361baf++,'VoiceExtensionId':_0x53cea8['id']},{'type':_0x95b8('0x10'),'app':_0x95b8('0x6'),'appdata':_0x53cea8[_0x95b8('0x12')]?_0x95b8('0x16')+_0x53cea8[_0x95b8('0x12')]+'}':_0x95b8('0x17'),'context':_0x53cea8['context'],'exten':_0x53cea8[_0x95b8('0x4')],'priority':_0x361baf++,'VoiceExtensionId':_0x53cea8['id']},{'type':_0x95b8('0x10'),'app':_0x95b8('0x6'),'appdata':_0x95b8('0xd'),'context':_0x53cea8['context'],'exten':_0x53cea8['exten'],'priority':_0x361baf++,'VoiceExtensionId':_0x53cea8['id']},{'type':_0x95b8('0x10'),'app':_0x95b8('0x6'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x53cea8['context'],'exten':_0x53cea8[_0x95b8('0x4')],'priority':_0x361baf++,'VoiceExtensionId':_0x53cea8['id']},{'type':_0x95b8('0x10'),'app':_0x95b8('0x6'),'appdata':_0x95b8('0xf'),'context':_0x53cea8[_0x95b8('0x3')],'exten':_0x53cea8[_0x95b8('0x4')],'priority':_0x361baf++,'VoiceExtensionId':_0x53cea8['id']},{'type':_0x95b8('0x10'),'app':'Set','appdata':'outboundrouteid='+_0x53cea8['id'],'context':_0x53cea8[_0x95b8('0x3')],'exten':_0x53cea8[_0x95b8('0x4')],'priority':_0x361baf++,'VoiceExtensionId':_0x53cea8['id']}];if(_0x53cea8['hasOwnProperty'](_0x95b8('0x18'))&&_0x53cea8['recordingFormat']!==_0x95b8('0x19')){_0x575cf6['push']({'type':_0x95b8('0x10'),'app':'Set','appdata':_0x95b8('0x1a'),'context':_0x53cea8[_0x95b8('0x3')],'exten':_0x53cea8[_0x95b8('0x4')],'priority':_0x361baf++,'VoiceExtensionId':_0x53cea8['id']},{'type':_0x95b8('0x10'),'app':_0x95b8('0x6'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x53cea8[_0x95b8('0x18')]||_0x95b8('0x1b'),'context':_0x53cea8[_0x95b8('0x3')],'exten':_0x53cea8['exten'],'priority':_0x361baf++,'VoiceExtensionId':_0x53cea8['id']});}return _0x575cf6;}function _0x527fcc(_0x16acc5,_0x3e823c){var _0x17f7ef=[{'name':'trunk','param':0x0},{'name':_0x95b8('0x1c'),'param':0x1},{'name':_0x95b8('0x1d'),'param':0x2},{'name':_0x95b8('0x1e'),'param':0x3}];var _0x47fc46={};var _0x41d270=_0x3e823c[_0x95b8('0x1f')](',');var _0x5678d2=[];for(var _0x3dcf5b=0x0;_0x3dcf5b<_0x17f7ef[_0x95b8('0x20')];_0x3dcf5b++){switch(_0x17f7ef[_0x3dcf5b][_0x95b8('0x21')]){case _0x95b8('0x22'):_0x47fc46[_0x95b8('0x22')]=_0x41d270[_0x17f7ef[_0x3dcf5b][_0x95b8('0x23')]][_0x95b8('0x1f')]('/')[0x1];_0x47fc46[_0x95b8('0x24')]=_0x41d270[_0x17f7ef[_0x3dcf5b][_0x95b8('0x23')]]['split']('/')[0x2];_0x47fc46[_0x95b8('0x25')]=_0x47fc46[_0x95b8('0x24')]?_0x47fc46[_0x95b8('0x24')][_0x95b8('0x1f')]('$')[0x0]:undefined;_0x47fc46[_0x95b8('0x24')]=_0x16acc5[_0x95b8('0x12')]?(_0x47fc46[_0x95b8('0x25')]||'')+_0x95b8('0x26')+_0x16acc5[_0x95b8('0x12')]+'}':(_0x47fc46['prefix']||'')+'${EXTEN}';_0x5678d2[_0x17f7ef[_0x3dcf5b][_0x95b8('0x23')]]=[_0x95b8('0x27'),_0x47fc46[_0x95b8('0x22')],_0x47fc46[_0x95b8('0x24')]][_0x95b8('0x28')]('/');break;case'options':_0x47fc46[_0x95b8('0x1d')]=_0x41d270[_0x17f7ef[_0x3dcf5b]['param']];if(_0x16acc5['recordingFormat']!=='none'){if(_0x47fc46[_0x95b8('0x1d')][_0x95b8('0x29')](_0x95b8('0x2a'))<0x0){_0x47fc46[_0x95b8('0x1d')]+='U(xcally-mixmonitor-context)';}}else{_0x47fc46[_0x95b8('0x1d')]=_0x47fc46['options'][_0x95b8('0x2b')]('U(xcally-mixmonitor-context)','');}_0x5678d2[_0x17f7ef[_0x3dcf5b][_0x95b8('0x23')]]=_0x47fc46[_0x95b8('0x1d')];break;default:_0x5678d2[_0x17f7ef[_0x3dcf5b][_0x95b8('0x23')]]=_0x41d270[_0x17f7ef[_0x3dcf5b][_0x95b8('0x23')]];}}return _0x5678d2[_0x95b8('0x28')](',');}function _0x3cc61a(_0x8200b5,_0x1ce718,_0x169028){return new Promise(function(_0x4f9d64,_0x3fccaf){var _0x4c12a4=[];if(_[_0x95b8('0x2c')](_0x1ce718))return _0x4f9d64(_0x4c12a4);_0x5b6e93[_0x95b8('0x2d')][_0x95b8('0x2e')]({'attributes':['id',_0x95b8('0x2f'),'IntervalId'],'raw':!![]})[_0x95b8('0x30')](function(_0x574411){for(var _0x14c2a9=0x0,_0xe9e36=0x0;_0x14c2a9<_0x1ce718[_0x95b8('0x20')];_0x14c2a9++,_0xe9e36=0x0){var _0x529a0c=_0x1ce718[_0x14c2a9];var _0x3287d1=[];var _0x2fb7ec=[];delete _0x529a0c['id'];if(_0x529a0c[_0x95b8('0x2f')]!==_0x95b8('0x31')){_0x529a0c['intervals']=[_0x529a0c[_0x95b8('0x2f')]];}else{_0x529a0c['intervals']=_0x529a0c[_0x95b8('0x32')]?_[_0x95b8('0x33')](_[_0x95b8('0x34')](_0x574411,{'IntervalId':_0x529a0c[_0x95b8('0x32')]}),_0x95b8('0x2f')):[];}_0x529a0c['context']=_0x8200b5[_0x95b8('0x3')];_0x529a0c[_0x95b8('0x4')]=_0x8200b5[_0x95b8('0x4')];if(_0x529a0c[_0x95b8('0x2')])_0x529a0c[_0x95b8('0x2')]=_0x529a0c[_0x95b8('0x2')][_0x95b8('0x35')]();if(_0x8200b5[_0x95b8('0x2')]===_0x95b8('0x10')){if(_0x529a0c['hasOwnProperty'](_0x95b8('0x36'))&&_0x529a0c[_0x95b8('0x36')]&&_0x529a0c[_0x95b8('0x36')]!=='--'){_0x3287d1[_0x95b8('0xa')]({'type':_0x529a0c[_0x95b8('0x2')][_0x95b8('0x35')](),'app':_0x95b8('0x6'),'appdata':'CDR(tag)='+_0x529a0c[_0x95b8('0x36')],'context':_0x8200b5[_0x95b8('0x3')],'exten':_0x8200b5['exten'],'priority':_0x529a0c[_0x95b8('0x37')][_0x95b8('0x20')]+_0x169028+_0xe9e36++,'VoiceExtensionId':_0x8200b5['id']});}_0x3287d1[_0x95b8('0xa')]({'type':_0x529a0c[_0x95b8('0x2')][_0x95b8('0x35')](),'app':'ExecIf','appdata':_0x95b8('0x38')+(_0x529a0c[_0x95b8('0x39')]?_0x95b8('0x3a')+_0x529a0c[_0x95b8('0x39')]+')':'NoOp(No\x20number\x20available)'),'context':_0x8200b5['context'],'exten':_0x8200b5[_0x95b8('0x4')],'priority':_0x529a0c['intervals'][_0x95b8('0x20')]+_0x169028+_0xe9e36++,'VoiceExtensionId':_0x8200b5['id']});}else{if(_0x529a0c[_0x95b8('0x3b')](_0x95b8('0x3c'))){if(['queue',_0x95b8('0x3d')]['includes'](_0x529a0c[_0x95b8('0x3e')][_0x95b8('0x35')]())&&_0x529a0c[_0x95b8('0x3f')]!==_0x95b8('0x40')){if(_0x529a0c[_0x95b8('0x3c')]){_0x3287d1['push']({'type':_0x529a0c[_0x95b8('0x2')][_0x95b8('0x35')](),'app':_0x95b8('0x14'),'appdata':_0x95b8('0x41'),'context':_0x8200b5[_0x95b8('0x3')],'exten':_0x8200b5[_0x95b8('0x4')],'priority':_0x529a0c[_0x95b8('0x37')]['length']+_0x169028+_0xe9e36++,'VoiceExtensionId':_0x8200b5['id']});_0x3287d1[_0x95b8('0xa')]({'type':_0x529a0c[_0x95b8('0x2')]['toLowerCase'](),'app':'Set','appdata':_0x95b8('0x42'),'context':_0x8200b5[_0x95b8('0x3')],'exten':_0x8200b5[_0x95b8('0x4')],'priority':_0x529a0c[_0x95b8('0x37')][_0x95b8('0x20')]+_0x169028+_0xe9e36++,'VoiceExtensionId':_0x8200b5['id']});}else{_0x3287d1[_0x95b8('0xa')]({'type':_0x529a0c[_0x95b8('0x2')][_0x95b8('0x35')](),'app':_0x95b8('0x14'),'appdata':_0x95b8('0x43'),'context':_0x8200b5[_0x95b8('0x3')],'exten':_0x8200b5[_0x95b8('0x4')],'priority':_0x529a0c[_0x95b8('0x37')][_0x95b8('0x20')]+_0x169028+_0xe9e36++,'VoiceExtensionId':_0x8200b5['id']});_0x3287d1[_0x95b8('0xa')]({'type':_0x529a0c[_0x95b8('0x2')][_0x95b8('0x35')](),'app':_0x95b8('0x6'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x8200b5[_0x95b8('0x3')],'exten':_0x8200b5[_0x95b8('0x4')],'priority':_0x529a0c[_0x95b8('0x37')][_0x95b8('0x20')]+_0x169028+_0xe9e36++,'VoiceExtensionId':_0x8200b5['id']});}}}}for(var _0x10ac2c=0x0;_0x10ac2c<_0x529a0c['intervals']['length'];_0x10ac2c++){var _0x17e18b=_0x169028+_0x529a0c[_0x95b8('0x37')][_0x95b8('0x20')];var _0x42ba61=_0x10ac2c===_0x529a0c['intervals'][_0x95b8('0x20')]-0x1?_0x169028+_0x3287d1[_0x95b8('0x20')]+_0x2fb7ec[_0x95b8('0x20')]+0x2:_0x169028+_0x10ac2c+0x1;_0x3287d1[_0x95b8('0x44')](_0x10ac2c,0x0,{'type':_0x8200b5['type'],'app':_0x95b8('0x45'),'appdata':_0x529a0c['intervals'][_0x10ac2c]+'?'+_0x8200b5[_0x95b8('0x3')]+_0x95b8('0x46')+_0x17e18b+':'+_0x8200b5[_0x95b8('0x3')]+',${EXTEN},'+_0x42ba61,'exten':_0x8200b5[_0x95b8('0x4')],'context':_0x8200b5['context'],'priority':_0x169028+_0x10ac2c,'VoiceExtensionId':_0x8200b5['id']});}if(_0x529a0c[_0x95b8('0x3f')]===_0x95b8('0x47')){_0x529a0c[_0x95b8('0x48')]=_0x527fcc(_0x8200b5,_0x529a0c['appdata']);}if(_0x529a0c[_0x95b8('0x3f')]===_0x95b8('0x49')){_0x3287d1[_0x95b8('0xa')]({'type':_0x529a0c[_0x95b8('0x2')]['toLowerCase'](),'app':_0x95b8('0x6'),'appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x8200b5['context'],'exten':_0x8200b5[_0x95b8('0x4')],'priority':_0x529a0c[_0x95b8('0x37')][_0x95b8('0x20')]+_0x169028+_0xe9e36++,'VoiceExtensionId':_0x8200b5['id']});}_0x529a0c[_0x95b8('0x4a')]=_0x3287d1[_0x95b8('0x20')]?_[_0x95b8('0x4b')](_0x3287d1)['priority']+0x1:_0x169028;_0x4c12a4=_[_0x95b8('0x4c')](_0x4c12a4,_0x3287d1,[_0x529a0c],_0x2fb7ec);_0x169028=_[_0x95b8('0x4b')](_0x4c12a4)['priority']+0x1;}return _0x4f9d64(_0x4c12a4);})[_0x95b8('0x4d')](function(_0x174331){_0x3fccaf(_0x174331);});});}return _0x299215[_0x95b8('0x4e')](_0x95b8('0x4f'),attributes,{'tableName':_0x95b8('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x36766d){var _0x465279=this['get']({'plain':!![]});var _0x1e7bfd=_0x465279[_0x95b8('0x2')]===_0x95b8('0x10')?_0x3cfb99(_0x465279):_0x568b69(_0x465279);return _0x3cc61a(_0x465279,_0x36766d,_['last'](_0x1e7bfd)[_0x95b8('0x4a')]+0x1)[_0x95b8('0x30')](function(_0x375f0a){var _0x2a93b1=_[_0x95b8('0x4c')](_0x1e7bfd,_0x375f0a);_0x2a93b1[_0x95b8('0xa')]({'type':_0x465279[_0x95b8('0x2')],'app':_0x95b8('0x51'),'exten':_0x465279[_0x95b8('0x4')],'context':_0x465279[_0x95b8('0x3')],'priority':_[_0x95b8('0x4b')](_0x2a93b1)[_0x95b8('0x4a')]+0x1,'VoiceExtensionId':_0x465279['id']});return _0x2a93b1;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 797f3e3..b35530f 100644 --- a/server/api/voiceExtension/voiceExtension.rpc.js +++ b/server/api/voiceExtension/voiceExtension.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa751=['model','map','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','VoiceExtension,\x20%s,\x20%s','message','info','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','include'];(function(_0x2a0350,_0x249319){var _0x425220=function(_0x1d5f78){while(--_0x1d5f78){_0x2a0350['push'](_0x2a0350['shift']());}};_0x425220(++_0x249319);}(_0xa751,0x175));var _0x1a75=function(_0x4269cc,_0x411574){_0x4269cc=_0x4269cc-0x0;var _0x50731c=_0xa751[_0x4269cc];return _0x50731c;};'use strict';var _=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var moment=require(_0x1a75('0x2'));var BPromise=require(_0x1a75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a75('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a75('0x5'));var logger=require(_0x1a75('0x6'))(_0x1a75('0x7'));var config=require('../../config/environment');var jayson=require(_0x1a75('0x8'));var client=jayson[_0x1a75('0x9')][_0x1a75('0xa')]({'port':0x232a});config[_0x1a75('0xb')]=_[_0x1a75('0xc')](config[_0x1a75('0xb')],{'host':_0x1a75('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceExtension.socket')[_0x1a75('0xe')](socket);function respondWithRpcPromise(_0x377b3b,_0x1d7819,_0x271286){return new BPromise(function(_0x15b4cc,_0xd150fc){return client[_0x1a75('0xf')](_0x377b3b,_0x271286)[_0x1a75('0x10')](function(_0x5b615f){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x1d7819,_0x1a75('0x11'));logger[_0x1a75('0x12')](_0x1a75('0x13'),_0x1d7819,_0x1a75('0x11'),JSON['stringify'](_0x5b615f));if(_0x5b615f['error']){if(_0x5b615f[_0x1a75('0x14')][_0x1a75('0x15')]===0x1f4){logger['error'](_0x1a75('0x16'),_0x1d7819,_0x5b615f[_0x1a75('0x14')]['message']);return _0xd150fc(_0x5b615f[_0x1a75('0x14')][_0x1a75('0x17')]);}logger[_0x1a75('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x1d7819,_0x5b615f['error']['message']);return _0x15b4cc(_0x5b615f[_0x1a75('0x14')][_0x1a75('0x17')]);}else{logger[_0x1a75('0x18')](_0x1a75('0x16'),_0x1d7819,_0x1a75('0x11'));_0x15b4cc(_0x5b615f[_0x1a75('0x19')]['message']);}})[_0x1a75('0x1a')](function(_0x490e1f){logger['error'](_0x1a75('0x16'),_0x1d7819,_0x490e1f);_0xd150fc(_0x490e1f);});});}exports[_0x1a75('0x1b')]=function(_0x5ae0f4){var _0x42d283=this;return new Promise(function(_0x4d877c,_0x4699c9){return db[_0x1a75('0x1c')][_0x1a75('0x1d')]({'raw':_0x5ae0f4[_0x1a75('0x1e')]?_0x5ae0f4[_0x1a75('0x1e')][_0x1a75('0x1f')]===undefined?!![]:![]:!![],'where':_0x5ae0f4['options']?_0x5ae0f4[_0x1a75('0x1e')]['where']||null:null,'attributes':_0x5ae0f4[_0x1a75('0x1e')]?_0x5ae0f4[_0x1a75('0x1e')][_0x1a75('0x20')]||null:null,'limit':_0x5ae0f4['options']?_0x5ae0f4[_0x1a75('0x1e')]['limit']||null:null,'include':_0x5ae0f4[_0x1a75('0x1e')]?_0x5ae0f4[_0x1a75('0x1e')][_0x1a75('0x21')]?_['map'](_0x5ae0f4[_0x1a75('0x1e')][_0x1a75('0x21')],function(_0x4dec82){return{'model':db[_0x4dec82[_0x1a75('0x22')]],'as':_0x4dec82['as'],'attributes':_0x4dec82[_0x1a75('0x20')],'include':_0x4dec82['include']?_[_0x1a75('0x23')](_0x4dec82[_0x1a75('0x21')],function(_0x34c106){return{'model':db[_0x34c106[_0x1a75('0x22')]],'as':_0x34c106['as'],'attributes':_0x34c106['attributes'],'include':_0x34c106[_0x1a75('0x21')]?_[_0x1a75('0x23')](_0x34c106[_0x1a75('0x21')],function(_0x2f5ac9){return{'model':db[_0x2f5ac9[_0x1a75('0x22')]],'as':_0x2f5ac9['as'],'attributes':_0x2f5ac9[_0x1a75('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1a75('0x10')](function(_0x38e885){logger['info']('GetVoiceExtension',_0x5ae0f4);logger[_0x1a75('0x12')](_0x1a75('0x1b'),_0x5ae0f4,JSON[_0x1a75('0x24')](_0x38e885));_0x4d877c(_0x38e885);})[_0x1a75('0x1a')](function(_0x6f02dc){logger[_0x1a75('0x14')](_0x1a75('0x1b'),_0x6f02dc[_0x1a75('0x17')],_0x5ae0f4);_0x4699c9(_0x42d283['error'](0x1f4,_0x6f02dc['message']));});});}; \ No newline at end of file +var _0xbfe8=['request','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','VoiceExtension','options','attributes','limit','include','model','map','GetVoiceExtension','stringify','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x224f61,_0x4c881d){_0x224f61=_0x224f61-0x0;var _0x51caa3=_0xbfe8[_0x224f61];return _0x51caa3;};'use strict';var _=require('lodash');var util=require(_0x8bfe('0x0'));var moment=require('moment');var BPromise=require(_0x8bfe('0x1'));var rs=require(_0x8bfe('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8bfe('0x3'));var logger=require(_0x8bfe('0x4'))('rpc');var config=require(_0x8bfe('0x5'));var jayson=require(_0x8bfe('0x6'));var client=jayson[_0x8bfe('0x7')]['http']({'port':0x232a});config[_0x8bfe('0x8')]=_[_0x8bfe('0x9')](config[_0x8bfe('0x8')],{'host':_0x8bfe('0xa'),'port':0x18eb});var socket=require(_0x8bfe('0xb'))(new Redis(config[_0x8bfe('0x8')]));require(_0x8bfe('0xc'))[_0x8bfe('0xd')](socket);function respondWithRpcPromise(_0x243a11,_0xc1f3c3,_0x1f19ee){return new BPromise(function(_0x18cc30,_0x3a07cf){return client[_0x8bfe('0xe')](_0x243a11,_0x1f19ee)[_0x8bfe('0xf')](function(_0x4dd881){logger[_0x8bfe('0x10')]('VoiceExtension,\x20%s,\x20%s',_0xc1f3c3,_0x8bfe('0x11'));logger[_0x8bfe('0x12')](_0x8bfe('0x13'),_0xc1f3c3,'request\x20sent',JSON['stringify'](_0x4dd881));if(_0x4dd881[_0x8bfe('0x14')]){if(_0x4dd881[_0x8bfe('0x14')][_0x8bfe('0x15')]===0x1f4){logger[_0x8bfe('0x14')](_0x8bfe('0x16'),_0xc1f3c3,_0x4dd881['error'][_0x8bfe('0x17')]);return _0x3a07cf(_0x4dd881[_0x8bfe('0x14')]['message']);}logger[_0x8bfe('0x14')](_0x8bfe('0x16'),_0xc1f3c3,_0x4dd881[_0x8bfe('0x14')]['message']);return _0x18cc30(_0x4dd881['error'][_0x8bfe('0x17')]);}else{logger['info']('VoiceExtension,\x20%s,\x20%s',_0xc1f3c3,_0x8bfe('0x11'));_0x18cc30(_0x4dd881[_0x8bfe('0x18')][_0x8bfe('0x17')]);}})[_0x8bfe('0x19')](function(_0xfd4a2a){logger[_0x8bfe('0x14')](_0x8bfe('0x16'),_0xc1f3c3,_0xfd4a2a);_0x3a07cf(_0xfd4a2a);});});}exports['GetVoiceExtension']=function(_0xbc7fa2){var _0x5442e1=this;return new Promise(function(_0x2e64ee,_0x3f8050){return db[_0x8bfe('0x1a')]['findAll']({'raw':_0xbc7fa2['options']?_0xbc7fa2[_0x8bfe('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xbc7fa2['options']?_0xbc7fa2[_0x8bfe('0x1b')]['where']||null:null,'attributes':_0xbc7fa2[_0x8bfe('0x1b')]?_0xbc7fa2['options'][_0x8bfe('0x1c')]||null:null,'limit':_0xbc7fa2[_0x8bfe('0x1b')]?_0xbc7fa2[_0x8bfe('0x1b')][_0x8bfe('0x1d')]||null:null,'include':_0xbc7fa2['options']?_0xbc7fa2[_0x8bfe('0x1b')][_0x8bfe('0x1e')]?_['map'](_0xbc7fa2[_0x8bfe('0x1b')][_0x8bfe('0x1e')],function(_0x46526f){return{'model':db[_0x46526f[_0x8bfe('0x1f')]],'as':_0x46526f['as'],'attributes':_0x46526f[_0x8bfe('0x1c')],'include':_0x46526f[_0x8bfe('0x1e')]?_['map'](_0x46526f[_0x8bfe('0x1e')],function(_0x458888){return{'model':db[_0x458888[_0x8bfe('0x1f')]],'as':_0x458888['as'],'attributes':_0x458888[_0x8bfe('0x1c')],'include':_0x458888[_0x8bfe('0x1e')]?_[_0x8bfe('0x20')](_0x458888[_0x8bfe('0x1e')],function(_0x2cbfb3){return{'model':db[_0x2cbfb3[_0x8bfe('0x1f')]],'as':_0x2cbfb3['as'],'attributes':_0x2cbfb3[_0x8bfe('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8bfe('0xf')](function(_0x597651){logger[_0x8bfe('0x10')](_0x8bfe('0x21'),_0xbc7fa2);logger['debug'](_0x8bfe('0x21'),_0xbc7fa2,JSON[_0x8bfe('0x22')](_0x597651));_0x2e64ee(_0x597651);})[_0x8bfe('0x19')](function(_0x5259ec){logger[_0x8bfe('0x14')](_0x8bfe('0x21'),_0x5259ec['message'],_0xbc7fa2);_0x3f8050(_0x5442e1['error'](0x1f4,_0x5259ec[_0x8bfe('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 2f8c3da..27a90d7 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x2067c1,_0x4ad413){var _0x4c2968=function(_0x51df02){while(--_0x51df02){_0x2067c1['push'](_0x2067c1['shift']());}};_0x4c2968(++_0x4ad413);}(_0xe14b,0x93));var _0xbe14=function(_0x2f13ad,_0x193c7f){_0x2f13ad=_0x2f13ad-0x0;var _0x533e1d=_0xe14b[_0x2f13ad];return _0x533e1d;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file +var _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0x427ad4,_0x50587e){var _0x43ce67=function(_0x3b210f){while(--_0x3b210f){_0x427ad4['push'](_0x427ad4['shift']());}};_0x43ce67(++_0x50587e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2bcb75,_0x5789a7){_0x2bcb75=_0x2bcb75-0x0;var _0x175345=_0x5fc3[_0x2bcb75];return _0x175345;};'use strict';var VoiceExtensionEvents=require(_0x35fc('0x0'));var events=[_0x35fc('0x1'),'remove',_0x35fc('0x2')];function createListener(_0x2ac6da,_0x196bc2){return function(_0x91d024){_0x196bc2[_0x35fc('0x3')](_0x2ac6da,_0x91d024);};}function removeListener(_0x5e75e6,_0x2d1404){return function(){VoiceExtensionEvents[_0x35fc('0x4')](_0x5e75e6,_0x2d1404);};}exports[_0x35fc('0x5')]=function(_0x5b85ad){for(var _0x5754be=0x0,_0x19a0d1=events['length'];_0x5754be<_0x19a0d1;_0x5754be++){var _0x16e153=events[_0x5754be];var _0x27524f=createListener(_0x35fc('0x6')+_0x16e153,_0x5b85ad);VoiceExtensionEvents['on'](_0x16e153,_0x27524f);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 9bc209c..69c543c 100644 --- a/server/api/voiceMail/index.js +++ b/server/api/voiceMail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bd3=['post','create','put','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/messages','getMessages'];(function(_0x32c772,_0x2d02d9){var _0x4ba2ba=function(_0x3c2e49){while(--_0x3c2e49){_0x32c772['push'](_0x32c772['shift']());}};_0x4ba2ba(++_0x2d02d9);}(_0x4bd3,0x174));var _0x34bd=function(_0x1ea2b5,_0x11207f){_0x1ea2b5=_0x1ea2b5-0x0;var _0xaff09a=_0x4bd3[_0x1ea2b5];return _0xaff09a;};'use strict';var multer=require(_0x34bd('0x0'));var util=require('util');var path=require(_0x34bd('0x1'));var timeout=require(_0x34bd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x34bd('0x3'));var interaction=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var controller=require('./voiceMail.controller');router[_0x34bd('0x6')]('/',auth[_0x34bd('0x7')](),controller['index']);router[_0x34bd('0x6')](_0x34bd('0x8'),auth['isAuthenticated'](),controller[_0x34bd('0x9')]);router[_0x34bd('0x6')](_0x34bd('0xa'),auth[_0x34bd('0x7')](),controller[_0x34bd('0xb')]);router[_0x34bd('0xc')]('/',auth['isAuthenticated'](),controller[_0x34bd('0xd')]);router[_0x34bd('0xe')](_0x34bd('0x8'),auth[_0x34bd('0x7')](),controller['update']);router['delete'](_0x34bd('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x34bd('0xf')]=router; \ No newline at end of file +var _0x2ef3=['express','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','/:id','isAuthenticated','show','/:id/messages','getMessages','post','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x1917d3,_0x218e74){var _0x43db55=function(_0x52dece){while(--_0x52dece){_0x1917d3['push'](_0x1917d3['shift']());}};_0x43db55(++_0x218e74);}(_0x2ef3,0xba));var _0x32ef=function(_0xb8592d,_0x1f2b83){_0xb8592d=_0xb8592d-0x0;var _0x1ce8e5=_0x2ef3[_0xb8592d];return _0x1ce8e5;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')]('/',auth[_0x32ef('0xb')](),controller['create']);router['put'](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')]('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index a7c189b..5528923 100644 --- a/server/api/voiceMail/voiceMail.attributes.js +++ b/server/api/voiceMail/voiceMail.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bbd=['ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','string','central'];(function(_0x5f9714,_0x28e97f){var _0x5d6252=function(_0x54092a){while(--_0x54092a){_0x5f9714['push'](_0x5f9714['shift']());}};_0x5d6252(++_0x28e97f);}(_0x8bbd,0x109));var _0xd8bb=function(_0x27dc5a,_0x5b3948){_0x27dc5a=_0x27dc5a-0x0;var _0xb0f2f5=_0x8bbd[_0x27dc5a];return _0xb0f2f5;};'use strict';var Sequelize=require(_0xd8bb('0x0'));module[_0xd8bb('0x1')]={'customer_id':{'type':Sequelize[_0xd8bb('0x2')]},'context':{'type':Sequelize[_0xd8bb('0x2')],'defaultValue':_0xd8bb('0x3'),'unique':_0xd8bb('0x4')},'mailbox':{'type':Sequelize[_0xd8bb('0x2')],'defaultValue':'','allowNull':![],'unique':_0xd8bb('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xd8bb('0x2')]},'email':{'type':Sequelize[_0xd8bb('0x2')],'validate':{'isEmail':!![]},'set':function(_0x575e81){this['setDataValue']('email',typeof _0x575e81===_0xd8bb('0x5')&&_0x575e81['trim']()?_0x575e81['trim']():null);}},'pager':{'type':Sequelize[_0xd8bb('0x2')]},'tz':{'type':Sequelize[_0xd8bb('0x2')],'defaultValue':_0xd8bb('0x6')},'attach':{'type':Sequelize[_0xd8bb('0x7')](_0xd8bb('0x8'),'no'),'defaultValue':_0xd8bb('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xd8bb('0x7')](_0xd8bb('0x8'),'no'),'defaultValue':_0xd8bb('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0xd8bb('0x2')]},'callback':{'type':Sequelize[_0xd8bb('0x2')]},'review':{'type':Sequelize[_0xd8bb('0x7')](_0xd8bb('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xd8bb('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xd8bb('0x7')](_0xd8bb('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xd8bb('0x7')](_0xd8bb('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xd8bb('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xd8bb('0x7')](_0xd8bb('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xd8bb('0x7')]('yes','no'),'defaultValue':_0xd8bb('0x8'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xd8bb('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xd8bb('0x7')](_0xd8bb('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xd8bb('0x7')](_0xd8bb('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xd8bb('0xa')},'emailsubject':{'type':Sequelize[_0xd8bb('0x2')]},'emailbody':{'type':Sequelize[_0xd8bb('0x2')]},'maxsecs':{'type':Sequelize[_0xd8bb('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xd8bb('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xd8bb('0xc')],'get':function(){return this[_0xd8bb('0xd')](_0xd8bb('0xe'))+_0xd8bb('0xf')+this[_0xd8bb('0xd')](_0xd8bb('0x10'));}}}; \ No newline at end of file +var _0xa337=['STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','ENUM','yes','INTEGER','getDataValue','fullname','mailbox','exports'];(function(_0x132d9e,_0x4a0839){var _0x40b733=function(_0x30c113){while(--_0x30c113){_0x132d9e['push'](_0x132d9e['shift']());}};_0x40b733(++_0x4a0839);}(_0xa337,0xb5));var _0x7a33=function(_0x4e85cf,_0x21513b){_0x4e85cf=_0x4e85cf-0x0;var _0x39b3c8=_0xa337[_0x4e85cf];return _0x39b3c8;};'use strict';var Sequelize=require('sequelize');module[_0x7a33('0x0')]={'customer_id':{'type':Sequelize[_0x7a33('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x7a33('0x2'),'unique':_0x7a33('0x3')},'mailbox':{'type':Sequelize[_0x7a33('0x1')],'defaultValue':'','allowNull':![],'unique':_0x7a33('0x3')},'password':{'type':Sequelize[_0x7a33('0x1')]},'fullname':{'type':Sequelize[_0x7a33('0x1')]},'email':{'type':Sequelize[_0x7a33('0x1')],'validate':{'isEmail':!![]},'set':function(_0x506bf0){this[_0x7a33('0x4')](_0x7a33('0x5'),typeof _0x506bf0===_0x7a33('0x6')&&_0x506bf0[_0x7a33('0x7')]()?_0x506bf0[_0x7a33('0x7')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x7a33('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x7a33('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x7a33('0x8')]('yes','no'),'defaultValue':_0x7a33('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x7a33('0x1')]},'review':{'type':Sequelize['ENUM'](_0x7a33('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7a33('0x8')](_0x7a33('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x7a33('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7a33('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x7a33('0x8')](_0x7a33('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x7a33('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7a33('0x8')](_0x7a33('0x9'),'no'),'defaultValue':_0x7a33('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x7a33('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7a33('0x8')](_0x7a33('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7a33('0x8')](_0x7a33('0x9'),'no'),'defaultValue':_0x7a33('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x7a33('0x1')]},'emailbody':{'type':Sequelize[_0x7a33('0x1')]},'maxsecs':{'type':Sequelize[_0x7a33('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7a33('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x7a33('0xb')](_0x7a33('0xc'))+'\x20-\x20'+this[_0x7a33('0xb')](_0x7a33('0xd'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index b2541d0..afc528d 100644 --- a/server/api/voiceMail/voiceMail.controller.js +++ b/server/api/voiceMail/voiceMail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ffd=['moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','update','then','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMail','includeAll','include','findAll','rows','catch','params','find','create','user','get','Voicemails','UserProfileSection','userProfileId','autoAssociation','body','destroy','getMessages','findOne','VoiceMailMessage','order','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','request-promise'];(function(_0x2a243a,_0x382151){var _0x43d146=function(_0x1fa890){while(--_0x1fa890){_0x2a243a['push'](_0x2a243a['shift']());}};_0x43d146(++_0x382151);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5cac98,_0x3aaee9){_0x5cac98=_0x5cac98-0x0;var _0x45aba2=_0x9ffd[_0x5cac98];return _0x45aba2;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var hardwareService=require(_0xd9ff('0x13'));var logger=require(_0xd9ff('0x14'))(_0xd9ff('0x15'));var utils=require(_0xd9ff('0x16'));var config=require(_0xd9ff('0x17'));var licenseUtil=require(_0xd9ff('0x18'));var db=require(_0xd9ff('0x19'))['db'];function respondWithStatusCode(_0x47d842,_0x47b0d7){_0x47b0d7=_0x47b0d7||0xcc;return function(_0xaaf7af){if(_0xaaf7af){return _0x47d842[_0xd9ff('0x1a')](_0x47b0d7);}return _0x47d842[_0xd9ff('0x1b')](_0x47b0d7)[_0xd9ff('0x1c')]();};}function respondWithResult(_0x12c39a,_0x556aa4){_0x556aa4=_0x556aa4||0xc8;return function(_0x2f78c1){if(_0x2f78c1){return _0x12c39a[_0xd9ff('0x1b')](_0x556aa4)['json'](_0x2f78c1);}};}function respondWithFilteredResult(_0xf14c9f,_0x5db010){return function(_0x4ffe54){if(_0x4ffe54){var _0x547e28=typeof _0x5db010['offset']===_0xd9ff('0x1d')&&typeof _0x5db010['limit']===_0xd9ff('0x1d');var _0xa30fd2=_0x4ffe54[_0xd9ff('0x1e')];var _0x3afd19=_0x547e28?0x0:_0x5db010[_0xd9ff('0x1f')];var _0x2d4df1=_0x547e28?_0x4ffe54[_0xd9ff('0x1e')]:_0x5db010[_0xd9ff('0x1f')]+_0x5db010[_0xd9ff('0x20')];var _0x1f028f;if(_0x2d4df1>=_0xa30fd2){_0x2d4df1=_0xa30fd2;_0x1f028f=0xc8;}else{_0x1f028f=0xce;}_0xf14c9f[_0xd9ff('0x1b')](_0x1f028f);return _0xf14c9f[_0xd9ff('0x21')](_0xd9ff('0x22'),_0x3afd19+'-'+_0x2d4df1+'/'+_0xa30fd2)['json'](_0x4ffe54);}return null;};}function patchUpdates(_0x4cf8ec){return function(_0x264a3d){try{jsonpatch[_0xd9ff('0x23')](_0x264a3d,_0x4cf8ec,!![]);}catch(_0x4eea4d){return BPromise['reject'](_0x4eea4d);}return _0x264a3d['save']();};}function saveUpdates(_0x4b1477,_0x1f4d9e){return function(_0x58eb5f){if(_0x58eb5f){return _0x58eb5f[_0xd9ff('0x24')](_0x4b1477)[_0xd9ff('0x25')](function(_0x291f52){return _0x291f52;});}return null;};}function removeEntity(_0x9f074e,_0x278b66){return function(_0x42a828){if(_0x42a828){return _0x42a828['destroy']()['then'](function(){var _0x1136e9=_0x42a828['get']({'plain':!![]});var _0x3ca906='Voicemails';return db[_0xd9ff('0x26')]['destroy']({'where':{'type':_0x3ca906,'resourceId':_0x1136e9['id']}})[_0xd9ff('0x25')](function(){return _0x42a828;});})[_0xd9ff('0x25')](function(){_0x9f074e[_0xd9ff('0x1b')](0xcc)[_0xd9ff('0x1c')]();});}};}function handleEntityNotFound(_0x5d685e,_0x11a17b){return function(_0xe11f88){if(!_0xe11f88){_0x5d685e[_0xd9ff('0x1a')](0x194);}return _0xe11f88;};}function handleError(_0x4390f7,_0x5c1c1f){_0x5c1c1f=_0x5c1c1f||0x1f4;return function(_0x1d3684){logger[_0xd9ff('0x27')](_0x1d3684[_0xd9ff('0x28')]);if(_0x1d3684[_0xd9ff('0x29')]){delete _0x1d3684[_0xd9ff('0x29')];}_0x4390f7[_0xd9ff('0x1b')](_0x5c1c1f)[_0xd9ff('0x2a')](_0x1d3684);};}exports[_0xd9ff('0x2b')]=function(_0x3dc443,_0x5706cf){var _0xcea5db={},_0x4ba2be={},_0x1d55fd={'count':0x0,'rows':[]};var _0x29c532=_[_0xd9ff('0x2c')](db['VoiceMail'][_0xd9ff('0x2d')],function(_0x3b26da){return{'name':_0x3b26da[_0xd9ff('0x2e')],'type':_0x3b26da[_0xd9ff('0x2f')]['key']};});_0x4ba2be[_0xd9ff('0x30')]=_['map'](_0x29c532,_0xd9ff('0x29'));_0x4ba2be[_0xd9ff('0x31')]=_[_0xd9ff('0x32')](_0x3dc443[_0xd9ff('0x31')]);_0x4ba2be[_0xd9ff('0x33')]=_[_0xd9ff('0x34')](_0x4ba2be[_0xd9ff('0x30')],_0x4ba2be[_0xd9ff('0x31')]);_0xcea5db[_0xd9ff('0x35')]=_[_0xd9ff('0x34')](_0x4ba2be[_0xd9ff('0x30')],qs[_0xd9ff('0x36')](_0x3dc443[_0xd9ff('0x31')][_0xd9ff('0x36')]));_0xcea5db['attributes']=_0xcea5db[_0xd9ff('0x35')][_0xd9ff('0x37')]?_0xcea5db[_0xd9ff('0x35')]:_0x4ba2be['model'];if(!_0x3dc443[_0xd9ff('0x31')]['hasOwnProperty'](_0xd9ff('0x38'))){_0xcea5db['limit']=qs[_0xd9ff('0x20')](_0x3dc443['query'][_0xd9ff('0x20')]);_0xcea5db[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x3dc443['query']['offset']);}_0xcea5db['order']=qs[_0xd9ff('0x39')](_0x3dc443[_0xd9ff('0x31')][_0xd9ff('0x39')]);_0xcea5db[_0xd9ff('0x3a')]=qs[_0xd9ff('0x33')](_[_0xd9ff('0x3b')](_0x3dc443['query'],_0x4ba2be['filters']),_0x29c532);if(_0x3dc443['query'][_0xd9ff('0x3c')]){_0xcea5db[_0xd9ff('0x3a')]=_[_0xd9ff('0x3d')](_0xcea5db[_0xd9ff('0x3a')],{'$or':_['map'](_0x29c532,function(_0x2692c0){if(_0x2692c0['type']!==_0xd9ff('0x3e')){var _0x3e2beb={};_0x3e2beb[_0x2692c0[_0xd9ff('0x29')]]={'$like':'%'+_0x3dc443[_0xd9ff('0x31')]['filter']+'%'};return _0x3e2beb;}})});}_0xcea5db=_[_0xd9ff('0x3d')]({},_0xcea5db,_0x3dc443[_0xd9ff('0x3f')]);var _0x4961a7={'where':_0xcea5db[_0xd9ff('0x3a')]};return db[_0xd9ff('0x40')][_0xd9ff('0x1e')](_0x4961a7)[_0xd9ff('0x25')](function(_0x1fe44d){_0x1d55fd[_0xd9ff('0x1e')]=_0x1fe44d;if(_0x3dc443['query'][_0xd9ff('0x41')]){_0xcea5db[_0xd9ff('0x42')]=[{'all':!![]}];}return db[_0xd9ff('0x40')][_0xd9ff('0x43')](_0xcea5db);})[_0xd9ff('0x25')](function(_0x52aab8){_0x1d55fd[_0xd9ff('0x44')]=_0x52aab8;return _0x1d55fd;})[_0xd9ff('0x25')](respondWithFilteredResult(_0x5706cf,_0xcea5db))[_0xd9ff('0x45')](handleError(_0x5706cf,null));};exports['show']=function(_0x5d06dd,_0x36843b){var _0x7eb1a={'raw':!![],'where':{'id':_0x5d06dd[_0xd9ff('0x46')]['id']}},_0x18d1c4={};_0x18d1c4[_0xd9ff('0x30')]=_[_0xd9ff('0x32')](db['VoiceMail'][_0xd9ff('0x2d')]);_0x18d1c4[_0xd9ff('0x31')]=_['keys'](_0x5d06dd[_0xd9ff('0x31')]);_0x18d1c4[_0xd9ff('0x33')]=_[_0xd9ff('0x34')](_0x18d1c4[_0xd9ff('0x30')],_0x18d1c4[_0xd9ff('0x31')]);_0x7eb1a['attributes']=_['intersection'](_0x18d1c4['model'],qs[_0xd9ff('0x36')](_0x5d06dd['query'][_0xd9ff('0x36')]));_0x7eb1a[_0xd9ff('0x35')]=_0x7eb1a[_0xd9ff('0x35')]['length']?_0x7eb1a[_0xd9ff('0x35')]:_0x18d1c4[_0xd9ff('0x30')];if(_0x5d06dd['query'][_0xd9ff('0x41')]){_0x7eb1a[_0xd9ff('0x42')]=[{'all':!![]}];}_0x7eb1a=_[_0xd9ff('0x3d')]({},_0x7eb1a,_0x5d06dd[_0xd9ff('0x3f')]);return db['VoiceMail'][_0xd9ff('0x47')](_0x7eb1a)['then'](handleEntityNotFound(_0x36843b,null))[_0xd9ff('0x25')](respondWithResult(_0x36843b,null))['catch'](handleError(_0x36843b,null));};exports[_0xd9ff('0x48')]=function(_0x3d91e6,_0x2bf37a){return db[_0xd9ff('0x40')][_0xd9ff('0x48')](_0x3d91e6['body'],{})[_0xd9ff('0x25')](function(_0x3d6f11){var _0x2fbe53=_0x3d91e6[_0xd9ff('0x49')]['get']({'plain':!![]});if(!_0x2fbe53)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fbe53['role']===_0xd9ff('0x49')){var _0x40be56=_0x3d6f11[_0xd9ff('0x4a')]({'plain':!![]});var _0x572618=_0xd9ff('0x4b');return db[_0xd9ff('0x4c')][_0xd9ff('0x47')]({'where':{'name':_0x572618,'userProfileId':_0x2fbe53[_0xd9ff('0x4d')]},'raw':!![]})[_0xd9ff('0x25')](function(_0x40d391){if(_0x40d391&&_0x40d391[_0xd9ff('0x4e')]===0x0){return db[_0xd9ff('0x26')][_0xd9ff('0x48')]({'name':_0x40be56[_0xd9ff('0x29')],'resourceId':_0x40be56['id'],'type':_0x40d391[_0xd9ff('0x29')],'sectionId':_0x40d391['id']},{})[_0xd9ff('0x25')](function(){return _0x3d6f11;});}else{return _0x3d6f11;}})[_0xd9ff('0x45')](function(_0x487b07){logger[_0xd9ff('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x487b07);throw _0x487b07;});}return _0x3d6f11;})[_0xd9ff('0x25')](respondWithResult(_0x2bf37a,0xc9))['catch'](handleError(_0x2bf37a,null));};exports[_0xd9ff('0x24')]=function(_0x49623d,_0xc82610){if(_0x49623d['body']['id']){delete _0x49623d[_0xd9ff('0x4f')]['id'];}return db['VoiceMail'][_0xd9ff('0x47')]({'where':{'id':_0x49623d['params']['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0xc82610,null))['then'](saveUpdates(_0x49623d[_0xd9ff('0x4f')],null))[_0xd9ff('0x25')](respondWithResult(_0xc82610,null))[_0xd9ff('0x45')](handleError(_0xc82610,null));};exports[_0xd9ff('0x50')]=function(_0x4df17b,_0x8c136b){return db[_0xd9ff('0x40')][_0xd9ff('0x47')]({'where':{'id':_0x4df17b['params']['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x8c136b,null))[_0xd9ff('0x25')](removeEntity(_0x8c136b,null))[_0xd9ff('0x45')](handleError(_0x8c136b,null));};exports[_0xd9ff('0x51')]=function(_0x11dd0c,_0x56e8e8,_0x27cc9e){return db[_0xd9ff('0x40')][_0xd9ff('0x52')]({'where':{'id':_0x11dd0c[_0xd9ff('0x46')]['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x56e8e8,null))[_0xd9ff('0x25')](function(_0x458fd4){var _0x5bac6f;var _0x3be850={},_0x11251f={};_0x11251f['model']=_[_0xd9ff('0x32')](db[_0xd9ff('0x53')]['rawAttributes']);_0x11251f[_0xd9ff('0x31')]=_[_0xd9ff('0x32')](_0x11dd0c[_0xd9ff('0x31')]);_0x11251f['filters']=_['intersection'](_0x11251f[_0xd9ff('0x30')],_0x11251f['query']);_0x3be850[_0xd9ff('0x35')]=_[_0xd9ff('0x34')](_0x11251f[_0xd9ff('0x30')],qs[_0xd9ff('0x36')](_0x11dd0c['query']['fields']));_0x3be850['attributes']=_0x3be850[_0xd9ff('0x35')][_0xd9ff('0x37')]?_0x3be850[_0xd9ff('0x35')]:_0x11251f[_0xd9ff('0x30')];if(!_0x11dd0c[_0xd9ff('0x31')]['hasOwnProperty'](_0xd9ff('0x38'))){_0x3be850['limit']=qs[_0xd9ff('0x20')](_0x11dd0c[_0xd9ff('0x31')][_0xd9ff('0x20')]);_0x3be850[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x11dd0c[_0xd9ff('0x31')][_0xd9ff('0x1f')]);}_0x3be850[_0xd9ff('0x54')]=qs['sort'](_0x11dd0c[_0xd9ff('0x31')][_0xd9ff('0x39')]);_0x3be850['where']=qs['filters'](_[_0xd9ff('0x3b')](_0x11dd0c['query'],_0x11251f[_0xd9ff('0x33')]));if(_0x11dd0c[_0xd9ff('0x31')]['filter']){_0x3be850[_0xd9ff('0x3a')]=_[_0xd9ff('0x3d')](_0x3be850[_0xd9ff('0x3a')],{'$or':_[_0xd9ff('0x2c')](_0x3be850[_0xd9ff('0x35')],function(_0x49c5fa){var _0x12a8d7={};_0x12a8d7[_0x49c5fa]={'$like':'%'+_0x11dd0c['query']['filter']+'%'};return _0x12a8d7;})});}_0x3be850[_0xd9ff('0x3a')]=_[_0xd9ff('0x3d')](_0x3be850[_0xd9ff('0x3a')],{'mailboxuser':_0x458fd4[_0xd9ff('0x55')]});_0x3be850=_['merge']({},_0x3be850,_0x11dd0c[_0xd9ff('0x3f')]);return db[_0xd9ff('0x53')][_0xd9ff('0x56')](_0x3be850)[_0xd9ff('0x25')](respondWithFilteredResult(_0x56e8e8,_0x3be850));})[_0xd9ff('0x45')](handleError(_0x56e8e8,null));}; \ No newline at end of file +var _0xae60=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','VoiceMail','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','order','pick','mailbox','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x157e1d,_0x2ac5d2){var _0x493d29=function(_0x537f8e){while(--_0x537f8e){_0x157e1d['push'](_0x157e1d['shift']());}};_0x493d29(++_0x2ac5d2);}(_0xae60,0x1c7));var _0x0ae6=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xae60[_0x2c7618];return _0x5ce3f0;};'use strict';var emlformat=require(_0x0ae6('0x0'));var rimraf=require(_0x0ae6('0x1'));var zipdir=require(_0x0ae6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae6('0x3'));var moment=require(_0x0ae6('0x4'));var BPromise=require(_0x0ae6('0x5'));var Mustache=require('mustache');var util=require(_0x0ae6('0x6'));var path=require(_0x0ae6('0x7'));var sox=require('sox');var csv=require(_0x0ae6('0x8'));var ejs=require(_0x0ae6('0x9'));var fs=require('fs');var fs_extra=require(_0x0ae6('0xa'));var _=require(_0x0ae6('0xb'));var squel=require(_0x0ae6('0xc'));var crypto=require(_0x0ae6('0xd'));var jsforce=require(_0x0ae6('0xe'));var deskjs=require(_0x0ae6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ae6('0x10'));var Papa=require(_0x0ae6('0x11'));var Redis=require(_0x0ae6('0x12'));var authService=require(_0x0ae6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0ae6('0x14'));var hardwareService=require(_0x0ae6('0x15'));var logger=require(_0x0ae6('0x16'))(_0x0ae6('0x17'));var utils=require(_0x0ae6('0x18'));var config=require(_0x0ae6('0x19'));var licenseUtil=require(_0x0ae6('0x1a'));var db=require(_0x0ae6('0x1b'))['db'];function respondWithStatusCode(_0x3b05a4,_0x30f8f9){_0x30f8f9=_0x30f8f9||0xcc;return function(_0x1aefd5){if(_0x1aefd5){return _0x3b05a4[_0x0ae6('0x1c')](_0x30f8f9);}return _0x3b05a4[_0x0ae6('0x1d')](_0x30f8f9)[_0x0ae6('0x1e')]();};}function respondWithResult(_0x4d2da8,_0x3809c6){_0x3809c6=_0x3809c6||0xc8;return function(_0x10c3bc){if(_0x10c3bc){return _0x4d2da8[_0x0ae6('0x1d')](_0x3809c6)[_0x0ae6('0x1f')](_0x10c3bc);}};}function respondWithFilteredResult(_0xce3e23,_0x3a1e26){return function(_0x151144){if(_0x151144){var _0x3b64ac=typeof _0x3a1e26[_0x0ae6('0x20')]===_0x0ae6('0x21')&&typeof _0x3a1e26[_0x0ae6('0x22')]===_0x0ae6('0x21');var _0xa97151=_0x151144[_0x0ae6('0x23')];var _0xda4f01=_0x3b64ac?0x0:_0x3a1e26[_0x0ae6('0x20')];var _0x2fdf25=_0x3b64ac?_0x151144[_0x0ae6('0x23')]:_0x3a1e26[_0x0ae6('0x20')]+_0x3a1e26[_0x0ae6('0x22')];var _0x26b369;if(_0x2fdf25>=_0xa97151){_0x2fdf25=_0xa97151;_0x26b369=0xc8;}else{_0x26b369=0xce;}_0xce3e23[_0x0ae6('0x1d')](_0x26b369);return _0xce3e23['set'](_0x0ae6('0x24'),_0xda4f01+'-'+_0x2fdf25+'/'+_0xa97151)[_0x0ae6('0x1f')](_0x151144);}return null;};}function patchUpdates(_0x140a3b){return function(_0x1027c2){try{jsonpatch[_0x0ae6('0x25')](_0x1027c2,_0x140a3b,!![]);}catch(_0xb4e6af){return BPromise[_0x0ae6('0x26')](_0xb4e6af);}return _0x1027c2[_0x0ae6('0x27')]();};}function saveUpdates(_0x515f3d,_0x39b22e){return function(_0x2a6484){if(_0x2a6484){return _0x2a6484[_0x0ae6('0x28')](_0x515f3d)[_0x0ae6('0x29')](function(_0x31ad85){return _0x31ad85;});}return null;};}function removeEntity(_0x4eba72,_0x296a9d){return function(_0x4e1242){if(_0x4e1242){return _0x4e1242[_0x0ae6('0x2a')]()[_0x0ae6('0x29')](function(){var _0x3c43d8=_0x4e1242[_0x0ae6('0x2b')]({'plain':!![]});var _0x5b86fe=_0x0ae6('0x2c');return db[_0x0ae6('0x2d')]['destroy']({'where':{'type':_0x5b86fe,'resourceId':_0x3c43d8['id']}})['then'](function(){return _0x4e1242;});})[_0x0ae6('0x29')](function(){_0x4eba72[_0x0ae6('0x1d')](0xcc)[_0x0ae6('0x1e')]();});}};}function handleEntityNotFound(_0x4fe77b,_0x3b5f8f){return function(_0xb68cbe){if(!_0xb68cbe){_0x4fe77b[_0x0ae6('0x1c')](0x194);}return _0xb68cbe;};}function handleError(_0x4df796,_0x2428b2){_0x2428b2=_0x2428b2||0x1f4;return function(_0x29fef3){logger[_0x0ae6('0x2e')](_0x29fef3[_0x0ae6('0x2f')]);if(_0x29fef3[_0x0ae6('0x30')]){delete _0x29fef3[_0x0ae6('0x30')];}_0x4df796['status'](_0x2428b2)['send'](_0x29fef3);};}exports[_0x0ae6('0x31')]=function(_0x419384,_0x4e6df8){var _0x4a06f1={},_0x1ca059={},_0x278577={'count':0x0,'rows':[]};var _0x714c6d=_[_0x0ae6('0x32')](db['VoiceMail'][_0x0ae6('0x33')],function(_0x429f06){return{'name':_0x429f06[_0x0ae6('0x34')],'type':_0x429f06['type'][_0x0ae6('0x35')]};});_0x1ca059[_0x0ae6('0x36')]=_[_0x0ae6('0x32')](_0x714c6d,_0x0ae6('0x30'));_0x1ca059[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x419384[_0x0ae6('0x37')]);_0x1ca059[_0x0ae6('0x39')]=_[_0x0ae6('0x3a')](_0x1ca059[_0x0ae6('0x36')],_0x1ca059['query']);_0x4a06f1[_0x0ae6('0x3b')]=_[_0x0ae6('0x3a')](_0x1ca059['model'],qs[_0x0ae6('0x3c')](_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x4a06f1['attributes']=_0x4a06f1[_0x0ae6('0x3b')]['length']?_0x4a06f1['attributes']:_0x1ca059[_0x0ae6('0x36')];if(!_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3d')](_0x0ae6('0x3e'))){_0x4a06f1[_0x0ae6('0x22')]=qs['limit'](_0x419384['query'][_0x0ae6('0x22')]);_0x4a06f1['offset']=qs[_0x0ae6('0x20')](_0x419384['query'][_0x0ae6('0x20')]);}_0x4a06f1['order']=qs[_0x0ae6('0x3f')](_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3f')]);_0x4a06f1[_0x0ae6('0x40')]=qs['filters'](_['pick'](_0x419384[_0x0ae6('0x37')],_0x1ca059[_0x0ae6('0x39')]),_0x714c6d);if(_0x419384[_0x0ae6('0x37')]['filter']){_0x4a06f1[_0x0ae6('0x40')]=_['merge'](_0x4a06f1[_0x0ae6('0x40')],{'$or':_[_0x0ae6('0x32')](_0x714c6d,function(_0x460e3f){if(_0x460e3f[_0x0ae6('0x41')]!==_0x0ae6('0x42')){var _0x1f8258={};_0x1f8258[_0x460e3f['name']]={'$like':'%'+_0x419384[_0x0ae6('0x37')][_0x0ae6('0x43')]+'%'};return _0x1f8258;}})});}_0x4a06f1=_[_0x0ae6('0x44')]({},_0x4a06f1,_0x419384[_0x0ae6('0x45')]);var _0x1ad562={'where':_0x4a06f1[_0x0ae6('0x40')]};return db[_0x0ae6('0x46')][_0x0ae6('0x23')](_0x1ad562)['then'](function(_0x38faeb){_0x278577[_0x0ae6('0x23')]=_0x38faeb;if(_0x419384[_0x0ae6('0x37')][_0x0ae6('0x47')]){_0x4a06f1[_0x0ae6('0x48')]=[{'all':!![]}];}return db[_0x0ae6('0x46')][_0x0ae6('0x49')](_0x4a06f1);})[_0x0ae6('0x29')](function(_0xb38cbb){_0x278577[_0x0ae6('0x4a')]=_0xb38cbb;return _0x278577;})[_0x0ae6('0x29')](respondWithFilteredResult(_0x4e6df8,_0x4a06f1))[_0x0ae6('0x4b')](handleError(_0x4e6df8,null));};exports[_0x0ae6('0x4c')]=function(_0x85d9ce,_0x201e95){var _0x16d225={'raw':!![],'where':{'id':_0x85d9ce[_0x0ae6('0x4d')]['id']}},_0x4235de={};_0x4235de['model']=_[_0x0ae6('0x38')](db[_0x0ae6('0x46')][_0x0ae6('0x33')]);_0x4235de[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x85d9ce[_0x0ae6('0x37')]);_0x4235de['filters']=_[_0x0ae6('0x3a')](_0x4235de[_0x0ae6('0x36')],_0x4235de[_0x0ae6('0x37')]);_0x16d225[_0x0ae6('0x3b')]=_['intersection'](_0x4235de['model'],qs['fields'](_0x85d9ce[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x16d225[_0x0ae6('0x3b')]=_0x16d225['attributes'][_0x0ae6('0x4e')]?_0x16d225[_0x0ae6('0x3b')]:_0x4235de['model'];if(_0x85d9ce[_0x0ae6('0x37')][_0x0ae6('0x47')]){_0x16d225['include']=[{'all':!![]}];}_0x16d225=_[_0x0ae6('0x44')]({},_0x16d225,_0x85d9ce[_0x0ae6('0x45')]);return db['VoiceMail'][_0x0ae6('0x4f')](_0x16d225)[_0x0ae6('0x29')](handleEntityNotFound(_0x201e95,null))[_0x0ae6('0x29')](respondWithResult(_0x201e95,null))['catch'](handleError(_0x201e95,null));};exports[_0x0ae6('0x50')]=function(_0x21de54,_0x46075a){return db[_0x0ae6('0x46')][_0x0ae6('0x50')](_0x21de54[_0x0ae6('0x51')],{})[_0x0ae6('0x29')](function(_0x5ababa){var _0x5afd3b=_0x21de54[_0x0ae6('0x52')][_0x0ae6('0x2b')]({'plain':!![]});if(!_0x5afd3b)throw new Error(_0x0ae6('0x53'));if(_0x5afd3b['role']===_0x0ae6('0x52')){var _0x51df5c=_0x5ababa['get']({'plain':!![]});var _0x23454a=_0x0ae6('0x2c');return db[_0x0ae6('0x54')]['find']({'where':{'name':_0x23454a,'userProfileId':_0x5afd3b[_0x0ae6('0x55')]},'raw':!![]})[_0x0ae6('0x29')](function(_0x31a4db){if(_0x31a4db&&_0x31a4db[_0x0ae6('0x56')]===0x0){return db[_0x0ae6('0x2d')][_0x0ae6('0x50')]({'name':_0x51df5c[_0x0ae6('0x30')],'resourceId':_0x51df5c['id'],'type':_0x31a4db[_0x0ae6('0x30')],'sectionId':_0x31a4db['id']},{})[_0x0ae6('0x29')](function(){return _0x5ababa;});}else{return _0x5ababa;}})[_0x0ae6('0x4b')](function(_0x1cc515){logger[_0x0ae6('0x2e')](_0x0ae6('0x57'),_0x1cc515);throw _0x1cc515;});}return _0x5ababa;})[_0x0ae6('0x29')](respondWithResult(_0x46075a,0xc9))[_0x0ae6('0x4b')](handleError(_0x46075a,null));};exports['update']=function(_0x4cbe19,_0x30a9f1){if(_0x4cbe19[_0x0ae6('0x51')]['id']){delete _0x4cbe19[_0x0ae6('0x51')]['id'];}return db[_0x0ae6('0x46')][_0x0ae6('0x4f')]({'where':{'id':_0x4cbe19[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x30a9f1,null))[_0x0ae6('0x29')](saveUpdates(_0x4cbe19[_0x0ae6('0x51')],null))[_0x0ae6('0x29')](respondWithResult(_0x30a9f1,null))[_0x0ae6('0x4b')](handleError(_0x30a9f1,null));};exports[_0x0ae6('0x2a')]=function(_0x16a311,_0x2babcc){return db[_0x0ae6('0x46')][_0x0ae6('0x4f')]({'where':{'id':_0x16a311[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x2babcc,null))['then'](removeEntity(_0x2babcc,null))[_0x0ae6('0x4b')](handleError(_0x2babcc,null));};exports[_0x0ae6('0x58')]=function(_0x15191e,_0x578125,_0x2648de){return db[_0x0ae6('0x46')][_0x0ae6('0x59')]({'where':{'id':_0x15191e[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x578125,null))[_0x0ae6('0x29')](function(_0x5ec716){var _0x456d2a;var _0x2132d6={},_0x1c53bf={};_0x1c53bf[_0x0ae6('0x36')]=_[_0x0ae6('0x38')](db[_0x0ae6('0x5a')][_0x0ae6('0x33')]);_0x1c53bf[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x15191e['query']);_0x1c53bf['filters']=_[_0x0ae6('0x3a')](_0x1c53bf[_0x0ae6('0x36')],_0x1c53bf['query']);_0x2132d6['attributes']=_[_0x0ae6('0x3a')](_0x1c53bf[_0x0ae6('0x36')],qs[_0x0ae6('0x3c')](_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x2132d6[_0x0ae6('0x3b')]=_0x2132d6[_0x0ae6('0x3b')]['length']?_0x2132d6[_0x0ae6('0x3b')]:_0x1c53bf['model'];if(!_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x3d')]('nolimit')){_0x2132d6[_0x0ae6('0x22')]=qs[_0x0ae6('0x22')](_0x15191e[_0x0ae6('0x37')]['limit']);_0x2132d6[_0x0ae6('0x20')]=qs['offset'](_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x20')]);}_0x2132d6[_0x0ae6('0x5b')]=qs[_0x0ae6('0x3f')](_0x15191e['query']['sort']);_0x2132d6[_0x0ae6('0x40')]=qs[_0x0ae6('0x39')](_[_0x0ae6('0x5c')](_0x15191e[_0x0ae6('0x37')],_0x1c53bf[_0x0ae6('0x39')]));if(_0x15191e[_0x0ae6('0x37')]['filter']){_0x2132d6['where']=_[_0x0ae6('0x44')](_0x2132d6[_0x0ae6('0x40')],{'$or':_[_0x0ae6('0x32')](_0x2132d6[_0x0ae6('0x3b')],function(_0x2bafcc){var _0x15f38f={};_0x15f38f[_0x2bafcc]={'$like':'%'+_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x43')]+'%'};return _0x15f38f;})});}_0x2132d6['where']=_[_0x0ae6('0x44')](_0x2132d6[_0x0ae6('0x40')],{'mailboxuser':_0x5ec716[_0x0ae6('0x5d')]});_0x2132d6=_[_0x0ae6('0x44')]({},_0x2132d6,_0x15191e[_0x0ae6('0x45')]);return db[_0x0ae6('0x5a')]['findAndCountAll'](_0x2132d6)['then'](respondWithFilteredResult(_0x578125,_0x2132d6));})[_0x0ae6('0x4b')](handleError(_0x578125,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index f2cca75..2f7bea9 100644 --- a/server/api/voiceMail/voiceMail.model.js +++ b/server/api/voiceMail/voiceMail.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc009=['./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','context','lodash','util','api','bluebird','path'];(function(_0x444478,_0x241299){var _0x3efd57=function(_0x27f1fb){while(--_0x27f1fb){_0x444478['push'](_0x444478['shift']());}};_0x3efd57(++_0x241299);}(_0xc009,0x8a));var _0x9c00=function(_0xbd46d,_0x39d268){_0xbd46d=_0xbd46d-0x0;var _0x18f795=_0xc009[_0xbd46d];return _0x18f795;};'use strict';var _=require(_0x9c00('0x0'));var util=require(_0x9c00('0x1'));var logger=require('../../config/logger')(_0x9c00('0x2'));var moment=require('moment');var BPromise=require(_0x9c00('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c00('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9c00('0x5'));module[_0x9c00('0x6')]=function(_0x432f0f,_0x220fb5){return _0x432f0f[_0x9c00('0x7')]('VoiceMail',attributes,{'tableName':_0x9c00('0x8'),'paranoid':![],'indexes':[{'name':_0x9c00('0x9'),'fields':['mailbox',_0x9c00('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3051=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','lodash','util','../../config/logger','api'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x3051,0xf8));var _0x1305=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3051[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1305('0x0'));var util=require(_0x1305('0x1'));var logger=require(_0x1305('0x2'))(_0x1305('0x3'));var moment=require('moment');var BPromise=require(_0x1305('0x4'));var rp=require(_0x1305('0x5'));var fs=require('fs');var path=require(_0x1305('0x6'));var rimraf=require(_0x1305('0x7'));var config=require(_0x1305('0x8'));var attributes=require(_0x1305('0x9'));module[_0x1305('0xa')]=function(_0x1559fe,_0x57ff7d){return _0x1559fe[_0x1305('0xb')](_0x1305('0xc'),attributes,{'tableName':_0x1305('0xd'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 0c47b9c..dd1f0d2 100644 --- a/server/api/voiceMail/voiceMail.rpc.js +++ b/server/api/voiceMail/voiceMail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe1bf=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x14b944,_0x541124){var _0x467250=function(_0x81fd3d){while(--_0x81fd3d){_0x14b944['push'](_0x14b944['shift']());}};_0x467250(++_0x541124);}(_0xe1bf,0x18c));var _0xfe1b=function(_0x2fcf4f,_0xf3009d){_0x2fcf4f=_0x2fcf4f-0x0;var _0x2e3b3e=_0xe1bf[_0x2fcf4f];return _0x2e3b3e;};'use strict';var _=require('lodash');var util=require(_0xfe1b('0x0'));var moment=require(_0xfe1b('0x1'));var BPromise=require(_0xfe1b('0x2'));var rs=require(_0xfe1b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe1b('0x4'))['db'];var utils=require(_0xfe1b('0x5'));var logger=require(_0xfe1b('0x6'))('rpc');var config=require(_0xfe1b('0x7'));var jayson=require(_0xfe1b('0x8'));var client=jayson[_0xfe1b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17a860,_0x4bd01,_0x101c65){return new BPromise(function(_0x4037f9,_0x1dbea5){return client[_0xfe1b('0xa')](_0x17a860,_0x101c65)[_0xfe1b('0xb')](function(_0x4ac373){logger['info'](_0xfe1b('0xc'),_0x4bd01,_0xfe1b('0xd'));logger['debug'](_0xfe1b('0xe'),_0x4bd01,_0xfe1b('0xd'),JSON[_0xfe1b('0xf')](_0x4ac373));if(_0x4ac373[_0xfe1b('0x10')]){if(_0x4ac373[_0xfe1b('0x10')][_0xfe1b('0x11')]===0x1f4){logger[_0xfe1b('0x10')](_0xfe1b('0xc'),_0x4bd01,_0x4ac373['error'][_0xfe1b('0x12')]);return _0x1dbea5(_0x4ac373[_0xfe1b('0x10')]['message']);}logger[_0xfe1b('0x10')](_0xfe1b('0xc'),_0x4bd01,_0x4ac373['error'][_0xfe1b('0x12')]);return _0x4037f9(_0x4ac373['error'][_0xfe1b('0x12')]);}else{logger['info'](_0xfe1b('0xc'),_0x4bd01,_0xfe1b('0xd'));_0x4037f9(_0x4ac373[_0xfe1b('0x13')][_0xfe1b('0x12')]);}})[_0xfe1b('0x14')](function(_0x51d37b){logger[_0xfe1b('0x10')](_0xfe1b('0xc'),_0x4bd01,_0x51d37b);_0x1dbea5(_0x51d37b);});});} \ No newline at end of file +var _0x7e2c=['../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3c79d1,_0x1e55d4){var _0x1646e8=function(_0x278dfe){while(--_0x278dfe){_0x3c79d1['push'](_0x3c79d1['shift']());}};_0x1646e8(++_0x1e55d4);}(_0x7e2c,0x6c));var _0xc7e2=function(_0x4b25d8,_0x3f86c9){_0x4b25d8=_0x4b25d8-0x0;var _0x2d23e1=_0x7e2c[_0x4b25d8];return _0x2d23e1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc7e2('0x0'));var BPromise=require(_0xc7e2('0x1'));var rs=require(_0xc7e2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc7e2('0x3'))['db'];var utils=require(_0xc7e2('0x4'));var logger=require(_0xc7e2('0x5'))(_0xc7e2('0x6'));var config=require(_0xc7e2('0x7'));var jayson=require(_0xc7e2('0x8'));var client=jayson[_0xc7e2('0x9')][_0xc7e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20d0b7,_0x577af1,_0x3d9f17){return new BPromise(function(_0x500065,_0x1755db){return client[_0xc7e2('0xb')](_0x20d0b7,_0x3d9f17)[_0xc7e2('0xc')](function(_0x13ef0b){logger[_0xc7e2('0xd')](_0xc7e2('0xe'),_0x577af1,_0xc7e2('0xf'));logger[_0xc7e2('0x10')](_0xc7e2('0x11'),_0x577af1,_0xc7e2('0xf'),JSON[_0xc7e2('0x12')](_0x13ef0b));if(_0x13ef0b[_0xc7e2('0x13')]){if(_0x13ef0b[_0xc7e2('0x13')][_0xc7e2('0x14')]===0x1f4){logger[_0xc7e2('0x13')](_0xc7e2('0xe'),_0x577af1,_0x13ef0b['error'][_0xc7e2('0x15')]);return _0x1755db(_0x13ef0b[_0xc7e2('0x13')][_0xc7e2('0x15')]);}logger[_0xc7e2('0x13')](_0xc7e2('0xe'),_0x577af1,_0x13ef0b[_0xc7e2('0x13')]['message']);return _0x500065(_0x13ef0b[_0xc7e2('0x13')][_0xc7e2('0x15')]);}else{logger['info'](_0xc7e2('0xe'),_0x577af1,_0xc7e2('0xf'));_0x500065(_0x13ef0b['result'][_0xc7e2('0x15')]);}})[_0xc7e2('0x16')](function(_0x57357e){logger[_0xc7e2('0x13')](_0xc7e2('0xe'),_0x577af1,_0x57357e);_0x1755db(_0x57357e);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 72a30a6..fff8f75 100644 --- a/server/api/voiceMailMessage/index.js +++ b/server/api/voiceMailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c6d=['../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','download','create','put','update','destroy','exports','path','connect-timeout','express','fs-extra'];(function(_0x3d4a91,_0x276ad1){var _0x55fc7f=function(_0x22f600){while(--_0x22f600){_0x3d4a91['push'](_0x3d4a91['shift']());}};_0x55fc7f(++_0x276ad1);}(_0x7c6d,0xf8));var _0xd7c6=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x7c6d[_0x4baae2];return _0x1a2285;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd7c6('0x0'));var timeout=require(_0xd7c6('0x1'));var express=require(_0xd7c6('0x2'));var router=express['Router']();var fs_extra=require(_0xd7c6('0x3'));var auth=require(_0xd7c6('0x4'));var interaction=require(_0xd7c6('0x5'));var config=require('../../config/environment');var controller=require(_0xd7c6('0x6'));router[_0xd7c6('0x7')]('/',auth[_0xd7c6('0x8')](),controller[_0xd7c6('0x9')]);router[_0xd7c6('0x7')](_0xd7c6('0xa'),auth[_0xd7c6('0x8')](),controller[_0xd7c6('0xb')]);router[_0xd7c6('0x7')]('/:id/download',auth[_0xd7c6('0x8')](),controller[_0xd7c6('0xc')]);router['post']('/',auth[_0xd7c6('0x8')](),controller[_0xd7c6('0xd')]);router[_0xd7c6('0xe')](_0xd7c6('0xa'),auth['isAuthenticated'](),controller[_0xd7c6('0xf')]);router['delete'](_0xd7c6('0xa'),auth[_0xd7c6('0x8')](),controller[_0xd7c6('0x10')]);module[_0xd7c6('0x11')]=router; \ No newline at end of file +var _0x6b5e=['download','post','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/download'];(function(_0xe98645,_0x6fe58c){var _0x1c8a2d=function(_0x3dfa27){while(--_0x3dfa27){_0xe98645['push'](_0xe98645['shift']());}};_0x1c8a2d(++_0x6fe58c);}(_0x6b5e,0x1d4));var _0xe6b5=function(_0x4131c3,_0x3317b1){_0x4131c3=_0x4131c3-0x0;var _0x31b229=_0x6b5e[_0x4131c3];return _0x31b229;};'use strict';var multer=require(_0xe6b5('0x0'));var util=require(_0xe6b5('0x1'));var path=require(_0xe6b5('0x2'));var timeout=require(_0xe6b5('0x3'));var express=require(_0xe6b5('0x4'));var router=express['Router']();var fs_extra=require(_0xe6b5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe6b5('0x6'));var config=require(_0xe6b5('0x7'));var controller=require('./voiceMailMessage.controller');router[_0xe6b5('0x8')]('/',auth[_0xe6b5('0x9')](),controller['index']);router['get']('/:id',auth[_0xe6b5('0x9')](),controller[_0xe6b5('0xa')]);router['get'](_0xe6b5('0xb'),auth['isAuthenticated'](),controller[_0xe6b5('0xc')]);router[_0xe6b5('0xd')]('/',auth[_0xe6b5('0x9')](),controller['create']);router[_0xe6b5('0xe')]('/:id',auth[_0xe6b5('0x9')](),controller[_0xe6b5('0xf')]);router[_0xe6b5('0x10')](_0xe6b5('0x11'),auth[_0xe6b5('0x9')](),controller[_0xe6b5('0x12')]);module[_0xe6b5('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 92a9b33..1200e6d 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.attributes.js +++ b/server/api/voiceMailMessage/voiceMailMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e1c=['literal','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x2db32c,_0x26088b){var _0xd8149f=function(_0x43c52e){while(--_0x43c52e){_0x2db32c['push'](_0x2db32c['shift']());}};_0xd8149f(++_0x26088b);}(_0x0e1c,0x191));var _0xc0e1=function(_0x1e2cfe,_0x399b35){_0x1e2cfe=_0x1e2cfe-0x0;var _0x611709=_0x0e1c[_0x1e2cfe];return _0x611709;};'use strict';var Sequelize=require(_0xc0e1('0x0'));module[_0xc0e1('0x1')]={'name':{'type':Sequelize[_0xc0e1('0x2')],'get':function(_0x4b592b){return this[_0xc0e1('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xc0e1('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xc0e1('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xc0e1('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xc0e1('0x5')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xc0e1('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xc0e1('0x6')](_0xc0e1('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0xc0e1('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xc0e1('0x5')],'defaultValue':''},'stamp':{'type':_0xc0e1('0x8'),'defaultValue':Sequelize[_0xc0e1('0x9')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x9d3f=['INTEGER','STRING','BLOB','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue'];(function(_0x42b707,_0x19a39f){var _0x592719=function(_0x5562c2){while(--_0x5562c2){_0x42b707['push'](_0x42b707['shift']());}};_0x592719(++_0x19a39f);}(_0x9d3f,0x1d1));var _0xf9d3=function(_0x1c119a,_0x24c360){_0x1c119a=_0x1c119a-0x0;var _0x3b14da=_0x9d3f[_0x1c119a];return _0x3b14da;};'use strict';var Sequelize=require('sequelize');module[_0xf9d3('0x0')]={'name':{'type':Sequelize[_0xf9d3('0x1')],'get':function(_0x41ce8d){return this[_0xf9d3('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xf9d3('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xf9d3('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xf9d3('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xf9d3('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xf9d3('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xf9d3('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xf9d3('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xf9d3('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xf9d3('0x5')](_0xf9d3('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xf9d3('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xf9d3('0x7')](_0xf9d3('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 91bfeab..bf8b804 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.controller.js +++ b/server/api/voiceMailMessage/voiceMailMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02a6=['body','download','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','limit','undefined','offset','count','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','VoiceMailMessage','includeAll','include','findAll','rows','catch','show','params','find','create'];(function(_0x2c6bad,_0x29ffed){var _0x5f5435=function(_0x23f89b){while(--_0x23f89b){_0x2c6bad['push'](_0x2c6bad['shift']());}};_0x5f5435(++_0x29ffed);}(_0x02a6,0xb7));var _0x602a=function(_0x29f58d,_0x5d4371){_0x29f58d=_0x29f58d-0x0;var _0x4c006e=_0x02a6[_0x29f58d];return _0x4c006e;};'use strict';var emlformat=require(_0x602a('0x0'));var rimraf=require(_0x602a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x602a('0x2'));var rp=require(_0x602a('0x3'));var moment=require(_0x602a('0x4'));var BPromise=require(_0x602a('0x5'));var Mustache=require(_0x602a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x602a('0x7'));var csv=require(_0x602a('0x8'));var ejs=require(_0x602a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x602a('0xa'));var squel=require('squel');var crypto=require(_0x602a('0xb'));var jsforce=require(_0x602a('0xc'));var deskjs=require(_0x602a('0xd'));var toCsv=require(_0x602a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x602a('0xe'));var authService=require(_0x602a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x602a('0x10'));var hardwareService=require(_0x602a('0x11'));var logger=require(_0x602a('0x12'))(_0x602a('0x13'));var utils=require(_0x602a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x602a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xade59b,_0x444ad9){_0x444ad9=_0x444ad9||0xcc;return function(_0x5caa1a){if(_0x5caa1a){return _0xade59b['sendStatus'](_0x444ad9);}return _0xade59b[_0x602a('0x16')](_0x444ad9)['end']();};}function respondWithResult(_0x1db6e5,_0x4943a0){_0x4943a0=_0x4943a0||0xc8;return function(_0x4a8bb4){if(_0x4a8bb4){return _0x1db6e5[_0x602a('0x16')](_0x4943a0)['json'](_0x4a8bb4);}};}function respondWithFilteredResult(_0x53b107,_0x20a373){return function(_0x9f3ea2){if(_0x9f3ea2){var _0x383046=typeof _0x20a373['offset']==='undefined'&&typeof _0x20a373[_0x602a('0x17')]===_0x602a('0x18');var _0x5c6913=_0x9f3ea2['count'];var _0x3d9a41=_0x383046?0x0:_0x20a373[_0x602a('0x19')];var _0xe3e1cc=_0x383046?_0x9f3ea2[_0x602a('0x1a')]:_0x20a373['offset']+_0x20a373[_0x602a('0x17')];var _0x3ec6e5;if(_0xe3e1cc>=_0x5c6913){_0xe3e1cc=_0x5c6913;_0x3ec6e5=0xc8;}else{_0x3ec6e5=0xce;}_0x53b107[_0x602a('0x16')](_0x3ec6e5);return _0x53b107['set'](_0x602a('0x1b'),_0x3d9a41+'-'+_0xe3e1cc+'/'+_0x5c6913)[_0x602a('0x1c')](_0x9f3ea2);}return null;};}function patchUpdates(_0x22e0ef){return function(_0x4981af){try{jsonpatch[_0x602a('0x1d')](_0x4981af,_0x22e0ef,!![]);}catch(_0x5d4e65){return BPromise[_0x602a('0x1e')](_0x5d4e65);}return _0x4981af[_0x602a('0x1f')]();};}function saveUpdates(_0xc047d2,_0x1c492e){return function(_0xc7bb77){if(_0xc7bb77){return _0xc7bb77[_0x602a('0x20')](_0xc047d2)[_0x602a('0x21')](function(_0x12a55f){return _0x12a55f;});}return null;};}function removeEntity(_0x59bf0f,_0x306b29){return function(_0x121e18){if(_0x121e18){return _0x121e18[_0x602a('0x22')]()['then'](function(){_0x59bf0f[_0x602a('0x16')](0xcc)[_0x602a('0x23')]();});}};}function handleEntityNotFound(_0x183d19,_0x4bee0c){return function(_0x2d19dd){if(!_0x2d19dd){_0x183d19[_0x602a('0x24')](0x194);}return _0x2d19dd;};}function handleError(_0x373a3b,_0x4957ab){_0x4957ab=_0x4957ab||0x1f4;return function(_0x5a9c8b){logger[_0x602a('0x25')](_0x5a9c8b[_0x602a('0x26')]);if(_0x5a9c8b[_0x602a('0x27')]){delete _0x5a9c8b[_0x602a('0x27')];}_0x373a3b[_0x602a('0x16')](_0x4957ab)[_0x602a('0x28')](_0x5a9c8b);};}exports['index']=function(_0x13c5d8,_0x32113f){var _0x15bee7={},_0x1dd921={},_0x4f16d7={'count':0x0,'rows':[]};var _0x1b553c=_[_0x602a('0x29')](db['VoiceMailMessage'][_0x602a('0x2a')],function(_0x28c1c5){return{'name':_0x28c1c5[_0x602a('0x2b')],'type':_0x28c1c5[_0x602a('0x2c')][_0x602a('0x2d')]};});_0x1dd921[_0x602a('0x2e')]=_[_0x602a('0x2f')](_[_0x602a('0x29')](_0x1b553c,_0x602a('0x27')),[_0x602a('0x27')]);_0x1dd921[_0x602a('0x30')]=_[_0x602a('0x31')](_0x13c5d8[_0x602a('0x30')]);_0x1dd921[_0x602a('0x32')]=_[_0x602a('0x33')](_0x1dd921[_0x602a('0x2e')],_0x1dd921[_0x602a('0x30')]);_0x15bee7[_0x602a('0x34')]=_[_0x602a('0x33')](_0x1dd921[_0x602a('0x2e')],qs[_0x602a('0x35')](_0x13c5d8[_0x602a('0x30')][_0x602a('0x35')]));_0x15bee7[_0x602a('0x34')]=_0x15bee7[_0x602a('0x34')][_0x602a('0x36')]?_0x15bee7[_0x602a('0x34')]:_0x1dd921[_0x602a('0x2e')];if(!_0x13c5d8[_0x602a('0x30')][_0x602a('0x37')](_0x602a('0x38'))){_0x15bee7[_0x602a('0x17')]=qs[_0x602a('0x17')](_0x13c5d8[_0x602a('0x30')]['limit']);_0x15bee7[_0x602a('0x19')]=qs[_0x602a('0x19')](_0x13c5d8[_0x602a('0x30')][_0x602a('0x19')]);}_0x15bee7[_0x602a('0x39')]=qs['sort'](_0x13c5d8['query'][_0x602a('0x3a')]);_0x15bee7[_0x602a('0x3b')]=qs[_0x602a('0x32')](_[_0x602a('0x3c')](_0x13c5d8[_0x602a('0x30')],_0x1dd921[_0x602a('0x32')]),_0x1b553c);if(_0x13c5d8[_0x602a('0x30')][_0x602a('0x3d')]){_0x15bee7['where']=_['merge'](_0x15bee7[_0x602a('0x3b')],{'$or':_[_0x602a('0x29')](_0x1b553c,function(_0x38064e){if(_0x38064e['type']!==_0x602a('0x3e')){var _0x1b8a3f={};_0x1b8a3f[_0x38064e['name']]={'$like':'%'+_0x13c5d8[_0x602a('0x30')][_0x602a('0x3d')]+'%'};return _0x1b8a3f;}})});}_0x15bee7=_[_0x602a('0x3f')]({},_0x15bee7,_0x13c5d8[_0x602a('0x40')]);var _0x2e2b91={'where':_0x15bee7['where']};return db[_0x602a('0x41')][_0x602a('0x1a')](_0x2e2b91)['then'](function(_0x421ef8){_0x4f16d7[_0x602a('0x1a')]=_0x421ef8;if(_0x13c5d8[_0x602a('0x30')][_0x602a('0x42')]){_0x15bee7[_0x602a('0x43')]=[{'all':!![]}];}return db[_0x602a('0x41')][_0x602a('0x44')](_0x15bee7);})['then'](function(_0x31976c){_0x4f16d7[_0x602a('0x45')]=_0x31976c;return _0x4f16d7;})[_0x602a('0x21')](respondWithFilteredResult(_0x32113f,_0x15bee7))[_0x602a('0x46')](handleError(_0x32113f,null));};exports[_0x602a('0x47')]=function(_0x4c6198,_0x574e9f){var _0x29d912={'raw':!![],'where':{'id':_0x4c6198[_0x602a('0x48')]['id']}},_0x1b43bb={};_0x1b43bb['model']=_[_0x602a('0x31')](db[_0x602a('0x41')]['rawAttributes']);_0x1b43bb[_0x602a('0x30')]=_[_0x602a('0x31')](_0x4c6198[_0x602a('0x30')]);_0x1b43bb[_0x602a('0x32')]=_['intersection'](_0x1b43bb[_0x602a('0x2e')],_0x1b43bb[_0x602a('0x30')]);_0x29d912['attributes']=_[_0x602a('0x33')](_0x1b43bb[_0x602a('0x2e')],qs[_0x602a('0x35')](_0x4c6198[_0x602a('0x30')][_0x602a('0x35')]));_0x29d912[_0x602a('0x34')]=_0x29d912[_0x602a('0x34')][_0x602a('0x36')]?_0x29d912['attributes']:_0x1b43bb[_0x602a('0x2e')];if(_0x4c6198[_0x602a('0x30')][_0x602a('0x42')]){_0x29d912[_0x602a('0x43')]=[{'all':!![]}];}_0x29d912=_[_0x602a('0x3f')]({},_0x29d912,_0x4c6198['options']);return db[_0x602a('0x41')][_0x602a('0x49')](_0x29d912)[_0x602a('0x21')](handleEntityNotFound(_0x574e9f,null))['then'](respondWithResult(_0x574e9f,null))['catch'](handleError(_0x574e9f,null));};exports['create']=function(_0x5a0b61,_0x213e58){return db[_0x602a('0x41')][_0x602a('0x4a')](_0x5a0b61[_0x602a('0x4b')],{})[_0x602a('0x21')](respondWithResult(_0x213e58,0xc9))[_0x602a('0x46')](handleError(_0x213e58,null));};exports[_0x602a('0x20')]=function(_0x2fc854,_0x489618){if(_0x2fc854[_0x602a('0x4b')]['id']){delete _0x2fc854['body']['id'];}return db[_0x602a('0x41')][_0x602a('0x49')]({'where':{'id':_0x2fc854[_0x602a('0x48')]['id']}})['then'](handleEntityNotFound(_0x489618,null))[_0x602a('0x21')](saveUpdates(_0x2fc854[_0x602a('0x4b')],null))[_0x602a('0x21')](respondWithResult(_0x489618,null))[_0x602a('0x46')](handleError(_0x489618,null));};exports[_0x602a('0x22')]=function(_0x17272c,_0x58e84a){return db[_0x602a('0x41')]['find']({'where':{'id':_0x17272c[_0x602a('0x48')]['id']}})[_0x602a('0x21')](handleEntityNotFound(_0x58e84a,null))[_0x602a('0x21')](removeEntity(_0x58e84a,null))[_0x602a('0x46')](handleError(_0x58e84a,null));};exports[_0x602a('0x4c')]=function(_0x1420b5,_0x36c1ac,_0x24fcaf){return db[_0x602a('0x41')]['find']({'where':{'id':_0x1420b5['params']['id']},'attributes':['id','recording',_0x602a('0x4d')]})['then'](handleEntityNotFound(_0x36c1ac,null))[_0x602a('0x21')](function(_0x3ad86d){if(_0x3ad86d){if(!_0x3ad86d[_0x602a('0x4e')]){throw new db[(_0x602a('0x4f'))][(_0x602a('0x50'))](_0x602a('0x51'));}var _0xb8fe89={'Content-Type':_0x602a('0x52'),'Content-Disposition':'attachment'};if(_0x3ad86d[_0x602a('0x4d')]){_0xb8fe89[_0x602a('0x53')]=_0x602a('0x54')+_0x3ad86d[_0x602a('0x4d')]+_0x602a('0x55');}_0x36c1ac['set'](_0xb8fe89);return _0x36c1ac[_0x602a('0x28')](new Buffer(_0x3ad86d[_0x602a('0x4e')]));}})[_0x602a('0x46')](handleError(_0x36c1ac,null));}; \ No newline at end of file +var _0x1923=['includeAll','include','findAll','catch','params','fields','length','options','find','create','body','update','destroy','download','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','recording','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','name','index','fieldName','type','key','model','map','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','VoiceMailMessage','then'];(function(_0x3055ab,_0x4d1f74){var _0x31d336=function(_0x207a6a){while(--_0x207a6a){_0x3055ab['push'](_0x3055ab['shift']());}};_0x31d336(++_0x4d1f74);}(_0x1923,0x117));var _0x3192=function(_0x5c8a1f,_0xfdb46e){_0x5c8a1f=_0x5c8a1f-0x0;var _0x8592e9=_0x1923[_0x5c8a1f];return _0x8592e9;};'use strict';var emlformat=require(_0x3192('0x0'));var rimraf=require(_0x3192('0x1'));var zipdir=require(_0x3192('0x2'));var jsonpatch=require(_0x3192('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3192('0x4'));var Mustache=require('mustache');var util=require(_0x3192('0x5'));var path=require(_0x3192('0x6'));var sox=require(_0x3192('0x7'));var csv=require(_0x3192('0x8'));var ejs=require(_0x3192('0x9'));var fs=require('fs');var fs_extra=require(_0x3192('0xa'));var _=require('lodash');var squel=require(_0x3192('0xb'));var crypto=require(_0x3192('0xc'));var jsforce=require(_0x3192('0xd'));var deskjs=require(_0x3192('0xe'));var toCsv=require(_0x3192('0x8'));var querystring=require(_0x3192('0xf'));var Papa=require(_0x3192('0x10'));var Redis=require(_0x3192('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3192('0x12'));var as=require(_0x3192('0x13'));var hardwareService=require(_0x3192('0x14'));var logger=require(_0x3192('0x15'))(_0x3192('0x16'));var utils=require(_0x3192('0x17'));var config=require(_0x3192('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3192('0x19'))['db'];function respondWithStatusCode(_0x2af9a4,_0x551ee7){_0x551ee7=_0x551ee7||0xcc;return function(_0xbce135){if(_0xbce135){return _0x2af9a4[_0x3192('0x1a')](_0x551ee7);}return _0x2af9a4[_0x3192('0x1b')](_0x551ee7)['end']();};}function respondWithResult(_0x31651c,_0x29e7d0){_0x29e7d0=_0x29e7d0||0xc8;return function(_0x586896){if(_0x586896){return _0x31651c[_0x3192('0x1b')](_0x29e7d0)[_0x3192('0x1c')](_0x586896);}};}function respondWithFilteredResult(_0x56732,_0x3dfea9){return function(_0x1928b3){if(_0x1928b3){var _0xbd3fad=typeof _0x3dfea9['offset']===_0x3192('0x1d')&&typeof _0x3dfea9['limit']===_0x3192('0x1d');var _0x11e013=_0x1928b3[_0x3192('0x1e')];var _0x22ae82=_0xbd3fad?0x0:_0x3dfea9['offset'];var _0x501f25=_0xbd3fad?_0x1928b3[_0x3192('0x1e')]:_0x3dfea9[_0x3192('0x1f')]+_0x3dfea9[_0x3192('0x20')];var _0x53b24c;if(_0x501f25>=_0x11e013){_0x501f25=_0x11e013;_0x53b24c=0xc8;}else{_0x53b24c=0xce;}_0x56732[_0x3192('0x1b')](_0x53b24c);return _0x56732[_0x3192('0x21')](_0x3192('0x22'),_0x22ae82+'-'+_0x501f25+'/'+_0x11e013)['json'](_0x1928b3);}return null;};}function patchUpdates(_0x253ccb){return function(_0x44e312){try{jsonpatch[_0x3192('0x23')](_0x44e312,_0x253ccb,!![]);}catch(_0x1b7285){return BPromise[_0x3192('0x24')](_0x1b7285);}return _0x44e312[_0x3192('0x25')]();};}function saveUpdates(_0x3578ce,_0x70549b){return function(_0x40aa96){if(_0x40aa96){return _0x40aa96['update'](_0x3578ce)['then'](function(_0x12b9b9){return _0x12b9b9;});}return null;};}function removeEntity(_0x21810f,_0x4aed18){return function(_0xc41b97){if(_0xc41b97){return _0xc41b97['destroy']()['then'](function(){_0x21810f[_0x3192('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x703969,_0x13770b){return function(_0x5a9134){if(!_0x5a9134){_0x703969[_0x3192('0x1a')](0x194);}return _0x5a9134;};}function handleError(_0x307c81,_0x3c6608){_0x3c6608=_0x3c6608||0x1f4;return function(_0x1855f4){logger['error'](_0x1855f4['stack']);if(_0x1855f4[_0x3192('0x26')]){delete _0x1855f4[_0x3192('0x26')];}_0x307c81[_0x3192('0x1b')](_0x3c6608)['send'](_0x1855f4);};}exports[_0x3192('0x27')]=function(_0x398cf3,_0x19807c){var _0x4686f7={},_0x338ef={},_0x1cf543={'count':0x0,'rows':[]};var _0x5d0d5f=_['map'](db['VoiceMailMessage']['rawAttributes'],function(_0x213848){return{'name':_0x213848[_0x3192('0x28')],'type':_0x213848[_0x3192('0x29')][_0x3192('0x2a')]};});_0x338ef[_0x3192('0x2b')]=_['differenceBy'](_[_0x3192('0x2c')](_0x5d0d5f,_0x3192('0x26')),['name']);_0x338ef[_0x3192('0x2d')]=_[_0x3192('0x2e')](_0x398cf3[_0x3192('0x2d')]);_0x338ef['filters']=_['intersection'](_0x338ef[_0x3192('0x2b')],_0x338ef['query']);_0x4686f7['attributes']=_[_0x3192('0x2f')](_0x338ef['model'],qs['fields'](_0x398cf3[_0x3192('0x2d')]['fields']));_0x4686f7[_0x3192('0x30')]=_0x4686f7[_0x3192('0x30')]['length']?_0x4686f7[_0x3192('0x30')]:_0x338ef[_0x3192('0x2b')];if(!_0x398cf3[_0x3192('0x2d')][_0x3192('0x31')](_0x3192('0x32'))){_0x4686f7[_0x3192('0x20')]=qs[_0x3192('0x20')](_0x398cf3[_0x3192('0x2d')]['limit']);_0x4686f7[_0x3192('0x1f')]=qs['offset'](_0x398cf3[_0x3192('0x2d')][_0x3192('0x1f')]);}_0x4686f7[_0x3192('0x33')]=qs[_0x3192('0x34')](_0x398cf3['query'][_0x3192('0x34')]);_0x4686f7[_0x3192('0x35')]=qs[_0x3192('0x36')](_[_0x3192('0x37')](_0x398cf3[_0x3192('0x2d')],_0x338ef[_0x3192('0x36')]),_0x5d0d5f);if(_0x398cf3[_0x3192('0x2d')][_0x3192('0x38')]){_0x4686f7[_0x3192('0x35')]=_['merge'](_0x4686f7[_0x3192('0x35')],{'$or':_[_0x3192('0x2c')](_0x5d0d5f,function(_0x1a2847){if(_0x1a2847[_0x3192('0x29')]!==_0x3192('0x39')){var _0x1b8994={};_0x1b8994[_0x1a2847[_0x3192('0x26')]]={'$like':'%'+_0x398cf3[_0x3192('0x2d')]['filter']+'%'};return _0x1b8994;}})});}_0x4686f7=_[_0x3192('0x3a')]({},_0x4686f7,_0x398cf3['options']);var _0x4c795f={'where':_0x4686f7[_0x3192('0x35')]};return db[_0x3192('0x3b')][_0x3192('0x1e')](_0x4c795f)[_0x3192('0x3c')](function(_0x3b79e8){_0x1cf543[_0x3192('0x1e')]=_0x3b79e8;if(_0x398cf3[_0x3192('0x2d')][_0x3192('0x3d')]){_0x4686f7[_0x3192('0x3e')]=[{'all':!![]}];}return db[_0x3192('0x3b')][_0x3192('0x3f')](_0x4686f7);})[_0x3192('0x3c')](function(_0x4908ec){_0x1cf543['rows']=_0x4908ec;return _0x1cf543;})[_0x3192('0x3c')](respondWithFilteredResult(_0x19807c,_0x4686f7))[_0x3192('0x40')](handleError(_0x19807c,null));};exports['show']=function(_0x397b45,_0x3e7130){var _0x2d48f2={'raw':!![],'where':{'id':_0x397b45[_0x3192('0x41')]['id']}},_0x108023={};_0x108023[_0x3192('0x2b')]=_['keys'](db[_0x3192('0x3b')]['rawAttributes']);_0x108023[_0x3192('0x2d')]=_[_0x3192('0x2e')](_0x397b45[_0x3192('0x2d')]);_0x108023[_0x3192('0x36')]=_[_0x3192('0x2f')](_0x108023[_0x3192('0x2b')],_0x108023[_0x3192('0x2d')]);_0x2d48f2[_0x3192('0x30')]=_[_0x3192('0x2f')](_0x108023[_0x3192('0x2b')],qs[_0x3192('0x42')](_0x397b45['query']['fields']));_0x2d48f2[_0x3192('0x30')]=_0x2d48f2[_0x3192('0x30')][_0x3192('0x43')]?_0x2d48f2[_0x3192('0x30')]:_0x108023[_0x3192('0x2b')];if(_0x397b45[_0x3192('0x2d')][_0x3192('0x3d')]){_0x2d48f2[_0x3192('0x3e')]=[{'all':!![]}];}_0x2d48f2=_[_0x3192('0x3a')]({},_0x2d48f2,_0x397b45[_0x3192('0x44')]);return db[_0x3192('0x3b')][_0x3192('0x45')](_0x2d48f2)[_0x3192('0x3c')](handleEntityNotFound(_0x3e7130,null))[_0x3192('0x3c')](respondWithResult(_0x3e7130,null))[_0x3192('0x40')](handleError(_0x3e7130,null));};exports[_0x3192('0x46')]=function(_0x16dd51,_0x18c053){return db['VoiceMailMessage'][_0x3192('0x46')](_0x16dd51[_0x3192('0x47')],{})['then'](respondWithResult(_0x18c053,0xc9))[_0x3192('0x40')](handleError(_0x18c053,null));};exports[_0x3192('0x48')]=function(_0x4adff8,_0x7a84db){if(_0x4adff8[_0x3192('0x47')]['id']){delete _0x4adff8[_0x3192('0x47')]['id'];}return db[_0x3192('0x3b')][_0x3192('0x45')]({'where':{'id':_0x4adff8[_0x3192('0x41')]['id']}})[_0x3192('0x3c')](handleEntityNotFound(_0x7a84db,null))[_0x3192('0x3c')](saveUpdates(_0x4adff8['body'],null))[_0x3192('0x3c')](respondWithResult(_0x7a84db,null))[_0x3192('0x40')](handleError(_0x7a84db,null));};exports[_0x3192('0x49')]=function(_0x463b23,_0x2d1641){return db[_0x3192('0x3b')][_0x3192('0x45')]({'where':{'id':_0x463b23['params']['id']}})['then'](handleEntityNotFound(_0x2d1641,null))[_0x3192('0x3c')](removeEntity(_0x2d1641,null))[_0x3192('0x40')](handleError(_0x2d1641,null));};exports[_0x3192('0x4a')]=function(_0x17407e,_0x1aeb84,_0x4e9cf0){return db[_0x3192('0x3b')][_0x3192('0x45')]({'where':{'id':_0x17407e[_0x3192('0x41')]['id']},'attributes':['id','recording','msg_id']})['then'](handleEntityNotFound(_0x1aeb84,null))[_0x3192('0x3c')](function(_0x174a9c){if(_0x174a9c){if(!_0x174a9c['recording']){throw new db['Sequelize'][(_0x3192('0x4b'))](_0x3192('0x4c'));}var _0x53ca58={'Content-Type':_0x3192('0x4d'),'Content-Disposition':_0x3192('0x4e')};if(_0x174a9c[_0x3192('0x4f')]){_0x53ca58[_0x3192('0x50')]=_0x3192('0x51')+_0x174a9c[_0x3192('0x4f')]+_0x3192('0x52');}_0x1aeb84[_0x3192('0x21')](_0x53ca58);return _0x1aeb84[_0x3192('0x53')](new Buffer(_0x174a9c[_0x3192('0x54')]));}})[_0x3192('0x40')](handleError(_0x1aeb84,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 2d18fd2..7272352 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.model.js +++ b/server/api/voiceMailMessage/voiceMailMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2edf=['define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x572944,_0xd5c0df){var _0x2f457a=function(_0x5ba3bf){while(--_0x5ba3bf){_0x572944['push'](_0x572944['shift']());}};_0x2f457a(++_0xd5c0df);}(_0x2edf,0x79));var _0xf2ed=function(_0x4945e8,_0x597c5e){_0x4945e8=_0x4945e8-0x0;var _0x4300ca=_0x2edf[_0x4945e8];return _0x4300ca;};'use strict';var _=require(_0xf2ed('0x0'));var util=require(_0xf2ed('0x1'));var logger=require(_0xf2ed('0x2'))('api');var moment=require(_0xf2ed('0x3'));var BPromise=require(_0xf2ed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2ed('0x5'));var rimraf=require(_0xf2ed('0x6'));var config=require(_0xf2ed('0x7'));var attributes=require('./voiceMailMessage.attributes');module[_0xf2ed('0x8')]=function(_0x24d471,_0x17f0fd){return _0x24d471[_0xf2ed('0x9')](_0xf2ed('0xa'),attributes,{'tableName':_0xf2ed('0xb'),'paranoid':![],'indexes':[{'name':_0xf2ed('0xc'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0xfd9b=['VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0xff3486,_0x346fe0){var _0x13f3eb=function(_0xdc29d){while(--_0xdc29d){_0xff3486['push'](_0xff3486['shift']());}};_0x13f3eb(++_0x346fe0);}(_0xfd9b,0xff));var _0xbfd9=function(_0x4a532a,_0x16251a){_0x4a532a=_0x4a532a-0x0;var _0x231f9d=_0xfd9b[_0x4a532a];return _0x231f9d;};'use strict';var _=require(_0xbfd9('0x0'));var util=require(_0xbfd9('0x1'));var logger=require(_0xbfd9('0x2'))(_0xbfd9('0x3'));var moment=require(_0xbfd9('0x4'));var BPromise=require(_0xbfd9('0x5'));var rp=require(_0xbfd9('0x6'));var fs=require('fs');var path=require(_0xbfd9('0x7'));var rimraf=require(_0xbfd9('0x8'));var config=require(_0xbfd9('0x9'));var attributes=require('./voiceMailMessage.attributes');module[_0xbfd9('0xa')]=function(_0xce2953,_0x382441){return _0xce2953['define'](_0xbfd9('0xb'),attributes,{'tableName':_0xbfd9('0xc'),'paranoid':![],'indexes':[{'name':_0xbfd9('0xd'),'fields':[_0xbfd9('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 1352fca..155a31d 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.rpc.js +++ b/server/api/voiceMailMessage/voiceMailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa0f4=['VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x327409,_0x4aabb8){var _0x463eff=function(_0x1bf6a9){while(--_0x1bf6a9){_0x327409['push'](_0x327409['shift']());}};_0x463eff(++_0x4aabb8);}(_0xa0f4,0x1bd));var _0x4a0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0f4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4a0f('0x0'));var util=require(_0x4a0f('0x1'));var moment=require(_0x4a0f('0x2'));var BPromise=require(_0x4a0f('0x3'));var rs=require(_0x4a0f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a0f('0x5'))['db'];var utils=require(_0x4a0f('0x6'));var logger=require(_0x4a0f('0x7'))(_0x4a0f('0x8'));var config=require(_0x4a0f('0x9'));var jayson=require(_0x4a0f('0xa'));var client=jayson[_0x4a0f('0xb')][_0x4a0f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x49a910,_0x1f4384,_0x1a3516){return new BPromise(function(_0x4f3c49,_0xd6867b){return client['request'](_0x49a910,_0x1a3516)[_0x4a0f('0xd')](function(_0x578951){logger[_0x4a0f('0xe')](_0x4a0f('0xf'),_0x1f4384,_0x4a0f('0x10'));logger['debug'](_0x4a0f('0x11'),_0x1f4384,_0x4a0f('0x10'),JSON[_0x4a0f('0x12')](_0x578951));if(_0x578951[_0x4a0f('0x13')]){if(_0x578951[_0x4a0f('0x13')]['code']===0x1f4){logger[_0x4a0f('0x13')](_0x4a0f('0xf'),_0x1f4384,_0x578951[_0x4a0f('0x13')][_0x4a0f('0x14')]);return _0xd6867b(_0x578951['error'][_0x4a0f('0x14')]);}logger[_0x4a0f('0x13')](_0x4a0f('0xf'),_0x1f4384,_0x578951[_0x4a0f('0x13')][_0x4a0f('0x14')]);return _0x4f3c49(_0x578951['error']['message']);}else{logger[_0x4a0f('0xe')](_0x4a0f('0xf'),_0x1f4384,_0x4a0f('0x10'));_0x4f3c49(_0x578951[_0x4a0f('0x15')]['message']);}})['catch'](function(_0x386ef3){logger[_0x4a0f('0x13')](_0x4a0f('0xf'),_0x1f4384,_0x386ef3);_0xd6867b(_0x386ef3);});});} \ No newline at end of file +var _0xf503=['jayson/promise','http','request','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceMailMessage,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1fa841,_0x37a70c){var _0x384b67=function(_0x248c40){while(--_0x248c40){_0x1fa841['push'](_0x1fa841['shift']());}};_0x384b67(++_0x37a70c);}(_0xf503,0x16d));var _0x3f50=function(_0x541845,_0x2f8b95){_0x541845=_0x541845-0x0;var _0x35bfd0=_0xf503[_0x541845];return _0x35bfd0;};'use strict';var _=require('lodash');var util=require(_0x3f50('0x0'));var moment=require(_0x3f50('0x1'));var BPromise=require(_0x3f50('0x2'));var rs=require(_0x3f50('0x3'));var fs=require('fs');var Redis=require(_0x3f50('0x4'));var db=require(_0x3f50('0x5'))['db'];var utils=require(_0x3f50('0x6'));var logger=require(_0x3f50('0x7'))(_0x3f50('0x8'));var config=require('../../config/environment');var jayson=require(_0x3f50('0x9'));var client=jayson['client'][_0x3f50('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b2b76,_0x4d312c,_0x4ce865){return new BPromise(function(_0x471b38,_0x16d3a6){return client[_0x3f50('0xb')](_0x4b2b76,_0x4ce865)['then'](function(_0xbe0c70){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x4d312c,_0x3f50('0xc'));logger[_0x3f50('0xd')](_0x3f50('0xe'),_0x4d312c,_0x3f50('0xc'),JSON[_0x3f50('0xf')](_0xbe0c70));if(_0xbe0c70['error']){if(_0xbe0c70[_0x3f50('0x10')][_0x3f50('0x11')]===0x1f4){logger[_0x3f50('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x4d312c,_0xbe0c70[_0x3f50('0x10')][_0x3f50('0x12')]);return _0x16d3a6(_0xbe0c70[_0x3f50('0x10')][_0x3f50('0x12')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x4d312c,_0xbe0c70[_0x3f50('0x10')][_0x3f50('0x12')]);return _0x471b38(_0xbe0c70[_0x3f50('0x10')][_0x3f50('0x12')]);}else{logger['info'](_0x3f50('0x13'),_0x4d312c,_0x3f50('0xc'));_0x471b38(_0xbe0c70[_0x3f50('0x14')][_0x3f50('0x12')]);}})[_0x3f50('0x15')](function(_0x25b537){logger[_0x3f50('0x10')](_0x3f50('0x13'),_0x4d312c,_0x25b537);_0x16d3a6(_0x25b537);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 61550fe..8ece379 100644 --- a/server/api/voiceMusicOnHold/index.js +++ b/server/api/voiceMusicOnHold/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ada=['getSounds','post','create','addSound','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds'];(function(_0x4f7fe0,_0x18201f){var _0x1e2851=function(_0x448ddc){while(--_0x448ddc){_0x4f7fe0['push'](_0x4f7fe0['shift']());}};_0x1e2851(++_0x18201f);}(_0x3ada,0x6e));var _0xa3ad=function(_0x178507,_0x46af17){_0x178507=_0x178507-0x0;var _0x1b04bb=_0x3ada[_0x178507];return _0x1b04bb;};'use strict';var multer=require(_0xa3ad('0x0'));var util=require(_0xa3ad('0x1'));var path=require(_0xa3ad('0x2'));var timeout=require('connect-timeout');var express=require(_0xa3ad('0x3'));var router=express['Router']();var fs_extra=require(_0xa3ad('0x4'));var auth=require(_0xa3ad('0x5'));var interaction=require(_0xa3ad('0x6'));var config=require(_0xa3ad('0x7'));var controller=require(_0xa3ad('0x8'));router[_0xa3ad('0x9')]('/',auth[_0xa3ad('0xa')](),controller[_0xa3ad('0xb')]);router[_0xa3ad('0x9')](_0xa3ad('0xc'),auth[_0xa3ad('0xa')](),controller[_0xa3ad('0xd')]);router['get'](_0xa3ad('0xe'),auth[_0xa3ad('0xa')](),controller[_0xa3ad('0xf')]);router[_0xa3ad('0x10')]('/',auth[_0xa3ad('0xa')](),controller[_0xa3ad('0x11')]);router['post'](_0xa3ad('0xe'),auth['isAuthenticated'](),controller[_0xa3ad('0x12')]);router['put'](_0xa3ad('0xc'),auth[_0xa3ad('0xa')](),controller[_0xa3ad('0x13')]);router[_0xa3ad('0x14')]('/:id',auth[_0xa3ad('0xa')](),controller[_0xa3ad('0x15')]);router[_0xa3ad('0x14')](_0xa3ad('0x16'),auth[_0xa3ad('0xa')](),controller[_0xa3ad('0x17')]);module[_0xa3ad('0x18')]=router; \ No newline at end of file +var _0xb2db=['get','index','/:id','isAuthenticated','show','/:id/sounds','getSounds','post','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout','express','Router','./voiceMusicOnHold.controller'];(function(_0x3cc356,_0x67281){var _0x59293f=function(_0x50aca6){while(--_0x50aca6){_0x3cc356['push'](_0x3cc356['shift']());}};_0x59293f(++_0x67281);}(_0xb2db,0x159));var _0xbb2d=function(_0xa2deb6,_0x54dcb3){_0xa2deb6=_0xa2deb6-0x0;var _0x536543=_0xb2db[_0xa2deb6];return _0x536543;};'use strict';var multer=require(_0xbb2d('0x0'));var util=require(_0xbb2d('0x1'));var path=require(_0xbb2d('0x2'));var timeout=require(_0xbb2d('0x3'));var express=require(_0xbb2d('0x4'));var router=express[_0xbb2d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbb2d('0x6'));router[_0xbb2d('0x7')]('/',auth['isAuthenticated'](),controller[_0xbb2d('0x8')]);router[_0xbb2d('0x7')](_0xbb2d('0x9'),auth[_0xbb2d('0xa')](),controller[_0xbb2d('0xb')]);router[_0xbb2d('0x7')](_0xbb2d('0xc'),auth[_0xbb2d('0xa')](),controller[_0xbb2d('0xd')]);router[_0xbb2d('0xe')]('/',auth[_0xbb2d('0xa')](),controller['create']);router[_0xbb2d('0xe')](_0xbb2d('0xc'),auth[_0xbb2d('0xa')](),controller[_0xbb2d('0xf')]);router[_0xbb2d('0x10')](_0xbb2d('0x9'),auth[_0xbb2d('0xa')](),controller[_0xbb2d('0x11')]);router[_0xbb2d('0x12')](_0xbb2d('0x9'),auth['isAuthenticated'](),controller[_0xbb2d('0x13')]);router[_0xbb2d('0x12')](_0xbb2d('0x14'),auth[_0xbb2d('0xa')](),controller[_0xbb2d('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index e053ec2..cb2dc90 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x72d2=['alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3'];(function(_0x23ffae,_0x3a4899){var _0x8ef24c=function(_0x249338){while(--_0x249338){_0x23ffae['push'](_0x23ffae['shift']());}};_0x8ef24c(++_0x3a4899);}(_0x72d2,0xb9));var _0x272d=function(_0x846ae8,_0x33a70b){_0x846ae8=_0x846ae8-0x0;var _0x356b00=_0x72d2[_0x846ae8];return _0x356b00;};'use strict';var Sequelize=require(_0x272d('0x0'));module[_0x272d('0x1')]={'name':{'type':Sequelize[_0x272d('0x2')],'allowNull':![],'unique':_0x272d('0x3')},'mode':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x5'),_0x272d('0x6'),_0x272d('0x7'),_0x272d('0x8'),_0x272d('0x9'),_0x272d('0xa')),'allowNull':!![],'defaultValue':_0x272d('0x6')},'directory':{'type':Sequelize[_0x272d('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x272d('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x272d('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x272d('0x2')],'allowNull':!![],'defaultValue':_0x272d('0xb')},'format':{'type':Sequelize[_0x272d('0x2')],'allowNull':!![]},'stamp':{'type':_0x272d('0xc')},'defaultEntry':{'type':Sequelize[_0x272d('0xd')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0642=['alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','quietmp3nb','quietmp3','mp3'];(function(_0x4ac48d,_0x171a68){var _0x7537af=function(_0x1c6ca6){while(--_0x1c6ca6){_0x4ac48d['push'](_0x4ac48d['shift']());}};_0x7537af(++_0x171a68);}(_0x0642,0x107));var _0x2064=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x0642[_0x34bc30];return _0x5706de;};'use strict';var Sequelize=require(_0x2064('0x0'));module[_0x2064('0x1')]={'name':{'type':Sequelize[_0x2064('0x2')],'allowNull':![],'unique':_0x2064('0x3')},'mode':{'type':Sequelize[_0x2064('0x4')](_0x2064('0x5'),_0x2064('0x6'),'mp3nb',_0x2064('0x7'),_0x2064('0x8'),_0x2064('0x9')),'allowNull':!![],'defaultValue':_0x2064('0x6')},'directory':{'type':Sequelize[_0x2064('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x2064('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2064('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2064('0x2')],'allowNull':!![],'defaultValue':_0x2064('0xa')},'format':{'type':Sequelize[_0x2064('0x2')],'allowNull':!![]},'stamp':{'type':_0x2064('0xb')},'defaultEntry':{'type':Sequelize[_0x2064('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index b1a9501..d68dd2c 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7744=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','sendStatus','error','name','send','index','map','VoiceMusicOnHold','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','rawAttributes','length','include','find','body','create','sequelize','files','directory','join','root','server/files/moh','mode','mkdirSync','0777','user','UserProfileSection','userProfileId','transaction','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','findOne','converted_format','server/files/sounds/converted','format','%s.%s','extname','save_name','removeSound','id2','Sound','createdAt','getSounds','pick','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7744,0xc8));var _0x4774=function(_0x1c3765,_0xc3b431){_0x1c3765=_0x1c3765-0x0;var _0x3ab003=_0x7744[_0x1c3765];return _0x3ab003;};'use strict';var emlformat=require(_0x4774('0x0'));var rimraf=require(_0x4774('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4774('0x2'));var rp=require('request-promise');var moment=require(_0x4774('0x3'));var BPromise=require(_0x4774('0x4'));var Mustache=require(_0x4774('0x5'));var util=require(_0x4774('0x6'));var path=require('path');var sox=require(_0x4774('0x7'));var csv=require(_0x4774('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4774('0x9'));var _=require(_0x4774('0xa'));var squel=require(_0x4774('0xb'));var crypto=require(_0x4774('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4774('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4774('0xe'));var Redis=require(_0x4774('0xf'));var authService=require(_0x4774('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4774('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4774('0x12'))(_0x4774('0x13'));var utils=require(_0x4774('0x14'));var config=require(_0x4774('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4774('0x16'))['db'];function respondWithStatusCode(_0x53152f,_0x496050){_0x496050=_0x496050||0xcc;return function(_0x194e96){if(_0x194e96){return _0x53152f['sendStatus'](_0x496050);}return _0x53152f[_0x4774('0x17')](_0x496050)[_0x4774('0x18')]();};}function respondWithResult(_0x4e6506,_0x30c103){_0x30c103=_0x30c103||0xc8;return function(_0x3b54df){if(_0x3b54df){return _0x4e6506[_0x4774('0x17')](_0x30c103)[_0x4774('0x19')](_0x3b54df);}};}function respondWithFilteredResult(_0x306d05,_0x348f0c){return function(_0x5f0134){if(_0x5f0134){var _0x1f8933=typeof _0x348f0c[_0x4774('0x1a')]==='undefined'&&typeof _0x348f0c[_0x4774('0x1b')]===_0x4774('0x1c');var _0x2aa0bb=_0x5f0134[_0x4774('0x1d')];var _0x5e0da3=_0x1f8933?0x0:_0x348f0c[_0x4774('0x1a')];var _0x5abf7c=_0x1f8933?_0x5f0134[_0x4774('0x1d')]:_0x348f0c['offset']+_0x348f0c[_0x4774('0x1b')];var _0x3be781;if(_0x5abf7c>=_0x2aa0bb){_0x5abf7c=_0x2aa0bb;_0x3be781=0xc8;}else{_0x3be781=0xce;}_0x306d05[_0x4774('0x17')](_0x3be781);return _0x306d05[_0x4774('0x1e')](_0x4774('0x1f'),_0x5e0da3+'-'+_0x5abf7c+'/'+_0x2aa0bb)[_0x4774('0x19')](_0x5f0134);}return null;};}function patchUpdates(_0x601fa1){return function(_0x5dfe66){try{jsonpatch[_0x4774('0x20')](_0x5dfe66,_0x601fa1,!![]);}catch(_0x35f6bd){return BPromise['reject'](_0x35f6bd);}return _0x5dfe66[_0x4774('0x21')]();};}function saveUpdates(_0x2ede34,_0x3a0cd9){return function(_0x23d89b){if(_0x23d89b){return _0x23d89b[_0x4774('0x22')](_0x2ede34)[_0x4774('0x23')](function(_0x2317ef){return _0x2317ef;});}return null;};}function removeEntity(_0x2c8e50,_0x2bcd90){return function(_0x4211fc){if(_0x4211fc){return _0x4211fc[_0x4774('0x24')]()[_0x4774('0x23')](function(){var _0x2e894f=_0x4211fc[_0x4774('0x25')]({'plain':!![]});var _0x436867=_0x4774('0x26');return db[_0x4774('0x27')][_0x4774('0x24')]({'where':{'type':_0x436867,'resourceId':_0x2e894f['id']}})[_0x4774('0x23')](function(){return _0x4211fc;});})[_0x4774('0x23')](function(){_0x2c8e50['status'](0xcc)[_0x4774('0x18')]();});}};}function handleEntityNotFound(_0x190fc1,_0x1ea1e8){return function(_0x521e0f){if(!_0x521e0f){_0x190fc1[_0x4774('0x28')](0x194);}return _0x521e0f;};}function handleError(_0xc8360f,_0x564706){_0x564706=_0x564706||0x1f4;return function(_0x107157){logger[_0x4774('0x29')](_0x107157['stack']);if(_0x107157[_0x4774('0x2a')]){delete _0x107157[_0x4774('0x2a')];}_0xc8360f[_0x4774('0x17')](_0x564706)[_0x4774('0x2b')](_0x107157);};}exports[_0x4774('0x2c')]=function(_0x5d3685,_0x315ff0){var _0x9c1735={},_0x3325dc={},_0x30006d={'count':0x0,'rows':[]};var _0x3005e8=_[_0x4774('0x2d')](db[_0x4774('0x2e')]['rawAttributes'],function(_0x406faa){return{'name':_0x406faa[_0x4774('0x2f')],'type':_0x406faa[_0x4774('0x30')][_0x4774('0x31')]};});_0x3325dc[_0x4774('0x32')]=_[_0x4774('0x2d')](_0x3005e8,'name');_0x3325dc[_0x4774('0x33')]=_[_0x4774('0x34')](_0x5d3685['query']);_0x3325dc['filters']=_[_0x4774('0x35')](_0x3325dc[_0x4774('0x32')],_0x3325dc[_0x4774('0x33')]);_0x9c1735['attributes']=_[_0x4774('0x35')](_0x3325dc[_0x4774('0x32')],qs[_0x4774('0x36')](_0x5d3685[_0x4774('0x33')][_0x4774('0x36')]));_0x9c1735[_0x4774('0x37')]=_0x9c1735['attributes']['length']?_0x9c1735['attributes']:_0x3325dc[_0x4774('0x32')];if(!_0x5d3685[_0x4774('0x33')][_0x4774('0x38')](_0x4774('0x39'))){_0x9c1735['limit']=qs['limit'](_0x5d3685['query']['limit']);_0x9c1735['offset']=qs[_0x4774('0x1a')](_0x5d3685[_0x4774('0x33')]['offset']);}_0x9c1735[_0x4774('0x3a')]=qs[_0x4774('0x3b')](_0x5d3685[_0x4774('0x33')][_0x4774('0x3b')]);delete _0x5d3685[_0x4774('0x33')][_0x4774('0x3b')];_0x9c1735[_0x4774('0x3c')]=qs[_0x4774('0x3d')](_['pick'](_0x5d3685[_0x4774('0x33')],_0x3325dc[_0x4774('0x3d')]),_0x3005e8);if(_0x5d3685[_0x4774('0x33')][_0x4774('0x3e')]){_0x9c1735[_0x4774('0x3c')]=_[_0x4774('0x3f')](_0x9c1735[_0x4774('0x3c')],{'$or':_[_0x4774('0x2d')](_0x3005e8,function(_0xf552c4){if(_0xf552c4[_0x4774('0x30')]!==_0x4774('0x40')){var _0x26bc7e={};_0x26bc7e[_0xf552c4[_0x4774('0x2a')]]={'$like':'%'+_0x5d3685[_0x4774('0x33')]['filter']+'%'};return _0x26bc7e;}})});}_0x9c1735=_[_0x4774('0x3f')]({},_0x9c1735,_0x5d3685[_0x4774('0x41')]);var _0x4c991c={'where':_0x9c1735[_0x4774('0x3c')]};return db[_0x4774('0x2e')][_0x4774('0x1d')](_0x4c991c)[_0x4774('0x23')](function(_0x179cc8){_0x30006d[_0x4774('0x1d')]=_0x179cc8;if(_0x5d3685[_0x4774('0x33')][_0x4774('0x42')]){_0x9c1735['include']=[{'all':!![]}];}return db[_0x4774('0x2e')][_0x4774('0x43')](_0x9c1735);})[_0x4774('0x23')](function(_0x50e357){_0x30006d['rows']=_0x50e357;return _0x30006d;})[_0x4774('0x23')](respondWithFilteredResult(_0x315ff0,_0x9c1735))[_0x4774('0x44')](handleError(_0x315ff0,null));};exports['show']=function(_0x34eb1e,_0x1f4191){var _0x226a01={'raw':![],'where':{'id':_0x34eb1e[_0x4774('0x45')]['id']}},_0x4bb276={};_0x4bb276[_0x4774('0x32')]=_[_0x4774('0x34')](db[_0x4774('0x2e')][_0x4774('0x46')]);_0x4bb276['query']=_['keys'](_0x34eb1e[_0x4774('0x33')]);_0x4bb276[_0x4774('0x3d')]=_['intersection'](_0x4bb276[_0x4774('0x32')],_0x4bb276['query']);_0x226a01['attributes']=_[_0x4774('0x35')](_0x4bb276['model'],qs[_0x4774('0x36')](_0x34eb1e[_0x4774('0x33')][_0x4774('0x36')]));_0x226a01[_0x4774('0x37')]=_0x226a01[_0x4774('0x37')][_0x4774('0x47')]?_0x226a01[_0x4774('0x37')]:_0x4bb276[_0x4774('0x32')];if(_0x34eb1e[_0x4774('0x33')][_0x4774('0x42')]){_0x226a01[_0x4774('0x48')]=[{'all':!![]}];}_0x226a01=_[_0x4774('0x3f')]({},_0x226a01,_0x34eb1e[_0x4774('0x41')]);return db[_0x4774('0x2e')][_0x4774('0x49')](_0x226a01)[_0x4774('0x23')](handleEntityNotFound(_0x1f4191,null))['then'](respondWithResult(_0x1f4191,null))[_0x4774('0x44')](handleError(_0x1f4191,null));};exports[_0x4774('0x22')]=function(_0x1c2e79,_0x37be43){if(_0x1c2e79[_0x4774('0x4a')]['id']){delete _0x1c2e79['body']['id'];}return db[_0x4774('0x2e')][_0x4774('0x49')]({'where':{'id':_0x1c2e79[_0x4774('0x45')]['id']}})['then'](handleEntityNotFound(_0x37be43,null))['then'](saveUpdates(_0x1c2e79[_0x4774('0x4a')],null))[_0x4774('0x23')](respondWithResult(_0x37be43,null))[_0x4774('0x44')](handleError(_0x37be43,null));};exports[_0x4774('0x4b')]=function(_0x2d26c0,_0x472f8b,_0x2c0a95){return db[_0x4774('0x4c')]['transaction'](function(_0x27a6a2){if(_0x2d26c0[_0x4774('0x4a')]['mode']===_0x4774('0x4d')){_0x2d26c0[_0x4774('0x4a')][_0x4774('0x4e')]=path[_0x4774('0x4f')](config[_0x4774('0x50')],_0x4774('0x51'),_0x2d26c0[_0x4774('0x4a')]['name']);}return db[_0x4774('0x2e')]['create'](_0x2d26c0['body'],{'transaction':_0x27a6a2})[_0x4774('0x23')](function(_0x26420d){if(_0x2d26c0[_0x4774('0x4a')][_0x4774('0x52')]==='files'){fs[_0x4774('0x53')](_0x26420d['directory'],parseInt(_0x4774('0x54'),0x8));}var _0x4d8594=_0x2d26c0[_0x4774('0x55')][_0x4774('0x25')]({'plain':!![]});if(!_0x4d8594)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d8594['role']===_0x4774('0x55')){var _0x3ce318=_0x26420d[_0x4774('0x25')]({'plain':!![]});return db[_0x4774('0x56')][_0x4774('0x49')]({'where':{'name':_0x4774('0x26'),'userProfileId':_0x4d8594[_0x4774('0x57')]},'raw':!![]})[_0x4774('0x23')](function(_0x5ca78a){if(_0x5ca78a&&_0x5ca78a['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3ce318[_0x4774('0x2a')],'resourceId':_0x3ce318['id'],'type':_0x5ca78a[_0x4774('0x2a')],'sectionId':_0x5ca78a['id']},{})[_0x4774('0x23')](function(){return _0x26420d;});}else{return _0x26420d;}})[_0x4774('0x44')](function(_0x339dea){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x339dea);});}return _0x26420d;});})[_0x4774('0x23')](respondWithResult(_0x472f8b,0xc9))[_0x4774('0x44')](handleError(_0x472f8b,null));};exports['destroy']=function(_0xfada48,_0x4a0a00,_0x5b6e53){var _0xe2c479;return db[_0x4774('0x2e')][_0x4774('0x49')]({'where':{'id':_0xfada48[_0x4774('0x45')]['id']}})[_0x4774('0x23')](function(_0x4a271b){if(_0x4a271b){return db[_0x4774('0x4c')][_0x4774('0x58')](function(_0x50ea79){return _0x4a271b[_0x4774('0x24')]({'transaction':_0x50ea79,'raw':!![]})[_0x4774('0x23')](function(_0x263bd6){if(_0x263bd6[_0x4774('0x4e')]){fs[_0x4774('0x59')](_0x263bd6[_0x4774('0x4e')])[_0x4774('0x5a')](function(_0xc08d83){fs[_0x4774('0x5b')](path['join'](_0x263bd6[_0x4774('0x4e')],_0xc08d83));});fs[_0x4774('0x5c')](_0x263bd6[_0x4774('0x4e')]);}return _0x263bd6;});})['catch'](function(_0x22733d){throw new db[(_0x4774('0x5d'))][(_0x4774('0x5e'))](_0x22733d[_0x4774('0x5f')]);});}})[_0x4774('0x23')](handleEntityNotFound(_0x4a0a00,null))[_0x4774('0x23')](removeEntity(_0x4a0a00,null))['catch'](handleError(_0x4a0a00,null));};exports['addSound']=function(_0x4997b0,_0x2d70c7,_0x5bca7f){return db[_0x4774('0x4c')][_0x4774('0x58')](function(_0x549e93){var _0x2ed0df;return db[_0x4774('0x2e')][_0x4774('0x49')]({'where':{'id':_0x4997b0[_0x4774('0x45')]['id']}})['then'](function(_0x218ebc){if(_0x218ebc){_0x2ed0df=_0x218ebc;return _0x218ebc['addSound'](_0x4997b0['body']['id'],{'transaction':_0x549e93});}})[_0x4774('0x23')](function(_0x513214){if(_0x513214){return db['Sound'][_0x4774('0x60')]({'where':{'id':_0x4997b0[_0x4774('0x4a')]['id']},'attributes':['id',_0x4774('0x2a'),'save_name',_0x4774('0x61'),'createdAt'],'raw':!![]});}})[_0x4774('0x23')](function(_0x877173){if(_0x877173){var _0x243c6b=path['join'](config[_0x4774('0x50')],_0x4774('0x62'),util[_0x4774('0x63')](_0x4774('0x64'),path['basename'](_0x877173['save_name'],path[_0x4774('0x65')](_0x877173[_0x4774('0x66')])),_0x877173[_0x4774('0x61')]));var _0x3709b8=path[_0x4774('0x4f')](config[_0x4774('0x50')],_0x4774('0x51'),_0x2ed0df[_0x4774('0x2a')],util[_0x4774('0x63')](_0x4774('0x64'),_0x877173['name'],_0x877173['converted_format']));fs['symlinkSync'](_0x243c6b,_0x3709b8);return _0x877173;}})[_0x4774('0x44')](function(_0x4df1a5){throw new db['Sequelize'][(_0x4774('0x5e'))](_0x4df1a5['message']);});})[_0x4774('0x23')](handleEntityNotFound(_0x2d70c7,null))[_0x4774('0x23')](respondWithResult(_0x2d70c7,0xc9))[_0x4774('0x44')](handleError(_0x2d70c7,null));};exports[_0x4774('0x67')]=function(_0x52fc40,_0x646311,_0x27825b){return db[_0x4774('0x4c')][_0x4774('0x58')](function(_0x438311){var _0x547d80;return db[_0x4774('0x2e')][_0x4774('0x60')]({'where':{'id':_0x52fc40[_0x4774('0x45')]['id']}})[_0x4774('0x23')](handleEntityNotFound(_0x646311,null))[_0x4774('0x23')](function(_0x48ae63){if(_0x48ae63){_0x547d80=_0x48ae63;return _0x48ae63[_0x4774('0x67')](_0x52fc40[_0x4774('0x45')][_0x4774('0x68')]);}})['then'](function(_0x2d9aa1){if(_0x2d9aa1){return db[_0x4774('0x69')]['findOne']({'where':{'id':_0x52fc40[_0x4774('0x45')][_0x4774('0x68')]},'attributes':['id',_0x4774('0x2a'),_0x4774('0x66'),'converted_format',_0x4774('0x6a')],'raw':!![]});}})[_0x4774('0x23')](function(_0x32051f){if(_0x32051f){fs[_0x4774('0x5b')](path[_0x4774('0x4f')](_0x547d80[_0x4774('0x4e')],util[_0x4774('0x63')](_0x4774('0x64'),_0x32051f[_0x4774('0x2a')],_0x32051f[_0x4774('0x61')])));return _0x32051f;}})[_0x4774('0x44')](function(_0x35a3d4){throw new db[(_0x4774('0x5d'))][(_0x4774('0x5e'))](_0x35a3d4[_0x4774('0x5f')]);});})[_0x4774('0x23')](handleEntityNotFound(_0x646311,null))[_0x4774('0x23')](respondWithStatusCode(_0x646311,0xcc))[_0x4774('0x44')](handleError(_0x646311,null));};exports[_0x4774('0x6b')]=function(_0x68ae26,_0x5b66ff,_0x2f4bd6){var _0x308093={};var _0x231aeb={};var _0x52ee4b;var _0xec2956;return db[_0x4774('0x2e')]['findOne']({'where':{'id':_0x68ae26[_0x4774('0x45')]['id']}})[_0x4774('0x23')](handleEntityNotFound(_0x5b66ff,null))['then'](function(_0x27af4b){if(_0x27af4b){_0x52ee4b=_0x27af4b;_0x231aeb['model']=_[_0x4774('0x34')](db[_0x4774('0x69')][_0x4774('0x46')]);_0x231aeb[_0x4774('0x33')]=_[_0x4774('0x34')](_0x68ae26['query']);_0x231aeb[_0x4774('0x3d')]=_[_0x4774('0x35')](_0x231aeb[_0x4774('0x32')],_0x231aeb[_0x4774('0x33')]);_0x308093[_0x4774('0x37')]=_[_0x4774('0x35')](_0x231aeb[_0x4774('0x32')],qs['fields'](_0x68ae26[_0x4774('0x33')][_0x4774('0x36')]));_0x308093[_0x4774('0x37')]=_0x308093[_0x4774('0x37')][_0x4774('0x47')]?_0x308093['attributes']:_0x231aeb[_0x4774('0x32')];_0x308093[_0x4774('0x3a')]=qs[_0x4774('0x3b')](_0x68ae26[_0x4774('0x33')][_0x4774('0x3b')]);_0x308093[_0x4774('0x3c')]=qs['filters'](_[_0x4774('0x6c')](_0x68ae26[_0x4774('0x33')],_0x231aeb['filters']));if(_0x68ae26[_0x4774('0x33')][_0x4774('0x3e')]){_0x308093[_0x4774('0x3c')]=_[_0x4774('0x3f')](_0x308093[_0x4774('0x3c')],{'$or':_[_0x4774('0x2d')](_0x308093[_0x4774('0x37')],function(_0x3ec1b1){var _0x40c5e0={};_0x40c5e0[_0x3ec1b1]={'$like':'%'+_0x68ae26['query'][_0x4774('0x3e')]+'%'};return _0x40c5e0;})});}_0x308093=_[_0x4774('0x3f')]({},_0x308093,_0x68ae26[_0x4774('0x41')]);return _0x52ee4b[_0x4774('0x6b')](_0x308093);}})[_0x4774('0x23')](function(_0x4e62c8){if(_0x4e62c8){_0xec2956=_0x4e62c8['length'];if(!_0x68ae26[_0x4774('0x33')][_0x4774('0x38')](_0x4774('0x39'))){_0x308093['limit']=qs[_0x4774('0x1b')](_0x68ae26[_0x4774('0x33')][_0x4774('0x1b')]);_0x308093[_0x4774('0x1a')]=qs[_0x4774('0x1a')](_0x68ae26[_0x4774('0x33')][_0x4774('0x1a')]);}return _0x52ee4b[_0x4774('0x6b')](_0x308093);}})[_0x4774('0x23')](function(_0x29bc3f){if(_0x29bc3f){return _0x29bc3f?{'count':_0xec2956,'rows':_0x29bc3f}:null;}})[_0x4774('0x23')](respondWithResult(_0x5b66ff,null))[_0x4774('0x44')](handleError(_0x5b66ff,null));}; \ No newline at end of file +var _0x5ba0=['VoiceMusicOnHold','rawAttributes','fieldName','key','query','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','find','body','create','sequelize','mode','directory','join','server/files/moh','0777','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','Sound','save_name','converted_format','createdAt','server/files/sounds/converted','format','basename','root','symlinkSync','message','removeSound','findOne','id2','%s.%s','getSounds','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','Content-Range','save','update','destroy','then','UserProfileResource','sendStatus','error','stack','name','send','index','map'];(function(_0x2dcf38,_0x33765a){var _0x2295dc=function(_0x1aff4f){while(--_0x1aff4f){_0x2dcf38['push'](_0x2dcf38['shift']());}};_0x2295dc(++_0x33765a);}(_0x5ba0,0x194));var _0x05ba=function(_0x3cd83e,_0x4f1899){_0x3cd83e=_0x3cd83e-0x0;var _0x1ec296=_0x5ba0[_0x3cd83e];return _0x1ec296;};'use strict';var emlformat=require(_0x05ba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x05ba('0x1'));var jsonpatch=require(_0x05ba('0x2'));var rp=require(_0x05ba('0x3'));var moment=require(_0x05ba('0x4'));var BPromise=require(_0x05ba('0x5'));var Mustache=require(_0x05ba('0x6'));var util=require(_0x05ba('0x7'));var path=require(_0x05ba('0x8'));var sox=require(_0x05ba('0x9'));var csv=require(_0x05ba('0xa'));var ejs=require(_0x05ba('0xb'));var fs=require('fs');var fs_extra=require(_0x05ba('0xc'));var _=require(_0x05ba('0xd'));var squel=require(_0x05ba('0xe'));var crypto=require('crypto');var jsforce=require(_0x05ba('0xf'));var deskjs=require(_0x05ba('0x10'));var toCsv=require('to-csv');var querystring=require(_0x05ba('0x11'));var Papa=require(_0x05ba('0x12'));var Redis=require(_0x05ba('0x13'));var authService=require(_0x05ba('0x14'));var qs=require(_0x05ba('0x15'));var as=require(_0x05ba('0x16'));var hardwareService=require(_0x05ba('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x05ba('0x18'));var config=require(_0x05ba('0x19'));var licenseUtil=require(_0x05ba('0x1a'));var db=require(_0x05ba('0x1b'))['db'];function respondWithStatusCode(_0x179b60,_0xc6bbe0){_0xc6bbe0=_0xc6bbe0||0xcc;return function(_0x201ec4){if(_0x201ec4){return _0x179b60['sendStatus'](_0xc6bbe0);}return _0x179b60['status'](_0xc6bbe0)[_0x05ba('0x1c')]();};}function respondWithResult(_0x4d9b33,_0x37fdfc){_0x37fdfc=_0x37fdfc||0xc8;return function(_0x1d1c39){if(_0x1d1c39){return _0x4d9b33[_0x05ba('0x1d')](_0x37fdfc)[_0x05ba('0x1e')](_0x1d1c39);}};}function respondWithFilteredResult(_0x355bbe,_0x3693f0){return function(_0x297476){if(_0x297476){var _0x31e107=typeof _0x3693f0['offset']===_0x05ba('0x1f')&&typeof _0x3693f0[_0x05ba('0x20')]===_0x05ba('0x1f');var _0x1b94f8=_0x297476[_0x05ba('0x21')];var _0x456998=_0x31e107?0x0:_0x3693f0[_0x05ba('0x22')];var _0x5d2920=_0x31e107?_0x297476[_0x05ba('0x21')]:_0x3693f0[_0x05ba('0x22')]+_0x3693f0[_0x05ba('0x20')];var _0x2699e7;if(_0x5d2920>=_0x1b94f8){_0x5d2920=_0x1b94f8;_0x2699e7=0xc8;}else{_0x2699e7=0xce;}_0x355bbe['status'](_0x2699e7);return _0x355bbe['set'](_0x05ba('0x23'),_0x456998+'-'+_0x5d2920+'/'+_0x1b94f8)['json'](_0x297476);}return null;};}function patchUpdates(_0x5a567d){return function(_0x12c69e){try{jsonpatch['apply'](_0x12c69e,_0x5a567d,!![]);}catch(_0x3bbb40){return BPromise['reject'](_0x3bbb40);}return _0x12c69e[_0x05ba('0x24')]();};}function saveUpdates(_0x535a09,_0x4f1747){return function(_0x1d472c){if(_0x1d472c){return _0x1d472c[_0x05ba('0x25')](_0x535a09)['then'](function(_0x3c75f1){return _0x3c75f1;});}return null;};}function removeEntity(_0x3a0bf9,_0x338519){return function(_0x1d723b){if(_0x1d723b){return _0x1d723b[_0x05ba('0x26')]()[_0x05ba('0x27')](function(){var _0x9bd492=_0x1d723b['get']({'plain':!![]});var _0x46ba2e='MusicOnHolds';return db[_0x05ba('0x28')][_0x05ba('0x26')]({'where':{'type':_0x46ba2e,'resourceId':_0x9bd492['id']}})[_0x05ba('0x27')](function(){return _0x1d723b;});})[_0x05ba('0x27')](function(){_0x3a0bf9[_0x05ba('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f0729,_0x52917e){return function(_0x3f9304){if(!_0x3f9304){_0x2f0729[_0x05ba('0x29')](0x194);}return _0x3f9304;};}function handleError(_0x114e0a,_0xc0e04b){_0xc0e04b=_0xc0e04b||0x1f4;return function(_0x169082){logger[_0x05ba('0x2a')](_0x169082[_0x05ba('0x2b')]);if(_0x169082[_0x05ba('0x2c')]){delete _0x169082['name'];}_0x114e0a[_0x05ba('0x1d')](_0xc0e04b)[_0x05ba('0x2d')](_0x169082);};}exports[_0x05ba('0x2e')]=function(_0x2f3695,_0xe11ffc){var _0x3ead2b={},_0x2def15={},_0x4fec84={'count':0x0,'rows':[]};var _0x1b625f=_[_0x05ba('0x2f')](db[_0x05ba('0x30')][_0x05ba('0x31')],function(_0x2f7c6c){return{'name':_0x2f7c6c[_0x05ba('0x32')],'type':_0x2f7c6c['type'][_0x05ba('0x33')]};});_0x2def15['model']=_[_0x05ba('0x2f')](_0x1b625f,_0x05ba('0x2c'));_0x2def15['query']=_['keys'](_0x2f3695[_0x05ba('0x34')]);_0x2def15['filters']=_['intersection'](_0x2def15['model'],_0x2def15[_0x05ba('0x34')]);_0x3ead2b['attributes']=_[_0x05ba('0x35')](_0x2def15['model'],qs[_0x05ba('0x36')](_0x2f3695[_0x05ba('0x34')][_0x05ba('0x36')]));_0x3ead2b[_0x05ba('0x37')]=_0x3ead2b['attributes'][_0x05ba('0x38')]?_0x3ead2b[_0x05ba('0x37')]:_0x2def15[_0x05ba('0x39')];if(!_0x2f3695['query'][_0x05ba('0x3a')](_0x05ba('0x3b'))){_0x3ead2b['limit']=qs[_0x05ba('0x20')](_0x2f3695[_0x05ba('0x34')][_0x05ba('0x20')]);_0x3ead2b[_0x05ba('0x22')]=qs['offset'](_0x2f3695[_0x05ba('0x34')]['offset']);}_0x3ead2b[_0x05ba('0x3c')]=qs[_0x05ba('0x3d')](_0x2f3695[_0x05ba('0x34')][_0x05ba('0x3d')]);delete _0x2f3695[_0x05ba('0x34')]['sort'];_0x3ead2b[_0x05ba('0x3e')]=qs[_0x05ba('0x3f')](_[_0x05ba('0x40')](_0x2f3695[_0x05ba('0x34')],_0x2def15['filters']),_0x1b625f);if(_0x2f3695[_0x05ba('0x34')]['filter']){_0x3ead2b[_0x05ba('0x3e')]=_[_0x05ba('0x41')](_0x3ead2b[_0x05ba('0x3e')],{'$or':_[_0x05ba('0x2f')](_0x1b625f,function(_0x59b105){if(_0x59b105[_0x05ba('0x42')]!==_0x05ba('0x43')){var _0x3d77fe={};_0x3d77fe[_0x59b105['name']]={'$like':'%'+_0x2f3695[_0x05ba('0x34')][_0x05ba('0x44')]+'%'};return _0x3d77fe;}})});}_0x3ead2b=_[_0x05ba('0x41')]({},_0x3ead2b,_0x2f3695[_0x05ba('0x45')]);var _0x318533={'where':_0x3ead2b[_0x05ba('0x3e')]};return db[_0x05ba('0x30')][_0x05ba('0x21')](_0x318533)[_0x05ba('0x27')](function(_0x589894){_0x4fec84[_0x05ba('0x21')]=_0x589894;if(_0x2f3695[_0x05ba('0x34')][_0x05ba('0x46')]){_0x3ead2b[_0x05ba('0x47')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x05ba('0x48')](_0x3ead2b);})[_0x05ba('0x27')](function(_0x233843){_0x4fec84['rows']=_0x233843;return _0x4fec84;})['then'](respondWithFilteredResult(_0xe11ffc,_0x3ead2b))[_0x05ba('0x49')](handleError(_0xe11ffc,null));};exports[_0x05ba('0x4a')]=function(_0x17c503,_0x316b33){var _0x33ffad={'raw':![],'where':{'id':_0x17c503[_0x05ba('0x4b')]['id']}},_0x4de876={};_0x4de876['model']=_[_0x05ba('0x4c')](db[_0x05ba('0x30')][_0x05ba('0x31')]);_0x4de876[_0x05ba('0x34')]=_[_0x05ba('0x4c')](_0x17c503[_0x05ba('0x34')]);_0x4de876['filters']=_[_0x05ba('0x35')](_0x4de876[_0x05ba('0x39')],_0x4de876[_0x05ba('0x34')]);_0x33ffad[_0x05ba('0x37')]=_[_0x05ba('0x35')](_0x4de876['model'],qs[_0x05ba('0x36')](_0x17c503[_0x05ba('0x34')][_0x05ba('0x36')]));_0x33ffad[_0x05ba('0x37')]=_0x33ffad[_0x05ba('0x37')][_0x05ba('0x38')]?_0x33ffad[_0x05ba('0x37')]:_0x4de876[_0x05ba('0x39')];if(_0x17c503[_0x05ba('0x34')][_0x05ba('0x46')]){_0x33ffad[_0x05ba('0x47')]=[{'all':!![]}];}_0x33ffad=_[_0x05ba('0x41')]({},_0x33ffad,_0x17c503['options']);return db[_0x05ba('0x30')][_0x05ba('0x4d')](_0x33ffad)['then'](handleEntityNotFound(_0x316b33,null))[_0x05ba('0x27')](respondWithResult(_0x316b33,null))[_0x05ba('0x49')](handleError(_0x316b33,null));};exports['update']=function(_0x39bdfa,_0x33c833){if(_0x39bdfa[_0x05ba('0x4e')]['id']){delete _0x39bdfa['body']['id'];}return db[_0x05ba('0x30')][_0x05ba('0x4d')]({'where':{'id':_0x39bdfa[_0x05ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0x33c833,null))[_0x05ba('0x27')](saveUpdates(_0x39bdfa[_0x05ba('0x4e')],null))[_0x05ba('0x27')](respondWithResult(_0x33c833,null))[_0x05ba('0x49')](handleError(_0x33c833,null));};exports[_0x05ba('0x4f')]=function(_0x11f696,_0x3a84e1,_0x244e3f){return db[_0x05ba('0x50')]['transaction'](function(_0x3a5884){if(_0x11f696[_0x05ba('0x4e')][_0x05ba('0x51')]==='files'){_0x11f696[_0x05ba('0x4e')][_0x05ba('0x52')]=path[_0x05ba('0x53')](config['root'],_0x05ba('0x54'),_0x11f696[_0x05ba('0x4e')][_0x05ba('0x2c')]);}return db['VoiceMusicOnHold'][_0x05ba('0x4f')](_0x11f696[_0x05ba('0x4e')],{'transaction':_0x3a5884})[_0x05ba('0x27')](function(_0x5157ab){if(_0x11f696[_0x05ba('0x4e')][_0x05ba('0x51')]==='files'){fs['mkdirSync'](_0x5157ab[_0x05ba('0x52')],parseInt(_0x05ba('0x55'),0x8));}var _0x22272d=_0x11f696['user'][_0x05ba('0x56')]({'plain':!![]});if(!_0x22272d)throw new Error(_0x05ba('0x57'));if(_0x22272d[_0x05ba('0x58')]===_0x05ba('0x59')){var _0x498dd1=_0x5157ab['get']({'plain':!![]});return db['UserProfileSection'][_0x05ba('0x4d')]({'where':{'name':'MusicOnHolds','userProfileId':_0x22272d[_0x05ba('0x5a')]},'raw':!![]})[_0x05ba('0x27')](function(_0x3f8226){if(_0x3f8226&&_0x3f8226['autoAssociation']===0x0){return db[_0x05ba('0x28')][_0x05ba('0x4f')]({'name':_0x498dd1[_0x05ba('0x2c')],'resourceId':_0x498dd1['id'],'type':_0x3f8226[_0x05ba('0x2c')],'sectionId':_0x3f8226['id']},{})[_0x05ba('0x27')](function(){return _0x5157ab;});}else{return _0x5157ab;}})[_0x05ba('0x49')](function(_0x59b501){logger[_0x05ba('0x2a')](_0x05ba('0x5b'),_0x59b501);});}return _0x5157ab;});})[_0x05ba('0x27')](respondWithResult(_0x3a84e1,0xc9))[_0x05ba('0x49')](handleError(_0x3a84e1,null));};exports['destroy']=function(_0x17f0cd,_0x39d62a,_0x5867d0){var _0x3a3968;return db[_0x05ba('0x30')][_0x05ba('0x4d')]({'where':{'id':_0x17f0cd[_0x05ba('0x4b')]['id']}})[_0x05ba('0x27')](function(_0x3f89f){if(_0x3f89f){return db[_0x05ba('0x50')]['transaction'](function(_0x16e2ca){return _0x3f89f['destroy']({'transaction':_0x16e2ca,'raw':!![]})[_0x05ba('0x27')](function(_0x4de6b4){if(_0x4de6b4[_0x05ba('0x52')]){fs['readdirSync'](_0x4de6b4[_0x05ba('0x52')])[_0x05ba('0x5c')](function(_0x18221d){fs[_0x05ba('0x5d')](path[_0x05ba('0x53')](_0x4de6b4[_0x05ba('0x52')],_0x18221d));});fs[_0x05ba('0x5e')](_0x4de6b4[_0x05ba('0x52')]);}return _0x4de6b4;});})[_0x05ba('0x49')](function(_0x1c07db){throw new db[(_0x05ba('0x5f'))][(_0x05ba('0x60'))](_0x1c07db['message']);});}})[_0x05ba('0x27')](handleEntityNotFound(_0x39d62a,null))['then'](removeEntity(_0x39d62a,null))[_0x05ba('0x49')](handleError(_0x39d62a,null));};exports[_0x05ba('0x61')]=function(_0x48525a,_0x1ba05d,_0x3b0aef){return db[_0x05ba('0x50')]['transaction'](function(_0x5d45de){var _0x42904a;return db[_0x05ba('0x30')][_0x05ba('0x4d')]({'where':{'id':_0x48525a[_0x05ba('0x4b')]['id']}})[_0x05ba('0x27')](function(_0x59ce62){if(_0x59ce62){_0x42904a=_0x59ce62;return _0x59ce62[_0x05ba('0x61')](_0x48525a['body']['id'],{'transaction':_0x5d45de});}})[_0x05ba('0x27')](function(_0x4b0cd7){if(_0x4b0cd7){return db[_0x05ba('0x62')]['findOne']({'where':{'id':_0x48525a[_0x05ba('0x4e')]['id']},'attributes':['id',_0x05ba('0x2c'),_0x05ba('0x63'),_0x05ba('0x64'),_0x05ba('0x65')],'raw':!![]});}})[_0x05ba('0x27')](function(_0x179b2e){if(_0x179b2e){var _0x4358bf=path[_0x05ba('0x53')](config['root'],_0x05ba('0x66'),util[_0x05ba('0x67')]('%s.%s',path[_0x05ba('0x68')](_0x179b2e[_0x05ba('0x63')],path['extname'](_0x179b2e[_0x05ba('0x63')])),_0x179b2e['converted_format']));var _0x229df0=path[_0x05ba('0x53')](config[_0x05ba('0x69')],_0x05ba('0x54'),_0x42904a['name'],util['format']('%s.%s',_0x179b2e[_0x05ba('0x2c')],_0x179b2e['converted_format']));fs[_0x05ba('0x6a')](_0x4358bf,_0x229df0);return _0x179b2e;}})[_0x05ba('0x49')](function(_0x525751){throw new db[(_0x05ba('0x5f'))]['ValidationError'](_0x525751[_0x05ba('0x6b')]);});})[_0x05ba('0x27')](handleEntityNotFound(_0x1ba05d,null))['then'](respondWithResult(_0x1ba05d,0xc9))[_0x05ba('0x49')](handleError(_0x1ba05d,null));};exports[_0x05ba('0x6c')]=function(_0x35faff,_0x3c3bb1,_0x243952){return db[_0x05ba('0x50')]['transaction'](function(_0x4e10da){var _0x32eee9;return db['VoiceMusicOnHold'][_0x05ba('0x6d')]({'where':{'id':_0x35faff[_0x05ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3c3bb1,null))[_0x05ba('0x27')](function(_0x30cfdf){if(_0x30cfdf){_0x32eee9=_0x30cfdf;return _0x30cfdf[_0x05ba('0x6c')](_0x35faff[_0x05ba('0x4b')][_0x05ba('0x6e')]);}})[_0x05ba('0x27')](function(_0x41e8a5){if(_0x41e8a5){return db[_0x05ba('0x62')][_0x05ba('0x6d')]({'where':{'id':_0x35faff[_0x05ba('0x4b')][_0x05ba('0x6e')]},'attributes':['id','name',_0x05ba('0x63'),_0x05ba('0x64'),_0x05ba('0x65')],'raw':!![]});}})[_0x05ba('0x27')](function(_0xf29672){if(_0xf29672){fs['unlinkSync'](path['join'](_0x32eee9[_0x05ba('0x52')],util[_0x05ba('0x67')](_0x05ba('0x6f'),_0xf29672[_0x05ba('0x2c')],_0xf29672[_0x05ba('0x64')])));return _0xf29672;}})[_0x05ba('0x49')](function(_0x3b9376){throw new db[(_0x05ba('0x5f'))][(_0x05ba('0x60'))](_0x3b9376[_0x05ba('0x6b')]);});})['then'](handleEntityNotFound(_0x3c3bb1,null))[_0x05ba('0x27')](respondWithStatusCode(_0x3c3bb1,0xcc))[_0x05ba('0x49')](handleError(_0x3c3bb1,null));};exports[_0x05ba('0x70')]=function(_0x5dc438,_0x4b4934,_0x391c6f){var _0x1acd12={};var _0x394363={};var _0x40292a;var _0x3d9edd;return db[_0x05ba('0x30')][_0x05ba('0x6d')]({'where':{'id':_0x5dc438[_0x05ba('0x4b')]['id']}})[_0x05ba('0x27')](handleEntityNotFound(_0x4b4934,null))[_0x05ba('0x27')](function(_0x81e82c){if(_0x81e82c){_0x40292a=_0x81e82c;_0x394363[_0x05ba('0x39')]=_[_0x05ba('0x4c')](db[_0x05ba('0x62')][_0x05ba('0x31')]);_0x394363[_0x05ba('0x34')]=_[_0x05ba('0x4c')](_0x5dc438[_0x05ba('0x34')]);_0x394363['filters']=_['intersection'](_0x394363[_0x05ba('0x39')],_0x394363[_0x05ba('0x34')]);_0x1acd12[_0x05ba('0x37')]=_[_0x05ba('0x35')](_0x394363[_0x05ba('0x39')],qs['fields'](_0x5dc438[_0x05ba('0x34')][_0x05ba('0x36')]));_0x1acd12[_0x05ba('0x37')]=_0x1acd12[_0x05ba('0x37')]['length']?_0x1acd12['attributes']:_0x394363[_0x05ba('0x39')];_0x1acd12['order']=qs[_0x05ba('0x3d')](_0x5dc438[_0x05ba('0x34')][_0x05ba('0x3d')]);_0x1acd12[_0x05ba('0x3e')]=qs[_0x05ba('0x3f')](_[_0x05ba('0x40')](_0x5dc438[_0x05ba('0x34')],_0x394363[_0x05ba('0x3f')]));if(_0x5dc438['query'][_0x05ba('0x44')]){_0x1acd12[_0x05ba('0x3e')]=_[_0x05ba('0x41')](_0x1acd12[_0x05ba('0x3e')],{'$or':_[_0x05ba('0x2f')](_0x1acd12[_0x05ba('0x37')],function(_0x594aa8){var _0x48116f={};_0x48116f[_0x594aa8]={'$like':'%'+_0x5dc438[_0x05ba('0x34')][_0x05ba('0x44')]+'%'};return _0x48116f;})});}_0x1acd12=_[_0x05ba('0x41')]({},_0x1acd12,_0x5dc438[_0x05ba('0x45')]);return _0x40292a[_0x05ba('0x70')](_0x1acd12);}})[_0x05ba('0x27')](function(_0x53364c){if(_0x53364c){_0x3d9edd=_0x53364c[_0x05ba('0x38')];if(!_0x5dc438[_0x05ba('0x34')][_0x05ba('0x3a')](_0x05ba('0x3b'))){_0x1acd12[_0x05ba('0x20')]=qs[_0x05ba('0x20')](_0x5dc438[_0x05ba('0x34')][_0x05ba('0x20')]);_0x1acd12[_0x05ba('0x22')]=qs[_0x05ba('0x22')](_0x5dc438[_0x05ba('0x34')]['offset']);}return _0x40292a[_0x05ba('0x70')](_0x1acd12);}})[_0x05ba('0x27')](function(_0x10c73d){if(_0x10c73d){return _0x10c73d?{'count':_0x3d9edd,'rows':_0x10c73d}:null;}})[_0x05ba('0x27')](respondWithResult(_0x4b4934,null))[_0x05ba('0x49')](handleError(_0x4b4934,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index ee91dfc..3e9945f 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc15=['lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0x422682,_0x2cf4b3){var _0x360903=function(_0xa2c64a){while(--_0xa2c64a){_0x422682['push'](_0x422682['shift']());}};_0x360903(++_0x2cf4b3);}(_0xcc15,0x108));var _0x5cc1=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xcc15[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x5cc1('0x0'));var util=require(_0x5cc1('0x1'));var logger=require(_0x5cc1('0x2'))(_0x5cc1('0x3'));var moment=require(_0x5cc1('0x4'));var BPromise=require('bluebird');var rp=require(_0x5cc1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5cc1('0x6'));var attributes=require(_0x5cc1('0x7'));module[_0x5cc1('0x8')]=function(_0x37dc90,_0x393fda){return _0x37dc90[_0x5cc1('0x9')](_0x5cc1('0xa'),attributes,{'tableName':_0x5cc1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4514=['path','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5a16f8,_0x310b32){var _0x2a1fe7=function(_0x427d4e){while(--_0x427d4e){_0x5a16f8['push'](_0x5a16f8['shift']());}};_0x2a1fe7(++_0x310b32);}(_0x4514,0xc0));var _0x4451=function(_0x82b2d6,_0x12b83e){_0x82b2d6=_0x82b2d6-0x0;var _0x47df09=_0x4514[_0x82b2d6];return _0x47df09;};'use strict';var _=require(_0x4451('0x0'));var util=require(_0x4451('0x1'));var logger=require(_0x4451('0x2'))(_0x4451('0x3'));var moment=require('moment');var BPromise=require(_0x4451('0x4'));var rp=require(_0x4451('0x5'));var fs=require('fs');var path=require(_0x4451('0x6'));var rimraf=require('rimraf');var config=require(_0x4451('0x7'));var attributes=require(_0x4451('0x8'));module[_0x4451('0x9')]=function(_0x54a10d,_0x245202){return _0x54a10d['define'](_0x4451('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 6259a82..ef0916b 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4070d9,_0x428cab){var _0x4f0dbf=function(_0x35c18a){while(--_0x35c18a){_0x4070d9['push'](_0x4070d9['shift']());}};_0x4f0dbf(++_0x428cab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x297a15,_0x2355e7){var _0x2a6fbf=function(_0x22ac9e){while(--_0x22ac9e){_0x297a15['push'](_0x297a15['shift']());}};_0x2a6fbf(++_0x2355e7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index cea207a..cce1447 100644 --- a/server/api/voicePrefix/index.js +++ b/server/api/voicePrefix/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83f1=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addTeams','put','update','destroy','removeAgents','removeTeams','exports','multer','util','path','connect-timeout'];(function(_0x26f866,_0x1900bc){var _0x1abef3=function(_0x3217de){while(--_0x3217de){_0x26f866['push'](_0x26f866['shift']());}};_0x1abef3(++_0x1900bc);}(_0x83f1,0x1cc));var _0x183f=function(_0x305c70,_0x3da947){_0x305c70=_0x305c70-0x0;var _0x52cdc8=_0x83f1[_0x305c70];return _0x52cdc8;};'use strict';var multer=require(_0x183f('0x0'));var util=require(_0x183f('0x1'));var path=require(_0x183f('0x2'));var timeout=require(_0x183f('0x3'));var express=require(_0x183f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x183f('0x5'));var interaction=require(_0x183f('0x6'));var config=require(_0x183f('0x7'));var controller=require(_0x183f('0x8'));router[_0x183f('0x9')]('/',auth['isAuthenticated'](),controller[_0x183f('0xa')]);router[_0x183f('0x9')](_0x183f('0xb'),auth['isAuthenticated'](),controller[_0x183f('0xc')]);router['get'](_0x183f('0xd'),auth[_0x183f('0xe')](),controller[_0x183f('0xf')]);router[_0x183f('0x9')](_0x183f('0x10'),auth[_0x183f('0xe')](),controller[_0x183f('0x11')]);router['get'](_0x183f('0x12'),auth[_0x183f('0xe')](),controller[_0x183f('0x13')]);router[_0x183f('0x14')]('/',auth[_0x183f('0xe')](),controller[_0x183f('0x15')]);router[_0x183f('0x14')]('/:id/users',auth[_0x183f('0xe')](),controller['addAgents']);router['post'](_0x183f('0x12'),auth[_0x183f('0xe')](),controller[_0x183f('0x16')]);router[_0x183f('0x17')](_0x183f('0xd'),auth['isAuthenticated'](),controller[_0x183f('0x18')]);router['delete'](_0x183f('0xd'),auth[_0x183f('0xe')](),controller[_0x183f('0x19')]);router['delete'](_0x183f('0x10'),auth[_0x183f('0xe')](),controller[_0x183f('0x1a')]);router['delete'](_0x183f('0x12'),auth[_0x183f('0xe')](),controller[_0x183f('0x1b')]);module[_0x183f('0x1c')]=router; \ No newline at end of file +var _0xa5c0=['/:id','show','getAgents','/:id/teams','getTeams','create','post','/:id/users','addAgents','addTeams','put','update','destroy','removeAgents','delete','removeTeams','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','isAuthenticated','describe','get'];(function(_0xd13a88,_0x3c5269){var _0x1c993c=function(_0x245af5){while(--_0x245af5){_0xd13a88['push'](_0xd13a88['shift']());}};_0x1c993c(++_0x3c5269);}(_0xa5c0,0xbf));var _0x0a5c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5c0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0a5c('0x0'));var util=require(_0x0a5c('0x1'));var path=require(_0x0a5c('0x2'));var timeout=require('connect-timeout');var express=require(_0x0a5c('0x3'));var router=express[_0x0a5c('0x4')]();var fs_extra=require(_0x0a5c('0x5'));var auth=require(_0x0a5c('0x6'));var interaction=require(_0x0a5c('0x7'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0a5c('0x8')]);router['get']('/describe',auth[_0x0a5c('0x9')](),controller[_0x0a5c('0xa')]);router[_0x0a5c('0xb')](_0x0a5c('0xc'),auth[_0x0a5c('0x9')](),controller[_0x0a5c('0xd')]);router[_0x0a5c('0xb')]('/:id/users',auth[_0x0a5c('0x9')](),controller[_0x0a5c('0xe')]);router['get'](_0x0a5c('0xf'),auth[_0x0a5c('0x9')](),controller[_0x0a5c('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0a5c('0x11')]);router[_0x0a5c('0x12')](_0x0a5c('0x13'),auth[_0x0a5c('0x9')](),controller[_0x0a5c('0x14')]);router[_0x0a5c('0x12')](_0x0a5c('0xf'),auth[_0x0a5c('0x9')](),controller[_0x0a5c('0x15')]);router[_0x0a5c('0x16')](_0x0a5c('0xc'),auth[_0x0a5c('0x9')](),controller[_0x0a5c('0x17')]);router['delete']('/:id',auth[_0x0a5c('0x9')](),controller[_0x0a5c('0x18')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x0a5c('0x19')]);router[_0x0a5c('0x1a')](_0x0a5c('0xf'),auth[_0x0a5c('0x9')](),controller[_0x0a5c('0x1b')]);module[_0x0a5c('0x1c')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index a9dcb43..b53e812 100644 --- a/server/api/voicePrefix/voicePrefix.attributes.js +++ b/server/api/voicePrefix/voicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcdf5=['getDataValue','INTEGER','exports','STRING','name','VIRTUAL','system-'];(function(_0x50ac3d,_0x4e8e7d){var _0x9a555c=function(_0x31028c){while(--_0x31028c){_0x50ac3d['push'](_0x50ac3d['shift']());}};_0x9a555c(++_0x4e8e7d);}(_0xcdf5,0x1bb));var _0x5cdf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xcdf5[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module[_0x5cdf('0x0')]={'name':{'type':Sequelize[_0x5cdf('0x1')],'allowNull':![],'unique':_0x5cdf('0x2')},'prefix':{'type':Sequelize[_0x5cdf('0x3')],'get':function(_0x5e38da){return _0x5cdf('0x4')+this[_0x5cdf('0x5')](_0x5cdf('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x5cdf('0x6')]}}; \ No newline at end of file +var _0x07c7=['sequelize','exports','STRING','name','VIRTUAL','system-','getDataValue','INTEGER'];(function(_0x345c5d,_0x333867){var _0x2502f5=function(_0x1c9279){while(--_0x1c9279){_0x345c5d['push'](_0x345c5d['shift']());}};_0x2502f5(++_0x333867);}(_0x07c7,0xc0));var _0x707c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x07c7[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x707c('0x0'));module[_0x707c('0x1')]={'name':{'type':Sequelize[_0x707c('0x2')],'allowNull':![],'unique':_0x707c('0x3')},'prefix':{'type':Sequelize[_0x707c('0x4')],'get':function(_0x44ba4c){return _0x707c('0x5')+this[_0x707c('0x6')](_0x707c('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x707c('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x707c('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 5e26c37..8b178e0 100644 --- a/server/api/voicePrefix/voicePrefix.controller.js +++ b/server/api/voicePrefix/voicePrefix.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14a0=['mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','VoicePrefixes','UserProfileResource','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','params','find','describe','sequelize','body','get','VoiceExtension','VoiceExtensionId','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','create','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','charAt','system-','transaction','addAgents','ids','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','pick','getTeams','addTeams','findAll','User','Agents','online','voicePause','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','Team','select','from','join','user_has_teams','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5965d9,_0x185b85){var _0x30ce52=function(_0x77f86f){while(--_0x77f86f){_0x5965d9['push'](_0x5965d9['shift']());}};_0x30ce52(++_0x185b85);}(_0x14a0,0x8e));var _0x014a=function(_0x74923d,_0x4eff77){_0x74923d=_0x74923d-0x0;var _0x2c9e16=_0x14a0[_0x74923d];return _0x2c9e16;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x014a('0x0'));var zipdir=require(_0x014a('0x1'));var jsonpatch=require(_0x014a('0x2'));var rp=require(_0x014a('0x3'));var moment=require(_0x014a('0x4'));var BPromise=require(_0x014a('0x5'));var Mustache=require(_0x014a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x014a('0x7'));var csv=require(_0x014a('0x8'));var ejs=require(_0x014a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x014a('0xf'))(_0x014a('0x10'));var utils=require('../../config/utils');var config=require(_0x014a('0x11'));var licenseUtil=require(_0x014a('0x12'));var db=require(_0x014a('0x13'))['db'];config[_0x014a('0x14')]=_[_0x014a('0x15')](config[_0x014a('0x14')],{'host':_0x014a('0x16'),'port':0x18eb});var socket=require(_0x014a('0x17'))(new Redis(config[_0x014a('0x14')]));require(_0x014a('0x18'))[_0x014a('0x19')](socket);function respondWithStatusCode(_0x3c54c8,_0x4fe87c){_0x4fe87c=_0x4fe87c||0xcc;return function(_0x130d13){if(_0x130d13){return _0x3c54c8[_0x014a('0x1a')](_0x4fe87c);}return _0x3c54c8['status'](_0x4fe87c)[_0x014a('0x1b')]();};}function respondWithResult(_0x128c46,_0x59a4ea){_0x59a4ea=_0x59a4ea||0xc8;return function(_0x16e6fc){if(_0x16e6fc){return _0x128c46[_0x014a('0x1c')](_0x59a4ea)[_0x014a('0x1d')](_0x16e6fc);}};}function respondWithFilteredResult(_0x12da95,_0x2c26ac){return function(_0x12d339){if(_0x12d339){var _0x61ec9f=typeof _0x2c26ac[_0x014a('0x1e')]===_0x014a('0x1f')&&typeof _0x2c26ac[_0x014a('0x20')]===_0x014a('0x1f');var _0x89e132=_0x12d339[_0x014a('0x21')];var _0x34e5c3=_0x61ec9f?0x0:_0x2c26ac['offset'];var _0x359903=_0x61ec9f?_0x12d339[_0x014a('0x21')]:_0x2c26ac[_0x014a('0x1e')]+_0x2c26ac[_0x014a('0x20')];var _0xc9a563;if(_0x359903>=_0x89e132){_0x359903=_0x89e132;_0xc9a563=0xc8;}else{_0xc9a563=0xce;}_0x12da95[_0x014a('0x1c')](_0xc9a563);return _0x12da95[_0x014a('0x22')](_0x014a('0x23'),_0x34e5c3+'-'+_0x359903+'/'+_0x89e132)[_0x014a('0x1d')](_0x12d339);}return null;};}function patchUpdates(_0x486e66){return function(_0x3679ed){try{jsonpatch['apply'](_0x3679ed,_0x486e66,!![]);}catch(_0x1a1318){return BPromise[_0x014a('0x24')](_0x1a1318);}return _0x3679ed[_0x014a('0x25')]();};}function saveUpdates(_0x36d52b,_0x2b3c10){return function(_0x113b12){if(_0x113b12){return _0x113b12[_0x014a('0x26')](_0x36d52b)[_0x014a('0x27')](function(_0x165a42){return _0x165a42;});}return null;};}function removeEntity(_0x4c2627,_0x3b4b92){return function(_0x5358e9){if(_0x5358e9){return _0x5358e9[_0x014a('0x28')]()[_0x014a('0x27')](function(){var _0x4f1c44=_0x5358e9['get']({'plain':!![]});var _0x9a901f=_0x014a('0x29');return db[_0x014a('0x2a')]['destroy']({'where':{'type':_0x9a901f,'resourceId':_0x4f1c44['id']}})[_0x014a('0x27')](function(){return _0x5358e9;});})[_0x014a('0x27')](function(){_0x4c2627['status'](0xcc)[_0x014a('0x1b')]();});}};}function handleEntityNotFound(_0x2560a6,_0x496040){return function(_0x4f9c1c){if(!_0x4f9c1c){_0x2560a6[_0x014a('0x1a')](0x194);}return _0x4f9c1c;};}function handleError(_0x3e5a0a,_0xe70dfa){_0xe70dfa=_0xe70dfa||0x1f4;return function(_0x29fce5){logger['error'](_0x29fce5[_0x014a('0x2b')]);if(_0x29fce5[_0x014a('0x2c')]){delete _0x29fce5[_0x014a('0x2c')];}_0x3e5a0a[_0x014a('0x1c')](_0xe70dfa)[_0x014a('0x2d')](_0x29fce5);};}exports[_0x014a('0x2e')]=function(_0x354f4c,_0x1dae8e){var _0xc802d5={},_0x3c8755={},_0x9dfb11={'count':0x0,'rows':[]};var _0x4ed54e=_[_0x014a('0x2f')](db[_0x014a('0x30')][_0x014a('0x31')],function(_0x457883){return{'name':_0x457883[_0x014a('0x32')],'type':_0x457883[_0x014a('0x33')][_0x014a('0x34')]};});_0x3c8755['model']=_[_0x014a('0x2f')](_0x4ed54e,_0x014a('0x2c'));_0x3c8755['query']=_[_0x014a('0x35')](_0x354f4c[_0x014a('0x36')]);_0x3c8755[_0x014a('0x37')]=_[_0x014a('0x38')](_0x3c8755[_0x014a('0x39')],_0x3c8755[_0x014a('0x36')]);_0xc802d5[_0x014a('0x3a')]=_[_0x014a('0x38')](_0x3c8755['model'],qs[_0x014a('0x3b')](_0x354f4c[_0x014a('0x36')][_0x014a('0x3b')]));_0xc802d5[_0x014a('0x3a')]=_0xc802d5['attributes'][_0x014a('0x3c')]?_0xc802d5[_0x014a('0x3a')]:_0x3c8755[_0x014a('0x39')];if(!_0x354f4c[_0x014a('0x36')][_0x014a('0x3d')](_0x014a('0x3e'))){_0xc802d5[_0x014a('0x20')]=qs[_0x014a('0x20')](_0x354f4c[_0x014a('0x36')]['limit']);_0xc802d5[_0x014a('0x1e')]=qs['offset'](_0x354f4c[_0x014a('0x36')][_0x014a('0x1e')]);}_0xc802d5[_0x014a('0x3f')]=qs[_0x014a('0x40')](_0x354f4c[_0x014a('0x36')]['sort']);_0xc802d5[_0x014a('0x41')]=qs[_0x014a('0x37')](_['pick'](_0x354f4c[_0x014a('0x36')],_0x3c8755[_0x014a('0x37')]),_0x4ed54e);if(_0x354f4c[_0x014a('0x36')][_0x014a('0x42')]){_0xc802d5[_0x014a('0x41')]=_[_0x014a('0x43')](_0xc802d5[_0x014a('0x41')],{'$or':_[_0x014a('0x2f')](_0x4ed54e,function(_0x2beddc){if(_0x2beddc['type']!==_0x014a('0x44')){var _0x3baf40={};_0x3baf40[_0x2beddc[_0x014a('0x2c')]]={'$like':'%'+_0x354f4c[_0x014a('0x36')]['filter']+'%'};return _0x3baf40;}})});}_0xc802d5=_[_0x014a('0x43')]({},_0xc802d5,_0x354f4c[_0x014a('0x45')]);var _0x4cd132={'where':_0xc802d5[_0x014a('0x41')]};return db[_0x014a('0x30')][_0x014a('0x21')](_0x4cd132)['then'](function(_0x361866){_0x9dfb11[_0x014a('0x21')]=_0x361866;if(_0x354f4c['query'][_0x014a('0x46')]){_0xc802d5[_0x014a('0x47')]=[{'all':!![]}];}return db[_0x014a('0x30')]['findAll'](_0xc802d5);})[_0x014a('0x27')](function(_0x50a8f0){_0x9dfb11['rows']=_0x50a8f0;return _0x9dfb11;})[_0x014a('0x27')](respondWithFilteredResult(_0x1dae8e,_0xc802d5))[_0x014a('0x48')](handleError(_0x1dae8e,null));};exports['show']=function(_0x1557ad,_0x11c0d5){var _0xa4b68e={'raw':![],'where':{'id':_0x1557ad[_0x014a('0x49')]['id']}},_0x15c5dc={};_0x15c5dc[_0x014a('0x39')]=_['keys'](db[_0x014a('0x30')][_0x014a('0x31')]);_0x15c5dc[_0x014a('0x36')]=_['keys'](_0x1557ad['query']);_0x15c5dc[_0x014a('0x37')]=_['intersection'](_0x15c5dc['model'],_0x15c5dc[_0x014a('0x36')]);_0xa4b68e['attributes']=_[_0x014a('0x38')](_0x15c5dc[_0x014a('0x39')],qs[_0x014a('0x3b')](_0x1557ad['query'][_0x014a('0x3b')]));_0xa4b68e[_0x014a('0x3a')]=_0xa4b68e[_0x014a('0x3a')][_0x014a('0x3c')]?_0xa4b68e[_0x014a('0x3a')]:_0x15c5dc[_0x014a('0x39')];if(_0x1557ad['query'][_0x014a('0x46')]){_0xa4b68e[_0x014a('0x47')]=[{'all':!![]}];}_0xa4b68e=_['merge']({},_0xa4b68e,_0x1557ad[_0x014a('0x45')]);return db[_0x014a('0x30')][_0x014a('0x4a')](_0xa4b68e)[_0x014a('0x27')](handleEntityNotFound(_0x11c0d5,null))[_0x014a('0x27')](respondWithResult(_0x11c0d5,null))[_0x014a('0x48')](handleError(_0x11c0d5,null));};exports[_0x014a('0x28')]=function(_0x21680f,_0x4aa72b){return db[_0x014a('0x30')][_0x014a('0x4a')]({'where':{'id':_0x21680f[_0x014a('0x49')]['id']}})[_0x014a('0x27')](handleEntityNotFound(_0x4aa72b,null))[_0x014a('0x27')](removeEntity(_0x4aa72b,null))['catch'](handleError(_0x4aa72b,null));};exports[_0x014a('0x4b')]=function(_0x5bee56,_0x2da804){return db[_0x014a('0x30')][_0x014a('0x4b')]()[_0x014a('0x27')](respondWithResult(_0x2da804,null))[_0x014a('0x48')](handleError(_0x2da804,null));};exports['create']=function(_0x51e1de,_0x4bb0b2){var _0x58905d;return db[_0x014a('0x4c')]['transaction'](function(_0x1fe253){return db['VoicePrefix']['create'](_0x51e1de[_0x014a('0x4d')],{'transaction':_0x1fe253})['then'](function(_0x1c640b){_0x58905d=_0x1c640b[_0x014a('0x4e')]({'plain':!![]});return db[_0x014a('0x4f')][_0x014a('0x4a')]({'where':{'id':_0x58905d[_0x014a('0x50')]},'raw':!![]})[_0x014a('0x27')](function(_0x35a421){return createVoicePrefixExtensions(_0x58905d,_0x35a421,_0x1fe253);});});})[_0x014a('0x27')](function(){var _0x133fcd=_0x51e1de[_0x014a('0x51')]['get']({'plain':!![]});if(!_0x133fcd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x133fcd[_0x014a('0x52')]===_0x014a('0x51')){var _0x237345=_0x58905d;return db['UserProfileSection']['find']({'where':{'name':_0x014a('0x29'),'userProfileId':_0x133fcd['userProfileId']},'raw':!![]})[_0x014a('0x27')](function(_0x3f6177){if(_0x3f6177&&_0x3f6177[_0x014a('0x53')]===0x0){return db[_0x014a('0x2a')]['create']({'name':_0x237345[_0x014a('0x2c')],'resourceId':_0x237345['id'],'type':_0x3f6177[_0x014a('0x2c')],'sectionId':_0x3f6177['id']},{})[_0x014a('0x27')](function(){return _0x58905d;});}else{return _0x58905d;}})['catch'](function(_0xbaeb5f){logger['error'](_0x014a('0x54'),_0xbaeb5f);throw _0xbaeb5f;});}return _0x58905d;})[_0x014a('0x27')](respondWithResult(_0x4bb0b2,null))[_0x014a('0x48')](handleError(_0x4bb0b2,null));};function Extension(_0x24d433,_0xd0334a,_0x1a308b,_0x4e9260){this[_0x014a('0x55')]=_0x014a('0x56');this[_0x014a('0x57')]=_0x24d433;this['app']=_0x1a308b;this[_0x014a('0x33')]=_0x014a('0x58');this[_0x014a('0x59')]=_0x014a('0x5a');this[_0x014a('0x5b')]=_0xd0334a;this['appdata']=_0x4e9260;}function createVoicePrefixExtensions(_0x8ac9cd,_0x46168d,_0x63c341){return new BPromise(function(_0x37a7b8,_0x3ca7e6){var _0x37b4a5=new Extension(formatPrefixName(_0x8ac9cd[_0x014a('0x5c')]),0x1,_0x014a('0x5d'),_0x014a('0x5e'));_0x37b4a5[_0x014a('0x5f')]=_0x8ac9cd['id'];return db[_0x014a('0x4f')][_0x014a('0x60')](_0x37b4a5,{'transaction':_0x63c341})['then'](function(_0x2ac66a){var _0x5ac216=_0x2ac66a['get']({'plain':!![]});var _0x5c9c47=_['map'](addVoicePrefixExtensions(_0x8ac9cd,_0x46168d),function(_0x5a38b4){_0x5a38b4[_0x014a('0x50')]=_0x5ac216['id'];_0x5a38b4[_0x014a('0x5f')]=_0x8ac9cd['id'];return _0x5a38b4;});return db[_0x014a('0x4f')]['bulkCreate'](_0x5c9c47,{'transaction':_0x63c341})[_0x014a('0x27')](function(_0x2a5007){if(!_0x2a5007){return _0x3ca7e6(_0x014a('0x61'));}else{return _0x37a7b8(_0x2a5007);}})[_0x014a('0x48')](function(_0x4dd210){return _0x3ca7e6(_0x4dd210);});});;});};function addVoicePrefixExtensions(_0x5edf80,_0xd3ab26){var _0x39154c=[];var _0x411948=formatPrefixName(_0x5edf80[_0x014a('0x5c')]);_0x39154c[_0x014a('0x62')](new Extension(_0x411948,0x2,_0x014a('0x63'),_0x014a('0x64')+_0x5edf80[_0x014a('0x2c')]));if(_0x5edf80[_0x014a('0x65')]){_0x39154c[_0x014a('0x62')](new Extension(_0x411948,0x3,_0x014a('0x63'),'PREFIX-CALLERIDALL='+_0x5edf80[_0x014a('0x65')]));}else{_0x39154c[_0x014a('0x62')](new Extension(_0x411948,0x3,'NoOp',_0x014a('0x66')));}_0x39154c[_0x014a('0x62')](new Extension(_0x411948,0x4,'goto',_0xd3ab26[_0x014a('0x55')]+','+'${EXTEN:'+(0x8+_0x5edf80[_0x014a('0x2c')][_0x014a('0x3c')])+'}'+','+0x1));return _0x39154c;}function formatPrefixName(_0xcdcbbb){var _0x456d69='_';for(var _0x37b8f=0x0;_0x37b8f<_0xcdcbbb['length'];_0x37b8f++){if(_0xcdcbbb[_0x014a('0x67')](_0x37b8f)=='-'){_0x456d69+=_0xcdcbbb[_0x014a('0x67')](_0x37b8f);}else{_0x456d69+='['+_0xcdcbbb[_0x014a('0x67')](_0x37b8f)+']';}}_0x456d69+='.';return _0x456d69;}exports[_0x014a('0x26')]=function(_0xbad5ef,_0x52e79e,_0x20cddc){var _0x188e65=_0xbad5ef[_0x014a('0x4d')];_0x188e65['prefix']=_0x014a('0x68')+_0x188e65['name']+'-';return db[_0x014a('0x4c')][_0x014a('0x69')](function(_0x267026){return db[_0x014a('0x30')][_0x014a('0x26')](_0x188e65,{'where':{'id':_0x188e65['id']},'transaction':_0x267026})[_0x014a('0x27')](function(){return db[_0x014a('0x4f')]['destroy']({'where':{'VoicePrefixId':_0x188e65['id']},'transaction':_0x267026})['then'](function(){return db[_0x014a('0x4f')]['find']({'where':{'id':_0x188e65[_0x014a('0x50')]},'raw':!![]})['then'](function(_0x1dcfc6){return createVoicePrefixExtensions(_0x188e65,_0x1dcfc6,_0x267026);});});});})[_0x014a('0x27')](function(){return db['VoicePrefix']['findById'](_0x188e65['id']);})[_0x014a('0x27')](respondWithResult(_0x52e79e,null))[_0x014a('0x48')](handleError(_0x52e79e,null));};exports['addAgents']=function(_0x882fc9,_0x42e4e9,_0x5635fc){return db['VoicePrefix'][_0x014a('0x4a')]({'where':{'id':_0x882fc9[_0x014a('0x49')]['id']}})[_0x014a('0x27')](handleEntityNotFound(_0x42e4e9,null))[_0x014a('0x27')](function(_0x37ea2d){if(_0x37ea2d){return _0x37ea2d[_0x014a('0x6a')](_0x882fc9['body'][_0x014a('0x6b')],_['omit'](_0x882fc9['body'],[_0x014a('0x6b'),'id'])||{})[_0x014a('0x6c')](function(_0x523859){for(var _0x27e363=0x0;_0x27e363<_0x882fc9[_0x014a('0x4d')][_0x014a('0x6b')][_0x014a('0x3c')];_0x27e363+=0x1){socket[_0x014a('0x6d')]('userVoicePrefix:save',{'UserId':Number(_0x882fc9[_0x014a('0x4d')][_0x014a('0x6b')][_0x27e363]),'VoicePrefixId':Number(_0x882fc9[_0x014a('0x49')]['id'])});}return _0x523859;});}})[_0x014a('0x27')](respondWithResult(_0x42e4e9,null))['catch'](handleError(_0x42e4e9,null));};exports[_0x014a('0x6e')]=function(_0x4c568c,_0x469bb0,_0x3807c4){return db[_0x014a('0x30')][_0x014a('0x4a')]({'where':{'id':_0x4c568c[_0x014a('0x49')]['id']}})[_0x014a('0x27')](handleEntityNotFound(_0x469bb0,null))['then'](function(_0x389bfb){if(_0x389bfb){return _0x389bfb[_0x014a('0x6e')](_0x4c568c[_0x014a('0x36')][_0x014a('0x6b')])[_0x014a('0x27')](function(){if(_[_0x014a('0x6f')](_0x4c568c[_0x014a('0x36')][_0x014a('0x6b')])){for(var _0x55cfe7=0x0;_0x55cfe7<_0x4c568c[_0x014a('0x36')][_0x014a('0x6b')][_0x014a('0x3c')];_0x55cfe7+=0x1){socket['emit'](_0x014a('0x70'),{'UserId':Number(_0x4c568c[_0x014a('0x36')][_0x014a('0x6b')][_0x55cfe7]),'VoicePrefixId':Number(_0x4c568c[_0x014a('0x49')]['id'])});}}else{socket[_0x014a('0x6d')](_0x014a('0x70'),{'UserId':Number(_0x4c568c[_0x014a('0x36')]['ids']),'VoicePrefixId':Number(_0x4c568c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x469bb0,null))['catch'](handleError(_0x469bb0,null));};exports[_0x014a('0x71')]=function(_0x32683c,_0x1810a8,_0x3804e1){var _0xe1b5ed={};var _0x7cd599={};var _0x1ba571;var _0x4e5d25;return db[_0x014a('0x30')][_0x014a('0x72')]({'where':{'id':_0x32683c[_0x014a('0x49')]['id']}})[_0x014a('0x27')](handleEntityNotFound(_0x1810a8,null))['then'](function(_0x55d5f1){if(_0x55d5f1){_0x1ba571=_0x55d5f1;_0x7cd599[_0x014a('0x39')]=_[_0x014a('0x35')](db['User']['rawAttributes']);_0x7cd599[_0x014a('0x36')]=_['keys'](_0x32683c['query']);_0x7cd599[_0x014a('0x37')]=_[_0x014a('0x38')](_0x7cd599['model'],_0x7cd599[_0x014a('0x36')]);_0xe1b5ed[_0x014a('0x3a')]=_[_0x014a('0x38')](_0x7cd599[_0x014a('0x39')],qs[_0x014a('0x3b')](_0x32683c[_0x014a('0x36')][_0x014a('0x3b')]));_0xe1b5ed[_0x014a('0x3a')]=_0xe1b5ed['attributes']['length']?_0xe1b5ed[_0x014a('0x3a')]:_0x7cd599['model'];_0xe1b5ed['order']=qs['sort'](_0x32683c[_0x014a('0x36')][_0x014a('0x40')]);_0xe1b5ed[_0x014a('0x41')]=qs['filters'](_[_0x014a('0x73')](_0x32683c[_0x014a('0x36')],_0x7cd599[_0x014a('0x37')]));if(_0x32683c[_0x014a('0x36')]['filter']){_0xe1b5ed[_0x014a('0x41')]=_[_0x014a('0x43')](_0xe1b5ed[_0x014a('0x41')],{'$or':_['map'](_0xe1b5ed[_0x014a('0x3a')],function(_0x52a3a8){var _0x59871d={};_0x59871d[_0x52a3a8]={'$like':'%'+_0x32683c[_0x014a('0x36')][_0x014a('0x42')]+'%'};return _0x59871d;})});}_0xe1b5ed=_[_0x014a('0x43')]({},_0xe1b5ed,_0x32683c['options']);return _0x1ba571[_0x014a('0x71')](_0xe1b5ed);}})[_0x014a('0x27')](function(_0x53c335){if(_0x53c335){_0x4e5d25=_0x53c335[_0x014a('0x3c')];if(!_0x32683c[_0x014a('0x36')][_0x014a('0x3d')](_0x014a('0x3e'))){_0xe1b5ed[_0x014a('0x20')]=qs[_0x014a('0x20')](_0x32683c[_0x014a('0x36')][_0x014a('0x20')]);_0xe1b5ed['offset']=qs[_0x014a('0x1e')](_0x32683c[_0x014a('0x36')]['offset']);}return _0x1ba571['getAgents'](_0xe1b5ed);}})[_0x014a('0x27')](function(_0x45a093){if(_0x45a093){return _0x45a093?{'count':_0x4e5d25,'rows':_0x45a093}:null;}})['then'](respondWithResult(_0x1810a8,null))[_0x014a('0x48')](handleError(_0x1810a8,null));};exports[_0x014a('0x74')]=function(_0x216b27,_0x5ddb47,_0x3a0012){var _0x2c320f={};var _0x5dedaf={};var _0x5baf80;var _0x105786;return db['VoicePrefix'][_0x014a('0x72')]({'where':{'id':_0x216b27['params']['id']}})[_0x014a('0x27')](handleEntityNotFound(_0x5ddb47,null))[_0x014a('0x27')](function(_0xda07b5){if(_0xda07b5){_0x5baf80=_0xda07b5;_0x5dedaf[_0x014a('0x39')]=_[_0x014a('0x35')](db['Team'][_0x014a('0x31')]);_0x5dedaf[_0x014a('0x36')]=_[_0x014a('0x35')](_0x216b27[_0x014a('0x36')]);_0x5dedaf[_0x014a('0x37')]=_[_0x014a('0x38')](_0x5dedaf[_0x014a('0x39')],_0x5dedaf[_0x014a('0x36')]);_0x2c320f['attributes']=_[_0x014a('0x38')](_0x5dedaf['model'],qs[_0x014a('0x3b')](_0x216b27['query']['fields']));_0x2c320f['attributes']=_0x2c320f['attributes'][_0x014a('0x3c')]?_0x2c320f[_0x014a('0x3a')]:_0x5dedaf[_0x014a('0x39')];_0x2c320f[_0x014a('0x3f')]=qs[_0x014a('0x40')](_0x216b27[_0x014a('0x36')][_0x014a('0x40')]);_0x2c320f[_0x014a('0x41')]=qs['filters'](_['pick'](_0x216b27[_0x014a('0x36')],_0x5dedaf[_0x014a('0x37')]));if(_0x216b27[_0x014a('0x36')][_0x014a('0x42')]){_0x2c320f[_0x014a('0x41')]=_[_0x014a('0x43')](_0x2c320f[_0x014a('0x41')],{'$or':_[_0x014a('0x2f')](_0x2c320f['attributes'],function(_0x27431c){var _0x3cfcc7={};_0x3cfcc7[_0x27431c]={'$like':'%'+_0x216b27[_0x014a('0x36')][_0x014a('0x42')]+'%'};return _0x3cfcc7;})});}_0x2c320f=_[_0x014a('0x43')]({},_0x2c320f,_0x216b27['options']);return _0x5baf80[_0x014a('0x74')](_0x2c320f);}})[_0x014a('0x27')](function(_0x2b9496){if(_0x2b9496){_0x105786=_0x2b9496[_0x014a('0x3c')];if(!_0x216b27[_0x014a('0x36')][_0x014a('0x3d')](_0x014a('0x3e'))){_0x2c320f['limit']=qs[_0x014a('0x20')](_0x216b27['query']['limit']);_0x2c320f[_0x014a('0x1e')]=qs[_0x014a('0x1e')](_0x216b27['query'][_0x014a('0x1e')]);}return _0x5baf80[_0x014a('0x74')](_0x2c320f);}})[_0x014a('0x27')](function(_0x5e116d){if(_0x5e116d){return _0x5e116d?{'count':_0x105786,'rows':_0x5e116d}:null;}})[_0x014a('0x27')](respondWithResult(_0x5ddb47,null))[_0x014a('0x48')](handleError(_0x5ddb47,null));};exports[_0x014a('0x75')]=function(_0x336bcf,_0x2f7969,_0x263212){var _0x13c2b2=_0x336bcf[_0x014a('0x4d')][_0x014a('0x6b')];var _0x58341b;return db['Team'][_0x014a('0x76')]({'where':{'id':_0x13c2b2},'attributes':['id'],'include':[{'model':db[_0x014a('0x77')],'as':_0x014a('0x78'),'attributes':['id','name',_0x014a('0x79'),_0x014a('0x7a'),_0x014a('0x7b')],'raw':!![]}]})[_0x014a('0x27')](function(_0x49997){if(_0x49997){_0x58341b=_0x49997;var _0x2888a0=_['flatMap'](_0x49997,function(_0x1c8cba){var _0x3ab005=_0x1c8cba[_0x014a('0x4e')]({'plain':!![]});return _0x3ab005[_0x014a('0x78')];});return db['VoicePrefix'][_0x014a('0x4a')]({'where':{'id':_0x336bcf[_0x014a('0x49')]['id']}})[_0x014a('0x27')](function(_0x30999a){return db[_0x014a('0x4c')]['transaction'](function(_0xcf0aee){return _0x30999a['addTeams'](_0x13c2b2,{'transaction':_0xcf0aee})['then'](function(){return BPromise[_0x014a('0x7c')](_0x58341b,function(_0x369fbd){return db[_0x014a('0x7d')][_0x014a('0x7e')]({'TeamId':_0x369fbd['id'],'VoicePrefixId':_0x336bcf[_0x014a('0x49')]['id']},{'transaction':_0xcf0aee});});})[_0x014a('0x27')](function(){return BPromise[_0x014a('0x7c')](_0x2888a0,function(_0x3a9352){return db[_0x014a('0x7f')][_0x014a('0x80')]({'where':{'UserId':_0x3a9352['id'],'VoicePrefixId':_0x336bcf[_0x014a('0x49')]['id']},'transaction':_0xcf0aee});});})[_0x014a('0x27')](function(){_0x2888a0[_0x014a('0x81')](function(_0x175c12){socket[_0x014a('0x6d')](_0x014a('0x82'),{'UserId':_0x175c12['id'],'VoicePrefixId':_0x30999a['id']});});});});});}})['then'](respondWithStatusCode(_0x2f7969,null))[_0x014a('0x48')](handleError(_0x2f7969,null));};exports[_0x014a('0x83')]=function(_0x3c03ac,_0x4ab9d6,_0x4495c1){return db[_0x014a('0x84')][_0x014a('0x76')]({'where':{'id':_0x3c03ac[_0x014a('0x36')][_0x014a('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x014a('0x77')],'as':_0x014a('0x78'),'attributes':['id'],'raw':!![]}]})[_0x014a('0x27')](handleEntityNotFound(_0x4ab9d6,null))[_0x014a('0x27')](function(_0x480639){var _0x346734=_[_0x014a('0x2f')](_0x480639,'id');var _0x1b1e6a=[];var _0x11aab3=[];var _0x4f91f1=squel[_0x014a('0x85')]();_0x4f91f1['field']('tq.TeamId')[_0x014a('0x86')]('team_has_voice_prefixes','tq')[_0x014a('0x87')](_0x014a('0x88'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x014a('0x41')]('VoicePrefixId\x20=\x20?',_0x3c03ac[_0x014a('0x49')]['id']);for(var _0x8cc35d=0x0;_0x8cc35d<_0x480639['length'];_0x8cc35d+=0x1){let _0x183bf6=_0x480639[_0x8cc35d];for(var _0x1b1c4e=0x0;_0x1b1c4e<_0x183bf6['Agents'][_0x014a('0x3c')];_0x1b1c4e+=0x1){let _0x3f5c3e=_0x183bf6[_0x014a('0x78')][_0x1b1c4e];var _0x383c07=_0x4f91f1[_0x014a('0x89')]();_0x383c07[_0x014a('0x41')](_0x014a('0x8a'),_0x3f5c3e['id']);_0x11aab3[_0x014a('0x62')](db[_0x014a('0x4c')][_0x014a('0x36')](_0x383c07[_0x014a('0x8b')](),{'type':db[_0x014a('0x4c')]['QueryTypes'][_0x014a('0x8c')]})[_0x014a('0x27')](function(_0x3d8d34){if(_0x3d8d34[_0x014a('0x3c')]===0x1){return _0x3f5c3e['id'];}else{var _0x3cf20e=_[_0x014a('0x8d')](_[_0x014a('0x2f')](_0x3d8d34,_0x014a('0x8e')),function(_0x5a7fd0){return _[_0x014a('0x8f')](_0x346734,_0x5a7fd0);});if(_0x3cf20e){return _0x3f5c3e['id'];}}}));}}return BPromise[_0x014a('0x90')](_0x11aab3)[_0x014a('0x27')](function(_0x29d217){_0x1b1e6a=_(_0x1b1e6a)[_0x014a('0x91')](_0x29d217)[_0x014a('0x92')]()['value']();return db[_0x014a('0x30')][_0x014a('0x4a')]({'where':{'id':_0x3c03ac[_0x014a('0x49')]['id']}})['then'](function(_0x4e6844){return db[_0x014a('0x4c')][_0x014a('0x69')](function(_0x262513){return _0x4e6844[_0x014a('0x83')](_0x3c03ac[_0x014a('0x36')]['ids'],{'transaction':_0x262513})[_0x014a('0x27')](function(){if(!_[_0x014a('0x93')](_0x1b1e6a)){return _0x4e6844[_0x014a('0x6e')](_0x1b1e6a,{'transaction':_0x262513});}})[_0x014a('0x27')](function(){_0x1b1e6a[_0x014a('0x81')](function(_0x87c7e5){socket['emit'](_0x014a('0x70'),{'UserId':_0x87c7e5,'VoicePrefixId':_0x4e6844['id']});});});});});});})['then'](respondWithStatusCode(_0x4ab9d6,null))[_0x014a('0x48')](handleError(_0x4ab9d6,null));}; \ No newline at end of file +var _0x5f2f=['VoicePrefixes','UserProfileResource','error','stack','name','send','map','VoicePrefix','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','describe','create','transaction','body','get','VoiceExtension','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','app','system','description','Voice\x20Prefix\x20Extension','appdata','Voice\x20Prefix','VoiceExtensionId','VoicePrefixId','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','NoOp','No\x20callerid\x20available','goto','context','charAt','prefix','system-','sequelize','findById','addAgents','ids','omit','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','order','hasOwnProperty','getTeams','findOne','Team','addTeams','User','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','select','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x1177d5,_0x22b649){var _0xc3ddc2=function(_0x43ff95){while(--_0x43ff95){_0x1177d5['push'](_0x1177d5['shift']());}};_0xc3ddc2(++_0x22b649);}(_0x5f2f,0x73));var _0xf5f2=function(_0x25cdd2,_0x1150f9){_0x25cdd2=_0x25cdd2-0x0;var _0x1c76ce=_0x5f2f[_0x25cdd2];return _0x1c76ce;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];config[_0xf5f2('0x18')]=_[_0xf5f2('0x19')](config[_0xf5f2('0x18')],{'host':_0xf5f2('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5f2('0x18')]));require(_0xf5f2('0x1b'))[_0xf5f2('0x1c')](socket);function respondWithStatusCode(_0x1c1a5c,_0x422b55){_0x422b55=_0x422b55||0xcc;return function(_0x4d97fc){if(_0x4d97fc){return _0x1c1a5c[_0xf5f2('0x1d')](_0x422b55);}return _0x1c1a5c[_0xf5f2('0x1e')](_0x422b55)[_0xf5f2('0x1f')]();};}function respondWithResult(_0x1b6dd2,_0x23e23a){_0x23e23a=_0x23e23a||0xc8;return function(_0x3a9dbb){if(_0x3a9dbb){return _0x1b6dd2[_0xf5f2('0x1e')](_0x23e23a)[_0xf5f2('0x20')](_0x3a9dbb);}};}function respondWithFilteredResult(_0x11f702,_0x228ace){return function(_0x20fccd){if(_0x20fccd){var _0x28e097=typeof _0x228ace[_0xf5f2('0x21')]===_0xf5f2('0x22')&&typeof _0x228ace[_0xf5f2('0x23')]===_0xf5f2('0x22');var _0x1bf655=_0x20fccd['count'];var _0x34706d=_0x28e097?0x0:_0x228ace[_0xf5f2('0x21')];var _0x49dac2=_0x28e097?_0x20fccd['count']:_0x228ace[_0xf5f2('0x21')]+_0x228ace[_0xf5f2('0x23')];var _0x4ae323;if(_0x49dac2>=_0x1bf655){_0x49dac2=_0x1bf655;_0x4ae323=0xc8;}else{_0x4ae323=0xce;}_0x11f702[_0xf5f2('0x1e')](_0x4ae323);return _0x11f702[_0xf5f2('0x24')](_0xf5f2('0x25'),_0x34706d+'-'+_0x49dac2+'/'+_0x1bf655)[_0xf5f2('0x20')](_0x20fccd);}return null;};}function patchUpdates(_0x36f1cb){return function(_0x4c691a){try{jsonpatch[_0xf5f2('0x26')](_0x4c691a,_0x36f1cb,!![]);}catch(_0x4669a6){return BPromise[_0xf5f2('0x27')](_0x4669a6);}return _0x4c691a[_0xf5f2('0x28')]();};}function saveUpdates(_0x287ad5,_0x5bdf4a){return function(_0x529f07){if(_0x529f07){return _0x529f07[_0xf5f2('0x29')](_0x287ad5)[_0xf5f2('0x2a')](function(_0x13da6f){return _0x13da6f;});}return null;};}function removeEntity(_0x1a5bb3,_0xf6c58d){return function(_0x788a8d){if(_0x788a8d){return _0x788a8d[_0xf5f2('0x2b')]()[_0xf5f2('0x2a')](function(){var _0x294414=_0x788a8d['get']({'plain':!![]});var _0xaa2602=_0xf5f2('0x2c');return db[_0xf5f2('0x2d')][_0xf5f2('0x2b')]({'where':{'type':_0xaa2602,'resourceId':_0x294414['id']}})[_0xf5f2('0x2a')](function(){return _0x788a8d;});})[_0xf5f2('0x2a')](function(){_0x1a5bb3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22c826,_0x14c829){return function(_0x11c771){if(!_0x11c771){_0x22c826['sendStatus'](0x194);}return _0x11c771;};}function handleError(_0x5a2c7e,_0x29571b){_0x29571b=_0x29571b||0x1f4;return function(_0x50b8a2){logger[_0xf5f2('0x2e')](_0x50b8a2[_0xf5f2('0x2f')]);if(_0x50b8a2[_0xf5f2('0x30')]){delete _0x50b8a2['name'];}_0x5a2c7e['status'](_0x29571b)[_0xf5f2('0x31')](_0x50b8a2);};}exports['index']=function(_0xb744b9,_0x58a4df){var _0x45b643={},_0x31087c={},_0x7b6817={'count':0x0,'rows':[]};var _0x428770=_[_0xf5f2('0x32')](db[_0xf5f2('0x33')][_0xf5f2('0x34')],function(_0x2c0e05){return{'name':_0x2c0e05['fieldName'],'type':_0x2c0e05[_0xf5f2('0x35')][_0xf5f2('0x36')]};});_0x31087c[_0xf5f2('0x37')]=_[_0xf5f2('0x32')](_0x428770,_0xf5f2('0x30'));_0x31087c[_0xf5f2('0x38')]=_[_0xf5f2('0x39')](_0xb744b9['query']);_0x31087c[_0xf5f2('0x3a')]=_[_0xf5f2('0x3b')](_0x31087c['model'],_0x31087c[_0xf5f2('0x38')]);_0x45b643['attributes']=_[_0xf5f2('0x3b')](_0x31087c[_0xf5f2('0x37')],qs[_0xf5f2('0x3c')](_0xb744b9[_0xf5f2('0x38')]['fields']));_0x45b643['attributes']=_0x45b643[_0xf5f2('0x3d')][_0xf5f2('0x3e')]?_0x45b643[_0xf5f2('0x3d')]:_0x31087c['model'];if(!_0xb744b9[_0xf5f2('0x38')]['hasOwnProperty'](_0xf5f2('0x3f'))){_0x45b643['limit']=qs[_0xf5f2('0x23')](_0xb744b9[_0xf5f2('0x38')]['limit']);_0x45b643[_0xf5f2('0x21')]=qs[_0xf5f2('0x21')](_0xb744b9[_0xf5f2('0x38')][_0xf5f2('0x21')]);}_0x45b643['order']=qs['sort'](_0xb744b9[_0xf5f2('0x38')][_0xf5f2('0x40')]);_0x45b643[_0xf5f2('0x41')]=qs[_0xf5f2('0x3a')](_[_0xf5f2('0x42')](_0xb744b9[_0xf5f2('0x38')],_0x31087c[_0xf5f2('0x3a')]),_0x428770);if(_0xb744b9['query'][_0xf5f2('0x43')]){_0x45b643[_0xf5f2('0x41')]=_['merge'](_0x45b643[_0xf5f2('0x41')],{'$or':_[_0xf5f2('0x32')](_0x428770,function(_0x71b0e7){if(_0x71b0e7[_0xf5f2('0x35')]!==_0xf5f2('0x44')){var _0x3b6372={};_0x3b6372[_0x71b0e7[_0xf5f2('0x30')]]={'$like':'%'+_0xb744b9[_0xf5f2('0x38')]['filter']+'%'};return _0x3b6372;}})});}_0x45b643=_[_0xf5f2('0x45')]({},_0x45b643,_0xb744b9[_0xf5f2('0x46')]);var _0x17a78e={'where':_0x45b643['where']};return db['VoicePrefix']['count'](_0x17a78e)[_0xf5f2('0x2a')](function(_0x2ad13c){_0x7b6817['count']=_0x2ad13c;if(_0xb744b9[_0xf5f2('0x38')][_0xf5f2('0x47')]){_0x45b643[_0xf5f2('0x48')]=[{'all':!![]}];}return db[_0xf5f2('0x33')][_0xf5f2('0x49')](_0x45b643);})[_0xf5f2('0x2a')](function(_0x1a6ec1){_0x7b6817[_0xf5f2('0x4a')]=_0x1a6ec1;return _0x7b6817;})[_0xf5f2('0x2a')](respondWithFilteredResult(_0x58a4df,_0x45b643))[_0xf5f2('0x4b')](handleError(_0x58a4df,null));};exports[_0xf5f2('0x4c')]=function(_0x4773cd,_0x4252a3){var _0x2fb67e={'raw':![],'where':{'id':_0x4773cd[_0xf5f2('0x4d')]['id']}},_0x4faeed={};_0x4faeed['model']=_[_0xf5f2('0x39')](db[_0xf5f2('0x33')][_0xf5f2('0x34')]);_0x4faeed[_0xf5f2('0x38')]=_[_0xf5f2('0x39')](_0x4773cd[_0xf5f2('0x38')]);_0x4faeed['filters']=_[_0xf5f2('0x3b')](_0x4faeed[_0xf5f2('0x37')],_0x4faeed[_0xf5f2('0x38')]);_0x2fb67e[_0xf5f2('0x3d')]=_[_0xf5f2('0x3b')](_0x4faeed[_0xf5f2('0x37')],qs[_0xf5f2('0x3c')](_0x4773cd[_0xf5f2('0x38')]['fields']));_0x2fb67e[_0xf5f2('0x3d')]=_0x2fb67e[_0xf5f2('0x3d')][_0xf5f2('0x3e')]?_0x2fb67e['attributes']:_0x4faeed[_0xf5f2('0x37')];if(_0x4773cd[_0xf5f2('0x38')][_0xf5f2('0x47')]){_0x2fb67e['include']=[{'all':!![]}];}_0x2fb67e=_['merge']({},_0x2fb67e,_0x4773cd[_0xf5f2('0x46')]);return db[_0xf5f2('0x33')]['find'](_0x2fb67e)[_0xf5f2('0x2a')](handleEntityNotFound(_0x4252a3,null))['then'](respondWithResult(_0x4252a3,null))[_0xf5f2('0x4b')](handleError(_0x4252a3,null));};exports['destroy']=function(_0x2cbd9d,_0x5d9120){return db[_0xf5f2('0x33')][_0xf5f2('0x4e')]({'where':{'id':_0x2cbd9d[_0xf5f2('0x4d')]['id']}})[_0xf5f2('0x2a')](handleEntityNotFound(_0x5d9120,null))['then'](removeEntity(_0x5d9120,null))[_0xf5f2('0x4b')](handleError(_0x5d9120,null));};exports[_0xf5f2('0x4f')]=function(_0x4f6b01,_0x58213b){return db[_0xf5f2('0x33')][_0xf5f2('0x4f')]()['then'](respondWithResult(_0x58213b,null))[_0xf5f2('0x4b')](handleError(_0x58213b,null));};exports[_0xf5f2('0x50')]=function(_0x29c9b6,_0x41b1c7){var _0x5d0db0;return db['sequelize'][_0xf5f2('0x51')](function(_0xa3cc67){return db['VoicePrefix'][_0xf5f2('0x50')](_0x29c9b6[_0xf5f2('0x52')],{'transaction':_0xa3cc67})[_0xf5f2('0x2a')](function(_0x14029e){_0x5d0db0=_0x14029e[_0xf5f2('0x53')]({'plain':!![]});return db[_0xf5f2('0x54')][_0xf5f2('0x4e')]({'where':{'id':_0x5d0db0['VoiceExtensionId']},'raw':!![]})['then'](function(_0x330730){return createVoicePrefixExtensions(_0x5d0db0,_0x330730,_0xa3cc67);});});})[_0xf5f2('0x2a')](function(){var _0x3c349f=_0x29c9b6[_0xf5f2('0x55')][_0xf5f2('0x53')]({'plain':!![]});if(!_0x3c349f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c349f[_0xf5f2('0x56')]===_0xf5f2('0x55')){var _0x18b124=_0x5d0db0;return db['UserProfileSection'][_0xf5f2('0x4e')]({'where':{'name':'VoicePrefixes','userProfileId':_0x3c349f[_0xf5f2('0x57')]},'raw':!![]})[_0xf5f2('0x2a')](function(_0x28cce5){if(_0x28cce5&&_0x28cce5[_0xf5f2('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x18b124[_0xf5f2('0x30')],'resourceId':_0x18b124['id'],'type':_0x28cce5['name'],'sectionId':_0x28cce5['id']},{})[_0xf5f2('0x2a')](function(){return _0x5d0db0;});}else{return _0x5d0db0;}})[_0xf5f2('0x4b')](function(_0x572ec1){logger[_0xf5f2('0x2e')](_0xf5f2('0x59'),_0x572ec1);throw _0x572ec1;});}return _0x5d0db0;})[_0xf5f2('0x2a')](respondWithResult(_0x41b1c7,null))['catch'](handleError(_0x41b1c7,null));};function Extension(_0x397b99,_0xcf7a50,_0x42cc27,_0x4579f4){this['context']=_0xf5f2('0x5a');this['exten']=_0x397b99;this[_0xf5f2('0x5b')]=_0x42cc27;this[_0xf5f2('0x35')]=_0xf5f2('0x5c');this[_0xf5f2('0x5d')]=_0xf5f2('0x5e');this['priority']=_0xcf7a50;this[_0xf5f2('0x5f')]=_0x4579f4;}function createVoicePrefixExtensions(_0xacd80,_0x3461e5,_0x212639){return new BPromise(function(_0x2c5733,_0x5359b5){var _0x31e16b=new Extension(formatPrefixName(_0xacd80['prefix']),0x1,'NoOp',_0xf5f2('0x60'));_0x31e16b['VoicePrefixId']=_0xacd80['id'];return db[_0xf5f2('0x54')][_0xf5f2('0x50')](_0x31e16b,{'transaction':_0x212639})[_0xf5f2('0x2a')](function(_0x123b93){var _0x5767fc=_0x123b93[_0xf5f2('0x53')]({'plain':!![]});var _0x3a53f2=_[_0xf5f2('0x32')](addVoicePrefixExtensions(_0xacd80,_0x3461e5),function(_0x18c41f){_0x18c41f[_0xf5f2('0x61')]=_0x5767fc['id'];_0x18c41f[_0xf5f2('0x62')]=_0xacd80['id'];return _0x18c41f;});return db[_0xf5f2('0x54')]['bulkCreate'](_0x3a53f2,{'transaction':_0x212639})[_0xf5f2('0x2a')](function(_0x2d171d){if(!_0x2d171d){return _0x5359b5(_0xf5f2('0x63'));}else{return _0x2c5733(_0x2d171d);}})[_0xf5f2('0x4b')](function(_0x5a5b2b){return _0x5359b5(_0x5a5b2b);});});;});};function addVoicePrefixExtensions(_0x1de396,_0x4cce08){var _0x410866=[];var _0x1c7f06=formatPrefixName(_0x1de396['prefix']);_0x410866[_0xf5f2('0x64')](new Extension(_0x1c7f06,0x2,_0xf5f2('0x65'),_0xf5f2('0x66')+_0x1de396[_0xf5f2('0x30')]));if(_0x1de396[_0xf5f2('0x67')]){_0x410866['push'](new Extension(_0x1c7f06,0x3,_0xf5f2('0x65'),_0xf5f2('0x68')+_0x1de396[_0xf5f2('0x67')]));}else{_0x410866[_0xf5f2('0x64')](new Extension(_0x1c7f06,0x3,_0xf5f2('0x69'),_0xf5f2('0x6a')));}_0x410866['push'](new Extension(_0x1c7f06,0x4,_0xf5f2('0x6b'),_0x4cce08[_0xf5f2('0x6c')]+','+'${EXTEN:'+(0x8+_0x1de396[_0xf5f2('0x30')][_0xf5f2('0x3e')])+'}'+','+0x1));return _0x410866;}function formatPrefixName(_0x377aad){var _0x51a3c7='_';for(var _0x551cc9=0x0;_0x551cc9<_0x377aad['length'];_0x551cc9++){if(_0x377aad[_0xf5f2('0x6d')](_0x551cc9)=='-'){_0x51a3c7+=_0x377aad[_0xf5f2('0x6d')](_0x551cc9);}else{_0x51a3c7+='['+_0x377aad[_0xf5f2('0x6d')](_0x551cc9)+']';}}_0x51a3c7+='.';return _0x51a3c7;}exports[_0xf5f2('0x29')]=function(_0x55da4d,_0x4d878e,_0x278b76){var _0x3a98b4=_0x55da4d[_0xf5f2('0x52')];_0x3a98b4[_0xf5f2('0x6e')]=_0xf5f2('0x6f')+_0x3a98b4[_0xf5f2('0x30')]+'-';return db[_0xf5f2('0x70')][_0xf5f2('0x51')](function(_0x155f45){return db[_0xf5f2('0x33')][_0xf5f2('0x29')](_0x3a98b4,{'where':{'id':_0x3a98b4['id']},'transaction':_0x155f45})['then'](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x3a98b4['id']},'transaction':_0x155f45})[_0xf5f2('0x2a')](function(){return db[_0xf5f2('0x54')][_0xf5f2('0x4e')]({'where':{'id':_0x3a98b4[_0xf5f2('0x61')]},'raw':!![]})[_0xf5f2('0x2a')](function(_0x5c6959){return createVoicePrefixExtensions(_0x3a98b4,_0x5c6959,_0x155f45);});});});})[_0xf5f2('0x2a')](function(){return db[_0xf5f2('0x33')][_0xf5f2('0x71')](_0x3a98b4['id']);})[_0xf5f2('0x2a')](respondWithResult(_0x4d878e,null))[_0xf5f2('0x4b')](handleError(_0x4d878e,null));};exports['addAgents']=function(_0x2986ed,_0x1409b9,_0x517c15){return db[_0xf5f2('0x33')][_0xf5f2('0x4e')]({'where':{'id':_0x2986ed[_0xf5f2('0x4d')]['id']}})[_0xf5f2('0x2a')](handleEntityNotFound(_0x1409b9,null))['then'](function(_0x40b36e){if(_0x40b36e){return _0x40b36e[_0xf5f2('0x72')](_0x2986ed[_0xf5f2('0x52')][_0xf5f2('0x73')],_[_0xf5f2('0x74')](_0x2986ed['body'],['ids','id'])||{})[_0xf5f2('0x75')](function(_0x30f362){for(var _0x17eb69=0x0;_0x17eb69<_0x2986ed[_0xf5f2('0x52')]['ids']['length'];_0x17eb69+=0x1){socket[_0xf5f2('0x76')]('userVoicePrefix:save',{'UserId':Number(_0x2986ed['body']['ids'][_0x17eb69]),'VoicePrefixId':Number(_0x2986ed['params']['id'])});}return _0x30f362;});}})[_0xf5f2('0x2a')](respondWithResult(_0x1409b9,null))[_0xf5f2('0x4b')](handleError(_0x1409b9,null));};exports[_0xf5f2('0x77')]=function(_0x168092,_0x3de508,_0x9f941e){return db[_0xf5f2('0x33')][_0xf5f2('0x4e')]({'where':{'id':_0x168092[_0xf5f2('0x4d')]['id']}})[_0xf5f2('0x2a')](handleEntityNotFound(_0x3de508,null))[_0xf5f2('0x2a')](function(_0x2afeac){if(_0x2afeac){return _0x2afeac[_0xf5f2('0x77')](_0x168092[_0xf5f2('0x38')][_0xf5f2('0x73')])[_0xf5f2('0x2a')](function(){if(_[_0xf5f2('0x78')](_0x168092[_0xf5f2('0x38')]['ids'])){for(var _0xe7ac8=0x0;_0xe7ac8<_0x168092[_0xf5f2('0x38')][_0xf5f2('0x73')][_0xf5f2('0x3e')];_0xe7ac8+=0x1){socket[_0xf5f2('0x76')](_0xf5f2('0x79'),{'UserId':Number(_0x168092[_0xf5f2('0x38')][_0xf5f2('0x73')][_0xe7ac8]),'VoicePrefixId':Number(_0x168092['params']['id'])});}}else{socket[_0xf5f2('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x168092['query']['ids']),'VoicePrefixId':Number(_0x168092['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3de508,null))['catch'](handleError(_0x3de508,null));};exports[_0xf5f2('0x7a')]=function(_0x18ce86,_0x26a57c,_0x375bc9){var _0x145d4d={};var _0x3cf857={};var _0x5dc63f;var _0x4a0005;return db[_0xf5f2('0x33')]['findOne']({'where':{'id':_0x18ce86[_0xf5f2('0x4d')]['id']}})[_0xf5f2('0x2a')](handleEntityNotFound(_0x26a57c,null))['then'](function(_0x4f3ad4){if(_0x4f3ad4){_0x5dc63f=_0x4f3ad4;_0x3cf857[_0xf5f2('0x37')]=_[_0xf5f2('0x39')](db['User'][_0xf5f2('0x34')]);_0x3cf857[_0xf5f2('0x38')]=_['keys'](_0x18ce86[_0xf5f2('0x38')]);_0x3cf857[_0xf5f2('0x3a')]=_[_0xf5f2('0x3b')](_0x3cf857['model'],_0x3cf857[_0xf5f2('0x38')]);_0x145d4d[_0xf5f2('0x3d')]=_[_0xf5f2('0x3b')](_0x3cf857[_0xf5f2('0x37')],qs[_0xf5f2('0x3c')](_0x18ce86[_0xf5f2('0x38')][_0xf5f2('0x3c')]));_0x145d4d[_0xf5f2('0x3d')]=_0x145d4d[_0xf5f2('0x3d')][_0xf5f2('0x3e')]?_0x145d4d[_0xf5f2('0x3d')]:_0x3cf857[_0xf5f2('0x37')];_0x145d4d[_0xf5f2('0x7b')]=qs[_0xf5f2('0x40')](_0x18ce86[_0xf5f2('0x38')][_0xf5f2('0x40')]);_0x145d4d[_0xf5f2('0x41')]=qs[_0xf5f2('0x3a')](_[_0xf5f2('0x42')](_0x18ce86[_0xf5f2('0x38')],_0x3cf857[_0xf5f2('0x3a')]));if(_0x18ce86['query'][_0xf5f2('0x43')]){_0x145d4d[_0xf5f2('0x41')]=_['merge'](_0x145d4d[_0xf5f2('0x41')],{'$or':_[_0xf5f2('0x32')](_0x145d4d['attributes'],function(_0xb56304){var _0x2f54eb={};_0x2f54eb[_0xb56304]={'$like':'%'+_0x18ce86[_0xf5f2('0x38')]['filter']+'%'};return _0x2f54eb;})});}_0x145d4d=_['merge']({},_0x145d4d,_0x18ce86[_0xf5f2('0x46')]);return _0x5dc63f[_0xf5f2('0x7a')](_0x145d4d);}})[_0xf5f2('0x2a')](function(_0x5ba275){if(_0x5ba275){_0x4a0005=_0x5ba275['length'];if(!_0x18ce86[_0xf5f2('0x38')][_0xf5f2('0x7c')](_0xf5f2('0x3f'))){_0x145d4d['limit']=qs['limit'](_0x18ce86['query']['limit']);_0x145d4d['offset']=qs[_0xf5f2('0x21')](_0x18ce86['query'][_0xf5f2('0x21')]);}return _0x5dc63f[_0xf5f2('0x7a')](_0x145d4d);}})[_0xf5f2('0x2a')](function(_0x43a167){if(_0x43a167){return _0x43a167?{'count':_0x4a0005,'rows':_0x43a167}:null;}})[_0xf5f2('0x2a')](respondWithResult(_0x26a57c,null))[_0xf5f2('0x4b')](handleError(_0x26a57c,null));};exports[_0xf5f2('0x7d')]=function(_0x40e921,_0x3dc051,_0x27ca4a){var _0x1bb4ac={};var _0x36c3c8={};var _0x10c982;var _0x5e69a2;return db[_0xf5f2('0x33')][_0xf5f2('0x7e')]({'where':{'id':_0x40e921['params']['id']}})[_0xf5f2('0x2a')](handleEntityNotFound(_0x3dc051,null))[_0xf5f2('0x2a')](function(_0x537a7d){if(_0x537a7d){_0x10c982=_0x537a7d;_0x36c3c8[_0xf5f2('0x37')]=_[_0xf5f2('0x39')](db[_0xf5f2('0x7f')]['rawAttributes']);_0x36c3c8[_0xf5f2('0x38')]=_[_0xf5f2('0x39')](_0x40e921['query']);_0x36c3c8[_0xf5f2('0x3a')]=_[_0xf5f2('0x3b')](_0x36c3c8[_0xf5f2('0x37')],_0x36c3c8['query']);_0x1bb4ac[_0xf5f2('0x3d')]=_['intersection'](_0x36c3c8[_0xf5f2('0x37')],qs['fields'](_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x3c')]));_0x1bb4ac[_0xf5f2('0x3d')]=_0x1bb4ac[_0xf5f2('0x3d')]['length']?_0x1bb4ac[_0xf5f2('0x3d')]:_0x36c3c8['model'];_0x1bb4ac['order']=qs['sort'](_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x40')]);_0x1bb4ac['where']=qs[_0xf5f2('0x3a')](_[_0xf5f2('0x42')](_0x40e921[_0xf5f2('0x38')],_0x36c3c8[_0xf5f2('0x3a')]));if(_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x43')]){_0x1bb4ac['where']=_[_0xf5f2('0x45')](_0x1bb4ac[_0xf5f2('0x41')],{'$or':_['map'](_0x1bb4ac[_0xf5f2('0x3d')],function(_0x19cbff){var _0x58042c={};_0x58042c[_0x19cbff]={'$like':'%'+_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x43')]+'%'};return _0x58042c;})});}_0x1bb4ac=_[_0xf5f2('0x45')]({},_0x1bb4ac,_0x40e921[_0xf5f2('0x46')]);return _0x10c982[_0xf5f2('0x7d')](_0x1bb4ac);}})[_0xf5f2('0x2a')](function(_0x4df05c){if(_0x4df05c){_0x5e69a2=_0x4df05c[_0xf5f2('0x3e')];if(!_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x7c')](_0xf5f2('0x3f'))){_0x1bb4ac[_0xf5f2('0x23')]=qs[_0xf5f2('0x23')](_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x23')]);_0x1bb4ac[_0xf5f2('0x21')]=qs['offset'](_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x21')]);}return _0x10c982[_0xf5f2('0x7d')](_0x1bb4ac);}})[_0xf5f2('0x2a')](function(_0x35fe1a){if(_0x35fe1a){return _0x35fe1a?{'count':_0x5e69a2,'rows':_0x35fe1a}:null;}})[_0xf5f2('0x2a')](respondWithResult(_0x3dc051,null))[_0xf5f2('0x4b')](handleError(_0x3dc051,null));};exports[_0xf5f2('0x80')]=function(_0x33cfe7,_0x40d0eb,_0x4c138c){var _0x52e419=_0x33cfe7[_0xf5f2('0x52')][_0xf5f2('0x73')];var _0x28eda5;return db[_0xf5f2('0x7f')]['findAll']({'where':{'id':_0x52e419},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x81')],'as':_0xf5f2('0x82'),'attributes':['id',_0xf5f2('0x30'),_0xf5f2('0x83'),_0xf5f2('0x84'),'interface'],'raw':!![]}]})[_0xf5f2('0x2a')](function(_0x18d727){if(_0x18d727){_0x28eda5=_0x18d727;var _0x4bdb72=_[_0xf5f2('0x85')](_0x18d727,function(_0x3ff714){var _0x2563fa=_0x3ff714[_0xf5f2('0x53')]({'plain':!![]});return _0x2563fa['Agents'];});return db[_0xf5f2('0x33')][_0xf5f2('0x4e')]({'where':{'id':_0x33cfe7[_0xf5f2('0x4d')]['id']}})['then'](function(_0x489d4a){return db[_0xf5f2('0x70')][_0xf5f2('0x51')](function(_0x1432ef){return _0x489d4a[_0xf5f2('0x80')](_0x52e419,{'transaction':_0x1432ef})[_0xf5f2('0x2a')](function(){return BPromise[_0xf5f2('0x86')](_0x28eda5,function(_0x58711d){return db[_0xf5f2('0x87')]['upsert']({'TeamId':_0x58711d['id'],'VoicePrefixId':_0x33cfe7[_0xf5f2('0x4d')]['id']},{'transaction':_0x1432ef});});})[_0xf5f2('0x2a')](function(){return BPromise[_0xf5f2('0x86')](_0x4bdb72,function(_0xa74467){return db[_0xf5f2('0x88')][_0xf5f2('0x89')]({'where':{'UserId':_0xa74467['id'],'VoicePrefixId':_0x33cfe7['params']['id']},'transaction':_0x1432ef});});})[_0xf5f2('0x2a')](function(){_0x4bdb72[_0xf5f2('0x8a')](function(_0x457b53){socket[_0xf5f2('0x76')](_0xf5f2('0x8b'),{'UserId':_0x457b53['id'],'VoicePrefixId':_0x489d4a['id']});});});});});}})[_0xf5f2('0x2a')](respondWithStatusCode(_0x40d0eb,null))[_0xf5f2('0x4b')](handleError(_0x40d0eb,null));};exports['removeTeams']=function(_0x1ee541,_0x4a6b83,_0x5857d1){return db['Team'][_0xf5f2('0x49')]({'where':{'id':_0x1ee541[_0xf5f2('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x81')],'as':_0xf5f2('0x82'),'attributes':['id'],'raw':!![]}]})[_0xf5f2('0x2a')](handleEntityNotFound(_0x4a6b83,null))[_0xf5f2('0x2a')](function(_0x4f2704){var _0x3075b4=_[_0xf5f2('0x32')](_0x4f2704,'id');var _0x10ac11=[];var _0x5d3ca7=[];var _0x29f7bd=squel[_0xf5f2('0x8c')]();_0x29f7bd['field'](_0xf5f2('0x8d'))[_0xf5f2('0x8e')](_0xf5f2('0x8f'),'tq')[_0xf5f2('0x90')](_0xf5f2('0x91'),'ut',_0xf5f2('0x92'))[_0xf5f2('0x41')](_0xf5f2('0x93'),_0x1ee541[_0xf5f2('0x4d')]['id']);for(var _0x4782da=0x0;_0x4782da<_0x4f2704[_0xf5f2('0x3e')];_0x4782da+=0x1){let _0x4b6146=_0x4f2704[_0x4782da];for(var _0x299c53=0x0;_0x299c53<_0x4b6146[_0xf5f2('0x82')]['length'];_0x299c53+=0x1){let _0x2275ba=_0x4b6146['Agents'][_0x299c53];var _0x3b2620=_0x29f7bd[_0xf5f2('0x94')]();_0x3b2620[_0xf5f2('0x41')](_0xf5f2('0x95'),_0x2275ba['id']);_0x5d3ca7['push'](db[_0xf5f2('0x70')]['query'](_0x3b2620[_0xf5f2('0x96')](),{'type':db['sequelize'][_0xf5f2('0x97')][_0xf5f2('0x98')]})['then'](function(_0x2bfc53){if(_0x2bfc53[_0xf5f2('0x3e')]===0x1){return _0x2275ba['id'];}else{var _0x16619b=_[_0xf5f2('0x99')](_[_0xf5f2('0x32')](_0x2bfc53,_0xf5f2('0x9a')),function(_0x54c86e){return _['includes'](_0x3075b4,_0x54c86e);});if(_0x16619b){return _0x2275ba['id'];}}}));}}return BPromise[_0xf5f2('0x9b')](_0x5d3ca7)[_0xf5f2('0x2a')](function(_0x5dc5da){_0x10ac11=_(_0x10ac11)[_0xf5f2('0x9c')](_0x5dc5da)[_0xf5f2('0x9d')]()[_0xf5f2('0x9e')]();return db[_0xf5f2('0x33')][_0xf5f2('0x4e')]({'where':{'id':_0x1ee541[_0xf5f2('0x4d')]['id']}})[_0xf5f2('0x2a')](function(_0x4f9e2d){return db[_0xf5f2('0x70')]['transaction'](function(_0x3ea1aa){return _0x4f9e2d['removeTeams'](_0x1ee541[_0xf5f2('0x38')]['ids'],{'transaction':_0x3ea1aa})[_0xf5f2('0x2a')](function(){if(!_['isEmpty'](_0x10ac11)){return _0x4f9e2d['removeAgents'](_0x10ac11,{'transaction':_0x3ea1aa});}})[_0xf5f2('0x2a')](function(){_0x10ac11[_0xf5f2('0x8a')](function(_0x57708f){socket[_0xf5f2('0x76')](_0xf5f2('0x79'),{'UserId':_0x57708f,'VoicePrefixId':_0x4f9e2d['id']});});});});});});})[_0xf5f2('0x2a')](respondWithStatusCode(_0x4a6b83,null))[_0xf5f2('0x4b')](handleError(_0x4a6b83,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 312406e..860b43a 100644 --- a/server/api/voicePrefix/voicePrefix.events.js +++ b/server/api/voicePrefix/voicePrefix.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa95c=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','emit','exports','events'];(function(_0x4f8937,_0x4a31e0){var _0xfe91d7=function(_0x1a1dbf){while(--_0x1a1dbf){_0x4f8937['push'](_0x4f8937['shift']());}};_0xfe91d7(++_0x4a31e0);}(_0xa95c,0x147));var _0xca95=function(_0x3e3f5f,_0x410fc0){_0x3e3f5f=_0x3e3f5f-0x0;var _0x382b1c=_0xa95c[_0x3e3f5f];return _0x382b1c;};'use strict';var EventEmitter=require(_0xca95('0x0'));var VoicePrefix=require(_0xca95('0x1'))['db'][_0xca95('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xca95('0x3')](0x0);var events={'afterCreate':_0xca95('0x4'),'afterUpdate':_0xca95('0x5'),'afterDestroy':'remove'};function emitEvent(_0x27daa1){return function(_0x457ab0,_0x529745,_0x18c999){VoicePrefixEvents[_0xca95('0x6')](_0x27daa1+':'+_0x457ab0['id'],_0x457ab0);VoicePrefixEvents['emit'](_0x27daa1,_0x457ab0);_0x18c999(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xca95('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0xf25b=['VoicePrefix','update','remove','emit','hook','events','../../mysqldb'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xf25b,0xf3));var _0xbf25=function(_0x435891,_0xc53f9e){_0x435891=_0x435891-0x0;var _0x593fa7=_0xf25b[_0x435891];return _0x593fa7;};'use strict';var EventEmitter=require(_0xbf25('0x0'));var VoicePrefix=require(_0xbf25('0x1'))['db'][_0xbf25('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbf25('0x3'),'afterDestroy':_0xbf25('0x4')};function emitEvent(_0x48f56f){return function(_0x3b598b,_0x482727,_0x5294e3){VoicePrefixEvents[_0xbf25('0x5')](_0x48f56f+':'+_0x3b598b['id'],_0x3b598b);VoicePrefixEvents[_0xbf25('0x5')](_0x48f56f,_0x3b598b);_0x5294e3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xbf25('0x6')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 19730fc..3908f54 100644 --- a/server/api/voicePrefix/voicePrefix.model.js +++ b/server/api/voicePrefix/voicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd47=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xfd47,0x9c));var _0x7fd4=function(_0x1574f2,_0x55309b){_0x1574f2=_0x1574f2-0x0;var _0x3faef7=_0xfd47[_0x1574f2];return _0x3faef7;};'use strict';var _=require(_0x7fd4('0x0'));var util=require(_0x7fd4('0x1'));var logger=require(_0x7fd4('0x2'))(_0x7fd4('0x3'));var moment=require(_0x7fd4('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7fd4('0x5'));var rimraf=require(_0x7fd4('0x6'));var config=require(_0x7fd4('0x7'));var attributes=require(_0x7fd4('0x8'));module['exports']=function(_0x3e7aeb,_0x5cadd4){return _0x3e7aeb[_0x7fd4('0x9')](_0x7fd4('0xa'),attributes,{'tableName':_0x7fd4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72d2=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util'];(function(_0x2dd2e0,_0x50c160){var _0x3d6532=function(_0x214b07){while(--_0x214b07){_0x2dd2e0['push'](_0x2dd2e0['shift']());}};_0x3d6532(++_0x50c160);}(_0x72d2,0x8d));var _0x272d=function(_0x110d53,_0x59b52e){_0x110d53=_0x110d53-0x0;var _0x24c192=_0x72d2[_0x110d53];return _0x24c192;};'use strict';var _=require(_0x272d('0x0'));var util=require(_0x272d('0x1'));var logger=require(_0x272d('0x2'))(_0x272d('0x3'));var moment=require(_0x272d('0x4'));var BPromise=require(_0x272d('0x5'));var rp=require(_0x272d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x272d('0x7'));var attributes=require(_0x272d('0x8'));module[_0x272d('0x9')]=function(_0x1ce6dd,_0x3e0629){return _0x1ce6dd[_0x272d('0xa')](_0x272d('0xb'),attributes,{'tableName':_0x272d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index be219b5..06de116 100644 --- a/server/api/voicePrefix/voicePrefix.rpc.js +++ b/server/api/voicePrefix/voicePrefix.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x002d=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x002d,0xca));var _0xd002=function(_0x514a19,_0x2d80de){_0x514a19=_0x514a19-0x0;var _0x326a46=_0x002d[_0x514a19];return _0x326a46;};'use strict';var _=require(_0xd002('0x0'));var util=require(_0xd002('0x1'));var moment=require(_0xd002('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd002('0x3'));var db=require(_0xd002('0x4'))['db'];var utils=require(_0xd002('0x5'));var logger=require(_0xd002('0x6'))(_0xd002('0x7'));var config=require(_0xd002('0x8'));var jayson=require(_0xd002('0x9'));var client=jayson[_0xd002('0xa')][_0xd002('0xb')]({'port':0x232a});config[_0xd002('0xc')]=_[_0xd002('0xd')](config[_0xd002('0xc')],{'host':_0xd002('0xe'),'port':0x18eb});var socket=require(_0xd002('0xf'))(new Redis(config[_0xd002('0xc')]));require(_0xd002('0x10'))[_0xd002('0x11')](socket);function respondWithRpcPromise(_0x4a6621,_0x55d14a,_0x269cfe){return new BPromise(function(_0x3e283b,_0x2be09b){return client['request'](_0x4a6621,_0x269cfe)[_0xd002('0x12')](function(_0x12dad3){logger[_0xd002('0x13')](_0xd002('0x14'),_0x55d14a,_0xd002('0x15'));logger[_0xd002('0x16')](_0xd002('0x17'),_0x55d14a,_0xd002('0x15'),JSON[_0xd002('0x18')](_0x12dad3));if(_0x12dad3[_0xd002('0x19')]){if(_0x12dad3[_0xd002('0x19')][_0xd002('0x1a')]===0x1f4){logger[_0xd002('0x19')](_0xd002('0x14'),_0x55d14a,_0x12dad3['error']['message']);return _0x2be09b(_0x12dad3['error'][_0xd002('0x1b')]);}logger['error'](_0xd002('0x14'),_0x55d14a,_0x12dad3[_0xd002('0x19')][_0xd002('0x1b')]);return _0x3e283b(_0x12dad3[_0xd002('0x19')][_0xd002('0x1b')]);}else{logger[_0xd002('0x13')](_0xd002('0x14'),_0x55d14a,'request\x20sent');_0x3e283b(_0x12dad3[_0xd002('0x1c')][_0xd002('0x1b')]);}})[_0xd002('0x1d')](function(_0x3b1725){logger[_0xd002('0x19')]('VoicePrefix,\x20%s,\x20%s',_0x55d14a,_0x3b1725);_0x2be09b(_0x3b1725);});});} \ No newline at end of file +var _0x1c75=['http','redis','localhost','socket.io-emitter','register','then','info','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','VoicePrefix,\x20%s,\x20%s','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x26aa35,_0x290962){var _0x4d6f6d=function(_0x94bf7a){while(--_0x94bf7a){_0x26aa35['push'](_0x26aa35['shift']());}};_0x4d6f6d(++_0x290962);}(_0x1c75,0xce));var _0x51c7=function(_0x13530a,_0x44630c){_0x13530a=_0x13530a-0x0;var _0x587e70=_0x1c75[_0x13530a];return _0x587e70;};'use strict';var _=require(_0x51c7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x51c7('0x1'));var fs=require('fs');var Redis=require(_0x51c7('0x2'));var db=require(_0x51c7('0x3'))['db'];var utils=require(_0x51c7('0x4'));var logger=require(_0x51c7('0x5'))(_0x51c7('0x6'));var config=require(_0x51c7('0x7'));var jayson=require(_0x51c7('0x8'));var client=jayson[_0x51c7('0x9')][_0x51c7('0xa')]({'port':0x232a});config[_0x51c7('0xb')]=_['defaults'](config[_0x51c7('0xb')],{'host':_0x51c7('0xc'),'port':0x18eb});var socket=require(_0x51c7('0xd'))(new Redis(config[_0x51c7('0xb')]));require('./voicePrefix.socket')[_0x51c7('0xe')](socket);function respondWithRpcPromise(_0x4b02a5,_0x45c45e,_0x5692a7){return new BPromise(function(_0x179902,_0x1830a0){return client['request'](_0x4b02a5,_0x5692a7)[_0x51c7('0xf')](function(_0x115baa){logger[_0x51c7('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x45c45e,'request\x20sent');logger['debug'](_0x51c7('0x11'),_0x45c45e,_0x51c7('0x12'),JSON[_0x51c7('0x13')](_0x115baa));if(_0x115baa['error']){if(_0x115baa[_0x51c7('0x14')]['code']===0x1f4){logger[_0x51c7('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x45c45e,_0x115baa[_0x51c7('0x14')]['message']);return _0x1830a0(_0x115baa[_0x51c7('0x14')][_0x51c7('0x15')]);}logger[_0x51c7('0x14')](_0x51c7('0x16'),_0x45c45e,_0x115baa['error'][_0x51c7('0x15')]);return _0x179902(_0x115baa[_0x51c7('0x14')][_0x51c7('0x15')]);}else{logger[_0x51c7('0x10')](_0x51c7('0x16'),_0x45c45e,_0x51c7('0x12'));_0x179902(_0x115baa['result'][_0x51c7('0x15')]);}})[_0x51c7('0x17')](function(_0x6960a9){logger['error'](_0x51c7('0x16'),_0x45c45e,_0x6960a9);_0x1830a0(_0x6960a9);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 7a87d75..31fc646 100644 --- a/server/api/voicePrefix/voicePrefix.socket.js +++ b/server/api/voicePrefix/voicePrefix.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd3a=['save','remove','update','emit','removeListener','length','./voicePrefix.events'];(function(_0x4a73c,_0xe48f9e){var _0x26c04c=function(_0x461d82){while(--_0x461d82){_0x4a73c['push'](_0x4a73c['shift']());}};_0x26c04c(++_0xe48f9e);}(_0xfd3a,0x179));var _0xafd3=function(_0x219049,_0x5ab804){_0x219049=_0x219049-0x0;var _0x554a80=_0xfd3a[_0x219049];return _0x554a80;};'use strict';var VoicePrefixEvents=require(_0xafd3('0x0'));var events=[_0xafd3('0x1'),_0xafd3('0x2'),_0xafd3('0x3')];function createListener(_0x4ce05e,_0x488608){return function(_0x160b0d){_0x488608[_0xafd3('0x4')](_0x4ce05e,_0x160b0d);};}function removeListener(_0x328118,_0x415217){return function(){VoicePrefixEvents[_0xafd3('0x5')](_0x328118,_0x415217);};}exports['register']=function(_0x9db715){for(var _0x1a72eb=0x0,_0x1f7e16=events[_0xafd3('0x6')];_0x1a72eb<_0x1f7e16;_0x1a72eb++){var _0xd2d780=events[_0x1a72eb];var _0x4c4dcd=createListener('voicePrefix:'+_0xd2d780,_0x9db715);VoicePrefixEvents['on'](_0xd2d780,_0x4c4dcd);}}; \ No newline at end of file +var _0xde13=['remove','update','emit','removeListener','length','voicePrefix:','./voicePrefix.events','save'];(function(_0x50918a,_0x3ba882){var _0x4fe766=function(_0x1f5203){while(--_0x1f5203){_0x50918a['push'](_0x50918a['shift']());}};_0x4fe766(++_0x3ba882);}(_0xde13,0x146));var _0x3de1=function(_0x2dadc5,_0x47e17d){_0x2dadc5=_0x2dadc5-0x0;var _0xa6a9c8=_0xde13[_0x2dadc5];return _0xa6a9c8;};'use strict';var VoicePrefixEvents=require(_0x3de1('0x0'));var events=[_0x3de1('0x1'),_0x3de1('0x2'),_0x3de1('0x3')];function createListener(_0x2dcc03,_0x5c4dbc){return function(_0x1594b3){_0x5c4dbc[_0x3de1('0x4')](_0x2dcc03,_0x1594b3);};}function removeListener(_0x420711,_0x4b5b09){return function(){VoicePrefixEvents[_0x3de1('0x5')](_0x420711,_0x4b5b09);};}exports['register']=function(_0xa7fd83){for(var _0x3d0c57=0x0,_0x3d2169=events[_0x3de1('0x6')];_0x3d0c57<_0x3d2169;_0x3d0c57++){var _0x5f1aff=events[_0x3d0c57];var _0x11df45=createListener(_0x3de1('0x7')+_0x5f1aff,_0xa7fd83);VoicePrefixEvents['on'](_0x5f1aff,_0x11df45);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index b66d53e..f73efef 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x5204f5,_0x3961a2){var _0x4c55ee=function(_0x110143){while(--_0x110143){_0x5204f5['push'](_0x5204f5['shift']());}};_0x4c55ee(++_0x3961a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x360083,_0x272ea6){var _0x36036a=function(_0x3fc427){while(--_0x3fc427){_0x360083['push'](_0x360083['shift']());}};_0x36036a(++_0x272ea6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 0922ca6..758fd99 100644 --- a/server/api/voiceQueue/voiceQueue.attributes.js +++ b/server/api/voiceQueue/voiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc360=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','inbound','outbound','leastrecent','fewestcalls','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','includes','INTEGER','yes','once','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x38d1bf,_0x15c565){var _0x41f861=function(_0x13a2e2){while(--_0x13a2e2){_0x38d1bf['push'](_0x38d1bf['shift']());}};_0x41f861(++_0x15c565);}(_0xc360,0x16e));var _0x0c36=function(_0x291354,_0x1ee76c){_0x291354=_0x291354-0x0;var _0x31da9c=_0xc360[_0x291354];return _0x31da9c;};'use strict';var Sequelize=require(_0x0c36('0x0'));module[_0x0c36('0x1')]={'name':{'type':Sequelize[_0x0c36('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0c36('0x3')](_0x0c36('0x4'),_0x0c36('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x0c36('0x3')]('rr','ringall',_0x0c36('0x6'),_0x0c36('0x7'),'random',_0x0c36('0x8'),_0x0c36('0x9'),_0x0c36('0xa'),_0x0c36('0xb')),'allowNull':![],'defaultValue':_0x0c36('0xc'),'set':function(_0x4bf7cd){this[_0x0c36('0xd')](_0x0c36('0xe'),_0x4bf7cd?_0x4bf7cd:_0x0c36('0x8'));},'get':function(){var _0x4d7fea=this[_0x0c36('0xf')](_0x0c36('0x10'));var _0x223785=this[_0x0c36('0xf')](_0x0c36('0x11'));var _0x2e8ac5=this[_0x0c36('0xf')](_0x0c36('0xe'));if(_0x4d7fea===_0x0c36('0x5')){if(_0x223785==='preview'){return null;}if(_0x223785===_0x0c36('0x12')&&![_0x0c36('0x8'),_0x0c36('0x13')][_0x0c36('0x14')](_0x2e8ac5)){this[_0x0c36('0xd')](_0x0c36('0xe'),_0x0c36('0x8'));}}return _0x2e8ac5;}},'servicelevel':{'type':Sequelize[_0x0c36('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0c36('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0c36('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x0c36('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0c36('0x2')]},'weight':{'type':Sequelize[_0x0c36('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0c36('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0c36('0x3')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x0c36('0x3')](_0x0c36('0x16'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0c36('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x0c36('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0c36('0x3')](_0x0c36('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0c36('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0c36('0x3')](_0x0c36('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0c36('0x3')](_0x0c36('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x0c36('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0c36('0x3')](_0x0c36('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0c36('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x0c36('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0c36('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0c36('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0c36('0x3')](_0x0c36('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x0c36('0x3')](_0x0c36('0x16'),'no'),'defaultValue':_0x0c36('0x16')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x0c36('0x16'),'no',_0x0c36('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0c36('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0c36('0x3')](_0x0c36('0x16'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0c36('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x0c36('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x0c36('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0c36('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x0c36('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0c36('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0c36('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0c36('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x0c36('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x0c36('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x408702){this[_0x0c36('0xd')](_0x0c36('0x18'),_0x408702?_0x408702[_0x0c36('0x19')](','):[]);},'get':function(){return this['getDataValue'](_0x0c36('0x18'))?this[_0x0c36('0xf')](_0x0c36('0x18'))['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':'yes','set':function(_0x3fc9f1){this[_0x0c36('0xd')](_0x0c36('0x1a'),_0x3fc9f1?_0x3fc9f1[_0x0c36('0x19')](','):undefined);},'get':function(){return this[_0x0c36('0xf')](_0x0c36('0x1a'))?this[_0x0c36('0xf')](_0x0c36('0x1a'))[_0x0c36('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x8912f){this['setDataValue'](_0x0c36('0x1c'),_0x8912f?_0x8912f[_0x0c36('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0c36('0x1c'))?this[_0x0c36('0xf')](_0x0c36('0x1c'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0c36('0x3')](_0x0c36('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0c36('0x3')](_0x0c36('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0c36('0x2')]},'description':{'type':Sequelize[_0x0c36('0x2')]},'acw':{'type':Sequelize[_0x0c36('0x1d')],'defaultValue':0x0,'set':function(_0x34baf2){this[_0x0c36('0xd')](_0x0c36('0x1e'),_0x34baf2);if(_0x34baf2){if(this[_0x0c36('0xf')]('wrapuptime')<0x2){this['setDataValue'](_0x0c36('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x0c36('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0c36('0x1d')],'defaultValue':0x0,'comment':_0x0c36('0x20')},'dialMethod':{'type':Sequelize[_0x0c36('0x3')]('preview',_0x0c36('0x21'),_0x0c36('0x22'),'predictive',_0x0c36('0x12')),'defaultValue':_0x0c36('0x21'),'comment':_0x0c36('0x23')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0c36('0x24')},'dialLimitQueue':{'type':Sequelize[_0x0c36('0x15')](0x4)[_0x0c36('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0c36('0x26')},'dialPowerLevel':{'type':Sequelize[_0x0c36('0x27')](0x2)[_0x0c36('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0c36('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x0c36('0x3')](_0x0c36('0x29'),'dropRate'),'defaultValue':'dropRate','comment':_0x0c36('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0c36('0x27')](0x2)[_0x0c36('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0c36('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x0c36('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0c36('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0c36('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x0c36('0x15')](0x3)[_0x0c36('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c36('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x0c36('0x2')],'defaultValue':_0x0c36('0x2e'),'comment':_0x0c36('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x0c36('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c36('0x30')},'dialQueueProject':{'type':Sequelize[_0x0c36('0x2')],'comment':_0x0c36('0x31')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0c36('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c36('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0c36('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c36('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x0c36('0x15')](0x3)[_0x0c36('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c36('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0c36('0x15')](0x5)[_0x0c36('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c36('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0c36('0x15')](0x3)[_0x0c36('0x25')],'defaultValue':0x3,'comment':_0x0c36('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0c36('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0c36('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0c36('0x2')],'defaultValue':_0x0c36('0x37')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x0c36('0x3')]('always',_0x0c36('0x38'),'onlyIfOpen'),'defaultValue':_0x0c36('0x39')},'dialAMDActive':{'type':Sequelize[_0x0c36('0x1d')],'defaultValue':0x0,'comment':_0x0c36('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x0c36('0x15')](0x9)[_0x0c36('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0c36('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x0c36('0x15')](0x9)[_0x0c36('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0c36('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0c36('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0c36('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0c36('0x15')](0x9)[_0x0c36('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0c36('0x3e')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0c36('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0c36('0x15')](0x9)[_0x0c36('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x0c36('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0c36('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0c36('0x15')](0x5)[_0x0c36('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0c36('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0c36('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0c36('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x0c36('0x15')](0x5)[_0x0c36('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0c36('0x42')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0c36('0x43')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0c36('0x3')](_0x0c36('0x44'),_0x0c36('0x45')),'defaultValue':_0x0c36('0x44')},'dialQueueProject2':{'type':Sequelize[_0x0c36('0x2')],'comment':_0x0c36('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0c36('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0c36('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0c36('0x15')](0x3)[_0x0c36('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0c36('0x46')},'dialCutDigit':{'type':Sequelize[_0x0c36('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0c36('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0c36('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c36('0x48')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c36('0x49')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0c36('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c36('0x4a')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0c36('0x15')](0x3)[_0x0c36('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c36('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0c36('0x15')](0x5)[_0x0c36('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c36('0x4c')},'dialMachineMaxRetry':{'type':Sequelize[_0x0c36('0x15')](0x3)[_0x0c36('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c36('0x4d')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0c36('0x15')](0x5)[_0x0c36('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c36('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0c36('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0c36('0x15')](0x5)[_0x0c36('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c36('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0c36('0x15')],'allowNull':!![],'comment':_0x0c36('0x50')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0c36('0x51'),'set':function(_0x4cd8d5){if(!_0x4cd8d5)this[_0x0c36('0xd')](_0x0c36('0x52'),null);this[_0x0c36('0xd')](_0x0c36('0x53'),_0x4cd8d5);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x0c36('0x15')](0x3)[_0x0c36('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x0c36('0x15')](0x3)[_0x0c36('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x0c36('0x1d')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x0c36('0x15')](0x3)[_0x0c36('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x0c36('0x1d')],'defaultValue':![]}}; \ No newline at end of file +var _0x1dac=['sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','wrandom','rrordered','setDataValue','strategy','rrmemory','dialMethod','preview','booked','roundrobin','includes','INTEGER','yes','all','once','periodic_announce','getDataValue','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','predictive','Dial\x20Method.','FLOAT','UNSIGNED','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x552c1e,_0x2159ea){var _0x1cd5b3=function(_0x41d70d){while(--_0x41d70d){_0x552c1e['push'](_0x552c1e['shift']());}};_0x1cd5b3(++_0x2159ea);}(_0x1dac,0xf9));var _0xc1da=function(_0x4fbe76,_0x1b7645){_0x4fbe76=_0x4fbe76-0x0;var _0x72a29b=_0x1dac[_0x4fbe76];return _0x72a29b;};'use strict';var Sequelize=require(_0xc1da('0x0'));module[_0xc1da('0x1')]={'name':{'type':Sequelize[_0xc1da('0x2')],'allowNull':![],'unique':_0xc1da('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xc1da('0x4')](_0xc1da('0x5'),_0xc1da('0x6')),'allowNull':![],'defaultValue':_0xc1da('0x5')},'musiconhold':{'type':Sequelize[_0xc1da('0x2')],'defaultValue':_0xc1da('0x7')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0xc1da('0x4')]('rr',_0xc1da('0x8'),_0xc1da('0x9'),_0xc1da('0xa'),_0xc1da('0xb'),'rrmemory','linear',_0xc1da('0xc'),_0xc1da('0xd')),'allowNull':![],'defaultValue':'ringall','set':function(_0x391bf0){this[_0xc1da('0xe')](_0xc1da('0xf'),_0x391bf0?_0x391bf0:_0xc1da('0x10'));},'get':function(){var _0x231b82=this['getDataValue']('type');var _0x38fbdd=this['getDataValue'](_0xc1da('0x11'));var _0x5d07c7=this['getDataValue'](_0xc1da('0xf'));if(_0x231b82===_0xc1da('0x6')){if(_0x38fbdd===_0xc1da('0x12')){return null;}if(_0x38fbdd===_0xc1da('0x13')&&![_0xc1da('0x10'),_0xc1da('0x14')][_0xc1da('0x15')](_0x5d07c7)){this[_0xc1da('0xe')](_0xc1da('0xf'),'rrmemory');}}return _0x5d07c7;}},'servicelevel':{'type':Sequelize[_0xc1da('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xc1da('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xc1da('0x16')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xc1da('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xc1da('0x2')]},'weight':{'type':Sequelize[_0xc1da('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xc1da('0x4')](_0xc1da('0x17'),'no'),'defaultValue':_0xc1da('0x17')},'autopause':{'type':Sequelize[_0xc1da('0x4')](_0xc1da('0x17'),'no',_0xc1da('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xc1da('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0xc1da('0x4')](_0xc1da('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xc1da('0x4')](_0xc1da('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xc1da('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xc1da('0x4')](_0xc1da('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xc1da('0x4')](_0xc1da('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xc1da('0x4')](_0xc1da('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xc1da('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xc1da('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xc1da('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xc1da('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xc1da('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xc1da('0x4')](_0xc1da('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xc1da('0x17'),'no'),'defaultValue':_0xc1da('0x17')},'announce_holdtime':{'type':Sequelize[_0xc1da('0x4')]('yes','no',_0xc1da('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xc1da('0x4')](_0xc1da('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xc1da('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xc1da('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xc1da('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xc1da('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xc1da('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xc1da('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xc1da('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xc1da('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xc1da('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xc1da('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x61dbd6){this[_0xc1da('0xe')](_0xc1da('0x1a'),_0x61dbd6?_0x61dbd6['join'](','):[]);},'get':function(){return this[_0xc1da('0x1b')](_0xc1da('0x1a'))?this['getDataValue'](_0xc1da('0x1a'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xc1da('0x2')],'defaultValue':_0xc1da('0x17'),'set':function(_0x81a382){this[_0xc1da('0xe')]('joinempty',_0x81a382?_0x81a382[_0xc1da('0x1c')](','):undefined);},'get':function(){return this[_0xc1da('0x1b')](_0xc1da('0x1d'))?this['getDataValue'](_0xc1da('0x1d'))[_0xc1da('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xc1da('0x2')],'defaultValue':'no','set':function(_0x2af4e1){this[_0xc1da('0xe')]('leavewhenempty',_0x2af4e1?_0x2af4e1['join'](','):undefined);},'get':function(){return this[_0xc1da('0x1b')](_0xc1da('0x1f'))?this[_0xc1da('0x1b')](_0xc1da('0x1f'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xc1da('0x4')](_0xc1da('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xc1da('0x4')](_0xc1da('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xc1da('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc1da('0x2')]},'acw':{'type':Sequelize[_0xc1da('0x20')],'defaultValue':0x0,'set':function(_0x4d9e96){this['setDataValue'](_0xc1da('0x21'),_0x4d9e96);if(_0x4d9e96){if(this['getDataValue'](_0xc1da('0x22'))<0x2){this[_0xc1da('0xe')](_0xc1da('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xc1da('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xc1da('0x20')],'defaultValue':0x0,'comment':_0xc1da('0x23')},'dialMethod':{'type':Sequelize['ENUM']('preview',_0xc1da('0x24'),_0xc1da('0x25'),_0xc1da('0x26'),'booked'),'defaultValue':_0xc1da('0x24'),'comment':_0xc1da('0x27')},'dialLimitChannel':{'type':Sequelize[_0xc1da('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xc1da('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0xc1da('0x28')](0x2)[_0xc1da('0x29')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xc1da('0x4')](_0xc1da('0x2a'),_0xc1da('0x2b')),'defaultValue':'dropRate','comment':_0xc1da('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xc1da('0x28')](0x2)[_0xc1da('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xc1da('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc1da('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xc1da('0x16')](0x3)[_0xc1da('0x29')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc1da('0x2d')},'dialQueueOptions':{'type':Sequelize[_0xc1da('0x2')],'defaultValue':_0xc1da('0x2e'),'comment':_0xc1da('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0xc1da('0x16')](0x3)[_0xc1da('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc1da('0x30')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xc1da('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc1da('0x16')](0x3)[_0xc1da('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc1da('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc1da('0x16')](0x5)[_0xc1da('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc1da('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0xc1da('0x16')](0x3)[_0xc1da('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc1da('0x34')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc1da('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc1da('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc1da('0x29')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc1da('0x16')](0x5)[_0xc1da('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc1da('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc1da('0x16')](0x3)[_0xc1da('0x29')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc1da('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xc1da('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0xc1da('0x37'),_0xc1da('0x38')),'defaultValue':_0xc1da('0x39')},'dialAMDActive':{'type':Sequelize[_0xc1da('0x20')],'defaultValue':0x0,'comment':_0xc1da('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0xc1da('0x16')](0x9)[_0xc1da('0x29')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc1da('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0xc1da('0x16')](0x9)[_0xc1da('0x29')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc1da('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc1da('0x16')](0x9)[_0xc1da('0x29')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc1da('0x16')](0x9)[_0xc1da('0x29')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc1da('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0xc1da('0x16')](0x9)[_0xc1da('0x29')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc1da('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc1da('0x29')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc1da('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc1da('0x16')](0x9)[_0xc1da('0x29')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc1da('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc1da('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc1da('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xc1da('0x29')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc1da('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0xc1da('0x16')](0x5)[_0xc1da('0x29')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xc1da('0x43')},'dialRecallInQueue':{'type':Sequelize[_0xc1da('0x20')],'defaultValue':0x0,'comment':_0xc1da('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc1da('0x4')](_0xc1da('0x45'),'ASC'),'defaultValue':_0xc1da('0x45')},'dialQueueProject2':{'type':Sequelize[_0xc1da('0x2')],'comment':_0xc1da('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc1da('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xc1da('0x16')](0x3)[_0xc1da('0x29')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc1da('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc1da('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc1da('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc1da('0x16')](0x5)[_0xc1da('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc1da('0x48')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc1da('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc1da('0x49')},'dialDropRetryFrequency':{'type':Sequelize[_0xc1da('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc1da('0x4a')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc1da('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc1da('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc1da('0x16')](0x5)[_0xc1da('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc1da('0x4c')},'dialMachineMaxRetry':{'type':Sequelize[_0xc1da('0x16')](0x3)[_0xc1da('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xc1da('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc1da('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc1da('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc1da('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc1da('0x16')],'allowNull':!![],'comment':_0xc1da('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0xc1da('0x20')],'defaultValue':![],'comment':_0xc1da('0x50'),'set':function(_0x12a73c){if(!_0x12a73c)this[_0xc1da('0xe')](_0xc1da('0x51'),null);this['setDataValue'](_0xc1da('0x52'),_0x12a73c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xc1da('0x16')](0x3)[_0xc1da('0x29')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xc1da('0x16')](0x3)[_0xc1da('0x29')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xc1da('0x20')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0xc1da('0x29')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xc1da('0x20')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 7c1f207..7c2665a 100644 --- a/server/api/voiceQueue/voiceQueue.controller.js +++ b/server/api/voiceQueue/voiceQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['VoiceQueues','inbound','filter','ignore','map','value','includes','type','name','UserProfileResource','error','send','index','VoiceQueue','rawAttributes','fieldName','key','getOptions','where','count','include','query','rows','catch','params','keys','filters','intersection','attributes','model','fields','length','includeAll','merge','find','create','body','user','get','role','QueueCampaigns','outbound','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','getHoppers','CmHopper','nolimit','order','sort','pick','VoiceQueueId','findAll','getHopperHistories','findOne','CmHopperHistory','hasOwnProperty','getHopperFinals','CmHopperFinal','options','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','online','voicePause','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','userVoiceQueue:save','removeTeams','ids','User','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','addAgents','spread','emit','push','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','ContactId','phone','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId','scheduledAt','cm_hopper_additional_phones','CmHopperId','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','util','lodash','squel','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','undefined','limit','offset','Content-Range','update','then','destroy'];(function(_0x2e3545,_0x20a6ec){var _0xcf18f=function(_0x3c85dd){while(--_0x3c85dd){_0x2e3545['push'](_0x2e3545['shift']());}};_0xcf18f(++_0x20a6ec);}(_0x1cb9,0x14e));var _0x91cb=function(_0x27f59f,_0x2882fa){_0x27f59f=_0x27f59f-0x0;var _0x7cadd1=_0x1cb9[_0x27f59f];return _0x7cadd1;};'use strict';var moment=require(_0x91cb('0x0'));var BPromise=require('bluebird');var util=require(_0x91cb('0x1'));var _=require(_0x91cb('0x2'));var squel=require(_0x91cb('0x3'));var Redis=require(_0x91cb('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x91cb('0x5'))(_0x91cb('0x6'));var config=require('../../config/environment');var db=require(_0x91cb('0x7'))['db'];config[_0x91cb('0x8')]=_[_0x91cb('0x9')](config[_0x91cb('0x8')],{'host':_0x91cb('0xa'),'port':0x18eb});var socket=require(_0x91cb('0xb'))(new Redis(config['redis']));require(_0x91cb('0xc'))['register'](socket);function respondWithStatusCode(_0x2fdfce,_0x4cf9ed){_0x4cf9ed=_0x4cf9ed||0xcc;return function(_0xa43e7a){if(_0xa43e7a){return _0x2fdfce[_0x91cb('0xd')](_0x4cf9ed);}return _0x2fdfce[_0x91cb('0xe')](_0x4cf9ed)[_0x91cb('0xf')]();};}function respondWithResult(_0x429928,_0x23ba9a){_0x23ba9a=_0x23ba9a||0xc8;return function(_0x21a0a5){if(_0x21a0a5){return _0x429928[_0x91cb('0xe')](_0x23ba9a)[_0x91cb('0x10')](_0x21a0a5);}};}function respondWithFilteredResult(_0x8c0097,_0x530d92){return function(_0x3c1f56){if(_0x3c1f56){var _0x366f09=typeof _0x530d92['offset']===_0x91cb('0x11')&&typeof _0x530d92[_0x91cb('0x12')]===_0x91cb('0x11');var _0x2c7d40=_0x3c1f56['count'];var _0x4cc6ef=_0x366f09?0x0:_0x530d92[_0x91cb('0x13')];var _0x3d22b7=_0x366f09?_0x3c1f56['count']:_0x530d92['offset']+_0x530d92[_0x91cb('0x12')];var _0xc3629e;if(_0x3d22b7>=_0x2c7d40){_0x3d22b7=_0x2c7d40;_0xc3629e=0xc8;}else{_0xc3629e=0xce;}_0x8c0097[_0x91cb('0xe')](_0xc3629e);return _0x8c0097['set'](_0x91cb('0x14'),_0x4cc6ef+'-'+_0x3d22b7+'/'+_0x2c7d40)[_0x91cb('0x10')](_0x3c1f56);}return null;};}function saveUpdates(_0x4f1554){return function(_0xc594e3){if(_0xc594e3){return _0xc594e3[_0x91cb('0x15')](_0x4f1554)[_0x91cb('0x16')](function(_0xcd1a78){return _0xcd1a78;});}return null;};}function removeEntity(_0x5cc1c3){return function(_0x3fba4f){if(_0x3fba4f){return _0x3fba4f[_0x91cb('0x17')]()['then'](function(){var _0x123847=_0x3fba4f['get']({'plain':!![]});var _0x55042a=[{'name':_0x91cb('0x18'),'value':_0x91cb('0x19'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x5b385a=_(_0x55042a)[_0x91cb('0x1a')](_0x91cb('0x1b'))[_0x91cb('0x1c')](_0x91cb('0x1d'))['value']();if(_[_0x91cb('0x1e')](_0x5b385a,_0x123847[_0x91cb('0x1f')])){return;}var _0x1fa837=_['find'](_0x55042a,[_0x91cb('0x1d'),_0x123847[_0x91cb('0x1f')]])[_0x91cb('0x20')];return db[_0x91cb('0x21')][_0x91cb('0x17')]({'where':{'type':_0x1fa837,'resourceId':_0x123847['id']}})[_0x91cb('0x16')](function(){return _0x3fba4f;});})[_0x91cb('0x16')](function(){_0x5cc1c3[_0x91cb('0xe')](0xcc)[_0x91cb('0xf')]();});}};}function handleEntityNotFound(_0x4c8438){return function(_0x59bf3a){if(!_0x59bf3a){_0x4c8438[_0x91cb('0xd')](0x194);}return _0x59bf3a;};}function handleError(_0x554350,_0x1c67d2){_0x1c67d2=_0x1c67d2||0x1f4;return function(_0x34d372){logger[_0x91cb('0x22')](_0x34d372['stack']);if(_0x34d372[_0x91cb('0x20')]){delete _0x34d372['name'];}_0x554350[_0x91cb('0xe')](_0x1c67d2)[_0x91cb('0x23')](_0x34d372);};}exports[_0x91cb('0x24')]=function(_0x2fb473,_0x468908){var _0x504275={};var _0x2f04a3={'count':0x0,'rows':[]};var _0x52670a=_[_0x91cb('0x1c')](db[_0x91cb('0x25')][_0x91cb('0x26')],function(_0x4944bd){return{'name':_0x4944bd[_0x91cb('0x27')],'type':_0x4944bd[_0x91cb('0x1f')][_0x91cb('0x28')]};});_0x504275=qs[_0x91cb('0x29')](_0x52670a,_0x2fb473);var _0xf296bc={'where':_0x504275[_0x91cb('0x2a')]};return db[_0x91cb('0x25')][_0x91cb('0x2b')](_0xf296bc)[_0x91cb('0x16')](function(_0x5e6ed3){_0x2f04a3[_0x91cb('0x2b')]=_0x5e6ed3;_0x504275[_0x91cb('0x2c')]=qs[_0x91cb('0x2c')](_0x2fb473[_0x91cb('0x2d')]);return db[_0x91cb('0x25')]['findAll'](_0x504275);})[_0x91cb('0x16')](function(_0x74b443){_0x2f04a3[_0x91cb('0x2e')]=_0x74b443;return _0x2f04a3;})[_0x91cb('0x16')](respondWithFilteredResult(_0x468908,_0x504275))[_0x91cb('0x2f')](handleError(_0x468908,null));};exports['show']=function(_0x121c37,_0x5927cb){var _0x47fc17={'raw':![],'where':{'id':_0x121c37[_0x91cb('0x30')]['id']}},_0x479968={};_0x479968['model']=_[_0x91cb('0x31')](db['VoiceQueue']['rawAttributes']);_0x479968[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x121c37[_0x91cb('0x2d')]);_0x479968[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x479968['model'],_0x479968[_0x91cb('0x2d')]);_0x47fc17[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x479968[_0x91cb('0x35')],qs['fields'](_0x121c37['query'][_0x91cb('0x36')]));_0x47fc17[_0x91cb('0x34')]=_0x47fc17['attributes'][_0x91cb('0x37')]?_0x47fc17[_0x91cb('0x34')]:_0x479968['model'];if(_0x121c37[_0x91cb('0x2d')][_0x91cb('0x38')]){_0x47fc17['include']=[{'all':!![]}];}_0x47fc17=_[_0x91cb('0x39')]({},_0x47fc17,_0x121c37['options']);return db[_0x91cb('0x25')][_0x91cb('0x3a')](_0x47fc17)[_0x91cb('0x16')](handleEntityNotFound(_0x5927cb,null))[_0x91cb('0x16')](respondWithResult(_0x5927cb,null))[_0x91cb('0x2f')](handleError(_0x5927cb,null));};exports[_0x91cb('0x3b')]=function(_0x5d0e37,_0xa90111){return db[_0x91cb('0x25')]['create'](_0x5d0e37[_0x91cb('0x3c')],{})['then'](function(_0x2c6102){var _0x2eac87=_0x5d0e37[_0x91cb('0x3d')][_0x91cb('0x3e')]({'plain':!![]});if(!_0x2eac87)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2eac87[_0x91cb('0x3f')]===_0x91cb('0x3d')){var _0x2cf27e=_0x2c6102[_0x91cb('0x3e')]({'plain':!![]});var _0x42a7f3=[{'name':_0x91cb('0x18'),'value':_0x91cb('0x19')},{'name':_0x91cb('0x40'),'value':_0x91cb('0x41')}];var _0x3cc4c1=_['find'](_0x42a7f3,[_0x91cb('0x1d'),_0x2cf27e['type']])[_0x91cb('0x20')];return db['UserProfileSection'][_0x91cb('0x3a')]({'where':{'name':_0x3cc4c1,'userProfileId':_0x2eac87['userProfileId']},'raw':!![]})[_0x91cb('0x16')](function(_0x477131){if(_0x477131&&_0x477131[_0x91cb('0x42')]===0x0){return db[_0x91cb('0x21')]['create']({'name':_0x2cf27e[_0x91cb('0x20')],'resourceId':_0x2cf27e['id'],'type':_0x477131[_0x91cb('0x20')],'sectionId':_0x477131['id']},{})['then'](function(){return _0x2c6102;});}else{return _0x2c6102;}})[_0x91cb('0x2f')](function(_0x2f1749){logger[_0x91cb('0x22')](_0x91cb('0x43'),_0x2f1749);throw _0x2f1749;});}return _0x2c6102;})[_0x91cb('0x16')](respondWithResult(_0xa90111,0xc9))[_0x91cb('0x2f')](handleError(_0xa90111,null));};exports[_0x91cb('0x44')]=function(_0x29d5a1,_0x396b81){var _0x4b26f6={'where':{'id':_0x29d5a1[_0x91cb('0x30')]['id']}},_0x7c22b3={};_0x7c22b3[_0x91cb('0x35')]=_[_0x91cb('0x31')](db[_0x91cb('0x25')][_0x91cb('0x26')]);_0x4b26f6[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x7c22b3['model'],qs[_0x91cb('0x36')](_0x29d5a1[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x4b26f6[_0x91cb('0x34')]=_0x4b26f6['attributes'][_0x91cb('0x37')]?_0x4b26f6[_0x91cb('0x34')]:_0x7c22b3['model'];if(_0x29d5a1[_0x91cb('0x2d')]['includeAll']){_0x4b26f6[_0x91cb('0x2c')]=[{'all':!![]}];}_0x4b26f6=_['merge']({},_0x4b26f6,_0x29d5a1['options']);return db['VoiceQueue'][_0x91cb('0x3a')](_0x4b26f6)[_0x91cb('0x16')](handleEntityNotFound(_0x396b81,null))[_0x91cb('0x16')](function(_0x2f8384){if(_0x2f8384){var _0x333814=_0x2f8384['get']({'plain':!![]});_0x333814=qs['omit'](_0x333814,['id',_0x91cb('0x45'),_0x91cb('0x46')]);_0x29d5a1[_0x91cb('0x3c')]=_[_0x91cb('0x47')](_0x29d5a1['body'],['id','createdAt','updatedAt']);return db[_0x91cb('0x25')]['create'](_[_0x91cb('0x39')](_0x333814,_0x29d5a1['body']),{'include':_0x29d5a1[_0x91cb('0x2d')][_0x91cb('0x38')]?[{'all':!![]}]:undefined})[_0x91cb('0x16')](function(_0x649976){var _0x1884bc=_0x29d5a1[_0x91cb('0x3d')][_0x91cb('0x3e')]({'plain':!![]});if(!_0x1884bc)throw new Error(_0x91cb('0x48'));if(_0x1884bc[_0x91cb('0x3f')]===_0x91cb('0x3d')){var _0xd8f7c2=_0x649976['get']({'plain':!![]});var _0x1e445a=[{'name':_0x91cb('0x18'),'value':'inbound'},{'name':_0x91cb('0x40'),'value':_0x91cb('0x41')}];var _0x4bab7d=_[_0x91cb('0x3a')](_0x1e445a,[_0x91cb('0x1d'),_0xd8f7c2[_0x91cb('0x1f')]])[_0x91cb('0x20')];return db[_0x91cb('0x49')][_0x91cb('0x3a')]({'where':{'name':_0x4bab7d,'userProfileId':_0x1884bc[_0x91cb('0x4a')]},'raw':!![]})[_0x91cb('0x16')](function(_0x3320bd){if(_0x3320bd&&_0x3320bd[_0x91cb('0x42')]===0x0){return db[_0x91cb('0x21')]['create']({'name':_0xd8f7c2[_0x91cb('0x20')],'resourceId':_0xd8f7c2['id'],'type':_0x3320bd['name'],'sectionId':_0x3320bd['id']},{})[_0x91cb('0x16')](function(){return _0x649976;});}else{return _0x649976;}})['catch'](function(_0x3dfff9){logger[_0x91cb('0x22')](_0x91cb('0x43'),_0x3dfff9);throw _0x3dfff9;});}return _0x649976;});}})['then'](respondWithResult(_0x396b81,0xc9))[_0x91cb('0x2f')](handleError(_0x396b81,null));};exports[_0x91cb('0x15')]=function(_0x48dcf7,_0xef4754){if(_0x48dcf7[_0x91cb('0x3c')]['id']){delete _0x48dcf7[_0x91cb('0x3c')]['id'];}return db[_0x91cb('0x25')]['find']({'where':{'id':_0x48dcf7[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0xef4754,null))[_0x91cb('0x16')](saveUpdates(_0x48dcf7[_0x91cb('0x3c')],null))['then'](respondWithResult(_0xef4754,null))[_0x91cb('0x2f')](handleError(_0xef4754,null));};exports[_0x91cb('0x17')]=function(_0x5c2c01,_0x492b09){return db[_0x91cb('0x25')]['find']({'where':{'id':_0x5c2c01[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x492b09,null))['then'](removeEntity(_0x492b09,null))['catch'](handleError(_0x492b09,null));};exports[_0x91cb('0x4b')]=function(_0x5c468a,_0x1b69ce){var _0x961ebf={'raw':![],'where':{}};var _0x33de58={};var _0x551836={'count':0x0,'rows':[]};return db[_0x91cb('0x25')]['findOne']({'where':{'id':_0x5c468a[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x1b69ce,null))[_0x91cb('0x16')](function(_0x2c1911){if(_0x2c1911){_0x33de58['model']=_[_0x91cb('0x31')](db[_0x91cb('0x4c')][_0x91cb('0x26')]);_0x33de58[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x5c468a[_0x91cb('0x2d')]);_0x33de58[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x33de58[_0x91cb('0x35')],_0x33de58[_0x91cb('0x2d')]);_0x961ebf[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x33de58['model'],qs[_0x91cb('0x36')](_0x5c468a[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x961ebf[_0x91cb('0x34')]=_0x961ebf[_0x91cb('0x34')][_0x91cb('0x37')]?_0x961ebf[_0x91cb('0x34')]:_0x33de58['model'];if(!_0x5c468a[_0x91cb('0x2d')]['hasOwnProperty'](_0x91cb('0x4d'))){_0x961ebf[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x5c468a[_0x91cb('0x2d')]['limit']);_0x961ebf[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x5c468a[_0x91cb('0x2d')][_0x91cb('0x13')]);}_0x961ebf[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x5c468a['query'][_0x91cb('0x4f')]);_0x961ebf[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_[_0x91cb('0x50')](_0x5c468a[_0x91cb('0x2d')],_0x33de58[_0x91cb('0x32')]));_0x961ebf[_0x91cb('0x2a')][_0x91cb('0x51')]=_0x2c1911['id'];if(_0x5c468a[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x961ebf[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x961ebf[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x961ebf[_0x91cb('0x34')],function(_0x2605c3){var _0x1d9ded={};_0x1d9ded[_0x2605c3]={'$like':'%'+_0x5c468a['query'][_0x91cb('0x1a')]+'%'};return _0x1d9ded;})});}_0x961ebf=_[_0x91cb('0x39')]({},_0x961ebf,_0x5c468a['options']);return db[_0x91cb('0x4c')][_0x91cb('0x2b')]({'where':_0x961ebf[_0x91cb('0x2a')]})['then'](function(_0x45e26b){_0x551836[_0x91cb('0x2b')]=_0x45e26b;if(_0x5c468a['query']['includeAll']){_0x961ebf[_0x91cb('0x2c')]=[{'all':!![]}];}return db['CmHopper'][_0x91cb('0x52')](_0x961ebf);})[_0x91cb('0x16')](function(_0x4e11e3){_0x551836[_0x91cb('0x2e')]=_0x4e11e3;return _0x551836;});}})['then'](respondWithFilteredResult(_0x1b69ce,_0x961ebf))[_0x91cb('0x2f')](handleError(_0x1b69ce,null));};exports[_0x91cb('0x53')]=function(_0x4f827e,_0x5d8a7e){var _0x16a21f={'raw':!![],'where':{}};var _0x43be3e={};var _0x37666a={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x91cb('0x54')]({'where':{'id':_0x4f827e[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x5d8a7e,null))[_0x91cb('0x16')](function(_0x570f6b){if(_0x570f6b){_0x43be3e[_0x91cb('0x35')]=_['keys'](db[_0x91cb('0x55')][_0x91cb('0x26')]);_0x43be3e[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x4f827e['query']);_0x43be3e['filters']=_[_0x91cb('0x33')](_0x43be3e['model'],_0x43be3e[_0x91cb('0x2d')]);_0x16a21f[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x43be3e[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x16a21f['attributes']=_0x16a21f[_0x91cb('0x34')][_0x91cb('0x37')]?_0x16a21f['attributes']:_0x43be3e[_0x91cb('0x35')];if(!_0x4f827e['query'][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x16a21f[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x16a21f[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x13')]);}_0x16a21f[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x16a21f[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_['pick'](_0x4f827e[_0x91cb('0x2d')],_0x43be3e['filters']));_0x16a21f[_0x91cb('0x2a')][_0x91cb('0x51')]=_0x570f6b['id'];if(_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x16a21f[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x16a21f[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x16a21f['attributes'],function(_0xb5c264){var _0xdee7f={};_0xdee7f[_0xb5c264]={'$like':'%'+_0x4f827e['query']['filter']+'%'};return _0xdee7f;})});}_0x16a21f=_[_0x91cb('0x39')]({},_0x16a21f,_0x4f827e['options']);return db['CmHopperHistory'][_0x91cb('0x2b')]({'where':_0x16a21f['where']})[_0x91cb('0x16')](function(_0x498382){_0x37666a[_0x91cb('0x2b')]=_0x498382;if(_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x38')]){_0x16a21f[_0x91cb('0x2c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x91cb('0x52')](_0x16a21f);})[_0x91cb('0x16')](function(_0x42d07b){_0x37666a[_0x91cb('0x2e')]=_0x42d07b;return _0x37666a;});}})[_0x91cb('0x16')](respondWithFilteredResult(_0x5d8a7e,_0x16a21f))[_0x91cb('0x2f')](handleError(_0x5d8a7e,null));};exports[_0x91cb('0x57')]=function(_0x3cf8c5,_0x21dfd3){var _0x24facc={'raw':!![],'where':{}};var _0xafda63={};var _0x32704d={'count':0x0,'rows':[]};return db[_0x91cb('0x25')][_0x91cb('0x54')]({'where':{'id':_0x3cf8c5[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x21dfd3,null))[_0x91cb('0x16')](function(_0x39fce4){if(_0x39fce4){_0xafda63[_0x91cb('0x35')]=_[_0x91cb('0x31')](db[_0x91cb('0x58')][_0x91cb('0x26')]);_0xafda63[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x3cf8c5[_0x91cb('0x2d')]);_0xafda63['filters']=_[_0x91cb('0x33')](_0xafda63[_0x91cb('0x35')],_0xafda63[_0x91cb('0x2d')]);_0x24facc[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0xafda63[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x3cf8c5[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x24facc[_0x91cb('0x34')]=_0x24facc[_0x91cb('0x34')]['length']?_0x24facc[_0x91cb('0x34')]:_0xafda63['model'];if(!_0x3cf8c5['query'][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x24facc[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x3cf8c5[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x24facc[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x3cf8c5[_0x91cb('0x2d')][_0x91cb('0x13')]);}_0x24facc['order']=qs[_0x91cb('0x4f')](_0x3cf8c5[_0x91cb('0x2d')]['sort']);_0x24facc[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_['pick'](_0x3cf8c5[_0x91cb('0x2d')],_0xafda63[_0x91cb('0x32')]));_0x24facc[_0x91cb('0x2a')][_0x91cb('0x51')]=_0x39fce4['id'];if(_0x3cf8c5[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x24facc[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x24facc[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x24facc[_0x91cb('0x34')],function(_0x378cd0){var _0x538a8c={};_0x538a8c[_0x378cd0]={'$like':'%'+_0x3cf8c5['query'][_0x91cb('0x1a')]+'%'};return _0x538a8c;})});}_0x24facc=_[_0x91cb('0x39')]({},_0x24facc,_0x3cf8c5[_0x91cb('0x59')]);return db[_0x91cb('0x58')][_0x91cb('0x2b')]({'where':_0x24facc[_0x91cb('0x2a')]})[_0x91cb('0x16')](function(_0x5ac5cc){_0x32704d[_0x91cb('0x2b')]=_0x5ac5cc;if(_0x3cf8c5['query'][_0x91cb('0x38')]){_0x24facc[_0x91cb('0x2c')]=[{'all':!![]}];}return db[_0x91cb('0x58')][_0x91cb('0x52')](_0x24facc);})[_0x91cb('0x16')](function(_0x4ac4dd){_0x32704d[_0x91cb('0x2e')]=_0x4ac4dd;return _0x32704d;});}})[_0x91cb('0x16')](respondWithFilteredResult(_0x21dfd3,_0x24facc))[_0x91cb('0x2f')](handleError(_0x21dfd3,null));};exports[_0x91cb('0x5a')]=function(_0x3a213e,_0x4e4003){var _0x4003c9={'raw':!![],'where':{}};var _0x9cff8f={};var _0x25a779={'count':0x0,'rows':[]};return db[_0x91cb('0x25')]['findOne']({'where':{'id':_0x3a213e['params']['id']}})['then'](handleEntityNotFound(_0x4e4003,null))[_0x91cb('0x16')](function(_0x182aa5){if(_0x182aa5){_0x9cff8f[_0x91cb('0x35')]=_[_0x91cb('0x31')](db['CmHopperBlack'][_0x91cb('0x26')]);_0x9cff8f[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x3a213e[_0x91cb('0x2d')]);_0x9cff8f['filters']=_['intersection'](_0x9cff8f[_0x91cb('0x35')],_0x9cff8f[_0x91cb('0x2d')]);_0x4003c9[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x9cff8f[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x4003c9[_0x91cb('0x34')]=_0x4003c9[_0x91cb('0x34')][_0x91cb('0x37')]?_0x4003c9[_0x91cb('0x34')]:_0x9cff8f[_0x91cb('0x35')];if(!_0x3a213e['query']['hasOwnProperty'](_0x91cb('0x4d'))){_0x4003c9['limit']=qs[_0x91cb('0x12')](_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x4003c9[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x13')]);}_0x4003c9[_0x91cb('0x4e')]=qs['sort'](_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x4003c9[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_[_0x91cb('0x50')](_0x3a213e['query'],_0x9cff8f[_0x91cb('0x32')]));_0x4003c9[_0x91cb('0x2a')][_0x91cb('0x51')]=_0x182aa5['id'];if(_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x4003c9['where']=_[_0x91cb('0x39')](_0x4003c9[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x4003c9[_0x91cb('0x34')],function(_0x440ef4){var _0x2c2ed8={};_0x2c2ed8[_0x440ef4]={'$like':'%'+_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x2c2ed8;})});}_0x4003c9=_[_0x91cb('0x39')]({},_0x4003c9,_0x3a213e[_0x91cb('0x59')]);return db[_0x91cb('0x5b')][_0x91cb('0x2b')]({'where':_0x4003c9[_0x91cb('0x2a')]})[_0x91cb('0x16')](function(_0x7c84fc){_0x25a779[_0x91cb('0x2b')]=_0x7c84fc;if(_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x38')]){_0x4003c9[_0x91cb('0x2c')]=[{'all':!![]}];}return db[_0x91cb('0x5b')][_0x91cb('0x52')](_0x4003c9);})[_0x91cb('0x16')](function(_0x275c80){_0x25a779[_0x91cb('0x2e')]=_0x275c80;return _0x25a779;});}})[_0x91cb('0x16')](respondWithFilteredResult(_0x4e4003,_0x4003c9))[_0x91cb('0x2f')](handleError(_0x4e4003,null));};exports['getTeams']=function(_0x16cf02,_0x2b8634){var _0x1eb46e={};var _0x261a3a={};var _0x16f334;var _0x5ca377;return db['VoiceQueue']['findOne']({'where':{'id':_0x16cf02['params']['id']}})['then'](handleEntityNotFound(_0x2b8634,null))[_0x91cb('0x16')](function(_0x46a6cc){if(_0x46a6cc){_0x16f334=_0x46a6cc;_0x261a3a[_0x91cb('0x35')]=_[_0x91cb('0x31')](db[_0x91cb('0x5c')][_0x91cb('0x26')]);_0x261a3a[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x16cf02[_0x91cb('0x2d')]);_0x261a3a[_0x91cb('0x32')]=_['intersection'](_0x261a3a[_0x91cb('0x35')],_0x261a3a[_0x91cb('0x2d')]);_0x1eb46e['attributes']=_[_0x91cb('0x33')](_0x261a3a[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x1eb46e[_0x91cb('0x34')]=_0x1eb46e[_0x91cb('0x34')]['length']?_0x1eb46e[_0x91cb('0x34')]:_0x261a3a[_0x91cb('0x35')];_0x1eb46e[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x1eb46e[_0x91cb('0x2a')]=qs['filters'](_[_0x91cb('0x50')](_0x16cf02['query'],_0x261a3a[_0x91cb('0x32')]));if(_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x1eb46e[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x1eb46e[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x1eb46e[_0x91cb('0x34')],function(_0x1c7c10){var _0x570cf0={};_0x570cf0[_0x1c7c10]={'$like':'%'+_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x570cf0;})});}_0x1eb46e=_[_0x91cb('0x39')]({},_0x1eb46e,_0x16cf02[_0x91cb('0x59')]);return _0x16f334[_0x91cb('0x5d')](_0x1eb46e);}})[_0x91cb('0x16')](function(_0x189a87){if(_0x189a87){_0x5ca377=_0x189a87[_0x91cb('0x37')];if(!_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x1eb46e[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x16cf02['query'][_0x91cb('0x12')]);_0x1eb46e['offset']=qs[_0x91cb('0x13')](_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x13')]);}return _0x16f334[_0x91cb('0x5d')](_0x1eb46e);}})[_0x91cb('0x16')](function(_0x12da14){if(_0x12da14){return _0x12da14?{'count':_0x5ca377,'rows':_0x12da14}:null;}})[_0x91cb('0x16')](respondWithResult(_0x2b8634,null))[_0x91cb('0x2f')](handleError(_0x2b8634,null));};exports['addTeams']=function(_0x3353bf,_0x5b3658){var _0x3c1703=_0x3353bf[_0x91cb('0x3c')][_0x91cb('0x5e')];var _0x598663=_[_0x91cb('0x1c')](_0x3c1703,'id');return db[_0x91cb('0x5c')][_0x91cb('0x52')]({'where':{'id':_0x598663},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x91cb('0x5f'),_0x91cb('0x60'),_0x91cb('0x61')],'raw':!![]}]})['then'](function(_0x469e62){if(_0x469e62){var _0x1e9441=_[_0x91cb('0x62')](_0x469e62,function(_0x1bb2de){var _0x129ea0=_0x1bb2de[_0x91cb('0x3e')]({'plain':!![]});_0x129ea0[_0x91cb('0x63')][_0x91cb('0x64')](function(_0x50b8d6){_0x50b8d6[_0x91cb('0x65')]=_[_0x91cb('0x3a')](_0x3c1703,{'id':_0x129ea0['id']})[_0x91cb('0x65')];});return _0x129ea0[_0x91cb('0x63')];});return db['VoiceQueue'][_0x91cb('0x3a')]({'where':{'id':_0x3353bf['params']['id']}})[_0x91cb('0x16')](function(_0x43b620){return db[_0x91cb('0x66')][_0x91cb('0x67')](function(_0x3b0bd5){return _0x43b620['addTeams'](_0x598663,{'transaction':_0x3b0bd5})[_0x91cb('0x16')](function(){return BPromise['each'](_0x3c1703,function(_0x58608e){return db[_0x91cb('0x68')][_0x91cb('0x69')]({'TeamId':_0x58608e['id'],'VoiceQueueId':_0x3353bf[_0x91cb('0x30')]['id'],'penalty':_0x58608e[_0x91cb('0x65')]},{'transaction':_0x3b0bd5});});})[_0x91cb('0x16')](function(){return BPromise[_0x91cb('0x6a')](_0x1e9441,function(_0x20ef3d){return db[_0x91cb('0x6b')]['findOrCreate']({'where':{'UserId':_0x20ef3d['id'],'VoiceQueueId':_0x3353bf[_0x91cb('0x30')]['id']},'defaults':{'penalty':_0x20ef3d[_0x91cb('0x65')]},'transaction':_0x3b0bd5});});})[_0x91cb('0x16')](function(){return BPromise['each'](_['filter'](_0x1e9441,{'online':!![]}),function(_0x530565){return db[_0x91cb('0x6c')][_0x91cb('0x69')]({'membername':_0x530565[_0x91cb('0x20')],'UserId':_0x530565['id'],'queue_name':_0x43b620['name'],'VoiceQueueId':_0x43b620['id'],'interface':_[_0x91cb('0x6d')](_0x530565[_0x91cb('0x61')])?util[_0x91cb('0x6e')](_0x91cb('0x6f'),_0x530565['name']):_0x530565[_0x91cb('0x61')],'paused':_0x530565[_0x91cb('0x60')]||![],'penalty':_0x530565[_0x91cb('0x65')]},{'transaction':_0x3b0bd5});});})[_0x91cb('0x16')](function(){_0x1e9441[_0x91cb('0x64')](function(_0x3c788e){socket['emit'](_0x91cb('0x70'),{'UserId':_0x3c788e['id'],'VoiceQueueId':_0x43b620['id']});});});});});}})[_0x91cb('0x16')](respondWithStatusCode(_0x5b3658,null))[_0x91cb('0x2f')](handleError(_0x5b3658,null));};exports[_0x91cb('0x71')]=function(_0x3782cd,_0x4b290e){return db[_0x91cb('0x5c')][_0x91cb('0x52')]({'where':{'id':_0x3782cd[_0x91cb('0x2d')][_0x91cb('0x72')]},'attributes':['id'],'include':[{'model':db[_0x91cb('0x73')],'as':_0x91cb('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4b290e,null))[_0x91cb('0x16')](function(_0x2bafae){var _0x27472a=_['map'](_0x2bafae,'id');var _0x59cb69=[];var _0x5d0f96=[];var _0x174325=squel[_0x91cb('0x74')]();_0x174325[_0x91cb('0x75')](_0x91cb('0x76'))['from'](_0x91cb('0x77'),'tq')[_0x91cb('0x78')](_0x91cb('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x91cb('0x2a')]('VoiceQueueId\x20=\x20?',_0x3782cd[_0x91cb('0x30')]['id']);for(var _0x43b2e7=0x0;_0x43b2e7<_0x2bafae['length'];_0x43b2e7+=0x1){let _0x1b47fe=_0x2bafae[_0x43b2e7];for(var _0x1853de=0x0;_0x1853de<_0x1b47fe[_0x91cb('0x63')][_0x91cb('0x37')];_0x1853de+=0x1){let _0x376426=_0x1b47fe['Agents'][_0x1853de];var _0x22a6e6=_0x174325[_0x91cb('0x44')]();_0x22a6e6[_0x91cb('0x2a')](_0x91cb('0x7a'),_0x376426['id']);_0x5d0f96['push'](db[_0x91cb('0x66')]['query'](_0x22a6e6['toString'](),{'type':db['sequelize'][_0x91cb('0x7b')][_0x91cb('0x7c')]})[_0x91cb('0x16')](function(_0x4972c3){if(_0x4972c3[_0x91cb('0x37')]===0x1){return _0x376426['id'];}else{var _0x53dbb2=_[_0x91cb('0x7d')](_[_0x91cb('0x1c')](_0x4972c3,_0x91cb('0x7e')),function(_0x2a2a71){return _[_0x91cb('0x1e')](_0x27472a,_0x2a2a71);});if(_0x53dbb2){return _0x376426['id'];}}}));}}return BPromise[_0x91cb('0x7f')](_0x5d0f96)['then'](function(_0x5bfd2c){_0x59cb69=_(_0x59cb69)[_0x91cb('0x80')](_0x5bfd2c)['compact']()[_0x91cb('0x1d')]();return db[_0x91cb('0x25')][_0x91cb('0x3a')]({'where':{'id':_0x3782cd[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](function(_0x51d431){return db[_0x91cb('0x66')][_0x91cb('0x67')](function(_0x18ec67){return _0x51d431['removeTeams'](_0x3782cd[_0x91cb('0x2d')][_0x91cb('0x72')],{'transaction':_0x18ec67})['then'](function(){if(!_[_0x91cb('0x81')](_0x59cb69)){return _0x51d431[_0x91cb('0x82')](_0x59cb69,{'transaction':_0x18ec67})[_0x91cb('0x16')](function(){return db[_0x91cb('0x6c')][_0x91cb('0x17')]({'where':{'VoiceQueueId':_0x3782cd[_0x91cb('0x30')]['id'],'UserId':_0x59cb69},'transaction':_0x18ec67});});}})['then'](function(){_0x59cb69[_0x91cb('0x64')](function(_0x5da781){socket['emit']('userVoiceQueue:remove',{'UserId':_0x5da781,'VoiceQueueId':_0x51d431['id']});});});});});});})[_0x91cb('0x16')](respondWithStatusCode(_0x4b290e,null))['catch'](handleError(_0x4b290e,null));};exports['addAgents']=function(_0x3c0211,_0x3710e9){var _0x395e21,_0x52b9af;return db['VoiceQueue'][_0x91cb('0x3a')]({'where':{'id':_0x3c0211[_0x91cb('0x30')]['id']}})['then'](handleEntityNotFound(_0x3710e9,null))[_0x91cb('0x16')](function(_0x3280a5){if(_0x3280a5){_0x52b9af=_0x3280a5;return _0x3280a5[_0x91cb('0x83')](_0x3c0211[_0x91cb('0x3c')][_0x91cb('0x72')],_['omit'](_0x3c0211['body'],[_0x91cb('0x72'),'id'])||{})[_0x91cb('0x84')](function(_0x547b4d){for(var _0x1aef0b=0x0;_0x1aef0b<_0x3c0211[_0x91cb('0x3c')][_0x91cb('0x72')][_0x91cb('0x37')];_0x1aef0b+=0x1){socket[_0x91cb('0x85')]('userVoiceQueue:save',{'UserId':Number(_0x3c0211[_0x91cb('0x3c')][_0x91cb('0x72')][_0x1aef0b]),'VoiceQueueId':Number(_0x3c0211[_0x91cb('0x30')]['id'])});}return _0x547b4d;});}})['then'](function(_0x4ba088){_0x395e21=_0x4ba088||[];if(_0x52b9af){return db[_0x91cb('0x73')][_0x91cb('0x52')]({'where':{'id':_0x3c0211[_0x91cb('0x3c')][_0x91cb('0x72')]},'attributes':['id',_0x91cb('0x20'),_0x91cb('0x5f'),_0x91cb('0x60'),_0x91cb('0x61')],'raw':!![]});}})['then'](function(_0x33b7a7){if(!_[_0x91cb('0x81')](_0x33b7a7)){var _0x4ac7b9=[];for(var _0x41c3ff=0x0;_0x41c3ff<_0x33b7a7[_0x91cb('0x37')];_0x41c3ff++){if(_0x33b7a7[_0x41c3ff]['online']){_0x4ac7b9[_0x91cb('0x86')](db[_0x91cb('0x6c')][_0x91cb('0x69')]({'membername':_0x33b7a7[_0x41c3ff][_0x91cb('0x20')],'UserId':_0x33b7a7[_0x41c3ff]['id'],'queue_name':_0x52b9af[_0x91cb('0x20')],'VoiceQueueId':_0x52b9af['id'],'interface':_['isNil'](_0x33b7a7[_0x41c3ff][_0x91cb('0x61')])?util[_0x91cb('0x6e')](_0x91cb('0x6f'),_0x33b7a7[_0x41c3ff][_0x91cb('0x20')]):_0x33b7a7[_0x41c3ff]['interface'],'paused':_0x33b7a7[_0x41c3ff][_0x91cb('0x60')]||![],'penalty':_0x3c0211['body'][_0x91cb('0x65')]||0x0}));}}return BPromise[_0x91cb('0x7f')](_0x4ac7b9);}})[_0x91cb('0x16')](function(){return _0x395e21;})[_0x91cb('0x16')](respondWithResult(_0x3710e9,null))[_0x91cb('0x2f')](handleError(_0x3710e9,null));};exports[_0x91cb('0x82')]=function(_0xd572bc,_0x1e7a48){return db[_0x91cb('0x25')]['find']({'where':{'id':_0xd572bc[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x1e7a48,null))[_0x91cb('0x16')](function(_0x51ef1c){if(_0x51ef1c){return _0x51ef1c[_0x91cb('0x82')](_0xd572bc['query'][_0x91cb('0x72')])['then'](function(){if(_[_0x91cb('0x87')](_0xd572bc[_0x91cb('0x2d')][_0x91cb('0x72')])){for(var _0x10fe63=0x0;_0x10fe63<_0xd572bc[_0x91cb('0x2d')][_0x91cb('0x72')][_0x91cb('0x37')];_0x10fe63+=0x1){socket['emit'](_0x91cb('0x88'),{'UserId':Number(_0xd572bc[_0x91cb('0x2d')][_0x91cb('0x72')][_0x10fe63]),'VoiceQueueId':Number(_0xd572bc[_0x91cb('0x30')]['id'])});}}else{socket[_0x91cb('0x85')](_0x91cb('0x88'),{'UserId':Number(_0xd572bc[_0x91cb('0x2d')]['ids']),'VoiceQueueId':Number(_0xd572bc[_0x91cb('0x30')]['id'])});}});}})[_0x91cb('0x16')](function(_0x219b5f){return db[_0x91cb('0x6c')][_0x91cb('0x17')]({'where':{'VoiceQueueId':_0xd572bc['params']['id'],'UserId':_0xd572bc['query']['ids']}})[_0x91cb('0x16')](function(){return _0x219b5f;});})[_0x91cb('0x16')](respondWithStatusCode(_0x1e7a48,null))['catch'](handleError(_0x1e7a48,null));};exports['getAgents']=function(_0x471c17,_0x6549a7){var _0x13564d={};var _0x3c1e63={};var _0x1f2d72;var _0x376adc;return db[_0x91cb('0x25')][_0x91cb('0x54')]({'where':{'id':_0x471c17['params']['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x6549a7,null))[_0x91cb('0x16')](function(_0xf15400){if(_0xf15400){_0x1f2d72=_0xf15400;_0x3c1e63['model']=_[_0x91cb('0x31')](db[_0x91cb('0x73')][_0x91cb('0x26')]);_0x3c1e63[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x471c17[_0x91cb('0x2d')]);_0x3c1e63[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x3c1e63['model'],_0x3c1e63['query']);_0x13564d[_0x91cb('0x34')]=_['intersection'](_0x3c1e63[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x471c17[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x13564d['attributes']=_0x13564d[_0x91cb('0x34')][_0x91cb('0x37')]?_0x13564d[_0x91cb('0x34')]:_0x3c1e63[_0x91cb('0x35')];_0x13564d[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x471c17[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x13564d['where']=qs[_0x91cb('0x32')](_['pick'](_0x471c17[_0x91cb('0x2d')],_0x3c1e63[_0x91cb('0x32')]));if(_0x471c17['query'][_0x91cb('0x1a')]){_0x13564d[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x13564d[_0x91cb('0x2a')],{'$or':_['map'](_0x13564d[_0x91cb('0x34')],function(_0x1bef2b){var _0x5a38f7={};_0x5a38f7[_0x1bef2b]={'$like':'%'+_0x471c17[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x5a38f7;})});}_0x13564d=_[_0x91cb('0x39')]({},_0x13564d,_0x471c17[_0x91cb('0x59')]);return _0x1f2d72[_0x91cb('0x89')](_0x13564d);}})[_0x91cb('0x16')](function(_0x2f42ef){if(_0x2f42ef){_0x376adc=_0x2f42ef[_0x91cb('0x37')];if(!_0x471c17[_0x91cb('0x2d')][_0x91cb('0x56')]('nolimit')){_0x13564d[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x471c17[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x13564d[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x471c17[_0x91cb('0x2d')][_0x91cb('0x13')]);}return _0x1f2d72[_0x91cb('0x89')](_0x13564d);}})[_0x91cb('0x16')](function(_0x31cf76){if(_0x31cf76){return _0x31cf76?{'count':_0x376adc,'rows':_0x31cf76}:null;}})['then'](respondWithResult(_0x6549a7,null))[_0x91cb('0x2f')](handleError(_0x6549a7,null));};exports['getMembers']=function(_0x3a5022,_0x17141e){var _0x3e2c58={};var _0x11c67c={};var _0xf4b4ab;var _0x2fa5e3;return db[_0x91cb('0x25')]['findOne']({'where':{'id':_0x3a5022[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x17141e,null))[_0x91cb('0x16')](function(_0x4483fb){if(_0x4483fb){_0xf4b4ab=_0x4483fb;_0x11c67c['model']=_['keys'](db['UserVoiceQueueRt'][_0x91cb('0x26')]);_0x11c67c[_0x91cb('0x2d')]=_['keys'](_0x3a5022['query']);_0x11c67c['filters']=_[_0x91cb('0x33')](_0x11c67c[_0x91cb('0x35')],_0x11c67c['query']);_0x3e2c58['attributes']=_['intersection'](_0x11c67c[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x3a5022['query'][_0x91cb('0x36')]));_0x3e2c58[_0x91cb('0x34')]=_0x3e2c58['attributes']['length']?_0x3e2c58[_0x91cb('0x34')]:_0x11c67c[_0x91cb('0x35')];_0x3e2c58[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x3a5022[_0x91cb('0x2d')]['sort']);_0x3e2c58[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_['pick'](_0x3a5022[_0x91cb('0x2d')],_0x11c67c[_0x91cb('0x32')]));if(_0x3a5022[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x3e2c58[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x3e2c58[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x3e2c58[_0x91cb('0x34')],function(_0x1ea132){var _0x3b1d97={};_0x3b1d97[_0x1ea132]={'$like':'%'+_0x3a5022[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x3b1d97;})});}_0x3e2c58=_[_0x91cb('0x39')]({},_0x3e2c58,_0x3a5022[_0x91cb('0x59')]);return _0xf4b4ab[_0x91cb('0x8a')](_0x3e2c58);}})[_0x91cb('0x16')](function(_0x5cf6df){if(_0x5cf6df){_0x2fa5e3=_0x5cf6df['length'];if(!_0x3a5022['query'][_0x91cb('0x56')]('nolimit')){_0x3e2c58[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x3a5022[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x3e2c58[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x3a5022[_0x91cb('0x2d')][_0x91cb('0x13')]);}return _0xf4b4ab['getMembers'](_0x3e2c58);}})['then'](function(_0x5f2de0){return _0x5f2de0?{'count':_0x2fa5e3,'rows':_0x5f2de0}:null;})[_0x91cb('0x16')](respondWithResult(_0x17141e,null))[_0x91cb('0x2f')](handleError(_0x17141e,null));};exports[_0x91cb('0x8b')]=function(_0x2b4e25,_0x4c044d){var _0x54c194={};var _0x3cfdcb={};var _0x1624b3;var _0x1e2acd;return db[_0x91cb('0x25')][_0x91cb('0x54')]({'where':{'id':_0x2b4e25['params']['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x4c044d,null))['then'](function(_0x1e979e){if(_0x1e979e){_0x1624b3=_0x1e979e;_0x3cfdcb[_0x91cb('0x35')]=_['keys'](db[_0x91cb('0x8c')][_0x91cb('0x26')]);_0x3cfdcb[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x2b4e25[_0x91cb('0x2d')]);_0x3cfdcb['filters']=_[_0x91cb('0x33')](_0x3cfdcb[_0x91cb('0x35')],_0x3cfdcb[_0x91cb('0x2d')]);_0x54c194[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x3cfdcb['model'],qs[_0x91cb('0x36')](_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x54c194['attributes']=_0x54c194['attributes'][_0x91cb('0x37')]?_0x54c194['attributes']:_0x3cfdcb[_0x91cb('0x35')];_0x54c194[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x2b4e25[_0x91cb('0x2d')]['sort']);_0x54c194[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_['pick'](_0x2b4e25[_0x91cb('0x2d')],_0x3cfdcb[_0x91cb('0x32')]));if(_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x54c194[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x54c194['where'],{'$or':_[_0x91cb('0x1c')](_0x54c194['attributes'],function(_0x283743){var _0x44ffde={};_0x44ffde[_0x283743]={'$like':'%'+_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x44ffde;})});}_0x54c194=_['merge']({},_0x54c194,_0x2b4e25[_0x91cb('0x59')]);return _0x1624b3[_0x91cb('0x8b')](_0x54c194);}})[_0x91cb('0x16')](function(_0x5e629){if(_0x5e629){_0x1e2acd=_0x5e629[_0x91cb('0x37')];if(!_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x54c194[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x2b4e25['query'][_0x91cb('0x12')]);_0x54c194['offset']=qs[_0x91cb('0x13')](_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x13')]);}return _0x1624b3[_0x91cb('0x8b')](_0x54c194);}})['then'](function(_0x87f382){if(_0x87f382){return _0x87f382?{'count':_0x1e2acd,'rows':_0x87f382}:null;}})[_0x91cb('0x16')](respondWithResult(_0x4c044d,null))[_0x91cb('0x2f')](handleError(_0x4c044d,null));};exports['addLists']=function(_0x330123,_0x23bc13){var _0x175d85=moment()[_0x91cb('0x6e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x97ba8,_0x4bc382;return db[_0x91cb('0x25')]['find']({'where':{'id':_0x330123[_0x91cb('0x30')]['id']}})['then'](handleEntityNotFound(_0x23bc13,null))[_0x91cb('0x16')](function(_0x399012){if(_0x399012){_0x4bc382=_0x399012;return _0x399012[_0x91cb('0x8d')](_0x330123['body']['ids'],_[_0x91cb('0x47')](_0x330123[_0x91cb('0x3c')],[_0x91cb('0x72'),'id'])||{});}return null;})[_0x91cb('0x84')](function(_0x571a6f){var _0x19596b;_0x97ba8=_0x571a6f||[];var _0x5b4849=[];if(_0x571a6f){for(var _0x39a183=0x0;_0x39a183<_0x571a6f[_0x91cb('0x37')];_0x39a183+=0x1){var _0x693690=_0x571a6f[_0x39a183][_0x91cb('0x3e')]({'plain':!![]});_0x4bc382[_0x91cb('0x8e')]=_0x330123[_0x91cb('0x3c')][_0x91cb('0x8e')]?_0x330123[_0x91cb('0x3c')]['dialCheckDuplicateType']:_0x4bc382['dialCheckDuplicateType'];switch(_0x4bc382['dialCheckDuplicateType']){case'always':_0x19596b=squel[_0x91cb('0x8f')]()[_0x91cb('0x90')](_0x91cb('0x91'))[_0x91cb('0x92')](['phone','scheduledAt',_0x91cb('0x93'),'ListId',_0x91cb('0x51'),_0x91cb('0x45'),_0x91cb('0x46')],squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0x94'),_0x91cb('0x94'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27','scheduledAt')[_0x91cb('0x75')]('id',_0x91cb('0x93'))[_0x91cb('0x75')](_0x693690[_0x91cb('0x95')]['toString'](),'ListId')['field'](_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')](),_0x91cb('0x51'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x45'))['field']('\x27'+_0x175d85+'\x27',_0x91cb('0x46'))[_0x91cb('0x97')](_0x91cb('0x98'))[_0x91cb('0x2a')](_0x91cb('0x99'))[_0x91cb('0x2a')](_0x91cb('0x9a'),_0x693690[_0x91cb('0x95')][_0x91cb('0x96')]())[_0x91cb('0x2a')](_0x91cb('0x9b'))[_0x91cb('0x2a')](_0x91cb('0x9c'),squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0x9d'))[_0x91cb('0x97')](_0x91cb('0x9e'))[_0x91cb('0x2a')](_0x91cb('0x9f'),_0x330123[_0x91cb('0x30')]['id']['toString']()))[_0x91cb('0x2a')](_0x91cb('0x9c'),squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0xa0'))['from'](_0x91cb('0x91'))[_0x91cb('0x2a')](_0x91cb('0x9f'),_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')]())))['toString']();break;case _0x91cb('0xa1'):_0x19596b=squel[_0x91cb('0x8f')]()['into'](_0x91cb('0x91'))['fromQuery']([_0x91cb('0x94'),'scheduledAt',_0x91cb('0x93'),_0x91cb('0xa2'),_0x91cb('0x51'),'createdAt',_0x91cb('0x46')],squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0x94'),_0x91cb('0x94'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0xa3'))[_0x91cb('0x75')]('id',_0x91cb('0x93'))['field'](_0x693690[_0x91cb('0x95')][_0x91cb('0x96')](),_0x91cb('0xa2'))[_0x91cb('0x75')](_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')](),_0x91cb('0x51'))['field']('\x27'+_0x175d85+'\x27',_0x91cb('0x45'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x46'))[_0x91cb('0x97')](_0x91cb('0x98'))[_0x91cb('0x2a')](_0x91cb('0x99'))['where'](_0x91cb('0x9a'),_0x693690[_0x91cb('0x95')][_0x91cb('0x96')]())[_0x91cb('0x2a')](_0x91cb('0x9b'))[_0x91cb('0x2a')](_0x91cb('0x9c'),squel[_0x91cb('0x74')]()['field']('COALESCE(phone,\x27\x27)')[_0x91cb('0x97')]('cm_hopper')[_0x91cb('0x2a')](_0x91cb('0x9f'),_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')]())))[_0x91cb('0x96')]();break;default:_0x19596b=squel['insert']()[_0x91cb('0x90')](_0x91cb('0x91'))[_0x91cb('0x92')]([_0x91cb('0x94'),_0x91cb('0xa3'),_0x91cb('0x93'),_0x91cb('0xa2'),'VoiceQueueId',_0x91cb('0x45'),_0x91cb('0x46')],squel[_0x91cb('0x74')]()['field'](_0x91cb('0x94'),'phone')['field']('\x27'+_0x175d85+'\x27',_0x91cb('0xa3'))['field']('id',_0x91cb('0x93'))[_0x91cb('0x75')](_0x693690['CmListId'][_0x91cb('0x96')](),_0x91cb('0xa2'))[_0x91cb('0x75')](_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')](),_0x91cb('0x51'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x45'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x46'))[_0x91cb('0x97')](_0x91cb('0x98'))['where'](_0x91cb('0x99'))[_0x91cb('0x2a')](_0x91cb('0x9a'),_0x693690[_0x91cb('0x95')][_0x91cb('0x96')]())['where'](_0x91cb('0x9b')))[_0x91cb('0x96')]();}_0x5b4849['push'](db[_0x91cb('0x66')]['query'](_0x19596b));}return BPromise[_0x91cb('0x7f')](_0x5b4849);}})['then'](function(){var _0x739447=[];var _0x2deed1=squel[_0x91cb('0x8f')]()[_0x91cb('0x90')](_0x91cb('0xa4'))['fromQuery']([_0x91cb('0xa5'),_0x91cb('0x94'),'OrderBy','createdAt',_0x91cb('0x46')],squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0xa6'))['field'](_0x91cb('0xa7'))[_0x91cb('0x75')](_0x91cb('0xa8'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x45'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x46'))['from'](_0x91cb('0xa9'),'ci')[_0x91cb('0x78')]('cm_hopper','h','h.ContactId=ci.CmContactId')[_0x91cb('0x2a')](_0x91cb('0xaa'),_0x175d85)[_0x91cb('0x2a')](_0x91cb('0xab'),_0x91cb('0xac')))[_0x91cb('0x96')]();_0x739447[_0x91cb('0x86')](db[_0x91cb('0x66')]['query'](_0x2deed1));return BPromise[_0x91cb('0x7f')](_0x739447);})[_0x91cb('0x16')](function(){return _0x97ba8;})[_0x91cb('0x16')](respondWithResult(_0x23bc13,null))[_0x91cb('0x2f')](handleError(_0x23bc13,null));};exports[_0x91cb('0xad')]=function(_0x554923,_0x2fe556){return db[_0x91cb('0x25')]['find']({'where':{'id':_0x554923[_0x91cb('0x30')]['id']}})['then'](handleEntityNotFound(_0x2fe556,null))[_0x91cb('0x16')](function(_0x43958a){if(_0x43958a){return _0x43958a[_0x91cb('0xad')](_0x554923['query'][_0x91cb('0x72')]);}})[_0x91cb('0x16')](function(_0x409a36){if(_0x409a36){return db[_0x91cb('0x4c')][_0x91cb('0x17')]({'where':{'ListId':_0x554923[_0x91cb('0x2d')][_0x91cb('0x72')],'VoiceQueueId':_0x554923[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](function(){return _0x409a36;});}})[_0x91cb('0x16')](respondWithStatusCode(_0x2fe556,null))['catch'](handleError(_0x2fe556,null));};exports[_0x91cb('0xae')]=function(_0x2d870d,_0x173761){var _0x2cf0d8={};var _0x9d63ff={};var _0x720de;var _0x80f0ba;return db[_0x91cb('0x25')][_0x91cb('0x54')]({'where':{'id':_0x2d870d[_0x91cb('0x30')]['id']}})['then'](handleEntityNotFound(_0x173761,null))[_0x91cb('0x16')](function(_0x800860){if(_0x800860){_0x720de=_0x800860;_0x9d63ff[_0x91cb('0x35')]=_[_0x91cb('0x31')](db[_0x91cb('0x8c')][_0x91cb('0x26')]);_0x9d63ff['query']=_['keys'](_0x2d870d[_0x91cb('0x2d')]);_0x9d63ff[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x9d63ff['model'],_0x9d63ff[_0x91cb('0x2d')]);_0x2cf0d8[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x9d63ff[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x2d870d[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x2cf0d8[_0x91cb('0x34')]=_0x2cf0d8[_0x91cb('0x34')][_0x91cb('0x37')]?_0x2cf0d8[_0x91cb('0x34')]:_0x9d63ff[_0x91cb('0x35')];_0x2cf0d8[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x2d870d[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x2cf0d8[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_[_0x91cb('0x50')](_0x2d870d['query'],_0x9d63ff[_0x91cb('0x32')]));if(_0x2d870d[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x2cf0d8['where']=_['merge'](_0x2cf0d8['where'],{'$or':_[_0x91cb('0x1c')](_0x2cf0d8[_0x91cb('0x34')],function(_0x4370f6){var _0x5bc712={};_0x5bc712[_0x4370f6]={'$like':'%'+_0x2d870d['query'][_0x91cb('0x1a')]+'%'};return _0x5bc712;})});}_0x2cf0d8=_[_0x91cb('0x39')]({},_0x2cf0d8,_0x2d870d[_0x91cb('0x59')]);return _0x720de[_0x91cb('0xae')](_0x2cf0d8);}})[_0x91cb('0x16')](function(_0x182f2c){if(_0x182f2c){_0x80f0ba=_0x182f2c[_0x91cb('0x37')];if(!_0x2d870d[_0x91cb('0x2d')][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x2cf0d8['limit']=qs['limit'](_0x2d870d[_0x91cb('0x2d')]['limit']);_0x2cf0d8[_0x91cb('0x13')]=qs['offset'](_0x2d870d['query'][_0x91cb('0x13')]);}return _0x720de['getBlackLists'](_0x2cf0d8);}})[_0x91cb('0x16')](function(_0x2ac9df){if(_0x2ac9df){return _0x2ac9df?{'count':_0x80f0ba,'rows':_0x2ac9df}:null;}})['then'](respondWithResult(_0x173761,null))[_0x91cb('0x2f')](handleError(_0x173761,null));};exports[_0x91cb('0xaf')]=function(_0x331381,_0x52ce8c){var _0x534968;return db[_0x91cb('0x25')][_0x91cb('0x3a')]({'where':{'id':_0x331381['params']['id']}})['then'](handleEntityNotFound(_0x52ce8c,null))['then'](function(_0x397397){if(_0x397397){return _0x397397[_0x91cb('0xaf')](_0x331381[_0x91cb('0x3c')][_0x91cb('0x72')],_['omit'](_0x331381[_0x91cb('0x3c')],[_0x91cb('0x72'),'id'])||{});}return null;})[_0x91cb('0x84')](function(_0x2a0c3c){var _0x30ef98;_0x534968=_0x2a0c3c||[];var _0x27d0ab=[];if(_0x2a0c3c){for(var _0x547db7=0x0;_0x547db7<_0x2a0c3c['length'];_0x547db7+=0x1){var _0x38d608=_0x2a0c3c[_0x547db7][_0x91cb('0x3e')]({'plain':!![]});_0x30ef98=squel[_0x91cb('0x8f')]()[_0x91cb('0x90')](_0x91cb('0xb0'))[_0x91cb('0x92')](['phone',_0x91cb('0x93'),_0x91cb('0xa2'),_0x91cb('0x51'),'createdAt',_0x91cb('0x46')],squel['select']()[_0x91cb('0x75')](_0x91cb('0x94'),'phone')[_0x91cb('0x75')]('id','ContactId')[_0x91cb('0x75')](_0x38d608[_0x91cb('0x95')][_0x91cb('0x96')](),_0x91cb('0xa2'))['field'](_0x331381[_0x91cb('0x30')]['id']['toString'](),_0x91cb('0x51'))['field']('NOW()',_0x91cb('0x45'))[_0x91cb('0x75')](_0x91cb('0xb1'),_0x91cb('0x46'))[_0x91cb('0x97')]('cm_contacts')['where'](_0x91cb('0x99'))['where'](_0x91cb('0x9a'),_0x38d608['CmListId'][_0x91cb('0x96')]())[_0x91cb('0x2a')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x27d0ab[_0x91cb('0x86')](db['sequelize'][_0x91cb('0x2d')](_0x30ef98));}return BPromise['all'](_0x27d0ab);}})['then'](function(){return _0x534968;})[_0x91cb('0x16')](respondWithResult(_0x52ce8c,null))[_0x91cb('0x2f')](handleError(_0x52ce8c,null));};exports[_0x91cb('0xb2')]=function(_0x4ef95b,_0x2f0269){return db[_0x91cb('0x25')][_0x91cb('0x3a')]({'where':{'id':_0x4ef95b[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x2f0269,null))['then'](function(_0x5e1b97){if(_0x5e1b97){return _0x5e1b97[_0x91cb('0xb2')](_0x4ef95b['query'][_0x91cb('0x72')]);}})[_0x91cb('0x16')](function(_0xcb3114){if(_0xcb3114){return db[_0x91cb('0x5b')][_0x91cb('0x17')]({'where':{'ListId':_0x4ef95b['query'][_0x91cb('0x72')],'VoiceQueueId':_0x4ef95b['params']['id']}})[_0x91cb('0x16')](function(){return _0xcb3114;});}})['then'](respondWithStatusCode(_0x2f0269,null))[_0x91cb('0x2f')](handleError(_0x2f0269,null));}; \ No newline at end of file +var _0x34e8=['body','role','user','QueueCampaigns','find','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','includeAll','merge','options','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','hasOwnProperty','nolimit','order','sort','pick','VoiceQueueId','where','filter','CmHopper','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','interface','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','isEmpty','removeAgents','userVoiceQueue:remove','spread','push','isArray','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','cm_hopper','fromQuery','phone','scheduledAt','CmListId','ListId','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','ContactId','cm_contacts','ListId\x20=\x20?','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','then','destroy','get','VoiceQueues','inbound','outbound','ignore','map','value','type','UserProfileResource','error','stack','name','VoiceQueue','rawAttributes','fieldName','key','getOptions','include','query','findAll','catch','show','keys','filters','model','attributes','intersection','fields','length','create'];(function(_0x537c32,_0x5c0845){var _0x2524d7=function(_0x2a30c3){while(--_0x2a30c3){_0x537c32['push'](_0x537c32['shift']());}};_0x2524d7(++_0x5c0845);}(_0x34e8,0x12c));var _0x834e=function(_0x3cfd7a,_0x5439b9){_0x3cfd7a=_0x3cfd7a-0x0;var _0x3b41ca=_0x34e8[_0x3cfd7a];return _0x3b41ca;};'use strict';var moment=require(_0x834e('0x0'));var BPromise=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));var squel=require('squel');var Redis=require(_0x834e('0x4'));var qs=require(_0x834e('0x5'));var logger=require(_0x834e('0x6'))(_0x834e('0x7'));var config=require(_0x834e('0x8'));var db=require(_0x834e('0x9'))['db'];config[_0x834e('0xa')]=_['defaults'](config[_0x834e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x834e('0xb'))(new Redis(config[_0x834e('0xa')]));require(_0x834e('0xc'))[_0x834e('0xd')](socket);function respondWithStatusCode(_0x33ea05,_0x23501c){_0x23501c=_0x23501c||0xcc;return function(_0x363786){if(_0x363786){return _0x33ea05[_0x834e('0xe')](_0x23501c);}return _0x33ea05[_0x834e('0xf')](_0x23501c)[_0x834e('0x10')]();};}function respondWithResult(_0x1e41fe,_0x36e124){_0x36e124=_0x36e124||0xc8;return function(_0x14038b){if(_0x14038b){return _0x1e41fe[_0x834e('0xf')](_0x36e124)[_0x834e('0x11')](_0x14038b);}};}function respondWithFilteredResult(_0x1e00de,_0x2fd95c){return function(_0x538bb3){if(_0x538bb3){var _0x5e5b6d=typeof _0x2fd95c[_0x834e('0x12')]==='undefined'&&typeof _0x2fd95c[_0x834e('0x13')]===_0x834e('0x14');var _0x28e659=_0x538bb3[_0x834e('0x15')];var _0x50e860=_0x5e5b6d?0x0:_0x2fd95c[_0x834e('0x12')];var _0x302cbd=_0x5e5b6d?_0x538bb3['count']:_0x2fd95c[_0x834e('0x12')]+_0x2fd95c['limit'];var _0x38a8cd;if(_0x302cbd>=_0x28e659){_0x302cbd=_0x28e659;_0x38a8cd=0xc8;}else{_0x38a8cd=0xce;}_0x1e00de[_0x834e('0xf')](_0x38a8cd);return _0x1e00de['set'](_0x834e('0x16'),_0x50e860+'-'+_0x302cbd+'/'+_0x28e659)[_0x834e('0x11')](_0x538bb3);}return null;};}function saveUpdates(_0x370fb5){return function(_0x50b3f6){if(_0x50b3f6){return _0x50b3f6[_0x834e('0x17')](_0x370fb5)[_0x834e('0x18')](function(_0x34e41a){return _0x34e41a;});}return null;};}function removeEntity(_0xb993a1){return function(_0x237947){if(_0x237947){return _0x237947[_0x834e('0x19')]()[_0x834e('0x18')](function(){var _0x595515=_0x237947[_0x834e('0x1a')]({'plain':!![]});var _0x1fd2c6=[{'name':_0x834e('0x1b'),'value':_0x834e('0x1c'),'ignore':![]},{'name':'QueueCampaigns','value':_0x834e('0x1d'),'ignore':![]}];var _0x62f8f1=_(_0x1fd2c6)['filter'](_0x834e('0x1e'))[_0x834e('0x1f')](_0x834e('0x20'))['value']();if(_['includes'](_0x62f8f1,_0x595515[_0x834e('0x21')])){return;}var _0x34563b=_['find'](_0x1fd2c6,[_0x834e('0x20'),_0x595515[_0x834e('0x21')]])['name'];return db[_0x834e('0x22')][_0x834e('0x19')]({'where':{'type':_0x34563b,'resourceId':_0x595515['id']}})[_0x834e('0x18')](function(){return _0x237947;});})['then'](function(){_0xb993a1[_0x834e('0xf')](0xcc)[_0x834e('0x10')]();});}};}function handleEntityNotFound(_0x5e1cc5){return function(_0x5bef62){if(!_0x5bef62){_0x5e1cc5[_0x834e('0xe')](0x194);}return _0x5bef62;};}function handleError(_0x508a1d,_0x2826ec){_0x2826ec=_0x2826ec||0x1f4;return function(_0x3f1b0b){logger[_0x834e('0x23')](_0x3f1b0b[_0x834e('0x24')]);if(_0x3f1b0b[_0x834e('0x25')]){delete _0x3f1b0b[_0x834e('0x25')];}_0x508a1d['status'](_0x2826ec)['send'](_0x3f1b0b);};}exports['index']=function(_0x58c1d7,_0x2c7a8d){var _0x567cea={};var _0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x1f')](db[_0x834e('0x26')][_0x834e('0x27')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x28')],'type':_0x1e026a[_0x834e('0x21')][_0x834e('0x29')]};});_0x567cea=qs[_0x834e('0x2a')](_0x5dacc1,_0x58c1d7);var _0x278db3={'where':_0x567cea['where']};return db[_0x834e('0x26')]['count'](_0x278db3)[_0x834e('0x18')](function(_0x3787b0){_0x106d6a[_0x834e('0x15')]=_0x3787b0;_0x567cea[_0x834e('0x2b')]=qs[_0x834e('0x2b')](_0x58c1d7[_0x834e('0x2c')]);return db[_0x834e('0x26')][_0x834e('0x2d')](_0x567cea);})[_0x834e('0x18')](function(_0x12b2bc){_0x106d6a['rows']=_0x12b2bc;return _0x106d6a;})[_0x834e('0x18')](respondWithFilteredResult(_0x2c7a8d,_0x567cea))[_0x834e('0x2e')](handleError(_0x2c7a8d,null));};exports[_0x834e('0x2f')]=function(_0xaf01f4,_0x595cc0){var _0x3f88ad={'raw':![],'where':{'id':_0xaf01f4['params']['id']}},_0x379d60={};_0x379d60['model']=_['keys'](db[_0x834e('0x26')][_0x834e('0x27')]);_0x379d60[_0x834e('0x2c')]=_[_0x834e('0x30')](_0xaf01f4[_0x834e('0x2c')]);_0x379d60[_0x834e('0x31')]=_['intersection'](_0x379d60[_0x834e('0x32')],_0x379d60['query']);_0x3f88ad[_0x834e('0x33')]=_[_0x834e('0x34')](_0x379d60['model'],qs[_0x834e('0x35')](_0xaf01f4[_0x834e('0x2c')]['fields']));_0x3f88ad['attributes']=_0x3f88ad[_0x834e('0x33')][_0x834e('0x36')]?_0x3f88ad[_0x834e('0x33')]:_0x379d60[_0x834e('0x32')];if(_0xaf01f4[_0x834e('0x2c')]['includeAll']){_0x3f88ad[_0x834e('0x2b')]=[{'all':!![]}];}_0x3f88ad=_['merge']({},_0x3f88ad,_0xaf01f4['options']);return db[_0x834e('0x26')]['find'](_0x3f88ad)[_0x834e('0x18')](handleEntityNotFound(_0x595cc0,null))[_0x834e('0x18')](respondWithResult(_0x595cc0,null))[_0x834e('0x2e')](handleError(_0x595cc0,null));};exports[_0x834e('0x37')]=function(_0x2b7933,_0x574ea8){return db[_0x834e('0x26')][_0x834e('0x37')](_0x2b7933[_0x834e('0x38')],{})['then'](function(_0x35380e){var _0x16ac45=_0x2b7933['user'][_0x834e('0x1a')]({'plain':!![]});if(!_0x16ac45)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16ac45[_0x834e('0x39')]===_0x834e('0x3a')){var _0x4a18bb=_0x35380e['get']({'plain':!![]});var _0x22ea21=[{'name':_0x834e('0x1b'),'value':_0x834e('0x1c')},{'name':_0x834e('0x3b'),'value':_0x834e('0x1d')}];var _0x23feea=_[_0x834e('0x3c')](_0x22ea21,['value',_0x4a18bb[_0x834e('0x21')]])['name'];return db[_0x834e('0x3d')]['find']({'where':{'name':_0x23feea,'userProfileId':_0x16ac45[_0x834e('0x3e')]},'raw':!![]})['then'](function(_0x361f60){if(_0x361f60&&_0x361f60[_0x834e('0x3f')]===0x0){return db['UserProfileResource'][_0x834e('0x37')]({'name':_0x4a18bb[_0x834e('0x25')],'resourceId':_0x4a18bb['id'],'type':_0x361f60[_0x834e('0x25')],'sectionId':_0x361f60['id']},{})[_0x834e('0x18')](function(){return _0x35380e;});}else{return _0x35380e;}})[_0x834e('0x2e')](function(_0x1a7149){logger[_0x834e('0x23')](_0x834e('0x40'),_0x1a7149);throw _0x1a7149;});}return _0x35380e;})[_0x834e('0x18')](respondWithResult(_0x574ea8,0xc9))[_0x834e('0x2e')](handleError(_0x574ea8,null));};exports['clone']=function(_0x3124be,_0x6fff27){var _0x47a8a9={'where':{'id':_0x3124be[_0x834e('0x41')]['id']}},_0x112306={};_0x112306[_0x834e('0x32')]=_[_0x834e('0x30')](db[_0x834e('0x26')][_0x834e('0x27')]);_0x47a8a9['attributes']=_['intersection'](_0x112306[_0x834e('0x32')],qs[_0x834e('0x35')](_0x3124be[_0x834e('0x2c')][_0x834e('0x35')]));_0x47a8a9[_0x834e('0x33')]=_0x47a8a9[_0x834e('0x33')][_0x834e('0x36')]?_0x47a8a9[_0x834e('0x33')]:_0x112306[_0x834e('0x32')];if(_0x3124be[_0x834e('0x2c')][_0x834e('0x42')]){_0x47a8a9[_0x834e('0x2b')]=[{'all':!![]}];}_0x47a8a9=_[_0x834e('0x43')]({},_0x47a8a9,_0x3124be[_0x834e('0x44')]);return db[_0x834e('0x26')][_0x834e('0x3c')](_0x47a8a9)[_0x834e('0x18')](handleEntityNotFound(_0x6fff27,null))[_0x834e('0x18')](function(_0x420841){if(_0x420841){var _0x1adf86=_0x420841['get']({'plain':!![]});_0x1adf86=qs[_0x834e('0x45')](_0x1adf86,['id',_0x834e('0x46'),'updatedAt']);_0x3124be[_0x834e('0x38')]=_[_0x834e('0x45')](_0x3124be['body'],['id',_0x834e('0x46'),_0x834e('0x47')]);return db[_0x834e('0x26')][_0x834e('0x37')](_[_0x834e('0x43')](_0x1adf86,_0x3124be[_0x834e('0x38')]),{'include':_0x3124be[_0x834e('0x2c')]['includeAll']?[{'all':!![]}]:undefined})[_0x834e('0x18')](function(_0x8bc6c6){var _0x3e0550=_0x3124be[_0x834e('0x3a')][_0x834e('0x1a')]({'plain':!![]});if(!_0x3e0550)throw new Error(_0x834e('0x48'));if(_0x3e0550[_0x834e('0x39')]===_0x834e('0x3a')){var _0x5afa07=_0x8bc6c6[_0x834e('0x1a')]({'plain':!![]});var _0x4dc104=[{'name':_0x834e('0x1b'),'value':'inbound'},{'name':_0x834e('0x3b'),'value':'outbound'}];var _0x527eef=_[_0x834e('0x3c')](_0x4dc104,[_0x834e('0x20'),_0x5afa07['type']])['name'];return db[_0x834e('0x3d')][_0x834e('0x3c')]({'where':{'name':_0x527eef,'userProfileId':_0x3e0550[_0x834e('0x3e')]},'raw':!![]})[_0x834e('0x18')](function(_0x21c417){if(_0x21c417&&_0x21c417[_0x834e('0x3f')]===0x0){return db[_0x834e('0x22')][_0x834e('0x37')]({'name':_0x5afa07['name'],'resourceId':_0x5afa07['id'],'type':_0x21c417[_0x834e('0x25')],'sectionId':_0x21c417['id']},{})[_0x834e('0x18')](function(){return _0x8bc6c6;});}else{return _0x8bc6c6;}})['catch'](function(_0x281342){logger['error'](_0x834e('0x40'),_0x281342);throw _0x281342;});}return _0x8bc6c6;});}})[_0x834e('0x18')](respondWithResult(_0x6fff27,0xc9))['catch'](handleError(_0x6fff27,null));};exports[_0x834e('0x17')]=function(_0x37ee0e,_0x2de29a){if(_0x37ee0e[_0x834e('0x38')]['id']){delete _0x37ee0e['body']['id'];}return db[_0x834e('0x26')][_0x834e('0x3c')]({'where':{'id':_0x37ee0e[_0x834e('0x41')]['id']}})['then'](handleEntityNotFound(_0x2de29a,null))[_0x834e('0x18')](saveUpdates(_0x37ee0e[_0x834e('0x38')],null))[_0x834e('0x18')](respondWithResult(_0x2de29a,null))[_0x834e('0x2e')](handleError(_0x2de29a,null));};exports[_0x834e('0x19')]=function(_0x125f37,_0x3a1426){return db[_0x834e('0x26')][_0x834e('0x3c')]({'where':{'id':_0x125f37[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x3a1426,null))[_0x834e('0x18')](removeEntity(_0x3a1426,null))[_0x834e('0x2e')](handleError(_0x3a1426,null));};exports[_0x834e('0x49')]=function(_0x460a7a,_0x17b8e3){var _0x297cce={'raw':![],'where':{}};var _0x14ed83={};var _0x193a15={'count':0x0,'rows':[]};return db[_0x834e('0x26')][_0x834e('0x4a')]({'where':{'id':_0x460a7a[_0x834e('0x41')]['id']}})['then'](handleEntityNotFound(_0x17b8e3,null))[_0x834e('0x18')](function(_0x25d6f4){if(_0x25d6f4){_0x14ed83[_0x834e('0x32')]=_[_0x834e('0x30')](db['CmHopper'][_0x834e('0x27')]);_0x14ed83['query']=_['keys'](_0x460a7a[_0x834e('0x2c')]);_0x14ed83[_0x834e('0x31')]=_[_0x834e('0x34')](_0x14ed83[_0x834e('0x32')],_0x14ed83[_0x834e('0x2c')]);_0x297cce[_0x834e('0x33')]=_[_0x834e('0x34')](_0x14ed83[_0x834e('0x32')],qs['fields'](_0x460a7a[_0x834e('0x2c')]['fields']));_0x297cce[_0x834e('0x33')]=_0x297cce[_0x834e('0x33')]['length']?_0x297cce['attributes']:_0x14ed83[_0x834e('0x32')];if(!_0x460a7a[_0x834e('0x2c')][_0x834e('0x4b')](_0x834e('0x4c'))){_0x297cce[_0x834e('0x13')]=qs['limit'](_0x460a7a[_0x834e('0x2c')][_0x834e('0x13')]);_0x297cce[_0x834e('0x12')]=qs[_0x834e('0x12')](_0x460a7a[_0x834e('0x2c')][_0x834e('0x12')]);}_0x297cce[_0x834e('0x4d')]=qs[_0x834e('0x4e')](_0x460a7a[_0x834e('0x2c')][_0x834e('0x4e')]);_0x297cce['where']=qs[_0x834e('0x31')](_[_0x834e('0x4f')](_0x460a7a[_0x834e('0x2c')],_0x14ed83[_0x834e('0x31')]));_0x297cce['where'][_0x834e('0x50')]=_0x25d6f4['id'];if(_0x460a7a['query']['filter']){_0x297cce['where']=_[_0x834e('0x43')](_0x297cce[_0x834e('0x51')],{'$or':_['map'](_0x297cce[_0x834e('0x33')],function(_0x1b200d){var _0x4d4477={};_0x4d4477[_0x1b200d]={'$like':'%'+_0x460a7a[_0x834e('0x2c')][_0x834e('0x52')]+'%'};return _0x4d4477;})});}_0x297cce=_['merge']({},_0x297cce,_0x460a7a['options']);return db[_0x834e('0x53')][_0x834e('0x15')]({'where':_0x297cce[_0x834e('0x51')]})[_0x834e('0x18')](function(_0x1d8e7){_0x193a15['count']=_0x1d8e7;if(_0x460a7a[_0x834e('0x2c')]['includeAll']){_0x297cce[_0x834e('0x2b')]=[{'all':!![]}];}return db[_0x834e('0x53')][_0x834e('0x2d')](_0x297cce);})['then'](function(_0x33a3cd){_0x193a15[_0x834e('0x54')]=_0x33a3cd;return _0x193a15;});}})['then'](respondWithFilteredResult(_0x17b8e3,_0x297cce))[_0x834e('0x2e')](handleError(_0x17b8e3,null));};exports[_0x834e('0x55')]=function(_0xb4e130,_0x50d0a3){var _0x214014={'raw':!![],'where':{}};var _0x1d4e66={};var _0x402692={'count':0x0,'rows':[]};return db[_0x834e('0x26')][_0x834e('0x4a')]({'where':{'id':_0xb4e130[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x50d0a3,null))[_0x834e('0x18')](function(_0xd49002){if(_0xd49002){_0x1d4e66[_0x834e('0x32')]=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x1d4e66[_0x834e('0x2c')]=_[_0x834e('0x30')](_0xb4e130[_0x834e('0x2c')]);_0x1d4e66[_0x834e('0x31')]=_[_0x834e('0x34')](_0x1d4e66['model'],_0x1d4e66['query']);_0x214014[_0x834e('0x33')]=_[_0x834e('0x34')](_0x1d4e66[_0x834e('0x32')],qs[_0x834e('0x35')](_0xb4e130[_0x834e('0x2c')]['fields']));_0x214014[_0x834e('0x33')]=_0x214014[_0x834e('0x33')][_0x834e('0x36')]?_0x214014['attributes']:_0x1d4e66[_0x834e('0x32')];if(!_0xb4e130[_0x834e('0x2c')][_0x834e('0x4b')](_0x834e('0x4c'))){_0x214014[_0x834e('0x13')]=qs['limit'](_0xb4e130['query'][_0x834e('0x13')]);_0x214014[_0x834e('0x12')]=qs['offset'](_0xb4e130[_0x834e('0x2c')]['offset']);}_0x214014[_0x834e('0x4d')]=qs[_0x834e('0x4e')](_0xb4e130[_0x834e('0x2c')]['sort']);_0x214014[_0x834e('0x51')]=qs['filters'](_['pick'](_0xb4e130['query'],_0x1d4e66[_0x834e('0x31')]));_0x214014[_0x834e('0x51')][_0x834e('0x50')]=_0xd49002['id'];if(_0xb4e130[_0x834e('0x2c')][_0x834e('0x52')]){_0x214014[_0x834e('0x51')]=_[_0x834e('0x43')](_0x214014[_0x834e('0x51')],{'$or':_[_0x834e('0x1f')](_0x214014['attributes'],function(_0x2f775a){var _0x54e70d={};_0x54e70d[_0x2f775a]={'$like':'%'+_0xb4e130[_0x834e('0x2c')][_0x834e('0x52')]+'%'};return _0x54e70d;})});}_0x214014=_[_0x834e('0x43')]({},_0x214014,_0xb4e130[_0x834e('0x44')]);return db[_0x834e('0x56')][_0x834e('0x15')]({'where':_0x214014['where']})['then'](function(_0xeb096d){_0x402692[_0x834e('0x15')]=_0xeb096d;if(_0xb4e130['query'][_0x834e('0x42')]){_0x214014[_0x834e('0x2b')]=[{'all':!![]}];}return db[_0x834e('0x56')][_0x834e('0x2d')](_0x214014);})[_0x834e('0x18')](function(_0x5a75e3){_0x402692[_0x834e('0x54')]=_0x5a75e3;return _0x402692;});}})[_0x834e('0x18')](respondWithFilteredResult(_0x50d0a3,_0x214014))['catch'](handleError(_0x50d0a3,null));};exports['getHopperFinals']=function(_0x5ede29,_0x1e5252){var _0x1f3e26={'raw':!![],'where':{}};var _0x4f716d={};var _0x23ce49={'count':0x0,'rows':[]};return db[_0x834e('0x26')]['findOne']({'where':{'id':_0x5ede29[_0x834e('0x41')]['id']}})['then'](handleEntityNotFound(_0x1e5252,null))['then'](function(_0x41dfd9){if(_0x41dfd9){_0x4f716d[_0x834e('0x32')]=_[_0x834e('0x30')](db[_0x834e('0x57')]['rawAttributes']);_0x4f716d[_0x834e('0x2c')]=_[_0x834e('0x30')](_0x5ede29[_0x834e('0x2c')]);_0x4f716d[_0x834e('0x31')]=_[_0x834e('0x34')](_0x4f716d[_0x834e('0x32')],_0x4f716d[_0x834e('0x2c')]);_0x1f3e26[_0x834e('0x33')]=_[_0x834e('0x34')](_0x4f716d[_0x834e('0x32')],qs[_0x834e('0x35')](_0x5ede29[_0x834e('0x2c')][_0x834e('0x35')]));_0x1f3e26[_0x834e('0x33')]=_0x1f3e26[_0x834e('0x33')][_0x834e('0x36')]?_0x1f3e26[_0x834e('0x33')]:_0x4f716d[_0x834e('0x32')];if(!_0x5ede29[_0x834e('0x2c')][_0x834e('0x4b')](_0x834e('0x4c'))){_0x1f3e26[_0x834e('0x13')]=qs['limit'](_0x5ede29[_0x834e('0x2c')][_0x834e('0x13')]);_0x1f3e26[_0x834e('0x12')]=qs[_0x834e('0x12')](_0x5ede29[_0x834e('0x2c')][_0x834e('0x12')]);}_0x1f3e26[_0x834e('0x4d')]=qs[_0x834e('0x4e')](_0x5ede29[_0x834e('0x2c')]['sort']);_0x1f3e26['where']=qs['filters'](_[_0x834e('0x4f')](_0x5ede29['query'],_0x4f716d[_0x834e('0x31')]));_0x1f3e26[_0x834e('0x51')][_0x834e('0x50')]=_0x41dfd9['id'];if(_0x5ede29['query'][_0x834e('0x52')]){_0x1f3e26[_0x834e('0x51')]=_[_0x834e('0x43')](_0x1f3e26[_0x834e('0x51')],{'$or':_[_0x834e('0x1f')](_0x1f3e26[_0x834e('0x33')],function(_0x528052){var _0x10dd7b={};_0x10dd7b[_0x528052]={'$like':'%'+_0x5ede29[_0x834e('0x2c')][_0x834e('0x52')]+'%'};return _0x10dd7b;})});}_0x1f3e26=_[_0x834e('0x43')]({},_0x1f3e26,_0x5ede29[_0x834e('0x44')]);return db['CmHopperFinal']['count']({'where':_0x1f3e26['where']})['then'](function(_0x1dfa2e){_0x23ce49[_0x834e('0x15')]=_0x1dfa2e;if(_0x5ede29['query'][_0x834e('0x42')]){_0x1f3e26[_0x834e('0x2b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x834e('0x2d')](_0x1f3e26);})[_0x834e('0x18')](function(_0xbf7693){_0x23ce49[_0x834e('0x54')]=_0xbf7693;return _0x23ce49;});}})[_0x834e('0x18')](respondWithFilteredResult(_0x1e5252,_0x1f3e26))[_0x834e('0x2e')](handleError(_0x1e5252,null));};exports['getHopperBlacks']=function(_0x5a49fc,_0x43b92f){var _0x30ab20={'raw':!![],'where':{}};var _0x1d2e12={};var _0x58bdd6={'count':0x0,'rows':[]};return db[_0x834e('0x26')][_0x834e('0x4a')]({'where':{'id':_0x5a49fc['params']['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x43b92f,null))[_0x834e('0x18')](function(_0x216d1f){if(_0x216d1f){_0x1d2e12[_0x834e('0x32')]=_['keys'](db[_0x834e('0x58')]['rawAttributes']);_0x1d2e12['query']=_[_0x834e('0x30')](_0x5a49fc[_0x834e('0x2c')]);_0x1d2e12[_0x834e('0x31')]=_[_0x834e('0x34')](_0x1d2e12[_0x834e('0x32')],_0x1d2e12[_0x834e('0x2c')]);_0x30ab20['attributes']=_['intersection'](_0x1d2e12[_0x834e('0x32')],qs[_0x834e('0x35')](_0x5a49fc[_0x834e('0x2c')][_0x834e('0x35')]));_0x30ab20[_0x834e('0x33')]=_0x30ab20[_0x834e('0x33')][_0x834e('0x36')]?_0x30ab20['attributes']:_0x1d2e12[_0x834e('0x32')];if(!_0x5a49fc[_0x834e('0x2c')]['hasOwnProperty'](_0x834e('0x4c'))){_0x30ab20[_0x834e('0x13')]=qs[_0x834e('0x13')](_0x5a49fc[_0x834e('0x2c')][_0x834e('0x13')]);_0x30ab20[_0x834e('0x12')]=qs[_0x834e('0x12')](_0x5a49fc[_0x834e('0x2c')][_0x834e('0x12')]);}_0x30ab20[_0x834e('0x4d')]=qs[_0x834e('0x4e')](_0x5a49fc[_0x834e('0x2c')][_0x834e('0x4e')]);_0x30ab20[_0x834e('0x51')]=qs['filters'](_[_0x834e('0x4f')](_0x5a49fc[_0x834e('0x2c')],_0x1d2e12['filters']));_0x30ab20[_0x834e('0x51')]['VoiceQueueId']=_0x216d1f['id'];if(_0x5a49fc[_0x834e('0x2c')]['filter']){_0x30ab20[_0x834e('0x51')]=_['merge'](_0x30ab20[_0x834e('0x51')],{'$or':_[_0x834e('0x1f')](_0x30ab20[_0x834e('0x33')],function(_0x1aac37){var _0x57ee25={};_0x57ee25[_0x1aac37]={'$like':'%'+_0x5a49fc[_0x834e('0x2c')][_0x834e('0x52')]+'%'};return _0x57ee25;})});}_0x30ab20=_[_0x834e('0x43')]({},_0x30ab20,_0x5a49fc[_0x834e('0x44')]);return db[_0x834e('0x58')][_0x834e('0x15')]({'where':_0x30ab20[_0x834e('0x51')]})[_0x834e('0x18')](function(_0x2aa430){_0x58bdd6[_0x834e('0x15')]=_0x2aa430;if(_0x5a49fc[_0x834e('0x2c')][_0x834e('0x42')]){_0x30ab20[_0x834e('0x2b')]=[{'all':!![]}];}return db[_0x834e('0x58')][_0x834e('0x2d')](_0x30ab20);})[_0x834e('0x18')](function(_0xe84914){_0x58bdd6['rows']=_0xe84914;return _0x58bdd6;});}})['then'](respondWithFilteredResult(_0x43b92f,_0x30ab20))[_0x834e('0x2e')](handleError(_0x43b92f,null));};exports[_0x834e('0x59')]=function(_0x3f52b9,_0x213303){var _0x3bf1b6={};var _0x31f336={};var _0x22f90d;var _0x40fd40;return db[_0x834e('0x26')][_0x834e('0x4a')]({'where':{'id':_0x3f52b9[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x213303,null))['then'](function(_0x1bd254){if(_0x1bd254){_0x22f90d=_0x1bd254;_0x31f336['model']=_[_0x834e('0x30')](db[_0x834e('0x5a')][_0x834e('0x27')]);_0x31f336['query']=_[_0x834e('0x30')](_0x3f52b9[_0x834e('0x2c')]);_0x31f336['filters']=_['intersection'](_0x31f336[_0x834e('0x32')],_0x31f336[_0x834e('0x2c')]);_0x3bf1b6['attributes']=_[_0x834e('0x34')](_0x31f336[_0x834e('0x32')],qs[_0x834e('0x35')](_0x3f52b9[_0x834e('0x2c')][_0x834e('0x35')]));_0x3bf1b6['attributes']=_0x3bf1b6['attributes'][_0x834e('0x36')]?_0x3bf1b6['attributes']:_0x31f336['model'];_0x3bf1b6['order']=qs[_0x834e('0x4e')](_0x3f52b9[_0x834e('0x2c')]['sort']);_0x3bf1b6[_0x834e('0x51')]=qs[_0x834e('0x31')](_[_0x834e('0x4f')](_0x3f52b9[_0x834e('0x2c')],_0x31f336['filters']));if(_0x3f52b9[_0x834e('0x2c')][_0x834e('0x52')]){_0x3bf1b6[_0x834e('0x51')]=_['merge'](_0x3bf1b6[_0x834e('0x51')],{'$or':_['map'](_0x3bf1b6[_0x834e('0x33')],function(_0x4af2a2){var _0x461420={};_0x461420[_0x4af2a2]={'$like':'%'+_0x3f52b9[_0x834e('0x2c')]['filter']+'%'};return _0x461420;})});}_0x3bf1b6=_[_0x834e('0x43')]({},_0x3bf1b6,_0x3f52b9[_0x834e('0x44')]);return _0x22f90d[_0x834e('0x59')](_0x3bf1b6);}})[_0x834e('0x18')](function(_0x410895){if(_0x410895){_0x40fd40=_0x410895[_0x834e('0x36')];if(!_0x3f52b9['query'][_0x834e('0x4b')](_0x834e('0x4c'))){_0x3bf1b6[_0x834e('0x13')]=qs[_0x834e('0x13')](_0x3f52b9[_0x834e('0x2c')][_0x834e('0x13')]);_0x3bf1b6['offset']=qs[_0x834e('0x12')](_0x3f52b9['query']['offset']);}return _0x22f90d[_0x834e('0x59')](_0x3bf1b6);}})['then'](function(_0x4c5da4){if(_0x4c5da4){return _0x4c5da4?{'count':_0x40fd40,'rows':_0x4c5da4}:null;}})[_0x834e('0x18')](respondWithResult(_0x213303,null))[_0x834e('0x2e')](handleError(_0x213303,null));};exports[_0x834e('0x5b')]=function(_0x2e5886,_0x38fbc4){var _0x3e0ee6=_0x2e5886[_0x834e('0x38')][_0x834e('0x5c')];var _0x1d3ca9=_[_0x834e('0x1f')](_0x3e0ee6,'id');return db[_0x834e('0x5a')][_0x834e('0x2d')]({'where':{'id':_0x1d3ca9},'attributes':['id'],'include':[{'model':db[_0x834e('0x5d')],'as':_0x834e('0x5e'),'attributes':['id','name',_0x834e('0x5f'),'voicePause',_0x834e('0x60')],'raw':!![]}]})[_0x834e('0x18')](function(_0x284412){if(_0x284412){var _0x2cdbe0=_['flatMap'](_0x284412,function(_0x5f558a){var _0x37d8dd=_0x5f558a[_0x834e('0x1a')]({'plain':!![]});_0x37d8dd['Agents'][_0x834e('0x61')](function(_0xfa7b14){_0xfa7b14['penalty']=_[_0x834e('0x3c')](_0x3e0ee6,{'id':_0x37d8dd['id']})[_0x834e('0x62')];});return _0x37d8dd[_0x834e('0x5e')];});return db[_0x834e('0x26')]['find']({'where':{'id':_0x2e5886['params']['id']}})['then'](function(_0x48e14c){return db[_0x834e('0x63')][_0x834e('0x64')](function(_0x47891e){return _0x48e14c[_0x834e('0x5b')](_0x1d3ca9,{'transaction':_0x47891e})['then'](function(){return BPromise[_0x834e('0x65')](_0x3e0ee6,function(_0x13b39a){return db[_0x834e('0x66')][_0x834e('0x67')]({'TeamId':_0x13b39a['id'],'VoiceQueueId':_0x2e5886[_0x834e('0x41')]['id'],'penalty':_0x13b39a[_0x834e('0x62')]},{'transaction':_0x47891e});});})[_0x834e('0x18')](function(){return BPromise['each'](_0x2cdbe0,function(_0x12a0f3){return db[_0x834e('0x68')]['findOrCreate']({'where':{'UserId':_0x12a0f3['id'],'VoiceQueueId':_0x2e5886[_0x834e('0x41')]['id']},'defaults':{'penalty':_0x12a0f3[_0x834e('0x62')]},'transaction':_0x47891e});});})['then'](function(){return BPromise['each'](_['filter'](_0x2cdbe0,{'online':!![]}),function(_0x3edbbb){return db[_0x834e('0x69')][_0x834e('0x67')]({'membername':_0x3edbbb['name'],'UserId':_0x3edbbb['id'],'queue_name':_0x48e14c[_0x834e('0x25')],'VoiceQueueId':_0x48e14c['id'],'interface':_[_0x834e('0x6a')](_0x3edbbb[_0x834e('0x60')])?util[_0x834e('0x6b')](_0x834e('0x6c'),_0x3edbbb[_0x834e('0x25')]):_0x3edbbb[_0x834e('0x60')],'paused':_0x3edbbb[_0x834e('0x6d')]||![],'penalty':_0x3edbbb[_0x834e('0x62')]},{'transaction':_0x47891e});});})[_0x834e('0x18')](function(){_0x2cdbe0['forEach'](function(_0x5d6b66){socket[_0x834e('0x6e')](_0x834e('0x6f'),{'UserId':_0x5d6b66['id'],'VoiceQueueId':_0x48e14c['id']});});});});});}})[_0x834e('0x18')](respondWithStatusCode(_0x38fbc4,null))[_0x834e('0x2e')](handleError(_0x38fbc4,null));};exports[_0x834e('0x70')]=function(_0xd22e8f,_0x281922){return db[_0x834e('0x5a')][_0x834e('0x2d')]({'where':{'id':_0xd22e8f[_0x834e('0x2c')][_0x834e('0x71')]},'attributes':['id'],'include':[{'model':db[_0x834e('0x5d')],'as':_0x834e('0x5e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x281922,null))[_0x834e('0x18')](function(_0x3b13be){var _0x3f5b2e=_[_0x834e('0x1f')](_0x3b13be,'id');var _0x495697=[];var _0x5943a3=[];var _0x4e7c43=squel[_0x834e('0x72')]();_0x4e7c43[_0x834e('0x73')](_0x834e('0x74'))[_0x834e('0x75')](_0x834e('0x76'),'tq')[_0x834e('0x77')](_0x834e('0x78'),'ut',_0x834e('0x79'))['where']('VoiceQueueId\x20=\x20?',_0xd22e8f['params']['id']);for(var _0x5a5602=0x0;_0x5a5602<_0x3b13be[_0x834e('0x36')];_0x5a5602+=0x1){let _0xd108fa=_0x3b13be[_0x5a5602];for(var _0x37defd=0x0;_0x37defd<_0xd108fa[_0x834e('0x5e')][_0x834e('0x36')];_0x37defd+=0x1){let _0x386e10=_0xd108fa[_0x834e('0x5e')][_0x37defd];var _0x29ef2f=_0x4e7c43[_0x834e('0x7a')]();_0x29ef2f['where']('ut.UserId\x20=\x20?',_0x386e10['id']);_0x5943a3['push'](db['sequelize'][_0x834e('0x2c')](_0x29ef2f[_0x834e('0x7b')](),{'type':db[_0x834e('0x63')][_0x834e('0x7c')][_0x834e('0x7d')]})[_0x834e('0x18')](function(_0x416bea){if(_0x416bea[_0x834e('0x36')]===0x1){return _0x386e10['id'];}else{var _0x86d08c=_[_0x834e('0x7e')](_[_0x834e('0x1f')](_0x416bea,_0x834e('0x7f')),function(_0x1fd72b){return _[_0x834e('0x80')](_0x3f5b2e,_0x1fd72b);});if(_0x86d08c){return _0x386e10['id'];}}}));}}return BPromise[_0x834e('0x81')](_0x5943a3)[_0x834e('0x18')](function(_0x5022f2){_0x495697=_(_0x495697)[_0x834e('0x82')](_0x5022f2)['compact']()[_0x834e('0x20')]();return db[_0x834e('0x26')][_0x834e('0x3c')]({'where':{'id':_0xd22e8f['params']['id']}})[_0x834e('0x18')](function(_0x3d9d85){return db['sequelize']['transaction'](function(_0x1c3b23){return _0x3d9d85[_0x834e('0x70')](_0xd22e8f[_0x834e('0x2c')][_0x834e('0x71')],{'transaction':_0x1c3b23})[_0x834e('0x18')](function(){if(!_[_0x834e('0x83')](_0x495697)){return _0x3d9d85[_0x834e('0x84')](_0x495697,{'transaction':_0x1c3b23})[_0x834e('0x18')](function(){return db['UserVoiceQueueRt'][_0x834e('0x19')]({'where':{'VoiceQueueId':_0xd22e8f[_0x834e('0x41')]['id'],'UserId':_0x495697},'transaction':_0x1c3b23});});}})[_0x834e('0x18')](function(){_0x495697[_0x834e('0x61')](function(_0x1912e6){socket[_0x834e('0x6e')](_0x834e('0x85'),{'UserId':_0x1912e6,'VoiceQueueId':_0x3d9d85['id']});});});});});});})['then'](respondWithStatusCode(_0x281922,null))[_0x834e('0x2e')](handleError(_0x281922,null));};exports['addAgents']=function(_0x586fa5,_0x1115b7){var _0x1e0bc9,_0x4b16fa;return db[_0x834e('0x26')][_0x834e('0x3c')]({'where':{'id':_0x586fa5['params']['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x1115b7,null))[_0x834e('0x18')](function(_0x5d994e){if(_0x5d994e){_0x4b16fa=_0x5d994e;return _0x5d994e['addAgents'](_0x586fa5[_0x834e('0x38')][_0x834e('0x71')],_['omit'](_0x586fa5['body'],[_0x834e('0x71'),'id'])||{})[_0x834e('0x86')](function(_0x5d6f5e){for(var _0x480290=0x0;_0x480290<_0x586fa5['body']['ids'][_0x834e('0x36')];_0x480290+=0x1){socket['emit'](_0x834e('0x6f'),{'UserId':Number(_0x586fa5['body'][_0x834e('0x71')][_0x480290]),'VoiceQueueId':Number(_0x586fa5[_0x834e('0x41')]['id'])});}return _0x5d6f5e;});}})[_0x834e('0x18')](function(_0x3d2569){_0x1e0bc9=_0x3d2569||[];if(_0x4b16fa){return db['User'][_0x834e('0x2d')]({'where':{'id':_0x586fa5[_0x834e('0x38')][_0x834e('0x71')]},'attributes':['id',_0x834e('0x25'),_0x834e('0x5f'),_0x834e('0x6d'),_0x834e('0x60')],'raw':!![]});}})[_0x834e('0x18')](function(_0x464ae6){if(!_[_0x834e('0x83')](_0x464ae6)){var _0x590e52=[];for(var _0x40e12e=0x0;_0x40e12e<_0x464ae6['length'];_0x40e12e++){if(_0x464ae6[_0x40e12e][_0x834e('0x5f')]){_0x590e52[_0x834e('0x87')](db[_0x834e('0x69')][_0x834e('0x67')]({'membername':_0x464ae6[_0x40e12e][_0x834e('0x25')],'UserId':_0x464ae6[_0x40e12e]['id'],'queue_name':_0x4b16fa['name'],'VoiceQueueId':_0x4b16fa['id'],'interface':_[_0x834e('0x6a')](_0x464ae6[_0x40e12e]['interface'])?util['format'](_0x834e('0x6c'),_0x464ae6[_0x40e12e][_0x834e('0x25')]):_0x464ae6[_0x40e12e][_0x834e('0x60')],'paused':_0x464ae6[_0x40e12e]['voicePause']||![],'penalty':_0x586fa5[_0x834e('0x38')][_0x834e('0x62')]||0x0}));}}return BPromise[_0x834e('0x81')](_0x590e52);}})[_0x834e('0x18')](function(){return _0x1e0bc9;})[_0x834e('0x18')](respondWithResult(_0x1115b7,null))[_0x834e('0x2e')](handleError(_0x1115b7,null));};exports[_0x834e('0x84')]=function(_0x687dab,_0x125787){return db[_0x834e('0x26')][_0x834e('0x3c')]({'where':{'id':_0x687dab['params']['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x125787,null))[_0x834e('0x18')](function(_0x121d4f){if(_0x121d4f){return _0x121d4f[_0x834e('0x84')](_0x687dab[_0x834e('0x2c')][_0x834e('0x71')])['then'](function(){if(_[_0x834e('0x88')](_0x687dab[_0x834e('0x2c')][_0x834e('0x71')])){for(var _0x37dea1=0x0;_0x37dea1<_0x687dab[_0x834e('0x2c')][_0x834e('0x71')][_0x834e('0x36')];_0x37dea1+=0x1){socket[_0x834e('0x6e')](_0x834e('0x85'),{'UserId':Number(_0x687dab[_0x834e('0x2c')]['ids'][_0x37dea1]),'VoiceQueueId':Number(_0x687dab['params']['id'])});}}else{socket[_0x834e('0x6e')]('userVoiceQueue:remove',{'UserId':Number(_0x687dab[_0x834e('0x2c')][_0x834e('0x71')]),'VoiceQueueId':Number(_0x687dab[_0x834e('0x41')]['id'])});}});}})[_0x834e('0x18')](function(_0x1daa58){return db[_0x834e('0x69')]['destroy']({'where':{'VoiceQueueId':_0x687dab[_0x834e('0x41')]['id'],'UserId':_0x687dab['query']['ids']}})['then'](function(){return _0x1daa58;});})[_0x834e('0x18')](respondWithStatusCode(_0x125787,null))[_0x834e('0x2e')](handleError(_0x125787,null));};exports['getAgents']=function(_0x5cb379,_0x494e08){var _0x2515f6={};var _0x45c8e6={};var _0x3512d8;var _0x5e0bfe;return db[_0x834e('0x26')][_0x834e('0x4a')]({'where':{'id':_0x5cb379[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x494e08,null))[_0x834e('0x18')](function(_0x3c1a19){if(_0x3c1a19){_0x3512d8=_0x3c1a19;_0x45c8e6['model']=_['keys'](db['User']['rawAttributes']);_0x45c8e6[_0x834e('0x2c')]=_[_0x834e('0x30')](_0x5cb379[_0x834e('0x2c')]);_0x45c8e6[_0x834e('0x31')]=_[_0x834e('0x34')](_0x45c8e6[_0x834e('0x32')],_0x45c8e6[_0x834e('0x2c')]);_0x2515f6[_0x834e('0x33')]=_[_0x834e('0x34')](_0x45c8e6[_0x834e('0x32')],qs[_0x834e('0x35')](_0x5cb379[_0x834e('0x2c')][_0x834e('0x35')]));_0x2515f6[_0x834e('0x33')]=_0x2515f6[_0x834e('0x33')]['length']?_0x2515f6['attributes']:_0x45c8e6[_0x834e('0x32')];_0x2515f6[_0x834e('0x4d')]=qs[_0x834e('0x4e')](_0x5cb379['query'][_0x834e('0x4e')]);_0x2515f6[_0x834e('0x51')]=qs[_0x834e('0x31')](_[_0x834e('0x4f')](_0x5cb379[_0x834e('0x2c')],_0x45c8e6[_0x834e('0x31')]));if(_0x5cb379[_0x834e('0x2c')][_0x834e('0x52')]){_0x2515f6[_0x834e('0x51')]=_['merge'](_0x2515f6[_0x834e('0x51')],{'$or':_[_0x834e('0x1f')](_0x2515f6[_0x834e('0x33')],function(_0x2f1de8){var _0x4b6834={};_0x4b6834[_0x2f1de8]={'$like':'%'+_0x5cb379[_0x834e('0x2c')][_0x834e('0x52')]+'%'};return _0x4b6834;})});}_0x2515f6=_[_0x834e('0x43')]({},_0x2515f6,_0x5cb379[_0x834e('0x44')]);return _0x3512d8[_0x834e('0x89')](_0x2515f6);}})[_0x834e('0x18')](function(_0x3f6ead){if(_0x3f6ead){_0x5e0bfe=_0x3f6ead[_0x834e('0x36')];if(!_0x5cb379[_0x834e('0x2c')]['hasOwnProperty'](_0x834e('0x4c'))){_0x2515f6['limit']=qs[_0x834e('0x13')](_0x5cb379['query'][_0x834e('0x13')]);_0x2515f6[_0x834e('0x12')]=qs[_0x834e('0x12')](_0x5cb379[_0x834e('0x2c')][_0x834e('0x12')]);}return _0x3512d8['getAgents'](_0x2515f6);}})[_0x834e('0x18')](function(_0x29f970){if(_0x29f970){return _0x29f970?{'count':_0x5e0bfe,'rows':_0x29f970}:null;}})['then'](respondWithResult(_0x494e08,null))['catch'](handleError(_0x494e08,null));};exports[_0x834e('0x8a')]=function(_0x4db3c5,_0x4e6a75){var _0x57a989={};var _0x26cb93={};var _0x39bd0c;var _0xbd9400;return db[_0x834e('0x26')][_0x834e('0x4a')]({'where':{'id':_0x4db3c5[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x4e6a75,null))['then'](function(_0x28825c){if(_0x28825c){_0x39bd0c=_0x28825c;_0x26cb93[_0x834e('0x32')]=_['keys'](db['UserVoiceQueueRt'][_0x834e('0x27')]);_0x26cb93[_0x834e('0x2c')]=_['keys'](_0x4db3c5['query']);_0x26cb93[_0x834e('0x31')]=_[_0x834e('0x34')](_0x26cb93[_0x834e('0x32')],_0x26cb93['query']);_0x57a989[_0x834e('0x33')]=_[_0x834e('0x34')](_0x26cb93[_0x834e('0x32')],qs['fields'](_0x4db3c5[_0x834e('0x2c')]['fields']));_0x57a989[_0x834e('0x33')]=_0x57a989[_0x834e('0x33')][_0x834e('0x36')]?_0x57a989[_0x834e('0x33')]:_0x26cb93[_0x834e('0x32')];_0x57a989['order']=qs[_0x834e('0x4e')](_0x4db3c5[_0x834e('0x2c')][_0x834e('0x4e')]);_0x57a989[_0x834e('0x51')]=qs[_0x834e('0x31')](_['pick'](_0x4db3c5['query'],_0x26cb93[_0x834e('0x31')]));if(_0x4db3c5[_0x834e('0x2c')][_0x834e('0x52')]){_0x57a989['where']=_[_0x834e('0x43')](_0x57a989[_0x834e('0x51')],{'$or':_[_0x834e('0x1f')](_0x57a989[_0x834e('0x33')],function(_0x53faec){var _0x3cc563={};_0x3cc563[_0x53faec]={'$like':'%'+_0x4db3c5[_0x834e('0x2c')]['filter']+'%'};return _0x3cc563;})});}_0x57a989=_[_0x834e('0x43')]({},_0x57a989,_0x4db3c5[_0x834e('0x44')]);return _0x39bd0c[_0x834e('0x8a')](_0x57a989);}})[_0x834e('0x18')](function(_0x4b0246){if(_0x4b0246){_0xbd9400=_0x4b0246[_0x834e('0x36')];if(!_0x4db3c5['query'][_0x834e('0x4b')](_0x834e('0x4c'))){_0x57a989[_0x834e('0x13')]=qs[_0x834e('0x13')](_0x4db3c5[_0x834e('0x2c')][_0x834e('0x13')]);_0x57a989['offset']=qs['offset'](_0x4db3c5[_0x834e('0x2c')][_0x834e('0x12')]);}return _0x39bd0c['getMembers'](_0x57a989);}})[_0x834e('0x18')](function(_0x4af796){return _0x4af796?{'count':_0xbd9400,'rows':_0x4af796}:null;})[_0x834e('0x18')](respondWithResult(_0x4e6a75,null))[_0x834e('0x2e')](handleError(_0x4e6a75,null));};exports[_0x834e('0x8b')]=function(_0x151b58,_0x2ec7b0){var _0x1ca24b={};var _0x36836f={};var _0x56ae60;var _0x122b03;return db[_0x834e('0x26')][_0x834e('0x4a')]({'where':{'id':_0x151b58[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x2ec7b0,null))['then'](function(_0x167642){if(_0x167642){_0x56ae60=_0x167642;_0x36836f[_0x834e('0x32')]=_[_0x834e('0x30')](db['CmList']['rawAttributes']);_0x36836f['query']=_[_0x834e('0x30')](_0x151b58[_0x834e('0x2c')]);_0x36836f[_0x834e('0x31')]=_[_0x834e('0x34')](_0x36836f[_0x834e('0x32')],_0x36836f[_0x834e('0x2c')]);_0x1ca24b[_0x834e('0x33')]=_[_0x834e('0x34')](_0x36836f[_0x834e('0x32')],qs[_0x834e('0x35')](_0x151b58[_0x834e('0x2c')]['fields']));_0x1ca24b[_0x834e('0x33')]=_0x1ca24b[_0x834e('0x33')][_0x834e('0x36')]?_0x1ca24b[_0x834e('0x33')]:_0x36836f[_0x834e('0x32')];_0x1ca24b[_0x834e('0x4d')]=qs[_0x834e('0x4e')](_0x151b58[_0x834e('0x2c')]['sort']);_0x1ca24b[_0x834e('0x51')]=qs[_0x834e('0x31')](_['pick'](_0x151b58[_0x834e('0x2c')],_0x36836f[_0x834e('0x31')]));if(_0x151b58[_0x834e('0x2c')][_0x834e('0x52')]){_0x1ca24b['where']=_['merge'](_0x1ca24b[_0x834e('0x51')],{'$or':_['map'](_0x1ca24b[_0x834e('0x33')],function(_0x433cb4){var _0x18638d={};_0x18638d[_0x433cb4]={'$like':'%'+_0x151b58[_0x834e('0x2c')][_0x834e('0x52')]+'%'};return _0x18638d;})});}_0x1ca24b=_['merge']({},_0x1ca24b,_0x151b58[_0x834e('0x44')]);return _0x56ae60['getLists'](_0x1ca24b);}})['then'](function(_0x3d8b08){if(_0x3d8b08){_0x122b03=_0x3d8b08[_0x834e('0x36')];if(!_0x151b58[_0x834e('0x2c')][_0x834e('0x4b')](_0x834e('0x4c'))){_0x1ca24b[_0x834e('0x13')]=qs['limit'](_0x151b58[_0x834e('0x2c')][_0x834e('0x13')]);_0x1ca24b['offset']=qs[_0x834e('0x12')](_0x151b58[_0x834e('0x2c')]['offset']);}return _0x56ae60[_0x834e('0x8b')](_0x1ca24b);}})[_0x834e('0x18')](function(_0x47a239){if(_0x47a239){return _0x47a239?{'count':_0x122b03,'rows':_0x47a239}:null;}})[_0x834e('0x18')](respondWithResult(_0x2ec7b0,null))[_0x834e('0x2e')](handleError(_0x2ec7b0,null));};exports[_0x834e('0x8c')]=function(_0x3b658a,_0x34a13d){var _0x29b8fd=moment()[_0x834e('0x6b')](_0x834e('0x8d'));var _0x208bbe,_0xe0b3;return db['VoiceQueue'][_0x834e('0x3c')]({'where':{'id':_0x3b658a[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x34a13d,null))[_0x834e('0x18')](function(_0x371767){if(_0x371767){_0xe0b3=_0x371767;return _0x371767[_0x834e('0x8c')](_0x3b658a[_0x834e('0x38')][_0x834e('0x71')],_[_0x834e('0x45')](_0x3b658a[_0x834e('0x38')],[_0x834e('0x71'),'id'])||{});}return null;})[_0x834e('0x86')](function(_0x5af6fc){var _0x2ddbc0;_0x208bbe=_0x5af6fc||[];var _0x1cd122=[];if(_0x5af6fc){for(var _0x49be08=0x0;_0x49be08<_0x5af6fc['length'];_0x49be08+=0x1){var _0x563f20=_0x5af6fc[_0x49be08][_0x834e('0x1a')]({'plain':!![]});_0xe0b3[_0x834e('0x8e')]=_0x3b658a[_0x834e('0x38')][_0x834e('0x8e')]?_0x3b658a[_0x834e('0x38')][_0x834e('0x8e')]:_0xe0b3[_0x834e('0x8e')];switch(_0xe0b3['dialCheckDuplicateType']){case'always':_0x2ddbc0=squel['insert']()['into'](_0x834e('0x8f'))[_0x834e('0x90')]([_0x834e('0x91'),'scheduledAt','ContactId','ListId',_0x834e('0x50'),'createdAt','updatedAt'],squel[_0x834e('0x72')]()[_0x834e('0x73')](_0x834e('0x91'),_0x834e('0x91'))[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27',_0x834e('0x92'))[_0x834e('0x73')]('id','ContactId')[_0x834e('0x73')](_0x563f20[_0x834e('0x93')][_0x834e('0x7b')](),_0x834e('0x94'))[_0x834e('0x73')](_0x3b658a['params']['id'][_0x834e('0x7b')](),'VoiceQueueId')[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27',_0x834e('0x46'))[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27','updatedAt')['from']('cm_contacts')['where'](_0x834e('0x95'))[_0x834e('0x51')]('ListId\x20=\x20?',_0x563f20['CmListId'][_0x834e('0x7b')]())[_0x834e('0x51')](_0x834e('0x96'))['where'](_0x834e('0x97'),squel[_0x834e('0x72')]()[_0x834e('0x73')]('COALESCE(calleridnum,\x27\x27)')[_0x834e('0x75')](_0x834e('0x98'))[_0x834e('0x51')](_0x834e('0x99'),_0x3b658a[_0x834e('0x41')]['id'][_0x834e('0x7b')]()))[_0x834e('0x51')]('phone\x20NOT\x20IN\x20(?)',squel[_0x834e('0x72')]()[_0x834e('0x73')](_0x834e('0x9a'))['from'](_0x834e('0x8f'))[_0x834e('0x51')](_0x834e('0x99'),_0x3b658a[_0x834e('0x41')]['id'][_0x834e('0x7b')]())))[_0x834e('0x7b')]();break;case _0x834e('0x9b'):_0x2ddbc0=squel[_0x834e('0x9c')]()[_0x834e('0x9d')](_0x834e('0x8f'))[_0x834e('0x90')]([_0x834e('0x91'),'scheduledAt',_0x834e('0x9e'),'ListId',_0x834e('0x50'),'createdAt',_0x834e('0x47')],squel[_0x834e('0x72')]()[_0x834e('0x73')](_0x834e('0x91'),_0x834e('0x91'))[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27',_0x834e('0x92'))[_0x834e('0x73')]('id','ContactId')['field'](_0x563f20['CmListId'][_0x834e('0x7b')](),_0x834e('0x94'))[_0x834e('0x73')](_0x3b658a[_0x834e('0x41')]['id'][_0x834e('0x7b')](),_0x834e('0x50'))[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27',_0x834e('0x46'))['field']('\x27'+_0x29b8fd+'\x27','updatedAt')[_0x834e('0x75')](_0x834e('0x9f'))[_0x834e('0x51')]('deletedAt\x20IS\x20NULL')['where'](_0x834e('0xa0'),_0x563f20['CmListId'][_0x834e('0x7b')]())[_0x834e('0x51')](_0x834e('0x96'))['where'](_0x834e('0x97'),squel[_0x834e('0x72')]()[_0x834e('0x73')](_0x834e('0x9a'))[_0x834e('0x75')](_0x834e('0x8f'))[_0x834e('0x51')]('VoiceQueueId\x20=\x20?',_0x3b658a[_0x834e('0x41')]['id'][_0x834e('0x7b')]())))[_0x834e('0x7b')]();break;default:_0x2ddbc0=squel[_0x834e('0x9c')]()[_0x834e('0x9d')](_0x834e('0x8f'))[_0x834e('0x90')](['phone','scheduledAt',_0x834e('0x9e'),'ListId','VoiceQueueId',_0x834e('0x46'),_0x834e('0x47')],squel['select']()[_0x834e('0x73')]('phone','phone')[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27','scheduledAt')[_0x834e('0x73')]('id',_0x834e('0x9e'))[_0x834e('0x73')](_0x563f20[_0x834e('0x93')][_0x834e('0x7b')](),_0x834e('0x94'))[_0x834e('0x73')](_0x3b658a[_0x834e('0x41')]['id'][_0x834e('0x7b')](),'VoiceQueueId')[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27',_0x834e('0x46'))[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27',_0x834e('0x47'))['from']('cm_contacts')[_0x834e('0x51')](_0x834e('0x95'))['where'](_0x834e('0xa0'),_0x563f20['CmListId'][_0x834e('0x7b')]())[_0x834e('0x51')](_0x834e('0x96')))[_0x834e('0x7b')]();}_0x1cd122[_0x834e('0x87')](db[_0x834e('0x63')]['query'](_0x2ddbc0));}return BPromise['all'](_0x1cd122);}})['then'](function(){var _0xbafedb=[];var _0x1d004f=squel[_0x834e('0x9c')]()['into']('cm_hopper_additional_phones')[_0x834e('0x90')]([_0x834e('0xa1'),_0x834e('0x91'),_0x834e('0xa2'),_0x834e('0x46'),_0x834e('0x47')],squel[_0x834e('0x72')]()[_0x834e('0x73')](_0x834e('0xa3'))[_0x834e('0x73')](_0x834e('0xa4'))['field'](_0x834e('0xa5'))[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27','createdAt')[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27',_0x834e('0x47'))[_0x834e('0x75')](_0x834e('0xa6'),'ci')[_0x834e('0x77')](_0x834e('0x8f'),'h',_0x834e('0xa7'))[_0x834e('0x51')](_0x834e('0xa8'),_0x29b8fd)[_0x834e('0x51')](_0x834e('0xa9'),_0x834e('0xaa')))[_0x834e('0x7b')]();_0xbafedb[_0x834e('0x87')](db[_0x834e('0x63')][_0x834e('0x2c')](_0x1d004f));return BPromise[_0x834e('0x81')](_0xbafedb);})[_0x834e('0x18')](function(){return _0x208bbe;})[_0x834e('0x18')](respondWithResult(_0x34a13d,null))[_0x834e('0x2e')](handleError(_0x34a13d,null));};exports[_0x834e('0xab')]=function(_0x239efd,_0x2f7170){return db['VoiceQueue'][_0x834e('0x3c')]({'where':{'id':_0x239efd[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x2f7170,null))[_0x834e('0x18')](function(_0x3fd7a3){if(_0x3fd7a3){return _0x3fd7a3[_0x834e('0xab')](_0x239efd[_0x834e('0x2c')][_0x834e('0x71')]);}})[_0x834e('0x18')](function(_0x41d0a7){if(_0x41d0a7){return db[_0x834e('0x53')][_0x834e('0x19')]({'where':{'ListId':_0x239efd['query'][_0x834e('0x71')],'VoiceQueueId':_0x239efd[_0x834e('0x41')]['id']}})['then'](function(){return _0x41d0a7;});}})[_0x834e('0x18')](respondWithStatusCode(_0x2f7170,null))[_0x834e('0x2e')](handleError(_0x2f7170,null));};exports['getBlackLists']=function(_0x16a7a9,_0x18b8c7){var _0x576ece={};var _0x51c877={};var _0x54915f;var _0x32d06c;return db[_0x834e('0x26')][_0x834e('0x4a')]({'where':{'id':_0x16a7a9[_0x834e('0x41')]['id']}})['then'](handleEntityNotFound(_0x18b8c7,null))[_0x834e('0x18')](function(_0x132711){if(_0x132711){_0x54915f=_0x132711;_0x51c877[_0x834e('0x32')]=_['keys'](db[_0x834e('0xac')][_0x834e('0x27')]);_0x51c877[_0x834e('0x2c')]=_['keys'](_0x16a7a9[_0x834e('0x2c')]);_0x51c877[_0x834e('0x31')]=_['intersection'](_0x51c877[_0x834e('0x32')],_0x51c877[_0x834e('0x2c')]);_0x576ece['attributes']=_[_0x834e('0x34')](_0x51c877[_0x834e('0x32')],qs[_0x834e('0x35')](_0x16a7a9[_0x834e('0x2c')][_0x834e('0x35')]));_0x576ece['attributes']=_0x576ece['attributes'][_0x834e('0x36')]?_0x576ece[_0x834e('0x33')]:_0x51c877[_0x834e('0x32')];_0x576ece['order']=qs[_0x834e('0x4e')](_0x16a7a9[_0x834e('0x2c')][_0x834e('0x4e')]);_0x576ece[_0x834e('0x51')]=qs[_0x834e('0x31')](_[_0x834e('0x4f')](_0x16a7a9['query'],_0x51c877[_0x834e('0x31')]));if(_0x16a7a9[_0x834e('0x2c')][_0x834e('0x52')]){_0x576ece[_0x834e('0x51')]=_[_0x834e('0x43')](_0x576ece['where'],{'$or':_['map'](_0x576ece[_0x834e('0x33')],function(_0x5eca84){var _0xcb4fe4={};_0xcb4fe4[_0x5eca84]={'$like':'%'+_0x16a7a9[_0x834e('0x2c')][_0x834e('0x52')]+'%'};return _0xcb4fe4;})});}_0x576ece=_[_0x834e('0x43')]({},_0x576ece,_0x16a7a9[_0x834e('0x44')]);return _0x54915f[_0x834e('0xad')](_0x576ece);}})[_0x834e('0x18')](function(_0x5b4718){if(_0x5b4718){_0x32d06c=_0x5b4718[_0x834e('0x36')];if(!_0x16a7a9[_0x834e('0x2c')]['hasOwnProperty'](_0x834e('0x4c'))){_0x576ece[_0x834e('0x13')]=qs[_0x834e('0x13')](_0x16a7a9['query'][_0x834e('0x13')]);_0x576ece['offset']=qs[_0x834e('0x12')](_0x16a7a9['query'][_0x834e('0x12')]);}return _0x54915f[_0x834e('0xad')](_0x576ece);}})['then'](function(_0x3757bf){if(_0x3757bf){return _0x3757bf?{'count':_0x32d06c,'rows':_0x3757bf}:null;}})['then'](respondWithResult(_0x18b8c7,null))[_0x834e('0x2e')](handleError(_0x18b8c7,null));};exports[_0x834e('0xae')]=function(_0x395b48,_0x5b4208){var _0x4c9b90;return db[_0x834e('0x26')][_0x834e('0x3c')]({'where':{'id':_0x395b48[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x5b4208,null))[_0x834e('0x18')](function(_0x414ff2){if(_0x414ff2){return _0x414ff2[_0x834e('0xae')](_0x395b48[_0x834e('0x38')][_0x834e('0x71')],_[_0x834e('0x45')](_0x395b48[_0x834e('0x38')],[_0x834e('0x71'),'id'])||{});}return null;})[_0x834e('0x86')](function(_0x3aeca7){var _0x1d9e00;_0x4c9b90=_0x3aeca7||[];var _0x11db76=[];if(_0x3aeca7){for(var _0x37f058=0x0;_0x37f058<_0x3aeca7[_0x834e('0x36')];_0x37f058+=0x1){var _0x354497=_0x3aeca7[_0x37f058]['get']({'plain':!![]});_0x1d9e00=squel[_0x834e('0x9c')]()['into'](_0x834e('0xaf'))[_0x834e('0x90')]([_0x834e('0x91'),_0x834e('0x9e'),_0x834e('0x94'),'VoiceQueueId',_0x834e('0x46'),_0x834e('0x47')],squel[_0x834e('0x72')]()[_0x834e('0x73')]('phone','phone')[_0x834e('0x73')]('id',_0x834e('0x9e'))[_0x834e('0x73')](_0x354497[_0x834e('0x93')]['toString'](),'ListId')['field'](_0x395b48['params']['id'][_0x834e('0x7b')](),'VoiceQueueId')[_0x834e('0x73')]('NOW()',_0x834e('0x46'))[_0x834e('0x73')](_0x834e('0xb0'),'updatedAt')[_0x834e('0x75')]('cm_contacts')[_0x834e('0x51')]('deletedAt\x20IS\x20NULL')[_0x834e('0x51')]('ListId\x20=\x20?',_0x354497[_0x834e('0x93')][_0x834e('0x7b')]())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x11db76['push'](db[_0x834e('0x63')][_0x834e('0x2c')](_0x1d9e00));}return BPromise['all'](_0x11db76);}})[_0x834e('0x18')](function(){return _0x4c9b90;})[_0x834e('0x18')](respondWithResult(_0x5b4208,null))[_0x834e('0x2e')](handleError(_0x5b4208,null));};exports['removeBlackLists']=function(_0x5cb260,_0x5b3fda){return db[_0x834e('0x26')][_0x834e('0x3c')]({'where':{'id':_0x5cb260[_0x834e('0x41')]['id']}})['then'](handleEntityNotFound(_0x5b3fda,null))[_0x834e('0x18')](function(_0x1e5e2a){if(_0x1e5e2a){return _0x1e5e2a[_0x834e('0xb1')](_0x5cb260[_0x834e('0x2c')][_0x834e('0x71')]);}})[_0x834e('0x18')](function(_0x549c2f){if(_0x549c2f){return db['CmHopperBlack'][_0x834e('0x19')]({'where':{'ListId':_0x5cb260[_0x834e('0x2c')][_0x834e('0x71')],'VoiceQueueId':_0x5cb260[_0x834e('0x41')]['id']}})[_0x834e('0x18')](function(){return _0x549c2f;});}})[_0x834e('0x18')](respondWithStatusCode(_0x5b3fda,null))[_0x834e('0x2e')](handleError(_0x5b3fda,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index d792ed5..2e47e6f 100644 --- a/server/api/voiceQueue/voiceQueue.events.js +++ b/server/api/voiceQueue/voiceQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x73e0=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue'];(function(_0x415f7e,_0x4630b6){var _0x311ff4=function(_0x19c19d){while(--_0x19c19d){_0x415f7e['push'](_0x415f7e['shift']());}};_0x311ff4(++_0x4630b6);}(_0x73e0,0x114));var _0x073e=function(_0x21d80c,_0x1bc9fa){_0x21d80c=_0x21d80c-0x0;var _0xc8c035=_0x73e0[_0x21d80c];return _0xc8c035;};'use strict';var EventEmitter=require(_0x073e('0x0'));var VoiceQueue=require(_0x073e('0x1'))['db'][_0x073e('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x073e('0x3'),'afterUpdate':_0x073e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3bc30c){return function(_0x12a16c,_0x1262ee,_0x556b20){VoiceQueueEvents[_0x073e('0x5')](_0x3bc30c+':'+_0x12a16c['id'],_0x12a16c);VoiceQueueEvents[_0x073e('0x5')](_0x3bc30c,_0x12a16c);_0x556b20(null);};}for(var e in events){if(events[_0x073e('0x6')](e)){var event=events[e];VoiceQueue[_0x073e('0x7')](e,emitEvent(event));}}module[_0x073e('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xdb5c=['events','../../mysqldb','VoiceQueue','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x6ac0f1,_0x3ea2be){var _0x50c158=function(_0x2005b2){while(--_0x2005b2){_0x6ac0f1['push'](_0x6ac0f1['shift']());}};_0x50c158(++_0x3ea2be);}(_0xdb5c,0x183));var _0xcdb5=function(_0x2664f5,_0x525781){_0x2664f5=_0x2664f5-0x0;var _0x2acd10=_0xdb5c[_0x2664f5];return _0x2acd10;};'use strict';var EventEmitter=require(_0xcdb5('0x0'));var VoiceQueue=require(_0xcdb5('0x1'))['db'][_0xcdb5('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcdb5('0x3'),'afterUpdate':_0xcdb5('0x4'),'afterDestroy':_0xcdb5('0x5')};function emitEvent(_0x39c405){return function(_0x26661a,_0x2017d5,_0x839c7c){VoiceQueueEvents[_0xcdb5('0x6')](_0x39c405+':'+_0x26661a['id'],_0x26661a);VoiceQueueEvents['emit'](_0x39c405,_0x26661a);_0x839c7c(null);};}for(var e in events){if(events[_0xcdb5('0x7')](e)){var event=events[e];VoiceQueue[_0xcdb5('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index e7bd9e0..7c7fec3 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0x3e74,0x175));var _0x43e7=function(_0x30a387,_0x5765cc){_0x30a387=_0x30a387-0x0;var _0x118d41=_0x3e74[_0x30a387];return _0x118d41;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x4c9a5e,_0x4838df){var _0x195968=function(_0x1669ce){while(--_0x1669ce){_0x4c9a5e['push'](_0x4c9a5e['shift']());}};_0x195968(++_0x4838df);}(_0xedd9,0xfc));var _0x9edd=function(_0x4e1749,_0x20e8a3){_0x4e1749=_0x4e1749-0x0;var _0x1fe5ac=_0xedd9[_0x4e1749];return _0x1fe5ac;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index c070a81..4112d7a 100644 --- a/server/api/voiceQueue/voiceQueue.rpc.js +++ b/server/api/voiceQueue/voiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x711d=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','request','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','map','include','attributes','model','ShowVoiceQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xdad658,_0x2340cf){var _0x3fddaa=function(_0x49ec00){while(--_0x49ec00){_0xdad658['push'](_0xdad658['shift']());}};_0x3fddaa(++_0x2340cf);}(_0x711d,0x162));var _0xd711=function(_0x36fa0e,_0x453fa5){_0x36fa0e=_0x36fa0e-0x0;var _0xdd4817=_0x711d[_0x36fa0e];return _0xdd4817;};'use strict';var _=require('lodash');var util=require(_0xd711('0x0'));var moment=require(_0xd711('0x1'));var BPromise=require(_0xd711('0x2'));var rs=require(_0xd711('0x3'));var fs=require('fs');var Redis=require(_0xd711('0x4'));var db=require(_0xd711('0x5'))['db'];var utils=require(_0xd711('0x6'));var logger=require('../../config/logger')(_0xd711('0x7'));var config=require(_0xd711('0x8'));var jayson=require(_0xd711('0x9'));var client=jayson[_0xd711('0xa')][_0xd711('0xb')]({'port':0x232a});config[_0xd711('0xc')]=_[_0xd711('0xd')](config[_0xd711('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd711('0xe'))(new Redis(config[_0xd711('0xc')]));require(_0xd711('0xf'))['register'](socket);function respondWithRpcPromise(_0x4ccd5d,_0x2e9f58,_0x262b09){return new BPromise(function(_0x3f2647,_0x2f7027){return client[_0xd711('0x10')](_0x4ccd5d,_0x262b09)[_0xd711('0x11')](function(_0x1b5b07){logger[_0xd711('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x2e9f58,_0xd711('0x13'));logger[_0xd711('0x14')](_0xd711('0x15'),_0x2e9f58,_0xd711('0x13'),JSON[_0xd711('0x16')](_0x1b5b07));if(_0x1b5b07[_0xd711('0x17')]){if(_0x1b5b07[_0xd711('0x17')][_0xd711('0x18')]===0x1f4){logger[_0xd711('0x17')](_0xd711('0x19'),_0x2e9f58,_0x1b5b07[_0xd711('0x17')]['message']);return _0x2f7027(_0x1b5b07[_0xd711('0x17')][_0xd711('0x1a')]);}logger[_0xd711('0x17')](_0xd711('0x19'),_0x2e9f58,_0x1b5b07[_0xd711('0x17')]['message']);return _0x3f2647(_0x1b5b07[_0xd711('0x17')]['message']);}else{logger[_0xd711('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x2e9f58,_0xd711('0x13'));_0x3f2647(_0x1b5b07[_0xd711('0x1b')][_0xd711('0x1a')]);}})[_0xd711('0x1c')](function(_0x41374b){logger['error'](_0xd711('0x19'),_0x2e9f58,_0x41374b);_0x2f7027(_0x41374b);});});}exports[_0xd711('0x1d')]=function(_0x43882e){var _0x415767=this;return new Promise(function(_0x19ef5f,_0x5be596){return db[_0xd711('0x1e')]['findAll']({'raw':_0x43882e['options']?_0x43882e[_0xd711('0x1f')][_0xd711('0x20')]===undefined?!![]:![]:!![],'where':_0x43882e[_0xd711('0x1f')]?_0x43882e['options'][_0xd711('0x21')]||null:null,'attributes':_0x43882e[_0xd711('0x1f')]?_0x43882e[_0xd711('0x1f')]['attributes']||null:null,'limit':_0x43882e[_0xd711('0x1f')]?_0x43882e['options']['limit']||null:null,'include':_0x43882e['options']?_0x43882e[_0xd711('0x1f')]['include']?_[_0xd711('0x22')](_0x43882e[_0xd711('0x1f')][_0xd711('0x23')],function(_0x15ccf7){return{'model':db[_0x15ccf7['model']],'as':_0x15ccf7['as'],'attributes':_0x15ccf7[_0xd711('0x24')],'include':_0x15ccf7['include']?_['map'](_0x15ccf7['include'],function(_0x14c7a5){return{'model':db[_0x14c7a5['model']],'as':_0x14c7a5['as'],'attributes':_0x14c7a5[_0xd711('0x24')],'include':_0x14c7a5[_0xd711('0x23')]?_[_0xd711('0x22')](_0x14c7a5[_0xd711('0x23')],function(_0x558458){return{'model':db[_0x558458[_0xd711('0x25')]],'as':_0x558458['as'],'attributes':_0x558458['attributes']};}):[]};}):[]};}):[]:[]})[_0xd711('0x11')](function(_0x138d94){logger['info'](_0xd711('0x1d'),_0x43882e);logger[_0xd711('0x14')](_0xd711('0x1d'),_0x43882e,JSON['stringify'](_0x138d94));_0x19ef5f(_0x138d94);})['catch'](function(_0x2b1e0f){logger[_0xd711('0x17')](_0xd711('0x1d'),_0x2b1e0f[_0xd711('0x1a')],_0x43882e);_0x5be596(_0x415767[_0xd711('0x17')](0x1f4,_0x2b1e0f['message']));});});};exports[_0xd711('0x26')]=function(_0x2a49ee){var _0x55b11c=this;return new Promise(function(_0x2f4768,_0x49f18b){return db[_0xd711('0x1e')][_0xd711('0x27')]({'raw':_0x2a49ee[_0xd711('0x1f')]?_0x2a49ee['options'][_0xd711('0x20')]===undefined?!![]:![]:!![],'where':_0x2a49ee['options']?_0x2a49ee[_0xd711('0x1f')][_0xd711('0x21')]||null:null,'attributes':_0x2a49ee[_0xd711('0x1f')]?_0x2a49ee['options']['attributes']||null:null,'include':_0x2a49ee['options']?_0x2a49ee[_0xd711('0x1f')][_0xd711('0x23')]?_[_0xd711('0x22')](_0x2a49ee[_0xd711('0x1f')][_0xd711('0x23')],function(_0x38d6a3){return{'model':db[_0x38d6a3[_0xd711('0x25')]],'as':_0x38d6a3['as'],'attributes':_0x38d6a3[_0xd711('0x24')],'include':_0x38d6a3[_0xd711('0x23')]?_['map'](_0x38d6a3[_0xd711('0x23')],function(_0x427c36){return{'model':db[_0x427c36[_0xd711('0x25')]],'as':_0x427c36['as'],'attributes':_0x427c36['attributes'],'include':_0x427c36[_0xd711('0x23')]?_[_0xd711('0x22')](_0x427c36[_0xd711('0x23')],function(_0x18dd46){return{'model':db[_0x18dd46[_0xd711('0x25')]],'as':_0x18dd46['as'],'attributes':_0x18dd46[_0xd711('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25a5ef){logger[_0xd711('0x12')](_0xd711('0x26'),_0x2a49ee);logger[_0xd711('0x14')]('ShowVoiceQueue',_0x2a49ee,JSON['stringify'](_0x25a5ef));_0x2f4768(_0x25a5ef);})[_0xd711('0x1c')](function(_0xa66708){logger['error']('ShowVoiceQueue',_0xa66708[_0xd711('0x1a')],_0x2a49ee);_0x49f18b(_0x55b11c[_0xd711('0x17')](0x1f4,_0xa66708['message']));});});}; \ No newline at end of file +var _0x6007=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowVoiceQueue','find','stringify','lodash','util','bluebird'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x6007,0xa1));var _0x7600=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x6007[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x7600('0x0'));var util=require(_0x7600('0x1'));var moment=require('moment');var BPromise=require(_0x7600('0x2'));var rs=require(_0x7600('0x3'));var fs=require('fs');var Redis=require(_0x7600('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7600('0x5'));var logger=require(_0x7600('0x6'))(_0x7600('0x7'));var config=require(_0x7600('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7600('0x9')]['http']({'port':0x232a});config['redis']=_[_0x7600('0xa')](config[_0x7600('0xb')],{'host':_0x7600('0xc'),'port':0x18eb});var socket=require(_0x7600('0xd'))(new Redis(config[_0x7600('0xb')]));require(_0x7600('0xe'))[_0x7600('0xf')](socket);function respondWithRpcPromise(_0x30e407,_0x269021,_0x16ad27){return new BPromise(function(_0x2fe754,_0x30dc46){return client[_0x7600('0x10')](_0x30e407,_0x16ad27)[_0x7600('0x11')](function(_0x393b0f){logger[_0x7600('0x12')](_0x7600('0x13'),_0x269021,_0x7600('0x14'));logger[_0x7600('0x15')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x269021,'request\x20sent',JSON['stringify'](_0x393b0f));if(_0x393b0f[_0x7600('0x16')]){if(_0x393b0f['error'][_0x7600('0x17')]===0x1f4){logger[_0x7600('0x16')](_0x7600('0x13'),_0x269021,_0x393b0f[_0x7600('0x16')][_0x7600('0x18')]);return _0x30dc46(_0x393b0f['error'][_0x7600('0x18')]);}logger[_0x7600('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x269021,_0x393b0f[_0x7600('0x16')][_0x7600('0x18')]);return _0x2fe754(_0x393b0f[_0x7600('0x16')]['message']);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0x269021,_0x7600('0x14'));_0x2fe754(_0x393b0f[_0x7600('0x19')][_0x7600('0x18')]);}})[_0x7600('0x1a')](function(_0x149a99){logger[_0x7600('0x16')](_0x7600('0x13'),_0x269021,_0x149a99);_0x30dc46(_0x149a99);});});}exports[_0x7600('0x1b')]=function(_0x5533d3){var _0x147895=this;return new Promise(function(_0x83121b,_0x55a828){return db[_0x7600('0x1c')][_0x7600('0x1d')]({'raw':_0x5533d3[_0x7600('0x1e')]?_0x5533d3[_0x7600('0x1e')][_0x7600('0x1f')]===undefined?!![]:![]:!![],'where':_0x5533d3[_0x7600('0x1e')]?_0x5533d3[_0x7600('0x1e')][_0x7600('0x20')]||null:null,'attributes':_0x5533d3[_0x7600('0x1e')]?_0x5533d3[_0x7600('0x1e')][_0x7600('0x21')]||null:null,'limit':_0x5533d3[_0x7600('0x1e')]?_0x5533d3[_0x7600('0x1e')][_0x7600('0x22')]||null:null,'include':_0x5533d3[_0x7600('0x1e')]?_0x5533d3['options'][_0x7600('0x23')]?_[_0x7600('0x24')](_0x5533d3['options'][_0x7600('0x23')],function(_0x563cbf){return{'model':db[_0x563cbf[_0x7600('0x25')]],'as':_0x563cbf['as'],'attributes':_0x563cbf[_0x7600('0x21')],'include':_0x563cbf[_0x7600('0x23')]?_[_0x7600('0x24')](_0x563cbf[_0x7600('0x23')],function(_0x344755){return{'model':db[_0x344755[_0x7600('0x25')]],'as':_0x344755['as'],'attributes':_0x344755[_0x7600('0x21')],'include':_0x344755['include']?_['map'](_0x344755[_0x7600('0x23')],function(_0xdbc7fa){return{'model':db[_0xdbc7fa['model']],'as':_0xdbc7fa['as'],'attributes':_0xdbc7fa['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x583231){logger[_0x7600('0x12')](_0x7600('0x1b'),_0x5533d3);logger[_0x7600('0x15')]('GetVoiceQueue',_0x5533d3,JSON['stringify'](_0x583231));_0x83121b(_0x583231);})[_0x7600('0x1a')](function(_0x1369ad){logger[_0x7600('0x16')](_0x7600('0x1b'),_0x1369ad[_0x7600('0x18')],_0x5533d3);_0x55a828(_0x147895[_0x7600('0x16')](0x1f4,_0x1369ad['message']));});});};exports[_0x7600('0x26')]=function(_0x1f4ba7){var _0x523957=this;return new Promise(function(_0x2f5261,_0x10ad9f){return db[_0x7600('0x1c')][_0x7600('0x27')]({'raw':_0x1f4ba7['options']?_0x1f4ba7[_0x7600('0x1e')][_0x7600('0x1f')]===undefined?!![]:![]:!![],'where':_0x1f4ba7[_0x7600('0x1e')]?_0x1f4ba7[_0x7600('0x1e')]['where']||null:null,'attributes':_0x1f4ba7[_0x7600('0x1e')]?_0x1f4ba7[_0x7600('0x1e')][_0x7600('0x21')]||null:null,'include':_0x1f4ba7[_0x7600('0x1e')]?_0x1f4ba7[_0x7600('0x1e')]['include']?_[_0x7600('0x24')](_0x1f4ba7[_0x7600('0x1e')]['include'],function(_0x2dc082){return{'model':db[_0x2dc082[_0x7600('0x25')]],'as':_0x2dc082['as'],'attributes':_0x2dc082['attributes'],'include':_0x2dc082[_0x7600('0x23')]?_[_0x7600('0x24')](_0x2dc082[_0x7600('0x23')],function(_0x1de9d0){return{'model':db[_0x1de9d0[_0x7600('0x25')]],'as':_0x1de9d0['as'],'attributes':_0x1de9d0[_0x7600('0x21')],'include':_0x1de9d0[_0x7600('0x23')]?_[_0x7600('0x24')](_0x1de9d0[_0x7600('0x23')],function(_0x56c625){return{'model':db[_0x56c625[_0x7600('0x25')]],'as':_0x56c625['as'],'attributes':_0x56c625[_0x7600('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7600('0x11')](function(_0x26a60c){logger[_0x7600('0x12')](_0x7600('0x26'),_0x1f4ba7);logger[_0x7600('0x15')](_0x7600('0x26'),_0x1f4ba7,JSON[_0x7600('0x28')](_0x26a60c));_0x2f5261(_0x26a60c);})[_0x7600('0x1a')](function(_0x54bb3b){logger[_0x7600('0x16')](_0x7600('0x26'),_0x54bb3b[_0x7600('0x18')],_0x1f4ba7);_0x10ad9f(_0x523957[_0x7600('0x16')](0x1f4,_0x54bb3b[_0x7600('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 1374039..f10c247 100644 --- a/server/api/voiceQueue/voiceQueue.socket.js +++ b/server/api/voiceQueue/voiceQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d08=['register','voiceQueue:','./voiceQueue.events','save','remove','update','removeListener'];(function(_0xe89b42,_0x2ccbd6){var _0x5e605b=function(_0xffc3fb){while(--_0xffc3fb){_0xe89b42['push'](_0xe89b42['shift']());}};_0x5e605b(++_0x2ccbd6);}(_0x6d08,0xfe));var _0x86d0=function(_0x3a2e01,_0x2d806d){_0x3a2e01=_0x3a2e01-0x0;var _0x11b58b=_0x6d08[_0x3a2e01];return _0x11b58b;};'use strict';var VoiceQueueEvents=require(_0x86d0('0x0'));var events=[_0x86d0('0x1'),_0x86d0('0x2'),_0x86d0('0x3')];function createListener(_0x40b7ab,_0x455a1b){return function(_0x44ff6f){_0x455a1b['emit'](_0x40b7ab,_0x44ff6f);};}function removeListener(_0x15a1f5,_0x4a4fc9){return function(){VoiceQueueEvents[_0x86d0('0x4')](_0x15a1f5,_0x4a4fc9);};}exports[_0x86d0('0x5')]=function(_0x3b6280){for(var _0x274f99=0x0,_0x378d2e=events['length'];_0x274f99<_0x378d2e;_0x274f99++){var _0x426fad=events[_0x274f99];var _0x45716c=createListener(_0x86d0('0x6')+_0x426fad,_0x3b6280);VoiceQueueEvents['on'](_0x426fad,_0x45716c);}}; \ No newline at end of file +var _0xef22=['length','voiceQueue:','./voiceQueue.events','save','update','emit'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xef22,0xd4));var _0x2ef2=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0xef22[_0x4ae625];return _0x31accf;};'use strict';var VoiceQueueEvents=require(_0x2ef2('0x0'));var events=[_0x2ef2('0x1'),'remove',_0x2ef2('0x2')];function createListener(_0x468929,_0xcafe09){return function(_0x3c0202){_0xcafe09[_0x2ef2('0x3')](_0x468929,_0x3c0202);};}function removeListener(_0x107b4e,_0x56f0b7){return function(){VoiceQueueEvents['removeListener'](_0x107b4e,_0x56f0b7);};}exports['register']=function(_0x293197){for(var _0x4062b9=0x0,_0x41b265=events[_0x2ef2('0x4')];_0x4062b9<_0x41b265;_0x4062b9++){var _0x43badf=events[_0x4062b9];var _0x4c37be=createListener(_0x2ef2('0x5')+_0x43badf,_0x293197);VoiceQueueEvents['on'](_0x43badf,_0x4c37be);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index b94d960..2aa6048 100644 --- a/server/api/voiceQueueReport/index.js +++ b/server/api/voiceQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94c1=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','get','/describe','/index','getVoiceQueuesReport','/:id','post','create','put','destroy','exports','multer','util','connect-timeout'];(function(_0x49f7be,_0x4eb902){var _0x41ccf4=function(_0x59b0ce){while(--_0x59b0ce){_0x49f7be['push'](_0x49f7be['shift']());}};_0x41ccf4(++_0x4eb902);}(_0x94c1,0x1c9));var _0x194c=function(_0x9ba869,_0x1980dd){_0x9ba869=_0x9ba869-0x0;var _0x582532=_0x94c1[_0x9ba869];return _0x582532;};'use strict';var multer=require(_0x194c('0x0'));var util=require(_0x194c('0x1'));var path=require('path');var timeout=require(_0x194c('0x2'));var express=require(_0x194c('0x3'));var router=express[_0x194c('0x4')]();var fs_extra=require(_0x194c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x194c('0x6'));var config=require(_0x194c('0x7'));var controller=require(_0x194c('0x8'));router['get']('/',auth[_0x194c('0x9')](),controller['index']);router[_0x194c('0xa')](_0x194c('0xb'),auth[_0x194c('0x9')](),controller['describe']);router[_0x194c('0xa')](_0x194c('0xc'),auth[_0x194c('0x9')](),controller[_0x194c('0xd')]);router['get'](_0x194c('0xe'),auth[_0x194c('0x9')](),controller['show']);router[_0x194c('0xf')]('/',auth[_0x194c('0x9')](),controller[_0x194c('0x10')]);router[_0x194c('0x11')](_0x194c('0xe'),auth[_0x194c('0x9')](),controller['update']);router['delete'](_0x194c('0xe'),auth[_0x194c('0x9')](),controller[_0x194c('0x12')]);module[_0x194c('0x13')]=router; \ No newline at end of file +var _0xc58b=['update','delete','destroy','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','describe','/index','getVoiceQueuesReport','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc58b,0x1df));var _0xbc58=function(_0x1cee6a,_0x2f6a18){_0x1cee6a=_0x1cee6a-0x0;var _0x37c39e=_0xc58b[_0x1cee6a];return _0x37c39e;};'use strict';var multer=require(_0xbc58('0x0'));var util=require(_0xbc58('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbc58('0x2'));var router=express[_0xbc58('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbc58('0x4'));var config=require(_0xbc58('0x5'));var controller=require(_0xbc58('0x6'));router[_0xbc58('0x7')]('/',auth[_0xbc58('0x8')](),controller[_0xbc58('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xbc58('0xa')]);router[_0xbc58('0x7')](_0xbc58('0xb'),auth[_0xbc58('0x8')](),controller[_0xbc58('0xc')]);router[_0xbc58('0x7')](_0xbc58('0xd'),auth[_0xbc58('0x8')](),controller[_0xbc58('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xbc58('0x8')](),controller[_0xbc58('0xf')]);router[_0xbc58('0x10')](_0xbc58('0xd'),auth['isAuthenticated'](),controller[_0xbc58('0x11')]);module[_0xbc58('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 4e6fe50..af65717 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.attributes.js +++ b/server/api/voiceQueueReport/voiceQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e1=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x54077b,_0x3be0ab){var _0x4d1d1d=function(_0x35527d){while(--_0x35527d){_0x54077b['push'](_0x54077b['shift']());}};_0x4d1d1d(++_0x3be0ab);}(_0xa9e1,0x166));var _0x1a9e=function(_0x366e99,_0x15d82d){_0x366e99=_0x366e99-0x0;var _0x180bbe=_0xa9e1[_0x366e99];return _0x180bbe;};'use strict';var Sequelize=require(_0x1a9e('0x0'));var moment=require('moment');module[_0x1a9e('0x1')]={'type':{'type':Sequelize[_0x1a9e('0x2')]},'uniqueid':{'type':Sequelize[_0x1a9e('0x2')]},'calleridnum':{'type':Sequelize[_0x1a9e('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x1a9e('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x1a9e('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x1a9e('0x3')],'set':function(_0x9d5fba){var _0x17adc8=moment(_0x9d5fba);var _0x477acf=moment(this[_0x1a9e('0x4')](_0x1a9e('0x5')))[_0x1a9e('0x6')](_0x1a9e('0x7'));var _0x233556=_0x17adc8[_0x1a9e('0x8')](_0x477acf,_0x1a9e('0x9'));this[_0x1a9e('0xa')](_0x1a9e('0xb'),_0x9d5fba);this[_0x1a9e('0xa')](_0x1a9e('0xc'),_0x233556||null);}},'position':{'type':Sequelize[_0x1a9e('0xd')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x1a9e('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x1a9e('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x1a9e('0x3')]},'queuecallerexit':{'type':Sequelize[_0x1a9e('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x1a9e('0x2')],'comment':_0x1a9e('0xf')},'originalposition':{'type':Sequelize[_0x1a9e('0xd')]},'channel':{'type':Sequelize[_0x1a9e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1a9e('0x2')]},'connectedlinename':{'type':Sequelize[_0x1a9e('0x2')]},'accountcode':{'type':Sequelize[_0x1a9e('0x2')]},'context':{'type':Sequelize[_0x1a9e('0x2')]},'exten':{'type':Sequelize[_0x1a9e('0x2')]},'priority':{'type':Sequelize[_0x1a9e('0x2')]},'holdtime':{'type':Sequelize[_0x1a9e('0xd')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x1a9e('0x2')],'comment':_0x1a9e('0x10')},'transferexten':{'type':Sequelize[_0x1a9e('0x2')]},'transferuniqueid':{'type':Sequelize[_0x1a9e('0x2')]},'disposition':{'type':Sequelize[_0x1a9e('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1a9e('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x1a9e('0xd')],'defaultValue':0x0},'note':{'type':Sequelize[_0x1a9e('0x2')]}}; \ No newline at end of file +var _0x979b=['queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue'];(function(_0x57dc85,_0x3a6d51){var _0x563a2e=function(_0x5713b2){while(--_0x5713b2){_0x57dc85['push'](_0x57dc85['shift']());}};_0x563a2e(++_0x3a6d51);}(_0x979b,0xa5));var _0xb979=function(_0x5d4f12,_0x11e67c){_0x5d4f12=_0x5d4f12-0x0;var _0x4eb577=_0x979b[_0x5d4f12];return _0x4eb577;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb979('0x0'));module[_0xb979('0x1')]={'type':{'type':Sequelize[_0xb979('0x2')]},'uniqueid':{'type':Sequelize[_0xb979('0x2')]},'calleridnum':{'type':Sequelize[_0xb979('0x2')]},'calleridname':{'type':Sequelize[_0xb979('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xb979('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x49c57d){var _0x4942fb=moment(_0x49c57d);var _0x4e523c=moment(this[_0xb979('0x4')](_0xb979('0x5')))[_0xb979('0x6')](_0xb979('0x7'));var _0x276e6a=_0x4942fb[_0xb979('0x8')](_0x4e523c,_0xb979('0x9'));this[_0xb979('0xa')](_0xb979('0xb'),_0x49c57d);this[_0xb979('0xa')](_0xb979('0xc'),_0x276e6a||null);}},'position':{'type':Sequelize[_0xb979('0xd')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xb979('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xb979('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xb979('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xb979('0x3')]},'queuecallerexit':{'type':Sequelize[_0xb979('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xb979('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xb979('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xb979('0xd')]},'channel':{'type':Sequelize[_0xb979('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb979('0x2')]},'accountcode':{'type':Sequelize[_0xb979('0x2')]},'context':{'type':Sequelize[_0xb979('0x2')]},'exten':{'type':Sequelize[_0xb979('0x2')]},'priority':{'type':Sequelize[_0xb979('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb979('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xb979('0x2')]},'transfer':{'type':Sequelize[_0xb979('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb979('0x2')],'comment':_0xb979('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xb979('0x2')]},'disposition':{'type':Sequelize[_0xb979('0x2')]},'secondDisposition':{'type':Sequelize[_0xb979('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb979('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0xb979('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 04d40a1..2e2b29b 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.controller.js +++ b/server/api/voiceQueueReport/voiceQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b0a=['order','sort','where','pick','filter','merge','map','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','hasOwnProperty','getVoiceQueuesReport','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','register','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','VoiceQueueReport','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x4b0a,0x104));var _0xa4b0=function(_0x5b4cb5,_0x2c296e){_0x5b4cb5=_0x5b4cb5-0x0;var _0x13d4e0=_0x4b0a[_0x5b4cb5];return _0x13d4e0;};'use strict';var emlformat=require(_0xa4b0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa4b0('0x1'));var rp=require(_0xa4b0('0x2'));var moment=require(_0xa4b0('0x3'));var BPromise=require(_0xa4b0('0x4'));var Mustache=require('mustache');var util=require(_0xa4b0('0x5'));var path=require('path');var sox=require(_0xa4b0('0x6'));var csv=require(_0xa4b0('0x7'));var ejs=require(_0xa4b0('0x8'));var fs=require('fs');var fs_extra=require(_0xa4b0('0x9'));var _=require(_0xa4b0('0xa'));var squel=require('squel');var crypto=require(_0xa4b0('0xb'));var jsforce=require(_0xa4b0('0xc'));var deskjs=require(_0xa4b0('0xd'));var toCsv=require(_0xa4b0('0x7'));var querystring=require(_0xa4b0('0xe'));var Papa=require(_0xa4b0('0xf'));var Redis=require(_0xa4b0('0x10'));var authService=require(_0xa4b0('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4b0('0x12'));var logger=require(_0xa4b0('0x13'))(_0xa4b0('0x14'));var utils=require('../../config/utils');var config=require(_0xa4b0('0x15'));var licenseUtil=require(_0xa4b0('0x16'));var db=require(_0xa4b0('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4b0('0x18')]));require('./voiceQueueReport.socket')[_0xa4b0('0x19')](socket);function respondWithStatusCode(_0x20c5d1,_0x5dff22){_0x5dff22=_0x5dff22||0xcc;return function(_0xa83c38){if(_0xa83c38){return _0x20c5d1[_0xa4b0('0x1a')](_0x5dff22);}return _0x20c5d1[_0xa4b0('0x1b')](_0x5dff22)[_0xa4b0('0x1c')]();};}function respondWithResult(_0x48c983,_0x1be186){_0x1be186=_0x1be186||0xc8;return function(_0xbc3470){if(_0xbc3470){return _0x48c983[_0xa4b0('0x1b')](_0x1be186)[_0xa4b0('0x1d')](_0xbc3470);}};}function respondWithFilteredResult(_0x3bd202,_0x53d1cd){return function(_0x5ac9e4){if(_0x5ac9e4){var _0x5e6763=typeof _0x53d1cd[_0xa4b0('0x1e')]===_0xa4b0('0x1f')&&typeof _0x53d1cd[_0xa4b0('0x20')]===_0xa4b0('0x1f');var _0xab868e=_0x5ac9e4['count'];var _0x105ed4=_0x5e6763?0x0:_0x53d1cd[_0xa4b0('0x1e')];var _0x3a68ab=_0x5e6763?_0x5ac9e4['count']:_0x53d1cd[_0xa4b0('0x1e')]+_0x53d1cd[_0xa4b0('0x20')];var _0x5d6426;if(_0x3a68ab>=_0xab868e){_0x3a68ab=_0xab868e;_0x5d6426=0xc8;}else{_0x5d6426=0xce;}_0x3bd202[_0xa4b0('0x1b')](_0x5d6426);return _0x3bd202['set'](_0xa4b0('0x21'),_0x105ed4+'-'+_0x3a68ab+'/'+_0xab868e)[_0xa4b0('0x1d')](_0x5ac9e4);}return null;};}function patchUpdates(_0x3de929){return function(_0x4ebf3d){try{jsonpatch[_0xa4b0('0x22')](_0x4ebf3d,_0x3de929,!![]);}catch(_0x46bebd){return BPromise[_0xa4b0('0x23')](_0x46bebd);}return _0x4ebf3d[_0xa4b0('0x24')]();};}function saveUpdates(_0x2c5326,_0x392b71){return function(_0x3003ec){if(_0x3003ec){return _0x3003ec[_0xa4b0('0x25')](_0x2c5326)['then'](function(_0x377f82){return _0x377f82;});}return null;};}function removeEntity(_0x3adae3,_0x5847a2){return function(_0x3e08d6){if(_0x3e08d6){return _0x3e08d6['destroy']()[_0xa4b0('0x26')](function(){_0x3adae3[_0xa4b0('0x1b')](0xcc)[_0xa4b0('0x1c')]();});}};}function handleEntityNotFound(_0x565d17,_0x56e0a4){return function(_0x3ce163){if(!_0x3ce163){_0x565d17[_0xa4b0('0x1a')](0x194);}return _0x3ce163;};}function handleError(_0x242784,_0x21de85){_0x21de85=_0x21de85||0x1f4;return function(_0x4a68d7){logger[_0xa4b0('0x27')](_0x4a68d7[_0xa4b0('0x28')]);if(_0x4a68d7[_0xa4b0('0x29')]){delete _0x4a68d7[_0xa4b0('0x29')];}_0x242784[_0xa4b0('0x1b')](_0x21de85)[_0xa4b0('0x2a')](_0x4a68d7);};}exports[_0xa4b0('0x2b')]=function(_0x4c94d2,_0x3ba029){var _0x9c351e={},_0x1a6f3d={},_0x1dbd0f={'count':0x0,'rows':[]};var _0x2f5317=_['map'](db[_0xa4b0('0x2c')]['rawAttributes'],function(_0x1881de){return{'name':_0x1881de['fieldName'],'type':_0x1881de[_0xa4b0('0x2d')][_0xa4b0('0x2e')]};});_0x1a6f3d['model']=_['map'](_0x2f5317,_0xa4b0('0x29'));_0x1a6f3d[_0xa4b0('0x2f')]=_[_0xa4b0('0x30')](_0x4c94d2[_0xa4b0('0x2f')]);_0x1a6f3d[_0xa4b0('0x31')]=_[_0xa4b0('0x32')](_0x1a6f3d[_0xa4b0('0x33')],_0x1a6f3d[_0xa4b0('0x2f')]);_0x9c351e[_0xa4b0('0x34')]=_['intersection'](_0x1a6f3d[_0xa4b0('0x33')],qs[_0xa4b0('0x35')](_0x4c94d2[_0xa4b0('0x2f')]['fields']));_0x9c351e[_0xa4b0('0x34')]=_0x9c351e['attributes'][_0xa4b0('0x36')]?_0x9c351e[_0xa4b0('0x34')]:_0x1a6f3d[_0xa4b0('0x33')];if(!_0x4c94d2[_0xa4b0('0x2f')]['hasOwnProperty'](_0xa4b0('0x37'))){_0x9c351e[_0xa4b0('0x20')]=qs[_0xa4b0('0x20')](_0x4c94d2[_0xa4b0('0x2f')][_0xa4b0('0x20')]);_0x9c351e['offset']=qs[_0xa4b0('0x1e')](_0x4c94d2['query'][_0xa4b0('0x1e')]);}_0x9c351e[_0xa4b0('0x38')]=qs[_0xa4b0('0x39')](_0x4c94d2['query'][_0xa4b0('0x39')]);_0x9c351e[_0xa4b0('0x3a')]=qs[_0xa4b0('0x31')](_[_0xa4b0('0x3b')](_0x4c94d2['query'],_0x1a6f3d['filters']),_0x2f5317);if(_0x4c94d2[_0xa4b0('0x2f')][_0xa4b0('0x3c')]){_0x9c351e[_0xa4b0('0x3a')]=_[_0xa4b0('0x3d')](_0x9c351e[_0xa4b0('0x3a')],{'$or':_[_0xa4b0('0x3e')](_0x2f5317,function(_0x2ba8d3){if(_0x2ba8d3[_0xa4b0('0x2d')]!=='VIRTUAL'){var _0x400423={};_0x400423[_0x2ba8d3[_0xa4b0('0x29')]]={'$like':'%'+_0x4c94d2[_0xa4b0('0x2f')][_0xa4b0('0x3c')]+'%'};return _0x400423;}})});}_0x9c351e=_[_0xa4b0('0x3d')]({},_0x9c351e,_0x4c94d2[_0xa4b0('0x3f')]);var _0x1c0828={'where':_0x9c351e[_0xa4b0('0x3a')]};return db['VoiceQueueReport'][_0xa4b0('0x40')](_0x1c0828)[_0xa4b0('0x26')](function(_0x1e9d33){_0x1dbd0f['count']=_0x1e9d33;if(_0x4c94d2[_0xa4b0('0x2f')][_0xa4b0('0x41')]){_0x9c351e[_0xa4b0('0x42')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xa4b0('0x43')](_0x9c351e);})['then'](function(_0x4b3df0){_0x1dbd0f[_0xa4b0('0x44')]=_0x4b3df0;return _0x1dbd0f;})[_0xa4b0('0x26')](respondWithFilteredResult(_0x3ba029,_0x9c351e))[_0xa4b0('0x45')](handleError(_0x3ba029,null));};exports[_0xa4b0('0x46')]=function(_0x561832,_0x4b1660){var _0x2b7957={'raw':![],'where':{'id':_0x561832[_0xa4b0('0x47')]['id']}},_0x531b9c={};_0x531b9c['model']=_[_0xa4b0('0x30')](db['VoiceQueueReport'][_0xa4b0('0x48')]);_0x531b9c[_0xa4b0('0x2f')]=_[_0xa4b0('0x30')](_0x561832[_0xa4b0('0x2f')]);_0x531b9c[_0xa4b0('0x31')]=_[_0xa4b0('0x32')](_0x531b9c['model'],_0x531b9c[_0xa4b0('0x2f')]);_0x2b7957[_0xa4b0('0x34')]=_[_0xa4b0('0x32')](_0x531b9c['model'],qs[_0xa4b0('0x35')](_0x561832[_0xa4b0('0x2f')][_0xa4b0('0x35')]));_0x2b7957[_0xa4b0('0x34')]=_0x2b7957[_0xa4b0('0x34')]['length']?_0x2b7957[_0xa4b0('0x34')]:_0x531b9c[_0xa4b0('0x33')];if(_0x561832[_0xa4b0('0x2f')][_0xa4b0('0x41')]){_0x2b7957[_0xa4b0('0x42')]=[{'all':!![]}];}_0x2b7957=_[_0xa4b0('0x3d')]({},_0x2b7957,_0x561832[_0xa4b0('0x3f')]);return db[_0xa4b0('0x2c')]['find'](_0x2b7957)[_0xa4b0('0x26')](handleEntityNotFound(_0x4b1660,null))[_0xa4b0('0x26')](respondWithResult(_0x4b1660,null))['catch'](handleError(_0x4b1660,null));};exports[_0xa4b0('0x49')]=function(_0x3fd1c0,_0x4e8b76){return db[_0xa4b0('0x2c')]['create'](_0x3fd1c0[_0xa4b0('0x4a')],{})[_0xa4b0('0x26')](respondWithResult(_0x4e8b76,0xc9))[_0xa4b0('0x45')](handleError(_0x4e8b76,null));};exports[_0xa4b0('0x25')]=function(_0x106198,_0x1e7490){if(_0x106198[_0xa4b0('0x4a')]['id']){delete _0x106198[_0xa4b0('0x4a')]['id'];}return db[_0xa4b0('0x2c')]['find']({'where':{'id':_0x106198['params']['id']}})[_0xa4b0('0x26')](handleEntityNotFound(_0x1e7490,null))[_0xa4b0('0x26')](saveUpdates(_0x106198[_0xa4b0('0x4a')],null))[_0xa4b0('0x26')](respondWithResult(_0x1e7490,null))[_0xa4b0('0x45')](handleError(_0x1e7490,null));};exports['destroy']=function(_0x2d5f42,_0xb54309){return db[_0xa4b0('0x2c')][_0xa4b0('0x4b')]({'where':{'id':_0x2d5f42['params']['id']}})[_0xa4b0('0x26')](handleEntityNotFound(_0xb54309,null))[_0xa4b0('0x26')](removeEntity(_0xb54309,null))[_0xa4b0('0x45')](handleError(_0xb54309,null));};exports[_0xa4b0('0x4c')]=function(_0x281b15,_0x2879c8){return db[_0xa4b0('0x2c')][_0xa4b0('0x4c')]()[_0xa4b0('0x26')](respondWithResult(_0x2879c8,null))[_0xa4b0('0x45')](handleError(_0x2879c8,null));};exports['getVoiceQueuesReport']=function(_0x460f3d,_0x46264c){var _0x416e50={},_0x3139b0={},_0x589606={'count':0x0,'rows':[]};_0x3139b0['model']=_[_0xa4b0('0x30')](db[_0xa4b0('0x2c')][_0xa4b0('0x48')]);_0x3139b0['query']=_[_0xa4b0('0x30')](_0x460f3d[_0xa4b0('0x2f')]);_0x3139b0['filters']=_['intersection'](_0x3139b0['model'],_0x3139b0[_0xa4b0('0x2f')]);_0x416e50[_0xa4b0('0x34')]=_[_0xa4b0('0x32')](_0x3139b0[_0xa4b0('0x33')],qs[_0xa4b0('0x35')](_0x460f3d[_0xa4b0('0x2f')][_0xa4b0('0x35')]));_0x416e50[_0xa4b0('0x34')]=_0x416e50['attributes']['length']?_0x416e50[_0xa4b0('0x34')]:_0x3139b0[_0xa4b0('0x33')];if(!_0x460f3d['query'][_0xa4b0('0x4d')](_0xa4b0('0x37'))){_0x416e50[_0xa4b0('0x20')]=qs['limit'](_0x460f3d[_0xa4b0('0x2f')][_0xa4b0('0x20')]);_0x416e50[_0xa4b0('0x1e')]=qs[_0xa4b0('0x1e')](_0x460f3d['query'][_0xa4b0('0x1e')]);}_0x416e50[_0xa4b0('0x38')]=qs[_0xa4b0('0x39')](_0x460f3d['query'][_0xa4b0('0x39')]);_0x416e50[_0xa4b0('0x3a')]=qs[_0xa4b0('0x31')](_[_0xa4b0('0x3b')](_0x460f3d[_0xa4b0('0x2f')],_0x3139b0[_0xa4b0('0x31')]));if(_0x460f3d[_0xa4b0('0x2f')][_0xa4b0('0x3c')]){_0x416e50[_0xa4b0('0x3a')]=_[_0xa4b0('0x3d')](_0x416e50[_0xa4b0('0x3a')],{'$or':_[_0xa4b0('0x3e')](_0x416e50[_0xa4b0('0x34')],function(_0x10b33d){var _0x292f43={};_0x292f43[_0x10b33d]={'$like':'%'+_0x460f3d[_0xa4b0('0x2f')][_0xa4b0('0x3c')]+'%'};return _0x292f43;})});}_0x416e50=_['merge']({},_0x416e50,_0x460f3d[_0xa4b0('0x3f')]);var _0x3f129c={'where':_0x416e50[_0xa4b0('0x3a')]};return db[_0xa4b0('0x2c')][_0xa4b0('0x40')](_0x3f129c)['then'](function(_0x60b0b2){_0x589606[_0xa4b0('0x40')]=_0x60b0b2;if(_0x460f3d['query'][_0xa4b0('0x41')]){_0x416e50[_0xa4b0('0x42')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xa4b0('0x43')](_0x416e50);})[_0xa4b0('0x26')](function(_0x8ff2e7){_0x589606[_0xa4b0('0x44')]=_0x8ff2e7;return _0x589606;})[_0xa4b0('0x26')](respondWithFilteredResult(_0x46264c,_0x416e50,_0xa4b0('0x4e')))[_0xa4b0('0x45')](handleError(_0x46264c,null,_0xa4b0('0x4e')));}; \ No newline at end of file +var _0x4bc7=['../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','VoiceQueueReport','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','getVoiceQueuesReport','hasOwnProperty','map','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment'];(function(_0x417af4,_0xa1ccb7){var _0x26026b=function(_0x3ebe92){while(--_0x3ebe92){_0x417af4['push'](_0x417af4['shift']());}};_0x26026b(++_0xa1ccb7);}(_0x4bc7,0xde));var _0x74bc=function(_0x404eff,_0x4ef653){_0x404eff=_0x404eff-0x0;var _0x46cc25=_0x4bc7[_0x404eff];return _0x46cc25;};'use strict';var emlformat=require(_0x74bc('0x0'));var rimraf=require(_0x74bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x74bc('0x2'));var rp=require(_0x74bc('0x3'));var moment=require('moment');var BPromise=require(_0x74bc('0x4'));var Mustache=require(_0x74bc('0x5'));var util=require(_0x74bc('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x74bc('0x7'));var ejs=require(_0x74bc('0x8'));var fs=require('fs');var fs_extra=require(_0x74bc('0x9'));var _=require(_0x74bc('0xa'));var squel=require(_0x74bc('0xb'));var crypto=require(_0x74bc('0xc'));var jsforce=require(_0x74bc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x74bc('0x7'));var querystring=require('querystring');var Papa=require(_0x74bc('0xe'));var Redis=require(_0x74bc('0xf'));var authService=require(_0x74bc('0x10'));var qs=require(_0x74bc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x74bc('0x12'));var logger=require('../../config/logger')(_0x74bc('0x13'));var utils=require('../../config/utils');var config=require(_0x74bc('0x14'));var licenseUtil=require(_0x74bc('0x15'));var db=require('../../mysqldb')['db'];config[_0x74bc('0x16')]=_[_0x74bc('0x17')](config[_0x74bc('0x16')],{'host':_0x74bc('0x18'),'port':0x18eb});var socket=require(_0x74bc('0x19'))(new Redis(config[_0x74bc('0x16')]));require(_0x74bc('0x1a'))['register'](socket);function respondWithStatusCode(_0x27d64f,_0x35071a){_0x35071a=_0x35071a||0xcc;return function(_0x368c7c){if(_0x368c7c){return _0x27d64f[_0x74bc('0x1b')](_0x35071a);}return _0x27d64f[_0x74bc('0x1c')](_0x35071a)[_0x74bc('0x1d')]();};}function respondWithResult(_0x2990bd,_0x2d2243){_0x2d2243=_0x2d2243||0xc8;return function(_0x5241e3){if(_0x5241e3){return _0x2990bd[_0x74bc('0x1c')](_0x2d2243)[_0x74bc('0x1e')](_0x5241e3);}};}function respondWithFilteredResult(_0xc3c96d,_0x36f24a){return function(_0x45d6c6){if(_0x45d6c6){var _0x5f31a6=typeof _0x36f24a[_0x74bc('0x1f')]===_0x74bc('0x20')&&typeof _0x36f24a[_0x74bc('0x21')]==='undefined';var _0x7bc090=_0x45d6c6[_0x74bc('0x22')];var _0x1932f0=_0x5f31a6?0x0:_0x36f24a[_0x74bc('0x1f')];var _0x46a9e9=_0x5f31a6?_0x45d6c6[_0x74bc('0x22')]:_0x36f24a['offset']+_0x36f24a[_0x74bc('0x21')];var _0x4aeaf0;if(_0x46a9e9>=_0x7bc090){_0x46a9e9=_0x7bc090;_0x4aeaf0=0xc8;}else{_0x4aeaf0=0xce;}_0xc3c96d[_0x74bc('0x1c')](_0x4aeaf0);return _0xc3c96d[_0x74bc('0x23')](_0x74bc('0x24'),_0x1932f0+'-'+_0x46a9e9+'/'+_0x7bc090)['json'](_0x45d6c6);}return null;};}function patchUpdates(_0x1662b7){return function(_0x38a85a){try{jsonpatch['apply'](_0x38a85a,_0x1662b7,!![]);}catch(_0x295574){return BPromise[_0x74bc('0x25')](_0x295574);}return _0x38a85a[_0x74bc('0x26')]();};}function saveUpdates(_0x38e4d2,_0x4ada81){return function(_0x2fdc95){if(_0x2fdc95){return _0x2fdc95[_0x74bc('0x27')](_0x38e4d2)[_0x74bc('0x28')](function(_0x5d3877){return _0x5d3877;});}return null;};}function removeEntity(_0x15d883,_0x3f59b7){return function(_0x123369){if(_0x123369){return _0x123369[_0x74bc('0x29')]()['then'](function(){_0x15d883[_0x74bc('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x378778,_0x722905){return function(_0x52bfcb){if(!_0x52bfcb){_0x378778[_0x74bc('0x1b')](0x194);}return _0x52bfcb;};}function handleError(_0x540f50,_0x5dcfc6){_0x5dcfc6=_0x5dcfc6||0x1f4;return function(_0x223876){logger['error'](_0x223876[_0x74bc('0x2a')]);if(_0x223876[_0x74bc('0x2b')]){delete _0x223876[_0x74bc('0x2b')];}_0x540f50[_0x74bc('0x1c')](_0x5dcfc6)[_0x74bc('0x2c')](_0x223876);};}exports[_0x74bc('0x2d')]=function(_0x4cdc73,_0x12fcb3){var _0x404571={},_0x2f7d67={},_0x23f32d={'count':0x0,'rows':[]};var _0x3b3d76=_['map'](db[_0x74bc('0x2e')]['rawAttributes'],function(_0x4c65be){return{'name':_0x4c65be[_0x74bc('0x2f')],'type':_0x4c65be[_0x74bc('0x30')][_0x74bc('0x31')]};});_0x2f7d67[_0x74bc('0x32')]=_['map'](_0x3b3d76,_0x74bc('0x2b'));_0x2f7d67[_0x74bc('0x33')]=_['keys'](_0x4cdc73[_0x74bc('0x33')]);_0x2f7d67['filters']=_[_0x74bc('0x34')](_0x2f7d67[_0x74bc('0x32')],_0x2f7d67[_0x74bc('0x33')]);_0x404571['attributes']=_[_0x74bc('0x34')](_0x2f7d67['model'],qs['fields'](_0x4cdc73[_0x74bc('0x33')][_0x74bc('0x35')]));_0x404571[_0x74bc('0x36')]=_0x404571['attributes'][_0x74bc('0x37')]?_0x404571[_0x74bc('0x36')]:_0x2f7d67['model'];if(!_0x4cdc73[_0x74bc('0x33')]['hasOwnProperty'](_0x74bc('0x38'))){_0x404571[_0x74bc('0x21')]=qs[_0x74bc('0x21')](_0x4cdc73[_0x74bc('0x33')][_0x74bc('0x21')]);_0x404571['offset']=qs[_0x74bc('0x1f')](_0x4cdc73[_0x74bc('0x33')][_0x74bc('0x1f')]);}_0x404571[_0x74bc('0x39')]=qs['sort'](_0x4cdc73['query'][_0x74bc('0x3a')]);_0x404571['where']=qs[_0x74bc('0x3b')](_[_0x74bc('0x3c')](_0x4cdc73[_0x74bc('0x33')],_0x2f7d67[_0x74bc('0x3b')]),_0x3b3d76);if(_0x4cdc73[_0x74bc('0x33')][_0x74bc('0x3d')]){_0x404571[_0x74bc('0x3e')]=_[_0x74bc('0x3f')](_0x404571[_0x74bc('0x3e')],{'$or':_['map'](_0x3b3d76,function(_0xb9ae81){if(_0xb9ae81[_0x74bc('0x30')]!==_0x74bc('0x40')){var _0x1ca24e={};_0x1ca24e[_0xb9ae81[_0x74bc('0x2b')]]={'$like':'%'+_0x4cdc73[_0x74bc('0x33')]['filter']+'%'};return _0x1ca24e;}})});}_0x404571=_[_0x74bc('0x3f')]({},_0x404571,_0x4cdc73[_0x74bc('0x41')]);var _0x24d517={'where':_0x404571[_0x74bc('0x3e')]};return db[_0x74bc('0x2e')]['count'](_0x24d517)[_0x74bc('0x28')](function(_0x20611d){_0x23f32d[_0x74bc('0x22')]=_0x20611d;if(_0x4cdc73[_0x74bc('0x33')][_0x74bc('0x42')]){_0x404571[_0x74bc('0x43')]=[{'all':!![]}];}return db[_0x74bc('0x2e')][_0x74bc('0x44')](_0x404571);})['then'](function(_0x4a89ce){_0x23f32d[_0x74bc('0x45')]=_0x4a89ce;return _0x23f32d;})[_0x74bc('0x28')](respondWithFilteredResult(_0x12fcb3,_0x404571))[_0x74bc('0x46')](handleError(_0x12fcb3,null));};exports[_0x74bc('0x47')]=function(_0x511b36,_0x52c50b){var _0x577e55={'raw':![],'where':{'id':_0x511b36[_0x74bc('0x48')]['id']}},_0x2d5b94={};_0x2d5b94['model']=_[_0x74bc('0x49')](db[_0x74bc('0x2e')]['rawAttributes']);_0x2d5b94[_0x74bc('0x33')]=_['keys'](_0x511b36[_0x74bc('0x33')]);_0x2d5b94[_0x74bc('0x3b')]=_[_0x74bc('0x34')](_0x2d5b94[_0x74bc('0x32')],_0x2d5b94[_0x74bc('0x33')]);_0x577e55[_0x74bc('0x36')]=_[_0x74bc('0x34')](_0x2d5b94[_0x74bc('0x32')],qs[_0x74bc('0x35')](_0x511b36['query'][_0x74bc('0x35')]));_0x577e55[_0x74bc('0x36')]=_0x577e55[_0x74bc('0x36')][_0x74bc('0x37')]?_0x577e55[_0x74bc('0x36')]:_0x2d5b94[_0x74bc('0x32')];if(_0x511b36[_0x74bc('0x33')][_0x74bc('0x42')]){_0x577e55[_0x74bc('0x43')]=[{'all':!![]}];}_0x577e55=_[_0x74bc('0x3f')]({},_0x577e55,_0x511b36[_0x74bc('0x41')]);return db[_0x74bc('0x2e')][_0x74bc('0x4a')](_0x577e55)['then'](handleEntityNotFound(_0x52c50b,null))[_0x74bc('0x28')](respondWithResult(_0x52c50b,null))[_0x74bc('0x46')](handleError(_0x52c50b,null));};exports[_0x74bc('0x4b')]=function(_0x49b0bb,_0x118c20){return db[_0x74bc('0x2e')]['create'](_0x49b0bb[_0x74bc('0x4c')],{})[_0x74bc('0x28')](respondWithResult(_0x118c20,0xc9))[_0x74bc('0x46')](handleError(_0x118c20,null));};exports[_0x74bc('0x27')]=function(_0x448557,_0x274634){if(_0x448557[_0x74bc('0x4c')]['id']){delete _0x448557[_0x74bc('0x4c')]['id'];}return db[_0x74bc('0x2e')][_0x74bc('0x4a')]({'where':{'id':_0x448557['params']['id']}})[_0x74bc('0x28')](handleEntityNotFound(_0x274634,null))[_0x74bc('0x28')](saveUpdates(_0x448557[_0x74bc('0x4c')],null))['then'](respondWithResult(_0x274634,null))[_0x74bc('0x46')](handleError(_0x274634,null));};exports[_0x74bc('0x29')]=function(_0x58007d,_0xf7d03a){return db['VoiceQueueReport'][_0x74bc('0x4a')]({'where':{'id':_0x58007d[_0x74bc('0x48')]['id']}})[_0x74bc('0x28')](handleEntityNotFound(_0xf7d03a,null))[_0x74bc('0x28')](removeEntity(_0xf7d03a,null))[_0x74bc('0x46')](handleError(_0xf7d03a,null));};exports[_0x74bc('0x4d')]=function(_0x49216e,_0x109186){return db[_0x74bc('0x2e')][_0x74bc('0x4d')]()[_0x74bc('0x28')](respondWithResult(_0x109186,null))['catch'](handleError(_0x109186,null));};exports[_0x74bc('0x4e')]=function(_0x46c1b6,_0x409ed6){var _0x3e0030={},_0x37e9af={},_0x3772bc={'count':0x0,'rows':[]};_0x37e9af['model']=_[_0x74bc('0x49')](db[_0x74bc('0x2e')]['rawAttributes']);_0x37e9af[_0x74bc('0x33')]=_[_0x74bc('0x49')](_0x46c1b6[_0x74bc('0x33')]);_0x37e9af[_0x74bc('0x3b')]=_[_0x74bc('0x34')](_0x37e9af[_0x74bc('0x32')],_0x37e9af['query']);_0x3e0030['attributes']=_[_0x74bc('0x34')](_0x37e9af[_0x74bc('0x32')],qs[_0x74bc('0x35')](_0x46c1b6['query'][_0x74bc('0x35')]));_0x3e0030[_0x74bc('0x36')]=_0x3e0030[_0x74bc('0x36')][_0x74bc('0x37')]?_0x3e0030[_0x74bc('0x36')]:_0x37e9af['model'];if(!_0x46c1b6['query'][_0x74bc('0x4f')](_0x74bc('0x38'))){_0x3e0030[_0x74bc('0x21')]=qs[_0x74bc('0x21')](_0x46c1b6['query'][_0x74bc('0x21')]);_0x3e0030[_0x74bc('0x1f')]=qs[_0x74bc('0x1f')](_0x46c1b6['query'][_0x74bc('0x1f')]);}_0x3e0030[_0x74bc('0x39')]=qs['sort'](_0x46c1b6[_0x74bc('0x33')][_0x74bc('0x3a')]);_0x3e0030[_0x74bc('0x3e')]=qs['filters'](_[_0x74bc('0x3c')](_0x46c1b6[_0x74bc('0x33')],_0x37e9af[_0x74bc('0x3b')]));if(_0x46c1b6[_0x74bc('0x33')][_0x74bc('0x3d')]){_0x3e0030[_0x74bc('0x3e')]=_['merge'](_0x3e0030[_0x74bc('0x3e')],{'$or':_[_0x74bc('0x50')](_0x3e0030[_0x74bc('0x36')],function(_0x339c9e){var _0x1bb275={};_0x1bb275[_0x339c9e]={'$like':'%'+_0x46c1b6[_0x74bc('0x33')][_0x74bc('0x3d')]+'%'};return _0x1bb275;})});}_0x3e0030=_[_0x74bc('0x3f')]({},_0x3e0030,_0x46c1b6[_0x74bc('0x41')]);var _0x4e96e6={'where':_0x3e0030[_0x74bc('0x3e')]};return db[_0x74bc('0x2e')][_0x74bc('0x22')](_0x4e96e6)[_0x74bc('0x28')](function(_0x5b6542){_0x3772bc['count']=_0x5b6542;if(_0x46c1b6[_0x74bc('0x33')][_0x74bc('0x42')]){_0x3e0030[_0x74bc('0x43')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x74bc('0x44')](_0x3e0030);})[_0x74bc('0x28')](function(_0x53d1d4){_0x3772bc[_0x74bc('0x45')]=_0x53d1d4;return _0x3772bc;})['then'](respondWithFilteredResult(_0x409ed6,_0x3e0030,_0x74bc('0x4e')))['catch'](handleError(_0x409ed6,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index fbe58ac..f3d5104 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.events.js +++ b/server/api/voiceQueueReport/voiceQueueReport.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca7a=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueueReport'];(function(_0x2aa54b,_0x174cd9){var _0x44cf3e=function(_0x5b4d25){while(--_0x5b4d25){_0x2aa54b['push'](_0x2aa54b['shift']());}};_0x44cf3e(++_0x174cd9);}(_0xca7a,0x8e));var _0xaca7=function(_0x1857c6,_0x48840c){_0x1857c6=_0x1857c6-0x0;var _0x51011c=_0xca7a[_0x1857c6];return _0x51011c;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xaca7('0x0'))['db'][_0xaca7('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xaca7('0x2')](0x0);var events={'afterCreate':_0xaca7('0x3'),'afterUpdate':'update','afterDestroy':_0xaca7('0x4')};function emitEvent(_0x38f98e){return function(_0x47f9cd,_0x39349e,_0x29f40d){VoiceQueueReportEvents[_0xaca7('0x5')](_0x38f98e+':'+_0x47f9cd['id'],_0x47f9cd);VoiceQueueReportEvents[_0xaca7('0x5')](_0x38f98e,_0x47f9cd);_0x29f40d(null);};}for(var e in events){if(events[_0xaca7('0x6')](e)){var event=events[e];VoiceQueueReport[_0xaca7('0x7')](e,emitEvent(event));}}module[_0xaca7('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xcac4=['save','remove','emit','hook','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0xcac4,0x84));var _0x4cac=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xcac4[_0x37c22c];return _0x119d79;};'use strict';var EventEmitter=require(_0x4cac('0x0'));var VoiceQueueReport=require(_0x4cac('0x1'))['db'][_0x4cac('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x4cac('0x3')](0x0);var events={'afterCreate':_0x4cac('0x4'),'afterUpdate':'update','afterDestroy':_0x4cac('0x5')};function emitEvent(_0x4993ff){return function(_0x4ff1a4,_0x403c78,_0x57c29a){VoiceQueueReportEvents[_0x4cac('0x6')](_0x4993ff+':'+_0x4ff1a4['id'],_0x4ff1a4);VoiceQueueReportEvents[_0x4cac('0x6')](_0x4993ff,_0x4ff1a4);_0x57c29a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x4cac('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 63858e9..847c9a8 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.model.js +++ b/server/api/voiceQueueReport/voiceQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9b5=['request-promise','path','rimraf','../../config/environment','define','lodash','moment','bluebird'];(function(_0x562362,_0x5d54f4){var _0x3a18ce=function(_0x4b96ed){while(--_0x4b96ed){_0x562362['push'](_0x562362['shift']());}};_0x3a18ce(++_0x5d54f4);}(_0xd9b5,0x7d));var _0x5d9b=function(_0x4f8c5b,_0x873bd7){_0x4f8c5b=_0x4f8c5b-0x0;var _0x4a5a88=_0xd9b5[_0x4f8c5b];return _0x4a5a88;};'use strict';var _=require(_0x5d9b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5d9b('0x1'));var BPromise=require(_0x5d9b('0x2'));var rp=require(_0x5d9b('0x3'));var fs=require('fs');var path=require(_0x5d9b('0x4'));var rimraf=require(_0x5d9b('0x5'));var config=require(_0x5d9b('0x6'));var attributes=require('./voiceQueueReport.attributes');module['exports']=function(_0x3a4f86,_0x274749){return _0x3a4f86[_0x5d9b('0x7')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x37b4=['../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2880d8,_0x284ded){var _0x51f5a9=function(_0xafd747){while(--_0xafd747){_0x2880d8['push'](_0x2880d8['shift']());}};_0x51f5a9(++_0x284ded);}(_0x37b4,0x16d));var _0x437b=function(_0x5aa373,_0x54c7f4){_0x5aa373=_0x5aa373-0x0;var _0x590e8e=_0x37b4[_0x5aa373];return _0x590e8e;};'use strict';var _=require(_0x437b('0x0'));var util=require(_0x437b('0x1'));var logger=require(_0x437b('0x2'))(_0x437b('0x3'));var moment=require(_0x437b('0x4'));var BPromise=require(_0x437b('0x5'));var rp=require(_0x437b('0x6'));var fs=require('fs');var path=require(_0x437b('0x7'));var rimraf=require(_0x437b('0x8'));var config=require(_0x437b('0x9'));var attributes=require(_0x437b('0xa'));module[_0x437b('0xb')]=function(_0x2ff86f,_0x2865fc){return _0x2ff86f[_0x437b('0xc')](_0x437b('0xd'),attributes,{'tableName':_0x437b('0xe'),'paranoid':![],'indexes':[{'fields':[_0x437b('0xf')]},{'fields':[_0x437b('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 63af303..34f1c1d 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.rpc.js +++ b/server/api/voiceQueueReport/voiceQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc553=['body','raw','info','UpdateVoiceQueueReport','update','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','map','include','model','stringify','CreateVoiceQueueReport'];(function(_0x405ec6,_0x3071e5){var _0xdf12a4=function(_0x4286b3){while(--_0x4286b3){_0x405ec6['push'](_0x405ec6['shift']());}};_0xdf12a4(++_0x3071e5);}(_0xc553,0x165));var _0x3c55=function(_0x13715b,_0x50bea5){_0x13715b=_0x13715b-0x0;var _0x308d68=_0xc553[_0x13715b];return _0x308d68;};'use strict';var _=require(_0x3c55('0x0'));var util=require('util');var moment=require(_0x3c55('0x1'));var BPromise=require(_0x3c55('0x2'));var rs=require(_0x3c55('0x3'));var fs=require('fs');var Redis=require(_0x3c55('0x4'));var db=require(_0x3c55('0x5'))['db'];var utils=require(_0x3c55('0x6'));var logger=require(_0x3c55('0x7'))(_0x3c55('0x8'));var config=require(_0x3c55('0x9'));var jayson=require(_0x3c55('0xa'));var client=jayson['client'][_0x3c55('0xb')]({'port':0x232a});config['redis']=_[_0x3c55('0xc')](config[_0x3c55('0xd')],{'host':_0x3c55('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c55('0xd')]));require(_0x3c55('0xf'))[_0x3c55('0x10')](socket);function respondWithRpcPromise(_0x2fe7d5,_0x1e5f79,_0x48486c){return new BPromise(function(_0x7365bc,_0x825e69){return client[_0x3c55('0x11')](_0x2fe7d5,_0x48486c)[_0x3c55('0x12')](function(_0x58a2a8){logger['info'](_0x3c55('0x13'),_0x1e5f79,'request\x20sent');logger[_0x3c55('0x14')](_0x3c55('0x15'),_0x1e5f79,'request\x20sent',JSON['stringify'](_0x58a2a8));if(_0x58a2a8['error']){if(_0x58a2a8[_0x3c55('0x16')][_0x3c55('0x17')]===0x1f4){logger['error'](_0x3c55('0x13'),_0x1e5f79,_0x58a2a8['error'][_0x3c55('0x18')]);return _0x825e69(_0x58a2a8[_0x3c55('0x16')][_0x3c55('0x18')]);}logger[_0x3c55('0x16')](_0x3c55('0x13'),_0x1e5f79,_0x58a2a8['error'][_0x3c55('0x18')]);return _0x7365bc(_0x58a2a8['error'][_0x3c55('0x18')]);}else{logger['info'](_0x3c55('0x13'),_0x1e5f79,_0x3c55('0x19'));_0x7365bc(_0x58a2a8[_0x3c55('0x1a')][_0x3c55('0x18')]);}})[_0x3c55('0x1b')](function(_0x31c6aa){logger[_0x3c55('0x16')](_0x3c55('0x13'),_0x1e5f79,_0x31c6aa);_0x825e69(_0x31c6aa);});});}exports[_0x3c55('0x1c')]=function(_0x4c367a){var _0x197e1d=this;return new Promise(function(_0x59638a,_0x1e7d55){return db[_0x3c55('0x1d')][_0x3c55('0x1e')]({'raw':_0x4c367a[_0x3c55('0x1f')]?_0x4c367a[_0x3c55('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x4c367a['options']?_0x4c367a['options'][_0x3c55('0x20')]||null:null,'attributes':_0x4c367a['options']?_0x4c367a[_0x3c55('0x1f')][_0x3c55('0x21')]||null:null,'limit':_0x4c367a[_0x3c55('0x1f')]?_0x4c367a[_0x3c55('0x1f')]['limit']||null:null,'include':_0x4c367a[_0x3c55('0x1f')]?_0x4c367a[_0x3c55('0x1f')]['include']?_[_0x3c55('0x22')](_0x4c367a[_0x3c55('0x1f')][_0x3c55('0x23')],function(_0x74f8ae){return{'model':db[_0x74f8ae[_0x3c55('0x24')]],'as':_0x74f8ae['as'],'attributes':_0x74f8ae['attributes'],'include':_0x74f8ae['include']?_['map'](_0x74f8ae[_0x3c55('0x23')],function(_0x2aa580){return{'model':db[_0x2aa580['model']],'as':_0x2aa580['as'],'attributes':_0x2aa580[_0x3c55('0x21')],'include':_0x2aa580['include']?_[_0x3c55('0x22')](_0x2aa580['include'],function(_0x2e5a15){return{'model':db[_0x2e5a15[_0x3c55('0x24')]],'as':_0x2e5a15['as'],'attributes':_0x2e5a15[_0x3c55('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3c55('0x12')](function(_0x412c99){logger['info']('GetVoiceQueueReport',_0x4c367a);logger['debug']('GetVoiceQueueReport',_0x4c367a,JSON[_0x3c55('0x25')](_0x412c99));_0x59638a(_0x412c99);})[_0x3c55('0x1b')](function(_0x53ad10){logger[_0x3c55('0x16')](_0x3c55('0x1c'),_0x53ad10['message'],_0x4c367a);_0x1e7d55(_0x197e1d[_0x3c55('0x16')](0x1f4,_0x53ad10[_0x3c55('0x18')]));});});};exports[_0x3c55('0x26')]=function(_0x52ca65){var _0x3d7b24=this;return new Promise(function(_0x41654e,_0x3f5084){return db[_0x3c55('0x1d')]['create'](_0x52ca65[_0x3c55('0x27')],{'raw':_0x52ca65['options']?_0x52ca65[_0x3c55('0x1f')][_0x3c55('0x28')]===undefined?!![]:![]:!![]})[_0x3c55('0x12')](function(_0x261aea){logger[_0x3c55('0x29')](_0x3c55('0x26'),_0x52ca65);logger['debug'](_0x3c55('0x26'),_0x52ca65,JSON[_0x3c55('0x25')](_0x261aea));_0x41654e(_0x261aea);})['catch'](function(_0x559727){logger[_0x3c55('0x16')](_0x3c55('0x26'),_0x559727[_0x3c55('0x18')],_0x52ca65);_0x3f5084(_0x3d7b24[_0x3c55('0x16')](0x1f4,_0x559727['message']));});});};exports[_0x3c55('0x2a')]=function(_0x5d49b6){var _0x260e6b=this;return new Promise(function(_0x16efb1,_0x29001f){return db[_0x3c55('0x1d')][_0x3c55('0x2b')](_0x5d49b6[_0x3c55('0x27')],{'raw':_0x5d49b6['options']?_0x5d49b6[_0x3c55('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d49b6[_0x3c55('0x1f')]?_0x5d49b6[_0x3c55('0x1f')][_0x3c55('0x20')]||null:null,'attributes':_0x5d49b6[_0x3c55('0x1f')]?_0x5d49b6[_0x3c55('0x1f')]['attributes']||null:null,'limit':_0x5d49b6[_0x3c55('0x1f')]?_0x5d49b6[_0x3c55('0x1f')]['limit']||null:null})[_0x3c55('0x12')](function(_0x49f254){logger[_0x3c55('0x29')](_0x3c55('0x2a'),_0x5d49b6);logger[_0x3c55('0x14')](_0x3c55('0x2a'),_0x5d49b6,JSON[_0x3c55('0x25')](_0x49f254));_0x16efb1(_0x49f254);})[_0x3c55('0x1b')](function(_0x588c44){logger[_0x3c55('0x16')](_0x3c55('0x2a'),_0x588c44[_0x3c55('0x18')],_0x5d49b6);_0x29001f(_0x260e6b[_0x3c55('0x16')](0x1f4,_0x588c44[_0x3c55('0x18')]));});});}; \ No newline at end of file +var _0x9129=['catch','VoiceQueueReport','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','register','request','then','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x9129,0x1aa));var _0x9912=function(_0x593cbd,_0x141c5b){_0x593cbd=_0x593cbd-0x0;var _0x1ea4aa=_0x9129[_0x593cbd];return _0x1ea4aa;};'use strict';var _=require('lodash');var util=require(_0x9912('0x0'));var moment=require(_0x9912('0x1'));var BPromise=require(_0x9912('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9912('0x3'));var db=require(_0x9912('0x4'))['db'];var utils=require(_0x9912('0x5'));var logger=require(_0x9912('0x6'))(_0x9912('0x7'));var config=require(_0x9912('0x8'));var jayson=require(_0x9912('0x9'));var client=jayson['client'][_0x9912('0xa')]({'port':0x232a});config[_0x9912('0xb')]=_['defaults'](config[_0x9912('0xb')],{'host':_0x9912('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9912('0xb')]));require('./voiceQueueReport.socket')[_0x9912('0xd')](socket);function respondWithRpcPromise(_0x1b4f69,_0x50d0c9,_0x13699b){return new BPromise(function(_0x2c1729,_0x2a397f){return client[_0x9912('0xe')](_0x1b4f69,_0x13699b)[_0x9912('0xf')](function(_0x43bdcc){logger['info'](_0x9912('0x10'),_0x50d0c9,'request\x20sent');logger[_0x9912('0x11')](_0x9912('0x12'),_0x50d0c9,'request\x20sent',JSON[_0x9912('0x13')](_0x43bdcc));if(_0x43bdcc[_0x9912('0x14')]){if(_0x43bdcc[_0x9912('0x14')][_0x9912('0x15')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x50d0c9,_0x43bdcc[_0x9912('0x14')]['message']);return _0x2a397f(_0x43bdcc['error'][_0x9912('0x16')]);}logger[_0x9912('0x14')](_0x9912('0x10'),_0x50d0c9,_0x43bdcc[_0x9912('0x14')][_0x9912('0x16')]);return _0x2c1729(_0x43bdcc[_0x9912('0x14')][_0x9912('0x16')]);}else{logger[_0x9912('0x17')](_0x9912('0x10'),_0x50d0c9,'request\x20sent');_0x2c1729(_0x43bdcc[_0x9912('0x18')]['message']);}})[_0x9912('0x19')](function(_0x2084b6){logger[_0x9912('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x50d0c9,_0x2084b6);_0x2a397f(_0x2084b6);});});}exports['GetVoiceQueueReport']=function(_0x407555){var _0x4e8aba=this;return new Promise(function(_0x811708,_0x39cc45){return db[_0x9912('0x1a')]['findAll']({'raw':_0x407555['options']?_0x407555[_0x9912('0x1b')][_0x9912('0x1c')]===undefined?!![]:![]:!![],'where':_0x407555[_0x9912('0x1b')]?_0x407555['options'][_0x9912('0x1d')]||null:null,'attributes':_0x407555[_0x9912('0x1b')]?_0x407555[_0x9912('0x1b')][_0x9912('0x1e')]||null:null,'limit':_0x407555['options']?_0x407555[_0x9912('0x1b')][_0x9912('0x1f')]||null:null,'include':_0x407555[_0x9912('0x1b')]?_0x407555[_0x9912('0x1b')][_0x9912('0x20')]?_[_0x9912('0x21')](_0x407555[_0x9912('0x1b')][_0x9912('0x20')],function(_0x39e2e5){return{'model':db[_0x39e2e5[_0x9912('0x22')]],'as':_0x39e2e5['as'],'attributes':_0x39e2e5[_0x9912('0x1e')],'include':_0x39e2e5['include']?_[_0x9912('0x21')](_0x39e2e5['include'],function(_0x37d538){return{'model':db[_0x37d538[_0x9912('0x22')]],'as':_0x37d538['as'],'attributes':_0x37d538[_0x9912('0x1e')],'include':_0x37d538[_0x9912('0x20')]?_[_0x9912('0x21')](_0x37d538['include'],function(_0x2c0527){return{'model':db[_0x2c0527[_0x9912('0x22')]],'as':_0x2c0527['as'],'attributes':_0x2c0527[_0x9912('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9912('0xf')](function(_0x406f09){logger[_0x9912('0x17')](_0x9912('0x23'),_0x407555);logger['debug'](_0x9912('0x23'),_0x407555,JSON[_0x9912('0x13')](_0x406f09));_0x811708(_0x406f09);})[_0x9912('0x19')](function(_0x4b0011){logger[_0x9912('0x14')](_0x9912('0x23'),_0x4b0011['message'],_0x407555);_0x39cc45(_0x4e8aba[_0x9912('0x14')](0x1f4,_0x4b0011[_0x9912('0x16')]));});});};exports[_0x9912('0x24')]=function(_0x13f5a4){var _0x9503b7=this;return new Promise(function(_0x9e36e2,_0x366b40){return db[_0x9912('0x1a')][_0x9912('0x25')](_0x13f5a4[_0x9912('0x26')],{'raw':_0x13f5a4[_0x9912('0x1b')]?_0x13f5a4['options'][_0x9912('0x1c')]===undefined?!![]:![]:!![]})[_0x9912('0xf')](function(_0x510a5c){logger[_0x9912('0x17')](_0x9912('0x24'),_0x13f5a4);logger[_0x9912('0x11')]('CreateVoiceQueueReport',_0x13f5a4,JSON['stringify'](_0x510a5c));_0x9e36e2(_0x510a5c);})[_0x9912('0x19')](function(_0x406b6c){logger[_0x9912('0x14')](_0x9912('0x24'),_0x406b6c[_0x9912('0x16')],_0x13f5a4);_0x366b40(_0x9503b7[_0x9912('0x14')](0x1f4,_0x406b6c['message']));});});};exports[_0x9912('0x27')]=function(_0x5d9750){var _0x364e1b=this;return new Promise(function(_0x57989c,_0x519bce){return db[_0x9912('0x1a')][_0x9912('0x28')](_0x5d9750[_0x9912('0x26')],{'raw':_0x5d9750[_0x9912('0x1b')]?_0x5d9750['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d9750['options']?_0x5d9750[_0x9912('0x1b')][_0x9912('0x1d')]||null:null,'attributes':_0x5d9750[_0x9912('0x1b')]?_0x5d9750['options']['attributes']||null:null,'limit':_0x5d9750['options']?_0x5d9750[_0x9912('0x1b')][_0x9912('0x1f')]||null:null})[_0x9912('0xf')](function(_0x3069b2){logger[_0x9912('0x17')](_0x9912('0x27'),_0x5d9750);logger[_0x9912('0x11')](_0x9912('0x27'),_0x5d9750,JSON[_0x9912('0x13')](_0x3069b2));_0x57989c(_0x3069b2);})['catch'](function(_0x15e6b3){logger[_0x9912('0x14')](_0x9912('0x27'),_0x15e6b3[_0x9912('0x16')],_0x5d9750);_0x519bce(_0x364e1b['error'](0x1f4,_0x15e6b3['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index e9bc06f..1b6546a 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.socket.js +++ b/server/api/voiceQueueReport/voiceQueueReport.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02ef=['length','voiceQueueReport:','./voiceQueueReport.events','remove','emit','removeListener','register'];(function(_0xccb202,_0x1b7105){var _0x2b40a4=function(_0x5501c1){while(--_0x5501c1){_0xccb202['push'](_0xccb202['shift']());}};_0x2b40a4(++_0x1b7105);}(_0x02ef,0x11a));var _0xf02e=function(_0x454db3,_0xcd150e){_0x454db3=_0x454db3-0x0;var _0x3b36da=_0x02ef[_0x454db3];return _0x3b36da;};'use strict';var VoiceQueueReportEvents=require(_0xf02e('0x0'));var events=['save',_0xf02e('0x1'),'update'];function createListener(_0x3acfe2,_0x1c228d){return function(_0x4c87bc){_0x1c228d[_0xf02e('0x2')](_0x3acfe2,_0x4c87bc);};}function removeListener(_0x4783f7,_0x1edc1c){return function(){VoiceQueueReportEvents[_0xf02e('0x3')](_0x4783f7,_0x1edc1c);};}exports[_0xf02e('0x4')]=function(_0x511257){for(var _0x332c29=0x0,_0x411cbe=events[_0xf02e('0x5')];_0x332c29<_0x411cbe;_0x332c29++){var _0x4682a6=events[_0x332c29];var _0x2b79b3=createListener(_0xf02e('0x6')+_0x4682a6,_0x511257);VoiceQueueReportEvents['on'](_0x4682a6,_0x2b79b3);}}; \ No newline at end of file +var _0xea03=['update','removeListener','register','voiceQueueReport:','./voiceQueueReport.events','remove'];(function(_0x32163b,_0x40f526){var _0x3103c1=function(_0x50eecc){while(--_0x50eecc){_0x32163b['push'](_0x32163b['shift']());}};_0x3103c1(++_0x40f526);}(_0xea03,0x1ba));var _0x3ea0=function(_0x16b51e,_0x30cb17){_0x16b51e=_0x16b51e-0x0;var _0x27b91a=_0xea03[_0x16b51e];return _0x27b91a;};'use strict';var VoiceQueueReportEvents=require(_0x3ea0('0x0'));var events=['save',_0x3ea0('0x1'),_0x3ea0('0x2')];function createListener(_0x438baa,_0x36b291){return function(_0x250977){_0x36b291['emit'](_0x438baa,_0x250977);};}function removeListener(_0x4d62ed,_0x531f4a){return function(){VoiceQueueReportEvents[_0x3ea0('0x3')](_0x4d62ed,_0x531f4a);};}exports[_0x3ea0('0x4')]=function(_0x266966){for(var _0xed8a4b=0x0,_0x2be1c5=events['length'];_0xed8a4b<_0x2be1c5;_0xed8a4b++){var _0x128556=events[_0xed8a4b];var _0x13b5ab=createListener(_0x3ea0('0x5')+_0x128556,_0x266966);VoiceQueueReportEvents['on'](_0x128556,_0x13b5ab);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 50e4d2c..16ad1ca 100644 --- a/server/api/voiceQueuesLog/index.js +++ b/server/api/voiceQueuesLog/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a81=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x1ecae9,_0x3d5fb9){var _0x5518e1=function(_0x1fcef5){while(--_0x1fcef5){_0x1ecae9['push'](_0x1ecae9['shift']());}};_0x5518e1(++_0x3d5fb9);}(_0x4a81,0x1b7));var _0x14a8=function(_0x291ff9,_0xd54647){_0x291ff9=_0x291ff9-0x0;var _0x54f86a=_0x4a81[_0x291ff9];return _0x54f86a;};'use strict';var multer=require(_0x14a8('0x0'));var util=require(_0x14a8('0x1'));var path=require(_0x14a8('0x2'));var timeout=require(_0x14a8('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x14a8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x14a8('0x5'));var config=require(_0x14a8('0x6'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0x14a8('0x7')](),controller['index']);router[_0x14a8('0x8')]('/:id',auth[_0x14a8('0x7')](),controller[_0x14a8('0x9')]);router[_0x14a8('0xa')]('/',auth[_0x14a8('0x7')](),controller[_0x14a8('0xb')]);router['put']('/:id',auth[_0x14a8('0x7')](),controller[_0x14a8('0xc')]);router[_0x14a8('0xd')]('/:id',auth[_0x14a8('0x7')](),controller[_0x14a8('0xe')]);module[_0x14a8('0xf')]=router; \ No newline at end of file +var _0x7a62=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','post','put','update','exports'];(function(_0x51ede7,_0x5dd1d1){var _0x3bceb4=function(_0x2768d7){while(--_0x2768d7){_0x51ede7['push'](_0x51ede7['shift']());}};_0x3bceb4(++_0x5dd1d1);}(_0x7a62,0x1b0));var _0x27a6=function(_0x3dae38,_0x358865){_0x3dae38=_0x3dae38-0x0;var _0x21ec8d=_0x7a62[_0x3dae38];return _0x21ec8d;};'use strict';var multer=require(_0x27a6('0x0'));var util=require(_0x27a6('0x1'));var path=require(_0x27a6('0x2'));var timeout=require(_0x27a6('0x3'));var express=require(_0x27a6('0x4'));var router=express[_0x27a6('0x5')]();var fs_extra=require(_0x27a6('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x27a6('0x7'));var config=require(_0x27a6('0x8'));var controller=require(_0x27a6('0x9'));router[_0x27a6('0xa')]('/',auth[_0x27a6('0xb')](),controller['index']);router['get'](_0x27a6('0xc'),auth[_0x27a6('0xb')](),controller[_0x27a6('0xd')]);router[_0x27a6('0xe')]('/',auth[_0x27a6('0xb')](),controller['create']);router[_0x27a6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x27a6('0x10')]);router['delete']('/:id',auth[_0x27a6('0xb')](),controller['destroy']);module[_0x27a6('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 16de7b0..b1495d3 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe368=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING','DATE'];(function(_0x1752dc,_0x564306){var _0x216466=function(_0x58cad9){while(--_0x58cad9){_0x1752dc['push'](_0x1752dc['shift']());}};_0x216466(++_0x564306);}(_0xe368,0x187));var _0x8e36=function(_0x114267,_0x367e49){_0x114267=_0x114267-0x0;var _0x2f5aa8=_0xe368[_0x114267];return _0x2f5aa8;};'use strict';var Sequelize=require(_0x8e36('0x0'));var moment=require(_0x8e36('0x1'));module[_0x8e36('0x2')]={'time':{'type':Sequelize[_0x8e36('0x3')]},'callid':{'type':Sequelize[_0x8e36('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x8e36('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x8e36('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x8e36('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x8e36('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x8e36('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x8e36('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x8e36('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x8e36('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x8e36('0x4')],'allowNull':![],'defaultValue':Sequelize['literal'](_0x8e36('0x5'))}}; \ No newline at end of file +var _0xc818=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','STRING','DATE'];(function(_0x1f87ce,_0x2454a8){var _0x2eff19=function(_0x21566c){while(--_0x21566c){_0x1f87ce['push'](_0x1f87ce['shift']());}};_0x2eff19(++_0x2454a8);}(_0xc818,0xf2));var _0x8c81=function(_0x237fc9,_0x2cd7a9){_0x237fc9=_0x237fc9-0x0;var _0x189f99=_0xc818[_0x237fc9];return _0x189f99;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'time':{'type':Sequelize[_0x8c81('0x0')]},'callid':{'type':Sequelize[_0x8c81('0x0')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x8c81('0x0')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x8c81('0x0')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x8c81('0x0')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x8c81('0x0')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x8c81('0x0')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x8c81('0x0')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x8c81('0x0')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x8c81('0x1')],'allowNull':![],'defaultValue':Sequelize[_0x8c81('0x2')](_0x8c81('0x3'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 7eaa7e3..38bb6fa 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x928e=['util','path','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x5d95a9,_0x33409c){var _0x200612=function(_0x45958b){while(--_0x45958b){_0x5d95a9['push'](_0x5d95a9['shift']());}};_0x200612(++_0x33409c);}(_0x928e,0x1f2));var _0xe928=function(_0x2fd692,_0x3deb3c){_0x2fd692=_0x2fd692-0x0;var _0x505778=_0x928e[_0x2fd692];return _0x505778;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe928('0x0'));var zipdir=require(_0xe928('0x1'));var jsonpatch=require(_0xe928('0x2'));var rp=require(_0xe928('0x3'));var moment=require(_0xe928('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe928('0x5'));var util=require(_0xe928('0x6'));var path=require(_0xe928('0x7'));var sox=require(_0xe928('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe928('0x9'));var _=require(_0xe928('0xa'));var squel=require(_0xe928('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe928('0xc'));var toCsv=require(_0xe928('0xd'));var querystring=require(_0xe928('0xe'));var Papa=require(_0xe928('0xf'));var Redis=require(_0xe928('0x10'));var authService=require(_0xe928('0x11'));var qs=require(_0xe928('0x12'));var as=require(_0xe928('0x13'));var hardwareService=require(_0xe928('0x14'));var logger=require('../../config/logger')(_0xe928('0x15'));var utils=require(_0xe928('0x16'));var config=require(_0xe928('0x17'));var licenseUtil=require(_0xe928('0x18'));var db=require(_0xe928('0x19'))['db'];function respondWithStatusCode(_0x4b8428,_0x536dc5){_0x536dc5=_0x536dc5||0xcc;return function(_0x507048){if(_0x507048){return _0x4b8428[_0xe928('0x1a')](_0x536dc5);}return _0x4b8428[_0xe928('0x1b')](_0x536dc5)[_0xe928('0x1c')]();};}function respondWithResult(_0x4d6ecb,_0x5afa62){_0x5afa62=_0x5afa62||0xc8;return function(_0x45802b){if(_0x45802b){return _0x4d6ecb[_0xe928('0x1b')](_0x5afa62)[_0xe928('0x1d')](_0x45802b);}};}function respondWithFilteredResult(_0x40a61e,_0x1e685a){return function(_0xf69394){if(_0xf69394){var _0x4faa82=typeof _0x1e685a[_0xe928('0x1e')]===_0xe928('0x1f')&&typeof _0x1e685a[_0xe928('0x20')]===_0xe928('0x1f');var _0x407162=_0xf69394[_0xe928('0x21')];var _0x1a8429=_0x4faa82?0x0:_0x1e685a[_0xe928('0x1e')];var _0x4d06ad=_0x4faa82?_0xf69394[_0xe928('0x21')]:_0x1e685a[_0xe928('0x1e')]+_0x1e685a[_0xe928('0x20')];var _0x27c021;if(_0x4d06ad>=_0x407162){_0x4d06ad=_0x407162;_0x27c021=0xc8;}else{_0x27c021=0xce;}_0x40a61e['status'](_0x27c021);return _0x40a61e[_0xe928('0x22')]('Content-Range',_0x1a8429+'-'+_0x4d06ad+'/'+_0x407162)['json'](_0xf69394);}return null;};}function patchUpdates(_0x521763){return function(_0x5db212){try{jsonpatch[_0xe928('0x23')](_0x5db212,_0x521763,!![]);}catch(_0x2f0b83){return BPromise[_0xe928('0x24')](_0x2f0b83);}return _0x5db212['save']();};}function saveUpdates(_0x5b5ab7,_0x38a5dc){return function(_0x39af0c){if(_0x39af0c){return _0x39af0c[_0xe928('0x25')](_0x5b5ab7)[_0xe928('0x26')](function(_0x4cd092){return _0x4cd092;});}return null;};}function removeEntity(_0xe54cea,_0x25973c){return function(_0x12fb2c){if(_0x12fb2c){return _0x12fb2c[_0xe928('0x27')]()[_0xe928('0x26')](function(){_0xe54cea[_0xe928('0x1b')](0xcc)[_0xe928('0x1c')]();});}};}function handleEntityNotFound(_0xb13f91,_0x37d26b){return function(_0x3872b2){if(!_0x3872b2){_0xb13f91[_0xe928('0x1a')](0x194);}return _0x3872b2;};}function handleError(_0x214948,_0x540d3d){_0x540d3d=_0x540d3d||0x1f4;return function(_0x10ba86){logger['error'](_0x10ba86[_0xe928('0x28')]);if(_0x10ba86['name']){delete _0x10ba86[_0xe928('0x29')];}_0x214948[_0xe928('0x1b')](_0x540d3d)['send'](_0x10ba86);};}exports[_0xe928('0x2a')]=function(_0x2ef500,_0x474116){var _0x1f79ce={},_0x21033b={},_0x3d857b={'count':0x0,'rows':[]};var _0x1be109=_[_0xe928('0x2b')](db[_0xe928('0x2c')][_0xe928('0x2d')],function(_0x390cf8){return{'name':_0x390cf8[_0xe928('0x2e')],'type':_0x390cf8[_0xe928('0x2f')]['key']};});_0x21033b[_0xe928('0x30')]=_['map'](_0x1be109,_0xe928('0x29'));_0x21033b[_0xe928('0x31')]=_[_0xe928('0x32')](_0x2ef500[_0xe928('0x31')]);_0x21033b['filters']=_[_0xe928('0x33')](_0x21033b[_0xe928('0x30')],_0x21033b['query']);_0x1f79ce[_0xe928('0x34')]=_[_0xe928('0x33')](_0x21033b[_0xe928('0x30')],qs[_0xe928('0x35')](_0x2ef500['query']['fields']));_0x1f79ce[_0xe928('0x34')]=_0x1f79ce['attributes'][_0xe928('0x36')]?_0x1f79ce[_0xe928('0x34')]:_0x21033b['model'];if(!_0x2ef500[_0xe928('0x31')]['hasOwnProperty'](_0xe928('0x37'))){_0x1f79ce[_0xe928('0x20')]=qs[_0xe928('0x20')](_0x2ef500['query']['limit']);_0x1f79ce['offset']=qs[_0xe928('0x1e')](_0x2ef500[_0xe928('0x31')]['offset']);}_0x1f79ce[_0xe928('0x38')]=qs['sort'](_0x2ef500['query'][_0xe928('0x39')]);_0x1f79ce[_0xe928('0x3a')]=qs['filters'](_['pick'](_0x2ef500[_0xe928('0x31')],_0x21033b['filters']),_0x1be109);if(_0x2ef500[_0xe928('0x31')][_0xe928('0x3b')]){_0x1f79ce[_0xe928('0x3a')]=_['merge'](_0x1f79ce['where'],{'$or':_[_0xe928('0x2b')](_0x1be109,function(_0x26e78c){if(_0x26e78c[_0xe928('0x2f')]!=='VIRTUAL'){var _0x5771a4={};_0x5771a4[_0x26e78c['name']]={'$like':'%'+_0x2ef500[_0xe928('0x31')][_0xe928('0x3b')]+'%'};return _0x5771a4;}})});}_0x1f79ce=_[_0xe928('0x3c')]({},_0x1f79ce,_0x2ef500[_0xe928('0x3d')]);var _0x2470f9={'where':_0x1f79ce[_0xe928('0x3a')]};return db[_0xe928('0x2c')][_0xe928('0x21')](_0x2470f9)[_0xe928('0x26')](function(_0x397480){_0x3d857b[_0xe928('0x21')]=_0x397480;if(_0x2ef500[_0xe928('0x31')]['includeAll']){_0x1f79ce[_0xe928('0x3e')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xe928('0x3f')](_0x1f79ce);})[_0xe928('0x26')](function(_0x3fa736){_0x3d857b[_0xe928('0x40')]=_0x3fa736;return _0x3d857b;})['then'](respondWithFilteredResult(_0x474116,_0x1f79ce))[_0xe928('0x41')](handleError(_0x474116,null));};exports[_0xe928('0x42')]=function(_0x5cb20d,_0xfb3274){var _0x2a33de={'raw':!![],'where':{'id':_0x5cb20d['params']['id']}},_0x4d85ce={};_0x4d85ce[_0xe928('0x30')]=_['keys'](db[_0xe928('0x2c')][_0xe928('0x2d')]);_0x4d85ce[_0xe928('0x31')]=_[_0xe928('0x32')](_0x5cb20d[_0xe928('0x31')]);_0x4d85ce['filters']=_[_0xe928('0x33')](_0x4d85ce[_0xe928('0x30')],_0x4d85ce[_0xe928('0x31')]);_0x2a33de[_0xe928('0x34')]=_[_0xe928('0x33')](_0x4d85ce[_0xe928('0x30')],qs['fields'](_0x5cb20d[_0xe928('0x31')][_0xe928('0x35')]));_0x2a33de[_0xe928('0x34')]=_0x2a33de['attributes']['length']?_0x2a33de[_0xe928('0x34')]:_0x4d85ce[_0xe928('0x30')];if(_0x5cb20d[_0xe928('0x31')][_0xe928('0x43')]){_0x2a33de['include']=[{'all':!![]}];}_0x2a33de=_[_0xe928('0x3c')]({},_0x2a33de,_0x5cb20d[_0xe928('0x3d')]);return db[_0xe928('0x2c')][_0xe928('0x44')](_0x2a33de)[_0xe928('0x26')](handleEntityNotFound(_0xfb3274,null))[_0xe928('0x26')](respondWithResult(_0xfb3274,null))['catch'](handleError(_0xfb3274,null));};exports[_0xe928('0x45')]=function(_0x279e9f,_0x354bb4){return db[_0xe928('0x2c')][_0xe928('0x45')](_0x279e9f[_0xe928('0x46')],{})[_0xe928('0x26')](respondWithResult(_0x354bb4,0xc9))[_0xe928('0x41')](handleError(_0x354bb4,null));};exports[_0xe928('0x25')]=function(_0x301c33,_0x33bc98){if(_0x301c33[_0xe928('0x46')]['id']){delete _0x301c33[_0xe928('0x46')]['id'];}return db['VoiceQueuesLog'][_0xe928('0x44')]({'where':{'id':_0x301c33[_0xe928('0x47')]['id']}})[_0xe928('0x26')](handleEntityNotFound(_0x33bc98,null))[_0xe928('0x26')](saveUpdates(_0x301c33['body'],null))[_0xe928('0x26')](respondWithResult(_0x33bc98,null))[_0xe928('0x41')](handleError(_0x33bc98,null));};exports[_0xe928('0x27')]=function(_0x228d8e,_0x2acb1a){return db[_0xe928('0x2c')]['find']({'where':{'id':_0x228d8e[_0xe928('0x47')]['id']}})[_0xe928('0x26')](handleEntityNotFound(_0x2acb1a,null))['then'](removeEntity(_0x2acb1a,null))['catch'](handleError(_0x2acb1a,null));}; \ No newline at end of file +var _0xb08b=['save','update','then','destroy','error','stack','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','merge','type','filter','includeAll','rows','catch','show','params','options','create','body','find','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xb08b,0xaa));var _0xbb08=function(_0x6f9986,_0x47cc82){_0x6f9986=_0x6f9986-0x0;var _0x520e0d=_0xb08b[_0x6f9986];return _0x520e0d;};'use strict';var emlformat=require(_0xbb08('0x0'));var rimraf=require(_0xbb08('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbb08('0x2'));var moment=require(_0xbb08('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbb08('0x4'));var util=require(_0xbb08('0x5'));var path=require(_0xbb08('0x6'));var sox=require(_0xbb08('0x7'));var csv=require(_0xbb08('0x8'));var ejs=require(_0xbb08('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbb08('0xa'));var toCsv=require(_0xbb08('0x8'));var querystring=require(_0xbb08('0xb'));var Papa=require(_0xbb08('0xc'));var Redis=require(_0xbb08('0xd'));var authService=require(_0xbb08('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb08('0xf'));var logger=require(_0xbb08('0x10'))('api');var utils=require(_0xbb08('0x11'));var config=require(_0xbb08('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb08('0x13'))['db'];function respondWithStatusCode(_0x15093b,_0x8d453b){_0x8d453b=_0x8d453b||0xcc;return function(_0x47a4ae){if(_0x47a4ae){return _0x15093b[_0xbb08('0x14')](_0x8d453b);}return _0x15093b[_0xbb08('0x15')](_0x8d453b)[_0xbb08('0x16')]();};}function respondWithResult(_0x2d7193,_0x2c6cbd){_0x2c6cbd=_0x2c6cbd||0xc8;return function(_0x46f155){if(_0x46f155){return _0x2d7193['status'](_0x2c6cbd)[_0xbb08('0x17')](_0x46f155);}};}function respondWithFilteredResult(_0x4b044d,_0x2456ec){return function(_0x271d7d){if(_0x271d7d){var _0x57d763=typeof _0x2456ec[_0xbb08('0x18')]===_0xbb08('0x19')&&typeof _0x2456ec[_0xbb08('0x1a')]===_0xbb08('0x19');var _0x3fa8ba=_0x271d7d[_0xbb08('0x1b')];var _0x5219e4=_0x57d763?0x0:_0x2456ec['offset'];var _0x2a3ced=_0x57d763?_0x271d7d[_0xbb08('0x1b')]:_0x2456ec[_0xbb08('0x18')]+_0x2456ec[_0xbb08('0x1a')];var _0x216558;if(_0x2a3ced>=_0x3fa8ba){_0x2a3ced=_0x3fa8ba;_0x216558=0xc8;}else{_0x216558=0xce;}_0x4b044d[_0xbb08('0x15')](_0x216558);return _0x4b044d['set'](_0xbb08('0x1c'),_0x5219e4+'-'+_0x2a3ced+'/'+_0x3fa8ba)[_0xbb08('0x17')](_0x271d7d);}return null;};}function patchUpdates(_0x429b3b){return function(_0x496161){try{jsonpatch[_0xbb08('0x1d')](_0x496161,_0x429b3b,!![]);}catch(_0x1d669a){return BPromise[_0xbb08('0x1e')](_0x1d669a);}return _0x496161[_0xbb08('0x1f')]();};}function saveUpdates(_0x532db6,_0x5aba04){return function(_0x32d252){if(_0x32d252){return _0x32d252[_0xbb08('0x20')](_0x532db6)[_0xbb08('0x21')](function(_0x488370){return _0x488370;});}return null;};}function removeEntity(_0x455e37,_0x13d94e){return function(_0x10c3dc){if(_0x10c3dc){return _0x10c3dc[_0xbb08('0x22')]()[_0xbb08('0x21')](function(){_0x455e37[_0xbb08('0x15')](0xcc)[_0xbb08('0x16')]();});}};}function handleEntityNotFound(_0x3c7b07,_0x4fa1c6){return function(_0x35a57d){if(!_0x35a57d){_0x3c7b07[_0xbb08('0x14')](0x194);}return _0x35a57d;};}function handleError(_0x24c6ae,_0x3ff5ac){_0x3ff5ac=_0x3ff5ac||0x1f4;return function(_0x28da03){logger[_0xbb08('0x23')](_0x28da03[_0xbb08('0x24')]);if(_0x28da03[_0xbb08('0x25')]){delete _0x28da03[_0xbb08('0x25')];}_0x24c6ae[_0xbb08('0x15')](_0x3ff5ac)[_0xbb08('0x26')](_0x28da03);};}exports['index']=function(_0x30d49f,_0x418957){var _0x3fdda4={},_0x42bcdf={},_0x266cef={'count':0x0,'rows':[]};var _0x4da4ed=_[_0xbb08('0x27')](db[_0xbb08('0x28')][_0xbb08('0x29')],function(_0x536121){return{'name':_0x536121[_0xbb08('0x2a')],'type':_0x536121['type'][_0xbb08('0x2b')]};});_0x42bcdf[_0xbb08('0x2c')]=_[_0xbb08('0x27')](_0x4da4ed,_0xbb08('0x25'));_0x42bcdf['query']=_[_0xbb08('0x2d')](_0x30d49f[_0xbb08('0x2e')]);_0x42bcdf[_0xbb08('0x2f')]=_[_0xbb08('0x30')](_0x42bcdf[_0xbb08('0x2c')],_0x42bcdf[_0xbb08('0x2e')]);_0x3fdda4[_0xbb08('0x31')]=_[_0xbb08('0x30')](_0x42bcdf['model'],qs['fields'](_0x30d49f[_0xbb08('0x2e')][_0xbb08('0x32')]));_0x3fdda4['attributes']=_0x3fdda4[_0xbb08('0x31')][_0xbb08('0x33')]?_0x3fdda4[_0xbb08('0x31')]:_0x42bcdf[_0xbb08('0x2c')];if(!_0x30d49f['query']['hasOwnProperty']('nolimit')){_0x3fdda4['limit']=qs[_0xbb08('0x1a')](_0x30d49f['query'][_0xbb08('0x1a')]);_0x3fdda4['offset']=qs[_0xbb08('0x18')](_0x30d49f['query']['offset']);}_0x3fdda4['order']=qs[_0xbb08('0x34')](_0x30d49f[_0xbb08('0x2e')][_0xbb08('0x34')]);_0x3fdda4[_0xbb08('0x35')]=qs[_0xbb08('0x2f')](_[_0xbb08('0x36')](_0x30d49f[_0xbb08('0x2e')],_0x42bcdf['filters']),_0x4da4ed);if(_0x30d49f[_0xbb08('0x2e')]['filter']){_0x3fdda4[_0xbb08('0x35')]=_[_0xbb08('0x37')](_0x3fdda4[_0xbb08('0x35')],{'$or':_[_0xbb08('0x27')](_0x4da4ed,function(_0x8cd5f3){if(_0x8cd5f3[_0xbb08('0x38')]!=='VIRTUAL'){var _0x15a6a1={};_0x15a6a1[_0x8cd5f3[_0xbb08('0x25')]]={'$like':'%'+_0x30d49f[_0xbb08('0x2e')][_0xbb08('0x39')]+'%'};return _0x15a6a1;}})});}_0x3fdda4=_['merge']({},_0x3fdda4,_0x30d49f['options']);var _0xdac4d1={'where':_0x3fdda4[_0xbb08('0x35')]};return db['VoiceQueuesLog'][_0xbb08('0x1b')](_0xdac4d1)['then'](function(_0x118a02){_0x266cef[_0xbb08('0x1b')]=_0x118a02;if(_0x30d49f['query'][_0xbb08('0x3a')]){_0x3fdda4['include']=[{'all':!![]}];}return db[_0xbb08('0x28')]['findAll'](_0x3fdda4);})[_0xbb08('0x21')](function(_0x77017e){_0x266cef[_0xbb08('0x3b')]=_0x77017e;return _0x266cef;})['then'](respondWithFilteredResult(_0x418957,_0x3fdda4))[_0xbb08('0x3c')](handleError(_0x418957,null));};exports[_0xbb08('0x3d')]=function(_0x31dbac,_0x2341c6){var _0x3b8599={'raw':!![],'where':{'id':_0x31dbac[_0xbb08('0x3e')]['id']}},_0x12f750={};_0x12f750['model']=_['keys'](db[_0xbb08('0x28')][_0xbb08('0x29')]);_0x12f750[_0xbb08('0x2e')]=_[_0xbb08('0x2d')](_0x31dbac[_0xbb08('0x2e')]);_0x12f750['filters']=_['intersection'](_0x12f750[_0xbb08('0x2c')],_0x12f750[_0xbb08('0x2e')]);_0x3b8599['attributes']=_[_0xbb08('0x30')](_0x12f750['model'],qs[_0xbb08('0x32')](_0x31dbac[_0xbb08('0x2e')][_0xbb08('0x32')]));_0x3b8599['attributes']=_0x3b8599[_0xbb08('0x31')][_0xbb08('0x33')]?_0x3b8599[_0xbb08('0x31')]:_0x12f750['model'];if(_0x31dbac[_0xbb08('0x2e')][_0xbb08('0x3a')]){_0x3b8599['include']=[{'all':!![]}];}_0x3b8599=_['merge']({},_0x3b8599,_0x31dbac[_0xbb08('0x3f')]);return db[_0xbb08('0x28')]['find'](_0x3b8599)['then'](handleEntityNotFound(_0x2341c6,null))[_0xbb08('0x21')](respondWithResult(_0x2341c6,null))[_0xbb08('0x3c')](handleError(_0x2341c6,null));};exports[_0xbb08('0x40')]=function(_0x1e237f,_0x79e759){return db[_0xbb08('0x28')][_0xbb08('0x40')](_0x1e237f[_0xbb08('0x41')],{})['then'](respondWithResult(_0x79e759,0xc9))[_0xbb08('0x3c')](handleError(_0x79e759,null));};exports[_0xbb08('0x20')]=function(_0x4055ca,_0x407018){if(_0x4055ca[_0xbb08('0x41')]['id']){delete _0x4055ca['body']['id'];}return db['VoiceQueuesLog'][_0xbb08('0x42')]({'where':{'id':_0x4055ca[_0xbb08('0x3e')]['id']}})['then'](handleEntityNotFound(_0x407018,null))[_0xbb08('0x21')](saveUpdates(_0x4055ca[_0xbb08('0x41')],null))[_0xbb08('0x21')](respondWithResult(_0x407018,null))[_0xbb08('0x3c')](handleError(_0x407018,null));};exports['destroy']=function(_0x345f9a,_0x31938f){return db[_0xbb08('0x28')]['find']({'where':{'id':_0x345f9a[_0xbb08('0x3e')]['id']}})[_0xbb08('0x21')](handleEntityNotFound(_0x31938f,null))['then'](removeEntity(_0x31938f,null))[_0xbb08('0x3c')](handleError(_0x31938f,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 661738c..ebbca51 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.model.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63bf=['../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','event','dtm','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x36cb7e,_0x58fe51){var _0x595086=function(_0x58e504){while(--_0x58e504){_0x36cb7e['push'](_0x36cb7e['shift']());}};_0x595086(++_0x58fe51);}(_0x63bf,0x199));var _0xf63b=function(_0x218d77,_0xdcca93){_0x218d77=_0x218d77-0x0;var _0x4c48f9=_0x63bf[_0x218d77];return _0x4c48f9;};'use strict';var _=require(_0xf63b('0x0'));var util=require('util');var logger=require(_0xf63b('0x1'))(_0xf63b('0x2'));var moment=require('moment');var BPromise=require(_0xf63b('0x3'));var rp=require(_0xf63b('0x4'));var fs=require('fs');var path=require(_0xf63b('0x5'));var rimraf=require(_0xf63b('0x6'));var config=require(_0xf63b('0x7'));var attributes=require(_0xf63b('0x8'));module[_0xf63b('0x9')]=function(_0x14fd2e,_0x333aa7){return _0x14fd2e['define'](_0xf63b('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xf63b('0xb'),_0xf63b('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe2f2=['voice_queues_log','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog'];(function(_0xac36f6,_0x41be7d){var _0x3f7547=function(_0x5d15c0){while(--_0x5d15c0){_0xac36f6['push'](_0xac36f6['shift']());}};_0x3f7547(++_0x41be7d);}(_0xe2f2,0x6c));var _0x2e2f=function(_0x3b604a,_0x3a4716){_0x3b604a=_0x3b604a-0x0;var _0x190c1f=_0xe2f2[_0x3b604a];return _0x190c1f;};'use strict';var _=require(_0x2e2f('0x0'));var util=require(_0x2e2f('0x1'));var logger=require(_0x2e2f('0x2'))(_0x2e2f('0x3'));var moment=require(_0x2e2f('0x4'));var BPromise=require(_0x2e2f('0x5'));var rp=require(_0x2e2f('0x6'));var fs=require('fs');var path=require(_0x2e2f('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2e2f('0x8'));module[_0x2e2f('0x9')]=function(_0x2346f5,_0x3f868e){return _0x2346f5[_0x2e2f('0xa')](_0x2e2f('0xb'),attributes,{'tableName':_0x2e2f('0xc'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x2e2f('0xd'),_0x2e2f('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 83dfe77..7490ea8 100644 --- a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js +++ b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05cc=['request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x5e8f36,_0x41620a){var _0x25430a=function(_0x4e9800){while(--_0x4e9800){_0x5e8f36['push'](_0x5e8f36['shift']());}};_0x25430a(++_0x41620a);}(_0x05cc,0xd9));var _0xc05c=function(_0x40502f,_0x5aff42){_0x40502f=_0x40502f-0x0;var _0x12a5b9=_0x05cc[_0x40502f];return _0x12a5b9;};'use strict';var _=require(_0xc05c('0x0'));var util=require(_0xc05c('0x1'));var moment=require(_0xc05c('0x2'));var BPromise=require(_0xc05c('0x3'));var rs=require(_0xc05c('0x4'));var fs=require('fs');var Redis=require(_0xc05c('0x5'));var db=require(_0xc05c('0x6'))['db'];var utils=require(_0xc05c('0x7'));var logger=require(_0xc05c('0x8'))(_0xc05c('0x9'));var config=require(_0xc05c('0xa'));var jayson=require(_0xc05c('0xb'));var client=jayson[_0xc05c('0xc')][_0xc05c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x590308,_0x5943be,_0x4578c7){return new BPromise(function(_0x36450,_0x31134a){return client[_0xc05c('0xe')](_0x590308,_0x4578c7)['then'](function(_0x1ca4d9){logger[_0xc05c('0xf')](_0xc05c('0x10'),_0x5943be,_0xc05c('0x11'));logger[_0xc05c('0x12')](_0xc05c('0x13'),_0x5943be,_0xc05c('0x11'),JSON[_0xc05c('0x14')](_0x1ca4d9));if(_0x1ca4d9[_0xc05c('0x15')]){if(_0x1ca4d9[_0xc05c('0x15')][_0xc05c('0x16')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x5943be,_0x1ca4d9['error'][_0xc05c('0x17')]);return _0x31134a(_0x1ca4d9[_0xc05c('0x15')][_0xc05c('0x17')]);}logger['error'](_0xc05c('0x10'),_0x5943be,_0x1ca4d9['error'][_0xc05c('0x17')]);return _0x36450(_0x1ca4d9[_0xc05c('0x15')][_0xc05c('0x17')]);}else{logger[_0xc05c('0xf')](_0xc05c('0x10'),_0x5943be,'request\x20sent');_0x36450(_0x1ca4d9[_0xc05c('0x18')][_0xc05c('0x17')]);}})[_0xc05c('0x19')](function(_0x496fb0){logger['error'](_0xc05c('0x10'),_0x5943be,_0x496fb0);_0x31134a(_0x496fb0);});});} \ No newline at end of file +var _0x5cd8=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x8b828d,_0x13f8c2){var _0x266939=function(_0x2c1c90){while(--_0x2c1c90){_0x8b828d['push'](_0x8b828d['shift']());}};_0x266939(++_0x13f8c2);}(_0x5cd8,0x1d2));var _0x85cd=function(_0x12a1b3,_0x3fcde2){_0x12a1b3=_0x12a1b3-0x0;var _0x178f67=_0x5cd8[_0x12a1b3];return _0x178f67;};'use strict';var _=require(_0x85cd('0x0'));var util=require('util');var moment=require(_0x85cd('0x1'));var BPromise=require(_0x85cd('0x2'));var rs=require(_0x85cd('0x3'));var fs=require('fs');var Redis=require(_0x85cd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x85cd('0x5'));var logger=require('../../config/logger')(_0x85cd('0x6'));var config=require(_0x85cd('0x7'));var jayson=require(_0x85cd('0x8'));var client=jayson[_0x85cd('0x9')][_0x85cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x598ab6,_0x1a8619,_0x1a69c4){return new BPromise(function(_0x5aa3c3,_0x1e002d){return client[_0x85cd('0xb')](_0x598ab6,_0x1a69c4)[_0x85cd('0xc')](function(_0x30204b){logger[_0x85cd('0xd')](_0x85cd('0xe'),_0x1a8619,_0x85cd('0xf'));logger[_0x85cd('0x10')](_0x85cd('0x11'),_0x1a8619,'request\x20sent',JSON['stringify'](_0x30204b));if(_0x30204b[_0x85cd('0x12')]){if(_0x30204b[_0x85cd('0x12')][_0x85cd('0x13')]===0x1f4){logger[_0x85cd('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1a8619,_0x30204b[_0x85cd('0x12')][_0x85cd('0x14')]);return _0x1e002d(_0x30204b[_0x85cd('0x12')][_0x85cd('0x14')]);}logger[_0x85cd('0x12')](_0x85cd('0xe'),_0x1a8619,_0x30204b[_0x85cd('0x12')][_0x85cd('0x14')]);return _0x5aa3c3(_0x30204b['error'][_0x85cd('0x14')]);}else{logger[_0x85cd('0xd')](_0x85cd('0xe'),_0x1a8619,_0x85cd('0xf'));_0x5aa3c3(_0x30204b[_0x85cd('0x15')]['message']);}})[_0x85cd('0x16')](function(_0x5164e8){logger[_0x85cd('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1a8619,_0x5164e8);_0x1e002d(_0x5164e8);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index ffb8545..3074a36 100644 --- a/server/api/voiceRecording/index.js +++ b/server/api/voiceRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d36=['runTranscribe','put','/:id','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','/:id/downloads','/:id/transcribe','post','create'];(function(_0x59d259,_0x4188eb){var _0x1dd2ed=function(_0x276a58){while(--_0x276a58){_0x59d259['push'](_0x59d259['shift']());}};_0x1dd2ed(++_0x4188eb);}(_0x9d36,0xd6));var _0x69d3=function(_0x2259f0,_0x38f1e5){_0x2259f0=_0x2259f0-0x0;var _0x572e46=_0x9d36[_0x2259f0];return _0x572e46;};'use strict';var multer=require(_0x69d3('0x0'));var util=require(_0x69d3('0x1'));var path=require('path');var timeout=require(_0x69d3('0x2'));var express=require('express');var router=express[_0x69d3('0x3')]();var fs_extra=require(_0x69d3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x69d3('0x5'));var config=require(_0x69d3('0x6'));var controller=require(_0x69d3('0x7'));router[_0x69d3('0x8')]('/',auth[_0x69d3('0x9')](),controller[_0x69d3('0xa')]);router[_0x69d3('0x8')](_0x69d3('0xb'),auth[_0x69d3('0x9')](),controller[_0x69d3('0xc')]);router[_0x69d3('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x69d3('0xd')]);router[_0x69d3('0x8')](_0x69d3('0xe'),auth[_0x69d3('0x9')](),controller[_0x69d3('0xf')]);router[_0x69d3('0x8')](_0x69d3('0x10'),controller['downloads']);router[_0x69d3('0x8')](_0x69d3('0x11'),auth[_0x69d3('0x9')](),controller['downloadTranscribe']);router[_0x69d3('0x12')]('/',auth[_0x69d3('0x9')](),controller[_0x69d3('0x13')]);router[_0x69d3('0x12')](_0x69d3('0x11'),auth[_0x69d3('0x9')](),controller[_0x69d3('0x14')]);router[_0x69d3('0x15')](_0x69d3('0x16'),auth['isAuthenticated'](),controller[_0x69d3('0x17')]);router[_0x69d3('0x18')](_0x69d3('0x16'),auth[_0x69d3('0x9')](),controller['destroy']);module[_0x69d3('0x19')]=router; \ No newline at end of file +var _0xfdf6=['delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','post','create','runTranscribe','put','update'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0xfdf6,0x12c));var _0x6fdf=function(_0x462bd8,_0x13cf10){_0x462bd8=_0x462bd8-0x0;var _0x40749d=_0xfdf6[_0x462bd8];return _0x40749d;};'use strict';var multer=require(_0x6fdf('0x0'));var util=require(_0x6fdf('0x1'));var path=require(_0x6fdf('0x2'));var timeout=require(_0x6fdf('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6fdf('0x4'));var auth=require(_0x6fdf('0x5'));var interaction=require(_0x6fdf('0x6'));var config=require('../../config/environment');var controller=require(_0x6fdf('0x7'));router[_0x6fdf('0x8')]('/',auth[_0x6fdf('0x9')](),controller[_0x6fdf('0xa')]);router['get'](_0x6fdf('0xb'),auth[_0x6fdf('0x9')](),controller['describe']);router[_0x6fdf('0x8')](_0x6fdf('0xc'),auth[_0x6fdf('0x9')](),controller[_0x6fdf('0xd')]);router[_0x6fdf('0x8')](_0x6fdf('0xe'),auth[_0x6fdf('0x9')](),controller[_0x6fdf('0xf')]);router[_0x6fdf('0x8')](_0x6fdf('0x10'),controller[_0x6fdf('0x11')]);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller[_0x6fdf('0x12')]);router[_0x6fdf('0x13')]('/',auth[_0x6fdf('0x9')](),controller[_0x6fdf('0x14')]);router[_0x6fdf('0x13')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0x6fdf('0x15')]);router[_0x6fdf('0x16')]('/:id',auth[_0x6fdf('0x9')](),controller[_0x6fdf('0x17')]);router[_0x6fdf('0x18')]('/:id',auth[_0x6fdf('0x9')](),controller[_0x6fdf('0x19')]);module[_0x6fdf('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 4da8618..65dc25f 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 22bab79..93755aa 100644 --- a/server/api/voiceRecording/voiceRecording.controller.js +++ b/server/api/voiceRecording/voiceRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaaa6=['aws-sdk','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','VoiceRecording','fieldName','type','key','model','differenceBy','map','format','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','merge','options','find','create','body','describe','download','../../components/encryptor','uniqueid','%s.cypher','existsSync','decryptFile','recording','value','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','downloads','sequelize','token','push','$and','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','listBuckets','upload','TranscribeService','startTranscriptionJob','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','secrets','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','bucket','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','language','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse'];(function(_0xc30740,_0x49b963){var _0x54741b=function(_0x4be8d4){while(--_0x4be8d4){_0xc30740['push'](_0xc30740['shift']());}};_0x54741b(++_0x49b963);}(_0xaaa6,0x1b6));var _0x6aaa=function(_0x3667fa,_0x4a9421){_0x3667fa=_0x3667fa-0x0;var _0x46340e=_0xaaa6[_0x3667fa];return _0x46340e;};'use strict';var emlformat=require(_0x6aaa('0x0'));var rimraf=require(_0x6aaa('0x1'));var zipdir=require(_0x6aaa('0x2'));var jsonpatch=require(_0x6aaa('0x3'));var rp=require('request-promise');var moment=require(_0x6aaa('0x4'));var BPromise=require(_0x6aaa('0x5'));var Mustache=require(_0x6aaa('0x6'));var util=require(_0x6aaa('0x7'));var path=require(_0x6aaa('0x8'));var sox=require(_0x6aaa('0x9'));var csv=require(_0x6aaa('0xa'));var ejs=require(_0x6aaa('0xb'));var fs=require('fs');var fs_extra=require(_0x6aaa('0xc'));var _=require(_0x6aaa('0xd'));var squel=require(_0x6aaa('0xe'));var crypto=require(_0x6aaa('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6aaa('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6aaa('0x11'));var AWS=require(_0x6aaa('0x12'));var uuidv4=require('uuid/v4');var Redis=require(_0x6aaa('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x6aaa('0x14'));var as=require(_0x6aaa('0x15'));var hardwareService=require(_0x6aaa('0x16'));var logger=require(_0x6aaa('0x17'))(_0x6aaa('0x18'));var utils=require(_0x6aaa('0x19'));var config=require(_0x6aaa('0x1a'));var licenseUtil=require(_0x6aaa('0x1b'));var db=require(_0x6aaa('0x1c'))['db'];function respondWithStatusCode(_0x3589ad,_0x251138){_0x251138=_0x251138||0xcc;return function(_0x4c348f){if(_0x4c348f){return _0x3589ad[_0x6aaa('0x1d')](_0x251138);}return _0x3589ad[_0x6aaa('0x1e')](_0x251138)['end']();};}function respondWithResult(_0x145144,_0x11bc3d){_0x11bc3d=_0x11bc3d||0xc8;return function(_0x390615){if(_0x390615){return _0x145144[_0x6aaa('0x1e')](_0x11bc3d)[_0x6aaa('0x1f')](_0x390615);}};}function respondWithFilteredResult(_0x1f406f,_0x3e53ef){return function(_0x1748e9){if(_0x1748e9){var _0x3f09f7=typeof _0x3e53ef[_0x6aaa('0x20')]===_0x6aaa('0x21')&&typeof _0x3e53ef[_0x6aaa('0x22')]===_0x6aaa('0x21');var _0x39b48d=_0x1748e9[_0x6aaa('0x23')];var _0x1db54f=_0x3f09f7?0x0:_0x3e53ef[_0x6aaa('0x20')];var _0x386ca1=_0x3f09f7?_0x1748e9['count']:_0x3e53ef[_0x6aaa('0x20')]+_0x3e53ef['limit'];var _0x307dbc;if(_0x386ca1>=_0x39b48d){_0x386ca1=_0x39b48d;_0x307dbc=0xc8;}else{_0x307dbc=0xce;}_0x1f406f[_0x6aaa('0x1e')](_0x307dbc);return _0x1f406f['set'](_0x6aaa('0x24'),_0x1db54f+'-'+_0x386ca1+'/'+_0x39b48d)[_0x6aaa('0x1f')](_0x1748e9);}return null;};}function patchUpdates(_0xb244fe){return function(_0x34a2df){try{jsonpatch[_0x6aaa('0x25')](_0x34a2df,_0xb244fe,!![]);}catch(_0x4b31f6){return BPromise[_0x6aaa('0x26')](_0x4b31f6);}return _0x34a2df[_0x6aaa('0x27')]();};}function saveUpdates(_0x6f2d4b,_0x35dfdb){return function(_0x4f2869){if(_0x4f2869){return _0x4f2869[_0x6aaa('0x28')](_0x6f2d4b)[_0x6aaa('0x29')](function(_0x156a1c){return _0x156a1c;});}return null;};}function removeEntity(_0x4e11aa,_0x1ce3e8){return function(_0x3c1043){if(_0x3c1043){return _0x3c1043[_0x6aaa('0x2a')]()['then'](function(){_0x4e11aa[_0x6aaa('0x1e')](0xcc)[_0x6aaa('0x2b')]();});}};}function handleEntityNotFound(_0x55b354,_0xbd383b){return function(_0x53ba10){if(!_0x53ba10){_0x55b354[_0x6aaa('0x1d')](0x194);}return _0x53ba10;};}function handleError(_0x5b76d8,_0x30bb78){_0x30bb78=_0x30bb78||0x1f4;return function(_0x4c9d43){logger['error'](_0x4c9d43[_0x6aaa('0x2c')]);if(_0x4c9d43['name']){delete _0x4c9d43[_0x6aaa('0x2d')];}_0x5b76d8[_0x6aaa('0x1e')](_0x30bb78)[_0x6aaa('0x2e')](_0x4c9d43);};}exports['index']=function(_0x5bea91,_0x222855){var _0x3b5153={},_0xc91f54={},_0xfbd198={'count':0x0,'rows':[]};var _0x5a8593=_['map'](db[_0x6aaa('0x2f')]['rawAttributes'],function(_0xd26cf3){return{'name':_0xd26cf3[_0x6aaa('0x30')],'type':_0xd26cf3[_0x6aaa('0x31')][_0x6aaa('0x32')]};});_0xc91f54[_0x6aaa('0x33')]=_[_0x6aaa('0x34')](_[_0x6aaa('0x35')](_0x5a8593,_0x6aaa('0x2d')),[_0x6aaa('0x36')]);_0xc91f54[_0x6aaa('0x37')]=_[_0x6aaa('0x38')](_0x5bea91[_0x6aaa('0x37')]);_0xc91f54[_0x6aaa('0x39')]=_[_0x6aaa('0x3a')](_0xc91f54[_0x6aaa('0x33')],_0xc91f54[_0x6aaa('0x37')]);_0x3b5153[_0x6aaa('0x3b')]=_[_0x6aaa('0x3a')](_0xc91f54[_0x6aaa('0x33')],qs['fields'](_0x5bea91[_0x6aaa('0x37')]['fields']));_0x3b5153[_0x6aaa('0x3b')]=_0x3b5153[_0x6aaa('0x3b')][_0x6aaa('0x3c')]?_0x3b5153['attributes']:_0xc91f54[_0x6aaa('0x33')];if(!_0x5bea91[_0x6aaa('0x37')][_0x6aaa('0x3d')](_0x6aaa('0x3e'))){_0x3b5153['limit']=qs['limit'](_0x5bea91['query']['limit']);_0x3b5153['offset']=qs[_0x6aaa('0x20')](_0x5bea91['query'][_0x6aaa('0x20')]);}_0x3b5153['order']=qs['sort'](_0x5bea91[_0x6aaa('0x37')][_0x6aaa('0x3f')]);_0x3b5153[_0x6aaa('0x40')]=qs[_0x6aaa('0x39')](_['pick'](_0x5bea91[_0x6aaa('0x37')],_0xc91f54[_0x6aaa('0x39')]),_0x5a8593);if(_0x5bea91[_0x6aaa('0x37')][_0x6aaa('0x41')]){_0x3b5153[_0x6aaa('0x40')]=_['merge'](_0x3b5153[_0x6aaa('0x40')],{'$or':_[_0x6aaa('0x35')](_0x5a8593,function(_0x57c020){if(_0x57c020['type']!==_0x6aaa('0x42')){var _0x5f27a4={};_0x5f27a4[_0x57c020['name']]={'$like':'%'+_0x5bea91[_0x6aaa('0x37')]['filter']+'%'};return _0x5f27a4;}})});}_0x3b5153=_['merge']({},_0x3b5153,_0x5bea91['options']);var _0x10d696={'where':_0x3b5153[_0x6aaa('0x40')]};return db[_0x6aaa('0x2f')][_0x6aaa('0x23')](_0x10d696)[_0x6aaa('0x29')](function(_0x7f4162){_0xfbd198['count']=_0x7f4162;if(_0x5bea91[_0x6aaa('0x37')][_0x6aaa('0x43')]){_0x3b5153[_0x6aaa('0x44')]=[{'all':!![]}];}return db[_0x6aaa('0x2f')]['findAll'](_0x3b5153);})[_0x6aaa('0x29')](function(_0x236779){_0xfbd198[_0x6aaa('0x45')]=_0x236779;return _0xfbd198;})['then'](respondWithFilteredResult(_0x222855,_0x3b5153))[_0x6aaa('0x46')](handleError(_0x222855,null));};exports[_0x6aaa('0x47')]=function(_0x1e179c,_0x5b340b){var _0x486ffe={'raw':![],'where':{'id':_0x1e179c[_0x6aaa('0x48')]['id']}},_0x178cbc={};_0x178cbc[_0x6aaa('0x33')]=_[_0x6aaa('0x38')](db[_0x6aaa('0x2f')][_0x6aaa('0x49')]);_0x178cbc[_0x6aaa('0x37')]=_[_0x6aaa('0x38')](_0x1e179c[_0x6aaa('0x37')]);_0x178cbc['filters']=_[_0x6aaa('0x3a')](_0x178cbc[_0x6aaa('0x33')],_0x178cbc[_0x6aaa('0x37')]);_0x486ffe['attributes']=_[_0x6aaa('0x3a')](_0x178cbc[_0x6aaa('0x33')],qs['fields'](_0x1e179c[_0x6aaa('0x37')]['fields']));_0x486ffe[_0x6aaa('0x3b')]=_0x486ffe[_0x6aaa('0x3b')][_0x6aaa('0x3c')]?_0x486ffe[_0x6aaa('0x3b')]:_0x178cbc[_0x6aaa('0x33')];if(_0x1e179c[_0x6aaa('0x37')][_0x6aaa('0x43')]){_0x486ffe[_0x6aaa('0x44')]=[{'all':!![]}];}_0x486ffe=_[_0x6aaa('0x4a')]({},_0x486ffe,_0x1e179c[_0x6aaa('0x4b')]);return db[_0x6aaa('0x2f')][_0x6aaa('0x4c')](_0x486ffe)[_0x6aaa('0x29')](handleEntityNotFound(_0x5b340b,null))['then'](respondWithResult(_0x5b340b,null))[_0x6aaa('0x46')](handleError(_0x5b340b,null));};exports['create']=function(_0x8c9dd1,_0x42193b){return db[_0x6aaa('0x2f')][_0x6aaa('0x4d')](_0x8c9dd1[_0x6aaa('0x4e')],{})[_0x6aaa('0x29')](respondWithResult(_0x42193b,0xc9))[_0x6aaa('0x46')](handleError(_0x42193b,null));};exports[_0x6aaa('0x28')]=function(_0x196194,_0x553a9a){if(_0x196194[_0x6aaa('0x4e')]['id']){delete _0x196194[_0x6aaa('0x4e')]['id'];}return db[_0x6aaa('0x2f')][_0x6aaa('0x4c')]({'where':{'id':_0x196194['params']['id']}})['then'](handleEntityNotFound(_0x553a9a,null))[_0x6aaa('0x29')](saveUpdates(_0x196194[_0x6aaa('0x4e')],null))[_0x6aaa('0x29')](respondWithResult(_0x553a9a,null))[_0x6aaa('0x46')](handleError(_0x553a9a,null));};exports['describe']=function(_0x31d536,_0x361b37){return db[_0x6aaa('0x2f')][_0x6aaa('0x4f')]()[_0x6aaa('0x29')](respondWithResult(_0x361b37,null))[_0x6aaa('0x46')](handleError(_0x361b37,null));};exports[_0x6aaa('0x50')]=function(_0x1281bd,_0x5d436a,_0x4c9108){var _0x223386=require(_0x6aaa('0x51'));var _0x279478=![];var _0x545489={};if(_0x1281bd[_0x6aaa('0x37')][_0x6aaa('0x31')]&&_0x1281bd['query'][_0x6aaa('0x31')]==='uniqueid'){_0x545489[_0x6aaa('0x52')]=_0x1281bd[_0x6aaa('0x48')]['id'];}else{_0x545489['id']=_0x1281bd[_0x6aaa('0x48')]['id'];}return db['VoiceRecording'][_0x6aaa('0x4c')]({'where':_0x545489,'attributes':['id','value'],'raw':!![]})[_0x6aaa('0x29')](handleEntityNotFound(_0x5d436a,null))[_0x6aaa('0x29')](function(_0x47740a){if(_0x47740a){var _0xc08ccc=_0x47740a['value'];var _0x52ced6=util[_0x6aaa('0x36')](_0x6aaa('0x53'),_0xc08ccc);if(fs[_0x6aaa('0x54')](_0x52ced6)){_0x279478=!![];return _0x223386[_0x6aaa('0x55')](_0x52ced6,_0xc08ccc,config['secrets'][_0x6aaa('0x56')])['then'](function(){return _0x47740a;});}return _0x47740a;}})[_0x6aaa('0x29')](function(_0x14a53e){if(_0x14a53e){var _0x43a24e=_0x14a53e[_0x6aaa('0x57')];if(!fs[_0x6aaa('0x54')](_0x43a24e)){throw new db[(_0x6aaa('0x58'))][(_0x6aaa('0x59'))](_0x6aaa('0x5a'));}if(_0x14a53e[_0x6aaa('0x5b')]){return _0x5d436a[_0x6aaa('0x50')](_0x43a24e,_0x14a53e[_0x6aaa('0x5b')]+path['extname'](_0x43a24e),function(){if(_0x279478){fs[_0x6aaa('0x5c')](_0x43a24e);}});}else{return _0x5d436a[_0x6aaa('0x50')](_0x43a24e,function(_0xe6ca6f){if(_0x279478){fs['unlink'](_0x43a24e);}});}}})[_0x6aaa('0x46')](function(_0x2c3cea){if(_0x2c3cea[_0x6aaa('0x5d')]===_0x6aaa('0x5a')){_0x5d436a[_0x6aaa('0x1e')](0x194)[_0x6aaa('0x2e')]('Not\x20found');}else{return handleError(_0x5d436a,null);}});};exports[_0x6aaa('0x5e')]=function(_0x48760b,_0x1fac8b,_0x18e470){var _0x3de5ee=require(_0x6aaa('0x51'));var _0x21d760=![];var _0x2132dd={'$and':[db[_0x6aaa('0x5f')][_0x6aaa('0x40')](db[_0x6aaa('0x5f')]['fn']('MD5',db['sequelize']['col'](_0x6aaa('0x52'))),_0x48760b['query'][_0x6aaa('0x60')])]};if(_0x48760b[_0x6aaa('0x37')][_0x6aaa('0x31')]&&_0x48760b[_0x6aaa('0x37')][_0x6aaa('0x31')]===_0x6aaa('0x52')){_0x2132dd['$and'][_0x6aaa('0x61')]({'uniqueid':_0x48760b[_0x6aaa('0x48')]['id']});}else{_0x2132dd[_0x6aaa('0x62')]['push']({'id':_0x48760b[_0x6aaa('0x48')]['id']});}return db['VoiceRecording']['find']({'where':_0x2132dd,'attributes':['id',_0x6aaa('0x57')],'raw':!![]})[_0x6aaa('0x29')](handleEntityNotFound(_0x1fac8b,null))[_0x6aaa('0x29')](function(_0x5b4402){if(_0x5b4402){var _0x4a9f59=util[_0x6aaa('0x36')]('%s.cypher',_0x5b4402['value']);if(fs['existsSync'](_0x4a9f59)){_0x21d760=!![];return _0x3de5ee[_0x6aaa('0x55')](_0x4a9f59,_0x5b4402['value'],config['secrets'][_0x6aaa('0x56')])[_0x6aaa('0x29')](function(){return _0x5b4402;});}return _0x5b4402;}})['then'](function(_0xdf23d5){if(_0xdf23d5){if(!fs['existsSync'](_0xdf23d5['value'])){throw new db[(_0x6aaa('0x58'))][(_0x6aaa('0x59'))](_0x6aaa('0x5a'));}if(_0xdf23d5[_0x6aaa('0x5b')]){return _0x1fac8b['download'](_0xdf23d5[_0x6aaa('0x57')],_0xdf23d5[_0x6aaa('0x5b')]+path['extname'](_0xdf23d5[_0x6aaa('0x57')]),function(){if(_0x21d760){fs[_0x6aaa('0x5c')](_0xdf23d5[_0x6aaa('0x57')]);}});}else{return _0x1fac8b[_0x6aaa('0x50')](_0xdf23d5[_0x6aaa('0x57')],function(_0x480463){if(_0x21d760){fs['unlink'](_0xdf23d5[_0x6aaa('0x57')]);}});}}})['catch'](handleError(_0x1fac8b,null));};exports['destroy']=function(_0x322842,_0x5ec9aa){return db[_0x6aaa('0x2f')][_0x6aaa('0x4c')]({'where':{'id':_0x322842[_0x6aaa('0x48')]['id']}})[_0x6aaa('0x29')](function(_0x35880b){if(_[_0x6aaa('0x63')](_0x35880b)){throw new ReferenceError('Entity\x20not\x20found');}return _0x35880b;})['then'](function(_0x383cd1){var _0x35cfbf=_0x383cd1['value'];logger[_0x6aaa('0x64')](_0x6aaa('0x65'),_0x35cfbf);if(!_[_0x6aaa('0x63')](_0x383cd1[_0x6aaa('0x57')])&&fs[_0x6aaa('0x54')](_0x35cfbf)){logger['info']('File:\x20\x22'+_0x35cfbf+_0x6aaa('0x66'));fs['unlinkSync'](_0x35cfbf);}_0x35cfbf=_0x35cfbf+_0x6aaa('0x67');if(!_[_0x6aaa('0x63')](_0x383cd1['value'])&&fs[_0x6aaa('0x54')](_0x35cfbf)){logger[_0x6aaa('0x64')](_0x6aaa('0x68')+_0x35cfbf+_0x6aaa('0x66'));fs['unlinkSync'](_0x35cfbf);}return _0x383cd1;})[_0x6aaa('0x29')](function(_0x17b139){if(!_0x17b139)throw new InternalError();return _0x17b139[_0x6aaa('0x2a')]();})[_0x6aaa('0x29')](function(){_0x5ec9aa['status'](0xcc)['end']();})[_0x6aaa('0x46')](handleError(_0x5ec9aa,null));};function getBucketslist(_0x4e1bf4,_0x59d508,_0x2d9bd1){return new Promise(function(_0x1ddf8b,_0x3a8667){var _0x2eb6f8=new AWS['S3']({'accessKeyId':_0x59d508,'secretAccessKey':_0x4e1bf4,'region':_0x2d9bd1});_0x2eb6f8[_0x6aaa('0x69')]({},function(_0x1839ae,_0x214623){if(_0x1839ae){return _0x3a8667(_0x1839ae);}else{return _0x1ddf8b(_0x214623);}});});}function createBucket(_0x41a871,_0x5adee5,_0x190ff5,_0x356a62){return new Promise(function(_0x32cd46,_0x4c1334){var _0x186aea=new AWS['S3']({'accessKeyId':_0x5adee5,'secretAccessKey':_0x41a871,'region':_0x190ff5});_0x186aea['createBucket']({'Bucket':_0x356a62},function(_0x194dfa,_0x4c5729){if(_0x194dfa){return _0x4c1334(_0x194dfa);}else{return _0x32cd46(_0x4c5729);}});});}function uploadFile(_0x224b72,_0x22a3e9,_0x11943c,_0x195c63,_0x473154,_0x4bc1f9){return new Promise(function(_0x5dc6b1,_0x169f06){var _0x32e1e0=new AWS['S3']({'accessKeyId':_0x22a3e9,'secretAccessKey':_0x224b72,'region':_0x11943c});_0x32e1e0[_0x6aaa('0x6a')]({'Bucket':_0x195c63,'Key':_0x473154,'Body':_0x4bc1f9},function(_0x3189ed,_0x32f53d){if(_0x3189ed){return _0x169f06(_0x3189ed);}else{return _0x5dc6b1(_0x32f53d);}});});}function startTranscribe(_0x46d57c,_0x332af6,_0x2a3379,_0x42003d,_0x357374,_0x15554c){return new Promise(function(_0x5d07db,_0xfbc7a){var _0x52946a=new AWS[(_0x6aaa('0x6b'))]({'accessKeyId':_0x332af6,'secretAccessKey':_0x46d57c,'region':_0x2a3379});_0x52946a[_0x6aaa('0x6c')]({'TranscriptionJobName':_0x42003d,'LanguageCode':_0x357374,'Media':{'MediaFileUri':_0x15554c}},function(_0x3f5cd0,_0x254ead){if(_0x3f5cd0){return _0xfbc7a(_0x3f5cd0);}else{return _0x5d07db(_0x254ead);}});});}function transcribe(_0x47acec,_0xea3118,_0xf02284,_0x17cf26,_0x38d242,_0x2580a3,_0x430e1e){return new Promise(function(_0x28f325,_0x38c847){var _0x166986={};logger[_0x6aaa('0x64')](util[_0x6aaa('0x36')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x47acec,_0x38d242));return uploadFile(_0xea3118,_0xf02284,_0x17cf26,_0x38d242,path[_0x6aaa('0x6d')](_0x2580a3),fs[_0x6aaa('0x6e')](_0x2580a3))['then'](function(_0x1a58b7){logger[_0x6aaa('0x64')](util['format'](_0x6aaa('0x6f'),_0x47acec,_0x38d242,_0x1a58b7[_0x6aaa('0x70')]));_0x166986['bucket']=_0x1a58b7[_0x6aaa('0x71')];_0x166986[_0x6aaa('0x72')]=_0x1a58b7['Location'];logger[_0x6aaa('0x64')](util[_0x6aaa('0x36')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x47acec));return startTranscribe(_0xea3118,_0xf02284,_0x17cf26,uuidv4(),_0x430e1e,_0x1a58b7[_0x6aaa('0x70')]);})[_0x6aaa('0x29')](function(_0x3355a5){logger[_0x6aaa('0x64')](util[_0x6aaa('0x36')](_0x6aaa('0x73'),_0x47acec,_0x3355a5[_0x6aaa('0x74')][_0x6aaa('0x75')]));_0x166986[_0x6aaa('0x76')]=_0x3355a5['TranscriptionJob'][_0x6aaa('0x75')];_0x166986[_0x6aaa('0x77')]=_0x3355a5[_0x6aaa('0x74')][_0x6aaa('0x78')];return _0x28f325(_0x166986);})['catch'](function(_0x3b19ae){return _0x38c847(_0x3b19ae);});});}exports['runTranscribe']=function(_0x4de3d5,_0x4fc940,_0x57fefa){var _0x98dfaf;var _0x474f70;var _0xdf4e60;var _0x5c818b=require(_0x6aaa('0x51'));return db[_0x6aaa('0x2f')]['findOne']({'where':{'id':_0x4de3d5[_0x6aaa('0x48')]['id']}})[_0x6aaa('0x29')](function(_0x42b6d4){if(_0x42b6d4){var _0xa6bda2=util['format'](_0x6aaa('0x53'),_0x42b6d4[_0x6aaa('0x57')]);if(fs['existsSync'](_0xa6bda2)){cypher=!![];return _0x5c818b[_0x6aaa('0x55')](_0xa6bda2,_0x42b6d4[_0x6aaa('0x57')],config[_0x6aaa('0x79')][_0x6aaa('0x56')])[_0x6aaa('0x29')](function(){return _0x42b6d4;});}return _0x42b6d4;}})[_0x6aaa('0x29')](function(_0x5c0401){if(!_0x5c0401){throw new db['Sequelize'][(_0x6aaa('0x59'))](_0x6aaa('0x7a'));}_0x474f70=_0x5c0401;return db[_0x6aaa('0x7b')][_0x6aaa('0x7c')]({'where':{'id':0x1}});})[_0x6aaa('0x29')](handleEntityNotFound(_0x4fc940,null))[_0x6aaa('0x29')](function(_0x1bc678){if(_0x1bc678){_0x98dfaf=_0x1bc678;if(!_0x98dfaf[_0x6aaa('0x7d')]||!_0x98dfaf[_0x6aaa('0x7e')]||!_0x98dfaf['transcribeRegion']||!_0x98dfaf['language']||!_0x98dfaf[_0x6aaa('0x7f')]){throw new db['Sequelize'][(_0x6aaa('0x59'))](_0x6aaa('0x80'));}if(_0x4de3d5['body'][_0x6aaa('0x81')]&&(!_0x98dfaf['sentiment']||!_0x98dfaf[_0x6aaa('0x82')]||!_0x98dfaf[_0x6aaa('0x83')]||!_0x98dfaf['language']||!_0x98dfaf[_0x6aaa('0x7f')])){throw new db[(_0x6aaa('0x58'))][(_0x6aaa('0x59'))](_0x6aaa('0x84'));}return db[_0x6aaa('0x85')][_0x6aaa('0x7c')]({'where':{'id':_0x98dfaf[_0x6aaa('0x7e')]}});}})[_0x6aaa('0x29')](function(_0x18e8cf){if(!_0x18e8cf){throw new db[(_0x6aaa('0x58'))][(_0x6aaa('0x59'))](_0x6aaa('0x86'));}if(!_0x18e8cf[_0x6aaa('0x87')]||!_0x18e8cf[_0x6aaa('0x88')]){throw new db[(_0x6aaa('0x58'))][(_0x6aaa('0x59'))](_0x6aaa('0x89'));}_0xdf4e60=_0x18e8cf;return getBucketslist(_0xdf4e60['data1'],_0xdf4e60[_0x6aaa('0x88')],_0x98dfaf[_0x6aaa('0x8a')]);})[_0x6aaa('0x29')](function(_0x1e85cc){if(_0x1e85cc&&_0x1e85cc[_0x6aaa('0x8b')]){var _0x3e25e5=_[_0x6aaa('0x4c')](_0x1e85cc[_0x6aaa('0x8b')],function(_0x55cfa4){return _0x55cfa4['Name']===_0x98dfaf['bucket'];});if(!_0x3e25e5){logger[_0x6aaa('0x64')](util['format'](_0x6aaa('0x8c'),_0x4de3d5['params']['id'],_0x98dfaf[_0x6aaa('0x7f')]));return createBucket(_0xdf4e60[_0x6aaa('0x87')],_0xdf4e60[_0x6aaa('0x88')],_0x98dfaf[_0x6aaa('0x8a')],_0x98dfaf['bucket']);}logger[_0x6aaa('0x64')](util[_0x6aaa('0x36')](_0x6aaa('0x8d'),_0x4de3d5['params']['id'],_0x98dfaf['bucket']));return;}})[_0x6aaa('0x29')](function(_0x1639b1){if(_0x474f70['transcribeStatus']===_0x6aaa('0x8e')){return transcribe(_0x4de3d5[_0x6aaa('0x48')]['id'],_0xdf4e60[_0x6aaa('0x87')],_0xdf4e60[_0x6aaa('0x88')],_0x98dfaf[_0x6aaa('0x8a')],_0x98dfaf[_0x6aaa('0x7f')],_0x474f70[_0x6aaa('0x57')],_0x98dfaf[_0x6aaa('0x8f')]);}else{logger[_0x6aaa('0x64')](util['format'](_0x6aaa('0x90'),_0x4de3d5['params']['id']));return{'transcribeStatus':_0x6aaa('0x91')};}})['then'](function(_0x406b61){if(_0x406b61){_0x406b61[_0x6aaa('0x92')]=_0x4de3d5[_0x6aaa('0x4e')][_0x6aaa('0x81')];return _0x474f70[_0x6aaa('0x93')](_0x406b61);}})['then'](respondWithResult(_0x4fc940,null))[_0x6aaa('0x46')](handleError(_0x4fc940,null));};function writeFile(_0xafaf6c,_0x2e9e7b){return new Promise(function(_0x518309,_0x5a8215){fs['writeFile'](_0x2e9e7b,_0xafaf6c,function(_0x47d7c6,_0x35acef){if(_0x47d7c6){return _0x5a8215(_0x47d7c6);}else{return _0x518309(_0x35acef);}});});}exports['downloadTranscribe']=function(_0x2b61aa,_0x10a53d,_0x954521){return db[_0x6aaa('0x2f')]['findOne']({'where':{'id':_0x2b61aa[_0x6aaa('0x48')]['id']}})['then'](handleEntityNotFound(_0x10a53d))[_0x6aaa('0x29')](function(_0x321b45){if(_0x321b45&&_0x321b45[_0x6aaa('0x94')]){var _0x108feb=_0x321b45[_0x6aaa('0x94')];var _0x1f2b4b=config[_0x6aaa('0x95')]+'/server/files/transcribes/transcribe_'+_0x321b45['id']+_0x6aaa('0x96');if(fs[_0x6aaa('0x54')](_0x1f2b4b)){return _0x1f2b4b;}return writeFile(_0x108feb,_0x1f2b4b)[_0x6aaa('0x29')](function(){return _0x1f2b4b;});}else{throw new db[(_0x6aaa('0x58'))][(_0x6aaa('0x59'))](_0x6aaa('0x97'));}})[_0x6aaa('0x29')](function(_0x4aa13c){return _0x10a53d[_0x6aaa('0x50')](_0x4aa13c);})['catch'](handleError(_0x10a53d));}; \ No newline at end of file +var _0xf1db=['Sequelize','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','data1','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','uuid/v4','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','VoiceRecording','rawAttributes','model','differenceBy','map','name','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','merge','type','filter','count','includeAll','include','rows','show','params','options','find','catch','create','body','describe','download','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','token','uniqueid','$and','push','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','upload','startTranscriptionJob','readFileSync','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne'];(function(_0x358321,_0x18c7a3){var _0x118046=function(_0x373e5f){while(--_0x373e5f){_0x358321['push'](_0x358321['shift']());}};_0x118046(++_0x18c7a3);}(_0xf1db,0xb9));var _0xbf1d=function(_0x570e8c,_0x5710fe){_0x570e8c=_0x570e8c-0x0;var _0x122ab6=_0xf1db[_0x570e8c];return _0x122ab6;};'use strict';var emlformat=require(_0xbf1d('0x0'));var rimraf=require(_0xbf1d('0x1'));var zipdir=require(_0xbf1d('0x2'));var jsonpatch=require(_0xbf1d('0x3'));var rp=require(_0xbf1d('0x4'));var moment=require(_0xbf1d('0x5'));var BPromise=require(_0xbf1d('0x6'));var Mustache=require(_0xbf1d('0x7'));var util=require(_0xbf1d('0x8'));var path=require(_0xbf1d('0x9'));var sox=require(_0xbf1d('0xa'));var csv=require(_0xbf1d('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf1d('0xc'));var _=require(_0xbf1d('0xd'));var squel=require('squel');var crypto=require(_0xbf1d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbf1d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0xbf1d('0x10'));var Redis=require(_0xbf1d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbf1d('0x12'));var hardwareService=require(_0xbf1d('0x13'));var logger=require(_0xbf1d('0x14'))(_0xbf1d('0x15'));var utils=require('../../config/utils');var config=require(_0xbf1d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf1d('0x17'))['db'];function respondWithStatusCode(_0x56a7f1,_0xff5fc8){_0xff5fc8=_0xff5fc8||0xcc;return function(_0x522413){if(_0x522413){return _0x56a7f1[_0xbf1d('0x18')](_0xff5fc8);}return _0x56a7f1[_0xbf1d('0x19')](_0xff5fc8)[_0xbf1d('0x1a')]();};}function respondWithResult(_0x33973e,_0x5c1280){_0x5c1280=_0x5c1280||0xc8;return function(_0x37dbf2){if(_0x37dbf2){return _0x33973e[_0xbf1d('0x19')](_0x5c1280)[_0xbf1d('0x1b')](_0x37dbf2);}};}function respondWithFilteredResult(_0x93ec78,_0x28c5ef){return function(_0x1df5e3){if(_0x1df5e3){var _0xead464=typeof _0x28c5ef[_0xbf1d('0x1c')]===_0xbf1d('0x1d')&&typeof _0x28c5ef[_0xbf1d('0x1e')]===_0xbf1d('0x1d');var _0x3062ef=_0x1df5e3['count'];var _0x233063=_0xead464?0x0:_0x28c5ef[_0xbf1d('0x1c')];var _0x324134=_0xead464?_0x1df5e3['count']:_0x28c5ef[_0xbf1d('0x1c')]+_0x28c5ef[_0xbf1d('0x1e')];var _0x6e407d;if(_0x324134>=_0x3062ef){_0x324134=_0x3062ef;_0x6e407d=0xc8;}else{_0x6e407d=0xce;}_0x93ec78['status'](_0x6e407d);return _0x93ec78[_0xbf1d('0x1f')](_0xbf1d('0x20'),_0x233063+'-'+_0x324134+'/'+_0x3062ef)['json'](_0x1df5e3);}return null;};}function patchUpdates(_0x2c0d77){return function(_0x3b87f8){try{jsonpatch[_0xbf1d('0x21')](_0x3b87f8,_0x2c0d77,!![]);}catch(_0x4c149d){return BPromise[_0xbf1d('0x22')](_0x4c149d);}return _0x3b87f8[_0xbf1d('0x23')]();};}function saveUpdates(_0x54c6c5,_0xbc866c){return function(_0x179b36){if(_0x179b36){return _0x179b36[_0xbf1d('0x24')](_0x54c6c5)[_0xbf1d('0x25')](function(_0x227209){return _0x227209;});}return null;};}function removeEntity(_0x2afcff,_0x553d6e){return function(_0x20351a){if(_0x20351a){return _0x20351a[_0xbf1d('0x26')]()['then'](function(){_0x2afcff[_0xbf1d('0x19')](0xcc)[_0xbf1d('0x1a')]();});}};}function handleEntityNotFound(_0x41299d,_0x5a650e){return function(_0x2dbcdf){if(!_0x2dbcdf){_0x41299d[_0xbf1d('0x18')](0x194);}return _0x2dbcdf;};}function handleError(_0x971926,_0x365ad2){_0x365ad2=_0x365ad2||0x1f4;return function(_0x2dc675){logger[_0xbf1d('0x27')](_0x2dc675['stack']);if(_0x2dc675['name']){delete _0x2dc675['name'];}_0x971926[_0xbf1d('0x19')](_0x365ad2)[_0xbf1d('0x28')](_0x2dc675);};}exports[_0xbf1d('0x29')]=function(_0x3ee853,_0x3802e1){var _0x7237da={},_0x250e46={},_0x3758d0={'count':0x0,'rows':[]};var _0x5b95df=_['map'](db[_0xbf1d('0x2a')][_0xbf1d('0x2b')],function(_0x2d4d42){return{'name':_0x2d4d42['fieldName'],'type':_0x2d4d42['type']['key']};});_0x250e46[_0xbf1d('0x2c')]=_[_0xbf1d('0x2d')](_[_0xbf1d('0x2e')](_0x5b95df,_0xbf1d('0x2f')),['format']);_0x250e46[_0xbf1d('0x30')]=_['keys'](_0x3ee853['query']);_0x250e46[_0xbf1d('0x31')]=_[_0xbf1d('0x32')](_0x250e46[_0xbf1d('0x2c')],_0x250e46[_0xbf1d('0x30')]);_0x7237da['attributes']=_[_0xbf1d('0x32')](_0x250e46[_0xbf1d('0x2c')],qs['fields'](_0x3ee853[_0xbf1d('0x30')]['fields']));_0x7237da[_0xbf1d('0x33')]=_0x7237da[_0xbf1d('0x33')][_0xbf1d('0x34')]?_0x7237da[_0xbf1d('0x33')]:_0x250e46[_0xbf1d('0x2c')];if(!_0x3ee853[_0xbf1d('0x30')][_0xbf1d('0x35')]('nolimit')){_0x7237da[_0xbf1d('0x1e')]=qs[_0xbf1d('0x1e')](_0x3ee853['query']['limit']);_0x7237da[_0xbf1d('0x1c')]=qs[_0xbf1d('0x1c')](_0x3ee853[_0xbf1d('0x30')][_0xbf1d('0x1c')]);}_0x7237da[_0xbf1d('0x36')]=qs[_0xbf1d('0x37')](_0x3ee853[_0xbf1d('0x30')][_0xbf1d('0x37')]);_0x7237da[_0xbf1d('0x38')]=qs['filters'](_[_0xbf1d('0x39')](_0x3ee853['query'],_0x250e46[_0xbf1d('0x31')]),_0x5b95df);if(_0x3ee853['query']['filter']){_0x7237da['where']=_[_0xbf1d('0x3a')](_0x7237da['where'],{'$or':_[_0xbf1d('0x2e')](_0x5b95df,function(_0x20e874){if(_0x20e874[_0xbf1d('0x3b')]!=='VIRTUAL'){var _0x3cac72={};_0x3cac72[_0x20e874[_0xbf1d('0x2f')]]={'$like':'%'+_0x3ee853[_0xbf1d('0x30')][_0xbf1d('0x3c')]+'%'};return _0x3cac72;}})});}_0x7237da=_[_0xbf1d('0x3a')]({},_0x7237da,_0x3ee853['options']);var _0x3f18c4={'where':_0x7237da[_0xbf1d('0x38')]};return db[_0xbf1d('0x2a')][_0xbf1d('0x3d')](_0x3f18c4)['then'](function(_0x3cd3c5){_0x3758d0[_0xbf1d('0x3d')]=_0x3cd3c5;if(_0x3ee853[_0xbf1d('0x30')][_0xbf1d('0x3e')]){_0x7237da[_0xbf1d('0x3f')]=[{'all':!![]}];}return db[_0xbf1d('0x2a')]['findAll'](_0x7237da);})['then'](function(_0x2b47e6){_0x3758d0[_0xbf1d('0x40')]=_0x2b47e6;return _0x3758d0;})[_0xbf1d('0x25')](respondWithFilteredResult(_0x3802e1,_0x7237da))['catch'](handleError(_0x3802e1,null));};exports[_0xbf1d('0x41')]=function(_0x689314,_0x48463a){var _0x112467={'raw':![],'where':{'id':_0x689314[_0xbf1d('0x42')]['id']}},_0x2a7c9d={};_0x2a7c9d[_0xbf1d('0x2c')]=_['keys'](db[_0xbf1d('0x2a')]['rawAttributes']);_0x2a7c9d['query']=_['keys'](_0x689314[_0xbf1d('0x30')]);_0x2a7c9d[_0xbf1d('0x31')]=_[_0xbf1d('0x32')](_0x2a7c9d[_0xbf1d('0x2c')],_0x2a7c9d[_0xbf1d('0x30')]);_0x112467['attributes']=_[_0xbf1d('0x32')](_0x2a7c9d[_0xbf1d('0x2c')],qs['fields'](_0x689314['query']['fields']));_0x112467['attributes']=_0x112467[_0xbf1d('0x33')][_0xbf1d('0x34')]?_0x112467['attributes']:_0x2a7c9d['model'];if(_0x689314[_0xbf1d('0x30')]['includeAll']){_0x112467[_0xbf1d('0x3f')]=[{'all':!![]}];}_0x112467=_[_0xbf1d('0x3a')]({},_0x112467,_0x689314[_0xbf1d('0x43')]);return db['VoiceRecording'][_0xbf1d('0x44')](_0x112467)[_0xbf1d('0x25')](handleEntityNotFound(_0x48463a,null))[_0xbf1d('0x25')](respondWithResult(_0x48463a,null))[_0xbf1d('0x45')](handleError(_0x48463a,null));};exports[_0xbf1d('0x46')]=function(_0x459210,_0x26afc9){return db[_0xbf1d('0x2a')][_0xbf1d('0x46')](_0x459210[_0xbf1d('0x47')],{})[_0xbf1d('0x25')](respondWithResult(_0x26afc9,0xc9))['catch'](handleError(_0x26afc9,null));};exports[_0xbf1d('0x24')]=function(_0x3306f7,_0x433583){if(_0x3306f7['body']['id']){delete _0x3306f7[_0xbf1d('0x47')]['id'];}return db[_0xbf1d('0x2a')][_0xbf1d('0x44')]({'where':{'id':_0x3306f7[_0xbf1d('0x42')]['id']}})[_0xbf1d('0x25')](handleEntityNotFound(_0x433583,null))[_0xbf1d('0x25')](saveUpdates(_0x3306f7[_0xbf1d('0x47')],null))['then'](respondWithResult(_0x433583,null))[_0xbf1d('0x45')](handleError(_0x433583,null));};exports['describe']=function(_0x511b50,_0x5b7dd8){return db['VoiceRecording'][_0xbf1d('0x48')]()['then'](respondWithResult(_0x5b7dd8,null))[_0xbf1d('0x45')](handleError(_0x5b7dd8,null));};exports[_0xbf1d('0x49')]=function(_0x3da27b,_0x2c86e8,_0x5abe0a){var _0x101c02=require('../../components/encryptor');var _0x59a044=![];var _0x30c18d={};if(_0x3da27b['query'][_0xbf1d('0x3b')]&&_0x3da27b[_0xbf1d('0x30')][_0xbf1d('0x3b')]==='uniqueid'){_0x30c18d['uniqueid']=_0x3da27b['params']['id'];}else{_0x30c18d['id']=_0x3da27b[_0xbf1d('0x42')]['id'];}return db[_0xbf1d('0x2a')][_0xbf1d('0x44')]({'where':_0x30c18d,'attributes':['id',_0xbf1d('0x4a')],'raw':!![]})['then'](handleEntityNotFound(_0x2c86e8,null))[_0xbf1d('0x25')](function(_0x1bfe70){if(_0x1bfe70){var _0x59fc91=_0x1bfe70[_0xbf1d('0x4a')];var _0x499b76=util[_0xbf1d('0x4b')](_0xbf1d('0x4c'),_0x59fc91);if(fs[_0xbf1d('0x4d')](_0x499b76)){_0x59a044=!![];return _0x101c02[_0xbf1d('0x4e')](_0x499b76,_0x59fc91,config[_0xbf1d('0x4f')][_0xbf1d('0x50')])[_0xbf1d('0x25')](function(){return _0x1bfe70;});}return _0x1bfe70;}})[_0xbf1d('0x25')](function(_0x28dcfb){if(_0x28dcfb){var _0x7dac57=_0x28dcfb[_0xbf1d('0x4a')];if(!fs['existsSync'](_0x7dac57)){throw new db['Sequelize'][(_0xbf1d('0x51'))](_0xbf1d('0x52'));}if(_0x28dcfb['filename']){return _0x2c86e8['download'](_0x7dac57,_0x28dcfb[_0xbf1d('0x53')]+path[_0xbf1d('0x54')](_0x7dac57),function(){if(_0x59a044){fs[_0xbf1d('0x55')](_0x7dac57);}});}else{return _0x2c86e8[_0xbf1d('0x49')](_0x7dac57,function(_0x2f85f7){if(_0x59a044){fs[_0xbf1d('0x55')](_0x7dac57);}});}}})['catch'](function(_0x4a2281){if(_0x4a2281[_0xbf1d('0x56')]==='VoiceRecording\x20not\x20found'){_0x2c86e8['status'](0x194)[_0xbf1d('0x28')](_0xbf1d('0x57'));}else{return handleError(_0x2c86e8,null);}});};exports[_0xbf1d('0x58')]=function(_0x5b2cb3,_0x50ea33,_0x514d07){var _0x4ec8a4=require(_0xbf1d('0x59'));var _0xb6503b=![];var _0x23c161={'$and':[db[_0xbf1d('0x5a')]['where'](db[_0xbf1d('0x5a')]['fn'](_0xbf1d('0x5b'),db[_0xbf1d('0x5a')]['col']('uniqueid')),_0x5b2cb3[_0xbf1d('0x30')][_0xbf1d('0x5c')])]};if(_0x5b2cb3[_0xbf1d('0x30')]['type']&&_0x5b2cb3[_0xbf1d('0x30')]['type']===_0xbf1d('0x5d')){_0x23c161[_0xbf1d('0x5e')][_0xbf1d('0x5f')]({'uniqueid':_0x5b2cb3[_0xbf1d('0x42')]['id']});}else{_0x23c161['$and'][_0xbf1d('0x5f')]({'id':_0x5b2cb3[_0xbf1d('0x42')]['id']});}return db['VoiceRecording'][_0xbf1d('0x44')]({'where':_0x23c161,'attributes':['id',_0xbf1d('0x4a')],'raw':!![]})[_0xbf1d('0x25')](handleEntityNotFound(_0x50ea33,null))['then'](function(_0xf124ce){if(_0xf124ce){var _0x4b3aa1=util['format']('%s.cypher',_0xf124ce['value']);if(fs[_0xbf1d('0x4d')](_0x4b3aa1)){_0xb6503b=!![];return _0x4ec8a4[_0xbf1d('0x4e')](_0x4b3aa1,_0xf124ce[_0xbf1d('0x4a')],config[_0xbf1d('0x4f')][_0xbf1d('0x50')])[_0xbf1d('0x25')](function(){return _0xf124ce;});}return _0xf124ce;}})[_0xbf1d('0x25')](function(_0x13fc87){if(_0x13fc87){if(!fs[_0xbf1d('0x4d')](_0x13fc87[_0xbf1d('0x4a')])){throw new db['Sequelize'][(_0xbf1d('0x51'))](_0xbf1d('0x52'));}if(_0x13fc87[_0xbf1d('0x53')]){return _0x50ea33[_0xbf1d('0x49')](_0x13fc87[_0xbf1d('0x4a')],_0x13fc87[_0xbf1d('0x53')]+path[_0xbf1d('0x54')](_0x13fc87['value']),function(){if(_0xb6503b){fs[_0xbf1d('0x55')](_0x13fc87['value']);}});}else{return _0x50ea33[_0xbf1d('0x49')](_0x13fc87['value'],function(_0x23dc3a){if(_0xb6503b){fs['unlink'](_0x13fc87[_0xbf1d('0x4a')]);}});}}})[_0xbf1d('0x45')](handleError(_0x50ea33,null));};exports['destroy']=function(_0x192f41,_0x32d575){return db[_0xbf1d('0x2a')][_0xbf1d('0x44')]({'where':{'id':_0x192f41[_0xbf1d('0x42')]['id']}})[_0xbf1d('0x25')](function(_0x32210f){if(_[_0xbf1d('0x60')](_0x32210f)){throw new ReferenceError(_0xbf1d('0x61'));}return _0x32210f;})[_0xbf1d('0x25')](function(_0x5952bd){var _0x858ed8=_0x5952bd[_0xbf1d('0x4a')];logger[_0xbf1d('0x62')](_0xbf1d('0x63'),_0x858ed8);if(!_[_0xbf1d('0x60')](_0x5952bd[_0xbf1d('0x4a')])&&fs[_0xbf1d('0x4d')](_0x858ed8)){logger[_0xbf1d('0x62')](_0xbf1d('0x64')+_0x858ed8+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xbf1d('0x65')](_0x858ed8);}_0x858ed8=_0x858ed8+_0xbf1d('0x66');if(!_[_0xbf1d('0x60')](_0x5952bd[_0xbf1d('0x4a')])&&fs[_0xbf1d('0x4d')](_0x858ed8)){logger[_0xbf1d('0x62')](_0xbf1d('0x64')+_0x858ed8+_0xbf1d('0x67'));fs['unlinkSync'](_0x858ed8);}return _0x5952bd;})[_0xbf1d('0x25')](function(_0xbcd8cf){if(!_0xbcd8cf)throw new InternalError();return _0xbcd8cf[_0xbf1d('0x26')]();})['then'](function(){_0x32d575[_0xbf1d('0x19')](0xcc)['end']();})[_0xbf1d('0x45')](handleError(_0x32d575,null));};function getBucketslist(_0x71bb28,_0x2e463f,_0x1e4a53){return new Promise(function(_0x3a014c,_0x4e45d5){var _0x42dac2=new AWS['S3']({'accessKeyId':_0x2e463f,'secretAccessKey':_0x71bb28,'region':_0x1e4a53});_0x42dac2[_0xbf1d('0x68')]({},function(_0x88dcfa,_0x1ddfec){if(_0x88dcfa){return _0x4e45d5(_0x88dcfa);}else{return _0x3a014c(_0x1ddfec);}});});}function createBucket(_0x3c41e6,_0x84e7c4,_0x8fe4ec,_0x593ba6){return new Promise(function(_0x253355,_0x2467f8){var _0x483d11=new AWS['S3']({'accessKeyId':_0x84e7c4,'secretAccessKey':_0x3c41e6,'region':_0x8fe4ec});_0x483d11[_0xbf1d('0x69')]({'Bucket':_0x593ba6},function(_0x1b8020,_0x5ac9a4){if(_0x1b8020){return _0x2467f8(_0x1b8020);}else{return _0x253355(_0x5ac9a4);}});});}function uploadFile(_0xf8b577,_0x333e6c,_0x56dc2b,_0x4c1b3e,_0x376a09,_0x307981){return new Promise(function(_0x1acaed,_0x28b868){var _0xda8034=new AWS['S3']({'accessKeyId':_0x333e6c,'secretAccessKey':_0xf8b577,'region':_0x56dc2b});_0xda8034[_0xbf1d('0x6a')]({'Bucket':_0x4c1b3e,'Key':_0x376a09,'Body':_0x307981},function(_0x4df3a4,_0x1ff8d5){if(_0x4df3a4){return _0x28b868(_0x4df3a4);}else{return _0x1acaed(_0x1ff8d5);}});});}function startTranscribe(_0x2efc9b,_0x5344b4,_0x22040c,_0x44353f,_0x4d08f1,_0x5eaa2e){return new Promise(function(_0x41ff72,_0x5de388){var _0x10d2e4=new AWS['TranscribeService']({'accessKeyId':_0x5344b4,'secretAccessKey':_0x2efc9b,'region':_0x22040c});_0x10d2e4[_0xbf1d('0x6b')]({'TranscriptionJobName':_0x44353f,'LanguageCode':_0x4d08f1,'Media':{'MediaFileUri':_0x5eaa2e}},function(_0x38daba,_0x1e3b31){if(_0x38daba){return _0x5de388(_0x38daba);}else{return _0x41ff72(_0x1e3b31);}});});}function transcribe(_0x16fb45,_0x194383,_0x126004,_0x26967f,_0x4b3e99,_0xa5a35f,_0x3afe9b){return new Promise(function(_0x5f108f,_0x53d868){var _0x122eb5={};logger[_0xbf1d('0x62')](util[_0xbf1d('0x4b')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x16fb45,_0x4b3e99));return uploadFile(_0x194383,_0x126004,_0x26967f,_0x4b3e99,path['basename'](_0xa5a35f),fs[_0xbf1d('0x6c')](_0xa5a35f))[_0xbf1d('0x25')](function(_0x11a307){logger['info'](util[_0xbf1d('0x4b')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x16fb45,_0x4b3e99,_0x11a307[_0xbf1d('0x6d')]));_0x122eb5['bucket']=_0x11a307[_0xbf1d('0x6e')];_0x122eb5[_0xbf1d('0x6f')]=_0x11a307['Location'];logger[_0xbf1d('0x62')](util['format'](_0xbf1d('0x70'),_0x16fb45));return startTranscribe(_0x194383,_0x126004,_0x26967f,uuidv4(),_0x3afe9b,_0x11a307[_0xbf1d('0x6d')]);})[_0xbf1d('0x25')](function(_0x3ef0d1){logger['info'](util[_0xbf1d('0x4b')](_0xbf1d('0x71'),_0x16fb45,_0x3ef0d1[_0xbf1d('0x72')][_0xbf1d('0x73')]));_0x122eb5[_0xbf1d('0x74')]=_0x3ef0d1[_0xbf1d('0x72')][_0xbf1d('0x73')];_0x122eb5[_0xbf1d('0x75')]=_0x3ef0d1['TranscriptionJob'][_0xbf1d('0x76')];return _0x5f108f(_0x122eb5);})[_0xbf1d('0x45')](function(_0x2fcc3c){return _0x53d868(_0x2fcc3c);});});}exports[_0xbf1d('0x77')]=function(_0x398dc8,_0x452f7a,_0x4b309c){var _0x273af6;var _0x13baea;var _0x5e2932;var _0x3dab58=require(_0xbf1d('0x59'));return db[_0xbf1d('0x2a')][_0xbf1d('0x78')]({'where':{'id':_0x398dc8[_0xbf1d('0x42')]['id']}})[_0xbf1d('0x25')](function(_0x75f1e6){if(_0x75f1e6){var _0x19e1aa=util[_0xbf1d('0x4b')]('%s.cypher',_0x75f1e6[_0xbf1d('0x4a')]);if(fs['existsSync'](_0x19e1aa)){cypher=!![];return _0x3dab58[_0xbf1d('0x4e')](_0x19e1aa,_0x75f1e6[_0xbf1d('0x4a')],config[_0xbf1d('0x4f')][_0xbf1d('0x50')])[_0xbf1d('0x25')](function(){return _0x75f1e6;});}return _0x75f1e6;}})[_0xbf1d('0x25')](function(_0x3126c6){if(!_0x3126c6){throw new db[(_0xbf1d('0x79'))][(_0xbf1d('0x51'))](_0xbf1d('0x7a'));}_0x13baea=_0x3126c6;return db[_0xbf1d('0x7b')]['findOne']({'where':{'id':0x1}});})[_0xbf1d('0x25')](handleEntityNotFound(_0x452f7a,null))['then'](function(_0x290df1){if(_0x290df1){_0x273af6=_0x290df1;if(!_0x273af6[_0xbf1d('0x7c')]||!_0x273af6[_0xbf1d('0x7d')]||!_0x273af6['transcribeRegion']||!_0x273af6[_0xbf1d('0x7e')]||!_0x273af6[_0xbf1d('0x7f')]){throw new db['Sequelize'][(_0xbf1d('0x51'))](_0xbf1d('0x80'));}if(_0x398dc8[_0xbf1d('0x47')][_0xbf1d('0x81')]&&(!_0x273af6[_0xbf1d('0x82')]||!_0x273af6[_0xbf1d('0x83')]||!_0x273af6['sentimentRegion']||!_0x273af6[_0xbf1d('0x7e')]||!_0x273af6['bucket'])){throw new db[(_0xbf1d('0x79'))][(_0xbf1d('0x51'))](_0xbf1d('0x84'));}return db[_0xbf1d('0x85')][_0xbf1d('0x78')]({'where':{'id':_0x273af6[_0xbf1d('0x7d')]}});}})[_0xbf1d('0x25')](function(_0x4c37e7){if(!_0x4c37e7){throw new db[(_0xbf1d('0x79'))]['ValidationError'](_0xbf1d('0x86'));}if(!_0x4c37e7['data1']||!_0x4c37e7[_0xbf1d('0x87')]){throw new db[(_0xbf1d('0x79'))][(_0xbf1d('0x51'))]('Cloud\x20Provider\x20not\x20configured');}_0x5e2932=_0x4c37e7;return getBucketslist(_0x5e2932[_0xbf1d('0x88')],_0x5e2932[_0xbf1d('0x87')],_0x273af6[_0xbf1d('0x89')]);})['then'](function(_0x1f9e2d){if(_0x1f9e2d&&_0x1f9e2d[_0xbf1d('0x8a')]){var _0x5f4146=_[_0xbf1d('0x44')](_0x1f9e2d[_0xbf1d('0x8a')],function(_0x53876d){return _0x53876d['Name']===_0x273af6[_0xbf1d('0x7f')];});if(!_0x5f4146){logger[_0xbf1d('0x62')](util['format'](_0xbf1d('0x8b'),_0x398dc8['params']['id'],_0x273af6['bucket']));return createBucket(_0x5e2932[_0xbf1d('0x88')],_0x5e2932[_0xbf1d('0x87')],_0x273af6[_0xbf1d('0x89')],_0x273af6['bucket']);}logger[_0xbf1d('0x62')](util[_0xbf1d('0x4b')](_0xbf1d('0x8c'),_0x398dc8['params']['id'],_0x273af6['bucket']));return;}})[_0xbf1d('0x25')](function(_0x2d63f3){if(_0x13baea['transcribeStatus']===_0xbf1d('0x8d')){return transcribe(_0x398dc8[_0xbf1d('0x42')]['id'],_0x5e2932[_0xbf1d('0x88')],_0x5e2932[_0xbf1d('0x87')],_0x273af6[_0xbf1d('0x89')],_0x273af6[_0xbf1d('0x7f')],_0x13baea[_0xbf1d('0x4a')],_0x273af6[_0xbf1d('0x7e')]);}else{logger['info'](util[_0xbf1d('0x4b')](_0xbf1d('0x8e'),_0x398dc8[_0xbf1d('0x42')]['id']));return{'transcribeStatus':_0xbf1d('0x8f')};}})[_0xbf1d('0x25')](function(_0x3d66e7){if(_0x3d66e7){_0x3d66e7[_0xbf1d('0x90')]=_0x398dc8[_0xbf1d('0x47')][_0xbf1d('0x81')];return _0x13baea[_0xbf1d('0x91')](_0x3d66e7);}})['then'](respondWithResult(_0x452f7a,null))[_0xbf1d('0x45')](handleError(_0x452f7a,null));};function writeFile(_0x445064,_0x34538b){return new Promise(function(_0x187e03,_0x3eda4c){fs[_0xbf1d('0x92')](_0x34538b,_0x445064,function(_0x373325,_0x2564bf){if(_0x373325){return _0x3eda4c(_0x373325);}else{return _0x187e03(_0x2564bf);}});});}exports[_0xbf1d('0x93')]=function(_0x39e8eb,_0x7d147b,_0x4a4c5f){return db[_0xbf1d('0x2a')]['findOne']({'where':{'id':_0x39e8eb['params']['id']}})[_0xbf1d('0x25')](handleEntityNotFound(_0x7d147b))[_0xbf1d('0x25')](function(_0x1bf114){if(_0x1bf114&&_0x1bf114[_0xbf1d('0x94')]){var _0x1c4b88=_0x1bf114[_0xbf1d('0x94')];var _0x3bf445=config[_0xbf1d('0x95')]+_0xbf1d('0x96')+_0x1bf114['id']+_0xbf1d('0x97');if(fs[_0xbf1d('0x4d')](_0x3bf445)){return _0x3bf445;}return writeFile(_0x1c4b88,_0x3bf445)[_0xbf1d('0x25')](function(){return _0x3bf445;});}else{throw new db[(_0xbf1d('0x79'))][(_0xbf1d('0x51'))](_0xbf1d('0x98'));}})['then'](function(_0xebc5b5){return _0x7d147b[_0xbf1d('0x49')](_0xebc5b5);})['catch'](handleError(_0x7d147b));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 87cfecd..e97b8f0 100644 --- a/server/api/voiceRecording/voiceRecording.model.js +++ b/server/api/voiceRecording/voiceRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x834d=['./voiceRecording.attributes','exports','voice_recordings','uniqueid','transcribeStatus'];(function(_0x4e5969,_0x59d73e){var _0x59d7ce=function(_0x13a624){while(--_0x13a624){_0x4e5969['push'](_0x4e5969['shift']());}};_0x59d7ce(++_0x59d73e);}(_0x834d,0x140));var _0xd834=function(_0x1077ae,_0x23c9ba){_0x1077ae=_0x1077ae-0x0;var _0x4415d0=_0x834d[_0x1077ae];return _0x4415d0;};'use strict';var attributes=require(_0xd834('0x0'));module[_0xd834('0x1')]=function(_0x595403,_0x14a18f){return _0x595403['define']('VoiceRecording',attributes,{'tableName':_0xd834('0x2'),'paranoid':![],'indexes':[{'name':_0xd834('0x3'),'fields':[_0xd834('0x3')]},{'name':_0xd834('0x4'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc3fe=['voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording'];(function(_0x1ce650,_0x21ad20){var _0x26793c=function(_0x25c85d){while(--_0x25c85d){_0x1ce650['push'](_0x1ce650['shift']());}};_0x26793c(++_0x21ad20);}(_0xc3fe,0xff));var _0xec3f=function(_0x101d5b,_0x40cfd){_0x101d5b=_0x101d5b-0x0;var _0x382a50=_0xc3fe[_0x101d5b];return _0x382a50;};'use strict';var attributes=require(_0xec3f('0x0'));module[_0xec3f('0x1')]=function(_0xc1dd73,_0x4d38a1){return _0xc1dd73[_0xec3f('0x2')](_0xec3f('0x3'),attributes,{'tableName':_0xec3f('0x4'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xec3f('0x5')]},{'name':_0xec3f('0x6'),'fields':[_0xec3f('0x6')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index bcbcd61..78fe382 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa456=['UpdateVoiceRecording','options','attributes','stringify','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','body','existsSync','value','%s.cypher','encryptFile','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x110e11,_0x2386fb){var _0x16d509=function(_0x58d8e7){while(--_0x58d8e7){_0x110e11['push'](_0x110e11['shift']());}};_0x16d509(++_0x2386fb);}(_0xa456,0x142));var _0x6a45=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xa456[_0x3fba9f];return _0x192cf1;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var moment=require(_0x6a45('0x2'));var BPromise=require(_0x6a45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a45('0x4'));var db=require(_0x6a45('0x5'))['db'];var utils=require(_0x6a45('0x6'));var logger=require('../../config/logger')(_0x6a45('0x7'));var config=require(_0x6a45('0x8'));var jayson=require(_0x6a45('0x9'));var client=jayson[_0x6a45('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25cf8d,_0x26bfc0,_0x214514){return new BPromise(function(_0x19e67c,_0x3deb09){return client['request'](_0x25cf8d,_0x214514)[_0x6a45('0xb')](function(_0x517040){logger[_0x6a45('0xc')](_0x6a45('0xd'),_0x26bfc0,_0x6a45('0xe'));logger[_0x6a45('0xf')](_0x6a45('0x10'),_0x26bfc0,'request\x20sent',JSON['stringify'](_0x517040));if(_0x517040[_0x6a45('0x11')]){if(_0x517040[_0x6a45('0x11')]['code']===0x1f4){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x26bfc0,_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);return _0x3deb09(_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);}logger[_0x6a45('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x26bfc0,_0x517040['error'][_0x6a45('0x12')]);return _0x19e67c(_0x517040[_0x6a45('0x11')]['message']);}else{logger[_0x6a45('0xc')](_0x6a45('0xd'),_0x26bfc0,_0x6a45('0xe'));_0x19e67c(_0x517040[_0x6a45('0x13')]['message']);}})['catch'](function(_0x49023f){logger[_0x6a45('0x11')](_0x6a45('0xd'),_0x26bfc0,_0x49023f);_0x3deb09(_0x49023f);});});}exports[_0x6a45('0x14')]=function(_0x52a055){var _0x379c22=this;return new Promise(function(_0x102981,_0x3439c8){return db['VoiceRecording']['update'](_0x52a055['body'],{'raw':_0x52a055[_0x6a45('0x15')]?_0x52a055[_0x6a45('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52a055[_0x6a45('0x15')]?_0x52a055[_0x6a45('0x15')]['where']||null:null,'attributes':_0x52a055[_0x6a45('0x15')]?_0x52a055[_0x6a45('0x15')][_0x6a45('0x16')]||null:null,'limit':_0x52a055[_0x6a45('0x15')]?_0x52a055[_0x6a45('0x15')]['limit']||null:null})['then'](function(_0x3faae5){logger[_0x6a45('0xc')](_0x6a45('0x14'),_0x52a055);logger[_0x6a45('0xf')](_0x6a45('0x14'),_0x52a055,JSON[_0x6a45('0x17')](_0x3faae5));_0x102981(_0x3faae5);})[_0x6a45('0x18')](function(_0x4692f5){logger[_0x6a45('0x11')](_0x6a45('0x14'),_0x4692f5[_0x6a45('0x12')],_0x52a055);_0x3439c8(_0x379c22[_0x6a45('0x11')](0x1f4,_0x4692f5['message']));});});};exports[_0x6a45('0x19')]=function(_0x5a0389){var _0x1b83fa=this;return new Promise(function(_0x25467d,_0x28bdf0){var _0x2c7315=require(_0x6a45('0x1a'));var _0x526062;return db[_0x6a45('0x1b')][_0x6a45('0x1c')]({'attributes':['id',_0x6a45('0x1d')],'where':{'id':0x1},'raw':!![]})[_0x6a45('0xb')](function(_0x8265d9){_0x526062=_0x8265d9;return db[_0x6a45('0x1e')][_0x6a45('0x1f')](_0x5a0389[_0x6a45('0x20')]);})['then'](function(_0x14adb5){if(_0x526062[_0x6a45('0x1d')]&&fs[_0x6a45('0x21')](_0x14adb5[_0x6a45('0x22')])){var _0x3b07a1=util['format'](_0x6a45('0x23'),_0x14adb5[_0x6a45('0x22')]);return _0x2c7315[_0x6a45('0x24')](_0x14adb5[_0x6a45('0x22')],_0x3b07a1,config['secrets']['recording'])[_0x6a45('0xb')](function(){fs['unlink'](_0x14adb5[_0x6a45('0x22')]);logger['info'](_0x6a45('0x25'));return _0x14adb5;});}return _0x14adb5;})[_0x6a45('0xb')](function(_0x429900){logger[_0x6a45('0xc')](_0x6a45('0x19'),_0x5a0389);logger[_0x6a45('0xf')](_0x6a45('0x19'),_0x5a0389,JSON[_0x6a45('0x17')](_0x429900));_0x25467d(_0x429900);})[_0x6a45('0x18')](function(_0x36f4a4){logger[_0x6a45('0x11')](_0x6a45('0x19'),_0x36f4a4[_0x6a45('0x12')],_0x5a0389);_0x28bdf0(_0x1b83fa['error'](0x1f4,_0x36f4a4[_0x6a45('0x12')]));});});}; \ No newline at end of file +var _0x66fa=['CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceRecording,\x20%s,\x20%s','message','catch','VoiceRecording','update','body','options','raw','where','attributes','UpdateVoiceRecording','stringify'];(function(_0x16b509,_0x5bfd52){var _0x4f9d6f=function(_0x348d6f){while(--_0x348d6f){_0x16b509['push'](_0x16b509['shift']());}};_0x4f9d6f(++_0x5bfd52);}(_0x66fa,0x117));var _0xa66f=function(_0x551aeb,_0x3a8335){_0x551aeb=_0x551aeb-0x0;var _0x3884e2=_0x66fa[_0x551aeb];return _0x3884e2;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});}exports['UpdateVoiceRecording']=function(_0x1cbe64){var _0x55b59d=this;return new Promise(function(_0x4a28d4,_0x2f9da2){return db[_0xa66f('0x14')][_0xa66f('0x15')](_0x1cbe64[_0xa66f('0x16')],{'raw':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')][_0xa66f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')][_0xa66f('0x19')]||null:null,'attributes':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')][_0xa66f('0x1a')]||null:null,'limit':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')]['limit']||null:null})[_0xa66f('0xb')](function(_0xc5c82e){logger[_0xa66f('0xc')](_0xa66f('0x1b'),_0x1cbe64);logger['debug'](_0xa66f('0x1b'),_0x1cbe64,JSON[_0xa66f('0x1c')](_0xc5c82e));_0x4a28d4(_0xc5c82e);})[_0xa66f('0x13')](function(_0x16f1fa){logger['error']('UpdateVoiceRecording',_0x16f1fa[_0xa66f('0x12')],_0x1cbe64);_0x2f9da2(_0x55b59d['error'](0x1f4,_0x16f1fa[_0xa66f('0x12')]));});});};exports[_0xa66f('0x1d')]=function(_0x384164){var _0x57da7f=this;return new Promise(function(_0x4683c7,_0x1c2903){var _0x13495f=require(_0xa66f('0x1e'));var _0x17c103;return db[_0xa66f('0x1f')][_0xa66f('0x20')]({'attributes':['id',_0xa66f('0x21')],'where':{'id':0x1},'raw':!![]})[_0xa66f('0xb')](function(_0x117d03){_0x17c103=_0x117d03;return db[_0xa66f('0x14')][_0xa66f('0x22')](_0x384164[_0xa66f('0x16')]);})[_0xa66f('0xb')](function(_0x49f615){if(_0x17c103['callRecordingEncryption']&&fs[_0xa66f('0x23')](_0x49f615[_0xa66f('0x24')])){var _0x55f309=util[_0xa66f('0x25')](_0xa66f('0x26'),_0x49f615['value']);return _0x13495f[_0xa66f('0x27')](_0x49f615[_0xa66f('0x24')],_0x55f309,config[_0xa66f('0x28')][_0xa66f('0x29')])[_0xa66f('0xb')](function(){fs['unlink'](_0x49f615[_0xa66f('0x24')]);logger['info'](_0xa66f('0x2a'));return _0x49f615;});}return _0x49f615;})[_0xa66f('0xb')](function(_0x2e4dc8){logger['info'](_0xa66f('0x1d'),_0x384164);logger[_0xa66f('0x2b')]('CreateVoiceRecording',_0x384164,JSON[_0xa66f('0x1c')](_0x2e4dc8));_0x4683c7(_0x2e4dc8);})[_0xa66f('0x13')](function(_0xba9457){logger[_0xa66f('0xf')](_0xa66f('0x1d'),_0xba9457[_0xa66f('0x12')],_0x384164);_0x1c2903(_0x57da7f[_0xa66f('0xf')](0x1f4,_0xba9457[_0xa66f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 313fc43..1427c46 100644 --- a/server/api/voiceTransferReport/index.js +++ b/server/api/voiceTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1439=['fs-extra','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','post','put','update','delete','exports','multer','connect-timeout'];(function(_0x413221,_0x348dee){var _0x22db25=function(_0x483dbf){while(--_0x483dbf){_0x413221['push'](_0x413221['shift']());}};_0x22db25(++_0x348dee);}(_0x1439,0x8e));var _0x9143=function(_0x2f00d6,_0x234642){_0x2f00d6=_0x2f00d6-0x0;var _0x439da2=_0x1439[_0x2f00d6];return _0x439da2;};'use strict';var multer=require(_0x9143('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9143('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9143('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x9143('0x3'));var config=require(_0x9143('0x4'));var controller=require(_0x9143('0x5'));router[_0x9143('0x6')]('/',auth[_0x9143('0x7')](),controller['index']);router['get'](_0x9143('0x8'),auth[_0x9143('0x7')](),controller[_0x9143('0x9')]);router['get'](_0x9143('0xa'),auth[_0x9143('0x7')](),controller['show']);router[_0x9143('0xb')]('/',auth[_0x9143('0x7')](),controller['create']);router[_0x9143('0xc')](_0x9143('0xa'),auth[_0x9143('0x7')](),controller[_0x9143('0xd')]);router[_0x9143('0xe')](_0x9143('0xa'),auth[_0x9143('0x7')](),controller['destroy']);module[_0x9143('0xf')]=router; \ No newline at end of file +var _0x8cd1=['./voiceTransferReport.controller','get','index','isAuthenticated','show','post','put','update','/:id','destroy','multer','path','express','fs-extra','../../components/auth/service'];(function(_0x1b0e95,_0x52f557){var _0x5b42c0=function(_0x58c4c8){while(--_0x58c4c8){_0x1b0e95['push'](_0x1b0e95['shift']());}};_0x5b42c0(++_0x52f557);}(_0x8cd1,0xaf));var _0x18cd=function(_0x6eef34,_0x45ebcc){_0x6eef34=_0x6eef34-0x0;var _0x1bfade=_0x8cd1[_0x6eef34];return _0x1bfade;};'use strict';var multer=require(_0x18cd('0x0'));var util=require('util');var path=require(_0x18cd('0x1'));var timeout=require('connect-timeout');var express=require(_0x18cd('0x2'));var router=express['Router']();var fs_extra=require(_0x18cd('0x3'));var auth=require(_0x18cd('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x18cd('0x5'));router[_0x18cd('0x6')]('/',auth['isAuthenticated'](),controller[_0x18cd('0x7')]);router[_0x18cd('0x6')]('/describe',auth[_0x18cd('0x8')](),controller['describe']);router[_0x18cd('0x6')]('/:id',auth[_0x18cd('0x8')](),controller[_0x18cd('0x9')]);router[_0x18cd('0xa')]('/',auth[_0x18cd('0x8')](),controller['create']);router[_0x18cd('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x18cd('0xc')]);router['delete'](_0x18cd('0xd'),auth['isAuthenticated'](),controller[_0x18cd('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 0b2f5c2..ef3a6d8 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.attributes.js +++ b/server/api/voiceTransferReport/voiceTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc715=['STRING','sequelize','moment','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc715,0xfd));var _0x5c71=function(_0x28c752,_0x238454){_0x28c752=_0x28c752-0x0;var _0x30cd6c=_0xc715[_0x28c752];return _0x30cd6c;};'use strict';var Sequelize=require(_0x5c71('0x0'));var moment=require(_0x5c71('0x1'));module['exports']={'type':{'type':Sequelize[_0x5c71('0x2')]('blind','attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x5c71('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x5c71('0x3')]},'transferercalleridname':{'type':Sequelize[_0x5c71('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x5c71('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x5c71('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x5c71('0x3')]},'transferercontext':{'type':Sequelize[_0x5c71('0x3')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x5c71('0x3')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x5c71('0x3')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x5c71('0x3')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x5c71('0x3')]},'transfereecontext':{'type':Sequelize[_0x5c71('0x3')]},'transfereeexten':{'type':Sequelize[_0x5c71('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x5c71('0x3')]},'isexternal':{'type':Sequelize[_0x5c71('0x2')]('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x5c71('0x3')]}}; \ No newline at end of file +var _0xe741=['blind','attended','STRING','ENUM','Yes','moment','exports'];(function(_0x32e70d,_0x2caed0){var _0x3bf307=function(_0x349870){while(--_0x349870){_0x32e70d['push'](_0x32e70d['shift']());}};_0x3bf307(++_0x2caed0);}(_0xe741,0xe5));var _0x1e74=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xe741[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1e74('0x0'));module[_0x1e74('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1e74('0x2'),_0x1e74('0x3'))},'result':{'type':Sequelize[_0x1e74('0x4')]},'transfererchannel':{'type':Sequelize[_0x1e74('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x1e74('0x4')]},'transferercalleridname':{'type':Sequelize[_0x1e74('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1e74('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x1e74('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x1e74('0x4')]},'transferercontext':{'type':Sequelize[_0x1e74('0x4')]},'transfererexten':{'type':Sequelize[_0x1e74('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x1e74('0x4')]},'transfereechannel':{'type':Sequelize[_0x1e74('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x1e74('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x1e74('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1e74('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1e74('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x1e74('0x4')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x1e74('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x1e74('0x4')]},'isexternal':{'type':Sequelize[_0x1e74('0x5')](_0x1e74('0x6'),'No')},'context':{'type':Sequelize[_0x1e74('0x4')]},'extension':{'type':Sequelize[_0x1e74('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 51f6863..8318547 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.controller.js +++ b/server/api/voiceTransferReport/voiceTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x29a0=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3d7828,_0x4c3ac9){var _0x529af0=function(_0x50ebac){while(--_0x50ebac){_0x3d7828['push'](_0x3d7828['shift']());}};_0x529af0(++_0x4c3ac9);}(_0x29a0,0x1d4));var _0x029a=function(_0x59fa96,_0x20cbab){_0x59fa96=_0x59fa96-0x0;var _0x3f93e3=_0x29a0[_0x59fa96];return _0x3f93e3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x029a('0x0'));var zipdir=require(_0x029a('0x1'));var jsonpatch=require(_0x029a('0x2'));var rp=require(_0x029a('0x3'));var moment=require(_0x029a('0x4'));var BPromise=require(_0x029a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x029a('0x6'));var csv=require(_0x029a('0x7'));var ejs=require(_0x029a('0x8'));var fs=require('fs');var fs_extra=require(_0x029a('0x9'));var _=require(_0x029a('0xa'));var squel=require(_0x029a('0xb'));var crypto=require(_0x029a('0xc'));var jsforce=require(_0x029a('0xd'));var deskjs=require(_0x029a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x029a('0xf'));var Papa=require(_0x029a('0x10'));var Redis=require('ioredis');var authService=require(_0x029a('0x11'));var qs=require(_0x029a('0x12'));var as=require(_0x029a('0x13'));var hardwareService=require(_0x029a('0x14'));var logger=require('../../config/logger')(_0x029a('0x15'));var utils=require(_0x029a('0x16'));var config=require(_0x029a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x029a('0x18'))['db'];function respondWithStatusCode(_0x4abede,_0x208283){_0x208283=_0x208283||0xcc;return function(_0x4a3549){if(_0x4a3549){return _0x4abede[_0x029a('0x19')](_0x208283);}return _0x4abede[_0x029a('0x1a')](_0x208283)[_0x029a('0x1b')]();};}function respondWithResult(_0x543db1,_0x155390){_0x155390=_0x155390||0xc8;return function(_0x8b6c){if(_0x8b6c){return _0x543db1[_0x029a('0x1a')](_0x155390)[_0x029a('0x1c')](_0x8b6c);}};}function respondWithFilteredResult(_0x252613,_0x2a7953){return function(_0x13a58d){if(_0x13a58d){var _0x4eb46c=typeof _0x2a7953[_0x029a('0x1d')]===_0x029a('0x1e')&&typeof _0x2a7953[_0x029a('0x1f')]===_0x029a('0x1e');var _0x58060c=_0x13a58d[_0x029a('0x20')];var _0x314fbb=_0x4eb46c?0x0:_0x2a7953[_0x029a('0x1d')];var _0x17a0dc=_0x4eb46c?_0x13a58d['count']:_0x2a7953[_0x029a('0x1d')]+_0x2a7953[_0x029a('0x1f')];var _0x3a572a;if(_0x17a0dc>=_0x58060c){_0x17a0dc=_0x58060c;_0x3a572a=0xc8;}else{_0x3a572a=0xce;}_0x252613['status'](_0x3a572a);return _0x252613['set'](_0x029a('0x21'),_0x314fbb+'-'+_0x17a0dc+'/'+_0x58060c)['json'](_0x13a58d);}return null;};}function patchUpdates(_0x385ea5){return function(_0x582891){try{jsonpatch[_0x029a('0x22')](_0x582891,_0x385ea5,!![]);}catch(_0x158d35){return BPromise[_0x029a('0x23')](_0x158d35);}return _0x582891[_0x029a('0x24')]();};}function saveUpdates(_0x42ac6b,_0x56d362){return function(_0x2056f5){if(_0x2056f5){return _0x2056f5[_0x029a('0x25')](_0x42ac6b)['then'](function(_0x135a66){return _0x135a66;});}return null;};}function removeEntity(_0x26154f,_0x3055ee){return function(_0x282608){if(_0x282608){return _0x282608[_0x029a('0x26')]()[_0x029a('0x27')](function(){_0x26154f[_0x029a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x185987,_0x156140){return function(_0xbd4a3e){if(!_0xbd4a3e){_0x185987[_0x029a('0x19')](0x194);}return _0xbd4a3e;};}function handleError(_0x53aa9d,_0x3d05e7){_0x3d05e7=_0x3d05e7||0x1f4;return function(_0x5e658f){logger[_0x029a('0x28')](_0x5e658f[_0x029a('0x29')]);if(_0x5e658f[_0x029a('0x2a')]){delete _0x5e658f[_0x029a('0x2a')];}_0x53aa9d[_0x029a('0x1a')](_0x3d05e7)[_0x029a('0x2b')](_0x5e658f);};}exports[_0x029a('0x2c')]=function(_0x59c5cb,_0x6ed89d){var _0x489a98={},_0x269e4a={},_0xbeb08c={'count':0x0,'rows':[]};var _0x592756=_[_0x029a('0x2d')](db[_0x029a('0x2e')][_0x029a('0x2f')],function(_0x441c8b){return{'name':_0x441c8b[_0x029a('0x30')],'type':_0x441c8b[_0x029a('0x31')][_0x029a('0x32')]};});_0x269e4a['model']=_['map'](_0x592756,_0x029a('0x2a'));_0x269e4a[_0x029a('0x33')]=_[_0x029a('0x34')](_0x59c5cb[_0x029a('0x33')]);_0x269e4a[_0x029a('0x35')]=_[_0x029a('0x36')](_0x269e4a['model'],_0x269e4a[_0x029a('0x33')]);_0x489a98[_0x029a('0x37')]=_['intersection'](_0x269e4a[_0x029a('0x38')],qs[_0x029a('0x39')](_0x59c5cb[_0x029a('0x33')][_0x029a('0x39')]));_0x489a98[_0x029a('0x37')]=_0x489a98['attributes'][_0x029a('0x3a')]?_0x489a98['attributes']:_0x269e4a[_0x029a('0x38')];if(!_0x59c5cb[_0x029a('0x33')][_0x029a('0x3b')](_0x029a('0x3c'))){_0x489a98['limit']=qs[_0x029a('0x1f')](_0x59c5cb['query']['limit']);_0x489a98[_0x029a('0x1d')]=qs['offset'](_0x59c5cb[_0x029a('0x33')][_0x029a('0x1d')]);}_0x489a98[_0x029a('0x3d')]=qs[_0x029a('0x3e')](_0x59c5cb['query'][_0x029a('0x3e')]);_0x489a98['where']=qs[_0x029a('0x35')](_[_0x029a('0x3f')](_0x59c5cb[_0x029a('0x33')],_0x269e4a[_0x029a('0x35')]),_0x592756);if(_0x59c5cb[_0x029a('0x33')]['filter']){_0x489a98[_0x029a('0x40')]=_['merge'](_0x489a98[_0x029a('0x40')],{'$or':_[_0x029a('0x2d')](_0x592756,function(_0x5661a4){if(_0x5661a4['type']!=='VIRTUAL'){var _0x1e8314={};_0x1e8314[_0x5661a4['name']]={'$like':'%'+_0x59c5cb['query'][_0x029a('0x41')]+'%'};return _0x1e8314;}})});}_0x489a98=_[_0x029a('0x42')]({},_0x489a98,_0x59c5cb[_0x029a('0x43')]);var _0x8dabb2={'where':_0x489a98['where']};return db[_0x029a('0x2e')][_0x029a('0x20')](_0x8dabb2)[_0x029a('0x27')](function(_0x5dfad7){_0xbeb08c['count']=_0x5dfad7;if(_0x59c5cb[_0x029a('0x33')][_0x029a('0x44')]){_0x489a98[_0x029a('0x45')]=[{'all':!![]}];}return db[_0x029a('0x2e')][_0x029a('0x46')](_0x489a98);})[_0x029a('0x27')](function(_0x52147a){_0xbeb08c[_0x029a('0x47')]=_0x52147a;return _0xbeb08c;})[_0x029a('0x27')](respondWithFilteredResult(_0x6ed89d,_0x489a98))[_0x029a('0x48')](handleError(_0x6ed89d,null));};exports[_0x029a('0x49')]=function(_0x41c136,_0x4fb6e2){var _0xf42ae5={'raw':!![],'where':{'id':_0x41c136[_0x029a('0x4a')]['id']}},_0x53ee0f={};_0x53ee0f['model']=_[_0x029a('0x34')](db[_0x029a('0x2e')][_0x029a('0x2f')]);_0x53ee0f[_0x029a('0x33')]=_[_0x029a('0x34')](_0x41c136[_0x029a('0x33')]);_0x53ee0f[_0x029a('0x35')]=_['intersection'](_0x53ee0f[_0x029a('0x38')],_0x53ee0f[_0x029a('0x33')]);_0xf42ae5[_0x029a('0x37')]=_[_0x029a('0x36')](_0x53ee0f[_0x029a('0x38')],qs[_0x029a('0x39')](_0x41c136[_0x029a('0x33')][_0x029a('0x39')]));_0xf42ae5[_0x029a('0x37')]=_0xf42ae5[_0x029a('0x37')]['length']?_0xf42ae5['attributes']:_0x53ee0f[_0x029a('0x38')];if(_0x41c136[_0x029a('0x33')][_0x029a('0x44')]){_0xf42ae5[_0x029a('0x45')]=[{'all':!![]}];}_0xf42ae5=_[_0x029a('0x42')]({},_0xf42ae5,_0x41c136['options']);return db[_0x029a('0x2e')][_0x029a('0x4b')](_0xf42ae5)[_0x029a('0x27')](handleEntityNotFound(_0x4fb6e2,null))['then'](respondWithResult(_0x4fb6e2,null))[_0x029a('0x48')](handleError(_0x4fb6e2,null));};exports[_0x029a('0x4c')]=function(_0x453f59,_0x32bc37){return db['VoiceTransferReport']['create'](_0x453f59['body'],{})[_0x029a('0x27')](respondWithResult(_0x32bc37,0xc9))[_0x029a('0x48')](handleError(_0x32bc37,null));};exports[_0x029a('0x25')]=function(_0x11ec1b,_0x887b2b){if(_0x11ec1b['body']['id']){delete _0x11ec1b[_0x029a('0x4d')]['id'];}return db[_0x029a('0x2e')][_0x029a('0x4b')]({'where':{'id':_0x11ec1b[_0x029a('0x4a')]['id']}})[_0x029a('0x27')](handleEntityNotFound(_0x887b2b,null))['then'](saveUpdates(_0x11ec1b[_0x029a('0x4d')],null))['then'](respondWithResult(_0x887b2b,null))[_0x029a('0x48')](handleError(_0x887b2b,null));};exports[_0x029a('0x26')]=function(_0x7d1466,_0x40dc67){return db[_0x029a('0x2e')]['find']({'where':{'id':_0x7d1466['params']['id']}})[_0x029a('0x27')](handleEntityNotFound(_0x40dc67,null))[_0x029a('0x27')](removeEntity(_0x40dc67,null))[_0x029a('0x48')](handleError(_0x40dc67,null));};exports[_0x029a('0x4e')]=function(_0x565094,_0x46373e){return db[_0x029a('0x2e')]['describe']()[_0x029a('0x27')](respondWithResult(_0x46373e,null))[_0x029a('0x48')](handleError(_0x46373e,null));}; \ No newline at end of file +var _0x4e4c=['map','VoiceTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send'];(function(_0x3ca9c7,_0x36c71c){var _0xd68797=function(_0x608cff){while(--_0x608cff){_0x3ca9c7['push'](_0x3ca9c7['shift']());}};_0xd68797(++_0x36c71c);}(_0x4e4c,0x113));var _0xc4e4=function(_0x4a12d2,_0x4e34ee){_0x4a12d2=_0x4a12d2-0x0;var _0x5856c2=_0x4e4c[_0x4a12d2];return _0x5856c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc4e4('0x0'));var zipdir=require(_0xc4e4('0x1'));var jsonpatch=require(_0xc4e4('0x2'));var rp=require(_0xc4e4('0x3'));var moment=require(_0xc4e4('0x4'));var BPromise=require(_0xc4e4('0x5'));var Mustache=require(_0xc4e4('0x6'));var util=require(_0xc4e4('0x7'));var path=require(_0xc4e4('0x8'));var sox=require(_0xc4e4('0x9'));var csv=require(_0xc4e4('0xa'));var ejs=require(_0xc4e4('0xb'));var fs=require('fs');var fs_extra=require(_0xc4e4('0xc'));var _=require('lodash');var squel=require(_0xc4e4('0xd'));var crypto=require('crypto');var jsforce=require(_0xc4e4('0xe'));var deskjs=require(_0xc4e4('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc4e4('0x10'));var Redis=require(_0xc4e4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc4e4('0x12'));var as=require(_0xc4e4('0x13'));var hardwareService=require(_0xc4e4('0x14'));var logger=require(_0xc4e4('0x15'))(_0xc4e4('0x16'));var utils=require(_0xc4e4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc4e4('0x18'));var db=require(_0xc4e4('0x19'))['db'];function respondWithStatusCode(_0x471a20,_0x4e0085){_0x4e0085=_0x4e0085||0xcc;return function(_0x25cd24){if(_0x25cd24){return _0x471a20[_0xc4e4('0x1a')](_0x4e0085);}return _0x471a20['status'](_0x4e0085)[_0xc4e4('0x1b')]();};}function respondWithResult(_0x21b629,_0x481a76){_0x481a76=_0x481a76||0xc8;return function(_0x571117){if(_0x571117){return _0x21b629[_0xc4e4('0x1c')](_0x481a76)[_0xc4e4('0x1d')](_0x571117);}};}function respondWithFilteredResult(_0x449cf8,_0x1f94bd){return function(_0x29ce50){if(_0x29ce50){var _0x303ea7=typeof _0x1f94bd[_0xc4e4('0x1e')]==='undefined'&&typeof _0x1f94bd[_0xc4e4('0x1f')]===_0xc4e4('0x20');var _0x5108db=_0x29ce50[_0xc4e4('0x21')];var _0x2672c9=_0x303ea7?0x0:_0x1f94bd[_0xc4e4('0x1e')];var _0x3e3b70=_0x303ea7?_0x29ce50[_0xc4e4('0x21')]:_0x1f94bd['offset']+_0x1f94bd[_0xc4e4('0x1f')];var _0x2377fb;if(_0x3e3b70>=_0x5108db){_0x3e3b70=_0x5108db;_0x2377fb=0xc8;}else{_0x2377fb=0xce;}_0x449cf8[_0xc4e4('0x1c')](_0x2377fb);return _0x449cf8[_0xc4e4('0x22')](_0xc4e4('0x23'),_0x2672c9+'-'+_0x3e3b70+'/'+_0x5108db)[_0xc4e4('0x1d')](_0x29ce50);}return null;};}function patchUpdates(_0x507627){return function(_0x3dca8b){try{jsonpatch[_0xc4e4('0x24')](_0x3dca8b,_0x507627,!![]);}catch(_0x55a253){return BPromise[_0xc4e4('0x25')](_0x55a253);}return _0x3dca8b[_0xc4e4('0x26')]();};}function saveUpdates(_0x2abee0,_0x1c7395){return function(_0x5a3f90){if(_0x5a3f90){return _0x5a3f90['update'](_0x2abee0)[_0xc4e4('0x27')](function(_0x576f09){return _0x576f09;});}return null;};}function removeEntity(_0xa6db0c,_0x23bddf){return function(_0x5e0b04){if(_0x5e0b04){return _0x5e0b04[_0xc4e4('0x28')]()[_0xc4e4('0x27')](function(){_0xa6db0c[_0xc4e4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e21e8,_0x4e610b){return function(_0x3cf28e){if(!_0x3cf28e){_0x4e21e8[_0xc4e4('0x1a')](0x194);}return _0x3cf28e;};}function handleError(_0x3a417a,_0x298c5c){_0x298c5c=_0x298c5c||0x1f4;return function(_0x282357){logger[_0xc4e4('0x29')](_0x282357[_0xc4e4('0x2a')]);if(_0x282357[_0xc4e4('0x2b')]){delete _0x282357[_0xc4e4('0x2b')];}_0x3a417a[_0xc4e4('0x1c')](_0x298c5c)[_0xc4e4('0x2c')](_0x282357);};}exports['index']=function(_0x4cce19,_0x4d5039){var _0x19f8d7={},_0x2fb5f4={},_0x49d42b={'count':0x0,'rows':[]};var _0x2c6469=_[_0xc4e4('0x2d')](db[_0xc4e4('0x2e')][_0xc4e4('0x2f')],function(_0x418b21){return{'name':_0x418b21[_0xc4e4('0x30')],'type':_0x418b21['type'][_0xc4e4('0x31')]};});_0x2fb5f4[_0xc4e4('0x32')]=_[_0xc4e4('0x2d')](_0x2c6469,'name');_0x2fb5f4[_0xc4e4('0x33')]=_[_0xc4e4('0x34')](_0x4cce19[_0xc4e4('0x33')]);_0x2fb5f4[_0xc4e4('0x35')]=_['intersection'](_0x2fb5f4[_0xc4e4('0x32')],_0x2fb5f4['query']);_0x19f8d7[_0xc4e4('0x36')]=_[_0xc4e4('0x37')](_0x2fb5f4['model'],qs[_0xc4e4('0x38')](_0x4cce19[_0xc4e4('0x33')]['fields']));_0x19f8d7[_0xc4e4('0x36')]=_0x19f8d7['attributes']['length']?_0x19f8d7[_0xc4e4('0x36')]:_0x2fb5f4[_0xc4e4('0x32')];if(!_0x4cce19[_0xc4e4('0x33')][_0xc4e4('0x39')](_0xc4e4('0x3a'))){_0x19f8d7[_0xc4e4('0x1f')]=qs[_0xc4e4('0x1f')](_0x4cce19[_0xc4e4('0x33')]['limit']);_0x19f8d7[_0xc4e4('0x1e')]=qs['offset'](_0x4cce19[_0xc4e4('0x33')]['offset']);}_0x19f8d7[_0xc4e4('0x3b')]=qs[_0xc4e4('0x3c')](_0x4cce19[_0xc4e4('0x33')][_0xc4e4('0x3c')]);_0x19f8d7[_0xc4e4('0x3d')]=qs[_0xc4e4('0x35')](_['pick'](_0x4cce19[_0xc4e4('0x33')],_0x2fb5f4[_0xc4e4('0x35')]),_0x2c6469);if(_0x4cce19[_0xc4e4('0x33')][_0xc4e4('0x3e')]){_0x19f8d7[_0xc4e4('0x3d')]=_[_0xc4e4('0x3f')](_0x19f8d7[_0xc4e4('0x3d')],{'$or':_['map'](_0x2c6469,function(_0x57667f){if(_0x57667f[_0xc4e4('0x40')]!==_0xc4e4('0x41')){var _0x1d7cc7={};_0x1d7cc7[_0x57667f[_0xc4e4('0x2b')]]={'$like':'%'+_0x4cce19[_0xc4e4('0x33')][_0xc4e4('0x3e')]+'%'};return _0x1d7cc7;}})});}_0x19f8d7=_['merge']({},_0x19f8d7,_0x4cce19[_0xc4e4('0x42')]);var _0x3e8ea8={'where':_0x19f8d7['where']};return db[_0xc4e4('0x2e')]['count'](_0x3e8ea8)[_0xc4e4('0x27')](function(_0x4a9a30){_0x49d42b['count']=_0x4a9a30;if(_0x4cce19['query'][_0xc4e4('0x43')]){_0x19f8d7[_0xc4e4('0x44')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xc4e4('0x45')](_0x19f8d7);})[_0xc4e4('0x27')](function(_0xbccd79){_0x49d42b[_0xc4e4('0x46')]=_0xbccd79;return _0x49d42b;})['then'](respondWithFilteredResult(_0x4d5039,_0x19f8d7))['catch'](handleError(_0x4d5039,null));};exports[_0xc4e4('0x47')]=function(_0x180f21,_0x278ce2){var _0x52a754={'raw':!![],'where':{'id':_0x180f21[_0xc4e4('0x48')]['id']}},_0x294c65={};_0x294c65[_0xc4e4('0x32')]=_['keys'](db[_0xc4e4('0x2e')][_0xc4e4('0x2f')]);_0x294c65['query']=_[_0xc4e4('0x34')](_0x180f21[_0xc4e4('0x33')]);_0x294c65[_0xc4e4('0x35')]=_[_0xc4e4('0x37')](_0x294c65[_0xc4e4('0x32')],_0x294c65[_0xc4e4('0x33')]);_0x52a754[_0xc4e4('0x36')]=_['intersection'](_0x294c65[_0xc4e4('0x32')],qs[_0xc4e4('0x38')](_0x180f21[_0xc4e4('0x33')][_0xc4e4('0x38')]));_0x52a754[_0xc4e4('0x36')]=_0x52a754[_0xc4e4('0x36')][_0xc4e4('0x49')]?_0x52a754[_0xc4e4('0x36')]:_0x294c65[_0xc4e4('0x32')];if(_0x180f21[_0xc4e4('0x33')][_0xc4e4('0x43')]){_0x52a754['include']=[{'all':!![]}];}_0x52a754=_[_0xc4e4('0x3f')]({},_0x52a754,_0x180f21[_0xc4e4('0x42')]);return db['VoiceTransferReport'][_0xc4e4('0x4a')](_0x52a754)['then'](handleEntityNotFound(_0x278ce2,null))[_0xc4e4('0x27')](respondWithResult(_0x278ce2,null))[_0xc4e4('0x4b')](handleError(_0x278ce2,null));};exports[_0xc4e4('0x4c')]=function(_0x180a37,_0x47eca1){return db[_0xc4e4('0x2e')][_0xc4e4('0x4c')](_0x180a37[_0xc4e4('0x4d')],{})[_0xc4e4('0x27')](respondWithResult(_0x47eca1,0xc9))[_0xc4e4('0x4b')](handleError(_0x47eca1,null));};exports[_0xc4e4('0x4e')]=function(_0x3013c2,_0x38cf47){if(_0x3013c2[_0xc4e4('0x4d')]['id']){delete _0x3013c2[_0xc4e4('0x4d')]['id'];}return db['VoiceTransferReport'][_0xc4e4('0x4a')]({'where':{'id':_0x3013c2[_0xc4e4('0x48')]['id']}})[_0xc4e4('0x27')](handleEntityNotFound(_0x38cf47,null))[_0xc4e4('0x27')](saveUpdates(_0x3013c2[_0xc4e4('0x4d')],null))[_0xc4e4('0x27')](respondWithResult(_0x38cf47,null))[_0xc4e4('0x4b')](handleError(_0x38cf47,null));};exports[_0xc4e4('0x28')]=function(_0x227cde,_0x49600d){return db[_0xc4e4('0x2e')]['find']({'where':{'id':_0x227cde[_0xc4e4('0x48')]['id']}})[_0xc4e4('0x27')](handleEntityNotFound(_0x49600d,null))['then'](removeEntity(_0x49600d,null))[_0xc4e4('0x4b')](handleError(_0x49600d,null));};exports[_0xc4e4('0x4f')]=function(_0x20bcc4,_0x3a56e7){return db['VoiceTransferReport'][_0xc4e4('0x4f')]()['then'](respondWithResult(_0x3a56e7,null))[_0xc4e4('0x4b')](handleError(_0x3a56e7,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 2c6aa7a..3245439 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.model.js +++ b/server/api/voiceTransferReport/voiceTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf55c=['util','api','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf55c,0x6e));var _0xcf55=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xf55c[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require('lodash');var util=require(_0xcf55('0x0'));var logger=require('../../config/logger')(_0xcf55('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf55('0x2'));var rimraf=require(_0xcf55('0x3'));var config=require(_0xcf55('0x4'));var attributes=require(_0xcf55('0x5'));module[_0xcf55('0x6')]=function(_0x4d37e1,_0x414320){return _0x4d37e1[_0xcf55('0x7')](_0xcf55('0x8'),attributes,{'tableName':_0xcf55('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec55=['exports','define','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xb10a00,_0x5686ec){var _0x1112d7=function(_0xc4d68f){while(--_0xc4d68f){_0xb10a00['push'](_0xb10a00['shift']());}};_0x1112d7(++_0x5686ec);}(_0xec55,0x8e));var _0x5ec5=function(_0x58ef77,_0x52605d){_0x58ef77=_0x58ef77-0x0;var _0x2c7fa4=_0xec55[_0x58ef77];return _0x2c7fa4;};'use strict';var _=require(_0x5ec5('0x0'));var util=require('util');var logger=require(_0x5ec5('0x1'))(_0x5ec5('0x2'));var moment=require(_0x5ec5('0x3'));var BPromise=require(_0x5ec5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ec5('0x5'));var rimraf=require(_0x5ec5('0x6'));var config=require(_0x5ec5('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x5ec5('0x8')]=function(_0x48d750,_0x358067){return _0x48d750[_0x5ec5('0x9')]('VoiceTransferReport',attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 5f0b345..9d596ac 100644 --- a/server/api/voiceTransferReport/voiceTransferReport.rpc.js +++ b/server/api/voiceTransferReport/voiceTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x050b=['VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','create','body','options','raw','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x050b,0x1da));var _0xb050=function(_0x1ef584,_0x485024){_0x1ef584=_0x1ef584-0x0;var _0x1b29f7=_0x050b[_0x1ef584];return _0x1b29f7;};'use strict';var _=require(_0xb050('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb050('0x1'));var rs=require(_0xb050('0x2'));var fs=require('fs');var Redis=require(_0xb050('0x3'));var db=require(_0xb050('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb050('0x5'))(_0xb050('0x6'));var config=require('../../config/environment');var jayson=require(_0xb050('0x7'));var client=jayson['client'][_0xb050('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe59ab0,_0x588380,_0x5da217){return new BPromise(function(_0x4f5f30,_0x2a3f23){return client[_0xb050('0x9')](_0xe59ab0,_0x5da217)[_0xb050('0xa')](function(_0x186b6d){logger[_0xb050('0xb')](_0xb050('0xc'),_0x588380,_0xb050('0xd'));logger[_0xb050('0xe')](_0xb050('0xf'),_0x588380,_0xb050('0xd'),JSON[_0xb050('0x10')](_0x186b6d));if(_0x186b6d[_0xb050('0x11')]){if(_0x186b6d[_0xb050('0x11')][_0xb050('0x12')]===0x1f4){logger[_0xb050('0x11')](_0xb050('0xc'),_0x588380,_0x186b6d[_0xb050('0x11')]['message']);return _0x2a3f23(_0x186b6d[_0xb050('0x11')][_0xb050('0x13')]);}logger['error'](_0xb050('0xc'),_0x588380,_0x186b6d[_0xb050('0x11')]['message']);return _0x4f5f30(_0x186b6d['error']['message']);}else{logger[_0xb050('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x588380,_0xb050('0xd'));_0x4f5f30(_0x186b6d[_0xb050('0x14')][_0xb050('0x13')]);}})[_0xb050('0x15')](function(_0x187b92){logger['error'](_0xb050('0xc'),_0x588380,_0x187b92);_0x2a3f23(_0x187b92);});});}exports[_0xb050('0x16')]=function(_0x332b91){var _0x52a2d4=this;return new Promise(function(_0x3764e3,_0x3c9a3c){return db['VoiceTransferReport'][_0xb050('0x17')](_0x332b91[_0xb050('0x18')],{'raw':_0x332b91[_0xb050('0x19')]?_0x332b91[_0xb050('0x19')][_0xb050('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x144bac){logger['info'](_0xb050('0x16'),_0x332b91);logger[_0xb050('0xe')]('CreateVoiceTransferReport',_0x332b91,JSON[_0xb050('0x10')](_0x144bac));_0x3764e3(_0x144bac);})[_0xb050('0x15')](function(_0x43fb3d){logger['error'](_0xb050('0x16'),_0x43fb3d[_0xb050('0x13')],_0x332b91);_0x3c9a3c(_0x52a2d4[_0xb050('0x11')](0x1f4,_0x43fb3d[_0xb050('0x13')]));});});}; \ No newline at end of file +var _0xfe5e=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceTransferReport,\x20%s,\x20%s','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','debug','lodash','randomstring','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe5e,0x174));var _0xefe5=function(_0x5ca0b3,_0x33f5ef){_0x5ca0b3=_0x5ca0b3-0x0;var _0x6ba806=_0xfe5e[_0x5ca0b3];return _0x6ba806;};'use strict';var _=require(_0xefe5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xefe5('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xefe5('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xefe5('0x3'))(_0xefe5('0x4'));var config=require(_0xefe5('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xefe5('0x6')][_0xefe5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1c0d14,_0x21f4bc,_0x112e36){return new BPromise(function(_0x3d0bd6,_0x21129a){return client[_0xefe5('0x8')](_0x1c0d14,_0x112e36)[_0xefe5('0x9')](function(_0x4d8d1c){logger[_0xefe5('0xa')]('VoiceTransferReport,\x20%s,\x20%s',_0x21f4bc,_0xefe5('0xb'));logger['debug'](_0xefe5('0xc'),_0x21f4bc,_0xefe5('0xb'),JSON[_0xefe5('0xd')](_0x4d8d1c));if(_0x4d8d1c[_0xefe5('0xe')]){if(_0x4d8d1c[_0xefe5('0xe')][_0xefe5('0xf')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x21f4bc,_0x4d8d1c[_0xefe5('0xe')][_0xefe5('0x10')]);return _0x21129a(_0x4d8d1c['error']['message']);}logger['error'](_0xefe5('0x11'),_0x21f4bc,_0x4d8d1c[_0xefe5('0xe')][_0xefe5('0x10')]);return _0x3d0bd6(_0x4d8d1c['error']['message']);}else{logger[_0xefe5('0xa')](_0xefe5('0x11'),_0x21f4bc,'request\x20sent');_0x3d0bd6(_0x4d8d1c[_0xefe5('0x12')][_0xefe5('0x10')]);}})[_0xefe5('0x13')](function(_0x56fa3f){logger[_0xefe5('0xe')](_0xefe5('0x11'),_0x21f4bc,_0x56fa3f);_0x21129a(_0x56fa3f);});});}exports[_0xefe5('0x14')]=function(_0x23e5af){var _0x45e51d=this;return new Promise(function(_0x3e2b0b,_0x1011d0){return db[_0xefe5('0x15')][_0xefe5('0x16')](_0x23e5af[_0xefe5('0x17')],{'raw':_0x23e5af['options']?_0x23e5af['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x53b246){logger[_0xefe5('0xa')](_0xefe5('0x14'),_0x23e5af);logger[_0xefe5('0x18')]('CreateVoiceTransferReport',_0x23e5af,JSON[_0xefe5('0xd')](_0x53b246));_0x3e2b0b(_0x53b246);})[_0xefe5('0x13')](function(_0x17a36d){logger[_0xefe5('0xe')]('CreateVoiceTransferReport',_0x17a36d[_0xefe5('0x10')],_0x23e5af);_0x1011d0(_0x45e51d['error'](0x1f4,_0x17a36d['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 81d5215..d5b460c 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['unhold','/calls','/transfer','transfer','express','Router','../../components/auth/service','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','/hold','hold','/unhold'];(function(_0x5f0e81,_0x39e741){var _0x9e05f6=function(_0x2ffb1a){while(--_0x2ffb1a){_0x5f0e81['push'](_0x5f0e81['shift']());}};_0x9e05f6(++_0x39e741);}(_0x54ef,0x112));var _0xf54e=function(_0x1a8520,_0x4833b8){_0x1a8520=_0x1a8520-0x0;var _0x449272=_0x54ef[_0x1a8520];return _0x449272;};'use strict';var express=require(_0xf54e('0x0'));var router=express[_0xf54e('0x1')]();var auth=require(_0xf54e('0x2'));var controller=require('./webbar.controller');router[_0xf54e('0x3')](_0xf54e('0x4'),auth[_0xf54e('0x5')](),auth[_0xf54e('0x6')](),controller[_0xf54e('0x7')]);router[_0xf54e('0x3')](_0xf54e('0x8'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xf54e('0x9')]);router[_0xf54e('0x3')](_0xf54e('0xa'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller['answer']);router[_0xf54e('0x3')](_0xf54e('0xb'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller[_0xf54e('0xc')]);router[_0xf54e('0x3')](_0xf54e('0xd'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller[_0xf54e('0xe')]);router[_0xf54e('0x3')](_0xf54e('0xf'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller['calls']);router['post'](_0xf54e('0x10'),auth[_0xf54e('0x5')](),auth[_0xf54e('0x6')](),controller[_0xf54e('0x11')]);module['exports']=router; \ No newline at end of file +var _0x008c=['/transfer','transfer','express','Router','../../components/auth/service','./webbar.controller','post','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','answer','/calls','calls'];(function(_0x38747d,_0x2565e1){var _0x3ffeaa=function(_0x51a9e3){while(--_0x51a9e3){_0x38747d['push'](_0x38747d['shift']());}};_0x3ffeaa(++_0x2565e1);}(_0x008c,0x188));var _0xc008=function(_0x4b13f0,_0x1273df){_0x4b13f0=_0x4b13f0-0x0;var _0x2a1955=_0x008c[_0x4b13f0];return _0x2a1955;};'use strict';var express=require(_0xc008('0x0'));var router=express[_0xc008('0x1')]();var auth=require(_0xc008('0x2'));var controller=require(_0xc008('0x3'));router[_0xc008('0x4')]('/originate',auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller[_0xc008('0x7')]);router[_0xc008('0x4')](_0xc008('0x8'),auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller[_0xc008('0x9')]);router[_0xc008('0x4')]('/answer',auth[_0xc008('0x5')](),auth['isWebrtcLicence'](),controller[_0xc008('0xa')]);router['post']('/hold',auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller['hold']);router['post']('/unhold',auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller['unhold']);router[_0xc008('0x4')](_0xc008('0xb'),auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller[_0xc008('0xc')]);router[_0xc008('0x4')](_0xc008('0xd'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xc008('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index dc90055..98885ad 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5db8=['callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','sessionId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','UserId','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','util','bluebird','jayson/promise','../../config/logger','webbarapi','ioredis','redis','localhost','socket.io-emitter','validate','userId\x20is\x20required','callNumber\x20is\x20required','string','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','error','stack','name','status','send','NotFound','request','code','message','result','catch','findOne','agent','then','all','filter','rows','length','\x20not\x20found!','originate','originate\x20fired:','body','json','userId'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x5db8,0xbb));var _0x85db=function(_0x3eee56,_0x176daf){_0x3eee56=_0x3eee56-0x0;var _0x506bcd=_0x5db8[_0x3eee56];return _0x506bcd;};'use strict';var path=require(_0x85db('0x0'));var fs=require('fs');var _=require(_0x85db('0x1'));var db=require(_0x85db('0x2'))['db'];var config=require('../../config/environment');var util=require(_0x85db('0x3'));var BPromise=require(_0x85db('0x4'));var jayson=require(_0x85db('0x5'));var amiClient=jayson['client']['http']({'port':0x232a});var logger=require(_0x85db('0x6'))(_0x85db('0x7'));var Redis=require(_0x85db('0x8'));config[_0x85db('0x9')]=_['defaults'](config['redis'],{'host':_0x85db('0xa'),'port':0x18eb});var io=require(_0x85db('0xb'))(new Redis(config[_0x85db('0x9')]));var Schema=require(_0x85db('0xc'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x85db('0xd')]},'callNumber':{'type':'string','required':[!![],_0x85db('0xe')]},'callerId':{'type':_0x85db('0xf')},'callbackUrl':{'type':_0x85db('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x85db('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x85db('0xd')]},'sessionId':{'type':_0x85db('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x85db('0xd')]},'sessionId':{'type':'string','required':[!![],_0x85db('0x11')]},'transferNumber':{'type':_0x85db('0xf'),'required':[!![],_0x85db('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x85db('0x10'),'required':[!![],_0x85db('0xd')]},'sessionId':{'type':_0x85db('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x85db('0x10'),'required':[!![],_0x85db('0xd')]},'sessionId':{'type':_0x85db('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x85db('0x10'),'required':[!![],_0x85db('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x85db('0x10'),'required':[!![],_0x85db('0xd')]}});function emit(_0x5ccfef,_0x27bd65,_0x175622){logger[_0x85db('0x13')](_0x5ccfef,_0x27bd65,JSON[_0x85db('0x14')](_0x175622));io['to'](_0x5ccfef)[_0x85db('0x15')](_0x27bd65,_0x175622);}function handleError(_0x396afa){return function(_0x3209b3){console['log'](_0x85db('0x16'),_0x3209b3,_0x3209b3 instanceof RangeError);logger[_0x85db('0x17')](_0x3209b3[_0x85db('0x18')]);if(_0x3209b3 instanceof RangeError){if(_0x3209b3[_0x85db('0x19')]){delete _0x3209b3[_0x85db('0x19')];}_0x396afa[_0x85db('0x1a')](0x194)[_0x85db('0x1b')](_0x3209b3);}else{if(_0x3209b3[_0x85db('0x19')]){delete _0x3209b3[_0x85db('0x19')];}_0x396afa[_0x85db('0x1a')](0x1f4)['send'](_0x3209b3);}};}function checkError(){return function(_0x36a2af){if(!_0x36a2af){throw new RangeError(_0x85db('0x1c'));}return _0x36a2af;};}function respondWithRpcPromise(_0xc812d2,_0x470c81){return new BPromise(function(_0x44c122,_0x3842d7){var _0x3a7148=amiClient;return _0x3a7148[_0x85db('0x1d')](_0xc812d2,_0x470c81)['then'](function(_0xfffea2){if(_0xfffea2[_0x85db('0x17')]){if(_0xfffea2[_0x85db('0x17')][_0x85db('0x1e')]===0x1f4){return _0x3842d7(_0xfffea2[_0x85db('0x17')][_0x85db('0x1f')]);}return _0x44c122(_0xfffea2['error'][_0x85db('0x1f')]);}else{_0x44c122(_0xfffea2[_0x85db('0x20')]);}})[_0x85db('0x21')](function(_0x54ba03){_0x3842d7(_0x54ba03);});});}function getAgent(_0x5467ad){return db['User'][_0x85db('0x22')]({'where':{'id':_0x5467ad,'role':_0x85db('0x23')}})[_0x85db('0x24')](checkError());}function getAgentCheckSession(_0x51b748,_0x71c6f4){return new BPromise(function(_0xc2abb8,_0xdfff49){var _0x574bcc=respondWithRpcPromise('VoiceChannels');var _0x299013=getAgent(_0x51b748);Promise[_0x85db('0x25')]([_0x574bcc,_0x299013])[_0x85db('0x24')](function(_0x226540){var _0x397afc=_0x226540[0x0];var _0x16ee2a=_0x226540[0x1];var _0x8af4a4=_[_0x85db('0x26')](_0x397afc[_0x85db('0x27')],function(_0x1edc8d){return _0x1edc8d['UserId']==_0x16ee2a['id']&&_0x1edc8d['sessionId']==_0x71c6f4;});if(_0x8af4a4[_0x85db('0x28')]==0x1){_0xc2abb8(_0x16ee2a);}else{_0xdfff49(new RangeError('sessionId\x20'+_0x71c6f4+_0x85db('0x29')));}});});}exports[_0x85db('0x2a')]=function(_0x5abdb7,_0x1d15b0){logger[_0x85db('0x13')](_0x85db('0x2b'),_0x5abdb7[_0x85db('0x2c')]);var _0x515a06=originateValidation[_0x85db('0xc')](_0x5abdb7[_0x85db('0x2c')]);if(_0x515a06[_0x85db('0x28')]>0x0){return _0x1d15b0[_0x85db('0x1a')](0x190)[_0x85db('0x2d')](_0x515a06);}var _0x4808a4=_0x5abdb7[_0x85db('0x2c')][_0x85db('0x2e')];var _0x232175=_0x5abdb7[_0x85db('0x2c')]['callNumber'];var _0xfe3cd9=_0x5abdb7[_0x85db('0x2c')][_0x85db('0x2f')];var _0x536398=_0x5abdb7['body'][_0x85db('0x30')];return getAgent(_0x4808a4)[_0x85db('0x24')](function(_0x4980b7){logger[_0x85db('0x13')](_0x85db('0x31'),_0x4980b7[_0x85db('0x19')]);emit(util[_0x85db('0x32')](_0x85db('0x33'),_0x4980b7[_0x85db('0x19')]),_0x85db('0x34'),{'callNumber':_0x232175,'callerId':_0xfe3cd9,'callbackUrl':_0x536398});return _0x1d15b0[_0x85db('0x1a')](0xc8)[_0x85db('0x2d')]({'error':![],'message':_0x85db('0x35')});})[_0x85db('0x21')](handleError(_0x1d15b0));};exports[_0x85db('0x36')]=function(_0x54bc6f,_0x35e938){logger[_0x85db('0x13')](_0x85db('0x37'),_0x54bc6f[_0x85db('0x2c')]);var _0x57a77a=hangupValidation[_0x85db('0xc')](_0x54bc6f[_0x85db('0x2c')]);if(_0x57a77a[_0x85db('0x28')]>0x0){return _0x35e938[_0x85db('0x1a')](0x190)['json'](_0x57a77a);}var _0x5dfe91=_0x54bc6f['body']['userId'];var _0x4d5ff9=_0x54bc6f[_0x85db('0x2c')][_0x85db('0x38')];return getAgent(_0x5dfe91)[_0x85db('0x24')](function(_0x17f649){logger[_0x85db('0x13')]('entityFound:',_0x17f649['name']);emit(util[_0x85db('0x32')]('user:%s',_0x17f649[_0x85db('0x19')]),_0x85db('0x39'),{'sessionId':_0x4d5ff9});return _0x35e938['status'](0xc8)['json']({'error':![],'message':_0x85db('0x3a')});})[_0x85db('0x21')](handleError(_0x35e938));};exports[_0x85db('0x3b')]=function(_0x73eb93,_0x24f8dc){logger['info'](_0x85db('0x3c'),_0x73eb93[_0x85db('0x2c')]);var _0x115720=answerValidation['validate'](_0x73eb93['body']);if(_0x115720['length']>0x0){return _0x24f8dc[_0x85db('0x1a')](0x190)[_0x85db('0x2d')](_0x115720);}var _0x116cb3=_0x73eb93['body']['userId'];var _0x3e4dbc=_0x73eb93['body'][_0x85db('0x38')];return getAgent(_0x116cb3)[_0x85db('0x24')](function(_0x374515){logger['info'](_0x85db('0x31'),_0x374515[_0x85db('0x19')]);emit(util[_0x85db('0x32')](_0x85db('0x33'),_0x374515[_0x85db('0x19')]),_0x85db('0x3d'),{'sessionId':_0x3e4dbc});return _0x24f8dc[_0x85db('0x1a')](0xc8)[_0x85db('0x2d')]({'error':![],'message':_0x85db('0x3e')});})['catch'](handleError(_0x24f8dc));};exports[_0x85db('0x3f')]=function(_0x1b9ab8,_0x30c7a0){logger[_0x85db('0x13')](_0x85db('0x40'),_0x1b9ab8[_0x85db('0x2c')]);var _0x4acd1c=holdValidation[_0x85db('0xc')](_0x1b9ab8[_0x85db('0x2c')]);if(_0x4acd1c[_0x85db('0x28')]>0x0){return _0x30c7a0['status'](0x190)['json'](_0x4acd1c);}var _0x1350ae=_0x1b9ab8['body'][_0x85db('0x2e')];var _0x85181f=_0x1b9ab8[_0x85db('0x2c')][_0x85db('0x38')];return getAgent(_0x1350ae)[_0x85db('0x24')](function(_0x5e1455){logger['info'](_0x85db('0x31'),_0x5e1455[_0x85db('0x19')]);emit(util[_0x85db('0x32')](_0x85db('0x33'),_0x5e1455[_0x85db('0x19')]),_0x85db('0x41'),{'sessionId':_0x85181f});return _0x30c7a0[_0x85db('0x1a')](0xc8)[_0x85db('0x2d')]({'error':![],'message':_0x85db('0x42')});})[_0x85db('0x21')](handleError(_0x30c7a0));};exports['unhold']=function(_0x69c505,_0x2c4ae4){logger['info']('unhold\x20fired:',_0x69c505[_0x85db('0x2c')]);var _0x306be6=unholdValidation['validate'](_0x69c505['body']);if(_0x306be6[_0x85db('0x28')]>0x0){return _0x2c4ae4[_0x85db('0x1a')](0x190)['json'](_0x306be6);}var _0x101388=_0x69c505[_0x85db('0x2c')][_0x85db('0x2e')];var _0xd3cedb=_0x69c505[_0x85db('0x2c')][_0x85db('0x38')];return getAgent(_0x101388)[_0x85db('0x24')](function(_0x438ce7){logger[_0x85db('0x13')](_0x85db('0x31'),_0x438ce7['name']);emit(util['format'](_0x85db('0x33'),_0x438ce7[_0x85db('0x19')]),_0x85db('0x43'),{'sessionId':_0xd3cedb});return _0x2c4ae4[_0x85db('0x1a')](0xc8)[_0x85db('0x2d')]({'error':![],'message':_0x85db('0x44')});})[_0x85db('0x21')](handleError(_0x2c4ae4));};exports[_0x85db('0x45')]=function(_0x34b54e,_0x1e6f60){logger[_0x85db('0x13')](_0x85db('0x46'),_0x1e6f60[_0x85db('0x2c')]);var _0x425e61=callsValidation['validate'](_0x34b54e[_0x85db('0x2c')]);if(_0x425e61[_0x85db('0x28')]>0x0){return _0x1e6f60['status'](0x190)[_0x85db('0x2d')](_0x425e61);}var _0x40a009=_0x34b54e[_0x85db('0x2c')][_0x85db('0x2e')];var _0x992a63=respondWithRpcPromise(_0x85db('0x47'));var _0x43b095=getAgent(_0x40a009);return Promise['all']([_0x992a63,_0x43b095])[_0x85db('0x24')](function(_0x355be9){var _0x4d7e50=_0x355be9[0x0];var _0x5b38c6=_0x355be9[0x1];var _0x1e910e=_['filter'](_0x4d7e50[_0x85db('0x27')],function(_0x42ca02){return _0x42ca02[_0x85db('0x48')]==_0x5b38c6['id'];});return _0x1e6f60[_0x85db('0x1a')](0xc8)['json']({'count':_0x1e910e[_0x85db('0x28')],'rows':_0x1e910e});})['catch'](handleError(_0x1e6f60));};exports['conference']=function(_0x493ab3,_0x367e3e){logger[_0x85db('0x13')]('conference\x20fired:',_0x493ab3[_0x85db('0x2c')]);var _0x1249a6=conferenceValidation['validate'](_0x493ab3[_0x85db('0x2c')]);if(_0x1249a6[_0x85db('0x28')]>0x0){return _0x367e3e[_0x85db('0x1a')](0x190)[_0x85db('0x2d')](_0x1249a6);}var _0x42eddd=_0x493ab3[_0x85db('0x2c')]['userId'];return getAgent(_0x42eddd)[_0x85db('0x24')](function(_0x427250){logger[_0x85db('0x13')](_0x85db('0x31'),_0x427250[_0x85db('0x19')]);emit(util[_0x85db('0x32')](_0x85db('0x33'),_0x427250[_0x85db('0x19')]),'webbar:conference');return _0x367e3e['status'](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0x85db('0x21')](handleError(_0x367e3e));};exports[_0x85db('0x49')]=function(_0x88626d,_0x239027){logger[_0x85db('0x13')](_0x85db('0x4a'),_0x88626d['body']);var _0x367ebe=transferValidation[_0x85db('0xc')](_0x88626d[_0x85db('0x2c')]);if(_0x367ebe[_0x85db('0x28')]>0x0){return _0x239027['status'](0x190)[_0x85db('0x2d')](_0x367ebe);}var _0x3dc6f0=_0x88626d[_0x85db('0x2c')][_0x85db('0x2e')];var _0x4d042c=_0x88626d[_0x85db('0x2c')][_0x85db('0x38')];var _0x2af26e=_0x88626d[_0x85db('0x2c')][_0x85db('0x4b')];return getAgent(_0x3dc6f0)['then'](function(_0x4667a5){logger[_0x85db('0x13')](_0x85db('0x31'),_0x4667a5[_0x85db('0x19')]);emit(util[_0x85db('0x32')]('user:%s',_0x4667a5[_0x85db('0x19')]),_0x85db('0x4c'),{'sessionId':_0x4d042c,'transferNumber':_0x2af26e});return _0x239027[_0x85db('0x1a')](0xc8)[_0x85db('0x2d')]({'error':![],'message':_0x85db('0x4d')});})['catch'](handleError(_0x239027));}; \ No newline at end of file +var _0x073e=['originate','info','originate\x20fired:','body','json','userId','callNumber','callbackUrl','entityFound:','format','user:%s','webbar:originate','catch','hangup','webbar:hangup','hangup\x20executed!','answer','webbar:answer','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','UserId','conference','conference\x20fired:','webbar:conference','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','client','http','../../config/logger','defaults','redis','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','emit','log','error','stack','name','status','send','NotFound','request','then','User','agent','VoiceChannels','filter','rows','sessionId','length'];(function(_0x3513a4,_0x53b738){var _0x1a1bca=function(_0x102ee3){while(--_0x102ee3){_0x3513a4['push'](_0x3513a4['shift']());}};_0x1a1bca(++_0x53b738);}(_0x073e,0x181));var _0xe073=function(_0xd35f7f,_0x5aa5c5){_0xd35f7f=_0xd35f7f-0x0;var _0x4cfa61=_0x073e[_0xd35f7f];return _0x4cfa61;};'use strict';var path=require(_0xe073('0x0'));var fs=require('fs');var _=require(_0xe073('0x1'));var db=require(_0xe073('0x2'))['db'];var config=require(_0xe073('0x3'));var util=require('util');var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson[_0xe073('0x4')][_0xe073('0x5')]({'port':0x232a});var logger=require(_0xe073('0x6'))('webbarapi');var Redis=require('ioredis');config['redis']=_[_0xe073('0x7')](config[_0xe073('0x8')],{'host':_0xe073('0x9'),'port':0x18eb});var io=require(_0xe073('0xa'))(new Redis(config[_0xe073('0x8')]));var Schema=require(_0xe073('0xb'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe073('0xc')]},'callNumber':{'type':_0xe073('0xd'),'required':[!![],_0xe073('0xe')]},'callerId':{'type':_0xe073('0xd')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xe073('0xf'),'required':[!![],_0xe073('0xc')]},'sessionId':{'type':_0xe073('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xe073('0xf'),'required':[!![],_0xe073('0xc')]},'sessionId':{'type':_0xe073('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe073('0xc')]},'sessionId':{'type':'string','required':[!![],_0xe073('0x10')]},'transferNumber':{'type':'string','required':[!![],_0xe073('0x11')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe073('0xc')]},'sessionId':{'type':_0xe073('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe073('0xf'),'required':[!![],_0xe073('0xc')]},'sessionId':{'type':_0xe073('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xe073('0xf'),'required':[!![],_0xe073('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0xe073('0xf'),'required':[!![],_0xe073('0xc')]}});function emit(_0x26f3d3,_0x38f9e5,_0x512fe8){logger['info'](_0x26f3d3,_0x38f9e5,JSON['stringify'](_0x512fe8));io['to'](_0x26f3d3)[_0xe073('0x12')](_0x38f9e5,_0x512fe8);}function handleError(_0x15488e){return function(_0x10486c){console[_0xe073('0x13')]('handleError:',_0x10486c,_0x10486c instanceof RangeError);logger[_0xe073('0x14')](_0x10486c[_0xe073('0x15')]);if(_0x10486c instanceof RangeError){if(_0x10486c[_0xe073('0x16')]){delete _0x10486c['name'];}_0x15488e[_0xe073('0x17')](0x194)[_0xe073('0x18')](_0x10486c);}else{if(_0x10486c[_0xe073('0x16')]){delete _0x10486c[_0xe073('0x16')];}_0x15488e[_0xe073('0x17')](0x1f4)[_0xe073('0x18')](_0x10486c);}};}function checkError(){return function(_0x41639a){if(!_0x41639a){throw new RangeError(_0xe073('0x19'));}return _0x41639a;};}function respondWithRpcPromise(_0xef9bf5,_0x40b28c){return new BPromise(function(_0x5143fa,_0x4405fd){var _0x21f9c2=amiClient;return _0x21f9c2[_0xe073('0x1a')](_0xef9bf5,_0x40b28c)[_0xe073('0x1b')](function(_0x39bcb4){if(_0x39bcb4[_0xe073('0x14')]){if(_0x39bcb4['error']['code']===0x1f4){return _0x4405fd(_0x39bcb4[_0xe073('0x14')]['message']);}return _0x5143fa(_0x39bcb4['error']['message']);}else{_0x5143fa(_0x39bcb4['result']);}})['catch'](function(_0x50795f){_0x4405fd(_0x50795f);});});}function getAgent(_0x23537f){return db[_0xe073('0x1c')]['findOne']({'where':{'id':_0x23537f,'role':_0xe073('0x1d')}})[_0xe073('0x1b')](checkError());}function getAgentCheckSession(_0x436c34,_0x5a5b2b){return new BPromise(function(_0x10f5ba,_0x58bffd){var _0x255d91=respondWithRpcPromise(_0xe073('0x1e'));var _0x599972=getAgent(_0x436c34);Promise['all']([_0x255d91,_0x599972])[_0xe073('0x1b')](function(_0x859ed8){var _0x278fbb=_0x859ed8[0x0];var _0x2f1cd2=_0x859ed8[0x1];var _0x20fabe=_[_0xe073('0x1f')](_0x278fbb[_0xe073('0x20')],function(_0x2a206a){return _0x2a206a['UserId']==_0x2f1cd2['id']&&_0x2a206a[_0xe073('0x21')]==_0x5a5b2b;});if(_0x20fabe[_0xe073('0x22')]==0x1){_0x10f5ba(_0x2f1cd2);}else{_0x58bffd(new RangeError('sessionId\x20'+_0x5a5b2b+'\x20not\x20found!'));}});});}exports[_0xe073('0x23')]=function(_0x5afd92,_0x3f6564){logger[_0xe073('0x24')](_0xe073('0x25'),_0x5afd92['body']);var _0x4b1e0a=originateValidation[_0xe073('0xb')](_0x5afd92[_0xe073('0x26')]);if(_0x4b1e0a['length']>0x0){return _0x3f6564[_0xe073('0x17')](0x190)[_0xe073('0x27')](_0x4b1e0a);}var _0xd2e860=_0x5afd92['body'][_0xe073('0x28')];var _0x4997a8=_0x5afd92['body'][_0xe073('0x29')];var _0x4588df=_0x5afd92[_0xe073('0x26')]['callerId'];var _0x23da53=_0x5afd92[_0xe073('0x26')][_0xe073('0x2a')];return getAgent(_0xd2e860)['then'](function(_0x341bab){logger[_0xe073('0x24')](_0xe073('0x2b'),_0x341bab[_0xe073('0x16')]);emit(util[_0xe073('0x2c')](_0xe073('0x2d'),_0x341bab['name']),_0xe073('0x2e'),{'callNumber':_0x4997a8,'callerId':_0x4588df,'callbackUrl':_0x23da53});return _0x3f6564[_0xe073('0x17')](0xc8)[_0xe073('0x27')]({'error':![],'message':'originate\x20executed!'});})[_0xe073('0x2f')](handleError(_0x3f6564));};exports[_0xe073('0x30')]=function(_0x110416,_0xc348b1){logger[_0xe073('0x24')]('hangup\x20fired:',_0x110416[_0xe073('0x26')]);var _0x5abc09=hangupValidation[_0xe073('0xb')](_0x110416[_0xe073('0x26')]);if(_0x5abc09[_0xe073('0x22')]>0x0){return _0xc348b1[_0xe073('0x17')](0x190)[_0xe073('0x27')](_0x5abc09);}var _0x2e200c=_0x110416[_0xe073('0x26')][_0xe073('0x28')];var _0x23a210=_0x110416[_0xe073('0x26')][_0xe073('0x21')];return getAgent(_0x2e200c)[_0xe073('0x1b')](function(_0x16be1a){logger['info'](_0xe073('0x2b'),_0x16be1a['name']);emit(util[_0xe073('0x2c')](_0xe073('0x2d'),_0x16be1a[_0xe073('0x16')]),_0xe073('0x31'),{'sessionId':_0x23a210});return _0xc348b1['status'](0xc8)[_0xe073('0x27')]({'error':![],'message':_0xe073('0x32')});})[_0xe073('0x2f')](handleError(_0xc348b1));};exports[_0xe073('0x33')]=function(_0x27758c,_0x56c08e){logger[_0xe073('0x24')]('answer\x20fired:',_0x27758c[_0xe073('0x26')]);var _0x2a8c57=answerValidation[_0xe073('0xb')](_0x27758c[_0xe073('0x26')]);if(_0x2a8c57[_0xe073('0x22')]>0x0){return _0x56c08e[_0xe073('0x17')](0x190)[_0xe073('0x27')](_0x2a8c57);}var _0x2f4939=_0x27758c[_0xe073('0x26')][_0xe073('0x28')];var _0x2c312b=_0x27758c['body']['sessionId'];return getAgent(_0x2f4939)[_0xe073('0x1b')](function(_0x3d4138){logger[_0xe073('0x24')](_0xe073('0x2b'),_0x3d4138[_0xe073('0x16')]);emit(util['format'](_0xe073('0x2d'),_0x3d4138[_0xe073('0x16')]),_0xe073('0x34'),{'sessionId':_0x2c312b});return _0x56c08e[_0xe073('0x17')](0xc8)[_0xe073('0x27')]({'error':![],'message':'answer\x20executed!'});})[_0xe073('0x2f')](handleError(_0x56c08e));};exports['hold']=function(_0x5aad64,_0x122f82){logger[_0xe073('0x24')]('hold\x20fired:',_0x5aad64['body']);var _0x20aea2=holdValidation[_0xe073('0xb')](_0x5aad64[_0xe073('0x26')]);if(_0x20aea2[_0xe073('0x22')]>0x0){return _0x122f82[_0xe073('0x17')](0x190)[_0xe073('0x27')](_0x20aea2);}var _0x317159=_0x5aad64['body'][_0xe073('0x28')];var _0x570964=_0x5aad64[_0xe073('0x26')][_0xe073('0x21')];return getAgent(_0x317159)[_0xe073('0x1b')](function(_0x4e1f1d){logger['info'](_0xe073('0x2b'),_0x4e1f1d[_0xe073('0x16')]);emit(util[_0xe073('0x2c')]('user:%s',_0x4e1f1d[_0xe073('0x16')]),_0xe073('0x35'),{'sessionId':_0x570964});return _0x122f82[_0xe073('0x17')](0xc8)[_0xe073('0x27')]({'error':![],'message':_0xe073('0x36')});})[_0xe073('0x2f')](handleError(_0x122f82));};exports[_0xe073('0x37')]=function(_0x307541,_0x3238eb){logger['info'](_0xe073('0x38'),_0x307541['body']);var _0x145bff=unholdValidation['validate'](_0x307541[_0xe073('0x26')]);if(_0x145bff[_0xe073('0x22')]>0x0){return _0x3238eb[_0xe073('0x17')](0x190)[_0xe073('0x27')](_0x145bff);}var _0x527a35=_0x307541[_0xe073('0x26')][_0xe073('0x28')];var _0x191005=_0x307541['body']['sessionId'];return getAgent(_0x527a35)[_0xe073('0x1b')](function(_0x1b12f8){logger[_0xe073('0x24')](_0xe073('0x2b'),_0x1b12f8[_0xe073('0x16')]);emit(util['format'](_0xe073('0x2d'),_0x1b12f8[_0xe073('0x16')]),_0xe073('0x39'),{'sessionId':_0x191005});return _0x3238eb[_0xe073('0x17')](0xc8)[_0xe073('0x27')]({'error':![],'message':_0xe073('0x3a')});})[_0xe073('0x2f')](handleError(_0x3238eb));};exports[_0xe073('0x3b')]=function(_0x374587,_0xbb074){logger['info'](_0xe073('0x3c'),_0xbb074['body']);var _0x5825eb=callsValidation[_0xe073('0xb')](_0x374587[_0xe073('0x26')]);if(_0x5825eb[_0xe073('0x22')]>0x0){return _0xbb074['status'](0x190)[_0xe073('0x27')](_0x5825eb);}var _0x37e892=_0x374587[_0xe073('0x26')]['userId'];var _0x420b53=respondWithRpcPromise('VoiceChannels');var _0xa0a501=getAgent(_0x37e892);return Promise[_0xe073('0x3d')]([_0x420b53,_0xa0a501])[_0xe073('0x1b')](function(_0x1a1382){var _0x3ff94a=_0x1a1382[0x0];var _0x56d026=_0x1a1382[0x1];var _0x129953=_[_0xe073('0x1f')](_0x3ff94a[_0xe073('0x20')],function(_0x3c0389){return _0x3c0389[_0xe073('0x3e')]==_0x56d026['id'];});return _0xbb074[_0xe073('0x17')](0xc8)[_0xe073('0x27')]({'count':_0x129953[_0xe073('0x22')],'rows':_0x129953});})[_0xe073('0x2f')](handleError(_0xbb074));};exports[_0xe073('0x3f')]=function(_0x922c35,_0x21ac98){logger[_0xe073('0x24')](_0xe073('0x40'),_0x922c35[_0xe073('0x26')]);var _0x1b26ac=conferenceValidation[_0xe073('0xb')](_0x922c35[_0xe073('0x26')]);if(_0x1b26ac[_0xe073('0x22')]>0x0){return _0x21ac98[_0xe073('0x17')](0x190)['json'](_0x1b26ac);}var _0x2fde71=_0x922c35[_0xe073('0x26')][_0xe073('0x28')];return getAgent(_0x2fde71)[_0xe073('0x1b')](function(_0x29405d){logger['info'](_0xe073('0x2b'),_0x29405d['name']);emit(util[_0xe073('0x2c')](_0xe073('0x2d'),_0x29405d[_0xe073('0x16')]),_0xe073('0x41'));return _0x21ac98[_0xe073('0x17')](0xc8)[_0xe073('0x27')]({'error':![],'message':'conference\x20executed!'});})[_0xe073('0x2f')](handleError(_0x21ac98));};exports['transfer']=function(_0x3c04a9,_0x4be096){logger[_0xe073('0x24')](_0xe073('0x42'),_0x3c04a9[_0xe073('0x26')]);var _0xae8bac=transferValidation[_0xe073('0xb')](_0x3c04a9[_0xe073('0x26')]);if(_0xae8bac[_0xe073('0x22')]>0x0){return _0x4be096[_0xe073('0x17')](0x190)[_0xe073('0x27')](_0xae8bac);}var _0x3264fb=_0x3c04a9[_0xe073('0x26')]['userId'];var _0x4e3453=_0x3c04a9[_0xe073('0x26')][_0xe073('0x21')];var _0x5b8653=_0x3c04a9['body'][_0xe073('0x43')];return getAgent(_0x3264fb)[_0xe073('0x1b')](function(_0x2f70d1){logger[_0xe073('0x24')](_0xe073('0x2b'),_0x2f70d1['name']);emit(util[_0xe073('0x2c')](_0xe073('0x2d'),_0x2f70d1[_0xe073('0x16')]),_0xe073('0x44'),{'sessionId':_0x4e3453,'transferNumber':_0x5b8653});return _0x4be096[_0xe073('0x17')](0xc8)[_0xe073('0x27')]({'error':![],'message':_0xe073('0x45')});})[_0xe073('0x2f')](handleError(_0x4be096));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index a3e3d36..f74d72e 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4de=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','send','delete','removeAnswers','exports','multer'];(function(_0x79e8b5,_0xc953db){var _0x5123a8=function(_0x35e9dd){while(--_0x35e9dd){_0x79e8b5['push'](_0x79e8b5['shift']());}};_0x5123a8(++_0xc953db);}(_0xe4de,0x1bf));var _0xee4d=function(_0x63ede1,_0x2f1409){_0x63ede1=_0x63ede1-0x0;var _0x4b0b61=_0xe4de[_0x63ede1];return _0x4b0b61;};'use strict';var multer=require(_0xee4d('0x0'));var util=require(_0xee4d('0x1'));var path=require(_0xee4d('0x2'));var timeout=require(_0xee4d('0x3'));var express=require(_0xee4d('0x4'));var router=express[_0xee4d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xee4d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xee4d('0x7'));var controller=require(_0xee4d('0x8'));router[_0xee4d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xee4d('0x9')](_0xee4d('0xa'),auth[_0xee4d('0xb')](),controller['describe']);router['get'](_0xee4d('0xc'),auth[_0xee4d('0xb')](),controller[_0xee4d('0xd')]);router['get'](_0xee4d('0xe'),auth[_0xee4d('0xb')](),controller[_0xee4d('0xf')]);router[_0xee4d('0x9')](_0xee4d('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xee4d('0x9')](_0xee4d('0x11'),auth[_0xee4d('0xb')](),controller['getAgents']);router[_0xee4d('0x9')](_0xee4d('0x12'),auth[_0xee4d('0xb')](),controller[_0xee4d('0x13')]);router[_0xee4d('0x14')]('/',auth[_0xee4d('0xb')](),controller[_0xee4d('0x15')]);router[_0xee4d('0x14')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xee4d('0x16')]);router['post']('/:id/canned_answers',auth[_0xee4d('0xb')](),controller[_0xee4d('0x17')]);router[_0xee4d('0x14')]('/:id/users',auth[_0xee4d('0xb')](),controller['addAgents']);router[_0xee4d('0x14')](_0xee4d('0x12'),auth[_0xee4d('0xb')](),controller[_0xee4d('0x18')]);router[_0xee4d('0x14')](_0xee4d('0x19'),controller[_0xee4d('0x1a')]);router['post'](_0xee4d('0x1b'),auth[_0xee4d('0xb')](),controller[_0xee4d('0x1c')]);router['put'](_0xee4d('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xee4d('0x1d')]('/:id',auth[_0xee4d('0xb')](),controller['destroy']);router[_0xee4d('0x1d')](_0xee4d('0xe'),auth[_0xee4d('0xb')](),controller['removeDispositions']);router['delete'](_0xee4d('0x10'),auth[_0xee4d('0xb')](),controller[_0xee4d('0x1e')]);router[_0xee4d('0x1d')](_0xee4d('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xee4d('0x1f')]=router; \ No newline at end of file +var _0x02a7=['./whatsappAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','create','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','send','put','delete','removeAnswers','removeAgents','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3bf7a9,_0x33c630){var _0x209c3d=function(_0x197439){while(--_0x197439){_0x3bf7a9['push'](_0x3bf7a9['shift']());}};_0x209c3d(++_0x33c630);}(_0x02a7,0x14f));var _0x702a=function(_0x639414,_0x3bae37){_0x639414=_0x639414-0x0;var _0x486306=_0x02a7[_0x639414];return _0x486306;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x702a('0x0'));var express=require(_0x702a('0x1'));var router=express[_0x702a('0x2')]();var fs_extra=require(_0x702a('0x3'));var auth=require(_0x702a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x702a('0x5'));router['get']('/',auth[_0x702a('0x6')](),controller[_0x702a('0x7')]);router[_0x702a('0x8')](_0x702a('0x9'),auth[_0x702a('0x6')](),controller[_0x702a('0xa')]);router[_0x702a('0x8')](_0x702a('0xb'),auth[_0x702a('0x6')](),controller[_0x702a('0xc')]);router[_0x702a('0x8')](_0x702a('0xd'),auth[_0x702a('0x6')](),controller[_0x702a('0xe')]);router['get'](_0x702a('0xf'),auth[_0x702a('0x6')](),controller[_0x702a('0x10')]);router['get'](_0x702a('0x11'),auth[_0x702a('0x6')](),controller[_0x702a('0x12')]);router[_0x702a('0x8')](_0x702a('0x13'),auth[_0x702a('0x6')](),controller['getApplications']);router[_0x702a('0x14')]('/',auth[_0x702a('0x6')](),controller[_0x702a('0x15')]);router[_0x702a('0x14')]('/:id/dispositions',auth[_0x702a('0x6')](),controller[_0x702a('0x16')]);router[_0x702a('0x14')](_0x702a('0xf'),auth[_0x702a('0x6')](),controller[_0x702a('0x17')]);router[_0x702a('0x14')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x702a('0x14')](_0x702a('0x13'),auth[_0x702a('0x6')](),controller[_0x702a('0x18')]);router[_0x702a('0x14')](_0x702a('0x19'),controller[_0x702a('0x1a')]);router['post'](_0x702a('0x1b'),auth[_0x702a('0x6')](),controller[_0x702a('0x1c')]);router[_0x702a('0x1d')]('/:id',auth[_0x702a('0x6')](),controller['update']);router[_0x702a('0x1e')](_0x702a('0xb'),auth[_0x702a('0x6')](),controller['destroy']);router[_0x702a('0x1e')](_0x702a('0xd'),auth[_0x702a('0x6')](),controller['removeDispositions']);router[_0x702a('0x1e')](_0x702a('0xf'),auth[_0x702a('0x6')](),controller[_0x702a('0x1f')]);router[_0x702a('0x1e')](_0x702a('0x11'),auth[_0x702a('0x6')](),controller[_0x702a('0x20')]);module[_0x702a('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 5c703c7..837aed2 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb828=['STRING','name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports'];(function(_0x59a0e1,_0x1ce04b){var _0x5a512b=function(_0x220cb8){while(--_0x220cb8){_0x59a0e1['push'](_0x59a0e1['shift']());}};_0x5a512b(++_0x1ce04b);}(_0xb828,0x9e));var _0x8b82=function(_0x479b99,_0x1e5bec){_0x479b99=_0x479b99-0x0;var _0x1e7eb7=_0xb828[_0x479b99];return _0x1e7eb7;};'use strict';var Sequelize=require(_0x8b82('0x0'));var rs=require('randomstring');module[_0x8b82('0x1')]={'name':{'type':Sequelize[_0x8b82('0x2')],'unique':_0x8b82('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x8b82('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x8b82('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x8b82('0x2')],'defaultValue':function(){return rs[_0x8b82('0x4')]();}},'phone':{'type':Sequelize[_0x8b82('0x2')]},'type':{'type':Sequelize[_0x8b82('0x5')](_0x8b82('0x6'),_0x8b82('0x7'))},'accountSid':{'type':Sequelize[_0x8b82('0x2')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x8b82('0x2')]},'notificationTemplate':{'type':Sequelize[_0x8b82('0x8')],'defaultValue':function(){return _0x8b82('0x9');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x8b82('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8b82('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8b82('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8b82('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8b82('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8b82('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8b82('0xb')],'comment':_0x8b82('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x8b82('0xa')],'defaultValue':![],'comment':_0x8b82('0xd'),'set':function(_0x593492){if(!_0x593492){this[_0x8b82('0xe')](_0x8b82('0xf'),null);}this['setDataValue']('mandatoryDisposition',_0x593492);}},'description':{'type':Sequelize[_0x8b82('0x2')]}}; \ No newline at end of file +var _0x83cc=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','ENUM','twilio','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x2f8619,_0x2bb39f){var _0x25f36b=function(_0x2cbadb){while(--_0x2cbadb){_0x2f8619['push'](_0x2f8619['shift']());}};_0x25f36b(++_0x2bb39f);}(_0x83cc,0x115));var _0xc83c=function(_0x29184b,_0xb55b72){_0x29184b=_0x29184b-0x0;var _0x2fefd9=_0x83cc[_0x29184b];return _0x2fefd9;};'use strict';var Sequelize=require(_0xc83c('0x0'));var rs=require(_0xc83c('0x1'));module[_0xc83c('0x2')]={'name':{'type':Sequelize[_0xc83c('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xc83c('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xc83c('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc83c('0x4')](_0xc83c('0x5'),_0xc83c('0x6'))},'accountSid':{'type':Sequelize[_0xc83c('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xc83c('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc83c('0x7');}},'notificationSound':{'type':Sequelize[_0xc83c('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc83c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc83c('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc83c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc83c('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc83c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc83c('0x9')],'comment':_0xc83c('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc83c('0xb'),'set':function(_0x50186c){if(!_0x50186c){this[_0xc83c('0xc')](_0xc83c('0xd'),null);}this[_0xc83c('0xc')](_0xc83c('0xe'),_0x50186c);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index ef3f26f..e2755af 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x431b=['sox','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','sendStatus','status','end','offset','undefined','count','set','Content-Range','apply','save','update','destroy','get','name','send','mandatoryDispositionPause','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','WhatsappAccount','rows','catch','params','Pause','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','findOne','Disposition','WhatsappAccountId','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','pick','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','json','getApplications','whatsapp','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','Applications','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','From','replace','whatsapp:','messageId','MessageSid','notifications','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','contact','WhatsappInteraction','push','close','*,*,*,*','interaction','created','ContactId','UserId','agent','queueId','WhatsappQueue','queue','waitForTheAssignedQueue','Start','startRouting','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','twilio','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','user','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x7be4ff,_0x253ea0){var _0x5a7931=function(_0x4ab850){while(--_0x4ab850){_0x7be4ff['push'](_0x7be4ff['shift']());}};_0x5a7931(++_0x253ea0);}(_0x431b,0x18d));var _0xb431=function(_0x20f48d,_0x18f672){_0x20f48d=_0x20f48d-0x0;var _0x5ac3d6=_0x431b[_0x20f48d];return _0x5ac3d6;};'use strict';var emlformat=require(_0xb431('0x0'));var rimraf=require(_0xb431('0x1'));var zipdir=require(_0xb431('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb431('0x3'));var moment=require(_0xb431('0x4'));var BPromise=require(_0xb431('0x5'));var Mustache=require(_0xb431('0x6'));var util=require(_0xb431('0x7'));var path=require(_0xb431('0x8'));var sox=require(_0xb431('0x9'));var csv=require('to-csv');var ejs=require(_0xb431('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb431('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb431('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb431('0xd'));var Papa=require(_0xb431('0xe'));var Redis=require(_0xb431('0xf'));var authService=require(_0xb431('0x10'));var qs=require(_0xb431('0x11'));var as=require(_0xb431('0x12'));var hardwareService=require(_0xb431('0x13'));var logger=require('../../config/logger')(_0xb431('0x14'));var utils=require(_0xb431('0x15'));var config=require(_0xb431('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb431('0x17'))['db'];config[_0xb431('0x18')]=_[_0xb431('0x19')](config[_0xb431('0x18')],{'host':_0xb431('0x1a'),'port':0x18eb});var socket=require(_0xb431('0x1b'))(new Redis(config['redis']));require(_0xb431('0x1c'))['register'](socket);var jayson=require(_0xb431('0x1d'));var client=jayson[_0xb431('0x1e')][_0xb431('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x2bf8ee,_0x3c3bae,_0x163b4c,_0x4ddfab){return new BPromise(function(_0x339474,_0x592db9){var _0xc73c8a=_0x4ddfab||client;return _0xc73c8a[_0xb431('0x20')](_0x2bf8ee,_0x163b4c)[_0xb431('0x21')](function(_0x411ca1){logger['info'](_0xb431('0x22'),_0x3c3bae,_0xb431('0x23'));logger['debug'](_0xb431('0x24'),_0x3c3bae,_0xb431('0x23'),JSON['stringify'](_0x411ca1));if(_0x411ca1['error']){if(_0x411ca1[_0xb431('0x25')][_0xb431('0x26')]===0x1f4){logger[_0xb431('0x25')](_0xb431('0x22'),_0x3c3bae,_0x411ca1[_0xb431('0x25')][_0xb431('0x27')]);return _0x592db9(_0x411ca1[_0xb431('0x25')][_0xb431('0x27')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x3c3bae,_0x411ca1[_0xb431('0x25')][_0xb431('0x27')]);return _0x339474(_0x411ca1[_0xb431('0x25')][_0xb431('0x27')]);}else{logger[_0xb431('0x28')](_0xb431('0x22'),_0x3c3bae,_0xb431('0x23'));_0x339474(_0x411ca1[_0xb431('0x29')][_0xb431('0x27')]);}})['catch'](function(_0xbba1be){logger[_0xb431('0x25')](_0xb431('0x22'),_0x3c3bae,_0xbba1be);_0x592db9(_0xbba1be);});});}function respondWithStatusCode(_0x575796,_0x521110){_0x521110=_0x521110||0xcc;return function(_0x529a9a){if(_0x529a9a){return _0x575796[_0xb431('0x2a')](_0x521110);}return _0x575796[_0xb431('0x2b')](_0x521110)[_0xb431('0x2c')]();};}function respondWithResult(_0x2d5939,_0x1e6e8b){_0x1e6e8b=_0x1e6e8b||0xc8;return function(_0x4d0b73){if(_0x4d0b73){return _0x2d5939[_0xb431('0x2b')](_0x1e6e8b)['json'](_0x4d0b73);}};}function respondWithFilteredResult(_0xbf40e2,_0x3fb490){return function(_0x47bee2){if(_0x47bee2){var _0xad5fc3=typeof _0x3fb490[_0xb431('0x2d')]===_0xb431('0x2e')&&typeof _0x3fb490['limit']==='undefined';var _0x505fb4=_0x47bee2[_0xb431('0x2f')];var _0x3ee435=_0xad5fc3?0x0:_0x3fb490[_0xb431('0x2d')];var _0x52c0e7=_0xad5fc3?_0x47bee2['count']:_0x3fb490[_0xb431('0x2d')]+_0x3fb490['limit'];var _0x1f775b;if(_0x52c0e7>=_0x505fb4){_0x52c0e7=_0x505fb4;_0x1f775b=0xc8;}else{_0x1f775b=0xce;}_0xbf40e2[_0xb431('0x2b')](_0x1f775b);return _0xbf40e2[_0xb431('0x30')](_0xb431('0x31'),_0x3ee435+'-'+_0x52c0e7+'/'+_0x505fb4)['json'](_0x47bee2);}return null;};}function patchUpdates(_0x51186e){return function(_0x262f7b){try{jsonpatch[_0xb431('0x32')](_0x262f7b,_0x51186e,!![]);}catch(_0x2db252){return BPromise['reject'](_0x2db252);}return _0x262f7b[_0xb431('0x33')]();};}function saveUpdates(_0xb73758,_0x37157d){return function(_0x40dfe1){if(_0x40dfe1){return _0x40dfe1[_0xb431('0x34')](_0xb73758)[_0xb431('0x21')](function(_0x59b9c7){return _0x59b9c7;});}return null;};}function removeEntity(_0x9a16c8,_0x4091b1){return function(_0x2789d8){if(_0x2789d8){return _0x2789d8[_0xb431('0x35')]()[_0xb431('0x21')](function(){var _0x2771fd=_0x2789d8[_0xb431('0x36')]({'plain':!![]});var _0x2030f0='WhatsappAccounts';return db['UserProfileResource'][_0xb431('0x35')]({'where':{'type':_0x2030f0,'resourceId':_0x2771fd['id']}})[_0xb431('0x21')](function(){return _0x2789d8;});})[_0xb431('0x21')](function(){_0x9a16c8[_0xb431('0x2b')](0xcc)[_0xb431('0x2c')]();});}};}function handleEntityNotFound(_0x360306,_0x31f9c4){return function(_0x2b8430){if(!_0x2b8430){_0x360306[_0xb431('0x2a')](0x194);}return _0x2b8430;};}function handleError(_0x8e4d26,_0x41592b){_0x41592b=_0x41592b||0x1f4;return function(_0x2488ca){logger[_0xb431('0x25')](_0x2488ca['stack']);if(_0x2488ca[_0xb431('0x37')]){delete _0x2488ca[_0xb431('0x37')];}_0x8e4d26['status'](_0x41592b)[_0xb431('0x38')](_0x2488ca);};}exports['index']=function(_0x18991f,_0x2c80f7){var _0x4dc679={'include':[{'model':db['Pause'],'as':_0xb431('0x39')}]},_0x53186d={},_0x22fd91={'count':0x0,'rows':[]};var _0x1d6bbd=_['map'](db['WhatsappAccount'][_0xb431('0x3a')],function(_0x5ac2ff){return{'name':_0x5ac2ff[_0xb431('0x3b')],'type':_0x5ac2ff[_0xb431('0x3c')][_0xb431('0x3d')]};});_0x53186d['model']=_['map'](_0x1d6bbd,_0xb431('0x37'));_0x53186d[_0xb431('0x3e')]=_[_0xb431('0x3f')](_0x18991f[_0xb431('0x3e')]);_0x53186d[_0xb431('0x40')]=_['intersection'](_0x53186d[_0xb431('0x41')],_0x53186d[_0xb431('0x3e')]);_0x4dc679[_0xb431('0x42')]=_[_0xb431('0x43')](_0x53186d[_0xb431('0x41')],qs[_0xb431('0x44')](_0x18991f[_0xb431('0x3e')][_0xb431('0x44')]));_0x4dc679[_0xb431('0x42')]=_0x4dc679[_0xb431('0x42')][_0xb431('0x45')]?_0x4dc679[_0xb431('0x42')]:_0x53186d['model'];if(!_0x18991f['query'][_0xb431('0x46')](_0xb431('0x47'))){_0x4dc679[_0xb431('0x48')]=qs[_0xb431('0x48')](_0x18991f[_0xb431('0x3e')][_0xb431('0x48')]);_0x4dc679['offset']=qs[_0xb431('0x2d')](_0x18991f[_0xb431('0x3e')]['offset']);}_0x4dc679[_0xb431('0x49')]=qs[_0xb431('0x4a')](_0x18991f['query'][_0xb431('0x4a')]);_0x4dc679[_0xb431('0x4b')]=qs[_0xb431('0x40')](_['pick'](_0x18991f[_0xb431('0x3e')],_0x53186d[_0xb431('0x40')]),_0x1d6bbd);if(_0x18991f[_0xb431('0x3e')][_0xb431('0x4c')]){_0x4dc679[_0xb431('0x4b')]=_[_0xb431('0x4d')](_0x4dc679[_0xb431('0x4b')],{'$or':_[_0xb431('0x4e')](_0x1d6bbd,function(_0x3047e4){if(_0x3047e4['type']!==_0xb431('0x4f')){var _0x2688cb={};_0x2688cb[_0x3047e4['name']]={'$like':'%'+_0x18991f[_0xb431('0x3e')][_0xb431('0x4c')]+'%'};return _0x2688cb;}})});}_0x4dc679=_[_0xb431('0x4d')]({},_0x4dc679,_0x18991f[_0xb431('0x50')]);var _0x4be594={'where':_0x4dc679[_0xb431('0x4b')]};return db['WhatsappAccount'][_0xb431('0x2f')](_0x4be594)[_0xb431('0x21')](function(_0x264844){_0x22fd91[_0xb431('0x2f')]=_0x264844;if(_0x18991f['query'][_0xb431('0x51')]){_0x4dc679[_0xb431('0x52')]=[{'all':!![]}];}return db[_0xb431('0x53')]['findAll'](_0x4dc679);})[_0xb431('0x21')](function(_0xbe326f){_0x22fd91[_0xb431('0x54')]=_0xbe326f;return _0x22fd91;})[_0xb431('0x21')](respondWithFilteredResult(_0x2c80f7,_0x4dc679))[_0xb431('0x55')](handleError(_0x2c80f7,null));};exports['show']=function(_0x121621,_0x5844dc){var _0x5ccb1f={'raw':![],'where':{'id':_0x121621[_0xb431('0x56')]['id']},'include':[{'model':db[_0xb431('0x57')],'as':'mandatoryDispositionPause'}]},_0x1c8e6c={};_0x1c8e6c[_0xb431('0x41')]=_[_0xb431('0x3f')](db[_0xb431('0x53')]['rawAttributes']);_0x1c8e6c[_0xb431('0x3e')]=_['keys'](_0x121621[_0xb431('0x3e')]);_0x1c8e6c['filters']=_[_0xb431('0x43')](_0x1c8e6c[_0xb431('0x41')],_0x1c8e6c[_0xb431('0x3e')]);_0x5ccb1f[_0xb431('0x42')]=_[_0xb431('0x43')](_0x1c8e6c[_0xb431('0x41')],qs[_0xb431('0x44')](_0x121621[_0xb431('0x3e')][_0xb431('0x44')]));_0x5ccb1f[_0xb431('0x42')]=_0x5ccb1f[_0xb431('0x42')][_0xb431('0x45')]?_0x5ccb1f['attributes']:_0x1c8e6c[_0xb431('0x41')];if(_0x121621[_0xb431('0x3e')]['includeAll']){_0x5ccb1f[_0xb431('0x52')]=[{'all':!![]}];}_0x5ccb1f=_['merge']({},_0x5ccb1f,_0x121621['options']);return db[_0xb431('0x53')][_0xb431('0x58')](_0x5ccb1f)[_0xb431('0x21')](handleEntityNotFound(_0x5844dc,null))['then'](respondWithResult(_0x5844dc,null))[_0xb431('0x55')](handleError(_0x5844dc,null));};exports[_0xb431('0x59')]=function(_0x41e20f,_0x32a792){return db[_0xb431('0x53')]['create'](_0x41e20f[_0xb431('0x5a')],{})[_0xb431('0x21')](function(_0x75ff3){var _0x2537cb=_0x41e20f['user'][_0xb431('0x36')]({'plain':!![]});if(!_0x2537cb)throw new Error(_0xb431('0x5b'));if(_0x2537cb[_0xb431('0x5c')]==='user'){var _0x54378f=_0x75ff3[_0xb431('0x36')]({'plain':!![]});var _0x3e27d1=_0xb431('0x5d');return db[_0xb431('0x5e')][_0xb431('0x58')]({'where':{'name':_0x3e27d1,'userProfileId':_0x2537cb[_0xb431('0x5f')]},'raw':!![]})[_0xb431('0x21')](function(_0x2a12a5){if(_0x2a12a5&&_0x2a12a5[_0xb431('0x60')]===0x0){return db[_0xb431('0x61')][_0xb431('0x59')]({'name':_0x54378f[_0xb431('0x37')],'resourceId':_0x54378f['id'],'type':_0x2a12a5['name'],'sectionId':_0x2a12a5['id']},{})[_0xb431('0x21')](function(){return _0x75ff3;});}else{return _0x75ff3;}})[_0xb431('0x55')](function(_0x1ba445){logger[_0xb431('0x25')](_0xb431('0x62'),_0x1ba445);throw _0x1ba445;});}return _0x75ff3;})[_0xb431('0x21')](respondWithResult(_0x32a792,0xc9))[_0xb431('0x55')](handleError(_0x32a792,null));};exports[_0xb431('0x34')]=function(_0xe11268,_0xfb5ea1){if(_0xe11268[_0xb431('0x5a')]['id']){delete _0xe11268['body']['id'];}return db['WhatsappAccount'][_0xb431('0x58')]({'where':{'id':_0xe11268[_0xb431('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0xb431('0x39')}]})[_0xb431('0x21')](handleEntityNotFound(_0xfb5ea1,null))[_0xb431('0x21')](saveUpdates(_0xe11268[_0xb431('0x5a')],null))[_0xb431('0x21')](respondWithResult(_0xfb5ea1,null))[_0xb431('0x55')](handleError(_0xfb5ea1,null));};exports[_0xb431('0x35')]=function(_0x378e62,_0x8ae0a2){return db['WhatsappAccount'][_0xb431('0x58')]({'where':{'id':_0x378e62[_0xb431('0x56')]['id']}})['then'](handleEntityNotFound(_0x8ae0a2,null))[_0xb431('0x21')](removeEntity(_0x8ae0a2,null))['catch'](handleError(_0x8ae0a2,null));};exports['describe']=function(_0x2c03e1,_0x202b05){return db[_0xb431('0x53')][_0xb431('0x63')]()[_0xb431('0x21')](respondWithResult(_0x202b05,null))[_0xb431('0x55')](handleError(_0x202b05,null));};exports[_0xb431('0x64')]=function(_0x210fc1,_0xd876a9,_0x5bde38){if(_0x210fc1[_0xb431('0x5a')]['id']){delete _0x210fc1['body']['id'];}return db[_0xb431('0x53')]['find']({'where':{'id':_0x210fc1[_0xb431('0x56')]['id']}})['then'](handleEntityNotFound(_0xd876a9,null))['then'](function(_0x26a59d){if(_0x26a59d){_0x210fc1[_0xb431('0x5a')]['WhatsappAccountId']=_0x26a59d['id'];return db['Disposition']['create'](_0x210fc1[_0xb431('0x5a')]);}})['then'](respondWithResult(_0xd876a9,null))['catch'](handleError(_0xd876a9,null));};exports[_0xb431('0x65')]=function(_0x37e926,_0x5efbb1,_0x393ec4){var _0x4c09d3={'raw':![],'where':{}};var _0x2d56ec={};var _0x2e12d9={'count':0x0,'rows':[]};return db[_0xb431('0x53')][_0xb431('0x66')]({'where':{'id':_0x37e926[_0xb431('0x56')]['id']}})[_0xb431('0x21')](handleEntityNotFound(_0x5efbb1,null))[_0xb431('0x21')](function(_0x58efc7){if(_0x58efc7){_0x2d56ec[_0xb431('0x41')]=_[_0xb431('0x3f')](db[_0xb431('0x67')][_0xb431('0x3a')]);_0x2d56ec[_0xb431('0x3e')]=_[_0xb431('0x3f')](_0x37e926[_0xb431('0x3e')]);_0x2d56ec[_0xb431('0x40')]=_[_0xb431('0x43')](_0x2d56ec[_0xb431('0x41')],_0x2d56ec[_0xb431('0x3e')]);_0x4c09d3[_0xb431('0x42')]=_[_0xb431('0x43')](_0x2d56ec['model'],qs['fields'](_0x37e926[_0xb431('0x3e')][_0xb431('0x44')]));_0x4c09d3['attributes']=_0x4c09d3['attributes']['length']?_0x4c09d3[_0xb431('0x42')]:_0x2d56ec[_0xb431('0x41')];if(!_0x37e926[_0xb431('0x3e')][_0xb431('0x46')](_0xb431('0x47'))){_0x4c09d3[_0xb431('0x48')]=qs['limit'](_0x37e926['query'][_0xb431('0x48')]);_0x4c09d3[_0xb431('0x2d')]=qs[_0xb431('0x2d')](_0x37e926[_0xb431('0x3e')][_0xb431('0x2d')]);}_0x4c09d3[_0xb431('0x49')]=qs[_0xb431('0x4a')](_0x37e926[_0xb431('0x3e')][_0xb431('0x4a')]);_0x4c09d3[_0xb431('0x4b')]=qs['filters'](_['pick'](_0x37e926[_0xb431('0x3e')],_0x2d56ec[_0xb431('0x40')]));_0x4c09d3['where'][_0xb431('0x68')]=_0x58efc7['id'];if(_0x37e926[_0xb431('0x3e')]['filter']){_0x4c09d3[_0xb431('0x4b')]=_[_0xb431('0x4d')](_0x4c09d3[_0xb431('0x4b')],{'$or':_[_0xb431('0x4e')](_0x4c09d3[_0xb431('0x42')],function(_0x4db60c){var _0x29aaa3={};_0x29aaa3[_0x4db60c]={'$like':'%'+_0x37e926[_0xb431('0x3e')][_0xb431('0x4c')]+'%'};return _0x29aaa3;})});}_0x4c09d3=_[_0xb431('0x4d')]({},_0x4c09d3,_0x37e926[_0xb431('0x50')]);return db[_0xb431('0x67')]['count']({'where':_0x4c09d3[_0xb431('0x4b')]})[_0xb431('0x21')](function(_0x6c5a0){_0x2e12d9['count']=_0x6c5a0;if(_0x37e926[_0xb431('0x3e')][_0xb431('0x51')]){_0x4c09d3['include']=[{'all':!![]}];}return db[_0xb431('0x67')][_0xb431('0x69')](_0x4c09d3);})['then'](function(_0x33060d){_0x2e12d9['rows']=_0x33060d;return _0x2e12d9;});}})[_0xb431('0x21')](respondWithFilteredResult(_0x5efbb1,_0x4c09d3))['catch'](handleError(_0x5efbb1,null));};exports[_0xb431('0x6a')]=function(_0x36cf09,_0x5cf821,_0x3d9584){return db[_0xb431('0x53')][_0xb431('0x58')]({'where':{'id':_0x36cf09[_0xb431('0x56')]['id']}})['then'](handleEntityNotFound(_0x5cf821,null))[_0xb431('0x21')](function(_0x448858){if(_0x448858){return _0x448858[_0xb431('0x6a')](_0x36cf09['query'][_0xb431('0x6b')]);}})[_0xb431('0x21')](respondWithStatusCode(_0x5cf821,null))[_0xb431('0x55')](handleError(_0x5cf821,null));};exports[_0xb431('0x6c')]=function(_0x4e0270,_0x57d530,_0x28fbda){if(_0x4e0270[_0xb431('0x5a')]['id']){delete _0x4e0270[_0xb431('0x5a')]['id'];}return db[_0xb431('0x53')][_0xb431('0x58')]({'where':{'id':_0x4e0270['params']['id']}})['then'](handleEntityNotFound(_0x57d530,null))[_0xb431('0x21')](function(_0x191158){if(_0x191158){_0x4e0270[_0xb431('0x5a')][_0xb431('0x68')]=_0x191158['id'];return db['CannedAnswer'][_0xb431('0x59')](_0x4e0270['body']);}})[_0xb431('0x21')](respondWithResult(_0x57d530,null))[_0xb431('0x55')](handleError(_0x57d530,null));};exports[_0xb431('0x6d')]=function(_0xf69776,_0x536285,_0x2e426b){var _0x3c9d84={'raw':![],'where':{}};var _0x441fe={};var _0x1c1544={'count':0x0,'rows':[]};return db[_0xb431('0x53')]['findOne']({'where':{'id':_0xf69776[_0xb431('0x56')]['id']}})[_0xb431('0x21')](handleEntityNotFound(_0x536285,null))[_0xb431('0x21')](function(_0x2700cc){if(_0x2700cc){_0x441fe[_0xb431('0x41')]=_[_0xb431('0x3f')](db[_0xb431('0x6e')][_0xb431('0x3a')]);_0x441fe[_0xb431('0x3e')]=_[_0xb431('0x3f')](_0xf69776['query']);_0x441fe[_0xb431('0x40')]=_[_0xb431('0x43')](_0x441fe[_0xb431('0x41')],_0x441fe['query']);_0x3c9d84['attributes']=_[_0xb431('0x43')](_0x441fe[_0xb431('0x41')],qs[_0xb431('0x44')](_0xf69776['query']['fields']));_0x3c9d84[_0xb431('0x42')]=_0x3c9d84[_0xb431('0x42')][_0xb431('0x45')]?_0x3c9d84[_0xb431('0x42')]:_0x441fe[_0xb431('0x41')];if(!_0xf69776['query']['hasOwnProperty'](_0xb431('0x47'))){_0x3c9d84[_0xb431('0x48')]=qs['limit'](_0xf69776[_0xb431('0x3e')][_0xb431('0x48')]);_0x3c9d84[_0xb431('0x2d')]=qs[_0xb431('0x2d')](_0xf69776[_0xb431('0x3e')][_0xb431('0x2d')]);}_0x3c9d84['order']=qs['sort'](_0xf69776[_0xb431('0x3e')][_0xb431('0x4a')]);_0x3c9d84[_0xb431('0x4b')]=qs[_0xb431('0x40')](_[_0xb431('0x6f')](_0xf69776[_0xb431('0x3e')],_0x441fe['filters']));_0x3c9d84[_0xb431('0x4b')][_0xb431('0x68')]=_0x2700cc['id'];if(_0xf69776[_0xb431('0x3e')][_0xb431('0x4c')]){_0x3c9d84[_0xb431('0x4b')]=_[_0xb431('0x4d')](_0x3c9d84[_0xb431('0x4b')],{'$or':_[_0xb431('0x4e')](_0x3c9d84[_0xb431('0x42')],function(_0x457f5e){var _0x3e924a={};_0x3e924a[_0x457f5e]={'$like':'%'+_0xf69776['query'][_0xb431('0x4c')]+'%'};return _0x3e924a;})});}_0x3c9d84=_[_0xb431('0x4d')]({},_0x3c9d84,_0xf69776[_0xb431('0x50')]);return db['CannedAnswer'][_0xb431('0x2f')]({'where':_0x3c9d84[_0xb431('0x4b')]})[_0xb431('0x21')](function(_0x4fd9b5){_0x1c1544[_0xb431('0x2f')]=_0x4fd9b5;if(_0xf69776[_0xb431('0x3e')][_0xb431('0x51')]){_0x3c9d84[_0xb431('0x52')]=[{'all':!![]}];}return db[_0xb431('0x6e')][_0xb431('0x69')](_0x3c9d84);})[_0xb431('0x21')](function(_0x3703a6){_0x1c1544['rows']=_0x3703a6;return _0x1c1544;});}})[_0xb431('0x21')](respondWithFilteredResult(_0x536285,_0x3c9d84))[_0xb431('0x55')](handleError(_0x536285,null));};exports[_0xb431('0x70')]=function(_0x5438d2,_0x6086bd,_0x8d5645){return db[_0xb431('0x53')][_0xb431('0x58')]({'where':{'id':_0x5438d2[_0xb431('0x56')]['id']}})[_0xb431('0x21')](handleEntityNotFound(_0x6086bd,null))[_0xb431('0x21')](function(_0x4c2608){if(_0x4c2608){return _0x4c2608[_0xb431('0x70')](_0x5438d2[_0xb431('0x3e')][_0xb431('0x6b')]);}})[_0xb431('0x21')](respondWithStatusCode(_0x6086bd,null))[_0xb431('0x55')](handleError(_0x6086bd,null));};exports['addAgents']=function(_0x4dd2e3,_0x2e1aec,_0x492558){return db[_0xb431('0x53')]['find']({'where':{'id':_0x4dd2e3[_0xb431('0x56')]['id']}})[_0xb431('0x21')](handleEntityNotFound(_0x2e1aec,null))[_0xb431('0x21')](function(_0x464e8d){if(_0x464e8d){return _0x464e8d[_0xb431('0x71')](_0x4dd2e3['body'][_0xb431('0x6b')],_[_0xb431('0x72')](_0x4dd2e3[_0xb431('0x5a')],[_0xb431('0x6b'),'id'])||{})[_0xb431('0x73')](function(_0x419e64){for(var _0x1cea8b=0x0;_0x1cea8b<_0x4dd2e3[_0xb431('0x5a')][_0xb431('0x6b')][_0xb431('0x45')];_0x1cea8b+=0x1){socket[_0xb431('0x74')](_0xb431('0x75'),{'UserId':Number(_0x4dd2e3[_0xb431('0x5a')][_0xb431('0x6b')][_0x1cea8b]),'WhatsappAccountId':Number(_0x4dd2e3[_0xb431('0x56')]['id'])});}return _0x419e64;});}})[_0xb431('0x21')](respondWithResult(_0x2e1aec,null))['catch'](handleError(_0x2e1aec,null));};exports[_0xb431('0x76')]=function(_0x454fd3,_0x401b55,_0x1699be){return db['WhatsappAccount'][_0xb431('0x58')]({'where':{'id':_0x454fd3[_0xb431('0x56')]['id']}})[_0xb431('0x21')](handleEntityNotFound(_0x401b55,null))['then'](function(_0x58ff17){if(_0x58ff17){return _0x58ff17[_0xb431('0x76')](_0x454fd3['query']['ids'])[_0xb431('0x21')](function(){if(_[_0xb431('0x77')](_0x454fd3[_0xb431('0x3e')][_0xb431('0x6b')])){for(var _0x192b5c=0x0;_0x192b5c<_0x454fd3[_0xb431('0x3e')][_0xb431('0x6b')][_0xb431('0x45')];_0x192b5c+=0x1){socket['emit'](_0xb431('0x78'),{'UserId':Number(_0x454fd3['query'][_0xb431('0x6b')][_0x192b5c]),'WhatsappAccountId':Number(_0x454fd3[_0xb431('0x56')]['id'])});}}else{socket[_0xb431('0x74')](_0xb431('0x78'),{'UserId':Number(_0x454fd3['query'][_0xb431('0x6b')]),'WhatsappAccountId':Number(_0x454fd3[_0xb431('0x56')]['id'])});}});}})[_0xb431('0x21')](respondWithStatusCode(_0x401b55,null))['catch'](handleError(_0x401b55,null));};exports[_0xb431('0x79')]=function(_0x57df59,_0x2e2882,_0x69bba7){var _0xa2f794={};var _0x379f14={};var _0x7da3fb;var _0x18d43a;return db[_0xb431('0x53')][_0xb431('0x66')]({'where':{'id':_0x57df59[_0xb431('0x56')]['id']}})[_0xb431('0x21')](handleEntityNotFound(_0x2e2882,null))[_0xb431('0x21')](function(_0x4e31aa){if(_0x4e31aa){_0x7da3fb=_0x4e31aa;_0x379f14[_0xb431('0x41')]=_[_0xb431('0x3f')](db[_0xb431('0x7a')][_0xb431('0x3a')]);_0x379f14[_0xb431('0x3e')]=_[_0xb431('0x3f')](_0x57df59[_0xb431('0x3e')]);_0x379f14[_0xb431('0x40')]=_[_0xb431('0x43')](_0x379f14[_0xb431('0x41')],_0x379f14['query']);_0xa2f794[_0xb431('0x42')]=_[_0xb431('0x43')](_0x379f14[_0xb431('0x41')],qs['fields'](_0x57df59['query'][_0xb431('0x44')]));_0xa2f794[_0xb431('0x42')]=_0xa2f794['attributes']['length']?_0xa2f794[_0xb431('0x42')]:_0x379f14[_0xb431('0x41')];_0xa2f794[_0xb431('0x49')]=qs[_0xb431('0x4a')](_0x57df59[_0xb431('0x3e')][_0xb431('0x4a')]);_0xa2f794[_0xb431('0x4b')]=qs[_0xb431('0x40')](_[_0xb431('0x6f')](_0x57df59['query'],_0x379f14['filters']));if(_0x57df59['query']['filter']){_0xa2f794[_0xb431('0x4b')]=_[_0xb431('0x4d')](_0xa2f794[_0xb431('0x4b')],{'$or':_[_0xb431('0x4e')](_0xa2f794['attributes'],function(_0x177413){var _0x5848b2={};_0x5848b2[_0x177413]={'$like':'%'+_0x57df59[_0xb431('0x3e')][_0xb431('0x4c')]+'%'};return _0x5848b2;})});}_0xa2f794=_[_0xb431('0x4d')]({},_0xa2f794,_0x57df59[_0xb431('0x50')]);return _0x7da3fb[_0xb431('0x79')](_0xa2f794);}})[_0xb431('0x21')](function(_0x348671){if(_0x348671){_0x18d43a=_0x348671[_0xb431('0x45')];if(!_0x57df59[_0xb431('0x3e')][_0xb431('0x46')](_0xb431('0x47'))){_0xa2f794[_0xb431('0x48')]=qs[_0xb431('0x48')](_0x57df59[_0xb431('0x3e')][_0xb431('0x48')]);_0xa2f794['offset']=qs['offset'](_0x57df59[_0xb431('0x3e')][_0xb431('0x2d')]);}return _0x7da3fb[_0xb431('0x79')](_0xa2f794);}})[_0xb431('0x21')](function(_0x3ce038){if(_0x3ce038){return _0x3ce038?{'count':_0x18d43a,'rows':_0x3ce038}:null;}})['then'](respondWithResult(_0x2e2882,null))[_0xb431('0x55')](handleError(_0x2e2882,null));};exports[_0xb431('0x7b')]=function(_0x2e91c3,_0x1ef950){var _0x3f25aa=_0x2e91c3[_0xb431('0x56')]['id'];var _0x246797=_0x2e91c3[_0xb431('0x5a')];var _0x31c0b4=0xc8;var _0x2edb41=null;return db[_0xb431('0x7c')][_0xb431('0x7d')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0xb431('0x7e')]},function(_0x56d5cf){return db['WhatsappAccount'][_0xb431('0x66')]({'where':{'id':_0x3f25aa},'transaction':_0x56d5cf})['then'](function(_0x19eba1){if(_0x19eba1){return db[_0xb431('0x7f')][_0xb431('0x35')]({'where':{'WhatsappAccountId':_0x3f25aa},'transaction':_0x56d5cf})['then'](function(){var _0x20b4ce=_[_0xb431('0x4e')](_0x246797,function(_0x2a9282){_0x2a9282['WhatsappAccountId']=_0x3f25aa;return _0x2a9282;});return db['WhatsappApplication'][_0xb431('0x80')](_0x20b4ce,{'transaction':_0x56d5cf});});}else{_0x31c0b4=0x194;_0x2edb41=[];}});})[_0xb431('0x21')](function(){if(_0x31c0b4!==0x194){return db['WhatsappApplication'][_0xb431('0x81')]({'where':{'WhatsappAccountId':_0x3f25aa},'order':_0xb431('0x82')})[_0xb431('0x21')](function(_0x411ebc){_0x2edb41=_0x411ebc;});}})[_0xb431('0x55')](function(_0x2d23fe){_0x31c0b4=0x1f4;logger[_0xb431('0x25')](_0x2d23fe[_0xb431('0x83')]);if(_0x2d23fe['name']){delete _0x2d23fe[_0xb431('0x37')];}_0x2edb41=_0x2d23fe;})[_0xb431('0x84')](function(){if(_0x2edb41===null){_0x1ef950['sendStatus'](_0x31c0b4);}else{if(_0x31c0b4===0x1f4){_0x1ef950[_0xb431('0x2b')](_0x31c0b4)['send'](_0x2edb41);}else{_0x1ef950['status'](_0x31c0b4)[_0xb431('0x85')](_0x2edb41);}}});};exports['getApplications']=function(_0x722c8d,_0x2fd7b7,_0x40144d){var _0x40b26c={};var _0x57a234={};var _0x4840c9;var _0x36c522;return db['WhatsappAccount'][_0xb431('0x66')]({'where':{'id':_0x722c8d['params']['id']}})['then'](handleEntityNotFound(_0x2fd7b7,null))[_0xb431('0x21')](function(_0xdb302f){if(_0xdb302f){_0x4840c9=_0xdb302f;_0x57a234['model']=_['keys'](db['WhatsappApplication']['rawAttributes']);_0x57a234[_0xb431('0x3e')]=_['keys'](_0x722c8d[_0xb431('0x3e')]);_0x57a234[_0xb431('0x40')]=_[_0xb431('0x43')](_0x57a234[_0xb431('0x41')],_0x57a234[_0xb431('0x3e')]);_0x40b26c[_0xb431('0x42')]=_[_0xb431('0x43')](_0x57a234[_0xb431('0x41')],qs['fields'](_0x722c8d[_0xb431('0x3e')][_0xb431('0x44')]));_0x40b26c[_0xb431('0x42')]=_0x40b26c[_0xb431('0x42')]['length']?_0x40b26c[_0xb431('0x42')]:_0x57a234['model'];_0x40b26c[_0xb431('0x49')]=qs['sort'](_0x722c8d[_0xb431('0x3e')][_0xb431('0x4a')]);_0x40b26c[_0xb431('0x4b')]=qs[_0xb431('0x40')](_[_0xb431('0x6f')](_0x722c8d[_0xb431('0x3e')],_0x57a234['filters']));if(_0x722c8d['query'][_0xb431('0x4c')]){_0x40b26c[_0xb431('0x4b')]=_[_0xb431('0x4d')](_0x40b26c[_0xb431('0x4b')],{'$or':_[_0xb431('0x4e')](_0x40b26c[_0xb431('0x42')],function(_0x310a87){var _0xe05985={};_0xe05985[_0x310a87]={'$like':'%'+_0x722c8d[_0xb431('0x3e')]['filter']+'%'};return _0xe05985;})});}_0x40b26c=_[_0xb431('0x4d')]({},_0x40b26c,_0x722c8d[_0xb431('0x50')]);return _0x4840c9[_0xb431('0x86')](_0x40b26c);}})[_0xb431('0x21')](function(_0x28370d){if(_0x28370d){_0x36c522=_0x28370d[_0xb431('0x45')];if(!_0x722c8d[_0xb431('0x3e')][_0xb431('0x46')]('nolimit')){_0x40b26c['limit']=qs[_0xb431('0x48')](_0x722c8d['query']['limit']);_0x40b26c['offset']=qs['offset'](_0x722c8d['query'][_0xb431('0x2d')]);}return _0x4840c9[_0xb431('0x86')](_0x40b26c);}})[_0xb431('0x21')](function(_0x12659e){if(_0x12659e){return _0x12659e?{'count':_0x36c522,'rows':_0x12659e}:null;}})['then'](respondWithResult(_0x2fd7b7,null))[_0xb431('0x55')](handleError(_0x2fd7b7,null));};exports['notify']=function(_0x3296d2,_0x53cea7,_0x5c6d24){var _0x2165c7={'channel':_0xb431('0x87')};var _0x5441ca=[];var _0x21da96=[];var _0x5eaa9b={};return db[_0xb431('0x53')][_0xb431('0x58')]({'where':{'id':_0x3296d2[_0xb431('0x56')]['id']},'include':[{'model':db[_0xb431('0x7f')],'as':'Applications'}]})[_0xb431('0x21')](handleEntityNotFound(_0x53cea7,null))['then'](function(_0x49c02b){_0x2165c7['account']=_0x49c02b;if(_0x2165c7[_0xb431('0x88')]&&_0x2165c7[_0xb431('0x88')]['type']===_0xb431('0x89')&&_0x3296d2['body'][_0xb431('0x8a')]){if(_0x3296d2[_0xb431('0x5a')][_0xb431('0x8a')][_0xb431('0x45')]===0x0)return;if(_0x3296d2[_0xb431('0x5a')][_0xb431('0x8a')][0x0][_0xb431('0x8b')]!==_0xb431('0x8c'))return;return db[_0xb431('0x8d')][_0xb431('0x34')]({'read':!![],'readAt':_0x3296d2['body']['statuses'][0x0][_0xb431('0x8e')]},{'where':{'messageId':_0x3296d2['body'][_0xb431('0x8a')][0x0][_0xb431('0x8f')]},'individualHooks':!![]})[_0xb431('0x21')](function(_0x3b35de){return _0x53cea7[_0xb431('0x2b')](0xc8)['json'](_0x3b35de);});}_0x2165c7[_0xb431('0x90')]=_[_0xb431('0x91')](_0x49c02b[_0xb431('0x92')],[_0xb431('0x82')],['asc']);if(_0x2165c7['account'][_0xb431('0x92')]){delete _0x2165c7[_0xb431('0x88')]['Applications'];}return db[_0xb431('0x93')][_0xb431('0x63')]()[_0xb431('0x21')](function(_0x27844a){if(!_0x27844a){throw new db['Sequelize'][(_0xb431('0x94'))](_0xb431('0x95'));}_0x5441ca=_[_0xb431('0x96')](_['keys'](_0x27844a),[_0xb431('0x97'),'updatedAt']);_0x21da96=_[_0xb431('0x96')](_[_0xb431('0x3f')](_0x27844a),[_0xb431('0x97'),_0xb431('0x98'),_0xb431('0x99'),_0xb431('0x9a')]);_0x2165c7[_0xb431('0x5a')]={'mapKey':_0xb431('0x9b')};if(_0x2165c7[_0xb431('0x88')]&&_0x2165c7[_0xb431('0x88')][_0xb431('0x3c')]==='twilio'){_0x2165c7[_0xb431('0x5a')][_0xb431('0x9c')]=_0x3296d2[_0xb431('0x5a')][_0xb431('0x9d')][_0xb431('0x9e')](_0xb431('0x9f'),'');_0x2165c7[_0xb431('0x5a')][_0xb431('0x5a')]=_0x3296d2[_0xb431('0x5a')]['Body'];_0x2165c7['body'][_0xb431('0xa0')]=_0x3296d2[_0xb431('0x5a')][_0xb431('0xa1')];}if(_0x2165c7[_0xb431('0x88')]&&_0x2165c7[_0xb431('0x88')][_0xb431('0x3c')]==='sinch'){_0x2165c7[_0xb431('0x5a')]['from']=_0x3296d2[_0xb431('0x5a')]['notifications'][0x0][_0xb431('0x9c')];_0x2165c7[_0xb431('0x5a')][_0xb431('0x5a')]=_0x3296d2['body']['notifications'][0x0]['message']['body'];_0x2165c7[_0xb431('0x5a')][_0xb431('0xa0')]=_0x3296d2[_0xb431('0x5a')][_0xb431('0xa2')][0x0]['message_id'];}if(_0x2165c7[_0xb431('0x5a')]['id']){delete _0x2165c7[_0xb431('0x5a')]['id'];}if(_[_0xb431('0xa3')](_0x2165c7[_0xb431('0x5a')]['from'])){throw new db[(_0xb431('0xa4'))][(_0xb431('0x94'))](_0xb431('0xa5'));}if(_[_0xb431('0xa3')](_0x2165c7[_0xb431('0x5a')][_0xb431('0x5a')])||_0x2165c7[_0xb431('0x5a')][_0xb431('0x5a')]===''){throw new db[(_0xb431('0xa4'))][(_0xb431('0x94'))](_0xb431('0xa6'));}if(_[_0xb431('0xa3')](_0x2165c7['body'][_0xb431('0xa7')])){throw new db[(_0xb431('0xa4'))]['ValidationError'](_0xb431('0xa8')+_0x21da96);}if(!_[_0xb431('0xa9')](_0x21da96,_0x2165c7[_0xb431('0x5a')]['mapKey'])){throw new db[(_0xb431('0xa4'))][(_0xb431('0x94'))](_0xb431('0xaa')+_0x21da96);}_0x5eaa9b[_0x2165c7[_0xb431('0x5a')][_0xb431('0xa7')]]=_0x2165c7[_0xb431('0x5a')][_0xb431('0x9c')];return db[_0xb431('0xab')][_0xb431('0x58')]({'where':{'id':_0x2165c7['account']['ListId']},'include':[{'model':db[_0xb431('0x93')],'as':_0xb431('0xac'),'where':_0x5eaa9b,'limit':0x1,'order':[['updatedAt',_0xb431('0xad')]]}]});})['then'](handleEntityNotFound(_0x53cea7,null))[_0xb431('0x21')](function(_0x32a3dd){if(_0x32a3dd){_0x2165c7['list']=_['omit'](_0x32a3dd,['Contacts']);if(_0x32a3dd[_0xb431('0xac')][_0xb431('0x45')]){return _0x32a3dd[_0xb431('0xac')][0x0];}var _0x27d833=_[_0xb431('0x19')](_0x2165c7[_0xb431('0x5a')],{'firstName':_0x2165c7[_0xb431('0x5a')][_0xb431('0x9c')],'ListId':_0x32a3dd['id']});_0x27d833[_0x2165c7[_0xb431('0x5a')][_0xb431('0xa7')]]=_0x2165c7['body'][_0xb431('0x9c')];return db[_0xb431('0x93')][_0xb431('0x59')](_0x27d833,{'fields':_0x5441ca,'raw':!![]});}})['then'](handleEntityNotFound(_0x53cea7,null))['then'](function(_0x2fe441){if(_0x2fe441){_0x2165c7[_0xb431('0xae')]=_0x2fe441;var _0xb60abe={'ContactId':_0x2fe441['id'],'phone':_0x2165c7[_0xb431('0x5a')]['from'],'WhatsappAccountId':_0x3296d2[_0xb431('0x56')]['id']};var _0x13cb3d={'ContactId':_0x2fe441['id'],'WhatsappAccountId':_0x3296d2[_0xb431('0x56')]['id'],'closed':![]};return db[_0xb431('0xaf')][_0xb431('0x58')]({'where':_0x13cb3d})[_0xb431('0x21')](function(_0x129974){if(_0x129974){return[_0x129974,![]];}return db[_0xb431('0xaf')][_0xb431('0x59')](_0xb60abe)[_0xb431('0x21')](function(_0x27b2ca){return[_0x27b2ca,!![]];});});}})['spread'](function(_0x4859a0,_0x4b891a){_0x2165c7['interaction']=_0x4859a0[_0xb431('0x36')]({'plain':!![]});_0x2165c7['interaction']['created']=![];if(_0x4b891a){if(_0x2165c7['account']['autoclose']){_0x2165c7[_0xb431('0x90')][_0xb431('0xb0')]({'id':0x0,'priority':_0x2165c7[_0xb431('0x90')][_0xb431('0x45')]+0x1,'app':_0xb431('0xb1'),'appdata':'unmanaged','interval':_0xb431('0xb2')});}_0x2165c7[_0xb431('0xb3')][_0xb431('0xb4')]=!![];}return db['WhatsappMessage'][_0xb431('0x59')]({'phone':_0x2165c7['body'][_0xb431('0x9c')],'messageId':_0x2165c7[_0xb431('0x5a')][_0xb431('0xa0')],'body':_0x2165c7[_0xb431('0x5a')][_0xb431('0x5a')],'WhatsappAccountId':_0x3296d2['params']['id'],'WhatsappInteractionId':_0x4859a0['id'],'direction':'in','ContactId':_0x4859a0[_0xb431('0xb5')],'AttachmentId':_0x2165c7['body']['AttachmentId']});})[_0xb431('0x21')](function(_0xfc1f98){_0x2165c7[_0xb431('0x27')]=_0xfc1f98;if(!_0x2165c7['interaction'][_0xb431('0xb6')])return;return db[_0xb431('0x7a')]['find']({'attributes':['id',_0xb431('0x37')],'where':{'id':_0x2165c7[_0xb431('0xb3')][_0xb431('0xb6')]}});})[_0xb431('0x21')](function(_0x2e08b6){if(_0x2e08b6){_0x2165c7['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xb431('0xb7'),'appdata':_0x2e08b6[_0xb431('0x37')]+','+(_0x2165c7['account']['waitForTheAssignedAgent']||0xa),'interval':_0xb431('0xb2')});}if(!_0x2165c7[_0xb431('0xb3')][_0xb431('0xb8')])return;return db[_0xb431('0xb9')][_0xb431('0x58')]({'attributes':['id',_0xb431('0x37')],'where':{'id':_0x2165c7[_0xb431('0xb3')][_0xb431('0xb8')]}});})[_0xb431('0x21')](function(_0x187f2e){if(_0x187f2e){_0x2165c7[_0xb431('0x90')]['unshift']({'id':0x0,'priority':0x1,'app':_0xb431('0xba'),'appdata':_0x187f2e[_0xb431('0x37')]+','+(_0x2165c7[_0xb431('0x88')][_0xb431('0xbb')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xb431('0xbc'),_0xb431('0xbd'),_0x2165c7);})[_0xb431('0x21')](function(_0x5106a7){if(_0x5106a7){var _0x1b9370=0xc8;var _0xbfef21='receiveMessage';logger['info'](_0xb431('0x24'),_0xbfef21,_0x1b9370,_0xb431('0xbe'));logger[_0xb431('0xbf')](_0xb431('0xc0'),_0xbfef21,_0x1b9370,_0xb431('0xbe'),JSON[_0xb431('0xc1')](_0x5106a7));if(_0x2165c7[_0xb431('0x88')]['type']===_0xb431('0xc2')){return _0x53cea7[_0xb431('0x2b')](_0x1b9370)[_0xb431('0x30')]('Content-Type',_0xb431('0xc3'))[_0xb431('0x38')](_0xb431('0xc4'));}else{return _0x53cea7[_0xb431('0x2b')](_0x1b9370)[_0xb431('0x85')](_0x5106a7);}}});})['catch'](handleError(_0x53cea7,null));};exports[_0xb431('0x38')]=function(_0x5acf58,_0x435705,_0x119a4b){var _0x3c48cc,_0x1b3e5f,_0x1a502f;if(_['isNil'](_0x5acf58[_0xb431('0x5a')]['body'])||_0x5acf58[_0xb431('0x5a')][_0xb431('0x5a')]===''){throw new db[(_0xb431('0xa4'))][(_0xb431('0x94'))](_0xb431('0xa6'));}if(_[_0xb431('0xa3')](_0x5acf58[_0xb431('0x5a')]['to'])){throw new db[(_0xb431('0xa4'))]['ValidationError'](_0xb431('0xc5'));}_0x3c48cc=_0x5acf58[_0xb431('0x5a')]['to'];return db['WhatsappAccount'][_0xb431('0x58')]({'where':{'id':_0x5acf58[_0xb431('0x56')]['id']},'include':[{'model':db[_0xb431('0xab')],'as':_0xb431('0xc6'),'include':[{'model':db[_0xb431('0x93')],'as':_0xb431('0xac'),'where':{'mobile':_0x3c48cc},'limit':0x1,'order':[[_0xb431('0x98'),_0xb431('0xad')]]}]}]})[_0xb431('0x21')](handleEntityNotFound(_0x435705,null))[_0xb431('0x21')](function(_0x349eb6){if(_0x349eb6&&_0x349eb6['List']){_0x1b3e5f=_0x349eb6[_0xb431('0x36')]({'plain':!![]});if(_0x1b3e5f[_0xb431('0xc6')]&&_0x1b3e5f[_0xb431('0xc6')][_0xb431('0xac')][_0xb431('0x45')]){return _0x1b3e5f[_0xb431('0xc6')][_0xb431('0xac')][0x0];}return db['CmContact'][_0xb431('0x59')](_[_0xb431('0x19')](_0x5acf58[_0xb431('0x5a')],{'firstName':_0x3c48cc,'mobile':_0x3c48cc,'phone':_0x3c48cc,'ListId':_0x1b3e5f['ListId']}));}})[_0xb431('0x21')](handleEntityNotFound(_0x435705,null))[_0xb431('0x21')](function(_0xe13bd){if(_0xe13bd){_0x1a502f=_0xe13bd;return db[_0xb431('0xaf')][_0xb431('0x58')]({'where':{'ContactId':_0x1a502f['id'],'closed':![],'WhatsappAccountId':_0x1b3e5f['id']}})[_0xb431('0x21')](function(_0x20a4aa){if(_0x20a4aa){return[_0x20a4aa,![]];}return db[_0xb431('0xaf')][_0xb431('0x59')]({'UserId':_0x5acf58['user']['id'],'ContactId':_0x1a502f['id'],'WhatsappAccountId':_0x1b3e5f['id'],'phone':_0x3c48cc,'firstMsgDirection':_0xb431('0xc7'),'Messages':[_[_0xb431('0x4d')](_0x5acf58[_0xb431('0x5a')],{'read':![],'body':_0x5acf58[_0xb431('0x5a')]['body'],'phone':_0x3c48cc,'WhatsappAccountId':_0x1b3e5f['id'],'UserId':_0x5acf58['user']['id'],'ContactId':_0x1a502f['id']})]},{'include':[{'model':db[_0xb431('0x8d')],'as':_0xb431('0xc8')}]})[_0xb431('0x21')](function(_0x25c51f){return[_0x25c51f,!![]];});});}})['spread'](function(_0x402997,_0x143564){if(_0x143564){return _0x402997;}return db[_0xb431('0x8d')]['create'](_[_0xb431('0x4d')](_0x5acf58[_0xb431('0x5a')],{'read':![],'body':_0x5acf58[_0xb431('0x5a')]['body'],'phone':_0x3c48cc,'WhatsappAccountId':_0x1b3e5f['id'],'WhatsappInteractionId':_0x402997['id'],'UserId':_0x5acf58[_0xb431('0xc9')]['id'],'ContactId':_0x1a502f['id']}))[_0xb431('0x21')](function(_0x2ec0c3){_0x402997[_0xb431('0xca')][_0xb431('0xc8')]=[];_0x402997['dataValues']['Messages'][_0xb431('0xb0')](_0x2ec0c3[_0xb431('0xca')]);return _0x402997;});})[_0xb431('0x21')](respondWithResult(_0x435705,null))[_0xb431('0x55')](handleError(_0x435705,null));}; \ No newline at end of file +var _0xda74=['whatsapp:','Body','MessageSid','notifications','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','ListId','Contacts','DESC','list','omit','contact','WhatsappInteraction','interaction','created','applications','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','WhatsappQueue','queue','waitForTheAssignedQueue','Start','startRouting','entity\x20found','debug','Content-Type','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./whatsappAccount.socket','register','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','WhatsappAccounts','sendStatus','stack','name','send','index','rawAttributes','fieldName','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','WhatsappAccount','findAll','rows','show','params','Pause','mandatoryDispositionPause','options','create','body','user','get','role','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','WhatsappAccountId','getDispositions','findOne','Disposition','nolimit','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','Transaction','WhatsappApplication','bulkCreate','priority','finally','getApplications','notify','whatsapp','Applications','account','type','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda74,0xf1));var _0x4da7=function(_0x32a5be,_0x47f974){_0x32a5be=_0x32a5be-0x0;var _0x3a0a78=_0xda74[_0x32a5be];return _0x3a0a78;};'use strict';var emlformat=require(_0x4da7('0x0'));var rimraf=require(_0x4da7('0x1'));var zipdir=require(_0x4da7('0x2'));var jsonpatch=require(_0x4da7('0x3'));var rp=require(_0x4da7('0x4'));var moment=require(_0x4da7('0x5'));var BPromise=require(_0x4da7('0x6'));var Mustache=require(_0x4da7('0x7'));var util=require('util');var path=require(_0x4da7('0x8'));var sox=require('sox');var csv=require(_0x4da7('0x9'));var ejs=require(_0x4da7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4da7('0xb'));var squel=require(_0x4da7('0xc'));var crypto=require(_0x4da7('0xd'));var jsforce=require(_0x4da7('0xe'));var deskjs=require(_0x4da7('0xf'));var toCsv=require(_0x4da7('0x9'));var querystring=require(_0x4da7('0x10'));var Papa=require(_0x4da7('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4da7('0x12'));var as=require(_0x4da7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4da7('0x14'))(_0x4da7('0x15'));var utils=require(_0x4da7('0x16'));var config=require(_0x4da7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4da7('0x18'))['db'];config[_0x4da7('0x19')]=_[_0x4da7('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4da7('0x19')]));require(_0x4da7('0x1b'))[_0x4da7('0x1c')](socket);var jayson=require(_0x4da7('0x1d'));var client=jayson[_0x4da7('0x1e')][_0x4da7('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x4760ad,_0x23735b,_0x14aa7a,_0x20857e){return new BPromise(function(_0x1290ac,_0x1909a0){var _0x3d4d96=_0x20857e||client;return _0x3d4d96[_0x4da7('0x20')](_0x4760ad,_0x14aa7a)['then'](function(_0x2d2d73){logger[_0x4da7('0x21')](_0x4da7('0x22'),_0x23735b,_0x4da7('0x23'));logger['debug'](_0x4da7('0x24'),_0x23735b,'request\x20sent',JSON[_0x4da7('0x25')](_0x2d2d73));if(_0x2d2d73[_0x4da7('0x26')]){if(_0x2d2d73['error']['code']===0x1f4){logger['error'](_0x4da7('0x22'),_0x23735b,_0x2d2d73[_0x4da7('0x26')][_0x4da7('0x27')]);return _0x1909a0(_0x2d2d73[_0x4da7('0x26')]['message']);}logger[_0x4da7('0x26')](_0x4da7('0x22'),_0x23735b,_0x2d2d73[_0x4da7('0x26')][_0x4da7('0x27')]);return _0x1290ac(_0x2d2d73[_0x4da7('0x26')][_0x4da7('0x27')]);}else{logger[_0x4da7('0x21')](_0x4da7('0x22'),_0x23735b,_0x4da7('0x23'));_0x1290ac(_0x2d2d73[_0x4da7('0x28')][_0x4da7('0x27')]);}})[_0x4da7('0x29')](function(_0x4e99ef){logger['error'](_0x4da7('0x22'),_0x23735b,_0x4e99ef);_0x1909a0(_0x4e99ef);});});}function respondWithStatusCode(_0x44f8e7,_0x319985){_0x319985=_0x319985||0xcc;return function(_0x217728){if(_0x217728){return _0x44f8e7['sendStatus'](_0x319985);}return _0x44f8e7[_0x4da7('0x2a')](_0x319985)[_0x4da7('0x2b')]();};}function respondWithResult(_0x375964,_0x480041){_0x480041=_0x480041||0xc8;return function(_0x27f91f){if(_0x27f91f){return _0x375964[_0x4da7('0x2a')](_0x480041)[_0x4da7('0x2c')](_0x27f91f);}};}function respondWithFilteredResult(_0x1c0650,_0x325fed){return function(_0x374d7d){if(_0x374d7d){var _0x594192=typeof _0x325fed[_0x4da7('0x2d')]===_0x4da7('0x2e')&&typeof _0x325fed[_0x4da7('0x2f')]===_0x4da7('0x2e');var _0x260e47=_0x374d7d[_0x4da7('0x30')];var _0x16e2e0=_0x594192?0x0:_0x325fed['offset'];var _0x548407=_0x594192?_0x374d7d['count']:_0x325fed['offset']+_0x325fed[_0x4da7('0x2f')];var _0x19aa34;if(_0x548407>=_0x260e47){_0x548407=_0x260e47;_0x19aa34=0xc8;}else{_0x19aa34=0xce;}_0x1c0650[_0x4da7('0x2a')](_0x19aa34);return _0x1c0650[_0x4da7('0x31')](_0x4da7('0x32'),_0x16e2e0+'-'+_0x548407+'/'+_0x260e47)['json'](_0x374d7d);}return null;};}function patchUpdates(_0x4261f3){return function(_0x3aaf3c){try{jsonpatch['apply'](_0x3aaf3c,_0x4261f3,!![]);}catch(_0x3e02fa){return BPromise[_0x4da7('0x33')](_0x3e02fa);}return _0x3aaf3c[_0x4da7('0x34')]();};}function saveUpdates(_0x1af183,_0x86f596){return function(_0x45e2aa){if(_0x45e2aa){return _0x45e2aa['update'](_0x1af183)[_0x4da7('0x35')](function(_0x5623fc){return _0x5623fc;});}return null;};}function removeEntity(_0x3c7050,_0x1183fe){return function(_0x288a5e){if(_0x288a5e){return _0x288a5e[_0x4da7('0x36')]()['then'](function(){var _0x3632bb=_0x288a5e['get']({'plain':!![]});var _0x10e93c=_0x4da7('0x37');return db['UserProfileResource'][_0x4da7('0x36')]({'where':{'type':_0x10e93c,'resourceId':_0x3632bb['id']}})[_0x4da7('0x35')](function(){return _0x288a5e;});})[_0x4da7('0x35')](function(){_0x3c7050[_0x4da7('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38bf0a,_0x5bef36){return function(_0x969538){if(!_0x969538){_0x38bf0a[_0x4da7('0x38')](0x194);}return _0x969538;};}function handleError(_0x3d038f,_0x44f219){_0x44f219=_0x44f219||0x1f4;return function(_0xd57ec5){logger[_0x4da7('0x26')](_0xd57ec5[_0x4da7('0x39')]);if(_0xd57ec5[_0x4da7('0x3a')]){delete _0xd57ec5['name'];}_0x3d038f[_0x4da7('0x2a')](_0x44f219)[_0x4da7('0x3b')](_0xd57ec5);};}exports[_0x4da7('0x3c')]=function(_0x21ca3b,_0x2c9228){var _0x264c0e={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x146ca3={},_0xd2aa2b={'count':0x0,'rows':[]};var _0x6714c=_['map'](db['WhatsappAccount'][_0x4da7('0x3d')],function(_0x4d8d42){return{'name':_0x4d8d42[_0x4da7('0x3e')],'type':_0x4d8d42['type']['key']};});_0x146ca3['model']=_['map'](_0x6714c,_0x4da7('0x3a'));_0x146ca3['query']=_[_0x4da7('0x3f')](_0x21ca3b[_0x4da7('0x40')]);_0x146ca3[_0x4da7('0x41')]=_['intersection'](_0x146ca3[_0x4da7('0x42')],_0x146ca3[_0x4da7('0x40')]);_0x264c0e[_0x4da7('0x43')]=_[_0x4da7('0x44')](_0x146ca3[_0x4da7('0x42')],qs[_0x4da7('0x45')](_0x21ca3b['query'][_0x4da7('0x45')]));_0x264c0e[_0x4da7('0x43')]=_0x264c0e['attributes'][_0x4da7('0x46')]?_0x264c0e[_0x4da7('0x43')]:_0x146ca3[_0x4da7('0x42')];if(!_0x21ca3b[_0x4da7('0x40')][_0x4da7('0x47')]('nolimit')){_0x264c0e[_0x4da7('0x2f')]=qs[_0x4da7('0x2f')](_0x21ca3b[_0x4da7('0x40')][_0x4da7('0x2f')]);_0x264c0e[_0x4da7('0x2d')]=qs[_0x4da7('0x2d')](_0x21ca3b[_0x4da7('0x40')]['offset']);}_0x264c0e[_0x4da7('0x48')]=qs[_0x4da7('0x49')](_0x21ca3b[_0x4da7('0x40')][_0x4da7('0x49')]);_0x264c0e[_0x4da7('0x4a')]=qs[_0x4da7('0x41')](_[_0x4da7('0x4b')](_0x21ca3b[_0x4da7('0x40')],_0x146ca3[_0x4da7('0x41')]),_0x6714c);if(_0x21ca3b['query'][_0x4da7('0x4c')]){_0x264c0e[_0x4da7('0x4a')]=_[_0x4da7('0x4d')](_0x264c0e['where'],{'$or':_[_0x4da7('0x4e')](_0x6714c,function(_0x2da1e0){if(_0x2da1e0['type']!==_0x4da7('0x4f')){var _0x5a01b8={};_0x5a01b8[_0x2da1e0[_0x4da7('0x3a')]]={'$like':'%'+_0x21ca3b[_0x4da7('0x40')][_0x4da7('0x4c')]+'%'};return _0x5a01b8;}})});}_0x264c0e=_[_0x4da7('0x4d')]({},_0x264c0e,_0x21ca3b['options']);var _0x8b22ed={'where':_0x264c0e[_0x4da7('0x4a')]};return db['WhatsappAccount'][_0x4da7('0x30')](_0x8b22ed)['then'](function(_0x1f8bc6){_0xd2aa2b[_0x4da7('0x30')]=_0x1f8bc6;if(_0x21ca3b['query'][_0x4da7('0x50')]){_0x264c0e[_0x4da7('0x51')]=[{'all':!![]}];}return db[_0x4da7('0x52')][_0x4da7('0x53')](_0x264c0e);})[_0x4da7('0x35')](function(_0x1554cc){_0xd2aa2b[_0x4da7('0x54')]=_0x1554cc;return _0xd2aa2b;})[_0x4da7('0x35')](respondWithFilteredResult(_0x2c9228,_0x264c0e))[_0x4da7('0x29')](handleError(_0x2c9228,null));};exports[_0x4da7('0x55')]=function(_0x46a70e,_0x27bae7){var _0x506b53={'raw':![],'where':{'id':_0x46a70e[_0x4da7('0x56')]['id']},'include':[{'model':db[_0x4da7('0x57')],'as':_0x4da7('0x58')}]},_0x48c325={};_0x48c325[_0x4da7('0x42')]=_['keys'](db[_0x4da7('0x52')][_0x4da7('0x3d')]);_0x48c325[_0x4da7('0x40')]=_[_0x4da7('0x3f')](_0x46a70e[_0x4da7('0x40')]);_0x48c325['filters']=_[_0x4da7('0x44')](_0x48c325[_0x4da7('0x42')],_0x48c325[_0x4da7('0x40')]);_0x506b53['attributes']=_[_0x4da7('0x44')](_0x48c325[_0x4da7('0x42')],qs[_0x4da7('0x45')](_0x46a70e[_0x4da7('0x40')][_0x4da7('0x45')]));_0x506b53[_0x4da7('0x43')]=_0x506b53[_0x4da7('0x43')][_0x4da7('0x46')]?_0x506b53[_0x4da7('0x43')]:_0x48c325[_0x4da7('0x42')];if(_0x46a70e[_0x4da7('0x40')][_0x4da7('0x50')]){_0x506b53['include']=[{'all':!![]}];}_0x506b53=_['merge']({},_0x506b53,_0x46a70e[_0x4da7('0x59')]);return db['WhatsappAccount']['find'](_0x506b53)['then'](handleEntityNotFound(_0x27bae7,null))[_0x4da7('0x35')](respondWithResult(_0x27bae7,null))[_0x4da7('0x29')](handleError(_0x27bae7,null));};exports['create']=function(_0x134b8b,_0x104403){return db[_0x4da7('0x52')][_0x4da7('0x5a')](_0x134b8b[_0x4da7('0x5b')],{})['then'](function(_0x410071){var _0x2f3b59=_0x134b8b[_0x4da7('0x5c')][_0x4da7('0x5d')]({'plain':!![]});if(!_0x2f3b59)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f3b59[_0x4da7('0x5e')]==='user'){var _0x5a3028=_0x410071[_0x4da7('0x5d')]({'plain':!![]});var _0x429fc5=_0x4da7('0x37');return db['UserProfileSection'][_0x4da7('0x5f')]({'where':{'name':_0x429fc5,'userProfileId':_0x2f3b59[_0x4da7('0x60')]},'raw':!![]})['then'](function(_0x14e271){if(_0x14e271&&_0x14e271['autoAssociation']===0x0){return db[_0x4da7('0x61')][_0x4da7('0x5a')]({'name':_0x5a3028['name'],'resourceId':_0x5a3028['id'],'type':_0x14e271[_0x4da7('0x3a')],'sectionId':_0x14e271['id']},{})[_0x4da7('0x35')](function(){return _0x410071;});}else{return _0x410071;}})[_0x4da7('0x29')](function(_0xb010d2){logger[_0x4da7('0x26')](_0x4da7('0x62'),_0xb010d2);throw _0xb010d2;});}return _0x410071;})[_0x4da7('0x35')](respondWithResult(_0x104403,0xc9))[_0x4da7('0x29')](handleError(_0x104403,null));};exports[_0x4da7('0x63')]=function(_0x3743a1,_0x14eab8){if(_0x3743a1['body']['id']){delete _0x3743a1[_0x4da7('0x5b')]['id'];}return db[_0x4da7('0x52')]['find']({'where':{'id':_0x3743a1[_0x4da7('0x56')]['id']},'include':[{'model':db[_0x4da7('0x57')],'as':'mandatoryDispositionPause'}]})[_0x4da7('0x35')](handleEntityNotFound(_0x14eab8,null))[_0x4da7('0x35')](saveUpdates(_0x3743a1[_0x4da7('0x5b')],null))[_0x4da7('0x35')](respondWithResult(_0x14eab8,null))[_0x4da7('0x29')](handleError(_0x14eab8,null));};exports['destroy']=function(_0x2c61f3,_0x2c3fbc){return db['WhatsappAccount'][_0x4da7('0x5f')]({'where':{'id':_0x2c61f3['params']['id']}})['then'](handleEntityNotFound(_0x2c3fbc,null))['then'](removeEntity(_0x2c3fbc,null))[_0x4da7('0x29')](handleError(_0x2c3fbc,null));};exports[_0x4da7('0x64')]=function(_0x2aee4b,_0x109798){return db[_0x4da7('0x52')]['describe']()[_0x4da7('0x35')](respondWithResult(_0x109798,null))['catch'](handleError(_0x109798,null));};exports['addDisposition']=function(_0x1383cd,_0x2d2d76,_0x5c54e8){if(_0x1383cd['body']['id']){delete _0x1383cd['body']['id'];}return db[_0x4da7('0x52')][_0x4da7('0x5f')]({'where':{'id':_0x1383cd['params']['id']}})['then'](handleEntityNotFound(_0x2d2d76,null))['then'](function(_0x2172f4){if(_0x2172f4){_0x1383cd['body'][_0x4da7('0x65')]=_0x2172f4['id'];return db['Disposition'][_0x4da7('0x5a')](_0x1383cd[_0x4da7('0x5b')]);}})['then'](respondWithResult(_0x2d2d76,null))[_0x4da7('0x29')](handleError(_0x2d2d76,null));};exports[_0x4da7('0x66')]=function(_0x1983a2,_0x5dbb14,_0x1d56ef){var _0x26c3f3={'raw':![],'where':{}};var _0x3328e1={};var _0x27ea4f={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x4da7('0x67')]({'where':{'id':_0x1983a2[_0x4da7('0x56')]['id']}})[_0x4da7('0x35')](handleEntityNotFound(_0x5dbb14,null))['then'](function(_0x558302){if(_0x558302){_0x3328e1[_0x4da7('0x42')]=_[_0x4da7('0x3f')](db[_0x4da7('0x68')][_0x4da7('0x3d')]);_0x3328e1[_0x4da7('0x40')]=_[_0x4da7('0x3f')](_0x1983a2['query']);_0x3328e1[_0x4da7('0x41')]=_['intersection'](_0x3328e1['model'],_0x3328e1['query']);_0x26c3f3[_0x4da7('0x43')]=_[_0x4da7('0x44')](_0x3328e1[_0x4da7('0x42')],qs[_0x4da7('0x45')](_0x1983a2[_0x4da7('0x40')][_0x4da7('0x45')]));_0x26c3f3[_0x4da7('0x43')]=_0x26c3f3[_0x4da7('0x43')]['length']?_0x26c3f3[_0x4da7('0x43')]:_0x3328e1['model'];if(!_0x1983a2[_0x4da7('0x40')][_0x4da7('0x47')](_0x4da7('0x69'))){_0x26c3f3[_0x4da7('0x2f')]=qs[_0x4da7('0x2f')](_0x1983a2['query']['limit']);_0x26c3f3[_0x4da7('0x2d')]=qs[_0x4da7('0x2d')](_0x1983a2[_0x4da7('0x40')]['offset']);}_0x26c3f3['order']=qs[_0x4da7('0x49')](_0x1983a2['query'][_0x4da7('0x49')]);_0x26c3f3[_0x4da7('0x4a')]=qs[_0x4da7('0x41')](_['pick'](_0x1983a2[_0x4da7('0x40')],_0x3328e1[_0x4da7('0x41')]));_0x26c3f3[_0x4da7('0x4a')][_0x4da7('0x65')]=_0x558302['id'];if(_0x1983a2[_0x4da7('0x40')]['filter']){_0x26c3f3['where']=_['merge'](_0x26c3f3[_0x4da7('0x4a')],{'$or':_['map'](_0x26c3f3[_0x4da7('0x43')],function(_0xabb8c){var _0x301de4={};_0x301de4[_0xabb8c]={'$like':'%'+_0x1983a2[_0x4da7('0x40')][_0x4da7('0x4c')]+'%'};return _0x301de4;})});}_0x26c3f3=_['merge']({},_0x26c3f3,_0x1983a2[_0x4da7('0x59')]);return db[_0x4da7('0x68')]['count']({'where':_0x26c3f3[_0x4da7('0x4a')]})[_0x4da7('0x35')](function(_0x47965d){_0x27ea4f[_0x4da7('0x30')]=_0x47965d;if(_0x1983a2[_0x4da7('0x40')][_0x4da7('0x50')]){_0x26c3f3['include']=[{'all':!![]}];}return db[_0x4da7('0x68')]['findAll'](_0x26c3f3);})[_0x4da7('0x35')](function(_0x18c16c){_0x27ea4f[_0x4da7('0x54')]=_0x18c16c;return _0x27ea4f;});}})[_0x4da7('0x35')](respondWithFilteredResult(_0x5dbb14,_0x26c3f3))[_0x4da7('0x29')](handleError(_0x5dbb14,null));};exports[_0x4da7('0x6a')]=function(_0x1f1e5c,_0x4d5009,_0x659c25){return db[_0x4da7('0x52')][_0x4da7('0x5f')]({'where':{'id':_0x1f1e5c[_0x4da7('0x56')]['id']}})[_0x4da7('0x35')](handleEntityNotFound(_0x4d5009,null))[_0x4da7('0x35')](function(_0x177fed){if(_0x177fed){return _0x177fed[_0x4da7('0x6a')](_0x1f1e5c[_0x4da7('0x40')][_0x4da7('0x6b')]);}})[_0x4da7('0x35')](respondWithStatusCode(_0x4d5009,null))[_0x4da7('0x29')](handleError(_0x4d5009,null));};exports[_0x4da7('0x6c')]=function(_0x378bc6,_0x35c0a9,_0x448afc){if(_0x378bc6[_0x4da7('0x5b')]['id']){delete _0x378bc6[_0x4da7('0x5b')]['id'];}return db['WhatsappAccount'][_0x4da7('0x5f')]({'where':{'id':_0x378bc6['params']['id']}})['then'](handleEntityNotFound(_0x35c0a9,null))[_0x4da7('0x35')](function(_0x4a9743){if(_0x4a9743){_0x378bc6['body'][_0x4da7('0x65')]=_0x4a9743['id'];return db['CannedAnswer']['create'](_0x378bc6[_0x4da7('0x5b')]);}})['then'](respondWithResult(_0x35c0a9,null))[_0x4da7('0x29')](handleError(_0x35c0a9,null));};exports[_0x4da7('0x6d')]=function(_0x463f71,_0x548dc0,_0x562683){var _0xdc83b7={'raw':![],'where':{}};var _0x3f4c57={};var _0x28ceac={'count':0x0,'rows':[]};return db[_0x4da7('0x52')][_0x4da7('0x67')]({'where':{'id':_0x463f71[_0x4da7('0x56')]['id']}})['then'](handleEntityNotFound(_0x548dc0,null))[_0x4da7('0x35')](function(_0x9fedc2){if(_0x9fedc2){_0x3f4c57[_0x4da7('0x42')]=_['keys'](db['CannedAnswer'][_0x4da7('0x3d')]);_0x3f4c57[_0x4da7('0x40')]=_['keys'](_0x463f71[_0x4da7('0x40')]);_0x3f4c57[_0x4da7('0x41')]=_[_0x4da7('0x44')](_0x3f4c57[_0x4da7('0x42')],_0x3f4c57[_0x4da7('0x40')]);_0xdc83b7[_0x4da7('0x43')]=_[_0x4da7('0x44')](_0x3f4c57[_0x4da7('0x42')],qs[_0x4da7('0x45')](_0x463f71['query']['fields']));_0xdc83b7[_0x4da7('0x43')]=_0xdc83b7[_0x4da7('0x43')][_0x4da7('0x46')]?_0xdc83b7[_0x4da7('0x43')]:_0x3f4c57[_0x4da7('0x42')];if(!_0x463f71[_0x4da7('0x40')]['hasOwnProperty'](_0x4da7('0x69'))){_0xdc83b7['limit']=qs[_0x4da7('0x2f')](_0x463f71[_0x4da7('0x40')][_0x4da7('0x2f')]);_0xdc83b7['offset']=qs[_0x4da7('0x2d')](_0x463f71['query'][_0x4da7('0x2d')]);}_0xdc83b7[_0x4da7('0x48')]=qs[_0x4da7('0x49')](_0x463f71[_0x4da7('0x40')][_0x4da7('0x49')]);_0xdc83b7[_0x4da7('0x4a')]=qs[_0x4da7('0x41')](_[_0x4da7('0x4b')](_0x463f71['query'],_0x3f4c57[_0x4da7('0x41')]));_0xdc83b7['where'][_0x4da7('0x65')]=_0x9fedc2['id'];if(_0x463f71[_0x4da7('0x40')][_0x4da7('0x4c')]){_0xdc83b7['where']=_['merge'](_0xdc83b7[_0x4da7('0x4a')],{'$or':_['map'](_0xdc83b7['attributes'],function(_0xffd668){var _0x18a13f={};_0x18a13f[_0xffd668]={'$like':'%'+_0x463f71[_0x4da7('0x40')][_0x4da7('0x4c')]+'%'};return _0x18a13f;})});}_0xdc83b7=_[_0x4da7('0x4d')]({},_0xdc83b7,_0x463f71[_0x4da7('0x59')]);return db[_0x4da7('0x6e')][_0x4da7('0x30')]({'where':_0xdc83b7[_0x4da7('0x4a')]})[_0x4da7('0x35')](function(_0x426f8e){_0x28ceac[_0x4da7('0x30')]=_0x426f8e;if(_0x463f71[_0x4da7('0x40')][_0x4da7('0x50')]){_0xdc83b7[_0x4da7('0x51')]=[{'all':!![]}];}return db[_0x4da7('0x6e')][_0x4da7('0x53')](_0xdc83b7);})[_0x4da7('0x35')](function(_0x528a76){_0x28ceac[_0x4da7('0x54')]=_0x528a76;return _0x28ceac;});}})[_0x4da7('0x35')](respondWithFilteredResult(_0x548dc0,_0xdc83b7))[_0x4da7('0x29')](handleError(_0x548dc0,null));};exports[_0x4da7('0x6f')]=function(_0x1378cb,_0xe252f8,_0x4d46fc){return db[_0x4da7('0x52')]['find']({'where':{'id':_0x1378cb['params']['id']}})['then'](handleEntityNotFound(_0xe252f8,null))['then'](function(_0x3495c4){if(_0x3495c4){return _0x3495c4[_0x4da7('0x6f')](_0x1378cb[_0x4da7('0x40')][_0x4da7('0x6b')]);}})[_0x4da7('0x35')](respondWithStatusCode(_0xe252f8,null))[_0x4da7('0x29')](handleError(_0xe252f8,null));};exports[_0x4da7('0x70')]=function(_0xd3776c,_0x9ffa9f,_0x3b0722){return db[_0x4da7('0x52')][_0x4da7('0x5f')]({'where':{'id':_0xd3776c[_0x4da7('0x56')]['id']}})[_0x4da7('0x35')](handleEntityNotFound(_0x9ffa9f,null))['then'](function(_0xe9bcd2){if(_0xe9bcd2){return _0xe9bcd2[_0x4da7('0x70')](_0xd3776c[_0x4da7('0x5b')][_0x4da7('0x6b')],_['omit'](_0xd3776c[_0x4da7('0x5b')],['ids','id'])||{})[_0x4da7('0x71')](function(_0x3ede8f){for(var _0x4d73b1=0x0;_0x4d73b1<_0xd3776c[_0x4da7('0x5b')][_0x4da7('0x6b')][_0x4da7('0x46')];_0x4d73b1+=0x1){socket[_0x4da7('0x72')](_0x4da7('0x73'),{'UserId':Number(_0xd3776c['body']['ids'][_0x4d73b1]),'WhatsappAccountId':Number(_0xd3776c[_0x4da7('0x56')]['id'])});}return _0x3ede8f;});}})[_0x4da7('0x35')](respondWithResult(_0x9ffa9f,null))['catch'](handleError(_0x9ffa9f,null));};exports[_0x4da7('0x74')]=function(_0xc9b539,_0x2483e3,_0x4c4c57){return db[_0x4da7('0x52')][_0x4da7('0x5f')]({'where':{'id':_0xc9b539[_0x4da7('0x56')]['id']}})[_0x4da7('0x35')](handleEntityNotFound(_0x2483e3,null))['then'](function(_0x1a508f){if(_0x1a508f){return _0x1a508f[_0x4da7('0x74')](_0xc9b539[_0x4da7('0x40')]['ids'])[_0x4da7('0x35')](function(){if(_[_0x4da7('0x75')](_0xc9b539[_0x4da7('0x40')][_0x4da7('0x6b')])){for(var _0x5ed99c=0x0;_0x5ed99c<_0xc9b539[_0x4da7('0x40')][_0x4da7('0x6b')][_0x4da7('0x46')];_0x5ed99c+=0x1){socket[_0x4da7('0x72')](_0x4da7('0x76'),{'UserId':Number(_0xc9b539['query']['ids'][_0x5ed99c]),'WhatsappAccountId':Number(_0xc9b539[_0x4da7('0x56')]['id'])});}}else{socket[_0x4da7('0x72')](_0x4da7('0x76'),{'UserId':Number(_0xc9b539['query'][_0x4da7('0x6b')]),'WhatsappAccountId':Number(_0xc9b539[_0x4da7('0x56')]['id'])});}});}})[_0x4da7('0x35')](respondWithStatusCode(_0x2483e3,null))[_0x4da7('0x29')](handleError(_0x2483e3,null));};exports[_0x4da7('0x77')]=function(_0x1314a7,_0x47510b,_0x11e076){var _0x3b7c16={};var _0x2a5834={};var _0x335ca3;var _0x5a6c03;return db[_0x4da7('0x52')]['findOne']({'where':{'id':_0x1314a7[_0x4da7('0x56')]['id']}})[_0x4da7('0x35')](handleEntityNotFound(_0x47510b,null))[_0x4da7('0x35')](function(_0x40211c){if(_0x40211c){_0x335ca3=_0x40211c;_0x2a5834[_0x4da7('0x42')]=_[_0x4da7('0x3f')](db[_0x4da7('0x78')]['rawAttributes']);_0x2a5834['query']=_[_0x4da7('0x3f')](_0x1314a7[_0x4da7('0x40')]);_0x2a5834[_0x4da7('0x41')]=_[_0x4da7('0x44')](_0x2a5834[_0x4da7('0x42')],_0x2a5834['query']);_0x3b7c16[_0x4da7('0x43')]=_[_0x4da7('0x44')](_0x2a5834['model'],qs[_0x4da7('0x45')](_0x1314a7[_0x4da7('0x40')]['fields']));_0x3b7c16[_0x4da7('0x43')]=_0x3b7c16[_0x4da7('0x43')][_0x4da7('0x46')]?_0x3b7c16[_0x4da7('0x43')]:_0x2a5834[_0x4da7('0x42')];_0x3b7c16[_0x4da7('0x48')]=qs[_0x4da7('0x49')](_0x1314a7[_0x4da7('0x40')][_0x4da7('0x49')]);_0x3b7c16[_0x4da7('0x4a')]=qs[_0x4da7('0x41')](_[_0x4da7('0x4b')](_0x1314a7[_0x4da7('0x40')],_0x2a5834['filters']));if(_0x1314a7[_0x4da7('0x40')][_0x4da7('0x4c')]){_0x3b7c16[_0x4da7('0x4a')]=_[_0x4da7('0x4d')](_0x3b7c16['where'],{'$or':_[_0x4da7('0x4e')](_0x3b7c16['attributes'],function(_0x49f1bd){var _0x5a9255={};_0x5a9255[_0x49f1bd]={'$like':'%'+_0x1314a7[_0x4da7('0x40')][_0x4da7('0x4c')]+'%'};return _0x5a9255;})});}_0x3b7c16=_[_0x4da7('0x4d')]({},_0x3b7c16,_0x1314a7['options']);return _0x335ca3[_0x4da7('0x77')](_0x3b7c16);}})[_0x4da7('0x35')](function(_0x82d8fc){if(_0x82d8fc){_0x5a6c03=_0x82d8fc[_0x4da7('0x46')];if(!_0x1314a7['query']['hasOwnProperty'](_0x4da7('0x69'))){_0x3b7c16[_0x4da7('0x2f')]=qs[_0x4da7('0x2f')](_0x1314a7['query'][_0x4da7('0x2f')]);_0x3b7c16['offset']=qs[_0x4da7('0x2d')](_0x1314a7['query']['offset']);}return _0x335ca3[_0x4da7('0x77')](_0x3b7c16);}})[_0x4da7('0x35')](function(_0x52489a){if(_0x52489a){return _0x52489a?{'count':_0x5a6c03,'rows':_0x52489a}:null;}})[_0x4da7('0x35')](respondWithResult(_0x47510b,null))[_0x4da7('0x29')](handleError(_0x47510b,null));};exports[_0x4da7('0x79')]=function(_0x23f858,_0x37613b){var _0x5e1adb=_0x23f858[_0x4da7('0x56')]['id'];var _0x1aa4bd=_0x23f858[_0x4da7('0x5b')];var _0x41af33=0xc8;var _0x111663=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x4da7('0x7a')][_0x4da7('0x7b')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x1dfb8e){return db[_0x4da7('0x52')][_0x4da7('0x67')]({'where':{'id':_0x5e1adb},'transaction':_0x1dfb8e})[_0x4da7('0x35')](function(_0x3822ff){if(_0x3822ff){return db['WhatsappApplication'][_0x4da7('0x36')]({'where':{'WhatsappAccountId':_0x5e1adb},'transaction':_0x1dfb8e})['then'](function(){var _0x259045=_[_0x4da7('0x4e')](_0x1aa4bd,function(_0x2d27c5){_0x2d27c5['WhatsappAccountId']=_0x5e1adb;return _0x2d27c5;});return db[_0x4da7('0x7c')][_0x4da7('0x7d')](_0x259045,{'transaction':_0x1dfb8e});});}else{_0x41af33=0x194;_0x111663=[];}});})[_0x4da7('0x35')](function(){if(_0x41af33!==0x194){return db[_0x4da7('0x7c')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x5e1adb},'order':_0x4da7('0x7e')})['then'](function(_0x3a19f0){_0x111663=_0x3a19f0;});}})[_0x4da7('0x29')](function(_0x25087a){_0x41af33=0x1f4;logger[_0x4da7('0x26')](_0x25087a[_0x4da7('0x39')]);if(_0x25087a['name']){delete _0x25087a[_0x4da7('0x3a')];}_0x111663=_0x25087a;})[_0x4da7('0x7f')](function(){if(_0x111663===null){_0x37613b[_0x4da7('0x38')](_0x41af33);}else{if(_0x41af33===0x1f4){_0x37613b['status'](_0x41af33)[_0x4da7('0x3b')](_0x111663);}else{_0x37613b[_0x4da7('0x2a')](_0x41af33)[_0x4da7('0x2c')](_0x111663);}}});};exports[_0x4da7('0x80')]=function(_0x5f1993,_0x3ea3f1,_0x44810c){var _0x17b461={};var _0x249edc={};var _0x5eb847;var _0x41e7d9;return db[_0x4da7('0x52')][_0x4da7('0x67')]({'where':{'id':_0x5f1993[_0x4da7('0x56')]['id']}})['then'](handleEntityNotFound(_0x3ea3f1,null))[_0x4da7('0x35')](function(_0x424315){if(_0x424315){_0x5eb847=_0x424315;_0x249edc['model']=_[_0x4da7('0x3f')](db[_0x4da7('0x7c')]['rawAttributes']);_0x249edc[_0x4da7('0x40')]=_[_0x4da7('0x3f')](_0x5f1993[_0x4da7('0x40')]);_0x249edc[_0x4da7('0x41')]=_[_0x4da7('0x44')](_0x249edc[_0x4da7('0x42')],_0x249edc[_0x4da7('0x40')]);_0x17b461[_0x4da7('0x43')]=_[_0x4da7('0x44')](_0x249edc[_0x4da7('0x42')],qs[_0x4da7('0x45')](_0x5f1993[_0x4da7('0x40')][_0x4da7('0x45')]));_0x17b461[_0x4da7('0x43')]=_0x17b461[_0x4da7('0x43')]['length']?_0x17b461[_0x4da7('0x43')]:_0x249edc[_0x4da7('0x42')];_0x17b461[_0x4da7('0x48')]=qs[_0x4da7('0x49')](_0x5f1993[_0x4da7('0x40')][_0x4da7('0x49')]);_0x17b461[_0x4da7('0x4a')]=qs['filters'](_[_0x4da7('0x4b')](_0x5f1993[_0x4da7('0x40')],_0x249edc[_0x4da7('0x41')]));if(_0x5f1993[_0x4da7('0x40')][_0x4da7('0x4c')]){_0x17b461['where']=_[_0x4da7('0x4d')](_0x17b461[_0x4da7('0x4a')],{'$or':_['map'](_0x17b461[_0x4da7('0x43')],function(_0x515a8a){var _0x3eca92={};_0x3eca92[_0x515a8a]={'$like':'%'+_0x5f1993['query'][_0x4da7('0x4c')]+'%'};return _0x3eca92;})});}_0x17b461=_['merge']({},_0x17b461,_0x5f1993['options']);return _0x5eb847['getApplications'](_0x17b461);}})[_0x4da7('0x35')](function(_0x4396ba){if(_0x4396ba){_0x41e7d9=_0x4396ba[_0x4da7('0x46')];if(!_0x5f1993[_0x4da7('0x40')][_0x4da7('0x47')](_0x4da7('0x69'))){_0x17b461['limit']=qs[_0x4da7('0x2f')](_0x5f1993[_0x4da7('0x40')][_0x4da7('0x2f')]);_0x17b461[_0x4da7('0x2d')]=qs[_0x4da7('0x2d')](_0x5f1993[_0x4da7('0x40')]['offset']);}return _0x5eb847[_0x4da7('0x80')](_0x17b461);}})[_0x4da7('0x35')](function(_0x686d9f){if(_0x686d9f){return _0x686d9f?{'count':_0x41e7d9,'rows':_0x686d9f}:null;}})[_0x4da7('0x35')](respondWithResult(_0x3ea3f1,null))[_0x4da7('0x29')](handleError(_0x3ea3f1,null));};exports[_0x4da7('0x81')]=function(_0x1313d0,_0x337fc1,_0x1fdfff){var _0x3a3850={'channel':_0x4da7('0x82')};var _0x1baa10=[];var _0x305bf0=[];var _0x3a7a6e={};return db[_0x4da7('0x52')][_0x4da7('0x5f')]({'where':{'id':_0x1313d0[_0x4da7('0x56')]['id']},'include':[{'model':db[_0x4da7('0x7c')],'as':_0x4da7('0x83')}]})['then'](handleEntityNotFound(_0x337fc1,null))['then'](function(_0x1dfedd){_0x3a3850[_0x4da7('0x84')]=_0x1dfedd;if(_0x3a3850['account']&&_0x3a3850[_0x4da7('0x84')][_0x4da7('0x85')]===_0x4da7('0x86')&&_0x1313d0[_0x4da7('0x5b')][_0x4da7('0x87')]){if(_0x1313d0[_0x4da7('0x5b')][_0x4da7('0x87')][_0x4da7('0x46')]===0x0)return;if(_0x1313d0[_0x4da7('0x5b')][_0x4da7('0x87')][0x0][_0x4da7('0x88')]!==_0x4da7('0x89'))return;return db[_0x4da7('0x8a')][_0x4da7('0x63')]({'read':!![],'readAt':_0x1313d0[_0x4da7('0x5b')][_0x4da7('0x87')][0x0][_0x4da7('0x8b')]},{'where':{'messageId':_0x1313d0[_0x4da7('0x5b')][_0x4da7('0x87')][0x0][_0x4da7('0x8c')]},'individualHooks':!![]})[_0x4da7('0x35')](function(_0x3ed768){return _0x337fc1[_0x4da7('0x2a')](0xc8)['json'](_0x3ed768);});}_0x3a3850['applications']=_[_0x4da7('0x8d')](_0x1dfedd[_0x4da7('0x83')],['priority'],[_0x4da7('0x8e')]);if(_0x3a3850['account'][_0x4da7('0x83')]){delete _0x3a3850['account']['Applications'];}return db[_0x4da7('0x8f')][_0x4da7('0x64')]()[_0x4da7('0x35')](function(_0xdc265c){if(!_0xdc265c){throw new db[(_0x4da7('0x90'))][(_0x4da7('0x91'))](_0x4da7('0x92'));}_0x1baa10=_[_0x4da7('0x93')](_['keys'](_0xdc265c),[_0x4da7('0x94'),_0x4da7('0x95')]);_0x305bf0=_[_0x4da7('0x93')](_[_0x4da7('0x3f')](_0xdc265c),[_0x4da7('0x94'),'updatedAt',_0x4da7('0x96'),'ListId']);_0x3a3850['body']={'mapKey':_0x4da7('0x97')};if(_0x3a3850[_0x4da7('0x84')]&&_0x3a3850['account'][_0x4da7('0x85')]===_0x4da7('0x98')){_0x3a3850[_0x4da7('0x5b')][_0x4da7('0x99')]=_0x1313d0[_0x4da7('0x5b')][_0x4da7('0x9a')]['replace'](_0x4da7('0x9b'),'');_0x3a3850[_0x4da7('0x5b')][_0x4da7('0x5b')]=_0x1313d0[_0x4da7('0x5b')][_0x4da7('0x9c')];_0x3a3850[_0x4da7('0x5b')]['messageId']=_0x1313d0[_0x4da7('0x5b')][_0x4da7('0x9d')];}if(_0x3a3850[_0x4da7('0x84')]&&_0x3a3850['account']['type']===_0x4da7('0x86')){_0x3a3850[_0x4da7('0x5b')]['from']=_0x1313d0['body']['notifications'][0x0][_0x4da7('0x99')];_0x3a3850[_0x4da7('0x5b')][_0x4da7('0x5b')]=_0x1313d0[_0x4da7('0x5b')][_0x4da7('0x9e')][0x0][_0x4da7('0x27')][_0x4da7('0x5b')];_0x3a3850[_0x4da7('0x5b')]['messageId']=_0x1313d0[_0x4da7('0x5b')][_0x4da7('0x9e')][0x0][_0x4da7('0x8c')];}if(_0x3a3850[_0x4da7('0x5b')]['id']){delete _0x3a3850[_0x4da7('0x5b')]['id'];}if(_['isNil'](_0x3a3850[_0x4da7('0x5b')]['from'])){throw new db[(_0x4da7('0x90'))][(_0x4da7('0x91'))]('from\x20is\x20mandatory');}if(_[_0x4da7('0x9f')](_0x3a3850[_0x4da7('0x5b')][_0x4da7('0x5b')])||_0x3a3850[_0x4da7('0x5b')][_0x4da7('0x5b')]===''){throw new db[(_0x4da7('0x90'))][(_0x4da7('0x91'))](_0x4da7('0xa0'));}if(_[_0x4da7('0x9f')](_0x3a3850[_0x4da7('0x5b')][_0x4da7('0xa1')])){throw new db['Sequelize'][(_0x4da7('0x91'))](_0x4da7('0xa2')+_0x305bf0);}if(!_['includes'](_0x305bf0,_0x3a3850[_0x4da7('0x5b')][_0x4da7('0xa1')])){throw new db['Sequelize'][(_0x4da7('0x91'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x305bf0);}_0x3a7a6e[_0x3a3850[_0x4da7('0x5b')][_0x4da7('0xa1')]]=_0x3a3850['body'][_0x4da7('0x99')];return db['CmList'][_0x4da7('0x5f')]({'where':{'id':_0x3a3850['account'][_0x4da7('0xa3')]},'include':[{'model':db[_0x4da7('0x8f')],'as':_0x4da7('0xa4'),'where':_0x3a7a6e,'limit':0x1,'order':[[_0x4da7('0x95'),_0x4da7('0xa5')]]}]});})[_0x4da7('0x35')](handleEntityNotFound(_0x337fc1,null))[_0x4da7('0x35')](function(_0x5dcde1){if(_0x5dcde1){_0x3a3850[_0x4da7('0xa6')]=_[_0x4da7('0xa7')](_0x5dcde1,['Contacts']);if(_0x5dcde1[_0x4da7('0xa4')][_0x4da7('0x46')]){return _0x5dcde1[_0x4da7('0xa4')][0x0];}var _0x2f7835=_[_0x4da7('0x1a')](_0x3a3850[_0x4da7('0x5b')],{'firstName':_0x3a3850[_0x4da7('0x5b')][_0x4da7('0x99')],'ListId':_0x5dcde1['id']});_0x2f7835[_0x3a3850[_0x4da7('0x5b')][_0x4da7('0xa1')]]=_0x3a3850[_0x4da7('0x5b')][_0x4da7('0x99')];return db[_0x4da7('0x8f')][_0x4da7('0x5a')](_0x2f7835,{'fields':_0x1baa10,'raw':!![]});}})[_0x4da7('0x35')](handleEntityNotFound(_0x337fc1,null))[_0x4da7('0x35')](function(_0x81c0a0){if(_0x81c0a0){_0x3a3850[_0x4da7('0xa8')]=_0x81c0a0;var _0x44476b={'ContactId':_0x81c0a0['id'],'phone':_0x3a3850[_0x4da7('0x5b')]['from'],'WhatsappAccountId':_0x1313d0[_0x4da7('0x56')]['id']};var _0x195f33={'ContactId':_0x81c0a0['id'],'WhatsappAccountId':_0x1313d0['params']['id'],'closed':![]};return db['WhatsappInteraction'][_0x4da7('0x5f')]({'where':_0x195f33})[_0x4da7('0x35')](function(_0x1825cc){if(_0x1825cc){return[_0x1825cc,![]];}return db[_0x4da7('0xa9')][_0x4da7('0x5a')](_0x44476b)[_0x4da7('0x35')](function(_0x11f412){return[_0x11f412,!![]];});});}})[_0x4da7('0x71')](function(_0x13f36c,_0x1bf163){_0x3a3850[_0x4da7('0xaa')]=_0x13f36c[_0x4da7('0x5d')]({'plain':!![]});_0x3a3850[_0x4da7('0xaa')][_0x4da7('0xab')]=![];if(_0x1bf163){if(_0x3a3850['account']['autoclose']){_0x3a3850[_0x4da7('0xac')]['push']({'id':0x0,'priority':_0x3a3850[_0x4da7('0xac')][_0x4da7('0x46')]+0x1,'app':_0x4da7('0xad'),'appdata':_0x4da7('0xae'),'interval':_0x4da7('0xaf')});}_0x3a3850['interaction'][_0x4da7('0xab')]=!![];}return db[_0x4da7('0x8a')][_0x4da7('0x5a')]({'phone':_0x3a3850['body'][_0x4da7('0x99')],'messageId':_0x3a3850[_0x4da7('0x5b')]['messageId'],'body':_0x3a3850[_0x4da7('0x5b')][_0x4da7('0x5b')],'WhatsappAccountId':_0x1313d0[_0x4da7('0x56')]['id'],'WhatsappInteractionId':_0x13f36c['id'],'direction':'in','ContactId':_0x13f36c[_0x4da7('0xb0')],'AttachmentId':_0x3a3850['body'][_0x4da7('0xb1')]});})[_0x4da7('0x35')](function(_0x557c91){_0x3a3850[_0x4da7('0x27')]=_0x557c91;if(!_0x3a3850[_0x4da7('0xaa')][_0x4da7('0xb2')])return;return db[_0x4da7('0x78')][_0x4da7('0x5f')]({'attributes':['id',_0x4da7('0x3a')],'where':{'id':_0x3a3850[_0x4da7('0xaa')]['UserId']}});})[_0x4da7('0x35')](function(_0x34fce2){if(_0x34fce2){_0x3a3850[_0x4da7('0xac')][_0x4da7('0xb3')]({'id':0x0,'priority':0x0,'app':_0x4da7('0xb4'),'appdata':_0x34fce2[_0x4da7('0x3a')]+','+(_0x3a3850[_0x4da7('0x84')][_0x4da7('0xb5')]||0xa),'interval':_0x4da7('0xaf')});}if(!_0x3a3850[_0x4da7('0xaa')][_0x4da7('0xb6')])return;return db[_0x4da7('0xb7')][_0x4da7('0x5f')]({'attributes':['id',_0x4da7('0x3a')],'where':{'id':_0x3a3850[_0x4da7('0xaa')]['queueId']}});})[_0x4da7('0x35')](function(_0x302d14){if(_0x302d14){_0x3a3850[_0x4da7('0xac')]['unshift']({'id':0x0,'priority':0x1,'app':_0x4da7('0xb8'),'appdata':_0x302d14[_0x4da7('0x3a')]+','+(_0x3a3850[_0x4da7('0x84')][_0x4da7('0xb9')]||0x12c),'interval':_0x4da7('0xaf')});}return respondWithRpcPromise(_0x4da7('0xba'),_0x4da7('0xbb'),_0x3a3850);})[_0x4da7('0x35')](function(_0x56bce8){if(_0x56bce8){var _0x4a8385=0xc8;var _0xe1e745='receiveMessage';logger[_0x4da7('0x21')](_0x4da7('0x24'),_0xe1e745,_0x4a8385,_0x4da7('0xbc'));logger[_0x4da7('0xbd')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0xe1e745,_0x4a8385,_0x4da7('0xbc'),JSON[_0x4da7('0x25')](_0x56bce8));if(_0x3a3850[_0x4da7('0x84')][_0x4da7('0x85')]===_0x4da7('0x98')){return _0x337fc1[_0x4da7('0x2a')](_0x4a8385)[_0x4da7('0x31')](_0x4da7('0xbe'),'text/xml')[_0x4da7('0x3b')](_0x4da7('0xbf'));}else{return _0x337fc1[_0x4da7('0x2a')](_0x4a8385)['json'](_0x56bce8);}}});})['catch'](handleError(_0x337fc1,null));};exports['send']=function(_0x53957e,_0xd01af5,_0x48d913){var _0x44254e,_0x4fcb45,_0x5e8625;if(_[_0x4da7('0x9f')](_0x53957e[_0x4da7('0x5b')][_0x4da7('0x5b')])||_0x53957e[_0x4da7('0x5b')][_0x4da7('0x5b')]===''){throw new db[(_0x4da7('0x90'))][(_0x4da7('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4da7('0x9f')](_0x53957e[_0x4da7('0x5b')]['to'])){throw new db[(_0x4da7('0x90'))][(_0x4da7('0x91'))](_0x4da7('0xc0'));}_0x44254e=_0x53957e['body']['to'];return db[_0x4da7('0x52')][_0x4da7('0x5f')]({'where':{'id':_0x53957e['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x4da7('0x8f')],'as':_0x4da7('0xa4'),'where':{'mobile':_0x44254e},'limit':0x1,'order':[[_0x4da7('0x95'),_0x4da7('0xa5')]]}]}]})[_0x4da7('0x35')](handleEntityNotFound(_0xd01af5,null))[_0x4da7('0x35')](function(_0x3ff46b){if(_0x3ff46b&&_0x3ff46b['List']){_0x4fcb45=_0x3ff46b['get']({'plain':!![]});if(_0x4fcb45[_0x4da7('0xc1')]&&_0x4fcb45[_0x4da7('0xc1')][_0x4da7('0xa4')][_0x4da7('0x46')]){return _0x4fcb45[_0x4da7('0xc1')]['Contacts'][0x0];}return db[_0x4da7('0x8f')]['create'](_[_0x4da7('0x1a')](_0x53957e[_0x4da7('0x5b')],{'firstName':_0x44254e,'mobile':_0x44254e,'phone':_0x44254e,'ListId':_0x4fcb45[_0x4da7('0xa3')]}));}})['then'](handleEntityNotFound(_0xd01af5,null))['then'](function(_0x127244){if(_0x127244){_0x5e8625=_0x127244;return db[_0x4da7('0xa9')][_0x4da7('0x5f')]({'where':{'ContactId':_0x5e8625['id'],'closed':![],'WhatsappAccountId':_0x4fcb45['id']}})['then'](function(_0x45311b){if(_0x45311b){return[_0x45311b,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x53957e[_0x4da7('0x5c')]['id'],'ContactId':_0x5e8625['id'],'WhatsappAccountId':_0x4fcb45['id'],'phone':_0x44254e,'firstMsgDirection':_0x4da7('0xc2'),'Messages':[_[_0x4da7('0x4d')](_0x53957e['body'],{'read':![],'body':_0x53957e[_0x4da7('0x5b')][_0x4da7('0x5b')],'phone':_0x44254e,'WhatsappAccountId':_0x4fcb45['id'],'UserId':_0x53957e[_0x4da7('0x5c')]['id'],'ContactId':_0x5e8625['id']})]},{'include':[{'model':db[_0x4da7('0x8a')],'as':_0x4da7('0xc3')}]})[_0x4da7('0x35')](function(_0x240716){return[_0x240716,!![]];});});}})[_0x4da7('0x71')](function(_0x310297,_0x322b0f){if(_0x322b0f){return _0x310297;}return db['WhatsappMessage'][_0x4da7('0x5a')](_['merge'](_0x53957e[_0x4da7('0x5b')],{'read':![],'body':_0x53957e[_0x4da7('0x5b')][_0x4da7('0x5b')],'phone':_0x44254e,'WhatsappAccountId':_0x4fcb45['id'],'WhatsappInteractionId':_0x310297['id'],'UserId':_0x53957e['user']['id'],'ContactId':_0x5e8625['id']}))['then'](function(_0x5048e9){_0x310297[_0x4da7('0xc4')][_0x4da7('0xc3')]=[];_0x310297['dataValues'][_0x4da7('0xc3')][_0x4da7('0xc5')](_0x5048e9[_0x4da7('0xc4')]);return _0x310297;});})['then'](respondWithResult(_0xd01af5,null))[_0x4da7('0x29')](handleError(_0xd01af5,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index a6a63a3..b2b1b0f 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1be1=['hook','events','../../mysqldb','WhatsappAccount','setMaxListeners','update','remove','emit'];(function(_0x224cf7,_0x4e468d){var _0x198366=function(_0x5e3873){while(--_0x5e3873){_0x224cf7['push'](_0x224cf7['shift']());}};_0x198366(++_0x4e468d);}(_0x1be1,0x1e9));var _0x11be=function(_0x473328,_0x2aa0cb){_0x473328=_0x473328-0x0;var _0x3dd1cb=_0x1be1[_0x473328];return _0x3dd1cb;};'use strict';var EventEmitter=require(_0x11be('0x0'));var WhatsappAccount=require(_0x11be('0x1'))['db'][_0x11be('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x11be('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x11be('0x4'),'afterDestroy':_0x11be('0x5')};function emitEvent(_0x405f56){return function(_0x3c7541,_0x4040bf,_0x4456c4){WhatsappAccountEvents[_0x11be('0x6')](_0x405f56+':'+_0x3c7541['id'],_0x3c7541);WhatsappAccountEvents[_0x11be('0x6')](_0x405f56,_0x3c7541);_0x4456c4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x11be('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x8c2b=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x2f569b,_0x4a4556){var _0x5da362=function(_0x527810){while(--_0x527810){_0x2f569b['push'](_0x2f569b['shift']());}};_0x5da362(++_0x4a4556);}(_0x8c2b,0xe5));var _0xb8c2=function(_0x21dc9c,_0x116926){_0x21dc9c=_0x21dc9c-0x0;var _0x1fd707=_0x8c2b[_0x21dc9c];return _0x1fd707;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xb8c2('0x0'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xb8c2('0x1')](0x0);var events={'afterCreate':_0xb8c2('0x2'),'afterUpdate':'update','afterDestroy':_0xb8c2('0x3')};function emitEvent(_0x42f657){return function(_0x4ea3c7,_0x61bd0b,_0x59701d){WhatsappAccountEvents[_0xb8c2('0x4')](_0x42f657+':'+_0x4ea3c7['id'],_0x4ea3c7);WhatsappAccountEvents[_0xb8c2('0x4')](_0x42f657,_0x4ea3c7);_0x59701d(null);};}for(var e in events){if(events[_0xb8c2('0x5')](e)){var event=events[e];WhatsappAccount[_0xb8c2('0x6')](e,emitEvent(event));}}module[_0xb8c2('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 2ed3dbf..21fea9c 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb5ce=['whatsapp_accounts','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','WhatsappAccount'];(function(_0x44a264,_0x39f768){var _0x2f0024=function(_0x3a825e){while(--_0x3a825e){_0x44a264['push'](_0x44a264['shift']());}};_0x2f0024(++_0x39f768);}(_0xb5ce,0x173));var _0xeb5c=function(_0x2d335d,_0x57b4da){_0x2d335d=_0x2d335d-0x0;var _0x475ef5=_0xb5ce[_0x2d335d];return _0x475ef5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xeb5c('0x0'));var BPromise=require(_0xeb5c('0x1'));var rp=require(_0xeb5c('0x2'));var fs=require('fs');var path=require(_0xeb5c('0x3'));var rimraf=require(_0xeb5c('0x4'));var config=require(_0xeb5c('0x5'));var attributes=require(_0xeb5c('0x6'));module[_0xeb5c('0x7')]=function(_0x5411c0,_0x31dca6){return _0x5411c0['define'](_0xeb5c('0x8'),attributes,{'tableName':_0xeb5c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ac6=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','WhatsappAccount','whatsapp_accounts'];(function(_0x22a001,_0x501c96){var _0x5a7dd7=function(_0x4f4247){while(--_0x4f4247){_0x22a001['push'](_0x22a001['shift']());}};_0x5a7dd7(++_0x501c96);}(_0x3ac6,0x176));var _0x63ac=function(_0x43ff55,_0x145418){_0x43ff55=_0x43ff55-0x0;var _0x30598f=_0x3ac6[_0x43ff55];return _0x30598f;};'use strict';var _=require(_0x63ac('0x0'));var util=require(_0x63ac('0x1'));var logger=require(_0x63ac('0x2'))(_0x63ac('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x63ac('0x4'));var fs=require('fs');var path=require(_0x63ac('0x5'));var rimraf=require(_0x63ac('0x6'));var config=require(_0x63ac('0x7'));var attributes=require('./whatsappAccount.attributes');module['exports']=function(_0x2488e0,_0x22a1e9){return _0x2488e0[_0x63ac('0x8')](_0x63ac('0x9'),attributes,{'tableName':_0x63ac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 0789d81..2d82ebd 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe034=['include','model','attributes','debug','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappAccount.socket','register','then','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where'];(function(_0xce4c29,_0x4029e5){var _0x3e7922=function(_0x17c742){while(--_0x17c742){_0xce4c29['push'](_0xce4c29['shift']());}};_0x3e7922(++_0x4029e5);}(_0xe034,0x190));var _0x4e03=function(_0x47d28f,_0xed095f){_0x47d28f=_0x47d28f-0x0;var _0x5916c6=_0xe034[_0x47d28f];return _0x5916c6;};'use strict';var _=require(_0x4e03('0x0'));var util=require(_0x4e03('0x1'));var moment=require(_0x4e03('0x2'));var BPromise=require('bluebird');var rs=require(_0x4e03('0x3'));var fs=require('fs');var Redis=require(_0x4e03('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e03('0x5'));var logger=require(_0x4e03('0x6'))('rpc');var config=require(_0x4e03('0x7'));var jayson=require(_0x4e03('0x8'));var client=jayson[_0x4e03('0x9')][_0x4e03('0xa')]({'port':0x232a});config[_0x4e03('0xb')]=_[_0x4e03('0xc')](config[_0x4e03('0xb')],{'host':_0x4e03('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4e03('0xb')]));require(_0x4e03('0xe'))[_0x4e03('0xf')](socket);function respondWithRpcPromise(_0x4870a2,_0x2950e9,_0x4d7f48){return new BPromise(function(_0x5e792f,_0x11eccd){return client['request'](_0x4870a2,_0x4d7f48)[_0x4e03('0x10')](function(_0x1d744c){logger[_0x4e03('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x2950e9,_0x4e03('0x12'));logger['debug'](_0x4e03('0x13'),_0x2950e9,'request\x20sent',JSON[_0x4e03('0x14')](_0x1d744c));if(_0x1d744c[_0x4e03('0x15')]){if(_0x1d744c[_0x4e03('0x15')][_0x4e03('0x16')]===0x1f4){logger[_0x4e03('0x15')](_0x4e03('0x17'),_0x2950e9,_0x1d744c['error'][_0x4e03('0x18')]);return _0x11eccd(_0x1d744c[_0x4e03('0x15')][_0x4e03('0x18')]);}logger[_0x4e03('0x15')](_0x4e03('0x17'),_0x2950e9,_0x1d744c[_0x4e03('0x15')][_0x4e03('0x18')]);return _0x5e792f(_0x1d744c[_0x4e03('0x15')][_0x4e03('0x18')]);}else{logger[_0x4e03('0x11')](_0x4e03('0x17'),_0x2950e9,_0x4e03('0x12'));_0x5e792f(_0x1d744c[_0x4e03('0x19')][_0x4e03('0x18')]);}})[_0x4e03('0x1a')](function(_0x5d5e4d){logger[_0x4e03('0x15')](_0x4e03('0x17'),_0x2950e9,_0x5d5e4d);_0x11eccd(_0x5d5e4d);});});}exports[_0x4e03('0x1b')]=function(_0x38c034){var _0x319b27=this;return new Promise(function(_0x3114aa,_0x240072){return db[_0x4e03('0x1c')][_0x4e03('0x1d')]({'raw':_0x38c034[_0x4e03('0x1e')]?_0x38c034[_0x4e03('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x38c034[_0x4e03('0x1e')]?_0x38c034['options'][_0x4e03('0x1f')]||null:null,'attributes':_0x38c034[_0x4e03('0x1e')]?_0x38c034[_0x4e03('0x1e')]['attributes']||null:null,'include':_0x38c034[_0x4e03('0x1e')]?_0x38c034[_0x4e03('0x1e')][_0x4e03('0x20')]?_['map'](_0x38c034['options'][_0x4e03('0x20')],function(_0x5337fe){return{'model':db[_0x5337fe[_0x4e03('0x21')]],'as':_0x5337fe['as'],'attributes':_0x5337fe[_0x4e03('0x22')],'include':_0x5337fe[_0x4e03('0x20')]?_['map'](_0x5337fe[_0x4e03('0x20')],function(_0x4e4e05){return{'model':db[_0x4e4e05[_0x4e03('0x21')]],'as':_0x4e4e05['as'],'attributes':_0x4e4e05['attributes'],'include':_0x4e4e05[_0x4e03('0x20')]?_['map'](_0x4e4e05[_0x4e03('0x20')],function(_0x4b1a1a){return{'model':db[_0x4b1a1a[_0x4e03('0x21')]],'as':_0x4b1a1a['as'],'attributes':_0x4b1a1a[_0x4e03('0x22')]};}):[]};}):[]};}):[]:[]})[_0x4e03('0x10')](function(_0x4d42d4){logger[_0x4e03('0x11')](_0x4e03('0x1b'),_0x38c034);logger[_0x4e03('0x23')]('ShowWhatsappAccount',_0x38c034,JSON['stringify'](_0x4d42d4));_0x3114aa(_0x4d42d4);})['catch'](function(_0x1fdfaf){logger[_0x4e03('0x15')](_0x4e03('0x1b'),_0x1fdfaf[_0x4e03('0x18')],_0x38c034);_0x240072(_0x319b27[_0x4e03('0x15')](0x1f4,_0x1fdfaf[_0x4e03('0x18')]));});});}; \ No newline at end of file +var _0xe1e9=['catch','WhatsappAccount','options','raw','where','attributes','include','map','model','ShowWhatsappAccount','debug','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','socket.io-emitter','./whatsappAccount.socket','register','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message'];(function(_0x16818e,_0x4c3656){var _0x6fadf9=function(_0x182c97){while(--_0x182c97){_0x16818e['push'](_0x16818e['shift']());}};_0x6fadf9(++_0x4c3656);}(_0xe1e9,0x10b));var _0x9e1e=function(_0xdb60c4,_0x2beac1){_0xdb60c4=_0xdb60c4-0x0;var _0x191a4d=_0xe1e9[_0xdb60c4];return _0x191a4d;};'use strict';var _=require(_0x9e1e('0x0'));var util=require('util');var moment=require(_0x9e1e('0x1'));var BPromise=require(_0x9e1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e1e('0x3'))['db'];var utils=require(_0x9e1e('0x4'));var logger=require('../../config/logger')(_0x9e1e('0x5'));var config=require(_0x9e1e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9e1e('0x7')][_0x9e1e('0x8')]({'port':0x232a});config[_0x9e1e('0x9')]=_['defaults'](config[_0x9e1e('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9e1e('0xa'))(new Redis(config[_0x9e1e('0x9')]));require(_0x9e1e('0xb'))[_0x9e1e('0xc')](socket);function respondWithRpcPromise(_0x4f2159,_0x2be3c3,_0x2e301d){return new BPromise(function(_0x443bc9,_0x2c6dcd){return client['request'](_0x4f2159,_0x2e301d)['then'](function(_0x1e484b){logger[_0x9e1e('0xd')]('WhatsappAccount,\x20%s,\x20%s',_0x2be3c3,_0x9e1e('0xe'));logger['debug'](_0x9e1e('0xf'),_0x2be3c3,'request\x20sent',JSON[_0x9e1e('0x10')](_0x1e484b));if(_0x1e484b[_0x9e1e('0x11')]){if(_0x1e484b[_0x9e1e('0x11')][_0x9e1e('0x12')]===0x1f4){logger[_0x9e1e('0x11')](_0x9e1e('0x13'),_0x2be3c3,_0x1e484b[_0x9e1e('0x11')][_0x9e1e('0x14')]);return _0x2c6dcd(_0x1e484b[_0x9e1e('0x11')]['message']);}logger[_0x9e1e('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x2be3c3,_0x1e484b[_0x9e1e('0x11')]['message']);return _0x443bc9(_0x1e484b[_0x9e1e('0x11')]['message']);}else{logger[_0x9e1e('0xd')](_0x9e1e('0x13'),_0x2be3c3,'request\x20sent');_0x443bc9(_0x1e484b['result']['message']);}})[_0x9e1e('0x15')](function(_0xeffb5){logger[_0x9e1e('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x2be3c3,_0xeffb5);_0x2c6dcd(_0xeffb5);});});}exports['ShowWhatsappAccount']=function(_0x226e08){var _0x27882e=this;return new Promise(function(_0x3b549e,_0x406915){return db[_0x9e1e('0x16')]['find']({'raw':_0x226e08['options']?_0x226e08[_0x9e1e('0x17')][_0x9e1e('0x18')]===undefined?!![]:![]:!![],'where':_0x226e08[_0x9e1e('0x17')]?_0x226e08[_0x9e1e('0x17')][_0x9e1e('0x19')]||null:null,'attributes':_0x226e08[_0x9e1e('0x17')]?_0x226e08[_0x9e1e('0x17')][_0x9e1e('0x1a')]||null:null,'include':_0x226e08[_0x9e1e('0x17')]?_0x226e08[_0x9e1e('0x17')][_0x9e1e('0x1b')]?_[_0x9e1e('0x1c')](_0x226e08[_0x9e1e('0x17')][_0x9e1e('0x1b')],function(_0x5e71c6){return{'model':db[_0x5e71c6['model']],'as':_0x5e71c6['as'],'attributes':_0x5e71c6[_0x9e1e('0x1a')],'include':_0x5e71c6['include']?_[_0x9e1e('0x1c')](_0x5e71c6[_0x9e1e('0x1b')],function(_0x5ca751){return{'model':db[_0x5ca751[_0x9e1e('0x1d')]],'as':_0x5ca751['as'],'attributes':_0x5ca751[_0x9e1e('0x1a')],'include':_0x5ca751[_0x9e1e('0x1b')]?_[_0x9e1e('0x1c')](_0x5ca751[_0x9e1e('0x1b')],function(_0x2bcfc9){return{'model':db[_0x2bcfc9['model']],'as':_0x2bcfc9['as'],'attributes':_0x2bcfc9[_0x9e1e('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8f66ef){logger[_0x9e1e('0xd')](_0x9e1e('0x1e'),_0x226e08);logger[_0x9e1e('0x1f')]('ShowWhatsappAccount',_0x226e08,JSON[_0x9e1e('0x10')](_0x8f66ef));_0x3b549e(_0x8f66ef);})[_0x9e1e('0x15')](function(_0x35beaa){logger['error']('ShowWhatsappAccount',_0x35beaa[_0x9e1e('0x14')],_0x226e08);_0x406915(_0x27882e['error'](0x1f4,_0x35beaa['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index cc79014..d0329bd 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x591d=['update','emit','removeListener','whatsappAccount:','./whatsappAccount.events','save','remove'];(function(_0x54c177,_0x3b1abf){var _0x31e301=function(_0x522872){while(--_0x522872){_0x54c177['push'](_0x54c177['shift']());}};_0x31e301(++_0x3b1abf);}(_0x591d,0x1c4));var _0xd591=function(_0x1a990c,_0x570ceb){_0x1a990c=_0x1a990c-0x0;var _0x4f1eee=_0x591d[_0x1a990c];return _0x4f1eee;};'use strict';var WhatsappAccountEvents=require(_0xd591('0x0'));var events=[_0xd591('0x1'),_0xd591('0x2'),_0xd591('0x3')];function createListener(_0x1c0103,_0x1dfa49){return function(_0x3cfb0d){_0x1dfa49[_0xd591('0x4')](_0x1c0103,_0x3cfb0d);};}function removeListener(_0x5e3500,_0x58c372){return function(){WhatsappAccountEvents[_0xd591('0x5')](_0x5e3500,_0x58c372);};}exports['register']=function(_0x543723){for(var _0x130a50=0x0,_0x464f1f=events['length'];_0x130a50<_0x464f1f;_0x130a50++){var _0x3faef4=events[_0x130a50];var _0x30e7c1=createListener(_0xd591('0x6')+_0x3faef4,_0x543723);WhatsappAccountEvents['on'](_0x3faef4,_0x30e7c1);}}; \ No newline at end of file +var _0x3822=['remove','update','emit','removeListener','register','whatsappAccount:','./whatsappAccount.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3822,0x1cd));var _0x2382=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x3822[_0x5f1391];return _0x50ebe3;};'use strict';var WhatsappAccountEvents=require(_0x2382('0x0'));var events=['save',_0x2382('0x1'),_0x2382('0x2')];function createListener(_0xd82233,_0x31dcfd){return function(_0x261fff){_0x31dcfd[_0x2382('0x3')](_0xd82233,_0x261fff);};}function removeListener(_0x207b32,_0x58e6ac){return function(){WhatsappAccountEvents[_0x2382('0x4')](_0x207b32,_0x58e6ac);};}exports[_0x2382('0x5')]=function(_0xaab329){for(var _0x3f5bdb=0x0,_0x5a0e9d=events['length'];_0x3f5bdb<_0x5a0e9d;_0x3f5bdb++){var _0xb9bd72=events[_0x3f5bdb];var _0x3db4ef=createListener(_0x2382('0x6')+_0xb9bd72,_0xaab329);WhatsappAccountEvents['on'](_0xb9bd72,_0x3db4ef);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 2da880f..ae8bfc9 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x846b=['isAuthenticated','index','/:id','post','create','put','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0xc23d21,_0x2a5841){var _0x593b70=function(_0x3ef0a3){while(--_0x3ef0a3){_0xc23d21['push'](_0xc23d21['shift']());}};_0x593b70(++_0x2a5841);}(_0x846b,0x1d8));var _0xb846=function(_0x9da1f6,_0x53a7da){_0x9da1f6=_0x9da1f6-0x0;var _0x12e9ee=_0x846b[_0x9da1f6];return _0x12e9ee;};'use strict';var multer=require(_0xb846('0x0'));var util=require('util');var path=require(_0xb846('0x1'));var timeout=require('connect-timeout');var express=require(_0xb846('0x2'));var router=express[_0xb846('0x3')]();var fs_extra=require(_0xb846('0x4'));var auth=require(_0xb846('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb846('0x6'));var controller=require('./whatsappApplication.controller');router[_0xb846('0x7')]('/',auth[_0xb846('0x8')](),controller[_0xb846('0x9')]);router[_0xb846('0x7')](_0xb846('0xa'),auth[_0xb846('0x8')](),controller['show']);router[_0xb846('0xb')]('/',auth[_0xb846('0x8')](),controller[_0xb846('0xc')]);router[_0xb846('0xd')]('/:id',auth[_0xb846('0x8')](),controller['update']);router[_0xb846('0xe')](_0xb846('0xa'),auth[_0xb846('0x8')](),controller['destroy']);module[_0xb846('0xf')]=router; \ No newline at end of file +var _0x7b6b=['../../components/interaction/service','./whatsappApplication.controller','isAuthenticated','get','/:id','show','post','create','put','delete','destroy','multer','util','../../components/auth/service'];(function(_0x260859,_0x3cfcff){var _0x4b77f8=function(_0x2e48f8){while(--_0x2e48f8){_0x260859['push'](_0x260859['shift']());}};_0x4b77f8(++_0x3cfcff);}(_0x7b6b,0x115));var _0xb7b6=function(_0x5c82fb,_0x54b63f){_0x5c82fb=_0x5c82fb-0x0;var _0x32e310=_0x7b6b[_0x5c82fb];return _0x32e310;};'use strict';var multer=require(_0xb7b6('0x0'));var util=require(_0xb7b6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb7b6('0x2'));var interaction=require(_0xb7b6('0x3'));var config=require('../../config/environment');var controller=require(_0xb7b6('0x4'));router['get']('/',auth[_0xb7b6('0x5')](),controller['index']);router[_0xb7b6('0x6')](_0xb7b6('0x7'),auth[_0xb7b6('0x5')](),controller[_0xb7b6('0x8')]);router[_0xb7b6('0x9')]('/',auth[_0xb7b6('0x5')](),controller[_0xb7b6('0xa')]);router[_0xb7b6('0xb')](_0xb7b6('0x7'),auth[_0xb7b6('0x5')](),controller['update']);router[_0xb7b6('0xc')]('/:id',auth[_0xb7b6('0x5')](),controller[_0xb7b6('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 0ef61c0..71a0629 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d46=['STRING','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0xdf94ea,_0x2b13d1){var _0x7a751c=function(_0x3e7aea){while(--_0x3e7aea){_0xdf94ea['push'](_0xdf94ea['shift']());}};_0x7a751c(++_0x2b13d1);}(_0x4d46,0x107));var _0x64d4=function(_0xdec73e,_0x1749a1){_0xdec73e=_0xdec73e-0x0;var _0x23f232=_0x4d46[_0xdec73e];return _0x23f232;};'use strict';var Sequelize=require(_0x64d4('0x0'));module['exports']={'priority':{'type':Sequelize[_0x64d4('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x64d4('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x64d4('0x3')]()},'description':{'type':Sequelize[_0x64d4('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x64d4('0x4')}}; \ No newline at end of file +var _0xbf78=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbf78,0x99));var _0x8bf7=function(_0x57f9f9,_0x5edf46){_0x57f9f9=_0x57f9f9-0x0;var _0x271e0f=_0xbf78[_0x57f9f9];return _0x271e0f;};'use strict';var Sequelize=require('sequelize');module[_0x8bf7('0x0')]={'priority':{'type':Sequelize[_0x8bf7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8bf7('0x2')],'allowNull':![],'defaultValue':_0x8bf7('0x3')},'appdata':{'type':Sequelize[_0x8bf7('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x8bf7('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 2b5cabf..fe3efc4 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcac2=['includeAll','include','findAll','rows','show','params','length','options','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','then','end','error','name','send','map','WhatsappApplication','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','order','sort','where','pick','merge','VIRTUAL','filter'];(function(_0x38199d,_0x4730f1){var _0x5bd08c=function(_0x17d9a5){while(--_0x17d9a5){_0x38199d['push'](_0x38199d['shift']());}};_0x5bd08c(++_0x4730f1);}(_0xcac2,0x1e8));var _0x2cac=function(_0x4aea0d,_0x204799){_0x4aea0d=_0x4aea0d-0x0;var _0x51c8ee=_0xcac2[_0x4aea0d];return _0x51c8ee;};'use strict';var emlformat=require(_0x2cac('0x0'));var rimraf=require(_0x2cac('0x1'));var zipdir=require(_0x2cac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2cac('0x3'));var moment=require(_0x2cac('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2cac('0x5'));var csv=require(_0x2cac('0x6'));var ejs=require(_0x2cac('0x7'));var fs=require('fs');var fs_extra=require(_0x2cac('0x8'));var _=require(_0x2cac('0x9'));var squel=require(_0x2cac('0xa'));var crypto=require(_0x2cac('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2cac('0x6'));var querystring=require('querystring');var Papa=require(_0x2cac('0xc'));var Redis=require(_0x2cac('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2cac('0xe'));var hardwareService=require(_0x2cac('0xf'));var logger=require('../../config/logger')(_0x2cac('0x10'));var utils=require('../../config/utils');var config=require(_0x2cac('0x11'));var licenseUtil=require(_0x2cac('0x12'));var db=require(_0x2cac('0x13'))['db'];function respondWithStatusCode(_0x1ccf7b,_0x2b5975){_0x2b5975=_0x2b5975||0xcc;return function(_0x58aad7){if(_0x58aad7){return _0x1ccf7b[_0x2cac('0x14')](_0x2b5975);}return _0x1ccf7b[_0x2cac('0x15')](_0x2b5975)['end']();};}function respondWithResult(_0x440617,_0x302d91){_0x302d91=_0x302d91||0xc8;return function(_0x3c1b1f){if(_0x3c1b1f){return _0x440617['status'](_0x302d91)[_0x2cac('0x16')](_0x3c1b1f);}};}function respondWithFilteredResult(_0x354ab7,_0x3d846b){return function(_0x5e731b){if(_0x5e731b){var _0x46db00=typeof _0x3d846b[_0x2cac('0x17')]===_0x2cac('0x18')&&typeof _0x3d846b['limit']==='undefined';var _0x474b7=_0x5e731b[_0x2cac('0x19')];var _0x1dac01=_0x46db00?0x0:_0x3d846b[_0x2cac('0x17')];var _0x2109af=_0x46db00?_0x5e731b['count']:_0x3d846b[_0x2cac('0x17')]+_0x3d846b[_0x2cac('0x1a')];var _0x397e70;if(_0x2109af>=_0x474b7){_0x2109af=_0x474b7;_0x397e70=0xc8;}else{_0x397e70=0xce;}_0x354ab7[_0x2cac('0x15')](_0x397e70);return _0x354ab7[_0x2cac('0x1b')](_0x2cac('0x1c'),_0x1dac01+'-'+_0x2109af+'/'+_0x474b7)[_0x2cac('0x16')](_0x5e731b);}return null;};}function patchUpdates(_0xd04add){return function(_0x5871af){try{jsonpatch[_0x2cac('0x1d')](_0x5871af,_0xd04add,!![]);}catch(_0x2c082e){return BPromise['reject'](_0x2c082e);}return _0x5871af['save']();};}function saveUpdates(_0x35d99b,_0x53f335){return function(_0xbdb16b){if(_0xbdb16b){return _0xbdb16b[_0x2cac('0x1e')](_0x35d99b)['then'](function(_0x3823e8){return _0x3823e8;});}return null;};}function removeEntity(_0x565f96,_0x43b372){return function(_0x4267cc){if(_0x4267cc){return _0x4267cc[_0x2cac('0x1f')]()[_0x2cac('0x20')](function(){_0x565f96['status'](0xcc)[_0x2cac('0x21')]();});}};}function handleEntityNotFound(_0x1de22c,_0x4652f6){return function(_0xf1b63e){if(!_0xf1b63e){_0x1de22c[_0x2cac('0x14')](0x194);}return _0xf1b63e;};}function handleError(_0x11780c,_0x57979a){_0x57979a=_0x57979a||0x1f4;return function(_0x2c1968){logger[_0x2cac('0x22')](_0x2c1968['stack']);if(_0x2c1968[_0x2cac('0x23')]){delete _0x2c1968['name'];}_0x11780c[_0x2cac('0x15')](_0x57979a)[_0x2cac('0x24')](_0x2c1968);};}exports['index']=function(_0x4898b3,_0x221d72){var _0x3bc6de={},_0x246cef={},_0x4fa50b={'count':0x0,'rows':[]};var _0x1657c5=_[_0x2cac('0x25')](db[_0x2cac('0x26')]['rawAttributes'],function(_0x3584d6){return{'name':_0x3584d6[_0x2cac('0x27')],'type':_0x3584d6[_0x2cac('0x28')][_0x2cac('0x29')]};});_0x246cef[_0x2cac('0x2a')]=_[_0x2cac('0x25')](_0x1657c5,_0x2cac('0x23'));_0x246cef['query']=_[_0x2cac('0x2b')](_0x4898b3[_0x2cac('0x2c')]);_0x246cef[_0x2cac('0x2d')]=_['intersection'](_0x246cef[_0x2cac('0x2a')],_0x246cef[_0x2cac('0x2c')]);_0x3bc6de[_0x2cac('0x2e')]=_[_0x2cac('0x2f')](_0x246cef[_0x2cac('0x2a')],qs[_0x2cac('0x30')](_0x4898b3[_0x2cac('0x2c')][_0x2cac('0x30')]));_0x3bc6de[_0x2cac('0x2e')]=_0x3bc6de['attributes']['length']?_0x3bc6de['attributes']:_0x246cef[_0x2cac('0x2a')];if(!_0x4898b3[_0x2cac('0x2c')]['hasOwnProperty']('nolimit')){_0x3bc6de['limit']=qs['limit'](_0x4898b3['query'][_0x2cac('0x1a')]);_0x3bc6de['offset']=qs[_0x2cac('0x17')](_0x4898b3[_0x2cac('0x2c')][_0x2cac('0x17')]);}_0x3bc6de[_0x2cac('0x31')]=qs[_0x2cac('0x32')](_0x4898b3[_0x2cac('0x2c')][_0x2cac('0x32')]);_0x3bc6de[_0x2cac('0x33')]=qs[_0x2cac('0x2d')](_[_0x2cac('0x34')](_0x4898b3['query'],_0x246cef[_0x2cac('0x2d')]),_0x1657c5);if(_0x4898b3[_0x2cac('0x2c')]['filter']){_0x3bc6de['where']=_[_0x2cac('0x35')](_0x3bc6de[_0x2cac('0x33')],{'$or':_[_0x2cac('0x25')](_0x1657c5,function(_0xbb39f0){if(_0xbb39f0[_0x2cac('0x28')]!==_0x2cac('0x36')){var _0xf67ef0={};_0xf67ef0[_0xbb39f0[_0x2cac('0x23')]]={'$like':'%'+_0x4898b3[_0x2cac('0x2c')][_0x2cac('0x37')]+'%'};return _0xf67ef0;}})});}_0x3bc6de=_['merge']({},_0x3bc6de,_0x4898b3['options']);var _0x2124e1={'where':_0x3bc6de[_0x2cac('0x33')]};return db[_0x2cac('0x26')][_0x2cac('0x19')](_0x2124e1)[_0x2cac('0x20')](function(_0x1645ed){_0x4fa50b[_0x2cac('0x19')]=_0x1645ed;if(_0x4898b3[_0x2cac('0x2c')][_0x2cac('0x38')]){_0x3bc6de[_0x2cac('0x39')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x2cac('0x3a')](_0x3bc6de);})[_0x2cac('0x20')](function(_0x25c9f9){_0x4fa50b[_0x2cac('0x3b')]=_0x25c9f9;return _0x4fa50b;})[_0x2cac('0x20')](respondWithFilteredResult(_0x221d72,_0x3bc6de))['catch'](handleError(_0x221d72,null));};exports[_0x2cac('0x3c')]=function(_0x274814,_0x4c5692){var _0x189367={'raw':!![],'where':{'id':_0x274814[_0x2cac('0x3d')]['id']}},_0x23cdec={};_0x23cdec[_0x2cac('0x2a')]=_[_0x2cac('0x2b')](db[_0x2cac('0x26')]['rawAttributes']);_0x23cdec[_0x2cac('0x2c')]=_[_0x2cac('0x2b')](_0x274814['query']);_0x23cdec[_0x2cac('0x2d')]=_[_0x2cac('0x2f')](_0x23cdec[_0x2cac('0x2a')],_0x23cdec['query']);_0x189367[_0x2cac('0x2e')]=_['intersection'](_0x23cdec['model'],qs['fields'](_0x274814[_0x2cac('0x2c')][_0x2cac('0x30')]));_0x189367['attributes']=_0x189367['attributes'][_0x2cac('0x3e')]?_0x189367[_0x2cac('0x2e')]:_0x23cdec[_0x2cac('0x2a')];if(_0x274814[_0x2cac('0x2c')][_0x2cac('0x38')]){_0x189367['include']=[{'all':!![]}];}_0x189367=_[_0x2cac('0x35')]({},_0x189367,_0x274814[_0x2cac('0x3f')]);return db[_0x2cac('0x26')][_0x2cac('0x40')](_0x189367)['then'](handleEntityNotFound(_0x4c5692,null))[_0x2cac('0x20')](respondWithResult(_0x4c5692,null))[_0x2cac('0x41')](handleError(_0x4c5692,null));};exports[_0x2cac('0x42')]=function(_0x174ab8,_0x26c5be){return db['WhatsappApplication'][_0x2cac('0x42')](_0x174ab8['body'],{})[_0x2cac('0x20')](respondWithResult(_0x26c5be,0xc9))[_0x2cac('0x41')](handleError(_0x26c5be,null));};exports[_0x2cac('0x1e')]=function(_0x108483,_0xd7ad89){if(_0x108483[_0x2cac('0x43')]['id']){delete _0x108483[_0x2cac('0x43')]['id'];}return db[_0x2cac('0x26')][_0x2cac('0x40')]({'where':{'id':_0x108483[_0x2cac('0x3d')]['id']}})[_0x2cac('0x20')](handleEntityNotFound(_0xd7ad89,null))[_0x2cac('0x20')](saveUpdates(_0x108483[_0x2cac('0x43')],null))[_0x2cac('0x20')](respondWithResult(_0xd7ad89,null))[_0x2cac('0x41')](handleError(_0xd7ad89,null));};exports[_0x2cac('0x1f')]=function(_0x28f724,_0x1f9653){return db[_0x2cac('0x26')]['find']({'where':{'id':_0x28f724[_0x2cac('0x3d')]['id']}})[_0x2cac('0x20')](handleEntityNotFound(_0x1f9653,null))[_0x2cac('0x20')](removeEntity(_0x1f9653,null))['catch'](handleError(_0x1f9653,null));}; \ No newline at end of file +var _0xa329=['merge','options','then','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','WhatsappApplication','type','key','model','keys','query','filters','intersection','fields','attributes','sort','where','pick','VIRTUAL','filter'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa329,0x162));var _0x9a32=function(_0x561915,_0x241e58){_0x561915=_0x561915-0x0;var _0xb86f7=_0xa329[_0x561915];return _0xb86f7;};'use strict';var emlformat=require(_0x9a32('0x0'));var rimraf=require(_0x9a32('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a32('0x2'));var rp=require('request-promise');var moment=require(_0x9a32('0x3'));var BPromise=require(_0x9a32('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9a32('0x5'));var sox=require(_0x9a32('0x6'));var csv=require(_0x9a32('0x7'));var ejs=require(_0x9a32('0x8'));var fs=require('fs');var fs_extra=require(_0x9a32('0x9'));var _=require(_0x9a32('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9a32('0xb'));var toCsv=require(_0x9a32('0x7'));var querystring=require('querystring');var Papa=require(_0x9a32('0xc'));var Redis=require(_0x9a32('0xd'));var authService=require(_0x9a32('0xe'));var qs=require(_0x9a32('0xf'));var as=require(_0x9a32('0x10'));var hardwareService=require(_0x9a32('0x11'));var logger=require('../../config/logger')(_0x9a32('0x12'));var utils=require(_0x9a32('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9a32('0x14'))['db'];function respondWithStatusCode(_0x3eb0f1,_0x58184a){_0x58184a=_0x58184a||0xcc;return function(_0x48ae67){if(_0x48ae67){return _0x3eb0f1[_0x9a32('0x15')](_0x58184a);}return _0x3eb0f1[_0x9a32('0x16')](_0x58184a)[_0x9a32('0x17')]();};}function respondWithResult(_0x897c93,_0x52512b){_0x52512b=_0x52512b||0xc8;return function(_0x224747){if(_0x224747){return _0x897c93[_0x9a32('0x16')](_0x52512b)['json'](_0x224747);}};}function respondWithFilteredResult(_0x1f8314,_0x96a800){return function(_0x301fab){if(_0x301fab){var _0x448fd6=typeof _0x96a800[_0x9a32('0x18')]===_0x9a32('0x19')&&typeof _0x96a800['limit']===_0x9a32('0x19');var _0x31bd3e=_0x301fab[_0x9a32('0x1a')];var _0x4cfd70=_0x448fd6?0x0:_0x96a800[_0x9a32('0x18')];var _0x1448da=_0x448fd6?_0x301fab['count']:_0x96a800['offset']+_0x96a800[_0x9a32('0x1b')];var _0x56df79;if(_0x1448da>=_0x31bd3e){_0x1448da=_0x31bd3e;_0x56df79=0xc8;}else{_0x56df79=0xce;}_0x1f8314[_0x9a32('0x16')](_0x56df79);return _0x1f8314[_0x9a32('0x1c')](_0x9a32('0x1d'),_0x4cfd70+'-'+_0x1448da+'/'+_0x31bd3e)['json'](_0x301fab);}return null;};}function patchUpdates(_0x23abc6){return function(_0xd3f35f){try{jsonpatch[_0x9a32('0x1e')](_0xd3f35f,_0x23abc6,!![]);}catch(_0x4ca971){return BPromise[_0x9a32('0x1f')](_0x4ca971);}return _0xd3f35f[_0x9a32('0x20')]();};}function saveUpdates(_0x172cf0,_0x781c9){return function(_0x3b3e66){if(_0x3b3e66){return _0x3b3e66[_0x9a32('0x21')](_0x172cf0)['then'](function(_0x4e6e68){return _0x4e6e68;});}return null;};}function removeEntity(_0x44b3b4,_0x2cb1ff){return function(_0x109144){if(_0x109144){return _0x109144['destroy']()['then'](function(){_0x44b3b4[_0x9a32('0x16')](0xcc)[_0x9a32('0x17')]();});}};}function handleEntityNotFound(_0x301dac,_0x51889a){return function(_0x49531d){if(!_0x49531d){_0x301dac['sendStatus'](0x194);}return _0x49531d;};}function handleError(_0x3515bc,_0x5ae8b1){_0x5ae8b1=_0x5ae8b1||0x1f4;return function(_0x527159){logger['error'](_0x527159[_0x9a32('0x22')]);if(_0x527159[_0x9a32('0x23')]){delete _0x527159[_0x9a32('0x23')];}_0x3515bc[_0x9a32('0x16')](_0x5ae8b1)[_0x9a32('0x24')](_0x527159);};}exports[_0x9a32('0x25')]=function(_0x13787b,_0x15b394){var _0x41f755={},_0x35c1be={},_0x1a9353={'count':0x0,'rows':[]};var _0x50a7a9=_[_0x9a32('0x26')](db[_0x9a32('0x27')]['rawAttributes'],function(_0x3e9e85){return{'name':_0x3e9e85['fieldName'],'type':_0x3e9e85[_0x9a32('0x28')][_0x9a32('0x29')]};});_0x35c1be[_0x9a32('0x2a')]=_[_0x9a32('0x26')](_0x50a7a9,_0x9a32('0x23'));_0x35c1be['query']=_[_0x9a32('0x2b')](_0x13787b[_0x9a32('0x2c')]);_0x35c1be[_0x9a32('0x2d')]=_[_0x9a32('0x2e')](_0x35c1be[_0x9a32('0x2a')],_0x35c1be[_0x9a32('0x2c')]);_0x41f755['attributes']=_[_0x9a32('0x2e')](_0x35c1be[_0x9a32('0x2a')],qs[_0x9a32('0x2f')](_0x13787b[_0x9a32('0x2c')][_0x9a32('0x2f')]));_0x41f755['attributes']=_0x41f755[_0x9a32('0x30')]['length']?_0x41f755[_0x9a32('0x30')]:_0x35c1be['model'];if(!_0x13787b['query']['hasOwnProperty']('nolimit')){_0x41f755[_0x9a32('0x1b')]=qs[_0x9a32('0x1b')](_0x13787b['query'][_0x9a32('0x1b')]);_0x41f755[_0x9a32('0x18')]=qs[_0x9a32('0x18')](_0x13787b[_0x9a32('0x2c')][_0x9a32('0x18')]);}_0x41f755['order']=qs[_0x9a32('0x31')](_0x13787b[_0x9a32('0x2c')][_0x9a32('0x31')]);_0x41f755[_0x9a32('0x32')]=qs[_0x9a32('0x2d')](_[_0x9a32('0x33')](_0x13787b[_0x9a32('0x2c')],_0x35c1be[_0x9a32('0x2d')]),_0x50a7a9);if(_0x13787b[_0x9a32('0x2c')]['filter']){_0x41f755[_0x9a32('0x32')]=_['merge'](_0x41f755[_0x9a32('0x32')],{'$or':_[_0x9a32('0x26')](_0x50a7a9,function(_0x680a07){if(_0x680a07[_0x9a32('0x28')]!==_0x9a32('0x34')){var _0xa5fd1e={};_0xa5fd1e[_0x680a07[_0x9a32('0x23')]]={'$like':'%'+_0x13787b[_0x9a32('0x2c')][_0x9a32('0x35')]+'%'};return _0xa5fd1e;}})});}_0x41f755=_[_0x9a32('0x36')]({},_0x41f755,_0x13787b[_0x9a32('0x37')]);var _0x3122cb={'where':_0x41f755['where']};return db[_0x9a32('0x27')]['count'](_0x3122cb)[_0x9a32('0x38')](function(_0x328d3d){_0x1a9353['count']=_0x328d3d;if(_0x13787b['query']['includeAll']){_0x41f755[_0x9a32('0x39')]=[{'all':!![]}];}return db[_0x9a32('0x27')]['findAll'](_0x41f755);})[_0x9a32('0x38')](function(_0x551215){_0x1a9353[_0x9a32('0x3a')]=_0x551215;return _0x1a9353;})[_0x9a32('0x38')](respondWithFilteredResult(_0x15b394,_0x41f755))[_0x9a32('0x3b')](handleError(_0x15b394,null));};exports[_0x9a32('0x3c')]=function(_0x24e598,_0x1f4324){var _0x48c559={'raw':!![],'where':{'id':_0x24e598[_0x9a32('0x3d')]['id']}},_0x50a03d={};_0x50a03d[_0x9a32('0x2a')]=_[_0x9a32('0x2b')](db['WhatsappApplication'][_0x9a32('0x3e')]);_0x50a03d['query']=_[_0x9a32('0x2b')](_0x24e598[_0x9a32('0x2c')]);_0x50a03d[_0x9a32('0x2d')]=_['intersection'](_0x50a03d[_0x9a32('0x2a')],_0x50a03d[_0x9a32('0x2c')]);_0x48c559[_0x9a32('0x30')]=_[_0x9a32('0x2e')](_0x50a03d[_0x9a32('0x2a')],qs[_0x9a32('0x2f')](_0x24e598[_0x9a32('0x2c')][_0x9a32('0x2f')]));_0x48c559['attributes']=_0x48c559[_0x9a32('0x30')]['length']?_0x48c559[_0x9a32('0x30')]:_0x50a03d[_0x9a32('0x2a')];if(_0x24e598[_0x9a32('0x2c')][_0x9a32('0x3f')]){_0x48c559[_0x9a32('0x39')]=[{'all':!![]}];}_0x48c559=_[_0x9a32('0x36')]({},_0x48c559,_0x24e598[_0x9a32('0x37')]);return db[_0x9a32('0x27')][_0x9a32('0x40')](_0x48c559)[_0x9a32('0x38')](handleEntityNotFound(_0x1f4324,null))[_0x9a32('0x38')](respondWithResult(_0x1f4324,null))['catch'](handleError(_0x1f4324,null));};exports['create']=function(_0x35cd40,_0x4a876f){return db[_0x9a32('0x27')][_0x9a32('0x41')](_0x35cd40[_0x9a32('0x42')],{})[_0x9a32('0x38')](respondWithResult(_0x4a876f,0xc9))['catch'](handleError(_0x4a876f,null));};exports[_0x9a32('0x21')]=function(_0x253ebc,_0x195de1){if(_0x253ebc[_0x9a32('0x42')]['id']){delete _0x253ebc[_0x9a32('0x42')]['id'];}return db[_0x9a32('0x27')][_0x9a32('0x40')]({'where':{'id':_0x253ebc[_0x9a32('0x3d')]['id']}})[_0x9a32('0x38')](handleEntityNotFound(_0x195de1,null))['then'](saveUpdates(_0x253ebc[_0x9a32('0x42')],null))[_0x9a32('0x38')](respondWithResult(_0x195de1,null))[_0x9a32('0x3b')](handleError(_0x195de1,null));};exports[_0x9a32('0x43')]=function(_0x10ce6b,_0x33c13b){return db['WhatsappApplication'][_0x9a32('0x40')]({'where':{'id':_0x10ce6b['params']['id']}})[_0x9a32('0x38')](handleEntityNotFound(_0x33c13b,null))[_0x9a32('0x38')](removeEntity(_0x33c13b,null))[_0x9a32('0x3b')](handleError(_0x33c13b,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 22631bf..bc865bb 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a19=['exports','define','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x9a19,0x114));var _0x99a1=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x9a19[_0x2aecb2];return _0x3ebb80;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x99a1('0xc')});}; \ No newline at end of file +var _0x6dac=['rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x457062,_0x1893df){var _0x4df1a9=function(_0x5b9652){while(--_0x5b9652){_0x457062['push'](_0x457062['shift']());}};_0x4df1a9(++_0x1893df);}(_0x6dac,0x16e));var _0xc6da=function(_0x119d07,_0x55d2bd){_0x119d07=_0x119d07-0x0;var _0x43d428=_0x6dac[_0x119d07];return _0x43d428;};'use strict';var _=require(_0xc6da('0x0'));var util=require(_0xc6da('0x1'));var logger=require(_0xc6da('0x2'))(_0xc6da('0x3'));var moment=require(_0xc6da('0x4'));var BPromise=require(_0xc6da('0x5'));var rp=require(_0xc6da('0x6'));var fs=require('fs');var path=require(_0xc6da('0x7'));var rimraf=require(_0xc6da('0x8'));var config=require(_0xc6da('0x9'));var attributes=require(_0xc6da('0xa'));module[_0xc6da('0xb')]=function(_0x325f49,_0x5caf49){return _0x325f49[_0xc6da('0xc')](_0xc6da('0xd'),attributes,{'tableName':_0xc6da('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc6da('0xf'),'collate':_0xc6da('0x10')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 7f1e9b6..b25dade 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeec6=['then','info','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x2c1e7a,_0x155f86){var _0xcacb4f=function(_0x2b2eb3){while(--_0x2b2eb3){_0x2c1e7a['push'](_0x2c1e7a['shift']());}};_0xcacb4f(++_0x155f86);}(_0xeec6,0x1c2));var _0x6eec=function(_0x5aa1e2,_0x2b5adb){_0x5aa1e2=_0x5aa1e2-0x0;var _0x399098=_0xeec6[_0x5aa1e2];return _0x399098;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48064a,_0x5a5e47,_0x1c810e){return new BPromise(function(_0x3443c2,_0x834c2){return client['request'](_0x48064a,_0x1c810e)[_0x6eec('0xc')](function(_0x3aca38){logger[_0x6eec('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x5a5e47,'request\x20sent');logger['debug'](_0x6eec('0xe'),_0x5a5e47,_0x6eec('0xf'),JSON['stringify'](_0x3aca38));if(_0x3aca38['error']){if(_0x3aca38[_0x6eec('0x10')]['code']===0x1f4){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x834c2(_0x3aca38[_0x6eec('0x10')]['message']);}logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x3443c2(_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);}else{logger[_0x6eec('0xd')](_0x6eec('0x11'),_0x5a5e47,_0x6eec('0xf'));_0x3443c2(_0x3aca38[_0x6eec('0x13')]['message']);}})[_0x6eec('0x14')](function(_0x5f1f33){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x5f1f33);_0x834c2(_0x5f1f33);});});} \ No newline at end of file +var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x449b70,_0x6ce747){var _0x410069=function(_0x87d049){while(--_0x87d049){_0x449b70['push'](_0x449b70['shift']());}};_0x410069(++_0x6ce747);}(_0x6aa7,0x178));var _0x76aa=function(_0x4a3b54,_0x47b32e){_0x4a3b54=_0x4a3b54-0x0;var _0x2581af=_0x6aa7[_0x4a3b54];return _0x2581af;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 3f4a349..40fbf09 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b8e=['whatsappinteraction:destroy','removeTags','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','put','/:id','whatsapp','whatsappinteraction:update','update','delete'];(function(_0x46dd7b,_0x468c09){var _0x167885=function(_0x4bedc8){while(--_0x4bedc8){_0x46dd7b['push'](_0x46dd7b['shift']());}};_0x167885(++_0x468c09);}(_0x8b8e,0x108));var _0xe8b8=function(_0x233f46,_0x114f63){_0x233f46=_0x233f46-0x0;var _0xa6f235=_0x8b8e[_0x233f46];return _0xa6f235;};'use strict';var multer=require(_0xe8b8('0x0'));var util=require('util');var path=require(_0xe8b8('0x1'));var timeout=require('connect-timeout');var express=require(_0xe8b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe8b8('0x3'));var interaction=require(_0xe8b8('0x4'));var config=require(_0xe8b8('0x5'));var controller=require(_0xe8b8('0x6'));router[_0xe8b8('0x7')]('/',auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x9')]);router[_0xe8b8('0x7')](_0xe8b8('0xa'),auth[_0xe8b8('0x8')](),controller['describe']);router[_0xe8b8('0x7')]('/:id',auth[_0xe8b8('0x8')](),controller['show']);router['get'](_0xe8b8('0xb'),auth[_0xe8b8('0x8')](),controller['getMessages']);router['get'](_0xe8b8('0xc'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0xd')]);router[_0xe8b8('0xe')]('/',auth[_0xe8b8('0x8')](),controller[_0xe8b8('0xf')]);router[_0xe8b8('0xe')](_0xe8b8('0xb'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x10')]);router[_0xe8b8('0xe')](_0xe8b8('0x11'),auth[_0xe8b8('0x8')](),interaction[_0xe8b8('0x12')]('whatsapp',_0xe8b8('0x13')),controller['addTags']);router[_0xe8b8('0x14')](_0xe8b8('0x15'),auth[_0xe8b8('0x8')](),interaction[_0xe8b8('0x12')](_0xe8b8('0x16'),_0xe8b8('0x17')),controller[_0xe8b8('0x18')]);router[_0xe8b8('0x19')](_0xe8b8('0x15'),auth[_0xe8b8('0x8')](),interaction['tracked'](_0xe8b8('0x16'),_0xe8b8('0x1a')),controller['destroy']);router[_0xe8b8('0x19')](_0xe8b8('0x11'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x1b')]);module[_0xe8b8('0x1c')]=router; \ No newline at end of file +var _0x1b65=['removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','isAuthenticated','/:id','show','getMessages','/:id/download','/:id/messages','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update','delete','whatsappinteraction:destroy'];(function(_0x43f99d,_0xacc489){var _0x52a2e5=function(_0x54cb3f){while(--_0x54cb3f){_0x43f99d['push'](_0x43f99d['shift']());}};_0x52a2e5(++_0xacc489);}(_0x1b65,0x1b4));var _0x51b6=function(_0x31dbd9,_0x452f48){_0x31dbd9=_0x31dbd9-0x0;var _0x23a849=_0x1b65[_0x31dbd9];return _0x23a849;};'use strict';var multer=require(_0x51b6('0x0'));var util=require(_0x51b6('0x1'));var path=require(_0x51b6('0x2'));var timeout=require(_0x51b6('0x3'));var express=require('express');var router=express[_0x51b6('0x4')]();var fs_extra=require(_0x51b6('0x5'));var auth=require(_0x51b6('0x6'));var interaction=require(_0x51b6('0x7'));var config=require(_0x51b6('0x8'));var controller=require(_0x51b6('0x9'));router[_0x51b6('0xa')]('/',auth['isAuthenticated'](),controller[_0x51b6('0xb')]);router[_0x51b6('0xa')](_0x51b6('0xc'),auth[_0x51b6('0xd')](),controller['describe']);router[_0x51b6('0xa')](_0x51b6('0xe'),auth['isAuthenticated'](),controller[_0x51b6('0xf')]);router['get']('/:id/messages',auth[_0x51b6('0xd')](),controller[_0x51b6('0x10')]);router[_0x51b6('0xa')](_0x51b6('0x11'),auth[_0x51b6('0xd')](),controller['download']);router['post']('/',auth[_0x51b6('0xd')](),controller['create']);router['post'](_0x51b6('0x12'),auth['isAuthenticated'](),controller[_0x51b6('0x13')]);router['post'](_0x51b6('0x14'),auth[_0x51b6('0xd')](),interaction[_0x51b6('0x15')](_0x51b6('0x16'),_0x51b6('0x17')),controller[_0x51b6('0x18')]);router['put'](_0x51b6('0xe'),auth[_0x51b6('0xd')](),interaction[_0x51b6('0x15')]('whatsapp',_0x51b6('0x19')),controller['update']);router[_0x51b6('0x1a')](_0x51b6('0xe'),auth[_0x51b6('0xd')](),interaction[_0x51b6('0x15')](_0x51b6('0x16'),_0x51b6('0x1b')),controller['destroy']);router[_0x51b6('0x1a')]('/:id/tags',auth[_0x51b6('0xd')](),controller[_0x51b6('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 1508199..94d177d 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x751c=['INTEGER','sequelize','moment','exports','DATE','STRING','ENUM','out'];(function(_0x11f237,_0x5344de){var _0x38566a=function(_0x3ca560){while(--_0x3ca560){_0x11f237['push'](_0x11f237['shift']());}};_0x38566a(++_0x5344de);}(_0x751c,0x69));var _0xc751=function(_0x5377f4,_0x11e70e){_0x5377f4=_0x5377f4-0x0;var _0x344f1c=_0x751c[_0x5377f4];return _0x344f1c;};'use strict';var Sequelize=require(_0xc751('0x0'));var moment=require(_0xc751('0x1'));module[_0xc751('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc751('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc751('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc751('0x4')]},'phone':{'type':Sequelize[_0xc751('0x4')]},'read1stAt':{'type':Sequelize[_0xc751('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xc751('0x5')]('in',_0xc751('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc751('0x5')]('in',_0xc751('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xc751('0x7')]}}; \ No newline at end of file +var _0xb94c=['BOOLEAN','DATE','STRING','ENUM','out','INTEGER','sequelize','moment'];(function(_0x48d1d4,_0xd24262){var _0x50521d=function(_0x232926){while(--_0x232926){_0x48d1d4['push'](_0x48d1d4['shift']());}};_0x50521d(++_0xd24262);}(_0xb94c,0x176));var _0xcb94=function(_0x3b7afb,_0x4c65de){_0x3b7afb=_0x3b7afb-0x0;var _0x5e8043=_0xb94c[_0x3b7afb];return _0x5e8043;};'use strict';var Sequelize=require(_0xcb94('0x0'));var moment=require(_0xcb94('0x1'));module['exports']={'closed':{'type':Sequelize[_0xcb94('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcb94('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xcb94('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xcb94('0x4')]},'phone':{'type':Sequelize[_0xcb94('0x4')]},'read1stAt':{'type':Sequelize[_0xcb94('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xcb94('0x5')]('in',_0xcb94('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xcb94('0x5')]('in',_0xcb94('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xcb94('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xcb94('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 58f1462..1e5ae8f 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf442=['model','attributes','fields','length','include','merge','find','create','body','destroy','describe','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','hasOwnProperty','sort','pick','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','rows','addTags','setTags','Tag','emit','whatsappInteractionTags:save','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','WhatsappAccount','Account','fullname','get','mkdirSync','Owner','closed','disposition','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','value','renderFile','downloadInteraction.ejs','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','error','stack','name','send','map','type','key','findAll','query','user','catch','show','params','keys','WhatsappInteraction','rawAttributes','filters','intersection'];(function(_0x8706bb,_0x5b5fb4){var _0x5132f5=function(_0x5ebfba){while(--_0x5ebfba){_0x8706bb['push'](_0x8706bb['shift']());}};_0x5132f5(++_0x5b5fb4);}(_0xf442,0xd0));var _0x2f44=function(_0x1a0d69,_0x14c729){_0x1a0d69=_0x1a0d69-0x0;var _0x1214e2=_0xf442[_0x1a0d69];return _0x1214e2;};'use strict';var rimraf=require(_0x2f44('0x0'));var zipdir=require(_0x2f44('0x1'));var moment=require(_0x2f44('0x2'));var BPromise=require(_0x2f44('0x3'));var util=require(_0x2f44('0x4'));var path=require(_0x2f44('0x5'));var ejs=require(_0x2f44('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x2f44('0x7'));var interaction=require(_0x2f44('0x8'));var qs=require(_0x2f44('0x9'));var pdf=require(_0x2f44('0xa'));var logger=require(_0x2f44('0xb'))(_0x2f44('0xc'));var config=require(_0x2f44('0xd'));var db=require(_0x2f44('0xe'))['db'];config['redis']=_[_0x2f44('0xf')](config['redis'],{'host':_0x2f44('0x10'),'port':0x18eb});var socket=require(_0x2f44('0x11'))(new Redis(config[_0x2f44('0x12')]));require(_0x2f44('0x13'))[_0x2f44('0x14')](socket);function respondWithStatusCode(_0xbdcc1,_0x2b67f6){_0x2b67f6=_0x2b67f6||0xcc;return function(_0x3054a6){if(_0x3054a6){return _0xbdcc1[_0x2f44('0x15')](_0x2b67f6);}return _0xbdcc1[_0x2f44('0x16')](_0x2b67f6)[_0x2f44('0x17')]();};}function respondWithResult(_0x485d0f,_0x460ad0){_0x460ad0=_0x460ad0||0xc8;return function(_0x26d138){if(_0x26d138){return _0x485d0f[_0x2f44('0x16')](_0x460ad0)[_0x2f44('0x18')](_0x26d138);}};}function respondWithFilteredResult(_0x1677bf,_0x317da0){return function(_0x44386e){if(_0x44386e){var _0x27c1c0=typeof _0x317da0[_0x2f44('0x19')]===_0x2f44('0x1a')&&typeof _0x317da0[_0x2f44('0x1b')]===_0x2f44('0x1a');var _0x47771e=_0x44386e['count'];var _0x362855=_0x27c1c0?0x0:_0x317da0['offset'];var _0x56ea58=_0x27c1c0?_0x44386e[_0x2f44('0x1c')]:_0x317da0['offset']+_0x317da0[_0x2f44('0x1b')];var _0x2c7912;if(_0x56ea58>=_0x47771e){_0x56ea58=_0x47771e;_0x2c7912=0xc8;}else{_0x2c7912=0xce;}_0x1677bf['status'](_0x2c7912);return _0x1677bf['set'](_0x2f44('0x1d'),_0x362855+'-'+_0x56ea58+'/'+_0x47771e)[_0x2f44('0x18')](_0x44386e);}return null;};}function saveUpdates(_0x4a28da){return function(_0x19d512){if(_0x19d512){return _0x19d512[_0x2f44('0x1e')](_0x4a28da)[_0x2f44('0x1f')](function(_0x5ab2ed){return _0x5ab2ed;});}return null;};}function removeEntity(_0x2778df){return function(_0x3d3e06){if(_0x3d3e06){return _0x3d3e06['destroy']()[_0x2f44('0x1f')](function(){_0x2778df[_0x2f44('0x16')](0xcc)[_0x2f44('0x17')]();});}};}function handleEntityNotFound(_0xd860c2){return function(_0x28a7e8){if(!_0x28a7e8){_0xd860c2[_0x2f44('0x15')](0x194);}return _0x28a7e8;};}function handleError(_0x426f93,_0x469eb0){_0x469eb0=_0x469eb0||0x1f4;return function(_0xa18f86){logger[_0x2f44('0x20')](_0xa18f86[_0x2f44('0x21')]);if(_0xa18f86[_0x2f44('0x22')]){delete _0xa18f86[_0x2f44('0x22')];}_0x426f93['status'](_0x469eb0)[_0x2f44('0x23')](_0xa18f86);};}exports['index']=function(_0x28bdf7,_0x50c704){var _0x55718e={};var _0x25a0af=_[_0x2f44('0x24')](db['WhatsappInteraction']['rawAttributes'],function(_0x8430ce){return{'name':_0x8430ce['fieldName'],'type':_0x8430ce[_0x2f44('0x25')][_0x2f44('0x26')]};});_0x55718e=qs['getOptions'](_0x25a0af,_0x28bdf7);return interaction[_0x2f44('0x27')]('whatsapp',_0x28bdf7[_0x2f44('0x28')],_0x28bdf7[_0x2f44('0x29')],_0x55718e,_0x25a0af)['then'](respondWithFilteredResult(_0x50c704,_0x55718e))[_0x2f44('0x2a')](handleError(_0x50c704,null));};exports[_0x2f44('0x2b')]=function(_0x34e6a8,_0x4a0733){var _0x9eb63c={'raw':![],'where':{'id':_0x34e6a8[_0x2f44('0x2c')]['id']}},_0x9179f8={};_0x9179f8['model']=_[_0x2f44('0x2d')](db[_0x2f44('0x2e')][_0x2f44('0x2f')]);_0x9179f8[_0x2f44('0x28')]=_[_0x2f44('0x2d')](_0x34e6a8[_0x2f44('0x28')]);_0x9179f8[_0x2f44('0x30')]=_[_0x2f44('0x31')](_0x9179f8[_0x2f44('0x32')],_0x9179f8[_0x2f44('0x28')]);_0x9eb63c[_0x2f44('0x33')]=_['intersection'](_0x9179f8['model'],qs[_0x2f44('0x34')](_0x34e6a8[_0x2f44('0x28')][_0x2f44('0x34')]));_0x9eb63c[_0x2f44('0x33')]=_0x9eb63c[_0x2f44('0x33')][_0x2f44('0x35')]?_0x9eb63c[_0x2f44('0x33')]:_0x9179f8[_0x2f44('0x32')];if(_0x34e6a8[_0x2f44('0x28')]['includeAll']){_0x9eb63c[_0x2f44('0x36')]=[{'all':!![]}];}_0x9eb63c=_[_0x2f44('0x37')]({},_0x9eb63c,_0x34e6a8['options']);return db['WhatsappInteraction'][_0x2f44('0x38')](_0x9eb63c)[_0x2f44('0x1f')](handleEntityNotFound(_0x4a0733,null))[_0x2f44('0x1f')](respondWithResult(_0x4a0733,null))['catch'](handleError(_0x4a0733,null));};exports[_0x2f44('0x39')]=function(_0x4fbed4,_0x24d574){return db[_0x2f44('0x2e')][_0x2f44('0x39')](_0x4fbed4[_0x2f44('0x3a')],{})['then'](respondWithResult(_0x24d574,0xc9))[_0x2f44('0x2a')](handleError(_0x24d574,null));};exports[_0x2f44('0x1e')]=function(_0x1bf518,_0x688bf){if(_0x1bf518[_0x2f44('0x3a')]['id']){delete _0x1bf518['body']['id'];}return db[_0x2f44('0x2e')]['find']({'where':{'id':_0x1bf518[_0x2f44('0x2c')]['id']}})[_0x2f44('0x1f')](handleEntityNotFound(_0x688bf,null))[_0x2f44('0x1f')](saveUpdates(_0x1bf518['body'],null))[_0x2f44('0x1f')](respondWithResult(_0x688bf,null))[_0x2f44('0x2a')](handleError(_0x688bf,null));};exports[_0x2f44('0x3b')]=function(_0x4e7e7d,_0x4f486e){return db['WhatsappInteraction'][_0x2f44('0x38')]({'where':{'id':_0x4e7e7d['params']['id']}})[_0x2f44('0x1f')](handleEntityNotFound(_0x4f486e,null))[_0x2f44('0x1f')](removeEntity(_0x4f486e,null))[_0x2f44('0x2a')](handleError(_0x4f486e,null));};exports['describe']=function(_0x170591,_0xd292c0){return db[_0x2f44('0x2e')][_0x2f44('0x3c')]()[_0x2f44('0x1f')](respondWithResult(_0xd292c0,null))[_0x2f44('0x2a')](handleError(_0xd292c0,null));};exports[_0x2f44('0x3d')]=function(_0x5be941,_0xab4a14){return db[_0x2f44('0x3e')][_0x2f44('0x38')]({'where':{'id':_0x5be941['params']['id']}})[_0x2f44('0x1f')](handleEntityNotFound(_0xab4a14,null))[_0x2f44('0x1f')](function(_0x6a8315){if(_0x6a8315){return _0x6a8315[_0x2f44('0x3d')](_0x5be941['body']['ids'],_[_0x2f44('0x3f')](_0x5be941['body'],[_0x2f44('0x40'),'id'])||{});}})[_0x2f44('0x1f')](respondWithResult(_0xab4a14,null))[_0x2f44('0x2a')](handleError(_0xab4a14,null));};exports[_0x2f44('0x41')]=function(_0x4610ed,_0x352ef5){var _0x4be6ba={'raw':![],'where':{}};var _0xc8cf74={};var _0x16337e={'count':0x0,'rows':[]};return db[_0x2f44('0x2e')][_0x2f44('0x42')]({'where':{'id':_0x4610ed['params']['id']}})[_0x2f44('0x1f')](handleEntityNotFound(_0x352ef5,null))[_0x2f44('0x1f')](function(_0x1359e3){if(_0x1359e3){_0xc8cf74[_0x2f44('0x32')]=_[_0x2f44('0x2d')](db['WhatsappMessage'][_0x2f44('0x2f')]);_0xc8cf74[_0x2f44('0x28')]=_[_0x2f44('0x2d')](_0x4610ed[_0x2f44('0x28')]);_0xc8cf74[_0x2f44('0x30')]=_[_0x2f44('0x31')](_0xc8cf74[_0x2f44('0x32')],_0xc8cf74[_0x2f44('0x28')]);_0x4be6ba[_0x2f44('0x33')]=_['intersection'](_0xc8cf74[_0x2f44('0x32')],qs[_0x2f44('0x34')](_0x4610ed[_0x2f44('0x28')][_0x2f44('0x34')]));_0x4be6ba[_0x2f44('0x33')]=_0x4be6ba['attributes'][_0x2f44('0x35')]?_0x4be6ba[_0x2f44('0x33')]:_0xc8cf74[_0x2f44('0x32')];if(!_0x4610ed[_0x2f44('0x28')][_0x2f44('0x43')]('nolimit')){_0x4be6ba[_0x2f44('0x1b')]=qs['limit'](_0x4610ed[_0x2f44('0x28')][_0x2f44('0x1b')]);_0x4be6ba[_0x2f44('0x19')]=qs[_0x2f44('0x19')](_0x4610ed[_0x2f44('0x28')]['offset']);}_0x4be6ba['order']=qs[_0x2f44('0x44')](_0x4610ed[_0x2f44('0x28')][_0x2f44('0x44')]);_0x4be6ba['where']=qs[_0x2f44('0x30')](_[_0x2f44('0x45')](_0x4610ed[_0x2f44('0x28')],_0xc8cf74['filters']));_0x4be6ba[_0x2f44('0x46')]['WhatsappInteractionId']=_0x1359e3['id'];if(_0x4610ed[_0x2f44('0x28')][_0x2f44('0x47')]){_0x4be6ba[_0x2f44('0x46')]=_[_0x2f44('0x37')](_0x4be6ba[_0x2f44('0x46')],{'$or':_['map'](_0x4be6ba['attributes'],function(_0x410d6d){var _0x333870={};_0x333870[_0x410d6d]={'$like':'%'+_0x4610ed[_0x2f44('0x28')][_0x2f44('0x47')]+'%'};return _0x333870;})});}if(_0x4610ed[_0x2f44('0x28')][_0x2f44('0x48')]){var _0x1d9443=_0x4610ed[_0x2f44('0x28')][_0x2f44('0x48')][_0x2f44('0x49')](',');var _0x40bc76={};_0x40bc76[_0x1d9443[0x0]]={'$gte':moment(_0x1d9443[0x1])[_0x2f44('0x4a')](_0x2f44('0x4b'))};_0x4be6ba['where']=_[_0x2f44('0x37')](_0x4be6ba[_0x2f44('0x46')],_0x40bc76);}_0x4be6ba=_[_0x2f44('0x37')]({},_0x4be6ba,_0x4610ed[_0x2f44('0x4c')]);return db[_0x2f44('0x3e')]['count']({'where':_0x4be6ba['where']})['then'](function(_0x5e5433){_0x16337e[_0x2f44('0x1c')]=_0x5e5433;if(_0x4610ed[_0x2f44('0x28')][_0x2f44('0x4d')]){_0x4be6ba[_0x2f44('0x36')]=[{'all':!![]}];}return db[_0x2f44('0x3e')][_0x2f44('0x27')](_0x4be6ba);})[_0x2f44('0x1f')](function(_0xbc7598){_0x16337e[_0x2f44('0x4e')]=_0xbc7598;return _0x16337e;});}})[_0x2f44('0x1f')](respondWithFilteredResult(_0x352ef5,_0x4be6ba))[_0x2f44('0x2a')](handleError(_0x352ef5,null));};exports[_0x2f44('0x4f')]=function(_0x241e7f,_0x4a5d08){return db[_0x2f44('0x2e')][_0x2f44('0x38')]({'where':{'id':_0x241e7f[_0x2f44('0x2c')]['id']}})[_0x2f44('0x1f')](handleEntityNotFound(_0x4a5d08,null))[_0x2f44('0x1f')](function(_0x2c8e1a){if(_0x2c8e1a){return _0x2c8e1a[_0x2f44('0x50')](_0x241e7f[_0x2f44('0x3a')][_0x2f44('0x40')],_[_0x2f44('0x3f')](_0x241e7f['body'],[_0x2f44('0x40'),'id'])||{})['spread'](function(){return db[_0x2f44('0x51')][_0x2f44('0x27')]({'attributes':['id',_0x2f44('0x22'),'color'],'where':{'id':_0x241e7f['body']['ids']}});})[_0x2f44('0x1f')](function(_0x133c20){socket[_0x2f44('0x52')](_0x2f44('0x53'),{'id':Number(_0x241e7f[_0x2f44('0x2c')]['id']),'tags':_0x133c20||[]});return{'id':Number(_0x241e7f[_0x2f44('0x2c')]['id']),'tags':_0x133c20||[]};});}})[_0x2f44('0x1f')](respondWithResult(_0x4a5d08,null))[_0x2f44('0x2a')](handleError(_0x4a5d08,null));};exports['removeTags']=function(_0x38c76d,_0x327f33){return db[_0x2f44('0x2e')][_0x2f44('0x38')]({'where':{'id':_0x38c76d['params']['id']}})[_0x2f44('0x1f')](handleEntityNotFound(_0x327f33,null))['then'](function(_0x9065dd){if(_0x9065dd){return _0x9065dd['removeTags'](_0x38c76d['query']['ids']);}})['then'](respondWithStatusCode(_0x327f33,null))['catch'](handleError(_0x327f33,null));};exports[_0x2f44('0x54')]=function(_0x3a621b,_0x1eaf45){var _0x4b755a=moment()[_0x2f44('0x55')]()[_0x2f44('0x56')]();var _0x28635a=path[_0x2f44('0x57')](config[_0x2f44('0x58')],_0x2f44('0x59'),_0x2f44('0x5a'),_0x2f44('0x5b'));var _0x388107=path[_0x2f44('0x57')](config['root'],_0x2f44('0x59'),_0x2f44('0x5a'),_0x2f44('0x5c'));var _0x2d95a6=path[_0x2f44('0x57')](_0x28635a,_0x4b755a);var _0x46774b=util['format'](_0x2f44('0x5d'),_0x3a621b[_0x2f44('0x2c')]['id'],_0x4b755a);var _0x28534c=path['join'](_0x28635a,_0x46774b);var _0x2c5832=[];_0x2c5832[_0x2f44('0x5e')]({'model':db[_0x2f44('0x5f')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x2c5832[_0x2f44('0x5e')]({'model':db['CmContact'],'as':_0x2f44('0x60'),'attributes':['id',_0x2f44('0x61'),_0x2f44('0x62')],'raw':!![]});if(_0x3a621b[_0x2f44('0x28')]['attachments']){_0x2c5832['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x338e0a=[{'model':db[_0x2f44('0x3e')],'as':_0x2f44('0x63'),'attributes':['id',_0x2f44('0x3a'),_0x2f44('0x64'),_0x2f44('0x65'),_0x2f44('0x66'),_0x2f44('0x67')],'include':_0x2c5832}];_0x338e0a[_0x2f44('0x5e')]({'model':db[_0x2f44('0x68')],'as':_0x2f44('0x69'),'attributes':['id',_0x2f44('0x22')]});_0x338e0a[_0x2f44('0x5e')]({'model':db[_0x2f44('0x5f')],'as':'Owner','attributes':['id',_0x2f44('0x6a')]});return db['WhatsappInteraction'][_0x2f44('0x38')]({'where':{'id':_0x3a621b[_0x2f44('0x2c')]['id']},'include':_0x338e0a})['then'](handleEntityNotFound(_0x1eaf45,null))[_0x2f44('0x1f')](function(_0x287c73){if(_0x287c73){var _0x5c9d46=_0x287c73[_0x2f44('0x6b')]({'plain':!![]});fs[_0x2f44('0x6c')](_0x2d95a6);var _0xfcf3fd={'channel':'Whatsapp','account':_0x5c9d46[_0x2f44('0x69')][_0x2f44('0x22')],'agent':_0x5c9d46[_0x2f44('0x6d')]?_0x5c9d46[_0x2f44('0x6d')][_0x2f44('0x6a')]:'N.A.','createdAt':moment(_0x5c9d46[_0x2f44('0x64')])[_0x2f44('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2f44('0x56')](),'closedAt':_0x5c9d46[_0x2f44('0x6e')]?moment(_0x5c9d46['closedAt'])[_0x2f44('0x4a')](_0x2f44('0x4b'))[_0x2f44('0x56')]():'','disposition':_0x5c9d46[_0x2f44('0x6f')],'messages':_(_0x5c9d46[_0x2f44('0x63')])[_0x2f44('0x47')]({'secret':![]})[_0x2f44('0x24')](function(_0x198835){if(_0x198835[_0x2f44('0x70')]){var _0x313097=path[_0x2f44('0x57')](_0x388107,_0x198835[_0x2f44('0x70')][_0x2f44('0x71')]);if(fs[_0x2f44('0x72')](_0x313097)){fs[_0x2f44('0x73')](_0x313097)[_0x2f44('0x74')](fs[_0x2f44('0x75')](path['join'](_0x2d95a6,_0x198835[_0x2f44('0x70')][_0x2f44('0x71')])));}}return{'date':moment(_0x198835[_0x2f44('0x64')])[_0x2f44('0x4a')](_0x2f44('0x4b'))[_0x2f44('0x56')](),'sender':_0x198835[_0x2f44('0x65')]===_0x2f44('0x76')?_0x198835['User']?_0x198835[_0x2f44('0x5f')]['fullname']:_0x2f44('0x77'):_0x198835['Contact'][_0x2f44('0x61')]+(_0x198835[_0x2f44('0x60')]['lastName']?'\x20'+_0x198835[_0x2f44('0x60')]['lastName']:''),'body':_0x198835['Attachment']?_0x198835[_0x2f44('0x70')][_0x2f44('0x71')]:_0x198835[_0x2f44('0x3a')],'direction':_0x198835[_0x2f44('0x65')]==='out'?'A':'C','secret':_0x198835['secret'],'read':_0x198835[_0x2f44('0x67')],'attachment':_0x198835['Attachment']};})[_0x2f44('0x78')]()};return ejs[_0x2f44('0x79')](path['join'](config['root'],'server','views',_0x2f44('0x7a')),{'interaction':_0xfcf3fd})[_0x2f44('0x1f')](function(_0x5aec20){var _0x4c33ff=path['join'](_0x2d95a6,'transcript-'+_0x5c9d46['id']+'-'+_0x4b755a+_0x2f44('0x7b'));var _0x1de7bb={'path':_0x4c33ff,'channel':_0x2f44('0x7c'),'interactionId':_0x5c9d46['id']};return pdf[_0x2f44('0x7d')](_0x5aec20,_0x1de7bb);})[_0x2f44('0x1f')](function(){return new BPromise(function(_0x40b391,_0x593c3b){zipdir(_0x2d95a6,{'saveTo':_0x28534c},function(_0x46baab,_0x422e70){if(_0x46baab)return _0x593c3b(_0x46baab);return _0x40b391(_0x422e70);});})[_0x2f44('0x1f')](function(){return new BPromise(function(_0xa21f6a,_0x2f9585){rimraf(_0x2d95a6,function(_0x45e673){if(_0x45e673)_0x2f9585(_0x45e673);return _0xa21f6a();});});})[_0x2f44('0x1f')](function(){return _0x1eaf45[_0x2f44('0x54')](_0x28534c,_0x46774b,function(_0x1bcb0e){if(_0x1bcb0e){console[_0x2f44('0x7e')](_0x2f44('0x7f'),_0x1bcb0e);}else{fs[_0x2f44('0x80')](_0x28534c);}});});});}else{return _0x1eaf45[_0x2f44('0x15')](0xc8);}})[_0x2f44('0x2a')](handleError(_0x1eaf45,null));}; \ No newline at end of file +var _0x4cbd=['tmp','root','attachments','format','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','out','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','key','findAll','whatsapp','query','user','show','params','model','keys','filters','attributes','intersection','fields','length','includeAll','include','options','catch','create','body','find','describe','addMessage','WhatsappMessage','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','ids','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','server','files'];(function(_0x159b72,_0x183756){var _0x4fa7b7=function(_0x43e36b){while(--_0x43e36b){_0x159b72['push'](_0x159b72['shift']());}};_0x4fa7b7(++_0x183756);}(_0x4cbd,0xa9));var _0xd4cb=function(_0x45ef14,_0x834d23){_0x45ef14=_0x45ef14-0x0;var _0x161624=_0x4cbd[_0x45ef14];return _0x161624;};'use strict';var rimraf=require(_0xd4cb('0x0'));var zipdir=require(_0xd4cb('0x1'));var moment=require(_0xd4cb('0x2'));var BPromise=require(_0xd4cb('0x3'));var util=require(_0xd4cb('0x4'));var path=require(_0xd4cb('0x5'));var ejs=require(_0xd4cb('0x6'));var fs=require('fs');var _=require(_0xd4cb('0x7'));var Redis=require(_0xd4cb('0x8'));var interaction=require(_0xd4cb('0x9'));var qs=require('../../components/parsers/qs');var pdf=require(_0xd4cb('0xa'));var logger=require(_0xd4cb('0xb'))(_0xd4cb('0xc'));var config=require(_0xd4cb('0xd'));var db=require(_0xd4cb('0xe'))['db'];config[_0xd4cb('0xf')]=_[_0xd4cb('0x10')](config[_0xd4cb('0xf')],{'host':_0xd4cb('0x11'),'port':0x18eb});var socket=require(_0xd4cb('0x12'))(new Redis(config[_0xd4cb('0xf')]));require(_0xd4cb('0x13'))[_0xd4cb('0x14')](socket);function respondWithStatusCode(_0x5cdbf9,_0x49c764){_0x49c764=_0x49c764||0xcc;return function(_0x25237b){if(_0x25237b){return _0x5cdbf9[_0xd4cb('0x15')](_0x49c764);}return _0x5cdbf9['status'](_0x49c764)[_0xd4cb('0x16')]();};}function respondWithResult(_0x5f1909,_0x1cd17b){_0x1cd17b=_0x1cd17b||0xc8;return function(_0x189655){if(_0x189655){return _0x5f1909[_0xd4cb('0x17')](_0x1cd17b)[_0xd4cb('0x18')](_0x189655);}};}function respondWithFilteredResult(_0x34bc16,_0x243821){return function(_0x37ba00){if(_0x37ba00){var _0x2e6d3c=typeof _0x243821[_0xd4cb('0x19')]==='undefined'&&typeof _0x243821['limit']===_0xd4cb('0x1a');var _0x5c68c1=_0x37ba00[_0xd4cb('0x1b')];var _0x142a99=_0x2e6d3c?0x0:_0x243821[_0xd4cb('0x19')];var _0x580233=_0x2e6d3c?_0x37ba00[_0xd4cb('0x1b')]:_0x243821[_0xd4cb('0x19')]+_0x243821[_0xd4cb('0x1c')];var _0x5dcd89;if(_0x580233>=_0x5c68c1){_0x580233=_0x5c68c1;_0x5dcd89=0xc8;}else{_0x5dcd89=0xce;}_0x34bc16['status'](_0x5dcd89);return _0x34bc16[_0xd4cb('0x1d')](_0xd4cb('0x1e'),_0x142a99+'-'+_0x580233+'/'+_0x5c68c1)[_0xd4cb('0x18')](_0x37ba00);}return null;};}function saveUpdates(_0x3c2d65){return function(_0x2eb10d){if(_0x2eb10d){return _0x2eb10d[_0xd4cb('0x1f')](_0x3c2d65)[_0xd4cb('0x20')](function(_0x39f5a4){return _0x39f5a4;});}return null;};}function removeEntity(_0x37de2a){return function(_0x4f123a){if(_0x4f123a){return _0x4f123a[_0xd4cb('0x21')]()[_0xd4cb('0x20')](function(){_0x37de2a[_0xd4cb('0x17')](0xcc)[_0xd4cb('0x16')]();});}};}function handleEntityNotFound(_0x2a1570){return function(_0x15fd65){if(!_0x15fd65){_0x2a1570[_0xd4cb('0x15')](0x194);}return _0x15fd65;};}function handleError(_0x4757bf,_0x116dae){_0x116dae=_0x116dae||0x1f4;return function(_0x4b5395){logger[_0xd4cb('0x22')](_0x4b5395[_0xd4cb('0x23')]);if(_0x4b5395[_0xd4cb('0x24')]){delete _0x4b5395[_0xd4cb('0x24')];}_0x4757bf[_0xd4cb('0x17')](_0x116dae)[_0xd4cb('0x25')](_0x4b5395);};}exports[_0xd4cb('0x26')]=function(_0x381c8f,_0x157e48){var _0x16eb10={};var _0x32234a=_[_0xd4cb('0x27')](db[_0xd4cb('0x28')][_0xd4cb('0x29')],function(_0x49a014){return{'name':_0x49a014[_0xd4cb('0x2a')],'type':_0x49a014['type'][_0xd4cb('0x2b')]};});_0x16eb10=qs['getOptions'](_0x32234a,_0x381c8f);return interaction[_0xd4cb('0x2c')](_0xd4cb('0x2d'),_0x381c8f[_0xd4cb('0x2e')],_0x381c8f[_0xd4cb('0x2f')],_0x16eb10,_0x32234a)[_0xd4cb('0x20')](respondWithFilteredResult(_0x157e48,_0x16eb10))['catch'](handleError(_0x157e48,null));};exports[_0xd4cb('0x30')]=function(_0x2fca1a,_0x332849){var _0x5b42cb={'raw':![],'where':{'id':_0x2fca1a[_0xd4cb('0x31')]['id']}},_0x5415d2={};_0x5415d2[_0xd4cb('0x32')]=_[_0xd4cb('0x33')](db['WhatsappInteraction'][_0xd4cb('0x29')]);_0x5415d2['query']=_[_0xd4cb('0x33')](_0x2fca1a['query']);_0x5415d2[_0xd4cb('0x34')]=_['intersection'](_0x5415d2[_0xd4cb('0x32')],_0x5415d2[_0xd4cb('0x2e')]);_0x5b42cb[_0xd4cb('0x35')]=_[_0xd4cb('0x36')](_0x5415d2['model'],qs[_0xd4cb('0x37')](_0x2fca1a[_0xd4cb('0x2e')][_0xd4cb('0x37')]));_0x5b42cb[_0xd4cb('0x35')]=_0x5b42cb[_0xd4cb('0x35')][_0xd4cb('0x38')]?_0x5b42cb[_0xd4cb('0x35')]:_0x5415d2[_0xd4cb('0x32')];if(_0x2fca1a['query'][_0xd4cb('0x39')]){_0x5b42cb[_0xd4cb('0x3a')]=[{'all':!![]}];}_0x5b42cb=_['merge']({},_0x5b42cb,_0x2fca1a[_0xd4cb('0x3b')]);return db['WhatsappInteraction']['find'](_0x5b42cb)[_0xd4cb('0x20')](handleEntityNotFound(_0x332849,null))[_0xd4cb('0x20')](respondWithResult(_0x332849,null))[_0xd4cb('0x3c')](handleError(_0x332849,null));};exports[_0xd4cb('0x3d')]=function(_0x5310d9,_0x22ccaa){return db[_0xd4cb('0x28')]['create'](_0x5310d9[_0xd4cb('0x3e')],{})[_0xd4cb('0x20')](respondWithResult(_0x22ccaa,0xc9))[_0xd4cb('0x3c')](handleError(_0x22ccaa,null));};exports[_0xd4cb('0x1f')]=function(_0x22e06e,_0x192f98){if(_0x22e06e[_0xd4cb('0x3e')]['id']){delete _0x22e06e['body']['id'];}return db['WhatsappInteraction'][_0xd4cb('0x3f')]({'where':{'id':_0x22e06e[_0xd4cb('0x31')]['id']}})[_0xd4cb('0x20')](handleEntityNotFound(_0x192f98,null))[_0xd4cb('0x20')](saveUpdates(_0x22e06e[_0xd4cb('0x3e')],null))[_0xd4cb('0x20')](respondWithResult(_0x192f98,null))[_0xd4cb('0x3c')](handleError(_0x192f98,null));};exports[_0xd4cb('0x21')]=function(_0x65ad35,_0x12fb86){return db[_0xd4cb('0x28')][_0xd4cb('0x3f')]({'where':{'id':_0x65ad35[_0xd4cb('0x31')]['id']}})[_0xd4cb('0x20')](handleEntityNotFound(_0x12fb86,null))['then'](removeEntity(_0x12fb86,null))[_0xd4cb('0x3c')](handleError(_0x12fb86,null));};exports[_0xd4cb('0x40')]=function(_0x20af6a,_0x13141b){return db[_0xd4cb('0x28')][_0xd4cb('0x40')]()[_0xd4cb('0x20')](respondWithResult(_0x13141b,null))[_0xd4cb('0x3c')](handleError(_0x13141b,null));};exports[_0xd4cb('0x41')]=function(_0x58a106,_0x57e495){return db[_0xd4cb('0x42')][_0xd4cb('0x3f')]({'where':{'id':_0x58a106[_0xd4cb('0x31')]['id']}})['then'](handleEntityNotFound(_0x57e495,null))[_0xd4cb('0x20')](function(_0x2caff5){if(_0x2caff5){return _0x2caff5[_0xd4cb('0x41')](_0x58a106['body']['ids'],_[_0xd4cb('0x43')](_0x58a106[_0xd4cb('0x3e')],['ids','id'])||{});}})[_0xd4cb('0x20')](respondWithResult(_0x57e495,null))[_0xd4cb('0x3c')](handleError(_0x57e495,null));};exports[_0xd4cb('0x44')]=function(_0x3f3dbd,_0x53ca57){var _0x5c654={'raw':![],'where':{}};var _0x4ff1e0={};var _0x3db277={'count':0x0,'rows':[]};return db[_0xd4cb('0x28')][_0xd4cb('0x45')]({'where':{'id':_0x3f3dbd[_0xd4cb('0x31')]['id']}})[_0xd4cb('0x20')](handleEntityNotFound(_0x53ca57,null))['then'](function(_0x3a9212){if(_0x3a9212){_0x4ff1e0[_0xd4cb('0x32')]=_['keys'](db[_0xd4cb('0x42')][_0xd4cb('0x29')]);_0x4ff1e0[_0xd4cb('0x2e')]=_[_0xd4cb('0x33')](_0x3f3dbd[_0xd4cb('0x2e')]);_0x4ff1e0[_0xd4cb('0x34')]=_['intersection'](_0x4ff1e0[_0xd4cb('0x32')],_0x4ff1e0[_0xd4cb('0x2e')]);_0x5c654[_0xd4cb('0x35')]=_['intersection'](_0x4ff1e0[_0xd4cb('0x32')],qs[_0xd4cb('0x37')](_0x3f3dbd[_0xd4cb('0x2e')]['fields']));_0x5c654[_0xd4cb('0x35')]=_0x5c654[_0xd4cb('0x35')][_0xd4cb('0x38')]?_0x5c654[_0xd4cb('0x35')]:_0x4ff1e0[_0xd4cb('0x32')];if(!_0x3f3dbd[_0xd4cb('0x2e')][_0xd4cb('0x46')](_0xd4cb('0x47'))){_0x5c654[_0xd4cb('0x1c')]=qs[_0xd4cb('0x1c')](_0x3f3dbd['query'][_0xd4cb('0x1c')]);_0x5c654[_0xd4cb('0x19')]=qs['offset'](_0x3f3dbd[_0xd4cb('0x2e')][_0xd4cb('0x19')]);}_0x5c654[_0xd4cb('0x48')]=qs[_0xd4cb('0x49')](_0x3f3dbd['query'][_0xd4cb('0x49')]);_0x5c654[_0xd4cb('0x4a')]=qs[_0xd4cb('0x34')](_[_0xd4cb('0x4b')](_0x3f3dbd[_0xd4cb('0x2e')],_0x4ff1e0['filters']));_0x5c654[_0xd4cb('0x4a')][_0xd4cb('0x4c')]=_0x3a9212['id'];if(_0x3f3dbd[_0xd4cb('0x2e')][_0xd4cb('0x4d')]){_0x5c654[_0xd4cb('0x4a')]=_[_0xd4cb('0x4e')](_0x5c654['where'],{'$or':_['map'](_0x5c654[_0xd4cb('0x35')],function(_0x1e198c){var _0x209d47={};_0x209d47[_0x1e198c]={'$like':'%'+_0x3f3dbd['query'][_0xd4cb('0x4d')]+'%'};return _0x209d47;})});}if(_0x3f3dbd[_0xd4cb('0x2e')][_0xd4cb('0x4f')]){var _0x3a421f=_0x3f3dbd[_0xd4cb('0x2e')][_0xd4cb('0x4f')][_0xd4cb('0x50')](',');var _0x4df481={};_0x4df481[_0x3a421f[0x0]]={'$gte':moment(_0x3a421f[0x1])['format'](_0xd4cb('0x51'))};_0x5c654[_0xd4cb('0x4a')]=_[_0xd4cb('0x4e')](_0x5c654[_0xd4cb('0x4a')],_0x4df481);}_0x5c654=_['merge']({},_0x5c654,_0x3f3dbd[_0xd4cb('0x3b')]);return db[_0xd4cb('0x42')][_0xd4cb('0x1b')]({'where':_0x5c654[_0xd4cb('0x4a')]})[_0xd4cb('0x20')](function(_0x4b09ce){_0x3db277[_0xd4cb('0x1b')]=_0x4b09ce;if(_0x3f3dbd[_0xd4cb('0x2e')][_0xd4cb('0x39')]){_0x5c654[_0xd4cb('0x3a')]=[{'all':!![]}];}return db[_0xd4cb('0x42')][_0xd4cb('0x2c')](_0x5c654);})['then'](function(_0x415559){_0x3db277[_0xd4cb('0x52')]=_0x415559;return _0x3db277;});}})[_0xd4cb('0x20')](respondWithFilteredResult(_0x53ca57,_0x5c654))[_0xd4cb('0x3c')](handleError(_0x53ca57,null));};exports[_0xd4cb('0x53')]=function(_0x262f71,_0x36be80){return db[_0xd4cb('0x28')][_0xd4cb('0x3f')]({'where':{'id':_0x262f71[_0xd4cb('0x31')]['id']}})[_0xd4cb('0x20')](handleEntityNotFound(_0x36be80,null))['then'](function(_0x3a0d36){if(_0x3a0d36){return _0x3a0d36['setTags'](_0x262f71[_0xd4cb('0x3e')][_0xd4cb('0x54')],_[_0xd4cb('0x43')](_0x262f71[_0xd4cb('0x3e')],[_0xd4cb('0x54'),'id'])||{})[_0xd4cb('0x55')](function(){return db['Tag'][_0xd4cb('0x2c')]({'attributes':['id',_0xd4cb('0x24'),'color'],'where':{'id':_0x262f71['body'][_0xd4cb('0x54')]}});})[_0xd4cb('0x20')](function(_0x13ce62){socket[_0xd4cb('0x56')](_0xd4cb('0x57'),{'id':Number(_0x262f71['params']['id']),'tags':_0x13ce62||[]});return{'id':Number(_0x262f71[_0xd4cb('0x31')]['id']),'tags':_0x13ce62||[]};});}})['then'](respondWithResult(_0x36be80,null))[_0xd4cb('0x3c')](handleError(_0x36be80,null));};exports['removeTags']=function(_0x12197a,_0x3ef46e){return db['WhatsappInteraction'][_0xd4cb('0x3f')]({'where':{'id':_0x12197a[_0xd4cb('0x31')]['id']}})[_0xd4cb('0x20')](handleEntityNotFound(_0x3ef46e,null))[_0xd4cb('0x20')](function(_0x197163){if(_0x197163){return _0x197163[_0xd4cb('0x58')](_0x12197a['query'][_0xd4cb('0x54')]);}})[_0xd4cb('0x20')](respondWithStatusCode(_0x3ef46e,null))[_0xd4cb('0x3c')](handleError(_0x3ef46e,null));};exports[_0xd4cb('0x59')]=function(_0x11a801,_0x262b66){var _0x26a234=moment()[_0xd4cb('0x5a')]()[_0xd4cb('0x5b')]();var _0x38b14e=path[_0xd4cb('0x5c')](config['root'],_0xd4cb('0x5d'),_0xd4cb('0x5e'),_0xd4cb('0x5f'));var _0x561426=path['join'](config[_0xd4cb('0x60')],_0xd4cb('0x5d'),'files',_0xd4cb('0x61'));var _0x484218=path[_0xd4cb('0x5c')](_0x38b14e,_0x26a234);var _0x29663c=util[_0xd4cb('0x62')](_0xd4cb('0x63'),_0x11a801['params']['id'],_0x26a234);var _0x4ddd41=path['join'](_0x38b14e,_0x29663c);var _0x1deff7=[];_0x1deff7[_0xd4cb('0x64')]({'model':db[_0xd4cb('0x65')],'as':_0xd4cb('0x65'),'attributes':['id',_0xd4cb('0x66')],'raw':!![]});_0x1deff7[_0xd4cb('0x64')]({'model':db['CmContact'],'as':_0xd4cb('0x67'),'attributes':['id',_0xd4cb('0x68'),_0xd4cb('0x69')],'raw':!![]});if(_0x11a801[_0xd4cb('0x2e')][_0xd4cb('0x61')]){_0x1deff7[_0xd4cb('0x64')]({'model':db[_0xd4cb('0x6a')],'as':_0xd4cb('0x6a'),'raw':!![]});}var _0x2f08b1=[{'model':db['WhatsappMessage'],'as':_0xd4cb('0x6b'),'attributes':['id','body',_0xd4cb('0x6c'),_0xd4cb('0x6d'),_0xd4cb('0x6e'),_0xd4cb('0x6f')],'include':_0x1deff7}];_0x2f08b1[_0xd4cb('0x64')]({'model':db[_0xd4cb('0x70')],'as':_0xd4cb('0x71'),'attributes':['id','name']});_0x2f08b1[_0xd4cb('0x64')]({'model':db['User'],'as':_0xd4cb('0x72'),'attributes':['id',_0xd4cb('0x66')]});return db[_0xd4cb('0x28')][_0xd4cb('0x3f')]({'where':{'id':_0x11a801[_0xd4cb('0x31')]['id']},'include':_0x2f08b1})[_0xd4cb('0x20')](handleEntityNotFound(_0x262b66,null))[_0xd4cb('0x20')](function(_0xa72b42){if(_0xa72b42){var _0xf39e05=_0xa72b42['get']({'plain':!![]});fs[_0xd4cb('0x73')](_0x484218);var _0x1dc212={'channel':_0xd4cb('0x74'),'account':_0xf39e05[_0xd4cb('0x71')][_0xd4cb('0x24')],'agent':_0xf39e05[_0xd4cb('0x72')]?_0xf39e05[_0xd4cb('0x72')]['fullname']:_0xd4cb('0x75'),'createdAt':moment(_0xf39e05['createdAt'])[_0xd4cb('0x62')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd4cb('0x5b')](),'closedAt':_0xf39e05[_0xd4cb('0x76')]?moment(_0xf39e05[_0xd4cb('0x77')])[_0xd4cb('0x62')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd4cb('0x5b')]():'','disposition':_0xf39e05[_0xd4cb('0x78')],'messages':_(_0xf39e05[_0xd4cb('0x6b')])['filter']({'secret':![]})[_0xd4cb('0x27')](function(_0x4a8106){if(_0x4a8106[_0xd4cb('0x6a')]){var _0x53cbe1=path[_0xd4cb('0x5c')](_0x561426,_0x4a8106[_0xd4cb('0x6a')][_0xd4cb('0x79')]);if(fs[_0xd4cb('0x7a')](_0x53cbe1)){fs[_0xd4cb('0x7b')](_0x53cbe1)[_0xd4cb('0x7c')](fs['createWriteStream'](path[_0xd4cb('0x5c')](_0x484218,_0x4a8106[_0xd4cb('0x6a')][_0xd4cb('0x79')])));}}return{'date':moment(_0x4a8106[_0xd4cb('0x6c')])[_0xd4cb('0x62')](_0xd4cb('0x51'))[_0xd4cb('0x5b')](),'sender':_0x4a8106[_0xd4cb('0x6d')]===_0xd4cb('0x7d')?_0x4a8106[_0xd4cb('0x65')]?_0x4a8106['User'][_0xd4cb('0x66')]:'System':_0x4a8106[_0xd4cb('0x67')][_0xd4cb('0x68')]+(_0x4a8106[_0xd4cb('0x67')]['lastName']?'\x20'+_0x4a8106[_0xd4cb('0x67')]['lastName']:''),'body':_0x4a8106[_0xd4cb('0x6a')]?_0x4a8106[_0xd4cb('0x6a')][_0xd4cb('0x79')]:_0x4a8106[_0xd4cb('0x3e')],'direction':_0x4a8106[_0xd4cb('0x6d')]==='out'?'A':'C','secret':_0x4a8106[_0xd4cb('0x6e')],'read':_0x4a8106[_0xd4cb('0x6f')],'attachment':_0x4a8106[_0xd4cb('0x6a')]};})[_0xd4cb('0x7e')]()};return ejs[_0xd4cb('0x7f')](path['join'](config['root'],_0xd4cb('0x5d'),_0xd4cb('0x80'),_0xd4cb('0x81')),{'interaction':_0x1dc212})[_0xd4cb('0x20')](function(_0x21c58f){var _0xadb75c=path[_0xd4cb('0x5c')](_0x484218,'transcript-'+_0xf39e05['id']+'-'+_0x26a234+_0xd4cb('0x82'));var _0x1040c9={'path':_0xadb75c,'channel':_0xd4cb('0x74'),'interactionId':_0xf39e05['id']};return pdf[_0xd4cb('0x83')](_0x21c58f,_0x1040c9);})[_0xd4cb('0x20')](function(){return new BPromise(function(_0x2bc2ea,_0x103280){zipdir(_0x484218,{'saveTo':_0x4ddd41},function(_0x2d2580,_0x2387f1){if(_0x2d2580)return _0x103280(_0x2d2580);return _0x2bc2ea(_0x2387f1);});})[_0xd4cb('0x20')](function(){return new BPromise(function(_0x4a0f0b,_0x8d24e7){rimraf(_0x484218,function(_0x358176){if(_0x358176)_0x8d24e7(_0x358176);return _0x4a0f0b();});});})['then'](function(){return _0x262b66[_0xd4cb('0x59')](_0x4ddd41,_0x29663c,function(_0x16ad18){if(_0x16ad18){console['log']('err',_0x16ad18);}else{fs['unlinkSync'](_0x4ddd41);}});});});}else{return _0x262b66[_0xd4cb('0x15')](0xc8);}})[_0xd4cb('0x3c')](handleError(_0x262b66,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 791cb14..f9d0d53 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf151=['exports','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x39257b,_0x474003){var _0x24cc6b=function(_0x4c360f){while(--_0x4c360f){_0x39257b['push'](_0x39257b['shift']());}};_0x24cc6b(++_0x474003);}(_0xf151,0xab));var _0x1f15=function(_0x491756,_0x2bd06b){_0x491756=_0x491756-0x0;var _0x269960=_0xf151[_0x491756];return _0x269960;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x1f15('0x0')];var WhatsappMessage=require(_0x1f15('0x1'))['db'][_0x1f15('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x1f15('0x3')](0x0);var events={'afterCreate':_0x1f15('0x4'),'afterUpdate':_0x1f15('0x5'),'afterDestroy':_0x1f15('0x6')};function emitEvent(_0x2fbef0){return function(_0x500179,_0x45df42,_0x5548bb){_0x500179['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1a1c65){_0x500179[_0x1f15('0x7')](_0x1f15('0x8'),_0x1a1c65['map'](function(_0x39fe86){return{'id':_0x39fe86['id']};}));return WhatsappMessage[_0x1f15('0x9')]({'where':{'WhatsappInteractionId':_0x500179['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4e6f42){_0x500179[_0x1f15('0x7')](_0x1f15('0xa'),_0x4e6f42[_0x1f15('0xb')]);WhatsappInteractionEvents[_0x1f15('0xc')](_0x2fbef0+':'+_0x500179['id'],_0x500179);WhatsappInteractionEvents['emit'](_0x2fbef0,_0x500179);_0x5548bb(null);})[_0x1f15('0xd')](_0x5548bb(null));};}for(var e in events){if(events[_0x1f15('0xe')](e)){var event=events[e];WhatsappInteraction[_0x1f15('0xf')](e,emitEvent(event));}}module[_0x1f15('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x9c5e=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch'];(function(_0xb7dce7,_0x247483){var _0x331bc4=function(_0x4a06b2){while(--_0x4a06b2){_0xb7dce7['push'](_0xb7dce7['shift']());}};_0x331bc4(++_0x247483);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x54db3c,_0x57a938){_0x54db3c=_0x54db3c-0x0;var _0x89abe3=_0x9c5e[_0x54db3c];return _0x89abe3;};'use strict';var EventEmitter=require(_0xe9c5('0x0'));var WhatsappInteraction=require(_0xe9c5('0x1'))['db'][_0xe9c5('0x2')];var WhatsappMessage=require(_0xe9c5('0x1'))['db'][_0xe9c5('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe9c5('0x4')};function emitEvent(_0x13d5d7){return function(_0x4fa4c5,_0x361ef3,_0x5c11e5){_0x4fa4c5[_0xe9c5('0x5')]({'attributes':['id'],'raw':!![]})[_0xe9c5('0x6')](function(_0x5b1c04){_0x4fa4c5[_0xe9c5('0x7')](_0xe9c5('0x8'),_0x5b1c04[_0xe9c5('0x9')](function(_0x38218c){return{'id':_0x38218c['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x4fa4c5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x29d7e0){_0x4fa4c5[_0xe9c5('0x7')](_0xe9c5('0xa'),_0x29d7e0[_0xe9c5('0xb')]);WhatsappInteractionEvents[_0xe9c5('0xc')](_0x13d5d7+':'+_0x4fa4c5['id'],_0x4fa4c5);WhatsappInteractionEvents[_0xe9c5('0xc')](_0x13d5d7,_0x4fa4c5);_0x5c11e5(null);})[_0xe9c5('0xd')](_0x5c11e5(null));};}for(var e in events){if(events[_0xe9c5('0xe')](e)){var event=events[e];WhatsappInteraction[_0xe9c5('0xf')](e,emitEvent(event));}}module[_0xe9c5('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 7f85389..fd27a95 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x938f=['closed','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed'];(function(_0x3ebaf9,_0x5de656){var _0x4dab61=function(_0x5cf1f2){while(--_0x5cf1f2){_0x3ebaf9['push'](_0x3ebaf9['shift']());}};_0x4dab61(++_0x5de656);}(_0x938f,0xc1));var _0xf938=function(_0x259d17,_0x220710){_0x259d17=_0x259d17-0x0;var _0x407535=_0x938f[_0x259d17];return _0x407535;};'use strict';var _=require(_0xf938('0x0'));var util=require(_0xf938('0x1'));var logger=require(_0xf938('0x2'))(_0xf938('0x3'));var moment=require(_0xf938('0x4'));var BPromise=require(_0xf938('0x5'));var rp=require(_0xf938('0x6'));var fs=require('fs');var path=require(_0xf938('0x7'));var rimraf=require(_0xf938('0x8'));var config=require('../../config/environment');var attributes=require(_0xf938('0x9'));module[_0xf938('0xa')]=function(_0x753bca,_0x2774e0){return _0x753bca[_0xf938('0xb')](_0xf938('0xc'),attributes,{'tableName':_0xf938('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34d908,_0x5efda2,_0x1743c6){if(_0x34d908[_0xf938('0xe')](_0xf938('0xf'))){_0x34d908['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1743c6(null,_0x34d908);}}});}; \ No newline at end of file +var _0x9b6b=['bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappInteraction','closedAt','format','../../config/logger'];(function(_0x2c45c9,_0x221849){var _0x4701e9=function(_0xc1c85b){while(--_0xc1c85b){_0x2c45c9['push'](_0x2c45c9['shift']());}};_0x4701e9(++_0x221849);}(_0x9b6b,0xe5));var _0xb9b6=function(_0x14e4f2,_0x29a1d3){_0x14e4f2=_0x14e4f2-0x0;var _0x32868f=_0x9b6b[_0x14e4f2];return _0x32868f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb9b6('0x0'))('api');var moment=require('moment');var BPromise=require(_0xb9b6('0x1'));var rp=require(_0xb9b6('0x2'));var fs=require('fs');var path=require(_0xb9b6('0x3'));var rimraf=require(_0xb9b6('0x4'));var config=require(_0xb9b6('0x5'));var attributes=require('./whatsappInteraction.attributes');module[_0xb9b6('0x6')]=function(_0x59d260,_0x409871){return _0x59d260['define'](_0xb9b6('0x7'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f3963,_0x3566c7,_0x1e9fc3){if(_0x3f3963['changed']('closed')){_0x3f3963[_0xb9b6('0x8')]=moment()[_0xb9b6('0x9')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1e9fc3(null,_0x3f3963);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 02ba243..81b7c12 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c06=['options','raw','where','attributes','limit','then','find','addTags','body','ids','omit','AddTags','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update'];(function(_0x52c4e9,_0x5412d0){var _0x252a03=function(_0x57857c){while(--_0x57857c){_0x52c4e9['push'](_0x52c4e9['shift']());}};_0x252a03(++_0x5412d0);}(_0x2c06,0xc5));var _0x62c0=function(_0x712717,_0xe8a2b9){_0x712717=_0x712717-0x0;var _0x37378f=_0x2c06[_0x712717];return _0x37378f;};'use strict';var _=require('lodash');var util=require(_0x62c0('0x0'));var moment=require(_0x62c0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x62c0('0x2'))['db'];var utils=require(_0x62c0('0x3'));var logger=require(_0x62c0('0x4'))(_0x62c0('0x5'));var config=require(_0x62c0('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x62c0('0x7')]=_['defaults'](config['redis'],{'host':_0x62c0('0x8'),'port':0x18eb});var socket=require(_0x62c0('0x9'))(new Redis(config['redis']));require(_0x62c0('0xa'))[_0x62c0('0xb')](socket);function respondWithRpcPromise(_0x1edda6,_0x3c8646,_0x4185b4){return new BPromise(function(_0x802262,_0x3f5922){return client['request'](_0x1edda6,_0x4185b4)['then'](function(_0x55c84c){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x3c8646,_0x62c0('0xc'));logger[_0x62c0('0xd')](_0x62c0('0xe'),_0x3c8646,'request\x20sent',JSON[_0x62c0('0xf')](_0x55c84c));if(_0x55c84c['error']){if(_0x55c84c[_0x62c0('0x10')]['code']===0x1f4){logger[_0x62c0('0x10')](_0x62c0('0x11'),_0x3c8646,_0x55c84c[_0x62c0('0x10')]['message']);return _0x3f5922(_0x55c84c[_0x62c0('0x10')]['message']);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x3c8646,_0x55c84c[_0x62c0('0x10')]['message']);return _0x802262(_0x55c84c[_0x62c0('0x10')][_0x62c0('0x12')]);}else{logger[_0x62c0('0x13')](_0x62c0('0x11'),_0x3c8646,_0x62c0('0xc'));_0x802262(_0x55c84c[_0x62c0('0x14')]['message']);}})[_0x62c0('0x15')](function(_0x3cc616){logger[_0x62c0('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x3c8646,_0x3cc616);_0x3f5922(_0x3cc616);});});}exports[_0x62c0('0x16')]=function(_0x432951){var _0x5d9a3a=this;return new Promise(function(_0x50b66c,_0x517326){return db[_0x62c0('0x17')][_0x62c0('0x18')](_0x432951['body'],{'raw':_0x432951[_0x62c0('0x19')]?_0x432951['options'][_0x62c0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x432951['options']?_0x432951[_0x62c0('0x19')][_0x62c0('0x1b')]||null:null,'attributes':_0x432951[_0x62c0('0x19')]?_0x432951[_0x62c0('0x19')][_0x62c0('0x1c')]||null:null,'limit':_0x432951[_0x62c0('0x19')]?_0x432951[_0x62c0('0x19')][_0x62c0('0x1d')]||null:null})[_0x62c0('0x1e')](function(_0xbf9e30){logger[_0x62c0('0x13')](_0x62c0('0x16'),_0x432951);logger[_0x62c0('0xd')](_0x62c0('0x16'),_0x432951,JSON['stringify'](_0xbf9e30));_0x50b66c(_0xbf9e30);})[_0x62c0('0x15')](function(_0x48ef06){logger[_0x62c0('0x10')](_0x62c0('0x16'),_0x48ef06['message'],_0x432951);_0x517326(_0x5d9a3a[_0x62c0('0x10')](0x1f4,_0x48ef06[_0x62c0('0x12')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x3b4a34){return new Promise(function(_0x4b5406,_0x17e53f){return db[_0x62c0('0x17')][_0x62c0('0x1f')]({'where':_0x3b4a34[_0x62c0('0x19')]?_0x3b4a34['options'][_0x62c0('0x1b')]||null:null})[_0x62c0('0x1e')](function(_0xd5e0dd){if(_0xd5e0dd){return _0xd5e0dd[_0x62c0('0x20')](_0x3b4a34[_0x62c0('0x21')][_0x62c0('0x22')],_[_0x62c0('0x23')](_0x3b4a34['body'],[_0x62c0('0x22'),'id'])||{});}})['spread'](function(_0x2af8b2){logger[_0x62c0('0x13')]('AddTags',_0x3b4a34);logger[_0x62c0('0xd')](_0x62c0('0x24'),_0x3b4a34,JSON[_0x62c0('0xf')](_0x2af8b2));_0x4b5406(_0x2af8b2);})['catch'](function(_0x388c9c){logger[_0x62c0('0x10')]('AddTags',_0x388c9c[_0x62c0('0x12')],_0x3b4a34);_0x17e53f(_this[_0x62c0('0x10')](0x1f4,_0x388c9c[_0x62c0('0x12')]));});});}; \ No newline at end of file +var _0xee9c=['ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','attributes','limit','debug','catch','AddTagsToWhatsappInteraction','find','where'];(function(_0xe570d0,_0x5a37e6){var _0xf81290=function(_0x1e2c1c){while(--_0x1e2c1c){_0xe570d0['push'](_0xe570d0['shift']());}};_0xf81290(++_0x5a37e6);}(_0xee9c,0x1d1));var _0xcee9=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xee9c[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var util=require(_0xcee9('0x0'));var moment=require(_0xcee9('0x1'));var BPromise=require(_0xcee9('0x2'));var rs=require(_0xcee9('0x3'));var fs=require('fs');var Redis=require(_0xcee9('0x4'));var db=require(_0xcee9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcee9('0x6'))(_0xcee9('0x7'));var config=require(_0xcee9('0x8'));var jayson=require(_0xcee9('0x9'));var client=jayson[_0xcee9('0xa')][_0xcee9('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xcee9('0xc')],{'host':_0xcee9('0xd'),'port':0x18eb});var socket=require(_0xcee9('0xe'))(new Redis(config['redis']));require(_0xcee9('0xf'))[_0xcee9('0x10')](socket);function respondWithRpcPromise(_0x1b7a37,_0x9612b8,_0x5dde9e){return new BPromise(function(_0x2862c3,_0x2199a3){return client[_0xcee9('0x11')](_0x1b7a37,_0x5dde9e)[_0xcee9('0x12')](function(_0x2f9d75){logger[_0xcee9('0x13')](_0xcee9('0x14'),_0x9612b8,_0xcee9('0x15'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x9612b8,_0xcee9('0x15'),JSON[_0xcee9('0x16')](_0x2f9d75));if(_0x2f9d75[_0xcee9('0x17')]){if(_0x2f9d75[_0xcee9('0x17')][_0xcee9('0x18')]===0x1f4){logger[_0xcee9('0x17')](_0xcee9('0x14'),_0x9612b8,_0x2f9d75[_0xcee9('0x17')][_0xcee9('0x19')]);return _0x2199a3(_0x2f9d75[_0xcee9('0x17')][_0xcee9('0x19')]);}logger['error'](_0xcee9('0x14'),_0x9612b8,_0x2f9d75['error'][_0xcee9('0x19')]);return _0x2862c3(_0x2f9d75[_0xcee9('0x17')][_0xcee9('0x19')]);}else{logger[_0xcee9('0x13')](_0xcee9('0x14'),_0x9612b8,'request\x20sent');_0x2862c3(_0x2f9d75['result'][_0xcee9('0x19')]);}})['catch'](function(_0x54da56){logger['error'](_0xcee9('0x14'),_0x9612b8,_0x54da56);_0x2199a3(_0x54da56);});});}exports[_0xcee9('0x1a')]=function(_0x2dac07){var _0x3c9952=this;return new Promise(function(_0x124d10,_0xe7dee0){return db[_0xcee9('0x1b')][_0xcee9('0x1c')](_0x2dac07[_0xcee9('0x1d')],{'raw':_0x2dac07[_0xcee9('0x1e')]?_0x2dac07[_0xcee9('0x1e')][_0xcee9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dac07[_0xcee9('0x1e')]?_0x2dac07['options']['where']||null:null,'attributes':_0x2dac07['options']?_0x2dac07['options'][_0xcee9('0x20')]||null:null,'limit':_0x2dac07[_0xcee9('0x1e')]?_0x2dac07[_0xcee9('0x1e')][_0xcee9('0x21')]||null:null})['then'](function(_0x205890){logger[_0xcee9('0x13')]('UpdateWhatsappInteraction',_0x2dac07);logger[_0xcee9('0x22')](_0xcee9('0x1a'),_0x2dac07,JSON['stringify'](_0x205890));_0x124d10(_0x205890);})[_0xcee9('0x23')](function(_0x4b4bd3){logger[_0xcee9('0x17')](_0xcee9('0x1a'),_0x4b4bd3['message'],_0x2dac07);_0xe7dee0(_0x3c9952['error'](0x1f4,_0x4b4bd3['message']));});});};exports[_0xcee9('0x24')]=function(_0x56c249){return new Promise(function(_0x57c1f0,_0x5ab91e){return db[_0xcee9('0x1b')][_0xcee9('0x25')]({'where':_0x56c249[_0xcee9('0x1e')]?_0x56c249[_0xcee9('0x1e')][_0xcee9('0x26')]||null:null})[_0xcee9('0x12')](function(_0x4927e6){if(_0x4927e6){return _0x4927e6['addTags'](_0x56c249[_0xcee9('0x1d')][_0xcee9('0x27')],_['omit'](_0x56c249['body'],[_0xcee9('0x27'),'id'])||{});}})[_0xcee9('0x28')](function(_0x3757c7){logger[_0xcee9('0x13')](_0xcee9('0x29'),_0x56c249);logger['debug'](_0xcee9('0x29'),_0x56c249,JSON[_0xcee9('0x16')](_0x3757c7));_0x57c1f0(_0x3757c7);})[_0xcee9('0x23')](function(_0x3483ea){logger[_0xcee9('0x17')](_0xcee9('0x29'),_0x3483ea[_0xcee9('0x19')],_0x56c249);_0x5ab91e(_this[_0xcee9('0x17')](0x1f4,_0x3483ea[_0xcee9('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index ddcd9a7..c356c4e 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2150=['emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x3a08be,_0x569c52){var _0x3502cd=function(_0x501176){while(--_0x501176){_0x3a08be['push'](_0x3a08be['shift']());}};_0x3502cd(++_0x569c52);}(_0x2150,0x75));var _0x0215=function(_0x53e3fa,_0x50c5f2){_0x53e3fa=_0x53e3fa-0x0;var _0xe8584a=_0x2150[_0x53e3fa];return _0xe8584a;};'use strict';var WhatsappInteractionEvents=require(_0x0215('0x0'));var events=[_0x0215('0x1'),'remove','update'];function createListener(_0x5171a2,_0x3264a9){return function(_0x4ef0cd){_0x3264a9[_0x0215('0x2')](_0x5171a2,_0x4ef0cd);};}function removeListener(_0x36acda,_0x2daad0){return function(){WhatsappInteractionEvents[_0x0215('0x3')](_0x36acda,_0x2daad0);};}exports[_0x0215('0x4')]=function(_0x2254d2){for(var _0x474dd1=0x0,_0x755cdc=events[_0x0215('0x5')];_0x474dd1<_0x755cdc;_0x474dd1++){var _0x44b15e=events[_0x474dd1];var _0xb41fe3=createListener(_0x0215('0x6')+_0x44b15e,_0x2254d2);WhatsappInteractionEvents['on'](_0x44b15e,_0xb41fe3);}}; \ No newline at end of file +var _0x3cd4=['whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3cd4,0x1d9));var _0x43cd=function(_0x16ae45,_0x534ed9){_0x16ae45=_0x16ae45-0x0;var _0x39e1de=_0x3cd4[_0x16ae45];return _0x39e1de;};'use strict';var WhatsappInteractionEvents=require(_0x43cd('0x0'));var events=[_0x43cd('0x1'),_0x43cd('0x2'),_0x43cd('0x3')];function createListener(_0x4e398f,_0x29c5ee){return function(_0x45dfec){_0x29c5ee[_0x43cd('0x4')](_0x4e398f,_0x45dfec);};}function removeListener(_0x20eed,_0x25234c){return function(){WhatsappInteractionEvents[_0x43cd('0x5')](_0x20eed,_0x25234c);};}exports[_0x43cd('0x6')]=function(_0x3d4b41){for(var _0x306f98=0x0,_0x3f80ec=events['length'];_0x306f98<_0x3f80ec;_0x306f98++){var _0x5e8115=events[_0x306f98];var _0x4cf4ba=createListener(_0x43cd('0x7')+_0x5e8115,_0x3d4b41);WhatsappInteractionEvents['on'](_0x5e8115,_0x4cf4ba);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index f06d1fb..39690ac 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa1a3=['express','Router','fs-extra','../../components/auth/service','./whatsappMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','whatsappmessage:create','create','/:id/status','update','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','multer','path','connect-timeout'];(function(_0x263b9f,_0x510f5a){var _0x4db4ab=function(_0x22f8d5){while(--_0x22f8d5){_0x263b9f['push'](_0x263b9f['shift']());}};_0x4db4ab(++_0x510f5a);}(_0xa1a3,0x192));var _0x3a1a=function(_0x393449,_0x22c1dc){_0x393449=_0x393449-0x0;var _0x39db97=_0xa1a3[_0x393449];return _0x39db97;};'use strict';var multer=require(_0x3a1a('0x0'));var util=require('util');var path=require(_0x3a1a('0x1'));var timeout=require(_0x3a1a('0x2'));var express=require(_0x3a1a('0x3'));var router=express[_0x3a1a('0x4')]();var fs_extra=require(_0x3a1a('0x5'));var auth=require(_0x3a1a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3a1a('0x7'));router[_0x3a1a('0x8')]('/',auth[_0x3a1a('0x9')](),controller[_0x3a1a('0xa')]);router[_0x3a1a('0x8')](_0x3a1a('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x3a1a('0x8')](_0x3a1a('0xc'),auth[_0x3a1a('0x9')](),controller[_0x3a1a('0xd')]);router[_0x3a1a('0xe')]('/',auth[_0x3a1a('0x9')](),interaction[_0x3a1a('0xf')]('whatsapp',_0x3a1a('0x10')),controller[_0x3a1a('0x11')]);router['post'](_0x3a1a('0x12'),controller['status']);router['put']('/:id',auth[_0x3a1a('0x9')](),controller[_0x3a1a('0x13')]);router['put'](_0x3a1a('0x14'),auth[_0x3a1a('0x9')](),controller[_0x3a1a('0x15')]);router[_0x3a1a('0x16')](_0x3a1a('0x17'),auth[_0x3a1a('0x9')](),controller[_0x3a1a('0x18')]);router[_0x3a1a('0x19')](_0x3a1a('0xc'),auth[_0x3a1a('0x9')](),controller[_0x3a1a('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x753e=['describe','/:id','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','put','update','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe'];(function(_0x56e124,_0x1ca566){var _0x2e0f7f=function(_0x590fdb){while(--_0x590fdb){_0x56e124['push'](_0x56e124['shift']());}};_0x2e0f7f(++_0x1ca566);}(_0x753e,0x143));var _0xe753=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x753e[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0xe753('0x0'));var util=require(_0xe753('0x1'));var path=require(_0xe753('0x2'));var timeout=require(_0xe753('0x3'));var express=require(_0xe753('0x4'));var router=express[_0xe753('0x5')]();var fs_extra=require(_0xe753('0x6'));var auth=require(_0xe753('0x7'));var interaction=require(_0xe753('0x8'));var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router['get']('/',auth[_0xe753('0x9')](),controller[_0xe753('0xa')]);router[_0xe753('0xb')](_0xe753('0xc'),auth['isAuthenticated'](),controller[_0xe753('0xd')]);router['get'](_0xe753('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xe753('0xf')]('/',auth['isAuthenticated'](),interaction[_0xe753('0x10')](_0xe753('0x11'),_0xe753('0x12')),controller[_0xe753('0x13')]);router[_0xe753('0xf')](_0xe753('0x14'),controller['status']);router[_0xe753('0x15')](_0xe753('0xe'),auth['isAuthenticated'](),controller[_0xe753('0x16')]);router[_0xe753('0x15')]('/:id/accept',auth[_0xe753('0x9')](),controller[_0xe753('0x17')]);router[_0xe753('0x15')](_0xe753('0x18'),auth[_0xe753('0x9')](),controller[_0xe753('0x19')]);router['delete'](_0xe753('0xe'),auth[_0xe753('0x9')](),controller[_0xe753('0x1a')]);module[_0xe753('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 687b59a..eb9cb11 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0590=['out','DATE','STRING','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x57e53d,_0xe25146){var _0x599f96=function(_0x1a9fab){while(--_0x1a9fab){_0x57e53d['push'](_0x57e53d['shift']());}};_0x599f96(++_0xe25146);}(_0x0590,0x1d3));var _0x0059=function(_0x23b478,_0x3e738a){_0x23b478=_0x23b478-0x0;var _0x11648e=_0x0590[_0x23b478];return _0x11648e;};'use strict';var Sequelize=require(_0x0059('0x0'));module[_0x0059('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0059('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0059('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0059('0x4')]('in',_0x0059('0x5')),'defaultValue':_0x0059('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x0059('0x6')]},'secret':{'type':Sequelize[_0x0059('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x0059('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5697=['BOOLEAN','DATE','sequelize','TEXT','medium'];(function(_0x56050b,_0x41db73){var _0x5dd2da=function(_0x31f3ca){while(--_0x31f3ca){_0x56050b['push'](_0x56050b['shift']());}};_0x5dd2da(++_0x41db73);}(_0x5697,0x1b5));var _0x7569=function(_0x39bfb6,_0x4272c8){_0x39bfb6=_0x39bfb6-0x0;var _0x23fef9=_0x5697[_0x39bfb6];return _0x23fef9;};'use strict';var Sequelize=require(_0x7569('0x0'));module['exports']={'body':{'type':Sequelize[_0x7569('0x1')](_0x7569('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7569('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x7569('0x4')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 037e3d7..77c5d55 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ff3=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./whatsappMessage.socket','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','stack','name','send','index','map','rawAttributes','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','WhatsappMessage','includeAll','include','show','params','options','find','create','body','describe','whatsapp-interactions','accept','whatsapp','readAt','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','internal','manual','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','email','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto'];(function(_0x41b44f,_0x1f8f04){var _0x5c8e15=function(_0x3e507f){while(--_0x3e507f){_0x41b44f['push'](_0x41b44f['shift']());}};_0x5c8e15(++_0x1f8f04);}(_0x7ff3,0x105));var _0x37ff=function(_0xeff2c3,_0x3a5a82){_0xeff2c3=_0xeff2c3-0x0;var _0x2cade6=_0x7ff3[_0xeff2c3];return _0x2cade6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x37ff('0x0'));var jsonpatch=require(_0x37ff('0x1'));var rp=require('request-promise');var moment=require(_0x37ff('0x2'));var BPromise=require(_0x37ff('0x3'));var Mustache=require(_0x37ff('0x4'));var util=require(_0x37ff('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x37ff('0x6'));var ejs=require(_0x37ff('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x37ff('0x8'));var squel=require(_0x37ff('0x9'));var crypto=require(_0x37ff('0xa'));var jsforce=require(_0x37ff('0xb'));var deskjs=require(_0x37ff('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x37ff('0xd'));var Redis=require(_0x37ff('0xe'));var authService=require(_0x37ff('0xf'));var qs=require(_0x37ff('0x10'));var as=require(_0x37ff('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x37ff('0x12'))(_0x37ff('0x13'));var utils=require(_0x37ff('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x37ff('0x15'));var db=require('../../mysqldb')['db'];config[_0x37ff('0x16')]=_[_0x37ff('0x17')](config[_0x37ff('0x16')],{'host':_0x37ff('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x37ff('0x19'))['register'](socket);var jayson=require(_0x37ff('0x1a'));var client=jayson[_0x37ff('0x1b')][_0x37ff('0x1c')]({'port':0x232c});var client9002=jayson[_0x37ff('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8b1e7,_0x1113b8,_0x361d68,_0x1a8bc9){return new BPromise(function(_0xe7d1ee,_0x42913a){var _0x337506=_0x1a8bc9||client;return _0x337506[_0x37ff('0x1d')](_0x8b1e7,_0x361d68)[_0x37ff('0x1e')](function(_0x5b92c3){logger[_0x37ff('0x1f')](_0x37ff('0x20'),_0x1113b8,_0x37ff('0x21'));logger['debug'](_0x37ff('0x22'),_0x1113b8,_0x37ff('0x21'),JSON[_0x37ff('0x23')](_0x5b92c3));if(_0x5b92c3['error']){if(_0x5b92c3[_0x37ff('0x24')]['code']===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x1113b8,_0x5b92c3[_0x37ff('0x24')][_0x37ff('0x25')]);return _0x42913a(_0x5b92c3[_0x37ff('0x24')][_0x37ff('0x25')]);}logger[_0x37ff('0x24')](_0x37ff('0x20'),_0x1113b8,_0x5b92c3[_0x37ff('0x24')]['message']);return _0xe7d1ee(_0x5b92c3[_0x37ff('0x24')][_0x37ff('0x25')]);}else{logger[_0x37ff('0x1f')](_0x37ff('0x20'),_0x1113b8,_0x37ff('0x21'));_0xe7d1ee(_0x5b92c3[_0x37ff('0x26')]['message']);}})[_0x37ff('0x27')](function(_0x46f24a){logger[_0x37ff('0x24')](_0x37ff('0x20'),_0x1113b8,_0x46f24a);_0x42913a(_0x46f24a);});});}function respondWithStatusCode(_0x4c0025,_0x12d56b){_0x12d56b=_0x12d56b||0xcc;return function(_0xbdde11){if(_0xbdde11){return _0x4c0025[_0x37ff('0x28')](_0x12d56b);}return _0x4c0025[_0x37ff('0x29')](_0x12d56b)['end']();};}function respondWithResult(_0x3570ec,_0xbc8261){_0xbc8261=_0xbc8261||0xc8;return function(_0x52b3e6){if(_0x52b3e6){return _0x3570ec['status'](_0xbc8261)[_0x37ff('0x2a')](_0x52b3e6);}};}function respondWithFilteredResult(_0xfb4f99,_0x4dc87f){return function(_0x27fd86){if(_0x27fd86){var _0x50fbaf=typeof _0x4dc87f[_0x37ff('0x2b')]===_0x37ff('0x2c')&&typeof _0x4dc87f['limit']===_0x37ff('0x2c');var _0x161356=_0x27fd86[_0x37ff('0x2d')];var _0x4d8e57=_0x50fbaf?0x0:_0x4dc87f[_0x37ff('0x2b')];var _0x370830=_0x50fbaf?_0x27fd86['count']:_0x4dc87f[_0x37ff('0x2b')]+_0x4dc87f[_0x37ff('0x2e')];var _0x5a3ae9;if(_0x370830>=_0x161356){_0x370830=_0x161356;_0x5a3ae9=0xc8;}else{_0x5a3ae9=0xce;}_0xfb4f99[_0x37ff('0x29')](_0x5a3ae9);return _0xfb4f99[_0x37ff('0x2f')](_0x37ff('0x30'),_0x4d8e57+'-'+_0x370830+'/'+_0x161356)[_0x37ff('0x2a')](_0x27fd86);}return null;};}function patchUpdates(_0x4c61ab){return function(_0x576ceb){try{jsonpatch['apply'](_0x576ceb,_0x4c61ab,!![]);}catch(_0x5a563b){return BPromise[_0x37ff('0x31')](_0x5a563b);}return _0x576ceb['save']();};}function saveUpdates(_0x59fba3,_0x9fe064){return function(_0x928202){if(_0x928202){return _0x928202[_0x37ff('0x32')](_0x59fba3)['then'](function(_0x1fefd3){return _0x1fefd3;});}return null;};}function removeEntity(_0x4664fa,_0x1b24d0){return function(_0x57f528){if(_0x57f528){return _0x57f528[_0x37ff('0x33')]()[_0x37ff('0x1e')](function(){_0x4664fa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15963b,_0x5b1238){return function(_0x44e29f){if(!_0x44e29f){_0x15963b[_0x37ff('0x28')](0x194);}return _0x44e29f;};}function handleError(_0x1013a4,_0x311a10){_0x311a10=_0x311a10||0x1f4;return function(_0x89e121){logger[_0x37ff('0x24')](_0x89e121[_0x37ff('0x34')]);if(_0x89e121[_0x37ff('0x35')]){delete _0x89e121[_0x37ff('0x35')];}_0x1013a4[_0x37ff('0x29')](_0x311a10)[_0x37ff('0x36')](_0x89e121);};}exports[_0x37ff('0x37')]=function(_0x328c9a,_0x4a28b2){var _0x4f0ee6={},_0x1dad7e={},_0xab04b6={'count':0x0,'rows':[]};var _0x3bef7c=_[_0x37ff('0x38')](db['WhatsappMessage'][_0x37ff('0x39')],function(_0x1838ff){return{'name':_0x1838ff['fieldName'],'type':_0x1838ff[_0x37ff('0x3a')][_0x37ff('0x3b')]};});_0x1dad7e['model']=_['map'](_0x3bef7c,'name');_0x1dad7e[_0x37ff('0x3c')]=_[_0x37ff('0x3d')](_0x328c9a[_0x37ff('0x3c')]);_0x1dad7e['filters']=_[_0x37ff('0x3e')](_0x1dad7e[_0x37ff('0x3f')],_0x1dad7e[_0x37ff('0x3c')]);_0x4f0ee6['attributes']=_[_0x37ff('0x3e')](_0x1dad7e['model'],qs['fields'](_0x328c9a[_0x37ff('0x3c')][_0x37ff('0x40')]));_0x4f0ee6[_0x37ff('0x41')]=_0x4f0ee6['attributes'][_0x37ff('0x42')]?_0x4f0ee6[_0x37ff('0x41')]:_0x1dad7e[_0x37ff('0x3f')];if(!_0x328c9a[_0x37ff('0x3c')][_0x37ff('0x43')]('nolimit')){_0x4f0ee6['limit']=qs[_0x37ff('0x2e')](_0x328c9a[_0x37ff('0x3c')][_0x37ff('0x2e')]);_0x4f0ee6[_0x37ff('0x2b')]=qs[_0x37ff('0x2b')](_0x328c9a[_0x37ff('0x3c')][_0x37ff('0x2b')]);}_0x4f0ee6[_0x37ff('0x44')]=qs[_0x37ff('0x45')](_0x328c9a['query'][_0x37ff('0x45')]);_0x4f0ee6[_0x37ff('0x46')]=qs[_0x37ff('0x47')](_['pick'](_0x328c9a[_0x37ff('0x3c')],_0x1dad7e[_0x37ff('0x47')]),_0x3bef7c);if(_0x328c9a[_0x37ff('0x3c')]['filter']){_0x4f0ee6['where']=_[_0x37ff('0x48')](_0x4f0ee6[_0x37ff('0x46')],{'$or':_[_0x37ff('0x38')](_0x3bef7c,function(_0x2d992c){if(_0x2d992c[_0x37ff('0x3a')]!==_0x37ff('0x49')){var _0x1431b0={};_0x1431b0[_0x2d992c['name']]={'$like':'%'+_0x328c9a[_0x37ff('0x3c')][_0x37ff('0x4a')]+'%'};return _0x1431b0;}})});}_0x4f0ee6=_['merge']({},_0x4f0ee6,_0x328c9a['options']);var _0xc7732f={'where':_0x4f0ee6['where']};return db[_0x37ff('0x4b')][_0x37ff('0x2d')](_0xc7732f)[_0x37ff('0x1e')](function(_0x258ab6){_0xab04b6[_0x37ff('0x2d')]=_0x258ab6;if(_0x328c9a[_0x37ff('0x3c')][_0x37ff('0x4c')]){_0x4f0ee6[_0x37ff('0x4d')]=[{'all':!![]}];}return db[_0x37ff('0x4b')]['findAll'](_0x4f0ee6);})[_0x37ff('0x1e')](function(_0x3ab83e){_0xab04b6['rows']=_0x3ab83e;return _0xab04b6;})[_0x37ff('0x1e')](respondWithFilteredResult(_0x4a28b2,_0x4f0ee6))[_0x37ff('0x27')](handleError(_0x4a28b2,null));};exports[_0x37ff('0x4e')]=function(_0x3235e1,_0x49f98e){var _0xf1f0c={'raw':!![],'where':{'id':_0x3235e1[_0x37ff('0x4f')]['id']}},_0x46500a={};_0x46500a['model']=_[_0x37ff('0x3d')](db['WhatsappMessage'][_0x37ff('0x39')]);_0x46500a[_0x37ff('0x3c')]=_['keys'](_0x3235e1[_0x37ff('0x3c')]);_0x46500a[_0x37ff('0x47')]=_['intersection'](_0x46500a[_0x37ff('0x3f')],_0x46500a[_0x37ff('0x3c')]);_0xf1f0c[_0x37ff('0x41')]=_[_0x37ff('0x3e')](_0x46500a[_0x37ff('0x3f')],qs[_0x37ff('0x40')](_0x3235e1[_0x37ff('0x3c')][_0x37ff('0x40')]));_0xf1f0c[_0x37ff('0x41')]=_0xf1f0c[_0x37ff('0x41')][_0x37ff('0x42')]?_0xf1f0c['attributes']:_0x46500a['model'];if(_0x3235e1[_0x37ff('0x3c')][_0x37ff('0x4c')]){_0xf1f0c[_0x37ff('0x4d')]=[{'all':!![]}];}_0xf1f0c=_[_0x37ff('0x48')]({},_0xf1f0c,_0x3235e1[_0x37ff('0x50')]);return db['WhatsappMessage'][_0x37ff('0x51')](_0xf1f0c)[_0x37ff('0x1e')](handleEntityNotFound(_0x49f98e,null))['then'](respondWithResult(_0x49f98e,null))[_0x37ff('0x27')](handleError(_0x49f98e,null));};exports[_0x37ff('0x52')]=function(_0x4f7377,_0x21f856){return db['WhatsappMessage']['create'](_0x4f7377[_0x37ff('0x53')],{})['then'](respondWithResult(_0x21f856,0xc9))[_0x37ff('0x27')](handleError(_0x21f856,null));};exports['update']=function(_0x47b91b,_0x5cae5f){if(_0x47b91b[_0x37ff('0x53')]['id']){delete _0x47b91b['body']['id'];}return db[_0x37ff('0x4b')][_0x37ff('0x51')]({'where':{'id':_0x47b91b[_0x37ff('0x4f')]['id']}})[_0x37ff('0x1e')](handleEntityNotFound(_0x5cae5f,null))[_0x37ff('0x1e')](saveUpdates(_0x47b91b[_0x37ff('0x53')],null))[_0x37ff('0x1e')](respondWithResult(_0x5cae5f,null))[_0x37ff('0x27')](handleError(_0x5cae5f,null));};exports[_0x37ff('0x33')]=function(_0x271633,_0x35f71d){return db['WhatsappMessage'][_0x37ff('0x51')]({'where':{'id':_0x271633[_0x37ff('0x4f')]['id']}})[_0x37ff('0x1e')](handleEntityNotFound(_0x35f71d,null))['then'](removeEntity(_0x35f71d,null))['catch'](handleError(_0x35f71d,null));};exports[_0x37ff('0x54')]=function(_0xe06932,_0x5ad5a3){return db[_0x37ff('0x4b')][_0x37ff('0x54')]()[_0x37ff('0x1e')](respondWithResult(_0x5ad5a3,null))[_0x37ff('0x27')](handleError(_0x5ad5a3,null));};var interaction_log=require('../../config/logger')(_0x37ff('0x55'));exports[_0x37ff('0x56')]=function(_0xf78c58,_0x505b96,_0x33e978){var _0x2ad4e2={'agent':{},'channel':_0x37ff('0x57')};if(_0xf78c58[_0x37ff('0x53')]['id']){delete _0xf78c58['body']['id'];}_0xf78c58[_0x37ff('0x53')]['read']=!![];_0xf78c58[_0x37ff('0x53')][_0x37ff('0x58')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xf78c58[_0x37ff('0x53')][_0x37ff('0x59')]=_0xf78c58[_0x37ff('0x53')][_0x37ff('0x59')]||_0xf78c58[_0x37ff('0x5a')]['id'];_0x2ad4e2['agent']['id']=_0xf78c58[_0x37ff('0x53')][_0x37ff('0x59')];return db[_0x37ff('0x4b')]['find']({'where':{'id':_0xf78c58[_0x37ff('0x4f')]['id'],'UserId':null}})[_0x37ff('0x1e')](handleEntityNotFound(_0x505b96,null))[_0x37ff('0x1e')](saveUpdates(_0xf78c58[_0x37ff('0x53')],null))[_0x37ff('0x1e')](function(_0x16324d){if(_0x16324d){_0x2ad4e2['message']=_0x16324d[_0x37ff('0x5b')]({'plain':!![]});return db[_0x37ff('0x5c')][_0x37ff('0x51')]({'where':{'id':_0x16324d[_0x37ff('0x5d')]}});}return null;})[_0x37ff('0x1e')](handleEntityNotFound(_0x505b96,null))['then'](function(_0x4b867e){if(_0x4b867e){return _0x4b867e[_0x37ff('0x32')]({'UserId':_0xf78c58['body'][_0x37ff('0x59')],'read1stAt':_[_0x37ff('0x5e')](_0x4b867e['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x37ff('0x1e')](function(_0x54f609){if(_0x54f609){_0x2ad4e2[_0x37ff('0x5f')]=_0x54f609[_0x37ff('0x5b')]({'plain':!![]});interaction_log[_0x37ff('0x1f')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf78c58['user']['id'],_0xf78c58[_0x37ff('0x5a')][_0x37ff('0x35')],_0xf78c58[_0x37ff('0x5a')]['role'],_0x2ad4e2[_0x37ff('0x5f')]['id'],_0xf78c58['body']?JSON['stringify'](_0xf78c58[_0x37ff('0x53')]):_0x37ff('0x60'));return respondWithRpcPromise(_0x37ff('0x61'),_0x37ff('0x62'),_0x2ad4e2);}return null;})[_0x37ff('0x1e')](function(_0x4073fb){var _0x5af472=_0x37ff('0x63')+_0x4073fb[_0x37ff('0x25')][_0x37ff('0x64')];return db['sequelize'][_0x37ff('0x3c')](_0x5af472,{'type':db[_0x37ff('0x65')][_0x37ff('0x66')][_0x37ff('0x67')],'raw':!![]})[_0x37ff('0x1e')](function(_0x36f3d3){return _0x36f3d3;});})['then'](function(_0x5f4ac4){if(_0x5f4ac4){_0x2ad4e2['message'][_0x37ff('0x68')]=_0x5f4ac4[0x0];if(!_0xf78c58['body']['UserId'])return;return db[_0x37ff('0x69')][_0x37ff('0x51')]({'where':{'id':_0xf78c58[_0x37ff('0x53')][_0x37ff('0x59')],'role':_0x37ff('0x6a')},'attributes':['id','name',_0x37ff('0x6b'),'email',_0x37ff('0x6c')],'raw':!![]});}return null;})[_0x37ff('0x1e')](function(_0x2cca28){if(!_0x2cca28)return null;_0x2ad4e2[_0x37ff('0x25')][_0x37ff('0x6a')]=_0x2cca28;return _0x2ad4e2;})[_0x37ff('0x1e')](function(_0x2eb84c){if(_0x2eb84c){if(_0xf78c58[_0x37ff('0x53')][_0x37ff('0x6d')]){_0x2ad4e2['message'][_0x37ff('0x6e')]=util[_0x37ff('0x6f')](_0x37ff('0x70'),_0xf78c58[_0x37ff('0x5a')][_0x37ff('0x35')]);_0x2ad4e2['message']['channel']=_0x2ad4e2[_0x37ff('0x71')];_0x2ad4e2[_0x37ff('0x25')][_0x37ff('0x72')]=_0x2ad4e2[_0x37ff('0x71')];_0x2ad4e2['message'][_0x37ff('0x73')]=_0x37ff('0x56');return respondWithRpcPromise('EventManager',_0x37ff('0x74'),{'event':_0x37ff('0x75'),'message':_0x2ad4e2[_0x37ff('0x25')]},client9002)[_0x37ff('0x1e')](function(){return _0x2ad4e2;});}return _0x2ad4e2;}return null;})[_0x37ff('0x1e')](respondWithResult(_0x505b96,null))[_0x37ff('0x27')](handleError(_0x505b96,null));};var interaction_log=require('../../config/logger')(_0x37ff('0x55'));exports[_0x37ff('0x31')]=function(_0x5a4e2e,_0x1809ee,_0x25267b){var _0x11f8b0={'agent':{},'channel':_0x37ff('0x57')};if(_0x5a4e2e[_0x37ff('0x53')]['id']){delete _0x5a4e2e[_0x37ff('0x53')]['id'];}_0x5a4e2e[_0x37ff('0x53')][_0x37ff('0x59')]=_0x5a4e2e[_0x37ff('0x53')][_0x37ff('0x59')]||_0x5a4e2e[_0x37ff('0x5a')]['id'];_0x11f8b0[_0x37ff('0x6a')]['id']=_0x5a4e2e['body'][_0x37ff('0x59')];return db[_0x37ff('0x4b')]['find']({'where':{'id':_0x5a4e2e['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1809ee,null))['then'](function(_0x5cc4b9){if(_0x5cc4b9){_0x11f8b0[_0x37ff('0x25')]=_0x5cc4b9['get']({'plain':!![]});return db['WhatsappInteraction'][_0x37ff('0x51')]({'where':{'id':_0x5cc4b9[_0x37ff('0x5d')]}});}return null;})['then'](handleEntityNotFound(_0x1809ee,null))[_0x37ff('0x1e')](function(_0x316a68){if(_0x316a68){_0x11f8b0['interaction']=_0x316a68[_0x37ff('0x5b')]({'plain':!![]});interaction_log['info'](_0x37ff('0x76'),_0x5a4e2e[_0x37ff('0x5a')]['id'],_0x5a4e2e['user'][_0x37ff('0x35')],_0x5a4e2e[_0x37ff('0x5a')][_0x37ff('0x77')],_0x11f8b0[_0x37ff('0x5f')]['id'],_0x5a4e2e[_0x37ff('0x53')]?JSON['stringify'](_0x5a4e2e['body']):'null');return respondWithRpcPromise(_0x37ff('0x78'),_0x37ff('0x79'),_0x11f8b0);}return null;})[_0x37ff('0x1e')](function(_0x3299fc){var _0x138cde=_0x37ff('0x63')+_0x3299fc[_0x37ff('0x25')][_0x37ff('0x64')];return db['sequelize'][_0x37ff('0x3c')](_0x138cde,{'type':db[_0x37ff('0x65')][_0x37ff('0x66')][_0x37ff('0x67')],'raw':!![]})[_0x37ff('0x1e')](function(_0x258398){return _0x258398;});})[_0x37ff('0x1e')](function(_0x4befaa){if(_0x4befaa){_0x11f8b0['message']['contact']=_0x4befaa[0x0];if(!_0x5a4e2e[_0x37ff('0x53')][_0x37ff('0x59')])return;return db[_0x37ff('0x69')][_0x37ff('0x51')]({'where':{'id':_0x5a4e2e[_0x37ff('0x53')][_0x37ff('0x59')],'role':_0x37ff('0x6a')},'attributes':['id',_0x37ff('0x35'),_0x37ff('0x6b'),_0x37ff('0x7a'),_0x37ff('0x6c')],'raw':!![]});}return null;})[_0x37ff('0x1e')](function(_0x458fa7){if(!_0x458fa7)return null;_0x11f8b0['message']['agent']=_0x458fa7;return _0x11f8b0;})[_0x37ff('0x1e')](function(_0x14884e){if(_0x14884e){_0x14884e[_0x37ff('0x25')]['interface']=util[_0x37ff('0x6f')](_0x37ff('0x70'),_0x5a4e2e['user'][_0x37ff('0x35')]);_0x14884e[_0x37ff('0x25')][_0x37ff('0x71')]=_0x11f8b0[_0x37ff('0x71')];_0x14884e['message']['motionChannel']=_0x11f8b0[_0x37ff('0x71')];_0x14884e[_0x37ff('0x25')][_0x37ff('0x73')]='reject';respondWithRpcPromise('EventManager',_0x37ff('0x74'),{'event':_0x37ff('0x7b'),'message':_0x14884e[_0x37ff('0x25')]},client9002);return _0x11f8b0;}return null;})[_0x37ff('0x1e')](respondWithResult(_0x1809ee,null))[_0x37ff('0x27')](handleError(_0x1809ee,null));};exports[_0x37ff('0x29')]=function(_0x36a51c,_0x1649ae,_0x5e5746){if(_0x36a51c[_0x37ff('0x53')]['id']){delete _0x36a51c['body']['id'];}var _0x5148d7;return db['WhatsappMessage'][_0x37ff('0x51')]({'where':{'id':_0x36a51c[_0x37ff('0x4f')]['id']}})[_0x37ff('0x1e')](handleEntityNotFound(_0x1649ae,null))[_0x37ff('0x1e')](function(_0xf473dc){if(_0xf473dc){_0x5148d7=_0xf473dc;return db[_0x37ff('0x7c')]['find']({'where':{'id':_0xf473dc[_0x37ff('0x7d')]}});}})['then'](handleEntityNotFound(_0x1649ae,null))[_0x37ff('0x1e')](function(_0x37ca81){if(_0x37ca81){logger[_0x37ff('0x7e')](_0x37ff('0x7f'),_0x37ff('0x29'),_0x37ff('0x80'),_0x37ca81[_0x37ff('0x3a')],util[_0x37ff('0x81')](_0x36a51c['body'],{'showHidden':![],'depth':null}));switch(_0x37ca81[_0x37ff('0x3a')]){case _0x37ff('0x82'):if(_0x36a51c['body']['MessageSid']&&_0x36a51c[_0x37ff('0x53')][_0x37ff('0x83')]===_0x5148d7[_0x37ff('0x84')]&&_0x36a51c[_0x37ff('0x53')][_0x37ff('0x85')]&&_0x36a51c[_0x37ff('0x53')][_0x37ff('0x85')]===_0x37ff('0x86')){return _0x5148d7['update']({'read':!![]});}else{logger[_0x37ff('0x24')](_0x37ff('0x87'),_0x37ff('0x29'),_0x37ff('0x82'),util[_0x37ff('0x81')](_0x36a51c[_0x37ff('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x5148d7;}})[_0x37ff('0x1e')](respondWithResult(_0x1649ae,null))[_0x37ff('0x27')](handleError(_0x1649ae,null));}; \ No newline at end of file +var _0xb20d=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','stack','send','index','WhatsappMessage','rawAttributes','fieldName','type','key','map','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','create','body','accept','whatsapp','read','readAt','format','UserId','user','agent','get','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','../../config/logger','whatsapp-interactions','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','Sequelize','contact','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2dca37,_0x1b93c3){var _0x50bcac=function(_0x392a36){while(--_0x392a36){_0x2dca37['push'](_0x2dca37['shift']());}};_0x50bcac(++_0x1b93c3);}(_0xb20d,0x1a5));var _0xdb20=function(_0x2cd6f5,_0x48e394){_0x2cd6f5=_0x2cd6f5-0x0;var _0x486641=_0xb20d[_0x2cd6f5];return _0x486641;};'use strict';var emlformat=require(_0xdb20('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb20('0x1'));var jsonpatch=require(_0xdb20('0x2'));var rp=require(_0xdb20('0x3'));var moment=require(_0xdb20('0x4'));var BPromise=require(_0xdb20('0x5'));var Mustache=require(_0xdb20('0x6'));var util=require(_0xdb20('0x7'));var path=require(_0xdb20('0x8'));var sox=require(_0xdb20('0x9'));var csv=require(_0xdb20('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb20('0xb'));var _=require(_0xdb20('0xc'));var squel=require('squel');var crypto=require(_0xdb20('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdb20('0xe'));var toCsv=require(_0xdb20('0xa'));var querystring=require(_0xdb20('0xf'));var Papa=require(_0xdb20('0x10'));var Redis=require('ioredis');var authService=require(_0xdb20('0x11'));var qs=require(_0xdb20('0x12'));var as=require(_0xdb20('0x13'));var hardwareService=require(_0xdb20('0x14'));var logger=require('../../config/logger')(_0xdb20('0x15'));var utils=require(_0xdb20('0x16'));var config=require(_0xdb20('0x17'));var licenseUtil=require(_0xdb20('0x18'));var db=require(_0xdb20('0x19'))['db'];config[_0xdb20('0x1a')]=_[_0xdb20('0x1b')](config['redis'],{'host':_0xdb20('0x1c'),'port':0x18eb});var socket=require(_0xdb20('0x1d'))(new Redis(config[_0xdb20('0x1a')]));require('./whatsappMessage.socket')[_0xdb20('0x1e')](socket);var jayson=require(_0xdb20('0x1f'));var client=jayson[_0xdb20('0x20')]['http']({'port':0x232c});var client9002=jayson[_0xdb20('0x20')][_0xdb20('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x236aff,_0x5cd2f4,_0x3ffa80,_0x6e8d0c){return new BPromise(function(_0x3525b2,_0x16d114){var _0x30af55=_0x6e8d0c||client;return _0x30af55[_0xdb20('0x22')](_0x236aff,_0x3ffa80)[_0xdb20('0x23')](function(_0x6b9ea){logger['info'](_0xdb20('0x24'),_0x5cd2f4,_0xdb20('0x25'));logger[_0xdb20('0x26')](_0xdb20('0x27'),_0x5cd2f4,_0xdb20('0x25'),JSON[_0xdb20('0x28')](_0x6b9ea));if(_0x6b9ea[_0xdb20('0x29')]){if(_0x6b9ea[_0xdb20('0x29')][_0xdb20('0x2a')]===0x1f4){logger[_0xdb20('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x5cd2f4,_0x6b9ea[_0xdb20('0x29')][_0xdb20('0x2b')]);return _0x16d114(_0x6b9ea[_0xdb20('0x29')]['message']);}logger[_0xdb20('0x29')](_0xdb20('0x24'),_0x5cd2f4,_0x6b9ea['error'][_0xdb20('0x2b')]);return _0x3525b2(_0x6b9ea[_0xdb20('0x29')][_0xdb20('0x2b')]);}else{logger[_0xdb20('0x2c')](_0xdb20('0x24'),_0x5cd2f4,'request\x20sent');_0x3525b2(_0x6b9ea[_0xdb20('0x2d')]['message']);}})[_0xdb20('0x2e')](function(_0x2012e1){logger[_0xdb20('0x29')](_0xdb20('0x24'),_0x5cd2f4,_0x2012e1);_0x16d114(_0x2012e1);});});}function respondWithStatusCode(_0x5e52b8,_0x51aad3){_0x51aad3=_0x51aad3||0xcc;return function(_0x43dfae){if(_0x43dfae){return _0x5e52b8[_0xdb20('0x2f')](_0x51aad3);}return _0x5e52b8[_0xdb20('0x30')](_0x51aad3)[_0xdb20('0x31')]();};}function respondWithResult(_0x33fab8,_0x392e77){_0x392e77=_0x392e77||0xc8;return function(_0x5bb387){if(_0x5bb387){return _0x33fab8['status'](_0x392e77)[_0xdb20('0x32')](_0x5bb387);}};}function respondWithFilteredResult(_0x49d616,_0x3c5458){return function(_0x1787f3){if(_0x1787f3){var _0x1a7994=typeof _0x3c5458[_0xdb20('0x33')]===_0xdb20('0x34')&&typeof _0x3c5458[_0xdb20('0x35')]==='undefined';var _0x415e31=_0x1787f3[_0xdb20('0x36')];var _0x424b40=_0x1a7994?0x0:_0x3c5458[_0xdb20('0x33')];var _0x535e80=_0x1a7994?_0x1787f3[_0xdb20('0x36')]:_0x3c5458[_0xdb20('0x33')]+_0x3c5458[_0xdb20('0x35')];var _0x4ba368;if(_0x535e80>=_0x415e31){_0x535e80=_0x415e31;_0x4ba368=0xc8;}else{_0x4ba368=0xce;}_0x49d616[_0xdb20('0x30')](_0x4ba368);return _0x49d616[_0xdb20('0x37')](_0xdb20('0x38'),_0x424b40+'-'+_0x535e80+'/'+_0x415e31)[_0xdb20('0x32')](_0x1787f3);}return null;};}function patchUpdates(_0x1594d1){return function(_0x2231e7){try{jsonpatch[_0xdb20('0x39')](_0x2231e7,_0x1594d1,!![]);}catch(_0x116979){return BPromise[_0xdb20('0x3a')](_0x116979);}return _0x2231e7['save']();};}function saveUpdates(_0x5d0d0e,_0x4b27c2){return function(_0x34de0e){if(_0x34de0e){return _0x34de0e[_0xdb20('0x3b')](_0x5d0d0e)[_0xdb20('0x23')](function(_0x81c1d9){return _0x81c1d9;});}return null;};}function removeEntity(_0x4b9e4d,_0x2a6ee1){return function(_0x321ac8){if(_0x321ac8){return _0x321ac8[_0xdb20('0x3c')]()[_0xdb20('0x23')](function(){_0x4b9e4d[_0xdb20('0x30')](0xcc)[_0xdb20('0x31')]();});}};}function handleEntityNotFound(_0x46fdaa,_0x561a0d){return function(_0xf75aa0){if(!_0xf75aa0){_0x46fdaa[_0xdb20('0x2f')](0x194);}return _0xf75aa0;};}function handleError(_0x187156,_0x158b57){_0x158b57=_0x158b57||0x1f4;return function(_0xcabc7c){logger[_0xdb20('0x29')](_0xcabc7c[_0xdb20('0x3d')]);if(_0xcabc7c['name']){delete _0xcabc7c['name'];}_0x187156[_0xdb20('0x30')](_0x158b57)[_0xdb20('0x3e')](_0xcabc7c);};}exports[_0xdb20('0x3f')]=function(_0x1cac65,_0x29ee01){var _0x52c654={},_0x595751={},_0x4955ce={'count':0x0,'rows':[]};var _0x45fed4=_['map'](db[_0xdb20('0x40')][_0xdb20('0x41')],function(_0xf4e491){return{'name':_0xf4e491[_0xdb20('0x42')],'type':_0xf4e491[_0xdb20('0x43')][_0xdb20('0x44')]};});_0x595751['model']=_[_0xdb20('0x45')](_0x45fed4,_0xdb20('0x46'));_0x595751[_0xdb20('0x47')]=_[_0xdb20('0x48')](_0x1cac65[_0xdb20('0x47')]);_0x595751['filters']=_[_0xdb20('0x49')](_0x595751[_0xdb20('0x4a')],_0x595751[_0xdb20('0x47')]);_0x52c654[_0xdb20('0x4b')]=_[_0xdb20('0x49')](_0x595751[_0xdb20('0x4a')],qs[_0xdb20('0x4c')](_0x1cac65[_0xdb20('0x47')][_0xdb20('0x4c')]));_0x52c654[_0xdb20('0x4b')]=_0x52c654['attributes'][_0xdb20('0x4d')]?_0x52c654[_0xdb20('0x4b')]:_0x595751['model'];if(!_0x1cac65[_0xdb20('0x47')][_0xdb20('0x4e')](_0xdb20('0x4f'))){_0x52c654['limit']=qs[_0xdb20('0x35')](_0x1cac65[_0xdb20('0x47')][_0xdb20('0x35')]);_0x52c654[_0xdb20('0x33')]=qs[_0xdb20('0x33')](_0x1cac65[_0xdb20('0x47')][_0xdb20('0x33')]);}_0x52c654[_0xdb20('0x50')]=qs[_0xdb20('0x51')](_0x1cac65['query'][_0xdb20('0x51')]);_0x52c654[_0xdb20('0x52')]=qs[_0xdb20('0x53')](_[_0xdb20('0x54')](_0x1cac65[_0xdb20('0x47')],_0x595751[_0xdb20('0x53')]),_0x45fed4);if(_0x1cac65[_0xdb20('0x47')][_0xdb20('0x55')]){_0x52c654[_0xdb20('0x52')]=_[_0xdb20('0x56')](_0x52c654[_0xdb20('0x52')],{'$or':_[_0xdb20('0x45')](_0x45fed4,function(_0x173618){if(_0x173618['type']!==_0xdb20('0x57')){var _0x2ac143={};_0x2ac143[_0x173618[_0xdb20('0x46')]]={'$like':'%'+_0x1cac65[_0xdb20('0x47')][_0xdb20('0x55')]+'%'};return _0x2ac143;}})});}_0x52c654=_[_0xdb20('0x56')]({},_0x52c654,_0x1cac65[_0xdb20('0x58')]);var _0x1b7584={'where':_0x52c654['where']};return db[_0xdb20('0x40')][_0xdb20('0x36')](_0x1b7584)[_0xdb20('0x23')](function(_0x1dad26){_0x4955ce['count']=_0x1dad26;if(_0x1cac65['query'][_0xdb20('0x59')]){_0x52c654['include']=[{'all':!![]}];}return db[_0xdb20('0x40')]['findAll'](_0x52c654);})[_0xdb20('0x23')](function(_0x389046){_0x4955ce[_0xdb20('0x5a')]=_0x389046;return _0x4955ce;})[_0xdb20('0x23')](respondWithFilteredResult(_0x29ee01,_0x52c654))['catch'](handleError(_0x29ee01,null));};exports[_0xdb20('0x5b')]=function(_0x52e94f,_0x3c3d9b){var _0x2bb6cb={'raw':!![],'where':{'id':_0x52e94f[_0xdb20('0x5c')]['id']}},_0x5f4f8f={};_0x5f4f8f['model']=_['keys'](db[_0xdb20('0x40')][_0xdb20('0x41')]);_0x5f4f8f[_0xdb20('0x47')]=_[_0xdb20('0x48')](_0x52e94f[_0xdb20('0x47')]);_0x5f4f8f[_0xdb20('0x53')]=_[_0xdb20('0x49')](_0x5f4f8f[_0xdb20('0x4a')],_0x5f4f8f[_0xdb20('0x47')]);_0x2bb6cb[_0xdb20('0x4b')]=_[_0xdb20('0x49')](_0x5f4f8f[_0xdb20('0x4a')],qs[_0xdb20('0x4c')](_0x52e94f[_0xdb20('0x47')][_0xdb20('0x4c')]));_0x2bb6cb[_0xdb20('0x4b')]=_0x2bb6cb[_0xdb20('0x4b')][_0xdb20('0x4d')]?_0x2bb6cb[_0xdb20('0x4b')]:_0x5f4f8f[_0xdb20('0x4a')];if(_0x52e94f[_0xdb20('0x47')][_0xdb20('0x59')]){_0x2bb6cb[_0xdb20('0x5d')]=[{'all':!![]}];}_0x2bb6cb=_[_0xdb20('0x56')]({},_0x2bb6cb,_0x52e94f[_0xdb20('0x58')]);return db[_0xdb20('0x40')][_0xdb20('0x5e')](_0x2bb6cb)[_0xdb20('0x23')](handleEntityNotFound(_0x3c3d9b,null))[_0xdb20('0x23')](respondWithResult(_0x3c3d9b,null))[_0xdb20('0x2e')](handleError(_0x3c3d9b,null));};exports['create']=function(_0x4ce81d,_0x5d0cc4){return db[_0xdb20('0x40')][_0xdb20('0x5f')](_0x4ce81d['body'],{})[_0xdb20('0x23')](respondWithResult(_0x5d0cc4,0xc9))[_0xdb20('0x2e')](handleError(_0x5d0cc4,null));};exports[_0xdb20('0x3b')]=function(_0x1cf86d,_0xe45e5c){if(_0x1cf86d[_0xdb20('0x60')]['id']){delete _0x1cf86d['body']['id'];}return db[_0xdb20('0x40')]['find']({'where':{'id':_0x1cf86d['params']['id']}})[_0xdb20('0x23')](handleEntityNotFound(_0xe45e5c,null))[_0xdb20('0x23')](saveUpdates(_0x1cf86d[_0xdb20('0x60')],null))['then'](respondWithResult(_0xe45e5c,null))[_0xdb20('0x2e')](handleError(_0xe45e5c,null));};exports[_0xdb20('0x3c')]=function(_0x2e0ee8,_0x4ab039){return db['WhatsappMessage'][_0xdb20('0x5e')]({'where':{'id':_0x2e0ee8[_0xdb20('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4ab039,null))['then'](removeEntity(_0x4ab039,null))[_0xdb20('0x2e')](handleError(_0x4ab039,null));};exports['describe']=function(_0x5ce535,_0x5a984d){return db[_0xdb20('0x40')]['describe']()[_0xdb20('0x23')](respondWithResult(_0x5a984d,null))[_0xdb20('0x2e')](handleError(_0x5a984d,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0xdb20('0x61')]=function(_0x24e9fc,_0x12e355,_0xd87e00){var _0x2dc5d5={'agent':{},'channel':_0xdb20('0x62')};if(_0x24e9fc[_0xdb20('0x60')]['id']){delete _0x24e9fc['body']['id'];}_0x24e9fc['body'][_0xdb20('0x63')]=!![];_0x24e9fc[_0xdb20('0x60')][_0xdb20('0x64')]=moment()[_0xdb20('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x24e9fc['body'][_0xdb20('0x66')]=_0x24e9fc['body'][_0xdb20('0x66')]||_0x24e9fc[_0xdb20('0x67')]['id'];_0x2dc5d5[_0xdb20('0x68')]['id']=_0x24e9fc['body'][_0xdb20('0x66')];return db['WhatsappMessage'][_0xdb20('0x5e')]({'where':{'id':_0x24e9fc[_0xdb20('0x5c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x12e355,null))['then'](saveUpdates(_0x24e9fc[_0xdb20('0x60')],null))[_0xdb20('0x23')](function(_0x2a1066){if(_0x2a1066){_0x2dc5d5['message']=_0x2a1066[_0xdb20('0x69')]({'plain':!![]});return db['WhatsappInteraction'][_0xdb20('0x5e')]({'where':{'id':_0x2a1066[_0xdb20('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x12e355,null))[_0xdb20('0x23')](function(_0x2b23a1){if(_0x2b23a1){return _0x2b23a1['update']({'UserId':_0x24e9fc[_0xdb20('0x60')]['UserId'],'read1stAt':_[_0xdb20('0x6b')](_0x2b23a1[_0xdb20('0x6c')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdb20('0x23')](function(_0x3aff74){if(_0x3aff74){_0x2dc5d5[_0xdb20('0x6d')]=_0x3aff74[_0xdb20('0x69')]({'plain':!![]});interaction_log[_0xdb20('0x2c')](_0xdb20('0x6e'),_0x24e9fc['user']['id'],_0x24e9fc[_0xdb20('0x67')][_0xdb20('0x46')],_0x24e9fc['user']['role'],_0x2dc5d5[_0xdb20('0x6d')]['id'],_0x24e9fc['body']?JSON[_0xdb20('0x28')](_0x24e9fc[_0xdb20('0x60')]):_0xdb20('0x6f'));return respondWithRpcPromise('AcceptMessage',_0xdb20('0x70'),_0x2dc5d5);}return null;})[_0xdb20('0x23')](function(_0x1a522d){var _0x1a5f23=_0xdb20('0x71')+_0x1a522d['message'][_0xdb20('0x72')];return db[_0xdb20('0x73')][_0xdb20('0x47')](_0x1a5f23,{'type':db['Sequelize'][_0xdb20('0x74')][_0xdb20('0x75')],'raw':!![]})['then'](function(_0x21e3d1){return _0x21e3d1;});})[_0xdb20('0x23')](function(_0x570051){if(_0x570051){_0x2dc5d5[_0xdb20('0x2b')]['contact']=_0x570051[0x0];if(!_0x24e9fc[_0xdb20('0x60')][_0xdb20('0x66')])return;return db[_0xdb20('0x76')][_0xdb20('0x5e')]({'where':{'id':_0x24e9fc['body']['UserId'],'role':_0xdb20('0x68')},'attributes':['id',_0xdb20('0x46'),_0xdb20('0x77'),_0xdb20('0x78'),_0xdb20('0x79')],'raw':!![]});}return null;})[_0xdb20('0x23')](function(_0x59e941){if(!_0x59e941)return null;_0x2dc5d5[_0xdb20('0x2b')]['agent']=_0x59e941;return _0x2dc5d5;})[_0xdb20('0x23')](function(_0x320f1a){if(_0x320f1a){if(_0x24e9fc['body'][_0xdb20('0x7a')]){_0x2dc5d5[_0xdb20('0x2b')][_0xdb20('0x7b')]=util['format'](_0xdb20('0x7c'),_0x24e9fc[_0xdb20('0x67')]['name']);_0x2dc5d5[_0xdb20('0x2b')][_0xdb20('0x7d')]=_0x2dc5d5[_0xdb20('0x7d')];_0x2dc5d5[_0xdb20('0x2b')][_0xdb20('0x7e')]=_0x2dc5d5[_0xdb20('0x7d')];_0x2dc5d5['message'][_0xdb20('0x7f')]=_0xdb20('0x61');return respondWithRpcPromise(_0xdb20('0x80'),_0xdb20('0x80'),{'event':_0xdb20('0x81'),'message':_0x2dc5d5[_0xdb20('0x2b')]},client9002)[_0xdb20('0x23')](function(){return _0x2dc5d5;});}return _0x2dc5d5;}return null;})[_0xdb20('0x23')](respondWithResult(_0x12e355,null))[_0xdb20('0x2e')](handleError(_0x12e355,null));};var interaction_log=require(_0xdb20('0x82'))(_0xdb20('0x83'));exports[_0xdb20('0x3a')]=function(_0x530627,_0x4cc7dd,_0x9b10b3){var _0x2233ad={'agent':{},'channel':_0xdb20('0x62')};if(_0x530627['body']['id']){delete _0x530627['body']['id'];}_0x530627['body'][_0xdb20('0x66')]=_0x530627['body'][_0xdb20('0x66')]||_0x530627[_0xdb20('0x67')]['id'];_0x2233ad['agent']['id']=_0x530627[_0xdb20('0x60')][_0xdb20('0x66')];return db[_0xdb20('0x40')][_0xdb20('0x5e')]({'where':{'id':_0x530627[_0xdb20('0x5c')]['id'],'UserId':null}})[_0xdb20('0x23')](handleEntityNotFound(_0x4cc7dd,null))[_0xdb20('0x23')](function(_0xbaf0de){if(_0xbaf0de){_0x2233ad[_0xdb20('0x2b')]=_0xbaf0de[_0xdb20('0x69')]({'plain':!![]});return db[_0xdb20('0x84')][_0xdb20('0x5e')]({'where':{'id':_0xbaf0de[_0xdb20('0x6a')]}});}return null;})[_0xdb20('0x23')](handleEntityNotFound(_0x4cc7dd,null))[_0xdb20('0x23')](function(_0x57a1ec){if(_0x57a1ec){_0x2233ad['interaction']=_0x57a1ec[_0xdb20('0x69')]({'plain':!![]});interaction_log[_0xdb20('0x2c')](_0xdb20('0x85'),_0x530627[_0xdb20('0x67')]['id'],_0x530627[_0xdb20('0x67')][_0xdb20('0x46')],_0x530627[_0xdb20('0x67')][_0xdb20('0x86')],_0x2233ad[_0xdb20('0x6d')]['id'],_0x530627['body']?JSON[_0xdb20('0x28')](_0x530627[_0xdb20('0x60')]):_0xdb20('0x6f'));return respondWithRpcPromise(_0xdb20('0x87'),'rejectMessage',_0x2233ad);}return null;})[_0xdb20('0x23')](function(_0x45d599){var _0x5ced89='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x45d599[_0xdb20('0x2b')][_0xdb20('0x72')];return db[_0xdb20('0x73')][_0xdb20('0x47')](_0x5ced89,{'type':db[_0xdb20('0x88')][_0xdb20('0x74')][_0xdb20('0x75')],'raw':!![]})[_0xdb20('0x23')](function(_0x2f3cb5){return _0x2f3cb5;});})[_0xdb20('0x23')](function(_0x8e0307){if(_0x8e0307){_0x2233ad[_0xdb20('0x2b')][_0xdb20('0x89')]=_0x8e0307[0x0];if(!_0x530627[_0xdb20('0x60')][_0xdb20('0x66')])return;return db['User'][_0xdb20('0x5e')]({'where':{'id':_0x530627[_0xdb20('0x60')][_0xdb20('0x66')],'role':_0xdb20('0x68')},'attributes':['id',_0xdb20('0x46'),'fullname','email',_0xdb20('0x79')],'raw':!![]});}return null;})[_0xdb20('0x23')](function(_0x1e4af1){if(!_0x1e4af1)return null;_0x2233ad[_0xdb20('0x2b')][_0xdb20('0x68')]=_0x1e4af1;return _0x2233ad;})[_0xdb20('0x23')](function(_0xea8c34){if(_0xea8c34){_0xea8c34[_0xdb20('0x2b')][_0xdb20('0x7b')]=util[_0xdb20('0x65')](_0xdb20('0x7c'),_0x530627[_0xdb20('0x67')]['name']);_0xea8c34[_0xdb20('0x2b')][_0xdb20('0x7d')]=_0x2233ad['channel'];_0xea8c34[_0xdb20('0x2b')]['motionChannel']=_0x2233ad[_0xdb20('0x7d')];_0xea8c34[_0xdb20('0x2b')][_0xdb20('0x7f')]=_0xdb20('0x3a');respondWithRpcPromise(_0xdb20('0x80'),_0xdb20('0x80'),{'event':_0xdb20('0x8a'),'message':_0xea8c34['message']},client9002);return _0x2233ad;}return null;})['then'](respondWithResult(_0x4cc7dd,null))[_0xdb20('0x2e')](handleError(_0x4cc7dd,null));};exports[_0xdb20('0x30')]=function(_0x3a43c6,_0x2c6d43,_0x2a29f2){if(_0x3a43c6[_0xdb20('0x60')]['id']){delete _0x3a43c6[_0xdb20('0x60')]['id'];}var _0x7656f5;return db[_0xdb20('0x40')][_0xdb20('0x5e')]({'where':{'id':_0x3a43c6[_0xdb20('0x5c')]['id']}})[_0xdb20('0x23')](handleEntityNotFound(_0x2c6d43,null))[_0xdb20('0x23')](function(_0x2bb96f){if(_0x2bb96f){_0x7656f5=_0x2bb96f;return db['WhatsappAccount'][_0xdb20('0x5e')]({'where':{'id':_0x2bb96f[_0xdb20('0x8b')]}});}})[_0xdb20('0x23')](handleEntityNotFound(_0x2c6d43,null))[_0xdb20('0x23')](function(_0xca19cc){if(_0xca19cc){logger[_0xdb20('0x26')](_0xdb20('0x8c'),'status',_0xdb20('0x8d'),_0xca19cc[_0xdb20('0x43')],util[_0xdb20('0x8e')](_0x3a43c6[_0xdb20('0x60')],{'showHidden':![],'depth':null}));switch(_0xca19cc[_0xdb20('0x43')]){case _0xdb20('0x8f'):if(_0x3a43c6[_0xdb20('0x60')]['MessageSid']&&_0x3a43c6[_0xdb20('0x60')][_0xdb20('0x90')]===_0x7656f5['messageId']&&_0x3a43c6[_0xdb20('0x60')][_0xdb20('0x91')]&&_0x3a43c6[_0xdb20('0x60')][_0xdb20('0x91')]===_0xdb20('0x63')){return _0x7656f5[_0xdb20('0x3b')]({'read':!![]});}else{logger[_0xdb20('0x29')](_0xdb20('0x92'),_0xdb20('0x30'),_0xdb20('0x8f'),util[_0xdb20('0x8e')](_0x3a43c6[_0xdb20('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x7656f5;}})[_0xdb20('0x23')](respondWithResult(_0x2c6d43,null))[_0xdb20('0x2e')](handleError(_0x2c6d43,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 3ed24ff..3a83980 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ba2=['remove','emit','hasOwnProperty','exports','events','WhatsappMessage','save','update'];(function(_0x590637,_0x825024){var _0x3f249c=function(_0x48f96d){while(--_0x48f96d){_0x590637['push'](_0x590637['shift']());}};_0x3f249c(++_0x825024);}(_0x1ba2,0xb4));var _0x21ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1ba2[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x21ba('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0x21ba('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x21ba('0x2'),'afterUpdate':_0x21ba('0x3'),'afterDestroy':_0x21ba('0x4')};function emitEvent(_0xface0a){return function(_0x3661dd,_0x527ad5,_0x36e207){WhatsappMessageEvents[_0x21ba('0x5')](_0xface0a+':'+_0x3661dd['id'],_0x3661dd);WhatsappMessageEvents['emit'](_0xface0a,_0x3661dd);_0x36e207(null);};}for(var e in events){if(events[_0x21ba('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x21ba('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x1c7c=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x7b8cae,_0xd3983f){var _0x46ae49=function(_0x3872f1){while(--_0x3872f1){_0x7b8cae['push'](_0x7b8cae['shift']());}};_0x46ae49(++_0xd3983f);}(_0x1c7c,0x164));var _0xc1c7=function(_0x2ebdc5,_0x323f93){_0x2ebdc5=_0x2ebdc5-0x0;var _0x10f41a=_0x1c7c[_0x2ebdc5];return _0x10f41a;};'use strict';var EventEmitter=require(_0xc1c7('0x0'));var WhatsappMessage=require(_0xc1c7('0x1'))['db'][_0xc1c7('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xc1c7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc1c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3cb551){return function(_0x20dad3,_0xbb9da0,_0x2a0383){WhatsappMessageEvents[_0xc1c7('0x5')](_0x3cb551+':'+_0x20dad3['id'],_0x20dad3);WhatsappMessageEvents[_0xc1c7('0x5')](_0x3cb551,_0x20dad3);_0x2a0383(null);};}for(var e in events){if(events[_0xc1c7('0x6')](e)){var event=events[e];WhatsappMessage[_0xc1c7('0x7')](e,emitEvent(event));}}module[_0xc1c7('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index f4f0372..b8b6123 100644 --- a/server/api/whatsappMessage/whatsappMessage.model.js +++ b/server/api/whatsappMessage/whatsappMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c57=['get','toLowerCase','secret','WhatsappInteractionId','then','update','createdAt','catch','out','WhatsappAccount','find','twilio','accountSid','authToken','phone','create','whatsapp:','/api/whatsapp/messages/','token','sid','error','afterCreate','inspect','sinch','/whatsapp/v1/','/messages/','Bearer\x20','application/json','statuses','message_id','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','node-fetch','path','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','body','models'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8c57,0x1c7));var _0x78c5=function(_0x41fef3,_0x4c9eff){_0x41fef3=_0x41fef3-0x0;var _0x8ee292=_0x8c57[_0x41fef3];return _0x8ee292;};'use strict';var _=require(_0x78c5('0x0'));var util=require(_0x78c5('0x1'));var logger=require(_0x78c5('0x2'))(_0x78c5('0x3'));var moment=require('moment');var BPromise=require(_0x78c5('0x4'));var rp=require('request-promise');var fetch=require(_0x78c5('0x5'));var fs=require('fs');var path=require(_0x78c5('0x6'));var rimraf=require('rimraf');var config=require(_0x78c5('0x7'));var attributes=require(_0x78c5('0x8'));module['exports']=function(_0xb8beb,_0x4d0c3e){return _0xb8beb[_0x78c5('0x9')](_0x78c5('0xa'),attributes,{'tableName':_0x78c5('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x78c5('0xc')]},{'name':'fti_whatsapp_messages','fields':[_0x78c5('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29233c,_0x449a22,_0x50fe47){var _0x41e64a=_0xb8beb[_0x78c5('0xe')];var _0x424166=_0x29233c[_0x78c5('0xf')]({'plain':!![]});if(_0x424166['direction'][_0x78c5('0x10')]()==='in'||_0x424166['direction'][_0x78c5('0x10')]()==='out'&&!_0x424166[_0x78c5('0x11')]&&!_['isNil'](_0x424166['UserId'])){_0x41e64a['WhatsappInteraction']['findOne']({'where':{'id':_0x424166[_0x78c5('0x12')]}})[_0x78c5('0x13')](function(_0x24a84e){if(_0x24a84e){_0x24a84e[_0x78c5('0x14')]({'lastMsgAt':_0x424166[_0x78c5('0x15')],'lastMsgDirection':_0x424166['direction'][_0x78c5('0x10')]()});}})[_0x78c5('0x16')](function(_0x1de971){console['error'](_0x1de971);});}if(_0x424166['direction']===_0x78c5('0x17')&&!_0x424166[_0x78c5('0x11')]){var _0x119678;_0x41e64a[_0x78c5('0x18')][_0x78c5('0x19')]({'where':{'id':_0x424166['WhatsappAccountId']},'raw':!![]})[_0x78c5('0x13')](function(_0x6a3e35){_0x119678=_0x6a3e35;if(_0x119678&&_0x119678['type']){switch(_0x119678['type']){case _0x78c5('0x1a'):var _0x4b0e97=require('twilio');if(_0x119678[_0x78c5('0x1b')]&&_0x119678[_0x78c5('0x1c')]&&_0x119678[_0x78c5('0x1d')]){var _0x18d572=new _0x4b0e97(_0x119678[_0x78c5('0x1b')],_0x119678[_0x78c5('0x1c')]);_0x18d572['messages'][_0x78c5('0x1e')]({'body':_0x424166['body'],'to':_0x78c5('0x1f')+_0x424166[_0x78c5('0x1d')],'from':_0x78c5('0x1f')+_0x119678['phone'],'statusCallback':_0x119678['remote']+_0x78c5('0x20')+_0x424166['id']+'/status?token='+_0x119678[_0x78c5('0x21')]})[_0x78c5('0x13')](function(_0x405460){if(_0x405460[_0x78c5('0x22')]){return _0x29233c[_0x78c5('0x14')]({'messageId':_0x405460[_0x78c5('0x22')]});}})[_0x78c5('0x16')](function(_0x8d000b){logger[_0x78c5('0x23')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x78c5('0x24'),'twilio',util[_0x78c5('0x25')](_0x8d000b,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x78c5('0x24'),_0x78c5('0x1a'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x78c5('0x26'):var _0x1ace23=_0x119678[_0x78c5('0x1b')];var _0x4139e9=_0x119678[_0x78c5('0x1c')];var _0x229508=_0x119678['baseUrl']+_0x78c5('0x27')+_0x1ace23+_0x78c5('0x28');var _0x6f4230={'to':[_0x424166[_0x78c5('0x1d')]],'message':{'type':'text','text':_0x424166['body']}};var _0x363381={'method':'POST','uri':_0x229508,'headers':{'Authorization':_0x78c5('0x29')+_0x4139e9,'Content-Type':_0x78c5('0x2a')},'body':_0x6f4230,'json':!![]};rp(_0x363381)[_0x78c5('0x13')](function(_0x2c9e1c){if(_0x2c9e1c[_0x78c5('0x2b')][0x0]['message_id']){return _0x29233c[_0x78c5('0x14')]({'messageId':_0x2c9e1c[_0x78c5('0x2b')][0x0][_0x78c5('0x2c')]});}})[_0x78c5('0x16')](function(_0x2d9d3a){logger['err']('WhatsappMessage,\x20%s',_0x2d9d3a);});break;}}})['finally'](function(){_0x50fe47();});}else{_0x50fe47();}}},'charset':_0x78c5('0x2d'),'collate':_0x78c5('0x2e')});}; \ No newline at end of file +var _0x1989=['toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','createdAt','catch','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','token','sid','update','inspect','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','text','Bearer\x20','application/json','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','direction'];(function(_0x3725ee,_0x543bd9){var _0x399c71=function(_0xaf9400){while(--_0xaf9400){_0x3725ee['push'](_0x3725ee['shift']());}};_0x399c71(++_0x543bd9);}(_0x1989,0x119));var _0x9198=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1989[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9198('0x0'));var util=require(_0x9198('0x1'));var logger=require(_0x9198('0x2'))(_0x9198('0x3'));var moment=require(_0x9198('0x4'));var BPromise=require(_0x9198('0x5'));var rp=require(_0x9198('0x6'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x9198('0x7'));var rimraf=require('rimraf');var config=require(_0x9198('0x8'));var attributes=require(_0x9198('0x9'));module[_0x9198('0xa')]=function(_0x80540a,_0x495070){return _0x80540a['define'](_0x9198('0xb'),attributes,{'tableName':_0x9198('0xc'),'paranoid':![],'indexes':[{'name':_0x9198('0xd'),'fields':[_0x9198('0xd')]},{'name':_0x9198('0xe'),'fields':[_0x9198('0xf')],'type':_0x9198('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xfa3e80,_0x194fe1,_0x15d5ef){var _0x42f556=_0x80540a[_0x9198('0x11')];var _0x3d023a=_0xfa3e80['get']({'plain':!![]});if(_0x3d023a[_0x9198('0x12')]['toLowerCase']()==='in'||_0x3d023a['direction'][_0x9198('0x13')]()===_0x9198('0x14')&&!_0x3d023a[_0x9198('0x15')]&&!_[_0x9198('0x16')](_0x3d023a[_0x9198('0x17')])){_0x42f556[_0x9198('0x18')]['findOne']({'where':{'id':_0x3d023a[_0x9198('0x19')]}})[_0x9198('0x1a')](function(_0x10f8d2){if(_0x10f8d2){_0x10f8d2['update']({'lastMsgAt':_0x3d023a[_0x9198('0x1b')],'lastMsgDirection':_0x3d023a['direction'][_0x9198('0x13')]()});}})[_0x9198('0x1c')](function(_0x575cbb){console['error'](_0x575cbb);});}if(_0x3d023a[_0x9198('0x12')]===_0x9198('0x14')&&!_0x3d023a[_0x9198('0x15')]){var _0x407be8;_0x42f556[_0x9198('0x1d')][_0x9198('0x1e')]({'where':{'id':_0x3d023a[_0x9198('0x1f')]},'raw':!![]})[_0x9198('0x1a')](function(_0x23acd2){_0x407be8=_0x23acd2;if(_0x407be8&&_0x407be8[_0x9198('0x20')]){switch(_0x407be8[_0x9198('0x20')]){case _0x9198('0x21'):var _0x829f1b=require(_0x9198('0x21'));if(_0x407be8[_0x9198('0x22')]&&_0x407be8['authToken']&&_0x407be8[_0x9198('0x23')]){var _0x4f5a6e=new _0x829f1b(_0x407be8['accountSid'],_0x407be8['authToken']);_0x4f5a6e[_0x9198('0x24')][_0x9198('0x25')]({'body':_0x3d023a[_0x9198('0xf')],'to':_0x9198('0x26')+_0x3d023a['phone'],'from':_0x9198('0x26')+_0x407be8[_0x9198('0x23')],'statusCallback':_0x407be8[_0x9198('0x27')]+_0x9198('0x28')+_0x3d023a['id']+'/status?token='+_0x407be8[_0x9198('0x29')]})[_0x9198('0x1a')](function(_0x4ceb2c){if(_0x4ceb2c[_0x9198('0x2a')]){return _0xfa3e80[_0x9198('0x2b')]({'messageId':_0x4ceb2c[_0x9198('0x2a')]});}})[_0x9198('0x1c')](function(_0x25633c){logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x9198('0x21'),util[_0x9198('0x2c')](_0x25633c,{'showHidden':![],'depth':null}));});}else{logger[_0x9198('0x2d')](_0x9198('0x2e'),_0x9198('0x2f'),_0x9198('0x21'),_0x9198('0x30'));}break;case _0x9198('0x31'):var _0x4c601e=_0x407be8[_0x9198('0x22')];var _0x59aeab=_0x407be8['authToken'];var _0x123b22=_0x407be8[_0x9198('0x32')]+_0x9198('0x33')+_0x4c601e+'/messages/';var _0x504405={'to':[_0x3d023a[_0x9198('0x23')]],'message':{'type':_0x9198('0x34'),'text':_0x3d023a[_0x9198('0xf')]}};var _0x462661={'method':'POST','uri':_0x123b22,'headers':{'Authorization':_0x9198('0x35')+_0x59aeab,'Content-Type':_0x9198('0x36')},'body':_0x504405,'json':!![]};rp(_0x462661)[_0x9198('0x1a')](function(_0x3ef6f8){if(_0x3ef6f8['statuses'][0x0]['message_id']){return _0xfa3e80[_0x9198('0x2b')]({'messageId':_0x3ef6f8[_0x9198('0x37')][0x0][_0x9198('0x38')]});}})[_0x9198('0x1c')](function(_0x4f79ce){logger['err'](_0x9198('0x39'),_0x4f79ce);});break;}}})[_0x9198('0x3a')](function(){_0x15d5ef();});}else{_0x15d5ef();}}},'charset':'utf8mb4','collate':_0x9198('0x3b')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 95aa0bd..fc6fbfa 100644 --- a/server/api/whatsappMessage/whatsappMessage.rpc.js +++ b/server/api/whatsappMessage/whatsappMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd679=['redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x20d410,_0x4f539d){var _0x29f679=function(_0x35f3a3){while(--_0x35f3a3){_0x20d410['push'](_0x20d410['shift']());}};_0x29f679(++_0x4f539d);}(_0xd679,0x80));var _0x9d67=function(_0x4506c6,_0x4fa3dd){_0x4506c6=_0x4506c6-0x0;var _0x54ae83=_0xd679[_0x4506c6];return _0x54ae83;};'use strict';var _=require(_0x9d67('0x0'));var util=require(_0x9d67('0x1'));var moment=require(_0x9d67('0x2'));var BPromise=require(_0x9d67('0x3'));var rs=require(_0x9d67('0x4'));var fs=require('fs');var Redis=require(_0x9d67('0x5'));var db=require(_0x9d67('0x6'))['db'];var utils=require(_0x9d67('0x7'));var logger=require('../../config/logger')(_0x9d67('0x8'));var config=require('../../config/environment');var jayson=require(_0x9d67('0x9'));var client=jayson[_0x9d67('0xa')][_0x9d67('0xb')]({'port':0x232a});config[_0x9d67('0xc')]=_[_0x9d67('0xd')](config[_0x9d67('0xc')],{'host':_0x9d67('0xe'),'port':0x18eb});var socket=require(_0x9d67('0xf'))(new Redis(config[_0x9d67('0xc')]));require(_0x9d67('0x10'))[_0x9d67('0x11')](socket);function respondWithRpcPromise(_0x2f0b66,_0x1b30dd,_0x6e2d9){return new BPromise(function(_0xc1670c,_0x33a474){return client[_0x9d67('0x12')](_0x2f0b66,_0x6e2d9)[_0x9d67('0x13')](function(_0x33a159){logger[_0x9d67('0x14')](_0x9d67('0x15'),_0x1b30dd,_0x9d67('0x16'));logger['debug'](_0x9d67('0x17'),_0x1b30dd,'request\x20sent',JSON[_0x9d67('0x18')](_0x33a159));if(_0x33a159[_0x9d67('0x19')]){if(_0x33a159[_0x9d67('0x19')]['code']===0x1f4){logger[_0x9d67('0x19')](_0x9d67('0x15'),_0x1b30dd,_0x33a159[_0x9d67('0x19')][_0x9d67('0x1a')]);return _0x33a474(_0x33a159[_0x9d67('0x19')][_0x9d67('0x1a')]);}logger[_0x9d67('0x19')]('WhatsappMessage,\x20%s,\x20%s',_0x1b30dd,_0x33a159[_0x9d67('0x19')][_0x9d67('0x1a')]);return _0xc1670c(_0x33a159['error']['message']);}else{logger['info'](_0x9d67('0x15'),_0x1b30dd,_0x9d67('0x16'));_0xc1670c(_0x33a159[_0x9d67('0x1b')][_0x9d67('0x1a')]);}})[_0x9d67('0x1c')](function(_0x1dbeb8){logger[_0x9d67('0x19')](_0x9d67('0x15'),_0x1b30dd,_0x1dbeb8);_0x33a474(_0x1dbeb8);});});}exports[_0x9d67('0x1d')]=function(_0x1c1740){var _0x15fe2c=this;return new Promise(function(_0x3f8a87,_0x40cd32){return db[_0x9d67('0x1e')]['create'](_0x1c1740[_0x9d67('0x1f')],{'raw':_0x1c1740[_0x9d67('0x20')]?_0x1c1740[_0x9d67('0x20')][_0x9d67('0x21')]===undefined?!![]:![]:!![]})[_0x9d67('0x13')](function(_0x26db7a){logger['info'](_0x9d67('0x1d'),_0x1c1740);logger[_0x9d67('0x22')]('CreateWhatsappMessage',_0x1c1740,JSON[_0x9d67('0x18')](_0x26db7a));_0x3f8a87(_0x26db7a);})[_0x9d67('0x1c')](function(_0x5242ae){logger[_0x9d67('0x19')](_0x9d67('0x1d'),_0x5242ae['message'],_0x1c1740);_0x40cd32(_0x15fe2c[_0x9d67('0x19')](0x1f4,_0x5242ae['message']));});});}; \ No newline at end of file +var _0x4cfd=['localhost','socket.io-emitter','register','request','then','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','result','catch','CreateWhatsappMessage','create','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x380d16,_0xdf0d31){var _0x5d5253=function(_0x7a25bc){while(--_0x7a25bc){_0x380d16['push'](_0x380d16['shift']());}};_0x5d5253(++_0xdf0d31);}(_0x4cfd,0x124));var _0xd4cf=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x4cfd[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0xd4cf('0x0'));var util=require(_0xd4cf('0x1'));var moment=require('moment');var BPromise=require(_0xd4cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd4cf('0x3'));var db=require(_0xd4cf('0x4'))['db'];var utils=require(_0xd4cf('0x5'));var logger=require(_0xd4cf('0x6'))(_0xd4cf('0x7'));var config=require(_0xd4cf('0x8'));var jayson=require(_0xd4cf('0x9'));var client=jayson[_0xd4cf('0xa')][_0xd4cf('0xb')]({'port':0x232a});config[_0xd4cf('0xc')]=_[_0xd4cf('0xd')](config['redis'],{'host':_0xd4cf('0xe'),'port':0x18eb});var socket=require(_0xd4cf('0xf'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0xd4cf('0x10')](socket);function respondWithRpcPromise(_0x5a9013,_0x30b382,_0x402eec){return new BPromise(function(_0x24d0f3,_0x5abe89){return client[_0xd4cf('0x11')](_0x5a9013,_0x402eec)[_0xd4cf('0x12')](function(_0x63c9df){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x30b382,_0xd4cf('0x13'));logger[_0xd4cf('0x14')](_0xd4cf('0x15'),_0x30b382,'request\x20sent',JSON[_0xd4cf('0x16')](_0x63c9df));if(_0x63c9df[_0xd4cf('0x17')]){if(_0x63c9df['error'][_0xd4cf('0x18')]===0x1f4){logger[_0xd4cf('0x17')](_0xd4cf('0x19'),_0x30b382,_0x63c9df['error']['message']);return _0x5abe89(_0x63c9df[_0xd4cf('0x17')][_0xd4cf('0x1a')]);}logger[_0xd4cf('0x17')](_0xd4cf('0x19'),_0x30b382,_0x63c9df[_0xd4cf('0x17')]['message']);return _0x24d0f3(_0x63c9df['error'][_0xd4cf('0x1a')]);}else{logger[_0xd4cf('0x1b')](_0xd4cf('0x19'),_0x30b382,_0xd4cf('0x13'));_0x24d0f3(_0x63c9df[_0xd4cf('0x1c')][_0xd4cf('0x1a')]);}})[_0xd4cf('0x1d')](function(_0x11cf49){logger[_0xd4cf('0x17')](_0xd4cf('0x19'),_0x30b382,_0x11cf49);_0x5abe89(_0x11cf49);});});}exports[_0xd4cf('0x1e')]=function(_0x2553a9){var _0x3ce0af=this;return new Promise(function(_0x192631,_0x32e756){return db['WhatsappMessage'][_0xd4cf('0x1f')](_0x2553a9['body'],{'raw':_0x2553a9[_0xd4cf('0x20')]?_0x2553a9[_0xd4cf('0x20')][_0xd4cf('0x21')]===undefined?!![]:![]:!![]})[_0xd4cf('0x12')](function(_0x442f8b){logger['info']('CreateWhatsappMessage',_0x2553a9);logger[_0xd4cf('0x14')](_0xd4cf('0x1e'),_0x2553a9,JSON[_0xd4cf('0x16')](_0x442f8b));_0x192631(_0x442f8b);})[_0xd4cf('0x1d')](function(_0x544526){logger['error'](_0xd4cf('0x1e'),_0x544526[_0xd4cf('0x1a')],_0x2553a9);_0x32e756(_0x3ce0af[_0xd4cf('0x17')](0x1f4,_0x544526[_0xd4cf('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index b6e4d6a..f55ca7c 100644 --- a/server/api/whatsappMessage/whatsappMessage.socket.js +++ b/server/api/whatsappMessage/whatsappMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb84f=['remove','update','emit','length','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x586f4a,_0xc85c68){var _0x56657c=function(_0x294ad2){while(--_0x294ad2){_0x586f4a['push'](_0x586f4a['shift']());}};_0x56657c(++_0xc85c68);}(_0xb84f,0x75));var _0xfb84=function(_0x34d2ce,_0x236e9a){_0x34d2ce=_0x34d2ce-0x0;var _0x1d7dd5=_0xb84f[_0x34d2ce];return _0x1d7dd5;};'use strict';var WhatsappMessageEvents=require(_0xfb84('0x0'));var events=[_0xfb84('0x1'),_0xfb84('0x2'),_0xfb84('0x3')];function createListener(_0x584969,_0x199045){return function(_0x13699d){_0x199045[_0xfb84('0x4')](_0x584969,_0x13699d);};}function removeListener(_0x3e0abe,_0x287229){return function(){WhatsappMessageEvents['removeListener'](_0x3e0abe,_0x287229);};}exports['register']=function(_0x207cf2){for(var _0xfb1590=0x0,_0x3ce16f=events[_0xfb84('0x5')];_0xfb1590<_0x3ce16f;_0xfb1590++){var _0x5c7ff2=events[_0xfb1590];var _0x29129d=createListener(_0xfb84('0x6')+_0x5c7ff2,_0x207cf2);WhatsappMessageEvents['on'](_0x5c7ff2,_0x29129d);}}; \ No newline at end of file +var _0x53bf=['whatsappMessage:','./whatsappMessage.events','save','remove','update'];(function(_0x409640,_0x15fbec){var _0x2dc61b=function(_0x68c4b1){while(--_0x68c4b1){_0x409640['push'](_0x409640['shift']());}};_0x2dc61b(++_0x15fbec);}(_0x53bf,0xd8));var _0xf53b=function(_0x52ad48,_0x461a22){_0x52ad48=_0x52ad48-0x0;var _0x4ca08b=_0x53bf[_0x52ad48];return _0x4ca08b;};'use strict';var WhatsappMessageEvents=require(_0xf53b('0x0'));var events=[_0xf53b('0x1'),_0xf53b('0x2'),_0xf53b('0x3')];function createListener(_0xc49185,_0x59dd5a){return function(_0x3b1924){_0x59dd5a['emit'](_0xc49185,_0x3b1924);};}function removeListener(_0x17ebe4,_0x31e515){return function(){WhatsappMessageEvents['removeListener'](_0x17ebe4,_0x31e515);};}exports['register']=function(_0x5534f5){for(var _0x58fd46=0x0,_0x33caf4=events['length'];_0x58fd46<_0x33caf4;_0x58fd46++){var _0x5f038b=events[_0x58fd46];var _0x1579a7=createListener(_0xf53b('0x4')+_0x5f038b,_0x5534f5);WhatsappMessageEvents['on'](_0x5f038b,_0x1579a7);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index e42e436..392177d 100644 --- a/server/api/whatsappQueue/index.js +++ b/server/api/whatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5763=['/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers'];(function(_0x1a226c,_0x12e969){var _0x1f1d65=function(_0x40a215){while(--_0x40a215){_0x1a226c['push'](_0x1a226c['shift']());}};_0x1f1d65(++_0x12e969);}(_0x5763,0xfd));var _0x3576=function(_0x14339c,_0x541121){_0x14339c=_0x14339c-0x0;var _0x100238=_0x5763[_0x14339c];return _0x100238;};'use strict';var multer=require(_0x3576('0x0'));var util=require(_0x3576('0x1'));var path=require(_0x3576('0x2'));var timeout=require(_0x3576('0x3'));var express=require(_0x3576('0x4'));var router=express[_0x3576('0x5')]();var fs_extra=require(_0x3576('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3576('0x7'));var config=require(_0x3576('0x8'));var controller=require(_0x3576('0x9'));router[_0x3576('0xa')]('/',auth[_0x3576('0xb')](),controller[_0x3576('0xc')]);router[_0x3576('0xa')](_0x3576('0xd'),auth[_0x3576('0xb')](),controller[_0x3576('0xe')]);router[_0x3576('0xa')]('/:id',auth[_0x3576('0xb')](),controller['show']);router[_0x3576('0xa')](_0x3576('0xf'),auth[_0x3576('0xb')](),controller[_0x3576('0x10')]);router[_0x3576('0xa')](_0x3576('0x11'),auth['isAuthenticated'](),controller['getTeams']);router[_0x3576('0xa')]('/:id/users',auth[_0x3576('0xb')](),controller[_0x3576('0x12')]);router[_0x3576('0x13')]('/',auth[_0x3576('0xb')](),controller[_0x3576('0x14')]);router[_0x3576('0x13')](_0x3576('0x11'),auth[_0x3576('0xb')](),controller[_0x3576('0x15')]);router[_0x3576('0x13')](_0x3576('0x16'),auth[_0x3576('0xb')](),controller[_0x3576('0x17')]);router['put']('/:id',auth[_0x3576('0xb')](),controller[_0x3576('0x18')]);router[_0x3576('0x19')]('/:id',auth[_0x3576('0xb')](),controller[_0x3576('0x1a')]);router[_0x3576('0x19')](_0x3576('0x11'),auth[_0x3576('0xb')](),controller[_0x3576('0x1b')]);router[_0x3576('0x19')](_0x3576('0x16'),auth[_0x3576('0xb')](),controller[_0x3576('0x1c')]);module[_0x3576('0x1d')]=router; \ No newline at end of file +var _0x6bb0=['/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getAgents','create','post','addTeams','addAgents','put','delete','destroy','removeTeams','util','express','Router','fs-extra','../../config/environment','./whatsappQueue.controller','get','isAuthenticated'];(function(_0x51a1e7,_0x54cc87){var _0x4980d2=function(_0x54d17e){while(--_0x54d17e){_0x51a1e7['push'](_0x51a1e7['shift']());}};_0x4980d2(++_0x54cc87);}(_0x6bb0,0x151));var _0x06bb=function(_0x3bb830,_0xa498c1){_0x3bb830=_0x3bb830-0x0;var _0x309778=_0x6bb0[_0x3bb830];return _0x309778;};'use strict';var multer=require('multer');var util=require(_0x06bb('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x06bb('0x1'));var router=express[_0x06bb('0x2')]();var fs_extra=require(_0x06bb('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x06bb('0x4'));var controller=require(_0x06bb('0x5'));router[_0x06bb('0x6')]('/',auth[_0x06bb('0x7')](),controller['index']);router[_0x06bb('0x6')](_0x06bb('0x8'),auth[_0x06bb('0x7')](),controller[_0x06bb('0x9')]);router['get'](_0x06bb('0xa'),auth[_0x06bb('0x7')](),controller['show']);router[_0x06bb('0x6')](_0x06bb('0xb'),auth['isAuthenticated'](),controller[_0x06bb('0xc')]);router[_0x06bb('0x6')](_0x06bb('0xd'),auth[_0x06bb('0x7')](),controller['getTeams']);router['get']('/:id/users',auth[_0x06bb('0x7')](),controller[_0x06bb('0xe')]);router['post']('/',auth[_0x06bb('0x7')](),controller[_0x06bb('0xf')]);router[_0x06bb('0x10')](_0x06bb('0xd'),auth['isAuthenticated'](),controller[_0x06bb('0x11')]);router[_0x06bb('0x10')]('/:id/users',auth[_0x06bb('0x7')](),controller[_0x06bb('0x12')]);router[_0x06bb('0x13')](_0x06bb('0xa'),auth[_0x06bb('0x7')](),controller['update']);router[_0x06bb('0x14')](_0x06bb('0xa'),auth[_0x06bb('0x7')](),controller[_0x06bb('0x15')]);router['delete'](_0x06bb('0xd'),auth[_0x06bb('0x7')](),controller[_0x06bb('0x16')]);router[_0x06bb('0x14')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index ad4408f..5aaa0cb 100644 --- a/server/api/whatsappQueue/whatsappQueue.attributes.js +++ b/server/api/whatsappQueue/whatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bc6=['exports','STRING','beepall','sequelize'];(function(_0x2fc087,_0x72b243){var _0x37bfeb=function(_0x3980fa){while(--_0x3980fa){_0x2fc087['push'](_0x2fc087['shift']());}};_0x37bfeb(++_0x72b243);}(_0x2bc6,0x163));var _0x62bc=function(_0x2cb0a2,_0x5e7abf){_0x2cb0a2=_0x2cb0a2-0x0;var _0x13f416=_0x2bc6[_0x2cb0a2];return _0x13f416;};'use strict';var Sequelize=require(_0x62bc('0x0'));module[_0x62bc('0x1')]={'name':{'type':Sequelize[_0x62bc('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x62bc('0x3'),'roundrobin')},'description':{'type':Sequelize[_0x62bc('0x2')]}}; \ No newline at end of file +var _0x4e83=['rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x117c36,_0x12da79){var _0x2c4cab=function(_0x197fd2){while(--_0x197fd2){_0x117c36['push'](_0x117c36['shift']());}};_0x2c4cab(++_0x12da79);}(_0x4e83,0x88));var _0x34e8=function(_0x2e9ded,_0x235e2b){_0x2e9ded=_0x2e9ded-0x0;var _0xc88a61=_0x4e83[_0x2e9ded];return _0xc88a61;};'use strict';var Sequelize=require('sequelize');module[_0x34e8('0x0')]={'name':{'type':Sequelize[_0x34e8('0x1')],'unique':_0x34e8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x34e8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x34e8('0x4'),_0x34e8('0x5'),_0x34e8('0x6'))},'description':{'type':Sequelize[_0x34e8('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 2cc0b6d..7028c51 100644 --- a/server/api/whatsappQueue/whatsappQueue.controller.js +++ b/server/api/whatsappQueue/whatsappQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd410=['spread','isArray','getAgents','util','squel','ioredis','../../components/parsers/qs','api','../../mysqldb','defaults','redis','./whatsappQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','then','get','WhatsappQueues','destroy','error','map','rawAttributes','fieldName','type','key','getOptions','where','include','query','WhatsappQueue','rows','catch','show','model','keys','intersection','attributes','fields','includeAll','merge','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','UserWhatsappQueue','length','hasOwnProperty','nolimit','order','sort','filters','pick','WhatsappQueueId','filter','findAll','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','transaction','forEach','emit','userWhatsappQueue:save','Agents','select','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','TeamId','includes','all','value','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit'];(function(_0x41c124,_0x938abf){var _0x1b8248=function(_0x5c8aef){while(--_0x5c8aef){_0x41c124['push'](_0x41c124['shift']());}};_0x1b8248(++_0x938abf);}(_0xd410,0x1cf));var _0x0d41=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xd410[_0x2bf141];return _0x48277b;};'use strict';var BPromise=require('bluebird');var util=require(_0x0d41('0x0'));var _=require('lodash');var squel=require(_0x0d41('0x1'));var Redis=require(_0x0d41('0x2'));var qs=require(_0x0d41('0x3'));var logger=require('../../config/logger')(_0x0d41('0x4'));var config=require('../../config/environment');var db=require(_0x0d41('0x5'))['db'];config['redis']=_[_0x0d41('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d41('0x7')]));require(_0x0d41('0x8'))['register'](socket);function respondWithStatusCode(_0x2cde70,_0x45e2c2){_0x45e2c2=_0x45e2c2||0xcc;return function(_0x2645bb){if(_0x2645bb){return _0x2cde70[_0x0d41('0x9')](_0x45e2c2);}return _0x2cde70[_0x0d41('0xa')](_0x45e2c2)['end']();};}function respondWithResult(_0x1f3edf,_0x1d781e){_0x1d781e=_0x1d781e||0xc8;return function(_0x2b08f8){if(_0x2b08f8){return _0x1f3edf['status'](_0x1d781e)[_0x0d41('0xb')](_0x2b08f8);}};}function respondWithFilteredResult(_0x2ac236,_0x5f14c2){return function(_0x4e6bac){if(_0x4e6bac){var _0x4e4f7e=typeof _0x5f14c2[_0x0d41('0xc')]===_0x0d41('0xd')&&typeof _0x5f14c2[_0x0d41('0xe')]===_0x0d41('0xd');var _0xe7d9b8=_0x4e6bac[_0x0d41('0xf')];var _0x189da1=_0x4e4f7e?0x0:_0x5f14c2[_0x0d41('0xc')];var _0x15bf2f=_0x4e4f7e?_0x4e6bac[_0x0d41('0xf')]:_0x5f14c2[_0x0d41('0xc')]+_0x5f14c2[_0x0d41('0xe')];var _0x18e35e;if(_0x15bf2f>=_0xe7d9b8){_0x15bf2f=_0xe7d9b8;_0x18e35e=0xc8;}else{_0x18e35e=0xce;}_0x2ac236[_0x0d41('0xa')](_0x18e35e);return _0x2ac236[_0x0d41('0x10')](_0x0d41('0x11'),_0x189da1+'-'+_0x15bf2f+'/'+_0xe7d9b8)[_0x0d41('0xb')](_0x4e6bac);}return null;};}function saveUpdates(_0x31c25c){return function(_0xd659ad){if(_0xd659ad){return _0xd659ad['update'](_0x31c25c)[_0x0d41('0x12')](function(_0x5c2fcb){return _0x5c2fcb;});}return null;};}function removeEntity(_0xb8c900){return function(_0x207410){if(_0x207410){return _0x207410['destroy']()[_0x0d41('0x12')](function(){var _0x1e1c70=_0x207410[_0x0d41('0x13')]({'plain':!![]});var _0x2c550f=_0x0d41('0x14');return db['UserProfileResource'][_0x0d41('0x15')]({'where':{'type':_0x2c550f,'resourceId':_0x1e1c70['id']}})[_0x0d41('0x12')](function(){return _0x207410;});})[_0x0d41('0x12')](function(){_0xb8c900[_0x0d41('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58f332){return function(_0x13efef){if(!_0x13efef){_0x58f332[_0x0d41('0x9')](0x194);}return _0x13efef;};}function handleError(_0x22ba30,_0x516262){_0x516262=_0x516262||0x1f4;return function(_0x1bcfe1){logger[_0x0d41('0x16')](_0x1bcfe1['stack']);if(_0x1bcfe1['name']){delete _0x1bcfe1['name'];}_0x22ba30[_0x0d41('0xa')](_0x516262)['send'](_0x1bcfe1);};}exports['index']=function(_0x1cac7f,_0x39475f){var _0x49e960={};var _0x13147e={'count':0x0,'rows':[]};var _0x3a216c=_[_0x0d41('0x17')](db['WhatsappQueue'][_0x0d41('0x18')],function(_0x238cc1){return{'name':_0x238cc1[_0x0d41('0x19')],'type':_0x238cc1[_0x0d41('0x1a')][_0x0d41('0x1b')]};});_0x49e960=qs[_0x0d41('0x1c')](_0x3a216c,_0x1cac7f);var _0x5af429={'where':_0x49e960[_0x0d41('0x1d')]};return db['WhatsappQueue'][_0x0d41('0xf')](_0x5af429)[_0x0d41('0x12')](function(_0x267f48){_0x13147e[_0x0d41('0xf')]=_0x267f48;_0x49e960[_0x0d41('0x1e')]=qs[_0x0d41('0x1e')](_0x1cac7f[_0x0d41('0x1f')]);return db[_0x0d41('0x20')]['findAll'](_0x49e960);})[_0x0d41('0x12')](function(_0x541469){_0x13147e[_0x0d41('0x21')]=_0x541469;return _0x13147e;})[_0x0d41('0x12')](respondWithFilteredResult(_0x39475f,_0x49e960))[_0x0d41('0x22')](handleError(_0x39475f,null));};exports[_0x0d41('0x23')]=function(_0x1d816c,_0x3dd8fb){var _0x42682b={'raw':!![],'where':{'id':_0x1d816c['params']['id']}},_0x399327={};_0x399327[_0x0d41('0x24')]=_[_0x0d41('0x25')](db[_0x0d41('0x20')][_0x0d41('0x18')]);_0x399327[_0x0d41('0x1f')]=_['keys'](_0x1d816c[_0x0d41('0x1f')]);_0x399327['filters']=_[_0x0d41('0x26')](_0x399327['model'],_0x399327[_0x0d41('0x1f')]);_0x42682b[_0x0d41('0x27')]=_[_0x0d41('0x26')](_0x399327[_0x0d41('0x24')],qs[_0x0d41('0x28')](_0x1d816c[_0x0d41('0x1f')][_0x0d41('0x28')]));_0x42682b[_0x0d41('0x27')]=_0x42682b[_0x0d41('0x27')]['length']?_0x42682b[_0x0d41('0x27')]:_0x399327[_0x0d41('0x24')];if(_0x1d816c[_0x0d41('0x1f')][_0x0d41('0x29')]){_0x42682b[_0x0d41('0x1e')]=[{'all':!![]}];}_0x42682b=_[_0x0d41('0x2a')]({},_0x42682b,_0x1d816c[_0x0d41('0x2b')]);return db[_0x0d41('0x20')]['find'](_0x42682b)[_0x0d41('0x12')](handleEntityNotFound(_0x3dd8fb,null))['then'](respondWithResult(_0x3dd8fb,null))['catch'](handleError(_0x3dd8fb,null));};exports[_0x0d41('0x2c')]=function(_0x4d70ec,_0x52ea66){return db[_0x0d41('0x20')]['create'](_0x4d70ec[_0x0d41('0x2d')],{})[_0x0d41('0x12')](function(_0x205cda){var _0x20cd3b=_0x4d70ec['user'][_0x0d41('0x13')]({'plain':!![]});if(!_0x20cd3b)throw new Error(_0x0d41('0x2e'));if(_0x20cd3b['role']==='user'){var _0x58fdfa=_0x205cda[_0x0d41('0x13')]({'plain':!![]});var _0xefac87=_0x0d41('0x14');return db[_0x0d41('0x2f')][_0x0d41('0x30')]({'where':{'name':_0xefac87,'userProfileId':_0x20cd3b[_0x0d41('0x31')]},'raw':!![]})['then'](function(_0x55146b){if(_0x55146b&&_0x55146b[_0x0d41('0x32')]===0x0){return db[_0x0d41('0x33')][_0x0d41('0x2c')]({'name':_0x58fdfa[_0x0d41('0x34')],'resourceId':_0x58fdfa['id'],'type':_0x55146b[_0x0d41('0x34')],'sectionId':_0x55146b['id']},{})[_0x0d41('0x12')](function(){return _0x205cda;});}else{return _0x205cda;}})['catch'](function(_0xd8e727){logger[_0x0d41('0x16')](_0x0d41('0x35'),_0xd8e727);throw _0xd8e727;});}return _0x205cda;})['then'](respondWithResult(_0x52ea66,0xc9))[_0x0d41('0x22')](handleError(_0x52ea66,null));};exports[_0x0d41('0x36')]=function(_0x501afc,_0x3ca358){if(_0x501afc[_0x0d41('0x2d')]['id']){delete _0x501afc['body']['id'];}return db[_0x0d41('0x20')]['find']({'where':{'id':_0x501afc['params']['id']}})[_0x0d41('0x12')](handleEntityNotFound(_0x3ca358,null))['then'](saveUpdates(_0x501afc[_0x0d41('0x2d')],null))['then'](respondWithResult(_0x3ca358,null))[_0x0d41('0x22')](handleError(_0x3ca358,null));};exports['destroy']=function(_0x36bc7d,_0x4b1371){return db[_0x0d41('0x20')][_0x0d41('0x30')]({'where':{'id':_0x36bc7d[_0x0d41('0x37')]['id']}})[_0x0d41('0x12')](handleEntityNotFound(_0x4b1371,null))[_0x0d41('0x12')](removeEntity(_0x4b1371,null))[_0x0d41('0x22')](handleError(_0x4b1371,null));};exports[_0x0d41('0x38')]=function(_0x5d80e0,_0x1efbd9){return db[_0x0d41('0x20')]['describe']()[_0x0d41('0x12')](respondWithResult(_0x1efbd9,null))[_0x0d41('0x22')](handleError(_0x1efbd9,null));};exports[_0x0d41('0x39')]=function(_0x537635,_0x56eea7){var _0x49b73a={'raw':!![],'where':{}},_0x73486={},_0xdbd497;return db[_0x0d41('0x20')][_0x0d41('0x3a')]({'where':{'id':_0x537635[_0x0d41('0x37')]['id']}})[_0x0d41('0x12')](handleEntityNotFound(_0x56eea7,null))[_0x0d41('0x12')](function(_0x5de101){if(_0x5de101){_0xdbd497=_0x5de101['get']({'plain':!![]});_0x73486[_0x0d41('0x24')]=_['keys'](db[_0x0d41('0x3b')][_0x0d41('0x18')]);_0x73486[_0x0d41('0x1f')]=_[_0x0d41('0x25')](_0x537635[_0x0d41('0x1f')]);_0x73486['filters']=_[_0x0d41('0x26')](_0x73486[_0x0d41('0x24')],_0x73486[_0x0d41('0x1f')]);_0x49b73a[_0x0d41('0x27')]=_[_0x0d41('0x26')](_0x73486['model'],qs[_0x0d41('0x28')](_0x537635['query'][_0x0d41('0x28')]));_0x49b73a[_0x0d41('0x27')]=_0x49b73a['attributes'][_0x0d41('0x3c')]?_0x49b73a['attributes']:_0x73486[_0x0d41('0x24')];if(!_0x537635['query'][_0x0d41('0x3d')](_0x0d41('0x3e'))){_0x49b73a[_0x0d41('0xe')]=qs[_0x0d41('0xe')](_0x537635['query'][_0x0d41('0xe')]);_0x49b73a[_0x0d41('0xc')]=qs[_0x0d41('0xc')](_0x537635[_0x0d41('0x1f')][_0x0d41('0xc')]);}_0x49b73a[_0x0d41('0x3f')]=qs[_0x0d41('0x40')](_0x537635[_0x0d41('0x1f')][_0x0d41('0x40')]);_0x49b73a['where']=qs[_0x0d41('0x41')](_[_0x0d41('0x42')](_0x537635[_0x0d41('0x1f')],_0x73486[_0x0d41('0x41')]));_0x49b73a[_0x0d41('0x1d')][_0x0d41('0x43')]=_0x5de101['id'];if(_0x537635[_0x0d41('0x1f')]['filter']){_0x49b73a[_0x0d41('0x1d')]=_[_0x0d41('0x2a')](_0x49b73a[_0x0d41('0x1d')],{'$or':_[_0x0d41('0x17')](_0x49b73a[_0x0d41('0x27')],function(_0x4e1b0f){var _0x54b35e={};_0x54b35e[_0x4e1b0f]={'$like':'%'+_0x537635[_0x0d41('0x1f')][_0x0d41('0x44')]+'%'};return _0x54b35e;})});}_0x49b73a=_[_0x0d41('0x2a')]({},_0x49b73a,_0x537635[_0x0d41('0x2b')]);return db['UserWhatsappQueue'][_0x0d41('0x45')](_0x49b73a);}})[_0x0d41('0x12')](function(_0x3c3e07){if(_0x3c3e07){return db[_0x0d41('0x46')][_0x0d41('0x47')]({'where':{'id':_[_0x0d41('0x17')](_0x3c3e07,_0x0d41('0x48')),'role':_0x0d41('0x49')},'attributes':['id',_0x0d41('0x34'),_0x0d41('0x4a'),_0x0d41('0x4b'),_0x0d41('0x4c')]});}})[_0x0d41('0x12')](function(_0x4e6c01){if(_0x4e6c01){return{'count':_0x4e6c01[_0x0d41('0xf')],'rows':_[_0x0d41('0x17')](_0x4e6c01['rows'],function(_0x2bcfe4){return{'membername':_0x2bcfe4['name'],'UserId':_0x2bcfe4['id'],'queue_name':_0xdbd497[_0x0d41('0x34')],'WhatsappQueueId':_0xdbd497['id'],'interface':util['format'](_0x0d41('0x4d'),_0x0d41('0x4e'),_0x2bcfe4['name']),'penalty':0x0,'paused':_0x2bcfe4[_0x0d41('0x4a')],'createdAt':_0x2bcfe4[_0x0d41('0x4c')],'updatedAt':_0x2bcfe4[_0x0d41('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x56eea7,_0x49b73a))[_0x0d41('0x22')](handleError(_0x56eea7,null));};exports[_0x0d41('0x4f')]=function(_0x514d4b,_0x2c1693){var _0x47bc72={};var _0x1b5806={};var _0x26c782;var _0x52e7e7;return db[_0x0d41('0x20')]['findOne']({'where':{'id':_0x514d4b[_0x0d41('0x37')]['id']}})[_0x0d41('0x12')](handleEntityNotFound(_0x2c1693,null))[_0x0d41('0x12')](function(_0x275572){if(_0x275572){_0x26c782=_0x275572;_0x1b5806[_0x0d41('0x24')]=_[_0x0d41('0x25')](db[_0x0d41('0x50')][_0x0d41('0x18')]);_0x1b5806[_0x0d41('0x1f')]=_[_0x0d41('0x25')](_0x514d4b[_0x0d41('0x1f')]);_0x1b5806['filters']=_['intersection'](_0x1b5806[_0x0d41('0x24')],_0x1b5806['query']);_0x47bc72[_0x0d41('0x27')]=_[_0x0d41('0x26')](_0x1b5806['model'],qs[_0x0d41('0x28')](_0x514d4b[_0x0d41('0x1f')]['fields']));_0x47bc72[_0x0d41('0x27')]=_0x47bc72[_0x0d41('0x27')][_0x0d41('0x3c')]?_0x47bc72[_0x0d41('0x27')]:_0x1b5806[_0x0d41('0x24')];_0x47bc72['order']=qs[_0x0d41('0x40')](_0x514d4b[_0x0d41('0x1f')][_0x0d41('0x40')]);_0x47bc72[_0x0d41('0x1d')]=qs[_0x0d41('0x41')](_['pick'](_0x514d4b['query'],_0x1b5806[_0x0d41('0x41')]));if(_0x514d4b[_0x0d41('0x1f')][_0x0d41('0x44')]){_0x47bc72['where']=_[_0x0d41('0x2a')](_0x47bc72[_0x0d41('0x1d')],{'$or':_[_0x0d41('0x17')](_0x47bc72['attributes'],function(_0x3e024e){var _0x55d985={};_0x55d985[_0x3e024e]={'$like':'%'+_0x514d4b[_0x0d41('0x1f')][_0x0d41('0x44')]+'%'};return _0x55d985;})});}_0x47bc72=_['merge']({},_0x47bc72,_0x514d4b[_0x0d41('0x2b')]);return _0x26c782[_0x0d41('0x4f')](_0x47bc72);}})[_0x0d41('0x12')](function(_0x474ca7){if(_0x474ca7){_0x52e7e7=_0x474ca7['length'];if(!_0x514d4b[_0x0d41('0x1f')][_0x0d41('0x3d')](_0x0d41('0x3e'))){_0x47bc72[_0x0d41('0xe')]=qs['limit'](_0x514d4b[_0x0d41('0x1f')][_0x0d41('0xe')]);_0x47bc72[_0x0d41('0xc')]=qs['offset'](_0x514d4b[_0x0d41('0x1f')][_0x0d41('0xc')]);}return _0x26c782[_0x0d41('0x4f')](_0x47bc72);}})['then'](function(_0x2d5cf3){if(_0x2d5cf3){return _0x2d5cf3?{'count':_0x52e7e7,'rows':_0x2d5cf3}:null;}})[_0x0d41('0x12')](respondWithResult(_0x2c1693,null))[_0x0d41('0x22')](handleError(_0x2c1693,null));};exports[_0x0d41('0x51')]=function(_0xf17a9b,_0xe6a44e){var _0x1cc067=_0xf17a9b[_0x0d41('0x2d')][_0x0d41('0x52')];return db[_0x0d41('0x50')][_0x0d41('0x45')]({'where':{'id':_0x1cc067},'attributes':['id'],'include':[{'model':db[_0x0d41('0x46')],'as':'Agents','attributes':['id',_0x0d41('0x34'),_0x0d41('0x53'),_0x0d41('0x54'),_0x0d41('0x55')],'raw':!![]}]})[_0x0d41('0x12')](function(_0x2d7ab4){if(_0x2d7ab4){var _0x262b36=_['flatMap'](_0x2d7ab4,function(_0x5c6a5e){var _0x22c1a7=_0x5c6a5e[_0x0d41('0x13')]({'plain':!![]});return _0x22c1a7['Agents'];});return db[_0x0d41('0x20')]['find']({'where':{'id':_0xf17a9b['params']['id']}})[_0x0d41('0x12')](function(_0x3aafca){return db['sequelize'][_0x0d41('0x56')](function(_0x24d57c){return _0x3aafca[_0x0d41('0x51')](_0x1cc067,{'transaction':_0x24d57c})[_0x0d41('0x12')](function(){return BPromise['each'](_0x262b36,function(_0x52049b){return db[_0x0d41('0x3b')]['findOrCreate']({'where':{'UserId':_0x52049b['id'],'WhatsappQueueId':_0xf17a9b['params']['id']},'transaction':_0x24d57c});});})['then'](function(){_0x262b36[_0x0d41('0x57')](function(_0x1f1caa){socket[_0x0d41('0x58')](_0x0d41('0x59'),{'UserId':_0x1f1caa['id'],'WhatsappQueueId':_0x3aafca['id']});});});});});}})['then'](respondWithStatusCode(_0xe6a44e,null))['catch'](handleError(_0xe6a44e,null));};exports['removeTeams']=function(_0x1d2377,_0x4ce93a){return db[_0x0d41('0x50')][_0x0d41('0x45')]({'where':{'id':_0x1d2377[_0x0d41('0x1f')][_0x0d41('0x52')]},'attributes':['id'],'include':[{'model':db[_0x0d41('0x46')],'as':_0x0d41('0x5a'),'attributes':['id'],'raw':!![]}]})[_0x0d41('0x12')](handleEntityNotFound(_0x4ce93a,null))['then'](function(_0x3bf78b){var _0x324ecb=_[_0x0d41('0x17')](_0x3bf78b,'id');var _0x2a18a7=[];var _0x536040=[];var _0x2c81a8=squel[_0x0d41('0x5b')]();_0x2c81a8[_0x0d41('0x5c')]('tq.TeamId')['from']('team_has_whatsapp_queues','tq')[_0x0d41('0x5d')](_0x0d41('0x5e'),'ut',_0x0d41('0x5f'))[_0x0d41('0x1d')](_0x0d41('0x60'),_0x1d2377['params']['id']);for(var _0x4c8702=0x0;_0x4c8702<_0x3bf78b['length'];_0x4c8702+=0x1){let _0x1666b1=_0x3bf78b[_0x4c8702];for(var _0x5265d0=0x0;_0x5265d0<_0x1666b1['Agents']['length'];_0x5265d0+=0x1){let _0x596181=_0x1666b1[_0x0d41('0x5a')][_0x5265d0];var _0x7d02ac=_0x2c81a8[_0x0d41('0x61')]();_0x7d02ac['where'](_0x0d41('0x62'),_0x596181['id']);_0x536040[_0x0d41('0x63')](db['sequelize'][_0x0d41('0x1f')](_0x7d02ac[_0x0d41('0x64')](),{'type':db[_0x0d41('0x65')]['QueryTypes']['SELECT']})[_0x0d41('0x12')](function(_0x52f90d){if(_0x52f90d['length']===0x1){return _0x596181['id'];}else{var _0xff8874=_['every'](_[_0x0d41('0x17')](_0x52f90d,_0x0d41('0x66')),function(_0x5b00f8){return _[_0x0d41('0x67')](_0x324ecb,_0x5b00f8);});if(_0xff8874){return _0x596181['id'];}}}));}}return BPromise[_0x0d41('0x68')](_0x536040)['then'](function(_0x54a93e){_0x2a18a7=_(_0x2a18a7)['union'](_0x54a93e)['compact']()[_0x0d41('0x69')]();return db[_0x0d41('0x20')][_0x0d41('0x30')]({'where':{'id':_0x1d2377[_0x0d41('0x37')]['id']}})['then'](function(_0xd90fcf){return db[_0x0d41('0x65')][_0x0d41('0x56')](function(_0x936e78){return _0xd90fcf[_0x0d41('0x6a')](_0x1d2377['query'][_0x0d41('0x52')],{'transaction':_0x936e78})[_0x0d41('0x12')](function(){if(!_[_0x0d41('0x6b')](_0x2a18a7)){return _0xd90fcf[_0x0d41('0x6c')](_0x2a18a7,{'transaction':_0x936e78});}})[_0x0d41('0x12')](function(){_0x2a18a7[_0x0d41('0x57')](function(_0x41b5b3){socket[_0x0d41('0x58')](_0x0d41('0x6d'),{'UserId':_0x41b5b3,'WhatsappQueueId':_0xd90fcf['id']});});});});});});})[_0x0d41('0x12')](respondWithStatusCode(_0x4ce93a,null))[_0x0d41('0x22')](handleError(_0x4ce93a,null));};exports[_0x0d41('0x6e')]=function(_0x1fd35c,_0x29f366){return db[_0x0d41('0x20')][_0x0d41('0x30')]({'where':{'id':_0x1fd35c[_0x0d41('0x37')]['id']}})['then'](handleEntityNotFound(_0x29f366,null))[_0x0d41('0x12')](function(_0x33d190){if(_0x33d190){return _0x33d190['addAgents'](_0x1fd35c[_0x0d41('0x2d')][_0x0d41('0x52')],_[_0x0d41('0x6f')](_0x1fd35c['body'],[_0x0d41('0x52'),'id'])||{})[_0x0d41('0x70')](function(_0x18cd27){for(var _0x64df80=0x0;_0x64df80<_0x1fd35c[_0x0d41('0x2d')][_0x0d41('0x52')][_0x0d41('0x3c')];_0x64df80+=0x1){socket['emit'](_0x0d41('0x59'),{'UserId':Number(_0x1fd35c[_0x0d41('0x2d')]['ids'][_0x64df80]),'WhatsappQueueId':Number(_0x1fd35c[_0x0d41('0x37')]['id'])});}return _0x18cd27;});}})[_0x0d41('0x12')](respondWithResult(_0x29f366,null))[_0x0d41('0x22')](handleError(_0x29f366,null));};exports[_0x0d41('0x6c')]=function(_0x3645be,_0x5821f1){return db[_0x0d41('0x20')][_0x0d41('0x30')]({'where':{'id':_0x3645be['params']['id']}})[_0x0d41('0x12')](handleEntityNotFound(_0x5821f1,null))[_0x0d41('0x12')](function(_0x226214){if(_0x226214){return _0x226214[_0x0d41('0x6c')](_0x3645be[_0x0d41('0x1f')]['ids'])[_0x0d41('0x12')](function(){if(_[_0x0d41('0x71')](_0x3645be[_0x0d41('0x1f')][_0x0d41('0x52')])){for(var _0x2e8954=0x0;_0x2e8954<_0x3645be[_0x0d41('0x1f')][_0x0d41('0x52')][_0x0d41('0x3c')];_0x2e8954+=0x1){socket[_0x0d41('0x58')](_0x0d41('0x6d'),{'UserId':Number(_0x3645be[_0x0d41('0x1f')][_0x0d41('0x52')][_0x2e8954]),'WhatsappQueueId':Number(_0x3645be[_0x0d41('0x37')]['id'])});}}else{socket[_0x0d41('0x58')]('userWhatsappQueue:remove',{'UserId':Number(_0x3645be[_0x0d41('0x1f')]['ids']),'WhatsappQueueId':Number(_0x3645be[_0x0d41('0x37')]['id'])});}});}})['then'](respondWithStatusCode(_0x5821f1,null))[_0x0d41('0x22')](handleError(_0x5821f1,null));};exports[_0x0d41('0x72')]=function(_0x5bdb17,_0x450e7e){var _0x54b60d={};var _0x599e9e={};var _0x203ae3;var _0x42bab4;return db[_0x0d41('0x20')][_0x0d41('0x3a')]({'where':{'id':_0x5bdb17[_0x0d41('0x37')]['id']}})[_0x0d41('0x12')](handleEntityNotFound(_0x450e7e,null))[_0x0d41('0x12')](function(_0x258bcb){if(_0x258bcb){_0x203ae3=_0x258bcb;_0x599e9e[_0x0d41('0x24')]=_['keys'](db['User'][_0x0d41('0x18')]);_0x599e9e[_0x0d41('0x1f')]=_[_0x0d41('0x25')](_0x5bdb17[_0x0d41('0x1f')]);_0x599e9e[_0x0d41('0x41')]=_['intersection'](_0x599e9e['model'],_0x599e9e[_0x0d41('0x1f')]);_0x54b60d['attributes']=_[_0x0d41('0x26')](_0x599e9e[_0x0d41('0x24')],qs[_0x0d41('0x28')](_0x5bdb17[_0x0d41('0x1f')][_0x0d41('0x28')]));_0x54b60d[_0x0d41('0x27')]=_0x54b60d['attributes']['length']?_0x54b60d[_0x0d41('0x27')]:_0x599e9e[_0x0d41('0x24')];_0x54b60d['order']=qs[_0x0d41('0x40')](_0x5bdb17[_0x0d41('0x1f')]['sort']);_0x54b60d[_0x0d41('0x1d')]=qs[_0x0d41('0x41')](_[_0x0d41('0x42')](_0x5bdb17[_0x0d41('0x1f')],_0x599e9e['filters']));if(_0x5bdb17[_0x0d41('0x1f')][_0x0d41('0x44')]){_0x54b60d[_0x0d41('0x1d')]=_['merge'](_0x54b60d['where'],{'$or':_[_0x0d41('0x17')](_0x54b60d[_0x0d41('0x27')],function(_0x38fd1e){var _0x14cad8={};_0x14cad8[_0x38fd1e]={'$like':'%'+_0x5bdb17[_0x0d41('0x1f')][_0x0d41('0x44')]+'%'};return _0x14cad8;})});}_0x54b60d=_[_0x0d41('0x2a')]({},_0x54b60d,_0x5bdb17[_0x0d41('0x2b')]);return _0x203ae3['getAgents'](_0x54b60d);}})[_0x0d41('0x12')](function(_0x39470a){if(_0x39470a){_0x42bab4=_0x39470a[_0x0d41('0x3c')];if(!_0x5bdb17[_0x0d41('0x1f')][_0x0d41('0x3d')](_0x0d41('0x3e'))){_0x54b60d[_0x0d41('0xe')]=qs[_0x0d41('0xe')](_0x5bdb17[_0x0d41('0x1f')][_0x0d41('0xe')]);_0x54b60d[_0x0d41('0xc')]=qs[_0x0d41('0xc')](_0x5bdb17[_0x0d41('0x1f')][_0x0d41('0xc')]);}return _0x203ae3['getAgents'](_0x54b60d);}})[_0x0d41('0x12')](function(_0xf193e6){if(_0xf193e6){return _0xf193e6?{'count':_0x42bab4,'rows':_0xf193e6}:null;}})[_0x0d41('0x12')](respondWithResult(_0x450e7e,null))[_0x0d41('0x22')](handleError(_0x450e7e,null));}; \ No newline at end of file +var _0xf69a=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserWhatsappQueue','hasOwnProperty','nolimit','sort','where','WhatsappQueueId','filter','map','options','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','order','pick','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','User','select','tq.TeamId','team_has_whatsapp_queues','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','addAgents','omit','spread','userWhatsappQueue:save','isArray','userWhatsappQueue:remove','getAgents','bluebird','squel','../../components/parsers/qs','../../mysqldb','redis','socket.io-emitter','./whatsappQueue.socket','register','end','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','get','WhatsappQueues','UserProfileResource','stack','name','send','WhatsappQueue','rawAttributes','fieldName','type','include','query','findAll','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','find','create'];(function(_0x3f98cf,_0x3e3269){var _0x5c9d8c=function(_0x1a51b7){while(--_0x1a51b7){_0x3f98cf['push'](_0x3f98cf['shift']());}};_0x5c9d8c(++_0x3e3269);}(_0xf69a,0xbf));var _0xaf69=function(_0x43b609,_0xcf0924){_0x43b609=_0x43b609-0x0;var _0x5d4cef=_0xf69a[_0x43b609];return _0x5d4cef;};'use strict';var BPromise=require(_0xaf69('0x0'));var util=require('util');var _=require('lodash');var squel=require(_0xaf69('0x1'));var Redis=require('ioredis');var qs=require(_0xaf69('0x2'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xaf69('0x3'))['db'];config[_0xaf69('0x4')]=_['defaults'](config[_0xaf69('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0xaf69('0x5'))(new Redis(config[_0xaf69('0x4')]));require(_0xaf69('0x6'))[_0xaf69('0x7')](socket);function respondWithStatusCode(_0x417fd6,_0x4269e6){_0x4269e6=_0x4269e6||0xcc;return function(_0x7e3ca8){if(_0x7e3ca8){return _0x417fd6['sendStatus'](_0x4269e6);}return _0x417fd6['status'](_0x4269e6)[_0xaf69('0x8')]();};}function respondWithResult(_0x1a2ad2,_0x482054){_0x482054=_0x482054||0xc8;return function(_0x91731e){if(_0x91731e){return _0x1a2ad2[_0xaf69('0x9')](_0x482054)[_0xaf69('0xa')](_0x91731e);}};}function respondWithFilteredResult(_0xc1b31a,_0x5ac6f6){return function(_0x48374b){if(_0x48374b){var _0x39d375=typeof _0x5ac6f6[_0xaf69('0xb')]===_0xaf69('0xc')&&typeof _0x5ac6f6[_0xaf69('0xd')]===_0xaf69('0xc');var _0x2847b5=_0x48374b[_0xaf69('0xe')];var _0x2efdfd=_0x39d375?0x0:_0x5ac6f6[_0xaf69('0xb')];var _0xaf5d29=_0x39d375?_0x48374b[_0xaf69('0xe')]:_0x5ac6f6[_0xaf69('0xb')]+_0x5ac6f6[_0xaf69('0xd')];var _0x1b13a4;if(_0xaf5d29>=_0x2847b5){_0xaf5d29=_0x2847b5;_0x1b13a4=0xc8;}else{_0x1b13a4=0xce;}_0xc1b31a[_0xaf69('0x9')](_0x1b13a4);return _0xc1b31a['set'](_0xaf69('0xf'),_0x2efdfd+'-'+_0xaf5d29+'/'+_0x2847b5)[_0xaf69('0xa')](_0x48374b);}return null;};}function saveUpdates(_0x5ec64f){return function(_0x42d308){if(_0x42d308){return _0x42d308[_0xaf69('0x10')](_0x5ec64f)[_0xaf69('0x11')](function(_0x566e0e){return _0x566e0e;});}return null;};}function removeEntity(_0x32514d){return function(_0x524a53){if(_0x524a53){return _0x524a53[_0xaf69('0x12')]()['then'](function(){var _0x54fefc=_0x524a53[_0xaf69('0x13')]({'plain':!![]});var _0x5a761c=_0xaf69('0x14');return db[_0xaf69('0x15')][_0xaf69('0x12')]({'where':{'type':_0x5a761c,'resourceId':_0x54fefc['id']}})[_0xaf69('0x11')](function(){return _0x524a53;});})[_0xaf69('0x11')](function(){_0x32514d['status'](0xcc)[_0xaf69('0x8')]();});}};}function handleEntityNotFound(_0x2d9e01){return function(_0x27ee11){if(!_0x27ee11){_0x2d9e01['sendStatus'](0x194);}return _0x27ee11;};}function handleError(_0x4d520d,_0x124bed){_0x124bed=_0x124bed||0x1f4;return function(_0x4be637){logger['error'](_0x4be637[_0xaf69('0x16')]);if(_0x4be637[_0xaf69('0x17')]){delete _0x4be637[_0xaf69('0x17')];}_0x4d520d[_0xaf69('0x9')](_0x124bed)[_0xaf69('0x18')](_0x4be637);};}exports['index']=function(_0x22ab5f,_0x112d69){var _0x14adf7={};var _0x535da6={'count':0x0,'rows':[]};var _0xd0f09e=_['map'](db[_0xaf69('0x19')][_0xaf69('0x1a')],function(_0x21e3a6){return{'name':_0x21e3a6[_0xaf69('0x1b')],'type':_0x21e3a6[_0xaf69('0x1c')]['key']};});_0x14adf7=qs['getOptions'](_0xd0f09e,_0x22ab5f);var _0x183ec5={'where':_0x14adf7['where']};return db[_0xaf69('0x19')][_0xaf69('0xe')](_0x183ec5)[_0xaf69('0x11')](function(_0x464abb){_0x535da6[_0xaf69('0xe')]=_0x464abb;_0x14adf7[_0xaf69('0x1d')]=qs[_0xaf69('0x1d')](_0x22ab5f[_0xaf69('0x1e')]);return db[_0xaf69('0x19')][_0xaf69('0x1f')](_0x14adf7);})['then'](function(_0x71afd6){_0x535da6[_0xaf69('0x20')]=_0x71afd6;return _0x535da6;})['then'](respondWithFilteredResult(_0x112d69,_0x14adf7))[_0xaf69('0x21')](handleError(_0x112d69,null));};exports[_0xaf69('0x22')]=function(_0x4513ea,_0x49ced5){var _0xc73dda={'raw':!![],'where':{'id':_0x4513ea[_0xaf69('0x23')]['id']}},_0x41ebe8={};_0x41ebe8[_0xaf69('0x24')]=_[_0xaf69('0x25')](db[_0xaf69('0x19')]['rawAttributes']);_0x41ebe8[_0xaf69('0x1e')]=_[_0xaf69('0x25')](_0x4513ea[_0xaf69('0x1e')]);_0x41ebe8[_0xaf69('0x26')]=_[_0xaf69('0x27')](_0x41ebe8[_0xaf69('0x24')],_0x41ebe8[_0xaf69('0x1e')]);_0xc73dda[_0xaf69('0x28')]=_[_0xaf69('0x27')](_0x41ebe8[_0xaf69('0x24')],qs[_0xaf69('0x29')](_0x4513ea['query'][_0xaf69('0x29')]));_0xc73dda[_0xaf69('0x28')]=_0xc73dda['attributes'][_0xaf69('0x2a')]?_0xc73dda['attributes']:_0x41ebe8[_0xaf69('0x24')];if(_0x4513ea[_0xaf69('0x1e')][_0xaf69('0x2b')]){_0xc73dda[_0xaf69('0x1d')]=[{'all':!![]}];}_0xc73dda=_[_0xaf69('0x2c')]({},_0xc73dda,_0x4513ea['options']);return db[_0xaf69('0x19')][_0xaf69('0x2d')](_0xc73dda)[_0xaf69('0x11')](handleEntityNotFound(_0x49ced5,null))['then'](respondWithResult(_0x49ced5,null))[_0xaf69('0x21')](handleError(_0x49ced5,null));};exports['create']=function(_0x44bbe2,_0x47d718){return db[_0xaf69('0x19')][_0xaf69('0x2e')](_0x44bbe2[_0xaf69('0x2f')],{})[_0xaf69('0x11')](function(_0x232aaa){var _0x4b6941=_0x44bbe2[_0xaf69('0x30')][_0xaf69('0x13')]({'plain':!![]});if(!_0x4b6941)throw new Error(_0xaf69('0x31'));if(_0x4b6941[_0xaf69('0x32')]===_0xaf69('0x30')){var _0x4cd3c2=_0x232aaa[_0xaf69('0x13')]({'plain':!![]});var _0x12e2e1='WhatsappQueues';return db[_0xaf69('0x33')][_0xaf69('0x2d')]({'where':{'name':_0x12e2e1,'userProfileId':_0x4b6941[_0xaf69('0x34')]},'raw':!![]})['then'](function(_0x279ff8){if(_0x279ff8&&_0x279ff8[_0xaf69('0x35')]===0x0){return db['UserProfileResource']['create']({'name':_0x4cd3c2[_0xaf69('0x17')],'resourceId':_0x4cd3c2['id'],'type':_0x279ff8[_0xaf69('0x17')],'sectionId':_0x279ff8['id']},{})[_0xaf69('0x11')](function(){return _0x232aaa;});}else{return _0x232aaa;}})[_0xaf69('0x21')](function(_0xbf8ce4){logger['error'](_0xaf69('0x36'),_0xbf8ce4);throw _0xbf8ce4;});}return _0x232aaa;})[_0xaf69('0x11')](respondWithResult(_0x47d718,0xc9))['catch'](handleError(_0x47d718,null));};exports['update']=function(_0x3855fe,_0x196ec3){if(_0x3855fe[_0xaf69('0x2f')]['id']){delete _0x3855fe[_0xaf69('0x2f')]['id'];}return db[_0xaf69('0x19')]['find']({'where':{'id':_0x3855fe[_0xaf69('0x23')]['id']}})[_0xaf69('0x11')](handleEntityNotFound(_0x196ec3,null))[_0xaf69('0x11')](saveUpdates(_0x3855fe[_0xaf69('0x2f')],null))[_0xaf69('0x11')](respondWithResult(_0x196ec3,null))[_0xaf69('0x21')](handleError(_0x196ec3,null));};exports[_0xaf69('0x12')]=function(_0x3c5fb0,_0x5c5dfa){return db[_0xaf69('0x19')][_0xaf69('0x2d')]({'where':{'id':_0x3c5fb0[_0xaf69('0x23')]['id']}})[_0xaf69('0x11')](handleEntityNotFound(_0x5c5dfa,null))[_0xaf69('0x11')](removeEntity(_0x5c5dfa,null))[_0xaf69('0x21')](handleError(_0x5c5dfa,null));};exports['describe']=function(_0x407514,_0x3f3c0b){return db['WhatsappQueue'][_0xaf69('0x37')]()['then'](respondWithResult(_0x3f3c0b,null))[_0xaf69('0x21')](handleError(_0x3f3c0b,null));};exports[_0xaf69('0x38')]=function(_0xb049a2,_0x5df123){var _0x5f3804={'raw':!![],'where':{}},_0x164829={},_0x3fca4e;return db[_0xaf69('0x19')]['findOne']({'where':{'id':_0xb049a2[_0xaf69('0x23')]['id']}})[_0xaf69('0x11')](handleEntityNotFound(_0x5df123,null))[_0xaf69('0x11')](function(_0x3df31c){if(_0x3df31c){_0x3fca4e=_0x3df31c['get']({'plain':!![]});_0x164829[_0xaf69('0x24')]=_['keys'](db[_0xaf69('0x39')][_0xaf69('0x1a')]);_0x164829[_0xaf69('0x1e')]=_['keys'](_0xb049a2['query']);_0x164829[_0xaf69('0x26')]=_['intersection'](_0x164829[_0xaf69('0x24')],_0x164829[_0xaf69('0x1e')]);_0x5f3804[_0xaf69('0x28')]=_[_0xaf69('0x27')](_0x164829[_0xaf69('0x24')],qs['fields'](_0xb049a2['query'][_0xaf69('0x29')]));_0x5f3804[_0xaf69('0x28')]=_0x5f3804[_0xaf69('0x28')][_0xaf69('0x2a')]?_0x5f3804[_0xaf69('0x28')]:_0x164829[_0xaf69('0x24')];if(!_0xb049a2[_0xaf69('0x1e')][_0xaf69('0x3a')](_0xaf69('0x3b'))){_0x5f3804[_0xaf69('0xd')]=qs[_0xaf69('0xd')](_0xb049a2[_0xaf69('0x1e')]['limit']);_0x5f3804[_0xaf69('0xb')]=qs['offset'](_0xb049a2[_0xaf69('0x1e')][_0xaf69('0xb')]);}_0x5f3804['order']=qs[_0xaf69('0x3c')](_0xb049a2['query']['sort']);_0x5f3804[_0xaf69('0x3d')]=qs['filters'](_['pick'](_0xb049a2[_0xaf69('0x1e')],_0x164829['filters']));_0x5f3804[_0xaf69('0x3d')][_0xaf69('0x3e')]=_0x3df31c['id'];if(_0xb049a2[_0xaf69('0x1e')][_0xaf69('0x3f')]){_0x5f3804['where']=_[_0xaf69('0x2c')](_0x5f3804[_0xaf69('0x3d')],{'$or':_[_0xaf69('0x40')](_0x5f3804['attributes'],function(_0xd7b574){var _0x11ca27={};_0x11ca27[_0xd7b574]={'$like':'%'+_0xb049a2[_0xaf69('0x1e')][_0xaf69('0x3f')]+'%'};return _0x11ca27;})});}_0x5f3804=_['merge']({},_0x5f3804,_0xb049a2[_0xaf69('0x41')]);return db['UserWhatsappQueue'][_0xaf69('0x1f')](_0x5f3804);}})[_0xaf69('0x11')](function(_0x5ac5eb){if(_0x5ac5eb){return db['User'][_0xaf69('0x42')]({'where':{'id':_[_0xaf69('0x40')](_0x5ac5eb,_0xaf69('0x43')),'role':_0xaf69('0x44')},'attributes':['id',_0xaf69('0x17'),_0xaf69('0x45'),_0xaf69('0x46'),_0xaf69('0x47')]});}})['then'](function(_0x21e14b){if(_0x21e14b){return{'count':_0x21e14b[_0xaf69('0xe')],'rows':_[_0xaf69('0x40')](_0x21e14b[_0xaf69('0x20')],function(_0x350a85){return{'membername':_0x350a85[_0xaf69('0x17')],'UserId':_0x350a85['id'],'queue_name':_0x3fca4e[_0xaf69('0x17')],'WhatsappQueueId':_0x3fca4e['id'],'interface':util[_0xaf69('0x48')](_0xaf69('0x49'),_0xaf69('0x4a'),_0x350a85[_0xaf69('0x17')]),'penalty':0x0,'paused':_0x350a85['whatsappPause'],'createdAt':_0x350a85[_0xaf69('0x47')],'updatedAt':_0x350a85[_0xaf69('0x46')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xaf69('0x11')](respondWithFilteredResult(_0x5df123,_0x5f3804))['catch'](handleError(_0x5df123,null));};exports[_0xaf69('0x4b')]=function(_0x2fd3a6,_0x335779){var _0x4547cd={};var _0x1fc9eb={};var _0x5b22c0;var _0x26de3f;return db[_0xaf69('0x19')][_0xaf69('0x4c')]({'where':{'id':_0x2fd3a6[_0xaf69('0x23')]['id']}})[_0xaf69('0x11')](handleEntityNotFound(_0x335779,null))[_0xaf69('0x11')](function(_0x5882b2){if(_0x5882b2){_0x5b22c0=_0x5882b2;_0x1fc9eb['model']=_[_0xaf69('0x25')](db['Team']['rawAttributes']);_0x1fc9eb['query']=_[_0xaf69('0x25')](_0x2fd3a6[_0xaf69('0x1e')]);_0x1fc9eb[_0xaf69('0x26')]=_[_0xaf69('0x27')](_0x1fc9eb[_0xaf69('0x24')],_0x1fc9eb[_0xaf69('0x1e')]);_0x4547cd['attributes']=_[_0xaf69('0x27')](_0x1fc9eb[_0xaf69('0x24')],qs[_0xaf69('0x29')](_0x2fd3a6[_0xaf69('0x1e')][_0xaf69('0x29')]));_0x4547cd['attributes']=_0x4547cd[_0xaf69('0x28')]['length']?_0x4547cd['attributes']:_0x1fc9eb['model'];_0x4547cd[_0xaf69('0x4d')]=qs[_0xaf69('0x3c')](_0x2fd3a6[_0xaf69('0x1e')]['sort']);_0x4547cd[_0xaf69('0x3d')]=qs[_0xaf69('0x26')](_[_0xaf69('0x4e')](_0x2fd3a6[_0xaf69('0x1e')],_0x1fc9eb[_0xaf69('0x26')]));if(_0x2fd3a6['query'][_0xaf69('0x3f')]){_0x4547cd[_0xaf69('0x3d')]=_[_0xaf69('0x2c')](_0x4547cd[_0xaf69('0x3d')],{'$or':_[_0xaf69('0x40')](_0x4547cd[_0xaf69('0x28')],function(_0x1c14d1){var _0x277074={};_0x277074[_0x1c14d1]={'$like':'%'+_0x2fd3a6[_0xaf69('0x1e')][_0xaf69('0x3f')]+'%'};return _0x277074;})});}_0x4547cd=_['merge']({},_0x4547cd,_0x2fd3a6['options']);return _0x5b22c0['getTeams'](_0x4547cd);}})[_0xaf69('0x11')](function(_0x3c7e86){if(_0x3c7e86){_0x26de3f=_0x3c7e86[_0xaf69('0x2a')];if(!_0x2fd3a6['query'][_0xaf69('0x3a')](_0xaf69('0x3b'))){_0x4547cd[_0xaf69('0xd')]=qs[_0xaf69('0xd')](_0x2fd3a6[_0xaf69('0x1e')][_0xaf69('0xd')]);_0x4547cd['offset']=qs[_0xaf69('0xb')](_0x2fd3a6[_0xaf69('0x1e')][_0xaf69('0xb')]);}return _0x5b22c0[_0xaf69('0x4b')](_0x4547cd);}})[_0xaf69('0x11')](function(_0x15f9a5){if(_0x15f9a5){return _0x15f9a5?{'count':_0x26de3f,'rows':_0x15f9a5}:null;}})[_0xaf69('0x11')](respondWithResult(_0x335779,null))[_0xaf69('0x21')](handleError(_0x335779,null));};exports[_0xaf69('0x4f')]=function(_0x12e57c,_0x34951c){var _0x5ccc6a=_0x12e57c[_0xaf69('0x2f')][_0xaf69('0x50')];return db['Team'][_0xaf69('0x1f')]({'where':{'id':_0x5ccc6a},'attributes':['id'],'include':[{'model':db['User'],'as':_0xaf69('0x51'),'attributes':['id',_0xaf69('0x17'),_0xaf69('0x52'),_0xaf69('0x53'),_0xaf69('0x54')],'raw':!![]}]})[_0xaf69('0x11')](function(_0x3ab7e9){if(_0x3ab7e9){var _0x169799=_[_0xaf69('0x55')](_0x3ab7e9,function(_0x16178b){var _0x19a203=_0x16178b['get']({'plain':!![]});return _0x19a203[_0xaf69('0x51')];});return db[_0xaf69('0x19')]['find']({'where':{'id':_0x12e57c[_0xaf69('0x23')]['id']}})[_0xaf69('0x11')](function(_0x45d3cb){return db[_0xaf69('0x56')][_0xaf69('0x57')](function(_0x132944){return _0x45d3cb[_0xaf69('0x4f')](_0x5ccc6a,{'transaction':_0x132944})['then'](function(){return BPromise[_0xaf69('0x58')](_0x169799,function(_0x3627c6){return db[_0xaf69('0x39')][_0xaf69('0x59')]({'where':{'UserId':_0x3627c6['id'],'WhatsappQueueId':_0x12e57c[_0xaf69('0x23')]['id']},'transaction':_0x132944});});})[_0xaf69('0x11')](function(){_0x169799[_0xaf69('0x5a')](function(_0x7d51f0){socket[_0xaf69('0x5b')]('userWhatsappQueue:save',{'UserId':_0x7d51f0['id'],'WhatsappQueueId':_0x45d3cb['id']});});});});});}})[_0xaf69('0x11')](respondWithStatusCode(_0x34951c,null))[_0xaf69('0x21')](handleError(_0x34951c,null));};exports['removeTeams']=function(_0x30a165,_0x2c9d7d){return db['Team'][_0xaf69('0x1f')]({'where':{'id':_0x30a165[_0xaf69('0x1e')][_0xaf69('0x50')]},'attributes':['id'],'include':[{'model':db[_0xaf69('0x5c')],'as':_0xaf69('0x51'),'attributes':['id'],'raw':!![]}]})[_0xaf69('0x11')](handleEntityNotFound(_0x2c9d7d,null))[_0xaf69('0x11')](function(_0x42db9a){var _0x26fd37=_['map'](_0x42db9a,'id');var _0x21fe7f=[];var _0x55f998=[];var _0x5eecfc=squel[_0xaf69('0x5d')]();_0x5eecfc['field'](_0xaf69('0x5e'))['from'](_0xaf69('0x5f'),'tq')['join'](_0xaf69('0x60'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xaf69('0x3d')](_0xaf69('0x61'),_0x30a165[_0xaf69('0x23')]['id']);for(var _0x4ebf8d=0x0;_0x4ebf8d<_0x42db9a[_0xaf69('0x2a')];_0x4ebf8d+=0x1){let _0x4d3217=_0x42db9a[_0x4ebf8d];for(var _0x53cdd3=0x0;_0x53cdd3<_0x4d3217[_0xaf69('0x51')][_0xaf69('0x2a')];_0x53cdd3+=0x1){let _0x300b38=_0x4d3217['Agents'][_0x53cdd3];var _0xa1045a=_0x5eecfc[_0xaf69('0x62')]();_0xa1045a['where'](_0xaf69('0x63'),_0x300b38['id']);_0x55f998['push'](db[_0xaf69('0x56')][_0xaf69('0x1e')](_0xa1045a['toString'](),{'type':db[_0xaf69('0x56')][_0xaf69('0x64')][_0xaf69('0x65')]})[_0xaf69('0x11')](function(_0x5d434b){if(_0x5d434b[_0xaf69('0x2a')]===0x1){return _0x300b38['id'];}else{var _0x3bd0b6=_[_0xaf69('0x66')](_['map'](_0x5d434b,_0xaf69('0x67')),function(_0x367505){return _[_0xaf69('0x68')](_0x26fd37,_0x367505);});if(_0x3bd0b6){return _0x300b38['id'];}}}));}}return BPromise[_0xaf69('0x69')](_0x55f998)[_0xaf69('0x11')](function(_0x569508){_0x21fe7f=_(_0x21fe7f)[_0xaf69('0x6a')](_0x569508)[_0xaf69('0x6b')]()[_0xaf69('0x6c')]();return db[_0xaf69('0x19')][_0xaf69('0x2d')]({'where':{'id':_0x30a165['params']['id']}})['then'](function(_0x4b6305){return db[_0xaf69('0x56')]['transaction'](function(_0x57fad8){return _0x4b6305[_0xaf69('0x6d')](_0x30a165[_0xaf69('0x1e')]['ids'],{'transaction':_0x57fad8})['then'](function(){if(!_[_0xaf69('0x6e')](_0x21fe7f)){return _0x4b6305[_0xaf69('0x6f')](_0x21fe7f,{'transaction':_0x57fad8});}})[_0xaf69('0x11')](function(){_0x21fe7f['forEach'](function(_0x1ea873){socket[_0xaf69('0x5b')]('userWhatsappQueue:remove',{'UserId':_0x1ea873,'WhatsappQueueId':_0x4b6305['id']});});});});});});})[_0xaf69('0x11')](respondWithStatusCode(_0x2c9d7d,null))[_0xaf69('0x21')](handleError(_0x2c9d7d,null));};exports[_0xaf69('0x70')]=function(_0x383a4e,_0xc0befc){return db['WhatsappQueue'][_0xaf69('0x2d')]({'where':{'id':_0x383a4e[_0xaf69('0x23')]['id']}})[_0xaf69('0x11')](handleEntityNotFound(_0xc0befc,null))['then'](function(_0xa42fac){if(_0xa42fac){return _0xa42fac[_0xaf69('0x70')](_0x383a4e[_0xaf69('0x2f')][_0xaf69('0x50')],_[_0xaf69('0x71')](_0x383a4e[_0xaf69('0x2f')],[_0xaf69('0x50'),'id'])||{})[_0xaf69('0x72')](function(_0x10f178){for(var _0x55197b=0x0;_0x55197b<_0x383a4e['body']['ids'][_0xaf69('0x2a')];_0x55197b+=0x1){socket[_0xaf69('0x5b')](_0xaf69('0x73'),{'UserId':Number(_0x383a4e[_0xaf69('0x2f')][_0xaf69('0x50')][_0x55197b]),'WhatsappQueueId':Number(_0x383a4e['params']['id'])});}return _0x10f178;});}})['then'](respondWithResult(_0xc0befc,null))[_0xaf69('0x21')](handleError(_0xc0befc,null));};exports[_0xaf69('0x6f')]=function(_0x13afa0,_0x6a0ed7){return db[_0xaf69('0x19')][_0xaf69('0x2d')]({'where':{'id':_0x13afa0[_0xaf69('0x23')]['id']}})[_0xaf69('0x11')](handleEntityNotFound(_0x6a0ed7,null))['then'](function(_0x1af862){if(_0x1af862){return _0x1af862[_0xaf69('0x6f')](_0x13afa0[_0xaf69('0x1e')][_0xaf69('0x50')])[_0xaf69('0x11')](function(){if(_[_0xaf69('0x74')](_0x13afa0['query'][_0xaf69('0x50')])){for(var _0x2d039a=0x0;_0x2d039a<_0x13afa0[_0xaf69('0x1e')]['ids'][_0xaf69('0x2a')];_0x2d039a+=0x1){socket[_0xaf69('0x5b')](_0xaf69('0x75'),{'UserId':Number(_0x13afa0[_0xaf69('0x1e')][_0xaf69('0x50')][_0x2d039a]),'WhatsappQueueId':Number(_0x13afa0[_0xaf69('0x23')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x13afa0[_0xaf69('0x1e')]['ids']),'WhatsappQueueId':Number(_0x13afa0['params']['id'])});}});}})['then'](respondWithStatusCode(_0x6a0ed7,null))[_0xaf69('0x21')](handleError(_0x6a0ed7,null));};exports[_0xaf69('0x76')]=function(_0x489cf3,_0x370b42){var _0x560b14={};var _0x2a0eee={};var _0x302a6b;var _0x298fb0;return db[_0xaf69('0x19')][_0xaf69('0x4c')]({'where':{'id':_0x489cf3[_0xaf69('0x23')]['id']}})[_0xaf69('0x11')](handleEntityNotFound(_0x370b42,null))[_0xaf69('0x11')](function(_0x257b76){if(_0x257b76){_0x302a6b=_0x257b76;_0x2a0eee[_0xaf69('0x24')]=_['keys'](db['User'][_0xaf69('0x1a')]);_0x2a0eee[_0xaf69('0x1e')]=_[_0xaf69('0x25')](_0x489cf3['query']);_0x2a0eee[_0xaf69('0x26')]=_['intersection'](_0x2a0eee[_0xaf69('0x24')],_0x2a0eee[_0xaf69('0x1e')]);_0x560b14[_0xaf69('0x28')]=_[_0xaf69('0x27')](_0x2a0eee[_0xaf69('0x24')],qs[_0xaf69('0x29')](_0x489cf3[_0xaf69('0x1e')][_0xaf69('0x29')]));_0x560b14[_0xaf69('0x28')]=_0x560b14[_0xaf69('0x28')][_0xaf69('0x2a')]?_0x560b14[_0xaf69('0x28')]:_0x2a0eee[_0xaf69('0x24')];_0x560b14[_0xaf69('0x4d')]=qs[_0xaf69('0x3c')](_0x489cf3['query']['sort']);_0x560b14[_0xaf69('0x3d')]=qs[_0xaf69('0x26')](_['pick'](_0x489cf3[_0xaf69('0x1e')],_0x2a0eee[_0xaf69('0x26')]));if(_0x489cf3['query'][_0xaf69('0x3f')]){_0x560b14[_0xaf69('0x3d')]=_['merge'](_0x560b14[_0xaf69('0x3d')],{'$or':_[_0xaf69('0x40')](_0x560b14[_0xaf69('0x28')],function(_0x44f4bb){var _0x1f2c24={};_0x1f2c24[_0x44f4bb]={'$like':'%'+_0x489cf3[_0xaf69('0x1e')][_0xaf69('0x3f')]+'%'};return _0x1f2c24;})});}_0x560b14=_[_0xaf69('0x2c')]({},_0x560b14,_0x489cf3[_0xaf69('0x41')]);return _0x302a6b['getAgents'](_0x560b14);}})[_0xaf69('0x11')](function(_0x2e15cb){if(_0x2e15cb){_0x298fb0=_0x2e15cb[_0xaf69('0x2a')];if(!_0x489cf3[_0xaf69('0x1e')][_0xaf69('0x3a')](_0xaf69('0x3b'))){_0x560b14[_0xaf69('0xd')]=qs['limit'](_0x489cf3[_0xaf69('0x1e')][_0xaf69('0xd')]);_0x560b14[_0xaf69('0xb')]=qs['offset'](_0x489cf3[_0xaf69('0x1e')][_0xaf69('0xb')]);}return _0x302a6b[_0xaf69('0x76')](_0x560b14);}})[_0xaf69('0x11')](function(_0x4f87ee){if(_0x4f87ee){return _0x4f87ee?{'count':_0x298fb0,'rows':_0x4f87ee}:null;}})[_0xaf69('0x11')](respondWithResult(_0x370b42,null))[_0xaf69('0x21')](handleError(_0x370b42,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index e9b7dcc..8eda528 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3264=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappQueue','setMaxListeners','save'];(function(_0x5a554a,_0x55b05a){var _0x46920e=function(_0x37b9df){while(--_0x37b9df){_0x5a554a['push'](_0x5a554a['shift']());}};_0x46920e(++_0x55b05a);}(_0x3264,0x114));var _0x4326=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x3264[_0x5f1391];return _0x50ebe3;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x4326('0x0'))['db'][_0x4326('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4326('0x2')](0x0);var events={'afterCreate':_0x4326('0x3'),'afterUpdate':_0x4326('0x4'),'afterDestroy':_0x4326('0x5')};function emitEvent(_0x116bc0){return function(_0x25ec5a,_0x49a08c,_0x4c629c){WhatsappQueueEvents[_0x4326('0x6')](_0x116bc0+':'+_0x25ec5a['id'],_0x25ec5a);WhatsappQueueEvents[_0x4326('0x6')](_0x116bc0,_0x25ec5a);_0x4c629c(null);};}for(var e in events){if(events[_0x4326('0x7')](e)){var event=events[e];WhatsappQueue[_0x4326('0x8')](e,emitEvent(event));}}module[_0x4326('0x9')]=WhatsappQueueEvents; \ No newline at end of file +var _0xc08e=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue'];(function(_0x2d22cd,_0x207c38){var _0x41b394=function(_0x2777c0){while(--_0x2777c0){_0x2d22cd['push'](_0x2d22cd['shift']());}};_0x41b394(++_0x207c38);}(_0xc08e,0x11f));var _0xec08=function(_0x440e9e,_0x49ffde){_0x440e9e=_0x440e9e-0x0;var _0x3292d3=_0xc08e[_0x440e9e];return _0x3292d3;};'use strict';var EventEmitter=require(_0xec08('0x0'));var WhatsappQueue=require(_0xec08('0x1'))['db'][_0xec08('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xec08('0x3')](0x0);var events={'afterCreate':_0xec08('0x4'),'afterUpdate':'update','afterDestroy':_0xec08('0x5')};function emitEvent(_0xc6899f){return function(_0x52f8c8,_0x1d8f92,_0x5debe9){WhatsappQueueEvents[_0xec08('0x6')](_0xc6899f+':'+_0x52f8c8['id'],_0x52f8c8);WhatsappQueueEvents[_0xec08('0x6')](_0xc6899f,_0x52f8c8);_0x5debe9(null);};}for(var e in events){if(events[_0xec08('0x7')](e)){var event=events[e];WhatsappQueue[_0xec08('0x8')](e,emitEvent(event));}}module[_0xec08('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 5d891f7..4bf4846 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb386=['rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','whatsapp_queues','lodash','util','api','moment','request-promise','path'];(function(_0x3e0a02,_0x2642b3){var _0x50a8f6=function(_0x4199fa){while(--_0x4199fa){_0x3e0a02['push'](_0x3e0a02['shift']());}};_0x50a8f6(++_0x2642b3);}(_0xb386,0x156));var _0x6b38=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb386[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6b38('0x0'));var util=require(_0x6b38('0x1'));var logger=require('../../config/logger')(_0x6b38('0x2'));var moment=require(_0x6b38('0x3'));var BPromise=require('bluebird');var rp=require(_0x6b38('0x4'));var fs=require('fs');var path=require(_0x6b38('0x5'));var rimraf=require(_0x6b38('0x6'));var config=require(_0x6b38('0x7'));var attributes=require(_0x6b38('0x8'));module[_0x6b38('0x9')]=function(_0x250ec3,_0xd4324d){return _0x250ec3[_0x6b38('0xa')]('WhatsappQueue',attributes,{'tableName':_0x6b38('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a8d=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','api'];(function(_0x39609a,_0x28a563){var _0xecd92=function(_0x57241a){while(--_0x57241a){_0x39609a['push'](_0x39609a['shift']());}};_0xecd92(++_0x28a563);}(_0x3a8d,0x14d));var _0xd3a8=function(_0x5ef905,_0x564b87){_0x5ef905=_0x5ef905-0x0;var _0x367808=_0x3a8d[_0x5ef905];return _0x367808;};'use strict';var _=require(_0xd3a8('0x0'));var util=require(_0xd3a8('0x1'));var logger=require('../../config/logger')(_0xd3a8('0x2'));var moment=require(_0xd3a8('0x3'));var BPromise=require(_0xd3a8('0x4'));var rp=require(_0xd3a8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd3a8('0x6'));var config=require(_0xd3a8('0x7'));var attributes=require('./whatsappQueue.attributes');module[_0xd3a8('0x8')]=function(_0x3f8696,_0x13716a){return _0x3f8696[_0xd3a8('0x9')](_0xd3a8('0xa'),attributes,{'tableName':_0xd3a8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index cf3060f..0e6c6f3 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d06=['WhatsappQueue','findAll','options','raw','attributes','limit','include','map','model','ShowWhatsappQueue','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','catch','GetWhatsappQueue'];(function(_0x2f9288,_0x1809af){var _0x412321=function(_0x4df29f){while(--_0x4df29f){_0x2f9288['push'](_0x2f9288['shift']());}};_0x412321(++_0x1809af);}(_0x1d06,0x1c3));var _0x61d0=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x1d06[_0x3511d3];return _0x5d6321;};'use strict';var _=require('lodash');var util=require(_0x61d0('0x0'));var moment=require(_0x61d0('0x1'));var BPromise=require(_0x61d0('0x2'));var rs=require(_0x61d0('0x3'));var fs=require('fs');var Redis=require(_0x61d0('0x4'));var db=require(_0x61d0('0x5'))['db'];var utils=require(_0x61d0('0x6'));var logger=require(_0x61d0('0x7'))('rpc');var config=require(_0x61d0('0x8'));var jayson=require(_0x61d0('0x9'));var client=jayson[_0x61d0('0xa')][_0x61d0('0xb')]({'port':0x232a});config[_0x61d0('0xc')]=_['defaults'](config['redis'],{'host':_0x61d0('0xd'),'port':0x18eb});var socket=require(_0x61d0('0xe'))(new Redis(config[_0x61d0('0xc')]));require(_0x61d0('0xf'))[_0x61d0('0x10')](socket);function respondWithRpcPromise(_0x11aae4,_0x5edcea,_0x4b025a){return new BPromise(function(_0x126d95,_0x7f500c){return client[_0x61d0('0x11')](_0x11aae4,_0x4b025a)[_0x61d0('0x12')](function(_0x5b02da){logger[_0x61d0('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x5edcea,_0x61d0('0x14'));logger[_0x61d0('0x15')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x5edcea,_0x61d0('0x14'),JSON[_0x61d0('0x16')](_0x5b02da));if(_0x5b02da[_0x61d0('0x17')]){if(_0x5b02da['error'][_0x61d0('0x18')]===0x1f4){logger[_0x61d0('0x17')](_0x61d0('0x19'),_0x5edcea,_0x5b02da[_0x61d0('0x17')][_0x61d0('0x1a')]);return _0x7f500c(_0x5b02da[_0x61d0('0x17')][_0x61d0('0x1a')]);}logger[_0x61d0('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x5edcea,_0x5b02da[_0x61d0('0x17')][_0x61d0('0x1a')]);return _0x126d95(_0x5b02da[_0x61d0('0x17')]['message']);}else{logger[_0x61d0('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x5edcea,_0x61d0('0x14'));_0x126d95(_0x5b02da['result'][_0x61d0('0x1a')]);}})[_0x61d0('0x1b')](function(_0x37d7fe){logger[_0x61d0('0x17')](_0x61d0('0x19'),_0x5edcea,_0x37d7fe);_0x7f500c(_0x37d7fe);});});}exports[_0x61d0('0x1c')]=function(_0x445255){var _0x4c83b4=this;return new Promise(function(_0x14f185,_0x158ea7){return db[_0x61d0('0x1d')][_0x61d0('0x1e')]({'raw':_0x445255['options']?_0x445255[_0x61d0('0x1f')][_0x61d0('0x20')]===undefined?!![]:![]:!![],'where':_0x445255['options']?_0x445255[_0x61d0('0x1f')]['where']||null:null,'attributes':_0x445255[_0x61d0('0x1f')]?_0x445255[_0x61d0('0x1f')][_0x61d0('0x21')]||null:null,'limit':_0x445255[_0x61d0('0x1f')]?_0x445255[_0x61d0('0x1f')][_0x61d0('0x22')]||null:null,'include':_0x445255[_0x61d0('0x1f')]?_0x445255['options'][_0x61d0('0x23')]?_[_0x61d0('0x24')](_0x445255[_0x61d0('0x1f')][_0x61d0('0x23')],function(_0x2eff4c){return{'model':db[_0x2eff4c[_0x61d0('0x25')]],'as':_0x2eff4c['as'],'attributes':_0x2eff4c[_0x61d0('0x21')],'include':_0x2eff4c['include']?_['map'](_0x2eff4c['include'],function(_0x217bb4){return{'model':db[_0x217bb4[_0x61d0('0x25')]],'as':_0x217bb4['as'],'attributes':_0x217bb4[_0x61d0('0x21')],'include':_0x217bb4[_0x61d0('0x23')]?_[_0x61d0('0x24')](_0x217bb4[_0x61d0('0x23')],function(_0x5f9b14){return{'model':db[_0x5f9b14[_0x61d0('0x25')]],'as':_0x5f9b14['as'],'attributes':_0x5f9b14[_0x61d0('0x21')]};}):[]};}):[]};}):[]:[]})[_0x61d0('0x12')](function(_0x2fb7ec){logger[_0x61d0('0x13')](_0x61d0('0x1c'),_0x445255);logger[_0x61d0('0x15')](_0x61d0('0x1c'),_0x445255,JSON[_0x61d0('0x16')](_0x2fb7ec));_0x14f185(_0x2fb7ec);})[_0x61d0('0x1b')](function(_0x35f6e2){logger[_0x61d0('0x17')]('GetWhatsappQueue',_0x35f6e2['message'],_0x445255);_0x158ea7(_0x4c83b4[_0x61d0('0x17')](0x1f4,_0x35f6e2[_0x61d0('0x1a')]));});});};exports[_0x61d0('0x26')]=function(_0x35385a){var _0x5d5915=this;return new Promise(function(_0x445834,_0x34a37a){return db[_0x61d0('0x1d')]['find']({'raw':_0x35385a[_0x61d0('0x1f')]?_0x35385a[_0x61d0('0x1f')][_0x61d0('0x20')]===undefined?!![]:![]:!![],'where':_0x35385a[_0x61d0('0x1f')]?_0x35385a[_0x61d0('0x1f')][_0x61d0('0x27')]||null:null,'attributes':_0x35385a['options']?_0x35385a['options']['attributes']||null:null,'include':_0x35385a[_0x61d0('0x1f')]?_0x35385a[_0x61d0('0x1f')][_0x61d0('0x23')]?_[_0x61d0('0x24')](_0x35385a[_0x61d0('0x1f')][_0x61d0('0x23')],function(_0xa0d571){return{'model':db[_0xa0d571[_0x61d0('0x25')]],'as':_0xa0d571['as'],'attributes':_0xa0d571[_0x61d0('0x21')],'include':_0xa0d571[_0x61d0('0x23')]?_['map'](_0xa0d571[_0x61d0('0x23')],function(_0x541139){return{'model':db[_0x541139[_0x61d0('0x25')]],'as':_0x541139['as'],'attributes':_0x541139[_0x61d0('0x21')],'include':_0x541139[_0x61d0('0x23')]?_[_0x61d0('0x24')](_0x541139[_0x61d0('0x23')],function(_0x1d8d84){return{'model':db[_0x1d8d84[_0x61d0('0x25')]],'as':_0x1d8d84['as'],'attributes':_0x1d8d84[_0x61d0('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c019a){logger['info'](_0x61d0('0x26'),_0x35385a);logger['debug']('ShowWhatsappQueue',_0x35385a,JSON[_0x61d0('0x16')](_0x3c019a));_0x445834(_0x3c019a);})[_0x61d0('0x1b')](function(_0x282036){logger[_0x61d0('0x17')](_0x61d0('0x26'),_0x282036[_0x61d0('0x1a')],_0x35385a);_0x34a37a(_0x5d5915[_0x61d0('0x17')](0x1f4,_0x282036['message']));});});}; \ No newline at end of file +var _0x4f34=['request\x20sent','stringify','error','code','message','result','GetWhatsappQueue','findAll','options','raw','include','map','attributes','model','ShowWhatsappQueue','WhatsappQueue','where','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x41c4aa,_0xb881f4){var _0xc847a8=function(_0x38fbc0){while(--_0x38fbc0){_0x41c4aa['push'](_0x41c4aa['shift']());}};_0xc847a8(++_0xb881f4);}(_0x4f34,0x1ca));var _0x44f3=function(_0x3f9138,_0x57aa27){_0x3f9138=_0x3f9138-0x0;var _0x224d79=_0x4f34[_0x3f9138];return _0x224d79;};'use strict';var _=require('lodash');var util=require(_0x44f3('0x0'));var moment=require(_0x44f3('0x1'));var BPromise=require(_0x44f3('0x2'));var rs=require(_0x44f3('0x3'));var fs=require('fs');var Redis=require(_0x44f3('0x4'));var db=require(_0x44f3('0x5'))['db'];var utils=require(_0x44f3('0x6'));var logger=require('../../config/logger')(_0x44f3('0x7'));var config=require(_0x44f3('0x8'));var jayson=require(_0x44f3('0x9'));var client=jayson[_0x44f3('0xa')][_0x44f3('0xb')]({'port':0x232a});config['redis']=_[_0x44f3('0xc')](config[_0x44f3('0xd')],{'host':_0x44f3('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44f3('0xd')]));require('./whatsappQueue.socket')[_0x44f3('0xf')](socket);function respondWithRpcPromise(_0x4621e5,_0x40da33,_0x4be209){return new BPromise(function(_0x19c216,_0x4ca974){return client[_0x44f3('0x10')](_0x4621e5,_0x4be209)[_0x44f3('0x11')](function(_0x2f648e){logger[_0x44f3('0x12')](_0x44f3('0x13'),_0x40da33,'request\x20sent');logger[_0x44f3('0x14')](_0x44f3('0x15'),_0x40da33,_0x44f3('0x16'),JSON[_0x44f3('0x17')](_0x2f648e));if(_0x2f648e['error']){if(_0x2f648e[_0x44f3('0x18')][_0x44f3('0x19')]===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x40da33,_0x2f648e[_0x44f3('0x18')][_0x44f3('0x1a')]);return _0x4ca974(_0x2f648e['error'][_0x44f3('0x1a')]);}logger[_0x44f3('0x18')](_0x44f3('0x13'),_0x40da33,_0x2f648e[_0x44f3('0x18')][_0x44f3('0x1a')]);return _0x19c216(_0x2f648e[_0x44f3('0x18')][_0x44f3('0x1a')]);}else{logger[_0x44f3('0x12')](_0x44f3('0x13'),_0x40da33,_0x44f3('0x16'));_0x19c216(_0x2f648e[_0x44f3('0x1b')]['message']);}})['catch'](function(_0x398c3f){logger['error'](_0x44f3('0x13'),_0x40da33,_0x398c3f);_0x4ca974(_0x398c3f);});});}exports[_0x44f3('0x1c')]=function(_0x616dae){var _0x21ed7e=this;return new Promise(function(_0x1f29e8,_0x1fceb8){return db['WhatsappQueue'][_0x44f3('0x1d')]({'raw':_0x616dae[_0x44f3('0x1e')]?_0x616dae[_0x44f3('0x1e')][_0x44f3('0x1f')]===undefined?!![]:![]:!![],'where':_0x616dae[_0x44f3('0x1e')]?_0x616dae[_0x44f3('0x1e')]['where']||null:null,'attributes':_0x616dae[_0x44f3('0x1e')]?_0x616dae['options']['attributes']||null:null,'limit':_0x616dae['options']?_0x616dae[_0x44f3('0x1e')]['limit']||null:null,'include':_0x616dae[_0x44f3('0x1e')]?_0x616dae[_0x44f3('0x1e')][_0x44f3('0x20')]?_[_0x44f3('0x21')](_0x616dae[_0x44f3('0x1e')][_0x44f3('0x20')],function(_0x1f983d){return{'model':db[_0x1f983d['model']],'as':_0x1f983d['as'],'attributes':_0x1f983d[_0x44f3('0x22')],'include':_0x1f983d[_0x44f3('0x20')]?_[_0x44f3('0x21')](_0x1f983d[_0x44f3('0x20')],function(_0x5f5c77){return{'model':db[_0x5f5c77[_0x44f3('0x23')]],'as':_0x5f5c77['as'],'attributes':_0x5f5c77[_0x44f3('0x22')],'include':_0x5f5c77['include']?_[_0x44f3('0x21')](_0x5f5c77[_0x44f3('0x20')],function(_0x2b858c){return{'model':db[_0x2b858c[_0x44f3('0x23')]],'as':_0x2b858c['as'],'attributes':_0x2b858c['attributes']};}):[]};}):[]};}):[]:[]})[_0x44f3('0x11')](function(_0x48558e){logger[_0x44f3('0x12')](_0x44f3('0x1c'),_0x616dae);logger[_0x44f3('0x14')](_0x44f3('0x1c'),_0x616dae,JSON['stringify'](_0x48558e));_0x1f29e8(_0x48558e);})['catch'](function(_0x5d2992){logger['error']('GetWhatsappQueue',_0x5d2992[_0x44f3('0x1a')],_0x616dae);_0x1fceb8(_0x21ed7e[_0x44f3('0x18')](0x1f4,_0x5d2992[_0x44f3('0x1a')]));});});};exports[_0x44f3('0x24')]=function(_0x36e3dc){var _0x65db11=this;return new Promise(function(_0xa5b5fa,_0x38d883){return db[_0x44f3('0x25')]['find']({'raw':_0x36e3dc[_0x44f3('0x1e')]?_0x36e3dc[_0x44f3('0x1e')][_0x44f3('0x1f')]===undefined?!![]:![]:!![],'where':_0x36e3dc[_0x44f3('0x1e')]?_0x36e3dc[_0x44f3('0x1e')][_0x44f3('0x26')]||null:null,'attributes':_0x36e3dc['options']?_0x36e3dc['options'][_0x44f3('0x22')]||null:null,'include':_0x36e3dc[_0x44f3('0x1e')]?_0x36e3dc[_0x44f3('0x1e')][_0x44f3('0x20')]?_[_0x44f3('0x21')](_0x36e3dc[_0x44f3('0x1e')]['include'],function(_0x374fe9){return{'model':db[_0x374fe9[_0x44f3('0x23')]],'as':_0x374fe9['as'],'attributes':_0x374fe9[_0x44f3('0x22')],'include':_0x374fe9['include']?_['map'](_0x374fe9[_0x44f3('0x20')],function(_0x4f4689){return{'model':db[_0x4f4689[_0x44f3('0x23')]],'as':_0x4f4689['as'],'attributes':_0x4f4689[_0x44f3('0x22')],'include':_0x4f4689['include']?_[_0x44f3('0x21')](_0x4f4689['include'],function(_0x32b9db){return{'model':db[_0x32b9db[_0x44f3('0x23')]],'as':_0x32b9db['as'],'attributes':_0x32b9db[_0x44f3('0x22')]};}):[]};}):[]};}):[]:[]})[_0x44f3('0x11')](function(_0x7f521f){logger[_0x44f3('0x12')](_0x44f3('0x24'),_0x36e3dc);logger[_0x44f3('0x14')]('ShowWhatsappQueue',_0x36e3dc,JSON[_0x44f3('0x17')](_0x7f521f));_0xa5b5fa(_0x7f521f);})[_0x44f3('0x27')](function(_0x4e8ead){logger[_0x44f3('0x18')](_0x44f3('0x24'),_0x4e8ead[_0x44f3('0x1a')],_0x36e3dc);_0x38d883(_0x65db11['error'](0x1f4,_0x4e8ead[_0x44f3('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 9da6372..4dc20cc 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe036=['register','length','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','removeListener'];(function(_0x497566,_0x498468){var _0x23d26a=function(_0xef8827){while(--_0xef8827){_0x497566['push'](_0x497566['shift']());}};_0x23d26a(++_0x498468);}(_0xe036,0x78));var _0x6e03=function(_0x36f42f,_0x57fcea){_0x36f42f=_0x36f42f-0x0;var _0x10e58a=_0xe036[_0x36f42f];return _0x10e58a;};'use strict';var WhatsappQueueEvents=require(_0x6e03('0x0'));var events=[_0x6e03('0x1'),_0x6e03('0x2'),_0x6e03('0x3')];function createListener(_0x3ef460,_0x520d55){return function(_0x2c7621){_0x520d55[_0x6e03('0x4')](_0x3ef460,_0x2c7621);};}function removeListener(_0xbe22aa,_0x49901d){return function(){WhatsappQueueEvents[_0x6e03('0x5')](_0xbe22aa,_0x49901d);};}exports[_0x6e03('0x6')]=function(_0x2da849){for(var _0x546cf3=0x0,_0x22fa46=events[_0x6e03('0x7')];_0x546cf3<_0x22fa46;_0x546cf3++){var _0x47ac43=events[_0x546cf3];var _0xaf49f5=createListener(_0x6e03('0x8')+_0x47ac43,_0x2da849);WhatsappQueueEvents['on'](_0x47ac43,_0xaf49f5);}}; \ No newline at end of file +var _0xaba7=['save','whatsappQueue:'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xaba7,0x1da));var _0x7aba=function(_0x3eaf5e,_0x3c9120){_0x3eaf5e=_0x3eaf5e-0x0;var _0x2e7aad=_0xaba7[_0x3eaf5e];return _0x2e7aad;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x7aba('0x0'),'remove','update'];function createListener(_0x376702,_0xdeb623){return function(_0x4c26e5){_0xdeb623['emit'](_0x376702,_0x4c26e5);};}function removeListener(_0x4e1714,_0x1470f8){return function(){WhatsappQueueEvents['removeListener'](_0x4e1714,_0x1470f8);};}exports['register']=function(_0x4788e1){for(var _0x107f59=0x0,_0x170744=events['length'];_0x107f59<_0x170744;_0x107f59++){var _0x3a72c9=events[_0x107f59];var _0x1b5899=createListener(_0x7aba('0x1')+_0x3a72c9,_0x4788e1);WhatsappQueueEvents['on'](_0x3a72c9,_0x1b5899);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index fa69506..4f6e066 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91b6=['/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x91b6,0x1d4));var _0x691b=function(_0x445fc6,_0x162f29){_0x445fc6=_0x445fc6-0x0;var _0x42708e=_0x91b6[_0x445fc6];return _0x42708e;};'use strict';var multer=require(_0x691b('0x0'));var util=require(_0x691b('0x1'));var path=require('path');var timeout=require(_0x691b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x691b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x691b('0x4'));var config=require(_0x691b('0x5'));var controller=require(_0x691b('0x6'));router[_0x691b('0x7')]('/',auth[_0x691b('0x8')](),controller[_0x691b('0x9')]);router[_0x691b('0x7')](_0x691b('0xa'),auth[_0x691b('0x8')](),controller[_0x691b('0xb')]);router[_0x691b('0x7')](_0x691b('0xc'),auth[_0x691b('0x8')](),controller[_0x691b('0xd')]);router[_0x691b('0xe')]('/',auth[_0x691b('0x8')](),controller[_0x691b('0xf')]);router[_0x691b('0x10')](_0x691b('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x691b('0x11')](_0x691b('0xc'),auth['isAuthenticated'](),controller[_0x691b('0x12')]);module[_0x691b('0x13')]=router; \ No newline at end of file +var _0x3788=['fs-extra','../../config/environment','./whatsappQueueReport.controller','get','index','/describe','show','post','isAuthenticated','create','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','Router'];(function(_0xe0f242,_0x2f4ecf){var _0x3b801a=function(_0x29d08c){while(--_0x29d08c){_0xe0f242['push'](_0xe0f242['shift']());}};_0x3b801a(++_0x2f4ecf);}(_0x3788,0x73));var _0x8378=function(_0x579735,_0x3a6b85){_0x579735=_0x579735-0x0;var _0x10b914=_0x3788[_0x579735];return _0x10b914;};'use strict';var multer=require(_0x8378('0x0'));var util=require(_0x8378('0x1'));var path=require(_0x8378('0x2'));var timeout=require(_0x8378('0x3'));var express=require('express');var router=express[_0x8378('0x4')]();var fs_extra=require(_0x8378('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8378('0x6'));var controller=require(_0x8378('0x7'));router[_0x8378('0x8')]('/',auth['isAuthenticated'](),controller[_0x8378('0x9')]);router[_0x8378('0x8')](_0x8378('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x8378('0xb')]);router[_0x8378('0xc')]('/',auth[_0x8378('0xd')](),controller[_0x8378('0xe')]);router[_0x8378('0xf')]('/:id',auth[_0x8378('0xd')](),controller[_0x8378('0x10')]);router[_0x8378('0x11')](_0x8378('0x12'),auth[_0x8378('0xd')](),controller[_0x8378('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index ee14dd4..ed24c4d 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x36f77d,_0x3287b8){var _0x442eb5=function(_0x2dca1c){while(--_0x2dca1c){_0x36f77d['push'](_0x36f77d['shift']());}};_0x442eb5(++_0x3287b8);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x25cf97,_0x4d62f8){var _0x2963ae=function(_0x5294bc){while(--_0x5294bc){_0x25cf97['push'](_0x25cf97['shift']());}};_0x2963ae(++_0x4d62f8);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index d5baf1f..7699030 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cf8=['limit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','findAll','rows','show','merge','find','create','body','params','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x239875,_0x52a793){var _0x55a8d6=function(_0x1c48db){while(--_0x1c48db){_0x239875['push'](_0x239875['shift']());}};_0x55a8d6(++_0x52a793);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0x4cf8[_0x4914e2];return _0x2dcd07;};'use strict';var emlformat=require(_0x84cf('0x0'));var rimraf=require(_0x84cf('0x1'));var zipdir=require(_0x84cf('0x2'));var jsonpatch=require(_0x84cf('0x3'));var rp=require(_0x84cf('0x4'));var moment=require(_0x84cf('0x5'));var BPromise=require(_0x84cf('0x6'));var Mustache=require(_0x84cf('0x7'));var util=require(_0x84cf('0x8'));var path=require(_0x84cf('0x9'));var sox=require(_0x84cf('0xa'));var csv=require(_0x84cf('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84cf('0xc'));var squel=require('squel');var crypto=require(_0x84cf('0xd'));var jsforce=require(_0x84cf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x84cf('0xb'));var querystring=require(_0x84cf('0xf'));var Papa=require('papaparse');var Redis=require(_0x84cf('0x10'));var authService=require(_0x84cf('0x11'));var qs=require(_0x84cf('0x12'));var as=require(_0x84cf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84cf('0x14'))(_0x84cf('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x84cf('0x16'));var db=require(_0x84cf('0x17'))['db'];function respondWithStatusCode(_0x35f852,_0x33f83e){_0x33f83e=_0x33f83e||0xcc;return function(_0x172d04){if(_0x172d04){return _0x35f852[_0x84cf('0x18')](_0x33f83e);}return _0x35f852[_0x84cf('0x19')](_0x33f83e)[_0x84cf('0x1a')]();};}function respondWithResult(_0xced48,_0x250a19){_0x250a19=_0x250a19||0xc8;return function(_0x2fc41f){if(_0x2fc41f){return _0xced48[_0x84cf('0x19')](_0x250a19)[_0x84cf('0x1b')](_0x2fc41f);}};}function respondWithFilteredResult(_0x20e79c,_0x27261b){return function(_0x167c3e){if(_0x167c3e){var _0x464e70=typeof _0x27261b[_0x84cf('0x1c')]===_0x84cf('0x1d')&&typeof _0x27261b['limit']===_0x84cf('0x1d');var _0x5d6a93=_0x167c3e[_0x84cf('0x1e')];var _0x1abe2d=_0x464e70?0x0:_0x27261b[_0x84cf('0x1c')];var _0x13ba16=_0x464e70?_0x167c3e[_0x84cf('0x1e')]:_0x27261b['offset']+_0x27261b['limit'];var _0x42d6d4;if(_0x13ba16>=_0x5d6a93){_0x13ba16=_0x5d6a93;_0x42d6d4=0xc8;}else{_0x42d6d4=0xce;}_0x20e79c[_0x84cf('0x19')](_0x42d6d4);return _0x20e79c[_0x84cf('0x1f')](_0x84cf('0x20'),_0x1abe2d+'-'+_0x13ba16+'/'+_0x5d6a93)[_0x84cf('0x1b')](_0x167c3e);}return null;};}function patchUpdates(_0x5dda3f){return function(_0x39a37b){try{jsonpatch[_0x84cf('0x21')](_0x39a37b,_0x5dda3f,!![]);}catch(_0x3ca1be){return BPromise[_0x84cf('0x22')](_0x3ca1be);}return _0x39a37b[_0x84cf('0x23')]();};}function saveUpdates(_0x54405a,_0x42fa45){return function(_0x160f86){if(_0x160f86){return _0x160f86[_0x84cf('0x24')](_0x54405a)[_0x84cf('0x25')](function(_0x3e5e94){return _0x3e5e94;});}return null;};}function removeEntity(_0x29e9e1,_0x7feb4){return function(_0x4c9d1c){if(_0x4c9d1c){return _0x4c9d1c[_0x84cf('0x26')]()[_0x84cf('0x25')](function(){_0x29e9e1[_0x84cf('0x19')](0xcc)[_0x84cf('0x1a')]();});}};}function handleEntityNotFound(_0x1d220a,_0x44d4bf){return function(_0x3c7eda){if(!_0x3c7eda){_0x1d220a[_0x84cf('0x18')](0x194);}return _0x3c7eda;};}function handleError(_0x401aa4,_0x6797c0){_0x6797c0=_0x6797c0||0x1f4;return function(_0x5179c1){logger[_0x84cf('0x27')](_0x5179c1[_0x84cf('0x28')]);if(_0x5179c1[_0x84cf('0x29')]){delete _0x5179c1[_0x84cf('0x29')];}_0x401aa4['status'](_0x6797c0)[_0x84cf('0x2a')](_0x5179c1);};}exports['index']=function(_0x29455e,_0x4092fd){var _0x43b41b={},_0xc15298={},_0x51adcf={'count':0x0,'rows':[]};var _0x20de4b=_[_0x84cf('0x2b')](db[_0x84cf('0x2c')][_0x84cf('0x2d')],function(_0xb4fc5a){return{'name':_0xb4fc5a[_0x84cf('0x2e')],'type':_0xb4fc5a[_0x84cf('0x2f')][_0x84cf('0x30')]};});_0xc15298[_0x84cf('0x31')]=_['map'](_0x20de4b,'name');_0xc15298[_0x84cf('0x32')]=_[_0x84cf('0x33')](_0x29455e[_0x84cf('0x32')]);_0xc15298[_0x84cf('0x34')]=_[_0x84cf('0x35')](_0xc15298[_0x84cf('0x31')],_0xc15298[_0x84cf('0x32')]);_0x43b41b[_0x84cf('0x36')]=_['intersection'](_0xc15298[_0x84cf('0x31')],qs[_0x84cf('0x37')](_0x29455e['query'][_0x84cf('0x37')]));_0x43b41b['attributes']=_0x43b41b[_0x84cf('0x36')][_0x84cf('0x38')]?_0x43b41b[_0x84cf('0x36')]:_0xc15298[_0x84cf('0x31')];if(!_0x29455e[_0x84cf('0x32')]['hasOwnProperty'](_0x84cf('0x39'))){_0x43b41b['limit']=qs['limit'](_0x29455e[_0x84cf('0x32')][_0x84cf('0x3a')]);_0x43b41b['offset']=qs[_0x84cf('0x1c')](_0x29455e[_0x84cf('0x32')][_0x84cf('0x1c')]);}_0x43b41b[_0x84cf('0x3b')]=qs[_0x84cf('0x3c')](_0x29455e[_0x84cf('0x32')]['sort']);_0x43b41b[_0x84cf('0x3d')]=qs[_0x84cf('0x34')](_[_0x84cf('0x3e')](_0x29455e[_0x84cf('0x32')],_0xc15298[_0x84cf('0x34')]),_0x20de4b);if(_0x29455e[_0x84cf('0x32')]['filter']){_0x43b41b[_0x84cf('0x3d')]=_['merge'](_0x43b41b[_0x84cf('0x3d')],{'$or':_[_0x84cf('0x2b')](_0x20de4b,function(_0x3fa39a){if(_0x3fa39a[_0x84cf('0x2f')]!==_0x84cf('0x3f')){var _0x3897b0={};_0x3897b0[_0x3fa39a[_0x84cf('0x29')]]={'$like':'%'+_0x29455e[_0x84cf('0x32')][_0x84cf('0x40')]+'%'};return _0x3897b0;}})});}_0x43b41b=_['merge']({},_0x43b41b,_0x29455e[_0x84cf('0x41')]);var _0x516928={'where':_0x43b41b[_0x84cf('0x3d')]};return db[_0x84cf('0x2c')]['count'](_0x516928)[_0x84cf('0x25')](function(_0x531410){_0x51adcf[_0x84cf('0x1e')]=_0x531410;if(_0x29455e['query'][_0x84cf('0x42')]){_0x43b41b['include']=[{'all':!![]}];}return db[_0x84cf('0x2c')][_0x84cf('0x43')](_0x43b41b);})['then'](function(_0x847ce9){_0x51adcf[_0x84cf('0x44')]=_0x847ce9;return _0x51adcf;})[_0x84cf('0x25')](respondWithFilteredResult(_0x4092fd,_0x43b41b))['catch'](handleError(_0x4092fd,null));};exports[_0x84cf('0x45')]=function(_0x5f1b8e,_0x1c84e0){var _0x58b539={'raw':!![],'where':{'id':_0x5f1b8e['params']['id']}},_0x56b0e5={};_0x56b0e5[_0x84cf('0x31')]=_[_0x84cf('0x33')](db['WhatsappQueueReport'][_0x84cf('0x2d')]);_0x56b0e5['query']=_[_0x84cf('0x33')](_0x5f1b8e[_0x84cf('0x32')]);_0x56b0e5['filters']=_[_0x84cf('0x35')](_0x56b0e5['model'],_0x56b0e5[_0x84cf('0x32')]);_0x58b539['attributes']=_['intersection'](_0x56b0e5['model'],qs['fields'](_0x5f1b8e['query']['fields']));_0x58b539['attributes']=_0x58b539[_0x84cf('0x36')][_0x84cf('0x38')]?_0x58b539[_0x84cf('0x36')]:_0x56b0e5[_0x84cf('0x31')];if(_0x5f1b8e['query'][_0x84cf('0x42')]){_0x58b539['include']=[{'all':!![]}];}_0x58b539=_[_0x84cf('0x46')]({},_0x58b539,_0x5f1b8e[_0x84cf('0x41')]);return db[_0x84cf('0x2c')][_0x84cf('0x47')](_0x58b539)[_0x84cf('0x25')](handleEntityNotFound(_0x1c84e0,null))[_0x84cf('0x25')](respondWithResult(_0x1c84e0,null))['catch'](handleError(_0x1c84e0,null));};exports[_0x84cf('0x48')]=function(_0x2732bf,_0x4a4cf7){return db[_0x84cf('0x2c')][_0x84cf('0x48')](_0x2732bf[_0x84cf('0x49')],{})['then'](respondWithResult(_0x4a4cf7,0xc9))['catch'](handleError(_0x4a4cf7,null));};exports['update']=function(_0x1cf3f6,_0x104421){if(_0x1cf3f6[_0x84cf('0x49')]['id']){delete _0x1cf3f6[_0x84cf('0x49')]['id'];}return db[_0x84cf('0x2c')][_0x84cf('0x47')]({'where':{'id':_0x1cf3f6['params']['id']}})[_0x84cf('0x25')](handleEntityNotFound(_0x104421,null))['then'](saveUpdates(_0x1cf3f6[_0x84cf('0x49')],null))['then'](respondWithResult(_0x104421,null))['catch'](handleError(_0x104421,null));};exports[_0x84cf('0x26')]=function(_0xb1c3a8,_0x426df1){return db['WhatsappQueueReport']['find']({'where':{'id':_0xb1c3a8[_0x84cf('0x4a')]['id']}})[_0x84cf('0x25')](handleEntityNotFound(_0x426df1,null))[_0x84cf('0x25')](removeEntity(_0x426df1,null))[_0x84cf('0x4b')](handleError(_0x426df1,null));};exports[_0x84cf('0x4c')]=function(_0x4c2025,_0xcfe28f){return db[_0x84cf('0x2c')]['describe']()[_0x84cf('0x25')](respondWithResult(_0xcfe28f,null))['catch'](handleError(_0xcfe28f,null));}; \ No newline at end of file +var _0x6f7a=['squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','sendStatus','error','name','index','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','then','catch','show','params','keys','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x3e545c,_0x2070fe){var _0x10f5b1=function(_0x569b31){while(--_0x569b31){_0x3e545c['push'](_0x3e545c['shift']());}};_0x10f5b1(++_0x2070fe);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x27ab1d,_0x722bed){_0x27ab1d=_0x27ab1d-0x0;var _0x36b68c=_0x6f7a[_0x27ab1d];return _0x36b68c;};'use strict';var emlformat=require(_0xa6f7('0x0'));var rimraf=require(_0xa6f7('0x1'));var zipdir=require(_0xa6f7('0x2'));var jsonpatch=require(_0xa6f7('0x3'));var rp=require('request-promise');var moment=require(_0xa6f7('0x4'));var BPromise=require(_0xa6f7('0x5'));var Mustache=require(_0xa6f7('0x6'));var util=require(_0xa6f7('0x7'));var path=require(_0xa6f7('0x8'));var sox=require(_0xa6f7('0x9'));var csv=require(_0xa6f7('0xa'));var ejs=require(_0xa6f7('0xb'));var fs=require('fs');var fs_extra=require(_0xa6f7('0xc'));var _=require(_0xa6f7('0xd'));var squel=require(_0xa6f7('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa6f7('0xf'));var toCsv=require(_0xa6f7('0xa'));var querystring=require(_0xa6f7('0x10'));var Papa=require(_0xa6f7('0x11'));var Redis=require(_0xa6f7('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa6f7('0x13'));var hardwareService=require(_0xa6f7('0x14'));var logger=require('../../config/logger')(_0xa6f7('0x15'));var utils=require('../../config/utils');var config=require(_0xa6f7('0x16'));var licenseUtil=require(_0xa6f7('0x17'));var db=require(_0xa6f7('0x18'))['db'];function respondWithStatusCode(_0xd5558b,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x3fc7f1){if(_0x3fc7f1){return _0xd5558b['sendStatus'](_0x5a3035);}return _0xd5558b[_0xa6f7('0x19')](_0x5a3035)[_0xa6f7('0x1a')]();};}function respondWithResult(_0x25c123,_0x4d3d59){_0x4d3d59=_0x4d3d59||0xc8;return function(_0x34c02d){if(_0x34c02d){return _0x25c123['status'](_0x4d3d59)[_0xa6f7('0x1b')](_0x34c02d);}};}function respondWithFilteredResult(_0x57308a,_0x17b814){return function(_0x17f9c5){if(_0x17f9c5){var _0x6efd38=typeof _0x17b814['offset']===_0xa6f7('0x1c')&&typeof _0x17b814[_0xa6f7('0x1d')]===_0xa6f7('0x1c');var _0x2401b9=_0x17f9c5['count'];var _0x4a8827=_0x6efd38?0x0:_0x17b814[_0xa6f7('0x1e')];var _0x5298ba=_0x6efd38?_0x17f9c5[_0xa6f7('0x1f')]:_0x17b814[_0xa6f7('0x1e')]+_0x17b814['limit'];var _0x18fc4a;if(_0x5298ba>=_0x2401b9){_0x5298ba=_0x2401b9;_0x18fc4a=0xc8;}else{_0x18fc4a=0xce;}_0x57308a[_0xa6f7('0x19')](_0x18fc4a);return _0x57308a[_0xa6f7('0x20')](_0xa6f7('0x21'),_0x4a8827+'-'+_0x5298ba+'/'+_0x2401b9)[_0xa6f7('0x1b')](_0x17f9c5);}return null;};}function patchUpdates(_0x1aa8dc){return function(_0x4887ad){try{jsonpatch[_0xa6f7('0x22')](_0x4887ad,_0x1aa8dc,!![]);}catch(_0x45d79e){return BPromise['reject'](_0x45d79e);}return _0x4887ad['save']();};}function saveUpdates(_0x5ddc8d,_0x1de6c9){return function(_0x119950){if(_0x119950){return _0x119950['update'](_0x5ddc8d)['then'](function(_0x50e2be){return _0x50e2be;});}return null;};}function removeEntity(_0x2b6a84,_0xc77e8e){return function(_0x28263e){if(_0x28263e){return _0x28263e['destroy']()['then'](function(){_0x2b6a84[_0xa6f7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47ef97,_0x402d25){return function(_0x5efdce){if(!_0x5efdce){_0x47ef97[_0xa6f7('0x23')](0x194);}return _0x5efdce;};}function handleError(_0x126d24,_0x3c79ea){_0x3c79ea=_0x3c79ea||0x1f4;return function(_0x2b4c6c){logger[_0xa6f7('0x24')](_0x2b4c6c['stack']);if(_0x2b4c6c['name']){delete _0x2b4c6c[_0xa6f7('0x25')];}_0x126d24[_0xa6f7('0x19')](_0x3c79ea)['send'](_0x2b4c6c);};}exports[_0xa6f7('0x26')]=function(_0x27babb,_0x87bccc){var _0x3a7ff9={},_0x224f5a={},_0x10bf77={'count':0x0,'rows':[]};var _0x353de8=_[_0xa6f7('0x27')](db[_0xa6f7('0x28')][_0xa6f7('0x29')],function(_0x40b0f8){return{'name':_0x40b0f8[_0xa6f7('0x2a')],'type':_0x40b0f8['type'][_0xa6f7('0x2b')]};});_0x224f5a[_0xa6f7('0x2c')]=_['map'](_0x353de8,_0xa6f7('0x25'));_0x224f5a[_0xa6f7('0x2d')]=_['keys'](_0x27babb['query']);_0x224f5a[_0xa6f7('0x2e')]=_[_0xa6f7('0x2f')](_0x224f5a[_0xa6f7('0x2c')],_0x224f5a[_0xa6f7('0x2d')]);_0x3a7ff9[_0xa6f7('0x30')]=_['intersection'](_0x224f5a['model'],qs[_0xa6f7('0x31')](_0x27babb['query'][_0xa6f7('0x31')]));_0x3a7ff9[_0xa6f7('0x30')]=_0x3a7ff9[_0xa6f7('0x30')][_0xa6f7('0x32')]?_0x3a7ff9[_0xa6f7('0x30')]:_0x224f5a[_0xa6f7('0x2c')];if(!_0x27babb['query'][_0xa6f7('0x33')](_0xa6f7('0x34'))){_0x3a7ff9[_0xa6f7('0x1d')]=qs['limit'](_0x27babb[_0xa6f7('0x2d')]['limit']);_0x3a7ff9[_0xa6f7('0x1e')]=qs[_0xa6f7('0x1e')](_0x27babb[_0xa6f7('0x2d')]['offset']);}_0x3a7ff9[_0xa6f7('0x35')]=qs[_0xa6f7('0x36')](_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x36')]);_0x3a7ff9[_0xa6f7('0x37')]=qs[_0xa6f7('0x2e')](_['pick'](_0x27babb[_0xa6f7('0x2d')],_0x224f5a[_0xa6f7('0x2e')]),_0x353de8);if(_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x38')]){_0x3a7ff9[_0xa6f7('0x37')]=_[_0xa6f7('0x39')](_0x3a7ff9[_0xa6f7('0x37')],{'$or':_[_0xa6f7('0x27')](_0x353de8,function(_0x4c2d2e){if(_0x4c2d2e[_0xa6f7('0x3a')]!==_0xa6f7('0x3b')){var _0x353e54={};_0x353e54[_0x4c2d2e['name']]={'$like':'%'+_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x38')]+'%'};return _0x353e54;}})});}_0x3a7ff9=_['merge']({},_0x3a7ff9,_0x27babb[_0xa6f7('0x3c')]);var _0x13c7c4={'where':_0x3a7ff9[_0xa6f7('0x37')]};return db[_0xa6f7('0x28')][_0xa6f7('0x1f')](_0x13c7c4)['then'](function(_0x2e3eb2){_0x10bf77[_0xa6f7('0x1f')]=_0x2e3eb2;if(_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x3d')]){_0x3a7ff9[_0xa6f7('0x3e')]=[{'all':!![]}];}return db[_0xa6f7('0x28')][_0xa6f7('0x3f')](_0x3a7ff9);})[_0xa6f7('0x40')](function(_0x5646b9){_0x10bf77['rows']=_0x5646b9;return _0x10bf77;})[_0xa6f7('0x40')](respondWithFilteredResult(_0x87bccc,_0x3a7ff9))[_0xa6f7('0x41')](handleError(_0x87bccc,null));};exports[_0xa6f7('0x42')]=function(_0x2546a3,_0x2ac07f){var _0x387714={'raw':!![],'where':{'id':_0x2546a3[_0xa6f7('0x43')]['id']}},_0x21fdd7={};_0x21fdd7[_0xa6f7('0x2c')]=_[_0xa6f7('0x44')](db['WhatsappQueueReport'][_0xa6f7('0x29')]);_0x21fdd7[_0xa6f7('0x2d')]=_['keys'](_0x2546a3[_0xa6f7('0x2d')]);_0x21fdd7[_0xa6f7('0x2e')]=_[_0xa6f7('0x2f')](_0x21fdd7[_0xa6f7('0x2c')],_0x21fdd7['query']);_0x387714[_0xa6f7('0x30')]=_['intersection'](_0x21fdd7['model'],qs[_0xa6f7('0x31')](_0x2546a3[_0xa6f7('0x2d')][_0xa6f7('0x31')]));_0x387714[_0xa6f7('0x30')]=_0x387714[_0xa6f7('0x30')][_0xa6f7('0x32')]?_0x387714[_0xa6f7('0x30')]:_0x21fdd7['model'];if(_0x2546a3[_0xa6f7('0x2d')][_0xa6f7('0x3d')]){_0x387714['include']=[{'all':!![]}];}_0x387714=_[_0xa6f7('0x39')]({},_0x387714,_0x2546a3[_0xa6f7('0x3c')]);return db[_0xa6f7('0x28')]['find'](_0x387714)[_0xa6f7('0x40')](handleEntityNotFound(_0x2ac07f,null))['then'](respondWithResult(_0x2ac07f,null))[_0xa6f7('0x41')](handleError(_0x2ac07f,null));};exports[_0xa6f7('0x45')]=function(_0x260e77,_0x5f3c84){return db['WhatsappQueueReport'][_0xa6f7('0x45')](_0x260e77['body'],{})[_0xa6f7('0x40')](respondWithResult(_0x5f3c84,0xc9))['catch'](handleError(_0x5f3c84,null));};exports['update']=function(_0x1e7089,_0x2e3a04){if(_0x1e7089[_0xa6f7('0x46')]['id']){delete _0x1e7089[_0xa6f7('0x46')]['id'];}return db[_0xa6f7('0x28')][_0xa6f7('0x47')]({'where':{'id':_0x1e7089['params']['id']}})[_0xa6f7('0x40')](handleEntityNotFound(_0x2e3a04,null))[_0xa6f7('0x40')](saveUpdates(_0x1e7089['body'],null))[_0xa6f7('0x40')](respondWithResult(_0x2e3a04,null))['catch'](handleError(_0x2e3a04,null));};exports[_0xa6f7('0x48')]=function(_0x59091a,_0x488efc){return db[_0xa6f7('0x28')][_0xa6f7('0x47')]({'where':{'id':_0x59091a[_0xa6f7('0x43')]['id']}})[_0xa6f7('0x40')](handleEntityNotFound(_0x488efc,null))[_0xa6f7('0x40')](removeEntity(_0x488efc,null))['catch'](handleError(_0x488efc,null));};exports[_0xa6f7('0x49')]=function(_0x34de29,_0x5cddc9){return db[_0xa6f7('0x28')]['describe']()[_0xa6f7('0x40')](respondWithResult(_0x5cddc9,null))[_0xa6f7('0x41')](handleError(_0x5cddc9,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 5f2a778..2e3015d 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2dc0=['moment','bluebird','request-promise','path','rimraf','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0x5103d2,_0x2d4722){var _0x34b5e1=function(_0x2310dc){while(--_0x2310dc){_0x5103d2['push'](_0x5103d2['shift']());}};_0x34b5e1(++_0x2d4722);}(_0x2dc0,0x128));var _0x02dc=function(_0xf255ab,_0x3c71b0){_0xf255ab=_0xf255ab-0x0;var _0x261aa8=_0x2dc0[_0xf255ab];return _0x261aa8;};'use strict';var _=require(_0x02dc('0x0'));var util=require(_0x02dc('0x1'));var logger=require(_0x02dc('0x2'))(_0x02dc('0x3'));var moment=require(_0x02dc('0x4'));var BPromise=require(_0x02dc('0x5'));var rp=require(_0x02dc('0x6'));var fs=require('fs');var path=require(_0x02dc('0x7'));var rimraf=require(_0x02dc('0x8'));var config=require('../../config/environment');var attributes=require(_0x02dc('0x9'));module[_0x02dc('0xa')]=function(_0x25c52b,_0x2b33a6){return _0x25c52b[_0x02dc('0xb')](_0x02dc('0xc'),attributes,{'tableName':_0x02dc('0xd'),'paranoid':![],'indexes':[{'name':_0x02dc('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x02e0=['lodash','util','api','bluebird','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid'];(function(_0x3cc1bf,_0x34455c){var _0x3e867d=function(_0xcf3d43){while(--_0xcf3d43){_0x3cc1bf['push'](_0x3cc1bf['shift']());}};_0x3e867d(++_0x34455c);}(_0x02e0,0x1b0));var _0x002e=function(_0x3b70cf,_0x5b0234){_0x3b70cf=_0x3b70cf-0x0;var _0x149542=_0x02e0[_0x3b70cf];return _0x149542;};'use strict';var _=require(_0x002e('0x0'));var util=require(_0x002e('0x1'));var logger=require('../../config/logger')(_0x002e('0x2'));var moment=require('moment');var BPromise=require(_0x002e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x002e('0x4'));var rimraf=require(_0x002e('0x5'));var config=require(_0x002e('0x6'));var attributes=require(_0x002e('0x7'));module['exports']=function(_0x22993b,_0x183ebb){return _0x22993b[_0x002e('0x8')](_0x002e('0x9'),attributes,{'tableName':_0x002e('0xa'),'paranoid':![],'indexes':[{'name':_0x002e('0xb'),'fields':[_0x002e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index ff4e88b..eb8ebaf 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x85ce=['client','http','then','info','request\x20sent','debug','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','where','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3be00a,_0x2b0509){var _0x13937c=function(_0x25b637){while(--_0x25b637){_0x3be00a['push'](_0x3be00a['shift']());}};_0x13937c(++_0x2b0509);}(_0x85ce,0x1c3));var _0xe85c=function(_0x3925e4,_0x311807){_0x3925e4=_0x3925e4-0x0;var _0x219068=_0x85ce[_0x3925e4];return _0x219068;};'use strict';var _=require(_0xe85c('0x0'));var util=require(_0xe85c('0x1'));var moment=require(_0xe85c('0x2'));var BPromise=require(_0xe85c('0x3'));var rs=require(_0xe85c('0x4'));var fs=require('fs');var Redis=require(_0xe85c('0x5'));var db=require(_0xe85c('0x6'))['db'];var utils=require(_0xe85c('0x7'));var logger=require(_0xe85c('0x8'))(_0xe85c('0x9'));var config=require(_0xe85c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe85c('0xb')][_0xe85c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5542e1,_0x2a95d3,_0x185079){return new BPromise(function(_0x25b67e,_0x54c30d){return client['request'](_0x5542e1,_0x185079)[_0xe85c('0xd')](function(_0x4951e9){logger[_0xe85c('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2a95d3,_0xe85c('0xf'));logger[_0xe85c('0x10')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x2a95d3,_0xe85c('0xf'),JSON['stringify'](_0x4951e9));if(_0x4951e9['error']){if(_0x4951e9[_0xe85c('0x11')][_0xe85c('0x12')]===0x1f4){logger['error'](_0xe85c('0x13'),_0x2a95d3,_0x4951e9[_0xe85c('0x11')][_0xe85c('0x14')]);return _0x54c30d(_0x4951e9['error'][_0xe85c('0x14')]);}logger[_0xe85c('0x11')](_0xe85c('0x13'),_0x2a95d3,_0x4951e9[_0xe85c('0x11')][_0xe85c('0x14')]);return _0x25b67e(_0x4951e9[_0xe85c('0x11')]['message']);}else{logger[_0xe85c('0xe')](_0xe85c('0x13'),_0x2a95d3,_0xe85c('0xf'));_0x25b67e(_0x4951e9[_0xe85c('0x15')][_0xe85c('0x14')]);}})[_0xe85c('0x16')](function(_0x11195f){logger[_0xe85c('0x11')](_0xe85c('0x13'),_0x2a95d3,_0x11195f);_0x54c30d(_0x11195f);});});}exports[_0xe85c('0x17')]=function(_0x245385){var _0x152661=this;return new Promise(function(_0x2100b5,_0x75279){return db[_0xe85c('0x18')][_0xe85c('0x19')](_0x245385[_0xe85c('0x1a')],{'raw':_0x245385['options']?_0x245385[_0xe85c('0x1b')][_0xe85c('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x5dae00){logger[_0xe85c('0xe')](_0xe85c('0x17'),_0x245385);logger['debug'](_0xe85c('0x17'),_0x245385,JSON['stringify'](_0x5dae00));_0x2100b5(_0x5dae00);})[_0xe85c('0x16')](function(_0x5acdf6){logger[_0xe85c('0x11')](_0xe85c('0x17'),_0x5acdf6['message'],_0x245385);_0x75279(_0x152661['error'](0x1f4,_0x5acdf6[_0xe85c('0x14')]));});});};exports[_0xe85c('0x1d')]=function(_0x3e0f21){var _0x5a42e8=this;return new Promise(function(_0x59cd6c,_0x3c6127){return db[_0xe85c('0x18')]['update'](_0x3e0f21[_0xe85c('0x1a')],{'raw':_0x3e0f21[_0xe85c('0x1b')]?_0x3e0f21[_0xe85c('0x1b')][_0xe85c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e0f21['options']?_0x3e0f21[_0xe85c('0x1b')][_0xe85c('0x1e')]||null:null,'attributes':_0x3e0f21[_0xe85c('0x1b')]?_0x3e0f21[_0xe85c('0x1b')]['attributes']||null:null,'limit':_0x3e0f21[_0xe85c('0x1b')]?_0x3e0f21['options'][_0xe85c('0x1f')]||null:null})[_0xe85c('0xd')](function(_0x254546){logger['info'](_0xe85c('0x1d'),_0x3e0f21);logger[_0xe85c('0x10')](_0xe85c('0x1d'),_0x3e0f21,JSON[_0xe85c('0x20')](_0x254546));_0x59cd6c(_0x254546);})[_0xe85c('0x16')](function(_0x5621a4){logger[_0xe85c('0x11')](_0xe85c('0x1d'),_0x5621a4[_0xe85c('0x14')],_0x3e0f21);_0x3c6127(_0x5a42e8[_0xe85c('0x11')](0x1f4,_0x5621a4[_0xe85c('0x14')]));});});}; \ No newline at end of file +var _0xff83=['body','options','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','attributes','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','WhatsappQueueReport'];(function(_0x2289b3,_0x437045){var _0x5ca1f5=function(_0x5140a8){while(--_0x5140a8){_0x2289b3['push'](_0x2289b3['shift']());}};_0x5ca1f5(++_0x437045);}(_0xff83,0x98));var _0x3ff8=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xff83[_0x2b10c6];return _0x3789d2;};'use strict';var _=require('lodash');var util=require(_0x3ff8('0x0'));var moment=require(_0x3ff8('0x1'));var BPromise=require(_0x3ff8('0x2'));var rs=require(_0x3ff8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3ff8('0x4'));var logger=require(_0x3ff8('0x5'))(_0x3ff8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3ff8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49f70f,_0x493ce5,_0x65158c){return new BPromise(function(_0x184b3f,_0x278a17){return client[_0x3ff8('0x8')](_0x49f70f,_0x65158c)[_0x3ff8('0x9')](function(_0x2062c9){logger['info'](_0x3ff8('0xa'),_0x493ce5,_0x3ff8('0xb'));logger[_0x3ff8('0xc')](_0x3ff8('0xd'),_0x493ce5,_0x3ff8('0xb'),JSON[_0x3ff8('0xe')](_0x2062c9));if(_0x2062c9[_0x3ff8('0xf')]){if(_0x2062c9['error'][_0x3ff8('0x10')]===0x1f4){logger['error'](_0x3ff8('0xa'),_0x493ce5,_0x2062c9[_0x3ff8('0xf')][_0x3ff8('0x11')]);return _0x278a17(_0x2062c9[_0x3ff8('0xf')][_0x3ff8('0x11')]);}logger[_0x3ff8('0xf')](_0x3ff8('0xa'),_0x493ce5,_0x2062c9[_0x3ff8('0xf')][_0x3ff8('0x11')]);return _0x184b3f(_0x2062c9[_0x3ff8('0xf')][_0x3ff8('0x11')]);}else{logger[_0x3ff8('0x12')](_0x3ff8('0xa'),_0x493ce5,_0x3ff8('0xb'));_0x184b3f(_0x2062c9[_0x3ff8('0x13')]['message']);}})[_0x3ff8('0x14')](function(_0x7b666c){logger[_0x3ff8('0xf')](_0x3ff8('0xa'),_0x493ce5,_0x7b666c);_0x278a17(_0x7b666c);});});}exports['CreateWhatsappQueueReport']=function(_0x3741a0){var _0x4c9901=this;return new Promise(function(_0xaf76d5,_0x1d29bc){return db[_0x3ff8('0x15')]['create'](_0x3741a0[_0x3ff8('0x16')],{'raw':_0x3741a0[_0x3ff8('0x17')]?_0x3741a0[_0x3ff8('0x17')][_0x3ff8('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x16a4b0){logger[_0x3ff8('0x12')](_0x3ff8('0x19'),_0x3741a0);logger['debug']('CreateWhatsappQueueReport',_0x3741a0,JSON[_0x3ff8('0xe')](_0x16a4b0));_0xaf76d5(_0x16a4b0);})[_0x3ff8('0x14')](function(_0xd23441){logger[_0x3ff8('0xf')](_0x3ff8('0x19'),_0xd23441[_0x3ff8('0x11')],_0x3741a0);_0x1d29bc(_0x4c9901[_0x3ff8('0xf')](0x1f4,_0xd23441[_0x3ff8('0x11')]));});});};exports[_0x3ff8('0x1a')]=function(_0x42f214){var _0x4338c8=this;return new Promise(function(_0x1c95fb,_0x573564){return db[_0x3ff8('0x15')][_0x3ff8('0x1b')](_0x42f214[_0x3ff8('0x16')],{'raw':_0x42f214[_0x3ff8('0x17')]?_0x42f214[_0x3ff8('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42f214['options']?_0x42f214[_0x3ff8('0x17')]['where']||null:null,'attributes':_0x42f214[_0x3ff8('0x17')]?_0x42f214[_0x3ff8('0x17')][_0x3ff8('0x1c')]||null:null,'limit':_0x42f214[_0x3ff8('0x17')]?_0x42f214[_0x3ff8('0x17')]['limit']||null:null})['then'](function(_0x480ea2){logger[_0x3ff8('0x12')](_0x3ff8('0x1a'),_0x42f214);logger[_0x3ff8('0xc')](_0x3ff8('0x1a'),_0x42f214,JSON[_0x3ff8('0xe')](_0x480ea2));_0x1c95fb(_0x480ea2);})[_0x3ff8('0x14')](function(_0x348ffa){logger[_0x3ff8('0xf')](_0x3ff8('0x1a'),_0x348ffa['message'],_0x42f214);_0x573564(_0x4338c8[_0x3ff8('0xf')](0x1f4,_0x348ffa[_0x3ff8('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index f4d51bc..6444502 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c02=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','multer','util'];(function(_0xa63bb5,_0x245ae3){var _0x45deeb=function(_0x34350b){while(--_0x34350b){_0xa63bb5['push'](_0xa63bb5['shift']());}};_0x45deeb(++_0x245ae3);}(_0x4c02,0x70));var _0x24c0=function(_0x217e5b,_0x53776f){_0x217e5b=_0x217e5b-0x0;var _0x38f156=_0x4c02[_0x217e5b];return _0x38f156;};'use strict';var multer=require(_0x24c0('0x0'));var util=require(_0x24c0('0x1'));var path=require(_0x24c0('0x2'));var timeout=require(_0x24c0('0x3'));var express=require('express');var router=express[_0x24c0('0x4')]();var fs_extra=require(_0x24c0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x24c0('0x6'));var config=require(_0x24c0('0x7'));var controller=require(_0x24c0('0x8'));router[_0x24c0('0x9')]('/',auth[_0x24c0('0xa')](),controller['index']);router['get']('/describe',auth[_0x24c0('0xa')](),controller[_0x24c0('0xb')]);router[_0x24c0('0x9')](_0x24c0('0xc'),auth[_0x24c0('0xa')](),controller[_0x24c0('0xd')]);router[_0x24c0('0xe')]('/',auth[_0x24c0('0xa')](),controller[_0x24c0('0xf')]);router[_0x24c0('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x24c0('0x11')]);router[_0x24c0('0x12')](_0x24c0('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6467=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','get','/describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6467,0x11e));var _0x7646=function(_0x3cf4e3,_0x4ed8d7){_0x3cf4e3=_0x3cf4e3-0x0;var _0x2aa1f6=_0x6467[_0x3cf4e3];return _0x2aa1f6;};'use strict';var multer=require(_0x7646('0x0'));var util=require(_0x7646('0x1'));var path=require(_0x7646('0x2'));var timeout=require(_0x7646('0x3'));var express=require(_0x7646('0x4'));var router=express[_0x7646('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7646('0x6'));var config=require(_0x7646('0x7'));var controller=require(_0x7646('0x8'));router['get']('/',auth[_0x7646('0x9')](),controller[_0x7646('0xa')]);router[_0x7646('0xb')](_0x7646('0xc'),auth[_0x7646('0x9')](),controller[_0x7646('0xd')]);router[_0x7646('0xb')](_0x7646('0xe'),auth[_0x7646('0x9')](),controller[_0x7646('0xf')]);router[_0x7646('0x10')]('/',auth['isAuthenticated'](),controller[_0x7646('0x11')]);router[_0x7646('0x12')](_0x7646('0xe'),auth[_0x7646('0x9')](),controller[_0x7646('0x13')]);router[_0x7646('0x14')]('/:id',auth[_0x7646('0x9')](),controller[_0x7646('0x15')]);module[_0x7646('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 0bde324..68406fc 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe13=['ENUM','account','agent','queue','DATE','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe13,0x178));var _0x3fe1=function(_0xbe40ad,_0x44343c){_0xbe40ad=_0xbe40ad-0x0;var _0x50fac9=_0xfe13[_0xbe40ad];return _0x50fac9;};'use strict';var Sequelize=require(_0x3fe1('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3fe1('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3fe1('0x2')](_0x3fe1('0x3'),_0x3fe1('0x4'),_0x3fe1('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x3fe1('0x6')]}}; \ No newline at end of file +var _0x351d=['STRING','ENUM','account','queue','sequelize'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x351d,0x90));var _0xd351=function(_0x1ad4a5,_0x18c21d){_0x1ad4a5=_0x1ad4a5-0x0;var _0x46cf15=_0x351d[_0x1ad4a5];return _0x46cf15;};'use strict';var Sequelize=require(_0xd351('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd351('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd351('0x2')](_0xd351('0x3'),'agent',_0xd351('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index f13bea7..33ae297 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe13=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','params','includeAll','options','find','create','catch','update','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x44579,_0xeed777){var _0x1ad5e8=function(_0x1567d4){while(--_0x1567d4){_0x44579['push'](_0x44579['shift']());}};_0x1ad5e8(++_0xeed777);}(_0xfe13,0x178));var _0x3fe1=function(_0x16539a,_0x31409a){_0x16539a=_0x16539a-0x0;var _0x200796=_0xfe13[_0x16539a];return _0x200796;};'use strict';var emlformat=require(_0x3fe1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fe1('0x1'));var jsonpatch=require(_0x3fe1('0x2'));var rp=require(_0x3fe1('0x3'));var moment=require(_0x3fe1('0x4'));var BPromise=require(_0x3fe1('0x5'));var Mustache=require(_0x3fe1('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3fe1('0x7'));var csv=require(_0x3fe1('0x8'));var ejs=require(_0x3fe1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3fe1('0xa'));var squel=require(_0x3fe1('0xb'));var crypto=require(_0x3fe1('0xc'));var jsforce=require(_0x3fe1('0xd'));var deskjs=require(_0x3fe1('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3fe1('0xf'));var Redis=require(_0x3fe1('0x10'));var authService=require(_0x3fe1('0x11'));var qs=require(_0x3fe1('0x12'));var as=require(_0x3fe1('0x13'));var hardwareService=require(_0x3fe1('0x14'));var logger=require(_0x3fe1('0x15'))(_0x3fe1('0x16'));var utils=require('../../config/utils');var config=require(_0x3fe1('0x17'));var licenseUtil=require(_0x3fe1('0x18'));var db=require(_0x3fe1('0x19'))['db'];function respondWithStatusCode(_0x23da7f,_0x120411){_0x120411=_0x120411||0xcc;return function(_0xda23ad){if(_0xda23ad){return _0x23da7f[_0x3fe1('0x1a')](_0x120411);}return _0x23da7f[_0x3fe1('0x1b')](_0x120411)[_0x3fe1('0x1c')]();};}function respondWithResult(_0x59e62b,_0x753172){_0x753172=_0x753172||0xc8;return function(_0x138634){if(_0x138634){return _0x59e62b[_0x3fe1('0x1b')](_0x753172)[_0x3fe1('0x1d')](_0x138634);}};}function respondWithFilteredResult(_0xb4d7e3,_0x56e720){return function(_0x47055f){if(_0x47055f){var _0x358209=typeof _0x56e720[_0x3fe1('0x1e')]===_0x3fe1('0x1f')&&typeof _0x56e720[_0x3fe1('0x20')]===_0x3fe1('0x1f');var _0xd38a1=_0x47055f[_0x3fe1('0x21')];var _0xf28d3c=_0x358209?0x0:_0x56e720[_0x3fe1('0x1e')];var _0x5bb4b4=_0x358209?_0x47055f['count']:_0x56e720[_0x3fe1('0x1e')]+_0x56e720[_0x3fe1('0x20')];var _0x427a44;if(_0x5bb4b4>=_0xd38a1){_0x5bb4b4=_0xd38a1;_0x427a44=0xc8;}else{_0x427a44=0xce;}_0xb4d7e3[_0x3fe1('0x1b')](_0x427a44);return _0xb4d7e3[_0x3fe1('0x22')](_0x3fe1('0x23'),_0xf28d3c+'-'+_0x5bb4b4+'/'+_0xd38a1)[_0x3fe1('0x1d')](_0x47055f);}return null;};}function patchUpdates(_0x3b712b){return function(_0x1421f0){try{jsonpatch[_0x3fe1('0x24')](_0x1421f0,_0x3b712b,!![]);}catch(_0x784bb4){return BPromise[_0x3fe1('0x25')](_0x784bb4);}return _0x1421f0[_0x3fe1('0x26')]();};}function saveUpdates(_0x56bc7e,_0x1001c6){return function(_0x5d2c5f){if(_0x5d2c5f){return _0x5d2c5f['update'](_0x56bc7e)[_0x3fe1('0x27')](function(_0x5d9ca6){return _0x5d9ca6;});}return null;};}function removeEntity(_0x309b56,_0x2d7327){return function(_0xfcc335){if(_0xfcc335){return _0xfcc335[_0x3fe1('0x28')]()[_0x3fe1('0x27')](function(){_0x309b56[_0x3fe1('0x1b')](0xcc)[_0x3fe1('0x1c')]();});}};}function handleEntityNotFound(_0x3420cb,_0xd9dc56){return function(_0x4c55ea){if(!_0x4c55ea){_0x3420cb[_0x3fe1('0x1a')](0x194);}return _0x4c55ea;};}function handleError(_0x50d82f,_0x5a03bd){_0x5a03bd=_0x5a03bd||0x1f4;return function(_0x92eff8){logger[_0x3fe1('0x29')](_0x92eff8[_0x3fe1('0x2a')]);if(_0x92eff8[_0x3fe1('0x2b')]){delete _0x92eff8[_0x3fe1('0x2b')];}_0x50d82f[_0x3fe1('0x1b')](_0x5a03bd)[_0x3fe1('0x2c')](_0x92eff8);};}exports[_0x3fe1('0x2d')]=function(_0x9832f2,_0x27fae1){var _0x5a926b={},_0x2157e1={},_0x198242={'count':0x0,'rows':[]};var _0x42ae02=_[_0x3fe1('0x2e')](db[_0x3fe1('0x2f')][_0x3fe1('0x30')],function(_0x444548){return{'name':_0x444548[_0x3fe1('0x31')],'type':_0x444548[_0x3fe1('0x32')][_0x3fe1('0x33')]};});_0x2157e1[_0x3fe1('0x34')]=_[_0x3fe1('0x2e')](_0x42ae02,_0x3fe1('0x2b'));_0x2157e1[_0x3fe1('0x35')]=_[_0x3fe1('0x36')](_0x9832f2['query']);_0x2157e1[_0x3fe1('0x37')]=_[_0x3fe1('0x38')](_0x2157e1[_0x3fe1('0x34')],_0x2157e1[_0x3fe1('0x35')]);_0x5a926b[_0x3fe1('0x39')]=_[_0x3fe1('0x38')](_0x2157e1['model'],qs[_0x3fe1('0x3a')](_0x9832f2[_0x3fe1('0x35')][_0x3fe1('0x3a')]));_0x5a926b[_0x3fe1('0x39')]=_0x5a926b[_0x3fe1('0x39')][_0x3fe1('0x3b')]?_0x5a926b[_0x3fe1('0x39')]:_0x2157e1['model'];if(!_0x9832f2[_0x3fe1('0x35')][_0x3fe1('0x3c')](_0x3fe1('0x3d'))){_0x5a926b[_0x3fe1('0x20')]=qs['limit'](_0x9832f2['query'][_0x3fe1('0x20')]);_0x5a926b[_0x3fe1('0x1e')]=qs[_0x3fe1('0x1e')](_0x9832f2[_0x3fe1('0x35')][_0x3fe1('0x1e')]);}_0x5a926b[_0x3fe1('0x3e')]=qs[_0x3fe1('0x3f')](_0x9832f2[_0x3fe1('0x35')][_0x3fe1('0x3f')]);_0x5a926b[_0x3fe1('0x40')]=qs['filters'](_[_0x3fe1('0x41')](_0x9832f2[_0x3fe1('0x35')],_0x2157e1['filters']),_0x42ae02);if(_0x9832f2[_0x3fe1('0x35')]['filter']){_0x5a926b['where']=_[_0x3fe1('0x42')](_0x5a926b['where'],{'$or':_['map'](_0x42ae02,function(_0x3f0237){if(_0x3f0237[_0x3fe1('0x32')]!==_0x3fe1('0x43')){var _0x1889ad={};_0x1889ad[_0x3f0237[_0x3fe1('0x2b')]]={'$like':'%'+_0x9832f2[_0x3fe1('0x35')][_0x3fe1('0x44')]+'%'};return _0x1889ad;}})});}_0x5a926b=_['merge']({},_0x5a926b,_0x9832f2['options']);var _0x5d5978={'where':_0x5a926b[_0x3fe1('0x40')]};return db[_0x3fe1('0x2f')][_0x3fe1('0x21')](_0x5d5978)[_0x3fe1('0x27')](function(_0x4f1314){_0x198242[_0x3fe1('0x21')]=_0x4f1314;if(_0x9832f2['query']['includeAll']){_0x5a926b[_0x3fe1('0x45')]=[{'all':!![]}];}return db[_0x3fe1('0x2f')][_0x3fe1('0x46')](_0x5a926b);})[_0x3fe1('0x27')](function(_0x1bde8a){_0x198242[_0x3fe1('0x47')]=_0x1bde8a;return _0x198242;})[_0x3fe1('0x27')](respondWithFilteredResult(_0x27fae1,_0x5a926b))['catch'](handleError(_0x27fae1,null));};exports['show']=function(_0x55e27d,_0x22fc83){var _0x330df7={'raw':!![],'where':{'id':_0x55e27d[_0x3fe1('0x48')]['id']}},_0x3bffd1={};_0x3bffd1['model']=_[_0x3fe1('0x36')](db[_0x3fe1('0x2f')][_0x3fe1('0x30')]);_0x3bffd1[_0x3fe1('0x35')]=_[_0x3fe1('0x36')](_0x55e27d['query']);_0x3bffd1[_0x3fe1('0x37')]=_['intersection'](_0x3bffd1['model'],_0x3bffd1['query']);_0x330df7[_0x3fe1('0x39')]=_[_0x3fe1('0x38')](_0x3bffd1[_0x3fe1('0x34')],qs[_0x3fe1('0x3a')](_0x55e27d[_0x3fe1('0x35')][_0x3fe1('0x3a')]));_0x330df7[_0x3fe1('0x39')]=_0x330df7[_0x3fe1('0x39')][_0x3fe1('0x3b')]?_0x330df7['attributes']:_0x3bffd1[_0x3fe1('0x34')];if(_0x55e27d[_0x3fe1('0x35')][_0x3fe1('0x49')]){_0x330df7[_0x3fe1('0x45')]=[{'all':!![]}];}_0x330df7=_[_0x3fe1('0x42')]({},_0x330df7,_0x55e27d[_0x3fe1('0x4a')]);return db[_0x3fe1('0x2f')][_0x3fe1('0x4b')](_0x330df7)['then'](handleEntityNotFound(_0x22fc83,null))[_0x3fe1('0x27')](respondWithResult(_0x22fc83,null))['catch'](handleError(_0x22fc83,null));};exports[_0x3fe1('0x4c')]=function(_0x1ba066,_0x28d6a8){return db[_0x3fe1('0x2f')][_0x3fe1('0x4c')](_0x1ba066['body'],{})[_0x3fe1('0x27')](respondWithResult(_0x28d6a8,0xc9))[_0x3fe1('0x4d')](handleError(_0x28d6a8,null));};exports[_0x3fe1('0x4e')]=function(_0x47de28,_0x4189f5){if(_0x47de28[_0x3fe1('0x4f')]['id']){delete _0x47de28[_0x3fe1('0x4f')]['id'];}return db[_0x3fe1('0x2f')][_0x3fe1('0x4b')]({'where':{'id':_0x47de28[_0x3fe1('0x48')]['id']}})['then'](handleEntityNotFound(_0x4189f5,null))[_0x3fe1('0x27')](saveUpdates(_0x47de28[_0x3fe1('0x4f')],null))[_0x3fe1('0x27')](respondWithResult(_0x4189f5,null))[_0x3fe1('0x4d')](handleError(_0x4189f5,null));};exports[_0x3fe1('0x28')]=function(_0x26ef94,_0x114106){return db['WhatsappTransferReport']['find']({'where':{'id':_0x26ef94['params']['id']}})[_0x3fe1('0x27')](handleEntityNotFound(_0x114106,null))['then'](removeEntity(_0x114106,null))[_0x3fe1('0x4d')](handleError(_0x114106,null));};exports[_0x3fe1('0x50')]=function(_0x5569ae,_0x198300){return db[_0x3fe1('0x2f')][_0x3fe1('0x50')]()['then'](respondWithResult(_0x198300,null))['catch'](handleError(_0x198300,null));}; \ No newline at end of file +var _0x6e85=['json','offset','undefined','count','set','Content-Range','reject','update','then','destroy','end','name','send','index','map','WhatsappTransferReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','include','findAll','catch','show','params','rawAttributes','includeAll','merge','options','create','body','find','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status'];(function(_0x3de873,_0x174b5f){var _0x380b8c=function(_0x313dea){while(--_0x313dea){_0x3de873['push'](_0x3de873['shift']());}};_0x380b8c(++_0x174b5f);}(_0x6e85,0x15c));var _0x56e8=function(_0x373fc7,_0x535bbe){_0x373fc7=_0x373fc7-0x0;var _0x24a401=_0x6e85[_0x373fc7];return _0x24a401;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x56e8('0x0'));var zipdir=require(_0x56e8('0x1'));var jsonpatch=require(_0x56e8('0x2'));var rp=require('request-promise');var moment=require(_0x56e8('0x3'));var BPromise=require(_0x56e8('0x4'));var Mustache=require(_0x56e8('0x5'));var util=require(_0x56e8('0x6'));var path=require(_0x56e8('0x7'));var sox=require(_0x56e8('0x8'));var csv=require(_0x56e8('0x9'));var ejs=require(_0x56e8('0xa'));var fs=require('fs');var fs_extra=require(_0x56e8('0xb'));var _=require(_0x56e8('0xc'));var squel=require('squel');var crypto=require(_0x56e8('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x56e8('0x9'));var querystring=require(_0x56e8('0xe'));var Papa=require(_0x56e8('0xf'));var Redis=require(_0x56e8('0x10'));var authService=require(_0x56e8('0x11'));var qs=require(_0x56e8('0x12'));var as=require(_0x56e8('0x13'));var hardwareService=require(_0x56e8('0x14'));var logger=require(_0x56e8('0x15'))(_0x56e8('0x16'));var utils=require(_0x56e8('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x56e8('0x18'))['db'];function respondWithStatusCode(_0x2ea35d,_0x342b86){_0x342b86=_0x342b86||0xcc;return function(_0x1ef60e){if(_0x1ef60e){return _0x2ea35d[_0x56e8('0x19')](_0x342b86);}return _0x2ea35d[_0x56e8('0x1a')](_0x342b86)['end']();};}function respondWithResult(_0x1edc7e,_0x739a99){_0x739a99=_0x739a99||0xc8;return function(_0x488bdf){if(_0x488bdf){return _0x1edc7e[_0x56e8('0x1a')](_0x739a99)[_0x56e8('0x1b')](_0x488bdf);}};}function respondWithFilteredResult(_0x204862,_0x3d4e7c){return function(_0x41a358){if(_0x41a358){var _0x4269e5=typeof _0x3d4e7c[_0x56e8('0x1c')]===_0x56e8('0x1d')&&typeof _0x3d4e7c['limit']===_0x56e8('0x1d');var _0x34c10e=_0x41a358[_0x56e8('0x1e')];var _0x5a8267=_0x4269e5?0x0:_0x3d4e7c[_0x56e8('0x1c')];var _0x4e9fd=_0x4269e5?_0x41a358[_0x56e8('0x1e')]:_0x3d4e7c[_0x56e8('0x1c')]+_0x3d4e7c['limit'];var _0x2edb50;if(_0x4e9fd>=_0x34c10e){_0x4e9fd=_0x34c10e;_0x2edb50=0xc8;}else{_0x2edb50=0xce;}_0x204862['status'](_0x2edb50);return _0x204862[_0x56e8('0x1f')](_0x56e8('0x20'),_0x5a8267+'-'+_0x4e9fd+'/'+_0x34c10e)[_0x56e8('0x1b')](_0x41a358);}return null;};}function patchUpdates(_0x445f62){return function(_0x2c144b){try{jsonpatch['apply'](_0x2c144b,_0x445f62,!![]);}catch(_0x14deb0){return BPromise[_0x56e8('0x21')](_0x14deb0);}return _0x2c144b['save']();};}function saveUpdates(_0x49a879,_0x1d2c19){return function(_0x618e5a){if(_0x618e5a){return _0x618e5a[_0x56e8('0x22')](_0x49a879)[_0x56e8('0x23')](function(_0x5c9c20){return _0x5c9c20;});}return null;};}function removeEntity(_0x110e6f,_0x25c812){return function(_0x8341c0){if(_0x8341c0){return _0x8341c0[_0x56e8('0x24')]()[_0x56e8('0x23')](function(){_0x110e6f[_0x56e8('0x1a')](0xcc)[_0x56e8('0x25')]();});}};}function handleEntityNotFound(_0x47b242,_0x25465e){return function(_0xf306dd){if(!_0xf306dd){_0x47b242[_0x56e8('0x19')](0x194);}return _0xf306dd;};}function handleError(_0x3032f7,_0x175fda){_0x175fda=_0x175fda||0x1f4;return function(_0x3082b8){logger['error'](_0x3082b8['stack']);if(_0x3082b8[_0x56e8('0x26')]){delete _0x3082b8[_0x56e8('0x26')];}_0x3032f7[_0x56e8('0x1a')](_0x175fda)[_0x56e8('0x27')](_0x3082b8);};}exports[_0x56e8('0x28')]=function(_0x273da8,_0x45775b){var _0x36936e={},_0x1b4b9f={},_0x49273a={'count':0x0,'rows':[]};var _0x7fd8fb=_[_0x56e8('0x29')](db[_0x56e8('0x2a')]['rawAttributes'],function(_0x24e2d2){return{'name':_0x24e2d2[_0x56e8('0x2b')],'type':_0x24e2d2[_0x56e8('0x2c')][_0x56e8('0x2d')]};});_0x1b4b9f[_0x56e8('0x2e')]=_[_0x56e8('0x29')](_0x7fd8fb,_0x56e8('0x26'));_0x1b4b9f[_0x56e8('0x2f')]=_['keys'](_0x273da8[_0x56e8('0x2f')]);_0x1b4b9f[_0x56e8('0x30')]=_[_0x56e8('0x31')](_0x1b4b9f['model'],_0x1b4b9f[_0x56e8('0x2f')]);_0x36936e[_0x56e8('0x32')]=_[_0x56e8('0x31')](_0x1b4b9f[_0x56e8('0x2e')],qs[_0x56e8('0x33')](_0x273da8[_0x56e8('0x2f')][_0x56e8('0x33')]));_0x36936e['attributes']=_0x36936e[_0x56e8('0x32')][_0x56e8('0x34')]?_0x36936e[_0x56e8('0x32')]:_0x1b4b9f['model'];if(!_0x273da8[_0x56e8('0x2f')][_0x56e8('0x35')](_0x56e8('0x36'))){_0x36936e[_0x56e8('0x37')]=qs['limit'](_0x273da8[_0x56e8('0x2f')][_0x56e8('0x37')]);_0x36936e[_0x56e8('0x1c')]=qs['offset'](_0x273da8[_0x56e8('0x2f')][_0x56e8('0x1c')]);}_0x36936e[_0x56e8('0x38')]=qs[_0x56e8('0x39')](_0x273da8['query'][_0x56e8('0x39')]);_0x36936e['where']=qs[_0x56e8('0x30')](_[_0x56e8('0x3a')](_0x273da8[_0x56e8('0x2f')],_0x1b4b9f[_0x56e8('0x30')]),_0x7fd8fb);if(_0x273da8['query'][_0x56e8('0x3b')]){_0x36936e[_0x56e8('0x3c')]=_['merge'](_0x36936e[_0x56e8('0x3c')],{'$or':_[_0x56e8('0x29')](_0x7fd8fb,function(_0x1dfc67){if(_0x1dfc67[_0x56e8('0x2c')]!==_0x56e8('0x3d')){var _0x5c8db1={};_0x5c8db1[_0x1dfc67['name']]={'$like':'%'+_0x273da8['query'][_0x56e8('0x3b')]+'%'};return _0x5c8db1;}})});}_0x36936e=_['merge']({},_0x36936e,_0x273da8['options']);var _0x4bb872={'where':_0x36936e['where']};return db[_0x56e8('0x2a')][_0x56e8('0x1e')](_0x4bb872)[_0x56e8('0x23')](function(_0x4bcedd){_0x49273a[_0x56e8('0x1e')]=_0x4bcedd;if(_0x273da8[_0x56e8('0x2f')]['includeAll']){_0x36936e[_0x56e8('0x3e')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x56e8('0x3f')](_0x36936e);})['then'](function(_0x21d17d){_0x49273a['rows']=_0x21d17d;return _0x49273a;})[_0x56e8('0x23')](respondWithFilteredResult(_0x45775b,_0x36936e))[_0x56e8('0x40')](handleError(_0x45775b,null));};exports[_0x56e8('0x41')]=function(_0x21edb2,_0x5cc1af){var _0x2ff0dd={'raw':!![],'where':{'id':_0x21edb2[_0x56e8('0x42')]['id']}},_0x5a47ef={};_0x5a47ef['model']=_['keys'](db['WhatsappTransferReport'][_0x56e8('0x43')]);_0x5a47ef['query']=_['keys'](_0x21edb2[_0x56e8('0x2f')]);_0x5a47ef[_0x56e8('0x30')]=_[_0x56e8('0x31')](_0x5a47ef[_0x56e8('0x2e')],_0x5a47ef['query']);_0x2ff0dd[_0x56e8('0x32')]=_[_0x56e8('0x31')](_0x5a47ef[_0x56e8('0x2e')],qs[_0x56e8('0x33')](_0x21edb2[_0x56e8('0x2f')][_0x56e8('0x33')]));_0x2ff0dd['attributes']=_0x2ff0dd['attributes'][_0x56e8('0x34')]?_0x2ff0dd['attributes']:_0x5a47ef[_0x56e8('0x2e')];if(_0x21edb2[_0x56e8('0x2f')][_0x56e8('0x44')]){_0x2ff0dd[_0x56e8('0x3e')]=[{'all':!![]}];}_0x2ff0dd=_[_0x56e8('0x45')]({},_0x2ff0dd,_0x21edb2[_0x56e8('0x46')]);return db['WhatsappTransferReport']['find'](_0x2ff0dd)['then'](handleEntityNotFound(_0x5cc1af,null))[_0x56e8('0x23')](respondWithResult(_0x5cc1af,null))[_0x56e8('0x40')](handleError(_0x5cc1af,null));};exports[_0x56e8('0x47')]=function(_0x17e96c,_0xaee451){return db[_0x56e8('0x2a')][_0x56e8('0x47')](_0x17e96c[_0x56e8('0x48')],{})[_0x56e8('0x23')](respondWithResult(_0xaee451,0xc9))['catch'](handleError(_0xaee451,null));};exports[_0x56e8('0x22')]=function(_0x4e82e4,_0x3445b8){if(_0x4e82e4[_0x56e8('0x48')]['id']){delete _0x4e82e4['body']['id'];}return db[_0x56e8('0x2a')][_0x56e8('0x49')]({'where':{'id':_0x4e82e4[_0x56e8('0x42')]['id']}})['then'](handleEntityNotFound(_0x3445b8,null))[_0x56e8('0x23')](saveUpdates(_0x4e82e4[_0x56e8('0x48')],null))[_0x56e8('0x23')](respondWithResult(_0x3445b8,null))['catch'](handleError(_0x3445b8,null));};exports[_0x56e8('0x24')]=function(_0x341a90,_0x3de138){return db['WhatsappTransferReport'][_0x56e8('0x49')]({'where':{'id':_0x341a90[_0x56e8('0x42')]['id']}})[_0x56e8('0x23')](handleEntityNotFound(_0x3de138,null))[_0x56e8('0x23')](removeEntity(_0x3de138,null))['catch'](handleError(_0x3de138,null));};exports[_0x56e8('0x4a')]=function(_0x15514b,_0x1acd63){return db[_0x56e8('0x2a')][_0x56e8('0x4a')]()[_0x56e8('0x23')](respondWithResult(_0x1acd63,null))[_0x56e8('0x40')](handleError(_0x1acd63,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 2e641b6..b5243d2 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3bde=['report_whatsapp_transfer','uniqueid','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x3bde,0x1c9));var _0xe3bd=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x3bde[_0x474bc0];return _0x4b24cf;};'use strict';var _=require('lodash');var util=require(_0xe3bd('0x0'));var logger=require(_0xe3bd('0x1'))(_0xe3bd('0x2'));var moment=require(_0xe3bd('0x3'));var BPromise=require('bluebird');var rp=require(_0xe3bd('0x4'));var fs=require('fs');var path=require(_0xe3bd('0x5'));var rimraf=require(_0xe3bd('0x6'));var config=require(_0xe3bd('0x7'));var attributes=require(_0xe3bd('0x8'));module[_0xe3bd('0x9')]=function(_0x40b864,_0x476301){return _0x40b864['define'](_0xe3bd('0xa'),attributes,{'tableName':_0xe3bd('0xb'),'paranoid':![],'indexes':[{'name':_0xe3bd('0xc'),'fields':[_0xe3bd('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8a8f=['../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','moment','bluebird','request-promise','path'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x8a8f,0x7e));var _0xf8a8=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x8a8f[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0xf8a8('0x0'));var util=require(_0xf8a8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf8a8('0x2'));var BPromise=require(_0xf8a8('0x3'));var rp=require(_0xf8a8('0x4'));var fs=require('fs');var path=require(_0xf8a8('0x5'));var rimraf=require('rimraf');var config=require(_0xf8a8('0x6'));var attributes=require(_0xf8a8('0x7'));module[_0xf8a8('0x8')]=function(_0x11b8fb,_0x284784){return _0x11b8fb['define'](_0xf8a8('0x9'),attributes,{'tableName':_0xf8a8('0xa'),'paranoid':![],'indexes':[{'name':_0xf8a8('0xb'),'fields':[_0xf8a8('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 8b95258..3f47542 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5944=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0x5944,0x18d));var _0x4594=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x5944[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x4594('0x0'));var util=require(_0x4594('0x1'));var moment=require('moment');var BPromise=require(_0x4594('0x2'));var rs=require(_0x4594('0x3'));var fs=require('fs');var Redis=require(_0x4594('0x4'));var db=require(_0x4594('0x5'))['db'];var utils=require(_0x4594('0x6'));var logger=require(_0x4594('0x7'))(_0x4594('0x8'));var config=require(_0x4594('0x9'));var jayson=require(_0x4594('0xa'));var client=jayson[_0x4594('0xb')][_0x4594('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7f5b05,_0x3bde86,_0x2be0e4){return new BPromise(function(_0x43f364,_0x57c355){return client[_0x4594('0xd')](_0x7f5b05,_0x2be0e4)[_0x4594('0xe')](function(_0x37bbb4){logger['info'](_0x4594('0xf'),_0x3bde86,_0x4594('0x10'));logger['debug'](_0x4594('0x11'),_0x3bde86,_0x4594('0x10'),JSON[_0x4594('0x12')](_0x37bbb4));if(_0x37bbb4[_0x4594('0x13')]){if(_0x37bbb4[_0x4594('0x13')][_0x4594('0x14')]===0x1f4){logger[_0x4594('0x13')](_0x4594('0xf'),_0x3bde86,_0x37bbb4[_0x4594('0x13')][_0x4594('0x15')]);return _0x57c355(_0x37bbb4[_0x4594('0x13')][_0x4594('0x15')]);}logger[_0x4594('0x13')](_0x4594('0xf'),_0x3bde86,_0x37bbb4['error'][_0x4594('0x15')]);return _0x43f364(_0x37bbb4['error'][_0x4594('0x15')]);}else{logger[_0x4594('0x16')](_0x4594('0xf'),_0x3bde86,_0x4594('0x10'));_0x43f364(_0x37bbb4[_0x4594('0x17')][_0x4594('0x15')]);}})[_0x4594('0x18')](function(_0x368228){logger['error'](_0x4594('0xf'),_0x3bde86,_0x368228);_0x57c355(_0x368228);});});} \ No newline at end of file +var _0x6c13=['../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x6c13,0x10b));var _0x36c1=function(_0x31f8a0,_0x1e3391){_0x31f8a0=_0x31f8a0-0x0;var _0x319328=_0x6c13[_0x31f8a0];return _0x319328;};'use strict';var _=require('lodash');var util=require(_0x36c1('0x0'));var moment=require(_0x36c1('0x1'));var BPromise=require(_0x36c1('0x2'));var rs=require(_0x36c1('0x3'));var fs=require('fs');var Redis=require(_0x36c1('0x4'));var db=require(_0x36c1('0x5'))['db'];var utils=require(_0x36c1('0x6'));var logger=require('../../config/logger')(_0x36c1('0x7'));var config=require(_0x36c1('0x8'));var jayson=require(_0x36c1('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xeb4ab8,_0x132645,_0x1da6c5){return new BPromise(function(_0x542d0b,_0x147b8e){return client[_0x36c1('0xa')](_0xeb4ab8,_0x1da6c5)[_0x36c1('0xb')](function(_0x7375a3){logger[_0x36c1('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x132645,_0x36c1('0xd'));logger['debug'](_0x36c1('0xe'),_0x132645,_0x36c1('0xd'),JSON[_0x36c1('0xf')](_0x7375a3));if(_0x7375a3[_0x36c1('0x10')]){if(_0x7375a3['error']['code']===0x1f4){logger[_0x36c1('0x10')](_0x36c1('0x11'),_0x132645,_0x7375a3['error']['message']);return _0x147b8e(_0x7375a3['error'][_0x36c1('0x12')]);}logger[_0x36c1('0x10')](_0x36c1('0x11'),_0x132645,_0x7375a3['error']['message']);return _0x542d0b(_0x7375a3['error'][_0x36c1('0x12')]);}else{logger[_0x36c1('0xc')](_0x36c1('0x11'),_0x132645,_0x36c1('0xd'));_0x542d0b(_0x7375a3[_0x36c1('0x13')][_0x36c1('0x12')]);}})[_0x36c1('0x14')](function(_0x5e57e7){logger[_0x36c1('0x10')](_0x36c1('0x11'),_0x132645,_0x5e57e7);_0x147b8e(_0x5e57e7);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 3cd8dda..199ed46 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe75a=['filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','name','map','online','join','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','exit','lodash','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/cloud-provider','then','default','start','info'];(function(_0x33b333,_0x23102d){var _0x4f8503=function(_0x31e567){while(--_0x31e567){_0x33b333['push'](_0x33b333['shift']());}};_0x4f8503(++_0x23102d);}(_0xe75a,0x1de));var _0xae75=function(_0x29d87d,_0x23dc31){_0x29d87d=_0x29d87d-0x0;var _0x1fd84b=_0xe75a[_0x29d87d];return _0x1fd84b;};'use strict';var _=require(_0xae75('0x0'));var db=require(_0xae75('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xae75('0x2'));var rpc=require(_0xae75('0x3'));var config=require(_0xae75('0x4'));var logger=require(_0xae75('0x5'))(_0xae75('0x6'));var pm2=require(_0xae75('0x7'));var pm2Config=require(_0xae75('0x8'));var schedule=require(_0xae75('0x9'));var chat=require(_0xae75('0xa'));var whatsapp=require(_0xae75('0xb'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0xae75('0xc'));function main(){return db['sequelize']['sync']()[_0xae75('0xd')](function(){if(config['seedDB']){return seedDb['default']();}})['then'](function(){return checkLicense[_0xae75('0xe')]();})['then'](function(){return rpc['listen']();})[_0xae75('0xd')](function(_0x3f6ae2){logger['info'](_0x3f6ae2);return chat[_0xae75('0xf')]();})[_0xae75('0xd')](function(){return whatsapp['start']();})[_0xae75('0xd')](function(){return schedule[_0xae75('0xf')]();})[_0xae75('0xd')](function(){return transcribe['start']();})[_0xae75('0xd')](function(){return provider[_0xae75('0xf')]();})[_0xae75('0xd')](function(_0x105487){logger[_0xae75('0x10')](_0x105487);return pm2[_0xae75('0xf')](pm2Config);})[_0xae75('0xd')](function(_0x99fdc8){var _0xa268ec=_0x99fdc8[_0xae75('0x11')](function(_0x5dcc10){return typeof _0x5dcc10[_0xae75('0x12')]===_0xae75('0x13')&&_0x5dcc10[_0xae75('0x12')]>=0x0;});if(_0xa268ec[_0xae75('0x14')]>0x0){throw new Error(_0xa268ec[_0xae75('0x14')]+_0xae75('0x15')+_['map'](_0xa268ec,function(_0x52f683){return'\x22'+_0x52f683[_0xae75('0x16')][_0xae75('0x17')]+'\x22';}));}logger[_0xae75('0x10')]('Online\x20apps:',_[_0xae75('0x18')](_[_0xae75('0x11')](_0x99fdc8,{'status':_0xae75('0x19')}),_0xae75('0x17'))[_0xae75('0x1a')]());logger[_0xae75('0x10')]('Offline\x20apps:',_[_0xae75('0x18')](_[_0xae75('0x11')](_0x99fdc8,function(_0x3c82bc){return _0x3c82bc[_0xae75('0x1b')]!==_0xae75('0x19');}),_0xae75('0x17'))[_0xae75('0x1a')]()||_0xae75('0x1c'));console[_0xae75('0x1d')]('App\x20Ready!');})[_0xae75('0x1e')](function(_0x24e207){console[_0xae75('0x1d')](_0xae75('0x1f'),_0x24e207);logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x24e207);process[_0xae75('0x20')](0x1);});}main(); \ No newline at end of file +var _0x2bd8=['listen','info','start','number','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','filter','online','Offline\x20apps:','status','join','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/cloud-provider','sequelize','sync','then','default'];(function(_0x50c70b,_0x5f3473){var _0x49feb1=function(_0x47233c){while(--_0x47233c){_0x50c70b['push'](_0x50c70b['shift']());}};_0x49feb1(++_0x5f3473);}(_0x2bd8,0x130));var _0x82bd=function(_0x8ff7cf,_0x156089){_0x8ff7cf=_0x8ff7cf-0x0;var _0x40ca32=_0x2bd8[_0x8ff7cf];return _0x40ca32;};'use strict';var _=require(_0x82bd('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0x82bd('0x1'));var checkLicense=require(_0x82bd('0x2'));var rpc=require(_0x82bd('0x3'));var config=require(_0x82bd('0x4'));var logger=require(_0x82bd('0x5'))(_0x82bd('0x6'));var pm2=require(_0x82bd('0x7'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x82bd('0x8'));var chat=require(_0x82bd('0x9'));var whatsapp=require(_0x82bd('0xa'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0x82bd('0xb'));function main(){return db[_0x82bd('0xc')][_0x82bd('0xd')]()[_0x82bd('0xe')](function(){if(config['seedDB']){return seedDb[_0x82bd('0xf')]();}})['then'](function(){return checkLicense['default']();})['then'](function(){return rpc[_0x82bd('0x10')]();})['then'](function(_0x4c9430){logger[_0x82bd('0x11')](_0x4c9430);return chat['start']();})['then'](function(){return whatsapp[_0x82bd('0x12')]();})[_0x82bd('0xe')](function(){return schedule['start']();})[_0x82bd('0xe')](function(){return transcribe['start']();})[_0x82bd('0xe')](function(){return provider['start']();})[_0x82bd('0xe')](function(_0x3c4042){logger[_0x82bd('0x11')](_0x3c4042);return pm2[_0x82bd('0x12')](pm2Config);})['then'](function(_0x446ffc){var _0xd43e79=_0x446ffc['filter'](function(_0x3667ef){return typeof _0x3667ef['exitCode']===_0x82bd('0x13')&&_0x3667ef[_0x82bd('0x14')]>=0x0;});if(_0xd43e79[_0x82bd('0x15')]>0x0){throw new Error(_0xd43e79[_0x82bd('0x15')]+_0x82bd('0x16')+_[_0x82bd('0x17')](_0xd43e79,function(_0x387d21){return'\x22'+_0x387d21[_0x82bd('0x18')][_0x82bd('0x19')]+'\x22';}));}logger[_0x82bd('0x11')](_0x82bd('0x1a'),_[_0x82bd('0x17')](_[_0x82bd('0x1b')](_0x446ffc,{'status':_0x82bd('0x1c')}),'name')['join']());logger[_0x82bd('0x11')](_0x82bd('0x1d'),_[_0x82bd('0x17')](_[_0x82bd('0x1b')](_0x446ffc,function(_0x34899b){return _0x34899b[_0x82bd('0x1e')]!==_0x82bd('0x1c');}),_0x82bd('0x19'))[_0x82bd('0x1f')]()||_0x82bd('0x20'));console[_0x82bd('0x21')](_0x82bd('0x22'));})[_0x82bd('0x23')](function(_0x3260c4){console[_0x82bd('0x21')](_0x82bd('0x24'),_0x3260c4);logger[_0x82bd('0x25')](_0x82bd('0x26'),_0x3260c4);process[_0x82bd('0x27')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 9e2f436..5aa17b8 100644 --- a/server/components/auth/service.js +++ b/server/components/auth/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcdd2=['smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','ChatInteraction','findOne','closed','disposition','then','query','forceDownload','status','unmanaged','json','Unmanaged.','Forbidden.','use','headers','authorization','Basic','User','find','name','authenticate','pass','Wrong\x20credentials.','startsWith','Unknown\x20authorization\x20format','apikey','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','user','catch','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey','apiKeyNonce','apiKeyIat','getUuid','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','join','promisify','secret','options','verify','randomBytes','toString','hex','floor','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','express-jwt','composable-middleware','crypto','bluebird','util','moment','secrets','session','role','internal','email','userpic','permissions','voicePause','chatPause','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','alias','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','wssPort','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcdd2,0xe3));var _0x2cdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdd2[_0x3dd15e];return _0x231fd0;};'use strict';var db=require(_0x2cdd('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x2cdd('0x1'));var licenseUtil=require(_0x2cdd('0x2'));var encryptor=require('../encryptor');var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x2cdd('0x3'));var compose=require(_0x2cdd('0x4'));var basicAuth=require('basic-auth');var crypto=require(_0x2cdd('0x5'));var BPromise=require(_0x2cdd('0x6'));var util=require(_0x2cdd('0x7'));var moment=require(_0x2cdd('0x8'));var validateJwt=expressJwt({'secret':config[_0x2cdd('0x9')][_0x2cdd('0xa')]});var userAttributes=['id',_0x2cdd('0xb'),'fullname','name',_0x2cdd('0xc'),_0x2cdd('0xd'),_0x2cdd('0xe'),_0x2cdd('0xf'),'md5secret',_0x2cdd('0x10'),_0x2cdd('0x11'),_0x2cdd('0x12'),'faxPause',_0x2cdd('0x13'),_0x2cdd('0x14'),_0x2cdd('0x15'),_0x2cdd('0x16'),_0x2cdd('0x17'),_0x2cdd('0x18'),'crudPermissions',_0x2cdd('0x19'),'passwordResetAt',_0x2cdd('0x1a'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd',_0x2cdd('0x1b'),_0x2cdd('0x1c'),_0x2cdd('0x1d'),_0x2cdd('0x1e'),'phoneBarPrefixRequired',_0x2cdd('0x1f'),_0x2cdd('0x20'),_0x2cdd('0x21'),'interface',_0x2cdd('0x22'),'privacyEnabled','settingsEnabled',_0x2cdd('0x23'),'downloadVoiceRecordings','downloadOmnichannelInteractions',_0x2cdd('0x24'),_0x2cdd('0x25'),_0x2cdd('0x26'),'chatAutoanswer',_0x2cdd('0x27'),_0x2cdd('0x28'),_0x2cdd('0x29'),_0x2cdd('0x2a'),_0x2cdd('0x2b'),_0x2cdd('0x2c'),_0x2cdd('0x2d'),'faxAutoanswer',_0x2cdd('0x2e'),_0x2cdd('0x2f'),_0x2cdd('0x30'),'messengerSoundNotification'];exports[_0x2cdd('0x31')]=function(){return this[_0x2cdd('0x32')](!![])['use'](function(_0x4ed96b,_0x910709,_0x2d2045){if(_0x4ed96b['user']){_0x2d2045();}else{return db[_0x2cdd('0x33')][_0x2cdd('0x34')]({'where':{'id':_0x4ed96b['params']['id']},'attributes':['id',_0x2cdd('0x35'),_0x2cdd('0x36')],'raw':!![]})[_0x2cdd('0x37')](function(_0x51129f){if(_0x51129f&&_0x51129f[_0x2cdd('0x35')]&&!_0x4ed96b[_0x2cdd('0x38')][_0x2cdd('0x39')]){return _0x910709[_0x2cdd('0x3a')](_0x51129f[_0x2cdd('0x36')]===_0x2cdd('0x3b')?0x195:0x193)[_0x2cdd('0x3c')]({'message':_0x51129f[_0x2cdd('0x36')]===_0x2cdd('0x3b')?_0x2cdd('0x3d'):_0x2cdd('0x3e')});}else{_0x2d2045();}})['catch'](function(_0x4d11a1){_0x2d2045(_0x4d11a1);});}});};exports[_0x2cdd('0x32')]=function isAuthenticated(_0x3c5eb6){return compose()[_0x2cdd('0x3f')](function(_0x10cd3b,_0x1b5e37,_0x241266){var _0x3a9da5;if(_0x10cd3b[_0x2cdd('0x40')][_0x2cdd('0x41')]){if(_['startsWith'](_0x10cd3b[_0x2cdd('0x40')][_0x2cdd('0x41')],_0x2cdd('0x42'))){var _0x40cd15=basicAuth(_0x10cd3b);db[_0x2cdd('0x43')][_0x2cdd('0x44')]({'where':{'name':_0x40cd15[_0x2cdd('0x45')]}})[_0x2cdd('0x37')](function(_0x2ba8e7){if(!_0x2ba8e7||!_0x2ba8e7[_0x2cdd('0x46')](_0x40cd15[_0x2cdd('0x47')])){return _0x1b5e37['status'](0x191)['json']({'message':_0x2cdd('0x48')});}_0x10cd3b['user']={'id':_0x2ba8e7['id']};_0x241266();})['catch'](function(_0x9cdca7){_0x241266(_0x9cdca7);});}else if(_[_0x2cdd('0x49')](_0x10cd3b[_0x2cdd('0x40')][_0x2cdd('0x41')],'Bearer')){validateJwt(_0x10cd3b,_0x1b5e37,_0x241266);}else{if(_0x3c5eb6){_0x241266();}else{return _0x1b5e37['status'](0x193)['json']({'message':_0x2cdd('0x4a')});}}}else if(_0x10cd3b[_0x2cdd('0x38')][_0x2cdd('0x4b')]){try{var _0x1b70b0={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x10cd3b[_0x2cdd('0x38')][_0x2cdd('0x4b')],_0x1b70b0)[_0x2cdd('0x37')](function(_0x352b0a){return db[_0x2cdd('0x43')]['find']({'where':{'id':_0x352b0a[_0x2cdd('0x4c')]}})[_0x2cdd('0x37')](function(_0x13e403){_0x3a9da5=_0x13e403;return db[_0x2cdd('0x4d')][_0x2cdd('0x34')]({'where':{'id':0x1},'attributes':[_0x2cdd('0x4e'),_0x2cdd('0x4f')],'raw':!![]});})[_0x2cdd('0x37')](function(_0x455e13){if(!_0x3a9da5||!_[_0x2cdd('0x50')](_0x3a9da5['apiKeyNonce'],_0x352b0a[_0x2cdd('0x51')])){return _0x1b5e37[_0x2cdd('0x3a')](0x191)[_0x2cdd('0x3c')]({'message':_0x2cdd('0x52')});}if(_0x3a9da5[_0x2cdd('0x53')]){return _0x1b5e37[_0x2cdd('0x3a')](0x191)[_0x2cdd('0x3c')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x3a9da5['blocked']){if(_0x455e13[_0x2cdd('0x4f')]>0x0){if(moment(_0x3a9da5[_0x2cdd('0x54')])[_0x2cdd('0x55')](_0x455e13['blockDuration'],_0x2cdd('0x56'))>moment()){return _0x1b5e37[_0x2cdd('0x3a')](0x191)['json']({'message':_0x2cdd('0x57')});}}else{return _0x1b5e37[_0x2cdd('0x3a')](0x191)['json']({'message':_0x2cdd('0x57')});}}_0x10cd3b[_0x2cdd('0x58')]={'id':_0x3a9da5['id']};_0x241266();});})[_0x2cdd('0x59')](function(){return _0x1b5e37[_0x2cdd('0x3a')](0x191)[_0x2cdd('0x3c')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0xe0dfd2){_0x241266(_0xe0dfd2);}}else if(_0x3c5eb6){_0x241266();}else{return _0x1b5e37[_0x2cdd('0x3a')](0x193)[_0x2cdd('0x3c')]({'message':_0x2cdd('0x4a')});}})[_0x2cdd('0x3f')](function(_0x5075c9,_0xc9c218,_0xe9f1c5){if(_0x5075c9[_0x2cdd('0x58')]){db['User'][_0x2cdd('0x44')]({'where':{'id':_0x5075c9['user']['id']},'attributes':userAttributes})[_0x2cdd('0x37')](function(_0x32066f){if(!_0x32066f){return _0xc9c218[_0x2cdd('0x3a')](0x194)[_0x2cdd('0x3c')]({'message':_0x2cdd('0x5a')});}_0x5075c9[_0x2cdd('0x58')]=_0x32066f;_0xe9f1c5();})[_0x2cdd('0x59')](function(_0x5f4be8){_0xe9f1c5(_0x5f4be8);});}else if(_0x3c5eb6){_0xe9f1c5();}else{return _0xc9c218[_0x2cdd('0x3a')](0x194)[_0x2cdd('0x3c')]({'message':_0x2cdd('0x5b')});}});};exports[_0x2cdd('0x5c')]=function canUpdate(){return compose()[_0x2cdd('0x3f')](function(_0x338dd4,_0x2f0c86,_0x42f6fd){return licenseUtil['getLicense']()[_0x2cdd('0x37')](function(_0x34ec42){if(_0x34ec42['update']){_0x42f6fd();}else{return _0x2f0c86[_0x2cdd('0x3a')](0x193)['json']({'message':_0x2cdd('0x5d')});}})['catch'](function(_0x124648){_0x42f6fd(_0x124648);});});};exports[_0x2cdd('0x5e')]=function isWebrtcLicence(){return compose()[_0x2cdd('0x3f')](function(_0x5deff4,_0x1d9d13,_0x2edfde){return licenseUtil['getLicense']()['then'](function(_0x3fd4cf){if(_0x3fd4cf[_0x2cdd('0x5f')]){_0x2edfde();}else{return _0x1d9d13[_0x2cdd('0x3a')](0x193)['json']({'message':_0x2cdd('0x5d')});}})[_0x2cdd('0x59')](function(_0x112afd){_0x2edfde(_0x112afd);});});};exports[_0x2cdd('0x60')]=function(_0x58d041,_0x4092a7,_0x21e0f4){_0x58d041[_0x2cdd('0x60')]=!![];return _0x21e0f4();};exports[_0x2cdd('0x61')]=function signToken(_0x46d3de){return signJwt(_0x46d3de);};exports[_0x2cdd('0x62')]=function(_0x26025b,_0x302772){if(!_0x26025b[_0x2cdd('0x58')]){return _0x302772[_0x2cdd('0x3a')](0x194)[_0x2cdd('0x3c')]({'message':_0x2cdd('0x63')});}var _0xba9728={'payload':{'id':_0x26025b[_0x2cdd('0x58')]['id'],'role':_0x26025b[_0x2cdd('0x58')][_0x2cdd('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0xba9728)[_0x2cdd('0x37')](function(_0x4c1033){_0x302772['cookie'](_0x2cdd('0x64'),_0x4c1033);_0x302772[_0x2cdd('0x65')](_0x2cdd('0x66'));})[_0x2cdd('0x59')](function(_0x5b6b41){return _0x302772['status'](0x1f4)[_0x2cdd('0x67')](_0x5b6b41);});};exports[_0x2cdd('0x68')]=function(_0x4f4eee){if(_[_0x2cdd('0x69')](_0x4f4eee['apiKeyNonce'])||_[_0x2cdd('0x69')](_0x4f4eee['apiKeyIat'])){return null;}else{return createJwt(_0x4f4eee);}};exports[_0x2cdd('0x6a')]=function(_0x23839e){_0x23839e[_0x2cdd('0x6b')]=generateNonce();_0x23839e[_0x2cdd('0x6c')]=generateIssuedAt();return createJwt(_0x23839e);};exports['regenerateApiKey']=function(_0x40a358,_0x3edb9b){var _0x3e79f8=_0x40a358['query'][_0x2cdd('0x4b')];if(_0x3e79f8){var _0x4b6c7a={'nonce':_0x3edb9b[_0x2cdd('0x6b')],'iat':_0x3edb9b[_0x2cdd('0x6c')],'audience':hardwareConf[_0x2cdd('0x6d')](),'issuer':hardwareConf[_0x2cdd('0x6d')]()};return verifyJwt(_0x3e79f8,_0x4b6c7a)[_0x2cdd('0x37')](function(){return generateApiKey(_0x3edb9b);});}else{throw{'message':_0x2cdd('0x6e')};}};exports[_0x2cdd('0x6f')]=function(_0x572371){var _0x4b9f71=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4b9f71[_0x2cdd('0x70')](_0x572371))throw new db[(_0x2cdd('0x71'))][(_0x2cdd('0x72'))](_0x2cdd('0x73'));return;};exports['validatePasswordHistory']=function(_0x4d4a50,_0x17f556,_0xcc63e6){var _0xeab301=encryptor[_0x2cdd('0x74')](_0x17f556)[_0x2cdd('0x75')](',');for(var _0x268a86=0x0;_0x268a86<_0xcc63e6;_0x268a86++){if(!_0xeab301[_0x268a86])break;if(_0x4d4a50[_0x2cdd('0x76')]()===_0xeab301[_0x268a86][_0x2cdd('0x76')]()){var _0x3903b2=util[_0x2cdd('0x77')](_0x2cdd('0x78'),_0xcc63e6);if(_0xcc63e6===0x1){_0x3903b2=_0x2cdd('0x79');}throw new db['Sequelize'][(_0x2cdd('0x72'))](_0x3903b2);}}return;};exports[_0x2cdd('0x7a')]=function(_0x482c36,_0x336497){var _0x160462=_0x336497?encryptor[_0x2cdd('0x74')](_0x336497)[_0x2cdd('0x75')](','):[];if(_0x160462[_0x2cdd('0x7b')]===0x5){_0x160462[_0x2cdd('0x7c')](-0x1,0x1);}_0x160462['unshift'](_0x482c36);return encryptor['encryptString'](_0x160462[_0x2cdd('0x7d')](','));};function signJwt(_0x4023a9){var _0x297470=BPromise[_0x2cdd('0x7e')](jwt['sign'],{'context':jwt});var _0x3ff1bb=_0x4023a9[_0x2cdd('0x7f')]||config[_0x2cdd('0x9')][_0x2cdd('0xa')];return new BPromise(function(_0x1ad5b2,_0x27934a){_0x297470(_0x4023a9['payload'],_0x3ff1bb,_0x4023a9[_0x2cdd('0x80')])['then'](function(_0x5a5712){_0x1ad5b2(_0x5a5712);})[_0x2cdd('0x59')](function(_0x2ed284){_0x27934a(_0x2ed284);});});}function verifyJwt(_0x54f9f6,_0x3486ba,_0x23196d){var _0x34fade=BPromise[_0x2cdd('0x7e')](jwt[_0x2cdd('0x81')],{'context':jwt});var _0x461f63=_0x23196d||config[_0x2cdd('0x9')][_0x2cdd('0xa')];return new BPromise(function(_0x1bf7fb,_0x19f7e4){_0x34fade(_0x54f9f6,_0x461f63,_0x3486ba)[_0x2cdd('0x37')](function(_0x3b1eda){_0x1bf7fb(_0x3b1eda);})[_0x2cdd('0x59')](function(_0x4a5ed1){_0x19f7e4(_0x4a5ed1);});});}function generateNonce(){return crypto[_0x2cdd('0x82')](0x10)[_0x2cdd('0x83')](_0x2cdd('0x84'));}function generateIssuedAt(){return Math[_0x2cdd('0x85')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x1181b9){var _0x26c49f={'payload':{'iat':_0x1181b9[_0x2cdd('0x6c')],'nonce':_0x1181b9[_0x2cdd('0x6b')]},'options':{'algorithm':_0x2cdd('0x86'),'subject':_0x1181b9['id']['toString'](),'issuer':hardwareConf[_0x2cdd('0x6d')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x26c49f)[_0x2cdd('0x37')](function(_0x3faaaa){return{'iat':_0x1181b9[_0x2cdd('0x6c')],'nonce':_0x1181b9['apiKeyNonce'],'token':_0x3faaaa};});} \ No newline at end of file +var _0x1a75=['nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blockDuration','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','catch','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','cookie','motion.token','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','decryptString','length','splice','encryptString','join','promisify','sign','options','verify','randomBytes','floor','now','toString','../../mysqldb','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','role','fullname','name','email','permissions','md5secret','voicePause','chatPause','faxPause','lastLoginAt','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','query','forceDownload','status','unmanaged','json','Unmanaged.','Forbidden.','startsWith','headers','authorization','User','then','authenticate','pass','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','find','sub','Setting','allowedLoginAttempts','apiKeyNonce'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x1a75,0x132));var _0x51a7=function(_0x780034,_0x3f6b5b){_0x780034=_0x780034-0x0;var _0x7d5ba4=_0x1a75[_0x780034];return _0x7d5ba4;};'use strict';var db=require(_0x51a7('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x51a7('0x1'));var licenseUtil=require(_0x51a7('0x2'));var encryptor=require('../encryptor');var _=require(_0x51a7('0x3'));var jwt=require(_0x51a7('0x4'));var expressJwt=require(_0x51a7('0x5'));var compose=require(_0x51a7('0x6'));var basicAuth=require(_0x51a7('0x7'));var crypto=require(_0x51a7('0x8'));var BPromise=require(_0x51a7('0x9'));var util=require(_0x51a7('0xa'));var moment=require(_0x51a7('0xb'));var validateJwt=expressJwt({'secret':config[_0x51a7('0xc')][_0x51a7('0xd')]});var userAttributes=['id',_0x51a7('0xe'),_0x51a7('0xf'),_0x51a7('0x10'),'internal',_0x51a7('0x11'),'userpic',_0x51a7('0x12'),_0x51a7('0x13'),_0x51a7('0x14'),_0x51a7('0x15'),'mailPause',_0x51a7('0x16'),'smsPause','openchannelPause','pauseType','showWebBar',_0x51a7('0x17'),'lastPauseAt','crudPermissions',_0x51a7('0x18'),'passwordResetAt',_0x51a7('0x19'),_0x51a7('0x1a'),_0x51a7('0x1b'),_0x51a7('0x1c'),_0x51a7('0x1d'),'phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires',_0x51a7('0x1e'),'phoneBarRemoteControl',_0x51a7('0x1f'),_0x51a7('0x20'),_0x51a7('0x21'),_0x51a7('0x22'),_0x51a7('0x23'),'settingsEnabled',_0x51a7('0x24'),_0x51a7('0x25'),_0x51a7('0x26'),_0x51a7('0x27'),_0x51a7('0x28'),_0x51a7('0x29'),_0x51a7('0x2a'),_0x51a7('0x2b'),_0x51a7('0x2c'),_0x51a7('0x2d'),_0x51a7('0x2e'),_0x51a7('0x2f'),'openchannelAutoanswer',_0x51a7('0x30'),_0x51a7('0x31'),'faxAutoanswerDelay','whatsappAutoanswer',_0x51a7('0x32'),_0x51a7('0x33')];exports[_0x51a7('0x34')]=function(){return this[_0x51a7('0x35')](!![])[_0x51a7('0x36')](function(_0x406ddd,_0x4a2dbe,_0x13f6b3){if(_0x406ddd[_0x51a7('0x37')]){_0x13f6b3();}else{return db[_0x51a7('0x38')][_0x51a7('0x39')]({'where':{'id':_0x406ddd[_0x51a7('0x3a')]['id']},'attributes':['id',_0x51a7('0x3b'),_0x51a7('0x3c')],'raw':!![]})['then'](function(_0x4bcd2a){if(_0x4bcd2a&&_0x4bcd2a[_0x51a7('0x3b')]&&!_0x406ddd[_0x51a7('0x3d')][_0x51a7('0x3e')]){return _0x4a2dbe[_0x51a7('0x3f')](_0x4bcd2a[_0x51a7('0x3c')]===_0x51a7('0x40')?0x195:0x193)[_0x51a7('0x41')]({'message':_0x4bcd2a[_0x51a7('0x3c')]===_0x51a7('0x40')?_0x51a7('0x42'):_0x51a7('0x43')});}else{_0x13f6b3();}})['catch'](function(_0x3d8efa){_0x13f6b3(_0x3d8efa);});}});};exports[_0x51a7('0x35')]=function isAuthenticated(_0x150463){return compose()[_0x51a7('0x36')](function(_0x53fa81,_0x83d178,_0x64f316){var _0x266cef;if(_0x53fa81['headers']['authorization']){if(_[_0x51a7('0x44')](_0x53fa81[_0x51a7('0x45')][_0x51a7('0x46')],'Basic')){var _0x2b4483=basicAuth(_0x53fa81);db[_0x51a7('0x47')]['find']({'where':{'name':_0x2b4483['name']}})[_0x51a7('0x48')](function(_0x131a8a){if(!_0x131a8a||!_0x131a8a[_0x51a7('0x49')](_0x2b4483[_0x51a7('0x4a')])){return _0x83d178['status'](0x191)[_0x51a7('0x41')]({'message':'Wrong\x20credentials.'});}_0x53fa81['user']={'id':_0x131a8a['id']};_0x64f316();})['catch'](function(_0xaff216){_0x64f316(_0xaff216);});}else if(_[_0x51a7('0x44')](_0x53fa81[_0x51a7('0x45')]['authorization'],_0x51a7('0x4b'))){validateJwt(_0x53fa81,_0x83d178,_0x64f316);}else{if(_0x150463){_0x64f316();}else{return _0x83d178[_0x51a7('0x3f')](0x193)[_0x51a7('0x41')]({'message':_0x51a7('0x4c')});}}}else if(_0x53fa81[_0x51a7('0x3d')][_0x51a7('0x4d')]){try{var _0x516fbf={'audience':hardwareConf[_0x51a7('0x4e')](),'issuer':hardwareConf[_0x51a7('0x4e')]()};verifyJwt(_0x53fa81[_0x51a7('0x3d')][_0x51a7('0x4d')],_0x516fbf)['then'](function(_0x2d9961){return db[_0x51a7('0x47')][_0x51a7('0x4f')]({'where':{'id':_0x2d9961[_0x51a7('0x50')]}})[_0x51a7('0x48')](function(_0x3c2fad){_0x266cef=_0x3c2fad;return db[_0x51a7('0x51')][_0x51a7('0x39')]({'where':{'id':0x1},'attributes':[_0x51a7('0x52'),'blockDuration'],'raw':!![]});})[_0x51a7('0x48')](function(_0x45bbd7){if(!_0x266cef||!_['isEqual'](_0x266cef[_0x51a7('0x53')],_0x2d9961[_0x51a7('0x54')])){return _0x83d178[_0x51a7('0x3f')](0x191)[_0x51a7('0x41')]({'message':_0x51a7('0x55')});}if(_0x266cef[_0x51a7('0x56')]){return _0x83d178['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}if(_0x266cef['blocked']){if(_0x45bbd7[_0x51a7('0x57')]>0x0){if(moment(_0x266cef[_0x51a7('0x58')])[_0x51a7('0x59')](_0x45bbd7[_0x51a7('0x57')],_0x51a7('0x5a'))>moment()){return _0x83d178[_0x51a7('0x3f')](0x191)[_0x51a7('0x41')]({'message':_0x51a7('0x5b')});}}else{return _0x83d178['status'](0x191)[_0x51a7('0x41')]({'message':_0x51a7('0x5b')});}}_0x53fa81['user']={'id':_0x266cef['id']};_0x64f316();});})[_0x51a7('0x5c')](function(){return _0x83d178[_0x51a7('0x3f')](0x191)['json']({'message':_0x51a7('0x5b')});});}catch(_0x316387){_0x64f316(_0x316387);}}else if(_0x150463){_0x64f316();}else{return _0x83d178[_0x51a7('0x3f')](0x193)[_0x51a7('0x41')]({'message':_0x51a7('0x4c')});}})[_0x51a7('0x36')](function(_0x2245a6,_0x191cc5,_0x4ad2ac){if(_0x2245a6[_0x51a7('0x37')]){db[_0x51a7('0x47')]['find']({'where':{'id':_0x2245a6[_0x51a7('0x37')]['id']},'attributes':userAttributes})[_0x51a7('0x48')](function(_0x2c0040){if(!_0x2c0040){return _0x191cc5[_0x51a7('0x3f')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x2245a6[_0x51a7('0x37')]=_0x2c0040;_0x4ad2ac();})['catch'](function(_0x21baca){_0x4ad2ac(_0x21baca);});}else if(_0x150463){_0x4ad2ac();}else{return _0x191cc5['status'](0x194)[_0x51a7('0x41')]({'message':_0x51a7('0x5d')});}});};exports[_0x51a7('0x5e')]=function canUpdate(){return compose()['use'](function(_0x24f9fd,_0x55200d,_0x5ad667){return licenseUtil[_0x51a7('0x5f')]()['then'](function(_0x2d2231){if(_0x2d2231[_0x51a7('0x60')]){_0x5ad667();}else{return _0x55200d['status'](0x193)[_0x51a7('0x41')]({'message':_0x51a7('0x61')});}})[_0x51a7('0x5c')](function(_0x51fbc2){_0x5ad667(_0x51fbc2);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x51a7('0x36')](function(_0x22b9c4,_0x5422ed,_0x3a0a3c){return licenseUtil['getLicense']()[_0x51a7('0x48')](function(_0xff7fd){if(_0xff7fd['webrtc']){_0x3a0a3c();}else{return _0x5422ed['status'](0x193)[_0x51a7('0x41')]({'message':'Forbidden'});}})[_0x51a7('0x5c')](function(_0x1d3e49){_0x3a0a3c(_0x1d3e49);});});};exports['isMiddleware']=function(_0x487ad3,_0x52a5db,_0x2d1ce0){_0x487ad3[_0x51a7('0x62')]=!![];return _0x2d1ce0();};exports['signToken']=function signToken(_0x4ede98){return signJwt(_0x4ede98);};exports['setTokenCookie']=function(_0x310f80,_0x213a26){if(!_0x310f80[_0x51a7('0x37')]){return _0x213a26['status'](0x194)[_0x51a7('0x41')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x7c14={'payload':{'id':_0x310f80[_0x51a7('0x37')]['id'],'role':_0x310f80[_0x51a7('0x37')][_0x51a7('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x7c14)[_0x51a7('0x48')](function(_0x6668d){_0x213a26[_0x51a7('0x63')](_0x51a7('0x64'),_0x6668d);_0x213a26['redirect'](_0x51a7('0x65'));})[_0x51a7('0x5c')](function(_0x3f2ca3){return _0x213a26[_0x51a7('0x3f')](0x1f4)[_0x51a7('0x66')](_0x3f2ca3);});};exports[_0x51a7('0x67')]=function(_0x218e53){if(_[_0x51a7('0x68')](_0x218e53[_0x51a7('0x53')])||_[_0x51a7('0x68')](_0x218e53['apiKeyIat'])){return null;}else{return createJwt(_0x218e53);}};exports[_0x51a7('0x69')]=function(_0x277421){_0x277421[_0x51a7('0x53')]=generateNonce();_0x277421['apiKeyIat']=generateIssuedAt();return createJwt(_0x277421);};exports['regenerateApiKey']=function(_0xd23cb0,_0x1c4d93){var _0x3092f1=_0xd23cb0[_0x51a7('0x3d')]['apikey'];if(_0x3092f1){var _0x2fa7df={'nonce':_0x1c4d93[_0x51a7('0x53')],'iat':_0x1c4d93[_0x51a7('0x6a')],'audience':hardwareConf[_0x51a7('0x4e')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x3092f1,_0x2fa7df)[_0x51a7('0x48')](function(){return generateApiKey(_0x1c4d93);});}else{throw{'message':_0x51a7('0x6b')};}};exports[_0x51a7('0x6c')]=function(_0x1c34da){var _0x4283e0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4283e0[_0x51a7('0x6d')](_0x1c34da))throw new db[(_0x51a7('0x6e'))][(_0x51a7('0x6f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports['validatePasswordHistory']=function(_0x155d58,_0x2e6ee1,_0x242aa3){var _0x452e4e=encryptor['decryptString'](_0x2e6ee1)[_0x51a7('0x70')](',');for(var _0xc92bb0=0x0;_0xc92bb0<_0x242aa3;_0xc92bb0++){if(!_0x452e4e[_0xc92bb0])break;if(_0x155d58[_0x51a7('0x71')]()===_0x452e4e[_0xc92bb0]['toLowerCase']()){var _0x566b18=util[_0x51a7('0x72')](_0x51a7('0x73'),_0x242aa3);if(_0x242aa3===0x1){_0x566b18=_0x51a7('0x74');}throw new db[(_0x51a7('0x6e'))]['ValidationError'](_0x566b18);}}return;};exports['updatePasswordsHistory']=function(_0x135ce3,_0x3752c3){var _0x309ef1=_0x3752c3?encryptor[_0x51a7('0x75')](_0x3752c3)[_0x51a7('0x70')](','):[];if(_0x309ef1[_0x51a7('0x76')]===0x5){_0x309ef1[_0x51a7('0x77')](-0x1,0x1);}_0x309ef1['unshift'](_0x135ce3);return encryptor[_0x51a7('0x78')](_0x309ef1[_0x51a7('0x79')](','));};function signJwt(_0x585445){var _0x438cb2=BPromise[_0x51a7('0x7a')](jwt[_0x51a7('0x7b')],{'context':jwt});var _0x29c436=_0x585445['secret']||config['secrets'][_0x51a7('0xd')];return new BPromise(function(_0x2b2f94,_0xfeff73){_0x438cb2(_0x585445['payload'],_0x29c436,_0x585445[_0x51a7('0x7c')])[_0x51a7('0x48')](function(_0x4a87f3){_0x2b2f94(_0x4a87f3);})[_0x51a7('0x5c')](function(_0x5d544d){_0xfeff73(_0x5d544d);});});}function verifyJwt(_0x328499,_0x2702ec,_0x5b1cce){var _0x51045d=BPromise['promisify'](jwt[_0x51a7('0x7d')],{'context':jwt});var _0x1678f2=_0x5b1cce||config[_0x51a7('0xc')][_0x51a7('0xd')];return new BPromise(function(_0x2e51b5,_0xa05aa0){_0x51045d(_0x328499,_0x1678f2,_0x2702ec)[_0x51a7('0x48')](function(_0x1ab7df){_0x2e51b5(_0x1ab7df);})['catch'](function(_0x12c600){_0xa05aa0(_0x12c600);});});}function generateNonce(){return crypto[_0x51a7('0x7e')](0x10)['toString']('hex');}function generateIssuedAt(){return Math[_0x51a7('0x7f')](Date[_0x51a7('0x80')]()/0x3e8)[_0x51a7('0x81')]();}function createJwt(_0x405dda){var _0x53af0b={'payload':{'iat':_0x405dda[_0x51a7('0x6a')],'nonce':_0x405dda['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x405dda['id']['toString'](),'issuer':hardwareConf[_0x51a7('0x4e')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x53af0b)['then'](function(_0x3a19c7){return{'iat':_0x405dda[_0x51a7('0x6a')],'nonce':_0x405dda[_0x51a7('0x53')],'token':_0x3a19c7};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 4ba29ce..cdee05f 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x054a=['keys','startsWith','map','CmCustomField','findOne','slice','all','length','cf_','fieldType','type','lodash','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseQueryParameters','where','default','fields','filter','tags','skip','ids','count','User','clause','getFilteredContacts','rows','catch','describe','CmContact'];(function(_0x98197,_0xea7356){var _0x5d9199=function(_0x135375){while(--_0x135375){_0x98197['push'](_0x98197['shift']());}};_0x5d9199(++_0xea7356);}(_0x054a,0x18c));var _0xa054=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x054a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa054('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xa054('0x1'))['db'];exports[_0xa054('0x2')]=function(_0x59728b,_0x5861e2,_0x3b30bf,_0x79fcaa){var _0xa782b7={'count':0x0,'rows':[]};var _0x48f607=sqlUtils[_0xa054('0x3')](_0x5861e2,_0x59728b);if(_0x48f607){return Promise[_0xa054('0x4')](_0xa782b7);}var _0x4c4d1f=sqlUtils[_0xa054('0x5')]();var _0x2d3f3b={};var _0x185df0=![];var _0x485409=![];return Promise[_0xa054('0x4')]()[_0xa054('0x6')](function(){if(_0x59728b[_0xa054('0x7')]){return sqlUtils['parseAdvancedSearchFilter'](_0x59728b[_0xa054('0x7')],_0x79fcaa);}else{return sqlUtils[_0xa054('0x8')](_0x59728b,_0x79fcaa);}})[_0xa054('0x6')](function(_0x38f618){_0x4c4d1f[_0xa054('0x9')](_0x38f618[_0xa054('0xa')]);_0x4c4d1f[_0xa054('0x9')](_0x38f618[_0xa054('0xb')]);_0x4c4d1f[_0xa054('0x9')](_0x38f618[_0xa054('0xc')]);_0x4c4d1f[_0xa054('0x9')](_0x38f618['user']['clause']);_0x2d3f3b=_0x38f618[_0xa054('0xd')];_0x485409=_0x38f618['user'][_0xa054('0xe')];return sqlUtils['checkListsRestrictions'](_0x5861e2,_0x59728b,_0x485409);})[_0xa054('0x6')](function(_0x275a21){_0x4c4d1f[_0xa054('0x9')](_0x275a21);var _0x5235de=_0x59728b[_0xa054('0x7')]?_0x2d3f3b[_0xa054('0xf')]:_0x59728b['tag'];_0x185df0=_0x5235de?!![]:![];return sqlUtils['countFilteredContacts'](_0x4c4d1f,_0x5235de);})[_0xa054('0x6')](function(_0x7c8ff8){_0xa782b7['count']=_0x7c8ff8;if(_0xa782b7[_0xa054('0x10')]===0x0){return;}if(_0x59728b[_0xa054('0x11')]){_0x485409=!![];}return sqlUtils['buildContactsQuery'](_0x4c4d1f,_0x59728b[_0xa054('0xb')],_0x3b30bf,_0x185df0,_0x2d3f3b[_0xa054('0x12')],_0x485409);})[_0xa054('0x6')](function(_0x2c7be4){if(!_0x2c7be4){return[];}return sqlUtils[_0xa054('0x13')](_0x2c7be4,_0x59728b,_0x3b30bf);})[_0xa054('0x6')](function(_0x9fd1ad){_0xa782b7[_0xa054('0x14')]=_0x9fd1ad;return _0xa782b7;})[_0xa054('0x15')](function(_0x48526d){throw _0x48526d;});};exports[_0xa054('0x16')]=function(){var _0x45d43d={};var _0x1d3d35=[];return db[_0xa054('0x17')][_0xa054('0x16')]()[_0xa054('0x6')](function(_0x58bf1e){_0x45d43d=_0x58bf1e;var _0x4fb9fe=Object[_0xa054('0x18')](_0x45d43d)[_0xa054('0xc')](function(_0x16b748){return _[_0xa054('0x19')](_0x16b748,'cf_')?_0x16b748:undefined;});var _0x179722=_0x4fb9fe[_0xa054('0x1a')](function(_0x595de5){return db[_0xa054('0x1b')][_0xa054('0x1c')]({'where':{'id':_0x595de5[_0xa054('0x1d')](0x3)},'raw':!![]});});return Promise[_0xa054('0x1e')](_0x179722);})[_0xa054('0x6')](function(_0x1d32be){for(var _0x4898af=0x0;_0x4898af<_0x1d32be[_0xa054('0x1f')];_0x4898af++){if(_0x1d32be[_0x4898af]){var _0xf4fef4=_0xa054('0x20')+_0x1d32be[_0x4898af]['id'];_0x45d43d[_0xf4fef4][_0xa054('0x21')]=_0x1d32be[_0x4898af][_0xa054('0x22')];}}_0x1d3d35=_[_0xa054('0x1a')](Object[_0xa054('0x18')](_0x45d43d),function(_0x322c9e){return{'name':_0x322c9e,'type':_0x45d43d[_0x322c9e][_0xa054('0x22')]};});return _0x1d3d35;})[_0xa054('0x15')](function(_0x353263){throw _0x353263;});}; \ No newline at end of file +var _0xd7cf=['./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','where','fields','filter','user','clause','tags','skip','ids','tag','countFilteredContacts','count','User','getFilteredContacts','rows','catch','describe','CmContact','cf_','map','CmCustomField','findOne','slice','length','fieldType','keys','type','lodash'];(function(_0x4d7d33,_0x575510){var _0x19407b=function(_0x24a723){while(--_0x24a723){_0x4d7d33['push'](_0x4d7d33['shift']());}};_0x19407b(++_0x575510);}(_0xd7cf,0x1af));var _0xfd7c=function(_0x9a29ea,_0x5b8b29){_0x9a29ea=_0x9a29ea-0x0;var _0x11f261=_0xd7cf[_0x9a29ea];return _0x11f261;};'use strict';var _=require(_0xfd7c('0x0'));var sqlUtils=require(_0xfd7c('0x1'));var db=require(_0xfd7c('0x2'))['db'];exports[_0xfd7c('0x3')]=function(_0x528aa3,_0x809698,_0x467583,_0x58ee35){var _0x18f3fb={'count':0x0,'rows':[]};var _0x4a90d5=sqlUtils[_0xfd7c('0x4')](_0x809698,_0x528aa3);if(_0x4a90d5){return Promise[_0xfd7c('0x5')](_0x18f3fb);}var _0x531dfa=sqlUtils[_0xfd7c('0x6')]();var _0x52b03f={};var _0x252dd9=![];var _0x4fa33e=![];return Promise['resolve']()[_0xfd7c('0x7')](function(){if(_0x528aa3[_0xfd7c('0x8')]){return sqlUtils[_0xfd7c('0x9')](_0x528aa3[_0xfd7c('0x8')],_0x58ee35);}else{return sqlUtils['parseQueryParameters'](_0x528aa3,_0x58ee35);}})[_0xfd7c('0x7')](function(_0x1c7acd){_0x531dfa[_0xfd7c('0xa')](_0x1c7acd['default']);_0x531dfa[_0xfd7c('0xa')](_0x1c7acd[_0xfd7c('0xb')]);_0x531dfa[_0xfd7c('0xa')](_0x1c7acd[_0xfd7c('0xc')]);_0x531dfa[_0xfd7c('0xa')](_0x1c7acd[_0xfd7c('0xd')][_0xfd7c('0xe')]);_0x52b03f=_0x1c7acd[_0xfd7c('0xf')];_0x4fa33e=_0x1c7acd[_0xfd7c('0xd')][_0xfd7c('0x10')];return sqlUtils['checkListsRestrictions'](_0x809698,_0x528aa3,_0x4fa33e);})[_0xfd7c('0x7')](function(_0x2c7b7b){_0x531dfa['where'](_0x2c7b7b);var _0x1a5766=_0x528aa3['search']?_0x52b03f[_0xfd7c('0x11')]:_0x528aa3[_0xfd7c('0x12')];_0x252dd9=_0x1a5766?!![]:![];return sqlUtils[_0xfd7c('0x13')](_0x531dfa,_0x1a5766);})['then'](function(_0x277524){_0x18f3fb[_0xfd7c('0x14')]=_0x277524;if(_0x18f3fb[_0xfd7c('0x14')]===0x0){return;}if(_0x528aa3[_0xfd7c('0x15')]){_0x4fa33e=!![];}return sqlUtils['buildContactsQuery'](_0x531dfa,_0x528aa3[_0xfd7c('0xb')],_0x467583,_0x252dd9,_0x52b03f['clause'],_0x4fa33e);})[_0xfd7c('0x7')](function(_0x4364bd){if(!_0x4364bd){return[];}return sqlUtils[_0xfd7c('0x16')](_0x4364bd,_0x528aa3,_0x467583);})[_0xfd7c('0x7')](function(_0x1fff6d){_0x18f3fb[_0xfd7c('0x17')]=_0x1fff6d;return _0x18f3fb;})[_0xfd7c('0x18')](function(_0x5da0cd){throw _0x5da0cd;});};exports[_0xfd7c('0x19')]=function(){var _0x3b7b13={};var _0x2be0b5=[];return db[_0xfd7c('0x1a')][_0xfd7c('0x19')]()['then'](function(_0x5cbb85){_0x3b7b13=_0x5cbb85;var _0x516add=Object['keys'](_0x3b7b13)[_0xfd7c('0xc')](function(_0x34e600){return _['startsWith'](_0x34e600,_0xfd7c('0x1b'))?_0x34e600:undefined;});var _0x29f413=_0x516add[_0xfd7c('0x1c')](function(_0x4911e7){return db[_0xfd7c('0x1d')][_0xfd7c('0x1e')]({'where':{'id':_0x4911e7[_0xfd7c('0x1f')](0x3)},'raw':!![]});});return Promise['all'](_0x29f413);})['then'](function(_0x46340e){for(var _0x39c774=0x0;_0x39c774<_0x46340e[_0xfd7c('0x20')];_0x39c774++){if(_0x46340e[_0x39c774]){var _0x22349d=_0xfd7c('0x1b')+_0x46340e[_0x39c774]['id'];_0x3b7b13[_0x22349d][_0xfd7c('0x21')]=_0x46340e[_0x39c774]['type'];}}_0x2be0b5=_[_0xfd7c('0x1c')](Object[_0xfd7c('0x22')](_0x3b7b13),function(_0x3a948a){return{'name':_0x3a948a,'type':_0x3b7b13[_0x3a948a][_0xfd7c('0x23')]};});return _0x2be0b5;})[_0xfd7c('0x18')](function(_0x3053f6){throw _0x3053f6;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 93596aa..a3e245f 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc607=['user','skip','keys','some','compact','Contact','User','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','uc.UserId\x20=\x20?','\x20=\x20?','then','tag','filter','resolve','search','agent','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','attributes','group','limit','offset','having','order','DESC','findAll','color','keyBy','Sequelize','SELECT','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','c.id','isEmpty','QueryTypes','exports','lodash','squel','../parsers/advancedSearch','../interaction/utils','../../mysqldb','role','ListId','autocomplete','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','left_join','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','tools_tags','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','phone','mobile','fax','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','replace','length','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','castTo','DATE','buildExpression','type','default','value','start','end','Tag','split','map','tags','clause','and'];(function(_0xd024ea,_0x273358){var _0x1d27ad=function(_0x15e9d7){while(--_0x15e9d7){_0xd024ea['push'](_0xd024ea['shift']());}};_0x1d27ad(++_0x273358);}(_0xc607,0x170));var _0x7c60=function(_0x3193ed,_0x319aa5){_0x3193ed=_0x3193ed-0x0;var _0x42c0cb=_0xc607[_0x3193ed];return _0x42c0cb;};'use strict';var _=require(_0x7c60('0x0'));var squel=require(_0x7c60('0x1'));var as=require(_0x7c60('0x2'));var qs=require('../parsers/qs');var utils=require(_0x7c60('0x3'));var db=require(_0x7c60('0x4'))['db'];function skipContactsQuery(_0x5002ff,_0x3d472){var _0x48b83d=![];if(_0x5002ff[_0x7c60('0x5')]==='agent'&&!_0x3d472['search']&&!_0x3d472[_0x7c60('0x6')]&&_0x3d472[_0x7c60('0x7')]!==_0x7c60('0x8')){_0x48b83d=!![];}return _0x48b83d;}function getContactsSubquery(){return squel[_0x7c60('0x9')]()[_0x7c60('0xa')](_0x7c60('0xb'),'c')[_0x7c60('0xc')](_0x7c60('0xd'));}function applyJoinClauses(_0x58e234,_0x1364fc){var _0x1677c9=_0x1364fc?'c':'subqry';_0x58e234[_0x7c60('0xe')]('cm_user_has_contacts','uc',_0x7c60('0xf')+_0x1677c9+_0x7c60('0x10'))[_0x7c60('0xe')](_0x7c60('0x11'),'ct','ct.CmContactId\x20=\x20'+_0x1677c9+_0x7c60('0x10'))['left_join'](_0x7c60('0x12'),'t',_0x7c60('0x13'));return _0x58e234;}function addFieldsToQuery(_0x32ec8c,_0x577615,_0x9e9fb1,_0x5df686,_0x11f841){var _0x278b99=_0x11f841?'c':_0x7c60('0x14');if(!_0x577615){_0x577615=['id',_0x7c60('0x15'),_0x7c60('0x16'),_0x7c60('0x17'),_0x7c60('0x18'),_0x7c60('0x19'),_0x7c60('0x1a'),'ListId',_0x7c60('0x1b'),_0x7c60('0x1c'),_0x7c60('0x1d'),_0x7c60('0x1e'),_0x7c60('0x1f')];}else if(!_0x577615[_0x7c60('0x20')]('id')){_0x577615[_0x7c60('0x21')]('id');}var _0x2dd629=_0x9e9fb1&&_0x11f841||!_0x9e9fb1&&!_0x11f841;if(_0x5df686){_0x2dd629=_0x5df686&&_0x11f841||!_0x5df686&&!_0x11f841;}_0x577615[_0x7c60('0x22')](function(_0x33b9f9){if(_0x33b9f9==='TagIds'){if(_0x2dd629){_0x32ec8c[_0x7c60('0x23')](_0x7c60('0x24'),_0x33b9f9);}else if(_0x9e9fb1||_0x5df686){_0x32ec8c[_0x7c60('0x23')](_0x278b99+'.'+_0x33b9f9);}}else{_0x32ec8c[_0x7c60('0x23')](_0x278b99+'.'+_0x33b9f9);}});return _0x32ec8c;}function getSqlClauses(){var _0xf0e72a={'default':squel[_0x7c60('0x25')](),'fields':squel[_0x7c60('0x25')](),'filter':squel['expr'](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x7c60('0x25')](),'skip':![]}};return _0xf0e72a;}function parseTagParameter(_0x3992a0){var _0xcad4ad=squel[_0x7c60('0x25')]();if(_0x3992a0){var _0x4646b5=utils[_0x7c60('0x26')](_0x3992a0);_0x4646b5['forEach'](function(_0x372eb8){_0xcad4ad['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x372eb8+',%');});}return _0xcad4ad;}function parseSearchFilter(_0x16acf7){var _0x27294e=squel[_0x7c60('0x25')]();if(_0x16acf7){var _0x194603=_0x16acf7['replace']('\x5c','\x5c\x5c')[_0x7c60('0x27')](/'/g,'\x27\x27');if(_0x194603['split']('\x20')[_0x7c60('0x28')]>0x1){_0x27294e['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7c60('0x29')](_0x194603,!![]),null);}else{if(qs[_0x7c60('0x2a')](_0x194603)){_0x27294e['or'](_0x7c60('0x2b'),_0x194603+'%');_0x27294e['or'](_0x7c60('0x2c'),_0x194603+'%');_0x27294e['or'](_0x7c60('0x2d'),_0x194603+'%');_0x27294e['or'](_0x7c60('0x2e'),_0x194603+'%');}else if(qs[_0x7c60('0x2f')](_0x194603)){_0x27294e['or']('c.email\x20LIKE\x20?',_0x194603+'%');}else{_0x27294e['or']('c.firstName\x20LIKE\x20?','%'+_0x194603+'%');_0x27294e['or']('c.lastName\x20LIKE\x20?','%'+_0x194603+'%');_0x27294e['or']('c.email\x20LIKE\x20?','%'+_0x194603+'%');}}}return _0x27294e;}function parseAdvancedSearchFilter(_0x1bc64b,_0x5cecb0){var _0x1bce5b=getSqlClauses();var _0x191cb0=as[_0x7c60('0x30')](_0x1bc64b);var _0x2974b3=_0x191cb0[_0x7c60('0x31')];for(var _0x9c703a=0x0;_0x9c703a<_0x191cb0['conditions']['length'];_0x9c703a++){var _0x452fba=_0x191cb0[_0x7c60('0x32')][_0x9c703a];var _0x715a4f='c';var _0x3d1e7f=_[_0x7c60('0x33')](_0x5cecb0,[_0x7c60('0x34'),_0x452fba[_0x7c60('0x23')]]);if(_0x3d1e7f){if(_0x452fba[_0x7c60('0x23')]===_0x7c60('0x35')||_0x3d1e7f['fieldType']==='datetime'){_0x452fba[_0x7c60('0x36')]=_0x7c60('0x37');}var _0x4ebbb0=as[_0x7c60('0x38')](_0x715a4f,_0x3d1e7f[_0x7c60('0x39')],_0x452fba);_0x1bce5b[_0x7c60('0x3a')][_0x2974b3](_0x4ebbb0['text'],_0x4ebbb0[_0x7c60('0x3b')][_0x7c60('0x3c')],_0x4ebbb0['value'][_0x7c60('0x3d')]);}else{if(_0x452fba['field']===_0x7c60('0x3e')){var _0x5566b6=_0x452fba[_0x7c60('0x3b')][_0x7c60('0x3f')](',')[_0x7c60('0x40')](function(_0x41d339){return Number(_0x41d339);});var _0x3f487b=parseTagParameter(_0x5566b6);_0x1bce5b[_0x7c60('0x41')][_0x7c60('0x42')][_0x7c60('0x43')](_0x3f487b);_0x1bce5b['tags']['ids']=_0x5566b6;}else if(_0x452fba[_0x7c60('0x23')]==='User'){_0x1bce5b['user']['clause'][_0x7c60('0x43')]('uc.UserId\x20=\x20?',_0x452fba[_0x7c60('0x3b')]);_0x1bce5b[_0x7c60('0x44')][_0x7c60('0x45')]=!![];}}}return _0x1bce5b;}function parseModelFields(_0x439521,_0x471c10){var _0x1b1da5=squel[_0x7c60('0x25')]();var _0x565eb3=_(_0x439521)[_0x7c60('0x46')]()['map'](function(_0x17e8bf){return _[_0x7c60('0x47')](_0x471c10,['name',_0x17e8bf])?_0x17e8bf:undefined;})[_0x7c60('0x48')]()[_0x7c60('0x3b')]();if(_0x439521[_0x7c60('0x49')]){_0x565eb3[_0x7c60('0x21')]('Contact');}if(_0x439521['User']){_0x565eb3[_0x7c60('0x21')](_0x7c60('0x4a'));}if(_0x565eb3[_0x7c60('0x28')]>0x0){_0x565eb3[_0x7c60('0x22')](function(_0x51ba62){if(_0x51ba62==='ListId'){_0x1b1da5[_0x7c60('0x43')]('c.ListId\x20IN\x20?',[]['concat'](_0x439521[_0x51ba62]));}else if(_0x51ba62==='Contact'){var _0x17d490='%'+_0x439521[_0x51ba62]+'%';_0x1b1da5['and'](_0x7c60('0x4b'),_0x17d490);}else if(_0x51ba62===_0x7c60('0x4a')){_0x1b1da5['and'](_0x7c60('0x4c'),_0x439521[_0x51ba62]);}else{_0x1b1da5[_0x7c60('0x43')]('c.'+_0x51ba62+_0x7c60('0x4d'),_0x439521[_0x51ba62]);}});}return _0x1b1da5;}function parseQueryParameters(_0xd5e88,_0x25c0f0){var _0x50b6cb=getSqlClauses();return Promise['resolve']()[_0x7c60('0x4e')](function(){return parseModelFields(_0xd5e88,_0x25c0f0);})[_0x7c60('0x4e')](function(_0x4a2bb1){_0x50b6cb['fields'][_0x7c60('0x43')](_0x4a2bb1);return parseTagParameter(_0xd5e88[_0x7c60('0x4f')]);})[_0x7c60('0x4e')](function(_0x5cbb0a){_0x50b6cb[_0x7c60('0x41')][_0x7c60('0x42')][_0x7c60('0x43')](_0x5cbb0a);return parseSearchFilter(_0xd5e88[_0x7c60('0x50')]);})['then'](function(_0x2147fd){_0x50b6cb['filter']=_0x2147fd;return _0x50b6cb;});}function checkListsRestrictions(_0x3b009f,_0x2a761d,_0x471c3b){var _0xece1f4=squel[_0x7c60('0x25')]();return Promise[_0x7c60('0x51')]()[_0x7c60('0x4e')](function(){if(_0x2a761d[_0x7c60('0x52')]&&_0x3b009f[_0x7c60('0x5')]===_0x7c60('0x53')&&!_0x471c3b){return _0x3b009f['getLists']({'attributes':['id'],'raw':!![]});}})[_0x7c60('0x4e')](function(_0x373e14){if(_0x373e14){if(_0x373e14[_0x7c60('0x28')]===0x0){_0xece1f4[_0x7c60('0x43')](_0x7c60('0x54'));}else{_0xece1f4['and'](_0x7c60('0x55'),_['map'](_0x373e14,'id'));}}})[_0x7c60('0x4e')](function(){return _0xece1f4;});}function buildContactsQuery(_0x1b31dc,_0x3900b1,_0x3ac845,_0x1dc20a,_0xed107,_0x531219){if(_0x3900b1){_0x3900b1=_0x3ac845[_0x7c60('0x56')];}_0x1b31dc=addFieldsToQuery(_0x1b31dc,_0x3900b1,_0x1dc20a,_0x531219,!![]);var _0x7bbe42=squel[_0x7c60('0x9')]();_0x7bbe42=addFieldsToQuery(_0x7bbe42,_0x3900b1,_0x1dc20a,_0x531219,![]);if(_0x1dc20a||_0x531219){_0x1b31dc=applyJoinClauses(_0x1b31dc,!![]);_0x1b31dc[_0x7c60('0x57')]('c.id');if(_0x3ac845[_0x7c60('0x58')]){_0x7bbe42[_0x7c60('0x58')](_0x3ac845[_0x7c60('0x58')]);}if(_0x3ac845[_0x7c60('0x59')]){_0x7bbe42['offset'](_0x3ac845[_0x7c60('0x59')]);}}else{_0x7bbe42=applyJoinClauses(_0x7bbe42,![]);_0x7bbe42['group']('subqry.id');if(_0x3ac845[_0x7c60('0x58')]){_0x1b31dc[_0x7c60('0x58')](_0x3ac845['limit']);}if(_0x3ac845['offset']){_0x1b31dc['offset'](_0x3ac845[_0x7c60('0x59')]);}}_0x7bbe42[_0x7c60('0x5a')](_0xed107);if(_0x3ac845[_0x7c60('0x5b')]){_0x3ac845[_0x7c60('0x5b')][_0x7c60('0x22')](function(_0x4f351b){_0x1b31dc[_0x7c60('0x5b')]('c.'+_0x4f351b[0x0],_0x4f351b[0x1]===_0x7c60('0x5c')?![]:!![]);_0x7bbe42[_0x7c60('0x5b')]('subqry.'+_0x4f351b[0x0],_0x4f351b[0x1]===_0x7c60('0x5c')?![]:!![]);});}_0x7bbe42['from'](_0x1b31dc,_0x7c60('0x14'));return _0x7bbe42;}function getFilteredContacts(_0x861b3b){var _0x41f767=[];return db[_0x7c60('0x3e')][_0x7c60('0x5d')]({'attributes':['id',_0x7c60('0x34'),_0x7c60('0x5e')],'raw':!![]})[_0x7c60('0x4e')](function(_0x21cfe6){_0x41f767=_[_0x7c60('0x5f')](_0x21cfe6,'id');var _0x1758d8={'type':db[_0x7c60('0x60')]['QueryTypes'][_0x7c60('0x61')],'model':db[_0x7c60('0x62')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x7c60('0x63')][_0x7c60('0x64')](_0x861b3b[_0x7c60('0x65')](),_0x1758d8);})['then'](function(_0x12b941){_0x12b941[_0x7c60('0x22')](function(_0x5499db){if(_0x5499db['TagIds']){_0x5499db[_0x7c60('0x66')]=[];_0x5499db['TagIds'][_0x7c60('0x3f')](',')[_0x7c60('0x22')](function(_0xe64a4c){_0x5499db[_0x7c60('0x66')][_0x7c60('0x21')](_0x41f767[_0xe64a4c]);});}delete _0x5499db[_0x7c60('0x1f')];});return _0x12b941;});}function countFilteredContacts(_0x5ca8f2,_0x584586){var _0x13a9e1=_0x5ca8f2[_0x7c60('0x67')]();_0x13a9e1[_0x7c60('0x23')](_0x7c60('0x68'));_0x13a9e1=applyJoinClauses(_0x13a9e1,!![]);_0x5ca8f2[_0x7c60('0x57')](_0x7c60('0x69'));var _0x41eee7=utils[_0x7c60('0x26')](_0x584586);if(!_[_0x7c60('0x6a')](_0x41eee7)){_0x13a9e1[_0x7c60('0xc')]('t.id\x20IN\x20?',_0x41eee7);}var _0x471e11={'type':db[_0x7c60('0x60')][_0x7c60('0x6b')][_0x7c60('0x61')],'raw':!![]};return db['sequelize'][_0x7c60('0x64')](_0x13a9e1[_0x7c60('0x65')](),_0x471e11)[_0x7c60('0x4e')](function(_0x5293fb){return _0x5293fb[0x0][_0x7c60('0x68')];});}module[_0x7c60('0x6c')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xd9bd=['../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','from','cm_contacts','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','firstName','lastName','mobile','email','CompanyId','createdAt','updatedAt','TagIds','includes','push','forEach','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','find','name','dateOfBirth','datetime','castTo','DATE','buildExpression','type','default','text','start','value','map','tags','clause','and','ids','user','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','User','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','attributes','select','group','c.id','limit','offset','subqry.id','order','DESC','subqry.','Tag','findAll','color','keyBy','SELECT','CmContact','sequelize','toString','Tags','clone','COUNT(*)','isEmpty','where','t.id\x20IN\x20?','Sequelize','QueryTypes','query','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xd9bd,0xd8));var _0xdd9b=function(_0x3a40d6,_0x119aeb){_0x3a40d6=_0x3a40d6-0x0;var _0x5cbed3=_0xd9bd[_0x3a40d6];return _0x5cbed3;};'use strict';var _=require(_0xdd9b('0x0'));var squel=require(_0xdd9b('0x1'));var as=require(_0xdd9b('0x2'));var qs=require(_0xdd9b('0x3'));var utils=require(_0xdd9b('0x4'));var db=require(_0xdd9b('0x5'))['db'];function skipContactsQuery(_0x5d45b8,_0x5efbee){var _0x95124d=![];if(_0x5d45b8[_0xdd9b('0x6')]===_0xdd9b('0x7')&&!_0x5efbee[_0xdd9b('0x8')]&&!_0x5efbee[_0xdd9b('0x9')]&&_0x5efbee[_0xdd9b('0xa')]!==_0xdd9b('0xb')){_0x95124d=!![];}return _0x95124d;}function getContactsSubquery(){return squel['select']()[_0xdd9b('0xc')](_0xdd9b('0xd'),'c')['where'](_0xdd9b('0xe'));}function applyJoinClauses(_0xa0b47f,_0x4e759f){var _0xdc0faf=_0x4e759f?'c':_0xdd9b('0xf');_0xa0b47f['left_join'](_0xdd9b('0x10'),'uc','uc.CmContactId\x20=\x20'+_0xdc0faf+_0xdd9b('0x11'))[_0xdd9b('0x12')](_0xdd9b('0x13'),'ct',_0xdd9b('0x14')+_0xdc0faf+_0xdd9b('0x11'))[_0xdd9b('0x12')](_0xdd9b('0x15'),'t','t.id\x20=\x20ct.TagId');return _0xa0b47f;}function addFieldsToQuery(_0x87a6fa,_0x373121,_0x3c01c0,_0x727828,_0x4ec8a4){var _0x1170d6=_0x4ec8a4?'c':_0xdd9b('0xf');if(!_0x373121){_0x373121=['id',_0xdd9b('0x16'),_0xdd9b('0x17'),'phone',_0xdd9b('0x18'),'fax',_0xdd9b('0x19'),'ListId',_0xdd9b('0x1a'),_0xdd9b('0x1b'),_0xdd9b('0x1c'),'deletedAt',_0xdd9b('0x1d')];}else if(!_0x373121[_0xdd9b('0x1e')]('id')){_0x373121[_0xdd9b('0x1f')]('id');}var _0x1687c5=_0x3c01c0&&_0x4ec8a4||!_0x3c01c0&&!_0x4ec8a4;if(_0x727828){_0x1687c5=_0x727828&&_0x4ec8a4||!_0x727828&&!_0x4ec8a4;}_0x373121[_0xdd9b('0x20')](function(_0x4f9086){if(_0x4f9086==='TagIds'){if(_0x1687c5){_0x87a6fa[_0xdd9b('0x21')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x4f9086);}else if(_0x3c01c0||_0x727828){_0x87a6fa['field'](_0x1170d6+'.'+_0x4f9086);}}else{_0x87a6fa[_0xdd9b('0x21')](_0x1170d6+'.'+_0x4f9086);}});return _0x87a6fa;}function getSqlClauses(){var _0x1a9341={'default':squel[_0xdd9b('0x22')](),'fields':squel[_0xdd9b('0x22')](),'filter':squel[_0xdd9b('0x22')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0xdd9b('0x22')](),'skip':![]}};return _0x1a9341;}function parseTagParameter(_0x450dd3){var _0x13f275=squel[_0xdd9b('0x22')]();if(_0x450dd3){var _0x3b2808=utils[_0xdd9b('0x23')](_0x450dd3);_0x3b2808[_0xdd9b('0x20')](function(_0x59d15d){_0x13f275['or'](_0xdd9b('0x24'),'%,'+_0x59d15d+',%');});}return _0x13f275;}function parseSearchFilter(_0x1a06db){var _0x2c0574=squel['expr']();if(_0x1a06db){var _0x15f236=_0x1a06db[_0xdd9b('0x25')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x15f236[_0xdd9b('0x26')]('\x20')[_0xdd9b('0x27')]>0x1){_0x2c0574['or'](_0xdd9b('0x28'),qs[_0xdd9b('0x29')](_0x15f236,!![]),null);}else{if(qs[_0xdd9b('0x2a')](_0x15f236)){_0x2c0574['or'](_0xdd9b('0x2b'),_0x15f236+'%');_0x2c0574['or'](_0xdd9b('0x2c'),_0x15f236+'%');_0x2c0574['or']('c.mobile\x20LIKE\x20?',_0x15f236+'%');_0x2c0574['or'](_0xdd9b('0x2d'),_0x15f236+'%');}else if(qs[_0xdd9b('0x2e')](_0x15f236)){_0x2c0574['or'](_0xdd9b('0x2f'),_0x15f236+'%');}else{_0x2c0574['or']('c.firstName\x20LIKE\x20?','%'+_0x15f236+'%');_0x2c0574['or'](_0xdd9b('0x30'),'%'+_0x15f236+'%');_0x2c0574['or']('c.email\x20LIKE\x20?','%'+_0x15f236+'%');}}}return _0x2c0574;}function parseAdvancedSearchFilter(_0x377ddb,_0x6761a1){var _0x4a593d=getSqlClauses();var _0x5454f8=as[_0xdd9b('0x31')](_0x377ddb);var _0xdaf3ed=_0x5454f8['sqlOperator'];for(var _0x2963e4=0x0;_0x2963e4<_0x5454f8[_0xdd9b('0x32')][_0xdd9b('0x27')];_0x2963e4++){var _0x35f103=_0x5454f8[_0xdd9b('0x32')][_0x2963e4];var _0x1eff3d='c';var _0x58eecf=_[_0xdd9b('0x33')](_0x6761a1,[_0xdd9b('0x34'),_0x35f103['field']]);if(_0x58eecf){if(_0x35f103[_0xdd9b('0x21')]===_0xdd9b('0x35')||_0x58eecf['fieldType']===_0xdd9b('0x36')){_0x35f103[_0xdd9b('0x37')]=_0xdd9b('0x38');}var _0x53257d=as[_0xdd9b('0x39')](_0x1eff3d,_0x58eecf[_0xdd9b('0x3a')],_0x35f103);_0x4a593d[_0xdd9b('0x3b')][_0xdaf3ed](_0x53257d[_0xdd9b('0x3c')],_0x53257d['value'][_0xdd9b('0x3d')],_0x53257d[_0xdd9b('0x3e')]['end']);}else{if(_0x35f103[_0xdd9b('0x21')]==='Tag'){var _0x339947=_0x35f103[_0xdd9b('0x3e')]['split'](',')[_0xdd9b('0x3f')](function(_0x3f24f7){return Number(_0x3f24f7);});var _0x5a5825=parseTagParameter(_0x339947);_0x4a593d[_0xdd9b('0x40')][_0xdd9b('0x41')][_0xdd9b('0x42')](_0x5a5825);_0x4a593d[_0xdd9b('0x40')][_0xdd9b('0x43')]=_0x339947;}else if(_0x35f103[_0xdd9b('0x21')]==='User'){_0x4a593d[_0xdd9b('0x44')][_0xdd9b('0x41')][_0xdd9b('0x42')](_0xdd9b('0x45'),_0x35f103['value']);_0x4a593d[_0xdd9b('0x44')][_0xdd9b('0x46')]=!![];}}}return _0x4a593d;}function parseModelFields(_0x3073d0,_0x5c704b){var _0x356986=squel['expr']();var _0x11dbdd=_(_0x3073d0)[_0xdd9b('0x47')]()['map'](function(_0x1231eb){return _[_0xdd9b('0x48')](_0x5c704b,[_0xdd9b('0x34'),_0x1231eb])?_0x1231eb:undefined;})[_0xdd9b('0x49')]()['value']();if(_0x3073d0['Contact']){_0x11dbdd[_0xdd9b('0x1f')](_0xdd9b('0x4a'));}if(_0x3073d0[_0xdd9b('0x4b')]){_0x11dbdd['push'](_0xdd9b('0x4b'));}if(_0x11dbdd[_0xdd9b('0x27')]>0x0){_0x11dbdd[_0xdd9b('0x20')](function(_0x26b33d){if(_0x26b33d===_0xdd9b('0x9')){_0x356986['and'](_0xdd9b('0x4c'),[][_0xdd9b('0x4d')](_0x3073d0[_0x26b33d]));}else if(_0x26b33d===_0xdd9b('0x4a')){var _0x2cb69c='%'+_0x3073d0[_0x26b33d]+'%';_0x356986['and'](_0xdd9b('0x4e'),_0x2cb69c);}else if(_0x26b33d==='User'){_0x356986[_0xdd9b('0x42')](_0xdd9b('0x45'),_0x3073d0[_0x26b33d]);}else{_0x356986['and']('c.'+_0x26b33d+_0xdd9b('0x4f'),_0x3073d0[_0x26b33d]);}});}return _0x356986;}function parseQueryParameters(_0x1ffcf6,_0x448a2c){var _0x369527=getSqlClauses();return Promise[_0xdd9b('0x50')]()[_0xdd9b('0x51')](function(){return parseModelFields(_0x1ffcf6,_0x448a2c);})['then'](function(_0x464792){_0x369527['fields']['and'](_0x464792);return parseTagParameter(_0x1ffcf6['tag']);})['then'](function(_0xaced71){_0x369527[_0xdd9b('0x40')]['clause'][_0xdd9b('0x42')](_0xaced71);return parseSearchFilter(_0x1ffcf6['filter']);})['then'](function(_0x4cb8d7){_0x369527['filter']=_0x4cb8d7;return _0x369527;});}function checkListsRestrictions(_0x5d54d7,_0x507411,_0x2a4e69){var _0x18af71=squel['expr']();return Promise[_0xdd9b('0x50')]()[_0xdd9b('0x51')](function(){if(_0x507411['search']&&_0x5d54d7['role']==='agent'&&!_0x2a4e69){return _0x5d54d7['getLists']({'attributes':['id'],'raw':!![]});}})[_0xdd9b('0x51')](function(_0x1dd1e6){if(_0x1dd1e6){if(_0x1dd1e6[_0xdd9b('0x27')]===0x0){_0x18af71[_0xdd9b('0x42')]('c.ListId\x20IS\x20NULL');}else{_0x18af71[_0xdd9b('0x42')]('c.ListId\x20IN\x20?',_[_0xdd9b('0x3f')](_0x1dd1e6,'id'));}}})['then'](function(){return _0x18af71;});}function buildContactsQuery(_0x1e8b8f,_0x187ccd,_0x178e0c,_0x43350b,_0x2b603c,_0x57a442){if(_0x187ccd){_0x187ccd=_0x178e0c[_0xdd9b('0x52')];}_0x1e8b8f=addFieldsToQuery(_0x1e8b8f,_0x187ccd,_0x43350b,_0x57a442,!![]);var _0x2b3f97=squel[_0xdd9b('0x53')]();_0x2b3f97=addFieldsToQuery(_0x2b3f97,_0x187ccd,_0x43350b,_0x57a442,![]);if(_0x43350b||_0x57a442){_0x1e8b8f=applyJoinClauses(_0x1e8b8f,!![]);_0x1e8b8f[_0xdd9b('0x54')](_0xdd9b('0x55'));if(_0x178e0c[_0xdd9b('0x56')]){_0x2b3f97[_0xdd9b('0x56')](_0x178e0c[_0xdd9b('0x56')]);}if(_0x178e0c[_0xdd9b('0x57')]){_0x2b3f97[_0xdd9b('0x57')](_0x178e0c[_0xdd9b('0x57')]);}}else{_0x2b3f97=applyJoinClauses(_0x2b3f97,![]);_0x2b3f97[_0xdd9b('0x54')](_0xdd9b('0x58'));if(_0x178e0c[_0xdd9b('0x56')]){_0x1e8b8f[_0xdd9b('0x56')](_0x178e0c[_0xdd9b('0x56')]);}if(_0x178e0c[_0xdd9b('0x57')]){_0x1e8b8f[_0xdd9b('0x57')](_0x178e0c[_0xdd9b('0x57')]);}}_0x2b3f97['having'](_0x2b603c);if(_0x178e0c['order']){_0x178e0c[_0xdd9b('0x59')]['forEach'](function(_0x5c75f8){_0x1e8b8f['order']('c.'+_0x5c75f8[0x0],_0x5c75f8[0x1]===_0xdd9b('0x5a')?![]:!![]);_0x2b3f97[_0xdd9b('0x59')](_0xdd9b('0x5b')+_0x5c75f8[0x0],_0x5c75f8[0x1]===_0xdd9b('0x5a')?![]:!![]);});}_0x2b3f97['from'](_0x1e8b8f,'subqry');return _0x2b3f97;}function getFilteredContacts(_0x5b0ae7){var _0x45fcdd=[];return db[_0xdd9b('0x5c')][_0xdd9b('0x5d')]({'attributes':['id',_0xdd9b('0x34'),_0xdd9b('0x5e')],'raw':!![]})['then'](function(_0x3c40cb){_0x45fcdd=_[_0xdd9b('0x5f')](_0x3c40cb,'id');var _0x2a7f85={'type':db['Sequelize']['QueryTypes'][_0xdd9b('0x60')],'model':db[_0xdd9b('0x61')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xdd9b('0x62')]['query'](_0x5b0ae7[_0xdd9b('0x63')](),_0x2a7f85);})[_0xdd9b('0x51')](function(_0xda7298){_0xda7298[_0xdd9b('0x20')](function(_0x3068d8){if(_0x3068d8[_0xdd9b('0x1d')]){_0x3068d8[_0xdd9b('0x64')]=[];_0x3068d8[_0xdd9b('0x1d')][_0xdd9b('0x26')](',')[_0xdd9b('0x20')](function(_0x2eb5e8){_0x3068d8[_0xdd9b('0x64')][_0xdd9b('0x1f')](_0x45fcdd[_0x2eb5e8]);});}delete _0x3068d8[_0xdd9b('0x1d')];});return _0xda7298;});}function countFilteredContacts(_0x188d22,_0x2efb42){var _0x4c8870=_0x188d22[_0xdd9b('0x65')]();_0x4c8870[_0xdd9b('0x21')](_0xdd9b('0x66'));_0x4c8870=applyJoinClauses(_0x4c8870,!![]);_0x188d22[_0xdd9b('0x54')](_0xdd9b('0x55'));var _0x3dbc16=utils['getSelectedTags'](_0x2efb42);if(!_[_0xdd9b('0x67')](_0x3dbc16)){_0x4c8870[_0xdd9b('0x68')](_0xdd9b('0x69'),_0x3dbc16);}var _0x5d819d={'type':db[_0xdd9b('0x6a')][_0xdd9b('0x6b')][_0xdd9b('0x60')],'raw':!![]};return db[_0xdd9b('0x62')][_0xdd9b('0x6c')](_0x4c8870[_0xdd9b('0x63')](),_0x5d819d)[_0xdd9b('0x51')](function(_0x59772a){return _0x59772a[0x0][_0xdd9b('0x66')];});}module[_0xdd9b('0x6d')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index bd6eef4..5e47817 100644 --- a/server/components/encryptor/index.js +++ b/server/components/encryptor/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1fe6=['decryptString','createDecipher','crypto','bluebird','lodash','../../config/environment','app','secrets','session','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','filter','hasOwnProperty','encryptFile','createReadStream','createCipher','data','update','binary','final','write','end','close','unlink','createWriteStream','secret','utf8','base64'];(function(_0x21bc66,_0x42c06b){var _0x2a753e=function(_0xab249a){while(--_0xab249a){_0x21bc66['push'](_0x21bc66['shift']());}};_0x2a753e(++_0x42c06b);}(_0x1fe6,0x182));var _0x61fe=function(_0x35371d,_0x9c1afd){_0x35371d=_0x35371d-0x0;var _0x2e4ec2=_0x1fe6[_0x35371d];return _0x2e4ec2;};'use strict';var crypto=require(_0x61fe('0x0'));var fs=require('fs');var BPromise=require(_0x61fe('0x1'));var _=require(_0x61fe('0x2'));var config=require(_0x61fe('0x3'));var logger=require('../../config/logger')(_0x61fe('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x61fe('0x5')][_0x61fe('0x6')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x61fe('0x7')};if(config[_0x61fe('0x8')]&&config['encrypt']['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt'][_0x61fe('0x9')]);if(isSupported){fileOptions[_0x61fe('0x9')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x61fe('0xa')](',\x20');logger[_0x61fe('0xb')](config[_0x61fe('0x8')]['algorithm'],_0x61fe('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x3fe8d8){return AES_SUPPORTED_RX['test'](_0x3fe8d8);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x61fe('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x176694){return getSupportedCiphers()['indexOf'](_0x176694)>-0x1;}function combineOptions(_0x281699){var _0x47834b={};for(var _0x25a0aa in fileOptions){if(fileOptions['hasOwnProperty'](_0x25a0aa)){_0x47834b[_0x25a0aa]=fileOptions[_0x25a0aa];}}if(_0x281699){for(var _0x445605 in _0x281699){if(_0x281699[_0x61fe('0xe')](_0x445605)){_0x47834b[_0x445605]=_0x281699[_0x445605];}}}return _0x47834b;}exports[_0x61fe('0xf')]=function(_0x3177d4,_0x299db4,_0x12b265,_0x3a8ff7){return new BPromise(function(_0x10c231,_0x3a48b0){_0x3a8ff7=combineOptions(_0x3a8ff7);var _0x498066=new Buffer(_0x12b265);var _0x444673=fs[_0x61fe('0x10')](_0x3177d4);var _0x197795=fs['createWriteStream'](_0x299db4);var _0x1d5154=crypto[_0x61fe('0x11')](_0x3a8ff7['algorithm'],_0x498066);_0x444673['on'](_0x61fe('0x12'),function(_0x10e05c){var _0x305eed=new Buffer(_0x1d5154[_0x61fe('0x13')](_0x10e05c),_0x61fe('0x14'));_0x197795['write'](_0x305eed);});_0x444673['on']('end',function(){try{var _0x4fd20a=new Buffer(_0x1d5154[_0x61fe('0x15')](_0x61fe('0x14')),_0x61fe('0x14'));_0x197795[_0x61fe('0x16')](_0x4fd20a);_0x197795[_0x61fe('0x17')]();_0x197795['on'](_0x61fe('0x18'),function(){return _0x10c231(_0x299db4);});}catch(_0x52357f){fs[_0x61fe('0x19')](_0x299db4);return _0x3a48b0(_0x52357f);}});});};exports['decryptFile']=function(_0x99acc4,_0x47fb95,_0x537e77,_0x7ab8b2){return new BPromise(function(_0x370c65,_0x4b6f5f){_0x7ab8b2=combineOptions(_0x7ab8b2);var _0x5e958f=new Buffer(_0x537e77);var _0x4f9904=fs[_0x61fe('0x10')](_0x99acc4);var _0x29576f=fs[_0x61fe('0x1a')](_0x47fb95);var _0x3f7021=crypto['createDecipher'](_0x7ab8b2[_0x61fe('0x9')],_0x5e958f);_0x4f9904['on'](_0x61fe('0x12'),function(_0x330d83){var _0x5064bf=new Buffer(_0x3f7021['update'](_0x330d83),'binary');_0x29576f[_0x61fe('0x16')](_0x5064bf);});_0x4f9904['on'](_0x61fe('0x17'),function(){try{var _0x474673=new Buffer(_0x3f7021[_0x61fe('0x15')]('binary'),_0x61fe('0x14'));_0x29576f[_0x61fe('0x16')](_0x474673);_0x29576f['end']();_0x29576f['on'](_0x61fe('0x18'),function(){return _0x370c65(_0x47fb95);});}catch(_0xf43cdd){fs[_0x61fe('0x19')](_0x47fb95);return _0x4b6f5f(_0xf43cdd);}});});};exports['encryptString']=function(_0x56f112,_0x694031,_0x2ae755){var _0x38c8cc=_0x2ae755||stringOptions['algorithm'];var _0x655937=_0x694031||stringOptions[_0x61fe('0x1b')];var _0x4dabab=crypto[_0x61fe('0x11')](_0x38c8cc,_0x655937);var _0x24d9e6=_0x4dabab['update'](_0x56f112,_0x61fe('0x1c'),_0x61fe('0x1d'));_0x24d9e6+=_0x4dabab[_0x61fe('0x15')](_0x61fe('0x1d'));return _0x24d9e6;};exports[_0x61fe('0x1e')]=function(_0x51b929,_0x4a99fb,_0x2bc3ac){var _0x5316b1=_0x2bc3ac||stringOptions[_0x61fe('0x9')];var _0x35f92d=_0x4a99fb||stringOptions[_0x61fe('0x1b')];var _0x20d54b=crypto[_0x61fe('0x1f')](_0x5316b1,_0x35f92d);var _0x2a4343=_0x20d54b[_0x61fe('0x13')](_0x51b929,_0x61fe('0x1d'),_0x61fe('0x1c'));_0x2a4343+=_0x20d54b[_0x61fe('0x15')](_0x61fe('0x1c'));return _0x2a4343;}; \ No newline at end of file +var _0x276c=['update','encryptString','secret','utf8','base64','decryptString','crypto','lodash','app','secrets','session','aes192','encrypt','algorithm','join','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher','binary','write','end','final','close','unlink','decryptFile','createReadStream','createDecipher','data'];(function(_0x53e937,_0x5d671b){var _0x35efed=function(_0x1c4bf8){while(--_0x1c4bf8){_0x53e937['push'](_0x53e937['shift']());}};_0x35efed(++_0x5d671b);}(_0x276c,0x17a));var _0xc276=function(_0x14499f,_0x16a1c1){_0x14499f=_0x14499f-0x0;var _0x26aa9e=_0x276c[_0x14499f];return _0x26aa9e;};'use strict';var crypto=require(_0xc276('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xc276('0x1'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xc276('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xc276('0x3')][_0xc276('0x4')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xc276('0x5')};if(config['encrypt']&&config[_0xc276('0x6')][_0xc276('0x7')]){var isSupported=isAlgorithmSupported(config[_0xc276('0x6')][_0xc276('0x7')]);if(isSupported){fileOptions[_0xc276('0x7')]=config['encrypt'][_0xc276('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xc276('0x8')](',\x20');logger['error'](config['encrypt'][_0xc276('0x7')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x15f1bb){return AES_SUPPORTED_RX['test'](_0x15f1bb);}function getSupportedCiphers(){return crypto['getCiphers']()[_0xc276('0x9')](isASupportedCipher);}function isAlgorithmSupported(_0x92ec89){return getSupportedCiphers()[_0xc276('0xa')](_0x92ec89)>-0x1;}function combineOptions(_0x42ce36){var _0x50feac={};for(var _0xedffda in fileOptions){if(fileOptions[_0xc276('0xb')](_0xedffda)){_0x50feac[_0xedffda]=fileOptions[_0xedffda];}}if(_0x42ce36){for(var _0x574bd3 in _0x42ce36){if(_0x42ce36[_0xc276('0xb')](_0x574bd3)){_0x50feac[_0x574bd3]=_0x42ce36[_0x574bd3];}}}return _0x50feac;}exports[_0xc276('0xc')]=function(_0x4f5ee0,_0x14a90c,_0x5c248e,_0x1600e5){return new BPromise(function(_0x311131,_0x236fdd){_0x1600e5=combineOptions(_0x1600e5);var _0x12d2b5=new Buffer(_0x5c248e);var _0xe99c7e=fs['createReadStream'](_0x4f5ee0);var _0xc1d8fd=fs[_0xc276('0xd')](_0x14a90c);var _0x16796a=crypto[_0xc276('0xe')](_0x1600e5['algorithm'],_0x12d2b5);_0xe99c7e['on']('data',function(_0x351520){var _0x26a2d3=new Buffer(_0x16796a['update'](_0x351520),_0xc276('0xf'));_0xc1d8fd[_0xc276('0x10')](_0x26a2d3);});_0xe99c7e['on'](_0xc276('0x11'),function(){try{var _0x199dff=new Buffer(_0x16796a[_0xc276('0x12')](_0xc276('0xf')),_0xc276('0xf'));_0xc1d8fd['write'](_0x199dff);_0xc1d8fd['end']();_0xc1d8fd['on'](_0xc276('0x13'),function(){return _0x311131(_0x14a90c);});}catch(_0x150d05){fs[_0xc276('0x14')](_0x14a90c);return _0x236fdd(_0x150d05);}});});};exports[_0xc276('0x15')]=function(_0x3d3eeb,_0x1bef59,_0x5e5114,_0x2ba16f){return new BPromise(function(_0xd8d4ad,_0x9e9afa){_0x2ba16f=combineOptions(_0x2ba16f);var _0x45c4a4=new Buffer(_0x5e5114);var _0x3ba3bc=fs[_0xc276('0x16')](_0x3d3eeb);var _0x547071=fs[_0xc276('0xd')](_0x1bef59);var _0x3aa312=crypto[_0xc276('0x17')](_0x2ba16f['algorithm'],_0x45c4a4);_0x3ba3bc['on'](_0xc276('0x18'),function(_0x1f156e){var _0x106aef=new Buffer(_0x3aa312[_0xc276('0x19')](_0x1f156e),'binary');_0x547071[_0xc276('0x10')](_0x106aef);});_0x3ba3bc['on'](_0xc276('0x11'),function(){try{var _0x394dbc=new Buffer(_0x3aa312[_0xc276('0x12')](_0xc276('0xf')),_0xc276('0xf'));_0x547071[_0xc276('0x10')](_0x394dbc);_0x547071[_0xc276('0x11')]();_0x547071['on'](_0xc276('0x13'),function(){return _0xd8d4ad(_0x1bef59);});}catch(_0x5412c8){fs['unlink'](_0x1bef59);return _0x9e9afa(_0x5412c8);}});});};exports[_0xc276('0x1a')]=function(_0xccae4a,_0x59b144,_0x2329d5){var _0x4afa4e=_0x2329d5||stringOptions['algorithm'];var _0x2215d1=_0x59b144||stringOptions[_0xc276('0x1b')];var _0x57470e=crypto['createCipher'](_0x4afa4e,_0x2215d1);var _0x11d5d0=_0x57470e['update'](_0xccae4a,_0xc276('0x1c'),_0xc276('0x1d'));_0x11d5d0+=_0x57470e[_0xc276('0x12')]('base64');return _0x11d5d0;};exports[_0xc276('0x1e')]=function(_0x2aea44,_0x5e86b7,_0x516ade){var _0x38c915=_0x516ade||stringOptions[_0xc276('0x7')];var _0xff2235=_0x5e86b7||stringOptions['secret'];var _0x15d502=crypto[_0xc276('0x17')](_0x38c915,_0xff2235);var _0x10f8a7=_0x15d502[_0xc276('0x19')](_0x2aea44,_0xc276('0x1d'),_0xc276('0x1c'));_0x10f8a7+=_0x15d502[_0xc276('0x12')](_0xc276('0x1c'));return _0x10f8a7;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 057793e..d159081 100644 --- a/server/components/export/csv.js +++ b/server/components/export/csv.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ac0=['Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','path','lodash','to-csv','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','length','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','.csv','existsSync','mkdirSync','join','%s%d.%s','csv','writeFileSync','%s.%s','zip','zip\x20finished','catch'];(function(_0x48b981,_0x40da15){var _0x1e386f=function(_0x517755){while(--_0x517755){_0x48b981['push'](_0x48b981['shift']());}};_0x1e386f(++_0x40da15);}(_0x4ac0,0x119));var _0x04ac=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x4ac0[_0x311c35];return _0x5cc50c;};'use strict';var util=require('util');var path=require(_0x04ac('0x0'));var _=require(_0x04ac('0x1'));var csv=require(_0x04ac('0x2'));var fs=require('fs');var BPromise=require(_0x04ac('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x04ac('0x4'))['db'];var dbH=require(_0x04ac('0x4'))[_0x04ac('0x5')];var logger=require(_0x04ac('0x6'))(_0x04ac('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x04ac('0x8')][0x2]);var QUERY=process[_0x04ac('0x8')][0x3];var PATH=process[_0x04ac('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x53d0b0,_0x3ad0e8){var _0x2719e2={'status':_0x53d0b0};var _0x486511={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3ad0e8){_0x2719e2[_0x04ac('0x9')]=_0x3ad0e8;}return db[_0x04ac('0xa')][_0x04ac('0xb')](_0x2719e2,_0x486511);}function main(){var _0x499df2=0x1388;var _0x53bc8e;logger[_0x04ac('0xc')](util[_0x04ac('0xd')](_0x04ac('0xe'),EXTRACTED_REPORT_ID,_0x04ac('0xf')));return db[_0x04ac('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x04ac('0x11'),_0x04ac('0x12')]})[_0x04ac('0x13')](function(_0x41e214){if(_0x41e214){_0x53bc8e=_0x41e214;_0x499df2=_0x53bc8e['splitSizeCsv']||0x1388;}})[_0x04ac('0x13')](function(){return dbH['sequelize'][_0x04ac('0x14')](util[_0x04ac('0xd')](_0x04ac('0x15'),QUERY),{'type':dbH[_0x04ac('0x16')][_0x04ac('0x17')][_0x04ac('0x18')]});})[_0x04ac('0x13')](function(_0x3dae41){if(!_0x3dae41[0x0][_0x04ac('0x19')]){return analyticExtractedReport('Empty');}var _0x27e4c9=[];var _0x3cace6=0x0;if(_0x53bc8e['split']){if(_0x3dae41&&_0x3dae41[_0x04ac('0x1a')]){var _0x47ded8=_['range'](_0x3dae41[0x0][_0x04ac('0x19')]/_0x499df2);var _0x548d94=Number[_0x04ac('0x1b')](_0x3dae41[0x0][_0x04ac('0x19')]/_0x499df2)?_0x3dae41[0x0][_0x04ac('0x19')]%_0x499df2:0x0;_0x47ded8['forEach'](function(_0x225207){if(_0x225207>0x0){_0x3cace6+=_0x499df2;}_0x27e4c9[_0x04ac('0x1c')](dbH['sequelize'][_0x04ac('0x14')](util[_0x04ac('0xd')](_0x04ac('0x1d'),QUERY,_0x499df2,_0x3cace6),{'type':dbH[_0x04ac('0x16')]['QueryTypes'][_0x04ac('0x18')]}));});if(_0x548d94>0x0){_0x3cace6+=_0x499df2;_0x27e4c9['push'](dbH['sequelize'][_0x04ac('0x14')](util[_0x04ac('0xd')](_0x04ac('0x1d'),QUERY,_0x548d94,_0x3cace6),{'type':dbH[_0x04ac('0x16')][_0x04ac('0x17')]['SELECT']}));}}}else{_0x27e4c9[_0x04ac('0x1c')](dbH[_0x04ac('0x16')][_0x04ac('0x14')](QUERY,{'type':dbH[_0x04ac('0x16')][_0x04ac('0x17')][_0x04ac('0x18')]}));}var _0x14d9b3=path['dirname'](PATH);var _0x5c9698=path['basename'](PATH,_0x04ac('0x1e'));var _0x2f4731=_0x53bc8e[_0x04ac('0x11')]&&_0x27e4c9[_0x04ac('0x1a')]>0x1;var _0x3dd87c=[];if(!fs[_0x04ac('0x1f')](path['join'](_0x14d9b3,_0x5c9698))&&_0x2f4731){fs[_0x04ac('0x20')](path[_0x04ac('0x21')](_0x14d9b3,_0x5c9698));}return BPromise['each'](_0x27e4c9,function(_0x103c0c){_0x3dd87c[_0x04ac('0x1c')](_0x103c0c);})['then'](function(){for(var _0x3bc710=0x0;_0x3bc710<_0x3dd87c[_0x04ac('0x1a')];_0x3bc710+=0x1){var _0xa457ab;var _0x12cedb=_0x3dd87c[_0x3bc710];if(_0x2f4731){_0xa457ab=path['join'](_0x14d9b3,_0x5c9698,util['format'](_0x04ac('0x22'),_0x5c9698,_0x3bc710,_0x04ac('0x23')));}else{_0xa457ab=path[_0x04ac('0x21')](_0x14d9b3,util['format']('%s.%s',_0x5c9698,_0x04ac('0x23')));}fs[_0x04ac('0x24')](_0xa457ab,csv(_0x12cedb));}})[_0x04ac('0x13')](function(){if(_0x2f4731){return new Promise(function(_0x20cd25){zipdir(path['join'](_0x14d9b3,_0x5c9698),{'saveTo':path[_0x04ac('0x21')](_0x14d9b3,util[_0x04ac('0xd')](_0x04ac('0x25'),_0x5c9698,_0x04ac('0x26')))},function(_0x1dbfe8,_0x40731c){rimraf(path['join'](_0x14d9b3,_0x5c9698),function(){});_0x20cd25(_0x04ac('0x27'));});});}})[_0x04ac('0x13')](function(){logger[_0x04ac('0xc')](util[_0x04ac('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x2f4731?util[_0x04ac('0xd')](_0x04ac('0x25'),_0x5c9698,_0x2f4731?'zip':_0x04ac('0x23')):null);});})[_0x04ac('0x28')](function(_0x4f1651){logger[_0x04ac('0xc')](util[_0x04ac('0xd')](_0x04ac('0x29'),EXTRACTED_REPORT_ID,'CSV'),util[_0x04ac('0x2a')](_0x4f1651,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x04ac('0x2b'));})[_0x04ac('0x2c')](function(){process[_0x04ac('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x66c6=['lodash','to-csv','zip-dir','rimraf','dbH','analytics','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','num','Empty','length','range','isInteger','forEach','QueryTypes','SELECT','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','existsSync','mkdirSync','join','each','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path'];(function(_0x301827,_0x2b9bd5){var _0x4e9c55=function(_0x3c232a){while(--_0x3c232a){_0x301827['push'](_0x301827['shift']());}};_0x4e9c55(++_0x2b9bd5);}(_0x66c6,0xf8));var _0x666c=function(_0xfefdd1,_0x24c906){_0xfefdd1=_0xfefdd1-0x0;var _0x14b117=_0x66c6[_0xfefdd1];return _0x14b117;};'use strict';var util=require(_0x666c('0x0'));var path=require(_0x666c('0x1'));var _=require(_0x666c('0x2'));var csv=require(_0x666c('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x666c('0x4'));var rimraf=require(_0x666c('0x5'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x666c('0x6')];var logger=require('../../config/logger')(_0x666c('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x666c('0x8')][0x2]);var QUERY=process[_0x666c('0x8')][0x3];var PATH=process[_0x666c('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1d6324,_0x1c36d0){var _0x5b2c55={'status':_0x1d6324};var _0x51ee1f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1c36d0){_0x5b2c55['savename']=_0x1c36d0;}return db['AnalyticExtractedReport'][_0x666c('0x9')](_0x5b2c55,_0x51ee1f);}function main(){var _0x47a187=0x1388;var _0x311768;logger[_0x666c('0xa')](util[_0x666c('0xb')](_0x666c('0xc'),EXTRACTED_REPORT_ID,_0x666c('0xd')));return db[_0x666c('0xe')][_0x666c('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x666c('0x10'),_0x666c('0x11')]})[_0x666c('0x12')](function(_0x49ac22){if(_0x49ac22){_0x311768=_0x49ac22;_0x47a187=_0x311768[_0x666c('0x11')]||0x1388;}})[_0x666c('0x12')](function(){return dbH['sequelize'][_0x666c('0x13')](util['format'](_0x666c('0x14'),QUERY),{'type':dbH[_0x666c('0x15')]['QueryTypes']['SELECT']});})[_0x666c('0x12')](function(_0x314552){if(!_0x314552[0x0][_0x666c('0x16')]){return analyticExtractedReport(_0x666c('0x17'));}var _0x1836cd=[];var _0x1c7726=0x0;if(_0x311768[_0x666c('0x10')]){if(_0x314552&&_0x314552[_0x666c('0x18')]){var _0x5a078f=_[_0x666c('0x19')](_0x314552[0x0]['num']/_0x47a187);var _0x5b36ca=Number[_0x666c('0x1a')](_0x314552[0x0][_0x666c('0x16')]/_0x47a187)?_0x314552[0x0][_0x666c('0x16')]%_0x47a187:0x0;_0x5a078f[_0x666c('0x1b')](function(_0x1ea7df){if(_0x1ea7df>0x0){_0x1c7726+=_0x47a187;}_0x1836cd['push'](dbH[_0x666c('0x15')][_0x666c('0x13')](util[_0x666c('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x47a187,_0x1c7726),{'type':dbH[_0x666c('0x15')][_0x666c('0x1c')][_0x666c('0x1d')]}));});if(_0x5b36ca>0x0){_0x1c7726+=_0x47a187;_0x1836cd[_0x666c('0x1e')](dbH[_0x666c('0x15')]['query'](util['format'](_0x666c('0x1f'),QUERY,_0x5b36ca,_0x1c7726),{'type':dbH[_0x666c('0x15')][_0x666c('0x1c')]['SELECT']}));}}}else{_0x1836cd[_0x666c('0x1e')](dbH[_0x666c('0x15')]['query'](QUERY,{'type':dbH[_0x666c('0x15')][_0x666c('0x1c')]['SELECT']}));}var _0x30e9cb=path['dirname'](PATH);var _0x4a16f3=path[_0x666c('0x20')](PATH,_0x666c('0x21'));var _0x3fc0c7=_0x311768[_0x666c('0x10')]&&_0x1836cd[_0x666c('0x18')]>0x1;var _0x184b89=[];if(!fs[_0x666c('0x22')](path['join'](_0x30e9cb,_0x4a16f3))&&_0x3fc0c7){fs[_0x666c('0x23')](path[_0x666c('0x24')](_0x30e9cb,_0x4a16f3));}return BPromise[_0x666c('0x25')](_0x1836cd,function(_0x386802){_0x184b89['push'](_0x386802);})[_0x666c('0x12')](function(){for(var _0x117c07=0x0;_0x117c07<_0x184b89[_0x666c('0x18')];_0x117c07+=0x1){var _0x27b98a;var _0x2bfc1b=_0x184b89[_0x117c07];if(_0x3fc0c7){_0x27b98a=path[_0x666c('0x24')](_0x30e9cb,_0x4a16f3,util[_0x666c('0xb')]('%s%d.%s',_0x4a16f3,_0x117c07,_0x666c('0x26')));}else{_0x27b98a=path['join'](_0x30e9cb,util['format'](_0x666c('0x27'),_0x4a16f3,_0x666c('0x26')));}fs[_0x666c('0x28')](_0x27b98a,csv(_0x2bfc1b));}})['then'](function(){if(_0x3fc0c7){return new Promise(function(_0x26e299){zipdir(path[_0x666c('0x24')](_0x30e9cb,_0x4a16f3),{'saveTo':path[_0x666c('0x24')](_0x30e9cb,util[_0x666c('0xb')]('%s.%s',_0x4a16f3,_0x666c('0x29')))},function(_0x181e77,_0x2342dc){rimraf(path['join'](_0x30e9cb,_0x4a16f3),function(){});_0x26e299(_0x666c('0x2a'));});});}})[_0x666c('0x12')](function(){logger[_0x666c('0xa')](util[_0x666c('0xb')](_0x666c('0x2b'),EXTRACTED_REPORT_ID,_0x666c('0xd')));return analyticExtractedReport(_0x666c('0x2c'),_0x3fc0c7?util[_0x666c('0xb')](_0x666c('0x27'),_0x4a16f3,_0x3fc0c7?'zip':_0x666c('0x26')):null);});})[_0x666c('0x2d')](function(_0x3c5979){logger[_0x666c('0xa')](util[_0x666c('0xb')](_0x666c('0x2e'),EXTRACTED_REPORT_ID,_0x666c('0xd')),util['inspect'](_0x3c5979,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x666c('0x2f'));})[_0x666c('0x30')](function(){process[_0x666c('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 0c2d581..e4dee35 100644 --- a/server/components/export/pdf.js +++ b/server/components/export/pdf.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15e6=['findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','finish','error','end','createPdfKitDocument','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','bluebird','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','toString','fill','length','auto','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','header','pageBreak','before','landscape','\x20/\x20','footer','Arial','right','num','Empty','Setting','find','split','splitSizePdf','then','range','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','query','QueryTypes','dirname','join','mkdirSync','each','flatten','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport'];(function(_0x11e8a1,_0x2b33bb){var _0x46ff78=function(_0x4a3dcb){while(--_0x4a3dcb){_0x11e8a1['push'](_0x11e8a1['shift']());}};_0x46ff78(++_0x2b33bb);}(_0x15e6,0x1d2));var _0x615e=function(_0x11c3a7,_0x4fc46b){_0x11c3a7=_0x11c3a7-0x0;var _0x249aa0=_0x15e6[_0x11c3a7];return _0x249aa0;};'use strict';var _=require(_0x615e('0x0'));var fs=require('fs');var util=require(_0x615e('0x1'));var path=require(_0x615e('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x615e('0x3'));var PdfPrinter=require(_0x615e('0x4'));var zipdir=require(_0x615e('0x5'));var rimraf=require('rimraf');var JSDOM=require(_0x615e('0x6'))[_0x615e('0x7')];var window=new JSDOM('')['window'];var BPromise=require(_0x615e('0x8'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x615e('0x9')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x615e('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x615e('0xa')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x615e('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x12d6f4,_0x222463){var _0x58aa7b={'status':_0x12d6f4};var _0x112613={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x222463){_0x58aa7b[_0x615e('0xc')]=_0x222463;}return db['AnalyticExtractedReport'][_0x615e('0xd')](_0x58aa7b,_0x112613);}function getHeaders(_0x2434b5){return _[_0x615e('0xe')](_0x2434b5,function(_0x482576){return{'text':_0x482576,'style':_0x615e('0xf')};});}function getRows(_0x6e52f1,_0x4eee5d){return _[_0x615e('0xe')](_0x4eee5d,function(_0x1c6f21){return _(_0x1c6f21)['pick'](_0x6e52f1)[_0x615e('0xe')](function(_0x3faad2){return _0x3faad2?_[_0x615e('0x10')](_0x3faad2):'';})['value']();});}function createTable(_0x29159f,_0x2e6107){var _0x37f884={'widths':_[_0x615e('0x11')](Array(_0x29159f[_0x615e('0x12')]),0x91),'heights':function(_0x521fbd){return _0x521fbd===0x0?_0x615e('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x109f3e=getHeaders(_0x29159f);_0x37f884[_0x615e('0x14')][_0x615e('0x15')](_0x109f3e);var _0x3fe41d=getRows(_0x29159f,_0x2e6107);_0x37f884[_0x615e('0x14')]=_0x37f884[_0x615e('0x14')][_0x615e('0x16')](_0x3fe41d);return _0x37f884;}function createTables(_0x81446d){var _0x4e91cb=[];var _0x3173b5=_[_0x615e('0x17')](Object[_0x615e('0x18')](_0x81446d[0x0]),0x5);_0x3173b5[_0x615e('0x19')](function(_0x506224){_0x4e91cb[_0x615e('0x15')](createTable(_0x506224,_0x81446d));});return _0x4e91cb;}function getPDFDocDefinition(_0xc6d089){var _0x2a7a90=util[_0x615e('0x1a')](_0x615e('0x1b'),NAME,EXTRACTED_REPORT[_0x615e('0x1c')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x615e('0x1d')])[_0x615e('0x1a')](FORMAT));var _0x1d9cf0=[];for(var _0x552b38=0x0;_0x552b38<_0xc6d089[_0x615e('0x12')];_0x552b38++){var _0x250b97=[];if(_0x552b38===0x0){_0x250b97['push']({'text':_0x2a7a90,'style':_0x615e('0x1e')});}var _0x42fecb={'table':_0xc6d089[_0x552b38]};if(_0x552b38>0x0){_0x42fecb[_0x615e('0x1f')]=_0x615e('0x20');_0x42fecb['margin']=[0x0,0x46,0x0,0x0];}_0x250b97['push'](_0x42fecb);_0x1d9cf0[_0x615e('0x15')](_0x250b97);}return{'pageSize':'A4','pageOrientation':_0x615e('0x21'),'content':_0x1d9cf0,'footer':function(_0x44fb07,_0x351792){return{'text':_0x44fb07[_0x615e('0x10')]()+_0x615e('0x22')+_0x351792,'style':_0x615e('0x23')};},'defaultStyle':{'font':_0x615e('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x615e('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x79acd5){var _0x579a26=0x1388;var _0x50df3f;if(!_0x79acd5[0x0][_0x615e('0x26')]){return analyticExtractedReport(_0x615e('0x27'));}return db[_0x615e('0x28')][_0x615e('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x615e('0x2a'),_0x615e('0x2b')]})['then'](function(_0x43d3c3){if(_0x43d3c3){_0x50df3f=_0x43d3c3;_0x579a26=_0x50df3f[_0x615e('0x2b')]||0x3e8;}})[_0x615e('0x2c')](function(){var _0x2169ad=[];var _0x46461c=0x0;if(_0x50df3f[_0x615e('0x2a')]){if(_0x79acd5&&_0x79acd5[_0x615e('0x12')]){var _0x39a907=_[_0x615e('0x2d')](_0x79acd5[0x0][_0x615e('0x26')]/_0x579a26);var _0x5e68ff=Number['isInteger'](_0x79acd5[0x0][_0x615e('0x26')]/_0x579a26)?_0x79acd5[0x0]['num']%_0x579a26:0x0;_0x39a907['forEach'](function(_0x5b6f1e){if(_0x5b6f1e>0x0){_0x46461c+=_0x579a26;}_0x2169ad['push'](dbH[_0x615e('0x2e')]['query'](util['format'](_0x615e('0x2f'),QUERY,_0x579a26,_0x46461c),{'type':dbH[_0x615e('0x2e')]['QueryTypes'][_0x615e('0x30')]}));});if(_0x5e68ff>0x0){_0x46461c+=_0x579a26;_0x2169ad[_0x615e('0x15')](dbH['sequelize'][_0x615e('0x31')](util[_0x615e('0x1a')](_0x615e('0x2f'),QUERY,_0x5e68ff,_0x46461c),{'type':dbH[_0x615e('0x2e')][_0x615e('0x32')]['SELECT']}));}}}else{_0x2169ad[_0x615e('0x15')](dbH[_0x615e('0x2e')][_0x615e('0x31')](QUERY,{'type':dbH[_0x615e('0x2e')][_0x615e('0x32')][_0x615e('0x30')]}));}var _0x441e6c=path[_0x615e('0x33')](PATH);var _0x3314e1=path['basename'](PATH,'.pdf');var _0x300daf=_0x50df3f[_0x615e('0x2a')]&&_0x2169ad[_0x615e('0x12')]>0x1;var _0x5c6d0c=[];if(!fs['existsSync'](path[_0x615e('0x34')](_0x441e6c,_0x3314e1))&&_0x300daf){fs[_0x615e('0x35')](path['join'](_0x441e6c,_0x3314e1));}return BPromise[_0x615e('0x36')](_0x2169ad,function(_0xf59f09){_0x5c6d0c['push'](_0xf59f09);})['then'](function(){var _0xbc04bc=[];for(var _0x1749cb=0x0;_0x1749cb<_0x5c6d0c[_0x615e('0x12')];_0x1749cb+=0x1){var _0xb5d206=_0x5c6d0c[_0x1749cb];var _0x258e05=createTables(_[_0x615e('0x37')](_0xb5d206));var _0x111a65;var _0x57030c=getPDFDocDefinition(_0x258e05);var _0x3fce91=getPDFPrinter();var _0x113a1a=_0x3fce91['createPdfKitDocument'](_0x57030c);if(_0x300daf){_0x111a65=path[_0x615e('0x34')](_0x441e6c,_0x3314e1,util[_0x615e('0x1a')](_0x615e('0x38'),_0x3314e1,_0x1749cb,_0x615e('0x39')));}else{_0x111a65=path[_0x615e('0x34')](_0x441e6c,util['format'](_0x615e('0x3a'),_0x3314e1,_0x615e('0x39')));}_0xbc04bc['push'](writePDFDocument(_0x113a1a,_0x111a65));}return Promise[_0x615e('0x3b')](_0xbc04bc);})['then'](function(){if(_0x300daf){return new Promise(function(_0x14b811){zipdir(path[_0x615e('0x34')](_0x441e6c,_0x3314e1),{'saveTo':path[_0x615e('0x34')](_0x441e6c,util['format']('%s.%s',_0x3314e1,_0x615e('0x3c')))},function(){rimraf(path[_0x615e('0x34')](_0x441e6c,_0x3314e1),function(){});_0x14b811(_0x615e('0x3d'));});});}})[_0x615e('0x2c')](function(){if(!_0x300daf)return;rimraf(path[_0x615e('0x34')](_0x441e6c,_0x3314e1),function(){});})['then'](function(){logger[_0x615e('0x3e')](util[_0x615e('0x1a')](_0x615e('0x3f'),EXTRACTED_REPORT_ID,_0x615e('0x40')));return analyticExtractedReport(_0x615e('0x41'),_0x300daf?util['format'](_0x615e('0x3a'),_0x3314e1,_0x300daf?_0x615e('0x3c'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x615e('0x1a')](_0x615e('0x42'),EXTRACTED_REPORT_ID,_0x615e('0x40')));return db[_0x615e('0x43')][_0x615e('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x2956f5){EXTRACTED_REPORT=_0x2956f5;return dbH[_0x615e('0x2e')][_0x615e('0x31')](util[_0x615e('0x1a')](_0x615e('0x45'),QUERY),{'type':dbH[_0x615e('0x2e')]['QueryTypes'][_0x615e('0x30')]});})[_0x615e('0x2c')](extractReport)[_0x615e('0x46')](function(_0x1c867e){logger['info'](util[_0x615e('0x1a')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x615e('0x40')),util[_0x615e('0x47')](_0x1c867e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x615e('0x48'));})[_0x615e('0x49')](function(){process[_0x615e('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2f594a=new PdfPrinter({'Arial':{'normal':__dirname+_0x615e('0x4b'),'bold':__dirname+_0x615e('0x4c'),'italics':__dirname+_0x615e('0x4d'),'bolditalics':__dirname+_0x615e('0x4e')}});return _0x2f594a;}function getPDFDocDefinitionFromHTML(_0xfebe78,_0x51842e){var _0x348513=util[_0x615e('0x1a')](_0x615e('0x4f'),_0x51842e[_0x615e('0x50')],_0x51842e[_0x615e('0x51')]);var _0x4b1ba8=moment()[_0x615e('0x1a')](_0x615e('0x52'))[_0x615e('0x10')]();var _0x573036=htmlToPdfmake(_0xfebe78,{'window':window,'tableAutoSize':!![]});return{'content':[_0x573036],'defaultStyle':{'font':_0x615e('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x615e('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x615e('0x53')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x615e('0x1e')}];},'footer':function(_0x35eba7,_0x52e5a6){return[{'text':util[_0x615e('0x1a')](_0x615e('0x54'),_0x348513,_0x35eba7,_0x52e5a6,_0x4b1ba8),'style':_0x615e('0x23')}];}};}function writePDFDocument(_0x9110fb,_0x4f50fb){return new Promise(function(_0x35a167,_0x56acd0){var _0xb9ca7f=_0x9110fb['pipe'](fs['createWriteStream'](_0x4f50fb));_0xb9ca7f['on'](_0x615e('0x55'),function(){_0x35a167(_0x615e('0x55'));});_0xb9ca7f['on'](_0x615e('0x56'),function(_0x22dcf5){_0x56acd0(_0x22dcf5);});_0x9110fb[_0x615e('0x57')]();});}exports['createPdfFromHTML']=function(_0x9ebf13,_0x213bee){var _0x5e914c=getPDFPrinter();var _0x2b5846=getPDFDocDefinitionFromHTML(_0x9ebf13,_0x213bee);var _0x59f8b2=_0x5e914c[_0x615e('0x58')](_0x2b5846);return writePDFDocument(_0x59f8b2,_0x213bee['path'])[_0x615e('0x46')](function(_0x342492){throw _0x342492;});}; \ No newline at end of file +var _0x266c=['end','createPdfFromHTML','path','lodash','util','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','map','tableHeader','pick','value','fill','length','auto','body','push','concat','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','format','header','pageBreak','before','landscape','footer','Arial','right','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','query','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','join','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','inspect','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','YYYY-MM-DD','toString','center','Interaction\x20Transcript','createWriteStream','finish'];(function(_0x421f8c,_0x361843){var _0x16e37a=function(_0xf75b64){while(--_0xf75b64){_0x421f8c['push'](_0x421f8c['shift']());}};_0x16e37a(++_0x361843);}(_0x266c,0x14b));var _0xc266=function(_0x5e5cc0,_0x47a0f9){_0x5e5cc0=_0x5e5cc0-0x0;var _0xdfbceb=_0x266c[_0x5e5cc0];return _0xdfbceb;};'use strict';var _=require(_0xc266('0x0'));var fs=require('fs');var util=require(_0xc266('0x1'));var path=require('path');var moment=require('moment');var htmlToPdfmake=require(_0xc266('0x2'));var PdfPrinter=require(_0xc266('0x3'));var zipdir=require(_0xc266('0x4'));var rimraf=require(_0xc266('0x5'));var JSDOM=require(_0xc266('0x6'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0xc266('0x7'));var db=require(_0xc266('0x8'))['db'];var dbH=require('../../mysqldb')[_0xc266('0x9')];var logger=require(_0xc266('0xa'))(_0xc266('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xc266('0xc')][0x3];var PATH=process[_0xc266('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xc266('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1e42eb,_0x16b07e){var _0x1c04b3={'status':_0x1e42eb};var _0x43fc13={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x16b07e){_0x1c04b3['savename']=_0x16b07e;}return db[_0xc266('0xe')]['update'](_0x1c04b3,_0x43fc13);}function getHeaders(_0xf2c57d){return _[_0xc266('0xf')](_0xf2c57d,function(_0x282528){return{'text':_0x282528,'style':_0xc266('0x10')};});}function getRows(_0x36842b,_0x4b7589){return _[_0xc266('0xf')](_0x4b7589,function(_0x53c492){return _(_0x53c492)[_0xc266('0x11')](_0x36842b)[_0xc266('0xf')](function(_0x4d08f4){return _0x4d08f4?_['toString'](_0x4d08f4):'';})[_0xc266('0x12')]();});}function createTable(_0x436c45,_0x4fad1f){var _0x1320d6={'widths':_[_0xc266('0x13')](Array(_0x436c45[_0xc266('0x14')]),0x91),'heights':function(_0x39e598){return _0x39e598===0x0?_0xc266('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x58055b=getHeaders(_0x436c45);_0x1320d6[_0xc266('0x16')][_0xc266('0x17')](_0x58055b);var _0x23af2b=getRows(_0x436c45,_0x4fad1f);_0x1320d6['body']=_0x1320d6[_0xc266('0x16')][_0xc266('0x18')](_0x23af2b);return _0x1320d6;}function createTables(_0x6a8aa5){var _0x2e1dfd=[];var _0x2ec389=_['chunk'](Object[_0xc266('0x19')](_0x6a8aa5[0x0]),0x5);_0x2ec389[_0xc266('0x1a')](function(_0x394ea8){_0x2e1dfd[_0xc266('0x17')](createTable(_0x394ea8,_0x6a8aa5));});return _0x2e1dfd;}function getPDFDocDefinition(_0x5cc66b){var _0x5b7eb1=util['format'](_0xc266('0x1b'),NAME,EXTRACTED_REPORT[_0xc266('0x1c')],moment(EXTRACTED_REPORT[_0xc266('0x1d')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xc266('0x1e')])[_0xc266('0x1f')](FORMAT));var _0x112014=[];for(var _0x1a7d45=0x0;_0x1a7d45<_0x5cc66b['length'];_0x1a7d45++){var _0x47ff81=[];if(_0x1a7d45===0x0){_0x47ff81[_0xc266('0x17')]({'text':_0x5b7eb1,'style':_0xc266('0x20')});}var _0x45efcc={'table':_0x5cc66b[_0x1a7d45]};if(_0x1a7d45>0x0){_0x45efcc[_0xc266('0x21')]=_0xc266('0x22');_0x45efcc['margin']=[0x0,0x46,0x0,0x0];}_0x47ff81[_0xc266('0x17')](_0x45efcc);_0x112014[_0xc266('0x17')](_0x47ff81);}return{'pageSize':'A4','pageOrientation':_0xc266('0x23'),'content':_0x112014,'footer':function(_0x880609,_0x54e999){return{'text':_0x880609['toString']()+'\x20/\x20'+_0x54e999,'style':_0xc266('0x24')};},'defaultStyle':{'font':_0xc266('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xc266('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3272d7){var _0x243aa0=0x1388;var _0x3df793;if(!_0x3272d7[0x0][_0xc266('0x27')]){return analyticExtractedReport(_0xc266('0x28'));}return db[_0xc266('0x29')][_0xc266('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc266('0x2b'),_0xc266('0x2c')]})['then'](function(_0x32ce8c){if(_0x32ce8c){_0x3df793=_0x32ce8c;_0x243aa0=_0x3df793[_0xc266('0x2c')]||0x3e8;}})[_0xc266('0x2d')](function(){var _0x21e069=[];var _0x5c76e1=0x0;if(_0x3df793[_0xc266('0x2b')]){if(_0x3272d7&&_0x3272d7['length']){var _0x49ffbb=_[_0xc266('0x2e')](_0x3272d7[0x0][_0xc266('0x27')]/_0x243aa0);var _0x5bb27e=Number[_0xc266('0x2f')](_0x3272d7[0x0]['num']/_0x243aa0)?_0x3272d7[0x0][_0xc266('0x27')]%_0x243aa0:0x0;_0x49ffbb[_0xc266('0x1a')](function(_0x5ce3fb){if(_0x5ce3fb>0x0){_0x5c76e1+=_0x243aa0;}_0x21e069['push'](dbH[_0xc266('0x30')][_0xc266('0x31')](util[_0xc266('0x1f')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x243aa0,_0x5c76e1),{'type':dbH[_0xc266('0x30')]['QueryTypes'][_0xc266('0x32')]}));});if(_0x5bb27e>0x0){_0x5c76e1+=_0x243aa0;_0x21e069[_0xc266('0x17')](dbH[_0xc266('0x30')][_0xc266('0x31')](util[_0xc266('0x1f')](_0xc266('0x33'),QUERY,_0x5bb27e,_0x5c76e1),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}}else{_0x21e069[_0xc266('0x17')](dbH['sequelize'][_0xc266('0x31')](QUERY,{'type':dbH[_0xc266('0x30')]['QueryTypes'][_0xc266('0x32')]}));}var _0x5baebb=path[_0xc266('0x34')](PATH);var _0xf686cd=path['basename'](PATH,'.pdf');var _0x5c37d6=_0x3df793[_0xc266('0x2b')]&&_0x21e069[_0xc266('0x14')]>0x1;var _0x3ce455=[];if(!fs['existsSync'](path['join'](_0x5baebb,_0xf686cd))&&_0x5c37d6){fs['mkdirSync'](path[_0xc266('0x35')](_0x5baebb,_0xf686cd));}return BPromise['each'](_0x21e069,function(_0x122d8b){_0x3ce455[_0xc266('0x17')](_0x122d8b);})[_0xc266('0x2d')](function(){var _0x4a1c12=[];for(var _0x41e3f9=0x0;_0x41e3f9<_0x3ce455[_0xc266('0x14')];_0x41e3f9+=0x1){var _0x2f6f27=_0x3ce455[_0x41e3f9];var _0x52a91b=createTables(_['flatten'](_0x2f6f27));var _0x578a87;var _0x544284=getPDFDocDefinition(_0x52a91b);var _0x16893a=getPDFPrinter();var _0x2f4992=_0x16893a[_0xc266('0x36')](_0x544284);if(_0x5c37d6){_0x578a87=path[_0xc266('0x35')](_0x5baebb,_0xf686cd,util[_0xc266('0x1f')](_0xc266('0x37'),_0xf686cd,_0x41e3f9,_0xc266('0x38')));}else{_0x578a87=path['join'](_0x5baebb,util[_0xc266('0x1f')]('%s.%s',_0xf686cd,_0xc266('0x38')));}_0x4a1c12['push'](writePDFDocument(_0x2f4992,_0x578a87));}return Promise[_0xc266('0x39')](_0x4a1c12);})[_0xc266('0x2d')](function(){if(_0x5c37d6){return new Promise(function(_0x41ce21){zipdir(path['join'](_0x5baebb,_0xf686cd),{'saveTo':path[_0xc266('0x35')](_0x5baebb,util[_0xc266('0x1f')](_0xc266('0x3a'),_0xf686cd,_0xc266('0x3b')))},function(){rimraf(path[_0xc266('0x35')](_0x5baebb,_0xf686cd),function(){});_0x41ce21('zip\x20finished');});});}})[_0xc266('0x2d')](function(){if(!_0x5c37d6)return;rimraf(path[_0xc266('0x35')](_0x5baebb,_0xf686cd),function(){});})[_0xc266('0x2d')](function(){logger[_0xc266('0x3c')](util['format'](_0xc266('0x3d'),EXTRACTED_REPORT_ID,_0xc266('0x3e')));return analyticExtractedReport(_0xc266('0x3f'),_0x5c37d6?util['format'](_0xc266('0x3a'),_0xf686cd,_0x5c37d6?_0xc266('0x3b'):_0xc266('0x38')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc266('0x3e')));return db[_0xc266('0xe')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xc266('0x2d')](function(_0x498496){EXTRACTED_REPORT=_0x498496;return dbH['sequelize']['query'](util[_0xc266('0x1f')](_0xc266('0x40'),QUERY),{'type':dbH[_0xc266('0x30')]['QueryTypes'][_0xc266('0x32')]});})[_0xc266('0x2d')](extractReport)['catch'](function(_0x752aa3){logger[_0xc266('0x3c')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'),util[_0xc266('0x41')](_0x752aa3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc266('0x42'));})[_0xc266('0x43')](function(){process[_0xc266('0x44')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x21db7b=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xc266('0x45'),'italics':__dirname+_0xc266('0x46'),'bolditalics':__dirname+_0xc266('0x47')}});return _0x21db7b;}function getPDFDocDefinitionFromHTML(_0x590a31,_0x115bc1){var _0x581fa3=util[_0xc266('0x1f')](_0xc266('0x48'),_0x115bc1['channel'],_0x115bc1['interactionId']);var _0x5eaead=moment()[_0xc266('0x1f')](_0xc266('0x49'))[_0xc266('0x4a')]();var _0xdb8128=htmlToPdfmake(_0x590a31,{'window':window,'tableAutoSize':!![]});return{'content':[_0xdb8128],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xc266('0x4b'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xc266('0x4b'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xc266('0x4c'),'style':_0xc266('0x20')}];},'footer':function(_0x14ddd3,_0x3fb4cd){return[{'text':util[_0xc266('0x1f')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x581fa3,_0x14ddd3,_0x3fb4cd,_0x5eaead),'style':'footer'}];}};}function writePDFDocument(_0x4c9420,_0x2780eb){return new Promise(function(_0x44ff09,_0x45f031){var _0x1337bd=_0x4c9420['pipe'](fs[_0xc266('0x4d')](_0x2780eb));_0x1337bd['on'](_0xc266('0x4e'),function(){_0x44ff09(_0xc266('0x4e'));});_0x1337bd['on']('error',function(_0x54fab1){_0x45f031(_0x54fab1);});_0x4c9420[_0xc266('0x4f')]();});}exports[_0xc266('0x50')]=function(_0x7b3d45,_0x474045){var _0x5bceff=getPDFPrinter();var _0xbb1702=getPDFDocDefinitionFromHTML(_0x7b3d45,_0x474045);var _0xe8d9cf=_0x5bceff[_0xc266('0x36')](_0xbb1702);return writePDFDocument(_0xe8d9cf,_0x474045[_0xc266('0x51')])['catch'](function(_0x4448a6){throw _0x4448a6;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 63d98ae..737adca 100644 --- a/server/components/export/xlsx.js +++ b/server/components/export/xlsx.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaef4=['catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','sequelize','push','basename','.xlsx','existsSync','mkdirSync','join','xlsx','%s.%s','binary','zip','zip\x20finished','Completed'];(function(_0x4a4d8f,_0x13aae4){var _0xf1b3d5=function(_0x1c705c){while(--_0x1c705c){_0x4a4d8f['push'](_0x4a4d8f['shift']());}};_0xf1b3d5(++_0x13aae4);}(_0xaef4,0xfb));var _0x4aef=function(_0x2ad4df,_0x5d12f0){_0x2ad4df=_0x2ad4df-0x0;var _0x4d91e9=_0xaef4[_0x2ad4df];return _0x4d91e9;};'use strict';var util=require(_0x4aef('0x0'));var path=require(_0x4aef('0x1'));var _=require(_0x4aef('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x4aef('0x3'));var zipdir=require(_0x4aef('0x4'));var rimraf=require(_0x4aef('0x5'));var db=require(_0x4aef('0x6'))['db'];var dbH=require('../../mysqldb')[_0x4aef('0x7')];var logger=require(_0x4aef('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x4aef('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x4aef('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x475917,_0x1e863a){var _0x2f594c={'status':_0x475917};var _0x1dee01={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1e863a){_0x2f594c[_0x4aef('0xa')]=_0x1e863a;}return db[_0x4aef('0xb')][_0x4aef('0xc')](_0x2f594c,_0x1dee01);}function main(){var _0x1f6b61=0x1388;var _0x3da5b8;logger[_0x4aef('0xd')](util[_0x4aef('0xe')](_0x4aef('0xf'),EXTRACTED_REPORT_ID,_0x4aef('0x10')));return db[_0x4aef('0x11')][_0x4aef('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4aef('0x13'),'splitSizeXlsx']})['then'](function(_0x34a796){if(_0x34a796){_0x3da5b8=_0x34a796;_0x1f6b61=_0x3da5b8[_0x4aef('0x14')]||0x1388;}})[_0x4aef('0x15')](function(){return dbH['sequelize'][_0x4aef('0x16')](util['format'](_0x4aef('0x17'),QUERY),{'type':dbH['sequelize'][_0x4aef('0x18')][_0x4aef('0x19')]});})[_0x4aef('0x15')](function(_0x246c2d){if(!_0x246c2d[0x0][_0x4aef('0x1a')]){return analyticExtractedReport(_0x4aef('0x1b'));}var _0x3ee38c=[];var _0x2a9a7f=0x0;if(_0x3da5b8[_0x4aef('0x13')]){if(_0x246c2d&&_0x246c2d[_0x4aef('0x1c')]){var _0x4b2afc=_[_0x4aef('0x1d')](_0x246c2d[0x0][_0x4aef('0x1a')]/_0x1f6b61);var _0x48d6bc=Number['isInteger'](_0x246c2d[0x0]['num']/_0x1f6b61)?_0x246c2d[0x0][_0x4aef('0x1a')]%_0x1f6b61:0x0;_0x4b2afc['forEach'](function(_0x57dc6e){if(_0x57dc6e>0x0){_0x2a9a7f+=_0x1f6b61;}_0x3ee38c['push'](dbH[_0x4aef('0x1e')][_0x4aef('0x16')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1f6b61,_0x2a9a7f),{'type':dbH['sequelize'][_0x4aef('0x18')]['SELECT']}));});if(_0x48d6bc>0x0){_0x2a9a7f+=_0x1f6b61;_0x3ee38c['push'](dbH[_0x4aef('0x1e')]['query'](util[_0x4aef('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x48d6bc,_0x2a9a7f),{'type':dbH['sequelize'][_0x4aef('0x18')][_0x4aef('0x19')]}));}}}else{_0x3ee38c[_0x4aef('0x1f')](dbH[_0x4aef('0x1e')]['query'](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x4aef('0x19')]}));}var _0x3d7f7f=path['dirname'](PATH);var _0x3e7842=path[_0x4aef('0x20')](PATH,_0x4aef('0x21'));var _0x474122=_0x3da5b8[_0x4aef('0x13')]&&_0x3ee38c['length']>0x1;var _0x5f3960=[];if(!fs[_0x4aef('0x22')](path['join'](_0x3d7f7f,_0x3e7842))&&_0x474122){fs[_0x4aef('0x23')](path[_0x4aef('0x24')](_0x3d7f7f,_0x3e7842));}return BPromise['each'](_0x3ee38c,function(_0x5b16b8){_0x5f3960[_0x4aef('0x1f')](_0x5b16b8);})[_0x4aef('0x15')](function(){for(var _0x3b959c=0x0;_0x3b959c<_0x5f3960['length'];_0x3b959c+=0x1){var _0x35b29e;var _0x39501c=_0x5f3960[_0x3b959c];if(_0x474122){_0x35b29e=path['join'](_0x3d7f7f,_0x3e7842,util[_0x4aef('0xe')]('%s%d.%s',_0x3e7842,_0x3b959c,_0x4aef('0x25')));}else{_0x35b29e=path[_0x4aef('0x24')](_0x3d7f7f,util['format'](_0x4aef('0x26'),_0x3e7842,_0x4aef('0x25')));}fs['writeFileSync'](_0x35b29e,json2xls(_0x39501c),_0x4aef('0x27'));}})[_0x4aef('0x15')](function(){if(_0x474122){return new Promise(function(_0x437e8f){zipdir(path[_0x4aef('0x24')](_0x3d7f7f,_0x3e7842),{'saveTo':path[_0x4aef('0x24')](_0x3d7f7f,util[_0x4aef('0xe')](_0x4aef('0x26'),_0x3e7842,_0x4aef('0x28')))},function(_0x1dc2c9,_0x9620d1){rimraf(path[_0x4aef('0x24')](_0x3d7f7f,_0x3e7842),function(){});_0x437e8f(_0x4aef('0x29'));});});}})['then'](function(){logger['info'](util[_0x4aef('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x4aef('0x10')));return analyticExtractedReport(_0x4aef('0x2a'),_0x474122?util[_0x4aef('0xe')](_0x4aef('0x26'),_0x3e7842,_0x474122?_0x4aef('0x28'):'xlsx'):null);});})[_0x4aef('0x2b')](function(_0x4b1a5e){logger[_0x4aef('0xd')](util[_0x4aef('0xe')](_0x4aef('0x2c'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x4aef('0x2d')](_0x4b1a5e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4aef('0x2e'));})[_0x4aef('0x2f')](function(){process[_0x4aef('0x30')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x23d2=['Failed','exit','util','path','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','XLSX','Setting','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','range','isInteger','push','QueryTypes','dirname','basename','.xlsx','length','mkdirSync','join','each','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x23d2,0x18a));var _0x223d=function(_0x2053c9,_0x185255){_0x2053c9=_0x2053c9-0x0;var _0x44de59=_0x23d2[_0x2053c9];return _0x44de59;};'use strict';var util=require(_0x223d('0x0'));var path=require(_0x223d('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x223d('0x2'));var BPromise=require(_0x223d('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x223d('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x223d('0x5'))[_0x223d('0x6')];var logger=require(_0x223d('0x7'))(_0x223d('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x223d('0x9')][0x2]);var QUERY=process[_0x223d('0x9')][0x3];var PATH=process[_0x223d('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x39e57a,_0x3a8634){var _0x5d7a05={'status':_0x39e57a};var _0x2d64d8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3a8634){_0x5d7a05['savename']=_0x3a8634;}return db[_0x223d('0xa')][_0x223d('0xb')](_0x5d7a05,_0x2d64d8);}function main(){var _0x2bf9bb=0x1388;var _0x5bd883;logger[_0x223d('0xc')](util[_0x223d('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x223d('0xe')));return db[_0x223d('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x223d('0x10'),_0x223d('0x11')]})[_0x223d('0x12')](function(_0x478263){if(_0x478263){_0x5bd883=_0x478263;_0x2bf9bb=_0x5bd883[_0x223d('0x11')]||0x1388;}})[_0x223d('0x12')](function(){return dbH[_0x223d('0x13')][_0x223d('0x14')](util[_0x223d('0xd')](_0x223d('0x15'),QUERY),{'type':dbH[_0x223d('0x13')]['QueryTypes'][_0x223d('0x16')]});})[_0x223d('0x12')](function(_0x2d61cc){if(!_0x2d61cc[0x0][_0x223d('0x17')]){return analyticExtractedReport(_0x223d('0x18'));}var _0x5a8532=[];var _0x39e3fc=0x0;if(_0x5bd883[_0x223d('0x10')]){if(_0x2d61cc&&_0x2d61cc['length']){var _0x527918=_[_0x223d('0x19')](_0x2d61cc[0x0]['num']/_0x2bf9bb);var _0xe534b8=Number[_0x223d('0x1a')](_0x2d61cc[0x0]['num']/_0x2bf9bb)?_0x2d61cc[0x0][_0x223d('0x17')]%_0x2bf9bb:0x0;_0x527918['forEach'](function(_0x4fbdb5){if(_0x4fbdb5>0x0){_0x39e3fc+=_0x2bf9bb;}_0x5a8532['push'](dbH[_0x223d('0x13')][_0x223d('0x14')](util[_0x223d('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2bf9bb,_0x39e3fc),{'type':dbH[_0x223d('0x13')]['QueryTypes'][_0x223d('0x16')]}));});if(_0xe534b8>0x0){_0x39e3fc+=_0x2bf9bb;_0x5a8532[_0x223d('0x1b')](dbH[_0x223d('0x13')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xe534b8,_0x39e3fc),{'type':dbH[_0x223d('0x13')]['QueryTypes'][_0x223d('0x16')]}));}}}else{_0x5a8532[_0x223d('0x1b')](dbH[_0x223d('0x13')][_0x223d('0x14')](QUERY,{'type':dbH[_0x223d('0x13')][_0x223d('0x1c')]['SELECT']}));}var _0x2c1b37=path[_0x223d('0x1d')](PATH);var _0x2bf6b2=path[_0x223d('0x1e')](PATH,_0x223d('0x1f'));var _0x45cd14=_0x5bd883[_0x223d('0x10')]&&_0x5a8532[_0x223d('0x20')]>0x1;var _0x44b1fa=[];if(!fs['existsSync'](path['join'](_0x2c1b37,_0x2bf6b2))&&_0x45cd14){fs[_0x223d('0x21')](path[_0x223d('0x22')](_0x2c1b37,_0x2bf6b2));}return BPromise[_0x223d('0x23')](_0x5a8532,function(_0x11c65f){_0x44b1fa[_0x223d('0x1b')](_0x11c65f);})[_0x223d('0x12')](function(){for(var _0x1bd277=0x0;_0x1bd277<_0x44b1fa[_0x223d('0x20')];_0x1bd277+=0x1){var _0x30dfb6;var _0x5c05bc=_0x44b1fa[_0x1bd277];if(_0x45cd14){_0x30dfb6=path[_0x223d('0x22')](_0x2c1b37,_0x2bf6b2,util[_0x223d('0xd')]('%s%d.%s',_0x2bf6b2,_0x1bd277,_0x223d('0x24')));}else{_0x30dfb6=path[_0x223d('0x22')](_0x2c1b37,util['format'](_0x223d('0x25'),_0x2bf6b2,_0x223d('0x24')));}fs[_0x223d('0x26')](_0x30dfb6,json2xls(_0x5c05bc),_0x223d('0x27'));}})['then'](function(){if(_0x45cd14){return new Promise(function(_0x1a3be2){zipdir(path[_0x223d('0x22')](_0x2c1b37,_0x2bf6b2),{'saveTo':path[_0x223d('0x22')](_0x2c1b37,util[_0x223d('0xd')](_0x223d('0x25'),_0x2bf6b2,_0x223d('0x28')))},function(_0x4d3a7a,_0x4d08bb){rimraf(path[_0x223d('0x22')](_0x2c1b37,_0x2bf6b2),function(){});_0x1a3be2(_0x223d('0x29'));});});}})[_0x223d('0x12')](function(){logger['info'](util[_0x223d('0xd')](_0x223d('0x2a'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x223d('0x2b'),_0x45cd14?util['format'](_0x223d('0x25'),_0x2bf6b2,_0x45cd14?'zip':'xlsx'):null);});})[_0x223d('0x2c')](function(_0x149ede){logger['info'](util[_0x223d('0xd')](_0x223d('0x2d'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x223d('0x2e')](_0x149ede,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x223d('0x2f'));})['finally'](function(){process[_0x223d('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 288bb42..6e2d8fb 100644 --- a/server/components/extensions/rewrite.js +++ b/server/components/extensions/rewrite.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8c6=['inbound','CDR(routeid)=','VoiceExtensionId','CDR(destination)=','cutdigits','${EXTEN:','context','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','app','appType','custom','answer','ExecIf','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extensions','extension','push','type','Set','format','CDR(type)=%s'];(function(_0x837006,_0x326159){var _0x4cf513=function(_0x2ac68e){while(--_0x2ac68e){_0x837006['push'](_0x837006['shift']());}};_0x4cf513(++_0x326159);}(_0xb8c6,0x19d));var _0x6b8c=function(_0x1cfb6e,_0x33de88){_0x1cfb6e=_0x1cfb6e-0x0;var _0x12d65c=_0xb8c6[_0x1cfb6e];return _0x12d65c;};'use strict';var _=require(_0x6b8c('0x0'));var util=require(_0x6b8c('0x1'));function rewrite(_0x5c9ffb,_0x33cb9d){var _0x318325=this;return _0x5c9ffb[_0x6b8c('0x2')][_0x6b8c('0x3')][_0x6b8c('0x4')]({'raw':!![]})[_0x6b8c('0x5')](function(_0x328862){_0x318325[_0x6b8c('0x6')]=_0x328862;return _0x5c9ffb[_0x6b8c('0x2')][_0x6b8c('0x7')]['findAll']({'where':{'IntervalId':_0x33cb9d[_0x6b8c('0x8')]},'raw':!![]});})['then'](function(_0x455c15){return _0x5c9ffb[_0x6b8c('0x2')][_0x6b8c('0x7')]['findAll']({'where':{'exten':{'$in':_[_0x6b8c('0x9')](_[_0x6b8c('0xa')](_0x455c15,_0x6b8c('0xb')))}},'order':[{'raw':_0x6b8c('0xc')}],'raw':!![]});})[_0x6b8c('0x5')](function(_0x5d1dd7){var _0x25ff71=_[_0x6b8c('0xd')](_0x5d1dd7,{'priority':'1'});var _0x40f5a4=_[_0x6b8c('0xd')](_0x5d1dd7,{'isApp':0x1});var _0x174873=_[_0x6b8c('0xe')](_0x40f5a4,_0x6b8c('0xb'));var _0x8a9575=[_0x6b8c('0xf'),_0x6b8c('0x10')];var _0x55e744=[];var _0x3d2563=[];for(var _0x37e4eb in _0x174873){if(_0x174873['hasOwnProperty'](_0x37e4eb)){_0x318325[_0x6b8c('0x11')]=0x2;_0x318325[_0x6b8c('0x12')]=[];_0x318325[_0x6b8c('0x13')]=_['find'](_0x25ff71,{'exten':_0x174873[_0x37e4eb][0x0][_0x6b8c('0xb')]});_0x318325[_0x6b8c('0x12')][_0x6b8c('0x14')]({'type':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x15')],'app':_0x6b8c('0x16'),'appdata':util[_0x6b8c('0x17')](_0x6b8c('0x18'),_0x174873[_0x37e4eb][0x0][_0x6b8c('0x15')]),'context':_0x174873[_0x37e4eb][0x0]['context'],'exten':_0x174873[_0x37e4eb][0x0][_0x6b8c('0xb')],'priority':_0x318325[_0x6b8c('0x11')]++,'VoiceExtensionId':_0x174873[_0x37e4eb][0x0]['VoiceExtensionId']});if(_0x174873[_0x37e4eb][0x0][_0x6b8c('0x15')]===_0x6b8c('0x19')){_0x318325['extensions'][_0x6b8c('0x14')]({'type':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x15')],'app':_0x6b8c('0x16'),'appdata':_0x6b8c('0x1a')+_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1b')],'context':_0x174873[_0x37e4eb][0x0]['context'],'exten':_0x174873[_0x37e4eb][0x0][_0x6b8c('0xb')],'priority':_0x318325[_0x6b8c('0x11')]++,'VoiceExtensionId':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1b')]});}else if(_0x174873[_0x37e4eb][0x0][_0x6b8c('0x15')]==='outbound'){if(_0x318325[_0x6b8c('0x13')]){_0x318325[_0x6b8c('0x12')][_0x6b8c('0x14')]({'type':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x15')],'app':'Set','appdata':_0x6b8c('0x1c')+(_0x318325[_0x6b8c('0x13')][_0x6b8c('0x1d')]?_0x6b8c('0x1e')+_0x318325[_0x6b8c('0x13')]['cutdigits']+'}':'${EXTEN}'),'context':_0x174873[_0x37e4eb][0x0]['context'],'exten':_0x174873[_0x37e4eb][0x0][_0x6b8c('0xb')],'priority':_0x318325[_0x6b8c('0x11')]++,'VoiceExtensionId':_0x174873[_0x37e4eb][0x0]['VoiceExtensionId']});}_0x318325['extensions'][_0x6b8c('0x14')]({'type':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x15')],'app':_0x6b8c('0x16'),'appdata':_0x6b8c('0x1a')+_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1b')],'context':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1f')],'exten':_0x174873[_0x37e4eb][0x0]['exten'],'priority':_0x318325[_0x6b8c('0x11')]++,'VoiceExtensionId':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1b')]});var _0x250dfa=_0x318325['priority']++;_0x318325[_0x6b8c('0x12')][_0x6b8c('0x14')]({'type':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x15')],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x250dfa+0x2)+_0x6b8c('0x20')+(_0x250dfa+0x1)+')','context':_0x174873[_0x37e4eb][0x0]['context'],'exten':_0x174873[_0x37e4eb][0x0][_0x6b8c('0xb')],'priority':_0x250dfa,'VoiceExtensionId':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1b')]});if(_0x318325[_0x6b8c('0x13')]){_0x318325['extensions'][_0x6b8c('0x14')]({'type':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x15')],'app':_0x6b8c('0x16'),'appdata':_0x318325[_0x6b8c('0x13')][_0x6b8c('0x1d')]?_0x6b8c('0x21')+_0x318325[_0x6b8c('0x13')][_0x6b8c('0x1d')]+'}':_0x6b8c('0x22'),'context':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1f')],'exten':_0x174873[_0x37e4eb][0x0]['exten'],'priority':_0x318325['priority']++,'VoiceExtensionId':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1b')]});}_0x318325[_0x6b8c('0x12')][_0x6b8c('0x14')]({'type':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x15')],'app':_0x6b8c('0x16'),'appdata':_0x6b8c('0x23')+_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1b')],'context':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1f')],'exten':_0x174873[_0x37e4eb][0x0]['exten'],'priority':_0x318325[_0x6b8c('0x11')]++,'VoiceExtensionId':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1b')]});if(_0x318325['extension']&&_0x318325[_0x6b8c('0x13')][_0x6b8c('0x24')](_0x6b8c('0x25'))&&_0x318325[_0x6b8c('0x13')][_0x6b8c('0x25')]!=='none'){_0x318325[_0x6b8c('0x12')][_0x6b8c('0x14')]({'type':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x15')],'app':'Set','appdata':_0x6b8c('0x26'),'context':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1f')],'exten':_0x174873[_0x37e4eb][0x0][_0x6b8c('0xb')],'priority':_0x318325['priority']++,'VoiceExtensionId':_0x174873[_0x37e4eb][0x0]['VoiceExtensionId']});_0x318325['extensions'][_0x6b8c('0x14')]({'type':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x15')],'app':_0x6b8c('0x16'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x318325[_0x6b8c('0x13')][_0x6b8c('0x25')]||_0x6b8c('0x27'),'context':_0x174873[_0x37e4eb][0x0]['context'],'exten':_0x174873[_0x37e4eb][0x0][_0x6b8c('0xb')],'priority':_0x318325[_0x6b8c('0x11')]++,'VoiceExtensionId':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1b')]});}}_0x318325['extensions'][_0x6b8c('0x14')]({'type':_0x174873[_0x37e4eb][0x0]['type'],'app':_0x6b8c('0x16'),'appdata':_0x6b8c('0x28'),'context':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1f')],'exten':_0x174873[_0x37e4eb][0x0][_0x6b8c('0xb')],'priority':_0x318325[_0x6b8c('0x11')]++,'VoiceExtensionId':_0x174873[_0x37e4eb][0x0]['VoiceExtensionId']});_0x318325[_0x6b8c('0x12')]['push']({'type':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x15')],'app':_0x6b8c('0x16'),'appdata':_0x6b8c('0x29'),'context':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1f')],'exten':_0x174873[_0x37e4eb][0x0]['exten'],'priority':_0x318325[_0x6b8c('0x11')]++,'VoiceExtensionId':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1b')]});_0x318325[_0x6b8c('0x12')]['push']({'type':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x15')],'app':_0x6b8c('0x16'),'appdata':_0x6b8c('0x2a'),'context':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1f')],'exten':_0x174873[_0x37e4eb][0x0]['exten'],'priority':_0x318325['priority']++,'VoiceExtensionId':_0x174873[_0x37e4eb][0x0]['VoiceExtensionId']});for(var _0x4515ac=0x0,_0x31df5e=0x0;_0x4515ac<_0x174873[_0x37e4eb][_0x6b8c('0x2b')];_0x4515ac+=0x1,_0x31df5e=0x0){var _0x9019f9=_0x174873[_0x37e4eb][_0x4515ac];if(_0x9019f9[_0x6b8c('0x15')]){_0x9019f9[_0x6b8c('0x15')]=_0x9019f9[_0x6b8c('0x15')][_0x6b8c('0x2c')]();}var _0x13c0d6=[];var _0x40c514=[];delete _0x9019f9['id'];delete _0x9019f9['createdAt'];delete _0x9019f9[_0x6b8c('0x2d')];var _0x295e92=_0x9019f9[_0x6b8c('0x2e')]!==_0x6b8c('0x2f')?[_0x9019f9['interval']]:_0x9019f9[_0x6b8c('0x8')]?_[_0x6b8c('0xa')](_[_0x6b8c('0xd')](_0x318325[_0x6b8c('0x6')],{'IntervalId':_0x9019f9[_0x6b8c('0x8')]}),_0x6b8c('0x2e')):[];if(_0x9019f9[_0x6b8c('0x24')]('tag')){if(_0x9019f9[_0x6b8c('0x30')]&&_0x9019f9['tag']!=='--'){_0x13c0d6[_0x6b8c('0x14')]({'type':_0x9019f9[_0x6b8c('0x15')],'app':_0x6b8c('0x16'),'appdata':_0x6b8c('0x31')+_0x9019f9['tag'],'context':_0x9019f9[_0x6b8c('0x1f')],'exten':_0x9019f9[_0x6b8c('0xb')],'priority':_0x295e92[_0x6b8c('0x2b')]+_0x318325[_0x6b8c('0x11')]+_0x31df5e++,'VoiceExtensionId':_0x9019f9[_0x6b8c('0x1b')]});}}if(_0x9019f9[_0x6b8c('0x15')]==='outbound'&&_0x9019f9[_0x6b8c('0x24')](_0x6b8c('0x32'))){if(_0x9019f9[_0x6b8c('0x32')]){_0x13c0d6['push']({'type':_0x9019f9[_0x6b8c('0x15')],'app':'ExecIf','appdata':_0x6b8c('0x33')+_0x9019f9[_0x6b8c('0x32')]+')','context':_0x9019f9[_0x6b8c('0x1f')],'exten':_0x9019f9[_0x6b8c('0xb')],'priority':_0x295e92['length']+_0x318325[_0x6b8c('0x11')]+_0x31df5e++,'VoiceExtensionId':_0x9019f9['VoiceExtensionId']});}else{_0x13c0d6['push']({'type':_0x9019f9['type'],'app':'ExecIf','appdata':_0x6b8c('0x34'),'context':_0x9019f9[_0x6b8c('0x1f')],'exten':_0x9019f9['exten'],'priority':_0x295e92[_0x6b8c('0x2b')]+_0x318325[_0x6b8c('0x11')]+_0x31df5e++,'VoiceExtensionId':_0x9019f9[_0x6b8c('0x1b')]});}}if(_0x9019f9[_0x6b8c('0x24')]('answer')){if(_0x8a9575['indexOf'](_0x9019f9[_0x6b8c('0x35')][_0x6b8c('0x2c')]())>=0x0&&_0x9019f9[_0x6b8c('0x36')]!==_0x6b8c('0x37')){if(_0x9019f9[_0x6b8c('0x38')]){_0x13c0d6[_0x6b8c('0x14')]({'type':_0x9019f9[_0x6b8c('0x15')],'app':_0x6b8c('0x39'),'appdata':_0x6b8c('0x3a'),'context':_0x9019f9[_0x6b8c('0x1f')],'exten':_0x9019f9[_0x6b8c('0xb')],'priority':_0x295e92[_0x6b8c('0x2b')]+_0x318325['priority']+_0x31df5e++,'VoiceExtensionId':_0x9019f9[_0x6b8c('0x1b')]});_0x13c0d6['push']({'type':_0x9019f9[_0x6b8c('0x15')],'app':'Set','appdata':_0x6b8c('0x3b'),'context':_0x9019f9[_0x6b8c('0x1f')],'exten':_0x9019f9['exten'],'priority':_0x295e92[_0x6b8c('0x2b')]+_0x318325[_0x6b8c('0x11')]+_0x31df5e++,'VoiceExtensionId':_0x9019f9[_0x6b8c('0x1b')]});}else{_0x13c0d6[_0x6b8c('0x14')]({'type':_0x9019f9['type'],'app':_0x6b8c('0x39'),'appdata':_0x6b8c('0x3c'),'context':_0x9019f9[_0x6b8c('0x1f')],'exten':_0x9019f9['exten'],'priority':_0x295e92[_0x6b8c('0x2b')]+_0x318325[_0x6b8c('0x11')]+_0x31df5e++,'VoiceExtensionId':_0x9019f9[_0x6b8c('0x1b')]});_0x13c0d6[_0x6b8c('0x14')]({'type':_0x9019f9['type'],'app':_0x6b8c('0x16'),'appdata':_0x6b8c('0x3d'),'context':_0x9019f9[_0x6b8c('0x1f')],'exten':_0x9019f9[_0x6b8c('0xb')],'priority':_0x295e92['length']+_0x318325[_0x6b8c('0x11')]+_0x31df5e++,'VoiceExtensionId':_0x9019f9[_0x6b8c('0x1b')]});}}}for(var _0xb572cc=0x0;_0xb572cc<_0x295e92['length'];_0xb572cc+=0x1){var _0x51a1e3=_0x318325[_0x6b8c('0x11')]+_0x295e92[_0x6b8c('0x2b')];var _0x514db9=_0xb572cc===_0x295e92[_0x6b8c('0x2b')]-0x1?_0x318325[_0x6b8c('0x11')]+_0x13c0d6[_0x6b8c('0x2b')]+_0x40c514['length']+0x2:_0x318325['priority']+_0xb572cc+0x1;_0x13c0d6[_0x6b8c('0x3e')](_0xb572cc,0x0,{'type':_0x9019f9[_0x6b8c('0x15')],'app':_0x6b8c('0x3f'),'appdata':_0x295e92[_0xb572cc]+'?'+_0x9019f9[_0x6b8c('0x1f')]+',${EXTEN},'+_0x51a1e3+':'+_0x9019f9[_0x6b8c('0x1f')]+_0x6b8c('0x40')+_0x514db9,'exten':_0x9019f9[_0x6b8c('0xb')],'context':_0x9019f9['context'],'priority':_0x318325[_0x6b8c('0x11')]+_0xb572cc,'VoiceExtensionId':_0x174873[_0x37e4eb][0x0]['VoiceExtensionId']});}_0x9019f9[_0x6b8c('0x11')]=_0x13c0d6[_0x6b8c('0x2b')]?_['last'](_0x13c0d6)[_0x6b8c('0x11')]+0x1:_0x318325[_0x6b8c('0x11')];_0x318325[_0x6b8c('0x11')]=(_0x40c514[_0x6b8c('0x2b')]?_[_0x6b8c('0x41')](_0x40c514)[_0x6b8c('0x11')]:_0x9019f9[_0x6b8c('0x11')])+0x1;_0x318325[_0x6b8c('0x12')]=_[_0x6b8c('0x42')](_0x318325[_0x6b8c('0x12')],_0x13c0d6,[_0x9019f9],_0x40c514);}_0x318325['extensions']['push']({'type':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x15')],'app':_0x6b8c('0x43'),'exten':_0x174873[_0x37e4eb][0x0][_0x6b8c('0xb')],'context':_0x174873[_0x37e4eb][0x0]['context'],'priority':_0x318325[_0x6b8c('0x11')],'VoiceExtensionId':_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1b')]});_0x55e744[_0x6b8c('0x14')](_0x174873[_0x37e4eb][0x0][_0x6b8c('0x1b')]);_0x3d2563=_[_0x6b8c('0x42')](_0x3d2563,_0x318325[_0x6b8c('0x12')]);}}return _0x5c9ffb[_0x6b8c('0x44')](function(_0x133fab){return _0x5c9ffb['models'][_0x6b8c('0x7')][_0x6b8c('0x45')]({'where':{'VoiceExtensionId':{'$in':_0x55e744}},'transaction':_0x133fab})[_0x6b8c('0x5')](function(_0x39064a){return _0x5c9ffb['models'][_0x6b8c('0x7')][_0x6b8c('0x46')](_[_0x6b8c('0x47')](_0x3d2563,_0x6b8c('0x11')),{'transaction':_0x133fab});});});})['catch'](function(_0x118189){console['error'](_0x118189);});}exports[_0x6b8c('0x48')]=rewrite; \ No newline at end of file +var _0x0c4d=['custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','catch','lodash','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','filter','groupBy','hasOwnProperty','priority','extensions','extension','exten','push','Set','format','CDR(type)=%s','type','VoiceExtensionId','CDR(routeid)=','context','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','outbound','ExecIf','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase'];(function(_0x29e3b6,_0x40b0b4){var _0x55d4b0=function(_0x55c58e){while(--_0x55c58e){_0x29e3b6['push'](_0x29e3b6['shift']());}};_0x55d4b0(++_0x40b0b4);}(_0x0c4d,0x115));var _0xd0c4=function(_0x5cc70a,_0x222265){_0x5cc70a=_0x5cc70a-0x0;var _0x190fab=_0x0c4d[_0x5cc70a];return _0x190fab;};'use strict';var _=require(_0xd0c4('0x0'));var util=require('util');function rewrite(_0x18b8ae,_0x2cd20b){var _0x3633a1=this;return _0x18b8ae[_0xd0c4('0x1')][_0xd0c4('0x2')][_0xd0c4('0x3')]({'raw':!![]})[_0xd0c4('0x4')](function(_0x4e6130){_0x3633a1[_0xd0c4('0x5')]=_0x4e6130;return _0x18b8ae[_0xd0c4('0x1')][_0xd0c4('0x6')][_0xd0c4('0x3')]({'where':{'IntervalId':_0x2cd20b[_0xd0c4('0x7')]},'raw':!![]});})[_0xd0c4('0x4')](function(_0x3b5571){return _0x18b8ae[_0xd0c4('0x1')]['VoiceExtension'][_0xd0c4('0x3')]({'where':{'exten':{'$in':_[_0xd0c4('0x8')](_['map'](_0x3b5571,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xd0c4('0x4')](function(_0xbdf6d5){var _0x4a5bf9=_['filter'](_0xbdf6d5,{'priority':'1'});var _0x2482ee=_[_0xd0c4('0x9')](_0xbdf6d5,{'isApp':0x1});var _0x40279e=_[_0xd0c4('0xa')](_0x2482ee,'exten');var _0x22e018=['queue','playback'];var _0x23174c=[];var _0x59c1b6=[];for(var _0x120e5b in _0x40279e){if(_0x40279e[_0xd0c4('0xb')](_0x120e5b)){_0x3633a1[_0xd0c4('0xc')]=0x2;_0x3633a1[_0xd0c4('0xd')]=[];_0x3633a1[_0xd0c4('0xe')]=_['find'](_0x4a5bf9,{'exten':_0x40279e[_0x120e5b][0x0][_0xd0c4('0xf')]});_0x3633a1['extensions'][_0xd0c4('0x10')]({'type':_0x40279e[_0x120e5b][0x0]['type'],'app':_0xd0c4('0x11'),'appdata':util[_0xd0c4('0x12')](_0xd0c4('0x13'),_0x40279e[_0x120e5b][0x0][_0xd0c4('0x14')]),'context':_0x40279e[_0x120e5b][0x0]['context'],'exten':_0x40279e[_0x120e5b][0x0][_0xd0c4('0xf')],'priority':_0x3633a1[_0xd0c4('0xc')]++,'VoiceExtensionId':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x15')]});if(_0x40279e[_0x120e5b][0x0][_0xd0c4('0x14')]==='inbound'){_0x3633a1['extensions'][_0xd0c4('0x10')]({'type':_0x40279e[_0x120e5b][0x0]['type'],'app':_0xd0c4('0x11'),'appdata':_0xd0c4('0x16')+_0x40279e[_0x120e5b][0x0][_0xd0c4('0x15')],'context':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x17')],'exten':_0x40279e[_0x120e5b][0x0][_0xd0c4('0xf')],'priority':_0x3633a1[_0xd0c4('0xc')]++,'VoiceExtensionId':_0x40279e[_0x120e5b][0x0]['VoiceExtensionId']});}else if(_0x40279e[_0x120e5b][0x0]['type']==='outbound'){if(_0x3633a1[_0xd0c4('0xe')]){_0x3633a1[_0xd0c4('0xd')][_0xd0c4('0x10')]({'type':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x14')],'app':_0xd0c4('0x11'),'appdata':_0xd0c4('0x18')+(_0x3633a1['extension'][_0xd0c4('0x19')]?_0xd0c4('0x1a')+_0x3633a1['extension']['cutdigits']+'}':_0xd0c4('0x1b')),'context':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x17')],'exten':_0x40279e[_0x120e5b][0x0][_0xd0c4('0xf')],'priority':_0x3633a1[_0xd0c4('0xc')]++,'VoiceExtensionId':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x15')]});}_0x3633a1['extensions'][_0xd0c4('0x10')]({'type':_0x40279e[_0x120e5b][0x0]['type'],'app':'Set','appdata':_0xd0c4('0x16')+_0x40279e[_0x120e5b][0x0]['VoiceExtensionId'],'context':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x17')],'exten':_0x40279e[_0x120e5b][0x0][_0xd0c4('0xf')],'priority':_0x3633a1[_0xd0c4('0xc')]++,'VoiceExtensionId':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x15')]});var _0x42f061=_0x3633a1[_0xd0c4('0xc')]++;_0x3633a1[_0xd0c4('0xd')][_0xd0c4('0x10')]({'type':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x14')],'app':'ExecIf','appdata':_0xd0c4('0x1c')+(_0x42f061+0x2)+_0xd0c4('0x1d')+(_0x42f061+0x1)+')','context':_0x40279e[_0x120e5b][0x0]['context'],'exten':_0x40279e[_0x120e5b][0x0][_0xd0c4('0xf')],'priority':_0x42f061,'VoiceExtensionId':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x15')]});if(_0x3633a1[_0xd0c4('0xe')]){_0x3633a1[_0xd0c4('0xd')]['push']({'type':_0x40279e[_0x120e5b][0x0]['type'],'app':_0xd0c4('0x11'),'appdata':_0x3633a1['extension'][_0xd0c4('0x19')]?_0xd0c4('0x1e')+_0x3633a1[_0xd0c4('0xe')][_0xd0c4('0x19')]+'}':_0xd0c4('0x1f'),'context':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x17')],'exten':_0x40279e[_0x120e5b][0x0]['exten'],'priority':_0x3633a1[_0xd0c4('0xc')]++,'VoiceExtensionId':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x15')]});}_0x3633a1['extensions'][_0xd0c4('0x10')]({'type':_0x40279e[_0x120e5b][0x0]['type'],'app':_0xd0c4('0x11'),'appdata':_0xd0c4('0x20')+_0x40279e[_0x120e5b][0x0][_0xd0c4('0x15')],'context':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x17')],'exten':_0x40279e[_0x120e5b][0x0]['exten'],'priority':_0x3633a1[_0xd0c4('0xc')]++,'VoiceExtensionId':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x15')]});if(_0x3633a1[_0xd0c4('0xe')]&&_0x3633a1[_0xd0c4('0xe')][_0xd0c4('0xb')](_0xd0c4('0x21'))&&_0x3633a1['extension'][_0xd0c4('0x21')]!=='none'){_0x3633a1[_0xd0c4('0xd')]['push']({'type':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x14')],'app':_0xd0c4('0x11'),'appdata':_0xd0c4('0x22'),'context':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x17')],'exten':_0x40279e[_0x120e5b][0x0][_0xd0c4('0xf')],'priority':_0x3633a1[_0xd0c4('0xc')]++,'VoiceExtensionId':_0x40279e[_0x120e5b][0x0]['VoiceExtensionId']});_0x3633a1[_0xd0c4('0xd')][_0xd0c4('0x10')]({'type':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x14')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x3633a1[_0xd0c4('0xe')]['recordingFormat']||_0xd0c4('0x23'),'context':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x17')],'exten':_0x40279e[_0x120e5b][0x0][_0xd0c4('0xf')],'priority':_0x3633a1[_0xd0c4('0xc')]++,'VoiceExtensionId':_0x40279e[_0x120e5b][0x0]['VoiceExtensionId']});}}_0x3633a1['extensions'][_0xd0c4('0x10')]({'type':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x14')],'app':_0xd0c4('0x11'),'appdata':_0xd0c4('0x24'),'context':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x17')],'exten':_0x40279e[_0x120e5b][0x0]['exten'],'priority':_0x3633a1['priority']++,'VoiceExtensionId':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x15')]});_0x3633a1[_0xd0c4('0xd')][_0xd0c4('0x10')]({'type':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x14')],'app':_0xd0c4('0x11'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x17')],'exten':_0x40279e[_0x120e5b][0x0][_0xd0c4('0xf')],'priority':_0x3633a1[_0xd0c4('0xc')]++,'VoiceExtensionId':_0x40279e[_0x120e5b][0x0]['VoiceExtensionId']});_0x3633a1[_0xd0c4('0xd')][_0xd0c4('0x10')]({'type':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x14')],'app':_0xd0c4('0x11'),'appdata':_0xd0c4('0x25'),'context':_0x40279e[_0x120e5b][0x0]['context'],'exten':_0x40279e[_0x120e5b][0x0]['exten'],'priority':_0x3633a1[_0xd0c4('0xc')]++,'VoiceExtensionId':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x15')]});for(var _0x3462db=0x0,_0x2f4c7d=0x0;_0x3462db<_0x40279e[_0x120e5b][_0xd0c4('0x26')];_0x3462db+=0x1,_0x2f4c7d=0x0){var _0x15ce9c=_0x40279e[_0x120e5b][_0x3462db];if(_0x15ce9c[_0xd0c4('0x14')]){_0x15ce9c[_0xd0c4('0x14')]=_0x15ce9c[_0xd0c4('0x14')]['toLowerCase']();}var _0x228fe3=[];var _0x231898=[];delete _0x15ce9c['id'];delete _0x15ce9c[_0xd0c4('0x27')];delete _0x15ce9c[_0xd0c4('0x28')];var _0x302618=_0x15ce9c[_0xd0c4('0x29')]!==_0xd0c4('0x2a')?[_0x15ce9c[_0xd0c4('0x29')]]:_0x15ce9c[_0xd0c4('0x7')]?_['map'](_['filter'](_0x3633a1['intervals'],{'IntervalId':_0x15ce9c[_0xd0c4('0x7')]}),'interval'):[];if(_0x15ce9c[_0xd0c4('0xb')]('tag')){if(_0x15ce9c[_0xd0c4('0x2b')]&&_0x15ce9c[_0xd0c4('0x2b')]!=='--'){_0x228fe3['push']({'type':_0x15ce9c[_0xd0c4('0x14')],'app':'Set','appdata':_0xd0c4('0x2c')+_0x15ce9c[_0xd0c4('0x2b')],'context':_0x15ce9c[_0xd0c4('0x17')],'exten':_0x15ce9c[_0xd0c4('0xf')],'priority':_0x302618[_0xd0c4('0x26')]+_0x3633a1[_0xd0c4('0xc')]+_0x2f4c7d++,'VoiceExtensionId':_0x15ce9c['VoiceExtensionId']});}}if(_0x15ce9c['type']===_0xd0c4('0x2d')&&_0x15ce9c['hasOwnProperty']('callerID')){if(_0x15ce9c['callerID']){_0x228fe3['push']({'type':_0x15ce9c['type'],'app':_0xd0c4('0x2e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x15ce9c[_0xd0c4('0x2f')]+')','context':_0x15ce9c[_0xd0c4('0x17')],'exten':_0x15ce9c[_0xd0c4('0xf')],'priority':_0x302618['length']+_0x3633a1['priority']+_0x2f4c7d++,'VoiceExtensionId':_0x15ce9c[_0xd0c4('0x15')]});}else{_0x228fe3[_0xd0c4('0x10')]({'type':_0x15ce9c[_0xd0c4('0x14')],'app':'ExecIf','appdata':_0xd0c4('0x30'),'context':_0x15ce9c[_0xd0c4('0x17')],'exten':_0x15ce9c[_0xd0c4('0xf')],'priority':_0x302618[_0xd0c4('0x26')]+_0x3633a1[_0xd0c4('0xc')]+_0x2f4c7d++,'VoiceExtensionId':_0x15ce9c['VoiceExtensionId']});}}if(_0x15ce9c['hasOwnProperty'](_0xd0c4('0x31'))){if(_0x22e018[_0xd0c4('0x32')](_0x15ce9c[_0xd0c4('0x33')][_0xd0c4('0x34')]())>=0x0&&_0x15ce9c['appType']!==_0xd0c4('0x35')){if(_0x15ce9c[_0xd0c4('0x31')]){_0x228fe3[_0xd0c4('0x10')]({'type':_0x15ce9c[_0xd0c4('0x14')],'app':_0xd0c4('0x2e'),'appdata':_0xd0c4('0x36'),'context':_0x15ce9c[_0xd0c4('0x17')],'exten':_0x15ce9c[_0xd0c4('0xf')],'priority':_0x302618[_0xd0c4('0x26')]+_0x3633a1[_0xd0c4('0xc')]+_0x2f4c7d++,'VoiceExtensionId':_0x15ce9c[_0xd0c4('0x15')]});_0x228fe3[_0xd0c4('0x10')]({'type':_0x15ce9c[_0xd0c4('0x14')],'app':_0xd0c4('0x11'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x15ce9c[_0xd0c4('0x17')],'exten':_0x15ce9c[_0xd0c4('0xf')],'priority':_0x302618['length']+_0x3633a1[_0xd0c4('0xc')]+_0x2f4c7d++,'VoiceExtensionId':_0x15ce9c['VoiceExtensionId']});}else{_0x228fe3[_0xd0c4('0x10')]({'type':_0x15ce9c['type'],'app':_0xd0c4('0x2e'),'appdata':_0xd0c4('0x37'),'context':_0x15ce9c['context'],'exten':_0x15ce9c[_0xd0c4('0xf')],'priority':_0x302618[_0xd0c4('0x26')]+_0x3633a1[_0xd0c4('0xc')]+_0x2f4c7d++,'VoiceExtensionId':_0x15ce9c[_0xd0c4('0x15')]});_0x228fe3['push']({'type':_0x15ce9c['type'],'app':_0xd0c4('0x11'),'appdata':_0xd0c4('0x38'),'context':_0x15ce9c['context'],'exten':_0x15ce9c[_0xd0c4('0xf')],'priority':_0x302618['length']+_0x3633a1['priority']+_0x2f4c7d++,'VoiceExtensionId':_0x15ce9c[_0xd0c4('0x15')]});}}}for(var _0x1057e0=0x0;_0x1057e0<_0x302618[_0xd0c4('0x26')];_0x1057e0+=0x1){var _0x2963cb=_0x3633a1[_0xd0c4('0xc')]+_0x302618['length'];var _0xc8010d=_0x1057e0===_0x302618[_0xd0c4('0x26')]-0x1?_0x3633a1[_0xd0c4('0xc')]+_0x228fe3['length']+_0x231898[_0xd0c4('0x26')]+0x2:_0x3633a1['priority']+_0x1057e0+0x1;_0x228fe3['splice'](_0x1057e0,0x0,{'type':_0x15ce9c[_0xd0c4('0x14')],'app':_0xd0c4('0x39'),'appdata':_0x302618[_0x1057e0]+'?'+_0x15ce9c[_0xd0c4('0x17')]+_0xd0c4('0x3a')+_0x2963cb+':'+_0x15ce9c['context']+',${EXTEN},'+_0xc8010d,'exten':_0x15ce9c[_0xd0c4('0xf')],'context':_0x15ce9c[_0xd0c4('0x17')],'priority':_0x3633a1[_0xd0c4('0xc')]+_0x1057e0,'VoiceExtensionId':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x15')]});}_0x15ce9c[_0xd0c4('0xc')]=_0x228fe3[_0xd0c4('0x26')]?_[_0xd0c4('0x3b')](_0x228fe3)[_0xd0c4('0xc')]+0x1:_0x3633a1[_0xd0c4('0xc')];_0x3633a1[_0xd0c4('0xc')]=(_0x231898[_0xd0c4('0x26')]?_[_0xd0c4('0x3b')](_0x231898)[_0xd0c4('0xc')]:_0x15ce9c[_0xd0c4('0xc')])+0x1;_0x3633a1[_0xd0c4('0xd')]=_[_0xd0c4('0x3c')](_0x3633a1['extensions'],_0x228fe3,[_0x15ce9c],_0x231898);}_0x3633a1['extensions'][_0xd0c4('0x10')]({'type':_0x40279e[_0x120e5b][0x0]['type'],'app':_0xd0c4('0x3d'),'exten':_0x40279e[_0x120e5b][0x0][_0xd0c4('0xf')],'context':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x17')],'priority':_0x3633a1[_0xd0c4('0xc')],'VoiceExtensionId':_0x40279e[_0x120e5b][0x0][_0xd0c4('0x15')]});_0x23174c[_0xd0c4('0x10')](_0x40279e[_0x120e5b][0x0][_0xd0c4('0x15')]);_0x59c1b6=_['concat'](_0x59c1b6,_0x3633a1[_0xd0c4('0xd')]);}}return _0x18b8ae[_0xd0c4('0x3e')](function(_0x13e129){return _0x18b8ae['models'][_0xd0c4('0x6')][_0xd0c4('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x23174c}},'transaction':_0x13e129})[_0xd0c4('0x4')](function(_0x1d44c3){return _0x18b8ae[_0xd0c4('0x1')]['VoiceExtension'][_0xd0c4('0x40')](_['sortBy'](_0x59c1b6,'priority'),{'transaction':_0x13e129});});});})[_0xd0c4('0x41')](function(_0x43355e){console['error'](_0x43355e);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 0077099..de4a33d 100644 --- a/server/components/import/cm/csv.js +++ b/server/components/import/cm/csv.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc6c=['finally','contact:csv_','resume','resolve','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','id\x20IN\x20?','str','calleridnum','fromQuery','VoiceQueue','outbound','dialCheckDuplicateType','get','always','push','query','VoiceQueueId','sequelize','all','CmList','BlackLists','Lists','CampaignId','onlyIfOpen','Campaign','findAll','generalCheckHopper','Error\x20processing\x20rows\x20block:'];(function(_0xc54a99,_0x205712){var _0x3b28d1=function(_0x4d60fe){while(--_0x4d60fe){_0xc54a99['push'](_0xc54a99['shift']());}};_0x3b28d1(++_0x205712);}(_0xcc6c,0x1b8));var _0xccc6=function(_0x4f064f,_0x31c44f){_0x4f064f=_0x4f064f-0x0;var _0x4f96fc=_0xcc6c[_0x4f064f];return _0x4f96fc;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xccc6('0x0'));var fs=require('fs');var squel=require(_0xccc6('0x1'));var Papa=require(_0xccc6('0x2'));var Redis=require('ioredis');var db=require(_0xccc6('0x3'))['db'];var config=require(_0xccc6('0x4'));var logger=require(_0xccc6('0x5'))(_0xccc6('0x6'));config[_0xccc6('0x7')]=_['defaults'](config[_0xccc6('0x7')],{'host':_0xccc6('0x8'),'port':0x18eb});var socket=require(_0xccc6('0x9'))(new Redis(config[_0xccc6('0x7')]));require(_0xccc6('0xa'))[_0xccc6('0xb')](socket);try{if(!process[_0xccc6('0xc')][0x2]||process[_0xccc6('0xc')][0x2]===_0xccc6('0xd')||process[_0xccc6('0xc')][0x2]===_0xccc6('0xe')){throw new Error(_0xccc6('0xf'));}var FILEPATH=process[_0xccc6('0xc')][0x2];if(!process[_0xccc6('0xc')][0x3]||process['argv'][0x3]===_0xccc6('0xd')||process[_0xccc6('0xc')][0x3]===_0xccc6('0xe')||!process['argv'][0x4]||process[_0xccc6('0xc')][0x4]===_0xccc6('0xd')||process[_0xccc6('0xc')][0x4]===_0xccc6('0xe')){throw new Error(_0xccc6('0x10'));}var FIELDS=_['zipObject'](process[_0xccc6('0xc')][0x3]['split'](','),process['argv'][0x4]['split'](','));if(!process[_0xccc6('0xc')][0x5]||process[_0xccc6('0xc')][0x5]===_0xccc6('0xd')||process[_0xccc6('0xc')][0x5]===_0xccc6('0xe')){throw new Error(_0xccc6('0x11'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xccc6('0xc')][0x6]&&process[_0xccc6('0xc')][0x6]!=='undefined'&&process['argv'][0x6]!==_0xccc6('0xe')?process[_0xccc6('0xc')][0x6]:null;var DUPLICATES=process[_0xccc6('0xc')][0x7]&&process[_0xccc6('0xc')][0x7]!=='undefined'&&process[_0xccc6('0xc')][0x7]!==_0xccc6('0xe')?process[_0xccc6('0xc')][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]===_0xccc6('0xd')||process[_0xccc6('0xc')][0x8]===_0xccc6('0xe')){throw new Error(_0xccc6('0x12'));}var SOCKET_TIMESTAMP=process[_0xccc6('0xc')][0x8];}catch(_0x5f123c){logger[_0xccc6('0x13')](_0x5f123c);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0xc4cf3b,_0x4ddd4e,_0x19ab34,_0xa172a0){var _0x19f7df={'message':_0x4ddd4e};_0x19f7df[_0xc4cf3b]=!![];if(_0x19ab34){_0x19f7df[_0xccc6('0x14')]=_0x19ab34;}if(_0xa172a0){_0x19f7df[_0xccc6('0x15')]=_0xa172a0;}return _0x19f7df;}function isEmail(_0x1ded62){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xccc6('0x16')](_0x1ded62);}function checkRow(_0x4d53f1,_0x32c9a1,_0x29f930){return new BPromise(function(_0xc4e943,_0x1cee0e){if(_[_0xccc6('0x17')](_0x4d53f1)){return _0x1cee0e(handleCheckRowError('error',_0xccc6('0x18'),null,_0x29f930));}if(_0x4d53f1[_0xccc6('0x19')]&&_0x4d53f1['errors'][_0xccc6('0x1a')]){var _0x11cd34=_[_0xccc6('0x1b')](_0x4d53f1['errors'],_0xccc6('0x1c'))[_0xccc6('0x1d')](';');return _0x1cee0e(handleCheckRowError(_0xccc6('0x13'),_0x11cd34,null,_0x29f930));}var _0x430d54={};for(var _0x5b1902 in FIELDS){if(FIELDS[_0xccc6('0x1e')](_0x5b1902)&&FIELDS[_0x5b1902]){_0x430d54[_0x5b1902]=_0x4d53f1[_0xccc6('0x1f')][0x0][FIELDS[_0x5b1902]]||_0x4d53f1[_0xccc6('0x1f')][0x0]['\ufeff'+FIELDS[_0x5b1902]];}}if(!_0x430d54['firstName']){return _0x1cee0e(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x29f930));}if(!_0x430d54[_0xccc6('0x20')]){return _0x1cee0e(handleCheckRowError(_0xccc6('0x13'),'phone\x20not\x20specified!',null,_0x29f930));}if(_0x430d54['birthDate']){var _0x90e0b6=moment(_0x430d54[_0xccc6('0x21')],_0xccc6('0x22'));if(!_0x90e0b6[_0xccc6('0x23')]()){return _0x1cee0e(handleCheckRowError('error',_0xccc6('0x24'),null,_0x29f930));}}if(_0x430d54[_0xccc6('0x25')]){if(!isEmail(_0x430d54[_0xccc6('0x25')])){return _0x1cee0e(handleCheckRowError(_0xccc6('0x13'),_0xccc6('0x26'),null,_0x29f930));}}_0x430d54[_0xccc6('0x27')]=LISTID;_0x430d54[_0xccc6('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xccc6('0x1a')]&&_0x32c9a1){var _0x28d776={};for(var _0x129e64=0x0,_0x472256=DUPLICATES['length'];_0x129e64<_0x472256;_0x129e64+=0x1){_0x28d776[DUPLICATES[_0x129e64]]=_0x430d54[DUPLICATES[_0x129e64]];}var _0x3a3e76=_[_0xccc6('0x29')](_0x32c9a1,_0x28d776);if(_0x3a3e76){return _0x1cee0e(handleCheckRowError(_0xccc6('0x2a'),_0xccc6('0x2b'),_0x3a3e76,_0x29f930));}}return db[_0xccc6('0x2c')]['create'](_0x430d54,{'raw':!![],'hooks':![],'fields':_['keys'](_0x430d54)})[_0xccc6('0x2d')](function(_0x502e58){if(DUPLICATES&&DUPLICATES[_0xccc6('0x1a')]&&_0x32c9a1){_0x32c9a1['push'](_[_0xccc6('0x2e')](_0x430d54,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x502e58['id'];return _0xc4e943();})[_0xccc6('0x2f')](function(_0x39e8f7){return _0x1cee0e(handleCheckRowError(_0xccc6('0x13'),_0xccc6('0x30')+(_0x39e8f7[_0xccc6('0x1c')]||JSON[_0xccc6('0x31')](_0x39e8f7)),null,_0x29f930));});});}function checkHopper(){function _0x470afe(){return function(_0x505036){logger[_0xccc6('0x13')](_0xccc6('0x32'),_0xccc6('0x33'),util[_0xccc6('0x34')](_0x505036,{'showHidden':![],'depth':null}));};}var _0xa43a3e=function(_0x12976b,_0x41c8b9){var _0x11d742=squel[_0xccc6('0x35')]()[_0xccc6('0x36')](_0xccc6('0x37'))['fromQuery']([_0xccc6('0x20'),'scheduledAt',_0xccc6('0x38'),_0xccc6('0x27'),_0x41c8b9,_0xccc6('0x39'),_0xccc6('0x3a')],squel[_0xccc6('0x3b')]()['field'](_0xccc6('0x20'),_0xccc6('0x20'))[_0xccc6('0x3c')](_0xccc6('0x3d'),_0xccc6('0x3e'))['field']('id',_0xccc6('0x38'))[_0xccc6('0x3c')](LISTID[_0xccc6('0x3f')](),_0xccc6('0x27'))[_0xccc6('0x3c')](_0x12976b['id'][_0xccc6('0x3f')](),_0x41c8b9)[_0xccc6('0x3c')](_0xccc6('0x3d'),'createdAt')['field'](_0xccc6('0x3d'),_0xccc6('0x3a'))[_0xccc6('0x40')](_0xccc6('0x41'))[_0xccc6('0x42')]('deletedAt\x20IS\x20NULL')[_0xccc6('0x42')]('ListId\x20=\x20?',LISTID[_0xccc6('0x3f')]())[_0xccc6('0x42')](_0xccc6('0x43'))[_0xccc6('0x42')](_0xccc6('0x44'),squel[_0xccc6('0x3b')]()[_0xccc6('0x3c')]('phone')[_0xccc6('0x40')](_0xccc6('0x37'))[_0xccc6('0x42')](_0x41c8b9+_0xccc6('0x45'),_0x12976b['id'][_0xccc6('0x3f')]())))[_0xccc6('0x3f')]();return _0x11d742;};var _0x57054b=function(_0x5aba84,_0x44030f){var _0x4bf485=squel['insert']()['into'](_0xccc6('0x37'))['fromQuery']([_0xccc6('0x20'),'scheduledAt',_0xccc6('0x38'),_0xccc6('0x27'),_0x44030f,_0xccc6('0x39'),_0xccc6('0x3a')],squel[_0xccc6('0x3b')]()['field'](_0xccc6('0x20'),'phone')[_0xccc6('0x3c')](_0xccc6('0x3d'),_0xccc6('0x3e'))['field']('id',_0xccc6('0x38'))[_0xccc6('0x3c')](LISTID[_0xccc6('0x3f')](),_0xccc6('0x27'))[_0xccc6('0x3c')](_0x5aba84['id'][_0xccc6('0x3f')](),_0x44030f)[_0xccc6('0x3c')]('NOW()','createdAt')[_0xccc6('0x3c')](_0xccc6('0x3d'),'updatedAt')['from'](_0xccc6('0x41'))[_0xccc6('0x42')](_0xccc6('0x46'))['where'](_0xccc6('0x47'),LISTID['toString']())[_0xccc6('0x42')](_0xccc6('0x48'),squel[_0xccc6('0x49')](hopperContacts))[_0xccc6('0x42')](_0xccc6('0x43'))[_0xccc6('0x42')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xccc6('0x4a'))[_0xccc6('0x40')]('cm_hopper_final')[_0xccc6('0x42')](_0x44030f+_0xccc6('0x45'),_0x5aba84['id'][_0xccc6('0x3f')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xccc6('0x20'))[_0xccc6('0x40')](_0xccc6('0x37'))[_0xccc6('0x42')](_0x44030f+'\x20=\x20?',_0x5aba84['id'][_0xccc6('0x3f')]())))['toString']();return _0x4bf485;};function _0x104b8e(_0x178233,_0x165bdf){var _0x2825e1=squel['insert']()[_0xccc6('0x36')]('cm_hopper')['fromQuery']([_0xccc6('0x20'),_0xccc6('0x3e'),_0xccc6('0x38'),_0xccc6('0x27'),_0x165bdf,_0xccc6('0x39'),_0xccc6('0x3a')],squel['select']()[_0xccc6('0x3c')](_0xccc6('0x20'),_0xccc6('0x20'))[_0xccc6('0x3c')](_0xccc6('0x3d'),'scheduledAt')[_0xccc6('0x3c')]('id',_0xccc6('0x38'))[_0xccc6('0x3c')](LISTID['toString'](),'ListId')['field'](_0x178233['id'][_0xccc6('0x3f')](),_0x165bdf)['field'](_0xccc6('0x3d'),_0xccc6('0x39'))[_0xccc6('0x3c')]('NOW()',_0xccc6('0x3a'))[_0xccc6('0x40')](_0xccc6('0x41'))[_0xccc6('0x42')]('deletedAt\x20IS\x20NULL')[_0xccc6('0x42')]('ListId\x20=\x20?',LISTID[_0xccc6('0x3f')]())[_0xccc6('0x42')](_0xccc6('0x48'),squel[_0xccc6('0x49')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xccc6('0x3f')]();return _0x2825e1;}function _0x3aa3dc(_0x2213dc,_0x2bbf0b){var _0x18d302=squel['insert']()[_0xccc6('0x36')]('cm_hopper_black')[_0xccc6('0x4b')]([_0xccc6('0x20'),'ContactId','ListId',_0x2bbf0b,_0xccc6('0x39'),'updatedAt'],squel['select']()['field'](_0xccc6('0x20'),_0xccc6('0x20'))[_0xccc6('0x3c')]('id','ContactId')['field'](LISTID[_0xccc6('0x3f')](),_0xccc6('0x27'))[_0xccc6('0x3c')](_0x2213dc['id'][_0xccc6('0x3f')](),_0x2bbf0b)[_0xccc6('0x3c')](_0xccc6('0x3d'),_0xccc6('0x39'))[_0xccc6('0x3c')]('NOW()',_0xccc6('0x3a'))[_0xccc6('0x40')](_0xccc6('0x41'))[_0xccc6('0x42')](_0xccc6('0x46'))[_0xccc6('0x42')](_0xccc6('0x47'),LISTID['toString']())[_0xccc6('0x42')](_0xccc6('0x48'),squel['str'](hopperContacts))[_0xccc6('0x42')](_0xccc6('0x43')))[_0xccc6('0x3f')]();return _0x18d302;}return db[_0xccc6('0x4c')]['findAll']({'where':{'type':_0xccc6('0x4d')},'attributes':['id',_0xccc6('0x4e')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x1aa75e){var _0x219142=[];if(_0x1aa75e){var _0x258e16;for(var _0x4d6138=0x0,_0x1e1446;_0x4d6138<_0x1aa75e[_0xccc6('0x1a')];_0x4d6138+=0x1){_0x1e1446=_0x1aa75e[_0x4d6138][_0xccc6('0x4f')]({'plain':!![]});switch(_0x1e1446['dialCheckDuplicateType']){case _0xccc6('0x50'):_0x219142[_0xccc6('0x51')](db['sequelize'][_0xccc6('0x52')](_0x57054b(_0x1e1446,_0xccc6('0x53')))[_0xccc6('0x2d')](function(){})['catch'](_0x470afe()));break;case'onlyIfOpen':_0x219142[_0xccc6('0x51')](db['sequelize'][_0xccc6('0x52')](_0xa43a3e(_0x1e1446,'VoiceQueueId'))['then'](function(){})['catch'](_0x470afe()));break;default:_0x219142['push'](db[_0xccc6('0x54')][_0xccc6('0x52')](_0x104b8e(_0x1e1446,_0xccc6('0x53')))[_0xccc6('0x2d')](function(){})[_0xccc6('0x2f')](_0x470afe()));}}}return _0x219142;})[_0xccc6('0x55')]()[_0xccc6('0x2d')](function(){return db[_0xccc6('0x4c')]['findAll']({'where':{'type':_0xccc6('0x4d')},'attributes':['id'],'include':[{'model':db[_0xccc6('0x56')],'as':_0xccc6('0x57'),'where':{'id':LISTID}}]})[_0xccc6('0x2d')](function(_0x485da4){var _0x3a0dad=[];if(_0x485da4){var _0x1a2ebf;for(var _0x1119e1=0x0,_0x50d8b1;_0x1119e1<_0x485da4[_0xccc6('0x1a')];_0x1119e1+=0x1){_0x50d8b1=_0x485da4[_0x1119e1][_0xccc6('0x4f')]({'plain':!![]});_0x3a0dad[_0xccc6('0x51')](db[_0xccc6('0x54')]['query'](_0x3aa3dc(_0x50d8b1,'VoiceQueueId'))[_0xccc6('0x2d')](function(){})[_0xccc6('0x2f')](_0x470afe()));}}return _0x3a0dad;})[_0xccc6('0x55')]();})[_0xccc6('0x2d')](function(){return db['Campaign']['findAll']({'attributes':['id',_0xccc6('0x4e')],'include':[{'model':db[_0xccc6('0x56')],'as':_0xccc6('0x58'),'where':{'id':LISTID}}]})[_0xccc6('0x2d')](function(_0x37895a){var _0xdb9314=[];if(_0x37895a){for(var _0x2e0c01=0x0,_0x3de040;_0x2e0c01<_0x37895a[_0xccc6('0x1a')];_0x2e0c01+=0x1){_0x3de040=_0x37895a[_0x2e0c01][_0xccc6('0x4f')]({'plain':!![]});switch(_0x3de040[_0xccc6('0x4e')]){case'always':_0xdb9314[_0xccc6('0x51')](db[_0xccc6('0x54')][_0xccc6('0x52')](_0x57054b(_0x3de040,_0xccc6('0x59')))[_0xccc6('0x2d')](function(){})[_0xccc6('0x2f')](_0x470afe()));break;case _0xccc6('0x5a'):_0xdb9314[_0xccc6('0x51')](db[_0xccc6('0x54')][_0xccc6('0x52')](_0xa43a3e(_0x3de040,_0xccc6('0x59')))[_0xccc6('0x2d')](function(){})[_0xccc6('0x2f')](_0x470afe()));break;default:_0xdb9314['push'](db['sequelize'][_0xccc6('0x52')](_0x104b8e(_0x3de040,'CampaignId'))['then'](function(){})[_0xccc6('0x2f')](_0x470afe()));}}}return _0xdb9314;})['all']();})[_0xccc6('0x2d')](function(){return db[_0xccc6('0x5b')][_0xccc6('0x5c')]({'attributes':['id'],'include':[{'model':db[_0xccc6('0x56')],'as':_0xccc6('0x57'),'where':{'id':LISTID}}]})[_0xccc6('0x2d')](function(_0x34e9f3){var _0x35e5a7=[];if(_0x34e9f3){for(var _0x5dd3bf=0x0,_0x1272ed;_0x5dd3bf<_0x34e9f3[_0xccc6('0x1a')];_0x5dd3bf+=0x1){_0x1272ed=_0x34e9f3[_0x5dd3bf][_0xccc6('0x4f')]({'plain':!![]});_0x35e5a7['push'](db[_0xccc6('0x54')][_0xccc6('0x52')](_0x3aa3dc(_0x1272ed,_0xccc6('0x59')))[_0xccc6('0x2d')](function(){})['catch'](_0x470afe()));}}return _0x35e5a7;})[_0xccc6('0x55')]();})[_0xccc6('0x2f')](function(_0x146220){logger[_0xccc6('0x13')]('cmContact,\x20%s,\x20%s',_0xccc6('0x5d'),_0x146220[_0xccc6('0x1c')]);});}var processPromises=function(_0x31a29e){return BPromise['all'](promises)[_0xccc6('0x2d')](function(_0x4b52f1){})[_0xccc6('0x2f')](function(_0x128239){logger[_0xccc6('0x13')](_0xccc6('0x5e'),JSON[_0xccc6('0x31')](_0x128239));})[_0xccc6('0x5f')](function(){socket['emit'](_0xccc6('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x31a29e){return _0x31a29e[_0xccc6('0x61')]();}});};var endCsv=function(){return BPromise[_0xccc6('0x62')]()[_0xccc6('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0xccc6('0x2d')](function(){socket[_0xccc6('0x63')](_0xccc6('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xccc6('0x64')](FILEPATH);}catch(_0x5a488d){logger[_0xccc6('0x13')](_0xccc6('0x65'),JSON[_0xccc6('0x31')](_0x5a488d));}finally{process[_0xccc6('0x66')](0x0);}});};process['on'](_0xccc6('0x67'),function(){logger[_0xccc6('0x68')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xccc6('0x62')]()[_0xccc6('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xccc6('0x2c')][_0xccc6('0x5c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xccc6('0x2d')](function(_0x5a07fe){var _0x4326fb=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x4326fb,{'header':!![],'skipEmptyLines':!![],'step':function(_0x25f8df,_0x36dccd){total+=0x1;var _0x287047=total;promises[_0xccc6('0x51')](checkRow(_0x25f8df,_0x5a07fe,_0x287047)[_0xccc6('0x2d')](function(){success+=0x1;})[_0xccc6('0x2f')](function(_0x3a93fa){if(_0x3a93fa[_0xccc6('0x13')]){errors+=0x1;delete _0x3a93fa[_0xccc6('0x13')];}else if(_0x3a93fa['duplicate']){duplicates+=0x1;delete _0x3a93fa[_0xccc6('0x2a')];}rows[_0xccc6('0x51')](_0x3a93fa);}));if(total%0xc8===0x0){_0x36dccd['pause']();return processPromises(_0x36dccd);}},'complete':function(){return processPromises()[_0xccc6('0x2d')](function(){logger[_0xccc6('0x68')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x5e4d09,_0x5b3eb6){logger[_0xccc6('0x68')](_0xccc6('0x69'),JSON['stringify'](_0x5e4d09));endCsv();}});})['catch'](function(_0xc26a15){logger[_0xccc6('0x13')](_0xccc6('0x6a'),JSON[_0xccc6('0x31')](_0xc26a15));});}main(); \ No newline at end of file +var _0xcafe=['cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','from','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','Lists','get','always','sequelize','query','onlyIfOpen','catch','VoiceQueueId','all','findAll','BlackLists','Campaign','CmList','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','resume','resolve','emit','contact:csv_','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','parse','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','../../../mysqldb','../../../config/environment','api','defaults','redis','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','errors','length','map','message','join','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','stringify','cmContact','checkHopper','insert','into'];(function(_0x174cd6,_0x57f734){var _0xa7c4e9=function(_0x388053){while(--_0x388053){_0x174cd6['push'](_0x174cd6['shift']());}};_0xa7c4e9(++_0x57f734);}(_0xcafe,0x1df));var _0xecaf=function(_0x348d66,_0x5ba207){_0x348d66=_0x348d66-0x0;var _0xa3f877=_0xcafe[_0x348d66];return _0xa3f877;};'use strict';var BPromise=require(_0xecaf('0x0'));var util=require('util');var _=require(_0xecaf('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0xecaf('0x2'))['db'];var config=require(_0xecaf('0x3'));var logger=require('../../../config/logger')(_0xecaf('0x4'));config['redis']=_[_0xecaf('0x5')](config[_0xecaf('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xecaf('0x6')]));require(_0xecaf('0x7'))[_0xecaf('0x8')](socket);try{if(!process[_0xecaf('0x9')][0x2]||process['argv'][0x2]===_0xecaf('0xa')||process[_0xecaf('0x9')][0x2]===_0xecaf('0xb')){throw new Error(_0xecaf('0xc'));}var FILEPATH=process[_0xecaf('0x9')][0x2];if(!process[_0xecaf('0x9')][0x3]||process[_0xecaf('0x9')][0x3]==='undefined'||process['argv'][0x3]===_0xecaf('0xb')||!process[_0xecaf('0x9')][0x4]||process['argv'][0x4]===_0xecaf('0xa')||process[_0xecaf('0x9')][0x4]===_0xecaf('0xb')){throw new Error(_0xecaf('0xd'));}var FIELDS=_[_0xecaf('0xe')](process[_0xecaf('0x9')][0x3]['split'](','),process[_0xecaf('0x9')][0x4][_0xecaf('0xf')](','));if(!process[_0xecaf('0x9')][0x5]||process[_0xecaf('0x9')][0x5]===_0xecaf('0xa')||process[_0xecaf('0x9')][0x5]===_0xecaf('0xb')){throw new Error(_0xecaf('0x10'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xecaf('0x9')][0x6]&&process[_0xecaf('0x9')][0x6]!=='undefined'&&process['argv'][0x6]!=='null'?process[_0xecaf('0x9')][0x6]:null;var DUPLICATES=process[_0xecaf('0x9')][0x7]&&process[_0xecaf('0x9')][0x7]!==_0xecaf('0xa')&&process[_0xecaf('0x9')][0x7]!==_0xecaf('0xb')?process[_0xecaf('0x9')][0x7]:null;if(!process['argv'][0x8]||process[_0xecaf('0x9')][0x8]===_0xecaf('0xa')||process[_0xecaf('0x9')][0x8]===_0xecaf('0xb')){throw new Error(_0xecaf('0x11'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x48f649){logger[_0xecaf('0x12')](_0x48f649);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x15194a,_0x2fd8ff,_0x43bb3f,_0x3c8cd2){var _0x2a3bf4={'message':_0x2fd8ff};_0x2a3bf4[_0x15194a]=!![];if(_0x43bb3f){_0x2a3bf4['contact']=_0x43bb3f;}if(_0x3c8cd2){_0x2a3bf4[_0xecaf('0x13')]=_0x3c8cd2;}return _0x2a3bf4;}function isEmail(_0x2a1f84){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xecaf('0x14')](_0x2a1f84);}function checkRow(_0x1eff37,_0x327087,_0x325f34){return new BPromise(function(_0x37447a,_0x457538){if(_[_0xecaf('0x15')](_0x1eff37)){return _0x457538(handleCheckRowError(_0xecaf('0x12'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x325f34));}if(_0x1eff37['errors']&&_0x1eff37[_0xecaf('0x16')][_0xecaf('0x17')]){var _0x22ff04=_[_0xecaf('0x18')](_0x1eff37['errors'],_0xecaf('0x19'))[_0xecaf('0x1a')](';');return _0x457538(handleCheckRowError('error',_0x22ff04,null,_0x325f34));}var _0xbe1feb={};for(var _0x3efbbd in FIELDS){if(FIELDS['hasOwnProperty'](_0x3efbbd)&&FIELDS[_0x3efbbd]){_0xbe1feb[_0x3efbbd]=_0x1eff37[_0xecaf('0x1b')][0x0][FIELDS[_0x3efbbd]]||_0x1eff37[_0xecaf('0x1b')][0x0]['\ufeff'+FIELDS[_0x3efbbd]];}}if(!_0xbe1feb[_0xecaf('0x1c')]){return _0x457538(handleCheckRowError(_0xecaf('0x12'),'firstName\x20not\x20specified!',null,_0x325f34));}if(!_0xbe1feb[_0xecaf('0x1d')]){return _0x457538(handleCheckRowError(_0xecaf('0x12'),_0xecaf('0x1e'),null,_0x325f34));}if(_0xbe1feb[_0xecaf('0x1f')]){var _0x327807=moment(_0xbe1feb['birthDate'],_0xecaf('0x20'));if(!_0x327807['isValid']()){return _0x457538(handleCheckRowError(_0xecaf('0x12'),_0xecaf('0x21'),null,_0x325f34));}}if(_0xbe1feb[_0xecaf('0x22')]){if(!isEmail(_0xbe1feb[_0xecaf('0x22')])){return _0x457538(handleCheckRowError(_0xecaf('0x12'),'email\x20format\x20is\x20not\x20valid!',null,_0x325f34));}}_0xbe1feb[_0xecaf('0x23')]=LISTID;_0xbe1feb[_0xecaf('0x24')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x327087){var _0x2c3faf={};for(var _0x5eda3a=0x0,_0x135120=DUPLICATES[_0xecaf('0x17')];_0x5eda3a<_0x135120;_0x5eda3a+=0x1){_0x2c3faf[DUPLICATES[_0x5eda3a]]=_0xbe1feb[DUPLICATES[_0x5eda3a]];}var _0x2bb670=_[_0xecaf('0x25')](_0x327087,_0x2c3faf);if(_0x2bb670){return _0x457538(handleCheckRowError(_0xecaf('0x26'),_0xecaf('0x27'),_0x2bb670,_0x325f34));}}return db[_0xecaf('0x28')][_0xecaf('0x29')](_0xbe1feb,{'raw':!![],'hooks':![],'fields':_[_0xecaf('0x2a')](_0xbe1feb)})[_0xecaf('0x2b')](function(_0x42c338){if(DUPLICATES&&DUPLICATES[_0xecaf('0x17')]&&_0x327087){_0x327087[_0xecaf('0x2c')](_[_0xecaf('0x2d')](_0xbe1feb,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x42c338['id'];return _0x37447a();})['catch'](function(_0x2c2f86){return _0x457538(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x2c2f86[_0xecaf('0x19')]||JSON[_0xecaf('0x2e')](_0x2c2f86)),null,_0x325f34));});});}function checkHopper(){function _0x21652b(){return function(_0x2abae0){logger[_0xecaf('0x12')](_0xecaf('0x2f'),_0xecaf('0x30'),util['inspect'](_0x2abae0,{'showHidden':![],'depth':null}));};}var _0x4f269f=function(_0x5af1e6,_0x43a5b6){var _0x42346b=squel[_0xecaf('0x31')]()[_0xecaf('0x32')](_0xecaf('0x33'))[_0xecaf('0x34')]([_0xecaf('0x1d'),_0xecaf('0x35'),_0xecaf('0x36'),_0xecaf('0x23'),_0x43a5b6,_0xecaf('0x37'),_0xecaf('0x38')],squel['select']()[_0xecaf('0x39')](_0xecaf('0x1d'),_0xecaf('0x1d'))[_0xecaf('0x39')](_0xecaf('0x3a'),_0xecaf('0x35'))[_0xecaf('0x39')]('id',_0xecaf('0x36'))[_0xecaf('0x39')](LISTID[_0xecaf('0x3b')](),'ListId')[_0xecaf('0x39')](_0x5af1e6['id'][_0xecaf('0x3b')](),_0x43a5b6)['field'](_0xecaf('0x3a'),'createdAt')[_0xecaf('0x39')]('NOW()','updatedAt')['from'](_0xecaf('0x3c'))[_0xecaf('0x3d')](_0xecaf('0x3e'))[_0xecaf('0x3d')](_0xecaf('0x3f'),LISTID[_0xecaf('0x3b')]())['where'](_0xecaf('0x40'))[_0xecaf('0x3d')](_0xecaf('0x41'),squel[_0xecaf('0x42')]()[_0xecaf('0x39')](_0xecaf('0x1d'))['from'](_0xecaf('0x33'))[_0xecaf('0x3d')](_0x43a5b6+_0xecaf('0x43'),_0x5af1e6['id']['toString']())))[_0xecaf('0x3b')]();return _0x42346b;};var _0xe4d015=function(_0x29fce4,_0x3ab8bb){var _0x273fb3=squel[_0xecaf('0x31')]()[_0xecaf('0x32')](_0xecaf('0x33'))['fromQuery'](['phone',_0xecaf('0x35'),_0xecaf('0x36'),_0xecaf('0x23'),_0x3ab8bb,_0xecaf('0x37'),'updatedAt'],squel[_0xecaf('0x42')]()[_0xecaf('0x39')]('phone','phone')[_0xecaf('0x39')](_0xecaf('0x3a'),'scheduledAt')[_0xecaf('0x39')]('id',_0xecaf('0x36'))[_0xecaf('0x39')](LISTID['toString'](),_0xecaf('0x23'))['field'](_0x29fce4['id'][_0xecaf('0x3b')](),_0x3ab8bb)[_0xecaf('0x39')](_0xecaf('0x3a'),_0xecaf('0x37'))[_0xecaf('0x39')](_0xecaf('0x3a'),'updatedAt')[_0xecaf('0x44')](_0xecaf('0x3c'))['where'](_0xecaf('0x3e'))['where'](_0xecaf('0x3f'),LISTID[_0xecaf('0x3b')]())[_0xecaf('0x3d')](_0xecaf('0x45'),squel[_0xecaf('0x46')](hopperContacts))[_0xecaf('0x3d')](_0xecaf('0x40'))[_0xecaf('0x3d')](_0xecaf('0x41'),squel[_0xecaf('0x42')]()[_0xecaf('0x39')](_0xecaf('0x47'))[_0xecaf('0x44')](_0xecaf('0x48'))[_0xecaf('0x3d')](_0x3ab8bb+_0xecaf('0x43'),_0x29fce4['id'][_0xecaf('0x3b')]()))[_0xecaf('0x3d')](_0xecaf('0x41'),squel[_0xecaf('0x42')]()[_0xecaf('0x39')](_0xecaf('0x1d'))[_0xecaf('0x44')](_0xecaf('0x33'))[_0xecaf('0x3d')](_0x3ab8bb+_0xecaf('0x43'),_0x29fce4['id']['toString']())))['toString']();return _0x273fb3;};function _0x4cc133(_0x2e2f8c,_0x31a641){var _0x553871=squel['insert']()[_0xecaf('0x32')](_0xecaf('0x33'))['fromQuery']([_0xecaf('0x1d'),_0xecaf('0x35'),_0xecaf('0x36'),_0xecaf('0x23'),_0x31a641,_0xecaf('0x37'),_0xecaf('0x38')],squel[_0xecaf('0x42')]()[_0xecaf('0x39')](_0xecaf('0x1d'),_0xecaf('0x1d'))['field'](_0xecaf('0x3a'),_0xecaf('0x35'))[_0xecaf('0x39')]('id','ContactId')['field'](LISTID[_0xecaf('0x3b')](),_0xecaf('0x23'))[_0xecaf('0x39')](_0x2e2f8c['id'][_0xecaf('0x3b')](),_0x31a641)[_0xecaf('0x39')](_0xecaf('0x3a'),_0xecaf('0x37'))[_0xecaf('0x39')](_0xecaf('0x3a'),'updatedAt')[_0xecaf('0x44')](_0xecaf('0x3c'))['where'](_0xecaf('0x3e'))[_0xecaf('0x3d')]('ListId\x20=\x20?',LISTID[_0xecaf('0x3b')]())[_0xecaf('0x3d')]('id\x20IN\x20?',squel[_0xecaf('0x46')](hopperContacts))[_0xecaf('0x3d')](_0xecaf('0x40')))[_0xecaf('0x3b')]();return _0x553871;}function _0x120455(_0x11eb52,_0x3fbe51){var _0x293907=squel[_0xecaf('0x31')]()[_0xecaf('0x32')](_0xecaf('0x49'))[_0xecaf('0x34')]([_0xecaf('0x1d'),_0xecaf('0x36'),_0xecaf('0x23'),_0x3fbe51,'createdAt',_0xecaf('0x38')],squel[_0xecaf('0x42')]()['field'](_0xecaf('0x1d'),_0xecaf('0x1d'))[_0xecaf('0x39')]('id',_0xecaf('0x36'))[_0xecaf('0x39')](LISTID[_0xecaf('0x3b')](),_0xecaf('0x23'))['field'](_0x11eb52['id']['toString'](),_0x3fbe51)[_0xecaf('0x39')](_0xecaf('0x3a'),'createdAt')[_0xecaf('0x39')](_0xecaf('0x3a'),_0xecaf('0x38'))[_0xecaf('0x44')](_0xecaf('0x3c'))['where'](_0xecaf('0x3e'))['where']('ListId\x20=\x20?',LISTID['toString']())[_0xecaf('0x3d')](_0xecaf('0x45'),squel[_0xecaf('0x46')](hopperContacts))[_0xecaf('0x3d')]('phone\x20IS\x20NOT\x20NULL'))[_0xecaf('0x3b')]();return _0x293907;}return db[_0xecaf('0x4a')]['findAll']({'where':{'type':_0xecaf('0x4b')},'attributes':['id',_0xecaf('0x4c')],'include':[{'model':db['CmList'],'as':_0xecaf('0x4d'),'where':{'id':LISTID}}]})[_0xecaf('0x2b')](function(_0x2fdba0){var _0x3d5047=[];if(_0x2fdba0){var _0x4c37d6;for(var _0x414b5b=0x0,_0x22c6cc;_0x414b5b<_0x2fdba0[_0xecaf('0x17')];_0x414b5b+=0x1){_0x22c6cc=_0x2fdba0[_0x414b5b][_0xecaf('0x4e')]({'plain':!![]});switch(_0x22c6cc['dialCheckDuplicateType']){case _0xecaf('0x4f'):_0x3d5047[_0xecaf('0x2c')](db[_0xecaf('0x50')][_0xecaf('0x51')](_0xe4d015(_0x22c6cc,'VoiceQueueId'))[_0xecaf('0x2b')](function(){})['catch'](_0x21652b()));break;case _0xecaf('0x52'):_0x3d5047['push'](db[_0xecaf('0x50')][_0xecaf('0x51')](_0x4f269f(_0x22c6cc,'VoiceQueueId'))[_0xecaf('0x2b')](function(){})[_0xecaf('0x53')](_0x21652b()));break;default:_0x3d5047[_0xecaf('0x2c')](db['sequelize'][_0xecaf('0x51')](_0x4cc133(_0x22c6cc,_0xecaf('0x54')))[_0xecaf('0x2b')](function(){})[_0xecaf('0x53')](_0x21652b()));}}}return _0x3d5047;})[_0xecaf('0x55')]()['then'](function(){return db[_0xecaf('0x4a')][_0xecaf('0x56')]({'where':{'type':_0xecaf('0x4b')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xecaf('0x57'),'where':{'id':LISTID}}]})[_0xecaf('0x2b')](function(_0x5b7378){var _0x5e6887=[];if(_0x5b7378){var _0x3f8e5c;for(var _0x1beb88=0x0,_0x49e53c;_0x1beb88<_0x5b7378[_0xecaf('0x17')];_0x1beb88+=0x1){_0x49e53c=_0x5b7378[_0x1beb88][_0xecaf('0x4e')]({'plain':!![]});_0x5e6887[_0xecaf('0x2c')](db['sequelize'][_0xecaf('0x51')](_0x120455(_0x49e53c,_0xecaf('0x54')))['then'](function(){})[_0xecaf('0x53')](_0x21652b()));}}return _0x5e6887;})[_0xecaf('0x55')]();})['then'](function(){return db[_0xecaf('0x58')][_0xecaf('0x56')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xecaf('0x59')],'as':_0xecaf('0x4d'),'where':{'id':LISTID}}]})[_0xecaf('0x2b')](function(_0xa7b375){var _0x4d49ca=[];if(_0xa7b375){for(var _0x5dbbc2=0x0,_0x28ab56;_0x5dbbc2<_0xa7b375[_0xecaf('0x17')];_0x5dbbc2+=0x1){_0x28ab56=_0xa7b375[_0x5dbbc2]['get']({'plain':!![]});switch(_0x28ab56[_0xecaf('0x4c')]){case _0xecaf('0x4f'):_0x4d49ca[_0xecaf('0x2c')](db[_0xecaf('0x50')]['query'](_0xe4d015(_0x28ab56,_0xecaf('0x5a')))[_0xecaf('0x2b')](function(){})[_0xecaf('0x53')](_0x21652b()));break;case'onlyIfOpen':_0x4d49ca['push'](db[_0xecaf('0x50')][_0xecaf('0x51')](_0x4f269f(_0x28ab56,'CampaignId'))[_0xecaf('0x2b')](function(){})[_0xecaf('0x53')](_0x21652b()));break;default:_0x4d49ca[_0xecaf('0x2c')](db[_0xecaf('0x50')][_0xecaf('0x51')](_0x4cc133(_0x28ab56,_0xecaf('0x5a')))[_0xecaf('0x2b')](function(){})[_0xecaf('0x53')](_0x21652b()));}}}return _0x4d49ca;})[_0xecaf('0x55')]();})[_0xecaf('0x2b')](function(){return db[_0xecaf('0x58')][_0xecaf('0x56')]({'attributes':['id'],'include':[{'model':db[_0xecaf('0x59')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xecaf('0x2b')](function(_0x751557){var _0x2797d2=[];if(_0x751557){for(var _0x3d5fef=0x0,_0x2a47d8;_0x3d5fef<_0x751557[_0xecaf('0x17')];_0x3d5fef+=0x1){_0x2a47d8=_0x751557[_0x3d5fef][_0xecaf('0x4e')]({'plain':!![]});_0x2797d2['push'](db[_0xecaf('0x50')][_0xecaf('0x51')](_0x120455(_0x2a47d8,_0xecaf('0x5a')))['then'](function(){})[_0xecaf('0x53')](_0x21652b()));}}return _0x2797d2;})[_0xecaf('0x55')]();})['catch'](function(_0x2f1aaf){logger['error'](_0xecaf('0x5b'),_0xecaf('0x5c'),_0x2f1aaf[_0xecaf('0x19')]);});}var processPromises=function(_0x5b760b){return BPromise['all'](promises)[_0xecaf('0x2b')](function(_0x345d1c){})[_0xecaf('0x53')](function(_0x363d31){logger[_0xecaf('0x12')]('Error\x20processing\x20rows\x20block:',JSON[_0xecaf('0x2e')](_0x363d31));})['finally'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5b760b){return _0x5b760b[_0xecaf('0x5d')]();}});};var endCsv=function(){return BPromise[_0xecaf('0x5e')]()[_0xecaf('0x2b')](function(){if(hopperContacts){return checkHopper();}})[_0xecaf('0x2b')](function(){socket[_0xecaf('0x5f')](_0xecaf('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xecaf('0x61')](FILEPATH);}catch(_0x32f693){logger[_0xecaf('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xecaf('0x2e')](_0x32f693));}finally{process[_0xecaf('0x62')](0x0);}});};process['on'](_0xecaf('0x63'),function(){logger[_0xecaf('0x64')](_0xecaf('0x65'));endCsv();});function main(){return BPromise[_0xecaf('0x5e')]()[_0xecaf('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xecaf('0xf')](',');return db[_0xecaf('0x28')][_0xecaf('0x56')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x10ef12){var _0x1b5571=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xecaf('0x66')](_0x1b5571,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3c869c,_0x3eee24){total+=0x1;var _0x1289a4=total;promises['push'](checkRow(_0x3c869c,_0x10ef12,_0x1289a4)[_0xecaf('0x2b')](function(){success+=0x1;})['catch'](function(_0xc4f153){if(_0xc4f153['error']){errors+=0x1;delete _0xc4f153[_0xecaf('0x12')];}else if(_0xc4f153[_0xecaf('0x26')]){duplicates+=0x1;delete _0xc4f153[_0xecaf('0x26')];}rows[_0xecaf('0x2c')](_0xc4f153);}));if(total%0xc8===0x0){_0x3eee24[_0xecaf('0x67')]();return processPromises(_0x3eee24);}},'complete':function(){return processPromises()[_0xecaf('0x2b')](function(){logger[_0xecaf('0x64')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x168ec1,_0x4f2baa){logger[_0xecaf('0x64')](_0xecaf('0x68'),JSON[_0xecaf('0x2e')](_0x168ec1));endCsv();}});})[_0xecaf('0x53')](function(_0x386225){logger[_0xecaf('0x12')](_0xecaf('0x69'),JSON[_0xecaf('0x2e')](_0x386225));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index c994b31..f06d9f9 100644 --- a/server/components/import/cm/csv2.js +++ b/server/components/import/cm/csv2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5beb=['where','\x20=\x20','findAll','length','all','then','AdditionalPhones','push','split','isNil','filter','findOne','update','updated','PHONE','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','recallme','select','fields','join','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.updatedAt','cm_hopper_black','.CmListId','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','into','priority','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','keys','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','message','exit','code','sequelize','query','spread','catch','campaigns_has_cm_lists','error','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','utcOffset','set','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','header','ContactItemType','name','_description','parse','createReadStream','rows','errors','data','find','trim','replace','isValid','UserId','isNumber','includes','agent\x20not\x20exists','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','hasOwnProperty','description','SystemRow','appendFileSync','emit','Abort\x20parser','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactTypeId','orderBy','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x5beb,0x9d));var _0xb5be=function(_0x529867,_0x2131bf){_0x529867=_0x529867-0x0;var _0x3b021c=_0x5beb[_0x529867];return _0x3b021c;};'use strict';var fs=require('fs');var path=require(_0xb5be('0x0'));var _=require(_0xb5be('0x1'));var Papa=require(_0xb5be('0x2'));var util=require(_0xb5be('0x3'));var BPromise=require(_0xb5be('0x4'));var moment=require(_0xb5be('0x5'));var squel=require(_0xb5be('0x6'));var Redis=require(_0xb5be('0x7'));var db=require(_0xb5be('0x8'))['db'];var config=require(_0xb5be('0x9'));var shared=require(_0xb5be('0xa'));var logger=require(_0xb5be('0xb'))(_0xb5be('0xc'));config['redis']=_[_0xb5be('0xd')](config[_0xb5be('0xe')],{'host':_0xb5be('0xf'),'port':0x18eb});var socket=require(_0xb5be('0x10'))(new Redis(config[_0xb5be('0xe')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xb5be('0x11')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0xb5be('0x12'));function isEmail(_0x4bc095){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xb5be('0x13')](_0x4bc095);}function selectNotIn(_0x381dfa,_0x560d29,_0x59133d,_0x566bc9,_0xbc012e){return squel['select']()[_0xb5be('0x14')](_0xb5be('0x15'))[_0xb5be('0x16')](_0x566bc9)['join'](_0x560d29,null,_0x560d29+'.id\x20=\x20'+_0x566bc9+'.'+_0x59133d)[_0xb5be('0x17')](_0x566bc9+'.'+_0x59133d+_0xb5be('0x18')+_0x381dfa+'.'+_0x59133d)[_0xb5be('0x17')](_0x560d29+'.dialCheckDuplicateType\x20IN\x20('+_0xbc012e['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x2ae0ce,_0x47e6c4){promisesAdditionalPhones=[];return db['CmContact'][_0xb5be('0x19')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x37f2d8){if(_0x37f2d8!==null){var _0x53af2a=[];for(var _0x53d50a=0x0;_0x53d50a<_0x37f2d8[_0xb5be('0x1a')];_0x53d50a++){var _0x287c90=_0x37f2d8[_0x53d50a];_0x53af2a['push'](insertAdditionalPhones(_0x287c90));}}Promise[_0xb5be('0x1b')](_0x53af2a)[_0xb5be('0x1c')](function(){_0x2ae0ce({'val':0x1});});});});}function insertAdditionalPhones(_0x5dd826){return new Promise(function(_0x23f31d,_0x3b137c){var _0xeeae6c=_0x5dd826[_0xb5be('0x1d')];var _0x5cddd2=_0xeeae6c['split'](';');var _0x51aec9=[];orderBy=0x0;for(var _0x5ace49=0x0;_0x5ace49<_0x5cddd2[_0xb5be('0x1a')];_0x5ace49++){_0x51aec9[_0xb5be('0x1e')](splitAdditionalPhone(_0x5dd826['id'],_0x5cddd2[_0x5ace49]));}Promise[_0xb5be('0x1b')](_0x51aec9)['then'](function(){_0x23f31d({'val':_0x5cddd2[_0xb5be('0x1a')]});});});}function splitAdditionalPhone(_0x43c1c4,_0xcd87eb){return new Promise(function(_0x5960de,_0x5a01bc){var _0x5e5428=_0xcd87eb[_0xb5be('0x1f')](':');var _0x2db909=_0x5e5428[0x0];var _0x3a45b4=_0x5e5428[0x1];if(!_[_0xb5be('0x20')](_0x3a45b4)){var _0x314b59=_0x3a45b4['split']('|');var _0x32a545=[];for(var _0x2bc7b4=0x0;_0x2bc7b4<_0x314b59[_0xb5be('0x1a')];_0x2bc7b4++){if(_0x314b59[_0x2bc7b4]!==''){var _0x120962=_[_0xb5be('0x21')](promisesAdditionalPhones,{'contactId':_0x43c1c4,'phone':_0x314b59[_0x2bc7b4]});if(_0x120962[_0xb5be('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0xb5be('0x1e')]({'contactId':_0x43c1c4,'contactTypeId':_0x2db909,'phone':_0x314b59[_0x2bc7b4],'orderBy':orderBy});}}}_0x5960de({'ok':0x1});}else _0x5960de({'res':0x0});});}function createAdditionalPhone(_0x42a505,_0x2a78e4,_0x30a06c,_0x3154bf){var _0x32bdc7='';var _0x3ed0df='';var _0x553fe6=_0x30a06c[_0xb5be('0x1f')]('§');_0x32bdc7=_0x553fe6[0x0];if(_0x553fe6[_0xb5be('0x1a')]==0x2)_0x3ed0df=_0x553fe6[0x1];return new Promise(function(_0x5f1acd,_0x41607a){return db['CmContactHasItem'][_0xb5be('0x22')]({'where':{'CmContactId':_0x42a505,'item':_0x32bdc7}})[_0xb5be('0x1c')](function(_0x338430){if(_0x338430){return db['CmContactHasItem'][_0xb5be('0x23')]({'ItemTypeId':_0x2a78e4,'description':_0x3ed0df,'OrderBy':_0x3154bf},{'where':{'CmContactId':_0x42a505,'item':_0x32bdc7}})[_0xb5be('0x1c')](function(_0x28081b){_0x5f1acd({'res':_0xb5be('0x24')});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0x42a505,'item':_0x32bdc7,'description':_0x3ed0df,'ItemTypeId':_0x2a78e4,'OrderBy':_0x3154bf,'ItemClass':_0xb5be('0x25')})[_0xb5be('0x1c')](function(_0x2eb2b7){_0x5f1acd({'res':_0xb5be('0x26')});});}});});}function insertCmHopper(_0x3f0cc7,_0x2ec6bb,_0x275552,_0xef4eb6,_0x149940){var _0x50db55=[_0xb5be('0x27'),'cm_contacts.scheduledat',_0xb5be('0x28'),_0xb5be('0x29'),_0x2ec6bb+'.'+_0xef4eb6,_0xb5be('0x2a'),'cm_contacts.updatedAt',_0xb5be('0x2b'),_0xb5be('0x2c'),'\x22'+_0x149940+'\x22'];return squel[_0xb5be('0x2d')]()['into'](_0xb5be('0x2e'))[_0xb5be('0x2f')]([_0xb5be('0x15'),_0xb5be('0x30'),_0xb5be('0x31'),_0xb5be('0x32'),_0xef4eb6,_0xb5be('0x33'),_0xb5be('0x34'),'priority','UserId',_0xb5be('0x35')],squel[_0xb5be('0x36')]()[_0xb5be('0x37')](_0x50db55)[_0xb5be('0x16')](_0x2ec6bb)[_0xb5be('0x38')](_0xb5be('0x39'),null,_0xb5be('0x3a')+_0x2ec6bb+'.CmListId')[_0xb5be('0x38')](_0x275552,null,_0x275552+_0xb5be('0x3b')+_0x2ec6bb+'.'+_0xef4eb6)['where'](_0x2ec6bb+_0xb5be('0x3c'),_0x3f0cc7)[_0xb5be('0x17')](_0xb5be('0x3d'),NOW)[_0xb5be('0x17')](_0xb5be('0x3e'),selectNotIn(_0x2ec6bb,_0x275552,_0xef4eb6,_0xb5be('0x2e'),[_0xb5be('0x3f'),_0xb5be('0x40')]))['where'](_0xb5be('0x3e'),selectNotIn(_0x2ec6bb,_0x275552,_0xef4eb6,_0xb5be('0x2e'),['\x22always\x22'])))[_0xb5be('0x41')]();}function insertCmHopperBlack(_0x2dfb04,_0x4ddda6,_0x5ddbf7,_0x48f3a2){var _0x1d47e3=[_0xb5be('0x27'),_0xb5be('0x28'),_0xb5be('0x29'),_0x4ddda6+'.'+_0x48f3a2,'cm_contacts.createdAt',_0xb5be('0x42')];return squel[_0xb5be('0x2d')]()['into'](_0xb5be('0x43'))[_0xb5be('0x2f')](['phone',_0xb5be('0x31'),_0xb5be('0x32'),_0x48f3a2,_0xb5be('0x33'),'updatedAt'],squel[_0xb5be('0x36')]()[_0xb5be('0x37')](_0x1d47e3)[_0xb5be('0x16')](_0x4ddda6)['join'](_0xb5be('0x39'),null,_0xb5be('0x3a')+_0x4ddda6+_0xb5be('0x44'))[_0xb5be('0x38')](_0x5ddbf7,null,_0x5ddbf7+'.id\x20=\x20'+_0x4ddda6+'.'+_0x48f3a2)[_0xb5be('0x17')](_0x4ddda6+'.CmListId\x20=\x20?',_0x2dfb04)[_0xb5be('0x17')](_0xb5be('0x3d'),NOW)['where'](_0xb5be('0x3e'),squel[_0xb5be('0x36')]()[_0xb5be('0x14')](_0xb5be('0x15'))['from']('cm_hopper_black')[_0xb5be('0x17')]('ListId\x20=\x20?',_0x2dfb04)[_0xb5be('0x17')](_0x48f3a2+_0xb5be('0x18')+_0x4ddda6+'.'+_0x48f3a2)))[_0xb5be('0x41')]();}function insertTzCmHopper(_0x8fcfdd,_0x49ff0d,_0x2f1b57,_0x31cf96,_0x2a192c,_0xab4dc){var _0x5043c4=['cm_contacts.phone',_0xb5be('0x45')+_0xab4dc+_0xb5be('0x46'),_0xb5be('0x28'),_0xb5be('0x29'),_0x49ff0d+'.'+_0x31cf96,_0xb5be('0x2a'),_0xb5be('0x42'),_0xb5be('0x2b'),_0xb5be('0x2c'),'\x22'+_0x2a192c+'\x22'];var _0x4f07c8=squel[_0xb5be('0x2d')]()[_0xb5be('0x47')](_0xb5be('0x2e'))['fromQuery'](['phone','scheduledat',_0xb5be('0x31'),_0xb5be('0x32'),_0x31cf96,_0xb5be('0x33'),_0xb5be('0x34'),_0xb5be('0x48'),'UserId',_0xb5be('0x35')],squel['select']()['fields'](_0x5043c4)[_0xb5be('0x16')](_0x49ff0d)['join'](_0xb5be('0x39'),null,_0xb5be('0x3a')+_0x49ff0d+_0xb5be('0x44'))[_0xb5be('0x38')](_0x2f1b57,null,_0x2f1b57+_0xb5be('0x3b')+_0x49ff0d+'.'+_0x31cf96)[_0xb5be('0x38')](_0xab4dc,null,_0xab4dc+_0xb5be('0x3b')+_0x49ff0d+'.'+_0x31cf96)[_0xb5be('0x17')](_0x49ff0d+_0xb5be('0x3c'),_0x8fcfdd)[_0xb5be('0x17')](_0xb5be('0x3d'),NOW)[_0xb5be('0x17')](_0xb5be('0x3e'),selectNotIn(_0x49ff0d,_0x2f1b57,_0x31cf96,_0xb5be('0x2e'),['\x22always\x22',_0xb5be('0x40')]))[_0xb5be('0x17')](_0xb5be('0x3e'),selectNotIn(_0x49ff0d,_0x2f1b57,_0x31cf96,'cm_hopper',[_0xb5be('0x3f')])))[_0xb5be('0x41')]();return _0x4f07c8;}function insertTzCmHopperBlack(_0x3d130f,_0xb2e70d,_0x1e9efe,_0x25911d){var _0x598b88=['cm_contacts.phone',_0xb5be('0x28'),_0xb5be('0x29'),_0xb2e70d+'.'+_0x25911d,_0xb5be('0x2a'),_0xb5be('0x42')];return squel[_0xb5be('0x2d')]()[_0xb5be('0x47')]('cm_hopper_black')[_0xb5be('0x2f')]([_0xb5be('0x15'),_0xb5be('0x31'),_0xb5be('0x32'),_0x25911d,_0xb5be('0x33'),_0xb5be('0x34')],squel[_0xb5be('0x36')]()[_0xb5be('0x37')](_0x598b88)[_0xb5be('0x16')](_0xb2e70d)[_0xb5be('0x38')]('cm_contacts',null,_0xb5be('0x3a')+_0xb2e70d+_0xb5be('0x44'))['join'](_0x1e9efe,null,_0x1e9efe+'.id\x20=\x20'+_0xb2e70d+'.'+_0x25911d)['where'](_0xb2e70d+_0xb5be('0x3c'),_0x3d130f)[_0xb5be('0x17')](_0xb5be('0x3d'),NOW)[_0xb5be('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xb5be('0x36')]()[_0xb5be('0x14')](_0xb5be('0x15'))['from'](_0xb5be('0x43'))['where'](_0xb5be('0x49'),_0x3d130f)['where'](_0x25911d+_0xb5be('0x18')+_0xb2e70d+'.'+_0x25911d)))[_0xb5be('0x41')]();}function insertCmHopperAdditionalPhones(_0x1ea659){var _0x41497c=[_0xb5be('0x4a'),_0xb5be('0x4b'),_0xb5be('0x4c'),'cm_contact_has_items.createdAt',_0xb5be('0x4d')];return squel['insert']()[_0xb5be('0x47')](_0xb5be('0x4e'))[_0xb5be('0x2f')]([_0xb5be('0x4f'),'phone',_0xb5be('0x50'),_0xb5be('0x33'),_0xb5be('0x34')],squel[_0xb5be('0x36')]()[_0xb5be('0x37')](_0x41497c)[_0xb5be('0x16')]('cm_hopper')[_0xb5be('0x38')](_0xb5be('0x39'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xb5be('0x38')]('cm_contact_has_items',null,_0xb5be('0x51'))[_0xb5be('0x17')]('cm_hopper.ListId\x20=\x20?',_0x1ea659)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0xb5be('0x41')]();}function insertCmContact(_0x5b57db,_0x58d205,_0xf3dee9,_0x14d0ff){var _0x87c96f=_['concat'](_[_0xb5be('0x52')](_0x14d0ff),[_0xb5be('0x32'),_0xb5be('0x53'),'createdAt','updatedAt',_0xb5be('0x54')]);return squel[_0xb5be('0x2d')]()[_0xb5be('0x47')](_0xb5be('0x39'))[_0xb5be('0x2f')](_0x87c96f,squel['select']()[_0xb5be('0x37')](_0x87c96f)[_0xb5be('0x16')](_0x58d205)[_0xb5be('0x17')]('('+_0xf3dee9[_0xb5be('0x38')](',')+_0xb5be('0x55'),squel[_0xb5be('0x36')]()['fields'](_0xf3dee9)['from']('cm_contacts')['where'](_0xb5be('0x49'),_0x5b57db)[_0xb5be('0x17')](_0xb5be('0x56')))[_0xb5be('0x17')](_0xb5be('0x57'),squel['select']()['field']('MIN(id)',_0xb5be('0x58'))['from'](_0x58d205)[_0xb5be('0x59')](_0xf3dee9[_0xb5be('0x38')](','))))['toString']();}function handleStop(){logger[_0xb5be('0x5a')](_0xb5be('0x5b'));stopped=!![];}function handleUncaughtException(_0x336671){logger['error'](_0x336671[_0xb5be('0x5c')]);process[_0xb5be('0x5d')](0x1);}function handleError(_0x1880a6,_0x502d45){stats['errors']['push']({'name':_0x502d45[_0xb5be('0x5e')],'message':_0x502d45[_0xb5be('0x5c')],'row':_0x1880a6});}function handleQuery(_0xd06588){logger[_0xb5be('0x5a')](_0xd06588);return db[_0xb5be('0x5f')][_0xb5be('0x60')](_0xd06588)[_0xb5be('0x61')](function(_0x3e7312){results[_0xb5be('0x1e')](_0x3e7312);})[_0xb5be('0x62')](function(_0x362a73){logger['error'](_0x362a73['message']);});}function updateTzCampaigns(_0x58e7e3){return new Promise(function(_0xb0115a,_0x128d68){var _0x2e1cd4=squel[_0xb5be('0x36')]()[_0xb5be('0x37')](['campaigns.id','campaigns.dialTimezone'])[_0xb5be('0x16')]('campaigns')['join'](_0xb5be('0x63'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0xb5be('0x17')]('campaigns_has_cm_lists.CmListId='+_0x58e7e3);db[_0xb5be('0x5f')][_0xb5be('0x60')](_0x2e1cd4['toString']())['spread'](function(_0x1ad423){var _0x1bf914=[];for(var _0x603058=0x0;_0x603058<_0x1ad423['length'];_0x603058++){_0x1bf914[_0xb5be('0x1e')](getTimezoneData(_0x1ad423[_0x603058],tmp_campaigns));}BPromise['all'](_0x1bf914)[_0xb5be('0x1c')](function(){_0xb0115a({'val':0x1});});})[_0xb5be('0x62')](function(_0x573cab){logger[_0xb5be('0x64')](_0x573cab[_0xb5be('0x5c')]);_0xb0115a({'val':0x0});});});}function updateTzVoiceQueues(_0xce3586){return new Promise(function(_0x32b006,_0x4ecc7a){var _0x289750=squel[_0xb5be('0x36')]()[_0xb5be('0x37')](['voice_queues.id',_0xb5be('0x65')])[_0xb5be('0x16')](_0xb5be('0x66'))[_0xb5be('0x38')](_0xb5be('0x67'),null,_0xb5be('0x68'))[_0xb5be('0x17')](_0xb5be('0x69')+_0xce3586);db['sequelize']['query'](_0x289750[_0xb5be('0x41')]())['spread'](function(_0x53ba8f){var _0x33471d=[];for(var _0x3e84dd=0x0;_0x3e84dd<_0x53ba8f[_0xb5be('0x1a')];_0x3e84dd++){_0x33471d[_0xb5be('0x1e')](getTimezoneData(_0x53ba8f[_0x3e84dd],tmp_voice_queues));}BPromise[_0xb5be('0x1b')](_0x33471d)[_0xb5be('0x1c')](function(){_0x32b006({'val':0x1});});})['catch'](function(_0x1a6f39){logger[_0xb5be('0x64')](_0x1a6f39['message']);_0x32b006({'val':0x0});});});}function getTimezoneData(_0x9aec10,_0x39526a){return new Promise(function(_0x48bf28,_0x60e3c6){var _0x303a90=shared['timezones'];var _0xb0555c=_0x303a90[_0x9aec10[_0xb5be('0x6a')]];if(_[_0xb5be('0x20')](_0xb0555c)){_0x48bf28({'ret':0x1});}else{var _0x1dfae8=_0xb0555c[_0xb5be('0x6b')];var _0x24708e=squel[_0xb5be('0x2d')]()[_0xb5be('0x47')](_0x39526a)[_0xb5be('0x6c')]('id',_0x9aec10['id'])[_0xb5be('0x6c')]('offset',_0x1dfae8)[_0xb5be('0x6c')](_0xb5be('0x6a'),_0x9aec10['dialTimezone'])[_0xb5be('0x41')]();return db[_0xb5be('0x5f')][_0xb5be('0x60')](_0x24708e)['spread'](function(_0x566648){_0x48bf28({'ret':0x1});})[_0xb5be('0x62')](function(_0x29534c){logger[_0xb5be('0x64')](_0x29534c[_0xb5be('0x5c')]);_0x60e3c6({'ret':0x1});});}});}function handleTZQuery(_0x2d3b88){logger[_0xb5be('0x5a')](_0x2d3b88);return db['sequelize'][_0xb5be('0x60')](_0x2d3b88)[_0xb5be('0x61')](function(_0xfe1380){})[_0xb5be('0x62')](function(_0x5bb7d9){logger['error'](_0x5bb7d9[_0xb5be('0x5c')]);});}function main(_0x21cd5b,_0x31dc3c,_0x56fb9c,_0x25b6dd){logger[_0xb5be('0x5a')](_0xb5be('0x6d'),_0x21cd5b,JSON[_0xb5be('0x6e')](_0x31dc3c));process[_0xb5be('0x6f')](_0xb5be('0x70'));var _0x5dbeb1=_0x31dc3c[_0xb5be('0x71')];var _0x5984a2=_['clone'](_0x5dbeb1);var _0x25b501=_0x31dc3c[_0xb5be('0x72')];var _0x30ba2a=path[_0xb5be('0x38')](config[_0xb5be('0x73')],_0xb5be('0x74'),_0x25b501+_0xb5be('0x75'));hasTZ=_[_0xb5be('0x52')](_0x5dbeb1)['includes'](_0xb5be('0x6a'));var _0x50e8d8=_[_0xb5be('0x52')](_0x5dbeb1)[_0xb5be('0x38')]();logger[_0xb5be('0x5a')](_0xb5be('0x76'),_0x50e8d8);db[_0xb5be('0x77')]['findAll']({'raw':!![],'attributes':['id',_0xb5be('0x78')]})[_0xb5be('0x1c')](function(_0x35b369){for(var _0x247775=0x0;_0x247775<_0x35b369[_0xb5be('0x1a')];_0x247775++){if(_0x35b369[_0x247775]['name']in _0x5dbeb1){contactItemTypes[_0xb5be('0x1e')](_0x35b369[_0x247775]);delete _0x5984a2[_0x35b369[_0x247775][_0xb5be('0x78')]];hasAdditionalPhones=!![];}for(var _0x245519 in _0x5dbeb1){if(_0x35b369[_0x247775]['name']+_0xb5be('0x79')===_0x245519){phoneDescriptions[_0xb5be('0x1e')]({'itemTypeId':_0x35b369[_0x247775]['id'],'description':_0x245519});delete _0x5984a2[_0x245519];}}}if(hasAdditionalPhones)_0x5984a2[_0xb5be('0x1d')]='';var _0x1d9f7d=_[_0xb5be('0x52')](_0x5984a2)['join']();logger[_0xb5be('0x5a')]('header',_0x1d9f7d);fs['writeFileSync'](_0x30ba2a,_0x1d9f7d+'\x0a');Papa[_0xb5be('0x7a')](fs[_0xb5be('0x7b')](_0x21cd5b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x56adb6,_0x15be38){try{for(var _0x3a0f20=0x0,_0x19cf20=[];_0x3a0f20<_0x56adb6['data']['length'];_0x3a0f20++){stats[_0xb5be('0x7c')]+=0x1;if(_0x56adb6[_0xb5be('0x7d')][_0x3a0f20]){handleError(_0x56adb6[_0xb5be('0x7e')][_0x3a0f20],_0x56adb6[_0xb5be('0x7d')][_0x3a0f20]);}else{var _0x27b329=[];var _0x5a6690=[];var _0xaf5a58={};for(var _0x5d0407 in _0x5dbeb1){let _0x59724b=contactItemTypes['find'](_0x3fc00d=>_0x3fc00d[_0xb5be('0x78')]===_0x5d0407);let _0x289124=contactItemTypes[_0xb5be('0x7f')](_0x35a3e6=>_0x35a3e6[_0xb5be('0x78')]+_0xb5be('0x79')===_0x5d0407);if(_[_0xb5be('0x20')](_0x59724b)&&_[_0xb5be('0x20')](_0x289124)){if(_0x5dbeb1['hasOwnProperty'](_0x5d0407)){if(_0x56adb6['data'][_0x3a0f20][_0x5dbeb1[_0x5d0407]]){var _0x5ca0f8=_[_0xb5be('0x80')](_0x56adb6[_0xb5be('0x7e')][_0x3a0f20][_0x5dbeb1[_0x5d0407]][_0xb5be('0x81')](/"/g,'\x27'));switch(_0x5d0407){case _0xb5be('0x30'):var _0x40005c=moment(_0x5ca0f8,_0xb5be('0x12'),!![]);if(_0x40005c[_0xb5be('0x82')]()){_0x19cf20['push']('\x22'+_0x5ca0f8+'\x22');}else{_0x27b329[_0xb5be('0x1e')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xb5be('0x48'):var _0x47142b=parseInt(_0x5ca0f8);_0x5ca0f8=_['isNaN'](_0x47142b)||_0x47142b<0x0||_0x47142b>0x4?_0x25b6dd?0x3:0x2:_0x47142b;_0x19cf20[_0xb5be('0x1e')]('\x22'+_0x5ca0f8+'\x22');break;case _0xb5be('0x83'):var _0x3b57a1=parseInt(_0x5ca0f8);if(_[_0xb5be('0x84')](_0x3b57a1)&&_[_0xb5be('0x85')](_0x56fb9c,_0x3b57a1)){_0x19cf20[_0xb5be('0x1e')]('\x22'+_0x3b57a1+'\x22');}else{_0x27b329[_0xb5be('0x1e')](_0xb5be('0x86'));}break;case'email':if(isEmail(_0x5ca0f8)){_0x19cf20[_0xb5be('0x1e')]('\x22'+_0x5ca0f8+'\x22');}else{_0x27b329[_0xb5be('0x1e')]('email\x20wrong\x20format');}break;case _0xb5be('0x87'):var _0x592e0e=moment(_0x5ca0f8,'YYYY-MM-DD',!![]);if(_0x592e0e[_0xb5be('0x82')]()){_0x19cf20[_0xb5be('0x1e')]('\x22'+_0x5ca0f8+'\x22');}else{_0x27b329[_0xb5be('0x1e')](_0xb5be('0x88'));}break;case'dialTimezone':var _0x638a7e=shared['timezones'];var _0x59285e=_0x638a7e[_0x5ca0f8];if(!_[_0xb5be('0x20')](_0x59285e)){var _0x38bea4=_0x59285e[_0xb5be('0x6b')];_0x19cf20['push']('\x22'+_0x5ca0f8+'\x22');_0x19cf20[_0xb5be('0x1e')]('\x22'+_0x38bea4+'\x22');}break;default:_0x19cf20[_0xb5be('0x1e')]('\x22'+_0x5ca0f8+'\x22');}}else{switch(_0x5d0407){case _0xb5be('0x89'):case _0xb5be('0x15'):_0x27b329[_0xb5be('0x1e')](_0x5d0407+'\x20not\x20specified');break;default:_0x19cf20[_0xb5be('0x1e')]('\x22\x22');}}}}else{var _0x1134bf='';if(!_[_0xb5be('0x20')](_0x59724b)){if(!_0xaf5a58[_0xb5be('0x8a')](_0x59724b['id'])){if(!_[_0xb5be('0x20')](_0x56adb6[_0xb5be('0x7e')][_0x3a0f20][_0x5dbeb1[_0x5d0407]])){var _0x5ca0f8=_[_0xb5be('0x80')](_0x56adb6[_0xb5be('0x7e')][_0x3a0f20][_0x5dbeb1[_0x5d0407]]['replace'](/"/g,'\x27'));var _0x3e8654=phoneDescriptions[_0xb5be('0x7f')](_0x55ee27=>_0x55ee27['itemTypeId']===_0x59724b['id']);if(!_['isNil'](_0x3e8654)){var _0x28ae56=_[_0xb5be('0x80')](_0x56adb6[_0xb5be('0x7e')][_0x3a0f20][_0x5dbeb1[_0x3e8654[_0xb5be('0x8b')]]][_0xb5be('0x81')](/"/g,'\x27'));if(!_[_0xb5be('0x20')](_0x28ae56))_0x5ca0f8=_0x5ca0f8+'§'+_0x28ae56;}if(_0x1134bf=='')_0x1134bf=_0x5ca0f8;else _0x1134bf+='|'+_0x5ca0f8;}_0x5a6690[_0xb5be('0x1e')](_0x59724b['id']+':'+_0x1134bf);_0xaf5a58[_0x59724b['id']]=0x1;}}}}if(hasAdditionalPhones){_0x19cf20[_0xb5be('0x1e')]('\x22'+_0x5a6690['join'](';')+'\x22');}if(_0x27b329[_0xb5be('0x1a')]){handleError(_0x56adb6['data'][_0x3a0f20],{'code':_0xb5be('0x8c'),'message':_0x27b329[_0xb5be('0x38')]()});}else{fs[_0xb5be('0x8d')](_0x30ba2a,_0x19cf20[_0xb5be('0x38')]()+'\x0a');}_0x19cf20=[];}if(!(stats[_0xb5be('0x7c')]%0xc8)){socket[_0xb5be('0x8e')]('contact:import:'+_0x25b501,stats);stats[_0xb5be('0x7d')]=[];}}if(stopped){logger['info'](_0xb5be('0x8f'));_0x15be38[_0xb5be('0x90')]();}}catch(_0x28ae0c){handleError(_0x56adb6[_0xb5be('0x7e')][_0x3a0f20],{'code':'SystemError','message':_0x28ae0c[_0xb5be('0x5c')]});logger[_0xb5be('0x64')](_0xb5be('0x91'),_0x28ae0c[_0xb5be('0x5c')]);}},'complete':function(){try{var _0x1e6747=[];var _0x1314f5=[];var _0x4ae087=_0xb5be('0x39');if(_0x31dc3c[_0xb5be('0x92')]&&_0x31dc3c[_0xb5be('0x92')]['length']){_0x4ae087=_0xb5be('0x93')+_0x25b501;_0x1e6747[_0xb5be('0x1e')](_0xb5be('0x94')+_0x4ae087+_0xb5be('0x95'));}tmp_campaigns=_0xb5be('0x96')+_0x25b501;tmp_voice_queues=_0xb5be('0x97')+_0x25b501;_0x1314f5['push'](_0xb5be('0x94')+tmp_campaigns+_0xb5be('0x98'));_0x1314f5[_0xb5be('0x1e')](_0xb5be('0x94')+tmp_voice_queues+_0xb5be('0x98'));BPromise[_0xb5be('0x99')](_0x1314f5,handleTZQuery)[_0xb5be('0x1c')](function(_0x2e68da){updateTzCampaigns(_0x31dc3c['ListId'])[_0xb5be('0x1c')](function(_0x20a930){updateTzVoiceQueues(_0x31dc3c[_0xb5be('0x32')])['then'](function(_0x4adfff){if(hasTZ)_0x1d9f7d=_0x1d9f7d['replace'](_0xb5be('0x6a'),_0xb5be('0x9a'));var _0x348095=util[_0xb5be('0x11')](_0xb5be('0x9b'),_0x30ba2a,_0x4ae087,_0x1d9f7d,_0x31dc3c[_0xb5be('0x32')],_0x31dc3c[_0xb5be('0x53')]||null,NOW,NOW);if(_[_0xb5be('0x20')](_0x5dbeb1[_0xb5be('0x30')])){_0x348095+=_0xb5be('0x9c');}_0x1e6747[_0xb5be('0x1e')](_0x348095);if(_0x31dc3c['duplicates']&&_0x31dc3c[_0xb5be('0x92')][_0xb5be('0x1a')]){_0x1e6747[_0xb5be('0x1e')](insertCmContact(_0x31dc3c[_0xb5be('0x32')],_0x4ae087,_0x31dc3c[_0xb5be('0x92')],_0x5dbeb1));_0x1e6747['push'](_0xb5be('0x9d')+_0x4ae087+';');}BPromise['each'](_0x1e6747,handleQuery)[_0xb5be('0x1c')](function(_0x587bfd){BPromise[_0xb5be('0x1b')]([handleAdditionalPhones()])[_0xb5be('0x1c')](function(){_0x1e6747=[];for(var _0x434368=0x0;_0x434368\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','binding','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','lodash','papaparse','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','localhost','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','length','push','all','split','isNil'];(function(_0x3af039,_0x28d762){var _0x19aa9f=function(_0x375d26){while(--_0x375d26){_0x3af039['push'](_0x3af039['shift']());}};_0x19aa9f(++_0x28d762);}(_0x375b,0x99));var _0xb375=function(_0x47548c,_0x19d9bb){_0x47548c=_0x47548c-0x0;var _0x4a75b1=_0x375b[_0x47548c];return _0x4a75b1;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xb375('0x0'));var Papa=require(_0xb375('0x1'));var util=require('util');var BPromise=require(_0xb375('0x2'));var moment=require(_0xb375('0x3'));var squel=require(_0xb375('0x4'));var Redis=require(_0xb375('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xb375('0x6'));var shared=require(_0xb375('0x7'));var logger=require(_0xb375('0x8'))(_0xb375('0x9'));config[_0xb375('0xa')]=_['defaults'](config[_0xb375('0xa')],{'host':_0xb375('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb375('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0xb375('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0xb375('0xc'));function isEmail(_0x319de2){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xb375('0xd')](_0x319de2);}function selectNotIn(_0x58d3e9,_0x45350d,_0x24b72b,_0x3539b9,_0x79b905){return squel[_0xb375('0xe')]()[_0xb375('0xf')](_0xb375('0x10'))[_0xb375('0x11')](_0x3539b9)['join'](_0x45350d,null,_0x45350d+_0xb375('0x12')+_0x3539b9+'.'+_0x24b72b)[_0xb375('0x13')](_0x3539b9+'.'+_0x24b72b+_0xb375('0x14')+_0x58d3e9+'.'+_0x24b72b)[_0xb375('0x13')](_0x45350d+_0xb375('0x15')+_0x79b905['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3c627f,_0x2f2112){promisesAdditionalPhones=[];return db[_0xb375('0x16')][_0xb375('0x17')]({'raw':!![],'attributes':['id',_0xb375('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xb375('0x19')](function(_0x5c14f1){if(_0x5c14f1!==null){var _0x4ec8ee=[];for(var _0x13d551=0x0;_0x13d551<_0x5c14f1[_0xb375('0x1a')];_0x13d551++){var _0x5ab7ea=_0x5c14f1[_0x13d551];_0x4ec8ee[_0xb375('0x1b')](insertAdditionalPhones(_0x5ab7ea));}}Promise[_0xb375('0x1c')](_0x4ec8ee)[_0xb375('0x19')](function(){_0x3c627f({'val':0x1});});});});}function insertAdditionalPhones(_0x37abf4){return new Promise(function(_0xa1b84d,_0x1a7b87){var _0x4f0ceb=_0x37abf4[_0xb375('0x18')];var _0x140814=_0x4f0ceb[_0xb375('0x1d')](';');var _0x5ca614=[];orderBy=0x0;for(var _0x5be2aa=0x0;_0x5be2aa<_0x140814[_0xb375('0x1a')];_0x5be2aa++){_0x5ca614['push'](splitAdditionalPhone(_0x37abf4['id'],_0x140814[_0x5be2aa]));}Promise[_0xb375('0x1c')](_0x5ca614)[_0xb375('0x19')](function(){_0xa1b84d({'val':_0x140814['length']});});});}function splitAdditionalPhone(_0x186b42,_0x400fd9){return new Promise(function(_0x10227d,_0x126803){var _0x653bd6=_0x400fd9[_0xb375('0x1d')](':');var _0x2dcc2e=_0x653bd6[0x0];var _0x1e8ffe=_0x653bd6[0x1];if(!_[_0xb375('0x1e')](_0x1e8ffe)){var _0x22a0ee=_0x1e8ffe[_0xb375('0x1d')]('|');var _0x35e392=[];for(var _0x473e13=0x0;_0x473e13<_0x22a0ee[_0xb375('0x1a')];_0x473e13++){if(_0x22a0ee[_0x473e13]!==''){var _0x3d5313=_[_0xb375('0x1f')](promisesAdditionalPhones,{'contactId':_0x186b42,'phone':_0x22a0ee[_0x473e13]});if(_0x3d5313[_0xb375('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0xb375('0x1b')]({'contactId':_0x186b42,'contactTypeId':_0x2dcc2e,'phone':_0x22a0ee[_0x473e13],'orderBy':orderBy});}}}_0x10227d({'ok':0x1});}else _0x10227d({'res':0x0});});}function createAdditionalPhone(_0x36bf11,_0x5a2cf4,_0x5a38d6,_0x30707a){var _0x407703='';var _0x4f1569='';var _0x4f6ef1=_0x5a38d6[_0xb375('0x1d')]('§');_0x407703=_0x4f6ef1[0x0];if(_0x4f6ef1['length']==0x2)_0x4f1569=_0x4f6ef1[0x1];return new Promise(function(_0x10ee6d,_0x387084){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x36bf11,'item':_0x407703}})[_0xb375('0x19')](function(_0xf1de04){if(_0xf1de04){return db[_0xb375('0x20')][_0xb375('0x21')]({'ItemTypeId':_0x5a2cf4,'description':_0x4f1569,'OrderBy':_0x30707a},{'where':{'CmContactId':_0x36bf11,'item':_0x407703}})['then'](function(_0x19bcf1){_0x10ee6d({'res':_0xb375('0x22')});});}else{return db[_0xb375('0x20')][_0xb375('0x23')]({'CmContactId':_0x36bf11,'item':_0x407703,'description':_0x4f1569,'ItemTypeId':_0x5a2cf4,'OrderBy':_0x30707a,'ItemClass':'PHONE'})[_0xb375('0x19')](function(_0x25aed){_0x10ee6d({'res':_0xb375('0x24')});});}});});}function insertCmHopper(_0x34982e,_0x50b64c,_0xffc6dc,_0x3a7e24,_0x5f5b54){var _0x345db5=['cm_contacts.phone',_0xb375('0x25'),_0xb375('0x26'),_0xb375('0x27'),_0x50b64c+'.'+_0x3a7e24,_0xb375('0x28'),_0xb375('0x29'),_0xb375('0x2a'),_0xb375('0x2b'),'\x22'+_0x5f5b54+'\x22'];return squel['insert']()['into']('cm_hopper')[_0xb375('0x2c')](['phone',_0xb375('0x2d'),_0xb375('0x2e'),_0xb375('0x2f'),_0x3a7e24,_0xb375('0x30'),'updatedAt','priority',_0xb375('0x31'),'recallme'],squel[_0xb375('0xe')]()[_0xb375('0x32')](_0x345db5)[_0xb375('0x11')](_0x50b64c)['join'](_0xb375('0x33'),null,_0xb375('0x34')+_0x50b64c+_0xb375('0x35'))[_0xb375('0x36')](_0xffc6dc,null,_0xffc6dc+'.id\x20=\x20'+_0x50b64c+'.'+_0x3a7e24)[_0xb375('0x13')](_0x50b64c+'.CmListId\x20=\x20?',_0x34982e)['where'](_0xb375('0x37'),NOW)[_0xb375('0x13')](_0xb375('0x38'),selectNotIn(_0x50b64c,_0xffc6dc,_0x3a7e24,_0xb375('0x39'),['\x22always\x22',_0xb375('0x3a')]))[_0xb375('0x13')](_0xb375('0x38'),selectNotIn(_0x50b64c,_0xffc6dc,_0x3a7e24,'cm_hopper',[_0xb375('0x3b')])))[_0xb375('0x3c')]();}function insertCmHopperBlack(_0x3c53e4,_0x5885d0,_0x283ba3,_0x2a651a){var _0x5942e8=['cm_contacts.phone',_0xb375('0x26'),_0xb375('0x27'),_0x5885d0+'.'+_0x2a651a,_0xb375('0x28'),'cm_contacts.updatedAt'];return squel[_0xb375('0x3d')]()[_0xb375('0x3e')]('cm_hopper_black')['fromQuery'](['phone','ContactId','ListId',_0x2a651a,_0xb375('0x30'),_0xb375('0x3f')],squel[_0xb375('0xe')]()[_0xb375('0x32')](_0x5942e8)[_0xb375('0x11')](_0x5885d0)[_0xb375('0x36')]('cm_contacts',null,_0xb375('0x34')+_0x5885d0+_0xb375('0x35'))[_0xb375('0x36')](_0x283ba3,null,_0x283ba3+'.id\x20=\x20'+_0x5885d0+'.'+_0x2a651a)[_0xb375('0x13')](_0x5885d0+_0xb375('0x40'),_0x3c53e4)[_0xb375('0x13')](_0xb375('0x37'),NOW)[_0xb375('0x13')](_0xb375('0x38'),squel['select']()['field'](_0xb375('0x10'))[_0xb375('0x11')]('cm_hopper_black')[_0xb375('0x13')](_0xb375('0x41'),_0x3c53e4)[_0xb375('0x13')](_0x2a651a+_0xb375('0x14')+_0x5885d0+'.'+_0x2a651a)))[_0xb375('0x3c')]();}function insertTzCmHopper(_0x1cdae0,_0x2e3faf,_0x32793c,_0x324686,_0x2a36b1,_0x2e3fd7){var _0x44c61f=[_0xb375('0x42'),_0xb375('0x43')+_0x2e3fd7+_0xb375('0x44'),_0xb375('0x26'),_0xb375('0x27'),_0x2e3faf+'.'+_0x324686,_0xb375('0x28'),_0xb375('0x29'),_0xb375('0x2a'),_0xb375('0x2b'),'\x22'+_0x2a36b1+'\x22'];var _0x9f444=squel[_0xb375('0x3d')]()[_0xb375('0x3e')](_0xb375('0x39'))[_0xb375('0x2c')]([_0xb375('0x10'),'scheduledat','ContactId',_0xb375('0x2f'),_0x324686,'createdAt',_0xb375('0x3f'),_0xb375('0x45'),_0xb375('0x31'),_0xb375('0x46')],squel['select']()[_0xb375('0x32')](_0x44c61f)[_0xb375('0x11')](_0x2e3faf)[_0xb375('0x36')](_0xb375('0x33'),null,_0xb375('0x34')+_0x2e3faf+_0xb375('0x35'))['join'](_0x32793c,null,_0x32793c+_0xb375('0x12')+_0x2e3faf+'.'+_0x324686)[_0xb375('0x36')](_0x2e3fd7,null,_0x2e3fd7+'.id\x20=\x20'+_0x2e3faf+'.'+_0x324686)[_0xb375('0x13')](_0x2e3faf+_0xb375('0x40'),_0x1cdae0)[_0xb375('0x13')](_0xb375('0x37'),NOW)[_0xb375('0x13')](_0xb375('0x38'),selectNotIn(_0x2e3faf,_0x32793c,_0x324686,_0xb375('0x39'),[_0xb375('0x3b'),_0xb375('0x3a')]))['where'](_0xb375('0x38'),selectNotIn(_0x2e3faf,_0x32793c,_0x324686,'cm_hopper',[_0xb375('0x3b')])))[_0xb375('0x3c')]();return _0x9f444;}function insertTzCmHopperBlack(_0x86cc37,_0xcafaa7,_0x29aa23,_0x37ed61){var _0x274fcc=[_0xb375('0x42'),_0xb375('0x26'),_0xb375('0x27'),_0xcafaa7+'.'+_0x37ed61,_0xb375('0x28'),_0xb375('0x29')];return squel['insert']()[_0xb375('0x3e')](_0xb375('0x47'))[_0xb375('0x2c')]([_0xb375('0x10'),_0xb375('0x2e'),_0xb375('0x2f'),_0x37ed61,_0xb375('0x30'),_0xb375('0x3f')],squel['select']()[_0xb375('0x32')](_0x274fcc)['from'](_0xcafaa7)[_0xb375('0x36')](_0xb375('0x33'),null,_0xb375('0x34')+_0xcafaa7+'.CmListId')[_0xb375('0x36')](_0x29aa23,null,_0x29aa23+_0xb375('0x12')+_0xcafaa7+'.'+_0x37ed61)[_0xb375('0x13')](_0xcafaa7+_0xb375('0x40'),_0x86cc37)['where'](_0xb375('0x37'),NOW)[_0xb375('0x13')](_0xb375('0x38'),squel[_0xb375('0xe')]()[_0xb375('0xf')](_0xb375('0x10'))['from'](_0xb375('0x47'))[_0xb375('0x13')](_0xb375('0x41'),_0x86cc37)['where'](_0x37ed61+_0xb375('0x14')+_0xcafaa7+'.'+_0x37ed61)))[_0xb375('0x3c')]();}function insertCmHopperAdditionalPhones(_0xefd9af){var _0x320072=[_0xb375('0x48'),'cm_contact_has_items.item',_0xb375('0x49'),_0xb375('0x4a'),_0xb375('0x4b')];return squel[_0xb375('0x3d')]()[_0xb375('0x3e')](_0xb375('0x4c'))['fromQuery']([_0xb375('0x4d'),_0xb375('0x10'),'OrderBy',_0xb375('0x30'),_0xb375('0x3f')],squel[_0xb375('0xe')]()[_0xb375('0x32')](_0x320072)['from'](_0xb375('0x39'))[_0xb375('0x36')](_0xb375('0x33'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xb375('0x36')]('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0xb375('0x4e'),_0xefd9af)[_0xb375('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xb375('0x3c')]();}function insertCmContact(_0x2966ac,_0x4ec0ad,_0x459df8,_0x14c7e9){var _0x5b6713=_[_0xb375('0x4f')](_[_0xb375('0x50')](_0x14c7e9),[_0xb375('0x2f'),_0xb375('0x51'),_0xb375('0x30'),_0xb375('0x3f'),_0xb375('0x52')]);return squel[_0xb375('0x3d')]()[_0xb375('0x3e')](_0xb375('0x33'))[_0xb375('0x2c')](_0x5b6713,squel[_0xb375('0xe')]()[_0xb375('0x32')](_0x5b6713)[_0xb375('0x11')](_0x4ec0ad)[_0xb375('0x13')]('('+_0x459df8['join'](',')+_0xb375('0x53'),squel[_0xb375('0xe')]()[_0xb375('0x32')](_0x459df8)[_0xb375('0x11')](_0xb375('0x33'))['where'](_0xb375('0x41'),_0x2966ac)[_0xb375('0x13')](_0xb375('0x54')))[_0xb375('0x13')](_0xb375('0x55'),squel[_0xb375('0xe')]()[_0xb375('0xf')](_0xb375('0x56'),_0xb375('0x57'))[_0xb375('0x11')](_0x4ec0ad)[_0xb375('0x58')](_0x459df8[_0xb375('0x36')](','))))[_0xb375('0x3c')]();}function handleStop(){logger[_0xb375('0x59')](_0xb375('0x5a'));stopped=!![];}function handleUncaughtException(_0x40379c){logger[_0xb375('0x5b')](_0x40379c['message']);process['exit'](0x1);}function handleError(_0xfd2ef6,_0x5c916a){stats[_0xb375('0x5c')][_0xb375('0x1b')]({'name':_0x5c916a['code'],'message':_0x5c916a[_0xb375('0x5d')],'row':_0xfd2ef6});}function handleQuery(_0x223e21){logger[_0xb375('0x59')](_0x223e21);return db[_0xb375('0x5e')][_0xb375('0x5f')](_0x223e21)['spread'](function(_0x106b0c){results[_0xb375('0x1b')](_0x106b0c);})[_0xb375('0x60')](function(_0x103811){logger['error'](_0x103811[_0xb375('0x5d')]);});}function updateTzCampaigns(_0x524dd5){return new Promise(function(_0x2a6b3,_0x14fcd2){var _0x42c6a4=squel[_0xb375('0xe')]()[_0xb375('0x32')]([_0xb375('0x61'),_0xb375('0x62')])[_0xb375('0x11')](_0xb375('0x63'))[_0xb375('0x36')](_0xb375('0x64'),null,_0xb375('0x65'))[_0xb375('0x13')](_0xb375('0x66')+_0x524dd5);db[_0xb375('0x5e')][_0xb375('0x5f')](_0x42c6a4['toString']())[_0xb375('0x67')](function(_0x2e0186){var _0xd2edf5=[];for(var _0x5d50c0=0x0;_0x5d50c0<_0x2e0186[_0xb375('0x1a')];_0x5d50c0++){_0xd2edf5['push'](getTimezoneData(_0x2e0186[_0x5d50c0],tmp_campaigns));}BPromise[_0xb375('0x1c')](_0xd2edf5)[_0xb375('0x19')](function(){_0x2a6b3({'val':0x1});});})[_0xb375('0x60')](function(_0x220cf5){logger[_0xb375('0x5b')](_0x220cf5['message']);_0x2a6b3({'val':0x0});});});}function updateTzVoiceQueues(_0x3461e0){return new Promise(function(_0x5ba07a,_0x55ebdf){var _0x395934=squel['select']()[_0xb375('0x32')]([_0xb375('0x68'),_0xb375('0x69')])['from']('voice_queues')['join']('voice_queues_has_cm_lists',null,_0xb375('0x6a'))[_0xb375('0x13')]('voice_queues_has_cm_lists.CmListId='+_0x3461e0);db['sequelize'][_0xb375('0x5f')](_0x395934[_0xb375('0x3c')]())['spread'](function(_0x5f2cef){var _0x3e0770=[];for(var _0x2daefa=0x0;_0x2daefa<_0x5f2cef[_0xb375('0x1a')];_0x2daefa++){_0x3e0770['push'](getTimezoneData(_0x5f2cef[_0x2daefa],tmp_voice_queues));}BPromise[_0xb375('0x1c')](_0x3e0770)[_0xb375('0x19')](function(){_0x5ba07a({'val':0x1});});})[_0xb375('0x60')](function(_0x588258){logger[_0xb375('0x5b')](_0x588258['message']);_0x5ba07a({'val':0x0});});});}function getTimezoneData(_0x34759a,_0x421d40){return new Promise(function(_0x2e7d8b,_0x31f286){var _0x170bea=shared[_0xb375('0x6b')];var _0x405732=_0x170bea[_0x34759a[_0xb375('0x6c')]];if(_[_0xb375('0x1e')](_0x405732)){_0x2e7d8b({'ret':0x1});}else{var _0x1288f9=_0x405732[_0xb375('0x6d')];var _0x2a33ca=squel[_0xb375('0x3d')]()[_0xb375('0x3e')](_0x421d40)[_0xb375('0x6e')]('id',_0x34759a['id'])[_0xb375('0x6e')]('offset',_0x1288f9)[_0xb375('0x6e')]('dialTimezone',_0x34759a['dialTimezone'])['toString']();return db[_0xb375('0x5e')][_0xb375('0x5f')](_0x2a33ca)[_0xb375('0x67')](function(_0x42f384){_0x2e7d8b({'ret':0x1});})[_0xb375('0x60')](function(_0x103a34){logger['error'](_0x103a34[_0xb375('0x5d')]);_0x31f286({'ret':0x1});});}});}function handleTZQuery(_0x4369d6){logger[_0xb375('0x59')](_0x4369d6);return db[_0xb375('0x5e')]['query'](_0x4369d6)['spread'](function(_0x20e77d){})[_0xb375('0x60')](function(_0x17e1cd){logger[_0xb375('0x5b')](_0x17e1cd[_0xb375('0x5d')]);});}function main(_0x425d4b,_0x162738,_0x1596e3,_0x2c42a6){logger[_0xb375('0x59')](_0xb375('0x6f'),_0x425d4b,JSON[_0xb375('0x70')](_0x162738));process[_0xb375('0x71')](_0xb375('0x72'));var _0x12880c=_0x162738['binding'];var _0x2c9768=_[_0xb375('0x73')](_0x12880c);var _0xb58142=_0x162738[_0xb375('0x74')];var _0x303fcf=path['join'](config[_0xb375('0x75')],_0xb375('0x76'),_0xb58142+'.csv');hasTZ=_['keys'](_0x12880c)[_0xb375('0x77')](_0xb375('0x6c'));var _0x21369f=_[_0xb375('0x50')](_0x12880c)[_0xb375('0x36')]();logger[_0xb375('0x59')](_0xb375('0x78'),_0x21369f);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0xb375('0x79')]})[_0xb375('0x19')](function(_0x5d67d6){for(var _0x22f3a2=0x0;_0x22f3a2<_0x5d67d6['length'];_0x22f3a2++){if(_0x5d67d6[_0x22f3a2][_0xb375('0x79')]in _0x12880c){contactItemTypes[_0xb375('0x1b')](_0x5d67d6[_0x22f3a2]);delete _0x2c9768[_0x5d67d6[_0x22f3a2][_0xb375('0x79')]];hasAdditionalPhones=!![];}for(var _0x26daba in _0x12880c){if(_0x5d67d6[_0x22f3a2][_0xb375('0x79')]+'_description'===_0x26daba){phoneDescriptions['push']({'itemTypeId':_0x5d67d6[_0x22f3a2]['id'],'description':_0x26daba});delete _0x2c9768[_0x26daba];}}}if(hasAdditionalPhones)_0x2c9768[_0xb375('0x18')]='';var _0x410e92=_[_0xb375('0x50')](_0x2c9768)[_0xb375('0x36')]();logger['info'](_0xb375('0x78'),_0x410e92);fs[_0xb375('0x7a')](_0x303fcf,_0x410e92+'\x0a');Papa[_0xb375('0x7b')](fs[_0xb375('0x7c')](_0x425d4b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x24b0fe,_0x49f9b5){try{for(var _0x22477f=0x0,_0x2e3669=[];_0x22477f<_0x24b0fe['data'][_0xb375('0x1a')];_0x22477f++){stats[_0xb375('0x7d')]+=0x1;if(_0x24b0fe[_0xb375('0x5c')][_0x22477f]){handleError(_0x24b0fe['data'][_0x22477f],_0x24b0fe[_0xb375('0x5c')][_0x22477f]);}else{var _0x4447b2=[];var _0x39ddc6=[];var _0x3a4a46={};for(var _0xd7d757 in _0x12880c){let _0x305cd8=contactItemTypes['find'](_0xc324c0=>_0xc324c0[_0xb375('0x79')]===_0xd7d757);let _0x504e73=contactItemTypes[_0xb375('0x7e')](_0x10e4f7=>_0x10e4f7[_0xb375('0x79')]+_0xb375('0x7f')===_0xd7d757);if(_[_0xb375('0x1e')](_0x305cd8)&&_['isNil'](_0x504e73)){if(_0x12880c[_0xb375('0x80')](_0xd7d757)){if(_0x24b0fe[_0xb375('0x81')][_0x22477f][_0x12880c[_0xd7d757]]){var _0x275f0d=_[_0xb375('0x82')](_0x24b0fe[_0xb375('0x81')][_0x22477f][_0x12880c[_0xd7d757]][_0xb375('0x83')](/"/g,'\x27'));switch(_0xd7d757){case'scheduledat':var _0x3d84e6=moment(_0x275f0d,_0xb375('0xc'),!![]);if(_0x3d84e6[_0xb375('0x84')]()){_0x2e3669[_0xb375('0x1b')]('\x22'+_0x275f0d+'\x22');}else{_0x4447b2[_0xb375('0x1b')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xb375('0x45'):var _0x3f6b31=parseInt(_0x275f0d);_0x275f0d=_[_0xb375('0x85')](_0x3f6b31)||_0x3f6b31<0x0||_0x3f6b31>0x4?_0x2c42a6?0x3:0x2:_0x3f6b31;_0x2e3669[_0xb375('0x1b')]('\x22'+_0x275f0d+'\x22');break;case _0xb375('0x31'):var _0x43b3e7=parseInt(_0x275f0d);if(_[_0xb375('0x86')](_0x43b3e7)&&_[_0xb375('0x77')](_0x1596e3,_0x43b3e7)){_0x2e3669[_0xb375('0x1b')]('\x22'+_0x43b3e7+'\x22');}else{_0x4447b2['push'](_0xb375('0x87'));}break;case'email':if(isEmail(_0x275f0d)){_0x2e3669[_0xb375('0x1b')]('\x22'+_0x275f0d+'\x22');}else{_0x4447b2[_0xb375('0x1b')]('email\x20wrong\x20format');}break;case _0xb375('0x88'):var _0x34ce76=moment(_0x275f0d,_0xb375('0x89'),!![]);if(_0x34ce76['isValid']()){_0x2e3669[_0xb375('0x1b')]('\x22'+_0x275f0d+'\x22');}else{_0x4447b2[_0xb375('0x1b')](_0xb375('0x8a'));}break;case _0xb375('0x6c'):var _0x5eda8d=shared[_0xb375('0x6b')];var _0x24fdcb=_0x5eda8d[_0x275f0d];if(!_['isNil'](_0x24fdcb)){var _0x435ee9=_0x24fdcb[_0xb375('0x6d')];_0x2e3669[_0xb375('0x1b')]('\x22'+_0x275f0d+'\x22');_0x2e3669['push']('\x22'+_0x435ee9+'\x22');}break;default:_0x2e3669[_0xb375('0x1b')]('\x22'+_0x275f0d+'\x22');}}else{switch(_0xd7d757){case _0xb375('0x8b'):case'phone':_0x4447b2[_0xb375('0x1b')](_0xd7d757+_0xb375('0x8c'));break;default:_0x2e3669[_0xb375('0x1b')]('\x22\x22');}}}}else{var _0x578a80='';if(!_[_0xb375('0x1e')](_0x305cd8)){if(!_0x3a4a46[_0xb375('0x80')](_0x305cd8['id'])){if(!_[_0xb375('0x1e')](_0x24b0fe[_0xb375('0x81')][_0x22477f][_0x12880c[_0xd7d757]])){var _0x275f0d=_[_0xb375('0x82')](_0x24b0fe['data'][_0x22477f][_0x12880c[_0xd7d757]]['replace'](/"/g,'\x27'));var _0x12650a=phoneDescriptions[_0xb375('0x7e')](_0x531d80=>_0x531d80[_0xb375('0x8d')]===_0x305cd8['id']);if(!_[_0xb375('0x1e')](_0x12650a)){var _0x4847f5=_['trim'](_0x24b0fe['data'][_0x22477f][_0x12880c[_0x12650a[_0xb375('0x8e')]]][_0xb375('0x83')](/"/g,'\x27'));if(!_[_0xb375('0x1e')](_0x4847f5))_0x275f0d=_0x275f0d+'§'+_0x4847f5;}if(_0x578a80=='')_0x578a80=_0x275f0d;else _0x578a80+='|'+_0x275f0d;}_0x39ddc6[_0xb375('0x1b')](_0x305cd8['id']+':'+_0x578a80);_0x3a4a46[_0x305cd8['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2e3669[_0xb375('0x1b')]('\x22'+_0x39ddc6[_0xb375('0x36')](';')+'\x22');}if(_0x4447b2[_0xb375('0x1a')]){handleError(_0x24b0fe[_0xb375('0x81')][_0x22477f],{'code':_0xb375('0x8f'),'message':_0x4447b2[_0xb375('0x36')]()});}else{fs[_0xb375('0x90')](_0x303fcf,_0x2e3669[_0xb375('0x36')]()+'\x0a');}_0x2e3669=[];}if(!(stats[_0xb375('0x7d')]%0xc8)){socket[_0xb375('0x91')](_0xb375('0x92')+_0xb58142,stats);stats[_0xb375('0x5c')]=[];}}if(stopped){logger[_0xb375('0x59')](_0xb375('0x93'));_0x49f9b5['abort']();}}catch(_0x310baa){handleError(_0x24b0fe[_0xb375('0x81')][_0x22477f],{'code':_0xb375('0x94'),'message':_0x310baa[_0xb375('0x5d')]});logger[_0xb375('0x5b')](_0xb375('0x95'),_0x310baa[_0xb375('0x5d')]);}},'complete':function(){try{var _0xd779fa=[];var _0x35c76e=[];var _0x2ea274=_0xb375('0x33');if(_0x162738[_0xb375('0x96')]&&_0x162738[_0xb375('0x96')][_0xb375('0x1a')]){_0x2ea274=_0xb375('0x97')+_0xb58142;_0xd779fa['push'](_0xb375('0x98')+_0x2ea274+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0xb375('0x99')+_0xb58142;tmp_voice_queues=_0xb375('0x9a')+_0xb58142;_0x35c76e['push'](_0xb375('0x98')+tmp_campaigns+_0xb375('0x9b'));_0x35c76e['push'](_0xb375('0x98')+tmp_voice_queues+_0xb375('0x9b'));BPromise[_0xb375('0x9c')](_0x35c76e,handleTZQuery)[_0xb375('0x19')](function(_0x15bd42){updateTzCampaigns(_0x162738[_0xb375('0x2f')])['then'](function(_0x279e4c){updateTzVoiceQueues(_0x162738[_0xb375('0x2f')])[_0xb375('0x19')](function(_0x17e622){if(hasTZ)_0x410e92=_0x410e92[_0xb375('0x83')](_0xb375('0x6c'),_0xb375('0x9d'));var _0x50fc40=util[_0xb375('0x9e')](_0xb375('0x9f'),_0x303fcf,_0x2ea274,_0x410e92,_0x162738[_0xb375('0x2f')],_0x162738['CompanyId']||null,NOW,NOW);if(_[_0xb375('0x1e')](_0x12880c[_0xb375('0x2d')])){_0x50fc40+=',\x20scheduledAt\x20=\x20NOW()';}_0xd779fa[_0xb375('0x1b')](_0x50fc40);if(_0x162738[_0xb375('0x96')]&&_0x162738[_0xb375('0x96')][_0xb375('0x1a')]){_0xd779fa[_0xb375('0x1b')](insertCmContact(_0x162738[_0xb375('0x2f')],_0x2ea274,_0x162738['duplicates'],_0x12880c));_0xd779fa[_0xb375('0x1b')]('DROP\x20TABLE\x20'+_0x2ea274+';');}BPromise[_0xb375('0x9c')](_0xd779fa,handleQuery)[_0xb375('0x19')](function(_0x2f028e){BPromise['all']([handleAdditionalPhones()])[_0xb375('0x19')](function(){_0xd779fa=[];for(var _0x38f730=0x0;_0x38f730\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','YYYYMMDDHHmmss','field','phone','join','where','\x20=\x20','sequelize','query','length','isNil'];(function(_0x1bbf20,_0x44a301){var _0x53ca34=function(_0x1cf0b7){while(--_0x1cf0b7){_0x1bbf20['push'](_0x1bbf20['shift']());}};_0x53ca34(++_0x44a301);}(_0xdc64,0x80));var _0x4dc6=function(_0x1bc039,_0x43e1d9){_0x1bc039=_0x1bc039-0x0;var _0x3f850c=_0xdc64[_0x1bc039];return _0x3f850c;};'use strict';var fs=require('fs');var path=require(_0x4dc6('0x0'));var _=require(_0x4dc6('0x1'));var Papa=require(_0x4dc6('0x2'));var util=require(_0x4dc6('0x3'));var BPromise=require('bluebird');var moment=require(_0x4dc6('0x4'));var squel=require(_0x4dc6('0x5'));var Redis=require(_0x4dc6('0x6'));var db=require(_0x4dc6('0x7'))['db'];var config=require(_0x4dc6('0x8'));var logger=require(_0x4dc6('0x9'))(_0x4dc6('0xa'));config[_0x4dc6('0xb')]=_[_0x4dc6('0xc')](config[_0x4dc6('0xb')],{'host':_0x4dc6('0xd'),'port':0x18eb});var socket=require(_0x4dc6('0xe'))(new Redis(config[_0x4dc6('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x4dc6('0xf')](_0x4dc6('0x10'));var tempTableName='cm_contacts_temp_'+moment()[_0x4dc6('0xf')](_0x4dc6('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x21f383){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x21f383);}function selectNotIn(_0xd6a6f8,_0x10c881,_0x4c680e,_0x1c8a36,_0x9e19b9){return squel['select']()[_0x4dc6('0x12')](_0x4dc6('0x13'))['from'](_0x1c8a36)[_0x4dc6('0x14')](_0x10c881,null,_0x10c881+'.id\x20=\x20'+_0x1c8a36+'.'+_0x4c680e)[_0x4dc6('0x15')](_0x1c8a36+'.'+_0x4c680e+_0x4dc6('0x16')+_0xd6a6f8+'.'+_0x4c680e)[_0x4dc6('0x15')](_0x10c881+'.dialCheckDuplicateType\x20IN\x20('+_0x9e19b9[_0x4dc6('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x28aeb9,_0x2f9aea){promisesAdditionalPhones=[];promisesContact=[];return db[_0x4dc6('0x17')][_0x4dc6('0x18')]('select\x20*\x20from\x20'+tempTableName)['spread'](function(_0x155c21){if(_0x155c21!==null){var _0x2d17bc=[];for(var _0x37bcf0=0x0;_0x37bcf0<_0x155c21[_0x4dc6('0x19')];_0x37bcf0++){var _0x20bea3=_0x155c21[_0x37bcf0];if(!_[_0x4dc6('0x1a')](_0x20bea3[_0x4dc6('0x13')])){if(!_[_0x4dc6('0x1a')](_0x20bea3[_0x4dc6('0x1b')]))_0x2d17bc[_0x4dc6('0x1c')](insertAdditionalPhones(_0x20bea3));promisesContact['push']({'contact':_0x20bea3});}}}Promise[_0x4dc6('0x1d')](_0x2d17bc)[_0x4dc6('0x1e')](function(){_0x28aeb9({'val':0x1});});})['catch'](function(_0x131464){logger[_0x4dc6('0x1f')](_0x131464['message']);});});}function insertAdditionalPhones(_0x592a0a){return new Promise(function(_0x5c1244,_0x1c7ada){var _0x2c9755=_0x592a0a['AdditionalPhones'];if(_['isNil'](_0x2c9755))_0x1c7ada({'val':0x0});else{var _0xea8150=_0x2c9755['split'](';');var _0x4efac9=[];orderBy=0x0;for(var _0x705c6b=0x0;_0x705c6b<_0xea8150[_0x4dc6('0x19')];_0x705c6b++){_0x4efac9[_0x4dc6('0x1c')](splitAdditionalPhone(_0x592a0a['id'],_0xea8150[_0x705c6b]));}Promise[_0x4dc6('0x1d')](_0x4efac9)[_0x4dc6('0x1e')](function(){_0x5c1244({'val':_0xea8150['length']});});}});}function splitAdditionalPhone(_0x1e6cab,_0x390b7d){return new Promise(function(_0x1e0ed8,_0x200978){var _0x9aebd=_0x390b7d[_0x4dc6('0x20')](':');var _0x16f3c3=_0x9aebd[0x0];var _0x210e4e=_0x9aebd[0x1];if(_0x210e4e!==''){var _0x512b8d=_0x210e4e[_0x4dc6('0x20')]('|');var _0x95c65c=[];for(var _0x2c5154=0x0;_0x2c5154<_0x512b8d[_0x4dc6('0x19')];_0x2c5154++){if(_0x512b8d[_0x2c5154]!==''){var _0x5efbae=_[_0x4dc6('0x21')](promisesAdditionalPhones,{'contactId':_0x1e6cab,'phone':_0x512b8d[_0x2c5154]});if(_0x5efbae[_0x4dc6('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0x4dc6('0x1c')]({'contactId':_0x1e6cab,'contactTypeId':_0x16f3c3,'phone':_0x512b8d[_0x2c5154],'orderBy':orderBy});}}}_0x1e0ed8({'ok':0x1});}else _0x1e0ed8({'res':0x0});});}function createAdditionalPhone(_0x485d2a,_0x16cf3e,_0x440f1f,_0x4dc8ba){var _0x1d1dd3='';var _0x42371f='';var _0x8c4901=_0x440f1f[_0x4dc6('0x20')]('§');_0x1d1dd3=_0x8c4901[0x0];if(_0x8c4901[_0x4dc6('0x19')]==0x2)_0x42371f=_0x8c4901[0x1];return new Promise(function(_0x599274,_0x416ec1){return db['CmContactHasItem'][_0x4dc6('0x22')]({'where':{'CmContactId':_0x485d2a,'item':_0x1d1dd3}})[_0x4dc6('0x1e')](function(_0x425ae5){if(_0x425ae5){return db[_0x4dc6('0x23')][_0x4dc6('0x24')]({'ItemTypeId':_0x16cf3e,'description':_0x42371f,'OrderBy':_0x4dc8ba},{'where':{'CmContactId':_0x485d2a,'item':_0x1d1dd3}})['then'](function(_0x4f4339){_0x599274({'res':_0x4dc6('0x25')});});}else{return db[_0x4dc6('0x23')][_0x4dc6('0x26')]({'CmContactId':_0x485d2a,'item':_0x1d1dd3,'ItemTypeId':_0x16cf3e,'description':_0x42371f,'OrderBy':_0x4dc8ba,'ItemClass':'PHONE'})[_0x4dc6('0x1e')](function(_0x543efd){_0x599274({'res':_0x4dc6('0x27')});});}});});}function updateContact(_0x5c0ee1){return new Promise(function(_0x2150b2,_0x522f60){var _0xd7fa48=_0x5c0ee1['id'];delete _0x5c0ee1['id'];return db['CmContact'][_0x4dc6('0x24')](_0x5c0ee1,{'where':{'id':_0xd7fa48}})[_0x4dc6('0x1e')](function(_0x22e266){updatedRows+=0x1;return db[_0x4dc6('0x28')]['update']({'phone':_0x5c0ee1[_0x4dc6('0x13')]},{'where':{'ContactId':_0xd7fa48}})[_0x4dc6('0x1e')](function(_0x36587b){_0x2150b2({'ret':'OK'});});});});}function insertCmHopper(_0x5d9cf5,_0x56f749,_0x1ebfb9,_0x696f6e,_0x49d4d5){var _0x1b7567=[_0x4dc6('0x29'),_0x4dc6('0x2a'),_0x4dc6('0x2b'),_0x4dc6('0x2c'),_0x56f749+'.'+_0x696f6e,_0x4dc6('0x2d'),'cm_contacts.updatedAt',_0x4dc6('0x2e'),_0x4dc6('0x2f'),'\x22'+_0x49d4d5+'\x22'];return squel[_0x4dc6('0x30')]()[_0x4dc6('0x31')](_0x4dc6('0x32'))[_0x4dc6('0x33')]([_0x4dc6('0x13'),_0x4dc6('0x34'),_0x4dc6('0x35'),_0x4dc6('0x36'),_0x696f6e,_0x4dc6('0x37'),_0x4dc6('0x38'),_0x4dc6('0x39'),'UserId',_0x4dc6('0x3a')],squel[_0x4dc6('0x3b')]()[_0x4dc6('0x3c')](_0x1b7567)[_0x4dc6('0x3d')](_0x56f749)['join'](_0x4dc6('0x3e'),null,_0x4dc6('0x3f')+_0x56f749+_0x4dc6('0x40'))['join'](_0x1ebfb9,null,_0x1ebfb9+'.id\x20=\x20'+_0x56f749+'.'+_0x696f6e)[_0x4dc6('0x15')](_0x56f749+'.CmListId\x20=\x20?',_0x5d9cf5)[_0x4dc6('0x15')](_0x4dc6('0x41'),NOW)[_0x4dc6('0x15')](_0x4dc6('0x42'),selectNotIn(_0x56f749,_0x1ebfb9,_0x696f6e,_0x4dc6('0x32'),[_0x4dc6('0x43'),_0x4dc6('0x44')]))[_0x4dc6('0x15')](_0x4dc6('0x42'),selectNotIn(_0x56f749,_0x1ebfb9,_0x696f6e,_0x4dc6('0x32'),[_0x4dc6('0x43')])))['toString']();}function insertCmHopperBlack(_0x36f3f0,_0x4497ed,_0x4e6cf7,_0x19265e){var _0x32f366=[_0x4dc6('0x29'),_0x4dc6('0x2b'),_0x4dc6('0x2c'),_0x4497ed+'.'+_0x19265e,'cm_contacts.createdAt',_0x4dc6('0x45')];return squel['insert']()['into'](_0x4dc6('0x46'))[_0x4dc6('0x33')]([_0x4dc6('0x13'),_0x4dc6('0x35'),_0x4dc6('0x36'),_0x19265e,_0x4dc6('0x37'),_0x4dc6('0x38')],squel[_0x4dc6('0x3b')]()[_0x4dc6('0x3c')](_0x32f366)['from'](_0x4497ed)[_0x4dc6('0x14')](_0x4dc6('0x3e'),null,_0x4dc6('0x3f')+_0x4497ed+_0x4dc6('0x40'))[_0x4dc6('0x14')](_0x4e6cf7,null,_0x4e6cf7+_0x4dc6('0x47')+_0x4497ed+'.'+_0x19265e)[_0x4dc6('0x15')](_0x4497ed+_0x4dc6('0x48'),_0x36f3f0)[_0x4dc6('0x15')](_0x4dc6('0x41'),NOW)[_0x4dc6('0x15')](_0x4dc6('0x42'),squel['select']()['field'](_0x4dc6('0x13'))[_0x4dc6('0x3d')]('cm_hopper_black')['where']('ListId\x20=\x20?',_0x36f3f0)[_0x4dc6('0x15')](_0x19265e+_0x4dc6('0x49'),_0x4497ed+'.'+_0x19265e)))['toString']();}function insertCmHopperAdditionalPhones(_0x2b07b6){var _0x41526c=[_0x4dc6('0x4a'),'cm_contact_has_items.item',_0x4dc6('0x4b'),_0x4dc6('0x4c'),_0x4dc6('0x4d')];return squel[_0x4dc6('0x30')]()['into'](_0x4dc6('0x4e'))['fromQuery']([_0x4dc6('0x4f'),_0x4dc6('0x13'),_0x4dc6('0x50'),_0x4dc6('0x37'),_0x4dc6('0x38')],squel[_0x4dc6('0x3b')]()['fields'](_0x41526c)[_0x4dc6('0x3d')](_0x4dc6('0x32'))[_0x4dc6('0x14')](_0x4dc6('0x3e'),null,_0x4dc6('0x51'))[_0x4dc6('0x14')](_0x4dc6('0x52'),null,_0x4dc6('0x53'))[_0x4dc6('0x15')](_0x4dc6('0x54'),_0x2b07b6)[_0x4dc6('0x15')](_0x4dc6('0x41'),NOW))[_0x4dc6('0x55')]();}function insertCmContact(_0x22cc97,_0x4ed06b,_0x5ddcc9,_0x3e2b65){var _0x4cbd56=_[_0x4dc6('0x56')](_[_0x4dc6('0x57')](_0x3e2b65),[_0x4dc6('0x36'),'CompanyId',_0x4dc6('0x37'),_0x4dc6('0x38')]);return squel['insert']()[_0x4dc6('0x31')]('cm_contacts')[_0x4dc6('0x33')](_0x4cbd56,squel[_0x4dc6('0x3b')]()[_0x4dc6('0x3c')](_0x4cbd56)['from'](_0x4ed06b)['where']('('+_0x5ddcc9[_0x4dc6('0x14')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x4dc6('0x3c')](_0x5ddcc9)[_0x4dc6('0x3d')](_0x4dc6('0x3e'))[_0x4dc6('0x15')](_0x4dc6('0x58'),_0x22cc97))[_0x4dc6('0x15')](_0x4dc6('0x59'),squel[_0x4dc6('0x3b')]()['field'](_0x4dc6('0x5a'),'min_id')[_0x4dc6('0x3d')](_0x4ed06b)[_0x4dc6('0x5b')](_0x5ddcc9[_0x4dc6('0x14')](','))))['toString']();}function handleStop(){logger['info'](_0x4dc6('0x5c'));stopped=!![];}function handleUncaughtException(_0x466573){logger[_0x4dc6('0x1f')](_0x466573[_0x4dc6('0x5d')]);process['exit'](0x1);}function handleError(_0x5295eb,_0x2dcd9a){stats[_0x4dc6('0x5e')]['push']({'name':_0x2dcd9a[_0x4dc6('0x5f')],'message':_0x2dcd9a[_0x4dc6('0x5d')],'row':_0x5295eb});}function handleQuery(_0x20112e){logger[_0x4dc6('0x60')](_0x20112e);return db[_0x4dc6('0x17')]['query'](_0x20112e)['spread'](function(_0x274f5d){results['push'](_0x274f5d);})[_0x4dc6('0x61')](function(_0x4dfde3){logger[_0x4dc6('0x1f')](_0x4dfde3['message']);});}function main(_0x52b396,_0x1d62c7,_0x110799,_0x8d1ae){logger[_0x4dc6('0x60')](_0x4dc6('0x62'),_0x52b396,JSON[_0x4dc6('0x63')](_0x1d62c7));process['send']('start');var _0x3c26d0=_0x1d62c7[_0x4dc6('0x64')];var _0x16c882=_['clone'](_0x3c26d0);var _0x99c6bb=_0x1d62c7[_0x4dc6('0x65')];var _0x1b57d7=path[_0x4dc6('0x14')](config[_0x4dc6('0x66')],_0x4dc6('0x67'),_0x99c6bb+'.csv');logger[_0x4dc6('0x60')]('body',_0x1d62c7);db[_0x4dc6('0x68')]['findAll']({'raw':!![],'attributes':['id','name']})[_0x4dc6('0x1e')](function(_0x1a08b4){for(var _0x28571a=0x0;_0x28571a<_0x1a08b4[_0x4dc6('0x19')];_0x28571a++){if(_0x1a08b4[_0x28571a][_0x4dc6('0x69')]in _0x3c26d0){contactItemTypes[_0x4dc6('0x1c')](_0x1a08b4[_0x28571a]);delete _0x16c882[_0x1a08b4[_0x28571a][_0x4dc6('0x69')]];hasAdditionalPhones=!![];}for(var _0x43cb62 in _0x3c26d0){if(_0x1a08b4[_0x28571a]['name']+'_description'===_0x43cb62){phoneDescriptions['push']({'itemTypeId':_0x1a08b4[_0x28571a]['id'],'description':_0x43cb62});delete _0x16c882[_0x43cb62];}}}if(hasAdditionalPhones)_0x16c882[_0x4dc6('0x1b')]='';var _0x2496c6=_[_0x4dc6('0x57')](_0x16c882)['join']();logger[_0x4dc6('0x60')](_0x4dc6('0x6a'),_0x2496c6);fs[_0x4dc6('0x6b')](_0x1b57d7,_0x2496c6+'\x0a');Papa[_0x4dc6('0x6c')](fs[_0x4dc6('0x6d')](_0x52b396),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5ce7a8,_0x71c185){try{for(var _0x4b2bba=0x0,_0x56aa26=[];_0x4b2bba<_0x5ce7a8[_0x4dc6('0x6e')]['length'];_0x4b2bba++){stats[_0x4dc6('0x6f')]+=0x1;if(_0x5ce7a8[_0x4dc6('0x5e')][_0x4b2bba]){handleError(_0x5ce7a8[_0x4dc6('0x6e')][_0x4b2bba],_0x5ce7a8['errors'][_0x4b2bba]);}else{var _0x25ebd7=[];var _0x103265=[];var _0x2d269c={};for(var _0x31f4cf in _0x3c26d0){let _0x35844f=contactItemTypes[_0x4dc6('0x70')](_0x366825=>_0x366825[_0x4dc6('0x69')]===_0x31f4cf);let _0x633006=contactItemTypes[_0x4dc6('0x70')](_0x43bb3b=>_0x43bb3b['name']+'_description'===_0x31f4cf);if(_[_0x4dc6('0x1a')](_0x35844f)&&_[_0x4dc6('0x1a')](_0x633006)){if(_0x3c26d0['hasOwnProperty'](_0x31f4cf)){if(_0x5ce7a8[_0x4dc6('0x6e')][_0x4b2bba][_0x3c26d0[_0x31f4cf]]){var _0x3dc6cb=_[_0x4dc6('0x71')](_0x5ce7a8[_0x4dc6('0x6e')][_0x4b2bba][_0x3c26d0[_0x31f4cf]][_0x4dc6('0x72')](/"/g,'\x27'));switch(_0x31f4cf){case'scheduledat':var _0x157800=moment(_0x3dc6cb,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x157800[_0x4dc6('0x73')]()){_0x56aa26['push']('\x22'+_0x3dc6cb+'\x22');}else{_0x25ebd7['push'](_0x4dc6('0x74'));}break;case _0x4dc6('0x39'):var _0x209780=parseInt(_0x3dc6cb);_0x3dc6cb=_[_0x4dc6('0x75')](_0x209780)||_0x209780<0x0||_0x209780>0x4?_0x8d1ae?0x3:0x2:_0x209780;_0x56aa26['push']('\x22'+_0x3dc6cb+'\x22');break;case _0x4dc6('0x76'):var _0x3d3051=parseInt(_0x3dc6cb);if(_[_0x4dc6('0x77')](_0x3d3051)&&_[_0x4dc6('0x78')](_0x110799,_0x3d3051)){_0x56aa26['push']('\x22'+_0x3d3051+'\x22');}else{_0x25ebd7[_0x4dc6('0x1c')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x3dc6cb)){_0x56aa26[_0x4dc6('0x1c')]('\x22'+_0x3dc6cb+'\x22');}else{_0x25ebd7[_0x4dc6('0x1c')](_0x4dc6('0x79'));}break;case _0x4dc6('0x7a'):var _0x312932=moment(_0x3dc6cb,_0x4dc6('0x7b'),!![]);if(_0x312932[_0x4dc6('0x73')]()){_0x56aa26[_0x4dc6('0x1c')]('\x22'+_0x3dc6cb+'\x22');}else{_0x25ebd7[_0x4dc6('0x1c')](_0x4dc6('0x7c'));}break;default:_0x56aa26[_0x4dc6('0x1c')]('\x22'+_0x3dc6cb+'\x22');}}else{switch(_0x31f4cf){case _0x4dc6('0x7d'):case _0x4dc6('0x13'):_0x25ebd7[_0x4dc6('0x1c')](_0x31f4cf+_0x4dc6('0x7e'));break;default:_0x56aa26[_0x4dc6('0x1c')]('\x22\x22');}}}}else{var _0x368591='';if(!_[_0x4dc6('0x1a')](_0x35844f)){if(!_0x2d269c['hasOwnProperty'](_0x35844f['id'])){for(var _0x1a9091=0x0;_0x1a9091<_0x3c26d0[_0x31f4cf]['length'];_0x1a9091++){var _0x3dc6cb=_[_0x4dc6('0x71')](_0x5ce7a8[_0x4dc6('0x6e')][_0x4b2bba][_0x3c26d0[_0x31f4cf][_0x1a9091]][_0x4dc6('0x72')](/"/g,'\x27'));var _0x4b82be=phoneDescriptions[_0x4dc6('0x70')](_0x4d50d0=>_0x4d50d0['itemTypeId']===_0x35844f['id']);if(!_[_0x4dc6('0x1a')](_0x4b82be)){var _0x33cc60=_[_0x4dc6('0x71')](_0x5ce7a8[_0x4dc6('0x6e')][_0x4b2bba][_0x3c26d0[_0x4b82be[_0x4dc6('0x7f')]][0x0]][_0x4dc6('0x72')](/"/g,'\x27'));if(!_[_0x4dc6('0x1a')](_0x33cc60))_0x3dc6cb=_0x3dc6cb+'§'+_0x33cc60;}if(_0x368591=='')_0x368591=_0x3dc6cb;else _0x368591+='|'+_0x3dc6cb;}_0x103265[_0x4dc6('0x1c')](_0x35844f['id']+':'+_0x368591);_0x2d269c[_0x35844f['id']]=0x1;}}}}if(hasAdditionalPhones){_0x56aa26[_0x4dc6('0x1c')]('\x22'+_0x103265[_0x4dc6('0x14')](';')+'\x22');}if(_0x25ebd7['length']){handleError(_0x5ce7a8[_0x4dc6('0x6e')][_0x4b2bba],{'code':_0x4dc6('0x80'),'message':_0x25ebd7[_0x4dc6('0x14')]()});}else{fs['appendFileSync'](_0x1b57d7,_0x56aa26[_0x4dc6('0x14')]()+'\x0a');}_0x56aa26=[];}if(!(stats[_0x4dc6('0x6f')]%0xc8)){socket[_0x4dc6('0x81')]('contact:import:'+_0x99c6bb,stats);stats['errors']=[];}}if(stopped){logger['info']('Abort\x20parser');_0x71c185['abort']();}}catch(_0x2355fb){handleError(_0x5ce7a8[_0x4dc6('0x6e')][_0x4b2bba],{'code':_0x4dc6('0x82'),'message':_0x2355fb[_0x4dc6('0x5d')]});logger[_0x4dc6('0x1f')](_0x4dc6('0x83'),_0x2355fb[_0x4dc6('0x5d')]);}},'complete':function(){try{var _0x3ba204=[];var _0x2796e9=tempTableName;_0x3ba204['push'](_0x4dc6('0x84')+_0x2796e9+_0x4dc6('0x85'));logger[_0x4dc6('0x60')](_0x4dc6('0x86'),contactItemTypes[_0x4dc6('0x19')]);var _0x114b80=util['format'](_0x4dc6('0x87'),_0x1b57d7,_0x2796e9,_0x2496c6,_0x1d62c7[_0x4dc6('0x36')],_0x1d62c7['CompanyId']||null,NOW,NOW);if(_[_0x4dc6('0x1a')](_0x3c26d0[_0x4dc6('0x34')])){_0x114b80+=_0x4dc6('0x88');}_0x3ba204['push'](_0x114b80);BPromise['each'](_0x3ba204,handleQuery)[_0x4dc6('0x1e')](function(_0x4e86c8){BPromise[_0x4dc6('0x1d')]([handleAdditionalPhones()])[_0x4dc6('0x1e')](function(){_0x3ba204=[];for(var _0x3bf0ce=0x0;_0x3bf0ce\x20\x20','existsSync','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','uncaughtException','path','lodash','util','squel','../../../config/environment','../../../config/logger','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','then','catch','error','split','filter','findOne','CmContactHasItem','update','updated','PHONE','CmContact','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_hopper_black','fields','cm_hopper.id','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','toString','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','min_id','group','info','Received\x20SIGINT','message','exit','errors','sequelize','main','send','start','binding','root','.csv','body'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x09df,0x164));var _0xf09d=function(_0x1f7413,_0x3388c3){_0x1f7413=_0x1f7413-0x0;var _0x2d2775=_0x09df[_0x1f7413];return _0x2d2775;};'use strict';var fs=require('fs');var path=require(_0xf09d('0x0'));var _=require(_0xf09d('0x1'));var Papa=require('papaparse');var util=require(_0xf09d('0x2'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0xf09d('0x3'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0xf09d('0x4'));var logger=require(_0xf09d('0x5'))('import');config['redis']=_['defaults'](config[_0xf09d('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xf09d('0x7'))(new Redis(config[_0xf09d('0x6')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xf09d('0x8')](_0xf09d('0x9'));var tempTableName=_0xf09d('0xa')+moment()[_0xf09d('0x8')](_0xf09d('0xb'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x5c1b57){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xf09d('0xc')](_0x5c1b57);}function selectNotIn(_0x227a55,_0x56a961,_0x38d929,_0x5eab7c,_0x2f9736){return squel[_0xf09d('0xd')]()[_0xf09d('0xe')](_0xf09d('0xf'))[_0xf09d('0x10')](_0x5eab7c)[_0xf09d('0x11')](_0x56a961,null,_0x56a961+_0xf09d('0x12')+_0x5eab7c+'.'+_0x38d929)[_0xf09d('0x13')](_0x5eab7c+'.'+_0x38d929+_0xf09d('0x14')+_0x227a55+'.'+_0x38d929)['where'](_0x56a961+_0xf09d('0x15')+_0x2f9736[_0xf09d('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x6bb95b,_0x486d20){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0xf09d('0x16')](_0xf09d('0x17')+tempTableName)[_0xf09d('0x18')](function(_0x58ae3c){if(_0x58ae3c!==null){var _0x12bdec=[];for(var _0x5a03b9=0x0;_0x5a03b9<_0x58ae3c[_0xf09d('0x19')];_0x5a03b9++){var _0x2c5dbd=_0x58ae3c[_0x5a03b9];if(!_[_0xf09d('0x1a')](_0x2c5dbd[_0xf09d('0xf')])){if(!_['isNil'](_0x2c5dbd[_0xf09d('0x1b')]))_0x12bdec[_0xf09d('0x1c')](insertAdditionalPhones(_0x2c5dbd));promisesContact[_0xf09d('0x1c')]({'contact':_0x2c5dbd});}}}Promise[_0xf09d('0x1d')](_0x12bdec)[_0xf09d('0x1e')](function(){_0x6bb95b({'val':0x1});});})[_0xf09d('0x1f')](function(_0x4f336c){logger[_0xf09d('0x20')](_0x4f336c['message']);});});}function insertAdditionalPhones(_0x380b14){return new Promise(function(_0x342e14,_0x408ede){var _0x236222=_0x380b14[_0xf09d('0x1b')];if(_[_0xf09d('0x1a')](_0x236222))_0x408ede({'val':0x0});else{var _0x4e8f95=_0x236222[_0xf09d('0x21')](';');var _0x2ab436=[];orderBy=0x0;for(var _0x2ab38c=0x0;_0x2ab38c<_0x4e8f95[_0xf09d('0x19')];_0x2ab38c++){_0x2ab436[_0xf09d('0x1c')](splitAdditionalPhone(_0x380b14['id'],_0x4e8f95[_0x2ab38c]));}Promise[_0xf09d('0x1d')](_0x2ab436)[_0xf09d('0x1e')](function(){_0x342e14({'val':_0x4e8f95[_0xf09d('0x19')]});});}});}function splitAdditionalPhone(_0x507484,_0x394934){return new Promise(function(_0x59f232,_0x383ff6){var _0x47c6c5=_0x394934[_0xf09d('0x21')](':');var _0x1e4c35=_0x47c6c5[0x0];var _0x369700=_0x47c6c5[0x1];if(_0x369700!==''){var _0x3363ae=_0x369700[_0xf09d('0x21')]('|');var _0x2aa592=[];for(var _0x56b56a=0x0;_0x56b56a<_0x3363ae[_0xf09d('0x19')];_0x56b56a++){if(_0x3363ae[_0x56b56a]!==''){var _0x35957d=_[_0xf09d('0x22')](promisesAdditionalPhones,{'contactId':_0x507484,'phone':_0x3363ae[_0x56b56a]});if(_0x35957d['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x507484,'contactTypeId':_0x1e4c35,'phone':_0x3363ae[_0x56b56a],'orderBy':orderBy});}}}_0x59f232({'ok':0x1});}else _0x59f232({'res':0x0});});}function createAdditionalPhone(_0x587125,_0x2f3803,_0x2d1da5,_0x28eb98){var _0x287841='';var _0x45e073='';var _0x34efaa=_0x2d1da5[_0xf09d('0x21')]('§');_0x287841=_0x34efaa[0x0];if(_0x34efaa['length']==0x2)_0x45e073=_0x34efaa[0x1];return new Promise(function(_0x3d3475,_0x4b20f5){return db['CmContactHasItem'][_0xf09d('0x23')]({'where':{'CmContactId':_0x587125,'item':_0x287841}})[_0xf09d('0x1e')](function(_0x5a7cbe){if(_0x5a7cbe){return db[_0xf09d('0x24')][_0xf09d('0x25')]({'ItemTypeId':_0x2f3803,'description':_0x45e073,'OrderBy':_0x28eb98},{'where':{'CmContactId':_0x587125,'item':_0x287841}})[_0xf09d('0x1e')](function(_0x56863a){_0x3d3475({'res':_0xf09d('0x26')});});}else{return db[_0xf09d('0x24')]['create']({'CmContactId':_0x587125,'item':_0x287841,'ItemTypeId':_0x2f3803,'description':_0x45e073,'OrderBy':_0x28eb98,'ItemClass':_0xf09d('0x27')})[_0xf09d('0x1e')](function(_0x4cf7bf){_0x3d3475({'res':'inserted'});});}});});}function updateContact(_0x3c0ef9){return new Promise(function(_0x50ecae,_0x49b33e){var _0x2724cb=_0x3c0ef9['id'];delete _0x3c0ef9['id'];return db[_0xf09d('0x28')]['update'](_0x3c0ef9,{'where':{'id':_0x2724cb}})[_0xf09d('0x1e')](function(_0x5ddc8d){updatedRows+=0x1;return db['CmHopper']['update']({'phone':_0x3c0ef9[_0xf09d('0xf')]},{'where':{'ContactId':_0x2724cb}})[_0xf09d('0x1e')](function(_0x52c473){_0x50ecae({'ret':'OK'});});});});}function insertCmHopper(_0x2a7d17,_0x380f21,_0x345b4b,_0x479744,_0x504f63){var _0x2aa2e8=[_0xf09d('0x29'),_0xf09d('0x2a'),_0xf09d('0x2b'),_0xf09d('0x2c'),_0x380f21+'.'+_0x479744,'cm_contacts.createdAt','cm_contacts.updatedAt',_0xf09d('0x2d'),_0xf09d('0x2e'),'\x22'+_0x504f63+'\x22'];return squel[_0xf09d('0x2f')]()[_0xf09d('0x30')](_0xf09d('0x31'))[_0xf09d('0x32')]([_0xf09d('0xf'),_0xf09d('0x33'),_0xf09d('0x34'),_0xf09d('0x35'),_0x479744,_0xf09d('0x36'),_0xf09d('0x37'),'priority',_0xf09d('0x38'),'recallme'],squel[_0xf09d('0xd')]()['fields'](_0x2aa2e8)[_0xf09d('0x10')](_0x380f21)[_0xf09d('0x11')](_0xf09d('0x39'),null,_0xf09d('0x3a')+_0x380f21+_0xf09d('0x3b'))[_0xf09d('0x11')](_0x345b4b,null,_0x345b4b+_0xf09d('0x12')+_0x380f21+'.'+_0x479744)[_0xf09d('0x13')](_0x380f21+_0xf09d('0x3c'),_0x2a7d17)[_0xf09d('0x13')](_0xf09d('0x3d'),NOW)[_0xf09d('0x13')](_0xf09d('0x3e'),selectNotIn(_0x380f21,_0x345b4b,_0x479744,_0xf09d('0x31'),[_0xf09d('0x3f'),_0xf09d('0x40')]))[_0xf09d('0x13')](_0xf09d('0x3e'),selectNotIn(_0x380f21,_0x345b4b,_0x479744,_0xf09d('0x31'),[_0xf09d('0x3f')])))['toString']();}function insertCmHopperBlack(_0x109655,_0xa09f3e,_0x408dde,_0x28fc44){var _0x38355a=[_0xf09d('0x29'),_0xf09d('0x2b'),'cm_contacts.ListId',_0xa09f3e+'.'+_0x28fc44,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0xf09d('0x2f')]()[_0xf09d('0x30')](_0xf09d('0x41'))[_0xf09d('0x32')](['phone','ContactId',_0xf09d('0x35'),_0x28fc44,_0xf09d('0x36'),'updatedAt'],squel[_0xf09d('0xd')]()[_0xf09d('0x42')](_0x38355a)[_0xf09d('0x10')](_0xa09f3e)[_0xf09d('0x11')](_0xf09d('0x39'),null,_0xf09d('0x3a')+_0xa09f3e+'.CmListId')['join'](_0x408dde,null,_0x408dde+'.id\x20=\x20'+_0xa09f3e+'.'+_0x28fc44)['where'](_0xa09f3e+_0xf09d('0x3c'),_0x109655)[_0xf09d('0x13')](_0xf09d('0x3d'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xf09d('0xd')]()[_0xf09d('0xe')](_0xf09d('0xf'))[_0xf09d('0x10')](_0xf09d('0x41'))[_0xf09d('0x13')]('ListId\x20=\x20?',_0x109655)[_0xf09d('0x13')](_0x28fc44+'\x20=\x20?',_0xa09f3e+'.'+_0x28fc44)))['toString']();}function insertCmHopperAdditionalPhones(_0x6204fb){var _0x21f6c7=[_0xf09d('0x43'),'cm_contact_has_items.item','cm_contact_has_items.OrderBy',_0xf09d('0x44'),_0xf09d('0x45')];return squel[_0xf09d('0x2f')]()[_0xf09d('0x30')]('cm_hopper_additional_phones')[_0xf09d('0x32')]([_0xf09d('0x46'),_0xf09d('0xf'),_0xf09d('0x47'),_0xf09d('0x36'),_0xf09d('0x37')],squel[_0xf09d('0xd')]()[_0xf09d('0x42')](_0x21f6c7)[_0xf09d('0x10')]('cm_hopper')[_0xf09d('0x11')](_0xf09d('0x39'),null,_0xf09d('0x48'))[_0xf09d('0x11')](_0xf09d('0x49'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0xf09d('0x4a'),_0x6204fb)['where'](_0xf09d('0x3d'),NOW))[_0xf09d('0x4b')]();}function insertCmContact(_0x21c01f,_0x832840,_0x386167,_0x15f72f){var _0x2adebb=_['concat'](_['keys'](_0x15f72f),[_0xf09d('0x35'),_0xf09d('0x4c'),'createdAt',_0xf09d('0x37')]);return squel['insert']()['into'](_0xf09d('0x39'))[_0xf09d('0x32')](_0x2adebb,squel[_0xf09d('0xd')]()['fields'](_0x2adebb)[_0xf09d('0x10')](_0x832840)[_0xf09d('0x13')]('('+_0x386167['join'](',')+_0xf09d('0x4d'),squel[_0xf09d('0xd')]()['fields'](_0x386167)['from'](_0xf09d('0x39'))[_0xf09d('0x13')](_0xf09d('0x4e'),_0x21c01f))[_0xf09d('0x13')]('id\x20IN\x20?',squel[_0xf09d('0xd')]()['field']('MIN(id)',_0xf09d('0x4f'))[_0xf09d('0x10')](_0x832840)[_0xf09d('0x50')](_0x386167[_0xf09d('0x11')](','))))[_0xf09d('0x4b')]();}function handleStop(){logger[_0xf09d('0x51')](_0xf09d('0x52'));stopped=!![];}function handleUncaughtException(_0x24974c){logger[_0xf09d('0x20')](_0x24974c[_0xf09d('0x53')]);process[_0xf09d('0x54')](0x1);}function handleError(_0x35382e,_0x314c12){stats[_0xf09d('0x55')][_0xf09d('0x1c')]({'name':_0x314c12['code'],'message':_0x314c12['message'],'row':_0x35382e});}function handleQuery(_0x4a4665){logger[_0xf09d('0x51')](_0x4a4665);return db[_0xf09d('0x56')][_0xf09d('0x16')](_0x4a4665)['spread'](function(_0x3cab08){results[_0xf09d('0x1c')](_0x3cab08);})['catch'](function(_0x54a912){logger[_0xf09d('0x20')](_0x54a912[_0xf09d('0x53')]);});}function main(_0x25073c,_0x4813cb,_0x257fa8,_0x267818){logger['info'](_0xf09d('0x57'),_0x25073c,JSON['stringify'](_0x4813cb));process[_0xf09d('0x58')](_0xf09d('0x59'));var _0x1571da=_0x4813cb[_0xf09d('0x5a')];var _0x1a334d=_['clone'](_0x1571da);var _0x2bf20f=_0x4813cb['socket_timestamp'];var _0x23844c=path[_0xf09d('0x11')](config[_0xf09d('0x5b')],'server/files/tmp',_0x2bf20f+_0xf09d('0x5c'));logger[_0xf09d('0x51')](_0xf09d('0x5d'),_0x4813cb);db[_0xf09d('0x5e')][_0xf09d('0x5f')]({'raw':!![],'attributes':['id',_0xf09d('0x60')]})[_0xf09d('0x1e')](function(_0x46676c){for(var _0x296745=0x0;_0x296745<_0x46676c['length'];_0x296745++){if(_0x46676c[_0x296745][_0xf09d('0x60')]in _0x1571da){contactItemTypes[_0xf09d('0x1c')](_0x46676c[_0x296745]);delete _0x1a334d[_0x46676c[_0x296745][_0xf09d('0x60')]];hasAdditionalPhones=!![];}for(var _0x2f0b3c in _0x1571da){if(_0x46676c[_0x296745][_0xf09d('0x60')]+_0xf09d('0x61')===_0x2f0b3c){phoneDescriptions[_0xf09d('0x1c')]({'itemTypeId':_0x46676c[_0x296745]['id'],'description':_0x2f0b3c});delete _0x1a334d[_0x2f0b3c];}}}if(hasAdditionalPhones)_0x1a334d[_0xf09d('0x1b')]='';var _0x25efeb=_['keys'](_0x1a334d)[_0xf09d('0x11')]();logger[_0xf09d('0x51')](_0xf09d('0x62'),_0x25efeb);fs[_0xf09d('0x63')](_0x23844c,_0x25efeb+'\x0a');Papa[_0xf09d('0x64')](fs[_0xf09d('0x65')](_0x25073c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x111e96,_0x45850c){try{for(var _0x4e2919=0x0,_0x430d4a=[];_0x4e2919<_0x111e96[_0xf09d('0x66')][_0xf09d('0x19')];_0x4e2919++){stats[_0xf09d('0x67')]+=0x1;if(_0x111e96[_0xf09d('0x55')][_0x4e2919]){handleError(_0x111e96[_0xf09d('0x66')][_0x4e2919],_0x111e96['errors'][_0x4e2919]);}else{var _0x947d0e=[];var _0x49cb70=[];var _0xb68579={};for(var _0x2883a2 in _0x1571da){let _0x1eb3b8=contactItemTypes[_0xf09d('0x68')](_0x55316c=>_0x55316c['name']===_0x2883a2);let _0x205cbe=contactItemTypes['find'](_0x28cfcd=>_0x28cfcd[_0xf09d('0x60')]+_0xf09d('0x61')===_0x2883a2);if(_[_0xf09d('0x1a')](_0x1eb3b8)&&_[_0xf09d('0x1a')](_0x205cbe)){if(_0x1571da['hasOwnProperty'](_0x2883a2)){if(_0x111e96[_0xf09d('0x66')][_0x4e2919][_0x1571da[_0x2883a2]]){var _0x1f065a=_[_0xf09d('0x69')](_0x111e96[_0xf09d('0x66')][_0x4e2919][_0x1571da[_0x2883a2]]['replace'](/"/g,'\x27'));switch(_0x2883a2){case _0xf09d('0x33'):var _0x276a67=moment(_0x1f065a,_0xf09d('0x9'),!![]);if(_0x276a67[_0xf09d('0x6a')]()){_0x430d4a[_0xf09d('0x1c')]('\x22'+_0x1f065a+'\x22');}else{_0x947d0e[_0xf09d('0x1c')](_0xf09d('0x6b'));}break;case _0xf09d('0x6c'):var _0x2ec8fd=parseInt(_0x1f065a);_0x1f065a=_[_0xf09d('0x6d')](_0x2ec8fd)||_0x2ec8fd<0x0||_0x2ec8fd>0x4?_0x267818?0x3:0x2:_0x2ec8fd;_0x430d4a[_0xf09d('0x1c')]('\x22'+_0x1f065a+'\x22');break;case'UserId':var _0x32f239=parseInt(_0x1f065a);if(_['isNumber'](_0x32f239)&&_[_0xf09d('0x6e')](_0x257fa8,_0x32f239)){_0x430d4a['push']('\x22'+_0x32f239+'\x22');}else{_0x947d0e[_0xf09d('0x1c')](_0xf09d('0x6f'));}break;case _0xf09d('0x70'):if(isEmail(_0x1f065a)){_0x430d4a['push']('\x22'+_0x1f065a+'\x22');}else{_0x947d0e[_0xf09d('0x1c')]('email\x20wrong\x20format');}break;case _0xf09d('0x71'):var _0x101473=moment(_0x1f065a,_0xf09d('0x72'),!![]);if(_0x101473[_0xf09d('0x6a')]()){_0x430d4a['push']('\x22'+_0x1f065a+'\x22');}else{_0x947d0e[_0xf09d('0x1c')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x430d4a[_0xf09d('0x1c')]('\x22'+_0x1f065a+'\x22');}}else{switch(_0x2883a2){case _0xf09d('0x73'):case _0xf09d('0xf'):_0x947d0e[_0xf09d('0x1c')](_0x2883a2+_0xf09d('0x74'));break;default:_0x430d4a[_0xf09d('0x1c')]('\x22\x22');}}}}else{var _0x486db3='';if(!_[_0xf09d('0x1a')](_0x1eb3b8)){if(!_0xb68579[_0xf09d('0x75')](_0x1eb3b8['id'])){for(var _0x2aa3ce=0x0;_0x2aa3ce<_0x1571da[_0x2883a2][_0xf09d('0x19')];_0x2aa3ce++){var _0x1f065a=_[_0xf09d('0x69')](_0x111e96['data'][_0x4e2919][_0x1571da[_0x2883a2][_0x2aa3ce]][_0xf09d('0x76')](/"/g,'\x27'));var _0x5748eb=phoneDescriptions[_0xf09d('0x68')](_0x1eaac2=>_0x1eaac2[_0xf09d('0x77')]===_0x1eb3b8['id']);if(!_[_0xf09d('0x1a')](_0x5748eb)){var _0x41da73=_[_0xf09d('0x69')](_0x111e96[_0xf09d('0x66')][_0x4e2919][_0x1571da[_0x5748eb[_0xf09d('0x78')]][0x0]][_0xf09d('0x76')](/"/g,'\x27'));if(!_[_0xf09d('0x1a')](_0x41da73))_0x1f065a=_0x1f065a+'§'+_0x41da73;}if(_0x486db3=='')_0x486db3=_0x1f065a;else _0x486db3+='|'+_0x1f065a;}_0x49cb70['push'](_0x1eb3b8['id']+':'+_0x486db3);_0xb68579[_0x1eb3b8['id']]=0x1;}}}}if(hasAdditionalPhones){_0x430d4a[_0xf09d('0x1c')]('\x22'+_0x49cb70[_0xf09d('0x11')](';')+'\x22');}if(_0x947d0e[_0xf09d('0x19')]){handleError(_0x111e96[_0xf09d('0x66')][_0x4e2919],{'code':_0xf09d('0x79'),'message':_0x947d0e[_0xf09d('0x11')]()});}else{fs[_0xf09d('0x7a')](_0x23844c,_0x430d4a['join']()+'\x0a');}_0x430d4a=[];}if(!(stats[_0xf09d('0x67')]%0xc8)){socket['emit'](_0xf09d('0x7b')+_0x2bf20f,stats);stats[_0xf09d('0x55')]=[];}}if(stopped){logger[_0xf09d('0x51')](_0xf09d('0x7c'));_0x45850c[_0xf09d('0x7d')]();}}catch(_0x538fd9){handleError(_0x111e96['data'][_0x4e2919],{'code':'SystemError','message':_0x538fd9[_0xf09d('0x53')]});logger[_0xf09d('0x20')](_0xf09d('0x7e'),_0x538fd9[_0xf09d('0x53')]);}},'complete':function(){try{var _0x52dec5=[];var _0x1ba02e=tempTableName;_0x52dec5['push'](_0xf09d('0x7f')+_0x1ba02e+'\x20LIKE\x20cm_contacts;');logger[_0xf09d('0x51')](_0xf09d('0x80'),contactItemTypes['length']);var _0x588cfb=util[_0xf09d('0x8')](_0xf09d('0x81'),_0x23844c,_0x1ba02e,_0x25efeb,_0x4813cb[_0xf09d('0x35')],_0x4813cb[_0xf09d('0x4c')]||null,NOW,NOW);if(_[_0xf09d('0x1a')](_0x1571da[_0xf09d('0x33')])){_0x588cfb+=_0xf09d('0x82');}_0x52dec5[_0xf09d('0x1c')](_0x588cfb);BPromise[_0xf09d('0x83')](_0x52dec5,handleQuery)[_0xf09d('0x1e')](function(_0x1b59d2){BPromise['all']([handleAdditionalPhones()])[_0xf09d('0x1e')](function(){_0x52dec5=[];for(var _0x4f1611=0x0;_0x4f1611\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.ContactId','i.MailAccountId','i.UserId','openchannel','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','clone','t.id\x20IN\x20?','exports','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','select','field','name','from','tools_tags','getInteractionFK','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','where','getInteractionsTables','interactions','cm_contacts','o.id\x20=\x20i.UserId','accounts','it.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','i.from\x20LIKE\x20?','mail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','parseSearch','sqlOperator','conditions','buildExpression','type','value','end','unreadMessages','read','operator','$substring','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','text','Tag','map','clause','and','tags','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','keys','compact','concat','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','then','tag','filter','get','capitalize','chat','resolve','search','\x20IS\x20NOT\x20NULL'];(function(_0x1c6779,_0x4dd577){var _0xc28824=function(_0x4cb413){while(--_0x4cb413){_0x1c6779['push'](_0x1c6779['shift']());}};_0xc28824(++_0x4dd577);}(_0xb37c,0xdc));var _0xcb37=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xb37c[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var squel=require('squel');var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require(_0xcb37('0x0'))[_0xcb37('0x1')];var utils=require(_0xcb37('0x2'));var db=require(_0xcb37('0x3'))['db'];function skipInteractionsQuery(_0x34e748,_0x24413b,_0xf07931){var _0x3a27b8=![];var _0x2733e1=utils[_0xcb37('0x4')](_0x34e748);if(_0x24413b['role']==='agent'&&!_0xf07931['search']&&!_0xf07931[_0x2733e1]){_0x3a27b8=!![];}return _0x3a27b8;}function getTagsQuery(){return squel[_0xcb37('0x5')]()[_0xcb37('0x6')]('id')[_0xcb37('0x6')](_0xcb37('0x7'))[_0xcb37('0x6')]('color')[_0xcb37('0x8')](_0xcb37('0x9'));}function getUsersQuery(_0x110018,_0x2ee2f5){var _0x43d68d=utils[_0xcb37('0xa')](_0x110018);var _0x466953='user_has_'+_0x110018+'_interactions';var _0x3bca43=squel[_0xcb37('0x5')]()[_0xcb37('0x6')](_0xcb37('0xb'))[_0xcb37('0x6')](_0xcb37('0xc'))[_0xcb37('0x6')](_0xcb37('0xd')+_0x43d68d)[_0xcb37('0x8')](_0x466953,'ui')[_0xcb37('0xe')](_0xcb37('0xf'),'u',_0xcb37('0x10'));if(_0x2ee2f5['length']>0x0){_0x3bca43[_0xcb37('0x11')](_0xcb37('0xd')+_0x43d68d+'\x20IN\x20?',_['map'](_0x2ee2f5,'id'));}return _0x3bca43;}function getInteractionsQuery(_0x53b4e0){var _0x5d9258=utils[_0xcb37('0x12')](_0x53b4e0);var _0x214cf8=utils[_0xcb37('0x4')](_0x53b4e0);var _0xc76495=utils[_0xcb37('0xa')](_0x53b4e0);return squel[_0xcb37('0x5')]()[_0xcb37('0x8')](_0x5d9258[_0xcb37('0x13')],'i')['left_join'](_0xcb37('0x14'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xcb37('0xe')](_0xcb37('0xf'),'o',_0xcb37('0x15'))[_0xcb37('0xe')](_0x5d9258[_0xcb37('0x16')],'a','a.id\x20=\x20i.'+_0x214cf8)['left_join'](_0x5d9258['messages'],'me','me.'+_0xc76495+'\x20=\x20i.id')[_0xcb37('0xe')](_0x5d9258['interactionsTags'],'it',_0xcb37('0x17')+_0xc76495+_0xcb37('0x18'))[_0xcb37('0xe')](_0xcb37('0x9'),'t',_0xcb37('0x19'));}function getSqlClauses(){var _0x3b1b17={'body':squel[_0xcb37('0x1a')](),'contact':squel[_0xcb37('0x1a')](),'default':squel[_0xcb37('0x1a')](),'fields':squel[_0xcb37('0x1a')](),'filter':squel[_0xcb37('0x1a')](),'read':squel[_0xcb37('0x1a')](),'tags':{'clause':squel[_0xcb37('0x1a')](),'ids':null},'user':squel[_0xcb37('0x1a')]()};return _0x3b1b17;}function parseTagParameter(_0x198ea9){var _0x251fac=squel[_0xcb37('0x1a')]();if(_0x198ea9){var _0x5f3ffe=utils['getSelectedTags'](_0x198ea9);_0x5f3ffe[_0xcb37('0x1b')](function(_0x21ffc7){_0x251fac['or'](_0xcb37('0x1c'),'%,'+_0x21ffc7+',%');});}return _0x251fac;}function parseReadParameter(_0x406763){var _0x2d1885='';if(_0x406763){_0x2d1885=_0xcb37('0x1d');if(_0x406763==='1'){_0x2d1885=_0x2d1885[_0xcb37('0x1e')](_0xcb37('0x1f'),'=');}else{_0x2d1885=_0x2d1885[_0xcb37('0x1e')]('{OPERATOR}','>');}}return _0x2d1885;}function parseSearchFilter(_0x380369,_0x55c726){var _0xc81ebb=squel[_0xcb37('0x1a')]();if(_0x55c726){var _0x368167=_0x55c726[_0xcb37('0x1e')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xcb37('0x20')](_0x368167)){_0xc81ebb['or'](_0xcb37('0x21'),_0x368167+'%');if([_0xcb37('0x22'),_0xcb37('0x23')]['includes'](_0x380369)){_0xc81ebb['or'](_0xcb37('0x24'),_0x368167+'%');}else if(_0x380369===_0xcb37('0x25')){_0xc81ebb['or'](_0xcb37('0x26'),_0x368167+'%');}else if(_0x380369==='openchannel'){_0xc81ebb['or'](_0xcb37('0x27'),_0x368167+'%');}}else if(_0x380369===_0xcb37('0x28')&&qs['isEmail'](_0x368167)){_0xc81ebb['or'](_0xcb37('0x29'),_0x368167+'%');}else{if(_0x380369===_0xcb37('0x28')){_0xc81ebb['or'](_0xcb37('0x2a'),qs['getFullTextValue'](_0x368167,!![]))['or'](_0xcb37('0x2b'),qs['getFullTextValue'](_0x368167));}else if(_0x380369!==_0xcb37('0x25')){_0xc81ebb['or'](_0xcb37('0x2c'),qs[_0xcb37('0x2d')](_0x368167));}_0xc81ebb['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xcb37('0x2d')](_0x368167,!![]),null);}}return _0xc81ebb;}function parseAdvancedSearchFilter(_0x1bb324,_0x27650b){var _0x5ce1a3=getSqlClauses();var _0x8aca24=as[_0xcb37('0x2e')](_0x1bb324);var _0x2e5547=_0x8aca24[_0xcb37('0x2f')];for(var _0x233f33=0x0;_0x233f33<_0x8aca24[_0xcb37('0x30')]['length'];_0x233f33++){var _0x3315f8=_0x8aca24[_0xcb37('0x30')][_0x233f33];var _0x56207e='i';var _0x427340=_['find'](_0x27650b,[_0xcb37('0x7'),_0x3315f8[_0xcb37('0x6')]]);if(_0x427340){var _0x5b99a2=as[_0xcb37('0x31')](_0x56207e,_0x427340[_0xcb37('0x32')],_0x3315f8);_0x5ce1a3['default'][_0x2e5547](_0x5b99a2['text'],_0x5b99a2[_0xcb37('0x33')]['start'],_0x5b99a2['value'][_0xcb37('0x34')]);}else{switch(_0x3315f8[_0xcb37('0x6')]){case _0xcb37('0x35'):var _0x59b5c1=parseReadParameter(_0x3315f8[_0xcb37('0x33')]);_0x5ce1a3[_0xcb37('0x36')]['and'](_0x59b5c1);break;case'Contact':if(_0x3315f8[_0xcb37('0x37')]===_0xcb37('0x38')){if(_0x3315f8[_0xcb37('0x33')][_0xcb37('0x39')]('\x20')[_0xcb37('0x3a')]>0x1){_0x5ce1a3['contact'][_0x2e5547](_0xcb37('0x3b'),qs['getFullTextValue'](_0x3315f8[_0xcb37('0x33')],!![]),null);}else{var _0x3cd761='%'+_0x3315f8[_0xcb37('0x33')]+'%';_0x5ce1a3[_0xcb37('0x3c')][_0x2e5547](_0xcb37('0x3d'),_0x3cd761,_0x3cd761,_0x3cd761);}}else{_0x427340=_[_0xcb37('0x3e')](_0x27650b,['name',_0xcb37('0x3f')]);_0x3315f8[_0xcb37('0x6')]=_0xcb37('0x3f');_0x5b99a2=as['buildExpression'](_0x56207e,_0x427340[_0xcb37('0x32')],_0x3315f8);_0x5ce1a3[_0xcb37('0x3c')][_0x2e5547](_0x5b99a2[_0xcb37('0x40')],_0x5b99a2['value']['start'],_0x5b99a2[_0xcb37('0x33')][_0xcb37('0x34')]);}break;case _0xcb37('0x41'):var _0x3ffc1c=_0x3315f8[_0xcb37('0x33')][_0xcb37('0x39')](',')[_0xcb37('0x42')](function(_0x58bc06){return Number(_0x58bc06);});var _0x3b313b=parseTagParameter(_0x3ffc1c);_0x5ce1a3['tags'][_0xcb37('0x43')][_0xcb37('0x44')](_0x3b313b);_0x5ce1a3[_0xcb37('0x45')]['ids']=_0x3ffc1c;break;case'User':if(_0x3315f8[_0xcb37('0x37')]===_0xcb37('0x38')){_0x5ce1a3[_0xcb37('0x46')][_0x2e5547](_0xcb37('0x47'),'%'+_0x3315f8[_0xcb37('0x33')]+'%',null);}else{_0x427340=_[_0xcb37('0x3e')](_0x27650b,[_0xcb37('0x7'),_0xcb37('0x48')]);_0x3315f8[_0xcb37('0x6')]=_0xcb37('0x48');_0x5b99a2=as[_0xcb37('0x31')](_0x56207e,_0x427340[_0xcb37('0x32')],_0x3315f8);_0x5ce1a3[_0xcb37('0x46')][_0x2e5547](_0x5b99a2['text'],_0x5b99a2[_0xcb37('0x33')][_0xcb37('0x49')],_0x5b99a2[_0xcb37('0x33')][_0xcb37('0x34')]);}break;case _0xcb37('0x4a'):case'plainBody':_0x5b99a2=as[_0xcb37('0x31')]('me',null,_0x3315f8);_0x5ce1a3[_0xcb37('0x4a')][_0x2e5547](_0x5b99a2[_0xcb37('0x40')],_0x5b99a2[_0xcb37('0x33')][_0xcb37('0x49')],_0x5b99a2[_0xcb37('0x33')][_0xcb37('0x34')]);break;}}}return _0x5ce1a3;}function parseModelFields(_0xc9e469,_0x377232,_0x5bb04c){var _0x13ecef=utils[_0xcb37('0x4')](_0xc9e469);var _0x292cf5=squel[_0xcb37('0x1a')]();var _0x135c4c=_(_0x377232)[_0xcb37('0x4b')]()[_0xcb37('0x42')](function(_0x21ab97){return _['some'](_0x5bb04c,[_0xcb37('0x7'),_0x21ab97])?_0x21ab97:undefined;})[_0xcb37('0x4c')]()[_0xcb37('0x33')]();if(_0x135c4c['length']>0x0){_0x135c4c[_0xcb37('0x1b')](function(_0x102c1f){if(_0x102c1f===_0x13ecef){_0x292cf5[_0xcb37('0x44')]('i.'+_0x13ecef+'\x20IN\x20?',[][_0xcb37('0x4d')](_0x377232[_0x102c1f]));}else if(_0x102c1f==='createdAt'){var _0x3234f2=JSON[_0xcb37('0x4e')](_0x377232[_0x102c1f])['$gte'];var _0x2d3f6f=JSON['parse'](_0x377232[_0x102c1f])['$lte'];_0x292cf5[_0xcb37('0x44')](_0xcb37('0x4f'),_0x3234f2,_0x2d3f6f);}else{if(_0x377232[_0x102c1f]===_0xcb37('0x50')){_0x292cf5[_0xcb37('0x44')]('i.'+_0x102c1f+_0xcb37('0x51'));}else{_0x292cf5[_0xcb37('0x44')]('i.'+_0x102c1f+_0xcb37('0x52'),_0x377232[_0x102c1f]);}}});}return _0x292cf5;}function parseQueryParameters(_0x3d59cd,_0x5964f4,_0x4f3c1f){var _0x5e02f8=getSqlClauses();return Promise['resolve']()['then'](function(){return parseModelFields(_0x3d59cd,_0x5964f4,_0x4f3c1f);})[_0xcb37('0x53')](function(_0x472cdf){_0x5e02f8['fields'][_0xcb37('0x44')](_0x472cdf);return parseReadParameter(_0x5964f4[_0xcb37('0x36')]);})[_0xcb37('0x53')](function(_0x2d5d67){_0x5e02f8[_0xcb37('0x36')][_0xcb37('0x44')](_0x2d5d67);return parseTagParameter(_0x5964f4[_0xcb37('0x54')]);})[_0xcb37('0x53')](function(_0x3a05b7){_0x5e02f8[_0xcb37('0x45')]['clause'][_0xcb37('0x44')](_0x3a05b7);return parseSearchFilter(_0x3d59cd,_0x5964f4[_0xcb37('0x55')]);})[_0xcb37('0x53')](function(_0x336adb){_0x5e02f8[_0xcb37('0x55')]=_0x336adb;return _0x5e02f8;});}function checkAccountsRestrictions(_0xb77e58,_0x259651,_0x190e67){var _0xf5222b=utils[_0xcb37('0x4')](_0xb77e58);var _0x5ab073=_0xcb37('0x56')+_[_0xcb37('0x57')](_0xb77e58)+(_0xb77e58===_0xcb37('0x58')?'Websites':'Accounts');var _0x42add5=squel[_0xcb37('0x1a')]();return Promise[_0xcb37('0x59')]()[_0xcb37('0x53')](function(){if(_0x190e67[_0xcb37('0x5a')]&&_0x259651['role']==='agent'){return _0x259651[_0x5ab073]({'attributes':['id'],'raw':!![]});}})[_0xcb37('0x53')](function(_0x5c6b87){if(_0x5c6b87){if(_0x5c6b87[_0xcb37('0x3a')]===0x0){_0x42add5['and']('i.'+_0xf5222b+_0xcb37('0x51'));}else{_0x42add5[_0xcb37('0x44')]('i.'+_0xf5222b+'\x20IN\x20?',_['map'](_0x5c6b87,'id'));}}else if(!_0x190e67[_0xf5222b]){_0x42add5['and']('i.'+_0xf5222b+_0xcb37('0x5b'));}})[_0xcb37('0x53')](function(){return _0x42add5;});}function getClosedOrderClause(_0x1e0420,_0x44d89b){var _0x93762e='';var _0x4b0535=[_0xcb37('0x5c'),'i.secondDisposition','i.disposition'];if(_0x1e0420===_0xcb37('0x28')){_0x4b0535['unshift'](_0xcb37('0x5d'));}if(_0x44d89b[_0xcb37('0x5e')]==='0'&&_0x1e0420===_0xcb37('0x28')){_0x93762e=_0xcb37('0x5d');}else{if(_0x44d89b[_0xcb37('0x5e')]==='1'){_0x4b0535[_0xcb37('0x5f')]();}_0x93762e='CONCAT_WS(\x27\x27,\x20'+_0x4b0535[_0xcb37('0x60')](',\x20')+')';}return _0x93762e;}function getFilteredInteractions(_0x2f57ff,_0x1056ba,_0x326495,_0xa758a0){var _0x51ceff=utils[_0xcb37('0xa')](_0x2f57ff);var _0x2c360a=_[_0xcb37('0x57')](_0x2f57ff)+'Interaction';var _0x374a65=[];var _0x4f4f29=getTagsQuery();var _0x4be87d={'type':db['Sequelize'][_0xcb37('0x61')][_0xcb37('0x62')],'raw':!![]};var _0x1e0cc9=[];var _0x530f3f=[];return db[_0xcb37('0x63')][_0xcb37('0x64')](_0x4f4f29[_0xcb37('0x65')](),_0x4be87d)[_0xcb37('0x53')](function(_0x188094){_0x374a65=_[_0xcb37('0x66')](_0x188094,'id');_0x4be87d=_[_0xcb37('0x67')](_0x4be87d,{'model':db[_0x2c360a],'mapToModel':!![],'nest':!![]});if(_0x326495[_0xcb37('0x68')]){_0xa758a0[_0xcb37('0x69')]['forEach'](function(_0x468a31){_0x1056ba['field']('i.'+_0x468a31);});}else{_0x1056ba[_0xcb37('0x6')](_0xcb37('0x6a'),_0xcb37('0x35'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x6b'),_0xcb37('0x6c'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x6d'),_0xcb37('0x6e'));if(_0x2f57ff===_0xcb37('0x28')){_0x1056ba['field']('a.email',_0xcb37('0x6f'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x70'),_0xcb37('0x71'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x72'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x73'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x74'));_0x1056ba['field']('i.closed');_0x1056ba[_0xcb37('0x6')](_0xcb37('0x75'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x76'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x77'));_0x1056ba['field'](_0xcb37('0x78'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x79'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x7a'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x7b'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x5c'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x5d'));_0x1056ba[_0xcb37('0x6')]('i.to');_0x1056ba[_0xcb37('0x6')](_0xcb37('0x7c'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x7d'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x7e'));}else if(_0x2f57ff===_0xcb37('0x7f')){_0x1056ba[_0xcb37('0x6')](_0xcb37('0x80'),_0xcb37('0x71'));}else{_0x1056ba['field'](_0xcb37('0x81'),_0xcb37('0x71'));}if(_0x2f57ff!==_0xcb37('0x28')){_0x1056ba[_0xcb37('0x6')](_0xcb37('0x82'));}_0x1056ba[_0xcb37('0x6')]('c.firstName',_0xcb37('0x83'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x84'),_0xcb37('0x85'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x86'),_0xcb37('0x87'));_0x1056ba['field'](_0xcb37('0x88'),'Contact.phone');_0x1056ba[_0xcb37('0x6')](_0xcb37('0x89'),_0xcb37('0x8a'));_0x1056ba['field'](_0xcb37('0x8b'),_0xcb37('0x8c'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x8d'),_0xcb37('0x8e'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x8f'),_0xcb37('0x90'));_0x1056ba[_0xcb37('0x6')](_0xcb37('0x91'),'TagIds');}if(_0xa758a0[_0xcb37('0x92')]){_0x1056ba['limit'](_0xa758a0[_0xcb37('0x92')]);}if(_0xa758a0[_0xcb37('0x93')]){_0x1056ba[_0xcb37('0x93')](_0xa758a0[_0xcb37('0x93')]);}return db[_0xcb37('0x63')]['query'](_0x1056ba['toString'](),_0x4be87d);})[_0xcb37('0x53')](function(_0x2eb93e){_0x1e0cc9=_0x2eb93e;var _0x3388ad=getUsersQuery(_0x2f57ff,_0x1e0cc9);return db[_0xcb37('0x63')][_0xcb37('0x64')](_0x3388ad[_0xcb37('0x65')](),_0x4be87d);})[_0xcb37('0x53')](function(_0x327b6e){_0x530f3f=_[_0xcb37('0x94')](_0x327b6e,_0x51ceff);if(_0x2f57ff===_0xcb37('0x28')){return db[_0xcb37('0x95')][_0xcb37('0x96')]({'attributes':[_0xcb37('0x97')],'raw':!![]});}})['then'](function(_0x1d7d73){var _0x3d2c2e=_0x1d7d73?_0x1d7d73[_0xcb37('0x97')]:undefined;var _0x321b35=_0x1e0cc9[_0xcb37('0x42')](function(_0x46497a){return updateInteraction(_0x46497a,_0x374a65,_0x530f3f,_0x3d2c2e);});return Promise[_0xcb37('0x98')](_0x321b35);});}function countFilteredInteractions(_0x45f0b2,_0x32d883){var _0x278d42=_0x45f0b2[_0xcb37('0x99')]();_0x278d42['field']('COUNT(*)');_0x278d42[_0xcb37('0x6')](_0xcb37('0x6a'),_0xcb37('0x35'));var _0x10395b=utils['getSelectedTags'](_0x32d883);if(!_['isEmpty'](_0x10395b)){_0x278d42[_0xcb37('0x11')](_0xcb37('0x9a'),_0x10395b);}var _0x5489dc={'type':db['Sequelize'][_0xcb37('0x61')][_0xcb37('0x62')],'raw':!![]};return db[_0xcb37('0x63')]['query'](_0x278d42[_0xcb37('0x65')](),_0x5489dc);}module[_0xcb37('0x9b')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xc0ee=['tools_tags','getInteractionFK','user_has_','_interactions','u.id','left_join','users','u.id\x20=\x20ui.UserId','where','ui.','map','getInteractionsTables','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','sms','whatsapp','includes','fax','i.fax\x20LIKE\x20?','openchannel','c.email\x20LIKE\x20?','mail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','sqlOperator','conditions','length','find','name','buildExpression','type','default','text','value','end','read','Contact','operator','$substring','split','contact','ContactId','start','Tag','tags','clause','and','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','tag','capitalize','chat','Websites','Accounts','\x20IN\x20?','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','TagIds','limit','offset','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','exports','squel','../parsers/advancedSearch','getAccountFK','role','agent','search','select','field','color','from'];(function(_0x5584aa,_0x3d40f7){var _0xf2ca7f=function(_0x1d1c26){while(--_0x1d1c26){_0x5584aa['push'](_0x5584aa['shift']());}};_0xf2ca7f(++_0x3d40f7);}(_0xc0ee,0x1df));var _0xec0e=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0xc0ee[_0x4099ee];return _0x1b7bfc;};'use strict';var _=require('lodash');var squel=require(_0xec0e('0x0'));var as=require(_0xec0e('0x1'));var qs=require('../parsers/qs');var updateInteraction=require('./update-interaction')['updateInteraction'];var utils=require('./utils');var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x5ee1ad,_0x3c51b7,_0x5a6781){var _0x578a3e=![];var _0x4fdedc=utils[_0xec0e('0x2')](_0x5ee1ad);if(_0x3c51b7[_0xec0e('0x3')]===_0xec0e('0x4')&&!_0x5a6781[_0xec0e('0x5')]&&!_0x5a6781[_0x4fdedc]){_0x578a3e=!![];}return _0x578a3e;}function getTagsQuery(){return squel[_0xec0e('0x6')]()['field']('id')[_0xec0e('0x7')]('name')[_0xec0e('0x7')](_0xec0e('0x8'))[_0xec0e('0x9')](_0xec0e('0xa'));}function getUsersQuery(_0x4762b7,_0x5f19b7){var _0x21c64b=utils[_0xec0e('0xb')](_0x4762b7);var _0x394cea=_0xec0e('0xc')+_0x4762b7+_0xec0e('0xd');var _0x13b08d=squel[_0xec0e('0x6')]()[_0xec0e('0x7')](_0xec0e('0xe'))[_0xec0e('0x7')]('u.fullname')[_0xec0e('0x7')]('ui.'+_0x21c64b)[_0xec0e('0x9')](_0x394cea,'ui')[_0xec0e('0xf')](_0xec0e('0x10'),'u',_0xec0e('0x11'));if(_0x5f19b7['length']>0x0){_0x13b08d[_0xec0e('0x12')](_0xec0e('0x13')+_0x21c64b+'\x20IN\x20?',_[_0xec0e('0x14')](_0x5f19b7,'id'));}return _0x13b08d;}function getInteractionsQuery(_0x475b7f){var _0x58391b=utils[_0xec0e('0x15')](_0x475b7f);var _0x4a6485=utils[_0xec0e('0x2')](_0x475b7f);var _0x1727e9=utils['getInteractionFK'](_0x475b7f);return squel[_0xec0e('0x6')]()['from'](_0x58391b[_0xec0e('0x16')],'i')['left_join'](_0xec0e('0x17'),'c',_0xec0e('0x18'))[_0xec0e('0xf')]('users','o',_0xec0e('0x19'))[_0xec0e('0xf')](_0x58391b[_0xec0e('0x1a')],'a',_0xec0e('0x1b')+_0x4a6485)[_0xec0e('0xf')](_0x58391b[_0xec0e('0x1c')],'me',_0xec0e('0x1d')+_0x1727e9+_0xec0e('0x1e'))[_0xec0e('0xf')](_0x58391b[_0xec0e('0x1f')],'it',_0xec0e('0x20')+_0x1727e9+'\x20=\x20i.id')['left_join'](_0xec0e('0xa'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0xd452de={'body':squel[_0xec0e('0x21')](),'contact':squel[_0xec0e('0x21')](),'default':squel[_0xec0e('0x21')](),'fields':squel['expr'](),'filter':squel['expr'](),'read':squel[_0xec0e('0x21')](),'tags':{'clause':squel[_0xec0e('0x21')](),'ids':null},'user':squel[_0xec0e('0x21')]()};return _0xd452de;}function parseTagParameter(_0xd8c3e9){var _0x2c3dd4=squel[_0xec0e('0x21')]();if(_0xd8c3e9){var _0x55c108=utils[_0xec0e('0x22')](_0xd8c3e9);_0x55c108[_0xec0e('0x23')](function(_0x430266){_0x2c3dd4['or'](_0xec0e('0x24'),'%,'+_0x430266+',%');});}return _0x2c3dd4;}function parseReadParameter(_0x2989b0){var _0x3fc422='';if(_0x2989b0){_0x3fc422=_0xec0e('0x25');if(_0x2989b0==='1'){_0x3fc422=_0x3fc422[_0xec0e('0x26')](_0xec0e('0x27'),'=');}else{_0x3fc422=_0x3fc422[_0xec0e('0x26')](_0xec0e('0x27'),'>');}}return _0x3fc422;}function parseSearchFilter(_0x15ec6d,_0x48c122){var _0x293fc3=squel[_0xec0e('0x21')]();if(_0x48c122){var _0x3f580a=_0x48c122[_0xec0e('0x26')]('\x5c','\x5c\x5c')[_0xec0e('0x26')](/'/g,'\x27\x27');if(qs[_0xec0e('0x28')](_0x3f580a)){_0x293fc3['or']('i.id\x20LIKE\x20?',_0x3f580a+'%');if([_0xec0e('0x29'),_0xec0e('0x2a')][_0xec0e('0x2b')](_0x15ec6d)){_0x293fc3['or']('i.phone\x20LIKE\x20?',_0x3f580a+'%');}else if(_0x15ec6d===_0xec0e('0x2c')){_0x293fc3['or'](_0xec0e('0x2d'),_0x3f580a+'%');}else if(_0x15ec6d===_0xec0e('0x2e')){_0x293fc3['or']('i.from\x20LIKE\x20?',_0x3f580a+'%');}}else if(_0x15ec6d==='mail'&&qs['isEmail'](_0x3f580a)){_0x293fc3['or'](_0xec0e('0x2f'),_0x3f580a+'%');}else{if(_0x15ec6d===_0xec0e('0x30')){_0x293fc3['or'](_0xec0e('0x31'),qs['getFullTextValue'](_0x3f580a,!![]))['or'](_0xec0e('0x32'),qs[_0xec0e('0x33')](_0x3f580a));}else if(_0x15ec6d!=='fax'){_0x293fc3['or'](_0xec0e('0x34'),qs['getFullTextValue'](_0x3f580a));}_0x293fc3['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xec0e('0x33')](_0x3f580a,!![]),null);}}return _0x293fc3;}function parseAdvancedSearchFilter(_0x528a0d,_0x8682b4){var _0x1ac302=getSqlClauses();var _0x54dadc=as['parseSearch'](_0x528a0d);var _0x51e6d1=_0x54dadc[_0xec0e('0x35')];for(var _0x597f1=0x0;_0x597f1<_0x54dadc[_0xec0e('0x36')][_0xec0e('0x37')];_0x597f1++){var _0x5066a0=_0x54dadc[_0xec0e('0x36')][_0x597f1];var _0x5cd071='i';var _0x250795=_[_0xec0e('0x38')](_0x8682b4,[_0xec0e('0x39'),_0x5066a0[_0xec0e('0x7')]]);if(_0x250795){var _0x48711e=as[_0xec0e('0x3a')](_0x5cd071,_0x250795[_0xec0e('0x3b')],_0x5066a0);_0x1ac302[_0xec0e('0x3c')][_0x51e6d1](_0x48711e[_0xec0e('0x3d')],_0x48711e[_0xec0e('0x3e')]['start'],_0x48711e[_0xec0e('0x3e')][_0xec0e('0x3f')]);}else{switch(_0x5066a0[_0xec0e('0x7')]){case'unreadMessages':var _0x4d9f4e=parseReadParameter(_0x5066a0[_0xec0e('0x3e')]);_0x1ac302[_0xec0e('0x40')]['and'](_0x4d9f4e);break;case _0xec0e('0x41'):if(_0x5066a0[_0xec0e('0x42')]===_0xec0e('0x43')){if(_0x5066a0[_0xec0e('0x3e')][_0xec0e('0x44')]('\x20')[_0xec0e('0x37')]>0x1){_0x1ac302[_0xec0e('0x45')][_0x51e6d1]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5066a0[_0xec0e('0x3e')],!![]),null);}else{var _0x2e89dd='%'+_0x5066a0[_0xec0e('0x3e')]+'%';_0x1ac302[_0xec0e('0x45')][_0x51e6d1]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2e89dd,_0x2e89dd,_0x2e89dd);}}else{_0x250795=_[_0xec0e('0x38')](_0x8682b4,[_0xec0e('0x39'),_0xec0e('0x46')]);_0x5066a0[_0xec0e('0x7')]=_0xec0e('0x46');_0x48711e=as[_0xec0e('0x3a')](_0x5cd071,_0x250795[_0xec0e('0x3b')],_0x5066a0);_0x1ac302[_0xec0e('0x45')][_0x51e6d1](_0x48711e[_0xec0e('0x3d')],_0x48711e[_0xec0e('0x3e')][_0xec0e('0x47')],_0x48711e[_0xec0e('0x3e')]['end']);}break;case _0xec0e('0x48'):var _0x344022=_0x5066a0[_0xec0e('0x3e')][_0xec0e('0x44')](',')[_0xec0e('0x14')](function(_0x1b04ad){return Number(_0x1b04ad);});var _0x575c00=parseTagParameter(_0x344022);_0x1ac302[_0xec0e('0x49')][_0xec0e('0x4a')][_0xec0e('0x4b')](_0x575c00);_0x1ac302[_0xec0e('0x49')][_0xec0e('0x4c')]=_0x344022;break;case _0xec0e('0x4d'):if(_0x5066a0['operator']===_0xec0e('0x43')){_0x1ac302[_0xec0e('0x4e')][_0x51e6d1](_0xec0e('0x4f'),'%'+_0x5066a0[_0xec0e('0x3e')]+'%',null);}else{_0x250795=_[_0xec0e('0x38')](_0x8682b4,[_0xec0e('0x39'),_0xec0e('0x50')]);_0x5066a0[_0xec0e('0x7')]=_0xec0e('0x50');_0x48711e=as['buildExpression'](_0x5cd071,_0x250795[_0xec0e('0x3b')],_0x5066a0);_0x1ac302[_0xec0e('0x4e')][_0x51e6d1](_0x48711e[_0xec0e('0x3d')],_0x48711e[_0xec0e('0x3e')]['start'],_0x48711e[_0xec0e('0x3e')][_0xec0e('0x3f')]);}break;case _0xec0e('0x51'):case'plainBody':_0x48711e=as['buildExpression']('me',null,_0x5066a0);_0x1ac302['body'][_0x51e6d1](_0x48711e[_0xec0e('0x3d')],_0x48711e[_0xec0e('0x3e')]['start'],_0x48711e['value'][_0xec0e('0x3f')]);break;}}}return _0x1ac302;}function parseModelFields(_0x120ab2,_0x2ee210,_0x50dd3d){var _0x189c29=utils[_0xec0e('0x2')](_0x120ab2);var _0x591325=squel['expr']();var _0x4cbae2=_(_0x2ee210)['keys']()[_0xec0e('0x14')](function(_0x3012eb){return _[_0xec0e('0x52')](_0x50dd3d,[_0xec0e('0x39'),_0x3012eb])?_0x3012eb:undefined;})[_0xec0e('0x53')]()['value']();if(_0x4cbae2[_0xec0e('0x37')]>0x0){_0x4cbae2[_0xec0e('0x23')](function(_0x51fe33){if(_0x51fe33===_0x189c29){_0x591325['and']('i.'+_0x189c29+'\x20IN\x20?',[]['concat'](_0x2ee210[_0x51fe33]));}else if(_0x51fe33===_0xec0e('0x54')){var _0x588ac7=JSON['parse'](_0x2ee210[_0x51fe33])[_0xec0e('0x55')];var _0x5b0a63=JSON[_0xec0e('0x56')](_0x2ee210[_0x51fe33])['$lte'];_0x591325[_0xec0e('0x4b')](_0xec0e('0x57'),_0x588ac7,_0x5b0a63);}else{if(_0x2ee210[_0x51fe33]==='null'){_0x591325[_0xec0e('0x4b')]('i.'+_0x51fe33+_0xec0e('0x58'));}else{_0x591325['and']('i.'+_0x51fe33+_0xec0e('0x59'),_0x2ee210[_0x51fe33]);}}});}return _0x591325;}function parseQueryParameters(_0x3dcf60,_0x4015a9,_0x25f2d7){var _0x539dcc=getSqlClauses();return Promise[_0xec0e('0x5a')]()['then'](function(){return parseModelFields(_0x3dcf60,_0x4015a9,_0x25f2d7);})[_0xec0e('0x5b')](function(_0x687361){_0x539dcc[_0xec0e('0x5c')][_0xec0e('0x4b')](_0x687361);return parseReadParameter(_0x4015a9['read']);})['then'](function(_0x2123a7){_0x539dcc[_0xec0e('0x40')]['and'](_0x2123a7);return parseTagParameter(_0x4015a9[_0xec0e('0x5d')]);})['then'](function(_0xd8747a){_0x539dcc[_0xec0e('0x49')][_0xec0e('0x4a')]['and'](_0xd8747a);return parseSearchFilter(_0x3dcf60,_0x4015a9['filter']);})[_0xec0e('0x5b')](function(_0x29936a){_0x539dcc['filter']=_0x29936a;return _0x539dcc;});}function checkAccountsRestrictions(_0x186ca3,_0x38ab49,_0x2c2a2c){var _0x24f359=utils[_0xec0e('0x2')](_0x186ca3);var _0x3f0bcd='get'+_[_0xec0e('0x5e')](_0x186ca3)+(_0x186ca3===_0xec0e('0x5f')?_0xec0e('0x60'):_0xec0e('0x61'));var _0x249c92=squel[_0xec0e('0x21')]();return Promise[_0xec0e('0x5a')]()[_0xec0e('0x5b')](function(){if(_0x2c2a2c['search']&&_0x38ab49['role']===_0xec0e('0x4')){return _0x38ab49[_0x3f0bcd]({'attributes':['id'],'raw':!![]});}})[_0xec0e('0x5b')](function(_0x429dc8){if(_0x429dc8){if(_0x429dc8[_0xec0e('0x37')]===0x0){_0x249c92[_0xec0e('0x4b')]('i.'+_0x24f359+_0xec0e('0x58'));}else{_0x249c92[_0xec0e('0x4b')]('i.'+_0x24f359+_0xec0e('0x62'),_[_0xec0e('0x14')](_0x429dc8,'id'));}}else if(!_0x2c2a2c[_0x24f359]){_0x249c92['and']('i.'+_0x24f359+_0xec0e('0x63'));}})['then'](function(){return _0x249c92;});}function getClosedOrderClause(_0x15e8d1,_0x2e1eb4){var _0x50d2e7='';var _0x5ad904=[_0xec0e('0x64'),_0xec0e('0x65'),_0xec0e('0x66')];if(_0x15e8d1==='mail'){_0x5ad904[_0xec0e('0x67')](_0xec0e('0x68'));}if(_0x2e1eb4[_0xec0e('0x69')]==='0'&&_0x15e8d1===_0xec0e('0x30')){_0x50d2e7=_0xec0e('0x68');}else{if(_0x2e1eb4[_0xec0e('0x69')]==='1'){_0x5ad904[_0xec0e('0x6a')]();}_0x50d2e7=_0xec0e('0x6b')+_0x5ad904[_0xec0e('0x6c')](',\x20')+')';}return _0x50d2e7;}function getFilteredInteractions(_0x2d3758,_0x1d702c,_0xa894ec,_0x2bded7){var _0xa14ea8=utils['getInteractionFK'](_0x2d3758);var _0x23c2e5=_[_0xec0e('0x5e')](_0x2d3758)+_0xec0e('0x6d');var _0x2b3311=[];var _0x3bb495=getTagsQuery();var _0x141428={'type':db[_0xec0e('0x6e')][_0xec0e('0x6f')][_0xec0e('0x70')],'raw':!![]};var _0x261be1=[];var _0x3bf7c7=[];return db[_0xec0e('0x71')][_0xec0e('0x72')](_0x3bb495[_0xec0e('0x73')](),_0x141428)[_0xec0e('0x5b')](function(_0xb1b449){_0x2b3311=_[_0xec0e('0x74')](_0xb1b449,'id');_0x141428=_['merge'](_0x141428,{'model':db[_0x23c2e5],'mapToModel':!![],'nest':!![]});if(_0xa894ec['fields']){_0x2bded7['attributes'][_0xec0e('0x23')](function(_0x38dff7){_0x1d702c['field']('i.'+_0x38dff7);});}else{_0x1d702c[_0xec0e('0x7')](_0xec0e('0x75'),_0xec0e('0x76'));_0x1d702c['field']('a.key',_0xec0e('0x77'));_0x1d702c[_0xec0e('0x7')](_0xec0e('0x78'),_0xec0e('0x79'));if(_0x2d3758===_0xec0e('0x30')){_0x1d702c[_0xec0e('0x7')](_0xec0e('0x7a'),_0xec0e('0x7b'));_0x1d702c['field'](_0xec0e('0x7c'),_0xec0e('0x7d'));_0x1d702c[_0xec0e('0x7')]('i.id');_0x1d702c[_0xec0e('0x7')]('i.createdAt');_0x1d702c[_0xec0e('0x7')](_0xec0e('0x7e'));_0x1d702c[_0xec0e('0x7')](_0xec0e('0x7f'));_0x1d702c['field'](_0xec0e('0x80'));_0x1d702c[_0xec0e('0x7')](_0xec0e('0x81'));_0x1d702c['field'](_0xec0e('0x82'));_0x1d702c[_0xec0e('0x7')](_0xec0e('0x83'));_0x1d702c['field'](_0xec0e('0x84'));_0x1d702c[_0xec0e('0x7')](_0xec0e('0x66'));_0x1d702c[_0xec0e('0x7')](_0xec0e('0x65'));_0x1d702c[_0xec0e('0x7')]('i.thirdDisposition');_0x1d702c[_0xec0e('0x7')](_0xec0e('0x68'));_0x1d702c['field'](_0xec0e('0x85'));_0x1d702c[_0xec0e('0x7')](_0xec0e('0x86'));_0x1d702c[_0xec0e('0x7')](_0xec0e('0x87'));_0x1d702c[_0xec0e('0x7')](_0xec0e('0x88'));}else if(_0x2d3758==='openchannel'){_0x1d702c[_0xec0e('0x7')](_0xec0e('0x89'),_0xec0e('0x7d'));}else{_0x1d702c[_0xec0e('0x7')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');}if(_0x2d3758!==_0xec0e('0x30')){_0x1d702c[_0xec0e('0x7')](_0xec0e('0x8a'));}_0x1d702c['field'](_0xec0e('0x8b'),'Contact.firstName');_0x1d702c[_0xec0e('0x7')]('c.lastName',_0xec0e('0x8c'));_0x1d702c[_0xec0e('0x7')](_0xec0e('0x8d'),_0xec0e('0x8e'));_0x1d702c[_0xec0e('0x7')](_0xec0e('0x8f'),_0xec0e('0x90'));_0x1d702c[_0xec0e('0x7')](_0xec0e('0x91'),_0xec0e('0x92'));_0x1d702c[_0xec0e('0x7')](_0xec0e('0x93'),'Contact.fax');_0x1d702c[_0xec0e('0x7')](_0xec0e('0x94'),_0xec0e('0x95'));_0x1d702c['field']('o.internal',_0xec0e('0x96'));_0x1d702c['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xec0e('0x97'));}if(_0x2bded7['limit']){_0x1d702c['limit'](_0x2bded7[_0xec0e('0x98')]);}if(_0x2bded7[_0xec0e('0x99')]){_0x1d702c[_0xec0e('0x99')](_0x2bded7[_0xec0e('0x99')]);}return db[_0xec0e('0x71')][_0xec0e('0x72')](_0x1d702c[_0xec0e('0x73')](),_0x141428);})[_0xec0e('0x5b')](function(_0x339205){_0x261be1=_0x339205;var _0x5dbfdb=getUsersQuery(_0x2d3758,_0x261be1);return db['sequelize'][_0xec0e('0x72')](_0x5dbfdb[_0xec0e('0x73')](),_0x141428);})[_0xec0e('0x5b')](function(_0x1d358c){_0x3bf7c7=_['groupBy'](_0x1d358c,_0xa14ea8);if(_0x2d3758==='mail'){return db[_0xec0e('0x9a')][_0xec0e('0x9b')]({'attributes':[_0xec0e('0x9c')],'raw':!![]});}})[_0xec0e('0x5b')](function(_0x1e90bf){var _0x144747=_0x1e90bf?_0x1e90bf[_0xec0e('0x9c')]:undefined;var _0x25f20=_0x261be1[_0xec0e('0x14')](function(_0x2eb61a){return updateInteraction(_0x2eb61a,_0x2b3311,_0x3bf7c7,_0x144747);});return Promise[_0xec0e('0x9d')](_0x25f20);});}function countFilteredInteractions(_0x2a54a4,_0xf66b30){var _0x31b2e7=_0x2a54a4[_0xec0e('0x9e')]();_0x31b2e7['field'](_0xec0e('0x9f'));_0x31b2e7['field'](_0xec0e('0x75'),_0xec0e('0x76'));var _0x609082=utils[_0xec0e('0x22')](_0xf66b30);if(!_[_0xec0e('0xa0')](_0x609082)){_0x31b2e7[_0xec0e('0x12')](_0xec0e('0xa1'),_0x609082);}var _0x268152={'type':db[_0xec0e('0x6e')][_0xec0e('0x6f')][_0xec0e('0x70')],'raw':!![]};return db[_0xec0e('0x71')]['query'](_0x31b2e7[_0xec0e('0x73')](),_0x268152);}module[_0xec0e('0xa2')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 2ce8af0..51f4ea2 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd6d3=['plainBody','then','lastMsgText','catch','updateInteraction','Users','TagIds','Tags','map','fullname','split','forEach','push','waiting','talking','answered','unmanaged','abandoned','total','disposition','UserId','findOne','out'];(function(_0x3ef45e,_0xe84f33){var _0x69e7c=function(_0x43ba11){while(--_0x43ba11){_0x3ef45e['push'](_0x3ef45e['shift']());}};_0x69e7c(++_0xe84f33);}(_0xd6d3,0x1eb));var _0x3d6d=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xd6d3[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x1d0546,_0x511107){return new Promise(function(_0x304385,_0xe7c49d){try{var _0x34711b=[];if(_0x511107[_0x1d0546]){_0x34711b=_0x511107[_0x1d0546][_0x3d6d('0x0')](function(_0x35d58f){return{'id':_0x35d58f['id'],'fullname':_0x35d58f[_0x3d6d('0x1')]};});}return _0x304385(_0x34711b);}catch(_0x3e5f76){_0xe7c49d(_0x3e5f76);}});}function getInteractionTags(_0x505e16,_0xd0a3e9){var _0x4c709d=[];if(_0x505e16){_0x505e16[_0x3d6d('0x2')](',')[_0x3d6d('0x3')](function(_0x3add7){_0x4c709d[_0x3d6d('0x4')](_0xd0a3e9[_0x3add7]);});}return _0x4c709d;}function updateWaitingCounter(_0x349056){if(_0x349056[_0x3d6d('0x5')]){_0x349056[_0x3d6d('0x5')]-=0x1;}}function updateInteractionCounters(_0x1b38bd){_0x1b38bd[_0x3d6d('0x5')]=0x0;_0x1b38bd[_0x3d6d('0x6')]=0x0;_0x1b38bd[_0x3d6d('0x7')]=0x0;_0x1b38bd[_0x3d6d('0x8')]=0x0;_0x1b38bd[_0x3d6d('0x9')]=0x0;_0x1b38bd[_0x3d6d('0xa')]=0x0;if(_0x1b38bd['closed']){if(_0x1b38bd[_0x3d6d('0xb')]===_0x3d6d('0x9')){_0x1b38bd[_0x3d6d('0x9')]+=0x1;updateWaitingCounter(_0x1b38bd);}if(_0x1b38bd[_0x3d6d('0xc')]){_0x1b38bd['answered']+=0x1;if(_0x1b38bd[_0x3d6d('0x6')]){_0x1b38bd[_0x3d6d('0x6')]-=0x1;}}else{if(_0x1b38bd[_0x3d6d('0xb')]){_0x1b38bd['unmanaged']+=0x1;updateWaitingCounter(_0x1b38bd);}}}else{if(!_0x1b38bd['UserId']){_0x1b38bd[_0x3d6d('0x5')]+=0x1;}if(_0x1b38bd[_0x3d6d('0xc')]){_0x1b38bd[_0x3d6d('0x6')]+=0x1;updateWaitingCounter(_0x1b38bd);}}_0x1b38bd['total']+=0x1;return _0x1b38bd;}function getLastMessageText(_0x5b006e){return db['MailMessage'][_0x3d6d('0xd')]({'where':{'$and':[{'MailInteractionId':_0x5b006e['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x3d6d('0xe')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x3d6d('0xf')],'order':'-id','raw':!![]})[_0x3d6d('0x10')](function(_0x4bce90){if(_0x4bce90&&_0x4bce90[_0x3d6d('0xf')]){_0x5b006e[_0x3d6d('0x11')]=_['trimStart'](_0x4bce90[_0x3d6d('0xf')]);}return _0x5b006e;})[_0x3d6d('0x12')](function(_0x20d60a){throw _0x20d60a;});}exports[_0x3d6d('0x13')]=function(_0x1e08e4,_0x2f3ff2,_0x2db5a5,_0x49c2c2){return new Promise(function(_0x48b7e7,_0x4cf0a4){return getInteractionUsers(_0x1e08e4['id'],_0x2db5a5)[_0x3d6d('0x10')](function(_0x3f2b86){_0x1e08e4[_0x3d6d('0x14')]=_0x3f2b86;return getInteractionTags(_0x1e08e4[_0x3d6d('0x15')],_0x2f3ff2);})['then'](function(_0x248db8){_0x1e08e4[_0x3d6d('0x16')]=_0x248db8;delete _0x1e08e4[_0x3d6d('0x15')];return updateInteractionCounters(_0x1e08e4);})['then'](function(_0x3fb97c){if(_0x49c2c2){return getLastMessageText(_0x3fb97c);}else{return _0x3fb97c;}})[_0x3d6d('0x10')](function(_0x2e5904){_0x48b7e7(_0x2e5904);})[_0x3d6d('0x12')](function(_0x155f7c){_0x4cf0a4(_0x155f7c);});});}; \ No newline at end of file +var _0xf9ca=['answered','unmanaged','abandoned','total','closed','disposition','UserId','MailMessage','findOne','then','plainBody','trimStart','catch','Users','TagIds','Tags','lodash','fullname','split','forEach','waiting','talking'];(function(_0xe39fbd,_0x36c512){var _0x299da1=function(_0x16e31c){while(--_0x16e31c){_0xe39fbd['push'](_0xe39fbd['shift']());}};_0x299da1(++_0x36c512);}(_0xf9ca,0x144));var _0xaf9c=function(_0x44089a,_0x35a3d3){_0x44089a=_0x44089a-0x0;var _0x89c2e0=_0xf9ca[_0x44089a];return _0x89c2e0;};'use strict';var _=require(_0xaf9c('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x1e3073,_0x57d3ae){return new Promise(function(_0x3caec0,_0x2f4412){try{var _0x58aeed=[];if(_0x57d3ae[_0x1e3073]){_0x58aeed=_0x57d3ae[_0x1e3073]['map'](function(_0x41fc23){return{'id':_0x41fc23['id'],'fullname':_0x41fc23[_0xaf9c('0x1')]};});}return _0x3caec0(_0x58aeed);}catch(_0x28d1ba){_0x2f4412(_0x28d1ba);}});}function getInteractionTags(_0x2ece8d,_0x22506d){var _0x521963=[];if(_0x2ece8d){_0x2ece8d[_0xaf9c('0x2')](',')[_0xaf9c('0x3')](function(_0x3eea66){_0x521963['push'](_0x22506d[_0x3eea66]);});}return _0x521963;}function updateWaitingCounter(_0x1c2e95){if(_0x1c2e95[_0xaf9c('0x4')]){_0x1c2e95['waiting']-=0x1;}}function updateInteractionCounters(_0x1f54d4){_0x1f54d4[_0xaf9c('0x4')]=0x0;_0x1f54d4[_0xaf9c('0x5')]=0x0;_0x1f54d4[_0xaf9c('0x6')]=0x0;_0x1f54d4[_0xaf9c('0x7')]=0x0;_0x1f54d4[_0xaf9c('0x8')]=0x0;_0x1f54d4[_0xaf9c('0x9')]=0x0;if(_0x1f54d4[_0xaf9c('0xa')]){if(_0x1f54d4[_0xaf9c('0xb')]===_0xaf9c('0x8')){_0x1f54d4[_0xaf9c('0x8')]+=0x1;updateWaitingCounter(_0x1f54d4);}if(_0x1f54d4[_0xaf9c('0xc')]){_0x1f54d4[_0xaf9c('0x6')]+=0x1;if(_0x1f54d4[_0xaf9c('0x5')]){_0x1f54d4[_0xaf9c('0x5')]-=0x1;}}else{if(_0x1f54d4[_0xaf9c('0xb')]){_0x1f54d4[_0xaf9c('0x7')]+=0x1;updateWaitingCounter(_0x1f54d4);}}}else{if(!_0x1f54d4[_0xaf9c('0xc')]){_0x1f54d4[_0xaf9c('0x4')]+=0x1;}if(_0x1f54d4['UserId']){_0x1f54d4[_0xaf9c('0x5')]+=0x1;updateWaitingCounter(_0x1f54d4);}}_0x1f54d4['total']+=0x1;return _0x1f54d4;}function getLastMessageText(_0x5b726c){return db[_0xaf9c('0xd')][_0xaf9c('0xe')]({'where':{'$and':[{'MailInteractionId':_0x5b726c['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0xaf9c('0xf')](function(_0x4d736d){if(_0x4d736d&&_0x4d736d[_0xaf9c('0x10')]){_0x5b726c['lastMsgText']=_[_0xaf9c('0x11')](_0x4d736d[_0xaf9c('0x10')]);}return _0x5b726c;})[_0xaf9c('0x12')](function(_0x574dad){throw _0x574dad;});}exports['updateInteraction']=function(_0x1a2515,_0x496306,_0x624e31,_0x344725){return new Promise(function(_0x2928f2,_0x2ed453){return getInteractionUsers(_0x1a2515['id'],_0x624e31)['then'](function(_0x4231b1){_0x1a2515[_0xaf9c('0x13')]=_0x4231b1;return getInteractionTags(_0x1a2515[_0xaf9c('0x14')],_0x496306);})[_0xaf9c('0xf')](function(_0x1cf373){_0x1a2515[_0xaf9c('0x15')]=_0x1cf373;delete _0x1a2515[_0xaf9c('0x14')];return updateInteractionCounters(_0x1a2515);})['then'](function(_0x558fc3){if(_0x344725){return getLastMessageText(_0x558fc3);}else{return _0x558fc3;}})[_0xaf9c('0xf')](function(_0x7da9e1){_0x2928f2(_0x7da9e1);})[_0xaf9c('0x12')](function(_0x138ea0){_0x2ed453(_0x138ea0);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 60e17a4..2738863 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e7c=['Website','Account','InteractionId','upperFirst','unknown','accounts','_interactions','_interaction_has_tags','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','then','update','info','error','exports','lodash','../../mysqldb','openchannel-interactions','../../config/logger','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x5e7c,0x92));var _0xc5e7=function(_0x34c796,_0x8e7a6a){_0x34c796=_0x34c796-0x0;var _0x436e87=_0x5e7c[_0x34c796];return _0x436e87;};'use strict';var _=require(_0xc5e7('0x0'));var db=require(_0xc5e7('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xc5e7('0x2')),'mail':require(_0xc5e7('0x3'))('mail-interactions'),'fax':require(_0xc5e7('0x3'))('fax-interactions'),'sms':require(_0xc5e7('0x3'))(_0xc5e7('0x4')),'chat':require(_0xc5e7('0x3'))(_0xc5e7('0x5')),'whatsapp':require(_0xc5e7('0x3'))(_0xc5e7('0x6'))};function getAccountFK(_0x19a49a){return _[_0xc5e7('0x7')](_0x19a49a)+(_0x19a49a===_0xc5e7('0x8')?_0xc5e7('0x9'):_0xc5e7('0xa'))+'Id';}function getInteractionFK(_0x4483ec){return _[_0xc5e7('0x7')](_0x4483ec)+_0xc5e7('0xb');}function getInteractionId(_0x3a963c,_0x3df139,_0x567243){if(_0x3a963c&&_0x3a963c[_['upperFirst'](_0x567243)+'InteractionId']){return _0x3a963c[_[_0xc5e7('0xc')](_0x567243)+_0xc5e7('0xb')];}else if(_0x3a963c&&_0x3a963c['id']){return _0x3a963c['id'];}else if(_0x3df139&&_0x3df139['id']){return _0x3df139['id'];}else{return _0xc5e7('0xd');}}function getInteractionsTables(_0x1a417){return{'accounts':_0x1a417+'_'+(_0x1a417===_0xc5e7('0x8')?'websites':_0xc5e7('0xe')),'interactions':_0x1a417+_0xc5e7('0xf'),'interactionsTags':_0x1a417+_0xc5e7('0x10'),'messages':_0x1a417+'_messages','userInteractions':_0xc5e7('0x11')+_0x1a417+_0xc5e7('0xf')};}function getSelectedTags(_0x2929e1){var _0x940bfb=[];if(_0x2929e1){_0x940bfb=Array[_0xc5e7('0x12')](_0x2929e1)?_0x2929e1:[_0x2929e1];}return _0x940bfb;}function log(_0x1bed19,_0x347d52,_0x55a92f,_0x2e8a4f,_0x15ab43,_0x10aa85){loggers[_0x15ab43[_0xc5e7('0x13')]()][_0x1bed19](_0xc5e7('0x14'),_0x10aa85[_0xc5e7('0x15')](),_0x347d52?_0x347d52['id']:null,_0x347d52?_0x347d52[_0xc5e7('0x16')]:null,_0x347d52?_0x347d52['role']:null,getInteractionId(_0x55a92f,_0x2e8a4f,_0x15ab43),_0x55a92f?JSON[_0xc5e7('0x17')](_0x55a92f):_0xc5e7('0x18'));}function updateUser(_0x2032d0,_0x291b47,_0x2f4540,_0x29f658,_0x3f68fc){db[_[_0xc5e7('0xc')](_0x29f658)+_0xc5e7('0x19')]['findOne']({'where':{'id':getInteractionId(_0x291b47,_0x2f4540,_0x29f658)}})[_0xc5e7('0x1a')](function(_0x15b4d8){if(_0x15b4d8){return _0x15b4d8[_0xc5e7('0x1b')]({'UserId':_0x2032d0?_0x2032d0['id']:null});}})[_0xc5e7('0x1a')](function(_0x34e76f){if(_0x34e76f){log(_0xc5e7('0x1c'),_0x2032d0,_0x291b47,_0x2f4540,_0x29f658,_0x3f68fc);}})['catch'](function(){log(_0xc5e7('0x1d'),_0x2032d0,_0x291b47,_0x2f4540,_0x29f658,_0x3f68fc);});}module[_0xc5e7('0x1e')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xf34a=['mail-interactions','fax-interactions','sms-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','user_has_','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction','then','update','info','catch','error','lodash','../../mysqldb','../../config/logger','openchannel-interactions'];(function(_0x48df04,_0x1522b1){var _0x4de5fa=function(_0x3ae6db){while(--_0x3ae6db){_0x48df04['push'](_0x48df04['shift']());}};_0x4de5fa(++_0x1522b1);}(_0xf34a,0x78));var _0xaf34=function(_0x1b6fb7,_0x2cea7f){_0x1b6fb7=_0x1b6fb7-0x0;var _0x327d7a=_0xf34a[_0x1b6fb7];return _0x327d7a;};'use strict';var _=require(_0xaf34('0x0'));var db=require(_0xaf34('0x1'))['db'];var loggers={'openchannel':require(_0xaf34('0x2'))(_0xaf34('0x3')),'mail':require('../../config/logger')(_0xaf34('0x4')),'fax':require(_0xaf34('0x2'))(_0xaf34('0x5')),'sms':require(_0xaf34('0x2'))(_0xaf34('0x6')),'chat':require(_0xaf34('0x2'))('chat-interactions'),'whatsapp':require(_0xaf34('0x2'))('whatsapp-interactions')};function getAccountFK(_0x414768){return _[_0xaf34('0x7')](_0x414768)+(_0x414768===_0xaf34('0x8')?_0xaf34('0x9'):_0xaf34('0xa'))+'Id';}function getInteractionFK(_0x469021){return _[_0xaf34('0x7')](_0x469021)+_0xaf34('0xb');}function getInteractionId(_0x39ede4,_0x1f5235,_0x5eed6c){if(_0x39ede4&&_0x39ede4[_['upperFirst'](_0x5eed6c)+_0xaf34('0xb')]){return _0x39ede4[_[_0xaf34('0xc')](_0x5eed6c)+_0xaf34('0xb')];}else if(_0x39ede4&&_0x39ede4['id']){return _0x39ede4['id'];}else if(_0x1f5235&&_0x1f5235['id']){return _0x1f5235['id'];}else{return _0xaf34('0xd');}}function getInteractionsTables(_0x2e5024){return{'accounts':_0x2e5024+'_'+(_0x2e5024==='chat'?_0xaf34('0xe'):_0xaf34('0xf')),'interactions':_0x2e5024+_0xaf34('0x10'),'interactionsTags':_0x2e5024+_0xaf34('0x11'),'messages':_0x2e5024+'_messages','userInteractions':_0xaf34('0x12')+_0x2e5024+_0xaf34('0x10')};}function getSelectedTags(_0x4a2215){var _0x39eb86=[];if(_0x4a2215){_0x39eb86=Array[_0xaf34('0x13')](_0x4a2215)?_0x4a2215:[_0x4a2215];}return _0x39eb86;}function log(_0x5399c4,_0xfe8084,_0x253d24,_0x2db311,_0x51206d,_0x5e5d1c){loggers[_0x51206d['toLowerCase']()][_0x5399c4](_0xaf34('0x14'),_0x5e5d1c[_0xaf34('0x15')](),_0xfe8084?_0xfe8084['id']:null,_0xfe8084?_0xfe8084[_0xaf34('0x16')]:null,_0xfe8084?_0xfe8084[_0xaf34('0x17')]:null,getInteractionId(_0x253d24,_0x2db311,_0x51206d),_0x253d24?JSON[_0xaf34('0x18')](_0x253d24):'null');}function updateUser(_0x4ae4c9,_0x564ff1,_0xbaa446,_0x2edc3f,_0x522bcf){db[_['upperFirst'](_0x2edc3f)+_0xaf34('0x19')]['findOne']({'where':{'id':getInteractionId(_0x564ff1,_0xbaa446,_0x2edc3f)}})[_0xaf34('0x1a')](function(_0x48baa1){if(_0x48baa1){return _0x48baa1[_0xaf34('0x1b')]({'UserId':_0x4ae4c9?_0x4ae4c9['id']:null});}})['then'](function(_0x7d7d9){if(_0x7d7d9){log(_0xaf34('0x1c'),_0x4ae4c9,_0x564ff1,_0xbaa446,_0x2edc3f,_0x522bcf);}})[_0xaf34('0x1d')](function(){log(_0xaf34('0x1e'),_0x4ae4c9,_0x564ff1,_0xbaa446,_0x2edc3f,_0x522bcf);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index d1dd19c..6f71387 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02f9=['User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','%s:%s:%s','update','base64','utf8','final','hasOwnProperty','License','findOne','then','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users'];(function(_0x362e1a,_0x6dfa10){var _0x229043=function(_0x399a0d){while(--_0x399a0d){_0x362e1a['push'](_0x362e1a['shift']());}};_0x229043(++_0x6dfa10);}(_0x02f9,0x19a));var _0x902f=function(_0x227427,_0x39a41d){_0x227427=_0x227427-0x0;var _0x2f3aef=_0x02f9[_0x227427];return _0x2f3aef;};'use strict';var crypto=require(_0x902f('0x0'));var util=require(_0x902f('0x1'));var compose=require(_0x902f('0x2'));var db=require(_0x902f('0x3'))['db'];var config=require(_0x902f('0x4'));function getValueFromLicense(_0x6d591,_0x470313){if(_0x6d591&&_0x470313){if(_0x470313[_0x902f('0x5')]&&_0x470313[_0x902f('0x6')]){var _0xf13a55=_0x470313[_0x902f('0x5')];var _0x2a1890=_0x470313[_0x902f('0x6')];var _0x5e2299=_0xf13a55[_0x902f('0x7')]('-')[0x4];var _0x460f2e=_0xf13a55[_0x902f('0x7')]('-')[0x0];var _0x114f24=crypto[_0x902f('0x8')](_0x902f('0x9'),util['format'](_0x902f('0xa'),_0x5e2299,_0xf13a55,_0x460f2e));var _0x3f9ee0=_0x114f24[_0x902f('0xb')](_0x2a1890,_0x902f('0xc'),_0x902f('0xd'));_0x3f9ee0+=_0x114f24[_0x902f('0xe')](_0x902f('0xd'));var _0x4fe7a2=JSON['parse'](_0x3f9ee0);return _0x4fe7a2[_0x902f('0xf')](_0x6d591)?_0x4fe7a2[_0x6d591]:null;}}return null;}function isLimit(_0x8359ac,_0x15ed46,_0x2565fc,_0x12f9db){var _0x4d40a9=_0x15ed46;return compose()['use'](function(_0x4f6efb,_0x425f62,_0x56cc57){return db[_0x902f('0x10')][_0x902f('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x902f('0x12')](function(_0x249860){var _0x271727=getValueFromLicense(_0x8359ac,_0x249860);return _0x271727?_0x271727:_0x4d40a9;})[_0x902f('0x12')](function(_0x1791d4){_0x4d40a9=_0x1791d4;return _0x2565fc['count'](_0x12f9db);})[_0x902f('0x12')](function(_0xa9582f){if(_0xa9582f>=_0x4d40a9){return _0x425f62[_0x902f('0x13')](0x193)[_0x902f('0x14')]({'message':util[_0x902f('0x15')](_0x902f('0x16'),_0x8359ac)});}_0x56cc57();})[_0x902f('0x17')](function(_0xb1554f){_0x56cc57(_0xb1554f);});});}function isUserLimit(){return isLimit(_0x902f('0x18'),0x1,db[_0x902f('0x19')],{'where':{'$or':[{'role':_0x902f('0x1a')},{'role':_0x902f('0x1b')}]}});}exports[_0x902f('0x1c')]=isUserLimit; \ No newline at end of file +var _0x4056=['split','createDecipher','format','%s:%s:%s','base64','utf8','hasOwnProperty','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','isUserLimit','util','../../mysqldb','data1','license'];(function(_0xe9a6f1,_0x6a6a2f){var _0x4893b6=function(_0x218535){while(--_0x218535){_0xe9a6f1['push'](_0xe9a6f1['shift']());}};_0x4893b6(++_0x6a6a2f);}(_0x4056,0x110));var _0x6405=function(_0x22a58b,_0x232830){_0x22a58b=_0x22a58b-0x0;var _0x26b203=_0x4056[_0x22a58b];return _0x26b203;};'use strict';var crypto=require('crypto');var util=require(_0x6405('0x0'));var compose=require('composable-middleware');var db=require(_0x6405('0x1'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x18bad2,_0x41e984){if(_0x18bad2&&_0x41e984){if(_0x41e984[_0x6405('0x2')]&&_0x41e984[_0x6405('0x3')]){var _0x5d8297=_0x41e984[_0x6405('0x2')];var _0x4ff074=_0x41e984[_0x6405('0x3')];var _0x5ec35a=_0x5d8297['split']('-')[0x4];var _0x57d73d=_0x5d8297[_0x6405('0x4')]('-')[0x0];var _0x267617=crypto[_0x6405('0x5')]('aes-256-ctr',util[_0x6405('0x6')](_0x6405('0x7'),_0x5ec35a,_0x5d8297,_0x57d73d));var _0x2bf486=_0x267617['update'](_0x4ff074,_0x6405('0x8'),'utf8');_0x2bf486+=_0x267617['final'](_0x6405('0x9'));var _0x2053cf=JSON['parse'](_0x2bf486);return _0x2053cf[_0x6405('0xa')](_0x18bad2)?_0x2053cf[_0x18bad2]:null;}}return null;}function isLimit(_0x538461,_0x1b1d6f,_0x529cb7,_0x337827){var _0x1c24ea=_0x1b1d6f;return compose()['use'](function(_0x83a1be,_0x19eb1a,_0x2fdcca){return db[_0x6405('0xb')][_0x6405('0xc')]({'where':{'id':0x1},'raw':!![]})[_0x6405('0xd')](function(_0x22efa8){var _0x4b2229=getValueFromLicense(_0x538461,_0x22efa8);return _0x4b2229?_0x4b2229:_0x1c24ea;})[_0x6405('0xd')](function(_0x109507){_0x1c24ea=_0x109507;return _0x529cb7[_0x6405('0xe')](_0x337827);})[_0x6405('0xd')](function(_0x270d69){if(_0x270d69>=_0x1c24ea){return _0x19eb1a[_0x6405('0xf')](0x193)[_0x6405('0x10')]({'message':util['format'](_0x6405('0x11'),_0x538461)});}_0x2fdcca();})[_0x6405('0x12')](function(_0x3ab02a){_0x2fdcca(_0x3ab02a);});});}function isUserLimit(){return isLimit(_0x6405('0x13'),0x1,db[_0x6405('0x14')],{'where':{'$or':[{'role':'admin'},{'role':_0x6405('0x15')}]}});}exports[_0x6405('0x16')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 60b62b0..6ef41bf 100644 --- a/server/components/parsers/advancedSearch.js +++ b/server/components/parsers/advancedSearch.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04db=['add','days','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$between','shift','pop','utcOffset','format','hours','seconds','lodash','moment','parseSearch','startsWith','[$or]','and','replace','[$and]','split','slice','forEach','match','filter','map','conditions','buildExpression','DATE','operator','$eq','value','includes','$gt','$lte'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x04db,0x1f3));var _0xb04d=function(_0x28648b,_0x3a32ac){_0x28648b=_0x28648b-0x0;var _0x1efb79=_0x04db[_0x28648b];return _0x1efb79;};'use strict';var _=require(_0xb04d('0x0'));var moment=require(_0xb04d('0x1'));exports[_0xb04d('0x2')]=function(_0x5b890e){var _0x19ce59={'conditions':[]};_0x19ce59['sqlOperator']=_[_0xb04d('0x3')](_0x5b890e,_0xb04d('0x4'))?'or':_0xb04d('0x5');var _0x35068a=_0x5b890e[_0xb04d('0x6')](_0xb04d('0x7'),'')[_0xb04d('0x6')](_0xb04d('0x4'),'')[_0xb04d('0x8')]('||');for(var _0x5e9700=0x0;_0x5e9700<_0x35068a['length'];_0x5e9700++){var _0x405671=_0x35068a[_0x5e9700][_0xb04d('0x8')](':=');var _0x45ba0a=_0x405671[0x0];var _0x435620=_0x405671[_0xb04d('0x9')](0x1);_0x435620[_0xb04d('0xa')](function(_0x35d115){var _0x153b3f=_0x35d115[_0xb04d('0x8')]('[')['shift']();var _0x4107bc=_0x35d115[_0xb04d('0xb')](/\[(.*?)\]/g);_0x4107bc[_0xb04d('0xa')](function(_0x4fabf2){var _0x652aee=_0x4fabf2[_0xb04d('0x8')]('[')[_0xb04d('0xc')](function(_0x152b42){return _0x152b42['indexOf'](']')>-0x1;})[_0xb04d('0xd')](function(_0xce0591){return _0xce0591[_0xb04d('0x8')](']')[0x0];})[0x0];_0x19ce59[_0xb04d('0xe')]['push']({'field':_0x45ba0a,'operator':_0x153b3f,'value':_0x652aee});});});}return _0x19ce59;};exports[_0xb04d('0xf')]=function(_0x3aa7d4,_0x2e0a66,_0x50fda5){var _0x4a360c={};if(_0x2e0a66===_0xb04d('0x10')){if(_0x50fda5[_0xb04d('0x11')]===_0xb04d('0x12')){_0x50fda5['operator']='$between';_0x50fda5['value']+=','+_0x50fda5[_0xb04d('0x13')];}else if(_[_0xb04d('0x14')]([_0xb04d('0x15'),_0xb04d('0x16')],_0x50fda5['operator'])){_0x50fda5[_0xb04d('0x13')]=moment(_0x50fda5[_0xb04d('0x13')])[_0xb04d('0x17')](0x1,_0xb04d('0x18'))['format'](_0xb04d('0x19'));}}if(_0x50fda5[_0xb04d('0x1a')]){_0x2e0a66=_0x50fda5[_0xb04d('0x1a')];_0x4a360c[_0xb04d('0x1b')]=_0xb04d('0x1c')+_0x3aa7d4+'.'+_0x50fda5[_0xb04d('0x1d')]+_0xb04d('0x1e')+_0x50fda5[_0xb04d('0x1a')]+')\x20'+parseOperator(_0x50fda5['operator']);}else{_0x4a360c[_0xb04d('0x1b')]=_0x3aa7d4+'.'+_0x50fda5['field']+'\x20'+parseOperator(_0x50fda5[_0xb04d('0x11')]);}if(_['includes']([_0xb04d('0x1f'),'$notIn'],_0x50fda5[_0xb04d('0x11')]))_0x4a360c[_0xb04d('0x1b')]='('+_0x4a360c[_0xb04d('0x1b')]+_0xb04d('0x20')+_0x3aa7d4+'.'+_0x50fda5[_0xb04d('0x1d')]+_0xb04d('0x21');_0x4a360c[_0xb04d('0x13')]=parseValue(_0x2e0a66,_0x50fda5['operator'],_0x50fda5[_0xb04d('0x13')]);return _0x4a360c;};function parseOperator(_0x3b73f6){var _0x3b02ac;switch(_0x3b73f6){case _0xb04d('0x22'):_0x3b02ac='IN\x20?';break;case _0xb04d('0x23'):_0x3b02ac=_0xb04d('0x24');break;case'$eq':_0x3b02ac=_0xb04d('0x25');break;case'$ne':_0x3b02ac=_0xb04d('0x26');break;case _0xb04d('0x27'):case _0xb04d('0x28'):case _0xb04d('0x29'):_0x3b02ac=_0xb04d('0x2a');break;case _0xb04d('0x2b'):_0x3b02ac=_0xb04d('0x2c');break;case'$gt':_0x3b02ac=_0xb04d('0x2d');break;case _0xb04d('0x16'):_0x3b02ac=_0xb04d('0x2e');break;case _0xb04d('0x2f'):_0x3b02ac=_0xb04d('0x30');break;case'$between':_0x3b02ac=_0xb04d('0x31');break;}return _0x3b02ac;}function parseValue(_0x31e7e0,_0x3a7c24,_0x30b591){var _0x1b80ef={'start':undefined,'end':undefined};switch(_0x3a7c24){case'$in':case _0xb04d('0x23'):_0x1b80ef['start']=_0x30b591[_0xb04d('0x8')](',');break;case _0xb04d('0x27'):_0x1b80ef[_0xb04d('0x32')]='%'+_0x30b591+'%';break;case _0xb04d('0x28'):_0x1b80ef[_0xb04d('0x32')]=_0x30b591+'%';break;case'$endsWith':_0x1b80ef[_0xb04d('0x32')]='%'+_0x30b591;break;case _0xb04d('0x33'):var _0x401cba=_0x30b591[_0xb04d('0x8')](',');var _0x30b591=_0x401cba[_0xb04d('0x34')]();var _0x5fa86b=_0x401cba[_0xb04d('0x35')]();if(_0x31e7e0===_0xb04d('0x10')){_0x30b591=moment(_0x30b591)[_0xb04d('0x36')](0x0,!![])[_0xb04d('0x37')]();_0x5fa86b=moment(_0x5fa86b)[_0xb04d('0x36')](0x0,!![])['add'](0x17,_0xb04d('0x38'))['add'](0x3b,'minutes')[_0xb04d('0x17')](0x3b,_0xb04d('0x39'))[_0xb04d('0x37')]();}_0x1b80ef={'start':_0x30b591,'end':_0x5fa86b};break;default:_0x1b80ef['start']=_0x30b591;break;}return _0x1b80ef;} \ No newline at end of file +var _0xeaca=['$substring','start','utcOffset','hours','seconds','lodash','moment','sqlOperator','startsWith','and','replace','[$and]','[$or]','split','length','slice','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','value','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$startsWith','$endsWith','$lt','<\x20?','<=\x20?','$gte','>=\x20?','$between'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0xeaca,0xad));var _0xaeac=function(_0x10d367,_0x31a35c){_0x10d367=_0x10d367-0x0;var _0x541332=_0xeaca[_0x10d367];return _0x541332;};'use strict';var _=require(_0xaeac('0x0'));var moment=require(_0xaeac('0x1'));exports['parseSearch']=function(_0x267bfe){var _0x4d41cd={'conditions':[]};_0x4d41cd[_0xaeac('0x2')]=_[_0xaeac('0x3')](_0x267bfe,'[$or]')?'or':_0xaeac('0x4');var _0x10c5cb=_0x267bfe[_0xaeac('0x5')](_0xaeac('0x6'),'')[_0xaeac('0x5')](_0xaeac('0x7'),'')[_0xaeac('0x8')]('||');for(var _0x5b4f3e=0x0;_0x5b4f3e<_0x10c5cb[_0xaeac('0x9')];_0x5b4f3e++){var _0x10735e=_0x10c5cb[_0x5b4f3e]['split'](':=');var _0x2bde7a=_0x10735e[0x0];var _0x2ab8ff=_0x10735e[_0xaeac('0xa')](0x1);_0x2ab8ff[_0xaeac('0xb')](function(_0x13174c){var _0x2376d0=_0x13174c[_0xaeac('0x8')]('[')[_0xaeac('0xc')]();var _0x1a7e11=_0x13174c[_0xaeac('0xd')](/\[(.*?)\]/g);_0x1a7e11[_0xaeac('0xb')](function(_0x49fc91){var _0x18f61f=_0x49fc91[_0xaeac('0x8')]('[')[_0xaeac('0xe')](function(_0x4b11df){return _0x4b11df[_0xaeac('0xf')](']')>-0x1;})[_0xaeac('0x10')](function(_0x80500){return _0x80500['split'](']')[0x0];})[0x0];_0x4d41cd[_0xaeac('0x11')][_0xaeac('0x12')]({'field':_0x2bde7a,'operator':_0x2376d0,'value':_0x18f61f});});});}return _0x4d41cd;};exports[_0xaeac('0x13')]=function(_0x37f866,_0x36ee18,_0x3af13d){var _0x6d400f={};if(_0x36ee18===_0xaeac('0x14')){if(_0x3af13d[_0xaeac('0x15')]===_0xaeac('0x16')){_0x3af13d['operator']='$between';_0x3af13d[_0xaeac('0x17')]+=','+_0x3af13d[_0xaeac('0x17')];}else if(_['includes']([_0xaeac('0x18'),_0xaeac('0x19')],_0x3af13d[_0xaeac('0x15')])){_0x3af13d[_0xaeac('0x17')]=moment(_0x3af13d['value'])[_0xaeac('0x1a')](0x1,_0xaeac('0x1b'))[_0xaeac('0x1c')](_0xaeac('0x1d'));}}if(_0x3af13d[_0xaeac('0x1e')]){_0x36ee18=_0x3af13d['castTo'];_0x6d400f[_0xaeac('0x1f')]=_0xaeac('0x20')+_0x37f866+'.'+_0x3af13d[_0xaeac('0x21')]+_0xaeac('0x22')+_0x3af13d[_0xaeac('0x1e')]+')\x20'+parseOperator(_0x3af13d['operator']);}else{_0x6d400f['text']=_0x37f866+'.'+_0x3af13d['field']+'\x20'+parseOperator(_0x3af13d['operator']);}if(_[_0xaeac('0x23')]([_0xaeac('0x24'),_0xaeac('0x25')],_0x3af13d[_0xaeac('0x15')]))_0x6d400f[_0xaeac('0x1f')]='('+_0x6d400f['text']+_0xaeac('0x26')+_0x37f866+'.'+_0x3af13d['field']+_0xaeac('0x27');_0x6d400f[_0xaeac('0x17')]=parseValue(_0x36ee18,_0x3af13d[_0xaeac('0x15')],_0x3af13d[_0xaeac('0x17')]);return _0x6d400f;};function parseOperator(_0x3f3d6a){var _0x4b3141;switch(_0x3f3d6a){case _0xaeac('0x28'):_0x4b3141=_0xaeac('0x29');break;case _0xaeac('0x25'):_0x4b3141=_0xaeac('0x2a');break;case _0xaeac('0x16'):_0x4b3141='=\x20?';break;case _0xaeac('0x24'):_0x4b3141='<>\x20?';break;case'$substring':case _0xaeac('0x2b'):case _0xaeac('0x2c'):_0x4b3141='LIKE\x20?';break;case _0xaeac('0x2d'):_0x4b3141=_0xaeac('0x2e');break;case _0xaeac('0x18'):_0x4b3141='>\x20?';break;case _0xaeac('0x19'):_0x4b3141=_0xaeac('0x2f');break;case _0xaeac('0x30'):_0x4b3141=_0xaeac('0x31');break;case _0xaeac('0x32'):_0x4b3141='BETWEEN\x20?\x20AND\x20?';break;}return _0x4b3141;}function parseValue(_0x5db087,_0x4bd849,_0x53e419){var _0x18a62a={'start':undefined,'end':undefined};switch(_0x4bd849){case _0xaeac('0x28'):case _0xaeac('0x25'):_0x18a62a['start']=_0x53e419[_0xaeac('0x8')](',');break;case _0xaeac('0x33'):_0x18a62a['start']='%'+_0x53e419+'%';break;case _0xaeac('0x2b'):_0x18a62a[_0xaeac('0x34')]=_0x53e419+'%';break;case'$endsWith':_0x18a62a['start']='%'+_0x53e419;break;case _0xaeac('0x32'):var _0x22a774=_0x53e419[_0xaeac('0x8')](',');var _0x53e419=_0x22a774[_0xaeac('0xc')]();var _0x2eb076=_0x22a774['pop']();if(_0x5db087===_0xaeac('0x14')){_0x53e419=moment(_0x53e419)[_0xaeac('0x35')](0x0,!![])['format']();_0x2eb076=moment(_0x2eb076)[_0xaeac('0x35')](0x0,!![])[_0xaeac('0x1a')](0x17,_0xaeac('0x36'))[_0xaeac('0x1a')](0x3b,'minutes')['add'](0x3b,_0xaeac('0x37'))['format']();}_0x18a62a={'start':_0x53e419,'end':_0x2eb076};break;default:_0x18a62a[_0xaeac('0x34')]=_0x53e419;break;}return _0x18a62a;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 9aa58ad..ef0d503 100644 --- a/server/components/parsers/qs.js +++ b/server/components/parsers/qs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8569=['join','getOptions','query','$id','map','intersection','attributes','length','offset','order','filter','object','columns','value','where','merge','type','VIRTUAL','lower','options','includeAll','push','include','moment','../../mysqldb','parse','keys','includes','model','alias','fields','raw','filters','isEmpty','forOwn','find','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','split','limit','sort','priority','col','unsigned','cast','omit','isObject','isString','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','match','forEach','replace'];(function(_0x5208b0,_0x4ced8f){var _0x33cd81=function(_0x36074a){while(--_0x36074a){_0x5208b0['push'](_0x5208b0['shift']());}};_0x33cd81(++_0x4ced8f);}(_0x8569,0x14d));var _0x9856=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x8569[_0x5a6644];return _0x3a2a5d;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require(_0x9856('0x0'));var db=require(_0x9856('0x1'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x35960d){var _0x5372fb=['ne'];try{var _0x3b2601=JSON[_0x9856('0x2')](_0x35960d);var _0x4ae486=Object[_0x9856('0x3')](_0x3b2601)[0x0];return _0x5372fb[_0x9856('0x4')](_0x4ae486);}catch(_0x2314f2){return![];}}function getOperatorValue(_0x291194){var _0xaea046=JSON[_0x9856('0x2')](_0x291194);var _0x2cf6aa=Object[_0x9856('0x3')](_0xaea046)[0x0];var _0x2abebc=_0xaea046[_0x2cf6aa];return{['$'+_0x2cf6aa]:_0x2abebc};}function parseIncludeModel(_0x238042){var _0x3c6adb=JSON[_0x9856('0x2')](_0x238042);return{'model':db[_0x3c6adb[_0x9856('0x5')]],'as':_0x3c6adb[_0x9856('0x6')],'attributes':_0x3c6adb[_0x9856('0x7')],'raw':_0x3c6adb[_0x9856('0x8')]};}exports[_0x9856('0x7')]=function(_0x2db3ed){var _0x5430b3=null;if(_0x2db3ed){_0x5430b3=_0x2db3ed['split'](',');}return _0x5430b3;};exports[_0x9856('0x9')]=function(_0x20b126,_0x45cad9){var _0x5c9ae7={};if(!_[_0x9856('0xa')](_0x20b126)){_[_0x9856('0xb')](_0x20b126,function(_0xc04c24,_0x3ec9cc){try{if(_0x45cad9){var _0x4edc12=_[_0x9856('0xc')](_0x45cad9,{'name':_0x3ec9cc})||{};if(hasSequelizeOperator(_0xc04c24)){_0x5c9ae7[_0x3ec9cc]=getOperatorValue(_0xc04c24);}else if(_0x4edc12['type']==='DATE'&&_['isPlainObject'](_0xc04c24)){var _0x517165=JSON['parse'](_0xc04c24);var _0x19d0a1={'$gte':moment(moment(_0x517165[_0x9856('0xd')])[_0x9856('0xe')](_0x9856('0xf')))[_0x9856('0x10')]()['format'](),'$lte':moment(moment(_0x517165[_0x9856('0x11')])[_0x9856('0xe')]('YYYY-MM-DD'))[_0x9856('0x10')]()[_0x9856('0x12')](0x1,'s')[_0x9856('0xe')]()};_0x5c9ae7[_0x3ec9cc]=_0x19d0a1;}else if(_0x4edc12[_0x9856('0x13')]===_0x9856('0x14')){_0x5c9ae7[_0x3ec9cc]=_0xc04c24;}else{_0x5c9ae7[_0x3ec9cc]=_['isArray'](_0xc04c24)?_0xc04c24:JSON[_0x9856('0x2')](_0xc04c24);}}else{_0x5c9ae7[_0x3ec9cc]=_[_0x9856('0x15')](_0xc04c24)?_0xc04c24:JSON['parse'](_0xc04c24);}}catch(_0x384dfd){_0x5c9ae7[_0x3ec9cc]=_0xc04c24[_0x9856('0x16')](',');}});}return _0x5c9ae7;};exports[_0x9856('0x17')]=function(_0x2450e0){_0x2450e0=parseInt(_0x2450e0,0xa);if(!_0x2450e0||_0x2450e0<0x0){_0x2450e0=LIMIT_VALUE;}return _0x2450e0;};exports['offset']=function(_0x54d788){_0x54d788=parseInt(_0x54d788,0xa);if(!_0x54d788||_0x54d788<0x0){_0x54d788=0x0;}return _0x54d788;};exports[_0x9856('0x18')]=function(_0x78c368){var _0x1b882d,_0x1fcce5=null;if(_0x78c368){_0x1b882d=_0x78c368[_0x9856('0x16')](',');_0x1fcce5=_['map'](_0x1b882d,function(_0x49c014){if(_0x49c014['indexOf']('-')===0x0){return[_0x49c014===_0x9856('0x19')?sequelize['cast'](sequelize[_0x9856('0x1a')]('priority'),_0x9856('0x1b')):_0x49c014['substr'](0x1),'DESC'];}else{return[_0x49c014===_0x9856('0x19')?sequelize[_0x9856('0x1c')](sequelize[_0x9856('0x1a')]('priority'),_0x9856('0x1b')):_0x49c014,'ASC'];}});}return _0x1fcce5;};exports['omit']=function(_0x539fb0,_0xa2c65){if(_['isEmpty'](_0x539fb0)){return _0x539fb0;}if(_[_0x9856('0x15')](_0x539fb0)){for(var _0x4a46b4=0x0;_0x4a46b4<_0x539fb0['length'];_0x4a46b4+=0x1){_0x539fb0[_0x4a46b4]=this[_0x9856('0x1d')](_0x539fb0[_0x4a46b4],_0xa2c65);}return _0x539fb0;}if(!_[_0x9856('0x1e')](_0x539fb0)){return _0x539fb0;}if(_[_0x9856('0x1f')](_0xa2c65)){_0xa2c65=[_0xa2c65];}if(!_['isArray'](_0xa2c65)){return _0x539fb0;}for(var _0x21f66f=0x0;_0x21f66f<_0xa2c65['length'];_0x21f66f+=0x1){_[_0x9856('0x20')](_0x539fb0,_0xa2c65[_0x21f66f]);}for(var _0x3d4e5b in _0x539fb0){if(_0x539fb0[_0x9856('0x21')](_0x3d4e5b)){_0x539fb0[_0x3d4e5b]=this['omit'](_0x539fb0[_0x3d4e5b],_0xa2c65);}}return _0x539fb0;};exports[_0x9856('0x22')]=function(_0x725a32){return _0x725a32['match'](RegExp(_0x9856('0x23')))?!![]:![];};exports['isEmail']=function(_0x41c5b7){return _0x41c5b7[_0x9856('0x24')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x3eae61,_0xf9a9e5){var _0x183bbf=[];var _0x2658fd=/[ `!@#$%^&*()_\-?~]/;var _0x175770=_0xf9a9e5?'\x22{EXPR}\x22':'{EXPR}';_0x3eae61[_0x9856('0x16')](/[ ,]+/)[_0x9856('0x25')](function(_0x46822b){_0x46822b=_0x46822b[_0x9856('0x26')](/([^:]")"+/g,'$1');_0x46822b='+'+_0x46822b+'*';var _0x4f03c8=_0x46822b[_0x9856('0x24')](_0x2658fd);if(_0x4f03c8){_0x46822b='\x22'+_0x46822b+'\x22';}_0x183bbf['push'](_0x46822b);});_0x175770=_0x175770[_0x9856('0x26')]('{EXPR}',_0x183bbf[_0x9856('0x27')]('\x20'));return _0x175770;};exports[_0x9856('0x28')]=function(_0x39e56d,_0x367215,_0x55014c){var _0xca92d8={},_0x42b57d={};if(_0x367215[_0x9856('0x29')][_0x9856('0x2a')]){_0x367215[_0x9856('0x29')]['id']=_0x367215['query'][_0x9856('0x2a')];delete _0x367215[_0x9856('0x29')][_0x9856('0x2a')];}_0xca92d8['model']=_[_0x9856('0x2b')](_0x39e56d,_0x9856('0x13'));_0xca92d8['query']=_['keys'](_0x367215[_0x9856('0x29')]);_0xca92d8[_0x9856('0x9')]=_[_0x9856('0x2c')](_0xca92d8[_0x9856('0x5')],_0xca92d8['query']);_0x42b57d[_0x9856('0x2d')]=_[_0x9856('0x2c')](_0xca92d8['model'],this[_0x9856('0x7')](_0x367215[_0x9856('0x29')][_0x9856('0x7')]));_0x42b57d['attributes']=_0x42b57d['attributes'][_0x9856('0x2e')]?_0x42b57d[_0x9856('0x2d')]:_0xca92d8[_0x9856('0x5')];if(!_0x367215[_0x9856('0x29')][_0x9856('0x21')]('nolimit')){_0x42b57d[_0x9856('0x17')]=this[_0x9856('0x17')](_0x367215[_0x9856('0x29')][_0x9856('0x17')]);_0x42b57d['offset']=this[_0x9856('0x2f')](_0x367215[_0x9856('0x29')][_0x9856('0x2f')]);}_0x42b57d[_0x9856('0x30')]=this[_0x9856('0x18')](_0x367215[_0x9856('0x29')][_0x9856('0x18')]);_0x42b57d['where']=this[_0x9856('0x9')](_['pick'](_0x367215['query'],_0xca92d8[_0x9856('0x9')]),_0x39e56d);if(_0x367215[_0x9856('0x29')][_0x9856('0x31')]){var _0x543292=_0x39e56d;var _0x1d9c78=_0x367215['query'][_0x9856('0x31')];if(typeof _0x1d9c78===_0x9856('0x32')){_0x543292=_[_0x9856('0x31')](_0x39e56d,function(_0x5dd416){return _[_0x9856('0x4')](_0x1d9c78[_0x9856('0x33')],_0x5dd416[_0x9856('0x13')]);});_0x1d9c78=_0x1d9c78[_0x9856('0x34')];}_0x42b57d[_0x9856('0x35')]=_[_0x9856('0x36')](_0x42b57d[_0x9856('0x35')],{'$or':_[_0x9856('0x2b')](_0x543292,function(_0x12ca43){if(_0x12ca43[_0x9856('0x37')]!==_0x9856('0x38')){if(_0x55014c){return sequelize[_0x9856('0x35')](sequelize['fn']('lower',sequelize[_0x9856('0x1a')](_0x12ca43[_0x9856('0x13')])),{'$like':sequelize['fn'](_0x9856('0x39'),'%'+_0x367215[_0x9856('0x29')][_0x9856('0x31')]+'%')});}else{var _0x28dd12={};_0x28dd12[_0x12ca43[_0x9856('0x13')]]={'$like':'%'+_0x367215[_0x9856('0x29')]['filter']+'%'};return _0x28dd12;}}})});}_0x42b57d=_[_0x9856('0x36')]({},_0x42b57d,_0x367215[_0x9856('0x3a')]);return _0x42b57d;};exports['include']=function(_0x1119d4){var _0x49efec=[];if(_0x1119d4[_0x9856('0x3b')]){_0x49efec[_0x9856('0x3c')]({'all':!![]});}else if(_0x1119d4['include']){if(Array[_0x9856('0x15')](_0x1119d4[_0x9856('0x3d')])){_0x49efec=Object[_0x9856('0x3')](_0x1119d4['include'])[_0x9856('0x2b')](function(_0xc731be){return parseIncludeModel(_0x1119d4[_0x9856('0x3d')][_0xc731be]);});}else{var _0x52fcd5=parseIncludeModel(_0x1119d4['include']);_0x49efec[_0x9856('0x3c')](_0x52fcd5);}}return _0x49efec;}; \ No newline at end of file +var _0xc0b3=['moment','../../mysqldb','parse','keys','model','alias','fields','raw','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','YYYY-MM-DD','format','$lte','utc','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','cast','col','DESC','priority','ASC','omit','length','isString','unset','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','push','replace','join','getOptions','query','$id','intersection','attributes','hasOwnProperty','nolimit','order','pick','filter','object','includes','value','where','merge','VIRTUAL','lower','options','include','includeAll','lodash','sequelize'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xc0b3,0x1a8));var _0x3c0b=function(_0x4cea1f,_0x23162f){_0x4cea1f=_0x4cea1f-0x0;var _0x22087e=_0xc0b3[_0x4cea1f];return _0x22087e;};'use strict';var _=require(_0x3c0b('0x0'));var sequelize=require(_0x3c0b('0x1'));var moment=require(_0x3c0b('0x2'));var db=require(_0x3c0b('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x11e11e){var _0x36c46f=['ne'];try{var _0x181848=JSON[_0x3c0b('0x4')](_0x11e11e);var _0x13c9f6=Object['keys'](_0x181848)[0x0];return _0x36c46f['includes'](_0x13c9f6);}catch(_0x3e6636){return![];}}function getOperatorValue(_0x41f671){var _0x312d35=JSON[_0x3c0b('0x4')](_0x41f671);var _0x37124e=Object[_0x3c0b('0x5')](_0x312d35)[0x0];var _0x2d384c=_0x312d35[_0x37124e];return{['$'+_0x37124e]:_0x2d384c};}function parseIncludeModel(_0x13e8c5){var _0x3e6e00=JSON[_0x3c0b('0x4')](_0x13e8c5);return{'model':db[_0x3e6e00[_0x3c0b('0x6')]],'as':_0x3e6e00[_0x3c0b('0x7')],'attributes':_0x3e6e00[_0x3c0b('0x8')],'raw':_0x3e6e00[_0x3c0b('0x9')]};}exports[_0x3c0b('0x8')]=function(_0x21b360){var _0x32a5d4=null;if(_0x21b360){_0x32a5d4=_0x21b360[_0x3c0b('0xa')](',');}return _0x32a5d4;};exports[_0x3c0b('0xb')]=function(_0x482979,_0x554a1b){var _0x3b09b6={};if(!_[_0x3c0b('0xc')](_0x482979)){_[_0x3c0b('0xd')](_0x482979,function(_0x2a5d91,_0x1a9b76){try{if(_0x554a1b){var _0x4c501f=_[_0x3c0b('0xe')](_0x554a1b,{'name':_0x1a9b76})||{};if(hasSequelizeOperator(_0x2a5d91)){_0x3b09b6[_0x1a9b76]=getOperatorValue(_0x2a5d91);}else if(_0x4c501f[_0x3c0b('0xf')]===_0x3c0b('0x10')&&_[_0x3c0b('0x11')](_0x2a5d91)){var _0x12b9a5=JSON[_0x3c0b('0x4')](_0x2a5d91);var _0x2007a2={'$gte':moment(moment(_0x12b9a5[_0x3c0b('0x12')])['format'](_0x3c0b('0x13')))['utc']()[_0x3c0b('0x14')](),'$lte':moment(moment(_0x12b9a5[_0x3c0b('0x15')])['format'](_0x3c0b('0x13')))[_0x3c0b('0x16')]()[_0x3c0b('0x17')](0x1,'s')[_0x3c0b('0x14')]()};_0x3b09b6[_0x1a9b76]=_0x2007a2;}else if(_0x4c501f[_0x3c0b('0x18')]===_0x3c0b('0x19')){_0x3b09b6[_0x1a9b76]=_0x2a5d91;}else{_0x3b09b6[_0x1a9b76]=_[_0x3c0b('0x1a')](_0x2a5d91)?_0x2a5d91:JSON['parse'](_0x2a5d91);}}else{_0x3b09b6[_0x1a9b76]=_[_0x3c0b('0x1a')](_0x2a5d91)?_0x2a5d91:JSON[_0x3c0b('0x4')](_0x2a5d91);}}catch(_0x4e25b8){_0x3b09b6[_0x1a9b76]=_0x2a5d91[_0x3c0b('0xa')](',');}});}return _0x3b09b6;};exports[_0x3c0b('0x1b')]=function(_0x4dfa07){_0x4dfa07=parseInt(_0x4dfa07,0xa);if(!_0x4dfa07||_0x4dfa07<0x0){_0x4dfa07=LIMIT_VALUE;}return _0x4dfa07;};exports[_0x3c0b('0x1c')]=function(_0x345c78){_0x345c78=parseInt(_0x345c78,0xa);if(!_0x345c78||_0x345c78<0x0){_0x345c78=0x0;}return _0x345c78;};exports[_0x3c0b('0x1d')]=function(_0x53b938){var _0x4187c9,_0x47abf9=null;if(_0x53b938){_0x4187c9=_0x53b938[_0x3c0b('0xa')](',');_0x47abf9=_[_0x3c0b('0x1e')](_0x4187c9,function(_0x585b82){if(_0x585b82[_0x3c0b('0x1f')]('-')===0x0){return[_0x585b82==='priority'?sequelize[_0x3c0b('0x20')](sequelize[_0x3c0b('0x21')]('priority'),'unsigned'):_0x585b82['substr'](0x1),_0x3c0b('0x22')];}else{return[_0x585b82===_0x3c0b('0x23')?sequelize[_0x3c0b('0x20')](sequelize[_0x3c0b('0x21')](_0x3c0b('0x23')),'unsigned'):_0x585b82,_0x3c0b('0x24')];}});}return _0x47abf9;};exports[_0x3c0b('0x25')]=function(_0x20e307,_0x2198d2){if(_[_0x3c0b('0xc')](_0x20e307)){return _0x20e307;}if(_[_0x3c0b('0x1a')](_0x20e307)){for(var _0x378aa0=0x0;_0x378aa0<_0x20e307[_0x3c0b('0x26')];_0x378aa0+=0x1){_0x20e307[_0x378aa0]=this['omit'](_0x20e307[_0x378aa0],_0x2198d2);}return _0x20e307;}if(!_['isObject'](_0x20e307)){return _0x20e307;}if(_[_0x3c0b('0x27')](_0x2198d2)){_0x2198d2=[_0x2198d2];}if(!_[_0x3c0b('0x1a')](_0x2198d2)){return _0x20e307;}for(var _0x239c2f=0x0;_0x239c2f<_0x2198d2[_0x3c0b('0x26')];_0x239c2f+=0x1){_[_0x3c0b('0x28')](_0x20e307,_0x2198d2[_0x239c2f]);}for(var _0xa4af17 in _0x20e307){if(_0x20e307['hasOwnProperty'](_0xa4af17)){_0x20e307[_0xa4af17]=this['omit'](_0x20e307[_0xa4af17],_0x2198d2);}}return _0x20e307;};exports['isNumeric']=function(_0x6aa1ac){return _0x6aa1ac[_0x3c0b('0x29')](RegExp(_0x3c0b('0x2a')))?!![]:![];};exports[_0x3c0b('0x2b')]=function(_0x4547c0){return _0x4547c0[_0x3c0b('0x29')](/^\S+@\S+$/)?!![]:![];};exports[_0x3c0b('0x2c')]=function(_0x23f120,_0x286f2a){var _0x1d68bc=[];var _0x329e8d=/[ `!@#$%^&*()_\-?~]/;var _0x84dfa=_0x286f2a?_0x3c0b('0x2d'):_0x3c0b('0x2e');_0x23f120[_0x3c0b('0xa')](/[ ,]+/)[_0x3c0b('0x2f')](function(_0x384e97){_0x384e97=_0x384e97['replace'](/([^:]")"+/g,'$1');_0x384e97='+'+_0x384e97+'*';var _0x3f2a67=_0x384e97[_0x3c0b('0x29')](_0x329e8d);if(_0x3f2a67){_0x384e97='\x22'+_0x384e97+'\x22';}_0x1d68bc[_0x3c0b('0x30')](_0x384e97);});_0x84dfa=_0x84dfa[_0x3c0b('0x31')](_0x3c0b('0x2e'),_0x1d68bc[_0x3c0b('0x32')]('\x20'));return _0x84dfa;};exports[_0x3c0b('0x33')]=function(_0x29b2c1,_0xe9c088,_0x225579){var _0x32b8f3={},_0x501baa={};if(_0xe9c088[_0x3c0b('0x34')][_0x3c0b('0x35')]){_0xe9c088['query']['id']=_0xe9c088[_0x3c0b('0x34')][_0x3c0b('0x35')];delete _0xe9c088[_0x3c0b('0x34')][_0x3c0b('0x35')];}_0x32b8f3[_0x3c0b('0x6')]=_[_0x3c0b('0x1e')](_0x29b2c1,_0x3c0b('0x18'));_0x32b8f3[_0x3c0b('0x34')]=_['keys'](_0xe9c088['query']);_0x32b8f3[_0x3c0b('0xb')]=_[_0x3c0b('0x36')](_0x32b8f3[_0x3c0b('0x6')],_0x32b8f3[_0x3c0b('0x34')]);_0x501baa[_0x3c0b('0x37')]=_[_0x3c0b('0x36')](_0x32b8f3[_0x3c0b('0x6')],this[_0x3c0b('0x8')](_0xe9c088['query'][_0x3c0b('0x8')]));_0x501baa[_0x3c0b('0x37')]=_0x501baa[_0x3c0b('0x37')][_0x3c0b('0x26')]?_0x501baa[_0x3c0b('0x37')]:_0x32b8f3[_0x3c0b('0x6')];if(!_0xe9c088[_0x3c0b('0x34')][_0x3c0b('0x38')](_0x3c0b('0x39'))){_0x501baa[_0x3c0b('0x1b')]=this['limit'](_0xe9c088[_0x3c0b('0x34')]['limit']);_0x501baa[_0x3c0b('0x1c')]=this[_0x3c0b('0x1c')](_0xe9c088['query'][_0x3c0b('0x1c')]);}_0x501baa[_0x3c0b('0x3a')]=this['sort'](_0xe9c088['query']['sort']);_0x501baa['where']=this[_0x3c0b('0xb')](_[_0x3c0b('0x3b')](_0xe9c088[_0x3c0b('0x34')],_0x32b8f3[_0x3c0b('0xb')]),_0x29b2c1);if(_0xe9c088['query'][_0x3c0b('0x3c')]){var _0x725b9c=_0x29b2c1;var _0x2f787a=_0xe9c088[_0x3c0b('0x34')][_0x3c0b('0x3c')];if(typeof _0x2f787a===_0x3c0b('0x3d')){_0x725b9c=_[_0x3c0b('0x3c')](_0x29b2c1,function(_0x4d9e0a){return _[_0x3c0b('0x3e')](_0x2f787a['columns'],_0x4d9e0a[_0x3c0b('0x18')]);});_0x2f787a=_0x2f787a[_0x3c0b('0x3f')];}_0x501baa[_0x3c0b('0x40')]=_[_0x3c0b('0x41')](_0x501baa[_0x3c0b('0x40')],{'$or':_[_0x3c0b('0x1e')](_0x725b9c,function(_0x884e9d){if(_0x884e9d[_0x3c0b('0xf')]!==_0x3c0b('0x42')){if(_0x225579){return sequelize[_0x3c0b('0x40')](sequelize['fn'](_0x3c0b('0x43'),sequelize[_0x3c0b('0x21')](_0x884e9d[_0x3c0b('0x18')])),{'$like':sequelize['fn'](_0x3c0b('0x43'),'%'+_0xe9c088[_0x3c0b('0x34')][_0x3c0b('0x3c')]+'%')});}else{var _0x163c81={};_0x163c81[_0x884e9d['name']]={'$like':'%'+_0xe9c088[_0x3c0b('0x34')][_0x3c0b('0x3c')]+'%'};return _0x163c81;}}})});}_0x501baa=_[_0x3c0b('0x41')]({},_0x501baa,_0xe9c088[_0x3c0b('0x44')]);return _0x501baa;};exports[_0x3c0b('0x45')]=function(_0x5e5c5b){var _0xa56b29=[];if(_0x5e5c5b[_0x3c0b('0x46')]){_0xa56b29[_0x3c0b('0x30')]({'all':!![]});}else if(_0x5e5c5b[_0x3c0b('0x45')]){if(Array[_0x3c0b('0x1a')](_0x5e5c5b['include'])){_0xa56b29=Object['keys'](_0x5e5c5b[_0x3c0b('0x45')])['map'](function(_0x3a7c84){return parseIncludeModel(_0x5e5c5b[_0x3c0b('0x45')][_0x3a7c84]);});}else{var _0x55151c=parseIncludeModel(_0x5e5c5b[_0x3c0b('0x45')]);_0xa56b29[_0x3c0b('0x30')](_0x55151c);}}return _0xa56b29;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 4451629..ec817af 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['substring','indexOf','validateSortParameter','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','openchannelCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','role','openchannelStatusTime','voiceStatusTime','chatCapacity','whatsappCapacity','smsCurrentCapacity','onhold','routealias','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','filter','length','idle','unknown','ringing','voiceStatus','every','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','error','merge','catch','getRealtimeAgents','pause','*pause','busy','isArray','startCase','Queue','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','User','findAll','name','fullname','pauseType','globalStatus','getSortedAgentsIdsByStatus','split','fields','DESC','internal'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0xac4a('0x0'));var jayson=require(_0xac4a('0x1'));var db=require(_0xac4a('0x2'))['db'];var amiClient=jayson[_0xac4a('0x3')][_0xac4a('0x4')]({'port':0x232a});var routingClient=jayson[_0xac4a('0x3')]['http']({'port':0x232c});function isAgentPaused(_0x5cda73,_0x47d4f6){var _0x2f48ed=[_0x5cda73[_0xac4a('0x5')],_0x5cda73[_0xac4a('0x6')],_0x5cda73[_0xac4a('0x7')],_0x5cda73[_0xac4a('0x8')],_0x5cda73[_0xac4a('0x9')],_0x5cda73[_0xac4a('0xa')],_0x5cda73[_0xac4a('0xb')]];if(!_0x47d4f6)return _['every'](_0x2f48ed);var _0x5b8339=_[_0xac4a('0xc')](_0x2f48ed);return _0x5b8339[_0xac4a('0xd')]>0x0&&_0x5b8339[_0xac4a('0xd')]<_0x2f48ed['length']?!![]:![];}function isIdle(_0x1d182e){return _0x1d182e===_0xac4a('0xe')||_0x1d182e===_0xac4a('0xf')||_0x1d182e==='unavailable'||_0x1d182e===_0xac4a('0x10')||_['isNil'](_0x1d182e);}function isAgentIdle(_0x2f062c){if(_0x2f062c['voiceStatus']!==_0xac4a('0xe')&&_0x2f062c[_0xac4a('0xa')]){_0x2f062c[_0xac4a('0x11')]='pause';return![];}return _[_0xac4a('0x12')]([_0x2f062c[_0xac4a('0x13')],_0x2f062c[_0xac4a('0x14')],_0x2f062c[_0xac4a('0x15')],_0x2f062c[_0xac4a('0x16')],_0x2f062c[_0xac4a('0x17')],_0x2f062c[_0xac4a('0x11')],_0x2f062c[_0xac4a('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xac4a('0x19')](_0xac4a('0x1a'),{})[_0xac4a('0x1b')](function(_0x26dbb8){if(_0x26dbb8['error']){throw new Error(_0xac4a('0x1c'));}var _0x34d797=_0x26dbb8[_0xac4a('0x1d')];return routingClient[_0xac4a('0x19')](_0xac4a('0x1a'),{})[_0xac4a('0x1b')](function(_0x28e304){if(_0x28e304[_0xac4a('0x1e')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x5ac21e=_0x28e304[_0xac4a('0x1d')];return _[_0xac4a('0x1f')]({},_0x34d797,_0x5ac21e);});})[_0xac4a('0x20')](function(_0x4d837c){throw _0x4d837c;});}exports[_0xac4a('0x21')]=getRealtimeAgents;function getAgentStatus(_0x15c223){var _0x3752e4=_0xac4a('0xf');if(isAgentPaused(_0x15c223))_0x3752e4=_0xac4a('0x22');else if(isAgentPaused(_0x15c223,!![]))_0x3752e4=_0xac4a('0x23');else if(isAgentIdle(_0x15c223))_0x3752e4=_0xac4a('0xe');else _0x3752e4=_0xac4a('0x24');return _0x3752e4;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x3d8f0a,_0x3204ad){var _0x599787=_[_0xac4a('0x25')](_0x3d8f0a)?_0x3d8f0a:[_0x3d8f0a];var _0x4169c0=_[_0xac4a('0x26')](_0x3204ad)+_0xac4a('0x27');var _0x4d2d6c=_[_0xac4a('0x28')](_0x599787,function(_0x2503d8){return db[_0x4169c0][_0xac4a('0x29')]({'where':{'id':_0x2503d8}})[_0xac4a('0x1b')](function(_0x594f36){if(!_0x594f36)return[];return _0x594f36[_0xac4a('0x2a')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xac4a('0x2b')](_0x4d2d6c)[_0xac4a('0x1b')](function(_0x3e2c69){var _0x3bc318=_(_0x3e2c69)[_0xac4a('0x2c')]()[_0xac4a('0x28')]('id')[_0xac4a('0x2d')]()[_0xac4a('0x2e')]();return _0x3bc318;});}exports[_0xac4a('0x2f')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x20202c,_0x4e17ce,_0x23b061){try{if(_0x4e17ce[_0xac4a('0xd')]>0x0){_0x20202c=_0x20202c[_0xac4a('0xc')](function(_0x2772fe){return _0x4e17ce[_0xac4a('0x30')](_0x2772fe['id']);});}var _0x4a5a9e=_0x20202c['filter'](function(_0xdb7e){var _0x7a948b=_0xac4a('0x24');if(isAgentIdle(_0xdb7e)){_0x7a948b='idle';}return _0x7a948b===_0x23b061;});return _['map'](_0x4a5a9e,'id');}catch(_0x355755){throw _0x355755;}}exports[_0xac4a('0x31')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x228629,_0x432066,_0x17118e){return Promise['resolve']()[_0xac4a('0x1b')](function(){if(_0x432066['length']>0x0){_0x228629=_0x228629[_0xac4a('0xc')](function(_0x57adcf){return _0x432066[_0xac4a('0x30')](_0x57adcf['id']);});}return _0x228629;})[_0xac4a('0x1b')](function(){return db[_0xac4a('0x32')][_0xac4a('0x33')]({'attributes':['id',_0xac4a('0x34'),_0xac4a('0x35'),_0xac4a('0x5'),_0xac4a('0x6'),_0xac4a('0x7'),_0xac4a('0x8'),_0xac4a('0x9'),_0xac4a('0xa'),_0xac4a('0xb'),_0xac4a('0x36')],'where':{'id':{'$in':_['map'](_0x228629,'id')}},'raw':!![]});})[_0xac4a('0x1b')](function(_0x1c41fb){return _0x1c41fb['map'](function(_0x2a5419){var _0x1af1c1=_['find'](_0x228629,['id',_0x2a5419['id']]);var _0x58804b=filterAgentAttributes(_0x1af1c1);_[_0xac4a('0x1f')](_0x2a5419,_0x58804b);_0x2a5419[_0xac4a('0x37')]=getAgentStatus(_0x2a5419);return _0x2a5419;});})[_0xac4a('0x1b')](function(_0x3de9e2){var _0x4f5986=sortAgentsByStatus(_0x3de9e2,_0x17118e);return _[_0xac4a('0x28')](_0x4f5986,'id');})[_0xac4a('0x20')](function(_0x4e7630){throw _0x4e7630;});}exports[_0xac4a('0x38')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x34f55c){var _0x3ea5c8={'fields':[],'order':null};var _0x5f0eb8=_0x34f55c[_0xac4a('0x39')](',');_0x3ea5c8[_0xac4a('0x3a')]=_[_0xac4a('0xc')](_0x5f0eb8,function(_0x4e0445){if(!_0x4e0445[_0xac4a('0x30')](_0xac4a('0x37'))){return!![];}_0x3ea5c8['order']=_['startsWith'](_0x4e0445,'-')?_0xac4a('0x3b'):'ASC';return![];});return _0x3ea5c8;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x5f0af0){if(!_0x5f0af0){_0x5f0af0='fullname,internal';}if(_0x5f0af0[_0xac4a('0x30')](_0xac4a('0x35'))&&!_0x5f0af0[_0xac4a('0x30')](_0xac4a('0x3c'))){var _0x2bdb21=_0x5f0af0[_0xac4a('0x3d')](0x0,_0x5f0af0[_0xac4a('0x3e')](_0xac4a('0x35')));_0x5f0af0+=','+_0x2bdb21+_0xac4a('0x3c');}return _0x5f0af0;}exports[_0xac4a('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0x14f7d5,_0x1c2a87){var _0x4e4994=_0x14f7d5['sort'](function(_0x5cd24f,_0x1e1cc5){if(_0x5cd24f[_0xac4a('0x37')]===_0x1e1cc5[_0xac4a('0x37')]){if(_0x5cd24f[_0xac4a('0x37')]===_0xac4a('0x22')){if(_0x1c2a87===_0xac4a('0x3b')){return(_0x5cd24f[_0xac4a('0x36')]||'')<(_0x1e1cc5[_0xac4a('0x36')]||'')||_0x5cd24f[_0xac4a('0x35')][_0xac4a('0x40')]()>_0x1e1cc5['fullname'][_0xac4a('0x40')]()?0x1:-0x1;}else{return(_0x5cd24f[_0xac4a('0x36')]||'')<(_0x1e1cc5[_0xac4a('0x36')]||'')||_0x5cd24f[_0xac4a('0x35')][_0xac4a('0x40')]()>_0x1e1cc5['fullname'][_0xac4a('0x40')]()?-0x1:0x1;}}else{if(_0x1c2a87===_0xac4a('0x3b')){return _0x5cd24f['fullname'][_0xac4a('0x40')]()<_0x1e1cc5['fullname'][_0xac4a('0x40')]()?0x1:-0x1;}else{return _0x5cd24f[_0xac4a('0x35')][_0xac4a('0x40')]()<_0x1e1cc5[_0xac4a('0x35')][_0xac4a('0x40')]()?-0x1:0x1;}}}else{if(_0x1c2a87===_0xac4a('0x3b')){return _0x5cd24f[_0xac4a('0x37')]<_0x1e1cc5[_0xac4a('0x37')]?0x1:-0x1;}else{return _0x5cd24f[_0xac4a('0x37')]<_0x1e1cc5[_0xac4a('0x37')]?-0x1:0x1;}}});return _0x4e4994;}exports[_0xac4a('0x41')]=sortAgentsByStatus;function filterAgentAttributes(_0x3b68b3){var _0x569812=[_0xac4a('0x42'),_0xac4a('0x43'),_0xac4a('0x44'),'lastPauseAt',_0xac4a('0x36'),_0xac4a('0x45'),'internal',_0xac4a('0x46'),'chatPause',_0xac4a('0x8'),_0xac4a('0x7'),_0xac4a('0x9'),'whatsappPause','faxPause',_0xac4a('0xa'),'chatCapacity',_0xac4a('0x47'),'mailCapacity',_0xac4a('0x48'),'whatsappCapacity',_0xac4a('0x49'),_0xac4a('0x4a'),_0xac4a('0x4b'),_0xac4a('0x4c'),'smsCurrentCapacity',_0xac4a('0x4d'),_0xac4a('0x4e'),_0xac4a('0x13'),_0xac4a('0x16'),_0xac4a('0x15'),_0xac4a('0x17'),_0xac4a('0x18'),'faxStatus',_0xac4a('0x11'),_0xac4a('0x4f'),'openchannelStatusTime',_0xac4a('0x50'),_0xac4a('0x51'),_0xac4a('0x52'),_0xac4a('0x53'),'voiceStatusTime',_0xac4a('0x54'),_0xac4a('0x55'),_0xac4a('0x56'),_0xac4a('0x57'),_0xac4a('0x58'),'routealias'];var _0x179373=['chatPause',_0xac4a('0x8'),_0xac4a('0x7'),'smsPause','whatsappPause',_0xac4a('0x6'),_0xac4a('0xa'),'online'];var _0x18d29c=_(_0x3b68b3)[_0xac4a('0x59')](_0x179373)[_0xac4a('0x5a')](_0x569812)[_0xac4a('0x2e')]();return _0x18d29c;}exports['filterAgentAttributes']=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xac4a('0x34'),_0xac4a('0x35'),_0xac4a('0x5b'),_0xac4a('0x3c'),_0xac4a('0x43'),_0xac4a('0x37'),_0xac4a('0x42'),'lastLoginAt',_0xac4a('0x36'),_0xac4a('0x45'),_0xac4a('0x6'),_0xac4a('0x5'),_0xac4a('0x7'),_0xac4a('0x8'),_0xac4a('0x9'),_0xac4a('0xa'),_0xac4a('0xb'),_0xac4a('0x13'),_0xac4a('0x14'),_0xac4a('0x15'),_0xac4a('0x16'),_0xac4a('0x17'),_0xac4a('0x11'),_0xac4a('0x18'),'chatStatusTime',_0xac4a('0x53'),'mailStatusTime',_0xac4a('0x5c'),'smsStatusTime',_0xac4a('0x5d'),'whatsappStatusTime',_0xac4a('0x5e'),'faxCapacity','mailCapacity',_0xac4a('0x47'),_0xac4a('0x48'),_0xac4a('0x5f'),_0xac4a('0x4a'),_0xac4a('0x4e'),_0xac4a('0x4c'),'openchannelCurrentCapacity',_0xac4a('0x60'),'whatsappCurrentCapacity',_0xac4a('0x57'),'phoneBarEnableAutomaticScreenRecording',_0xac4a('0x55'),_0xac4a('0x61'),_0xac4a('0x54'),_0xac4a('0x62'),_0xac4a('0x56')];}exports[_0xac4a('0x63')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x687b=['openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','mailStatus','chatStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','role','faxStatusTime','openchannelStatusTime','chatCapacity','chatCurrentCapacity','faxCurrentCapacity','whatsappCurrentCapacity','destconnectedlinenum','onhold','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','every','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','chatStatus','faxStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','pause','getAgentStatus','isArray','startCase','Queue','map','findOne','getAgents','all','flatten','uniq','value','filter','busy','getAgentIdsByStatus','resolve','includes','User','findAll','whatsappPause','pauseType','find','globalStatus','catch','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','ASC','fullname,internal','fullname','substring','internal','validateSortParameter','sort','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','address'];(function(_0x47a44a,_0x5ce11d){var _0x3c8653=function(_0x35886e){while(--_0x35886e){_0x47a44a['push'](_0x47a44a['shift']());}};_0x3c8653(++_0x5ce11d);}(_0x687b,0x14a));var _0xb687=function(_0x135904,_0x1e252b){_0x135904=_0x135904-0x0;var _0x1ce7d5=_0x687b[_0x135904];return _0x1ce7d5;};'use strict';var _=require(_0xb687('0x0'));var jayson=require(_0xb687('0x1'));var db=require(_0xb687('0x2'))['db'];var amiClient=jayson[_0xb687('0x3')]['http']({'port':0x232a});var routingClient=jayson['client'][_0xb687('0x4')]({'port':0x232c});function isAgentPaused(_0x2a4a7c,_0x36c468){var _0x31bd0d=[_0x2a4a7c[_0xb687('0x5')],_0x2a4a7c[_0xb687('0x6')],_0x2a4a7c[_0xb687('0x7')],_0x2a4a7c[_0xb687('0x8')],_0x2a4a7c[_0xb687('0x9')],_0x2a4a7c[_0xb687('0xa')],_0x2a4a7c['whatsappPause']];if(!_0x36c468)return _[_0xb687('0xb')](_0x31bd0d);var _0xd40346=_['filter'](_0x31bd0d);return _0xd40346[_0xb687('0xc')]>0x0&&_0xd40346[_0xb687('0xc')]<_0x31bd0d[_0xb687('0xc')]?!![]:![];}function isIdle(_0x15dc9a){return _0x15dc9a===_0xb687('0xd')||_0x15dc9a===_0xb687('0xe')||_0x15dc9a===_0xb687('0xf')||_0x15dc9a===_0xb687('0x10')||_[_0xb687('0x11')](_0x15dc9a);}function isAgentIdle(_0x5103b9){if(_0x5103b9[_0xb687('0x12')]!==_0xb687('0xd')&&_0x5103b9[_0xb687('0xa')]){_0x5103b9[_0xb687('0x12')]='pause';return![];}return _['every']([_0x5103b9[_0xb687('0x13')],_0x5103b9[_0xb687('0x14')],_0x5103b9['mailStatus'],_0x5103b9[_0xb687('0x15')],_0x5103b9[_0xb687('0x16')],_0x5103b9[_0xb687('0x12')],_0x5103b9[_0xb687('0x17')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xb687('0x18')](_0xb687('0x19'),{})[_0xb687('0x1a')](function(_0x141375){if(_0x141375[_0xb687('0x1b')]){throw new Error(_0xb687('0x1c'));}var _0x25124a=_0x141375[_0xb687('0x1d')];return routingClient['request'](_0xb687('0x19'),{})[_0xb687('0x1a')](function(_0x30d370){if(_0x30d370['error']){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x12eff1=_0x30d370[_0xb687('0x1d')];return _[_0xb687('0x1e')]({},_0x25124a,_0x12eff1);});})['catch'](function(_0x42cdd2){throw _0x42cdd2;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x1bd2bf){var _0x243236=_0xb687('0xe');if(isAgentPaused(_0x1bd2bf))_0x243236=_0xb687('0x1f');else if(isAgentPaused(_0x1bd2bf,!![]))_0x243236='*pause';else if(isAgentIdle(_0x1bd2bf))_0x243236=_0xb687('0xd');else _0x243236='busy';return _0x243236;}exports[_0xb687('0x20')]=getAgentStatus;function getAgentIdsByQueues(_0x90e892,_0x274241){var _0x546fde=_[_0xb687('0x21')](_0x90e892)?_0x90e892:[_0x90e892];var _0x491623=_[_0xb687('0x22')](_0x274241)+_0xb687('0x23');var _0xbf6c58=_[_0xb687('0x24')](_0x546fde,function(_0xf48ba4){return db[_0x491623][_0xb687('0x25')]({'where':{'id':_0xf48ba4}})['then'](function(_0xf45db0){if(!_0xf45db0)return[];return _0xf45db0[_0xb687('0x26')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xb687('0x27')](_0xbf6c58)[_0xb687('0x1a')](function(_0x290cf7){var _0x4136c9=_(_0x290cf7)[_0xb687('0x28')]()[_0xb687('0x24')]('id')[_0xb687('0x29')]()[_0xb687('0x2a')]();return _0x4136c9;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3712cf,_0x192966,_0x392721){try{if(_0x192966[_0xb687('0xc')]>0x0){_0x3712cf=_0x3712cf[_0xb687('0x2b')](function(_0x173c58){return _0x192966['includes'](_0x173c58['id']);});}var _0x28b69a=_0x3712cf['filter'](function(_0x360429){var _0x40f35c=_0xb687('0x2c');if(isAgentIdle(_0x360429)){_0x40f35c=_0xb687('0xd');}return _0x40f35c===_0x392721;});return _[_0xb687('0x24')](_0x28b69a,'id');}catch(_0x43d20d){throw _0x43d20d;}}exports[_0xb687('0x2d')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x556815,_0x3da2be,_0xe3428f){return Promise[_0xb687('0x2e')]()[_0xb687('0x1a')](function(){if(_0x3da2be[_0xb687('0xc')]>0x0){_0x556815=_0x556815[_0xb687('0x2b')](function(_0x44be88){return _0x3da2be[_0xb687('0x2f')](_0x44be88['id']);});}return _0x556815;})[_0xb687('0x1a')](function(){return db[_0xb687('0x30')][_0xb687('0x31')]({'attributes':['id','name','fullname',_0xb687('0x5'),_0xb687('0x6'),_0xb687('0x7'),_0xb687('0x8'),'smsPause','voicePause',_0xb687('0x32'),_0xb687('0x33')],'where':{'id':{'$in':_['map'](_0x556815,'id')}},'raw':!![]});})[_0xb687('0x1a')](function(_0x449074){return _0x449074['map'](function(_0x387448){var _0x5c4964=_[_0xb687('0x34')](_0x556815,['id',_0x387448['id']]);var _0x24f34e=filterAgentAttributes(_0x5c4964);_[_0xb687('0x1e')](_0x387448,_0x24f34e);_0x387448[_0xb687('0x35')]=getAgentStatus(_0x387448);return _0x387448;});})[_0xb687('0x1a')](function(_0x28087e){var _0x5f59d0=sortAgentsByStatus(_0x28087e,_0xe3428f);return _[_0xb687('0x24')](_0x5f59d0,'id');})[_0xb687('0x36')](function(_0x2a73df){throw _0x2a73df;});}exports[_0xb687('0x37')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x58b246){var _0x43cd9f={'fields':[],'order':null};var _0x100f4a=_0x58b246[_0xb687('0x38')](',');_0x43cd9f[_0xb687('0x39')]=_[_0xb687('0x2b')](_0x100f4a,function(_0x58c214){if(!_0x58c214[_0xb687('0x2f')](_0xb687('0x35'))){return!![];}_0x43cd9f[_0xb687('0x3a')]=_[_0xb687('0x3b')](_0x58c214,'-')?_0xb687('0x3c'):_0xb687('0x3d');return![];});return _0x43cd9f;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x5ad577){if(!_0x5ad577){_0x5ad577=_0xb687('0x3e');}if(_0x5ad577['includes'](_0xb687('0x3f'))&&!_0x5ad577[_0xb687('0x2f')]('internal')){var _0x3e5fc6=_0x5ad577[_0xb687('0x40')](0x0,_0x5ad577['indexOf'](_0xb687('0x3f')));_0x5ad577+=','+_0x3e5fc6+_0xb687('0x41');}return _0x5ad577;}exports[_0xb687('0x42')]=validateSortParameter;function sortAgentsByStatus(_0x5253df,_0x66fabe){var _0x9cffb2=_0x5253df[_0xb687('0x43')](function(_0x75102a,_0x140388){if(_0x75102a[_0xb687('0x35')]===_0x140388[_0xb687('0x35')]){if(_0x75102a['globalStatus']===_0xb687('0x1f')){if(_0x66fabe==='DESC'){return(_0x75102a['pauseType']||'')<(_0x140388[_0xb687('0x33')]||'')||_0x75102a[_0xb687('0x3f')]['toLowerCase']()>_0x140388[_0xb687('0x3f')]['toLowerCase']()?0x1:-0x1;}else{return(_0x75102a[_0xb687('0x33')]||'')<(_0x140388[_0xb687('0x33')]||'')||_0x75102a['fullname'][_0xb687('0x44')]()>_0x140388[_0xb687('0x3f')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x66fabe===_0xb687('0x3c')){return _0x75102a[_0xb687('0x3f')][_0xb687('0x44')]()<_0x140388[_0xb687('0x3f')][_0xb687('0x44')]()?0x1:-0x1;}else{return _0x75102a[_0xb687('0x3f')][_0xb687('0x44')]()<_0x140388[_0xb687('0x3f')][_0xb687('0x44')]()?-0x1:0x1;}}}else{if(_0x66fabe===_0xb687('0x3c')){return _0x75102a[_0xb687('0x35')]<_0x140388[_0xb687('0x35')]?0x1:-0x1;}else{return _0x75102a['globalStatus']<_0x140388[_0xb687('0x35')]?-0x1:0x1;}}});return _0x9cffb2;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x3da453){var _0x1edb1a=[_0xb687('0x45'),_0xb687('0x46'),_0xb687('0x47'),_0xb687('0x48'),'pauseType','lastPauseAt',_0xb687('0x41'),_0xb687('0x49'),_0xb687('0x5'),_0xb687('0x8'),'mailPause',_0xb687('0x9'),_0xb687('0x32'),_0xb687('0x6'),_0xb687('0xa'),'chatCapacity',_0xb687('0x4a'),_0xb687('0x4b'),_0xb687('0x4c'),_0xb687('0x4d'),'faxCapacity','chatCurrentCapacity',_0xb687('0x4e'),_0xb687('0x4f'),_0xb687('0x50'),'whatsappCurrentCapacity','faxCurrentCapacity',_0xb687('0x13'),_0xb687('0x15'),_0xb687('0x51'),_0xb687('0x16'),_0xb687('0x17'),_0xb687('0x14'),_0xb687('0x12'),_0xb687('0x52'),'openchannelStatusTime',_0xb687('0x53'),_0xb687('0x54'),_0xb687('0x55'),'faxStatusTime','voiceStatusTime','queue','destconnectedlinenum',_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),_0xb687('0x59')];var _0x1ddfd4=[_0xb687('0x5'),_0xb687('0x8'),_0xb687('0x7'),_0xb687('0x9'),_0xb687('0x32'),_0xb687('0x6'),_0xb687('0xa'),_0xb687('0x46')];var _0xbffa37=_(_0x3da453)[_0xb687('0x5a')](_0x1ddfd4)[_0xb687('0x5b')](_0x1edb1a)[_0xb687('0x2a')]();return _0xbffa37;}exports['filterAgentAttributes']=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id','name',_0xb687('0x3f'),_0xb687('0x5c'),_0xb687('0x41'),_0xb687('0x46'),'globalStatus',_0xb687('0x45'),_0xb687('0x47'),'pauseType',_0xb687('0x48'),'faxPause',_0xb687('0x5'),_0xb687('0x7'),'openchannelPause','smsPause',_0xb687('0xa'),_0xb687('0x32'),'chatStatus',_0xb687('0x14'),_0xb687('0x51'),_0xb687('0x15'),'smsStatus',_0xb687('0x12'),'whatsappStatus',_0xb687('0x52'),_0xb687('0x5d'),_0xb687('0x53'),_0xb687('0x5e'),_0xb687('0x54'),'voiceStatusTime','whatsappStatusTime',_0xb687('0x5f'),'faxCapacity','mailCapacity','openchannelCapacity','smsCapacity',_0xb687('0x4d'),_0xb687('0x60'),_0xb687('0x61'),_0xb687('0x4f'),_0xb687('0x4e'),_0xb687('0x50'),_0xb687('0x62'),_0xb687('0x57'),_0xb687('0x58'),_0xb687('0x63'),_0xb687('0x64'),'queue','routealias',_0xb687('0x56')];}exports['getRealtimeAgentsQueryFields']=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index c4fccd9..32cc163 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33fd=['ringing','ringInUse','unavailable','unknown','pTalking','message','statusMessage','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','voice','request','startCase','then','error','format','result','catch','getRealtimeQueues','inbound','concat','get','loggedIn','talking','busy','outbound','find','merge','pick','initializeQueues','lodash','jayson/promise','client','http','available','paused','waiting','inUse','invalid','loggedInDb','notInUse','onHold'];(function(_0x2dc7d3,_0x371453){var _0x989910=function(_0x319b09){while(--_0x319b09){_0x2dc7d3['push'](_0x2dc7d3['shift']());}};_0x989910(++_0x371453);}(_0x33fd,0x93));var _0xd33f=function(_0x3e614e,_0x27fdbd){_0x3e614e=_0x3e614e-0x0;var _0x45fedd=_0x33fd[_0x3e614e];return _0x45fedd;};'use strict';var _=require(_0xd33f('0x0'));var jayson=require(_0xd33f('0x1'));var util=require('util');var amiClient=jayson[_0xd33f('0x2')][_0xd33f('0x3')]({'port':0x232a});var routingClient=jayson[_0xd33f('0x2')][_0xd33f('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xd33f('0x4'),'loggedIn',_0xd33f('0x5'),_0xd33f('0x6')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0xd33f('0x7'),_0xd33f('0x8'),_0xd33f('0x9'),_0xd33f('0xa'),_0xd33f('0xb'),_0xd33f('0xc'),_0xd33f('0xd'),'talking',_0xd33f('0xe'),_0xd33f('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xd33f('0x10'),'originated',_0xd33f('0x11'),_0xd33f('0x12'),_0xd33f('0x13'),_0xd33f('0x14'),_0xd33f('0x15'),'startPredictive',_0xd33f('0x16'),_0xd33f('0x17'),_0xd33f('0x18'),'erlangAbandonmentRate',_0xd33f('0x19'),'dialPredictiveInterval',_0xd33f('0x1a'),_0xd33f('0x1b'),_0xd33f('0x1c'),'predictiveIntervalTotalCalls',_0xd33f('0x1d'),_0xd33f('0x1e'),_0xd33f('0x1f'),'predictiveIntervalAvgHoldtime',_0xd33f('0x20')];function getRealtimeQueues(_0x5c13ce,_0x49399d){var _0x28abb5=_0x49399d===_0xd33f('0x21')?amiClient:routingClient;return _0x28abb5[_0xd33f('0x22')](_[_0xd33f('0x23')](_0x49399d)+'Queues',_0x5c13ce)[_0xd33f('0x24')](function(_0x11dc5b){if(_0x11dc5b[_0xd33f('0x25')])throw new Error(util[_0xd33f('0x26')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x49399d));return _0x11dc5b[_0xd33f('0x27')];})[_0xd33f('0x28')](function(_0x35fada){throw _0x35fada;});}exports[_0xd33f('0x29')]=getRealtimeQueues;function initializeQueues(_0x2c6a7d,_0x50e431,_0xf1c99d,_0xdf9646){var _0x902165=DEFAULT_QUEUE_ATTRIBUTES;if(_0xf1c99d===_0xd33f('0x21')){if(_0xdf9646===_0xd33f('0x2a')){_0x902165=_0x902165[_0xd33f('0x2b')](VOICE_QUEUE_ATTRIBUTES);}else if(_0xdf9646==='outbound'){_0x902165=_0x902165[_0xd33f('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x2c6a7d['map'](function(_0x205fa5){var _0x190e32=_0x205fa5[_0xd33f('0x2c')]({'plain':!![]});_0x190e32[_0xd33f('0x5')]=0x0;_0x190e32[_0xd33f('0x9')]=0x0;_0x190e32[_0xd33f('0x2d')]=0x0;_0x190e32[_0xd33f('0x4')]=0x0;_0x190e32[_0xd33f('0x6')]=0x0;if(_0xf1c99d==='voice'){_0x190e32[_0xd33f('0x2e')]=0x0;_0x190e32[_0xd33f('0x2f')]=0x0;if(_0xdf9646===_0xd33f('0x30')){_0x190e32[_0xd33f('0x10')]=0x0;_0x190e32['originated']=0x0;}}var _0x58117a=_[_0xd33f('0x31')](_0x50e431,['id',_0x190e32['id']]);if(_0x58117a){_[_0xd33f('0x32')](_0x190e32,_[_0xd33f('0x33')](_0x58117a,_0x902165));}return _0x190e32;});}exports[_0xd33f('0x34')]=initializeQueues; \ No newline at end of file +var _0xefe4=['inbound','concat','map','outbound','originated','pick','initializeQueues','lodash','client','http','available','loggedIn','paused','busy','inUse','invalid','loggedInDb','notInUse','ringInUse','talking','unavailable','unknown','pTalking','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','voice','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','getRealtimeQueues'];(function(_0x1cfca7,_0x462449){var _0x2f6329=function(_0x51543c){while(--_0x51543c){_0x1cfca7['push'](_0x1cfca7['shift']());}};_0x2f6329(++_0x462449);}(_0xefe4,0xa0));var _0x4efe=function(_0x12093c,_0x5919af){_0x12093c=_0x12093c-0x0;var _0x514cbb=_0xefe4[_0x12093c];return _0x514cbb;};'use strict';var _=require(_0x4efe('0x0'));var jayson=require('jayson/promise');var util=require('util');var amiClient=jayson[_0x4efe('0x1')][_0x4efe('0x2')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x4efe('0x3'),_0x4efe('0x4'),_0x4efe('0x5'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0x4efe('0x6'),_0x4efe('0x7'),_0x4efe('0x8'),_0x4efe('0x9'),_0x4efe('0xa'),'onHold','ringing',_0x4efe('0xb'),_0x4efe('0xc'),_0x4efe('0xd'),_0x4efe('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x4efe('0xf'),'originated',_0x4efe('0x10'),_0x4efe('0x11'),_0x4efe('0x12'),_0x4efe('0x13'),_0x4efe('0x14'),_0x4efe('0x15'),_0x4efe('0x16'),_0x4efe('0x17'),_0x4efe('0x18'),_0x4efe('0x19'),_0x4efe('0x1a'),_0x4efe('0x1b'),_0x4efe('0x1c'),_0x4efe('0x1d'),_0x4efe('0x1e'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0x4efe('0x1f'),_0x4efe('0x20'),_0x4efe('0x21'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x3c5597,_0x1ef2f5){var _0x13eb68=_0x1ef2f5===_0x4efe('0x22')?amiClient:routingClient;return _0x13eb68[_0x4efe('0x23')](_[_0x4efe('0x24')](_0x1ef2f5)+_0x4efe('0x25'),_0x3c5597)[_0x4efe('0x26')](function(_0x25bd9f){if(_0x25bd9f[_0x4efe('0x27')])throw new Error(util[_0x4efe('0x28')](_0x4efe('0x29'),_0x1ef2f5));return _0x25bd9f['result'];})[_0x4efe('0x2a')](function(_0x40e19c){throw _0x40e19c;});}exports[_0x4efe('0x2b')]=getRealtimeQueues;function initializeQueues(_0x563cfc,_0x31d5cd,_0x51999d,_0x432cb8){var _0x55dbc1=DEFAULT_QUEUE_ATTRIBUTES;if(_0x51999d==='voice'){if(_0x432cb8===_0x4efe('0x2c')){_0x55dbc1=_0x55dbc1[_0x4efe('0x2d')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x432cb8==='outbound'){_0x55dbc1=_0x55dbc1[_0x4efe('0x2d')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x563cfc[_0x4efe('0x2e')](function(_0x2b768d){var _0xce899d=_0x2b768d['get']({'plain':!![]});_0xce899d[_0x4efe('0x5')]=0x0;_0xce899d[_0x4efe('0x9')]=0x0;_0xce899d[_0x4efe('0x4')]=0x0;_0xce899d[_0x4efe('0x3')]=0x0;_0xce899d['waiting']=0x0;if(_0x51999d===_0x4efe('0x22')){_0xce899d[_0x4efe('0xc')]=0x0;_0xce899d[_0x4efe('0x6')]=0x0;if(_0x432cb8===_0x4efe('0x2f')){_0xce899d[_0x4efe('0xf')]=0x0;_0xce899d[_0x4efe('0x30')]=0x0;}}var _0x42fe15=_['find'](_0x31d5cd,['id',_0xce899d['id']]);if(_0x42fe15){_['merge'](_0xce899d,_[_0x4efe('0x31')](_0x42fe15,_0x55dbc1));}return _0xce899d;});}exports[_0x4efe('0x32')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 8ca4d75..5a0513a 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x2e6516,_0x125bc3){var _0xafbb16=function(_0x4a7a03){while(--_0x4a7a03){_0x2e6516['push'](_0x2e6516['shift']());}};_0xafbb16(++_0x125bc3);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x3ccc44,_0x207b0c){var _0x5d74bb=function(_0x59989a){while(--_0x59989a){_0x3ccc44['push'](_0x3ccc44['shift']());}};_0x5d74bb(++_0x207b0c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 91e351a..a757eff 100644 --- a/server/config/license/hardware.js +++ b/server/config/license/hardware.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2663=['concat','head','mac','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','join','createHash','update','digest','hex','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','md5','substring','lodash','execSync','../environment','networkInterfaces','keys','filter','family','IPv4','internal'];(function(_0x3adc72,_0x4fb254){var _0x182b64=function(_0x5c6e6b){while(--_0x5c6e6b){_0x3adc72['push'](_0x3adc72['shift']());}};_0x182b64(++_0x4fb254);}(_0x2663,0xe5));var _0x3266=function(_0x4145a8,_0x55e817){_0x4145a8=_0x4145a8-0x0;var _0x155db0=_0x2663[_0x4145a8];return _0x155db0;};'use strict';var _=require(_0x3266('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0x3266('0x1')];var config=require(_0x3266('0x2'));function getInterfaces(){var _0x389969=[];var _0x1756a1=os[_0x3266('0x3')]();var _0xc9ad01=_['orderBy'](_[_0x3266('0x4')](_0x1756a1));for(var _0x16f59d=0x0;_0x16f59d<_0xc9ad01['length'];_0x16f59d++){var _0xc88151=_0x1756a1[_0xc9ad01[_0x16f59d]][_0x3266('0x5')](function(_0x4bbd9e){return _0x4bbd9e[_0x3266('0x6')]===_0x3266('0x7')&&_0x4bbd9e[_0x3266('0x8')]===![];});_0x389969=_0x389969[_0x3266('0x9')](_0xc88151);}return _0x389969;}function getFirstInterface(){var _0x57222f=_[_0x3266('0xa')](getInterfaces());return{'macAddress':_0x57222f&&_0x57222f[_0x3266('0xb')]?_0x57222f[_0x3266('0xb')]:'00:00:00:00:00:00','ipAddress':_0x57222f&&_0x57222f[_0x3266('0xc')]?_0x57222f[_0x3266('0xc')]:_0x3266('0xd')};}exports[_0x3266('0xe')]=getFirstInterface;function getCPUhash(){var _0x699b73=_[_0x3266('0xf')](os[_0x3266('0x10')]()[_0x3266('0x11')](function(_0x5b845c){return _0x5b845c[_0x3266('0x12')];}))[_0x3266('0x13')](':');return crypto[_0x3266('0x14')]('md5')[_0x3266('0x15')](_0x699b73)[_0x3266('0x16')](_0x3266('0x17'));}exports['getUuid']=function(){var _0x39ed82=os[_0x3266('0x18')]();var _0xcf9d97=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0xcf9d97[_0x3266('0x19')](config[_0x3266('0x1a')])){return config[_0x3266('0x1a')];}else if(_0x39ed82===_0x3266('0x1b')){return exec(_0x3266('0x1c'),{'encoding':_0x3266('0x1d')})[_0x3266('0x1e')]('\x0d\x0a','');}else{var _0x5af416=getFirstInterface();var _0x4c9f74=getCPUhash();var _0x57cd58=_0x4c9f74+'|'+os[_0x3266('0x1f')]()+'|'+_0x5af416['macAddress']+'|'+_0x5af416['ipAddress'];var _0x4857fc=crypto[_0x3266('0x14')](_0x3266('0x20'))[_0x3266('0x15')](_0x57cd58)[_0x3266('0x16')](_0x3266('0x17'));return _0x4857fc[_0x3266('0x21')](0x0,0x8)+'-'+_0x4857fc['substring'](0x8,0xc)+'-'+_0x4857fc['substring'](0xc,0x10)+'-'+_0x4857fc[_0x3266('0x21')](0x10,0x14)+'-'+_0x4857fc[_0x3266('0x21')](0x14);}}; \ No newline at end of file +var _0xa24c=['createHash','md5','update','platform','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','digest','hex','substring','lodash','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','keys','length','filter','family','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','orderBy','map','model'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xa24c,0x1bb));var _0xca24=function(_0x3e4566,_0x378e21){_0x3e4566=_0x3e4566-0x0;var _0x29c854=_0xa24c[_0x3e4566];return _0x29c854;};'use strict';var _=require(_0xca24('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xca24('0x1'));var exec=require(_0xca24('0x2'))[_0xca24('0x3')];var config=require(_0xca24('0x4'));function getInterfaces(){var _0x3daa9f=[];var _0x5e7d5c=os[_0xca24('0x5')]();var _0x3fa581=_['orderBy'](_[_0xca24('0x6')](_0x5e7d5c));for(var _0xf8e3cc=0x0;_0xf8e3cc<_0x3fa581[_0xca24('0x7')];_0xf8e3cc++){var _0x17e6f6=_0x5e7d5c[_0x3fa581[_0xf8e3cc]][_0xca24('0x8')](function(_0x4eacb3){return _0x4eacb3[_0xca24('0x9')]==='IPv4'&&_0x4eacb3[_0xca24('0xa')]===![];});_0x3daa9f=_0x3daa9f['concat'](_0x17e6f6);}return _0x3daa9f;}function getFirstInterface(){var _0x9e1c5=_[_0xca24('0xb')](getInterfaces());return{'macAddress':_0x9e1c5&&_0x9e1c5[_0xca24('0xc')]?_0x9e1c5['mac']:_0xca24('0xd'),'ipAddress':_0x9e1c5&&_0x9e1c5[_0xca24('0xe')]?_0x9e1c5['address']:_0xca24('0xf')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x594037=_[_0xca24('0x10')](os['cpus']()[_0xca24('0x11')](function(_0x44184e){return _0x44184e[_0xca24('0x12')];}))['join'](':');return crypto[_0xca24('0x13')](_0xca24('0x14'))[_0xca24('0x15')](_0x594037)['digest']('hex');}exports['getUuid']=function(){var _0x18fe4c=os[_0xca24('0x16')]();var _0x7d2fea=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x7d2fea[_0xca24('0x17')](config['licenseToken'])){return config['licenseToken'];}else if(_0x18fe4c===_0xca24('0x18')){return exec(_0xca24('0x19'),{'encoding':_0xca24('0x1a')})[_0xca24('0x1b')]('\x0d\x0a','');}else{var _0x5e8a0e=getFirstInterface();var _0x3d8b9e=getCPUhash();var _0x56a82f=_0x3d8b9e+'|'+os[_0xca24('0x1c')]()+'|'+_0x5e8a0e['macAddress']+'|'+_0x5e8a0e[_0xca24('0x1d')];var _0x53fbe9=crypto['createHash'](_0xca24('0x14'))['update'](_0x56a82f)[_0xca24('0x1e')](_0xca24('0x1f'));return _0x53fbe9[_0xca24('0x20')](0x0,0x8)+'-'+_0x53fbe9[_0xca24('0x20')](0x8,0xc)+'-'+_0x53fbe9[_0xca24('0x20')](0xc,0x10)+'-'+_0x53fbe9['substring'](0x10,0x14)+'-'+_0x53fbe9[_0xca24('0x20')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 244e13e..e956b1e 100644 --- a/server/config/license/index.js +++ b/server/config/license/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3e0=['finally','License','findOrCreate','spread','catch','default','util','request-promise','bluebird','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','version','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','data1','data2','then','active','info','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message'];(function(_0x129479,_0x256c7e){var _0x3fa0ce=function(_0x35401f){while(--_0x35401f){_0x129479['push'](_0x129479['shift']());}};_0x3fa0ce(++_0x256c7e);}(_0xc3e0,0xea));var _0x0c3e=function(_0x6fa996,_0x3dfa10){_0x6fa996=_0x6fa996-0x0;var _0x448be7=_0xc3e0[_0x6fa996];return _0x448be7;};'use strict';var util=require(_0x0c3e('0x0'));var moment=require('moment');var rp=require(_0x0c3e('0x1'));var BPromise=require(_0x0c3e('0x2'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0x0c3e('0x3'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x0c3e('0x4'));var logger=require(_0x0c3e('0x5'))(_0x0c3e('0x6'));var HOST=_0x0c3e('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1bad39){return new BPromise(function(_0x3b51bc,_0x279da0){var _0x502f61=util['format'](_0x0c3e('0x8'),HOST,_0x1bad39,module[_0x0c3e('0x9')][_0x0c3e('0xa')]);if(oldToken){_0x502f61=util[_0x0c3e('0xb')](_0x0c3e('0xc'),HOST,_0x1bad39,module[_0x0c3e('0x9')][_0x0c3e('0xa')],oldToken);}var _0xf38aa3={'uri':_0x502f61,'method':_0x0c3e('0xd'),'timeout':0xea60,'json':!![]};return rp(_0xf38aa3)['then'](function(_0xd6f4e0){_0x3b51bc(_0xd6f4e0);})['catch'](function(_0x1413f2){_0x279da0(_0x1413f2);});});}function manageLicense(_0x221e35,_0x1effec){var _0x13df61=_0x1effec['get']({'plain':!![]});if(!isOldTokenSent&&_0x13df61[_0x0c3e('0xe')]!==_0x221e35&&!_0x13df61[_0x0c3e('0xf')]){oldToken=_0x13df61[_0x0c3e('0xe')];}httpRequest(_0x221e35)[_0x0c3e('0x10')](function(_0x1c3e6e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1c3e6e[_0x0c3e('0x11')]){isOldTokenSent=![];if(!_0x13df61[_0x0c3e('0x6')]&&_0x13df61['license']!=_0x1c3e6e['license']||_0x13df61[_0x0c3e('0x6')]&&_0x13df61[_0x0c3e('0xf')]){logger[_0x0c3e('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x13df61['license']&&!_0x13df61[_0x0c3e('0xf')]&&_0x13df61['license']!=_0x1c3e6e[_0x0c3e('0x6')]){logger[_0x0c3e('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x13df61[_0x0c3e('0x6')]&&!_0x13df61[_0x0c3e('0xf')]&&_0x13df61[_0x0c3e('0x6')]==_0x1c3e6e[_0x0c3e('0x6')]){return _0x1effec;}return _0x1effec[_0x0c3e('0x13')]({'data1':_0x221e35,'data2':null,'license':_0x1c3e6e['license']});}else{if(_0x1c3e6e['license']||_0x13df61['license']){if(!_0x13df61[_0x0c3e('0xf')]){if(_0x13df61['data1']==_0x221e35){GRAY_PERIOD_REASON=_0x0c3e('0x14');logger[_0x0c3e('0x12')](_0x0c3e('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger['info'](_0x0c3e('0x16'),_0x13df61[_0x0c3e('0xe')],_0x221e35);}logger[_0x0c3e('0x12')](_0x0c3e('0x17'),GRAY_PERIOD_REASON[_0x0c3e('0x18')](),moment()[_0x0c3e('0xb')](_0x0c3e('0x19')));return _0x1effec[_0x0c3e('0x13')]({'data2':encryptor['encryptString'](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x0c3e('0x1a')](encryptor[_0x0c3e('0x1b')](_0x13df61[_0x0c3e('0xf')]),_0x0c3e('0x1c'))>DAYS){logger['info'](_0x0c3e('0x1d'),moment()[_0x0c3e('0xb')](_0x0c3e('0x19')));isOldTokenSent=![];return _0x1effec[_0x0c3e('0x13')]({'data1':_0x221e35,'data2':null,'license':null});}}}else{if(_0x13df61[_0x0c3e('0xe')]!=_0x221e35){logger['info'](_0x0c3e('0x16'),_0x13df61[_0x0c3e('0xe')],_0x221e35);return _0x1effec['update']({'data1':_0x221e35,'data2':null,'license':null});}}}return _0x1effec;})[_0x0c3e('0x10')](function(_0x3a2aff){_0x1effec=_0x3a2aff;})['catch'](function(_0x1dd5b9){logger[_0x0c3e('0x1e')](_0x1dd5b9[_0x0c3e('0x1f')]);})[_0x0c3e('0x20')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x1effec);},TIME);});}function defaultLicense(){var _0x4b4496=hardware['getUuid']();if(_0x4b4496){return db[_0x0c3e('0x21')][_0x0c3e('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x4b4496}})[_0x0c3e('0x23')](function(_0x407331,_0x4ad28c){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x4b4496);manageLicense(_0x4b4496,_0x407331);})[_0x0c3e('0x24')](function(_0x4d0ae8){logger[_0x0c3e('0x1e')](_0x4d0ae8[_0x0c3e('0x1f')]);});}}exports[_0x0c3e('0x25')]=defaultLicense; \ No newline at end of file +var _0xb003=['update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','format','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','moment','request-promise','pkginfo','version','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','catch','data2','data1','then','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED'];(function(_0x144b4f,_0x34069c){var _0x5f5978=function(_0x3ecd67){while(--_0x3ecd67){_0x144b4f['push'](_0x144b4f['shift']());}};_0x5f5978(++_0x34069c);}(_0xb003,0xbf));var _0x3b00=function(_0x527ce8,_0x122695){_0x527ce8=_0x527ce8-0x0;var _0x2a8a56=_0xb003[_0x527ce8];return _0x2a8a56;};'use strict';var util=require(_0x3b00('0x0'));var moment=require(_0x3b00('0x1'));var rp=require(_0x3b00('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x3b00('0x3'))(module,_0x3b00('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x3b00('0x5'));var logger=require(_0x3b00('0x6'))(_0x3b00('0x7'));var HOST=_0x3b00('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1f48eb){return new BPromise(function(_0x302807,_0x47c8c6){var _0x4d6696=util['format'](_0x3b00('0x9'),HOST,_0x1f48eb,module[_0x3b00('0xa')][_0x3b00('0x4')]);if(oldToken){_0x4d6696=util['format'](_0x3b00('0xb'),HOST,_0x1f48eb,module['exports'][_0x3b00('0x4')],oldToken);}var _0x8c4e91={'uri':_0x4d6696,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x8c4e91)['then'](function(_0x218ba2){_0x302807(_0x218ba2);})[_0x3b00('0xc')](function(_0x14660a){_0x47c8c6(_0x14660a);});});}function manageLicense(_0x954b2c,_0x559a02){var _0x344956=_0x559a02['get']({'plain':!![]});if(!isOldTokenSent&&_0x344956['data1']!==_0x954b2c&&!_0x344956[_0x3b00('0xd')]){oldToken=_0x344956[_0x3b00('0xe')];}httpRequest(_0x954b2c)[_0x3b00('0xf')](function(_0x143597){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x143597['active']){isOldTokenSent=![];if(!_0x344956[_0x3b00('0x7')]&&_0x344956[_0x3b00('0x7')]!=_0x143597[_0x3b00('0x7')]||_0x344956[_0x3b00('0x7')]&&_0x344956[_0x3b00('0xd')]){logger[_0x3b00('0x10')](_0x3b00('0x11'));}if(_0x344956[_0x3b00('0x7')]&&!_0x344956['data2']&&_0x344956[_0x3b00('0x7')]!=_0x143597[_0x3b00('0x7')]){logger[_0x3b00('0x10')](_0x3b00('0x12'));}if(_0x344956[_0x3b00('0x7')]&&!_0x344956[_0x3b00('0xd')]&&_0x344956[_0x3b00('0x7')]==_0x143597[_0x3b00('0x7')]){return _0x559a02;}return _0x559a02[_0x3b00('0x13')]({'data1':_0x954b2c,'data2':null,'license':_0x143597[_0x3b00('0x7')]});}else{if(_0x143597['license']||_0x344956[_0x3b00('0x7')]){if(!_0x344956[_0x3b00('0xd')]){if(_0x344956[_0x3b00('0xe')]==_0x954b2c){GRAY_PERIOD_REASON=_0x3b00('0x14');logger['info'](_0x3b00('0x15'));}else{GRAY_PERIOD_REASON=_0x3b00('0x16');logger['info'](_0x3b00('0x17'),_0x344956[_0x3b00('0xe')],_0x954b2c);}logger[_0x3b00('0x10')](_0x3b00('0x18'),GRAY_PERIOD_REASON[_0x3b00('0x19')](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x559a02['update']({'data2':encryptor[_0x3b00('0x1a')](moment()[_0x3b00('0x1b')](_0x3b00('0x1c')))});}else{if(moment()[_0x3b00('0x1d')](encryptor[_0x3b00('0x1e')](_0x344956[_0x3b00('0xd')]),_0x3b00('0x1f'))>DAYS){logger['info'](_0x3b00('0x20'),moment()[_0x3b00('0x1b')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x559a02[_0x3b00('0x13')]({'data1':_0x954b2c,'data2':null,'license':null});}}}else{if(_0x344956['data1']!=_0x954b2c){logger[_0x3b00('0x10')](_0x3b00('0x17'),_0x344956[_0x3b00('0xe')],_0x954b2c);return _0x559a02[_0x3b00('0x13')]({'data1':_0x954b2c,'data2':null,'license':null});}}}return _0x559a02;})['then'](function(_0x15f593){_0x559a02=_0x15f593;})[_0x3b00('0xc')](function(_0x5131a8){logger['error'](_0x5131a8[_0x3b00('0x21')]);})[_0x3b00('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x3b00('0x23')](),_0x559a02);},TIME);});}function defaultLicense(){var _0x204147=hardware['getUuid']();if(_0x204147){return db[_0x3b00('0x24')][_0x3b00('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x204147}})[_0x3b00('0x26')](function(_0x16a619,_0x195d68){logger[_0x3b00('0x10')](_0x3b00('0x27'),_0x204147);manageLicense(_0x204147,_0x16a619);})['catch'](function(_0x1af9df){logger[_0x3b00('0x28')](_0x1af9df[_0x3b00('0x21')]);});}}exports[_0x3b00('0x29')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 9d95f14..f710f9c 100644 --- a/server/config/license/util.js +++ b/server/config/license/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19cf=['forEach','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','demo','machineUuid','deadline','add','days','changed','disabled','message','User','findAll','role','sequelize','COUNT','col','count','admin','user','telephones'];(function(_0x5026f2,_0x3e87b4){var _0x2414b6=function(_0x167f6a){while(--_0x167f6a){_0x5026f2['push'](_0x5026f2['shift']());}};_0x2414b6(++_0x3e87b4);}(_0x19cf,0x17d));var _0xf19c=function(_0x5ed887,_0x361216){_0x5ed887=_0x5ed887-0x0;var _0x2ad599=_0x19cf[_0x5ed887];return _0x2ad599;};'use strict';var util=require(_0xf19c('0x0'));var _=require(_0xf19c('0x1'));var moment=require('moment');var BPromise=require(_0xf19c('0x2'));var hardware=require(_0xf19c('0x3'));var encryptor=require(_0xf19c('0x4'));var db=require(_0xf19c('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xf19c('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xf19c('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xf19c('0x8'),'machineUuid':hardware[_0xf19c('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1a575f){return new BPromise(function(_0x5a9756,_0x30541e){return db[_0xf19c('0x9')][_0xf19c('0xa')](_[_0xf19c('0xb')](_0x1a575f,{'raw':!![],'where':{'id':0x1}}))[_0xf19c('0xc')](function(_0x59c3bf){return checkLicense(_0x59c3bf,null);})[_0xf19c('0xc')](function(_0x51d886){_0x5a9756(_0x51d886);return;})[_0xf19c('0xd')](function(_0x451d87){_0x30541e(_0x451d87);});});}function checkLicense(_0x5d3dc9,_0x270e04){if(!_0x5d3dc9){demoLicense[_0xf19c('0xe')]=_0x5d3dc9[_0xf19c('0xf')];return demoLicense;}try{var _0x14a546=_0x270e04||_0x5d3dc9[_0xf19c('0x10')];if(_[_0xf19c('0x11')](_0x14a546)){throw new Error(_0xf19c('0x12'));}var _0x442615=_0x5d3dc9[_0xf19c('0xf')];var _0x58c286=_0x5d3dc9[_0xf19c('0x13')];var _0x45e8b9=_0x442615[_0xf19c('0x14')]('-')[0x4];var _0x333201=_0x442615[_0xf19c('0x14')]('-')[0x0];var _0x5f3627=encryptor[_0xf19c('0x15')](_0x14a546,util[_0xf19c('0x16')]('%s:%s:%s',_0x45e8b9,_0x442615,_0x333201));var _0x4a4f5b=JSON[_0xf19c('0x17')](_0x5f3627);_0x4a4f5b[_0xf19c('0x18')]=![];_0x4a4f5b[_0xf19c('0xe')]=_0x442615;_0x4a4f5b[_0xf19c('0x19')]=hardware[_0xf19c('0x7')]();if(_0x58c286){var _0x15fbfa=encryptor['decryptString'](_0x58c286);_0x4a4f5b['gray']=_0x15fbfa;_0x4a4f5b[_0xf19c('0x1a')]=moment(_0x15fbfa)[_0xf19c('0x1b')](0x7,_0xf19c('0x1c'))[_0xf19c('0x16')]();_0x4a4f5b['grayReason']=_0x4a4f5b[_0xf19c('0xe')]!=_0x4a4f5b[_0xf19c('0x19')]?_0xf19c('0x1d'):_0xf19c('0x1e');}return _0x4a4f5b;}catch(_0x1a5b98){breakingLicense[_0xf19c('0xe')]=_0x5d3dc9[_0xf19c('0xf')];breakingLicense[_0xf19c('0x1f')]=_0x1a5b98[_0xf19c('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x13cc0d,_0x882f65){getLicense()[_0xf19c('0xc')](function(_0x12a367){return db[_0xf19c('0x20')][_0xf19c('0x21')]({'attributes':[_0xf19c('0x22'),[db[_0xf19c('0x23')]['fn'](_0xf19c('0x24'),db[_0xf19c('0x23')][_0xf19c('0x25')]('role')),_0xf19c('0x26')]],'group':_0xf19c('0x22'),'where':{'role':{'$or':[_0xf19c('0x27'),_0xf19c('0x28'),'telephone']}},'raw':!![]})['then'](function(_0x52f523){var _0x180f82={'user':_0x12a367['users']||0x0,'telephone':_0x12a367[_0xf19c('0x29')]||0x0};_0x52f523[_0xf19c('0x2a')](function(_0x1c148b){var _0x350bbb=_0x1c148b[_0xf19c('0x22')]===_0xf19c('0x27')?_0xf19c('0x28'):_0x1c148b[_0xf19c('0x22')];_0x180f82[_0x350bbb]-=_0x1c148b[_0xf19c('0x26')];if(_0x180f82[_0x350bbb]<0x0)_0x180f82[_0x350bbb]=0x0;});_0x13cc0d(_0x180f82);return;});})[_0xf19c('0xd')](function(_0x3ffff6){_0x882f65(_0x3ffff6);});});}function checkUserLimits(_0x3d0737){return new BPromise(function(_0x5da6aa,_0x437e8a){getLimits()[_0xf19c('0xc')](function(_0x4953d2){var _0x2b590c=_['pick'](_[_0xf19c('0x2b')](_0x3d0737,_0xf19c('0x22')),['admin',_0xf19c('0x28'),_0xf19c('0x2c')]);var _0x5780f1=(_0x2b590c['admin']||0x0)+(_0x2b590c[_0xf19c('0x28')]||0x0);var _0x10ec4a=_0x2b590c[_0xf19c('0x2c')]||0x0;if(_0x5780f1>_0x4953d2[_0xf19c('0x28')])return _0x437e8a(_0xf19c('0x2d'));if(_0x10ec4a>_0x4953d2[_0xf19c('0x2c')])return _0x437e8a(_0xf19c('0x2e'));return _0x5da6aa();})[_0xf19c('0xd')](function(_0x4d9cdd){_0x437e8a(_0x4d9cdd);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xbfb6=['message','User','role','sequelize','col','count','admin','users','telephones','user','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird','../../components/encryptor','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','grayReason','changed','disabled'];(function(_0x628eee,_0x3f3fba){var _0x447718=function(_0x38112b){while(--_0x38112b){_0x628eee['push'](_0x628eee['shift']());}};_0x447718(++_0x3f3fba);}(_0xbfb6,0x100));var _0x6bfb=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xbfb6[_0x59ee6f];return _0x4c0979;};'use strict';var util=require(_0x6bfb('0x0'));var _=require('lodash');var moment=require(_0x6bfb('0x1'));var BPromise=require(_0x6bfb('0x2'));var hardware=require('./hardware');var encryptor=require(_0x6bfb('0x3'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x6bfb('0x4'),'machineUuid':hardware[_0x6bfb('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6bfb('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x6bfb('0x7'),'machineUuid':hardware[_0x6bfb('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5d7593){return new BPromise(function(_0x1c06b6,_0x4a930d){return db[_0x6bfb('0x8')]['find'](_[_0x6bfb('0x9')](_0x5d7593,{'raw':!![],'where':{'id':0x1}}))[_0x6bfb('0xa')](function(_0x1955ca){return checkLicense(_0x1955ca,null);})[_0x6bfb('0xa')](function(_0x335db7){_0x1c06b6(_0x335db7);return;})[_0x6bfb('0xb')](function(_0x5b1a36){_0x4a930d(_0x5b1a36);});});}function checkLicense(_0x101e72,_0x2b79cd){if(!_0x101e72){demoLicense[_0x6bfb('0xc')]=_0x101e72[_0x6bfb('0xd')];return demoLicense;}try{var _0x33f857=_0x2b79cd||_0x101e72[_0x6bfb('0xe')];if(_[_0x6bfb('0xf')](_0x33f857)){throw new Error(_0x6bfb('0x10'));}var _0x2d53ec=_0x101e72[_0x6bfb('0xd')];var _0x5476b4=_0x101e72[_0x6bfb('0x11')];var _0xa12e3=_0x2d53ec[_0x6bfb('0x12')]('-')[0x4];var _0x1aa085=_0x2d53ec[_0x6bfb('0x12')]('-')[0x0];var _0x16dbd8=encryptor[_0x6bfb('0x13')](_0x33f857,util[_0x6bfb('0x14')](_0x6bfb('0x15'),_0xa12e3,_0x2d53ec,_0x1aa085));var _0xadb0dd=JSON[_0x6bfb('0x16')](_0x16dbd8);_0xadb0dd[_0x6bfb('0x17')]=![];_0xadb0dd[_0x6bfb('0xc')]=_0x2d53ec;_0xadb0dd[_0x6bfb('0x18')]=hardware[_0x6bfb('0x5')]();if(_0x5476b4){var _0x2092fa=encryptor[_0x6bfb('0x13')](_0x5476b4);_0xadb0dd[_0x6bfb('0x19')]=_0x2092fa;_0xadb0dd[_0x6bfb('0x1a')]=moment(_0x2092fa)[_0x6bfb('0x1b')](0x7,_0x6bfb('0x1c'))[_0x6bfb('0x14')]();_0xadb0dd[_0x6bfb('0x1d')]=_0xadb0dd[_0x6bfb('0xc')]!=_0xadb0dd[_0x6bfb('0x18')]?_0x6bfb('0x1e'):_0x6bfb('0x1f');}return _0xadb0dd;}catch(_0x41366b){breakingLicense[_0x6bfb('0xc')]=_0x101e72['data1'];breakingLicense[_0x6bfb('0x20')]=_0x41366b[_0x6bfb('0x20')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x54dd50,_0x47f7ef){getLicense()[_0x6bfb('0xa')](function(_0x106308){return db[_0x6bfb('0x21')]['findAll']({'attributes':[_0x6bfb('0x22'),[db[_0x6bfb('0x23')]['fn']('COUNT',db['sequelize'][_0x6bfb('0x24')](_0x6bfb('0x22'))),_0x6bfb('0x25')]],'group':_0x6bfb('0x22'),'where':{'role':{'$or':[_0x6bfb('0x26'),'user','telephone']}},'raw':!![]})[_0x6bfb('0xa')](function(_0x191fff){var _0x227d92={'user':_0x106308[_0x6bfb('0x27')]||0x0,'telephone':_0x106308[_0x6bfb('0x28')]||0x0};_0x191fff['forEach'](function(_0x17d325){var _0x45ce95=_0x17d325['role']==='admin'?_0x6bfb('0x29'):_0x17d325[_0x6bfb('0x22')];_0x227d92[_0x45ce95]-=_0x17d325[_0x6bfb('0x25')];if(_0x227d92[_0x45ce95]<0x0)_0x227d92[_0x45ce95]=0x0;});_0x54dd50(_0x227d92);return;});})[_0x6bfb('0xb')](function(_0x4e48e7){_0x47f7ef(_0x4e48e7);});});}function checkUserLimits(_0x4afa00){return new BPromise(function(_0x164ea8,_0x1b64e8){getLimits()['then'](function(_0x19fc23){var _0x4057c0=_[_0x6bfb('0x2a')](_[_0x6bfb('0x2b')](_0x4afa00,_0x6bfb('0x22')),[_0x6bfb('0x26'),'user',_0x6bfb('0x2c')]);var _0x34f17b=(_0x4057c0[_0x6bfb('0x26')]||0x0)+(_0x4057c0[_0x6bfb('0x29')]||0x0);var _0x1e7cee=_0x4057c0[_0x6bfb('0x2c')]||0x0;if(_0x34f17b>_0x19fc23['user'])return _0x1b64e8(_0x6bfb('0x2d'));if(_0x1e7cee>_0x19fc23[_0x6bfb('0x2c')])return _0x1b64e8(_0x6bfb('0x2e'));return _0x164ea8();})[_0x6bfb('0xb')](function(_0x514f8c){_0x1b64e8(_0x514f8c);});});}module[_0x6bfb('0x2f')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index ed3596c..8dcd7f5 100644 --- a/server/config/local.env.js +++ b/server/config/local.env.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb11=['exports','myappanuglar-secret','app-id'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xfb11[_0x4bfac3];return _0x15f0f2;};'use strict';module[_0x1fb1('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x1fb1('0x1'),'GOOGLE_ID':_0x1fb1('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0xb44a=['myappanuglar-secret','secret'];(function(_0x3fa59c,_0x2302f9){var _0x239a2c=function(_0x410d0f){while(--_0x410d0f){_0x3fa59c['push'](_0x3fa59c['shift']());}};_0x239a2c(++_0x2302f9);}(_0xb44a,0x1c2));var _0xab44=function(_0x38e870,_0x3d2e6a){_0x38e870=_0x38e870-0x0;var _0x2dabbe=_0xb44a[_0x38e870];return _0x2dabbe;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xab44('0x0'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xab44('0x1'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 1abb0b1..5134608 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb8c=['fileLogger'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xbb8c,0x77));var _0xcbb8=function(_0x4bc7d8,_0x52e3f3){_0x4bc7d8=_0x4bc7d8-0x0;var _0x59e650=_0xbb8c[_0x4bc7d8];return _0x59e650;};'use strict';var fileLogger=require('../utils/loggers')[_0xcbb8('0x0')];module['exports']=fileLogger; \ No newline at end of file +var _0xa440=['fileLogger'];(function(_0x42f843,_0x3a49c4){var _0x7526=function(_0x46822){while(--_0x46822){_0x42f843['push'](_0x42f843['shift']());}};_0x7526(++_0x3a49c4);}(_0xa440,0x139));var _0x0a44=function(_0x2b9e8a,_0x7b21d4){_0x2b9e8a=_0x2b9e8a-0x0;var _0x520e67=_0xa440[_0x2b9e8a];return _0x520e67;};'use strict';var fileLogger=require('../utils/loggers')[_0x0a44('0x0')];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 2c72262..1abc53f 100644 --- a/server/config/pm2/config.js +++ b/server/config/pm2/config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6679=['../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','xdr','../../services/xdr/index.js','exports','resolve','root','legacy-libs','express','join'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x6679,0x183));var _0x9667=function(_0x4ec520,_0x15fee2){_0x4ec520=_0x4ec520-0x0;var _0xed49d7=_0x6679[_0x4ec520];return _0xed49d7;};'use strict';var path=require('path');var cfg=require('../../config/environment');var env={'NODE_PATH':path[_0x9667('0x0')](path['join'](cfg[_0x9667('0x1')],_0x9667('0x2')))};var pm2config={'apps':[{'name':_0x9667('0x3'),'script':path[_0x9667('0x4')](__dirname,_0x9667('0x5')),'env':env},{'name':_0x9667('0x6'),'script':path[_0x9667('0x4')](__dirname,_0x9667('0x7')),'env':env},{'name':_0x9667('0x8'),'script':path[_0x9667('0x4')](__dirname,_0x9667('0x9')),'env':env},{'name':'email','script':path[_0x9667('0x4')](__dirname,_0x9667('0xa')),'env':env},{'name':'routing','script':path[_0x9667('0x4')](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0x9667('0xb'),'script':path['join'](__dirname,_0x9667('0xc')),'env':env}]};module[_0x9667('0xd')]=pm2config; \ No newline at end of file +var _0x63c4=['../../services/routing/index.js','xdr','exports','path','../../config/environment','resolve','join','root','legacy-libs','ami','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js'];(function(_0x9f73a,_0x1ac7d7){var _0x454526=function(_0xf782c8){while(--_0xf782c8){_0x9f73a['push'](_0x9f73a['shift']());}};_0x454526(++_0x1ac7d7);}(_0x63c4,0x17d));var _0x463c=function(_0x4a17ad,_0x383a70){_0x4a17ad=_0x4a17ad-0x0;var _0x13497c=_0x63c4[_0x4a17ad];return _0x13497c;};'use strict';var path=require(_0x463c('0x0'));var cfg=require(_0x463c('0x1'));var env={'NODE_PATH':path[_0x463c('0x2')](path[_0x463c('0x3')](cfg[_0x463c('0x4')],_0x463c('0x5')))};var pm2config={'apps':[{'name':'express','script':path[_0x463c('0x3')](__dirname,'../../services/express/index.js'),'env':env},{'name':_0x463c('0x6'),'script':path[_0x463c('0x3')](__dirname,_0x463c('0x7')),'env':env},{'name':'agi','script':path[_0x463c('0x3')](__dirname,_0x463c('0x8')),'env':env},{'name':_0x463c('0x9'),'script':path['join'](__dirname,_0x463c('0xa')),'env':env},{'name':'routing','script':path[_0x463c('0x3')](__dirname,_0x463c('0xb')),'env':env},{'name':_0x463c('0xc'),'script':path[_0x463c('0x3')](__dirname,'../../services/xdr/index.js'),'env':env}]};module[_0x463c('0xd')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 6e95ba0..341be1c 100644 --- a/server/config/pm2/index.js +++ b/server/config/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x144d=['restart','list','describe','delete','dump','saved','pm2','./config','connected','start','then','disconnect','stop'];(function(_0x1ffc90,_0xe2e0d6){var _0x430897=function(_0x5d8d07){while(--_0x5d8d07){_0x1ffc90['push'](_0x1ffc90['shift']());}};_0x430897(++_0xe2e0d6);}(_0x144d,0x1b3));var _0xd144=function(_0x19bd7b,_0x147240){_0x19bd7b=_0x19bd7b-0x0;var _0x20985c=_0x144d[_0x19bd7b];return _0x20985c;};'use strict';var pm2=require(_0xd144('0x0'));var BPromise=require('bluebird');var config=require(_0xd144('0x1'));function connect(){return new BPromise(function(_0x518c32,_0x179937){return pm2['connect'](function(_0x192bc4){if(_0x192bc4){return _0x179937(_0x192bc4);}return _0x518c32(_0xd144('0x2'));});});};exports[_0xd144('0x3')]=function(_0x2d125e){return connect()[_0xd144('0x4')](function(){return new BPromise(function(_0x48082a,_0x3adc90){return pm2['start'](_0x2d125e,function(_0x411922,_0x2c7733){if(_0x411922){return _0x3adc90(_0x411922);}pm2[_0xd144('0x5')]();return _0x48082a(_0x2c7733);});});});};exports[_0xd144('0x6')]=function(_0x58d219){return connect()[_0xd144('0x4')](function(){return new BPromise(function(_0x2dee41,_0x2a37e4){return pm2[_0xd144('0x6')](_0x58d219,function(_0x2f8a52,_0x27dbf3){if(_0x2f8a52){return _0x2a37e4(_0x2f8a52);}pm2[_0xd144('0x5')]();return _0x2dee41(_0x27dbf3);});});});};exports['restart']=function(_0x548514){return connect()[_0xd144('0x4')](function(){return new BPromise(function(_0x219f31,_0x5962d8){return pm2[_0xd144('0x7')](_0x548514,function(_0x493ba5,_0x450705){if(_0x493ba5){return _0x5962d8(_0x493ba5);}pm2[_0xd144('0x5')]();return _0x219f31(_0x450705);});});});};exports[_0xd144('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x2d855f,_0x256a6c){return pm2[_0xd144('0x8')](function(_0x5bb207,_0x5a9dcd){if(_0x5bb207){return _0x256a6c(_0x5bb207);}pm2['disconnect']();return _0x2d855f(_0x5a9dcd);});});});};exports[_0xd144('0x9')]=function(_0x5269fb){return connect()[_0xd144('0x4')](function(){return new BPromise(function(_0x5bfe51,_0x2cb6ad){return pm2[_0xd144('0x9')](_0x5269fb,function(_0xf9af11,_0x1bc276){if(_0xf9af11){return _0x2cb6ad(_0xf9af11);}pm2[_0xd144('0x5')]();return _0x5bfe51(_0x1bc276);});});});};exports[_0xd144('0xa')]=function(_0x53a4a3){return connect()[_0xd144('0x4')](function(){return new BPromise(function(_0x23ee50,_0x35dfe9){return pm2['delete'](_0x53a4a3,function(_0x378529,_0x5b5211){if(_0x378529){return _0x35dfe9(_0x378529);}pm2['disconnect']();return _0x23ee50(_0x5b5211);});});});};exports[_0xd144('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1aeb2b,_0x1ea74e){return pm2['dump'](function(_0x5a31c4){if(_0x5a31c4){return _0x1ea74e(_0x5a31c4);}return _0x1aeb2b(_0xd144('0xc'));});});});}; \ No newline at end of file +var _0xc178=['stop','restart','list','describe','delete','dump','bluebird','./config','start','then','disconnect'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc178,0x103));var _0x8c17=function(_0x56a267,_0x17d06c){_0x56a267=_0x56a267-0x0;var _0x40ac38=_0xc178[_0x56a267];return _0x40ac38;};'use strict';var pm2=require('pm2');var BPromise=require(_0x8c17('0x0'));var config=require(_0x8c17('0x1'));function connect(){return new BPromise(function(_0x3251a5,_0x2c728f){return pm2['connect'](function(_0x4a93be){if(_0x4a93be){return _0x2c728f(_0x4a93be);}return _0x3251a5('connected');});});};exports[_0x8c17('0x2')]=function(_0x1c45a0){return connect()[_0x8c17('0x3')](function(){return new BPromise(function(_0x1a192e,_0x2744e5){return pm2[_0x8c17('0x2')](_0x1c45a0,function(_0x178051,_0x2235d3){if(_0x178051){return _0x2744e5(_0x178051);}pm2[_0x8c17('0x4')]();return _0x1a192e(_0x2235d3);});});});};exports[_0x8c17('0x5')]=function(_0x1eb529){return connect()[_0x8c17('0x3')](function(){return new BPromise(function(_0x55ed87,_0x22776c){return pm2[_0x8c17('0x5')](_0x1eb529,function(_0x27e581,_0x3eaecc){if(_0x27e581){return _0x22776c(_0x27e581);}pm2[_0x8c17('0x4')]();return _0x55ed87(_0x3eaecc);});});});};exports[_0x8c17('0x6')]=function(_0x465c6d){return connect()[_0x8c17('0x3')](function(){return new BPromise(function(_0x3719be,_0x5e328d){return pm2[_0x8c17('0x6')](_0x465c6d,function(_0x4af13b,_0x4b46f6){if(_0x4af13b){return _0x5e328d(_0x4af13b);}pm2[_0x8c17('0x4')]();return _0x3719be(_0x4b46f6);});});});};exports[_0x8c17('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1c8afa,_0x341e68){return pm2[_0x8c17('0x7')](function(_0x4d2d35,_0x57d5c5){if(_0x4d2d35){return _0x341e68(_0x4d2d35);}pm2[_0x8c17('0x4')]();return _0x1c8afa(_0x57d5c5);});});});};exports[_0x8c17('0x8')]=function(_0xf509e7){return connect()[_0x8c17('0x3')](function(){return new BPromise(function(_0x301e97,_0x39f9c7){return pm2[_0x8c17('0x8')](_0xf509e7,function(_0x135134,_0x451a55){if(_0x135134){return _0x39f9c7(_0x135134);}pm2[_0x8c17('0x4')]();return _0x301e97(_0x451a55);});});});};exports[_0x8c17('0x9')]=function(_0x42ce96){return connect()[_0x8c17('0x3')](function(){return new BPromise(function(_0x58270c,_0x5b1f5f){return pm2[_0x8c17('0x9')](_0x42ce96,function(_0x24035a,_0x17fcf1){if(_0x24035a){return _0x5b1f5f(_0x24035a);}pm2[_0x8c17('0x4')]();return _0x58270c(_0x17fcf1);});});});};exports[_0x8c17('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x418355,_0x1203df){return pm2['dump'](function(_0x5e1af7){if(_0x5e1af7){return _0x1203df(_0x5e1af7);}return _0x418355('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index ecad703..c468802 100644 --- a/server/config/schedule/chat.js +++ b/server/config/schedule/chat.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49cf=['[CHAT]\x20Error\x20closing\x20interactions','inspect','moment','util','../../config/environment','../../mysqldb','../logger','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','then','lastMsgAt','subtract','minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','timeout','YYYY-MM-DD\x20HH:mm:ss','info','emit','chatInteraction:update','catch'];(function(_0x226879,_0x30a56b){var _0x20964c=function(_0x4a1ea6){while(--_0x4a1ea6){_0x226879['push'](_0x226879['shift']());}};_0x20964c(++_0x30a56b);}(_0x49cf,0x1ef));var _0xf49c=function(_0x3d3974,_0x315687){_0x3d3974=_0x3d3974-0x0;var _0x323d62=_0x49cf[_0x3d3974];return _0x323d62;};'use strict';var _=require('lodash');var moment=require(_0xf49c('0x0'));var Redis=require('ioredis');var util=require(_0xf49c('0x1'));var config=require(_0xf49c('0x2'));var db=require(_0xf49c('0x3'))['db'];var logger=require(_0xf49c('0x4'))('schedule');config[_0xf49c('0x5')]=_[_0xf49c('0x6')](config[_0xf49c('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xf49c('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x534b7e=0x0;var _0x2cf540=[];return db[_0xf49c('0x8')][_0xf49c('0x9')]({'raw':!![],'attributes':['id',_0xf49c('0xa')],'where':{'id':0x1}})[_0xf49c('0xb')](function(_0x310b62){_0x534b7e=_0x310b62[_0xf49c('0xa')];if(_0x534b7e){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0xf49c('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xf49c('0xd')](_0x310b62[_0xf49c('0xa')],_0xf49c('0xe'))}}});}else{return[];}})[_0xf49c('0xb')](function(_0x1f8ccc){if(_0x1f8ccc&&_0x1f8ccc[_0xf49c('0xf')]){_0x2cf540=_[_0xf49c('0x10')](_0x1f8ccc||[],'id');logger['info'](_0xf49c('0x11'),_0x2cf540[_0xf49c('0x12')]());return db[_0xf49c('0x13')][_0xf49c('0x14')]({'closeReason':'system','disposition':_0xf49c('0x15'),'closed':!![],'closedAt':moment()['format'](_0xf49c('0x16'))},{'where':{'id':_0x2cf540}});}})['then'](function(){if(_0x2cf540&&_0x2cf540[_0xf49c('0xf')]){logger[_0xf49c('0x17')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x2cf540['join']());for(var _0x493269=0x0;_0x493269<_0x2cf540['length'];_0x493269++){io[_0xf49c('0x18')](_0xf49c('0x19'),{'id':_0x2cf540[_0x493269],'closed':!![]});}}})[_0xf49c('0x1a')](function(_0x416684){logger['error'](_0xf49c('0x1b'),_0x416684?util[_0xf49c('0x1c')](_0x416684,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x4f0d=['[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','defaults','socket.io-emitter','Setting','find','then','ChatInteraction','findAll','lastMsgAt','subtract','chatTimeout','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','timeout','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x223a3e,_0x2da798){var _0x582005=function(_0x4adba8){while(--_0x4adba8){_0x223a3e['push'](_0x223a3e['shift']());}};_0x582005(++_0x2da798);}(_0x4f0d,0x1d5));var _0xd4f0=function(_0x5cf1a1,_0x1ab924){_0x5cf1a1=_0x5cf1a1-0x0;var _0x52cbcc=_0x4f0d[_0x5cf1a1];return _0x52cbcc;};'use strict';var _=require(_0xd4f0('0x0'));var moment=require(_0xd4f0('0x1'));var Redis=require(_0xd4f0('0x2'));var util=require(_0xd4f0('0x3'));var config=require(_0xd4f0('0x4'));var db=require(_0xd4f0('0x5'))['db'];var logger=require(_0xd4f0('0x6'))('schedule');config[_0xd4f0('0x7')]=_[_0xd4f0('0x8')](config[_0xd4f0('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xd4f0('0x9'))(new Redis(config[_0xd4f0('0x7')]));function closeInteractions(){var _0x2859ec=0x0;var _0x105f32=[];return db[_0xd4f0('0xa')][_0xd4f0('0xb')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xd4f0('0xc')](function(_0x51f049){_0x2859ec=_0x51f049['chatTimeout'];if(_0x2859ec){return db[_0xd4f0('0xd')][_0xd4f0('0xe')]({'raw':!![],'attributes':['id',_0xd4f0('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xd4f0('0x10')](_0x51f049[_0xd4f0('0x11')],_0xd4f0('0x12'))}}});}else{return[];}})[_0xd4f0('0xc')](function(_0x26f4bd){if(_0x26f4bd&&_0x26f4bd[_0xd4f0('0x13')]){_0x105f32=_[_0xd4f0('0x14')](_0x26f4bd||[],'id');logger[_0xd4f0('0x15')](_0xd4f0('0x16'),_0x105f32['join']());return db[_0xd4f0('0xd')][_0xd4f0('0x17')]({'closeReason':'system','disposition':_0xd4f0('0x18'),'closed':!![],'closedAt':moment()['format'](_0xd4f0('0x19'))},{'where':{'id':_0x105f32}});}})[_0xd4f0('0xc')](function(){if(_0x105f32&&_0x105f32['length']){logger[_0xd4f0('0x15')](_0xd4f0('0x1a'),_0x105f32[_0xd4f0('0x1b')]());for(var _0x105d27=0x0;_0x105d27<_0x105f32[_0xd4f0('0x13')];_0x105d27++){io[_0xd4f0('0x1c')](_0xd4f0('0x1d'),{'id':_0x105f32[_0x105d27],'closed':!![]});}}})[_0xd4f0('0x1e')](function(_0x3c6c07){logger['error'](_0xd4f0('0x1f'),_0x3c6c07?util['inspect'](_0x3c6c07,{'showHidden':![],'depth':null}):'');});}exports[_0xd4f0('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index ede7950..630bc28 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9dbb=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x4c88e2,_0x387148){var _0x2bcbee=function(_0x5b2476){while(--_0x5b2476){_0x4c88e2['push'](_0x4c88e2['shift']());}};_0x2bcbee(++_0x387148);}(_0x9dbb,0xf5));var _0xb9db=function(_0x1e6e99,_0xd3bb5f){_0x1e6e99=_0x1e6e99-0x0;var _0x6b6ca8=_0x9dbb[_0x1e6e99];return _0x6b6ca8;};'use strict';function start(){var _0x45f67a=require(_0xb9db('0x0'));return _0x45f67a['startAllRefreshIntervals']();}module[_0xb9db('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x85fa=['exports','startAllRefreshIntervals'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x85fa,0x129));var _0xa85f=function(_0x2ed7bb,_0x47f2da){_0x2ed7bb=_0x2ed7bb-0x0;var _0x3fda74=_0x85fa[_0x2ed7bb];return _0x3fda74;};'use strict';function start(){var _0xd97551=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0xd97551[_0xa85f('0x0')]();}module[_0xa85f('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index fb6cc66..c99f6e7 100644 --- a/server/config/schedule/index.js +++ b/server/config/schedule/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6de5=['subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','jobs','toString','keyBy','difference','intersection','length','exists','delete\x20cron','toRun','index','my\x20id','resolve','isBetween','startAt','endAt','add','cron','start','add\x20cron','stop','update','deleteJob','run','util','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','MailAccount','\x22%s\x22\x20<%s>','name','user','bcc','format','subtractNumber','subtractUnit','join','savename','%s.%s','basename','extname','existsSync','status','Sent','message','attachments','stringify','text','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','email\x20sent','catch','Smtp','isNil'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x6de5,0xbb));var _0x56de=function(_0x404de9,_0x36533d){_0x404de9=_0x404de9-0x0;var _0x404c70=_0x6de5[_0x404de9];return _0x404c70;};'use strict';var fs=require('fs');var util=require(_0x56de('0x0'));var path=require('path');var _=require('lodash');var moment=require('moment');var CronJobManager=require(_0x56de('0x1'));var jayson=require(_0x56de('0x2'));var BPromise=require('bluebird');var logger=require(_0x56de('0x3'))(_0x56de('0x4'));var db=require(_0x56de('0x5'))['db'];var analyticCustomReportController=require(_0x56de('0x6'));var analyticDefaultReportController=require(_0x56de('0x7'));var client=jayson[_0x56de('0x8')][_0x56de('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x145ca5,_0x12b8b8){return function(){logger[_0x56de('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x145ca5[_0x56de('0xb')]);var _0x1efaac=!![];var _0x109283=_0x145ca5[_0x56de('0xc')]['getSmtpOptions']();var _0x451655={'account':_0x109283,'message':{'from':util['format'](_0x56de('0xd'),_0x145ca5[_0x56de('0xc')][_0x56de('0xe')],_0x145ca5[_0x56de('0xc')][_0x56de('0xb')]||_0x145ca5[_0x56de('0xc')]['Smtp'][_0x56de('0xf')]),'to':_0x145ca5[_0x56de('0xb')],'cc':_0x145ca5['cc'],'bcc':_0x145ca5[_0x56de('0x10')],'subject':util[_0x56de('0x11')]('Report\x20%s\x20last\x20%s\x20%s',_0x12b8b8[_0x56de('0xe')],_0x145ca5[_0x56de('0x12')],_0x145ca5[_0x56de('0x13')])}};var _0x4e38de=path[_0x56de('0x14')](__dirname,'../../files/reports');var _0x5b8321=_0x12b8b8[_0x56de('0x15')];var _0x453f2f=util[_0x56de('0x11')](_0x56de('0x16'),path[_0x56de('0x17')](_0x12b8b8[_0x56de('0x15')],path[_0x56de('0x18')](_0x12b8b8[_0x56de('0x15')])),'zip');var _0x1c9642=path[_0x56de('0x14')](_0x4e38de,_0x5b8321);var _0x434ace=path['join'](_0x4e38de,_0x453f2f);if(fs[_0x56de('0x19')](_0x1c9642)){_0x12b8b8[_0x56de('0x1a')]=_0x56de('0x1b');_0x451655[_0x56de('0x1c')][_0x56de('0x1d')]=[{'filename':_0x5b8321,'path':_0x1c9642}];_0x451655[_0x56de('0x1c')]['text']=util[_0x56de('0x11')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x56de('0x1e')](_0x12b8b8,null,0x2));}else if(fs['existsSync'](_0x434ace)){_0x12b8b8['status']=_0x56de('0x1b');_0x451655[_0x56de('0x1c')][_0x56de('0x1d')]=[{'filename':_0x453f2f,'path':_0x434ace}];}else{_0x451655[_0x56de('0x1c')][_0x56de('0x1f')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x145ca5['sendIfEmpty']){_0x1efaac=![];logger[_0x56de('0xa')](_0x56de('0x20'));}}if(_0x1efaac){return client[_0x56de('0x21')]('SendMail',_0x451655)[_0x56de('0x22')](function(_0x5e7b6a){if(_0x5e7b6a[_0x56de('0x23')]){return logger['error'](_0x56de('0x24'),JSON['stringify'](_0x5e7b6a));}return logger[_0x56de('0xa')](_0x56de('0x25'));})[_0x56de('0x26')](function(_0x4a63e3){return logger[_0x56de('0x23')]('error\x20mail',JSON['stringify'](_0x4a63e3));});}};}function handleError(){return function(_0x30b567){return logger[_0x56de('0x23')](JSON[_0x56de('0x1e')](_0x30b567));};}function handleResult(_0x400c65){return function(_0x4db815){logger[_0x56de('0xa')]('data',JSON[_0x56de('0x1e')](_0x4db815));if(_0x400c65[_0x56de('0xc')]&&_0x400c65[_0x56de('0xc')][_0x56de('0x27')]&&!_[_0x56de('0x28')](_0x400c65['email'])){setTimeout(handleSendEmail(_0x400c65,_0x4db815),0x3c*0x3e8);}};}function handleJob(_0x420ff9){return function(){try{if(_[_0x56de('0x28')](_0x420ff9['subtractNumber'])){return logger['info'](_0x56de('0x29'));}if(_[_0x56de('0x28')](_0x420ff9[_0x56de('0x13')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x1a60b5={'startDate':moment()[_0x56de('0x2a')](_0x420ff9['subtractNumber'],_0x420ff9[_0x56de('0x13')])[_0x56de('0x11')](_0x56de('0x2b')),'endDate':moment()['format'](_0x56de('0x2b')),'type':_0x56de('0x2c'),'output':_0x420ff9['output'],'name':_0x420ff9[_0x56de('0xe')]};if(!_[_0x56de('0x28')](_0x420ff9['DefaultReportId'])){logger[_0x56de('0xa')]('exec\x20defaul\x20report\x20id:%s',_0x420ff9[_0x56de('0x2d')]);return analyticDefaultReportController['runReport']({'id':_0x420ff9['DefaultReportId']},_0x1a60b5)['then'](handleResult(_0x420ff9))[_0x56de('0x26')](handleError());}if(!_[_0x56de('0x28')](_0x420ff9[_0x56de('0x2e')])){logger[_0x56de('0xa')](_0x56de('0x2f'),_0x420ff9[_0x56de('0x2e')]);return analyticCustomReportController['runReport']({'id':_0x420ff9['CustomReportId']},_0x1a60b5)[_0x56de('0x22')](handleResult(_0x420ff9))[_0x56de('0x26')](handleError());}}catch(_0x1463d8){logger[_0x56de('0x23')](JSON[_0x56de('0x1e')](_0x1463d8));}return logger[_0x56de('0xa')](_0x56de('0x30'));};}function getJobs(_0xf15ee4){var _0x1f9766={};if(_0xf15ee4){_0x1f9766['id']=_0xf15ee4;}return db[_0x56de('0x31')][_0x56de('0x32')]({'where':_0x1f9766,'include':[{'model':db[_0x56de('0xc')],'attributes':['id',_0x56de('0xe'),_0x56de('0xb')],'include':[{'model':db[_0x56de('0x33')],'as':_0x56de('0x27'),'include':[{'model':db[_0x56de('0x34')],'as':_0x56de('0x34')}]}]}]})[_0x56de('0x22')](function(_0x11081e){var _0x382e0b=_['keys'](manager[_0x56de('0x35')]);var _0x2dacb2=_['map'](_0x11081e,function(_0x48fbb6){return _0x48fbb6['id'][_0x56de('0x36')]();});var _0x1d0088=_[_0x56de('0x37')](_0x11081e,function(_0x541585){return _0x541585['id'][_0x56de('0x36')]();});var _0x1545f7=_0xf15ee4?_0x2dacb2:_[_0x56de('0x38')](_0x2dacb2,_0x382e0b);var _0x2704bd=_[_0x56de('0x39')](_0x2dacb2,_0x382e0b);var _0x50780e=_[_0x56de('0x38')](_0x382e0b,_0x2dacb2);var _0x386fe2;var _0x428e23;for(_0x386fe2=0x0;_0x386fe2<_0x50780e[_0x56de('0x3a')]&&!_0xf15ee4;_0x386fe2+=0x1){_0x428e23=_0x50780e[_0x386fe2][_0x56de('0x36')]();if(manager[_0x56de('0x3b')](_0x428e23)){manager['stop'](_0x428e23);manager['deleteJob'](_0x428e23);logger[_0x56de('0xa')](_0x56de('0x3c'),_0x428e23);}}logger[_0x56de('0xa')](_0x56de('0x3d'),JSON[_0x56de('0x1e')](_0x1545f7));for(_0x386fe2=0x0;_0x386fe2<_0x1545f7[_0x56de('0x3a')];_0x386fe2+=0x1){_0x428e23=_0x1545f7[_0x386fe2][_0x56de('0x36')]();logger[_0x56de('0xa')](_0x56de('0x3e'),_0x428e23);if(_0xf15ee4){logger['info'](_0x56de('0x3f'),_0xf15ee4);logger['info'](JSON[_0x56de('0x1e')](_0x1d0088[_0x428e23]));BPromise[_0x56de('0x40')]()[_0x56de('0x22')](handleJob(_0x1d0088[_0x428e23]));logger[_0x56de('0xa')]('run\x20job',_0x1d0088[_0x428e23][_0x56de('0xe')],_0x1d0088[_0x428e23]['cron']);}else if(_0x1d0088[_0x428e23]['cron']&&_0x1d0088[_0x428e23]['active']&&moment()[_0x56de('0x41')](_0x1d0088[_0x428e23][_0x56de('0x42')],_0x1d0088[_0x428e23][_0x56de('0x43')])){manager[_0x56de('0x44')](_0x428e23,_0x1d0088[_0x428e23][_0x56de('0x45')],handleJob(_0x1d0088[_0x428e23]));manager[_0x56de('0x46')](_0x428e23);logger['info'](_0x56de('0x47'),_0x1d0088[_0x428e23]['name'],_0x1d0088[_0x428e23][_0x56de('0x45')]);}else if(manager[_0x56de('0x3b')](_0x428e23)){manager[_0x56de('0x48')](_0x428e23);manager['deleteJob'](_0x428e23);logger[_0x56de('0xa')]('stop\x20cron',_0x1d0088[_0x428e23][_0x56de('0xe')],_0x1d0088[_0x428e23][_0x56de('0x45')]);}}for(_0x386fe2=0x0,_0x428e23;_0x386fe2<_0x2704bd[_0x56de('0x3a')]&&!_0xf15ee4;_0x386fe2+=0x1){_0x428e23=_0x2704bd[_0x386fe2][_0x56de('0x36')]();if(manager[_0x56de('0x3b')](_0x428e23)){if(_0x1d0088[_0x428e23][_0x56de('0x45')]&&_0x1d0088[_0x428e23]['active']&&moment()[_0x56de('0x41')](_0x1d0088[_0x428e23][_0x56de('0x42')],_0x1d0088[_0x428e23][_0x56de('0x43')])){manager[_0x56de('0x49')](_0x428e23,_0x1d0088[_0x428e23][_0x56de('0x45')],handleJob(_0x1d0088[_0x428e23]));logger[_0x56de('0xa')]('update\x20cron',_0x1d0088[_0x428e23][_0x56de('0xe')],_0x1d0088[_0x428e23][_0x56de('0x45')]);}else{manager['stop'](_0x428e23);manager[_0x56de('0x4a')](_0x428e23);logger[_0x56de('0xa')]('stop\x20cron',_0x1d0088[_0x428e23]['name'],_0x1d0088[_0x428e23][_0x56de('0x45')]);}}}})[_0x56de('0x26')](function(_0x43d194){logger['error'](JSON[_0x56de('0x1e')](_0x43d194));});}exports[_0x56de('0x4b')]=function(_0x28242b){return getJobs(_0x28242b);};exports[_0x56de('0x46')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x2ac1=['status','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','existsSync','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','name','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','CloudProvider','keys','jobs','map','toString','keyBy','difference','exists','stop','toRun','length','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update\x20cron','lodash','moment','cron-job-manager','jayson/promise','../logger','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip'];(function(_0x3d7bbf,_0x29a513){var _0x475de3=function(_0x4a64c6){while(--_0x4a64c6){_0x3d7bbf['push'](_0x3d7bbf['shift']());}};_0x475de3(++_0x29a513);}(_0x2ac1,0x93));var _0x12ac=function(_0x53949a,_0x2ddc5b){_0x53949a=_0x53949a-0x0;var _0xe5c764=_0x2ac1[_0x53949a];return _0xe5c764;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0x12ac('0x0'));var moment=require(_0x12ac('0x1'));var CronJobManager=require(_0x12ac('0x2'));var jayson=require(_0x12ac('0x3'));var BPromise=require('bluebird');var logger=require(_0x12ac('0x4'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x12ac('0x5'));var analyticDefaultReportController=require(_0x12ac('0x6'));var client=jayson[_0x12ac('0x7')][_0x12ac('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2f5a4,_0x51902c){return function(){logger[_0x12ac('0x9')](_0x12ac('0xa'),_0x2f5a4[_0x12ac('0xb')]);var _0x51ac3f=!![];var _0x598333=_0x2f5a4[_0x12ac('0xc')][_0x12ac('0xd')]();var _0x2193cb={'account':_0x598333,'message':{'from':util[_0x12ac('0xe')](_0x12ac('0xf'),_0x2f5a4[_0x12ac('0xc')]['name'],_0x2f5a4[_0x12ac('0xc')]['email']||_0x2f5a4[_0x12ac('0xc')][_0x12ac('0x10')][_0x12ac('0x11')]),'to':_0x2f5a4[_0x12ac('0xb')],'cc':_0x2f5a4['cc'],'bcc':_0x2f5a4[_0x12ac('0x12')],'subject':util['format'](_0x12ac('0x13'),_0x51902c['name'],_0x2f5a4[_0x12ac('0x14')],_0x2f5a4[_0x12ac('0x15')])}};var _0x4f3267=path[_0x12ac('0x16')](__dirname,_0x12ac('0x17'));var _0x2429fc=_0x51902c[_0x12ac('0x18')];var _0x47001c=util['format'](_0x12ac('0x19'),path[_0x12ac('0x1a')](_0x51902c[_0x12ac('0x18')],path[_0x12ac('0x1b')](_0x51902c['savename'])),_0x12ac('0x1c'));var _0x1ae385=path[_0x12ac('0x16')](_0x4f3267,_0x2429fc);var _0x2f05c7=path['join'](_0x4f3267,_0x47001c);if(fs['existsSync'](_0x1ae385)){_0x51902c[_0x12ac('0x1d')]='Sent';_0x2193cb[_0x12ac('0x1e')][_0x12ac('0x1f')]=[{'filename':_0x2429fc,'path':_0x1ae385}];_0x2193cb[_0x12ac('0x1e')][_0x12ac('0x20')]=util['format'](_0x12ac('0x21'),JSON['stringify'](_0x51902c,null,0x2));}else if(fs[_0x12ac('0x22')](_0x2f05c7)){_0x51902c['status']=_0x12ac('0x23');_0x2193cb['message'][_0x12ac('0x1f')]=[{'filename':_0x47001c,'path':_0x2f05c7}];}else{_0x2193cb[_0x12ac('0x1e')][_0x12ac('0x20')]=_0x12ac('0x24');if(!_0x2f5a4[_0x12ac('0x25')]){_0x51ac3f=![];logger[_0x12ac('0x9')](_0x12ac('0x26'));}}if(_0x51ac3f){return client[_0x12ac('0x27')](_0x12ac('0x28'),_0x2193cb)[_0x12ac('0x29')](function(_0x4a5d7b){if(_0x4a5d7b[_0x12ac('0x2a')]){return logger[_0x12ac('0x2a')](_0x12ac('0x2b'),JSON[_0x12ac('0x2c')](_0x4a5d7b));}return logger[_0x12ac('0x9')](_0x12ac('0x2d'));})[_0x12ac('0x2e')](function(_0x1defde){return logger[_0x12ac('0x2a')](_0x12ac('0x2b'),JSON[_0x12ac('0x2c')](_0x1defde));});}};}function handleError(){return function(_0x3f508e){return logger[_0x12ac('0x2a')](JSON[_0x12ac('0x2c')](_0x3f508e));};}function handleResult(_0x2ff0e6){return function(_0x3fb53a){logger['info'](_0x12ac('0x2f'),JSON[_0x12ac('0x2c')](_0x3fb53a));if(_0x2ff0e6[_0x12ac('0xc')]&&_0x2ff0e6[_0x12ac('0xc')][_0x12ac('0x10')]&&!_[_0x12ac('0x30')](_0x2ff0e6[_0x12ac('0xb')])){setTimeout(handleSendEmail(_0x2ff0e6,_0x3fb53a),0x3c*0x3e8);}};}function handleJob(_0xfb4b3e){return function(){try{if(_[_0x12ac('0x30')](_0xfb4b3e['subtractNumber'])){return logger[_0x12ac('0x9')](_0x12ac('0x31'));}if(_[_0x12ac('0x30')](_0xfb4b3e['subtractUnit'])){return logger[_0x12ac('0x9')](_0x12ac('0x32'));}var _0x3fa9b3={'startDate':moment()[_0x12ac('0x33')](_0xfb4b3e['subtractNumber'],_0xfb4b3e['subtractUnit'])[_0x12ac('0xe')](_0x12ac('0x34')),'endDate':moment()[_0x12ac('0xe')](_0x12ac('0x34')),'type':_0x12ac('0x35'),'output':_0xfb4b3e[_0x12ac('0x36')],'name':_0xfb4b3e[_0x12ac('0x37')]};if(!_['isNil'](_0xfb4b3e[_0x12ac('0x38')])){logger[_0x12ac('0x9')](_0x12ac('0x39'),_0xfb4b3e[_0x12ac('0x38')]);return analyticDefaultReportController[_0x12ac('0x3a')]({'id':_0xfb4b3e[_0x12ac('0x38')]},_0x3fa9b3)[_0x12ac('0x29')](handleResult(_0xfb4b3e))[_0x12ac('0x2e')](handleError());}if(!_[_0x12ac('0x30')](_0xfb4b3e['CustomReportId'])){logger[_0x12ac('0x9')](_0x12ac('0x3b'),_0xfb4b3e[_0x12ac('0x3c')]);return analyticCustomReportController[_0x12ac('0x3a')]({'id':_0xfb4b3e['CustomReportId']},_0x3fa9b3)[_0x12ac('0x29')](handleResult(_0xfb4b3e))[_0x12ac('0x2e')](handleError());}}catch(_0x468af2){logger['error'](JSON[_0x12ac('0x2c')](_0x468af2));}return logger[_0x12ac('0x9')](_0x12ac('0x3d'));};}function getJobs(_0xa0da60){var _0x4bb807={};if(_0xa0da60){_0x4bb807['id']=_0xa0da60;}return db[_0x12ac('0x3e')]['findAll']({'where':_0x4bb807,'include':[{'model':db[_0x12ac('0xc')],'attributes':['id',_0x12ac('0x37'),_0x12ac('0xb')],'include':[{'model':db['MailServerOut'],'as':_0x12ac('0x10'),'include':[{'model':db[_0x12ac('0x3f')],'as':'CloudProvider'}]}]}]})[_0x12ac('0x29')](function(_0x70cfd1){var _0x5dc376=_[_0x12ac('0x40')](manager[_0x12ac('0x41')]);var _0x1ae9e1=_[_0x12ac('0x42')](_0x70cfd1,function(_0x98b82){return _0x98b82['id'][_0x12ac('0x43')]();});var _0x56b3c4=_[_0x12ac('0x44')](_0x70cfd1,function(_0x2ee422){return _0x2ee422['id'][_0x12ac('0x43')]();});var _0x21745d=_0xa0da60?_0x1ae9e1:_['difference'](_0x1ae9e1,_0x5dc376);var _0xfdb123=_['intersection'](_0x1ae9e1,_0x5dc376);var _0x57e2fb=_[_0x12ac('0x45')](_0x5dc376,_0x1ae9e1);var _0x1ddb1d;var _0x3bdcd4;for(_0x1ddb1d=0x0;_0x1ddb1d<_0x57e2fb['length']&&!_0xa0da60;_0x1ddb1d+=0x1){_0x3bdcd4=_0x57e2fb[_0x1ddb1d][_0x12ac('0x43')]();if(manager[_0x12ac('0x46')](_0x3bdcd4)){manager[_0x12ac('0x47')](_0x3bdcd4);manager['deleteJob'](_0x3bdcd4);logger[_0x12ac('0x9')]('delete\x20cron',_0x3bdcd4);}}logger[_0x12ac('0x9')](_0x12ac('0x48'),JSON['stringify'](_0x21745d));for(_0x1ddb1d=0x0;_0x1ddb1d<_0x21745d[_0x12ac('0x49')];_0x1ddb1d+=0x1){_0x3bdcd4=_0x21745d[_0x1ddb1d][_0x12ac('0x43')]();logger[_0x12ac('0x9')](_0x12ac('0x4a'),_0x3bdcd4);if(_0xa0da60){logger[_0x12ac('0x9')](_0x12ac('0x4b'),_0xa0da60);logger[_0x12ac('0x9')](JSON[_0x12ac('0x2c')](_0x56b3c4[_0x3bdcd4]));BPromise[_0x12ac('0x4c')]()['then'](handleJob(_0x56b3c4[_0x3bdcd4]));logger[_0x12ac('0x9')](_0x12ac('0x4d'),_0x56b3c4[_0x3bdcd4]['name'],_0x56b3c4[_0x3bdcd4][_0x12ac('0x4e')]);}else if(_0x56b3c4[_0x3bdcd4][_0x12ac('0x4e')]&&_0x56b3c4[_0x3bdcd4][_0x12ac('0x4f')]&&moment()[_0x12ac('0x50')](_0x56b3c4[_0x3bdcd4][_0x12ac('0x51')],_0x56b3c4[_0x3bdcd4][_0x12ac('0x52')])){manager[_0x12ac('0x53')](_0x3bdcd4,_0x56b3c4[_0x3bdcd4][_0x12ac('0x4e')],handleJob(_0x56b3c4[_0x3bdcd4]));manager[_0x12ac('0x54')](_0x3bdcd4);logger[_0x12ac('0x9')](_0x12ac('0x55'),_0x56b3c4[_0x3bdcd4][_0x12ac('0x37')],_0x56b3c4[_0x3bdcd4][_0x12ac('0x4e')]);}else if(manager[_0x12ac('0x46')](_0x3bdcd4)){manager[_0x12ac('0x47')](_0x3bdcd4);manager['deleteJob'](_0x3bdcd4);logger[_0x12ac('0x9')](_0x12ac('0x56'),_0x56b3c4[_0x3bdcd4][_0x12ac('0x37')],_0x56b3c4[_0x3bdcd4]['cron']);}}for(_0x1ddb1d=0x0,_0x3bdcd4;_0x1ddb1d<_0xfdb123[_0x12ac('0x49')]&&!_0xa0da60;_0x1ddb1d+=0x1){_0x3bdcd4=_0xfdb123[_0x1ddb1d][_0x12ac('0x43')]();if(manager[_0x12ac('0x46')](_0x3bdcd4)){if(_0x56b3c4[_0x3bdcd4]['cron']&&_0x56b3c4[_0x3bdcd4][_0x12ac('0x4f')]&&moment()[_0x12ac('0x50')](_0x56b3c4[_0x3bdcd4][_0x12ac('0x51')],_0x56b3c4[_0x3bdcd4][_0x12ac('0x52')])){manager['update'](_0x3bdcd4,_0x56b3c4[_0x3bdcd4][_0x12ac('0x4e')],handleJob(_0x56b3c4[_0x3bdcd4]));logger[_0x12ac('0x9')](_0x12ac('0x57'),_0x56b3c4[_0x3bdcd4][_0x12ac('0x37')],_0x56b3c4[_0x3bdcd4][_0x12ac('0x4e')]);}else{manager[_0x12ac('0x47')](_0x3bdcd4);manager['deleteJob'](_0x3bdcd4);logger['info']('stop\x20cron',_0x56b3c4[_0x3bdcd4][_0x12ac('0x37')],_0x56b3c4[_0x3bdcd4][_0x12ac('0x4e')]);}}}})[_0x12ac('0x2e')](function(_0x27d34d){logger['error'](JSON[_0x12ac('0x2c')](_0x27d34d));});}exports['run']=function(_0x48227f){return getJobs(_0x48227f);};exports[_0x12ac('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 082a681..f091e21 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x115a=['../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','sentiment','sentimentAccountId','sentimentRegion','ValidationError','Sentiment\x20Analysis\x20not\x20configured','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','bucket','Transcript\x20not\x20available','Cloud\x20Provider\x20not\x20configured','Negative','COMPLETED','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','start','lodash','aws-sdk','request-promise','util','bluebird'];(function(_0x3896d0,_0x5c9578){var _0x15360d=function(_0xcf9e93){while(--_0xcf9e93){_0x3896d0['push'](_0x3896d0['shift']());}};_0x15360d(++_0x5c9578);}(_0x115a,0x91));var _0xa115=function(_0x325d3a,_0x2306a0){_0x325d3a=_0x325d3a-0x0;var _0x3dc89c=_0x115a[_0x325d3a];return _0x3dc89c;};var _=require(_0xa115('0x0'));var AWS=require(_0xa115('0x1'));var rp=require(_0xa115('0x2'));var util=require(_0xa115('0x3'));var BPromise=require(_0xa115('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0xa115('0x5'))('transcribe');function getTranscriptionJob(_0x1e23d3,_0x217a8e,_0x41bb3f,_0x40901a){return new Promise(function(_0x1ab6f9,_0x234bed){var _0x567cb3=new AWS[(_0xa115('0x6'))]({'accessKeyId':_0x217a8e,'secretAccessKey':_0x1e23d3,'region':_0x41bb3f});_0x567cb3[_0xa115('0x7')]({'TranscriptionJobName':_0x40901a},function(_0x291bec,_0x2a7527){if(_0x291bec){return _0x234bed(_0x291bec);}else{return _0x1ab6f9(_0x2a7527);}});});}function sentiment(_0x2499fd,_0x54cbfa,_0xd6f607,_0xc66b44,_0x3ba292){return new Promise(function(_0xa173e8,_0x46b5c0){var _0x5683d6=new AWS[(_0xa115('0x8'))]({'accessKeyId':_0x54cbfa,'secretAccessKey':_0x2499fd,'region':_0xd6f607});_0x5683d6[_0xa115('0x9')]({'Text':_0xc66b44,'LanguageCode':_0x3ba292[_0xa115('0xa')](0x0,0x2)},function(_0x33385e,_0x4d0241){if(_0x33385e){return _0x46b5c0(_0x33385e);}else{return _0xa173e8(_0x4d0241);}});});}function checkTranscribeJob(_0x23a688,_0x3f1796,_0x207857){var _0x279a25;return new BPromise(function(_0xf71f3e,_0x171629){logger[_0xa115('0xb')](util['format'](_0xa115('0xc'),_0x23a688['id'],_0x23a688[_0xa115('0xd')]));return getTranscriptionJob(_0x207857[_0xa115('0xe')],_0x207857[_0xa115('0xf')],_0x3f1796[_0xa115('0x10')],_0x23a688[_0xa115('0xd')])[_0xa115('0x11')](function(_0x325427){logger[_0xa115('0xb')](util[_0xa115('0x12')](_0xa115('0x13'),_0x23a688['id'],_0x23a688[_0xa115('0xd')],_0x325427[_0xa115('0x14')]['TranscriptionJobStatus']));if(!_0x23a688[_0xa115('0x15')]){switch(_0x325427[_0xa115('0x14')][_0xa115('0x16')]){case'COMPLETED':var _0x57f366={'transcribeStatus':_0x325427[_0xa115('0x14')][_0xa115('0x16')],'fileUri':_0x325427['TranscriptionJob'][_0xa115('0x17')][_0xa115('0x18')]};logger[_0xa115('0xb')](util[_0xa115('0x12')](_0xa115('0x19'),_0x23a688['id']));return rp({'uri':_0x325427[_0xa115('0x14')][_0xa115('0x17')][_0xa115('0x18')],'json':!![]})[_0xa115('0x11')](function(_0x85deca){logger['info'](util[_0xa115('0x12')](_0xa115('0x1a'),_0x23a688['id']));if(_0x85deca&&_0x85deca[_0xa115('0x1b')]&&_0x85deca[_0xa115('0x1b')][_0xa115('0x1c')]&&_0x85deca[_0xa115('0x1b')][_0xa115('0x1c')][_0xa115('0x1d')]){_0x57f366[_0xa115('0x15')]='';for(var _0x507b10=0x0;_0x507b10<_0x85deca['results'][_0xa115('0x1c')]['length'];_0x507b10++){_0x57f366[_0xa115('0x15')]+=_0x85deca[_0xa115('0x1b')][_0xa115('0x1c')][_0x507b10][_0xa115('0x1e')]+'';}}return _0x23a688[_0xa115('0x1f')](_0x57f366);})['then'](function(){logger[_0xa115('0xb')](util[_0xa115('0x12')](_0xa115('0x20'),_0x23a688['id']));if(!_0x23a688['tempSentiment']){throw new db[(_0xa115('0x21'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x3f1796[_0xa115('0x22')]||!_0x3f1796[_0xa115('0x23')]||!_0x3f1796[_0xa115('0x24')]||!_0x3f1796['language']||!_0x3f1796['bucket']){throw new db['Sequelize'][(_0xa115('0x25'))](_0xa115('0x26'));}if(!_0x57f366['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x3f1796[_0xa115('0x23')]===_0x207857['id']){return _0x207857;}else{return db['CloudProvider'][_0xa115('0x27')]({'where':{'id':_settings[_0xa115('0x23')]}});}})[_0xa115('0x11')](function(_0x3dfd94){if(!_0x3dfd94){throw new db[(_0xa115('0x21'))]['ValidationError'](_0xa115('0x28'));}if(!_0x3dfd94[_0xa115('0xe')]||!_0x3dfd94[_0xa115('0xf')]){throw new db[(_0xa115('0x21'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x279a25=_0x3dfd94;logger[_0xa115('0xb')](util[_0xa115('0x12')](_0xa115('0x29'),_0x23a688['id']));return sentiment(_0x279a25['data1'],_0x279a25[_0xa115('0xf')],_0x3f1796[_0xa115('0x24')],_0x57f366[_0xa115('0x15')],_0x3f1796[_0xa115('0x2a')]);})[_0xa115('0x11')](function(_0x213354){logger['info'](util['format'](_0xa115('0x2b'),_0x23a688['id']));return _0x23a688[_0xa115('0x1f')]({'sentiment':_0x213354[_0xa115('0x2c')],'sPositive':_0x213354[_0xa115('0x2d')][_0xa115('0x2e')],'sNegative':_0x213354['SentimentScore']['Negative'],'sMixed':_0x213354['SentimentScore'][_0xa115('0x2f')],'sNeutral':_0x213354[_0xa115('0x2d')][_0xa115('0x30')]});})[_0xa115('0x11')](function(){logger[_0xa115('0xb')](util['format'](_0xa115('0x20'),_0x23a688['id']));_0xf71f3e();});case _0xa115('0x31'):return _0x23a688['update']({'transcribeStatus':_0xa115('0x31'),'failureReason':_0x325427[_0xa115('0x14')][_0xa115('0x32')]})[_0xa115('0x11')](function(){logger[_0xa115('0xb')](util['format'](_0xa115('0x20'),_0x23a688['id']));_0xf71f3e();});default:logger[_0xa115('0xb')](util[_0xa115('0x12')](_0xa115('0x33'),_0x23a688['id']));break;}}else{return BPromise[_0xa115('0x34')]()[_0xa115('0x11')](function(){if(!_0x23a688[_0xa115('0x35')]){throw new db['Sequelize'][(_0xa115('0x25'))](_0xa115('0x36'));}if(!_0x3f1796[_0xa115('0x22')]||!_0x3f1796[_0xa115('0x23')]||!_0x3f1796[_0xa115('0x24')]||!_0x3f1796[_0xa115('0x2a')]||!_0x3f1796[_0xa115('0x37')]){throw new db[(_0xa115('0x21'))][(_0xa115('0x25'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x23a688['fileText']){throw new Error(_0xa115('0x38'));}if(_0x3f1796['sentimentAccountId']===_0x207857['id']){return _0x207857;}else{return db['CloudProvider'][_0xa115('0x27')]({'where':{'id':_settings[_0xa115('0x23')]}});}})['then'](function(_0x10da2b){if(!_0x10da2b){throw new db[(_0xa115('0x21'))][(_0xa115('0x25'))](_0xa115('0x28'));}if(!_0x10da2b[_0xa115('0xe')]||!_0x10da2b[_0xa115('0xf')]){throw new db[(_0xa115('0x21'))][(_0xa115('0x25'))](_0xa115('0x39'));}_0x279a25=_0x10da2b;logger[_0xa115('0xb')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x23a688['id']));return sentiment(_0x279a25[_0xa115('0xe')],_0x279a25[_0xa115('0xf')],_0x3f1796[_0xa115('0x24')],_0x23a688[_0xa115('0x15')],_0x3f1796[_0xa115('0x2a')]);})[_0xa115('0x11')](function(_0x284d7f){logger['info'](util[_0xa115('0x12')](_0xa115('0x2b'),_0x23a688['id']));return _0x23a688[_0xa115('0x1f')]({'sentiment':_0x284d7f['Sentiment'],'sPositive':_0x284d7f['SentimentScore'][_0xa115('0x2e')],'sNegative':_0x284d7f['SentimentScore'][_0xa115('0x3a')],'sMixed':_0x284d7f[_0xa115('0x2d')][_0xa115('0x2f')],'sNeutral':_0x284d7f['SentimentScore']['Neutral'],'transcribeStatus':_0xa115('0x3b')});})['then'](function(){logger[_0xa115('0xb')](util[_0xa115('0x12')](_0xa115('0x20'),_0x23a688['id']));_0xf71f3e();});}})[_0xa115('0x3c')](function(_0x326e87){if(_0x326e87){if(!_0x326e87[_0xa115('0x3d')]||_0x326e87[_0xa115('0x3d')]!==_0xa115('0x3e')){logger[_0xa115('0x3f')](util[_0xa115('0x12')](_0xa115('0x40'),_0x23a688['id']),util[_0xa115('0x41')](_0x326e87,{'showHidden':![],'depth':null}));}}_0xf71f3e();});});}function checkTranscribe(){var _0x51704d;var _0x5723e1;var _0x2f2bfe;return db[_0xa115('0x42')][_0xa115('0x43')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xa115('0x11')](function(_0x202a73){if(!_0x202a73||!_0x202a73['length']){throw new db[(_0xa115('0x21'))]['ValidationError'](_0xa115('0x44'));}_0x51704d=_0x202a73;return db[_0xa115('0x45')][_0xa115('0x27')]({'where':{'id':0x1}});})[_0xa115('0x11')](function(_0xe4c568){if(!_0xe4c568){throw new db[(_0xa115('0x21'))]['ValidationError']('Settings\x20not\x20available');}_0x5723e1=_0xe4c568;if(!_0x5723e1['transcribe']||!_0x5723e1[_0xa115('0x46')]||!_0x5723e1[_0xa115('0x10')]||!_0x5723e1[_0xa115('0x2a')]||!_0x5723e1['bucket']){throw new db['Sequelize']['ValidationError'](_0xa115('0x47'));}return db['CloudProvider'][_0xa115('0x27')]({'where':{'id':_0x5723e1['transcribeAccountId']}});})[_0xa115('0x11')](function(_0x590613){if(!_0x590613){throw new db['Sequelize'][(_0xa115('0x25'))](_0xa115('0x28'));}if(!_0x590613['data1']||!_0x590613[_0xa115('0xf')]){throw new db['Sequelize'][(_0xa115('0x25'))]('Cloud\x20Provider\x20not\x20configured');}_0x2f2bfe=_0x590613;var _0x5c0387=[];_0x51704d[_0xa115('0x48')](function(_0xa86cd2){_0x5c0387['push'](checkTranscribeJob(_0xa86cd2,_0x5723e1,_0x2f2bfe));});return BPromise[_0xa115('0x49')](_0x5c0387);})[_0xa115('0x3c')](function(_0x29d390){if(_0x29d390){if(!_0x29d390[_0xa115('0x3d')]||_0x29d390['name']!==_0xa115('0x3e')){logger[_0xa115('0x3f')](util[_0xa115('0x41')](_0x29d390,{'showHidden':![],'depth':null}));}}});}exports[_0xa115('0x4a')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x13b6=['[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','SequelizeValidationError','lodash','request-promise','util','bluebird','../../mysqldb','transcribe','TranscribeService','Comprehend','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','findOne','ValidationError','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Transcript\x20not\x20available','CloudProvider','catch','name','error'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0x13b6,0x97));var _0x613b=function(_0x200c86,_0x468001){_0x200c86=_0x200c86-0x0;var _0xed178c=_0x13b6[_0x200c86];return _0xed178c;};var _=require(_0x613b('0x0'));var AWS=require('aws-sdk');var rp=require(_0x613b('0x1'));var util=require(_0x613b('0x2'));var BPromise=require(_0x613b('0x3'));var db=require(_0x613b('0x4'))['db'];var logger=require('../../config/logger')(_0x613b('0x5'));function getTranscriptionJob(_0x1dc7f9,_0x451191,_0x50fb84,_0x44d5d8){return new Promise(function(_0x1c746e,_0x312a27){var _0x593a18=new AWS[(_0x613b('0x6'))]({'accessKeyId':_0x451191,'secretAccessKey':_0x1dc7f9,'region':_0x50fb84});_0x593a18['getTranscriptionJob']({'TranscriptionJobName':_0x44d5d8},function(_0xf83c34,_0x4abb96){if(_0xf83c34){return _0x312a27(_0xf83c34);}else{return _0x1c746e(_0x4abb96);}});});}function sentiment(_0x5a7415,_0x1cef76,_0x37dbc7,_0x2fac8d,_0x402c15){return new Promise(function(_0x40cd30,_0x5989f7){var _0x51a45f=new AWS[(_0x613b('0x7'))]({'accessKeyId':_0x1cef76,'secretAccessKey':_0x5a7415,'region':_0x37dbc7});_0x51a45f['detectSentiment']({'Text':_0x2fac8d,'LanguageCode':_0x402c15[_0x613b('0x8')](0x0,0x2)},function(_0x579400,_0x59829f){if(_0x579400){return _0x5989f7(_0x579400);}else{return _0x40cd30(_0x59829f);}});});}function checkTranscribeJob(_0x2f6cd6,_0x408b5f,_0x1567cd){var _0x4afa45;return new BPromise(function(_0x1d31f8,_0x2931ee){logger[_0x613b('0x9')](util[_0x613b('0xa')](_0x613b('0xb'),_0x2f6cd6['id'],_0x2f6cd6[_0x613b('0xc')]));return getTranscriptionJob(_0x1567cd[_0x613b('0xd')],_0x1567cd[_0x613b('0xe')],_0x408b5f[_0x613b('0xf')],_0x2f6cd6[_0x613b('0xc')])['then'](function(_0xa74b30){logger[_0x613b('0x9')](util[_0x613b('0xa')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x2f6cd6['id'],_0x2f6cd6['transcribeName'],_0xa74b30[_0x613b('0x10')]['TranscriptionJobStatus']));if(!_0x2f6cd6[_0x613b('0x11')]){switch(_0xa74b30['TranscriptionJob'][_0x613b('0x12')]){case _0x613b('0x13'):var _0x34cd14={'transcribeStatus':_0xa74b30[_0x613b('0x10')][_0x613b('0x12')],'fileUri':_0xa74b30[_0x613b('0x10')][_0x613b('0x14')]['TranscriptFileUri']};logger[_0x613b('0x9')](util[_0x613b('0xa')]('[RECORDING:%d]\x20Get\x20transcript',_0x2f6cd6['id']));return rp({'uri':_0xa74b30['TranscriptionJob'][_0x613b('0x14')][_0x613b('0x15')],'json':!![]})[_0x613b('0x16')](function(_0x425ebb){logger[_0x613b('0x9')](util['format'](_0x613b('0x17'),_0x2f6cd6['id']));if(_0x425ebb&&_0x425ebb['results']&&_0x425ebb[_0x613b('0x18')][_0x613b('0x19')]&&_0x425ebb[_0x613b('0x18')][_0x613b('0x19')]['length']){_0x34cd14[_0x613b('0x11')]='';for(var _0x4eb354=0x0;_0x4eb354<_0x425ebb[_0x613b('0x18')]['transcripts'][_0x613b('0x1a')];_0x4eb354++){_0x34cd14[_0x613b('0x11')]+=_0x425ebb[_0x613b('0x18')][_0x613b('0x19')][_0x4eb354][_0x613b('0x1b')]+'';}}return _0x2f6cd6[_0x613b('0x1c')](_0x34cd14);})[_0x613b('0x16')](function(){logger[_0x613b('0x9')](util[_0x613b('0xa')](_0x613b('0x1d'),_0x2f6cd6['id']));if(!_0x2f6cd6[_0x613b('0x1e')]){throw new db[(_0x613b('0x1f'))]['ValidationError'](_0x613b('0x20'));}if(!_0x408b5f[_0x613b('0x21')]||!_0x408b5f[_0x613b('0x22')]||!_0x408b5f[_0x613b('0x23')]||!_0x408b5f[_0x613b('0x24')]||!_0x408b5f[_0x613b('0x25')]){throw new db[(_0x613b('0x1f'))]['ValidationError'](_0x613b('0x26'));}if(!_0x34cd14[_0x613b('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x408b5f[_0x613b('0x22')]===_0x1567cd['id']){return _0x1567cd;}else{return db['CloudProvider'][_0x613b('0x27')]({'where':{'id':_settings[_0x613b('0x22')]}});}})['then'](function(_0x3306ee){if(!_0x3306ee){throw new db[(_0x613b('0x1f'))][(_0x613b('0x28'))](_0x613b('0x29'));}if(!_0x3306ee[_0x613b('0xd')]||!_0x3306ee[_0x613b('0xe')]){throw new db[(_0x613b('0x1f'))][(_0x613b('0x28'))](_0x613b('0x2a'));}_0x4afa45=_0x3306ee;logger[_0x613b('0x9')](util[_0x613b('0xa')](_0x613b('0x2b'),_0x2f6cd6['id']));return sentiment(_0x4afa45[_0x613b('0xd')],_0x4afa45['data2'],_0x408b5f[_0x613b('0x23')],_0x34cd14[_0x613b('0x11')],_0x408b5f[_0x613b('0x24')]);})[_0x613b('0x16')](function(_0x5e577e){logger['info'](util[_0x613b('0xa')](_0x613b('0x2c'),_0x2f6cd6['id']));return _0x2f6cd6[_0x613b('0x1c')]({'sentiment':_0x5e577e[_0x613b('0x2d')],'sPositive':_0x5e577e[_0x613b('0x2e')][_0x613b('0x2f')],'sNegative':_0x5e577e[_0x613b('0x2e')]['Negative'],'sMixed':_0x5e577e[_0x613b('0x2e')][_0x613b('0x30')],'sNeutral':_0x5e577e[_0x613b('0x2e')][_0x613b('0x31')]});})[_0x613b('0x16')](function(){logger[_0x613b('0x9')](util[_0x613b('0xa')](_0x613b('0x1d'),_0x2f6cd6['id']));_0x1d31f8();});case _0x613b('0x32'):return _0x2f6cd6[_0x613b('0x1c')]({'transcribeStatus':_0x613b('0x32'),'failureReason':_0xa74b30[_0x613b('0x10')][_0x613b('0x33')]})[_0x613b('0x16')](function(){logger[_0x613b('0x9')](util[_0x613b('0xa')](_0x613b('0x1d'),_0x2f6cd6['id']));_0x1d31f8();});default:logger[_0x613b('0x9')](util['format'](_0x613b('0x34'),_0x2f6cd6['id']));break;}}else{return BPromise[_0x613b('0x35')]()[_0x613b('0x16')](function(){if(!_0x2f6cd6[_0x613b('0x1e')]){throw new db[(_0x613b('0x1f'))][(_0x613b('0x28'))](_0x613b('0x20'));}if(!_0x408b5f[_0x613b('0x21')]||!_0x408b5f[_0x613b('0x22')]||!_0x408b5f[_0x613b('0x23')]||!_0x408b5f[_0x613b('0x24')]||!_0x408b5f['bucket']){throw new db[(_0x613b('0x1f'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2f6cd6[_0x613b('0x11')]){throw new Error(_0x613b('0x36'));}if(_0x408b5f[_0x613b('0x22')]===_0x1567cd['id']){return _0x1567cd;}else{return db[_0x613b('0x37')]['findOne']({'where':{'id':_settings[_0x613b('0x22')]}});}})['then'](function(_0x33671a){if(!_0x33671a){throw new db[(_0x613b('0x1f'))]['ValidationError'](_0x613b('0x29'));}if(!_0x33671a['data1']||!_0x33671a['data2']){throw new db['Sequelize']['ValidationError'](_0x613b('0x2a'));}_0x4afa45=_0x33671a;logger['info'](util[_0x613b('0xa')](_0x613b('0x2b'),_0x2f6cd6['id']));return sentiment(_0x4afa45['data1'],_0x4afa45[_0x613b('0xe')],_0x408b5f[_0x613b('0x23')],_0x2f6cd6[_0x613b('0x11')],_0x408b5f[_0x613b('0x24')]);})['then'](function(_0x5c184a){logger[_0x613b('0x9')](util[_0x613b('0xa')](_0x613b('0x2c'),_0x2f6cd6['id']));return _0x2f6cd6['update']({'sentiment':_0x5c184a['Sentiment'],'sPositive':_0x5c184a[_0x613b('0x2e')][_0x613b('0x2f')],'sNegative':_0x5c184a[_0x613b('0x2e')]['Negative'],'sMixed':_0x5c184a['SentimentScore'][_0x613b('0x30')],'sNeutral':_0x5c184a[_0x613b('0x2e')][_0x613b('0x31')],'transcribeStatus':_0x613b('0x13')});})[_0x613b('0x16')](function(){logger[_0x613b('0x9')](util[_0x613b('0xa')](_0x613b('0x1d'),_0x2f6cd6['id']));_0x1d31f8();});}})[_0x613b('0x38')](function(_0x2b856e){if(_0x2b856e){if(!_0x2b856e[_0x613b('0x39')]||_0x2b856e[_0x613b('0x39')]!=='SequelizeValidationError'){logger[_0x613b('0x3a')](util[_0x613b('0xa')](_0x613b('0x3b'),_0x2f6cd6['id']),util[_0x613b('0x3c')](_0x2b856e,{'showHidden':![],'depth':null}));}}_0x1d31f8();});});}function checkTranscribe(){var _0x20f32b;var _0x5dcb8e;var _0x1e6226;return db[_0x613b('0x3d')][_0x613b('0x3e')]({'where':{'transcribeStatus':_0x613b('0x3f')}})[_0x613b('0x16')](function(_0x31f2d1){if(!_0x31f2d1||!_0x31f2d1[_0x613b('0x1a')]){throw new db[(_0x613b('0x1f'))][(_0x613b('0x28'))](_0x613b('0x40'));}_0x20f32b=_0x31f2d1;return db[_0x613b('0x41')][_0x613b('0x27')]({'where':{'id':0x1}});})[_0x613b('0x16')](function(_0x77daf3){if(!_0x77daf3){throw new db[(_0x613b('0x1f'))][(_0x613b('0x28'))](_0x613b('0x42'));}_0x5dcb8e=_0x77daf3;if(!_0x5dcb8e[_0x613b('0x5')]||!_0x5dcb8e[_0x613b('0x43')]||!_0x5dcb8e['transcribeRegion']||!_0x5dcb8e[_0x613b('0x24')]||!_0x5dcb8e[_0x613b('0x25')]){throw new db[(_0x613b('0x1f'))]['ValidationError']('Transcribe\x20not\x20configured');}return db[_0x613b('0x37')][_0x613b('0x27')]({'where':{'id':_0x5dcb8e[_0x613b('0x43')]}});})['then'](function(_0x23116e){if(!_0x23116e){throw new db[(_0x613b('0x1f'))]['ValidationError'](_0x613b('0x29'));}if(!_0x23116e[_0x613b('0xd')]||!_0x23116e[_0x613b('0xe')]){throw new db[(_0x613b('0x1f'))][(_0x613b('0x28'))](_0x613b('0x2a'));}_0x1e6226=_0x23116e;var _0x5ef07a=[];_0x20f32b[_0x613b('0x44')](function(_0x2bab8f){_0x5ef07a['push'](checkTranscribeJob(_0x2bab8f,_0x5dcb8e,_0x1e6226));});return BPromise['all'](_0x5ef07a);})[_0x613b('0x38')](function(_0x56a788){if(_0x56a788){if(!_0x56a788['name']||_0x56a788[_0x613b('0x39')]!==_0x613b('0x45')){logger[_0x613b('0x3a')](util[_0x613b('0x3c')](_0x56a788,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index c522244..d56d13b 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3095=['[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','util','../../mysqldb','schedule','defaults','redis','localhost','socket.io-emitter','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','timeout','format','emit','catch','error'];(function(_0xd734c5,_0x2d6668){var _0x169b64=function(_0x27e446){while(--_0x27e446){_0xd734c5['push'](_0xd734c5['shift']());}};_0x169b64(++_0x2d6668);}(_0x3095,0x13a));var _0x5309=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x3095[_0xbb9dbf];return _0x30223c;};'use strict';var _=require(_0x5309('0x0'));var moment=require(_0x5309('0x1'));var Redis=require('ioredis');var util=require(_0x5309('0x2'));var config=require('../../config/environment');var db=require(_0x5309('0x3'))['db'];var logger=require('../logger')(_0x5309('0x4'));config['redis']=_[_0x5309('0x5')](config[_0x5309('0x6')],{'host':_0x5309('0x7'),'port':0x18eb});var io=require(_0x5309('0x8'))(new Redis(config[_0x5309('0x6')]));function closeInteractions(){var _0x2c95af=[];return db['WhatsappInteraction'][_0x5309('0x9')]({'raw':!![],'attributes':['id',_0x5309('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x5309('0xb')](0x18,_0x5309('0xc'))}}})[_0x5309('0xd')](function(_0x618ff0){if(_0x618ff0&&_0x618ff0[_0x5309('0xe')]){_0x2c95af=_[_0x5309('0xf')](_0x618ff0||[],'id');logger[_0x5309('0x10')](_0x5309('0x11'),_0x2c95af['join']());return db['WhatsappInteraction'][_0x5309('0x12')]({'closeReason':'system','disposition':_0x5309('0x13'),'closed':!![],'closedAt':moment()[_0x5309('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x2c95af}});}})[_0x5309('0xd')](function(){if(_0x2c95af&&_0x2c95af[_0x5309('0xe')]){logger[_0x5309('0x10')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x2c95af['join']());for(var _0xd96f82=0x0;_0xd96f82<_0x2c95af['length'];_0xd96f82++){io[_0x5309('0x15')]('whatsappInteraction:update',{'id':_0x2c95af[_0xd96f82],'closed':!![]});}}})[_0x5309('0x16')](function(_0x1ad75e){logger[_0x5309('0x17')](_0x5309('0x18'),_0x1ad75e?util['inspect'](_0x1ad75e,{'showHidden':![],'depth':null}):'');});}exports[_0x5309('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xdb73=['catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../logger','redis','socket.io-emitter','WhatsappInteraction','findAll','subtract','length','map','info','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','emit','whatsappInteraction:update'];(function(_0x56f9ce,_0x3307f7){var _0x126964=function(_0x364a97){while(--_0x364a97){_0x56f9ce['push'](_0x56f9ce['shift']());}};_0x126964(++_0x3307f7);}(_0xdb73,0x122));var _0x3db7=function(_0xa5a0f2,_0x4a0114){_0xa5a0f2=_0xa5a0f2-0x0;var _0x36df4d=_0xdb73[_0xa5a0f2];return _0x36df4d;};'use strict';var _=require(_0x3db7('0x0'));var moment=require(_0x3db7('0x1'));var Redis=require(_0x3db7('0x2'));var util=require(_0x3db7('0x3'));var config=require(_0x3db7('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x3db7('0x5'))('schedule');config[_0x3db7('0x6')]=_['defaults'](config[_0x3db7('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x3db7('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x39903f=[];return db[_0x3db7('0x8')][_0x3db7('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x3db7('0xa')](0x18,'hours')}}})['then'](function(_0xd82527){if(_0xd82527&&_0xd82527[_0x3db7('0xb')]){_0x39903f=_[_0x3db7('0xc')](_0xd82527||[],'id');logger[_0x3db7('0xd')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x39903f[_0x3db7('0xe')]());return db[_0x3db7('0x8')][_0x3db7('0xf')]({'closeReason':'system','disposition':_0x3db7('0x10'),'closed':!![],'closedAt':moment()[_0x3db7('0x11')](_0x3db7('0x12'))},{'where':{'id':_0x39903f}});}})[_0x3db7('0x13')](function(){if(_0x39903f&&_0x39903f[_0x3db7('0xb')]){logger[_0x3db7('0xd')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x39903f[_0x3db7('0xe')]());for(var _0x365cdc=0x0;_0x365cdc<_0x39903f[_0x3db7('0xb')];_0x365cdc++){io[_0x3db7('0x14')](_0x3db7('0x15'),{'id':_0x39903f[_0x365cdc],'closed':!![]});}}})[_0x3db7('0x16')](function(_0x26bfb6){logger[_0x3db7('0x17')](_0x3db7('0x18'),_0x26bfb6?util[_0x3db7('0x19')](_0x26bfb6,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 10d7967..17c82bb 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1743=['now','CmContact','then','log','finished\x20populating','contacts1','CmHopper','destroy','bulkCreate','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com'];(function(_0x7ec937,_0xbe3b08){var _0x150040=function(_0x4a5d8e){while(--_0x4a5d8e){_0x7ec937['push'](_0x7ec937['shift']());}};_0x150040(++_0xbe3b08);}(_0x1743,0x1b1));var _0x3174=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1743[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x3174('0x0'));var db=require(_0x3174('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x3174('0x2')]({'id':i,'firstName':_0x3174('0x3')+i,'lastName':_0x3174('0x4')+i,'phone':0xf879fb460+i,'email':_0x3174('0x5')+i+_0x3174('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x3174('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3174('0x7')](),'updatedAt':Date[_0x3174('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x3174('0x3')+i,'lastName':_0x3174('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x3174('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3174('0x7')](),'updatedAt':Date[_0x3174('0x7')]()});}db[_0x3174('0x8')]['destroy']({'where':{}})[_0x3174('0x9')](function(){return db[_0x3174('0x8')]['bulkCreate'](contacts);})['then'](function(){console[_0x3174('0xa')](_0x3174('0xb'),_0x3174('0xc'));return db[_0x3174('0xd')][_0x3174('0xe')]({'where':{}});})[_0x3174('0x9')](function(){return db['CmHopper'][_0x3174('0xf')](hopper);})[_0x3174('0x9')](function(){console['log']('finished\x20populating',_0x3174('0x10'));return db[_0x3174('0x8')][_0x3174('0xf')](contacts2);})['then'](function(){console[_0x3174('0xa')]('finished\x20populating',_0x3174('0x11'));return db['CmHopper'][_0x3174('0xf')](hopper2);})[_0x3174('0x9')](function(){console['log'](_0x3174('0xb'),_0x3174('0x12'));})[_0x3174('0x13')](function(_0x4f9880){console[_0x3174('0xa')](_0x4f9880);}); \ No newline at end of file +var _0xd5f5=['innocenzo.biondo','@xcally.com','now','Biondo','CmContact','destroy','then','contacts1','CmHopper','log','finished\x20populating','hopper1','contacts2','bulkCreate','hopper2','catch','util','../mysqldb','Innocenzo'];(function(_0x223414,_0x2e7bf0){var _0x54841d=function(_0x5947fb){while(--_0x5947fb){_0x223414['push'](_0x223414['shift']());}};_0x54841d(++_0x2e7bf0);}(_0xd5f5,0x82));var _0x5d5f=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xd5f5[_0x46698a];return _0x356db0;};'use strict';var util=require(_0x5d5f('0x0'));var db=require(_0x5d5f('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x5d5f('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x5d5f('0x3')+i+_0x5d5f('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x5d5f('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5d5f('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x5d5f('0x6')+i,'phone':0xf879fb460+i,'email':_0x5d5f('0x3')+i+_0x5d5f('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x5d5f('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5d5f('0x5')](),'updatedAt':Date[_0x5d5f('0x5')]()});}db[_0x5d5f('0x7')][_0x5d5f('0x8')]({'where':{}})[_0x5d5f('0x9')](function(){return db[_0x5d5f('0x7')]['bulkCreate'](contacts);})[_0x5d5f('0x9')](function(){console['log']('finished\x20populating',_0x5d5f('0xa'));return db['CmHopper'][_0x5d5f('0x8')]({'where':{}});})[_0x5d5f('0x9')](function(){return db[_0x5d5f('0xb')]['bulkCreate'](hopper);})[_0x5d5f('0x9')](function(){console[_0x5d5f('0xc')](_0x5d5f('0xd'),_0x5d5f('0xe'));return db['CmContact']['bulkCreate'](contacts2);})[_0x5d5f('0x9')](function(){console['log'](_0x5d5f('0xd'),_0x5d5f('0xf'));return db['CmHopper'][_0x5d5f('0x10')](hopper2);})[_0x5d5f('0x9')](function(){console[_0x5d5f('0xc')](_0x5d5f('0xd'),_0x5d5f('0x11'));})[_0x5d5f('0x12')](function(_0x1c8ab8){console['log'](_0x1c8ab8);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 6e85367..d8bdea2 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x779e=['agent','format','%s%s@xcally.com','password','friend','udp','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','%s%s'];(function(_0x365072,_0x16f68c){var _0x5cdc5b=function(_0x50da5a){while(--_0x50da5a){_0x365072['push'](_0x365072['shift']());}};_0x5cdc5b(++_0x16f68c);}(_0x779e,0x1f4));var _0xe779=function(_0xfe26da,_0x5ac1b7){_0xfe26da=_0xfe26da-0x0;var _0x2abe6e=_0x779e[_0xfe26da];return _0x2abe6e;};'use strict';var util=require(_0xe779('0x0'));var db=require(_0xe779('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xe779('0x2')]({'name':util['format'](_0xe779('0x3'),_0xe779('0x4'),i),'fullname':util[_0xe779('0x5')](_0xe779('0x3'),_0xe779('0x4'),i),'email':util[_0xe779('0x5')](_0xe779('0x6'),_0xe779('0x4'),i),'role':'agent','password':_0xe779('0x7'),'internal':0xfa0+i,'type':_0xe779('0x8'),'transport':[_0xe779('0x9'),'ws','wss'],'disallow':['all'],'allow':[_0xe779('0xa')],'defaultuser':util['format']('%s%s',_0xe779('0x4'),i),'encryption':_0xe779('0xb'),'avpf':_0xe779('0xb'),'force_avp':'yes','icesupport':_0xe779('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xe779('0xc'),'dtlsprivatekey':_0xe779('0xd'),'dtlssetup':_0xe779('0xe'),'callerid':util[_0xe779('0x5')]('\x22%s\x22\x20<%s>',util[_0xe779('0x5')](_0xe779('0x3'),_0xe779('0x4'),i),0xfa0+i)});}db[_0xe779('0xf')][_0xe779('0x10')](users)[_0xe779('0x11')](function(){console[_0xe779('0x12')](_0xe779('0x13'));})[_0xe779('0x14')](function(_0x2baabb){console[_0xe779('0x12')](_0x2baabb);}); \ No newline at end of file +var _0xf0f5=['catch','log','util','../mysqldb','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','add\x20user'];(function(_0x4ad0f7,_0x1920b0){var _0x30f5c8=function(_0x2aa6b6){while(--_0x2aa6b6){_0x4ad0f7['push'](_0x4ad0f7['shift']());}};_0x30f5c8(++_0x1920b0);}(_0xf0f5,0x13d));var _0x5f0f=function(_0x2c9b13,_0x4fa585){_0x2c9b13=_0x2c9b13-0x0;var _0x351b56=_0xf0f5[_0x2c9b13];return _0x351b56;};'use strict';var util=require(_0x5f0f('0x0'));var db=require(_0x5f0f('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x5f0f('0x2')](_0x5f0f('0x3'),_0x5f0f('0x4'),i),'fullname':util[_0x5f0f('0x2')](_0x5f0f('0x3'),_0x5f0f('0x4'),i),'email':util[_0x5f0f('0x2')](_0x5f0f('0x5'),_0x5f0f('0x4'),i),'role':_0x5f0f('0x4'),'password':_0x5f0f('0x6'),'internal':0xfa0+i,'type':_0x5f0f('0x7'),'transport':[_0x5f0f('0x8'),'ws','wss'],'disallow':[_0x5f0f('0x9')],'allow':[_0x5f0f('0xa')],'defaultuser':util[_0x5f0f('0x2')](_0x5f0f('0x3'),'agent',i),'encryption':_0x5f0f('0xb'),'avpf':_0x5f0f('0xb'),'force_avp':_0x5f0f('0xb'),'icesupport':_0x5f0f('0xb'),'dtlsenable':_0x5f0f('0xb'),'dtlsverify':'no','dtlscertfile':_0x5f0f('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x5f0f('0xd'),'callerid':util[_0x5f0f('0x2')](_0x5f0f('0xe'),util['format']('%s%s',_0x5f0f('0x4'),i),0xfa0+i)});}db[_0x5f0f('0xf')][_0x5f0f('0x10')](users)[_0x5f0f('0x11')](function(){console['log'](_0x5f0f('0x12'));})[_0x5f0f('0x13')](function(_0x158e0c){console[_0x5f0f('0x14')](_0x158e0c);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index ae8e377..234b680 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57ef=['user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','default','connection','address','remoteAddress','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','ivr','UserProfileSection','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','type','format','%s:queue:%s','length','handshake','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','admin','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:inbound','voice:outbound','WhatsappQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','user:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions'];(function(_0x3a7ab8,_0x35dbf3){var _0x2734fa=function(_0x14b78e){while(--_0x14b78e){_0x3a7ab8['push'](_0x3a7ab8['shift']());}};_0x2734fa(++_0x35dbf3);}(_0x57ef,0xdb));var _0xf57e=function(_0x3f71b2,_0x1ef8ca){_0x3f71b2=_0x3f71b2-0x0;var _0x53a14f=_0x57ef[_0x3f71b2];return _0x53a14f;};'use strict';var _=require('lodash');var util=require(_0xf57e('0x0'));var BPromise=require(_0xf57e('0x1'));var db=require(_0xf57e('0x2'))['db'];var config=require(_0xf57e('0x3'));var queryQueues={'attributes':['id',_0xf57e('0x4')],'include':[{'as':_0xf57e('0x5'),'model':db[_0xf57e('0x6')],'attributes':['id','name',_0xf57e('0x7')],'raw':!![],'where':{'role':_0xf57e('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xf57e('0x4')],'where':{'role':_0xf57e('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xf57e('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xf57e('0x4')],'where':{'role':_0xf57e('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xf57e('0x4'),'type'],'where':{'type':_0xf57e('0xa')}};function getAssociatedResources(_0x4601c7,_0x46200c,_0x2430b1){return db[_0xf57e('0xb')]['findOne']({'where':{'name':_0x4601c7,'userProfileId':_0x46200c},'raw':!![]})[_0xf57e('0xc')](function(_0x99db89){if(_0x99db89){if(_0x99db89['autoAssociation']){switch(_0x4601c7){case _0xf57e('0xd'):case _0xf57e('0xe'):case _0xf57e('0xf'):case _0xf57e('0x10'):case _0xf57e('0x11'):case _0xf57e('0x12'):case'WhatsappQueues':return db[_0x2430b1][_0xf57e('0x13')](queryQueues);case _0xf57e('0x14'):return db[_0x2430b1][_0xf57e('0x13')](queryTelephones);case _0xf57e('0x15'):return db[_0x2430b1][_0xf57e('0x13')](queryTrunks);case _0xf57e('0x16'):return db[_0x2430b1][_0xf57e('0x13')](queryCampaigns);}}else{return db[_0xf57e('0x17')][_0xf57e('0x13')]({'attributes':[_0xf57e('0x18')],'where':{'sectionId':_0x99db89['id']},'raw':!![]})[_0xf57e('0xc')](function(_0x2a6ff7){if(_0x2a6ff7){var _0x3bf629={'where':{'id':_[_0xf57e('0x19')](_0x2a6ff7,_0xf57e('0x18'))},'raw':!![]};switch(_0x2430b1){case _0xf57e('0x6'):_0x3bf629[_0xf57e('0x1a')][_0xf57e('0x7')]=_0xf57e('0x9');break;case _0xf57e('0x1b'):_0x3bf629[_0xf57e('0x1a')][_0xf57e('0x1c')]='ivr';break;}return db[_0x2430b1]['findAll'](_0x3bf629);}else{return[];}});}}else{return[];}})[_0xf57e('0xc')](function(_0x48c77e){return _0x48c77e;});}function joinOrLeaveQueues(_0x3100ce,_0x4e84a7,_0x5ada9b,_0x254ef0){_0x3100ce[_0x4e84a7](util[_0xf57e('0x1d')](_0xf57e('0x1e'),_0x5ada9b,_0x254ef0['name']));if(_0x254ef0[_0xf57e('0x5')]){for(var _0x582ca5=0x0;_0x582ca5<_0x254ef0[_0xf57e('0x5')][_0xf57e('0x1f')];_0x582ca5+=0x1){_0x3100ce[_0x4e84a7](util['format']('user:%s',_0x254ef0[_0xf57e('0x5')][_0x582ca5][_0xf57e('0x4')]));}}}function joinOrLeave(_0x1d905b,_0x297b2f,_0x5d0f7f){var _0x134557;if(_0x1d905b[_0xf57e('0x20')]['query']['id']){db[_0xf57e('0x6')][_0xf57e('0x21')]({'attributes':['id',_0xf57e('0x4'),_0xf57e('0x7'),_0xf57e('0x22')],'where':{'id':_0x1d905b[_0xf57e('0x20')]['query']['id']},'include':[{'model':db[_0xf57e('0x23')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xf57e('0x24')],'as':_0xf57e('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xf57e('0x26')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xf57e('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xf57e('0x28')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xf57e('0x29')],'as':_0xf57e('0x2a'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x545f45){if(_0x545f45){_0x134557=_0x545f45;_0x1d905b[_0x297b2f](util[_0xf57e('0x1d')]('user:%s',_0x545f45[_0xf57e('0x4')]));var _0x40831e=[];switch(_0x545f45[_0xf57e('0x7')]){case _0xf57e('0x2b'):_0x1d905b[_0x297b2f]('voice:inbound');_0x1d905b[_0x297b2f]('voice:outbound');if(queryQueues[_0xf57e('0x2c')]('include')){delete queryQueues[_0xf57e('0x2d')];}_0x40831e[_0xf57e('0x2e')](db[_0xf57e('0x2f')]['findAll'](queryQueues));_0x40831e[_0xf57e('0x2e')](db[_0xf57e('0x30')]['findAll'](queryQueues));_0x40831e['push'](db[_0xf57e('0x31')]['findAll'](queryQueues));_0x40831e[_0xf57e('0x2e')](db[_0xf57e('0x32')]['findAll'](queryQueues));_0x40831e['push'](db[_0xf57e('0x33')][_0xf57e('0x13')](queryQueues));_0x40831e[_0xf57e('0x2e')](db[_0xf57e('0x34')]['findAll'](queryQueues));_0x40831e['push'](db[_0xf57e('0x35')][_0xf57e('0x13')](queryQueues));_0x40831e[_0xf57e('0x2e')](db[_0xf57e('0x6')][_0xf57e('0x13')](queryTelephones));_0x40831e['push'](db[_0xf57e('0x36')]['findAll'](queryTrunks));_0x40831e['push'](db[_0xf57e('0x1b')]['findAll'](queryCampaigns));_0x40831e[_0xf57e('0x2e')](db[_0xf57e('0x6')]['findAll'](queryAgents));break;case _0xf57e('0x37'):_0x1d905b[_0x297b2f](_0xf57e('0x38'));_0x1d905b[_0x297b2f](_0xf57e('0x39'));_0x40831e[_0xf57e('0x2e')](getAssociatedResources(_0xf57e('0xd'),_0x545f45[_0xf57e('0x22')],_0xf57e('0x2f')));_0x40831e[_0xf57e('0x2e')](getAssociatedResources(_0xf57e('0xe'),_0x545f45[_0xf57e('0x22')],_0xf57e('0x30')));_0x40831e[_0xf57e('0x2e')](getAssociatedResources(_0xf57e('0xf'),_0x545f45[_0xf57e('0x22')],'FaxQueue'));_0x40831e[_0xf57e('0x2e')](getAssociatedResources('SmsQueues',_0x545f45['userProfileId'],'SmsQueue'));_0x40831e[_0xf57e('0x2e')](getAssociatedResources(_0xf57e('0x11'),_0x545f45['userProfileId'],'MailQueue'));_0x40831e['push'](getAssociatedResources(_0xf57e('0x12'),_0x545f45[_0xf57e('0x22')],_0xf57e('0x34')));_0x40831e[_0xf57e('0x2e')](getAssociatedResources(_0xf57e('0x3a'),_0x545f45['userProfileId'],_0xf57e('0x35')));_0x40831e[_0xf57e('0x2e')](getAssociatedResources(_0xf57e('0x14'),_0x545f45['userProfileId'],_0xf57e('0x6')));_0x40831e['push'](getAssociatedResources('Trunks',_0x545f45['userProfileId'],_0xf57e('0x36')));_0x40831e[_0xf57e('0x2e')](getAssociatedResources(_0xf57e('0x16'),_0x545f45['userProfileId'],'Campaign'));_0x40831e['push'](db[_0xf57e('0x6')][_0xf57e('0x13')](queryAgents));break;case'agent':_0x1d905b[_0x297b2f](_0xf57e('0x38'));_0x1d905b[_0x297b2f](_0xf57e('0x39'));_0x40831e[_0xf57e('0x2e')](_0x545f45[_0xf57e('0x3b')]({'attributes':['id',_0xf57e('0x4')]}));_0x40831e['push'](_0x545f45[_0xf57e('0x3c')]({'attributes':['id','name']}));_0x40831e['push'](_0x545f45[_0xf57e('0x3d')]({'attributes':['id',_0xf57e('0x4')]}));_0x40831e[_0xf57e('0x2e')](_0x545f45[_0xf57e('0x3e')]({'attributes':['id',_0xf57e('0x4')]}));_0x40831e['push'](_0x545f45['getMailQueues']({'attributes':['id',_0xf57e('0x4')]}));_0x40831e[_0xf57e('0x2e')](_0x545f45[_0xf57e('0x3f')]({'attributes':['id',_0xf57e('0x4')]}));_0x40831e[_0xf57e('0x2e')](_0x545f45[_0xf57e('0x40')]({'attributes':['id','name']}));break;}return BPromise[_0xf57e('0x41')](_0x40831e);}})[_0xf57e('0xc')](function(_0xb90c4e){if(_0xb90c4e&&_0xb90c4e[_0xf57e('0x1f')]){for(var _0x38304e=0x0;_0x38304e<_0xb90c4e[_0xf57e('0x1f')];_0x38304e+=0x1){for(var _0x49ecad=0x0;_0x49ecad<_0xb90c4e[_0x38304e][_0xf57e('0x1f')];_0x49ecad+=0x1){switch(_0x38304e){case 0x0:joinOrLeaveQueues(_0x1d905b,_0x297b2f,'voice',_0xb90c4e[_0x38304e][_0x49ecad]);break;case 0x1:joinOrLeaveQueues(_0x1d905b,_0x297b2f,_0xf57e('0x42'),_0xb90c4e[_0x38304e][_0x49ecad]);break;case 0x2:joinOrLeaveQueues(_0x1d905b,_0x297b2f,_0xf57e('0x43'),_0xb90c4e[_0x38304e][_0x49ecad]);break;case 0x3:joinOrLeaveQueues(_0x1d905b,_0x297b2f,'sms',_0xb90c4e[_0x38304e][_0x49ecad]);break;case 0x4:joinOrLeaveQueues(_0x1d905b,_0x297b2f,_0xf57e('0x44'),_0xb90c4e[_0x38304e][_0x49ecad]);break;case 0x5:joinOrLeaveQueues(_0x1d905b,_0x297b2f,_0xf57e('0x45'),_0xb90c4e[_0x38304e][_0x49ecad]);break;case 0x6:joinOrLeaveQueues(_0x1d905b,_0x297b2f,_0xf57e('0x46'),_0xb90c4e[_0x38304e][_0x49ecad]);break;case 0x7:if(_0x134557[_0xf57e('0x7')]!==_0xf57e('0x8'))_0x1d905b[_0x297b2f](util[_0xf57e('0x1d')](_0xf57e('0x47'),_0xb90c4e[_0x38304e][_0x49ecad][_0xf57e('0x4')]));break;case 0x8:if(_0x134557['role']!==_0xf57e('0x8'))_0x1d905b[_0x297b2f](util[_0xf57e('0x1d')](_0xf57e('0x48'),_0xb90c4e[_0x38304e][_0x49ecad][_0xf57e('0x4')]));break;case 0x9:if(_0x134557[_0xf57e('0x7')]!==_0xf57e('0x8'))_0x1d905b[_0x297b2f](util['format'](_0xf57e('0x49'),_0xb90c4e[_0x38304e][_0x49ecad][_0xf57e('0x1c')],_0xb90c4e[_0x38304e][_0x49ecad][_0xf57e('0x4')]));break;case 0xa:_0x1d905b[_0x297b2f](util[_0xf57e('0x1d')](_0xf57e('0x4a'),_0xb90c4e[_0x38304e][_0x49ecad][_0xf57e('0x4')]));break;}}}}})['then'](function(){if(_0x297b2f===_0xf57e('0x4b')){var _0x202628=_[_0xf57e('0x19')](_0x134557['ChatInteractions'],'id');return _0x134557[_0xf57e('0x4c')](_0x202628)['then'](function(){for(var _0x4caf38=0x0;_0x4caf38<_0x202628[_0xf57e('0x1f')];_0x4caf38+=0x1){_0x5d0f7f[_0xf57e('0x4d')](_0xf57e('0x4e'),{'ChatInteractionId':Number(_0x202628[_0x4caf38]),'UserId':Number(_0x134557['id'])});}});}})[_0xf57e('0xc')](function(){if(_0x297b2f===_0xf57e('0x4b')){var _0x2d31f1=_[_0xf57e('0x19')](_0x134557[_0xf57e('0x25')],'id');return _0x134557['removeMailInteractions'](_0x2d31f1)[_0xf57e('0xc')](function(){for(var _0x2a8edb=0x0;_0x2a8edb<_0x2d31f1[_0xf57e('0x1f')];_0x2a8edb+=0x1){_0x5d0f7f[_0xf57e('0x4d')](_0xf57e('0x4f'),{'MailInteractionId':Number(_0x2d31f1[_0x2a8edb]),'UserId':Number(_0x134557['id'])});}});}})[_0xf57e('0xc')](function(){if(_0x297b2f===_0xf57e('0x4b')){var _0x185d5e=_[_0xf57e('0x19')](_0x134557[_0xf57e('0x50')],'id');return _0x134557[_0xf57e('0x51')](_0x185d5e)[_0xf57e('0xc')](function(){for(var _0x14b567=0x0;_0x14b567<_0x185d5e[_0xf57e('0x1f')];_0x14b567+=0x1){_0x5d0f7f[_0xf57e('0x4d')](_0xf57e('0x52'),{'FaxInteractionId':Number(_0x185d5e[_0x14b567]),'UserId':Number(_0x134557['id'])});}});}})['then'](function(){if(_0x297b2f==='leave'){var _0x151f70=_[_0xf57e('0x19')](_0x134557[_0xf57e('0x27')],'id');return _0x134557[_0xf57e('0x53')](_0x151f70)['then'](function(){for(var _0x9bd532=0x0;_0x9bd532<_0x151f70['length'];_0x9bd532+=0x1){_0x5d0f7f['emit'](_0xf57e('0x54'),{'SmsInteractionId':Number(_0x151f70[_0x9bd532]),'UserId':Number(_0x134557['id'])});}});}})[_0xf57e('0xc')](function(){if(_0x297b2f==='leave'){var _0x47750a=_[_0xf57e('0x19')](_0x134557[_0xf57e('0x55')],'id');return _0x134557[_0xf57e('0x56')](_0x47750a)[_0xf57e('0xc')](function(){for(var _0x8dd24f=0x0;_0x8dd24f<_0x47750a[_0xf57e('0x1f')];_0x8dd24f+=0x1){_0x5d0f7f[_0xf57e('0x4d')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x47750a[_0x8dd24f]),'UserId':Number(_0x134557['id'])});}});}})[_0xf57e('0xc')](function(){if(_0x297b2f===_0xf57e('0x4b')){var _0x539b41=_['map'](_0x134557[_0xf57e('0x2a')],'id');return _0x134557[_0xf57e('0x57')](_0x539b41)['then'](function(){for(var _0x2bfbdc=0x0;_0x2bfbdc<_0x539b41[_0xf57e('0x1f')];_0x2bfbdc+=0x1){_0x5d0f7f['emit'](_0xf57e('0x58'),{'WhatsappInteractionId':Number(_0x539b41[_0x2bfbdc]),'UserId':Number(_0x134557['id'])});}});}})[_0xf57e('0x59')](function(_0x230361){_0x1d905b[_0xf57e('0x5a')](_0x230361);});}}function onDisconnect(_0x13a349,_0x5a63a2){joinOrLeave(_0x13a349,'leave',_0x5a63a2);}function onConnect(_0x2aadb8){joinOrLeave(_0x2aadb8,'join');}exports[_0xf57e('0x5b')]=function(_0xf9d739){_0xf9d739['on'](_0xf57e('0x5c'),function(_0x4113eb){_0x4113eb['setMaxListeners'](0x0);_0x4113eb[_0xf57e('0x5d')]=_0x4113eb['request'][_0xf57e('0x5c')][_0xf57e('0x5e')]+':'+_0x4113eb['request'][_0xf57e('0x5c')]['remotePort'];_0x4113eb[_0xf57e('0x5f')]=new Date();_0x4113eb['log']=function(_0x12766e){console[_0xf57e('0x5a')](_0xf57e('0x60')+_0x4113eb[_0xf57e('0x61')][_0xf57e('0x4')]+'['+_0x4113eb[_0xf57e('0x5d')]+']',_0x12766e);};_0x4113eb['on'](_0xf57e('0x62'),function(){onDisconnect(_0x4113eb,_0xf9d739);_0x4113eb[_0xf57e('0x5a')](_0xf57e('0x63'));});onConnect(_0x4113eb);_0x4113eb['log'](_0xf57e('0x64'));});}; \ No newline at end of file +var _0x1a0e=['FaxInteractions','SmsInteraction','OpenchannelInteractions','WhatsappInteraction','admin','voice:outbound','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','VoiceQueues','ChatQueue','voice:inbound','getVoiceQueues','getOpenchannelQueues','getWhatsappQueues','all','length','fax','sms','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','map','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','default','setMaxListeners','request','connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','address','disconnect','DISCONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','telephone','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','User','where','role','Campaign','format','%s:queue:%s','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction'];(function(_0x272d8a,_0x45184b){var _0x26286e=function(_0x93beaa){while(--_0x93beaa){_0x272d8a['push'](_0x272d8a['shift']());}};_0x26286e(++_0x45184b);}(_0x1a0e,0x1c6));var _0xe1a0=function(_0x217483,_0x422422){_0x217483=_0x217483-0x0;var _0x37f8a4=_0x1a0e[_0x217483];return _0x37f8a4;};'use strict';var _=require(_0xe1a0('0x0'));var util=require(_0xe1a0('0x1'));var BPromise=require(_0xe1a0('0x2'));var db=require(_0xe1a0('0x3'))['db'];var config=require(_0xe1a0('0x4'));var queryQueues={'attributes':['id',_0xe1a0('0x5')],'include':[{'as':_0xe1a0('0x6'),'model':db['User'],'attributes':['id',_0xe1a0('0x5'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xe1a0('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0xe1a0('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xe1a0('0x5')],'where':{'role':_0xe1a0('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xe1a0('0x5'),_0xe1a0('0x9')],'where':{'type':_0xe1a0('0xa')}};function getAssociatedResources(_0x10d66a,_0x2f6bdc,_0x3cd4f4){return db[_0xe1a0('0xb')][_0xe1a0('0xc')]({'where':{'name':_0x10d66a,'userProfileId':_0x2f6bdc},'raw':!![]})[_0xe1a0('0xd')](function(_0x4f1099){if(_0x4f1099){if(_0x4f1099[_0xe1a0('0xe')]){switch(_0x10d66a){case'VoiceQueues':case _0xe1a0('0xf'):case _0xe1a0('0x10'):case _0xe1a0('0x11'):case _0xe1a0('0x12'):case _0xe1a0('0x13'):case _0xe1a0('0x14'):return db[_0x3cd4f4][_0xe1a0('0x15')](queryQueues);case _0xe1a0('0x16'):return db[_0x3cd4f4]['findAll'](queryTelephones);case _0xe1a0('0x17'):return db[_0x3cd4f4]['findAll'](queryTrunks);case _0xe1a0('0x18'):return db[_0x3cd4f4][_0xe1a0('0x15')](queryCampaigns);}}else{return db['UserProfileResource'][_0xe1a0('0x15')]({'attributes':[_0xe1a0('0x19')],'where':{'sectionId':_0x4f1099['id']},'raw':!![]})[_0xe1a0('0xd')](function(_0x4080fd){if(_0x4080fd){var _0x2255ae={'where':{'id':_['map'](_0x4080fd,_0xe1a0('0x19'))},'raw':!![]};switch(_0x3cd4f4){case _0xe1a0('0x1a'):_0x2255ae[_0xe1a0('0x1b')][_0xe1a0('0x1c')]=_0xe1a0('0x7');break;case _0xe1a0('0x1d'):_0x2255ae[_0xe1a0('0x1b')][_0xe1a0('0x9')]=_0xe1a0('0xa');break;}return db[_0x3cd4f4][_0xe1a0('0x15')](_0x2255ae);}else{return[];}});}}else{return[];}})[_0xe1a0('0xd')](function(_0xd02171){return _0xd02171;});}function joinOrLeaveQueues(_0x47ebf1,_0x4f8849,_0x5c3831,_0xc3dcb4){_0x47ebf1[_0x4f8849](util[_0xe1a0('0x1e')](_0xe1a0('0x1f'),_0x5c3831,_0xc3dcb4[_0xe1a0('0x5')]));if(_0xc3dcb4['Agents']){for(var _0xbcc33d=0x0;_0xbcc33d<_0xc3dcb4[_0xe1a0('0x6')]['length'];_0xbcc33d+=0x1){_0x47ebf1[_0x4f8849](util[_0xe1a0('0x1e')](_0xe1a0('0x20'),_0xc3dcb4['Agents'][_0xbcc33d][_0xe1a0('0x5')]));}}}function joinOrLeave(_0x29bdde,_0x8cd788,_0x15615f){var _0x180b77;if(_0x29bdde[_0xe1a0('0x21')][_0xe1a0('0x22')]['id']){db[_0xe1a0('0x1a')]['find']({'attributes':['id',_0xe1a0('0x5'),_0xe1a0('0x1c'),_0xe1a0('0x23')],'where':{'id':_0x29bdde[_0xe1a0('0x21')][_0xe1a0('0x22')]['id']},'include':[{'model':db[_0xe1a0('0x24')],'as':_0xe1a0('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xe1a0('0x26')],'as':_0xe1a0('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xe1a0('0x28')],'as':_0xe1a0('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xe1a0('0x2a')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xe1a0('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0xe1a0('0x2c')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0xe1a0('0xd')](function(_0x177337){if(_0x177337){_0x180b77=_0x177337;_0x29bdde[_0x8cd788](util[_0xe1a0('0x1e')]('user:%s',_0x177337[_0xe1a0('0x5')]));var _0x2aa1ea=[];switch(_0x177337[_0xe1a0('0x1c')]){case _0xe1a0('0x2d'):_0x29bdde[_0x8cd788]('voice:inbound');_0x29bdde[_0x8cd788](_0xe1a0('0x2e'));if(queryQueues['hasOwnProperty'](_0xe1a0('0x2f'))){delete queryQueues['include'];}_0x2aa1ea[_0xe1a0('0x30')](db[_0xe1a0('0x31')][_0xe1a0('0x15')](queryQueues));_0x2aa1ea[_0xe1a0('0x30')](db['ChatQueue']['findAll'](queryQueues));_0x2aa1ea[_0xe1a0('0x30')](db[_0xe1a0('0x32')][_0xe1a0('0x15')](queryQueues));_0x2aa1ea[_0xe1a0('0x30')](db[_0xe1a0('0x33')][_0xe1a0('0x15')](queryQueues));_0x2aa1ea[_0xe1a0('0x30')](db[_0xe1a0('0x34')]['findAll'](queryQueues));_0x2aa1ea['push'](db[_0xe1a0('0x35')][_0xe1a0('0x15')](queryQueues));_0x2aa1ea[_0xe1a0('0x30')](db[_0xe1a0('0x36')][_0xe1a0('0x15')](queryQueues));_0x2aa1ea[_0xe1a0('0x30')](db[_0xe1a0('0x1a')][_0xe1a0('0x15')](queryTelephones));_0x2aa1ea[_0xe1a0('0x30')](db[_0xe1a0('0x37')][_0xe1a0('0x15')](queryTrunks));_0x2aa1ea[_0xe1a0('0x30')](db[_0xe1a0('0x1d')][_0xe1a0('0x15')](queryCampaigns));_0x2aa1ea[_0xe1a0('0x30')](db[_0xe1a0('0x1a')][_0xe1a0('0x15')](queryAgents));break;case _0xe1a0('0x38'):_0x29bdde[_0x8cd788]('voice:inbound');_0x29bdde[_0x8cd788](_0xe1a0('0x2e'));_0x2aa1ea[_0xe1a0('0x30')](getAssociatedResources(_0xe1a0('0x39'),_0x177337[_0xe1a0('0x23')],_0xe1a0('0x31')));_0x2aa1ea[_0xe1a0('0x30')](getAssociatedResources(_0xe1a0('0xf'),_0x177337[_0xe1a0('0x23')],_0xe1a0('0x3a')));_0x2aa1ea[_0xe1a0('0x30')](getAssociatedResources('FaxQueues',_0x177337[_0xe1a0('0x23')],'FaxQueue'));_0x2aa1ea['push'](getAssociatedResources(_0xe1a0('0x11'),_0x177337['userProfileId'],_0xe1a0('0x33')));_0x2aa1ea['push'](getAssociatedResources(_0xe1a0('0x12'),_0x177337['userProfileId'],_0xe1a0('0x34')));_0x2aa1ea[_0xe1a0('0x30')](getAssociatedResources(_0xe1a0('0x13'),_0x177337[_0xe1a0('0x23')],_0xe1a0('0x35')));_0x2aa1ea['push'](getAssociatedResources('WhatsappQueues',_0x177337[_0xe1a0('0x23')],_0xe1a0('0x36')));_0x2aa1ea[_0xe1a0('0x30')](getAssociatedResources(_0xe1a0('0x16'),_0x177337[_0xe1a0('0x23')],_0xe1a0('0x1a')));_0x2aa1ea[_0xe1a0('0x30')](getAssociatedResources(_0xe1a0('0x17'),_0x177337[_0xe1a0('0x23')],'Trunk'));_0x2aa1ea['push'](getAssociatedResources('IvrCampaigns',_0x177337[_0xe1a0('0x23')],_0xe1a0('0x1d')));_0x2aa1ea[_0xe1a0('0x30')](db[_0xe1a0('0x1a')]['findAll'](queryAgents));break;case _0xe1a0('0x8'):_0x29bdde[_0x8cd788](_0xe1a0('0x3b'));_0x29bdde[_0x8cd788](_0xe1a0('0x2e'));_0x2aa1ea['push'](_0x177337[_0xe1a0('0x3c')]({'attributes':['id',_0xe1a0('0x5')]}));_0x2aa1ea['push'](_0x177337['getChatQueues']({'attributes':['id',_0xe1a0('0x5')]}));_0x2aa1ea['push'](_0x177337['getFaxQueues']({'attributes':['id',_0xe1a0('0x5')]}));_0x2aa1ea[_0xe1a0('0x30')](_0x177337['getSmsQueues']({'attributes':['id',_0xe1a0('0x5')]}));_0x2aa1ea['push'](_0x177337['getMailQueues']({'attributes':['id',_0xe1a0('0x5')]}));_0x2aa1ea[_0xe1a0('0x30')](_0x177337[_0xe1a0('0x3d')]({'attributes':['id',_0xe1a0('0x5')]}));_0x2aa1ea[_0xe1a0('0x30')](_0x177337[_0xe1a0('0x3e')]({'attributes':['id',_0xe1a0('0x5')]}));break;}return BPromise[_0xe1a0('0x3f')](_0x2aa1ea);}})[_0xe1a0('0xd')](function(_0x5b938c){if(_0x5b938c&&_0x5b938c[_0xe1a0('0x40')]){for(var _0x1821b3=0x0;_0x1821b3<_0x5b938c['length'];_0x1821b3+=0x1){for(var _0x1e559d=0x0;_0x1e559d<_0x5b938c[_0x1821b3][_0xe1a0('0x40')];_0x1e559d+=0x1){switch(_0x1821b3){case 0x0:joinOrLeaveQueues(_0x29bdde,_0x8cd788,'voice',_0x5b938c[_0x1821b3][_0x1e559d]);break;case 0x1:joinOrLeaveQueues(_0x29bdde,_0x8cd788,'chat',_0x5b938c[_0x1821b3][_0x1e559d]);break;case 0x2:joinOrLeaveQueues(_0x29bdde,_0x8cd788,_0xe1a0('0x41'),_0x5b938c[_0x1821b3][_0x1e559d]);break;case 0x3:joinOrLeaveQueues(_0x29bdde,_0x8cd788,_0xe1a0('0x42'),_0x5b938c[_0x1821b3][_0x1e559d]);break;case 0x4:joinOrLeaveQueues(_0x29bdde,_0x8cd788,'mail',_0x5b938c[_0x1821b3][_0x1e559d]);break;case 0x5:joinOrLeaveQueues(_0x29bdde,_0x8cd788,_0xe1a0('0x43'),_0x5b938c[_0x1821b3][_0x1e559d]);break;case 0x6:joinOrLeaveQueues(_0x29bdde,_0x8cd788,_0xe1a0('0x44'),_0x5b938c[_0x1821b3][_0x1e559d]);break;case 0x7:if(_0x180b77[_0xe1a0('0x1c')]!==_0xe1a0('0x8'))_0x29bdde[_0x8cd788](util[_0xe1a0('0x1e')](_0xe1a0('0x45'),_0x5b938c[_0x1821b3][_0x1e559d][_0xe1a0('0x5')]));break;case 0x8:if(_0x180b77['role']!==_0xe1a0('0x8'))_0x29bdde[_0x8cd788](util[_0xe1a0('0x1e')](_0xe1a0('0x46'),_0x5b938c[_0x1821b3][_0x1e559d][_0xe1a0('0x5')]));break;case 0x9:if(_0x180b77['role']!==_0xe1a0('0x8'))_0x29bdde[_0x8cd788](util['format'](_0xe1a0('0x47'),_0x5b938c[_0x1821b3][_0x1e559d][_0xe1a0('0x9')],_0x5b938c[_0x1821b3][_0x1e559d][_0xe1a0('0x5')]));break;case 0xa:_0x29bdde[_0x8cd788](util['format'](_0xe1a0('0x20'),_0x5b938c[_0x1821b3][_0x1e559d][_0xe1a0('0x5')]));break;}}}}})[_0xe1a0('0xd')](function(){if(_0x8cd788==='leave'){var _0x1c0ee2=_[_0xe1a0('0x48')](_0x180b77[_0xe1a0('0x25')],'id');return _0x180b77[_0xe1a0('0x49')](_0x1c0ee2)['then'](function(){for(var _0x1b6660=0x0;_0x1b6660<_0x1c0ee2[_0xe1a0('0x40')];_0x1b6660+=0x1){_0x15615f[_0xe1a0('0x4a')](_0xe1a0('0x4b'),{'ChatInteractionId':Number(_0x1c0ee2[_0x1b6660]),'UserId':Number(_0x180b77['id'])});}});}})[_0xe1a0('0xd')](function(){if(_0x8cd788===_0xe1a0('0x4c')){var _0x1dc636=_['map'](_0x180b77[_0xe1a0('0x27')],'id');return _0x180b77['removeMailInteractions'](_0x1dc636)[_0xe1a0('0xd')](function(){for(var _0x2b051d=0x0;_0x2b051d<_0x1dc636[_0xe1a0('0x40')];_0x2b051d+=0x1){_0x15615f[_0xe1a0('0x4a')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x1dc636[_0x2b051d]),'UserId':Number(_0x180b77['id'])});}});}})[_0xe1a0('0xd')](function(){if(_0x8cd788===_0xe1a0('0x4c')){var _0x7b024d=_[_0xe1a0('0x48')](_0x180b77[_0xe1a0('0x29')],'id');return _0x180b77[_0xe1a0('0x4d')](_0x7b024d)[_0xe1a0('0xd')](function(){for(var _0x411292=0x0;_0x411292<_0x7b024d[_0xe1a0('0x40')];_0x411292+=0x1){_0x15615f[_0xe1a0('0x4a')](_0xe1a0('0x4e'),{'FaxInteractionId':Number(_0x7b024d[_0x411292]),'UserId':Number(_0x180b77['id'])});}});}})['then'](function(){if(_0x8cd788===_0xe1a0('0x4c')){var _0x19e6ba=_[_0xe1a0('0x48')](_0x180b77[_0xe1a0('0x4f')],'id');return _0x180b77[_0xe1a0('0x50')](_0x19e6ba)[_0xe1a0('0xd')](function(){for(var _0x3e2e35=0x0;_0x3e2e35<_0x19e6ba['length'];_0x3e2e35+=0x1){_0x15615f[_0xe1a0('0x4a')](_0xe1a0('0x51'),{'SmsInteractionId':Number(_0x19e6ba[_0x3e2e35]),'UserId':Number(_0x180b77['id'])});}});}})[_0xe1a0('0xd')](function(){if(_0x8cd788===_0xe1a0('0x4c')){var _0x4a4682=_[_0xe1a0('0x48')](_0x180b77[_0xe1a0('0x2b')],'id');return _0x180b77['removeOpenchannelInteractions'](_0x4a4682)[_0xe1a0('0xd')](function(){for(var _0x34ef38=0x0;_0x34ef38<_0x4a4682[_0xe1a0('0x40')];_0x34ef38+=0x1){_0x15615f[_0xe1a0('0x4a')](_0xe1a0('0x52'),{'OpenchannelInteractionId':Number(_0x4a4682[_0x34ef38]),'UserId':Number(_0x180b77['id'])});}});}})['then'](function(){if(_0x8cd788===_0xe1a0('0x4c')){var _0x3f1bc2=_[_0xe1a0('0x48')](_0x180b77[_0xe1a0('0x53')],'id');return _0x180b77[_0xe1a0('0x54')](_0x3f1bc2)[_0xe1a0('0xd')](function(){for(var _0x49cd10=0x0;_0x49cd10<_0x3f1bc2[_0xe1a0('0x40')];_0x49cd10+=0x1){_0x15615f[_0xe1a0('0x4a')](_0xe1a0('0x55'),{'WhatsappInteractionId':Number(_0x3f1bc2[_0x49cd10]),'UserId':Number(_0x180b77['id'])});}});}})['catch'](function(_0x53e532){_0x29bdde[_0xe1a0('0x56')](_0x53e532);});}}function onDisconnect(_0x36024a,_0x380b26){joinOrLeave(_0x36024a,_0xe1a0('0x4c'),_0x380b26);}function onConnect(_0x5b4bd2){joinOrLeave(_0x5b4bd2,'join');}exports[_0xe1a0('0x57')]=function(_0x399e06){_0x399e06['on']('connection',function(_0x59133a){_0x59133a[_0xe1a0('0x58')](0x0);_0x59133a['address']=_0x59133a[_0xe1a0('0x59')][_0xe1a0('0x5a')][_0xe1a0('0x5b')]+':'+_0x59133a[_0xe1a0('0x59')][_0xe1a0('0x5a')][_0xe1a0('0x5c')];_0x59133a[_0xe1a0('0x5d')]=new Date();_0x59133a[_0xe1a0('0x56')]=function(_0x12c6d8){console[_0xe1a0('0x56')](_0xe1a0('0x5e')+_0x59133a[_0xe1a0('0x5f')][_0xe1a0('0x5')]+'['+_0x59133a[_0xe1a0('0x60')]+']',_0x12c6d8);};_0x59133a['on'](_0xe1a0('0x61'),function(){onDisconnect(_0x59133a,_0x399e06);_0x59133a[_0xe1a0('0x56')](_0xe1a0('0x62'));});onConnect(_0x59133a);_0x59133a['log']('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 82fdbf7..7caecec 100644 --- a/server/config/triggers/index.js +++ b/server/config/triggers/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7c4=['Sms','SmsInteraction','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','then','Trigger,\x20%s','error','code','catch','channel','motionChannel','direction','ContactId','undefined','query','Sequelize','QueryTypes','SELECT','UserId','interface','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','get','event','offlineMessage','opened','resolve','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','contact','format','changed','closed','substatus','SIP/%s','AfterUpdate','User','find','fullname','email','internal','default','length','model','hook','callback','condition','util','../../mysqldb','jayson/promise','../logger','triggers','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','closedinteraction','ChatMessage','newmessage'];(function(_0x2d994d,_0x168a27){var _0xd54be4=function(_0x1db925){while(--_0x1db925){_0x2d994d['push'](_0x2d994d['shift']());}};_0xd54be4(++_0x168a27);}(_0xf7c4,0x160));var _0x4f7c=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xf7c4[_0xbca1b1];return _0x4e1686;};'use strict';var util=require(_0x4f7c('0x0'));var db=require(_0x4f7c('0x1'))['db'];var jayson=require(_0x4f7c('0x2'));var logger=require(_0x4f7c('0x3'))(_0x4f7c('0x4'));var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x4f7c('0x5'),'event':_0x4f7c('0x6'),'condition':_0x4f7c('0x7'),'callback':afterCreate},{'channel':_0x4f7c('0x8'),'model':_0x4f7c('0x5'),'event':_0x4f7c('0x9'),'condition':_0x4f7c('0xa'),'callback':afterUpdate},{'channel':'Chat','model':_0x4f7c('0xb'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x4f7c('0x8'),'model':'ChatOfflineMessage','event':_0x4f7c('0x6'),'condition':_0x4f7c('0xc'),'callback':afterCreateOfflineMessage},{'channel':_0x4f7c('0xd'),'model':'SmsInteraction','event':_0x4f7c('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x4f7c('0xd'),'model':_0x4f7c('0xe'),'event':_0x4f7c('0x9'),'condition':_0x4f7c('0xa'),'callback':afterUpdate},{'channel':_0x4f7c('0xd'),'model':'SmsMessage','event':_0x4f7c('0x6'),'condition':_0x4f7c('0xc'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0x4f7c('0x6'),'condition':_0x4f7c('0x7'),'callback':afterCreate},{'channel':_0x4f7c('0xf'),'model':_0x4f7c('0x10'),'event':_0x4f7c('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x4f7c('0xf'),'model':_0x4f7c('0x11'),'event':'afterCreate','condition':_0x4f7c('0xc'),'callback':afterCreateMessage},{'channel':_0x4f7c('0x12'),'model':_0x4f7c('0x13'),'event':_0x4f7c('0x6'),'condition':_0x4f7c('0x7'),'callback':afterCreate},{'channel':_0x4f7c('0x12'),'model':_0x4f7c('0x13'),'event':_0x4f7c('0x9'),'condition':_0x4f7c('0xa'),'callback':afterUpdate},{'channel':_0x4f7c('0x12'),'model':_0x4f7c('0x14'),'event':_0x4f7c('0x6'),'condition':_0x4f7c('0xc'),'callback':afterCreateMessage},{'channel':_0x4f7c('0x15'),'model':_0x4f7c('0x16'),'event':_0x4f7c('0x6'),'condition':_0x4f7c('0x7'),'callback':afterCreate},{'channel':'Mail','model':_0x4f7c('0x16'),'event':_0x4f7c('0x9'),'condition':_0x4f7c('0xa'),'callback':afterUpdate},{'channel':_0x4f7c('0x15'),'model':'MailMessage','event':_0x4f7c('0x6'),'condition':_0x4f7c('0xc'),'callback':afterCreateMessage},{'channel':_0x4f7c('0x17'),'model':'OpenchannelInteraction','event':_0x4f7c('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x4f7c('0x17'),'model':_0x4f7c('0x18'),'event':_0x4f7c('0x9'),'condition':_0x4f7c('0xa'),'callback':afterUpdate},{'channel':_0x4f7c('0x17'),'model':_0x4f7c('0x19'),'event':_0x4f7c('0x6'),'condition':_0x4f7c('0xc'),'callback':afterCreateMessage}];function request(_0xd6c846){return client['request'](_0x4f7c('0x1a'),_0xd6c846)[_0x4f7c('0x1b')](function(_0x1cd296){logger['info'](_0x4f7c('0x1c'),_0x4f7c('0x1a'),_0x1cd296);if(_0x1cd296[_0x4f7c('0x1d')]){if(_0x1cd296[_0x4f7c('0x1d')][_0x4f7c('0x1e')]===0x1f4){logger['error']('Trigger,\x20%s',_0x4f7c('0x1a'),_0x1cd296[_0x4f7c('0x1d')]);}}})[_0x4f7c('0x1f')](function(_0x37ece8){logger[_0x4f7c('0x1d')]('Trigger,\x20%s',_0x4f7c('0x1a'),_0x37ece8);});}function afterCreateMessage(_0x22db6e){return function(_0xa4846b){_0xa4846b=_0xa4846b['get']({'plain':!![]});_0xa4846b[_0x4f7c('0x20')]=_0x22db6e;_0xa4846b[_0x4f7c('0x21')]=_0x22db6e;_0xa4846b['event']=_0xa4846b[_0x4f7c('0x22')];Promise['resolve']()[_0x4f7c('0x1b')](function(){if(typeof _0xa4846b[_0x4f7c('0x23')]===_0x4f7c('0x24'))return null;var _0x511638='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xa4846b[_0x4f7c('0x23')];return db['sequelize'][_0x4f7c('0x25')](_0x511638,{'type':db[_0x4f7c('0x26')][_0x4f7c('0x27')][_0x4f7c('0x28')],'raw':!![]});})['then'](function(_0x5cf69c){if(_0x5cf69c){_0xa4846b['contact']=_0x5cf69c[0x0];}if(typeof _0xa4846b[_0x4f7c('0x29')]===_0x4f7c('0x24'))return;return getAgent(_0xa4846b['UserId']);})[_0x4f7c('0x1b')](function(_0x2f3282){if(_0x2f3282){_0xa4846b[_0x4f7c('0x2a')]=util['format']('SIP/%s',_0x2f3282[_0x4f7c('0x2b')]);_0xa4846b[_0x4f7c('0x2c')]=_0x2f3282;_0xa4846b[_0x4f7c('0x20')]=_0x22db6e;return request({'event':_0x4f7c('0x2d'),'message':_0xa4846b});}else{return request({'event':_0x4f7c('0x2e'),'message':_0xa4846b});}})[_0x4f7c('0x1f')](function(_0x7615cc){logger['error'](_0x4f7c('0x1c'),_0x4f7c('0x2f'),_0x7615cc);});};}function afterCreateOfflineMessage(_0x4f8e74){return function(_0xc90fcf){_0xc90fcf=_0xc90fcf[_0x4f7c('0x30')]({'plain':!![]});_0xc90fcf[_0x4f7c('0x20')]=_0x4f8e74;_0xc90fcf[_0x4f7c('0x21')]=_0x4f8e74;_0xc90fcf[_0x4f7c('0x31')]=_0x4f7c('0x32');return request({'event':_0xc90fcf[_0x4f7c('0x31')],'message':_0xc90fcf});};}function afterCreate(_0x335b12,_0x1fe377){return function(_0x403695){_0x403695=_0x403695[_0x4f7c('0x30')]({'plain':!![]});_0x403695['channel']=_0x335b12;_0x403695[_0x4f7c('0x21')]=_0x335b12;_0x403695[_0x4f7c('0x31')]=_0x4f7c('0x33');Promise[_0x4f7c('0x34')]()['then'](function(){var _0x149d32=_0x4f7c('0x35')+_0x403695['ContactId'];return db[_0x4f7c('0x36')][_0x4f7c('0x25')](_0x149d32,{'type':db[_0x4f7c('0x26')][_0x4f7c('0x27')][_0x4f7c('0x28')],'raw':!![]});})[_0x4f7c('0x1b')](function(_0x5772ec){if(_0x5772ec){_0x403695[_0x4f7c('0x37')]=_0x5772ec[0x0];}if(typeof _0x403695[_0x4f7c('0x29')]==='undefined')return;return getAgent(_0x403695[_0x4f7c('0x29')]);})[_0x4f7c('0x1b')](function(_0x158114){if(_0x158114){_0x403695[_0x4f7c('0x2a')]=util[_0x4f7c('0x38')]('SIP/%s',_0x158114[_0x4f7c('0x2b')]);_0x403695[_0x4f7c('0x2c')]=_0x158114;}return request({'event':_0x1fe377,'message':_0x403695});})['catch'](function(_0xa2db38){logger[_0x4f7c('0x1d')](_0x4f7c('0x1c'),'AfterCreate',_0xa2db38);});};}function afterUpdate(_0x28520f){return function(_0x1d8d0c){var _0x36b815=_0x1d8d0c[_0x4f7c('0x39')](_0x4f7c('0x3a'))&&_0x1d8d0c[_0x4f7c('0x3a')];var _0x2445a7=_0x1d8d0c[_0x4f7c('0x39')](_0x4f7c('0x3b'));if(_0x36b815||_0x2445a7){var _0x260bd9=_0x36b815?_0x4f7c('0xa'):_0x4f7c('0x3b');var _0x42693d=_0x1d8d0c['get']({'plain':!![]});_0x42693d[_0x4f7c('0x20')]=_0x28520f;_0x42693d[_0x4f7c('0x21')]=_0x28520f;_0x42693d[_0x4f7c('0x31')]=_0x36b815?_0x4f7c('0x3a'):_0x4f7c('0x3b');var _0x12ff0c=_0x4f7c('0x35')+_0x42693d['ContactId'];return db[_0x4f7c('0x36')]['query'](_0x12ff0c,{'type':db[_0x4f7c('0x26')]['QueryTypes'][_0x4f7c('0x28')],'raw':!![]})['then'](function(_0x24bc1a){if(_0x24bc1a){_0x42693d[_0x4f7c('0x37')]=_0x24bc1a[0x0];}if(typeof _0x42693d[_0x4f7c('0x29')]==='undefined')return;return getAgent(_0x42693d[_0x4f7c('0x29')]);})['then'](function(_0x1ab8ad){if(_0x1ab8ad){_0x42693d['interface']=util[_0x4f7c('0x38')](_0x4f7c('0x3c'),_0x1ab8ad['name']);_0x42693d[_0x4f7c('0x2c')]=_0x1ab8ad;}return request({'event':_0x260bd9,'message':_0x42693d});})['catch'](function(_0x416d4a){logger[_0x4f7c('0x1d')](_0x4f7c('0x1c'),_0x4f7c('0x3d'),_0x416d4a);});}};}function getAgent(_0x4b5b31){return db[_0x4f7c('0x3e')][_0x4f7c('0x3f')]({'where':{'id':_0x4b5b31},'attributes':['id','name',_0x4f7c('0x40'),_0x4f7c('0x41'),_0x4f7c('0x42')],'raw':!![]})['then'](function(_0x3d9ac1){return _0x3d9ac1;});}exports[_0x4f7c('0x43')]=function(){for(var _0xe3db9b=0x0;_0xe3db9b=_0x5c2bfb[_0xc89c('0x14')]){throw Error(_0xc89c('0x15'));}_0x18bca1(_0x5ec9e4);})[_0xc89c('0x16')](function(_0x14e4f9){_0x2ea946(_0x14e4f9);});});}; \ No newline at end of file +var _0x20a1=['isValidChannel','toLowerCase','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','catch','lodash','bluebird','../mysqldb','./license/util','voice','chat','openchannel'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x20a1,0x173));var _0x120a=function(_0xb40607,_0x40089c){_0xb40607=_0xb40607-0x0;var _0x4f9998=_0x20a1[_0xb40607];return _0x4f9998;};'use strict';var _=require(_0x120a('0x0'));var BPromise=require(_0x120a('0x1'));var db=require(_0x120a('0x2'))['db'];var util=require(_0x120a('0x3'));var channels=[_0x120a('0x4'),'mail',_0x120a('0x5'),'fax','sms','whatsapp',_0x120a('0x6')];exports['getChannels']=function(){return channels;};exports[_0x120a('0x7')]=function(_0x4bc5d0){_0x4bc5d0=_0x4bc5d0[_0x120a('0x8')]();return _['includes'](channels,_0x4bc5d0);};exports[_0x120a('0x9')]=function(_0x8c3ddc,_0x596f3c,_0x336313,_0x25a0a4){var _0x449608={'loginAttempts':_0x596f3c,'blocked':_0x336313};if(!_[_0x120a('0xa')](_0x25a0a4)){_0x449608[_0x120a('0xb')]=_0x25a0a4;}return _0x8c3ddc[_0x120a('0xc')](_0x449608);};exports[_0x120a('0xd')]=function(_0x4a1db0){return new BPromise(function(_0xd8a939,_0x504be2){var _0x3bc471=0x0;if(_0x4a1db0[_0x120a('0xe')]!==_0x120a('0xf')){_0xd8a939(_0x4a1db0);}db[_0x120a('0x10')][_0x120a('0x11')]({'where':{'role':_0x120a('0xf'),'online':!![],'id':{'$ne':_0x4a1db0['id']}}})[_0x120a('0x12')](function(_0x3428da){_0x3bc471=_0x3428da;return util[_0x120a('0xd')]();})[_0x120a('0x12')](function(_0x4ff938){if(_0x4ff938&&_0x4ff938[_0x120a('0x13')]&&_0x3bc471>=_0x4ff938[_0x120a('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0xd8a939(_0x4a1db0);})[_0x120a('0x14')](function(_0x189cea){_0x504be2(_0x189cea);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 90cc2ef..32dfe34 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4736=['message','Internal\x20Server\x20Error','name','Error','Bad\x20Request','inherits','Forbidden','Not\x20Found','Out\x20Of\x20Interval','code','details','OutOfInterval','Conflict','stack','statusMessage','status','send','exports','../config/logger','api'];(function(_0xaf4f93,_0x3129ce){var _0x15230e=function(_0x537f3c){while(--_0x537f3c){_0xaf4f93['push'](_0xaf4f93['shift']());}};_0x15230e(++_0x3129ce);}(_0x4736,0x12a));var _0x6473=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4736[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var logger=require(_0x6473('0x0'))(_0x6473('0x1'));var APIError=function(_0x2e7253,_0x5ea330){this[_0x6473('0x2')]=_0x2e7253||_0x6473('0x3');this[_0x6473('0x4')]=_0x5ea330||_0x6473('0x5');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x355597){this['message']=_0x355597||_0x6473('0x6');this['name']=_0x6473('0x6');util[_0x6473('0x7')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x473ed5){this['message']=_0x473ed5||_0x6473('0x8');this['name']='Forbidden';util[_0x6473('0x7')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x5f4a71){this['message']=_0x5f4a71||'Entity\x20not\x20found';this[_0x6473('0x4')]=_0x6473('0x9');util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x1094d7){this[_0x6473('0x2')]=_0x1094d7||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this['name']=_0x6473('0xa');this[_0x6473('0xb')]=0x193;this[_0x6473('0xc')]={'type':_0x6473('0xd')};util['inherits'](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x1c70b8){this[_0x6473('0x2')]=_0x1c70b8||'Resource\x20Conflict';this[_0x6473('0x4')]=_0x6473('0xe');util['inherits'](APIBadRequestError,APIError);};function getStatusCode(_0x452cea){switch(_0x452cea){case _0x6473('0x6'):return 0x190;case _0x6473('0x8'),'Out\x20Of\x20Interval':return 0x193;case'Not\x20Found':return 0x194;case _0x6473('0xe'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x2ccc8f){if(_0x2ccc8f===_0x6473('0xa'))return _0x2ccc8f;return null;}function handleError(_0x187e80){return function(_0x265548){logger['error'](_0x265548[_0x6473('0xf')]);var _0x576575=getStatusCode(_0x265548[_0x6473('0x4')]);var _0x12b4d5=getCustomStatusMessage(_0x265548['name']);if(_0x265548[_0x6473('0x4')]){delete _0x265548[_0x6473('0x4')];}if(_0x12b4d5){_0x187e80[_0x6473('0x10')]=_0x12b4d5;}return _0x187e80[_0x6473('0x11')](_0x576575)[_0x6473('0x12')](_0x265548);};}module[_0x6473('0x13')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file +var _0x1d1e=['Resource\x20Conflict','Conflict','statusMessage','send','exports','api','message','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','Forbidden','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','code','OutOfInterval'];(function(_0x53ea86,_0x2e705f){var _0x16d7d3=function(_0x4b3771){while(--_0x4b3771){_0x53ea86['push'](_0x53ea86['shift']());}};_0x16d7d3(++_0x2e705f);}(_0x1d1e,0xd6));var _0xe1d1=function(_0x2264b7,_0x5a3536){_0x2264b7=_0x2264b7-0x0;var _0x22680e=_0x1d1e[_0x2264b7];return _0x22680e;};'use strict';var util=require('util');var logger=require('../config/logger')(_0xe1d1('0x0'));var APIError=function(_0x339d3f,_0x49e9e2){this[_0xe1d1('0x1')]=_0x339d3f||_0xe1d1('0x2');this[_0xe1d1('0x3')]=_0x49e9e2||_0xe1d1('0x4');util[_0xe1d1('0x5')](APIError,Error);};var APIBadRequestError=function(_0x238b02){this[_0xe1d1('0x1')]=_0x238b02||'Bad\x20Request';this[_0xe1d1('0x3')]=_0xe1d1('0x6');util[_0xe1d1('0x5')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x365c97){this[_0xe1d1('0x1')]=_0x365c97||_0xe1d1('0x7');this['name']=_0xe1d1('0x7');util['inherits'](APIForbiddenError,APIError);};var APINotFoundError=function(_0x490614){this['message']=_0x490614||_0xe1d1('0x8');this[_0xe1d1('0x3')]=_0xe1d1('0x9');util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x4d4ec6){this[_0xe1d1('0x1')]=_0x4d4ec6||_0xe1d1('0xa');this[_0xe1d1('0x3')]=_0xe1d1('0xb');this[_0xe1d1('0xc')]=0x193;this['details']={'type':_0xe1d1('0xd')};util[_0xe1d1('0x5')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x16e2f2){this[_0xe1d1('0x1')]=_0x16e2f2||_0xe1d1('0xe');this[_0xe1d1('0x3')]=_0xe1d1('0xf');util[_0xe1d1('0x5')](APIBadRequestError,APIError);};function getStatusCode(_0x475cca){switch(_0x475cca){case _0xe1d1('0x6'):return 0x190;case _0xe1d1('0x7'),_0xe1d1('0xb'):return 0x193;case _0xe1d1('0x9'):return 0x194;case _0xe1d1('0xf'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x572c72){if(_0x572c72==='Out\x20Of\x20Interval')return _0x572c72;return null;}function handleError(_0xa53c06){return function(_0x4cce8f){logger['error'](_0x4cce8f['stack']);var _0x37cdb9=getStatusCode(_0x4cce8f[_0xe1d1('0x3')]);var _0x420643=getCustomStatusMessage(_0x4cce8f['name']);if(_0x4cce8f[_0xe1d1('0x3')]){delete _0x4cce8f[_0xe1d1('0x3')];}if(_0x420643){_0xa53c06[_0xe1d1('0x10')]=_0x420643;}return _0xa53c06['status'](_0x37cdb9)[_0xe1d1('0x11')](_0x4cce8f);};}module[_0xe1d1('0x12')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index e2b4fd6..b2b631e 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dad=['exports','404','status','render','json','send'];(function(_0x1e4b14,_0x3225ac){var _0x5000f3=function(_0xc4650e){while(--_0xc4650e){_0x1e4b14['push'](_0x1e4b14['shift']());}};_0x5000f3(++_0x3225ac);}(_0x7dad,0x174));var _0xd7da=function(_0x206bc3,_0x4dbfb6){_0x206bc3=_0x206bc3-0x0;var _0x2f980b=_0x7dad[_0x206bc3];return _0x2f980b;};'use strict';module[_0xd7da('0x0')][0x194]=function pageNotFound(_0x5925f3,_0x22f896){var _0x522a8a=_0xd7da('0x1');var _0x15bdb1=0x194;var _0x2e6536={'status':_0x15bdb1};_0x22f896[_0xd7da('0x2')](_0x2e6536[_0xd7da('0x2')]);_0x22f896[_0xd7da('0x3')](_0x522a8a,{},function(_0x4a9885,_0x2bc787){if(_0x4a9885){return _0x22f896[_0xd7da('0x2')](_0x2e6536[_0xd7da('0x2')])[_0xd7da('0x4')](_0x2e6536);}_0x22f896[_0xd7da('0x5')](_0x2bc787);});}; \ No newline at end of file +var _0x03f8=['exports','status','render','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x03f8,0x1d0));var _0x803f=function(_0x178015,_0x4bcd41){_0x178015=_0x178015-0x0;var _0x5ef3c5=_0x03f8[_0x178015];return _0x5ef3c5;};'use strict';module[_0x803f('0x0')][0x194]=function pageNotFound(_0x3b7d4a,_0x5acd89){var _0x2a842d='404';var _0x3b7d84=0x194;var _0x101ddd={'status':_0x3b7d84};_0x5acd89[_0x803f('0x1')](_0x101ddd[_0x803f('0x1')]);_0x5acd89[_0x803f('0x2')](_0x2a842d,{},function(_0x2f974a,_0xa88695){if(_0x2f974a){return _0x5acd89[_0x803f('0x1')](_0x101ddd[_0x803f('0x1')])['json'](_0x101ddd);}_0x5acd89[_0x803f('0x3')](_0xa88695);});}; \ No newline at end of file diff --git a/server/migrations/2.6.27.js b/server/migrations/2.6.27.js new file mode 100644 index 0000000..a59425a --- /dev/null +++ b/server/migrations/2.6.27.js @@ -0,0 +1,169 @@ +'use strict'; + +var BPromise = require('bluebird'); +var util = require('util'); +var logger = require('../config/logger')('migration'); +var Sequence = function() {}; + +Sequence.prototype.enqueue = function(fn) { + this.tail = this.tail ? this.tail.finally(fn) : fn(); +}; + +var Migration = function(queryInterface) { + this.queryInterface = queryInterface; + this.sequence = new Sequence(); +}; + +Migration.prototype.changeColumn = function(table, column, type) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .changeColumn(table, column, type) + .then(function() { + logger.info('Changed column %s in table %s', column, table); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.addColumn = function(table, column, type) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .addColumn(table, column, type) + .then(function() { + logger.info('Added column %s to %s', column, table); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.dropTable = function(table) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .dropTable(table, { + force: true, + }) + .then(function() { + logger.info('table dropped %s', table); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.addIndex = function(table, column, indexName) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .addIndex(table, column, { + indexName: indexName, + }) + .then(function() { + logger.info('addIndex %s %s %s', table, column.join(','), indexName); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.removeIndex = function(table, indexName) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .removeIndex(table, indexName) + .then(function() { + logger.info('removeIndex %s %s', table, indexName); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.query = function(sql) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface.sequelize + .query(sql) + .then(function() { + logger.info('query %s', sql); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.removeColumn = function(table, column) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .removeColumn(table, column) + .then(function() { + logger.info('Removed column %s from %s', column, table); + }) + .catch(function(err) { + logger.info( + util.inspect(err, { + showHidden: false, + depth: null, + }) + ); + }); + }); +}; + +Migration.prototype.renameColumn = function(table, oldColumn, newColumn) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .renameColumn(table, oldColumn, newColumn) + .then(function() { + logger.info( + 'Renamed column from %s to %s on %s', + oldColumn, + newColumn, + table + ); + }) + .catch(function(err) { + logger.info( + util.inspect(err, { + showHidden: false, + depth: null, + }) + ); + }); + }); +}; + +Migration.prototype.final = function(resolve) { + this.sequence.enqueue(function() { + return resolve(); + }); +}; + +module.exports = { + up: function(queryInterface /*, Sequelize */) { + return new BPromise(function(resolve) { + var migration = new Migration(queryInterface); + // Add your migration code here + + // START FINAL + migration.final(resolve); + // END FINAL + }); + }, + + down: function( /* queryInterface, Sequelize */ ) { + // var migration = new Migration(queryInterface); + }, +}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 306537f..eca40f8 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2ee=['SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','FreshdeskField','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','MailInteractionHasTag','hasOne','cascade','UserId','UserSetting','userSetting','hasMany','VoiceRecording','Recordings','HopperFinals','OpenchannelInteractions','ChatInteractions','MailInteractions','UserNotification','UserNotifications','SenderId','Hoppers','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','SmsInteraction','SmsInteractions','user_has_sms_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','ChatQueues','UserChatQueue','FaxQueue','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','VoiceQueueId','HopperHistories','ReportAgentPreview','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','BlackLists','Messages','mailboxuser','mailbox','VoiceCallReport','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','restrict','CloudProviderId','Imap','Smtp','Dispositions','Answers','Interactions','List','ListId','mandatoryDispositionPauseId','team_has_mail_queues','MailInteractionId','Contact','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','Account','ChatOfflineMessage','ChatOfflineMessageId','TagId','MailQueueReport','DashboardItem','Items','FaxAccountId','Exntensions','FaxInteractionId','Owner','fax_interaction_has_tags','AttachmentId','UserFaxQueue','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','user_has_openchannel_accounts','OpenchannelQueue','OpenchannelQueueId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelInteractionId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Members','CmCompany','CompanyId','CmContactHasItem','CmContactId','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','Queue','CampaignId','OwnerId','Condition','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','AutomationId','ParentId','Intervals','MailApplications','FaxApplications','DefaultReportId','CustomReportId','Sound','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','TriggerAllId','Trigger','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','AnalyticMetric','MetricId','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','AccountId','Subject','Description','VariableId','SugarcrmField','Field','DeskAccount','DeskConfiguration','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskField','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','FromId','ToId','SessionId','user_has_teams','TeamVoiceQueue','MailQueues','team_has_chat_queues','team_has_fax_queues','team_has_whatsapp_queues','TeamVoicePrefix','VoicePrefixes','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToUserId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','userProfileId','UserProfileSections','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','user','exports','sequelize','jstz','motion2','xcall','xC@LL1234','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','defaultsDeep','password','options','database','username','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model'];(function(_0x19673d,_0x36c9c3){var _0x10b88a=function(_0xe73092){while(--_0xe73092){_0x19673d['push'](_0x19673d['shift']());}};_0x10b88a(++_0x36c9c3);}(_0xd2ee,0x161));var _0xed2e=function(_0x13f8e3,_0x210374){_0x13f8e3=_0x13f8e3-0x0;var _0x38e28d=_0xd2ee[_0x13f8e3];return _0x38e28d;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xed2e('0x0'));var _=require('lodash');var jstz=require(_0xed2e('0x1'));var timezone=jstz['determine']();config['sequelize']=_['defaultsDeep'](config[_0xed2e('0x0')],{'database':_0xed2e('0x2'),'username':_0xed2e('0x3'),'password':_0xed2e('0x4'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xed2e('0x5'),'dialectOptions':{'charset':_0xed2e('0x6')},'logging':![],'timezone':timezone[_0xed2e('0x7')](),'define':{'charset':'utf8','collate':_0xed2e('0x8')}}});config[_0xed2e('0x9')]=_[_0xed2e('0xa')](config[_0xed2e('0x9')],{'database':_0xed2e('0x2'),'username':_0xed2e('0x3'),'password':_0xed2e('0x4'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xed2e('0x5'),'dialectOptions':{'charset':_0xed2e('0x6')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0xed2e('0x8')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xed2e('0x0')]['database'],config[_0xed2e('0x0')]['username'],config[_0xed2e('0x0')][_0xed2e('0xb')],config[_0xed2e('0x0')][_0xed2e('0xc')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xed2e('0x9')][_0xed2e('0xd')],config[_0xed2e('0x9')][_0xed2e('0xe')],config['sequelizeHistory'][_0xed2e('0xb')],config['sequelizeHistory']['options'])};db[_0xed2e('0xf')]=db['sequelize']['import'](_0xed2e('0x10'));db[_0xed2e('0x11')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x13'));db[_0xed2e('0x14')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x15'));db[_0xed2e('0x16')]=db['sequelize']['import'](_0xed2e('0x17'));db[_0xed2e('0x18')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x19'));db[_0xed2e('0x1a')]=db['sequelize']['import']('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x1b'));db[_0xed2e('0x1c')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x1d'));db[_0xed2e('0x1e')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x1f'));db[_0xed2e('0x20')]=db[_0xed2e('0x0')]['import'](_0xed2e('0x21'));db['VoiceCallReport']=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/voiceCallReport/voiceCallReport.model');db[_0xed2e('0x22')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x23'));db[_0xed2e('0x24')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x25'));db[_0xed2e('0x26')]=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xed2e('0x27')]=db[_0xed2e('0x0')]['import']('../api/memberReport/memberReport.model');db[_0xed2e('0x28')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x29'));db[_0xed2e('0x2a')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x2b'));db[_0xed2e('0x2c')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x2d'));db[_0xed2e('0x2e')]=db[_0xed2e('0x0')]['import'](_0xed2e('0x2f'));db['UserChatQueue']=db[_0xed2e('0x0')]['import'](_0xed2e('0x30'));db[_0xed2e('0x31')]=db[_0xed2e('0x0')]['import'](_0xed2e('0x32'));db['UserFaxQueue']=db['sequelize'][_0xed2e('0x12')]('../api/userFaxQueue/userFaxQueue.model');db['UserSmsQueue']=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x33'));db['UserOpenchannelQueue']=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x34'));db[_0xed2e('0x35')]=db['sequelize'][_0xed2e('0x12')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xed2e('0x36')]=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/mailServerIn/mailServerIn.model');db[_0xed2e('0x37')]=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/mailServerOut/mailServerOut.model');db[_0xed2e('0x38')]=db[_0xed2e('0x0')]['import'](_0xed2e('0x39'));db[_0xed2e('0x3a')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x3b'));db[_0xed2e('0x3c')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x3d'));db[_0xed2e('0x3e')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x3f'));db[_0xed2e('0x40')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x41'));db[_0xed2e('0x42')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x43'));db['MailQueueReport']=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x44'));db[_0xed2e('0x45')]=db['sequelize'][_0xed2e('0x12')]('../api/dashboard/dashboard.model');db['DashboardItem']=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x46'));db[_0xed2e('0x47')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x48'));db[_0xed2e('0x49')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x4a'));db[_0xed2e('0x4b')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x4c'));db[_0xed2e('0x4d')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x4e'));db['FaxQueue']=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x4f'));db[_0xed2e('0x50')]=db['sequelize']['import'](_0xed2e('0x51'));db[_0xed2e('0x52')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x53'));db[_0xed2e('0x54')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x55'));db['SmsInteraction']=db[_0xed2e('0x0')]['import'](_0xed2e('0x56'));db[_0xed2e('0x57')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x58'));db[_0xed2e('0x59')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x5a'));db[_0xed2e('0x5b')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x5c'));db['OpenchannelApplication']=db[_0xed2e('0x0')]['import'](_0xed2e('0x5d'));db[_0xed2e('0x5e')]=db[_0xed2e('0x0')]['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0xed2e('0x5f')]=db[_0xed2e('0x0')]['import'](_0xed2e('0x60'));db['OpenchannelQueue']=db[_0xed2e('0x0')]['import'](_0xed2e('0x61'));db[_0xed2e('0x62')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x63'));db[_0xed2e('0x64')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x65'));db[_0xed2e('0x66')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x67'));db[_0xed2e('0x68')]=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/chatInteraction/chatInteraction.model');db[_0xed2e('0x69')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x6a'));db['ChatOfflineMessage']=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x6b'));db[_0xed2e('0x6c')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x6d'));db[_0xed2e('0x6e')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x6f'));db[_0xed2e('0x70')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x71'));db['CmCompany']=db['sequelize']['import'](_0xed2e('0x72'));db[_0xed2e('0x73')]=db[_0xed2e('0x0')]['import'](_0xed2e('0x74'));db[_0xed2e('0x75')]=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/cmHopper/cmHopper.model');db[_0xed2e('0x76')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x77'));db[_0xed2e('0x78')]=db[_0xed2e('0x0')]['import'](_0xed2e('0x79'));db[_0xed2e('0x7a')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x7b'));db['ReportAgentPreview']=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x7c'));db[_0xed2e('0x7d')]=db['sequelize'][_0xed2e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0xed2e('0x7e')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x7f'));db[_0xed2e('0x80')]=db['sequelize']['import'](_0xed2e('0x81'));db[_0xed2e('0x82')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x83'));db[_0xed2e('0x84')]=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/disposition/disposition.model');db['Condition']=db['sequelize'][_0xed2e('0x12')]('../api/condition/condition.model');db[_0xed2e('0x85')]=db[_0xed2e('0x0')]['import'](_0xed2e('0x86'));db[_0xed2e('0x87')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x88'));db[_0xed2e('0x89')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x8a'));db[_0xed2e('0x8b')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x8c'));db[_0xed2e('0x8d')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x8e'));db['Sound']=db[_0xed2e('0x0')]['import']('../api/sound/sound.model');db['Tag']=db['sequelize']['import']('../api/tag/tag.model');db[_0xed2e('0x8f')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x90'));db['CmContactHasItem']=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x91'));db[_0xed2e('0x92')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x93'));db[_0xed2e('0x94')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x95'));db['Trigger']=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x96'));db[_0xed2e('0x97')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x98'));db[_0xed2e('0x99')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x9a'));db[_0xed2e('0x9b')]=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/integrationReport/integrationReport.model');db[_0xed2e('0x9c')]=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xed2e('0x9d')]=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xed2e('0x9e')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x9f'));db['AnalyticMetric']=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0xed2e('0xa0')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0xa1'));db[_0xed2e('0xa2')]=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xed2e('0xa3')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xa4'));db[_0xed2e('0xa5')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xa6'));db[_0xed2e('0xa7')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xa8'));db[_0xed2e('0xa9')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xaa'));db[_0xed2e('0xab')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xac'));db['SugarcrmField']=db['sequelize']['import']('../api/intSugarcrmField/intSugarcrmField.model');db['DeskAccount']=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xad'));db['DeskConfiguration']=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xae'));db[_0xed2e('0xaf')]=db['sequelize'][_0xed2e('0x12')]('../api/intDeskField/intDeskField.model');db[_0xed2e('0xb0')]=db[_0xed2e('0x0')]['import']('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0xed2e('0x0')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xed2e('0xb1')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xb2'));db['ZendeskAccount']=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xb3'));db['ZendeskField']=db['sequelize'][_0xed2e('0x12')](_0xed2e('0xb4'));db[_0xed2e('0xb5')]=db['sequelize'][_0xed2e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xed2e('0xb6')]=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xed2e('0xb7')]=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0xed2e('0xb8')]=db['sequelize'][_0xed2e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xed2e('0xb9')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xba'));db[_0xed2e('0xbb')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0xbc'));db[_0xed2e('0xbd')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xbe'));db['ServicenowField']=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0xed2e('0xbf')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0xc0'));db[_0xed2e('0xc1')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xc2'));db[_0xed2e('0xc3')]=db['sequelize'][_0xed2e('0x12')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xed2e('0xc4')]=db[_0xed2e('0x0')]['import'](_0xed2e('0xc5'));db[_0xed2e('0xc6')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0xc7'));db[_0xed2e('0xc8')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xc9'));db['Integration']=db['sequelize']['import'](_0xed2e('0x9a'));db[_0xed2e('0xca')]=db[_0xed2e('0x0')]['import'](_0xed2e('0xcb'));db[_0xed2e('0xcc')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xcd'));db[_0xed2e('0xce')]=db['sequelize'][_0xed2e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xed2e('0xcf')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xd0'));db[_0xed2e('0xd1')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xd2'));db[_0xed2e('0xd3')]=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xed2e('0xd4')]=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0xed2e('0x0')]['import']('../api/squareReport/squareReport.model');db[_0xed2e('0xd5')]=db[_0xed2e('0x0')]['import'](_0xed2e('0xd6'));db[_0xed2e('0xd7')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xd8'));db[_0xed2e('0xd9')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xda'));db[_0xed2e('0xdb')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0xdc'));db[_0xed2e('0xdd')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xde'));db[_0xed2e('0xdf')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0xe0'));db[_0xed2e('0xe1')]=db['sequelize'][_0xed2e('0x12')]('../api/squareMessage/squareMessage.model');db[_0xed2e('0xe2')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0xe3'));db[_0xed2e('0xe4')]=db[_0xed2e('0x0')]['import'](_0xed2e('0xe5'));db[_0xed2e('0xe6')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xe7'));db['Migration']=db['sequelize'][_0xed2e('0x12')](_0xed2e('0xe8'));db[_0xed2e('0xe9')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xea'));db[_0xed2e('0xeb')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xec'));db[_0xed2e('0xed')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xee'));db[_0xed2e('0xef')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xf0'));db[_0xed2e('0xf1')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xf2'));db['OpenchannelTransferReport']=db[_0xed2e('0x0')]['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xed2e('0xf3')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xf4'));db[_0xed2e('0xf5')]=db[_0xed2e('0x0')]['import'](_0xed2e('0xf6'));db[_0xed2e('0xf7')]=db['sequelize']['import'](_0xed2e('0xf8'));db[_0xed2e('0xf9')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xfa'));db[_0xed2e('0xfb')]=db[_0xed2e('0x0')]['import'](_0xed2e('0xfc'));db[_0xed2e('0xfd')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0xfe'));db['UserNotification']=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0xff'));db['WhatsappAccount']=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x100'));db[_0xed2e('0x101')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x102'));db[_0xed2e('0x103')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x104'));db[_0xed2e('0x105')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x106'));db[_0xed2e('0x107')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x108'));db[_0xed2e('0x109')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x10a'));db[_0xed2e('0x10b')]=db[_0xed2e('0x0')]['import'](_0xed2e('0x10c'));db[_0xed2e('0x10d')]=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x10e'));db['TeamVoiceQueue']=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db[_0xed2e('0x0')][_0xed2e('0x12')](_0xed2e('0x10f'));db[_0xed2e('0x110')]=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x111'));db['UserSetting']=db['sequelize'][_0xed2e('0x12')](_0xed2e('0x112'));db[_0xed2e('0x113')]=db[_0xed2e('0x0')][_0xed2e('0x12')]('../api/mailInteractionHasTag/mailInteractionHasTag.model');db[_0xed2e('0xf')][_0xed2e('0x114')](db[_0xed2e('0x1e')],{'as':_0xed2e('0x1e'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x116')});db['User'][_0xed2e('0x114')](db[_0xed2e('0x117')],{'as':_0xed2e('0x118'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x116')});db['User'][_0xed2e('0x119')](db[_0xed2e('0x11a')],{'as':_0xed2e('0x11b'),'foreignKey':'UserId'});db[_0xed2e('0xf')][_0xed2e('0x119')](db[_0xed2e('0x2c')],{'as':'VoiceQueuesRt','foreignKey':_0xed2e('0x116')});db[_0xed2e('0xf')][_0xed2e('0x119')](db[_0xed2e('0x16')],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db['User'][_0xed2e('0x119')](db[_0xed2e('0x78')],{'as':_0xed2e('0x11c'),'foreignKey':_0xed2e('0x116')});db['User'][_0xed2e('0x119')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':'UserId'});db[_0xed2e('0xf')][_0xed2e('0x119')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xed2e('0x116')});db[_0xed2e('0xf')][_0xed2e('0x119')](db[_0xed2e('0x5e')],{'as':_0xed2e('0x11d'),'foreignKey':_0xed2e('0x116')});db[_0xed2e('0xf')][_0xed2e('0x119')](db[_0xed2e('0x68')],{'as':_0xed2e('0x11e'),'foreignKey':'UserId'});db[_0xed2e('0xf')][_0xed2e('0x119')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xed2e('0x116')});db[_0xed2e('0xf')][_0xed2e('0x119')](db[_0xed2e('0x4b')],{'as':'FaxInteractions','foreignKey':_0xed2e('0x116')});db[_0xed2e('0xf')][_0xed2e('0x119')](db['MailInteraction'],{'as':_0xed2e('0x11f'),'foreignKey':_0xed2e('0x116')});db[_0xed2e('0xf')]['hasMany'](db[_0xed2e('0x103')],{'as':'WhatsappInteractions','foreignKey':_0xed2e('0x116')});db[_0xed2e('0xf')][_0xed2e('0x119')](db[_0xed2e('0x120')],{'as':_0xed2e('0x121'),'foreignKey':_0xed2e('0x122')});db[_0xed2e('0xf')]['hasMany'](db[_0xed2e('0x75')],{'as':_0xed2e('0x123'),'foreignKey':_0xed2e('0x116'),'onDelete':'SET\x20NULL'});db[_0xed2e('0xf')]['belongsTo'](db[_0xed2e('0xf9')],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0xed2e('0xf')][_0xed2e('0x124')](db['ChatGroup'],{'as':_0xed2e('0x125'),'through':_0xed2e('0x126')});db[_0xed2e('0xf')][_0xed2e('0x124')](db[_0xed2e('0x73')],{'as':_0xed2e('0x127'),'through':_0xed2e('0x128')});db[_0xed2e('0xf')][_0xed2e('0x124')](db[_0xed2e('0xf5')],{'as':_0xed2e('0x129'),'through':_0xed2e('0x12a')});db[_0xed2e('0xf')]['belongsToMany'](db[_0xed2e('0xe2')],{'through':'user_has_teams'});db[_0xed2e('0xf')][_0xed2e('0x124')](db[_0xed2e('0x3e')],{'as':_0xed2e('0x11f'),'through':_0xed2e('0x12b')});db['User'][_0xed2e('0x124')](db[_0xed2e('0x68')],{'as':_0xed2e('0x11e'),'through':_0xed2e('0x12c')});db[_0xed2e('0xf')]['belongsToMany'](db[_0xed2e('0x4b')],{'as':_0xed2e('0x12d'),'through':_0xed2e('0x12e')});db[_0xed2e('0xf')]['belongsToMany'](db[_0xed2e('0x12f')],{'as':_0xed2e('0x130'),'through':_0xed2e('0x131')});db[_0xed2e('0xf')][_0xed2e('0x124')](db[_0xed2e('0x5e')],{'as':_0xed2e('0x11d'),'through':'user_has_openchannel_interactions'});db[_0xed2e('0xf')][_0xed2e('0x124')](db[_0xed2e('0x103')],{'as':_0xed2e('0x132'),'through':_0xed2e('0x133')});db['User'][_0xed2e('0x124')](db[_0xed2e('0x1a')],{'as':_0xed2e('0x134'),'through':_0xed2e('0x2e'),'required':![]});db[_0xed2e('0xf')][_0xed2e('0x124')](db[_0xed2e('0xf7')],{'as':'VoicePrefixes','through':_0xed2e('0x110'),'required':![]});db[_0xed2e('0xf')][_0xed2e('0x124')](db[_0xed2e('0x3a')],{'as':'MailQueues','through':_0xed2e('0x31'),'required':![]});db[_0xed2e('0xf')][_0xed2e('0x124')](db[_0xed2e('0x6c')],{'as':_0xed2e('0x135'),'through':_0xed2e('0x136'),'required':![],'hooks':!![]});db[_0xed2e('0xf')]['belongsToMany'](db[_0xed2e('0x137')],{'as':_0xed2e('0x138'),'through':'UserFaxQueue','required':![]});db[_0xed2e('0xf')][_0xed2e('0x124')](db[_0xed2e('0x59')],{'as':_0xed2e('0x139'),'through':_0xed2e('0x13a'),'required':![]});db[_0xed2e('0xf')][_0xed2e('0x124')](db['OpenchannelQueue'],{'as':_0xed2e('0x13b'),'through':_0xed2e('0x13c'),'required':![]});db['User'][_0xed2e('0x124')](db[_0xed2e('0x10b')],{'as':_0xed2e('0x13d'),'through':_0xed2e('0x35'),'required':![]});db[_0xed2e('0xf')][_0xed2e('0x124')](db['CmList'],{'through':_0xed2e('0x12a')});db[_0xed2e('0xf')][_0xed2e('0x124')](db[_0xed2e('0x62')],{'as':'ChatWebsites','through':_0xed2e('0x13e')});db[_0xed2e('0xf')][_0xed2e('0x124')](db[_0xed2e('0x47')],{'as':_0xed2e('0x13f'),'through':_0xed2e('0x140')});db[_0xed2e('0xf')][_0xed2e('0x124')](db[_0xed2e('0x38')],{'as':_0xed2e('0x141'),'through':_0xed2e('0x142')});db['User'][_0xed2e('0x124')](db[_0xed2e('0x5b')],{'as':_0xed2e('0x143'),'through':'user_has_openchannel_accounts'});db[_0xed2e('0xf')][_0xed2e('0x124')](db['SmsAccount'],{'as':_0xed2e('0x144'),'through':_0xed2e('0x145')});db[_0xed2e('0xf')][_0xed2e('0x124')](db[_0xed2e('0x146')],{'as':_0xed2e('0x147'),'through':'user_has_whatsapp_accounts'});db['VoiceChanSpy'][_0xed2e('0x119')](db[_0xed2e('0x16')],{'as':_0xed2e('0x148'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x149')});db[_0xed2e('0x14')][_0xed2e('0x119')](db[_0xed2e('0x16')],{'onDelete':_0xed2e('0x115')});db[_0xed2e('0x16')][_0xed2e('0x119')](db[_0xed2e('0x16')],{'as':_0xed2e('0x14a'),'onDelete':'cascade'});db['VoiceMusicOnHold'][_0xed2e('0x124')](db['Sound'],{'as':_0xed2e('0x14b'),'through':_0xed2e('0x14c')});db['VoiceQueue'][_0xed2e('0x119')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0xed2e('0x1a')]['hasMany'](db[_0xed2e('0x75')],{'as':'Hoppers','foreignKey':_0xed2e('0x14d')});db[_0xed2e('0x1a')]['hasMany'](db[_0xed2e('0x78')],{'as':_0xed2e('0x11c'),'foreignKey':'VoiceQueueId'});db[_0xed2e('0x1a')]['hasMany'](db['CmHopperHistory'],{'as':_0xed2e('0x14e'),'foreignKey':'VoiceQueueId'});db[_0xed2e('0x1a')][_0xed2e('0x119')](db[_0xed2e('0x14f')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0xed2e('0x1a')][_0xed2e('0x119')](db[_0xed2e('0x76')],{'as':_0xed2e('0x150'),'foreignKey':_0xed2e('0x14d')});db[_0xed2e('0x1a')]['hasMany'](db[_0xed2e('0xd3')],{'as':_0xed2e('0x151'),'foreignKey':_0xed2e('0x14d')});db[_0xed2e('0x1a')][_0xed2e('0x152')](db['Trunk'],{'as':_0xed2e('0x28'),'foreignKey':_0xed2e('0x153')});db[_0xed2e('0x1a')][_0xed2e('0x152')](db[_0xed2e('0x28')],{'as':_0xed2e('0x154'),'foreignKey':_0xed2e('0x155')});db[_0xed2e('0x1a')][_0xed2e('0x152')](db['Interval'],{'as':'Interval','foreignKey':_0xed2e('0x156')});db['VoiceQueue'][_0xed2e('0x152')](db['Pause'],{'as':_0xed2e('0x157'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0xed2e('0x124')](db['CmList'],{'as':'Lists','through':_0xed2e('0x158')});db[_0xed2e('0x1a')][_0xed2e('0x124')](db[_0xed2e('0xf')],{'as':_0xed2e('0x159'),'through':_0xed2e('0x2e')});db['VoiceQueue'][_0xed2e('0x124')](db[_0xed2e('0xe2')],{'as':_0xed2e('0x15a'),'through':'TeamVoiceQueue'});db['VoiceQueue']['belongsToMany'](db[_0xed2e('0xf5')],{'as':_0xed2e('0x15b'),'through':'voice_queues_has_cm_blacklists'});db[_0xed2e('0x11a')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'as':_0xed2e('0xf'),'foreignKey':'UserId'});db['ScreenRecording'][_0xed2e('0x152')](db[_0xed2e('0xf')],{'as':_0xed2e('0xf'),'foreignKey':_0xed2e('0x116')});db[_0xed2e('0x1e')][_0xed2e('0x119')](db[_0xed2e('0x20')],{'as':_0xed2e('0x15c'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x15d'),'sourceKey':'mailbox'});db[_0xed2e('0x20')]['belongsTo'](db[_0xed2e('0x1e')],{'foreignKey':_0xed2e('0x15d'),'targetKey':_0xed2e('0x15e')});db[_0xed2e('0x15f')][_0xed2e('0x119')](db['VoiceQueueReport'],{'as':_0xed2e('0x160'),'foreignKey':_0xed2e('0x161'),'constraints':![]});db['VoiceCallReport'][_0xed2e('0x119')](db[_0xed2e('0x24')],{'as':_0xed2e('0x162'),'foreignKey':_0xed2e('0x161'),'constraints':![]});db[_0xed2e('0x15f')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'as':_0xed2e('0xf'),'foreignKey':_0xed2e('0x116')});db['VoiceCallReport']['belongsTo'](db[_0xed2e('0x73')],{'as':'Contact','foreignKey':_0xed2e('0x163')});db[_0xed2e('0x36')][_0xed2e('0x152')](db[_0xed2e('0x38')],{'as':_0xed2e('0x38'),'foreignKey':_0xed2e('0x164')});db[_0xed2e('0x36')]['belongsTo'](db[_0xed2e('0x10d')],{'as':_0xed2e('0x10d'),'foreignKey':'CloudProviderId','onDelete':_0xed2e('0x165')});db[_0xed2e('0x37')][_0xed2e('0x152')](db[_0xed2e('0x38')],{'as':_0xed2e('0x38'),'foreignKey':_0xed2e('0x164')});db[_0xed2e('0x37')]['belongsTo'](db[_0xed2e('0x10d')],{'as':'CloudProvider','foreignKey':_0xed2e('0x166'),'onDelete':_0xed2e('0x165')});db[_0xed2e('0x38')][_0xed2e('0x114')](db[_0xed2e('0x36')],{'as':_0xed2e('0x167'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0x38')][_0xed2e('0x114')](db[_0xed2e('0x37')],{'as':_0xed2e('0x168'),'onDelete':'cascade'});db[_0xed2e('0x38')][_0xed2e('0x119')](db['Disposition'],{'as':_0xed2e('0x169'),'foreignKey':'MailAccountId','onDelete':_0xed2e('0x115')});db[_0xed2e('0x38')][_0xed2e('0x119')](db['CannedAnswer'],{'as':_0xed2e('0x16a'),'foreignKey':'MailAccountId'});db[_0xed2e('0x38')][_0xed2e('0x119')](db[_0xed2e('0x40')],{'as':_0xed2e('0x15c'),'foreignKey':_0xed2e('0x164')});db[_0xed2e('0x38')][_0xed2e('0x119')](db[_0xed2e('0x3e')],{'as':_0xed2e('0x16b')});db[_0xed2e('0x38')][_0xed2e('0x119')](db['MailApplication'],{'as':'Applications','foreignKey':_0xed2e('0x164'),'onDelete':_0xed2e('0x115')});db['MailAccount'][_0xed2e('0x152')](db[_0xed2e('0xf5')],{'as':_0xed2e('0x16c'),'foreignKey':_0xed2e('0x16d')});db['MailAccount']['belongsTo'](db[_0xed2e('0x94')],{'as':_0xed2e('0x94'),'foreignKey':'TemplateId'});db[_0xed2e('0x38')][_0xed2e('0x152')](db[_0xed2e('0x87')],{'as':_0xed2e('0x157'),'foreignKey':_0xed2e('0x16e')});db[_0xed2e('0x38')]['belongsToMany'](db['User'],{'as':_0xed2e('0x159'),'through':_0xed2e('0x142')});db[_0xed2e('0x3a')][_0xed2e('0x124')](db[_0xed2e('0xf')],{'as':_0xed2e('0x159'),'through':_0xed2e('0x31')});db[_0xed2e('0x3a')][_0xed2e('0x124')](db[_0xed2e('0xe2')],{'through':_0xed2e('0x16f'),'as':_0xed2e('0x15a')});db[_0xed2e('0x3e')][_0xed2e('0x119')](db[_0xed2e('0x40')],{'as':_0xed2e('0x15c'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x170')});db[_0xed2e('0x3e')]['belongsTo'](db[_0xed2e('0x38')],{'as':'Account','foreignKey':_0xed2e('0x164')});db['MailInteraction'][_0xed2e('0x152')](db['CmContact'],{'as':_0xed2e('0x171'),'foreignKey':_0xed2e('0x163')});db[_0xed2e('0x3e')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'as':'Owner','foreignKey':_0xed2e('0x116')});db[_0xed2e('0x3e')]['belongsToMany'](db[_0xed2e('0x172')],{'through':_0xed2e('0x173'),'as':_0xed2e('0x174')});db[_0xed2e('0x3e')][_0xed2e('0x124')](db['Tag'],{'through':_0xed2e('0x173'),'as':_0xed2e('0x175')});db['MailInteraction'][_0xed2e('0x124')](db[_0xed2e('0xf')],{'as':_0xed2e('0x176'),'through':'user_has_mail_interactions','foreignKey':_0xed2e('0x170')});db[_0xed2e('0x40')][_0xed2e('0x119')](db[_0xed2e('0xe9')],{'as':_0xed2e('0x177'),'onDelete':_0xed2e('0x115')});db['MailMessage'][_0xed2e('0x152')](db[_0xed2e('0xf')],{'as':_0xed2e('0xf')});db['MailMessage']['belongsTo'](db[_0xed2e('0x73')],{'onDelete':_0xed2e('0x115'),'as':_0xed2e('0x171')});db['MailMessage']['belongsTo'](db[_0xed2e('0x3e')],{'as':_0xed2e('0x178'),'foreignKey':_0xed2e('0x170')});db[_0xed2e('0x40')][_0xed2e('0x152')](db[_0xed2e('0x38')],{'as':_0xed2e('0x179'),'foreignKey':'MailAccountId'});db[_0xed2e('0x40')]['belongsTo'](db[_0xed2e('0x62')],{'as':_0xed2e('0x62'),'foreignKey':'ChatWebsiteId'});db['MailMessage'][_0xed2e('0x152')](db['ChatOfflineMessage'],{'as':_0xed2e('0x17a'),'foreignKey':_0xed2e('0x17b')});db[_0xed2e('0x42')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'onDelete':_0xed2e('0x165')});db[_0xed2e('0x42')][_0xed2e('0x152')](db[_0xed2e('0x3a')],{'onDelete':_0xed2e('0x165')});db[_0xed2e('0x42')][_0xed2e('0x152')](db[_0xed2e('0x38')],{'onDelete':_0xed2e('0x165')});db[_0xed2e('0x42')]['belongsTo'](db[_0xed2e('0x85')],{'onDelete':_0xed2e('0x165'),'foreignKey':_0xed2e('0x156')});db[_0xed2e('0x42')]['belongsTo'](db[_0xed2e('0x172')],{'onDelete':_0xed2e('0x165'),'foreignKey':_0xed2e('0x17c')});db[_0xed2e('0x17d')]['belongsTo'](db['MailAccount'],{});db[_0xed2e('0x17d')]['belongsTo'](db[_0xed2e('0xf5')],{'as':'List','foreignKey':_0xed2e('0x16d')});db[_0xed2e('0x17d')][_0xed2e('0x152')](db[_0xed2e('0x73')],{'as':_0xed2e('0x171'),'foreignKey':'ContactId'});db['MailQueueReport'][_0xed2e('0x152')](db[_0xed2e('0x3e')],{});db[_0xed2e('0x17d')][_0xed2e('0x152')](db[_0xed2e('0x40')],{});db[_0xed2e('0x17d')][_0xed2e('0x152')](db[_0xed2e('0xf')],{});db[_0xed2e('0x17d')][_0xed2e('0x152')](db['MailQueue'],{});db[_0xed2e('0x45')]['hasMany'](db[_0xed2e('0x17e')],{'as':_0xed2e('0x17f'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0x47')]['hasMany'](db['Disposition'],{'as':_0xed2e('0x169'),'foreignKey':'FaxAccountId','onDelete':_0xed2e('0x115')});db[_0xed2e('0x47')][_0xed2e('0x119')](db[_0xed2e('0x82')],{'as':_0xed2e('0x16a'),'foreignKey':'FaxAccountId'});db[_0xed2e('0x47')]['hasMany'](db[_0xed2e('0x4b')],{'as':_0xed2e('0x16b')});db['FaxAccount'][_0xed2e('0x119')](db['FaxApplication'],{'as':_0xed2e('0x14a'),'foreignKey':_0xed2e('0x180'),'onDelete':'cascade'});db[_0xed2e('0x47')][_0xed2e('0x119')](db[_0xed2e('0x16')],{'as':_0xed2e('0x181'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0x47')][_0xed2e('0x119')](db['FaxMessage'],{'as':_0xed2e('0x15c')});db[_0xed2e('0x47')]['belongsTo'](db[_0xed2e('0x28')],{'as':_0xed2e('0x28')});db[_0xed2e('0x47')][_0xed2e('0x152')](db['CmList'],{'as':_0xed2e('0x16c'),'foreignKey':_0xed2e('0x16d')});db['FaxAccount'][_0xed2e('0x152')](db['Pause'],{'as':_0xed2e('0x157'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xed2e('0x47')][_0xed2e('0x124')](db['User'],{'as':_0xed2e('0x159'),'through':_0xed2e('0x140')});db[_0xed2e('0x49')][_0xed2e('0x152')](db['User'],{'onDelete':_0xed2e('0x165')});db['FaxApplication'][_0xed2e('0x152')](db['FaxQueue'],{'onDelete':_0xed2e('0x165')});db['FaxApplication'][_0xed2e('0x152')](db[_0xed2e('0x47')],{'onDelete':_0xed2e('0x165')});db[_0xed2e('0x49')][_0xed2e('0x152')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xed2e('0x4b')][_0xed2e('0x119')](db['FaxMessage'],{'as':_0xed2e('0x15c'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x182')});db[_0xed2e('0x4b')]['belongsTo'](db[_0xed2e('0x47')],{'as':'Account','foreignKey':_0xed2e('0x180')});db['FaxInteraction'][_0xed2e('0x152')](db[_0xed2e('0x73')],{'as':'Contact','foreignKey':_0xed2e('0x163')});db[_0xed2e('0x4b')][_0xed2e('0x152')](db['User'],{'as':_0xed2e('0x183'),'foreignKey':'UserId'});db[_0xed2e('0x4b')][_0xed2e('0x124')](db['Tag'],{'through':_0xed2e('0x184'),'as':_0xed2e('0x174')});db[_0xed2e('0x4b')][_0xed2e('0x124')](db[_0xed2e('0x172')],{'through':_0xed2e('0x184'),'as':'ThroughTags'});db[_0xed2e('0x4b')][_0xed2e('0x124')](db[_0xed2e('0xf')],{'as':_0xed2e('0x176'),'through':_0xed2e('0x12e'),'foreignKey':'FaxInteractionId'});db[_0xed2e('0x4d')]['belongsTo'](db[_0xed2e('0xf')],{'onDelete':_0xed2e('0x115'),'as':_0xed2e('0xf')});db[_0xed2e('0x4d')][_0xed2e('0x152')](db[_0xed2e('0x4b')],{'as':_0xed2e('0x178'),'foreignKey':_0xed2e('0x182')});db[_0xed2e('0x4d')][_0xed2e('0x152')](db[_0xed2e('0x73')],{'onDelete':'cascade','as':_0xed2e('0x171')});db[_0xed2e('0x4d')][_0xed2e('0x152')](db[_0xed2e('0xe9')],{'as':'Attachment','foreignKey':_0xed2e('0x185')});db['FaxMessage'][_0xed2e('0x152')](db[_0xed2e('0x47')],{'as':_0xed2e('0x179'),'foreignKey':_0xed2e('0x180')});db[_0xed2e('0x137')]['belongsToMany'](db[_0xed2e('0xf')],{'as':_0xed2e('0x159'),'through':_0xed2e('0x186')});db['FaxQueue']['belongsToMany'](db[_0xed2e('0xe2')],{'through':'team_has_fax_queues','as':_0xed2e('0x15a')});db['FaxQueueReport'][_0xed2e('0x152')](db['FaxAccount'],{});db[_0xed2e('0x50')][_0xed2e('0x152')](db[_0xed2e('0xf5')],{'as':'List','foreignKey':_0xed2e('0x16d')});db[_0xed2e('0x50')][_0xed2e('0x152')](db[_0xed2e('0x73')],{'as':_0xed2e('0x171'),'foreignKey':_0xed2e('0x163')});db[_0xed2e('0x50')]['belongsTo'](db[_0xed2e('0x4b')],{});db['FaxQueueReport']['belongsTo'](db[_0xed2e('0x4d')],{});db[_0xed2e('0x50')]['belongsTo'](db['User'],{});db['FaxQueueReport']['belongsTo'](db['FaxQueue'],{});db[_0xed2e('0x52')]['hasMany'](db[_0xed2e('0x84')],{'as':'Dispositions','foreignKey':_0xed2e('0x187'),'onDelete':_0xed2e('0x115')});db['SmsAccount']['hasMany'](db['CannedAnswer'],{'as':_0xed2e('0x16a'),'foreignKey':_0xed2e('0x187')});db['SmsAccount'][_0xed2e('0x119')](db['SmsMessage'],{'as':_0xed2e('0x15c'),'foreignKey':_0xed2e('0x187')});db[_0xed2e('0x52')]['hasMany'](db[_0xed2e('0x12f')],{'as':'Interactions'});db[_0xed2e('0x52')][_0xed2e('0x119')](db[_0xed2e('0x54')],{'as':_0xed2e('0x14a'),'foreignKey':_0xed2e('0x187'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0x52')][_0xed2e('0x152')](db[_0xed2e('0xf5')],{'as':_0xed2e('0x16c'),'foreignKey':_0xed2e('0x16d')});db[_0xed2e('0x52')][_0xed2e('0x152')](db['Pause'],{'as':_0xed2e('0x157'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xed2e('0x52')][_0xed2e('0x124')](db[_0xed2e('0xf')],{'as':_0xed2e('0x159'),'through':_0xed2e('0x145')});db['SmsApplication']['belongsTo'](db[_0xed2e('0xf')],{'onDelete':'restrict'});db[_0xed2e('0x54')][_0xed2e('0x152')](db[_0xed2e('0x59')],{'onDelete':_0xed2e('0x165')});db[_0xed2e('0x54')]['belongsTo'](db[_0xed2e('0x52')],{'onDelete':_0xed2e('0x165')});db[_0xed2e('0x54')][_0xed2e('0x152')](db[_0xed2e('0x85')],{'onDelete':_0xed2e('0x165'),'foreignKey':_0xed2e('0x156')});db[_0xed2e('0x54')][_0xed2e('0x152')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xed2e('0x17c')});db['SmsInteraction'][_0xed2e('0x119')](db[_0xed2e('0x57')],{'as':_0xed2e('0x15c'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x188')});db[_0xed2e('0x12f')][_0xed2e('0x152')](db[_0xed2e('0x52')],{'as':_0xed2e('0x179'),'foreignKey':_0xed2e('0x187')});db[_0xed2e('0x12f')][_0xed2e('0x152')](db[_0xed2e('0x73')],{'as':_0xed2e('0x171'),'foreignKey':_0xed2e('0x163')});db[_0xed2e('0x12f')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'as':'Owner','foreignKey':_0xed2e('0x116')});db[_0xed2e('0x12f')][_0xed2e('0x124')](db[_0xed2e('0x172')],{'through':_0xed2e('0x189'),'as':_0xed2e('0x174')});db[_0xed2e('0x12f')]['belongsToMany'](db[_0xed2e('0x172')],{'through':_0xed2e('0x189'),'as':'ThroughTags'});db['SmsInteraction'][_0xed2e('0x124')](db[_0xed2e('0xf')],{'as':_0xed2e('0x176'),'through':_0xed2e('0x131'),'foreignKey':_0xed2e('0x188')});db[_0xed2e('0x57')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'as':_0xed2e('0xf')});db['SmsMessage'][_0xed2e('0x152')](db[_0xed2e('0x73')],{'onDelete':_0xed2e('0x115'),'as':_0xed2e('0x171')});db[_0xed2e('0x57')]['belongsTo'](db['SmsInteraction'],{'onDelete':_0xed2e('0x115'),'as':_0xed2e('0x178'),'foreignKey':'SmsInteractionId'});db[_0xed2e('0x57')][_0xed2e('0x152')](db['SmsAccount'],{'as':_0xed2e('0x179'),'foreignKey':_0xed2e('0x187')});db[_0xed2e('0x59')]['belongsToMany'](db[_0xed2e('0xf')],{'as':_0xed2e('0x159'),'through':_0xed2e('0x13a'),'foreignKey':_0xed2e('0x18a')});db['SmsQueue']['belongsToMany'](db['Team'],{'through':_0xed2e('0x18b'),'as':_0xed2e('0x15a')});db['OpenchannelAccount'][_0xed2e('0x119')](db[_0xed2e('0x84')],{'as':_0xed2e('0x169'),'foreignKey':_0xed2e('0x18c'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0x5b')]['hasMany'](db[_0xed2e('0x82')],{'as':'Answers','foreignKey':_0xed2e('0x18c')});db[_0xed2e('0x5b')][_0xed2e('0x119')](db[_0xed2e('0x5e')],{'as':'Interactions','foreignKey':_0xed2e('0x18c')});db[_0xed2e('0x5b')][_0xed2e('0x119')](db['OpenchannelMessage'],{'as':_0xed2e('0x15c'),'foreignKey':_0xed2e('0x18c')});db[_0xed2e('0x5b')][_0xed2e('0x119')](db[_0xed2e('0x18d')],{'as':_0xed2e('0x14a'),'foreignKey':_0xed2e('0x18c'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0x5b')]['belongsTo'](db[_0xed2e('0xf5')],{'as':'List','foreignKey':_0xed2e('0x16d')});db[_0xed2e('0x5b')]['belongsTo'](db['Pause'],{'as':_0xed2e('0x157'),'foreignKey':_0xed2e('0x16e')});db[_0xed2e('0x5b')][_0xed2e('0x124')](db[_0xed2e('0xf')],{'as':_0xed2e('0x159'),'through':_0xed2e('0x18e')});db['OpenchannelApplication']['belongsTo'](db[_0xed2e('0xf')],{'onDelete':_0xed2e('0x165')});db[_0xed2e('0x18d')][_0xed2e('0x152')](db[_0xed2e('0x18f')],{'onDelete':_0xed2e('0x165'),'foreignKey':_0xed2e('0x190')});db[_0xed2e('0x18d')][_0xed2e('0x152')](db[_0xed2e('0x5b')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db['OpenchannelApplication'][_0xed2e('0x152')](db[_0xed2e('0x85')],{'onDelete':_0xed2e('0x165'),'foreignKey':_0xed2e('0x156')});db['OpenchannelApplication']['belongsTo'](db[_0xed2e('0x172')],{'onDelete':'restrict','foreignKey':_0xed2e('0x17c')});db['OpenchannelInteraction'][_0xed2e('0x119')](db['OpenchannelMessage'],{'as':'Messages','onDelete':_0xed2e('0x115'),'foreignKey':'OpenchannelInteractionId'});db[_0xed2e('0x5e')]['belongsTo'](db['OpenchannelAccount'],{'as':_0xed2e('0x179'),'foreignKey':_0xed2e('0x18c')});db[_0xed2e('0x5e')][_0xed2e('0x152')](db[_0xed2e('0x73')],{'as':'Contact','foreignKey':'ContactId'});db[_0xed2e('0x5e')][_0xed2e('0x152')](db['User'],{'as':_0xed2e('0x183'),'foreignKey':_0xed2e('0x116')});db[_0xed2e('0x5e')]['belongsToMany'](db[_0xed2e('0x172')],{'through':_0xed2e('0x191'),'as':_0xed2e('0x174')});db[_0xed2e('0x5e')][_0xed2e('0x124')](db['Tag'],{'through':_0xed2e('0x191'),'as':'ThroughTags'});db[_0xed2e('0x5e')]['belongsToMany'](db[_0xed2e('0xf')],{'as':_0xed2e('0x176'),'through':_0xed2e('0x192'),'foreignKey':_0xed2e('0x193')});db[_0xed2e('0x5f')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'onDelete':_0xed2e('0x115'),'as':'User'});db[_0xed2e('0x5f')]['belongsTo'](db[_0xed2e('0x73')],{'onDelete':'cascade','as':_0xed2e('0x171')});db[_0xed2e('0x5f')][_0xed2e('0x152')](db[_0xed2e('0x5e')],{'onDelete':'cascade','as':_0xed2e('0x178'),'foreignKey':_0xed2e('0x193')});db['OpenchannelMessage'][_0xed2e('0x152')](db[_0xed2e('0xe9')],{'as':'Attachment','foreignKey':_0xed2e('0x185')});db[_0xed2e('0x5f')][_0xed2e('0x152')](db[_0xed2e('0x5b')],{'as':_0xed2e('0x179'),'foreignKey':'OpenchannelAccountId'});db[_0xed2e('0x18f')][_0xed2e('0x124')](db['User'],{'as':_0xed2e('0x159'),'through':_0xed2e('0x13c'),'foreignKey':_0xed2e('0x190')});db[_0xed2e('0x18f')][_0xed2e('0x124')](db[_0xed2e('0xe2')],{'through':_0xed2e('0x194'),'as':_0xed2e('0x15a')});db['ChatWebsite'][_0xed2e('0x119')](db['Disposition'],{'as':_0xed2e('0x169'),'foreignKey':_0xed2e('0x195'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0x62')][_0xed2e('0x119')](db[_0xed2e('0x82')],{'as':_0xed2e('0x16a'),'foreignKey':_0xed2e('0x195')});db[_0xed2e('0x62')]['hasMany'](db[_0xed2e('0x70')],{'as':_0xed2e('0x196')});db['ChatWebsite'][_0xed2e('0x119')](db['ChatInteraction'],{'as':_0xed2e('0x16b')});db[_0xed2e('0x62')][_0xed2e('0x119')](db[_0xed2e('0x66')],{'as':_0xed2e('0x14a'),'foreignKey':_0xed2e('0x195'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0x62')][_0xed2e('0x119')](db[_0xed2e('0x69')],{'as':_0xed2e('0x15c')});db['ChatWebsite'][_0xed2e('0x152')](db['CmList'],{'as':'List','foreignKey':_0xed2e('0x16d')});db[_0xed2e('0x62')][_0xed2e('0x152')](db[_0xed2e('0x85')],{'as':_0xed2e('0x85'),'foreignKey':_0xed2e('0x156')});db['ChatWebsite']['belongsTo'](db['MailAccount'],{'as':_0xed2e('0x38'),'foreignKey':_0xed2e('0x164')});db[_0xed2e('0x62')]['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xed2e('0x16e')});db[_0xed2e('0x62')][_0xed2e('0x124')](db['User'],{'as':_0xed2e('0x159'),'through':_0xed2e('0x13e')});db[_0xed2e('0x64')][_0xed2e('0x152')](db[_0xed2e('0x5b')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0xed2e('0xf5')],{'as':_0xed2e('0x16c'),'foreignKey':_0xed2e('0x16d')});db['OpenchannelQueueReport'][_0xed2e('0x152')](db[_0xed2e('0x73')],{'as':'Contact','foreignKey':_0xed2e('0x163')});db[_0xed2e('0x64')][_0xed2e('0x152')](db['OpenchannelInteraction'],{});db[_0xed2e('0x64')][_0xed2e('0x152')](db[_0xed2e('0x5f')],{});db[_0xed2e('0x64')][_0xed2e('0x152')](db[_0xed2e('0xf')],{});db[_0xed2e('0x64')][_0xed2e('0x152')](db[_0xed2e('0x18f')],{});db[_0xed2e('0x66')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'as':_0xed2e('0x197'),'foreignKey':_0xed2e('0x116'),'onDelete':'restrict'});db[_0xed2e('0x66')][_0xed2e('0x152')](db[_0xed2e('0x6c')],{'as':'Queue','foreignKey':_0xed2e('0x198'),'onDelete':_0xed2e('0x165')});db[_0xed2e('0x66')][_0xed2e('0x152')](db[_0xed2e('0x62')],{'as':_0xed2e('0x199'),'foreignKey':_0xed2e('0x195'),'onDelete':'restrict'});db[_0xed2e('0x66')]['belongsTo'](db[_0xed2e('0x172')],{'onDelete':_0xed2e('0x165'),'foreignKey':_0xed2e('0x17c')});db[_0xed2e('0x68')][_0xed2e('0x119')](db[_0xed2e('0x69')],{'as':'Messages','onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x19a')});db[_0xed2e('0x68')][_0xed2e('0x152')](db[_0xed2e('0x62')],{'as':'Account','foreignKey':_0xed2e('0x195')});db['ChatInteraction']['belongsTo'](db[_0xed2e('0x73')],{'as':_0xed2e('0x171'),'foreignKey':'ContactId'});db[_0xed2e('0x68')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'as':'Owner','foreignKey':_0xed2e('0x116')});db['ChatInteraction']['belongsToMany'](db['Tag'],{'through':_0xed2e('0x19b'),'as':_0xed2e('0x174')});db[_0xed2e('0x68')][_0xed2e('0x124')](db['Tag'],{'through':_0xed2e('0x19b'),'as':_0xed2e('0x175')});db['ChatInteraction'][_0xed2e('0x124')](db[_0xed2e('0xf')],{'as':_0xed2e('0x176'),'through':_0xed2e('0x12c'),'foreignKey':_0xed2e('0x19a')});db[_0xed2e('0x69')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'onDelete':_0xed2e('0x115'),'as':_0xed2e('0xf')});db[_0xed2e('0x69')][_0xed2e('0x152')](db['CmContact'],{'onDelete':_0xed2e('0x115'),'as':_0xed2e('0x171'),'foreignKey':_0xed2e('0x163')});db[_0xed2e('0x69')][_0xed2e('0x152')](db[_0xed2e('0x68')],{'onDelete':_0xed2e('0x115'),'as':'Interaction','foreignKey':_0xed2e('0x19a')});db['ChatMessage']['belongsTo'](db[_0xed2e('0xe9')],{'as':'Attachment','foreignKey':_0xed2e('0x185')});db[_0xed2e('0x69')][_0xed2e('0x152')](db[_0xed2e('0x62')],{'as':_0xed2e('0x179'),'foreignKey':_0xed2e('0x195')});db['ChatOfflineMessage']['hasMany'](db[_0xed2e('0xe9')],{'as':_0xed2e('0x177'),'foreignKey':'ChatOfflineMessageId','onDelete':'cascade','hooks':!![]});db['ChatOfflineMessage'][_0xed2e('0x152')](db['CmContact'],{'onDelete':'cascade','as':_0xed2e('0x171'),'foreignKey':_0xed2e('0x163')});db[_0xed2e('0x17a')][_0xed2e('0x152')](db[_0xed2e('0x62')],{'as':_0xed2e('0x179'),'foreignKey':_0xed2e('0x195')});db['ChatQueue'][_0xed2e('0x124')](db[_0xed2e('0xf')],{'as':_0xed2e('0x159'),'through':_0xed2e('0x136'),'hooks':!![]});db['ChatQueue'][_0xed2e('0x124')](db['Team'],{'through':'team_has_chat_queues','as':_0xed2e('0x15a')});db[_0xed2e('0x6e')][_0xed2e('0x119')](db['ChatInternalMessage'],{'as':_0xed2e('0x15c'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0xed2e('0x6e')][_0xed2e('0x124')](db[_0xed2e('0xf')],{'as':_0xed2e('0x19c'),'through':_0xed2e('0x126')});db[_0xed2e('0x70')][_0xed2e('0x152')](db[_0xed2e('0x62')],{'as':_0xed2e('0x199'),'foreignKey':_0xed2e('0x195')});db[_0xed2e('0x19d')][_0xed2e('0x119')](db[_0xed2e('0x73')],{'as':_0xed2e('0x127'),'foreignKey':_0xed2e('0x19e')});db[_0xed2e('0x73')][_0xed2e('0x119')](db[_0xed2e('0x19f')],{'as':'Phones','foreignKey':_0xed2e('0x1a0')});db[_0xed2e('0x73')][_0xed2e('0x119')](db[_0xed2e('0x75')],{'as':_0xed2e('0x123'),'foreignKey':_0xed2e('0x163')});db[_0xed2e('0x73')]['hasMany'](db[_0xed2e('0x78')],{'as':_0xed2e('0x11c'),'foreignKey':_0xed2e('0x163')});db[_0xed2e('0x73')][_0xed2e('0x119')](db['CmHopperHistory'],{'as':_0xed2e('0x14e'),'foreignKey':'ContactId'});db[_0xed2e('0x73')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xed2e('0x163')});db['CmContact'][_0xed2e('0x119')](db['JscriptySessionReport'],{'as':_0xed2e('0x151'),'foreignKey':_0xed2e('0x163')});db[_0xed2e('0x73')]['hasMany'](db[_0xed2e('0x5e')],{'as':'OpenchannelInteractions','foreignKey':_0xed2e('0x163'),'onDelete':_0xed2e('0x165')});db['CmContact'][_0xed2e('0x119')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0xed2e('0x163'),'onDelete':'restrict'});db[_0xed2e('0x73')][_0xed2e('0x119')](db[_0xed2e('0x12f')],{'as':_0xed2e('0x130'),'foreignKey':_0xed2e('0x163'),'onDelete':_0xed2e('0x165')});db[_0xed2e('0x73')]['hasMany'](db[_0xed2e('0x4b')],{'as':_0xed2e('0x12d'),'foreignKey':_0xed2e('0x163'),'onDelete':'restrict'});db['CmContact'][_0xed2e('0x119')](db[_0xed2e('0x3e')],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':_0xed2e('0x165')});db['CmContact'][_0xed2e('0x152')](db['CmCompany'],{'as':_0xed2e('0x1a1'),'foreignKey':_0xed2e('0x19e')});db[_0xed2e('0x73')][_0xed2e('0x152')](db[_0xed2e('0xf5')],{'as':_0xed2e('0x16c'),'foreignKey':_0xed2e('0x16d'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0x73')]['belongsToMany'](db[_0xed2e('0xf')],{'as':_0xed2e('0x176'),'through':_0xed2e('0x128')});db['CmContact'][_0xed2e('0x124')](db[_0xed2e('0x172')],{'as':'Tags','through':_0xed2e('0x1a2')});db[_0xed2e('0x73')][_0xed2e('0x124')](db[_0xed2e('0x172')],{'through':_0xed2e('0x1a2'),'as':'ThroughTags'});db[_0xed2e('0x75')][_0xed2e('0x119')](db['CmHopperAdditionalPhone'],{'as':_0xed2e('0x1a3'),'foreignKey':_0xed2e('0x1a4')});db[_0xed2e('0x75')][_0xed2e('0x152')](db[_0xed2e('0x73')],{'as':_0xed2e('0x171'),'foreignKey':_0xed2e('0x163'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0x75')][_0xed2e('0x152')](db[_0xed2e('0xf5')],{'as':_0xed2e('0x16c'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xed2e('0x75')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'as':_0xed2e('0x197'),'foreignKey':_0xed2e('0x116')});db[_0xed2e('0x75')][_0xed2e('0x152')](db[_0xed2e('0x1a')],{'as':_0xed2e('0x1a5'),'foreignKey':_0xed2e('0x14d'),'onDelete':'cascade'});db['CmHopper'][_0xed2e('0x152')](db[_0xed2e('0xe6')],{'as':'Campaign','foreignKey':_0xed2e('0x1a6'),'onDelete':'cascade'});db[_0xed2e('0x75')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'as':'Owner','foreignKey':_0xed2e('0x1a7')});db[_0xed2e('0x76')]['belongsTo'](db[_0xed2e('0x73')],{'as':_0xed2e('0x171'),'foreignKey':_0xed2e('0x163'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0x76')][_0xed2e('0x152')](db[_0xed2e('0xf5')],{'as':_0xed2e('0x16c'),'foreignKey':_0xed2e('0x16d'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0x76')][_0xed2e('0x152')](db['VoiceQueue'],{'as':_0xed2e('0x1a5'),'foreignKey':'VoiceQueueId','onDelete':_0xed2e('0x115')});db[_0xed2e('0x76')]['belongsTo'](db[_0xed2e('0xe6')],{'as':_0xed2e('0xe6'),'foreignKey':_0xed2e('0x1a6'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0x80')]['hasMany'](db[_0xed2e('0x1a8')],{'as':{'plural':'All','singular':_0xed2e('0x1a9')},'foreignKey':_0xed2e('0x1aa'),'onDelete':_0xed2e('0x115'),'hooks':!![]});db[_0xed2e('0x80')]['hasMany'](db[_0xed2e('0x1a8')],{'as':{'plural':_0xed2e('0x1ab'),'singular':_0xed2e('0x1ac')},'foreignKey':_0xed2e('0x1ad'),'onDelete':_0xed2e('0x115'),'hooks':!![]});db[_0xed2e('0x80')]['hasMany'](db[_0xed2e('0x7e')],{'as':'Actions','foreignKey':_0xed2e('0x1ae'),'onDelete':_0xed2e('0x115'),'hooks':!![]});db[_0xed2e('0x84')][_0xed2e('0x119')](db[_0xed2e('0x84')],{'as':_0xed2e('0x169'),'foreignKey':_0xed2e('0x1af'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0x85')][_0xed2e('0x119')](db['Interval'],{'as':_0xed2e('0x1b0'),'foreignKey':_0xed2e('0x156'),'onDelete':_0xed2e('0x115'),'hooks':!![],'required':![]});db[_0xed2e('0x85')][_0xed2e('0x119')](db['VoiceExtension'],{'as':'Extensions','foreignKey':_0xed2e('0x156'),'onDelete':_0xed2e('0x165')});db[_0xed2e('0x85')][_0xed2e('0x119')](db['MailApplication'],{'as':_0xed2e('0x1b1'),'foreignKey':_0xed2e('0x156')});db[_0xed2e('0x85')][_0xed2e('0x119')](db[_0xed2e('0x66')],{'as':'ChatApplications','foreignKey':_0xed2e('0x156')});db['Interval'][_0xed2e('0x119')](db[_0xed2e('0x49')],{'as':_0xed2e('0x1b2'),'foreignKey':'IntervalId'});db[_0xed2e('0x85')]['hasMany'](db[_0xed2e('0x54')],{'as':'SmsApplications','foreignKey':_0xed2e('0x156')});db[_0xed2e('0x8d')][_0xed2e('0x152')](db['MailAccount'],{});db['Schedule'][_0xed2e('0x152')](db[_0xed2e('0x9d')],{'foreignKey':_0xed2e('0x1b3')});db[_0xed2e('0x8d')]['belongsTo'](db[_0xed2e('0x9c')],{'foreignKey':_0xed2e('0x1b4')});db[_0xed2e('0x1b5')][_0xed2e('0x124')](db[_0xed2e('0x18')],{'as':'Mohs','through':_0xed2e('0x14c'),'onDelete':'restrict'});db[_0xed2e('0x172')]['belongsToMany'](db[_0xed2e('0x73')],{'through':_0xed2e('0x1a2')});db[_0xed2e('0x172')][_0xed2e('0x124')](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db['Tag'][_0xed2e('0x124')](db[_0xed2e('0x3e')],{'through':_0xed2e('0x173')});db[_0xed2e('0x172')]['belongsToMany'](db[_0xed2e('0x12f')],{'through':_0xed2e('0x189')});db[_0xed2e('0x172')][_0xed2e('0x124')](db[_0xed2e('0x4b')],{'through':_0xed2e('0x184')});db[_0xed2e('0x172')][_0xed2e('0x124')](db[_0xed2e('0x5e')],{'through':_0xed2e('0x191')});db[_0xed2e('0x172')]['belongsToMany'](db[_0xed2e('0x103')],{'through':_0xed2e('0x1b6')});db[_0xed2e('0x19f')][_0xed2e('0x152')](db['ContactItemType'],{'as':_0xed2e('0x1b7'),'foreignKey':_0xed2e('0x1b8')});db[_0xed2e('0x92')][_0xed2e('0x152')](db[_0xed2e('0x75')],{'as':_0xed2e('0x1b9'),'foreignKey':_0xed2e('0x1a4')});db[_0xed2e('0x19f')]['belongsTo'](db['CmContact'],{'as':_0xed2e('0x171'),'foreignKey':_0xed2e('0x1a0')});db['Trigger'][_0xed2e('0x119')](db[_0xed2e('0x1a8')],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':_0xed2e('0x1ba'),'onDelete':'cascade','hooks':!![]});db[_0xed2e('0x1bb')]['hasMany'](db['Condition'],{'as':{'plural':_0xed2e('0x1bc'),'singular':_0xed2e('0x1bd')},'foreignKey':_0xed2e('0x1be'),'onDelete':'cascade','hooks':!![]});db[_0xed2e('0x1bb')][_0xed2e('0x119')](db[_0xed2e('0x7e')],{'as':_0xed2e('0x1bf'),'foreignKey':_0xed2e('0x1c0'),'onDelete':_0xed2e('0x115'),'hooks':!![]});db[_0xed2e('0x9c')][_0xed2e('0x119')](db[_0xed2e('0xa0')],{'as':_0xed2e('0x1c1'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1b4'),'hooks':!![]});db[_0xed2e('0x9d')]['hasMany'](db[_0xed2e('0xa0')],{'as':_0xed2e('0x1c1'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1b3')});db[_0xed2e('0x1c2')]['hasMany'](db[_0xed2e('0xa0')],{'as':_0xed2e('0x1c1'),'onDelete':'cascade','foreignKey':_0xed2e('0x1c3')});db[_0xed2e('0xa0')][_0xed2e('0x152')](db[_0xed2e('0x1c2')],{'foreignKey':_0xed2e('0x1c3')});db[_0xed2e('0xa3')][_0xed2e('0x119')](db[_0xed2e('0xa5')],{'as':_0xed2e('0x1c4'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xed2e('0xa5')]['hasMany'](db[_0xed2e('0xa7')],{'as':_0xed2e('0x1c5'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1c6')});db['SalesforceConfiguration'][_0xed2e('0x119')](db[_0xed2e('0xa7')],{'as':_0xed2e('0x1c7'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1c8')});db[_0xed2e('0xa5')][_0xed2e('0x119')](db[_0xed2e('0xa7')],{'as':_0xed2e('0x1c1'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1c9')});db[_0xed2e('0xa5')][_0xed2e('0x152')](db[_0xed2e('0xa3')],{'as':_0xed2e('0x179'),'foreignKey':_0xed2e('0x1ca')});db[_0xed2e('0xa7')]['hasMany'](db['SalesforceField'],{'as':_0xed2e('0x1cb'),'foreignKey':_0xed2e('0x1c6')});db[_0xed2e('0xa7')][_0xed2e('0x119')](db['SalesforceField'],{'as':_0xed2e('0x1cc'),'foreignKey':_0xed2e('0x1c8')});db[_0xed2e('0xa7')][_0xed2e('0x119')](db[_0xed2e('0xa7')],{'as':'Field','foreignKey':_0xed2e('0x1c9')});db['SalesforceField'][_0xed2e('0x152')](db[_0xed2e('0x97')],{'as':_0xed2e('0x97'),'foreignKey':_0xed2e('0x1cd')});db[_0xed2e('0xa9')][_0xed2e('0x119')](db[_0xed2e('0xab')],{'as':_0xed2e('0x1c4'),'onDelete':_0xed2e('0x115'),'foreignKey':'AccountId'});db['SugarcrmConfiguration'][_0xed2e('0x119')](db[_0xed2e('0x1ce')],{'as':'Subjects','onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1c6')});db[_0xed2e('0xab')]['hasMany'](db[_0xed2e('0x1ce')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0xed2e('0x119')](db[_0xed2e('0x1ce')],{'as':'Fields','onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1c9')});db[_0xed2e('0xab')][_0xed2e('0x152')](db[_0xed2e('0xa9')],{'as':'Account','foreignKey':'AccountId'});db['SugarcrmField'][_0xed2e('0x119')](db['SugarcrmField'],{'as':_0xed2e('0x1cb'),'foreignKey':_0xed2e('0x1c6')});db[_0xed2e('0x1ce')]['hasMany'](db['SugarcrmField'],{'as':_0xed2e('0x1cc'),'foreignKey':'DescriptionId'});db[_0xed2e('0x1ce')][_0xed2e('0x119')](db[_0xed2e('0x1ce')],{'as':_0xed2e('0x1cf'),'foreignKey':_0xed2e('0x1c9')});db[_0xed2e('0x1ce')][_0xed2e('0x152')](db[_0xed2e('0x97')],{'as':'Variable','foreignKey':_0xed2e('0x1cd')});db[_0xed2e('0x1d0')]['hasMany'](db[_0xed2e('0x1d1')],{'as':'Configurations','onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1ca')});db[_0xed2e('0x1d1')][_0xed2e('0x119')](db[_0xed2e('0xaf')],{'as':_0xed2e('0x1c5'),'onDelete':'cascade','foreignKey':'SubjectId'});db['DeskConfiguration'][_0xed2e('0x119')](db[_0xed2e('0xaf')],{'as':_0xed2e('0x1c7'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1c8')});db[_0xed2e('0x1d1')][_0xed2e('0x119')](db[_0xed2e('0xaf')],{'as':_0xed2e('0x1c1'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1c9')});db[_0xed2e('0x1d1')][_0xed2e('0x152')](db[_0xed2e('0x1d0')],{'as':_0xed2e('0x179'),'foreignKey':_0xed2e('0x1ca')});db['DeskConfiguration']['belongsToMany'](db[_0xed2e('0x172')],{'through':_0xed2e('0x1d2')});db['DeskField']['hasMany'](db['DeskField'],{'as':'Subject','foreignKey':_0xed2e('0x1c6')});db[_0xed2e('0xaf')][_0xed2e('0x119')](db[_0xed2e('0xaf')],{'as':_0xed2e('0x1cc'),'foreignKey':'DescriptionId'});db[_0xed2e('0xaf')]['hasMany'](db['DeskField'],{'as':_0xed2e('0x1cf'),'foreignKey':'FieldId'});db[_0xed2e('0xaf')][_0xed2e('0x152')](db['Variable'],{'as':_0xed2e('0x97'),'foreignKey':_0xed2e('0x1cd')});db[_0xed2e('0xb0')]['hasMany'](db[_0xed2e('0x1d3')],{'as':_0xed2e('0x1c4'),'onDelete':'cascade','foreignKey':_0xed2e('0x1ca')});db[_0xed2e('0x1d3')][_0xed2e('0x119')](db[_0xed2e('0xb1')],{'as':_0xed2e('0x1c5'),'onDelete':_0xed2e('0x115'),'foreignKey':'SubjectId'});db[_0xed2e('0x1d3')][_0xed2e('0x119')](db[_0xed2e('0xb1')],{'as':_0xed2e('0x1c7'),'onDelete':_0xed2e('0x115'),'foreignKey':'DescriptionId'});db[_0xed2e('0x1d3')][_0xed2e('0x119')](db[_0xed2e('0xb1')],{'as':_0xed2e('0x1c1'),'onDelete':'cascade','foreignKey':_0xed2e('0x1c9')});db[_0xed2e('0x1d3')][_0xed2e('0x152')](db[_0xed2e('0xb0')],{'as':_0xed2e('0x179'),'foreignKey':_0xed2e('0x1ca')});db[_0xed2e('0xb1')]['hasMany'](db[_0xed2e('0xb1')],{'as':_0xed2e('0x1cb'),'foreignKey':'SubjectId'});db['ZohoField'][_0xed2e('0x119')](db[_0xed2e('0xb1')],{'as':'Description','foreignKey':_0xed2e('0x1c8')});db[_0xed2e('0xb1')][_0xed2e('0x119')](db[_0xed2e('0xb1')],{'as':_0xed2e('0x1cf'),'foreignKey':_0xed2e('0x1c9')});db['ZohoField']['belongsTo'](db[_0xed2e('0x97')],{'as':_0xed2e('0x97'),'foreignKey':_0xed2e('0x1cd')});db['ZendeskAccount'][_0xed2e('0x119')](db['ZendeskConfiguration'],{'as':_0xed2e('0x1c4'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1ca')});db['ZendeskConfiguration'][_0xed2e('0x119')](db[_0xed2e('0x1d4')],{'as':'Subjects','foreignKey':_0xed2e('0x1c6')});db['ZendeskConfiguration'][_0xed2e('0x119')](db['ZendeskField'],{'as':_0xed2e('0x1c7'),'foreignKey':_0xed2e('0x1c8')});db['ZendeskConfiguration'][_0xed2e('0x119')](db[_0xed2e('0x1d4')],{'as':'Fields','foreignKey':_0xed2e('0x1c9')});db[_0xed2e('0x1d5')][_0xed2e('0x152')](db['ZendeskAccount'],{'as':_0xed2e('0x179'),'foreignKey':'AccountId'});db[_0xed2e('0x1d5')][_0xed2e('0x124')](db[_0xed2e('0x172')],{'through':_0xed2e('0x1d6')});db['ZendeskField']['hasMany'](db[_0xed2e('0x1d4')],{'as':_0xed2e('0x1cb'),'foreignKey':_0xed2e('0x1c6')});db[_0xed2e('0x1d4')]['hasMany'](db[_0xed2e('0x1d4')],{'as':_0xed2e('0x1cc'),'foreignKey':_0xed2e('0x1c8')});db[_0xed2e('0x1d4')][_0xed2e('0x119')](db['ZendeskField'],{'as':_0xed2e('0x1cf'),'foreignKey':_0xed2e('0x1c9')});db[_0xed2e('0x1d4')][_0xed2e('0x152')](db[_0xed2e('0x97')],{'as':_0xed2e('0x97'),'foreignKey':_0xed2e('0x1cd')});db[_0xed2e('0xb5')]['hasMany'](db[_0xed2e('0xb6')],{'as':_0xed2e('0x1c4'),'onDelete':_0xed2e('0x115'),'foreignKey':'AccountId'});db[_0xed2e('0xb6')][_0xed2e('0x119')](db[_0xed2e('0xb7')],{'as':_0xed2e('0x1c5'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1c6')});db[_0xed2e('0xb6')][_0xed2e('0x119')](db[_0xed2e('0xb7')],{'as':'Descriptions','onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1c8')});db[_0xed2e('0xb6')][_0xed2e('0x119')](db[_0xed2e('0xb7')],{'as':_0xed2e('0x1c1'),'onDelete':'cascade','foreignKey':_0xed2e('0x1c9')});db['FreshdeskConfiguration'][_0xed2e('0x152')](db[_0xed2e('0xb5')],{'as':_0xed2e('0x179'),'foreignKey':_0xed2e('0x1ca')});db['FreshdeskConfiguration'][_0xed2e('0x124')](db[_0xed2e('0x172')],{'through':_0xed2e('0x1d7')});db['FreshdeskField'][_0xed2e('0x119')](db[_0xed2e('0xb7')],{'as':_0xed2e('0x1cb'),'foreignKey':'SubjectId'});db[_0xed2e('0xb7')][_0xed2e('0x119')](db[_0xed2e('0xb7')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xed2e('0xb7')]['hasMany'](db[_0xed2e('0xb7')],{'as':'Field','foreignKey':_0xed2e('0x1c9')});db['FreshdeskField']['belongsTo'](db[_0xed2e('0x97')],{'as':'Variable','foreignKey':_0xed2e('0x1cd')});db['VtigerAccount'][_0xed2e('0x119')](db[_0xed2e('0xb8')],{'as':_0xed2e('0x1c4'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1ca')});db['VtigerConfiguration'][_0xed2e('0x119')](db[_0xed2e('0xb9')],{'as':_0xed2e('0x1c5'),'foreignKey':'SubjectId'});db[_0xed2e('0xb8')][_0xed2e('0x119')](db[_0xed2e('0xb9')],{'as':'Descriptions','foreignKey':_0xed2e('0x1c8')});db[_0xed2e('0xb8')][_0xed2e('0x119')](db[_0xed2e('0xb9')],{'as':_0xed2e('0x1c1'),'foreignKey':_0xed2e('0x1c9')});db[_0xed2e('0xb8')][_0xed2e('0x152')](db[_0xed2e('0x1d8')],{'as':_0xed2e('0x179'),'foreignKey':_0xed2e('0x1ca')});db[_0xed2e('0xb9')][_0xed2e('0x119')](db[_0xed2e('0xb9')],{'as':_0xed2e('0x1cb'),'foreignKey':_0xed2e('0x1c6')});db[_0xed2e('0xb9')]['hasMany'](db[_0xed2e('0xb9')],{'as':'Description','foreignKey':_0xed2e('0x1c8')});db[_0xed2e('0xb9')]['hasMany'](db[_0xed2e('0xb9')],{'as':'Field','foreignKey':_0xed2e('0x1c9')});db[_0xed2e('0xb9')][_0xed2e('0x152')](db['Variable'],{'as':_0xed2e('0x97'),'foreignKey':_0xed2e('0x1cd')});db[_0xed2e('0xbb')][_0xed2e('0x119')](db[_0xed2e('0xbd')],{'as':_0xed2e('0x1c4'),'onDelete':'cascade','foreignKey':_0xed2e('0x1ca')});db['ServicenowConfiguration']['hasMany'](db['ServicenowField'],{'as':'Subjects','foreignKey':_0xed2e('0x1c6')});db[_0xed2e('0xbd')][_0xed2e('0x119')](db[_0xed2e('0x1d9')],{'as':_0xed2e('0x1c7'),'foreignKey':_0xed2e('0x1c8')});db['ServicenowConfiguration'][_0xed2e('0x119')](db[_0xed2e('0x1d9')],{'as':_0xed2e('0x1c1'),'foreignKey':'FieldId'});db[_0xed2e('0xbd')][_0xed2e('0x152')](db[_0xed2e('0xbb')],{'as':_0xed2e('0x179'),'foreignKey':'AccountId'});db['ServicenowField']['hasMany'](db[_0xed2e('0x1d9')],{'as':_0xed2e('0x1cb'),'foreignKey':_0xed2e('0x1c6')});db[_0xed2e('0x1d9')][_0xed2e('0x119')](db[_0xed2e('0x1d9')],{'as':_0xed2e('0x1cc'),'foreignKey':_0xed2e('0x1c8')});db['ServicenowField'][_0xed2e('0x119')](db['ServicenowField'],{'as':'Field','foreignKey':'FieldId'});db['ServicenowField']['belongsTo'](db[_0xed2e('0x97')],{'as':'Variable','foreignKey':_0xed2e('0x1cd')});db['Dynamics365Account']['hasMany'](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0xed2e('0x115'),'foreignKey':'AccountId'});db[_0xed2e('0xbf')][_0xed2e('0x152')](db[_0xed2e('0x10d')],{'as':'CloudProvider','foreignKey':_0xed2e('0x166')});db[_0xed2e('0xc1')]['hasMany'](db[_0xed2e('0xc3')],{'as':_0xed2e('0x1c5'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1c6')});db[_0xed2e('0xc1')]['hasMany'](db[_0xed2e('0xc3')],{'as':_0xed2e('0x1c7'),'onDelete':_0xed2e('0x115'),'foreignKey':'DescriptionId'});db[_0xed2e('0xc1')][_0xed2e('0x119')](db['Dynamics365Field'],{'as':_0xed2e('0x1c1'),'onDelete':'cascade','foreignKey':_0xed2e('0x1c9')});db['Dynamics365Configuration'][_0xed2e('0x152')](db[_0xed2e('0xbf')],{'as':_0xed2e('0x179'),'foreignKey':'AccountId'});db[_0xed2e('0xc3')][_0xed2e('0x119')](db[_0xed2e('0xc3')],{'as':'Subject','foreignKey':'SubjectId'});db['Dynamics365Field']['hasMany'](db[_0xed2e('0xc3')],{'as':'Description','foreignKey':_0xed2e('0x1c8')});db[_0xed2e('0xc3')][_0xed2e('0x119')](db['Dynamics365Field'],{'as':'Field','foreignKey':_0xed2e('0x1c9')});db['Dynamics365Field']['belongsTo'](db[_0xed2e('0x97')],{'as':_0xed2e('0x97'),'foreignKey':_0xed2e('0x1cd')});db[_0xed2e('0xc4')][_0xed2e('0x119')](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1ca')});db['FreshsalesConfiguration'][_0xed2e('0x119')](db[_0xed2e('0xc8')],{'as':_0xed2e('0x1c5'),'foreignKey':_0xed2e('0x1c6')});db[_0xed2e('0xc6')][_0xed2e('0x119')](db[_0xed2e('0xc8')],{'as':_0xed2e('0x1c7'),'foreignKey':'DescriptionId'});db[_0xed2e('0xc6')]['hasMany'](db[_0xed2e('0xc8')],{'as':_0xed2e('0x1c1'),'foreignKey':_0xed2e('0x1c9')});db[_0xed2e('0xc6')][_0xed2e('0x152')](db[_0xed2e('0xc4')],{'as':'Account','foreignKey':_0xed2e('0x1ca')});db['FreshsalesField'][_0xed2e('0x119')](db[_0xed2e('0xc8')],{'as':_0xed2e('0x1cb'),'foreignKey':_0xed2e('0x1c6')});db[_0xed2e('0xc8')]['hasMany'](db[_0xed2e('0xc8')],{'as':_0xed2e('0x1cc'),'foreignKey':'DescriptionId'});db['FreshsalesField'][_0xed2e('0x119')](db[_0xed2e('0xc8')],{'as':_0xed2e('0x1cf'),'foreignKey':_0xed2e('0x1c9')});db[_0xed2e('0xc8')][_0xed2e('0x152')](db['Variable'],{'as':_0xed2e('0x97'),'foreignKey':_0xed2e('0x1cd')});db['ChatQueueReport'][_0xed2e('0x152')](db[_0xed2e('0x62')],{});db[_0xed2e('0xcc')]['belongsTo'](db[_0xed2e('0xf5')],{'as':_0xed2e('0x16c'),'foreignKey':_0xed2e('0x16d')});db['ChatQueueReport']['belongsTo'](db[_0xed2e('0x73')],{'as':'Contact','foreignKey':_0xed2e('0x163')});db['ChatQueueReport'][_0xed2e('0x152')](db[_0xed2e('0x68')],{});db[_0xed2e('0xcc')][_0xed2e('0x152')](db['ChatMessage'],{});db[_0xed2e('0xcc')][_0xed2e('0x152')](db[_0xed2e('0xf')],{});db[_0xed2e('0xcc')][_0xed2e('0x152')](db[_0xed2e('0x6c')],{});db[_0xed2e('0xce')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1da')});db[_0xed2e('0xce')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x1db')});db['JscriptySessionReport'][_0xed2e('0x119')](db[_0xed2e('0xd1')],{'foreignKey':_0xed2e('0x1dc'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0xd3')][_0xed2e('0x119')](db[_0xed2e('0xcf')],{'foreignKey':_0xed2e('0x1dc'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0xd4')]['belongsTo'](db[_0xed2e('0x52')],{});db[_0xed2e('0xd4')]['belongsTo'](db[_0xed2e('0xf5')],{'as':'List','foreignKey':_0xed2e('0x16d')});db[_0xed2e('0xd4')][_0xed2e('0x152')](db[_0xed2e('0x73')],{'as':'Contact','foreignKey':_0xed2e('0x163')});db[_0xed2e('0xd4')]['belongsTo'](db[_0xed2e('0x12f')],{});db['SmsQueueReport'][_0xed2e('0x152')](db[_0xed2e('0x57')],{});db['SmsQueueReport'][_0xed2e('0x152')](db['User'],{});db[_0xed2e('0xd4')][_0xed2e('0x152')](db['SmsQueue'],{});db[_0xed2e('0xd7')]['hasMany'](db[_0xed2e('0xd3')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0xed2e('0x119')](db[_0xed2e('0xd1')],{'foreignKey':'ProjectId'});db[_0xed2e('0xd7')][_0xed2e('0x119')](db[_0xed2e('0xcf')],{'foreignKey':'ProjectId'});db[_0xed2e('0xe2')][_0xed2e('0x124')](db['User'],{'as':_0xed2e('0x159'),'through':_0xed2e('0x1dd')});db[_0xed2e('0xe2')][_0xed2e('0x124')](db['VoiceQueue'],{'through':_0xed2e('0x1de'),'as':_0xed2e('0x134')});db[_0xed2e('0xe2')][_0xed2e('0x124')](db[_0xed2e('0x3a')],{'through':_0xed2e('0x16f'),'as':_0xed2e('0x1df')});db[_0xed2e('0xe2')][_0xed2e('0x124')](db[_0xed2e('0x6c')],{'through':_0xed2e('0x1e0'),'as':_0xed2e('0x135')});db[_0xed2e('0xe2')][_0xed2e('0x124')](db[_0xed2e('0x137')],{'through':_0xed2e('0x1e1'),'as':'FaxQueues'});db[_0xed2e('0xe2')][_0xed2e('0x124')](db[_0xed2e('0x59')],{'through':_0xed2e('0x18b'),'as':_0xed2e('0x139')});db[_0xed2e('0xe2')][_0xed2e('0x124')](db[_0xed2e('0x18f')],{'through':_0xed2e('0x194'),'as':_0xed2e('0x13b')});db[_0xed2e('0xe2')][_0xed2e('0x124')](db[_0xed2e('0x10b')],{'through':_0xed2e('0x1e2'),'as':_0xed2e('0x13d')});db[_0xed2e('0xe2')][_0xed2e('0x124')](db['VoicePrefix'],{'through':_0xed2e('0x1e3'),'as':_0xed2e('0x1e4')});db[_0xed2e('0xe6')][_0xed2e('0x119')](db[_0xed2e('0x75')],{'as':'Hoppers','foreignKey':'CampaignId'});db['Campaign'][_0xed2e('0x119')](db[_0xed2e('0x78')],{'as':_0xed2e('0x11c'),'foreignKey':_0xed2e('0x1a6')});db['Campaign']['hasMany'](db[_0xed2e('0x7a')],{'as':'HopperHistories','foreignKey':_0xed2e('0x1a6')});db[_0xed2e('0xe6')][_0xed2e('0x119')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':'CampaignId'});db['Campaign'][_0xed2e('0x152')](db[_0xed2e('0x28')],{'as':_0xed2e('0x28'),'foreignKey':_0xed2e('0x153')});db[_0xed2e('0xe6')][_0xed2e('0x152')](db[_0xed2e('0x28')],{'as':_0xed2e('0x154'),'foreignKey':'TrunkBackupId'});db[_0xed2e('0xe6')][_0xed2e('0x152')](db[_0xed2e('0x85')],{'as':_0xed2e('0x85'),'foreignKey':_0xed2e('0x156')});db[_0xed2e('0xe6')]['belongsTo'](db[_0xed2e('0xdd')],{'as':_0xed2e('0xdd'),'foreignKey':_0xed2e('0x1e5')});db['Campaign'][_0xed2e('0x124')](db[_0xed2e('0xf5')],{'as':_0xed2e('0x129'),'through':_0xed2e('0x1e6')});db['Campaign']['belongsToMany'](db[_0xed2e('0xf5')],{'as':_0xed2e('0x15b'),'through':_0xed2e('0x1e7')});db[_0xed2e('0xe9')][_0xed2e('0x152')](db[_0xed2e('0x17a')],{'as':_0xed2e('0x17a'),'foreignKey':_0xed2e('0x17b')});db[_0xed2e('0xed')]['belongsTo'](db['MailMessage'],{});db[_0xed2e('0xed')][_0xed2e('0x152')](db[_0xed2e('0x3e')],{});db[_0xed2e('0xed')]['belongsTo'](db[_0xed2e('0x38')],{'foreignKey':_0xed2e('0x1e8'),'as':_0xed2e('0x1e9')});db[_0xed2e('0xed')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'foreignKey':'FromUserId','as':_0xed2e('0x1ea')});db['MailTransferReport'][_0xed2e('0x152')](db[_0xed2e('0xf')],{'foreignKey':'ToUserId','as':_0xed2e('0x1eb')});db[_0xed2e('0xed')][_0xed2e('0x152')](db[_0xed2e('0x3a')],{'foreignKey':_0xed2e('0x1ec'),'as':_0xed2e('0x1ed')});db[_0xed2e('0xed')][_0xed2e('0x152')](db[_0xed2e('0x38')],{'foreignKey':_0xed2e('0x1ee'),'as':_0xed2e('0x1ef')});db[_0xed2e('0xef')][_0xed2e('0x152')](db[_0xed2e('0x69')],{});db[_0xed2e('0xef')][_0xed2e('0x152')](db[_0xed2e('0x68')],{});db[_0xed2e('0xef')][_0xed2e('0x152')](db[_0xed2e('0x62')],{'foreignKey':_0xed2e('0x1f0'),'as':'FromAccount'});db[_0xed2e('0xef')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'foreignKey':_0xed2e('0x1f1'),'as':_0xed2e('0x1ea')});db[_0xed2e('0xef')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'foreignKey':_0xed2e('0x1f2'),'as':'ToAgent'});db[_0xed2e('0xef')][_0xed2e('0x152')](db[_0xed2e('0x6c')],{'foreignKey':'ToChatQueueId','as':_0xed2e('0x1ed')});db[_0xed2e('0xef')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0xed2e('0x1f3'),'as':_0xed2e('0x1ef')});db[_0xed2e('0xf1')][_0xed2e('0x152')](db[_0xed2e('0x4d')],{});db[_0xed2e('0xf1')][_0xed2e('0x152')](db['FaxInteraction'],{});db[_0xed2e('0xf1')][_0xed2e('0x152')](db[_0xed2e('0x47')],{'foreignKey':_0xed2e('0x1f4'),'as':_0xed2e('0x1e9')});db[_0xed2e('0xf1')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'foreignKey':_0xed2e('0x1f1'),'as':_0xed2e('0x1ea')});db[_0xed2e('0xf1')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'foreignKey':_0xed2e('0x1f2'),'as':'ToAgent'});db[_0xed2e('0xf1')][_0xed2e('0x152')](db[_0xed2e('0x137')],{'foreignKey':_0xed2e('0x1f5'),'as':_0xed2e('0x1ed')});db[_0xed2e('0xf1')]['belongsTo'](db[_0xed2e('0x47')],{'foreignKey':_0xed2e('0x1f6'),'as':_0xed2e('0x1ef')});db[_0xed2e('0x1f7')][_0xed2e('0x152')](db[_0xed2e('0x5f')],{});db[_0xed2e('0x1f7')][_0xed2e('0x152')](db[_0xed2e('0x5e')],{});db[_0xed2e('0x1f7')][_0xed2e('0x152')](db[_0xed2e('0x5b')],{'foreignKey':_0xed2e('0x1f8'),'as':_0xed2e('0x1e9')});db['OpenchannelTransferReport'][_0xed2e('0x152')](db[_0xed2e('0xf')],{'foreignKey':_0xed2e('0x1f1'),'as':_0xed2e('0x1ea')});db[_0xed2e('0x1f7')][_0xed2e('0x152')](db['User'],{'foreignKey':_0xed2e('0x1f2'),'as':_0xed2e('0x1eb')});db[_0xed2e('0x1f7')][_0xed2e('0x152')](db[_0xed2e('0x18f')],{'foreignKey':_0xed2e('0x1f9'),'as':'ToQueue'});db[_0xed2e('0x1f7')][_0xed2e('0x152')](db[_0xed2e('0x5b')],{'foreignKey':'ToOpenchannelAccountId','as':_0xed2e('0x1ef')});db[_0xed2e('0xf3')][_0xed2e('0x152')](db['SmsMessage'],{});db['SmsTransferReport']['belongsTo'](db[_0xed2e('0x12f')],{});db[_0xed2e('0xf3')][_0xed2e('0x152')](db[_0xed2e('0x52')],{'foreignKey':_0xed2e('0x1fa'),'as':'FromAccount'});db[_0xed2e('0xf3')]['belongsTo'](db[_0xed2e('0xf')],{'foreignKey':_0xed2e('0x1f1'),'as':_0xed2e('0x1ea')});db['SmsTransferReport'][_0xed2e('0x152')](db[_0xed2e('0xf')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xed2e('0xf3')][_0xed2e('0x152')](db[_0xed2e('0x59')],{'foreignKey':_0xed2e('0x1fb'),'as':_0xed2e('0x1ed')});db[_0xed2e('0xf3')][_0xed2e('0x152')](db['SmsAccount'],{'foreignKey':_0xed2e('0x1fc'),'as':_0xed2e('0x1ef')});db[_0xed2e('0xf5')][_0xed2e('0x119')](db[_0xed2e('0x84')],{'as':'Dispositions','foreignKey':_0xed2e('0x16d'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0xf5')]['hasMany'](db[_0xed2e('0x7d')],{'as':_0xed2e('0x1fd'),'foreignKey':'ListId'});db[_0xed2e('0xf5')]['hasMany'](db[_0xed2e('0x73')],{'as':_0xed2e('0x127'),'onDelete':_0xed2e('0x115'),'foreignKey':_0xed2e('0x16d')});db[_0xed2e('0xf5')][_0xed2e('0x119')](db['CmHopperFinal'],{'as':_0xed2e('0x11c'),'foreignKey':_0xed2e('0x16d')});db[_0xed2e('0xf5')][_0xed2e('0x119')](db[_0xed2e('0x7a')],{'as':'HopperHistory','foreignKey':_0xed2e('0x16d')});db[_0xed2e('0xf5')][_0xed2e('0x119')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xed2e('0x16d')});db[_0xed2e('0xf5')][_0xed2e('0x124')](db[_0xed2e('0x1a')],{'as':'Queues','through':_0xed2e('0x158')});db[_0xed2e('0xf5')][_0xed2e('0x124')](db['User'],{'as':_0xed2e('0x159'),'through':'cm_user_has_lists'});db['VoicePrefix'][_0xed2e('0x119')](db[_0xed2e('0x16')],{'as':'Extensions','onDelete':_0xed2e('0x115')});db[_0xed2e('0xf7')][_0xed2e('0x124')](db['User'],{'as':'Agents','through':_0xed2e('0x110')});db[_0xed2e('0xf7')][_0xed2e('0x124')](db[_0xed2e('0xe2')],{'through':'TeamVoicePrefix','as':_0xed2e('0x15a')});db['UserProfile'][_0xed2e('0x119')](db[_0xed2e('0xf')],{'as':'Users','foreignKey':_0xed2e('0x1fe')});db[_0xed2e('0xf9')][_0xed2e('0x119')](db[_0xed2e('0xfb')],{'as':_0xed2e('0x1ff'),'foreignKey':'userProfileId','onDelete':'cascade'});db[_0xed2e('0xfb')][_0xed2e('0x119')](db['UserProfileResource'],{'as':'Resources','foreignKey':_0xed2e('0x200'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0x146')][_0xed2e('0x119')](db[_0xed2e('0x84')],{'as':_0xed2e('0x169'),'foreignKey':'WhatsappAccountId','onDelete':_0xed2e('0x115')});db[_0xed2e('0x146')][_0xed2e('0x119')](db[_0xed2e('0x82')],{'as':'Answers','foreignKey':_0xed2e('0x201')});db[_0xed2e('0x146')][_0xed2e('0x119')](db[_0xed2e('0x105')],{'as':_0xed2e('0x15c'),'foreignKey':_0xed2e('0x201')});db[_0xed2e('0x146')][_0xed2e('0x119')](db[_0xed2e('0x103')],{'as':_0xed2e('0x16b')});db['WhatsappAccount'][_0xed2e('0x119')](db[_0xed2e('0x101')],{'as':_0xed2e('0x14a'),'foreignKey':_0xed2e('0x201'),'onDelete':_0xed2e('0x115')});db[_0xed2e('0x146')][_0xed2e('0x152')](db['CmList'],{'as':_0xed2e('0x16c'),'foreignKey':_0xed2e('0x16d')});db[_0xed2e('0x146')][_0xed2e('0x152')](db[_0xed2e('0x87')],{'as':_0xed2e('0x157'),'foreignKey':_0xed2e('0x16e')});db[_0xed2e('0x146')][_0xed2e('0x124')](db[_0xed2e('0xf')],{'as':_0xed2e('0x159'),'through':'user_has_whatsapp_accounts'});db[_0xed2e('0x101')][_0xed2e('0x152')](db['User'],{'onDelete':_0xed2e('0x165')});db['WhatsappApplication'][_0xed2e('0x152')](db['WhatsappQueue'],{'onDelete':_0xed2e('0x165')});db['WhatsappApplication'][_0xed2e('0x152')](db[_0xed2e('0x146')],{'onDelete':_0xed2e('0x165')});db[_0xed2e('0x101')][_0xed2e('0x152')](db[_0xed2e('0x85')],{'onDelete':'restrict','foreignKey':_0xed2e('0x156')});db[_0xed2e('0x101')]['belongsTo'](db[_0xed2e('0x172')],{'onDelete':_0xed2e('0x165'),'foreignKey':_0xed2e('0x17c')});db[_0xed2e('0x103')][_0xed2e('0x119')](db['WhatsappMessage'],{'as':_0xed2e('0x15c'),'onDelete':_0xed2e('0x115'),'foreignKey':'WhatsappInteractionId'});db[_0xed2e('0x103')]['belongsTo'](db[_0xed2e('0x146')],{'as':_0xed2e('0x179'),'foreignKey':_0xed2e('0x201')});db[_0xed2e('0x103')]['belongsTo'](db['CmContact'],{'as':_0xed2e('0x171'),'foreignKey':'ContactId'});db[_0xed2e('0x103')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'as':_0xed2e('0x183'),'foreignKey':_0xed2e('0x116')});db[_0xed2e('0x103')][_0xed2e('0x124')](db[_0xed2e('0x172')],{'through':_0xed2e('0x1b6'),'as':_0xed2e('0x174')});db[_0xed2e('0x103')][_0xed2e('0x124')](db[_0xed2e('0x172')],{'through':_0xed2e('0x1b6'),'as':'ThroughTags'});db[_0xed2e('0x103')][_0xed2e('0x124')](db[_0xed2e('0xf')],{'as':_0xed2e('0x176'),'through':_0xed2e('0x133'),'foreignKey':_0xed2e('0x202')});db[_0xed2e('0x105')]['belongsTo'](db[_0xed2e('0xf')],{'as':_0xed2e('0xf')});db['WhatsappMessage'][_0xed2e('0x152')](db[_0xed2e('0x73')],{'onDelete':_0xed2e('0x115'),'as':_0xed2e('0x171')});db[_0xed2e('0x105')][_0xed2e('0x152')](db[_0xed2e('0x103')],{'onDelete':_0xed2e('0x115'),'as':_0xed2e('0x178'),'foreignKey':_0xed2e('0x202')});db[_0xed2e('0x105')]['belongsTo'](db['WhatsappAccount'],{'as':_0xed2e('0x179'),'foreignKey':_0xed2e('0x201')});db[_0xed2e('0x107')][_0xed2e('0x152')](db[_0xed2e('0x146')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xed2e('0xf5')],{'as':_0xed2e('0x16c'),'foreignKey':_0xed2e('0x16d')});db['WhatsappQueueReport'][_0xed2e('0x152')](db['CmContact'],{'as':_0xed2e('0x171'),'foreignKey':_0xed2e('0x163')});db[_0xed2e('0x107')][_0xed2e('0x152')](db[_0xed2e('0x103')],{});db['WhatsappQueueReport'][_0xed2e('0x152')](db['WhatsappQueue'],{});db[_0xed2e('0x107')][_0xed2e('0x152')](db[_0xed2e('0x105')],{});db['WhatsappQueueReport'][_0xed2e('0x152')](db[_0xed2e('0xf')],{});db[_0xed2e('0x109')][_0xed2e('0x152')](db[_0xed2e('0x105')],{});db[_0xed2e('0x109')][_0xed2e('0x152')](db[_0xed2e('0x103')],{});db['WhatsappTransferReport'][_0xed2e('0x152')](db[_0xed2e('0x146')],{'foreignKey':_0xed2e('0x203'),'as':_0xed2e('0x1e9')});db[_0xed2e('0x109')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0xed2e('0x204'),'as':_0xed2e('0x1ef')});db[_0xed2e('0x109')]['belongsTo'](db[_0xed2e('0x10b')],{'foreignKey':'ToQueueId','as':_0xed2e('0x1ed')});db[_0xed2e('0x109')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'foreignKey':_0xed2e('0x1f1'),'as':'FromAgent'});db[_0xed2e('0x109')][_0xed2e('0x152')](db[_0xed2e('0xf')],{'foreignKey':_0xed2e('0x1f2'),'as':'ToAgent'});db[_0xed2e('0x10b')][_0xed2e('0x124')](db[_0xed2e('0xf')],{'as':_0xed2e('0x159'),'through':_0xed2e('0x35'),'foreignKey':_0xed2e('0x205')});db[_0xed2e('0x10b')]['belongsToMany'](db[_0xed2e('0xe2')],{'through':_0xed2e('0x1e2'),'as':'Teams'});db['UserSetting'][_0xed2e('0x152')](db[_0xed2e('0xf')],{'as':_0xed2e('0x206'),'foreignKey':_0xed2e('0x116'),'onDelete':_0xed2e('0x115'),'hooks':!![]});db['CloudProvider']['hasOne'](db[_0xed2e('0xbf')],{'as':'Dynamics365Account','onDelete':_0xed2e('0x165')});db[_0xed2e('0x10d')][_0xed2e('0x114')](db[_0xed2e('0x36')],{'as':_0xed2e('0x167'),'onDelete':_0xed2e('0x165')});db[_0xed2e('0x10d')][_0xed2e('0x114')](db[_0xed2e('0x37')],{'as':_0xed2e('0x168'),'onDelete':'restrict'});module[_0xed2e('0x207')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x34ae=['../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','FreshsalesField','Network','../api/network/network.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','../api/mailInteractionHasTag/mailInteractionHasTag.model','hasOne','cascade','User','userSetting','UserId','hasMany','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','HopperHistory','OpenchannelInteractions','UserNotifications','SenderId','SET\x20NULL','belongsTo','belongsToMany','ChatGroup','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','MailInteractions','user_has_mail_interactions','ChatInteractions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteraction','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','UserMailQueue','UserFaxQueue','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','WhatsappAccounts','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','uniqueid','Contact','MailAccountId','CloudProviderId','restrict','Imap','Disposition','Dispositions','Answers','Interactions','List','ListId','TemplateId','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','ContactId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','ChatOfflineMessageId','IntervalId','TagId','Items','FaxAccountId','Exntensions','FaxInteractionId','fax_interaction_has_tags','Interaction','AttachmentId','SmsAccountId','SmsMessage','mandatoryDispositionPauseId','user_has_sms_accounts','SmsQueue','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','user_has_chat_websites','Agent','Queue','ChatQueueId','Website','ChatInteractionId','user_has_chat_interactions','ChatOfflineMessage','team_has_chat_queues','ChatGroupId','CompanyId','Phones','CmContactId','Hoppers','HopperHistories','SmsInteractions','CmCompany','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','OwnerId','CampaignId','Automation','All','AutomationAnyId','Action','Actions','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','chat_interaction_has_tags','whatsapp_interaction_has_tags','ItemType','CmHopperAdditionalPhone','TriggerAllId','AnyConditions','AnyCondition','AnalyticFieldReport','Fields','AnalyticMetric','MetricId','Configurations','AccountId','DescriptionId','FieldId','SubjectId','Description','Field','Variable','SugarcrmField','Subjects','Subject','VariableId','DeskAccount','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','Descriptions','int_freshdesk_configuration_has_tags','ServicenowField','Dynamics365Field','ChatQueueReport','ChatInternalMessage','FromId','SessionId','ProjectId','user_has_teams','ChatQueues','FaxQueues','SmsQueues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromUserId','ToUserId','ToQueue','FromChatWebsiteId','ToChatQueueId','ToAccount','FromFaxAccountId','FromAgent','ToAgent','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','FromAccount','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','userProfileId','Resources','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','user','Smtp','exports','sequelize','lodash','jstz','determine','defaultsDeep','xC@LL1234','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','motion2','xcall','utf8','database','username','password','options','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model'];(function(_0xdb1212,_0x554414){var _0x127cd7=function(_0x1c2b66){while(--_0x1c2b66){_0xdb1212['push'](_0xdb1212['shift']());}};_0x127cd7(++_0x554414);}(_0x34ae,0x185));var _0xe34a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34ae[_0x3dd15e];return _0x231fd0;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xe34a('0x0'));var _=require(_0xe34a('0x1'));var jstz=require(_0xe34a('0x2'));var timezone=jstz[_0xe34a('0x3')]();config[_0xe34a('0x0')]=_[_0xe34a('0x4')](config[_0xe34a('0x0')],{'database':'motion2','username':'xcall','password':_0xe34a('0x5'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xe34a('0x6'),'dialectOptions':{'charset':_0xe34a('0x7')},'logging':![],'timezone':timezone[_0xe34a('0x8')](),'define':{'charset':'utf8','collate':_0xe34a('0x9')}}});config['sequelizeHistory']=_['defaultsDeep'](config[_0xe34a('0xa')],{'database':_0xe34a('0xb'),'username':_0xe34a('0xc'),'password':_0xe34a('0x5'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xe34a('0x6'),'dialectOptions':{'charset':_0xe34a('0x7')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xe34a('0xd'),'collate':_0xe34a('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe34a('0x0')][_0xe34a('0xe')],config[_0xe34a('0x0')][_0xe34a('0xf')],config[_0xe34a('0x0')]['password'],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe34a('0xa')][_0xe34a('0xe')],config[_0xe34a('0xa')][_0xe34a('0xf')],config[_0xe34a('0xa')][_0xe34a('0x10')],config[_0xe34a('0xa')][_0xe34a('0x11')])};db['User']=db[_0xe34a('0x0')]['import'](_0xe34a('0x12'));db[_0xe34a('0x13')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x15'));db[_0xe34a('0x16')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x17'));db[_0xe34a('0x18')]=db['sequelize'][_0xe34a('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0xe34a('0x19')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0x1a'));db[_0xe34a('0x1b')]=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/voiceQueue/voiceQueue.model');db[_0xe34a('0x1c')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x1d'));db[_0xe34a('0x1e')]=db['sequelize'][_0xe34a('0x14')]('../api/screenRecording/screenRecording.model');db[_0xe34a('0x1f')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x20'));db[_0xe34a('0x21')]=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xe34a('0x22')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0x23'));db[_0xe34a('0x24')]=db['sequelize']['import'](_0xe34a('0x25'));db[_0xe34a('0x26')]=db['sequelize'][_0xe34a('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xe34a('0x27')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x28'));db[_0xe34a('0x29')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0x2a'));db['Trunk']=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/trunk/trunk.model');db['VoiceTransferReport']=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0xe34a('0x2b')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x2c'));db[_0xe34a('0x2d')]=db[_0xe34a('0x0')]['import'](_0xe34a('0x2e'));db[_0xe34a('0x2f')]=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0xe34a('0x0')]['import'](_0xe34a('0x30'));db['UserFaxQueue']=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x31'));db[_0xe34a('0x32')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x33'));db[_0xe34a('0x34')]=db[_0xe34a('0x0')]['import'](_0xe34a('0x35'));db['UserWhatsappQueue']=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xe34a('0x36')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x37'));db[_0xe34a('0x38')]=db[_0xe34a('0x0')]['import'](_0xe34a('0x39'));db['MailAccount']=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x3a'));db[_0xe34a('0x3b')]=db[_0xe34a('0x0')]['import'](_0xe34a('0x3c'));db['MailSubstatus']=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/mailSubstatus/mailSubstatus.model');db[_0xe34a('0x3d')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0x3e'));db[_0xe34a('0x3f')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0x40'));db[_0xe34a('0x41')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0x42'));db[_0xe34a('0x43')]=db[_0xe34a('0x0')]['import'](_0xe34a('0x44'));db[_0xe34a('0x45')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0x46'));db[_0xe34a('0x47')]=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x48'));db[_0xe34a('0x49')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x4a'));db[_0xe34a('0x4b')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0x4c'));db[_0xe34a('0x4d')]=db[_0xe34a('0x0')]['import']('../api/faxMessage/faxMessage.model');db[_0xe34a('0x4e')]=db['sequelize']['import']('../api/faxQueue/faxQueue.model');db[_0xe34a('0x4f')]=db[_0xe34a('0x0')]['import'](_0xe34a('0x50'));db[_0xe34a('0x51')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x52'));db[_0xe34a('0x53')]=db[_0xe34a('0x0')]['import'](_0xe34a('0x54'));db[_0xe34a('0x55')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x56'));db['SmsMessage']=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/smsMessage/smsMessage.model');db['SmsQueue']=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x57'));db[_0xe34a('0x58')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x59'));db['OpenchannelApplication']=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x5a'));db[_0xe34a('0x5b')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x5c'));db['OpenchannelMessage']=db['sequelize']['import'](_0xe34a('0x5d'));db[_0xe34a('0x5e')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x5f'));db[_0xe34a('0x60')]=db[_0xe34a('0x0')]['import'](_0xe34a('0x61'));db[_0xe34a('0x62')]=db[_0xe34a('0x0')]['import'](_0xe34a('0x63'));db[_0xe34a('0x64')]=db['sequelize']['import']('../api/chatApplication/chatApplication.model');db[_0xe34a('0x65')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x66'));db[_0xe34a('0x67')]=db[_0xe34a('0x0')]['import']('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0xe34a('0x0')]['import'](_0xe34a('0x68'));db[_0xe34a('0x69')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x6a'));db['ChatGroup']=db[_0xe34a('0x0')]['import'](_0xe34a('0x6b'));db[_0xe34a('0x6c')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0x6d'));db['CmCompany']=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x6e'));db[_0xe34a('0x6f')]=db['sequelize'][_0xe34a('0x14')]('../api/cmContact/cmContact.model');db[_0xe34a('0x70')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0x71'));db[_0xe34a('0x72')]=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x73'));db[_0xe34a('0x74')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x75'));db[_0xe34a('0x76')]=db['sequelize']['import'](_0xe34a('0x77'));db[_0xe34a('0x78')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x79'));db['Action']=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/action/action.model');db['Automation']=db[_0xe34a('0x0')]['import'](_0xe34a('0x7a'));db[_0xe34a('0x7b')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x7c'));db['Disposition']=db['sequelize']['import'](_0xe34a('0x7d'));db[_0xe34a('0x7e')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x7f'));db[_0xe34a('0x80')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0x81'));db[_0xe34a('0x82')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x83'));db['Cdr']=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x84'));db[_0xe34a('0x85')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x86'));db[_0xe34a('0x87')]=db[_0xe34a('0x0')]['import']('../api/schedule/schedule.model');db[_0xe34a('0x88')]=db[_0xe34a('0x0')]['import']('../api/sound/sound.model');db[_0xe34a('0x89')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x8a'));db[_0xe34a('0x8b')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x8c'));db[_0xe34a('0x8d')]=db[_0xe34a('0x0')]['import'](_0xe34a('0x8e'));db['CmHopperAdditionalPhone']=db[_0xe34a('0x0')]['import'](_0xe34a('0x8f'));db['Template']=db['sequelize']['import'](_0xe34a('0x90'));db[_0xe34a('0x91')]=db['sequelize']['import'](_0xe34a('0x92'));db['Variable']=db[_0xe34a('0x0')]['import'](_0xe34a('0x93'));db[_0xe34a('0x94')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0x95'));db[_0xe34a('0x96')]=db['sequelize'][_0xe34a('0x14')]('../api/integrationReport/integrationReport.model');db[_0xe34a('0x97')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x98'));db['AnalyticDefaultReport']=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x99'));db[_0xe34a('0x9a')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0x9b'));db['AnalyticMetric']=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x9c'));db['AnalyticFieldReport']=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x9d'));db[_0xe34a('0x9e')]=db[_0xe34a('0x0')]['import'](_0xe34a('0x9f'));db[_0xe34a('0xa0')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xa1'));db[_0xe34a('0xa2')]=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xe34a('0xa3')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xa4'));db[_0xe34a('0xa5')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xa6'));db[_0xe34a('0xa7')]=db['sequelize']['import'](_0xe34a('0xa8'));db['SugarcrmField']=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xa9'));db['DeskAccount']=db['sequelize'][_0xe34a('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0xe34a('0xaa')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xab'));db[_0xe34a('0xac')]=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0xe34a('0x0')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xe34a('0xad')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xae'));db[_0xe34a('0xaf')]=db[_0xe34a('0x0')]['import']('../api/intZendeskAccount/intZendeskAccount.model');db[_0xe34a('0xb0')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xb1'));db[_0xe34a('0xb2')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0xb3'));db[_0xe34a('0xb4')]=db[_0xe34a('0x0')]['import'](_0xe34a('0xb5'));db[_0xe34a('0xb6')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xb7'));db[_0xe34a('0xb8')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xb9'));db[_0xe34a('0xba')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0xbb'));db[_0xe34a('0xbc')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xbd'));db[_0xe34a('0xbe')]=db[_0xe34a('0x0')]['import'](_0xe34a('0xbf'));db[_0xe34a('0xc0')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xc1'));db[_0xe34a('0xc2')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0xc3'));db['ServicenowField']=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xc4'));db[_0xe34a('0xc5')]=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xe34a('0xc6')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xc7'));db['Dynamics365Field']=db[_0xe34a('0x0')]['import'](_0xe34a('0xc8'));db[_0xe34a('0xc9')]=db['sequelize'][_0xe34a('0x14')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xe34a('0xca')]=db['sequelize'][_0xe34a('0x14')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xe34a('0xcb')]=db['sequelize'][_0xe34a('0x14')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0xe34a('0x94')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0x95'));db[_0xe34a('0xcc')]=db[_0xe34a('0x0')]['import'](_0xe34a('0xcd'));db['ChatQueueReport']=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/chatQueueReport/chatQueueReport.model');db['ChatInternalMessage']=db['sequelize']['import']('../api/chatInternalMessage/chatInternalMessage.model');db[_0xe34a('0xce')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0xcf'));db[_0xe34a('0xd0')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xd1'));db[_0xe34a('0xd2')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xd3'));db[_0xe34a('0xd4')]=db['sequelize']['import'](_0xe34a('0xd5'));db[_0xe34a('0xd6')]=db[_0xe34a('0x0')]['import'](_0xe34a('0xd7'));db[_0xe34a('0xd8')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xd9'));db[_0xe34a('0xda')]=db['sequelize'][_0xe34a('0x14')]('../api/jscriptyProject/jscriptyProject.model');db[_0xe34a('0xdb')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0xdc'));db[_0xe34a('0xdd')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xde'));db[_0xe34a('0xdf')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xe0'));db['SquareRecording']=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xe1'));db['SquareMessage']=db[_0xe34a('0x0')]['import'](_0xe34a('0xe2'));db[_0xe34a('0xe3')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xe4'));db[_0xe34a('0xe5')]=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/license/license.model');db[_0xe34a('0xe6')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xe7'));db['Migration']=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xe8'));db[_0xe34a('0xe9')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xea'));db[_0xe34a('0xeb')]=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/plugin/plugin.model');db['MailTransferReport']=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0xe34a('0xec')]=db[_0xe34a('0x0')]['import']('../api/chatTransferReport/chatTransferReport.model');db[_0xe34a('0xed')]=db[_0xe34a('0x0')]['import'](_0xe34a('0xee'));db[_0xe34a('0xef')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xf0'));db[_0xe34a('0xf1')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xf2'));db['CmList']=db['sequelize']['import'](_0xe34a('0xf3'));db[_0xe34a('0xf4')]=db['sequelize'][_0xe34a('0x14')]('../api/voicePrefix/voicePrefix.model');db[_0xe34a('0xf5')]=db[_0xe34a('0x0')]['import'](_0xe34a('0xf6'));db[_0xe34a('0xf7')]=db[_0xe34a('0x0')]['import']('../api/userProfileSection/userProfileSection.model');db[_0xe34a('0xf8')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xf9'));db[_0xe34a('0xfa')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0xfb'));db[_0xe34a('0xfc')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0xfd'));db[_0xe34a('0xfe')]=db['sequelize'][_0xe34a('0x14')](_0xe34a('0xff'));db['WhatsappInteraction']=db['sequelize'][_0xe34a('0x14')](_0xe34a('0x100'));db[_0xe34a('0x101')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x102'));db[_0xe34a('0x103')]=db[_0xe34a('0x0')][_0xe34a('0x14')]('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db['sequelize']['import'](_0xe34a('0x104'));db[_0xe34a('0x105')]=db['sequelize']['import'](_0xe34a('0x106'));db[_0xe34a('0x107')]=db[_0xe34a('0x0')]['import'](_0xe34a('0x108'));db[_0xe34a('0x109')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x10a'));db[_0xe34a('0x10b')]=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x10c'));db[_0xe34a('0x10d')]=db[_0xe34a('0x0')]['import'](_0xe34a('0x10e'));db['UserSetting']=db[_0xe34a('0x0')]['import'](_0xe34a('0x10f'));db['MailInteractionHasTag']=db[_0xe34a('0x0')][_0xe34a('0x14')](_0xe34a('0x110'));db['User'][_0xe34a('0x111')](db[_0xe34a('0x1f')],{'as':_0xe34a('0x1f'),'onDelete':_0xe34a('0x112'),'foreignKey':'UserId'});db[_0xe34a('0x113')][_0xe34a('0x111')](db['UserSetting'],{'as':_0xe34a('0x114'),'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x115')});db[_0xe34a('0x113')][_0xe34a('0x116')](db['VoiceRecording'],{'as':'Recordings','foreignKey':_0xe34a('0x115')});db[_0xe34a('0x113')]['hasMany'](db[_0xe34a('0x2b')],{'as':_0xe34a('0x117'),'foreignKey':_0xe34a('0x115')});db['User'][_0xe34a('0x116')](db[_0xe34a('0x18')],{'as':_0xe34a('0x118'),'onDelete':'cascade','hooks':!![]});db[_0xe34a('0x113')][_0xe34a('0x116')](db[_0xe34a('0x119')],{'as':_0xe34a('0x11a'),'foreignKey':'UserId'});db['User'][_0xe34a('0x116')](db[_0xe34a('0x74')],{'as':_0xe34a('0x11b'),'foreignKey':_0xe34a('0x115')});db[_0xe34a('0x113')][_0xe34a('0x116')](db['ReportAgentPreview'],{'as':_0xe34a('0x76'),'foreignKey':_0xe34a('0x115')});db[_0xe34a('0x113')][_0xe34a('0x116')](db[_0xe34a('0x5b')],{'as':_0xe34a('0x11c'),'foreignKey':_0xe34a('0x115')});db[_0xe34a('0x113')][_0xe34a('0x116')](db[_0xe34a('0x65')],{'as':'ChatInteractions','foreignKey':_0xe34a('0x115')});db[_0xe34a('0x113')][_0xe34a('0x116')](db[_0xe34a('0x55')],{'as':'SmsInteractions','foreignKey':_0xe34a('0x115')});db[_0xe34a('0x113')]['hasMany'](db[_0xe34a('0x4b')],{'as':'FaxInteractions','foreignKey':_0xe34a('0x115')});db[_0xe34a('0x113')][_0xe34a('0x116')](db[_0xe34a('0x3d')],{'as':'MailInteractions','foreignKey':_0xe34a('0x115')});db[_0xe34a('0x113')][_0xe34a('0x116')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','foreignKey':'UserId'});db['User'][_0xe34a('0x116')](db[_0xe34a('0xfa')],{'as':_0xe34a('0x11d'),'foreignKey':_0xe34a('0x11e')});db[_0xe34a('0x113')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':'UserId','onDelete':_0xe34a('0x11f')});db['User'][_0xe34a('0x120')](db['UserProfile'],{'as':_0xe34a('0xf5'),'foreignKey':'userProfileId'});db[_0xe34a('0x113')][_0xe34a('0x121')](db[_0xe34a('0x122')],{'as':_0xe34a('0x123'),'through':_0xe34a('0x124')});db['User'][_0xe34a('0x121')](db[_0xe34a('0x6f')],{'as':_0xe34a('0x125'),'through':_0xe34a('0x126')});db[_0xe34a('0x113')]['belongsToMany'](db[_0xe34a('0x127')],{'as':_0xe34a('0x128'),'through':_0xe34a('0x129')});db[_0xe34a('0x113')][_0xe34a('0x121')](db[_0xe34a('0xe3')],{'through':'user_has_teams'});db[_0xe34a('0x113')][_0xe34a('0x121')](db[_0xe34a('0x3d')],{'as':_0xe34a('0x12a'),'through':_0xe34a('0x12b')});db[_0xe34a('0x113')]['belongsToMany'](db[_0xe34a('0x65')],{'as':_0xe34a('0x12c'),'through':'user_has_chat_interactions'});db[_0xe34a('0x113')][_0xe34a('0x121')](db[_0xe34a('0x4b')],{'as':_0xe34a('0x12d'),'through':_0xe34a('0x12e')});db[_0xe34a('0x113')][_0xe34a('0x121')](db['SmsInteraction'],{'as':'SmsInteractions','through':_0xe34a('0x12f')});db[_0xe34a('0x113')]['belongsToMany'](db[_0xe34a('0x5b')],{'as':_0xe34a('0x11c'),'through':_0xe34a('0x130')});db[_0xe34a('0x113')][_0xe34a('0x121')](db[_0xe34a('0x131')],{'as':_0xe34a('0x132'),'through':_0xe34a('0x133')});db[_0xe34a('0x113')]['belongsToMany'](db[_0xe34a('0x1b')],{'as':_0xe34a('0x134'),'through':'UserVoiceQueue','required':![]});db[_0xe34a('0x113')][_0xe34a('0x121')](db[_0xe34a('0xf4')],{'as':_0xe34a('0x135'),'through':_0xe34a('0x10d'),'required':![]});db[_0xe34a('0x113')]['belongsToMany'](db['MailQueue'],{'as':_0xe34a('0x136'),'through':_0xe34a('0x137'),'required':![]});db[_0xe34a('0x113')][_0xe34a('0x121')](db[_0xe34a('0x69')],{'as':'ChatQueues','through':_0xe34a('0x2f'),'required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0xe34a('0x4e')],{'as':'FaxQueues','through':_0xe34a('0x138'),'required':![]});db[_0xe34a('0x113')]['belongsToMany'](db['SmsQueue'],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db[_0xe34a('0x113')][_0xe34a('0x121')](db['OpenchannelQueue'],{'as':_0xe34a('0x139'),'through':_0xe34a('0x34'),'required':![]});db['User'][_0xe34a('0x121')](db['WhatsappQueue'],{'as':_0xe34a('0x13a'),'through':_0xe34a('0x13b'),'required':![]});db[_0xe34a('0x113')][_0xe34a('0x121')](db[_0xe34a('0x127')],{'through':_0xe34a('0x129')});db[_0xe34a('0x113')]['belongsToMany'](db[_0xe34a('0x60')],{'as':_0xe34a('0x13c'),'through':'user_has_chat_websites'});db[_0xe34a('0x113')][_0xe34a('0x121')](db[_0xe34a('0x13d')],{'as':_0xe34a('0x13e'),'through':_0xe34a('0x13f')});db[_0xe34a('0x113')]['belongsToMany'](db[_0xe34a('0x140')],{'as':_0xe34a('0x141'),'through':'user_has_mail_accounts'});db[_0xe34a('0x113')][_0xe34a('0x121')](db[_0xe34a('0x58')],{'as':_0xe34a('0x142'),'through':_0xe34a('0x143')});db['User'][_0xe34a('0x121')](db[_0xe34a('0x51')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db[_0xe34a('0x113')][_0xe34a('0x121')](db['WhatsappAccount'],{'as':_0xe34a('0x144'),'through':'user_has_whatsapp_accounts'});db[_0xe34a('0x13')]['hasMany'](db[_0xe34a('0x18')],{'as':'SpiedAgents','onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x145')});db['VoiceContext'][_0xe34a('0x116')](db[_0xe34a('0x18')],{'onDelete':_0xe34a('0x112')});db[_0xe34a('0x18')]['hasMany'](db[_0xe34a('0x18')],{'as':_0xe34a('0x146'),'onDelete':_0xe34a('0x112')});db[_0xe34a('0x19')]['belongsToMany'](db[_0xe34a('0x88')],{'as':_0xe34a('0x147'),'through':_0xe34a('0x148')});db['VoiceQueue']['hasMany'](db[_0xe34a('0x2b')],{'as':_0xe34a('0x149'),'foreignKey':_0xe34a('0x14a')});db['VoiceQueue'][_0xe34a('0x116')](db[_0xe34a('0x70')],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db[_0xe34a('0x1b')][_0xe34a('0x116')](db['CmHopperFinal'],{'as':_0xe34a('0x11a'),'foreignKey':'VoiceQueueId'});db[_0xe34a('0x1b')][_0xe34a('0x116')](db[_0xe34a('0x74')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db[_0xe34a('0x1b')][_0xe34a('0x116')](db[_0xe34a('0x76')],{'as':'ReportAgentPreview','foreignKey':_0xe34a('0x14a')});db[_0xe34a('0x1b')][_0xe34a('0x116')](db[_0xe34a('0x72')],{'as':_0xe34a('0x14b'),'foreignKey':_0xe34a('0x14a')});db['VoiceQueue'][_0xe34a('0x116')](db[_0xe34a('0xd2')],{'as':_0xe34a('0x14c'),'foreignKey':_0xe34a('0x14a')});db[_0xe34a('0x1b')][_0xe34a('0x120')](db['Trunk'],{'as':_0xe34a('0x14d'),'foreignKey':_0xe34a('0x14e')});db[_0xe34a('0x1b')][_0xe34a('0x120')](db[_0xe34a('0x14d')],{'as':_0xe34a('0x14f'),'foreignKey':_0xe34a('0x150')});db[_0xe34a('0x1b')][_0xe34a('0x120')](db[_0xe34a('0x80')],{'as':_0xe34a('0x80'),'foreignKey':'IntervalId'});db['VoiceQueue'][_0xe34a('0x120')](db['Pause'],{'as':_0xe34a('0x151'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xe34a('0x1b')][_0xe34a('0x121')](db['CmList'],{'as':_0xe34a('0x128'),'through':'voice_queues_has_cm_lists'});db['VoiceQueue'][_0xe34a('0x121')](db[_0xe34a('0x113')],{'as':_0xe34a('0x152'),'through':'UserVoiceQueue'});db[_0xe34a('0x1b')][_0xe34a('0x121')](db[_0xe34a('0xe3')],{'as':_0xe34a('0x153'),'through':_0xe34a('0x109')});db['VoiceQueue'][_0xe34a('0x121')](db[_0xe34a('0x127')],{'as':_0xe34a('0x154'),'through':_0xe34a('0x155')});db[_0xe34a('0x1c')]['belongsTo'](db[_0xe34a('0x113')],{'as':_0xe34a('0x113'),'foreignKey':_0xe34a('0x115')});db[_0xe34a('0x1e')][_0xe34a('0x120')](db['User'],{'as':'User','foreignKey':_0xe34a('0x115')});db[_0xe34a('0x1f')][_0xe34a('0x116')](db[_0xe34a('0x21')],{'as':_0xe34a('0x156'),'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x157'),'sourceKey':_0xe34a('0x158')});db[_0xe34a('0x21')]['belongsTo'](db[_0xe34a('0x1f')],{'foreignKey':_0xe34a('0x157'),'targetKey':_0xe34a('0x158')});db[_0xe34a('0x22')]['hasMany'](db[_0xe34a('0x27')],{'as':'QueueCalls','foreignKey':_0xe34a('0x159'),'constraints':![]});db[_0xe34a('0x22')]['hasMany'](db[_0xe34a('0x26')],{'as':'AgentReports','foreignKey':_0xe34a('0x159'),'constraints':![]});db[_0xe34a('0x22')]['belongsTo'](db['User'],{'as':_0xe34a('0x113'),'foreignKey':_0xe34a('0x115')});db[_0xe34a('0x22')][_0xe34a('0x120')](db[_0xe34a('0x6f')],{'as':_0xe34a('0x15a'),'foreignKey':'ContactId'});db[_0xe34a('0x36')][_0xe34a('0x120')](db[_0xe34a('0x140')],{'as':_0xe34a('0x140'),'foreignKey':_0xe34a('0x15b')});db[_0xe34a('0x36')][_0xe34a('0x120')](db[_0xe34a('0x107')],{'as':_0xe34a('0x107'),'foreignKey':_0xe34a('0x15c'),'onDelete':_0xe34a('0x15d')});db[_0xe34a('0x38')]['belongsTo'](db[_0xe34a('0x140')],{'as':_0xe34a('0x140'),'foreignKey':_0xe34a('0x15b')});db[_0xe34a('0x38')][_0xe34a('0x120')](db[_0xe34a('0x107')],{'as':_0xe34a('0x107'),'foreignKey':_0xe34a('0x15c'),'onDelete':'restrict'});db['MailAccount'][_0xe34a('0x111')](db[_0xe34a('0x36')],{'as':_0xe34a('0x15e'),'onDelete':'cascade'});db[_0xe34a('0x140')][_0xe34a('0x111')](db['MailServerOut'],{'as':'Smtp','onDelete':_0xe34a('0x112')});db[_0xe34a('0x140')][_0xe34a('0x116')](db[_0xe34a('0x15f')],{'as':_0xe34a('0x160'),'foreignKey':_0xe34a('0x15b'),'onDelete':'cascade'});db[_0xe34a('0x140')][_0xe34a('0x116')](db[_0xe34a('0x7b')],{'as':_0xe34a('0x161'),'foreignKey':'MailAccountId'});db[_0xe34a('0x140')][_0xe34a('0x116')](db[_0xe34a('0x3f')],{'as':_0xe34a('0x156'),'foreignKey':_0xe34a('0x15b')});db['MailAccount'][_0xe34a('0x116')](db['MailInteraction'],{'as':_0xe34a('0x162')});db[_0xe34a('0x140')][_0xe34a('0x116')](db[_0xe34a('0x41')],{'as':_0xe34a('0x146'),'foreignKey':_0xe34a('0x15b'),'onDelete':_0xe34a('0x112')});db[_0xe34a('0x140')][_0xe34a('0x120')](db[_0xe34a('0x127')],{'as':_0xe34a('0x163'),'foreignKey':_0xe34a('0x164')});db[_0xe34a('0x140')][_0xe34a('0x120')](db['Template'],{'as':'Template','foreignKey':_0xe34a('0x165')});db['MailAccount'][_0xe34a('0x120')](db[_0xe34a('0x82')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['MailAccount']['belongsToMany'](db[_0xe34a('0x113')],{'as':_0xe34a('0x152'),'through':_0xe34a('0x166')});db['MailQueue']['belongsToMany'](db[_0xe34a('0x113')],{'as':_0xe34a('0x152'),'through':_0xe34a('0x137')});db[_0xe34a('0x3b')]['belongsToMany'](db[_0xe34a('0xe3')],{'through':_0xe34a('0x167'),'as':_0xe34a('0x153')});db[_0xe34a('0x3d')][_0xe34a('0x116')](db[_0xe34a('0x3f')],{'as':'Messages','onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x168')});db[_0xe34a('0x3d')][_0xe34a('0x120')](db['MailAccount'],{'as':_0xe34a('0x169'),'foreignKey':_0xe34a('0x15b')});db[_0xe34a('0x3d')][_0xe34a('0x120')](db['CmContact'],{'as':_0xe34a('0x15a'),'foreignKey':_0xe34a('0x16a')});db['MailInteraction'][_0xe34a('0x120')](db['User'],{'as':_0xe34a('0x16b'),'foreignKey':_0xe34a('0x115')});db[_0xe34a('0x3d')]['belongsToMany'](db[_0xe34a('0x89')],{'through':_0xe34a('0x16c'),'as':_0xe34a('0x16d')});db[_0xe34a('0x3d')]['belongsToMany'](db['Tag'],{'through':_0xe34a('0x16c'),'as':_0xe34a('0x16e')});db[_0xe34a('0x3d')][_0xe34a('0x121')](db[_0xe34a('0x113')],{'as':_0xe34a('0x16f'),'through':_0xe34a('0x12b'),'foreignKey':_0xe34a('0x168')});db[_0xe34a('0x3f')][_0xe34a('0x116')](db[_0xe34a('0xe9')],{'as':_0xe34a('0x170'),'onDelete':_0xe34a('0x112')});db[_0xe34a('0x3f')][_0xe34a('0x120')](db[_0xe34a('0x113')],{'as':'User'});db[_0xe34a('0x3f')][_0xe34a('0x120')](db[_0xe34a('0x6f')],{'onDelete':_0xe34a('0x112'),'as':_0xe34a('0x15a')});db[_0xe34a('0x3f')][_0xe34a('0x120')](db[_0xe34a('0x3d')],{'as':'Interaction','foreignKey':_0xe34a('0x168')});db['MailMessage']['belongsTo'](db[_0xe34a('0x140')],{'as':_0xe34a('0x169'),'foreignKey':_0xe34a('0x15b')});db[_0xe34a('0x3f')][_0xe34a('0x120')](db[_0xe34a('0x60')],{'as':_0xe34a('0x60'),'foreignKey':'ChatWebsiteId'});db[_0xe34a('0x3f')][_0xe34a('0x120')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0xe34a('0x171')});db['MailApplication'][_0xe34a('0x120')](db[_0xe34a('0x113')],{'onDelete':_0xe34a('0x15d')});db[_0xe34a('0x41')]['belongsTo'](db[_0xe34a('0x3b')],{'onDelete':'restrict'});db[_0xe34a('0x41')]['belongsTo'](db[_0xe34a('0x140')],{'onDelete':'restrict'});db[_0xe34a('0x41')][_0xe34a('0x120')](db[_0xe34a('0x80')],{'onDelete':_0xe34a('0x15d'),'foreignKey':_0xe34a('0x172')});db['MailApplication']['belongsTo'](db[_0xe34a('0x89')],{'onDelete':'restrict','foreignKey':_0xe34a('0x173')});db[_0xe34a('0x43')][_0xe34a('0x120')](db[_0xe34a('0x140')],{});db[_0xe34a('0x43')][_0xe34a('0x120')](db[_0xe34a('0x127')],{'as':_0xe34a('0x163'),'foreignKey':_0xe34a('0x164')});db[_0xe34a('0x43')][_0xe34a('0x120')](db[_0xe34a('0x6f')],{'as':_0xe34a('0x15a'),'foreignKey':_0xe34a('0x16a')});db[_0xe34a('0x43')][_0xe34a('0x120')](db[_0xe34a('0x3d')],{});db[_0xe34a('0x43')][_0xe34a('0x120')](db[_0xe34a('0x3f')],{});db[_0xe34a('0x43')]['belongsTo'](db[_0xe34a('0x113')],{});db['MailQueueReport'][_0xe34a('0x120')](db[_0xe34a('0x3b')],{});db[_0xe34a('0x45')][_0xe34a('0x116')](db[_0xe34a('0x47')],{'as':_0xe34a('0x174'),'onDelete':_0xe34a('0x112')});db['FaxAccount'][_0xe34a('0x116')](db[_0xe34a('0x15f')],{'as':_0xe34a('0x160'),'foreignKey':_0xe34a('0x175'),'onDelete':_0xe34a('0x112')});db[_0xe34a('0x13d')][_0xe34a('0x116')](db['CannedAnswer'],{'as':_0xe34a('0x161'),'foreignKey':_0xe34a('0x175')});db['FaxAccount']['hasMany'](db[_0xe34a('0x4b')],{'as':'Interactions'});db['FaxAccount']['hasMany'](db[_0xe34a('0x49')],{'as':_0xe34a('0x146'),'foreignKey':_0xe34a('0x175'),'onDelete':_0xe34a('0x112')});db[_0xe34a('0x13d')][_0xe34a('0x116')](db[_0xe34a('0x18')],{'as':_0xe34a('0x176'),'onDelete':_0xe34a('0x112')});db[_0xe34a('0x13d')][_0xe34a('0x116')](db['FaxMessage'],{'as':_0xe34a('0x156')});db[_0xe34a('0x13d')][_0xe34a('0x120')](db[_0xe34a('0x14d')],{'as':_0xe34a('0x14d')});db['FaxAccount'][_0xe34a('0x120')](db['CmList'],{'as':_0xe34a('0x163'),'foreignKey':'ListId'});db[_0xe34a('0x13d')][_0xe34a('0x120')](db[_0xe34a('0x82')],{'as':_0xe34a('0x151'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xe34a('0x13d')]['belongsToMany'](db[_0xe34a('0x113')],{'as':_0xe34a('0x152'),'through':'user_has_fax_accounts'});db[_0xe34a('0x49')][_0xe34a('0x120')](db[_0xe34a('0x113')],{'onDelete':_0xe34a('0x15d')});db[_0xe34a('0x49')][_0xe34a('0x120')](db[_0xe34a('0x4e')],{'onDelete':'restrict'});db[_0xe34a('0x49')]['belongsTo'](db[_0xe34a('0x13d')],{'onDelete':_0xe34a('0x15d')});db[_0xe34a('0x49')]['belongsTo'](db[_0xe34a('0x89')],{'onDelete':_0xe34a('0x15d'),'foreignKey':_0xe34a('0x173')});db[_0xe34a('0x4b')]['hasMany'](db[_0xe34a('0x4d')],{'as':_0xe34a('0x156'),'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x177')});db[_0xe34a('0x4b')][_0xe34a('0x120')](db[_0xe34a('0x13d')],{'as':_0xe34a('0x169'),'foreignKey':_0xe34a('0x175')});db[_0xe34a('0x4b')][_0xe34a('0x120')](db[_0xe34a('0x6f')],{'as':'Contact','foreignKey':_0xe34a('0x16a')});db[_0xe34a('0x4b')][_0xe34a('0x120')](db[_0xe34a('0x113')],{'as':_0xe34a('0x16b'),'foreignKey':_0xe34a('0x115')});db[_0xe34a('0x4b')][_0xe34a('0x121')](db[_0xe34a('0x89')],{'through':_0xe34a('0x178'),'as':_0xe34a('0x16d')});db[_0xe34a('0x4b')][_0xe34a('0x121')](db[_0xe34a('0x89')],{'through':_0xe34a('0x178'),'as':_0xe34a('0x16e')});db[_0xe34a('0x4b')][_0xe34a('0x121')](db[_0xe34a('0x113')],{'as':'Users','through':'user_has_fax_interactions','foreignKey':_0xe34a('0x177')});db[_0xe34a('0x4d')][_0xe34a('0x120')](db[_0xe34a('0x113')],{'onDelete':_0xe34a('0x112'),'as':_0xe34a('0x113')});db['FaxMessage'][_0xe34a('0x120')](db[_0xe34a('0x4b')],{'as':_0xe34a('0x179'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0xe34a('0x120')](db[_0xe34a('0x6f')],{'onDelete':_0xe34a('0x112'),'as':_0xe34a('0x15a')});db[_0xe34a('0x4d')][_0xe34a('0x120')](db[_0xe34a('0xe9')],{'as':_0xe34a('0xe9'),'foreignKey':_0xe34a('0x17a')});db[_0xe34a('0x4d')]['belongsTo'](db[_0xe34a('0x13d')],{'as':'Account','foreignKey':_0xe34a('0x175')});db[_0xe34a('0x4e')][_0xe34a('0x121')](db['User'],{'as':'Agents','through':_0xe34a('0x138')});db[_0xe34a('0x4e')][_0xe34a('0x121')](db[_0xe34a('0xe3')],{'through':'team_has_fax_queues','as':'Teams'});db[_0xe34a('0x4f')][_0xe34a('0x120')](db['FaxAccount'],{});db['FaxQueueReport'][_0xe34a('0x120')](db[_0xe34a('0x127')],{'as':_0xe34a('0x163'),'foreignKey':_0xe34a('0x164')});db['FaxQueueReport'][_0xe34a('0x120')](db[_0xe34a('0x6f')],{'as':_0xe34a('0x15a'),'foreignKey':_0xe34a('0x16a')});db[_0xe34a('0x4f')]['belongsTo'](db[_0xe34a('0x4b')],{});db[_0xe34a('0x4f')][_0xe34a('0x120')](db[_0xe34a('0x4d')],{});db['FaxQueueReport'][_0xe34a('0x120')](db[_0xe34a('0x113')],{});db['FaxQueueReport']['belongsTo'](db['FaxQueue'],{});db['SmsAccount'][_0xe34a('0x116')](db[_0xe34a('0x15f')],{'as':_0xe34a('0x160'),'foreignKey':'SmsAccountId','onDelete':_0xe34a('0x112')});db['SmsAccount']['hasMany'](db[_0xe34a('0x7b')],{'as':'Answers','foreignKey':_0xe34a('0x17b')});db[_0xe34a('0x51')][_0xe34a('0x116')](db[_0xe34a('0x17c')],{'as':'Messages','foreignKey':_0xe34a('0x17b')});db[_0xe34a('0x51')][_0xe34a('0x116')](db[_0xe34a('0x55')],{'as':_0xe34a('0x162')});db['SmsAccount'][_0xe34a('0x116')](db['SmsApplication'],{'as':_0xe34a('0x146'),'foreignKey':_0xe34a('0x17b'),'onDelete':'cascade'});db[_0xe34a('0x51')]['belongsTo'](db[_0xe34a('0x127')],{'as':_0xe34a('0x163'),'foreignKey':'ListId'});db[_0xe34a('0x51')][_0xe34a('0x120')](db['Pause'],{'as':_0xe34a('0x151'),'foreignKey':_0xe34a('0x17d')});db['SmsAccount'][_0xe34a('0x121')](db[_0xe34a('0x113')],{'as':_0xe34a('0x152'),'through':_0xe34a('0x17e')});db[_0xe34a('0x53')]['belongsTo'](db[_0xe34a('0x113')],{'onDelete':_0xe34a('0x15d')});db['SmsApplication'][_0xe34a('0x120')](db[_0xe34a('0x17f')],{'onDelete':'restrict'});db[_0xe34a('0x53')][_0xe34a('0x120')](db[_0xe34a('0x51')],{'onDelete':_0xe34a('0x15d')});db[_0xe34a('0x53')][_0xe34a('0x120')](db[_0xe34a('0x80')],{'onDelete':'restrict','foreignKey':_0xe34a('0x172')});db['SmsApplication']['belongsTo'](db[_0xe34a('0x89')],{'onDelete':_0xe34a('0x15d'),'foreignKey':_0xe34a('0x173')});db[_0xe34a('0x55')][_0xe34a('0x116')](db[_0xe34a('0x17c')],{'as':'Messages','onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x180')});db[_0xe34a('0x55')]['belongsTo'](db['SmsAccount'],{'as':_0xe34a('0x169'),'foreignKey':_0xe34a('0x17b')});db[_0xe34a('0x55')][_0xe34a('0x120')](db[_0xe34a('0x6f')],{'as':_0xe34a('0x15a'),'foreignKey':'ContactId'});db[_0xe34a('0x55')]['belongsTo'](db[_0xe34a('0x113')],{'as':_0xe34a('0x16b'),'foreignKey':_0xe34a('0x115')});db[_0xe34a('0x55')][_0xe34a('0x121')](db['Tag'],{'through':_0xe34a('0x181'),'as':_0xe34a('0x16d')});db[_0xe34a('0x55')]['belongsToMany'](db[_0xe34a('0x89')],{'through':'sms_interaction_has_tags','as':_0xe34a('0x16e')});db[_0xe34a('0x55')][_0xe34a('0x121')](db[_0xe34a('0x113')],{'as':_0xe34a('0x16f'),'through':_0xe34a('0x12f'),'foreignKey':_0xe34a('0x180')});db[_0xe34a('0x17c')][_0xe34a('0x120')](db[_0xe34a('0x113')],{'as':_0xe34a('0x113')});db[_0xe34a('0x17c')][_0xe34a('0x120')](db[_0xe34a('0x6f')],{'onDelete':_0xe34a('0x112'),'as':'Contact'});db[_0xe34a('0x17c')][_0xe34a('0x120')](db[_0xe34a('0x55')],{'onDelete':'cascade','as':_0xe34a('0x179'),'foreignKey':_0xe34a('0x180')});db[_0xe34a('0x17c')][_0xe34a('0x120')](db[_0xe34a('0x51')],{'as':_0xe34a('0x169'),'foreignKey':'SmsAccountId'});db[_0xe34a('0x17f')][_0xe34a('0x121')](db[_0xe34a('0x113')],{'as':_0xe34a('0x152'),'through':'UserSmsQueue','foreignKey':_0xe34a('0x182')});db[_0xe34a('0x17f')]['belongsToMany'](db['Team'],{'through':_0xe34a('0x183'),'as':_0xe34a('0x153')});db['OpenchannelAccount']['hasMany'](db[_0xe34a('0x15f')],{'as':_0xe34a('0x160'),'foreignKey':_0xe34a('0x184'),'onDelete':'cascade'});db[_0xe34a('0x58')][_0xe34a('0x116')](db['CannedAnswer'],{'as':_0xe34a('0x161'),'foreignKey':_0xe34a('0x184')});db[_0xe34a('0x58')]['hasMany'](db['OpenchannelInteraction'],{'as':'Interactions','foreignKey':_0xe34a('0x184')});db[_0xe34a('0x58')][_0xe34a('0x116')](db[_0xe34a('0x185')],{'as':_0xe34a('0x156'),'foreignKey':_0xe34a('0x184')});db[_0xe34a('0x58')][_0xe34a('0x116')](db[_0xe34a('0x186')],{'as':_0xe34a('0x146'),'foreignKey':'OpenchannelAccountId','onDelete':_0xe34a('0x112')});db[_0xe34a('0x58')][_0xe34a('0x120')](db[_0xe34a('0x127')],{'as':_0xe34a('0x163'),'foreignKey':'ListId'});db[_0xe34a('0x58')][_0xe34a('0x120')](db[_0xe34a('0x82')],{'as':'mandatoryDispositionPause','foreignKey':_0xe34a('0x17d')});db[_0xe34a('0x58')]['belongsToMany'](db[_0xe34a('0x113')],{'as':_0xe34a('0x152'),'through':_0xe34a('0x143')});db[_0xe34a('0x186')][_0xe34a('0x120')](db[_0xe34a('0x113')],{'onDelete':'restrict'});db[_0xe34a('0x186')][_0xe34a('0x120')](db[_0xe34a('0x5e')],{'onDelete':_0xe34a('0x15d'),'foreignKey':_0xe34a('0x187')});db[_0xe34a('0x186')][_0xe34a('0x120')](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0xe34a('0x184')});db[_0xe34a('0x186')]['belongsTo'](db[_0xe34a('0x80')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xe34a('0x186')][_0xe34a('0x120')](db[_0xe34a('0x89')],{'onDelete':'restrict','foreignKey':_0xe34a('0x173')});db[_0xe34a('0x5b')][_0xe34a('0x116')](db[_0xe34a('0x185')],{'as':_0xe34a('0x156'),'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x188')});db[_0xe34a('0x5b')][_0xe34a('0x120')](db['OpenchannelAccount'],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction']['belongsTo'](db['CmContact'],{'as':_0xe34a('0x15a'),'foreignKey':_0xe34a('0x16a')});db[_0xe34a('0x5b')][_0xe34a('0x120')](db[_0xe34a('0x113')],{'as':_0xe34a('0x16b'),'foreignKey':_0xe34a('0x115')});db['OpenchannelInteraction'][_0xe34a('0x121')](db[_0xe34a('0x89')],{'through':_0xe34a('0x189'),'as':_0xe34a('0x16d')});db[_0xe34a('0x5b')][_0xe34a('0x121')](db[_0xe34a('0x89')],{'through':'openchannel_interaction_has_tags','as':_0xe34a('0x16e')});db[_0xe34a('0x5b')]['belongsToMany'](db[_0xe34a('0x113')],{'as':_0xe34a('0x16f'),'through':_0xe34a('0x130'),'foreignKey':_0xe34a('0x188')});db['OpenchannelMessage']['belongsTo'](db[_0xe34a('0x113')],{'onDelete':'cascade','as':_0xe34a('0x113')});db[_0xe34a('0x185')][_0xe34a('0x120')](db[_0xe34a('0x6f')],{'onDelete':_0xe34a('0x112'),'as':'Contact'});db[_0xe34a('0x185')]['belongsTo'](db[_0xe34a('0x5b')],{'onDelete':_0xe34a('0x112'),'as':'Interaction','foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0xe34a('0x120')](db['Attachment'],{'as':'Attachment','foreignKey':_0xe34a('0x17a')});db[_0xe34a('0x185')][_0xe34a('0x120')](db['OpenchannelAccount'],{'as':_0xe34a('0x169'),'foreignKey':_0xe34a('0x184')});db['OpenchannelQueue'][_0xe34a('0x121')](db[_0xe34a('0x113')],{'as':_0xe34a('0x152'),'through':'UserOpenchannelQueue','foreignKey':_0xe34a('0x187')});db[_0xe34a('0x5e')][_0xe34a('0x121')](db['Team'],{'through':_0xe34a('0x18a'),'as':'Teams'});db[_0xe34a('0x60')][_0xe34a('0x116')](db['Disposition'],{'as':_0xe34a('0x160'),'foreignKey':_0xe34a('0x18b'),'onDelete':_0xe34a('0x112')});db[_0xe34a('0x60')][_0xe34a('0x116')](db['CannedAnswer'],{'as':_0xe34a('0x161'),'foreignKey':_0xe34a('0x18b')});db[_0xe34a('0x60')][_0xe34a('0x116')](db['ChatProactiveAction'],{'as':_0xe34a('0x18c')});db[_0xe34a('0x60')][_0xe34a('0x116')](db[_0xe34a('0x65')],{'as':_0xe34a('0x162')});db[_0xe34a('0x60')][_0xe34a('0x116')](db[_0xe34a('0x64')],{'as':_0xe34a('0x146'),'foreignKey':'ChatWebsiteId','onDelete':_0xe34a('0x112')});db['ChatWebsite'][_0xe34a('0x116')](db[_0xe34a('0x67')],{'as':_0xe34a('0x156')});db[_0xe34a('0x60')]['belongsTo'](db['CmList'],{'as':_0xe34a('0x163'),'foreignKey':_0xe34a('0x164')});db[_0xe34a('0x60')][_0xe34a('0x120')](db[_0xe34a('0x80')],{'as':_0xe34a('0x80'),'foreignKey':'IntervalId'});db[_0xe34a('0x60')][_0xe34a('0x120')](db[_0xe34a('0x140')],{'as':_0xe34a('0x140'),'foreignKey':_0xe34a('0x15b')});db[_0xe34a('0x60')]['belongsTo'](db[_0xe34a('0x82')],{'as':_0xe34a('0x151'),'foreignKey':_0xe34a('0x17d')});db[_0xe34a('0x60')][_0xe34a('0x121')](db['User'],{'as':_0xe34a('0x152'),'through':_0xe34a('0x18d')});db[_0xe34a('0x62')][_0xe34a('0x120')](db[_0xe34a('0x58')],{});db[_0xe34a('0x62')][_0xe34a('0x120')](db[_0xe34a('0x127')],{'as':_0xe34a('0x163'),'foreignKey':_0xe34a('0x164')});db[_0xe34a('0x62')][_0xe34a('0x120')](db[_0xe34a('0x6f')],{'as':_0xe34a('0x15a'),'foreignKey':'ContactId'});db[_0xe34a('0x62')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0xe34a('0x62')][_0xe34a('0x120')](db[_0xe34a('0x185')],{});db[_0xe34a('0x62')][_0xe34a('0x120')](db[_0xe34a('0x113')],{});db[_0xe34a('0x62')][_0xe34a('0x120')](db[_0xe34a('0x5e')],{});db[_0xe34a('0x64')]['belongsTo'](db[_0xe34a('0x113')],{'as':_0xe34a('0x18e'),'foreignKey':_0xe34a('0x115'),'onDelete':'restrict'});db[_0xe34a('0x64')][_0xe34a('0x120')](db[_0xe34a('0x69')],{'as':_0xe34a('0x18f'),'foreignKey':_0xe34a('0x190'),'onDelete':_0xe34a('0x15d')});db[_0xe34a('0x64')][_0xe34a('0x120')](db[_0xe34a('0x60')],{'as':_0xe34a('0x191'),'foreignKey':'ChatWebsiteId','onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0xe34a('0x89')],{'onDelete':_0xe34a('0x15d'),'foreignKey':_0xe34a('0x173')});db['ChatInteraction'][_0xe34a('0x116')](db[_0xe34a('0x67')],{'as':_0xe34a('0x156'),'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x192')});db['ChatInteraction']['belongsTo'](db[_0xe34a('0x60')],{'as':_0xe34a('0x169'),'foreignKey':_0xe34a('0x18b')});db[_0xe34a('0x65')][_0xe34a('0x120')](db[_0xe34a('0x6f')],{'as':'Contact','foreignKey':_0xe34a('0x16a')});db['ChatInteraction']['belongsTo'](db[_0xe34a('0x113')],{'as':_0xe34a('0x16b'),'foreignKey':_0xe34a('0x115')});db[_0xe34a('0x65')][_0xe34a('0x121')](db[_0xe34a('0x89')],{'through':'chat_interaction_has_tags','as':_0xe34a('0x16d')});db[_0xe34a('0x65')][_0xe34a('0x121')](db['Tag'],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db['ChatInteraction']['belongsToMany'](db[_0xe34a('0x113')],{'as':_0xe34a('0x16f'),'through':_0xe34a('0x193'),'foreignKey':_0xe34a('0x192')});db[_0xe34a('0x67')][_0xe34a('0x120')](db[_0xe34a('0x113')],{'onDelete':_0xe34a('0x112'),'as':'User'});db['ChatMessage'][_0xe34a('0x120')](db[_0xe34a('0x6f')],{'onDelete':'cascade','as':_0xe34a('0x15a'),'foreignKey':'ContactId'});db['ChatMessage']['belongsTo'](db[_0xe34a('0x65')],{'onDelete':'cascade','as':_0xe34a('0x179'),'foreignKey':_0xe34a('0x192')});db['ChatMessage']['belongsTo'](db[_0xe34a('0xe9')],{'as':_0xe34a('0xe9'),'foreignKey':_0xe34a('0x17a')});db[_0xe34a('0x67')][_0xe34a('0x120')](db[_0xe34a('0x60')],{'as':_0xe34a('0x169'),'foreignKey':_0xe34a('0x18b')});db[_0xe34a('0x194')][_0xe34a('0x116')](db['Attachment'],{'as':_0xe34a('0x170'),'foreignKey':_0xe34a('0x171'),'onDelete':'cascade','hooks':!![]});db[_0xe34a('0x194')][_0xe34a('0x120')](db['CmContact'],{'onDelete':_0xe34a('0x112'),'as':_0xe34a('0x15a'),'foreignKey':'ContactId'});db[_0xe34a('0x194')][_0xe34a('0x120')](db[_0xe34a('0x60')],{'as':_0xe34a('0x169'),'foreignKey':'ChatWebsiteId'});db[_0xe34a('0x69')][_0xe34a('0x121')](db['User'],{'as':_0xe34a('0x152'),'through':_0xe34a('0x2f'),'hooks':!![]});db[_0xe34a('0x69')][_0xe34a('0x121')](db[_0xe34a('0xe3')],{'through':_0xe34a('0x195'),'as':'Teams'});db[_0xe34a('0x122')][_0xe34a('0x116')](db['ChatInternalMessage'],{'as':_0xe34a('0x156'),'foreignKey':_0xe34a('0x196'),'onDelete':_0xe34a('0x112')});db[_0xe34a('0x122')][_0xe34a('0x121')](db[_0xe34a('0x113')],{'as':_0xe34a('0x149'),'through':_0xe34a('0x124')});db[_0xe34a('0x6c')][_0xe34a('0x120')](db[_0xe34a('0x60')],{'as':_0xe34a('0x191'),'foreignKey':_0xe34a('0x18b')});db['CmCompany']['hasMany'](db[_0xe34a('0x6f')],{'as':'Contacts','foreignKey':_0xe34a('0x197')});db['CmContact'][_0xe34a('0x116')](db[_0xe34a('0x8d')],{'as':_0xe34a('0x198'),'foreignKey':_0xe34a('0x199')});db['CmContact'][_0xe34a('0x116')](db['CmHopper'],{'as':_0xe34a('0x19a'),'foreignKey':_0xe34a('0x16a')});db[_0xe34a('0x6f')][_0xe34a('0x116')](db['CmHopperFinal'],{'as':_0xe34a('0x11a'),'foreignKey':_0xe34a('0x16a')});db[_0xe34a('0x6f')][_0xe34a('0x116')](db[_0xe34a('0x74')],{'as':_0xe34a('0x19b'),'foreignKey':_0xe34a('0x16a')});db[_0xe34a('0x6f')][_0xe34a('0x116')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db[_0xe34a('0x6f')]['hasMany'](db[_0xe34a('0xd2')],{'as':_0xe34a('0x14c'),'foreignKey':_0xe34a('0x16a')});db[_0xe34a('0x6f')][_0xe34a('0x116')](db['OpenchannelInteraction'],{'as':_0xe34a('0x11c'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xe34a('0x6f')][_0xe34a('0x116')](db[_0xe34a('0x65')],{'as':'ChatInteractions','foreignKey':_0xe34a('0x16a'),'onDelete':'restrict'});db['CmContact'][_0xe34a('0x116')](db[_0xe34a('0x55')],{'as':_0xe34a('0x19c'),'foreignKey':_0xe34a('0x16a'),'onDelete':_0xe34a('0x15d')});db[_0xe34a('0x6f')]['hasMany'](db[_0xe34a('0x4b')],{'as':'FaxInteractions','foreignKey':_0xe34a('0x16a'),'onDelete':'restrict'});db[_0xe34a('0x6f')]['hasMany'](db[_0xe34a('0x3d')],{'as':_0xe34a('0x12a'),'foreignKey':_0xe34a('0x16a'),'onDelete':_0xe34a('0x15d')});db[_0xe34a('0x6f')][_0xe34a('0x120')](db[_0xe34a('0x19d')],{'as':_0xe34a('0x19e'),'foreignKey':_0xe34a('0x197')});db[_0xe34a('0x6f')][_0xe34a('0x120')](db[_0xe34a('0x127')],{'as':_0xe34a('0x163'),'foreignKey':'ListId','onDelete':_0xe34a('0x112')});db['CmContact'][_0xe34a('0x121')](db[_0xe34a('0x113')],{'as':'Users','through':'cm_user_has_contacts'});db['CmContact'][_0xe34a('0x121')](db[_0xe34a('0x89')],{'as':_0xe34a('0x16d'),'through':'cm_contact_has_tags'});db['CmContact'][_0xe34a('0x121')](db[_0xe34a('0x89')],{'through':_0xe34a('0x19f'),'as':_0xe34a('0x16e')});db[_0xe34a('0x70')][_0xe34a('0x116')](db['CmHopperAdditionalPhone'],{'as':_0xe34a('0x1a0'),'foreignKey':_0xe34a('0x1a1')});db[_0xe34a('0x70')][_0xe34a('0x120')](db['CmContact'],{'as':_0xe34a('0x15a'),'foreignKey':'ContactId','onDelete':_0xe34a('0x112')});db[_0xe34a('0x70')]['belongsTo'](db['CmList'],{'as':_0xe34a('0x163'),'foreignKey':'ListId','onDelete':_0xe34a('0x112')});db[_0xe34a('0x70')][_0xe34a('0x120')](db['User'],{'as':'Agent','foreignKey':_0xe34a('0x115')});db[_0xe34a('0x70')][_0xe34a('0x120')](db[_0xe34a('0x1b')],{'as':_0xe34a('0x18f'),'foreignKey':_0xe34a('0x14a'),'onDelete':'cascade'});db[_0xe34a('0x70')][_0xe34a('0x120')](db[_0xe34a('0xe6')],{'as':_0xe34a('0xe6'),'foreignKey':'CampaignId','onDelete':_0xe34a('0x112')});db[_0xe34a('0x70')]['belongsTo'](db[_0xe34a('0x113')],{'as':_0xe34a('0x16b'),'foreignKey':_0xe34a('0x1a2')});db['CmHopperBlack'][_0xe34a('0x120')](db[_0xe34a('0x6f')],{'as':_0xe34a('0x15a'),'foreignKey':_0xe34a('0x16a'),'onDelete':_0xe34a('0x112')});db[_0xe34a('0x72')][_0xe34a('0x120')](db[_0xe34a('0x127')],{'as':'List','foreignKey':_0xe34a('0x164'),'onDelete':_0xe34a('0x112')});db[_0xe34a('0x72')][_0xe34a('0x120')](db[_0xe34a('0x1b')],{'as':'Queue','foreignKey':_0xe34a('0x14a'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db[_0xe34a('0xe6')],{'as':_0xe34a('0xe6'),'foreignKey':_0xe34a('0x1a3'),'onDelete':'cascade'});db[_0xe34a('0x1a4')][_0xe34a('0x116')](db[_0xe34a('0x7e')],{'as':{'plural':_0xe34a('0x1a5'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':_0xe34a('0x112'),'hooks':!![]});db['Automation'][_0xe34a('0x116')](db[_0xe34a('0x7e')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0xe34a('0x1a6'),'onDelete':_0xe34a('0x112'),'hooks':!![]});db['Automation'][_0xe34a('0x116')](db[_0xe34a('0x1a7')],{'as':_0xe34a('0x1a8'),'foreignKey':'AutomationId','onDelete':_0xe34a('0x112'),'hooks':!![]});db[_0xe34a('0x15f')][_0xe34a('0x116')](db[_0xe34a('0x15f')],{'as':_0xe34a('0x160'),'foreignKey':'ParentId','onDelete':_0xe34a('0x112')});db[_0xe34a('0x80')][_0xe34a('0x116')](db[_0xe34a('0x80')],{'as':_0xe34a('0x1a9'),'foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db[_0xe34a('0x80')][_0xe34a('0x116')](db['VoiceExtension'],{'as':_0xe34a('0x118'),'foreignKey':_0xe34a('0x172'),'onDelete':_0xe34a('0x15d')});db['Interval'][_0xe34a('0x116')](db[_0xe34a('0x41')],{'as':_0xe34a('0x1aa'),'foreignKey':_0xe34a('0x172')});db[_0xe34a('0x80')]['hasMany'](db[_0xe34a('0x64')],{'as':_0xe34a('0x1ab'),'foreignKey':_0xe34a('0x172')});db[_0xe34a('0x80')][_0xe34a('0x116')](db[_0xe34a('0x49')],{'as':_0xe34a('0x1ac'),'foreignKey':_0xe34a('0x172')});db[_0xe34a('0x80')][_0xe34a('0x116')](db[_0xe34a('0x53')],{'as':_0xe34a('0x1ad'),'foreignKey':_0xe34a('0x172')});db[_0xe34a('0x87')][_0xe34a('0x120')](db[_0xe34a('0x140')],{});db[_0xe34a('0x87')][_0xe34a('0x120')](db[_0xe34a('0x1ae')],{'foreignKey':_0xe34a('0x1af')});db[_0xe34a('0x87')][_0xe34a('0x120')](db['AnalyticCustomReport'],{'foreignKey':_0xe34a('0x1b0')});db[_0xe34a('0x88')][_0xe34a('0x121')](db[_0xe34a('0x19')],{'as':_0xe34a('0x1b1'),'through':_0xe34a('0x148'),'onDelete':_0xe34a('0x15d')});db['Tag'][_0xe34a('0x121')](db[_0xe34a('0x6f')],{'through':_0xe34a('0x19f')});db['Tag'][_0xe34a('0x121')](db[_0xe34a('0x65')],{'through':_0xe34a('0x1b2')});db['Tag'][_0xe34a('0x121')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db[_0xe34a('0x89')][_0xe34a('0x121')](db[_0xe34a('0x55')],{'through':'sms_interaction_has_tags'});db[_0xe34a('0x89')]['belongsToMany'](db[_0xe34a('0x4b')],{'through':_0xe34a('0x178')});db[_0xe34a('0x89')][_0xe34a('0x121')](db[_0xe34a('0x5b')],{'through':_0xe34a('0x189')});db[_0xe34a('0x89')][_0xe34a('0x121')](db[_0xe34a('0x131')],{'through':_0xe34a('0x1b3')});db['CmContactHasItem'][_0xe34a('0x120')](db['ContactItemType'],{'as':_0xe34a('0x1b4'),'foreignKey':'ItemTypeId'});db[_0xe34a('0x1b5')][_0xe34a('0x120')](db[_0xe34a('0x70')],{'as':'Hopper','foreignKey':_0xe34a('0x1a1')});db[_0xe34a('0x8d')]['belongsTo'](db['CmContact'],{'as':_0xe34a('0x15a'),'foreignKey':_0xe34a('0x199')});db[_0xe34a('0x91')]['hasMany'](db[_0xe34a('0x7e')],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':_0xe34a('0x1b6'),'onDelete':_0xe34a('0x112'),'hooks':!![]});db[_0xe34a('0x91')][_0xe34a('0x116')](db[_0xe34a('0x7e')],{'as':{'plural':_0xe34a('0x1b7'),'singular':_0xe34a('0x1b8')},'foreignKey':'TriggerAnyId','onDelete':_0xe34a('0x112'),'hooks':!![]});db[_0xe34a('0x91')][_0xe34a('0x116')](db['Action'],{'as':_0xe34a('0x1a8'),'foreignKey':'TriggerId','onDelete':_0xe34a('0x112'),'hooks':!![]});db[_0xe34a('0x97')][_0xe34a('0x116')](db[_0xe34a('0x1b9')],{'as':_0xe34a('0x1ba'),'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1b0'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0xe34a('0x1b9')],{'as':_0xe34a('0x1ba'),'onDelete':'cascade','foreignKey':_0xe34a('0x1af')});db[_0xe34a('0x1bb')][_0xe34a('0x116')](db[_0xe34a('0x1b9')],{'as':_0xe34a('0x1ba'),'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1bc')});db['AnalyticFieldReport']['belongsTo'](db[_0xe34a('0x1bb')],{'foreignKey':_0xe34a('0x1bc')});db[_0xe34a('0xa0')][_0xe34a('0x116')](db[_0xe34a('0xa2')],{'as':_0xe34a('0x1bd'),'onDelete':'cascade','foreignKey':_0xe34a('0x1be')});db['SalesforceConfiguration'][_0xe34a('0x116')](db[_0xe34a('0xa3')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db['SalesforceConfiguration'][_0xe34a('0x116')](db[_0xe34a('0xa3')],{'as':'Descriptions','onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1bf')});db[_0xe34a('0xa2')]['hasMany'](db[_0xe34a('0xa3')],{'as':_0xe34a('0x1ba'),'onDelete':'cascade','foreignKey':_0xe34a('0x1c0')});db['SalesforceConfiguration'][_0xe34a('0x120')](db[_0xe34a('0xa0')],{'as':_0xe34a('0x169'),'foreignKey':_0xe34a('0x1be')});db[_0xe34a('0xa3')][_0xe34a('0x116')](db[_0xe34a('0xa3')],{'as':'Subject','foreignKey':_0xe34a('0x1c1')});db['SalesforceField']['hasMany'](db[_0xe34a('0xa3')],{'as':_0xe34a('0x1c2'),'foreignKey':_0xe34a('0x1bf')});db[_0xe34a('0xa3')][_0xe34a('0x116')](db['SalesforceField'],{'as':_0xe34a('0x1c3'),'foreignKey':_0xe34a('0x1c0')});db[_0xe34a('0xa3')][_0xe34a('0x120')](db[_0xe34a('0x1c4')],{'as':_0xe34a('0x1c4'),'foreignKey':'VariableId'});db[_0xe34a('0xa5')][_0xe34a('0x116')](db['SugarcrmConfiguration'],{'as':_0xe34a('0x1bd'),'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1be')});db[_0xe34a('0xa7')][_0xe34a('0x116')](db[_0xe34a('0x1c5')],{'as':_0xe34a('0x1c6'),'onDelete':_0xe34a('0x112'),'foreignKey':'SubjectId'});db[_0xe34a('0xa7')]['hasMany'](db[_0xe34a('0x1c5')],{'as':'Descriptions','onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1bf')});db[_0xe34a('0xa7')][_0xe34a('0x116')](db[_0xe34a('0x1c5')],{'as':'Fields','onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1c0')});db[_0xe34a('0xa7')][_0xe34a('0x120')](db[_0xe34a('0xa5')],{'as':'Account','foreignKey':_0xe34a('0x1be')});db[_0xe34a('0x1c5')][_0xe34a('0x116')](db[_0xe34a('0x1c5')],{'as':_0xe34a('0x1c7'),'foreignKey':_0xe34a('0x1c1')});db[_0xe34a('0x1c5')][_0xe34a('0x116')](db[_0xe34a('0x1c5')],{'as':_0xe34a('0x1c2'),'foreignKey':_0xe34a('0x1bf')});db[_0xe34a('0x1c5')][_0xe34a('0x116')](db['SugarcrmField'],{'as':'Field','foreignKey':_0xe34a('0x1c0')});db[_0xe34a('0x1c5')][_0xe34a('0x120')](db[_0xe34a('0x1c4')],{'as':_0xe34a('0x1c4'),'foreignKey':_0xe34a('0x1c8')});db[_0xe34a('0x1c9')]['hasMany'](db['DeskConfiguration'],{'as':_0xe34a('0x1bd'),'onDelete':_0xe34a('0x112'),'foreignKey':'AccountId'});db[_0xe34a('0xaa')][_0xe34a('0x116')](db['DeskField'],{'as':_0xe34a('0x1c6'),'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1c1')});db[_0xe34a('0xaa')][_0xe34a('0x116')](db[_0xe34a('0xac')],{'as':'Descriptions','onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1bf')});db[_0xe34a('0xaa')][_0xe34a('0x116')](db['DeskField'],{'as':_0xe34a('0x1ba'),'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1c0')});db['DeskConfiguration'][_0xe34a('0x120')](db['DeskAccount'],{'as':_0xe34a('0x169'),'foreignKey':_0xe34a('0x1be')});db[_0xe34a('0xaa')][_0xe34a('0x121')](db['Tag'],{'through':_0xe34a('0x1ca')});db['DeskField'][_0xe34a('0x116')](db[_0xe34a('0xac')],{'as':_0xe34a('0x1c7'),'foreignKey':_0xe34a('0x1c1')});db['DeskField'][_0xe34a('0x116')](db[_0xe34a('0xac')],{'as':'Description','foreignKey':'DescriptionId'});db['DeskField'][_0xe34a('0x116')](db[_0xe34a('0xac')],{'as':_0xe34a('0x1c3'),'foreignKey':_0xe34a('0x1c0')});db[_0xe34a('0xac')][_0xe34a('0x120')](db[_0xe34a('0x1c4')],{'as':_0xe34a('0x1c4'),'foreignKey':_0xe34a('0x1c8')});db[_0xe34a('0x1cb')]['hasMany'](db['ZohoConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xe34a('0x1be')});db[_0xe34a('0x1cc')]['hasMany'](db['ZohoField'],{'as':_0xe34a('0x1c6'),'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1c1')});db['ZohoConfiguration'][_0xe34a('0x116')](db['ZohoField'],{'as':_0xe34a('0x1cd'),'onDelete':_0xe34a('0x112'),'foreignKey':'DescriptionId'});db[_0xe34a('0x1cc')][_0xe34a('0x116')](db['ZohoField'],{'as':_0xe34a('0x1ba'),'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1c0')});db[_0xe34a('0x1cc')]['belongsTo'](db['ZohoAccount'],{'as':_0xe34a('0x169'),'foreignKey':_0xe34a('0x1be')});db[_0xe34a('0xad')][_0xe34a('0x116')](db[_0xe34a('0xad')],{'as':_0xe34a('0x1c7'),'foreignKey':_0xe34a('0x1c1')});db['ZohoField'][_0xe34a('0x116')](db[_0xe34a('0xad')],{'as':'Description','foreignKey':_0xe34a('0x1bf')});db[_0xe34a('0xad')][_0xe34a('0x116')](db[_0xe34a('0xad')],{'as':_0xe34a('0x1c3'),'foreignKey':_0xe34a('0x1c0')});db[_0xe34a('0xad')][_0xe34a('0x120')](db[_0xe34a('0x1c4')],{'as':_0xe34a('0x1c4'),'foreignKey':'VariableId'});db[_0xe34a('0xaf')][_0xe34a('0x116')](db[_0xe34a('0xb0')],{'as':_0xe34a('0x1bd'),'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1be')});db[_0xe34a('0xb0')][_0xe34a('0x116')](db[_0xe34a('0xb2')],{'as':_0xe34a('0x1c6'),'foreignKey':_0xe34a('0x1c1')});db['ZendeskConfiguration'][_0xe34a('0x116')](db[_0xe34a('0xb2')],{'as':_0xe34a('0x1cd'),'foreignKey':_0xe34a('0x1bf')});db[_0xe34a('0xb0')][_0xe34a('0x116')](db['ZendeskField'],{'as':_0xe34a('0x1ba'),'foreignKey':_0xe34a('0x1c0')});db[_0xe34a('0xb0')][_0xe34a('0x120')](db[_0xe34a('0xaf')],{'as':_0xe34a('0x169'),'foreignKey':_0xe34a('0x1be')});db[_0xe34a('0xb0')][_0xe34a('0x121')](db[_0xe34a('0x89')],{'through':'int_zendesk_configuration_has_tags'});db[_0xe34a('0xb2')][_0xe34a('0x116')](db[_0xe34a('0xb2')],{'as':_0xe34a('0x1c7'),'foreignKey':_0xe34a('0x1c1')});db[_0xe34a('0xb2')][_0xe34a('0x116')](db[_0xe34a('0xb2')],{'as':'Description','foreignKey':_0xe34a('0x1bf')});db[_0xe34a('0xb2')][_0xe34a('0x116')](db['ZendeskField'],{'as':'Field','foreignKey':'FieldId'});db[_0xe34a('0xb2')][_0xe34a('0x120')](db[_0xe34a('0x1c4')],{'as':_0xe34a('0x1c4'),'foreignKey':_0xe34a('0x1c8')});db[_0xe34a('0xb4')]['hasMany'](db[_0xe34a('0xb6')],{'as':_0xe34a('0x1bd'),'onDelete':_0xe34a('0x112'),'foreignKey':'AccountId'});db[_0xe34a('0xb6')][_0xe34a('0x116')](db[_0xe34a('0xb8')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0xe34a('0xb6')][_0xe34a('0x116')](db[_0xe34a('0xb8')],{'as':_0xe34a('0x1cd'),'onDelete':'cascade','foreignKey':_0xe34a('0x1bf')});db[_0xe34a('0xb6')]['hasMany'](db['FreshdeskField'],{'as':_0xe34a('0x1ba'),'onDelete':_0xe34a('0x112'),'foreignKey':'FieldId'});db[_0xe34a('0xb6')][_0xe34a('0x120')](db[_0xe34a('0xb4')],{'as':_0xe34a('0x169'),'foreignKey':_0xe34a('0x1be')});db[_0xe34a('0xb6')][_0xe34a('0x121')](db[_0xe34a('0x89')],{'through':_0xe34a('0x1ce')});db[_0xe34a('0xb8')][_0xe34a('0x116')](db[_0xe34a('0xb8')],{'as':'Subject','foreignKey':_0xe34a('0x1c1')});db['FreshdeskField'][_0xe34a('0x116')](db[_0xe34a('0xb8')],{'as':_0xe34a('0x1c2'),'foreignKey':_0xe34a('0x1bf')});db[_0xe34a('0xb8')]['hasMany'](db[_0xe34a('0xb8')],{'as':_0xe34a('0x1c3'),'foreignKey':_0xe34a('0x1c0')});db['FreshdeskField'][_0xe34a('0x120')](db[_0xe34a('0x1c4')],{'as':_0xe34a('0x1c4'),'foreignKey':_0xe34a('0x1c8')});db[_0xe34a('0xba')]['hasMany'](db[_0xe34a('0xbc')],{'as':_0xe34a('0x1bd'),'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1be')});db[_0xe34a('0xbc')][_0xe34a('0x116')](db[_0xe34a('0xbe')],{'as':'Subjects','foreignKey':_0xe34a('0x1c1')});db[_0xe34a('0xbc')][_0xe34a('0x116')](db['VtigerField'],{'as':_0xe34a('0x1cd'),'foreignKey':_0xe34a('0x1bf')});db[_0xe34a('0xbc')][_0xe34a('0x116')](db[_0xe34a('0xbe')],{'as':_0xe34a('0x1ba'),'foreignKey':_0xe34a('0x1c0')});db[_0xe34a('0xbc')][_0xe34a('0x120')](db[_0xe34a('0xba')],{'as':_0xe34a('0x169'),'foreignKey':'AccountId'});db['VtigerField']['hasMany'](db[_0xe34a('0xbe')],{'as':_0xe34a('0x1c7'),'foreignKey':_0xe34a('0x1c1')});db[_0xe34a('0xbe')][_0xe34a('0x116')](db[_0xe34a('0xbe')],{'as':_0xe34a('0x1c2'),'foreignKey':_0xe34a('0x1bf')});db[_0xe34a('0xbe')]['hasMany'](db[_0xe34a('0xbe')],{'as':_0xe34a('0x1c3'),'foreignKey':_0xe34a('0x1c0')});db[_0xe34a('0xbe')][_0xe34a('0x120')](db[_0xe34a('0x1c4')],{'as':_0xe34a('0x1c4'),'foreignKey':_0xe34a('0x1c8')});db[_0xe34a('0xc0')][_0xe34a('0x116')](db[_0xe34a('0xc2')],{'as':'Configurations','onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1be')});db[_0xe34a('0xc2')][_0xe34a('0x116')](db[_0xe34a('0x1cf')],{'as':_0xe34a('0x1c6'),'foreignKey':_0xe34a('0x1c1')});db[_0xe34a('0xc2')][_0xe34a('0x116')](db[_0xe34a('0x1cf')],{'as':_0xe34a('0x1cd'),'foreignKey':_0xe34a('0x1bf')});db[_0xe34a('0xc2')][_0xe34a('0x116')](db[_0xe34a('0x1cf')],{'as':_0xe34a('0x1ba'),'foreignKey':_0xe34a('0x1c0')});db[_0xe34a('0xc2')]['belongsTo'](db['ServicenowAccount'],{'as':_0xe34a('0x169'),'foreignKey':_0xe34a('0x1be')});db[_0xe34a('0x1cf')][_0xe34a('0x116')](db[_0xe34a('0x1cf')],{'as':_0xe34a('0x1c7'),'foreignKey':'SubjectId'});db[_0xe34a('0x1cf')][_0xe34a('0x116')](db['ServicenowField'],{'as':_0xe34a('0x1c2'),'foreignKey':_0xe34a('0x1bf')});db[_0xe34a('0x1cf')][_0xe34a('0x116')](db[_0xe34a('0x1cf')],{'as':'Field','foreignKey':_0xe34a('0x1c0')});db[_0xe34a('0x1cf')][_0xe34a('0x120')](db[_0xe34a('0x1c4')],{'as':_0xe34a('0x1c4'),'foreignKey':_0xe34a('0x1c8')});db[_0xe34a('0xc5')][_0xe34a('0x116')](db[_0xe34a('0xc6')],{'as':_0xe34a('0x1bd'),'onDelete':_0xe34a('0x112'),'foreignKey':'AccountId'});db[_0xe34a('0xc5')][_0xe34a('0x120')](db[_0xe34a('0x107')],{'as':'CloudProvider','foreignKey':'CloudProviderId'});db[_0xe34a('0xc6')][_0xe34a('0x116')](db[_0xe34a('0x1d0')],{'as':_0xe34a('0x1c6'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xe34a('0xc6')]['hasMany'](db[_0xe34a('0x1d0')],{'as':_0xe34a('0x1cd'),'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1bf')});db['Dynamics365Configuration'][_0xe34a('0x116')](db[_0xe34a('0x1d0')],{'as':_0xe34a('0x1ba'),'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1c0')});db[_0xe34a('0xc6')][_0xe34a('0x120')](db[_0xe34a('0xc5')],{'as':_0xe34a('0x169'),'foreignKey':_0xe34a('0x1be')});db[_0xe34a('0x1d0')][_0xe34a('0x116')](db[_0xe34a('0x1d0')],{'as':_0xe34a('0x1c7'),'foreignKey':'SubjectId'});db[_0xe34a('0x1d0')]['hasMany'](db[_0xe34a('0x1d0')],{'as':_0xe34a('0x1c2'),'foreignKey':_0xe34a('0x1bf')});db['Dynamics365Field']['hasMany'](db['Dynamics365Field'],{'as':_0xe34a('0x1c3'),'foreignKey':'FieldId'});db[_0xe34a('0x1d0')][_0xe34a('0x120')](db[_0xe34a('0x1c4')],{'as':_0xe34a('0x1c4'),'foreignKey':_0xe34a('0x1c8')});db[_0xe34a('0xc9')][_0xe34a('0x116')](db[_0xe34a('0xca')],{'as':_0xe34a('0x1bd'),'onDelete':'cascade','foreignKey':_0xe34a('0x1be')});db[_0xe34a('0xca')][_0xe34a('0x116')](db[_0xe34a('0xcb')],{'as':_0xe34a('0x1c6'),'foreignKey':_0xe34a('0x1c1')});db['FreshsalesConfiguration'][_0xe34a('0x116')](db[_0xe34a('0xcb')],{'as':_0xe34a('0x1cd'),'foreignKey':_0xe34a('0x1bf')});db['FreshsalesConfiguration']['hasMany'](db[_0xe34a('0xcb')],{'as':_0xe34a('0x1ba'),'foreignKey':'FieldId'});db[_0xe34a('0xca')][_0xe34a('0x120')](db[_0xe34a('0xc9')],{'as':_0xe34a('0x169'),'foreignKey':_0xe34a('0x1be')});db[_0xe34a('0xcb')][_0xe34a('0x116')](db['FreshsalesField'],{'as':_0xe34a('0x1c7'),'foreignKey':_0xe34a('0x1c1')});db[_0xe34a('0xcb')][_0xe34a('0x116')](db[_0xe34a('0xcb')],{'as':_0xe34a('0x1c2'),'foreignKey':_0xe34a('0x1bf')});db[_0xe34a('0xcb')][_0xe34a('0x116')](db[_0xe34a('0xcb')],{'as':'Field','foreignKey':_0xe34a('0x1c0')});db[_0xe34a('0xcb')][_0xe34a('0x120')](db[_0xe34a('0x1c4')],{'as':_0xe34a('0x1c4'),'foreignKey':_0xe34a('0x1c8')});db['ChatQueueReport'][_0xe34a('0x120')](db[_0xe34a('0x60')],{});db[_0xe34a('0x1d1')][_0xe34a('0x120')](db[_0xe34a('0x127')],{'as':_0xe34a('0x163'),'foreignKey':'ListId'});db['ChatQueueReport'][_0xe34a('0x120')](db['CmContact'],{'as':_0xe34a('0x15a'),'foreignKey':_0xe34a('0x16a')});db[_0xe34a('0x1d1')][_0xe34a('0x120')](db[_0xe34a('0x65')],{});db[_0xe34a('0x1d1')][_0xe34a('0x120')](db[_0xe34a('0x67')],{});db['ChatQueueReport'][_0xe34a('0x120')](db['User'],{});db[_0xe34a('0x1d1')]['belongsTo'](db[_0xe34a('0x69')],{});db[_0xe34a('0x1d2')][_0xe34a('0x120')](db[_0xe34a('0x113')],{'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1d3')});db[_0xe34a('0x1d2')]['belongsTo'](db[_0xe34a('0x113')],{'onDelete':_0xe34a('0x112'),'foreignKey':'ToId'});db[_0xe34a('0xd2')][_0xe34a('0x116')](db[_0xe34a('0xd0')],{'foreignKey':_0xe34a('0x1d4'),'onDelete':_0xe34a('0x112')});db[_0xe34a('0xd2')][_0xe34a('0x116')](db[_0xe34a('0xce')],{'foreignKey':_0xe34a('0x1d4'),'onDelete':'cascade'});db[_0xe34a('0xd4')][_0xe34a('0x120')](db[_0xe34a('0x51')],{});db[_0xe34a('0xd4')][_0xe34a('0x120')](db[_0xe34a('0x127')],{'as':_0xe34a('0x163'),'foreignKey':'ListId'});db[_0xe34a('0xd4')][_0xe34a('0x120')](db['CmContact'],{'as':_0xe34a('0x15a'),'foreignKey':_0xe34a('0x16a')});db[_0xe34a('0xd4')]['belongsTo'](db[_0xe34a('0x55')],{});db[_0xe34a('0xd4')][_0xe34a('0x120')](db[_0xe34a('0x17c')],{});db[_0xe34a('0xd4')][_0xe34a('0x120')](db['User'],{});db['SmsQueueReport']['belongsTo'](db[_0xe34a('0x17f')],{});db[_0xe34a('0xda')][_0xe34a('0x116')](db[_0xe34a('0xd2')],{'foreignKey':_0xe34a('0x1d5')});db['JscriptyProject'][_0xe34a('0x116')](db[_0xe34a('0xd0')],{'foreignKey':_0xe34a('0x1d5')});db[_0xe34a('0xda')][_0xe34a('0x116')](db[_0xe34a('0xce')],{'foreignKey':_0xe34a('0x1d5')});db['Team'][_0xe34a('0x121')](db[_0xe34a('0x113')],{'as':_0xe34a('0x152'),'through':_0xe34a('0x1d6')});db[_0xe34a('0xe3')][_0xe34a('0x121')](db[_0xe34a('0x1b')],{'through':_0xe34a('0x109'),'as':_0xe34a('0x134')});db['Team'][_0xe34a('0x121')](db[_0xe34a('0x3b')],{'through':_0xe34a('0x167'),'as':_0xe34a('0x136')});db[_0xe34a('0xe3')][_0xe34a('0x121')](db[_0xe34a('0x69')],{'through':_0xe34a('0x195'),'as':_0xe34a('0x1d7')});db[_0xe34a('0xe3')]['belongsToMany'](db[_0xe34a('0x4e')],{'through':'team_has_fax_queues','as':_0xe34a('0x1d8')});db[_0xe34a('0xe3')][_0xe34a('0x121')](db[_0xe34a('0x17f')],{'through':_0xe34a('0x183'),'as':_0xe34a('0x1d9')});db['Team'][_0xe34a('0x121')](db['OpenchannelQueue'],{'through':_0xe34a('0x18a'),'as':'OpenchannelQueues'});db[_0xe34a('0xe3')]['belongsToMany'](db[_0xe34a('0x105')],{'through':'team_has_whatsapp_queues','as':_0xe34a('0x13a')});db['Team'][_0xe34a('0x121')](db[_0xe34a('0xf4')],{'through':_0xe34a('0x10b'),'as':'VoicePrefixes'});db['Campaign'][_0xe34a('0x116')](db[_0xe34a('0x70')],{'as':'Hoppers','foreignKey':_0xe34a('0x1a3')});db[_0xe34a('0xe6')]['hasMany'](db['CmHopperFinal'],{'as':_0xe34a('0x11a'),'foreignKey':_0xe34a('0x1a3')});db[_0xe34a('0xe6')]['hasMany'](db[_0xe34a('0x74')],{'as':'HopperHistories','foreignKey':_0xe34a('0x1a3')});db['Campaign']['hasMany'](db[_0xe34a('0x72')],{'as':_0xe34a('0x14b'),'foreignKey':_0xe34a('0x1a3')});db[_0xe34a('0xe6')][_0xe34a('0x120')](db[_0xe34a('0x14d')],{'as':_0xe34a('0x14d'),'foreignKey':'TrunkId'});db[_0xe34a('0xe6')]['belongsTo'](db[_0xe34a('0x14d')],{'as':_0xe34a('0x14f'),'foreignKey':_0xe34a('0x150')});db[_0xe34a('0xe6')][_0xe34a('0x120')](db[_0xe34a('0x80')],{'as':'Interval','foreignKey':_0xe34a('0x172')});db['Campaign']['belongsTo'](db[_0xe34a('0xdf')],{'as':'SquareProject','foreignKey':_0xe34a('0x1da')});db[_0xe34a('0xe6')][_0xe34a('0x121')](db[_0xe34a('0x127')],{'as':'Lists','through':_0xe34a('0x1db')});db[_0xe34a('0xe6')][_0xe34a('0x121')](db[_0xe34a('0x127')],{'as':_0xe34a('0x154'),'through':_0xe34a('0x1dc')});db[_0xe34a('0xe9')][_0xe34a('0x120')](db[_0xe34a('0x194')],{'as':_0xe34a('0x194'),'foreignKey':_0xe34a('0x171')});db[_0xe34a('0x1dd')][_0xe34a('0x120')](db[_0xe34a('0x3f')],{});db[_0xe34a('0x1dd')][_0xe34a('0x120')](db[_0xe34a('0x3d')],{});db[_0xe34a('0x1dd')][_0xe34a('0x120')](db[_0xe34a('0x140')],{'foreignKey':_0xe34a('0x1de'),'as':'FromAccount'});db[_0xe34a('0x1dd')]['belongsTo'](db[_0xe34a('0x113')],{'foreignKey':_0xe34a('0x1df'),'as':'FromAgent'});db[_0xe34a('0x1dd')]['belongsTo'](db[_0xe34a('0x113')],{'foreignKey':_0xe34a('0x1e0'),'as':'ToAgent'});db[_0xe34a('0x1dd')][_0xe34a('0x120')](db[_0xe34a('0x3b')],{'foreignKey':'ToMailQueueId','as':_0xe34a('0x1e1')});db['MailTransferReport']['belongsTo'](db[_0xe34a('0x140')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0xe34a('0xec')][_0xe34a('0x120')](db[_0xe34a('0x67')],{});db[_0xe34a('0xec')][_0xe34a('0x120')](db[_0xe34a('0x65')],{});db[_0xe34a('0xec')]['belongsTo'](db[_0xe34a('0x60')],{'foreignKey':_0xe34a('0x1e2'),'as':'FromAccount'});db[_0xe34a('0xec')]['belongsTo'](db[_0xe34a('0x113')],{'foreignKey':_0xe34a('0x1df'),'as':'FromAgent'});db[_0xe34a('0xec')]['belongsTo'](db[_0xe34a('0x113')],{'foreignKey':_0xe34a('0x1e0'),'as':'ToAgent'});db[_0xe34a('0xec')][_0xe34a('0x120')](db['ChatQueue'],{'foreignKey':_0xe34a('0x1e3'),'as':_0xe34a('0x1e1')});db[_0xe34a('0xec')][_0xe34a('0x120')](db[_0xe34a('0x60')],{'foreignKey':'ToChatWebsiteId','as':_0xe34a('0x1e4')});db['FaxTransferReport'][_0xe34a('0x120')](db['FaxMessage'],{});db['FaxTransferReport'][_0xe34a('0x120')](db[_0xe34a('0x4b')],{});db[_0xe34a('0xed')][_0xe34a('0x120')](db['FaxAccount'],{'foreignKey':_0xe34a('0x1e5'),'as':'FromAccount'});db['FaxTransferReport']['belongsTo'](db[_0xe34a('0x113')],{'foreignKey':_0xe34a('0x1df'),'as':_0xe34a('0x1e6')});db[_0xe34a('0xed')][_0xe34a('0x120')](db[_0xe34a('0x113')],{'foreignKey':'ToUserId','as':_0xe34a('0x1e7')});db[_0xe34a('0xed')][_0xe34a('0x120')](db['FaxQueue'],{'foreignKey':_0xe34a('0x1e8'),'as':'ToQueue'});db['FaxTransferReport'][_0xe34a('0x120')](db['FaxAccount'],{'foreignKey':_0xe34a('0x1e9'),'as':_0xe34a('0x1e4')});db['OpenchannelTransferReport']['belongsTo'](db[_0xe34a('0x185')],{});db[_0xe34a('0xef')][_0xe34a('0x120')](db[_0xe34a('0x5b')],{});db[_0xe34a('0xef')][_0xe34a('0x120')](db[_0xe34a('0x58')],{'foreignKey':_0xe34a('0x1ea'),'as':_0xe34a('0x1eb')});db['OpenchannelTransferReport'][_0xe34a('0x120')](db[_0xe34a('0x113')],{'foreignKey':'FromUserId','as':_0xe34a('0x1e6')});db[_0xe34a('0xef')]['belongsTo'](db['User'],{'foreignKey':_0xe34a('0x1e0'),'as':_0xe34a('0x1e7')});db['OpenchannelTransferReport']['belongsTo'](db[_0xe34a('0x5e')],{'foreignKey':_0xe34a('0x1ec'),'as':_0xe34a('0x1e1')});db[_0xe34a('0xef')][_0xe34a('0x120')](db[_0xe34a('0x58')],{'foreignKey':_0xe34a('0x1ed'),'as':_0xe34a('0x1e4')});db[_0xe34a('0xf1')]['belongsTo'](db['SmsMessage'],{});db[_0xe34a('0xf1')][_0xe34a('0x120')](db[_0xe34a('0x55')],{});db[_0xe34a('0xf1')]['belongsTo'](db[_0xe34a('0x51')],{'foreignKey':_0xe34a('0x1ee'),'as':_0xe34a('0x1eb')});db[_0xe34a('0xf1')][_0xe34a('0x120')](db[_0xe34a('0x113')],{'foreignKey':_0xe34a('0x1df'),'as':_0xe34a('0x1e6')});db[_0xe34a('0xf1')][_0xe34a('0x120')](db[_0xe34a('0x113')],{'foreignKey':'ToUserId','as':_0xe34a('0x1e7')});db[_0xe34a('0xf1')]['belongsTo'](db['SmsQueue'],{'foreignKey':_0xe34a('0x1ef'),'as':_0xe34a('0x1e1')});db[_0xe34a('0xf1')][_0xe34a('0x120')](db[_0xe34a('0x51')],{'foreignKey':_0xe34a('0x1f0'),'as':_0xe34a('0x1e4')});db[_0xe34a('0x127')][_0xe34a('0x116')](db[_0xe34a('0x15f')],{'as':'Dispositions','foreignKey':_0xe34a('0x164'),'onDelete':_0xe34a('0x112')});db['CmList']['hasMany'](db['CmCustomField'],{'as':_0xe34a('0x1f1'),'foreignKey':_0xe34a('0x164')});db['CmList'][_0xe34a('0x116')](db[_0xe34a('0x6f')],{'as':'Contacts','onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x164')});db[_0xe34a('0x127')][_0xe34a('0x116')](db[_0xe34a('0x119')],{'as':_0xe34a('0x11a'),'foreignKey':'ListId'});db['CmList'][_0xe34a('0x116')](db[_0xe34a('0x74')],{'as':'HopperHistory','foreignKey':_0xe34a('0x164')});db[_0xe34a('0x127')][_0xe34a('0x116')](db[_0xe34a('0x76')],{'as':_0xe34a('0x76'),'foreignKey':_0xe34a('0x164')});db['CmList'][_0xe34a('0x121')](db[_0xe34a('0x1b')],{'as':_0xe34a('0x1f2'),'through':_0xe34a('0x1f3')});db[_0xe34a('0x127')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xe34a('0x129')});db[_0xe34a('0xf4')]['hasMany'](db[_0xe34a('0x18')],{'as':_0xe34a('0x118'),'onDelete':_0xe34a('0x112')});db[_0xe34a('0xf4')]['belongsToMany'](db[_0xe34a('0x113')],{'as':_0xe34a('0x152'),'through':'UserVoicePrefix'});db['VoicePrefix'][_0xe34a('0x121')](db[_0xe34a('0xe3')],{'through':_0xe34a('0x10b'),'as':'Teams'});db['UserProfile'][_0xe34a('0x116')](db[_0xe34a('0x113')],{'as':'Users','foreignKey':'userProfileId'});db[_0xe34a('0xf5')][_0xe34a('0x116')](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0xe34a('0x1f4'),'onDelete':_0xe34a('0x112')});db[_0xe34a('0xf7')][_0xe34a('0x116')](db['UserProfileResource'],{'as':_0xe34a('0x1f5'),'foreignKey':'sectionId','onDelete':_0xe34a('0x112')});db['WhatsappAccount'][_0xe34a('0x116')](db[_0xe34a('0x15f')],{'as':_0xe34a('0x160'),'foreignKey':_0xe34a('0x1f6'),'onDelete':'cascade'});db[_0xe34a('0xfc')][_0xe34a('0x116')](db[_0xe34a('0x7b')],{'as':_0xe34a('0x161'),'foreignKey':_0xe34a('0x1f6')});db[_0xe34a('0xfc')][_0xe34a('0x116')](db[_0xe34a('0x101')],{'as':'Messages','foreignKey':_0xe34a('0x1f6')});db[_0xe34a('0xfc')]['hasMany'](db[_0xe34a('0x131')],{'as':_0xe34a('0x162')});db[_0xe34a('0xfc')]['hasMany'](db[_0xe34a('0xfe')],{'as':'Applications','foreignKey':_0xe34a('0x1f6'),'onDelete':_0xe34a('0x112')});db[_0xe34a('0xfc')][_0xe34a('0x120')](db[_0xe34a('0x127')],{'as':_0xe34a('0x163'),'foreignKey':_0xe34a('0x164')});db['WhatsappAccount'][_0xe34a('0x120')](db[_0xe34a('0x82')],{'as':_0xe34a('0x151'),'foreignKey':_0xe34a('0x17d')});db[_0xe34a('0xfc')]['belongsToMany'](db[_0xe34a('0x113')],{'as':_0xe34a('0x152'),'through':_0xe34a('0x1f7')});db[_0xe34a('0xfe')][_0xe34a('0x120')](db[_0xe34a('0x113')],{'onDelete':_0xe34a('0x15d')});db['WhatsappApplication'][_0xe34a('0x120')](db['WhatsappQueue'],{'onDelete':_0xe34a('0x15d')});db[_0xe34a('0xfe')][_0xe34a('0x120')](db[_0xe34a('0xfc')],{'onDelete':_0xe34a('0x15d')});db['WhatsappApplication'][_0xe34a('0x120')](db[_0xe34a('0x80')],{'onDelete':_0xe34a('0x15d'),'foreignKey':_0xe34a('0x172')});db[_0xe34a('0xfe')][_0xe34a('0x120')](db['Tag'],{'onDelete':_0xe34a('0x15d'),'foreignKey':_0xe34a('0x173')});db[_0xe34a('0x131')][_0xe34a('0x116')](db[_0xe34a('0x101')],{'as':_0xe34a('0x156'),'onDelete':_0xe34a('0x112'),'foreignKey':_0xe34a('0x1f8')});db[_0xe34a('0x131')]['belongsTo'](db[_0xe34a('0xfc')],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0xe34a('0x131')][_0xe34a('0x120')](db[_0xe34a('0x6f')],{'as':'Contact','foreignKey':_0xe34a('0x16a')});db[_0xe34a('0x131')][_0xe34a('0x120')](db['User'],{'as':_0xe34a('0x16b'),'foreignKey':_0xe34a('0x115')});db[_0xe34a('0x131')]['belongsToMany'](db['Tag'],{'through':_0xe34a('0x1b3'),'as':'Tags'});db[_0xe34a('0x131')][_0xe34a('0x121')](db[_0xe34a('0x89')],{'through':_0xe34a('0x1b3'),'as':_0xe34a('0x16e')});db[_0xe34a('0x131')][_0xe34a('0x121')](db['User'],{'as':_0xe34a('0x16f'),'through':'user_has_whatsapp_interactions','foreignKey':_0xe34a('0x1f8')});db['WhatsappMessage'][_0xe34a('0x120')](db[_0xe34a('0x113')],{'as':_0xe34a('0x113')});db[_0xe34a('0x101')][_0xe34a('0x120')](db[_0xe34a('0x6f')],{'onDelete':_0xe34a('0x112'),'as':_0xe34a('0x15a')});db[_0xe34a('0x101')][_0xe34a('0x120')](db[_0xe34a('0x131')],{'onDelete':_0xe34a('0x112'),'as':_0xe34a('0x179'),'foreignKey':'WhatsappInteractionId'});db[_0xe34a('0x101')][_0xe34a('0x120')](db[_0xe34a('0xfc')],{'as':'Account','foreignKey':_0xe34a('0x1f6')});db['WhatsappQueueReport'][_0xe34a('0x120')](db['WhatsappAccount'],{});db[_0xe34a('0x103')][_0xe34a('0x120')](db[_0xe34a('0x127')],{'as':_0xe34a('0x163'),'foreignKey':_0xe34a('0x164')});db[_0xe34a('0x103')][_0xe34a('0x120')](db[_0xe34a('0x6f')],{'as':_0xe34a('0x15a'),'foreignKey':'ContactId'});db['WhatsappQueueReport']['belongsTo'](db['WhatsappInteraction'],{});db[_0xe34a('0x103')][_0xe34a('0x120')](db[_0xe34a('0x105')],{});db[_0xe34a('0x103')][_0xe34a('0x120')](db[_0xe34a('0x101')],{});db[_0xe34a('0x103')][_0xe34a('0x120')](db['User'],{});db[_0xe34a('0x1f9')][_0xe34a('0x120')](db[_0xe34a('0x101')],{});db[_0xe34a('0x1f9')][_0xe34a('0x120')](db[_0xe34a('0x131')],{});db[_0xe34a('0x1f9')]['belongsTo'](db[_0xe34a('0xfc')],{'foreignKey':_0xe34a('0x1fa'),'as':_0xe34a('0x1eb')});db[_0xe34a('0x1f9')][_0xe34a('0x120')](db['WhatsappAccount'],{'foreignKey':_0xe34a('0x1fb'),'as':_0xe34a('0x1e4')});db[_0xe34a('0x1f9')][_0xe34a('0x120')](db[_0xe34a('0x105')],{'foreignKey':_0xe34a('0x1fc'),'as':_0xe34a('0x1e1')});db['WhatsappTransferReport'][_0xe34a('0x120')](db[_0xe34a('0x113')],{'foreignKey':_0xe34a('0x1df'),'as':'FromAgent'});db[_0xe34a('0x1f9')][_0xe34a('0x120')](db[_0xe34a('0x113')],{'foreignKey':'ToUserId','as':_0xe34a('0x1e7')});db['WhatsappQueue']['belongsToMany'](db[_0xe34a('0x113')],{'as':_0xe34a('0x152'),'through':_0xe34a('0x13b'),'foreignKey':_0xe34a('0x1fd')});db[_0xe34a('0x105')]['belongsToMany'](db[_0xe34a('0xe3')],{'through':_0xe34a('0x1fe'),'as':_0xe34a('0x153')});db['UserSetting'][_0xe34a('0x120')](db[_0xe34a('0x113')],{'as':_0xe34a('0x1ff'),'foreignKey':'UserId','onDelete':'cascade','hooks':!![]});db['CloudProvider'][_0xe34a('0x111')](db[_0xe34a('0xc5')],{'as':'Dynamics365Account','onDelete':_0xe34a('0x15d')});db['CloudProvider'][_0xe34a('0x111')](db['MailServerIn'],{'as':_0xe34a('0x15e'),'onDelete':_0xe34a('0x15d')});db[_0xe34a('0x107')][_0xe34a('0x111')](db[_0xe34a('0x38')],{'as':_0xe34a('0x200'),'onDelete':'restrict'});module[_0xe34a('0x201')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 925152a..8d35744 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f9b=['/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/applications','./api/smsApplication','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelInteraction','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','/api/schedules','/api/sounds','/api/tags','/api/contact_item_types','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/fields','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/networks','./api/network','/api/chat/reports/queue','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','/api/attachments','/api/plugins','./api/plugin','./api/chatTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','./api/cloudProvider','./api/realtime','./api/user-setting','/api/mail_interaction_has_tags','./api/mailInteractionHasTag','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.9.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','express','./errors','setupLoggers','./api/client-side-logs','then','use','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport'];(function(_0x28c939,_0x110e29){var _0x527fe9=function(_0x1df2a6){while(--_0x1df2a6){_0x28c939['push'](_0x28c939['shift']());}};_0x527fe9(++_0x110e29);}(_0x8f9b,0x1f2));var _0xb8f9=function(_0x4784a2,_0xa514a){_0x4784a2=_0x4784a2-0x0;var _0x36a5e4=_0x8f9b[_0x4784a2];return _0x36a5e4;};'use strict';var path=require('path');var express=require(_0xb8f9('0x0'));var errors=require(_0xb8f9('0x1'));var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')[_0xb8f9('0x2')];var clientSideLogs=require(_0xb8f9('0x3'));exports['default']=function(_0x317025){return setupLoggers(_0x317025)[_0xb8f9('0x4')](function(){_0x317025[_0xb8f9('0x5')](_0xb8f9('0x6'),require(_0xb8f9('0x7')));_0x317025['use'](_0xb8f9('0x8'),require('./api/voiceChanSpy'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x9'),require(_0xb8f9('0xa')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xb'),require(_0xb8f9('0xc')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xd'),require(_0xb8f9('0xe')));_0x317025[_0xb8f9('0x5')]('/api/voice/queues',require(_0xb8f9('0xf')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x10'),require(_0xb8f9('0x11')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x12'),require(_0xb8f9('0x13')));_0x317025['use'](_0xb8f9('0x14'),require(_0xb8f9('0x15')));_0x317025[_0xb8f9('0x5')]('/api/voice/mails/messages',require(_0xb8f9('0x16')));_0x317025['use'](_0xb8f9('0x17'),require('./api/voiceCallReport'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x18'),require(_0xb8f9('0x19')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x1a'),require(_0xb8f9('0x1b')));_0x317025['use'](_0xb8f9('0x1c'),require(_0xb8f9('0x1d')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x1e'),require(_0xb8f9('0x1f')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x20'),require('./api/trunk'));_0x317025[_0xb8f9('0x5')]('/api/voice/transfers/reports',require(_0xb8f9('0x21')));_0x317025['use']('/api/mail/out_servers',require(_0xb8f9('0x22')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x23'),require(_0xb8f9('0x24')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x25'),require(_0xb8f9('0x26')));_0x317025['use']('/api/mail/substatuses',require(_0xb8f9('0x27')));_0x317025['use'](_0xb8f9('0x28'),require(_0xb8f9('0x29')));_0x317025['use']('/api/mail/messages',require('./api/mailMessage'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x2a'),require('./api/mailApplication'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x2b'),require(_0xb8f9('0x2c')));_0x317025['use'](_0xb8f9('0x2d'),require('./api/dashboard'));_0x317025['use'](_0xb8f9('0x2e'),require(_0xb8f9('0x2f')));_0x317025['use'](_0xb8f9('0x30'),require(_0xb8f9('0x31')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x32'),require('./api/faxApplication'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x33'),require(_0xb8f9('0x34')));_0x317025[_0xb8f9('0x5')]('/api/fax/messages',require('./api/faxMessage'));_0x317025['use'](_0xb8f9('0x35'),require('./api/faxQueue'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x36'),require(_0xb8f9('0x37')));_0x317025[_0xb8f9('0x5')]('/api/sms/accounts',require('./api/smsAccount'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x38'),require(_0xb8f9('0x39')));_0x317025['use']('/api/sms/interactions',require('./api/smsInteraction'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x3a'),require(_0xb8f9('0x3b')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x3c'),require(_0xb8f9('0x3d')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x3e'),require('./api/openchannelAccount'));_0x317025['use']('/api/openchannel/applications',require('./api/openchannelApplication'));_0x317025[_0xb8f9('0x5')]('/api/openchannel/interactions',require(_0xb8f9('0x3f')));_0x317025['use']('/api/openchannel/messages',require(_0xb8f9('0x40')));_0x317025[_0xb8f9('0x5')]('/api/openchannel/queues',require(_0xb8f9('0x41')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x42'),require(_0xb8f9('0x43')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x44'),require(_0xb8f9('0x45')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x46'),require(_0xb8f9('0x47')));_0x317025['use']('/api/chat/interactions',require(_0xb8f9('0x48')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x49'),require(_0xb8f9('0x4a')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x4b'),require(_0xb8f9('0x4c')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x4d'),require(_0xb8f9('0x4e')));_0x317025['use']('/api/chat/groups',require(_0xb8f9('0x4f')));_0x317025[_0xb8f9('0x5')]('/api/chat/proactive_actions',require(_0xb8f9('0x50')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x51'),require(_0xb8f9('0x52')));_0x317025['use'](_0xb8f9('0x53'),require(_0xb8f9('0x54')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x55'),require('./api/cmHopper'));_0x317025[_0xb8f9('0x5')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x56'),require('./api/cmHopperFinal'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x57'),require(_0xb8f9('0x58')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x59'),require('./api/cmCustomField'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x5a'),require(_0xb8f9('0x5b')));_0x317025[_0xb8f9('0x5')]('/api/automations',require(_0xb8f9('0x5c')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x5d'),require('./api/cannedAnswer'));_0x317025['use'](_0xb8f9('0x5e'),require(_0xb8f9('0x5f')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x60'),require(_0xb8f9('0x61')));_0x317025['use'](_0xb8f9('0x62'),require(_0xb8f9('0x63')));_0x317025['use'](_0xb8f9('0x64'),require(_0xb8f9('0x65')));_0x317025[_0xb8f9('0x5')]('/api/cdr',require(_0xb8f9('0x66')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x67'),require('./api/voiceQueuesLog'));_0x317025['use'](_0xb8f9('0x68'),require('./api/schedule'));_0x317025['use'](_0xb8f9('0x69'),require('./api/sound'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x6a'),require('./api/tag'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x6b'),require('./api/contactItemType'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x6c'),require('./api/cmContactHasItem'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x6d'),require(_0xb8f9('0x6e')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x6f'),require(_0xb8f9('0x70')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x71'),require('./api/trigger'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x72'),require(_0xb8f9('0x73')));_0x317025['use'](_0xb8f9('0x74'),require('./api/integration'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x75'),require(_0xb8f9('0x76')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x77'),require(_0xb8f9('0x78')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x79'),require('./api/analyticDefaultReport'));_0x317025[_0xb8f9('0x5')]('/api/analytics/extracted_reports',require(_0xb8f9('0x7a')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x7b'),require(_0xb8f9('0x7c')));_0x317025[_0xb8f9('0x5')]('/api/analytics/field_reports',require(_0xb8f9('0x7d')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x7e'),require(_0xb8f9('0x7f')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x80'),require(_0xb8f9('0x81')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x82'),require('./api/intSalesforceConfiguration'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x83'),require('./api/intSalesforceField'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x84'),require('./api/intSugarcrmAccount'));_0x317025['use'](_0xb8f9('0x85'),require('./api/intSugarcrmConfiguration'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x86'),require(_0xb8f9('0x87')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x88'),require(_0xb8f9('0x89')));_0x317025[_0xb8f9('0x5')]('/api/integrations/desk/configurations',require(_0xb8f9('0x8a')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x8b'),require(_0xb8f9('0x8c')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x8d'),require(_0xb8f9('0x8e')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x8f'),require(_0xb8f9('0x90')));_0x317025[_0xb8f9('0x5')]('/api/integrations/zoho/fields',require(_0xb8f9('0x91')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x92'),require(_0xb8f9('0x93')));_0x317025[_0xb8f9('0x5')]('/api/integrations/zendesk/configurations',require(_0xb8f9('0x94')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x95'),require(_0xb8f9('0x96')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x97'),require(_0xb8f9('0x98')));_0x317025[_0xb8f9('0x5')]('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x99'),require('./api/intFreshdeskField'));_0x317025['use']('/api/integrations/vtiger/accounts',require(_0xb8f9('0x9a')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x9b'),require(_0xb8f9('0x9c')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x9d'),require(_0xb8f9('0x9e')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0x9f'),require(_0xb8f9('0xa0')));_0x317025[_0xb8f9('0x5')]('/api/integrations/servicenow/configurations',require(_0xb8f9('0xa1')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xa2'),require('./api/intServicenowField'));_0x317025['use'](_0xb8f9('0xa3'),require(_0xb8f9('0xa4')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xa5'),require(_0xb8f9('0xa6')));_0x317025[_0xb8f9('0x5')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x317025[_0xb8f9('0x5')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xa7'),require(_0xb8f9('0xa8')));_0x317025[_0xb8f9('0x5')]('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xa9'),require(_0xb8f9('0xaa')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xab'),require('./api/chatQueueReport'));_0x317025['use']('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xac'),require(_0xb8f9('0xad')));_0x317025['use'](_0xb8f9('0xae'),require(_0xb8f9('0xaf')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xb0'),require(_0xb8f9('0xb1')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xb2'),require(_0xb8f9('0xb3')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xb4'),require(_0xb8f9('0xb5')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xb6'),require(_0xb8f9('0xb7')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xb8'),require(_0xb8f9('0xb9')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xba'),require(_0xb8f9('0xbb')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xbc'),require(_0xb8f9('0xbd')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xbe'),require('./api/squareProject'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xbf'),require('./api/squareRecording'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xc0'),require(_0xb8f9('0xc1')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xc2'),require(_0xb8f9('0xc3')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xc4'),require(_0xb8f9('0xc5')));_0x317025[_0xb8f9('0x5')]('/api/campaigns',require(_0xb8f9('0xc6')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xc7'),require('./api/migration'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xc8'),require('./api/attachment'));_0x317025['use'](_0xb8f9('0xc9'),require(_0xb8f9('0xca')));_0x317025[_0xb8f9('0x5')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x317025[_0xb8f9('0x5')]('/api/chat/reports/transfer',require(_0xb8f9('0xcb')));_0x317025[_0xb8f9('0x5')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x317025['use'](_0xb8f9('0xcc'),require(_0xb8f9('0xcd')));_0x317025['use'](_0xb8f9('0xce'),require(_0xb8f9('0xcf')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xd0'),require(_0xb8f9('0xd1')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xd2'),require(_0xb8f9('0xd3')));_0x317025[_0xb8f9('0x5')]('/api/userProfiles',require(_0xb8f9('0xd4')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xd5'),require('./api/userProfileSection'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xd6'),require(_0xb8f9('0xd7')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xd8'),require(_0xb8f9('0xd9')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xda'),require('./api/whatsappAccount'));_0x317025['use']('/api/whatsapp/applications',require(_0xb8f9('0xdb')));_0x317025['use']('/api/whatsapp/interactions',require(_0xb8f9('0xdc')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xdd'),require(_0xb8f9('0xde')));_0x317025[_0xb8f9('0x5')]('/api/whatsapp/reports/queue',require(_0xb8f9('0xdf')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xe0'),require(_0xb8f9('0xe1')));_0x317025['use']('/api/whatsapp/queues',require(_0xb8f9('0xe2')));_0x317025['use']('/api/cloudProviders',require(_0xb8f9('0xe3')));_0x317025[_0xb8f9('0x5')]('/api/realtime',require(_0xb8f9('0xe4')));_0x317025[_0xb8f9('0x5')]('/api/user-settings',require(_0xb8f9('0xe5')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xe6'),require(_0xb8f9('0xe7')));_0x317025[_0xb8f9('0x5')]('/api/auth/local',require('./api/authLocal'));_0x317025['use'](_0xb8f9('0xe8'),require(_0xb8f9('0xe9')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xea'),require('./api/authActiveDirectory'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xeb'),require('./api/jira'));_0x317025['use'](_0xb8f9('0xec'),require(_0xb8f9('0xed')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xee'),require(_0xb8f9('0xef')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xf0'),require(_0xb8f9('0xf1')));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xf2'),require(_0xb8f9('0xf3')));_0x317025['use'](_0xb8f9('0xf4'),require('./api/webbar'));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xf5'),clientSideLogs);_0x317025[_0xb8f9('0x5')](_0xb8f9('0xf6'),express[_0xb8f9('0xf7')](path[_0xb8f9('0xf8')](config[_0xb8f9('0xf9')],_0xb8f9('0xf6'))));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xfa'),express[_0xb8f9('0xf7')](path[_0xb8f9('0xf8')](config[_0xb8f9('0xf9')],'/www')));_0x317025['use'](_0xb8f9('0xfb'),express[_0xb8f9('0xf7')](path['join'](config[_0xb8f9('0xf9')],_0xb8f9('0xfb'))));_0x317025[_0xb8f9('0x5')](_0xb8f9('0xfc'),express[_0xb8f9('0xf7')](path[_0xb8f9('0xf8')](config[_0xb8f9('0xf9')],_0xb8f9('0xfd'),_0xb8f9('0xfe'))));_0x317025[_0xb8f9('0x5')]('/plugins',express['static'](path[_0xb8f9('0xf8')](config[_0xb8f9('0xf9')],_0xb8f9('0xff'))));_0x317025[_0xb8f9('0x100')](_0xb8f9('0x101'))[_0xb8f9('0x102')](errors[0x194]);_0x317025[_0xb8f9('0x100')]('/*')[_0xb8f9('0x102')](function(_0x51d45f,_0x278ce0){_0x278ce0[_0xb8f9('0x103')](path[_0xb8f9('0x104')](_0x317025[_0xb8f9('0x102')](_0xb8f9('0x105'))+_0xb8f9('0x106')));});return _0x317025;});}; \ No newline at end of file +var _0xcf30=['./config/environment','setupLoggers','./api/client-side-logs','default','then','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/substatuses','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsApplication','/api/sms/messages','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','./api/trigger','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','/api/license','./api/license','/api/campaigns','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/voicePrefix','/api/userProfiles','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/mail_interaction_has_tags','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','join','root','/www','/demo','static','/snippet','snippet','/plugins','route','get','sendFile','resolve','path','express','./errors'];(function(_0x476896,_0x5c4e5c){var _0x2ef4a9=function(_0xaf7f2b){while(--_0xaf7f2b){_0x476896['push'](_0x476896['shift']());}};_0x2ef4a9(++_0x5c4e5c);}(_0xcf30,0x102));var _0x0cf3=function(_0x294d00,_0x322e54){_0x294d00=_0x294d00-0x0;var _0x558e1e=_0xcf30[_0x294d00];return _0x558e1e;};'use strict';var path=require(_0x0cf3('0x0'));var express=require(_0x0cf3('0x1'));var errors=require(_0x0cf3('0x2'));var config=require(_0x0cf3('0x3'));var setupLoggers=require('./utils/client-side-logger')[_0x0cf3('0x4')];var clientSideLogs=require(_0x0cf3('0x5'));exports[_0x0cf3('0x6')]=function(_0x257b83){return setupLoggers(_0x257b83)[_0x0cf3('0x7')](function(){_0x257b83[_0x0cf3('0x8')]('/api/users',require(_0x0cf3('0x9')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xa'),require(_0x0cf3('0xb')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xc'),require(_0x0cf3('0xd')));_0x257b83['use'](_0x0cf3('0xe'),require('./api/voiceExtension'));_0x257b83[_0x0cf3('0x8')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xf'),require(_0x0cf3('0x10')));_0x257b83[_0x0cf3('0x8')]('/api/voice/recordings',require(_0x0cf3('0x11')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x12'),require(_0x0cf3('0x13')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x14'),require('./api/voiceMail'));_0x257b83['use'](_0x0cf3('0x15'),require(_0x0cf3('0x16')));_0x257b83[_0x0cf3('0x8')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x257b83['use'](_0x0cf3('0x17'),require(_0x0cf3('0x18')));_0x257b83[_0x0cf3('0x8')]('/api/voice/agents/reports',require(_0x0cf3('0x19')));_0x257b83[_0x0cf3('0x8')]('/api/voice/queues/reports',require(_0x0cf3('0x1a')));_0x257b83[_0x0cf3('0x8')]('/api/members/reports',require(_0x0cf3('0x1b')));_0x257b83['use'](_0x0cf3('0x1c'),require(_0x0cf3('0x1d')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x1e'),require(_0x0cf3('0x1f')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x20'),require(_0x0cf3('0x21')));_0x257b83['use'](_0x0cf3('0x22'),require(_0x0cf3('0x23')));_0x257b83[_0x0cf3('0x8')]('/api/mail/queues',require('./api/mailQueue'));_0x257b83['use'](_0x0cf3('0x24'),require('./api/mailSubstatus'));_0x257b83[_0x0cf3('0x8')]('/api/mail/interactions',require(_0x0cf3('0x25')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x26'),require(_0x0cf3('0x27')));_0x257b83[_0x0cf3('0x8')]('/api/mail/applications',require(_0x0cf3('0x28')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x29'),require(_0x0cf3('0x2a')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x2b'),require(_0x0cf3('0x2c')));_0x257b83['use'](_0x0cf3('0x2d'),require(_0x0cf3('0x2e')));_0x257b83['use'](_0x0cf3('0x2f'),require(_0x0cf3('0x30')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x31'),require(_0x0cf3('0x32')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x33'),require(_0x0cf3('0x34')));_0x257b83['use'](_0x0cf3('0x35'),require(_0x0cf3('0x36')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x37'),require(_0x0cf3('0x38')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x39'),require(_0x0cf3('0x3a')));_0x257b83[_0x0cf3('0x8')]('/api/sms/accounts',require('./api/smsAccount'));_0x257b83[_0x0cf3('0x8')]('/api/sms/applications',require(_0x0cf3('0x3b')));_0x257b83[_0x0cf3('0x8')]('/api/sms/interactions',require('./api/smsInteraction'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x3c'),require('./api/smsMessage'));_0x257b83['use']('/api/sms/queues',require('./api/smsQueue'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x3d'),require(_0x0cf3('0x3e')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x3f'),require(_0x0cf3('0x40')));_0x257b83['use']('/api/openchannel/interactions',require(_0x0cf3('0x41')));_0x257b83['use'](_0x0cf3('0x42'),require('./api/openchannelMessage'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x43'),require('./api/openchannelQueue'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x44'),require(_0x0cf3('0x45')));_0x257b83['use']('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x257b83['use']('/api/chat/applications',require(_0x0cf3('0x46')));_0x257b83['use'](_0x0cf3('0x47'),require(_0x0cf3('0x48')));_0x257b83['use'](_0x0cf3('0x49'),require(_0x0cf3('0x4a')));_0x257b83['use'](_0x0cf3('0x4b'),require(_0x0cf3('0x4c')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x4d'),require(_0x0cf3('0x4e')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x4f'),require(_0x0cf3('0x50')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x51'),require(_0x0cf3('0x52')));_0x257b83['use'](_0x0cf3('0x53'),require('./api/cmCompany'));_0x257b83['use'](_0x0cf3('0x54'),require(_0x0cf3('0x55')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x56'),require(_0x0cf3('0x57')));_0x257b83['use'](_0x0cf3('0x58'),require('./api/cmHopperBlack'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x59'),require('./api/cmHopperFinal'));_0x257b83['use'](_0x0cf3('0x5a'),require(_0x0cf3('0x5b')));_0x257b83['use'](_0x0cf3('0x5c'),require(_0x0cf3('0x5d')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x5e'),require(_0x0cf3('0x5f')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x60'),require(_0x0cf3('0x61')));_0x257b83['use']('/api/canned_answers',require(_0x0cf3('0x62')));_0x257b83[_0x0cf3('0x8')]('/api/dispositions',require(_0x0cf3('0x63')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x64'),require(_0x0cf3('0x65')));_0x257b83['use']('/api/intervals',require('./api/interval'));_0x257b83[_0x0cf3('0x8')]('/api/pauses',require(_0x0cf3('0x66')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x67'),require(_0x0cf3('0x68')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x69'),require(_0x0cf3('0x6a')));_0x257b83['use'](_0x0cf3('0x6b'),require(_0x0cf3('0x6c')));_0x257b83['use'](_0x0cf3('0x6d'),require(_0x0cf3('0x6e')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x6f'),require('./api/tag'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x70'),require(_0x0cf3('0x71')));_0x257b83['use'](_0x0cf3('0x72'),require('./api/cmContactHasItem'));_0x257b83['use'](_0x0cf3('0x73'),require('./api/cmHopperAdditionalPhone'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x74'),require(_0x0cf3('0x75')));_0x257b83['use'](_0x0cf3('0x76'),require(_0x0cf3('0x77')));_0x257b83['use']('/api/variables',require(_0x0cf3('0x78')));_0x257b83[_0x0cf3('0x8')]('/api/integrations',require(_0x0cf3('0x79')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x7a'),require(_0x0cf3('0x7b')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x7c'),require(_0x0cf3('0x7d')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x7e'),require(_0x0cf3('0x7f')));_0x257b83['use'](_0x0cf3('0x80'),require(_0x0cf3('0x81')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x82'),require('./api/analyticMetric'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x83'),require(_0x0cf3('0x84')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x85'),require(_0x0cf3('0x86')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x87'),require(_0x0cf3('0x88')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x89'),require('./api/intSalesforceConfiguration'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x8a'),require(_0x0cf3('0x8b')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x8c'),require(_0x0cf3('0x8d')));_0x257b83['use'](_0x0cf3('0x8e'),require(_0x0cf3('0x8f')));_0x257b83['use']('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x90'),require(_0x0cf3('0x91')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x92'),require('./api/intDeskConfiguration'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x93'),require(_0x0cf3('0x94')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x95'),require(_0x0cf3('0x96')));_0x257b83[_0x0cf3('0x8')]('/api/integrations/zoho/configurations',require(_0x0cf3('0x97')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x98'),require('./api/intZohoField'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x99'),require(_0x0cf3('0x9a')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x9b'),require(_0x0cf3('0x9c')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x9d'),require(_0x0cf3('0x9e')));_0x257b83[_0x0cf3('0x8')]('/api/integrations/freshdesk/accounts',require(_0x0cf3('0x9f')));_0x257b83[_0x0cf3('0x8')]('/api/integrations/freshdesk/configurations',require(_0x0cf3('0xa0')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xa1'),require(_0x0cf3('0xa2')));_0x257b83['use'](_0x0cf3('0xa3'),require('./api/intVtigerAccount'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xa4'),require('./api/intVtigerConfiguration'));_0x257b83['use'](_0x0cf3('0xa5'),require('./api/intVtigerField'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xa6'),require(_0x0cf3('0xa7')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xa8'),require('./api/intServicenowConfiguration'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xa9'),require(_0x0cf3('0xaa')));_0x257b83['use']('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x257b83[_0x0cf3('0x8')]('/api/integrations/dynamics365/configurations',require(_0x0cf3('0xab')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xac'),require(_0x0cf3('0xad')));_0x257b83[_0x0cf3('0x8')]('/api/integrations/freshsales/accounts',require(_0x0cf3('0xae')));_0x257b83[_0x0cf3('0x8')]('/api/integrations/freshsales/configurations',require(_0x0cf3('0xaf')));_0x257b83[_0x0cf3('0x8')]('/api/integrations/freshsales/fields',require(_0x0cf3('0xb0')));_0x257b83['use'](_0x0cf3('0xb1'),require(_0x0cf3('0xb2')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xb3'),require(_0x0cf3('0xb4')));_0x257b83['use']('/api/chat/internal/messages',require(_0x0cf3('0xb5')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xb6'),require('./api/jscriptyAnswerReport'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xb7'),require(_0x0cf3('0xb8')));_0x257b83['use'](_0x0cf3('0xb9'),require(_0x0cf3('0xba')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xbb'),require('./api/smsQueueReport'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xbc'),require(_0x0cf3('0xbd')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xbe'),require(_0x0cf3('0xbf')));_0x257b83['use'](_0x0cf3('0xc0'),require('./api/jscriptyProject'));_0x257b83[_0x0cf3('0x8')]('/api/settings',require('./api/setting'));_0x257b83['use'](_0x0cf3('0xc1'),require('./api/squareOdbc'));_0x257b83['use'](_0x0cf3('0xc2'),require(_0x0cf3('0xc3')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xc4'),require('./api/squareRecording'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xc5'),require('./api/squareMessage'));_0x257b83[_0x0cf3('0x8')]('/api/teams',require('./api/team'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xc6'),require(_0x0cf3('0xc7')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xc8'),require('./api/campaign'));_0x257b83[_0x0cf3('0x8')]('/api/migrations',require(_0x0cf3('0xc9')));_0x257b83['use'](_0x0cf3('0xca'),require('./api/attachment'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xcb'),require(_0x0cf3('0xcc')));_0x257b83['use'](_0x0cf3('0xcd'),require(_0x0cf3('0xce')));_0x257b83[_0x0cf3('0x8')]('/api/chat/reports/transfer',require(_0x0cf3('0xcf')));_0x257b83['use']('/api/fax/reports/transfer',require(_0x0cf3('0xd0')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xd1'),require(_0x0cf3('0xd2')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xd3'),require('./api/smsTransferReport'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xd4'),require('./api/cmList'));_0x257b83[_0x0cf3('0x8')]('/api/voice/prefixes',require(_0x0cf3('0xd5')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xd6'),require('./api/userProfile'));_0x257b83['use']('/api/userProfile/sections',require(_0x0cf3('0xd7')));_0x257b83[_0x0cf3('0x8')]('/api/userProfile/resources',require(_0x0cf3('0xd8')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xd9'),require('./api/userNotification'));_0x257b83['use']('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xda'),require(_0x0cf3('0xdb')));_0x257b83['use']('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x257b83[_0x0cf3('0x8')]('/api/whatsapp/messages',require(_0x0cf3('0xdc')));_0x257b83[_0x0cf3('0x8')]('/api/whatsapp/reports/queue',require(_0x0cf3('0xdd')));_0x257b83[_0x0cf3('0x8')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xde'),require(_0x0cf3('0xdf')));_0x257b83['use'](_0x0cf3('0xe0'),require(_0x0cf3('0xe1')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xe2'),require(_0x0cf3('0xe3')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xe4'),require(_0x0cf3('0xe5')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xe6'),require('./api/mailInteractionHasTag'));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xe7'),require(_0x0cf3('0xe8')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xe9'),require(_0x0cf3('0xea')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xeb'),require(_0x0cf3('0xec')));_0x257b83['use'](_0x0cf3('0xed'),require(_0x0cf3('0xee')));_0x257b83['use']('/api/rpc',require('./api/rpc'));_0x257b83['use'](_0x0cf3('0xef'),require(_0x0cf3('0xf0')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xf1'),require(_0x0cf3('0xf2')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xf3'),require(_0x0cf3('0xf4')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xf5'),require(_0x0cf3('0xf6')));_0x257b83['use'](_0x0cf3('0xf7'),clientSideLogs);_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xf8'),express['static'](path[_0x0cf3('0xf9')](config[_0x0cf3('0xfa')],'/apidoc')));_0x257b83[_0x0cf3('0x8')]('/www',express['static'](path[_0x0cf3('0xf9')](config[_0x0cf3('0xfa')],_0x0cf3('0xfb'))));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0xfc'),express[_0x0cf3('0xfd')](path[_0x0cf3('0xf9')](config[_0x0cf3('0xfa')],_0x0cf3('0xfc'))));_0x257b83['use'](_0x0cf3('0xfe'),express['static'](path[_0x0cf3('0xf9')](config[_0x0cf3('0xfa')],_0x0cf3('0xff'),'3.9.0')));_0x257b83[_0x0cf3('0x8')](_0x0cf3('0x100'),express['static'](path[_0x0cf3('0xf9')](config[_0x0cf3('0xfa')],'/server/files/plugins')));_0x257b83[_0x0cf3('0x101')]('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x257b83[_0x0cf3('0x101')]('/*')[_0x0cf3('0x102')](function(_0x5581ff,_0x4e19e7){_0x4e19e7[_0x0cf3('0x103')](path[_0x0cf3('0x104')](_0x257b83[_0x0cf3('0x102')]('appPath')+'/index.html'));});return _0x257b83;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index b481159..359e722 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6615=['merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','RPC\x20listening\x20on\x20','jayson/promise','lodash','listen'];(function(_0x2adcfc,_0x27b73f){var _0x16518a=function(_0x2e746b){while(--_0x2e746b){_0x2adcfc['push'](_0x2adcfc['shift']());}};_0x16518a(++_0x27b73f);}(_0x6615,0x8f));var _0x5661=function(_0x4e7fbe,_0x585460){_0x4e7fbe=_0x4e7fbe-0x0;var _0x2e2277=_0x6615[_0x4e7fbe];return _0x2e2277;};'use strict';var jayson=require(_0x5661('0x0'));var _=require(_0x5661('0x1'));var config=require('../config/environment');exports[_0x5661('0x2')]=function(){return new Promise(function(_0x3219da,_0x6c7134){var _0x418ca9={};_0x418ca9=_['merge'](_0x418ca9,require('../api/user/user.rpc'));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x4')));_0x418ca9=_['merge'](_0x418ca9,require(_0x5661('0x5')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x6')));_0x418ca9=_['merge'](_0x418ca9,require(_0x5661('0x7')));_0x418ca9=_['merge'](_0x418ca9,require(_0x5661('0x8')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x9')));_0x418ca9=_['merge'](_0x418ca9,require(_0x5661('0xa')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require('../api/memberReport/memberReport.rpc'));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0xb')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0xc')));_0x418ca9=_['merge'](_0x418ca9,require(_0x5661('0xd')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0xe')));_0x418ca9=_['merge'](_0x418ca9,require(_0x5661('0xf')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x10')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x11')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require('../api/mailMessage/mailMessage.rpc'));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x12')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x13')));_0x418ca9=_['merge'](_0x418ca9,require(_0x5661('0x14')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x15')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require('../api/faxInteraction/faxInteraction.rpc'));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x16')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x17')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x418ca9=_['merge'](_0x418ca9,require(_0x5661('0x18')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require('../api/smsInteraction/smsInteraction.rpc'));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require('../api/smsMessage/smsMessage.rpc'));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require('../api/smsQueue/smsQueue.rpc'));_0x418ca9=_['merge'](_0x418ca9,require(_0x5661('0x19')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x1a')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x1b')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x1c')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x1d')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require('../api/chatInteraction/chatInteraction.rpc'));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x1e')));_0x418ca9=_['merge'](_0x418ca9,require('../api/chatQueue/chatQueue.rpc'));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x1f')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x20')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x21')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x22')));_0x418ca9=_['merge'](_0x418ca9,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x23')));_0x418ca9=_['merge'](_0x418ca9,require('../api/interval/interval.rpc'));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x24')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x25')));_0x418ca9=_['merge'](_0x418ca9,require(_0x5661('0x26')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x27')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x28')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x29')));_0x418ca9=_['merge'](_0x418ca9,require(_0x5661('0x2a')));_0x418ca9=_['merge'](_0x418ca9,require(_0x5661('0x2b')));_0x418ca9=_['merge'](_0x418ca9,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x2c')));_0x418ca9=_['merge'](_0x418ca9,require(_0x5661('0x2d')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x2e')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x2f')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x30')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x31')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x32')));_0x418ca9=_['merge'](_0x418ca9,require(_0x5661('0x33')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x34')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x35')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x36')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x37')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x38')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x39')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x3a')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x3b')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require('../api/attachment/attachment.rpc'));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x3c')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x3d')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x3e')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x3f')));_0x418ca9=_[_0x5661('0x3')](_0x418ca9,require(_0x5661('0x40')));var _0x885735=jayson[_0x5661('0x41')](_0x418ca9)[_0x5661('0x42')]();var _0x21233e=config[_0x5661('0x43')][_0x5661('0x44')]||config['port']+0x1;var _0x87cab=config[_0x5661('0x43')]['ip']||_0x5661('0x45');_0x885735['on'](_0x5661('0x46'),function(_0x25bdbe){return _0x6c7134(_0x25bdbe);});_0x885735['listen'](_0x21233e,_0x87cab,function(){console[_0x5661('0x47')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x87cab,_0x21233e);require('../config/triggers')['default']();return _0x3219da(_0x5661('0x48')+_0x87cab+':'+_0x21233e);});});}; \ No newline at end of file +var _0xc77b=['../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','server','http','rpc','port','localhost','error','log','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc'];(function(_0x180db5,_0x35cce8){var _0x8b6252=function(_0x25b5da){while(--_0x25b5da){_0x180db5['push'](_0x180db5['shift']());}};_0x8b6252(++_0x35cce8);}(_0xc77b,0x187));var _0xbc77=function(_0x5076f2,_0x5947d1){_0x5076f2=_0x5076f2-0x0;var _0x58d5f8=_0xc77b[_0x5076f2];return _0x58d5f8;};'use strict';var jayson=require(_0xbc77('0x0'));var _=require(_0xbc77('0x1'));var config=require(_0xbc77('0x2'));exports['listen']=function(){return new Promise(function(_0x65b0af,_0x185649){var _0x1e388a={};_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x4')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x5')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x6')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x7')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x8')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x9')));_0x1e388a=_['merge'](_0x1e388a,require(_0xbc77('0xa')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0xb')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0xc')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0xd')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0xe')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0xf')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x10')));_0x1e388a=_['merge'](_0x1e388a,require('../api/mailQueue/mailQueue.rpc'));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require('../api/mailInteraction/mailInteraction.rpc'));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require('../api/mailMessage/mailMessage.rpc'));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require('../api/mailApplication/mailApplication.rpc'));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x11')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x12')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x13')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x14')));_0x1e388a=_['merge'](_0x1e388a,require(_0xbc77('0x15')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x16')));_0x1e388a=_['merge'](_0x1e388a,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x1e388a=_['merge'](_0x1e388a,require(_0xbc77('0x17')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require('../api/smsInteraction/smsInteraction.rpc'));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x18')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x19')));_0x1e388a=_['merge'](_0x1e388a,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x1e388a=_['merge'](_0x1e388a,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x1e388a=_['merge'](_0x1e388a,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x1a')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x1b')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x1c')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x1d')));_0x1e388a=_['merge'](_0x1e388a,require(_0xbc77('0x1e')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x1f')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x20')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x21')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x22')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x23')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x24')));_0x1e388a=_['merge'](_0x1e388a,require(_0xbc77('0x25')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require('../api/pause/pause.rpc'));_0x1e388a=_['merge'](_0x1e388a,require(_0xbc77('0x26')));_0x1e388a=_['merge'](_0x1e388a,require(_0xbc77('0x27')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require('../api/template/template.rpc'));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x28')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x29')));_0x1e388a=_['merge'](_0x1e388a,require(_0xbc77('0x2a')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x1e388a=_['merge'](_0x1e388a,require(_0xbc77('0x2b')));_0x1e388a=_['merge'](_0x1e388a,require(_0xbc77('0x2c')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x2d')));_0x1e388a=_['merge'](_0x1e388a,require(_0xbc77('0x2e')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x2f')));_0x1e388a=_['merge'](_0x1e388a,require(_0xbc77('0x30')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x31')));_0x1e388a=_['merge'](_0x1e388a,require(_0xbc77('0x32')));_0x1e388a=_['merge'](_0x1e388a,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x33')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x34')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x35')));_0x1e388a=_['merge'](_0x1e388a,require(_0xbc77('0x36')));_0x1e388a=_['merge'](_0x1e388a,require('../api/squareOdbc/squareOdbc.rpc'));_0x1e388a=_['merge'](_0x1e388a,require('../api/squareProject/squareProject.rpc'));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require('../api/squareRecording/squareRecording.rpc'));_0x1e388a=_['merge'](_0x1e388a,require(_0xbc77('0x37')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x38')));_0x1e388a=_['merge'](_0x1e388a,require('../api/attachment/attachment.rpc'));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x39')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x3a')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x3b')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require(_0xbc77('0x3c')));_0x1e388a=_[_0xbc77('0x3')](_0x1e388a,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x1e388a=_['merge'](_0x1e388a,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x218611=jayson[_0xbc77('0x3d')](_0x1e388a)[_0xbc77('0x3e')]();var _0x4b90e2=config[_0xbc77('0x3f')][_0xbc77('0x40')]||config[_0xbc77('0x40')]+0x1;var _0x7e1026=config[_0xbc77('0x3f')]['ip']||_0xbc77('0x41');_0x218611['on'](_0xbc77('0x42'),function(_0x1bf367){return _0x185649(_0x1bf367);});_0x218611['listen'](_0x4b90e2,_0x7e1026,function(){console[_0xbc77('0x43')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x7e1026,_0x4b90e2);require('../config/triggers')[_0xbc77('0x44')]();return _0x65b0af(_0xbc77('0x45')+_0x7e1026+':'+_0x4b90e2);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index c6e90ec..7a7ad5a 100644 --- a/server/services/agi/channel.js +++ b/server/services/agi/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc23e=['VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','exec','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','lodash','events','EventEmitter','./reply','./error','call','utf8','setTimeout','headers','emit','ready','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','replace','indexOf','substr','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','inherits','prototype','answer','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xc23e,0x68));var _0xec23=function(_0x49b940,_0x102cc8){_0x49b940=_0x49b940-0x0;var _0x50f8d6=_0xc23e[_0x49b940];return _0x50f8d6;};'use strict';var util=require('util');var _=require(_0xec23('0x0'));var EventEmitter=require(_0xec23('0x1'))[_0xec23('0x2')];var AGIReply=require(_0xec23('0x3'));var AGIError=require(_0xec23('0x4'));function AGIChannel(_0x3107d4){var _0x5a0fe9=this,_0xde0e4f=new AGIReply(),_0x24003f=![],_0x4ac569={};EventEmitter[_0xec23('0x5')](_0x5a0fe9);_0x3107d4['setEncoding'](_0xec23('0x6'));_0x3107d4[_0xec23('0x7')](0x8*0x3c*0x3c*0x3e8);_0xde0e4f['setEncoding']('utf8');_0xde0e4f['on'](_0xec23('0x8'),function(_0x30ca38){for(var _0x116387 in _0x30ca38){_0x5a0fe9[_0x116387]=_0x30ca38[_0x116387];}_0x5a0fe9[_0xec23('0x9')](_0xec23('0xa'));});_0xde0e4f['on']('line',function(_0x2c820c){if(_0x2c820c[_0xec23('0xb')]()==_0xec23('0xc')){_0x5a0fe9[_0xec23('0x9')](_0xec23('0xc'));return;}if(_0x2c820c['substring'](0x0,0xb)==_0xec23('0xd')){_0x24003f=!![];}if(_0x24003f){_0x4ac569['rx']+=_0x2c820c+'\x0a';if(_0x2c820c[_0xec23('0xe')](_0xec23('0xf'))!=-0x1){_0x24003f=![];}}else{_0x4ac569['rx']=_0x2c820c;}if(_0x24003f){return;}if(typeof _0x4ac569['cb']==_0xec23('0x10')){var _0x34829a=_0x4ac569['rx'][_0xec23('0x11')](0x0,0x3),_0x15ac06=null,_0x579a30=null;_0x34829a=parseInt(_0x34829a);if(isNaN(_0x34829a)){_0x4ac569['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x34829a!=0xc8){_0x4ac569['cb'](null,{'code':_0x34829a,'result':-0x1,'extra':'KO'});return;}_0x15ac06=_0x4ac569['rx'][_0xec23('0x11')](0x4)[_0xec23('0x12')]('result=','');if(_0x15ac06[_0xec23('0x13')]('\x20')!=-0x1){_0x15ac06=_0x15ac06[_0xec23('0x14')](0x0,_0x15ac06[_0xec23('0x13')]('\x20'));}if(_[_0xec23('0x15')](_0x15ac06,'-1')){_0x15ac06=parseInt(_0x15ac06);}_0x579a30=_0x4ac569['rx'][_0xec23('0x16')]('\x20');if(_0x579a30[_0xec23('0x17')]==0x3){_0x579a30=_0x579a30[0x2][_0xec23('0x11')](0x1,_0x579a30[0x2][_0xec23('0x17')]-0x1);}else if(_0x579a30[_0xec23('0x17')]>0x3){var _0x558b23=/\((.+)\)/;var _0x2c34f6=_0x4ac569['rx'][_0xec23('0x18')](_0x558b23);if(_0x2c34f6){_0x579a30=_0x2c34f6[0x1];}else{_0x579a30=null;}}else{_0x579a30=null;}_0x4ac569['cb'](null,{'code':_0x34829a,'result':_0x15ac06,'extra':_0x579a30});}});_0x3107d4['on'](_0xec23('0x19'),function(_0x5dface){_0x5a0fe9[_0xec23('0x9')]('error',new AGIError('E_AGI_SOCKET_ERROR',_0x5dface[_0xec23('0x1a')]));});_0x3107d4['on'](_0xec23('0x1b'),function(){_0x5a0fe9[_0xec23('0x9')](_0xec23('0x1b'),new AGIError(_0xec23('0x1c')));});_0x3107d4['on'](_0xec23('0x1d'),function(){_0x5a0fe9[_0xec23('0x9')](_0xec23('0x1d'),new AGIError(_0xec23('0x1e')));_0x3107d4[_0xec23('0x1f')]();});_0x3107d4[_0xec23('0x20')](_0xde0e4f);this[_0xec23('0x21')]=function(_0x5d8af7,_0x4c11fb){var _0x5d8af7=_0x5d8af7||'',_0x4c11fb=typeof _0x4c11fb=='function'?_0x4c11fb:new Function();_0x4ac569={'tx':_0x5d8af7,'rx':'','cb':_0x4c11fb};_0x3107d4['write'](_0x5d8af7+'\x0a');},this[_0xec23('0x1b')]=function(){_0x3107d4[_0xec23('0x1f')]();};}util[_0xec23('0x22')](AGIChannel,EventEmitter);AGIChannel[_0xec23('0x23')]['sendRequest']=function(_0x3c8272){return this['command']['sync'](this,_0x3c8272);};AGIChannel[_0xec23('0x23')][_0xec23('0x24')]=function(){return this[_0xec23('0x25')](_0xec23('0x26'));};AGIChannel[_0xec23('0x23')][_0xec23('0x27')]=function(_0x253574,_0x18aa61,_0x35d8c1){_0x253574=_0x253574===undefined?_0xec23('0x28'):_0x253574;_0x18aa61=_0x18aa61===undefined?'5':_0x18aa61;_0x35d8c1=_0x35d8c1===undefined?'1':_0x35d8c1;return this[_0xec23('0x25')](util[_0xec23('0x29')](_0xec23('0x2a'),_0x253574,_0x18aa61*0x3e8,_0x35d8c1));};AGIChannel[_0xec23('0x23')][_0xec23('0x2b')]=function(_0x365a52){_0x365a52=_0x365a52||'NO\x20MESSAGE';return this[_0xec23('0x25')](util[_0xec23('0x29')](_0xec23('0x2c'),_0x365a52));};AGIChannel[_0xec23('0x23')]['exec']=function(_0x9a4069,_0x855cf9){if(_[_0xec23('0x2d')](_0x855cf9)){return this[_0xec23('0x25')](util[_0xec23('0x29')](_0xec23('0x2e'),_0x9a4069,_0x855cf9[_0xec23('0x2f')](',')));}return this['sendRequest'](util['format'](_0xec23('0x2e'),_0x9a4069,_0x855cf9));};AGIChannel[_0xec23('0x23')]['setContext']=function(_0x38b4ad){return this[_0xec23('0x25')](util[_0xec23('0x29')]('SET\x20CONTEXT\x20%s',_0x38b4ad));};AGIChannel[_0xec23('0x23')]['setExtension']=function(_0x5503e0){return this[_0xec23('0x25')](util[_0xec23('0x29')](_0xec23('0x30'),_0x5503e0));};AGIChannel[_0xec23('0x23')][_0xec23('0x31')]=function(_0x5caa29){return this[_0xec23('0x25')](util[_0xec23('0x29')](_0xec23('0x32'),_0x5caa29));};AGIChannel[_0xec23('0x23')][_0xec23('0xc')]=function(){return this[_0xec23('0x25')]('HANGUP');};AGIChannel[_0xec23('0x23')]['setVariable']=function(_0x5446c7,_0xba3be9){var _0x4ac733=_[_0xec23('0x33')](_0xba3be9)||_['isNumber'](_0xba3be9)?_0xba3be9[_0xec23('0x34')]():_0xba3be9;return this['sendRequest'](util[_0xec23('0x29')](_0xec23('0x35'),_0x5446c7,_0x4ac733?_0x4ac733[_0xec23('0x34')]()[_0xec23('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xec23('0x36')]=function(_0x32e927,_0x29fba9){return this[_0xec23('0x25')](util[_0xec23('0x29')](_0xec23('0x37'),_0x32e927,_0x29fba9));};AGIChannel['prototype'][_0xec23('0x38')]=function(_0x5112ff,_0x2136c2){return this[_0xec23('0x25')](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x5112ff,_0x2136c2));};AGIChannel[_0xec23('0x23')]['sayPhonetic']=function(_0x10395c,_0x1b85a2){return this[_0xec23('0x25')](util[_0xec23('0x29')](_0xec23('0x39'),_0x10395c,_0x1b85a2));};AGIChannel[_0xec23('0x23')][_0xec23('0x3a')]=function(_0xbcd358,_0x411db7,_0x4392c4){_0x411db7=_0x411db7||this[_0xec23('0x3b')];_0x4392c4=_0x4392c4||0x1;this[_0xec23('0x3c')](_0xbcd358);this['setExtension'](_0x411db7);this[_0xec23('0x31')](_0x4392c4);return this[_0xec23('0x2b')](util[_0xec23('0x29')](_0xec23('0x3d'),_0xbcd358,_0x411db7,_0x4392c4));};AGIChannel[_0xec23('0x23')][_0xec23('0x3e')]=function(_0x21994d){return this[_0xec23('0x25')](util[_0xec23('0x29')](_0xec23('0x3f'),_0x21994d));};AGIChannel[_0xec23('0x23')]['recordFile']=function(_0x394315,_0xdaef76,_0x5cfefb,_0x3c214c,_0x2aeba5,_0xdde5e2){_0xdaef76=_0xdaef76||_0xec23('0x40');_0x5cfefb=_0x5cfefb||'';_0x3c214c=_0x3c214c===undefined?-0x1:_0x3c214c==='-1'?-0x1:_0x3c214c*0x3e8;_0x2aeba5=_0x2aeba5===undefined?'':'s='+_0x2aeba5;_0xdde5e2=_0xdde5e2?_0xec23('0x41'):'';return this[_0xec23('0x25')](util[_0xec23('0x29')](_0xec23('0x42'),_0x394315,_0xdaef76,_0x5cfefb,_0x3c214c,_0xdde5e2,_0x2aeba5));};AGIChannel['prototype'][_0xec23('0x43')]=function(_0x464cc0,_0x378a2d){_0x378a2d=_0x378a2d||'';return this['sendRequest'](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x464cc0,_0x378a2d));};AGIChannel[_0xec23('0x23')][_0xec23('0x44')]=function(_0x207243){return this[_0xec23('0x45')]('AGI',_0x207243);};AGIChannel[_0xec23('0x23')][_0xec23('0x46')]=function(_0x41560b){return this[_0xec23('0x45')](_0xec23('0x47'),_0x41560b);};AGIChannel[_0xec23('0x23')][_0xec23('0x19')]=function(_0x44ab3f,_0x282849){this[_0xec23('0x2b')](util[_0xec23('0x29')](_0xec23('0x48'),_0x44ab3f['id'],_0x44ab3f[_0xec23('0x49')],_0x282849));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0x342e=['answer','ANSWER','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','isNumber','toString','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setPriority','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','lodash','events','./reply','./error','call','setEncoding','utf8','setTimeout','emit','ready','line','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','result=','indexOf','substr','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','timeout','destroy','pipe','command','write','inherits','sendRequest','sync','prototype'];(function(_0xea35d1,_0x302471){var _0x1d7a7c=function(_0x1bc101){while(--_0x1bc101){_0xea35d1['push'](_0xea35d1['shift']());}};_0x1d7a7c(++_0x302471);}(_0x342e,0x19e));var _0xe342=function(_0x2dc343,_0xf015a2){_0x2dc343=_0x2dc343-0x0;var _0x51eac5=_0x342e[_0x2dc343];return _0x51eac5;};'use strict';var util=require('util');var _=require(_0xe342('0x0'));var EventEmitter=require(_0xe342('0x1'))['EventEmitter'];var AGIReply=require(_0xe342('0x2'));var AGIError=require(_0xe342('0x3'));function AGIChannel(_0xfe51e5){var _0x326df2=this,_0x30dc1f=new AGIReply(),_0x28e5bb=![],_0x295a74={};EventEmitter[_0xe342('0x4')](_0x326df2);_0xfe51e5[_0xe342('0x5')](_0xe342('0x6'));_0xfe51e5[_0xe342('0x7')](0x8*0x3c*0x3c*0x3e8);_0x30dc1f[_0xe342('0x5')](_0xe342('0x6'));_0x30dc1f['on']('headers',function(_0x51fc15){for(var _0x4a30dc in _0x51fc15){_0x326df2[_0x4a30dc]=_0x51fc15[_0x4a30dc];}_0x326df2[_0xe342('0x8')](_0xe342('0x9'));});_0x30dc1f['on'](_0xe342('0xa'),function(_0x314bc9){if(_0x314bc9[_0xe342('0xb')]()==_0xe342('0xc')){_0x326df2[_0xe342('0x8')]('hangup');return;}if(_0x314bc9[_0xe342('0xd')](0x0,0xb)=='520-Invalid'){_0x28e5bb=!![];}if(_0x28e5bb){_0x295a74['rx']+=_0x314bc9+'\x0a';if(_0x314bc9[_0xe342('0xe')](_0xe342('0xf'))!=-0x1){_0x28e5bb=![];}}else{_0x295a74['rx']=_0x314bc9;}if(_0x28e5bb){return;}if(typeof _0x295a74['cb']==_0xe342('0x10')){var _0x4aa167=_0x295a74['rx'][_0xe342('0xd')](0x0,0x3),_0xe81bc6=null,_0x1f9483=null;_0x4aa167=parseInt(_0x4aa167);if(isNaN(_0x4aa167)){_0x295a74['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x4aa167!=0xc8){_0x295a74['cb'](null,{'code':_0x4aa167,'result':-0x1,'extra':'KO'});return;}_0xe81bc6=_0x295a74['rx'][_0xe342('0xd')](0x4)['replace'](_0xe342('0x11'),'');if(_0xe81bc6[_0xe342('0x12')]('\x20')!=-0x1){_0xe81bc6=_0xe81bc6[_0xe342('0x13')](0x0,_0xe81bc6[_0xe342('0x12')]('\x20'));}if(_[_0xe342('0x14')](_0xe81bc6,'-1')){_0xe81bc6=parseInt(_0xe81bc6);}_0x1f9483=_0x295a74['rx'][_0xe342('0x15')]('\x20');if(_0x1f9483['length']==0x3){_0x1f9483=_0x1f9483[0x2][_0xe342('0xd')](0x1,_0x1f9483[0x2][_0xe342('0x16')]-0x1);}else if(_0x1f9483[_0xe342('0x16')]>0x3){var _0x5ce40c=/\((.+)\)/;var _0x5e954b=_0x295a74['rx']['match'](_0x5ce40c);if(_0x5e954b){_0x1f9483=_0x5e954b[0x1];}else{_0x1f9483=null;}}else{_0x1f9483=null;}_0x295a74['cb'](null,{'code':_0x4aa167,'result':_0xe81bc6,'extra':_0x1f9483});}});_0xfe51e5['on'](_0xe342('0x17'),function(_0x20c3da){_0x326df2[_0xe342('0x8')](_0xe342('0x17'),new AGIError(_0xe342('0x18'),_0x20c3da[_0xe342('0x19')]));});_0xfe51e5['on'](_0xe342('0x1a'),function(){_0x326df2['emit']('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0xfe51e5['on'](_0xe342('0x1b'),function(){_0x326df2[_0xe342('0x8')]('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0xfe51e5[_0xe342('0x1c')]();});_0xfe51e5[_0xe342('0x1d')](_0x30dc1f);this[_0xe342('0x1e')]=function(_0x102bd9,_0xcd66b){var _0x102bd9=_0x102bd9||'',_0xcd66b=typeof _0xcd66b==_0xe342('0x10')?_0xcd66b:new Function();_0x295a74={'tx':_0x102bd9,'rx':'','cb':_0xcd66b};_0xfe51e5[_0xe342('0x1f')](_0x102bd9+'\x0a');},this['close']=function(){_0xfe51e5['destroy']();};}util[_0xe342('0x20')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xe342('0x21')]=function(_0x3e08b7){return this[_0xe342('0x1e')][_0xe342('0x22')](this,_0x3e08b7);};AGIChannel[_0xe342('0x23')][_0xe342('0x24')]=function(){return this[_0xe342('0x21')](_0xe342('0x25'));};AGIChannel[_0xe342('0x23')]['getData']=function(_0x1471e4,_0x6b26bf,_0x18e958){_0x1471e4=_0x1471e4===undefined?'beep':_0x1471e4;_0x6b26bf=_0x6b26bf===undefined?'5':_0x6b26bf;_0x18e958=_0x18e958===undefined?'1':_0x18e958;return this[_0xe342('0x21')](util[_0xe342('0x26')](_0xe342('0x27'),_0x1471e4,_0x6b26bf*0x3e8,_0x18e958));};AGIChannel['prototype'][_0xe342('0x28')]=function(_0x2c5d70){_0x2c5d70=_0x2c5d70||'NO\x20MESSAGE';return this[_0xe342('0x21')](util[_0xe342('0x26')]('VERBOSE\x20\x22%s\x22',_0x2c5d70));};AGIChannel[_0xe342('0x23')][_0xe342('0x29')]=function(_0x41d3b1,_0x444678){if(_[_0xe342('0x2a')](_0x444678)){return this['sendRequest'](util[_0xe342('0x26')](_0xe342('0x2b'),_0x41d3b1,_0x444678[_0xe342('0x2c')](',')));}return this['sendRequest'](util[_0xe342('0x26')](_0xe342('0x2b'),_0x41d3b1,_0x444678));};AGIChannel[_0xe342('0x23')][_0xe342('0x2d')]=function(_0x29eaee){return this[_0xe342('0x21')](util[_0xe342('0x26')](_0xe342('0x2e'),_0x29eaee));};AGIChannel[_0xe342('0x23')][_0xe342('0x2f')]=function(_0x4ee01a){return this[_0xe342('0x21')](util[_0xe342('0x26')](_0xe342('0x30'),_0x4ee01a));};AGIChannel[_0xe342('0x23')]['setPriority']=function(_0x32f87d){return this[_0xe342('0x21')](util['format'](_0xe342('0x31'),_0x32f87d));};AGIChannel[_0xe342('0x23')]['hangup']=function(){return this['sendRequest'](_0xe342('0x32'));};AGIChannel[_0xe342('0x23')]['setVariable']=function(_0x45564a,_0x5ff5aa){var _0x3ae4e9=_['isBoolean'](_0x5ff5aa)||_[_0xe342('0x33')](_0x5ff5aa)?_0x5ff5aa['toString']():_0x5ff5aa;return this[_0xe342('0x21')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x45564a,_0x3ae4e9?_0x3ae4e9[_0xe342('0x34')]()[_0xe342('0x35')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xe342('0x23')][_0xe342('0x36')]=function(_0x1a3eda,_0x52c7b0){return this[_0xe342('0x21')](util[_0xe342('0x26')](_0xe342('0x37'),_0x1a3eda,_0x52c7b0));};AGIChannel['prototype']['sayDigits']=function(_0x3bf76e,_0x2b67a1){return this['sendRequest'](util[_0xe342('0x26')](_0xe342('0x38'),_0x3bf76e,_0x2b67a1));};AGIChannel[_0xe342('0x23')][_0xe342('0x39')]=function(_0x4afa88,_0x43fc59){return this['sendRequest'](util[_0xe342('0x26')](_0xe342('0x3a'),_0x4afa88,_0x43fc59));};AGIChannel[_0xe342('0x23')][_0xe342('0x3b')]=function(_0x34e9f4,_0x48b84c,_0x557e61){_0x48b84c=_0x48b84c||this['extension'];_0x557e61=_0x557e61||0x1;this[_0xe342('0x2d')](_0x34e9f4);this['setExtension'](_0x48b84c);this[_0xe342('0x3c')](_0x557e61);return this[_0xe342('0x28')](util[_0xe342('0x26')](_0xe342('0x3d'),_0x34e9f4,_0x48b84c,_0x557e61));};AGIChannel['prototype']['getVariable']=function(_0x47b382){return this[_0xe342('0x21')](util[_0xe342('0x26')](_0xe342('0x3e'),_0x47b382));};AGIChannel[_0xe342('0x23')][_0xe342('0x3f')]=function(_0x3d0d21,_0x32a046,_0xd4826c,_0x47b70f,_0x3df02c,_0x5d5c1e){_0x32a046=_0x32a046||_0xe342('0x40');_0xd4826c=_0xd4826c||'';_0x47b70f=_0x47b70f===undefined?-0x1:_0x47b70f==='-1'?-0x1:_0x47b70f*0x3e8;_0x3df02c=_0x3df02c===undefined?'':'s='+_0x3df02c;_0x5d5c1e=_0x5d5c1e?_0xe342('0x41'):'';return this[_0xe342('0x21')](util[_0xe342('0x26')](_0xe342('0x42'),_0x3d0d21,_0x32a046,_0xd4826c,_0x47b70f,_0x5d5c1e,_0x3df02c));};AGIChannel[_0xe342('0x23')][_0xe342('0x43')]=function(_0x7e8fd7,_0x3218c4){_0x3218c4=_0x3218c4||'';return this['sendRequest'](util['format'](_0xe342('0x44'),_0x7e8fd7,_0x3218c4));};AGIChannel[_0xe342('0x23')][_0xe342('0x45')]=function(_0x5dea41){return this[_0xe342('0x29')](_0xe342('0x46'),_0x5dea41);};AGIChannel[_0xe342('0x23')][_0xe342('0x47')]=function(_0xcbe1aa){return this[_0xe342('0x29')](_0xe342('0x48'),_0xcbe1aa);};AGIChannel[_0xe342('0x23')]['error']=function(_0x2f509d,_0x18d6ca){this['noop'](util[_0xe342('0x26')](_0xe342('0x49'),_0x2f509d['id'],_0x2f509d[_0xe342('0x4a')],_0x18d6ca));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index eeada93..90bd364 100644 --- a/server/services/agi/error.js +++ b/server/services/agi/error.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46aa=['Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','Socket\x20error.\x20Code:\x20%s.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','util','Undefined\x20error.'];(function(_0xba98f6,_0x4c4de1){var _0x8fb27=function(_0x37c3e5){while(--_0x37c3e5){_0xba98f6['push'](_0xba98f6['shift']());}};_0x8fb27(++_0x4c4de1);}(_0x46aa,0x1be));var _0xa46a=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x46aa[_0x2b9b7f];return _0x4ed19a;};'use strict';var util=require(_0xa46a('0x0'));var error={'E_AGI_UNDEFINED':_0xa46a('0x1'),'E_AGI_ARGUMENT_PORT':_0xa46a('0x2'),'E_AGI_SERVER_ERROR':_0xa46a('0x3'),'E_AGI_SERVER_CLOSE':_0xa46a('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xa46a('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xa46a('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa46a('0x7'),'E_AGI_IVR_ENTRY':_0xa46a('0x8')};function AGIError(_0x4ea277){var _0x4ea277=_0x4ea277||null,_0x22427a=_0x22427a||[],_0x4140b4=0x1,_0x2f13ea='';if(!error[_0x4ea277]){_0x4ea277=_0xa46a('0x9');}_0x22427a[_0xa46a('0xa')](error[_0x4ea277]);while(arguments[_0x4140b4]){_0x22427a[_0xa46a('0xa')](arguments[_0x4140b4]);_0x4140b4++;}_0x2f13ea=util[_0xa46a('0xb')][_0xa46a('0xc')](util,_0x22427a);this[_0xa46a('0xd')]=_0x2f13ea;this['name']=_0x4ea277;}module['exports']=AGIError; \ No newline at end of file +var _0xe501=['format','apply','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push'];(function(_0x539fb2,_0x5b6718){var _0x4d583d=function(_0x55fa69){while(--_0x55fa69){_0x539fb2['push'](_0x539fb2['shift']());}};_0x4d583d(++_0x5b6718);}(_0xe501,0x18b));var _0x1e50=function(_0x2a3f7a,_0x43ebfe){_0x2a3f7a=_0x2a3f7a-0x0;var _0x487795=_0xe501[_0x2a3f7a];return _0x487795;};'use strict';var util=require(_0x1e50('0x0'));var error={'E_AGI_UNDEFINED':_0x1e50('0x1'),'E_AGI_ARGUMENT_PORT':_0x1e50('0x2'),'E_AGI_SERVER_ERROR':_0x1e50('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x1e50('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x1e50('0x5'),'E_AGI_SOCKET_ERROR':_0x1e50('0x6'),'E_AGI_SOCKET_CLOSE':_0x1e50('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x1e50('0x8'),'E_AGI_COMMAND_EMPTY':_0x1e50('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x1e50('0xa'),'E_AGI_IVR_ENTRY':_0x1e50('0xb')};function AGIError(_0x95ce30){var _0x95ce30=_0x95ce30||null,_0x6f015c=_0x6f015c||[],_0x5a1eda=0x1,_0x53776f='';if(!error[_0x95ce30]){_0x95ce30='E_AGI_UNDEFINED';}_0x6f015c[_0x1e50('0xc')](error[_0x95ce30]);while(arguments[_0x5a1eda]){_0x6f015c[_0x1e50('0xc')](arguments[_0x5a1eda]);_0x5a1eda++;}_0x53776f=util[_0x1e50('0xd')][_0x1e50('0xe')](util,_0x6f015c);this[_0x1e50('0xf')]=_0x53776f;this[_0x1e50('0x10')]=_0x95ce30;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 3f5b17c..31c4be9 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1347=['./error','../../config/environment','defaults','redis','localhost','subscribe','emit','error','E_AGI_SERVER_ERROR','message','agi','parse','projectUpdate','exports','lodash','events','EventEmitter','ioredis'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x1347,0xc2));var _0x7134=function(_0x5159fd,_0x4b760b){_0x5159fd=_0x5159fd-0x0;var _0x409bae=_0x1347[_0x5159fd];return _0x409bae;};'use strict';var _=require(_0x7134('0x0'));var EventEmitter=require(_0x7134('0x1'))[_0x7134('0x2')];var Redis=require(_0x7134('0x3'));var AGIError=require(_0x7134('0x4'));var config=require(_0x7134('0x5'));config['redis']=_[_0x7134('0x6')](config[_0x7134('0x7')],{'host':_0x7134('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0x7134('0x9')]('agi',function(_0x335f74){if(_0x335f74)return eventEmitter[_0x7134('0xa')](_0x7134('0xb'),new AGIError(_0x7134('0xc'),_0x335f74));});sub['on'](_0x7134('0xd'),function(_0x23d513,_0x5c6b8f){if(_0x23d513!==_0x7134('0xe'))return;try{var _0x4ad05b=JSON[_0x7134('0xf')](_0x5c6b8f);eventEmitter['emit'](_0x7134('0x10'),_0x4ad05b);}catch(_0x3a6943){eventEmitter[_0x7134('0xa')](_0x7134('0xb'),new AGIError(_0x7134('0xc'),_0x3a6943));}});module[_0x7134('0x11')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xf891=['agi','parse','projectUpdate','exports','lodash','events','EventEmitter','ioredis','../../config/environment','redis','defaults','localhost','emit','error','E_AGI_SERVER_ERROR','message'];(function(_0x1574c5,_0x107f22){var _0x3cf252=function(_0x3547dc){while(--_0x3547dc){_0x1574c5['push'](_0x1574c5['shift']());}};_0x3cf252(++_0x107f22);}(_0xf891,0x1c4));var _0x1f89=function(_0x2121ee,_0x414ccf){_0x2121ee=_0x2121ee-0x0;var _0x34f009=_0xf891[_0x2121ee];return _0x34f009;};'use strict';var _=require(_0x1f89('0x0'));var EventEmitter=require(_0x1f89('0x1'))[_0x1f89('0x2')];var Redis=require(_0x1f89('0x3'));var AGIError=require('./error');var config=require(_0x1f89('0x4'));config[_0x1f89('0x5')]=_[_0x1f89('0x6')](config['redis'],{'host':_0x1f89('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub['subscribe']('agi',function(_0x4ff218){if(_0x4ff218)return eventEmitter[_0x1f89('0x8')](_0x1f89('0x9'),new AGIError(_0x1f89('0xa'),_0x4ff218));});sub['on'](_0x1f89('0xb'),function(_0x3294a0,_0x31ef93){if(_0x3294a0!==_0x1f89('0xc'))return;try{var _0x31840c=JSON[_0x1f89('0xd')](_0x31ef93);eventEmitter[_0x1f89('0x8')](_0x1f89('0xe'),_0x31840c);}catch(_0x1bf83d){eventEmitter['emit'](_0x1f89('0x9'),new AGIError(_0x1f89('0xa'),_0x1bf83d));}});module[_0x1f89('0xf')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 81418e8..06efce5 100644 --- a/server/services/agi/graph/index.js +++ b/server/services/agi/graph/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5767=['../../../config/logger','agi','menu','getsecretdigits','vertices','edges','prototype','addVertex','push','numberOfEdges','size','relations','getVertex','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','agicommand','vswitch','target','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash'];(function(_0x2ca616,_0x384ec8){var _0x53155f=function(_0x108627){while(--_0x108627){_0x2ca616['push'](_0x2ca616['shift']());}};_0x53155f(++_0x384ec8);}(_0x5767,0x77));var _0x7576=function(_0x942383,_0x57200f){_0x942383=_0x942383-0x0;var _0x242fbf=_0x5767[_0x942383];return _0x242fbf;};'use strict';var _=require(_0x7576('0x0'));var logger=require(_0x7576('0x1'))(_0x7576('0x2'));var verticesWithRetry=[_0x7576('0x3'),'getdigits',_0x7576('0x4')];var Graph=function(){this[_0x7576('0x5')]={};this[_0x7576('0x6')]={};this['numberOfEdges']=0x0;};Graph[_0x7576('0x7')][_0x7576('0x8')]=function(_0x59d657){this[_0x7576('0x5')][_0x59d657['id']]=_0x59d657;this[_0x7576('0x6')][_0x59d657['id']]=[];};Graph[_0x7576('0x7')]['addEdge']=function(_0x484765,_0x147bd1,_0x42bfc8){this['edges'][_0x484765][_0x7576('0x9')]({'target':_0x147bd1,'condition':_0x42bfc8});this[_0x7576('0xa')]+=0x1;};Graph[_0x7576('0x7')][_0x7576('0xb')]=function(){return _[_0x7576('0xb')](this['vertices']);};Graph[_0x7576('0x7')][_0x7576('0xc')]=function(){return this[_0x7576('0xa')];};Graph[_0x7576('0x7')][_0x7576('0xd')]=function(_0x30fe3e){return this[_0x7576('0x5')][_0x30fe3e];};Graph['prototype']['traverseBFS']=function(_0x5d48eb,_0x14364b){if(!this[_0x7576('0x5')][_0x5d48eb]){return logger[_0x7576('0xe')](_0x7576('0xf'));}var _0x2e7a57=_0x14364b(this[_0x7576('0x5')][_0x5d48eb]);if(!_0x2e7a57){return logger['info'](_0x7576('0x10'));}if(this[_0x7576('0x6')][_0x5d48eb][_0x7576('0x11')]===0x0){return logger[_0x7576('0xe')](_0x7576('0x12'));}for(var _0x31fdfd=0x0,_0x4a008c=[],_0x55e736=![];_0x31fdfd\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','catch','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','find','handleNotFound','production','handleUnpublished','initialize','then','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','listening','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','./rpc','EventEmitter','defaults'];(function(_0x4070fe,_0x3816fe){var _0x43f95c=function(_0x34f9a0){while(--_0x34f9a0){_0x4070fe['push'](_0x4070fe['shift']());}};_0x43f95c(++_0x3816fe);}(_0x2b99,0x73));var _0x92b9=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x2b99[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x92b9('0x0'));var syncho=require(_0x92b9('0x1'));var util=require(_0x92b9('0x2'));var config=require(_0x92b9('0x3'));var logger=require(_0x92b9('0x4'))(_0x92b9('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0x92b9('0x6'));var Project=require('./project');var AGIEmitter=require('./events')[_0x92b9('0x7')];var projects=[];config['agi']=_[_0x92b9('0x8')](config[_0x92b9('0x5')],{'ip':_0x92b9('0x9'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x10296e){process[_0x92b9('0xa')](function(){syncho(function(){try{setChannelVariables(_0x10296e);agiHandler(_0x10296e);}catch(_0x3f03a1){logger[_0x92b9('0xb')](_0x3f03a1['stack']);}});});}function projectUpdateHandler(_0xcebf84){try{var _0x5c2b63=_[_0x92b9('0xc')](projects,['id',_0xcebf84['id']]);if(_0x5c2b63>-0x1){if(_0xcebf84[_0x92b9('0xd')]===!![]){projects[_0x92b9('0xe')](_0x5c2b63,0x1);}else{projects[_0x5c2b63]=_0xcebf84;}}else{projects[_0x92b9('0xf')](_0xcebf84);}}catch(_0x3a9727){logger[_0x92b9('0xb')](_0x3a9727[_0x92b9('0x10')]);}}function listeningHandler(){console[_0x92b9('0x11')](_0x92b9('0x12'),config[_0x92b9('0x5')][_0x92b9('0x13')]);logger[_0x92b9('0x14')](util[_0x92b9('0x15')](_0x92b9('0x16'),config[_0x92b9('0x5')]['ip'],config[_0x92b9('0x5')][_0x92b9('0x13')]));}function errorHandler(_0x4c354b){if(_0x4c354b&&_0x4c354b[_0x92b9('0x17')]&&_0x4c354b[_0x92b9('0x18')]){logger[_0x92b9('0xb')](util['format'](_0x92b9('0x19'),_0x4c354b[_0x92b9('0x17')],_0x4c354b[_0x92b9('0x18')]));}else{logger[_0x92b9('0xb')](util[_0x92b9('0x15')](_0x92b9('0x1a'),_0x4c354b[_0x92b9('0x10')]));}}function closeHandler(){logger[_0x92b9('0x14')](util['format'](_0x92b9('0x1b'),this[_0x92b9('0x1c')],this['calleridname'],this['callerid'],this[_0x92b9('0x1d')],this[_0x92b9('0x1e')]));try{createSquareReport(this);}catch(_0x5028b0){logger[_0x92b9('0xb')](_0x5028b0[_0x92b9('0x10')]);}}function timeoutHandler(){logger['info'](util[_0x92b9('0x15')](_0x92b9('0x1f'),this[_0x92b9('0x1c')],this[_0x92b9('0x20')],this[_0x92b9('0x21')],this[_0x92b9('0x1d')],this[_0x92b9('0x1e')]));}function hangupHandler(){logger[_0x92b9('0x14')](util[_0x92b9('0x15')](_0x92b9('0x22'),this[_0x92b9('0x1c')],this[_0x92b9('0x20')],this[_0x92b9('0x21')],this[_0x92b9('0x1d')],this['uniqueid']));this['evtHangup']=!![];}function createSquareReport(_0x2f5e84,_0x2ed724){rpc[_0x92b9('0x23')](_0x2f5e84)['then'](function(_0x57ba48){if(_0x2ed724){_0x2ed724(null,_0x57ba48);}})[_0x92b9('0x24')](function(_0x399d3e){if(_0x2ed724){_0x2ed724(null,_0x399d3e);}});}function setChannelVariables(_0x2955bf){for(var _0x27234f in _0x2955bf){if(_0x2955bf['hasOwnProperty'](_0x27234f)){if(_0x27234f[_0x92b9('0x25')](_0x92b9('0x26'))===0x0){_0x2955bf[_0x27234f[_0x92b9('0x27')](0x4)]=_0x2955bf[_0x27234f];delete _0x2955bf[_0x27234f];}}}}function agiHandler(_0x3bc42f){logger[_0x92b9('0x28')](_0x92b9('0x29'),JSON[_0x92b9('0x2a')](_0x3bc42f,null,0x2));logger[_0x92b9('0x14')](util[_0x92b9('0x15')](_0x92b9('0x2b'),_0x3bc42f[_0x92b9('0x1c')],_0x3bc42f['calleridname'],_0x3bc42f[_0x92b9('0x21')],_0x3bc42f['dnid'],_0x3bc42f[_0x92b9('0x1e')]));_0x3bc42f['on'](_0x92b9('0xb'),errorHandler);_0x3bc42f['on'](_0x92b9('0x2c'),closeHandler);_0x3bc42f['on'](_0x92b9('0x2d'),timeoutHandler);_0x3bc42f[_0x92b9('0x2e')]=![];_0x3bc42f['on'](_0x92b9('0x2f'),hangupHandler);var _0xcb2458=_[_0x92b9('0x30')](projects,['name',_0x3bc42f[_0x92b9('0x1c')]]);if(!_0xcb2458)return Project[_0x92b9('0x31')](_0x3bc42f);if(!_0xcb2458[_0x92b9('0x32')])return Project[_0x92b9('0x33')](_0x3bc42f);return Project[_0x92b9('0x34')](_0xcb2458,_0x3bc42f);}function main(){var _0x493056;return utilLicense['getLicense']()[_0x92b9('0x35')](function(_0x4cae17){if(!_0x4cae17)return;if(_0x4cae17['voice']){if(_0x4cae17[_0x92b9('0x36')]&&_0x4cae17[_0x92b9('0x36')]>0x0){logger['info'](util[_0x92b9('0x15')](_0x92b9('0x37'),_0x4cae17['callysquare']));_0x493056=_0x4cae17['callysquare'];}else{logger['info'](_0x92b9('0x38'));}}else{logger[_0x92b9('0x14')](_0x92b9('0x39'));_0x493056=-0x1;}})[_0x92b9('0x35')](function(){return Project[_0x92b9('0x3a')]();})[_0x92b9('0x35')](function(_0x5afb57){projects=_0x5afb57;return;})['catch'](function(_0x7765ab){logger['error'](_0x92b9('0x3b'),_0x7765ab[_0x92b9('0x10')]);})['finally'](function(){var _0x37948f=require('./server')(config[_0x92b9('0x5')][_0x92b9('0x13')],config[_0x92b9('0x5')]['ip'],_0x493056);_0x37948f['on'](_0x92b9('0xb'),errorHandler);_0x37948f['on'](_0x92b9('0x3c'),listeningHandler);_0x37948f['on'](_0x92b9('0x3d'),connectionHandler);_0x37948f['on'](_0x92b9('0x2c'),closeHandler);});}main(); \ No newline at end of file +var _0xbbaf=['callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','catch','finally','./server','listening','connection','lodash','util','../../config/environment','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','error','findIndex','deleted','splice','push','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','format','[%s]\x20%s','name','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice'];(function(_0x5e8212,_0x31fdc3){var _0x4ffffb=function(_0x1d2718){while(--_0x1d2718){_0x5e8212['push'](_0x5e8212['shift']());}};_0x4ffffb(++_0x31fdc3);}(_0xbbaf,0x8a));var _0xfbba=function(_0x555163,_0x4a5f0b){_0x555163=_0x555163-0x0;var _0x15816a=_0xbbaf[_0x555163];return _0x15816a;};'use strict';var _=require(_0xfbba('0x0'));var syncho=require('syncho');var util=require(_0xfbba('0x1'));var config=require(_0xfbba('0x2'));var logger=require('../../config/logger')(_0xfbba('0x3'));var utilLicense=require(_0xfbba('0x4'));var rpc=require(_0xfbba('0x5'));var Project=require(_0xfbba('0x6'));var AGIEmitter=require(_0xfbba('0x7'))[_0xfbba('0x8')];var projects=[];config[_0xfbba('0x3')]=_[_0xfbba('0x9')](config[_0xfbba('0x3')],{'ip':_0xfbba('0xa'),'port':0x11dd});AGIEmitter['on'](_0xfbba('0xb'),projectUpdateHandler);function connectionHandler(_0x30d230){process[_0xfbba('0xc')](function(){syncho(function(){try{setChannelVariables(_0x30d230);agiHandler(_0x30d230);}catch(_0x29770d){logger[_0xfbba('0xd')](_0x29770d['stack']);}});});}function projectUpdateHandler(_0xd5f945){try{var _0x3ac0c3=_[_0xfbba('0xe')](projects,['id',_0xd5f945['id']]);if(_0x3ac0c3>-0x1){if(_0xd5f945[_0xfbba('0xf')]===!![]){projects[_0xfbba('0x10')](_0x3ac0c3,0x1);}else{projects[_0x3ac0c3]=_0xd5f945;}}else{projects[_0xfbba('0x11')](_0xd5f945);}}catch(_0xae8238){logger[_0xfbba('0xd')](_0xae8238[_0xfbba('0x12')]);}}function listeningHandler(){console[_0xfbba('0x13')](_0xfbba('0x14'),config[_0xfbba('0x3')][_0xfbba('0x15')]);logger['info'](util['format'](_0xfbba('0x16'),config[_0xfbba('0x3')]['ip'],config[_0xfbba('0x3')][_0xfbba('0x15')]));}function errorHandler(_0x5bdefa){if(_0x5bdefa&&_0x5bdefa['name']&&_0x5bdefa['message']){logger[_0xfbba('0xd')](util[_0xfbba('0x17')](_0xfbba('0x18'),_0x5bdefa[_0xfbba('0x19')],_0x5bdefa['message']));}else{logger['error'](util[_0xfbba('0x17')](_0xfbba('0x1a'),_0x5bdefa[_0xfbba('0x12')]));}}function closeHandler(){logger[_0xfbba('0x1b')](util[_0xfbba('0x17')](_0xfbba('0x1c'),this[_0xfbba('0x1d')],this[_0xfbba('0x1e')],this[_0xfbba('0x1f')],this[_0xfbba('0x20')],this['uniqueid']));try{createSquareReport(this);}catch(_0x13df7c){logger[_0xfbba('0xd')](_0x13df7c[_0xfbba('0x12')]);}}function timeoutHandler(){logger[_0xfbba('0x1b')](util['format'](_0xfbba('0x21'),this[_0xfbba('0x1d')],this[_0xfbba('0x1e')],this[_0xfbba('0x1f')],this['dnid'],this[_0xfbba('0x22')]));}function hangupHandler(){logger['info'](util[_0xfbba('0x17')](_0xfbba('0x23'),this[_0xfbba('0x1d')],this[_0xfbba('0x1e')],this[_0xfbba('0x1f')],this['dnid'],this[_0xfbba('0x22')]));this['evtHangup']=!![];}function createSquareReport(_0x4c7004,_0x3ff9fb){rpc[_0xfbba('0x24')](_0x4c7004)[_0xfbba('0x25')](function(_0x2938de){if(_0x3ff9fb){_0x3ff9fb(null,_0x2938de);}})['catch'](function(_0x3f798){if(_0x3ff9fb){_0x3ff9fb(null,_0x3f798);}});}function setChannelVariables(_0x9db929){for(var _0x1a375e in _0x9db929){if(_0x9db929[_0xfbba('0x26')](_0x1a375e)){if(_0x1a375e[_0xfbba('0x27')](_0xfbba('0x28'))===0x0){_0x9db929[_0x1a375e[_0xfbba('0x29')](0x4)]=_0x9db929[_0x1a375e];delete _0x9db929[_0x1a375e];}}}}function agiHandler(_0x29ff02){logger[_0xfbba('0x2a')](_0xfbba('0x2b'),JSON[_0xfbba('0x2c')](_0x29ff02,null,0x2));logger[_0xfbba('0x1b')](util['format'](_0xfbba('0x2d'),_0x29ff02[_0xfbba('0x1d')],_0x29ff02[_0xfbba('0x1e')],_0x29ff02[_0xfbba('0x1f')],_0x29ff02[_0xfbba('0x20')],_0x29ff02[_0xfbba('0x22')]));_0x29ff02['on'](_0xfbba('0xd'),errorHandler);_0x29ff02['on'](_0xfbba('0x2e'),closeHandler);_0x29ff02['on'](_0xfbba('0x2f'),timeoutHandler);_0x29ff02[_0xfbba('0x30')]=![];_0x29ff02['on'](_0xfbba('0x31'),hangupHandler);var _0x37df8a=_[_0xfbba('0x32')](projects,[_0xfbba('0x19'),_0x29ff02[_0xfbba('0x1d')]]);if(!_0x37df8a)return Project[_0xfbba('0x33')](_0x29ff02);if(!_0x37df8a[_0xfbba('0x34')])return Project[_0xfbba('0x35')](_0x29ff02);return Project[_0xfbba('0x36')](_0x37df8a,_0x29ff02);}function main(){var _0x4975b8;return utilLicense[_0xfbba('0x37')]()[_0xfbba('0x25')](function(_0x1fc015){if(!_0x1fc015)return;if(_0x1fc015[_0xfbba('0x38')]){if(_0x1fc015['callysquare']&&_0x1fc015['callysquare']>0x0){logger['info'](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0x1fc015[_0xfbba('0x39')]));_0x4975b8=_0x1fc015['callysquare'];}else{logger[_0xfbba('0x1b')](_0xfbba('0x3a'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x4975b8=-0x1;}})[_0xfbba('0x25')](function(){return Project[_0xfbba('0x3b')]();})[_0xfbba('0x25')](function(_0x390bc3){projects=_0x390bc3;return;})[_0xfbba('0x3c')](function(_0x1eab9b){logger['error']('[LICENSE]',_0x1eab9b[_0xfbba('0x12')]);})[_0xfbba('0x3d')](function(){var _0x2ccdb4=require(_0xfbba('0x3e'))(config['agi'][_0xfbba('0x15')],config['agi']['ip'],_0x4975b8);_0x2ccdb4['on'](_0xfbba('0xd'),errorHandler);_0x2ccdb4['on'](_0xfbba('0x3f'),listeningHandler);_0x2ccdb4['on'](_0xfbba('0x40'),connectionHandler);_0x2ccdb4['on'](_0xfbba('0x2e'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 083aaa2..a572d4d 100644 --- a/server/services/agi/mailRpc/index.js +++ b/server/services/agi/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd5e=['catch','sendMailMessage','SendMail','request','then','error','message','result'];(function(_0x37079e,_0x557741){var _0x3d9155=function(_0x2792c3){while(--_0x2792c3){_0x37079e['push'](_0x37079e['shift']());}};_0x3d9155(++_0x557741);}(_0xfd5e,0x113));var _0xefd5=function(_0x161841,_0x11b6b5){_0x161841=_0x161841-0x0;var _0x4697c1=_0xfd5e[_0x161841];return _0x4697c1;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function request(_0x2786b7,_0x480f40){return new BPromise(function(_0x3f5d3b,_0xf667d1){return client[_0xefd5('0x0')](_0x2786b7,_0x480f40)[_0xefd5('0x1')](function(_0x23f002){if(_0x23f002[_0xefd5('0x2')]){return _0xf667d1(_0x23f002[_0xefd5('0x2')][_0xefd5('0x3')]);}else{return _0x3f5d3b(_0x23f002[_0xefd5('0x4')]);}})[_0xefd5('0x5')](function(_0x4a5012){return _0xf667d1(_0x4a5012);});});}exports[_0xefd5('0x6')]=function(_0x3d4029,_0x212331){return request(_0xefd5('0x7'),{'account':_0x3d4029,'message':_0x212331});}; \ No newline at end of file +var _0x533f=['result','catch','SendMail','bluebird','client','request','error','message'];(function(_0x3c2166,_0x41fc16){var _0x30ccc3=function(_0x689bc3){while(--_0x689bc3){_0x3c2166['push'](_0x3c2166['shift']());}};_0x30ccc3(++_0x41fc16);}(_0x533f,0x14b));var _0xf533=function(_0x390a19,_0x5dd137){_0x390a19=_0x390a19-0x0;var _0x5d8230=_0x533f[_0x390a19];return _0x5d8230;};'use strict';var BPromise=require(_0xf533('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xf533('0x1')]['http']({'port':0x232b});function request(_0x589527,_0x4fe739){return new BPromise(function(_0x2abc25,_0x3f5469){return client[_0xf533('0x2')](_0x589527,_0x4fe739)['then'](function(_0x59194e){if(_0x59194e[_0xf533('0x3')]){return _0x3f5469(_0x59194e['error'][_0xf533('0x4')]);}else{return _0x2abc25(_0x59194e[_0xf533('0x5')]);}})[_0xf533('0x6')](function(_0x26a46a){return _0x3f5469(_0x26a46a);});});}exports['sendMailMessage']=function(_0x3a8da2,_0x1ca42a){return request(_0xf533('0x7'),{'account':_0x3a8da2,'message':_0x1ca42a});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 7d38edf..2366c4a 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x92c7=['close','Project\x20%s\x20not\x20found','exports','lodash','moment','xml2json','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','catch','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','isArray','length','source','target','addEdge','value','root','inspect','production','debug','joinAt','mxCell','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','start','clear','stringify','gotoc','info','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','evtHangup','toString','agicommand\x20not\x20found','error','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','traverseBFS','vertex','result','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt'];(function(_0x1a9273,_0x4c1c68){var _0x140de3=function(_0x5cd45b){while(--_0x5cd45b){_0x1a9273['push'](_0x1a9273['shift']());}};_0x140de3(++_0x4c1c68);}(_0x92c7,0x1eb));var _0x792c=function(_0x2a303a,_0x10867f){_0x2a303a=_0x2a303a-0x0;var _0x147a51=_0x92c7[_0x2a303a];return _0x147a51;};'use strict';var _=require(_0x792c('0x0'));var moment=require(_0x792c('0x1'));var parser=require(_0x792c('0x2'));var util=require('util');var logger=require(_0x792c('0x3'))(_0x792c('0x4'));var rpc=require(_0x792c('0x5'));var mailRpc=require(_0x792c('0x6'));var Graph=require(_0x792c('0x7'));var Vertices=require(_0x792c('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x792c('0x9')](function(_0x42511a){logger['error']('Unable\x20to\x20download\x20CallySquare\x20projects',_0x42511a[_0x792c('0xa')]);return[];});}function addVertex(_0x449748,_0x4647e1,_0x52d8bf){_0x4647e1[_0x792c('0xb')]=_0x52d8bf;if(_0x4647e1[_0x792c('0xc')](_0x792c('0xd'))){_0x4647e1[_0x792c('0xe')]=parseInt(_0x4647e1[_0x792c('0xd')],0xa);}_0x449748[_0x792c('0xf')](_[_0x792c('0x10')](_0x4647e1,'mxCell'));}function initGraph(_0x2f3134,_0x5b8a26){var _0x12af1d=new Graph();for(var _0x5b6e00 in _0x2f3134){if(_0x2f3134[_0x792c('0xc')](_0x5b6e00)){if(_[_0x792c('0x11')](_0x2f3134[_0x5b6e00])){for(var _0x3f0f02=0x0;_0x3f0f02<_0x2f3134[_0x5b6e00][_0x792c('0x12')];_0x3f0f02+=0x1){addVertex(_0x12af1d,_0x2f3134[_0x5b6e00][_0x3f0f02],_0x5b6e00);}}else{addVertex(_0x12af1d,_0x2f3134[_0x5b6e00],_0x5b6e00);}}}for(var _0x4d1efe=0x0;_0x4d1efe<_0x5b8a26['length'];_0x4d1efe+=0x1){if(_0x5b8a26[_0x4d1efe][_0x792c('0x13')]&&_0x5b8a26[_0x4d1efe][_0x792c('0x14')]){_0x12af1d[_0x792c('0x15')](_0x5b8a26[_0x4d1efe][_0x792c('0x13')],_0x5b8a26[_0x4d1efe][_0x792c('0x14')],_0x5b8a26[_0x4d1efe][_0x792c('0x16')]);}}return _0x12af1d;}function getRoot(_0x507efa){return parser['toJson'](_0x507efa,{'object':!![]})['mxGraphModel'][_0x792c('0x17')];}function inspect(_0x4d0fb6){return util[_0x792c('0x18')](_0x4d0fb6,{'showHidden':![],'depth':null});}function initialize(_0x2b4902,_0x18cfad){var _0x51fb40=getRoot(_0x2b4902[_0x792c('0x19')]);if(!_0x51fb40||!_0x51fb40['start'])return;var _0x2292c1,_0x2e694c,_0x1486ec;logger[_0x792c('0x1a')]('root',JSON['stringify'](_0x51fb40,null,0x2));_0x18cfad[_0x792c('0x1b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2292c1=initGraph(_[_0x792c('0x10')](_0x51fb40,_0x792c('0x1c')),_0x51fb40[_0x792c('0x1c')]);_0x2e694c=new Vertices(_0x18cfad,rpc,mailRpc);logger['info'](util[_0x792c('0x1d')](_0x792c('0x1e'),_0x18cfad['arg_1'],_0x18cfad[_0x792c('0x1f')],_0x18cfad[_0x792c('0x20')],_0x18cfad[_0x792c('0x21')],_0x18cfad[_0x792c('0x22')]));_0x2292c1['traverseBFS'](_0x51fb40[_0x792c('0x23')]['id'],function(_0x49d457){try{_0x49d457=_0x2e694c[_0x792c('0x24')](_0x49d457);logger[_0x792c('0x1a')]('vertex',JSON[_0x792c('0x25')](_0x49d457,null,0x2));if(_0x49d457[_0x792c('0xb')]===_0x792c('0x26')){logger[_0x792c('0x27')](_0x792c('0x28'));_0x18cfad[_0x792c('0x29')]=_0x49d457[_0x792c('0x29')]||_0x18cfad[_0x792c('0x29')];_0x18cfad[_0x792c('0x2a')]=_0x49d457['extension'];_0x18cfad['priority']=_0x49d457[_0x792c('0x2b')]?_0x49d457['priority']-0x1:0x1;return null;}else if(_0x49d457&&_0x2e694c[_0x49d457[_0x792c('0xb')]]){_0x1486ec=_0x2e694c[_0x49d457[_0x792c('0xb')]](_0x49d457);logger[_0x792c('0x27')](_0x792c('0x2c'),JSON['stringify'](_0x1486ec,null,0x2));if(_0x1486ec&&_0x1486ec[_0x792c('0x2d')]===AGI_CODE_SUCCESS&&_0x1486ec['result']!==AGI_RESULT_ERROR&&!_0x18cfad[_0x792c('0x2e')]){logger[_0x792c('0x1a')](_0x792c('0x2c'),inspect(_0x1486ec));return _['isUndefined'](_0x1486ec['result'])?null:_0x1486ec['result'][_0x792c('0x2f')]();}else{logger['error'](_0x792c('0x2c'),inspect(_0x1486ec));return null;}}else{logger['error'](_0x792c('0x30'));return null;}}catch(_0x2406dd){logger[_0x792c('0x31')](_0x2406dd['stack']);return null;}});if(_0x51fb40[_0x792c('0x32')]){logger[_0x792c('0x27')](util[_0x792c('0x1d')](_0x792c('0x33'),_0x18cfad[_0x792c('0x34')],_0x18cfad[_0x792c('0x1f')],_0x18cfad[_0x792c('0x20')],_0x18cfad['dnid'],_0x18cfad[_0x792c('0x22')]));_0x2292c1[_0x792c('0x35')](_0x51fb40[_0x792c('0x32')]['id'],function(_0x2730e3){try{_0x2730e3=_0x2e694c[_0x792c('0x24')](_0x2730e3);logger[_0x792c('0x1a')](_0x792c('0x36'),JSON[_0x792c('0x25')](_0x2730e3,null,0x2));if(_0x2730e3&&_0x2e694c[_0x2730e3[_0x792c('0xb')]]){_0x1486ec=_0x2e694c[_0x2730e3['agicommand']](_0x2730e3);if(_0x1486ec){logger[_0x792c('0x1a')](_0x792c('0x2c'),inspect(_0x1486ec));return _['isUndefined'](_0x1486ec['result'])?null:_0x1486ec[_0x792c('0x37')]['toString']();}else{logger[_0x792c('0x31')](_0x792c('0x2c'),inspect(_0x1486ec));return null;}}else{logger[_0x792c('0x31')](_0x792c('0x30'));return null;}}catch(_0x2fd7e1){logger[_0x792c('0x31')](_0x2fd7e1['stack']);return null;}});}logger[_0x792c('0x27')](util[_0x792c('0x1d')](_0x792c('0x38'),_0x18cfad[_0x792c('0x34')],_0x18cfad[_0x792c('0x1f')],_0x18cfad['callerid'],_0x18cfad[_0x792c('0x21')],_0x18cfad[_0x792c('0x22')]));logger['info'](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x18cfad[_0x792c('0x29')],_0x18cfad[_0x792c('0x2a')],parseInt(_0x18cfad[_0x792c('0x2b')],0xa)+0x1));_0x18cfad[_0x792c('0x39')](_0x18cfad['context'],_0x18cfad[_0x792c('0x2a')],parseInt(_0x18cfad[_0x792c('0x2b')],0xa)+0x1);_0x18cfad[_0x792c('0x3a')]();}function handleNotFound(_0x27fa89){logger[_0x792c('0x31')](util[_0x792c('0x1d')](_0x792c('0x3b'),_0x27fa89[_0x792c('0x34')]));_0x27fa89[_0x792c('0x39')](_0x27fa89[_0x792c('0x29')],_0x27fa89['extension'],parseInt(_0x27fa89[_0x792c('0x2b')],0xa)+0x1);_0x27fa89[_0x792c('0x3a')]();}function handleUnpublished(_0x17d436){logger[_0x792c('0x31')](util['format']('Project\x20%s\x20not\x20published',_0x17d436['arg_1']));_0x17d436['continueAt'](_0x17d436[_0x792c('0x29')],_0x17d436['extension'],parseInt(_0x17d436[_0x792c('0x2b')],0xa)+0x1);_0x17d436[_0x792c('0x3a')]();}module[_0x792c('0x3c')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xdd25=['gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','toString','error','agicommand\x20not\x20found','finally','isUndefined','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','moment','util','../../config/logger','agi','./rpc','./graph','./vertices','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','maxRetry','retry','omit','mxCell','isArray','length','source','target','value','mxGraphModel','root','production','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','start','clear','debug','vertex','stringify'];(function(_0x4a869e,_0x350c89){var _0x54ae70=function(_0x29f47c){while(--_0x29f47c){_0x4a869e['push'](_0x4a869e['shift']());}};_0x54ae70(++_0x350c89);}(_0xdd25,0x175));var _0x5dd2=function(_0x4982a3,_0x28f227){_0x4982a3=_0x4982a3-0x0;var _0x47c9b2=_0xdd25[_0x4982a3];return _0x47c9b2;};'use strict';var _=require('lodash');var moment=require(_0x5dd2('0x0'));var parser=require('xml2json');var util=require(_0x5dd2('0x1'));var logger=require(_0x5dd2('0x2'))(_0x5dd2('0x3'));var rpc=require(_0x5dd2('0x4'));var mailRpc=require('./mailRpc');var Graph=require(_0x5dd2('0x5'));var Vertices=require(_0x5dd2('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x5dd2('0x7')](function(_0x1ba524){logger['error'](_0x5dd2('0x8'),_0x1ba524[_0x5dd2('0x9')]);return[];});}function addVertex(_0x3ded49,_0x584598,_0x37b393){_0x584598[_0x5dd2('0xa')]=_0x37b393;if(_0x584598[_0x5dd2('0xb')]('retry')){_0x584598[_0x5dd2('0xc')]=parseInt(_0x584598[_0x5dd2('0xd')],0xa);}_0x3ded49['addVertex'](_[_0x5dd2('0xe')](_0x584598,_0x5dd2('0xf')));}function initGraph(_0x4369de,_0x10b94a){var _0x4cdaa8=new Graph();for(var _0x39cd9c in _0x4369de){if(_0x4369de['hasOwnProperty'](_0x39cd9c)){if(_[_0x5dd2('0x10')](_0x4369de[_0x39cd9c])){for(var _0x239bfe=0x0;_0x239bfe<_0x4369de[_0x39cd9c][_0x5dd2('0x11')];_0x239bfe+=0x1){addVertex(_0x4cdaa8,_0x4369de[_0x39cd9c][_0x239bfe],_0x39cd9c);}}else{addVertex(_0x4cdaa8,_0x4369de[_0x39cd9c],_0x39cd9c);}}}for(var _0x4f06fc=0x0;_0x4f06fc<_0x10b94a[_0x5dd2('0x11')];_0x4f06fc+=0x1){if(_0x10b94a[_0x4f06fc][_0x5dd2('0x12')]&&_0x10b94a[_0x4f06fc]['target']){_0x4cdaa8['addEdge'](_0x10b94a[_0x4f06fc][_0x5dd2('0x12')],_0x10b94a[_0x4f06fc][_0x5dd2('0x13')],_0x10b94a[_0x4f06fc][_0x5dd2('0x14')]);}}return _0x4cdaa8;}function getRoot(_0x57298b){return parser['toJson'](_0x57298b,{'object':!![]})[_0x5dd2('0x15')][_0x5dd2('0x16')];}function inspect(_0x1fb75b){return util['inspect'](_0x1fb75b,{'showHidden':![],'depth':null});}function initialize(_0x245fd4,_0x46a8ba){var _0x3b23d9=getRoot(_0x245fd4[_0x5dd2('0x17')]);if(!_0x3b23d9||!_0x3b23d9['start'])return;var _0x51752d,_0x19fd6f,_0x4c0019;logger['debug'](_0x5dd2('0x16'),JSON['stringify'](_0x3b23d9,null,0x2));_0x46a8ba[_0x5dd2('0x18')]=moment()[_0x5dd2('0x19')](_0x5dd2('0x1a'));_0x51752d=initGraph(_['omit'](_0x3b23d9,'mxCell'),_0x3b23d9['mxCell']);_0x19fd6f=new Vertices(_0x46a8ba,rpc,mailRpc);logger[_0x5dd2('0x1b')](util[_0x5dd2('0x19')](_0x5dd2('0x1c'),_0x46a8ba[_0x5dd2('0x1d')],_0x46a8ba[_0x5dd2('0x1e')],_0x46a8ba[_0x5dd2('0x1f')],_0x46a8ba[_0x5dd2('0x20')],_0x46a8ba[_0x5dd2('0x21')]));_0x51752d[_0x5dd2('0x22')](_0x3b23d9[_0x5dd2('0x23')]['id'],function(_0x1c9fd3){try{_0x1c9fd3=_0x19fd6f[_0x5dd2('0x24')](_0x1c9fd3);logger[_0x5dd2('0x25')](_0x5dd2('0x26'),JSON[_0x5dd2('0x27')](_0x1c9fd3,null,0x2));if(_0x1c9fd3[_0x5dd2('0xa')]===_0x5dd2('0x28')){logger[_0x5dd2('0x1b')](_0x5dd2('0x29'));_0x46a8ba['context']=_0x1c9fd3[_0x5dd2('0x2a')]||_0x46a8ba[_0x5dd2('0x2a')];_0x46a8ba[_0x5dd2('0x2b')]=_0x1c9fd3[_0x5dd2('0x2b')];_0x46a8ba['priority']=_0x1c9fd3[_0x5dd2('0x2c')]?_0x1c9fd3[_0x5dd2('0x2c')]-0x1:0x1;return null;}else if(_0x1c9fd3&&_0x19fd6f[_0x1c9fd3[_0x5dd2('0xa')]]){_0x4c0019=_0x19fd6f[_0x1c9fd3[_0x5dd2('0xa')]](_0x1c9fd3);logger[_0x5dd2('0x1b')](_0x5dd2('0x2d'),JSON[_0x5dd2('0x27')](_0x4c0019,null,0x2));if(_0x4c0019&&_0x4c0019[_0x5dd2('0x2e')]===AGI_CODE_SUCCESS&&_0x4c0019[_0x5dd2('0x2f')]!==AGI_RESULT_ERROR&&!_0x46a8ba[_0x5dd2('0x30')]){logger['debug'](_0x5dd2('0x2d'),inspect(_0x4c0019));return _['isUndefined'](_0x4c0019[_0x5dd2('0x2f')])?null:_0x4c0019[_0x5dd2('0x2f')][_0x5dd2('0x31')]();}else{logger[_0x5dd2('0x32')]('response',inspect(_0x4c0019));return null;}}else{logger[_0x5dd2('0x32')](_0x5dd2('0x33'));return null;}}catch(_0x22fd40){logger[_0x5dd2('0x32')](_0x22fd40[_0x5dd2('0x9')]);return null;}});if(_0x3b23d9[_0x5dd2('0x34')]){logger[_0x5dd2('0x1b')](util[_0x5dd2('0x19')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x46a8ba[_0x5dd2('0x1d')],_0x46a8ba['calleridname'],_0x46a8ba[_0x5dd2('0x1f')],_0x46a8ba['dnid'],_0x46a8ba[_0x5dd2('0x21')]));_0x51752d['traverseBFS'](_0x3b23d9[_0x5dd2('0x34')]['id'],function(_0x10f518){try{_0x10f518=_0x19fd6f[_0x5dd2('0x24')](_0x10f518);logger[_0x5dd2('0x25')]('vertex',JSON[_0x5dd2('0x27')](_0x10f518,null,0x2));if(_0x10f518&&_0x19fd6f[_0x10f518['agicommand']]){_0x4c0019=_0x19fd6f[_0x10f518[_0x5dd2('0xa')]](_0x10f518);if(_0x4c0019){logger['debug'](_0x5dd2('0x2d'),inspect(_0x4c0019));return _[_0x5dd2('0x35')](_0x4c0019[_0x5dd2('0x2f')])?null:_0x4c0019[_0x5dd2('0x2f')]['toString']();}else{logger[_0x5dd2('0x32')](_0x5dd2('0x2d'),inspect(_0x4c0019));return null;}}else{logger[_0x5dd2('0x32')](_0x5dd2('0x33'));return null;}}catch(_0x55c1fc){logger[_0x5dd2('0x32')](_0x55c1fc[_0x5dd2('0x9')]);return null;}});}logger[_0x5dd2('0x1b')](util[_0x5dd2('0x19')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x46a8ba[_0x5dd2('0x1d')],_0x46a8ba[_0x5dd2('0x1e')],_0x46a8ba[_0x5dd2('0x1f')],_0x46a8ba['dnid'],_0x46a8ba[_0x5dd2('0x21')]));logger['info'](util[_0x5dd2('0x19')](_0x5dd2('0x36'),_0x46a8ba[_0x5dd2('0x2a')],_0x46a8ba['extension'],parseInt(_0x46a8ba['priority'],0xa)+0x1));_0x46a8ba[_0x5dd2('0x37')](_0x46a8ba[_0x5dd2('0x2a')],_0x46a8ba[_0x5dd2('0x2b')],parseInt(_0x46a8ba['priority'],0xa)+0x1);_0x46a8ba[_0x5dd2('0x38')]();}function handleNotFound(_0x262334){logger[_0x5dd2('0x32')](util[_0x5dd2('0x19')](_0x5dd2('0x39'),_0x262334[_0x5dd2('0x1d')]));_0x262334['continueAt'](_0x262334['context'],_0x262334[_0x5dd2('0x2b')],parseInt(_0x262334[_0x5dd2('0x2c')],0xa)+0x1);_0x262334[_0x5dd2('0x38')]();}function handleUnpublished(_0x2a0daa){logger[_0x5dd2('0x32')](util['format'](_0x5dd2('0x3a'),_0x2a0daa[_0x5dd2('0x1d')]));_0x2a0daa[_0x5dd2('0x37')](_0x2a0daa[_0x5dd2('0x2a')],_0x2a0daa['extension'],parseInt(_0x2a0daa['priority'],0xa)+0x1);_0x2a0daa[_0x5dd2('0x38')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index c78bffd..9e27157 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ba4=['\x0d\x0a\x0d\x0a','toString','substring','length','split','indexOf','trim','emit','headers','line','exports','util','stream','Transform','_localBuffer','_inBody','prototype','_transform'];(function(_0x77fb8c,_0x3f64c6){var _0x5b7136=function(_0x5824f1){while(--_0x5824f1){_0x77fb8c['push'](_0x77fb8c['shift']());}};_0x5b7136(++_0x3f64c6);}(_0x7ba4,0x13d));var _0x47ba=function(_0x254a83,_0x1e86b2){_0x254a83=_0x254a83-0x0;var _0x4d1237=_0x7ba4[_0x254a83];return _0x4d1237;};'use strict';var util=require(_0x47ba('0x0'));var Transform=require(_0x47ba('0x1'))[_0x47ba('0x2')];function AGIReply(_0x5b3609){Transform['call'](this,_0x5b3609);this[_0x47ba('0x3')]='';this[_0x47ba('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x47ba('0x5')][_0x47ba('0x6')]=function(_0x53dd37,_0x2b0226,_0x38d108){var _0x3275e9='\x0a',_0x52131f=['\x0a\x0a',_0x47ba('0x7')],_0xba7d9c=-0x1,_0x2faaa7=-0x1,_0x1656d2='',_0xe4a53a=0x0,_0x1c4c74='',_0x25a54a='';this[_0x47ba('0x3')]+=_0x53dd37[_0x47ba('0x8')]();_0x1c4c74=this['_localBuffer'];if(!this[_0x47ba('0x4')]){_0xe4a53a=0x0;while(_0x52131f[_0xe4a53a]){while((_0x2faaa7=_0x1c4c74['indexOf'](_0x52131f[_0xe4a53a]))!=-0x1){_0x1656d2=_0x52131f[_0xe4a53a];_0x25a54a=_0x1c4c74[_0x47ba('0x9')](0x0,_0x2faaa7);_0x1c4c74=_0x1c4c74[_0x47ba('0x9')](_0x2faaa7+_0x1656d2[_0x47ba('0xa')]);var _0x3929e5=_0x25a54a[_0x47ba('0xb')](_0x3275e9),_0xe79d82=0x0,_0x474ce6={},_0x168847='',_0x1a29e4='',_0x30a099=-0x1;while(_0x3929e5[_0xe79d82]){_0x30a099=_0x3929e5[_0xe79d82][_0x47ba('0xc')](':');if(_0x30a099!=-0x1){_0x168847=_0x3929e5[_0xe79d82]['slice'](0x0,_0x30a099)[_0x47ba('0xd')]();_0x1a29e4=_0x3929e5[_0xe79d82]['slice'](_0x30a099+0x1)[_0x47ba('0xd')]();if(_0x168847[_0x47ba('0xa')]>0x0){_0x474ce6[_0x168847]=_0x1a29e4;}}else{}_0xe79d82++;}this[_0x47ba('0xe')](_0x47ba('0xf'),_0x474ce6);this[_0x47ba('0x4')]=!![];}_0xe4a53a++;}this[_0x47ba('0x3')]=_0x1c4c74;}else{while((_0xba7d9c=_0x1c4c74[_0x47ba('0xc')](_0x3275e9))!=-0x1){_0x25a54a=_0x1c4c74[_0x47ba('0x9')](0x0,_0xba7d9c);this[_0x47ba('0xe')](_0x47ba('0x10'),_0x25a54a);_0x1c4c74=_0x1c4c74[_0x47ba('0x9')](_0xba7d9c+_0x3275e9['length']);}this['_localBuffer']=_0x1c4c74;}_0x38d108();};module[_0x47ba('0x11')]=AGIReply; \ No newline at end of file +var _0x7872=['emit','headers','line','exports','util','stream','Transform','call','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','_localBuffer','substring','length','split','indexOf','trim','slice'];(function(_0x17e11f,_0x3dca5a){var _0xe81a36=function(_0x2066c3){while(--_0x2066c3){_0x17e11f['push'](_0x17e11f['shift']());}};_0xe81a36(++_0x3dca5a);}(_0x7872,0x193));var _0x2787=function(_0x440d2a,_0x23070a){_0x440d2a=_0x440d2a-0x0;var _0x2bbe8c=_0x7872[_0x440d2a];return _0x2bbe8c;};'use strict';var util=require(_0x2787('0x0'));var Transform=require(_0x2787('0x1'))[_0x2787('0x2')];function AGIReply(_0x4e75d4){Transform[_0x2787('0x3')](this,_0x4e75d4);this['_localBuffer']='';this[_0x2787('0x4')]=![];}util[_0x2787('0x5')](AGIReply,Transform);AGIReply['prototype'][_0x2787('0x6')]=function(_0x7e656b,_0x531f26,_0x1108cc){var _0x433829='\x0a',_0x102cd8=['\x0a\x0a',_0x2787('0x7')],_0x56b049=-0x1,_0x508d39=-0x1,_0x5ba648='',_0x2f2058=0x0,_0x4bc325='',_0x31b4cd='';this[_0x2787('0x8')]+=_0x7e656b['toString']();_0x4bc325=this['_localBuffer'];if(!this[_0x2787('0x4')]){_0x2f2058=0x0;while(_0x102cd8[_0x2f2058]){while((_0x508d39=_0x4bc325['indexOf'](_0x102cd8[_0x2f2058]))!=-0x1){_0x5ba648=_0x102cd8[_0x2f2058];_0x31b4cd=_0x4bc325[_0x2787('0x9')](0x0,_0x508d39);_0x4bc325=_0x4bc325[_0x2787('0x9')](_0x508d39+_0x5ba648[_0x2787('0xa')]);var _0x2f081e=_0x31b4cd[_0x2787('0xb')](_0x433829),_0x1a0c13=0x0,_0x18a90b={},_0x4161ab='',_0x57d94e='',_0x4d90bc=-0x1;while(_0x2f081e[_0x1a0c13]){_0x4d90bc=_0x2f081e[_0x1a0c13][_0x2787('0xc')](':');if(_0x4d90bc!=-0x1){_0x4161ab=_0x2f081e[_0x1a0c13]['slice'](0x0,_0x4d90bc)[_0x2787('0xd')]();_0x57d94e=_0x2f081e[_0x1a0c13][_0x2787('0xe')](_0x4d90bc+0x1)[_0x2787('0xd')]();if(_0x4161ab['length']>0x0){_0x18a90b[_0x4161ab]=_0x57d94e;}}else{}_0x1a0c13++;}this[_0x2787('0xf')](_0x2787('0x10'),_0x18a90b);this[_0x2787('0x4')]=!![];}_0x2f2058++;}this[_0x2787('0x8')]=_0x4bc325;}else{while((_0x56b049=_0x4bc325[_0x2787('0xc')](_0x433829))!=-0x1){_0x31b4cd=_0x4bc325['substring'](0x0,_0x56b049);this[_0x2787('0xf')](_0x2787('0x11'),_0x31b4cd);_0x4bc325=_0x4bc325[_0x2787('0x9')](_0x56b049+_0x433829[_0x2787('0xa')]);}this[_0x2787('0x8')]=_0x4bc325;}_0x1108cc();};module[_0x2787('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 32f76fe..c8d3763 100644 --- a/server/services/agi/rpc/index.js +++ b/server/services/agi/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x43fd=['merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','ListId','getPauseById','LoginUser','agentPause','UnpauseUser','agentLogout','moment','http','request','then','error','message','result','catch','GetSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','ShowVoiceQueue','getSquareOdbcById','ShowSquareOdbc','dsn','getContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSquareDetailsReport','createSquareReport','CreateSquareReport'];(function(_0x57bb79,_0x42ca61){var _0x99c51b=function(_0x52af71){while(--_0x52af71){_0x57bb79['push'](_0x57bb79['shift']());}};_0x99c51b(++_0x42ca61);}(_0x43fd,0x1ec));var _0xd43f=function(_0x164a5a,_0x1e6e4e){_0x164a5a=_0x164a5a-0x0;var _0x4ff1e3=_0x43fd[_0x164a5a];return _0x4ff1e3;};'use strict';var _=require('lodash');var moment=require(_0xd43f('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd43f('0x1')]({'port':0x2329});function request(_0x1ead65,_0x484615){return new Promise(function(_0x3df2bd,_0x48f953){return client[_0xd43f('0x2')](_0x1ead65,_0x484615)[_0xd43f('0x3')](function(_0x1d36b7){if(_0x1d36b7[_0xd43f('0x4')]){return _0x48f953(_0x1d36b7['error'][_0xd43f('0x5')]);}else{return _0x3df2bd(_0x1d36b7[_0xd43f('0x6')]);}})[_0xd43f('0x7')](function(_0x331163){return _0x48f953(_0x331163);});});}exports['getSquareProjects']=function(){return request(_0xd43f('0x8'),{'options':{'raw':![],'attributes':['id',_0xd43f('0x9'),'production']}});};exports[_0xd43f('0xa')]=function(_0x2d5011){return request(_0xd43f('0xb'),{'options':{'raw':![],'where':{'name':_0x2d5011},'attributes':[_0xd43f('0xc')]}});};exports[_0xd43f('0xd')]=function(_0x5eb0bb){return request(_0xd43f('0xe'),{'options':{'raw':![],'where':{'id':_0x5eb0bb},'include':[{'model':_0xd43f('0xf'),'as':_0xd43f('0x10'),'include':[{'model':_0xd43f('0x11'),'as':_0xd43f('0x11')}]}],'attributes':['id',_0xd43f('0x9'),_0xd43f('0x12')],'smtp':!![]}});};exports[_0xd43f('0x13')]=function(_0x2b4549){return request(_0xd43f('0xb'),{'options':{'where':{'id':_0x2b4549},'attributes':[_0xd43f('0x9')]}});};exports['getVoiceQueueById']=function(_0x3d979d){return request(_0xd43f('0x14'),{'options':{'where':{'id':_0x3d979d},'attributes':[_0xd43f('0x9')]}});};exports['getVariableById']=function(_0x4c576e){return request('ShowVariable',{'options':{'where':{'id':_0x4c576e},'attributes':[_0xd43f('0x9')]}});};exports[_0xd43f('0x15')]=function(_0x4f8862){return request(_0xd43f('0x16'),{'options':{'where':{'id':_0x4f8862},'attributes':[_0xd43f('0x17')]}});};exports['getUserById']=function(_0x5ced70){return request('ShowUser',{'options':{'where':{'id':_0x5ced70},'attributes':['name']}});};exports[_0xd43f('0x18')]=function(_0x19784f){return request('GetContactByPhone',{'options':{'where':{'phone':_0x19784f[_0xd43f('0x19')]},'attributes':['id']}});};exports[_0xd43f('0x1a')]=function(_0x18b862){return request(_0xd43f('0x1b'),{'options':{'where':{'id':_0x18b862},'attributes':['name']}});};exports[_0xd43f('0x1c')]=function(_0xd3933){return request(_0xd43f('0x1d'),{'options':{'where':{'id':_0xd3933},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x5683dc){return request(_0xd43f('0x1e'),{'options':{'raw':![],'where':{'id':_0x5683dc},'include':[{'model':_0xd43f('0x1f'),'as':_0xd43f('0x20')}]}});};exports[_0xd43f('0x21')]=function(_0x3b1094){return request(_0xd43f('0x22'),{'options':{'where':{'id':_0x3b1094},'attributes':['id',_0xd43f('0x9')]}});};exports['createSmsMessage']=function(_0x262023){return request('CreateSmsMessage',{'body':_0x262023});};exports[_0xd43f('0x23')]=function(_0x47f960){return request('CreateSquareDetailsReport',{'body':_0x47f960});};exports[_0xd43f('0x24')]=function(_0x2dca76){return request(_0xd43f('0x25'),{'body':_[_0xd43f('0x26')](_0x2dca76,{'project_name':_0x2dca76[_0xd43f('0x27')],'prev_project_name':_0x2dca76[_0xd43f('0x28')]||'','is_subproject':_0x2dca76[_0xd43f('0x28')]?!![]:![],'leaveAt':moment()[_0xd43f('0x29')](_0xd43f('0x2a'))})});};exports['createSquareRecording']=function(_0x26a6c9){return request(_0xd43f('0x2b'),{'body':_0x26a6c9});};exports[_0xd43f('0x2c')]=function(_0x2d54a7){return request(_0xd43f('0x2d'),{'body':_0x2d54a7});};exports['createCmContact']=function(_0x161540){return request(_0xd43f('0x2e'),{'options':{'raw':![],'where':{'phone':_0x161540[_0xd43f('0x19')],'ListId':_0x161540[_0xd43f('0x2f')]}}})[_0xd43f('0x3')](function(_0x5a7580){if(_0x5a7580){return _0x5a7580;}return request('CreateCmContact',{'body':_0x161540});});};exports[_0xd43f('0x30')]=function(_0x1f476d){return request('ShowPause',{'options':{'where':{'id':_0x1f476d},'attributes':[_0xd43f('0x9')]}});};exports['agentLogin']=function(_0x53aae7,_0x45e84a){return request(_0xd43f('0x31'),{'body':{'interface':_0x45e84a},'options':{'where':_0x53aae7}});};exports[_0xd43f('0x32')]=function(_0x4d032e,_0x410921,_0x23c4f7){return request('PauseUser',{'body':{'type':_0x410921,'uniqueid':_0x23c4f7},'options':{'where':_0x4d032e}});};exports['agentUnpause']=function(_0x11d2b5){return request(_0xd43f('0x33'),{'body':{},'options':{'where':_0x11d2b5}});};exports[_0xd43f('0x34')]=function(_0x202a05){return request('LogoutUser',{'body':{},'options':{'where':_0x202a05}});}; \ No newline at end of file +var _0xb2b5=['production','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ListId','CreateCmContact','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','http','request','then','error','message','getSquareProjects','GetSquareProjects','name'];(function(_0x28a3bb,_0x3ec794){var _0x224a7c=function(_0x5410a1){while(--_0x5410a1){_0x28a3bb['push'](_0x28a3bb['shift']());}};_0x224a7c(++_0x3ec794);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb2b5[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var moment=require('moment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5b2b('0x0')]({'port':0x2329});function request(_0x1431f3,_0x518fe7){return new Promise(function(_0x4eee87,_0x31784d){return client[_0x5b2b('0x1')](_0x1431f3,_0x518fe7)[_0x5b2b('0x2')](function(_0x3c073f){if(_0x3c073f['error']){return _0x31784d(_0x3c073f[_0x5b2b('0x3')][_0x5b2b('0x4')]);}else{return _0x4eee87(_0x3c073f['result']);}})['catch'](function(_0x1e08e6){return _0x31784d(_0x1e08e6);});});}exports[_0x5b2b('0x5')]=function(){return request(_0x5b2b('0x6'),{'options':{'raw':![],'attributes':['id',_0x5b2b('0x7'),_0x5b2b('0x8')]}});};exports[_0x5b2b('0x9')]=function(_0x15425f){return request(_0x5b2b('0xa'),{'options':{'raw':![],'where':{'name':_0x15425f},'attributes':['production']}});};exports[_0x5b2b('0xb')]=function(_0x4732cd){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x4732cd},'include':[{'model':_0x5b2b('0xc'),'as':_0x5b2b('0xd'),'include':[{'model':'CloudProvider','as':_0x5b2b('0xe')}]}],'attributes':['id',_0x5b2b('0x7'),_0x5b2b('0xf')],'smtp':!![]}});};exports[_0x5b2b('0x10')]=function(_0x2efc16){return request(_0x5b2b('0xa'),{'options':{'where':{'id':_0x2efc16},'attributes':[_0x5b2b('0x7')]}});};exports['getVoiceQueueById']=function(_0x30e9a3){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x30e9a3},'attributes':[_0x5b2b('0x7')]}});};exports[_0x5b2b('0x11')]=function(_0x3f5236){return request(_0x5b2b('0x12'),{'options':{'where':{'id':_0x3f5236},'attributes':['name']}});};exports[_0x5b2b('0x13')]=function(_0x57b38f){return request(_0x5b2b('0x14'),{'options':{'where':{'id':_0x57b38f},'attributes':['dsn']}});};exports['getUserById']=function(_0x44be6d){return request(_0x5b2b('0x15'),{'options':{'where':{'id':_0x44be6d},'attributes':['name']}});};exports[_0x5b2b('0x16')]=function(_0x2db9ee){return request(_0x5b2b('0x17'),{'options':{'where':{'phone':_0x2db9ee[_0x5b2b('0x18')]},'attributes':['id']}});};exports[_0x5b2b('0x19')]=function(_0x47bb1b){return request(_0x5b2b('0x1a'),{'options':{'where':{'id':_0x47bb1b},'attributes':[_0x5b2b('0x7')]}});};exports[_0x5b2b('0x1b')]=function(_0x318e05){return request(_0x5b2b('0x1c'),{'options':{'where':{'id':_0x318e05},'attributes':[_0x5b2b('0x1d')]}});};exports[_0x5b2b('0x1e')]=function(_0x208c1f){return request(_0x5b2b('0x1f'),{'options':{'raw':![],'where':{'id':_0x208c1f},'include':[{'model':_0x5b2b('0x20'),'as':_0x5b2b('0x21')}]}});};exports[_0x5b2b('0x22')]=function(_0x2de273){return request(_0x5b2b('0x23'),{'options':{'where':{'id':_0x2de273},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0xfdaeed){return request('CreateSmsMessage',{'body':_0xfdaeed});};exports[_0x5b2b('0x24')]=function(_0x4adb6d){return request(_0x5b2b('0x25'),{'body':_0x4adb6d});};exports[_0x5b2b('0x26')]=function(_0xb6d0b0){return request(_0x5b2b('0x27'),{'body':_[_0x5b2b('0x28')](_0xb6d0b0,{'project_name':_0xb6d0b0['arg_1'],'prev_project_name':_0xb6d0b0[_0x5b2b('0x29')]||'','is_subproject':_0xb6d0b0[_0x5b2b('0x29')]?!![]:![],'leaveAt':moment()['format'](_0x5b2b('0x2a'))})});};exports[_0x5b2b('0x2b')]=function(_0x49fca6){return request(_0x5b2b('0x2c'),{'body':_0x49fca6});};exports[_0x5b2b('0x2d')]=function(_0x225a99){return request(_0x5b2b('0x2e'),{'body':_0x225a99});};exports[_0x5b2b('0x2f')]=function(_0x94d866){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x94d866[_0x5b2b('0x18')],'ListId':_0x94d866[_0x5b2b('0x30')]}}})[_0x5b2b('0x2')](function(_0x4162f6){if(_0x4162f6){return _0x4162f6;}return request(_0x5b2b('0x31'),{'body':_0x94d866});});};exports['getPauseById']=function(_0x3ff027){return request(_0x5b2b('0x32'),{'options':{'where':{'id':_0x3ff027},'attributes':[_0x5b2b('0x7')]}});};exports[_0x5b2b('0x33')]=function(_0xbe2fc9,_0x32bc4a){return request('LoginUser',{'body':{'interface':_0x32bc4a},'options':{'where':_0xbe2fc9}});};exports[_0x5b2b('0x34')]=function(_0x37d218,_0x101d5c,_0x1127b0){return request(_0x5b2b('0x35'),{'body':{'type':_0x101d5c,'uniqueid':_0x1127b0},'options':{'where':_0x37d218}});};exports[_0x5b2b('0x36')]=function(_0x343b83){return request(_0x5b2b('0x37'),{'body':{},'options':{'where':_0x343b83}});};exports[_0x5b2b('0x38')]=function(_0x3f7f22){return request('LogoutUser',{'body':{},'options':{'where':_0x3f7f22}});}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/index.js b/server/services/agi/scripts/aws/index.js index a988ef0..b8c5fdb 100644 --- a/server/services/agi/scripts/aws/index.js +++ b/server/services/agi/scripts/aws/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x448a=['exports','./lex'];(function(_0xdc4597,_0x32d2eb){var _0x513c83=function(_0x15f4ba){while(--_0x15f4ba){_0xdc4597['push'](_0xdc4597['shift']());}};_0x513c83(++_0x32d2eb);}(_0x448a,0x1ef));var _0xa448=function(_0x24d2db,_0x18983c){_0x24d2db=_0x24d2db-0x0;var _0x42de43=_0x448a[_0x24d2db];return _0x42de43;};var polly=require('./polly');var lex=require(_0xa448('0x0'));module[_0xa448('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x236d=['./polly','./lex'];(function(_0x25535d,_0x441ade){var _0x3313b5=function(_0x1672d7){while(--_0x1672d7){_0x25535d['push'](_0x25535d['shift']());}};_0x3313b5(++_0x441ade);}(_0x236d,0x7e));var _0xd236=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x236d[_0x321bb2];return _0x9c12ed;};var polly=require(_0xd236('0x0'));var lex=require(_0xd236('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 95581e8..6845f64 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x153f=['exports','./lib/api'];(function(_0x2df4cc,_0x1233c6){var _0x40af8d=function(_0x5e0f2a){while(--_0x5e0f2a){_0x2df4cc['push'](_0x2df4cc['shift']());}};_0x40af8d(++_0x1233c6);}(_0x153f,0x15b));var _0xf153=function(_0xc99cb7,_0x381cce){_0xc99cb7=_0xc99cb7-0x0;var _0xb5d3a2=_0x153f[_0xc99cb7];return _0xb5d3a2;};'use strict';var lex=require(_0xf153('0x0'));module[_0xf153('0x1')]=function(_0xde7eae,_0x44cea3,_0x2afb9a,_0x1ccc1c,_0x3b85fc,_0x59757c){return lex(_0xde7eae,_0x44cea3,_0x2afb9a,_0x1ccc1c,_0x3b85fc,_0x59757c);}; \ No newline at end of file +var _0xee5b=['./lib/api'];(function(_0x1c0a50,_0xaac6d4){var _0x1f58af=function(_0x30946e){while(--_0x30946e){_0x1c0a50['push'](_0x1c0a50['shift']());}};_0x1f58af(++_0xaac6d4);}(_0xee5b,0x1f4));var _0xbee5=function(_0x5beb13,_0x1a395a){_0x5beb13=_0x5beb13-0x0;var _0x527871=_0xee5b[_0x5beb13];return _0x527871;};'use strict';var lex=require(_0xbee5('0x0'));module['exports']=function(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857){return lex(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 89ce255..d9b2779 100644 --- a/server/services/agi/scripts/aws/lex/lib/api.js +++ b/server/services/agi/scripts/aws/lex/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x6b5a1,_0x187bbe){var _0x3dbc26=function(_0x14ab0a){while(--_0x14ab0a){_0x6b5a1['push'](_0x6b5a1['shift']());}};_0x3dbc26(++_0x187bbe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x5a31ca,_0x102c0d){var _0x332c98=function(_0x11929e){while(--_0x11929e){_0x5a31ca['push'](_0x5a31ca['shift']());}};_0x332c98(++_0x102c0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 3b10dbf..9a15c2c 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfdf=['exports'];(function(_0x57dfff,_0x2cd171){var _0x193ae0=function(_0x326cbf){while(--_0x326cbf){_0x57dfff['push'](_0x57dfff['shift']());}};_0x193ae0(++_0x2cd171);}(_0xcfdf,0x108));var _0xfcfd=function(_0x391424,_0x4d7640){_0x391424=_0x391424-0x0;var _0x59f0d8=_0xcfdf[_0x391424];return _0x59f0d8;};'use strict';var polly=require('./lib/api');module[_0xfcfd('0x0')]=function(_0x585168,_0x37431e,_0x7208a6,_0x97ace9,_0x4d0a7a,_0x4c5a6c,_0x1c8fde){return polly(_0x585168,_0x37431e,_0x7208a6,_0x97ace9,_0x4d0a7a,_0x4c5a6c,_0x1c8fde);}; \ No newline at end of file +var _0x97b6=['exports','./lib/api'];(function(_0x2717e9,_0x54c570){var _0x3cf35a=function(_0x51b907){while(--_0x51b907){_0x2717e9['push'](_0x2717e9['shift']());}};_0x3cf35a(++_0x54c570);}(_0x97b6,0x17d));var _0x697b=function(_0xf8bd98,_0x722df){_0xf8bd98=_0xf8bd98-0x0;var _0x34e8af=_0x97b6[_0xf8bd98];return _0x34e8af;};'use strict';var polly=require(_0x697b('0x0'));module[_0x697b('0x1')]=function(_0x32ae5a,_0x1f3289,_0x1cf6f5,_0x50ac63,_0x6424cd,_0x14fc5a,_0x43b60b){return polly(_0x32ae5a,_0x1f3289,_0x1cf6f5,_0x50ac63,_0x6424cd,_0x14fc5a,_0x43b60b);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/lib/api.js b/server/services/agi/scripts/aws/polly/lib/api.js index 4076307..75c5eab 100644 --- a/server/services/agi/scripts/aws/polly/lib/api.js +++ b/server/services/agi/scripts/aws/polly/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x30a3=['exports','Polly','text','mp3','path','randomstring','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0x30a3,0xae));var _0x330a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x30a3[_0x14add3];return _0x4a174f;};'use strict';var fs=require('fs');var path=require(_0x330a('0x0'));var BPromise=require('bluebird');var rs=require(_0x330a('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x291a0d,_0x274ef5,_0x544429){return new BPromise(function(_0x188c89,_0x591be7){_0x291a0d[_0x330a('0x2')](_0x274ef5,function(_0x28e668,_0x4e659b){if(_0x28e668){_0x591be7(_0x28e668);}else if(_0x4e659b){if(_0x4e659b[_0x330a('0x3')]instanceof Buffer){fs[_0x330a('0x4')](_0x544429,_0x4e659b[_0x330a('0x3')],function(_0x4b5c61){if(_0x4b5c61){_0x591be7(_0x4b5c61);}else{_0x188c89();}});}else{_0x591be7(new Error(_0x330a('0x5')));}}else{_0x591be7(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x330a('0x6')]=function(_0x22bf71,_0x61b02b,_0x5ec230,_0x21c596,_0x34117d,_0x37866d,_0x531628){var _0x50b1a7=new AWS[(_0x330a('0x7'))]({'accessKeyId':_0x22bf71,'secretAccessKey':_0x61b02b,'region':_0x5ec230});var _0x3fabb6={'Text':_0x34117d,'TextType':_0x37866d||_0x330a('0x8'),'OutputFormat':_0x330a('0x9'),'VoiceId':_0x21c596};return pollyResult(_0x50b1a7,_0x3fabb6,_0x531628);}; \ No newline at end of file +var _0x67ba=['aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','bluebird','randomstring'];(function(_0x891b81,_0xfbb107){var _0x585932=function(_0x18e04d){while(--_0x18e04d){_0x891b81['push'](_0x891b81['shift']());}};_0x585932(++_0xfbb107);}(_0x67ba,0x189));var _0xa67b=function(_0x365137,_0x1d5e38){_0x365137=_0x365137-0x0;var _0x13bf73=_0x67ba[_0x365137];return _0x13bf73;};'use strict';var fs=require('fs');var path=require(_0xa67b('0x0'));var BPromise=require(_0xa67b('0x1'));var rs=require(_0xa67b('0x2'));var AWS=require(_0xa67b('0x3'));function pollyResult(_0x1df9e0,_0x1f4601,_0x3f849a){return new BPromise(function(_0x1889f4,_0x4a092d){_0x1df9e0[_0xa67b('0x4')](_0x1f4601,function(_0x42330a,_0x3b7eb7){if(_0x42330a){_0x4a092d(_0x42330a);}else if(_0x3b7eb7){if(_0x3b7eb7[_0xa67b('0x5')]instanceof Buffer){fs[_0xa67b('0x6')](_0x3f849a,_0x3b7eb7[_0xa67b('0x5')],function(_0x8be0d7){if(_0x8be0d7){_0x4a092d(_0x8be0d7);}else{_0x1889f4();}});}else{_0x4a092d(new Error(_0xa67b('0x7')));}}else{_0x4a092d(new Error(_0xa67b('0x8')));}});});}module[_0xa67b('0x9')]=function(_0x29d1ca,_0x26aae6,_0x5a4d99,_0x9e733d,_0x55e021,_0x39f23e,_0x5e8d59){var _0x53b7d6=new AWS['Polly']({'accessKeyId':_0x29d1ca,'secretAccessKey':_0x26aae6,'region':_0x5a4d99});var _0x2e7fea={'Text':_0x55e021,'TextType':_0x39f23e||_0xa67b('0xa'),'OutputFormat':_0xa67b('0xb'),'VoiceId':_0x9e733d};return pollyResult(_0x53b7d6,_0x2e7fea,_0x5e8d59);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/index.js b/server/services/agi/scripts/google/asr/index.js index 6f2f4c5..cb912b1 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x773d=['./lib/api','exports'];(function(_0x1dfb4b,_0x55461f){var _0xd06ce=function(_0x524aa8){while(--_0x524aa8){_0x1dfb4b['push'](_0x1dfb4b['shift']());}};_0xd06ce(++_0x55461f);}(_0x773d,0x7c));var _0xd773=function(_0x121ff4,_0x1a0659){_0x121ff4=_0x121ff4-0x0;var _0x24466b=_0x773d[_0x121ff4];return _0x24466b;};'use strict';var asr=require(_0xd773('0x0'));module[_0xd773('0x1')]=function(_0x2af3bf,_0x28c86c,_0x31c4ce,_0xdc130d){return asr(_0x2af3bf,_0x28c86c,_0x31c4ce);}; \ No newline at end of file +var _0xa011=['./lib/api','exports'];(function(_0x15b996,_0xc52e55){var _0x5d5715=function(_0x491f60){while(--_0x491f60){_0x15b996['push'](_0x15b996['shift']());}};_0x5d5715(++_0xc52e55);}(_0xa011,0x10a));var _0x1a01=function(_0x25566d,_0x4f16e4){_0x25566d=_0x25566d-0x0;var _0x52ba76=_0xa011[_0x25566d];return _0x52ba76;};'use strict';var asr=require(_0x1a01('0x0'));module[_0x1a01('0x1')]=function(_0x5ae430,_0xc3f0b2,_0x5cbe5b,_0x2823ec){return asr(_0x5ae430,_0xc3f0b2,_0x5cbe5b);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/lib/api.js b/server/services/agi/scripts/google/asr/lib/api.js index ac3c48a..dbc7a85 100644 --- a/server/services/agi/scripts/google/asr/lib/api.js +++ b/server/services/agi/scripts/google/asr/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf93=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','readFileSync','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf93,0x151));var _0x3af9=function(_0x255a0a,_0x4d809f){_0x255a0a=_0x255a0a-0x0;var _0xcb9924=_0xaf93[_0x255a0a];return _0xcb9924;};'use strict';var url=require(_0x3af9('0x0'));var BPromise=require(_0x3af9('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x13f5d7,_0x3e84b6,_0x528aa0){return new BPromise(function(_0x1319bc,_0x44ae6e){var _0x5add3;if(typeof _0x13f5d7!==_0x3af9('0x2')||_0x13f5d7[_0x3af9('0x3')]===0x0){return _0x44ae6e(_0x3af9('0x4'));}if(typeof _0x3e84b6!==_0x3af9('0x2')||_0x3e84b6['length']===0x0){return _0x44ae6e(_0x3af9('0x5'));}if(typeof _0x528aa0!=='undefined'&&(typeof _0x528aa0!==_0x3af9('0x2')||_0x528aa0['length']===0x0)){return _0x44ae6e('lang\x20should\x20be\x20a\x20string');}try{_0x5add3=fs[_0x3af9('0x6')](_0x13f5d7)['toString']('base64');}catch(_0x1313eb){return _0x44ae6e(_0x1313eb);}return _0x1319bc({'method':_0x3af9('0x7'),'uri':host+_0x3af9('0x8')+_0x3e84b6,'body':{'config':{'encoding':_0x3af9('0x9'),'sampleRateHertz':'8000','languageCode':_0x528aa0},'audio':{'content':_0x5add3}},'json':!![]});});}; \ No newline at end of file +var _0xb0d9=['filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','base64','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','length'];(function(_0x443d50,_0x2474b6){var _0x11dd9a=function(_0x4db14c){while(--_0x4db14c){_0x443d50['push'](_0x443d50['shift']());}};_0x11dd9a(++_0x2474b6);}(_0xb0d9,0x10c));var _0x9b0d=function(_0x4e6c98,_0x5bd874){_0x4e6c98=_0x4e6c98-0x0;var _0x4c0408=_0xb0d9[_0x4e6c98];return _0x4c0408;};'use strict';var url=require(_0x9b0d('0x0'));var BPromise=require(_0x9b0d('0x1'));var fs=require('fs');var host=_0x9b0d('0x2');module[_0x9b0d('0x3')]=function(_0x23ff60,_0x168bd9,_0x595212){return new BPromise(function(_0x201946,_0x5dd128){var _0x4d327a;if(typeof _0x23ff60!=='string'||_0x23ff60[_0x9b0d('0x4')]===0x0){return _0x5dd128(_0x9b0d('0x5'));}if(typeof _0x168bd9!==_0x9b0d('0x6')||_0x168bd9[_0x9b0d('0x4')]===0x0){return _0x5dd128(_0x9b0d('0x7'));}if(typeof _0x595212!==_0x9b0d('0x8')&&(typeof _0x595212!==_0x9b0d('0x6')||_0x595212[_0x9b0d('0x4')]===0x0)){return _0x5dd128(_0x9b0d('0x9'));}try{_0x4d327a=fs['readFileSync'](_0x23ff60)['toString'](_0x9b0d('0xa'));}catch(_0x76dc19){return _0x5dd128(_0x76dc19);}return _0x201946({'method':'POST','uri':host+_0x9b0d('0xb')+_0x168bd9,'body':{'config':{'encoding':_0x9b0d('0xc'),'sampleRateHertz':'8000','languageCode':_0x595212},'audio':{'content':_0x4d327a}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index 1eba820..7bcd359 100644 --- a/server/services/agi/scripts/google/index.js +++ b/server/services/agi/scripts/google/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x506f=['./asr'];(function(_0x452f32,_0x6e402d){var _0x4cc854=function(_0x24e3dd){while(--_0x24e3dd){_0x452f32['push'](_0x452f32['shift']());}};_0x4cc854(++_0x6e402d);}(_0x506f,0x183));var _0xf506=function(_0x4797e5,_0x3f3d5b){_0x4797e5=_0x4797e5-0x0;var _0x1c4fe5=_0x506f[_0x4797e5];return _0x1c4fe5;};var asr=require(_0xf506('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xdc26=['exports','./asr'];(function(_0x4de8d4,_0xacd354){var _0x151736=function(_0x10c5f3){while(--_0x10c5f3){_0x4de8d4['push'](_0x4de8d4['shift']());}};_0x151736(++_0xacd354);}(_0xdc26,0x191));var _0x6dc2=function(_0x2c7dc6,_0x3c4ce0){_0x2c7dc6=_0x2c7dc6-0x0;var _0x10002b=_0xdc26[_0x2c7dc6];return _0x10002b;};var asr=require(_0x6dc2('0x0'));module[_0x6dc2('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index ccb40f8..5c4926c 100644 --- a/server/services/agi/scripts/index.js +++ b/server/services/agi/scripts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7774=['finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','base64','then','777','split','googleCloudTTS','input','voice','audioConfig','MP3','resolve','.mp3','from','audioContent','writeFile','chmodSync','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','f.req=','stringify','generic','slice','parse\x20response\x20failed:\x0a','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','results','map','alternatives','transcript','confidence','catch','[%s]\x20%s:%s','name','message','textRequest','source','result','fulfillment','code','metadata','isFallbackIntent','replace','SessionsClient','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','https','md5','path','querystring','randomstring','sox','google-tts-api','url','util','./sestek','../../../config/logger','agi','protocol','https:','host','WHAT_EVER','request\x20to\x20','statusCode','statusMessage','\x20failed,\x20status\x20code\x20=\x20','finish','info','close','unlink','download\x20error','pipe','error','end','data','transcode','wav','error\x20convert'];(function(_0x3b9d25,_0x3d9c64){var _0x38a18e=function(_0x116aa6){while(--_0x116aa6){_0x3b9d25['push'](_0x3b9d25['shift']());}};_0x38a18e(++_0x3d9c64);}(_0x7774,0xdb));var _0x4777=function(_0x22868f,_0x450f48){_0x22868f=_0x22868f-0x0;var _0x97bc75=_0x7774[_0x22868f];return _0x97bc75;};'use strict';var apiai=require(_0x4777('0x0'));var BPromise=require(_0x4777('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x4777('0x2'));var https=require(_0x4777('0x3'));var md5=require(_0x4777('0x4'));var path=require(_0x4777('0x5'));var querystring=require(_0x4777('0x6'));var rp=require('request-promise');var rs=require(_0x4777('0x7'));var sox=require(_0x4777('0x8'));var tts=require(_0x4777('0x9'));var urlParse=require(_0x4777('0xa'))['parse'];var util=require(_0x4777('0xb'));var aws=require('./aws');var google=require('./google');var sestek=require(_0x4777('0xc'));var tilde=require('./tilde');var logger=require(_0x4777('0xd'))(_0x4777('0xe'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0xe06bc6,_0x1ab487){return new BPromise(function(_0x5723ee,_0x14663d){var _0xfe467=urlParse(_0xe06bc6);var _0x59bcb4=_0xfe467[_0x4777('0xf')]===_0x4777('0x10')?https:http;var _0x1a4deb={'host':_0xfe467[_0x4777('0x11')],'path':_0xfe467[_0x4777('0x5')],'headers':{'user-agent':_0x4777('0x12')}};_0x59bcb4['get'](_0x1a4deb,function(_0x2e82a4){if(_0x2e82a4['statusCode']!==0xc8){logger['error'](_0x4777('0x13')+_0xe06bc6+'\x20failed,\x20status\x20code\x20=\x20'+_0x2e82a4[_0x4777('0x14')]+'\x20('+_0x2e82a4[_0x4777('0x15')]+')');_0x14663d(new Error(_0x4777('0x13')+_0xe06bc6+_0x4777('0x16')+_0x2e82a4[_0x4777('0x14')]+'\x20('+_0x2e82a4[_0x4777('0x15')]+')'));return;}var _0x461414=fs['createWriteStream'](_0x1ab487);_0x461414['on'](_0x4777('0x17'),function(){logger[_0x4777('0x18')]('finish\x20download\x20file');_0x461414[_0x4777('0x19')](_0x5723ee);});_0x461414['on']('error',function(_0x40aab5){fs[_0x4777('0x1a')](_0x1ab487);logger['error'](_0x4777('0x1b'),_0x40aab5);_0x14663d(_0x40aab5);});_0x2e82a4[_0x4777('0x1c')](_0x461414);})['on'](_0x4777('0x1d'),function(_0x3aba2b){logger['error'](_0x3aba2b);_0x14663d(_0x3aba2b);})[_0x4777('0x1e')]();});}function uploadFile(_0x1b5c28){return new BPromise(function(_0x1d6c64,_0x1ce8f3){var _0x4f0fb7=urlParse(_0x1b5c28);var _0x260d13=_0x4f0fb7[_0x4777('0xf')]===_0x4777('0x10')?https:http;var _0x556a3a={'host':_0x4f0fb7['host'],'path':_0x4f0fb7['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x260d13['get'](_0x556a3a,function(_0xede5a1){if(_0xede5a1[_0x4777('0x14')]!==0xc8){_0x1ce8f3(new Error('request\x20to\x20'+_0x1b5c28+'\x20failed,\x20status\x20code\x20=\x20'+_0xede5a1[_0x4777('0x14')]+'\x20('+_0xede5a1[_0x4777('0x15')]+')'));return;}var _0x573225='';_0xede5a1['on'](_0x4777('0x1f'),function(_0x46a390){_0x573225+=_0x46a390;});_0xede5a1['on'](_0x4777('0x1e'),function(){_0x1d6c64(_0x573225);});})['on']('error',function(_0x4f4c55){_0x1ce8f3(_0x4f4c55);})['end']();});}function convertFile(_0x1d5dbc,_0xc7f59a){return new BPromise(function(_0x300558,_0xbbcdb2){var _0x3f76d5=sox[_0x4777('0x20')](_0x1d5dbc,_0xc7f59a,{'sampleRate':0x1f40,'format':_0x4777('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3f76d5['on'](_0x4777('0x1d'),function(_0x31d3cb){logger[_0x4777('0x1d')](_0x4777('0x22'),_0x31d3cb);_0xbbcdb2(_0x31d3cb);});_0x3f76d5['on'](_0x4777('0x1e'),function(){logger[_0x4777('0x18')](_0x4777('0x23'));_0x300558();});_0x3f76d5[_0x4777('0x24')]();});}function base64Decode(_0x562e5d,_0x26e708){var _0x3d1dfd=path['resolve'](__dirname,_0x4777('0x25'),rs[_0x4777('0x26')](0x4)+_0x4777('0x27'));fs[_0x4777('0x28')](_0x3d1dfd,_0x562e5d,_0x4777('0x29'));return convertFile(_0x3d1dfd,_0x26e708)[_0x4777('0x2a')](function(){try{fs[_0x4777('0x1a')](_0x3d1dfd);fs['chmodSync'](_0x26e708,_0x4777('0x2b'));}catch(_0x1a322c){logger['error'](_0x1a322c);}return _0x26e708[_0x4777('0x2c')]('.')[0x0];});}function base64Encode(_0x3d15ee){var _0x25faee=fs['readFileSync'](_0x3d15ee);return new Buffer(_0x25faee)['toString'](_0x4777('0x29'));}exports[_0x4777('0x2d')]=function(_0x5e10aa,_0x5f0aaf,_0x22f68c,_0x5654c1,_0x37cd7c,_0x21d49f){var _0x21f804,_0x206406;var _0xc4ffff='https://texttospeech.googleapis.com/v1/';var _0x4edc8b='?key='+_0x5e10aa;var _0x152a70={};if(_0x5f0aaf==='ssml'){_0x152a70[_0x4777('0x2e')]={'ssml':_0x22f68c};}else{_0x152a70['input']={'text':_0x22f68c};};_0x152a70[_0x4777('0x2f')]={'languageCode':_0x5654c1,'ssmlGender':_0x37cd7c};_0x152a70[_0x4777('0x30')]={'audioEncoding':_0x4777('0x31'),'sampleRateHertz':0x1f40};var _0x4280e4={'url':_0xc4ffff+'text:synthesize'+_0x4edc8b,'method':'POST','json':!![],'body':_0x152a70};return rp(_0x4280e4)[_0x4777('0x2a')](function(_0x1ca0a9){return new BPromise(function(_0xdc8c65,_0x393039){_0x21f804=path[_0x4777('0x32')](__dirname,'tmp',rs[_0x4777('0x26')](0x4)+_0x4777('0x33'));var _0x3a5636=Buffer[_0x4777('0x34')](_0x1ca0a9[_0x4777('0x35')],_0x4777('0x29'));return fs[_0x4777('0x36')](_0x21f804,_0x3a5636,function(_0x31143b){_0x393039(_0x31143b);},function(_0x54ede7){fs[_0x4777('0x37')](_0x21f804,_0x4777('0x2b'));_0xdc8c65(_0x54ede7);});});})[_0x4777('0x2a')](function(_0x5ce5dd){_0x206406=path['resolve'](__dirname,_0x4777('0x25'),rs[_0x4777('0x26')](0x4)+_0x4777('0x27'));return convertFile(_0x21f804,_0x206406);})[_0x4777('0x2a')](function(){try{fs[_0x4777('0x1a')](_0x21f804);fs[_0x4777('0x37')](_0x206406,_0x4777('0x2b'));}catch(_0x59b451){logger[_0x4777('0x1d')](_0x59b451);}logger[_0x4777('0x18')](_0x4777('0x38'),_0x206406[_0x4777('0x2c')]('.')[0x0]);return _0x206406['split']('.')[0x0];});};exports[_0x4777('0x39')]=function(_0x262c6a,_0x2af386){var _0x466f94=_0x4777('0x3a');var _0x528af1,_0x420788;var _0xa6a184;var _0x2a2956={'encoding':_0x4777('0x3b'),'method':_0x4777('0x3c'),'timeout':0x2710,'url':_0x466f94,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x4777('0x3d')+encodeURIComponent(JSON[_0x4777('0x3e')]([[['jQ1olc',JSON[_0x4777('0x3e')]([_0x262c6a,_0x2af386||'en',![],'null']),null,_0x4777('0x3f')]]]))};return rp(_0x2a2956)['then'](function(_0x512046){try{_0xa6a184=eval(_0x512046[_0x4777('0x40')](0x5))[0x0][0x2];}catch(_0x4046cf){throw new Error(_0x4777('0x41')+_0x512046[_0x4777('0x1f')]);}if(!_0xa6a184){if(_0x262c6a['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x4777('0x42')+_0x2af386+_0x4777('0x43'));}}try{_0xa6a184=eval(_0xa6a184)[0x0];}catch(_0x4c16ac){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x4777('0x1f')]);}const _0x35c9a1=_0xa6a184;_0x528af1=path['resolve'](__dirname,_0x4777('0x25'),rs['generate'](0x4)+_0x4777('0x33'));fs['writeFileSync'](_0x528af1,_0xa6a184,{'encoding':_0x4777('0x29')});_0x420788=path[_0x4777('0x32')](__dirname,_0x4777('0x25'),rs[_0x4777('0x26')](0x4)+_0x4777('0x27'));return convertFile(_0x528af1,_0x420788);})['then'](function(){try{fs[_0x4777('0x1a')](_0x528af1);fs['chmodSync'](_0x420788,_0x4777('0x2b'));}catch(_0x2bafe7){logger['error'](_0x2bafe7);}logger['info'](_0x4777('0x44'),_0x420788[_0x4777('0x2c')]('.')[0x0]);return _0x420788[_0x4777('0x2c')]('.')[0x0];});};exports[_0x4777('0x45')]=function(_0x1c14e5,_0x288794,_0x4bae69){return google['asr'](_0x1c14e5,_0x288794,_0x4bae69)[_0x4777('0x2a')](function(_0x4bb597){logger[_0x4777('0x18')](_0x4bb597['uri']);return rp(_0x4bb597);})[_0x4777('0x2a')](function(_0x9eeef0){var _0x5097c9='';var _0xe6a97c=0x0;try{fs[_0x4777('0x1a')](_0x1c14e5);}catch(_0x134069){logger['error'](_0x134069);}if(_0x9eeef0&&_0x9eeef0[_0x4777('0x46')]){_0x5097c9=_0x9eeef0['results'][_0x4777('0x47')](function(_0x4e82b8){return _0x4e82b8&&_0x4e82b8[_0x4777('0x48')][0x0]&&_0x4e82b8[_0x4777('0x48')][0x0][_0x4777('0x49')]?_0x4e82b8[_0x4777('0x48')][0x0][_0x4777('0x49')]:'';})['join']('\x0a');_0xe6a97c=_0x9eeef0['results']['map'](function(_0x17510b){return _0x17510b&&_0x17510b[_0x4777('0x48')][0x0]&&_0x17510b[_0x4777('0x48')][0x0][_0x4777('0x4a')]?_0x17510b[_0x4777('0x48')][0x0][_0x4777('0x4a')]:0x0;})['join']('\x0a');}logger['info']('googleASR\x20transcription',_0x5097c9);logger[_0x4777('0x18')]('googleASR\x20confidence',_0xe6a97c);return{'transcript':_0x5097c9,'confidence':_0xe6a97c};})[_0x4777('0x4b')](function(_0x1df139){logger[_0x4777('0x1d')](_0x4777('0x4c'),_0x1df139[_0x4777('0x14')],_0x1df139[_0x4777('0x4d')],_0x1df139[_0x4777('0x4e')]);});};exports['googleDialogflow']=function(_0x251fbe,_0x2b3e1a,_0x5cd476,_0x1af3b2){var _0x55cf7f=apiai(_0x2b3e1a,{'language':_0x1af3b2||'en'});return _0x55cf7f[_0x4777('0x4f')](_0x5cd476,{'sessionId':md5(_0x251fbe)})[_0x4777('0x2a')](function(_0x21c1fa){logger[_0x4777('0x18')](JSON[_0x4777('0x3e')](_0x21c1fa));return{'source':_0x21c1fa['result'][_0x4777('0x50')],'resolvedQuery':_0x21c1fa[_0x4777('0x51')]['resolvedQuery'],'action':_0x21c1fa[_0x4777('0x51')]['action'],'actionIncomplete':_0x21c1fa['result']['actionIncomplete'],'speech':_0x21c1fa[_0x4777('0x51')][_0x4777('0x52')]['speech'],'score':_0x21c1fa[_0x4777('0x51')]['score'],'statusCode':_0x21c1fa['status'][_0x4777('0x53')],'endConversation':_0x21c1fa[_0x4777('0x51')][_0x4777('0x54')]['endConversation']||![],'isFallbackIntent':_0x21c1fa[_0x4777('0x51')][_0x4777('0x54')][_0x4777('0x55')]};});};exports['googleDialogflowV2']=function(_0x4353d4,_0x269bb8,_0xd6da4d,_0x16d9ea,_0x4e4c5d,_0x24506f){var _0x1dcab3=_0x16d9ea[_0x4777('0x56')](/\\n/g,'\x0a');var _0x4504ac={'credentials':{'private_key':_0x1dcab3,'client_email':_0xd6da4d}};var _0x4862a0=new dialogflow[(_0x4777('0x57'))](_0x4504ac);var _0x2a55ea=_0x4862a0[_0x4777('0x58')](_0x269bb8,md5(_0x4353d4));var _0x5cf821={'session':_0x2a55ea,'queryInput':{'text':{'text':_0x4e4c5d,'languageCode':_0x24506f}}};return _0x4862a0[_0x4777('0x59')](_0x5cf821)[_0x4777('0x2a')](function(_0xa4a78d){if(_0xa4a78d&&_0xa4a78d[_0x4777('0x5a')]){logger[_0x4777('0x18')](_0x4777('0x5b'),JSON[_0x4777('0x3e')](_0xa4a78d));var _0x21a04e=_0xa4a78d[0x0];if(_0x21a04e){var _0x14c60f={'action':_0x21a04e[_0x4777('0x5c')]['action'],'allRequiredParamsPresent':_0x21a04e['queryResult']['allRequiredParamsPresent'],'endConversation':_0x21a04e[_0x4777('0x5c')][_0x4777('0x5d')]&&_0x21a04e['queryResult'][_0x4777('0x5d')]['fields']?_0x21a04e[_0x4777('0x5c')][_0x4777('0x5d')]['fields'][_0x4777('0x5e')][_0x4777('0x5f')]:![],'fulfillmentText':_0x21a04e[_0x4777('0x5c')][_0x4777('0x60')],'intentName':_0x21a04e[_0x4777('0x5c')][_0x4777('0x61')]['name'],'intentDisplayName':_0x21a04e[_0x4777('0x5c')][_0x4777('0x61')][_0x4777('0x62')],'isFallbackIntent':_0x21a04e[_0x4777('0x5c')]['intent'][_0x4777('0x63')],'languageCode':_0x21a04e[_0x4777('0x5c')][_0x4777('0x64')],'queryText':_0x21a04e['queryResult'][_0x4777('0x65')],'responseId':_0x21a04e[_0x4777('0x66')],'score':_0x21a04e['queryResult']['intentDetectionConfidence'],'speech':_0x21a04e['queryResult'][_0x4777('0x60')],'providerResponse':JSON['stringify'](_0xa4a78d)};return _0x14c60f;}}});};exports[_0x4777('0x67')]=function(_0x46da40,_0x651aa,_0x332e5c,_0x3fe464){return tilde[_0x4777('0x68')](_0x46da40,_0x651aa,_0x332e5c,_0x3fe464)[_0x4777('0x2a')](function(_0x3bf479){try{fs[_0x4777('0x1a')](_0x46da40);}catch(_0xf9432){logger[_0x4777('0x1d')](_0xf9432);}logger['info'](_0x4777('0x69'),_0x3bf479[_0x4777('0x49')]);logger[_0x4777('0x18')](_0x4777('0x6a'),_0x3bf479[_0x4777('0x4a')]);return _0x3bf479;});};exports['awsPolly']=function(_0x510c45,_0x221566,_0xef1761,_0x30e4fa,_0x46be70,_0x5e36f1){var _0x262492=path[_0x4777('0x32')](__dirname,_0x4777('0x25'),rs[_0x4777('0x26')](0x4)+_0x4777('0x33'));var _0x2a9f8b;return aws['polly'](_0x510c45,_0x221566,_0xef1761,_0x30e4fa,_0x46be70,_0x5e36f1,_0x262492)[_0x4777('0x2a')](function(){_0x2a9f8b=path[_0x4777('0x32')](__dirname,'tmp',rs[_0x4777('0x26')](0x4)+'.wav');return convertFile(_0x262492,_0x2a9f8b);})['then'](function(){try{fs[_0x4777('0x1a')](_0x262492);fs['chmodSync'](_0x2a9f8b,'777');}catch(_0x250ab2){logger[_0x4777('0x1d')](_0x250ab2);}return _0x2a9f8b[_0x4777('0x2c')]('.')[0x0];});};exports[_0x4777('0x6b')]=function(_0x5aa80d,_0x28a9da,_0x32d5a2,_0x2d2e59,_0x48ea14,_0x4d0e40){return aws[_0x4777('0x6c')](_0x5aa80d,_0x28a9da,_0x32d5a2,_0x2d2e59,_0x48ea14,_0x4d0e40)[_0x4777('0x2a')](function(_0x443d33){logger[_0x4777('0x18')](JSON[_0x4777('0x3e')](_0x443d33));return _0x443d33;});};exports[_0x4777('0x6d')]=function(_0x2d663c,_0x46f911,_0x39a84a,_0x2bbc62){var _0x3d3a28=util[_0x4777('0x6e')](_0x4777('0x6f'),ISPEECH_API,_0x2d663c,encodeURIComponent(_0x46f911),_0x39a84a,_0x2bbc62);var _0x47368a=path[_0x4777('0x32')](__dirname,_0x4777('0x25'),rs[_0x4777('0x26')](0x4)+_0x4777('0x33'));var _0x6e739d;return downloadFile(_0x3d3a28,_0x47368a)[_0x4777('0x2a')](function(){_0x6e739d=path[_0x4777('0x32')](__dirname,_0x4777('0x25'),rs[_0x4777('0x26')](0x4)+_0x4777('0x27'));return convertFile(_0x47368a,_0x6e739d);})['then'](function(){try{fs[_0x4777('0x1a')](_0x47368a);fs[_0x4777('0x37')](_0x6e739d,_0x4777('0x2b'));}catch(_0x2d028c){logger[_0x4777('0x1d')](_0x2d028c);}return _0x6e739d['split']('.')[0x0];});};exports[_0x4777('0x70')]=function(_0x139bd1,_0x453c56,_0x4fb99c,_0x4b551d){var _0x2a6289=util['format'](_0x4777('0x71'),ISPEECH_API,_0x453c56,_0x4fb99c,base64Encode(_0x139bd1),_0x4b551d?util[_0x4777('0x6e')](_0x4777('0x72'),encodeURIComponent(_0x4b551d)):_0x4777('0x73'));return uploadFile(_0x2a6289)['then'](function(_0x3d23c5){return querystring[_0x4777('0x74')](_0x3d23c5);});};exports[_0x4777('0x75')]=function(_0x2fee53,_0xfbf602){return sestek[_0x4777('0x76')](_0x2fee53,_0xfbf602)[_0x4777('0x2a')](function(_0x15e034){logger[_0x4777('0x18')](JSON[_0x4777('0x3e')](_0x15e034));var _0x52c58d={'speech':_0x15e034[_0x4777('0x77')],'action':_0x15e034[_0x4777('0x78')]?_0x15e034[_0x4777('0x78')][_0x4777('0x79')]:undefined,'actiondata':_0x15e034[_0x4777('0x78')]?_0x15e034[_0x4777('0x78')][_0x4777('0x7a')]:undefined};if(_0x15e034[_0x4777('0x78')]&&_0x15e034[_0x4777('0x78')][_0x4777('0x7b')]){return base64Decode(_0x15e034[_0x4777('0x78')]['AudioFromTts'][_0x4777('0x7c')],path[_0x4777('0x32')](__dirname,'tmp',rs[_0x4777('0x26')](0x4)+'.wav'))[_0x4777('0x2a')](function(_0x32a6dc){_0x52c58d[_0x4777('0x7d')]=_0x32a6dc;return _0x52c58d;});}return _0x52c58d;});};exports[_0x4777('0x7e')]=function(){return __dirname;}; \ No newline at end of file +var _0x236a=['allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','intent','displayName','isFallback','queryText','responseId','fulfillmentText','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','bluebird','dialogflow','https','querystring','request-promise','randomstring','sox','parse','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','path','WHAT_EVER','statusCode','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','error','unlink','pipe','get','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','resolve','tmp','.wav','writeFileSync','base64','then','chmodSync','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','text:synthesize','POST','generate','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','split','googleTTS','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','generic','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','textRequest','result','resolvedQuery','actionIncomplete','fulfillment','speech','status','code','endConversation','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult'];(function(_0x47e03f,_0xe9ef14){var _0x26575b=function(_0x5cc580){while(--_0x5cc580){_0x47e03f['push'](_0x47e03f['shift']());}};_0x26575b(++_0xe9ef14);}(_0x236a,0x11a));var _0xa236=function(_0x159d53,_0x57fdfd){_0x159d53=_0x159d53-0x0;var _0x2895b7=_0x236a[_0x159d53];return _0x2895b7;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xa236('0x0'));var dialogflow=require(_0xa236('0x1'));var fs=require('fs');var http=require('http');var https=require(_0xa236('0x2'));var md5=require('md5');var path=require('path');var querystring=require(_0xa236('0x3'));var rp=require(_0xa236('0x4'));var rs=require(_0xa236('0x5'));var sox=require(_0xa236('0x6'));var tts=require('google-tts-api');var urlParse=require('url')[_0xa236('0x7')];var util=require('util');var aws=require('./aws');var google=require(_0xa236('0x8'));var sestek=require(_0xa236('0x9'));var tilde=require(_0xa236('0xa'));var logger=require(_0xa236('0xb'))(_0xa236('0xc'));var ISPEECH_API=_0xa236('0xd');function downloadFile(_0x1a9fdc,_0x35721d){return new BPromise(function(_0x3da635,_0x3be6f5){var _0x25d0f3=urlParse(_0x1a9fdc);var _0x9240f6=_0x25d0f3[_0xa236('0xe')]===_0xa236('0xf')?https:http;var _0x5d5e34={'host':_0x25d0f3[_0xa236('0x10')],'path':_0x25d0f3[_0xa236('0x11')],'headers':{'user-agent':_0xa236('0x12')}};_0x9240f6['get'](_0x5d5e34,function(_0x1308c3){if(_0x1308c3[_0xa236('0x13')]!==0xc8){logger['error'](_0xa236('0x14')+_0x1a9fdc+'\x20failed,\x20status\x20code\x20=\x20'+_0x1308c3[_0xa236('0x13')]+'\x20('+_0x1308c3[_0xa236('0x15')]+')');_0x3be6f5(new Error('request\x20to\x20'+_0x1a9fdc+_0xa236('0x16')+_0x1308c3[_0xa236('0x13')]+'\x20('+_0x1308c3[_0xa236('0x15')]+')'));return;}var _0x147678=fs[_0xa236('0x17')](_0x35721d);_0x147678['on'](_0xa236('0x18'),function(){logger[_0xa236('0x19')]('finish\x20download\x20file');_0x147678['close'](_0x3da635);});_0x147678['on'](_0xa236('0x1a'),function(_0x35d306){fs[_0xa236('0x1b')](_0x35721d);logger['error']('download\x20error',_0x35d306);_0x3be6f5(_0x35d306);});_0x1308c3[_0xa236('0x1c')](_0x147678);})['on']('error',function(_0x30bfb2){logger[_0xa236('0x1a')](_0x30bfb2);_0x3be6f5(_0x30bfb2);})['end']();});}function uploadFile(_0x93df5d){return new BPromise(function(_0x31e821,_0x568c0f){var _0x10abcf=urlParse(_0x93df5d);var _0x375340=_0x10abcf[_0xa236('0xe')]===_0xa236('0xf')?https:http;var _0x131008={'host':_0x10abcf[_0xa236('0x10')],'path':_0x10abcf[_0xa236('0x11')],'headers':{'user-agent':_0xa236('0x12')}};_0x375340[_0xa236('0x1d')](_0x131008,function(_0x20949c){if(_0x20949c[_0xa236('0x13')]!==0xc8){_0x568c0f(new Error(_0xa236('0x14')+_0x93df5d+_0xa236('0x16')+_0x20949c[_0xa236('0x13')]+'\x20('+_0x20949c[_0xa236('0x15')]+')'));return;}var _0x520af4='';_0x20949c['on'](_0xa236('0x1e'),function(_0x53bedf){_0x520af4+=_0x53bedf;});_0x20949c['on'](_0xa236('0x1f'),function(){_0x31e821(_0x520af4);});})['on'](_0xa236('0x1a'),function(_0x4f4898){_0x568c0f(_0x4f4898);})[_0xa236('0x1f')]();});}function convertFile(_0x1b46b2,_0x2663b6){return new BPromise(function(_0x5854c0,_0x21ea2c){var _0x43be40=sox[_0xa236('0x20')](_0x1b46b2,_0x2663b6,{'sampleRate':0x1f40,'format':_0xa236('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x43be40['on'](_0xa236('0x1a'),function(_0x367e2b){logger[_0xa236('0x1a')](_0xa236('0x22'),_0x367e2b);_0x21ea2c(_0x367e2b);});_0x43be40['on']('end',function(){logger[_0xa236('0x19')](_0xa236('0x23'));_0x5854c0();});_0x43be40['start']();});}function base64Decode(_0x260e30,_0x48e45d){var _0x5ee4df=path[_0xa236('0x24')](__dirname,_0xa236('0x25'),rs['generate'](0x4)+_0xa236('0x26'));fs[_0xa236('0x27')](_0x5ee4df,_0x260e30,_0xa236('0x28'));return convertFile(_0x5ee4df,_0x48e45d)[_0xa236('0x29')](function(){try{fs[_0xa236('0x1b')](_0x5ee4df);fs[_0xa236('0x2a')](_0x48e45d,_0xa236('0x2b'));}catch(_0x35ffd9){logger[_0xa236('0x1a')](_0x35ffd9);}return _0x48e45d['split']('.')[0x0];});}function base64Encode(_0x267bf1){var _0x2156d9=fs[_0xa236('0x2c')](_0x267bf1);return new Buffer(_0x2156d9)[_0xa236('0x2d')](_0xa236('0x28'));}exports[_0xa236('0x2e')]=function(_0xe69d9b,_0x47722e,_0xe0bee6,_0x1efb4f,_0x1ffafb,_0x1b0365){var _0x1b1d73,_0x17e77e;var _0x159915=_0xa236('0x2f');var _0x4f2464=_0xa236('0x30')+_0xe69d9b;var _0x3e2c3a={};if(_0x47722e==='ssml'){_0x3e2c3a[_0xa236('0x31')]={'ssml':_0xe0bee6};}else{_0x3e2c3a['input']={'text':_0xe0bee6};};_0x3e2c3a['voice']={'languageCode':_0x1efb4f,'ssmlGender':_0x1ffafb};_0x3e2c3a['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x1087d0={'url':_0x159915+_0xa236('0x32')+_0x4f2464,'method':_0xa236('0x33'),'json':!![],'body':_0x3e2c3a};return rp(_0x1087d0)[_0xa236('0x29')](function(_0x41f3bf){return new BPromise(function(_0x461fbc,_0x154205){_0x1b1d73=path[_0xa236('0x24')](__dirname,_0xa236('0x25'),rs[_0xa236('0x34')](0x4)+_0xa236('0x35'));var _0x36639a=Buffer[_0xa236('0x36')](_0x41f3bf[_0xa236('0x37')],_0xa236('0x28'));return fs[_0xa236('0x38')](_0x1b1d73,_0x36639a,function(_0x1a7c5a){_0x154205(_0x1a7c5a);},function(_0x295328){fs[_0xa236('0x2a')](_0x1b1d73,_0xa236('0x2b'));_0x461fbc(_0x295328);});});})[_0xa236('0x29')](function(_0x11d51d){_0x17e77e=path['resolve'](__dirname,_0xa236('0x25'),rs[_0xa236('0x34')](0x4)+'.wav');return convertFile(_0x1b1d73,_0x17e77e);})['then'](function(){try{fs[_0xa236('0x1b')](_0x1b1d73);fs[_0xa236('0x2a')](_0x17e77e,_0xa236('0x2b'));}catch(_0xd5f0ca){logger[_0xa236('0x1a')](_0xd5f0ca);}logger[_0xa236('0x19')](_0xa236('0x39'),_0x17e77e[_0xa236('0x3a')]('.')[0x0]);return _0x17e77e[_0xa236('0x3a')]('.')[0x0];});};exports[_0xa236('0x3b')]=function(_0x7aa177,_0x52ed25){var _0x57037a='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x1287fa,_0x51c58c;var _0x158462;var _0x372ebb={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x57037a,'headers':{'Content-Type':_0xa236('0x3c')},'body':_0xa236('0x3d')+encodeURIComponent(JSON['stringify']([[[_0xa236('0x3e'),JSON[_0xa236('0x3f')]([_0x7aa177,_0x52ed25||'en',![],'null']),null,_0xa236('0x40')]]]))};return rp(_0x372ebb)[_0xa236('0x29')](function(_0x3657cc){try{_0x158462=eval(_0x3657cc[_0xa236('0x41')](0x5))[0x0][0x2];}catch(_0x33acb2){throw new Error(_0xa236('0x42')+_0x3657cc[_0xa236('0x1e')]);}if(!_0x158462){if(_0x7aa177['length']>0xc8){throw new Error(_0xa236('0x43'));}else{throw new Error('lang\x20\x22'+_0x52ed25+_0xa236('0x44'));}}try{_0x158462=eval(_0x158462)[0x0];}catch(_0x173db6){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x1bcb7a=_0x158462;_0x1287fa=path[_0xa236('0x24')](__dirname,_0xa236('0x25'),rs[_0xa236('0x34')](0x4)+_0xa236('0x35'));fs[_0xa236('0x27')](_0x1287fa,_0x158462,{'encoding':_0xa236('0x28')});_0x51c58c=path[_0xa236('0x24')](__dirname,_0xa236('0x25'),rs[_0xa236('0x34')](0x4)+'.wav');return convertFile(_0x1287fa,_0x51c58c);})[_0xa236('0x29')](function(){try{fs['unlink'](_0x1287fa);fs['chmodSync'](_0x51c58c,_0xa236('0x2b'));}catch(_0x1b81f4){logger[_0xa236('0x1a')](_0x1b81f4);}logger[_0xa236('0x19')]('goggleTTS\x20path',_0x51c58c['split']('.')[0x0]);return _0x51c58c[_0xa236('0x3a')]('.')[0x0];});};exports[_0xa236('0x45')]=function(_0xa83a28,_0x570d20,_0xadb438){return google[_0xa236('0x46')](_0xa83a28,_0x570d20,_0xadb438)[_0xa236('0x29')](function(_0x1c5c89){logger['info'](_0x1c5c89['uri']);return rp(_0x1c5c89);})['then'](function(_0x4598b8){var _0x1db54b='';var _0x24befd=0x0;try{fs[_0xa236('0x1b')](_0xa83a28);}catch(_0x1a268c){logger[_0xa236('0x1a')](_0x1a268c);}if(_0x4598b8&&_0x4598b8[_0xa236('0x47')]){_0x1db54b=_0x4598b8['results'][_0xa236('0x48')](function(_0x3748ea){return _0x3748ea&&_0x3748ea[_0xa236('0x49')][0x0]&&_0x3748ea[_0xa236('0x49')][0x0][_0xa236('0x4a')]?_0x3748ea[_0xa236('0x49')][0x0][_0xa236('0x4a')]:'';})[_0xa236('0x4b')]('\x0a');_0x24befd=_0x4598b8[_0xa236('0x47')][_0xa236('0x48')](function(_0x4e3bea){return _0x4e3bea&&_0x4e3bea[_0xa236('0x49')][0x0]&&_0x4e3bea[_0xa236('0x49')][0x0]['confidence']?_0x4e3bea['alternatives'][0x0][_0xa236('0x4c')]:0x0;})['join']('\x0a');}logger[_0xa236('0x19')](_0xa236('0x4d'),_0x1db54b);logger[_0xa236('0x19')](_0xa236('0x4e'),_0x24befd);return{'transcript':_0x1db54b,'confidence':_0x24befd};})[_0xa236('0x4f')](function(_0x27873b){logger[_0xa236('0x1a')]('[%s]\x20%s:%s',_0x27873b[_0xa236('0x13')],_0x27873b[_0xa236('0x50')],_0x27873b[_0xa236('0x51')]);});};exports['googleDialogflow']=function(_0x51923d,_0x18e34c,_0x1b2f1d,_0x323ede){var _0x4c73a9=apiai(_0x18e34c,{'language':_0x323ede||'en'});return _0x4c73a9[_0xa236('0x52')](_0x1b2f1d,{'sessionId':md5(_0x51923d)})[_0xa236('0x29')](function(_0x26ed48){logger[_0xa236('0x19')](JSON['stringify'](_0x26ed48));return{'source':_0x26ed48[_0xa236('0x53')]['source'],'resolvedQuery':_0x26ed48[_0xa236('0x53')][_0xa236('0x54')],'action':_0x26ed48['result']['action'],'actionIncomplete':_0x26ed48[_0xa236('0x53')][_0xa236('0x55')],'speech':_0x26ed48[_0xa236('0x53')][_0xa236('0x56')][_0xa236('0x57')],'score':_0x26ed48[_0xa236('0x53')]['score'],'statusCode':_0x26ed48[_0xa236('0x58')][_0xa236('0x59')],'endConversation':_0x26ed48[_0xa236('0x53')]['metadata'][_0xa236('0x5a')]||![],'isFallbackIntent':_0x26ed48[_0xa236('0x53')]['metadata'][_0xa236('0x5b')]};});};exports[_0xa236('0x5c')]=function(_0x32bfcb,_0x580872,_0x811678,_0x5d28fb,_0x48292a,_0x4874c6){var _0xeafac7=_0x5d28fb[_0xa236('0x5d')](/\\n/g,'\x0a');var _0x36afe8={'credentials':{'private_key':_0xeafac7,'client_email':_0x811678}};var _0x4d1393=new dialogflow['SessionsClient'](_0x36afe8);var _0x5b2e04=_0x4d1393[_0xa236('0x5e')](_0x580872,md5(_0x32bfcb));var _0xb2b47f={'session':_0x5b2e04,'queryInput':{'text':{'text':_0x48292a,'languageCode':_0x4874c6}}};return _0x4d1393[_0xa236('0x5f')](_0xb2b47f)[_0xa236('0x29')](function(_0x5e7956){if(_0x5e7956&&_0x5e7956[_0xa236('0x60')]){logger['info'](_0xa236('0x61'),JSON['stringify'](_0x5e7956));var _0xefe5be=_0x5e7956[0x0];if(_0xefe5be){var _0x465097={'action':_0xefe5be[_0xa236('0x62')]['action'],'allRequiredParamsPresent':_0xefe5be[_0xa236('0x62')][_0xa236('0x63')],'endConversation':_0xefe5be['queryResult'][_0xa236('0x64')]&&_0xefe5be[_0xa236('0x62')][_0xa236('0x64')][_0xa236('0x65')]?_0xefe5be['queryResult'][_0xa236('0x64')][_0xa236('0x65')][_0xa236('0x66')]['boolValue']:![],'fulfillmentText':_0xefe5be[_0xa236('0x62')]['fulfillmentText'],'intentName':_0xefe5be[_0xa236('0x62')][_0xa236('0x67')][_0xa236('0x50')],'intentDisplayName':_0xefe5be['queryResult'][_0xa236('0x67')][_0xa236('0x68')],'isFallbackIntent':_0xefe5be[_0xa236('0x62')]['intent'][_0xa236('0x69')],'languageCode':_0xefe5be['queryResult']['languageCode'],'queryText':_0xefe5be[_0xa236('0x62')][_0xa236('0x6a')],'responseId':_0xefe5be[_0xa236('0x6b')],'score':_0xefe5be[_0xa236('0x62')]['intentDetectionConfidence'],'speech':_0xefe5be['queryResult'][_0xa236('0x6c')],'providerResponse':JSON[_0xa236('0x3f')](_0x5e7956)};return _0x465097;}}});};exports[_0xa236('0x6d')]=function(_0x1a1cde,_0x2c5a41,_0x550883,_0x22a5a7){return tilde[_0xa236('0x46')](_0x1a1cde,_0x2c5a41,_0x550883,_0x22a5a7)[_0xa236('0x29')](function(_0x3a8d){try{fs[_0xa236('0x1b')](_0x1a1cde);}catch(_0x535a9d){logger[_0xa236('0x1a')](_0x535a9d);}logger['info']('Tilde\x20ASR\x20transcription',_0x3a8d['transcript']);logger[_0xa236('0x19')](_0xa236('0x6e'),_0x3a8d[_0xa236('0x4c')]);return _0x3a8d;});};exports[_0xa236('0x6f')]=function(_0x2d7165,_0x164b5d,_0x141c3b,_0x19b5c0,_0x3c3f26,_0x49a6b7){var _0x4bfcc5=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xa236('0x35'));var _0x5d2103;return aws[_0xa236('0x70')](_0x2d7165,_0x164b5d,_0x141c3b,_0x19b5c0,_0x3c3f26,_0x49a6b7,_0x4bfcc5)[_0xa236('0x29')](function(){_0x5d2103=path['resolve'](__dirname,_0xa236('0x25'),rs[_0xa236('0x34')](0x4)+'.wav');return convertFile(_0x4bfcc5,_0x5d2103);})[_0xa236('0x29')](function(){try{fs[_0xa236('0x1b')](_0x4bfcc5);fs[_0xa236('0x2a')](_0x5d2103,_0xa236('0x2b'));}catch(_0x198c97){logger['error'](_0x198c97);}return _0x5d2103['split']('.')[0x0];});};exports[_0xa236('0x71')]=function(_0x34b0c4,_0x187d78,_0x5bf142,_0x48db63,_0x3168a8,_0xff1a13){return aws[_0xa236('0x72')](_0x34b0c4,_0x187d78,_0x5bf142,_0x48db63,_0x3168a8,_0xff1a13)[_0xa236('0x29')](function(_0x2228ad){logger['info'](JSON[_0xa236('0x3f')](_0x2228ad));return _0x2228ad;});};exports['ispeechTTS']=function(_0x54a23b,_0x417c2d,_0xfff0e5,_0x9fee43){var _0x104d55=util['format'](_0xa236('0x73'),ISPEECH_API,_0x54a23b,encodeURIComponent(_0x417c2d),_0xfff0e5,_0x9fee43);var _0x2ef901=path[_0xa236('0x24')](__dirname,_0xa236('0x25'),rs[_0xa236('0x34')](0x4)+_0xa236('0x35'));var _0x293ebf;return downloadFile(_0x104d55,_0x2ef901)[_0xa236('0x29')](function(){_0x293ebf=path['resolve'](__dirname,'tmp',rs[_0xa236('0x34')](0x4)+'.wav');return convertFile(_0x2ef901,_0x293ebf);})[_0xa236('0x29')](function(){try{fs['unlink'](_0x2ef901);fs[_0xa236('0x2a')](_0x293ebf,_0xa236('0x2b'));}catch(_0x18d60f){logger[_0xa236('0x1a')](_0x18d60f);}return _0x293ebf[_0xa236('0x3a')]('.')[0x0];});};exports['ispeechASR']=function(_0x2d7bbe,_0x236e9e,_0x4521dd,_0x3458fc){var _0x32f0b8=util['format'](_0xa236('0x74'),ISPEECH_API,_0x236e9e,_0x4521dd,base64Encode(_0x2d7bbe),_0x3458fc?util['format'](_0xa236('0x75'),encodeURIComponent(_0x3458fc)):_0xa236('0x76'));return uploadFile(_0x32f0b8)[_0xa236('0x29')](function(_0x3ca4f7){return querystring[_0xa236('0x7')](_0x3ca4f7);});};exports[_0xa236('0x77')]=function(_0x2b4835,_0x2ddde9){return sestek[_0xa236('0x78')](_0x2b4835,_0x2ddde9)[_0xa236('0x29')](function(_0x5c946b){logger[_0xa236('0x19')](JSON[_0xa236('0x3f')](_0x5c946b));var _0x205f14={'speech':_0x5c946b['text'],'action':_0x5c946b[_0xa236('0x79')]?_0x5c946b[_0xa236('0x79')][_0xa236('0x7a')]:undefined,'actiondata':_0x5c946b[_0xa236('0x79')]?_0x5c946b[_0xa236('0x79')][_0xa236('0x7b')]:undefined};if(_0x5c946b['channelData']&&_0x5c946b[_0xa236('0x79')][_0xa236('0x7c')]){return base64Decode(_0x5c946b['channelData']['AudioFromTts']['Data'],path['resolve'](__dirname,_0xa236('0x25'),rs[_0xa236('0x34')](0x4)+_0xa236('0x26')))[_0xa236('0x29')](function(_0x1b8db6){_0x205f14[_0xa236('0x7d')]=_0x1b8db6;return _0x205f14;});}return _0x205f14;});};exports[_0xa236('0x7e')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 586a6fc..067e796 100644 --- a/server/services/agi/scripts/sestek/index.js +++ b/server/services/agi/scripts/sestek/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x72dc=['./nda'];(function(_0x4fd6ef,_0x47caa3){var _0x539736=function(_0x2fa050){while(--_0x2fa050){_0x4fd6ef['push'](_0x4fd6ef['shift']());}};_0x539736(++_0x47caa3);}(_0x72dc,0x166));var _0xc72d=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0x72dc[_0x2b5513];return _0x578fd2;};var nda=require(_0xc72d('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x2d05=['./nda','exports'];(function(_0x2eaedf,_0x1b7ceb){var _0x4b054b=function(_0x18c2a4){while(--_0x18c2a4){_0x2eaedf['push'](_0x2eaedf['shift']());}};_0x4b054b(++_0x1b7ceb);}(_0x2d05,0xdc));var _0x52d0=function(_0xabdeb2,_0x3e6fb5){_0xabdeb2=_0xabdeb2-0x0;var _0x1c785a=_0x2d05[_0xabdeb2];return _0x1c785a;};var nda=require(_0x52d0('0x0'));module[_0x52d0('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 78e9fd5..980fb46 100644 --- a/server/services/agi/scripts/sestek/nda/index.js +++ b/server/services/agi/scripts/sestek/nda/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce3a=['Nda','uniqueid','callerid','calleridname','Bearer\x20','body','ProjectName','ndagenerate_audio','channelData','audio/wav','custom_action','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','username','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message'];(function(_0x3314f9,_0x400d4e){var _0x28359d=function(_0x13783e){while(--_0x13783e){_0x3314f9['push'](_0x3314f9['shift']());}};_0x28359d(++_0x400d4e);}(_0xce3a,0x194));var _0xace3=function(_0x5254b1,_0x3b5cd1){_0x5254b1=_0x5254b1-0x0;var _0x3b9730=_0xce3a[_0x5254b1];return _0x3b9730;};'use strict';var rp=require(_0xace3('0x0'));var url=require(_0xace3('0x1'));var logger=require(_0xace3('0x2'))(_0xace3('0x3'));module[_0xace3('0x4')]=function(_0x37ef15,_0x1f1865){var _0x215d89={'method':_0xace3('0x5'),'uri':url[_0xace3('0x6')](_0x1f1865[_0xace3('0x7')],_0xace3('0x8')),'form':{'grant_type':'password','username':_0x1f1865[_0xace3('0x9')],'password':_0x1f1865[_0xace3('0xa')]},'json':!![]};return rp(_0x215d89)[_0xace3('0xb')](function(_0x22f00a){var _0x4e27ad={'method':_0xace3('0x5'),'uri':url['resolve'](_0x1f1865[_0xace3('0xc')],_0xace3('0xd')),'body':{'type':_0x1f1865[_0xace3('0xe')]||_0xace3('0xf'),'channelId':_0xace3('0x10'),'conversation':{'id':_0x37ef15[_0xace3('0x11')]},'from':{'id':_0x37ef15[_0xace3('0x12')],'name':_0x37ef15[_0xace3('0x13')]},'recipient':{'id':_0x37ef15['dnid'],'name':_0x37ef15['extension']},'text':_0x1f1865['text'],'channelData':{}},'headers':{'Authorization':_0xace3('0x14')+_0x22f00a['access_token']},'json':!![]};if(_0x1f1865['project']){_0x4e27ad[_0xace3('0x15')]['channelData'][_0xace3('0x16')]=_0x1f1865['project'];}if(_0x1f1865[_0xace3('0x17')]=='1'){_0x4e27ad[_0xace3('0x15')][_0xace3('0x18')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xace3('0x19')};}if(_0x1f1865[_0xace3('0x1a')]){_0x4e27ad[_0xace3('0x15')][_0xace3('0x18')]['CustomAction']=_0x1f1865[_0xace3('0x1a')];if(_0x1f1865[_0xace3('0x1b')]){_0x4e27ad[_0xace3('0x15')][_0xace3('0x18')]['CustomActionData']=_0x1f1865[_0xace3('0x1b')];}}logger[_0xace3('0x1c')](JSON[_0xace3('0x1d')](_0x4e27ad));return rp(_0x4e27ad);});}; \ No newline at end of file +var _0xa5fa=['ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','username','then','POST','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','dnid','text','Bearer\x20','access_token','project','body','ProjectName'];(function(_0x52867e,_0x5a5d15){var _0x523893=function(_0xc93c0a){while(--_0xc93c0a){_0x52867e['push'](_0x52867e['shift']());}};_0x523893(++_0x5a5d15);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x128e7e,_0x2f9b63){_0x128e7e=_0x128e7e-0x0;var _0x4ab22e=_0xa5fa[_0x128e7e];return _0x4ab22e;};'use strict';var rp=require('request-promise');var url=require(_0xaa5f('0x0'));var logger=require(_0xaa5f('0x1'))(_0xaa5f('0x2'));module[_0xaa5f('0x3')]=function(_0x499d69,_0x3e56f9){var _0x106128={'method':'POST','uri':url[_0xaa5f('0x4')](_0x3e56f9[_0xaa5f('0x5')],_0xaa5f('0x6')),'form':{'grant_type':_0xaa5f('0x7'),'username':_0x3e56f9[_0xaa5f('0x8')],'password':_0x3e56f9[_0xaa5f('0x7')]},'json':!![]};return rp(_0x106128)[_0xaa5f('0x9')](function(_0xc326df){var _0x74f64f={'method':_0xaa5f('0xa'),'uri':url[_0xaa5f('0x4')](_0x3e56f9['ndassistant_url'],_0xaa5f('0xb')),'body':{'type':_0x3e56f9[_0xaa5f('0xc')]||'message','channelId':'Nda','conversation':{'id':_0x499d69[_0xaa5f('0xd')]},'from':{'id':_0x499d69['callerid'],'name':_0x499d69['calleridname']},'recipient':{'id':_0x499d69[_0xaa5f('0xe')],'name':_0x499d69['extension']},'text':_0x3e56f9[_0xaa5f('0xf')],'channelData':{}},'headers':{'Authorization':_0xaa5f('0x10')+_0xc326df[_0xaa5f('0x11')]},'json':!![]};if(_0x3e56f9[_0xaa5f('0x12')]){_0x74f64f[_0xaa5f('0x13')]['channelData'][_0xaa5f('0x14')]=_0x3e56f9['project'];}if(_0x3e56f9[_0xaa5f('0x15')]=='1'){_0x74f64f[_0xaa5f('0x13')][_0xaa5f('0x16')][_0xaa5f('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xaa5f('0x18')};}if(_0x3e56f9['custom_action']){_0x74f64f['body'][_0xaa5f('0x16')][_0xaa5f('0x19')]=_0x3e56f9[_0xaa5f('0x1a')];if(_0x3e56f9[_0xaa5f('0x1b')]){_0x74f64f[_0xaa5f('0x13')][_0xaa5f('0x16')][_0xaa5f('0x1c')]=_0x3e56f9[_0xaa5f('0x1b')];}}logger[_0xaa5f('0x1d')](JSON[_0xaa5f('0x1e')](_0x74f64f));return rp(_0x74f64f);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/index.js b/server/services/agi/scripts/tilde/asr/index.js index 931bc51..e4a72bc 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ae4=['exports','./lib/api'];(function(_0x40f7e3,_0x5d2c41){var _0x146e15=function(_0x3ef90e){while(--_0x3ef90e){_0x40f7e3['push'](_0x40f7e3['shift']());}};_0x146e15(++_0x5d2c41);}(_0x8ae4,0x1e1));var _0x48ae=function(_0x2e44cf,_0x16f684){_0x2e44cf=_0x2e44cf-0x0;var _0x361268=_0x8ae4[_0x2e44cf];return _0x361268;};'use strict';var asr=require(_0x48ae('0x0'));module[_0x48ae('0x1')]=function(_0x3f655c,_0x50a6cf,_0x5a7cd3,_0x2b14e6){return asr(_0x3f655c,_0x50a6cf,_0x5a7cd3,_0x2b14e6);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x85156,_0x6375f3,_0x42edb2,_0x5cb591){return asr(_0x85156,_0x6375f3,_0x42edb2,_0x5cb591);}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/lib/api.js b/server/services/agi/scripts/tilde/asr/lib/api.js index e9b4e43..7ab8e46 100644 --- a/server/services/agi/scripts/tilde/asr/lib/api.js +++ b/server/services/agi/scripts/tilde/asr/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbc8=['error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','update','digest','hex','unix','stringify','createReadStream','data','close','EOS'];(function(_0xb0de07,_0x3ca2a0){var _0x4633d8=function(_0x2368e0){while(--_0x2368e0){_0xb0de07['push'](_0xb0de07['shift']());}};_0x4633d8(++_0x3ca2a0);}(_0xcbc8,0x173));var _0x8cbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcbc8[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x8cbc('0x0'));var _=require(_0x8cbc('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x8cbc('0x2'));var crypto=require(_0x8cbc('0x3'));var logger=require(_0x8cbc('0x4'))('agi');module[_0x8cbc('0x5')]=function(_0x1ceea6,_0x551e0e,_0x8b1427,_0x1e8a87){return new BPromise(function(_0x41cc35,_0x29e0aa){logger[_0x8cbc('0x6')](_0x8cbc('0x7'),_0x1e8a87||_0x8cbc('0x8'));var _0x20eca8=new WebSocket(_0x1e8a87||_0x8cbc('0x8'),{'perMessageDeflate':![]});var _0x43ae3f='';var _0x489ecc='0';var _0x2e03c8='1';var _0x5e7e03=_0x8cbc('0x9');function _0x3b00f2(_0x55be95){var _0x25edfc=crypto['createHash']('sha1');_0x25edfc[_0x8cbc('0xa')](_0x55be95);return _0x25edfc[_0x8cbc('0xb')](_0x8cbc('0xc'));}function _0x49a17e(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x3f6a9b=moment()[_0x8cbc('0xd')]();var _0x46641=_0x3b00f2(_0x3f6a9b+_0x551e0e+_0x8b1427);_0x20eca8['send'](JSON[_0x8cbc('0xe')]({'appID':_0x551e0e,'timestamp':_0x3f6a9b,'appKey':_0x46641}));var _0x2eb05e=fs[_0x8cbc('0xf')](_0x1ceea6);_0x2eb05e['on'](_0x8cbc('0x10'),function(_0x2011d6){_0x20eca8['send'](_0x2011d6);});_0x2eb05e['on'](_0x8cbc('0x11'),function(){_0x20eca8['send'](_0x8cbc('0x12'));});}catch(_0x1513ec){logger[_0x8cbc('0x13')](_0x8cbc('0x14'),JSON[_0x8cbc('0xe')](_0x1513ec));_0x20eca8['terminate']();}}function _0xdc21df(_0xcb411f){try{if(_0xcb411f){var _0x1b2af1=JSON[_0x8cbc('0x15')](_0xcb411f);switch(_0x1b2af1[_0x8cbc('0x16')]){case 0x0:if(_0x1b2af1['result']){if(_0x1b2af1[_0x8cbc('0x17')][_0x8cbc('0x18')]){logger[_0x8cbc('0x6')](_0x8cbc('0x19'),JSON[_0x8cbc('0xe')](_0x1b2af1['result'][_0x8cbc('0x1a')]));_0x43ae3f=_0x1b2af1[_0x8cbc('0x17')][_0x8cbc('0x1a')][0x0]['transcript'];_0x489ecc=_0x1b2af1[_0x8cbc('0x17')][_0x8cbc('0x1a')][0x0][_0x8cbc('0x1b')];_0x2e03c8='0';_0x5e7e03=_0x8cbc('0x1c');_0x20eca8[_0x8cbc('0x1d')]();}}break;case 0x1:logger[_0x8cbc('0x6')](_0x8cbc('0x9'));_0x2e03c8='1';_0x5e7e03=_0x8cbc('0x9');break;case 0x2:logger[_0x8cbc('0x6')](_0x8cbc('0x1e'));_0x2e03c8='2';_0x5e7e03=_0x8cbc('0x1e');break;case 0x9:logger[_0x8cbc('0x6')](_0x8cbc('0x1f'));_0x2e03c8='9';_0x5e7e03=_0x8cbc('0x1f');break;case 0xa:logger[_0x8cbc('0x6')](_0x8cbc('0x20'));_0x2e03c8='10';_0x5e7e03=_0x8cbc('0x20');break;case 0xb:logger[_0x8cbc('0x6')](_0x8cbc('0x21'));_0x2e03c8='11';_0x5e7e03='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x3b850a){logger[_0x8cbc('0x13')](_0x8cbc('0x22'),JSON['stringify'](_0x3b850a));_0x20eca8[_0x8cbc('0x1d')]();}}function _0x2943e7(){logger[_0x8cbc('0x6')](_0x8cbc('0x23'));_0x41cc35({'transcript':_0x43ae3f,'confidence':_0x489ecc,'status':_0x2e03c8,'status_message':_0x5e7e03});}function _0x22cbb6(_0x4f4f86){logger[_0x8cbc('0x13')](_0x8cbc('0x24'));if(!_['isNil'](_0x4f4f86)){logger[_0x8cbc('0x13')](_[_0x8cbc('0x25')](_0x4f4f86)?JSON[_0x8cbc('0xe')](_0x4f4f86):_0x4f4f86);}}_0x20eca8['on']('open',_0x49a17e);_0x20eca8['on'](_0x8cbc('0x26'),_0xdc21df);_0x20eca8['on'](_0x8cbc('0x11'),_0x2943e7);_0x20eca8['on'](_0x8cbc('0x13'),_0x22cbb6);});}; \ No newline at end of file +var _0x50f9=['error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS'];(function(_0x46ef9d,_0xbc9e08){var _0x391eb0=function(_0x2deeca){while(--_0x2deeca){_0x46ef9d['push'](_0x46ef9d['shift']());}};_0x391eb0(++_0xbc9e08);}(_0x50f9,0x164));var _0x950f=function(_0x74731e,_0x2f8984){_0x74731e=_0x74731e-0x0;var _0x38d7da=_0x50f9[_0x74731e];return _0x38d7da;};'use strict';var BPromise=require(_0x950f('0x0'));var _=require(_0x950f('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x950f('0x2'));var crypto=require(_0x950f('0x3'));var logger=require(_0x950f('0x4'))(_0x950f('0x5'));module['exports']=function(_0x57e669,_0x37bc6f,_0x25b35a,_0x837ab3){return new BPromise(function(_0x5e8b3f,_0x54c618){logger[_0x950f('0x6')](_0x950f('0x7'),_0x837ab3||_0x950f('0x8'));var _0x54d8cb=new WebSocket(_0x837ab3||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x261477='';var _0x7a6ce5='0';var _0x3d34a4='1';var _0x2fdc0f=_0x950f('0x9');function _0x4aa854(_0x32537e){var _0x3c0a74=crypto['createHash'](_0x950f('0xa'));_0x3c0a74[_0x950f('0xb')](_0x32537e);return _0x3c0a74[_0x950f('0xc')](_0x950f('0xd'));}function _0x418cc2(){try{logger['info'](_0x950f('0xe'));var _0x4a5035=moment()[_0x950f('0xf')]();var _0x4d1264=_0x4aa854(_0x4a5035+_0x37bc6f+_0x25b35a);_0x54d8cb[_0x950f('0x10')](JSON[_0x950f('0x11')]({'appID':_0x37bc6f,'timestamp':_0x4a5035,'appKey':_0x4d1264}));var _0x4f4d3b=fs[_0x950f('0x12')](_0x57e669);_0x4f4d3b['on'](_0x950f('0x13'),function(_0x160caf){_0x54d8cb[_0x950f('0x10')](_0x160caf);});_0x4f4d3b['on'](_0x950f('0x14'),function(){_0x54d8cb['send'](_0x950f('0x15'));});}catch(_0x225bde){logger[_0x950f('0x16')](_0x950f('0x17'),JSON['stringify'](_0x225bde));_0x54d8cb[_0x950f('0x18')]();}}function _0x3c8c71(_0x54d8ea){try{if(_0x54d8ea){var _0x587fde=JSON[_0x950f('0x19')](_0x54d8ea);switch(_0x587fde[_0x950f('0x1a')]){case 0x0:if(_0x587fde[_0x950f('0x1b')]){if(_0x587fde[_0x950f('0x1b')][_0x950f('0x1c')]){logger[_0x950f('0x6')](_0x950f('0x1d'),JSON[_0x950f('0x11')](_0x587fde[_0x950f('0x1b')]['hypotheses']));_0x261477=_0x587fde[_0x950f('0x1b')][_0x950f('0x1e')][0x0][_0x950f('0x1f')];_0x7a6ce5=_0x587fde['result']['hypotheses'][0x0][_0x950f('0x20')];_0x3d34a4='0';_0x2fdc0f='Success.';_0x54d8cb[_0x950f('0x18')]();}}break;case 0x1:logger[_0x950f('0x6')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x3d34a4='1';_0x2fdc0f='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x3d34a4='2';_0x2fdc0f=_0x950f('0x21');break;case 0x9:logger['info'](_0x950f('0x22'));_0x3d34a4='9';_0x2fdc0f='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0x950f('0x23'));_0x3d34a4='10';_0x2fdc0f=_0x950f('0x23');break;case 0xb:logger[_0x950f('0x6')](_0x950f('0x24'));_0x3d34a4='11';_0x2fdc0f=_0x950f('0x24');}}}catch(_0x8b0808){logger['error'](_0x950f('0x25'),JSON[_0x950f('0x11')](_0x8b0808));_0x54d8cb[_0x950f('0x18')]();}}function _0x572e15(){logger[_0x950f('0x6')](_0x950f('0x26'));_0x5e8b3f({'transcript':_0x261477,'confidence':_0x7a6ce5,'status':_0x3d34a4,'status_message':_0x2fdc0f});}function _0x4e49c0(_0x22b0cc){logger[_0x950f('0x16')](_0x950f('0x27'));if(!_[_0x950f('0x28')](_0x22b0cc)){logger[_0x950f('0x16')](_['isObject'](_0x22b0cc)?JSON['stringify'](_0x22b0cc):_0x22b0cc);}}_0x54d8cb['on'](_0x950f('0x29'),_0x418cc2);_0x54d8cb['on']('message',_0x3c8c71);_0x54d8cb['on'](_0x950f('0x14'),_0x572e15);_0x54d8cb['on'](_0x950f('0x16'),_0x4e49c0);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/index.js b/server/services/agi/scripts/tilde/index.js index 075c713..8f9638a 100644 --- a/server/services/agi/scripts/tilde/index.js +++ b/server/services/agi/scripts/tilde/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e4a=['./asr'];(function(_0x35cabc,_0xc0f89a){var _0x2af2b9=function(_0x7490fb){while(--_0x7490fb){_0x35cabc['push'](_0x35cabc['shift']());}};_0x2af2b9(++_0xc0f89a);}(_0x6e4a,0xf5));var _0xa6e4=function(_0x2629b3,_0x4b24ee){_0x2629b3=_0x2629b3-0x0;var _0x8ce2ba=_0x6e4a[_0x2629b3];return _0x8ce2ba;};var asr=require(_0xa6e4('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x8247=['./asr'];(function(_0x1a876f,_0x4b675e){var _0x7d90e0=function(_0x214056){while(--_0x214056){_0x1a876f['push'](_0x1a876f['shift']());}};_0x7d90e0(++_0x4b675e);}(_0x8247,0xf0));var _0x7824=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x8247[_0x368e09];return _0x14b7df;};var asr=require(_0x7824('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index c833d04..3f48935 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x1f1f3b,_0x227aa9){var _0x2e63aa=function(_0x165a34){while(--_0x165a34){_0x1f1f3b['push'](_0x1f1f3b['shift']());}};_0x2e63aa(++_0x227aa9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file +var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x1f7a55,_0x352d22){var _0x2a291b=function(_0xc9d9f6){while(--_0xc9d9f6){_0x1f7a55['push'](_0x1f7a55['shift']());}};_0x2a291b(++_0x352d22);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 585d521..eefcfb3 100644 --- a/server/services/agi/vertices.js +++ b/server/services/agi/vertices.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x29d4=['getMailAccountById','sendMailMessage','getIntervalById','IntervalId','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','agentPause','agent','agentUnpause','agentLogout','agentLogin','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MP3','googleTTS','restAPI','url','method','number','timeout','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','agicommand','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','saveRestApiResult','isArray','length','%s.%s','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','no\x20key\x20configured','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','SestekNDA\x20Result\x20%s','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','trunk_id','no\x20trunk\x20selected','getTrunk','trunk_name','SIP/%s/%s','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','getSound','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','beep','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','success','math','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','retry','no\x20file\x20audio\x20selected','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','playback','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','statusMessage','sayDigits','digits','saynumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','template_id','debug','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','util','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','channel','mailRpc','prototype','rpc','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','getSoundById','getSoundPath','save_name'];(function(_0x26af93,_0x17de65){var _0x3d058d=function(_0x4077b5){while(--_0x4077b5){_0x26af93['push'](_0x26af93['shift']());}};_0x3d058d(++_0x17de65);}(_0x29d4,0x1a1));var _0x429d=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x29d4[_0x4b7b62];return _0x2280df;};'use strict';var fs=require('fs');var util=require(_0x429d('0x0'));var _=require('lodash');var sh=require(_0x429d('0x1'));var odbc=require(_0x429d('0x2'))();var rs=require(_0x429d('0x3'));var moment=require(_0x429d('0x4'));var Mustache=require(_0x429d('0x5'));var rp=require('request-promise');var logger=require(_0x429d('0x6'))(_0x429d('0x7'));var config=require(_0x429d('0x8'));var scripts=require(_0x429d('0x9'));var FILES_PATH=_0x429d('0xa');var recursiveMapAttributes=[_0x429d('0xb'),_0x429d('0xc')];var verticesWithRetry=[_0x429d('0xd'),'getdigits',_0x429d('0xe')];var AGIVertices=function(_0x47cb29,_0x471129,_0x207dee){this[_0x429d('0xf')]=_0x47cb29;this['rpc']=_0x471129;this[_0x429d('0x10')]=_0x207dee;};AGIVertices[_0x429d('0x11')]['getVariable']=function(_0x31ff87,_0x2fd1ca){this[_0x429d('0x12')]['getVariableById'](_0x31ff87)[_0x429d('0x13')](function(_0x1f7a35){_0x2fd1ca(null,_0x1f7a35?_0x1f7a35[_0x429d('0x14')]:![]);})[_0x429d('0x15')](function(_0x4843af){_0x2fd1ca(_0x4843af);});};AGIVertices[_0x429d('0x11')][_0x429d('0x16')]=function(_0x43211b,_0x56bf5d){this[_0x429d('0x12')][_0x429d('0x17')](_0x43211b)['then'](function(_0x32d6b3){_0x56bf5d(null,_0x32d6b3?_0x32d6b3[_0x429d('0x14')]:![]);})[_0x429d('0x15')](function(_0x2ee97b){_0x56bf5d(_0x2ee97b);});};AGIVertices[_0x429d('0x11')][_0x429d('0x18')]=function(_0x4ddb35,_0xbfe8a0){this['rpc'][_0x429d('0x19')](_0x4ddb35)[_0x429d('0x13')](function(_0x4eef9d){_0xbfe8a0(null,_0x4eef9d?_0x4eef9d[_0x429d('0x14')]:![]);})['catch'](function(_0x240a7d){_0xbfe8a0(_0x240a7d);});};AGIVertices[_0x429d('0x11')][_0x429d('0x1a')]=function(_0x513854,_0x329d67){this[_0x429d('0x12')][_0x429d('0x1b')](_0x513854)[_0x429d('0x13')](function(_0xd033f8){_0x329d67(null,_0xd033f8?_0xd033f8[_0x429d('0x1c')]:![]);})['catch'](function(_0x13e309){_0x329d67(_0x13e309);});};AGIVertices[_0x429d('0x11')][_0x429d('0x1d')]=function(_0x4839bc,_0x1492f1){this[_0x429d('0x12')][_0x429d('0x1e')](_0x4839bc)[_0x429d('0x13')](function(_0x2d0624){_0x1492f1(null,_0x2d0624?_0x2d0624[_0x429d('0x14')]:![]);})['catch'](function(_0x28f84e){_0x1492f1(_0x28f84e);});};AGIVertices[_0x429d('0x11')]['getTrunk']=function(_0x1a2c1c,_0x37fbf9){this[_0x429d('0x12')][_0x429d('0x1f')](_0x1a2c1c)['then'](function(_0x3b12f6){_0x37fbf9(null,_0x3b12f6?_0x3b12f6[_0x429d('0x14')]:![]);})[_0x429d('0x15')](function(_0x3896ee){_0x37fbf9(_0x3896ee);});};AGIVertices[_0x429d('0x11')]['getSound']=function(_0x33e4a4,_0x2209aa){var _0x258557=this;this[_0x429d('0x12')][_0x429d('0x20')](_0x33e4a4)[_0x429d('0x13')](function(_0x2351c9){_0x2209aa(null,_0x2351c9?_0x258557[_0x429d('0x21')](_0x2351c9[_0x429d('0x22')]):![]);})['catch'](function(_0x31cae6){_0x2209aa(_0x31cae6);});};AGIVertices[_0x429d('0x11')]['getMailAccount']=function(_0x29cdfb,_0x30c1ba){this[_0x429d('0x12')][_0x429d('0x23')](_0x29cdfb)[_0x429d('0x13')](function(_0x481122){_0x30c1ba(null,_0x481122?_0x481122:![]);})[_0x429d('0x15')](function(_0x6761d){_0x30c1ba(_0x6761d);});};AGIVertices[_0x429d('0x11')][_0x429d('0x24')]=function(_0x2c7c39,_0x1b98ad,_0x4dcacd){this['mailRpc'][_0x429d('0x24')](_0x2c7c39,_0x1b98ad)[_0x429d('0x13')](function(){_0x4dcacd(null);})['catch'](function(_0x4a0a95){_0x4dcacd(_0x4a0a95);});};AGIVertices[_0x429d('0x11')]['getIntervals']=function(_0x1992ca,_0x3ba3aa){this[_0x429d('0x12')][_0x429d('0x25')](_0x1992ca)['then'](function(_0x10c023){if(_0x10c023){if(_0x10c023[_0x429d('0x26')]){_0x3ba3aa(null,[_0x10c023['interval']]);}else{_0x3ba3aa(null,_['map'](_0x10c023['Intervals'],'interval'));}}else{_0x3ba3aa(null,![]);}})['catch'](function(_0x43427b){_0x3ba3aa(_0x43427b);});};AGIVertices['prototype']['getSoundPath']=function(_0x2acc3c){return util[_0x429d('0x27')](_0x429d('0x28'),FILES_PATH,_0x2acc3c);};AGIVertices[_0x429d('0x11')][_0x429d('0x29')]=function(_0x1a5d80,_0x4b23ab,_0x423dc8){odbc[_0x429d('0x2a')](_0x1a5d80,function(_0x1370f7){if(_0x1370f7){logger[_0x429d('0x2b')](_0x429d('0x2c'),_0x1370f7);_0x423dc8(_0x1370f7);}else{logger[_0x429d('0x2d')](_0x429d('0x2e'));odbc[_0x429d('0x2f')](_0x4b23ab,function(_0x429a5e,_0x439a6d){if(_0x429a5e){logger[_0x429d('0x2d')](_0x429d('0x30'),_0x4b23ab);_0x423dc8(_0x429a5e);}else{logger[_0x429d('0x2d')](_0x429d('0x31'),_0x4b23ab);odbc[_0x429d('0x32')](function(_0x19da82){if(_0x19da82){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x19da82);}_0x423dc8(null,_0x439a6d);});}});}});};AGIVertices[_0x429d('0x11')][_0x429d('0x33')]=function(_0x569811,_0x2ea43a){this[_0x429d('0x12')][_0x429d('0x34')](_0x569811)['then'](function(_0x50a907){_0x2ea43a(null,_0x50a907?_0x50a907:![]);})[_0x429d('0x15')](function(_0x1f655c){_0x2ea43a(_0x1f655c);});};AGIVertices['prototype'][_0x429d('0x35')]=function(_0x34f1f5,_0x57dcda){this[_0x429d('0x12')]['createSmsMessage'](_0x34f1f5)[_0x429d('0x13')](function(_0xdd3ff5){_0x57dcda(null,_0xdd3ff5);})[_0x429d('0x15')](function(_0x475a00){_0x57dcda(_0x475a00);});};AGIVertices['prototype'][_0x429d('0x36')]=function(_0x38b40c,_0x2a97c1,_0x4cc663){this['rpc'][_0x429d('0x36')]({'uniqueid':this[_0x429d('0xf')][_0x429d('0x37')],'node':_0x38b40c[_0x429d('0x38')],'application':_0x38b40c['agicommand'],'data':_0x2a97c1||null,'project_name':this[_0x429d('0xf')][_0x429d('0x39')],'callerid':this[_0x429d('0xf')][_0x429d('0x3a')]})[_0x429d('0x13')](function(_0x435d65){if(_0x4cc663){_0x4cc663(null,_0x435d65);}})[_0x429d('0x15')](function(_0x3d9f02){if(_0x4cc663){_0x4cc663(_0x3d9f02);}});};AGIVertices[_0x429d('0x11')][_0x429d('0x3b')]=function(_0x494bed,_0x2de550,_0x51d96e,_0x54804a){this['rpc'][_0x429d('0x3b')]({'uniqueid':this[_0x429d('0xf')]['uniqueid'],'callerid':this[_0x429d('0xf')][_0x429d('0x3a')],'calleridname':this['channel'][_0x429d('0x3c')],'context':this[_0x429d('0xf')][_0x429d('0x3d')],'extension':this[_0x429d('0xf')][_0x429d('0x3e')],'priority':this['channel'][_0x429d('0x3f')],'accountcode':this[_0x429d('0xf')][_0x429d('0x40')],'dnid':this[_0x429d('0xf')]['dnid'],'projectName':this[_0x429d('0xf')][_0x429d('0x39')],'saveName':_0x2de550,'filename':_0x494bed[_0x429d('0x41')]||_0x2de550,'savePath':_0x51d96e})['then'](function(_0x471ba5){_0x54804a(null,_0x471ba5);})['catch'](function(_0x548f71){_0x54804a(_0x548f71);});};AGIVertices[_0x429d('0x11')][_0x429d('0x42')]=function(_0x54d0f9,_0x4aa914,_0x260cf7,_0x514b1e,_0x3a15d0){this[_0x429d('0x12')][_0x429d('0x42')]({'uniqueid':this[_0x429d('0xf')][_0x429d('0x37')],'body':_0x54d0f9,'direction':_0x4aa914,'providerName':_0x260cf7,'providerResponse':_0x514b1e})[_0x429d('0x13')](function(_0x28ed8f){if(_0x3a15d0){_0x3a15d0(null,_0x28ed8f);}})[_0x429d('0x15')](function(_0x5dba96){if(_0x3a15d0){_0x3a15d0(_0x5dba96);}});};AGIVertices['prototype'][_0x429d('0x43')]=function(_0x168875,_0x18f172){this[_0x429d('0x12')]['createCmContact']({'firstName':_[_0x429d('0x44')](_0x168875[_0x429d('0x14')])||_[_0x429d('0x45')](_0x168875[_0x429d('0x14')])?_0x429d('0x46')+Math[_0x429d('0x47')]():_0x168875[_0x429d('0x14')],'lastName':_[_0x429d('0x44')](_0x168875[_0x429d('0x48')])||_[_0x429d('0x45')](_0x168875['lastName'])?null:_0x168875[_0x429d('0x48')],'phone':_0x168875[_0x429d('0x49')],'ListId':_0x168875[_0x429d('0x4a')],'scheduledat':_0x168875[_0x429d('0x4b')],'callbackUniqueid':this[_0x429d('0xf')][_0x429d('0x37')],'tags':_0x429d('0x4c'),'description':'Callback\x20scheduled\x20at\x20'+_0x168875[_0x429d('0x4b')][_0x429d('0x4d')](),'priority':_0x168875[_0x429d('0x4e')]})[_0x429d('0x13')](function(_0x59d006){_0x18f172(null,_0x59d006);})[_0x429d('0x15')](function(_0x4aee2d){_0x18f172(_0x4aee2d);});};AGIVertices[_0x429d('0x11')]['getPause']=function(_0x5f2e19,_0x462c5b){this[_0x429d('0x12')]['getPauseById'](_0x5f2e19)[_0x429d('0x13')](function(_0x1af295){_0x462c5b(null,_0x1af295?_0x1af295['name']:![]);})[_0x429d('0x15')](function(_0xc4b855){_0x462c5b(_0xc4b855);});};AGIVertices[_0x429d('0x11')][_0x429d('0x4f')]=function(_0x57f307,_0x2994ee,_0x2f5bd8){var _0x738c59={'role':_0x429d('0x50')};_0x738c59[_0x57f307]=this[_0x429d('0xf')][_0x429d('0x3a')];this[_0x429d('0x12')][_0x429d('0x4f')](_0x738c59,_0x2994ee,this[_0x429d('0xf')][_0x429d('0x37')])[_0x429d('0x13')](function(_0x3abe86){_0x2f5bd8(null,_[_0x429d('0x45')](_0x3abe86)?![]:!![]);})[_0x429d('0x15')](function(_0x274be1){logger[_0x429d('0x2b')](_0x274be1);_0x2f5bd8(null,![]);});};AGIVertices['prototype'][_0x429d('0x51')]=function(_0x1c20ae,_0x57d0ca){var _0x348a1f={'role':_0x429d('0x50')};_0x348a1f[_0x1c20ae]=this['channel'][_0x429d('0x3a')];this[_0x429d('0x12')][_0x429d('0x51')](_0x348a1f)['then'](function(_0x5bd3ac){_0x57d0ca(null,_[_0x429d('0x45')](_0x5bd3ac)?![]:!![]);})[_0x429d('0x15')](function(_0x4e7a6b){logger[_0x429d('0x2b')](_0x4e7a6b);_0x57d0ca(null,![]);});};AGIVertices[_0x429d('0x11')][_0x429d('0x52')]=function(_0x258c70,_0x9d1dd7){var _0x75686c={'role':_0x429d('0x50')};_0x75686c[_0x258c70]=this[_0x429d('0xf')][_0x429d('0x3a')];this[_0x429d('0x12')][_0x429d('0x52')](_0x75686c)['then'](function(_0x1d302c){_0x9d1dd7(null,_[_0x429d('0x45')](_0x1d302c)?![]:!![]);})[_0x429d('0x15')](function(_0x1d9f57){logger[_0x429d('0x2b')](_0x1d9f57);_0x9d1dd7(null,![]);});};AGIVertices['prototype'][_0x429d('0x53')]=function(_0x33a1ba,_0x4871d2){var _0x4948ef={'role':_0x429d('0x50')};_0x4948ef[_0x33a1ba]=this[_0x429d('0xf')][_0x429d('0x3a')];var _0x3faf9e=_0x33a1ba!='internal'?util['format']('%s/%s@from-sip/n','LOCAL',this[_0x429d('0xf')][_0x429d('0x3a')]):undefined;this[_0x429d('0x12')][_0x429d('0x53')](_0x4948ef,_0x3faf9e)[_0x429d('0x13')](function(_0x4b2243){_0x4871d2(null,_[_0x429d('0x45')](_0x4b2243)?![]:!![]);})[_0x429d('0x15')](function(_0x4fc5d0){logger[_0x429d('0x2b')](_0x4fc5d0);_0x4871d2(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x5c3d12,_0xc6fa23){sh['exec'](_['trim'](_0x5c3d12),function(_0x2b5576,_0x32926d){var _0xcf0bda=_0x32926d[_0x429d('0x54')](/(\r\n|\n|\r)/gm,'');_0xc6fa23(null,_0xcf0bda);});};AGIVertices[_0x429d('0x11')][_0x429d('0x55')]=function(_0x533a52,_0x23316b){scripts['googleCloudTTS'](_0x533a52[_0x429d('0x56')],_0x533a52[_0x429d('0x57')]||_0x429d('0x58'),_0x533a52[_0x429d('0x58')],_0x533a52[_0x429d('0x59')]||_0x429d('0x5a'),_0x533a52['ssmlGender']||'MALE',_0x533a52['audioEncoding']||_0x429d('0x5b'))[_0x429d('0x13')](function(_0x53b194){_0x23316b(null,_0x53b194);})[_0x429d('0x15')](function(_0x2fa8af){_0x23316b(_0x2fa8af);});};AGIVertices['prototype']['googleTTS']=function(_0x120e49,_0x5d965c){scripts[_0x429d('0x5c')](_0x120e49[_0x429d('0x58')],_0x120e49['google_tts_language']||'en',0x1)[_0x429d('0x13')](function(_0x3e6133){_0x5d965c(null,_0x3e6133);})['catch'](function(_0x283b2d){_0x5d965c(_0x283b2d);});};AGIVertices[_0x429d('0x11')][_0x429d('0x5d')]=function(_0x430e69,_0x3025f6){var _0x2c686e={'uri':_0x430e69[_0x429d('0x5e')],'method':_0x430e69[_0x429d('0x5f')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x430e69['timeout'])===_0x429d('0x60')&&parseInt(_0x430e69[_0x429d('0x61')])>=0x1?parseInt(_0x430e69['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x429d('0x62')]([_0x429d('0x63'),_0x429d('0x64')],_0x2c686e[_0x429d('0x5f')][_0x429d('0x65')]())){try{_0x2c686e[_0x429d('0x66')]=_0x430e69['rawBody']?JSON[_0x429d('0x67')](_0x430e69[_0x429d('0xc')]):{};}catch(_0x490fa1){logger[_0x429d('0x2b')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x490fa1);}}try{_0x2c686e['headers']=_0x430e69['rawHeaders']?JSON['parse'](_0x430e69[_0x429d('0xb')]):{};}catch(_0x367b94){logger[_0x429d('0x2b')](_0x429d('0x68'),_0x367b94);}if(_0x430e69[_0x429d('0x69')]){try{var _0x5dd4f0=require(_0x430e69[_0x429d('0x69')])[_0x429d('0x6a')](this,_0x2c686e);_0x2c686e[_0x429d('0x6b')]=Mustache[_0x429d('0x6c')](_0x430e69[_0x429d('0x5e')],_0x5dd4f0,{},['$$','$$']);if(_0x2c686e['headers']){_0x2c686e[_0x429d('0x6d')]=JSON[_0x429d('0x67')](Mustache[_0x429d('0x6c')](JSON['stringify'](_0x2c686e[_0x429d('0x6d')]),_0x5dd4f0,{},['$$','$$']));}if(_0x2c686e[_0x429d('0x66')]){_0x2c686e[_0x429d('0x66')]=JSON[_0x429d('0x67')](Mustache[_0x429d('0x6c')](JSON[_0x429d('0x6e')](_0x2c686e['body']),_0x5dd4f0,{},['$$','$$']));}}catch(_0x5397f0){logger['error'](_0x429d('0x6f'),_0x5397f0);}}rp(_0x2c686e)['then'](function(_0x244554){var _0x1be0ef={'statusCode':_0x244554['statusCode']||0xc8,'statusMessage':_0x244554['statusMessage']||'OK','headers':_0x244554[_0x429d('0x6d')]||{},'body':_0x244554[_0x429d('0x66')]||{}};_0x3025f6(null,_0x1be0ef);})[_0x429d('0x15')](function(_0x15b4f9){var _0xbe6bc8={'statusCode':_0x15b4f9[_0x429d('0x70')]||0x1f4,'statusMessage':_0x15b4f9[_0x429d('0x71')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x15b4f9['options'][_0x429d('0x6d')]||{},'body':_0x15b4f9[_0x429d('0x72')][_0x429d('0x66')]||{}};_0x3025f6(null,_0xbe6bc8);});};AGIVertices['prototype']['googleDialogflow']=function(_0x36faa7,_0x181663){scripts[_0x429d('0x73')](this[_0x429d('0xf')][_0x429d('0x37')],_0x36faa7[_0x429d('0x74')],_0x36faa7[_0x429d('0x58')],_0x36faa7[_0x429d('0x75')]||'en')['then'](function(_0x4fe0d1){_0x181663(null,_0x4fe0d1);})[_0x429d('0x15')](function(_0xee10a1){_0x181663(_0xee10a1);});};AGIVertices['prototype'][_0x429d('0x76')]=function(_0x4758ba,_0x1b76e3){scripts[_0x429d('0x76')](this[_0x429d('0xf')][_0x429d('0x37')],_0x4758ba['dialogflowV2_project_id'],_0x4758ba['client_email'],_0x4758ba['private_key'],_0x4758ba['text'],_0x4758ba[_0x429d('0x77')]||'en')[_0x429d('0x13')](function(_0x2cf872){_0x1b76e3(null,_0x2cf872);})[_0x429d('0x15')](function(_0x36739c){_0x1b76e3(_0x36739c);});};AGIVertices['prototype'][_0x429d('0x78')]=function(_0x11a59a,_0x49b3aa){scripts[_0x429d('0x78')](this[_0x429d('0xf')],_0x11a59a)[_0x429d('0x13')](function(_0x269bdf){_0x49b3aa(null,_0x269bdf);})[_0x429d('0x15')](function(_0x2422b7){_0x49b3aa(_0x2422b7);});};AGIVertices['prototype'][_0x429d('0x79')]=function(_0x438e5c,_0x1ee415){scripts['ispeechTTS'](_0x438e5c[_0x429d('0x74')],_0x438e5c[_0x429d('0x58')],_0x438e5c[_0x429d('0x7a')]||_0x429d('0x5a'),_0x438e5c[_0x429d('0x7b')])[_0x429d('0x13')](function(_0x1e8787){_0x1ee415(null,_0x1e8787);})[_0x429d('0x15')](function(_0x102970){_0x1ee415(_0x102970);});};AGIVertices['prototype'][_0x429d('0x7c')]=function(_0x49c995,_0x465438,_0x33972e){scripts[_0x429d('0x7c')](_0x465438,_0x49c995[_0x429d('0x74')],_0x49c995[_0x429d('0x7d')]||_0x429d('0x5a'),this[_0x429d('0x7e')](_0x49c995[_0x429d('0x7f')])?_0x49c995[_0x429d('0x7f')]:undefined)[_0x429d('0x13')](function(_0x38469a){_0x33972e(null,_0x38469a);})['catch'](function(_0x581cac){_0x33972e(_0x581cac);});};AGIVertices[_0x429d('0x11')][_0x429d('0x80')]=function(_0x539af3,_0x269aa4){scripts[_0x429d('0x80')](_0x539af3['aws_access_key_id'],_0x539af3[_0x429d('0x81')],_0x539af3[_0x429d('0x82')],_0x539af3[_0x429d('0x83')]||_0x429d('0x84'),_0x539af3['text'],_0x539af3[_0x429d('0x85')]||_0x429d('0x58'))[_0x429d('0x13')](function(_0x32a129){_0x269aa4(null,_0x32a129);})[_0x429d('0x15')](function(_0x117658){_0x269aa4(_0x117658);});};AGIVertices['prototype'][_0x429d('0x86')]=function(_0x5952c7,_0x10101c){scripts[_0x429d('0x86')](this['channel'][_0x429d('0x37')],_0x5952c7[_0x429d('0x87')],_0x5952c7[_0x429d('0x81')],_0x5952c7[_0x429d('0x88')],_0x5952c7[_0x429d('0x58')],_0x5952c7[_0x429d('0x89')])[_0x429d('0x13')](function(_0x3722ff){_0x10101c(null,_0x3722ff);})[_0x429d('0x15')](function(_0x4036f4){_0x10101c(_0x4036f4);});};AGIVertices[_0x429d('0x11')]['googleASR']=function(_0x2a7248,_0x1d1a38,_0x525c18){scripts[_0x429d('0x8a')](_0x1d1a38,_0x2a7248[_0x429d('0x74')],_0x2a7248[_0x429d('0x8b')]||_0x429d('0x5a'))[_0x429d('0x13')](function(_0x4e8e27){_0x525c18(null,_0x4e8e27);})[_0x429d('0x15')](function(_0x270ba1){_0x525c18(_0x270ba1);});};AGIVertices[_0x429d('0x11')][_0x429d('0x8c')]=function(_0x2ecdf6,_0xa6f4a6,_0x52e3d3){scripts[_0x429d('0x8c')](_0xa6f4a6,_0x2ecdf6['appid'],_0x2ecdf6[_0x429d('0x8d')],_0x2ecdf6[_0x429d('0x6b')])['then'](function(_0x3f98a3){_0x52e3d3(null,_0x3f98a3);})[_0x429d('0x15')](function(_0x516041){_0x52e3d3(_0x516041);});};AGIVertices['prototype']['clear']=function(_0x507be4){var _0x4798dc=_[_0x429d('0x62')](verticesWithRetry,_0x507be4[_0x429d('0x8e')])?_0x507be4:_[_0x429d('0x8f')](_0x507be4);for(var _0x2fd3ff in _0x4798dc){if(_0x4798dc['hasOwnProperty'](_0x2fd3ff)){if(_0x4798dc[_0x2fd3ff]&&_[_0x429d('0x90')](_0x4798dc[_0x2fd3ff])){if(_['includes'](recursiveMapAttributes,_0x2fd3ff)){_0x4798dc[_0x2fd3ff]=this[_0x429d('0x91')](_0x4798dc[_0x2fd3ff]);}else{_0x4798dc[_0x2fd3ff]=this[_0x429d('0x92')](_0x4798dc[_0x2fd3ff]);}}}}return _0x4798dc;};AGIVertices[_0x429d('0x11')]['recursiveNodeIndex']=function(_0x4f4fe6){for(var _0x412ff9 in _0x4f4fe6){if(_0x4f4fe6['hasOwnProperty'](_0x412ff9)){if(_['isPlainObject'](_0x4f4fe6[_0x412ff9])){this[_0x429d('0x93')](_0x4f4fe6[_0x412ff9]);}else if(_['isArray'](_0x4f4fe6[_0x412ff9])){for(var _0x4881b8=0x0;_0x4881b8<_0x4f4fe6[_0x412ff9]['length'];_0x4881b8++){this[_0x429d('0x93')](_0x4f4fe6[_0x412ff9][_0x4881b8]);}}else if(_[_0x429d('0x90')](_0x4f4fe6[_0x412ff9])){_0x4f4fe6[_0x412ff9]=this[_0x429d('0x92')](_0x4f4fe6[_0x412ff9]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x2dcd91,_0xecebae){for(var _0x406c8c in _0x2dcd91){if(_0x2dcd91[_0x429d('0x94')](_0x406c8c)){if(_['isPlainObject'](_0x2dcd91[_0x406c8c])){if(!_['isEmpty'](_0x2dcd91[_0x406c8c])){this[_0x429d('0x95')](_0x2dcd91[_0x406c8c],util[_0x429d('0x27')]('%s.%s',_0xecebae,_0x406c8c));}}else if(_[_0x429d('0x96')](_0x2dcd91[_0x406c8c])){for(var _0x5cdfa1=0x0;_0x5cdfa1<_0x2dcd91[_0x406c8c][_0x429d('0x97')];_0x5cdfa1++){this['saveRestApiResult'](_0x2dcd91[_0x406c8c][_0x5cdfa1],util['format'](_0x429d('0x98'),_0xecebae,_0x406c8c+'['+_0x5cdfa1+']'));}}else{if(!_[_0x429d('0x45')](_0x2dcd91[_0x406c8c])){this[_0x429d('0xf')][_0x429d('0x99')](util[_0x429d('0x27')](_0x429d('0x98'),_0xecebae,_0x406c8c),_0x2dcd91[_0x406c8c]);}}}}};AGIVertices['prototype'][_0x429d('0x91')]=function(_0x513de0){try{var _0x1c4983=JSON[_0x429d('0x67')](_0x513de0);this[_0x429d('0x93')](_0x1c4983);return JSON[_0x429d('0x6e')](_0x1c4983);}catch(_0x576d02){return this[_0x429d('0x92')](_0x513de0);}};AGIVertices['prototype'][_0x429d('0x92')]=function(_0x2c5cae){var _0x434cc8=_0x2c5cae[_0x429d('0x9a')]('{');for(var _0x38b25e=0x1;_0x38b25e<_0x434cc8[_0x429d('0x97')];_0x38b25e+=0x1){var _0x15a0cf=_0x434cc8[_0x38b25e]['split']('}');if(_0x15a0cf[_0x429d('0x97')]>0x1){_0x2c5cae=_0x2c5cae[_0x429d('0x9b')]('{'+_0x15a0cf[0x0]+'}',this[_0x429d('0xf')][_0x429d('0x9c')](_0x15a0cf[0x0])[_0x429d('0x9d')]||_0x15a0cf[0x0]);}}if(_0x434cc8[_0x429d('0x97')]===0x1){return _0x2c5cae[_0x429d('0x4d')]();}return this[_0x429d('0x92')](_0x2c5cae);};AGIVertices[_0x429d('0x11')][_0x429d('0x9e')]=function(_0x2777b2,_0x1e2a87){var _0x4412d1=this['channel']['getVariable'](_0x2777b2);if(_0x4412d1[_0x429d('0x9f')]===-0x1){return _0x4412d1;}logger[_0x429d('0x2d')](util['format'](_0x429d('0xa0'),_0x1e2a87,_0x4412d1[_0x429d('0x9d')]));return this['channel'][_0x429d('0x99')](_0x1e2a87,_0x4412d1[_0x429d('0x9d')]);};AGIVertices[_0x429d('0x11')][_0x429d('0x7e')]=function(_0x1cd718){return _0x1cd718&&_0x1cd718!=='0'&&_0x1cd718!=='-1'&&_0x1cd718!=='';};AGIVertices['prototype'][_0x429d('0xa1')]=function(_0x448e17){this[_0x429d('0x36')]['sync'](this,_0x448e17,'-');_0x448e17['retry']=_0x448e17['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x429d('0x11')][_0x429d('0xa2')]=function(_0x20dba4){logger[_0x429d('0x2d')](util['format'](_0x429d('0xa3'),_0x20dba4['label']));if(!this[_0x429d('0x7e')](_0x20dba4['text'])){return this[_0x429d('0xf')][_0x429d('0xa4')](_0x429d('0xa5'));}var _0x15b295='\x22'+_0x20dba4[_0x429d('0x58')]+'\x22';if(this[_0x429d('0x7e')](_0x20dba4['options'])){_0x15b295+=','+_0x20dba4['options'];}var _0x31e264=this[_0x429d('0xf')][_0x429d('0xa6')](_0x429d('0xa7'),_0x15b295);if(_0x31e264[_0x429d('0x9f')]===-0x1){return _0x31e264;}return this['channel']['noop'](util[_0x429d('0x27')](_0x429d('0xa8'),_0x15b295));};AGIVertices[_0x429d('0x11')]['mrcprecog']=function(_0x1ea8fa){logger[_0x429d('0x2d')](util[_0x429d('0x27')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x1ea8fa[_0x429d('0x38')]));if(!this['isConfigured'](_0x1ea8fa[_0x429d('0xa9')])){return this[_0x429d('0xf')][_0x429d('0xa4')](_0x429d('0xaa'));}var _0x10cfd5=_0x1ea8fa[_0x429d('0xa9')];if(this[_0x429d('0x7e')](_0x1ea8fa[_0x429d('0x72')])){_0x10cfd5+=','+_0x1ea8fa[_0x429d('0x72')];}var _0x234a10=this[_0x429d('0xf')]['exec'](_0x429d('0xab'),_0x10cfd5);if(_0x234a10['result']===-0x1){return _0x234a10;}var _0x45617e=this['getAndSetVariable'](_0x429d('0xac'),_0x429d('0xad'));if(_0x45617e[_0x429d('0x9f')]===-0x1){return _0x45617e;}var _0x102a6f=this[_0x429d('0x9e')]('RECOG_INPUT()',_0x429d('0xae'));if(_0x102a6f[_0x429d('0x9f')]===-0x1){return _0x102a6f;}var _0x18ee5d=this[_0x429d('0x9e')](_0x429d('0xaf'),_0x429d('0xb0'));if(_0x18ee5d['result']===-0x1){return _0x18ee5d;}return this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0xb1'),_0x10cfd5));};AGIVertices[_0x429d('0x11')]['agi']=function(_0x28c9e5){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0xb2'),_0x28c9e5[_0x429d('0x38')]));return this[_0x429d('0xf')]['agi']([_0x28c9e5[_0x429d('0xb3')],_0x28c9e5[_0x429d('0xb4')]]);};AGIVertices['prototype'][_0x429d('0xb5')]=function(_0x5dc0f7){logger[_0x429d('0x2d')](util[_0x429d('0x27')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x5dc0f7[_0x429d('0x38')]));if(this[_0x429d('0x7e')](_0x5dc0f7[_0x429d('0x61')])){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0xb6'),_0x5dc0f7[_0x429d('0x61')]));var _0x25b788=this[_0x429d('0xf')][_0x429d('0xb7')](_0x5dc0f7[_0x429d('0x61')]);if(_0x25b788[_0x429d('0x9f')]===-0x1){return _0x25b788;}}return this['channel'][_0x429d('0xb5')]();};AGIVertices['prototype'][_0x429d('0x4c')]=function(_0x230f31){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0xb8'),_0x230f31[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x230f31['list_id'])){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x230f31,_0x429d('0xb9'));}_0x230f31[_0x429d('0x4b')]=moment();if(this[_0x429d('0x7e')](_0x230f31[_0x429d('0xba')])){_0x230f31[_0x429d('0x4b')]=moment()[_0x429d('0xbb')](_0x230f31[_0x429d('0xba')],_0x429d('0xbc'));}if(!this[_0x429d('0x7e')](_0x230f31[_0x429d('0x4e')])){_0x230f31[_0x429d('0x4e')]=0x2;}this[_0x429d('0x43')]['sync'](this,_0x230f31);return this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x230f31[_0x429d('0x49')],_0x230f31['list_id'],_0x230f31[_0x429d('0x4b')]));};AGIVertices['prototype'][_0x429d('0xbd')]=function(_0xde1a2){logger['info'](util[_0x429d('0x27')](_0x429d('0xbe'),_0xde1a2[_0x429d('0x38')]));var _0x51c07d=this[_0x429d('0xf')]['exec'](_0xde1a2['application'],_0xde1a2[_0x429d('0x72')]);if(_0x51c07d['result']===-0x1){return _0x51c07d;}return this['channel']['noop'](util[_0x429d('0x27')](_0x429d('0xbf'),_0xde1a2[_0x429d('0xc0')],_0xde1a2[_0x429d('0x72')]));};AGIVertices['prototype']['lumenvoxtts']=function(_0x437408){logger['info'](util[_0x429d('0x27')](_0x429d('0xc1'),_0x437408[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x437408[_0x429d('0x58')])){return this[_0x429d('0xf')][_0x429d('0xa4')]('no\x20text\x20configured');}var _0x4024e9='\x22'+_0x437408['text']+'\x22';if(this[_0x429d('0x7e')](_0x437408[_0x429d('0x72')])){_0x4024e9+=','+_0x437408['options'];}var _0x5c6278=this[_0x429d('0xf')]['exec'](_0x429d('0xa7'),_0x4024e9);if(_0x5c6278[_0x429d('0x9f')]===-0x1){return _0x5c6278;}return this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0xa8'),_0x4024e9));};AGIVertices[_0x429d('0x11')][_0x429d('0xc2')]=function(_0x2b4756){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0xc3'),_0x2b4756[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x2b4756[_0x429d('0x58')])){return this['channel']['noop'](_0x429d('0xa5'));}var _0x50b2aa='\x22'+_0x2b4756['text']+'\x22';if(this['isConfigured'](_0x2b4756['options'])){_0x50b2aa+=','+_0x2b4756[_0x429d('0x72')];}var _0x6c2e1e=this[_0x429d('0xf')]['exec']('MRCPSynth',_0x50b2aa);if(_0x6c2e1e[_0x429d('0x9f')]===-0x1){return _0x6c2e1e;}return this[_0x429d('0xf')]['noop'](util[_0x429d('0x27')](_0x429d('0xa8'),_0x50b2aa));};AGIVertices[_0x429d('0x11')][_0x429d('0xc4')]=function(_0x34c364){logger[_0x429d('0x2d')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x34c364[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x34c364['grammar'])){return this[_0x429d('0xf')][_0x429d('0xa4')](_0x429d('0xaa'));}var _0x1040a9=_0x34c364['grammar'];if(this[_0x429d('0x7e')](_0x34c364[_0x429d('0x72')])){_0x1040a9+=','+_0x34c364[_0x429d('0x72')];}var _0x53e699=this['channel'][_0x429d('0xa6')]('MRCPRecog',_0x1040a9);if(_0x53e699[_0x429d('0x9f')]===-0x1){return _0x53e699;}var _0x4aa1ee=this[_0x429d('0x9e')](_0x429d('0xac'),_0x429d('0xc5'));if(_0x4aa1ee[_0x429d('0x9f')]===-0x1){return _0x4aa1ee;}var _0x44c94b=this[_0x429d('0x9e')](_0x429d('0xc6'),_0x429d('0xc7'));if(_0x44c94b[_0x429d('0x9f')]===-0x1){return _0x44c94b;}var _0x4e7bbb=this[_0x429d('0x9e')](_0x429d('0xaf'),_0x429d('0xc8'));if(_0x4e7bbb['result']===-0x1){return _0x4e7bbb;}return this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0xb1'),_0x1040a9));};AGIVertices['prototype'][_0x429d('0xc9')]=function(_0x5eba29){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0xca'),_0x5eba29[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x5eba29[_0x429d('0xa9')])){return this[_0x429d('0xf')][_0x429d('0xa4')](_0x429d('0xaa'));}var _0x1de080=_0x5eba29[_0x429d('0xa9')];if(this[_0x429d('0x7e')](_0x5eba29[_0x429d('0x72')])){_0x1de080+=','+_0x5eba29[_0x429d('0x72')];}var _0x2e8c13=this[_0x429d('0xf')][_0x429d('0xa6')](_0x429d('0xab'),_0x1de080);if(_0x2e8c13['result']===-0x1){return _0x2e8c13;}var _0x37d35b=this[_0x429d('0x9e')](_0x429d('0xac'),_0x429d('0xcb'));if(_0x37d35b['result']===-0x1){return _0x37d35b;}var _0x3b4720=this['getAndSetVariable'](_0x429d('0xc6'),_0x429d('0xcc'));if(_0x3b4720[_0x429d('0x9f')]===-0x1){return _0x3b4720;}var _0x69026a=this['getAndSetVariable'](_0x429d('0xaf'),_0x429d('0xcd'));if(_0x69026a[_0x429d('0x9f')]===-0x1){return _0x69026a;}return this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0xb1'),_0x1de080));};AGIVertices[_0x429d('0x11')][_0x429d('0xce')]=function(_0x25326f){logger[_0x429d('0x2d')](util[_0x429d('0x27')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x25326f['label']));if(!this[_0x429d('0x7e')](_0x25326f['odbc_id'])){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x25326f,_0x429d('0xcf'));}var _0x2bf831=this[_0x429d('0x1a')][_0x429d('0x6a')](this,_0x25326f['odbc_id']);if(!_0x2bf831){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x25326f,_0x429d('0xd0'));}if(!this['isConfigured'](_0x25326f[_0x429d('0x2f')])){return this[_0x429d('0xf')]['error'](_0x25326f,_0x429d('0xd1'));}var _0x44f73e=_0x25326f[_0x429d('0x2f')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0xd2'),_0x44f73e));var _0x263c18=this[_0x429d('0x29')]['sync'](this,_0x2bf831,_0x44f73e);this[_0x429d('0x36')]['sync'](this,_0x25326f,_0x44f73e);if(!this['isConfigured'](_0x25326f[_0x429d('0xd3')])){return this[_0x429d('0xf')]['noop'](_0x429d('0xd4'));}var _0x46f1cc=this['getVariable']['sync'](this,_0x25326f['variable_id']);if(!_0x46f1cc){return this['channel'][_0x429d('0x2b')](_0x25326f,_0x429d('0xd5'));}var _0x1e4a61=this;_0x263c18[_0x429d('0xd6')](function(_0x5439e2,_0x24a7b6){Object[_0x429d('0xd7')](_0x5439e2)['forEach'](function(_0x356c4c){_0x1e4a61['channel'][_0x429d('0x99')](util[_0x429d('0x27')](_0x429d('0xd8'),_0x46f1cc,_0x24a7b6,_0x356c4c),_0x5439e2[_0x356c4c]);});});this[_0x429d('0xf')][_0x429d('0x99')](util[_0x429d('0x27')]('%s_ROWS_COUNT',_0x46f1cc),_0x263c18[_0x429d('0x97')]);return this['channel'][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0xd9'),_0x46f1cc));};AGIVertices[_0x429d('0x11')][_0x429d('0xda')]=function(_0x24abe2){logger['debug'](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x24abe2[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x24abe2[_0x429d('0xdb')])){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x24abe2,_0x429d('0xdc'));}var _0x519cf3=this[_0x429d('0x1d')][_0x429d('0x6a')](this,_0x24abe2[_0x429d('0xdb')]);if(!_0x519cf3){return this['channel']['error'](_0x24abe2,_0x429d('0xdd'));}var _0x49503b=this[_0x429d('0xf')][_0x429d('0xa6')](_0x429d('0xde'),[util[_0x429d('0x27')](_0x429d('0xdf'),_0x519cf3),_0x24abe2[_0x429d('0x61')],_0x24abe2[_0x429d('0xe0')],_0x24abe2['url']]);if(_0x49503b[_0x429d('0x9f')]===-0x1){return _0x49503b;}return this[_0x429d('0xf')]['noop'](util['format']('Executed\x20command\x20%s',_0x429d('0xde')));};AGIVertices[_0x429d('0x11')]['dialogflow']=function(_0x53f2aa){logger['info'](util[_0x429d('0x27')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x53f2aa[_0x429d('0x38')]));if(!this['isConfigured'](_0x53f2aa['key'])){return this[_0x429d('0xf')]['noop'](_0x429d('0xe1'));}if(!this[_0x429d('0x7e')](_0x53f2aa[_0x429d('0x58')])){return this[_0x429d('0xf')][_0x429d('0xa4')]('no\x20text\x20configured');}this['channel']['bot']=!![];this[_0x429d('0x36')](_0x53f2aa);this[_0x429d('0x42')](_0x53f2aa[_0x429d('0x58')],'in','','');this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')]('Trying\x20Dialogflow:\x20%s',_0x53f2aa[_0x429d('0x58')]));var _0xc440d4=this['googleDialogflow'][_0x429d('0x6a')](this,_0x53f2aa);if(_0xc440d4){for(var _0x176e58 in _0xc440d4){if(_0xc440d4[_0x429d('0x94')](_0x176e58)){this[_0x429d('0xf')][_0x429d('0x99')](util[_0x429d('0x27')](_0x429d('0xe2'),_0x176e58['toUpperCase']()),_0xc440d4[_0x176e58]);}}this[_0x429d('0x42')](_0xc440d4[_0x429d('0xe3')],_0x429d('0xe4'),_0x429d('0xe5'),'');return this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0xe6'),_0xc440d4['speech']));}return this[_0x429d('0xf')][_0x429d('0x2b')](_0x53f2aa,_0x429d('0xe7'));};AGIVertices[_0x429d('0x11')][_0x429d('0xe8')]=function(_0x49bb8d){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0xe9'),_0x49bb8d[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x49bb8d[_0x429d('0xea')])){return this[_0x429d('0xf')][_0x429d('0xa4')](_0x429d('0xeb'));}if(!this[_0x429d('0x7e')](_0x49bb8d['client_email'])){return this['channel'][_0x429d('0xa4')](_0x429d('0xec'));}if(!this['isConfigured'](_0x49bb8d[_0x429d('0xed')])){return this['channel']['noop'](_0x429d('0xee'));}if(!this[_0x429d('0x7e')](_0x49bb8d[_0x429d('0x77')])){return this[_0x429d('0xf')]['noop'](_0x429d('0xef'));}if(!this[_0x429d('0x7e')](_0x49bb8d[_0x429d('0x58')])){return this[_0x429d('0xf')]['noop']('no\x20text\x20configured');}this[_0x429d('0xf')][_0x429d('0xf0')]=!![];this['createSquareDetailsReport'](_0x49bb8d);this[_0x429d('0x42')](_0x49bb8d[_0x429d('0x58')],'in','','');this[_0x429d('0xf')][_0x429d('0xa4')](util['format'](_0x429d('0xf1'),_0x49bb8d[_0x429d('0x58')]));var _0x208854=this[_0x429d('0x76')][_0x429d('0x6a')](this,_0x49bb8d);if(_0x208854){for(var _0x3ce8a2 in _0x208854){if(_0x208854[_0x429d('0x94')](_0x3ce8a2)){if(_0x3ce8a2!=='providerResponse'){this[_0x429d('0xf')][_0x429d('0x99')](util[_0x429d('0x27')]('DIALOGFLOW_%s',_0x3ce8a2[_0x429d('0x65')]()),_0x208854[_0x3ce8a2]);}}}this[_0x429d('0x42')](_0x208854[_0x429d('0xe3')],'out','dialogflowV2',_0x208854[_0x429d('0xf2')]);return this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')]('DialogflowV2\x20Result\x20%s',_0x208854[_0x429d('0xe3')]));}return this['channel'][_0x429d('0x2b')](_0x49bb8d,_0x429d('0xf3'));};AGIVertices['prototype'][_0x429d('0xf4')]=function(_0x2fe75f){logger[_0x429d('0x2d')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x2fe75f[_0x429d('0x38')]));if(!this['isConfigured'](_0x2fe75f[_0x429d('0xf5')])){return this[_0x429d('0xf')][_0x429d('0xa4')](_0x429d('0xf6'));}if(!this['isConfigured'](_0x2fe75f['username'])){return this[_0x429d('0xf')][_0x429d('0xa4')]('no\x20username\x20configured');}if(!this[_0x429d('0x7e')](_0x2fe75f['password'])){return this[_0x429d('0xf')][_0x429d('0xa4')](_0x429d('0xf7'));}if(!this[_0x429d('0x7e')](_0x2fe75f['ndassistant_url'])){return this[_0x429d('0xf')]['noop'](_0x429d('0xa5'));}this['channel'][_0x429d('0xf0')]=!![];this['createSquareDetailsReport'](_0x2fe75f);this[_0x429d('0x42')](_0x2fe75f[_0x429d('0x58')],'in','','');this[_0x429d('0xf')][_0x429d('0xa4')](util['format'](_0x429d('0xf8'),_0x2fe75f['text']));var _0x3c108d=this[_0x429d('0x78')]['sync'](this,_0x2fe75f);if(_0x3c108d){for(var _0x4ea9fc in _0x3c108d){if(_0x3c108d[_0x429d('0x94')](_0x4ea9fc)){this[_0x429d('0xf')][_0x429d('0x99')](util[_0x429d('0x27')](_0x429d('0xf9'),_0x4ea9fc[_0x429d('0x65')]()),_0x3c108d[_0x4ea9fc]);}}this['createSquareMessage'](_0x3c108d[_0x429d('0xe3')],_0x429d('0xe4'),_0x429d('0xf4'),'');if(_0x3c108d['audiofile']){this[_0x429d('0xf')]['noop'](util[_0x429d('0x27')](_0x429d('0xfa'),_0x3c108d[_0x429d('0xfb')]));var _0x38f843=this['channel'][_0x429d('0xfc')](_0x3c108d[_0x429d('0xfb')]);try{fs[_0x429d('0xfd')](_0x3c108d[_0x429d('0xfb')]+'.wav');}catch(_0x44c238){logger[_0x429d('0x2b')](_0x44c238);}return _0x38f843;}else{return this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0xfe'),_0x3c108d[_0x429d('0xe3')]));}}return this[_0x429d('0xf')][_0x429d('0x2b')](_0x2fe75f,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x429d('0x11')]['end']=function(_0x4482f1){logger['info'](util[_0x429d('0x27')](_0x429d('0xff'),_0x4482f1[_0x429d('0x38')]));return this[_0x429d('0xf')]['noop'](_0x429d('0x100'));};AGIVertices[_0x429d('0x11')][_0x429d('0x101')]=function(_0x10eb26){logger['info'](util[_0x429d('0x27')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x10eb26[_0x429d('0x38')]));var _0x357e6e='';if(_0x10eb26[_0x429d('0x102')]){if(!this[_0x429d('0x7e')](_0x10eb26['trunk_id'])){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x10eb26,_0x429d('0x103'));}else{var _0x1441a4=parseInt(_0x10eb26[_0x429d('0x102')],0xa);if(isNaN(_0x1441a4)){_0x357e6e=_0x10eb26['trunk_id'];}else{_0x357e6e=this[_0x429d('0x104')][_0x429d('0x6a')](this,_0x10eb26[_0x429d('0x102')]);if(!_0x357e6e){return this[_0x429d('0xf')]['error'](_0x10eb26,'no\x20trunk\x20found');}}}}else if(_0x10eb26[_0x429d('0x105')]){_0x357e6e=_0x10eb26[_0x429d('0x105')];}else{return this[_0x429d('0xf')]['error'](_0x10eb26,_0x429d('0x103'));}var _0xe15b97=this['channel'][_0x429d('0xa6')](_0x429d('0xde'),[util[_0x429d('0x27')](_0x429d('0x106'),_0x357e6e,_0x10eb26[_0x429d('0x49')]),_0x10eb26[_0x429d('0x61')],_0x10eb26[_0x429d('0xe0')],_0x10eb26['url']]);if(_0xe15b97[_0x429d('0x9f')]===-0x1){return _0xe15b97;}return this[_0x429d('0xf')][_0x429d('0xa4')](util['format']('Executed\x20command\x20%s',_0x429d('0xde')));};AGIVertices[_0x429d('0x11')][_0x429d('0x107')]=function(_0x2c49b8){logger['info'](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x2c49b8[_0x429d('0x38')]));return this[_0x429d('0xf')][_0x429d('0xa4')](_0x429d('0x107'));};AGIVertices['prototype'][_0x429d('0x108')]=function(_0x201e81){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x109'),_0x201e81['label']));if(_0x201e81['retry']===0x0){return this['maxRetry'](_0x201e81);}_0x201e81['retry']-=0x1;if(!this[_0x429d('0x7e')](_0x201e81[_0x429d('0x10a')])){return this['channel'][_0x429d('0x2b')](_0x201e81,'no\x20file\x20audio\x20selected');}var _0x5474ca=this[_0x429d('0x10b')][_0x429d('0x6a')](this,_0x201e81[_0x429d('0x10a')]);if(!_0x5474ca){return this['channel'][_0x429d('0x2b')](_0x201e81,_0x429d('0x10c'));}if(!this[_0x429d('0x7e')](_0x201e81['variable_id'])){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x429d('0xd4'));}var _0x4845f5=this[_0x429d('0xf')][_0x429d('0x10d')](_0x5474ca,_0x201e81[_0x429d('0x10e')],_0x201e81['maxdigit']);var _0x324eae=_0x4845f5['result']?_0x4845f5[_0x429d('0x9f')][_0x429d('0x4d')]():'';logger[_0x429d('0x2d')](_0x429d('0x10f'),JSON[_0x429d('0x6e')](_0x4845f5));if(_0x4845f5[_0x429d('0x9f')]===-0x1){this[_0x429d('0x36')][_0x429d('0x6a')](this,_0x201e81,_0x324eae);return _0x4845f5;}else if(_0x4845f5['extra']===_0x429d('0x61')){_0x4845f5[_0x429d('0x9f')]=_0x324eae[_0x429d('0x97')]>=parseInt(_0x201e81[_0x429d('0x110')])?'x':'i';}else{_0x4845f5[_0x429d('0x9f')]=_0x324eae[_0x429d('0x97')]>=parseInt(_0x201e81['mindigit'])&&_0x324eae[_0x429d('0x97')]<=parseInt(_0x201e81[_0x429d('0x111')])?'x':'i';}var _0x296879=this[_0x429d('0x9c')][_0x429d('0x6a')](this,_0x201e81[_0x429d('0xd3')]);if(!_0x296879){return this['channel']['error'](_0x201e81,_0x429d('0xd5'));}this[_0x429d('0xf')][_0x429d('0x99')](_0x296879,_0x324eae);if(this['isConfigured'](_0x201e81[_0x429d('0x112')])){var _0x29a90f=parseInt(_0x201e81['hiddendigitsnum'],0xa);var _0x292c5a=rs[_0x429d('0x113')]({'charset':'*','length':_0x29a90f});var _0x2b5287=_0x324eae[_0x429d('0x97')];if(_0x2b5287>0x0){if(_0x2b5287>_0x29a90f){this[_0x429d('0x36')]['sync'](this,_0x201e81,_0x201e81[_0x429d('0x114')]===_0x429d('0x115')?_0x292c5a+_0x324eae['substr'](_0x29a90f):_0x324eae[_0x429d('0x116')](0x0,_0x2b5287-_0x29a90f)+_0x292c5a);}else{this[_0x429d('0x36')][_0x429d('0x6a')](this,_0x201e81,rs['generate']({'charset':'*','length':_0x2b5287}));}}else{this[_0x429d('0x36')]['sync'](this,_0x201e81,'');}}else{this[_0x429d('0x36')][_0x429d('0x6a')](this,_0x201e81,_0x324eae);}return _0x4845f5;};AGIVertices[_0x429d('0x11')][_0x429d('0xe')]=function(_0x2156f3){logger[_0x429d('0x2d')](util[_0x429d('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x2156f3['label']));return this['getdigits'](_0x2156f3);};AGIVertices[_0x429d('0x11')][_0x429d('0x117')]=function(_0x3e195a){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x118'),_0x3e195a[_0x429d('0x38')]));this[_0x429d('0x36')][_0x429d('0x6a')](this,_0x3e195a,_0x3e195a[_0x429d('0x119')]);return this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x11a'),_0x3e195a[_0x429d('0x119')]));};AGIVertices['prototype']['awspolly']=function(_0x3c081b){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x11b'),_0x3c081b[_0x429d('0x38')]));if(!this['isConfigured'](_0x3c081b[_0x429d('0x87')])||!this[_0x429d('0x7e')](_0x3c081b[_0x429d('0x81')])){return this['channel'][_0x429d('0xa4')](_0x429d('0x11c'));}if(!this[_0x429d('0x7e')](_0x3c081b[_0x429d('0x58')])){return this['channel'][_0x429d('0xa4')](_0x429d('0xa5'));}this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x11d'),_0x3c081b[_0x429d('0x58')]));var _0x514b7d=this['awsPolly'][_0x429d('0x6a')](this,_0x3c081b);if(_0x514b7d){this['channel']['noop'](util[_0x429d('0x27')]('aws\x20Polly\x20%s\x20file\x20created',_0x514b7d));var _0x10d349=this[_0x429d('0xf')][_0x429d('0xfc')](_0x514b7d);try{fs[_0x429d('0xfd')](_0x514b7d+_0x429d('0x11e'));}catch(_0x51c0be){logger['error'](_0x51c0be);}return _0x10d349;}return this[_0x429d('0xf')][_0x429d('0x2b')](_0x3c081b,_0x429d('0x11f'));};AGIVertices[_0x429d('0x11')][_0x429d('0x120')]=function(_0x39f1d5){logger[_0x429d('0x2d')](util[_0x429d('0x27')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x39f1d5[_0x429d('0x38')]));if(!this['isConfigured'](_0x39f1d5['aws_access_key_id'])||!this[_0x429d('0x7e')](_0x39f1d5['aws_secret_access_key'])){return this[_0x429d('0xf')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x429d('0x7e')](_0x39f1d5[_0x429d('0x89')])){return this['channel'][_0x429d('0xa4')]('no\x20bot\x20name\x20configured');}if(!this[_0x429d('0x7e')](_0x39f1d5[_0x429d('0x58')])){return this['channel'][_0x429d('0xa4')](_0x429d('0xa5'));}this[_0x429d('0xf')]['bot']=!![];this[_0x429d('0x36')](_0x39f1d5);this[_0x429d('0x42')](_0x39f1d5[_0x429d('0x58')],'in','','');this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x121'),_0x39f1d5['text']));var _0x40c470=this['awsLex'][_0x429d('0x6a')](this,_0x39f1d5);if(_0x40c470){for(var _0x413170 in _0x40c470){if(_0x40c470[_0x429d('0x94')](_0x413170)&&_['isString'](_0x40c470[_0x413170])){this[_0x429d('0xf')][_0x429d('0x99')](util[_0x429d('0x27')](_0x429d('0x122'),_0x413170[_0x429d('0x65')]()),_0x40c470[_0x413170]);}}if(_[_0x429d('0x45')](_0x40c470[_0x429d('0x71')])){return this[_0x429d('0xf')]['noop'](_0x429d('0x123'));}else{this[_0x429d('0x42')](_0x40c470['message'],_0x429d('0xe4'),_0x429d('0x124'),'');return this[_0x429d('0xf')][_0x429d('0xa4')](util['format'](_0x429d('0x125'),_0x40c470[_0x429d('0x71')]));}}return this[_0x429d('0xf')]['error'](_0x39f1d5,_0x429d('0x126'));};AGIVertices['prototype'][_0x429d('0x127')]=function(_0x235513){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x128'),_0x235513['label'],_0x235513['timeout']));if(!this[_0x429d('0x7e')](_0x235513[_0x429d('0x74')])){return this[_0x429d('0xf')][_0x429d('0xa4')]('no\x20key\x20configured');}var _0x3199d7=_0x429d('0x129');var _0x4b4e86=util['format'](_0x429d('0x12a'),FILES_PATH,rs[_0x429d('0x113')](0x4));var _0x2fcee9=util[_0x429d('0x27')]('%s.%s',_0x4b4e86,_0x3199d7);var _0x13abd5=!![];if(_0x235513['beep']===_0x429d('0x12b')){_0x13abd5=![];}var _0x14b95b=this['channel'][_0x429d('0x12c')](_0x4b4e86,_0x3199d7,_0x235513['intKey'],_0x235513[_0x429d('0x61')],undefined,_0x13abd5);if(_0x14b95b[_0x429d('0x9f')]!==-0x1){this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x12d'),_0x2fcee9));var _0x5e51ac=this[_0x429d('0x8a')]['sync'](this,_0x235513,_0x2fcee9);if(_0x5e51ac){for(var _0x167bc2 in _0x5e51ac){if(_0x5e51ac[_0x429d('0x94')](_0x167bc2)){this[_0x429d('0xf')][_0x429d('0x99')](util[_0x429d('0x27')](_0x429d('0x12e'),_0x167bc2[_0x429d('0x65')]()),_0x5e51ac[_0x167bc2]);}}return this[_0x429d('0xf')][_0x429d('0xa4')](util['format']('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x5e51ac)));}}return _0x14b95b;};AGIVertices[_0x429d('0x11')]['tildeasr']=function(_0x47cbb5){logger['info'](util[_0x429d('0x27')](_0x429d('0x12f'),_0x47cbb5[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x47cbb5[_0x429d('0x130')])){return this[_0x429d('0xf')][_0x429d('0xa4')](_0x429d('0x131'));}if(!this['isConfigured'](_0x47cbb5['appsecret'])){return this[_0x429d('0xf')][_0x429d('0xa4')](_0x429d('0x132'));}var _0x583852='wav';var _0x3ee3bc=util[_0x429d('0x27')](_0x429d('0x12a'),FILES_PATH,rs[_0x429d('0x113')](0x4));var _0x3e2ac2=util[_0x429d('0x27')](_0x429d('0x98'),_0x3ee3bc,_0x583852);var _0x2b3125=!![];if(_0x47cbb5['beep']===_0x429d('0x12b')){_0x2b3125=![];}var _0x43176d=this[_0x429d('0xf')]['recordFile'](_0x3ee3bc,_0x583852,_0x47cbb5[_0x429d('0x133')],_0x47cbb5[_0x429d('0x61')],undefined,_0x2b3125);if(_0x43176d[_0x429d('0x9f')]!==-0x1){this['channel'][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x134'),_0x3e2ac2));var _0x152cdc=this[_0x429d('0x8c')][_0x429d('0x6a')](this,_0x47cbb5,_0x3e2ac2);if(_0x152cdc){for(var _0x4df26c in _0x152cdc){if(_0x152cdc[_0x429d('0x94')](_0x4df26c)){this['channel'][_0x429d('0x99')](util[_0x429d('0x27')](_0x429d('0x135'),_0x4df26c[_0x429d('0x65')]()),_0x152cdc[_0x4df26c]);}}return this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x136'),JSON[_0x429d('0x6e')](_0x152cdc)));}}return _0x43176d;};AGIVertices[_0x429d('0x11')]['gotoc']=function(_0x2a60ac){logger['info'](util[_0x429d('0x27')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x2a60ac[_0x429d('0x38')]));return this['channel'][_0x429d('0x137')](_0x2a60ac['context'],_0x2a60ac['extension'],_0x2a60ac[_0x429d('0x3f')]);};AGIVertices['prototype'][_0x429d('0x138')]=function(_0x3507f8){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x139'),_0x3507f8['label']));if(!this[_0x429d('0x7e')](_0x3507f8['condition'])){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x3507f8,_0x429d('0x13a'));}try{var _0x5dbe18=eval(_0x3507f8[_0x429d('0x13b')])?_0x429d('0x13c'):_0x429d('0x13d');this[_0x429d('0xf')][_0x429d('0xa4')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x3507f8[_0x429d('0x13b')],_0x5dbe18));return{'code':0xc8,'result':_0x5dbe18};}catch(_0x47a25f){return{'code':0xc8,'result':_0x429d('0x13d')};}};AGIVertices['prototype'][_0x429d('0x13e')]=function(_0x1d7880){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x13f'),_0x1d7880[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x1d7880[_0x429d('0x140')])){return this['channel'][_0x429d('0x2b')](_0x1d7880,_0x429d('0x141'));}var _0xa86ab4=this[_0x429d('0x142')][_0x429d('0x6a')](this,_0x1d7880[_0x429d('0x140')]);if(!_0xa86ab4){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x1d7880,'no\x20intervals\x20found');}for(var _0x551fe8=0x0;_0x551fe8<_0xa86ab4[_0x429d('0x97')];_0x551fe8+=0x1){var _0x2cc688=this[_0x429d('0xf')]['getVariable'](util[_0x429d('0x27')](_0x429d('0x143'),_0xa86ab4[_0x551fe8]));if(_0x2cc688[_0x429d('0x9f')]===-0x1){return _0x2cc688;}logger['info'](util['format'](_0x429d('0x144'),_0xa86ab4[_0x551fe8],_0x2cc688[_0x429d('0x9d')]));if(_0x2cc688['extra']===_0x429d('0x13c')){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x144'),_0xa86ab4[_0x551fe8],_0x429d('0x13c')));this['channel']['noop'](util[_0x429d('0x27')](_0x429d('0x144'),_0xa86ab4[_0x551fe8],_0x429d('0x13c')));return{'code':0xc8,'result':_0x429d('0x13c')};}else{logger['info'](util['format']('IFTIME\x20%s\x20%s',_0xa86ab4[_0x551fe8],_0x429d('0x13d')));this[_0x429d('0xf')]['noop'](util[_0x429d('0x27')](_0x429d('0x144'),_0xa86ab4[_0x551fe8],_0x429d('0x13d')));}}return{'code':0xc8,'result':_0x429d('0x13d')};};AGIVertices[_0x429d('0x11')]['hangup']=function(_0x754a05){logger[_0x429d('0x2d')](util['format'](_0x429d('0x145'),_0x754a05['label']));return this[_0x429d('0xf')][_0x429d('0x146')]();};AGIVertices[_0x429d('0x11')][_0x429d('0x147')]=function(_0x44bcd0){logger['info'](util[_0x429d('0x27')](_0x429d('0x148'),_0x44bcd0[_0x429d('0x38')]));if(!this['isConfigured'](_0x44bcd0[_0x429d('0x74')])){return this[_0x429d('0xf')]['noop'](_0x429d('0xe1'));}var _0x3454c4='wav';var _0x525515=util[_0x429d('0x27')](_0x429d('0x12a'),FILES_PATH,rs[_0x429d('0x113')](0x4));var _0x40b3d6=util[_0x429d('0x27')]('%s.%s',_0x525515,_0x3454c4);var _0x94f25c=!![];if(_0x44bcd0[_0x429d('0x149')]===_0x429d('0x12b')){_0x94f25c=![];}var _0x383476=this[_0x429d('0xf')][_0x429d('0x12c')](_0x525515,_0x3454c4,_0x44bcd0[_0x429d('0x133')],_0x44bcd0[_0x429d('0x61')],undefined,_0x94f25c);if(_0x383476['result']!==-0x1){this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x14a'),_0x40b3d6));var _0x29a80b=this[_0x429d('0x7c')]['sync'](this,_0x44bcd0,_0x40b3d6);if(_0x29a80b){for(var _0x12c9e2 in _0x29a80b){if(_0x29a80b['hasOwnProperty'](_0x12c9e2)){this['channel'][_0x429d('0x99')](util['format'](_0x429d('0x14b'),_0x12c9e2['toUpperCase']()),_0x29a80b[_0x12c9e2]);}}return this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x14c'),JSON['stringify'](_0x29a80b)));}}return _0x383476;};AGIVertices[_0x429d('0x11')][_0x429d('0x14d')]=function(_0x19e3d3){logger['info'](util[_0x429d('0x27')](_0x429d('0x14e'),_0x19e3d3[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x19e3d3['key'])){return this[_0x429d('0xf')]['noop'](_0x429d('0xe1'));}if(!this['isConfigured'](_0x19e3d3['text'])){return this[_0x429d('0xf')][_0x429d('0xa4')](_0x429d('0xa5'));}this[_0x429d('0xf')]['noop'](util[_0x429d('0x27')]('Trying\x20ispeech\x20TTS\x20%s',_0x19e3d3[_0x429d('0x58')]));var _0x1ae05f=this['ispeechTTS'][_0x429d('0x6a')](this,_0x19e3d3);if(_0x1ae05f){this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x14a'),_0x1ae05f));var _0x450be5=this[_0x429d('0xf')][_0x429d('0xfc')](_0x1ae05f,_0x19e3d3[_0x429d('0x133')]);try{fs[_0x429d('0xfd')](_0x1ae05f+_0x429d('0x11e'));}catch(_0x3e6e72){logger[_0x429d('0x2b')](_0x3e6e72);}return _0x450be5;}return this[_0x429d('0xf')][_0x429d('0x2b')](_0x19e3d3,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x429d('0x11')][_0x429d('0x14f')]=function(_0x55e341){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x150'),_0x55e341[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x55e341[_0x429d('0x151')])){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x55e341,_0x429d('0x152'));}logger[_0x429d('0x2d')](util[_0x429d('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x429d('0x3a')],_0x55e341['findBy']));var _0x5f5034=this[_0x429d('0x53')][_0x429d('0x6a')](this,_0x55e341['findBy']);if(_0x5f5034){logger['info'](util[_0x429d('0x27')](_0x429d('0x153'),this[_0x429d('0xf')]['callerid'],_0x55e341['findBy']));this[_0x429d('0xf')]['noop'](util[_0x429d('0x27')](_0x429d('0x153'),this[_0x429d('0xf')][_0x429d('0x3a')],_0x55e341['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x429d('0x2d')](util['format'](_0x429d('0x154'),this[_0x429d('0xf')][_0x429d('0x3a')],_0x55e341[_0x429d('0x151')]));this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x429d('0xf')][_0x429d('0x3a')],_0x55e341[_0x429d('0x151')]));return{'code':0xc8,'result':_0x429d('0x155')};}};AGIVertices[_0x429d('0x11')][_0x429d('0x156')]=function(_0x4ce6ea){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x157'),_0x4ce6ea['label']));if(!this[_0x429d('0x7e')](_0x4ce6ea['findBy'])){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x4ce6ea,'no\x20find\x20by\x20configured');}logger['info'](util[_0x429d('0x27')](_0x429d('0x158'),this[_0x429d('0xf')][_0x429d('0x3a')],_0x4ce6ea[_0x429d('0x151')]));var _0x5777e0=this['agentLogout'][_0x429d('0x6a')](this,_0x4ce6ea[_0x429d('0x151')]);if(_0x5777e0){logger[_0x429d('0x2d')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x429d('0xf')][_0x429d('0x3a')],_0x4ce6ea[_0x429d('0x151')]));this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x4ce6ea[_0x429d('0x151')]));return{'code':0xc8,'result':_0x429d('0x159')};}else{logger[_0x429d('0x2d')](util['format'](_0x429d('0x154'),this[_0x429d('0xf')][_0x429d('0x3a')],_0x4ce6ea[_0x429d('0x151')]));this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x154'),this[_0x429d('0xf')][_0x429d('0x3a')],_0x4ce6ea[_0x429d('0x151')]));return{'code':0xc8,'result':_0x429d('0x155')};}};AGIVertices['prototype'][_0x429d('0x15a')]=function(_0x47edaf){logger[_0x429d('0x2d')](util[_0x429d('0x27')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x47edaf[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x47edaf[_0x429d('0x15b')])){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x47edaf,_0x429d('0x15c'));}this[_0x429d('0xf')][_0x429d('0xa4')](util['format'](_0x429d('0x15d'),_0x47edaf[_0x429d('0x15b')]));var _0x2e84f5=eval(_0x47edaf[_0x429d('0x15b')]);if(!this['isConfigured'](_0x47edaf[_0x429d('0xd3')])){return this[_0x429d('0xf')][_0x429d('0xa4')](_0x429d('0xd4'));}var _0x3e8c03=this[_0x429d('0x9c')][_0x429d('0x6a')](this,_0x47edaf[_0x429d('0xd3')]);if(!_0x3e8c03){return this[_0x429d('0xf')]['error'](_0x47edaf,_0x429d('0xd5'));}if(_[_0x429d('0x96')](_0x2e84f5)){var _0x31036f=this;_0x2e84f5[_0x429d('0xd6')](function(_0x5b976d,_0x33efdd){_0x31036f[_0x429d('0xf')][_0x429d('0x99')](util[_0x429d('0x27')](_0x429d('0x15e'),_0x3e8c03,_0x33efdd),_0x5b976d);});return this[_0x429d('0xf')]['noop'](util[_0x429d('0x27')](_0x429d('0x15f'),_0x3e8c03));}else{return this[_0x429d('0xf')][_0x429d('0x99')](_0x3e8c03,_0x2e84f5);}};AGIVertices[_0x429d('0x11')]['menu']=function(_0xcd92eb){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x160'),_0xcd92eb[_0x429d('0x38')]));if(_0xcd92eb[_0x429d('0x161')]===0x0){return this[_0x429d('0xa1')](_0xcd92eb);}_0xcd92eb[_0x429d('0x161')]-=0x1;if(!this[_0x429d('0x7e')](_0xcd92eb[_0x429d('0x10a')])){return this[_0x429d('0xf')][_0x429d('0x2b')](_0xcd92eb,_0x429d('0x162'));}var _0x23a99d=this['getSound'][_0x429d('0x6a')](this,_0xcd92eb[_0x429d('0x10a')]);if(!_0x23a99d){return this[_0x429d('0xf')][_0x429d('0x2b')](_0xcd92eb,'no\x20file\x20audio\x20found');}var _0x4b1f1a=this[_0x429d('0xf')][_0x429d('0x10d')](_0x23a99d,_0xcd92eb[_0x429d('0x10e')],_0xcd92eb['digit']);var _0x27e61c=_0x4b1f1a['result'];if(_0x4b1f1a['result']===-0x1){this[_0x429d('0x36')][_0x429d('0x6a')](this,_0xcd92eb,'-1');return _0x4b1f1a;}else if(_0x4b1f1a[_0x429d('0x9d')]===_0x429d('0x61')){_0x4b1f1a[_0x429d('0x9f')]=_0x4b1f1a[_0x429d('0x9f')][_0x429d('0x97')]>0x0?_0x4b1f1a[_0x429d('0x9f')]:'t';}else if(_[_0x429d('0x44')](_0x4b1f1a['result'])){_0x4b1f1a['result']='#';_0x27e61c='#';}if(!this['isConfigured'](_0xcd92eb[_0x429d('0xd3')])){this[_0x429d('0xf')][_0x429d('0xa4')](_0x429d('0xd4'));}else{var _0x35ece4=this[_0x429d('0x9c')][_0x429d('0x6a')](this,_0xcd92eb[_0x429d('0xd3')]);if(!_0x35ece4){return this[_0x429d('0xf')][_0x429d('0x2b')](_0xcd92eb,_0x429d('0xd5'));}this['channel'][_0x429d('0x99')](_0x35ece4,_0x27e61c);}this[_0x429d('0x36')]['sync'](this,_0xcd92eb,_0x27e61c);return _0x4b1f1a;};AGIVertices['prototype'][_0x429d('0xa4')]=function(_0x251512){logger[_0x429d('0x2d')](util['format'](_0x429d('0x163'),_0x251512[_0x429d('0x38')]));return this['channel'][_0x429d('0xa4')](_0x251512['output']||_0x251512[_0x429d('0x38')]);};AGIVertices[_0x429d('0x11')][_0x429d('0x164')]=function(_0x2b306a){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x165'),_0x2b306a[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x2b306a[_0x429d('0x151')])){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x2b306a,_0x429d('0x152'));}logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x158'),this['channel'][_0x429d('0x3a')],_0x2b306a['findBy']));var _0x19336d=this[_0x429d('0x166')][_0x429d('0x6a')](this,_0x2b306a['pause_id']);var _0x58bd6a=this['agentPause']['sync'](this,_0x2b306a['findBy'],_0x19336d);if(_0x58bd6a){logger[_0x429d('0x2d')](util[_0x429d('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x2b306a[_0x429d('0x151')]));this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x153'),this[_0x429d('0xf')][_0x429d('0x3a')],_0x2b306a[_0x429d('0x151')]));return{'code':0xc8,'result':_0x429d('0x159')};}else{logger['info'](util['format'](_0x429d('0x154'),this[_0x429d('0xf')][_0x429d('0x3a')],_0x2b306a[_0x429d('0x151')]));this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x153'),this[_0x429d('0xf')][_0x429d('0x3a')],_0x2b306a[_0x429d('0x151')]));return{'code':0xc8,'result':_0x429d('0x155')};}};AGIVertices['prototype'][_0x429d('0x167')]=function(_0x2b22f7){logger[_0x429d('0x2d')](util[_0x429d('0x27')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x2b22f7[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x2b22f7[_0x429d('0x10a')])){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x2b22f7,_0x429d('0x162'));}var _0xbddbcd=this[_0x429d('0x10b')][_0x429d('0x6a')](this,_0x2b22f7[_0x429d('0x10a')]);if(!_0xbddbcd){return this['channel'][_0x429d('0x2b')](_0x2b22f7,_0x429d('0x10c'));}var _0x24e24a=this[_0x429d('0xf')][_0x429d('0xa6')](_0x429d('0x168'),[_0xbddbcd,_0x2b22f7[_0x429d('0xe0')]]);if(_0x24e24a['result']===-0x1){return _0x24e24a;}return this[_0x429d('0xf')][_0x429d('0xa4')](util['format'](_0x429d('0xbf'),_0x429d('0x168'),_0xbddbcd));};AGIVertices[_0x429d('0x11')][_0x429d('0x169')]=function(_0xc96c90){logger[_0x429d('0x2d')](util[_0x429d('0x27')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0xc96c90[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0xc96c90[_0x429d('0x16a')])){return this[_0x429d('0xf')][_0x429d('0x2b')](_0xc96c90,_0x429d('0x16b'));}var _0x1fd55f='';var _0x23e826=parseInt(_0xc96c90['queue_id'],0xa);if(isNaN(_0x23e826)){_0x1fd55f=_0xc96c90[_0x429d('0x16a')];}else{_0x1fd55f=this['getVoiceQueue']['sync'](this,_0xc96c90[_0x429d('0x16a')]);if(!_0x1fd55f){return this[_0x429d('0xf')]['error'](_0xc96c90,_0x429d('0x16c'));}}var _0x252538='';if(this[_0x429d('0x7e')](_0xc96c90[_0x429d('0x10a')])){var _0x390855=this['getSound'][_0x429d('0x6a')](this,_0xc96c90['file_id']);if(_0x390855){_0x252538=_0x390855;}}this[_0x429d('0x36')][_0x429d('0x6a')](this,_0xc96c90,_0x1fd55f);if(_0xc96c90['opts'][_0x429d('0x16d')]('x')<0x0){_0xc96c90[_0x429d('0xe0')]+='x';}if(_0xc96c90['opts'][_0x429d('0x16d')]('X')<0x0){_0xc96c90['opts']+='X';}this[_0x429d('0xf')][_0x429d('0x99')](_0x429d('0x16e'),_0x1fd55f?_0x1fd55f[_0x429d('0x16f')]():'');var _0x3ee414=this[_0x429d('0xf')][_0x429d('0xa6')](_0x429d('0x170'),[_0x1fd55f,_0xc96c90[_0x429d('0xe0')],_0xc96c90['url'],_0x252538,_0xc96c90['timeout'],_0xc96c90['agi'],_0xc96c90[_0x429d('0x171')],_0xc96c90['gosub'],'',_0xc96c90[_0x429d('0x172')]]);if(_0x3ee414[_0x429d('0x9f')]===-0x1){return _0x3ee414;}return this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0xbf'),_0x429d('0x170'),_0x1fd55f));};AGIVertices[_0x429d('0x11')][_0x429d('0x173')]=function(_0x1fa476){logger[_0x429d('0x2d')](util['format'](_0x429d('0x174'),_0x1fa476['label']));var _0x11177f=_0x1fa476[_0x429d('0x175')]||_0x429d('0x129');var _0x2908dc=util[_0x429d('0x27')]('%s_%s',this['channel']['uniqueid'],rs[_0x429d('0x113')](0x5));var _0x3fc60e=util[_0x429d('0x27')](_0x429d('0x176'),FILES_PATH,_0x2908dc,_0x11177f);var _0x1f423b=util[_0x429d('0x27')]('%s/recordings/%s',FILES_PATH,_0x2908dc);this[_0x429d('0x3b')][_0x429d('0x6a')](this,_0x1fa476,_0x2908dc,_0x3fc60e);this['channel'][_0x429d('0x99')](_0x429d('0x177'),_0x2908dc);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x1f423b,_0x11177f,_0x1fa476['escape_digits'],_0x1fa476['timeout']);return this[_0x429d('0xf')][_0x429d('0x12c')](_0x1f423b,_0x11177f,_0x1fa476[_0x429d('0x178')],_0x1fa476[_0x429d('0x61')],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x4b62d0){logger[_0x429d('0x2d')](util['format'](_0x429d('0x179'),_0x4b62d0[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x4b62d0[_0x429d('0x5e')])){return this[_0x429d('0xf')][_0x429d('0xa4')]('no\x20url\x20configured');}var _0x5ad155=this[_0x429d('0x5d')][_0x429d('0x6a')](this,_0x4b62d0);logger['info'](util[_0x429d('0x27')]('Response:',util[_0x429d('0x17a')](_0x5ad155,{'showHidden':![],'depth':null})));if(!this[_0x429d('0x7e')](_0x4b62d0['variable_id'])){return this[_0x429d('0xf')][_0x429d('0xa4')](_0x429d('0x17b'));}var _0x385ad7=this[_0x429d('0x9c')][_0x429d('0x6a')](this,_0x4b62d0['variable_id']);if(!_0x385ad7){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x4b62d0,'no\x20variable\x20found');}this[_0x429d('0xf')][_0x429d('0x99')](util[_0x429d('0x27')](_0x429d('0x17c'),_0x385ad7),_0x5ad155['statusCode']?_0x5ad155['statusCode']:_0x429d('0x17d'));this[_0x429d('0xf')]['setVariable'](util['format']('%s_STATUS_MESSAGE',_0x385ad7),_0x5ad155['statusMessage']?_0x5ad155[_0x429d('0x17e')]:'OK');if(_0x5ad155[_0x429d('0x66')]){try{this['saveRestApiResult'](_0x5ad155[_0x429d('0x66')],_0x385ad7);}catch(_0x42a82b){logger[_0x429d('0x2b')](util[_0x429d('0x27')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x385ad7));}}return this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0xd9'),_0x385ad7));};AGIVertices[_0x429d('0x11')]['saydigits']=function(_0x75e42a){logger[_0x429d('0x2d')](util[_0x429d('0x27')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x75e42a['label']));return this[_0x429d('0xf')][_0x429d('0x17f')](_0x75e42a[_0x429d('0x180')][_0x429d('0x54')](/\s+/g,''),_0x75e42a[_0x429d('0x178')]);};AGIVertices[_0x429d('0x11')][_0x429d('0x181')]=function(_0x17e251){logger[_0x429d('0x2d')](util[_0x429d('0x27')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x17e251['label']));return this[_0x429d('0xf')]['sayNumber'](_0x17e251['number'][_0x429d('0x54')](/\s+/g,''),_0x17e251[_0x429d('0x178')]);};AGIVertices[_0x429d('0x11')][_0x429d('0x182')]=function(_0x7386e3){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x183'),_0x7386e3[_0x429d('0x38')]));return this[_0x429d('0xf')][_0x429d('0x184')](_0x7386e3['text'],_0x7386e3[_0x429d('0x178')]);};AGIVertices[_0x429d('0x11')][_0x429d('0x185')]=function(_0xeca66f){logger[_0x429d('0x2d')](util['format'](_0x429d('0x186'),_0xeca66f[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0xeca66f[_0x429d('0x187')])){return this['channel'][_0x429d('0xa4')](_0x429d('0x188'));}var _0x3d7843=this[_0x429d('0x189')][_0x429d('0x6a')](this,_0xeca66f[_0x429d('0x187')]);if(!_0x3d7843||!_0x3d7843[_0x429d('0x18a')]){return this[_0x429d('0xf')][_0x429d('0x2b')](_0xeca66f,_0x429d('0x18b'));}var _0x319884={'from':util[_0x429d('0x27')](_0x429d('0x18c'),_0x3d7843[_0x429d('0x14')],_0x3d7843[_0x429d('0x18d')]||_0x3d7843['Smtp']['user']),'to':_0xeca66f['to']||'','cc':_0xeca66f['cc']||'','bcc':_0xeca66f[_0x429d('0x18e')]||'','subject':_0xeca66f[_0x429d('0x18f')],'html':_0xeca66f['text'],'text':_0xeca66f[_0x429d('0x58')]};if(this[_0x429d('0x7e')](_0xeca66f[_0x429d('0x190')])){}logger[_0x429d('0x191')]('sendMail\x20message',JSON[_0x429d('0x6e')](_0x319884));this[_0x429d('0x36')][_0x429d('0x6a')](this,_0xeca66f,_0xeca66f[_0x429d('0x187')]);this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x192'),_0x3d7843['name']));this[_0x429d('0x24')][_0x429d('0x6a')](this,_0x3d7843[_0x429d('0x193')],_0x319884);return this[_0x429d('0xf')][_0x429d('0xa4')](_0x429d('0x194'));};AGIVertices[_0x429d('0x11')][_0x429d('0x195')]=function(_0x3b6466){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x196'),_0x3b6466[_0x429d('0x38')]));return this['channel'][_0x429d('0xa4')](_0x429d('0x197'));};AGIVertices[_0x429d('0x11')][_0x429d('0x198')]=function(_0xb2eb23){logger[_0x429d('0x2d')](util['format'](_0x429d('0x199'),_0xb2eb23['label']));if(!this['isConfigured'](_0xb2eb23[_0x429d('0x19a')])){return this[_0x429d('0xf')]['noop'](_0x429d('0x19b'));}var _0x321e54=this['getSmsAccount'][_0x429d('0x6a')](this,_0xb2eb23[_0x429d('0x19a')]);if(!_0x321e54){return this['channel'][_0x429d('0x2b')](_0xb2eb23,'no\x20sms\x20account\x20found');}var _0x2f98c0={'body':_0xb2eb23[_0x429d('0x19c')],'phone':_0xb2eb23['to']||'','SmsAccountId':_0x321e54['id']};logger[_0x429d('0x191')](_0x429d('0x19d'),JSON[_0x429d('0x6e')](_0x2f98c0));this[_0x429d('0x36')]['sync'](this,_0xb2eb23,_0xb2eb23[_0x429d('0x19a')]);this[_0x429d('0xf')]['noop'](util['format'](_0x429d('0x19e'),_0x321e54[_0x429d('0x14')]));this[_0x429d('0x35')][_0x429d('0x6a')](this,_0x2f98c0);return this['channel'][_0x429d('0xa4')](_0x429d('0x19f'));};AGIVertices[_0x429d('0x11')][_0x429d('0x1a0')]=function(_0x4dfb4c){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x1a1'),_0x4dfb4c['label']));if(!this['isConfigured'](_0x4dfb4c[_0x429d('0xd3')])){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x4dfb4c,_0x429d('0x1a2'));}var _0x5a3fd6=this[_0x429d('0x9c')]['sync'](this,_0x4dfb4c[_0x429d('0xd3')]);if(!_0x5a3fd6){return this['channel'][_0x429d('0x2b')](_0x4dfb4c,_0x429d('0xd5'));}return this[_0x429d('0xf')][_0x429d('0x99')](_0x5a3fd6,_0x4dfb4c[_0x429d('0x1a3')]);};AGIVertices[_0x429d('0x11')][_0x429d('0x1a4')]=function(_0x366caf){logger[_0x429d('0x2d')](util[_0x429d('0x27')]('Enter\x20in\x20START\x20(%s)\x20block',_0x366caf['label']));this[_0x429d('0xf')][_0x429d('0xa4')](_0x429d('0x1a5'));var _0x409079=this[_0x429d('0xf')]['getVariable'](_0x429d('0x1a6'));if(!_['isEmpty'](_0x409079[_0x429d('0x9d')])){this[_0x429d('0xf')][_0x429d('0x37')]=_0x409079[_0x429d('0x9d')];}if(_0x366caf[_0x429d('0xb5')]===_0x429d('0x1a7')){this[_0x429d('0xf')][_0x429d('0xa4')](_0x429d('0x1a8'));return this[_0x429d('0xf')]['answer']();}return this['channel'][_0x429d('0xa4')](_0x429d('0x1a9'));};AGIVertices[_0x429d('0x11')]['subproject']=function(_0x3ee42d){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x1aa'),_0x3ee42d[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x3ee42d[_0x429d('0x1ab')])){return this[_0x429d('0xf')]['error'](_0x3ee42d,_0x429d('0x1ac'));}var _0x49a014=this[_0x429d('0x18')]['sync'](this,_0x3ee42d['project_id']);if(!this['isConfigured'](_0x49a014)){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x3ee42d,util[_0x429d('0x27')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x3ee42d[_0x429d('0x1ab')]));}if(_0x49a014===this[_0x429d('0xf')][_0x429d('0x39')]){return this['channel'][_0x429d('0x2b')](_0x3ee42d,_0x429d('0x1ad'));}this['createSquareDetailsReport'][_0x429d('0x6a')](this,_0x3ee42d,_0x49a014);var _0x5c5096=this['channel'][_0x429d('0xa6')](_0x429d('0x1ae'),util[_0x429d('0x27')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x429d('0x7')][_0x429d('0x1af')]||_0x429d('0x1b0'),_0x49a014,this[_0x429d('0xf')]['arg_1']));if(_0x5c5096[_0x429d('0x9f')]===-0x1){return _0x5c5096;}return this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0xbf'),_0x429d('0x1ae'),_0x49a014));};AGIVertices['prototype']['system']=function(_0x44ab4b){logger[_0x429d('0x2d')](util['format'](_0x429d('0x1b1'),_0x44ab4b[_0x429d('0x38')]));var _0x14b452=this[_0x429d('0x1b2')][_0x429d('0x6a')](this,_0x44ab4b[_0x429d('0xb3')]);this[_0x429d('0x36')][_0x429d('0x6a')](this,_0x44ab4b,_0x44ab4b['command']);if(this[_0x429d('0x7e')](_0x44ab4b[_0x429d('0xd3')])){var _0x3ff89d=this[_0x429d('0x9c')][_0x429d('0x6a')](this,_0x44ab4b[_0x429d('0xd3')]);if(_0x3ff89d){this[_0x429d('0xf')][_0x429d('0x99')](_0x3ff89d,_0x14b452);return this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x1b3'),_0x44ab4b[_0x429d('0xb3')],_0x3ff89d));}}return this['channel'][_0x429d('0xa4')](util[_0x429d('0x27')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x44ab4b[_0x429d('0xb3')]));};AGIVertices['prototype'][_0x429d('0x1b4')]=function(_0x40b7f3){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x1b5'),_0x40b7f3[_0x429d('0x38')]));_0x40b7f3[_0x429d('0x58')]=_0x40b7f3[_0x429d('0x58')][_0x429d('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x429d('0x7e')](_0x40b7f3[_0x429d('0x56')])){return this['channel'][_0x429d('0xa4')](_0x429d('0x1b6'));}if(!this[_0x429d('0x7e')](_0x40b7f3[_0x429d('0x58')])){return this['channel']['noop'](_0x429d('0xa5'));}this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x1b7'),_0x40b7f3[_0x429d('0x58')]));var _0x3f9dbd=this[_0x429d('0x55')][_0x429d('0x6a')](this,_0x40b7f3);if(_0x3f9dbd){this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x1b8'),_0x3f9dbd));var _0x1b0bda=this[_0x429d('0xf')]['streamFile'](_0x3f9dbd);try{fs['unlink'](_0x3f9dbd+_0x429d('0x11e'));}catch(_0x1f425c){logger[_0x429d('0x2b')](_0x1f425c);}return _0x1b0bda;}return this[_0x429d('0xf')][_0x429d('0x2b')](_0x40b7f3,_0x429d('0x1b9'));};AGIVertices[_0x429d('0x11')][_0x429d('0x1ba')]=function(_0x13813f){logger[_0x429d('0x2d')](util['format'](_0x429d('0x1bb'),_0x13813f['label']));_0x13813f[_0x429d('0x58')]=_0x13813f[_0x429d('0x58')][_0x429d('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x13813f[_0x429d('0x58')])){return this['channel'][_0x429d('0xa4')](_0x429d('0xa5'));}this['channel']['noop'](util['format'](_0x429d('0x1bc'),_0x13813f[_0x429d('0x58')]));var _0x2ac4da=this[_0x429d('0x5c')][_0x429d('0x6a')](this,_0x13813f);if(_0x2ac4da){this['channel'][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x1bd'),_0x2ac4da));var _0x7d21b5=this[_0x429d('0xf')]['streamFile'](_0x2ac4da);try{fs[_0x429d('0xfd')](_0x2ac4da+_0x429d('0x11e'));}catch(_0x54689c){logger[_0x429d('0x2b')](_0x54689c);}return _0x7d21b5;}return this[_0x429d('0xf')][_0x429d('0x2b')](_0x13813f,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x429d('0x11')][_0x429d('0x1be')]=function(_0x13d774){logger['info'](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x13d774[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x13d774[_0x429d('0x151')])){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x13d774,_0x429d('0x152'));}logger['info'](util['format'](_0x429d('0x158'),this[_0x429d('0xf')][_0x429d('0x3a')],_0x13d774['findBy']));var _0xdea114=this[_0x429d('0x51')][_0x429d('0x6a')](this,_0x13d774['findBy']);if(_0xdea114){logger['info'](util[_0x429d('0x27')](_0x429d('0x153'),this[_0x429d('0xf')][_0x429d('0x3a')],_0x13d774[_0x429d('0x151')]));this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x153'),this[_0x429d('0xf')][_0x429d('0x3a')],_0x13d774[_0x429d('0x151')]));return{'code':0xc8,'result':_0x429d('0x159')};}else{logger[_0x429d('0x2d')](util[_0x429d('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x429d('0xf')][_0x429d('0x3a')],_0x13d774['findBy']));this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0x154'),this[_0x429d('0xf')][_0x429d('0x3a')],_0x13d774['findBy']));return{'code':0xc8,'result':_0x429d('0x155')};}};AGIVertices[_0x429d('0x11')]['voicemail']=function(_0x494f28){logger[_0x429d('0x2d')](util[_0x429d('0x27')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x494f28[_0x429d('0x38')]));var _0x391509=this[_0x429d('0xf')][_0x429d('0xa6')](_0x429d('0x1bf'),[_0x494f28['mailbox'],_0x494f28[_0x429d('0x72')]]);if(_0x391509[_0x429d('0x9f')]===-0x1){return _0x391509;}return this[_0x429d('0xf')][_0x429d('0xa4')](util[_0x429d('0x27')](_0x429d('0xbf'),_0x429d('0x1bf'),_0x494f28[_0x429d('0x1c0')]));};AGIVertices['prototype'][_0x429d('0x1c1')]=function(_0x54bca8){logger[_0x429d('0x2d')](util[_0x429d('0x27')](_0x429d('0x1c2'),_0x54bca8[_0x429d('0x38')]));if(!this[_0x429d('0x7e')](_0x54bca8['variable_id'])){return this['channel'][_0x429d('0x2b')](_0x54bca8,_0x429d('0x1a2'));}var _0x5c6d0f=this[_0x429d('0x9c')][_0x429d('0x6a')](this,_0x54bca8[_0x429d('0xd3')]);if(!_0x5c6d0f){return this[_0x429d('0xf')][_0x429d('0x2b')](_0x54bca8,_0x429d('0xd5'));}var _0x5b34b5=this[_0x429d('0xf')][_0x429d('0x9c')](_0x5c6d0f);return{'code':0xc8,'result':_0x5b34b5['extra']?_0x5b34b5[_0x429d('0x9d')]:'-'};};String['prototype'][_0x429d('0x9b')]=function(_0x5e2a9c,_0x19f4a4){return this[_0x429d('0x9a')](_0x5e2a9c)['join'](_0x19f4a4);};module[_0x429d('0x1c3')]=AGIVertices; \ No newline at end of file +var _0x0c02=['TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','response','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','agentPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','getVoiceQueue','indexOf','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','user','bcc','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Trying\x20Google\x20TTS\x20%s','googleTTS','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','channel','rpc','mailRpc','getVariableById','then','name','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','prototype','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','interval','map','Intervals','%s/sounds/converted/%s','error','info','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','context','extension','accountcode','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','callback','scheduledAt','toString','callback_priority','getPause','agent','agentUnpause','agentLogout','internal','format','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','result','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','exec','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','getdigits','retry','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav'];(function(_0x243645,_0x1fec5a){var _0x37cbf5=function(_0x21a35e){while(--_0x21a35e){_0x243645['push'](_0x243645['shift']());}};_0x37cbf5(++_0x1fec5a);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x20c0('0x0'));var sh=require(_0x20c0('0x1'));var odbc=require('odbc')();var rs=require(_0x20c0('0x2'));var moment=require(_0x20c0('0x3'));var Mustache=require(_0x20c0('0x4'));var rp=require(_0x20c0('0x5'));var logger=require(_0x20c0('0x6'))(_0x20c0('0x7'));var config=require(_0x20c0('0x8'));var scripts=require(_0x20c0('0x9'));var FILES_PATH=_0x20c0('0xa');var recursiveMapAttributes=[_0x20c0('0xb'),'rawBody'];var verticesWithRetry=['menu','getdigits','getsecretdigits'];var AGIVertices=function(_0x1e35e2,_0x276e9b,_0xcdc174){this[_0x20c0('0xc')]=_0x1e35e2;this[_0x20c0('0xd')]=_0x276e9b;this[_0x20c0('0xe')]=_0xcdc174;};AGIVertices['prototype']['getVariable']=function(_0x52eb0d,_0x578592){this['rpc'][_0x20c0('0xf')](_0x52eb0d)[_0x20c0('0x10')](function(_0x2ecab9){_0x578592(null,_0x2ecab9?_0x2ecab9[_0x20c0('0x11')]:![]);})['catch'](function(_0x56fa09){_0x578592(_0x56fa09);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x34a930,_0xfc2d9c){this[_0x20c0('0xd')][_0x20c0('0x12')](_0x34a930)[_0x20c0('0x10')](function(_0x1e6662){_0xfc2d9c(null,_0x1e6662?_0x1e6662[_0x20c0('0x11')]:![]);})[_0x20c0('0x13')](function(_0x280aff){_0xfc2d9c(_0x280aff);});};AGIVertices['prototype'][_0x20c0('0x14')]=function(_0xc78626,_0x1a708e){this[_0x20c0('0xd')][_0x20c0('0x15')](_0xc78626)[_0x20c0('0x10')](function(_0x5d6d18){_0x1a708e(null,_0x5d6d18?_0x5d6d18['name']:![]);})['catch'](function(_0x10a921){_0x1a708e(_0x10a921);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x17')]=function(_0x43a885,_0x5b3725){this[_0x20c0('0xd')][_0x20c0('0x18')](_0x43a885)[_0x20c0('0x10')](function(_0x5851eb){_0x5b3725(null,_0x5851eb?_0x5851eb['dsn']:![]);})[_0x20c0('0x13')](function(_0x108973){_0x5b3725(_0x108973);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x19')]=function(_0x36ed49,_0x53d8e8){this[_0x20c0('0xd')][_0x20c0('0x1a')](_0x36ed49)[_0x20c0('0x10')](function(_0x8a887a){_0x53d8e8(null,_0x8a887a?_0x8a887a['name']:![]);})[_0x20c0('0x13')](function(_0x3e545c){_0x53d8e8(_0x3e545c);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x1b')]=function(_0x44642a,_0x41ab51){this[_0x20c0('0xd')]['getTrunkById'](_0x44642a)[_0x20c0('0x10')](function(_0x595d94){_0x41ab51(null,_0x595d94?_0x595d94[_0x20c0('0x11')]:![]);})[_0x20c0('0x13')](function(_0x11da5a){_0x41ab51(_0x11da5a);});};AGIVertices[_0x20c0('0x16')]['getSound']=function(_0x4e0cbb,_0x3012d5){var _0x198bdd=this;this[_0x20c0('0xd')]['getSoundById'](_0x4e0cbb)[_0x20c0('0x10')](function(_0x25592b){_0x3012d5(null,_0x25592b?_0x198bdd[_0x20c0('0x1c')](_0x25592b[_0x20c0('0x1d')]):![]);})['catch'](function(_0x49b738){_0x3012d5(_0x49b738);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x1e')]=function(_0x3edc22,_0xe961ad){this[_0x20c0('0xd')][_0x20c0('0x1f')](_0x3edc22)[_0x20c0('0x10')](function(_0x40c0a7){_0xe961ad(null,_0x40c0a7?_0x40c0a7:![]);})[_0x20c0('0x13')](function(_0x191ad8){_0xe961ad(_0x191ad8);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x20')]=function(_0x1fef93,_0x45fa64,_0x55ede5){this[_0x20c0('0xe')][_0x20c0('0x20')](_0x1fef93,_0x45fa64)[_0x20c0('0x10')](function(){_0x55ede5(null);})[_0x20c0('0x13')](function(_0x59406e){_0x55ede5(_0x59406e);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x21')]=function(_0x355db9,_0x1ba29e){this[_0x20c0('0xd')]['getIntervalById'](_0x355db9)[_0x20c0('0x10')](function(_0x538595){if(_0x538595){if(_0x538595['IntervalId']){_0x1ba29e(null,[_0x538595[_0x20c0('0x22')]]);}else{_0x1ba29e(null,_[_0x20c0('0x23')](_0x538595[_0x20c0('0x24')],_0x20c0('0x22')));}}else{_0x1ba29e(null,![]);}})[_0x20c0('0x13')](function(_0x39fd84){_0x1ba29e(_0x39fd84);});};AGIVertices[_0x20c0('0x16')]['getSoundPath']=function(_0x5f4cc9){return util['format'](_0x20c0('0x25'),FILES_PATH,_0x5f4cc9);};AGIVertices[_0x20c0('0x16')]['getQueryOdbc']=function(_0x346a04,_0x20d6f3,_0x550d2c){odbc['open'](_0x346a04,function(_0x700675){if(_0x700675){logger[_0x20c0('0x26')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x700675);_0x550d2c(_0x700675);}else{logger[_0x20c0('0x27')]('ODBC\x20connection\x20successfully');odbc[_0x20c0('0x28')](_0x20d6f3,function(_0x31bf03,_0xcaa484){if(_0x31bf03){logger[_0x20c0('0x27')]('Error\x20executing\x20query\x20%s',_0x20d6f3);_0x550d2c(_0x31bf03);}else{logger[_0x20c0('0x27')](_0x20c0('0x29'),_0x20d6f3);odbc[_0x20c0('0x2a')](function(_0x415b41){if(_0x415b41){logger[_0x20c0('0x26')](_0x20c0('0x2b'),_0x415b41);}_0x550d2c(null,_0xcaa484);});}});}});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x2c')]=function(_0x57bb71,_0x52664c){this['rpc'][_0x20c0('0x2d')](_0x57bb71)['then'](function(_0x438a22){_0x52664c(null,_0x438a22?_0x438a22:![]);})[_0x20c0('0x13')](function(_0x88863){_0x52664c(_0x88863);});};AGIVertices[_0x20c0('0x16')]['createSmsMessage']=function(_0x178d92,_0x5bf7b8){this['rpc'][_0x20c0('0x2e')](_0x178d92)[_0x20c0('0x10')](function(_0x456d28){_0x5bf7b8(null,_0x456d28);})[_0x20c0('0x13')](function(_0x5c06c4){_0x5bf7b8(_0x5c06c4);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x2f')]=function(_0x39852a,_0x1ef892,_0x4df560){this[_0x20c0('0xd')][_0x20c0('0x2f')]({'uniqueid':this['channel'][_0x20c0('0x30')],'node':_0x39852a[_0x20c0('0x31')],'application':_0x39852a[_0x20c0('0x32')],'data':_0x1ef892||null,'project_name':this['channel'][_0x20c0('0x33')],'callerid':this['channel']['callerid']})['then'](function(_0x36ccf2){if(_0x4df560){_0x4df560(null,_0x36ccf2);}})['catch'](function(_0x12945c){if(_0x4df560){_0x4df560(_0x12945c);}});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x34')]=function(_0x3e5c62,_0x15f299,_0x2c95a4,_0x267f97){this['rpc'][_0x20c0('0x34')]({'uniqueid':this[_0x20c0('0xc')][_0x20c0('0x30')],'callerid':this[_0x20c0('0xc')][_0x20c0('0x35')],'calleridname':this[_0x20c0('0xc')]['calleridname'],'context':this['channel'][_0x20c0('0x36')],'extension':this[_0x20c0('0xc')][_0x20c0('0x37')],'priority':this['channel']['priority'],'accountcode':this[_0x20c0('0xc')][_0x20c0('0x38')],'dnid':this[_0x20c0('0xc')]['dnid'],'projectName':this[_0x20c0('0xc')][_0x20c0('0x33')],'saveName':_0x15f299,'filename':_0x3e5c62['file']||_0x15f299,'savePath':_0x2c95a4})['then'](function(_0x3fb4f1){_0x267f97(null,_0x3fb4f1);})['catch'](function(_0xdd2a3b){_0x267f97(_0xdd2a3b);});};AGIVertices['prototype'][_0x20c0('0x39')]=function(_0x425953,_0x5dd76d,_0x555e5a,_0x18810f,_0x149376){this[_0x20c0('0xd')][_0x20c0('0x39')]({'uniqueid':this[_0x20c0('0xc')][_0x20c0('0x30')],'body':_0x425953,'direction':_0x5dd76d,'providerName':_0x555e5a,'providerResponse':_0x18810f})[_0x20c0('0x10')](function(_0x20faa2){if(_0x149376){_0x149376(null,_0x20faa2);}})['catch'](function(_0x24b5f5){if(_0x149376){_0x149376(_0x24b5f5);}});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x3a')]=function(_0xe50137,_0x2c3404){this['rpc']['createCmContact']({'firstName':_[_0x20c0('0x3b')](_0xe50137[_0x20c0('0x11')])||_[_0x20c0('0x3c')](_0xe50137[_0x20c0('0x11')])?_0x20c0('0x3d')+Math[_0x20c0('0x3e')]():_0xe50137[_0x20c0('0x11')],'lastName':_['isEmpty'](_0xe50137['lastName'])||_[_0x20c0('0x3c')](_0xe50137[_0x20c0('0x3f')])?null:_0xe50137[_0x20c0('0x3f')],'phone':_0xe50137['phone'],'ListId':_0xe50137[_0x20c0('0x40')],'scheduledat':_0xe50137['scheduledAt'],'callbackUniqueid':this[_0x20c0('0xc')][_0x20c0('0x30')],'tags':_0x20c0('0x41'),'description':'Callback\x20scheduled\x20at\x20'+_0xe50137[_0x20c0('0x42')][_0x20c0('0x43')](),'priority':_0xe50137[_0x20c0('0x44')]})[_0x20c0('0x10')](function(_0x1e62e3){_0x2c3404(null,_0x1e62e3);})['catch'](function(_0xe7a292){_0x2c3404(_0xe7a292);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x45')]=function(_0x1aafc3,_0x57f482){this[_0x20c0('0xd')]['getPauseById'](_0x1aafc3)[_0x20c0('0x10')](function(_0x5d40c9){_0x57f482(null,_0x5d40c9?_0x5d40c9[_0x20c0('0x11')]:![]);})[_0x20c0('0x13')](function(_0x2cf512){_0x57f482(_0x2cf512);});};AGIVertices[_0x20c0('0x16')]['agentPause']=function(_0x371cbb,_0xcd87e8,_0x1e1c4b){var _0x12f2d2={'role':_0x20c0('0x46')};_0x12f2d2[_0x371cbb]=this[_0x20c0('0xc')][_0x20c0('0x35')];this[_0x20c0('0xd')]['agentPause'](_0x12f2d2,_0xcd87e8,this[_0x20c0('0xc')][_0x20c0('0x30')])[_0x20c0('0x10')](function(_0x56e1f6){_0x1e1c4b(null,_[_0x20c0('0x3c')](_0x56e1f6)?![]:!![]);})[_0x20c0('0x13')](function(_0x57ca28){logger[_0x20c0('0x26')](_0x57ca28);_0x1e1c4b(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x5ee9cf,_0x558d5c){var _0x13093a={'role':_0x20c0('0x46')};_0x13093a[_0x5ee9cf]=this[_0x20c0('0xc')][_0x20c0('0x35')];this[_0x20c0('0xd')][_0x20c0('0x47')](_0x13093a)[_0x20c0('0x10')](function(_0x247dee){_0x558d5c(null,_[_0x20c0('0x3c')](_0x247dee)?![]:!![]);})['catch'](function(_0x32d445){logger[_0x20c0('0x26')](_0x32d445);_0x558d5c(null,![]);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x48')]=function(_0x2fd893,_0x189c6b){var _0x788e01={'role':_0x20c0('0x46')};_0x788e01[_0x2fd893]=this[_0x20c0('0xc')][_0x20c0('0x35')];this['rpc'][_0x20c0('0x48')](_0x788e01)[_0x20c0('0x10')](function(_0x1ae801){_0x189c6b(null,_[_0x20c0('0x3c')](_0x1ae801)?![]:!![]);})['catch'](function(_0x488e79){logger[_0x20c0('0x26')](_0x488e79);_0x189c6b(null,![]);});};AGIVertices[_0x20c0('0x16')]['agentLogin']=function(_0x2222eb,_0x4bc360){var _0x12080a={'role':_0x20c0('0x46')};_0x12080a[_0x2222eb]=this[_0x20c0('0xc')]['callerid'];var _0x59c854=_0x2222eb!=_0x20c0('0x49')?util[_0x20c0('0x4a')](_0x20c0('0x4b'),_0x20c0('0x4c'),this['channel']['callerid']):undefined;this['rpc'][_0x20c0('0x4d')](_0x12080a,_0x59c854)[_0x20c0('0x10')](function(_0x3c0b96){_0x4bc360(null,_['isNil'](_0x3c0b96)?![]:!![]);})['catch'](function(_0x21dbbf){logger[_0x20c0('0x26')](_0x21dbbf);_0x4bc360(null,![]);});};AGIVertices['prototype'][_0x20c0('0x4e')]=function(_0x57d80e,_0x4b2199){sh['exec'](_[_0x20c0('0x4f')](_0x57d80e),function(_0x4bb071,_0x2d7c27){var _0x4f2868=_0x2d7c27[_0x20c0('0x50')](/(\r\n|\n|\r)/gm,'');_0x4b2199(null,_0x4f2868);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x51')]=function(_0x47efdb,_0x589b56){scripts[_0x20c0('0x51')](_0x47efdb[_0x20c0('0x52')],_0x47efdb[_0x20c0('0x53')]||_0x20c0('0x54'),_0x47efdb['text'],_0x47efdb['languageCode']||_0x20c0('0x55'),_0x47efdb[_0x20c0('0x56')]||_0x20c0('0x57'),_0x47efdb[_0x20c0('0x58')]||'MP3')[_0x20c0('0x10')](function(_0x15a774){_0x589b56(null,_0x15a774);})[_0x20c0('0x13')](function(_0x4c83c0){_0x589b56(_0x4c83c0);});};AGIVertices['prototype']['googleTTS']=function(_0x39a28e,_0xe3c380){scripts['googleTTS'](_0x39a28e['text'],_0x39a28e[_0x20c0('0x59')]||'en',0x1)['then'](function(_0x5c0d59){_0xe3c380(null,_0x5c0d59);})[_0x20c0('0x13')](function(_0x45ca41){_0xe3c380(_0x45ca41);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x5a')]=function(_0x261212,_0x45f1ad){var _0x15c42e={'uri':_0x261212[_0x20c0('0x5b')],'method':_0x261212[_0x20c0('0x5c')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x261212[_0x20c0('0x5d')])===_0x20c0('0x5e')&&parseInt(_0x261212['timeout'])>=0x1?parseInt(_0x261212[_0x20c0('0x5d')])*0x3e8:0x5*0x3e8};if(_[_0x20c0('0x5f')]([_0x20c0('0x60'),_0x20c0('0x61')],_0x15c42e['method'][_0x20c0('0x62')]())){try{_0x15c42e[_0x20c0('0x63')]=_0x261212[_0x20c0('0x64')]?JSON[_0x20c0('0x65')](_0x261212[_0x20c0('0x64')]):{};}catch(_0x1566ce){logger[_0x20c0('0x26')](_0x20c0('0x66'),_0x1566ce);}}try{_0x15c42e[_0x20c0('0x67')]=_0x261212[_0x20c0('0xb')]?JSON[_0x20c0('0x65')](_0x261212[_0x20c0('0xb')]):{};}catch(_0x1d4e3d){logger[_0x20c0('0x26')](_0x20c0('0x68'),_0x1d4e3d);}if(_0x261212[_0x20c0('0x69')]){try{var _0x39bb39=require(_0x261212[_0x20c0('0x69')])[_0x20c0('0x6a')](this,_0x15c42e);_0x15c42e[_0x20c0('0x6b')]=Mustache[_0x20c0('0x6c')](_0x261212['url'],_0x39bb39,{},['$$','$$']);if(_0x15c42e['headers']){_0x15c42e[_0x20c0('0x67')]=JSON[_0x20c0('0x65')](Mustache[_0x20c0('0x6c')](JSON[_0x20c0('0x6d')](_0x15c42e['headers']),_0x39bb39,{},['$$','$$']));}if(_0x15c42e[_0x20c0('0x63')]){_0x15c42e[_0x20c0('0x63')]=JSON[_0x20c0('0x65')](Mustache['render'](JSON['stringify'](_0x15c42e[_0x20c0('0x63')]),_0x39bb39,{},['$$','$$']));}}catch(_0x38cef7){logger[_0x20c0('0x26')](_0x20c0('0x6e'),_0x38cef7);}}rp(_0x15c42e)['then'](function(_0x525a83){var _0xe08378={'statusCode':_0x525a83[_0x20c0('0x6f')]||0xc8,'statusMessage':_0x525a83[_0x20c0('0x70')]||'OK','headers':_0x525a83[_0x20c0('0x67')]||{},'body':_0x525a83[_0x20c0('0x63')]||{}};_0x45f1ad(null,_0xe08378);})[_0x20c0('0x13')](function(_0x563134){var _0x3c8744={'statusCode':_0x563134[_0x20c0('0x6f')]||0x1f4,'statusMessage':_0x563134['message']||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x563134[_0x20c0('0x71')]['headers']||{},'body':_0x563134[_0x20c0('0x71')][_0x20c0('0x63')]||{}};_0x45f1ad(null,_0x3c8744);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x72')]=function(_0x1f2408,_0x415137){scripts[_0x20c0('0x72')](this[_0x20c0('0xc')]['uniqueid'],_0x1f2408[_0x20c0('0x73')],_0x1f2408[_0x20c0('0x54')],_0x1f2408[_0x20c0('0x74')]||'en')[_0x20c0('0x10')](function(_0x540174){_0x415137(null,_0x540174);})['catch'](function(_0x5c28ad){_0x415137(_0x5c28ad);});};AGIVertices['prototype'][_0x20c0('0x75')]=function(_0x13c005,_0x4bb5df){scripts['googleDialogflowV2'](this[_0x20c0('0xc')]['uniqueid'],_0x13c005['dialogflowV2_project_id'],_0x13c005[_0x20c0('0x76')],_0x13c005[_0x20c0('0x77')],_0x13c005[_0x20c0('0x54')],_0x13c005[_0x20c0('0x78')]||'en')[_0x20c0('0x10')](function(_0x5d9308){_0x4bb5df(null,_0x5d9308);})[_0x20c0('0x13')](function(_0x3f5330){_0x4bb5df(_0x3f5330);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x79')]=function(_0xc7b414,_0x219940){scripts['sestekNDA'](this[_0x20c0('0xc')],_0xc7b414)[_0x20c0('0x10')](function(_0x57fc4b){_0x219940(null,_0x57fc4b);})[_0x20c0('0x13')](function(_0x159309){_0x219940(_0x159309);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x7a')]=function(_0x221018,_0x3ca6fc){scripts[_0x20c0('0x7a')](_0x221018[_0x20c0('0x73')],_0x221018[_0x20c0('0x54')],_0x221018[_0x20c0('0x7b')]||'en-US',_0x221018[_0x20c0('0x7c')])[_0x20c0('0x10')](function(_0x33e6c9){_0x3ca6fc(null,_0x33e6c9);})[_0x20c0('0x13')](function(_0x152f19){_0x3ca6fc(_0x152f19);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x7d')]=function(_0x23b6e8,_0x582ec4,_0x8c369f){scripts[_0x20c0('0x7d')](_0x582ec4,_0x23b6e8[_0x20c0('0x73')],_0x23b6e8[_0x20c0('0x7e')]||_0x20c0('0x55'),this[_0x20c0('0x7f')](_0x23b6e8[_0x20c0('0x80')])?_0x23b6e8[_0x20c0('0x80')]:undefined)['then'](function(_0x4c670c){_0x8c369f(null,_0x4c670c);})[_0x20c0('0x13')](function(_0x1d9116){_0x8c369f(_0x1d9116);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x81')]=function(_0x44add1,_0x59b9ee){scripts[_0x20c0('0x81')](_0x44add1[_0x20c0('0x82')],_0x44add1['aws_secret_access_key'],_0x44add1[_0x20c0('0x83')],_0x44add1[_0x20c0('0x84')]||_0x20c0('0x85'),_0x44add1[_0x20c0('0x54')],_0x44add1[_0x20c0('0x86')]||_0x20c0('0x54'))[_0x20c0('0x10')](function(_0x20b90a){_0x59b9ee(null,_0x20b90a);})['catch'](function(_0x2833f3){_0x59b9ee(_0x2833f3);});};AGIVertices['prototype'][_0x20c0('0x87')]=function(_0x3ec63a,_0x3747b1){scripts[_0x20c0('0x87')](this[_0x20c0('0xc')][_0x20c0('0x30')],_0x3ec63a['aws_access_key_id'],_0x3ec63a[_0x20c0('0x88')],_0x3ec63a[_0x20c0('0x89')],_0x3ec63a['text'],_0x3ec63a[_0x20c0('0x8a')])[_0x20c0('0x10')](function(_0x28c5ea){_0x3747b1(null,_0x28c5ea);})['catch'](function(_0x5e9d54){_0x3747b1(_0x5e9d54);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x8b')]=function(_0x16f70e,_0x223ede,_0x597b32){scripts[_0x20c0('0x8b')](_0x223ede,_0x16f70e[_0x20c0('0x73')],_0x16f70e[_0x20c0('0x8c')]||'en-US')[_0x20c0('0x10')](function(_0x1deed5){_0x597b32(null,_0x1deed5);})['catch'](function(_0x46423a){_0x597b32(_0x46423a);});};AGIVertices['prototype'][_0x20c0('0x8d')]=function(_0x193489,_0x280ce0,_0x485db3){scripts['tildeASR'](_0x280ce0,_0x193489[_0x20c0('0x8e')],_0x193489[_0x20c0('0x8f')],_0x193489[_0x20c0('0x6b')])[_0x20c0('0x10')](function(_0x2321a7){_0x485db3(null,_0x2321a7);})[_0x20c0('0x13')](function(_0x16341d){_0x485db3(_0x16341d);});};AGIVertices[_0x20c0('0x16')]['clear']=function(_0x5860ca){var _0x15b0c6=_[_0x20c0('0x5f')](verticesWithRetry,_0x5860ca[_0x20c0('0x32')])?_0x5860ca:_[_0x20c0('0x90')](_0x5860ca);for(var _0x16a426 in _0x15b0c6){if(_0x15b0c6[_0x20c0('0x91')](_0x16a426)){if(_0x15b0c6[_0x16a426]&&_[_0x20c0('0x92')](_0x15b0c6[_0x16a426])){if(_[_0x20c0('0x5f')](recursiveMapAttributes,_0x16a426)){_0x15b0c6[_0x16a426]=this[_0x20c0('0x93')](_0x15b0c6[_0x16a426]);}else{_0x15b0c6[_0x16a426]=this[_0x20c0('0x94')](_0x15b0c6[_0x16a426]);}}}}return _0x15b0c6;};AGIVertices[_0x20c0('0x16')]['recursiveNodeIndex']=function(_0x4c243e){for(var _0x4d1d09 in _0x4c243e){if(_0x4c243e[_0x20c0('0x91')](_0x4d1d09)){if(_[_0x20c0('0x95')](_0x4c243e[_0x4d1d09])){this[_0x20c0('0x96')](_0x4c243e[_0x4d1d09]);}else if(_['isArray'](_0x4c243e[_0x4d1d09])){for(var _0x177a33=0x0;_0x177a33<_0x4c243e[_0x4d1d09][_0x20c0('0x97')];_0x177a33++){this[_0x20c0('0x96')](_0x4c243e[_0x4d1d09][_0x177a33]);}}else if(_['isString'](_0x4c243e[_0x4d1d09])){_0x4c243e[_0x4d1d09]=this[_0x20c0('0x94')](_0x4c243e[_0x4d1d09]);}}}};AGIVertices[_0x20c0('0x16')][_0x20c0('0x98')]=function(_0x32cab3,_0x485997){for(var _0x12463d in _0x32cab3){if(_0x32cab3[_0x20c0('0x91')](_0x12463d)){if(_[_0x20c0('0x95')](_0x32cab3[_0x12463d])){if(!_[_0x20c0('0x3b')](_0x32cab3[_0x12463d])){this[_0x20c0('0x98')](_0x32cab3[_0x12463d],util[_0x20c0('0x4a')](_0x20c0('0x99'),_0x485997,_0x12463d));}}else if(_['isArray'](_0x32cab3[_0x12463d])){for(var _0x35ee82=0x0;_0x35ee82<_0x32cab3[_0x12463d][_0x20c0('0x97')];_0x35ee82++){this[_0x20c0('0x98')](_0x32cab3[_0x12463d][_0x35ee82],util[_0x20c0('0x4a')](_0x20c0('0x99'),_0x485997,_0x12463d+'['+_0x35ee82+']'));}}else{if(!_['isNil'](_0x32cab3[_0x12463d])){this[_0x20c0('0xc')][_0x20c0('0x9a')](util[_0x20c0('0x4a')](_0x20c0('0x99'),_0x485997,_0x12463d),_0x32cab3[_0x12463d]);}}}}};AGIVertices[_0x20c0('0x16')][_0x20c0('0x93')]=function(_0x43a157){try{var _0x1c1023=JSON[_0x20c0('0x65')](_0x43a157);this[_0x20c0('0x96')](_0x1c1023);return JSON[_0x20c0('0x6d')](_0x1c1023);}catch(_0x554f70){return this['replaceAllVariables'](_0x43a157);}};AGIVertices[_0x20c0('0x16')][_0x20c0('0x94')]=function(_0x49373f){var _0x41eadc=_0x49373f[_0x20c0('0x9b')]('{');for(var _0x518983=0x1;_0x518983<_0x41eadc[_0x20c0('0x97')];_0x518983+=0x1){var _0x5ef019=_0x41eadc[_0x518983][_0x20c0('0x9b')]('}');if(_0x5ef019[_0x20c0('0x97')]>0x1){_0x49373f=_0x49373f[_0x20c0('0x9c')]('{'+_0x5ef019[0x0]+'}',this[_0x20c0('0xc')][_0x20c0('0x9d')](_0x5ef019[0x0])[_0x20c0('0x9e')]||_0x5ef019[0x0]);}}if(_0x41eadc[_0x20c0('0x97')]===0x1){return _0x49373f['toString']();}return this[_0x20c0('0x94')](_0x49373f);};AGIVertices[_0x20c0('0x16')][_0x20c0('0x9f')]=function(_0x297a3e,_0x4d7b8f){var _0xaf0fe0=this[_0x20c0('0xc')][_0x20c0('0x9d')](_0x297a3e);if(_0xaf0fe0['result']===-0x1){return _0xaf0fe0;}logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0xa0'),_0x4d7b8f,_0xaf0fe0[_0x20c0('0x9e')]));return this['channel'][_0x20c0('0x9a')](_0x4d7b8f,_0xaf0fe0[_0x20c0('0x9e')]);};AGIVertices[_0x20c0('0x16')][_0x20c0('0x7f')]=function(_0x21a582){return _0x21a582&&_0x21a582!=='0'&&_0x21a582!=='-1'&&_0x21a582!=='';};AGIVertices[_0x20c0('0x16')][_0x20c0('0xa1')]=function(_0x306a52){this['createSquareDetailsReport'][_0x20c0('0x6a')](this,_0x306a52,'-');_0x306a52['retry']=_0x306a52[_0x20c0('0xa1')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x20c0('0x16')][_0x20c0('0xa2')]=function(_0x258898){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0xa3'),_0x258898['label']));if(!this[_0x20c0('0x7f')](_0x258898[_0x20c0('0x54')])){return this[_0x20c0('0xc')]['noop'](_0x20c0('0xa4'));}var _0x25e11c='\x22'+_0x258898[_0x20c0('0x54')]+'\x22';if(this[_0x20c0('0x7f')](_0x258898['options'])){_0x25e11c+=','+_0x258898['options'];}var _0x5c6483=this[_0x20c0('0xc')]['exec'](_0x20c0('0xa5'),_0x25e11c);if(_0x5c6483[_0x20c0('0xa6')]===-0x1){return _0x5c6483;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xa8'),_0x25e11c));};AGIVertices[_0x20c0('0x16')][_0x20c0('0xa9')]=function(_0x5a7afb){logger['info'](util[_0x20c0('0x4a')](_0x20c0('0xaa'),_0x5a7afb[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x5a7afb[_0x20c0('0xab')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xac'));}var _0x534840=_0x5a7afb[_0x20c0('0xab')];if(this[_0x20c0('0x7f')](_0x5a7afb[_0x20c0('0x71')])){_0x534840+=','+_0x5a7afb[_0x20c0('0x71')];}var _0x4f9060=this[_0x20c0('0xc')][_0x20c0('0xad')](_0x20c0('0xae'),_0x534840);if(_0x4f9060[_0x20c0('0xa6')]===-0x1){return _0x4f9060;}var _0x385673=this[_0x20c0('0x9f')](_0x20c0('0xaf'),_0x20c0('0xb0'));if(_0x385673[_0x20c0('0xa6')]===-0x1){return _0x385673;}var _0x52e18b=this[_0x20c0('0x9f')](_0x20c0('0xb1'),'MRCP_RECOG_TRANSCRIPT');if(_0x52e18b[_0x20c0('0xa6')]===-0x1){return _0x52e18b;}var _0x518162=this['getAndSetVariable'](_0x20c0('0xb2'),_0x20c0('0xb3'));if(_0x518162[_0x20c0('0xa6')]===-0x1){return _0x518162;}return this['channel'][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x534840));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x7')]=function(_0x4a7aaa){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0xb4'),_0x4a7aaa[_0x20c0('0x31')]));return this[_0x20c0('0xc')][_0x20c0('0x7')]([_0x4a7aaa[_0x20c0('0xb5')],_0x4a7aaa[_0x20c0('0xb6')]]);};AGIVertices[_0x20c0('0x16')][_0x20c0('0xb7')]=function(_0xe175a5){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0xb8'),_0xe175a5[_0x20c0('0x31')]));if(this[_0x20c0('0x7f')](_0xe175a5[_0x20c0('0x5d')])){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0xb9'),_0xe175a5[_0x20c0('0x5d')]));var _0x613d7=this[_0x20c0('0xc')][_0x20c0('0xba')](_0xe175a5[_0x20c0('0x5d')]);if(_0x613d7[_0x20c0('0xa6')]===-0x1){return _0x613d7;}}return this['channel'][_0x20c0('0xb7')]();};AGIVertices['prototype'][_0x20c0('0x41')]=function(_0x328a3a){logger['info'](util[_0x20c0('0x4a')](_0x20c0('0xbb'),_0x328a3a[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x328a3a[_0x20c0('0x40')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x328a3a,_0x20c0('0xbc'));}_0x328a3a[_0x20c0('0x42')]=moment();if(this[_0x20c0('0x7f')](_0x328a3a[_0x20c0('0xbd')])){_0x328a3a['scheduledAt']=moment()[_0x20c0('0xbe')](_0x328a3a[_0x20c0('0xbd')],_0x20c0('0xbf'));}if(!this[_0x20c0('0x7f')](_0x328a3a[_0x20c0('0x44')])){_0x328a3a[_0x20c0('0x44')]=0x2;}this['createCmContact']['sync'](this,_0x328a3a);return this[_0x20c0('0xc')][_0x20c0('0xa7')](util['format'](_0x20c0('0xc0'),_0x328a3a[_0x20c0('0xc1')],_0x328a3a[_0x20c0('0x40')],_0x328a3a[_0x20c0('0x42')]));};AGIVertices[_0x20c0('0x16')][_0x20c0('0xc2')]=function(_0x1c5cd0){logger['info'](util[_0x20c0('0x4a')](_0x20c0('0xc3'),_0x1c5cd0[_0x20c0('0x31')]));var _0x11acd2=this[_0x20c0('0xc')]['exec'](_0x1c5cd0[_0x20c0('0xc4')],_0x1c5cd0[_0x20c0('0x71')]);if(_0x11acd2['result']===-0x1){return _0x11acd2;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xc5'),_0x1c5cd0['application'],_0x1c5cd0[_0x20c0('0x71')]));};AGIVertices[_0x20c0('0x16')]['lumenvoxtts']=function(_0x58ca8e){logger['info'](util[_0x20c0('0x4a')](_0x20c0('0xc6'),_0x58ca8e[_0x20c0('0x31')]));if(!this['isConfigured'](_0x58ca8e[_0x20c0('0x54')])){return this['channel']['noop'](_0x20c0('0xa4'));}var _0x5879e1='\x22'+_0x58ca8e['text']+'\x22';if(this['isConfigured'](_0x58ca8e[_0x20c0('0x71')])){_0x5879e1+=','+_0x58ca8e[_0x20c0('0x71')];}var _0x429542=this[_0x20c0('0xc')][_0x20c0('0xad')](_0x20c0('0xa5'),_0x5879e1);if(_0x429542[_0x20c0('0xa6')]===-0x1){return _0x429542;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5879e1));};AGIVertices[_0x20c0('0x16')][_0x20c0('0xc7')]=function(_0x209be0){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0xc8'),_0x209be0['label']));if(!this[_0x20c0('0x7f')](_0x209be0[_0x20c0('0x54')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')]('no\x20text\x20configured');}var _0x52549c='\x22'+_0x209be0[_0x20c0('0x54')]+'\x22';if(this[_0x20c0('0x7f')](_0x209be0[_0x20c0('0x71')])){_0x52549c+=','+_0x209be0[_0x20c0('0x71')];}var _0x2704d=this['channel'][_0x20c0('0xad')](_0x20c0('0xa5'),_0x52549c);if(_0x2704d[_0x20c0('0xa6')]===-0x1){return _0x2704d;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xa8'),_0x52549c));};AGIVertices[_0x20c0('0x16')]['lumenvoxasr']=function(_0x425457){logger[_0x20c0('0x27')](util['format'](_0x20c0('0xc9'),_0x425457[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x425457[_0x20c0('0xab')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xac'));}var _0x2fa4e2=_0x425457[_0x20c0('0xab')];if(this[_0x20c0('0x7f')](_0x425457[_0x20c0('0x71')])){_0x2fa4e2+=','+_0x425457[_0x20c0('0x71')];}var _0x20e787=this[_0x20c0('0xc')][_0x20c0('0xad')](_0x20c0('0xae'),_0x2fa4e2);if(_0x20e787[_0x20c0('0xa6')]===-0x1){return _0x20e787;}var _0x59c0e5=this[_0x20c0('0x9f')](_0x20c0('0xaf'),_0x20c0('0xca'));if(_0x59c0e5[_0x20c0('0xa6')]===-0x1){return _0x59c0e5;}var _0x5f55be=this[_0x20c0('0x9f')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x5f55be['result']===-0x1){return _0x5f55be;}var _0x4fdd6f=this[_0x20c0('0x9f')]('RECOG_INSTANCE()',_0x20c0('0xcb'));if(_0x4fdd6f['result']===-0x1){return _0x4fdd6f;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xcc'),_0x2fa4e2));};AGIVertices[_0x20c0('0x16')][_0x20c0('0xcd')]=function(_0x21737b){logger[_0x20c0('0x27')](util['format'](_0x20c0('0xce'),_0x21737b['label']));if(!this[_0x20c0('0x7f')](_0x21737b[_0x20c0('0xab')])){return this['channel'][_0x20c0('0xa7')](_0x20c0('0xac'));}var _0x2a27b7=_0x21737b['grammar'];if(this[_0x20c0('0x7f')](_0x21737b[_0x20c0('0x71')])){_0x2a27b7+=','+_0x21737b['options'];}var _0x49f305=this['channel'][_0x20c0('0xad')](_0x20c0('0xae'),_0x2a27b7);if(_0x49f305['result']===-0x1){return _0x49f305;}var _0x313c2f=this[_0x20c0('0x9f')](_0x20c0('0xaf'),_0x20c0('0xcf'));if(_0x313c2f[_0x20c0('0xa6')]===-0x1){return _0x313c2f;}var _0x18710d=this[_0x20c0('0x9f')](_0x20c0('0xb1'),_0x20c0('0xd0'));if(_0x18710d[_0x20c0('0xa6')]===-0x1){return _0x18710d;}var _0x345cfa=this['getAndSetVariable'](_0x20c0('0xb2'),_0x20c0('0xd1'));if(_0x345cfa[_0x20c0('0xa6')]===-0x1){return _0x345cfa;}return this['channel'][_0x20c0('0xa7')](util['format'](_0x20c0('0xcc'),_0x2a27b7));};AGIVertices[_0x20c0('0x16')][_0x20c0('0xd2')]=function(_0xefb28d){logger[_0x20c0('0x27')](util['format'](_0x20c0('0xd3'),_0xefb28d[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0xefb28d[_0x20c0('0xd4')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0xefb28d,'no\x20database\x20selected');}var _0xef71a7=this[_0x20c0('0x17')][_0x20c0('0x6a')](this,_0xefb28d['odbc_id']);if(!_0xef71a7){return this[_0x20c0('0xc')]['error'](_0xefb28d,_0x20c0('0xd5'));}if(!this['isConfigured'](_0xefb28d['query'])){return this['channel'][_0x20c0('0x26')](_0xefb28d,_0x20c0('0xd6'));}var _0x55d6d6=_0xefb28d[_0x20c0('0x28')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x20c0('0xc')]['noop'](util[_0x20c0('0x4a')]('query:\x20%s',_0x55d6d6));var _0x32e47c=this['getQueryOdbc'][_0x20c0('0x6a')](this,_0xef71a7,_0x55d6d6);this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0xefb28d,_0x55d6d6);if(!this['isConfigured'](_0xefb28d[_0x20c0('0xd7')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xd8'));}var _0x33ff42=this[_0x20c0('0x9d')]['sync'](this,_0xefb28d['variable_id']);if(!_0x33ff42){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0xefb28d,_0x20c0('0xd9'));}var _0x3efe75=this;_0x32e47c[_0x20c0('0xda')](function(_0x59d4ff,_0x50dfcf){Object[_0x20c0('0xdb')](_0x59d4ff)[_0x20c0('0xda')](function(_0x34f819){_0x3efe75[_0x20c0('0xc')]['setVariable'](util['format'](_0x20c0('0xdc'),_0x33ff42,_0x50dfcf,_0x34f819),_0x59d4ff[_0x34f819]);});});this['channel'][_0x20c0('0x9a')](util['format'](_0x20c0('0xdd'),_0x33ff42),_0x32e47c[_0x20c0('0x97')]);return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xde'),_0x33ff42));};AGIVertices[_0x20c0('0x16')][_0x20c0('0xdf')]=function(_0x12be6e){logger[_0x20c0('0xe0')](util[_0x20c0('0x4a')](_0x20c0('0xe1'),_0x12be6e[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x12be6e[_0x20c0('0xe2')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x12be6e,'no\x20user\x20selected');}var _0x29ef07=this[_0x20c0('0x19')]['sync'](this,_0x12be6e[_0x20c0('0xe2')]);if(!_0x29ef07){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x12be6e,_0x20c0('0xe3'));}var _0x294b9e=this['channel'][_0x20c0('0xad')](_0x20c0('0xe4'),[util[_0x20c0('0x4a')]('SIP/%s',_0x29ef07),_0x12be6e[_0x20c0('0x5d')],_0x12be6e[_0x20c0('0xe5')],_0x12be6e[_0x20c0('0x5b')]]);if(_0x294b9e[_0x20c0('0xa6')]===-0x1){return _0x294b9e;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xe6'),'DIAL'));};AGIVertices[_0x20c0('0x16')][_0x20c0('0xe7')]=function(_0x37f3f8){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0xe8'),_0x37f3f8[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x37f3f8[_0x20c0('0x73')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x37f3f8[_0x20c0('0x54')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')]('no\x20text\x20configured');}this[_0x20c0('0xc')][_0x20c0('0xe9')]=!![];this[_0x20c0('0x2f')](_0x37f3f8);this[_0x20c0('0x39')](_0x37f3f8[_0x20c0('0x54')],'in','','');this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xea'),_0x37f3f8['text']));var _0x5a0381=this[_0x20c0('0x72')][_0x20c0('0x6a')](this,_0x37f3f8);if(_0x5a0381){for(var _0x2ecd26 in _0x5a0381){if(_0x5a0381['hasOwnProperty'](_0x2ecd26)){this[_0x20c0('0xc')][_0x20c0('0x9a')](util[_0x20c0('0x4a')](_0x20c0('0xeb'),_0x2ecd26['toUpperCase']()),_0x5a0381[_0x2ecd26]);}}this[_0x20c0('0x39')](_0x5a0381[_0x20c0('0xec')],_0x20c0('0xed'),_0x20c0('0xe7'),'');return this[_0x20c0('0xc')][_0x20c0('0xa7')](util['format']('Dialogflow\x20Result\x20%s',_0x5a0381['speech']));}return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x37f3f8,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x20c0('0x16')]['dialogflowV2']=function(_0x12491f){logger['info'](util[_0x20c0('0x4a')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x12491f['label']));if(!this[_0x20c0('0x7f')](_0x12491f[_0x20c0('0xee')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xef'));}if(!this['isConfigured'](_0x12491f['client_email'])){return this['channel'][_0x20c0('0xa7')](_0x20c0('0xf0'));}if(!this[_0x20c0('0x7f')](_0x12491f[_0x20c0('0x77')])){return this['channel'][_0x20c0('0xa7')](_0x20c0('0xf1'));}if(!this['isConfigured'](_0x12491f[_0x20c0('0x78')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xf2'));}if(!this[_0x20c0('0x7f')](_0x12491f[_0x20c0('0x54')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xa4'));}this[_0x20c0('0xc')][_0x20c0('0xe9')]=!![];this[_0x20c0('0x2f')](_0x12491f);this[_0x20c0('0x39')](_0x12491f[_0x20c0('0x54')],'in','','');this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xf3'),_0x12491f[_0x20c0('0x54')]));var _0x2302e2=this['googleDialogflowV2'][_0x20c0('0x6a')](this,_0x12491f);if(_0x2302e2){for(var _0x3d6a26 in _0x2302e2){if(_0x2302e2[_0x20c0('0x91')](_0x3d6a26)){if(_0x3d6a26!==_0x20c0('0xf4')){this['channel'][_0x20c0('0x9a')](util[_0x20c0('0x4a')](_0x20c0('0xeb'),_0x3d6a26[_0x20c0('0x62')]()),_0x2302e2[_0x3d6a26]);}}}this['createSquareMessage'](_0x2302e2[_0x20c0('0xec')],'out',_0x20c0('0xf5'),_0x2302e2[_0x20c0('0xf4')]);return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('DialogflowV2\x20Result\x20%s',_0x2302e2[_0x20c0('0xec')]));}return this['channel'][_0x20c0('0x26')](_0x12491f,_0x20c0('0xf6'));};AGIVertices['prototype'][_0x20c0('0xf7')]=function(_0x3477ad){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0xf8'),_0x3477ad['label']));if(!this[_0x20c0('0x7f')](_0x3477ad[_0x20c0('0xf9')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xfa'));}if(!this[_0x20c0('0x7f')](_0x3477ad['username'])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xfb'));}if(!this[_0x20c0('0x7f')](_0x3477ad[_0x20c0('0xfc')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xfd'));}if(!this[_0x20c0('0x7f')](_0x3477ad[_0x20c0('0xfe')])){return this[_0x20c0('0xc')]['noop']('no\x20text\x20configured');}this[_0x20c0('0xc')]['bot']=!![];this[_0x20c0('0x2f')](_0x3477ad);this[_0x20c0('0x39')](_0x3477ad[_0x20c0('0x54')],'in','','');this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xff'),_0x3477ad[_0x20c0('0x54')]));var _0x36df58=this[_0x20c0('0x79')][_0x20c0('0x6a')](this,_0x3477ad);if(_0x36df58){for(var _0x4b916d in _0x36df58){if(_0x36df58[_0x20c0('0x91')](_0x4b916d)){this[_0x20c0('0xc')]['setVariable'](util['format']('SESTEK_NDA_%s',_0x4b916d[_0x20c0('0x62')]()),_0x36df58[_0x4b916d]);}}this[_0x20c0('0x39')](_0x36df58[_0x20c0('0xec')],_0x20c0('0xed'),_0x20c0('0xf7'),'');if(_0x36df58[_0x20c0('0x100')]){this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x101'),_0x36df58['audiofile']));var _0x255879=this[_0x20c0('0xc')][_0x20c0('0x102')](_0x36df58[_0x20c0('0x100')]);try{fs['unlink'](_0x36df58[_0x20c0('0x100')]+_0x20c0('0x103'));}catch(_0x480dc3){logger['error'](_0x480dc3);}return _0x255879;}else{return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('SestekNDA\x20Result\x20%s',_0x36df58[_0x20c0('0xec')]));}}return this['channel'][_0x20c0('0x26')](_0x3477ad,_0x20c0('0x104'));};AGIVertices[_0x20c0('0x16')]['end']=function(_0x363c68){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x105'),_0x363c68[_0x20c0('0x31')]));return this['channel'][_0x20c0('0xa7')](_0x20c0('0x106'));};AGIVertices['prototype'][_0x20c0('0x107')]=function(_0x19d920){logger['info'](util[_0x20c0('0x4a')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x19d920[_0x20c0('0x31')]));var _0x5071b1='';if(_0x19d920[_0x20c0('0x108')]){if(!this[_0x20c0('0x7f')](_0x19d920['trunk_id'])){return this['channel']['error'](_0x19d920,_0x20c0('0x109'));}else{var _0x3ddec0=parseInt(_0x19d920['trunk_id'],0xa);if(isNaN(_0x3ddec0)){_0x5071b1=_0x19d920['trunk_id'];}else{_0x5071b1=this[_0x20c0('0x1b')][_0x20c0('0x6a')](this,_0x19d920[_0x20c0('0x108')]);if(!_0x5071b1){return this[_0x20c0('0xc')]['error'](_0x19d920,_0x20c0('0x10a'));}}}}else if(_0x19d920[_0x20c0('0x10b')]){_0x5071b1=_0x19d920['trunk_name'];}else{return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x19d920,_0x20c0('0x109'));}var _0x48f9b7=this[_0x20c0('0xc')][_0x20c0('0xad')](_0x20c0('0xe4'),[util[_0x20c0('0x4a')](_0x20c0('0x10c'),_0x5071b1,_0x19d920[_0x20c0('0xc1')]),_0x19d920['timeout'],_0x19d920['opts'],_0x19d920[_0x20c0('0x5b')]]);if(_0x48f9b7[_0x20c0('0xa6')]===-0x1){return _0x48f9b7;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xe6'),_0x20c0('0xe4')));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x10d')]=function(_0x191987){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x191987['label']));return this['channel'][_0x20c0('0xa7')]('finally');};AGIVertices[_0x20c0('0x16')][_0x20c0('0x10e')]=function(_0x14ee0d){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x14ee0d[_0x20c0('0x31')]));if(_0x14ee0d[_0x20c0('0x10f')]===0x0){return this['maxRetry'](_0x14ee0d);}_0x14ee0d['retry']-=0x1;if(!this[_0x20c0('0x7f')](_0x14ee0d[_0x20c0('0x110')])){return this['channel'][_0x20c0('0x26')](_0x14ee0d,_0x20c0('0x111'));}var _0x10812b=this[_0x20c0('0x112')][_0x20c0('0x6a')](this,_0x14ee0d[_0x20c0('0x110')]);if(!_0x10812b){return this['channel'][_0x20c0('0x26')](_0x14ee0d,_0x20c0('0x113'));}if(!this[_0x20c0('0x7f')](_0x14ee0d[_0x20c0('0xd7')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x20c0('0xd8'));}var _0x413740=this['channel'][_0x20c0('0x114')](_0x10812b,_0x14ee0d['response'],_0x14ee0d['maxdigit']);var _0x5d2eb1=_0x413740[_0x20c0('0xa6')]?_0x413740['result'][_0x20c0('0x43')]():'';logger[_0x20c0('0x27')](_0x20c0('0x115'),JSON['stringify'](_0x413740));if(_0x413740['result']===-0x1){this[_0x20c0('0x2f')]['sync'](this,_0x14ee0d,_0x5d2eb1);return _0x413740;}else if(_0x413740[_0x20c0('0x9e')]===_0x20c0('0x5d')){_0x413740[_0x20c0('0xa6')]=_0x5d2eb1['length']>=parseInt(_0x14ee0d[_0x20c0('0x116')])?'x':'i';}else{_0x413740[_0x20c0('0xa6')]=_0x5d2eb1[_0x20c0('0x97')]>=parseInt(_0x14ee0d[_0x20c0('0x116')])&&_0x5d2eb1[_0x20c0('0x97')]<=parseInt(_0x14ee0d[_0x20c0('0x117')])?'x':'i';}var _0x18657e=this['getVariable']['sync'](this,_0x14ee0d[_0x20c0('0xd7')]);if(!_0x18657e){return this['channel']['error'](_0x14ee0d,_0x20c0('0xd9'));}this[_0x20c0('0xc')][_0x20c0('0x9a')](_0x18657e,_0x5d2eb1);if(this[_0x20c0('0x7f')](_0x14ee0d['hiddendigitsnum'])){var _0x438284=parseInt(_0x14ee0d[_0x20c0('0x118')],0xa);var _0x594a02=rs[_0x20c0('0x119')]({'charset':'*','length':_0x438284});var _0x18c9a4=_0x5d2eb1[_0x20c0('0x97')];if(_0x18c9a4>0x0){if(_0x18c9a4>_0x438284){this[_0x20c0('0x2f')]['sync'](this,_0x14ee0d,_0x14ee0d[_0x20c0('0x11a')]===_0x20c0('0x11b')?_0x594a02+_0x5d2eb1[_0x20c0('0x11c')](_0x438284):_0x5d2eb1[_0x20c0('0x11c')](0x0,_0x18c9a4-_0x438284)+_0x594a02);}else{this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0x14ee0d,rs[_0x20c0('0x119')]({'charset':'*','length':_0x18c9a4}));}}else{this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0x14ee0d,'');}}else{this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0x14ee0d,_0x5d2eb1);}return _0x413740;};AGIVertices[_0x20c0('0x16')][_0x20c0('0x11d')]=function(_0x152a3f){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x11e'),_0x152a3f['label']));return this[_0x20c0('0x10e')](_0x152a3f);};AGIVertices[_0x20c0('0x16')][_0x20c0('0x11f')]=function(_0x228cb5){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x120'),_0x228cb5[_0x20c0('0x31')]));this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0x228cb5,_0x228cb5[_0x20c0('0x121')]);return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x122'),_0x228cb5[_0x20c0('0x121')]));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x123')]=function(_0x3f75ec){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x124'),_0x3f75ec[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x3f75ec[_0x20c0('0x82')])||!this[_0x20c0('0x7f')](_0x3f75ec[_0x20c0('0x88')])){return this['channel']['noop'](_0x20c0('0x125'));}if(!this['isConfigured'](_0x3f75ec[_0x20c0('0x54')])){return this['channel']['noop'](_0x20c0('0xa4'));}this['channel'][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x126'),_0x3f75ec['text']));var _0x409ba4=this['awsPolly'][_0x20c0('0x6a')](this,_0x3f75ec);if(_0x409ba4){this[_0x20c0('0xc')][_0x20c0('0xa7')](util['format'](_0x20c0('0x127'),_0x409ba4));var _0x2cce60=this[_0x20c0('0xc')][_0x20c0('0x102')](_0x409ba4);try{fs[_0x20c0('0x128')](_0x409ba4+_0x20c0('0x103'));}catch(_0x4933ed){logger[_0x20c0('0x26')](_0x4933ed);}return _0x2cce60;}return this[_0x20c0('0xc')]['error'](_0x3f75ec,_0x20c0('0x129'));};AGIVertices['prototype'][_0x20c0('0x12a')]=function(_0x5a0086){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x12b'),_0x5a0086[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x5a0086['aws_access_key_id'])||!this[_0x20c0('0x7f')](_0x5a0086[_0x20c0('0x88')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x20c0('0x7f')](_0x5a0086[_0x20c0('0x8a')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x12c'));}if(!this[_0x20c0('0x7f')](_0x5a0086[_0x20c0('0x54')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xa4'));}this[_0x20c0('0xc')][_0x20c0('0xe9')]=!![];this[_0x20c0('0x2f')](_0x5a0086);this[_0x20c0('0x39')](_0x5a0086[_0x20c0('0x54')],'in','','');this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x12d'),_0x5a0086['text']));var _0x39d59a=this[_0x20c0('0x87')][_0x20c0('0x6a')](this,_0x5a0086);if(_0x39d59a){for(var _0x416b29 in _0x39d59a){if(_0x39d59a[_0x20c0('0x91')](_0x416b29)&&_[_0x20c0('0x92')](_0x39d59a[_0x416b29])){this[_0x20c0('0xc')][_0x20c0('0x9a')](util['format'](_0x20c0('0x12e'),_0x416b29[_0x20c0('0x62')]()),_0x39d59a[_0x416b29]);}}if(_[_0x20c0('0x3c')](_0x39d59a[_0x20c0('0x12f')])){return this['channel'][_0x20c0('0xa7')](_0x20c0('0x130'));}else{this['createSquareMessage'](_0x39d59a[_0x20c0('0x12f')],_0x20c0('0xed'),'amazonlex','');return this['channel'][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x131'),_0x39d59a[_0x20c0('0x12f')]));}}return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x5a0086,_0x20c0('0x132'));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x133')]=function(_0x35d0f5){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x134'),_0x35d0f5['label'],_0x35d0f5[_0x20c0('0x5d')]));if(!this['isConfigured'](_0x35d0f5[_0x20c0('0x73')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x135'));}var _0x2dd5f8='wav';var _0x19d5ad=util['format'](_0x20c0('0x136'),FILES_PATH,rs[_0x20c0('0x119')](0x4));var _0x1309e2=util[_0x20c0('0x4a')]('%s.%s',_0x19d5ad,_0x2dd5f8);var _0x42e95d=!![];if(_0x35d0f5[_0x20c0('0x137')]===_0x20c0('0x138')){_0x42e95d=![];}var _0x44c23d=this[_0x20c0('0xc')][_0x20c0('0x139')](_0x19d5ad,_0x2dd5f8,_0x35d0f5[_0x20c0('0x13a')],_0x35d0f5[_0x20c0('0x5d')],undefined,_0x42e95d);if(_0x44c23d[_0x20c0('0xa6')]!==-0x1){this['channel'][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x13b'),_0x1309e2));var _0x343341=this[_0x20c0('0x8b')][_0x20c0('0x6a')](this,_0x35d0f5,_0x1309e2);if(_0x343341){for(var _0x3753a0 in _0x343341){if(_0x343341[_0x20c0('0x91')](_0x3753a0)){this[_0x20c0('0xc')][_0x20c0('0x9a')](util['format']('GOOGLE_ASR_%s',_0x3753a0[_0x20c0('0x62')]()),_0x343341[_0x3753a0]);}}return this['channel'][_0x20c0('0xa7')](util['format'](_0x20c0('0x13c'),JSON[_0x20c0('0x6d')](_0x343341)));}}return _0x44c23d;};AGIVertices[_0x20c0('0x16')][_0x20c0('0x13d')]=function(_0x1229ce){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x13e'),_0x1229ce[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x1229ce[_0x20c0('0x8e')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x13f'));}if(!this[_0x20c0('0x7f')](_0x1229ce[_0x20c0('0x8f')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x140'));}var _0x5896f4=_0x20c0('0x141');var _0x369c08=util[_0x20c0('0x4a')]('%s/recordings/%s',FILES_PATH,rs[_0x20c0('0x119')](0x4));var _0x2b5038=util['format'](_0x20c0('0x99'),_0x369c08,_0x5896f4);var _0x5d1e4c=!![];if(_0x1229ce[_0x20c0('0x137')]===_0x20c0('0x138')){_0x5d1e4c=![];}var _0x45c7d3=this[_0x20c0('0xc')]['recordFile'](_0x369c08,_0x5896f4,_0x1229ce[_0x20c0('0x13a')],_0x1229ce[_0x20c0('0x5d')],undefined,_0x5d1e4c);if(_0x45c7d3[_0x20c0('0xa6')]!==-0x1){this['channel']['noop'](util['format']('tilde\x20%s\x20file\x20created',_0x2b5038));var _0x260f37=this[_0x20c0('0x8d')][_0x20c0('0x6a')](this,_0x1229ce,_0x2b5038);if(_0x260f37){for(var _0x52ee9e in _0x260f37){if(_0x260f37['hasOwnProperty'](_0x52ee9e)){this[_0x20c0('0xc')][_0x20c0('0x9a')](util[_0x20c0('0x4a')](_0x20c0('0x142'),_0x52ee9e[_0x20c0('0x62')]()),_0x260f37[_0x52ee9e]);}}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x143'),JSON['stringify'](_0x260f37)));}}return _0x45c7d3;};AGIVertices[_0x20c0('0x16')][_0x20c0('0x144')]=function(_0x22d20d){logger['info'](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x22d20d[_0x20c0('0x31')]));return this[_0x20c0('0xc')][_0x20c0('0x145')](_0x22d20d['context'],_0x22d20d[_0x20c0('0x37')],_0x22d20d['priority']);};AGIVertices['prototype'][_0x20c0('0x146')]=function(_0x3aa080){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x3aa080['label']));if(!this['isConfigured'](_0x3aa080[_0x20c0('0x147')])){return this[_0x20c0('0xc')]['error'](_0x3aa080,_0x20c0('0x148'));}try{var _0x1c73bb=eval(_0x3aa080[_0x20c0('0x147')])?_0x20c0('0x149'):_0x20c0('0x14a');this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x14b'),_0x3aa080['condition'],_0x1c73bb));return{'code':0xc8,'result':_0x1c73bb};}catch(_0x5aa61e){return{'code':0xc8,'result':_0x20c0('0x14a')};}};AGIVertices[_0x20c0('0x16')]['gotoiftime']=function(_0x170250){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x14c'),_0x170250[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x170250[_0x20c0('0x14d')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x170250,_0x20c0('0x14e'));}var _0x5e6287=this['getIntervals']['sync'](this,_0x170250[_0x20c0('0x14d')]);if(!_0x5e6287){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x170250,_0x20c0('0x14f'));}for(var _0x2bc733=0x0;_0x2bc733<_0x5e6287[_0x20c0('0x97')];_0x2bc733+=0x1){var _0x100164=this['channel'][_0x20c0('0x9d')](util[_0x20c0('0x4a')](_0x20c0('0x150'),_0x5e6287[_0x2bc733]));if(_0x100164['result']===-0x1){return _0x100164;}logger['info'](util['format'](_0x20c0('0x151'),_0x5e6287[_0x2bc733],_0x100164[_0x20c0('0x9e')]));if(_0x100164[_0x20c0('0x9e')]===_0x20c0('0x149')){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x151'),_0x5e6287[_0x2bc733],'true'));this['channel'][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x151'),_0x5e6287[_0x2bc733],_0x20c0('0x149')));return{'code':0xc8,'result':_0x20c0('0x149')};}else{logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('IFTIME\x20%s\x20%s',_0x5e6287[_0x2bc733],_0x20c0('0x14a')));this['channel'][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('IFTIME\x20%s\x20%s',_0x5e6287[_0x2bc733],_0x20c0('0x14a')));}}return{'code':0xc8,'result':_0x20c0('0x14a')};};AGIVertices[_0x20c0('0x16')][_0x20c0('0x152')]=function(_0x319c82){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x319c82[_0x20c0('0x31')]));return this[_0x20c0('0xc')]['hangup']();};AGIVertices['prototype']['ispeechasr']=function(_0x4ed9a8){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x153'),_0x4ed9a8['label']));if(!this[_0x20c0('0x7f')](_0x4ed9a8[_0x20c0('0x73')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')]('no\x20key\x20configured');}var _0xf684f2=_0x20c0('0x141');var _0x379477=util[_0x20c0('0x4a')](_0x20c0('0x136'),FILES_PATH,rs['generate'](0x4));var _0x316f0a=util[_0x20c0('0x4a')](_0x20c0('0x99'),_0x379477,_0xf684f2);var _0x110797=!![];if(_0x4ed9a8['beep']==='NOBEEP'){_0x110797=![];}var _0x27ebd2=this[_0x20c0('0xc')]['recordFile'](_0x379477,_0xf684f2,_0x4ed9a8['intKey'],_0x4ed9a8[_0x20c0('0x5d')],undefined,_0x110797);if(_0x27ebd2[_0x20c0('0xa6')]!==-0x1){this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x154'),_0x316f0a));var _0xb995e5=this['ispeechASR']['sync'](this,_0x4ed9a8,_0x316f0a);if(_0xb995e5){for(var _0x250e4d in _0xb995e5){if(_0xb995e5['hasOwnProperty'](_0x250e4d)){this['channel'][_0x20c0('0x9a')](util[_0x20c0('0x4a')](_0x20c0('0x155'),_0x250e4d[_0x20c0('0x62')]()),_0xb995e5[_0x250e4d]);}}return this[_0x20c0('0xc')]['noop'](util[_0x20c0('0x4a')](_0x20c0('0x156'),JSON[_0x20c0('0x6d')](_0xb995e5)));}}return _0x27ebd2;};AGIVertices['prototype']['ispeechtts']=function(_0x15c6c3){logger['info'](util[_0x20c0('0x4a')](_0x20c0('0x157'),_0x15c6c3[_0x20c0('0x31')]));if(!this['isConfigured'](_0x15c6c3[_0x20c0('0x73')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x135'));}if(!this[_0x20c0('0x7f')](_0x15c6c3[_0x20c0('0x54')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xa4'));}this[_0x20c0('0xc')]['noop'](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x15c6c3[_0x20c0('0x54')]));var _0x4de334=this[_0x20c0('0x7a')][_0x20c0('0x6a')](this,_0x15c6c3);if(_0x4de334){this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x154'),_0x4de334));var _0x2403e2=this[_0x20c0('0xc')]['streamFile'](_0x4de334,_0x15c6c3[_0x20c0('0x13a')]);try{fs['unlink'](_0x4de334+'.wav');}catch(_0x131cdf){logger['error'](_0x131cdf);}return _0x2403e2;}return this['channel'][_0x20c0('0x26')](_0x15c6c3,_0x20c0('0x158'));};AGIVertices['prototype'][_0x20c0('0x159')]=function(_0x1c995b){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x15a'),_0x1c995b[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x1c995b[_0x20c0('0x15b')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x1c995b,_0x20c0('0x15c'));}logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x20c0('0xc')][_0x20c0('0x35')],_0x1c995b['findBy']));var _0x2c773c=this[_0x20c0('0x4d')][_0x20c0('0x6a')](this,_0x1c995b[_0x20c0('0x15b')]);if(_0x2c773c){logger['info'](util[_0x20c0('0x4a')](_0x20c0('0x15d'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0x1c995b[_0x20c0('0x15b')]));this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x20c0('0x35')],_0x1c995b['findBy']));return{'code':0xc8,'result':_0x20c0('0x15e')};}else{logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x15f'),this['channel'][_0x20c0('0x35')],_0x1c995b[_0x20c0('0x15b')]));this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x20c0('0xc')][_0x20c0('0x35')],_0x1c995b[_0x20c0('0x15b')]));return{'code':0xc8,'result':_0x20c0('0x160')};}};AGIVertices['prototype']['logout']=function(_0x3c9a79){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x161'),_0x3c9a79[_0x20c0('0x31')]));if(!this['isConfigured'](_0x3c9a79[_0x20c0('0x15b')])){return this['channel'][_0x20c0('0x26')](_0x3c9a79,'no\x20find\x20by\x20configured');}logger['info'](util[_0x20c0('0x4a')](_0x20c0('0x162'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0x3c9a79['findBy']));var _0x46cb2f=this[_0x20c0('0x48')][_0x20c0('0x6a')](this,_0x3c9a79[_0x20c0('0x15b')]);if(_0x46cb2f){logger[_0x20c0('0x27')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x20c0('0x35')],_0x3c9a79[_0x20c0('0x15b')]));this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x15d'),this['channel']['callerid'],_0x3c9a79['findBy']));return{'code':0xc8,'result':_0x20c0('0x15e')};}else{logger['info'](util['format'](_0x20c0('0x15f'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0x3c9a79[_0x20c0('0x15b')]));this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x15f'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0x3c9a79[_0x20c0('0x15b')]));return{'code':0xc8,'result':_0x20c0('0x160')};}};AGIVertices[_0x20c0('0x16')][_0x20c0('0x163')]=function(_0x3acde3){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x164'),_0x3acde3[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x3acde3[_0x20c0('0x165')])){return this['channel'][_0x20c0('0x26')](_0x3acde3,'no\x20operation\x20configured');}this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x166'),_0x3acde3[_0x20c0('0x165')]));var _0x34ba7a=eval(_0x3acde3[_0x20c0('0x165')]);if(!this[_0x20c0('0x7f')](_0x3acde3['variable_id'])){return this[_0x20c0('0xc')]['noop'](_0x20c0('0xd8'));}var _0x5b27f7=this[_0x20c0('0x9d')][_0x20c0('0x6a')](this,_0x3acde3['variable_id']);if(!_0x5b27f7){return this['channel'][_0x20c0('0x26')](_0x3acde3,_0x20c0('0xd9'));}if(_[_0x20c0('0x167')](_0x34ba7a)){var _0x3eabfd=this;_0x34ba7a['forEach'](function(_0x2ad78a,_0x519258){_0x3eabfd[_0x20c0('0xc')][_0x20c0('0x9a')](util[_0x20c0('0x4a')](_0x20c0('0x168'),_0x5b27f7,_0x519258),_0x2ad78a);});return this[_0x20c0('0xc')]['noop'](util[_0x20c0('0x4a')](_0x20c0('0x169'),_0x5b27f7));}else{return this['channel'][_0x20c0('0x9a')](_0x5b27f7,_0x34ba7a);}};AGIVertices['prototype']['menu']=function(_0x1d75af){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x1d75af[_0x20c0('0x31')]));if(_0x1d75af['retry']===0x0){return this['maxRetry'](_0x1d75af);}_0x1d75af[_0x20c0('0x10f')]-=0x1;if(!this[_0x20c0('0x7f')](_0x1d75af[_0x20c0('0x110')])){return this['channel'][_0x20c0('0x26')](_0x1d75af,_0x20c0('0x111'));}var _0x4dc355=this[_0x20c0('0x112')]['sync'](this,_0x1d75af[_0x20c0('0x110')]);if(!_0x4dc355){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x1d75af,_0x20c0('0x113'));}var _0x1ff8a5=this['channel'][_0x20c0('0x114')](_0x4dc355,_0x1d75af[_0x20c0('0x16a')],_0x1d75af['digit']);var _0x474bcc=_0x1ff8a5['result'];if(_0x1ff8a5[_0x20c0('0xa6')]===-0x1){this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0x1d75af,'-1');return _0x1ff8a5;}else if(_0x1ff8a5[_0x20c0('0x9e')]===_0x20c0('0x5d')){_0x1ff8a5['result']=_0x1ff8a5[_0x20c0('0xa6')][_0x20c0('0x97')]>0x0?_0x1ff8a5['result']:'t';}else if(_[_0x20c0('0x3b')](_0x1ff8a5[_0x20c0('0xa6')])){_0x1ff8a5[_0x20c0('0xa6')]='#';_0x474bcc='#';}if(!this['isConfigured'](_0x1d75af[_0x20c0('0xd7')])){this[_0x20c0('0xc')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x237d52=this[_0x20c0('0x9d')][_0x20c0('0x6a')](this,_0x1d75af['variable_id']);if(!_0x237d52){return this[_0x20c0('0xc')]['error'](_0x1d75af,_0x20c0('0xd9'));}this[_0x20c0('0xc')][_0x20c0('0x9a')](_0x237d52,_0x474bcc);}this['createSquareDetailsReport'][_0x20c0('0x6a')](this,_0x1d75af,_0x474bcc);return _0x1ff8a5;};AGIVertices[_0x20c0('0x16')][_0x20c0('0xa7')]=function(_0x432f7a){logger[_0x20c0('0x27')](util['format'](_0x20c0('0x16b'),_0x432f7a[_0x20c0('0x31')]));return this[_0x20c0('0xc')]['noop'](_0x432f7a['output']||_0x432f7a['label']);};AGIVertices[_0x20c0('0x16')][_0x20c0('0x16c')]=function(_0x15014c){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x16d'),_0x15014c['label']));if(!this[_0x20c0('0x7f')](_0x15014c[_0x20c0('0x15b')])){return this[_0x20c0('0xc')]['error'](_0x15014c,_0x20c0('0x15c'));}logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x162'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0x15014c['findBy']));var _0x22eb47=this[_0x20c0('0x45')]['sync'](this,_0x15014c[_0x20c0('0x16e')]);var _0xc91f48=this[_0x20c0('0x16f')][_0x20c0('0x6a')](this,_0x15014c[_0x20c0('0x15b')],_0x22eb47);if(_0xc91f48){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x15d'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0x15014c[_0x20c0('0x15b')]));this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x15d'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0x15014c[_0x20c0('0x15b')]));return{'code':0xc8,'result':_0x20c0('0x15e')};}else{logger[_0x20c0('0x27')](util['format'](_0x20c0('0x15f'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0x15014c[_0x20c0('0x15b')]));this[_0x20c0('0xc')]['noop'](util[_0x20c0('0x4a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x20c0('0xc')]['callerid'],_0x15014c['findBy']));return{'code':0xc8,'result':_0x20c0('0x160')};}};AGIVertices[_0x20c0('0x16')][_0x20c0('0x170')]=function(_0x53cf76){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x171'),_0x53cf76['label']));if(!this[_0x20c0('0x7f')](_0x53cf76[_0x20c0('0x110')])){return this['channel']['error'](_0x53cf76,_0x20c0('0x111'));}var _0x59bb6a=this[_0x20c0('0x112')]['sync'](this,_0x53cf76[_0x20c0('0x110')]);if(!_0x59bb6a){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x53cf76,_0x20c0('0x113'));}var _0x16414d=this[_0x20c0('0xc')]['exec'](_0x20c0('0x172'),[_0x59bb6a,_0x53cf76[_0x20c0('0xe5')]]);if(_0x16414d['result']===-0x1){return _0x16414d;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xc5'),_0x20c0('0x172'),_0x59bb6a));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x173')]=function(_0x5e0ad6){logger['info'](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x5e0ad6[_0x20c0('0x31')]));if(!this['isConfigured'](_0x5e0ad6[_0x20c0('0x174')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x5e0ad6,_0x20c0('0x175'));}var _0x49d65a='';var _0xe21f5d=parseInt(_0x5e0ad6['queue_id'],0xa);if(isNaN(_0xe21f5d)){_0x49d65a=_0x5e0ad6[_0x20c0('0x174')];}else{_0x49d65a=this[_0x20c0('0x176')][_0x20c0('0x6a')](this,_0x5e0ad6['queue_id']);if(!_0x49d65a){return this['channel']['error'](_0x5e0ad6,'no\x20queue\x20found');}}var _0x28ecfa='';if(this[_0x20c0('0x7f')](_0x5e0ad6[_0x20c0('0x110')])){var _0x20a651=this[_0x20c0('0x112')][_0x20c0('0x6a')](this,_0x5e0ad6[_0x20c0('0x110')]);if(_0x20a651){_0x28ecfa=_0x20a651;}}this['createSquareDetailsReport'][_0x20c0('0x6a')](this,_0x5e0ad6,_0x49d65a);if(_0x5e0ad6[_0x20c0('0xe5')]['indexOf']('x')<0x0){_0x5e0ad6[_0x20c0('0xe5')]+='x';}if(_0x5e0ad6[_0x20c0('0xe5')][_0x20c0('0x177')]('X')<0x0){_0x5e0ad6[_0x20c0('0xe5')]+='X';}this[_0x20c0('0xc')][_0x20c0('0x9a')]('XMCS-QUEUE',_0x49d65a?_0x49d65a['toLowerCase']():'');var _0x236c45=this[_0x20c0('0xc')]['exec']('QUEUE',[_0x49d65a,_0x5e0ad6[_0x20c0('0xe5')],_0x5e0ad6[_0x20c0('0x5b')],_0x28ecfa,_0x5e0ad6[_0x20c0('0x5d')],_0x5e0ad6['agi'],_0x5e0ad6[_0x20c0('0x178')],_0x5e0ad6['gosub'],'',_0x5e0ad6[_0x20c0('0x179')]]);if(_0x236c45[_0x20c0('0xa6')]===-0x1){return _0x236c45;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('Executed\x20command\x20%s\x20%s','QUEUE',_0x49d65a));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x17a')]=function(_0x4867f9){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x17b'),_0x4867f9[_0x20c0('0x31')]));var _0x12d38a=_0x4867f9[_0x20c0('0x17c')]||_0x20c0('0x141');var _0x1794da=util['format'](_0x20c0('0x17d'),this['channel'][_0x20c0('0x30')],rs[_0x20c0('0x119')](0x5));var _0x41900a=util[_0x20c0('0x4a')](_0x20c0('0x17e'),FILES_PATH,_0x1794da,_0x12d38a);var _0x2805c3=util['format'](_0x20c0('0x136'),FILES_PATH,_0x1794da);this[_0x20c0('0x34')][_0x20c0('0x6a')](this,_0x4867f9,_0x1794da,_0x41900a);this['channel'][_0x20c0('0x9a')](_0x20c0('0x17f'),_0x1794da);logger[_0x20c0('0x27')](_0x20c0('0x180'),_0x2805c3,_0x12d38a,_0x4867f9[_0x20c0('0x181')],_0x4867f9[_0x20c0('0x5d')]);return this[_0x20c0('0xc')][_0x20c0('0x139')](_0x2805c3,_0x12d38a,_0x4867f9[_0x20c0('0x181')],_0x4867f9['timeout'],undefined,!![]);};AGIVertices[_0x20c0('0x16')]['restapi']=function(_0x344e17){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x344e17['label']));if(!this[_0x20c0('0x7f')](_0x344e17[_0x20c0('0x5b')])){return this['channel'][_0x20c0('0xa7')](_0x20c0('0x182'));}var _0x4a8813=this[_0x20c0('0x5a')]['sync'](this,_0x344e17);logger['info'](util[_0x20c0('0x4a')](_0x20c0('0x183'),util[_0x20c0('0x184')](_0x4a8813,{'showHidden':![],'depth':null})));if(!this[_0x20c0('0x7f')](_0x344e17[_0x20c0('0xd7')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x185'));}var _0x2ddfdf=this[_0x20c0('0x9d')][_0x20c0('0x6a')](this,_0x344e17['variable_id']);if(!_0x2ddfdf){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x344e17,_0x20c0('0xd9'));}this[_0x20c0('0xc')][_0x20c0('0x9a')](util[_0x20c0('0x4a')](_0x20c0('0x186'),_0x2ddfdf),_0x4a8813[_0x20c0('0x6f')]?_0x4a8813[_0x20c0('0x6f')]:'200');this['channel']['setVariable'](util[_0x20c0('0x4a')](_0x20c0('0x187'),_0x2ddfdf),_0x4a8813[_0x20c0('0x70')]?_0x4a8813[_0x20c0('0x70')]:'OK');if(_0x4a8813[_0x20c0('0x63')]){try{this[_0x20c0('0x98')](_0x4a8813[_0x20c0('0x63')],_0x2ddfdf);}catch(_0x253934){logger['error'](util[_0x20c0('0x4a')](_0x20c0('0x188'),_0x2ddfdf));}}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xde'),_0x2ddfdf));};AGIVertices[_0x20c0('0x16')]['saydigits']=function(_0x305bcf){logger['info'](util[_0x20c0('0x4a')](_0x20c0('0x189'),_0x305bcf['label']));return this[_0x20c0('0xc')][_0x20c0('0x18a')](_0x305bcf['digits']['replace'](/\s+/g,''),_0x305bcf[_0x20c0('0x181')]);};AGIVertices[_0x20c0('0x16')][_0x20c0('0x18b')]=function(_0x36f272){logger[_0x20c0('0x27')](util['format'](_0x20c0('0x18c'),_0x36f272['label']));return this[_0x20c0('0xc')][_0x20c0('0x18d')](_0x36f272[_0x20c0('0x5e')][_0x20c0('0x50')](/\s+/g,''),_0x36f272[_0x20c0('0x181')]);};AGIVertices[_0x20c0('0x16')][_0x20c0('0x18e')]=function(_0x3586f8){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x18f'),_0x3586f8[_0x20c0('0x31')]));return this[_0x20c0('0xc')]['sayPhonetic'](_0x3586f8[_0x20c0('0x54')],_0x3586f8['escape_digits']);};AGIVertices['prototype']['sendMail']=function(_0x579554){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x579554[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x579554[_0x20c0('0x190')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x191'));}var _0x5776a5=this[_0x20c0('0x1e')][_0x20c0('0x6a')](this,_0x579554[_0x20c0('0x190')]);if(!_0x5776a5||!_0x5776a5[_0x20c0('0x192')]){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x579554,_0x20c0('0x193'));}var _0x300925={'from':util[_0x20c0('0x4a')]('\x22%s\x22\x20<%s>',_0x5776a5[_0x20c0('0x11')],_0x5776a5[_0x20c0('0x194')]||_0x5776a5[_0x20c0('0x192')][_0x20c0('0x195')]),'to':_0x579554['to']||'','cc':_0x579554['cc']||'','bcc':_0x579554[_0x20c0('0x196')]||'','subject':_0x579554['subject'],'html':_0x579554['text'],'text':_0x579554[_0x20c0('0x54')]};if(this[_0x20c0('0x7f')](_0x579554[_0x20c0('0x197')])){}logger['debug'](_0x20c0('0x198'),JSON[_0x20c0('0x6d')](_0x300925));this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0x579554,_0x579554[_0x20c0('0x190')]);this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x199'),_0x5776a5[_0x20c0('0x11')]));this[_0x20c0('0x20')]['sync'](this,_0x5776a5['smtpOptions'],_0x300925);return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x19a'));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x19b')]=function(_0x283200){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x19c'),_0x283200[_0x20c0('0x31')]));return this['channel'][_0x20c0('0xa7')](_0x20c0('0x19d'));};AGIVertices['prototype'][_0x20c0('0x19e')]=function(_0xd519c3){logger['info'](util[_0x20c0('0x4a')](_0x20c0('0x19f'),_0xd519c3[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0xd519c3['sms_account_id'])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x1a0'));}var _0x57b6c7=this[_0x20c0('0x2c')][_0x20c0('0x6a')](this,_0xd519c3[_0x20c0('0x1a1')]);if(!_0x57b6c7){return this[_0x20c0('0xc')]['error'](_0xd519c3,_0x20c0('0x1a2'));}var _0x117ae7={'body':_0xd519c3[_0x20c0('0x1a3')],'phone':_0xd519c3['to']||'','SmsAccountId':_0x57b6c7['id']};logger[_0x20c0('0xe0')](_0x20c0('0x1a4'),JSON[_0x20c0('0x6d')](_0x117ae7));this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0xd519c3,_0xd519c3[_0x20c0('0x1a1')]);this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x57b6c7[_0x20c0('0x11')]));this[_0x20c0('0x2e')][_0x20c0('0x6a')](this,_0x117ae7);return this[_0x20c0('0xc')][_0x20c0('0xa7')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x20c0('0x16')]['set']=function(_0x5f10e7){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x1a5'),_0x5f10e7[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x5f10e7[_0x20c0('0xd7')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x5f10e7,_0x20c0('0x1a6'));}var _0x44fdf8=this[_0x20c0('0x9d')][_0x20c0('0x6a')](this,_0x5f10e7[_0x20c0('0xd7')]);if(!_0x44fdf8){return this[_0x20c0('0xc')]['error'](_0x5f10e7,_0x20c0('0xd9'));}return this[_0x20c0('0xc')][_0x20c0('0x9a')](_0x44fdf8,_0x5f10e7[_0x20c0('0x1a7')]);};AGIVertices[_0x20c0('0x16')]['start']=function(_0x3acf09){logger['info'](util[_0x20c0('0x4a')]('Enter\x20in\x20START\x20(%s)\x20block',_0x3acf09[_0x20c0('0x31')]));this['channel'][_0x20c0('0xa7')](_0x20c0('0x1a8'));var _0x32e8ea=this[_0x20c0('0xc')]['getVariable'](_0x20c0('0x1a9'));if(!_[_0x20c0('0x3b')](_0x32e8ea[_0x20c0('0x9e')])){this[_0x20c0('0xc')][_0x20c0('0x30')]=_0x32e8ea[_0x20c0('0x9e')];}if(_0x3acf09[_0x20c0('0xb7')]===_0x20c0('0x1aa')){this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x1ab'));return this[_0x20c0('0xc')][_0x20c0('0xb7')]();}return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x1ac'));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x1ad')]=function(_0x125957){logger[_0x20c0('0x27')](util['format'](_0x20c0('0x1ae'),_0x125957[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x125957['project_id'])){return this['channel'][_0x20c0('0x26')](_0x125957,_0x20c0('0x1af'));}var _0x19b0c8=this[_0x20c0('0x14')]['sync'](this,_0x125957['project_id']);if(!this['isConfigured'](_0x19b0c8)){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x125957,util['format'](_0x20c0('0x1b0'),_0x125957['project_id']));}if(_0x19b0c8===this[_0x20c0('0xc')][_0x20c0('0x33')]){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x125957,_0x20c0('0x1b1'));}this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0x125957,_0x19b0c8);var _0x5492cc=this[_0x20c0('0xc')][_0x20c0('0xad')](_0x20c0('0x1b2'),util['format'](_0x20c0('0x1b3'),config[_0x20c0('0x7')]['host']||'127.0.0.1',_0x19b0c8,this[_0x20c0('0xc')][_0x20c0('0x33')]));if(_0x5492cc[_0x20c0('0xa6')]===-0x1){return _0x5492cc;}return this[_0x20c0('0xc')]['noop'](util[_0x20c0('0x4a')]('Executed\x20command\x20%s\x20%s','AGI',_0x19b0c8));};AGIVertices['prototype'][_0x20c0('0x1b4')]=function(_0x46ce47){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x46ce47['label']));var _0x1c6307=this['shellCommand'][_0x20c0('0x6a')](this,_0x46ce47[_0x20c0('0xb5')]);this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0x46ce47,_0x46ce47[_0x20c0('0xb5')]);if(this[_0x20c0('0x7f')](_0x46ce47[_0x20c0('0xd7')])){var _0x41fc5e=this[_0x20c0('0x9d')]['sync'](this,_0x46ce47[_0x20c0('0xd7')]);if(_0x41fc5e){this[_0x20c0('0xc')]['setVariable'](_0x41fc5e,_0x1c6307);return this[_0x20c0('0xc')][_0x20c0('0xa7')](util['format'](_0x20c0('0x1b5'),_0x46ce47['command'],_0x41fc5e));}}return this['channel'][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x46ce47[_0x20c0('0xb5')]));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x1b6')]=function(_0x461470){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x1b7'),_0x461470[_0x20c0('0x31')]));_0x461470[_0x20c0('0x54')]=_0x461470[_0x20c0('0x54')][_0x20c0('0x50')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x20c0('0x7f')](_0x461470[_0x20c0('0x52')])){return this[_0x20c0('0xc')]['noop']('no\x20apiKey\x20configured');}if(!this[_0x20c0('0x7f')](_0x461470[_0x20c0('0x54')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xa4'));}this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x461470['text']));var _0x24e6d9=this[_0x20c0('0x51')]['sync'](this,_0x461470);if(_0x24e6d9){this[_0x20c0('0xc')]['noop'](util['format'](_0x20c0('0x1b8'),_0x24e6d9));var _0x1ce779=this[_0x20c0('0xc')]['streamFile'](_0x24e6d9);try{fs[_0x20c0('0x128')](_0x24e6d9+_0x20c0('0x103'));}catch(_0x24451f){logger[_0x20c0('0x26')](_0x24451f);}return _0x1ce779;}return this[_0x20c0('0xc')]['error'](_0x461470,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x20c0('0x16')][_0x20c0('0x1b9')]=function(_0x502e88){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x502e88['label']));_0x502e88[_0x20c0('0x54')]=_0x502e88[_0x20c0('0x54')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x20c0('0x7f')](_0x502e88[_0x20c0('0x54')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')]('no\x20text\x20configured');}this[_0x20c0('0xc')]['noop'](util[_0x20c0('0x4a')](_0x20c0('0x1ba'),_0x502e88[_0x20c0('0x54')]));var _0x1bd7f3=this[_0x20c0('0x1bb')][_0x20c0('0x6a')](this,_0x502e88);if(_0x1bd7f3){this[_0x20c0('0xc')][_0x20c0('0xa7')](util['format'](_0x20c0('0x1bc'),_0x1bd7f3));var _0x22c00d=this[_0x20c0('0xc')][_0x20c0('0x102')](_0x1bd7f3);try{fs[_0x20c0('0x128')](_0x1bd7f3+_0x20c0('0x103'));}catch(_0x4f619b){logger[_0x20c0('0x26')](_0x4f619b);}return _0x22c00d;}return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x502e88,_0x20c0('0x1bd'));};AGIVertices['prototype'][_0x20c0('0x1be')]=function(_0xa4a9e6){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x1bf'),_0xa4a9e6[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0xa4a9e6[_0x20c0('0x15b')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0xa4a9e6,_0x20c0('0x15c'));}logger['info'](util[_0x20c0('0x4a')](_0x20c0('0x162'),this['channel'][_0x20c0('0x35')],_0xa4a9e6[_0x20c0('0x15b')]));var _0x4a7787=this['agentUnpause'][_0x20c0('0x6a')](this,_0xa4a9e6[_0x20c0('0x15b')]);if(_0x4a7787){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x15d'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0xa4a9e6[_0x20c0('0x15b')]));this[_0x20c0('0xc')]['noop'](util['format'](_0x20c0('0x15d'),this['channel']['callerid'],_0xa4a9e6[_0x20c0('0x15b')]));return{'code':0xc8,'result':_0x20c0('0x15e')};}else{logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x15f'),this[_0x20c0('0xc')]['callerid'],_0xa4a9e6[_0x20c0('0x15b')]));this[_0x20c0('0xc')][_0x20c0('0xa7')](util['format'](_0x20c0('0x15f'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0xa4a9e6[_0x20c0('0x15b')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x20c0('0x16')]['voicemail']=function(_0x4cfd34){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x1c0'),_0x4cfd34[_0x20c0('0x31')]));var _0x536c6e=this[_0x20c0('0xc')][_0x20c0('0xad')]('VOICEMAIL',[_0x4cfd34[_0x20c0('0x1c1')],_0x4cfd34[_0x20c0('0x71')]]);if(_0x536c6e[_0x20c0('0xa6')]===-0x1){return _0x536c6e;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xc5'),_0x20c0('0x1c2'),_0x4cfd34['mailbox']));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x1c3')]=function(_0x219600){logger[_0x20c0('0x27')](util['format'](_0x20c0('0x1c4'),_0x219600[_0x20c0('0x31')]));if(!this['isConfigured'](_0x219600[_0x20c0('0xd7')])){return this['channel'][_0x20c0('0x26')](_0x219600,_0x20c0('0x1a6'));}var _0x326bc5=this[_0x20c0('0x9d')][_0x20c0('0x6a')](this,_0x219600[_0x20c0('0xd7')]);if(!_0x326bc5){return this[_0x20c0('0xc')]['error'](_0x219600,'no\x20variable\x20found');}var _0x3fcf4c=this['channel'][_0x20c0('0x9d')](_0x326bc5);return{'code':0xc8,'result':_0x3fcf4c['extra']?_0x3fcf4c[_0x20c0('0x9e')]:'-'};};String['prototype'][_0x20c0('0x9c')]=function(_0x754cd3,_0x2552e5){return this[_0x20c0('0x9b')](_0x754cd3)['join'](_0x2552e5);};module[_0x20c0('0x1c5')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 31d5a66..ff8c3c3 100644 --- a/server/services/ami/acw/index.js +++ b/server/services/ami/acw/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea5f=['error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','voicePause','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','uniqueid','[ACW][START]\x20%s','message','getAgent','pauseType','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','interface','[ACW][syncAgentConnect]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','transfereeuniqueid','secondtransfereruniqueid','isNil','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','agentringnoanswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','updateAcw','lastPauseAt','timer','update','then','catch'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0xea5f,0x145));var _0xfea5=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0xea5f[_0x20c9b2];return _0x2c6030;};'use strict';var _=require(_0xfea5('0x0'));var moment=require(_0xfea5('0x1'));var ami=require(_0xfea5('0x2'));var logger=require(_0xfea5('0x3'))(_0xfea5('0x4'));var RpcUser=require(_0xfea5('0x5'));var RpcVoiceAgentReport=require(_0xfea5('0x6'));function Acw(_0x3017e3){this[_0xfea5('0x7')]=_0x3017e3[_0xfea5('0x7')];this[_0xfea5('0x8')]=_0x3017e3['agents'];this[_0xfea5('0x9')]=_0x3017e3['timers'];this[_0xfea5('0xa')]={};ami['on'](_0xfea5('0xb'),this[_0xfea5('0xc')][_0xfea5('0xd')](this));ami['on']('hanguprequest',this[_0xfea5('0xe')][_0xfea5('0xd')](this));ami['on'](_0xfea5('0xf'),this['syncHangup'][_0xfea5('0xd')](this));ami['on'](_0xfea5('0x10'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0xfea5('0x11'),this['syncAttendedTransfer'][_0xfea5('0xd')](this));ami['on'](_0xfea5('0x12'),this[_0xfea5('0x13')][_0xfea5('0xd')](this));ami['on'](_0xfea5('0x14'),this[_0xfea5('0x15')][_0xfea5('0xd')](this));}function getDiff(_0x128eee){var _0x124367=moment()[_0xfea5('0x16')](0x0);var _0x2f5088=moment(_0x128eee)['milliseconds'](0x0);return _0x124367[_0xfea5('0x17')](_0x2f5088,'seconds');}Acw[_0xfea5('0x18')][_0xfea5('0x19')]=function(_0x31e13b,_0x3497b2){var _0x3d2f70=this;var _0x972709=getDiff(_0x3d2f70[_0xfea5('0x9')][_0x31e13b][_0xfea5('0x1a')]);clearTimeout(_0x3d2f70[_0xfea5('0x9')][_0x31e13b][_0xfea5('0x1b')]);_0x3d2f70['timers'][_0x31e13b][_0xfea5('0x1b')]=![];return RpcVoiceAgentReport[_0xfea5('0x1c')]({'acwtime':_0x972709},_0x3d2f70[_0xfea5('0x9')][_0x31e13b]['uniqueid'],_0x31e13b)[_0xfea5('0x1d')](function(_0x37c6a6){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x3497b2,_0x972709,_0x37c6a6);})[_0xfea5('0x1e')](function(_0x3ca19d){logger[_0xfea5('0x1f')](_0xfea5('0x20'),_0x3497b2,_0x3ca19d);})[_0xfea5('0x21')](function(){delete _0x3d2f70['timers'][_0x31e13b];});};Acw[_0xfea5('0x18')][_0xfea5('0x22')]=function(_0x53762d){try{var _0x46175a=this;var _0x2beba9=this['channels'][_0x53762d]['interface'];var _0x253b0e=this[_0xfea5('0xa')][_0x53762d][_0xfea5('0x23')];var _0x46d11f=this[_0xfea5('0x7')][_0x253b0e];var _0x19f88c=![];var _0xefeb96='ACW';if(_0x46d11f[_0xfea5('0x24')]&&_0x46d11f[_0xfea5('0x25')][_0xfea5('0x26')]){_0x19f88c=!![];_0xefeb96=_0x46d11f[_0xfea5('0x25')][_0xfea5('0x26')];}return ami[_0xfea5('0x27')]({'action':_0xfea5('0x28'),'interface':_0x2beba9,'paused':!![],'reason':_0xefeb96})[_0xfea5('0x1d')](function(){if(_0x46175a[_0xfea5('0x8')][_0x2beba9]){return RpcUser['getAgent'](_0x46175a[_0xfea5('0x8')][_0x2beba9]['id'])['then'](function(_0x2d1864){if(!_0x2d1864||_0x2d1864[_0xfea5('0x29')]){logger[_0xfea5('0x2a')](_0xfea5('0x2b'),_0x53762d,_0x2beba9,_0x253b0e);return;}logger['info'](_0xfea5('0x2c'),_0x53762d,_0x2beba9,_0x253b0e);var _0xaec7ad=_0x46175a[_0xfea5('0xa')][_0x53762d]['attended']&&_0x46175a[_0xfea5('0xa')][_0x53762d][_0xfea5('0x2d')]?_0x46175a[_0xfea5('0xa')][_0x53762d]['destlinkedid']:_0x53762d;return RpcUser[_0xfea5('0x2e')](_0x46175a[_0xfea5('0x8')][_0x2beba9],_0xefeb96,_0xaec7ad)[_0xfea5('0x1d')](function(_0x36c073){_0x46175a[_0xfea5('0x7')][_0x253b0e]['available']-=0x1;_0x46175a[_0xfea5('0x7')][_0x253b0e]['paused']+=0x1;return _0x36c073;});})[_0xfea5('0x1d')](function(_0x394ee6){if(_0x19f88c||!_0x394ee6){return;}_0x46175a['timers'][_0x2beba9]={};logger['info'](_0xfea5('0x2f'),_0x53762d,_0x46175a['voiceQueues'][_0x253b0e][_0xfea5('0x30')],_0x2beba9,_0x253b0e);_0x46175a[_0xfea5('0x9')][_0x2beba9][_0xfea5('0x1b')]=setTimeout(_0x46175a[_0xfea5('0x31')][_0xfea5('0xd')](_0x46175a,_0x2beba9),_0x46175a['voiceQueues'][_0x253b0e]['acwTimeout']*0x3e8);_0x46175a['timers'][_0x2beba9][_0xfea5('0x1a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x46175a[_0xfea5('0x9')][_0x2beba9][_0xfea5('0x32')]=_0x53762d;_0x46175a[_0xfea5('0x9')][_0x2beba9][_0xfea5('0x23')]=_0x253b0e;_0x46175a[_0xfea5('0x9')][_0x2beba9][_0xfea5('0x19')]=_0x46175a[_0xfea5('0x19')][_0xfea5('0xd')](_0x46175a,_0x2beba9,_0x53762d);});}})[_0xfea5('0x1e')](function(){logger['error'](_0xfea5('0x2f'),_0x53762d,_0x46175a[_0xfea5('0x7')][_0x253b0e][_0xfea5('0x30')],_0x2beba9,_0x253b0e);})[_0xfea5('0x21')](function(){delete _0x46175a[_0xfea5('0xa')][_0x53762d];});}catch(_0x3d283f){logger[_0xfea5('0x1f')](_0xfea5('0x33'),_0x3d283f[_0xfea5('0x34')]);}};Acw[_0xfea5('0x18')]['stopAcw']=function(_0x409e8e){try{var _0x31d140=this;if(_0x31d140[_0xfea5('0x9')][_0x409e8e]){_0x31d140[_0xfea5('0x9')][_0x409e8e][_0xfea5('0x1b')]=![];var _0x32ed88=_0x31d140[_0xfea5('0x9')][_0x409e8e]['uniqueid'];var _0x17ceb6=_0x31d140['timers'][_0x409e8e][_0xfea5('0x23')];var _0x288401=_0x31d140[_0xfea5('0x7')][_0x17ceb6]['acwTimeout'];logger[_0xfea5('0x2a')]('[%s][TIMER][STOP][AGENT:%s]',_0x32ed88,_0x409e8e);RpcUser[_0xfea5('0x35')](this[_0xfea5('0x8')][_0x409e8e]['id'])[_0xfea5('0x1d')](function(_0x30aa1d){if(_0x30aa1d[_0xfea5('0x36')]==='ACW'){return RpcUser['saveUnpause'](_0x31d140[_0xfea5('0x8')][_0x409e8e]);}});RpcVoiceAgentReport[_0xfea5('0x1c')]({'acwtime':_0x288401,'agentacw':!![]},_0x32ed88,_0x409e8e)['then'](function(_0x1b8ef9){logger[_0xfea5('0x2a')](_0xfea5('0x37'),_0x32ed88,_0x288401,_0x1b8ef9);})[_0xfea5('0x1e')](function(_0x3e1b44){logger[_0xfea5('0x1f')]('[%s][UPDATE][ERRORS:%s]',_0x32ed88,_0x3e1b44);});}else{logger[_0xfea5('0x1f')](_0xfea5('0x38'),_0x409e8e);if(_0x31d140['timers']){logger[_0xfea5('0x2a')](_0xfea5('0x39'),JSON['stringify'](_0x31d140[_0xfea5('0x9')]));}}}catch(_0x25702e){logger[_0xfea5('0x1f')](_0xfea5('0x3a'),_0x25702e[_0xfea5('0x34')]);}};Acw[_0xfea5('0x18')][_0xfea5('0xc')]=function(_0x19ec13){try{if(this[_0xfea5('0x7')][_0x19ec13['queue']]&&(this['voiceQueues'][_0x19ec13['queue']][_0xfea5('0x4')]||this['voiceQueues'][_0x19ec13[_0xfea5('0x23')]][_0xfea5('0x24')])){if(this[_0xfea5('0x8')][_0x19ec13[_0xfea5('0x3b')]]){this[_0xfea5('0xa')][_0x19ec13[_0xfea5('0x32')]]={'queue':_0x19ec13[_0xfea5('0x23')],'interface':_0x19ec13[_0xfea5('0x3b')],'destlinkedid':_0x19ec13[_0xfea5('0x2d')]};}}}catch(_0x1a0461){logger[_0xfea5('0x1f')](_0xfea5('0x3c'),_0x1a0461['message']);}};Acw[_0xfea5('0x18')][_0xfea5('0x15')]=function(_0x1e1317){try{if(this[_0xfea5('0x7')][_0x1e1317[_0xfea5('0x23')]]&&(this['voiceQueues'][_0x1e1317[_0xfea5('0x23')]]['acw']||this['voiceQueues'][_0x1e1317[_0xfea5('0x23')]][_0xfea5('0x24')])){if(this[_0xfea5('0x8')][_0x1e1317['interface']]){this['channels'][_0x1e1317[_0xfea5('0x32')]]={'queue':_0x1e1317[_0xfea5('0x23')],'interface':_0x1e1317['interface']};}}}catch(_0x19774f){logger[_0xfea5('0x1f')]('[ACW][syncAgentConnectPreview]\x20%s',_0x19774f[_0xfea5('0x34')]);}};Acw[_0xfea5('0x18')][_0xfea5('0xe')]=function(_0x54a893){try{if(this['channels'][_0x54a893[_0xfea5('0x32')]]&&_[_0xfea5('0x3d')](this[_0xfea5('0xa')][_0x54a893[_0xfea5('0x32')]][_0xfea5('0x3e')])){logger['info'](_0xfea5('0x3f'),_0x54a893['uniqueid']);this[_0xfea5('0x22')](_0x54a893[_0xfea5('0x32')]);}else if(this[_0xfea5('0xa')][_0x54a893[_0xfea5('0x40')]]&&_[_0xfea5('0x3d')](this[_0xfea5('0xa')][_0x54a893[_0xfea5('0x40')]][_0xfea5('0x3e')])){logger['info'](_0xfea5('0x41'),_0x54a893[_0xfea5('0x40')]);this['startAcw'](_0x54a893[_0xfea5('0x40')]);}}catch(_0x45198e){logger[_0xfea5('0x1f')](_0xfea5('0x42'),_0x45198e[_0xfea5('0x34')]);}};Acw['prototype'][_0xfea5('0x43')]=function(_0x13ba2f){try{if(this[_0xfea5('0xa')][_0x13ba2f[_0xfea5('0x32')]]&&this[_0xfea5('0xa')][_0x13ba2f[_0xfea5('0x32')]][_0xfea5('0x3e')]){logger[_0xfea5('0x2a')](_0xfea5('0x44'),_0x13ba2f[_0xfea5('0x32')]);this[_0xfea5('0x22')](_0x13ba2f[_0xfea5('0x32')]);}else if(this[_0xfea5('0xa')][_0x13ba2f[_0xfea5('0x40')]]&&this[_0xfea5('0xa')][_0x13ba2f[_0xfea5('0x40')]][_0xfea5('0x3e')]){logger[_0xfea5('0x2a')](_0xfea5('0x45'),_0x13ba2f[_0xfea5('0x40')]);this['startAcw'](_0x13ba2f[_0xfea5('0x40')]);}}catch(_0x563c23){logger[_0xfea5('0x1f')](_0xfea5('0x46'),_0x563c23[_0xfea5('0x34')]);}};Acw[_0xfea5('0x18')][_0xfea5('0x47')]=function(_0x1835d2){try{if(!_['isNil'](this['channels'][_0x1835d2[_0xfea5('0x48')]])){this[_0xfea5('0x22')](_0x1835d2[_0xfea5('0x48')]);if(this[_0xfea5('0xa')][_0x1835d2[_0xfea5('0x49')]]){this[_0xfea5('0xa')][_0x1835d2[_0xfea5('0x49')]][_0xfea5('0x3e')]=!![];this[_0xfea5('0xa')][_0x1835d2['transfertargetuniqueid']]=this[_0xfea5('0xa')][_0x1835d2[_0xfea5('0x49')]];delete this[_0xfea5('0xa')][_0x1835d2[_0xfea5('0x49')]];}}else if(!_[_0xfea5('0x4a')](this['channels'][_0x1835d2[_0xfea5('0x4b')]])){this[_0xfea5('0x22')](_0x1835d2[_0xfea5('0x4b')]);if(this[_0xfea5('0xa')][_0x1835d2[_0xfea5('0x4c')]]){this['channels'][_0x1835d2['origtransfereruniqueid']]['attended']=!![];this[_0xfea5('0xa')][_0x1835d2['transfereeuniqueid']]=this[_0xfea5('0xa')][_0x1835d2[_0xfea5('0x4c')]];delete this['channels'][_0x1835d2[_0xfea5('0x4c')]];}}}catch(_0x5d4d49){logger['error'](_0xfea5('0x4d'),_0x5d4d49['message']);}};Acw[_0xfea5('0x18')]['syncBlindTransfer']=function(_0x4ad9a3){try{if(this[_0xfea5('0xa')][_0x4ad9a3[_0xfea5('0x4e')]]){logger['info'](_0xfea5('0x4f'),JSON[_0xfea5('0x50')](_0x4ad9a3['transfereruniqueid']));this[_0xfea5('0x22')](_0x4ad9a3[_0xfea5('0x4e')]);}else if(this['channels'][_0x4ad9a3[_0xfea5('0x51')]]){logger[_0xfea5('0x2a')](_0xfea5('0x52'),JSON[_0xfea5('0x50')](_0x4ad9a3['transfererlinkedid']));this[_0xfea5('0x22')](_0x4ad9a3['transfererlinkedid']);}}catch(_0x107c1a){logger['error'](_0xfea5('0x53'),_0x107c1a[_0xfea5('0x34')]);}};Acw[_0xfea5('0x18')][_0xfea5('0x54')]=function(_0x1a8734){try{if(this[_0xfea5('0x7')][_0x1a8734[_0xfea5('0x23')]]&&this[_0xfea5('0x7')][_0x1a8734[_0xfea5('0x23')]]['autopause']===_0xfea5('0x55')){if(this[_0xfea5('0x8')][_0x1a8734[_0xfea5('0x3b')]]){logger[_0xfea5('0x2a')](_0xfea5('0x56'),_0x1a8734[_0xfea5('0x32')],_0x1a8734[_0xfea5('0x3b')],_0x1a8734['queue']);return RpcUser[_0xfea5('0x2e')](this[_0xfea5('0x8')][_0x1a8734[_0xfea5('0x3b')]],_0xfea5('0x57'),_0x1a8734[_0xfea5('0x32')]);}}}catch(_0x5bbb47){logger[_0xfea5('0x1f')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x5bbb47['message']);}};module[_0xfea5('0x58')]=Acw; \ No newline at end of file +var _0x66a7=['isNil','transfereeuniqueid','secondtransfereruniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','bind','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','milliseconds','diff','timers','lastPauseAt','timer','update','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','prototype','startAcw','channels','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','acwTimeout','[ACW][START]\x20%s','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','pauseType','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','interface','syncAgentConnectPreview','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer'];(function(_0x20c6f1,_0x21fa65){var _0x43c3bf=function(_0x40c2dd){while(--_0x40c2dd){_0x20c6f1['push'](_0x20c6f1['shift']());}};_0x43c3bf(++_0x21fa65);}(_0x66a7,0xbc));var _0x766a=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0x66a7[_0x420b24];return _0x4da552;};'use strict';var _=require(_0x766a('0x0'));var moment=require(_0x766a('0x1'));var ami=require(_0x766a('0x2'));var logger=require(_0x766a('0x3'))(_0x766a('0x4'));var RpcUser=require(_0x766a('0x5'));var RpcVoiceAgentReport=require(_0x766a('0x6'));function Acw(_0x103646){this['voiceQueues']=_0x103646[_0x766a('0x7')];this['agents']=_0x103646[_0x766a('0x8')];this['timers']=_0x103646['timers'];this['channels']={};ami['on'](_0x766a('0x9'),this[_0x766a('0xa')]['bind'](this));ami['on'](_0x766a('0xb'),this[_0x766a('0xc')][_0x766a('0xd')](this));ami['on'](_0x766a('0xe'),this['syncHangup']['bind'](this));ami['on'](_0x766a('0xf'),this[_0x766a('0x10')][_0x766a('0xd')](this));ami['on'](_0x766a('0x11'),this['syncAttendedTransfer'][_0x766a('0xd')](this));ami['on'](_0x766a('0x12'),this[_0x766a('0x13')][_0x766a('0xd')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0x766a('0xd')](this));}function getDiff(_0x46d36b){var _0x456fb2=moment()[_0x766a('0x14')](0x0);var _0x316d12=moment(_0x46d36b)[_0x766a('0x14')](0x0);return _0x456fb2[_0x766a('0x15')](_0x316d12,'seconds');}Acw['prototype']['updateAcw']=function(_0x53c8d2,_0x4b83b9){var _0x269523=this;var _0x139d90=getDiff(_0x269523[_0x766a('0x16')][_0x53c8d2][_0x766a('0x17')]);clearTimeout(_0x269523[_0x766a('0x16')][_0x53c8d2][_0x766a('0x18')]);_0x269523[_0x766a('0x16')][_0x53c8d2][_0x766a('0x18')]=![];return RpcVoiceAgentReport[_0x766a('0x19')]({'acwtime':_0x139d90},_0x269523[_0x766a('0x16')][_0x53c8d2][_0x766a('0x1a')],_0x53c8d2)[_0x766a('0x1b')](function(_0x1d2e08){logger[_0x766a('0x1c')](_0x766a('0x1d'),_0x4b83b9,_0x139d90,_0x1d2e08);})[_0x766a('0x1e')](function(_0x3eb62a){logger[_0x766a('0x1f')](_0x766a('0x20'),_0x4b83b9,_0x3eb62a);})[_0x766a('0x21')](function(){delete _0x269523['timers'][_0x53c8d2];});};Acw[_0x766a('0x22')][_0x766a('0x23')]=function(_0x355217){try{var _0x19a6ba=this;var _0x1aa1bd=this[_0x766a('0x24')][_0x355217]['interface'];var _0x27b76e=this[_0x766a('0x24')][_0x355217][_0x766a('0x25')];var _0x5d5143=this[_0x766a('0x7')][_0x27b76e];var _0x2f90cd=![];var _0x3aa3fd='ACW';if(_0x5d5143[_0x766a('0x26')]&&_0x5d5143[_0x766a('0x27')][_0x766a('0x28')]){_0x2f90cd=!![];_0x3aa3fd=_0x5d5143['mandatoryDispositionPause'][_0x766a('0x28')];}return ami[_0x766a('0x29')]({'action':'QueuePause','interface':_0x1aa1bd,'paused':!![],'reason':_0x3aa3fd})['then'](function(){if(_0x19a6ba['agents'][_0x1aa1bd]){return RpcUser[_0x766a('0x2a')](_0x19a6ba[_0x766a('0x8')][_0x1aa1bd]['id'])[_0x766a('0x1b')](function(_0x4c0f5f){if(!_0x4c0f5f||_0x4c0f5f[_0x766a('0x2b')]){logger[_0x766a('0x1c')](_0x766a('0x2c'),_0x355217,_0x1aa1bd,_0x27b76e);return;}logger[_0x766a('0x1c')](_0x766a('0x2d'),_0x355217,_0x1aa1bd,_0x27b76e);var _0x47765c=_0x19a6ba[_0x766a('0x24')][_0x355217][_0x766a('0x2e')]&&_0x19a6ba[_0x766a('0x24')][_0x355217][_0x766a('0x2f')]?_0x19a6ba[_0x766a('0x24')][_0x355217][_0x766a('0x2f')]:_0x355217;return RpcUser[_0x766a('0x30')](_0x19a6ba[_0x766a('0x8')][_0x1aa1bd],_0x3aa3fd,_0x47765c)[_0x766a('0x1b')](function(_0x474830){_0x19a6ba[_0x766a('0x7')][_0x27b76e][_0x766a('0x31')]-=0x1;_0x19a6ba[_0x766a('0x7')][_0x27b76e]['paused']+=0x1;return _0x474830;});})[_0x766a('0x1b')](function(_0x2287ba){if(_0x2f90cd||!_0x2287ba){return;}_0x19a6ba[_0x766a('0x16')][_0x1aa1bd]={};logger[_0x766a('0x1c')](_0x766a('0x32'),_0x355217,_0x19a6ba[_0x766a('0x7')][_0x27b76e]['acwTimeout'],_0x1aa1bd,_0x27b76e);_0x19a6ba[_0x766a('0x16')][_0x1aa1bd][_0x766a('0x18')]=setTimeout(_0x19a6ba['stopAcw'][_0x766a('0xd')](_0x19a6ba,_0x1aa1bd),_0x19a6ba[_0x766a('0x7')][_0x27b76e]['acwTimeout']*0x3e8);_0x19a6ba[_0x766a('0x16')][_0x1aa1bd][_0x766a('0x17')]=moment()[_0x766a('0x33')](_0x766a('0x34'));_0x19a6ba['timers'][_0x1aa1bd]['uniqueid']=_0x355217;_0x19a6ba[_0x766a('0x16')][_0x1aa1bd][_0x766a('0x25')]=_0x27b76e;_0x19a6ba[_0x766a('0x16')][_0x1aa1bd][_0x766a('0x35')]=_0x19a6ba['updateAcw'][_0x766a('0xd')](_0x19a6ba,_0x1aa1bd,_0x355217);});}})[_0x766a('0x1e')](function(){logger[_0x766a('0x1f')](_0x766a('0x32'),_0x355217,_0x19a6ba[_0x766a('0x7')][_0x27b76e][_0x766a('0x36')],_0x1aa1bd,_0x27b76e);})[_0x766a('0x21')](function(){delete _0x19a6ba[_0x766a('0x24')][_0x355217];});}catch(_0x49c1fe){logger[_0x766a('0x1f')](_0x766a('0x37'),_0x49c1fe[_0x766a('0x38')]);}};Acw[_0x766a('0x22')][_0x766a('0x39')]=function(_0x4b41ed){try{var _0x1ccf03=this;if(_0x1ccf03[_0x766a('0x16')][_0x4b41ed]){_0x1ccf03['timers'][_0x4b41ed][_0x766a('0x18')]=![];var _0x414faa=_0x1ccf03[_0x766a('0x16')][_0x4b41ed][_0x766a('0x1a')];var _0x3efbd9=_0x1ccf03[_0x766a('0x16')][_0x4b41ed][_0x766a('0x25')];var _0x21eda9=_0x1ccf03[_0x766a('0x7')][_0x3efbd9][_0x766a('0x36')];logger[_0x766a('0x1c')](_0x766a('0x3a'),_0x414faa,_0x4b41ed);RpcUser[_0x766a('0x2a')](this[_0x766a('0x8')][_0x4b41ed]['id'])[_0x766a('0x1b')](function(_0x489058){if(_0x489058[_0x766a('0x3b')]==='ACW'){return RpcUser[_0x766a('0x3c')](_0x1ccf03['agents'][_0x4b41ed]);}});RpcVoiceAgentReport[_0x766a('0x19')]({'acwtime':_0x21eda9,'agentacw':!![]},_0x414faa,_0x4b41ed)[_0x766a('0x1b')](function(_0x2bc844){logger[_0x766a('0x1c')](_0x766a('0x1d'),_0x414faa,_0x21eda9,_0x2bc844);})[_0x766a('0x1e')](function(_0xb967c9){logger[_0x766a('0x1f')](_0x766a('0x20'),_0x414faa,_0xb967c9);});}else{logger[_0x766a('0x1f')](_0x766a('0x3d'),_0x4b41ed);if(_0x1ccf03[_0x766a('0x16')]){logger[_0x766a('0x1c')](_0x766a('0x3e'),JSON[_0x766a('0x3f')](_0x1ccf03[_0x766a('0x16')]));}}}catch(_0x394670){logger[_0x766a('0x1f')](_0x766a('0x40'),_0x394670['message']);}};Acw[_0x766a('0x22')][_0x766a('0xa')]=function(_0x312781){try{if(this[_0x766a('0x7')][_0x312781[_0x766a('0x25')]]&&(this[_0x766a('0x7')][_0x312781[_0x766a('0x25')]][_0x766a('0x4')]||this['voiceQueues'][_0x312781[_0x766a('0x25')]][_0x766a('0x26')])){if(this[_0x766a('0x8')][_0x312781[_0x766a('0x41')]]){this['channels'][_0x312781[_0x766a('0x1a')]]={'queue':_0x312781[_0x766a('0x25')],'interface':_0x312781[_0x766a('0x41')],'destlinkedid':_0x312781[_0x766a('0x2f')]};}}}catch(_0x508cf9){logger[_0x766a('0x1f')]('[ACW][syncAgentConnect]\x20%s',_0x508cf9['message']);}};Acw['prototype'][_0x766a('0x42')]=function(_0xf75d1d){try{if(this['voiceQueues'][_0xf75d1d['queue']]&&(this[_0x766a('0x7')][_0xf75d1d['queue']][_0x766a('0x4')]||this[_0x766a('0x7')][_0xf75d1d['queue']][_0x766a('0x26')])){if(this[_0x766a('0x8')][_0xf75d1d[_0x766a('0x41')]]){this[_0x766a('0x24')][_0xf75d1d['uniqueid']]={'queue':_0xf75d1d['queue'],'interface':_0xf75d1d['interface']};}}}catch(_0x21b631){logger[_0x766a('0x1f')]('[ACW][syncAgentConnectPreview]\x20%s',_0x21b631[_0x766a('0x38')]);}};Acw[_0x766a('0x22')][_0x766a('0xc')]=function(_0x44ba5c){try{if(this['channels'][_0x44ba5c[_0x766a('0x1a')]]&&_['isUndefined'](this[_0x766a('0x24')][_0x44ba5c['uniqueid']]['attended'])){logger[_0x766a('0x1c')](_0x766a('0x43'),_0x44ba5c['uniqueid']);this[_0x766a('0x23')](_0x44ba5c[_0x766a('0x1a')]);}else if(this['channels'][_0x44ba5c[_0x766a('0x44')]]&&_['isUndefined'](this[_0x766a('0x24')][_0x44ba5c[_0x766a('0x44')]][_0x766a('0x2e')])){logger[_0x766a('0x1c')]('[%s][HANGUP:LINKEDID]',_0x44ba5c['linkedid']);this[_0x766a('0x23')](_0x44ba5c[_0x766a('0x44')]);}}catch(_0x44d3b3){logger[_0x766a('0x1f')]('[ACW][syncHangupRequest]\x20%s',_0x44d3b3[_0x766a('0x38')]);}};Acw['prototype']['syncHangup']=function(_0x300dd3){try{if(this[_0x766a('0x24')][_0x300dd3['uniqueid']]&&this['channels'][_0x300dd3[_0x766a('0x1a')]][_0x766a('0x2e')]){logger[_0x766a('0x1c')](_0x766a('0x45'),_0x300dd3[_0x766a('0x1a')]);this[_0x766a('0x23')](_0x300dd3[_0x766a('0x1a')]);}else if(this[_0x766a('0x24')][_0x300dd3['linkedid']]&&this[_0x766a('0x24')][_0x300dd3['linkedid']][_0x766a('0x2e')]){logger[_0x766a('0x1c')](_0x766a('0x46'),_0x300dd3[_0x766a('0x44')]);this[_0x766a('0x23')](_0x300dd3['linkedid']);}}catch(_0x46af46){logger['error'](_0x766a('0x47'),_0x46af46[_0x766a('0x38')]);}};Acw[_0x766a('0x22')][_0x766a('0x48')]=function(_0x371578){try{if(!_[_0x766a('0x49')](this[_0x766a('0x24')][_0x371578[_0x766a('0x4a')]])){this[_0x766a('0x23')](_0x371578[_0x766a('0x4a')]);if(this[_0x766a('0x24')][_0x371578[_0x766a('0x4b')]]){this[_0x766a('0x24')][_0x371578[_0x766a('0x4b')]][_0x766a('0x2e')]=!![];this[_0x766a('0x24')][_0x371578['transfertargetuniqueid']]=this[_0x766a('0x24')][_0x371578[_0x766a('0x4b')]];delete this[_0x766a('0x24')][_0x371578[_0x766a('0x4b')]];}}else if(!_[_0x766a('0x49')](this[_0x766a('0x24')][_0x371578['transfertargetuniqueid']])){this[_0x766a('0x23')](_0x371578['transfertargetuniqueid']);if(this['channels'][_0x371578[_0x766a('0x4c')]]){this['channels'][_0x371578[_0x766a('0x4c')]][_0x766a('0x2e')]=!![];this[_0x766a('0x24')][_0x371578[_0x766a('0x4a')]]=this['channels'][_0x371578[_0x766a('0x4c')]];delete this['channels'][_0x371578[_0x766a('0x4c')]];}}}catch(_0x4a0fbe){logger['error'](_0x766a('0x4d'),_0x4a0fbe[_0x766a('0x38')]);}};Acw[_0x766a('0x22')][_0x766a('0x13')]=function(_0x4546bf){try{if(this[_0x766a('0x24')][_0x4546bf[_0x766a('0x4e')]]){logger[_0x766a('0x1c')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x766a('0x3f')](_0x4546bf[_0x766a('0x4e')]));this[_0x766a('0x23')](_0x4546bf[_0x766a('0x4e')]);}else if(this['channels'][_0x4546bf[_0x766a('0x4f')]]){logger[_0x766a('0x1c')](_0x766a('0x50'),JSON[_0x766a('0x3f')](_0x4546bf[_0x766a('0x4f')]));this[_0x766a('0x23')](_0x4546bf[_0x766a('0x4f')]);}}catch(_0x12f012){logger[_0x766a('0x1f')](_0x766a('0x51'),_0x12f012[_0x766a('0x38')]);}};Acw[_0x766a('0x22')][_0x766a('0x10')]=function(_0x243f9e){try{if(this[_0x766a('0x7')][_0x243f9e[_0x766a('0x25')]]&&this[_0x766a('0x7')][_0x243f9e[_0x766a('0x25')]][_0x766a('0x52')]==='all'){if(this[_0x766a('0x8')][_0x243f9e[_0x766a('0x41')]]){logger[_0x766a('0x1c')](_0x766a('0x53'),_0x243f9e[_0x766a('0x1a')],_0x243f9e[_0x766a('0x41')],_0x243f9e[_0x766a('0x25')]);return RpcUser[_0x766a('0x30')](this[_0x766a('0x8')][_0x243f9e[_0x766a('0x41')]],_0x766a('0x54'),_0x243f9e[_0x766a('0x1a')]);}}}catch(_0x2facbd){logger[_0x766a('0x1f')](_0x766a('0x55'),_0x2facbd['message']);}};module[_0x766a('0x56')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 22b2261..13f97c5 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x704f=['format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionSipPeerStatus','catch','exports','util','../../config/logger','../../config/environment','asterisk','port','username','keepConnected','Action','promisify','action','error'];(function(_0x1eb6e6,_0x43d684){var _0x4ef68c=function(_0x3cf78e){while(--_0x3cf78e){_0x1eb6e6['push'](_0x1eb6e6['shift']());}};_0x4ef68c(++_0x43d684);}(_0x704f,0x18d));var _0xf704=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0x704f[_0x18afca];return _0x11603f;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var util=require(_0xf704('0x0'));var logger=require(_0xf704('0x1'))('ami');var config=require(_0xf704('0x2'));var ami=new Manager(config[_0xf704('0x3')][_0xf704('0x4')],config[_0xf704('0x3')]['ip'],config[_0xf704('0x3')][_0xf704('0x5')],config[_0xf704('0x3')]['password'],!![]);ami[_0xf704('0x6')]();ami[_0xf704('0x7')]=BPromise[_0xf704('0x8')](ami[_0xf704('0x9')]);function error(_0x4b9004){logger[_0xf704('0xa')](util[_0xf704('0xb')](_0xf704('0xc'),config[_0xf704('0x3')][_0xf704('0x5')],config['asterisk']['ip'],config[_0xf704('0x3')][_0xf704('0x4')],util[_0xf704('0xd')](_0x4b9004,![],null)));}function close(){logger[_0xf704('0xa')](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xf704('0x3')][_0xf704('0x5')],config['asterisk']['ip'],config[_0xf704('0x3')]['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xf704('0xe')]=function(){return function(){return ami[_0xf704('0x7')]({'action':_0xf704('0xf')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xf704('0x7')]({'action':_0xf704('0x10')});};};ami[_0xf704('0x11')]=function(){return function(){return ami['Action']({'action':_0xf704('0x12')});};};ami[_0xf704('0x13')]=function(){return function(){return ami['Action']({'action':_0xf704('0x14')});};};function connect(){logger[_0xf704('0x15')](util[_0xf704('0xb')](_0xf704('0x16'),config['asterisk'][_0xf704('0x5')],config[_0xf704('0x3')]['ip'],config[_0xf704('0x3')][_0xf704('0x4')]));ami[_0xf704('0x17')](_0xf704('0xa'),error);ami[_0xf704('0x17')](_0xf704('0x18'),close);}ami['on']('connect',connect);ami['on'](_0xf704('0x19'),function(_0x4409f5){logger[_0xf704('0x15')](util['format'](_0xf704('0x1a'),config[_0xf704('0x3')]['username'],config[_0xf704('0x3')]['ip'],config[_0xf704('0x3')][_0xf704('0x4')],util[_0xf704('0xd')](_0x4409f5,![],null)));});ami['on']('fullybooted',function(){logger[_0xf704('0x15')](util['format'](_0xf704('0x1b'),config['asterisk'][_0xf704('0x5')],config['asterisk']['ip'],config[_0xf704('0x3')][_0xf704('0x4')]));return Promise[_0xf704('0x1c')]()[_0xf704('0x1d')](ami[_0xf704('0x1e')]())[_0xf704('0x1d')](ami[_0xf704('0xe')]())[_0xf704('0x1d')](ami[_0xf704('0x1f')]())[_0xf704('0x1d')](ami['actionQueueSummary']())['then'](ami[_0xf704('0x13')]())[_0xf704('0x20')](function(_0x152518){logger[_0xf704('0xa')]('[ami.js][fullybooted]',util['inspect'](_0x152518,{'showHidden':![],'depth':null}));});});ami[_0xf704('0x17')]('error',error);ami[_0xf704('0x17')](_0xf704('0x18'),close);module[_0xf704('0x21')]=ami; \ No newline at end of file +var _0x18d3=['util','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x18d3,0x90));var _0x318d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x18d3[_0xa464c9];return _0x3d73c4;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var util=require(_0x318d('0x0'));var logger=require(_0x318d('0x1'))(_0x318d('0x2'));var config=require(_0x318d('0x3'));var ami=new Manager(config[_0x318d('0x4')][_0x318d('0x5')],config[_0x318d('0x4')]['ip'],config[_0x318d('0x4')][_0x318d('0x6')],config[_0x318d('0x4')][_0x318d('0x7')],!![]);ami['keepConnected']();ami[_0x318d('0x8')]=BPromise['promisify'](ami[_0x318d('0x9')]);function error(_0x33a0ad){logger[_0x318d('0xa')](util[_0x318d('0xb')](_0x318d('0xc'),config[_0x318d('0x4')][_0x318d('0x6')],config[_0x318d('0x4')]['ip'],config[_0x318d('0x4')][_0x318d('0x5')],util[_0x318d('0xd')](_0x33a0ad,![],null)));}function close(){logger[_0x318d('0xa')](util[_0x318d('0xb')](_0x318d('0xe'),config[_0x318d('0x4')][_0x318d('0x6')],config['asterisk']['ip'],config[_0x318d('0x4')][_0x318d('0x5')]));}ami[_0x318d('0xf')]=function(){return function(){return ami[_0x318d('0x8')]({'action':_0x318d('0x10')});};};ami[_0x318d('0x11')]=function(){return function(){return ami[_0x318d('0x8')]({'action':_0x318d('0x12')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x318d('0x8')]({'action':'sippeerstatus'});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x318d('0x8')]({'action':_0x318d('0x13')});};};ami[_0x318d('0x14')]=function(){return function(){return ami[_0x318d('0x8')]({'action':_0x318d('0x15')});};};function connect(){logger[_0x318d('0x16')](util[_0x318d('0xb')](_0x318d('0x17'),config[_0x318d('0x4')]['username'],config[_0x318d('0x4')]['ip'],config[_0x318d('0x4')]['port']));ami[_0x318d('0x18')](_0x318d('0xa'),error);ami['once'](_0x318d('0x19'),close);}ami['on'](_0x318d('0x1a'),connect);ami['on'](_0x318d('0x1b'),function(_0xbeb791){logger[_0x318d('0x16')](util[_0x318d('0xb')](_0x318d('0x1c'),config[_0x318d('0x4')][_0x318d('0x6')],config[_0x318d('0x4')]['ip'],config[_0x318d('0x4')][_0x318d('0x5')],util[_0x318d('0xd')](_0xbeb791,![],null)));});ami['on'](_0x318d('0x1d'),function(){logger[_0x318d('0x16')](util['format'](_0x318d('0x1e'),config[_0x318d('0x4')][_0x318d('0x6')],config['asterisk']['ip'],config[_0x318d('0x4')]['port']));return Promise['resolve']()[_0x318d('0x1f')](ami[_0x318d('0xf')]())[_0x318d('0x1f')](ami[_0x318d('0x11')]())[_0x318d('0x1f')](ami[_0x318d('0x20')]())[_0x318d('0x1f')](ami['actionQueueSummary']())[_0x318d('0x1f')](ami[_0x318d('0x14')]())[_0x318d('0x21')](function(_0x4b1fca){logger['error'](_0x318d('0x22'),util[_0x318d('0xd')](_0x4b1fca,{'showHidden':![],'depth':null}));});});ami[_0x318d('0x18')](_0x318d('0xa'),error);ami[_0x318d('0x18')](_0x318d('0x19'),close);module[_0x318d('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index e2db43d..8df3ef9 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0x599d7f,_0xc586e8){var _0x3346d3=function(_0x56b820){while(--_0x56b820){_0x599d7f['push'](_0x599d7f['shift']());}};_0x3346d3(++_0xc586e8);}(_0x9bde,0xe1));var _0xe9bd=function(_0xb01bae,_0x54d555){_0xb01bae=_0xb01bae-0x0;var _0x186b74=_0x9bde[_0xb01bae];return _0x186b74;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var client=jayson['client'][_0xe9bd('0x2')]({'port':0x2329});client[_0xe9bd('0x3')]=function(_0x131f6a,_0x1c1b34){return new BPromise(function(_0x10822d,_0x1a4d14){return client[_0xe9bd('0x4')](_0x131f6a,_0x1c1b34)['then'](function(_0x4763e9){logger[_0xe9bd('0x5')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x1c1b34,_0x4763e9);if(_0x4763e9[_0xe9bd('0x8')]){logger[_0xe9bd('0x8')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x4763e9[_0xe9bd('0x8')][_0xe9bd('0x9')],_0x1c1b34);return _0x1a4d14(_0x4763e9['error']['message']);}else{return _0x10822d(_0x4763e9[_0xe9bd('0xa')]);}})[_0xe9bd('0xb')](function(_0x2601ac){logger['error'](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x2601ac,_0x1c1b34);return _0x1a4d14(_0x2601ac);});});};module[_0xe9bd('0xc')]=client; \ No newline at end of file +var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x13137e,_0x29c0f3){var _0x346261=function(_0x8c7d4f){while(--_0x8c7d4f){_0x13137e['push'](_0x13137e['shift']());}};_0x346261(++_0x29c0f3);}(_0xac4a,0x13f));var _0xaac4=function(_0x2bd0d7,_0x49a477){_0x2bd0d7=_0x2bd0d7-0x0;var _0x51137b=_0xac4a[_0x2bd0d7];return _0x51137b;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index c467b5e..6b84b52 100644 --- a/server/services/ami/dialer/index.js +++ b/server/services/ami/dialer/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9640=['Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','getSeconds','name','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','endtime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','isIVRCampaign','format','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','[ifTime][Action]','Error','stringify','isTrunkReachable','active','status','reachable','SIP/%s','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','ifTime','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','Failure','\x20Timezone\x20unknow\x20','isArray','push','iftime\x20%s,%s','interval','content','indexOf','true','catch','command','all','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','checkIsTrunkReachable','checkIfTime','dialTimezone','launchHandleIvr','dialMethod','predictive','handlePower','power','dialPowerLevel','Queue','dialGlobalInterval','silly','Dialer::ifTime()','intervalIftime','[ifTime][promiseAll]','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','uniqueId','type','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','droptime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','countdropretry','countglobal','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','queueCallerAbandonCreateState','rescheduleContact','add','dialDropRetryFrequency','minutes','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','statedesc','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','ContactId','ListId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','swapAdditionalPhones','actions','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','responsetime','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','HangupInAMD','membername','AMD','buildObj','amd','saveInDb','dialAMDActive','MACHINE','Machine','countmachineretry','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','outboundAnswerAgiCallsDay','countcongestionretry','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AGI','Normal\x20Clearing','[syncAgentComplete]','cause-txt','[syncHangupIvr][createHistory]','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','sequence','Action','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','setXMDContactVariables','Contact','getCallerId','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','variables','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','object','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','reason\x205\x20busy','custom:agentcongestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','agentreject','[syncAgentComplete][createHistory][20]','outboundUnknownCallsDay','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','predictiveIntervalErlangCallsDroppedCalls','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','avgHandleTime',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','check\x20failure','floor','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','inBlackList','handleIvr','limitCalls','temp','getContactDialerIvr','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','checkContactEmpty','countReScheduled','checkIsBlackList','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[countReScheduled]\x20','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','abandonmentRate','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','p\x20=\x20','Umin\x20=\x20','util','uuid','moment','ioredis','./utils/hopper','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','../ami','redis','localhost','socket.io-emitter','../rpc/interval','./models/action','./models/final','./models/agentComplete','./models/queueCallerAbandon','env','127.0.0.1','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','isEmpty','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgTalktime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor'];(function(_0x51a834,_0x4c1046){var _0x1298fe=function(_0x241fdb){while(--_0x241fdb){_0x51a834['push'](_0x51a834['shift']());}};_0x1298fe(++_0x4c1046);}(_0x9640,0x1bf));var _0x0964=function(_0x4320b9,_0x3340df){_0x4320b9=_0x4320b9-0x0;var _0x193aa5=_0x9640[_0x4320b9];return _0x193aa5;};'use strict';var util=require(_0x0964('0x0'));var _=require('lodash');var uuid=require(_0x0964('0x1'));var moment=require(_0x0964('0x2'));var rr=require('rr');var Redis=require(_0x0964('0x3'));var utils=require('./utils');var hopperUtils=require(_0x0964('0x4'));var ut=require('../preview/util/util');var config=require(_0x0964('0x5'));var logger=require(_0x0964('0x6'))(_0x0964('0x7'));var loggerBooked=require(_0x0964('0x6'))(_0x0964('0x8'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x0964('0x6'))(_0x0964('0x9'));var loggerSyncQueueSummary=require(_0x0964('0x6'))('syncQueueSummary');var ami=require(_0x0964('0xa'));config[_0x0964('0xb')]=_['defaults'](config[_0x0964('0xb')],{'host':_0x0964('0xc'),'port':0x18eb});var io=require(_0x0964('0xd'))(new Redis(config[_0x0964('0xb')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Interval=require(_0x0964('0xe'));var Action=require(_0x0964('0xf'));var History=require('./models/history');var Final=require(_0x0964('0x10'));var AgentComplete=require(_0x0964('0x11'));var QueueCallerAbandon=require(_0x0964('0x12'));var Hangup=require('./models/hangup');var ipAgi=process[_0x0964('0x13')]['XCALLY_IP_AGI']||_0x0964('0x14');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x0964('0x15')][_0x0964('0x16')]=function(_0x44dfad){this['tail']=this['tail']?this[_0x0964('0x17')][_0x0964('0x18')](_0x44dfad):_0x44dfad();};function Dialer(_0x1e1dbc,_0x4153d8){this['sequence']=new Sequence();this[_0x0964('0x19')]=_0x4153d8;this['voiceQueues']=_0x1e1dbc[_0x0964('0x1a')];this[_0x0964('0x1b')]=_0x1e1dbc[_0x0964('0x1b')];this[_0x0964('0x1c')]=_0x1e1dbc[_0x0964('0x1c')];this[_0x0964('0x1d')]=_0x1e1dbc[_0x0964('0x1d')];this['maxNumberOriginate']=config[_0x0964('0x1e')]||0x2;this[_0x0964('0x1f')]={};this['actions']={};this[_0x0964('0x20')]={};this['uniqueId']={};this[_0x0964('0x21')]={};this[_0x0964('0x22')]={};this[_0x0964('0x23')]={};this[_0x0964('0x24')]={};this[_0x0964('0x25')]={};this[_0x0964('0x26')]={};this[_0x0964('0x27')]={};ami['on'](_0x0964('0x28'),this[_0x0964('0x29')][_0x0964('0x2a')](this));ami['on'](_0x0964('0x2b'),this[_0x0964('0x2c')][_0x0964('0x2a')](this));ami['on'](_0x0964('0x2d'),this[_0x0964('0x2e')]['bind'](this));ami['on'](_0x0964('0x2f'),this[_0x0964('0x30')][_0x0964('0x2a')](this));ami['on'](_0x0964('0x31'),this[_0x0964('0x32')][_0x0964('0x2a')](this));ami['on'](_0x0964('0x33'),this[_0x0964('0x34')][_0x0964('0x2a')](this));ami['on'](_0x0964('0x35'),this[_0x0964('0x36')][_0x0964('0x2a')](this));ami['on'](_0x0964('0x37'),this[_0x0964('0x38')][_0x0964('0x2a')](this));ami['on'](_0x0964('0x39'),this[_0x0964('0x3a')]['bind'](this));ami['on']('queuemember',this[_0x0964('0x3b')][_0x0964('0x2a')](this));ami['on']('queuestatuscomplete',this[_0x0964('0x3c')][_0x0964('0x2a')](this));this[_0x0964('0x3d')]();this[_0x0964('0x3e')]();RpcSetting[_0x0964('0x3f')]()[_0x0964('0x40')](function(_0x231a02){previewRecallmeReminderInterval=_0x231a02[_0x0964('0x41')];});}function isNotNull(_0x5b5193){return _0x5b5193!==null&&!_[_0x0964('0x42')](_0x5b5193);}function msgResponse(_0x19c376,_0x47c642,_0x902ea1){return{'action':_0x19c376,'response':_0x47c642,'message':_0x902ea1,'stack':_0x902ea1};}function emit(_0x4137d9,_0x28bca5,_0x5aae40){io['to'](_0x4137d9)[_0x0964('0x43')](_0x28bca5,_0x5aae40);}function emitOutboundVoiceQueueSummary(_0x49bca){if(_0x49bca['type']===_0x0964('0x44')){logger[_0x0964('0x45')](_0x0964('0x46'),util[_0x0964('0x47')](_0x49bca,{'showHidden':![],'depth':null}));emit(util['format'](_0x0964('0x48'),_0x49bca['name']),'voice_queue:save',_0x49bca);}}function checkGetDataPredictive(_0x14ec23){if(isNotNull(_0x14ec23)&&!_[_0x0964('0x49')](_0x14ec23)){loggerPredictive['info'](_0x0964('0x4a'));loggerPredictive[_0x0964('0x4b')](_0x0964('0x4c'),_0x14ec23[_0x0964('0x4d')]);loggerPredictive[_0x0964('0x4b')](_0x0964('0x4e'),_0x14ec23[_0x0964('0x4f')]);loggerPredictive[_0x0964('0x4b')](_0x0964('0x50'),_0x14ec23[_0x0964('0x51')]);loggerPredictive[_0x0964('0x4b')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14ec23[_0x0964('0x52')]);loggerPredictive[_0x0964('0x4b')](_0x0964('0x53'),_0x14ec23[_0x0964('0x54')]);loggerPredictive[_0x0964('0x4b')](_0x0964('0x55'),_0x14ec23['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0x0964('0x56'));if(_0x14ec23['predictiveIntervalTotalCalls']>0x0){if(!_[_0x0964('0x42')](_0x14ec23[_0x0964('0x57')])&&_0x14ec23[_0x0964('0x57')]>0x0){return!![];}loggerPredictive[_0x0964('0x4b')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x0964('0x42')](_0x14ec23['predictiveIntervalAvgHoldtime'])&&_0x14ec23[_0x0964('0x54')]>0x0){return!![];}loggerPredictive[_0x0964('0x4b')](_0x0964('0x58'));}else{loggerPredictive['info'](_0x0964('0x59'));}}else{loggerPredictive[_0x0964('0x4b')](_0x0964('0x5a'));}return![];}function mergeDataErlangB(_0x472f00){return function(_0x346fbe){loggerPredictive[_0x0964('0x4b')](_0x0964('0x5b'));loggerPredictive[_0x0964('0x4b')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x346fbe[_0x0964('0x5c')]);loggerPredictive[_0x0964('0x4b')](_0x0964('0x5d'),_0x346fbe[_0x0964('0x5e')]);loggerPredictive[_0x0964('0x4b')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x346fbe['erlangAbandonmentRate']);loggerPredictive[_0x0964('0x4b')](_0x0964('0x5f'),_0x346fbe[_0x0964('0x60')]);loggerPredictive['info'](_0x0964('0x61'),_0x346fbe[_0x0964('0x62')]);loggerPredictive['info']('---------------------------');_[_0x0964('0x63')](_0x472f00,_0x346fbe);};}function ifInterval(_0x43c26d,_0x11fc77){if(_[_0x0964('0x42')](_0x11fc77)){return![];}return utils[_0x0964('0x64')](undefined,_0x11fc77)<_0x43c26d*0x3c;}function clearPredictiveAttributes(_0x211722){if(_0x211722[_0x0964('0x23')]){_0x211722[_0x0964('0x23')]=undefined;loggerPredictive['debug'](_0x211722['name'],'startProgressive\x20value\x20cleared');}if(_0x211722[_0x0964('0x22')]){_0x211722[_0x0964('0x22')]=undefined;loggerPredictive[_0x0964('0x45')](_0x211722[_0x0964('0x65')],_0x0964('0x66'));}if(_0x211722['handlePredictive']){clearInterval(_0x211722[_0x0964('0x67')]);_0x211722['handlePredictive']=undefined;loggerPredictive[_0x0964('0x45')](_0x211722[_0x0964('0x65')],_0x0964('0x68'));}}function loggerCatchPredictive(_0x218e7f,_0x4fe788){return function(_0x3bde28){loggerPredictive['error'](_0x4fe788[_0x0964('0x65')],_0x218e7f);loggerPredictive[_0x0964('0x69')](_0x3bde28[_0x0964('0x6a')]);clearPredictiveAttributes(_0x4fe788);};}function loggerCatch(_0x3690f3){return function(_0x477612){logger['error'](_0x3690f3,util[_0x0964('0x47')](_0x477612,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x585b68,_0x3ced86,_0x5aecd2){return function(_0x508f0d){utils[_0x0964('0x6b')](_0x3ced86,_0x5aecd2,0x0);_0x3ced86['temp']=0x0;logger[_0x0964('0x69')](_0x585b68,util[_0x0964('0x47')](_0x508f0d,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xbb4472){return function(_0x41ead6){if(isNotNull(_0x41ead6)&&isNotNull(_0x41ead6[0x0])){if(_0x41ead6[0x0][_0x0964('0x6c')]>0x0){_0xbb4472[_0x0964('0x6d')]=utils[_0x0964('0x6e')][_0x0964('0x6f')];logger[_0x0964('0x4b')](_0x0964('0x70')+_0xbb4472[_0x0964('0x65')],_0x41ead6[0x0][_0x0964('0x6c')],_0x0964('0x71'));}else{_0xbb4472[_0x0964('0x6d')]=utils[_0x0964('0x6e')][_0x0964('0x72')];logger[_0x0964('0x4b')](_0x0964('0x73')+_0xbb4472[_0x0964('0x65')]);}}};}function createObjHistory(_0x5f5b63,_0x2032f8,_0xa75004,_0x488c6c,_0x366492){_0x5f5b63[_0x0964('0x6d')]=_0xa75004;var _0x1f5f2d=new Action(_0x5f5b63,_0x2032f8);var _0x1ff44c=new History(_0x1f5f2d);_0x1ff44c[_0x0964('0x74')]=_0x488c6c;_0x1ff44c['statedesc']=_0x366492;_0x1ff44c[_0x0964('0x75')]=_0x1f5f2d['starttime'];return _0x1ff44c;}function unlockQueueStatus(_0x24f5ce,_0x2730b3){setTimeout(function(){if(_[_0x0964('0x42')](_0x24f5ce[_0x0964('0x76')])){loggerBooked[_0x0964('0x69')](_0x0964('0x77'),_0x2730b3);}_0x24f5ce[_0x0964('0x76')]=!![];loggerBooked[_0x0964('0x4b')](_0x0964('0x78'),_0x2730b3,JSON['stringify'](_[_0x0964('0x79')](_0x24f5ce,[_0x0964('0x65'),_0x0964('0x76')])));},0x1f3);}function checkInterval(_0x342d6a){return function(){if(!isNotNull(_0x342d6a[_0x0964('0x7a')])){_0x342d6a[_0x0964('0x6d')]=utils[_0x0964('0x6e')][_0x0964('0x7b')];throw _0x342d6a[_0x0964('0x65')]+_0x0964('0x7c');}if(!isNotNull(_0x342d6a[_0x0964('0x7a')]['Intervals'])){_0x342d6a[_0x0964('0x6d')]=utils[_0x0964('0x6e')][_0x0964('0x7b')];throw _0x342d6a['name']+_0x0964('0x7c');}if(!isNotNull(_[_0x0964('0x49')](_0x342d6a[_0x0964('0x7a')][_0x0964('0x7d')]))){_0x342d6a['message']=utils[_0x0964('0x6e')]['NULL_INTERVAL'];throw _0x342d6a[_0x0964('0x65')]+_0x0964('0x7c');}};}function checkIsIVRCampaignActive(_0x387a62){return function(){if(!utils[_0x0964('0x7e')](_0x387a62)){_0x387a62[_0x0964('0x6d')]=utils[_0x0964('0x6e')][_0x0964('0x7f')];throw _0x387a62['name']+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x5dc046){if(utils[_0x0964('0x80')](_0x5dc046)){emit(util[_0x0964('0x81')]('campaign:ivr:%s',_0x5dc046['name']),'campaign:save',_0x5dc046);}}function loggerCatchQueueSummary(_0x294858,_0x1a0162){return function(_0x240aeb){clearPredictiveAttributes(_0x1a0162);emitCampaignSummary(_0x1a0162);loggerSyncQueueSummary[_0x0964('0x45')](_0x294858,util[_0x0964('0x47')](_0x240aeb,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x481f5e){if(_0x481f5e[_0x0964('0x82')]){if(_0x481f5e[_0x0964('0x83')]===0x0){_0x481f5e[_0x0964('0x82')]=![];_0x481f5e['message']=utils[_0x0964('0x6e')][_0x0964('0x7f')];loggerSyncQueueSummary['debug'](_0x0964('0x84'),_0x481f5e['name'],_0x0964('0x85'));}else{_0x481f5e[_0x0964('0x6d')]=utils[_0x0964('0x6e')]['DISACTIVED'];loggerSyncQueueSummary['debug'](_0x0964('0x84'),_0x481f5e[_0x0964('0x65')],_0x0964('0x86'));}emitCampaignSummary(_0x481f5e);}}function myreject(_0x566f63){return function(_0x2deee1){return _0x566f63(msgResponse(_0x0964('0x87'),_0x0964('0x88'),JSON[_0x0964('0x89')](_0x2deee1)));};}Dialer['prototype'][_0x0964('0x8a')]=function(_0x139626){return!_[_0x0964('0x42')](_0x139626)&&_0x139626&&!_['isUndefined'](_0x139626['name'])&&!_[_0x0964('0x42')](_0x139626[_0x0964('0x8b')])&&_0x139626[_0x0964('0x8b')]&&(this[_0x0964('0x1d')][util[_0x0964('0x81')]('SIP/%s',_0x139626[_0x0964('0x65')])][_0x0964('0x8c')]===_0x0964('0x8d')||this[_0x0964('0x1d')][util[_0x0964('0x81')](_0x0964('0x8e'),_0x139626['name'])]['status']==='unmonitored');};Dialer[_0x0964('0x15')]['checkIsTrunkReachable']=function(_0x17d218){var _0x2b352e=this;return function(){if(!_0x2b352e[_0x0964('0x8a')](_0x17d218[_0x0964('0x8f')])){if(!_0x2b352e['isTrunkReachable'](_0x17d218[_0x0964('0x90')])){_0x17d218[_0x0964('0x6d')]=utils['CAMPAIGN_STATUS'][_0x0964('0x91')];throw _0x17d218[_0x0964('0x65')]+_0x0964('0x92');}}};};Dialer[_0x0964('0x15')]['checkIfTime']=function(_0x5707b0,_0x50951e,_0x37f55c,_0x21c242){var _0x2556a8=this;return function(){var _0x42ba76=!![];return _0x2556a8[_0x0964('0x93')](_0x5707b0,_0x50951e,_0x37f55c,_0x21c242,_0x42ba76);};};Dialer[_0x0964('0x15')][_0x0964('0x94')]=function(_0x24e0aa,_0x4fe272,_0x4813ce,_0x3944d1){var _0x15b3d2=this;return function(){var _0x4e8f7b=![];return _0x15b3d2['ifTimeIvr'](_0x24e0aa[_0x0964('0x7d')],_0x4fe272,_0x4813ce,_0x3944d1,_0x4e8f7b);};};Dialer['prototype']['ifTimeIvr']=function(_0x20ffc0,_0x2fe14d,_0x2aa5b4,_0x298d9c,_0x21c35d){var _0x53824c=[];return new Promise(function(_0x3b84a0,_0x2f0776){if(!isNotNull(_0x20ffc0)){_0x298d9c['message']=utils[_0x0964('0x6e')][_0x0964('0x7b')];return _0x2f0776(msgResponse('ifTime','Failure',_0x2aa5b4+_0x0964('0x95')));}if(_['isEmpty'](_0x20ffc0)){_0x298d9c['message']=utils['CAMPAIGN_STATUS']['EMPTY_INTERVAL'];return _0x2f0776(msgResponse(_0x0964('0x96'),'Failure',_0x2aa5b4+_0x0964('0x97')));}if(_0x2fe14d&&_['isUndefined'](config[_0x0964('0x98')][_0x2fe14d])){_0x298d9c['message']=utils[_0x0964('0x6e')][_0x0964('0x99')];return _0x2f0776(msgResponse(_0x0964('0x96'),_0x0964('0x9a'),_0x2aa5b4+_0x0964('0x9b')+_0x2fe14d));}if(_[_0x0964('0x9c')](_0x20ffc0)){for(var _0x38f96d=0x0;_0x38f96d<_0x20ffc0['length'];_0x38f96d+=0x1){_0x53824c[_0x0964('0x9d')](ami['Action']({'action':'command','command':util[_0x0964('0x81')](_0x0964('0x9e'),_0x20ffc0[_0x38f96d][_0x0964('0x9f')],!_['isUndefined'](config[_0x0964('0x98')][_0x2fe14d])?_0x2fe14d:'')})[_0x0964('0x40')](function(_0x2a73d0){return _0x2a73d0[_0x0964('0xa0')][_0x0964('0xa1')](_0x0964('0xa2'))>=0x0;})[_0x0964('0xa3')](myreject(_0x2f0776)));}}else{_0x53824c[_0x0964('0x9d')](ami['Action']({'action':_0x0964('0xa4'),'command':util['format'](_0x0964('0x9e'),_0x20ffc0,!_[_0x0964('0x42')](config['timezones'][_0x2fe14d])?_0x2fe14d:'')})[_0x0964('0x40')](function(_0x47adc7){return _0x47adc7[_0x0964('0xa0')]['indexOf'](_0x0964('0xa2'))>=0x0;})['catch'](myreject(_0x2f0776)));}Promise[_0x0964('0xa5')](_0x53824c)[_0x0964('0x40')](function(_0x3f9924){var _0x5d2af5=_['some'](_0x3f9924);if(_0x5d2af5){return _0x3b84a0(_0x5d2af5);}else{_0x298d9c[_0x0964('0x6d')]=_0x21c35d?utils[_0x0964('0x6e')][_0x0964('0xa6')]:utils['CAMPAIGN_STATUS'][_0x0964('0xa7')];return _0x2f0776(msgResponse('[ifTime][promiseAll]','Failure',_0x0964('0xa8')+_0x21c35d+'\x20'+_0x2aa5b4+_0x0964('0xa9')+util[_0x0964('0x47')](_0x20ffc0,{'showHidden':![],'depth':null})+_0x0964('0xaa')+_0x2fe14d));}})[_0x0964('0xa3')](function(_0x22e33f){return _0x2f0776(msgResponse(_0x0964('0x96'),_0x0964('0x9a'),JSON[_0x0964('0x89')](_0x22e33f)));});});};Dialer[_0x0964('0x15')][_0x0964('0x3d')]=function(){var _0x5e30fe=this;return cmHopper[_0x0964('0xab')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x5e30fe[_0x0964('0xac')]();},0x3e8);});};Dialer[_0x0964('0x15')][_0x0964('0xac')]=function(){var _0x202515=this;var _0x40bb6c;for(var _0x2cd298 in this[_0x0964('0x1b')]){if(typeof this[_0x0964('0x1b')][_0x2cd298]!==_0x0964('0xad')){_0x40bb6c=this[_0x0964('0x1b')][_0x2cd298];if(utils[_0x0964('0x80')](_0x40bb6c)&&utils[_0x0964('0x7e')](_0x40bb6c)){_0x40bb6c[_0x0964('0x82')]=!![];Promise[_0x0964('0xae')]()[_0x0964('0x40')](checkIsIVRCampaignActive(_0x40bb6c))[_0x0964('0x40')](checkInterval(_0x40bb6c))[_0x0964('0x40')](_0x202515[_0x0964('0xaf')](_0x40bb6c))['then'](_0x202515[_0x0964('0xb0')](_0x40bb6c['dialGlobalInterval'],_0x40bb6c[_0x0964('0xb1')],_0x40bb6c[_0x0964('0x65')],_0x40bb6c))[_0x0964('0x40')](_0x202515[_0x0964('0x94')](_0x40bb6c[_0x0964('0x7a')],_0x40bb6c[_0x0964('0xb1')],_0x40bb6c[_0x0964('0x65')],_0x40bb6c))['then'](_0x202515[_0x0964('0xb2')](_0x40bb6c))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x40bb6c));}else{notSendMessagesCampaign(_0x40bb6c);}}}};Dialer[_0x0964('0x15')]['checkDialMethod']=function(_0x595a44){if(_0x595a44[_0x0964('0xb3')]!==_0x0964('0xb4')){clearPredictiveAttributes(_0x595a44);}switch(_0x595a44[_0x0964('0xb3')]){case'progressive':this[_0x0964('0xb5')](_0x595a44,0x1);break;case _0x0964('0xb6'):this[_0x0964('0xb5')](_0x595a44,_0x595a44[_0x0964('0xb7')]);break;case _0x0964('0xb4'):this['predictive'](_0x595a44);break;case _0x0964('0x8'):this['handlePower'](_0x595a44,0x1);break;default:logger['error'](_0x0964('0xb8'),_0x595a44['name'],'method\x20not\x20recognized');}};Dialer['prototype'][_0x0964('0x96')]=function(_0x136e42,_0x525df7){var _0x451967=_0x136e42[_0x0964('0xb1')];var _0x8f0aac=_0x525df7?_0x136e42[_0x0964('0xb9')]:_0x136e42['Interval'][_0x0964('0x7d')];logger[_0x0964('0xba')](_0x0964('0xbb'),_0x8f0aac,_0x451967,_0x136e42[_0x0964('0x65')],util[_0x0964('0x81')]('Voice\x20Queue\x20%s\x20$s',_0x136e42[_0x0964('0x65')],_0x136e42['id']));var _0xe913af=null;return Interval[_0x0964('0xbc')](_0x8f0aac,_0x451967)['then'](function(_0x17211f){if(_0x17211f===!![]){return _0x17211f;}else{_0x136e42[_0x0964('0x6d')]=_0x525df7?utils[_0x0964('0x6e')][_0x0964('0xa6')]:utils[_0x0964('0x6e')][_0x0964('0xa7')];_0xe913af=msgResponse(_0x0964('0xbd'),_0x0964('0x9a'),'Global:\x20'+_0x525df7+'\x20'+_0x136e42[_0x0964('0x65')]+'\x20Interval\x20is\x20overtime:\x20'+util[_0x0964('0x47')](_0x8f0aac,{'showHidden':![],'depth':null})+_0x0964('0xaa')+_0x451967);}if(_0xe913af!==null){logger['silly'](_0x0964('0xbe'),_0xe913af);_0xe913af[_0x0964('0xbf')]=_0x525df7;throw _0xe913af;}})[_0x0964('0xa3')](function(_0x2ee746){logger['error'](_0x0964('0xc0'),_0x2ee746);throw msgResponse('[ifTime][Action]',_0x0964('0x88'),util[_0x0964('0x47')](_0x2ee746,{'showHidden':![],'depth':null}));});};Dialer[_0x0964('0x15')][_0x0964('0x29')]=function(_0x2a403c){if(this['voiceQueues'][_0x2a403c[_0x0964('0xc1')]]){if(this['uniqueId'][_0x2a403c[_0x0964('0xc2')]]&&this[_0x0964('0xc3')][_0x2a403c[_0x0964('0xc2')]][_0x0964('0xc4')]!==_0x0964('0xc5')){this[_0x0964('0xc6')](this[_0x0964('0x1a')][_0x2a403c[_0x0964('0xc1')]]);this['uniqueId'][_0x2a403c[_0x0964('0xc2')]][_0x0964('0xc7')]=moment()['format'](_0x0964('0xc8'));}}};Dialer['prototype']['syncAgentComplete']=function(_0x51d85c){var _0x35a007=this[_0x0964('0xc3')][_0x51d85c[_0x0964('0xc2')]];if(this[_0x0964('0x1a')][_0x51d85c[_0x0964('0xc1')]]){if(_0x35a007&&_0x35a007[_0x0964('0xc4')]!==_0x0964('0xc5')){delete this[_0x0964('0xc3')][_0x51d85c[_0x0964('0xc2')]];this[_0x0964('0x1a')][_0x51d85c[_0x0964('0xc1')]][_0x0964('0xc9')]+=0x1;var _0x4ebf4f=new AgentComplete(_0x35a007,_0x51d85c);if(_0x51d85c[_0x0964('0xca')]===_0x0964('0xcb')){_0x4ebf4f['agiafterat']=this[_0x0964('0x1a')][_0x51d85c[_0x0964('0xc1')]]['dialQueueProject2']&&this[_0x0964('0x1a')][_0x51d85c['queue']][_0x0964('0xcc')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0x0964('0xcd')](_0x4ebf4f)[_0x0964('0xa3')](loggerCatch(_0x0964('0xce')));hopperUtils[_0x0964('0xcf')](_0x4ebf4f)[_0x0964('0xa3')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x4b556e){var _0x4fde53=this[_0x0964('0xc3')][_0x4b556e[_0x0964('0xc2')]];var _0xf8a503=this;var _0x5f531f=![];var _0x55209b;var _0x4213d7;if(this[_0x0964('0x1a')][_0x4b556e[_0x0964('0xc1')]]){if(_0x4fde53&&_0x4fde53[_0x0964('0xc4')]!==_0x0964('0xc5')){delete this['uniqueId'][_0x4b556e[_0x0964('0xc2')]];this[_0x0964('0xc6')](this[_0x0964('0x1a')][_0x4b556e[_0x0964('0xc1')]]);_0x4fde53[_0x0964('0xd0')]=moment()[_0x0964('0x81')](_0x0964('0xc8'));var _0x5ccf6e=new QueueCallerAbandon(_0x4fde53,_0x4b556e);if(utils[_0x0964('0x64')](_0x4fde53[_0x0964('0xd0')],_0x4fde53['responsetime'])>=_0x4fde53[_0x0964('0xd1')]){this[_0x0964('0x1a')][_0x4b556e[_0x0964('0xc1')]][_0x0964('0x51')]+=0x1;this[_0x0964('0x1a')][_0x4b556e[_0x0964('0xc1')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x0964('0x1a')][_0x4b556e[_0x0964('0xc1')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x5ccf6e['state']=0xa;_0x5ccf6e['statedesc']=_0x0964('0xd2');_0x5ccf6e[_0x0964('0xd3')]=_0x0964('0xd4');_0x5ccf6e['agiafterat']=this[_0x0964('0x1a')][_0x4b556e[_0x0964('0xc1')]][_0x0964('0xd5')]?moment()[_0x0964('0x81')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x5ccf6e[_0x0964('0xd6')]+=0x1;_0x5ccf6e[_0x0964('0xd7')]+=0x1;_0x55209b=this[_0x0964('0x1a')][_0x4b556e[_0x0964('0xc1')]]['dialDropRetryFrequency'];_0x4213d7=this[_0x0964('0x1a')][_0x4b556e[_0x0964('0xc1')]][_0x0964('0xd8')];hopperUtils[_0x0964('0xd9')](_0x5ccf6e,_0x5ccf6e[_0x0964('0x74')],_0x4fde53[_0x0964('0xda')])[_0x0964('0x40')](function(_0xa3a658){_0x5f531f=_0xa3a658[_0x0964('0xdb')]==0x1;if(_0x5ccf6e[_0x0964('0xd6')]>=_0xf8a503[_0x0964('0x1a')][_0x4b556e['queue']]['dialDropMaxRetry']){_0xf8a503[_0x0964('0xdc')](_0x5ccf6e,_0xa3a658[_0x0964('0xdb')]);}else{hopperUtils[_0x0964('0xdd')]({'active':![],'countdropretry':_0x5ccf6e[_0x0964('0xd6')],'scheduledat':moment()[_0x0964('0xde')](_0xf8a503['voiceQueues'][_0x4b556e['queue']][_0x0964('0xdf')],_0x0964('0xe0'))[_0x0964('0x81')](_0x0964('0xc8')),'ContactId':_0x4fde53['ContactId'],'ListId':_0x4fde53['ListId'],'VoiceQueueId':_0x4fde53[_0x0964('0xe1')]||undefined,'CampaignId':_0x4fde53[_0x0964('0xe2')]||undefined})[_0x0964('0xa3')](loggerCatch(_0x0964('0xe3')));var _0x5a3c3f=new History(_0x5ccf6e);_0x5a3c3f['state']=0xa;_0x5a3c3f[_0x0964('0xe4')]=_0x0964('0xd2');_0x5a3c3f['starttime']=moment()[_0x0964('0x81')](_0x0964('0xc8'));_0x5a3c3f[_0x0964('0x75')]=_0x5a3c3f[_0x0964('0xe5')];_0x5a3c3f[_0x0964('0xe6')]=_0x5ccf6e[_0x0964('0xe6')];_0x5a3c3f[_0x0964('0xe7')]=_0x5ccf6e[_0x0964('0xe7')];hopperUtils[_0x0964('0xcd')](_0x5a3c3f)['catch'](loggerCatch(_0x0964('0xe8')));}})[_0x0964('0x40')](function(){if(_0x5f531f)hopperUtils['swapAdditionalPhones'](_0x5ccf6e,_0x55209b,_0x4213d7)[_0x0964('0x40')](function(){return 0x1;});});}else{this['voiceQueues'][_0x4b556e[_0x0964('0xc1')]][_0x0964('0x52')]+=0x1;this[_0x0964('0x1a')][_0x4b556e[_0x0964('0xc1')]][_0x0964('0xe9')]+=0x1;_0x5ccf6e['state']=0xb;_0x5ccf6e[_0x0964('0xe4')]=_0x0964('0xea');_0x5ccf6e[_0x0964('0xd3')]=_0x0964('0xeb');_0x5ccf6e[_0x0964('0xec')]+=0x1;_0x5ccf6e[_0x0964('0xd7')]+=0x1;_0x55209b=this[_0x0964('0x1a')][_0x4b556e['queue']][_0x0964('0xed')];_0x4213d7=this[_0x0964('0x1a')][_0x4b556e['queue']]['callAdditionalPhoneAfterMin'];hopperUtils['verifyAdditionalPhones'](_0x5ccf6e,_0x5ccf6e[_0x0964('0x74')],_0x4fde53[_0x0964('0xda')])[_0x0964('0x40')](function(_0x59285c){if(_0x5ccf6e[_0x0964('0xec')]>=_0xf8a503[_0x0964('0x1a')][_0x4b556e[_0x0964('0xc1')]][_0x0964('0xee')]){_0xf8a503[_0x0964('0xdc')](_0x5ccf6e,_0x59285c[_0x0964('0xdb')]);}else{hopperUtils[_0x0964('0xdd')]({'active':![],'countabandonedretry':_0x5ccf6e[_0x0964('0xec')],'scheduledat':moment()[_0x0964('0xde')](_0xf8a503[_0x0964('0x1a')][_0x4b556e['queue']]['dialAbandonedRetryFrequency'],_0x0964('0xe0'))[_0x0964('0x81')](_0x0964('0xc8')),'ContactId':_0x4fde53[_0x0964('0xef')],'ListId':_0x4fde53[_0x0964('0xf0')],'VoiceQueueId':_0x4fde53[_0x0964('0xe1')]||undefined,'CampaignId':_0x4fde53[_0x0964('0xe2')]||undefined})[_0x0964('0xa3')](loggerCatch(_0x0964('0xf1')));var _0x3785f7=new History(_0x5ccf6e);_0x3785f7[_0x0964('0x74')]=0xb;_0x3785f7[_0x0964('0xe4')]=_0x0964('0xea');_0x3785f7[_0x0964('0xe5')]=moment()[_0x0964('0x81')](_0x0964('0xc8'));_0x3785f7[_0x0964('0x75')]=_0x3785f7[_0x0964('0xe5')];_0x3785f7[_0x0964('0xe6')]=_0x5ccf6e[_0x0964('0xe6')];_0x3785f7[_0x0964('0xe7')]=_0x5ccf6e['calleridnum'];hopperUtils[_0x0964('0xcd')](_0x3785f7)[_0x0964('0xa3')](loggerCatch(_0x0964('0xf2')));}})[_0x0964('0x40')](function(){if(_0x5f531f)hopperUtils[_0x0964('0xf3')](_0x5ccf6e,_0x55209b,_0x4213d7)[_0x0964('0x40')](function(){return 0x1;});});}}}};Dialer[_0x0964('0x15')][_0x0964('0x38')]=function(_0x10064e){if(this[_0x0964('0xf4')][_0x10064e['uniqueid']]){this[_0x0964('0xf4')][_0x10064e[_0x0964('0xc2')]][_0x0964('0xf5')]=_0x10064e[_0x0964('0xf5')];}if(this['uniqueId'][_0x10064e['uniqueid']]){this[_0x0964('0xc3')][_0x10064e[_0x0964('0xc2')]][_0x0964('0xf5')]=_0x10064e['channel'];}};Dialer[_0x0964('0x15')]['syncQueueMember']=function(_0x2fa62a){if(!this['actions'][_0x2fa62a[_0x0964('0xf6')]]){return;}var _0x587e92=this[_0x0964('0x1a')][this['actions'][_0x2fa62a[_0x0964('0xf6')]][_0x0964('0xc1')]][_0x0964('0xf7')]||_0x0964('0xf8');if(_0x587e92===_0x0964('0xf9')){if(this[_0x0964('0xf4')][_0x2fa62a['actionid']]&&_[_0x0964('0xfa')](this[_0x0964('0xf4')][_0x2fa62a[_0x0964('0xf6')]][_0x0964('0xfb')])&&_0x2fa62a[_0x0964('0x8c')]==='1'&&_0x2fa62a[_0x0964('0xfc')]==='0'){if(this[_0x0964('0x1c')][_0x2fa62a[_0x0964('0xfd')]]){if(!this[_0x0964('0x1c')][_0x2fa62a[_0x0964('0xfd')]]['locked']){this[_0x0964('0x1c')][_0x2fa62a[_0x0964('0xfd')]][_0x0964('0xfb')]=!![];this[_0x0964('0xf4')][_0x2fa62a[_0x0964('0xf6')]][_0x0964('0xfb')]=!![];this[_0x0964('0xf4')][_0x2fa62a['actionid']][_0x0964('0xfd')]=_0x2fa62a[_0x0964('0xfd')];}}}}else if(_0x587e92===_0x0964('0xf8')){if(this[_0x0964('0xf4')][_0x2fa62a['actionid']]){if(this[_0x0964('0x1c')][_0x2fa62a[_0x0964('0xfd')]]){this[_0x0964('0xf4')][_0x2fa62a[_0x0964('0xf6')]][_0x0964('0xfd')]=_0x2fa62a[_0x0964('0xfd')];if(_[_0x0964('0xfa')](this[_0x0964('0x25')][this['actions'][_0x2fa62a[_0x0964('0xf6')]][_0x0964('0xc1')]])){this[_0x0964('0x25')][this[_0x0964('0xf4')][_0x2fa62a[_0x0964('0xf6')]][_0x0964('0xc1')]]=[];}this[_0x0964('0x25')][this[_0x0964('0xf4')][_0x2fa62a[_0x0964('0xf6')]][_0x0964('0xc1')]]['push'](_['merge'](_[_0x0964('0x79')](this[_0x0964('0xf4')][_0x2fa62a[_0x0964('0xf6')]],['idHopper',_0x0964('0xfd')]),{'status':_0x2fa62a[_0x0964('0x8c')],'paused':_0x2fa62a['paused']}));}}}};Dialer[_0x0964('0x15')][_0x0964('0x3c')]=function(_0xffd05e){if(!this[_0x0964('0xf4')][_0xffd05e[_0x0964('0xf6')]]){return;}var _0x14f45e=this;var _0x5b5b17=this['voiceQueues'][this[_0x0964('0xf4')][_0xffd05e[_0x0964('0xf6')]][_0x0964('0xc1')]];var _0xbbde3e=_0x5b5b17[_0x0964('0xf7')]||_0x0964('0xf8');if(_0xbbde3e==='roundrobin'){if(this[_0x0964('0xf4')][_0xffd05e[_0x0964('0xf6')]]&&this['actions'][_0xffd05e[_0x0964('0xf6')]]['stateinterface']){this[_0x0964('0x19')][_0x0964('0xfe')](this[_0x0964('0xf4')][_0xffd05e['actionid']][_0x0964('0xff')],this[_0x0964('0xf4')][_0xffd05e[_0x0964('0xf6')]]['stateinterface'])[_0x0964('0xa3')](function(_0x2bcd6d){logger[_0x0964('0x69')](_0x0964('0x100'),util[_0x0964('0x47')](_0x2bcd6d,{'showHidden':![],'depth':null}));})['finally'](function(){_0x14f45e['updateOriginated'](_0x14f45e[_0x0964('0x1a')][_0x14f45e['actions'][_0xffd05e[_0x0964('0xf6')]][_0x0964('0xc1')]]);_0x14f45e[_0x0964('0x1c')][_0x14f45e[_0x0964('0xf4')][_0xffd05e[_0x0964('0xf6')]]['stateinterface']]['locked']=![];delete _0x14f45e[_0x0964('0xf4')][_0xffd05e[_0x0964('0xf6')]];unlockQueueStatus(_0x5b5b17);});}else{this[_0x0964('0xc6')](this[_0x0964('0x1a')][this[_0x0964('0xf4')][_0xffd05e[_0x0964('0xf6')]]['queue']]);hopperUtils[_0x0964('0xdd')]({'active':![],'ContactId':this[_0x0964('0xf4')][_0xffd05e[_0x0964('0xf6')]]['ContactId'],'ListId':this['actions'][_0xffd05e['actionid']][_0x0964('0xf0')],'VoiceQueueId':this[_0x0964('0xf4')][_0xffd05e[_0x0964('0xf6')]][_0x0964('0xe1')]||undefined,'CampaignId':this[_0x0964('0xf4')][_0xffd05e['actionid']]['CampaignId']||undefined})[_0x0964('0xa3')](loggerCatch(_0x0964('0x101')));delete this[_0x0964('0xf4')][_0xffd05e[_0x0964('0xf6')]];unlockQueueStatus(_0x5b5b17);}}else if(_0xbbde3e===_0x0964('0xf8')){var _0x4cf7b1;if(this[_0x0964('0xf4')][_0xffd05e[_0x0964('0xf6')]]&&!_['isEmpty'](this[_0x0964('0x25')][this[_0x0964('0xf4')][_0xffd05e[_0x0964('0xf6')]][_0x0964('0xc1')]])){if(this[_0x0964('0x26')][_0x14f45e['actions'][_0xffd05e['actionid']]['queue']]){this['queueBookedRR'][_0x14f45e['actions'][_0xffd05e[_0x0964('0xf6')]][_0x0964('0xc1')]]=this[_0x0964('0x26')][this[_0x0964('0xf4')][_0xffd05e[_0x0964('0xf6')]][_0x0964('0xc1')]]?this[_0x0964('0x26')][this[_0x0964('0xf4')][_0xffd05e['actionid']][_0x0964('0xc1')]]:this[_0x0964('0x25')][this[_0x0964('0xf4')][_0xffd05e['actionid']][_0x0964('0xc1')]]?this[_0x0964('0x25')][this[_0x0964('0xf4')][_0xffd05e[_0x0964('0xf6')]][_0x0964('0xc1')]][_0x0964('0x102')]||0x0:0x0;}this[_0x0964('0x25')][this[_0x0964('0xf4')][_0xffd05e[_0x0964('0xf6')]][_0x0964('0xc1')]]['_rr']=this[_0x0964('0x26')][this[_0x0964('0xf4')][_0xffd05e[_0x0964('0xf6')]][_0x0964('0xc1')]];for(var _0xdf4e9=0x0;_0xdf4e9=_0xd66377[_0x0964('0x126')]){_0x5cf1ce[_0x0964('0x127')](_0x2c50b0,_0xc19110,_0x46affa,_0x0964('0x128'));}else{if(_0x2c50b0[_0x0964('0x11f')]>=_0xd66377[_0x0964('0x129')]){_0x5cf1ce[_0x0964('0x12a')](_0x2c50b0,_0xc19110,_0x46affa,_0x0964('0x12b'));}else{hopperUtils[_0x0964('0xdd')]({'active':![],'countmachineretry':_0x2c50b0['countmachineretry'],'scheduledat':moment()[_0x0964('0xde')](_0xd66377[_0x0964('0x12c')],_0x0964('0xe0'))[_0x0964('0x81')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2c50b0['ContactId'],'ListId':_0x2c50b0[_0x0964('0xf0')],'VoiceQueueId':_0x2c50b0['VoiceQueueId']||undefined,'CampaignId':_0x2c50b0[_0x0964('0xe2')]||undefined})['catch'](loggerCatch(_0x0964('0x12d')));_0xc19110({'reschedule':0x1});}}});}if(_0xb1c1b8[_0x0964('0xc4')]===_0x0964('0xc5')&&this['campaigns'][_0xb1c1b8[_0x0964('0xc1')]][_0x0964('0x11c')]&&_0x16ba40[_0x0964('0x114')]===_0x0964('0x115')){delete this['uniqueId'][_0x16ba40['uniqueid']];this[_0x0964('0xc6')](this[_0x0964('0x1b')][_0xb1c1b8[_0x0964('0xc1')]]);_0x780f51=new Hangup(_0xb1c1b8,_0x16ba40);_0x780f51['state']=0x12;_0x780f51[_0x0964('0xe4')]='HangupInAMD';_0x780f51['membername']=_0x0964('0x118');ami['emit']('custom:amd',ut[_0x0964('0x119')](_0x780f51,_0x0964('0x11a')));this[_0x0964('0x11b')](_0x780f51,'[syncHangupInAMDIvr][createHistory]',_0x0964('0x12e'));}if(_0xb1c1b8[_0x0964('0xc4')]==='ivr'&&this[_0x0964('0x1b')][_0xb1c1b8['queue']]['dialAMDActive']&&_0x16ba40[_0x0964('0x114')]===_0x0964('0x11d')){return new Promise(function(_0x58dcf9,_0x10b696){delete _0x5cf1ce[_0x0964('0xc3')][_0x16ba40[_0x0964('0xc2')]];_0x5cf1ce[_0x0964('0xc6')](_0x5cf1ce[_0x0964('0x1b')][_0xb1c1b8['queue']]);_0x5cf1ce[_0x0964('0x1b')][_0xb1c1b8[_0x0964('0xc1')]][_0x0964('0xc9')]+=0x1;_0x5cf1ce[_0x0964('0x1b')][_0xb1c1b8[_0x0964('0xc1')]][_0x0964('0x12f')]+=0x1;var _0x5bb073=_0x5cf1ce[_0x0964('0x1b')][_0xb1c1b8[_0x0964('0xc1')]];var _0x42f89c=new Hangup(_0xb1c1b8,_0x16ba40);_0x42f89c[_0x0964('0x74')]=0x13;_0x42f89c['statedesc']='Machine';_0x42f89c['membername']='AMD';_0x42f89c['countmachineretry']+=0x1;_0x42f89c['countglobal']+=0x1;_0x42f89c[_0x0964('0x11a')]=!![];ami['emit'](_0x0964('0x120'),ut[_0x0964('0x119')](_0x42f89c,_0x0964('0x11a')));hopperUtils[_0x0964('0xcd')](_0x42f89c)[_0x0964('0xa3')](loggerCatch(_0x0964('0x121')));if(_0x42f89c[_0x0964('0x122')]+_0x42f89c[_0x0964('0x130')]+_0x42f89c[_0x0964('0x123')]+_0x42f89c[_0x0964('0x124')]+_0x42f89c[_0x0964('0xd6')]+_0x42f89c['countabandonedretry']+_0x42f89c['countmachineretry']+_0x42f89c[_0x0964('0x125')]>=_0x5bb073[_0x0964('0x126')]){_0x5cf1ce[_0x0964('0x127')](_0x42f89c,_0x58dcf9,_0x10b696,_0x0964('0x128'));}else{if(_0x42f89c['countmachineretry']>=_0x5bb073[_0x0964('0x129')]){_0x5cf1ce[_0x0964('0x12a')](_0x42f89c,_0x58dcf9,_0x10b696,_0x0964('0x12b'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x42f89c[_0x0964('0x11f')],'scheduledat':moment()[_0x0964('0xde')](_0x5bb073[_0x0964('0x12c')],_0x0964('0xe0'))[_0x0964('0x81')](_0x0964('0xc8')),'ContactId':_0x42f89c[_0x0964('0xef')],'ListId':_0x42f89c['ListId'],'VoiceQueueId':_0x42f89c[_0x0964('0xe1')]||undefined,'CampaignId':_0x42f89c['CampaignId']||undefined})[_0x0964('0xa3')](loggerCatch(_0x0964('0x12d')));_0x58dcf9({'reschedule':0x1});}}});}}};Dialer[_0x0964('0x15')][_0x0964('0x36')]=function(_0x10cb56){var _0x3a530e=this[_0x0964('0xc3')][_0x10cb56['uniqueid']];var _0x2e34cb;if(_0x3a530e&&_0x3a530e[_0x0964('0xc4')]===_0x0964('0xc5')){delete this[_0x0964('0xc3')][_0x10cb56[_0x0964('0xc2')]];this['updateOriginated'](this[_0x0964('0x1b')][_0x3a530e[_0x0964('0xc1')]]);this['campaigns'][_0x3a530e[_0x0964('0xc1')]][_0x0964('0x131')]+=0x1;_0x2e34cb=new Hangup(_0x3a530e,_0x10cb56);hopperUtils['createHistory'](_0x2e34cb)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x2e34cb)[_0x0964('0xa3')](loggerCatch(_0x0964('0x132')));}if(_0x3a530e&&_0x3a530e[_0x0964('0xc4')]!==_0x0964('0xc5')&&isNotNull(this[_0x0964('0x1a')][_0x3a530e['queue']][_0x0964('0x133')])){delete this[_0x0964('0xc3')][_0x10cb56[_0x0964('0xc2')]];this[_0x0964('0xc6')](this[_0x0964('0x1a')][_0x3a530e[_0x0964('0xc1')]]);this[_0x0964('0x1a')][_0x3a530e[_0x0964('0xc1')]]['outboundAnswerCallsDay']+=0x1;this[_0x0964('0x1a')][_0x3a530e[_0x0964('0xc1')]][_0x0964('0x12f')]+=0x1;_0x2e34cb=new Hangup(_0x3a530e,_0x10cb56);_0x2e34cb[_0x0964('0x74')]=0x10;_0x2e34cb[_0x0964('0xe4')]='AnswerAGI';_0x2e34cb['membername']=_0x0964('0x134');hopperUtils['createHistory'](_0x2e34cb)[_0x0964('0xa3')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x0964('0xcf')](_0x2e34cb)['catch'](loggerCatch(_0x0964('0x132')));}if(_0x3a530e&&_0x3a530e[_0x0964('0xc4')]!==_0x0964('0xc5')&&!isNotNull(this[_0x0964('0x1a')][_0x3a530e[_0x0964('0xc1')]][_0x0964('0x133')])){if(_0x10cb56['cause-txt']===_0x0964('0x135')){delete this[_0x0964('0xc3')][_0x10cb56[_0x0964('0xc2')]];this[_0x0964('0x1a')][_0x3a530e[_0x0964('0xc1')]]['outboundAnswerCallsDay']+=0x1;const _0xe47895=new AgentComplete(_0x3a530e,_0x10cb56);_0xe47895[_0x0964('0xe2')]=this[_0x0964('0x1a')][_0x3a530e[_0x0964('0xc1')]]['id'];hopperUtils[_0x0964('0xcd')](_0xe47895)[_0x0964('0xa3')](loggerCatch(_0x0964('0xce')));hopperUtils['moveContactManagedDialer'](_0xe47895)[_0x0964('0xa3')](loggerCatch(_0x0964('0x136')));}else{delete this[_0x0964('0xc3')][_0x10cb56['uniqueid']];this[_0x0964('0xc6')](this['voiceQueues'][_0x3a530e[_0x0964('0xc1')]]);this[_0x0964('0x1a')][_0x3a530e[_0x0964('0xc1')]]['outboundUnknownCallsDay']+=0x1;_0x2e34cb=new Hangup(_0x3a530e,_0x10cb56);_0x2e34cb[_0x0964('0x74')]=0xc;_0x2e34cb[_0x0964('0xe4')]=_0x10cb56[_0x0964('0x137')];_0x2e34cb[_0x0964('0x117')]='Unknow';hopperUtils[_0x0964('0xcd')](_0x2e34cb)[_0x0964('0xa3')](loggerCatch(_0x0964('0x138')));hopperUtils[_0x0964('0xcf')](_0x2e34cb)['catch'](loggerCatch(_0x0964('0x132')));}}};Dialer[_0x0964('0x15')][_0x0964('0x32')]=function(_0x11ea9a){var _0x3e6ea7=this;if(!_0x3e6ea7[_0x0964('0x27')][_0x11ea9a[_0x0964('0x65')]]){_0x3e6ea7[_0x0964('0x27')][_0x11ea9a['name']]={'running':![]};}else if(_0x3e6ea7[_0x0964('0x27')][_0x11ea9a[_0x0964('0x65')]][_0x0964('0x139')]===!![]){return;}else if(_0x3e6ea7[_0x0964('0x27')][_0x11ea9a[_0x0964('0x65')]]['running']===![]){_0x3e6ea7['queuesSummary'][_0x11ea9a[_0x0964('0x65')]]['running']=!![];}var _0x3dcf58=_0x3e6ea7['voiceQueues'][_0x11ea9a[_0x0964('0x65')]];var _0x44e923=_0x3dcf58[_0x0964('0x6d')]!==utils[_0x0964('0x6e')]['INACTIVE'];var _0x3b7d60=utils[_0x0964('0x13a')](_0x3dcf58);_0x3dcf58[_0x0964('0x13b')]=utils[_0x0964('0x13c')](_0x3dcf58,_0x3e6ea7[_0x0964('0x1d')]);Promise[_0x0964('0xae')]()[_0x0964('0x40')](function(){if(_0x3dcf58['statusMessage']===utils[_0x0964('0x6e')]['INACTIVE']){if(_0x44e923){clearPredictiveAttributes(_0x3dcf58);_0x11ea9a[_0x0964('0x22')]=undefined;_0x11ea9a['startProgressive']=undefined;}if(_0x3dcf58[_0x0964('0x13b')]===utils[_0x0964('0x6e')][_0x0964('0x7f')]){_0x11ea9a[_0x0964('0x13d')]=0x0;_0x11ea9a[_0x0964('0xfc')]=0x0;_0x11ea9a['inUse']=0x0;_0x11ea9a[_0x0964('0x13e')]=0x0;_0x11ea9a[_0x0964('0x13f')]=0x0;}}else if(_0x3dcf58['statusMessage']===utils['CAMPAIGN_STATUS'][_0x0964('0x140')]&&!_0x3b7d60){return _0x3e6ea7[_0x0964('0x96')](_0x3dcf58,!![])[_0x0964('0x40')](function(){return _0x3e6ea7[_0x0964('0x96')](_0x3dcf58,![]);})[_0x0964('0x40')](function(){return _0x3e6ea7['checkDialMethod'](_0x3dcf58);})['catch'](function(_0x567c02){loggerSyncQueueSummary[_0x0964('0x45')](_0x0964('0x141'),util[_0x0964('0x47')](_0x567c02,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3dcf58);});}else{clearPredictiveAttributes(_0x3dcf58);}})[_0x0964('0x40')](function(){var _0x253a01=_0x11ea9a[_0x0964('0x142')](_0x3dcf58);if(_0x253a01||_0x3dcf58['queueSummaryCountersUpdated']){_0x3dcf58['queueSummaryCountersUpdated']=![];_0x11ea9a[_0x0964('0x143')](_0x3dcf58);Object[_0x0964('0x144')](_0x3dcf58,_0x11ea9a);emitOutboundVoiceQueueSummary(_0x11ea9a);}_0x3e6ea7['queuesSummary'][_0x3dcf58[_0x0964('0x65')]][_0x0964('0x139')]=![];})[_0x0964('0xa3')](function(_0xee1c22){logger[_0x0964('0x69')]('[syncQueueSummary]',util['inspect'](_0xee1c22,{'showHidden':![],'depth':null}));_0x3e6ea7['queuesSummary'][_0x3dcf58[_0x0964('0x65')]]['running']=![];});};Dialer[_0x0964('0x15')]['syncQueueSummaryComplete']=_[_0x0964('0x145')](function(){var _0x58c1ae=_[_0x0964('0x146')](this[_0x0964('0x1a')],function(_0x176b48){return _0x176b48[_0x0964('0x147')];});var _0x1d1717=_[_0x0964('0x146')](this[_0x0964('0x1c')],function(_0x5da915){return _0x5da915['online']&&_0x5da915[_0x0964('0x8c')]==='reachable';});if(_0x58c1ae['length']>0x0&&_0x1d1717['length']>0x0){return Promise['resolve']()[_0x0964('0x40')](cmHopper[_0x0964('0x148')](_[_0x0964('0x149')](_0x58c1ae,'id'),previewRecallmeReminderInterval,_['map'](_0x1d1717,'id')))[_0x0964('0x40')](function(_0x670f7){for(var _0x476ac8=0x0;_0x476ac8<_0x670f7[_0x0964('0x103')];_0x476ac8++){var _0x1abeb8=_0x670f7[_0x476ac8][_0x0964('0x14a')]['name'];if(_0x1abeb8)io['to'](util[_0x0964('0x81')](_0x0964('0x14b'),_0x1abeb8))[_0x0964('0x43')](_0x0964('0x14c'),{'hopper':_0x670f7[_0x476ac8]});}})['catch'](function(_0x25f069){logger['error']('checkPreviewRecallReminder',_0x25f069);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x0964('0x15')][_0x0964('0x3e')]=function(){var _0x4e77d4=this;setInterval(function(){_0x4e77d4[_0x0964('0x14d')](_0x4e77d4[_0x0964('0xc3')],_0x0964('0x14e'));_0x4e77d4['clearZombieChannels'](_0x4e77d4['actions'],_0x0964('0x14f'));},0x32c8);};Dialer[_0x0964('0x15')][_0x0964('0x14d')]=function(_0x5423e0,_0x581501){var _0x3c8db0=this;for(var _0x24af25 in _0x5423e0){if(typeof _0x5423e0[_0x24af25]!==_0x0964('0xad')){this[_0x0964('0x150')][_0x0964('0x16')](function(){if(!_[_0x0964('0xfa')](_0x5423e0[_0x24af25])){return ami[_0x0964('0x151')]({'action':_0x0964('0x8c'),'channel':_0x5423e0[_0x24af25][_0x0964('0xf5')]})[_0x0964('0xa3')](function(_0x31745f){if(_0x31745f[_0x0964('0x6d')]===_0x0964('0x152')){setTimeout(function(){if(_0x5423e0[_0x24af25]&&_0x5423e0[_0x24af25]['type']!==_0x0964('0xc5')){_0x3c8db0[_0x0964('0xc6')](_0x3c8db0[_0x0964('0x1a')][_0x5423e0[_0x24af25][_0x0964('0xc1')]]);logger[_0x0964('0x69')](_0x0964('0x153'),_0x581501,_0x24af25,_0x5423e0[_0x24af25][_0x0964('0xc1')]);delete _0x5423e0[_0x24af25];}if(_0x5423e0[_0x24af25]&&_0x5423e0[_0x24af25]['type']===_0x0964('0xc5')){_0x3c8db0[_0x0964('0xc6')](_0x3c8db0[_0x0964('0x1b')][_0x5423e0[_0x24af25][_0x0964('0xc1')]]);logger[_0x0964('0x69')](_0x0964('0x154'),_0x581501,_0x24af25,_0x5423e0[_0x24af25][_0x0964('0xc1')]);delete _0x5423e0[_0x24af25];}},0x2328);}});}});}}};Dialer['prototype'][_0x0964('0x155')]=function(_0x53b1b5){return Promise[_0x0964('0xae')]()[_0x0964('0x40')](voiceQueueRt[_0x0964('0x155')](_0x53b1b5))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x0964('0x15')]['updateOriginated']=function(_0x3977fc){if(!_['isUndefined'](_0x3977fc)&&_0x3977fc!==null){if(typeof _0x3977fc['originated']!==_0x0964('0xad')){if(_0x3977fc['originated']>0x0){_0x3977fc[_0x0964('0x83')]-=0x1;}else{logger[_0x0964('0x69')](_0x0964('0x156'));}}}else{logger[_0x0964('0x69')](_0x0964('0x157'));}};Dialer[_0x0964('0x15')][_0x0964('0x158')]=function(_0x31c74e,_0xa2e3cd){var _0x180a76=this;return function(_0x3d029a){_0x180a76['updateOriginated'](_0xa2e3cd);logger['error'](_0x31c74e,util['inspect'](_0x3d029a,{'showHidden':![],'depth':null}));};};Dialer[_0x0964('0x15')][_0x0964('0x159')]=function(_0x992016,_0x4b5dae,_0x9ad0e){var _0x16ef5b={'state':0x19,'statedesc':_0x0964('0x15a')};this[_0x0964('0xc6')](_0x4b5dae);this['saveInDb'](_[_0x0964('0x63')](_0x16ef5b,_[_0x0964('0x79')](_0x9ad0e,[_0x0964('0xef'),_0x0964('0xf0'),_0x0964('0x15b'),_0x0964('0xe1'),_0x0964('0xe2')])),_0x0964('0x15c'),_0x0964('0x15d'));logger[_0x0964('0x69')](_0x992016);};Dialer[_0x0964('0x15')][_0x0964('0x11b')]=function(_0x1db4cb,_0x5ba2d1,_0xb7ce2b){hopperUtils[_0x0964('0xcd')](_0x1db4cb)['catch'](loggerCatch(_0x5ba2d1));hopperUtils['moveContactManagedDialer'](_0x1db4cb)['catch'](loggerCatch(_0xb7ce2b));};Dialer[_0x0964('0x15')][_0x0964('0xdc')]=function(_0x354f6c,_0x3e28a3){hopperUtils[_0x0964('0xcd')](_0x354f6c)['catch'](loggerCatch(_0x0964('0xce')));if(_0x3e28a3==0x0){hopperUtils[_0x0964('0xcf')](_0x354f6c)[_0x0964('0xa3')](loggerCatch(_0x0964('0x15e')));}};Dialer['prototype'][_0x0964('0x15f')]=function(_0x4d6b31){return Promise[_0x0964('0xae')]()['then'](cmHopper[_0x0964('0x148')](_0x4d6b31['id'],previewRecallmeReminderInterval))['then'](function(_0x5b553c){for(var _0x35b8ea=0x0;_0x35b8ea<_0x5b553c[_0x0964('0x103')];_0x35b8ea++){var _0x5e815d=_0x5b553c[_0x35b8ea][_0x0964('0x14a')][_0x0964('0x65')];if(_0x5e815d)io['to'](util['format'](_0x0964('0x14b'),_0x5e815d))[_0x0964('0x43')](_0x0964('0x14c'),{'hopper':_0x5b553c[_0x35b8ea]});}})[_0x0964('0xa3')](function(){});};Dialer[_0x0964('0x15')][_0x0964('0xb2')]=function(_0x2ab9e8){var _0x1c287f=this;return function(){_0x1c287f['handleIvr'](_0x2ab9e8);};};Dialer[_0x0964('0x15')][_0x0964('0x160')]=function(_0x4e7f95,_0x15de05){var _0x69f7fc=this;var _0x29b92c=uuid['v4']();this[_0x0964('0xf4')][_0x29b92c]=new Action(_0x4e7f95,_0x15de05,_0x29b92c);return new Promise(function(_0x47a283,_0x412f90){if(_['isUndefined'](_0x4e7f95)&&typeof _0x4e7f95!=='object'){return _0x412f90(msgResponse(_0x0964('0x161'),_0x0964('0x9a'),_0x0964('0x162')));}if(_['isUndefined'](_0x15de05[_0x0964('0x163')])||_0x15de05[_0x0964('0x163')]===null){return _0x412f90(msgResponse(_0x0964('0x161'),_0x0964('0x9a'),_0x0964('0x164')));}var _0x279eed={'XMD-CALLERID':_0x69f7fc[_0x0964('0xf4')][_0x29b92c][_0x0964('0x165')](),'XMD-AGI':_0x4e7f95['dialQueueProject']?util['format'](_0x0964('0x166'),ipAgi,_0x4e7f95[_0x0964('0x133')]):_0x0964('0x167'),'XMD-AGIAFTER':_0x4e7f95[_0x0964('0xd5')]?util[_0x0964('0x81')](_0x0964('0x166'),ipAgi,_0x4e7f95[_0x0964('0xd5')]):_0x0964('0x167'),'XMD-QUEUE':utils['isOutboundQueue'](_0x4e7f95)?util[_0x0964('0x81')](_0x0964('0x168'),_0x4e7f95[_0x0964('0x65')],_0x4e7f95[_0x0964('0x169')]||'',_0x4e7f95[_0x0964('0xcc')]?'c':'',_0x4e7f95[_0x0964('0xd1')]||0x3):_0x0964('0x167'),'XMD-CONTACTID':_0x15de05[_0x0964('0xef')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x69f7fc[_0x0964('0xf4')][_0x29b92c]['getCaller'](),'XMD-AMD':_0x4e7f95['dialAMDActive']?_0x0964('0x140'):_0x0964('0x167'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x4e7f95[_0x0964('0x11c')]){_0x279eed[_0x0964('0x16a')]=_0x4e7f95[_0x0964('0x16b')]||0x9c4;_0x279eed[_0x0964('0x16c')]=_0x4e7f95[_0x0964('0x16d')]||0x5dc;_0x279eed[_0x0964('0x16e')]=_0x4e7f95[_0x0964('0x16f')]||0x320;_0x279eed[_0x0964('0x170')]=_0x4e7f95[_0x0964('0x171')]||0x1388;_0x279eed['XMD-AMDMINWORDLENGTH']=_0x4e7f95[_0x0964('0x172')]||0x64;_0x279eed[_0x0964('0x173')]=_0x4e7f95['dialAMDBetweenWordsSilence']||0x32;_0x279eed[_0x0964('0x174')]=_0x4e7f95['dialAMDMaximumNumberOfWords']||0x3;_0x279eed[_0x0964('0x175')]=_0x4e7f95[_0x0964('0x176')]||0x100;_0x279eed[_0x0964('0x177')]=_0x4e7f95[_0x0964('0x178')]||0x1388;}if(utils['isOutboundQueue'](_0x4e7f95)){_0x279eed[_0x0964('0x179')]=_0x15de05[_0x0964('0xe1')];}else{_0x279eed['XMD-CAMPAIGNID']=_0x15de05['CampaignId'];}var _0x1c9830=utils[_0x0964('0x17a')](_0x15de05[_0x0964('0x17b')]);Object['assign'](_0x279eed,_0x1c9830);var _0x3d2fdd=_0x69f7fc[_0x0964('0x8a')](_0x4e7f95[_0x0964('0x8f')])?utils[_0x0964('0x17c')](_0x4e7f95[_0x0964('0x8f')][_0x0964('0x17d')],_0x4e7f95[_0x0964('0x17e')],_0x4e7f95['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x0964('0x17f')](_0x4e7f95['dialOriginateCallerIdNumber'],_0x4e7f95[_0x0964('0x180')]):_0x4e7f95[_0x0964('0x181')]):utils[_0x0964('0x17c')](_['isNil'](_0x4e7f95[_0x0964('0x90')])?_0x4e7f95['Trunk'][_0x0964('0x17d')]:_0x4e7f95[_0x0964('0x90')]['callerid'],_0x4e7f95['dialOriginateCallerIdName'],_0x4e7f95[_0x0964('0x180')]>0x0?utils[_0x0964('0x17f')](_0x4e7f95[_0x0964('0x181')],_0x4e7f95['dialRandomLastDigitCallerIdNumber']):_0x4e7f95['dialOriginateCallerIdNumber']);if(_0x3d2fdd){_0x279eed[_0x0964('0x182')]=_0x69f7fc[_0x0964('0xf4')][_0x29b92c][_0x0964('0x183')]=utils[_0x0964('0x184')](_0x3d2fdd);_0x279eed['XMD-ORIGINATECALLERIDNUM']=_0x15de05['phone'];}_0x4e7f95[_0x0964('0x185')]=_0x279eed;return ami[_0x0964('0x151')]({'actionid':_0x29b92c,'action':_0x0964('0x161'),'channel':_0x69f7fc[_0x0964('0x8a')](_0x4e7f95[_0x0964('0x8f')])?util['format']('SIP/%s/%s%s',_0x4e7f95[_0x0964('0x8f')][_0x0964('0x65')],isNotNull(_0x4e7f95[_0x0964('0x186')])?_0x4e7f95[_0x0964('0x186')][_0x0964('0x187')]()||'':'',_0x4e7f95[_0x0964('0x188')]>0x0?_0x15de05[_0x0964('0x163')][_0x0964('0x189')](_0x4e7f95['dialCutDigit']):_0x15de05[_0x0964('0x163')]):util[_0x0964('0x81')](_0x0964('0x18a'),_[_0x0964('0xfa')](_0x4e7f95[_0x0964('0x90')])?_0x4e7f95[_0x0964('0x8f')]['name']:_0x4e7f95['TrunkBackup'][_0x0964('0x65')],isNotNull(_0x4e7f95[_0x0964('0x186')])?_0x4e7f95['dialPrefix'][_0x0964('0x187')]()||'':'',_0x4e7f95[_0x0964('0x188')]>0x0?_0x15de05[_0x0964('0x163')][_0x0964('0x189')](_0x4e7f95[_0x0964('0x188')]):_0x15de05[_0x0964('0x163')]),'callerid':_0x3d2fdd,'Exten':_0x0964('0x113'),'Context':_0x0964('0x18b'),'Priority':'1','variable':_0x279eed,'timeout':(_0x4e7f95[_0x0964('0x18c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x29b92c})[_0x0964('0x40')](function(_0x488d5d){return _0x47a283(_0x488d5d);})['catch'](function(_0x8928b3){_0x4e7f95['outboundOriginateFailureCallsDay']+=0x1;var _0x4a6278=new History(_0x69f7fc[_0x0964('0xf4')][_0x29b92c]);logger[_0x0964('0x69')](util['format'](_0x0964('0x18d'),JSON[_0x0964('0x89')](_0x8928b3)));_0x4a6278[_0x0964('0x74')]=0xe;_0x4a6278['statedesc']=_0x0964('0x18e');_0x4a6278[_0x0964('0xe5')]=moment()[_0x0964('0x81')](_0x0964('0xc8'));_0x4a6278[_0x0964('0x75')]=_0x4a6278[_0x0964('0xe5')];hopperUtils['createHistory'](_0x4a6278)[_0x0964('0xa3')](loggerCatch(_0x0964('0x18f')));_0x69f7fc[_0x0964('0xcf')](_0x4a6278)[_0x0964('0xa3')](loggerCatch(_0x0964('0x18f')))[_0x0964('0x18')](function(){delete _0x69f7fc['actions'][_0x29b92c];return _0x412f90(msgResponse(_0x0964('0x161'),_0x0964('0x88'),_0x0964('0x190')));});});});};Dialer[_0x0964('0x15')][_0x0964('0x191')]=function(_0x138381,_0x732612,_0x6b0b42){var _0x2a40b5=new History(_0x732612);if(_0x2a40b5[_0x0964('0x122')]+_0x2a40b5['countcongestionretry']+_0x2a40b5[_0x0964('0x123')]+_0x2a40b5[_0x0964('0x124')]+_0x2a40b5[_0x0964('0xd6')]+_0x2a40b5['countabandonedretry']+_0x2a40b5[_0x0964('0x11f')]+_0x2a40b5[_0x0964('0x125')]>=_0x6b0b42[_0x0964('0x126')]-0x1){return!![];}switch(_0x138381){case 0x3:if(_0x2a40b5[_0x0964('0x123')]>=_0x6b0b42[_0x0964('0x192')]-0x1){return!![];}hopperUtils[_0x0964('0xdd')]({'active':![],'countnoanswerretry':_0x2a40b5['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x6b0b42[_0x0964('0x193')],'minutes')['format'](_0x0964('0xc8')),'ContactId':_0x2a40b5[_0x0964('0xef')],'ListId':_0x2a40b5[_0x0964('0xf0')],'VoiceQueueId':_0x2a40b5[_0x0964('0xe1')]||undefined,'CampaignId':_0x2a40b5[_0x0964('0xe2')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x2a40b5[_0x0964('0x122')]>=_0x6b0b42[_0x0964('0x194')]-0x1){return!![];}hopperUtils[_0x0964('0xdd')]({'active':![],'countbusyretry':_0x2a40b5[_0x0964('0x122')]+=0x1,'scheduledat':moment()[_0x0964('0xde')](_0x6b0b42[_0x0964('0x195')],'minutes')[_0x0964('0x81')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2a40b5[_0x0964('0xef')],'ListId':_0x2a40b5[_0x0964('0xf0')],'VoiceQueueId':_0x2a40b5[_0x0964('0xe1')]||undefined,'CampaignId':_0x2a40b5['CampaignId']||undefined})[_0x0964('0xa3')](loggerCatch(_0x0964('0x196')));break;case 0x8:if(_0x2a40b5[_0x0964('0x130')]>=_0x6b0b42[_0x0964('0x197')]-0x1){return!![];}hopperUtils[_0x0964('0xdd')]({'active':![],'countcongestionretry':_0x2a40b5[_0x0964('0x130')]+=0x1,'scheduledat':moment()[_0x0964('0xde')](_0x6b0b42[_0x0964('0x198')],'minutes')[_0x0964('0x81')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2a40b5['ContactId'],'ListId':_0x2a40b5['ListId'],'VoiceQueueId':_0x2a40b5['VoiceQueueId']||undefined,'CampaignId':_0x2a40b5['CampaignId']||undefined})[_0x0964('0xa3')](loggerCatch(_0x0964('0x199')));break;case 0x0:if(_0x2a40b5[_0x0964('0x124')]>=_0x6b0b42[_0x0964('0x19a')]-0x1){return!![];}else{hopperUtils[_0x0964('0xdd')]({'active':![],'countnosuchnumberretry':_0x2a40b5[_0x0964('0x124')]+=0x1,'scheduledat':moment()[_0x0964('0xde')](_0x6b0b42[_0x0964('0x19b')],_0x0964('0xe0'))[_0x0964('0x81')](_0x0964('0xc8')),'ContactId':_0x2a40b5[_0x0964('0xef')],'ListId':_0x2a40b5[_0x0964('0xf0')],'VoiceQueueId':_0x2a40b5[_0x0964('0xe1')]||undefined,'CampaignId':_0x2a40b5[_0x0964('0xe2')]||undefined})[_0x0964('0xa3')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x2a40b5[_0x0964('0xd6')]>=_0x6b0b42[_0x0964('0x19c')]-0x1){return!![];}hopperUtils[_0x0964('0xdd')]({'active':![],'countdropretry':_0x2a40b5['countdropretry']+=0x1,'scheduledat':moment()[_0x0964('0xde')](_0x6b0b42['dialDropRetryFrequency'],_0x0964('0xe0'))[_0x0964('0x81')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2a40b5[_0x0964('0xef')],'ListId':_0x2a40b5[_0x0964('0xf0')],'VoiceQueueId':_0x2a40b5[_0x0964('0xe1')]||undefined,'CampaignId':_0x2a40b5[_0x0964('0xe2')]||undefined})[_0x0964('0xa3')](loggerCatch(_0x0964('0xe3')));break;case 0xb:if(_0x2a40b5[_0x0964('0xec')]>=_0x6b0b42[_0x0964('0xee')]-0x1){return!![];}hopperUtils[_0x0964('0xdd')]({'active':![],'countabandonedretry':_0x2a40b5['countabandonedretry']+=0x1,'scheduledat':moment()[_0x0964('0xde')](_0x6b0b42[_0x0964('0xed')],_0x0964('0xe0'))[_0x0964('0x81')](_0x0964('0xc8')),'ContactId':_0x2a40b5[_0x0964('0xef')],'ListId':_0x2a40b5[_0x0964('0xf0')],'VoiceQueueId':_0x2a40b5[_0x0964('0xe1')]||undefined,'CampaignId':_0x2a40b5[_0x0964('0xe2')]||undefined})[_0x0964('0xa3')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x2a40b5[_0x0964('0x11f')]>=_0x6b0b42['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x2a40b5['countmachineretry']+=0x1,'scheduledat':moment()[_0x0964('0xde')](_0x6b0b42[_0x0964('0x12c')],_0x0964('0xe0'))['format'](_0x0964('0xc8')),'ContactId':_0x2a40b5[_0x0964('0xef')],'ListId':_0x2a40b5['ListId'],'VoiceQueueId':_0x2a40b5['VoiceQueueId']||undefined,'CampaignId':_0x2a40b5[_0x0964('0xe2')]||undefined})[_0x0964('0xa3')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x2a40b5[_0x0964('0x125')]>=_0x6b0b42['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x0964('0xdd')]({'active':![],'countagentrejectretry':_0x2a40b5[_0x0964('0x125')]+=0x1,'scheduledat':moment()[_0x0964('0xde')](_0x6b0b42['dialAgentRejectRetryFrequency'],_0x0964('0xe0'))[_0x0964('0x81')](_0x0964('0xc8')),'ContactId':_0x2a40b5[_0x0964('0xef')],'ListId':_0x2a40b5['ListId'],'VoiceQueueId':_0x2a40b5[_0x0964('0xe1')]||undefined,'CampaignId':_0x2a40b5[_0x0964('0xe2')]||undefined})[_0x0964('0xa3')](loggerCatch(_0x0964('0x19d')));break;default:return!![];}};Dialer[_0x0964('0x15')][_0x0964('0x10e')]=function(_0x272d90,_0x1d3882,_0x53d781){var _0xf9b617=this;var _0x133fd0=new History(_0x272d90);var _0x5d1a5d=![];var _0x10c80d;var _0x34914f;return new Promise(function(_0x57f8d0,_0xd60d92){if(_[_0x0964('0x42')](_0x1d3882)&&typeof _0x1d3882!=='object'){return _0xd60d92(msgResponse(_0x0964('0x19e'),_0x0964('0x9a'),_0x0964('0x19f')));}if(_[_0x0964('0x42')](_0x53d781)&&typeof _0x53d781!==_0x0964('0x1a0')){return _0xd60d92(msgResponse(_0x0964('0x19e'),_0x0964('0x9a'),_0x0964('0x1a1')));}hopperUtils[_0x0964('0xd9')](_0x133fd0,_0x53d781[_0x0964('0xca')],_0x1d3882)[_0x0964('0x40')](function(_0x5b0a3c){if(_0x5b0a3c[_0x0964('0xdb')]==0x1)_0x5d1a5d=!![];switch(_0x53d781[_0x0964('0xca')]){case'0':_0x1d3882['outboundNoSuchCallsDay']+=0x1;_0x133fd0[_0x0964('0x74')]=0x0;_0x133fd0[_0x0964('0xe4')]='NoSuchNumber';_0x133fd0['countnosuchnumberretry']+=0x1;_0x133fd0['countglobal']+=0x1;ami['emit'](_0x0964('0x1a2'),ut[_0x0964('0x119')](_0x272d90,_0x0964('0x1a3')));_0x10c80d=_0x1d3882[_0x0964('0x19b')];_0x34914f=_0x1d3882[_0x0964('0xd8')];hopperUtils[_0x0964('0xcd')](_0x133fd0)['catch'](loggerCatch(_0x0964('0x121')));if(_0xf9b617['checkRetriveMax'](0x0,_0x272d90,_0x1d3882)&&!_0x5d1a5d){if(_0x133fd0['countnosuchnumberretry']>=_0x1d3882[_0x0964('0x19a')]){_0xf9b617[_0x0964('0x12a')](_0x133fd0,_0x57f8d0,_0xd60d92,_0x0964('0x1a4'));}else{_0xf9b617[_0x0964('0x127')](_0x133fd0,_0x57f8d0,_0xd60d92,_0x0964('0x1a4'));}}break;case'3':_0x1d3882[_0x0964('0x1a5')]+=0x1;_0x133fd0[_0x0964('0x74')]=0x3;_0x133fd0[_0x0964('0xe4')]=_0x0964('0x1a6');_0x133fd0[_0x0964('0x123')]+=0x1;_0x133fd0[_0x0964('0xd7')]+=0x1;var _0x9be668=ut[_0x0964('0x1a7')](_0x272d90,_0x1d3882);ami[_0x0964('0x43')](_0x0964('0x1a8'),_0x9be668);_0x10c80d=_0x1d3882[_0x0964('0x193')];_0x34914f=_0x1d3882[_0x0964('0xd8')];hopperUtils[_0x0964('0xcd')](_0x133fd0)[_0x0964('0xa3')](loggerCatch(_0x0964('0x1a9')));if(_0xf9b617['checkRetriveMax'](0x3,_0x272d90,_0x1d3882)&&!_0x5d1a5d){if(_0x133fd0[_0x0964('0x123')]>=_0x1d3882[_0x0964('0x192')]){_0xf9b617[_0x0964('0x12a')](_0x133fd0,_0x57f8d0,_0xd60d92,_0x0964('0x1aa'));}else{_0xf9b617[_0x0964('0x127')](_0x133fd0,_0x57f8d0,_0xd60d92,_0x0964('0x1aa'));}}break;case'5':_0x1d3882[_0x0964('0x1ab')]+=0x1;_0x133fd0[_0x0964('0x74')]=0x5;_0x133fd0[_0x0964('0xe4')]=_0x0964('0x1ac');_0x133fd0[_0x0964('0x122')]+=0x1;_0x133fd0[_0x0964('0xd7')]+=0x1;ami[_0x0964('0x43')](_0x0964('0x1ad'),ut['buildObj'](_0x272d90,_0x0964('0x1ae')));_0x10c80d=_0x1d3882[_0x0964('0x195')];_0x34914f=_0x1d3882[_0x0964('0xd8')];hopperUtils[_0x0964('0xcd')](_0x133fd0)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0xf9b617[_0x0964('0x191')](0x5,_0x272d90,_0x1d3882)&&!_0x5d1a5d){if(_0x133fd0[_0x0964('0x122')]>=_0x1d3882[_0x0964('0x194')]){_0xf9b617['createStateFinal'](_0x133fd0,_0x57f8d0,_0xd60d92,_0x0964('0x1af'));}else{_0xf9b617[_0x0964('0x127')](_0x133fd0,_0x57f8d0,_0xd60d92,_0x0964('0x1af'));}}break;case'8':_0x1d3882['outboundCongestionCallsDay']+=0x1;_0x133fd0[_0x0964('0x74')]=0x8;_0x133fd0[_0x0964('0xe4')]='Congestion';_0x133fd0[_0x0964('0x130')]+=0x1;_0x133fd0[_0x0964('0xd7')]+=0x1;_0x10c80d=_0x1d3882[_0x0964('0x198')];_0x34914f=_0x1d3882[_0x0964('0xd8')];ami[_0x0964('0x43')](_0x0964('0x1b0'),ut[_0x0964('0x119')](_0x272d90,'congestion'));hopperUtils[_0x0964('0xcd')](_0x133fd0)[_0x0964('0xa3')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0xf9b617[_0x0964('0x191')](0x8,_0x272d90,_0x1d3882)&&!_0x5d1a5d){if(_0x133fd0[_0x0964('0x130')]>=_0x1d3882[_0x0964('0x197')]){_0xf9b617[_0x0964('0x12a')](_0x133fd0,_0x57f8d0,_0xd60d92,_0x0964('0x1b1'));}else{_0xf9b617[_0x0964('0x127')](_0x133fd0,_0x57f8d0,_0xd60d92,_0x0964('0x1b1'));}}break;case'11':_0x1d3882[_0x0964('0x1b2')]+=0x1;_0x133fd0[_0x0964('0x74')]=0xb;_0x133fd0[_0x0964('0xe4')]='Abandoned';_0x133fd0[_0x0964('0xec')]+=0x1;_0x133fd0[_0x0964('0xd7')]+=0x1;_0x10c80d=_0x1d3882[_0x0964('0xed')];_0x34914f=_0x1d3882['callAdditionalPhoneAfterMin'];hopperUtils[_0x0964('0xcd')](_0x133fd0)[_0x0964('0xa3')](loggerCatch(_0x0964('0xf2')));if(_0xf9b617[_0x0964('0x191')](0xb,_0x272d90,_0x1d3882)&&!_0x5d1a5d){if(_0x133fd0[_0x0964('0xec')]>=_0x1d3882[_0x0964('0xee')]){_0xf9b617[_0x0964('0x12a')](_0x133fd0,_0x57f8d0,_0xd60d92,_0x0964('0x1b3'));}else{_0xf9b617[_0x0964('0x127')](_0x133fd0,_0x57f8d0,_0xd60d92,_0x0964('0x1b3'));}}break;case'20':_0x1d3882[_0x0964('0x1b4')]+=0x1;_0x133fd0['state']=0x14;_0x133fd0[_0x0964('0xe4')]=_0x0964('0x1b5');_0x133fd0['countagentrejectretry']+=0x1;_0x133fd0[_0x0964('0xd7')]+=0x1;_0x10c80d=_0x1d3882[_0x0964('0x1b6')];_0x34914f=_0x1d3882[_0x0964('0xd8')];ami[_0x0964('0x43')]('custom:agentreject',ut['buildObj'](_0x272d90,_0x0964('0x1b7')));hopperUtils[_0x0964('0xcd')](_0x133fd0)['catch'](loggerCatch(_0x0964('0x1b8')));if(_0xf9b617['checkRetriveMax'](0x14,_0x272d90,_0x1d3882)&&!_0x5d1a5d){if(_0x133fd0[_0x0964('0x125')]>=_0x1d3882['dialAgentRejectMaxRetry']){_0xf9b617[_0x0964('0x12a')](_0x133fd0,_0x57f8d0,_0xd60d92,'reason\x2020\x20agentreject');}else{_0xf9b617['stateGlobal'](_0x133fd0,_0x57f8d0,_0xd60d92,'reason\x2020\x20agentreject');}}break;default:_0x1d3882[_0x0964('0x1b9')]+=0x1;_0x133fd0[_0x0964('0x74')]=0xc;_0x133fd0[_0x0964('0xe4')]=_0x53d781[_0x0964('0xca')];_0x10c80d=_0x1d3882[_0x0964('0x1b6')];_0x34914f=_0x1d3882[_0x0964('0xd8')];hopperUtils[_0x0964('0xcd')](_0x133fd0)[_0x0964('0xa3')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0xf9b617['checkRetriveMax'](_0x53d781[_0x0964('0xca')],_0x272d90,_0x1d3882)&&!_0x5d1a5d){if(_0x133fd0[_0x0964('0x122')]+_0x133fd0[_0x0964('0x130')]+_0x133fd0[_0x0964('0x123')]+_0x133fd0[_0x0964('0x124')]+_0x133fd0[_0x0964('0xd6')]+_0x133fd0[_0x0964('0xec')]+_0x133fd0['countmachineretry']+_0x133fd0[_0x0964('0x125')]>=_0x1d3882[_0x0964('0x126')]){_0xf9b617[_0x0964('0x127')](_0x133fd0,_0x57f8d0,_0xd60d92,_0x53d781['reason']);}else{_0xf9b617[_0x0964('0x12a')](_0x133fd0,_0x57f8d0,_0xd60d92,_0x53d781['reason']);}}}})[_0x0964('0x40')](function(){if(_0x5d1a5d){hopperUtils[_0x0964('0xf3')](_0x133fd0,_0x10c80d,_0x34914f)[_0x0964('0x40')](function(){return _0x57f8d0(0x1);});}});});};Dialer[_0x0964('0x15')][_0x0964('0x127')]=function(_0x236879,_0x48ca09,_0x3f353f,_0x66c177){var _0x405d05=new Final(_0x236879);_0x405d05[_0x0964('0x74')]=0xf;_0x405d05['statedesc']=_0x0964('0x1ba');this[_0x0964('0x12a')](_0x405d05,_0x48ca09,_0x3f353f,_0x66c177);};Dialer[_0x0964('0x15')][_0x0964('0x12a')]=function(_0x3f8a5b,_0x5cd6a5,_0x3d45b5,_0x10444b){hopperUtils[_0x0964('0xcf')](_0x3f8a5b)[_0x0964('0x40')](function(){return _0x5cd6a5(msgResponse('[callProgressDetecting]',_0x0964('0x10d'),_0x10444b));})[_0x0964('0xa3')](function(){return _0x3d45b5(msgResponse('[moveContactManagedDialer][0]',_0x0964('0x9a'),_0x0964('0x1bb')));});};Dialer['prototype'][_0x0964('0xb4')]=function(_0x5eedb3){var _0x37dc8c=_0x5eedb3[_0x0964('0x1bc')]/0x64;var _0x5d1428=_0x5eedb3['outboundDropCallsDayTimeout']/(_0x5eedb3['outboundDropCallsDayTimeout']+_0x5eedb3['outboundAnswerCallsDay']);var _0x4294f7=Math[_0x0964('0x1bd')](_0x5eedb3[_0x0964('0x1be')]*(_0x5eedb3['predictiveIntervalMaxThreshold']/0x64));var _0x2577f1=Math['round'](_0x5eedb3[_0x0964('0x1be')]*(_0x5eedb3[_0x0964('0x1bf')]/0x64));var _0xd999e8=_0x5eedb3[_0x0964('0x13d')]+_0x5eedb3['talking'];var _0x53cab1=Math['floor'](_0x5eedb3[_0x0964('0x5c')]*_0x5eedb3[_0x0964('0x62')]*_0x5eedb3[_0x0964('0x1c0')]*_0x5eedb3[_0x0964('0x1c1')]);if(_['isUndefined'](_0x5eedb3[_0x0964('0x23')])){if(!_[_0x0964('0x42')](_0x5eedb3[_0x0964('0x22')])){_0x5eedb3[_0x0964('0x22')]=undefined;loggerPredictive[_0x0964('0x69')](_0x0964('0x1c2'),_0x0964('0x1c3'));}if(!_['isUndefined'](_0x5eedb3['handlePredictive'])){loggerPredictive[_0x0964('0x69')](_0x0964('0x1c2'),_0x0964('0x1c4'));clearInterval(_0x5eedb3[_0x0964('0x67')]);_0x5eedb3[_0x0964('0x67')]=undefined;}_0x5eedb3[_0x0964('0x23')]=moment()[_0x0964('0x81')](_0x0964('0xc8'));loggerPredictive[_0x0964('0x4b')](_0x5eedb3['name'],_0x0964('0x1c5'),_0x5eedb3['startProgressive']);this[_0x0964('0xb5')](_0x5eedb3,0x1);}else if(ifInterval(_0x5eedb3[_0x0964('0x1c6')],_0x5eedb3[_0x0964('0x23')])){this['handlePower'](_0x5eedb3,0x1);loggerPredictiveCalls[_0x0964('0x4b')]('[startMethodPredictive][StartProgressive][Loop]',_0x5eedb3[_0x0964('0x23')],_0x5eedb3['name']);_0x5eedb3[_0x0964('0x5c')]=0x0;_0x5eedb3['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x37dc8c<_0x5d1428&&_0x5eedb3[_0x0964('0x1c7')]===_0x0964('0x1c8')){clearPredictiveAttributes(_0x5eedb3);loggerPredictive[_0x0964('0x4b')](_0x0964('0x1c9'),_0x0964('0x1ca'),_0x5d1428,_0x0964('0x23'),_0x5eedb3[_0x0964('0x65')]);}else if(_0x53cab1<_0x5eedb3[_0x0964('0x1cb')]&&_0x5eedb3[_0x0964('0x1c7')]===_0x0964('0x1c8')){clearPredictiveAttributes(_0x5eedb3);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x0964('0x1cc'),_0x53cab1,_0x0964('0x1cd'),_0x5eedb3[_0x0964('0x1cb')],_0x0964('0x23'),_0x5eedb3[_0x0964('0x65')]);}else if(!ifInterval(_0x5eedb3['dialPredictiveInterval'],_0x5eedb3['startProgressive'])&&_[_0x0964('0x42')](_0x5eedb3['startPredictive'])&&!_[_0x0964('0x42')](_0x5eedb3[_0x0964('0x23')])){_0x5eedb3[_0x0964('0x22')]=moment()[_0x0964('0x81')](_0x0964('0xc8'));loggerPredictive[_0x0964('0x4b')](_0x5eedb3['name'],_0x0964('0x1ce'),_0x5eedb3['startPredictive']);hopperUtils['avgHandleTime'](_0x5eedb3[_0x0964('0x1c6')])[_0x0964('0x40')](this[_0x0964('0x1cf')](_0x5eedb3))[_0x0964('0x40')](mergeDataErlangB(_0x5eedb3))['then'](this[_0x0964('0x1d0')](_0x5eedb3))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x5eedb3));}else if(!ifInterval(_0x5eedb3[_0x0964('0x1c6')],_0x5eedb3['startPredictive'])){_0x5eedb3[_0x0964('0x1cb')]=0x0;_0x5eedb3[_0x0964('0x22')]=moment()['format'](_0x0964('0xc8'));loggerPredictive[_0x0964('0x4b')](_0x5eedb3['name'],_0x0964('0x1d1'),_0x5eedb3[_0x0964('0x22')]);clearInterval(_0x5eedb3[_0x0964('0x67')]);_0x5eedb3[_0x0964('0x67')]=undefined;hopperUtils[_0x0964('0x1d2')](_0x5eedb3[_0x0964('0x1c6')])[_0x0964('0x40')](this[_0x0964('0x1cf')](_0x5eedb3))[_0x0964('0x40')](mergeDataErlangB(_0x5eedb3))[_0x0964('0x40')](this[_0x0964('0x1d0')](_0x5eedb3))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x5eedb3));}else if(_0x5eedb3['predictiveIntervalAvailable']&&_0xd999e8<_0x5eedb3[_0x0964('0x1be')]-_0x2577f1){clearPredictiveAttributes(_0x5eedb3);loggerPredictive[_0x0964('0x4b')](_0x5eedb3['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0xd999e8,_0x0964('0x1d3'),_0x5eedb3[_0x0964('0x1be')],'-',_0x2577f1,'=',_0x5eedb3[_0x0964('0x1be')]-_0x2577f1,')');}else if(_0x5eedb3[_0x0964('0x1be')]&&_0xd999e8>_0x5eedb3['predictiveIntervalAvailable']+_0x4294f7){clearPredictiveAttributes(_0x5eedb3);loggerPredictive[_0x0964('0x4b')](_0x5eedb3[_0x0964('0x65')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0xd999e8,_0x0964('0x1d4'),_0x5eedb3[_0x0964('0x1be')],'+',_0x4294f7,'=',_0x5eedb3[_0x0964('0x1be')]+_0x4294f7,')');}};Dialer['prototype'][_0x0964('0x1cf')]=function(_0x392321){var _0x54ed23=this;return function(_0x29626d){return new Promise(function(_0x3019de,_0x4417c2){_[_0x0964('0x63')](_0x392321,_0x29626d[0x0]);if(checkGetDataPredictive(_0x29626d[0x0])){var _0x44e9b8=_0x392321[_0x0964('0x1be')]=_0x392321[_0x0964('0x13e')]+_0x392321['available'];var _0x2f6217=_0x392321[_0x0964('0x1c6')]*0x3c;var _0xcb3efe=_0x29626d[0x0][_0x0964('0x57')]+_0x29626d[0x0][_0x0964('0x54')];var _0xe93366=(_0x29626d[0x0][_0x0964('0x4f')]+_0x29626d[0x0][_0x0964('0x51')]+_0x29626d[0x0][_0x0964('0x52')])/_0x29626d[0x0]['predictiveIntervalTotalCalls'];_0x392321[_0x0964('0x1c0')]=_0xe93366>0x0?_0xe93366:0x1;switch(_0x392321[_0x0964('0x1c7')]){case _0x0964('0x1c8'):var _0xe183e1=_0x392321[_0x0964('0x1bc')]/0x64;return _0x54ed23['abandonmentRate'](_0x44e9b8,_0x2f6217,_0xcb3efe,_0xe93366,_0xe183e1)[_0x0964('0x40')](function(_0x1d8638){return _0x3019de(_0x1d8638);});case _0x0964('0x1d5'):var _0x49530e=_0x392321['dialPredictiveOptimizationPercentage']/0x64;return _0x54ed23[_0x0964('0x1d6')](_0x44e9b8,_0x2f6217,_0xcb3efe,_0xe93366,_0x49530e)[_0x0964('0x40')](function(_0x408ea7){return _0x3019de(_0x408ea7);});default:return _0x4417c2(msgResponse(_0x0964('0x1d7'),_0x0964('0x9a'),_0x0964('0x1d8')));}}else{return _0x4417c2(msgResponse(_0x0964('0x1d7'),'Failure','check\x20failure'));}});};};Dialer[_0x0964('0x15')][_0x0964('0x1d9')]=function(_0x586a9c){var _0x9c78e8=this;return function(_0x1724a8){return new Promise(function(_0x219e9f,_0x397aed){_[_0x0964('0x63')](_0x586a9c,_0x1724a8[0x0]);if(checkGetDataPredictive(_0x1724a8[0x0])){loggerPredictive[_0x0964('0x4b')](JSON['stringify'](_0x1724a8[0x0]));if(_0x586a9c['dialPredictiveOptimization']==='dropRate'){return _0x9c78e8[_0x0964('0x155')](_0x586a9c['id'])['then'](function(_0x37476a){var _0x4db9af=_0x586a9c[_0x0964('0x1da')]-_0x37476a[0x0][_0x0964('0x1db')];var _0x2a9dbb=_0x586a9c[_0x0964('0x1c6')]*0x3c;var _0x36a309=_0x1724a8[0x0][_0x0964('0x57')]+_0x1724a8[0x0]['predictiveIntervalAvgHoldtime'];var _0x14d4c1=(_0x1724a8[0x0][_0x0964('0x4f')]+_0x1724a8[0x0][_0x0964('0x51')]+_0x1724a8[0x0][_0x0964('0x52')])/_0x1724a8[0x0][_0x0964('0x4d')];var _0x1a41a9=_0x586a9c[_0x0964('0x1bc')]/0x64;_0x586a9c[_0x0964('0x1dc')]=_0x37476a[0x0][_0x0964('0x1db')]||0x0;_0x586a9c[_0x0964('0x1c0')]=_0x14d4c1>0x0?_0x14d4c1:0x1;return _0x9c78e8['abandonmentRate'](_0x4db9af,_0x2a9dbb,_0x36a309,_0x14d4c1,_0x1a41a9);})[_0x0964('0x40')](function(_0x4b0137){return _0x219e9f(_0x4b0137);})[_0x0964('0xa3')](function(_0x3a86d6){return _0x397aed(msgResponse(_0x0964('0x1dd'),_0x0964('0x9a'),JSON[_0x0964('0x89')](_0x3a86d6)));});}if(_0x586a9c['dialPredictiveOptimization']===_0x0964('0x1d5')){return _0x9c78e8['getVoiceQueueRtPauses'](_0x586a9c['id'])['then'](function(_0x453de5){var _0x3cdc94=_0x586a9c[_0x0964('0x1da')]-_0x453de5[0x0][_0x0964('0x1db')];var _0x1aa45d=_0x586a9c['dialPredictiveInterval']*0x3c;var _0x5902ef=_0x1724a8[0x0]['predictiveIntervalAvgTalktime']+_0x1724a8[0x0][_0x0964('0x54')];var _0x3c1916=(_0x1724a8[0x0][_0x0964('0x4f')]+_0x1724a8[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1724a8[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1724a8[0x0]['predictiveIntervalTotalCalls'];var _0x3c87d2=_0x586a9c[_0x0964('0x1bc')]/0x64;_0x586a9c[_0x0964('0x1dc')]=_0x453de5[0x0][_0x0964('0x1db')]||0x0;_0x586a9c['predictiveIntervalHitRate']=_0x3c1916>0x0?_0x3c1916:0x1;return _0x9c78e8['busyFactor'](_0x3cdc94,_0x1aa45d,_0x5902ef,_0x3c1916,_0x3c87d2);})[_0x0964('0x40')](function(_0x133c37){return _0x219e9f(_0x133c37);})['catch'](function(_0x1f1b84){return _0x397aed(msgResponse('[CatchErlangB]',_0x0964('0x9a'),JSON[_0x0964('0x89')](_0x1f1b84)));});}}else{return _0x397aed(msgResponse(_0x0964('0x1d7'),_0x0964('0x9a'),_0x0964('0x1de')));}});};};Dialer[_0x0964('0x15')][_0x0964('0x1d0')]=function(_0x5d1556){var _0x26359f=this;return function(){var _0xe38ebf=0x0;var _0x186c90=Math[_0x0964('0x1df')](_0x5d1556['erlangCallToSecond']*0x3e8);if(_0x186c90>0x0){_0x186c90=_0x186c90<0x64?0x64:_0x186c90;loggerPredictive['info'](_0x5d1556[_0x0964('0x65')],_0x0964('0x1e0'),_0x186c90,_0x0964('0x1e1'));_0x5d1556['handlePredictive']=setInterval(function(){_0x26359f[_0x0964('0x67')](_0x5d1556);loggerPredictiveCalls[_0x0964('0x4b')](_0x0964('0x1e2'),_0xe38ebf+=0x1);},_0x186c90);}else{loggerPredictive[_0x0964('0x4b')](_0x5d1556[_0x0964('0x65')],_0x0964('0x1e3'));}};};Dialer[_0x0964('0x15')][_0x0964('0x1e4')]=function(_0x3841b7,_0x551134){var _0x3045b4=this;return function(_0x2bae01){if(_[_0x0964('0x49')](_0x2bae01)){if(_[_0x0964('0xfa')](_0x551134[_0x0964('0x15b')])||!_0x551134[_0x0964('0x1e5')]){if(_0x3841b7[_0x0964('0xb3')]===_0x0964('0x8')){_0x3841b7[_0x0964('0x76')]=_[_0x0964('0x42')](_0x3841b7[_0x0964('0x76')])?!![]:_0x3841b7['queueStatusComplete'];var _0x36642c=uuid['v4']();_0x3045b4[_0x0964('0xf4')][_0x36642c]=new Action(_0x3841b7,_0x551134,_0x36642c);loggerBooked[_0x0964('0x4b')](_0x0964('0x1e6'),_0x36642c,_0x0964('0x1e7'),JSON[_0x0964('0x89')](_0x3841b7[_0x0964('0x76')]),_0x0964('0x1e8'),_0x3841b7[_0x0964('0x65')]);if(_0x3841b7[_0x0964('0x76')]){_0x3841b7[_0x0964('0x76')]=![];_0x3045b4[_0x0964('0x25')][_0x3045b4[_0x0964('0xf4')][_0x36642c][_0x0964('0xc1')]]=[];ami[_0x0964('0x151')]({'actionid':_0x36642c,'action':'queuestatus','queue':_0x3841b7['name']})[_0x0964('0xa3')](function(){_0x3045b4[_0x0964('0xc6')](_0x3841b7);hopperUtils[_0x0964('0xdd')]({'active':![],'ContactId':_0x3045b4[_0x0964('0xf4')][_0x36642c][_0x0964('0xef')],'ListId':_0x3045b4[_0x0964('0xf4')][_0x36642c]['ListId'],'VoiceQueueId':_0x3045b4['actions'][_0x36642c]['VoiceQueueId']||undefined,'CampaignId':_0x3045b4[_0x0964('0xf4')][_0x36642c]['CampaignId']||undefined})[_0x0964('0xa3')](loggerCatch(_0x0964('0x1e9')));delete _0x3045b4[_0x0964('0xf4')][_0x36642c];});}else{loggerBooked[_0x0964('0x4b')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x3841b7[_0x0964('0x76')]),'Queue:\x20',_0x3841b7['name']);_0x3045b4['updateOriginated'](_0x3841b7);hopperUtils[_0x0964('0xdd')]({'active':![],'ContactId':_0x3045b4[_0x0964('0xf4')][_0x36642c]['ContactId'],'ListId':_0x3045b4[_0x0964('0xf4')][_0x36642c][_0x0964('0xf0')],'VoiceQueueId':_0x3045b4['actions'][_0x36642c]['VoiceQueueId']||undefined,'CampaignId':_0x3045b4[_0x0964('0xf4')][_0x36642c][_0x0964('0xe2')]||undefined})[_0x0964('0xa3')](loggerCatch(_0x0964('0x1e9')));delete _0x3045b4[_0x0964('0xf4')][_0x36642c];}}else{return _0x3045b4[_0x0964('0x160')](_0x3841b7,_0x551134);}}else{if(utils[_0x0964('0x64')](undefined,_0x551134[_0x0964('0x1ea')])<_0x3841b7[_0x0964('0x1eb')]*0x3c){if(_0x551134[_0x0964('0x14a')]&&!_0x551134['Agent'][_0x0964('0x1ec')]){_0x3045b4['preview'][_0x0964('0xfe')](_0x551134['id'])[_0x0964('0x18')](function(){_0x3045b4['updateOriginated'](_0x3841b7);});}else{hopperUtils[_0x0964('0x1ed')]({'active':![]},_0x551134['id'],0x1)['finally'](function(){_0x3045b4[_0x0964('0xc6')](_0x3841b7);});}}else{_0x3841b7[_0x0964('0x1ee')]+=0x1;_0x3045b4['updateOriginated'](_0x3841b7);if(_0x3841b7[_0x0964('0x1ef')]){hopperUtils[_0x0964('0xdd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x551134['ContactId'],'ListId':_0x551134[_0x0964('0xf0')],'VoiceQueueId':_0x551134[_0x0964('0xe1')]||undefined,'CampaignId':_0x551134[_0x0964('0xe2')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x0964('0xcd')](createObjHistory(_0x3841b7,_0x551134,utils[_0x0964('0x6e')]['QUEUE_RECALL'],0x17,'RecallInQueue'))[_0x0964('0xa3')](loggerCatch(_0x0964('0x1f0')));}else{_0x3045b4[_0x0964('0x11b')](createObjHistory(_0x3841b7,_0x551134,utils[_0x0964('0x6e')][_0x0964('0x1f1')],0x16,_0x0964('0x1f2')),_0x0964('0x1f3'),_0x0964('0x1f4'));}}}}else{_0x3841b7[_0x0964('0x1f5')]+=0x1;_0x3045b4[_0x0964('0x11b')](createObjHistory(_0x3841b7,_0x551134,utils[_0x0964('0x6e')][_0x0964('0x1f6')],0xd,_0x0964('0x1f7')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x0964('0x1f8');}};};Dialer[_0x0964('0x15')][_0x0964('0x1f9')]=function(_0x3c4697){var _0x4191f8=this;var _0x2cfc83=_0x3c4697[_0x0964('0x1fa')]-_0x3c4697[_0x0964('0x83')];emitCampaignSummary(_0x3c4697);if(_0x2cfc83>0x0&&_0x3c4697[_0x0964('0x1fb')]==0x0){if(_0x2cfc83>this[_0x0964('0x1e')]){_0x2cfc83=this[_0x0964('0x1e')];}_0x3c4697[_0x0964('0x1fb')]=0x1;hopperUtils[_0x0964('0x1fc')](_0x3c4697,_0x2cfc83)[_0x0964('0x40')](function(_0x5c9fc0){_0x3c4697[_0x0964('0x1fb')]=0x0;if(_0x5c9fc0){if(!utils['checkContactEmpty'](_0x5c9fc0)){_0x3c4697[_0x0964('0x6d')]=utils[_0x0964('0x6e')][_0x0964('0x72')];logger[_0x0964('0x4b')](_0x0964('0x1fd')+_0x3c4697[_0x0964('0x65')]);}else{_0x3c4697['originated']+=_0x5c9fc0[_0x0964('0x103')];_0x3c4697[_0x0964('0x6d')]=utils[_0x0964('0x6e')][_0x0964('0x1fe')];for(var _0x12f748=0x0;_0x12f748<_0x5c9fc0[_0x0964('0x103')];_0x12f748+=0x1){_0x3c4697[_0x0964('0x1ff')]+=0x1;if(_[_0x0964('0xfa')](_0x5c9fc0[_0x12f748])||_[_0x0964('0xfa')](_0x5c9fc0[_0x12f748][_0x0964('0x17b')])||_['isNil'](_0x5c9fc0[_0x12f748][_0x0964('0x163')])){_0x4191f8[_0x0964('0x159')](_0x0964('0x200'),_0x3c4697,_0x5c9fc0[_0x12f748]);}else{hopperUtils[_0x0964('0x201')](_['pick'](_0x5c9fc0[_0x12f748],[_0x0964('0xe2'),_0x0964('0x163')]))[_0x0964('0x40')](_0x4191f8['checkContactBlack'](_0x3c4697,_0x5c9fc0[_0x12f748]))[_0x0964('0xa3')](_0x4191f8[_0x0964('0x158')]('[actionOriginateIvr]\x20',_0x3c4697));}}}}})[_0x0964('0xa3')](loggerGetContactDialer(_0x0964('0x202'),_0x3c4697,_0x2cfc83));}};Dialer['prototype'][_0x0964('0xb5')]=function(_0x1c0089,_0x30602d){var _0xc1abff=this;var _0x40aa56=[];if(_0x30602d<0x1||_0x1c0089[_0x0964('0xb3')]==='booked'){_0x30602d=0x1;}var _0x37f113=Math[_0x0964('0x1df')](_0x1c0089['available']*_0x30602d)-_0x1c0089['originated'];if(_0x1c0089[_0x0964('0x203')]>0x0){var _0x548996=_0x1c0089['dialLimitQueue']-_0x1c0089[_0x0964('0x83')]-_0x1c0089[_0x0964('0x13e')]-_0x1c0089[_0x0964('0x13f')];if(_0x37f113>_0x548996){_0x37f113=_0x548996;}}if(_0x37f113>0x0&&_0x1c0089[_0x0964('0x1fb')]==0x0){if(_0x1c0089[_0x0964('0xb3')]==='booked'){_0x37f113=0x1;}if(_0x37f113>this[_0x0964('0x1e')]){_0x37f113=this[_0x0964('0x1e')];}for(var _0x4a027a in this[_0x0964('0x1c')]){if(typeof this[_0x0964('0x1c')][_0x4a027a]!=='undefined'){if(this['agents'][_0x4a027a][_0x0964('0x74')]===_0x0964('0x204')&&this[_0x0964('0x1c')][_0x4a027a][_0x0964('0x8c')]===_0x0964('0x8d')){_0x40aa56[_0x0964('0x9d')](this[_0x0964('0x1c')][_0x4a027a]['id']);}}}_0x1c0089[_0x0964('0x1fb')]=0x1;hopperUtils[_0x0964('0x205')](_0x1c0089,_0x40aa56,_0x37f113)['then'](function(_0x4f724c){_0x1c0089[_0x0964('0x1fb')]=0x0;if(_0x4f724c){if(!utils[_0x0964('0x206')](_0x4f724c)){hopperUtils[_0x0964('0x207')](_0x1c0089)[_0x0964('0x40')](sendMessageReschedule(_0x1c0089))[_0x0964('0xa3')](loggerCatch('[countReScheduled]\x20'));}else{_0x1c0089[_0x0964('0x83')]+=_0x4f724c[_0x0964('0x103')];_0x1c0089[_0x0964('0x6d')]=_0x1c0089['dialMethod']===_0x0964('0x8')?utils['CAMPAIGN_STATUS'][_0x0964('0x140')]:utils[_0x0964('0x6e')][_0x0964('0x1fe')];for(var _0x52048d=0x0;_0x52048d<_0x4f724c['length'];_0x52048d+=0x1){if(_[_0x0964('0xfa')](_0x4f724c[_0x52048d])||_[_0x0964('0xfa')](_0x4f724c[_0x52048d][_0x0964('0x17b')])||_[_0x0964('0xfa')](_0x4f724c[_0x52048d][_0x0964('0x163')])){_0xc1abff[_0x0964('0x159')](_0x0964('0x200'),_0x1c0089,_0x4f724c[_0x52048d]);}else{hopperUtils[_0x0964('0x208')](_['pick'](_0x4f724c[_0x52048d],[_0x0964('0xe1'),_0x0964('0x163')]))[_0x0964('0x40')](_0xc1abff['checkContactBlack'](_0x1c0089,_0x4f724c[_0x52048d]))[_0x0964('0xa3')](_0xc1abff['loggerHandler']('[actionOriginate]\x20',_0x1c0089));}}}}})[_0x0964('0xa3')](loggerGetContactDialer(_0x0964('0x209'),_0x1c0089,_0x37f113));}};Dialer[_0x0964('0x15')][_0x0964('0x67')]=function(_0x5e40fd){if(_0x5e40fd['dialLimitQueue']>0x0){var _0x3a34ab=_0x5e40fd[_0x0964('0x203')]-_0x5e40fd[_0x0964('0x83')]-_0x5e40fd[_0x0964('0x13e')];if(_0x3a34ab>0x0&&_0x5e40fd[_0x0964('0x1fb')]==0x0){this['tryOriginatePredictive'](_0x5e40fd);}else{loggerPredictiveCalls['info'](_0x0964('0x20a'));}}else{this[_0x0964('0x20b')](_0x5e40fd);}};Dialer[_0x0964('0x15')][_0x0964('0x20b')]=function(_0x1dd1aa){var _0x263bc0=this;var _0x25c35b=[];_0x1dd1aa[_0x0964('0x83')]+=0x1;for(var _0x17594d in this[_0x0964('0x1c')]){if(typeof this[_0x0964('0x1c')][_0x17594d]!==_0x0964('0xad')){if(this[_0x0964('0x1c')][_0x17594d][_0x0964('0x74')]===_0x0964('0x204')&&this[_0x0964('0x1c')][_0x17594d][_0x0964('0x8c')]===_0x0964('0x8d')){_0x25c35b[_0x0964('0x9d')](this[_0x0964('0x1c')][_0x17594d]['id']);}}}_0x1dd1aa[_0x0964('0x1fb')]=0x1;return this[_0x0964('0x205')](_0x1dd1aa['id'],_0x25c35b,0x1,_0x1dd1aa['dialOrderByScheduledAt'],_0x1dd1aa)['then'](function(_0x50b09f){_0x1dd1aa[_0x0964('0x1fb')]=0x1;if(_0x50b09f){if(!utils['checkContactEmpty'](_0x50b09f)){utils[_0x0964('0x6b')](_0x1dd1aa,0x1,0x0);return hopperUtils[_0x0964('0x207')](_0x1dd1aa)[_0x0964('0x40')](sendMessageReschedule(_0x1dd1aa))[_0x0964('0xa3')](loggerCatch(_0x0964('0x20c')));}else{_0x1dd1aa[_0x0964('0x6d')]=utils[_0x0964('0x6e')][_0x0964('0x1fe')];if(_['isNil'](_0x50b09f[0x0])||_[_0x0964('0xfa')](_0x50b09f[0x0][_0x0964('0x17b')])||_['isNil'](_0x50b09f[0x0][_0x0964('0x163')])){_0x263bc0[_0x0964('0x159')](_0x0964('0x200'),_0x1dd1aa,_0x50b09f[0x0]);}else{return hopperUtils[_0x0964('0x208')](_[_0x0964('0x79')](_0x50b09f[0x0],[_0x0964('0xe1'),_0x0964('0x163')]))[_0x0964('0x40')](_0x263bc0['checkContactBlack'](_0x1dd1aa,_0x50b09f[0x0]))[_0x0964('0xa3')](_0x263bc0[_0x0964('0x158')](_0x0964('0x20d'),_0x1dd1aa));}}}})[_0x0964('0xa3')](loggerGetContactDialer(_0x0964('0x20e'),_0x1dd1aa,0x1));};Dialer[_0x0964('0x15')][_0x0964('0x20f')]=function(_0x32fd97,_0xb6f8e3,_0x3ee122,_0x4a2b3e,_0x28f181,_0x3ce935){loggerPredictive[_0x0964('0x4b')](_0x0964('0x210'));loggerPredictive[_0x0964('0x4b')](_0x0964('0x211'),_0x32fd97);loggerPredictive[_0x0964('0x4b')](_0x0964('0x212'),_0xb6f8e3);loggerPredictive[_0x0964('0x4b')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3ee122);loggerPredictive[_0x0964('0x4b')](_0x0964('0x213'),_0x4a2b3e);loggerPredictive[_0x0964('0x4b')](_0x0964('0x214'),_0x28f181);loggerPredictive[_0x0964('0x4b')](_0x0964('0x56'));return new Promise(function(_0x53bf91,_0x19f242){if(_0x32fd97<=0x0||isNaN(_0x32fd97)){return _0x19f242(msgResponse(_0x0964('0x215'),'Error','m\x20=\x20'+_0x32fd97));}if(_0x3ee122<=0x0||isNaN(_0x3ee122)){return _0x19f242(msgResponse(_0x0964('0x215'),_0x0964('0x88'),_0x0964('0x216')+_0x3ee122));}if(_0x4a2b3e<=0x0||isNaN(_0x4a2b3e)){return _0x19f242(msgResponse(_0x0964('0x215'),_0x0964('0x88'),'p\x20=\x20'+_0x4a2b3e));}if(_0xb6f8e3<=0x0||isNaN(_0xb6f8e3)){return _0x19f242(msgResponse(_0x0964('0x215'),_0x0964('0x88'),_0x0964('0x217')+_0xb6f8e3));}if(_0x28f181<=0x0||isNaN(_0x28f181)){return _0x19f242(msgResponse('[abandonmentRate]',_0x0964('0x88'),_0x0964('0x218')+_0x28f181));}_0x3ce935=_0x3ce935||0x0;var _0x35c50b=0x1/_0x3ee122;var _0x87cc9f=0x0;var _0x328a11=0x0;var _0x5073de=0x0;var _0x48d0d1=0x0;for(var _0x5e5cad=0x0;_0x5073de<_0x28f181;_0x5e5cad+=0x1){_0x328a11=_0x5e5cad/_0xb6f8e3;_0x87cc9f=(_0x4a2b3e*_0x328a11+_0x3ce935)/_0x35c50b;_0x5073de=utils[_0x0964('0x219')](_0x87cc9f,_0x32fd97);_0x48d0d1=_0x87cc9f/_0x32fd97*(0x1-utils[_0x0964('0x219')](_0x87cc9f,_0x32fd97));}return _0x53bf91({'erlangCalls':_0x5e5cad,'erlangCallToSecond':_0xb6f8e3/_0x5e5cad,'erlangAbandonmentRate':_0x5073de,'erlangBusyFactor':_0x48d0d1});});};Dialer[_0x0964('0x15')]['busyFactor']=function(_0x5b6d8d,_0x5b3490,_0x5f38d1,_0x3ba459,_0x3081e4,_0x59313f){loggerPredictive['info'](_0x0964('0x21a'));loggerPredictive[_0x0964('0x4b')](_0x0964('0x211'),_0x5b6d8d);loggerPredictive[_0x0964('0x4b')](_0x0964('0x212'),_0x5b3490);loggerPredictive[_0x0964('0x4b')](_0x0964('0x21b'),_0x5f38d1);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3ba459);loggerPredictive[_0x0964('0x4b')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3081e4);loggerPredictive[_0x0964('0x4b')](_0x0964('0x56'));return new Promise(function(_0xf9c7f2,_0xe0fca4){if(_0x5b6d8d<=0x0||isNaN(_0x5b6d8d)){return _0xe0fca4(msgResponse(_0x0964('0x21c'),'Error',_0x0964('0x21d')+_0x5b6d8d));}if(_0x5f38d1<=0x0||isNaN(_0x5f38d1)){return _0xe0fca4(msgResponse(_0x0964('0x21c'),'Error','Ts\x20=\x20'+_0x5f38d1));}if(_0x3ba459<=0x0||isNaN(_0x3ba459)){return _0xe0fca4(msgResponse(_0x0964('0x21c'),'Error',_0x0964('0x21e')+_0x3ba459));}if(_0x5b3490<=0x0||isNaN(_0x5b3490)){return _0xe0fca4(msgResponse(_0x0964('0x21c'),_0x0964('0x88'),_0x0964('0x217')+_0x5b3490));}if(_0x3081e4<=0x0||isNaN(_0x3081e4)){return _0xe0fca4(msgResponse(_0x0964('0x21c'),'Error',_0x0964('0x21f')+_0x3081e4));}_0x59313f=_0x59313f||0x0;var _0x4bf3b2=0x1/_0x5f38d1;var _0x25a04d=0x0;var _0x3f07e3=0x0;var _0x5208a5=0x0;var _0x2aabad=0x0;for(var _0x34380e=0x0;_0x2aabad<_0x3081e4;_0x34380e+=0x1){_0x3f07e3=_0x34380e/_0x5b3490;_0x25a04d=(_0x3ba459*_0x3f07e3+_0x59313f)/_0x4bf3b2;_0x5208a5=utils[_0x0964('0x219')](_0x25a04d,_0x5b6d8d);_0x2aabad=_0x25a04d/_0x5b6d8d*(0x1-utils[_0x0964('0x219')](_0x25a04d,_0x5b6d8d));}return _0xf9c7f2({'erlangCalls':_0x34380e,'erlangCallToSecond':_0x5b3490/_0x34380e,'erlangAbandonmentRate':_0x5208a5,'erlangBusyFactor':_0x2aabad});});};module['exports']=Dialer; \ No newline at end of file +var _0x80df=['[actions]','undefined','enqueue','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialAgiAfterHangupAgent','dialQueueTimeout','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Trunk','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerId','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','phone','variables','dialPrefix','trim','dialCutDigit','SIP/%s/%s%s','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','stateGlobal','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','[syncAgentComplete][createHistory][20]','outboundUnknownCallsDay','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','dialPredictiveInterval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','dialPredictiveOptimizationPercentage','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','loggedIn','outboundQueuePauses','[CatchErlangB]','predictiveIntervalPauses','floor','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','getContactDialer','checkContactEmpty','[countReScheduled]\x20','RUNNING','checkIsBlackList','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','dialOrderByScheduledAt','countReScheduled','Contact','[actionOriginatePredictive]\x20','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','p\x20=\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','./utils','./utils/hopper','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/agentComplete','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','startPredictive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncHangup','syncNewExten','syncVarSet','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','inspect','voice:queue:%s','name','voice_queue:save','isEmpty','info','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalTotalCalls','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','merge','getSeconds','startProgressive','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','temp','message','CAMPAIGN_STATUS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','\x20INTERVAL_IS_NULL','Intervals','NULL_INTERVAL','isIVRCampaignActive','\x20NOT\x20Active','format','campaign:save','sendMessageOneNotActive','originated','INACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','push','Action','iftime\x20%s,%s','then','indexOf','true','command','catch','all','some','OVERTIME_GLOBAL_INTERVAL','Global:\x20','Timezone:\x20','syncCampaigns','isIVRCampaign','dialGlobalInterval','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','intervalIftime','OVERTIME_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueId','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','createHistory','moveContactManagedDialer','[syncAgentComplete]','responsetime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','state','dropreason','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','VoiceQueueId','CampaignId','Drop','calleridnum','swapAdditionalPhones','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','ContactId','ListId','[rescheduleContact][Abandoned]','Abandoned','calleridname','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','length','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','getQueue','response','Success','callProgressDetecting','variable','amdstatus','exten','xcally-motion-dialer','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','buildObj','saveInDb','[syncHangupInAMD][createHistory]','value','MACHINE','Machine','amd','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','dialAMDActive','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countnosuchnumberretry','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','Normal\x20Clearing','[syncAgentComplete][createHistory]','cause-txt','Unknow','[syncHangupIvr][createHistory]','queuesSummary','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','pTalking','ACTIVE','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','[syncQueueSummary]','syncQueueSummaryComplete','throttle','filter','dialPreviewRecallmeReminder','resolve','handlePreviewRecallNotifications','map','Agent','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x80df,0xd3));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xf80d('0x0'));var _=require(_0xf80d('0x1'));var uuid=require(_0xf80d('0x2'));var moment=require(_0xf80d('0x3'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0xf80d('0x4'));var hopperUtils=require(_0xf80d('0x5'));var ut=require('../preview/util/util');var config=require(_0xf80d('0x6'));var logger=require(_0xf80d('0x7'))(_0xf80d('0x8'));var loggerBooked=require('../../../config/logger')(_0xf80d('0x9'));var loggerPredictive=require(_0xf80d('0x7'))(_0xf80d('0xa'));var loggerPredictiveCalls=require(_0xf80d('0x7'))(_0xf80d('0xb'));var loggerSyncQueueSummary=require(_0xf80d('0x7'))(_0xf80d('0xc'));var ami=require('../ami');config['redis']=_[_0xf80d('0xd')](config[_0xf80d('0xe')],{'host':_0xf80d('0xf'),'port':0x18eb});var io=require(_0xf80d('0x10'))(new Redis(config['redis']));var cmHopper=require(_0xf80d('0x11'));var voiceQueueRt=require(_0xf80d('0x12'));var RpcSetting=require(_0xf80d('0x13'));var Interval=require(_0xf80d('0x14'));var Action=require(_0xf80d('0x15'));var History=require(_0xf80d('0x16'));var Final=require('./models/final');var AgentComplete=require(_0xf80d('0x17'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require('./models/hangup');var ipAgi=process['env'][_0xf80d('0x18')]||_0xf80d('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xf80d('0x1a')]['enqueue']=function(_0x3794ca){this[_0xf80d('0x1b')]=this[_0xf80d('0x1b')]?this[_0xf80d('0x1b')][_0xf80d('0x1c')](_0x3794ca):_0x3794ca();};function Dialer(_0x2915a9,_0x5dd5a0){this[_0xf80d('0x1d')]=new Sequence();this[_0xf80d('0x1e')]=_0x5dd5a0;this[_0xf80d('0x1f')]=_0x2915a9[_0xf80d('0x1f')];this[_0xf80d('0x20')]=_0x2915a9[_0xf80d('0x20')];this[_0xf80d('0x21')]=_0x2915a9[_0xf80d('0x21')];this[_0xf80d('0x22')]=_0x2915a9[_0xf80d('0x22')];this[_0xf80d('0x23')]=config[_0xf80d('0x23')]||0x2;this[_0xf80d('0x24')]={};this[_0xf80d('0x25')]={};this[_0xf80d('0x26')]={};this['uniqueId']={};this['optionPredictive']={};this[_0xf80d('0x27')]={};this['startProgressive']={};this[_0xf80d('0x28')]={};this[_0xf80d('0x29')]={};this['queueBookedRR']={};this['queuesSummary']={};ami['on'](_0xf80d('0x2a'),this[_0xf80d('0x2b')][_0xf80d('0x2c')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0xf80d('0x2c')](this));ami['on'](_0xf80d('0x2d'),this[_0xf80d('0x2e')]['bind'](this));ami['on'](_0xf80d('0x2f'),this[_0xf80d('0x30')][_0xf80d('0x2c')](this));ami['on'](_0xf80d('0x31'),this[_0xf80d('0xc')]['bind'](this));ami['on'](_0xf80d('0x32'),this['syncQueueSummaryComplete'][_0xf80d('0x2c')](this));ami['on']('hangup',this[_0xf80d('0x33')][_0xf80d('0x2c')](this));ami['on']('newexten',this[_0xf80d('0x34')][_0xf80d('0x2c')](this));ami['on']('varset',this[_0xf80d('0x35')]['bind'](this));ami['on']('queuemember',this[_0xf80d('0x36')][_0xf80d('0x2c')](this));ami['on']('queuestatuscomplete',this[_0xf80d('0x37')]['bind'](this));this[_0xf80d('0x38')]();this[_0xf80d('0x39')]();RpcSetting[_0xf80d('0x3a')]()['then'](function(_0x1cf444){previewRecallmeReminderInterval=_0x1cf444[_0xf80d('0x3b')];});}function isNotNull(_0x1912c8){return _0x1912c8!==null&&!_[_0xf80d('0x3c')](_0x1912c8);}function msgResponse(_0x5b69e8,_0x4b6663,_0x1579d4){return{'action':_0x5b69e8,'response':_0x4b6663,'message':_0x1579d4,'stack':_0x1579d4};}function emit(_0x26b6a3,_0x5f3d2c,_0xec0f43){io['to'](_0x26b6a3)[_0xf80d('0x3d')](_0x5f3d2c,_0xec0f43);}function emitOutboundVoiceQueueSummary(_0x39aa16){if(_0x39aa16[_0xf80d('0x3e')]===_0xf80d('0x3f')){logger[_0xf80d('0x40')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0xf80d('0x41')](_0x39aa16,{'showHidden':![],'depth':null}));emit(util['format'](_0xf80d('0x42'),_0x39aa16[_0xf80d('0x43')]),_0xf80d('0x44'),_0x39aa16);}}function checkGetDataPredictive(_0x4bf7b8){if(isNotNull(_0x4bf7b8)&&!_[_0xf80d('0x45')](_0x4bf7b8)){loggerPredictive[_0xf80d('0x46')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4bf7b8['predictiveIntervalTotalCalls']);loggerPredictive[_0xf80d('0x46')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4bf7b8[_0xf80d('0x47')]);loggerPredictive[_0xf80d('0x46')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4bf7b8[_0xf80d('0x48')]);loggerPredictive[_0xf80d('0x46')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4bf7b8[_0xf80d('0x49')]);loggerPredictive[_0xf80d('0x46')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4bf7b8[_0xf80d('0x4a')]);loggerPredictive['info'](_0xf80d('0x4b'),_0x4bf7b8['predictiveIntervalAvgTalktime']);loggerPredictive[_0xf80d('0x46')](_0xf80d('0x4c'));if(_0x4bf7b8[_0xf80d('0x4d')]>0x0){if(!_[_0xf80d('0x3c')](_0x4bf7b8[_0xf80d('0x4e')])&&_0x4bf7b8[_0xf80d('0x4e')]>0x0){return!![];}loggerPredictive['info'](_0xf80d('0x4f'));if(!_[_0xf80d('0x3c')](_0x4bf7b8[_0xf80d('0x4a')])&&_0x4bf7b8[_0xf80d('0x4a')]>0x0){return!![];}loggerPredictive['info'](_0xf80d('0x50'));}else{loggerPredictive[_0xf80d('0x46')](_0xf80d('0x51'));}}else{loggerPredictive['info'](_0xf80d('0x52'));}return![];}function mergeDataErlangB(_0x4612b8){return function(_0x21f703){loggerPredictive[_0xf80d('0x46')](_0xf80d('0x53'));loggerPredictive[_0xf80d('0x46')](_0xf80d('0x54'),_0x21f703[_0xf80d('0x55')]);loggerPredictive[_0xf80d('0x46')](_0xf80d('0x56'),_0x21f703[_0xf80d('0x57')]);loggerPredictive[_0xf80d('0x46')](_0xf80d('0x58'),_0x21f703[_0xf80d('0x59')]);loggerPredictive[_0xf80d('0x46')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x21f703[_0xf80d('0x5a')]);loggerPredictive[_0xf80d('0x46')](_0xf80d('0x58'),_0x21f703[_0xf80d('0x59')]);loggerPredictive['info'](_0xf80d('0x4c'));_[_0xf80d('0x5b')](_0x4612b8,_0x21f703);};}function ifInterval(_0x462101,_0x449ba4){if(_['isUndefined'](_0x449ba4)){return![];}return utils[_0xf80d('0x5c')](undefined,_0x449ba4)<_0x462101*0x3c;}function clearPredictiveAttributes(_0x27d178){if(_0x27d178[_0xf80d('0x5d')]){_0x27d178['startProgressive']=undefined;loggerPredictive[_0xf80d('0x40')](_0x27d178['name'],'startProgressive\x20value\x20cleared');}if(_0x27d178['startPredictive']){_0x27d178['startPredictive']=undefined;loggerPredictive[_0xf80d('0x40')](_0x27d178[_0xf80d('0x43')],_0xf80d('0x5e'));}if(_0x27d178[_0xf80d('0x5f')]){clearInterval(_0x27d178[_0xf80d('0x5f')]);_0x27d178['handlePredictive']=undefined;loggerPredictive[_0xf80d('0x40')](_0x27d178[_0xf80d('0x43')],_0xf80d('0x60'));}}function loggerCatchPredictive(_0xcf3ae6,_0x3f6ab2){return function(_0x342232){loggerPredictive[_0xf80d('0x61')](_0x3f6ab2['name'],_0xcf3ae6);loggerPredictive[_0xf80d('0x61')](_0x342232['stack']);clearPredictiveAttributes(_0x3f6ab2);};}function loggerCatch(_0x3f289f){return function(_0x48b0a4){logger['error'](_0x3f289f,util[_0xf80d('0x41')](_0x48b0a4,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x13ebcd,_0x300cab,_0x459547){return function(_0x4da566){utils[_0xf80d('0x62')](_0x300cab,_0x459547,0x0);_0x300cab[_0xf80d('0x63')]=0x0;logger[_0xf80d('0x61')](_0x13ebcd,util['inspect'](_0x4da566,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4efca3){return function(_0x343edc){if(isNotNull(_0x343edc)&&isNotNull(_0x343edc[0x0])){if(_0x343edc[0x0]['contactsRescheduled']>0x0){_0x4efca3[_0xf80d('0x64')]=utils[_0xf80d('0x65')]['CONTACTS_RESCHEDULED'];logger[_0xf80d('0x46')](_0xf80d('0x66')+_0x4efca3['name'],_0x343edc[0x0][_0xf80d('0x67')],_0xf80d('0x68'));}else{_0x4efca3[_0xf80d('0x64')]=utils[_0xf80d('0x65')][_0xf80d('0x69')];logger[_0xf80d('0x46')](_0xf80d('0x6a')+_0x4efca3[_0xf80d('0x43')]);}}};}function createObjHistory(_0x31e7d0,_0x358919,_0x5ec17e,_0x41bf51,_0x4a8335){_0x31e7d0[_0xf80d('0x64')]=_0x5ec17e;var _0x5b8dd2=new Action(_0x31e7d0,_0x358919);var _0x1d8100=new History(_0x5b8dd2);_0x1d8100['state']=_0x41bf51;_0x1d8100[_0xf80d('0x6b')]=_0x4a8335;_0x1d8100[_0xf80d('0x6c')]=_0x5b8dd2[_0xf80d('0x6d')];return _0x1d8100;}function unlockQueueStatus(_0x29d2a2,_0x2e2e99){setTimeout(function(){if(_['isUndefined'](_0x29d2a2[_0xf80d('0x6e')])){loggerBooked[_0xf80d('0x61')](_0xf80d('0x6f'),_0x2e2e99);}_0x29d2a2[_0xf80d('0x6e')]=!![];loggerBooked[_0xf80d('0x46')](_0xf80d('0x70'),_0x2e2e99,JSON[_0xf80d('0x71')](_[_0xf80d('0x72')](_0x29d2a2,[_0xf80d('0x43'),_0xf80d('0x6e')])));},0x1f3);}function checkInterval(_0x136bfc){return function(){if(!isNotNull(_0x136bfc[_0xf80d('0x73')])){_0x136bfc['message']=utils[_0xf80d('0x65')]['NULL_INTERVAL'];throw _0x136bfc[_0xf80d('0x43')]+_0xf80d('0x74');}if(!isNotNull(_0x136bfc[_0xf80d('0x73')][_0xf80d('0x75')])){_0x136bfc[_0xf80d('0x64')]=utils[_0xf80d('0x65')][_0xf80d('0x76')];throw _0x136bfc[_0xf80d('0x43')]+_0xf80d('0x74');}if(!isNotNull(_['isEmpty'](_0x136bfc['Interval'][_0xf80d('0x75')]))){_0x136bfc['message']=utils[_0xf80d('0x65')][_0xf80d('0x76')];throw _0x136bfc[_0xf80d('0x43')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x22c660){return function(){if(!utils[_0xf80d('0x77')](_0x22c660)){_0x22c660[_0xf80d('0x64')]=utils[_0xf80d('0x65')]['INACTIVE'];throw _0x22c660[_0xf80d('0x43')]+_0xf80d('0x78');}};}function emitCampaignSummary(_0x8e0541){if(utils['isIVRCampaign'](_0x8e0541)){emit(util[_0xf80d('0x79')]('campaign:ivr:%s',_0x8e0541[_0xf80d('0x43')]),_0xf80d('0x7a'),_0x8e0541);}}function loggerCatchQueueSummary(_0x25c8a6,_0x2785c6){return function(_0x201214){clearPredictiveAttributes(_0x2785c6);emitCampaignSummary(_0x2785c6);loggerSyncQueueSummary[_0xf80d('0x40')](_0x25c8a6,util[_0xf80d('0x41')](_0x201214,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0xf233c4){if(_0xf233c4[_0xf80d('0x7b')]){if(_0xf233c4[_0xf80d('0x7c')]===0x0){_0xf233c4[_0xf80d('0x7b')]=![];_0xf233c4['message']=utils[_0xf80d('0x65')][_0xf80d('0x7d')];loggerSyncQueueSummary[_0xf80d('0x40')](_0xf80d('0x7e'),_0xf233c4['name'],_0xf80d('0x7f'));}else{_0xf233c4[_0xf80d('0x64')]=utils[_0xf80d('0x65')]['DISACTIVED'];loggerSyncQueueSummary[_0xf80d('0x40')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0xf233c4[_0xf80d('0x43')],'is\x20disactive');}emitCampaignSummary(_0xf233c4);}}function myreject(_0x901104){return function(_0x1f2fe5){return _0x901104(msgResponse(_0xf80d('0x80'),_0xf80d('0x81'),JSON[_0xf80d('0x71')](_0x1f2fe5)));};}Dialer['prototype'][_0xf80d('0x82')]=function(_0x3ab341){return!_[_0xf80d('0x3c')](_0x3ab341)&&_0x3ab341&&!_['isUndefined'](_0x3ab341['name'])&&!_['isUndefined'](_0x3ab341[_0xf80d('0x83')])&&_0x3ab341['active']&&(this[_0xf80d('0x22')][util[_0xf80d('0x79')](_0xf80d('0x84'),_0x3ab341[_0xf80d('0x43')])][_0xf80d('0x85')]===_0xf80d('0x86')||this['trunks'][util[_0xf80d('0x79')]('SIP/%s',_0x3ab341[_0xf80d('0x43')])][_0xf80d('0x85')]===_0xf80d('0x87'));};Dialer[_0xf80d('0x1a')][_0xf80d('0x88')]=function(_0x5b4e0c){var _0x34503c=this;return function(){if(!_0x34503c[_0xf80d('0x82')](_0x5b4e0c['Trunk'])){if(!_0x34503c[_0xf80d('0x82')](_0x5b4e0c[_0xf80d('0x89')])){_0x5b4e0c[_0xf80d('0x64')]=utils['CAMPAIGN_STATUS'][_0xf80d('0x8a')];throw _0x5b4e0c[_0xf80d('0x43')]+_0xf80d('0x8b');}}};};Dialer[_0xf80d('0x1a')][_0xf80d('0x8c')]=function(_0x7237a6,_0x5d5cac,_0x45cc6d,_0x9974a9){var _0x5c55d0=this;return function(){var _0x1f9057=!![];return _0x5c55d0[_0xf80d('0x8d')](_0x7237a6,_0x5d5cac,_0x45cc6d,_0x9974a9,_0x1f9057);};};Dialer[_0xf80d('0x1a')][_0xf80d('0x8e')]=function(_0x382762,_0x2c15d0,_0x3c7af3,_0x72150){var _0x494037=this;return function(){var _0x4706cd=![];return _0x494037['ifTimeIvr'](_0x382762[_0xf80d('0x75')],_0x2c15d0,_0x3c7af3,_0x72150,_0x4706cd);};};Dialer[_0xf80d('0x1a')][_0xf80d('0x8d')]=function(_0x42b34b,_0x110129,_0x17d53d,_0xc6c001,_0x32f822){var _0x457a19=[];return new Promise(function(_0x1a3d43,_0x50dacd){if(!isNotNull(_0x42b34b)){_0xc6c001[_0xf80d('0x64')]=utils[_0xf80d('0x65')][_0xf80d('0x76')];return _0x50dacd(msgResponse(_0xf80d('0x8f'),_0xf80d('0x90'),_0x17d53d+_0xf80d('0x91')));}if(_['isEmpty'](_0x42b34b)){_0xc6c001[_0xf80d('0x64')]=utils[_0xf80d('0x65')][_0xf80d('0x92')];return _0x50dacd(msgResponse(_0xf80d('0x8f'),'Failure',_0x17d53d+_0xf80d('0x93')));}if(_0x110129&&_['isUndefined'](config[_0xf80d('0x94')][_0x110129])){_0xc6c001[_0xf80d('0x64')]=utils[_0xf80d('0x65')][_0xf80d('0x95')];return _0x50dacd(msgResponse(_0xf80d('0x8f'),_0xf80d('0x90'),_0x17d53d+_0xf80d('0x96')+_0x110129));}if(_['isArray'](_0x42b34b)){for(var _0x38150c=0x0;_0x38150c<_0x42b34b['length'];_0x38150c+=0x1){_0x457a19[_0xf80d('0x97')](ami[_0xf80d('0x98')]({'action':'command','command':util[_0xf80d('0x79')](_0xf80d('0x99'),_0x42b34b[_0x38150c]['interval'],!_[_0xf80d('0x3c')](config['timezones'][_0x110129])?_0x110129:'')})[_0xf80d('0x9a')](function(_0x38cd61){return _0x38cd61['content'][_0xf80d('0x9b')](_0xf80d('0x9c'))>=0x0;})['catch'](myreject(_0x50dacd)));}}else{_0x457a19[_0xf80d('0x97')](ami[_0xf80d('0x98')]({'action':_0xf80d('0x9d'),'command':util[_0xf80d('0x79')]('iftime\x20%s,%s',_0x42b34b,!_[_0xf80d('0x3c')](config['timezones'][_0x110129])?_0x110129:'')})[_0xf80d('0x9a')](function(_0x4fb1d8){return _0x4fb1d8['content'][_0xf80d('0x9b')](_0xf80d('0x9c'))>=0x0;})[_0xf80d('0x9e')](myreject(_0x50dacd)));}Promise[_0xf80d('0x9f')](_0x457a19)[_0xf80d('0x9a')](function(_0x48b87b){var _0x586973=_[_0xf80d('0xa0')](_0x48b87b);if(_0x586973){return _0x1a3d43(_0x586973);}else{_0xc6c001['message']=_0x32f822?utils[_0xf80d('0x65')][_0xf80d('0xa1')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];return _0x50dacd(msgResponse('[ifTime][promiseAll]',_0xf80d('0x90'),_0xf80d('0xa2')+_0x32f822+'\x20'+_0x17d53d+'\x20Interval\x20is\x20overtime:\x20'+util[_0xf80d('0x41')](_0x42b34b,{'showHidden':![],'depth':null})+_0xf80d('0xa3')+_0x110129));}})['catch'](function(_0x474269){return _0x50dacd(msgResponse('ifTime',_0xf80d('0x90'),JSON[_0xf80d('0x71')](_0x474269)));});});};Dialer['prototype'][_0xf80d('0x38')]=function(){var _0x51579e=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})[_0xf80d('0x9a')](function(){setInterval(function(){_0x51579e[_0xf80d('0xa4')]();},0x3e8);});};Dialer[_0xf80d('0x1a')][_0xf80d('0xa4')]=function(){var _0x2fde89=this;var _0x38e21b;for(var _0x49437a in this[_0xf80d('0x20')]){if(typeof this[_0xf80d('0x20')][_0x49437a]!=='undefined'){_0x38e21b=this['campaigns'][_0x49437a];if(utils[_0xf80d('0xa5')](_0x38e21b)&&utils[_0xf80d('0x77')](_0x38e21b)){_0x38e21b[_0xf80d('0x7b')]=!![];Promise['resolve']()[_0xf80d('0x9a')](checkIsIVRCampaignActive(_0x38e21b))[_0xf80d('0x9a')](checkInterval(_0x38e21b))[_0xf80d('0x9a')](_0x2fde89['checkIsTrunkReachable'](_0x38e21b))[_0xf80d('0x9a')](_0x2fde89[_0xf80d('0x8c')](_0x38e21b[_0xf80d('0xa6')],_0x38e21b[_0xf80d('0xa7')],_0x38e21b[_0xf80d('0x43')],_0x38e21b))[_0xf80d('0x9a')](_0x2fde89['checkIfTimeIntervals'](_0x38e21b[_0xf80d('0x73')],_0x38e21b[_0xf80d('0xa7')],_0x38e21b[_0xf80d('0x43')],_0x38e21b))['then'](_0x2fde89['launchHandleIvr'](_0x38e21b))[_0xf80d('0x9e')](loggerCatchQueueSummary(_0xf80d('0xa8'),_0x38e21b));}else{notSendMessagesCampaign(_0x38e21b);}}}};Dialer[_0xf80d('0x1a')][_0xf80d('0xa9')]=function(_0x267179){if(_0x267179[_0xf80d('0xaa')]!==_0xf80d('0xa')){clearPredictiveAttributes(_0x267179);}switch(_0x267179[_0xf80d('0xaa')]){case _0xf80d('0xab'):this[_0xf80d('0xac')](_0x267179,0x1);break;case _0xf80d('0xad'):this[_0xf80d('0xac')](_0x267179,_0x267179[_0xf80d('0xae')]);break;case _0xf80d('0xa'):this[_0xf80d('0xa')](_0x267179);break;case _0xf80d('0x9'):this[_0xf80d('0xac')](_0x267179,0x1);break;default:logger[_0xf80d('0x61')](_0xf80d('0xaf'),_0x267179[_0xf80d('0x43')],_0xf80d('0xb0'));}};Dialer['prototype'][_0xf80d('0x8f')]=function(_0x22cc52,_0x36e2c6){var _0x4a851e=_0x22cc52[_0xf80d('0xa7')];var _0x2792e6=_0x36e2c6?_0x22cc52[_0xf80d('0xa6')]:_0x22cc52[_0xf80d('0x73')][_0xf80d('0x75')];logger[_0xf80d('0xb1')](_0xf80d('0xb2'),_0x2792e6,_0x4a851e,_0x22cc52['name'],util[_0xf80d('0x79')]('Voice\x20Queue\x20%s\x20$s',_0x22cc52['name'],_0x22cc52['id']));var _0x31abec=null;return Interval[_0xf80d('0xb3')](_0x2792e6,_0x4a851e)[_0xf80d('0x9a')](function(_0x318912){if(_0x318912===!![]){return _0x318912;}else{_0x22cc52[_0xf80d('0x64')]=_0x36e2c6?utils[_0xf80d('0x65')][_0xf80d('0xa1')]:utils[_0xf80d('0x65')][_0xf80d('0xb4')];_0x31abec=msgResponse(_0xf80d('0xb5'),'Failure',_0xf80d('0xa2')+_0x36e2c6+'\x20'+_0x22cc52['name']+_0xf80d('0xb6')+util[_0xf80d('0x41')](_0x2792e6,{'showHidden':![],'depth':null})+_0xf80d('0xa3')+_0x4a851e);}if(_0x31abec!==null){logger[_0xf80d('0xb1')](_0xf80d('0xb7'),_0x31abec);_0x31abec[_0xf80d('0xb8')]=_0x36e2c6;throw _0x31abec;}})[_0xf80d('0x9e')](function(_0x3817f7){logger['error'](_0xf80d('0xb9'),_0x3817f7);throw msgResponse(_0xf80d('0x80'),_0xf80d('0x81'),util[_0xf80d('0x41')](_0x3817f7,{'showHidden':![],'depth':null}));});};Dialer[_0xf80d('0x1a')]['syncAgentConnect']=function(_0x115a3b){if(this[_0xf80d('0x1f')][_0x115a3b[_0xf80d('0xba')]]){if(this[_0xf80d('0xbb')][_0x115a3b[_0xf80d('0xbc')]]&&this[_0xf80d('0xbb')][_0x115a3b[_0xf80d('0xbc')]]['type']!==_0xf80d('0xbd')){this[_0xf80d('0xbe')](this['voiceQueues'][_0x115a3b[_0xf80d('0xba')]]);this[_0xf80d('0xbb')][_0x115a3b['uniqueid']][_0xf80d('0xbf')]=moment()['format'](_0xf80d('0xc0'));}}};Dialer[_0xf80d('0x1a')][_0xf80d('0x30')]=function(_0x253e7e){var _0x4cbfbe=this[_0xf80d('0xbb')][_0x253e7e[_0xf80d('0xbc')]];if(this[_0xf80d('0x1f')][_0x253e7e[_0xf80d('0xba')]]){if(_0x4cbfbe&&_0x4cbfbe[_0xf80d('0x3e')]!==_0xf80d('0xbd')){delete this[_0xf80d('0xbb')][_0x253e7e[_0xf80d('0xbc')]];this['voiceQueues'][_0x253e7e[_0xf80d('0xba')]][_0xf80d('0xc1')]+=0x1;var _0x565d35=new AgentComplete(_0x4cbfbe,_0x253e7e);if(_0x253e7e[_0xf80d('0xc2')]===_0xf80d('0xc3')){_0x565d35[_0xf80d('0xc4')]=this[_0xf80d('0x1f')][_0x253e7e[_0xf80d('0xba')]][_0xf80d('0xc5')]&&this['voiceQueues'][_0x253e7e[_0xf80d('0xba')]]['dialAgiAfterHangupAgent']?moment()[_0xf80d('0x79')](_0xf80d('0xc0')):undefined;}hopperUtils[_0xf80d('0xc6')](_0x565d35)[_0xf80d('0x9e')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0xf80d('0xc7')](_0x565d35)[_0xf80d('0x9e')](loggerCatch(_0xf80d('0xc8')));}}};Dialer[_0xf80d('0x1a')]['syncQueueCallerAbandon']=function(_0x40a7cd){var _0x2d05bf=this[_0xf80d('0xbb')][_0x40a7cd['uniqueid']];var _0x59c675=this;var _0x54e8c9=![];var _0x30c41e;var _0x3a951d;if(this[_0xf80d('0x1f')][_0x40a7cd[_0xf80d('0xba')]]){if(_0x2d05bf&&_0x2d05bf[_0xf80d('0x3e')]!==_0xf80d('0xbd')){delete this[_0xf80d('0xbb')][_0x40a7cd[_0xf80d('0xbc')]];this[_0xf80d('0xbe')](this[_0xf80d('0x1f')][_0x40a7cd[_0xf80d('0xba')]]);_0x2d05bf['droptime']=moment()['format'](_0xf80d('0xc0'));var _0x222737=new QueueCallerAbandon(_0x2d05bf,_0x40a7cd);if(utils[_0xf80d('0x5c')](_0x2d05bf['droptime'],_0x2d05bf[_0xf80d('0xc9')])>=_0x2d05bf['dialQueueTimeout']){this[_0xf80d('0x1f')][_0x40a7cd[_0xf80d('0xba')]][_0xf80d('0x48')]+=0x1;this[_0xf80d('0x1f')][_0x40a7cd['queue']][_0xf80d('0xca')]+=0x1;this['voiceQueues'][_0x40a7cd['queue']][_0xf80d('0xcb')]+=0x1;_0x222737[_0xf80d('0xcc')]=0xa;_0x222737[_0xf80d('0x6b')]='Drop';_0x222737[_0xf80d('0xcd')]=_0xf80d('0xce');_0x222737[_0xf80d('0xc4')]=this[_0xf80d('0x1f')][_0x40a7cd[_0xf80d('0xba')]][_0xf80d('0xc5')]?moment()[_0xf80d('0x79')](_0xf80d('0xc0')):undefined;_0x222737[_0xf80d('0xcf')]+=0x1;_0x222737[_0xf80d('0xd0')]+=0x1;_0x30c41e=this[_0xf80d('0x1f')][_0x40a7cd[_0xf80d('0xba')]][_0xf80d('0xd1')];_0x3a951d=this[_0xf80d('0x1f')][_0x40a7cd['queue']][_0xf80d('0xd2')];hopperUtils[_0xf80d('0xd3')](_0x222737,_0x222737[_0xf80d('0xcc')],_0x2d05bf[_0xf80d('0xd4')])['then'](function(_0x482ed2){_0x54e8c9=_0x482ed2[_0xf80d('0xd5')]==0x1;if(_0x222737[_0xf80d('0xcf')]>=_0x59c675[_0xf80d('0x1f')][_0x40a7cd[_0xf80d('0xba')]][_0xf80d('0xd6')]){_0x59c675[_0xf80d('0xd7')](_0x222737,_0x482ed2[_0xf80d('0xd5')]);}else{hopperUtils[_0xf80d('0xd8')]({'active':![],'countdropretry':_0x222737[_0xf80d('0xcf')],'scheduledat':moment()[_0xf80d('0xd9')](_0x59c675[_0xf80d('0x1f')][_0x40a7cd[_0xf80d('0xba')]]['dialDropRetryFrequency'],_0xf80d('0xda'))[_0xf80d('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2d05bf['ContactId'],'ListId':_0x2d05bf['ListId'],'VoiceQueueId':_0x2d05bf[_0xf80d('0xdb')]||undefined,'CampaignId':_0x2d05bf[_0xf80d('0xdc')]||undefined})[_0xf80d('0x9e')](loggerCatch('[rescheduleContact][Drop]'));var _0x38993c=new History(_0x222737);_0x38993c['state']=0xa;_0x38993c[_0xf80d('0x6b')]=_0xf80d('0xdd');_0x38993c[_0xf80d('0x6d')]=moment()[_0xf80d('0x79')](_0xf80d('0xc0'));_0x38993c[_0xf80d('0x6c')]=_0x38993c['starttime'];_0x38993c['calleridname']=_0x222737['calleridname'];_0x38993c[_0xf80d('0xde')]=_0x222737[_0xf80d('0xde')];hopperUtils[_0xf80d('0xc6')](_0x38993c)[_0xf80d('0x9e')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xf80d('0x9a')](function(){if(_0x54e8c9)hopperUtils[_0xf80d('0xdf')](_0x222737,_0x30c41e,_0x3a951d)[_0xf80d('0x9a')](function(){return 0x1;});});}else{this[_0xf80d('0x1f')][_0x40a7cd[_0xf80d('0xba')]][_0xf80d('0x49')]+=0x1;this[_0xf80d('0x1f')][_0x40a7cd[_0xf80d('0xba')]]['outboundDropCallsDayCallersExit']+=0x1;_0x222737[_0xf80d('0xcc')]=0xb;_0x222737['statedesc']='Abandoned';_0x222737['dropreason']=_0xf80d('0xe0');_0x222737[_0xf80d('0xe1')]+=0x1;_0x222737[_0xf80d('0xd0')]+=0x1;_0x30c41e=this[_0xf80d('0x1f')][_0x40a7cd[_0xf80d('0xba')]][_0xf80d('0xe2')];_0x3a951d=this[_0xf80d('0x1f')][_0x40a7cd['queue']][_0xf80d('0xd2')];hopperUtils[_0xf80d('0xd3')](_0x222737,_0x222737[_0xf80d('0xcc')],_0x2d05bf[_0xf80d('0xd4')])[_0xf80d('0x9a')](function(_0x246eb1){if(_0x222737[_0xf80d('0xe1')]>=_0x59c675['voiceQueues'][_0x40a7cd['queue']]['dialAbandonedMaxRetry']){_0x59c675[_0xf80d('0xd7')](_0x222737,_0x246eb1[_0xf80d('0xd5')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x222737[_0xf80d('0xe1')],'scheduledat':moment()[_0xf80d('0xd9')](_0x59c675[_0xf80d('0x1f')][_0x40a7cd[_0xf80d('0xba')]][_0xf80d('0xe2')],'minutes')[_0xf80d('0x79')](_0xf80d('0xc0')),'ContactId':_0x2d05bf[_0xf80d('0xe3')],'ListId':_0x2d05bf[_0xf80d('0xe4')],'VoiceQueueId':_0x2d05bf[_0xf80d('0xdb')]||undefined,'CampaignId':_0x2d05bf[_0xf80d('0xdc')]||undefined})[_0xf80d('0x9e')](loggerCatch(_0xf80d('0xe5')));var _0x5356fa=new History(_0x222737);_0x5356fa[_0xf80d('0xcc')]=0xb;_0x5356fa[_0xf80d('0x6b')]=_0xf80d('0xe6');_0x5356fa[_0xf80d('0x6d')]=moment()[_0xf80d('0x79')](_0xf80d('0xc0'));_0x5356fa[_0xf80d('0x6c')]=_0x5356fa[_0xf80d('0x6d')];_0x5356fa['calleridname']=_0x222737[_0xf80d('0xe7')];_0x5356fa['calleridnum']=_0x222737[_0xf80d('0xde')];hopperUtils[_0xf80d('0xc6')](_0x5356fa)[_0xf80d('0x9e')](loggerCatch(_0xf80d('0xe8')));}})[_0xf80d('0x9a')](function(){if(_0x54e8c9)hopperUtils['swapAdditionalPhones'](_0x222737,_0x30c41e,_0x3a951d)['then'](function(){return 0x1;});});}}}};Dialer[_0xf80d('0x1a')]['syncNewExten']=function(_0x1df658){if(this[_0xf80d('0x25')][_0x1df658[_0xf80d('0xbc')]]){this['actions'][_0x1df658[_0xf80d('0xbc')]][_0xf80d('0xe9')]=_0x1df658[_0xf80d('0xe9')];}if(this[_0xf80d('0xbb')][_0x1df658[_0xf80d('0xbc')]]){this[_0xf80d('0xbb')][_0x1df658[_0xf80d('0xbc')]][_0xf80d('0xe9')]=_0x1df658[_0xf80d('0xe9')];}};Dialer[_0xf80d('0x1a')][_0xf80d('0x36')]=function(_0x538048){if(!this['actions'][_0x538048[_0xf80d('0xea')]]){return;}var _0x40ddea=this[_0xf80d('0x1f')][this[_0xf80d('0x25')][_0x538048[_0xf80d('0xea')]][_0xf80d('0xba')]][_0xf80d('0xeb')]||_0xf80d('0xec');if(_0x40ddea===_0xf80d('0xed')){if(this[_0xf80d('0x25')][_0x538048[_0xf80d('0xea')]]&&_[_0xf80d('0xee')](this[_0xf80d('0x25')][_0x538048[_0xf80d('0xea')]][_0xf80d('0xef')])&&_0x538048[_0xf80d('0x85')]==='1'&&_0x538048[_0xf80d('0xf0')]==='0'){if(this[_0xf80d('0x21')][_0x538048['stateinterface']]){if(!this[_0xf80d('0x21')][_0x538048[_0xf80d('0xf1')]][_0xf80d('0xef')]){this[_0xf80d('0x21')][_0x538048['stateinterface']][_0xf80d('0xef')]=!![];this[_0xf80d('0x25')][_0x538048[_0xf80d('0xea')]]['locked']=!![];this['actions'][_0x538048[_0xf80d('0xea')]][_0xf80d('0xf1')]=_0x538048[_0xf80d('0xf1')];}}}}else if(_0x40ddea===_0xf80d('0xec')){if(this[_0xf80d('0x25')][_0x538048['actionid']]){if(this[_0xf80d('0x21')][_0x538048[_0xf80d('0xf1')]]){this['actions'][_0x538048['actionid']][_0xf80d('0xf1')]=_0x538048[_0xf80d('0xf1')];if(_[_0xf80d('0xee')](this[_0xf80d('0x29')][this[_0xf80d('0x25')][_0x538048[_0xf80d('0xea')]]['queue']])){this[_0xf80d('0x29')][this['actions'][_0x538048[_0xf80d('0xea')]][_0xf80d('0xba')]]=[];}this[_0xf80d('0x29')][this['actions'][_0x538048[_0xf80d('0xea')]][_0xf80d('0xba')]][_0xf80d('0x97')](_[_0xf80d('0x5b')](_['pick'](this[_0xf80d('0x25')][_0x538048[_0xf80d('0xea')]],[_0xf80d('0xf2'),_0xf80d('0xf1')]),{'status':_0x538048[_0xf80d('0x85')],'paused':_0x538048[_0xf80d('0xf0')]}));}}}};Dialer[_0xf80d('0x1a')][_0xf80d('0x37')]=function(_0x5bd4ef){if(!this[_0xf80d('0x25')][_0x5bd4ef['actionid']]){return;}var _0x7e6a01=this;var _0x284430=this['voiceQueues'][this[_0xf80d('0x25')][_0x5bd4ef[_0xf80d('0xea')]][_0xf80d('0xba')]];var _0x12d045=_0x284430[_0xf80d('0xeb')]||_0xf80d('0xec');if(_0x12d045===_0xf80d('0xed')){if(this[_0xf80d('0x25')][_0x5bd4ef['actionid']]&&this['actions'][_0x5bd4ef[_0xf80d('0xea')]][_0xf80d('0xf1')]){this['preview'][_0xf80d('0xf3')](this['actions'][_0x5bd4ef[_0xf80d('0xea')]]['idHopper'],this[_0xf80d('0x25')][_0x5bd4ef[_0xf80d('0xea')]][_0xf80d('0xf1')])[_0xf80d('0x9e')](function(_0x689f4f){logger['error'](_0xf80d('0xf4'),util[_0xf80d('0x41')](_0x689f4f,{'showHidden':![],'depth':null}));})[_0xf80d('0x1c')](function(){_0x7e6a01[_0xf80d('0xbe')](_0x7e6a01[_0xf80d('0x1f')][_0x7e6a01[_0xf80d('0x25')][_0x5bd4ef['actionid']][_0xf80d('0xba')]]);_0x7e6a01[_0xf80d('0x21')][_0x7e6a01[_0xf80d('0x25')][_0x5bd4ef['actionid']][_0xf80d('0xf1')]][_0xf80d('0xef')]=![];delete _0x7e6a01[_0xf80d('0x25')][_0x5bd4ef[_0xf80d('0xea')]];unlockQueueStatus(_0x284430);});}else{this['updateOriginated'](this[_0xf80d('0x1f')][this[_0xf80d('0x25')][_0x5bd4ef['actionid']][_0xf80d('0xba')]]);hopperUtils[_0xf80d('0xd8')]({'active':![],'ContactId':this[_0xf80d('0x25')][_0x5bd4ef['actionid']]['ContactId'],'ListId':this[_0xf80d('0x25')][_0x5bd4ef['actionid']][_0xf80d('0xe4')],'VoiceQueueId':this[_0xf80d('0x25')][_0x5bd4ef[_0xf80d('0xea')]][_0xf80d('0xdb')]||undefined,'CampaignId':this[_0xf80d('0x25')][_0x5bd4ef[_0xf80d('0xea')]][_0xf80d('0xdc')]||undefined})[_0xf80d('0x9e')](loggerCatch(_0xf80d('0xf5')));delete this[_0xf80d('0x25')][_0x5bd4ef['actionid']];unlockQueueStatus(_0x284430);}}else if(_0x12d045===_0xf80d('0xec')){var _0x157c72;if(this['actions'][_0x5bd4ef[_0xf80d('0xea')]]&&!_[_0xf80d('0x45')](this['queueBooked'][this['actions'][_0x5bd4ef[_0xf80d('0xea')]][_0xf80d('0xba')]])){if(this[_0xf80d('0xf6')][_0x7e6a01[_0xf80d('0x25')][_0x5bd4ef[_0xf80d('0xea')]][_0xf80d('0xba')]]){this['queueBookedRR'][_0x7e6a01[_0xf80d('0x25')][_0x5bd4ef[_0xf80d('0xea')]][_0xf80d('0xba')]]=this[_0xf80d('0xf6')][this[_0xf80d('0x25')][_0x5bd4ef[_0xf80d('0xea')]][_0xf80d('0xba')]]?this[_0xf80d('0xf6')][this[_0xf80d('0x25')][_0x5bd4ef[_0xf80d('0xea')]][_0xf80d('0xba')]]:this['queueBooked'][this[_0xf80d('0x25')][_0x5bd4ef[_0xf80d('0xea')]][_0xf80d('0xba')]]?this[_0xf80d('0x29')][this['actions'][_0x5bd4ef['actionid']]['queue']]['_rr']||0x0:0x0;}this[_0xf80d('0x29')][this[_0xf80d('0x25')][_0x5bd4ef[_0xf80d('0xea')]]['queue']][_0xf80d('0xf7')]=this[_0xf80d('0xf6')][this[_0xf80d('0x25')][_0x5bd4ef[_0xf80d('0xea')]][_0xf80d('0xba')]];for(var _0x2a8cae=0x0;_0x2a8cae=_0x2ebba8[_0xf80d('0x11a')]){_0x1e08ce['stateGlobal'](_0x248f77,_0x5d99b4,_0x34531b,_0xf80d('0x11b'));}else{if(_0x248f77[_0xf80d('0x118')]>=_0x2ebba8[_0xf80d('0x11c')]){_0x1e08ce[_0xf80d('0x11d')](_0x248f77,_0x5d99b4,_0x34531b,_0xf80d('0x11e'));}else{hopperUtils[_0xf80d('0xd8')]({'active':![],'countmachineretry':_0x248f77[_0xf80d('0x118')],'scheduledat':moment()[_0xf80d('0xd9')](_0x2ebba8[_0xf80d('0x11f')],_0xf80d('0xda'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x248f77[_0xf80d('0xe3')],'ListId':_0x248f77[_0xf80d('0xe4')],'VoiceQueueId':_0x248f77[_0xf80d('0xdb')]||undefined,'CampaignId':_0x248f77['CampaignId']||undefined})[_0xf80d('0x9e')](loggerCatch(_0xf80d('0x120')));_0x5d99b4({'reschedule':0x1});}}});}if(_0x419d19['type']===_0xf80d('0xbd')&&this[_0xf80d('0x20')][_0x419d19[_0xf80d('0xba')]][_0xf80d('0x121')]&&_0x188080[_0xf80d('0x10f')]==='HANGUP'){delete this[_0xf80d('0xbb')][_0x188080[_0xf80d('0xbc')]];this['updateOriginated'](this[_0xf80d('0x20')][_0x419d19[_0xf80d('0xba')]]);_0x50428c=new Hangup(_0x419d19,_0x188080);_0x50428c['state']=0x12;_0x50428c[_0xf80d('0x6b')]=_0xf80d('0x109');_0x50428c[_0xf80d('0x10a')]=_0xf80d('0x10b');ami[_0xf80d('0x3d')]('custom:amd',ut[_0xf80d('0x10c')](_0x50428c,_0xf80d('0x112')));this['saveInDb'](_0x50428c,_0xf80d('0x122'),_0xf80d('0x123'));}if(_0x419d19[_0xf80d('0x3e')]===_0xf80d('0xbd')&&this[_0xf80d('0x20')][_0x419d19[_0xf80d('0xba')]][_0xf80d('0x121')]&&_0x188080[_0xf80d('0x10f')]==='MACHINE'){return new Promise(function(_0x31a39a,_0x40aa45){delete _0x1e08ce[_0xf80d('0xbb')][_0x188080[_0xf80d('0xbc')]];_0x1e08ce[_0xf80d('0xbe')](_0x1e08ce['campaigns'][_0x419d19[_0xf80d('0xba')]]);_0x1e08ce['campaigns'][_0x419d19['queue']][_0xf80d('0xc1')]+=0x1;_0x1e08ce[_0xf80d('0x20')][_0x419d19[_0xf80d('0xba')]][_0xf80d('0x108')]+=0x1;var _0x394083=_0x1e08ce['campaigns'][_0x419d19[_0xf80d('0xba')]];var _0x8e09f0=new Hangup(_0x419d19,_0x188080);_0x8e09f0[_0xf80d('0xcc')]=0x13;_0x8e09f0[_0xf80d('0x6b')]=_0xf80d('0x111');_0x8e09f0[_0xf80d('0x10a')]=_0xf80d('0x10b');_0x8e09f0[_0xf80d('0x118')]+=0x1;_0x8e09f0[_0xf80d('0xd0')]+=0x1;_0x8e09f0[_0xf80d('0x112')]=!![];ami['emit'](_0xf80d('0x113'),ut['buildObj'](_0x8e09f0,_0xf80d('0x112')));hopperUtils[_0xf80d('0xc6')](_0x8e09f0)[_0xf80d('0x9e')](loggerCatch(_0xf80d('0x114')));if(_0x8e09f0['countbusyretry']+_0x8e09f0['countcongestionretry']+_0x8e09f0[_0xf80d('0x117')]+_0x8e09f0[_0xf80d('0x124')]+_0x8e09f0[_0xf80d('0xcf')]+_0x8e09f0['countabandonedretry']+_0x8e09f0[_0xf80d('0x118')]+_0x8e09f0[_0xf80d('0x119')]>=_0x394083[_0xf80d('0x11a')]){_0x1e08ce['stateGlobal'](_0x8e09f0,_0x31a39a,_0x40aa45,_0xf80d('0x11b'));}else{if(_0x8e09f0[_0xf80d('0x118')]>=_0x394083[_0xf80d('0x11c')]){_0x1e08ce[_0xf80d('0x11d')](_0x8e09f0,_0x31a39a,_0x40aa45,'reason\x2019\x20machine....');}else{hopperUtils[_0xf80d('0xd8')]({'active':![],'countmachineretry':_0x8e09f0['countmachineretry'],'scheduledat':moment()[_0xf80d('0xd9')](_0x394083[_0xf80d('0x11f')],'minutes')['format'](_0xf80d('0xc0')),'ContactId':_0x8e09f0['ContactId'],'ListId':_0x8e09f0[_0xf80d('0xe4')],'VoiceQueueId':_0x8e09f0['VoiceQueueId']||undefined,'CampaignId':_0x8e09f0[_0xf80d('0xdc')]||undefined})[_0xf80d('0x9e')](loggerCatch(_0xf80d('0x120')));_0x31a39a({'reschedule':0x1});}}});}}};Dialer[_0xf80d('0x1a')][_0xf80d('0x33')]=function(_0x3e5f84){var _0x2ca1ae=this['uniqueId'][_0x3e5f84[_0xf80d('0xbc')]];var _0xaedff6;if(_0x2ca1ae&&_0x2ca1ae[_0xf80d('0x3e')]===_0xf80d('0xbd')){delete this[_0xf80d('0xbb')][_0x3e5f84[_0xf80d('0xbc')]];this[_0xf80d('0xbe')](this[_0xf80d('0x20')][_0x2ca1ae['queue']]);this['campaigns'][_0x2ca1ae[_0xf80d('0xba')]][_0xf80d('0x125')]+=0x1;_0xaedff6=new Hangup(_0x2ca1ae,_0x3e5f84);hopperUtils[_0xf80d('0xc6')](_0xaedff6)[_0xf80d('0x9e')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xf80d('0xc7')](_0xaedff6)[_0xf80d('0x9e')](loggerCatch(_0xf80d('0x126')));}if(_0x2ca1ae&&_0x2ca1ae[_0xf80d('0x3e')]!==_0xf80d('0xbd')&&isNotNull(this['voiceQueues'][_0x2ca1ae['queue']][_0xf80d('0x127')])){delete this[_0xf80d('0xbb')][_0x3e5f84[_0xf80d('0xbc')]];this[_0xf80d('0xbe')](this[_0xf80d('0x1f')][_0x2ca1ae[_0xf80d('0xba')]]);this[_0xf80d('0x1f')][_0x2ca1ae[_0xf80d('0xba')]][_0xf80d('0xc1')]+=0x1;this[_0xf80d('0x1f')][_0x2ca1ae[_0xf80d('0xba')]][_0xf80d('0x108')]+=0x1;_0xaedff6=new Hangup(_0x2ca1ae,_0x3e5f84);_0xaedff6[_0xf80d('0xcc')]=0x10;_0xaedff6[_0xf80d('0x6b')]=_0xf80d('0x128');_0xaedff6[_0xf80d('0x10a')]='AGI';hopperUtils[_0xf80d('0xc6')](_0xaedff6)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0xaedff6)['catch'](loggerCatch(_0xf80d('0x126')));}if(_0x2ca1ae&&_0x2ca1ae['type']!==_0xf80d('0xbd')&&!isNotNull(this[_0xf80d('0x1f')][_0x2ca1ae[_0xf80d('0xba')]][_0xf80d('0x127')])){if(_0x3e5f84['cause-txt']===_0xf80d('0x129')){delete this[_0xf80d('0xbb')][_0x3e5f84[_0xf80d('0xbc')]];this[_0xf80d('0x1f')][_0x2ca1ae[_0xf80d('0xba')]][_0xf80d('0xc1')]+=0x1;const _0x344c5b=new AgentComplete(_0x2ca1ae,_0x3e5f84);_0x344c5b['CampaignId']=this[_0xf80d('0x1f')][_0x2ca1ae[_0xf80d('0xba')]]['id'];hopperUtils[_0xf80d('0xc6')](_0x344c5b)['catch'](loggerCatch(_0xf80d('0x12a')));hopperUtils[_0xf80d('0xc7')](_0x344c5b)[_0xf80d('0x9e')](loggerCatch(_0xf80d('0xc8')));}else{delete this['uniqueId'][_0x3e5f84['uniqueid']];this[_0xf80d('0xbe')](this[_0xf80d('0x1f')][_0x2ca1ae['queue']]);this[_0xf80d('0x1f')][_0x2ca1ae[_0xf80d('0xba')]]['outboundUnknownCallsDay']+=0x1;_0xaedff6=new Hangup(_0x2ca1ae,_0x3e5f84);_0xaedff6[_0xf80d('0xcc')]=0xc;_0xaedff6[_0xf80d('0x6b')]=_0x3e5f84[_0xf80d('0x12b')];_0xaedff6[_0xf80d('0x10a')]=_0xf80d('0x12c');hopperUtils[_0xf80d('0xc6')](_0xaedff6)[_0xf80d('0x9e')](loggerCatch(_0xf80d('0x12d')));hopperUtils[_0xf80d('0xc7')](_0xaedff6)[_0xf80d('0x9e')](loggerCatch(_0xf80d('0x126')));}}};Dialer[_0xf80d('0x1a')][_0xf80d('0xc')]=function(_0x184b30){var _0x568391=this;if(!_0x568391[_0xf80d('0x12e')][_0x184b30[_0xf80d('0x43')]]){_0x568391[_0xf80d('0x12e')][_0x184b30['name']]={'running':![]};}else if(_0x568391['queuesSummary'][_0x184b30[_0xf80d('0x43')]][_0xf80d('0x12f')]===!![]){return;}else if(_0x568391[_0xf80d('0x12e')][_0x184b30[_0xf80d('0x43')]][_0xf80d('0x12f')]===![]){_0x568391[_0xf80d('0x12e')][_0x184b30['name']]['running']=!![];}var _0x3cbc58=_0x568391['voiceQueues'][_0x184b30[_0xf80d('0x43')]];var _0x2665fb=_0x3cbc58[_0xf80d('0x64')]!==utils[_0xf80d('0x65')]['INACTIVE'];var _0x5e5cf0=utils[_0xf80d('0x130')](_0x3cbc58);_0x3cbc58[_0xf80d('0x131')]=utils[_0xf80d('0x132')](_0x3cbc58,_0x568391[_0xf80d('0x22')]);Promise['resolve']()[_0xf80d('0x9a')](function(){if(_0x3cbc58[_0xf80d('0x131')]===utils['CAMPAIGN_STATUS'][_0xf80d('0x7d')]){if(_0x2665fb){clearPredictiveAttributes(_0x3cbc58);_0x184b30['startPredictive']=undefined;_0x184b30[_0xf80d('0x5d')]=undefined;}if(_0x3cbc58[_0xf80d('0x131')]===utils[_0xf80d('0x65')]['INACTIVE']){_0x184b30[_0xf80d('0x133')]=0x0;_0x184b30['paused']=0x0;_0x184b30[_0xf80d('0x134')]=0x0;_0x184b30[_0xf80d('0x135')]=0x0;_0x184b30[_0xf80d('0x136')]=0x0;}}else if(_0x3cbc58[_0xf80d('0x131')]===utils[_0xf80d('0x65')][_0xf80d('0x137')]&&!_0x5e5cf0){return _0x568391[_0xf80d('0x8f')](_0x3cbc58,!![])['then'](function(){return _0x568391['ifTime'](_0x3cbc58,![]);})['then'](function(){return _0x568391['checkDialMethod'](_0x3cbc58);})[_0xf80d('0x9e')](function(_0xa15a0f){loggerSyncQueueSummary['debug']('[syncQueueSummary]',util[_0xf80d('0x41')](_0xa15a0f,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3cbc58);});}else{clearPredictiveAttributes(_0x3cbc58);}})[_0xf80d('0x9a')](function(){var _0x1ad22d=_0x184b30[_0xf80d('0x138')](_0x3cbc58);if(_0x1ad22d||_0x3cbc58['queueSummaryCountersUpdated']){_0x3cbc58[_0xf80d('0x139')]=![];_0x184b30[_0xf80d('0x13a')](_0x3cbc58);Object[_0xf80d('0x13b')](_0x3cbc58,_0x184b30);emitOutboundVoiceQueueSummary(_0x184b30);}_0x568391[_0xf80d('0x12e')][_0x3cbc58[_0xf80d('0x43')]][_0xf80d('0x12f')]=![];})['catch'](function(_0x182805){logger[_0xf80d('0x61')](_0xf80d('0x13c'),util[_0xf80d('0x41')](_0x182805,{'showHidden':![],'depth':null}));_0x568391['queuesSummary'][_0x3cbc58['name']][_0xf80d('0x12f')]=![];});};Dialer[_0xf80d('0x1a')][_0xf80d('0x13d')]=_[_0xf80d('0x13e')](function(){var _0x441dc0=_[_0xf80d('0x13f')](this[_0xf80d('0x1f')],function(_0x152892){return _0x152892[_0xf80d('0x140')];});var _0xdab575=_[_0xf80d('0x13f')](this[_0xf80d('0x21')],function(_0x3581c7){return _0x3581c7['online']&&_0x3581c7[_0xf80d('0x85')]===_0xf80d('0x86');});if(_0x441dc0[_0xf80d('0xf8')]>0x0&&_0xdab575[_0xf80d('0xf8')]>0x0){return Promise[_0xf80d('0x141')]()['then'](cmHopper[_0xf80d('0x142')](_[_0xf80d('0x143')](_0x441dc0,'id'),previewRecallmeReminderInterval,_[_0xf80d('0x143')](_0xdab575,'id')))['then'](function(_0x3c03ff){for(var _0xdb0ea=0x0;_0xdb0ea<_0x3c03ff[_0xf80d('0xf8')];_0xdb0ea++){var _0x14c23a=_0x3c03ff[_0xdb0ea][_0xf80d('0x144')][_0xf80d('0x43')];if(_0x14c23a)io['to'](util[_0xf80d('0x79')]('user:%s',_0x14c23a))[_0xf80d('0x3d')]('user:dialPreviewRecallReminder',{'hopper':_0x3c03ff[_0xdb0ea]});}})[_0xf80d('0x9e')](function(_0x43f62e){logger['error'](_0xf80d('0x145'),_0x43f62e);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xf80d('0x39')]=function(){var _0x56625c=this;setInterval(function(){_0x56625c[_0xf80d('0x146')](_0x56625c[_0xf80d('0xbb')],_0xf80d('0x147'));_0x56625c['clearZombieChannels'](_0x56625c[_0xf80d('0x25')],_0xf80d('0x148'));},0x32c8);};Dialer['prototype'][_0xf80d('0x146')]=function(_0xefacb2,_0x32ef65){var _0x2b91c6=this;for(var _0x336d23 in _0xefacb2){if(typeof _0xefacb2[_0x336d23]!==_0xf80d('0x149')){this[_0xf80d('0x1d')][_0xf80d('0x14a')](function(){if(!_[_0xf80d('0xee')](_0xefacb2[_0x336d23])){return ami[_0xf80d('0x98')]({'action':'status','channel':_0xefacb2[_0x336d23][_0xf80d('0xe9')]})[_0xf80d('0x9e')](function(_0x5088b6){if(_0x5088b6[_0xf80d('0x64')]===_0xf80d('0x14b')){setTimeout(function(){if(_0xefacb2[_0x336d23]&&_0xefacb2[_0x336d23][_0xf80d('0x3e')]!=='ivr'){_0x2b91c6[_0xf80d('0xbe')](_0x2b91c6[_0xf80d('0x1f')][_0xefacb2[_0x336d23][_0xf80d('0xba')]]);logger[_0xf80d('0x61')](_0xf80d('0x14c'),_0x32ef65,_0x336d23,_0xefacb2[_0x336d23][_0xf80d('0xba')]);delete _0xefacb2[_0x336d23];}if(_0xefacb2[_0x336d23]&&_0xefacb2[_0x336d23]['type']===_0xf80d('0xbd')){_0x2b91c6['updateOriginated'](_0x2b91c6['campaigns'][_0xefacb2[_0x336d23][_0xf80d('0xba')]]);logger['error'](_0xf80d('0x14d'),_0x32ef65,_0x336d23,_0xefacb2[_0x336d23][_0xf80d('0xba')]);delete _0xefacb2[_0x336d23];}},0x2328);}});}});}}};Dialer['prototype'][_0xf80d('0x14e')]=function(_0x42ef0f){return Promise[_0xf80d('0x141')]()[_0xf80d('0x9a')](voiceQueueRt[_0xf80d('0x14e')](_0x42ef0f))['catch'](loggerCatch(_0xf80d('0x14f')));};Dialer[_0xf80d('0x1a')][_0xf80d('0xbe')]=function(_0x1bc2e7){if(!_[_0xf80d('0x3c')](_0x1bc2e7)&&_0x1bc2e7!==null){if(typeof _0x1bc2e7[_0xf80d('0x7c')]!==_0xf80d('0x149')){if(_0x1bc2e7[_0xf80d('0x7c')]>0x0){_0x1bc2e7[_0xf80d('0x7c')]-=0x1;}else{logger[_0xf80d('0x61')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xf80d('0x61')](_0xf80d('0x150'));}};Dialer[_0xf80d('0x1a')][_0xf80d('0x151')]=function(_0xcf84c8,_0x15354f){var _0x261396=this;return function(_0x5b40ec){_0x261396[_0xf80d('0xbe')](_0x15354f);logger[_0xf80d('0x61')](_0xcf84c8,util[_0xf80d('0x41')](_0x5b40ec,{'showHidden':![],'depth':null}));};};Dialer[_0xf80d('0x1a')]['emptyContact']=function(_0x3813b4,_0x5c40a1,_0x74a9bc){var _0x1ce709={'state':0x19,'statedesc':_0xf80d('0x152')};this[_0xf80d('0xbe')](_0x5c40a1);this[_0xf80d('0x10d')](_['merge'](_0x1ce709,_['pick'](_0x74a9bc,['ContactId',_0xf80d('0xe4'),_0xf80d('0x153'),'VoiceQueueId',_0xf80d('0xdc')])),_0xf80d('0x154'),_0xf80d('0x155'));logger[_0xf80d('0x61')](_0x3813b4);};Dialer[_0xf80d('0x1a')][_0xf80d('0x10d')]=function(_0x10a21f,_0x23210f,_0x30a09e){hopperUtils['createHistory'](_0x10a21f)[_0xf80d('0x9e')](loggerCatch(_0x23210f));hopperUtils[_0xf80d('0xc7')](_0x10a21f)[_0xf80d('0x9e')](loggerCatch(_0x30a09e));};Dialer[_0xf80d('0x1a')][_0xf80d('0xd7')]=function(_0x390c32,_0x75b6f4){hopperUtils['createHistory'](_0x390c32)['catch'](loggerCatch(_0xf80d('0x12a')));if(_0x75b6f4==0x0){hopperUtils[_0xf80d('0xc7')](_0x390c32)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xf80d('0x1a')]['checkPreviewRecallReminder']=function(_0x4df0cb){return Promise[_0xf80d('0x141')]()[_0xf80d('0x9a')](cmHopper[_0xf80d('0x142')](_0x4df0cb['id'],previewRecallmeReminderInterval))[_0xf80d('0x9a')](function(_0x440932){for(var _0x61bc0c=0x0;_0x61bc0c<_0x440932['length'];_0x61bc0c++){var _0x45b2a0=_0x440932[_0x61bc0c][_0xf80d('0x144')][_0xf80d('0x43')];if(_0x45b2a0)io['to'](util['format'](_0xf80d('0x156'),_0x45b2a0))[_0xf80d('0x3d')](_0xf80d('0x157'),{'hopper':_0x440932[_0x61bc0c]});}})['catch'](function(){});};Dialer['prototype'][_0xf80d('0x158')]=function(_0x1d70a4){var _0x22c2e6=this;return function(){_0x22c2e6[_0xf80d('0x159')](_0x1d70a4);};};Dialer[_0xf80d('0x1a')][_0xf80d('0x15a')]=function(_0x3cfaa5,_0x23daae){var _0x51c65b=this;var _0x481bbe=uuid['v4']();this[_0xf80d('0x25')][_0x481bbe]=new Action(_0x3cfaa5,_0x23daae,_0x481bbe);return new Promise(function(_0x236c9b,_0x43e2f4){if(_[_0xf80d('0x3c')](_0x3cfaa5)&&typeof _0x3cfaa5!==_0xf80d('0x15b')){return _0x43e2f4(msgResponse(_0xf80d('0x15c'),_0xf80d('0x90'),_0xf80d('0x15d')));}if(_[_0xf80d('0x3c')](_0x23daae['phone'])||_0x23daae['phone']===null){return _0x43e2f4(msgResponse(_0xf80d('0x15c'),_0xf80d('0x90'),_0xf80d('0x15e')));}var _0x1c3622={'XMD-CALLERID':_0x51c65b[_0xf80d('0x25')][_0x481bbe][_0xf80d('0x15f')](),'XMD-AGI':_0x3cfaa5[_0xf80d('0x127')]?util[_0xf80d('0x79')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3cfaa5[_0xf80d('0x127')]):'NONE','XMD-AGIAFTER':_0x3cfaa5[_0xf80d('0xc5')]?util[_0xf80d('0x79')](_0xf80d('0x160'),ipAgi,_0x3cfaa5['dialQueueProject2']):_0xf80d('0x161'),'XMD-QUEUE':utils[_0xf80d('0x162')](_0x3cfaa5)?util[_0xf80d('0x79')](_0xf80d('0x163'),_0x3cfaa5['name'],_0x3cfaa5['dialQueueOptions']||'',_0x3cfaa5[_0xf80d('0x164')]?'c':'',_0x3cfaa5[_0xf80d('0x165')]||0x3):_0xf80d('0x161'),'XMD-CONTACTID':_0x23daae[_0xf80d('0xe3')],'XMD-CDRTYPE':_0xf80d('0x8'),'CALLERID(all)':_0x51c65b[_0xf80d('0x25')][_0x481bbe][_0xf80d('0x15f')](),'XMD-AMD':_0x3cfaa5['dialAMDActive']?_0xf80d('0x137'):_0xf80d('0x161'),'XMD-DESTINATION':_0xf80d('0x107')};if(_0x3cfaa5[_0xf80d('0x121')]){_0x1c3622[_0xf80d('0x166')]=_0x3cfaa5[_0xf80d('0x167')]||0x9c4;_0x1c3622[_0xf80d('0x168')]=_0x3cfaa5[_0xf80d('0x169')]||0x5dc;_0x1c3622[_0xf80d('0x16a')]=_0x3cfaa5[_0xf80d('0x16b')]||0x320;_0x1c3622[_0xf80d('0x16c')]=_0x3cfaa5['dialAMDTotalAnalysisTime']||0x1388;_0x1c3622['XMD-AMDMINWORDLENGTH']=_0x3cfaa5[_0xf80d('0x16d')]||0x64;_0x1c3622['XMD-AMDBETWEENWORDSSILENCE']=_0x3cfaa5['dialAMDBetweenWordsSilence']||0x32;_0x1c3622[_0xf80d('0x16e')]=_0x3cfaa5['dialAMDMaximumNumberOfWords']||0x3;_0x1c3622[_0xf80d('0x16f')]=_0x3cfaa5[_0xf80d('0x170')]||0x100;_0x1c3622[_0xf80d('0x171')]=_0x3cfaa5[_0xf80d('0x172')]||0x1388;}if(utils[_0xf80d('0x162')](_0x3cfaa5)){_0x1c3622[_0xf80d('0x173')]=_0x23daae[_0xf80d('0xdb')];}else{_0x1c3622[_0xf80d('0x174')]=_0x23daae[_0xf80d('0xdc')];}var _0x412403=utils[_0xf80d('0x175')](_0x23daae['Contact']);Object['assign'](_0x1c3622,_0x412403);var _0x45deb3=_0x51c65b[_0xf80d('0x82')](_0x3cfaa5[_0xf80d('0x176')])?utils['getCallerId'](_0x3cfaa5[_0xf80d('0x176')][_0xf80d('0x177')],_0x3cfaa5[_0xf80d('0x178')],_0x3cfaa5['dialRandomLastDigitCallerIdNumber']>0x0?utils['getCallerIdRandom'](_0x3cfaa5['dialOriginateCallerIdNumber'],_0x3cfaa5[_0xf80d('0x179')]):_0x3cfaa5[_0xf80d('0x17a')]):utils[_0xf80d('0x17b')](_[_0xf80d('0xee')](_0x3cfaa5[_0xf80d('0x89')])?_0x3cfaa5['Trunk'][_0xf80d('0x177')]:_0x3cfaa5[_0xf80d('0x89')][_0xf80d('0x177')],_0x3cfaa5[_0xf80d('0x178')],_0x3cfaa5[_0xf80d('0x179')]>0x0?utils[_0xf80d('0x17c')](_0x3cfaa5[_0xf80d('0x17a')],_0x3cfaa5[_0xf80d('0x179')]):_0x3cfaa5['dialOriginateCallerIdNumber']);if(_0x45deb3){_0x1c3622[_0xf80d('0x17d')]=_0x51c65b['actions'][_0x481bbe][_0xf80d('0x17e')]=utils[_0xf80d('0x17f')](_0x45deb3);_0x1c3622['XMD-ORIGINATECALLERIDNUM']=_0x23daae[_0xf80d('0x180')];}_0x3cfaa5[_0xf80d('0x181')]=_0x1c3622;return ami[_0xf80d('0x98')]({'actionid':_0x481bbe,'action':_0xf80d('0x15c'),'channel':_0x51c65b[_0xf80d('0x82')](_0x3cfaa5[_0xf80d('0x176')])?util['format']('SIP/%s/%s%s',_0x3cfaa5[_0xf80d('0x176')][_0xf80d('0x43')],isNotNull(_0x3cfaa5[_0xf80d('0x182')])?_0x3cfaa5['dialPrefix'][_0xf80d('0x183')]()||'':'',_0x3cfaa5[_0xf80d('0x184')]>0x0?_0x23daae[_0xf80d('0x180')]['substring'](_0x3cfaa5['dialCutDigit']):_0x23daae['phone']):util[_0xf80d('0x79')](_0xf80d('0x185'),_[_0xf80d('0xee')](_0x3cfaa5['TrunkBackup'])?_0x3cfaa5[_0xf80d('0x176')][_0xf80d('0x43')]:_0x3cfaa5[_0xf80d('0x89')][_0xf80d('0x43')],isNotNull(_0x3cfaa5[_0xf80d('0x182')])?_0x3cfaa5[_0xf80d('0x182')][_0xf80d('0x183')]()||'':'',_0x3cfaa5['dialCutDigit']>0x0?_0x23daae['phone'][_0xf80d('0x186')](_0x3cfaa5[_0xf80d('0x184')]):_0x23daae[_0xf80d('0x180')]),'callerid':_0x45deb3,'Exten':_0xf80d('0x107'),'Context':_0xf80d('0x187'),'Priority':'1','variable':_0x1c3622,'timeout':(_0x3cfaa5['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x481bbe})[_0xf80d('0x9a')](function(_0x44743f){return _0x236c9b(_0x44743f);})['catch'](function(_0x47f33e){_0x3cfaa5[_0xf80d('0x188')]+=0x1;var _0x3bbde4=new History(_0x51c65b[_0xf80d('0x25')][_0x481bbe]);logger[_0xf80d('0x61')](util[_0xf80d('0x79')](_0xf80d('0x189'),JSON[_0xf80d('0x71')](_0x47f33e)));_0x3bbde4[_0xf80d('0xcc')]=0xe;_0x3bbde4[_0xf80d('0x6b')]=_0xf80d('0x18a');_0x3bbde4[_0xf80d('0x6d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3bbde4[_0xf80d('0x6c')]=_0x3bbde4['starttime'];hopperUtils['createHistory'](_0x3bbde4)[_0xf80d('0x9e')](loggerCatch(_0xf80d('0x18b')));_0x51c65b[_0xf80d('0xc7')](_0x3bbde4)[_0xf80d('0x9e')](loggerCatch(_0xf80d('0x18b')))[_0xf80d('0x1c')](function(){delete _0x51c65b['actions'][_0x481bbe];return _0x43e2f4(msgResponse('originate',_0xf80d('0x81'),'originate\x20action\x20Error'));});});});};Dialer[_0xf80d('0x1a')]['checkRetriveMax']=function(_0x121212,_0x3f36bf,_0x2bb06a){var _0x4a66e8=new History(_0x3f36bf);if(_0x4a66e8[_0xf80d('0x115')]+_0x4a66e8[_0xf80d('0x116')]+_0x4a66e8[_0xf80d('0x117')]+_0x4a66e8[_0xf80d('0x124')]+_0x4a66e8[_0xf80d('0xcf')]+_0x4a66e8['countabandonedretry']+_0x4a66e8[_0xf80d('0x118')]+_0x4a66e8[_0xf80d('0x119')]>=_0x2bb06a[_0xf80d('0x11a')]-0x1){return!![];}switch(_0x121212){case 0x3:if(_0x4a66e8['countnoanswerretry']>=_0x2bb06a[_0xf80d('0x18c')]-0x1){return!![];}hopperUtils[_0xf80d('0xd8')]({'active':![],'countnoanswerretry':_0x4a66e8['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xf80d('0xd9')](_0x2bb06a[_0xf80d('0x18d')],'minutes')[_0xf80d('0x79')](_0xf80d('0xc0')),'ContactId':_0x4a66e8[_0xf80d('0xe3')],'ListId':_0x4a66e8['ListId'],'VoiceQueueId':_0x4a66e8[_0xf80d('0xdb')]||undefined,'CampaignId':_0x4a66e8[_0xf80d('0xdc')]||undefined})['catch'](loggerCatch(_0xf80d('0x18e')));break;case 0x5:if(_0x4a66e8[_0xf80d('0x115')]>=_0x2bb06a['dialBusyMaxRetry']-0x1){return!![];}hopperUtils[_0xf80d('0xd8')]({'active':![],'countbusyretry':_0x4a66e8[_0xf80d('0x115')]+=0x1,'scheduledat':moment()['add'](_0x2bb06a['dialBusyRetryFrequency'],_0xf80d('0xda'))[_0xf80d('0x79')](_0xf80d('0xc0')),'ContactId':_0x4a66e8['ContactId'],'ListId':_0x4a66e8[_0xf80d('0xe4')],'VoiceQueueId':_0x4a66e8[_0xf80d('0xdb')]||undefined,'CampaignId':_0x4a66e8[_0xf80d('0xdc')]||undefined})[_0xf80d('0x9e')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x4a66e8[_0xf80d('0x116')]>=_0x2bb06a[_0xf80d('0x18f')]-0x1){return!![];}hopperUtils[_0xf80d('0xd8')]({'active':![],'countcongestionretry':_0x4a66e8['countcongestionretry']+=0x1,'scheduledat':moment()[_0xf80d('0xd9')](_0x2bb06a[_0xf80d('0x190')],_0xf80d('0xda'))[_0xf80d('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4a66e8[_0xf80d('0xe3')],'ListId':_0x4a66e8['ListId'],'VoiceQueueId':_0x4a66e8[_0xf80d('0xdb')]||undefined,'CampaignId':_0x4a66e8[_0xf80d('0xdc')]||undefined})[_0xf80d('0x9e')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x4a66e8[_0xf80d('0x124')]>=_0x2bb06a[_0xf80d('0x191')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x4a66e8[_0xf80d('0x124')]+=0x1,'scheduledat':moment()[_0xf80d('0xd9')](_0x2bb06a[_0xf80d('0x192')],_0xf80d('0xda'))[_0xf80d('0x79')](_0xf80d('0xc0')),'ContactId':_0x4a66e8[_0xf80d('0xe3')],'ListId':_0x4a66e8[_0xf80d('0xe4')],'VoiceQueueId':_0x4a66e8[_0xf80d('0xdb')]||undefined,'CampaignId':_0x4a66e8[_0xf80d('0xdc')]||undefined})['catch'](loggerCatch(_0xf80d('0x193')));}break;case 0xa:if(_0x4a66e8[_0xf80d('0xcf')]>=_0x2bb06a[_0xf80d('0xd6')]-0x1){return!![];}hopperUtils[_0xf80d('0xd8')]({'active':![],'countdropretry':_0x4a66e8['countdropretry']+=0x1,'scheduledat':moment()[_0xf80d('0xd9')](_0x2bb06a[_0xf80d('0xd1')],_0xf80d('0xda'))['format'](_0xf80d('0xc0')),'ContactId':_0x4a66e8[_0xf80d('0xe3')],'ListId':_0x4a66e8[_0xf80d('0xe4')],'VoiceQueueId':_0x4a66e8[_0xf80d('0xdb')]||undefined,'CampaignId':_0x4a66e8[_0xf80d('0xdc')]||undefined})[_0xf80d('0x9e')](loggerCatch(_0xf80d('0x194')));break;case 0xb:if(_0x4a66e8[_0xf80d('0xe1')]>=_0x2bb06a[_0xf80d('0x195')]-0x1){return!![];}hopperUtils[_0xf80d('0xd8')]({'active':![],'countabandonedretry':_0x4a66e8['countabandonedretry']+=0x1,'scheduledat':moment()[_0xf80d('0xd9')](_0x2bb06a['dialAbandonedRetryFrequency'],_0xf80d('0xda'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4a66e8['ContactId'],'ListId':_0x4a66e8[_0xf80d('0xe4')],'VoiceQueueId':_0x4a66e8[_0xf80d('0xdb')]||undefined,'CampaignId':_0x4a66e8[_0xf80d('0xdc')]||undefined})['catch'](loggerCatch(_0xf80d('0xe5')));break;case 0x13:if(_0x4a66e8[_0xf80d('0x118')]>=_0x2bb06a[_0xf80d('0x11c')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x4a66e8[_0xf80d('0x118')]+=0x1,'scheduledat':moment()[_0xf80d('0xd9')](_0x2bb06a[_0xf80d('0x11f')],_0xf80d('0xda'))[_0xf80d('0x79')](_0xf80d('0xc0')),'ContactId':_0x4a66e8['ContactId'],'ListId':_0x4a66e8['ListId'],'VoiceQueueId':_0x4a66e8['VoiceQueueId']||undefined,'CampaignId':_0x4a66e8[_0xf80d('0xdc')]||undefined})['catch'](loggerCatch(_0xf80d('0x120')));break;case 0x14:if(_0x4a66e8[_0xf80d('0x119')]>=_0x2bb06a[_0xf80d('0x196')]-0x1){return!![];}hopperUtils[_0xf80d('0xd8')]({'active':![],'countagentrejectretry':_0x4a66e8[_0xf80d('0x119')]+=0x1,'scheduledat':moment()['add'](_0x2bb06a[_0xf80d('0x197')],_0xf80d('0xda'))[_0xf80d('0x79')](_0xf80d('0xc0')),'ContactId':_0x4a66e8[_0xf80d('0xe3')],'ListId':_0x4a66e8[_0xf80d('0xe4')],'VoiceQueueId':_0x4a66e8[_0xf80d('0xdb')]||undefined,'CampaignId':_0x4a66e8[_0xf80d('0xdc')]||undefined})[_0xf80d('0x9e')](loggerCatch(_0xf80d('0x198')));break;default:return!![];}};Dialer[_0xf80d('0x1a')][_0xf80d('0x103')]=function(_0x5ea647,_0x4ef885,_0x146b4f){var _0x3fe059=this;var _0x18c127=new History(_0x5ea647);var _0x2fe0ba=![];var _0x596c03;var _0x13082c;return new Promise(function(_0x3c3671,_0x44eaec){if(_['isUndefined'](_0x4ef885)&&typeof _0x4ef885!==_0xf80d('0x15b')){return _0x44eaec(msgResponse(_0xf80d('0x199'),'Failure',_0xf80d('0x19a')));}if(_[_0xf80d('0x3c')](_0x146b4f)&&typeof _0x146b4f!==_0xf80d('0x15b')){return _0x44eaec(msgResponse(_0xf80d('0x199'),_0xf80d('0x90'),'evt\x20is\x20undefine'));}hopperUtils[_0xf80d('0xd3')](_0x18c127,_0x146b4f['reason'],_0x4ef885)[_0xf80d('0x9a')](function(_0x218d84){if(_0x218d84['additional']==0x1)_0x2fe0ba=!![];switch(_0x146b4f[_0xf80d('0xc2')]){case'0':_0x4ef885[_0xf80d('0x19b')]+=0x1;_0x18c127['state']=0x0;_0x18c127['statedesc']=_0xf80d('0x19c');_0x18c127[_0xf80d('0x124')]+=0x1;_0x18c127['countglobal']+=0x1;ami[_0xf80d('0x3d')](_0xf80d('0x19d'),ut[_0xf80d('0x10c')](_0x5ea647,'nosuchnumber'));_0x596c03=_0x4ef885['dialNoSuchNumberRetryFrequency'];_0x13082c=_0x4ef885['callAdditionalPhoneAfterMin'];hopperUtils[_0xf80d('0xc6')](_0x18c127)[_0xf80d('0x9e')](loggerCatch(_0xf80d('0x114')));if(_0x3fe059[_0xf80d('0x19e')](0x0,_0x5ea647,_0x4ef885)&&!_0x2fe0ba){if(_0x18c127[_0xf80d('0x124')]>=_0x4ef885['dialNoSuchNumberMaxRetry']){_0x3fe059['createStateFinal'](_0x18c127,_0x3c3671,_0x44eaec,_0xf80d('0x19f'));}else{_0x3fe059[_0xf80d('0x1a0')](_0x18c127,_0x3c3671,_0x44eaec,_0xf80d('0x19f'));}}break;case'3':_0x4ef885[_0xf80d('0x1a1')]+=0x1;_0x18c127[_0xf80d('0xcc')]=0x3;_0x18c127[_0xf80d('0x6b')]=_0xf80d('0x1a2');_0x18c127[_0xf80d('0x117')]+=0x1;_0x18c127[_0xf80d('0xd0')]+=0x1;var _0x2d3746=ut[_0xf80d('0x1a3')](_0x5ea647,_0x4ef885);ami[_0xf80d('0x3d')](_0xf80d('0x1a4'),_0x2d3746);_0x596c03=_0x4ef885[_0xf80d('0x18d')];_0x13082c=_0x4ef885['callAdditionalPhoneAfterMin'];hopperUtils[_0xf80d('0xc6')](_0x18c127)['catch'](loggerCatch(_0xf80d('0x1a5')));if(_0x3fe059[_0xf80d('0x19e')](0x3,_0x5ea647,_0x4ef885)&&!_0x2fe0ba){if(_0x18c127[_0xf80d('0x117')]>=_0x4ef885['dialNoAnswerMaxRetry']){_0x3fe059[_0xf80d('0x11d')](_0x18c127,_0x3c3671,_0x44eaec,_0xf80d('0x1a6'));}else{_0x3fe059['stateGlobal'](_0x18c127,_0x3c3671,_0x44eaec,_0xf80d('0x1a6'));}}break;case'5':_0x4ef885[_0xf80d('0x1a7')]+=0x1;_0x18c127[_0xf80d('0xcc')]=0x5;_0x18c127[_0xf80d('0x6b')]=_0xf80d('0x1a8');_0x18c127[_0xf80d('0x115')]+=0x1;_0x18c127[_0xf80d('0xd0')]+=0x1;ami['emit']('custom:agentbusy',ut[_0xf80d('0x10c')](_0x5ea647,'busy'));_0x596c03=_0x4ef885[_0xf80d('0x1a9')];_0x13082c=_0x4ef885[_0xf80d('0xd2')];hopperUtils['createHistory'](_0x18c127)[_0xf80d('0x9e')](loggerCatch(_0xf80d('0x1aa')));if(_0x3fe059[_0xf80d('0x19e')](0x5,_0x5ea647,_0x4ef885)&&!_0x2fe0ba){if(_0x18c127[_0xf80d('0x115')]>=_0x4ef885[_0xf80d('0x1ab')]){_0x3fe059['createStateFinal'](_0x18c127,_0x3c3671,_0x44eaec,_0xf80d('0x1ac'));}else{_0x3fe059['stateGlobal'](_0x18c127,_0x3c3671,_0x44eaec,_0xf80d('0x1ac'));}}break;case'8':_0x4ef885[_0xf80d('0x1ad')]+=0x1;_0x18c127[_0xf80d('0xcc')]=0x8;_0x18c127[_0xf80d('0x6b')]=_0xf80d('0x1ae');_0x18c127[_0xf80d('0x116')]+=0x1;_0x18c127[_0xf80d('0xd0')]+=0x1;_0x596c03=_0x4ef885[_0xf80d('0x190')];_0x13082c=_0x4ef885[_0xf80d('0xd2')];ami[_0xf80d('0x3d')](_0xf80d('0x1af'),ut[_0xf80d('0x10c')](_0x5ea647,'congestion'));hopperUtils[_0xf80d('0xc6')](_0x18c127)[_0xf80d('0x9e')](loggerCatch(_0xf80d('0x1b0')));if(_0x3fe059[_0xf80d('0x19e')](0x8,_0x5ea647,_0x4ef885)&&!_0x2fe0ba){if(_0x18c127['countcongestionretry']>=_0x4ef885[_0xf80d('0x18f')]){_0x3fe059[_0xf80d('0x11d')](_0x18c127,_0x3c3671,_0x44eaec,_0xf80d('0x1b1'));}else{_0x3fe059[_0xf80d('0x1a0')](_0x18c127,_0x3c3671,_0x44eaec,_0xf80d('0x1b1'));}}break;case'11':_0x4ef885['outboundAbandonedCallsDay']+=0x1;_0x18c127['state']=0xb;_0x18c127[_0xf80d('0x6b')]='Abandoned';_0x18c127[_0xf80d('0xe1')]+=0x1;_0x18c127[_0xf80d('0xd0')]+=0x1;_0x596c03=_0x4ef885[_0xf80d('0xe2')];_0x13082c=_0x4ef885[_0xf80d('0xd2')];hopperUtils[_0xf80d('0xc6')](_0x18c127)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x3fe059[_0xf80d('0x19e')](0xb,_0x5ea647,_0x4ef885)&&!_0x2fe0ba){if(_0x18c127[_0xf80d('0xe1')]>=_0x4ef885[_0xf80d('0x195')]){_0x3fe059[_0xf80d('0x11d')](_0x18c127,_0x3c3671,_0x44eaec,_0xf80d('0x1b2'));}else{_0x3fe059[_0xf80d('0x1a0')](_0x18c127,_0x3c3671,_0x44eaec,'reason\x2011\x20abandoned');}}break;case'20':_0x4ef885[_0xf80d('0x1b3')]+=0x1;_0x18c127[_0xf80d('0xcc')]=0x14;_0x18c127[_0xf80d('0x6b')]='AgentReject';_0x18c127[_0xf80d('0x119')]+=0x1;_0x18c127['countglobal']+=0x1;_0x596c03=_0x4ef885[_0xf80d('0x197')];_0x13082c=_0x4ef885['callAdditionalPhoneAfterMin'];ami[_0xf80d('0x3d')]('custom:agentreject',ut[_0xf80d('0x10c')](_0x5ea647,'agentreject'));hopperUtils[_0xf80d('0xc6')](_0x18c127)['catch'](loggerCatch(_0xf80d('0x1b4')));if(_0x3fe059[_0xf80d('0x19e')](0x14,_0x5ea647,_0x4ef885)&&!_0x2fe0ba){if(_0x18c127['countagentrejectretry']>=_0x4ef885[_0xf80d('0x196')]){_0x3fe059[_0xf80d('0x11d')](_0x18c127,_0x3c3671,_0x44eaec,'reason\x2020\x20agentreject');}else{_0x3fe059[_0xf80d('0x1a0')](_0x18c127,_0x3c3671,_0x44eaec,'reason\x2020\x20agentreject');}}break;default:_0x4ef885[_0xf80d('0x1b5')]+=0x1;_0x18c127['state']=0xc;_0x18c127[_0xf80d('0x6b')]=_0x146b4f['reason'];_0x596c03=_0x4ef885[_0xf80d('0x197')];_0x13082c=_0x4ef885[_0xf80d('0xd2')];hopperUtils[_0xf80d('0xc6')](_0x18c127)[_0xf80d('0x9e')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x3fe059[_0xf80d('0x19e')](_0x146b4f[_0xf80d('0xc2')],_0x5ea647,_0x4ef885)&&!_0x2fe0ba){if(_0x18c127[_0xf80d('0x115')]+_0x18c127[_0xf80d('0x116')]+_0x18c127['countnoanswerretry']+_0x18c127[_0xf80d('0x124')]+_0x18c127[_0xf80d('0xcf')]+_0x18c127[_0xf80d('0xe1')]+_0x18c127[_0xf80d('0x118')]+_0x18c127['countagentrejectretry']>=_0x4ef885['dialGlobalMaxRetry']){_0x3fe059['stateGlobal'](_0x18c127,_0x3c3671,_0x44eaec,_0x146b4f['reason']);}else{_0x3fe059[_0xf80d('0x11d')](_0x18c127,_0x3c3671,_0x44eaec,_0x146b4f[_0xf80d('0xc2')]);}}}})['then'](function(){if(_0x2fe0ba){hopperUtils[_0xf80d('0xdf')](_0x18c127,_0x596c03,_0x13082c)[_0xf80d('0x9a')](function(){return _0x3c3671(0x1);});}});});};Dialer[_0xf80d('0x1a')][_0xf80d('0x1a0')]=function(_0x4db004,_0x2e9638,_0x4a47ab,_0x5b2537){var _0x481008=new Final(_0x4db004);_0x481008[_0xf80d('0xcc')]=0xf;_0x481008[_0xf80d('0x6b')]=_0xf80d('0x1b6');this[_0xf80d('0x11d')](_0x481008,_0x2e9638,_0x4a47ab,_0x5b2537);};Dialer['prototype'][_0xf80d('0x11d')]=function(_0x3f08d,_0x117699,_0x3b9b4a,_0x4857b8){hopperUtils['moveContactManagedDialer'](_0x3f08d)[_0xf80d('0x9a')](function(){return _0x117699(msgResponse('[callProgressDetecting]','Success',_0x4857b8));})['catch'](function(){return _0x3b9b4a(msgResponse(_0xf80d('0x1b7'),_0xf80d('0x90'),_0xf80d('0x1b8')));});};Dialer[_0xf80d('0x1a')][_0xf80d('0xa')]=function(_0x20fe76){var _0x563e2c=_0x20fe76['dialPredictiveOptimizationPercentage']/0x64;var _0x1f32b8=_0x20fe76[_0xf80d('0xca')]/(_0x20fe76[_0xf80d('0xca')]+_0x20fe76[_0xf80d('0xc1')]);var _0xff9045=Math[_0xf80d('0x1b9')](_0x20fe76[_0xf80d('0x1ba')]*(_0x20fe76[_0xf80d('0x1bb')]/0x64));var _0x1a09a9=Math[_0xf80d('0x1b9')](_0x20fe76[_0xf80d('0x1ba')]*(_0x20fe76['predictiveIntervalMinThreshold']/0x64));var _0x59ce24=_0x20fe76['available']+_0x20fe76[_0xf80d('0x135')];var _0x398954=Math['floor'](_0x20fe76['erlangCalls']*_0x20fe76[_0xf80d('0x59')]*_0x20fe76[_0xf80d('0x1bc')]*_0x20fe76[_0xf80d('0x1bd')]);if(_[_0xf80d('0x3c')](_0x20fe76[_0xf80d('0x5d')])){if(!_[_0xf80d('0x3c')](_0x20fe76[_0xf80d('0x27')])){_0x20fe76[_0xf80d('0x27')]=undefined;loggerPredictive['error'](_0xf80d('0x1be'),_0xf80d('0x1bf'));}if(!_[_0xf80d('0x3c')](_0x20fe76[_0xf80d('0x5f')])){loggerPredictive[_0xf80d('0x61')](_0xf80d('0x1be'),_0xf80d('0x1c0'));clearInterval(_0x20fe76[_0xf80d('0x5f')]);_0x20fe76[_0xf80d('0x5f')]=undefined;}_0x20fe76[_0xf80d('0x5d')]=moment()['format'](_0xf80d('0xc0'));loggerPredictive[_0xf80d('0x46')](_0x20fe76[_0xf80d('0x43')],_0xf80d('0x1c1'),_0x20fe76[_0xf80d('0x5d')]);this['handlePower'](_0x20fe76,0x1);}else if(ifInterval(_0x20fe76['dialPredictiveInterval'],_0x20fe76[_0xf80d('0x5d')])){this['handlePower'](_0x20fe76,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x20fe76[_0xf80d('0x5d')],_0x20fe76[_0xf80d('0x43')]);_0x20fe76[_0xf80d('0x55')]=0x0;_0x20fe76[_0xf80d('0xcb')]=0x0;}else if(_0x563e2c<_0x1f32b8&&_0x20fe76['dialPredictiveOptimization']===_0xf80d('0x1c2')){clearPredictiveAttributes(_0x20fe76);loggerPredictive['info'](_0xf80d('0x1c3'),_0xf80d('0x1c4'),_0x1f32b8,_0xf80d('0x5d'),_0x20fe76['name']);}else if(_0x398954<_0x20fe76[_0xf80d('0xcb')]&&_0x20fe76[_0xf80d('0x1c5')]===_0xf80d('0x1c2')){clearPredictiveAttributes(_0x20fe76);loggerPredictive['info'](_0xf80d('0x1c6'),'Max\x20Drop\x20',_0x398954,_0xf80d('0x1c7'),_0x20fe76[_0xf80d('0xcb')],_0xf80d('0x5d'),_0x20fe76[_0xf80d('0x43')]);}else if(!ifInterval(_0x20fe76['dialPredictiveInterval'],_0x20fe76[_0xf80d('0x5d')])&&_[_0xf80d('0x3c')](_0x20fe76['startPredictive'])&&!_['isUndefined'](_0x20fe76[_0xf80d('0x5d')])){_0x20fe76[_0xf80d('0x27')]=moment()[_0xf80d('0x79')](_0xf80d('0xc0'));loggerPredictive[_0xf80d('0x46')](_0x20fe76[_0xf80d('0x43')],'started\x20in\x20predictive\x20at',_0x20fe76[_0xf80d('0x27')]);hopperUtils['avgHandleTime'](_0x20fe76[_0xf80d('0x1c8')])[_0xf80d('0x9a')](this[_0xf80d('0x1c9')](_0x20fe76))[_0xf80d('0x9a')](mergeDataErlangB(_0x20fe76))[_0xf80d('0x9a')](this[_0xf80d('0x1ca')](_0x20fe76))[_0xf80d('0x9e')](loggerCatchPredictive(_0xf80d('0x1cb'),_0x20fe76));}else if(!ifInterval(_0x20fe76[_0xf80d('0x1c8')],_0x20fe76[_0xf80d('0x27')])){_0x20fe76[_0xf80d('0xcb')]=0x0;_0x20fe76[_0xf80d('0x27')]=moment()[_0xf80d('0x79')](_0xf80d('0xc0'));loggerPredictive[_0xf80d('0x46')](_0x20fe76[_0xf80d('0x43')],_0xf80d('0x1cc'),_0x20fe76[_0xf80d('0x27')]);clearInterval(_0x20fe76[_0xf80d('0x5f')]);_0x20fe76['handlePredictive']=undefined;hopperUtils['avgHandleTime'](_0x20fe76[_0xf80d('0x1c8')])[_0xf80d('0x9a')](this[_0xf80d('0x1c9')](_0x20fe76))['then'](mergeDataErlangB(_0x20fe76))[_0xf80d('0x9a')](this[_0xf80d('0x1ca')](_0x20fe76))['catch'](loggerCatchPredictive(_0xf80d('0x1cd'),_0x20fe76));}else if(_0x20fe76[_0xf80d('0x1ba')]&&_0x59ce24<_0x20fe76[_0xf80d('0x1ba')]-_0x1a09a9){clearPredictiveAttributes(_0x20fe76);loggerPredictive[_0xf80d('0x46')](_0x20fe76[_0xf80d('0x43')],_0xf80d('0x1ce'),_0x59ce24,_0xf80d('0x1cf'),_0x20fe76['predictiveIntervalAvailable'],'-',_0x1a09a9,'=',_0x20fe76['predictiveIntervalAvailable']-_0x1a09a9,')');}else if(_0x20fe76[_0xf80d('0x1ba')]&&_0x59ce24>_0x20fe76[_0xf80d('0x1ba')]+_0xff9045){clearPredictiveAttributes(_0x20fe76);loggerPredictive[_0xf80d('0x46')](_0x20fe76[_0xf80d('0x43')],_0xf80d('0x1ce'),_0x59ce24,_0xf80d('0x1d0'),_0x20fe76['predictiveIntervalAvailable'],'+',_0xff9045,'=',_0x20fe76[_0xf80d('0x1ba')]+_0xff9045,')');}};Dialer[_0xf80d('0x1a')][_0xf80d('0x1c9')]=function(_0xe407a6){var _0x304729=this;return function(_0x65d16b){return new Promise(function(_0x2284d8,_0x133181){_[_0xf80d('0x5b')](_0xe407a6,_0x65d16b[0x0]);if(checkGetDataPredictive(_0x65d16b[0x0])){var _0x1b3c52=_0xe407a6[_0xf80d('0x1ba')]=_0xe407a6['talking']+_0xe407a6[_0xf80d('0x133')];var _0x1f3745=_0xe407a6[_0xf80d('0x1c8')]*0x3c;var _0x1bb45d=_0x65d16b[0x0][_0xf80d('0x4e')]+_0x65d16b[0x0]['predictiveIntervalAvgHoldtime'];var _0x83e08f=(_0x65d16b[0x0][_0xf80d('0x47')]+_0x65d16b[0x0][_0xf80d('0x48')]+_0x65d16b[0x0][_0xf80d('0x49')])/_0x65d16b[0x0][_0xf80d('0x4d')];_0xe407a6[_0xf80d('0x1bc')]=_0x83e08f>0x0?_0x83e08f:0x1;switch(_0xe407a6[_0xf80d('0x1c5')]){case _0xf80d('0x1c2'):var _0x132b2a=_0xe407a6['dialPredictiveOptimizationPercentage']/0x64;return _0x304729[_0xf80d('0x1d1')](_0x1b3c52,_0x1f3745,_0x1bb45d,_0x83e08f,_0x132b2a)['then'](function(_0x5e9c83){return _0x2284d8(_0x5e9c83);});case _0xf80d('0x1d2'):var _0x189fc0=_0xe407a6[_0xf80d('0x1d3')]/0x64;return _0x304729[_0xf80d('0x1d4')](_0x1b3c52,_0x1f3745,_0x1bb45d,_0x83e08f,_0x189fc0)[_0xf80d('0x9a')](function(_0x10ae40){return _0x2284d8(_0x10ae40);});default:return _0x133181(msgResponse(_0xf80d('0x1d5'),_0xf80d('0x90'),_0xf80d('0x1d6')));}}else{return _0x133181(msgResponse('[getDataPredictive]','Failure',_0xf80d('0x1d7')));}});};};Dialer[_0xf80d('0x1a')]['getDataPredictiveOld']=function(_0x5b93a2){var _0x3bec2d=this;return function(_0xdbbffd){return new Promise(function(_0x5b7895,_0x283766){_['merge'](_0x5b93a2,_0xdbbffd[0x0]);if(checkGetDataPredictive(_0xdbbffd[0x0])){loggerPredictive[_0xf80d('0x46')](JSON['stringify'](_0xdbbffd[0x0]));if(_0x5b93a2[_0xf80d('0x1c5')]===_0xf80d('0x1c2')){return _0x3bec2d[_0xf80d('0x14e')](_0x5b93a2['id'])[_0xf80d('0x9a')](function(_0x164c50){var _0x549906=_0x5b93a2[_0xf80d('0x1d8')]-_0x164c50[0x0][_0xf80d('0x1d9')];var _0x44661c=_0x5b93a2[_0xf80d('0x1c8')]*0x3c;var _0x50af04=_0xdbbffd[0x0]['predictiveIntervalAvgTalktime']+_0xdbbffd[0x0][_0xf80d('0x4a')];var _0x14b64c=(_0xdbbffd[0x0][_0xf80d('0x47')]+_0xdbbffd[0x0][_0xf80d('0x48')]+_0xdbbffd[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xdbbffd[0x0][_0xf80d('0x4d')];var _0x28ebf2=_0x5b93a2[_0xf80d('0x1d3')]/0x64;_0x5b93a2['predictiveIntervalPauses']=_0x164c50[0x0]['outboundQueuePauses']||0x0;_0x5b93a2[_0xf80d('0x1bc')]=_0x14b64c>0x0?_0x14b64c:0x1;return _0x3bec2d[_0xf80d('0x1d1')](_0x549906,_0x44661c,_0x50af04,_0x14b64c,_0x28ebf2);})[_0xf80d('0x9a')](function(_0x1c7bc8){return _0x5b7895(_0x1c7bc8);})[_0xf80d('0x9e')](function(_0x3941d7){return _0x283766(msgResponse(_0xf80d('0x1da'),_0xf80d('0x90'),JSON[_0xf80d('0x71')](_0x3941d7)));});}if(_0x5b93a2[_0xf80d('0x1c5')]===_0xf80d('0x1d2')){return _0x3bec2d[_0xf80d('0x14e')](_0x5b93a2['id'])[_0xf80d('0x9a')](function(_0x189bcf){var _0x322556=_0x5b93a2[_0xf80d('0x1d8')]-_0x189bcf[0x0][_0xf80d('0x1d9')];var _0xf2d107=_0x5b93a2[_0xf80d('0x1c8')]*0x3c;var _0x5ae683=_0xdbbffd[0x0][_0xf80d('0x4e')]+_0xdbbffd[0x0]['predictiveIntervalAvgHoldtime'];var _0x18a2d7=(_0xdbbffd[0x0]['predictiveIntervalAnsweredCalls']+_0xdbbffd[0x0][_0xf80d('0x48')]+_0xdbbffd[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xdbbffd[0x0][_0xf80d('0x4d')];var _0x280af6=_0x5b93a2[_0xf80d('0x1d3')]/0x64;_0x5b93a2[_0xf80d('0x1db')]=_0x189bcf[0x0]['outboundQueuePauses']||0x0;_0x5b93a2[_0xf80d('0x1bc')]=_0x18a2d7>0x0?_0x18a2d7:0x1;return _0x3bec2d[_0xf80d('0x1d4')](_0x322556,_0xf2d107,_0x5ae683,_0x18a2d7,_0x280af6);})[_0xf80d('0x9a')](function(_0x1ae43d){return _0x5b7895(_0x1ae43d);})[_0xf80d('0x9e')](function(_0xe6c79){return _0x283766(msgResponse(_0xf80d('0x1da'),'Failure',JSON['stringify'](_0xe6c79)));});}}else{return _0x283766(msgResponse('[getDataPredictive]','Failure',_0xf80d('0x1d7')));}});};};Dialer[_0xf80d('0x1a')][_0xf80d('0x1ca')]=function(_0xf60e9f){var _0x3f19c6=this;return function(){var _0x106b48=0x0;var _0x117401=Math[_0xf80d('0x1dc')](_0xf60e9f['erlangCallToSecond']*0x3e8);if(_0x117401>0x0){_0x117401=_0x117401<0x64?0x64:_0x117401;loggerPredictive['info'](_0xf60e9f[_0xf80d('0x43')],_0xf80d('0x1dd'),_0x117401,_0xf80d('0x1de'));_0xf60e9f[_0xf80d('0x5f')]=setInterval(function(){_0x3f19c6[_0xf80d('0x5f')](_0xf60e9f);loggerPredictiveCalls[_0xf80d('0x46')](_0xf80d('0x1df'),_0x106b48+=0x1);},_0x117401);}else{loggerPredictive[_0xf80d('0x46')](_0xf60e9f['name'],_0xf80d('0x1e0'));}};};Dialer['prototype'][_0xf80d('0x1e1')]=function(_0x4826ce,_0x386384){var _0xcc13a9=this;return function(_0x1c1342){if(_[_0xf80d('0x45')](_0x1c1342)){if(_['isNil'](_0x386384[_0xf80d('0x153')])||!_0x386384[_0xf80d('0x1e2')]){if(_0x4826ce['dialMethod']==='booked'){_0x4826ce[_0xf80d('0x6e')]=_['isUndefined'](_0x4826ce[_0xf80d('0x6e')])?!![]:_0x4826ce[_0xf80d('0x6e')];var _0x2fff60=uuid['v4']();_0xcc13a9[_0xf80d('0x25')][_0x2fff60]=new Action(_0x4826ce,_0x386384,_0x2fff60);loggerBooked[_0xf80d('0x46')]('[booked][checkContactBlack]',_0x2fff60,_0xf80d('0x1e3'),JSON[_0xf80d('0x71')](_0x4826ce[_0xf80d('0x6e')]),_0xf80d('0x1e4'),_0x4826ce[_0xf80d('0x43')]);if(_0x4826ce[_0xf80d('0x6e')]){_0x4826ce[_0xf80d('0x6e')]=![];_0xcc13a9['queueBooked'][_0xcc13a9[_0xf80d('0x25')][_0x2fff60]['queue']]=[];ami[_0xf80d('0x98')]({'actionid':_0x2fff60,'action':_0xf80d('0x1e5'),'queue':_0x4826ce[_0xf80d('0x43')]})[_0xf80d('0x9e')](function(){_0xcc13a9[_0xf80d('0xbe')](_0x4826ce);hopperUtils[_0xf80d('0xd8')]({'active':![],'ContactId':_0xcc13a9[_0xf80d('0x25')][_0x2fff60]['ContactId'],'ListId':_0xcc13a9[_0xf80d('0x25')][_0x2fff60][_0xf80d('0xe4')],'VoiceQueueId':_0xcc13a9['actions'][_0x2fff60][_0xf80d('0xdb')]||undefined,'CampaignId':_0xcc13a9[_0xf80d('0x25')][_0x2fff60]['CampaignId']||undefined})[_0xf80d('0x9e')](loggerCatch(_0xf80d('0x1e6')));delete _0xcc13a9[_0xf80d('0x25')][_0x2fff60];});}else{loggerBooked[_0xf80d('0x46')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x4826ce['queueStatusComplete']),_0xf80d('0x1e4'),_0x4826ce['name']);_0xcc13a9['updateOriginated'](_0x4826ce);hopperUtils[_0xf80d('0xd8')]({'active':![],'ContactId':_0xcc13a9[_0xf80d('0x25')][_0x2fff60][_0xf80d('0xe3')],'ListId':_0xcc13a9[_0xf80d('0x25')][_0x2fff60]['ListId'],'VoiceQueueId':_0xcc13a9['actions'][_0x2fff60][_0xf80d('0xdb')]||undefined,'CampaignId':_0xcc13a9[_0xf80d('0x25')][_0x2fff60][_0xf80d('0xdc')]||undefined})['catch'](loggerCatch(_0xf80d('0x1e6')));delete _0xcc13a9[_0xf80d('0x25')][_0x2fff60];}}else{return _0xcc13a9[_0xf80d('0x15a')](_0x4826ce,_0x386384);}}else{if(utils[_0xf80d('0x5c')](undefined,_0x386384[_0xf80d('0x1e7')])<_0x4826ce[_0xf80d('0x1e8')]*0x3c){if(_0x386384[_0xf80d('0x144')]&&!_0x386384[_0xf80d('0x144')][_0xf80d('0x1e9')]){_0xcc13a9['preview'][_0xf80d('0xf3')](_0x386384['id'])['finally'](function(){_0xcc13a9[_0xf80d('0xbe')](_0x4826ce);});}else{hopperUtils[_0xf80d('0x1ea')]({'active':![]},_0x386384['id'],0x1)['finally'](function(){_0xcc13a9['updateOriginated'](_0x4826ce);});}}else{_0x4826ce[_0xf80d('0x1eb')]+=0x1;_0xcc13a9[_0xf80d('0xbe')](_0x4826ce);if(_0x4826ce[_0xf80d('0x1ec')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x386384[_0xf80d('0xe3')],'ListId':_0x386384[_0xf80d('0xe4')],'VoiceQueueId':_0x386384[_0xf80d('0xdb')]||undefined,'CampaignId':_0x386384[_0xf80d('0xdc')]||undefined})['catch'](loggerCatch(_0xf80d('0x1ed')));hopperUtils[_0xf80d('0xc6')](createObjHistory(_0x4826ce,_0x386384,utils[_0xf80d('0x65')][_0xf80d('0x1ee')],0x17,_0xf80d('0x1ef')))['catch'](loggerCatch(_0xf80d('0x1f0')));}else{_0xcc13a9[_0xf80d('0x10d')](createObjHistory(_0x4826ce,_0x386384,utils[_0xf80d('0x65')][_0xf80d('0x1f1')],0x16,'RecallFailedTimeout'),_0xf80d('0x1f2'),_0xf80d('0x1f3'));}}}}else{_0x4826ce['outboundBlacklistCallsDay']+=0x1;_0xcc13a9['saveInDb'](createObjHistory(_0x4826ce,_0x386384,utils[_0xf80d('0x65')][_0xf80d('0x1f4')],0xd,_0xf80d('0x1f5')),_0xf80d('0x1f6'),_0xf80d('0x1f7'));throw _0xf80d('0x1f8');}};};Dialer[_0xf80d('0x1a')][_0xf80d('0x159')]=function(_0x69720c){var _0x3ed6cc=this;var _0x146b03=_0x69720c[_0xf80d('0x1f9')]-_0x69720c[_0xf80d('0x7c')];emitCampaignSummary(_0x69720c);if(_0x146b03>0x0&&_0x69720c[_0xf80d('0x63')]==0x0){if(_0x146b03>this[_0xf80d('0x23')]){_0x146b03=this[_0xf80d('0x23')];}_0x69720c[_0xf80d('0x63')]=0x1;hopperUtils['getContactDialerIvr'](_0x69720c,_0x146b03)[_0xf80d('0x9a')](function(_0x1cb8f6){_0x69720c['temp']=0x0;if(_0x1cb8f6){if(!utils['checkContactEmpty'](_0x1cb8f6)){_0x69720c[_0xf80d('0x64')]=utils[_0xf80d('0x65')][_0xf80d('0x69')];logger[_0xf80d('0x46')]('[getContactCampaign2][Empty]'+_0x69720c[_0xf80d('0x43')]);}else{_0x69720c[_0xf80d('0x7c')]+=_0x1cb8f6[_0xf80d('0xf8')];_0x69720c[_0xf80d('0x64')]=utils[_0xf80d('0x65')]['RUNNING'];for(var _0x4089a1=0x0;_0x4089a1<_0x1cb8f6[_0xf80d('0xf8')];_0x4089a1+=0x1){_0x69720c[_0xf80d('0x1fa')]+=0x1;if(_[_0xf80d('0xee')](_0x1cb8f6[_0x4089a1])||_[_0xf80d('0xee')](_0x1cb8f6[_0x4089a1]['Contact'])||_[_0xf80d('0xee')](_0x1cb8f6[_0x4089a1][_0xf80d('0x180')])){_0x3ed6cc[_0xf80d('0x1fb')](_0xf80d('0x1fc'),_0x69720c,_0x1cb8f6[_0x4089a1]);}else{hopperUtils[_0xf80d('0x1fd')](_[_0xf80d('0x72')](_0x1cb8f6[_0x4089a1],['CampaignId',_0xf80d('0x180')]))[_0xf80d('0x9a')](_0x3ed6cc['checkContactBlack'](_0x69720c,_0x1cb8f6[_0x4089a1]))[_0xf80d('0x9e')](_0x3ed6cc['loggerHandler'](_0xf80d('0x1fe'),_0x69720c));}}}}})[_0xf80d('0x9e')](loggerGetContactDialer(_0xf80d('0x1ff'),_0x69720c,_0x146b03));}};Dialer[_0xf80d('0x1a')][_0xf80d('0xac')]=function(_0x673425,_0x270b75){var _0x170a1f=this;var _0x21c29e=[];if(_0x270b75<0x1||_0x673425[_0xf80d('0xaa')]==='booked'){_0x270b75=0x1;}var _0x35b07d=Math[_0xf80d('0x1dc')](_0x673425[_0xf80d('0x133')]*_0x270b75)-_0x673425[_0xf80d('0x7c')];if(_0x673425[_0xf80d('0x200')]>0x0){var _0x3a899a=_0x673425[_0xf80d('0x200')]-_0x673425['originated']-_0x673425[_0xf80d('0x135')]-_0x673425['pTalking'];if(_0x35b07d>_0x3a899a){_0x35b07d=_0x3a899a;}}if(_0x35b07d>0x0&&_0x673425[_0xf80d('0x63')]==0x0){if(_0x673425[_0xf80d('0xaa')]===_0xf80d('0x9')){_0x35b07d=0x1;}if(_0x35b07d>this[_0xf80d('0x23')]){_0x35b07d=this[_0xf80d('0x23')];}for(var _0x352c28 in this[_0xf80d('0x21')]){if(typeof this['agents'][_0x352c28]!==_0xf80d('0x149')){if(this[_0xf80d('0x21')][_0x352c28][_0xf80d('0xcc')]==='not_inuse'&&this[_0xf80d('0x21')][_0x352c28][_0xf80d('0x85')]==='reachable'){_0x21c29e[_0xf80d('0x97')](this[_0xf80d('0x21')][_0x352c28]['id']);}}}_0x673425[_0xf80d('0x63')]=0x1;hopperUtils[_0xf80d('0x201')](_0x673425,_0x21c29e,_0x35b07d)['then'](function(_0x529590){_0x673425[_0xf80d('0x63')]=0x0;if(_0x529590){if(!utils[_0xf80d('0x202')](_0x529590)){hopperUtils['countReScheduled'](_0x673425)[_0xf80d('0x9a')](sendMessageReschedule(_0x673425))['catch'](loggerCatch(_0xf80d('0x203')));}else{_0x673425[_0xf80d('0x7c')]+=_0x529590['length'];_0x673425[_0xf80d('0x64')]=_0x673425[_0xf80d('0xaa')]===_0xf80d('0x9')?utils[_0xf80d('0x65')]['ACTIVE']:utils[_0xf80d('0x65')][_0xf80d('0x204')];for(var _0x4f985c=0x0;_0x4f985c<_0x529590['length'];_0x4f985c+=0x1){if(_[_0xf80d('0xee')](_0x529590[_0x4f985c])||_[_0xf80d('0xee')](_0x529590[_0x4f985c]['Contact'])||_[_0xf80d('0xee')](_0x529590[_0x4f985c][_0xf80d('0x180')])){_0x170a1f[_0xf80d('0x1fb')]('[actionOriginate]\x20',_0x673425,_0x529590[_0x4f985c]);}else{hopperUtils[_0xf80d('0x205')](_[_0xf80d('0x72')](_0x529590[_0x4f985c],[_0xf80d('0xdb'),'phone']))['then'](_0x170a1f[_0xf80d('0x1e1')](_0x673425,_0x529590[_0x4f985c]))[_0xf80d('0x9e')](_0x170a1f[_0xf80d('0x151')]('[actionOriginate]\x20',_0x673425));}}}}})[_0xf80d('0x9e')](loggerGetContactDialer('[getContactDialer2]',_0x673425,_0x35b07d));}};Dialer['prototype']['handlePredictive']=function(_0x2428bc){if(_0x2428bc[_0xf80d('0x200')]>0x0){var _0xe4215b=_0x2428bc[_0xf80d('0x200')]-_0x2428bc[_0xf80d('0x7c')]-_0x2428bc[_0xf80d('0x135')];if(_0xe4215b>0x0&&_0x2428bc[_0xf80d('0x63')]==0x0){this[_0xf80d('0x206')](_0x2428bc);}else{loggerPredictiveCalls[_0xf80d('0x46')](_0xf80d('0x207'));}}else{this[_0xf80d('0x206')](_0x2428bc);}};Dialer[_0xf80d('0x1a')][_0xf80d('0x206')]=function(_0x88d49a){var _0x19b4c5=this;var _0x3d3c03=[];_0x88d49a[_0xf80d('0x7c')]+=0x1;for(var _0xea5615 in this['agents']){if(typeof this['agents'][_0xea5615]!=='undefined'){if(this['agents'][_0xea5615][_0xf80d('0xcc')]===_0xf80d('0x208')&&this[_0xf80d('0x21')][_0xea5615][_0xf80d('0x85')]===_0xf80d('0x86')){_0x3d3c03[_0xf80d('0x97')](this['agents'][_0xea5615]['id']);}}}_0x88d49a[_0xf80d('0x63')]=0x1;return this['getContactDialer'](_0x88d49a['id'],_0x3d3c03,0x1,_0x88d49a[_0xf80d('0x209')],_0x88d49a)[_0xf80d('0x9a')](function(_0x2fa215){_0x88d49a[_0xf80d('0x63')]=0x1;if(_0x2fa215){if(!utils[_0xf80d('0x202')](_0x2fa215)){utils[_0xf80d('0x62')](_0x88d49a,0x1,0x0);return hopperUtils[_0xf80d('0x20a')](_0x88d49a)[_0xf80d('0x9a')](sendMessageReschedule(_0x88d49a))[_0xf80d('0x9e')](loggerCatch('[countReScheduled]\x20'));}else{_0x88d49a[_0xf80d('0x64')]=utils[_0xf80d('0x65')][_0xf80d('0x204')];if(_[_0xf80d('0xee')](_0x2fa215[0x0])||_[_0xf80d('0xee')](_0x2fa215[0x0][_0xf80d('0x20b')])||_[_0xf80d('0xee')](_0x2fa215[0x0][_0xf80d('0x180')])){_0x19b4c5[_0xf80d('0x1fb')]('[actionOriginate]\x20',_0x88d49a,_0x2fa215[0x0]);}else{return hopperUtils[_0xf80d('0x205')](_[_0xf80d('0x72')](_0x2fa215[0x0],[_0xf80d('0xdb'),'phone']))[_0xf80d('0x9a')](_0x19b4c5[_0xf80d('0x1e1')](_0x88d49a,_0x2fa215[0x0]))[_0xf80d('0x9e')](_0x19b4c5[_0xf80d('0x151')](_0xf80d('0x20c'),_0x88d49a));}}}})[_0xf80d('0x9e')](loggerGetContactDialer('[getContactDialerPredictive]',_0x88d49a,0x1));};Dialer[_0xf80d('0x1a')]['abandonmentRate']=function(_0x1ec8af,_0x5614d5,_0x5db761,_0x13cfd2,_0x527c83,_0x13d7e6){loggerPredictive[_0xf80d('0x46')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xf80d('0x46')](_0xf80d('0x20d'),_0x1ec8af);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5614d5);loggerPredictive['info'](_0xf80d('0x20e'),_0x5db761);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x13cfd2);loggerPredictive[_0xf80d('0x46')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x527c83);loggerPredictive['info'](_0xf80d('0x4c'));return new Promise(function(_0x4c7dc8,_0x1dddfe){if(_0x1ec8af<=0x0||isNaN(_0x1ec8af)){return _0x1dddfe(msgResponse(_0xf80d('0x20f'),_0xf80d('0x81'),'m\x20=\x20'+_0x1ec8af));}if(_0x5db761<=0x0||isNaN(_0x5db761)){return _0x1dddfe(msgResponse('[abandonmentRate]','Error',_0xf80d('0x210')+_0x5db761));}if(_0x13cfd2<=0x0||isNaN(_0x13cfd2)){return _0x1dddfe(msgResponse(_0xf80d('0x20f'),_0xf80d('0x81'),'p\x20=\x20'+_0x13cfd2));}if(_0x5614d5<=0x0||isNaN(_0x5614d5)){return _0x1dddfe(msgResponse(_0xf80d('0x20f'),_0xf80d('0x81'),_0xf80d('0x211')+_0x5614d5));}if(_0x527c83<=0x0||isNaN(_0x527c83)){return _0x1dddfe(msgResponse(_0xf80d('0x20f'),_0xf80d('0x81'),_0xf80d('0x212')+_0x527c83));}_0x13d7e6=_0x13d7e6||0x0;var _0x2c1b75=0x1/_0x5db761;var _0x19d8fa=0x0;var _0xb0ae8e=0x0;var _0x329e2d=0x0;var _0xe88752=0x0;for(var _0x4fdd98=0x0;_0x329e2d<_0x527c83;_0x4fdd98+=0x1){_0xb0ae8e=_0x4fdd98/_0x5614d5;_0x19d8fa=(_0x13cfd2*_0xb0ae8e+_0x13d7e6)/_0x2c1b75;_0x329e2d=utils[_0xf80d('0x213')](_0x19d8fa,_0x1ec8af);_0xe88752=_0x19d8fa/_0x1ec8af*(0x1-utils['erlangb'](_0x19d8fa,_0x1ec8af));}return _0x4c7dc8({'erlangCalls':_0x4fdd98,'erlangCallToSecond':_0x5614d5/_0x4fdd98,'erlangAbandonmentRate':_0x329e2d,'erlangBusyFactor':_0xe88752});});};Dialer[_0xf80d('0x1a')][_0xf80d('0x1d4')]=function(_0x28bf9b,_0x41e36c,_0x209829,_0x3f156e,_0x5ddf6c,_0x4f22ff){loggerPredictive[_0xf80d('0x46')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0xf80d('0x20d'),_0x28bf9b);loggerPredictive[_0xf80d('0x46')](_0xf80d('0x214'),_0x41e36c);loggerPredictive[_0xf80d('0x46')](_0xf80d('0x20e'),_0x209829);loggerPredictive['info'](_0xf80d('0x215'),_0x3f156e);loggerPredictive[_0xf80d('0x46')](_0xf80d('0x216'),_0x5ddf6c);loggerPredictive[_0xf80d('0x46')](_0xf80d('0x4c'));return new Promise(function(_0x2cec52,_0xc64a92){if(_0x28bf9b<=0x0||isNaN(_0x28bf9b)){return _0xc64a92(msgResponse('[busyFactor]',_0xf80d('0x81'),'m\x20=\x20'+_0x28bf9b));}if(_0x209829<=0x0||isNaN(_0x209829)){return _0xc64a92(msgResponse('[busyFactor]',_0xf80d('0x81'),_0xf80d('0x210')+_0x209829));}if(_0x3f156e<=0x0||isNaN(_0x3f156e)){return _0xc64a92(msgResponse('[busyFactor]',_0xf80d('0x81'),_0xf80d('0x217')+_0x3f156e));}if(_0x41e36c<=0x0||isNaN(_0x41e36c)){return _0xc64a92(msgResponse(_0xf80d('0x218'),_0xf80d('0x81'),_0xf80d('0x211')+_0x41e36c));}if(_0x5ddf6c<=0x0||isNaN(_0x5ddf6c)){return _0xc64a92(msgResponse(_0xf80d('0x218'),_0xf80d('0x81'),_0xf80d('0x219')+_0x5ddf6c));}_0x4f22ff=_0x4f22ff||0x0;var _0x43ff66=0x1/_0x209829;var _0x296e99=0x0;var _0x455895=0x0;var _0x4f9c22=0x0;var _0xa8c7cf=0x0;for(var _0x354045=0x0;_0xa8c7cf<_0x5ddf6c;_0x354045+=0x1){_0x455895=_0x354045/_0x41e36c;_0x296e99=(_0x3f156e*_0x455895+_0x4f22ff)/_0x43ff66;_0x4f9c22=utils[_0xf80d('0x213')](_0x296e99,_0x28bf9b);_0xa8c7cf=_0x296e99/_0x28bf9b*(0x1-utils[_0xf80d('0x213')](_0x296e99,_0x28bf9b));}return _0x2cec52({'erlangCalls':_0x354045,'erlangCallToSecond':_0x41e36c/_0x354045,'erlangAbandonmentRate':_0x4f9c22,'erlangBusyFactor':_0xa8c7cf});});};module[_0xf80d('0x21a')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index cf7f6e7..3ec1137 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7486=['UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','getCaller','format','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','prototype','exports','lodash','moment','isNil','string','uniqueid','name','Contact','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId'];(function(_0x316dab,_0x2261ba){var _0x11d71f=function(_0x321488){while(--_0x321488){_0x316dab['push'](_0x316dab['shift']());}};_0x11d71f(++_0x2261ba);}(_0x7486,0x1a9));var _0x6748=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7486[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0x6748('0x0'));var moment=require(_0x6748('0x1'));function checkNameSurname(_0x1f5043,_0x28d5e8,_0x4c79c6){var _0x144cd3='';if(!_[_0x6748('0x2')](_0x28d5e8)&&_0x6748('0x3')===typeof _0x28d5e8){_0x144cd3+=_0x28d5e8;}if(!_[_0x6748('0x2')](_0x4c79c6)&&_0x6748('0x3')===typeof _0x4c79c6){_0x144cd3+='\x20'+_0x4c79c6;}if(_0x144cd3!==''){return _0x144cd3;}return _0x1f5043;}function Action(_0x1fec22,_0x4d75b5,_0x161950){this['voiceQueue']=_0x1fec22;this[_0x6748('0x4')]=_0x161950||undefined;this[_0x6748('0x5')]=checkNameSurname(_0x4d75b5[_0x6748('0x6')]['phone'],_0x4d75b5[_0x6748('0x6')]['firstName'],_0x4d75b5['Contact'][_0x6748('0x7')]);this[_0x6748('0x8')]=_0x4d75b5[_0x6748('0x9')];this[_0x6748('0xa')]=_0x1fec22[_0x6748('0x5')];this['active']=_0x4d75b5[_0x6748('0xb')]||![];this[_0x6748('0xc')]=_0x1fec22[_0x6748('0xc')];this[_0x6748('0xd')]=_0x1fec22[_0x6748('0xd')]||0x3;this[_0x6748('0xe')]=_0x4d75b5[_0x6748('0xe')];this[_0x6748('0xf')]=_0x4d75b5[_0x6748('0xf')];this[_0x6748('0x10')]=_0x4d75b5[_0x6748('0x10')];this[_0x6748('0x11')]=_0x4d75b5[_0x6748('0x11')];this[_0x6748('0x12')]=_0x4d75b5['countnosuchnumberretry'];this['countdropretry']=_0x4d75b5[_0x6748('0x13')];this['countabandonedretry']=_0x4d75b5[_0x6748('0x14')];this[_0x6748('0x15')]=_0x4d75b5[_0x6748('0x15')];this[_0x6748('0x16')]=_0x4d75b5[_0x6748('0x16')];this['ContactId']=_0x4d75b5[_0x6748('0x17')];this[_0x6748('0x18')]=_0x4d75b5['ListId'];this[_0x6748('0x19')]=_0x4d75b5[_0x6748('0x19')];this[_0x6748('0x1a')]=_0x4d75b5[_0x6748('0x1a')];this['CampaignId']=_0x4d75b5[_0x6748('0x1b')];this[_0x6748('0x1c')]=_0x4d75b5['id'];this[_0x6748('0x1d')]=_0x4d75b5[_0x6748('0x6')][_0x6748('0x1e')]||'';this[_0x6748('0x1f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x6748('0x20')]=_0x4d75b5[_0x6748('0x20')];this[_0x6748('0x21')]=_0x4d75b5['callbackuniqueid'];this[_0x6748('0x22')]=_0x4d75b5[_0x6748('0x22')];this[_0x6748('0x23')]=_0x4d75b5['recallme'];this[_0x6748('0x24')]='';this['originatecalleridname']='';}Action['prototype'][_0x6748('0x25')]=function(){return util[_0x6748('0x26')](_0x6748('0x27'),this[_0x6748('0x5')],this[_0x6748('0x28')][_0x6748('0x29')]>0x0?this['number'][_0x6748('0x2a')](this[_0x6748('0x28')]['dialCutDigit']):this[_0x6748('0x8')]);};Action[_0x6748('0x2b')]['getQueue']=function(){return this[_0x6748('0xa')];};module[_0x6748('0x2c')]=Action; \ No newline at end of file +var _0x92a0=['recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','substring','dialCutDigit','getQueue','exports','lodash','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','idHopper','ContactFirstName','callback','callbackuniqueid'];(function(_0x384e65,_0x1944de){var _0x547015=function(_0x104f32){while(--_0x104f32){_0x384e65['push'](_0x384e65['shift']());}};_0x547015(++_0x1944de);}(_0x92a0,0x1d8));var _0x092a=function(_0x48f7cf,_0x4baa04){_0x48f7cf=_0x48f7cf-0x0;var _0xc201c0=_0x92a0[_0x48f7cf];return _0xc201c0;};'use strict';var util=require('util');var _=require(_0x092a('0x0'));var moment=require('moment');function checkNameSurname(_0x5f20f4,_0x17850f,_0x5ebd24){var _0x3d11fd='';if(!_[_0x092a('0x1')](_0x17850f)&&_0x092a('0x2')===typeof _0x17850f){_0x3d11fd+=_0x17850f;}if(!_['isNil'](_0x5ebd24)&&_0x092a('0x2')===typeof _0x5ebd24){_0x3d11fd+='\x20'+_0x5ebd24;}if(_0x3d11fd!==''){return _0x3d11fd;}return _0x5f20f4;}function Action(_0x13d59c,_0x3d324a,_0x50210b){this[_0x092a('0x3')]=_0x13d59c;this[_0x092a('0x4')]=_0x50210b||undefined;this[_0x092a('0x5')]=checkNameSurname(_0x3d324a['Contact']['phone'],_0x3d324a[_0x092a('0x6')][_0x092a('0x7')],_0x3d324a['Contact'][_0x092a('0x8')]);this[_0x092a('0x9')]=_0x3d324a[_0x092a('0xa')];this[_0x092a('0xb')]=_0x13d59c[_0x092a('0x5')];this[_0x092a('0xc')]=_0x3d324a[_0x092a('0xc')]||![];this[_0x092a('0xd')]=_0x13d59c[_0x092a('0xd')];this[_0x092a('0xe')]=_0x13d59c[_0x092a('0xe')]||0x3;this[_0x092a('0xf')]=_0x3d324a[_0x092a('0xf')];this[_0x092a('0x10')]=_0x3d324a['countbusyretry'];this['countcongestionretry']=_0x3d324a[_0x092a('0x11')];this['countnoanswerretry']=_0x3d324a[_0x092a('0x12')];this[_0x092a('0x13')]=_0x3d324a[_0x092a('0x13')];this[_0x092a('0x14')]=_0x3d324a[_0x092a('0x14')];this[_0x092a('0x15')]=_0x3d324a[_0x092a('0x15')];this[_0x092a('0x16')]=_0x3d324a[_0x092a('0x16')];this[_0x092a('0x17')]=_0x3d324a[_0x092a('0x17')];this[_0x092a('0x18')]=_0x3d324a[_0x092a('0x18')];this['ListId']=_0x3d324a[_0x092a('0x19')];this[_0x092a('0x1a')]=_0x3d324a[_0x092a('0x1a')];this[_0x092a('0x1b')]=_0x3d324a['VoiceQueueId'];this['CampaignId']=_0x3d324a['CampaignId'];this[_0x092a('0x1c')]=_0x3d324a['id'];this[_0x092a('0x1d')]=_0x3d324a[_0x092a('0x6')][_0x092a('0x7')]||'';this['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x092a('0x1e')]=_0x3d324a[_0x092a('0x1e')];this[_0x092a('0x1f')]=_0x3d324a[_0x092a('0x1f')];this['callbackat']=_0x3d324a['callbackat'];this[_0x092a('0x20')]=_0x3d324a[_0x092a('0x20')];this[_0x092a('0x21')]='';this[_0x092a('0x22')]='';}Action[_0x092a('0x23')][_0x092a('0x24')]=function(){return util[_0x092a('0x25')]('\x22%s\x22\x20<%s>',this[_0x092a('0x5')],this[_0x092a('0x3')]['dialCutDigit']>0x0?this['number'][_0x092a('0x26')](this['voiceQueue'][_0x092a('0x27')]):this[_0x092a('0x9')]);};Action['prototype'][_0x092a('0x28')]=function(){return this['queue'];};module[_0x092a('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 7ca603a..6391b78 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2358=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','../utils','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','membername','reason','callback'];(function(_0x5303ac,_0x503d19){var _0x134f90=function(_0x3b280a){while(--_0x3b280a){_0x5303ac['push'](_0x5303ac['shift']());}};_0x134f90(++_0x503d19);}(_0x2358,0x87));var _0x8235=function(_0x77f389,_0x3028b5){_0x77f389=_0x77f389-0x0;var _0x3f0808=_0x2358[_0x77f389];return _0x3f0808;};'use strict';var moment=require('moment');var utils=require(_0x8235('0x0'));function AgentComplete(_0x55842d,_0x172673){this['state']=0x4;this['statedesc']=_0x8235('0x1');this[_0x8235('0x2')]=_0x55842d[_0x8235('0x2')];this[_0x8235('0x3')]=_0x55842d[_0x8235('0x3')];this['campaigntype']=_0x55842d[_0x8235('0x3')]===_0x8235('0x4')?_0x8235('0x5'):_0x55842d[_0x8235('0x3')];this['countbusyretry']=_0x55842d[_0x8235('0x6')];this[_0x8235('0x7')]=_0x55842d[_0x8235('0x7')];this[_0x8235('0x8')]=_0x55842d[_0x8235('0x8')];this['countglobal']=_0x55842d['countbusyretry']+_0x55842d[_0x8235('0x7')]+_0x55842d[_0x8235('0x8')]+_0x55842d[_0x8235('0x9')]+_0x55842d[_0x8235('0xa')]+_0x55842d[_0x8235('0xb')]+_0x55842d[_0x8235('0xc')]+_0x55842d[_0x8235('0xd')];this[_0x8235('0x9')]=_0x55842d[_0x8235('0x9')];this[_0x8235('0xa')]=_0x55842d[_0x8235('0xa')];this[_0x8235('0xb')]=_0x55842d['countabandonedretry'];this['countmachineretry']=_0x55842d[_0x8235('0xc')];this['countagentrejectretry']=_0x55842d['countagentrejectretry'];this[_0x8235('0xe')]=_0x172673[_0x8235('0xe')];this[_0x8235('0xf')]=_0x55842d[_0x8235('0x10')];this[_0x8235('0x11')]=_0x55842d['number'];this[_0x8235('0x12')]=_0x55842d['starttime'];this[_0x8235('0x13')]=_0x55842d[_0x8235('0x13')];this[_0x8235('0x14')]=_0x55842d[_0x8235('0x14')];this[_0x8235('0x15')]=moment()['format'](_0x8235('0x16'));this[_0x8235('0x17')]=utils[_0x8235('0x18')](_0x55842d[_0x8235('0x13')],_0x55842d[_0x8235('0x12')]);this[_0x8235('0x19')]=utils[_0x8235('0x18')](_0x55842d[_0x8235('0x14')],_0x55842d[_0x8235('0x13')]);this['talktime']=utils[_0x8235('0x18')](this[_0x8235('0x15')],_0x55842d['answertime']);this[_0x8235('0x5')]=_0x172673[_0x8235('0x5')];this[_0x8235('0x1a')]=_0x172673[_0x8235('0x1a')];this[_0x8235('0x1b')]=_0x172673[_0x8235('0x1b')];this[_0x8235('0x1c')]=_0x55842d['callback'];this[_0x8235('0x1d')]=_0x55842d[_0x8235('0x1d')];this[_0x8235('0x1e')]=_0x55842d[_0x8235('0x1e')];this[_0x8235('0x1f')]=_0x55842d['recallme'];this[_0x8235('0x20')]=_0x55842d[_0x8235('0x20')];this[_0x8235('0x21')]=_0x55842d[_0x8235('0x21')];this[_0x8235('0x22')]=_0x55842d[_0x8235('0x22')];this[_0x8235('0x23')]=_0x55842d[_0x8235('0x23')];this[_0x8235('0x24')]=_0x55842d['CampaignId'];this[_0x8235('0x25')]=_0x55842d['originatecalleridnum']||'';this[_0x8235('0x26')]=_0x55842d['originatecalleridname']||'';this[_0x8235('0x27')]=_0x55842d[_0x8235('0x27')];}module[_0x8235('0x28')]=AgentComplete; \ No newline at end of file +var _0x3e51=['countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','starttime','responsetime','answertime','endtime','format','ringtime','getSeconds','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','moment','../utils','state','statedesc','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x2214cc,_0x5997d0){var _0x21e63a=function(_0x5f0203){while(--_0x5f0203){_0x2214cc['push'](_0x2214cc['shift']());}};_0x21e63a(++_0x5997d0);}(_0x3e51,0x164));var _0x13e5=function(_0x3a2689,_0x1ec923){_0x3a2689=_0x3a2689-0x0;var _0x1327d1=_0x3e51[_0x3a2689];return _0x1327d1;};'use strict';var moment=require(_0x13e5('0x0'));var utils=require(_0x13e5('0x1'));function AgentComplete(_0x15f582,_0x38a83d){this[_0x13e5('0x2')]=0x4;this[_0x13e5('0x3')]='Answer';this[_0x13e5('0x4')]=_0x15f582['scheduledat'];this[_0x13e5('0x5')]=_0x15f582[_0x13e5('0x5')];this['campaigntype']=_0x15f582[_0x13e5('0x5')]==='outbound'?_0x13e5('0x6'):_0x15f582[_0x13e5('0x5')];this[_0x13e5('0x7')]=_0x15f582[_0x13e5('0x7')];this[_0x13e5('0x8')]=_0x15f582[_0x13e5('0x8')];this[_0x13e5('0x9')]=_0x15f582['countnoanswerretry'];this[_0x13e5('0xa')]=_0x15f582[_0x13e5('0x7')]+_0x15f582[_0x13e5('0x8')]+_0x15f582[_0x13e5('0x9')]+_0x15f582[_0x13e5('0xb')]+_0x15f582[_0x13e5('0xc')]+_0x15f582[_0x13e5('0xd')]+_0x15f582[_0x13e5('0xe')]+_0x15f582[_0x13e5('0xf')];this['countnosuchnumberretry']=_0x15f582[_0x13e5('0xb')];this[_0x13e5('0xc')]=_0x15f582[_0x13e5('0xc')];this['countabandonedretry']=_0x15f582[_0x13e5('0xd')];this[_0x13e5('0xe')]=_0x15f582[_0x13e5('0xe')];this[_0x13e5('0xf')]=_0x15f582[_0x13e5('0xf')];this[_0x13e5('0x10')]=_0x38a83d[_0x13e5('0x10')];this['calleridname']=_0x15f582[_0x13e5('0x11')];this['calleridnum']=_0x15f582['number'];this[_0x13e5('0x12')]=_0x15f582['starttime'];this['responsetime']=_0x15f582[_0x13e5('0x13')];this['answertime']=_0x15f582[_0x13e5('0x14')];this[_0x13e5('0x15')]=moment()[_0x13e5('0x16')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x13e5('0x17')]=utils[_0x13e5('0x18')](_0x15f582['responsetime'],_0x15f582['starttime']);this[_0x13e5('0x19')]=utils[_0x13e5('0x18')](_0x15f582[_0x13e5('0x14')],_0x15f582['responsetime']);this[_0x13e5('0x1a')]=utils['getSeconds'](this['endtime'],_0x15f582[_0x13e5('0x14')]);this['queue']=_0x38a83d[_0x13e5('0x6')];this[_0x13e5('0x1b')]=_0x38a83d[_0x13e5('0x1b')];this[_0x13e5('0x1c')]=_0x38a83d[_0x13e5('0x1c')];this['callback']=_0x15f582[_0x13e5('0x1d')];this[_0x13e5('0x1e')]=_0x15f582[_0x13e5('0x1e')];this['callbackat']=_0x15f582[_0x13e5('0x1f')];this[_0x13e5('0x20')]=_0x15f582[_0x13e5('0x20')];this['ContactId']=_0x15f582[_0x13e5('0x21')];this[_0x13e5('0x22')]=_0x15f582[_0x13e5('0x22')];this[_0x13e5('0x23')]=_0x15f582['UserId'];this[_0x13e5('0x24')]=_0x15f582[_0x13e5('0x24')];this[_0x13e5('0x25')]=_0x15f582[_0x13e5('0x25')];this[_0x13e5('0x26')]=_0x15f582[_0x13e5('0x26')]||'';this[_0x13e5('0x27')]=_0x15f582[_0x13e5('0x27')]||'';this[_0x13e5('0x28')]=_0x15f582[_0x13e5('0x28')];}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index b349544..a165c97 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad8e=['countmachineretry','countdropretry','countagentrejectretry','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry'];(function(_0x41e771,_0x8f47ed){var _0x705fcf=function(_0x4e1ad5){while(--_0x4e1ad5){_0x41e771['push'](_0x41e771['shift']());}};_0x705fcf(++_0x8f47ed);}(_0xad8e,0xb7));var _0xead8=function(_0x176149,_0x50b528){_0x176149=_0x176149-0x0;var _0x7b22ab=_0xad8e[_0x176149];return _0x7b22ab;};'use strict';function Final(_0x40861f){this[_0xead8('0x0')]=_0x40861f[_0xead8('0x0')];this['scheduledat']=_0x40861f['scheduledat'];this[_0xead8('0x1')]=_0x40861f[_0xead8('0x1')];this['campaigntype']=_0x40861f[_0xead8('0x1')]===_0xead8('0x2')?_0xead8('0x3'):_0x40861f[_0xead8('0x1')];this[_0xead8('0x4')]=_0x40861f[_0xead8('0x4')];this[_0xead8('0x5')]=_0x40861f['countcongestionretry'];this[_0xead8('0x6')]=_0x40861f['countnoanswerretry'];this['countglobal']=_0x40861f[_0xead8('0x4')]+_0x40861f[_0xead8('0x5')]+_0x40861f[_0xead8('0x6')]+_0x40861f[_0xead8('0x7')]+_0x40861f['countdropretry']+_0x40861f[_0xead8('0x8')]+_0x40861f[_0xead8('0x9')]+_0x40861f['countagentrejectretry'];this[_0xead8('0x7')]=_0x40861f[_0xead8('0x7')];this[_0xead8('0xa')]=_0x40861f[_0xead8('0xa')];this[_0xead8('0x8')]=_0x40861f[_0xead8('0x8')];this[_0xead8('0x9')]=_0x40861f[_0xead8('0x9')];this[_0xead8('0xb')]=_0x40861f['countagentrejectretry'];this[_0xead8('0x3')]=_0x40861f['queue'];this['calleridname']=_0x40861f['calleridname'];this[_0xead8('0xc')]=_0x40861f[_0xead8('0xc')];this[_0xead8('0xd')]=_0x40861f[_0xead8('0xd')];this['responsetime']=_0x40861f[_0xead8('0xe')];this[_0xead8('0xf')]=_0x40861f[_0xead8('0xe')];this[_0xead8('0x10')]=_0x40861f[_0xead8('0x10')]||0x0;this[_0xead8('0x11')]=_0x40861f[_0xead8('0x11')]||0x0;this['talktime']=_0x40861f[_0xead8('0x12')]||0x0;this[_0xead8('0x13')]=_0x40861f['callback'];this[_0xead8('0x14')]=_0x40861f['callbackuniqueid'];this['callbackat']=_0x40861f[_0xead8('0x15')];this[_0xead8('0x16')]=_0x40861f[_0xead8('0x16')];this['ContactId']=_0x40861f[_0xead8('0x17')];this['ListId']=_0x40861f['ListId'];this[_0xead8('0x18')]=_0x40861f[_0xead8('0x18')];this[_0xead8('0x19')]=_0x40861f[_0xead8('0x19')];this[_0xead8('0x1a')]=_0x40861f[_0xead8('0x1a')];this[_0xead8('0x1b')]=_0x40861f[_0xead8('0x1b')]||'';this[_0xead8('0x1c')]=_0x40861f[_0xead8('0x1c')]||'';this[_0xead8('0x1d')]=_0x40861f[_0xead8('0x1d')];this[_0xead8('0x1e')]=_0x40861f[_0xead8('0x1e')];}module[_0xead8('0x1f')]=Final; \ No newline at end of file +var _0x7d7c=['responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','originatecalleridnum','originatecalleridname','statedesc','exports','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','calleridname','calleridnum','starttime'];(function(_0x1721f6,_0x2d2bae){var _0x2219fe=function(_0x3bc848){while(--_0x3bc848){_0x1721f6['push'](_0x1721f6['shift']());}};_0x2219fe(++_0x2d2bae);}(_0x7d7c,0x145));var _0xc7d7=function(_0x21fbe0,_0x525d03){_0x21fbe0=_0x21fbe0-0x0;var _0x16ecb4=_0x7d7c[_0x21fbe0];return _0x16ecb4;};'use strict';function Final(_0x174304){this['uniqueid']=_0x174304['uniqueid'];this[_0xc7d7('0x0')]=_0x174304[_0xc7d7('0x0')];this[_0xc7d7('0x1')]=_0x174304['type'];this['campaigntype']=_0x174304[_0xc7d7('0x1')]===_0xc7d7('0x2')?_0xc7d7('0x3'):_0x174304[_0xc7d7('0x1')];this[_0xc7d7('0x4')]=_0x174304['countbusyretry'];this[_0xc7d7('0x5')]=_0x174304['countcongestionretry'];this[_0xc7d7('0x6')]=_0x174304['countnoanswerretry'];this[_0xc7d7('0x7')]=_0x174304[_0xc7d7('0x4')]+_0x174304[_0xc7d7('0x5')]+_0x174304[_0xc7d7('0x6')]+_0x174304['countnosuchnumberretry']+_0x174304[_0xc7d7('0x8')]+_0x174304['countabandonedretry']+_0x174304[_0xc7d7('0x9')]+_0x174304[_0xc7d7('0xa')];this[_0xc7d7('0xb')]=_0x174304[_0xc7d7('0xb')];this[_0xc7d7('0x8')]=_0x174304[_0xc7d7('0x8')];this[_0xc7d7('0xc')]=_0x174304[_0xc7d7('0xc')];this['countmachineretry']=_0x174304[_0xc7d7('0x9')];this[_0xc7d7('0xa')]=_0x174304[_0xc7d7('0xa')];this[_0xc7d7('0x3')]=_0x174304[_0xc7d7('0x3')];this[_0xc7d7('0xd')]=_0x174304[_0xc7d7('0xd')];this[_0xc7d7('0xe')]=_0x174304[_0xc7d7('0xe')];this[_0xc7d7('0xf')]=_0x174304['starttime'];this[_0xc7d7('0x10')]=_0x174304[_0xc7d7('0x10')];this['endtime']=_0x174304[_0xc7d7('0x10')];this[_0xc7d7('0x11')]=_0x174304[_0xc7d7('0x11')]||0x0;this[_0xc7d7('0x12')]=_0x174304[_0xc7d7('0x12')]||0x0;this['talktime']=_0x174304[_0xc7d7('0x13')]||0x0;this[_0xc7d7('0x14')]=_0x174304[_0xc7d7('0x14')];this[_0xc7d7('0x15')]=_0x174304['callbackuniqueid'];this[_0xc7d7('0x16')]=_0x174304[_0xc7d7('0x16')];this[_0xc7d7('0x17')]=_0x174304['recallme'];this[_0xc7d7('0x18')]=_0x174304['ContactId'];this[_0xc7d7('0x19')]=_0x174304[_0xc7d7('0x19')];this[_0xc7d7('0x1a')]=_0x174304[_0xc7d7('0x1a')];this['VoiceQueueId']=_0x174304['VoiceQueueId'];this['CampaignId']=_0x174304['CampaignId'];this[_0xc7d7('0x1b')]=_0x174304[_0xc7d7('0x1b')]||'';this[_0xc7d7('0x1c')]=_0x174304[_0xc7d7('0x1c')]||'';this['state']=_0x174304['state'];this[_0xc7d7('0x1d')]=_0x174304['statedesc'];}module[_0xc7d7('0x1e')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 90619e7..24f9566 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32c6=['countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','ringtime','getSeconds','holdtime','talktime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','amd'];(function(_0x53b133,_0x176261){var _0x5647e0=function(_0x4c62b0){while(--_0x4c62b0){_0x53b133['push'](_0x53b133['shift']());}};_0x5647e0(++_0x176261);}(_0x32c6,0x79));var _0x632c=function(_0x53d845,_0x15f08f){_0x53d845=_0x53d845-0x0;var _0x2532c1=_0x32c6[_0x53d845];return _0x2532c1;};'use strict';var moment=require(_0x632c('0x0'));var utils=require(_0x632c('0x1'));function Hangup(_0xdf9728,_0xe1d8af){this[_0x632c('0x2')]=0x4;this[_0x632c('0x3')]=_0x632c('0x4');this[_0x632c('0x5')]=_0xdf9728['scheduledat'];this[_0x632c('0x6')]=_0xdf9728[_0x632c('0x6')];this[_0x632c('0x7')]=_0xdf9728[_0x632c('0x6')]===_0x632c('0x8')?_0x632c('0x9'):_0xdf9728[_0x632c('0x6')];this['amd']=_0xdf9728[_0x632c('0xa')]||![];this['countbusyretry']=_0xdf9728[_0x632c('0xb')];this['countcongestionretry']=_0xdf9728[_0x632c('0xc')];this[_0x632c('0xd')]=_0xdf9728[_0x632c('0xd')];this['countglobal']=_0xdf9728[_0x632c('0xb')]+_0xdf9728[_0x632c('0xc')]+_0xdf9728['countnoanswerretry']+_0xdf9728[_0x632c('0xe')]+_0xdf9728[_0x632c('0xf')]+_0xdf9728[_0x632c('0x10')]+_0xdf9728['countmachineretry']+_0xdf9728[_0x632c('0x11')];this[_0x632c('0xe')]=_0xdf9728[_0x632c('0xe')];this[_0x632c('0xf')]=_0xdf9728[_0x632c('0xf')];this['countabandonedretry']=_0xdf9728[_0x632c('0x10')];this[_0x632c('0x12')]=_0xdf9728['countmachineretry'];this['countagentrejectretry']=_0xdf9728[_0x632c('0x11')];this[_0x632c('0x13')]=_0xe1d8af[_0x632c('0x13')];this[_0x632c('0x14')]=_0xdf9728[_0x632c('0x15')];this[_0x632c('0x16')]=_0xdf9728[_0x632c('0x17')];this[_0x632c('0x18')]=_0xdf9728[_0x632c('0x18')];this['responsetime']=_0xdf9728[_0x632c('0x19')];this[_0x632c('0x1a')]=moment()[_0x632c('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x632c('0x1c')]=utils[_0x632c('0x1d')](_0xdf9728[_0x632c('0x19')],_0xdf9728['starttime']);this[_0x632c('0x1e')]=0x0;this[_0x632c('0x1f')]=utils[_0x632c('0x1d')](this[_0x632c('0x1a')],_0xdf9728[_0x632c('0x19')]);this[_0x632c('0x9')]=_0xdf9728[_0x632c('0x9')];this[_0x632c('0x20')]=_0x632c('0x21');this['reason']=_0xe1d8af[_0x632c('0x22')];this['callback']=_0xdf9728[_0x632c('0x23')];this[_0x632c('0x24')]=_0xdf9728[_0x632c('0x24')];this['callbackat']=_0xdf9728[_0x632c('0x25')];this[_0x632c('0x26')]=_0xdf9728['recallme'];this['ContactId']=_0xdf9728[_0x632c('0x27')];this[_0x632c('0x28')]=_0xdf9728[_0x632c('0x28')];this[_0x632c('0x29')]=_0xdf9728['UserId'];this['VoiceQueueId']=_0xdf9728['VoiceQueueId'];this[_0x632c('0x2a')]=_0xdf9728[_0x632c('0x2a')];}module[_0x632c('0x2b')]=Hangup; \ No newline at end of file +var _0x3765=['VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','scheduledat','type','outbound','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','getSeconds','queue','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x2085d6,_0x54d6a9){var _0x2c8da9=function(_0x40676a){while(--_0x40676a){_0x2085d6['push'](_0x2085d6['shift']());}};_0x2c8da9(++_0x54d6a9);}(_0x3765,0x15b));var _0x5376=function(_0x1d3fa2,_0x1b4f9e){_0x1d3fa2=_0x1d3fa2-0x0;var _0x5a600b=_0x3765[_0x1d3fa2];return _0x5a600b;};'use strict';var moment=require(_0x5376('0x0'));var utils=require(_0x5376('0x1'));function Hangup(_0x1478ff,_0xc0cf4f){this[_0x5376('0x2')]=0x4;this[_0x5376('0x3')]='Answer';this[_0x5376('0x4')]=_0x1478ff['scheduledat'];this['type']=_0x1478ff[_0x5376('0x5')];this['campaigntype']=_0x1478ff[_0x5376('0x5')]===_0x5376('0x6')?'queue':_0x1478ff[_0x5376('0x5')];this[_0x5376('0x7')]=_0x1478ff[_0x5376('0x7')]||![];this['countbusyretry']=_0x1478ff[_0x5376('0x8')];this[_0x5376('0x9')]=_0x1478ff[_0x5376('0x9')];this['countnoanswerretry']=_0x1478ff[_0x5376('0xa')];this[_0x5376('0xb')]=_0x1478ff['countbusyretry']+_0x1478ff['countcongestionretry']+_0x1478ff[_0x5376('0xa')]+_0x1478ff[_0x5376('0xc')]+_0x1478ff[_0x5376('0xd')]+_0x1478ff[_0x5376('0xe')]+_0x1478ff[_0x5376('0xf')]+_0x1478ff['countagentrejectretry'];this['countnosuchnumberretry']=_0x1478ff[_0x5376('0xc')];this[_0x5376('0xd')]=_0x1478ff['countdropretry'];this['countabandonedretry']=_0x1478ff['countabandonedretry'];this[_0x5376('0xf')]=_0x1478ff[_0x5376('0xf')];this[_0x5376('0x10')]=_0x1478ff[_0x5376('0x10')];this[_0x5376('0x11')]=_0xc0cf4f[_0x5376('0x11')];this[_0x5376('0x12')]=_0x1478ff[_0x5376('0x13')];this['calleridnum']=_0x1478ff[_0x5376('0x14')];this[_0x5376('0x15')]=_0x1478ff[_0x5376('0x15')];this['responsetime']=_0x1478ff[_0x5376('0x16')];this[_0x5376('0x17')]=moment()[_0x5376('0x18')](_0x5376('0x19'));this['ringtime']=utils['getSeconds'](_0x1478ff[_0x5376('0x16')],_0x1478ff[_0x5376('0x15')]);this[_0x5376('0x1a')]=0x0;this[_0x5376('0x1b')]=utils[_0x5376('0x1c')](this[_0x5376('0x17')],_0x1478ff[_0x5376('0x16')]);this[_0x5376('0x1d')]=_0x1478ff[_0x5376('0x1d')];this[_0x5376('0x1e')]=_0x5376('0x1f');this['reason']=_0xc0cf4f[_0x5376('0x20')];this['callback']=_0x1478ff[_0x5376('0x21')];this[_0x5376('0x22')]=_0x1478ff['callbackuniqueid'];this[_0x5376('0x23')]=_0x1478ff[_0x5376('0x23')];this[_0x5376('0x24')]=_0x1478ff[_0x5376('0x24')];this[_0x5376('0x25')]=_0x1478ff[_0x5376('0x25')];this[_0x5376('0x26')]=_0x1478ff['ListId'];this[_0x5376('0x27')]=_0x1478ff['UserId'];this[_0x5376('0x28')]=_0x1478ff['VoiceQueueId'];this[_0x5376('0x29')]=_0x1478ff[_0x5376('0x29')];}module[_0x5376('0x2a')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 00bab20..7b460e7 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x26ab=['scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','number','starttime','responsetime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid'];(function(_0xc1411,_0x5081b9){var _0x806c50=function(_0x196f65){while(--_0x196f65){_0xc1411['push'](_0xc1411['shift']());}};_0x806c50(++_0x5081b9);}(_0x26ab,0x117));var _0xb26a=function(_0x6cbc20,_0x4ad188){_0x6cbc20=_0x6cbc20-0x0;var _0x1b09e5=_0x26ab[_0x6cbc20];return _0x1b09e5;};'use strict';var utils=require('../utils');function History(_0x29ca79){this[_0xb26a('0x0')]=_0x29ca79['uniqueid'];this[_0xb26a('0x1')]=_0x29ca79[_0xb26a('0x1')]||undefined;this[_0xb26a('0x2')]=_0x29ca79[_0xb26a('0x2')];this[_0xb26a('0x3')]=_0x29ca79[_0xb26a('0x2')]===_0xb26a('0x4')?_0xb26a('0x5'):_0x29ca79['type'];this[_0xb26a('0x6')]=_0x29ca79[_0xb26a('0x6')];this['countcongestionretry']=_0x29ca79[_0xb26a('0x7')];this[_0xb26a('0x8')]=_0x29ca79[_0xb26a('0x8')];this[_0xb26a('0x9')]=_0x29ca79[_0xb26a('0x6')]+_0x29ca79[_0xb26a('0x7')]+_0x29ca79[_0xb26a('0x8')]+_0x29ca79[_0xb26a('0xa')]+_0x29ca79[_0xb26a('0xb')]+_0x29ca79['countabandonedretry']+_0x29ca79[_0xb26a('0xc')]+_0x29ca79[_0xb26a('0xd')];this[_0xb26a('0xa')]=_0x29ca79['countnosuchnumberretry'];this[_0xb26a('0xb')]=_0x29ca79[_0xb26a('0xb')];this[_0xb26a('0xe')]=_0x29ca79['countabandonedretry'];this['countmachineretry']=_0x29ca79[_0xb26a('0xc')];this['countagentrejectretry']=_0x29ca79['countagentrejectretry'];this['queue']=_0x29ca79[_0xb26a('0x5')];this[_0xb26a('0xf')]=_0x29ca79['name'];this['calleridnum']=_0x29ca79[_0xb26a('0x10')];this[_0xb26a('0x11')]=_0x29ca79[_0xb26a('0x11')];this[_0xb26a('0x12')]=_0x29ca79['responsetime'];this['endtime']=_0x29ca79[_0xb26a('0x12')];this['ringtime']=utils['getSeconds'](_0x29ca79['responsetime'],_0x29ca79[_0xb26a('0x11')]);this[_0xb26a('0x13')]=0x0;this[_0xb26a('0x14')]=0x0;this[_0xb26a('0x15')]=_0x29ca79[_0xb26a('0x15')];this[_0xb26a('0x16')]=_0x29ca79[_0xb26a('0x16')];this['callbackat']=_0x29ca79[_0xb26a('0x17')];this[_0xb26a('0x18')]=_0x29ca79[_0xb26a('0x18')];this['ContactId']=_0x29ca79[_0xb26a('0x19')];this[_0xb26a('0x1a')]=_0x29ca79[_0xb26a('0x1a')];this[_0xb26a('0x1b')]=_0x29ca79[_0xb26a('0x1b')];this['VoiceQueueId']=_0x29ca79[_0xb26a('0x1c')];this[_0xb26a('0x1d')]=_0x29ca79[_0xb26a('0x1d')];this[_0xb26a('0x1e')]=_0x29ca79[_0xb26a('0x1e')]||'';this[_0xb26a('0x1f')]=_0x29ca79[_0xb26a('0x1f')]||'';this[_0xb26a('0x20')]=_0x29ca79[_0xb26a('0x20')];this[_0xb26a('0x21')]=_0x29ca79[_0xb26a('0x21')];}module[_0xb26a('0x22')]=History; \ No newline at end of file +var _0x46f2=['countglobal','countbusyretry','countdropretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','countmachineretry','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','scheduledat','campaigntype','type','queue','countcongestionretry','countnoanswerretry'];(function(_0x149d1e,_0x353a03){var _0x3125c6=function(_0x2349e3){while(--_0x2349e3){_0x149d1e['push'](_0x149d1e['shift']());}};_0x3125c6(++_0x353a03);}(_0x46f2,0x1b6));var _0x246f=function(_0x143b9a,_0x23a500){_0x143b9a=_0x143b9a-0x0;var _0x204b8d=_0x46f2[_0x143b9a];return _0x204b8d;};'use strict';var utils=require('../utils');function History(_0x2590f1){this['uniqueid']=_0x2590f1['uniqueid'];this['scheduledat']=_0x2590f1[_0x246f('0x0')]||undefined;this['type']=_0x2590f1['type'];this[_0x246f('0x1')]=_0x2590f1[_0x246f('0x2')]==='outbound'?_0x246f('0x3'):_0x2590f1['type'];this['countbusyretry']=_0x2590f1['countbusyretry'];this['countcongestionretry']=_0x2590f1[_0x246f('0x4')];this[_0x246f('0x5')]=_0x2590f1[_0x246f('0x5')];this[_0x246f('0x6')]=_0x2590f1[_0x246f('0x7')]+_0x2590f1[_0x246f('0x4')]+_0x2590f1[_0x246f('0x5')]+_0x2590f1['countnosuchnumberretry']+_0x2590f1[_0x246f('0x8')]+_0x2590f1['countabandonedretry']+_0x2590f1['countmachineretry']+_0x2590f1[_0x246f('0x9')];this[_0x246f('0xa')]=_0x2590f1['countnosuchnumberretry'];this[_0x246f('0x8')]=_0x2590f1[_0x246f('0x8')];this['countabandonedretry']=_0x2590f1[_0x246f('0xb')];this[_0x246f('0xc')]=_0x2590f1['countmachineretry'];this[_0x246f('0x9')]=_0x2590f1[_0x246f('0x9')];this[_0x246f('0x3')]=_0x2590f1[_0x246f('0x3')];this[_0x246f('0xd')]=_0x2590f1['name'];this[_0x246f('0xe')]=_0x2590f1[_0x246f('0xf')];this[_0x246f('0x10')]=_0x2590f1[_0x246f('0x10')];this[_0x246f('0x11')]=_0x2590f1['responsetime'];this[_0x246f('0x12')]=_0x2590f1[_0x246f('0x11')];this[_0x246f('0x13')]=utils[_0x246f('0x14')](_0x2590f1[_0x246f('0x11')],_0x2590f1['starttime']);this[_0x246f('0x15')]=0x0;this[_0x246f('0x16')]=0x0;this[_0x246f('0x17')]=_0x2590f1['callback'];this[_0x246f('0x18')]=_0x2590f1[_0x246f('0x18')];this[_0x246f('0x19')]=_0x2590f1[_0x246f('0x19')];this[_0x246f('0x1a')]=_0x2590f1['recallme'];this[_0x246f('0x1b')]=_0x2590f1[_0x246f('0x1b')];this[_0x246f('0x1c')]=_0x2590f1[_0x246f('0x1c')];this[_0x246f('0x1d')]=_0x2590f1[_0x246f('0x1d')];this[_0x246f('0x1e')]=_0x2590f1['VoiceQueueId'];this[_0x246f('0x1f')]=_0x2590f1[_0x246f('0x1f')];this[_0x246f('0x20')]=_0x2590f1[_0x246f('0x20')]||'';this[_0x246f('0x21')]=_0x2590f1[_0x246f('0x21')]||'';this[_0x246f('0x22')]=_0x2590f1[_0x246f('0x22')];this['statedesc']=_0x2590f1[_0x246f('0x23')];}module[_0x246f('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index f0e73bb..3f0cf55 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa0ec=['countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','holdtime','talktime','membername','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','../utils','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x2335ee,_0xa38a0d){var _0x153073=function(_0x18a7fb){while(--_0x18a7fb){_0x2335ee['push'](_0x2335ee['shift']());}};_0x153073(++_0xa38a0d);}(_0xa0ec,0x1e1));var _0xca0e=function(_0x39f5ac,_0x4e8a00){_0x39f5ac=_0x39f5ac-0x0;var _0x1ffa28=_0xa0ec[_0x39f5ac];return _0x1ffa28;};'use strict';var utils=require(_0xca0e('0x0'));function QueueCallerAbandon(_0x508ed5,_0x41acd3){this[_0xca0e('0x1')]=_0x508ed5['scheduledat'];this[_0xca0e('0x2')]=_0x508ed5[_0xca0e('0x2')];this['campaigntype']=_0x508ed5[_0xca0e('0x2')]===_0xca0e('0x3')?_0xca0e('0x4'):_0x508ed5[_0xca0e('0x2')];this[_0xca0e('0x5')]=_0x508ed5[_0xca0e('0x5')];this[_0xca0e('0x6')]=_0x508ed5[_0xca0e('0x6')];this[_0xca0e('0x7')]=_0x508ed5[_0xca0e('0x7')];this[_0xca0e('0x8')]=_0x508ed5[_0xca0e('0x5')]+_0x508ed5[_0xca0e('0x6')]+_0x508ed5[_0xca0e('0x7')]+_0x508ed5[_0xca0e('0x9')]+_0x508ed5[_0xca0e('0xa')]+_0x508ed5[_0xca0e('0xb')]+_0x508ed5[_0xca0e('0xc')]+_0x508ed5[_0xca0e('0xd')];this['countnosuchnumberretry']=_0x508ed5[_0xca0e('0x9')];this[_0xca0e('0xa')]=_0x508ed5['countdropretry'];this[_0xca0e('0xb')]=_0x508ed5[_0xca0e('0xb')];this[_0xca0e('0xc')]=_0x508ed5[_0xca0e('0xc')];this[_0xca0e('0xd')]=_0x508ed5[_0xca0e('0xd')];this[_0xca0e('0xe')]=_0x41acd3[_0xca0e('0xe')];this['calleridname']=_0x508ed5[_0xca0e('0xf')];this[_0xca0e('0x10')]=_0x508ed5[_0xca0e('0x11')];this[_0xca0e('0x12')]=_0x508ed5[_0xca0e('0x12')];this[_0xca0e('0x13')]=_0x508ed5[_0xca0e('0x13')];this[_0xca0e('0x14')]=_0x508ed5[_0xca0e('0x14')];this[_0xca0e('0x15')]=_0x508ed5['dropreason'];this[_0xca0e('0x16')]=this[_0xca0e('0x14')];this[_0xca0e('0x17')]=utils[_0xca0e('0x18')](_0x508ed5[_0xca0e('0x13')],_0x508ed5[_0xca0e('0x12')]);this[_0xca0e('0x19')]=utils[_0xca0e('0x18')](this[_0xca0e('0x14')],_0x508ed5[_0xca0e('0x13')]);this[_0xca0e('0x1a')]=0x0;this[_0xca0e('0x4')]=_0x41acd3[_0xca0e('0x4')];this[_0xca0e('0x1b')]=_0x41acd3['connectedlinename'];this['reason']=_0x41acd3['reason'];this[_0xca0e('0x1c')]=_0x508ed5[_0xca0e('0x1c')];this[_0xca0e('0x1d')]=_0x508ed5[_0xca0e('0x1d')];this[_0xca0e('0x1e')]=_0x508ed5[_0xca0e('0x1e')];this['recallme']=_0x508ed5['recallme'];this[_0xca0e('0x1f')]=_0x508ed5[_0xca0e('0x1f')];this[_0xca0e('0x20')]=_0x508ed5[_0xca0e('0x20')];this[_0xca0e('0x21')]=_0x508ed5[_0xca0e('0x21')];this[_0xca0e('0x22')]=_0x508ed5[_0xca0e('0x22')];this['CampaignId']=_0x508ed5[_0xca0e('0x23')];this['originatecalleridnum']=_0x508ed5[_0xca0e('0x24')]||'';this[_0xca0e('0x25')]=_0x508ed5[_0xca0e('0x25')]||'';this[_0xca0e('0x26')]=_0x508ed5[_0xca0e('0x26')];this[_0xca0e('0x27')]=_0x508ed5[_0xca0e('0x27')];this[_0xca0e('0x28')]=_0x508ed5['statedesc'];}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0x6b82=['membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','dropreason','endtime','getSeconds','holdtime','talktime'];(function(_0xd715ff,_0xf59490){var _0x165ef3=function(_0x32b3ef){while(--_0x32b3ef){_0xd715ff['push'](_0xd715ff['shift']());}};_0x165ef3(++_0xf59490);}(_0x6b82,0x119));var _0x26b8=function(_0x40570e,_0x53df30){_0x40570e=_0x40570e-0x0;var _0x16336a=_0x6b82[_0x40570e];return _0x16336a;};'use strict';var utils=require(_0x26b8('0x0'));function QueueCallerAbandon(_0x4faf69,_0x49cd94){this[_0x26b8('0x1')]=_0x4faf69[_0x26b8('0x1')];this[_0x26b8('0x2')]=_0x4faf69['type'];this[_0x26b8('0x3')]=_0x4faf69['type']===_0x26b8('0x4')?_0x26b8('0x5'):_0x4faf69['type'];this[_0x26b8('0x6')]=_0x4faf69[_0x26b8('0x6')];this['countcongestionretry']=_0x4faf69['countcongestionretry'];this[_0x26b8('0x7')]=_0x4faf69['countnoanswerretry'];this[_0x26b8('0x8')]=_0x4faf69[_0x26b8('0x6')]+_0x4faf69[_0x26b8('0x9')]+_0x4faf69['countnoanswerretry']+_0x4faf69[_0x26b8('0xa')]+_0x4faf69['countdropretry']+_0x4faf69[_0x26b8('0xb')]+_0x4faf69[_0x26b8('0xc')]+_0x4faf69[_0x26b8('0xd')];this[_0x26b8('0xa')]=_0x4faf69['countnosuchnumberretry'];this[_0x26b8('0xe')]=_0x4faf69[_0x26b8('0xe')];this['countabandonedretry']=_0x4faf69[_0x26b8('0xb')];this[_0x26b8('0xc')]=_0x4faf69[_0x26b8('0xc')];this['countagentrejectretry']=_0x4faf69['countagentrejectretry'];this[_0x26b8('0xf')]=_0x49cd94[_0x26b8('0xf')];this[_0x26b8('0x10')]=_0x4faf69[_0x26b8('0x11')];this[_0x26b8('0x12')]=_0x4faf69['number'];this[_0x26b8('0x13')]=_0x4faf69[_0x26b8('0x13')];this['responsetime']=_0x4faf69[_0x26b8('0x14')];this[_0x26b8('0x15')]=_0x4faf69[_0x26b8('0x15')];this[_0x26b8('0x16')]=_0x4faf69['dropreason'];this[_0x26b8('0x17')]=this[_0x26b8('0x15')];this['ringtime']=utils[_0x26b8('0x18')](_0x4faf69[_0x26b8('0x14')],_0x4faf69[_0x26b8('0x13')]);this[_0x26b8('0x19')]=utils['getSeconds'](this[_0x26b8('0x15')],_0x4faf69[_0x26b8('0x14')]);this[_0x26b8('0x1a')]=0x0;this[_0x26b8('0x5')]=_0x49cd94[_0x26b8('0x5')];this[_0x26b8('0x1b')]=_0x49cd94[_0x26b8('0x1c')];this[_0x26b8('0x1d')]=_0x49cd94['reason'];this[_0x26b8('0x1e')]=_0x4faf69[_0x26b8('0x1e')];this[_0x26b8('0x1f')]=_0x4faf69[_0x26b8('0x1f')];this['callbackat']=_0x4faf69[_0x26b8('0x20')];this[_0x26b8('0x21')]=_0x4faf69[_0x26b8('0x21')];this['ContactId']=_0x4faf69[_0x26b8('0x22')];this[_0x26b8('0x23')]=_0x4faf69[_0x26b8('0x23')];this['UserId']=_0x4faf69[_0x26b8('0x24')];this['VoiceQueueId']=_0x4faf69[_0x26b8('0x25')];this['CampaignId']=_0x4faf69['CampaignId'];this[_0x26b8('0x26')]=_0x4faf69[_0x26b8('0x26')]||'';this[_0x26b8('0x27')]=_0x4faf69[_0x26b8('0x27')]||'';this[_0x26b8('0x28')]=_0x4faf69[_0x26b8('0x28')];this['state']=_0x4faf69[_0x26b8('0x29')];this[_0x26b8('0x2a')]=_0x4faf69['statedesc'];}module[_0x26b8('0x2b')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 9a210c8..7df0bf6 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c09=['[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]','[verifyAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','../../../../config/logger','dialer','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','catch','temp','error','[getContactDialer]','getContactDialerIvr','dialOrderByScheduledAt'];(function(_0x55beeb,_0x2b5715){var _0x2bd563=function(_0xd565d){while(--_0xd565d){_0x55beeb['push'](_0x55beeb['shift']());}};_0x2bd563(++_0x2b5715);}(_0x7c09,0x102));var _0x97c0=function(_0x56b8ee,_0x3ceca0){_0x56b8ee=_0x56b8ee-0x0;var _0x2d1188=_0x7c09[_0x56b8ee];return _0x2d1188;};'use strict';var util=require('util');var logger=require(_0x97c0('0x0'))(_0x97c0('0x1'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require(_0x97c0('0x2'));var cmHopperBlack=require(_0x97c0('0x3'));var cmHopperHistory=require(_0x97c0('0x4'));function inspectError(_0x214897){return util[_0x97c0('0x5')](_0x214897,{'showHidden':![],'depth':null});}function getContactDialer(_0x99bf54,_0x15c67b,_0x4a7788){return cmHopper['getContactDialer'](_0x99bf54['id'],_0x15c67b,_0x4a7788,_0x99bf54['dialOrderByScheduledAt'])[_0x97c0('0x6')](function(_0x42c6c7){_0x99bf54[_0x97c0('0x7')]=0x0;logger[_0x97c0('0x8')](_0x97c0('0x9'),inspectError(_0x42c6c7));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x205520,_0x4ac5f1){return cmHopper[_0x97c0('0xa')](_0x205520['id'],_0x4ac5f1,_0x205520[_0x97c0('0xb')])['catch'](function(_0x50412f){_0x205520[_0x97c0('0x7')]=0x0;logger[_0x97c0('0x8')](_0x97c0('0xc'),inspectError(_0x50412f));});}exports[_0x97c0('0xa')]=getContactDialerIvr;function countReScheduled(_0x346e34){return cmHopper[_0x97c0('0xd')](_0x346e34)[_0x97c0('0x6')](function(_0x39a3b4){logger[_0x97c0('0x8')](_0x97c0('0xe'),inspectError(_0x39a3b4));});}exports[_0x97c0('0xd')]=countReScheduled;function rescheduleContact(_0x132865){return cmHopper[_0x97c0('0xf')](_0x132865)['catch'](function(_0x3f2fc2){logger[_0x97c0('0x8')](_0x97c0('0x10'),inspectError(_0x3f2fc2));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0x42027d,_0x9ca6a8,_0x379951){return cmHopper[_0x97c0('0x11')](_0x42027d,_0x9ca6a8,_0x379951)[_0x97c0('0x6')](function(_0x13d46e){logger['error'](_0x97c0('0x12'),inspectError(_0x13d46e));});}exports[_0x97c0('0x11')]=unlockContact;function moveContactManagedDialer(_0x51180e){return cmHopper[_0x97c0('0x13')](_0x51180e)[_0x97c0('0x6')](function(_0x179d43){logger[_0x97c0('0x8')](_0x97c0('0x14'),inspectError(_0x179d43));});}exports[_0x97c0('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x4fed42){return cmHopperBlack[_0x97c0('0x15')](_0x4fed42)[_0x97c0('0x6')](function(_0x323863){logger['error']('[checkIsBlackList]',inspectError(_0x323863));});}exports[_0x97c0('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0xa3f59d){return cmHopperBlack[_0x97c0('0x16')](_0xa3f59d)['catch'](function(_0x13a6c9){logger[_0x97c0('0x8')](_0x97c0('0x17'),inspectError(_0x13a6c9));});}exports[_0x97c0('0x16')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x30fba2,_0x3a0bfb,_0x9dff60){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x30fba2,_0x3a0bfb,_0x9dff60)[_0x97c0('0x6')](function(_0x29b3aa){logger[_0x97c0('0x8')](_0x97c0('0x18'),inspectError(_0x29b3aa));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x2bda6c,_0x14cada,_0x52a429){return cmHopperAdditionalPhone[_0x97c0('0x19')](_0x2bda6c,_0x14cada,_0x52a429)[_0x97c0('0x6')](function(_0x447316){logger['error']('[swapAdditionalPhone]',inspectError(_0x447316));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x11b8ad){return cmHopperHistory[_0x97c0('0x1a')](_0x11b8ad)[_0x97c0('0x6')](function(_0x225e43){logger[_0x97c0('0x8')](_0x97c0('0x1b'),inspectError(_0x225e43));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x10e47e){return cmHopperHistory[_0x97c0('0x1c')](_0x10e47e)[_0x97c0('0x6')](function(_0x4ad645){logger[_0x97c0('0x8')](_0x97c0('0x1d'),inspectError(_0x4ad645));});}exports[_0x97c0('0x1c')]=createHistory; \ No newline at end of file +var _0x7880=['checkIsBlackListIvr','[verifyAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','getContactDialerIvr','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','moveContactManagedDialer','checkIsBlackList'];(function(_0x2567f0,_0x4fa60){var _0x14852a=function(_0x55b95f){while(--_0x55b95f){_0x2567f0['push'](_0x2567f0['shift']());}};_0x14852a(++_0x4fa60);}(_0x7880,0x1f4));var _0x0788=function(_0x3d7af5,_0x308d72){_0x3d7af5=_0x3d7af5-0x0;var _0x11b446=_0x7880[_0x3d7af5];return _0x11b446;};'use strict';var util=require('util');var logger=require(_0x0788('0x0'))(_0x0788('0x1'));var cmHopper=require(_0x0788('0x2'));var cmHopperAdditionalPhone=require(_0x0788('0x3'));var cmHopperBlack=require(_0x0788('0x4'));var cmHopperHistory=require(_0x0788('0x5'));function inspectError(_0x5c29f7){return util[_0x0788('0x6')](_0x5c29f7,{'showHidden':![],'depth':null});}function getContactDialer(_0x1e0814,_0x317885,_0xd53e7d){return cmHopper[_0x0788('0x7')](_0x1e0814['id'],_0x317885,_0xd53e7d,_0x1e0814[_0x0788('0x8')])[_0x0788('0x9')](function(_0x44bbb5){_0x1e0814[_0x0788('0xa')]=0x0;logger[_0x0788('0xb')]('[getContactDialer]',inspectError(_0x44bbb5));});}exports[_0x0788('0x7')]=getContactDialer;function getContactDialerIvr(_0x49f53b,_0xabaf81){return cmHopper['getContactDialerIvr'](_0x49f53b['id'],_0xabaf81,_0x49f53b[_0x0788('0x8')])[_0x0788('0x9')](function(_0x1f9ff6){_0x49f53b[_0x0788('0xa')]=0x0;logger[_0x0788('0xb')]('[getContactDialerIvr]',inspectError(_0x1f9ff6));});}exports[_0x0788('0xc')]=getContactDialerIvr;function countReScheduled(_0x37560d){return cmHopper[_0x0788('0xd')](_0x37560d)[_0x0788('0x9')](function(_0x311729){logger[_0x0788('0xb')](_0x0788('0xe'),inspectError(_0x311729));});}exports['countReScheduled']=countReScheduled;function rescheduleContact(_0xcaa0e9){return cmHopper[_0x0788('0xf')](_0xcaa0e9)[_0x0788('0x9')](function(_0x13cf07){logger['error'](_0x0788('0x10'),inspectError(_0x13cf07));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0x195f14,_0x170d56,_0x3fd1e4){return cmHopper[_0x0788('0x11')](_0x195f14,_0x170d56,_0x3fd1e4)[_0x0788('0x9')](function(_0x430e34){logger['error']('[unlockContact]',inspectError(_0x430e34));});}exports[_0x0788('0x11')]=unlockContact;function moveContactManagedDialer(_0x461d9d){return cmHopper['moveContactManagedDialer'](_0x461d9d)[_0x0788('0x9')](function(_0x415f19){logger[_0x0788('0xb')]('[moveContactManagedDialer]',inspectError(_0x415f19));});}exports[_0x0788('0x12')]=moveContactManagedDialer;function checkIsBlackList(_0x3fb723){return cmHopperBlack['checkIsBlackList'](_0x3fb723)[_0x0788('0x9')](function(_0x5173d6){logger[_0x0788('0xb')]('[checkIsBlackList]',inspectError(_0x5173d6));});}exports[_0x0788('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x3c37ca){return cmHopperBlack[_0x0788('0x14')](_0x3c37ca)[_0x0788('0x9')](function(_0x3aa142){logger['error']('[checkIsBlackListIvr]',inspectError(_0x3aa142));});}exports[_0x0788('0x14')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x2a1460,_0x645320,_0x7a99a1){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x2a1460,_0x645320,_0x7a99a1)['catch'](function(_0x79204e){logger[_0x0788('0xb')](_0x0788('0x15'),inspectError(_0x79204e));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x4b2693,_0x240459,_0xa1f7dc){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x4b2693,_0x240459,_0xa1f7dc)['catch'](function(_0x5a54a5){logger[_0x0788('0xb')]('[swapAdditionalPhone]',inspectError(_0x5a54a5));});}exports[_0x0788('0x16')]=swapAdditionalPhones;function avgHandleTime(_0x40e7a6){return cmHopperHistory[_0x0788('0x17')](_0x40e7a6)[_0x0788('0x9')](function(_0xf9ba32){logger[_0x0788('0xb')](_0x0788('0x18'),inspectError(_0xf9ba32));});}exports[_0x0788('0x17')]=avgHandleTime;function createHistory(_0x5b7594){return cmHopperHistory['createHistory'](_0x5b7594)[_0x0788('0x9')](function(_0x40d345){logger['error']('[createHistory]',inspectError(_0x40d345));});}exports[_0x0788('0x19')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index ddff7ed..59a019b 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7414=['TrunkBackup','status','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','replace','random','getCallerIdRandom','error','length','erlangb','checkContactLowerLimitOriginate','updatedAt','description','XMD-','toUpperCase','toString','substring','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','RECALLINQUEUE','RUNNING','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','preview','type','ivr','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','Interval','Intervals','NULL_INTERVAL','dialGlobalInterval','isEmpty','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes'];(function(_0x532bfe,_0x2a2b78){var _0x5ee74e=function(_0x163d58){while(--_0x163d58){_0x532bfe['push'](_0x532bfe['shift']());}};_0x5ee74e(++_0x2a2b78);}(_0x7414,0x74));var _0x4741=function(_0x5cceb9,_0x312081){_0x5cceb9=_0x5cceb9-0x0;var _0x1157ef=_0x7414[_0x5cceb9];return _0x1157ef;};'use strict';var _=require(_0x4741('0x0'));var moment=require(_0x4741('0x1'));var util=require(_0x4741('0x2'));var logger=require(_0x4741('0x3'))(_0x4741('0x4'));var timezones=require(_0x4741('0x5'))[_0x4741('0x6')];var CAMPAIGN_STATUS={'ACTIVE':_0x4741('0x7'),'BLACKLIST':_0x4741('0x8'),'CONTACTS_RESCHEDULED':_0x4741('0x9'),'DEACTIVATED':'DEACTIVATED','DISACTIVED':_0x4741('0xa'),'EMPTY_INTERVAL':_0x4741('0xb'),'INACTIVE':_0x4741('0xc'),'NO_AGENTS_LOGGED':_0x4741('0xd'),'NO_AVAILABLE_CONTACTS':_0x4741('0xe'),'NULL_INTERVAL':_0x4741('0xf'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x4741('0x10'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':_0x4741('0x11'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0x4741('0x12')};exports[_0x4741('0x13')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x1640da){return _0x1640da['dialMethod']===_0x4741('0x14');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x35ab63){return _0x35ab63[_0x4741('0x15')]===_0x4741('0x16');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0xb1b9b7){return _0xb1b9b7['type']===_0x4741('0x17');}exports[_0x4741('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x3b34ff){return _0x3b34ff[_0x4741('0x19')];}exports[_0x4741('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0x1c9eaa){return _0x1c9eaa[_0x4741('0x1b')];}exports[_0x4741('0x1c')]=isIVRCampaignActive;function getSeconds(_0x2c47a6,_0x516344){var _0x4f8b15=moment(_0x2c47a6)[_0x4741('0x1d')](0x0);var _0x5d9927=moment(_0x516344)[_0x4741('0x1d')](0x0);return _0x4f8b15[_0x4741('0x1e')](_0x5d9927,'seconds');}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x3b50ac,_0x1597fa){var _0x2c1dcd=![];var _0x56df4c=_0x3b50ac['dialMethod']!==_0x1597fa['dialMethod']||_0x3b50ac[_0x4741('0x19')]!==_0x1597fa['dialActive']||_0x3b50ac['message']!==_0x1597fa[_0x4741('0x1f')];var _0x48694d=_0x3b50ac[_0x4741('0x20')]!==_0x1597fa['available']||_0x3b50ac[_0x4741('0x21')]!==_0x1597fa[_0x4741('0x21')]||_0x3b50ac[_0x4741('0x22')]!==_0x1597fa[_0x4741('0x22')]||_0x3b50ac[_0x4741('0x23')]!==_0x1597fa[_0x4741('0x23')]||_0x3b50ac[_0x4741('0x24')]!==_0x1597fa['talking']||_0x3b50ac['pTalking']!==_0x1597fa[_0x4741('0x25')]||_0x3b50ac[_0x4741('0x26')]!==_0x1597fa[_0x4741('0x26')]||_0x3b50ac[_0x4741('0x27')]!==_0x1597fa[_0x4741('0x27')]||_0x3b50ac[_0x4741('0x28')]!==_0x1597fa[_0x4741('0x28')];if(_0x3b50ac[_0x4741('0x29')]&&_0x1597fa[_0x4741('0x29')]){_0x2c1dcd=_0x3b50ac[_0x4741('0x29')][_0x4741('0x2a')]!==_0x1597fa[_0x4741('0x29')][_0x4741('0x2a')]||_0x3b50ac[_0x4741('0x29')]['active']!==_0x1597fa['Trunk'][_0x4741('0x1b')];}return _0x56df4c||_0x48694d||_0x2c1dcd;}exports[_0x4741('0x2b')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x5a264f){var _0x397697=null;var _0x1b3e44=_0x5a264f[_0x4741('0x2c')];if(_[_0x4741('0x2d')](_0x5a264f['dialGlobalInterval'])||_[_0x4741('0x2d')](_0x5a264f[_0x4741('0x2e')])||_[_0x4741('0x2d')](_0x5a264f[_0x4741('0x2e')][_0x4741('0x2f')])){_0x397697=CAMPAIGN_STATUS[_0x4741('0x30')];}else if(_['isEmpty'](_0x5a264f[_0x4741('0x31')])||_[_0x4741('0x32')](_0x5a264f['Interval']['Intervals'])){_0x397697=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x1b3e44&&!timezones[_0x1b3e44]){_0x397697=CAMPAIGN_STATUS[_0x4741('0x33')];}return _0x397697;}function checkAnyValidTrunk(_0x237b08,_0x3c845e){var _0x419bf1=null;var _0x1a65f8=_0x4741('0x34');var _0x995532=[_0x4741('0x35'),_0x4741('0x36')];var _0x5e444f=!![];if(_0x237b08[_0x4741('0x29')]&&_0x237b08[_0x4741('0x29')][_0x4741('0x1b')]){_0x1a65f8+=_0x237b08[_0x4741('0x29')][_0x4741('0x2a')];_0x419bf1=_0x3c845e[_0x1a65f8];_0x5e444f=_0x995532[_0x4741('0x37')](_0x419bf1['status']);}else if(_0x237b08[_0x4741('0x38')]&&_0x237b08[_0x4741('0x38')][_0x4741('0x1b')]){_0x1a65f8+=_0x237b08[_0x4741('0x38')]['name'];_0x419bf1=_0x3c845e[_0x1a65f8];_0x5e444f=_0x995532[_0x4741('0x37')](_0x419bf1[_0x4741('0x39')]);}return _0x5e444f;}function getQueueCampaignStatusMessage(_0x23d50d,_0x2f552e){var _0x41822c=CAMPAIGN_STATUS['ACTIVE'];var _0x19265b=isPreviewCampaign(_0x23d50d);if(!isQueueCampaignActive(_0x23d50d)){if(_0x19265b){_0x41822c=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x23d50d[_0x4741('0x28')]===0x0&&_0x23d50d[_0x4741('0x24')]===0x0&&_0x23d50d[_0x4741('0x26')]===0x0&&(_0x23d50d[_0x4741('0x25')]||0x0)===0x0){_0x41822c=CAMPAIGN_STATUS[_0x4741('0x3a')];}else{_0x41822c=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x23d50d['loggedIn']===0x0){_0x41822c=CAMPAIGN_STATUS[_0x4741('0x3b')];}else if(!checkAnyValidTrunk(_0x23d50d,_0x2f552e)){_0x41822c=CAMPAIGN_STATUS[_0x4741('0x3c')];}else if(!isPreviewCampaign(_0x23d50d)){var _0x590a42=checkAnyValidQueueCampaignInterval(_0x23d50d);if(_0x590a42){_0x41822c=_0x590a42;}}return _0x41822c;}exports[_0x4741('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x41b08a){var _0x58b9d0=CAMPAIGN_STATUS['DISACTIVED'];if(_0x41b08a['originated']===0x0&&_0x41b08a[_0x4741('0x24')]===0x0&&_0x41b08a[_0x4741('0x26')]===0x0&&(_0x41b08a[_0x4741('0x25')]||0x0)===0x0){_0x58b9d0=CAMPAIGN_STATUS[_0x4741('0x3a')];}return _0x58b9d0;}exports[_0x4741('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x3c5d12){var _0x468462=_0x3c5d12[_0x4741('0x3f')](/"(.*?)"/);return _0x468462?_0x468462[0x1]:_0x3c5d12;}exports[_0x4741('0x40')]=extractCalleridName;function getCallerId(_0x3ece0a,_0xe07415,_0x47ca33){if(!_[_0x4741('0x41')](_0x47ca33)&&typeof _0x47ca33==='string'&&!_[_0x4741('0x32')](_0x47ca33)){if(!_[_0x4741('0x41')](_0xe07415)&&typeof _0xe07415===_0x4741('0x42')&&!_[_0x4741('0x32')](_0xe07415)){return util[_0x4741('0x43')](_0x4741('0x44'),_0xe07415,_0x47ca33);}return util[_0x4741('0x43')]('\x22%s\x22\x20<%s>',_0x47ca33,_0x47ca33);}if(!_[_0x4741('0x41')](_0x3ece0a)&&typeof _0x3ece0a===_0x4741('0x42')&&!_[_0x4741('0x32')](_0x3ece0a)){return _0x3ece0a;}return'\x22\x22\x20<>';}exports[_0x4741('0x45')]=getCallerId;function getCallerIdRandom(_0x18af0d,_0x227307){var _0x4c4f44;var _0x52c8b0;var _0x50ae70;if(_0x227307<=0x0){_0x227307=0x1;}_0x4c4f44=new RegExp(_0x4741('0x46')+_0x227307+'}$');_0x52c8b0=Math['pow'](0xa,_0x227307-0x1);_0x50ae70=Math[_0x4741('0x47')](0xa,_0x227307)-0x1;return util[_0x4741('0x43')]('%s',_[_0x4741('0x48')](_0x18af0d,_0x4c4f44,_[_0x4741('0x49')](_0x52c8b0,_0x50ae70)['toString']()));}exports[_0x4741('0x4a')]=getCallerIdRandom;function decrementOriginate(_0x2b8e7a){if(_0x2b8e7a[_0x4741('0x28')]&&_0x2b8e7a[_0x4741('0x28')]>0x0){_0x2b8e7a['originated']-=0x1;}else{logger[_0x4741('0x4b')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x350655){return _0x350655&&_0x350655[_0x4741('0x4c')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x5b89ec,_0x288831){if(_0x288831===0x0){return 0x0;}var _0x1c0e7f=0x1;for(var _0x2449a5=0x1;_0x2449a5<=_0x288831;_0x2449a5+=0x1){_0x1c0e7f=0x1+_0x1c0e7f*_0x2449a5/_0x5b89ec;}return 0x1/_0x1c0e7f;}exports[_0x4741('0x4d')]=erlangb;function checkContactLowerLimitOriginate(_0x29f321,_0x5422de,_0x3f2415){if(_0x5422de>_0x3f2415){for(var _0x4b246e=0x0;_0x4b246e<_0x5422de-_0x3f2415;_0x4b246e+=0x1){decrementOriginate(_0x29f321);}}}exports[_0x4741('0x4e')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x4a33d9){var _0x44069f={};var _0x2b9daa=['id','createdAt','tags',_0x4741('0x4f')];const _0x4653cb=0xfa;if(_0x4a33d9){for(var _0x39d2ea in _0x4a33d9){if(typeof _0x4a33d9[_0x39d2ea]!=='undefined'){if(!_[_0x4741('0x2d')](_0x4a33d9[_0x39d2ea])&&!_0x2b9daa['includes'](_0x39d2ea)){if(_0x39d2ea===_0x4741('0x50')&&_0x4a33d9[_0x39d2ea][_0x4741('0x4c')]>_0x4653cb){_0x44069f[_0x4741('0x51')+_0x39d2ea[_0x4741('0x52')]()]=_0x4a33d9[_0x39d2ea][_0x4741('0x53')]()[_0x4741('0x54')](0x0,_0x4653cb);}else{_0x44069f[_0x4741('0x51')+_0x39d2ea[_0x4741('0x52')]()]=_0x4a33d9[_0x39d2ea];}}}}}return _0x44069f;}exports[_0x4741('0x55')]=setXMDContactVariables; \ No newline at end of file +var _0xe517=['erlangb','checkContactLowerLimitOriginate','tags','updatedAt','undefined','XMD-','toUpperCase','substring','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','type','ivr','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','dialGlobalInterval','isNil','Interval','NULL_INTERVAL','isEmpty','Intervals','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','reachable','unmonitored','status','TrunkBackup','includes','ACTIVE','INACTIVE','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','pow','replace','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty'];(function(_0x12fada,_0x5e000c){var _0x4650aa=function(_0x34168c){while(--_0x34168c){_0x12fada['push'](_0x12fada['shift']());}};_0x4650aa(++_0x5e000c);}(_0xe517,0x1c6));var _0x7e51=function(_0x4e15f6,_0x521296){_0x4e15f6=_0x4e15f6-0x0;var _0x57d6e6=_0xe517[_0x4e15f6];return _0x57d6e6;};'use strict';var _=require(_0x7e51('0x0'));var moment=require(_0x7e51('0x1'));var util=require(_0x7e51('0x2'));var logger=require(_0x7e51('0x3'))(_0x7e51('0x4'));var timezones=require(_0x7e51('0x5'))[_0x7e51('0x6')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x7e51('0x7'),'CONTACTS_RESCHEDULED':_0x7e51('0x8'),'DEACTIVATED':_0x7e51('0x9'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0x7e51('0xa'),'NO_AGENTS_LOGGED':_0x7e51('0xb'),'NO_AVAILABLE_CONTACTS':_0x7e51('0xc'),'NULL_INTERVAL':_0x7e51('0xd'),'OVERTIME_INTERVAL':_0x7e51('0xe'),'OVERTIME_GLOBAL_INTERVAL':_0x7e51('0xf'),'QUEUE_RECALL':_0x7e51('0x10'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0x7e51('0x11'),'UNREACHABLE_TRUNK':_0x7e51('0x12')};exports[_0x7e51('0x13')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x417cff){return _0x417cff[_0x7e51('0x14')]===_0x7e51('0x15');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x4ecec4){return _0x4ecec4[_0x7e51('0x16')]===_0x7e51('0x17');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x33b2a3){return _0x33b2a3[_0x7e51('0x16')]===_0x7e51('0x18');}exports[_0x7e51('0x19')]=isOutboundQueue;function isQueueCampaignActive(_0x391379){return _0x391379[_0x7e51('0x1a')];}exports[_0x7e51('0x1b')]=isQueueCampaignActive;function isIVRCampaignActive(_0x48ce26){return _0x48ce26[_0x7e51('0x1c')];}exports[_0x7e51('0x1d')]=isIVRCampaignActive;function getSeconds(_0x5ad0b1,_0x4aa229){var _0x37ccca=moment(_0x5ad0b1)[_0x7e51('0x1e')](0x0);var _0x143d7b=moment(_0x4aa229)[_0x7e51('0x1e')](0x0);return _0x37ccca[_0x7e51('0x1f')](_0x143d7b,_0x7e51('0x20'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x24f583,_0x38e323){var _0xf488f2=![];var _0x36d961=_0x24f583[_0x7e51('0x14')]!==_0x38e323['dialMethod']||_0x24f583[_0x7e51('0x1a')]!==_0x38e323['dialActive']||_0x24f583[_0x7e51('0x21')]!==_0x38e323[_0x7e51('0x21')];var _0x3deaa1=_0x24f583[_0x7e51('0x22')]!==_0x38e323[_0x7e51('0x22')]||_0x24f583[_0x7e51('0x23')]!==_0x38e323[_0x7e51('0x23')]||_0x24f583[_0x7e51('0x24')]!==_0x38e323[_0x7e51('0x24')]||_0x24f583[_0x7e51('0x25')]!==_0x38e323['paused']||_0x24f583[_0x7e51('0x26')]!==_0x38e323[_0x7e51('0x26')]||_0x24f583[_0x7e51('0x27')]!==_0x38e323['pTalking']||_0x24f583[_0x7e51('0x28')]!==_0x38e323['waiting']||_0x24f583[_0x7e51('0x29')]!==_0x38e323[_0x7e51('0x29')]||_0x24f583[_0x7e51('0x2a')]!==_0x38e323[_0x7e51('0x2a')];if(_0x24f583['Trunk']&&_0x38e323[_0x7e51('0x2b')]){_0xf488f2=_0x24f583[_0x7e51('0x2b')]['name']!==_0x38e323['Trunk'][_0x7e51('0x2c')]||_0x24f583[_0x7e51('0x2b')][_0x7e51('0x1c')]!==_0x38e323[_0x7e51('0x2b')][_0x7e51('0x1c')];}return _0x36d961||_0x3deaa1||_0xf488f2;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x164ee0){var _0x4f183a=null;var _0x58bb32=_0x164ee0['dialTimezone'];if(_['isNil'](_0x164ee0[_0x7e51('0x2d')])||_[_0x7e51('0x2e')](_0x164ee0[_0x7e51('0x2f')])||_[_0x7e51('0x2e')](_0x164ee0['Interval']['Intervals'])){_0x4f183a=CAMPAIGN_STATUS[_0x7e51('0x30')];}else if(_[_0x7e51('0x31')](_0x164ee0[_0x7e51('0x2d')])||_[_0x7e51('0x31')](_0x164ee0[_0x7e51('0x2f')][_0x7e51('0x32')])){_0x4f183a=CAMPAIGN_STATUS[_0x7e51('0x33')];}else if(_0x58bb32&&!timezones[_0x58bb32]){_0x4f183a=CAMPAIGN_STATUS[_0x7e51('0x34')];}return _0x4f183a;}function checkAnyValidTrunk(_0x411b02,_0x1ee838){var _0x55d0a6=null;var _0x4ddd60='SIP/';var _0x2d166c=[_0x7e51('0x35'),_0x7e51('0x36')];var _0x349e45=!![];if(_0x411b02[_0x7e51('0x2b')]&&_0x411b02[_0x7e51('0x2b')]['active']){_0x4ddd60+=_0x411b02[_0x7e51('0x2b')][_0x7e51('0x2c')];_0x55d0a6=_0x1ee838[_0x4ddd60];_0x349e45=_0x2d166c['includes'](_0x55d0a6[_0x7e51('0x37')]);}else if(_0x411b02[_0x7e51('0x38')]&&_0x411b02['TrunkBackup'][_0x7e51('0x1c')]){_0x4ddd60+=_0x411b02[_0x7e51('0x38')][_0x7e51('0x2c')];_0x55d0a6=_0x1ee838[_0x4ddd60];_0x349e45=_0x2d166c[_0x7e51('0x39')](_0x55d0a6[_0x7e51('0x37')]);}return _0x349e45;}function getQueueCampaignStatusMessage(_0x1eaf22,_0x2404bf){var _0x1bc983=CAMPAIGN_STATUS[_0x7e51('0x3a')];var _0x53bd06=isPreviewCampaign(_0x1eaf22);if(!isQueueCampaignActive(_0x1eaf22)){if(_0x53bd06){_0x1bc983=CAMPAIGN_STATUS[_0x7e51('0x3b')];}else{if(_0x1eaf22[_0x7e51('0x2a')]===0x0&&_0x1eaf22[_0x7e51('0x26')]===0x0&&_0x1eaf22['waiting']===0x0&&(_0x1eaf22[_0x7e51('0x27')]||0x0)===0x0){_0x1bc983=CAMPAIGN_STATUS[_0x7e51('0x3b')];}else{_0x1bc983=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x1eaf22['loggedIn']===0x0){_0x1bc983=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x1eaf22,_0x2404bf)){_0x1bc983=CAMPAIGN_STATUS[_0x7e51('0x3c')];}else if(!isPreviewCampaign(_0x1eaf22)){var _0x28b889=checkAnyValidQueueCampaignInterval(_0x1eaf22);if(_0x28b889){_0x1bc983=_0x28b889;}}return _0x1bc983;}exports[_0x7e51('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x3bc71d){var _0x1ef1cf=CAMPAIGN_STATUS[_0x7e51('0x3e')];if(_0x3bc71d[_0x7e51('0x2a')]===0x0&&_0x3bc71d[_0x7e51('0x26')]===0x0&&_0x3bc71d[_0x7e51('0x28')]===0x0&&(_0x3bc71d[_0x7e51('0x27')]||0x0)===0x0){_0x1ef1cf=CAMPAIGN_STATUS['INACTIVE'];}return _0x1ef1cf;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x15ba68){var _0x37ec8e=_0x15ba68[_0x7e51('0x3f')](/"(.*?)"/);return _0x37ec8e?_0x37ec8e[0x1]:_0x15ba68;}exports[_0x7e51('0x40')]=extractCalleridName;function getCallerId(_0x3477ea,_0x2c5e0a,_0x1c3a1e){if(!_[_0x7e51('0x41')](_0x1c3a1e)&&typeof _0x1c3a1e===_0x7e51('0x42')&&!_[_0x7e51('0x31')](_0x1c3a1e)){if(!_[_0x7e51('0x41')](_0x2c5e0a)&&typeof _0x2c5e0a===_0x7e51('0x42')&&!_[_0x7e51('0x31')](_0x2c5e0a)){return util[_0x7e51('0x43')](_0x7e51('0x44'),_0x2c5e0a,_0x1c3a1e);}return util[_0x7e51('0x43')]('\x22%s\x22\x20<%s>',_0x1c3a1e,_0x1c3a1e);}if(!_['isUndefined'](_0x3477ea)&&typeof _0x3477ea==='string'&&!_['isEmpty'](_0x3477ea)){return _0x3477ea;}return _0x7e51('0x45');}exports[_0x7e51('0x46')]=getCallerId;function getCallerIdRandom(_0x1977a8,_0x5eddb9){var _0x655f72;var _0x2335cf;var _0x50130d;if(_0x5eddb9<=0x0){_0x5eddb9=0x1;}_0x655f72=new RegExp('\x5cw{0,'+_0x5eddb9+'}$');_0x2335cf=Math[_0x7e51('0x47')](0xa,_0x5eddb9-0x1);_0x50130d=Math[_0x7e51('0x47')](0xa,_0x5eddb9)-0x1;return util[_0x7e51('0x43')]('%s',_[_0x7e51('0x48')](_0x1977a8,_0x655f72,_['random'](_0x2335cf,_0x50130d)[_0x7e51('0x49')]()));}exports[_0x7e51('0x4a')]=getCallerIdRandom;function decrementOriginate(_0x3b38b1){if(_0x3b38b1[_0x7e51('0x2a')]&&_0x3b38b1[_0x7e51('0x2a')]>0x0){_0x3b38b1[_0x7e51('0x2a')]-=0x1;}else{logger[_0x7e51('0x4b')](_0x7e51('0x4c'));}}exports[_0x7e51('0x4d')]=decrementOriginate;function checkContactEmpty(_0x4d72bc){return _0x4d72bc&&_0x4d72bc[_0x7e51('0x4e')]>0x0;}exports[_0x7e51('0x4f')]=checkContactEmpty;function erlangb(_0x937c70,_0x3e2eb6){if(_0x3e2eb6===0x0){return 0x0;}var _0x1c90f1=0x1;for(var _0x478f0b=0x1;_0x478f0b<=_0x3e2eb6;_0x478f0b+=0x1){_0x1c90f1=0x1+_0x1c90f1*_0x478f0b/_0x937c70;}return 0x1/_0x1c90f1;}exports[_0x7e51('0x50')]=erlangb;function checkContactLowerLimitOriginate(_0x4e6b18,_0x11d90a,_0x1997f3){if(_0x11d90a>_0x1997f3){for(var _0x6b27b1=0x0;_0x6b27b1<_0x11d90a-_0x1997f3;_0x6b27b1+=0x1){decrementOriginate(_0x4e6b18);}}}exports[_0x7e51('0x51')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x46ce49){var _0xcf472={};var _0x301f8e=['id','createdAt',_0x7e51('0x52'),_0x7e51('0x53')];const _0x194813=0xfa;if(_0x46ce49){for(var _0x3369c6 in _0x46ce49){if(typeof _0x46ce49[_0x3369c6]!==_0x7e51('0x54')){if(!_[_0x7e51('0x2e')](_0x46ce49[_0x3369c6])&&!_0x301f8e[_0x7e51('0x39')](_0x3369c6)){if(_0x3369c6==='description'&&_0x46ce49[_0x3369c6][_0x7e51('0x4e')]>_0x194813){_0xcf472[_0x7e51('0x55')+_0x3369c6[_0x7e51('0x56')]()]=_0x46ce49[_0x3369c6]['toString']()[_0x7e51('0x57')](0x0,_0x194813);}else{_0xcf472[_0x7e51('0x55')+_0x3369c6[_0x7e51('0x56')]()]=_0x46ce49[_0x3369c6];}}}}}return _0xcf472;}exports[_0x7e51('0x58')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 0e2dc81..2edd3ca 100644 --- a/server/services/ami/fax/action.js +++ b/server/services/ami/fax/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x26158b,_0x15593e){var _0x413e2b=function(_0x304255){while(--_0x304255){_0x26158b['push'](_0x26158b['shift']());}};_0x413e2b(++_0x15593e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x23b2da,_0x2ed84b){var _0x756133=function(_0x33d33f){while(--_0x33d33f){_0x23b2da['push'](_0x23b2da['shift']());}};_0x756133(++_0x2ed84b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 8642f09..97ec0a4 100644 --- a/server/services/ami/fax/index.js +++ b/server/services/ami/fax/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5352=['create','parse','.pdf','application/pdf','then','notify','\x20notify\x20','stringify','catch','error','\x20receiveFax\x20','merge','pick','reason','AttachmentId','update','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','reachable','SIP/%s','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','fax','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Is\x20Valid','exports','util','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./rpcDb','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','context','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message'];(function(_0x507dd0,_0x44680f){var _0x186957=function(_0x28e894){while(--_0x28e894){_0x507dd0['push'](_0x507dd0['shift']());}};_0x186957(++_0x44680f);}(_0x5352,0x12c));var _0x2535=function(_0x1ad7fc,_0x444145){_0x1ad7fc=_0x1ad7fc-0x0;var _0x3bb433=_0x5352[_0x1ad7fc];return _0x3bb433;};'use strict';var util=require(_0x2535('0x0'));var _=require('lodash');var BPromise=require(_0x2535('0x1'));var uuid=require(_0x2535('0x2'));var moment=require(_0x2535('0x3'));var path=require(_0x2535('0x4'));var tiff2pdf=require(_0x2535('0x5'));var gs=require(_0x2535('0x6'));var logger=require(_0x2535('0x7'))('fax');var ami=require(_0x2535('0x8'));var rpcDb=require(_0x2535('0x9'));var Channel=require('./channel');var ut=require(_0x2535('0xa'));var Action=require(_0x2535('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x2535('0xc'));var faxMessage=require(_0x2535('0xd'));function Fax(_0x3d0770){this[_0x2535('0xe')]={};this['faxAccounts']=_0x3d0770[_0x2535('0xf')];this[_0x2535('0x10')]=_0x3d0770[_0x2535('0x10')];this['actions']={};ami['on']('newchannel',this[_0x2535('0x11')][_0x2535('0x12')](this));ami['on'](_0x2535('0x13'),this[_0x2535('0x14')]['bind'](this));ami['on'](_0x2535('0x15'),this[_0x2535('0x16')][_0x2535('0x12')](this));ami['on'](_0x2535('0x17'),this['syncNewExten']['bind'](this));ami['on'](_0x2535('0x18'),this[_0x2535('0x19')][_0x2535('0x12')](this));ami['on'](_0x2535('0x1a'),this[_0x2535('0x1b')][_0x2535('0x12')](this));ami['on'](_0x2535('0x1c'),this[_0x2535('0x1d')][_0x2535('0x12')](this));ami['on']('originateresponse',this[_0x2535('0x1e')][_0x2535('0x12')](this));}Fax[_0x2535('0x1f')][_0x2535('0x11')]=function(_0x34178a){if(_0x34178a[_0x2535('0x20')]==='from-voip-provider'){for(var _0x485128 in this[_0x2535('0xf')]){if(this[_0x2535('0xf')][_0x2535('0x21')](_0x485128)){if(_0x34178a[_0x2535('0x22')]===this[_0x2535('0xf')][_0x485128][_0x2535('0x23')]){this['channels'][_0x34178a['uniqueid']]={};this[_0x2535('0xe')][_0x34178a[_0x2535('0x24')]][_0x2535('0x25')]=_0x34178a[_0x2535('0x25')];this[_0x2535('0xe')][_0x34178a[_0x2535('0x24')]]['id']=this['faxAccounts'][_0x485128]['id'];this[_0x2535('0xe')][_0x34178a['uniqueid']][_0x2535('0x26')]=this[_0x2535('0xf')][_0x485128][_0x2535('0x26')];logger[_0x2535('0x27')](_0x34178a[_0x2535('0x24')],_0x2535('0x28'));}}}}if(this[_0x2535('0x29')][_0x34178a[_0x2535('0x24')]]){this[_0x2535('0xe')][_0x34178a[_0x2535('0x24')]]={};this[_0x2535('0xe')][_0x34178a['uniqueid']][_0x2535('0x25')]=_0x34178a[_0x2535('0x25')];logger['info'](_0x34178a[_0x2535('0x24')],_0x2535('0x28'));}};Fax[_0x2535('0x1f')][_0x2535('0x14')]=function(_0xd8c849){if(this['channels'][_0xd8c849[_0x2535('0x24')]]){for(var _0x141341 in _0xd8c849[_0x2535('0x2a')]){if(_0xd8c849[_0x2535('0x2a')]['hasOwnProperty'](_0x141341)){this['channels'][_0xd8c849[_0x2535('0x24')]][_0x141341]=_0xd8c849['value'];}}}};Fax[_0x2535('0x1f')][_0x2535('0x16')]=function(_0x26b64c){if(this[_0x2535('0xe')][_0x26b64c[_0x2535('0x24')]]){this[_0x2535('0xe')][_0x26b64c[_0x2535('0x24')]][_0x2535('0x2b')]=_0x26b64c[_0x2535('0x2b')];this[_0x2535('0xe')][_0x26b64c[_0x2535('0x24')]][_0x2535('0x2c')]=_0x26b64c[_0x2535('0x2c')];}};Fax[_0x2535('0x1f')]['syncNewExten']=function(_0x3488f7){if(this[_0x2535('0xe')][_0x3488f7[_0x2535('0x24')]]){for(var _0x5ac1ca in _0x3488f7['variable']){if(_0x3488f7[_0x2535('0x2a')][_0x2535('0x21')](_0x5ac1ca)){this[_0x2535('0xe')][_0x3488f7[_0x2535('0x24')]][_0x5ac1ca]=_0x3488f7['value'];}}}};Fax[_0x2535('0x1f')]['syncFaxStatus']=function(_0x4e07a8){if(this[_0x2535('0xe')][_0x4e07a8[_0x2535('0x24')]]){this[_0x2535('0xe')][_0x4e07a8[_0x2535('0x24')]][_0x2535('0x2d')]=_0x4e07a8[_0x2535('0x2d')];this[_0x2535('0xe')][_0x4e07a8['uniqueid']][_0x2535('0x2e')]=_0x4e07a8[_0x2535('0x2e')];this[_0x2535('0xe')][_0x4e07a8[_0x2535('0x24')]][_0x2535('0x23')]=_0x4e07a8['localstationid'];this[_0x2535('0xe')][_0x4e07a8[_0x2535('0x24')]][_0x2535('0x2f')]=_0x4e07a8[_0x2535('0x2f')];logger[_0x2535('0x27')](_0x4e07a8[_0x2535('0x24')],_0x2535('0x30'));}};Fax[_0x2535('0x1f')][_0x2535('0x1b')]=function(_0xd0eb05){var _0xf99355=this;if(this[_0x2535('0xe')][_0xd0eb05['uniqueid']]){var _0xeba365=this[_0x2535('0xe')][_0xd0eb05[_0x2535('0x24')]]['id'];this[_0x2535('0xe')][_0xd0eb05[_0x2535('0x24')]][_0x2535('0x31')]=_0xd0eb05['remotestationid'];this['channels'][_0xd0eb05[_0x2535('0x24')]][_0x2535('0x32')]=_0xd0eb05[_0x2535('0x32')];this[_0x2535('0xe')][_0xd0eb05[_0x2535('0x24')]][_0x2535('0x23')]=_0xd0eb05[_0x2535('0x23')];this[_0x2535('0xe')][_0xd0eb05[_0x2535('0x24')]][_0x2535('0x33')]=_0xd0eb05['resolution'];this[_0x2535('0xe')][_0xd0eb05['uniqueid']][_0x2535('0x34')]=_0xd0eb05[_0x2535('0x34')];this[_0x2535('0xe')][_0xd0eb05[_0x2535('0x24')]][_0x2535('0x2f')]=_0xd0eb05['filename'];this[_0x2535('0xe')][_0xd0eb05[_0x2535('0x24')]]['calleridnum']=_0xd0eb05[_0x2535('0x35')];if(this[_0x2535('0xe')][_0xd0eb05[_0x2535('0x24')]][_0x2535('0x32')]>0x0){tiff2pdf(_0xd0eb05[_0x2535('0x2f')],_0x2535('0x36'),function(_0x1c0afa){logger[_0x2535('0x27')](_0xd0eb05[_0x2535('0x24')],_0x2535('0x37'),_0x1c0afa[_0x2535('0x38')]);attachment[_0x2535('0x39')]({'name':path[_0x2535('0x3a')](_0xd0eb05['filename'])[_0x2535('0x26')],'basename':path[_0x2535('0x3a')](_0xd0eb05[_0x2535('0x2f')])[_0x2535('0x26')]+_0x2535('0x3b'),'type':_0x2535('0x3c')})[_0x2535('0x3d')](function(_0x15008c){faxAccount[_0x2535('0x3e')](_0xeba365,{'from':_0xd0eb05['calleridnum'],'mapKey':'fax','body':path[_0x2535('0x3a')](_0xd0eb05[_0x2535('0x2f')])[_0x2535('0x26')]+_0x2535('0x3b'),'AttachmentId':_0x15008c['id']})['catch'](function(_0x4e7bb3){logger['error'](_0xd0eb05[_0x2535('0x24')],_0x2535('0x3f'),JSON[_0x2535('0x40')](_0x4e7bb3));});})[_0x2535('0x41')](function(_0x2b6418){logger[_0x2535('0x42')](_0xd0eb05[_0x2535('0x24')],_0x2535('0x43'),JSON[_0x2535('0x40')](_0x2b6418));});});}logger[_0x2535('0x27')](_0xd0eb05[_0x2535('0x24')],_0x2535('0x43'));}};Fax[_0x2535('0x1f')]['syncOriginateResponse']=function(_0x524cc7){if(this[_0x2535('0x29')][_0x524cc7[_0x2535('0x24')]]){_[_0x2535('0x44')](this[_0x2535('0xe')][_0x524cc7[_0x2535('0x24')]],_[_0x2535('0x45')](_0x524cc7,['response',_0x2535('0x46')]));}};function updateStatus(_0x48228e){if(_0x48228e[_0x2535('0x47')]){faxMessage[_0x2535('0x48')](_0x48228e[_0x2535('0x47')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x2535('0x3d')](function(_0x5d62bc){ut['logger']('[Fax][Message][Error][Updated]',_0x5d62bc);})[_0x2535('0x41')](function(_0x1bfe87){ut[_0x2535('0x49')](_0x2535('0x4a'),_0x1bfe87);});}else{ut[_0x2535('0x49')](_0x2535('0x4b'));}}Fax[_0x2535('0x1f')]['updateStatus']=function(_0x59f909,_0x446716,_0x51dac1){var _0x36239d=this;var _0x32471e={};if(_0x446716){_0x32471e={'read':_0x446716};}else{_0x32471e={'failMessage':_0x51dac1};}if(this['actions'][_0x59f909][_0x2535('0x47')]){faxMessage[_0x2535('0x48')](this[_0x2535('0x29')][_0x59f909]['AttachmentId'],_0x32471e)[_0x2535('0x3d')](function(_0x591acc){ut[_0x2535('0x49')]('[Fax][Message][Updated]',_0x591acc);})[_0x2535('0x41')](function(_0x2d651f){ut[_0x2535('0x49')](_0x2535('0x4c'),_0x2d651f);})[_0x2535('0x4d')](function(){delete _0x36239d[_0x2535('0xe')][_0x59f909];delete _0x36239d['actions'][_0x59f909];});}else{ut[_0x2535('0x49')](_0x2535('0x4e'));delete this[_0x2535('0xe')][_0x59f909];delete this[_0x2535('0x29')][_0x59f909];}};Fax['prototype']['syncHangup']=function(_0xde66bf){var _0x14ba89=this;if(this[_0x2535('0xe')][_0xde66bf['uniqueid']]){if(this[_0x2535('0x29')][_0xde66bf[_0x2535('0x24')]]){this[_0x2535('0xe')][_0xde66bf[_0x2535('0x24')]]['id']=this[_0x2535('0x29')][_0xde66bf['uniqueid']]['id'];this['channels'][_0xde66bf[_0x2535('0x24')]][_0x2535('0x26')]=this['actions'][_0xde66bf['uniqueid']][_0x2535('0x26')];}logger['info'](_0xde66bf[_0x2535('0x24')],this[_0x2535('0x29')][_0xde66bf[_0x2535('0x24')]]?'\x20hangup\x20sendFile\x20':_0x2535('0x4f'),JSON[_0x2535('0x40')](this[_0x2535('0xe')][_0xde66bf[_0x2535('0x24')]]));if(this[_0x2535('0x29')][_0xde66bf['uniqueid']]){if(this[_0x2535('0xe')][_0xde66bf[_0x2535('0x24')]][_0x2535('0x50')]>0x0&&this['channels'][_0xde66bf[_0x2535('0x24')]][_0x2535('0x18')]===_0x2535('0x51')){this[_0x2535('0x52')](_0xde66bf[_0x2535('0x24')],!![]);}else{this[_0x2535('0x52')](_0xde66bf[_0x2535('0x24')],![],this[_0x2535('0xe')][_0xde66bf[_0x2535('0x24')]][_0x2535('0x53')]?'SENDING\x20FAILED:\x20'+this[_0x2535('0xe')][_0xde66bf[_0x2535('0x24')]][_0x2535('0x53')]:_0x2535('0x54'));}}}};Fax[_0x2535('0x1f')][_0x2535('0x55')]=function(_0x54bb16){var _0x54e964=this;return new BPromise(function(_0x18ec42,_0x5189d1){_0x54e964[_0x2535('0x56')](_0x54bb16,_0x54e964[_0x2535('0xf')][_0x54bb16[_0x2535('0x57')]])[_0x2535('0x3d')](function(_0x10ba85){ut[_0x2535('0x49')]('[Fax][execOriginate][success]',_0x10ba85);_0x18ec42(ut['message'](_0x2535('0x58')));})[_0x2535('0x41')](function(_0x25f734){ut[_0x2535('0x49')](_0x2535('0x59'),_0x25f734);updateStatus(_0x54bb16);_0x5189d1(ut[_0x2535('0x38')](_0x2535('0x5a')));});});};Fax[_0x2535('0x1f')][_0x2535('0x5b')]=function(_0x5d1ad3){var _0x127074=this;return new BPromise(function(_0x5e8f2f,_0x3cbc96){var _0x33de05=_0x127074['checkTrunk'](_0x127074['faxAccounts'][_0x5d1ad3[_0x2535('0x57')]][_0x2535('0x5c')],_0x5d1ad3);if(_0x33de05[_0x2535('0x5d')]){_0x5e8f2f(ut[_0x2535('0x38')](_0x2535('0x5e')));}else{_0x3cbc96(ut[_0x2535('0x38')](_0x33de05[_0x2535('0x38')]));}});};function originate(_0xd0578a,_0x2983e6,_0x86e9af){return new BPromise(function(_0x57ecc2,_0x9f8491){if(_0x86e9af){var _0x24bc21=util[_0x2535('0x5f')](_0x2535('0x60'),path['parse'](_0xd0578a['path'])[_0x2535('0x26')],_0xd0578a[_0x2535('0x4')]);gs[_0x2535('0x61')](_0x24bc21)[_0x2535('0x3d')](function(){_0xd0578a['path']=util['format'](_0x2535('0x62'),path[_0x2535('0x3a')](_0xd0578a['path'])[_0x2535('0x63')],path[_0x2535('0x3a')](_0xd0578a[_0x2535('0x4')])['name']);_0x2983e6[_0x2535('0x64')]=_0xd0578a[_0x2535('0x4')];ut[_0x2535('0x49')](_0x2535('0x65'),'');ami['Action'](ut[_0x2535('0x66')](_0xd0578a,_0x2983e6))['then'](function(_0x41041e){_0x57ecc2(_0x41041e);})[_0x2535('0x41')](function(_0x3344fc){_0x9f8491(_0x3344fc);});})[_0x2535('0x41')](function(_0x89191c){_0x9f8491(_0x89191c);});}else{ami['Action'](ut['variablesAction'](_0xd0578a,_0x2983e6))['then'](function(_0x4a9ad7){_0x57ecc2(_0x4a9ad7);})[_0x2535('0x41')](function(_0x172914){_0x9f8491(_0x172914);});}});}Fax[_0x2535('0x1f')]['execOriginate']=function(_0x452d23,_0x4eec8b){var _0x8f224=this;return new BPromise(function(_0x15746f,_0x196d3c){var _0x1d7b0a=uuid['v4']();var _0x1479c6=ut[_0x2535('0x67')](_0x452d23,_0x4eec8b);_0x8f224['actions'][_0x1d7b0a]=new Action(_0x1d7b0a,_0x4eec8b,_0x452d23);var _0x2534b2=_0x8f224['actions'][_0x1d7b0a];if(path[_0x2535('0x3a')](_0x452d23[_0x2535('0x4')])[_0x2535('0x68')]===_0x2535('0x3b')){originate(_0x2534b2,_0x1479c6,!![])[_0x2535('0x3d')](function(_0x451a18){_0x15746f(_0x451a18);})['catch'](function(_0x17112e){_0x196d3c(_0x17112e);});}else{originate(_0x2534b2,_0x1479c6,![])[_0x2535('0x3d')](function(_0x33412a){_0x15746f(_0x33412a);})[_0x2535('0x41')](function(_0x3b42e5){_0x196d3c(_0x3b42e5);});}});};Fax['prototype'][_0x2535('0x69')]=function(_0x2c89ac){return!_[_0x2535('0x6a')](_0x2c89ac)&&!_[_0x2535('0x6a')](_0x2c89ac[_0x2535('0x26')])&&!_[_0x2535('0x6a')](_0x2c89ac['active'])&&_0x2c89ac[_0x2535('0x6b')]&&!_['isNil'](this[_0x2535('0x10')][util['format']('SIP/%s',_0x2c89ac[_0x2535('0x26')])])&&!_['isNil'](this[_0x2535('0x10')][util['format']('SIP/%s',_0x2c89ac[_0x2535('0x26')])][_0x2535('0x2e')])&&(this[_0x2535('0x10')][util[_0x2535('0x5f')]('SIP/%s',_0x2c89ac[_0x2535('0x26')])][_0x2535('0x2e')]===_0x2535('0x6c')||this[_0x2535('0x10')][util[_0x2535('0x5f')](_0x2535('0x6d'),_0x2c89ac[_0x2535('0x26')])]['status']===_0x2535('0x6e'));};Fax[_0x2535('0x1f')][_0x2535('0x6f')]=function(_0x211b9a,_0x433d52){if(!this['isTrunkReachable'](_0x211b9a)){ut[_0x2535('0x49')](_0x2535('0x70'),_['isNil'](_0x211b9a)?'':_0x211b9a[_0x2535('0x26')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x2535('0x71')};}if(_[_0x2535('0x6a')](_0x433d52[_0x2535('0x72')])){ut['logger'](_0x2535('0x73'),JSON[_0x2535('0x40')](_0x433d52));return{'isValid':![],'message':_0x2535('0x74')};}if(_[_0x2535('0x6a')](_0x433d52[_0x2535('0x4')])){ut[_0x2535('0x49')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x2535('0x40')](_0x433d52));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x2535('0x75')};};module[_0x2535('0x76')]=Fax; \ No newline at end of file +var _0xf43d=['info','value','channelstatedesc','variable','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','uuid','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/faxAccount','channels','faxAccounts','trunks','syncNewchannel','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','bind','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','channel','uniqueid','name','\x20syncNewchannel\x20','actions'];(function(_0x4d0632,_0x2a6482){var _0x2d68ea=function(_0x4ad22d){while(--_0x4ad22d){_0x4d0632['push'](_0x4d0632['shift']());}};_0x2d68ea(++_0x2a6482);}(_0xf43d,0x1a7));var _0xdf43=function(_0x28a382,_0x26266b){_0x28a382=_0x28a382-0x0;var _0x33e96e=_0xf43d[_0x28a382];return _0x33e96e;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xdf43('0x0'));var moment=require('moment');var path=require(_0xdf43('0x1'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xdf43('0x2'));var logger=require(_0xdf43('0x3'))(_0xdf43('0x4'));var ami=require(_0xdf43('0x5'));var rpcDb=require(_0xdf43('0x6'));var Channel=require(_0xdf43('0x7'));var ut=require(_0xdf43('0x8'));var Action=require('./action');var faxAccount=require(_0xdf43('0x9'));var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x2557c5){this[_0xdf43('0xa')]={};this[_0xdf43('0xb')]=_0x2557c5['faxAccounts'];this[_0xdf43('0xc')]=_0x2557c5[_0xdf43('0xc')];this['actions']={};ami['on']('newchannel',this[_0xdf43('0xd')]['bind'](this));ami['on'](_0xdf43('0xe'),this[_0xdf43('0xf')]['bind'](this));ami['on'](_0xdf43('0x10'),this[_0xdf43('0x11')]['bind'](this));ami['on'](_0xdf43('0x12'),this[_0xdf43('0x13')][_0xdf43('0x14')](this));ami['on'](_0xdf43('0x15'),this[_0xdf43('0x16')][_0xdf43('0x14')](this));ami['on'](_0xdf43('0x17'),this[_0xdf43('0x18')][_0xdf43('0x14')](this));ami['on']('hangup',this[_0xdf43('0x19')]['bind'](this));ami['on'](_0xdf43('0x1a'),this[_0xdf43('0x1b')]['bind'](this));}Fax[_0xdf43('0x1c')]['syncNewchannel']=function(_0x29ff35){if(_0x29ff35[_0xdf43('0x1d')]===_0xdf43('0x1e')){for(var _0x1e155b in this[_0xdf43('0xb')]){if(this[_0xdf43('0xb')][_0xdf43('0x1f')](_0x1e155b)){if(_0x29ff35['exten']===this[_0xdf43('0xb')][_0x1e155b]['localstationid']){this[_0xdf43('0xa')][_0x29ff35['uniqueid']]={};this[_0xdf43('0xa')][_0x29ff35['uniqueid']]['channel']=_0x29ff35[_0xdf43('0x20')];this[_0xdf43('0xa')][_0x29ff35[_0xdf43('0x21')]]['id']=this['faxAccounts'][_0x1e155b]['id'];this[_0xdf43('0xa')][_0x29ff35[_0xdf43('0x21')]][_0xdf43('0x22')]=this['faxAccounts'][_0x1e155b]['name'];logger['info'](_0x29ff35[_0xdf43('0x21')],_0xdf43('0x23'));}}}}if(this[_0xdf43('0x24')][_0x29ff35['uniqueid']]){this[_0xdf43('0xa')][_0x29ff35[_0xdf43('0x21')]]={};this['channels'][_0x29ff35['uniqueid']][_0xdf43('0x20')]=_0x29ff35[_0xdf43('0x20')];logger[_0xdf43('0x25')](_0x29ff35[_0xdf43('0x21')],_0xdf43('0x23'));}};Fax[_0xdf43('0x1c')][_0xdf43('0xf')]=function(_0xbf84b1){if(this['channels'][_0xbf84b1['uniqueid']]){for(var _0x34513b in _0xbf84b1['variable']){if(_0xbf84b1['variable'][_0xdf43('0x1f')](_0x34513b)){this[_0xdf43('0xa')][_0xbf84b1['uniqueid']][_0x34513b]=_0xbf84b1[_0xdf43('0x26')];}}}};Fax[_0xdf43('0x1c')][_0xdf43('0x11')]=function(_0x33043d){if(this[_0xdf43('0xa')][_0x33043d[_0xdf43('0x21')]]){this[_0xdf43('0xa')][_0x33043d[_0xdf43('0x21')]]['channelstate']=_0x33043d['channelstate'];this[_0xdf43('0xa')][_0x33043d['uniqueid']][_0xdf43('0x27')]=_0x33043d['channelstatedesc'];}};Fax[_0xdf43('0x1c')]['syncNewExten']=function(_0x16ca44){if(this[_0xdf43('0xa')][_0x16ca44[_0xdf43('0x21')]]){for(var _0x52859a in _0x16ca44['variable']){if(_0x16ca44[_0xdf43('0x28')]['hasOwnProperty'](_0x52859a)){this[_0xdf43('0xa')][_0x16ca44[_0xdf43('0x21')]][_0x52859a]=_0x16ca44[_0xdf43('0x26')];}}}};Fax[_0xdf43('0x1c')]['syncFaxStatus']=function(_0x500253){if(this[_0xdf43('0xa')][_0x500253['uniqueid']]){this[_0xdf43('0xa')][_0x500253[_0xdf43('0x21')]][_0xdf43('0x29')]=_0x500253[_0xdf43('0x29')];this[_0xdf43('0xa')][_0x500253[_0xdf43('0x21')]]['status']=_0x500253[_0xdf43('0x2a')];this[_0xdf43('0xa')][_0x500253['uniqueid']][_0xdf43('0x2b')]=_0x500253[_0xdf43('0x2b')];this['channels'][_0x500253[_0xdf43('0x21')]][_0xdf43('0x2c')]=_0x500253[_0xdf43('0x2c')];logger[_0xdf43('0x25')](_0x500253[_0xdf43('0x21')],_0xdf43('0x2d'));}};Fax['prototype']['syncReceiveFax']=function(_0x3e7312){var _0x18bec6=this;if(this[_0xdf43('0xa')][_0x3e7312[_0xdf43('0x21')]]){var _0x5377af=this[_0xdf43('0xa')][_0x3e7312[_0xdf43('0x21')]]['id'];this[_0xdf43('0xa')][_0x3e7312[_0xdf43('0x21')]][_0xdf43('0x2e')]=_0x3e7312[_0xdf43('0x2e')];this['channels'][_0x3e7312[_0xdf43('0x21')]][_0xdf43('0x2f')]=_0x3e7312['pagestransferred'];this[_0xdf43('0xa')][_0x3e7312[_0xdf43('0x21')]][_0xdf43('0x2b')]=_0x3e7312[_0xdf43('0x2b')];this[_0xdf43('0xa')][_0x3e7312[_0xdf43('0x21')]][_0xdf43('0x30')]=_0x3e7312[_0xdf43('0x30')];this['channels'][_0x3e7312[_0xdf43('0x21')]][_0xdf43('0x31')]=_0x3e7312['transferrate'];this[_0xdf43('0xa')][_0x3e7312[_0xdf43('0x21')]]['filename']=_0x3e7312[_0xdf43('0x2c')];this[_0xdf43('0xa')][_0x3e7312[_0xdf43('0x21')]][_0xdf43('0x32')]=_0x3e7312[_0xdf43('0x32')];if(this[_0xdf43('0xa')][_0x3e7312['uniqueid']][_0xdf43('0x2f')]>0x0){tiff2pdf(_0x3e7312[_0xdf43('0x2c')],_0xdf43('0x33'),function(_0x2f5f75){logger[_0xdf43('0x25')](_0x3e7312[_0xdf43('0x21')],_0xdf43('0x34'),_0x2f5f75['message']);attachment[_0xdf43('0x35')]({'name':path['parse'](_0x3e7312[_0xdf43('0x2c')])[_0xdf43('0x22')],'basename':path[_0xdf43('0x36')](_0x3e7312['filename'])[_0xdf43('0x22')]+_0xdf43('0x37'),'type':_0xdf43('0x38')})[_0xdf43('0x39')](function(_0x545fc9){faxAccount['notify'](_0x5377af,{'from':_0x3e7312['calleridnum'],'mapKey':_0xdf43('0x4'),'body':path['parse'](_0x3e7312[_0xdf43('0x2c')])[_0xdf43('0x22')]+_0xdf43('0x37'),'AttachmentId':_0x545fc9['id']})[_0xdf43('0x3a')](function(_0x3a1408){logger['error'](_0x3e7312[_0xdf43('0x21')],_0xdf43('0x3b'),JSON[_0xdf43('0x3c')](_0x3a1408));});})[_0xdf43('0x3a')](function(_0x1947b1){logger[_0xdf43('0x3d')](_0x3e7312[_0xdf43('0x21')],'\x20receiveFax\x20',JSON['stringify'](_0x1947b1));});});}logger['info'](_0x3e7312[_0xdf43('0x21')],_0xdf43('0x3e'));}};Fax['prototype'][_0xdf43('0x1b')]=function(_0x49d8d4){if(this[_0xdf43('0x24')][_0x49d8d4['uniqueid']]){_[_0xdf43('0x3f')](this[_0xdf43('0xa')][_0x49d8d4['uniqueid']],_['pick'](_0x49d8d4,['response',_0xdf43('0x40')]));}};function updateStatus(_0x166d3a){if(_0x166d3a[_0xdf43('0x41')]){faxMessage['update'](_0x166d3a[_0xdf43('0x41')],{'failMessage':_0xdf43('0x42')})[_0xdf43('0x39')](function(_0x3b2278){ut[_0xdf43('0x43')]('[Fax][Message][Error][Updated]',_0x3b2278);})[_0xdf43('0x3a')](function(_0x29dd6a){ut[_0xdf43('0x43')]('[Fax][Message][Error][NoUpdate1]',_0x29dd6a);});}else{ut[_0xdf43('0x43')](_0xdf43('0x44'));}}Fax[_0xdf43('0x1c')][_0xdf43('0x45')]=function(_0x27d8f2,_0x1173b2,_0x2a0207){var _0x27b37d=this;var _0x2cdc82={};if(_0x1173b2){_0x2cdc82={'read':_0x1173b2};}else{_0x2cdc82={'failMessage':_0x2a0207};}if(this[_0xdf43('0x24')][_0x27d8f2][_0xdf43('0x41')]){faxMessage[_0xdf43('0x46')](this[_0xdf43('0x24')][_0x27d8f2]['AttachmentId'],_0x2cdc82)[_0xdf43('0x39')](function(_0x140909){ut[_0xdf43('0x43')]('[Fax][Message][Updated]',_0x140909);})[_0xdf43('0x3a')](function(_0x3b6918){ut[_0xdf43('0x43')](_0xdf43('0x47'),_0x3b6918);})['finally'](function(){delete _0x27b37d[_0xdf43('0xa')][_0x27d8f2];delete _0x27b37d[_0xdf43('0x24')][_0x27d8f2];});}else{ut[_0xdf43('0x43')](_0xdf43('0x48'));delete this[_0xdf43('0xa')][_0x27d8f2];delete this[_0xdf43('0x24')][_0x27d8f2];}};Fax[_0xdf43('0x1c')][_0xdf43('0x19')]=function(_0x58783a){var _0x2dc3c8=this;if(this[_0xdf43('0xa')][_0x58783a[_0xdf43('0x21')]]){if(this[_0xdf43('0x24')][_0x58783a[_0xdf43('0x21')]]){this['channels'][_0x58783a['uniqueid']]['id']=this['actions'][_0x58783a['uniqueid']]['id'];this[_0xdf43('0xa')][_0x58783a[_0xdf43('0x21')]]['name']=this['actions'][_0x58783a[_0xdf43('0x21')]][_0xdf43('0x22')];}logger[_0xdf43('0x25')](_0x58783a['uniqueid'],this['actions'][_0x58783a[_0xdf43('0x21')]]?_0xdf43('0x49'):_0xdf43('0x4a'),JSON[_0xdf43('0x3c')](this[_0xdf43('0xa')][_0x58783a[_0xdf43('0x21')]]));if(this[_0xdf43('0x24')][_0x58783a[_0xdf43('0x21')]]){if(this[_0xdf43('0xa')][_0x58783a[_0xdf43('0x21')]][_0xdf43('0x4b')]>0x0&&this[_0xdf43('0xa')][_0x58783a['uniqueid']]['faxstatus']===_0xdf43('0x4c')){this[_0xdf43('0x45')](_0x58783a[_0xdf43('0x21')],!![]);}else{this[_0xdf43('0x45')](_0x58783a[_0xdf43('0x21')],![],this[_0xdf43('0xa')][_0x58783a[_0xdf43('0x21')]][_0xdf43('0x4d')]?_0xdf43('0x4e')+this[_0xdf43('0xa')][_0x58783a[_0xdf43('0x21')]][_0xdf43('0x4d')]:_0xdf43('0x4f'));}}}};Fax[_0xdf43('0x1c')]['send']=function(_0x41ca56){var _0x7bf4bd=this;return new BPromise(function(_0x306c7b,_0x51cf71){_0x7bf4bd[_0xdf43('0x50')](_0x41ca56,_0x7bf4bd[_0xdf43('0xb')][_0x41ca56[_0xdf43('0x51')]])[_0xdf43('0x39')](function(_0x1f5cdc){ut[_0xdf43('0x43')](_0xdf43('0x52'),_0x1f5cdc);_0x306c7b(ut[_0xdf43('0x53')](_0xdf43('0x54')));})['catch'](function(_0x2811a9){ut[_0xdf43('0x43')](_0xdf43('0x55'),_0x2811a9);updateStatus(_0x41ca56);_0x51cf71(ut[_0xdf43('0x53')](_0xdf43('0x56')));});});};Fax[_0xdf43('0x1c')][_0xdf43('0x57')]=function(_0x13161d){var _0x5d6a36=this;return new BPromise(function(_0x456a26,_0x482d97){var _0x182909=_0x5d6a36['checkTrunk'](_0x5d6a36[_0xdf43('0xb')][_0x13161d[_0xdf43('0x51')]][_0xdf43('0x58')],_0x13161d);if(_0x182909[_0xdf43('0x59')]){_0x456a26(ut['message']('Trunk\x20Reachable'));}else{_0x482d97(ut['message'](_0x182909[_0xdf43('0x53')]));}});};function originate(_0x4331a1,_0x127bdb,_0x5bbbe3){return new BPromise(function(_0x2768ce,_0x1dad76){if(_0x5bbbe3){var _0x25cc74=util[_0xdf43('0x5a')](_0xdf43('0x5b'),path[_0xdf43('0x36')](_0x4331a1[_0xdf43('0x1')])[_0xdf43('0x22')],_0x4331a1[_0xdf43('0x1')]);gs[_0xdf43('0x5c')](_0x25cc74)[_0xdf43('0x39')](function(){_0x4331a1[_0xdf43('0x1')]=util['format'](_0xdf43('0x5d'),path[_0xdf43('0x36')](_0x4331a1['path'])[_0xdf43('0x5e')],path['parse'](_0x4331a1[_0xdf43('0x1')])['name']);_0x127bdb[_0xdf43('0x5f')]=_0x4331a1['path'];ut[_0xdf43('0x43')](_0xdf43('0x60'),'');ami[_0xdf43('0x61')](ut[_0xdf43('0x62')](_0x4331a1,_0x127bdb))[_0xdf43('0x39')](function(_0x531aaf){_0x2768ce(_0x531aaf);})[_0xdf43('0x3a')](function(_0x13792a){_0x1dad76(_0x13792a);});})[_0xdf43('0x3a')](function(_0x59934a){_0x1dad76(_0x59934a);});}else{ami[_0xdf43('0x61')](ut['variablesAction'](_0x4331a1,_0x127bdb))['then'](function(_0x52b6bc){_0x2768ce(_0x52b6bc);})['catch'](function(_0x295d48){_0x1dad76(_0x295d48);});}});}Fax[_0xdf43('0x1c')][_0xdf43('0x50')]=function(_0x527f4a,_0x4cac68){var _0xf6ba51=this;return new BPromise(function(_0x119d97,_0x33c6ef){var _0x440b3b=uuid['v4']();var _0x2b47fa=ut[_0xdf43('0x63')](_0x527f4a,_0x4cac68);_0xf6ba51[_0xdf43('0x24')][_0x440b3b]=new Action(_0x440b3b,_0x4cac68,_0x527f4a);var _0x45df05=_0xf6ba51[_0xdf43('0x24')][_0x440b3b];if(path['parse'](_0x527f4a['path'])[_0xdf43('0x64')]===_0xdf43('0x37')){originate(_0x45df05,_0x2b47fa,!![])['then'](function(_0x3e1a5b){_0x119d97(_0x3e1a5b);})[_0xdf43('0x3a')](function(_0x2270ba){_0x33c6ef(_0x2270ba);});}else{originate(_0x45df05,_0x2b47fa,![])[_0xdf43('0x39')](function(_0x3b4a4a){_0x119d97(_0x3b4a4a);})[_0xdf43('0x3a')](function(_0x5766b5){_0x33c6ef(_0x5766b5);});}});};Fax['prototype'][_0xdf43('0x65')]=function(_0x20665c){return!_[_0xdf43('0x66')](_0x20665c)&&!_['isNil'](_0x20665c[_0xdf43('0x22')])&&!_['isNil'](_0x20665c[_0xdf43('0x67')])&&_0x20665c[_0xdf43('0x67')]&&!_[_0xdf43('0x66')](this['trunks'][util[_0xdf43('0x5a')](_0xdf43('0x68'),_0x20665c['name'])])&&!_[_0xdf43('0x66')](this[_0xdf43('0xc')][util[_0xdf43('0x5a')](_0xdf43('0x68'),_0x20665c[_0xdf43('0x22')])]['status'])&&(this[_0xdf43('0xc')][util[_0xdf43('0x5a')](_0xdf43('0x68'),_0x20665c[_0xdf43('0x22')])][_0xdf43('0x2a')]===_0xdf43('0x69')||this[_0xdf43('0xc')][util[_0xdf43('0x5a')](_0xdf43('0x68'),_0x20665c[_0xdf43('0x22')])][_0xdf43('0x2a')]===_0xdf43('0x6a'));};Fax[_0xdf43('0x1c')][_0xdf43('0x6b')]=function(_0x4981d6,_0x3172bb){if(!this[_0xdf43('0x65')](_0x4981d6)){ut['logger'](_0xdf43('0x6c'),_['isNil'](_0x4981d6)?'':_0x4981d6[_0xdf43('0x22')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xdf43('0x6d')};}if(_[_0xdf43('0x66')](_0x3172bb[_0xdf43('0x4')])){ut[_0xdf43('0x43')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xdf43('0x3c')](_0x3172bb));return{'isValid':![],'message':_0xdf43('0x6e')};}if(_[_0xdf43('0x66')](_0x3172bb[_0xdf43('0x1')])){ut['logger'](_0xdf43('0x6f'),JSON['stringify'](_0x3172bb));return{'isValid':![],'message':_0xdf43('0x70')};}return{'isValid':!![],'message':_0xdf43('0x71')};};module[_0xdf43('0x72')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 1e41b9a..84109ad 100644 --- a/server/services/ami/fax/rpcDb.js +++ b/server/services/ami/fax/rpcDb.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a33=['[Notify]\x20','util','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch'];(function(_0x3d7fa1,_0x340c0e){var _0x4f5e46=function(_0x587608){while(--_0x587608){_0x3d7fa1['push'](_0x3d7fa1['shift']());}};_0x4f5e46(++_0x340c0e);}(_0x4a33,0x15d));var _0x34a3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4a33[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0x34a3('0x0'));var BPromise=require('bluebird');var logger=require(_0x34a3('0x1'))(_0x34a3('0x2'));var _=require(_0x34a3('0x3'));var faxAccount=require(_0x34a3('0x4'));function loggerCatch(_0x34a181){return function(_0x2b2874){logger[_0x34a3('0x5')](_0x34a181,util[_0x34a3('0x6')](_0x2b2874,{'showHidden':![],'depth':null}));};}exports[_0x34a3('0x7')]=function(_0xd1f1db,_0xb8fb3){return BPromise[_0x34a3('0x8')]()[_0x34a3('0x9')](faxAccount[_0x34a3('0x7')](_0xd1f1db,_0xb8fb3))[_0x34a3('0xa')](loggerCatch(_0x34a3('0xb')));}; \ No newline at end of file +var _0x6767=['../../../config/logger','preview','lodash','error','inspect','notify','resolve','catch','bluebird'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x6767,0x8f));var _0x7676=function(_0x530b36,_0x3f4ed2){_0x530b36=_0x530b36-0x0;var _0xebd3f9=_0x6767[_0x530b36];return _0xebd3f9;};'use strict';var util=require('util');var BPromise=require(_0x7676('0x0'));var logger=require(_0x7676('0x1'))(_0x7676('0x2'));var _=require(_0x7676('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x5cc506){return function(_0x4fa4fb){logger[_0x7676('0x4')](_0x5cc506,util[_0x7676('0x5')](_0x4fa4fb,{'showHidden':![],'depth':null}));};}exports[_0x7676('0x6')]=function(_0x18724b,_0x3d7813){return BPromise[_0x7676('0x7')]()['then'](faxAccount['notify'](_0x18724b,_0x3d7813))[_0x7676('0x8')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 5e02c45..be8313a 100644 --- a/server/services/ami/fax/util/gs.js +++ b/server/services/ami/fax/util/gs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x398d=['execute','Exec\x20gs','info','inspect','../../../../config/logger','fax','exec'];(function(_0x408089,_0x1422f2){var _0x4c6373=function(_0x86ab18){while(--_0x86ab18){_0x408089['push'](_0x408089['shift']());}};_0x4c6373(++_0x1422f2);}(_0x398d,0x14d));var _0xd398=function(_0xd983d1,_0x59cc82){_0xd983d1=_0xd983d1-0x0;var _0x21c435=_0x398d[_0xd983d1];return _0x21c435;};'use strict';var util=require('util');var logger=require(_0xd398('0x0'))(_0xd398('0x1'));var BPromise=require('bluebird');var exec=require('child_process')[_0xd398('0x2')];exports[_0xd398('0x3')]=function(_0x31cda7){return new BPromise(function(_0x29e173,_0x74e461){exec(_0x31cda7,function(_0x356f12,_0x4f3f7a,_0x30a218){logger['info'](_0xd398('0x4'),_0x4f3f7a);if(_0x356f12){logger[_0xd398('0x5')](_0xd398('0x4'),'\x20Error\x20:',util[_0xd398('0x6')](_0x356f12,{'showHidden':![],'depth':null}),_0x4f3f7a,_0x30a218);_0x74e461(_0x356f12);}_0x29e173(_0x4f3f7a);});});}; \ No newline at end of file +var _0x8f3d=['execute','info','Exec\x20gs','inspect','util','../../../../config/logger','fax','bluebird','child_process'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x8f3d,0xa6));var _0xd8f3=function(_0x2584b6,_0x51a97e){_0x2584b6=_0x2584b6-0x0;var _0x3889d8=_0x8f3d[_0x2584b6];return _0x3889d8;};'use strict';var util=require(_0xd8f3('0x0'));var logger=require(_0xd8f3('0x1'))(_0xd8f3('0x2'));var BPromise=require(_0xd8f3('0x3'));var exec=require(_0xd8f3('0x4'))['exec'];exports[_0xd8f3('0x5')]=function(_0x462aed){return new BPromise(function(_0x280180,_0x6d8cb1){exec(_0x462aed,function(_0x55b81a,_0x1750a0,_0x6388a4){logger[_0xd8f3('0x6')](_0xd8f3('0x7'),_0x1750a0);if(_0x55b81a){logger['info'](_0xd8f3('0x7'),'\x20Error\x20:',util[_0xd8f3('0x8')](_0x55b81a,{'showHidden':![],'depth':null}),_0x1750a0,_0x6388a4);_0x6d8cb1(_0x55b81a);}_0x280180(_0x1750a0);});});}; \ No newline at end of file diff --git a/server/services/ami/fax/util/util.js b/server/services/ami/fax/util/util.js index e10ddeb..199de69 100644 --- a/server/services/ami/fax/util/util.js +++ b/server/services/ami/fax/util/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa29e=['../../../../config/logger','fax','message','logger','inspect','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','localstationid','variablesAction','originate','channel','from-sip','\x22%s\x22\x20<%s>','moment'];(function(_0x1fd9e7,_0x24cdbe){var _0x1781f2=function(_0x2bd0a3){while(--_0x2bd0a3){_0x1fd9e7['push'](_0x1fd9e7['shift']());}};_0x1781f2(++_0x24cdbe);}(_0xa29e,0x168));var _0xea29=function(_0x2c7597,_0x311720){_0x2c7597=_0x2c7597-0x0;var _0x49fbf3=_0xa29e[_0x2c7597];return _0x49fbf3;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xea29('0x0'));var logger=require(_0xea29('0x1'))(_0xea29('0x2'));exports[_0xea29('0x3')]=function(_0x4ef587){return{'message':_0x4ef587};};exports[_0xea29('0x4')]=function(_0x5882d7,_0x2b6976){logger['info'](_0x5882d7,util[_0xea29('0x5')](_0x2b6976,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x3b8f30,_0x46327a){var _0x2b5016={'XMF-ECM':_0x46327a['ecm'],'XMF-HEADERINFO':_0x46327a[_0xea29('0x6')],'XMF-MINRATE':_0x46327a[_0xea29('0x7')],'XMF-MAXRATE':_0x46327a[_0xea29('0x8')],'XMF-MODEM':util[_0xea29('0x9')](_0xea29('0xa'),_0x46327a[_0xea29('0xb')]),'XMF-GATEWAY':_0x46327a[_0xea29('0xc')],'XMF-FAXDETECT':_0x46327a['faxdetect'],'XMF-T38TIMEOUT':_0x46327a['t38timeout'],'XMF-LOCALSTATIONID':_0x46327a[_0xea29('0xd')],'XMF-PATH':_0x3b8f30['path']};return _0x2b5016;};exports[_0xea29('0xe')]=function(_0x2ccb52,_0x238c09){return{'actionid':_0x2ccb52['uniqueid'],'action':_0xea29('0xf'),'channel':_0x2ccb52[_0xea29('0x10')],'Exten':'xcally-motion-fax','Context':_0xea29('0x11'),'Priority':'1','callerid':util[_0xea29('0x9')](_0xea29('0x12'),_0x2ccb52[_0xea29('0x6')]?_0x2ccb52['headerinfo']:'',_0x2ccb52[_0xea29('0xd')]),'variable':_0x238c09,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2ccb52['uniqueid']};}; \ No newline at end of file +var _0x0870=['format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','originate','xcally-motion-fax','\x22%s\x22\x20<%s>','uniqueid','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','headerinfo','minrate','maxrate'];(function(_0x2a6b4f,_0x444c99){var _0x3da28d=function(_0x27f27c){while(--_0x27f27c){_0x2a6b4f['push'](_0x2a6b4f['shift']());}};_0x3da28d(++_0x444c99);}(_0x0870,0x9c));var _0x0087=function(_0x409df0,_0x5378e8){_0x409df0=_0x409df0-0x0;var _0x33d53e=_0x0870[_0x409df0];return _0x33d53e;};'use strict';var util=require('util');var _=require(_0x0087('0x0'));var moment=require(_0x0087('0x1'));var logger=require(_0x0087('0x2'))(_0x0087('0x3'));exports[_0x0087('0x4')]=function(_0x194052){return{'message':_0x194052};};exports[_0x0087('0x5')]=function(_0x210175,_0x36a534){logger[_0x0087('0x6')](_0x210175,util[_0x0087('0x7')](_0x36a534,{'showHidden':![],'depth':null}));};exports[_0x0087('0x8')]=function(_0x41eebd,_0x3ac6c6){var _0xc944dc={'XMF-ECM':_0x3ac6c6['ecm'],'XMF-HEADERINFO':_0x3ac6c6[_0x0087('0x9')],'XMF-MINRATE':_0x3ac6c6[_0x0087('0xa')],'XMF-MAXRATE':_0x3ac6c6[_0x0087('0xb')],'XMF-MODEM':util[_0x0087('0xc')](_0x0087('0xd'),_0x3ac6c6[_0x0087('0xe')]),'XMF-GATEWAY':_0x3ac6c6[_0x0087('0xf')],'XMF-FAXDETECT':_0x3ac6c6[_0x0087('0x10')],'XMF-T38TIMEOUT':_0x3ac6c6[_0x0087('0x11')],'XMF-LOCALSTATIONID':_0x3ac6c6[_0x0087('0x12')],'XMF-PATH':_0x41eebd[_0x0087('0x13')]};return _0xc944dc;};exports['variablesAction']=function(_0x26c344,_0x1697f2){return{'actionid':_0x26c344['uniqueid'],'action':_0x0087('0x14'),'channel':_0x26c344['channel'],'Exten':_0x0087('0x15'),'Context':'from-sip','Priority':'1','callerid':util[_0x0087('0xc')](_0x0087('0x16'),_0x26c344['headerinfo']?_0x26c344['headerinfo']:'',_0x26c344[_0x0087('0x12')]),'variable':_0x1697f2,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x26c344[_0x0087('0x17')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index d49046a..65eb5a2 100644 --- a/server/services/ami/index.js +++ b/server/services/ami/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f70=['./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','ami','get','hour','resolve','then','initAgents','getTelephones','initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','initFreshdeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','util','moment','./server','./realtime','./report','./acw','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/integrations/salesforce','./rpc/integrations/freshdesk'];(function(_0x40e4e4,_0x3f8468){var _0x381f7f=function(_0x519bcf){while(--_0x519bcf){_0x40e4e4['push'](_0x40e4e4['shift']());}};_0x381f7f(++_0x3f8468);}(_0x6f70,0xdd));var _0x06f7=function(_0x17b883,_0x41413c){_0x17b883=_0x17b883-0x0;var _0x592f72=_0x6f70[_0x17b883];return _0x592f72;};'use strict';var util=require(_0x06f7('0x0'));var moment=require(_0x06f7('0x1'));var server=require(_0x06f7('0x2'));var Realtime=require(_0x06f7('0x3'));var Report=require(_0x06f7('0x4'));var Acw=require(_0x06f7('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x06f7('0x6'));var Preview=require('./preview');var Fax=require(_0x06f7('0x7'));var user=require(_0x06f7('0x8'));var voiceQueue=require(_0x06f7('0x9'));var voiceQueueReport=require(_0x06f7('0xa'));var voiceCallReport=require(_0x06f7('0xb'));var trunk=require(_0x06f7('0xc'));var trigger=require(_0x06f7('0xd'));var template=require(_0x06f7('0xe'));var cmHopperHistory=require(_0x06f7('0xf'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x06f7('0x10'));var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x06f7('0x11'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x06f7('0x12'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x06f7('0x13'));var vtiger=require(_0x06f7('0x14'));var freshsales=require(_0x06f7('0x15'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x06f7('0x16'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x06f7('0x17')](_0x06f7('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x06f7('0x17')](_0x06f7('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x06f7('0x19')]()[_0x06f7('0x1a')](user['getAgents']())['then'](realtime[_0x06f7('0x1b')]())['then'](user[_0x06f7('0x1c')]())[_0x06f7('0x1a')](realtime['initTelephones']())[_0x06f7('0x1a')](trunk['getTrunks']())[_0x06f7('0x1a')](realtime[_0x06f7('0x1d')]())['then'](voiceQueue['getVoiceQueues']())[_0x06f7('0x1a')](realtime[_0x06f7('0x1e')]())[_0x06f7('0x1a')](trigger[_0x06f7('0x1f')]())['then'](realtime[_0x06f7('0x20')]())[_0x06f7('0x1a')](template[_0x06f7('0x21')]())['then'](realtime['initTemplates']())[_0x06f7('0x1a')](zendesk['getZendeskAccounts']())[_0x06f7('0x1a')](realtime[_0x06f7('0x22')]())[_0x06f7('0x1a')](salesforce[_0x06f7('0x23')]())[_0x06f7('0x1a')](realtime[_0x06f7('0x24')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0x06f7('0x1a')](realtime[_0x06f7('0x25')]())[_0x06f7('0x1a')](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0x06f7('0x26')]())[_0x06f7('0x1a')](desk['getDeskAccounts']())[_0x06f7('0x1a')](realtime[_0x06f7('0x27')]())[_0x06f7('0x1a')](zoho['getZohoAccounts']())['then'](realtime[_0x06f7('0x28')]())[_0x06f7('0x1a')](vtiger[_0x06f7('0x29')]())[_0x06f7('0x1a')](realtime['initVtigerAccounts']())[_0x06f7('0x1a')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0x06f7('0x2a')]())[_0x06f7('0x1a')](servicenow[_0x06f7('0x2b')]())[_0x06f7('0x1a')](realtime['initServicenowAccounts']())[_0x06f7('0x1a')](dynamics365[_0x06f7('0x2c')]())[_0x06f7('0x1a')](realtime[_0x06f7('0x2d')]())['then'](campaign[_0x06f7('0x2e')]())[_0x06f7('0x1a')](realtime[_0x06f7('0x2f')]())[_0x06f7('0x1a')](voiceExtension['getVoiceExtensions']())['then'](realtime[_0x06f7('0x30')]())[_0x06f7('0x1a')](faxAccount[_0x06f7('0x31')]())['then'](realtime['initFaxAccounts']())[_0x06f7('0x1a')](function(){return realtime;});}function initParams(){return Promise[_0x06f7('0x19')]()['then'](voiceQueueReport['getVoiceQueueReports']())['then'](realtime['initVoiceQueueReports']())[_0x06f7('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x06f7('0x1a')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x06f7('0x32')]())[_0x06f7('0x1a')](realtime['initCampaignHopperHistory']())[_0x06f7('0x1a')](voiceCallReport[_0x06f7('0x33')]())[_0x06f7('0x1a')](realtime[_0x06f7('0x34')]())[_0x06f7('0x35')](function(_0x35c6b1){logger[_0x06f7('0x36')](_0x06f7('0x37'),util[_0x06f7('0x38')](_0x35c6b1,{'showHidden':![],'depth':null}));});}function main(){return server[_0x06f7('0x39')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x06f7('0x1a')](function(){return initParams();})[_0x06f7('0x1a')](function(){report[_0x06f7('0x3a')]();setInterval(initRealtime,0x1388);})[_0x06f7('0x35')](function(_0x157499){logger[_0x06f7('0x36')](_0x06f7('0x3b'),util[_0x06f7('0x38')](_0x157499,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x7d4d=['initTemplates','initZendeskAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','util','moment','./server','./realtime','./report','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/dynamics365','../../config/logger','ami','hour','get','resolve','then','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x7d4d,0x1c5));var _0xd7d4=function(_0x2d486b,_0x5f213c){_0x2d486b=_0x2d486b-0x0;var _0x4291d1=_0x7d4d[_0x2d486b];return _0x4291d1;};'use strict';var util=require(_0xd7d4('0x0'));var moment=require(_0xd7d4('0x1'));var server=require(_0xd7d4('0x2'));var Realtime=require(_0xd7d4('0x3'));var Report=require(_0xd7d4('0x4'));var Acw=require('./acw');var Trigger=require(_0xd7d4('0x5'));var Dialer=require(_0xd7d4('0x6'));var Preview=require(_0xd7d4('0x7'));var Fax=require(_0xd7d4('0x8'));var user=require(_0xd7d4('0x9'));var voiceQueue=require(_0xd7d4('0xa'));var voiceQueueReport=require(_0xd7d4('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xd7d4('0xc'));var trigger=require('./rpc/trigger');var template=require(_0xd7d4('0xd'));var cmHopperHistory=require(_0xd7d4('0xe'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xd7d4('0xf'));var zendesk=require(_0xd7d4('0x10'));var salesforce=require(_0xd7d4('0x11'));var sugarcrm=require(_0xd7d4('0x12'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xd7d4('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xd7d4('0x14'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xd7d4('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xd7d4('0x16'))(_0xd7d4('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xd7d4('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xd7d4('0x19')](_0xd7d4('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xd7d4('0x1a')]()['then'](user['getAgents']())[_0xd7d4('0x1b')](realtime[_0xd7d4('0x1c')]())[_0xd7d4('0x1b')](user[_0xd7d4('0x1d')]())[_0xd7d4('0x1b')](realtime[_0xd7d4('0x1e')]())[_0xd7d4('0x1b')](trunk['getTrunks']())[_0xd7d4('0x1b')](realtime[_0xd7d4('0x1f')]())['then'](voiceQueue[_0xd7d4('0x20')]())['then'](realtime[_0xd7d4('0x21')]())[_0xd7d4('0x1b')](trigger[_0xd7d4('0x22')]())[_0xd7d4('0x1b')](realtime[_0xd7d4('0x23')]())['then'](template[_0xd7d4('0x24')]())[_0xd7d4('0x1b')](realtime[_0xd7d4('0x25')]())[_0xd7d4('0x1b')](zendesk['getZendeskAccounts']())['then'](realtime[_0xd7d4('0x26')]())[_0xd7d4('0x1b')](salesforce['getSalesforceAccounts']())[_0xd7d4('0x1b')](realtime['initSalesforceAccounts']())[_0xd7d4('0x1b')](sugarcrm[_0xd7d4('0x27')]())['then'](realtime[_0xd7d4('0x28')]())['then'](freshdesk[_0xd7d4('0x29')]())['then'](realtime[_0xd7d4('0x2a')]())['then'](desk[_0xd7d4('0x2b')]())['then'](realtime['initDeskAccounts']())[_0xd7d4('0x1b')](zoho[_0xd7d4('0x2c')]())['then'](realtime[_0xd7d4('0x2d')]())[_0xd7d4('0x1b')](vtiger[_0xd7d4('0x2e')]())['then'](realtime[_0xd7d4('0x2f')]())[_0xd7d4('0x1b')](freshsales[_0xd7d4('0x30')]())[_0xd7d4('0x1b')](realtime[_0xd7d4('0x31')]())['then'](servicenow[_0xd7d4('0x32')]())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0xd7d4('0x33')]())[_0xd7d4('0x1b')](realtime[_0xd7d4('0x34')]())[_0xd7d4('0x1b')](campaign[_0xd7d4('0x35')]())[_0xd7d4('0x1b')](realtime[_0xd7d4('0x36')]())['then'](voiceExtension['getVoiceExtensions']())[_0xd7d4('0x1b')](realtime[_0xd7d4('0x37')]())[_0xd7d4('0x1b')](faxAccount[_0xd7d4('0x38')]())[_0xd7d4('0x1b')](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return Promise[_0xd7d4('0x1a')]()['then'](voiceQueueReport[_0xd7d4('0x39')]())[_0xd7d4('0x1b')](realtime[_0xd7d4('0x3a')]())['then'](cmHopperHistory[_0xd7d4('0x3b')]())[_0xd7d4('0x1b')](realtime[_0xd7d4('0x3c')]())[_0xd7d4('0x1b')](cmHopperHistory[_0xd7d4('0x3d')]())[_0xd7d4('0x1b')](realtime[_0xd7d4('0x3e')]())[_0xd7d4('0x1b')](voiceCallReport[_0xd7d4('0x3f')]())[_0xd7d4('0x1b')](realtime[_0xd7d4('0x40')]())[_0xd7d4('0x41')](function(_0x50a5e9){logger['error'](_0xd7d4('0x42'),util[_0xd7d4('0x43')](_0x50a5e9,{'showHidden':![],'depth':null}));});}function main(){return server[_0xd7d4('0x44')](realtime,preview,fax)['then'](function(){return initRealtime();})['then'](function(){return initParams();})[_0xd7d4('0x1b')](function(){report[_0xd7d4('0x45')]();setInterval(initRealtime,0x1388);})[_0xd7d4('0x41')](function(_0xe4088a){logger['error']('[index.js][main]',util[_0xd7d4('0x43')](_0xe4088a,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index f06db4a..848a190 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x412d=['updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','format','voiceStatusQueue','interface','user:%s','emit','user:ami:update','omit','exports','lodash','util','moment','md5','ioredis','redis','name','email','accountcode','fullname','state','unknown','stateTime','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','prototype'];(function(_0x3b233e,_0x1dcc76){var _0x8c5815=function(_0x50c2cc){while(--_0x50c2cc){_0x3b233e['push'](_0x3b233e['shift']());}};_0x8c5815(++_0x1dcc76);}(_0x412d,0xfc));var _0xd412=function(_0x281f96,_0x5db2bf){_0x281f96=_0x281f96-0x0;var _0x50c879=_0x412d[_0x281f96];return _0x50c879;};'use strict';var _=require(_0xd412('0x0'));var util=require(_0xd412('0x1'));var moment=require(_0xd412('0x2'));var md5=require(_0xd412('0x3'));var Redis=require(_0xd412('0x4'));var config=require('../../../config/environment');config[_0xd412('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd412('0x5')]));function Agent(_0x2e1d2e){this['id']=_0x2e1d2e['id']||0x0;this[_0xd412('0x6')]=_0x2e1d2e['name']||'';this[_0xd412('0x7')]=_0x2e1d2e[_0xd412('0x7')]||'';this[_0xd412('0x8')]=_0x2e1d2e[_0xd412('0x8')]||'';this[_0xd412('0x9')]=_0x2e1d2e[_0xd412('0x9')]||'';this[_0xd412('0xa')]=_0xd412('0xb');this[_0xd412('0xc')]=0x0;this['status']='unknown';this['address']='';this['phone']='';this[_0xd412('0xd')]='';this['interface']='';this['online']=_0x2e1d2e[_0xd412('0xe')]||![];this[_0xd412('0xf')]=_0xd412('0xb');this[_0xd412('0x10')]=0x0;this[_0xd412('0x11')]='';this['voiceStatusQueue']='';this[_0xd412('0x12')]=![];this['local']=![];this['md5']='';}Agent[_0xd412('0x13')][_0xd412('0x14')]=function(_0x30881e){var _0x787793;if(_0x30881e&&_0x30881e[_0xd412('0xa')]){_0x787793=_0x30881e[_0xd412('0xa')][_0xd412('0x15')]();switch(_0x787793){case _0xd412('0x16'):_0x787793=_0xd412('0x17');break;case _0xd412('0x18'):_0x787793=_0xd412('0x19');break;}}if(_0x787793&&this[_0xd412('0xf')]!==_0x787793||_0x30881e['statePause']){this['voiceStatusTime']=_['toNumber'](moment()[_0xd412('0x1a')]('x'));}if(_0x787793){this[_0xd412('0xf')]=_0x787793;}var _0x421b65={'id':this['id'],'name':this[_0xd412('0x6')],'email':this['email'],'accountcode':this[_0xd412('0x8')],'fullname':this[_0xd412('0x9')],'state':this[_0xd412('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0xd412('0xe')],'voiceStatus':this[_0xd412('0xf')],'voiceStatusTime':this[_0xd412('0x10')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0xd412('0x1b')],'interface':this[_0xd412('0x1c')],'onhold':this[_0xd412('0x12')]};var _0x41610d=md5(JSON['stringify'](_0x421b65));if(this['md5']!==_0x41610d){this['md5']=_0x41610d;io['to'](util[_0xd412('0x1a')](_0xd412('0x1d'),_0x421b65[_0xd412('0x6')]))[_0xd412('0x1e')](_0xd412('0x1f'),_[_0xd412('0x20')](_0x421b65,['online']));io[_0xd412('0x1e')]('user:presence',_0x421b65);}};module[_0xd412('0x21')]=Agent; \ No newline at end of file +var _0xebd0=['interface','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','md5','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','statePause','format','online','user:%s','emit','lodash','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address'];(function(_0x111224,_0x2d6b68){var _0x1cd99d=function(_0x9aad56){while(--_0x9aad56){_0x111224['push'](_0x111224['shift']());}};_0x1cd99d(++_0x2d6b68);}(_0xebd0,0x194));var _0x0ebd=function(_0x4d39e7,_0x36a9c9){_0x4d39e7=_0x4d39e7-0x0;var _0x32fa3f=_0xebd0[_0x4d39e7];return _0x32fa3f;};'use strict';var _=require(_0x0ebd('0x0'));var util=require(_0x0ebd('0x1'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x0ebd('0x2'));var config=require(_0x0ebd('0x3'));config['redis']=_[_0x0ebd('0x4')](config['redis'],{'host':_0x0ebd('0x5'),'port':0x18eb});var io=require(_0x0ebd('0x6'))(new Redis(config['redis']));function Agent(_0x5c6cf7){this['id']=_0x5c6cf7['id']||0x0;this['name']=_0x5c6cf7[_0x0ebd('0x7')]||'';this[_0x0ebd('0x8')]=_0x5c6cf7[_0x0ebd('0x8')]||'';this[_0x0ebd('0x9')]=_0x5c6cf7[_0x0ebd('0x9')]||'';this['fullname']=_0x5c6cf7[_0x0ebd('0xa')]||'';this[_0x0ebd('0xb')]=_0x0ebd('0xc');this[_0x0ebd('0xd')]=0x0;this[_0x0ebd('0xe')]='unknown';this[_0x0ebd('0xf')]='';this['phone']='';this['mobile']='';this[_0x0ebd('0x10')]='';this['online']=_0x5c6cf7['online']||![];this[_0x0ebd('0x11')]=_0x0ebd('0xc');this[_0x0ebd('0x12')]=0x0;this[_0x0ebd('0x13')]='';this[_0x0ebd('0x14')]='';this[_0x0ebd('0x15')]=![];this[_0x0ebd('0x16')]=![];this[_0x0ebd('0x17')]='';}Agent[_0x0ebd('0x18')][_0x0ebd('0x19')]=function(_0xd684fd){var _0x97f1db;if(_0xd684fd&&_0xd684fd[_0x0ebd('0xb')]){_0x97f1db=_0xd684fd[_0x0ebd('0xb')][_0x0ebd('0x1a')]();switch(_0x97f1db){case _0x0ebd('0x1b'):_0x97f1db=_0x0ebd('0x1c');break;case _0x0ebd('0x1d'):_0x97f1db='talking';break;}}if(_0x97f1db&&this[_0x0ebd('0x11')]!==_0x97f1db||_0xd684fd[_0x0ebd('0x1e')]){this[_0x0ebd('0x12')]=_['toNumber'](moment()[_0x0ebd('0x1f')]('x'));}if(_0x97f1db){this['voiceStatus']=_0x97f1db;}var _0x4bcbda={'id':this['id'],'name':this[_0x0ebd('0x7')],'email':this[_0x0ebd('0x8')],'accountcode':this['accountcode'],'fullname':this[_0x0ebd('0xa')],'state':this['state'],'stateTime':this['stateTime'],'status':this[_0x0ebd('0xe')],'address':this[_0x0ebd('0xf')],'online':this[_0x0ebd('0x20')],'voiceStatus':this[_0x0ebd('0x11')],'voiceStatusTime':this[_0x0ebd('0x12')],'voiceStatusCallerIdNumber':this[_0x0ebd('0x13')],'voiceStatusQueue':this[_0x0ebd('0x14')],'interface':this[_0x0ebd('0x10')],'onhold':this[_0x0ebd('0x15')]};var _0x158486=md5(JSON['stringify'](_0x4bcbda));if(this[_0x0ebd('0x17')]!==_0x158486){this[_0x0ebd('0x17')]=_0x158486;io['to'](util[_0x0ebd('0x1f')](_0x0ebd('0x21'),_0x4bcbda[_0x0ebd('0x7')]))[_0x0ebd('0x22')]('user:ami:update',_['omit'](_0x4bcbda,[_0x0ebd('0x20')]));io[_0x0ebd('0x22')]('user:presence',_0x4bcbda);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 7ee6630..7d5379c 100644 --- a/server/services/ami/model/campaign.js +++ b/server/services/ami/model/campaign.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a72=['dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency'];(function(_0x537c91,_0x49c674){var _0xdf4c06=function(_0x534481){while(--_0x534481){_0x537c91['push'](_0x537c91['shift']());}};_0xdf4c06(++_0x49c674);}(_0x7a72,0x89));var _0x27a7=function(_0x362cad,_0x17acc9){_0x362cad=_0x362cad-0x0;var _0x55b246=_0x7a72[_0x362cad];return _0x55b246;};'use strict';function Campaign(_0x4a1701){this['id']=_0x4a1701['id']||0x0;this[_0x27a7('0x0')]=_0x4a1701['name']||'';this[_0x27a7('0x1')]=_0x4a1701['type']||'campaign';this[_0x27a7('0x2')]=0x0;this[_0x27a7('0x3')]=0x0;this[_0x27a7('0x4')]=0x0;this[_0x27a7('0x5')]=0x0;this['message']='';this[_0x27a7('0x6')]=!![];this['active']=_0x4a1701[_0x27a7('0x7')];this[_0x27a7('0x8')]=_0x4a1701[_0x27a7('0x8')];this[_0x27a7('0x9')]=_0x4a1701[_0x27a7('0x9')]||null;this['dialGlobalInterval']=_0x4a1701[_0x27a7('0xa')]?_0x4a1701[_0x27a7('0xa')]:null;this[_0x27a7('0xb')]=_0x4a1701['dialOriginateCallerIdName'];this[_0x27a7('0xc')]=_0x4a1701['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x4a1701[_0x27a7('0xd')]||0x1e;this[_0x27a7('0xe')]=_0x4a1701[_0x27a7('0xe')];this[_0x27a7('0xf')]=_0x4a1701[_0x27a7('0xf')];this[_0x27a7('0x10')]=_0x4a1701[_0x27a7('0x10')];this[_0x27a7('0x11')]=_0x4a1701[_0x27a7('0x11')];this[_0x27a7('0x12')]=_0x4a1701[_0x27a7('0x12')];this[_0x27a7('0x13')]=_0x4a1701[_0x27a7('0x13')];this[_0x27a7('0x14')]=_0x4a1701[_0x27a7('0x14')];this['dialNoSuchNumberMaxRetry']=_0x4a1701[_0x27a7('0x15')]||0x3;this[_0x27a7('0x16')]=_0x4a1701['dialNoSuchNumberRetryFrequency']||0x96;this[_0x27a7('0x17')]=_0x4a1701[_0x27a7('0x17')]||0x3;this['dialDropRetryFrequency']=_0x4a1701[_0x27a7('0x18')]||0x96;this['dialAbandonedMaxRetry']=_0x4a1701[_0x27a7('0x19')]||0x3;this[_0x27a7('0x1a')]=_0x4a1701[_0x27a7('0x1a')]||0x96;this[_0x27a7('0x1b')]=_0x4a1701[_0x27a7('0x1b')]||0x3;this['dialMachineRetryFrequency']=_0x4a1701[_0x27a7('0x1c')]||0x96;this[_0x27a7('0x1d')]=_0x4a1701['dialAgentRejectMaxRetry']||0x3;this[_0x27a7('0x1e')]=_0x4a1701[_0x27a7('0x1e')]||0x96;this['dialOrderByScheduledAt']=_0x4a1701[_0x27a7('0x1f')]||'DESC';this[_0x27a7('0x20')]=_0x4a1701[_0x27a7('0x20')]||undefined;this[_0x27a7('0x21')]=_0x4a1701['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x27a7('0x22')]=_0x4a1701[_0x27a7('0x22')]||undefined;this['TrunkBackup']=_0x4a1701[_0x27a7('0x23')]?_0x4a1701['TrunkBackup']:undefined;this['Trunk']=_0x4a1701['Trunk']?_0x4a1701[_0x27a7('0x24')]:undefined;this[_0x27a7('0x25')]=_0x4a1701[_0x27a7('0x25')]?_0x4a1701['Interval']:undefined;this[_0x27a7('0x26')]=_0x4a1701[_0x27a7('0x26')]?_0x4a1701['SquareProject']:undefined;this[_0x27a7('0x27')]=_0x4a1701['SquareProject']?_0x4a1701[_0x27a7('0x26')][_0x27a7('0x0')]:undefined;this[_0x27a7('0x28')]=_0x4a1701[_0x27a7('0x28')]||![];this[_0x27a7('0x29')]=_0x4a1701[_0x27a7('0x29')];this[_0x27a7('0x2a')]=_0x4a1701['dialAMDGreeting'];this[_0x27a7('0x2b')]=_0x4a1701[_0x27a7('0x2b')];this[_0x27a7('0x2c')]=_0x4a1701[_0x27a7('0x2c')];this[_0x27a7('0x2d')]=_0x4a1701[_0x27a7('0x2d')];this[_0x27a7('0x2e')]=_0x4a1701[_0x27a7('0x2e')];this[_0x27a7('0x2f')]=_0x4a1701['dialAMDMaximumNumberOfWords'];this[_0x27a7('0x30')]=_0x4a1701[_0x27a7('0x30')];this['dialAMDMaximumWordLength']=_0x4a1701[_0x27a7('0x31')];}module[_0x27a7('0x32')]=Campaign; \ No newline at end of file +var _0x8a24=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message'];(function(_0x5f1538,_0x336493){var _0x30911f=function(_0x1aeb5b){while(--_0x1aeb5b){_0x5f1538['push'](_0x5f1538['shift']());}};_0x30911f(++_0x336493);}(_0x8a24,0x97));var _0x48a2=function(_0x3a018b,_0x175f6f){_0x3a018b=_0x3a018b-0x0;var _0x52a308=_0x8a24[_0x3a018b];return _0x52a308;};'use strict';function Campaign(_0x515843){this['id']=_0x515843['id']||0x0;this[_0x48a2('0x0')]=_0x515843[_0x48a2('0x0')]||'';this[_0x48a2('0x1')]=_0x515843['type']||_0x48a2('0x2');this[_0x48a2('0x3')]=0x0;this[_0x48a2('0x4')]=0x0;this[_0x48a2('0x5')]=0x0;this[_0x48a2('0x6')]=0x0;this[_0x48a2('0x7')]='';this[_0x48a2('0x8')]=!![];this['active']=_0x515843[_0x48a2('0x9')];this['limitCalls']=_0x515843[_0x48a2('0xa')];this[_0x48a2('0xb')]=_0x515843[_0x48a2('0xb')]||null;this[_0x48a2('0xc')]=_0x515843[_0x48a2('0xc')]?_0x515843[_0x48a2('0xc')]:null;this[_0x48a2('0xd')]=_0x515843[_0x48a2('0xd')];this['dialOriginateCallerIdNumber']=_0x515843[_0x48a2('0xe')];this[_0x48a2('0xf')]=_0x515843['dialOriginateTimeout']||0x1e;this[_0x48a2('0x10')]=_0x515843[_0x48a2('0x10')];this[_0x48a2('0x11')]=_0x515843[_0x48a2('0x11')];this[_0x48a2('0x12')]=_0x515843['dialBusyMaxRetry'];this[_0x48a2('0x13')]=_0x515843['dialBusyRetryFrequency'];this[_0x48a2('0x14')]=_0x515843['dialNoAnswerMaxRetry'];this[_0x48a2('0x15')]=_0x515843[_0x48a2('0x15')];this[_0x48a2('0x16')]=_0x515843['dialGlobalMaxRetry'];this[_0x48a2('0x17')]=_0x515843['dialNoSuchNumberMaxRetry']||0x3;this[_0x48a2('0x18')]=_0x515843[_0x48a2('0x18')]||0x96;this[_0x48a2('0x19')]=_0x515843[_0x48a2('0x19')]||0x3;this[_0x48a2('0x1a')]=_0x515843[_0x48a2('0x1a')]||0x96;this[_0x48a2('0x1b')]=_0x515843[_0x48a2('0x1b')]||0x3;this[_0x48a2('0x1c')]=_0x515843['dialAbandonedRetryFrequency']||0x96;this[_0x48a2('0x1d')]=_0x515843[_0x48a2('0x1d')]||0x3;this[_0x48a2('0x1e')]=_0x515843[_0x48a2('0x1e')]||0x96;this[_0x48a2('0x1f')]=_0x515843[_0x48a2('0x1f')]||0x3;this[_0x48a2('0x20')]=_0x515843[_0x48a2('0x20')]||0x96;this[_0x48a2('0x21')]=_0x515843[_0x48a2('0x21')]||_0x48a2('0x22');this[_0x48a2('0x23')]=_0x515843[_0x48a2('0x23')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x515843[_0x48a2('0x24')]||undefined;this['dialCutDigit']=_0x515843['dialCutDigit']||undefined;this[_0x48a2('0x25')]=_0x515843[_0x48a2('0x25')]?_0x515843[_0x48a2('0x25')]:undefined;this[_0x48a2('0x26')]=_0x515843[_0x48a2('0x26')]?_0x515843['Trunk']:undefined;this[_0x48a2('0x27')]=_0x515843[_0x48a2('0x27')]?_0x515843[_0x48a2('0x27')]:undefined;this[_0x48a2('0x28')]=_0x515843[_0x48a2('0x28')]?_0x515843['SquareProject']:undefined;this[_0x48a2('0x29')]=_0x515843[_0x48a2('0x28')]?_0x515843['SquareProject'][_0x48a2('0x0')]:undefined;this[_0x48a2('0x2a')]=_0x515843[_0x48a2('0x2a')]||![];this[_0x48a2('0x2b')]=_0x515843[_0x48a2('0x2b')];this[_0x48a2('0x2c')]=_0x515843['dialAMDGreeting'];this[_0x48a2('0x2d')]=_0x515843[_0x48a2('0x2d')];this[_0x48a2('0x2e')]=_0x515843['dialAMDTotalAnalysisTime'];this[_0x48a2('0x2f')]=_0x515843[_0x48a2('0x2f')];this[_0x48a2('0x30')]=_0x515843['dialAMDBetweenWordsSilence'];this[_0x48a2('0x31')]=_0x515843[_0x48a2('0x31')];this[_0x48a2('0x32')]=_0x515843[_0x48a2('0x32')];this['dialAMDMaximumWordLength']=_0x515843[_0x48a2('0x33')];}module[_0x48a2('0x34')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 8167891..5059054 100644 --- a/server/services/ami/model/channel.js +++ b/server/services/ami/model/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5746=['context','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','queue','monitors','transfercalleridnum','transferType','mohtime','exports','starttime','channel','calleridnum','connectedlinenum'];(function(_0x5bee2b,_0x329124){var _0x3d169d=function(_0x241965){while(--_0x241965){_0x5bee2b['push'](_0x5bee2b['shift']());}};_0x3d169d(++_0x329124);}(_0x5746,0x176));var _0x6574=function(_0x320df0,_0x3d9e53){_0x320df0=_0x320df0-0x0;var _0x4b33b5=_0x5746[_0x320df0];return _0x4b33b5;};'use strict';function Channel(){this[_0x6574('0x0')]=null;this[_0x6574('0x1')]='';this['destinationchannel']='';this[_0x6574('0x2')]=0x0;this['calleridname']='';this[_0x6574('0x3')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0x6574('0x4')]='';this['uniqueid']=0x0;this[_0x6574('0x5')]=0x0;this[_0x6574('0x6')]=0x0;this[_0x6574('0x7')]=![];this[_0x6574('0x8')]=null;this[_0x6574('0x9')]=null;this[_0x6574('0xa')]=![];this[_0x6574('0xb')]=![];this[_0x6574('0xc')]='';this[_0x6574('0xd')]='';this[_0x6574('0xe')]=0x0;this[_0x6574('0xf')]=0x0;this[_0x6574('0x10')]=0x0;this[_0x6574('0x11')]=null;this[_0x6574('0x12')]=null;this[_0x6574('0x13')]=null;this[_0x6574('0x14')]=![];this['monitorFilename']=null;this[_0x6574('0x15')]=null;this[_0x6574('0x16')]=[];this[_0x6574('0x17')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x6574('0x18')]=undefined;this[_0x6574('0x19')]=0x0;}module[_0x6574('0x1a')]=Channel; \ No newline at end of file +var _0x431b=['calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','answered','endtime','lastapplication','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel'];(function(_0x1c64da,_0x518f2a){var _0xe50407=function(_0x676414){while(--_0x676414){_0x1c64da['push'](_0x1c64da['shift']());}};_0xe50407(++_0x518f2a);}(_0x431b,0x18d));var _0xb431=function(_0x3b5bc7,_0x1bb500){_0x3b5bc7=_0x3b5bc7-0x0;var _0x1c86c9=_0x431b[_0x3b5bc7];return _0x1c86c9;};'use strict';function Channel(){this[_0xb431('0x0')]=null;this[_0xb431('0x1')]='';this[_0xb431('0x2')]='';this['calleridnum']=0x0;this[_0xb431('0x3')]='';this[_0xb431('0x4')]=undefined;this[_0xb431('0x5')]=undefined;this[_0xb431('0x6')]=0x0;this[_0xb431('0x7')]='';this[_0xb431('0x8')]=0x0;this[_0xb431('0x9')]=0x0;this['exten']=0x0;this[_0xb431('0xa')]=![];this['answertime']=null;this[_0xb431('0xb')]=null;this['unmanaged']=![];this['abandoned']=![];this[_0xb431('0xc')]='';this['lastdata']='';this['duration']=0x0;this[_0xb431('0xd')]=0x0;this[_0xb431('0xe')]=0x0;this[_0xb431('0xf')]=null;this[_0xb431('0x10')]=null;this[_0xb431('0x11')]=null;this[_0xb431('0x12')]=![];this[_0xb431('0x13')]=null;this['queue']=null;this[_0xb431('0x14')]=[];this[_0xb431('0x15')]=undefined;this[_0xb431('0x16')]=undefined;this['transferType']=undefined;this[_0xb431('0x17')]=0x0;}module[_0xb431('0x18')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 4217b9e..d152e75 100644 --- a/server/services/ami/model/deskAccount.js +++ b/server/services/ami/model/deskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c62=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x2b955b,_0x25b512){var _0x28da9f=function(_0x3c8d43){while(--_0x3c8d43){_0x2b955b['push'](_0x2b955b['shift']());}};_0x28da9f(++_0x25b512);}(_0x4c62,0x179));var _0x24c6=function(_0x5369ed,_0x416aa5){_0x5369ed=_0x5369ed-0x0;var _0x49bad1=_0x4c62[_0x5369ed];return _0x49bad1;};'use strict';function DeskAccount(_0x1abf93){this['id']=_0x1abf93['id']||0x0;this[_0x24c6('0x0')]=_0x1abf93['name']||'';this[_0x24c6('0x1')]=_0x1abf93[_0x24c6('0x1')]||'';this[_0x24c6('0x2')]=_0x1abf93[_0x24c6('0x2')]||'';this[_0x24c6('0x3')]=_0x1abf93['authType']||'';this[_0x24c6('0x4')]=_0x1abf93['password']||'';this[_0x24c6('0x5')]=_0x1abf93[_0x24c6('0x5')]||'';this[_0x24c6('0x6')]=_0x1abf93[_0x24c6('0x6')]||'';this['token']=_0x1abf93[_0x24c6('0x7')]||'';this['tokenSecret']=_0x1abf93[_0x24c6('0x8')]||'';this[_0x24c6('0x9')]=_0x1abf93[_0x24c6('0x9')]||'';this[_0x24c6('0xa')]=_0x1abf93[_0x24c6('0xa')]||'';this[_0x24c6('0xb')]=_0x1abf93['Configurations']||{};}module[_0x24c6('0xc')]=DeskAccount; \ No newline at end of file +var _0x6df6=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0x44b7dd,_0x3e2e66){var _0x36ed5a=function(_0xaaffcb){while(--_0xaaffcb){_0x44b7dd['push'](_0x44b7dd['shift']());}};_0x36ed5a(++_0x3e2e66);}(_0x6df6,0x1ab));var _0x66df=function(_0x4e198a,_0x5a6bad){_0x4e198a=_0x4e198a-0x0;var _0xb84bfe=_0x6df6[_0x4e198a];return _0xb84bfe;};'use strict';function DeskAccount(_0x88471b){this['id']=_0x88471b['id']||0x0;this[_0x66df('0x0')]=_0x88471b[_0x66df('0x0')]||'';this[_0x66df('0x1')]=_0x88471b['username']||'';this[_0x66df('0x2')]=_0x88471b[_0x66df('0x2')]||'';this[_0x66df('0x3')]=_0x88471b[_0x66df('0x3')]||'';this['password']=_0x88471b[_0x66df('0x4')]||'';this[_0x66df('0x5')]=_0x88471b[_0x66df('0x5')]||'';this['consumerSecret']=_0x88471b[_0x66df('0x6')]||'';this[_0x66df('0x7')]=_0x88471b[_0x66df('0x7')]||'';this[_0x66df('0x8')]=_0x88471b['tokenSecret']||'';this['type']=_0x88471b[_0x66df('0x9')]||'';this[_0x66df('0xa')]=_0x88471b['serverUrl']||'';this[_0x66df('0xb')]=_0x88471b['Configurations']||{};}module[_0x66df('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 0929344..9a796a7 100644 --- a/server/services/ami/model/dynamics365Account.js +++ b/server/services/ami/model/dynamics365Account.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb5a=['CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations'];(function(_0x2f7ce9,_0x71274a){var _0x52b667=function(_0x263f3f){while(--_0x263f3f){_0x2f7ce9['push'](_0x2f7ce9['shift']());}};_0x52b667(++_0x71274a);}(_0xeb5a,0x70));var _0xaeb5=function(_0x52f158,_0x5689f0){_0x52f158=_0x52f158-0x0;var _0x5c27b7=_0xeb5a[_0x52f158];return _0x5c27b7;};'use strict';function Dynamics365Account(_0x31cda1){this['id']=_0x31cda1['id']||0x0;this[_0xaeb5('0x0')]=_0x31cda1[_0xaeb5('0x0')]||'';this[_0xaeb5('0x1')]=_0x31cda1['username']||'';this[_0xaeb5('0x2')]=_0x31cda1['password']||'';this[_0xaeb5('0x3')]=_0x31cda1[_0xaeb5('0x3')]||'';this[_0xaeb5('0x4')]=_0x31cda1[_0xaeb5('0x4')]||'';this['clientId']=_0x31cda1[_0xaeb5('0x5')]||'';this[_0xaeb5('0x6')]=_0x31cda1['clientSecret']||{};this[_0xaeb5('0x7')]=_0x31cda1[_0xaeb5('0x7')]||'';this['modernAuthentication']=_0x31cda1['modernAuthentication']||![];this[_0xaeb5('0x8')]=_0x31cda1['Configurations']||{};this[_0xaeb5('0x9')]=_0x31cda1['CloudProvider']||{};}module[_0xaeb5('0xa')]=Dynamics365Account; \ No newline at end of file +var _0x61e9=['Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientSecret','serverUrl','modernAuthentication'];(function(_0x402bf4,_0x23d12a){var _0xb8dfdd=function(_0x3cb23c){while(--_0x3cb23c){_0x402bf4['push'](_0x402bf4['shift']());}};_0xb8dfdd(++_0x23d12a);}(_0x61e9,0xea));var _0x961e=function(_0x5394a1,_0x1f6f62){_0x5394a1=_0x5394a1-0x0;var _0x23dcb1=_0x61e9[_0x5394a1];return _0x23dcb1;};'use strict';function Dynamics365Account(_0x14486b){this['id']=_0x14486b['id']||0x0;this[_0x961e('0x0')]=_0x14486b[_0x961e('0x0')]||'';this[_0x961e('0x1')]=_0x14486b[_0x961e('0x1')]||'';this[_0x961e('0x2')]=_0x14486b['password']||'';this[_0x961e('0x3')]=_0x14486b[_0x961e('0x3')]||'';this[_0x961e('0x4')]=_0x14486b['tenantId']||'';this['clientId']=_0x14486b['clientId']||'';this[_0x961e('0x5')]=_0x14486b['clientSecret']||{};this[_0x961e('0x6')]=_0x14486b[_0x961e('0x6')]||'';this[_0x961e('0x7')]=_0x14486b[_0x961e('0x7')]||![];this['Configurations']=_0x14486b[_0x961e('0x8')]||{};this[_0x961e('0x9')]=_0x14486b[_0x961e('0x9')]||{};}module[_0x961e('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 620a9a2..d7d9047 100644 --- a/server/services/ami/model/faxAccount.js +++ b/server/services/ami/model/faxAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb44c=['t38timeout','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect'];(function(_0x2bb612,_0xaedf28){var _0x4ef64c=function(_0x45bcff){while(--_0x45bcff){_0x2bb612['push'](_0x2bb612['shift']());}};_0x4ef64c(++_0xaedf28);}(_0xb44c,0xc8));var _0xcb44=function(_0x17ebb6,_0x465af7){_0x17ebb6=_0x17ebb6-0x0;var _0x32ec22=_0xb44c[_0x17ebb6];return _0x32ec22;};'use strict';function FaxAccount(_0x2d1cd0){this['id']=_0x2d1cd0['id']||0x0;this[_0xcb44('0x0')]=_0x2d1cd0[_0xcb44('0x0')]||'';this['description']=_0x2d1cd0[_0xcb44('0x1')];this[_0xcb44('0x2')]=_0x2d1cd0[_0xcb44('0x2')];this['headerinfo']=_0x2d1cd0[_0xcb44('0x3')];this[_0xcb44('0x4')]=_0x2d1cd0['localstationid'];this[_0xcb44('0x5')]=_0x2d1cd0['minrate']||0x960;this[_0xcb44('0x6')]=_0x2d1cd0['maxrate']||0x3840;this['modem']=_0x2d1cd0[_0xcb44('0x7')]||'v17,v27,v29';this[_0xcb44('0x8')]=_0x2d1cd0['gateway']||'no';this[_0xcb44('0x9')]=_0x2d1cd0[_0xcb44('0x9')]||'no';this[_0xcb44('0xa')]=_0x2d1cd0[_0xcb44('0xa')]||0x1388;this['tech']=_0x2d1cd0['tech']||'SIP';this[_0xcb44('0xb')]=_0x2d1cd0[_0xcb44('0xb')]?_0x2d1cd0[_0xcb44('0xb')]:undefined;this['ListId']=_0x2d1cd0[_0xcb44('0xc')];this['key']=_0x2d1cd0[_0xcb44('0xd')];}module[_0xcb44('0xe')]=FaxAccount; \ No newline at end of file +var _0x838d=['key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId'];(function(_0xb3099,_0x5cb813){var _0x18481c=function(_0x109be7){while(--_0x109be7){_0xb3099['push'](_0xb3099['shift']());}};_0x18481c(++_0x5cb813);}(_0x838d,0xbc));var _0xd838=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x838d[_0x1d9aa0];return _0x226868;};'use strict';function FaxAccount(_0x2eff28){this['id']=_0x2eff28['id']||0x0;this[_0xd838('0x0')]=_0x2eff28[_0xd838('0x0')]||'';this['description']=_0x2eff28[_0xd838('0x1')];this[_0xd838('0x2')]=_0x2eff28[_0xd838('0x2')];this['headerinfo']=_0x2eff28[_0xd838('0x3')];this[_0xd838('0x4')]=_0x2eff28[_0xd838('0x4')];this[_0xd838('0x5')]=_0x2eff28[_0xd838('0x5')]||0x960;this[_0xd838('0x6')]=_0x2eff28['maxrate']||0x3840;this[_0xd838('0x7')]=_0x2eff28[_0xd838('0x7')]||_0xd838('0x8');this[_0xd838('0x9')]=_0x2eff28[_0xd838('0x9')]||'no';this['faxdetect']=_0x2eff28[_0xd838('0xa')]||'no';this['t38timeout']=_0x2eff28[_0xd838('0xb')]||0x1388;this[_0xd838('0xc')]=_0x2eff28[_0xd838('0xc')]||_0xd838('0xd');this[_0xd838('0xe')]=_0x2eff28[_0xd838('0xe')]?_0x2eff28[_0xd838('0xe')]:undefined;this['ListId']=_0x2eff28[_0xd838('0xf')];this[_0xd838('0x10')]=_0x2eff28['key'];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index c76a41a..dd9d28d 100644 --- a/server/services/ami/model/freshdeskAccount.js +++ b/server/services/ami/model/freshdeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa1e7=['remoteUri','serverUrl','Configurations','exports','name','apiKey','token'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa1e7,0x131));var _0x7a1e=function(_0x40f28d,_0x25ff81){_0x40f28d=_0x40f28d-0x0;var _0x4e2cc8=_0xa1e7[_0x40f28d];return _0x4e2cc8;};'use strict';function FreshdeskAccount(_0x51a3fc){this['id']=_0x51a3fc['id']||0x0;this[_0x7a1e('0x0')]=_0x51a3fc[_0x7a1e('0x0')]||'';this['username']=_0x51a3fc['username']||'';this[_0x7a1e('0x1')]=_0x51a3fc[_0x7a1e('0x2')]||'';this[_0x7a1e('0x3')]=_0x51a3fc['remoteUri']||'';this[_0x7a1e('0x4')]=_0x51a3fc[_0x7a1e('0x4')]||'';this['Configurations']=_0x51a3fc[_0x7a1e('0x5')]||{};}module[_0x7a1e('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x6d51=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x59710f,_0x44c7f0){var _0xaae66a=function(_0x1c2397){while(--_0x1c2397){_0x59710f['push'](_0x59710f['shift']());}};_0xaae66a(++_0x44c7f0);}(_0x6d51,0x9e));var _0x16d5=function(_0x17e0e2,_0x1fc3ae){_0x17e0e2=_0x17e0e2-0x0;var _0xdd7a59=_0x6d51[_0x17e0e2];return _0xdd7a59;};'use strict';function FreshdeskAccount(_0x45a55c){this['id']=_0x45a55c['id']||0x0;this['name']=_0x45a55c[_0x16d5('0x0')]||'';this[_0x16d5('0x1')]=_0x45a55c['username']||'';this[_0x16d5('0x2')]=_0x45a55c[_0x16d5('0x3')]||'';this[_0x16d5('0x4')]=_0x45a55c[_0x16d5('0x4')]||'';this[_0x16d5('0x5')]=_0x45a55c[_0x16d5('0x5')]||'';this['Configurations']=_0x45a55c[_0x16d5('0x6')]||{};}module[_0x16d5('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 68dfe9a..bfbc597 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bae=['username','apiKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3e3748,_0x118608){var _0x467996=function(_0x475275){while(--_0x475275){_0x3e3748['push'](_0x3e3748['shift']());}};_0x467996(++_0x118608);}(_0x2bae,0x164));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';function FreshsalesAccount(_0x4fd3d7){this['id']=_0x4fd3d7['id']||0x0;this[_0xe2ba('0x0')]=_0x4fd3d7[_0xe2ba('0x0')]||'';this[_0xe2ba('0x1')]=_0x4fd3d7[_0xe2ba('0x1')]||'';this[_0xe2ba('0x2')]=_0x4fd3d7['token']||'';this[_0xe2ba('0x3')]=_0x4fd3d7['remoteUri']||'';this[_0xe2ba('0x4')]=_0x4fd3d7['serverUrl']||'';this[_0xe2ba('0x5')]=_0x4fd3d7[_0xe2ba('0x5')]||{};}module[_0xe2ba('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0xbfe8=['Configurations','name','username','remoteUri','serverUrl'];(function(_0x4f8378,_0x50f79c){var _0x2abfb6=function(_0x2d26f3){while(--_0x2d26f3){_0x4f8378['push'](_0x4f8378['shift']());}};_0x2abfb6(++_0x50f79c);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x59bc0a,_0x463734){_0x59bc0a=_0x59bc0a-0x0;var _0x3e7b87=_0xbfe8[_0x59bc0a];return _0x3e7b87;};'use strict';function FreshsalesAccount(_0x35f468){this['id']=_0x35f468['id']||0x0;this[_0x8bfe('0x0')]=_0x35f468['name']||'';this[_0x8bfe('0x1')]=_0x35f468[_0x8bfe('0x1')]||'';this['apiKey']=_0x35f468['token']||'';this[_0x8bfe('0x2')]=_0x35f468[_0x8bfe('0x2')]||'';this['serverUrl']=_0x35f468[_0x8bfe('0x3')]||'';this[_0x8bfe('0x4')]=_0x35f468[_0x8bfe('0x4')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 379bbf0..4346331 100644 --- a/server/services/ami/model/queueReport.js +++ b/server/services/ami/model/queueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c11=['queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','holdtime','lastAssignedTo','motionChannel','voice','routealias','mohtime','variables','exports','type','inbound','uniqueid','calleridnum'];(function(_0x1b5f82,_0x3ac47d){var _0x12a91c=function(_0x16215b){while(--_0x16215b){_0x1b5f82['push'](_0x1b5f82['shift']());}};_0x12a91c(++_0x3ac47d);}(_0x1c11,0x14e));var _0x11c1=function(_0x172626,_0x486e78){_0x172626=_0x172626-0x0;var _0xf0aba=_0x1c11[_0x172626];return _0xf0aba;};'use strict';function QueueReport(){this[_0x11c1('0x0')]=_0x11c1('0x1');this[_0x11c1('0x2')]='';this[_0x11c1('0x3')]='';this['calleridname']='';this['queue']='';this[_0x11c1('0x4')]=null;this[_0x11c1('0x5')]=null;this['position']=0x1;this[_0x11c1('0x6')]=0x1;this[_0x11c1('0x7')]=![];this[_0x11c1('0x8')]=null;this[_0x11c1('0x9')]=![];this['queuecallercompleteAt']=null;this[_0x11c1('0xa')]=![];this[_0x11c1('0xb')]=null;this[_0x11c1('0xc')]=0x1;this[_0x11c1('0xd')]='';this[_0x11c1('0xe')]='';this[_0x11c1('0xf')]='';this[_0x11c1('0x10')]='';this[_0x11c1('0x11')]='';this['exten']='';this['priority']='';this[_0x11c1('0x12')]=0x0;this['assigned']=![];this[_0x11c1('0x13')]='';this[_0x11c1('0x14')]=_0x11c1('0x15');this[_0x11c1('0x16')]=null;this[_0x11c1('0x17')]=0x0;this[_0x11c1('0x18')]={};}module[_0x11c1('0x19')]=QueueReport; \ No newline at end of file +var _0xcf30=['accountcode','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','routealias','variables','type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','queuecallerabandon','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum'];(function(_0x7403ef,_0xf36fcd){var _0x5764c7=function(_0x22e5f6){while(--_0x22e5f6){_0x7403ef['push'](_0x7403ef['shift']());}};_0x5764c7(++_0xf36fcd);}(_0xcf30,0x128));var _0x0cf3=function(_0x233db6,_0x28ce66){_0x233db6=_0x233db6-0x0;var _0x4baaa9=_0xcf30[_0x233db6];return _0x4baaa9;};'use strict';function QueueReport(){this[_0x0cf3('0x0')]=_0x0cf3('0x1');this[_0x0cf3('0x2')]='';this[_0x0cf3('0x3')]='';this['calleridname']='';this[_0x0cf3('0x4')]='';this[_0x0cf3('0x5')]=null;this['queuecallerleaveAt']=null;this['position']=0x1;this['count']=0x1;this[_0x0cf3('0x6')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0x0cf3('0x7')]=![];this[_0x0cf3('0x8')]=null;this[_0x0cf3('0x9')]=0x1;this[_0x0cf3('0xa')]='';this[_0x0cf3('0xb')]='';this['connectedlinename']='';this[_0x0cf3('0xc')]='';this['context']='';this[_0x0cf3('0xd')]='';this[_0x0cf3('0xe')]='';this[_0x0cf3('0xf')]=0x0;this[_0x0cf3('0x10')]=![];this[_0x0cf3('0x11')]='';this[_0x0cf3('0x12')]=_0x0cf3('0x13');this[_0x0cf3('0x14')]=null;this['mohtime']=0x0;this[_0x0cf3('0x15')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 8411e68..85c0029 100644 --- a/server/services/ami/model/salesforceAccount.js +++ b/server/services/ami/model/salesforceAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cb4=['password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name','remoteUri'];(function(_0x207740,_0x1a4a2a){var _0x1e424f=function(_0x6910f9){while(--_0x6910f9){_0x207740['push'](_0x207740['shift']());}};_0x1e424f(++_0x1a4a2a);}(_0x5cb4,0xc6));var _0x45cb=function(_0xc125ad,_0x384f79){_0xc125ad=_0xc125ad-0x0;var _0x42e8d9=_0x5cb4[_0xc125ad];return _0x42e8d9;};'use strict';function SalesforceAccount(_0x25b61d){this['id']=_0x25b61d['id']||0x0;this['name']=_0x25b61d[_0x45cb('0x0')]||'';this['username']=_0x25b61d['username']||'';this[_0x45cb('0x1')]=_0x25b61d[_0x45cb('0x1')]||'';this[_0x45cb('0x2')]=_0x25b61d[_0x45cb('0x2')]||'';this[_0x45cb('0x3')]=_0x25b61d[_0x45cb('0x3')]||'';this[_0x45cb('0x4')]=_0x25b61d[_0x45cb('0x4')]||'';this[_0x45cb('0x5')]=_0x25b61d[_0x45cb('0x5')]||'';this[_0x45cb('0x6')]=_0x25b61d[_0x45cb('0x6')]||'integrationTab';this[_0x45cb('0x7')]=_0x25b61d[_0x45cb('0x7')]||'';this[_0x45cb('0x8')]=_0x25b61d[_0x45cb('0x8')]||{};}module[_0x45cb('0x9')]=SalesforceAccount; \ No newline at end of file +var _0x5f01=['integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x45cbd1,_0x5666b0){var _0x2064dc=function(_0x589220){while(--_0x589220){_0x45cbd1['push'](_0x45cbd1['shift']());}};_0x2064dc(++_0x5666b0);}(_0x5f01,0x19c));var _0x15f0=function(_0xbfdd7e,_0x1be4bf){_0xbfdd7e=_0xbfdd7e-0x0;var _0x1c4703=_0x5f01[_0xbfdd7e];return _0x1c4703;};'use strict';function SalesforceAccount(_0x2ed489){this['id']=_0x2ed489['id']||0x0;this[_0x15f0('0x0')]=_0x2ed489[_0x15f0('0x0')]||'';this[_0x15f0('0x1')]=_0x2ed489[_0x15f0('0x1')]||'';this[_0x15f0('0x2')]=_0x2ed489[_0x15f0('0x2')]||'';this[_0x15f0('0x3')]=_0x2ed489[_0x15f0('0x3')]||'';this[_0x15f0('0x4')]=_0x2ed489['clientId']||'';this[_0x15f0('0x5')]=_0x2ed489[_0x15f0('0x5')]||'';this[_0x15f0('0x6')]=_0x2ed489[_0x15f0('0x6')]||'';this[_0x15f0('0x7')]=_0x2ed489[_0x15f0('0x7')]||_0x15f0('0x8');this[_0x15f0('0x9')]=_0x2ed489[_0x15f0('0x9')]||'';this[_0x15f0('0xa')]=_0x2ed489[_0x15f0('0xa')]||{};}module[_0x15f0('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 218dd4e..45479a6 100644 --- a/server/services/ami/model/servicenowAccount.js +++ b/server/services/ami/model/servicenowAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd47=['password','remoteUri','serverUrl','Configurations','username'];(function(_0x218ca4,_0x41cc40){var _0x1b3ff9=function(_0x5003cd){while(--_0x5003cd){_0x218ca4['push'](_0x218ca4['shift']());}};_0x1b3ff9(++_0x41cc40);}(_0xbd47,0x108));var _0x7bd4=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xbd47[_0x15c421];return _0x5e5ed5;};'use strict';function ServicenowAccount(_0x340775){this['id']=_0x340775['id']||0x0;this['name']=_0x340775['name']||'';this[_0x7bd4('0x0')]=_0x340775[_0x7bd4('0x0')]||'';this[_0x7bd4('0x1')]=_0x340775[_0x7bd4('0x1')]||'';this[_0x7bd4('0x2')]=_0x340775[_0x7bd4('0x2')]||'';this['serverUrl']=_0x340775[_0x7bd4('0x3')]||'';this[_0x7bd4('0x4')]=_0x340775[_0x7bd4('0x4')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x7891=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x979574,_0x20d84d){var _0x32ad1a=function(_0x331aec){while(--_0x331aec){_0x979574['push'](_0x979574['shift']());}};_0x32ad1a(++_0x20d84d);}(_0x7891,0xee));var _0x1789=function(_0x3f133,_0x212b86){_0x3f133=_0x3f133-0x0;var _0x5b0f16=_0x7891[_0x3f133];return _0x5b0f16;};'use strict';function ServicenowAccount(_0x1909e9){this['id']=_0x1909e9['id']||0x0;this[_0x1789('0x0')]=_0x1909e9[_0x1789('0x0')]||'';this[_0x1789('0x1')]=_0x1909e9[_0x1789('0x1')]||'';this[_0x1789('0x2')]=_0x1909e9[_0x1789('0x2')]||'';this['remoteUri']=_0x1909e9[_0x1789('0x3')]||'';this[_0x1789('0x4')]=_0x1909e9[_0x1789('0x4')]||'';this[_0x1789('0x5')]=_0x1909e9[_0x1789('0x5')]||{};}module[_0x1789('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 545181e..3b3206d 100644 --- a/server/services/ami/model/sugarcrmAccount.js +++ b/server/services/ami/model/sugarcrmAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d55=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0x7d55,0x1bc));var _0x57d5=function(_0x27576a,_0x75d731){_0x27576a=_0x27576a-0x0;var _0x47d70e=_0x7d55[_0x27576a];return _0x47d70e;};'use strict';function SugarcrmAccount(_0x3f2e19){this['id']=_0x3f2e19['id']||0x0;this[_0x57d5('0x0')]=_0x3f2e19[_0x57d5('0x0')]||'';this[_0x57d5('0x1')]=_0x3f2e19['username']||'';this['password']=_0x3f2e19[_0x57d5('0x2')]||'';this[_0x57d5('0x3')]=_0x3f2e19[_0x57d5('0x3')]||'';this['serverUrl']=_0x3f2e19[_0x57d5('0x4')]||'';this[_0x57d5('0x5')]=_0x3f2e19[_0x57d5('0x5')]||{};}module[_0x57d5('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x66d0=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x66d0,0x135));var _0x066d=function(_0x39caaa,_0x1f37bc){_0x39caaa=_0x39caaa-0x0;var _0x9b9c7d=_0x66d0[_0x39caaa];return _0x9b9c7d;};'use strict';function SugarcrmAccount(_0x110bb2){this['id']=_0x110bb2['id']||0x0;this[_0x066d('0x0')]=_0x110bb2[_0x066d('0x0')]||'';this[_0x066d('0x1')]=_0x110bb2[_0x066d('0x1')]||'';this['password']=_0x110bb2[_0x066d('0x2')]||'';this[_0x066d('0x3')]=_0x110bb2['remoteUri']||'';this[_0x066d('0x4')]=_0x110bb2['serverUrl']||'';this[_0x066d('0x5')]=_0x110bb2['Configurations']||{};}module[_0x066d('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index a2c2049..91407a3 100644 --- a/server/services/ami/model/telephone.js +++ b/server/services/ami/model/telephone.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d40=['status','address','name','accountcode','state','unknown','stateTime'];(function(_0x4da959,_0x25242d){var _0x2b25e0=function(_0x43bb07){while(--_0x43bb07){_0x4da959['push'](_0x4da959['shift']());}};_0x2b25e0(++_0x25242d);}(_0x6d40,0x1ec));var _0x06d4=function(_0x32deab,_0x350e85){_0x32deab=_0x32deab-0x0;var _0x21893b=_0x6d40[_0x32deab];return _0x21893b;};'use strict';function Telephone(_0x1bbff8){this['id']=_0x1bbff8['id']||0x0;this[_0x06d4('0x0')]=_0x1bbff8['name']||'';this[_0x06d4('0x1')]=_0x1bbff8[_0x06d4('0x1')]||'';this[_0x06d4('0x2')]=_0x06d4('0x3');this[_0x06d4('0x4')]=0x0;this[_0x06d4('0x5')]=_0x06d4('0x3');this[_0x06d4('0x6')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x6c4d=['exports','name','accountcode','state','unknown','stateTime','status'];(function(_0x472388,_0x32e433){var _0x32eccf=function(_0xa1521a){while(--_0xa1521a){_0x472388['push'](_0x472388['shift']());}};_0x32eccf(++_0x32e433);}(_0x6c4d,0x1dd));var _0xd6c4=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6c4d[_0x502c7d];return _0x30b7ed;};'use strict';function Telephone(_0x17f324){this['id']=_0x17f324['id']||0x0;this['name']=_0x17f324[_0xd6c4('0x0')]||'';this['accountcode']=_0x17f324[_0xd6c4('0x1')]||'';this[_0xd6c4('0x2')]=_0xd6c4('0x3');this[_0xd6c4('0x4')]=0x0;this[_0xd6c4('0x5')]=_0xd6c4('0x3');this['address']='';}module[_0xd6c4('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 02fba90..7e92f04 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x19c510,_0xf133be){var _0x160e49=function(_0x57c8f4){while(--_0x57c8f4){_0x19c510['push'](_0x19c510['shift']());}};_0x160e49(++_0xf133be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x149b59,_0x3c6b8a){var _0x16f2ee=function(_0x59298f){while(--_0x59298f){_0x149b59['push'](_0x149b59['shift']());}};_0x16f2ee(++_0x3c6b8a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 3c82511..2adf635 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x18a21d,_0x2d3bda){var _0x21dcbc=function(_0xce6f5d){while(--_0xce6f5d){_0x18a21d['push'](_0x18a21d['shift']());}};_0x21dcbc(++_0x2d3bda);}(_0xb10b,0x12a));var _0xbb10=function(_0x3f7101,_0x3af08b){_0x3f7101=_0x3f7101-0x0;var _0x1a30a0=_0xb10b[_0x3f7101];return _0x1a30a0;};'use strict';function Trigger(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'voice';this[_0xbb10('0x2')]=_0x13ce8d[_0xbb10('0x2')]||![];this[_0xbb10('0x3')]=_0x13ce8d[_0xbb10('0x3')]||[];this[_0xbb10('0x4')]=_0x13ce8d[_0xbb10('0x4')]||[];this['Actions']=_0x13ce8d[_0xbb10('0x5')]||[];}module[_0xbb10('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index b133bdc..9a9c1aa 100644 --- a/server/services/ami/model/trunk.js +++ b/server/services/ami/model/trunk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x72be=['unknown','stateTime','status','registry','indexOf','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x72be,0x1ee));var _0xe72b=function(_0x567932,_0x168e94){_0x567932=_0x567932-0x0;var _0x914ea5=_0x72be[_0x567932];return _0x914ea5;};'use strict';function Trunk(_0x4c046a){this['id']=_0x4c046a['id']||0x0;this[_0xe72b('0x0')]=_0x4c046a[_0xe72b('0x0')]||![];this['name']=_0x4c046a[_0xe72b('0x1')]||'';this['state']=_0xe72b('0x2');this[_0xe72b('0x3')]=0x0;this[_0xe72b('0x4')]=_0xe72b('0x2');this[_0xe72b('0x5')]=_0x4c046a[_0xe72b('0x5')]&&_0x4c046a[_0xe72b('0x5')][_0xe72b('0x6')](':')?_0x4c046a[_0xe72b('0x5')]['split'](':')[0x0]:'';this['host']='';this[_0xe72b('0x7')]='';this[_0xe72b('0x8')]='';this[_0xe72b('0x9')]='';this[_0xe72b('0xa')]='';this[_0xe72b('0xb')]='unknown';this[_0xe72b('0xc')]='';this[_0xe72b('0xd')]='';this[_0xe72b('0xe')]=_0x4c046a[_0xe72b('0xe')]||'';}module[_0xe72b('0xf')]=Trunk; \ No newline at end of file +var _0x205e=['domain','domainport','refresh','stateRegistry','registrationtime','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x205e,0x1c7));var _0xe205=function(_0x1c6d59,_0x25b8b0){_0x1c6d59=_0x1c6d59-0x0;var _0x2dfd1d=_0x205e[_0x1c6d59];return _0x2dfd1d;};'use strict';function Trunk(_0xa6f4a9){this['id']=_0xa6f4a9['id']||0x0;this[_0xe205('0x0')]=_0xa6f4a9['active']||![];this[_0xe205('0x1')]=_0xa6f4a9[_0xe205('0x1')]||'';this[_0xe205('0x2')]=_0xe205('0x3');this[_0xe205('0x4')]=0x0;this[_0xe205('0x5')]=_0xe205('0x3');this[_0xe205('0x6')]=_0xa6f4a9['registry']&&_0xa6f4a9[_0xe205('0x6')][_0xe205('0x7')](':')?_0xa6f4a9[_0xe205('0x6')][_0xe205('0x8')](':')[0x0]:'';this['host']='';this['port']='';this[_0xe205('0x9')]='';this[_0xe205('0xa')]='';this[_0xe205('0xb')]='';this[_0xe205('0xc')]='unknown';this[_0xe205('0xd')]='';this['address']='';this[_0xe205('0xe')]=_0xa6f4a9[_0xe205('0xe')]||'';}module[_0xe205('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 6b053c7..5603f96 100644 --- a/server/services/ami/model/voiceExtension.js +++ b/server/services/ami/model/voiceExtension.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x860d=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x195223,_0x121404){var _0x3a62dd=function(_0x3adeda){while(--_0x3adeda){_0x195223['push'](_0x195223['shift']());}};_0x3a62dd(++_0x121404);}(_0x860d,0x18c));var _0xd860=function(_0x23f19e,_0x4d583b){_0x23f19e=_0x23f19e-0x0;var _0x2a95d4=_0x860d[_0x23f19e];return _0x2a95d4;};'use strict';function voiceExtension(_0x19bbcd){this['id']=_0x19bbcd['id']||0x0;this[_0xd860('0x0')]=_0x19bbcd[_0xd860('0x0')]||'';this[_0xd860('0x1')]=_0x19bbcd[_0xd860('0x1')]||_0xd860('0x2');this['mandatoryDisposition']=_0x19bbcd[_0xd860('0x3')]||![];}module[_0xd860('0x4')]=voiceExtension; \ No newline at end of file +var _0xc35f=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x37b2db,_0x361844){var _0x34e762=function(_0x2cd9e8){while(--_0x2cd9e8){_0x37b2db['push'](_0x37b2db['shift']());}};_0x34e762(++_0x361844);}(_0xc35f,0xfc));var _0xfc35=function(_0xbb2e32,_0x143fc0){_0xbb2e32=_0xbb2e32-0x0;var _0xd1ed21=_0xc35f[_0xbb2e32];return _0xd1ed21;};'use strict';function voiceExtension(_0x27ce41){this['id']=_0x27ce41['id']||0x0;this[_0xfc35('0x0')]=_0x27ce41[_0xfc35('0x0')]||'';this[_0xfc35('0x1')]=_0x27ce41['recordingFormat']||_0xfc35('0x2');this[_0xfc35('0x3')]=_0x27ce41[_0xfc35('0x3')]||![];}module[_0xfc35('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 9a66e09..b68d69f 100644 --- a/server/services/ami/model/voiceQueue.js +++ b/server/services/ami/model/voiceQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a43=['unavailable','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','wav','wav49','gsm','fewestcalls','leastrecent','linear','random','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','abandoned','busy','inUse','invalid','notInUse','onHold','paused','ringing','talking'];(function(_0x2a8e65,_0x2ebc24){var _0x137b46=function(_0x383ed8){while(--_0x383ed8){_0x2a8e65['push'](_0x2a8e65['shift']());}};_0x137b46(++_0x2ebc24);}(_0x5a43,0xf1));var _0x35a4=function(_0x523ffe,_0x4ec00a){_0x523ffe=_0x523ffe-0x0;var _0x50fce8=_0x5a43[_0x523ffe];return _0x50fce8;};'use strict';var monitorFormat={'wav':_0x35a4('0x0'),'wav49':_0x35a4('0x1'),'gsm':_0x35a4('0x2')};var strategy={'fewestcalls':_0x35a4('0x3'),'leastrecent':_0x35a4('0x4'),'linear':_0x35a4('0x5'),'random':_0x35a4('0x6'),'ringall':'ringall','rr':'roundrobin','rrmemory':'rrmemory','rrordered':'rrordered','wrandom':_0x35a4('0x7')};function VoiceQueue(_0x38c350){this['id']=_0x38c350['id']||0x0;this[_0x35a4('0x8')]=_0x38c350[_0x35a4('0x8')]||'';this[_0x35a4('0x9')]=_0x38c350[_0x35a4('0x9')]||'';this['type']=_0x38c350[_0x35a4('0xa')]||_0x35a4('0xb');this[_0x35a4('0xc')]=0x0;this[_0x35a4('0xd')]=0x0;this[_0x35a4('0xe')]=0x0;this[_0x35a4('0xf')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0x35a4('0x10')]=0x0;this['available']=0x0;this[_0x35a4('0x11')]=0x0;this[_0x35a4('0x12')]=0x0;this[_0x35a4('0x13')]=0x0;this['loggedIn']=0x0;this[_0x35a4('0x14')]=0x0;this[_0x35a4('0x15')]=0x0;this[_0x35a4('0x16')]=0x0;this[_0x35a4('0x17')]=0x0;this['ringInUse']=0x0;this[_0x35a4('0x18')]=0x0;this[_0x35a4('0x19')]=0x0;this['unknown']=0x0;this[_0x35a4('0x1a')]=_0x38c350['acw']||![];this[_0x35a4('0x1b')]=_0x38c350[_0x35a4('0x1b')]||0xa;this[_0x35a4('0x1c')]=_0x38c350[_0x35a4('0x1c')]||'no';this[_0x35a4('0x1d')]=!![];this[_0x35a4('0x1e')]='';this[_0x35a4('0x1f')]='';this[_0x35a4('0x20')]=0x0;this[_0x35a4('0x21')]=0x0;this['dialTimezone']=_0x38c350[_0x35a4('0x22')]||null;this[_0x35a4('0x23')]=_0x38c350[_0x35a4('0x23')]?_0x38c350[_0x35a4('0x23')]:null;this[_0x35a4('0x24')]=_0x38c350[_0x35a4('0x24')];this[_0x35a4('0x25')]=_0x38c350[_0x35a4('0x25')]||'progressive';this[_0x35a4('0x26')]=_0x38c350['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x38c350[_0x35a4('0x27')]||0x0;this[_0x35a4('0x28')]=_0x38c350[_0x35a4('0x28')]||0x1;this['dialPredictiveOptimization']=_0x38c350[_0x35a4('0x29')]||_0x35a4('0x2a');this[_0x35a4('0x2b')]=_0x38c350['dialPredictiveOptimizationPercentage']||0.03;this[_0x35a4('0x2c')]=_0x38c350[_0x35a4('0x2c')]||0x258;this['dialOriginateCallerIdName']=_0x38c350[_0x35a4('0x2d')]||_0x35a4('0x2e');this[_0x35a4('0x2f')]=_0x38c350[_0x35a4('0x2f')]||'anonymous';this['dialOriginateTimeout']=_0x38c350[_0x35a4('0x30')]||0x1e;this['dialQueueOptions']=_0x38c350[_0x35a4('0x31')]||_0x35a4('0x32');this[_0x35a4('0x33')]=_0x38c350[_0x35a4('0x33')]||0x3;this[_0x35a4('0x34')]=_0x38c350[_0x35a4('0x34')]||undefined;this['dialCongestionMaxRetry']=_0x38c350['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x38c350[_0x35a4('0x35')]||0x96;this[_0x35a4('0x36')]=_0x38c350['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x38c350[_0x35a4('0x37')]||0x96;this[_0x35a4('0x38')]=_0x38c350[_0x35a4('0x38')]||0x3;this[_0x35a4('0x39')]=_0x38c350['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x38c350['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x38c350[_0x35a4('0x3a')]||0x96;this[_0x35a4('0x3b')]=_0x38c350[_0x35a4('0x3b')]||0x3;this[_0x35a4('0x3c')]=_0x38c350[_0x35a4('0x3c')]||0x96;this[_0x35a4('0x3d')]=_0x38c350[_0x35a4('0x3d')]||0x3;this[_0x35a4('0x3e')]=_0x38c350[_0x35a4('0x3e')]||0x96;this[_0x35a4('0x3f')]=_0x38c350[_0x35a4('0x3f')]||0x3;this[_0x35a4('0x40')]=_0x38c350[_0x35a4('0x40')]||0x96;this[_0x35a4('0x41')]=_0x38c350[_0x35a4('0x41')]||0x3;this[_0x35a4('0x42')]=_0x38c350['dialAgentRejectRetryFrequency']||0x96;this[_0x35a4('0x43')]=_0x38c350[_0x35a4('0x43')]||0x3;this[_0x35a4('0x44')]=_0x38c350['dialGlobalMaxRetry']||0x4;this[_0x35a4('0x45')]=_0x38c350[_0x35a4('0x45')]?_0x38c350[_0x35a4('0x45')]:undefined;this['TrunkBackup']=_0x38c350['TrunkBackup']?_0x38c350[_0x35a4('0x46')]:undefined;this['dialPrefix']=_0x38c350[_0x35a4('0x47')]||undefined;this[_0x35a4('0x48')]=_0x38c350[_0x35a4('0x48')]?_0x38c350['Interval']:undefined;this['dialOrderByScheduledAt']=_0x38c350[_0x35a4('0x49')]||_0x35a4('0x4a');this[_0x35a4('0x4b')]=_0x38c350[_0x35a4('0x4b')]||undefined;this[_0x35a4('0x4c')]=_0x38c350[_0x35a4('0x4c')]||undefined;this[_0x35a4('0x4d')]=strategy[_0x38c350[_0x35a4('0x4d')]];this['queueStatusComplete']=!![];this['dialAMDActive']=_0x38c350[_0x35a4('0x4e')]||![];this[_0x35a4('0x4f')]=_0x38c350[_0x35a4('0x4f')];this[_0x35a4('0x50')]=_0x38c350[_0x35a4('0x50')];this['dialAMDAfterGreetingSilence']=_0x38c350[_0x35a4('0x51')];this['dialAMDTotalAnalysisTime']=_0x38c350[_0x35a4('0x52')];this['dialAMDMinWordLength']=_0x38c350[_0x35a4('0x53')];this[_0x35a4('0x54')]=_0x38c350[_0x35a4('0x54')];this[_0x35a4('0x55')]=_0x38c350[_0x35a4('0x55')];this[_0x35a4('0x56')]=_0x38c350['dialAMDSilenceThreshold'];this[_0x35a4('0x57')]=_0x38c350[_0x35a4('0x57')];this[_0x35a4('0x58')]=0x0;this[_0x35a4('0x59')]=0x0;this[_0x35a4('0x5a')]=_0x38c350[_0x35a4('0x5a')];this[_0x35a4('0x5b')]=0x0;this[_0x35a4('0x5c')]=0x0;this[_0x35a4('0x5d')]=0x0;this[_0x35a4('0x5e')]=0x0;this[_0x35a4('0x5f')]=0x0;this[_0x35a4('0x60')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x35a4('0x61')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x35a4('0x62')]=0x0;this[_0x35a4('0x63')]=0x0;this[_0x35a4('0x64')]=0x0;this[_0x35a4('0x65')]=0x0;this[_0x35a4('0x66')]=0x0;this[_0x35a4('0x67')]=undefined;this[_0x35a4('0x68')]=undefined;this[_0x35a4('0x69')]=undefined;this[_0x35a4('0x6a')]=1.05;this[_0x35a4('0x6b')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x35a4('0x6c')]=0x0;this[_0x35a4('0x6d')]=0x0;this[_0x35a4('0x6e')]=0x0;this[_0x35a4('0x6f')]=0x0;this[_0x35a4('0x70')]=0x0;this[_0x35a4('0x71')]=0x0;this[_0x35a4('0x72')]=_0x38c350['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x35a4('0x73')]=_0x38c350[_0x35a4('0x74')]||0xa;this[_0x35a4('0x75')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x35a4('0x76')]=0x1;this[_0x35a4('0x77')]=0x0;this[_0x35a4('0x78')]=0x0;this[_0x35a4('0x79')]=0x0;this[_0x35a4('0x7a')]=0x0;this[_0x35a4('0x7b')]=_0x38c350[_0x35a4('0x7b')]||0x1e;this['dialRecallInQueue']=_0x38c350[_0x35a4('0x7c')]||![];this['dialPreviewAutoRecallMe']=!!_0x38c350[_0x35a4('0x7d')]||![];this[_0x35a4('0x7e')]=!!_0x38c350[_0x35a4('0x7e')]||![];this[_0x35a4('0x7f')]=_0x38c350['dialQueueProject2']||undefined;this[_0x35a4('0x80')]=_0x38c350[_0x35a4('0x80')]||![];this[_0x35a4('0x81')]=_0x38c350[_0x35a4('0x81')]||![];this[_0x35a4('0x9')]=monitorFormat[_0x38c350[_0x35a4('0x9')]]?monitorFormat[_0x38c350[_0x35a4('0x9')]]:undefined;this[_0x35a4('0x82')]=_0x38c350[_0x35a4('0x82')]||![];this['mandatoryDispositionPause']=_0x38c350[_0x35a4('0x83')]?_0x38c350[_0x35a4('0x83')]:undefined;this['queueSummaryCountersUpdated']=![];}module[_0x35a4('0x84')]=VoiceQueue; \ No newline at end of file +var _0x2bae=['progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','wav','wav49','gsm','fewestcalls','leastrecent','linear','ringall','rrmemory','wrandom','name','monitor_format','type','total','answered','sumDuration','sumHoldTime','sumBillable','abandoned','available','busy','inUse','invalid','loggedIn','notInUse','onHold','paused','ringing','ringInUse','unavailable','unknown','acw','acwTimeout','autopause','message','statusMessage','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x2bae,0x164));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var monitorFormat={'wav':_0xe2ba('0x0'),'wav49':_0xe2ba('0x1'),'gsm':_0xe2ba('0x2')};var strategy={'fewestcalls':_0xe2ba('0x3'),'leastrecent':_0xe2ba('0x4'),'linear':_0xe2ba('0x5'),'random':'random','ringall':_0xe2ba('0x6'),'rr':'roundrobin','rrmemory':_0xe2ba('0x7'),'rrordered':'rrordered','wrandom':_0xe2ba('0x8')};function VoiceQueue(_0x129677){this['id']=_0x129677['id']||0x0;this[_0xe2ba('0x9')]=_0x129677['name']||'';this[_0xe2ba('0xa')]=_0x129677[_0xe2ba('0xa')]||'';this[_0xe2ba('0xb')]=_0x129677[_0xe2ba('0xb')]||'inbound';this['waiting']=0x0;this[_0xe2ba('0xc')]=0x0;this[_0xe2ba('0xd')]=0x0;this[_0xe2ba('0xe')]=0x0;this[_0xe2ba('0xf')]=0x0;this[_0xe2ba('0x10')]=0x0;this['unmanaged']=0x0;this[_0xe2ba('0x11')]=0x0;this[_0xe2ba('0x12')]=0x0;this[_0xe2ba('0x13')]=0x0;this[_0xe2ba('0x14')]=0x0;this[_0xe2ba('0x15')]=0x0;this[_0xe2ba('0x16')]=0x0;this[_0xe2ba('0x17')]=0x0;this[_0xe2ba('0x18')]=0x0;this[_0xe2ba('0x19')]=0x0;this[_0xe2ba('0x1a')]=0x0;this[_0xe2ba('0x1b')]=0x0;this['talking']=0x0;this[_0xe2ba('0x1c')]=0x0;this[_0xe2ba('0x1d')]=0x0;this[_0xe2ba('0x1e')]=_0x129677[_0xe2ba('0x1e')]||![];this[_0xe2ba('0x1f')]=_0x129677[_0xe2ba('0x1f')]||0xa;this[_0xe2ba('0x20')]=_0x129677[_0xe2ba('0x20')]||'no';this['sendMessageOneNotActive']=!![];this[_0xe2ba('0x21')]='';this[_0xe2ba('0x22')]='';this[_0xe2ba('0x23')]=0x0;this['temp']=0x0;this[_0xe2ba('0x24')]=_0x129677[_0xe2ba('0x24')]||null;this[_0xe2ba('0x25')]=_0x129677[_0xe2ba('0x25')]?_0x129677[_0xe2ba('0x25')]:null;this[_0xe2ba('0x26')]=_0x129677[_0xe2ba('0x26')];this[_0xe2ba('0x27')]=_0x129677[_0xe2ba('0x27')]||_0xe2ba('0x28');this[_0xe2ba('0x29')]=_0x129677['dialLimitChannel']||0x0;this[_0xe2ba('0x2a')]=_0x129677[_0xe2ba('0x2a')]||0x0;this['dialPowerLevel']=_0x129677[_0xe2ba('0x2b')]||0x1;this['dialPredictiveOptimization']=_0x129677[_0xe2ba('0x2c')]||_0xe2ba('0x2d');this[_0xe2ba('0x2e')]=_0x129677['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x129677[_0xe2ba('0x2f')]||0x258;this[_0xe2ba('0x30')]=_0x129677['dialOriginateCallerIdName']||'anonymous';this['dialOriginateCallerIdNumber']=_0x129677[_0xe2ba('0x31')]||_0xe2ba('0x32');this[_0xe2ba('0x33')]=_0x129677[_0xe2ba('0x33')]||0x1e;this['dialQueueOptions']=_0x129677[_0xe2ba('0x34')]||_0xe2ba('0x35');this['dialQueueTimeout']=_0x129677[_0xe2ba('0x36')]||0x3;this[_0xe2ba('0x37')]=_0x129677[_0xe2ba('0x37')]||undefined;this[_0xe2ba('0x38')]=_0x129677[_0xe2ba('0x38')]||0x3;this[_0xe2ba('0x39')]=_0x129677[_0xe2ba('0x39')]||0x96;this[_0xe2ba('0x3a')]=_0x129677['dialBusyMaxRetry']||0x3;this[_0xe2ba('0x3b')]=_0x129677['dialBusyRetryFrequency']||0x96;this[_0xe2ba('0x3c')]=_0x129677['dialNoAnswerMaxRetry']||0x3;this[_0xe2ba('0x3d')]=_0x129677[_0xe2ba('0x3d')]||0x96;this[_0xe2ba('0x3e')]=_0x129677['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x129677[_0xe2ba('0x3f')]||0x96;this[_0xe2ba('0x40')]=_0x129677[_0xe2ba('0x40')]||0x3;this['dialDropRetryFrequency']=_0x129677[_0xe2ba('0x41')]||0x96;this[_0xe2ba('0x42')]=_0x129677[_0xe2ba('0x42')]||0x3;this[_0xe2ba('0x43')]=_0x129677[_0xe2ba('0x43')]||0x96;this[_0xe2ba('0x44')]=_0x129677[_0xe2ba('0x44')]||0x3;this['dialMachineRetryFrequency']=_0x129677[_0xe2ba('0x45')]||0x96;this['dialAgentRejectMaxRetry']=_0x129677[_0xe2ba('0x46')]||0x3;this[_0xe2ba('0x47')]=_0x129677['dialAgentRejectRetryFrequency']||0x96;this['callAdditionalPhoneAfterMin']=_0x129677[_0xe2ba('0x48')]||0x3;this['dialGlobalMaxRetry']=_0x129677[_0xe2ba('0x49')]||0x4;this[_0xe2ba('0x4a')]=_0x129677[_0xe2ba('0x4a')]?_0x129677[_0xe2ba('0x4a')]:undefined;this[_0xe2ba('0x4b')]=_0x129677[_0xe2ba('0x4b')]?_0x129677[_0xe2ba('0x4b')]:undefined;this[_0xe2ba('0x4c')]=_0x129677[_0xe2ba('0x4c')]||undefined;this[_0xe2ba('0x4d')]=_0x129677[_0xe2ba('0x4d')]?_0x129677[_0xe2ba('0x4d')]:undefined;this[_0xe2ba('0x4e')]=_0x129677[_0xe2ba('0x4e')]||'DESC';this[_0xe2ba('0x4f')]=_0x129677[_0xe2ba('0x4f')]||undefined;this[_0xe2ba('0x50')]=_0x129677[_0xe2ba('0x50')]||undefined;this[_0xe2ba('0x51')]=strategy[_0x129677[_0xe2ba('0x51')]];this[_0xe2ba('0x52')]=!![];this[_0xe2ba('0x53')]=_0x129677['dialAMDActive']||![];this[_0xe2ba('0x54')]=_0x129677[_0xe2ba('0x54')];this[_0xe2ba('0x55')]=_0x129677[_0xe2ba('0x55')];this[_0xe2ba('0x56')]=_0x129677[_0xe2ba('0x56')];this[_0xe2ba('0x57')]=_0x129677['dialAMDTotalAnalysisTime'];this[_0xe2ba('0x58')]=_0x129677[_0xe2ba('0x58')];this[_0xe2ba('0x59')]=_0x129677[_0xe2ba('0x59')];this[_0xe2ba('0x5a')]=_0x129677[_0xe2ba('0x5a')];this[_0xe2ba('0x5b')]=_0x129677[_0xe2ba('0x5b')];this[_0xe2ba('0x5c')]=_0x129677[_0xe2ba('0x5c')];this[_0xe2ba('0x5d')]=0x0;this['pTalking']=0x0;this[_0xe2ba('0x5e')]=_0x129677[_0xe2ba('0x5e')];this[_0xe2ba('0x5f')]=0x0;this[_0xe2ba('0x60')]=0x0;this[_0xe2ba('0x61')]=0x0;this[_0xe2ba('0x62')]=0x0;this[_0xe2ba('0x63')]=0x0;this[_0xe2ba('0x64')]=0x0;this[_0xe2ba('0x65')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xe2ba('0x66')]=0x0;this[_0xe2ba('0x67')]=0x0;this[_0xe2ba('0x68')]=0x0;this[_0xe2ba('0x69')]=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0xe2ba('0x6a')]=undefined;this[_0xe2ba('0x6b')]=undefined;this['handlePredictive']=undefined;this[_0xe2ba('0x6c')]=1.05;this[_0xe2ba('0x6d')]=0x0;this[_0xe2ba('0x6e')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xe2ba('0x6f')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xe2ba('0x70')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xe2ba('0x71')]=0x0;this[_0xe2ba('0x72')]=_0x129677[_0xe2ba('0x73')]||0x14;this['predictiveIntervalMinThreshold']=_0x129677[_0xe2ba('0x73')]||0xa;this[_0xe2ba('0x74')]=0x0;this[_0xe2ba('0x75')]=0x0;this[_0xe2ba('0x76')]=0x1;this[_0xe2ba('0x77')]=0x0;this[_0xe2ba('0x78')]=0x0;this[_0xe2ba('0x79')]=0x0;this[_0xe2ba('0x7a')]=0x0;this[_0xe2ba('0x7b')]=_0x129677[_0xe2ba('0x7b')]||0x1e;this[_0xe2ba('0x7c')]=_0x129677[_0xe2ba('0x7c')]||![];this[_0xe2ba('0x7d')]=!!_0x129677[_0xe2ba('0x7d')]||![];this[_0xe2ba('0x7e')]=!!_0x129677[_0xe2ba('0x7e')]||![];this[_0xe2ba('0x7f')]=_0x129677['dialQueueProject2']||undefined;this[_0xe2ba('0x80')]=_0x129677[_0xe2ba('0x80')]||![];this['dialAgiAfterHangupAgent']=_0x129677[_0xe2ba('0x81')]||![];this['monitor_format']=monitorFormat[_0x129677['monitor_format']]?monitorFormat[_0x129677[_0xe2ba('0xa')]]:undefined;this['mandatoryDisposition']=_0x129677[_0xe2ba('0x82')]||![];this[_0xe2ba('0x83')]=_0x129677[_0xe2ba('0x83')]?_0x129677[_0xe2ba('0x83')]:undefined;this['queueSummaryCountersUpdated']=![];}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 0267a0c..49d5527 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x556b=['active','callerid','prototype','loggedin','callers','SIP/','online','incall','includes','status','booked','keys','length','queue','dialer','xcally-motion-preview','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundAbandonedCallsDay','preview','available','loggedIn','loggedInDb','paused','ringing','waiting','answered','inUse','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','pTalking','sumBillable','sumDuration','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','talking','total','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk'];(function(_0x5bd044,_0xafd5fa){var _0x582fd7=function(_0x1accb9){while(--_0x1accb9){_0x5bd044['push'](_0x5bd044['shift']());}};_0x582fd7(++_0xafd5fa);}(_0x556b,0x1d7));var _0xb556=function(_0x5120f2,_0x2223e2){_0x5120f2=_0x5120f2-0x0;var _0x2cbf40=_0x556b[_0x5120f2];return _0x2cbf40;};'use strict';var INBOUND_COUNTERS=[_0xb556('0x0'),_0xb556('0x1'),_0xb556('0x2'),_0xb556('0x3'),_0xb556('0x4'),'talking',_0xb556('0x5')];var OUTBOUND_COUNTERS=[_0xb556('0x0'),_0xb556('0x6'),_0xb556('0x7'),_0xb556('0x1'),'loggedInDb','originated','outboundAbandonedCallsDay',_0xb556('0x8'),_0xb556('0x9'),_0xb556('0xa'),_0xb556('0xb'),_0xb556('0xc'),_0xb556('0xd'),_0xb556('0xe'),_0xb556('0xf'),'outboundUnknownCallsDay','paused',_0xb556('0x10'),'talking',_0xb556('0x11'),_0xb556('0x12'),'total','waiting'];function VoiceQueueSummary(_0x19ea2f){this['id']=_0x19ea2f['id'];this[_0xb556('0x13')]=_0x19ea2f[_0xb556('0x13')];this[_0xb556('0x14')]=_0x19ea2f[_0xb556('0x14')];this[_0xb556('0x15')]=_0x19ea2f['abandoned']||0x0;this['answered']=_0x19ea2f[_0xb556('0x6')]||0x0;this['available']=_0x19ea2f[_0xb556('0x0')]||0x0;this[_0xb556('0x16')]=_0x19ea2f['busy']||0x0;this['inUse']=_0x19ea2f[_0xb556('0x7')]||0x0;this[_0xb556('0x17')]=_0x19ea2f[_0xb556('0x17')]||0x0;this[_0xb556('0x1')]=_0x19ea2f[_0xb556('0x1')]||0x0;this[_0xb556('0x2')]=_0x19ea2f[_0xb556('0x2')]||0x0;this[_0xb556('0x18')]=_0x19ea2f[_0xb556('0x18')]||0x0;this['notInUse']=_0x19ea2f[_0xb556('0x19')]||0x0;this[_0xb556('0x3')]=_0x19ea2f[_0xb556('0x3')]||0x0;this[_0xb556('0x4')]=_0x19ea2f['ringing']||0x0;this[_0xb556('0x1a')]=_0x19ea2f[_0xb556('0x1a')];this[_0xb556('0x11')]=_0x19ea2f[_0xb556('0x11')];this['sumDuration']=_0x19ea2f[_0xb556('0x12')];this[_0xb556('0x1b')]=_0x19ea2f[_0xb556('0x1b')]||0x0;this[_0xb556('0x1c')]=_0x19ea2f['talking']||0x0;this[_0xb556('0x1d')]=_0x19ea2f[_0xb556('0x1d')]||0x0;this[_0xb556('0x1e')]=_0x19ea2f[_0xb556('0x1e')];this[_0xb556('0x1f')]=_0x19ea2f[_0xb556('0x1f')]||0x0;this[_0xb556('0x20')]=_0x19ea2f[_0xb556('0x20')]||0x0;this[_0xb556('0x21')]=_0x19ea2f[_0xb556('0x21')]||0x0;this[_0xb556('0x5')]=_0x19ea2f[_0xb556('0x5')]||0x0;if(_0x19ea2f[_0xb556('0x1e')]===_0xb556('0x22')){this[_0xb556('0x10')]=_0x19ea2f[_0xb556('0x10')]||0x0;this[_0xb556('0x23')]=_0x19ea2f[_0xb556('0x23')];this[_0xb556('0x24')]=_0x19ea2f[_0xb556('0x24')];this[_0xb556('0x25')]=_0x19ea2f[_0xb556('0x25')];this['dialOriginateCallerIdNumber']=_0x19ea2f[_0xb556('0x26')];this['dialOriginateTimeout']=_0x19ea2f['dialOriginateTimeout'];this['dialPrefix']=_0x19ea2f[_0xb556('0x27')];this[_0xb556('0x28')]=_0x19ea2f[_0xb556('0x28')];this['outboundAnswerAgiCallsDay']=_0x19ea2f[_0xb556('0x29')];this[_0xb556('0x8')]=_0x19ea2f['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x19ea2f['outboundBlacklistCallsDay'];this[_0xb556('0xa')]=_0x19ea2f[_0xb556('0xa')];this['outboundCongestionCallsDay']=_0x19ea2f['outboundCongestionCallsDay'];this[_0xb556('0x2a')]=_0x19ea2f['outboundDropCallsDayACS'];this[_0xb556('0x2b')]=_0x19ea2f['outboundDropCallsDayCallersExit'];this[_0xb556('0x2c')]=_0x19ea2f['outboundDropCallsDayTimeout'];this[_0xb556('0xc')]=_0x19ea2f[_0xb556('0xc')];this['outboundNoSuchCallsDay']=_0x19ea2f['outboundNoSuchCallsDay'];this[_0xb556('0x2d')]=_0x19ea2f[_0xb556('0x2d')];this[_0xb556('0xe')]=_0x19ea2f['outboundReCallsDay'];this[_0xb556('0xf')]=_0x19ea2f[_0xb556('0xf')];this[_0xb556('0x2e')]=_0x19ea2f[_0xb556('0x2e')];this['predictiveIntervalAnsweredCalls']=_0x19ea2f[_0xb556('0x2f')];this[_0xb556('0x30')]=_0x19ea2f['predictiveIntervalAvgHoldtime'];this['predictiveIntervalAvgTalktime']=_0x19ea2f[_0xb556('0x31')];this[_0xb556('0x32')]=_0x19ea2f[_0xb556('0x32')];this['predictiveIntervalDroppedCallsTimeout']=_0x19ea2f[_0xb556('0x33')];this[_0xb556('0x34')]=_0x19ea2f['predictiveIntervalErlangCalls'];this[_0xb556('0x35')]=_0x19ea2f[_0xb556('0x35')];this[_0xb556('0x36')]=_0x19ea2f['predictiveIntervalHitRate'];this['predictiveIntervalMultiplicativeFactor']=_0x19ea2f[_0xb556('0x37')];this[_0xb556('0x38')]=_0x19ea2f[_0xb556('0x38')];this['predictiveIntervalAvailable']=_0x19ea2f[_0xb556('0x39')];this[_0xb556('0x3a')]=_0x19ea2f['predictiveIntervalTotalCalls'];this['originated']=_0x19ea2f[_0xb556('0x3b')];this[_0xb556('0x3c')]=_0x19ea2f['erlangCalls'];this['erlangCallToSecond']=_0x19ea2f[_0xb556('0x3d')];this[_0xb556('0x3e')]=_0x19ea2f[_0xb556('0x3e')];this[_0xb556('0x3f')]=_0x19ea2f['erlangBusyFactor'];this[_0xb556('0x40')]=_0x19ea2f['startPredictive'];this['startProgressive']=_0x19ea2f[_0xb556('0x41')];this[_0xb556('0x42')]=_0x19ea2f[_0xb556('0x42')];this[_0xb556('0x43')]=_0x19ea2f[_0xb556('0x43')];}if(_0x19ea2f[_0xb556('0x44')]){this['Trunk']={'id':_0x19ea2f[_0xb556('0x44')]['id'],'name':_0x19ea2f[_0xb556('0x44')][_0xb556('0x13')],'active':_0x19ea2f[_0xb556('0x44')][_0xb556('0x45')],'callerid':_0x19ea2f['Trunk'][_0xb556('0x46')]};}}VoiceQueueSummary[_0xb556('0x47')]['createReport']=function(_0x107746,_0x1d48b5,_0x3a194d,_0x18842a){this[_0xb556('0x2')]=0x0;this[_0xb556('0x1c')]=0x0;this[_0xb556('0x3')]=0x0;this['unknown']=0x0;this['notInUse']=0x0;this[_0xb556('0x7')]=0x0;this[_0xb556('0x16')]=0x0;this['invalid']=0x0;this['unavailable']=0x0;this[_0xb556('0x4')]=0x0;this[_0xb556('0x1a')]=0x0;this[_0xb556('0x18')]=0x0;if(_0x3a194d){if(_0x3a194d['available']){this[_0xb556('0x0')]=Number(_0x3a194d['available']);}if(_0x3a194d[_0xb556('0x48')]){this[_0xb556('0x1')]=Number(_0x3a194d[_0xb556('0x48')]);}if(_0x3a194d[_0xb556('0x49')]){this['waiting']=Number(_0x3a194d[_0xb556('0x49')]);}}for(var _0x141b73=0x0;_0x141b73<_0x107746['length'];_0x141b73++){var _0x2fa740=_0x1d48b5[_0xb556('0x4a')+_0x107746[_0x141b73][_0xb556('0x13')]];if(_0x2fa740&&_0x2fa740[_0xb556('0x4b')]){this['loggedInDb']+=0x1;}if(_0x107746[_0x141b73][_0xb556('0x4c')]==='1'){this[_0xb556('0x1c')]+=0x1;}if(_0x107746[_0x141b73][_0xb556('0x3')]==='1'&&!['2','7','8'][_0xb556('0x4d')](_0x107746[_0x141b73]['status'])){this['paused']+=0x1;}switch(_0x107746[_0x141b73][_0xb556('0x4e')]){case'0':this[_0xb556('0x20')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0xb556('0x7')]+=0x1;break;case'3':this[_0xb556('0x16')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0xb556('0x1f')]+=0x1;break;case'6':this[_0xb556('0x4')]+=0x1;break;case'7':this[_0xb556('0x1a')]+=0x1;break;case'8':this[_0xb556('0x18')]+=0x1;break;}}if(this[_0xb556('0x24')]===_0xb556('0x4f')){var _0x100555=Object[_0xb556('0x50')](_0x18842a);for(var _0x221df8=0x0;_0x221df8<_0x100555[_0xb556('0x51')];_0x221df8++){var _0x1e222a=_0x100555[_0x221df8];var _0x3862ef=_0x18842a[_0x1e222a];if(_0x3862ef[_0xb556('0x52')]===this[_0xb556('0x13')]&&_0x3862ef[_0xb556('0x1e')]===_0xb556('0x53')&&_0x3862ef['exten']===_0xb556('0x54')){this[_0xb556('0x1c')]+=0x1;}}if(this['talking']>this['inUse']){this[_0xb556('0x1c')]=this[_0xb556('0x7')];}this[_0xb556('0x10')]=0x0;}return this;};VoiceQueueSummary[_0xb556('0x47')]['compareToInboundQueue']=function(_0x51d063){var _0x11dac3=![];if(_0x51d063){_0x11dac3=INBOUND_COUNTERS[_0xb556('0x55')](function(_0x43e195){return this[_0x43e195]!==_0x51d063[_0x43e195];},this);}return _0x11dac3;};VoiceQueueSummary[_0xb556('0x47')][_0xb556('0x56')]=function(_0xa12085){var _0x42945b=![];var _0x10f3d6=![];var _0x211c04=![];if(_0xa12085){_0x42945b=this['dialMethod']!==_0xa12085[_0xb556('0x24')]||this['dialActive']!==_0xa12085['dialActive']||this[_0xb556('0x42')]!==_0xa12085[_0xb556('0x42')]||this[_0xb556('0x43')]!==_0xa12085[_0xb556('0x43')];_0x10f3d6=OUTBOUND_COUNTERS['some'](function(_0x143bcf){return this[_0x143bcf]!==_0xa12085[_0x143bcf];},this);if(this[_0xb556('0x44')]&&_0xa12085[_0xb556('0x44')]){_0x211c04=this[_0xb556('0x44')][_0xb556('0x13')]!==_0xa12085[_0xb556('0x44')]['name']||this[_0xb556('0x44')][_0xb556('0x45')]!==_0xa12085[_0xb556('0x44')]['active'];}}return _0x42945b||_0x10f3d6||_0x211c04;};VoiceQueueSummary['prototype'][_0xb556('0x57')]=function(_0x12ffec){this['answered']=_0x12ffec[_0xb556('0x6')];this[_0xb556('0x42')]=_0x12ffec[_0xb556('0x42')];this[_0xb556('0x43')]=_0x12ffec['statusMessage'];this[_0xb556('0x3b')]=_0x12ffec[_0xb556('0x3b')];this['outboundAbandonedCallsDay']=_0x12ffec[_0xb556('0x58')];this[_0xb556('0x8')]=_0x12ffec['outboundAnswerCallsDay'];this[_0xb556('0x9')]=_0x12ffec[_0xb556('0x9')];this[_0xb556('0xa')]=_0x12ffec[_0xb556('0xa')];this[_0xb556('0xb')]=_0x12ffec[_0xb556('0xb')];this['outboundNoAnswerCallsDay']=_0x12ffec[_0xb556('0xc')];this['outboundNoSuchCallsDay']=_0x12ffec[_0xb556('0xd')];this['outboundReCallsDay']=_0x12ffec[_0xb556('0xe')];this[_0xb556('0xf')]=_0x12ffec[_0xb556('0xf')];this['outboundUnknownCallsDay']=_0x12ffec[_0xb556('0x2e')];this[_0xb556('0x11')]=_0x12ffec[_0xb556('0x11')];this[_0xb556('0x12')]=_0x12ffec['sumDuration'];this[_0xb556('0x1d')]=_0x12ffec[_0xb556('0x1d')];if(this[_0xb556('0x24')]===_0xb556('0x59')){this[_0xb556('0x10')]=_0x12ffec[_0xb556('0x10')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file +var _0x2263=['message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','SIP/','incall','status','booked','keys','queue','dialer','exten','xcally-motion-preview','some','compareToOutboundQueue','answered','preview','available','loggedIn','loggedInDb','paused','ringing','talking','waiting','inUse','originated','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive'];(function(_0x4d04fb,_0x400b7c){var _0xf5582a=function(_0x343f0a){while(--_0x343f0a){_0x4d04fb['push'](_0x4d04fb['shift']());}};_0xf5582a(++_0x400b7c);}(_0x2263,0x6e));var _0x3226=function(_0x151418,_0x2cbffa){_0x151418=_0x151418-0x0;var _0x40e29a=_0x2263[_0x151418];return _0x40e29a;};'use strict';var INBOUND_COUNTERS=[_0x3226('0x0'),_0x3226('0x1'),_0x3226('0x2'),_0x3226('0x3'),_0x3226('0x4'),_0x3226('0x5'),_0x3226('0x6')];var OUTBOUND_COUNTERS=[_0x3226('0x0'),'answered',_0x3226('0x7'),_0x3226('0x1'),_0x3226('0x2'),_0x3226('0x8'),_0x3226('0x9'),'outboundAnswerCallsDay',_0x3226('0xa'),_0x3226('0xb'),'outboundCongestionCallsDay','outboundNoAnswerCallsDay',_0x3226('0xc'),_0x3226('0xd'),'outboundRejectCallsDay',_0x3226('0xe'),_0x3226('0x3'),_0x3226('0xf'),_0x3226('0x5'),_0x3226('0x10'),_0x3226('0x11'),_0x3226('0x12'),'waiting'];function VoiceQueueSummary(_0x1e2c60){this['id']=_0x1e2c60['id'];this[_0x3226('0x13')]=_0x1e2c60[_0x3226('0x13')];this[_0x3226('0x14')]=_0x1e2c60['strategy'];this['abandoned']=_0x1e2c60['abandoned']||0x0;this['answered']=_0x1e2c60['answered']||0x0;this[_0x3226('0x0')]=_0x1e2c60[_0x3226('0x0')]||0x0;this[_0x3226('0x15')]=_0x1e2c60[_0x3226('0x15')]||0x0;this['inUse']=_0x1e2c60['inUse']||0x0;this[_0x3226('0x16')]=_0x1e2c60[_0x3226('0x16')]||0x0;this[_0x3226('0x1')]=_0x1e2c60['loggedIn']||0x0;this[_0x3226('0x2')]=_0x1e2c60[_0x3226('0x2')]||0x0;this[_0x3226('0x17')]=_0x1e2c60[_0x3226('0x17')]||0x0;this[_0x3226('0x18')]=_0x1e2c60[_0x3226('0x18')]||0x0;this['paused']=_0x1e2c60['paused']||0x0;this[_0x3226('0x4')]=_0x1e2c60['ringing']||0x0;this[_0x3226('0x19')]=_0x1e2c60[_0x3226('0x19')];this[_0x3226('0x10')]=_0x1e2c60[_0x3226('0x10')];this[_0x3226('0x11')]=_0x1e2c60[_0x3226('0x11')];this['sumHoldTime']=_0x1e2c60[_0x3226('0x1a')]||0x0;this[_0x3226('0x5')]=_0x1e2c60['talking']||0x0;this[_0x3226('0x12')]=_0x1e2c60[_0x3226('0x12')]||0x0;this[_0x3226('0x1b')]=_0x1e2c60['type'];this[_0x3226('0x1c')]=_0x1e2c60[_0x3226('0x1c')]||0x0;this[_0x3226('0x1d')]=_0x1e2c60[_0x3226('0x1d')]||0x0;this[_0x3226('0x1e')]=_0x1e2c60[_0x3226('0x1e')]||0x0;this[_0x3226('0x6')]=_0x1e2c60[_0x3226('0x6')]||0x0;if(_0x1e2c60['type']===_0x3226('0x1f')){this['pTalking']=_0x1e2c60[_0x3226('0xf')]||0x0;this['dialActive']=_0x1e2c60[_0x3226('0x20')];this['dialMethod']=_0x1e2c60[_0x3226('0x21')];this['dialOriginateCallerIdName']=_0x1e2c60[_0x3226('0x22')];this[_0x3226('0x23')]=_0x1e2c60['dialOriginateCallerIdNumber'];this[_0x3226('0x24')]=_0x1e2c60[_0x3226('0x24')];this[_0x3226('0x25')]=_0x1e2c60[_0x3226('0x25')];this[_0x3226('0x26')]=_0x1e2c60[_0x3226('0x26')];this[_0x3226('0x27')]=_0x1e2c60['outboundAnswerAgiCallsDay'];this[_0x3226('0x28')]=_0x1e2c60['outboundAnswerCallsDay'];this[_0x3226('0xa')]=_0x1e2c60[_0x3226('0xa')];this[_0x3226('0xb')]=_0x1e2c60['outboundBusyCallsDay'];this[_0x3226('0x29')]=_0x1e2c60['outboundCongestionCallsDay'];this['outboundDropCallsDayACS']=_0x1e2c60[_0x3226('0x2a')];this[_0x3226('0x2b')]=_0x1e2c60[_0x3226('0x2b')];this[_0x3226('0x2c')]=_0x1e2c60[_0x3226('0x2c')];this[_0x3226('0x2d')]=_0x1e2c60[_0x3226('0x2d')];this[_0x3226('0xc')]=_0x1e2c60[_0x3226('0xc')];this['outboundOriginateFailureCallsDay']=_0x1e2c60[_0x3226('0x2e')];this[_0x3226('0xd')]=_0x1e2c60[_0x3226('0xd')];this[_0x3226('0x2f')]=_0x1e2c60[_0x3226('0x2f')];this[_0x3226('0xe')]=_0x1e2c60[_0x3226('0xe')];this[_0x3226('0x30')]=_0x1e2c60[_0x3226('0x30')];this[_0x3226('0x31')]=_0x1e2c60[_0x3226('0x31')];this[_0x3226('0x32')]=_0x1e2c60[_0x3226('0x32')];this[_0x3226('0x33')]=_0x1e2c60['predictiveIntervalDroppedCallsCallersExit'];this['predictiveIntervalDroppedCallsTimeout']=_0x1e2c60[_0x3226('0x34')];this['predictiveIntervalErlangCalls']=_0x1e2c60[_0x3226('0x35')];this['predictiveIntervalErlangCallsDroppedCalls']=_0x1e2c60[_0x3226('0x36')];this[_0x3226('0x37')]=_0x1e2c60[_0x3226('0x37')];this[_0x3226('0x38')]=_0x1e2c60[_0x3226('0x38')];this['predictiveIntervalPauses']=_0x1e2c60[_0x3226('0x39')];this['predictiveIntervalAvailable']=_0x1e2c60[_0x3226('0x3a')];this['predictiveIntervalTotalCalls']=_0x1e2c60[_0x3226('0x3b')];this[_0x3226('0x8')]=_0x1e2c60[_0x3226('0x8')];this['erlangCalls']=_0x1e2c60[_0x3226('0x3c')];this[_0x3226('0x3d')]=_0x1e2c60[_0x3226('0x3d')];this[_0x3226('0x3e')]=_0x1e2c60[_0x3226('0x3e')];this[_0x3226('0x3f')]=_0x1e2c60[_0x3226('0x3f')];this[_0x3226('0x40')]=_0x1e2c60[_0x3226('0x40')];this[_0x3226('0x41')]=_0x1e2c60[_0x3226('0x41')];this[_0x3226('0x42')]=_0x1e2c60[_0x3226('0x42')];this[_0x3226('0x43')]=_0x1e2c60[_0x3226('0x43')];}if(_0x1e2c60['Trunk']){this[_0x3226('0x44')]={'id':_0x1e2c60[_0x3226('0x44')]['id'],'name':_0x1e2c60[_0x3226('0x44')][_0x3226('0x13')],'active':_0x1e2c60['Trunk'][_0x3226('0x45')],'callerid':_0x1e2c60[_0x3226('0x44')][_0x3226('0x46')]};}}VoiceQueueSummary[_0x3226('0x47')][_0x3226('0x48')]=function(_0x60a818,_0x34fe50,_0x1d0e02,_0x3f3efd){this['loggedInDb']=0x0;this[_0x3226('0x5')]=0x0;this[_0x3226('0x3')]=0x0;this[_0x3226('0x1d')]=0x0;this[_0x3226('0x18')]=0x0;this[_0x3226('0x7')]=0x0;this[_0x3226('0x15')]=0x0;this['invalid']=0x0;this['unavailable']=0x0;this[_0x3226('0x4')]=0x0;this[_0x3226('0x19')]=0x0;this['onHold']=0x0;if(_0x1d0e02){if(_0x1d0e02[_0x3226('0x0')]){this[_0x3226('0x0')]=Number(_0x1d0e02[_0x3226('0x0')]);}if(_0x1d0e02[_0x3226('0x49')]){this[_0x3226('0x1')]=Number(_0x1d0e02[_0x3226('0x49')]);}if(_0x1d0e02[_0x3226('0x4a')]){this[_0x3226('0x6')]=Number(_0x1d0e02['callers']);}}for(var _0xc63c19=0x0;_0xc63c19<_0x60a818['length'];_0xc63c19++){var _0x25664e=_0x34fe50[_0x3226('0x4b')+_0x60a818[_0xc63c19]['name']];if(_0x25664e&&_0x25664e['online']){this[_0x3226('0x2')]+=0x1;}if(_0x60a818[_0xc63c19][_0x3226('0x4c')]==='1'){this[_0x3226('0x5')]+=0x1;}if(_0x60a818[_0xc63c19][_0x3226('0x3')]==='1'&&!['2','7','8']['includes'](_0x60a818[_0xc63c19][_0x3226('0x4d')])){this[_0x3226('0x3')]+=0x1;}switch(_0x60a818[_0xc63c19]['status']){case'0':this[_0x3226('0x1d')]+=0x1;break;case'1':this[_0x3226('0x18')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0x3226('0x15')]+=0x1;break;case'4':this[_0x3226('0x16')]+=0x1;break;case'5':this[_0x3226('0x1c')]+=0x1;break;case'6':this[_0x3226('0x4')]+=0x1;break;case'7':this[_0x3226('0x19')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0x3226('0x21')]===_0x3226('0x4e')){var _0x3199b1=Object[_0x3226('0x4f')](_0x3f3efd);for(var _0xe890c=0x0;_0xe890c<_0x3199b1['length'];_0xe890c++){var _0x45f6bf=_0x3199b1[_0xe890c];var _0x206733=_0x3f3efd[_0x45f6bf];if(_0x206733[_0x3226('0x50')]===this[_0x3226('0x13')]&&_0x206733[_0x3226('0x1b')]===_0x3226('0x51')&&_0x206733[_0x3226('0x52')]===_0x3226('0x53')){this[_0x3226('0x5')]+=0x1;}}if(this[_0x3226('0x5')]>this[_0x3226('0x7')]){this[_0x3226('0x5')]=this[_0x3226('0x7')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0x3226('0x47')]['compareToInboundQueue']=function(_0x349852){var _0x4e5527=![];if(_0x349852){_0x4e5527=INBOUND_COUNTERS[_0x3226('0x54')](function(_0x222a6d){return this[_0x222a6d]!==_0x349852[_0x222a6d];},this);}return _0x4e5527;};VoiceQueueSummary['prototype'][_0x3226('0x55')]=function(_0x454144){var _0x3f673d=![];var _0x4ca7f4=![];var _0x165609=![];if(_0x454144){_0x3f673d=this[_0x3226('0x21')]!==_0x454144[_0x3226('0x21')]||this['dialActive']!==_0x454144[_0x3226('0x20')]||this[_0x3226('0x42')]!==_0x454144[_0x3226('0x42')]||this[_0x3226('0x43')]!==_0x454144['statusMessage'];_0x4ca7f4=OUTBOUND_COUNTERS['some'](function(_0x407fa5){return this[_0x407fa5]!==_0x454144[_0x407fa5];},this);if(this[_0x3226('0x44')]&&_0x454144[_0x3226('0x44')]){_0x165609=this[_0x3226('0x44')][_0x3226('0x13')]!==_0x454144[_0x3226('0x44')][_0x3226('0x13')]||this[_0x3226('0x44')][_0x3226('0x45')]!==_0x454144['Trunk'][_0x3226('0x45')];}}return _0x3f673d||_0x4ca7f4||_0x165609;};VoiceQueueSummary[_0x3226('0x47')]['updateReportFromOutboundQueue']=function(_0x75d0f2){this[_0x3226('0x56')]=_0x75d0f2[_0x3226('0x56')];this['message']=_0x75d0f2[_0x3226('0x42')];this[_0x3226('0x43')]=_0x75d0f2['statusMessage'];this[_0x3226('0x8')]=_0x75d0f2['originated'];this[_0x3226('0x9')]=_0x75d0f2[_0x3226('0x9')];this[_0x3226('0x28')]=_0x75d0f2['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x75d0f2['outboundBlacklistCallsDay'];this[_0x3226('0xb')]=_0x75d0f2[_0x3226('0xb')];this[_0x3226('0x29')]=_0x75d0f2[_0x3226('0x29')];this['outboundNoAnswerCallsDay']=_0x75d0f2['outboundNoAnswerCallsDay'];this[_0x3226('0xc')]=_0x75d0f2[_0x3226('0xc')];this[_0x3226('0xd')]=_0x75d0f2[_0x3226('0xd')];this[_0x3226('0x2f')]=_0x75d0f2[_0x3226('0x2f')];this[_0x3226('0xe')]=_0x75d0f2[_0x3226('0xe')];this['sumBillable']=_0x75d0f2[_0x3226('0x10')];this[_0x3226('0x11')]=_0x75d0f2[_0x3226('0x11')];this[_0x3226('0x12')]=_0x75d0f2['total'];if(this[_0x3226('0x21')]===_0x3226('0x57')){this[_0x3226('0xf')]=_0x75d0f2[_0x3226('0xf')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 70a3790..aec81f1 100644 --- a/server/services/ami/model/vtigerAccount.js +++ b/server/services/ami/model/vtigerAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9664=['username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x316904,_0x1e8b77){var _0xfa9a21=function(_0x2b75ae){while(--_0x2b75ae){_0x316904['push'](_0x316904['shift']());}};_0xfa9a21(++_0x1e8b77);}(_0x9664,0x126));var _0x4966=function(_0x13d343,_0xff2df3){_0x13d343=_0x13d343-0x0;var _0x55d49a=_0x9664[_0x13d343];return _0x55d49a;};'use strict';function VtigerAccount(_0x55e3a4){this['id']=_0x55e3a4['id']||0x0;this['name']=_0x55e3a4['name']||'';this[_0x4966('0x0')]=_0x55e3a4[_0x4966('0x0')]||'';this[_0x4966('0x1')]=_0x55e3a4[_0x4966('0x1')]||'';this[_0x4966('0x2')]=_0x55e3a4[_0x4966('0x2')]||'';this['serverUrl']=_0x55e3a4[_0x4966('0x3')]||'';this['Configurations']=_0x55e3a4[_0x4966('0x4')]||{};}module[_0x4966('0x5')]=VtigerAccount; \ No newline at end of file +var _0x5574=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3bc9ba,_0x4f95e3){var _0x5d3fc4=function(_0x4683bc){while(--_0x4683bc){_0x3bc9ba['push'](_0x3bc9ba['shift']());}};_0x5d3fc4(++_0x4f95e3);}(_0x5574,0xbc));var _0x4557=function(_0x1e05de,_0x2cd61c){_0x1e05de=_0x1e05de-0x0;var _0x506b05=_0x5574[_0x1e05de];return _0x506b05;};'use strict';function VtigerAccount(_0x2daadb){this['id']=_0x2daadb['id']||0x0;this[_0x4557('0x0')]=_0x2daadb[_0x4557('0x0')]||'';this[_0x4557('0x1')]=_0x2daadb[_0x4557('0x1')]||'';this[_0x4557('0x2')]=_0x2daadb[_0x4557('0x2')]||'';this[_0x4557('0x3')]=_0x2daadb[_0x4557('0x3')]||'';this[_0x4557('0x4')]=_0x2daadb[_0x4557('0x4')]||'';this['Configurations']=_0x2daadb[_0x4557('0x5')]||{};}module[_0x4557('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index a8d0b67..e8a3f5b 100644 --- a/server/services/ami/model/zendeskAccount.js +++ b/server/services/ami/model/zendeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7ec=['integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri','authType'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xe7ec,0x174));var _0xce7e=function(_0x480bc8,_0x1fac40){_0x480bc8=_0x480bc8-0x0;var _0x28c245=_0xe7ec[_0x480bc8];return _0x28c245;};'use strict';function ZendeskAccount(_0x514537){this['id']=_0x514537['id']||0x0;this[_0xce7e('0x0')]=_0x514537[_0xce7e('0x0')]||'';this[_0xce7e('0x1')]=_0x514537[_0xce7e('0x1')]||'';this[_0xce7e('0x2')]=_0x514537[_0xce7e('0x2')]||'';this[_0xce7e('0x3')]=_0x514537[_0xce7e('0x3')]||'';this[_0xce7e('0x4')]=_0x514537[_0xce7e('0x4')]||'';this[_0xce7e('0x5')]=_0x514537[_0xce7e('0x5')]||'';this['type']=_0x514537['type']||_0xce7e('0x6');this[_0xce7e('0x7')]=_0x514537[_0xce7e('0x7')]||'';this[_0xce7e('0x8')]=_0x514537[_0xce7e('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x1ae7=['serverUrl','Configurations','name','username','password','token','remoteUri','authType','type','integrationTab'];(function(_0x29a521,_0x44eefc){var _0x12e55f=function(_0x4b50b0){while(--_0x4b50b0){_0x29a521['push'](_0x29a521['shift']());}};_0x12e55f(++_0x44eefc);}(_0x1ae7,0xf2));var _0x71ae=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x1ae7[_0x5b78e8];return _0xf2c321;};'use strict';function ZendeskAccount(_0x584461){this['id']=_0x584461['id']||0x0;this['name']=_0x584461[_0x71ae('0x0')]||'';this[_0x71ae('0x1')]=_0x584461[_0x71ae('0x1')]||'';this[_0x71ae('0x2')]=_0x584461[_0x71ae('0x2')]||'';this[_0x71ae('0x3')]=_0x584461['token']||'';this[_0x71ae('0x4')]=_0x584461[_0x71ae('0x4')]||'';this[_0x71ae('0x5')]=_0x584461[_0x71ae('0x5')]||'';this[_0x71ae('0x6')]=_0x584461[_0x71ae('0x6')]||_0x71ae('0x7');this['serverUrl']=_0x584461[_0x71ae('0x8')]||'';this[_0x71ae('0x9')]=_0x584461[_0x71ae('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 43fb892..76c8ace 100644 --- a/server/services/ami/model/zohoAccount.js +++ b/server/services/ami/model/zohoAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f86=['exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x351fa0,_0x12387a){var _0x35a58d=function(_0x4ebfff){while(--_0x4ebfff){_0x351fa0['push'](_0x351fa0['shift']());}};_0x35a58d(++_0x12387a);}(_0x6f86,0x6f));var _0x66f8=function(_0x4f1789,_0x37fda7){_0x4f1789=_0x4f1789-0x0;var _0x5bb8fe=_0x6f86[_0x4f1789];return _0x5bb8fe;};'use strict';function ZohoAccount(_0x41c87b){this['id']=_0x41c87b['id']||0x0;this[_0x66f8('0x0')]=_0x41c87b[_0x66f8('0x0')]||'';this[_0x66f8('0x1')]=_0x41c87b[_0x66f8('0x1')]||'';this[_0x66f8('0x2')]=_0x41c87b['host']||'';this[_0x66f8('0x3')]=_0x41c87b[_0x66f8('0x3')]||'';this[_0x66f8('0x4')]=_0x41c87b[_0x66f8('0x4')]||'';this['clientSecret']=_0x41c87b[_0x66f8('0x5')]||'';this[_0x66f8('0x6')]=_0x41c87b['serverUrl']||'';this['code']=_0x41c87b[_0x66f8('0x7')]||'';this[_0x66f8('0x8')]=_0x41c87b[_0x66f8('0x8')]||'';this['Configurations']=_0x41c87b[_0x66f8('0x9')]||{};}module[_0x66f8('0xa')]=ZohoAccount; \ No newline at end of file +var _0x0ff4=['clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host','zone','clientId'];(function(_0x6f7f51,_0x49e1f3){var _0x3e8d20=function(_0x15fdae){while(--_0x15fdae){_0x6f7f51['push'](_0x6f7f51['shift']());}};_0x3e8d20(++_0x49e1f3);}(_0x0ff4,0x1b3));var _0x40ff=function(_0x190e94,_0x117fc1){_0x190e94=_0x190e94-0x0;var _0x3012a0=_0x0ff4[_0x190e94];return _0x3012a0;};'use strict';function ZohoAccount(_0x3b18bd){this['id']=_0x3b18bd['id']||0x0;this[_0x40ff('0x0')]=_0x3b18bd[_0x40ff('0x0')]||'';this[_0x40ff('0x1')]=_0x3b18bd[_0x40ff('0x1')]||'';this[_0x40ff('0x2')]=_0x3b18bd[_0x40ff('0x2')]||'';this['zone']=_0x3b18bd[_0x40ff('0x3')]||'';this[_0x40ff('0x4')]=_0x3b18bd[_0x40ff('0x4')]||'';this[_0x40ff('0x5')]=_0x3b18bd[_0x40ff('0x5')]||'';this[_0x40ff('0x6')]=_0x3b18bd[_0x40ff('0x6')]||'';this[_0x40ff('0x7')]=_0x3b18bd['code']||'';this[_0x40ff('0x8')]=_0x3b18bd['refreshToken']||'';this[_0x40ff('0x9')]=_0x3b18bd[_0x40ff('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 5a9611d..ddf80ff 100644 --- a/server/services/ami/preview/action.js +++ b/server/services/ami/preview/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cf8=['countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x4cf8[_0x38ced4];return _0x547c07;};'use strict';var util=require(_0x84cf('0x0'));var _=require(_0x84cf('0x1'));var moment=require(_0x84cf('0x2'));function checkNameSurname(_0x2125ed,_0xae953,_0x28455b){var _0x36b912='';if(!_[_0x84cf('0x3')](_0xae953)&&_0x84cf('0x4')===typeof _0xae953){_0x36b912+=_0xae953;}if(!_[_0x84cf('0x3')](_0x28455b)&&_0x84cf('0x4')===typeof _0x28455b){_0x36b912+='\x20'+_0x28455b;}if(_0x36b912!==''){return _0x36b912;}return _0x2125ed;}function Action(_0x2c613d,_0x50ade2,_0x4af3f1,_0x455345,_0x56c5cc){this[_0x84cf('0x5')]=_0x4af3f1||undefined;this[_0x84cf('0x6')]=_0x2c613d['id'];this['queue']=_0x50ade2[_0x84cf('0x7')];this[_0x84cf('0x8')]=_0x50ade2['type'];this[_0x84cf('0x9')]=_0x84cf('0xa');this[_0x84cf('0xb')]=![];this[_0x84cf('0xc')]=_['isNil'](_0x2c613d[_0x84cf('0xd')])?undefined:_0x2c613d[_0x84cf('0xd')]['name'];this['channelAgent']=this[_0x84cf('0xc')]?util[_0x84cf('0xe')](_0x84cf('0xf'),this[_0x84cf('0xc')]):_0x455345||undefined;this[_0x84cf('0x10')]=checkNameSurname(_0x2c613d[_0x84cf('0x11')][_0x84cf('0x12')],_0x2c613d[_0x84cf('0x11')][_0x84cf('0x13')],_0x2c613d[_0x84cf('0x11')][_0x84cf('0x14')]);this[_0x84cf('0x15')]=_0x2c613d[_0x84cf('0x15')]||![];this[_0x84cf('0x16')]=_0x2c613d[_0x84cf('0x12')];this[_0x84cf('0x17')]=_0x2c613d[_0x84cf('0x17')];this[_0x84cf('0x18')]=_0x2c613d[_0x84cf('0x18')]||0x0;this['countcongestionretry']=_0x2c613d[_0x84cf('0x19')]||0x0;this[_0x84cf('0x1a')]=_0x2c613d[_0x84cf('0x1a')]||0x0;this[_0x84cf('0x1b')]=(_0x2c613d[_0x84cf('0x18')]||0x0)+(_0x2c613d[_0x84cf('0x19')]||0x0)+(_0x2c613d[_0x84cf('0x1a')]||0x0)+(_0x2c613d['countnosuchnumberretry']||0x0)+(_0x2c613d['countdropretry']||0x0)+(_0x2c613d[_0x84cf('0x1c')]||0x0)+(_0x2c613d[_0x84cf('0x1d')]||0x0)+(_0x2c613d[_0x84cf('0x1e')]||0x0);this[_0x84cf('0x1f')]=_0x2c613d[_0x84cf('0x1f')]||0x0;this['countdropretry']=_0x2c613d[_0x84cf('0x20')]||0x0;this[_0x84cf('0x1c')]=_0x2c613d[_0x84cf('0x1c')]||0x0;this[_0x84cf('0x1d')]=_0x2c613d[_0x84cf('0x1d')]||0x0;this['countagentrejectretry']=_0x2c613d[_0x84cf('0x1e')]||0x0;this[_0x84cf('0x21')]=_0x2c613d[_0x84cf('0x21')];this[_0x84cf('0x22')]=_0x2c613d[_0x84cf('0x22')];this[_0x84cf('0x23')]=_0x2c613d[_0x84cf('0x23')];this['recallme']=_0x2c613d[_0x84cf('0x24')];this[_0x84cf('0x25')]=_0x2c613d[_0x84cf('0x25')];this[_0x84cf('0x26')]=_0x2c613d[_0x84cf('0x26')];this[_0x84cf('0x27')]=_[_0x84cf('0x3')](_0x2c613d[_0x84cf('0xd')])?_0x2c613d[_0x84cf('0x27')]:_0x2c613d[_0x84cf('0xd')]['id'];this['VoiceQueueId']=_0x2c613d[_0x84cf('0x28')];this[_0x84cf('0x29')]='';this[_0x84cf('0x2a')]='';}Action[_0x84cf('0x2b')]['getCaller']=function(){return util[_0x84cf('0xe')]('\x22%s\x22\x20<%s>',this[_0x84cf('0x10')],this[_0x84cf('0x2c')]);};module[_0x84cf('0x2d')]=Action; \ No newline at end of file +var _0xf2e3=['active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','exports','util','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName'];(function(_0x34c553,_0x3e7dfc){var _0x1357d2=function(_0x3b509f){while(--_0x3b509f){_0x34c553['push'](_0x34c553['shift']());}};_0x1357d2(++_0x3e7dfc);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xf2e3[_0x45d3f0];return _0x314b79;};'use strict';var util=require(_0x3f2e('0x0'));var _=require('lodash');var moment=require(_0x3f2e('0x1'));function checkNameSurname(_0x231b2b,_0x3fba4b,_0x30f1bb){var _0x27d28c='';if(!_[_0x3f2e('0x2')](_0x3fba4b)&&_0x3f2e('0x3')===typeof _0x3fba4b){_0x27d28c+=_0x3fba4b;}if(!_[_0x3f2e('0x2')](_0x30f1bb)&&_0x3f2e('0x3')===typeof _0x30f1bb){_0x27d28c+='\x20'+_0x30f1bb;}if(_0x27d28c!==''){return _0x27d28c;}return _0x231b2b;}function Action(_0x5f254a,_0x33a3b7,_0xdd6b3e,_0x3c0864,_0xdf499f){this[_0x3f2e('0x4')]=_0xdd6b3e||undefined;this[_0x3f2e('0x5')]=_0x5f254a['id'];this[_0x3f2e('0x6')]=_0x33a3b7[_0x3f2e('0x7')];this[_0x3f2e('0x8')]=_0x33a3b7[_0x3f2e('0x8')];this[_0x3f2e('0x9')]=_0x3f2e('0x6');this[_0x3f2e('0xa')]=![];this[_0x3f2e('0xb')]=_[_0x3f2e('0x2')](_0x5f254a[_0x3f2e('0xc')])?undefined:_0x5f254a[_0x3f2e('0xc')][_0x3f2e('0x7')];this[_0x3f2e('0xd')]=this['membername']?util[_0x3f2e('0xe')](_0x3f2e('0xf'),this['membername']):_0x3c0864||undefined;this[_0x3f2e('0x10')]=checkNameSurname(_0x5f254a[_0x3f2e('0x11')][_0x3f2e('0x12')],_0x5f254a[_0x3f2e('0x11')][_0x3f2e('0x13')],_0x5f254a['Contact'][_0x3f2e('0x14')]);this[_0x3f2e('0x15')]=_0x5f254a[_0x3f2e('0x15')]||![];this['calleridnum']=_0x5f254a[_0x3f2e('0x12')];this[_0x3f2e('0x16')]=_0x5f254a[_0x3f2e('0x16')];this[_0x3f2e('0x17')]=_0x5f254a[_0x3f2e('0x17')]||0x0;this[_0x3f2e('0x18')]=_0x5f254a[_0x3f2e('0x18')]||0x0;this[_0x3f2e('0x19')]=_0x5f254a[_0x3f2e('0x19')]||0x0;this[_0x3f2e('0x1a')]=(_0x5f254a[_0x3f2e('0x17')]||0x0)+(_0x5f254a['countcongestionretry']||0x0)+(_0x5f254a[_0x3f2e('0x19')]||0x0)+(_0x5f254a[_0x3f2e('0x1b')]||0x0)+(_0x5f254a[_0x3f2e('0x1c')]||0x0)+(_0x5f254a[_0x3f2e('0x1d')]||0x0)+(_0x5f254a[_0x3f2e('0x1e')]||0x0)+(_0x5f254a['countagentrejectretry']||0x0);this['countnosuchnumberretry']=_0x5f254a[_0x3f2e('0x1b')]||0x0;this[_0x3f2e('0x1c')]=_0x5f254a[_0x3f2e('0x1c')]||0x0;this[_0x3f2e('0x1d')]=_0x5f254a[_0x3f2e('0x1d')]||0x0;this[_0x3f2e('0x1e')]=_0x5f254a['countmachineretry']||0x0;this['countagentrejectretry']=_0x5f254a[_0x3f2e('0x1f')]||0x0;this[_0x3f2e('0x20')]=_0x5f254a['callback'];this['callbackuniqueid']=_0x5f254a[_0x3f2e('0x21')];this['callbackat']=_0x5f254a[_0x3f2e('0x22')];this[_0x3f2e('0x23')]=_0x5f254a['recallme'];this['ContactId']=_0x5f254a['ContactId'];this[_0x3f2e('0x24')]=_0x5f254a[_0x3f2e('0x24')];this['UserId']=_[_0x3f2e('0x2')](_0x5f254a['Agent'])?_0x5f254a[_0x3f2e('0x25')]:_0x5f254a['Agent']['id'];this[_0x3f2e('0x26')]=_0x5f254a[_0x3f2e('0x26')];this[_0x3f2e('0x27')]='';this[_0x3f2e('0x28')]='';}Action[_0x3f2e('0x29')]['getCaller']=function(){return util[_0x3f2e('0xe')](_0x3f2e('0x2a'),this['calleridname'],this['number']);};module[_0x3f2e('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 058e02c..61e4d7b 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x391d9f,_0x3fee6b){var _0xcfd16=function(_0x4ca136){while(--_0x4ca136){_0x391d9f['push'](_0x391d9f['shift']());}};_0xcfd16(++_0x3fee6b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x2fbb92,_0x466ca1){var _0x10778a=function(_0x20fb0f){while(--_0x20fb0f){_0x2fbb92['push'](_0x2fbb92['shift']());}};_0x10778a(++_0x466ca1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index b28c494..8c65aee 100644 --- a/server/services/ami/preview/rpcDb.js +++ b/server/services/ami/preview/rpcDb.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd16e=['queuecallercompleteAt','endtime','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','catch','[createHistory]\x20','resolve','then','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[activeContact]\x20','crateCustomerReportQueue','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete'];(function(_0x47bc58,_0x1e1998){var _0x4a0860=function(_0x2a5b23){while(--_0x2a5b23){_0x47bc58['push'](_0x47bc58['shift']());}};_0x4a0860(++_0x1e1998);}(_0xd16e,0x74));var _0xed16=function(_0x225fb4,_0x427699){_0x225fb4=_0x225fb4-0x0;var _0xc931c=_0xd16e[_0x225fb4];return _0xc931c;};'use strict';var util=require(_0xed16('0x0'));var BPromise=require(_0xed16('0x1'));var logger=require(_0xed16('0x2'))(_0xed16('0x3'));var cmHopper=require(_0xed16('0x4'));var cmHopperHistory=require(_0xed16('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0xed16('0x6'));var voiceQueueReport=require(_0xed16('0x7'));function loggerCatch(_0x5de73a){return function(_0x194fc8){logger[_0xed16('0x8')](_0x5de73a,util['inspect'](_0x194fc8,{'showHidden':![],'depth':null}));};}function create(_0x45ddf6){return cmHopperHistory['createHistory'](_0x45ddf6)[_0xed16('0x9')](loggerCatch(_0xed16('0xa')));}function createAgent(_0x3fb77b){return BPromise[_0xed16('0xb')]()[_0xed16('0xc')](agentReportPreview[_0xed16('0xd')](_0x3fb77b))[_0xed16('0x9')](loggerCatch(_0xed16('0xa')));}function moveContact(_0x2ab44b){return cmHopper[_0xed16('0xe')](_0x2ab44b,!![])[_0xed16('0x9')](loggerCatch(_0xed16('0xf')));}exports['checkIsBlackList']=function(_0x43e154){return cmHopperBlack[_0xed16('0x10')](_0x43e154)['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xed16('0x11')]=function(_0x479282){return BPromise[_0xed16('0xb')]()['then'](cmHopper[_0xed16('0x11')](_0x479282))['catch'](loggerCatch(_0xed16('0x12')));};exports[_0xed16('0xd')]=function(_0x487e32,_0x7c6206){create(_0x487e32)[_0xed16('0x9')](loggerCatch(_0x7c6206));moveContact(_0x487e32)['catch'](loggerCatch(_0x7c6206));};exports['createAgentHistory']=function(_0x5ece7f,_0x58b344){createAgent(_0x5ece7f)[_0xed16('0x9')](loggerCatch(_0x58b344));};exports[_0xed16('0x13')]=function(_0x93bce1,_0x5620f9){create(_0x93bce1)[_0xed16('0x9')](loggerCatch(_0x5620f9));};exports[_0xed16('0x14')]=function(_0x51bee0,_0x356855){moveContact(_0x51bee0)[_0xed16('0x9')](loggerCatch(_0x356855));};exports[_0xed16('0x15')]=function(_0x5f44aa,_0x4907a4,_0xc7c4cb){if(_0x4907a4){_0x5f44aa[_0xed16('0x16')]=null;}if(_0xc7c4cb){_0x5f44aa[_0xed16('0x17')]=![];}return cmHopper[_0xed16('0x15')](_0x5f44aa)[_0xed16('0x9')](loggerCatch(_0xed16('0x18')));};exports[_0xed16('0x19')]=function(_0x4bbc56){return cmHopper[_0xed16('0x19')](_0x4bbc56)[_0xed16('0x9')](loggerCatch(_0xed16('0x1a')));};exports[_0xed16('0x1b')]=function(_0xf752cb){return cmHopper[_0xed16('0x1b')]({'UserId':null},_0xf752cb,0x1)[_0xed16('0x9')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x53f390){return cmHopper[_0xed16('0x1b')]({'active':![]},_0x53f390,0x1)[_0xed16('0x9')](loggerCatch(_0xed16('0x1c')));};exports[_0xed16('0x1d')]=function(_0x2ec1a1){var _0x31c47e={};_0x31c47e['type']=_0x2ec1a1['type'];_0x31c47e['uniqueid']=_0x2ec1a1['uniqueid'];_0x31c47e['calleridnum']=_0x2ec1a1[_0xed16('0x1e')];_0x31c47e['calleridname']=_0x2ec1a1[_0xed16('0x1f')];_0x31c47e[_0xed16('0x20')]=_0x2ec1a1[_0xed16('0x20')];_0x31c47e[_0xed16('0x21')]=_0x2ec1a1[_0xed16('0x22')];_0x31c47e[_0xed16('0x23')]=_0x2ec1a1['answertime'];_0x31c47e[_0xed16('0x24')]=0x1;_0x31c47e[_0xed16('0x25')]=_0x2ec1a1[_0xed16('0x26')];_0x31c47e[_0xed16('0x27')]=_0x2ec1a1[_0xed16('0x28')];_0x31c47e[_0xed16('0x29')]='from-sip';_0x31c47e[_0xed16('0x2a')]=_0xed16('0x2b');_0x31c47e[_0xed16('0x2c')]=0x0;_0x31c47e['assigned']=0x1;_0x31c47e[_0xed16('0x2d')]=_0x2ec1a1[_0xed16('0x28')];_0x31c47e[_0xed16('0x2e')]='COMPLETED';return BPromise[_0xed16('0xb')]()['then'](voiceQueueReport['create'](_0x31c47e))[_0xed16('0x9')](loggerCatch(_0xed16('0x2f')));};exports[_0xed16('0x30')]=function(_0x11a9c9,_0x40a649){return BPromise[_0xed16('0xb')]()[_0xed16('0xc')](cmHopper[_0xed16('0x30')](_0x11a9c9,_0x40a649))[_0xed16('0x9')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xed16('0x31')]=function(_0x1717a3){return cmHopper[_0xed16('0x15')](_0x1717a3,!![],!![])[_0xed16('0x9')](loggerCatch(_0xed16('0x32')));}; \ No newline at end of file +var _0x1215=['getContactPreview','createAgentHistory','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','../../../config/logger','../rpc/cmHopperHistory','../rpc/voiceQueueReport','catch','[createHistory]\x20','resolve','then','createHistory','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20'];(function(_0x11df0b,_0x6b1e97){var _0x1def2c=function(_0x288949){while(--_0x288949){_0x11df0b['push'](_0x11df0b['shift']());}};_0x1def2c(++_0x6b1e97);}(_0x1215,0x192));var _0x5121=function(_0x4815a6,_0x29ef5e){_0x4815a6=_0x4815a6-0x0;var _0x309740=_0x1215[_0x4815a6];return _0x309740;};'use strict';var util=require(_0x5121('0x0'));var BPromise=require('bluebird');var logger=require(_0x5121('0x1'))('preview');var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x5121('0x2'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x5121('0x3'));function loggerCatch(_0x172161){return function(_0xfce083){logger['error'](_0x172161,util['inspect'](_0xfce083,{'showHidden':![],'depth':null}));};}function create(_0x38de03){return cmHopperHistory['createHistory'](_0x38de03)[_0x5121('0x4')](loggerCatch(_0x5121('0x5')));}function createAgent(_0x2e85d9){return BPromise[_0x5121('0x6')]()[_0x5121('0x7')](agentReportPreview[_0x5121('0x8')](_0x2e85d9))[_0x5121('0x4')](loggerCatch(_0x5121('0x5')));}function moveContact(_0x39fed4){return cmHopper['moveContactManagedDialer'](_0x39fed4,!![])[_0x5121('0x4')](loggerCatch(_0x5121('0x9')));}exports[_0x5121('0xa')]=function(_0x5dbea3){return cmHopperBlack[_0x5121('0xa')](_0x5dbea3)[_0x5121('0x4')](loggerCatch(_0x5121('0xb')));};exports['getContactPreview']=function(_0x2273e2){return BPromise['resolve']()[_0x5121('0x7')](cmHopper[_0x5121('0xc')](_0x2273e2))[_0x5121('0x4')](loggerCatch('[getContactPreview]\x20'));};exports[_0x5121('0x8')]=function(_0x58b1a1,_0x3189c4){create(_0x58b1a1)[_0x5121('0x4')](loggerCatch(_0x3189c4));moveContact(_0x58b1a1)[_0x5121('0x4')](loggerCatch(_0x3189c4));};exports[_0x5121('0xd')]=function(_0x14d1ee,_0x406b1b){createAgent(_0x14d1ee)[_0x5121('0x4')](loggerCatch(_0x406b1b));};exports['createCustomerHistory']=function(_0x48d731,_0x8a6118){create(_0x48d731)[_0x5121('0x4')](loggerCatch(_0x8a6118));};exports['createCustomerFinal']=function(_0x33a4c9,_0xdaacc4){moveContact(_0x33a4c9)[_0x5121('0x4')](loggerCatch(_0xdaacc4));};exports[_0x5121('0xe')]=function(_0xa226e2,_0xf4a2fe,_0x5f3ead){if(_0xf4a2fe){_0xa226e2[_0x5121('0xf')]=null;}if(_0x5f3ead){_0xa226e2['active']=![];}return cmHopper[_0x5121('0xe')](_0xa226e2)[_0x5121('0x4')](loggerCatch(_0x5121('0x10')));};exports[_0x5121('0x11')]=function(_0x514660){return cmHopper[_0x5121('0x11')](_0x514660)[_0x5121('0x4')](loggerCatch(_0x5121('0x12')));};exports[_0x5121('0x13')]=function(_0x13d601){return cmHopper[_0x5121('0x13')]({'UserId':null},_0x13d601,0x1)[_0x5121('0x4')](loggerCatch(_0x5121('0x14')));};exports[_0x5121('0x15')]=function(_0x5457a7){return cmHopper[_0x5121('0x13')]({'active':![]},_0x5457a7,0x1)[_0x5121('0x4')](loggerCatch(_0x5121('0x16')));};exports[_0x5121('0x17')]=function(_0x519058){var _0x13741b={};_0x13741b[_0x5121('0x18')]=_0x519058['type'];_0x13741b[_0x5121('0x19')]=_0x519058[_0x5121('0x19')];_0x13741b['calleridnum']=_0x519058['calleridnum'];_0x13741b[_0x5121('0x1a')]=_0x519058['calleridname'];_0x13741b['queue']=_0x519058[_0x5121('0x1b')];_0x13741b[_0x5121('0x1c')]=_0x519058[_0x5121('0x1d')];_0x13741b['queuecallerleaveAt']=_0x519058['answertime'];_0x13741b[_0x5121('0x1e')]=0x1;_0x13741b[_0x5121('0x1f')]=_0x519058[_0x5121('0x20')];_0x13741b[_0x5121('0x21')]=_0x519058[_0x5121('0x22')];_0x13741b['context']=_0x5121('0x23');_0x13741b['exten']=_0x5121('0x24');_0x13741b[_0x5121('0x25')]=0x0;_0x13741b[_0x5121('0x26')]=0x1;_0x13741b[_0x5121('0x27')]=_0x519058[_0x5121('0x22')];_0x13741b['queuecallerexitreason']=_0x5121('0x28');return BPromise[_0x5121('0x6')]()[_0x5121('0x7')](voiceQueueReport[_0x5121('0x29')](_0x13741b))[_0x5121('0x4')](loggerCatch(_0x5121('0x2a')));};exports[_0x5121('0x2b')]=function(_0x18e22e,_0x54f152){return BPromise[_0x5121('0x6')]()[_0x5121('0x7')](cmHopper[_0x5121('0x2b')](_0x18e22e,_0x54f152))[_0x5121('0x4')](loggerCatch(_0x5121('0x2c')));};exports[_0x5121('0x2d')]=function(_0x1a4a3d){return cmHopper[_0x5121('0xe')](_0x1a4a3d,!![],!![])[_0x5121('0x4')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index a34620f..47148e6 100644 --- a/server/services/ami/preview/util/util.js +++ b/server/services/ami/preview/util/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8514=['xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','noanswer','variables','keys','forEach','buildNoAnswerEventPayload','util','lodash','moment','preview','env','127.0.0.1','loggerCatch','inspect','info','loggerError','logger2','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','toLowerVariables','hasOwnProperty','toLower','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','responsetime','endtime','logAgent','getSeconds','logLookAgent','UserId','logCustomer','ringtime','starttime','talktime','answertime','isFailure','variablesAction','BOOKED','originate','channelAgent','from-sip','uniqueid','totalGlobal','countbusyretry','countcongestionretry','cloneAction','clone','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','diff','seconds','CampaignId','type','campaigntype','dialAnswer','membername','countnoanswerretry','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid'];(function(_0xacfeb9,_0x14eafd){var _0xf43316=function(_0x4c39fa){while(--_0x4c39fa){_0xacfeb9['push'](_0xacfeb9['shift']());}};_0xf43316(++_0x14eafd);}(_0x8514,0x1b5));var _0x4851=function(_0xc460e3,_0xd0c1c7){_0xc460e3=_0xc460e3-0x0;var _0x10a1a5=_0x8514[_0xc460e3];return _0x10a1a5;};'use strict';var util=require(_0x4851('0x0'));var _=require(_0x4851('0x1'));var moment=require(_0x4851('0x2'));var logger=require('../../../../config/logger')(_0x4851('0x3'));var ipAgi=process[_0x4851('0x4')]['XCALLY_IP_AGI']||_0x4851('0x5');var utils=require('../../dialer/utils');exports[_0x4851('0x6')]=function(_0x33f276){return function(_0x1c0f3c){logger['error'](_0x33f276,util[_0x4851('0x7')](_0x1c0f3c,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x1084fc,_0x4e1941){logger[_0x4851('0x8')](_0x1084fc,util[_0x4851('0x7')](_0x4e1941,{'showHidden':![],'depth':null}));};exports[_0x4851('0x9')]=function(_0x1eb374,_0x4ab373){logger['error'](_0x1eb374,util[_0x4851('0x7')](_0x4ab373,{'showHidden':![],'depth':null}));};exports[_0x4851('0xa')]=function(_0x10b54f){return function(_0xd79650){logger['info'](_0x10b54f,util[_0x4851('0x7')](_0xd79650,{'showHidden':![],'depth':null}));};};exports[_0x4851('0xb')]=function(_0x284176,_0xfb34d8,_0x8511e6){return{'message':_0x284176,'unlock':_0xfb34d8,'active':_0x8511e6};};exports[_0x4851('0xc')]=function(_0x52c770,_0x53ef0a,_0x4c5a3e){if(!_['isUndefined'](_0x4c5a3e)&&_0x4851('0xd')===typeof _0x4c5a3e&&!_[_0x4851('0xe')](_0x4c5a3e)){if(!_[_0x4851('0xf')](_0x53ef0a)&&_0x4851('0xd')===typeof _0x53ef0a&&!_[_0x4851('0xe')](_0x53ef0a)){return util[_0x4851('0x10')](_0x4851('0x11'),_0x53ef0a,_0x4c5a3e);}return util[_0x4851('0x10')](_0x4851('0x11'),_0x4c5a3e,_0x4c5a3e);}if(!_[_0x4851('0xf')](_0x52c770)&&'string'===typeof _0x52c770&&!_[_0x4851('0xe')](_0x52c770)){return _0x52c770;}return _0x4851('0x12');};exports[_0x4851('0x13')]=function(_0x23be2e){if(_[_0x4851('0x14')](_0x23be2e)){return![];}return _0x23be2e;};exports[_0x4851('0x15')]=function(_0x18f852,_0x1ad633,_0x3e9051,_0x16a9db,_0x40023a,_0x2b9199){var _0x594c22={'XMD-QUEUE':_0x1ad633[_0x4851('0x16')]?_0x1ad633[_0x4851('0x16')][_0x4851('0x17')]:'','XMD-CALLERID':_0x16a9db,'XMD-CALLERID-PREVIEW':_0x2b9199?util['format'](_0x4851('0x11'),_0x2b9199[_0x4851('0x18')],_0x2b9199[_0x4851('0x19')]):_0x16a9db,'XMD-DIALID':_0x40023a,'XMD-CONTACTID':_0x1ad633[_0x4851('0x1a')],'XMD-CDRTYPE':_0x4851('0x1b'),'CALLERID(all)':_0x16a9db,'XMD-VOICEQUEUEID':_0x1ad633[_0x4851('0x1c')],'XMD-DIALCHANNEL':_0x3e9051,'XMD-DIALTIMEOUT':_0x18f852[_0x4851('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x4851('0x10')](_0x4851('0x1e'),_0x18f852[_0x4851('0x1f')]?'g':'',_[_0x4851('0xe')](_0x18f852['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x18f852['dialPreviewUrl']||'','XMD-AGI':_0x18f852[_0x4851('0x20')]?util['format'](_0x4851('0x21'),ipAgi,_0x18f852[_0x4851('0x20')]):_0x4851('0x22'),'XMD-AGIAFTER':_0x18f852[_0x4851('0x1f')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x18f852[_0x4851('0x1f')]):_0x4851('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x2b9199?_0x2b9199[_0x4851('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x2b9199?_0x2b9199[_0x4851('0x24')]:'','XMD-DESTINATION':_0x4851('0x25'),'SIPADDHEADER':_0x4851('0x26')};if(!_[_0x4851('0xe')](_0x18f852[_0x4851('0x27')])){_0x594c22[util['format']('%s',_0x4851('0x28'))]=_0x18f852[_0x4851('0x27')];_0x594c22[util[_0x4851('0x10')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x40023a;}return _0x594c22;};exports[_0x4851('0x29')]=function(_0x3a41e8){var _0x1989c5={};for(var _0x3ba83e in _0x3a41e8){if(_0x3a41e8[_0x4851('0x2a')](_0x3ba83e)){_0x1989c5[util['format']('%s',_[_0x4851('0x2b')](_0x3ba83e))]=_0x3a41e8[_0x3ba83e];}}return{'variables':_0x1989c5};};exports['updateOriginated']=function(_0x8890b4,_0x1b092a){if(!_[_0x4851('0x14')](_0x8890b4)){if(_0x8890b4[_0x4851('0x2a')]('originated')){if(_0x8890b4[_0x4851('0x2c')]>0x0){_0x8890b4[_0x4851('0x2c')]-=0x1;}else{logger[_0x4851('0x2d')](_0x4851('0x2e'),_0x1b092a);}}}else{logger['error'](_0x4851('0x2f'),_0x1b092a);}};exports[_0x4851('0x30')]=function(_0x59679e){var _0x4dd724=moment()['format'](_0x4851('0x31'));_0x59679e[_0x4851('0x32')]=0xd;_0x59679e[_0x4851('0x33')]=_0x4851('0x34');_0x59679e['starttime']=_0x4dd724;_0x59679e[_0x4851('0x35')]=_0x4dd724;_0x59679e[_0x4851('0x36')]=_0x4dd724;};exports[_0x4851('0x37')]=function(_0x114482,_0x46e25a,_0x17acb9){var _0x45e0b0=moment()['format'](_0x4851('0x31'));_0x114482[_0x4851('0x32')]=_0x46e25a;_0x114482[_0x4851('0x33')]=_0x17acb9;_0x114482['responsetime']=_0x45e0b0;_0x114482['ringtime']=utils[_0x4851('0x38')](_0x114482['responsetime'],_0x114482['starttime']);};exports[_0x4851('0x39')]=function(_0x544066,_0x584f26,_0x5e09d3){_0x544066['membername']=_0x584f26;_0x544066[_0x4851('0x3a')]=_0x5e09d3;};exports[_0x4851('0x3b')]=function(_0x1fa164,_0x5bc53d,_0x9ac11d){var _0x444ea8=moment()[_0x4851('0x10')](_0x4851('0x31'));_0x1fa164['state']=_0x5bc53d;_0x1fa164[_0x4851('0x33')]=_0x9ac11d;_0x1fa164['responsetime']=_0x1fa164[_0x4851('0x35')]?_0x1fa164[_0x4851('0x35')]:_0x444ea8;_0x1fa164[_0x4851('0x36')]=_0x1fa164[_0x4851('0x36')]?_0x1fa164[_0x4851('0x36')]:_0x444ea8;_0x1fa164[_0x4851('0x3c')]=utils[_0x4851('0x38')](_0x1fa164['responsetime']||0x0,_0x1fa164[_0x4851('0x3d')]||0x0);_0x1fa164[_0x4851('0x3e')]=_0x1fa164['answertime']?utils[_0x4851('0x38')](_0x1fa164[_0x4851('0x36')],_0x1fa164[_0x4851('0x3f')]):0x0;};exports[_0x4851('0x40')]=function(_0x13d652){return _0x13d652==='Failure';};exports[_0x4851('0x41')]=function(_0x20f2fe,_0x5a8de6,_0x4e10b6,_0x6c22ff,_0x2bb7d9){var _0x298008=_0x6c22ff?'RECALL':_0x20f2fe[_0x4851('0x18')];_0x298008=_0x2bb7d9?_0x4851('0x42'):_0x298008;return{'actionid':_0x20f2fe['uniqueid'],'action':_0x4851('0x43'),'channel':_0x20f2fe[_0x4851('0x44')],'callerid':util[_0x4851('0x10')](_0x4851('0x11'),_0x298008,_0x20f2fe[_0x4851('0x19')]),'Exten':_0x4851('0x25'),'Context':_0x4851('0x45'),'Priority':'1','variable':_0x4e10b6,'timeout':(_0x5a8de6['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x20f2fe[_0x4851('0x46')]};};exports[_0x4851('0x47')]=function(_0x495674){return _0x495674[_0x4851('0x48')]+_0x495674[_0x4851('0x49')]+_0x495674['countnoanswerretry']+_0x495674['countagentrejectretry']+_0x495674['countnosuchnumberretry'];};exports[_0x4851('0x4a')]=function(_0x1edd0d){var _0x2081f9=_[_0x4851('0x4b')](_0x1edd0d);_0x2081f9[_0x4851('0x32')]=0xf;_0x2081f9['statedesc']='Global';return _0x2081f9;};exports['scheduledAt']=function(_0x55cf2e,_0xf407ab,_0x58f553){var _0x4b05e3={};_0x4b05e3[_0xf407ab]=_0x55cf2e[_0xf407ab];_0x4b05e3['active']=![];_0x4b05e3['scheduledat']=moment()[_0x4851('0x4c')](_0x58f553,'minutes')['format'](_0x4851('0x31'));_0x4b05e3[_0x4851('0x1a')]=_0x55cf2e[_0x4851('0x1a')];_0x4b05e3[_0x4851('0x4d')]=_0x55cf2e[_0x4851('0x4d')];_0x4b05e3['VoiceQueueId']=_0x55cf2e[_0x4851('0x1c')]||undefined;return _0x4b05e3;};exports[_0x4851('0x4e')]=function(_0x26bea6,_0x3793cc){if(!_[_0x4851('0x14')](_0x26bea6)){if(_0x26bea6[_0x4851('0x4f')]>0x0){_0x26bea6['pTalking']-=0x1;}else{logger[_0x4851('0x2d')](_0x3793cc,_0x4851('0x50'));}}else{logger['error'](_0x3793cc,_0x4851('0x51'));}};exports[_0x4851('0x52')]=function(_0x3fab88){if(_0x3fab88<=0x0){return!![];}return![];};function buildObj(_0x1e0eb7,_0x2b2a71,_0x184572){_0x1e0eb7[_0x4851('0x53')]=_0x2b2a71;_0x1e0eb7['name']=_0x1e0eb7[_0x4851('0x54')];_0x1e0eb7[_0x4851('0x55')]=_0x1e0eb7[_0x4851('0x44')];_0x1e0eb7[_0x4851('0x56')]=_0x4851('0x57');if(_0x184572){_0x1e0eb7['mandatoryDisposition']=_0x184572['mandatoryDisposition'];}return _0x1e0eb7;}exports['buildObj']=buildObj;exports[_0x4851('0x58')]=function(_0x13d6c3){var _0x4625a6=[];for(var _0x57852d in _0x13d6c3){if(_0x13d6c3['hasOwnProperty'](_0x57852d)){if(!_['isNil'](_0x13d6c3[_0x57852d])&&_0x13d6c3[_0x57852d][_0x4851('0x32')]===_0x4851('0x59')&&_0x13d6c3[_0x57852d][_0x4851('0x5a')]===_0x4851('0x5b')){_0x4625a6[_0x4851('0x5c')](_0x13d6c3[_0x57852d]['id']);}}}return _0x4625a6;};exports[_0x4851('0x5d')]=function(_0x31dd91){var _0x56c6ef=moment()[_0x4851('0x5e')](0x0);var _0x45ba1b=moment(_0x31dd91)['milliseconds'](0x0);return _0x56c6ef[_0x4851('0x5f')](_0x45ba1b,_0x4851('0x60'));};exports['createBody']=function(_0x265bb8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x265bb8[_0x4851('0x1a')],'ListId':_0x265bb8[_0x4851('0x4d')],'VoiceQueueId':_0x265bb8[_0x4851('0x1c')]||undefined,'CampaignId':_0x265bb8[_0x4851('0x61')]||undefined};};exports['filterKey']=function(_0x2c5a04){if(_0x2c5a04===_0x4851('0x46')||_0x2c5a04==='idContact'||_0x2c5a04===_0x4851('0x54')||_0x2c5a04===_0x4851('0x62')||_0x2c5a04===_0x4851('0x63')||_0x2c5a04===_0x4851('0x64')||_0x2c5a04===_0x4851('0x65')||_0x2c5a04==='channelAgent'||_0x2c5a04==='calleridname'||_0x2c5a04==='active'||_0x2c5a04==='calleridnum'||_0x2c5a04==='scheduledat'||_0x2c5a04==='countbusyretry'||_0x2c5a04===_0x4851('0x49')||_0x2c5a04===_0x4851('0x66')||_0x2c5a04==='countglobal'||_0x2c5a04===_0x4851('0x67')||_0x2c5a04===_0x4851('0x68')||_0x2c5a04===_0x4851('0x69')||_0x2c5a04===_0x4851('0x6a')||_0x2c5a04===_0x4851('0x1a')||_0x2c5a04===_0x4851('0x4d')||_0x2c5a04===_0x4851('0x3a')||_0x2c5a04===_0x4851('0x1c')||_0x2c5a04==='sipcallid'||_0x2c5a04===_0x4851('0x6b')||_0x2c5a04==='xmd-queue'||_0x2c5a04===_0x4851('0x6c')||_0x2c5a04===_0x4851('0x6d')||_0x2c5a04==='xmd-dialurl'||_0x2c5a04==='xmd-dialtimeout'||_0x2c5a04===_0x4851('0x6e')||_0x2c5a04===_0x4851('0x6f')||_0x2c5a04==='xmd-dialchannel'||_0x2c5a04===_0x4851('0x70')||_0x2c5a04===_0x4851('0x71')||_0x2c5a04===_0x4851('0x72')||_0x2c5a04===_0x4851('0x73')||_0x2c5a04===_0x4851('0x74')||_0x2c5a04===_0x4851('0x75')||_0x2c5a04===_0x4851('0x76')||_0x2c5a04===_0x4851('0x77')||_0x2c5a04==='rtpaudioqosjitterbridged'||_0x2c5a04==='rtpaudioqosloss'||_0x2c5a04==='rtpaudioqoslossbridged'||_0x2c5a04===_0x4851('0x78')||_0x2c5a04===_0x4851('0x79')||_0x2c5a04===_0x4851('0x75')||_0x2c5a04===_0x4851('0x76')||_0x2c5a04===_0x4851('0x77')||_0x2c5a04===_0x4851('0x7a')||_0x2c5a04===_0x4851('0x7b')||_0x2c5a04===_0x4851('0x7c')||_0x2c5a04===_0x4851('0x78')||_0x2c5a04==='rtpaudioqosrttbridged'||_0x2c5a04===_0x4851('0x7d')||_0x2c5a04===_0x4851('0x7e')||_0x2c5a04===_0x4851('0x32')||_0x2c5a04===_0x4851('0x33')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x46ed96,_0x266805){var _0x5d76af,_0x3d62bd,_0x4a4c9a;if(_0x266805<=0x0){_0x266805=0x1;}_0x5d76af=new RegExp(_0x4851('0x7f')+_0x266805+'}$');_0x3d62bd=Math[_0x4851('0x80')](0xa,_0x266805-0x1);_0x4a4c9a=Math[_0x4851('0x80')](0xa,_0x266805)-0x1;return util[_0x4851('0x10')]('%s',_[_0x4851('0x81')](_0x46ed96,_0x5d76af,_[_0x4851('0x82')](_0x3d62bd,_0x4a4c9a)));};exports[_0x4851('0x83')]=function(_0x556bbd){var _0x1ca364=_0x556bbd[_0x4851('0x84')](/"(.*?)"/);return _0x1ca364?_0x1ca364[0x1]:_0x556bbd;};exports['extractCalleridNumber']=function(_0x42bb8a){var _0x177e3b=_0x42bb8a['match'](/<(.*?)>/);return _0x177e3b?_0x177e3b[0x1]:_0x42bb8a;};function buildNoAnswerEventPayload(_0x2ba076,_0x5252de){var _0x36ac05=buildObj(_0x2ba076,_0x4851('0x85'));if(!_[_0x4851('0xe')](_0x5252de[_0x4851('0x86')])){Object[_0x4851('0x87')](_0x5252de[_0x4851('0x86')])[_0x4851('0x88')](function(_0xe35a18){_0x36ac05[_0xe35a18['toLowerCase']()]=_0x5252de[_0x4851('0x86')][_0xe35a18];});}return _0x36ac05;}exports[_0x4851('0x89')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x1b27=['endtime','ringtime','responsetime','logLookAgent','membername','logCustomer','getSeconds','answertime','Failure','variablesAction','calleridname','BOOKED','originate','channelAgent','xcally-motion-preview','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','voice','mandatoryDisposition','agentReadyId','not_inuse','status','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','active','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosloss','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','env','127.0.0.1','../../dialer/utils','error','info','inspect','loggerError','logger2','message','getCallerId','string','isEmpty','format','\x22%s\x22\x20<%s>','isUndefined','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridnum','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','NONE','originatecalleridnum','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime'];(function(_0x3bd534,_0x480f6b){var _0x1a7d1b=function(_0x1d30af){while(--_0x1d30af){_0x3bd534['push'](_0x3bd534['shift']());}};_0x1a7d1b(++_0x480f6b);}(_0x1b27,0x17c));var _0x71b2=function(_0xc8c2e8,_0x2d9c8c){_0xc8c2e8=_0xc8c2e8-0x0;var _0x5c042a=_0x1b27[_0xc8c2e8];return _0x5c042a;};'use strict';var util=require(_0x71b2('0x0'));var _=require(_0x71b2('0x1'));var moment=require(_0x71b2('0x2'));var logger=require(_0x71b2('0x3'))(_0x71b2('0x4'));var ipAgi=process[_0x71b2('0x5')]['XCALLY_IP_AGI']||_0x71b2('0x6');var utils=require(_0x71b2('0x7'));exports['loggerCatch']=function(_0x409f25){return function(_0x3d0b69){logger[_0x71b2('0x8')](_0x409f25,util['inspect'](_0x3d0b69,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x12db4a,_0x2064cc){logger[_0x71b2('0x9')](_0x12db4a,util[_0x71b2('0xa')](_0x2064cc,{'showHidden':![],'depth':null}));};exports[_0x71b2('0xb')]=function(_0x2705fb,_0x30ee7e){logger[_0x71b2('0x8')](_0x2705fb,util[_0x71b2('0xa')](_0x30ee7e,{'showHidden':![],'depth':null}));};exports[_0x71b2('0xc')]=function(_0xbbb151){return function(_0x534d84){logger[_0x71b2('0x9')](_0xbbb151,util[_0x71b2('0xa')](_0x534d84,{'showHidden':![],'depth':null}));};};exports[_0x71b2('0xd')]=function(_0xc8f202,_0xec2a3a,_0xed78eb){return{'message':_0xc8f202,'unlock':_0xec2a3a,'active':_0xed78eb};};exports[_0x71b2('0xe')]=function(_0x5ac1f6,_0x9f18d4,_0x24aaef){if(!_['isUndefined'](_0x24aaef)&&_0x71b2('0xf')===typeof _0x24aaef&&!_[_0x71b2('0x10')](_0x24aaef)){if(!_['isUndefined'](_0x9f18d4)&&_0x71b2('0xf')===typeof _0x9f18d4&&!_['isEmpty'](_0x9f18d4)){return util[_0x71b2('0x11')](_0x71b2('0x12'),_0x9f18d4,_0x24aaef);}return util['format'](_0x71b2('0x12'),_0x24aaef,_0x24aaef);}if(!_[_0x71b2('0x13')](_0x5ac1f6)&&_0x71b2('0xf')===typeof _0x5ac1f6&&!_[_0x71b2('0x10')](_0x5ac1f6)){return _0x5ac1f6;}return _0x71b2('0x14');};exports[_0x71b2('0x15')]=function(_0x385655){if(_[_0x71b2('0x16')](_0x385655)){return![];}return _0x385655;};exports[_0x71b2('0x17')]=function(_0x5f5b79,_0x5298d1,_0x3fe067,_0x2d7182,_0x1d5c29,_0x532428){var _0x32f480={'XMD-QUEUE':_0x5298d1[_0x71b2('0x18')]?_0x5298d1['Queue']['name']:'','XMD-CALLERID':_0x2d7182,'XMD-CALLERID-PREVIEW':_0x532428?util[_0x71b2('0x11')](_0x71b2('0x12'),_0x532428['calleridname'],_0x532428[_0x71b2('0x19')]):_0x2d7182,'XMD-DIALID':_0x1d5c29,'XMD-CONTACTID':_0x5298d1[_0x71b2('0x1a')],'XMD-CDRTYPE':_0x71b2('0x1b'),'CALLERID(all)':_0x2d7182,'XMD-VOICEQUEUEID':_0x5298d1[_0x71b2('0x1c')],'XMD-DIALCHANNEL':_0x3fe067,'XMD-DIALTIMEOUT':_0x5f5b79['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x71b2('0x11')](_0x71b2('0x1d'),_0x5f5b79[_0x71b2('0x1e')]?'g':'',_[_0x71b2('0x10')](_0x5f5b79[_0x71b2('0x1f')])?'':_0x71b2('0x20')),'XMD-DIALURL':_0x5f5b79['dialPreviewUrl']||'','XMD-AGI':_0x5f5b79[_0x71b2('0x21')]?util[_0x71b2('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5f5b79['dialQueueProject']):_0x71b2('0x22'),'XMD-AGIAFTER':_0x5f5b79[_0x71b2('0x1e')]?util[_0x71b2('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5f5b79[_0x71b2('0x1e')]):_0x71b2('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x532428?_0x532428[_0x71b2('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x532428?_0x532428['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x71b2('0x24')};if(!_[_0x71b2('0x10')](_0x5f5b79['monitor_format'])){_0x32f480[util[_0x71b2('0x11')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x5f5b79[_0x71b2('0x1f')];_0x32f480[util['format']('%s',_0x71b2('0x25'))]=_0x1d5c29;}return _0x32f480;};exports[_0x71b2('0x26')]=function(_0x442515){var _0x1ad7d1={};for(var _0x1b3835 in _0x442515){if(_0x442515[_0x71b2('0x27')](_0x1b3835)){_0x1ad7d1[util[_0x71b2('0x11')]('%s',_[_0x71b2('0x28')](_0x1b3835))]=_0x442515[_0x1b3835];}}return{'variables':_0x1ad7d1};};exports[_0x71b2('0x29')]=function(_0x3f362b,_0x405e1b){if(!_[_0x71b2('0x16')](_0x3f362b)){if(_0x3f362b[_0x71b2('0x27')](_0x71b2('0x2a'))){if(_0x3f362b[_0x71b2('0x2a')]>0x0){_0x3f362b[_0x71b2('0x2a')]-=0x1;}else{logger[_0x71b2('0x8')](_0x71b2('0x2b'),_0x405e1b);}}}else{logger['error'](_0x71b2('0x2c'),_0x405e1b);}};exports['logBlacklist']=function(_0x138217){var _0x3391df=moment()[_0x71b2('0x11')](_0x71b2('0x2d'));_0x138217[_0x71b2('0x2e')]=0xd;_0x138217[_0x71b2('0x2f')]='Blacklist';_0x138217[_0x71b2('0x30')]=_0x3391df;_0x138217['responsetime']=_0x3391df;_0x138217[_0x71b2('0x31')]=_0x3391df;};exports['logAgent']=function(_0x27e538,_0x45623a,_0x507ce9){var _0x413600=moment()['format'](_0x71b2('0x2d'));_0x27e538[_0x71b2('0x2e')]=_0x45623a;_0x27e538[_0x71b2('0x2f')]=_0x507ce9;_0x27e538['responsetime']=_0x413600;_0x27e538[_0x71b2('0x32')]=utils['getSeconds'](_0x27e538[_0x71b2('0x33')],_0x27e538[_0x71b2('0x30')]);};exports[_0x71b2('0x34')]=function(_0x2b9dc4,_0x16ff5d,_0x3669bc){_0x2b9dc4[_0x71b2('0x35')]=_0x16ff5d;_0x2b9dc4['UserId']=_0x3669bc;};exports[_0x71b2('0x36')]=function(_0x34c994,_0x3a7822,_0x405a28){var _0x4df434=moment()[_0x71b2('0x11')](_0x71b2('0x2d'));_0x34c994[_0x71b2('0x2e')]=_0x3a7822;_0x34c994['statedesc']=_0x405a28;_0x34c994[_0x71b2('0x33')]=_0x34c994[_0x71b2('0x33')]?_0x34c994[_0x71b2('0x33')]:_0x4df434;_0x34c994['endtime']=_0x34c994[_0x71b2('0x31')]?_0x34c994[_0x71b2('0x31')]:_0x4df434;_0x34c994['ringtime']=utils[_0x71b2('0x37')](_0x34c994['responsetime']||0x0,_0x34c994[_0x71b2('0x30')]||0x0);_0x34c994['talktime']=_0x34c994[_0x71b2('0x38')]?utils[_0x71b2('0x37')](_0x34c994[_0x71b2('0x31')],_0x34c994[_0x71b2('0x38')]):0x0;};exports['isFailure']=function(_0x42322e){return _0x42322e===_0x71b2('0x39');};exports[_0x71b2('0x3a')]=function(_0x3a169e,_0x552254,_0x4d9c0b,_0x2890ac,_0x76efd2){var _0x364ad9=_0x2890ac?'RECALL':_0x3a169e[_0x71b2('0x3b')];_0x364ad9=_0x76efd2?_0x71b2('0x3c'):_0x364ad9;return{'actionid':_0x3a169e['uniqueid'],'action':_0x71b2('0x3d'),'channel':_0x3a169e[_0x71b2('0x3e')],'callerid':util['format'](_0x71b2('0x12'),_0x364ad9,_0x3a169e['calleridnum']),'Exten':_0x71b2('0x3f'),'Context':_0x71b2('0x40'),'Priority':'1','variable':_0x4d9c0b,'timeout':(_0x552254[_0x71b2('0x41')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3a169e[_0x71b2('0x42')]};};exports[_0x71b2('0x43')]=function(_0x47f589){return _0x47f589[_0x71b2('0x44')]+_0x47f589[_0x71b2('0x45')]+_0x47f589[_0x71b2('0x46')]+_0x47f589[_0x71b2('0x47')]+_0x47f589[_0x71b2('0x48')];};exports[_0x71b2('0x49')]=function(_0x35341c){var _0x129db7=_[_0x71b2('0x4a')](_0x35341c);_0x129db7[_0x71b2('0x2e')]=0xf;_0x129db7[_0x71b2('0x2f')]=_0x71b2('0x4b');return _0x129db7;};exports[_0x71b2('0x4c')]=function(_0x4459e6,_0x32bc19,_0x365f21){var _0x3783b8={};_0x3783b8[_0x32bc19]=_0x4459e6[_0x32bc19];_0x3783b8['active']=![];_0x3783b8[_0x71b2('0x4d')]=moment()[_0x71b2('0x4e')](_0x365f21,'minutes')[_0x71b2('0x11')](_0x71b2('0x2d'));_0x3783b8[_0x71b2('0x1a')]=_0x4459e6[_0x71b2('0x1a')];_0x3783b8[_0x71b2('0x4f')]=_0x4459e6['ListId'];_0x3783b8['VoiceQueueId']=_0x4459e6[_0x71b2('0x1c')]||undefined;return _0x3783b8;};exports[_0x71b2('0x50')]=function(_0x196c29,_0x5223eb){if(!_[_0x71b2('0x16')](_0x196c29)){if(_0x196c29['pTalking']>0x0){_0x196c29[_0x71b2('0x51')]-=0x1;}else{logger['error'](_0x5223eb,_0x71b2('0x52'));}}else{logger[_0x71b2('0x8')](_0x5223eb,_0x71b2('0x53'));}};exports[_0x71b2('0x54')]=function(_0x22e126){if(_0x22e126<=0x0){return!![];}return![];};function buildObj(_0x145245,_0x2d5fc6,_0x1c77d3){_0x145245[_0x71b2('0x55')]=_0x2d5fc6;_0x145245['name']=_0x145245[_0x71b2('0x56')];_0x145245['interface']=_0x145245[_0x71b2('0x3e')];_0x145245['motionChannel']=_0x71b2('0x57');if(_0x1c77d3){_0x145245[_0x71b2('0x58')]=_0x1c77d3['mandatoryDisposition'];}return _0x145245;}exports['buildObj']=buildObj;exports[_0x71b2('0x59')]=function(_0x44f27f){var _0x5664cb=[];for(var _0x1841d3 in _0x44f27f){if(_0x44f27f[_0x71b2('0x27')](_0x1841d3)){if(!_['isNil'](_0x44f27f[_0x1841d3])&&_0x44f27f[_0x1841d3][_0x71b2('0x2e')]===_0x71b2('0x5a')&&_0x44f27f[_0x1841d3][_0x71b2('0x5b')]==='reachable'){_0x5664cb[_0x71b2('0x5c')](_0x44f27f[_0x1841d3]['id']);}}}return _0x5664cb;};exports[_0x71b2('0x5d')]=function(_0x54ec2d){var _0x49f3fe=moment()[_0x71b2('0x5e')](0x0);var _0x42f297=moment(_0x54ec2d)[_0x71b2('0x5e')](0x0);return _0x49f3fe[_0x71b2('0x5f')](_0x42f297,_0x71b2('0x60'));};exports[_0x71b2('0x61')]=function(_0x2dd62e){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2dd62e[_0x71b2('0x1a')],'ListId':_0x2dd62e['ListId'],'VoiceQueueId':_0x2dd62e[_0x71b2('0x1c')]||undefined,'CampaignId':_0x2dd62e[_0x71b2('0x62')]||undefined};};exports[_0x71b2('0x63')]=function(_0x15a84c){if(_0x15a84c===_0x71b2('0x42')||_0x15a84c===_0x71b2('0x64')||_0x15a84c===_0x71b2('0x56')||_0x15a84c===_0x71b2('0x65')||_0x15a84c===_0x71b2('0x66')||_0x15a84c===_0x71b2('0x67')||_0x15a84c===_0x71b2('0x35')||_0x15a84c===_0x71b2('0x3e')||_0x15a84c===_0x71b2('0x3b')||_0x15a84c===_0x71b2('0x68')||_0x15a84c===_0x71b2('0x19')||_0x15a84c==='scheduledat'||_0x15a84c==='countbusyretry'||_0x15a84c===_0x71b2('0x45')||_0x15a84c===_0x71b2('0x46')||_0x15a84c===_0x71b2('0x69')||_0x15a84c===_0x71b2('0x6a')||_0x15a84c===_0x71b2('0x6b')||_0x15a84c===_0x71b2('0x6c')||_0x15a84c===_0x71b2('0x6d')||_0x15a84c===_0x71b2('0x1a')||_0x15a84c==='ListId'||_0x15a84c===_0x71b2('0x6e')||_0x15a84c===_0x71b2('0x1c')||_0x15a84c===_0x71b2('0x6f')||_0x15a84c===_0x71b2('0x70')||_0x15a84c===_0x71b2('0x71')||_0x15a84c==='xmd-phone'||_0x15a84c===_0x71b2('0x72')||_0x15a84c==='xmd-dialurl'||_0x15a84c==='xmd-dialtimeout'||_0x15a84c==='xmd-dialoptions'||_0x15a84c===_0x71b2('0x73')||_0x15a84c===_0x71b2('0x74')||_0x15a84c===_0x71b2('0x75')||_0x15a84c===_0x71b2('0x76')||_0x15a84c===_0x71b2('0x77')||_0x15a84c===_0x71b2('0x78')||_0x15a84c===_0x71b2('0x79')||_0x15a84c===_0x71b2('0x7a')||_0x15a84c===_0x71b2('0x7b')||_0x15a84c===_0x71b2('0x7c')||_0x15a84c===_0x71b2('0x7d')||_0x15a84c==='rtpaudioqosloss'||_0x15a84c==='rtpaudioqoslossbridged'||_0x15a84c===_0x71b2('0x7e')||_0x15a84c===_0x71b2('0x7f')||_0x15a84c==='rtpaudioqos'||_0x15a84c===_0x71b2('0x7b')||_0x15a84c===_0x71b2('0x7c')||_0x15a84c===_0x71b2('0x7d')||_0x15a84c===_0x71b2('0x80')||_0x15a84c===_0x71b2('0x81')||_0x15a84c===_0x71b2('0x7e')||_0x15a84c==='rtpaudioqosrttbridged'||_0x15a84c===_0x71b2('0x82')||_0x15a84c===_0x71b2('0x83')||_0x15a84c===_0x71b2('0x2e')||_0x15a84c===_0x71b2('0x2f')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x43987d,_0x1187ea){var _0x507ebe,_0x1cf9a3,_0x55c092;if(_0x1187ea<=0x0){_0x1187ea=0x1;}_0x507ebe=new RegExp(_0x71b2('0x84')+_0x1187ea+'}$');_0x1cf9a3=Math['pow'](0xa,_0x1187ea-0x1);_0x55c092=Math[_0x71b2('0x85')](0xa,_0x1187ea)-0x1;return util['format']('%s',_[_0x71b2('0x86')](_0x43987d,_0x507ebe,_[_0x71b2('0x87')](_0x1cf9a3,_0x55c092)));};exports['extractCalleridName']=function(_0x4262b1){var _0x1f91b4=_0x4262b1[_0x71b2('0x88')](/"(.*?)"/);return _0x1f91b4?_0x1f91b4[0x1]:_0x4262b1;};exports[_0x71b2('0x89')]=function(_0xc9cab5){var _0x26a3bc=_0xc9cab5[_0x71b2('0x88')](/<(.*?)>/);return _0x26a3bc?_0x26a3bc[0x1]:_0xc9cab5;};function buildNoAnswerEventPayload(_0x3c6371,_0x275926){var _0x20e213=buildObj(_0x3c6371,_0x71b2('0x8a'));if(!_[_0x71b2('0x10')](_0x275926['variables'])){Object['keys'](_0x275926[_0x71b2('0x8b')])[_0x71b2('0x8c')](function(_0x19ec5c){_0x20e213[_0x19ec5c[_0x71b2('0x8d')]()]=_0x275926['variables'][_0x19ec5c];});}return _0x20e213;}exports[_0x71b2('0x8e')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index fcbf6a0..b4362e0 100644 --- a/server/services/ami/properties.js +++ b/server/services/ami/properties.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d24=['boolean','voicechannel','voicequeuechannelhangup','queueadd','string','number','queueremove','queuepause'];(function(_0x18032f,_0x4f4e45){var _0xb0b2b8=function(_0x563262){while(--_0x563262){_0x18032f['push'](_0x18032f['shift']());}};_0xb0b2b8(++_0x4f4e45);}(_0x6d24,0xeb));var _0x46d2=function(_0x5ab08e,_0x2cf537){_0x5ab08e=_0x5ab08e-0x0;var _0x52234e=_0x6d24[_0x5ab08e];return _0x52234e;};'use strict';exports[_0x46d2('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x46d2('0x1'),'required':!![]},'membername':{'type':_0x46d2('0x1'),'required':!![]},'penalty':{'type':_0x46d2('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x46d2('0x3')]={'queue':{'type':_0x46d2('0x1'),'required':!![]},'interface':{'type':_0x46d2('0x1'),'required':!![]}};exports[_0x46d2('0x4')]={'interface':{'type':_0x46d2('0x1'),'required':!![]},'paused':{'type':_0x46d2('0x5')},'reason':{'type':_0x46d2('0x1'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x46d2('0x1'),'required':!![]}};exports[_0x46d2('0x6')]={'uniqueid':{'type':_0x46d2('0x1'),'required':!![]},'filename':{'type':_0x46d2('0x1')},'format':{'type':_0x46d2('0x1')},'mixmonitorid':{'type':_0x46d2('0x1')}};exports[_0x46d2('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x46d2('0x1'),'required':!![]},'exten':{'type':_0x46d2('0x1'),'required':!![]},'context':{'type':_0x46d2('0x1')}}; \ No newline at end of file +var _0x8517=['voicequeuechannelhangup','queueadd','string','boolean','queueremove','queuepause','voicequeuechannel','voicechannel'];(function(_0x7876c7,_0x5b78e5){var _0x3908cb=function(_0x5bd505){while(--_0x5bd505){_0x7876c7['push'](_0x7876c7['shift']());}};_0x3908cb(++_0x5b78e5);}(_0x8517,0xe9));var _0x7851=function(_0x4fa587,_0x371e35){_0x4fa587=_0x4fa587-0x0;var _0x24cac8=_0x8517[_0x4fa587];return _0x24cac8;};'use strict';exports[_0x7851('0x0')]={'queue':{'type':_0x7851('0x1'),'required':!![]},'interface':{'type':_0x7851('0x1'),'required':!![]},'membername':{'type':_0x7851('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x7851('0x2'),'required':![]}};exports[_0x7851('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x7851('0x1'),'required':!![]}};exports[_0x7851('0x4')]={'interface':{'type':_0x7851('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x7851('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x7851('0x1'),'required':![]}};exports[_0x7851('0x5')]={'uniqueid':{'type':_0x7851('0x1'),'required':!![]}};exports[_0x7851('0x6')]={'uniqueid':{'type':_0x7851('0x1'),'required':!![]},'filename':{'type':_0x7851('0x1')},'format':{'type':_0x7851('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x7851('0x7')]={'uniqueid':{'type':_0x7851('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x7851('0x1'),'required':!![]},'exten':{'type':_0x7851('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 45a3931..9f9ea06 100644 --- a/server/services/ami/realtime/index.js +++ b/server/services/ami/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['initTriggers','triggers','initTemplates','initZendeskAccounts','zendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queuecallerexit','queuecallerabandon','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','total','answered','unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','agents','length','isUndefined','mergeFromDatabase','initTelephones','initTrunks'];(function(_0x34d73d,_0x22be61){var _0x5938e3=function(_0x1f0ca0){while(--_0x1f0ca0){_0x34d73d['push'](_0x34d73d['shift']());}};_0x5938e3(++_0x22be61);}(_0xdb28,0x106));var _0x8db2=function(_0x3290c1,_0x35ae41){_0x3290c1=_0x3290c1-0x0;var _0x3360e9=_0xdb28[_0x3290c1];return _0x3360e9;};'use strict';var _=require(_0x8db2('0x0'));var moment=require(_0x8db2('0x1'));var util=require(_0x8db2('0x2'));var Agent=require(_0x8db2('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x8db2('0x4'));var VoiceQueue=require(_0x8db2('0x5'));var Trigger=require(_0x8db2('0x6'));var Template=require(_0x8db2('0x7'));var Campaign=require(_0x8db2('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x8db2('0x9'));var SalesforceAccount=require(_0x8db2('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x8db2('0xb'));var DeskAccount=require(_0x8db2('0xc'));var VtigerAccount=require(_0x8db2('0xd'));var ServicenowAccount=require(_0x8db2('0xe'));var Dynamics365Account=require(_0x8db2('0xf'));var FreshsalesAccount=require(_0x8db2('0x10'));var FaxAccount=require(_0x8db2('0x11'));function Realtime(){this['agents']={};this[_0x8db2('0x12')]={};this[_0x8db2('0x13')]={};this[_0x8db2('0x14')]={};this['triggers']={};this[_0x8db2('0x15')]={};this[_0x8db2('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8db2('0x17')]={};this[_0x8db2('0x18')]={};this[_0x8db2('0x19')]={};this[_0x8db2('0x1a')]={};this[_0x8db2('0x1b')]={};this['settings']={};this['zendeskAccounts']={};this[_0x8db2('0x1c')]={};this[_0x8db2('0x1d')]={};this[_0x8db2('0x1e')]={};this[_0x8db2('0x1f')]={};this[_0x8db2('0x20')]={};this[_0x8db2('0x21')]={};this[_0x8db2('0x22')]={};this[_0x8db2('0x23')]={};this[_0x8db2('0x24')]={};this[_0x8db2('0x25')]={};}function freeIsNotKey(_0x5489a9,_0x13b0f5,_0x24da1b){var _0x48101e=_[_0x8db2('0x26')](_0x5489a9,function(_0x44957d){return _0x44957d[_0x24da1b];});for(var _0x21db8c in _0x13b0f5){if(_0x13b0f5[_0x8db2('0x27')](_0x21db8c)){if(!_0x48101e[_0x21db8c]){delete _0x13b0f5[_0x21db8c];}}}}function freeIsNotKeySip(_0x2efd06,_0x46ce14){var _0x51d60d=_['mapKeys'](_0x2efd06,function(_0x77789){return util[_0x8db2('0x28')](_0x8db2('0x29'),_0x77789[_0x8db2('0x2a')]);});for(var _0x58562e in _0x46ce14){if(_0x46ce14[_0x8db2('0x27')](_0x58562e)){if(!_0x51d60d[_0x58562e]){delete _0x46ce14[_0x58562e];}}}}function freeIsNotKeyAgent(_0x36a9ff,_0x260940){var _0x297ba3=_[_0x8db2('0x26')](_0x36a9ff,function(_0x597260){var _0x124467=_[_0x8db2('0x2b')](_0x597260[_0x8db2('0x2c')])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x597260[_0x8db2('0x2a')]):_0x597260[_0x8db2('0x2c')];return _0x124467;});for(var _0x5c6614 in _0x260940){if(_0x260940[_0x8db2('0x27')](_0x5c6614)){if(!_0x297ba3[_0x5c6614]){delete _0x260940[_0x5c6614];}}}}function clearVoiceCallReports(_0x4f6516){_0x4f6516['total']=0x0;_0x4f6516['answered']=0x0;_0x4f6516['sumHoldTime']=0x0;_0x4f6516[_0x8db2('0x2d')]=0x0;_0x4f6516[_0x8db2('0x2e')]=0x0;}function clearCampaigns(_0x3be281){if(!_[_0x8db2('0x2f')](_0x3be281)){for(var _0x145328 in _0x3be281){if(_0x3be281[_0x8db2('0x27')](_0x145328)){_0x3be281[_0x145328]['ivrTotalCallsDays']=0x0;_0x3be281[_0x145328][_0x8db2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x372311){if(!_[_0x8db2('0x2f')](_0x372311)){for(var _0x8b7cec in _0x372311){if(_0x372311['hasOwnProperty'](_0x8b7cec)){_0x372311[_0x8b7cec][_0x8db2('0x31')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x32')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x33')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x34')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x35')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2e')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x37')]=0x0;_0x372311[_0x8b7cec]['outboundBusyCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x38')]=0x0;_0x372311[_0x8b7cec]['outboundNoSuchCallsDay']=0x0;_0x372311[_0x8b7cec]['outboundUnknownCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x39')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3a')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3b')]=0x0;_0x372311[_0x8b7cec]['outboundOriginateFailureCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3c')]=0x0;_0x372311[_0x8b7cec]['outboundReCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3e')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x35d337,_0x1a460b){for(var _0x4df530 in _0x1a460b){if(_0x35d337['hasOwnProperty'](_0x4df530)){_0x35d337[_0x4df530]=_0x1a460b[_0x4df530];}}};Realtime[_0x8db2('0x3f')][_0x8db2('0x40')]=function(){var _0xc884a=this;return function(_0x2a2d65){if(_0x2a2d65){freeIsNotKeyAgent(_0x2a2d65,_0xc884a[_0x8db2('0x41')]);for(var _0xd39848=0x0,_0x101711={};_0xd39848<_0x2a2d65[_0x8db2('0x42')];_0xd39848+=0x1){_0x101711=_0x2a2d65[_0xd39848];var _0x46e0c8=_[_0x8db2('0x2b')](_0x101711['interface'])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x101711['name']):_0x101711[_0x8db2('0x2c')];if(_[_0x8db2('0x43')](_0xc884a['agents'][_0x46e0c8])){_0xc884a['agents'][_0x46e0c8]=new Agent(_0x101711);}else{_0xc884a[_0x8db2('0x44')](_0xc884a['agents'][_0x46e0c8],_0x101711);}}}return _0xc884a[_0x8db2('0x41')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x45')]=function(){var _0x22c896=this;return function(_0x5cc419){if(_0x5cc419){freeIsNotKeySip(_0x5cc419,_0x22c896[_0x8db2('0x12')]);for(var _0x5e34e0=0x0,_0x227a08={};_0x5e34e0<_0x5cc419[_0x8db2('0x42')];_0x5e34e0+=0x1){_0x227a08=_0x5cc419[_0x5e34e0];if(_[_0x8db2('0x43')](_0x22c896[_0x8db2('0x12')][util['format']('SIP/%s',_0x227a08[_0x8db2('0x2a')])])){_0x22c896[_0x8db2('0x12')][util['format'](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])]=new Telephone(_0x227a08);}else{_0x22c896[_0x8db2('0x44')](_0x22c896['telephones'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])],_0x227a08);}}}return _0x22c896[_0x8db2('0x12')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x46')]=function(){var _0x380046=this;return function(_0x1575ea){if(_0x1575ea){freeIsNotKeySip(_0x1575ea,_0x380046[_0x8db2('0x13')]);for(var _0x63c561=0x0,_0x21cf7c={};_0x63c561<_0x1575ea[_0x8db2('0x42')];_0x63c561+=0x1){_0x21cf7c=_0x1575ea[_0x63c561];if(_[_0x8db2('0x43')](_0x380046['trunks'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c['name'])])){_0x380046['trunks'][util[_0x8db2('0x28')]('SIP/%s',_0x21cf7c[_0x8db2('0x2a')])]=new Trunk(_0x21cf7c);}else{_0x380046[_0x8db2('0x44')](_0x380046[_0x8db2('0x13')][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c[_0x8db2('0x2a')])],_0x21cf7c);}}}return _0x380046[_0x8db2('0x13')];};};Realtime['prototype'][_0x8db2('0x47')]=function(){var _0x3d44de=this;return function(_0x40c69e){if(_0x40c69e){freeIsNotKey(_0x40c69e,_0x3d44de[_0x8db2('0x48')],'id');for(var _0x482b26=0x0,_0x424c27={};_0x482b26<_0x40c69e[_0x8db2('0x42')];_0x482b26+=0x1){_0x424c27=_0x40c69e[_0x482b26];if(_[_0x8db2('0x43')](_0x3d44de[_0x8db2('0x48')][_0x424c27['id']])){_0x3d44de['triggers'][_0x424c27['id']]=new Trigger(_0x424c27);}else{_0x3d44de[_0x8db2('0x44')](_0x3d44de['triggers'][_0x424c27['id']],_0x424c27);}}}return _0x3d44de[_0x8db2('0x48')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x49')]=function(){var _0x4d2164=this;return function(_0x4b0e72){if(_0x4b0e72){freeIsNotKey(_0x4b0e72,_0x4d2164[_0x8db2('0x16')],'id');for(var _0x47c556=0x0,_0x173cc7={};_0x47c556<_0x4b0e72[_0x8db2('0x42')];_0x47c556+=0x1){_0x173cc7=_0x4b0e72[_0x47c556];if(_[_0x8db2('0x43')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']])){_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']]=new Template(_0x173cc7);}else{_0x4d2164[_0x8db2('0x44')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']],_0x173cc7);}}}return _0x4d2164[_0x8db2('0x16')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4a')]=function(){var _0x1362ed=this;return function(_0x36f9d6){if(_0x36f9d6){freeIsNotKey(_0x36f9d6,_0x1362ed['zendeskAccounts'],'id');for(var _0x449109=0x0,_0x2ada52={};_0x449109<_0x36f9d6[_0x8db2('0x42')];_0x449109+=0x1){_0x2ada52=_0x36f9d6[_0x449109];if(_[_0x8db2('0x43')](_0x1362ed['zendeskAccounts'][_0x2ada52['id']])){_0x1362ed['zendeskAccounts'][_0x2ada52['id']]=new ZendeskAccount(_0x2ada52);}else{_0x1362ed[_0x8db2('0x44')](_0x1362ed[_0x8db2('0x4b')][_0x2ada52['id']],_0x2ada52);}}}return _0x1362ed[_0x8db2('0x4b')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x494d6e=this;return function(_0x44ac56){if(_0x44ac56){freeIsNotKey(_0x44ac56,_0x494d6e[_0x8db2('0x1c')],'id');for(var _0x55c7dd=0x0,_0x383fa1={};_0x55c7dd<_0x44ac56[_0x8db2('0x42')];_0x55c7dd+=0x1){_0x383fa1=_0x44ac56[_0x55c7dd];if(_[_0x8db2('0x43')](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']])){_0x494d6e['salesforceAccounts'][_0x383fa1['id']]=new SalesforceAccount(_0x383fa1);}else{_0x494d6e['mergeFromDatabase'](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']],_0x383fa1);}}}return _0x494d6e[_0x8db2('0x1c')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4c')]=function(){var _0x3daed6=this;return function(_0x2bf408){if(_0x2bf408){freeIsNotKey(_0x2bf408,_0x3daed6[_0x8db2('0x1e')],'id');for(var _0x3ca2a7=0x0,_0x4187d6={};_0x3ca2a7<_0x2bf408[_0x8db2('0x42')];_0x3ca2a7+=0x1){_0x4187d6=_0x2bf408[_0x3ca2a7];if(_[_0x8db2('0x43')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']])){_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']]=new FreshdeskAccount(_0x4187d6);}else{_0x3daed6[_0x8db2('0x44')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']],_0x4187d6);}}}return _0x3daed6['freshdeskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4d')]=function(){var _0x579317=this;return function(_0x27b644){if(_0x27b644){freeIsNotKey(_0x27b644,_0x579317[_0x8db2('0x1f')],'id');for(var _0x3af298=0x0,_0x547215={};_0x3af298<_0x27b644[_0x8db2('0x42')];_0x3af298+=0x1){_0x547215=_0x27b644[_0x3af298];if(_[_0x8db2('0x43')](_0x579317[_0x8db2('0x1f')][_0x547215['id']])){_0x579317[_0x8db2('0x1f')][_0x547215['id']]=new ZohoAccount(_0x547215);}else{_0x579317[_0x8db2('0x44')](_0x579317['zohoAccounts'][_0x547215['id']],_0x547215);}}}return _0x579317[_0x8db2('0x1f')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4e')]=function(){var _0x58bb60=this;return function(_0x1e7d1a){if(_0x1e7d1a){freeIsNotKey(_0x1e7d1a,_0x58bb60[_0x8db2('0x20')],'id');for(var _0x33dddd=0x0,_0x7b0de8={};_0x33dddd<_0x1e7d1a[_0x8db2('0x42')];_0x33dddd+=0x1){_0x7b0de8=_0x1e7d1a[_0x33dddd];if(_[_0x8db2('0x43')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']])){_0x58bb60['deskAccounts'][_0x7b0de8['id']]=new DeskAccount(_0x7b0de8);}else{_0x58bb60[_0x8db2('0x44')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']],_0x7b0de8);}}}return _0x58bb60['deskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4f')]=function(){var _0x533e41=this;return function(_0x107bbe){if(_0x107bbe){freeIsNotKey(_0x107bbe,_0x533e41[_0x8db2('0x1d')],'id');for(var _0x63e8f7=0x0,_0x30f4f3={};_0x63e8f7<_0x107bbe[_0x8db2('0x42')];_0x63e8f7+=0x1){_0x30f4f3=_0x107bbe[_0x63e8f7];if(_[_0x8db2('0x43')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']])){_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']]=new SugarcrmAccount(_0x30f4f3);}else{_0x533e41[_0x8db2('0x44')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']],_0x30f4f3);}}}return _0x533e41[_0x8db2('0x1d')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x50')]=function(){var _0x1ce89f=this;return function(_0x64ec90){if(_0x64ec90){freeIsNotKey(_0x64ec90,_0x1ce89f[_0x8db2('0x21')],'id');for(var _0x4a20a7=0x0,_0xe0c3e={};_0x4a20a7<_0x64ec90[_0x8db2('0x42')];_0x4a20a7+=0x1){_0xe0c3e=_0x64ec90[_0x4a20a7];if(_[_0x8db2('0x43')](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']])){_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']]=new VtigerAccount(_0xe0c3e);}else{_0x1ce89f['mergeFromDatabase'](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']],_0xe0c3e);}}}return _0x1ce89f[_0x8db2('0x21')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x51')]=function(){var _0x2ad70f=this;return function(_0x348da8){if(_0x348da8){freeIsNotKey(_0x348da8,_0x2ad70f[_0x8db2('0x22')],'id');for(var _0x2c7b04=0x0,_0x24cfe9={};_0x2c7b04<_0x348da8[_0x8db2('0x42')];_0x2c7b04+=0x1){_0x24cfe9=_0x348da8[_0x2c7b04];if(_[_0x8db2('0x43')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']])){_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']]=new ServicenowAccount(_0x24cfe9);}else{_0x2ad70f[_0x8db2('0x44')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']],_0x24cfe9);}}}return _0x2ad70f[_0x8db2('0x22')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x52')]=function(){var _0x5a719f=this;return function(_0x3273dd){if(_0x3273dd){freeIsNotKey(_0x3273dd,_0x5a719f['dynamics365Accounts'],'id');for(var _0x364176=0x0,_0x570c53={};_0x364176<_0x3273dd[_0x8db2('0x42')];_0x364176+=0x1){_0x570c53=_0x3273dd[_0x364176];if(_[_0x8db2('0x43')](_0x5a719f[_0x8db2('0x23')][_0x570c53['id']])){_0x5a719f[_0x8db2('0x23')][_0x570c53['id']]=new Dynamics365Account(_0x570c53);}else{_0x5a719f[_0x8db2('0x44')](_0x5a719f['dynamics365Accounts'][_0x570c53['id']],_0x570c53);}}}return _0x5a719f['dynamics365Accounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x53')]=function(){var _0x21ec87=this;return function(_0x3ba1d2){if(_0x3ba1d2){freeIsNotKey(_0x3ba1d2,_0x21ec87[_0x8db2('0x24')],'id');for(var _0x1f28d2=0x0,_0x3e3de3={};_0x1f28d2<_0x3ba1d2[_0x8db2('0x42')];_0x1f28d2+=0x1){_0x3e3de3=_0x3ba1d2[_0x1f28d2];if(_['isUndefined'](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']])){_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']]=new FreshsalesAccount(_0x3e3de3);}else{_0x21ec87[_0x8db2('0x44')](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']],_0x3e3de3);}}}return _0x21ec87[_0x8db2('0x24')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x54')]=function(){var _0x20caf0=this;return function(_0x4938bb){for(var _0x54318c=0x0;_0x54318c<_0x4938bb[_0x8db2('0x42')];_0x54318c+=0x1){_[_0x8db2('0x55')](_0x20caf0[_0x8db2('0x14')][_0x4938bb[_0x54318c][_0x8db2('0x2a')]],_0x4938bb[_0x54318c]);}return _0x20caf0[_0x8db2('0x14')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x3611da=this;return function(_0x364807){clearVoiceQueues(_0x3611da['voiceQueues']);if(_0x364807){_0x364807=_[_0x8db2('0x56')](_0x364807,_0x8db2('0x57'));for(var _0x1ab84c in _0x364807){if(_0x364807['hasOwnProperty'](_0x1ab84c)){for(var _0x26523b=0x0;_0x26523b<_0x364807[_0x1ab84c][_0x8db2('0x42')];_0x26523b+=0x1){var _0x2cf731=_0x364807[_0x1ab84c][_0x26523b]['queue'];if(_0x3611da[_0x8db2('0x14')][_0x2cf731]){if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x58')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x33')]+=0x1;}if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x59')]){_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x34')]+=0x1;}_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x35')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallerleaveAt'])['diff'](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;if(_0x26523b===_0x364807[_0x1ab84c]['length']-0x1){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5c')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5d')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5e')])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x31')]+=0x1;if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x60')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x32')]+=0x1;_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x2e')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallercompleteAt'])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x61')]),'seconds')||0x0;}}else{_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x35')]||0x0;}}}}}}return _0x3611da[_0x8db2('0x14')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x62')]=function(){var _0x242379=this;return function(_0x31a095){clearVoiceCallReports(_0x242379[_0x8db2('0x63')]);if(_0x31a095){for(var _0x3ac0fa=0x0;_0x3ac0fa<_0x31a095[_0x8db2('0x42')];_0x3ac0fa+=0x1){_0x242379['outbound']['total']+=0x1;_0x242379[_0x8db2('0x63')]['sumDuration']+=_0x31a095[_0x3ac0fa][_0x8db2('0x64')];if(_0x31a095[_0x3ac0fa][_0x8db2('0x65')]===_0x8db2('0x66')){_0x242379['outbound'][_0x8db2('0x32')]+=0x1;_0x242379[_0x8db2('0x63')][_0x8db2('0x35')]+=_0x31a095[_0x3ac0fa]['duration']-_0x31a095[_0x3ac0fa][_0x8db2('0x67')]||0x0;_0x242379[_0x8db2('0x63')][_0x8db2('0x2e')]+=_0x31a095[_0x3ac0fa][_0x8db2('0x67')];}}}return _0x242379['outbound'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x68')]=function(){var _0x299640=this;return function(_0x1edb1a){if(_0x1edb1a){freeIsNotKey(_0x1edb1a,_0x299640[_0x8db2('0x15')],_0x8db2('0x2a'));for(var _0x1aadfb=0x0,_0x3682bf={};_0x1aadfb<_0x1edb1a[_0x8db2('0x42')];_0x1aadfb+=0x1){_0x3682bf=_0x1edb1a[_0x1aadfb];if(_[_0x8db2('0x43')](_0x299640[_0x8db2('0x15')][_0x3682bf['name']])){_0x299640[_0x8db2('0x15')][_0x3682bf[_0x8db2('0x2a')]]=new Campaign(_0x3682bf);}else{_0x299640[_0x8db2('0x44')](_0x299640['campaigns'][_0x3682bf['name']],_0x3682bf);_0x299640['campaigns'][_0x3682bf[_0x8db2('0x2a')]][_0x8db2('0x69')]=_0x3682bf[_0x8db2('0x6a')]?_0x3682bf[_0x8db2('0x6a')][_0x8db2('0x2a')]:undefined;}}}return _0x299640[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6b')]=function(){var _0x3b1929=this;return function(_0x37cf6d){if(_0x37cf6d){freeIsNotKey(_0x37cf6d,_0x3b1929[_0x8db2('0x17')],'id');for(var _0x4d0ff6=0x0,_0x360a06={};_0x4d0ff6<_0x37cf6d[_0x8db2('0x42')];_0x4d0ff6+=0x1){_0x360a06=_0x37cf6d[_0x4d0ff6];if(_[_0x8db2('0x43')](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']])){_0x3b1929['voiceExtensions'][_0x360a06['id']]=new VoiceExtension(_0x360a06);}else{_0x3b1929['mergeFromDatabase'](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']],_0x360a06);}}}return _0x3b1929[_0x8db2('0x17')];};};Realtime['prototype'][_0x8db2('0x6c')]=function(){var _0x121f31=this;return function(_0x9132b4){clearCampaigns(_0x121f31['campaigns']);for(var _0x5dc46c=0x0;_0x5dc46c<_0x9132b4['length'];_0x5dc46c+=0x1){_[_0x8db2('0x55')](_0x121f31[_0x8db2('0x15')][_0x9132b4[_0x5dc46c][_0x8db2('0x2a')]],_0x9132b4[_0x5dc46c]);}return _0x121f31[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')]['initFaxAccounts']=function(){var _0x30930a=this;return function(_0x5e349c){if(_0x5e349c){freeIsNotKey(_0x5e349c,_0x30930a[_0x8db2('0x25')],'id');for(var _0x353101=0x0,_0xa083b1={};_0x353101<_0x5e349c[_0x8db2('0x42')];_0x353101+=0x1){_0xa083b1=_0x5e349c[_0x353101];if(_[_0x8db2('0x43')](_0x30930a['faxAccounts'][_0xa083b1['id']])){_0x30930a['faxAccounts'][_0xa083b1['id']]=new FaxAccount(_0xa083b1);}else{_0x30930a[_0x8db2('0x44')](_0x30930a['faxAccounts'][_0xa083b1['id']],_0xa083b1);}}}return _0x30930a[_0x8db2('0x25')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6d')]=function(){var _0x1e7bc2=this;return function(_0x2b7224){if(_0x2b7224){freeIsNotKey(_0x2b7224,_0x1e7bc2[_0x8db2('0x14')],'name');for(var _0x19f9a0=0x0,_0x222ea2={};_0x19f9a0<_0x2b7224[_0x8db2('0x42')];_0x19f9a0+=0x1){_0x222ea2=_0x2b7224[_0x19f9a0];if(_['isUndefined'](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]])){_0x1e7bc2['voiceQueues'][_0x222ea2[_0x8db2('0x2a')]]=new VoiceQueue(_0x222ea2);}else{_0x1e7bc2[_0x8db2('0x44')](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]],_0x222ea2);}}}return _0x1e7bc2[_0x8db2('0x14')];};};module[_0x8db2('0x6e')]=Realtime; \ No newline at end of file +var _0x2032=['voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','outbound','channels','queueChannels','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','agents','initTelephones','initTrunks','mergeFromDatabase','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2032,0xd9));var _0x2203=function(_0x5f330e,_0x5aeb90){_0x5f330e=_0x5f330e-0x0;var _0x4fe2b6=_0x2032[_0x5f330e];return _0x4fe2b6;};'use strict';var _=require('lodash');var moment=require(_0x2203('0x0'));var util=require(_0x2203('0x1'));var Agent=require(_0x2203('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x2203('0x3'));var VoiceQueue=require(_0x2203('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x2203('0x5'));var Campaign=require(_0x2203('0x6'));var VoiceExtension=require(_0x2203('0x7'));var ZendeskAccount=require(_0x2203('0x8'));var SalesforceAccount=require(_0x2203('0x9'));var FreshdeskAccount=require(_0x2203('0xa'));var SugarcrmAccount=require(_0x2203('0xb'));var ZohoAccount=require(_0x2203('0xc'));var DeskAccount=require(_0x2203('0xd'));var VtigerAccount=require(_0x2203('0xe'));var ServicenowAccount=require(_0x2203('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x2203('0x10'));function Realtime(){this['agents']={};this[_0x2203('0x11')]={};this[_0x2203('0x12')]={};this[_0x2203('0x13')]={};this['triggers']={};this[_0x2203('0x14')]={};this['templates']={};this[_0x2203('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x2203('0x16')]={};this[_0x2203('0x17')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x2203('0x18')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x2203('0x19')]={};this[_0x2203('0x1a')]={};this[_0x2203('0x1b')]={};this[_0x2203('0x1c')]={};this[_0x2203('0x1d')]={};this[_0x2203('0x1e')]={};}function freeIsNotKey(_0x2c36e6,_0x2c085c,_0xdf9d0b){var _0x3053f3=_['mapKeys'](_0x2c36e6,function(_0x280eda){return _0x280eda[_0xdf9d0b];});for(var _0x2ee127 in _0x2c085c){if(_0x2c085c['hasOwnProperty'](_0x2ee127)){if(!_0x3053f3[_0x2ee127]){delete _0x2c085c[_0x2ee127];}}}}function freeIsNotKeySip(_0x3f9ef6,_0x8906e1){var _0x4aeb9f=_[_0x2203('0x1f')](_0x3f9ef6,function(_0x5ee83c){return util[_0x2203('0x20')](_0x2203('0x21'),_0x5ee83c[_0x2203('0x22')]);});for(var _0x3b4034 in _0x8906e1){if(_0x8906e1[_0x2203('0x23')](_0x3b4034)){if(!_0x4aeb9f[_0x3b4034]){delete _0x8906e1[_0x3b4034];}}}}function freeIsNotKeyAgent(_0x449039,_0x538c23){var _0x13d3f7=_['mapKeys'](_0x449039,function(_0x5ac866){var _0x15f543=_['isNil'](_0x5ac866[_0x2203('0x24')])?util[_0x2203('0x20')]('SIP/%s',_0x5ac866[_0x2203('0x22')]):_0x5ac866['interface'];return _0x15f543;});for(var _0x5c8da9 in _0x538c23){if(_0x538c23[_0x2203('0x23')](_0x5c8da9)){if(!_0x13d3f7[_0x5c8da9]){delete _0x538c23[_0x5c8da9];}}}}function clearVoiceCallReports(_0x2718f5){_0x2718f5[_0x2203('0x25')]=0x0;_0x2718f5[_0x2203('0x26')]=0x0;_0x2718f5[_0x2203('0x27')]=0x0;_0x2718f5[_0x2203('0x28')]=0x0;_0x2718f5[_0x2203('0x29')]=0x0;}function clearCampaigns(_0x250349){if(!_['isEmpty'](_0x250349)){for(var _0x143f41 in _0x250349){if(_0x250349[_0x2203('0x23')](_0x143f41)){_0x250349[_0x143f41][_0x2203('0x2a')]=0x0;_0x250349[_0x143f41]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xb2071b){if(!_[_0x2203('0x2b')](_0xb2071b)){for(var _0x5c5fd3 in _0xb2071b){if(_0xb2071b[_0x2203('0x23')](_0x5c5fd3)){_0xb2071b[_0x5c5fd3][_0x2203('0x25')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x26')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2c')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2d')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x27')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x28')]=0x0;_0xb2071b[_0x5c5fd3]['sumBillable']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2e')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2f')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x30')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x31')]=0x0;_0xb2071b[_0x5c5fd3]['outboundNoSuchCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x32')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x33')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x34')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x35')]=0x0;_0xb2071b[_0x5c5fd3]['outboundOriginateFailureCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x36')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x37')]=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerAgiCallsDay']=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x38')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x125dfc,_0x464c88){for(var _0x191894 in _0x464c88){if(_0x125dfc[_0x2203('0x23')](_0x191894)){_0x125dfc[_0x191894]=_0x464c88[_0x191894];}}};Realtime[_0x2203('0x39')]['initAgents']=function(){var _0xb22e28=this;return function(_0x2324c0){if(_0x2324c0){freeIsNotKeyAgent(_0x2324c0,_0xb22e28['agents']);for(var _0x2a2ee7=0x0,_0x20fbe1={};_0x2a2ee7<_0x2324c0[_0x2203('0x3a')];_0x2a2ee7+=0x1){_0x20fbe1=_0x2324c0[_0x2a2ee7];var _0x4187b4=_[_0x2203('0x3b')](_0x20fbe1[_0x2203('0x24')])?util[_0x2203('0x20')](_0x2203('0x21'),_0x20fbe1[_0x2203('0x22')]):_0x20fbe1['interface'];if(_[_0x2203('0x3c')](_0xb22e28[_0x2203('0x3d')][_0x4187b4])){_0xb22e28['agents'][_0x4187b4]=new Agent(_0x20fbe1);}else{_0xb22e28['mergeFromDatabase'](_0xb22e28[_0x2203('0x3d')][_0x4187b4],_0x20fbe1);}}}return _0xb22e28['agents'];};};Realtime[_0x2203('0x39')][_0x2203('0x3e')]=function(){var _0x127ee3=this;return function(_0x5221f0){if(_0x5221f0){freeIsNotKeySip(_0x5221f0,_0x127ee3['telephones']);for(var _0x34cdeb=0x0,_0x47c93a={};_0x34cdeb<_0x5221f0[_0x2203('0x3a')];_0x34cdeb+=0x1){_0x47c93a=_0x5221f0[_0x34cdeb];if(_['isUndefined'](_0x127ee3[_0x2203('0x11')][util['format'](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])])){_0x127ee3[_0x2203('0x11')][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a['name'])]=new Telephone(_0x47c93a);}else{_0x127ee3['mergeFromDatabase'](_0x127ee3['telephones'][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])],_0x47c93a);}}}return _0x127ee3[_0x2203('0x11')];};};Realtime[_0x2203('0x39')][_0x2203('0x3f')]=function(){var _0x1c7e3d=this;return function(_0x590b4e){if(_0x590b4e){freeIsNotKeySip(_0x590b4e,_0x1c7e3d[_0x2203('0x12')]);for(var _0x1b12c3=0x0,_0x108fde={};_0x1b12c3<_0x590b4e[_0x2203('0x3a')];_0x1b12c3+=0x1){_0x108fde=_0x590b4e[_0x1b12c3];if(_['isUndefined'](_0x1c7e3d['trunks'][util[_0x2203('0x20')]('SIP/%s',_0x108fde[_0x2203('0x22')])])){_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')]('SIP/%s',_0x108fde['name'])]=new Trunk(_0x108fde);}else{_0x1c7e3d[_0x2203('0x40')](_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')](_0x2203('0x21'),_0x108fde[_0x2203('0x22')])],_0x108fde);}}}return _0x1c7e3d[_0x2203('0x12')];};};Realtime['prototype'][_0x2203('0x41')]=function(){var _0x165a3f=this;return function(_0x3a866c){if(_0x3a866c){freeIsNotKey(_0x3a866c,_0x165a3f[_0x2203('0x42')],'id');for(var _0x16b452=0x0,_0x36b99f={};_0x16b452<_0x3a866c[_0x2203('0x3a')];_0x16b452+=0x1){_0x36b99f=_0x3a866c[_0x16b452];if(_[_0x2203('0x3c')](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']])){_0x165a3f[_0x2203('0x42')][_0x36b99f['id']]=new Trigger(_0x36b99f);}else{_0x165a3f['mergeFromDatabase'](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']],_0x36b99f);}}}return _0x165a3f[_0x2203('0x42')];};};Realtime[_0x2203('0x39')][_0x2203('0x43')]=function(){var _0x4c3259=this;return function(_0x58bd5c){if(_0x58bd5c){freeIsNotKey(_0x58bd5c,_0x4c3259[_0x2203('0x44')],'id');for(var _0x48129c=0x0,_0x273e5f={};_0x48129c<_0x58bd5c[_0x2203('0x3a')];_0x48129c+=0x1){_0x273e5f=_0x58bd5c[_0x48129c];if(_[_0x2203('0x3c')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']])){_0x4c3259['templates'][_0x273e5f['id']]=new Template(_0x273e5f);}else{_0x4c3259[_0x2203('0x40')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']],_0x273e5f);}}}return _0x4c3259['templates'];};};Realtime[_0x2203('0x39')][_0x2203('0x45')]=function(){var _0x35b2e9=this;return function(_0x2600a9){if(_0x2600a9){freeIsNotKey(_0x2600a9,_0x35b2e9['zendeskAccounts'],'id');for(var _0x4c1a29=0x0,_0x21b8ab={};_0x4c1a29<_0x2600a9['length'];_0x4c1a29+=0x1){_0x21b8ab=_0x2600a9[_0x4c1a29];if(_['isUndefined'](_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']])){_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']]=new ZendeskAccount(_0x21b8ab);}else{_0x35b2e9[_0x2203('0x40')](_0x35b2e9['zendeskAccounts'][_0x21b8ab['id']],_0x21b8ab);}}}return _0x35b2e9['zendeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x47')]=function(){var _0x12d7fa=this;return function(_0x21d2d7){if(_0x21d2d7){freeIsNotKey(_0x21d2d7,_0x12d7fa[_0x2203('0x48')],'id');for(var _0x21fd78=0x0,_0x4a7f4e={};_0x21fd78<_0x21d2d7[_0x2203('0x3a')];_0x21fd78+=0x1){_0x4a7f4e=_0x21d2d7[_0x21fd78];if(_['isUndefined'](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']])){_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']]=new SalesforceAccount(_0x4a7f4e);}else{_0x12d7fa[_0x2203('0x40')](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']],_0x4a7f4e);}}}return _0x12d7fa['salesforceAccounts'];};};Realtime['prototype'][_0x2203('0x49')]=function(){var _0x1f772d=this;return function(_0x126aad){if(_0x126aad){freeIsNotKey(_0x126aad,_0x1f772d[_0x2203('0x4a')],'id');for(var _0x559370=0x0,_0x4de47a={};_0x559370<_0x126aad['length'];_0x559370+=0x1){_0x4de47a=_0x126aad[_0x559370];if(_[_0x2203('0x3c')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']])){_0x1f772d['freshdeskAccounts'][_0x4de47a['id']]=new FreshdeskAccount(_0x4de47a);}else{_0x1f772d[_0x2203('0x40')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']],_0x4de47a);}}}return _0x1f772d['freshdeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x4b')]=function(){var _0x172c6a=this;return function(_0x6a1877){if(_0x6a1877){freeIsNotKey(_0x6a1877,_0x172c6a['zohoAccounts'],'id');for(var _0x120db1=0x0,_0x5268d6={};_0x120db1<_0x6a1877[_0x2203('0x3a')];_0x120db1+=0x1){_0x5268d6=_0x6a1877[_0x120db1];if(_[_0x2203('0x3c')](_0x172c6a['zohoAccounts'][_0x5268d6['id']])){_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']]=new ZohoAccount(_0x5268d6);}else{_0x172c6a[_0x2203('0x40')](_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']],_0x5268d6);}}}return _0x172c6a[_0x2203('0x4c')];};};Realtime[_0x2203('0x39')][_0x2203('0x4d')]=function(){var _0x569d4a=this;return function(_0x562a3d){if(_0x562a3d){freeIsNotKey(_0x562a3d,_0x569d4a[_0x2203('0x19')],'id');for(var _0x524356=0x0,_0x56e881={};_0x524356<_0x562a3d[_0x2203('0x3a')];_0x524356+=0x1){_0x56e881=_0x562a3d[_0x524356];if(_[_0x2203('0x3c')](_0x569d4a[_0x2203('0x19')][_0x56e881['id']])){_0x569d4a['deskAccounts'][_0x56e881['id']]=new DeskAccount(_0x56e881);}else{_0x569d4a[_0x2203('0x40')](_0x569d4a['deskAccounts'][_0x56e881['id']],_0x56e881);}}}return _0x569d4a['deskAccounts'];};};Realtime[_0x2203('0x39')]['initSugarcrmAccounts']=function(){var _0x54ec71=this;return function(_0x5efc59){if(_0x5efc59){freeIsNotKey(_0x5efc59,_0x54ec71[_0x2203('0x18')],'id');for(var _0x31256b=0x0,_0x367122={};_0x31256b<_0x5efc59[_0x2203('0x3a')];_0x31256b+=0x1){_0x367122=_0x5efc59[_0x31256b];if(_[_0x2203('0x3c')](_0x54ec71[_0x2203('0x18')][_0x367122['id']])){_0x54ec71[_0x2203('0x18')][_0x367122['id']]=new SugarcrmAccount(_0x367122);}else{_0x54ec71[_0x2203('0x40')](_0x54ec71[_0x2203('0x18')][_0x367122['id']],_0x367122);}}}return _0x54ec71[_0x2203('0x18')];};};Realtime[_0x2203('0x39')][_0x2203('0x4e')]=function(){var _0x58ff57=this;return function(_0x585bde){if(_0x585bde){freeIsNotKey(_0x585bde,_0x58ff57[_0x2203('0x1a')],'id');for(var _0x43d8c0=0x0,_0x2511bd={};_0x43d8c0<_0x585bde[_0x2203('0x3a')];_0x43d8c0+=0x1){_0x2511bd=_0x585bde[_0x43d8c0];if(_[_0x2203('0x3c')](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']])){_0x58ff57['vtigerAccounts'][_0x2511bd['id']]=new VtigerAccount(_0x2511bd);}else{_0x58ff57['mergeFromDatabase'](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']],_0x2511bd);}}}return _0x58ff57[_0x2203('0x1a')];};};Realtime[_0x2203('0x39')][_0x2203('0x4f')]=function(){var _0xcab922=this;return function(_0x7b0b9c){if(_0x7b0b9c){freeIsNotKey(_0x7b0b9c,_0xcab922[_0x2203('0x1b')],'id');for(var _0x191b67=0x0,_0x2c6bcc={};_0x191b67<_0x7b0b9c[_0x2203('0x3a')];_0x191b67+=0x1){_0x2c6bcc=_0x7b0b9c[_0x191b67];if(_[_0x2203('0x3c')](_0xcab922['servicenowAccounts'][_0x2c6bcc['id']])){_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']]=new ServicenowAccount(_0x2c6bcc);}else{_0xcab922[_0x2203('0x40')](_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']],_0x2c6bcc);}}}return _0xcab922[_0x2203('0x1b')];};};Realtime[_0x2203('0x39')][_0x2203('0x50')]=function(){var _0x52c159=this;return function(_0x544756){if(_0x544756){freeIsNotKey(_0x544756,_0x52c159[_0x2203('0x1c')],'id');for(var _0x35b7b9=0x0,_0x49e795={};_0x35b7b9<_0x544756[_0x2203('0x3a')];_0x35b7b9+=0x1){_0x49e795=_0x544756[_0x35b7b9];if(_[_0x2203('0x3c')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']])){_0x52c159[_0x2203('0x1c')][_0x49e795['id']]=new Dynamics365Account(_0x49e795);}else{_0x52c159[_0x2203('0x40')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']],_0x49e795);}}}return _0x52c159[_0x2203('0x1c')];};};Realtime[_0x2203('0x39')][_0x2203('0x51')]=function(){var _0x519120=this;return function(_0x468619){if(_0x468619){freeIsNotKey(_0x468619,_0x519120[_0x2203('0x1d')],'id');for(var _0x465898=0x0,_0x4e461e={};_0x465898<_0x468619[_0x2203('0x3a')];_0x465898+=0x1){_0x4e461e=_0x468619[_0x465898];if(_[_0x2203('0x3c')](_0x519120[_0x2203('0x1d')][_0x4e461e['id']])){_0x519120[_0x2203('0x1d')][_0x4e461e['id']]=new FreshsalesAccount(_0x4e461e);}else{_0x519120[_0x2203('0x40')](_0x519120['freshsalesAccounts'][_0x4e461e['id']],_0x4e461e);}}}return _0x519120[_0x2203('0x1d')];};};Realtime[_0x2203('0x39')][_0x2203('0x52')]=function(){var _0x4dde80=this;return function(_0x5507b6){for(var _0x5d9ae2=0x0;_0x5d9ae2<_0x5507b6['length'];_0x5d9ae2+=0x1){_['merge'](_0x4dde80[_0x2203('0x13')][_0x5507b6[_0x5d9ae2][_0x2203('0x22')]],_0x5507b6[_0x5d9ae2]);}return _0x4dde80[_0x2203('0x13')];};};Realtime[_0x2203('0x39')][_0x2203('0x53')]=function(){var _0x169845=this;return function(_0x3f7926){clearVoiceQueues(_0x169845[_0x2203('0x13')]);if(_0x3f7926){_0x3f7926=_['groupBy'](_0x3f7926,'uniqueid');for(var _0xb54e51 in _0x3f7926){if(_0x3f7926[_0x2203('0x23')](_0xb54e51)){for(var _0xafcc82=0x0;_0xafcc82<_0x3f7926[_0xb54e51][_0x2203('0x3a')];_0xafcc82+=0x1){var _0x1bbd2d=_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x54')];if(_0x169845[_0x2203('0x13')][_0x1bbd2d]){if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x55')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2c')]+=0x1;}if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x56')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2d')]+=0x1;}_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x57')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;if(_0xafcc82===_0x3f7926[_0xb54e51]['length']-0x1){_0x169845[_0x2203('0x13')][_0x1bbd2d]['sumDuration']+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')]||_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerabandonAt']||_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5c')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x25')]+=0x1;if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5d')]){_0x169845[_0x2203('0x13')][_0x1bbd2d]['answered']+=0x1;_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x29')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x28')]+=_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]||0x0;}}}}}}return _0x169845[_0x2203('0x13')];};};Realtime['prototype'][_0x2203('0x5e')]=function(){var _0x47a2c7=this;return function(_0x48bd5){clearVoiceCallReports(_0x47a2c7[_0x2203('0x15')]);if(_0x48bd5){for(var _0xe3bee5=0x0;_0xe3bee5<_0x48bd5[_0x2203('0x3a')];_0xe3bee5+=0x1){_0x47a2c7[_0x2203('0x15')]['total']+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x28')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')];if(_0x48bd5[_0xe3bee5]['disposition']===_0x2203('0x60')){_0x47a2c7[_0x2203('0x15')][_0x2203('0x26')]+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x27')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')]-_0x48bd5[_0xe3bee5][_0x2203('0x61')]||0x0;_0x47a2c7[_0x2203('0x15')][_0x2203('0x29')]+=_0x48bd5[_0xe3bee5][_0x2203('0x61')];}}}return _0x47a2c7[_0x2203('0x15')];};};Realtime['prototype'][_0x2203('0x62')]=function(){var _0x7f71b8=this;return function(_0x21b755){if(_0x21b755){freeIsNotKey(_0x21b755,_0x7f71b8[_0x2203('0x14')],_0x2203('0x22'));for(var _0x52c35e=0x0,_0x23f7b1={};_0x52c35e<_0x21b755[_0x2203('0x3a')];_0x52c35e+=0x1){_0x23f7b1=_0x21b755[_0x52c35e];if(_[_0x2203('0x3c')](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]])){_0x7f71b8[_0x2203('0x14')][_0x23f7b1['name']]=new Campaign(_0x23f7b1);}else{_0x7f71b8['mergeFromDatabase'](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]],_0x23f7b1);_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]][_0x2203('0x63')]=_0x23f7b1['SquareProject']?_0x23f7b1[_0x2203('0x64')][_0x2203('0x22')]:undefined;}}}return _0x7f71b8['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x4fc51a=this;return function(_0x5e07d7){if(_0x5e07d7){freeIsNotKey(_0x5e07d7,_0x4fc51a[_0x2203('0x65')],'id');for(var _0x6319a3=0x0,_0x437095={};_0x6319a3<_0x5e07d7['length'];_0x6319a3+=0x1){_0x437095=_0x5e07d7[_0x6319a3];if(_['isUndefined'](_0x4fc51a['voiceExtensions'][_0x437095['id']])){_0x4fc51a[_0x2203('0x65')][_0x437095['id']]=new VoiceExtension(_0x437095);}else{_0x4fc51a[_0x2203('0x40')](_0x4fc51a[_0x2203('0x65')][_0x437095['id']],_0x437095);}}}return _0x4fc51a[_0x2203('0x65')];};};Realtime[_0x2203('0x39')][_0x2203('0x66')]=function(){var _0x3d1797=this;return function(_0x52f25e){clearCampaigns(_0x3d1797[_0x2203('0x14')]);for(var _0x74843=0x0;_0x74843<_0x52f25e[_0x2203('0x3a')];_0x74843+=0x1){_[_0x2203('0x67')](_0x3d1797[_0x2203('0x14')][_0x52f25e[_0x74843][_0x2203('0x22')]],_0x52f25e[_0x74843]);}return _0x3d1797[_0x2203('0x14')];};};Realtime['prototype'][_0x2203('0x68')]=function(){var _0x51a2fe=this;return function(_0x5d0176){if(_0x5d0176){freeIsNotKey(_0x5d0176,_0x51a2fe[_0x2203('0x1e')],'id');for(var _0x5cd030=0x0,_0xb9588e={};_0x5cd030<_0x5d0176[_0x2203('0x3a')];_0x5cd030+=0x1){_0xb9588e=_0x5d0176[_0x5cd030];if(_['isUndefined'](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']])){_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']]=new FaxAccount(_0xb9588e);}else{_0x51a2fe[_0x2203('0x40')](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']],_0xb9588e);}}}return _0x51a2fe[_0x2203('0x1e')];};};Realtime[_0x2203('0x39')]['initVoiceQueues']=function(){var _0x215638=this;return function(_0x3541b3){if(_0x3541b3){freeIsNotKey(_0x3541b3,_0x215638['voiceQueues'],'name');for(var _0x377176=0x0,_0x3fe71b={};_0x377176<_0x3541b3[_0x2203('0x3a')];_0x377176+=0x1){_0x3fe71b=_0x3541b3[_0x377176];if(_[_0x2203('0x3c')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]])){_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]]=new VoiceQueue(_0x3fe71b);}else{_0x215638[_0x2203('0x40')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]],_0x3fe71b);}}}return _0x215638[_0x2203('0x13')];};};module[_0x2203('0x69')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index efe9faa..f149992 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe411=['assign'];(function(_0x358230,_0x4769b8){var _0x55791b=function(_0x233fc3){while(--_0x233fc3){_0x358230['push'](_0x358230['shift']());}};_0x55791b(++_0x4769b8);}(_0xe411,0x1e8));var _0x1e41=function(_0x9c6c54,_0x531173){_0x9c6c54=_0x9c6c54-0x0;var _0x1c24c1=_0xe411[_0x9c6c54];return _0x1c24c1;};'use strict';function mergeDBDataToRealtime(_0x37a114,_0x302222){var _0x3f61f0=Object[_0x1e41('0x0')]({},_0x37a114);for(var _0x27f2df in _0x302222){if(_0x3f61f0['hasOwnProperty'](_0x27f2df)){_0x3f61f0[_0x27f2df]=_0x302222[_0x27f2df];}}return _0x3f61f0;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file +var _0x2714=['mergeDBDataToRealtime','assign'];(function(_0x7ab092,_0x3de9c8){var _0xbca572=function(_0x5da948){while(--_0x5da948){_0x7ab092['push'](_0x7ab092['shift']());}};_0xbca572(++_0x3de9c8);}(_0x2714,0xdb));var _0x4271=function(_0x3fb28f,_0x390790){_0x3fb28f=_0x3fb28f-0x0;var _0x4d8b8c=_0x2714[_0x3fb28f];return _0x4d8b8c;};'use strict';function mergeDBDataToRealtime(_0x539276,_0x125657){var _0x59df8d=Object[_0x4271('0x0')]({},_0x539276);for(var _0x3e49aa in _0x125657){if(_0x59df8d['hasOwnProperty'](_0x3e49aa)){_0x59df8d[_0x3e49aa]=_0x125657[_0x3e49aa];}}return _0x59df8d;}exports[_0x4271('0x1')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 966e5c5..684b00b 100644 --- a/server/services/ami/report/index.js +++ b/server/services/ami/report/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7960=['keys','split','getAgentByInternal','calleridnum','internal','destination','exten','type','lastapplication','queue','from-voip-provider','context','xcally-motion-preview','originatecalleridnum','channel','destinationchannel','disposition','ANSWERED','callerid','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','uniqueid','monitor','monitors','monitorFilename','createdAt','calleridname','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','voiceDialReport','Local','indexOf','mobile','substring','lastIndexOf','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','xdr','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','connectedlinenum','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','queuecallerexit','create'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7960,0x12b));var _0x0796=function(_0x53d519,_0x19d299){_0x53d519=_0x53d519-0x0;var _0x2a0a12=_0x7960[_0x53d519];return _0x2a0a12;};'use strict';var _=require(_0x0796('0x0'));var moment=require(_0x0796('0x1'));var util=require(_0x0796('0x2'));var config=require(_0x0796('0x3'));var ami=require(_0x0796('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x0796('0x5'));var RpcVoiceDialReport=require(_0x0796('0x6'));var RpcMemberReport=require(_0x0796('0x7'));var RpcVoiceQueueReport=require(_0x0796('0x8'));var RpcVoiceRecording=require(_0x0796('0x9'));var RpcVoiceTransferReport=require(_0x0796('0xa'));var VoiceQueueReport=require(_0x0796('0xb'));var VoiceCallReport=require(_0x0796('0xc'));var VoiceAgentReport=require(_0x0796('0xd'));var VoiceDialReport=require(_0x0796('0xe'));var UserReport=require(_0x0796('0xf'));function Report(_0x5c769d){this[_0x0796('0x10')]=_0x5c769d;this[_0x0796('0x11')]=_0x5c769d[_0x0796('0x11')];this[_0x0796('0x12')]=_0x5c769d['telephones'];}Report[_0x0796('0x13')]['sync']=function(_0x5da4b7){var _0x2c6644=new VoiceQueueReport(this[_0x0796('0x10')]);var _0x5110fa=new VoiceAgentReport(this['realtime']);var _0x1ef077=new VoiceDialReport(this[_0x0796('0x10')]);var _0xcc4782=new VoiceCallReport(this[_0x0796('0x10')]);var _0x13edb8=new UserReport(this['realtime']);if(config[_0x0796('0x14')]&&config['xdr']['disabled']){ami['on']('custom:voiceQueueReport',this[_0x0796('0x15')][_0x0796('0x16')](this));ami['on']('custom:voiceCallReport',this[_0x0796('0x17')][_0x0796('0x16')](this));ami['on'](_0x0796('0x18'),this[_0x0796('0x19')][_0x0796('0x16')](this));ami['on'](_0x0796('0x1a'),this['voiceDialReport'][_0x0796('0x16')](this));ami['on'](_0x0796('0x1b'),this[_0x0796('0x1c')]['bind'](this));ami['on']('attendedtransfer',this[_0x0796('0x1d')][_0x0796('0x16')](this));}};Report[_0x0796('0x13')][_0x0796('0x1e')]=function(_0x47c198){var _0x221769;_0x221769=_[_0x0796('0x1f')](this[_0x0796('0x11')],function(_0x17938c){return _0x17938c[_0x0796('0x20')]==_0x47c198||_0x17938c[_0x0796('0x21')]==_0x47c198;});if(_[_0x0796('0x22')](_0x221769)){var _0x2ac889=_[_0x0796('0x1f')](this[_0x0796('0x12')],function(_0x2e4578){return _0x2e4578[_0x0796('0x20')]==_0x47c198||_0x2e4578[_0x0796('0x21')]==_0x47c198;});if(_0x2ac889){_0x221769=_['find'](this[_0x0796('0x11')],function(_0x22a6f7){return _0x22a6f7[_0x0796('0x23')]==util[_0x0796('0x24')](_0x0796('0x25'),_0x2ac889[_0x0796('0x21')]);});}}return _0x221769;};Report[_0x0796('0x13')][_0x0796('0x15')]=function(_0x106500){for(var _0x1e8992=0x0;_0x1e8992<_0x106500[_0x0796('0x26')];_0x1e8992+=0x1){var _0x47a60b=this[_0x0796('0x1e')](_0x106500[_0x1e8992][_0x0796('0x27')]);if(_0x47a60b){_0x106500[_0x1e8992]['accountcode']=_0x47a60b[_0x0796('0x20')];_0x106500[_0x1e8992]['assigned']=!![];_0x106500[_0x1e8992][_0x0796('0x28')]=_0x47a60b[_0x0796('0x21')];_0x106500[_0x1e8992]['interface']=_[_0x0796('0x22')](_0x47a60b[_0x0796('0x23')])?util[_0x0796('0x24')]('SIP/%s',_0x47a60b['name']):_0x47a60b[_0x0796('0x23')];if(_0x106500[_0x1e8992][_0x0796('0x29')]){_0x106500[_0x1e8992][_0x0796('0x2a')]=moment()[_0x0796('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x106500[_0x1e8992][_0x0796('0x2b')]){_0x106500[_0x1e8992]['queuecallerexitAt']=moment()[_0x0796('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x0796('0x15')](_0x106500[_0x1e8992]);}RpcVoiceQueueReport[_0x0796('0x2c')](_0x106500[_0x1e8992]);}};function extractCalleridNumber(_0x2af05d){var _0x247c31=_0x2af05d['match'](/<(.*?)>/);return _0x247c31?_0x247c31[0x1]:_0x2af05d;}Report['prototype']['getAgentByInternal']=function(_0xbbdd1f){for(var _0x4ae2dd=0x0;_0x4ae2dd/);return _0x19157b?_0x19157b[0x1]:_0x5392a0;}Report[_0xb12a('0xe')][_0xb12a('0x30')]=function(_0x13a9bc){for(var _0x5b70f4=0x0;_0x5b70f4',_0x568825['calleridname'],_0x568825['calleridnum']);}if(RpcVoiceTransferReport[_0xb12a('0x46')][_0x568825[_0xb12a('0x47')]]){var _0x5d5b4d=RpcVoiceTransferReport['transfers'][_0x568825[_0xb12a('0x47')]];_0x5d5b4d[_0xb12a('0x48')]=_0x568825['uniqueid'];RpcVoiceTransferReport[_0xb12a('0x49')](_0x5d5b4d);delete RpcVoiceTransferReport['transfers'][_0x568825[_0xb12a('0x47')]];}if(_[_0xb12a('0x21')](_0x568825[_0xb12a('0x38')])){_0x568825[_0xb12a('0x38')]=this[_0xb12a('0x4a')](_0x568825);}if(_[_0xb12a('0x21')](_0x568825[_0xb12a('0x4b')])){var _0x4b6923=_0x568825['channel'][_0xb12a('0x33')]('-')[0x0];var _0xeaca63=this['agents'][_0x4b6923];if(!_0xeaca63)_0xeaca63=this['getAgentByInternal'](_0x568825[_0xb12a('0x27')]);if(_0xeaca63){_0x568825[_0xb12a('0x4b')]=_0xeaca63['id'];_0x568825[_0xb12a('0x4c')]=_0xeaca63[_0xb12a('0x20')];}}RpcVoiceCallReport[_0xb12a('0x2e')](_0x568825);if(_0x568825[_0xb12a('0x4d')]){for(var _0x5ddfc0=0x0;_0x5ddfc0<_0x568825[_0xb12a('0x4e')][_0xb12a('0x25')];_0x5ddfc0+=0x1){_0x568825[_0xb12a('0x4f')]=_0x568825[_0xb12a('0x4e')][_0x5ddfc0][_0xb12a('0x50')];_0x568825[_0xb12a('0x51')]=_0x568825[_0xb12a('0x4e')][_0x5ddfc0]['createdAt'];if(_0x568825['exten']==_0xb12a('0x41')){_0x568825[_0xb12a('0x34')]=_0x568825['connectedlinenum'];_0x568825['calleridname']=_0x568825['connectedlinename'];_0x568825[_0xb12a('0x26')]=_0x568825[_0xb12a('0x27')];_0x568825[_0xb12a('0x52')]=_0x568825['membername'];_0x568825['exten']=_0x568825[_0xb12a('0x43')];}else if(_0x568825['exten']==_0xb12a('0x53')){_0x568825[_0xb12a('0x34')]=_0x568825[_0xb12a('0x36')];_0x568825['exten']=_0x568825[_0xb12a('0x43')];}RpcVoiceRecording['create'](_0x568825);}}};Report[_0xb12a('0xe')][_0xb12a('0x18')]=function(_0x26da35){if(_[_0xb12a('0x54')](_0x26da35)){_0x26da35[_0xb12a('0x55')](function(_0x2a7e4e){RpcVoiceAgentReport[_0xb12a('0x2e')](_0x2a7e4e);});}else{RpcVoiceAgentReport[_0xb12a('0x2e')](_0x26da35);}};Report[_0xb12a('0xe')][_0xb12a('0x1a')]=function(_0x5d4388){RpcVoiceDialReport[_0xb12a('0x2e')](_0x5d4388);var _0xc5e206;var _0x53fb05;var _0x2b16ac=_0x5d4388['channel'];if(_['startsWith'](_0x2b16ac,_0xb12a('0x56'))){_0x53fb05=_0x2b16ac['substring'](_0x2b16ac[_0xb12a('0x57')]('/')+0x1,_0x2b16ac[_0xb12a('0x57')]('@'));_0xc5e206=_[_0xb12a('0x1e')](this[_0xb12a('0x1f')],function(_0x1efa95){return _0x1efa95[_0xb12a('0x58')]==_0x53fb05||_0x1efa95['phone']==_0x53fb05||_0x1efa95[_0xb12a('0x27')]==_0x53fb05;});}else{_0x53fb05=_0x2b16ac[_0xb12a('0x59')](_0x2b16ac[_0xb12a('0x57')]('/')+0x1,_0x2b16ac[_0xb12a('0x5a')]('-'));_0xc5e206=this[_0xb12a('0x1d')](_0x53fb05);}if(_0xc5e206){_0x5d4388[_0xb12a('0x22')]=_['isNil'](_0xc5e206[_0xb12a('0x22')])?util[_0xb12a('0x23')](_0xb12a('0x24'),_0xc5e206[_0xb12a('0x20')]):_0xc5e206[_0xb12a('0x22')];_0x5d4388[_0xb12a('0x4c')]=_0xc5e206[_0xb12a('0x20')];_0x5d4388[_0xb12a('0x27')]=_0xc5e206[_0xb12a('0x27')];RpcMemberReport[_0xb12a('0x1a')](_0x5d4388);}};Report[_0xb12a('0xe')]['blindTransfer']=function(_0x146c1d){RpcVoiceTransferReport[_0xb12a('0x46')][_0x146c1d[_0xb12a('0x5b')]]=_0x146c1d;};Report[_0xb12a('0xe')][_0xb12a('0x1c')]=function(_0x54fecc){RpcVoiceTransferReport['attendedTransfer'](_0x54fecc);};module[_0xb12a('0x5c')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 7409fb4..e5d2800 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x30df=['[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','address','peer','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','moment','util','ioredis','../../../config/logger','ami','../ami','defaults','redis','localhost','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','peerstatus','syncPeerStatus','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','resolve','actionDeviceStateList','[userReport][devicestatelist]','[userReport][sippeerstatus]','prototype','syncRealtimeShow','then','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','updateStatusRealtime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x30df,0x13e));var _0xf30d=function(_0xaacb02,_0xf06ae3){_0xaacb02=_0xaacb02-0x0;var _0x220eb1=_0x30df[_0xaacb02];return _0x220eb1;};'use strict';var _=require('lodash');var moment=require(_0xf30d('0x0'));var util=require(_0xf30d('0x1'));var Redis=require(_0xf30d('0x2'));var BPromise=require('bluebird');var config=require('../../../config/environment');var logger=require(_0xf30d('0x3'))(_0xf30d('0x4'));var ami=require(_0xf30d('0x5'));config['redis']=_[_0xf30d('0x6')](config[_0xf30d('0x7')],{'host':_0xf30d('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf30d('0x7')]));function UserReport(_0x3416ce){this['trunks']=_0x3416ce[_0xf30d('0x9')];this['agents']=_0x3416ce[_0xf30d('0xa')];this['telephones']=_0x3416ce[_0xf30d('0xb')];ami['on'](_0xf30d('0xc'),this[_0xf30d('0xd')][_0xf30d('0xe')](this));ami['on'](_0xf30d('0xf'),this[_0xf30d('0xd')][_0xf30d('0xe')](this));ami['on']('devicestatechange',this['syncDeviceState'][_0xf30d('0xe')](this));ami['on'](_0xf30d('0x10'),this[_0xf30d('0x11')]['bind'](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise['resolve']()['then'](ami[_0xf30d('0x12')]())[_0xf30d('0x13')](function(_0xee3513){logger[_0xf30d('0x14')](_0xf30d('0x15'),util[_0xf30d('0x16')](_0xee3513,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xf30d('0x17')]()['then'](ami[_0xf30d('0x18')]())[_0xf30d('0x13')](function(_0x5531e4){logger[_0xf30d('0x14')](_0xf30d('0x19'),util['inspect'](_0x5531e4,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xf30d('0x17')]()['then'](ami['actionSipPeerStatus']())['catch'](function(_0x1a7c38){logger[_0xf30d('0x14')](_0xf30d('0x1a'),util[_0xf30d('0x16')](_0x1a7c38,{'showHidden':![],'depth':null}));});}UserReport[_0xf30d('0x1b')][_0xf30d('0x1c')]=function(){setInterval(function(){BPromise[_0xf30d('0x17')]()[_0xf30d('0x1d')](showSipRegistrations())[_0xf30d('0x1d')](listDeviceStates())[_0xf30d('0x1d')](showPeersStatus());},0x32c8);};UserReport[_0xf30d('0x1b')][_0xf30d('0x1e')]=function(_0x2ddc16){return _0x2ddc16!==null&&!_[_0xf30d('0x1f')](_0x2ddc16);};UserReport[_0xf30d('0x1b')][_0xf30d('0x20')]=function(_0xf0c52e,_0x423e45,_0x586eb8){io['to'](_0xf0c52e)['emit'](_0x423e45,_0x586eb8);};UserReport[_0xf30d('0x1b')][_0xf30d('0xd')]=function(_0x1df395){try{if(this[_0xf30d('0x1e')](_0x1df395)){logger[_0xf30d('0x21')](_0xf30d('0x22'),_0x1df395[_0xf30d('0x23')],_0x1df395[_0xf30d('0x24')]);logger['debug'](_0xf30d('0x25'),util['inspect'](_0x1df395,{'showHidden':![],'depth':null}));var _0x374fba=_[_0xf30d('0x26')](this[_0xf30d('0x9')],{'defaultuser':_0x1df395[_0xf30d('0x23')]});if(_0x374fba){_0x1df395[_0xf30d('0x27')]=_0x1df395[_0xf30d('0x24')];_[_0xf30d('0x28')](_0x374fba,_[_0xf30d('0x29')](_0x1df395,[_0xf30d('0x2a'),_0xf30d('0x2b'),_0xf30d('0x23'),_0xf30d('0x24')]));logger[_0xf30d('0x2c')](_0xf30d('0x2d'),util[_0xf30d('0x16')](_0x374fba,{'showHidden':![],'depth':null}));this[_0xf30d('0x20')](util[_0xf30d('0x2e')](_0xf30d('0x2f'),_0x374fba[_0xf30d('0x30')]),_0xf30d('0x31'),_0x374fba);}}}catch(_0x406377){logger[_0xf30d('0x14')](_0xf30d('0x25'),util[_0xf30d('0x16')](_0x406377,{'showHidden':![],'depth':null}));}};UserReport[_0xf30d('0x1b')][_0xf30d('0x32')]=function(_0xe3d190){try{if(this[_0xf30d('0x1e')](_0xe3d190)){logger[_0xf30d('0x21')](_0xf30d('0x33'),_0xe3d190[_0xf30d('0x34')],_0xe3d190['state']);logger[_0xf30d('0x2c')](_0xf30d('0x35'),util[_0xf30d('0x16')](_0xe3d190,{'showHidden':![],'depth':null}));if(this['agents'][_0xe3d190[_0xf30d('0x34')]]){if(!this[_0xf30d('0xa')][_0xe3d190[_0xf30d('0x34')]][_0xf30d('0x36')]||_0xe3d190[_0xf30d('0x24')][_0xf30d('0x37')]()==_0xf30d('0x38')){this['agents'][_0xe3d190[_0xf30d('0x34')]][_0xf30d('0x36')]=![];if(this[_0xf30d('0xa')][_0xe3d190[_0xf30d('0x34')]][_0xf30d('0x24')]!==_0xe3d190[_0xf30d('0x24')][_0xf30d('0x37')]()){this[_0xf30d('0xa')][_0xe3d190[_0xf30d('0x34')]][_0xf30d('0x39')]=_['toNumber'](moment()['format']('x'));}this[_0xf30d('0xa')][_0xe3d190[_0xf30d('0x34')]][_0xf30d('0x24')]=_0xe3d190[_0xf30d('0x24')][_0xf30d('0x37')]();this[_0xf30d('0xa')][_0xe3d190[_0xf30d('0x34')]][_0xf30d('0x3a')](_0xe3d190);}}else if(this[_0xf30d('0xb')][_0xe3d190[_0xf30d('0x34')]]){if(this['telephones'][_0xe3d190[_0xf30d('0x34')]][_0xf30d('0x24')]!==_0xe3d190[_0xf30d('0x24')]['toLowerCase']()){this[_0xf30d('0xb')][_0xe3d190[_0xf30d('0x34')]][_0xf30d('0x39')]=_[_0xf30d('0x3b')](moment()[_0xf30d('0x2e')]('x'));}this[_0xf30d('0xb')][_0xe3d190[_0xf30d('0x34')]][_0xf30d('0x24')]=_0xe3d190['state'][_0xf30d('0x37')]();logger['debug'](_0xf30d('0x3c'),util['inspect'](this[_0xf30d('0xb')][_0xe3d190[_0xf30d('0x34')]],{'showHidden':![],'depth':null}));this[_0xf30d('0x20')](util[_0xf30d('0x2e')](_0xf30d('0x3d'),this['telephones'][_0xe3d190[_0xf30d('0x34')]]['name']),'telephone:save',this[_0xf30d('0xb')][_0xe3d190[_0xf30d('0x34')]]);}else if(this['trunks'][_0xe3d190[_0xf30d('0x34')]]){if(this['trunks'][_0xe3d190[_0xf30d('0x34')]][_0xf30d('0x24')]!==_0xe3d190[_0xf30d('0x24')][_0xf30d('0x37')]()){this[_0xf30d('0x9')][_0xe3d190['device']][_0xf30d('0x39')]=_['toNumber'](moment()[_0xf30d('0x2e')]('x'));}this[_0xf30d('0x9')][_0xe3d190[_0xf30d('0x34')]][_0xf30d('0x24')]=_0xe3d190[_0xf30d('0x24')][_0xf30d('0x37')]();logger['debug'](_0xf30d('0x3e'),util[_0xf30d('0x16')](this[_0xf30d('0x9')][_0xe3d190['device']],{'showHidden':![],'depth':null}));this[_0xf30d('0x20')](util[_0xf30d('0x2e')](_0xf30d('0x2f'),this[_0xf30d('0x9')][_0xe3d190[_0xf30d('0x34')]][_0xf30d('0x30')]),'trunk:save',this[_0xf30d('0x9')][_0xe3d190['device']]);}else if(_[_0xf30d('0x3f')](_0xe3d190[_0xf30d('0x34')],_0xf30d('0x40'))){var _0x4740b0=_0xe3d190[_0xf30d('0x34')];var _0x168ac9=_0x4740b0[_0xf30d('0x41')](_0x4740b0[_0xf30d('0x42')]('/')+0x1,_0x4740b0[_0xf30d('0x42')]('@'));var _0x46988e=_[_0xf30d('0x26')](this[_0xf30d('0xa')],function(_0x58ff2d){return _0x58ff2d['mobile']==_0x168ac9||_0x58ff2d['phone']==_0x168ac9||_0x58ff2d['accountcode']==_0x168ac9;});if(_0x46988e){if(_0x46988e['state']!==_0xe3d190[_0xf30d('0x24')][_0xf30d('0x37')]()){_0x46988e[_0xf30d('0x39')]=_[_0xf30d('0x3b')](moment()[_0xf30d('0x2e')]('x'));}_0x46988e[_0xf30d('0x24')]=_0xe3d190[_0xf30d('0x24')][_0xf30d('0x37')]();_0x46988e[_0xf30d('0x36')]=!![];_0x46988e['updateStatusRealtime'](_0xe3d190);}}}}catch(_0xe1fd5){logger[_0xf30d('0x14')](_0xf30d('0x35'),util['inspect'](_0xe1fd5,{'showHidden':![],'depth':null}));}};UserReport[_0xf30d('0x1b')][_0xf30d('0x11')]=function(_0x2403de){try{if(this[_0xf30d('0x1e')](_0x2403de)&&this[_0xf30d('0x1e')](_0x2403de[_0xf30d('0x10')])){logger[_0xf30d('0x21')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x2403de['peer'],_0x2403de[_0xf30d('0x43')],_0x2403de[_0xf30d('0x10')]);logger[_0xf30d('0x2c')]('[userReport][peerstatus]',util[_0xf30d('0x16')](_0x2403de,{'showHidden':![],'depth':null}));if(this[_0xf30d('0xa')][_0x2403de[_0xf30d('0x44')]]){if(!this['agents'][_0x2403de[_0xf30d('0x44')]][_0xf30d('0x36')]||_0x2403de['peerstatus']['toLowerCase']()==_0xf30d('0x45')){this[_0xf30d('0xa')][_0x2403de[_0xf30d('0x44')]]['local']=![];this['agents'][_0x2403de['peer']][_0xf30d('0x46')]=_0x2403de[_0xf30d('0x10')][_0xf30d('0x37')]();this[_0xf30d('0xa')][_0x2403de[_0xf30d('0x44')]]['address']=_0x2403de[_0xf30d('0x43')];this[_0xf30d('0xa')][_0x2403de['peer']][_0xf30d('0x3a')](_0x2403de);}}else if(this['telephones'][_0x2403de['peer']]){this[_0xf30d('0xb')][_0x2403de[_0xf30d('0x44')]][_0xf30d('0x46')]=_0x2403de['peerstatus'][_0xf30d('0x37')]();this[_0xf30d('0xb')][_0x2403de['peer']][_0xf30d('0x43')]=_0x2403de[_0xf30d('0x43')];logger[_0xf30d('0x2c')](_0xf30d('0x47'),util[_0xf30d('0x16')](this[_0xf30d('0xb')][_0x2403de['peer']],{'showHidden':![],'depth':null}));this['emit'](util[_0xf30d('0x2e')](_0xf30d('0x3d'),this[_0xf30d('0xb')][_0x2403de[_0xf30d('0x44')]]['name']),_0xf30d('0x48'),this['telephones'][_0x2403de[_0xf30d('0x44')]]);}else if(this[_0xf30d('0x9')][_0x2403de[_0xf30d('0x44')]]){this[_0xf30d('0x9')][_0x2403de[_0xf30d('0x44')]][_0xf30d('0x46')]=_0x2403de[_0xf30d('0x10')][_0xf30d('0x37')]();this[_0xf30d('0x9')][_0x2403de['peer']]['address']=_0x2403de[_0xf30d('0x43')];logger[_0xf30d('0x2c')](_0xf30d('0x49'),util[_0xf30d('0x16')](this[_0xf30d('0x9')][_0x2403de[_0xf30d('0x44')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xf30d('0x2f'),this[_0xf30d('0x9')][_0x2403de[_0xf30d('0x44')]]['name']),_0xf30d('0x31'),this[_0xf30d('0x9')][_0x2403de[_0xf30d('0x44')]]);}}}catch(_0x3a764a){logger[_0xf30d('0x14')](_0xf30d('0x4a'),util[_0xf30d('0x16')](_0x3a764a,{'showHidden':![],'depth':null}));}};module[_0xf30d('0x4b')]=UserReport; \ No newline at end of file +var _0x2de2=['[userReport][sippeerstatus]','prototype','isNotNull','emit','username','[userReport][registry]','find','stateRegistry','merge','event','actionid','state','debug','format','trunk:%s','name','trunk:save','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','toNumber','updateStatusRealtime','stateTime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','startsWith','substring','indexOf','mobile','accountcode','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncRealtimeShow','actionSipShowRegistry','catch','error','inspect','resolve','then','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus'];(function(_0x24ab46,_0x21a944){var _0x2557a7=function(_0x5c241d){while(--_0x5c241d){_0x24ab46['push'](_0x24ab46['shift']());}};_0x2557a7(++_0x21a944);}(_0x2de2,0x1a9));var _0x22de=function(_0x15980c,_0x322a48){_0x15980c=_0x15980c-0x0;var _0x3693fb=_0x2de2[_0x15980c];return _0x3693fb;};'use strict';var _=require(_0x22de('0x0'));var moment=require(_0x22de('0x1'));var util=require(_0x22de('0x2'));var Redis=require('ioredis');var BPromise=require(_0x22de('0x3'));var config=require(_0x22de('0x4'));var logger=require(_0x22de('0x5'))(_0x22de('0x6'));var ami=require(_0x22de('0x7'));config['redis']=_['defaults'](config[_0x22de('0x8')],{'host':_0x22de('0x9'),'port':0x18eb});var io=require(_0x22de('0xa'))(new Redis(config[_0x22de('0x8')]));function UserReport(_0x2d0059){this[_0x22de('0xb')]=_0x2d0059[_0x22de('0xb')];this[_0x22de('0xc')]=_0x2d0059[_0x22de('0xc')];this['telephones']=_0x2d0059[_0x22de('0xd')];ami['on'](_0x22de('0xe'),this[_0x22de('0xf')][_0x22de('0x10')](this));ami['on'](_0x22de('0x11'),this[_0x22de('0xf')][_0x22de('0x10')](this));ami['on'](_0x22de('0x12'),this[_0x22de('0x13')]['bind'](this));ami['on'](_0x22de('0x14'),this['syncPeerStatus'][_0x22de('0x10')](this));return this[_0x22de('0x15')]();}function showSipRegistrations(){Promise['resolve']()['then'](ami[_0x22de('0x16')]())[_0x22de('0x17')](function(_0xae5a9a){logger[_0x22de('0x18')]('[userReport][sipshowregistry]',util[_0x22de('0x19')](_0xae5a9a,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x22de('0x1a')]()[_0x22de('0x1b')](ami[_0x22de('0x1c')]())[_0x22de('0x17')](function(_0x33f44a){logger[_0x22de('0x18')](_0x22de('0x1d'),util[_0x22de('0x19')](_0x33f44a,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x22de('0x1b')](ami[_0x22de('0x1e')]())[_0x22de('0x17')](function(_0x1bbba3){logger[_0x22de('0x18')](_0x22de('0x1f'),util[_0x22de('0x19')](_0x1bbba3,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0x22de('0x15')]=function(){setInterval(function(){BPromise[_0x22de('0x1a')]()[_0x22de('0x1b')](showSipRegistrations())['then'](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x22de('0x20')][_0x22de('0x21')]=function(_0x42b036){return _0x42b036!==null&&!_['isUndefined'](_0x42b036);};UserReport['prototype']['emit']=function(_0x3ae166,_0x398886,_0x4e685e){io['to'](_0x3ae166)[_0x22de('0x22')](_0x398886,_0x4e685e);};UserReport[_0x22de('0x20')]['syncRegistry']=function(_0x224349){try{if(this[_0x22de('0x21')](_0x224349)){logger['info']('[userReport][registry]\x20registry:%s\x20state:%s',_0x224349[_0x22de('0x23')],_0x224349['state']);logger['debug'](_0x22de('0x24'),util[_0x22de('0x19')](_0x224349,{'showHidden':![],'depth':null}));var _0x404182=_[_0x22de('0x25')](this[_0x22de('0xb')],{'defaultuser':_0x224349[_0x22de('0x23')]});if(_0x404182){_0x224349[_0x22de('0x26')]=_0x224349['state'];_[_0x22de('0x27')](_0x404182,_['omit'](_0x224349,[_0x22de('0x28'),_0x22de('0x29'),_0x22de('0x23'),_0x22de('0x2a')]));logger[_0x22de('0x2b')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x22de('0x19')](_0x404182,{'showHidden':![],'depth':null}));this['emit'](util[_0x22de('0x2c')](_0x22de('0x2d'),_0x404182[_0x22de('0x2e')]),_0x22de('0x2f'),_0x404182);}}}catch(_0x1350aa){logger[_0x22de('0x18')]('[userReport][registry]',util[_0x22de('0x19')](_0x1350aa,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x22de('0x13')]=function(_0x5812fa){try{if(this[_0x22de('0x21')](_0x5812fa)){logger[_0x22de('0x30')](_0x22de('0x31'),_0x5812fa[_0x22de('0x32')],_0x5812fa['state']);logger[_0x22de('0x2b')](_0x22de('0x33'),util[_0x22de('0x19')](_0x5812fa,{'showHidden':![],'depth':null}));if(this[_0x22de('0xc')][_0x5812fa[_0x22de('0x32')]]){if(!this[_0x22de('0xc')][_0x5812fa['device']][_0x22de('0x34')]||_0x5812fa[_0x22de('0x2a')][_0x22de('0x35')]()==_0x22de('0x36')){this[_0x22de('0xc')][_0x5812fa[_0x22de('0x32')]][_0x22de('0x34')]=![];if(this['agents'][_0x5812fa['device']][_0x22de('0x2a')]!==_0x5812fa['state'][_0x22de('0x35')]()){this['agents'][_0x5812fa[_0x22de('0x32')]]['stateTime']=_[_0x22de('0x37')](moment()['format']('x'));}this[_0x22de('0xc')][_0x5812fa[_0x22de('0x32')]][_0x22de('0x2a')]=_0x5812fa[_0x22de('0x2a')][_0x22de('0x35')]();this[_0x22de('0xc')][_0x5812fa[_0x22de('0x32')]][_0x22de('0x38')](_0x5812fa);}}else if(this[_0x22de('0xd')][_0x5812fa[_0x22de('0x32')]]){if(this[_0x22de('0xd')][_0x5812fa[_0x22de('0x32')]][_0x22de('0x2a')]!==_0x5812fa['state']['toLowerCase']()){this[_0x22de('0xd')][_0x5812fa['device']][_0x22de('0x39')]=_[_0x22de('0x37')](moment()['format']('x'));}this['telephones'][_0x5812fa[_0x22de('0x32')]]['state']=_0x5812fa[_0x22de('0x2a')][_0x22de('0x35')]();logger['debug'](_0x22de('0x3a'),util[_0x22de('0x19')](this[_0x22de('0xd')][_0x5812fa['device']],{'showHidden':![],'depth':null}));this[_0x22de('0x22')](util[_0x22de('0x2c')]('telephone:%s',this[_0x22de('0xd')][_0x5812fa['device']][_0x22de('0x2e')]),_0x22de('0x3b'),this[_0x22de('0xd')][_0x5812fa['device']]);}else if(this[_0x22de('0xb')][_0x5812fa[_0x22de('0x32')]]){if(this[_0x22de('0xb')][_0x5812fa[_0x22de('0x32')]][_0x22de('0x2a')]!==_0x5812fa[_0x22de('0x2a')][_0x22de('0x35')]()){this['trunks'][_0x5812fa[_0x22de('0x32')]][_0x22de('0x39')]=_['toNumber'](moment()[_0x22de('0x2c')]('x'));}this[_0x22de('0xb')][_0x5812fa[_0x22de('0x32')]][_0x22de('0x2a')]=_0x5812fa[_0x22de('0x2a')][_0x22de('0x35')]();logger[_0x22de('0x2b')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0x22de('0x19')](this[_0x22de('0xb')][_0x5812fa[_0x22de('0x32')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x22de('0x2c')](_0x22de('0x2d'),this[_0x22de('0xb')][_0x5812fa[_0x22de('0x32')]][_0x22de('0x2e')]),_0x22de('0x2f'),this['trunks'][_0x5812fa[_0x22de('0x32')]]);}else if(_[_0x22de('0x3c')](_0x5812fa[_0x22de('0x32')],'Local')){var _0x302ffa=_0x5812fa[_0x22de('0x32')];var _0xde9730=_0x302ffa[_0x22de('0x3d')](_0x302ffa['indexOf']('/')+0x1,_0x302ffa[_0x22de('0x3e')]('@'));var _0x3f0952=_[_0x22de('0x25')](this[_0x22de('0xc')],function(_0x578608){return _0x578608[_0x22de('0x3f')]==_0xde9730||_0x578608['phone']==_0xde9730||_0x578608[_0x22de('0x40')]==_0xde9730;});if(_0x3f0952){if(_0x3f0952[_0x22de('0x2a')]!==_0x5812fa[_0x22de('0x2a')]['toLowerCase']()){_0x3f0952[_0x22de('0x39')]=_[_0x22de('0x37')](moment()[_0x22de('0x2c')]('x'));}_0x3f0952[_0x22de('0x2a')]=_0x5812fa['state'][_0x22de('0x35')]();_0x3f0952['local']=!![];_0x3f0952[_0x22de('0x38')](_0x5812fa);}}}}catch(_0x1c6c17){logger[_0x22de('0x18')](_0x22de('0x33'),util[_0x22de('0x19')](_0x1c6c17,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x22de('0x41')]=function(_0x393a7f){try{if(this[_0x22de('0x21')](_0x393a7f)&&this[_0x22de('0x21')](_0x393a7f[_0x22de('0x14')])){logger[_0x22de('0x30')](_0x22de('0x42'),_0x393a7f[_0x22de('0x43')],_0x393a7f['address'],_0x393a7f[_0x22de('0x14')]);logger['debug'](_0x22de('0x44'),util['inspect'](_0x393a7f,{'showHidden':![],'depth':null}));if(this['agents'][_0x393a7f[_0x22de('0x43')]]){if(!this[_0x22de('0xc')][_0x393a7f[_0x22de('0x43')]][_0x22de('0x34')]||_0x393a7f[_0x22de('0x14')]['toLowerCase']()==_0x22de('0x45')){this['agents'][_0x393a7f[_0x22de('0x43')]][_0x22de('0x34')]=![];this[_0x22de('0xc')][_0x393a7f['peer']][_0x22de('0x46')]=_0x393a7f[_0x22de('0x14')]['toLowerCase']();this[_0x22de('0xc')][_0x393a7f[_0x22de('0x43')]][_0x22de('0x47')]=_0x393a7f[_0x22de('0x47')];this[_0x22de('0xc')][_0x393a7f['peer']][_0x22de('0x38')](_0x393a7f);}}else if(this[_0x22de('0xd')][_0x393a7f[_0x22de('0x43')]]){this[_0x22de('0xd')][_0x393a7f['peer']]['status']=_0x393a7f['peerstatus']['toLowerCase']();this[_0x22de('0xd')][_0x393a7f[_0x22de('0x43')]]['address']=_0x393a7f[_0x22de('0x47')];logger[_0x22de('0x2b')](_0x22de('0x48'),util[_0x22de('0x19')](this['telephones'][_0x393a7f[_0x22de('0x43')]],{'showHidden':![],'depth':null}));this[_0x22de('0x22')](util['format'](_0x22de('0x49'),this[_0x22de('0xd')][_0x393a7f[_0x22de('0x43')]][_0x22de('0x2e')]),'telephone:save',this['telephones'][_0x393a7f[_0x22de('0x43')]]);}else if(this[_0x22de('0xb')][_0x393a7f[_0x22de('0x43')]]){this['trunks'][_0x393a7f[_0x22de('0x43')]][_0x22de('0x46')]=_0x393a7f['peerstatus']['toLowerCase']();this[_0x22de('0xb')][_0x393a7f[_0x22de('0x43')]][_0x22de('0x47')]=_0x393a7f[_0x22de('0x47')];logger[_0x22de('0x2b')](_0x22de('0x4a'),util[_0x22de('0x19')](this[_0x22de('0xb')][_0x393a7f[_0x22de('0x43')]],{'showHidden':![],'depth':null}));this[_0x22de('0x22')](util[_0x22de('0x2c')](_0x22de('0x2d'),this[_0x22de('0xb')][_0x393a7f[_0x22de('0x43')]][_0x22de('0x2e')]),_0x22de('0x2f'),this[_0x22de('0xb')][_0x393a7f[_0x22de('0x43')]]);}}}catch(_0x3070e1){logger[_0x22de('0x18')]('[userReport][peerstatus]',util[_0x22de('0x19')](_0x3070e1,{'showHidden':![],'depth':null}));}};module[_0x22de('0x4b')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 6da70f5..ae6b8ff 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd68e=['custom:agentconnect','user:%s','user:agentconnect','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','isNotNull','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','agentringnoanswerAt','rejected','reason','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceAgentReport][varset]','addVariable','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','lastIndexOf','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','util','ioredis','../../../config/environment','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','varset','syncVarSet','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','prototype','emit','isUndefined','syncAgentCalled','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','debug','inspect','interface','queue','format','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','inbound','assign','omit','event','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:called','error','[%s][voiceAgentReport][agentcalled]','destuniqueid','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','routealias','destconnectedlinenum','name','accountcode','exten'];(function(_0x10119d,_0x232452){var _0x13b4ee=function(_0x2dcd53){while(--_0x2dcd53){_0x10119d['push'](_0x10119d['shift']());}};_0x13b4ee(++_0x232452);}(_0xd68e,0x18e));var _0xed68=function(_0x274638,_0x578968){_0x274638=_0x274638-0x0;var _0x5755df=_0xd68e[_0x274638];return _0x5755df;};'use strict';var _=require(_0xed68('0x0'));var moment=require('moment');var util=require(_0xed68('0x1'));var Redis=require(_0xed68('0x2'));var config=require(_0xed68('0x3'));var logger=require('../../../config/logger')('ami');var ami=require(_0xed68('0x4'));config[_0xed68('0x5')]=_[_0xed68('0x6')](config[_0xed68('0x5')],{'host':_0xed68('0x7'),'port':0x18eb});var io=require(_0xed68('0x8'))(new Redis(config[_0xed68('0x5')]));function VoiceAgentReport(_0x194871){this[_0xed68('0x9')]={};this[_0xed68('0xa')]=_0x194871[_0xed68('0x9')];this[_0xed68('0xb')]=_0x194871[_0xed68('0xb')];this['agents']=_0x194871[_0xed68('0xc')];this[_0xed68('0xd')]={};ami['on'](_0xed68('0xe'),this['syncAgentCalled'][_0xed68('0xf')](this));ami['on'](_0xed68('0x10'),this[_0xed68('0x11')][_0xed68('0xf')](this));ami['on'](_0xed68('0x12'),this[_0xed68('0x13')][_0xed68('0xf')](this));ami['on'](_0xed68('0x14'),this[_0xed68('0x15')][_0xed68('0xf')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0xed68('0xf')](this));ami['on'](_0xed68('0x16'),this[_0xed68('0x17')][_0xed68('0xf')](this));ami['on']('hangup',this[_0xed68('0x18')][_0xed68('0xf')](this));ami['on'](_0xed68('0x19'),this[_0xed68('0x1a')]['bind'](this));ami['on'](_0xed68('0x1b'),this[_0xed68('0x1c')][_0xed68('0xf')](this));ami['on'](_0xed68('0x1d'),this[_0xed68('0x1e')][_0xed68('0xf')](this));ami['on'](_0xed68('0x1f'),this['syncBlindTransfer'][_0xed68('0xf')](this));}VoiceAgentReport[_0xed68('0x20')][_0xed68('0x21')]=function(_0x5362b0,_0x404917,_0xd5949){io['to'](_0x5362b0)[_0xed68('0x21')](_0x404917,_0xd5949);};VoiceAgentReport[_0xed68('0x20')]['isNotNull']=function(_0xcafbc8){return _0xcafbc8!==null&&!_[_0xed68('0x22')](_0xcafbc8);};VoiceAgentReport[_0xed68('0x20')][_0xed68('0x23')]=function(_0x2da6fa){try{if(this['isNotNull'](_0x2da6fa)){logger[_0xed68('0x24')](_0xed68('0x25'),_0x2da6fa[_0xed68('0x26')],_0x2da6fa[_0xed68('0x27')],_0x2da6fa['destuniqueid']);logger[_0xed68('0x28')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x2da6fa[_0xed68('0x26')],util[_0xed68('0x29')](_0x2da6fa,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['channels'][_0x2da6fa[_0xed68('0x26')]])){this[_0xed68('0x9')][_0x2da6fa[_0xed68('0x26')]]={};}var _0x154797=this[_0xed68('0xc')][_0x2da6fa[_0xed68('0x2a')]];var _0x47b249=this[_0xed68('0x9')][_0x2da6fa[_0xed68('0x26')]][_0x2da6fa['destuniqueid']];var _0x228009=this['voiceQueues'][_0x2da6fa[_0xed68('0x2b')]];var _0x3ec856=this[_0xed68('0xd')][_0x2da6fa[_0xed68('0x26')]];if(_['isUndefined'](_0x47b249)){_0x47b249={'agentcalledAt':moment()[_0xed68('0x2c')](_0xed68('0x2d')),'lastevent':_0xed68('0x2e'),'mandatoryDisposition':_0x228009&&_0x228009[_0xed68('0x2f')]?_0x228009[_0xed68('0x2f')]:![],'type':_0x228009&&_0x228009['type']?_0x228009[_0xed68('0x30')]:_0xed68('0x31'),'variables':_0x3ec856,'motionChannel':'voice'};}Object[_0xed68('0x32')](_0x47b249,_[_0xed68('0x33')](_0x2da6fa,[_0xed68('0x34'),'privilege']));this[_0xed68('0x9')][_0x2da6fa['uniqueid']][_0x2da6fa['destuniqueid']]=_0x47b249;logger[_0xed68('0x28')](_0xed68('0x35'),_0x2da6fa['uniqueid'],util[_0xed68('0x29')](_0x47b249,{'showHidden':![],'depth':null}));ami[_0xed68('0x21')]('custom:agentcalled',_0x47b249);var _0x8b6925={'id':_0x154797['id'],'calleridnum':_0x47b249[_0xed68('0x36')],'queue':_0x47b249['queue'],'variables':_0x47b249[_0xed68('0xd')],'uniqueid':_0x2da6fa[_0xed68('0x26')]};logger[_0xed68('0x28')](_0xed68('0x37'),_0x2da6fa['uniqueid'],util['inspect'](_0x8b6925,{'showHidden':![],'depth':null}));this[_0xed68('0x21')](util['format']('user:%s',_0x2da6fa['membername']),_0xed68('0x38'),_0x8b6925);}}catch(_0x2ed36c){logger[_0xed68('0x39')](_0xed68('0x3a'),_0x2da6fa[_0xed68('0x26')],util[_0xed68('0x29')](_0x2ed36c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xed68('0x20')][_0xed68('0x11')]=function(_0x174778){try{if(this['isNotNull'](_0x174778)){if(this[_0xed68('0x9')][_0x174778['uniqueid']]){for(var _0x441fa0 in this[_0xed68('0x9')][_0x174778['uniqueid']]){if(this[_0xed68('0x9')][_0x174778['uniqueid']]['hasOwnProperty'](_0x441fa0)){if(_0x174778[_0xed68('0x3b')]===_0x441fa0){logger[_0xed68('0x24')](_0xed68('0x3c'),_0x174778[_0xed68('0x26')],_0x174778[_0xed68('0x27')],_0x174778[_0xed68('0x3b')]);this[_0xed68('0x9')][_0x174778[_0xed68('0x26')]][_0x441fa0][_0xed68('0x3d')]=moment()[_0xed68('0x2c')](_0xed68('0x2d'));this[_0xed68('0x9')][_0x174778[_0xed68('0x26')]][_0x441fa0]['connectedlinename']=_0x174778[_0xed68('0x3e')];this[_0xed68('0x9')][_0x174778[_0xed68('0x26')]][_0x441fa0][_0xed68('0x3f')]=_0x174778[_0xed68('0x3f')];this[_0xed68('0x9')][_0x174778[_0xed68('0x26')]][_0x441fa0][_0xed68('0x40')]=_0x174778['destchannelstate'];this['channels'][_0x174778[_0xed68('0x26')]][_0x441fa0][_0xed68('0x41')]=_0x174778[_0xed68('0x41')];this[_0xed68('0x9')][_0x174778[_0xed68('0x26')]][_0x441fa0][_0xed68('0x42')]=_0x174778[_0xed68('0x42')];this['channels'][_0x174778[_0xed68('0x26')]][_0x441fa0]['lastevent']=_0xed68('0x43');if(this[_0xed68('0xa')][this[_0xed68('0x9')][_0x174778['uniqueid']][_0x441fa0][_0xed68('0x26')]]){var _0x377549=this[_0xed68('0xa')][this[_0xed68('0x9')][_0x174778['uniqueid']][_0x441fa0][_0xed68('0x26')]]['routealias'];this[_0xed68('0x9')][_0x174778[_0xed68('0x26')]][_0x441fa0][_0xed68('0x44')]=_0x377549;_0x174778[_0xed68('0x44')]=_0x377549;}_['merge'](this['agents'][_0x174778[_0xed68('0x2a')]],_['pick'](_0x174778,[_0xed68('0x2b'),_0xed68('0x45'),_0xed68('0x44')]));var _0x123f47=this[_0xed68('0xc')][_0x174778['interface']];var _0x99f4b2={'id':_0x123f47['id'],'name':_0x123f47[_0xed68('0x46')],'agentconnected':!![],'destaccountcode':_0x123f47[_0xed68('0x47')],'destconnectedlinenum':this[_0xed68('0x9')][_0x174778[_0xed68('0x26')]][_0x174778[_0xed68('0x3b')]][_0xed68('0x48')],'queue':this['channels'][_0x174778[_0xed68('0x26')]][_0x174778[_0xed68('0x3b')]]['queue'],'routealias':this[_0xed68('0x9')][_0x174778[_0xed68('0x26')]][_0x174778[_0xed68('0x3b')]]['routealias'],'uniqueid':this[_0xed68('0x9')][_0x174778['uniqueid']][_0x174778[_0xed68('0x3b')]][_0xed68('0x26')]};ami[_0xed68('0x21')](_0xed68('0x49'),this[_0xed68('0x9')][_0x174778[_0xed68('0x26')]][_0x174778[_0xed68('0x3b')]]);this[_0xed68('0x21')](util['format'](_0xed68('0x4a'),_0x174778[_0xed68('0x27')]),_0xed68('0x4b'),_0x99f4b2);}else if(!this[_0xed68('0x9')][_0x174778[_0xed68('0x26')]][_0x441fa0]['agentringnoanswer']&&!this[_0xed68('0x9')][_0x174778[_0xed68('0x26')]][_0x441fa0][_0xed68('0x4c')]){logger[_0xed68('0x24')](_0xed68('0x4d'),_0x174778[_0xed68('0x26')],this['channels'][_0x174778[_0xed68('0x26')]][_0x441fa0][_0xed68('0x27')],_0x441fa0);this[_0xed68('0x9')][_0x174778[_0xed68('0x26')]][_0x441fa0][_0xed68('0x12')]=!![];this[_0xed68('0x9')][_0x174778[_0xed68('0x26')]][_0x441fa0]['agentringnoanswerAt']=moment()['format'](_0xed68('0x2d'));this[_0xed68('0x9')][_0x174778[_0xed68('0x26')]][_0x441fa0][_0xed68('0x4e')]=_0x174778[_0xed68('0x3b')];this['channels'][_0x174778[_0xed68('0x26')]][_0x441fa0][_0xed68('0x4f')]=_0x174778[_0xed68('0x27')];this['channels'][_0x174778[_0xed68('0x26')]][_0x441fa0][_0xed68('0x50')]=_0xed68('0x51');this[_0xed68('0x9')][_0x174778[_0xed68('0x26')]][_0x441fa0]['reason']=_0xed68('0x51');logger[_0xed68('0x28')](_0xed68('0x52'),_0x174778['uniqueid'],util[_0xed68('0x29')](this['channels'][_0x174778['uniqueid']][_0x441fa0],{'showHidden':![],'depth':null}));ami['emit'](_0xed68('0x53'),this[_0xed68('0x9')][_0x174778[_0xed68('0x26')]][_0x441fa0]);}else{logger[_0xed68('0x28')](_0xed68('0x54'),_0x174778['uniqueid']);}}}}}}catch(_0x49c133){logger[_0xed68('0x39')]('[%s][voiceAgentReport][agentconnect]',_0x174778['uniqueid'],util[_0xed68('0x29')](_0x49c133,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xed68('0x20')][_0xed68('0x13')]=function(_0x459318){try{if(this[_0xed68('0x55')](_0x459318)){logger['debug'](_0xed68('0x56'),_0x459318[_0xed68('0x26')],util[_0xed68('0x29')](_0x459318,{'showHidden':![],'depth':null}));if(this[_0xed68('0x9')][_0x459318[_0xed68('0x26')]]&&this[_0xed68('0x9')][_0x459318[_0xed68('0x26')]][_0x459318['destuniqueid']]){logger['info'](_0xed68('0x57'),_0x459318[_0xed68('0x26')],_0x459318[_0xed68('0x27')],_0x459318[_0xed68('0x3b')]);var _0x2a8f92=this['agents'][_0x459318[_0xed68('0x2a')]];var _0x47cea6=this[_0xed68('0x9')][_0x459318[_0xed68('0x26')]][_0x459318[_0xed68('0x3b')]];_0x47cea6[_0xed68('0x12')]=!![];_0x47cea6[_0xed68('0x58')]=moment()['format'](_0xed68('0x2d'));_0x47cea6[_0xed68('0x50')]=_0xed68('0x59');_0x47cea6[_0xed68('0x5a')]=_0xed68('0x59');var _0x1de701={'id':_0x2a8f92['id'],'name':_0x2a8f92['name'],'queue':_0x47cea6[_0xed68('0x2b')],'uniqueid':_0x47cea6[_0xed68('0x26')]};logger['debug'](_0xed68('0x5b'),_0x459318[_0xed68('0x26')],util['inspect'](_0x1de701,{'showHidden':![],'depth':null}));this[_0xed68('0x21')](util[_0xed68('0x2c')]('user:%s',_0x2a8f92['name']),_0xed68('0x5c'),_0x1de701);ami[_0xed68('0x21')]('custom:agentringnoanswer',_0x47cea6);this[_0xed68('0x9')][_0x459318['uniqueid']][_0x459318[_0xed68('0x3b')]]=Object['assign']({},_0x47cea6);}}}catch(_0x4baa6f){logger[_0xed68('0x39')](_0xed68('0x5d'),_0x459318[_0xed68('0x26')],util['inspect'](_0x4baa6f,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xed68('0x15')]=function(_0x3fc9e7){try{if(this[_0xed68('0x55')](_0x3fc9e7)){logger[_0xed68('0x28')](_0xed68('0x5e'),_0x3fc9e7[_0xed68('0x26')],util[_0xed68('0x29')](_0x3fc9e7,{'showHidden':![],'depth':null}));if(this['channels'][_0x3fc9e7[_0xed68('0x26')]]){for(var _0x1aed16 in this[_0xed68('0x9')][_0x3fc9e7['uniqueid']]){if(this['channels'][_0x3fc9e7[_0xed68('0x26')]]['hasOwnProperty'](_0x1aed16)&&!this[_0xed68('0x9')][_0x3fc9e7['uniqueid']][_0x1aed16][_0xed68('0x12')]&&!this[_0xed68('0x9')][_0x3fc9e7['uniqueid']][_0x1aed16][_0xed68('0x4c')]){logger[_0xed68('0x24')](_0xed68('0x5f'),_0x3fc9e7[_0xed68('0x26')],this[_0xed68('0x9')][_0x3fc9e7[_0xed68('0x26')]][_0x1aed16][_0xed68('0x27')],_0x1aed16);this['channels'][_0x3fc9e7[_0xed68('0x26')]][_0x1aed16][_0xed68('0x12')]=!![];this[_0xed68('0x9')][_0x3fc9e7[_0xed68('0x26')]][_0x1aed16][_0xed68('0x58')]=moment()['format'](_0xed68('0x2d'));this[_0xed68('0x9')][_0x3fc9e7[_0xed68('0x26')]][_0x1aed16][_0xed68('0x50')]=_0xed68('0x60');this['channels'][_0x3fc9e7['uniqueid']][_0x1aed16][_0xed68('0x5a')]=_0xed68('0x60');logger[_0xed68('0x28')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x3fc9e7[_0xed68('0x26')],util[_0xed68('0x29')](this['channels'][_0x3fc9e7['uniqueid']][_0x1aed16],{'showHidden':![],'depth':null}));ami[_0xed68('0x21')](_0xed68('0x61'),this[_0xed68('0x9')][_0x3fc9e7['uniqueid']][_0x1aed16]);}}}}}catch(_0x2d96b2){logger[_0xed68('0x39')](_0xed68('0x62'),_0x3fc9e7[_0xed68('0x26')],util['inspect'](_0x2d96b2,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xed68('0x63')]=function(_0x423271){try{if(this[_0xed68('0x55')](_0x423271)){logger[_0xed68('0x28')](_0xed68('0x64'),_0x423271[_0xed68('0x26')],util[_0xed68('0x29')](_0x423271,{'showHidden':![],'depth':null}));if(this['channels'][_0x423271[_0xed68('0x26')]]){for(var _0x155edc in this['channels'][_0x423271[_0xed68('0x26')]]){if(this[_0xed68('0x9')][_0x423271[_0xed68('0x26')]][_0xed68('0x65')](_0x155edc)){if(this[_0xed68('0x9')][_0x423271['uniqueid']][_0x155edc][_0xed68('0x3d')]&&!this[_0xed68('0x9')][_0x423271[_0xed68('0x26')]][_0x155edc][_0xed68('0x4c')]){logger[_0xed68('0x24')](_0xed68('0x66'),_0x423271['uniqueid'],this['channels'][_0x423271['uniqueid']][_0x155edc][_0xed68('0x27')],_0x155edc);this['channels'][_0x423271[_0xed68('0x26')]][_0x155edc][_0xed68('0x4c')]=!![];this['channels'][_0x423271['uniqueid']][_0x155edc][_0xed68('0x67')]=moment()['format'](_0xed68('0x2d'));this[_0xed68('0x9')][_0x423271['uniqueid']][_0x155edc][_0xed68('0x50')]=_0xed68('0x68');this[_0xed68('0x9')][_0x423271['uniqueid']][_0x155edc][_0xed68('0x5a')]=_0x423271[_0xed68('0x5a')]==_0xed68('0x69')?_0xed68('0x6a'):_0x423271[_0xed68('0x5a')];this['channels'][_0x423271[_0xed68('0x26')]][_0x155edc][_0xed68('0x6b')]=_0x423271[_0xed68('0x6b')];if(this['voiceQueues'][_0x423271[_0xed68('0x2b')]]&&this[_0xed68('0xb')][_0x423271[_0xed68('0x2b')]][_0xed68('0x6c')]){this[_0xed68('0x9')][_0x423271[_0xed68('0x26')]][_0x155edc][_0xed68('0x6d')]=this[_0xed68('0xb')][_0x423271[_0xed68('0x2b')]]['acwTimeout'];this[_0xed68('0x9')][_0x423271['uniqueid']][_0x155edc]['agentacw']=!![];}this['agents'][_0x423271['interface']]=_[_0xed68('0x33')](this[_0xed68('0xc')][_0x423271[_0xed68('0x2a')]],[_0xed68('0x2b'),'destconnectedlinenum']);logger['debug'](_0xed68('0x6e'),_0x423271[_0xed68('0x26')],util['inspect'](this[_0xed68('0x9')][_0x423271[_0xed68('0x26')]][_0x155edc],{'showHidden':![],'depth':null}));ami[_0xed68('0x21')]('custom:agentcomplete',this[_0xed68('0x9')][_0x423271[_0xed68('0x26')]][_0x155edc]);logger[_0xed68('0x28')](_0xed68('0x6f'),_0x423271[_0xed68('0x26')],util[_0xed68('0x29')]({'id':this[_0xed68('0xc')][_0x423271[_0xed68('0x2a')]]['id'],'destaccountcode':_0x423271[_0xed68('0x70')]},{'showHidden':![],'depth':null}));this[_0xed68('0x21')](util[_0xed68('0x2c')](_0xed68('0x4a'),_0x423271[_0xed68('0x27')]),_0xed68('0x71'),{'id':this['agents'][_0x423271['interface']]['id'],'destaccountcode':Number(_0x423271['destaccountcode'])});}}}}}}catch(_0x431f7e){logger[_0xed68('0x39')](_0xed68('0x72'),_0x423271[_0xed68('0x26')],util[_0xed68('0x29')](_0x431f7e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xed68('0x20')][_0xed68('0x17')]=function(_0x4a7e62){try{if(this[_0xed68('0x55')](_0x4a7e62)){logger[_0xed68('0x28')](_0xed68('0x73'),_0x4a7e62[_0xed68('0x26')],util['inspect'](_0x4a7e62,{'showHidden':![],'depth':null}));this['addVariable'](_0x4a7e62['uniqueid'],_['keys'](_0x4a7e62[_0xed68('0x74')])[0x0],_0x4a7e62[_0xed68('0x75')]);if(this[_0xed68('0x9')][_0x4a7e62[_0xed68('0x26')]]){for(var _0x157a72 in this[_0xed68('0x9')][_0x4a7e62[_0xed68('0x26')]]){if(this['channels'][_0x4a7e62[_0xed68('0x26')]]['hasOwnProperty'](_0x157a72)){logger[_0xed68('0x24')](_0xed68('0x76'),_0x4a7e62['uniqueid'],_0x157a72,_[_0xed68('0x77')](_0x4a7e62[_0xed68('0x74')])[0x0],_0x4a7e62['value']);if(_[_0xed68('0x22')](this[_0xed68('0x9')][_0x4a7e62[_0xed68('0x26')]][_0x157a72]['variables'])){this[_0xed68('0x9')][_0x4a7e62[_0xed68('0x26')]][_0x157a72][_0xed68('0xd')]={};}this[_0xed68('0x9')][_0x4a7e62[_0xed68('0x26')]][_0x157a72][_0xed68('0xd')]=this[_0xed68('0xd')][_0x4a7e62[_0xed68('0x26')]];}}}}}catch(_0x4b6b7f){logger['error'](_0xed68('0x78'),_0x4a7e62[_0xed68('0x26')],util[_0xed68('0x29')](_0x4b6b7f,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xed68('0x79')]=function(_0x5acaf2,_0x43dc3a,_0x6e191a){var _0x3bd5c4=[_0xed68('0x7a'),'rtpaudioqosbridged',_0xed68('0x7b'),_0xed68('0x7c'),_0xed68('0x7d'),_0xed68('0x7e'),_0xed68('0x7f'),_0xed68('0x80'),'sipcallid',_0xed68('0x81'),'bridgepeer',_0xed68('0x82'),_0xed68('0x83'),'memberdynamic','memberinterface',_0xed68('0x84'),_0xed68('0x27'),_0xed68('0x85'),'memberrealtime'];if(!_['isNil'](_0x43dc3a)&&!_[_0xed68('0x86')](_0x3bd5c4,_0x43dc3a)){if(_['isUndefined'](this['variables'][_0x5acaf2])){this[_0xed68('0xd')][_0x5acaf2]={};}this[_0xed68('0xd')][_0x5acaf2][_0x43dc3a]=_0x6e191a;}};VoiceAgentReport[_0xed68('0x20')][_0xed68('0x18')]=function(_0x28b97f){try{if(this[_0xed68('0x55')](_0x28b97f)){logger[_0xed68('0x28')](_0xed68('0x87'),_0x28b97f[_0xed68('0x26')],util[_0xed68('0x29')](_0x28b97f,{'showHidden':![],'depth':null}));if(this['channels'][_0x28b97f[_0xed68('0x26')]]){for(var _0x140e14 in this['channels'][_0x28b97f[_0xed68('0x26')]]){if(this[_0xed68('0x9')][_0x28b97f[_0xed68('0x26')]][_0xed68('0x65')](_0x140e14)){if(this[_0xed68('0x9')][_0x28b97f['uniqueid']][_0x140e14]['reason']=='transfer'&&this[_0xed68('0x9')][_0x28b97f[_0xed68('0x26')]][_0x140e14][_0xed68('0x4c')]){logger[_0xed68('0x24')](_0xed68('0x88'),_0x28b97f[_0xed68('0x26')],_0x140e14);this[_0xed68('0x9')][_0x28b97f['uniqueid']][_0x140e14][_0xed68('0x67')]=moment()[_0xed68('0x2c')](_0xed68('0x2d'));}}}logger['debug'](_0xed68('0x89'),_0x28b97f['uniqueid'],util[_0xed68('0x29')](_[_0xed68('0x8a')](this[_0xed68('0x9')][_0x28b97f['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0xed68('0x21')](_0xed68('0x8b'),_['values'](this[_0xed68('0x9')][_0x28b97f[_0xed68('0x26')]]));delete this[_0xed68('0x9')][_0x28b97f['uniqueid']];}if(this[_0xed68('0xd')][_0x28b97f[_0xed68('0x26')]]){delete this['variables'][_0x28b97f['uniqueid']];}}}catch(_0x43dca5){logger[_0xed68('0x39')](_0xed68('0x8c'),_0x28b97f['uniqueid'],util[_0xed68('0x29')](_0x43dca5,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAttendedTransfer']=function(_0x1213e7){try{if(this[_0xed68('0x55')](_0x1213e7)){logger[_0xed68('0x28')](_0xed68('0x8d'),_0x1213e7[_0xed68('0x26')],util[_0xed68('0x29')](_0x1213e7,{'showHidden':![],'depth':null}));if(this[_0xed68('0x9')][_0x1213e7['transfereeuniqueid']]){for(var _0x2f1c2f in this['channels'][_0x1213e7[_0xed68('0x8e')]]){if(this['channels'][_0x1213e7[_0xed68('0x8e')]]['hasOwnProperty'](_0x2f1c2f)){if(_0x1213e7[_0xed68('0x8f')]===_0x2f1c2f){logger[_0xed68('0x24')](_0xed68('0x90'),_0x1213e7['uniqueid'],this[_0xed68('0x9')][_0x1213e7['transfereeuniqueid']][_0x2f1c2f]['membername'],_0x2f1c2f);var _0x42ae3a=moment();this[_0xed68('0x9')][_0x1213e7['transfereeuniqueid']][_0x2f1c2f][_0xed68('0x4c')]=!![];this[_0xed68('0x9')][_0x1213e7['transfereeuniqueid']][_0x2f1c2f][_0xed68('0x67')]=moment()['format'](_0xed68('0x2d'));this['channels'][_0x1213e7[_0xed68('0x8e')]][_0x2f1c2f][_0xed68('0x50')]=_0xed68('0x68');this[_0xed68('0x9')][_0x1213e7[_0xed68('0x8e')]][_0x2f1c2f]['reason']='transfer';this[_0xed68('0x9')][_0x1213e7[_0xed68('0x8e')]][_0x2f1c2f][_0xed68('0x6b')]=_0x42ae3a[_0xed68('0x91')](this[_0xed68('0x9')][_0x1213e7[_0xed68('0x8e')]][_0x2f1c2f][_0xed68('0x3d')],'seconds');}}}}if(this[_0xed68('0x9')][_0x1213e7['secondtransfereruniqueid']]){var _0x2b0dc9=this[_0xed68('0x9')][_0x1213e7[_0xed68('0x92')]];this[_0xed68('0x9')][_0x1213e7[_0xed68('0x92')]]=this['channels'][_0x1213e7['transfereeuniqueid']];this[_0xed68('0x9')][_0x1213e7[_0xed68('0x8e')]]=_0x2b0dc9;}}}catch(_0x19b7cc){logger[_0xed68('0x39')]('[%s][voiceAgentReport][attendedtransfer]',_0x1213e7[_0xed68('0x26')],util['inspect'](_0x19b7cc,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncBlindTransfer']=function(_0x17586b){try{if(this[_0xed68('0x55')](_0x17586b)){logger[_0xed68('0x28')](_0xed68('0x93'),_0x17586b['uniqueid'],util[_0xed68('0x29')](_0x17586b,{'showHidden':![],'depth':null}));if(this[_0xed68('0x9')][_0x17586b[_0xed68('0x8e')]]){for(var _0x453c19 in this[_0xed68('0x9')][_0x17586b[_0xed68('0x8e')]]){if(this[_0xed68('0x9')][_0x17586b['transfereeuniqueid']]['hasOwnProperty'](_0x453c19)){if(_0x17586b['transfereruniqueid']===_0x453c19){logger[_0xed68('0x24')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x17586b['uniqueid'],this[_0xed68('0x9')][_0x17586b[_0xed68('0x8e')]][_0x453c19]['membername'],_0x453c19);var _0x4efebb=moment();this['channels'][_0x17586b[_0xed68('0x8e')]][_0x453c19][_0xed68('0x4c')]=!![];this[_0xed68('0x9')][_0x17586b[_0xed68('0x8e')]][_0x453c19][_0xed68('0x67')]=_0x4efebb;this['channels'][_0x17586b[_0xed68('0x8e')]][_0x453c19][_0xed68('0x50')]=_0xed68('0x68');this['channels'][_0x17586b['transfereeuniqueid']][_0x453c19][_0xed68('0x5a')]=_0xed68('0x69');this['channels'][_0x17586b[_0xed68('0x8e')]][_0x453c19][_0xed68('0x6b')]=_0x4efebb[_0xed68('0x91')](this['channels'][_0x17586b[_0xed68('0x8e')]][_0x453c19][_0xed68('0x3d')],'seconds');}}}}}}catch(_0x1cc7a9){logger[_0xed68('0x39')](_0xed68('0x94'),_0x17586b['uniqueid'],util[_0xed68('0x29')](_0x1cc7a9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xed68('0x20')][_0xed68('0x1a')]=function(_0x7a314b){var _0x2a97f3='';try{if(this[_0xed68('0x55')](_0x7a314b)){logger[_0xed68('0x28')](_0xed68('0x95'),_0x7a314b[_0xed68('0x26')],util[_0xed68('0x29')](_0x7a314b,{'showHidden':![],'depth':null}));if(_0x7a314b[_0xed68('0x96')]){_0x2a97f3=_0x7a314b[_0xed68('0x96')]['substring'](0x0,_0x7a314b[_0xed68('0x96')][_0xed68('0x97')]('-'));if(this[_0xed68('0xc')][_0x2a97f3]){logger['info']('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x7a314b[_0xed68('0x26')],_0x2a97f3);this[_0xed68('0xc')][_0x2a97f3][_0xed68('0x98')]=!![];}}}}catch(_0x18803f){logger[_0xed68('0x39')]('[%s][voiceAgentReport][musiconholdstart]',_0x7a314b[_0xed68('0x26')],util[_0xed68('0x29')](_0x18803f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xed68('0x20')][_0xed68('0x1c')]=function(_0x205064){var _0xbd8fd='';try{if(this[_0xed68('0x55')](_0x205064)){logger[_0xed68('0x28')](_0xed68('0x99'),_0x205064[_0xed68('0x26')],util['inspect'](_0x205064,{'showHidden':![],'depth':null}));if(_0x205064[_0xed68('0x96')]){_0xbd8fd=_0x205064[_0xed68('0x96')]['substring'](0x0,_0x205064[_0xed68('0x96')]['lastIndexOf']('-'));if(this['agents'][_0xbd8fd]){logger[_0xed68('0x24')](_0xed68('0x9a'),_0x205064['uniqueid'],_0xbd8fd);this[_0xed68('0xc')][_0xbd8fd][_0xed68('0x98')]=![];}}}}catch(_0x2128ce){logger['error'](_0xed68('0x9b'),_0x205064['uniqueid'],util['inspect'](_0x2128ce,{'showHidden':![],'depth':null}));}};module[_0xed68('0x9c')]=VoiceAgentReport; \ No newline at end of file +var _0x7e0f=['addVariable','keys','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variable','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','syncHangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','channels','uniqueid','interface','queue','format','called','type','assign','event','privilege','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','membername','user:called','error','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinenum','destchannelstate','holdtime','lastevent','connect','voiceChannels','routealias','merge','destconnectedlinenum','name','accountcode','exten','custom:agentconnect','agentringnoanswer','agentcomplete','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','agentcompleteAt','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','omit','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','[%s][voiceAgentReport][agentcomplete]','syncVarSet'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x7e0f,0x1f4));var _0xf7e0=function(_0x49f821,_0x42767f){_0x49f821=_0x49f821-0x0;var _0x58072f=_0x7e0f[_0x49f821];return _0x58072f;};'use strict';var _=require(_0xf7e0('0x0'));var moment=require(_0xf7e0('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xf7e0('0x2'));var logger=require(_0xf7e0('0x3'))(_0xf7e0('0x4'));var ami=require(_0xf7e0('0x5'));config[_0xf7e0('0x6')]=_[_0xf7e0('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceAgentReport(_0x4c39a1){this['channels']={};this['voiceChannels']=_0x4c39a1['channels'];this[_0xf7e0('0x8')]=_0x4c39a1[_0xf7e0('0x8')];this[_0xf7e0('0x9')]=_0x4c39a1[_0xf7e0('0x9')];this[_0xf7e0('0xa')]={};ami['on'](_0xf7e0('0xb'),this[_0xf7e0('0xc')][_0xf7e0('0xd')](this));ami['on'](_0xf7e0('0xe'),this[_0xf7e0('0xf')][_0xf7e0('0xd')](this));ami['on']('agentringnoanswer',this[_0xf7e0('0x10')][_0xf7e0('0xd')](this));ami['on'](_0xf7e0('0x11'),this[_0xf7e0('0x12')][_0xf7e0('0xd')](this));ami['on']('agentcomplete',this[_0xf7e0('0x13')]['bind'](this));ami['on'](_0xf7e0('0x14'),this['syncVarSet'][_0xf7e0('0xd')](this));ami['on']('hangup',this[_0xf7e0('0x15')][_0xf7e0('0xd')](this));ami['on'](_0xf7e0('0x16'),this[_0xf7e0('0x17')][_0xf7e0('0xd')](this));ami['on']('musiconholdstop',this[_0xf7e0('0x18')][_0xf7e0('0xd')](this));ami['on'](_0xf7e0('0x19'),this['syncAttendedTransfer'][_0xf7e0('0xd')](this));ami['on'](_0xf7e0('0x1a'),this[_0xf7e0('0x1b')][_0xf7e0('0xd')](this));}VoiceAgentReport[_0xf7e0('0x1c')][_0xf7e0('0x1d')]=function(_0x2564ea,_0x3a994a,_0xe4be8c){io['to'](_0x2564ea)['emit'](_0x3a994a,_0xe4be8c);};VoiceAgentReport[_0xf7e0('0x1c')][_0xf7e0('0x1e')]=function(_0x50933e){return _0x50933e!==null&&!_[_0xf7e0('0x1f')](_0x50933e);};VoiceAgentReport[_0xf7e0('0x1c')][_0xf7e0('0xc')]=function(_0x41125d){try{if(this[_0xf7e0('0x1e')](_0x41125d)){logger['info']('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x41125d['uniqueid'],_0x41125d['membername'],_0x41125d['destuniqueid']);logger[_0xf7e0('0x20')](_0xf7e0('0x21'),_0x41125d['uniqueid'],util[_0xf7e0('0x22')](_0x41125d,{'showHidden':![],'depth':null}));if(_[_0xf7e0('0x1f')](this[_0xf7e0('0x23')][_0x41125d[_0xf7e0('0x24')]])){this[_0xf7e0('0x23')][_0x41125d[_0xf7e0('0x24')]]={};}var _0x4f20d4=this['agents'][_0x41125d[_0xf7e0('0x25')]];var _0x1c958c=this[_0xf7e0('0x23')][_0x41125d[_0xf7e0('0x24')]][_0x41125d['destuniqueid']];var _0x112130=this[_0xf7e0('0x8')][_0x41125d[_0xf7e0('0x26')]];var _0x18661f=this['variables'][_0x41125d['uniqueid']];if(_[_0xf7e0('0x1f')](_0x1c958c)){_0x1c958c={'agentcalledAt':moment()[_0xf7e0('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xf7e0('0x28'),'mandatoryDisposition':_0x112130&&_0x112130['mandatoryDisposition']?_0x112130['mandatoryDisposition']:![],'type':_0x112130&&_0x112130[_0xf7e0('0x29')]?_0x112130[_0xf7e0('0x29')]:'inbound','variables':_0x18661f,'motionChannel':'voice'};}Object[_0xf7e0('0x2a')](_0x1c958c,_['omit'](_0x41125d,[_0xf7e0('0x2b'),_0xf7e0('0x2c')]));this['channels'][_0x41125d['uniqueid']][_0x41125d[_0xf7e0('0x2d')]]=_0x1c958c;logger[_0xf7e0('0x20')](_0xf7e0('0x2e'),_0x41125d[_0xf7e0('0x24')],util[_0xf7e0('0x22')](_0x1c958c,{'showHidden':![],'depth':null}));ami[_0xf7e0('0x1d')](_0xf7e0('0x2f'),_0x1c958c);var _0x29847a={'id':_0x4f20d4['id'],'calleridnum':_0x1c958c[_0xf7e0('0x30')],'queue':_0x1c958c[_0xf7e0('0x26')],'variables':_0x1c958c[_0xf7e0('0xa')],'uniqueid':_0x41125d[_0xf7e0('0x24')]};logger['debug'](_0xf7e0('0x31'),_0x41125d[_0xf7e0('0x24')],util['inspect'](_0x29847a,{'showHidden':![],'depth':null}));this[_0xf7e0('0x1d')](util['format'](_0xf7e0('0x32'),_0x41125d[_0xf7e0('0x33')]),_0xf7e0('0x34'),_0x29847a);}}catch(_0x4a2c6c){logger[_0xf7e0('0x35')]('[%s][voiceAgentReport][agentcalled]',_0x41125d[_0xf7e0('0x24')],util[_0xf7e0('0x22')](_0x4a2c6c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf7e0('0x1c')][_0xf7e0('0xf')]=function(_0x3bcf3b){try{if(this['isNotNull'](_0x3bcf3b)){if(this['channels'][_0x3bcf3b[_0xf7e0('0x24')]]){for(var _0x319f56 in this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]]){if(this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0xf7e0('0x36')](_0x319f56)){if(_0x3bcf3b['destuniqueid']===_0x319f56){logger['info'](_0xf7e0('0x37'),_0x3bcf3b[_0xf7e0('0x24')],_0x3bcf3b['membername'],_0x3bcf3b['destuniqueid']);this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56][_0xf7e0('0x38')]=moment()['format'](_0xf7e0('0x39'));this[_0xf7e0('0x23')][_0x3bcf3b['uniqueid']][_0x319f56]['connectedlinename']=_0x3bcf3b['connectedlinename'];this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56]['connectedlinenum']=_0x3bcf3b[_0xf7e0('0x3a')];this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56][_0xf7e0('0x3b')]=_0x3bcf3b[_0xf7e0('0x3b')];this['channels'][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56]['destchannelstatedesc']=_0x3bcf3b['destchannelstatedesc'];this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56][_0xf7e0('0x3c')]=_0x3bcf3b[_0xf7e0('0x3c')];this['channels'][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56][_0xf7e0('0x3d')]=_0xf7e0('0x3e');if(this['voiceChannels'][this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56][_0xf7e0('0x24')]]){var _0x31454b=this[_0xf7e0('0x3f')][this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56][_0xf7e0('0x24')]]['routealias'];this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56][_0xf7e0('0x40')]=_0x31454b;_0x3bcf3b['routealias']=_0x31454b;}_[_0xf7e0('0x41')](this['agents'][_0x3bcf3b[_0xf7e0('0x25')]],_['pick'](_0x3bcf3b,['queue',_0xf7e0('0x42'),'routealias']));var _0x4f02b9=this[_0xf7e0('0x9')][_0x3bcf3b[_0xf7e0('0x25')]];var _0x50c920={'id':_0x4f02b9['id'],'name':_0x4f02b9[_0xf7e0('0x43')],'agentconnected':!![],'destaccountcode':_0x4f02b9[_0xf7e0('0x44')],'destconnectedlinenum':this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x3bcf3b['destuniqueid']][_0xf7e0('0x45')],'queue':this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x3bcf3b[_0xf7e0('0x2d')]][_0xf7e0('0x26')],'routealias':this[_0xf7e0('0x23')][_0x3bcf3b['uniqueid']][_0x3bcf3b['destuniqueid']][_0xf7e0('0x40')],'uniqueid':this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x3bcf3b[_0xf7e0('0x2d')]][_0xf7e0('0x24')]};ami[_0xf7e0('0x1d')](_0xf7e0('0x46'),this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x3bcf3b['destuniqueid']]);this['emit'](util[_0xf7e0('0x27')](_0xf7e0('0x32'),_0x3bcf3b[_0xf7e0('0x33')]),'user:agentconnect',_0x50c920);}else if(!this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56][_0xf7e0('0x47')]&&!this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56][_0xf7e0('0x48')]){logger[_0xf7e0('0x49')](_0xf7e0('0x4a'),_0x3bcf3b[_0xf7e0('0x24')],this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56]['membername'],_0x319f56);this['channels'][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56][_0xf7e0('0x47')]=!![];this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56][_0xf7e0('0x4b')]=moment()[_0xf7e0('0x27')](_0xf7e0('0x39'));this[_0xf7e0('0x23')][_0x3bcf3b['uniqueid']][_0x319f56][_0xf7e0('0x4c')]=_0x3bcf3b[_0xf7e0('0x2d')];this[_0xf7e0('0x23')][_0x3bcf3b['uniqueid']][_0x319f56][_0xf7e0('0x4d')]=_0x3bcf3b[_0xf7e0('0x33')];this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56][_0xf7e0('0x3d')]=_0xf7e0('0x4e');this['channels'][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56][_0xf7e0('0x4f')]=_0xf7e0('0x4e');logger['debug'](_0xf7e0('0x50'),_0x3bcf3b[_0xf7e0('0x24')],util[_0xf7e0('0x22')](this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56],{'showHidden':![],'depth':null}));ami['emit'](_0xf7e0('0x51'),this[_0xf7e0('0x23')][_0x3bcf3b[_0xf7e0('0x24')]][_0x319f56]);}else{logger[_0xf7e0('0x20')]('[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken',_0x3bcf3b[_0xf7e0('0x24')]);}}}}}}catch(_0x339b06){logger[_0xf7e0('0x35')]('[%s][voiceAgentReport][agentconnect]',_0x3bcf3b[_0xf7e0('0x24')],util[_0xf7e0('0x22')](_0x339b06,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf7e0('0x1c')][_0xf7e0('0x10')]=function(_0x3d08b9){try{if(this[_0xf7e0('0x1e')](_0x3d08b9)){logger['debug'](_0xf7e0('0x52'),_0x3d08b9[_0xf7e0('0x24')],util['inspect'](_0x3d08b9,{'showHidden':![],'depth':null}));if(this['channels'][_0x3d08b9[_0xf7e0('0x24')]]&&this[_0xf7e0('0x23')][_0x3d08b9[_0xf7e0('0x24')]][_0x3d08b9[_0xf7e0('0x2d')]]){logger[_0xf7e0('0x49')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x3d08b9[_0xf7e0('0x24')],_0x3d08b9[_0xf7e0('0x33')],_0x3d08b9['destuniqueid']);var _0x2abd68=this['agents'][_0x3d08b9[_0xf7e0('0x25')]];var _0x328ec6=this[_0xf7e0('0x23')][_0x3d08b9[_0xf7e0('0x24')]][_0x3d08b9[_0xf7e0('0x2d')]];_0x328ec6[_0xf7e0('0x47')]=!![];_0x328ec6[_0xf7e0('0x4b')]=moment()[_0xf7e0('0x27')]('YYYY-MM-DD\x20HH:mm:ss');_0x328ec6[_0xf7e0('0x3d')]=_0xf7e0('0x53');_0x328ec6['reason']=_0xf7e0('0x53');var _0x1f553c={'id':_0x2abd68['id'],'name':_0x2abd68[_0xf7e0('0x43')],'queue':_0x328ec6[_0xf7e0('0x26')],'uniqueid':_0x328ec6['uniqueid']};logger[_0xf7e0('0x20')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x3d08b9[_0xf7e0('0x24')],util[_0xf7e0('0x22')](_0x1f553c,{'showHidden':![],'depth':null}));this['emit'](util[_0xf7e0('0x27')](_0xf7e0('0x32'),_0x2abd68['name']),_0xf7e0('0x54'),_0x1f553c);ami['emit'](_0xf7e0('0x55'),_0x328ec6);this[_0xf7e0('0x23')][_0x3d08b9[_0xf7e0('0x24')]][_0x3d08b9[_0xf7e0('0x2d')]]=Object[_0xf7e0('0x2a')]({},_0x328ec6);}}}catch(_0x32b155){logger['error'](_0xf7e0('0x56'),_0x3d08b9[_0xf7e0('0x24')],util[_0xf7e0('0x22')](_0x32b155,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xf7e0('0x12')]=function(_0x458b9d){try{if(this[_0xf7e0('0x1e')](_0x458b9d)){logger[_0xf7e0('0x20')](_0xf7e0('0x57'),_0x458b9d['uniqueid'],util[_0xf7e0('0x22')](_0x458b9d,{'showHidden':![],'depth':null}));if(this[_0xf7e0('0x23')][_0x458b9d['uniqueid']]){for(var _0x238f1a in this[_0xf7e0('0x23')][_0x458b9d[_0xf7e0('0x24')]]){if(this[_0xf7e0('0x23')][_0x458b9d[_0xf7e0('0x24')]][_0xf7e0('0x36')](_0x238f1a)&&!this[_0xf7e0('0x23')][_0x458b9d['uniqueid']][_0x238f1a][_0xf7e0('0x47')]&&!this[_0xf7e0('0x23')][_0x458b9d['uniqueid']][_0x238f1a][_0xf7e0('0x48')]){logger[_0xf7e0('0x49')](_0xf7e0('0x58'),_0x458b9d[_0xf7e0('0x24')],this['channels'][_0x458b9d[_0xf7e0('0x24')]][_0x238f1a][_0xf7e0('0x33')],_0x238f1a);this[_0xf7e0('0x23')][_0x458b9d[_0xf7e0('0x24')]][_0x238f1a][_0xf7e0('0x47')]=!![];this[_0xf7e0('0x23')][_0x458b9d['uniqueid']][_0x238f1a]['agentringnoanswerAt']=moment()[_0xf7e0('0x27')](_0xf7e0('0x39'));this[_0xf7e0('0x23')][_0x458b9d[_0xf7e0('0x24')]][_0x238f1a][_0xf7e0('0x3d')]='abandoned';this['channels'][_0x458b9d[_0xf7e0('0x24')]][_0x238f1a][_0xf7e0('0x4f')]='abandoned';logger[_0xf7e0('0x20')](_0xf7e0('0x59'),_0x458b9d[_0xf7e0('0x24')],util['inspect'](this[_0xf7e0('0x23')][_0x458b9d[_0xf7e0('0x24')]][_0x238f1a],{'showHidden':![],'depth':null}));ami[_0xf7e0('0x1d')](_0xf7e0('0x5a'),this[_0xf7e0('0x23')][_0x458b9d[_0xf7e0('0x24')]][_0x238f1a]);}}}}}catch(_0x37ffb2){logger[_0xf7e0('0x35')]('[%s][voiceAgentReport][queuecallerabandon]',_0x458b9d[_0xf7e0('0x24')],util[_0xf7e0('0x22')](_0x37ffb2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf7e0('0x1c')][_0xf7e0('0x13')]=function(_0x550070){try{if(this[_0xf7e0('0x1e')](_0x550070)){logger[_0xf7e0('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x550070[_0xf7e0('0x24')],util[_0xf7e0('0x22')](_0x550070,{'showHidden':![],'depth':null}));if(this[_0xf7e0('0x23')][_0x550070['uniqueid']]){for(var _0x261ed5 in this[_0xf7e0('0x23')][_0x550070[_0xf7e0('0x24')]]){if(this[_0xf7e0('0x23')][_0x550070[_0xf7e0('0x24')]][_0xf7e0('0x36')](_0x261ed5)){if(this[_0xf7e0('0x23')][_0x550070[_0xf7e0('0x24')]][_0x261ed5][_0xf7e0('0x38')]&&!this[_0xf7e0('0x23')][_0x550070[_0xf7e0('0x24')]][_0x261ed5][_0xf7e0('0x48')]){logger[_0xf7e0('0x49')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x550070[_0xf7e0('0x24')],this[_0xf7e0('0x23')][_0x550070[_0xf7e0('0x24')]][_0x261ed5][_0xf7e0('0x33')],_0x261ed5);this['channels'][_0x550070[_0xf7e0('0x24')]][_0x261ed5][_0xf7e0('0x48')]=!![];this['channels'][_0x550070[_0xf7e0('0x24')]][_0x261ed5][_0xf7e0('0x5b')]=moment()[_0xf7e0('0x27')](_0xf7e0('0x39'));this[_0xf7e0('0x23')][_0x550070[_0xf7e0('0x24')]][_0x261ed5][_0xf7e0('0x3d')]='complete';this[_0xf7e0('0x23')][_0x550070[_0xf7e0('0x24')]][_0x261ed5][_0xf7e0('0x4f')]=_0x550070[_0xf7e0('0x4f')]==_0xf7e0('0x5c')?_0xf7e0('0x5d'):_0x550070[_0xf7e0('0x4f')];this[_0xf7e0('0x23')][_0x550070[_0xf7e0('0x24')]][_0x261ed5]['talktime']=_0x550070[_0xf7e0('0x5e')];if(this[_0xf7e0('0x8')][_0x550070[_0xf7e0('0x26')]]&&this[_0xf7e0('0x8')][_0x550070[_0xf7e0('0x26')]][_0xf7e0('0x5f')]){this['channels'][_0x550070[_0xf7e0('0x24')]][_0x261ed5][_0xf7e0('0x60')]=this[_0xf7e0('0x8')][_0x550070[_0xf7e0('0x26')]][_0xf7e0('0x61')];this[_0xf7e0('0x23')][_0x550070['uniqueid']][_0x261ed5][_0xf7e0('0x62')]=!![];}this[_0xf7e0('0x9')][_0x550070['interface']]=_[_0xf7e0('0x63')](this[_0xf7e0('0x9')][_0x550070[_0xf7e0('0x25')]],[_0xf7e0('0x26'),_0xf7e0('0x42')]);logger[_0xf7e0('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x550070[_0xf7e0('0x24')],util[_0xf7e0('0x22')](this[_0xf7e0('0x23')][_0x550070['uniqueid']][_0x261ed5],{'showHidden':![],'depth':null}));ami[_0xf7e0('0x1d')]('custom:agentcomplete',this[_0xf7e0('0x23')][_0x550070['uniqueid']][_0x261ed5]);logger[_0xf7e0('0x20')](_0xf7e0('0x64'),_0x550070[_0xf7e0('0x24')],util[_0xf7e0('0x22')]({'id':this[_0xf7e0('0x9')][_0x550070[_0xf7e0('0x25')]]['id'],'destaccountcode':_0x550070['destaccountcode']},{'showHidden':![],'depth':null}));this[_0xf7e0('0x1d')](util[_0xf7e0('0x27')](_0xf7e0('0x32'),_0x550070[_0xf7e0('0x33')]),'user:agentcomplete',{'id':this[_0xf7e0('0x9')][_0x550070[_0xf7e0('0x25')]]['id'],'destaccountcode':Number(_0x550070[_0xf7e0('0x65')])});}}}}}}catch(_0x4c780f){logger[_0xf7e0('0x35')](_0xf7e0('0x66'),_0x550070['uniqueid'],util['inspect'](_0x4c780f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf7e0('0x1c')][_0xf7e0('0x67')]=function(_0x1b8d89){try{if(this[_0xf7e0('0x1e')](_0x1b8d89)){logger[_0xf7e0('0x20')]('[%s][voiceAgentReport][varset]\x20event:',_0x1b8d89['uniqueid'],util[_0xf7e0('0x22')](_0x1b8d89,{'showHidden':![],'depth':null}));this[_0xf7e0('0x68')](_0x1b8d89[_0xf7e0('0x24')],_[_0xf7e0('0x69')](_0x1b8d89['variable'])[0x0],_0x1b8d89[_0xf7e0('0x6a')]);if(this[_0xf7e0('0x23')][_0x1b8d89['uniqueid']]){for(var _0x17be0e in this[_0xf7e0('0x23')][_0x1b8d89[_0xf7e0('0x24')]]){if(this[_0xf7e0('0x23')][_0x1b8d89[_0xf7e0('0x24')]][_0xf7e0('0x36')](_0x17be0e)){logger[_0xf7e0('0x49')](_0xf7e0('0x6b'),_0x1b8d89[_0xf7e0('0x24')],_0x17be0e,_[_0xf7e0('0x69')](_0x1b8d89[_0xf7e0('0x6c')])[0x0],_0x1b8d89[_0xf7e0('0x6a')]);if(_[_0xf7e0('0x1f')](this[_0xf7e0('0x23')][_0x1b8d89[_0xf7e0('0x24')]][_0x17be0e][_0xf7e0('0xa')])){this[_0xf7e0('0x23')][_0x1b8d89['uniqueid']][_0x17be0e][_0xf7e0('0xa')]={};}this[_0xf7e0('0x23')][_0x1b8d89[_0xf7e0('0x24')]][_0x17be0e]['variables']=this[_0xf7e0('0xa')][_0x1b8d89[_0xf7e0('0x24')]];}}}}}catch(_0x5df013){logger[_0xf7e0('0x35')](_0xf7e0('0x6d'),_0x1b8d89[_0xf7e0('0x24')],util[_0xf7e0('0x22')](_0x5df013,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xf7e0('0x68')]=function(_0x5c83ad,_0x5dee72,_0x1adcdc){var _0xbc81f=[_0xf7e0('0x6e'),_0xf7e0('0x6f'),_0xf7e0('0x70'),_0xf7e0('0x71'),_0xf7e0('0x72'),_0xf7e0('0x73'),_0xf7e0('0x74'),_0xf7e0('0x75'),'sipcallid',_0xf7e0('0x76'),_0xf7e0('0x77'),'bridgepvtcallid','membercalls','memberdynamic',_0xf7e0('0x78'),_0xf7e0('0x79'),_0xf7e0('0x33'),_0xf7e0('0x7a'),_0xf7e0('0x7b')];if(!_[_0xf7e0('0x7c')](_0x5dee72)&&!_[_0xf7e0('0x7d')](_0xbc81f,_0x5dee72)){if(_[_0xf7e0('0x1f')](this[_0xf7e0('0xa')][_0x5c83ad])){this[_0xf7e0('0xa')][_0x5c83ad]={};}this[_0xf7e0('0xa')][_0x5c83ad][_0x5dee72]=_0x1adcdc;}};VoiceAgentReport['prototype'][_0xf7e0('0x15')]=function(_0x4993e4){try{if(this[_0xf7e0('0x1e')](_0x4993e4)){logger[_0xf7e0('0x20')]('[%s][voiceAgentReport][hangup]\x20event:',_0x4993e4[_0xf7e0('0x24')],util['inspect'](_0x4993e4,{'showHidden':![],'depth':null}));if(this['channels'][_0x4993e4[_0xf7e0('0x24')]]){for(var _0x400d39 in this[_0xf7e0('0x23')][_0x4993e4[_0xf7e0('0x24')]]){if(this[_0xf7e0('0x23')][_0x4993e4['uniqueid']]['hasOwnProperty'](_0x400d39)){if(this['channels'][_0x4993e4['uniqueid']][_0x400d39][_0xf7e0('0x4f')]=='transfer'&&this[_0xf7e0('0x23')][_0x4993e4[_0xf7e0('0x24')]][_0x400d39][_0xf7e0('0x48')]){logger[_0xf7e0('0x49')](_0xf7e0('0x7e'),_0x4993e4[_0xf7e0('0x24')],_0x400d39);this[_0xf7e0('0x23')][_0x4993e4[_0xf7e0('0x24')]][_0x400d39]['agentcompleteAt']=moment()[_0xf7e0('0x27')](_0xf7e0('0x39'));}}}logger[_0xf7e0('0x20')](_0xf7e0('0x7f'),_0x4993e4[_0xf7e0('0x24')],util[_0xf7e0('0x22')](_[_0xf7e0('0x80')](this[_0xf7e0('0x23')][_0x4993e4[_0xf7e0('0x24')]]),{'showHidden':![],'depth':null}));ami[_0xf7e0('0x1d')](_0xf7e0('0x81'),_['values'](this[_0xf7e0('0x23')][_0x4993e4['uniqueid']]));delete this['channels'][_0x4993e4['uniqueid']];}if(this[_0xf7e0('0xa')][_0x4993e4[_0xf7e0('0x24')]]){delete this[_0xf7e0('0xa')][_0x4993e4[_0xf7e0('0x24')]];}}}catch(_0x12e822){logger[_0xf7e0('0x35')](_0xf7e0('0x82'),_0x4993e4[_0xf7e0('0x24')],util[_0xf7e0('0x22')](_0x12e822,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xf7e0('0x83')]=function(_0x3d8232){try{if(this[_0xf7e0('0x1e')](_0x3d8232)){logger['debug'](_0xf7e0('0x84'),_0x3d8232[_0xf7e0('0x24')],util[_0xf7e0('0x22')](_0x3d8232,{'showHidden':![],'depth':null}));if(this[_0xf7e0('0x23')][_0x3d8232['transfereeuniqueid']]){for(var _0x182f57 in this[_0xf7e0('0x23')][_0x3d8232[_0xf7e0('0x85')]]){if(this[_0xf7e0('0x23')][_0x3d8232['transfereeuniqueid']][_0xf7e0('0x36')](_0x182f57)){if(_0x3d8232['origtransfereruniqueid']===_0x182f57){logger[_0xf7e0('0x49')](_0xf7e0('0x86'),_0x3d8232[_0xf7e0('0x24')],this[_0xf7e0('0x23')][_0x3d8232[_0xf7e0('0x85')]][_0x182f57][_0xf7e0('0x33')],_0x182f57);var _0x2746ff=moment();this['channels'][_0x3d8232[_0xf7e0('0x85')]][_0x182f57][_0xf7e0('0x48')]=!![];this[_0xf7e0('0x23')][_0x3d8232['transfereeuniqueid']][_0x182f57][_0xf7e0('0x5b')]=moment()['format'](_0xf7e0('0x39'));this[_0xf7e0('0x23')][_0x3d8232['transfereeuniqueid']][_0x182f57][_0xf7e0('0x3d')]=_0xf7e0('0x87');this[_0xf7e0('0x23')][_0x3d8232[_0xf7e0('0x85')]][_0x182f57]['reason']='transfer';this['channels'][_0x3d8232[_0xf7e0('0x85')]][_0x182f57][_0xf7e0('0x5e')]=_0x2746ff[_0xf7e0('0x88')](this['channels'][_0x3d8232[_0xf7e0('0x85')]][_0x182f57]['agentconnectAt'],_0xf7e0('0x89'));}}}}if(this[_0xf7e0('0x23')][_0x3d8232[_0xf7e0('0x8a')]]){var _0x719b4=this[_0xf7e0('0x23')][_0x3d8232[_0xf7e0('0x8a')]];this[_0xf7e0('0x23')][_0x3d8232[_0xf7e0('0x8a')]]=this[_0xf7e0('0x23')][_0x3d8232[_0xf7e0('0x85')]];this[_0xf7e0('0x23')][_0x3d8232[_0xf7e0('0x85')]]=_0x719b4;}}}catch(_0x4ebc96){logger[_0xf7e0('0x35')]('[%s][voiceAgentReport][attendedtransfer]',_0x3d8232[_0xf7e0('0x24')],util[_0xf7e0('0x22')](_0x4ebc96,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf7e0('0x1c')][_0xf7e0('0x1b')]=function(_0x49d94e){try{if(this[_0xf7e0('0x1e')](_0x49d94e)){logger[_0xf7e0('0x20')](_0xf7e0('0x8b'),_0x49d94e[_0xf7e0('0x24')],util[_0xf7e0('0x22')](_0x49d94e,{'showHidden':![],'depth':null}));if(this[_0xf7e0('0x23')][_0x49d94e[_0xf7e0('0x85')]]){for(var _0x14bd4b in this[_0xf7e0('0x23')][_0x49d94e[_0xf7e0('0x85')]]){if(this[_0xf7e0('0x23')][_0x49d94e[_0xf7e0('0x85')]][_0xf7e0('0x36')](_0x14bd4b)){if(_0x49d94e[_0xf7e0('0x8c')]===_0x14bd4b){logger[_0xf7e0('0x49')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x49d94e[_0xf7e0('0x24')],this[_0xf7e0('0x23')][_0x49d94e['transfereeuniqueid']][_0x14bd4b][_0xf7e0('0x33')],_0x14bd4b);var _0x11f13e=moment();this[_0xf7e0('0x23')][_0x49d94e['transfereeuniqueid']][_0x14bd4b][_0xf7e0('0x48')]=!![];this['channels'][_0x49d94e[_0xf7e0('0x85')]][_0x14bd4b][_0xf7e0('0x5b')]=_0x11f13e;this[_0xf7e0('0x23')][_0x49d94e[_0xf7e0('0x85')]][_0x14bd4b]['lastevent']=_0xf7e0('0x87');this[_0xf7e0('0x23')][_0x49d94e[_0xf7e0('0x85')]][_0x14bd4b][_0xf7e0('0x4f')]=_0xf7e0('0x5c');this[_0xf7e0('0x23')][_0x49d94e[_0xf7e0('0x85')]][_0x14bd4b][_0xf7e0('0x5e')]=_0x11f13e['diff'](this[_0xf7e0('0x23')][_0x49d94e[_0xf7e0('0x85')]][_0x14bd4b][_0xf7e0('0x38')],'seconds');}}}}}}catch(_0x4e918b){logger[_0xf7e0('0x35')](_0xf7e0('0x8d'),_0x49d94e[_0xf7e0('0x24')],util[_0xf7e0('0x22')](_0x4e918b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf7e0('0x1c')][_0xf7e0('0x17')]=function(_0x121245){var _0x1a59f7='';try{if(this[_0xf7e0('0x1e')](_0x121245)){logger[_0xf7e0('0x20')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x121245[_0xf7e0('0x24')],util[_0xf7e0('0x22')](_0x121245,{'showHidden':![],'depth':null}));if(_0x121245[_0xf7e0('0x8e')]){_0x1a59f7=_0x121245[_0xf7e0('0x8e')][_0xf7e0('0x8f')](0x0,_0x121245[_0xf7e0('0x8e')][_0xf7e0('0x90')]('-'));if(this[_0xf7e0('0x9')][_0x1a59f7]){logger['info'](_0xf7e0('0x91'),_0x121245[_0xf7e0('0x24')],_0x1a59f7);this[_0xf7e0('0x9')][_0x1a59f7][_0xf7e0('0x92')]=!![];}}}}catch(_0x4c0c27){logger[_0xf7e0('0x35')]('[%s][voiceAgentReport][musiconholdstart]',_0x121245['uniqueid'],util[_0xf7e0('0x22')](_0x4c0c27,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf7e0('0x1c')][_0xf7e0('0x18')]=function(_0x386299){var _0x3b0a80='';try{if(this[_0xf7e0('0x1e')](_0x386299)){logger[_0xf7e0('0x20')](_0xf7e0('0x93'),_0x386299['uniqueid'],util[_0xf7e0('0x22')](_0x386299,{'showHidden':![],'depth':null}));if(_0x386299[_0xf7e0('0x8e')]){_0x3b0a80=_0x386299[_0xf7e0('0x8e')][_0xf7e0('0x8f')](0x0,_0x386299[_0xf7e0('0x8e')][_0xf7e0('0x90')]('-'));if(this['agents'][_0x3b0a80]){logger['info'](_0xf7e0('0x94'),_0x386299[_0xf7e0('0x24')],_0x3b0a80);this[_0xf7e0('0x9')][_0x3b0a80][_0xf7e0('0x92')]=![];}}}}catch(_0x3a44f2){logger[_0xf7e0('0x35')](_0xf7e0('0x95'),_0x386299[_0xf7e0('0x24')],util['inspect'](_0x3a44f2,{'showHidden':![],'depth':null}));}};module[_0xf7e0('0x96')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index e562465..112f991 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8903=['syncVarSet','hangup','syncHangup','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','emit','uniqueid','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','isUndefined','merge','pick','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','[%s][voiceCallReport][newcallerid]','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','disposition','toNumber','keys','undefined','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','name','user:agentconnect','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','duration','seconds','lastapplication','lastdata','cdr(','match','type','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','answered','answertime','YYYY-MM-DD\x20HH:mm:ss','holdtime','connectedlinename','destinationchannel','channelstate','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','monitorFilename','find','monitors','rec','variable','mixmonitor_filename','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','syncMixMonitorFilename','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','diff','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','resolve','then','transferType','transferToInternal','isEmpty','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','outbound','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','BLIND','BlindTransfer','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','[%s][voiceCallReport][musiconholdstop]','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../model/channel','set','queue','dial','voicemail','FAILED','NO\x20ANSWER','ANSWERED','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','syncNewChannel','newstate','syncNewState','varset'];(function(_0x4ddc12,_0x1ec9b2){var _0x12a6ba=function(_0x3f3941){while(--_0x3f3941){_0x4ddc12['push'](_0x4ddc12['shift']());}};_0x12a6ba(++_0x1ec9b2);}(_0x8903,0xa7));var _0x3890=function(_0x1fc82b,_0x5150a6){_0x1fc82b=_0x1fc82b-0x0;var _0x4c6679=_0x8903[_0x1fc82b];return _0x4c6679;};'use strict';var _=require(_0x3890('0x0'));var moment=require(_0x3890('0x1'));var util=require(_0x3890('0x2'));var path=require(_0x3890('0x3'));var Redis=require(_0x3890('0x4'));var config=require(_0x3890('0x5'));var logger=require(_0x3890('0x6'))(_0x3890('0x7'));var ami=require('../ami');var Channel=require(_0x3890('0x8'));var RpcSetting=require('../rpc/setting');var applications=[_0x3890('0x9'),_0x3890('0xa'),'agi',_0x3890('0xb'),'playback',_0x3890('0xc')];var dispositions=['NO\x20ANSWER',_0x3890('0xd'),_0x3890('0xd'),_0x3890('0xe'),_0x3890('0xe'),_0x3890('0xe'),_0x3890('0xf'),'BUSY',_0x3890('0xd'),_0x3890('0xd'),_0x3890('0xd')];config[_0x3890('0x10')]=_['defaults'](config[_0x3890('0x10')],{'host':_0x3890('0x11'),'port':0x18eb});var io=require(_0x3890('0x12'))(new Redis(config[_0x3890('0x10')]));function VoiceCallReport(_0x4795e1){this[_0x3890('0x13')]=_0x4795e1[_0x3890('0x13')];this[_0x3890('0x14')]=_0x4795e1[_0x3890('0x14')];this[_0x3890('0x15')]={};ami['on'](_0x3890('0x16'),this[_0x3890('0x17')][_0x3890('0x18')](this));ami['on'](_0x3890('0x19'),this[_0x3890('0x17')]['bind'](this));ami['on']('newchannel',this[_0x3890('0x1a')]['bind'](this));ami['on'](_0x3890('0x1b'),this[_0x3890('0x1c')][_0x3890('0x18')](this));ami['on'](_0x3890('0x1d'),this[_0x3890('0x1e')]['bind'](this));ami['on'](_0x3890('0x1f'),this[_0x3890('0x20')]['bind'](this));ami['on']('newcallerid',this[_0x3890('0x21')][_0x3890('0x18')](this));ami['on']('attendedtransfer',this[_0x3890('0x22')]['bind'](this));ami['on'](_0x3890('0x23'),this[_0x3890('0x24')][_0x3890('0x18')](this));ami['on'](_0x3890('0x25'),this[_0x3890('0x26')][_0x3890('0x18')](this));ami['on'](_0x3890('0x27'),this[_0x3890('0x28')]['bind'](this));try{logger[_0x3890('0x29')](_0x3890('0x2a'));ami[_0x3890('0x2b')]();}catch(_0xcd837c){logger[_0x3890('0x2c')](_0x3890('0x2d'),util[_0x3890('0x2e')](_0xcd837c,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x3890('0x2f')][_0x3890('0x30')]=function(_0x502834){return _0x502834!==null&&!_['isUndefined'](_0x502834);};VoiceCallReport[_0x3890('0x2f')][_0x3890('0x31')]=function(_0x186a84,_0x41fef3,_0x4b7648){io['to'](_0x186a84)[_0x3890('0x31')](_0x41fef3,_0x4b7648);};VoiceCallReport[_0x3890('0x2f')][_0x3890('0x21')]=function(_0x58de6c){try{if(this[_0x3890('0x30')](_0x58de6c)){logger[_0x3890('0x29')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x58de6c[_0x3890('0x32')],_0x58de6c['calleridname'],_0x58de6c['calleridnum']);logger[_0x3890('0x33')](_0x3890('0x34'),_0x58de6c[_0x3890('0x32')],util[_0x3890('0x2e')](_0x58de6c,{'showHidden':![],'depth':null}));if(_0x58de6c[_0x3890('0x32')]===_0x58de6c[_0x3890('0x35')]){if(!_[_0x3890('0x36')](this[_0x3890('0x13')][_0x58de6c['uniqueid']])){_[_0x3890('0x37')](this[_0x3890('0x13')][_0x58de6c[_0x3890('0x32')]],_[_0x3890('0x38')](_0x58de6c,_['keys'](this['channels'][_0x58de6c[_0x3890('0x32')]])));}}if(_0x58de6c[_0x3890('0x39')]===_0x3890('0x3a')){var _0x4b87d5=this[_0x3890('0x14')][_0x58de6c[_0x3890('0x3b')][_0x3890('0x3c')]('-')[0x0]];if(_0x4b87d5){if(_0x58de6c[_0x3890('0x3d')]==_0x3890('0x3e')){_0x4b87d5[_0x3890('0x3f')]=_0x58de6c[_0x3890('0x40')];this[_0x3890('0x31')](util[_0x3890('0x41')](_0x3890('0x42'),_0x4b87d5['name']),'user:agentconnect',{'id':_0x4b87d5['id'],'destaccountcode':_0x4b87d5['accountcode'],'destconnectedlinenum':_0x58de6c['connectedlinenum']});}}}}}catch(_0x1b8968){logger[_0x3890('0x2c')](_0x3890('0x43'),_0x58de6c[_0x3890('0x32')],util[_0x3890('0x2e')](_0x1b8968,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3890('0x2f')]['syncNewChannel']=function(_0x2806f1){try{if(this[_0x3890('0x30')](_0x2806f1)){logger[_0x3890('0x33')]('[%s][voiceCallReport][newchannel]\x20event:',_0x2806f1[_0x3890('0x32')],util[_0x3890('0x2e')](_0x2806f1,{'showHidden':![],'depth':null}));if(this[_0x3890('0x13')][_0x2806f1['uniqueid']]){return;}if(_0x2806f1[_0x3890('0x3b')]===_0x3890('0x44')){return;}if(_0x2806f1[_0x3890('0x32')]!==_0x2806f1[_0x3890('0x35')]&&!this[_0x3890('0x15')][_0x2806f1[_0x3890('0x35')]]){return;}logger['info'](_0x3890('0x45'),_0x2806f1[_0x3890('0x32')],_0x2806f1[_0x3890('0x39')],_0x2806f1['exten']);this[_0x3890('0x13')][_0x2806f1[_0x3890('0x32')]]=new Channel();this[_0x3890('0x13')][_0x2806f1['uniqueid']][_0x3890('0x46')]=moment()[_0x3890('0x41')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x2806f1[_0x3890('0x32')]][_0x3890('0x47')]=dispositions[_[_0x3890('0x48')](_0x2806f1['channelstate'])];_[_0x3890('0x37')](this[_0x3890('0x13')][_0x2806f1['uniqueid']],_['pick'](_0x2806f1,_[_0x3890('0x49')](this[_0x3890('0x13')][_0x2806f1[_0x3890('0x32')]])));if(_0x2806f1[_0x3890('0x39')]===_0x3890('0x3a')){var _0x49eb59=this[_0x3890('0x14')][_0x2806f1['channel'][_0x3890('0x3c')]('-')[0x0]];if(_0x49eb59&&typeof _0x49eb59[_0x3890('0x3f')]===_0x3890('0x4a')){_0x49eb59[_0x3890('0x3f')]=_0x2806f1['exten'];logger['debug'](_0x3890('0x4b'),_0x2806f1['uniqueid'],util[_0x3890('0x2e')]({'id':_0x49eb59['id'],'destaccountcode':_0x49eb59[_0x3890('0x4c')],'destconnectedlinenum':_0x2806f1[_0x3890('0x3d')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x3890('0x41')](_0x3890('0x42'),_0x49eb59[_0x3890('0x4d')]),_0x3890('0x4e'),{'id':_0x49eb59['id'],'destaccountcode':_0x49eb59[_0x3890('0x4c')],'destconnectedlinenum':_0x2806f1[_0x3890('0x3d')]});}}}}catch(_0x55efb5){logger[_0x3890('0x2c')](_0x3890('0x4f'),_0x2806f1[_0x3890('0x32')],util[_0x3890('0x2e')](_0x55efb5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3890('0x2f')][_0x3890('0x17')]=function(_0x2a72c3){try{if(this[_0x3890('0x30')](_0x2a72c3)){logger[_0x3890('0x33')](_0x3890('0x50'),_0x2a72c3['uniqueid'],util[_0x3890('0x2e')](_0x2a72c3,{'showHidden':![],'depth':null}));if(_0x2a72c3[_0x3890('0x3b')]===_0x3890('0x44')||_0x2a72c3[_0x3890('0x3d')]==='h')return;if(_0x2a72c3[_0x3890('0x32')]===_0x2a72c3['linkedid']||this[_0x3890('0x15')][_0x2a72c3[_0x3890('0x35')]]){_0x2a72c3[_0x3890('0x51')]=_0x2a72c3[_0x3890('0x51')]?_0x2a72c3[_0x3890('0x51')][_0x3890('0x52')]():undefined;_0x2a72c3[_0x3890('0x53')]=_0x2a72c3[_0x3890('0x54')]||_0x2a72c3[_0x3890('0x53')];if(_0x2a72c3[_0x3890('0x54')]&&!_0x2a72c3[_0x3890('0x54')][_0x3890('0x55')](_0x3890('0x56'))&&_0x2a72c3[_0x3890('0x51')]!==_0x3890('0xa')){_0x2a72c3['applicationdata']=_0x2a72c3[_0x3890('0x53')]['toLowerCase']();}logger[_0x3890('0x29')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x2a72c3[_0x3890('0x32')],_0x2a72c3[_0x3890('0x51')],_0x2a72c3[_0x3890('0x53')]);if(_[_0x3890('0x36')](this[_0x3890('0x13')][_0x2a72c3[_0x3890('0x32')]])){this['channels'][_0x2a72c3[_0x3890('0x32')]]=new Channel();this[_0x3890('0x13')][_0x2a72c3['uniqueid']][_0x3890('0x46')]=_0x2a72c3[_0x3890('0x57')]?moment()['subtract'](moment['duration'](_0x2a72c3[_0x3890('0x57')])['seconds'](),_0x3890('0x58'))[_0x3890('0x41')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x3890('0x41')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x2a72c3[_0x3890('0x32')]][_0x3890('0x47')]=_0x3890('0xe');}_['merge'](this[_0x3890('0x13')][_0x2a72c3[_0x3890('0x32')]],_[_0x3890('0x38')](_0x2a72c3,_['keys'](this[_0x3890('0x13')][_0x2a72c3[_0x3890('0x32')]])));if(_['includes'](applications,_0x2a72c3[_0x3890('0x51')])){this[_0x3890('0x13')][_0x2a72c3[_0x3890('0x32')]][_0x3890('0x59')]=_0x2a72c3['application'];this[_0x3890('0x13')][_0x2a72c3[_0x3890('0x32')]][_0x3890('0x5a')]=_0x2a72c3[_0x3890('0x53')];if(_0x2a72c3['application']===_0x3890('0x9')&&_[_0x3890('0x55')](_0x2a72c3[_0x3890('0x53')][_0x3890('0x52')](),_0x3890('0x5b'))){var _0x31e391=_0x2a72c3['applicationdata']['split']('=');var _0x389bd6=_0x31e391[0x0][_0x3890('0x52')]()[_0x3890('0x5c')](/cdr\((.*)\)/);if(_0x389bd6){if(_0x389bd6[0x1]===_0x3890('0x5d')&&!_[_0x3890('0x5e')](this[_0x3890('0x13')][_0x2a72c3['uniqueid']][_0x389bd6[0x1]]))return;this[_0x3890('0x13')][_0x2a72c3[_0x3890('0x32')]][_0x389bd6[0x1]]=_0x31e391[0x1];}}else if(_0x2a72c3[_0x3890('0x51')]===_0x3890('0xa')){this[_0x3890('0x13')][_0x2a72c3['uniqueid']]['queue']=_0x2a72c3[_0x3890('0x53')][_0x3890('0x3c')](',')[0x0];}}}}}catch(_0x53bc70){logger[_0x3890('0x2c')](_0x3890('0x5f'),_0x2a72c3[_0x3890('0x32')],util['inspect'](_0x53bc70,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3890('0x2f')][_0x3890('0x1c')]=function(_0x3a2428){try{if(this[_0x3890('0x30')](_0x3a2428)){logger[_0x3890('0x29')](_0x3890('0x60'),_0x3a2428[_0x3890('0x32')],_0x3a2428[_0x3890('0x35')],_0x3a2428[_0x3890('0x61')],_0x3a2428[_0x3890('0x62')]);logger['debug']('[%s][voiceCallReport][newstate]\x20event:',_0x3a2428[_0x3890('0x32')],util['inspect'](_0x3a2428,{'showHidden':![],'depth':null}));if(_0x3a2428['channelstate']!=='6')return;var _0x41b25e=this[_0x3890('0x14')][_0x3a2428[_0x3890('0x3b')][_0x3890('0x3c')]('-')[0x0]];if(_0x3a2428[_0x3890('0x32')]!==_0x3a2428[_0x3890('0x35')]){var _0x2207d2=moment();if(this['channels'][_0x3a2428[_0x3890('0x35')]]){if(!this['channels'][_0x3a2428['linkedid']][_0x3890('0x63')]){this[_0x3890('0x13')][_0x3a2428[_0x3890('0x35')]]['answered']=!![];this[_0x3890('0x13')][_0x3a2428['linkedid']][_0x3890('0x64')]=_0x2207d2[_0x3890('0x41')](_0x3890('0x65'));if(this[_0x3890('0x13')][_0x3a2428['linkedid']][_0x3890('0x46')]){this['channels'][_0x3a2428[_0x3890('0x35')]][_0x3890('0x66')]=_0x2207d2['diff'](this['channels'][_0x3a2428['linkedid']][_0x3890('0x46')],_0x3890('0x58'));}}this[_0x3890('0x13')][_0x3a2428[_0x3890('0x35')]][_0x3890('0x35')]=_0x3a2428[_0x3890('0x32')];if(_0x3a2428[_0x3890('0x62')]!==_0x3890('0x3e')){this['channels'][_0x3a2428['linkedid']]['connectedlinenum']=_0x3a2428[_0x3890('0x62')];}this['channels'][_0x3a2428['linkedid']][_0x3890('0x67')]=_0x3a2428[_0x3890('0x61')];this[_0x3890('0x13')][_0x3a2428['linkedid']][_0x3890('0x68')]=_0x3a2428[_0x3890('0x3b')];this['channels'][_0x3a2428[_0x3890('0x35')]]['disposition']=dispositions[_[_0x3890('0x48')](_0x3a2428[_0x3890('0x69')])];if(_0x41b25e){this[_0x3890('0x13')][_0x3a2428[_0x3890('0x35')]][_0x3890('0x6a')]=_0x41b25e['id'];this[_0x3890('0x13')][_0x3a2428[_0x3890('0x35')]][_0x3890('0x6b')]=_0x41b25e[_0x3890('0x4d')];}}if(this[_0x3890('0x13')][_0x3a2428[_0x3890('0x32')]]){if(!this[_0x3890('0x13')][_0x3a2428['uniqueid']][_0x3890('0x63')]){this['channels'][_0x3a2428[_0x3890('0x32')]][_0x3890('0x63')]=!![];this[_0x3890('0x13')][_0x3a2428[_0x3890('0x32')]]['answertime']=_0x2207d2[_0x3890('0x41')](_0x3890('0x65'));if(this[_0x3890('0x13')][_0x3a2428[_0x3890('0x32')]][_0x3890('0x46')]){this[_0x3890('0x13')][_0x3a2428[_0x3890('0x32')]]['holdtime']=_0x2207d2['diff'](this[_0x3890('0x13')][_0x3a2428[_0x3890('0x32')]][_0x3890('0x46')],_0x3890('0x58'));}}if(_0x3a2428[_0x3890('0x62')]!=='xcally-motion-preview'){this[_0x3890('0x13')][_0x3a2428['uniqueid']][_0x3890('0x40')]=_0x3a2428[_0x3890('0x62')];}this['channels'][_0x3a2428[_0x3890('0x32')]][_0x3890('0x67')]=_0x3a2428[_0x3890('0x61')];this[_0x3890('0x13')][_0x3a2428[_0x3890('0x32')]][_0x3890('0x68')]=_0x3a2428[_0x3890('0x3b')];this[_0x3890('0x13')][_0x3a2428[_0x3890('0x32')]][_0x3890('0x47')]=dispositions[_[_0x3890('0x48')](_0x3a2428[_0x3890('0x69')])];}}else{if(this[_0x3890('0x13')][_0x3a2428[_0x3890('0x32')]]){if(_0x41b25e){this['channels'][_0x3a2428[_0x3890('0x32')]][_0x3890('0x6a')]=_0x41b25e['id'];this['channels'][_0x3a2428[_0x3890('0x32')]][_0x3890('0x6b')]=_0x41b25e[_0x3890('0x4d')];}}}if(_0x3a2428['context']===_0x3890('0x3a')){if(_0x41b25e){_0x41b25e[_0x3890('0x3f')]=_0x3a2428[_0x3890('0x3d')];var _0x42c7ac,_0x3d9caf;if(this['channels'][_0x3a2428['uniqueid']]){_0x42c7ac=this[_0x3890('0x13')][_0x3a2428[_0x3890('0x32')]][_0x3890('0x6c')];_0x3d9caf=this['channels'][_0x3a2428[_0x3890('0x32')]][_0x3890('0xa')];}else if(this[_0x3890('0x13')][_0x3a2428['linkedid']]){_0x42c7ac=this[_0x3890('0x13')][_0x3a2428['linkedid']][_0x3890('0x6c')];_0x3d9caf=this[_0x3890('0x13')][_0x3a2428[_0x3890('0x35')]][_0x3890('0xa')];}_0x41b25e[_0x3890('0xa')]=_0x3d9caf;_0x41b25e['routealias']=_0x42c7ac;var _0x10ffe5={'id':_0x41b25e['id'],'name':_0x41b25e[_0x3890('0x4d')],'agentconnected':!![],'destaccountcode':_0x41b25e[_0x3890('0x4c')],'destconnectedlinenum':_0x3a2428['exten'],'queue':_0x3d9caf||undefined,'routealias':_0x42c7ac,'uniqueid':_0x3a2428[_0x3890('0x35')]};logger[_0x3890('0x33')](_0x3890('0x6d'),_0x3a2428[_0x3890('0x32')],util['inspect'](_0x10ffe5,{'showHidden':![],'depth':null}));this['emit'](util[_0x3890('0x41')]('user:%s',_0x41b25e['name']),_0x3890('0x4e'),_0x10ffe5);}}}}catch(_0x4a4ccf){logger[_0x3890('0x2c')](_0x3890('0x6e'),_0x3a2428[_0x3890('0x32')],util[_0x3890('0x2e')](_0x4a4ccf,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMixMonitorFilename']=function(_0x13f4e1,_0x281b17){try{if(this[_0x3890('0x13')][_0x13f4e1]){logger[_0x3890('0x29')](_0x3890('0x6f'),_0x13f4e1,_0x281b17);this[_0x3890('0x13')][_0x13f4e1][_0x3890('0x70')]=!![];if(_[_0x3890('0x71')](_0x281b17,_0x3890('0x72'))){_0x281b17=_0x281b17[_0x3890('0x73')](_0x3890('0x72'),'.WAV');}this[_0x3890('0x13')][_0x13f4e1][_0x3890('0x74')]=_0x281b17;var _0x1a736c=_[_0x3890('0x75')](this['channels'][_0x13f4e1][_0x3890('0x76')],{'filename':_0x281b17});if(_[_0x3890('0x5e')](_0x1a736c)){this[_0x3890('0x13')][_0x13f4e1][_0x3890('0x76')]['push']({'filename':_0x281b17,'createdAt':moment()['format'](_0x3890('0x65')),'mixmonitorid':'','status':_0x3890('0x77')});}}}catch(_0x5e53d5){logger['error']('[%s][voiceCallReport][mixMonitorFilename]',_0x13f4e1,util[_0x3890('0x2e')](_0x5e53d5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3890('0x2f')][_0x3890('0x1e')]=function(_0x4b8818){try{if(this[_0x3890('0x30')](_0x4b8818)){logger[_0x3890('0x33')]('[%s][voiceCallReport][varset]\x20event:',_0x4b8818[_0x3890('0x32')],util[_0x3890('0x2e')](_0x4b8818,{'showHidden':![],'depth':null}));if(this['channels'][_0x4b8818[_0x3890('0x32')]]&&_0x4b8818['channel']!='OutgoingSpoolFailed'){if(this[_0x3890('0x30')](_0x4b8818[_0x3890('0x78')])){if(this[_0x3890('0x30')](_0x4b8818[_0x3890('0x78')][_0x3890('0x79')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x4b8818[_0x3890('0x32')],_0x4b8818[_0x3890('0x7a')]);this['syncMixMonitorFilename'](_0x4b8818[_0x3890('0x32')],_0x4b8818[_0x3890('0x7a')]);}else if(this['isNotNull'](_0x4b8818[_0x3890('0x78')][_0x3890('0x7b')])){logger[_0x3890('0x29')](_0x3890('0x7c'),_0x4b8818[_0x3890('0x32')],_0x4b8818[_0x3890('0x7a')]);this[_0x3890('0x13')][_0x4b8818[_0x3890('0x32')]][_0x3890('0x62')]=_0x4b8818[_0x3890('0x7a')];}else if(this[_0x3890('0x30')](_0x4b8818[_0x3890('0x78')]['xmd-callerid'])){logger[_0x3890('0x29')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x4b8818[_0x3890('0x32')],_0x4b8818[_0x3890('0x7a')]);this[_0x3890('0x13')][_0x4b8818[_0x3890('0x32')]]['callerid']=_0x4b8818[_0x3890('0x7a')];}else if(this[_0x3890('0x30')](_0x4b8818[_0x3890('0x78')][_0x3890('0x7d')])){logger['info'](_0x3890('0x7e'),_0x4b8818[_0x3890('0x32')],_0x4b8818['value']);this[_0x3890('0x13')][_0x4b8818['uniqueid']][_0x3890('0x5d')]=_0x4b8818[_0x3890('0x7a')];}else if(this[_0x3890('0x30')](_0x4b8818[_0x3890('0x78')][_0x3890('0x7f')])){logger[_0x3890('0x29')](_0x3890('0x80'),_0x4b8818['uniqueid'],_0x4b8818[_0x3890('0x7a')][_0x3890('0x3c')](',')[0x0]);this['channels'][_0x4b8818[_0x3890('0x32')]]['queue']=_0x4b8818[_0x3890('0x7a')][_0x3890('0x3c')](',')[0x0];}else if(this['isNotNull'](_0x4b8818['variable'][_0x3890('0x81')])){logger[_0x3890('0x29')](_0x3890('0x82'),_0x4b8818['uniqueid'],_0x4b8818[_0x3890('0x7a')]);this[_0x3890('0x13')][_0x4b8818[_0x3890('0x32')]][_0x3890('0x83')]=_0x4b8818[_0x3890('0x7a')];}else if(this[_0x3890('0x30')](_0x4b8818[_0x3890('0x78')][_0x3890('0x84')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x4b8818[_0x3890('0x32')],_0x4b8818[_0x3890('0x7a')]);this[_0x3890('0x13')][_0x4b8818[_0x3890('0x32')]][_0x3890('0x85')]=_0x4b8818[_0x3890('0x7a')];}else if(this['isNotNull'](_0x4b8818[_0x3890('0x78')][_0x3890('0x86')])){logger[_0x3890('0x29')](_0x3890('0x87'),_0x4b8818[_0x3890('0x32')],_0x4b8818[_0x3890('0x7a')]);this[_0x3890('0x13')][_0x4b8818['uniqueid']]['calleridpreview']=_0x4b8818[_0x3890('0x7a')];}else if(this[_0x3890('0x30')](_0x4b8818[_0x3890('0x78')][_0x3890('0x88')])){logger['info'](_0x3890('0x89'),_0x4b8818[_0x3890('0x32')],_0x4b8818[_0x3890('0x7a')]);this['channels'][_0x4b8818['uniqueid']]['queue']=_0x4b8818[_0x3890('0x7a')];}else if(this['isNotNull'](_0x4b8818['variable'][_0x3890('0x8a')])){logger[_0x3890('0x29')](_0x3890('0x8b'),_0x4b8818[_0x3890('0x32')],_0x4b8818[_0x3890('0x7a')]);this['channels'][_0x4b8818[_0x3890('0x32')]][_0x3890('0x8c')]=_0x4b8818['value'];}}}else if(this[_0x3890('0x30')](_0x4b8818[_0x3890('0x78')][_0x3890('0x79')])){if(_0x4b8818[_0x3890('0x7a')]){var _0x483255=path[_0x3890('0x8d')](_0x4b8818[_0x3890('0x7a')])[_0x3890('0x4d')];logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x483255,_0x4b8818['value']);this[_0x3890('0x8e')](_0x483255,_0x4b8818[_0x3890('0x7a')]);}}else if(this[_0x3890('0x13')][_0x4b8818['linkedid']]){if(this[_0x3890('0x30')](_0x4b8818[_0x3890('0x78')])){if(this[_0x3890('0x30')](_0x4b8818['variable']['sipcallid'])){logger['info'](_0x3890('0x8b'),_0x4b8818[_0x3890('0x35')],_0x4b8818['value']);this['channels'][_0x4b8818[_0x3890('0x35')]]['sipcalllinkedid']=_0x4b8818[_0x3890('0x7a')];}}}}}catch(_0x492968){logger[_0x3890('0x2c')]('[%s][voiceCallReport][varset]',_0x4b8818[_0x3890('0x32')],util[_0x3890('0x2e')](_0x492968,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncHangup']=function(_0x65ac31){try{if(this[_0x3890('0x30')](_0x65ac31)){logger['debug'](_0x3890('0x8f'),_0x65ac31[_0x3890('0x32')],util[_0x3890('0x2e')](_0x65ac31,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x65ac31['linkedid']]){if(this[_0x3890('0x13')][this[_0x3890('0x15')][_0x65ac31[_0x3890('0x35')]]['linkedid']]){this[_0x3890('0x13')][this[_0x3890('0x15')][_0x65ac31['linkedid']][_0x3890('0x35')]][_0x3890('0x32')]=_0x65ac31[_0x3890('0x32')];this[_0x3890('0x13')][this[_0x3890('0x15')][_0x65ac31[_0x3890('0x35')]][_0x3890('0x35')]]['answered']=this[_0x3890('0x13')][_0x65ac31[_0x3890('0x32')]][_0x3890('0x63')];this[_0x3890('0x13')][this[_0x3890('0x15')][_0x65ac31['linkedid']][_0x3890('0x35')]][_0x3890('0x64')]=this[_0x3890('0x13')][_0x65ac31[_0x3890('0x32')]]['answertime'];this['channels'][this[_0x3890('0x15')][_0x65ac31[_0x3890('0x35')]]['linkedid']][_0x3890('0x68')]=this[_0x3890('0x13')][this[_0x3890('0x15')][_0x65ac31[_0x3890('0x35')]][_0x3890('0x35')]][_0x3890('0x3b')];this[_0x3890('0x13')][this[_0x3890('0x15')][_0x65ac31[_0x3890('0x35')]]['linkedid']]['disposition']=this[_0x3890('0x13')][_0x65ac31['uniqueid']]['disposition'];this['channels'][_0x65ac31[_0x3890('0x32')]]=this[_0x3890('0x13')][this['blindTransfers'][_0x65ac31[_0x3890('0x35')]]['linkedid']];delete this['channels'][this[_0x3890('0x15')][_0x65ac31[_0x3890('0x35')]][_0x3890('0x35')]];}else if(this[_0x3890('0x13')][this[_0x3890('0x15')][_0x65ac31[_0x3890('0x35')]][_0x3890('0x32')]]){this[_0x3890('0x13')][this['blindTransfers'][_0x65ac31[_0x3890('0x35')]][_0x3890('0x32')]][_0x3890('0x32')]=[this['channels'][this[_0x3890('0x15')][_0x65ac31['linkedid']]['uniqueid']][_0x3890('0x35')],this[_0x3890('0x13')][this[_0x3890('0x15')][_0x65ac31[_0x3890('0x35')]][_0x3890('0x32')]]['linkedid']=this[_0x3890('0x13')][this['blindTransfers'][_0x65ac31[_0x3890('0x35')]][_0x3890('0x32')]]['uniqueid']][0x0];this[_0x3890('0x13')][this[_0x3890('0x15')][_0x65ac31['linkedid']][_0x3890('0x32')]][_0x3890('0x63')]=this[_0x3890('0x13')][_0x65ac31[_0x3890('0x32')]]['answered'];this[_0x3890('0x13')][this['blindTransfers'][_0x65ac31[_0x3890('0x35')]][_0x3890('0x32')]][_0x3890('0x64')]=this['channels'][_0x65ac31['uniqueid']][_0x3890('0x64')];this[_0x3890('0x13')][this[_0x3890('0x15')][_0x65ac31['linkedid']][_0x3890('0x32')]][_0x3890('0x68')]=this[_0x3890('0x13')][this[_0x3890('0x15')][_0x65ac31[_0x3890('0x35')]][_0x3890('0x32')]][_0x3890('0x3b')];this['channels'][this['blindTransfers'][_0x65ac31[_0x3890('0x35')]][_0x3890('0x32')]]['disposition']=this[_0x3890('0x13')][_0x65ac31[_0x3890('0x32')]][_0x3890('0x47')];this[_0x3890('0x13')][_0x65ac31[_0x3890('0x32')]]=this[_0x3890('0x13')][this['blindTransfers'][_0x65ac31[_0x3890('0x35')]][_0x3890('0x32')]];delete this[_0x3890('0x13')][this[_0x3890('0x15')][_0x65ac31[_0x3890('0x35')]][_0x3890('0x32')]];}}if(this[_0x3890('0x13')][_0x65ac31[_0x3890('0x32')]]){logger[_0x3890('0x29')](_0x3890('0x90'),_0x65ac31[_0x3890('0x32')],_0x65ac31[_0x3890('0x91')]);var _0x26dc5b=moment();this['channels'][_0x65ac31[_0x3890('0x32')]][_0x3890('0x92')]=_0x26dc5b[_0x3890('0x41')](_0x3890('0x65'));this[_0x3890('0x13')][_0x65ac31['uniqueid']][_0x3890('0x57')]=_0x26dc5b[_0x3890('0x93')](this['channels'][_0x65ac31[_0x3890('0x32')]][_0x3890('0x46')],_0x3890('0x58'));if(this[_0x3890('0x13')][_0x65ac31[_0x3890('0x32')]][_0x3890('0x63')]){this[_0x3890('0x13')][_0x65ac31[_0x3890('0x32')]]['billableseconds']=_0x26dc5b['diff'](this[_0x3890('0x13')][_0x65ac31[_0x3890('0x32')]][_0x3890('0x64')],_0x3890('0x58'));this['channels'][_0x65ac31[_0x3890('0x32')]][_0x3890('0x66')]=this['channels'][_0x65ac31[_0x3890('0x32')]]['duration']-this[_0x3890('0x13')][_0x65ac31[_0x3890('0x32')]][_0x3890('0x94')];}if(_0x65ac31[_0x3890('0x39')]===_0x3890('0x3a')){if(this[_0x3890('0x14')][_0x65ac31[_0x3890('0x3b')]['split']('-')[0x0]]){this['agents'][_0x65ac31[_0x3890('0x3b')][_0x3890('0x3c')]('-')[0x0]]=_['omit'](this[_0x3890('0x14')][_0x65ac31['channel'][_0x3890('0x3c')]('-')[0x0]],['destconnectedlinenum']);logger['debug'](_0x3890('0x95'),_0x65ac31[_0x3890('0x32')],util[_0x3890('0x2e')]({'id':this[_0x3890('0x14')][_0x65ac31['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0x3890('0x14')][_0x65ac31[_0x3890('0x3b')][_0x3890('0x3c')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x3890('0x42'),this[_0x3890('0x14')][_0x65ac31[_0x3890('0x3b')]['split']('-')[0x0]]['name']),_0x3890('0x96'),{'id':this['agents'][_0x65ac31[_0x3890('0x3b')][_0x3890('0x3c')]('-')[0x0]]['id'],'destaccountcode':this[_0x3890('0x14')][_0x65ac31[_0x3890('0x3b')][_0x3890('0x3c')]('-')[0x0]][_0x3890('0x4c')]});for(var _0x51078b=0x0;_0x51078b0x0?!![]:![];if(!_0x19795c){return this[_0xfa7c('0x1a')](this[_0xfa7c('0x14')][_0xfa7c('0x6f')]);}};VoiceQueueReport[_0xfa7c('0x37')]['syncQueueMember']=function(_0x2390b4){var _0x88887=this[_0xfa7c('0x14')]['id'];if(this[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x88887]&&this[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x88887][_0x2390b4[_0xfa7c('0x60')]]){this[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x88887][_0x2390b4[_0xfa7c('0x60')]][_0xfa7c('0x11')][_0xfa7c('0x70')](_0x2390b4);}};VoiceQueueReport[_0xfa7c('0x37')]['syncQueueSummary']=function(_0x231591){var _0x40dac8=this;try{if(this[_0xfa7c('0x5c')](_0x231591)&&this[_0xfa7c('0x5c')](_0x231591[_0xfa7c('0x4f')])){logger[_0xfa7c('0x4a')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xfa7c('0x42')](_0x231591,{'showHidden':![],'depth':null}));var _0x16a14e=this[_0xfa7c('0x12')][_0x231591[_0xfa7c('0x4f')]];if(_0x16a14e){logger[_0xfa7c('0x4a')](_0xfa7c('0x71'),_0x16a14e['name']);this['summary'][_0xfa7c('0x64')][_0x16a14e[_0xfa7c('0x5a')]]={'summaryEvent':_0x231591};this[_0xfa7c('0x14')][_0xfa7c('0x6e')]+=0x1;return ami[_0xfa7c('0x3c')]({'action':_0xfa7c('0x62'),'queue':_0x16a14e[_0xfa7c('0x5a')]})[_0xfa7c('0x5f')](function(_0x327729){if(!_0x40dac8[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x231591['actionid']]){_0x40dac8[_0xfa7c('0x14')]['queuestatus'][_0x231591[_0xfa7c('0x60')]]={};}_0x40dac8[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x231591['actionid']][_0x327729['actionid']]={'queue':_0x16a14e[_0xfa7c('0x5a')],'agents':[]};})[_0xfa7c('0x3f')](function(_0xe6e478){throw _0xe6e478;});}}}catch(_0x57d71b){logger[_0xfa7c('0x40')](_0xfa7c('0x63'),util['inspect'](_0x57d71b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x1a')]=function(_0xff23c2){if(this[_0xfa7c('0x14')]['statusRequests']>0x0){this[_0xfa7c('0x14')]['completeEvent']=_0xff23c2;return;}logger[_0xfa7c('0x4a')](_0xfa7c('0x72'),util[_0xfa7c('0x42')](_0xff23c2,{'showHidden':![],'depth':null}));this[_0xfa7c('0x14')]=initializeSummary();ami['emit'](_0xfa7c('0x73'),{});};VoiceQueueReport[_0xfa7c('0x37')]['syncQueueCallerJoin']=function(_0xb167ce){try{if(this['isNotNull'](_0xb167ce)){logger['debug'](_0xfa7c('0x74'),_0xb167ce['uniqueid'],util[_0xfa7c('0x42')](_0xb167ce,{'showHidden':![],'depth':null}));if(_[_0xfa7c('0x5d')](this[_0xfa7c('0x10')][_0xb167ce[_0xfa7c('0x4c')]])){this[_0xfa7c('0x10')][_0xb167ce['uniqueid']]=[];}if(_[_0xfa7c('0x5d')](this[_0xfa7c('0x39')][_0xb167ce[_0xfa7c('0x4c')]])){this['channels'][_0xb167ce['uniqueid']]={};}var _0xc444a9=new QueueReport();_0xc444a9[_0xfa7c('0x4f')]=_0xb167ce[_0xfa7c('0x4f')];_0xc444a9[_0xfa7c('0x57')]=this[_0xfa7c('0x12')][_0xc444a9[_0xfa7c('0x4f')]]&&this[_0xfa7c('0x12')][_0xc444a9[_0xfa7c('0x4f')]][_0xfa7c('0x57')]?this[_0xfa7c('0x12')][_0xc444a9['queue']][_0xfa7c('0x57')]||_0xfa7c('0x58'):_0xfa7c('0x58');_0xc444a9[_0xfa7c('0x75')]=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0xc444a9[_0xfa7c('0x77')]=_0xb167ce[_0xfa7c('0x77')];_0xc444a9[_0xfa7c('0x78')]=_0xb167ce[_0xfa7c('0x78')];_0xc444a9[_0xfa7c('0x4c')]=_0xb167ce[_0xfa7c('0x4c')];_0xc444a9[_0xfa7c('0x79')]=this[_0xfa7c('0x39')][_0xb167ce[_0xfa7c('0x4c')]][_0xfa7c('0x79')];logger[_0xfa7c('0x7a')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0xc444a9[_0xfa7c('0x4f')],_0xc444a9[_0xfa7c('0x57')]);Object['assign'](_0xc444a9,_[_0xfa7c('0x7b')](_0xb167ce,_[_0xfa7c('0x7c')](_0xc444a9)));this[_0xfa7c('0x10')][_0xb167ce[_0xfa7c('0x4c')]]['push'](_0xc444a9);this[_0xfa7c('0x39')][_0xb167ce[_0xfa7c('0x4c')]]=_0xc444a9;this[_0xfa7c('0x49')](_0xc444a9,_0xfa7c('0x7d'));}}catch(_0x18a6ab){logger[_0xfa7c('0x40')](_0xfa7c('0x74'),_0xb167ce[_0xfa7c('0x4c')],util['inspect'](_0x18a6ab,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x7e')]=function(_0x4d79d2){try{if(this[_0xfa7c('0x5c')](_0x4d79d2)){logger[_0xfa7c('0x4a')]('[%s][voiceQueueReport][queuecallerabandon]',_0x4d79d2['uniqueid'],util[_0xfa7c('0x42')](_0x4d79d2,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x4d79d2[_0xfa7c('0x4c')]]){var _0x11ec77=_[_0xfa7c('0x7f')](this[_0xfa7c('0x10')][_0x4d79d2['uniqueid']]);_0x11ec77['queuecallercomplete']=![];_0x11ec77['queuecallercompleteAt']=null;_0x11ec77[_0xfa7c('0x80')]=_0x4d79d2[_0xfa7c('0x80')];_0x11ec77[_0xfa7c('0x81')]=_0x4d79d2[_0xfa7c('0x81')];_0x11ec77[_0xfa7c('0x1f')]=!![];_0x11ec77['queuecallerabandonAt']=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0x11ec77['queuecallerexitreason']=_0xfa7c('0x82');_0x11ec77['lastAssignedTo']=null;logger[_0xfa7c('0x7a')](_0xfa7c('0x83'),_0x11ec77[_0xfa7c('0x4f')],_0x11ec77['type']);this['channels'][_0x4d79d2['uniqueid']]=_0x11ec77;this[_0xfa7c('0x52')](_0x11ec77,_0xfa7c('0x1f'));}}}catch(_0x35d2cd){logger[_0xfa7c('0x40')](_0xfa7c('0x84'),_0x4d79d2[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x35d2cd,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x5c549d){try{if(this['isNotNull'](_0x5c549d)){logger[_0xfa7c('0x4a')](_0xfa7c('0x85'),_0x5c549d[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x5c549d,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x5c549d[_0xfa7c('0x4c')]]){var _0x411217=_[_0xfa7c('0x7f')](this[_0xfa7c('0x10')][_0x5c549d['uniqueid']]);_0x411217[_0xfa7c('0x86')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x411217['connectedlinenum']=_0x5c549d['connectedlinenum'];_0x411217[_0xfa7c('0x87')]=_0x5c549d[_0xfa7c('0x87')];logger[_0xfa7c('0x7a')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x411217[_0xfa7c('0x4f')],_0x411217[_0xfa7c('0x57')],_0x5c549d[_0xfa7c('0x88')],_0x5c549d[_0xfa7c('0x87')]);this[_0xfa7c('0x39')][_0x5c549d[_0xfa7c('0x4c')]]=_0x411217;this[_0xfa7c('0x49')](_0x411217,_0xfa7c('0x20'));}}}catch(_0x1a061a){logger[_0xfa7c('0x40')](_0xfa7c('0x85'),_0x5c549d[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x1a061a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')]['syncAgentConnect']=function(_0x3d60ea){try{if(this[_0xfa7c('0x5c')](_0x3d60ea)){logger[_0xfa7c('0x4a')](_0xfa7c('0x89'),_0x3d60ea[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x3d60ea,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x3d60ea[_0xfa7c('0x4c')]]){var _0x3ea157=_['last'](this['queueReports'][_0x3d60ea[_0xfa7c('0x4c')]]);_0x3ea157[_0xfa7c('0x36')]=!![];_0x3ea157[_0xfa7c('0x54')]=_0xfa7c('0x8a');logger[_0xfa7c('0x7a')](_0xfa7c('0x8b'),_0x3ea157[_0xfa7c('0x4f')],_0x3ea157[_0xfa7c('0x57')]);}}}catch(_0x5168da){logger[_0xfa7c('0x40')](_0xfa7c('0x89'),_0x3d60ea[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x5168da,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x22')]=function(_0x44cf49){try{if(this[_0xfa7c('0x5c')](_0x44cf49)){logger[_0xfa7c('0x4a')](_0xfa7c('0x8c'),_0x44cf49[_0xfa7c('0x4c')],util['inspect'](_0x44cf49,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x44cf49[_0xfa7c('0x4c')]]){var _0x3a97e7=_['last'](this['queueReports'][_0x44cf49['uniqueid']]);_0x3a97e7['queuecallerabandon']=![];_0x3a97e7[_0xfa7c('0x8d')]=null;_0x3a97e7['assigned']=!![];_0x3a97e7['lastAssignedTo']=_0x44cf49[_0xfa7c('0x8e')];_0x3a97e7[_0xfa7c('0x80')]=_0x44cf49[_0xfa7c('0x80')];_0x3a97e7['queuecallercomplete']=!![];_0x3a97e7[_0xfa7c('0x35')]=![];_0x3a97e7[_0xfa7c('0x8f')]=null;if(!_0x3a97e7['transfer']){if(_0x44cf49['reason']==_0xfa7c('0x90')){_0x3a97e7[_0xfa7c('0x54')]=_0xfa7c('0x91');logger[_0xfa7c('0x7a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x3a97e7[_0xfa7c('0x4f')],_0x3a97e7[_0xfa7c('0x57')]);}else{if(_[_0xfa7c('0x92')](_0x44cf49[_0xfa7c('0x3e')][_0xfa7c('0x93')](),_0xfa7c('0x94'))){if(this[_0xfa7c('0x10')][_0x44cf49['linkedid']]){var _0x3f574d=_[_0xfa7c('0x7f')](this['queueReports'][_0x44cf49[_0xfa7c('0x95')]]);_0x3f574d[_0xfa7c('0x36')]=![];_0x3f574d[_0xfa7c('0x35')]=!![];_0x3f574d['queuecallerexitAt']=moment(_0x3a97e7[_0xfa7c('0x75')])[_0xfa7c('0x96')](_0x44cf49['holdtime'],_0xfa7c('0x97'))[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0x3f574d[_0xfa7c('0x54')]=_0xfa7c('0x98');_0x3f574d[_0xfa7c('0x90')]=!![];_0x3f574d[_0xfa7c('0x99')]=_0xfa7c('0x9a');_0x3f574d[_0xfa7c('0x9b')]=_0x44cf49[_0xfa7c('0x9c')];_0x3f574d[_0xfa7c('0x9d')]=_0x44cf49[_0xfa7c('0x4c')];logger[_0xfa7c('0x7a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x3f574d[_0xfa7c('0x4f')],_0x3f574d['type']);var _0x58ea14=this['queueReports'][_0x44cf49[_0xfa7c('0x95')]];this['queueReports'][_0x44cf49[_0xfa7c('0x95')]]=this[_0xfa7c('0x10')][_0x44cf49[_0xfa7c('0x4c')]];this[_0xfa7c('0x10')][_0x44cf49[_0xfa7c('0x4c')]]=_0x58ea14;}}else{_0x3a97e7[_0xfa7c('0x54')]='COMPLETEDBY'+_0x44cf49[_0xfa7c('0x9e')][_0xfa7c('0x9f')]();logger[_0xfa7c('0x7a')](_0xfa7c('0xa0'),_0x3a97e7['queue'],_0x3a97e7[_0xfa7c('0x57')],_0x3a97e7[_0xfa7c('0x54')]);}}}this[_0xfa7c('0x39')][_0x44cf49[_0xfa7c('0x4c')]]=_0x3a97e7;}}}catch(_0x155dbf){logger[_0xfa7c('0x40')](_0xfa7c('0x8c'),_0x44cf49[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x155dbf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x25')]=function(_0x202d17){try{if(this[_0xfa7c('0x5c')](_0x202d17)){logger['debug'](_0xfa7c('0xa1'),_0x202d17[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x202d17,{'showHidden':![],'depth':null}));this[_0xfa7c('0xa2')](_0x202d17[_0xfa7c('0x4c')],_[_0xfa7c('0x7c')](_0x202d17[_0xfa7c('0xa3')])[0x0],_0x202d17[_0xfa7c('0xa4')]);if(this[_0xfa7c('0x10')][_0x202d17['uniqueid']]){var _0x5d2d29=_['last'](this['queueReports'][_0x202d17[_0xfa7c('0x4c')]]);if(_0x5d2d29){if(this[_0xfa7c('0x5c')](_0x202d17['variable'])&&this[_0xfa7c('0x5c')](_0x202d17[_0xfa7c('0xa3')][_0xfa7c('0x62')])){switch(_0x202d17['value']){case _0xfa7c('0xa5'):_0x5d2d29[_0xfa7c('0x35')]=![];_0x5d2d29[_0xfa7c('0x8f')]=null;break;case _0xfa7c('0xa6'):_0x5d2d29[_0xfa7c('0xa7')]=_0xfa7c('0xa8');_0x5d2d29[_0xfa7c('0x35')]=!![];_0x5d2d29[_0xfa7c('0x8f')]=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0x5d2d29[_0xfa7c('0x86')]=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x202d17['uniqueid'],util[_0xfa7c('0x42')](_0x5d2d29,{'showHidden':![],'depth':null}));ami['emit'](_0xfa7c('0xa9'),_0x5d2d29);break;default:_0x5d2d29[_0xfa7c('0x35')]=!![];_0x5d2d29[_0xfa7c('0x8f')]=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0x5d2d29['queuecallerleaveAt']=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));}_0x5d2d29[_0xfa7c('0x1f')]=![];_0x5d2d29[_0xfa7c('0x8d')]=null;_0x5d2d29['queuecallerexitreason']=_0x202d17['value'];this[_0xfa7c('0x39')][_0x202d17[_0xfa7c('0x4c')]]=_0x5d2d29;this[_0xfa7c('0x52')](_0x5d2d29,_0xfa7c('0xaa'));}else if(this[_0xfa7c('0x5c')](_0x202d17['variable'])&&this[_0xfa7c('0x5c')](_0x202d17['variable']['queueposition'])){if(!_0x5d2d29[_0xfa7c('0x1f')]){_0x5d2d29[_0xfa7c('0x35')]=!![];_0x5d2d29[_0xfa7c('0x8f')]=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0x5d2d29[_0xfa7c('0x54')]=_0xfa7c('0xab');_0x5d2d29['queuecallerleaveAt']=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));this['channels'][_0x202d17['uniqueid']]=_0x5d2d29;}}logger[_0xfa7c('0x7a')](_0xfa7c('0xac'),_0x202d17['uniqueid'],_0x5d2d29['queue'],_0x5d2d29[_0xfa7c('0x57')],_['keys'](_0x202d17[_0xfa7c('0xa3')])[0x0],_0x202d17['value']);_0x5d2d29[_0xfa7c('0x15')]=this['variables'][_0x202d17[_0xfa7c('0x4c')]];}}}}catch(_0x15c821){logger[_0xfa7c('0x40')](_0xfa7c('0xa1'),_0x202d17[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x15c821,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0xa2')]=function(_0x1ca1a3,_0xed3cd8,_0x1ccfe4){var _0xe12134=[_0xfa7c('0xad'),_0xfa7c('0xae'),_0xfa7c('0xaf'),_0xfa7c('0xb0'),'rtpaudioqosloss',_0xfa7c('0xb1'),'rtpaudioqosrtt',_0xfa7c('0xb2'),'sipcallid','sipuri',_0xfa7c('0xb3'),_0xfa7c('0xb4'),_0xfa7c('0xb5'),_0xfa7c('0xb6'),_0xfa7c('0xb7'),_0xfa7c('0xb8'),_0xfa7c('0x8e'),_0xfa7c('0xb9'),_0xfa7c('0xba')];if(!_[_0xfa7c('0x3b')](_0xed3cd8)&&!_['includes'](_0xe12134,_0xed3cd8)){if(_[_0xfa7c('0x5d')](this[_0xfa7c('0x15')][_0x1ca1a3])){this[_0xfa7c('0x15')][_0x1ca1a3]={};}this[_0xfa7c('0x15')][_0x1ca1a3][_0xed3cd8]=_0x1ccfe4;}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0xbb')]=function(_0x6e90f6,_0x2ce986,_0x5e6987){try{var _0x2f2aa6={};if(this['queueReports'][_0x6e90f6]){for(var _0x233a72=0x0;_0x233a720x0?!![]:![];if(!_0x51ee3c){return this[_0x7451('0x17')](this['summary'][_0x7451('0x6b')]);}};VoiceQueueReport['prototype'][_0x7451('0x19')]=function(_0x37b459){var _0x7f472e=this[_0x7451('0x14')]['id'];if(this[_0x7451('0x14')]['queuestatus'][_0x7f472e]&&this['summary']['queuestatus'][_0x7f472e][_0x37b459[_0x7451('0x5f')]]){this[_0x7451('0x14')][_0x7451('0x60')][_0x7f472e][_0x37b459['actionid']][_0x7451('0xf')]['push'](_0x37b459);}};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x6c')]=function(_0x3a71c5){var _0x2b6cd5=this;try{if(this[_0x7451('0x58')](_0x3a71c5)&&this[_0x7451('0x58')](_0x3a71c5[_0x7451('0x50')])){logger['debug'](_0x7451('0x6d'),util['inspect'](_0x3a71c5,{'showHidden':![],'depth':null}));var _0x4b03c0=this[_0x7451('0x12')][_0x3a71c5[_0x7451('0x50')]];if(_0x4b03c0){logger[_0x7451('0x46')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x4b03c0[_0x7451('0x62')]);this[_0x7451('0x14')][_0x7451('0x5b')][_0x4b03c0[_0x7451('0x62')]]={'summaryEvent':_0x3a71c5};this[_0x7451('0x14')][_0x7451('0x6a')]+=0x1;return ami[_0x7451('0x37')]({'action':_0x7451('0x60'),'queue':_0x4b03c0['name']})[_0x7451('0x5e')](function(_0x75e606){if(!_0x2b6cd5['summary'][_0x7451('0x60')][_0x3a71c5[_0x7451('0x5f')]]){_0x2b6cd5[_0x7451('0x14')][_0x7451('0x60')][_0x3a71c5[_0x7451('0x5f')]]={};}_0x2b6cd5[_0x7451('0x14')][_0x7451('0x60')][_0x3a71c5[_0x7451('0x5f')]][_0x75e606[_0x7451('0x5f')]]={'queue':_0x4b03c0[_0x7451('0x62')],'agents':[]};})[_0x7451('0x39')](function(_0x451451){throw _0x451451;});}}}catch(_0x59dd3a){logger[_0x7451('0x3c')](_0x7451('0x61'),util[_0x7451('0x3d')](_0x59dd3a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x17')]=function(_0x2193bc){if(this[_0x7451('0x14')][_0x7451('0x6a')]>0x0){this[_0x7451('0x14')][_0x7451('0x6b')]=_0x2193bc;return;}logger[_0x7451('0x46')](_0x7451('0x6e'),util[_0x7451('0x3d')](_0x2193bc,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami['emit'](_0x7451('0x6f'),{});};VoiceQueueReport['prototype'][_0x7451('0x1d')]=function(_0x35df9c){try{if(this[_0x7451('0x58')](_0x35df9c)){logger[_0x7451('0x46')](_0x7451('0x70'),_0x35df9c[_0x7451('0x49')],util[_0x7451('0x3d')](_0x35df9c,{'showHidden':![],'depth':null}));if(_[_0x7451('0x59')](this[_0x7451('0xd')][_0x35df9c[_0x7451('0x49')]])){this[_0x7451('0xd')][_0x35df9c[_0x7451('0x49')]]=[];}if(_[_0x7451('0x59')](this[_0x7451('0x10')][_0x35df9c['uniqueid']])){this[_0x7451('0x10')][_0x35df9c[_0x7451('0x49')]]={};}var _0x3edcb5=new QueueReport();_0x3edcb5[_0x7451('0x50')]=_0x35df9c['queue'];_0x3edcb5[_0x7451('0x53')]=this[_0x7451('0x12')][_0x3edcb5[_0x7451('0x50')]]&&this[_0x7451('0x12')][_0x3edcb5['queue']][_0x7451('0x53')]?this[_0x7451('0x12')][_0x3edcb5['queue']]['type']||_0x7451('0x54'):_0x7451('0x54');_0x3edcb5[_0x7451('0x71')]=moment()['format'](_0x7451('0x72'));_0x3edcb5[_0x7451('0x73')]=_0x35df9c['position'];_0x3edcb5[_0x7451('0x74')]=_0x35df9c[_0x7451('0x74')];_0x3edcb5['uniqueid']=_0x35df9c[_0x7451('0x49')];_0x3edcb5['routealias']=this[_0x7451('0x10')][_0x35df9c[_0x7451('0x49')]][_0x7451('0x75')];logger[_0x7451('0x76')](_0x7451('0x77'),_0x3edcb5['queue'],_0x3edcb5[_0x7451('0x53')]);Object[_0x7451('0x78')](_0x3edcb5,_[_0x7451('0x79')](_0x35df9c,_[_0x7451('0x7a')](_0x3edcb5)));this[_0x7451('0xd')][_0x35df9c['uniqueid']]['push'](_0x3edcb5);this[_0x7451('0x10')][_0x35df9c[_0x7451('0x49')]]=_0x3edcb5;this['emitVoiceQueueChannelSave'](_0x3edcb5,_0x7451('0x1c'));}}catch(_0x152fb7){logger['error'](_0x7451('0x70'),_0x35df9c[_0x7451('0x49')],util['inspect'](_0x152fb7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7451('0x7b')]=function(_0x62427){try{if(this[_0x7451('0x58')](_0x62427)){logger[_0x7451('0x46')](_0x7451('0x7c'),_0x62427[_0x7451('0x49')],util[_0x7451('0x3d')](_0x62427,{'showHidden':![],'depth':null}));if(this[_0x7451('0xd')][_0x62427[_0x7451('0x49')]]){var _0x5a36d3=_['last'](this['queueReports'][_0x62427['uniqueid']]);_0x5a36d3['queuecallercomplete']=![];_0x5a36d3[_0x7451('0x7d')]=null;_0x5a36d3[_0x7451('0x7e')]=_0x62427['holdtime'];_0x5a36d3[_0x7451('0x7f')]=_0x62427[_0x7451('0x7f')];_0x5a36d3['queuecallerabandon']=!![];_0x5a36d3[_0x7451('0x80')]=moment()[_0x7451('0x4a')](_0x7451('0x72'));_0x5a36d3[_0x7451('0x4e')]='ABANDONED';_0x5a36d3[_0x7451('0x81')]=null;logger['info'](_0x7451('0x82'),_0x5a36d3[_0x7451('0x50')],_0x5a36d3[_0x7451('0x53')]);this[_0x7451('0x10')][_0x62427['uniqueid']]=_0x5a36d3;this[_0x7451('0x43')](_0x5a36d3,'queuecallerabandon');}}}catch(_0x45f762){logger[_0x7451('0x3c')](_0x7451('0x7c'),_0x62427[_0x7451('0x49')],util[_0x7451('0x3d')](_0x45f762,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x20')]=function(_0x5d39a4){try{if(this['isNotNull'](_0x5d39a4)){logger[_0x7451('0x46')]('[%s][voiceQueueReport][queuecallerleave]',_0x5d39a4[_0x7451('0x49')],util['inspect'](_0x5d39a4,{'showHidden':![],'depth':null}));if(this[_0x7451('0xd')][_0x5d39a4[_0x7451('0x49')]]){var _0x179825=_[_0x7451('0x83')](this[_0x7451('0xd')][_0x5d39a4['uniqueid']]);_0x179825['queuecallerleaveAt']=moment()[_0x7451('0x4a')](_0x7451('0x72'));_0x179825[_0x7451('0x84')]=_0x5d39a4['connectedlinenum'];_0x179825['connectedlinename']=_0x5d39a4[_0x7451('0x85')];logger['info'](_0x7451('0x86'),_0x179825[_0x7451('0x50')],_0x179825[_0x7451('0x53')],_0x5d39a4[_0x7451('0x84')],_0x5d39a4[_0x7451('0x85')]);this[_0x7451('0x10')][_0x5d39a4[_0x7451('0x49')]]=_0x179825;this[_0x7451('0x87')](_0x179825,_0x7451('0x1f'));}}}catch(_0x3bfed6){logger[_0x7451('0x3c')]('[%s][voiceQueueReport][queuecallerleave]',_0x5d39a4[_0x7451('0x49')],util[_0x7451('0x3d')](_0x3bfed6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x21')]=function(_0x1ccd7b){try{if(this[_0x7451('0x58')](_0x1ccd7b)){logger['debug'](_0x7451('0x88'),_0x1ccd7b[_0x7451('0x49')],util['inspect'](_0x1ccd7b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1ccd7b[_0x7451('0x49')]]){var _0x4e3def=_[_0x7451('0x83')](this['queueReports'][_0x1ccd7b['uniqueid']]);_0x4e3def[_0x7451('0x32')]=!![];_0x4e3def[_0x7451('0x4e')]=_0x7451('0x89');logger[_0x7451('0x76')](_0x7451('0x8a'),_0x4e3def[_0x7451('0x50')],_0x4e3def[_0x7451('0x53')]);}}}catch(_0xe9846a){logger[_0x7451('0x3c')](_0x7451('0x88'),_0x1ccd7b[_0x7451('0x49')],util['inspect'](_0xe9846a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x8b')]=function(_0x4bf836){try{if(this[_0x7451('0x58')](_0x4bf836)){logger[_0x7451('0x46')](_0x7451('0x8c'),_0x4bf836[_0x7451('0x49')],util[_0x7451('0x3d')](_0x4bf836,{'showHidden':![],'depth':null}));if(this[_0x7451('0xd')][_0x4bf836[_0x7451('0x49')]]){var _0x2ee8d8=_[_0x7451('0x83')](this['queueReports'][_0x4bf836[_0x7451('0x49')]]);_0x2ee8d8[_0x7451('0x1e')]=![];_0x2ee8d8[_0x7451('0x80')]=null;_0x2ee8d8[_0x7451('0x8d')]=!![];_0x2ee8d8[_0x7451('0x81')]=_0x4bf836[_0x7451('0x8e')];_0x2ee8d8['holdtime']=_0x4bf836[_0x7451('0x7e')];_0x2ee8d8['queuecallercomplete']=!![];_0x2ee8d8['queuecallerexit']=![];_0x2ee8d8[_0x7451('0x8f')]=null;if(!_0x2ee8d8[_0x7451('0x90')]){if(_0x4bf836[_0x7451('0x91')]=='transfer'){_0x2ee8d8[_0x7451('0x4e')]=_0x7451('0x92');logger[_0x7451('0x76')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x2ee8d8[_0x7451('0x50')],_0x2ee8d8[_0x7451('0x53')]);}else{if(_['startsWith'](_0x4bf836[_0x7451('0x38')][_0x7451('0x93')](),'local/')){if(this[_0x7451('0xd')][_0x4bf836['linkedid']]){var _0x5acb9e=_[_0x7451('0x83')](this[_0x7451('0xd')][_0x4bf836[_0x7451('0x94')]]);_0x5acb9e[_0x7451('0x32')]=![];_0x5acb9e[_0x7451('0x95')]=!![];_0x5acb9e[_0x7451('0x8f')]=moment(_0x2ee8d8[_0x7451('0x71')])[_0x7451('0x96')](_0x4bf836[_0x7451('0x7e')],_0x7451('0x97'))[_0x7451('0x4a')](_0x7451('0x72'));_0x5acb9e['queuecallerexitreason']=_0x7451('0x98');_0x5acb9e[_0x7451('0x90')]=!![];_0x5acb9e[_0x7451('0x99')]=_0x7451('0x9a');_0x5acb9e[_0x7451('0x9b')]=_0x4bf836['destexten'];_0x5acb9e[_0x7451('0x9c')]=_0x4bf836[_0x7451('0x49')];logger['info'](_0x7451('0x9d'),_0x5acb9e[_0x7451('0x50')],_0x5acb9e[_0x7451('0x53')]);var _0x1a47b8=this[_0x7451('0xd')][_0x4bf836['linkedid']];this['queueReports'][_0x4bf836[_0x7451('0x94')]]=this[_0x7451('0xd')][_0x4bf836[_0x7451('0x49')]];this[_0x7451('0xd')][_0x4bf836[_0x7451('0x49')]]=_0x1a47b8;}}else{_0x2ee8d8[_0x7451('0x4e')]=_0x7451('0x9e')+_0x4bf836[_0x7451('0x91')][_0x7451('0x9f')]();logger[_0x7451('0x76')](_0x7451('0xa0'),_0x2ee8d8[_0x7451('0x50')],_0x2ee8d8[_0x7451('0x53')],_0x2ee8d8[_0x7451('0x4e')]);}}}this['channels'][_0x4bf836[_0x7451('0x49')]]=_0x2ee8d8;}}}catch(_0x3245f2){logger['error'](_0x7451('0x8c'),_0x4bf836['uniqueid'],util['inspect'](_0x3245f2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x23')]=function(_0xe7cee2){try{if(this[_0x7451('0x58')](_0xe7cee2)){logger[_0x7451('0x46')](_0x7451('0xa1'),_0xe7cee2[_0x7451('0x49')],util[_0x7451('0x3d')](_0xe7cee2,{'showHidden':![],'depth':null}));this[_0x7451('0xa2')](_0xe7cee2[_0x7451('0x49')],_[_0x7451('0x7a')](_0xe7cee2[_0x7451('0xa3')])[0x0],_0xe7cee2[_0x7451('0xa4')]);if(this[_0x7451('0xd')][_0xe7cee2[_0x7451('0x49')]]){var _0x445f52=_[_0x7451('0x83')](this['queueReports'][_0xe7cee2[_0x7451('0x49')]]);if(_0x445f52){if(this[_0x7451('0x58')](_0xe7cee2[_0x7451('0xa3')])&&this['isNotNull'](_0xe7cee2[_0x7451('0xa3')][_0x7451('0x60')])){switch(_0xe7cee2[_0x7451('0xa4')]){case _0x7451('0xa5'):_0x445f52[_0x7451('0x95')]=![];_0x445f52[_0x7451('0x8f')]=null;break;case _0x7451('0xa6'):_0x445f52['lastevent']=_0x7451('0xa7');_0x445f52[_0x7451('0x95')]=!![];_0x445f52[_0x7451('0x8f')]=moment()['format'](_0x7451('0x72'));_0x445f52[_0x7451('0xa8')]=moment()[_0x7451('0x4a')](_0x7451('0x72'));logger[_0x7451('0x46')](_0x7451('0xa9'),_0xe7cee2[_0x7451('0x49')],util[_0x7451('0x3d')](_0x445f52,{'showHidden':![],'depth':null}));ami['emit'](_0x7451('0xaa'),_0x445f52);break;default:_0x445f52[_0x7451('0x95')]=!![];_0x445f52['queuecallerexitAt']=moment()[_0x7451('0x4a')](_0x7451('0x72'));_0x445f52[_0x7451('0xa8')]=moment()[_0x7451('0x4a')](_0x7451('0x72'));}_0x445f52[_0x7451('0x1e')]=![];_0x445f52[_0x7451('0x80')]=null;_0x445f52[_0x7451('0x4e')]=_0xe7cee2[_0x7451('0xa4')];this['channels'][_0xe7cee2[_0x7451('0x49')]]=_0x445f52;this[_0x7451('0x43')](_0x445f52,_0x7451('0x22'));}else if(this['isNotNull'](_0xe7cee2[_0x7451('0xa3')])&&this[_0x7451('0x58')](_0xe7cee2[_0x7451('0xa3')]['queueposition'])){if(!_0x445f52[_0x7451('0x1e')]){_0x445f52[_0x7451('0x95')]=!![];_0x445f52[_0x7451('0x8f')]=moment()['format'](_0x7451('0x72'));_0x445f52['queuecallerexitreason']=_0x7451('0xab');_0x445f52[_0x7451('0xa8')]=moment()[_0x7451('0x4a')](_0x7451('0x72'));this[_0x7451('0x10')][_0xe7cee2[_0x7451('0x49')]]=_0x445f52;}}logger[_0x7451('0x76')](_0x7451('0xac'),_0xe7cee2[_0x7451('0x49')],_0x445f52[_0x7451('0x50')],_0x445f52[_0x7451('0x53')],_[_0x7451('0x7a')](_0xe7cee2[_0x7451('0xa3')])[0x0],_0xe7cee2[_0x7451('0xa4')]);_0x445f52[_0x7451('0x15')]=this['variables'][_0xe7cee2[_0x7451('0x49')]];}}}}catch(_0x3ef623){logger[_0x7451('0x3c')](_0x7451('0xa1'),_0xe7cee2[_0x7451('0x49')],util[_0x7451('0x3d')](_0x3ef623,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7451('0xa2')]=function(_0x3f29e6,_0x418602,_0x3bd208){var _0xc14b4c=[_0x7451('0xad'),_0x7451('0xae'),_0x7451('0xaf'),_0x7451('0xb0'),_0x7451('0xb1'),_0x7451('0xb2'),_0x7451('0xb3'),_0x7451('0xb4'),_0x7451('0xb5'),_0x7451('0xb6'),_0x7451('0xb7'),_0x7451('0xb8'),_0x7451('0xb9'),_0x7451('0xba'),_0x7451('0xbb'),_0x7451('0xbc'),'membername','memberpenalty',_0x7451('0xbd')];if(!_[_0x7451('0x36')](_0x418602)&&!_[_0x7451('0xbe')](_0xc14b4c,_0x418602)){if(_[_0x7451('0x59')](this['variables'][_0x3f29e6])){this[_0x7451('0x15')][_0x3f29e6]={};}this[_0x7451('0x15')][_0x3f29e6][_0x418602]=_0x3bd208;}};VoiceQueueReport[_0x7451('0x42')]['handleHangup']=function(_0x2840b3,_0x1fced9,_0x59dcf0){try{var _0x4da43f={};if(this['queueReports'][_0x2840b3]){for(var _0x5e7f5a=0x0;_0x5e7f5a=0x0?moment(_0x436f4a[_0xe431('0x19')])[_0xe431('0xf')](_0x436f4a[_0xe431('0x1a')],'seconds'):null,'data1':_0xe431('0x1b'),'data2':_0x436f4a['accountcode'],'data3':_0x436f4a[_0xe431('0x11')],'data4':_0x436f4a[_0xe431('0x1c')]||null,'role':_0xe431('0x13'),'internal':_0x436f4a[_0xe431('0x14')]?_[_0xe431('0x15')](_0x436f4a[_0xe431('0x14')]):undefined,'uniqueid':_0x436f4a[_0xe431('0x16')]},'log':_0xe431('0x6')});}; \ No newline at end of file +var _0xeff8=['moment','lodash','util','voiceQueueReport','queuecallercompleteAt','Request','voice','lastAssignedTo','isNil','format','interface','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','toNumber','accountcode','uniqueid','CreateMemberReport','membername','starttime','endtime','outbound'];(function(_0x14f132,_0x4cf31e){var _0x24bf39=function(_0x10ddad){while(--_0x10ddad){_0x14f132['push'](_0x14f132['shift']());}};_0x24bf39(++_0x4cf31e);}(_0xeff8,0x1a4));var _0x8eff=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xeff8[_0x2f3848];return _0x102668;};'use strict';var moment=require(_0x8eff('0x0'));var _=require(_0x8eff('0x1'));var util=require(_0x8eff('0x2'));var client=require('../client');exports[_0x8eff('0x3')]=function(_0x1e8907){var _0x25dd4a=_0x1e8907[_0x8eff('0x4')]||_0x1e8907['queuecallerexitAt'];return client[_0x8eff('0x5')]('CreateMemberReport',{'body':{'channel':_0x8eff('0x6'),'membername':_0x1e8907[_0x8eff('0x7')],'interface':_[_0x8eff('0x8')](_0x1e8907['interface'])?util[_0x8eff('0x9')]('SIP/%s',_0x1e8907['lastAssignedTo']):_0x1e8907[_0x8eff('0xa')],'type':_0x8eff('0xb'),'enterAt':_0x1e8907[_0x8eff('0xc')],'exitAt':_0x25dd4a,'duration':moment(_0x25dd4a)[_0x8eff('0xd')](_0x1e8907[_0x8eff('0xc')],_0x8eff('0xe')),'data1':_0x8eff('0xf'),'data2':_0x1e8907[_0x8eff('0x10')],'data3':_0x1e8907[_0x8eff('0x11')],'data4':null,'data5':_0x1e8907[_0x8eff('0x12')],'role':_0x8eff('0x13'),'internal':_0x1e8907['accountcode']?_[_0x8eff('0x14')](_0x1e8907[_0x8eff('0x15')]):undefined,'uniqueid':_0x1e8907[_0x8eff('0x16')]},'log':_0x8eff('0x17')});};exports['voiceDialReport']=function(_0x3687b8){return client['Request']('CreateMemberReport',{'body':{'channel':_0x8eff('0x6'),'membername':_0x3687b8[_0x8eff('0x18')],'interface':_0x3687b8[_0x8eff('0xa')],'type':_0x8eff('0xb'),'enterAt':_0x3687b8[_0x8eff('0x19')],'exitAt':_0x3687b8[_0x8eff('0x1a')],'duration':moment(_0x3687b8['endtime'])[_0x8eff('0xd')](_0x3687b8[_0x8eff('0x19')],_0x8eff('0xe'))>=0x0?moment(_0x3687b8['endtime'])[_0x8eff('0xd')](_0x3687b8[_0x8eff('0x19')],_0x8eff('0xe')):null,'data1':_0x8eff('0x1b'),'data2':_0x3687b8[_0x8eff('0x15')],'data3':_0x3687b8[_0x8eff('0x11')],'data4':_0x3687b8['dialstring']||null,'role':_0x8eff('0x13'),'internal':_0x3687b8[_0x8eff('0x15')]?_[_0x8eff('0x14')](_0x3687b8[_0x8eff('0x15')]):undefined,'uniqueid':_0x3687b8[_0x8eff('0x16')]},'log':_0x8eff('0x17')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index a4dcd1e..524ce75 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f3d=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','Request','ShowSetting'];(function(_0x529859,_0x23c88b){var _0x5d084a=function(_0x3841f4){while(--_0x3841f4){_0x529859['push'](_0x529859['shift']());}};_0x5d084a(++_0x23c88b);}(_0x4f3d,0x171));var _0xd4f3=function(_0x12313e,_0x5d3f8f){_0x12313e=_0x12313e-0x0;var _0xd7988a=_0x4f3d[_0x12313e];return _0xd7988a;};'use strict';var client=require(_0xd4f3('0x0'));exports['getSettings']=function(){return client[_0xd4f3('0x1')](_0xd4f3('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd4f3('0x3'),_0xd4f3('0x4')]},'log':_0xd4f3('0x5')});}; \ No newline at end of file +var _0x4a65=['GetSettings','getSettings','Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4a65,0x16f));var _0x54a6=function(_0x162302,_0x59ab23){_0x162302=_0x162302-0x0;var _0x52a71f=_0x4a65[_0x162302];return _0x52a71f;};'use strict';var client=require('../client');exports[_0x54a6('0x0')]=function(){return client[_0x54a6('0x1')](_0x54a6('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x54a6('0x3'),_0x54a6('0x4')]},'log':_0x54a6('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 9ae1d5b..06ef32a 100644 --- a/server/services/ami/rpc/template.js +++ b/server/services/ami/rpc/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f87=['name','html','../client','getTemplates','Request','GetTemplate'];(function(_0x554d06,_0x2304b1){var _0x372fb5=function(_0x2d6409){while(--_0x2d6409){_0x554d06['push'](_0x554d06['shift']());}};_0x372fb5(++_0x2304b1);}(_0x6f87,0x194));var _0x76f8=function(_0x1293a3,_0x4f744c){_0x1293a3=_0x1293a3-0x0;var _0x5a2ad0=_0x6f87[_0x1293a3];return _0x5a2ad0;};'use strict';var client=require(_0x76f8('0x0'));exports[_0x76f8('0x1')]=function(_0x29ba67){return function(_0x4b2eb9){return client[_0x76f8('0x2')](_0x76f8('0x3'),{'options':{'raw':!![],'attributes':['id',_0x76f8('0x4'),_0x76f8('0x5')]},'log':_0x76f8('0x3')});};}; \ No newline at end of file +var _0x71f1=['GetTemplate','name','getTemplates','Request'];(function(_0x2145ce,_0x3bfbc0){var _0x456805=function(_0x5cb293){while(--_0x5cb293){_0x2145ce['push'](_0x2145ce['shift']());}};_0x456805(++_0x3bfbc0);}(_0x71f1,0x19a));var _0x171f=function(_0x268319,_0x53fc42){_0x268319=_0x268319-0x0;var _0x1f9479=_0x71f1[_0x268319];return _0x1f9479;};'use strict';var client=require('../client');exports[_0x171f('0x0')]=function(_0x15fb58){return function(_0x1a96e2){return client[_0x171f('0x1')](_0x171f('0x2'),{'options':{'raw':!![],'attributes':['id',_0x171f('0x3'),'html']},'log':_0x171f('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index a111c10..5e48716 100644 --- a/server/services/ami/rpc/trigger.js +++ b/server/services/ami/rpc/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd47d=['data3','data4','data6','../client','getTriggers','GetTrigger','name','status','field','value','Condition','Action','action','data2'];(function(_0xfb529c,_0xce9dee){var _0x141d34=function(_0x31204e){while(--_0x31204e){_0xfb529c['push'](_0xfb529c['shift']());}};_0x141d34(++_0xce9dee);}(_0xd47d,0xff));var _0xdd47=function(_0x101a17,_0x5d047a){_0x101a17=_0x101a17-0x0;var _0x3b76ee=_0xd47d[_0x101a17];return _0x3b76ee;};'use strict';var client=require(_0xdd47('0x0'));exports[_0xdd47('0x1')]=function(_0x5c9b2e){return function(_0x335cf3){return client['Request'](_0xdd47('0x2'),{'options':{'raw':![],'attributes':['id',_0xdd47('0x3'),'channel',_0xdd47('0x4')],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0xdd47('0x5'),'operator',_0xdd47('0x6')]},{'model':_0xdd47('0x7'),'as':'AnyConditions','attributes':['id','field','operator',_0xdd47('0x6')]},{'model':_0xdd47('0x8'),'as':'Actions','attributes':['id',_0xdd47('0x9'),'data1',_0xdd47('0xa'),_0xdd47('0xb'),_0xdd47('0xc'),'data5',_0xdd47('0xd'),'data7']}]},'log':_0xdd47('0x2')});};}; \ No newline at end of file +var _0x7345=['status','Condition','AllConditions','field','value','AnyConditions','action','data1','data3','data4','data5','data6','data7','getTriggers','Request','GetTrigger','name','channel'];(function(_0x1e9070,_0x580789){var _0x46ef9e=function(_0x5a843d){while(--_0x5a843d){_0x1e9070['push'](_0x1e9070['shift']());}};_0x46ef9e(++_0x580789);}(_0x7345,0x12d));var _0x5734=function(_0xc26f79,_0xbbc64a){_0xc26f79=_0xc26f79-0x0;var _0x1c909a=_0x7345[_0xc26f79];return _0x1c909a;};'use strict';var client=require('../client');exports[_0x5734('0x0')]=function(_0x5a29d5){return function(_0x8c84f8){return client[_0x5734('0x1')](_0x5734('0x2'),{'options':{'raw':![],'attributes':['id',_0x5734('0x3'),_0x5734('0x4'),_0x5734('0x5')],'include':[{'model':_0x5734('0x6'),'as':_0x5734('0x7'),'attributes':['id',_0x5734('0x8'),'operator',_0x5734('0x9')]},{'model':'Condition','as':_0x5734('0xa'),'attributes':['id','field','operator','value']},{'model':'Action','as':'Actions','attributes':['id',_0x5734('0xb'),_0x5734('0xc'),'data2',_0x5734('0xd'),_0x5734('0xe'),_0x5734('0xf'),_0x5734('0x10'),_0x5734('0x11')]}]},'log':_0x5734('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 6db3f2b..f57607e 100644 --- a/server/services/ami/rpc/trunk.js +++ b/server/services/ami/rpc/trunk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e84=['registry','defaultuser','getTrunks','Request','GetTrunk','name'];(function(_0x2ce263,_0xc6d338){var _0x5aa9c2=function(_0x5d413e){while(--_0x5d413e){_0x2ce263['push'](_0x2ce263['shift']());}};_0x5aa9c2(++_0xc6d338);}(_0x3e84,0xd4));var _0x43e8=function(_0x502137,_0x372ad2){_0x502137=_0x502137-0x0;var _0x443ecf=_0x3e84[_0x502137];return _0x443ecf;};'use strict';var client=require('../client');exports[_0x43e8('0x0')]=function(_0x1d7b40){return function(_0x18d1dd){return client[_0x43e8('0x1')](_0x43e8('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x43e8('0x3'),_0x43e8('0x4'),_0x43e8('0x5')]},'log':_0x43e8('0x2')});};}; \ No newline at end of file +var _0xd6cb=['../client','GetTrunk','defaultuser'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd6cb,0x16b));var _0xbd6c=function(_0x3439ea,_0x3c68ba){_0x3439ea=_0x3439ea-0x0;var _0x3900a3=_0xd6cb[_0x3439ea];return _0x3900a3;};'use strict';var client=require(_0xbd6c('0x0'));exports['getTrunks']=function(_0x48fbc2){return function(_0x471e0d){return client['Request'](_0xbd6c('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry',_0xbd6c('0x2')]},'log':_0xbd6c('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 1688c34..a128bde 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe706,0xa3));var _0x6e70=function(_0x326539,_0x108886){_0x326539=_0x326539-0x0;var _0x2cbb6e=_0xe706[_0x326539];return _0x2cbb6e;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xe706,0xa3));var _0x6e70=function(_0x7a6aed,_0x335e68){_0x7a6aed=_0x7a6aed-0x0;var _0x9dbabf=_0xe706[_0x7a6aed];return _0x9dbabf;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index d19dc7e..5065653 100644 --- a/server/services/ami/rpc/voiceAgentReport.js +++ b/server/services/ami/rpc/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d55=['UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport','update'];(function(_0x183d63,_0x399147){var _0x5e4a1d=function(_0x21adbb){while(--_0x21adbb){_0x183d63['push'](_0x183d63['shift']());}};_0x5e4a1d(++_0x399147);}(_0x1d55,0x8d));var _0x51d5=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0x1d55[_0x2b8077];return _0x308091;};'use strict';var client=require(_0x51d5('0x0'));exports['create']=function(_0x16ff18){return client[_0x51d5('0x1')](_0x51d5('0x2'),{'body':_0x16ff18,'log':'CreateVoiceAgentReport'});};exports[_0x51d5('0x3')]=function(_0x5d9a01,_0x521b8c,_0x3374b3){return client[_0x51d5('0x1')]('UpdateVoiceAgentReport',{'body':_0x5d9a01,'options':{'where':{'uniqueid':_0x521b8c,'interface':_0x3374b3,'agentcomplete':!![]}},'log':_0x51d5('0x4')});}; \ No newline at end of file +var _0x9c2b=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x152fc3,_0x3206ed){var _0x1e0cfa=function(_0x4ddb80){while(--_0x4ddb80){_0x152fc3['push'](_0x152fc3['shift']());}};_0x1e0cfa(++_0x3206ed);}(_0x9c2b,0x1b9));var _0xb9c2=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x9c2b[_0x1deb03];return _0x189fe7;};'use strict';var client=require(_0xb9c2('0x0'));exports[_0xb9c2('0x1')]=function(_0x5f41bf){return client[_0xb9c2('0x2')](_0xb9c2('0x3'),{'body':_0x5f41bf,'log':_0xb9c2('0x3')});};exports[_0xb9c2('0x4')]=function(_0x3f3e73,_0x34d6a3,_0x224975){return client[_0xb9c2('0x2')](_0xb9c2('0x5'),{'body':_0x3f3e73,'options':{'where':{'uniqueid':_0x34d6a3,'interface':_0x224975,'agentcomplete':!![]}},'log':_0xb9c2('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 9beb60c..ffcc759 100644 --- a/server/services/ami/rpc/voiceCallReport.js +++ b/server/services/ami/rpc/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6b6=['day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','duration','GetVoiceCallReports','moment','util','lodash','../client','create','CreateVoiceCallReport','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf'];(function(_0x2505ad,_0x417b1e){var _0x519b18=function(_0x2f9570){while(--_0x2f9570){_0x2505ad['push'](_0x2505ad['shift']());}};_0x519b18(++_0x417b1e);}(_0xf6b6,0x9f));var _0x6f6b=function(_0xc405f4,_0x1945c6){_0xc405f4=_0xc405f4-0x0;var _0x39fc7a=_0xf6b6[_0xc405f4];return _0x39fc7a;};'use strict';var moment=require(_0x6f6b('0x0'));var util=require(_0x6f6b('0x1'));var _=require(_0x6f6b('0x2'));var client=require(_0x6f6b('0x3'));exports[_0x6f6b('0x4')]=function(_0x3ef297){return client['Request'](_0x6f6b('0x5'),{'body':_['merge'](_0x3ef297,{'source':_0x3ef297['calleridnum'],'destinationcontext':_0x3ef297['context'],'callerid':_0x3ef297[_0x6f6b('0x6')],'amaflags':_0x6f6b('0x7')}),'log':_0x6f6b('0x5')});};exports[_0x6f6b('0x8')]=function(){return function(){return client['Request'](_0x6f6b('0x9'),{'options':{'where':{'type':[_0x6f6b('0xa')],'createdAt':{'$between':[moment()[_0x6f6b('0xb')](_0x6f6b('0xc'))[_0x6f6b('0xd')](_0x6f6b('0xe')),moment()[_0x6f6b('0xf')](_0x6f6b('0xc'))['format'](_0x6f6b('0xe'))]}},'attributes':['type',_0x6f6b('0x10'),_0x6f6b('0x11'),'billableseconds']},'log':_0x6f6b('0x12')});};}; \ No newline at end of file +var _0x41b3=['moment','util','lodash','../client','create','CreateVoiceCallReport','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports'];(function(_0x193e17,_0x47983e){var _0x34a587=function(_0x4cee83){while(--_0x4cee83){_0x193e17['push'](_0x193e17['shift']());}};_0x34a587(++_0x47983e);}(_0x41b3,0x108));var _0x341b=function(_0x4e205b,_0x576979){_0x4e205b=_0x4e205b-0x0;var _0x2caadd=_0x41b3[_0x4e205b];return _0x2caadd;};'use strict';var moment=require(_0x341b('0x0'));var util=require(_0x341b('0x1'));var _=require(_0x341b('0x2'));var client=require(_0x341b('0x3'));exports[_0x341b('0x4')]=function(_0xe87d9){return client['Request'](_0x341b('0x5'),{'body':_['merge'](_0xe87d9,{'source':_0xe87d9[_0x341b('0x6')],'destinationcontext':_0xe87d9[_0x341b('0x7')],'callerid':_0xe87d9[_0x341b('0x8')],'amaflags':_0x341b('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0x341b('0xa')]=function(){return function(){return client[_0x341b('0xb')](_0x341b('0xc'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0x341b('0xd'))[_0x341b('0xe')](_0x341b('0xf')),moment()[_0x341b('0x10')](_0x341b('0xd'))[_0x341b('0xe')](_0x341b('0xf'))]}},'attributes':[_0x341b('0x11'),_0x341b('0x12'),_0x341b('0x13'),_0x341b('0x14')]},'log':_0x341b('0x15')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 2833786..a3b5984 100644 --- a/server/services/ami/rpc/voiceDialReport.js +++ b/server/services/ami/rpc/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07e5=['CreateVoiceDialReport','../client','Request'];(function(_0x5d5cf2,_0x1ce38d){var _0x13d9d7=function(_0x188d68){while(--_0x188d68){_0x5d5cf2['push'](_0x5d5cf2['shift']());}};_0x13d9d7(++_0x1ce38d);}(_0x07e5,0x169));var _0x507e=function(_0x794d77,_0x18fb9a){_0x794d77=_0x794d77-0x0;var _0xe43f95=_0x07e5[_0x794d77];return _0xe43f95;};'use strict';var client=require(_0x507e('0x0'));exports['create']=function(_0x2c86ff){return client[_0x507e('0x1')](_0x507e('0x2'),{'body':_0x2c86ff,'log':_0x507e('0x2')});}; \ No newline at end of file +var _0x4a10=['create','CreateVoiceDialReport','../client'];(function(_0x4b1cd7,_0x27b641){var _0x400e61=function(_0x51d246){while(--_0x51d246){_0x4b1cd7['push'](_0x4b1cd7['shift']());}};_0x400e61(++_0x27b641);}(_0x4a10,0x125));var _0x04a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4a10[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x04a1('0x0'));exports[_0x04a1('0x1')]=function(_0x436794){return client['Request']('CreateVoiceDialReport',{'body':_0x436794,'log':_0x04a1('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 126bb71..b2814dd 100644 --- a/server/services/ami/rpc/voiceExtension.js +++ b/server/services/ami/rpc/voiceExtension.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe13a=['getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x40dcfe,_0xea7784){var _0x389191=function(_0x4ecbab){while(--_0x4ecbab){_0x40dcfe['push'](_0x40dcfe['shift']());}};_0x389191(++_0xea7784);}(_0xe13a,0x178));var _0xae13=function(_0x36e432,_0x2762df){_0x36e432=_0x36e432-0x0;var _0x471674=_0xe13a[_0x36e432];return _0x471674;};'use strict';var client=require('../client');exports[_0xae13('0x0')]=function(){return function(){return client[_0xae13('0x1')](_0xae13('0x2'),{'options':{'raw':!![],'attributes':['id',_0xae13('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xae13('0x0')});};}; \ No newline at end of file +var _0x4e81=['../client','getVoiceExtensions','Request'];(function(_0x1d1d09,_0x504d77){var _0x8827e=function(_0x4f3128){while(--_0x4f3128){_0x1d1d09['push'](_0x1d1d09['shift']());}};_0x8827e(++_0x504d77);}(_0x4e81,0x1bc));var _0x14e8=function(_0x2cc711,_0x300328){_0x2cc711=_0x2cc711-0x0;var _0x31a52e=_0x4e81[_0x2cc711];return _0x31a52e;};'use strict';var client=require(_0x14e8('0x0'));exports[_0x14e8('0x1')]=function(){return function(){return client[_0x14e8('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x14e8('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 1410088..4cb79cb 100644 --- a/server/services/ami/rpc/voiceQueue.js +++ b/server/services/ami/rpc/voiceQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4504=['dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','interval','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','monitor_format','dialActive','dialMethod','dialLimitQueue','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0xbbe217,_0x5c3d08){var _0x2882db=function(_0x72e067){while(--_0x72e067){_0xbbe217['push'](_0xbbe217['shift']());}};_0x2882db(++_0x5c3d08);}(_0x4504,0xa5));var _0x4450=function(_0x7531f9,_0x1a2090){_0x7531f9=_0x7531f9-0x0;var _0x1d67a5=_0x4504[_0x7531f9];return _0x1d67a5;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x4450('0x0'),{'options':{'raw':![],'attributes':['id',_0x4450('0x1'),_0x4450('0x2'),_0x4450('0x3'),'autopause',_0x4450('0x4'),'type',_0x4450('0x5'),_0x4450('0x6'),'dialLimitChannel',_0x4450('0x7'),'dialPowerLevel',_0x4450('0x8'),'dialPredictiveOptimizationPercentage',_0x4450('0x9'),'dialOriginateCallerIdName',_0x4450('0xa'),_0x4450('0xb'),_0x4450('0xc'),_0x4450('0xd'),'dialQueueProject',_0x4450('0xe'),'dialCongestionRetryFrequency',_0x4450('0xf'),_0x4450('0x10'),_0x4450('0x11'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry',_0x4450('0x12'),_0x4450('0x13'),_0x4450('0x14'),_0x4450('0x15'),_0x4450('0x16'),_0x4450('0x17'),_0x4450('0x18'),_0x4450('0x19'),'dialAMDTotalAnalysisTime',_0x4450('0x1a'),'dialAMDBetweenWordsSilence',_0x4450('0x1b'),_0x4450('0x1c'),_0x4450('0x1d'),_0x4450('0x1e'),'dialRecallMeTimeout',_0x4450('0x1f'),_0x4450('0x20'),_0x4450('0x21'),_0x4450('0x22'),_0x4450('0x23'),_0x4450('0x4'),_0x4450('0x24'),_0x4450('0x25'),_0x4450('0x26'),_0x4450('0x27'),_0x4450('0x28'),_0x4450('0x29'),_0x4450('0x2a'),_0x4450('0x2b'),_0x4450('0x2c'),_0x4450('0x2d'),_0x4450('0x2e'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0x4450('0x2f'),'dialPredictiveIntervalMaxThreshold',_0x4450('0x30'),_0x4450('0x31'),_0x4450('0x32')],'include':[{'model':_0x4450('0x33'),'as':_0x4450('0x33'),'attributes':['id','name',_0x4450('0x34'),_0x4450('0x35')]},{'model':_0x4450('0x36'),'as':_0x4450('0x37'),'attributes':['id','name']},{'model':_0x4450('0x33'),'as':'TrunkBackup','attributes':['id',_0x4450('0x1'),_0x4450('0x34'),_0x4450('0x35')]},{'model':_0x4450('0x38'),'as':_0x4450('0x38'),'attributes':['id','name'],'include':[{'model':_0x4450('0x38'),'as':'Intervals','attributes':['id',_0x4450('0x1'),_0x4450('0x39')]}]}]},'log':_0x4450('0x3a')});};}; \ No newline at end of file +var _0xbc53=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval','../client','Request','GetVoiceQueue','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallInQueue','dialOrderByScheduledAt','dialQueueProject2','monitor_format','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry'];(function(_0x21b85c,_0x228e90){var _0x3667f3=function(_0x37b718){while(--_0x37b718){_0x21b85c['push'](_0x21b85c['shift']());}};_0x3667f3(++_0x228e90);}(_0xbc53,0x1e9));var _0x3bc5=function(_0x5745de,_0x5646e6){_0x5745de=_0x5745de-0x0;var _0x7a8c21=_0xbc53[_0x5745de];return _0x7a8c21;};'use strict';var client=require(_0x3bc5('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x3bc5('0x1')](_0x3bc5('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x3bc5('0x3'),_0x3bc5('0x4'),_0x3bc5('0x5'),'monitor_format',_0x3bc5('0x6'),_0x3bc5('0x7'),_0x3bc5('0x8'),_0x3bc5('0x9'),_0x3bc5('0xa'),_0x3bc5('0xb'),_0x3bc5('0xc'),_0x3bc5('0xd'),_0x3bc5('0xe'),_0x3bc5('0xf'),_0x3bc5('0x10'),_0x3bc5('0x11'),_0x3bc5('0x12'),_0x3bc5('0x13'),_0x3bc5('0x14'),_0x3bc5('0x15'),_0x3bc5('0x16'),_0x3bc5('0x17'),_0x3bc5('0x18'),_0x3bc5('0x19'),_0x3bc5('0x1a'),_0x3bc5('0x1b'),_0x3bc5('0x1c'),_0x3bc5('0x1d'),_0x3bc5('0x1e'),_0x3bc5('0x1f'),_0x3bc5('0x20'),_0x3bc5('0x21'),_0x3bc5('0x22'),'dialAMDAfterGreetingSilence',_0x3bc5('0x23'),_0x3bc5('0x24'),_0x3bc5('0x25'),_0x3bc5('0x26'),_0x3bc5('0x27'),_0x3bc5('0x28'),'timeout','dialRecallMeTimeout',_0x3bc5('0x29'),_0x3bc5('0x2a'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0x3bc5('0x2b'),_0x3bc5('0x2c'),'strategy',_0x3bc5('0x2d'),'dialCutDigit',_0x3bc5('0x2e'),_0x3bc5('0x2f'),_0x3bc5('0x30'),_0x3bc5('0x31'),_0x3bc5('0x32'),'dialAbandonedRetryFrequency',_0x3bc5('0x33'),'dialMachineRetryFrequency',_0x3bc5('0x34'),'dialAgentRejectRetryFrequency',_0x3bc5('0x35'),_0x3bc5('0x36'),_0x3bc5('0x37'),_0x3bc5('0x38'),_0x3bc5('0x39')],'include':[{'model':_0x3bc5('0x3a'),'as':_0x3bc5('0x3a'),'attributes':['id',_0x3bc5('0x3b'),_0x3bc5('0x3c'),_0x3bc5('0x3d')]},{'model':_0x3bc5('0x3e'),'as':_0x3bc5('0x3f'),'attributes':['id',_0x3bc5('0x3b')]},{'model':_0x3bc5('0x3a'),'as':'TrunkBackup','attributes':['id',_0x3bc5('0x3b'),_0x3bc5('0x3c'),_0x3bc5('0x3d')]},{'model':_0x3bc5('0x40'),'as':_0x3bc5('0x40'),'attributes':['id',_0x3bc5('0x3b')],'include':[{'model':_0x3bc5('0x40'),'as':_0x3bc5('0x41'),'attributes':['id',_0x3bc5('0x3b'),_0x3bc5('0x42')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 6f8e171..6ca7063 100644 --- a/server/services/ami/rpc/voiceQueueReport.js +++ b/server/services/ami/rpc/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x2f6f57,_0x4aa3b1){var _0xa52006=function(_0x43bc35){while(--_0x43bc35){_0x2f6f57['push'](_0x2f6f57['shift']());}};_0xa52006(++_0x4aa3b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x4ced9f,_0x125a4e){var _0x2aa4e6=function(_0x5e650f){while(--_0x5e650f){_0x4ced9f['push'](_0x4ced9f['shift']());}};_0x2aa4e6(++_0x125a4e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 5beff14..a77221d 100644 --- a/server/services/ami/rpc/voiceQueueRt.js +++ b/server/services/ami/rpc/voiceQueueRt.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3756=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0x317403,_0x2d8af0){var _0x7367cc=function(_0x187ded){while(--_0x187ded){_0x317403['push'](_0x317403['shift']());}};_0x7367cc(++_0x2d8af0);}(_0x3756,0x10d));var _0x6375=function(_0x205f68,_0x19bcd5){_0x205f68=_0x205f68-0x0;var _0x292fcf=_0x3756[_0x205f68];return _0x292fcf;};'use strict';var client=require(_0x6375('0x0'));exports[_0x6375('0x1')]=function(_0x220d5c){return function(){return client['Request'](_0x6375('0x2'),{'options':{'where':{'VoiceQueueId':_0x220d5c,'paused':!![]},'raw':!![]},'log':_0x6375('0x1')});};}; \ No newline at end of file +var _0x0aba=['Request','../client','getVoiceQueueRtPauses'];(function(_0x33fbdf,_0x20ed66){var _0x36ff82=function(_0x171c96){while(--_0x171c96){_0x33fbdf['push'](_0x33fbdf['shift']());}};_0x36ff82(++_0x20ed66);}(_0x0aba,0x190));var _0xa0ab=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x0aba[_0x2d7f0e];return _0x110b07;};'use strict';var client=require(_0xa0ab('0x0'));exports[_0xa0ab('0x1')]=function(_0x10c383){return function(){return client[_0xa0ab('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x10c383,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 3b4c117..1f07c1a 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x59dcd8,_0x515428){var _0x1bb18d=function(_0x31f275){while(--_0x31f275){_0x59dcd8['push'](_0x59dcd8['shift']());}};_0x1bb18d(++_0x515428);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0xe0ed16,_0x4c4921){var _0x263b08=function(_0x1f6d8b){while(--_0x1f6d8b){_0xe0ed16['push'](_0xe0ed16['shift']());}};_0x263b08(++_0x4c4921);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 8692de2..7a44f07 100644 --- a/server/services/ami/rpc/voiceTransferReport.js +++ b/server/services/ami/rpc/voiceTransferReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0c0=['origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode'];(function(_0x428b0d,_0x2333ad){var _0x19f96e=function(_0x5906f7){while(--_0x5906f7){_0x428b0d['push'](_0x428b0d['shift']());}};_0x19f96e(++_0x2333ad);}(_0xe0c0,0x19c));var _0x0e0c=function(_0x2683be,_0x43c1c4){_0x2683be=_0x2683be-0x0;var _0x12625e=_0xe0c0[_0x2683be];return _0x12625e;};'use strict';var client=require(_0x0e0c('0x0'));exports[_0x0e0c('0x1')]={};exports[_0x0e0c('0x2')]=function(_0x709416){return client[_0x0e0c('0x3')](_0x0e0c('0x4'),{'body':{'result':_0x709416[_0x0e0c('0x5')],'transfererchannel':_0x709416[_0x0e0c('0x6')],'transferercalleridnum':_0x709416['transferercalleridnum'],'transferercalleridname':_0x709416[_0x0e0c('0x7')],'transfererconnectedlinenum':_0x709416['transfererconnectedlinenum'],'transfererconnectedlinename':_0x709416[_0x0e0c('0x8')],'transfereraccountcode':_0x709416['transfereraccountcode'],'transferercontext':_0x709416[_0x0e0c('0x9')],'transfererexten':_0x709416[_0x0e0c('0xa')],'transfererlinkedid':_0x709416[_0x0e0c('0xb')],'transfereechannel':_0x709416['transfereechannel'],'transfereecalleridnum':_0x709416[_0x0e0c('0xc')],'transfereecalleridname':_0x709416[_0x0e0c('0xd')],'transfereeconnectedlinenum':_0x709416[_0x0e0c('0xe')],'transfereeconnectedlinename':_0x709416['transfereeconnectedlinename'],'transfereeaccountcode':_0x709416[_0x0e0c('0xf')],'transfereecontext':_0x709416[_0x0e0c('0x10')],'transfereeexten':_0x709416[_0x0e0c('0x11')],'transfereelinkedid':_0x709416[_0x0e0c('0x12')],'isexternal':_0x709416[_0x0e0c('0x13')],'context':_0x709416[_0x0e0c('0x14')],'extension':_0x709416[_0x0e0c('0x15')],'type':_0x0e0c('0x16')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x379242){return client[_0x0e0c('0x3')](_0x0e0c('0x4'),{'body':{'result':_0x379242[_0x0e0c('0x5')],'transfererchannel':_0x379242[_0x0e0c('0x17')],'transferercalleridnum':_0x379242[_0x0e0c('0x18')],'transferercalleridname':_0x379242[_0x0e0c('0x19')],'transfererconnectedlinenum':_0x379242['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x379242[_0x0e0c('0x1a')],'transfereraccountcode':_0x379242[_0x0e0c('0x1b')],'transferercontext':_0x379242['secondtransferercontext'],'transfererexten':_0x379242['secondtransfererexten'],'transfererlinkedid':_0x379242[_0x0e0c('0x1c')],'transfereechannel':_0x379242[_0x0e0c('0x1d')],'transfereecalleridnum':_0x379242[_0x0e0c('0x1e')],'transfereecalleridname':_0x379242[_0x0e0c('0x1f')],'transfereeconnectedlinenum':_0x379242[_0x0e0c('0x20')],'transfereeconnectedlinename':_0x379242['transfertargetconnectedlinename'],'transfereeaccountcode':_0x379242[_0x0e0c('0x21')],'transfereecontext':_0x379242[_0x0e0c('0x22')],'transfereeexten':_0x379242[_0x0e0c('0x23')],'transfereelinkedid':_0x379242[_0x0e0c('0x24')],'isexternal':_0x379242[_0x0e0c('0x13')],'context':_0x379242[_0x0e0c('0x25')],'extension':_0x379242[_0x0e0c('0x26')],'type':_0x0e0c('0x27')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0xd721=['transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','CreateVoiceTransferReport','transfers','blindTransfer','Request','result','transferercalleridname','transfererconnectedlinenum','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','extension','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext'];(function(_0x47d7ec,_0x17f197){var _0x98674a=function(_0x4f7db3){while(--_0x4f7db3){_0x47d7ec['push'](_0x47d7ec['shift']());}};_0x98674a(++_0x17f197);}(_0xd721,0x135));var _0x1d72=function(_0x57ac58,_0x39f1d3){_0x57ac58=_0x57ac58-0x0;var _0x31fccc=_0xd721[_0x57ac58];return _0x31fccc;};'use strict';var client=require('../client');exports[_0x1d72('0x0')]={};exports[_0x1d72('0x1')]=function(_0x5d82bb){return client[_0x1d72('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x5d82bb[_0x1d72('0x3')],'transfererchannel':_0x5d82bb['transfererchannel'],'transferercalleridnum':_0x5d82bb['transferercalleridnum'],'transferercalleridname':_0x5d82bb[_0x1d72('0x4')],'transfererconnectedlinenum':_0x5d82bb[_0x1d72('0x5')],'transfererconnectedlinename':_0x5d82bb['transfererconnectedlinename'],'transfereraccountcode':_0x5d82bb['transfereraccountcode'],'transferercontext':_0x5d82bb[_0x1d72('0x6')],'transfererexten':_0x5d82bb[_0x1d72('0x7')],'transfererlinkedid':_0x5d82bb[_0x1d72('0x8')],'transfereechannel':_0x5d82bb[_0x1d72('0x9')],'transfereecalleridnum':_0x5d82bb[_0x1d72('0xa')],'transfereecalleridname':_0x5d82bb[_0x1d72('0xb')],'transfereeconnectedlinenum':_0x5d82bb['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x5d82bb['transfereeconnectedlinename'],'transfereeaccountcode':_0x5d82bb[_0x1d72('0xc')],'transfereecontext':_0x5d82bb['transfereecontext'],'transfereeexten':_0x5d82bb[_0x1d72('0xd')],'transfereelinkedid':_0x5d82bb[_0x1d72('0xe')],'isexternal':_0x5d82bb[_0x1d72('0xf')],'context':_0x5d82bb['context'],'extension':_0x5d82bb[_0x1d72('0x10')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0x1d72('0x11')]=function(_0x5499a9){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x5499a9[_0x1d72('0x3')],'transfererchannel':_0x5499a9[_0x1d72('0x12')],'transferercalleridnum':_0x5499a9[_0x1d72('0x13')],'transferercalleridname':_0x5499a9[_0x1d72('0x14')],'transfererconnectedlinenum':_0x5499a9[_0x1d72('0x15')],'transfererconnectedlinename':_0x5499a9[_0x1d72('0x16')],'transfereraccountcode':_0x5499a9[_0x1d72('0x17')],'transferercontext':_0x5499a9[_0x1d72('0x18')],'transfererexten':_0x5499a9[_0x1d72('0x19')],'transfererlinkedid':_0x5499a9[_0x1d72('0x1a')],'transfereechannel':_0x5499a9['transfertargetchannel'],'transfereecalleridnum':_0x5499a9[_0x1d72('0x1b')],'transfereecalleridname':_0x5499a9[_0x1d72('0x1c')],'transfereeconnectedlinenum':_0x5499a9[_0x1d72('0x1d')],'transfereeconnectedlinename':_0x5499a9[_0x1d72('0x1e')],'transfereeaccountcode':_0x5499a9[_0x1d72('0x1f')],'transfereecontext':_0x5499a9[_0x1d72('0x20')],'transfereeexten':_0x5499a9[_0x1d72('0x21')],'transfereelinkedid':_0x5499a9[_0x1d72('0x22')],'isexternal':_0x5499a9[_0x1d72('0xf')],'context':_0x5499a9[_0x1d72('0x23')],'extension':_0x5499a9[_0x1d72('0x24')],'type':'attended'},'log':_0x1d72('0x25')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 1cd38ca..71df540 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0xc58eb1,_0x5da05d){var _0xb74b32=function(_0x4b8db2){while(--_0x4b8db2){_0xc58eb1['push'](_0xc58eb1['shift']());}};_0xb74b32(++_0x5da05d);}(_0xb10b,0x12a));var _0xbb10=function(_0x8fa4bc,_0x5cd2af){_0x8fa4bc=_0x8fa4bc-0x0;var _0x35b6a7=_0xb10b[_0x8fa4bc];return _0x35b6a7;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file +var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x1379fa,_0x12a645){var _0x2271e0=function(_0x4b1c79){while(--_0x4b1c79){_0x1379fa['push'](_0x1379fa['shift']());}};_0x2271e0(++_0x12a645);}(_0xb10b,0x12a));var _0xbb10=function(_0x32292b,_0x4e9525){_0x32292b=_0x32292b-0x0;var _0x1845b4=_0xb10b[_0x32292b];return _0x1845b4;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 16ce0e5..66501b4 100644 --- a/server/services/ami/trigger/cmContact/index.js +++ b/server/services/ami/trigger/cmContact/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8ed=['xmd-contactid','ListId','data3','phone','$or','destcalleridnum','calleridnum','lastName','mobile','fax','createdAt','scheduledAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','map','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','firstName','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','trigger:%s','action','toLowerCase','merge','lodash','bluebird','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','isNil','data5'];(function(_0x183b10,_0x491d3d){var _0x19c46b=function(_0x3c3270){while(--_0x3c3270){_0x183b10['push'](_0x183b10['shift']());}};_0x19c46b(++_0x491d3d);}(_0xb8ed,0xcf));var _0xdb8e=function(_0x4dd757,_0x373c86){_0x4dd757=_0x4dd757-0x0;var _0x27e361=_0xb8ed[_0x4dd757];return _0x27e361;};'use strict';var _=require(_0xdb8e('0x0'));var BPromise=require(_0xdb8e('0x1'));var Redis=require('ioredis');var util=require(_0xdb8e('0x2'));var config=require('../../../../config/environment');var logger=require(_0xdb8e('0x3'))(_0xdb8e('0x4'));var cmContactRpc=require(_0xdb8e('0x5'));config['redis']=_['defaults'](config[_0xdb8e('0x6')],{'host':_0xdb8e('0x7'),'port':0x18eb});var io=require(_0xdb8e('0x8'))(new Redis(config['redis']));function emit(_0x4ffd58,_0x80e08,_0x43dc95,_0x26c00f,_0x623e92){logger[_0xdb8e('0x9')](_0xdb8e('0xa'),_0x4ffd58,_0x80e08['id'],_0x43dc95,_0x26c00f,JSON[_0xdb8e('0xb')](_0x623e92));io['to'](_0x43dc95)[_0xdb8e('0xc')](_0x26c00f,_0x623e92);}exports[_0xdb8e('0xd')]=function(_0x47c625,_0xd32a96,_0x24eb27,_0x19ea45){var _0x508b94,_0x570b82;var _0x12f482={};var _0x304245;var _0x25c8b4=Number(_0x24eb27[_0xdb8e('0xe')]);var _0x184795=_0x24eb27['data2']?Boolean(Number(_0x24eb27['data2'])):![];var _0x4fae0d;var _0x2c1f7b=![];if(!_[_0xdb8e('0xf')](_0x24eb27[_0xdb8e('0x10')])){if(_0x24eb27[_0xdb8e('0x10')]=='1')_0x2c1f7b=!![];}if(!_0x2c1f7b){if(_0x19ea45['xmd-contactid']){_0x12f482['id']=_0x19ea45[_0xdb8e('0x11')];}}if(!_0x12f482['id']){_0x12f482[_0xdb8e('0x12')]=_0x25c8b4;_0x4fae0d=_0x24eb27[_0xdb8e('0x13')]&&_0x24eb27['data3']!=='0'?_0x24eb27[_0xdb8e('0x13')]['split'](','):[_0xdb8e('0x14')];_0x12f482[_0xdb8e('0x15')]=_['map'](_0x4fae0d,function(_0x13eab9){var _0xc3069a={};_0xc3069a[_0x13eab9]=_0x19ea45['routeId']?_0x19ea45[_0xdb8e('0x16')]:_0x19ea45[_0xdb8e('0x17')];return _0xc3069a;});_0x304245=_0x19ea45['routeId']?_0x19ea45[_0xdb8e('0x16')]:_0x19ea45[_0xdb8e('0x17')];}var _0x1df724=['id','firstName',_0xdb8e('0x18'),_0xdb8e('0x14'),_0xdb8e('0x19'),_0xdb8e('0x1a'),_0xdb8e('0x12'),_0xdb8e('0x1b'),_0xdb8e('0x1c'),'updatedAt'];var _0x2868d5=_[_0xdb8e('0x1d')](_0x1df724,_0x4fae0d);BPromise[_0xdb8e('0x1e')]()[_0xdb8e('0x1f')](cmContactRpc['getContacts']({'attributes':_0x2868d5,'where':_0x12f482,'phone':_0x304245}))['then'](function(_0x576773){_0x570b82=_0x576773;if(!_[_0xdb8e('0x20')](_0x570b82)){if(_0x570b82[_0xdb8e('0x21')]===0x1){_0x508b94=_0x570b82[0x0];logger[_0xdb8e('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x19ea45['uniqueid'],_0xd32a96['id'],_0x508b94['id']);}else{logger[_0xdb8e('0x9')](_0xdb8e('0x22'),_0x19ea45[_0xdb8e('0x23')],_0xd32a96['id'],_[_0xdb8e('0x24')](_0x570b82,'id')['join'](','));}return;}else{logger[_0xdb8e('0x9')](_0xdb8e('0x25'),_0x19ea45['uniqueid'],_0xd32a96['id']);var _0x58db78={'ListId':_0x25c8b4};var _0x312830=_0x24eb27['data4']&&_0x24eb27['data4']!=='0'?_0x24eb27[_0xdb8e('0x26')]:_0xdb8e('0x14');if(_0x184795){logger['info'](_0xdb8e('0x27'),_0x19ea45[_0xdb8e('0x23')],_0xd32a96['id']);_0x58db78[_0x312830]=_[_0xdb8e('0xf')](_0x19ea45[_0xdb8e('0x28')])?_0x19ea45[_0xdb8e('0x17')]:_0x19ea45['destcalleridnum'];if(_[_0xdb8e('0xf')](_0x19ea45[_0xdb8e('0x28')])){_0x58db78[_0xdb8e('0x29')]=_0x19ea45[_0xdb8e('0x2a')]&&_0x19ea45[_0xdb8e('0x2a')]!==_0xdb8e('0x2b')?_0x19ea45[_0xdb8e('0x2a')]:_0xdb8e('0x2c');}else{_0x58db78[_0xdb8e('0x29')]=_0x19ea45['destcalleridname']&&_0x19ea45[_0xdb8e('0x2d')]!==''?_0x19ea45[_0xdb8e('0x2d')]:_0xdb8e('0x2c');}return BPromise['resolve']()[_0xdb8e('0x1f')](cmContactRpc[_0xdb8e('0x2e')](_0x58db78))[_0xdb8e('0x1f')](function(_0x1567ad){_0x508b94=_0x1567ad;_0x570b82[_0xdb8e('0x2f')](_0x1567ad);if(_0x508b94){logger[_0xdb8e('0x9')](_0xdb8e('0x30'),_0x19ea45[_0xdb8e('0x23')],_0xd32a96['id'],_0x508b94['id']);}return;});}else{logger[_0xdb8e('0x9')](_0xdb8e('0x31'),_0x19ea45[_0xdb8e('0x23')],_0xd32a96['id']);_0x58db78[_0x312830]=_['isNil'](_0x19ea45[_0xdb8e('0x28')])?_0x19ea45[_0xdb8e('0x17')]:_0x19ea45[_0xdb8e('0x16')];if(_[_0xdb8e('0xf')](_0x19ea45[_0xdb8e('0x28')])){_0x58db78['firstName']=_0x19ea45[_0xdb8e('0x2a')]&&_0x19ea45[_0xdb8e('0x2a')]!==''?_0x19ea45[_0xdb8e('0x2a')]:_0xdb8e('0x2c');}else{_0x58db78[_0xdb8e('0x29')]=_0x19ea45[_0xdb8e('0x2d')]&&_0x19ea45['destcalleridname']!==_0xdb8e('0x2b')?_0x19ea45[_0xdb8e('0x2d')]:_0xdb8e('0x2c');}_0x508b94=_0x58db78;_0x570b82['push'](_0x58db78);return;}}})[_0xdb8e('0x1f')](function(){if(_0x47c625){emit(_0x19ea45[_0xdb8e('0x23')],_0xd32a96,util[_0xdb8e('0x32')](_0xdb8e('0x33'),_0x47c625['name']),util[_0xdb8e('0x32')](_0xdb8e('0x34'),_0x24eb27[_0xdb8e('0x35')][_0xdb8e('0x36')]()),{'evt':_[_0xdb8e('0x37')](_0x19ea45,{'autoCreate':_0x184795}),'contact':_0x508b94===undefined?{}:_0x508b94,'contacts':_0x570b82[_0xdb8e('0x21')]===0x0?undefined:_0x570b82});}});}; \ No newline at end of file +var _0xdb2d=['fax','updatedAt','union','getContacts','isEmpty','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','Unknown','destcalleridname','','resolve','createContact','then','push','[CM][%s][%s]\x20Contact\x20created:%s','format','name','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','trigger','redis','defaults','localhost','socket.io-emitter','info','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','phone','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdb2d,0x19c));var _0xddb2=function(_0x56d9d7,_0x5aa064){_0x56d9d7=_0x56d9d7-0x0;var _0x5bb9e8=_0xdb2d[_0x56d9d7];return _0x5bb9e8;};'use strict';var _=require(_0xddb2('0x0'));var BPromise=require(_0xddb2('0x1'));var Redis=require(_0xddb2('0x2'));var util=require(_0xddb2('0x3'));var config=require(_0xddb2('0x4'));var logger=require('../../../../config/logger')(_0xddb2('0x5'));var cmContactRpc=require('../../rpc/cmContact');config[_0xddb2('0x6')]=_[_0xddb2('0x7')](config[_0xddb2('0x6')],{'host':_0xddb2('0x8'),'port':0x18eb});var io=require(_0xddb2('0x9'))(new Redis(config['redis']));function emit(_0xb5650e,_0x4b6968,_0x23a871,_0x1c721a,_0x37115f){logger[_0xddb2('0xa')]('[CM][%s][%s]',_0xb5650e,_0x4b6968['id'],_0x23a871,_0x1c721a,JSON[_0xddb2('0xb')](_0x37115f));io['to'](_0x23a871)[_0xddb2('0xc')](_0x1c721a,_0x37115f);}exports[_0xddb2('0xd')]=function(_0x26b0e2,_0x36a01a,_0x3a883d,_0x482f86){var _0x24c721,_0x10c29e;var _0x405267={};var _0x45fc32;var _0xabbb2c=Number(_0x3a883d[_0xddb2('0xe')]);var _0x26a6f7=_0x3a883d[_0xddb2('0xf')]?Boolean(Number(_0x3a883d['data2'])):![];var _0x2c444a;var _0x3fb777=![];if(!_[_0xddb2('0x10')](_0x3a883d['data5'])){if(_0x3a883d[_0xddb2('0x11')]=='1')_0x3fb777=!![];}if(!_0x3fb777){if(_0x482f86['xmd-contactid']){_0x405267['id']=_0x482f86[_0xddb2('0x12')];}}if(!_0x405267['id']){_0x405267[_0xddb2('0x13')]=_0xabbb2c;_0x2c444a=_0x3a883d[_0xddb2('0x14')]&&_0x3a883d[_0xddb2('0x14')]!=='0'?_0x3a883d[_0xddb2('0x14')]['split'](','):[_0xddb2('0x15')];_0x405267['$or']=_['map'](_0x2c444a,function(_0x72e5c6){var _0x251e58={};_0x251e58[_0x72e5c6]=_0x482f86[_0xddb2('0x16')]?_0x482f86[_0xddb2('0x17')]:_0x482f86[_0xddb2('0x18')];return _0x251e58;});_0x45fc32=_0x482f86[_0xddb2('0x16')]?_0x482f86[_0xddb2('0x17')]:_0x482f86['calleridnum'];}var _0x5c8057=['id',_0xddb2('0x19'),_0xddb2('0x1a'),'phone',_0xddb2('0x1b'),_0xddb2('0x1c'),_0xddb2('0x13'),'createdAt','scheduledAt',_0xddb2('0x1d')];var _0x40a129=_[_0xddb2('0x1e')](_0x5c8057,_0x2c444a);BPromise['resolve']()['then'](cmContactRpc[_0xddb2('0x1f')]({'attributes':_0x40a129,'where':_0x405267,'phone':_0x45fc32}))['then'](function(_0x4e3e24){_0x10c29e=_0x4e3e24;if(!_[_0xddb2('0x20')](_0x10c29e)){if(_0x10c29e[_0xddb2('0x21')]===0x1){_0x24c721=_0x10c29e[0x0];logger[_0xddb2('0xa')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x482f86[_0xddb2('0x22')],_0x36a01a['id'],_0x24c721['id']);}else{logger['info'](_0xddb2('0x23'),_0x482f86[_0xddb2('0x22')],_0x36a01a['id'],_[_0xddb2('0x24')](_0x10c29e,'id')[_0xddb2('0x25')](','));}return;}else{logger[_0xddb2('0xa')](_0xddb2('0x26'),_0x482f86[_0xddb2('0x22')],_0x36a01a['id']);var _0x6cee6d={'ListId':_0xabbb2c};var _0x341de8=_0x3a883d[_0xddb2('0x27')]&&_0x3a883d[_0xddb2('0x27')]!=='0'?_0x3a883d['data4']:'phone';if(_0x26a6f7){logger['info'](_0xddb2('0x28'),_0x482f86[_0xddb2('0x22')],_0x36a01a['id']);_0x6cee6d[_0x341de8]=_[_0xddb2('0x10')](_0x482f86[_0xddb2('0x16')])?_0x482f86['calleridnum']:_0x482f86['destcalleridnum'];if(_['isNil'](_0x482f86[_0xddb2('0x16')])){_0x6cee6d[_0xddb2('0x19')]=_0x482f86[_0xddb2('0x29')]&&_0x482f86[_0xddb2('0x29')]!==''?_0x482f86[_0xddb2('0x29')]:_0xddb2('0x2a');}else{_0x6cee6d[_0xddb2('0x19')]=_0x482f86[_0xddb2('0x2b')]&&_0x482f86[_0xddb2('0x2b')]!==_0xddb2('0x2c')?_0x482f86['destcalleridname']:_0xddb2('0x2a');}return BPromise[_0xddb2('0x2d')]()['then'](cmContactRpc[_0xddb2('0x2e')](_0x6cee6d))[_0xddb2('0x2f')](function(_0x118bc1){_0x24c721=_0x118bc1;_0x10c29e[_0xddb2('0x30')](_0x118bc1);if(_0x24c721){logger['info'](_0xddb2('0x31'),_0x482f86[_0xddb2('0x22')],_0x36a01a['id'],_0x24c721['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x482f86[_0xddb2('0x22')],_0x36a01a['id']);_0x6cee6d[_0x341de8]=_[_0xddb2('0x10')](_0x482f86[_0xddb2('0x16')])?_0x482f86[_0xddb2('0x18')]:_0x482f86[_0xddb2('0x17')];if(_[_0xddb2('0x10')](_0x482f86[_0xddb2('0x16')])){_0x6cee6d[_0xddb2('0x19')]=_0x482f86[_0xddb2('0x29')]&&_0x482f86[_0xddb2('0x29')]!==_0xddb2('0x2c')?_0x482f86[_0xddb2('0x29')]:_0xddb2('0x2a');}else{_0x6cee6d[_0xddb2('0x19')]=_0x482f86[_0xddb2('0x2b')]&&_0x482f86[_0xddb2('0x2b')]!==_0xddb2('0x2c')?_0x482f86[_0xddb2('0x2b')]:'Unknown';}_0x24c721=_0x6cee6d;_0x10c29e[_0xddb2('0x30')](_0x6cee6d);return;}}})[_0xddb2('0x2f')](function(){if(_0x26b0e2){emit(_0x482f86[_0xddb2('0x22')],_0x36a01a,util[_0xddb2('0x32')]('user:%s',_0x26b0e2[_0xddb2('0x33')]),util[_0xddb2('0x32')]('trigger:%s',_0x3a883d[_0xddb2('0x34')][_0xddb2('0x35')]()),{'evt':_[_0xddb2('0x36')](_0x482f86,{'autoCreate':_0x26a6f7}),'contact':_0x24c721===undefined?{}:_0x24c721,'contacts':_0x10c29e['length']===0x0?undefined:_0x10c29e});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index c9dbab1..42cc161 100644 --- a/server/services/ami/trigger/index.js +++ b/server/services/ami/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb20=['servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:rejectmessage','custom:offlineMessage','emit','prototype','clone','motionChannel','undefined','voice','debug','interface','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','contactmanager','browser','TemplateId','html','data2','render','template\x20not\x20found','buildUri','isNil','data3','data4','windowWidth','data5','800','windowHeight','data6','format','user:%s','name','toLowerCase','jscripty','data1','trigger:%s','exec','accounts','queue','routeId','urlforward','script','parse','query','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','some','checkTrigger:\x20trigger','inspect','evt','field','account','chat','ChatWebsiteId','operator','AccountId','value','interaction','message','event','agent','membername','lastevent','null','substatus','offlineMessage','created','equals','exports','util','lodash','url','mustache','ioredis','./urlforward','./cmContact','./script','../../../config/logger','../ami','defaults','redis','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts'];(function(_0x3657d9,_0x3de284){var _0x4e5b18=function(_0x586dea){while(--_0x586dea){_0x3657d9['push'](_0x3657d9['shift']());}};_0x4e5b18(++_0x3de284);}(_0xeb20,0xea));var _0x0eb2=function(_0x59421a,_0x2a76e1){_0x59421a=_0x59421a-0x0;var _0x1bc6ec=_0xeb20[_0x59421a];return _0x1bc6ec;};'use strict';var util=require(_0x0eb2('0x0'));var _=require(_0x0eb2('0x1'));var url=require(_0x0eb2('0x2'));var Mustache=require(_0x0eb2('0x3'));var Redis=require(_0x0eb2('0x4'));var urlforward=require(_0x0eb2('0x5'));var integration=require('./integration');var cmContact=require(_0x0eb2('0x6'));var script=require(_0x0eb2('0x7'));var config=require('../../../config/environment');var logger=require(_0x0eb2('0x8'))('trigger');var ami=require(_0x0eb2('0x9'));config['redis']=_[_0x0eb2('0xa')](config[_0x0eb2('0xb')],{'host':_0x0eb2('0xc'),'port':0x18eb});var io=require(_0x0eb2('0xd'))(new Redis(config[_0x0eb2('0xb')]));var operators={'equals':function(_0xe2d197,_0x5a6cc2){return _0xe2d197==_0x5a6cc2;},'not_equals':function(_0x422296,_0x56d702){return _0x422296!=_0x56d702;}};var barAndWebActions=[_0x0eb2('0xe'),'url',_0x0eb2('0xf')];function Trigger(_0x1e17b0){this[_0x0eb2('0x10')]=_0x1e17b0['triggers'];this[_0x0eb2('0x11')]=_0x1e17b0[_0x0eb2('0x11')];this[_0x0eb2('0x12')]=_0x1e17b0[_0x0eb2('0x12')];this[_0x0eb2('0x13')]=_0x1e17b0[_0x0eb2('0x13')];this[_0x0eb2('0x14')]=_0x1e17b0[_0x0eb2('0x14')];this[_0x0eb2('0x15')]=_0x1e17b0[_0x0eb2('0x15')];this[_0x0eb2('0x16')]=_0x1e17b0[_0x0eb2('0x16')];this[_0x0eb2('0x17')]=_0x1e17b0[_0x0eb2('0x17')];this['sugarcrmAccounts']=_0x1e17b0[_0x0eb2('0x18')];this[_0x0eb2('0x19')]=_0x1e17b0[_0x0eb2('0x19')];this[_0x0eb2('0x1a')]=_0x1e17b0[_0x0eb2('0x1a')];this['vtigerAccounts']=_0x1e17b0[_0x0eb2('0x1b')];this['servicenowAccounts']=_0x1e17b0[_0x0eb2('0x1c')];this[_0x0eb2('0x1d')]=_0x1e17b0[_0x0eb2('0x1d')];this['freshsalesAccounts']=_0x1e17b0[_0x0eb2('0x1e')];this['accounts']={'zendesk':this[_0x0eb2('0x15')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x0eb2('0x16')],'sugarcrm':this[_0x0eb2('0x18')],'zoho':this[_0x0eb2('0x19')],'desk':this[_0x0eb2('0x1a')],'vtiger':this[_0x0eb2('0x1b')],'dynamics365':this[_0x0eb2('0x1d')],'freshsales':this[_0x0eb2('0x1e')],'servicenow':this[_0x0eb2('0x1c')]};ami['on'](_0x0eb2('0x1f'),this[_0x0eb2('0x20')][_0x0eb2('0x21')](this));ami['on']('custom:agentconnect',this['syncCustomEvent']['bind'](this));ami['on'](_0x0eb2('0x22'),this['syncCustomEvent'][_0x0eb2('0x21')](this));ami['on'](_0x0eb2('0x23'),this[_0x0eb2('0x20')][_0x0eb2('0x21')](this));ami['on'](_0x0eb2('0x24'),this[_0x0eb2('0x20')][_0x0eb2('0x21')](this));ami['on'](_0x0eb2('0x25'),this[_0x0eb2('0x20')]['bind'](this));ami['on'](_0x0eb2('0x26'),this[_0x0eb2('0x20')][_0x0eb2('0x21')](this));ami['on'](_0x0eb2('0x27'),this['syncCustomEvent']['bind'](this));ami['on'](_0x0eb2('0x28'),this[_0x0eb2('0x20')]['bind'](this));ami['on'](_0x0eb2('0x29'),this[_0x0eb2('0x20')]['bind'](this));ami['on'](_0x0eb2('0x2a'),this[_0x0eb2('0x20')]['bind'](this));ami['on'](_0x0eb2('0x2b'),this[_0x0eb2('0x20')][_0x0eb2('0x21')](this));ami['on'](_0x0eb2('0x2c'),this[_0x0eb2('0x2d')][_0x0eb2('0x21')](this));ami['on']('custom:dialconnect',this[_0x0eb2('0x2d')]['bind'](this));ami['on'](_0x0eb2('0x2e'),this['syncAgentDial'][_0x0eb2('0x21')](this));ami['on'](_0x0eb2('0x2f'),this[_0x0eb2('0x20')][_0x0eb2('0x21')](this));ami['on'](_0x0eb2('0x30'),this[_0x0eb2('0x20')][_0x0eb2('0x21')](this));ami['on'](_0x0eb2('0x31'),this[_0x0eb2('0x20')][_0x0eb2('0x21')](this));ami['on'](_0x0eb2('0x32'),this[_0x0eb2('0x20')][_0x0eb2('0x21')](this));ami['on']('custom:outgoingmessage',this['syncCustomEvent'][_0x0eb2('0x21')](this));ami['on']('custom:acceptmessage',this[_0x0eb2('0x20')][_0x0eb2('0x21')](this));ami['on'](_0x0eb2('0x33'),this[_0x0eb2('0x20')][_0x0eb2('0x21')](this));ami['on'](_0x0eb2('0x34'),this[_0x0eb2('0x20')][_0x0eb2('0x21')](this));}Trigger['prototype'][_0x0eb2('0x35')]=function(_0x1d0e29,_0x362169,_0x27da46){logger['info'](_0x1d0e29,_0x362169,JSON['stringify'](_0x27da46));io['to'](_0x1d0e29)['emit'](_0x362169,_0x27da46);};Trigger[_0x0eb2('0x36')][_0x0eb2('0x20')]=function(_0x1aa0f9){var _0xc85522=_[_0x0eb2('0x37')](_0x1aa0f9);if(typeof _0xc85522[_0x0eb2('0x38')]===_0x0eb2('0x39')){_0xc85522['motionChannel']=_0x0eb2('0x3a');}logger[_0x0eb2('0x3b')](_0x0eb2('0x20'),util['inspect'](_0xc85522,{'showHidden':!![],'depth':null}));this['checkTriggers'](_0xc85522);};Trigger['prototype']['syncAgentDial']=function(_0x5c0568){if(this['agents'][_0x5c0568[_0x0eb2('0x3c')]]){this[_0x0eb2('0x20')](_0x5c0568);}};Trigger['prototype'][_0x0eb2('0x3d')]=function(_0x173ed9){var _0x48a3fa;for(var _0x1603eb in this[_0x0eb2('0x10')]){if(this[_0x0eb2('0x10')][_0x0eb2('0x3e')](_0x1603eb)){if(this[_0x0eb2('0x10')][_0x1603eb][_0x0eb2('0x3f')]){_0x48a3fa=this[_0x0eb2('0x40')](this['triggers'][_0x1603eb],_0x173ed9);if(_0x48a3fa){_[_0x0eb2('0x41')](_0x173ed9,_0x173ed9[_0x0eb2('0x42')]);for(var _0x29f78a=0x0,_0x5c5d48,_0x51d71f,_0x1642ef;_0x29f78a0x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});}; \ No newline at end of file +var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3ec122,_0x55150a){_0x3ec122=_0x3ec122-0x0;var _0x4ecf41=_0x5fc3[_0x3ec122];return _0x4ecf41;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 5edaccf..78d752a 100644 --- a/server/services/ami/trigger/integration/dynamics365.js +++ b/server/services/ami/trigger/integration/dynamics365.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5d3=['serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','ticketId',']\x20Error\x20running\x20Dynamics365\x20integration','error','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','modernAuthentication','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','remoteUri','username','clientSecret','then','access_token','catch','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','isNil','email','userEmail','length','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','4.0','odata-entityid','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','value','nothing','info',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Fields','phonecall','queue','callDirection','Descriptions','/contacts(','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','trigger:browser:url','stripTrailingSlash'];(function(_0x3dac7f,_0x34c456){var _0x465894=function(_0x21b8b6){while(--_0x21b8b6){_0x3dac7f['push'](_0x3dac7f['shift']());}};_0x465894(++_0x34c456);}(_0xa5d3,0x1c8));var _0x3a5d=function(_0x1cff93,_0x132b43){_0x1cff93=_0x1cff93-0x0;var _0x2ececc=_0xa5d3[_0x1cff93];return _0x2ececc;};'use strict';var _=require(_0x3a5d('0x0'));var rp=require(_0x3a5d('0x1'));var util=require(_0x3a5d('0x2'));var intUtil=require('./util');var md5=require(_0x3a5d('0x3'));var Redis=require('ioredis');var logger=require(_0x3a5d('0x4'))(_0x3a5d('0x5'));var config=require(_0x3a5d('0x6'));config[_0x3a5d('0x7')]=_[_0x3a5d('0x8')](config['redis'],{'host':_0x3a5d('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3a5d('0x7')]));function getAuthToken(_0x183132,_0x4689fc,_0x5caa27){if(_0x183132[_0x3a5d('0xa')]){_0x183132['remoteUri']=_0x183132[_0x3a5d('0xb')][_0x3a5d('0xc')];_0x183132[_0x3a5d('0xd')]=_0x183132[_0x3a5d('0xb')][_0x3a5d('0xe')];return Promise[_0x3a5d('0xf')](_0x183132['CloudProvider'][_0x3a5d('0x10')]);}var _0x4fc27c={'method':_0x3a5d('0x11'),'uri':_0x4689fc,'form':{'client_id':_0x183132[_0x3a5d('0x12')],'resource':_0x183132[_0x3a5d('0x13')],'username':_0x183132[_0x3a5d('0x14')],'password':_0x183132['password'],'grant_type':'password','client_secret':_0x183132[_0x3a5d('0x15')]},'json':!![]};return rp(_0x4fc27c)[_0x3a5d('0x16')](function(_0xa035df){return _0xa035df[_0x3a5d('0x17')];})[_0x3a5d('0x18')](function(_0x26ccbe){logger['error']('['+[_0x5caa27[_0x3a5d('0x19')]()]+']\x20Wrong\x20credentials!');return _0x26ccbe[_0x3a5d('0x1a')];});}function getUser(_0x571eea,_0x169beb,_0x163ba1,_0x1f35e3,_0x4fdbdf,_0x431d64){return new Promise(function(_0x174488,_0x283546){return getAuthToken(_0x169beb,_0x1f35e3,_0x431d64)['then'](function(_0x5ea4c2){var _0x1eff2a={'method':_0x3a5d('0x1b'),'uri':_0x4fdbdf+_0x3a5d('0x1c'),'headers':{'Authorization':_0x3a5d('0x1d')+_0x5ea4c2,'OData-Version':'4.0'},'json':!![]};return rp(_0x1eff2a);})['then'](function(_0x59a687){var _0x1d0e2a=_0x59a687['value'];var _0x35d5b7=![];var _0x4168a8=null;if(!_[_0x3a5d('0x1e')](_0x163ba1)){if(intUtil['validateEmail'](_0x163ba1[_0x3a5d('0x1f')])){_0x571eea[_0x3a5d('0x20')]=_0x163ba1[_0x3a5d('0x1f')];for(_0x4168a8=0x0;_0x4168a8<_0x1d0e2a[_0x3a5d('0x21')];_0x4168a8++){if(_0x1d0e2a[_0x4168a8]['internalemailaddress']===_0x163ba1[_0x3a5d('0x1f')]&&!_0x1d0e2a[_0x4168a8][_0x3a5d('0x22')]){_0x35d5b7=!![];logger['info']('['+[_0x431d64[_0x3a5d('0x19')]()]+_0x3a5d('0x23')+_0x1d0e2a[_0x4168a8][_0x3a5d('0x24')]+'!');_0x571eea[_0x3a5d('0x25')]=_0x1d0e2a[_0x4168a8][_0x3a5d('0x24')];}}}}if(!_0x35d5b7){logger['info']('['+[_0x431d64[_0x3a5d('0x19')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x571eea[_0x3a5d('0x20')]=_0x169beb[_0x3a5d('0x14')];for(_0x4168a8=0x0;_0x4168a8<_0x1d0e2a[_0x3a5d('0x21')];_0x4168a8++){if(_0x1d0e2a[_0x4168a8]['internalemailaddress']===_0x169beb['username']){_0x571eea[_0x3a5d('0x25')]=_0x1d0e2a[_0x4168a8][_0x3a5d('0x24')];}}}_0x174488(_0x571eea);})['catch'](function(_0x4ef152){_0x283546(_0x4ef152[_0x3a5d('0x1a')]);});});}function createEndUser(_0x22b972,_0x54029d,_0x52229c,_0x5d813b,_0x257eba,_0xae109b,_0x40327){return new Promise(function(_0x3db45c,_0x270eae){return getAuthToken(_0x54029d,_0x52229c,_0xae109b)[_0x3a5d('0x16')](function(_0x386207){var _0x176c9c=_0xae109b[_0x3a5d('0x26')]()===_0x3a5d('0x27')?_0x257eba[_0x3a5d('0x28')]:_0x257eba[_0x3a5d('0x29')];var _0x1e346b={'method':'POST','uri':_0x5d813b+_0x3a5d('0x2a'),'body':{'fullname':_0x176c9c,'firstname':_0x176c9c,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x3a5d('0x2b')+_0x22b972['userId']+')'},'headers':{'Authorization':_0x3a5d('0x1d')+_0x386207,'OData-Version':_0x3a5d('0x2c')},'json':!![],'resolveWithFullResponse':!![]};_0x1e346b['body'][_0x40327]=_0x176c9c;return rp(_0x1e346b);})['then'](function(_0x17b17d){var _0x145d1c=_0x17b17d['headers'][_0x3a5d('0x2d')];var _0x5c9dc9=_0x145d1c[_0x3a5d('0x2e')](_0x145d1c[_0x3a5d('0x2f')]('(')+0x1,_0x145d1c[_0x3a5d('0x2f')](')'));_0x22b972[_0x3a5d('0x30')]=_0x5c9dc9;_0x3db45c(_0x22b972);})['catch'](function(_0x44d080){_0x270eae(_0x44d080[_0x3a5d('0x1a')]);});});}function getEndUser(_0x36f178,_0x5ede5c,_0x32927a,_0x4f1f8e,_0x1323a2,_0xf16f6f,_0x5372e2,_0x264679){var _0x1fd535=_0xf16f6f[_0x3a5d('0x26')]()===_0x3a5d('0x27')?_0x1323a2[_0x3a5d('0x28')]:_0x1323a2[_0x3a5d('0x29')];return getAuthToken(_0x5ede5c,_0x32927a,_0xf16f6f)['then'](function(_0x1dac4d){_0x264679=_0x264679?_0x264679:_0x3a5d('0x31');var _0x494633={'method':_0x3a5d('0x1b'),'uri':_0x4f1f8e+_0x3a5d('0x32')+_0x264679+_0x3a5d('0x33')+_0x264679+_0x3a5d('0x34')+_0x1fd535[_0x3a5d('0x35')]('+',_0x3a5d('0x36'))+'\x27','headers':{'Authorization':_0x3a5d('0x1d')+_0x1dac4d,'If-None-Match':null,'OData-Version':_0x3a5d('0x2c')},'json':!![]};return rp(_0x494633);})[_0x3a5d('0x16')](function(_0x4456a3){var _0x59bdfa=![];if(!_0x4456a3)return _0x59bdfa;var _0x22cc42=_0x4456a3[_0x3a5d('0x37')];for(var _0x2781f5=0x0;_0x2781f5<_0x22cc42[_0x3a5d('0x21')];_0x2781f5++){if(_0x22cc42[_0x2781f5][_0x264679]===_0x1fd535){_0x59bdfa=!![];_0x36f178['enduserId']=_0x22cc42[_0x2781f5]['contactid'];}}return _0x59bdfa;})[_0x3a5d('0x16')](function(_0x14b9a3){if(_0x14b9a3)return _0x36f178;if(_0x5372e2===_0x3a5d('0x38')){logger[_0x3a5d('0x39')]('['+[_0xf16f6f[_0x3a5d('0x19')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x36f178;}return createEndUser(_0x36f178,_0x5ede5c,_0x32927a,_0x4f1f8e,_0x1323a2,_0xf16f6f,_0x264679)['then'](function(_0x5211fe){logger[_0x3a5d('0x39')]('['+[_0xf16f6f[_0x3a5d('0x19')]()]+_0x3a5d('0x3a'),_0x5211fe['enduserId']);return _0x5211fe;});});}function getCustomFields(_0x5ac593,_0x46e261,_0x385f8e){var _0x5be4f5={};if(_0x5ac593[_0x3a5d('0x21')]>0x0){_[_0x3a5d('0x3b')](_0x5ac593,function(_0xd837f9){if(_[_0x3a5d('0x3c')]([_0x3a5d('0x3d'),_0x3a5d('0x3e')],_0xd837f9[_0x3a5d('0x3f')])&&_0xd837f9[_0x3a5d('0x40')]&&!_0xd837f9[_0x3a5d('0x41')]){var _0x24ccc6=_0xd837f9[_0x3a5d('0x42')][_0x3a5d('0x26')]();var _0x2795a0=_0x24ccc6[_0x3a5d('0x2e')](0x0,_0x24ccc6[_0x3a5d('0x43')]('_'));var _0x56da24=_0x24ccc6[_0x3a5d('0x2e')](_0x24ccc6[_0x3a5d('0x43')]('_')+0x1);if(_0x2795a0===_0x385f8e){_0x5be4f5[_0x56da24]=_0xd837f9[_0x3a5d('0x44')];}}});}return _0x5be4f5;}function getTicket(_0x5beea8,_0xd653c2,_0x4f2553,_0x3cbc49,_0x1d08b9,_0x3fcb88,_0x46dbd){return new Promise(function(_0x911a61,_0x2d342d){var _0x2215f8;return getAuthToken(_0xd653c2,_0x4f2553,_0x46dbd)[_0x3a5d('0x16')](function(_0x412de9){if(_0x3fcb88[_0x3a5d('0x45')]===_0x3a5d('0x46')){_0x2215f8={'method':_0x3a5d('0x11'),'uri':_0x3cbc49+_0x3a5d('0x47'),'body':Object[_0x3a5d('0x48')]({},{'title':intUtil['getString'](_0x3fcb88['Subjects'],_0x1d08b9,'\x20'),'description':intUtil[_0x3a5d('0x49')](_0x3fcb88['Descriptions'],_0x1d08b9,'\x0a'),'customerid_contact@odata.bind':_0x5beea8[_0x3a5d('0x30')]?'/contacts('+_0x5beea8[_0x3a5d('0x30')]+')':undefined,'ownerid@odata.bind':_0x3a5d('0x2b')+_0x5beea8[_0x3a5d('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x3fcb88[_0x3a5d('0x4a')],_0x1d08b9,_0x3fcb88[_0x3a5d('0x45')])),'headers':{'Authorization':_0x3a5d('0x1d')+_0x412de9,'OData-Version':_0x3a5d('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3fcb88['ticketType']===_0x3a5d('0x4b')){var _0x161cf4=_0x5beea8[_0x3a5d('0x30')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x5beea8[_0x3a5d('0x25')]+')','participationtypemask':_0x5beea8['callDirection']===_0x3a5d('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x5beea8[_0x3a5d('0x30')]+')','participationtypemask':_0x5beea8[_0x3a5d('0x4d')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x5beea8['userId']+')','participationtypemask':_0x5beea8[_0x3a5d('0x4d')]===_0x3a5d('0x4c')?0x2:0x1}];_0x2215f8={'method':_0x3a5d('0x11'),'uri':_0x3cbc49+'phonecalls','body':Object[_0x3a5d('0x48')]({},{'subject':intUtil['getString'](_0x3fcb88['Subjects'],_0x1d08b9,'\x20'),'phonenumber':String(_0x1d08b9[_0x3a5d('0x29')]),'description':intUtil[_0x3a5d('0x49')](_0x3fcb88[_0x3a5d('0x4e')],_0x1d08b9,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5beea8['enduserId']?_0x3a5d('0x4f')+_0x5beea8['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x5beea8[_0x3a5d('0x25')]+')','directioncode':_0x5beea8[_0x3a5d('0x4d')]===_0x3a5d('0x4c')?![]:!![],'phonecall_activity_parties':_0x161cf4},getCustomFields(_0x3fcb88[_0x3a5d('0x4a')],_0x1d08b9,_0x3fcb88[_0x3a5d('0x45')])),'headers':{'Authorization':_0x3a5d('0x1d')+_0x412de9,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2215f8);})[_0x3a5d('0x16')](function(_0x4645ba){var _0xdb4851=_0x4645ba['headers']['odata-entityid'];var _0x270412=_0xdb4851[_0x3a5d('0x2e')](_0xdb4851[_0x3a5d('0x2f')]('(')+0x1,_0xdb4851[_0x3a5d('0x2f')](')'));_0x5beea8['ticketId']=_0x270412;_0x911a61(_0x5beea8);})[_0x3a5d('0x18')](function(_0x2c707d){_0x2d342d(_0x2c707d['message']);});});}function emit(_0x768076,_0x2126a4,_0xfda8fd,_0xf8a7e9){var _0x52d3af={'uri':util[_0x3a5d('0x50')](_0x3a5d('0x51'),_0x768076,_0xfda8fd,_0xf8a7e9)};io['to'](util[_0x3a5d('0x50')]('user:%s',_0x2126a4))['emit'](_0x3a5d('0x52'),_0x52d3af);}exports['cs']=function(_0x38755b,_0x5c554a,_0x4e84ed,_0x39c498,_0x72ddc2,_0x5dca74,_0x235d69,_0x24a6e7){var _0x248264={};_0x5dca74['remoteUri']=_0x5dca74[_0x3a5d('0xa')]?intUtil[_0x3a5d('0x53')](_0x5dca74[_0x3a5d('0xb')][_0x3a5d('0xc')]):intUtil['stripTrailingSlash'](_0x5dca74[_0x3a5d('0x13')]);_0x5dca74['serverUrl']=intUtil[_0x3a5d('0x53')](_0x5dca74[_0x3a5d('0x54')]);_0x248264[_0x3a5d('0x4d')]=_0x24a6e7==='queue'||_0x24a6e7===_0x3a5d('0x55')?_0x3a5d('0x4c'):_0x3a5d('0x27');var _0x590707=_0x5dca74[_0x3a5d('0xa')]?util['format'](_0x3a5d('0x56'),_0x5dca74[_0x3a5d('0xb')][_0x3a5d('0xc')]):util[_0x3a5d('0x50')](_0x3a5d('0x56'),_0x5dca74[_0x3a5d('0x13')]);var _0x2822ad=util[_0x3a5d('0x50')](_0x3a5d('0x57'),_0x5dca74[_0x3a5d('0xd')]);var _0x353846=util[_0x3a5d('0x50')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5dca74['serverUrl'],_0x5c554a[_0x3a5d('0x58')],md5(_0x5c554a[_0x3a5d('0x58')]));if(_0x72ddc2&&_0x72ddc2[_0x3a5d('0x59')]){logger['info'](_0x3a5d('0x5a'),_0x3a5d('0x5b'));_0x5c554a[_0x3a5d('0x5c')]=_0x353846;}else if(_0x235d69&&_0x235d69['recordingFormat']&&_0x235d69[_0x3a5d('0x5d')]!==_0x3a5d('0x5e')){logger[_0x3a5d('0x39')](_0x3a5d('0x5f'),'Recording\x20is\x20enabled!');_0x5c554a[_0x3a5d('0x5c')]=_0x353846;}else{_0x5c554a['recordingURL']='';}return getUser(_0x248264,_0x5dca74,_0x39c498,_0x2822ad,_0x590707,_0x24a6e7)[_0x3a5d('0x16')](function(_0x2c9e24){logger[_0x3a5d('0x39')]('['+_0x24a6e7['toUpperCase']()+_0x3a5d('0x60'),_0x2c9e24[_0x3a5d('0x25')]);logger[_0x3a5d('0x39')]('['+_0x24a6e7[_0x3a5d('0x19')]()+']\x20The\x20User\x20email\x20is:',_0x2c9e24[_0x3a5d('0x20')]);return getEndUser(_0x2c9e24,_0x5dca74,_0x2822ad,_0x590707,_0x5c554a,_0x24a6e7,_0x4e84ed[_0x3a5d('0x61')],_0x4e84ed['additionalSearchContact']);})[_0x3a5d('0x16')](function(_0x46c204){logger['info']('['+_0x24a6e7[_0x3a5d('0x19')]()+_0x3a5d('0x62'),_0x46c204[_0x3a5d('0x30')]);logger[_0x3a5d('0x39')]('['+_0x24a6e7[_0x3a5d('0x19')]()+_0x3a5d('0x63'),_0x5c554a[_0x3a5d('0x29')]);return getTicket(_0x46c204,_0x5dca74,_0x2822ad,_0x590707,_0x5c554a,_0x4e84ed,_0x24a6e7);})[_0x3a5d('0x16')](function(_0x11ae37){logger[_0x3a5d('0x39')](util[_0x3a5d('0x50')]('['+_0x24a6e7[_0x3a5d('0x19')]()+_0x3a5d('0x64'),_0x4e84ed[_0x3a5d('0x45')],_0x11ae37['ticketId']));logger[_0x3a5d('0x39')](util['format']('['+_0x24a6e7[_0x3a5d('0x19')]()+_0x3a5d('0x65'),_0x24a6e7));if(_0x24a6e7!==_0x3a5d('0x55')&&_0x4e84ed[_0x3a5d('0x66')]){logger[_0x3a5d('0x39')]('['+_0x24a6e7[_0x3a5d('0x19')]()+']',_0x3a5d('0x67'));emit(_0x5dca74['remoteUri'],_0x39c498['name'],_0x4e84ed[_0x3a5d('0x45')],_0x11ae37[_0x3a5d('0x68')]);}})[_0x3a5d('0x18')](function(_0x67d488){logger['error']('['+_0x24a6e7[_0x3a5d('0x19')]()+_0x3a5d('0x69'),_0x67d488['message']);console[_0x3a5d('0x6a')](_0x3a5d('0x6b'),_0x67d488);});}; \ No newline at end of file +var _0x8ef9=['serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','data7','tenantId','CloudProvider','data2','resolve','data5','POST','clientId','username','password','clientSecret','then','access_token','error','toUpperCase','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','email','length','isdisabled','userId','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','catch','message','telephone1','&$filter=','\x20eq\x20\x27','replace','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','type','customField','indexOf','content','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','Subjects','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash'];(function(_0x157416,_0x94217){var _0x1052ea=function(_0x3b153c){while(--_0x3b153c){_0x157416['push'](_0x157416['shift']());}};_0x1052ea(++_0x94217);}(_0x8ef9,0x155));var _0x98ef=function(_0x2a193d,_0x45a856){_0x2a193d=_0x2a193d-0x0;var _0x1ab652=_0x8ef9[_0x2a193d];return _0x1ab652;};'use strict';var _=require('lodash');var rp=require(_0x98ef('0x0'));var util=require(_0x98ef('0x1'));var intUtil=require(_0x98ef('0x2'));var md5=require('md5');var Redis=require(_0x98ef('0x3'));var logger=require(_0x98ef('0x4'))(_0x98ef('0x5'));var config=require(_0x98ef('0x6'));config[_0x98ef('0x7')]=_[_0x98ef('0x8')](config[_0x98ef('0x7')],{'host':_0x98ef('0x9'),'port':0x18eb});var io=require(_0x98ef('0xa'))(new Redis(config['redis']));function getAuthToken(_0x178d22,_0x4fb55d,_0x5e6c9f){if(_0x178d22[_0x98ef('0xb')]){_0x178d22[_0x98ef('0xc')]=_0x178d22['CloudProvider'][_0x98ef('0xd')];_0x178d22[_0x98ef('0xe')]=_0x178d22[_0x98ef('0xf')][_0x98ef('0x10')];return Promise[_0x98ef('0x11')](_0x178d22[_0x98ef('0xf')][_0x98ef('0x12')]);}var _0x2c1e15={'method':_0x98ef('0x13'),'uri':_0x4fb55d,'form':{'client_id':_0x178d22[_0x98ef('0x14')],'resource':_0x178d22['remoteUri'],'username':_0x178d22[_0x98ef('0x15')],'password':_0x178d22[_0x98ef('0x16')],'grant_type':'password','client_secret':_0x178d22[_0x98ef('0x17')]},'json':!![]};return rp(_0x2c1e15)[_0x98ef('0x18')](function(_0x154b78){return _0x154b78[_0x98ef('0x19')];})['catch'](function(_0x5d68b5){logger[_0x98ef('0x1a')]('['+[_0x5e6c9f[_0x98ef('0x1b')]()]+']\x20Wrong\x20credentials!');return _0x5d68b5['message'];});}function getUser(_0x31296a,_0x4c4ab2,_0x2740da,_0x128c6d,_0x2d41b1,_0x29b767){return new Promise(function(_0x4e2688,_0x389728){return getAuthToken(_0x4c4ab2,_0x128c6d,_0x29b767)[_0x98ef('0x18')](function(_0x21d70d){var _0x1a25ea={'method':_0x98ef('0x1c'),'uri':_0x2d41b1+_0x98ef('0x1d'),'headers':{'Authorization':_0x98ef('0x1e')+_0x21d70d,'OData-Version':_0x98ef('0x1f')},'json':!![]};return rp(_0x1a25ea);})[_0x98ef('0x18')](function(_0x2a6bb4){var _0x100838=_0x2a6bb4[_0x98ef('0x20')];var _0x496ff8=![];var _0x137e25=null;if(!_[_0x98ef('0x21')](_0x2740da)){if(intUtil['validateEmail'](_0x2740da['email'])){_0x31296a['userEmail']=_0x2740da[_0x98ef('0x22')];for(_0x137e25=0x0;_0x137e25<_0x100838[_0x98ef('0x23')];_0x137e25++){if(_0x100838[_0x137e25]['internalemailaddress']===_0x2740da['email']&&!_0x100838[_0x137e25][_0x98ef('0x24')]){_0x496ff8=!![];logger['info']('['+[_0x29b767['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x100838[_0x137e25]['systemuserid']+'!');_0x31296a[_0x98ef('0x25')]=_0x100838[_0x137e25][_0x98ef('0x26')];}}}}if(!_0x496ff8){logger[_0x98ef('0x27')]('['+[_0x29b767[_0x98ef('0x1b')]()]+_0x98ef('0x28'));_0x31296a['userEmail']=_0x4c4ab2['username'];for(_0x137e25=0x0;_0x137e25<_0x100838['length'];_0x137e25++){if(_0x100838[_0x137e25]['internalemailaddress']===_0x4c4ab2[_0x98ef('0x15')]){_0x31296a[_0x98ef('0x25')]=_0x100838[_0x137e25][_0x98ef('0x26')];}}}_0x4e2688(_0x31296a);})['catch'](function(_0x3b7f46){_0x389728(_0x3b7f46['message']);});});}function createEndUser(_0x2c463d,_0x95a327,_0x1b32a8,_0x25447a,_0x221612,_0x14306e,_0x24b38f){return new Promise(function(_0x4a1d6d,_0x2e8bde){return getAuthToken(_0x95a327,_0x1b32a8,_0x14306e)[_0x98ef('0x18')](function(_0x306c02){var _0x5d7629=_0x14306e[_0x98ef('0x29')]()===_0x98ef('0x2a')?_0x221612[_0x98ef('0x2b')]:_0x221612[_0x98ef('0x2c')];var _0x4aaebc={'method':'POST','uri':_0x25447a+_0x98ef('0x2d'),'body':{'fullname':_0x5d7629,'firstname':_0x5d7629,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x98ef('0x2e')+_0x2c463d[_0x98ef('0x25')]+')'},'headers':{'Authorization':_0x98ef('0x1e')+_0x306c02,'OData-Version':_0x98ef('0x1f')},'json':!![],'resolveWithFullResponse':!![]};_0x4aaebc['body'][_0x24b38f]=_0x5d7629;return rp(_0x4aaebc);})[_0x98ef('0x18')](function(_0x5db020){var _0x110ee7=_0x5db020[_0x98ef('0x2f')][_0x98ef('0x30')];var _0x24c8c6=_0x110ee7[_0x98ef('0x31')](_0x110ee7[_0x98ef('0x32')]('(')+0x1,_0x110ee7['lastIndexOf'](')'));_0x2c463d[_0x98ef('0x33')]=_0x24c8c6;_0x4a1d6d(_0x2c463d);})[_0x98ef('0x34')](function(_0x5426dc){_0x2e8bde(_0x5426dc[_0x98ef('0x35')]);});});}function getEndUser(_0xb65579,_0x1e8dad,_0x404638,_0x5877ed,_0x19379f,_0x3b0f44,_0xb1e06c,_0x11bd8f){var _0x3b1c77=_0x3b0f44[_0x98ef('0x29')]()===_0x98ef('0x2a')?_0x19379f[_0x98ef('0x2b')]:_0x19379f['calleridnum'];return getAuthToken(_0x1e8dad,_0x404638,_0x3b0f44)[_0x98ef('0x18')](function(_0x33d86e){_0x11bd8f=_0x11bd8f?_0x11bd8f:_0x98ef('0x36');var _0x21a573={'method':_0x98ef('0x1c'),'uri':_0x5877ed+'contacts?$select='+_0x11bd8f+_0x98ef('0x37')+_0x11bd8f+_0x98ef('0x38')+_0x3b1c77[_0x98ef('0x39')]('+','%2b')+'\x27','headers':{'Authorization':_0x98ef('0x1e')+_0x33d86e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x21a573);})[_0x98ef('0x18')](function(_0x2db4cf){var _0xade9be=![];if(!_0x2db4cf)return _0xade9be;var _0x544b58=_0x2db4cf[_0x98ef('0x20')];for(var _0x215c6f=0x0;_0x215c6f<_0x544b58[_0x98ef('0x23')];_0x215c6f++){if(_0x544b58[_0x215c6f][_0x11bd8f]===_0x3b1c77){_0xade9be=!![];_0xb65579[_0x98ef('0x33')]=_0x544b58[_0x215c6f][_0x98ef('0x3a')];}}return _0xade9be;})[_0x98ef('0x18')](function(_0x3caa31){if(_0x3caa31)return _0xb65579;if(_0xb1e06c===_0x98ef('0x3b')){logger[_0x98ef('0x27')]('['+[_0x3b0f44[_0x98ef('0x1b')]()]+_0x98ef('0x3c'));return _0xb65579;}return createEndUser(_0xb65579,_0x1e8dad,_0x404638,_0x5877ed,_0x19379f,_0x3b0f44,_0x11bd8f)[_0x98ef('0x18')](function(_0x57ee9e){logger[_0x98ef('0x27')]('['+[_0x3b0f44['toUpperCase']()]+_0x98ef('0x3d'),_0x57ee9e['enduserId']);return _0x57ee9e;});});}function getCustomFields(_0x1e0346,_0x5b301d,_0x5524ae){var _0x245950={};if(_0x1e0346[_0x98ef('0x23')]>0x0){_[_0x98ef('0x3e')](_0x1e0346,function(_0x66a3d){if(_['includes']([_0x98ef('0x3f'),'picklist'],_0x66a3d[_0x98ef('0x40')])&&_0x66a3d['nameField']&&!_0x66a3d[_0x98ef('0x41')]){var _0x2471a2=_0x66a3d['idField'][_0x98ef('0x29')]();var _0x29f204=_0x2471a2[_0x98ef('0x31')](0x0,_0x2471a2[_0x98ef('0x42')]('_'));var _0x108c30=_0x2471a2[_0x98ef('0x31')](_0x2471a2[_0x98ef('0x42')]('_')+0x1);if(_0x29f204===_0x5524ae){_0x245950[_0x108c30]=_0x66a3d[_0x98ef('0x43')];}}});}return _0x245950;}function getTicket(_0x3d52a7,_0x867845,_0x12cc24,_0x5f2275,_0x533120,_0x3a84a4,_0x12f19f){return new Promise(function(_0x1e232f,_0x2de6be){var _0x126cc3;return getAuthToken(_0x867845,_0x12cc24,_0x12f19f)[_0x98ef('0x18')](function(_0x3f9bd3){if(_0x3a84a4[_0x98ef('0x44')]===_0x98ef('0x45')){_0x126cc3={'method':_0x98ef('0x13'),'uri':_0x5f2275+_0x98ef('0x46'),'body':Object[_0x98ef('0x47')]({},{'title':intUtil[_0x98ef('0x48')](_0x3a84a4['Subjects'],_0x533120,'\x20'),'description':intUtil[_0x98ef('0x48')](_0x3a84a4[_0x98ef('0x49')],_0x533120,'\x0a'),'customerid_contact@odata.bind':_0x3d52a7[_0x98ef('0x33')]?_0x98ef('0x4a')+_0x3d52a7['enduserId']+')':undefined,'ownerid@odata.bind':_0x98ef('0x2e')+_0x3d52a7[_0x98ef('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x3a84a4[_0x98ef('0x4b')],_0x533120,_0x3a84a4[_0x98ef('0x44')])),'headers':{'Authorization':'Bearer\x20'+_0x3f9bd3,'OData-Version':_0x98ef('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3a84a4[_0x98ef('0x44')]===_0x98ef('0x4c')){var _0x49a780=_0x3d52a7[_0x98ef('0x33')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x3d52a7[_0x98ef('0x25')]+')','participationtypemask':_0x3d52a7[_0x98ef('0x4d')]===_0x98ef('0x4e')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x3d52a7[_0x98ef('0x33')]+')','participationtypemask':_0x3d52a7[_0x98ef('0x4d')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x98ef('0x2e')+_0x3d52a7[_0x98ef('0x25')]+')','participationtypemask':_0x3d52a7[_0x98ef('0x4d')]===_0x98ef('0x4e')?0x2:0x1}];_0x126cc3={'method':_0x98ef('0x13'),'uri':_0x5f2275+_0x98ef('0x4f'),'body':Object['assign']({},{'subject':intUtil[_0x98ef('0x48')](_0x3a84a4[_0x98ef('0x50')],_0x533120,'\x20'),'phonenumber':String(_0x533120[_0x98ef('0x2c')]),'description':intUtil['getString'](_0x3a84a4[_0x98ef('0x49')],_0x533120,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3d52a7['enduserId']?_0x98ef('0x4a')+_0x3d52a7['enduserId']+')':undefined,'ownerid@odata.bind':_0x98ef('0x2e')+_0x3d52a7[_0x98ef('0x25')]+')','directioncode':_0x3d52a7[_0x98ef('0x4d')]==='queue'?![]:!![],'phonecall_activity_parties':_0x49a780},getCustomFields(_0x3a84a4[_0x98ef('0x4b')],_0x533120,_0x3a84a4[_0x98ef('0x44')])),'headers':{'Authorization':'Bearer\x20'+_0x3f9bd3,'OData-Version':_0x98ef('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x126cc3);})[_0x98ef('0x18')](function(_0xc77497){var _0x34700c=_0xc77497[_0x98ef('0x2f')]['odata-entityid'];var _0x514ad3=_0x34700c[_0x98ef('0x31')](_0x34700c[_0x98ef('0x32')]('(')+0x1,_0x34700c[_0x98ef('0x32')](')'));_0x3d52a7[_0x98ef('0x51')]=_0x514ad3;_0x1e232f(_0x3d52a7);})[_0x98ef('0x34')](function(_0x19087a){_0x2de6be(_0x19087a[_0x98ef('0x35')]);});});}function emit(_0x8519a5,_0x30c1b0,_0x54aded,_0x1d35ab){var _0x4a0121={'uri':util[_0x98ef('0x52')](_0x98ef('0x53'),_0x8519a5,_0x54aded,_0x1d35ab)};io['to'](util[_0x98ef('0x52')]('user:%s',_0x30c1b0))[_0x98ef('0x54')](_0x98ef('0x55'),_0x4a0121);}exports['cs']=function(_0x18eeb0,_0x5d5650,_0x401075,_0x17ad91,_0x241fa0,_0x3948bf,_0x11fd48,_0x2bf944){var _0x1c908e={};_0x3948bf[_0x98ef('0xc')]=_0x3948bf[_0x98ef('0xb')]?intUtil['stripTrailingSlash'](_0x3948bf[_0x98ef('0xf')]['data7']):intUtil[_0x98ef('0x56')](_0x3948bf[_0x98ef('0xc')]);_0x3948bf[_0x98ef('0x57')]=intUtil[_0x98ef('0x56')](_0x3948bf[_0x98ef('0x57')]);_0x1c908e[_0x98ef('0x4d')]=_0x2bf944==='queue'||_0x2bf944===_0x98ef('0x58')?'queue':_0x98ef('0x2a');var _0xc72b51=_0x3948bf[_0x98ef('0xb')]?util['format']('%s/api/data/v9.0/',_0x3948bf['CloudProvider'][_0x98ef('0xd')]):util[_0x98ef('0x52')](_0x98ef('0x59'),_0x3948bf[_0x98ef('0xc')]);var _0x5904eb=util[_0x98ef('0x52')](_0x98ef('0x5a'),_0x3948bf[_0x98ef('0xe')]);var _0x47044c=util[_0x98ef('0x52')](_0x98ef('0x5b'),_0x3948bf[_0x98ef('0x57')],_0x5d5650['uniqueid'],md5(_0x5d5650['uniqueid']));if(_0x241fa0&&_0x241fa0[_0x98ef('0x5c')]){logger['info'](_0x98ef('0x5d'),_0x98ef('0x5e'));_0x5d5650[_0x98ef('0x5f')]=_0x47044c;}else if(_0x11fd48&&_0x11fd48[_0x98ef('0x60')]&&_0x11fd48[_0x98ef('0x60')]!=='none'){logger[_0x98ef('0x27')](_0x98ef('0x61'),'Recording\x20is\x20enabled!');_0x5d5650['recordingURL']=_0x47044c;}else{_0x5d5650[_0x98ef('0x5f')]='';}return getUser(_0x1c908e,_0x3948bf,_0x17ad91,_0x5904eb,_0xc72b51,_0x2bf944)[_0x98ef('0x18')](function(_0x3b5007){logger[_0x98ef('0x27')]('['+_0x2bf944[_0x98ef('0x1b')]()+']\x20The\x20User\x20ID\x20is:',_0x3b5007[_0x98ef('0x25')]);logger[_0x98ef('0x27')]('['+_0x2bf944['toUpperCase']()+_0x98ef('0x62'),_0x3b5007['userEmail']);return getEndUser(_0x3b5007,_0x3948bf,_0x5904eb,_0xc72b51,_0x5d5650,_0x2bf944,_0x401075[_0x98ef('0x63')],_0x401075[_0x98ef('0x64')]);})[_0x98ef('0x18')](function(_0x593375){logger[_0x98ef('0x27')]('['+_0x2bf944[_0x98ef('0x1b')]()+_0x98ef('0x65'),_0x593375[_0x98ef('0x33')]);logger[_0x98ef('0x27')]('['+_0x2bf944['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x5d5650[_0x98ef('0x2c')]);return getTicket(_0x593375,_0x3948bf,_0x5904eb,_0xc72b51,_0x5d5650,_0x401075,_0x2bf944);})[_0x98ef('0x18')](function(_0x1b2f4e){logger[_0x98ef('0x27')](util[_0x98ef('0x52')]('['+_0x2bf944['toUpperCase']()+_0x98ef('0x66'),_0x401075[_0x98ef('0x44')],_0x1b2f4e[_0x98ef('0x51')]));logger[_0x98ef('0x27')](util[_0x98ef('0x52')]('['+_0x2bf944[_0x98ef('0x1b')]()+_0x98ef('0x67'),_0x2bf944));if(_0x2bf944!==_0x98ef('0x58')&&_0x401075['openNewTab']){logger[_0x98ef('0x27')]('['+_0x2bf944[_0x98ef('0x1b')]()+']',_0x98ef('0x68'));emit(_0x3948bf['remoteUri'],_0x17ad91[_0x98ef('0x69')],_0x401075['ticketType'],_0x1b2f4e[_0x98ef('0x51')]);}})[_0x98ef('0x34')](function(_0x14249b){logger['error']('['+_0x2bf944[_0x98ef('0x1b')]()+_0x98ef('0x6a'),_0x14249b[_0x98ef('0x35')]);console[_0x98ef('0x1a')]('Error\x20running\x20Dynamics365\x20integration',_0x14249b);});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index 3c2479f..e2bfe41 100644 --- a/server/services/ami/trigger/integration/freshdesk.js +++ b/server/services/ami/trigger/integration/freshdesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3cd=['[HTTP]','stringify','GET','map','includes','string','customField','nameField','content','toString','picklist','type','idField','push','variable','variableName','customVariable','Variable','toLowerCase','queue','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','catch','error','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','destcalleridname','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','lodash','ioredis','./util','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','
','Tags','name','Fields','custom_fields','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','%s/api/v2/agents','length','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug'];(function(_0x515d24,_0x443b15){var _0x5a56cb=function(_0x52180f){while(--_0x52180f){_0x515d24['push'](_0x515d24['shift']());}};_0x5a56cb(++_0x443b15);}(_0xe3cd,0x19e));var _0xde3c=function(_0x2b1e2e,_0xf6875d){_0x2b1e2e=_0x2b1e2e-0x0;var _0x430f4f=_0xe3cd[_0x2b1e2e];return _0x430f4f;};'use strict';var _=require(_0xde3c('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var Redis=require(_0xde3c('0x1'));var intUtil=require(_0xde3c('0x2'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xde3c('0x3'));config[_0xde3c('0x4')]=_[_0xde3c('0x5')](config[_0xde3c('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xde3c('0x6'))(new Redis(config[_0xde3c('0x4')]));var headers={'Content-Type':_0xde3c('0x7'),'Accept':'application/json'};function emit(_0x4ca44f,_0xe23e42,_0x34d1c6){io['to'](_0x4ca44f)[_0xde3c('0x8')](_0xe23e42,_0x34d1c6);}function getTicket(_0x90f932,_0x5b98e4,_0x5c79df,_0x5262ad,_0x51f826){logger[_0xde3c('0x9')](_0xde3c('0xa'));var _0x5f218f=_[_0xde3c('0xb')]({'responder_id':_0x5b98e4['id'],'requester_id':_0x5c79df['id'],'name':util[_0xde3c('0xc')](_0xde3c('0xd'),_0x51f826[_0xde3c('0xe')]),'phone':_0x51f826[_0xde3c('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xde3c('0x10')](_0x5262ad['Subjects'],_0x51f826,'\x20'),'description':intUtil[_0xde3c('0x10')](_0x5262ad['Descriptions'],_0x51f826,_0xde3c('0x11')),'tags':getTags(_0x5262ad[_0xde3c('0x12')],_0xde3c('0x13'))},getCustomFields(_0x5262ad[_0xde3c('0x14')],_0x51f826));_0x5f218f[_0xde3c('0x15')]=_['mapValues'](_[_0xde3c('0x16')](_0x5f218f[_0xde3c('0x15')],'id'),_0xde3c('0x17'));return request({'uri':util[_0xde3c('0xc')](_0xde3c('0x18'),_0x90f932[_0xde3c('0x19')]),'method':_0xde3c('0x1a'),'body':_0x5f218f})[_0xde3c('0x1b')](function(_0x501368){logger[_0xde3c('0x9')]('Ticket\x20created!');return _0x501368;});}function getUser(_0x162882,_0xa3ff88){if(intUtil[_0xde3c('0x1c')](_0xa3ff88)){return request({'uri':util[_0xde3c('0xc')](_0xde3c('0x1d'),_0x162882[_0xde3c('0x19')]),'qs':{'email':_0xa3ff88}})[_0xde3c('0x1b')](function(_0x35898f){if(_0x35898f[_0xde3c('0x1e')]){logger['info']('Agent\x20found!');return _[_0xde3c('0x1f')](_0x35898f,function(_0x2926aa){return _0x2926aa['contact'][_0xde3c('0x20')]===_0xa3ff88;});}else{logger[_0xde3c('0x9')](_0xde3c('0x21'));return request({'uri':util[_0xde3c('0xc')](_0xde3c('0x22'),_0x162882[_0xde3c('0x19')])})[_0xde3c('0x1b')](function(_0xc727d5){logger[_0xde3c('0x9')](_0xde3c('0x23'));return _0xc727d5;});}});}else{logger[_0xde3c('0x9')](_0xde3c('0x24'));return request({'uri':util['format'](_0xde3c('0x22'),_0x162882[_0xde3c('0x19')])})['then'](function(_0x7c58){logger[_0xde3c('0x9')](_0xde3c('0x23'));return _0x7c58;});}}function getEndUser(_0x4e7f86,_0x4c263e,_0x4d85a9){logger[_0xde3c('0x9')](_0xde3c('0x25'),_0x4d85a9);return request({'uri':util[_0xde3c('0xc')]('%s/api/v2/contacts',_0x4e7f86[_0xde3c('0x19')]),'qs':{'phone':_0x4d85a9}})[_0xde3c('0x1b')](function(_0x49a189){if(_0x49a189['length']){logger[_0xde3c('0x9')](_0xde3c('0x26'));return _['find'](_0x49a189,{'phone':_0x4d85a9});}else{logger[_0xde3c('0x9')](_0xde3c('0x27'));return request({'uri':util['format'](_0xde3c('0x28'),_0x4e7f86[_0xde3c('0x19')]),'method':'POST','body':{'name':_0x4c263e,'phone':_0x4d85a9}})[_0xde3c('0x1b')](function(_0x1fc1b7){logger['info'](_0xde3c('0x29'));return _0x1fc1b7;});}});}function getAuth(_0x1583ca){return util[_0xde3c('0xc')](_0xde3c('0x2a'),new Buffer(_0x1583ca[_0xde3c('0x2b')]+':X')['toString'](_0xde3c('0x2c')));}function request(_0x275f93){logger[_0xde3c('0x2d')](_0xde3c('0x2e'),JSON[_0xde3c('0x2f')](_0x275f93));return rp(_[_0xde3c('0x5')](_0x275f93,{'method':_0xde3c('0x30'),'headers':headers,'json':!![]}));}function getTags(_0xa05141,_0x107484){var _0x34a857=[];if(_0xa05141&&_0xa05141[_0xde3c('0x1e')]>0x0){_0x34a857=_[_0xde3c('0x31')](_0xa05141,_0x107484);}return _0x34a857;}function getCustomFields(_0x596758,_0x5fd61e){var _0x570491=[];var _0x37796f={'custom_fields':[]};if(_0x596758['length']>0x0){_['forEach'](_0x596758,function(_0x4bb297){if(_[_0xde3c('0x32')]([_0xde3c('0x33'),'picklist'],_0x4bb297['type'])&&_0x4bb297['nameField']&&!_0x4bb297[_0xde3c('0x34')]){_0x37796f[_0x4bb297[_0xde3c('0x35')]['toLowerCase']()]=_0x4bb297[_0xde3c('0x36')][_0xde3c('0x37')]();}else if(_['includes']([_0xde3c('0x33'),_0xde3c('0x38')],_0x4bb297[_0xde3c('0x39')])&&_0x4bb297[_0xde3c('0x3a')]&&_0x4bb297[_0xde3c('0x34')]){_0x37796f[_0xde3c('0x15')][_0xde3c('0x3b')]({'id':_0x4bb297[_0xde3c('0x3a')],'value':_0x4bb297[_0xde3c('0x36')][_0xde3c('0x37')]()});}else if(_0x4bb297['type']===_0xde3c('0x3c')&&_0x4bb297[_0xde3c('0x3d')]&&_0x4bb297['idField']&&_0x4bb297[_0xde3c('0x34')]){_0x5fd61e[_0x4bb297[_0xde3c('0x3d')]]&&_0x37796f[_0xde3c('0x15')][_0xde3c('0x3b')]({'id':_0x4bb297['idField'],'value':_0x5fd61e[_0x4bb297['variableName']][_0xde3c('0x37')]()});}else if(_0x4bb297[_0xde3c('0x39')]===_0xde3c('0x3e')&&_0x4bb297[_0xde3c('0x3f')]&&_0x4bb297[_0xde3c('0x3f')][_0xde3c('0x13')]&&_0x4bb297[_0xde3c('0x3a')]&&_0x4bb297['customField']){_0x5fd61e[_0x4bb297[_0xde3c('0x3f')]['name'][_0xde3c('0x40')]()]&&_0x37796f[_0xde3c('0x15')][_0xde3c('0x3b')]({'id':_0x4bb297[_0xde3c('0x3a')],'value':_0x5fd61e[_0x4bb297[_0xde3c('0x3f')][_0xde3c('0x13')][_0xde3c('0x40')]()][_0xde3c('0x37')]()});}});}return _0x37796f;}exports[_0xde3c('0x41')]=function(_0x38dfd0,_0x500cb2,_0x309e7f,_0x10fb4c,_0x2d5f93,_0x118427){var _0x23bd13,_0x303ba0;_0x118427[_0xde3c('0x19')]=intUtil['stripTrailingSlash'](_0x118427[_0xde3c('0x19')]);_0x118427[_0xde3c('0x42')]=intUtil['stripTrailingSlash'](_0x118427['serverUrl']);if(_0x2d5f93&&_0x2d5f93[_0xde3c('0x43')]){logger['info'](_0xde3c('0x44'),_0xde3c('0x45'));_0x500cb2['recordingURL']=util[_0xde3c('0xc')](_0xde3c('0x46'),_0x118427[_0xde3c('0x42')],_0x500cb2[_0xde3c('0x47')],md5(_0x500cb2['uniqueid']));}else{_0x500cb2[_0xde3c('0x48')]='';}headers[_0xde3c('0x49')]=getAuth(_0x118427);return getUser(_0x118427,_0x10fb4c[_0xde3c('0x20')])['then'](function(_0x10d9cf){_0x23bd13=_0x10d9cf;logger[_0xde3c('0x9')](_0xde3c('0x4a'),_0x23bd13['id']);return getEndUser(_0x118427,_0x500cb2[_0xde3c('0xe')],_0x500cb2['calleridnum']);})[_0xde3c('0x1b')](function(_0x23c969){_0x303ba0=_0x23c969;logger[_0xde3c('0x9')](_0xde3c('0x4b'),_0x303ba0['id']);return getTicket(_0x118427,_0x23bd13,_0x303ba0,_0x309e7f,_0x500cb2);})[_0xde3c('0x1b')](function(_0x49b02d){if(_0x49b02d&&_0x49b02d['id']){logger[_0xde3c('0x9')](_0xde3c('0x4c'));logger[_0xde3c('0x9')](_0xde3c('0x4d'),_0x49b02d['id']);logger[_0xde3c('0x9')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xde3c('0xc')](_0xde3c('0x4e'),_0x10fb4c[_0xde3c('0x13')]),_0xde3c('0x4f'),{'uri':util[_0xde3c('0xc')]('%s/helpdesk/tickets/%d',_0x118427['remoteUri'],_0x49b02d['id'])});}})[_0xde3c('0x50')](function(_0x31abe0){logger[_0xde3c('0x51')](_0xde3c('0x44'),JSON[_0xde3c('0x2f')](_0x31abe0));});};exports['outbound']=function(_0x4ac5a8,_0x3b8193,_0x18f05c,_0xa4970,_0x30ad3e,_0x19142d,_0x5ca132){var _0x4f8c37,_0x5b4226;_0x19142d['remoteUri']=intUtil['stripTrailingSlash'](_0x19142d['remoteUri']);_0x19142d[_0xde3c('0x42')]=intUtil[_0xde3c('0x52')](_0x19142d[_0xde3c('0x42')]);if(_0x5ca132&&_0x5ca132['recordingFormat']&&_0x5ca132[_0xde3c('0x53')]!==_0xde3c('0x54')){logger[_0xde3c('0x9')](_0xde3c('0x55'),'Recording\x20is\x20enabled!');_0x3b8193[_0xde3c('0x48')]=util[_0xde3c('0xc')](_0xde3c('0x46'),_0x19142d[_0xde3c('0x42')],_0x3b8193[_0xde3c('0x47')],md5(_0x3b8193[_0xde3c('0x47')]));}headers['Authorization']=getAuth(_0x19142d);return getUser(_0x19142d,_0xa4970[_0xde3c('0x20')])['then'](function(_0x5c2d21){_0x4f8c37=_0x5c2d21;logger[_0xde3c('0x9')](_0xde3c('0x4a'),_0x4f8c37['id']);return getEndUser(_0x19142d,_0x3b8193[_0xde3c('0x56')],_0x3b8193['destcalleridnum']);})[_0xde3c('0x1b')](function(_0x2c9b71){_0x5b4226=_0x2c9b71;logger[_0xde3c('0x9')](_0xde3c('0x4b'),_0x5b4226['id']);return getTicket(_0x19142d,_0x4f8c37,_0x5b4226,_0x18f05c,_0x3b8193);})[_0xde3c('0x1b')](function(_0x4a4059){if(_0x4a4059&&_0x4a4059['id']){logger[_0xde3c('0x9')]('Ticket\x20created!');logger[_0xde3c('0x9')](_0xde3c('0x4d'),_0x4a4059['id']);logger['info'](_0xde3c('0x55'),_0xde3c('0x57'));emit(util[_0xde3c('0xc')](_0xde3c('0x4e'),_0xa4970[_0xde3c('0x13')]),_0xde3c('0x4f'),{'uri':util[_0xde3c('0xc')](_0xde3c('0x58'),_0x19142d[_0xde3c('0x19')],_0x4a4059['id'])});}})[_0xde3c('0x50')](function(_0x560d75){logger[_0xde3c('0x51')](_0xde3c('0x55'),JSON[_0xde3c('0x2f')](_0x560d75));});};exports[_0xde3c('0x59')]=function(_0x2c8de0,_0x236064,_0x47cac4,_0x56cfdb,_0x43f5e8,_0x51fe59){var _0x389b86,_0x400c91;_0x51fe59['remoteUri']=intUtil[_0xde3c('0x52')](_0x51fe59[_0xde3c('0x19')]);_0x51fe59[_0xde3c('0x42')]=intUtil[_0xde3c('0x52')](_0x51fe59['serverUrl']);if(_0x43f5e8&&_0x43f5e8['monitor_format']){logger['info']('['+_0x236064[_0xde3c('0x5a')][_0xde3c('0x5b')]()+']',_0xde3c('0x45'));_0x236064['recordingURL']=util['format'](_0xde3c('0x46'),_0x51fe59[_0xde3c('0x42')],_0x236064[_0xde3c('0x47')],md5(_0x236064[_0xde3c('0x47')]));}else{_0x236064[_0xde3c('0x48')]='';}headers[_0xde3c('0x49')]=getAuth(_0x51fe59);return getUser(_0x51fe59,'')[_0xde3c('0x1b')](function(_0x462a5f){_0x389b86=_0x462a5f;logger[_0xde3c('0x9')](_0xde3c('0x4a'),_0x389b86['id']);return getEndUser(_0x51fe59,_0x236064[_0xde3c('0xe')],_0x236064[_0xde3c('0xf')]);})[_0xde3c('0x1b')](function(_0x5b2d08){_0x400c91=_0x5b2d08;logger['info']('The\x20Enduser\x20ID\x20is:',_0x400c91['id']);return getTicket(_0x51fe59,_0x389b86,_0x400c91,_0x47cac4,_0x236064);})[_0xde3c('0x1b')](function(_0x1bb0bc){if(_0x1bb0bc){logger[_0xde3c('0x9')](_0xde3c('0x4c'));logger[_0xde3c('0x9')]('The\x20Ticket\x20ID\x20is:',_0x1bb0bc['id']);}})[_0xde3c('0x50')](function(_0x7e1503){logger[_0xde3c('0x51')]('['+_0x236064[_0xde3c('0x5a')][_0xde3c('0x5b')]()+']',JSON['stringify'](_0x7e1503));});}; \ No newline at end of file +var _0x7e51=['stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','%s/helpdesk/tickets/%d','error','stringify','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','unmanaged','lastevent','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','toUpperCase','util','ioredis','../../../../config/environment','redis','defaults','localhost','application/json','emit','Creating\x20new\x20ticket...','merge','format','calleridname','getString','Subjects','Descriptions','
','Tags','custom_fields','mapValues','keyBy','%s/api/v2/tickets','POST','then','info','Ticket\x20created!','validateEmail','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','remoteUri','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','map','forEach','string','picklist','type','nameField','customField','toLowerCase','content','includes','idField','push','variable','variableName','customVariable','Variable','name','queue'];(function(_0x5dbcd3,_0x9600f6){var _0x32453c=function(_0x39531a){while(--_0x39531a){_0x5dbcd3['push'](_0x5dbcd3['shift']());}};_0x32453c(++_0x9600f6);}(_0x7e51,0x77));var _0x17e5=function(_0x45d770,_0xb3f144){_0x45d770=_0x45d770-0x0;var _0x45acbc=_0x7e51[_0x45d770];return _0x45acbc;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x17e5('0x0'));var Redis=require(_0x17e5('0x1'));var intUtil=require('./util');var config=require(_0x17e5('0x2'));var logger=require('../../../../config/logger')('freshdesk');config[_0x17e5('0x3')]=_[_0x17e5('0x4')](config[_0x17e5('0x3')],{'host':_0x17e5('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x17e5('0x3')]));var headers={'Content-Type':_0x17e5('0x6'),'Accept':_0x17e5('0x6')};function emit(_0xfc9c96,_0x59e9c0,_0x307a67){io['to'](_0xfc9c96)[_0x17e5('0x7')](_0x59e9c0,_0x307a67);}function getTicket(_0x238e46,_0x503b18,_0x13d6bd,_0x26c5b8,_0x4d52d9){logger['info'](_0x17e5('0x8'));var _0xd795e=_[_0x17e5('0x9')]({'responder_id':_0x503b18['id'],'requester_id':_0x13d6bd['id'],'name':util[_0x17e5('0xa')]('Caller\x20-\x20%s',_0x4d52d9[_0x17e5('0xb')]),'phone':_0x4d52d9['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x17e5('0xc')](_0x26c5b8[_0x17e5('0xd')],_0x4d52d9,'\x20'),'description':intUtil[_0x17e5('0xc')](_0x26c5b8[_0x17e5('0xe')],_0x4d52d9,_0x17e5('0xf')),'tags':getTags(_0x26c5b8[_0x17e5('0x10')],'name')},getCustomFields(_0x26c5b8['Fields'],_0x4d52d9));_0xd795e[_0x17e5('0x11')]=_[_0x17e5('0x12')](_[_0x17e5('0x13')](_0xd795e[_0x17e5('0x11')],'id'),'value');return request({'uri':util[_0x17e5('0xa')](_0x17e5('0x14'),_0x238e46['remoteUri']),'method':_0x17e5('0x15'),'body':_0xd795e})[_0x17e5('0x16')](function(_0x472b2c){logger[_0x17e5('0x17')](_0x17e5('0x18'));return _0x472b2c;});}function getUser(_0x23eac3,_0x343c64){if(intUtil[_0x17e5('0x19')](_0x343c64)){return request({'uri':util[_0x17e5('0xa')]('%s/api/v2/agents',_0x23eac3['remoteUri']),'qs':{'email':_0x343c64}})['then'](function(_0x781542){if(_0x781542['length']){logger[_0x17e5('0x17')](_0x17e5('0x1a'));return _['find'](_0x781542,function(_0x164db4){return _0x164db4[_0x17e5('0x1b')][_0x17e5('0x1c')]===_0x343c64;});}else{logger[_0x17e5('0x17')](_0x17e5('0x1d'));return request({'uri':util[_0x17e5('0xa')](_0x17e5('0x1e'),_0x23eac3['remoteUri'])})[_0x17e5('0x16')](function(_0x55ed82){logger['info'](_0x17e5('0x1f'));return _0x55ed82;});}});}else{logger[_0x17e5('0x17')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x17e5('0xa')]('%s/api/v2/agents/me',_0x23eac3[_0x17e5('0x20')])})[_0x17e5('0x16')](function(_0x330fbc){logger[_0x17e5('0x17')](_0x17e5('0x1f'));return _0x330fbc;});}}function getEndUser(_0x1728b2,_0x3fe83d,_0x28f6bb){logger[_0x17e5('0x17')](_0x17e5('0x21'),_0x28f6bb);return request({'uri':util['format'](_0x17e5('0x22'),_0x1728b2[_0x17e5('0x20')]),'qs':{'phone':_0x28f6bb}})[_0x17e5('0x16')](function(_0x496030){if(_0x496030[_0x17e5('0x23')]){logger['info']('Enduser\x20found!');return _[_0x17e5('0x24')](_0x496030,{'phone':_0x28f6bb});}else{logger[_0x17e5('0x17')](_0x17e5('0x25'));return request({'uri':util[_0x17e5('0xa')](_0x17e5('0x22'),_0x1728b2[_0x17e5('0x20')]),'method':_0x17e5('0x15'),'body':{'name':_0x3fe83d,'phone':_0x28f6bb}})['then'](function(_0x51bdc6){logger[_0x17e5('0x17')](_0x17e5('0x26'));return _0x51bdc6;});}});}function getAuth(_0x5b6dd0){return util[_0x17e5('0xa')](_0x17e5('0x27'),new Buffer(_0x5b6dd0[_0x17e5('0x28')]+':X')[_0x17e5('0x29')](_0x17e5('0x2a')));}function request(_0x4c0d6e){logger[_0x17e5('0x2b')](_0x17e5('0x2c'),JSON['stringify'](_0x4c0d6e));return rp(_['defaults'](_0x4c0d6e,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x1866c5,_0x4529c4){var _0x71ab3e=[];if(_0x1866c5&&_0x1866c5[_0x17e5('0x23')]>0x0){_0x71ab3e=_[_0x17e5('0x2d')](_0x1866c5,_0x4529c4);}return _0x71ab3e;}function getCustomFields(_0x19714e,_0x3922a8){var _0x56b316=[];var _0x33367c={'custom_fields':[]};if(_0x19714e[_0x17e5('0x23')]>0x0){_[_0x17e5('0x2e')](_0x19714e,function(_0x568a95){if(_['includes']([_0x17e5('0x2f'),_0x17e5('0x30')],_0x568a95[_0x17e5('0x31')])&&_0x568a95[_0x17e5('0x32')]&&!_0x568a95[_0x17e5('0x33')]){_0x33367c[_0x568a95[_0x17e5('0x32')][_0x17e5('0x34')]()]=_0x568a95[_0x17e5('0x35')][_0x17e5('0x29')]();}else if(_[_0x17e5('0x36')](['string',_0x17e5('0x30')],_0x568a95[_0x17e5('0x31')])&&_0x568a95[_0x17e5('0x37')]&&_0x568a95[_0x17e5('0x33')]){_0x33367c['custom_fields'][_0x17e5('0x38')]({'id':_0x568a95[_0x17e5('0x37')],'value':_0x568a95[_0x17e5('0x35')]['toString']()});}else if(_0x568a95[_0x17e5('0x31')]===_0x17e5('0x39')&&_0x568a95[_0x17e5('0x3a')]&&_0x568a95[_0x17e5('0x37')]&&_0x568a95[_0x17e5('0x33')]){_0x3922a8[_0x568a95[_0x17e5('0x3a')]]&&_0x33367c[_0x17e5('0x11')]['push']({'id':_0x568a95[_0x17e5('0x37')],'value':_0x3922a8[_0x568a95[_0x17e5('0x3a')]][_0x17e5('0x29')]()});}else if(_0x568a95['type']===_0x17e5('0x3b')&&_0x568a95['Variable']&&_0x568a95[_0x17e5('0x3c')][_0x17e5('0x3d')]&&_0x568a95[_0x17e5('0x37')]&&_0x568a95['customField']){_0x3922a8[_0x568a95[_0x17e5('0x3c')]['name']['toLowerCase']()]&&_0x33367c[_0x17e5('0x11')][_0x17e5('0x38')]({'id':_0x568a95[_0x17e5('0x37')],'value':_0x3922a8[_0x568a95[_0x17e5('0x3c')]['name'][_0x17e5('0x34')]()][_0x17e5('0x29')]()});}});}return _0x33367c;}exports[_0x17e5('0x3e')]=function(_0x7ce547,_0x9b830b,_0x14b66d,_0x52b9ec,_0x7c886e,_0x59279b){var _0x35d0aa,_0x2bfe87;_0x59279b[_0x17e5('0x20')]=intUtil[_0x17e5('0x3f')](_0x59279b['remoteUri']);_0x59279b[_0x17e5('0x40')]=intUtil['stripTrailingSlash'](_0x59279b[_0x17e5('0x40')]);if(_0x7c886e&&_0x7c886e[_0x17e5('0x41')]){logger[_0x17e5('0x17')](_0x17e5('0x42'),_0x17e5('0x43'));_0x9b830b[_0x17e5('0x44')]=util[_0x17e5('0xa')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x59279b[_0x17e5('0x40')],_0x9b830b[_0x17e5('0x45')],md5(_0x9b830b[_0x17e5('0x45')]));}else{_0x9b830b[_0x17e5('0x44')]='';}headers[_0x17e5('0x46')]=getAuth(_0x59279b);return getUser(_0x59279b,_0x52b9ec[_0x17e5('0x1c')])[_0x17e5('0x16')](function(_0x4b6714){_0x35d0aa=_0x4b6714;logger[_0x17e5('0x17')]('The\x20User\x20ID\x20is:',_0x35d0aa['id']);return getEndUser(_0x59279b,_0x9b830b[_0x17e5('0xb')],_0x9b830b[_0x17e5('0x47')]);})['then'](function(_0x648ed2){_0x2bfe87=_0x648ed2;logger[_0x17e5('0x17')](_0x17e5('0x48'),_0x2bfe87['id']);return getTicket(_0x59279b,_0x35d0aa,_0x2bfe87,_0x14b66d,_0x9b830b);})[_0x17e5('0x16')](function(_0x25b2d2){if(_0x25b2d2&&_0x25b2d2['id']){logger[_0x17e5('0x17')](_0x17e5('0x18'));logger['info'](_0x17e5('0x49'),_0x25b2d2['id']);logger[_0x17e5('0x17')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x17e5('0xa')](_0x17e5('0x4a'),_0x52b9ec[_0x17e5('0x3d')]),'trigger:browser:url',{'uri':util[_0x17e5('0xa')](_0x17e5('0x4b'),_0x59279b[_0x17e5('0x20')],_0x25b2d2['id'])});}})['catch'](function(_0x6ec891){logger[_0x17e5('0x4c')]('[QUEUE]',JSON[_0x17e5('0x4d')](_0x6ec891));});};exports[_0x17e5('0x4e')]=function(_0x4197ce,_0x3d48d0,_0xdfb297,_0x473b18,_0x44e2f4,_0x22fc0d,_0x25aa8a){var _0xf88600,_0x54191e;_0x22fc0d[_0x17e5('0x20')]=intUtil[_0x17e5('0x3f')](_0x22fc0d[_0x17e5('0x20')]);_0x22fc0d[_0x17e5('0x40')]=intUtil[_0x17e5('0x3f')](_0x22fc0d[_0x17e5('0x40')]);if(_0x25aa8a&&_0x25aa8a[_0x17e5('0x4f')]&&_0x25aa8a['recordingFormat']!==_0x17e5('0x50')){logger['info'](_0x17e5('0x51'),_0x17e5('0x43'));_0x3d48d0[_0x17e5('0x44')]=util[_0x17e5('0xa')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x22fc0d[_0x17e5('0x40')],_0x3d48d0[_0x17e5('0x45')],md5(_0x3d48d0[_0x17e5('0x45')]));}headers[_0x17e5('0x46')]=getAuth(_0x22fc0d);return getUser(_0x22fc0d,_0x473b18[_0x17e5('0x1c')])['then'](function(_0x322ec1){_0xf88600=_0x322ec1;logger['info'](_0x17e5('0x52'),_0xf88600['id']);return getEndUser(_0x22fc0d,_0x3d48d0[_0x17e5('0x53')],_0x3d48d0['destcalleridnum']);})[_0x17e5('0x16')](function(_0x4e9364){_0x54191e=_0x4e9364;logger[_0x17e5('0x17')](_0x17e5('0x48'),_0x54191e['id']);return getTicket(_0x22fc0d,_0xf88600,_0x54191e,_0xdfb297,_0x3d48d0);})[_0x17e5('0x16')](function(_0x11d414){if(_0x11d414&&_0x11d414['id']){logger[_0x17e5('0x17')](_0x17e5('0x18'));logger[_0x17e5('0x17')](_0x17e5('0x49'),_0x11d414['id']);logger[_0x17e5('0x17')](_0x17e5('0x51'),_0x17e5('0x54'));emit(util['format'](_0x17e5('0x4a'),_0x473b18['name']),_0x17e5('0x55'),{'uri':util['format'](_0x17e5('0x4b'),_0x22fc0d[_0x17e5('0x20')],_0x11d414['id'])});}})[_0x17e5('0x56')](function(_0x484bff){logger['error'](_0x17e5('0x51'),JSON[_0x17e5('0x4d')](_0x484bff));});};exports[_0x17e5('0x57')]=function(_0x9b2e8e,_0x384b1e,_0x4afe7d,_0x3a36a3,_0x224321,_0xf4259f){var _0x3f5b28,_0x1bfbc8;_0xf4259f[_0x17e5('0x20')]=intUtil[_0x17e5('0x3f')](_0xf4259f[_0x17e5('0x20')]);_0xf4259f['serverUrl']=intUtil[_0x17e5('0x3f')](_0xf4259f[_0x17e5('0x40')]);if(_0x224321&&_0x224321[_0x17e5('0x41')]){logger['info']('['+_0x384b1e[_0x17e5('0x58')]['toUpperCase']()+']',_0x17e5('0x43'));_0x384b1e[_0x17e5('0x44')]=util['format'](_0x17e5('0x59'),_0xf4259f['serverUrl'],_0x384b1e['uniqueid'],md5(_0x384b1e[_0x17e5('0x45')]));}else{_0x384b1e[_0x17e5('0x44')]='';}headers[_0x17e5('0x46')]=getAuth(_0xf4259f);return getUser(_0xf4259f,'')[_0x17e5('0x16')](function(_0x5d4fa7){_0x3f5b28=_0x5d4fa7;logger[_0x17e5('0x17')]('The\x20User\x20ID\x20is:',_0x3f5b28['id']);return getEndUser(_0xf4259f,_0x384b1e[_0x17e5('0xb')],_0x384b1e[_0x17e5('0x47')]);})[_0x17e5('0x16')](function(_0x1acd69){_0x1bfbc8=_0x1acd69;logger[_0x17e5('0x17')](_0x17e5('0x48'),_0x1bfbc8['id']);return getTicket(_0xf4259f,_0x3f5b28,_0x1bfbc8,_0x4afe7d,_0x384b1e);})[_0x17e5('0x16')](function(_0x4edbd5){if(_0x4edbd5){logger[_0x17e5('0x17')]('Ticket\x20created!');logger[_0x17e5('0x17')](_0x17e5('0x49'),_0x4edbd5['id']);}})[_0x17e5('0x56')](function(_0x44090c){logger[_0x17e5('0x4c')]('['+_0x384b1e[_0x17e5('0x58')][_0x17e5('0x5a')]()+']',JSON[_0x17e5('0x4d')](_0x44090c));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index 4f0ea16..003ad0f 100644 --- a/server/services/ami/trigger/integration/freshsales.js +++ b/server/services/ami/trigger/integration/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5466=['YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','error','Creating\x20new\x20task','Subjects','getString','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','calleridnum','callDirection','queue','unmanaged','outbound','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','info','Admin\x20found:','catch','toUpperCase','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','Requested\x20Resource\x20not\x20Found','message','&f=','&entities=contact','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','POST','/api/contacts'];(function(_0xc10e38,_0x4749da){var _0x50736e=function(_0x260176){while(--_0x260176){_0xc10e38['push'](_0xc10e38['shift']());}};_0x50736e(++_0x4749da);}(_0x5466,0x7b));var _0x6546=function(_0x3da904,_0x50d883){_0x3da904=_0x3da904-0x0;var _0x2fe771=_0x5466[_0x3da904];return _0x2fe771;};'use strict';var _=require(_0x6546('0x0'));var rp=require(_0x6546('0x1'));var md5=require(_0x6546('0x2'));var util=require(_0x6546('0x3'));var moment=require(_0x6546('0x4'));var Promise=require(_0x6546('0x5'));var Redis=require(_0x6546('0x6'));var intUtil=require(_0x6546('0x7'));var config=require(_0x6546('0x8'));var logger=require(_0x6546('0x9'))('freshsales');config[_0x6546('0xa')]=_[_0x6546('0xb')](config[_0x6546('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x6546('0xc'))(new Redis(config[_0x6546('0xa')]));function getAdminId(_0x2de233,_0x21c5b1,_0x3084ff,_0x35d46a){return new Promise(function(_0x2147c3,_0x39113f){var _0x502bdd=![];var _0x5e0b62={'method':_0x6546('0xd'),'uri':_0x35d46a+_0x6546('0xe'),'json':!![]};_0x5e0b62[_0x6546('0xf')]=_0x3084ff;logger['info'](_0x6546('0x10'));return rp(_0x5e0b62)[_0x6546('0x11')](function(_0x2c0eea){if(_0x2c0eea){var _0x18a07f=_0x2c0eea['users'];var _0x3ac44a=null;for(_0x3ac44a=0x0;_0x3ac44a<_0x18a07f[_0x6546('0x12')];_0x3ac44a++){if(_0x18a07f[_0x3ac44a][_0x6546('0x13')]===_0x2de233[_0x6546('0x14')]){_0x2de233[_0x6546('0x15')]=_0x18a07f[_0x3ac44a]['id'];_0x502bdd=!![];}}if(_0x502bdd){logger[_0x6546('0x16')](_0x6546('0x17'),_0x2de233[_0x6546('0x15')]);_0x2147c3(_0x2de233);}else{_0x39113f({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x39113f({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x6546('0x18')](function(_0x9017ad){logger['error']('['+[_0x21c5b1[_0x6546('0x19')]()]+']',_0x9017ad['message']);_0x39113f(_0x9017ad);});});}function getUser(_0x5501a3,_0x421511,_0x1c6dcf){return function(_0x3dfb9f){return new Promise(function(_0x563d68,_0x2f745f){var _0x2c3ed4={'method':_0x6546('0xd'),'uri':_0x1c6dcf+_0x6546('0xe'),'json':!![]};_0x2c3ed4['headers']=_0x421511;logger[_0x6546('0x16')]('Getting\x20user\x20list');return rp(_0x2c3ed4)[_0x6546('0x11')](function(_0x441239){if(_0x441239){var _0x1a41cc=_0x441239['users'];var _0x5255fa=![];var _0xf3fc04=null;if(_0x3dfb9f['agentEmail']!==null){logger[_0x6546('0x16')](_0x6546('0x1a'),_0x3dfb9f[_0x6546('0x1b')]);_0x3dfb9f[_0x6546('0x1c')]=_0x3dfb9f[_0x6546('0x1b')];for(_0xf3fc04=0x0;_0xf3fc04<_0x1a41cc[_0x6546('0x12')];_0xf3fc04++){if(_0x1a41cc[_0xf3fc04][_0x6546('0x13')]===_0x3dfb9f[_0x6546('0x1b')]){_0x5255fa=!![];_0x3dfb9f[_0x6546('0x1d')]=_0x1a41cc[_0xf3fc04]['id'];logger[_0x6546('0x16')](_0x6546('0x1e'),_0x3dfb9f[_0x6546('0x1d')]);}}}if(!_0x5255fa){logger[_0x6546('0x16')](_0x6546('0x1f'));_0x3dfb9f[_0x6546('0x1c')]=_0x3dfb9f[_0x6546('0x14')];_0x3dfb9f[_0x6546('0x1d')]=_0x3dfb9f[_0x6546('0x15')];_0x5255fa=!![];}if(_0x5255fa){_0x563d68(_0x3dfb9f);}else{_0x2f745f({'statusCode':0x194,'message':_0x6546('0x20')});}}else{_0x2f745f({'statusCode':0x194,'message':_0x6546('0x20')});}})[_0x6546('0x18')](function(_0x2445d7){logger['error']('['+[_0x5501a3[_0x6546('0x19')]()]+']',_0x2445d7[_0x6546('0x21')]);_0x2f745f(_0x2445d7);});});};}function searchContact(_0x1bbce4,_0x54ba82,_0x4c97da,_0x15031e){return new Promise(function(_0x6874bb,_0x2694d7){var _0x3df5c8={'method':_0x6546('0xd'),'headers':_0x54ba82,'uri':_0x1bbce4+'/api/lookup?q='+_0x15031e+_0x6546('0x22')+_0x4c97da+_0x6546('0x23'),'json':!![]};rp(_0x3df5c8)[_0x6546('0x11')](function(_0x5d54f0){var _0x536d06=_['find'](_0x5d54f0[_0x6546('0x24')][_0x6546('0x24')],[_0x4c97da,_0x15031e]);_0x6874bb(_0x536d06);})[_0x6546('0x18')](function(_0x57eb27){_0x2694d7(_0x57eb27);});});}function getEndUser(_0x56dae4,_0x40c04c,_0x21619e){return function(_0x254c02){return new Promise(function(_0x4de030,_0x1736b3){logger[_0x6546('0x16')](util[_0x6546('0x25')]('Searching\x20contact\x20with\x20phone\x20%s',_0x254c02[_0x6546('0x26')]));searchContact(_0x21619e,_0x40c04c,_0x6546('0x27'),_0x254c02[_0x6546('0x26')])[_0x6546('0x11')](function(_0x399e32){if(_0x399e32){_0x254c02[_0x6546('0x28')]=_0x399e32['id'];logger[_0x6546('0x16')](_0x6546('0x29'),_0x254c02[_0x6546('0x28')]);return _0x4de030(_0x254c02);}searchContact(_0x21619e,_0x40c04c,'work_number',_0x254c02[_0x6546('0x26')])[_0x6546('0x11')](function(_0x2a6d3c){if(_0x2a6d3c){_0x254c02[_0x6546('0x28')]=_0x2a6d3c['id'];logger[_0x6546('0x16')](_0x6546('0x2a'),_0x254c02[_0x6546('0x28')]);return _0x4de030(_0x254c02);}createEndUser(_0x254c02,_0x56dae4,_0x40c04c,_0x21619e)[_0x6546('0x11')](function(_0x47c9d0){logger[_0x6546('0x16')]('Contact\x20created:',_0x47c9d0[_0x6546('0x28')]);return _0x4de030(_0x47c9d0);});});})['catch'](function(_0x6c5c90){_0x1736b3(_0x6c5c90);});});};}function createEndUser(_0xb41133,_0xd95ccc,_0x4c78d6,_0x3a239b){return new Promise(function(_0x54d5c0,_0x1e316e){var _0x198037=moment();var _0x39c51a={'method':_0x6546('0x2b'),'uri':_0x3a239b+_0x6546('0x2c'),'body':{'contact':{'last_name':_0xb41133[_0x6546('0x26')],'work_number':_0xb41133[_0x6546('0x26')],'mobile_number':_0xb41133[_0x6546('0x26')],'owner_id':_0xb41133['userId'],'created_at':_0x198037['format'](_0x6546('0x2d'))}},'json':!![]};_0x39c51a['headers']=_0x4c78d6;logger[_0x6546('0x16')](_0x6546('0x2e'));return rp(_0x39c51a)['then'](function(_0x134855){_0xb41133[_0x6546('0x28')]=_0x134855[_0x6546('0x2f')]['id'];_0x54d5c0(_0xb41133);})[_0x6546('0x18')](function(_0x361cd5){logger[_0x6546('0x30')]('['+[_0xd95ccc[_0x6546('0x19')]()]+']',_0x361cd5[_0x6546('0x21')]);_0x1e316e(_0x361cd5[_0x6546('0x21')]);});});}function getTicket(_0x32ba78,_0x2e3ed8,_0x37cae7,_0x43f393,_0x237e07){return function(_0x4c9dcc){logger[_0x6546('0x16')](_0x6546('0x31'));return new Promise(function(_0x2c2190,_0x444c26){var _0x410055=moment();var _0x55207f={'method':_0x6546('0x2b'),'uri':_0x37cae7+'/api/tasks','body':{'title':intUtil['getString'](_0x43f393[_0x6546('0x32')],_0x237e07,'\x20'),'description':intUtil[_0x6546('0x33')](_0x43f393[_0x6546('0x34')],_0x237e07,'\x0a'),'owner_id':_0x4c9dcc[_0x6546('0x1d')],'creater_id':_0x4c9dcc[_0x6546('0x15')],'targetable_id':_0x4c9dcc[_0x6546('0x28')],'targetable_type':_0x6546('0x35'),'created_at':_0x410055[_0x6546('0x25')](_0x6546('0x2d')),'due_date':_0x410055[_0x6546('0x36')](0x1e,'m')['format'](_0x6546('0x2d'))},'json':!![]};_0x55207f[_0x6546('0xf')]=_0x2e3ed8;return rp(_0x55207f)[_0x6546('0x11')](function(_0x293357){_0x4c9dcc[_0x6546('0x37')]=_0x293357[_0x6546('0x38')]['id'];logger[_0x6546('0x16')](_0x6546('0x39'),_0x4c9dcc[_0x6546('0x37')]);_0x2c2190(_0x4c9dcc);})[_0x6546('0x18')](function(_0x537cae){logger[_0x6546('0x30')]('['+[_0x32ba78[_0x6546('0x19')]()]+']',_0x537cae[_0x6546('0x21')]);_0x444c26(_0x537cae[_0x6546('0x21')]);});});};}function emit(_0x38a2de,_0x527cb4,_0x1f50b9){var _0x52b0d8={'uri':_0x38a2de+_0x6546('0x3a')+_0x1f50b9};io['to'](util[_0x6546('0x25')](_0x6546('0x3b'),_0x527cb4))[_0x6546('0x3c')](_0x6546('0x3d'),_0x52b0d8);}exports['cs']=function(_0x226dcf,_0x4e9f1d,_0x4defc9,_0x4c5a8e,_0x302797,_0x520d4c,_0x5845f7,_0x18c5e8){var _0xccf61a={};var _0x400899={'Authorization':_0x6546('0x3e')+_0x520d4c['apiKey']};_0x520d4c[_0x6546('0x3f')]=intUtil[_0x6546('0x40')](_0x520d4c[_0x6546('0x3f')]);_0x520d4c['serverUrl']=intUtil[_0x6546('0x40')](_0x520d4c[_0x6546('0x41')]);var _0x70a04=_0x520d4c['remoteUri'];_0xccf61a[_0x6546('0x14')]=_0x520d4c[_0x6546('0x42')];_0xccf61a[_0x6546('0x26')]=_0x18c5e8[_0x6546('0x43')]()==='outbound'?_0x4e9f1d['destcalleridnum']:_0x4e9f1d[_0x6546('0x44')];_0xccf61a[_0x6546('0x45')]=_0x18c5e8===_0x6546('0x46')||_0x18c5e8===_0x6546('0x47')?_0x6546('0x46'):_0x6546('0x48');if(_0x4c5a8e){_0xccf61a[_0x6546('0x1b')]=_0x4c5a8e[_0x6546('0x13')];}var _0x1d9a3f=util[_0x6546('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x520d4c[_0x6546('0x41')],_0x4e9f1d[_0x6546('0x49')],md5(_0x4e9f1d['uniqueid']));if(_0x302797&&_0x302797[_0x6546('0x4a')]){logger[_0x6546('0x16')](_0x6546('0x4b'),'Recording\x20is\x20enabled!');_0x4e9f1d[_0x6546('0x4c')]=_0x1d9a3f;}else if(_0x5845f7&&_0x5845f7[_0x6546('0x4d')]&&_0x5845f7[_0x6546('0x4d')]!==_0x6546('0x4e')){logger['info'](_0x6546('0x4f'),_0x6546('0x50'));_0x4e9f1d[_0x6546('0x4c')]=_0x1d9a3f;}else{_0x4e9f1d[_0x6546('0x4c')]='';}return getAdminId(_0xccf61a,_0x18c5e8,_0x400899,_0x70a04)[_0x6546('0x11')](getUser(_0x18c5e8,_0x400899,_0x70a04))[_0x6546('0x11')](getEndUser(_0x18c5e8,_0x400899,_0x70a04))[_0x6546('0x11')](getTicket(_0x18c5e8,_0x400899,_0x70a04,_0x4defc9,_0x4e9f1d))['then'](function(_0x5cee6f){logger[_0x6546('0x16')](util[_0x6546('0x25')]('The\x20ticket\x20ID\x20is:\x20%s',_0x5cee6f[_0x6546('0x37')]));if(_0x18c5e8!==_0x6546('0x47')){logger[_0x6546('0x16')]('['+[_0x18c5e8[_0x6546('0x19')]()]+']',_0x6546('0x51'));emit(_0x70a04,_0x4c5a8e[_0x6546('0x52')],_0x5cee6f[_0x6546('0x28')]);}})['catch'](function(_0x94b68f){logger['error']('['+[_0x18c5e8[_0x6546('0x19')]()]+_0x6546('0x53'),util['inspect'](_0x94b68f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7f26=['Contact\x20found\x20work_number:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','YYYY-MM-DDTHH:mm:ss','Task\x20created:','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','util','moment','bluebird','ioredis','../../../../config/logger','redis','defaults','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','catch','toUpperCase','message','users','agentEmail','Getting\x20user\x20with\x20email','User\x20found:','userId','userEmail','Requested\x20Resource\x20not\x20Found','error','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','endUserId','work_number'];(function(_0x17a7e1,_0x475c81){var _0xa181c4=function(_0x41a38d){while(--_0x41a38d){_0x17a7e1['push'](_0x17a7e1['shift']());}};_0xa181c4(++_0x475c81);}(_0x7f26,0xc9));var _0x67f2=function(_0xf3c4de,_0x12d6b6){_0xf3c4de=_0xf3c4de-0x0;var _0x131b38=_0x7f26[_0xf3c4de];return _0x131b38;};'use strict';var _=require(_0x67f2('0x0'));var rp=require('request-promise');var md5=require(_0x67f2('0x1'));var util=require(_0x67f2('0x2'));var moment=require(_0x67f2('0x3'));var Promise=require(_0x67f2('0x4'));var Redis=require(_0x67f2('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x67f2('0x6'))('freshsales');config[_0x67f2('0x7')]=_[_0x67f2('0x8')](config[_0x67f2('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x67f2('0x9'))(new Redis(config[_0x67f2('0x7')]));function getAdminId(_0x3b54a8,_0x9d7a40,_0x2db354,_0x2fae5c){return new Promise(function(_0x10483a,_0x577c50){var _0x570b0f=![];var _0x3f6bc3={'method':_0x67f2('0xa'),'uri':_0x2fae5c+_0x67f2('0xb'),'json':!![]};_0x3f6bc3[_0x67f2('0xc')]=_0x2db354;logger[_0x67f2('0xd')](_0x67f2('0xe'));return rp(_0x3f6bc3)[_0x67f2('0xf')](function(_0x3da9f0){if(_0x3da9f0){var _0x27f98a=_0x3da9f0['users'];var _0x46a07b=null;for(_0x46a07b=0x0;_0x46a07b<_0x27f98a[_0x67f2('0x10')];_0x46a07b++){if(_0x27f98a[_0x46a07b][_0x67f2('0x11')]===_0x3b54a8[_0x67f2('0x12')]){_0x3b54a8[_0x67f2('0x13')]=_0x27f98a[_0x46a07b]['id'];_0x570b0f=!![];}}if(_0x570b0f){logger[_0x67f2('0xd')]('Admin\x20found:',_0x3b54a8[_0x67f2('0x13')]);_0x10483a(_0x3b54a8);}else{_0x577c50({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x577c50({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x67f2('0x14')](function(_0x40dd0e){logger['error']('['+[_0x9d7a40[_0x67f2('0x15')]()]+']',_0x40dd0e[_0x67f2('0x16')]);_0x577c50(_0x40dd0e);});});}function getUser(_0x367f9a,_0x1b75ce,_0x26b539){return function(_0x3ff9ec){return new Promise(function(_0x37e320,_0x4e225c){var _0x105d5d={'method':_0x67f2('0xa'),'uri':_0x26b539+_0x67f2('0xb'),'json':!![]};_0x105d5d[_0x67f2('0xc')]=_0x1b75ce;logger[_0x67f2('0xd')]('Getting\x20user\x20list');return rp(_0x105d5d)[_0x67f2('0xf')](function(_0x32fd24){if(_0x32fd24){var _0x10baca=_0x32fd24[_0x67f2('0x17')];var _0xdc6e80=![];var _0x17f75d=null;if(_0x3ff9ec[_0x67f2('0x18')]!==null){logger['info'](_0x67f2('0x19'),_0x3ff9ec[_0x67f2('0x18')]);_0x3ff9ec['userEmail']=_0x3ff9ec[_0x67f2('0x18')];for(_0x17f75d=0x0;_0x17f75d<_0x10baca[_0x67f2('0x10')];_0x17f75d++){if(_0x10baca[_0x17f75d][_0x67f2('0x11')]===_0x3ff9ec['agentEmail']){_0xdc6e80=!![];_0x3ff9ec['userId']=_0x10baca[_0x17f75d]['id'];logger['info'](_0x67f2('0x1a'),_0x3ff9ec[_0x67f2('0x1b')]);}}}if(!_0xdc6e80){logger['info']('Admin\x20selected');_0x3ff9ec[_0x67f2('0x1c')]=_0x3ff9ec['adminEmail'];_0x3ff9ec[_0x67f2('0x1b')]=_0x3ff9ec[_0x67f2('0x13')];_0xdc6e80=!![];}if(_0xdc6e80){_0x37e320(_0x3ff9ec);}else{_0x4e225c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4e225c({'statusCode':0x194,'message':_0x67f2('0x1d')});}})[_0x67f2('0x14')](function(_0x4c5429){logger[_0x67f2('0x1e')]('['+[_0x367f9a[_0x67f2('0x15')]()]+']',_0x4c5429['message']);_0x4e225c(_0x4c5429);});});};}function searchContact(_0x2d8da6,_0x501c7f,_0x408af0,_0x5999c5){return new Promise(function(_0x609fa6,_0x42799b){var _0x1eb5bb={'method':'GET','headers':_0x501c7f,'uri':_0x2d8da6+_0x67f2('0x1f')+_0x5999c5+_0x67f2('0x20')+_0x408af0+_0x67f2('0x21'),'json':!![]};rp(_0x1eb5bb)[_0x67f2('0xf')](function(_0x53f2b2){var _0x2cd1bf=_[_0x67f2('0x22')](_0x53f2b2[_0x67f2('0x23')]['contacts'],[_0x408af0,_0x5999c5]);_0x609fa6(_0x2cd1bf);})[_0x67f2('0x14')](function(_0x560c31){_0x42799b(_0x560c31);});});}function getEndUser(_0x3f7011,_0x3f5ce9,_0x4908dd){return function(_0x38989a){return new Promise(function(_0x261113,_0x3bd44f){logger[_0x67f2('0xd')](util[_0x67f2('0x24')]('Searching\x20contact\x20with\x20phone\x20%s',_0x38989a[_0x67f2('0x25')]));searchContact(_0x4908dd,_0x3f5ce9,_0x67f2('0x26'),_0x38989a[_0x67f2('0x25')])['then'](function(_0x5265dd){if(_0x5265dd){_0x38989a['endUserId']=_0x5265dd['id'];logger[_0x67f2('0xd')](_0x67f2('0x27'),_0x38989a[_0x67f2('0x28')]);return _0x261113(_0x38989a);}searchContact(_0x4908dd,_0x3f5ce9,_0x67f2('0x29'),_0x38989a[_0x67f2('0x25')])['then'](function(_0x415bb2){if(_0x415bb2){_0x38989a[_0x67f2('0x28')]=_0x415bb2['id'];logger[_0x67f2('0xd')](_0x67f2('0x2a'),_0x38989a[_0x67f2('0x28')]);return _0x261113(_0x38989a);}createEndUser(_0x38989a,_0x3f7011,_0x3f5ce9,_0x4908dd)[_0x67f2('0xf')](function(_0x16e4f8){logger[_0x67f2('0xd')]('Contact\x20created:',_0x16e4f8[_0x67f2('0x28')]);return _0x261113(_0x16e4f8);});});})[_0x67f2('0x14')](function(_0x205bfb){_0x3bd44f(_0x205bfb);});});};}function createEndUser(_0x4b9e09,_0x198a58,_0x5111c3,_0x5cc989){return new Promise(function(_0x4f8fc2,_0x2ba9c6){var _0x2fbc48=moment();var _0x580323={'method':_0x67f2('0x2b'),'uri':_0x5cc989+_0x67f2('0x2c'),'body':{'contact':{'last_name':_0x4b9e09[_0x67f2('0x25')],'work_number':_0x4b9e09[_0x67f2('0x25')],'mobile_number':_0x4b9e09[_0x67f2('0x25')],'owner_id':_0x4b9e09['userId'],'created_at':_0x2fbc48[_0x67f2('0x24')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x580323[_0x67f2('0xc')]=_0x5111c3;logger['info'](_0x67f2('0x2d'));return rp(_0x580323)[_0x67f2('0xf')](function(_0x489e5f){_0x4b9e09[_0x67f2('0x28')]=_0x489e5f[_0x67f2('0x2e')]['id'];_0x4f8fc2(_0x4b9e09);})[_0x67f2('0x14')](function(_0x5255e0){logger[_0x67f2('0x1e')]('['+[_0x198a58[_0x67f2('0x15')]()]+']',_0x5255e0[_0x67f2('0x16')]);_0x2ba9c6(_0x5255e0[_0x67f2('0x16')]);});});}function getTicket(_0x1a32b7,_0xa8cd55,_0x5577f5,_0x53c0c2,_0x5089f2){return function(_0x3e1bc8){logger[_0x67f2('0xd')](_0x67f2('0x2f'));return new Promise(function(_0x16f5c3,_0x4a118e){var _0x379793=moment();var _0x36bc01={'method':_0x67f2('0x2b'),'uri':_0x5577f5+_0x67f2('0x30'),'body':{'title':intUtil[_0x67f2('0x31')](_0x53c0c2[_0x67f2('0x32')],_0x5089f2,'\x20'),'description':intUtil[_0x67f2('0x31')](_0x53c0c2[_0x67f2('0x33')],_0x5089f2,'\x0a'),'owner_id':_0x3e1bc8[_0x67f2('0x1b')],'creater_id':_0x3e1bc8[_0x67f2('0x13')],'targetable_id':_0x3e1bc8[_0x67f2('0x28')],'targetable_type':'Contact','created_at':_0x379793[_0x67f2('0x24')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x379793['add'](0x1e,'m')[_0x67f2('0x24')](_0x67f2('0x34'))},'json':!![]};_0x36bc01[_0x67f2('0xc')]=_0xa8cd55;return rp(_0x36bc01)[_0x67f2('0xf')](function(_0x1c3b9a){_0x3e1bc8['ticketId']=_0x1c3b9a['task']['id'];logger[_0x67f2('0xd')](_0x67f2('0x35'),_0x3e1bc8[_0x67f2('0x36')]);_0x16f5c3(_0x3e1bc8);})[_0x67f2('0x14')](function(_0x32a5dc){logger[_0x67f2('0x1e')]('['+[_0x1a32b7[_0x67f2('0x15')]()]+']',_0x32a5dc[_0x67f2('0x16')]);_0x4a118e(_0x32a5dc['message']);});});};}function emit(_0x37d898,_0x3f36b1,_0x52ed79){var _0x31570a={'uri':_0x37d898+_0x67f2('0x37')+_0x52ed79};io['to'](util['format'](_0x67f2('0x38'),_0x3f36b1))[_0x67f2('0x39')](_0x67f2('0x3a'),_0x31570a);}exports['cs']=function(_0x35b189,_0xe6f727,_0x38aef4,_0x1297b3,_0x37d66c,_0x1cfeae,_0x2aae05,_0x473a90){var _0xb9813f={};var _0x320621={'Authorization':_0x67f2('0x3b')+_0x1cfeae[_0x67f2('0x3c')]};_0x1cfeae[_0x67f2('0x3d')]=intUtil[_0x67f2('0x3e')](_0x1cfeae[_0x67f2('0x3d')]);_0x1cfeae[_0x67f2('0x3f')]=intUtil[_0x67f2('0x3e')](_0x1cfeae[_0x67f2('0x3f')]);var _0x3b03e7=_0x1cfeae[_0x67f2('0x3d')];_0xb9813f['adminEmail']=_0x1cfeae[_0x67f2('0x40')];_0xb9813f['contactNumber']=_0x473a90[_0x67f2('0x41')]()===_0x67f2('0x42')?_0xe6f727[_0x67f2('0x43')]:_0xe6f727[_0x67f2('0x44')];_0xb9813f[_0x67f2('0x45')]=_0x473a90==='queue'||_0x473a90===_0x67f2('0x46')?'queue':_0x67f2('0x42');if(_0x1297b3){_0xb9813f[_0x67f2('0x18')]=_0x1297b3[_0x67f2('0x11')];}var _0x53955e=util[_0x67f2('0x24')](_0x67f2('0x47'),_0x1cfeae['serverUrl'],_0xe6f727[_0x67f2('0x48')],md5(_0xe6f727[_0x67f2('0x48')]));if(_0x37d66c&&_0x37d66c['monitor_format']){logger['info'](_0x67f2('0x49'),_0x67f2('0x4a'));_0xe6f727[_0x67f2('0x4b')]=_0x53955e;}else if(_0x2aae05&&_0x2aae05['recordingFormat']&&_0x2aae05[_0x67f2('0x4c')]!=='none'){logger[_0x67f2('0xd')](_0x67f2('0x4d'),'Recording\x20is\x20enabled!');_0xe6f727['recordingURL']=_0x53955e;}else{_0xe6f727[_0x67f2('0x4b')]='';}return getAdminId(_0xb9813f,_0x473a90,_0x320621,_0x3b03e7)['then'](getUser(_0x473a90,_0x320621,_0x3b03e7))[_0x67f2('0xf')](getEndUser(_0x473a90,_0x320621,_0x3b03e7))[_0x67f2('0xf')](getTicket(_0x473a90,_0x320621,_0x3b03e7,_0x38aef4,_0xe6f727))[_0x67f2('0xf')](function(_0x4ec479){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x4ec479[_0x67f2('0x36')]));if(_0x473a90!==_0x67f2('0x46')){logger[_0x67f2('0xd')]('['+[_0x473a90['toUpperCase']()]+']',_0x67f2('0x4e'));emit(_0x3b03e7,_0x1297b3['name'],_0x4ec479['endUserId']);}})[_0x67f2('0x14')](function(_0xf52181){logger[_0x67f2('0x1e')]('['+[_0x473a90[_0x67f2('0x15')]()]+_0x67f2('0x4f'),util[_0x67f2('0x50')](_0xf52181,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index 5e0cc7e..263fc32 100644 --- a/server/services/ami/trigger/integration/index.js +++ b/server/services/ami/trigger/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf97a=['./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','servicenow','exec','includes','toLowerCase','data1','find','Configurations','data3','queue','log','EVENT\x20UNKNOWN','unmanaged','salesforce','freshsales','dynamics365','unknown\x20integration','error','[EXEC]','format','../../../../config/logger','data2','lodash','./zendesk'];(function(_0xe513bb,_0x295a5f){var _0x5eafea=function(_0x40cf3d){while(--_0x40cf3d){_0xe513bb['push'](_0xe513bb['shift']());}};_0x5eafea(++_0x295a5f);}(_0xf97a,0xb2));var _0xaf97=function(_0x8f592c,_0xeded68){_0x8f592c=_0x8f592c-0x0;var _0x354c1d=_0xf97a[_0x8f592c];return _0x354c1d;};'use strict';var _=require(_0xaf97('0x0'));var util=require('util');var zendesk=require(_0xaf97('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0xaf97('0x2'));var freshdesk=require(_0xaf97('0x3'));var zoho=require(_0xaf97('0x4'));var desk=require(_0xaf97('0x5'));var vtiger=require(_0xaf97('0x6'));var servicenow=require('./servicenow');var dynamics365=require(_0xaf97('0x7'));var freshsales=require(_0xaf97('0x8'));var integrations=[_0xaf97('0x9'),'salesforce',_0xaf97('0xa'),_0xaf97('0xb'),_0xaf97('0xc'),_0xaf97('0xd'),_0xaf97('0xe'),'dynamics365','freshsales',_0xaf97('0xf')];exports[_0xaf97('0x10')]=function(_0x3a1ca8,_0xc28e42,_0x30a55c,_0x32e4e9,_0x33cd7b,_0x328178){if(_0x30a55c){if(_[_0xaf97('0x11')](integrations,_0x3a1ca8['data1'][_0xaf97('0x12')]())){try{var _0x2bd03a=null;var _0x51a795='';var _0x3029a8=_0x30a55c[_0x3a1ca8[_0xaf97('0x13')][_0xaf97('0x12')]()];if(_0x3029a8){var _0x50af43=_0x3029a8[_0x3a1ca8['data2']];if(_0x50af43){var _0x5b7c64=_[_0xaf97('0x14')](_0x50af43[_0xaf97('0x15')],{'id':parseInt(_0x3a1ca8[_0xaf97('0x16')],0xa)});if(_0x5b7c64){if(_0x32e4e9){if(_0x33cd7b&&_0xc28e42['queue']){_0x51a795=_0xaf97('0x17');}else if(_0xc28e42['routeId']){_0x51a795='outbound';}else{console[_0xaf97('0x18')](_0xaf97('0x19'),_0xc28e42);}}else{_0x51a795=_0xaf97('0x1a');}switch(_0x3a1ca8[_0xaf97('0x13')][_0xaf97('0x12')]()){case _0xaf97('0x9'):zendesk[_0x51a795](_0x3a1ca8,_0xc28e42,_0x5b7c64,_0x32e4e9,_0x33cd7b,_0x50af43,_0x328178);break;case _0xaf97('0x1b'):salesforce[_0x51a795](_0x3a1ca8,_0xc28e42,_0x5b7c64,_0x32e4e9,_0x33cd7b,_0x50af43,_0x328178);break;case'sugarcrm':sugarcrm[_0x51a795](_0x3a1ca8,_0xc28e42,_0x5b7c64,_0x32e4e9,_0x33cd7b,_0x50af43,_0x328178);break;case _0xaf97('0xb'):freshdesk[_0x51a795](_0x3a1ca8,_0xc28e42,_0x5b7c64,_0x32e4e9,_0x33cd7b,_0x50af43,_0x328178);break;case _0xaf97('0xc'):zoho[_0x51a795](_0x3a1ca8,_0xc28e42,_0x5b7c64,_0x32e4e9,_0x33cd7b,_0x50af43,_0x328178);break;case'desk':desk[_0x51a795](_0x3a1ca8,_0xc28e42,_0x5b7c64,_0x32e4e9,_0x33cd7b,_0x50af43,_0x328178);break;case'vtiger':vtiger[_0x51a795](_0x3a1ca8,_0xc28e42,_0x5b7c64,_0x32e4e9,_0x33cd7b,_0x50af43,_0x328178);break;case _0xaf97('0x1c'):freshsales['cs'](_0x3a1ca8,_0xc28e42,_0x5b7c64,_0x32e4e9,_0x33cd7b,_0x50af43,_0x328178,_0x51a795);break;case _0xaf97('0xf'):servicenow['cs'](_0x3a1ca8,_0xc28e42,_0x5b7c64,_0x32e4e9,_0x33cd7b,_0x50af43,_0x328178,_0x51a795);break;case _0xaf97('0x1d'):dynamics365['cs'](_0x3a1ca8,_0xc28e42,_0x5b7c64,_0x32e4e9,_0x33cd7b,_0x50af43,_0x328178,_0x51a795);break;default:console['log'](_0xaf97('0x1e'));}}else{_0x2bd03a=require('../../../../config/logger')(_0x3a1ca8['data1'][_0xaf97('0x12')]());_0x2bd03a[_0xaf97('0x1f')](_0xaf97('0x20'),util[_0xaf97('0x21')]('%s\x20configuration\x20#%s\x20not\x20found',_0x3a1ca8['data1']['toLowerCase'](),_0x3a1ca8[_0xaf97('0x16')]));}}else{_0x2bd03a=require(_0xaf97('0x22'))(_0x3a1ca8[_0xaf97('0x13')]['toLowerCase']());_0x2bd03a[_0xaf97('0x1f')](_0xaf97('0x20'),util[_0xaf97('0x21')]('%s\x20account\x20#%s\x20not\x20found',_0x3a1ca8[_0xaf97('0x13')]['toLowerCase'](),_0x3a1ca8[_0xaf97('0x23')]));}}else{}}catch(_0x17fc2d){console[_0xaf97('0x1f')](_0x17fc2d);}}}}; \ No newline at end of file +var _0xeac9=['format','%s\x20account\x20#%s\x20not\x20found','data2','lodash','./zendesk','./salesforce','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','vtiger','dynamics365','servicenow','exec','data1','toLowerCase','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','desk','freshsales','unknown\x20integration','../../../../config/logger','[EXEC]','data3','error'];(function(_0x38170c,_0x1bed4){var _0x95db16=function(_0xafa838){while(--_0xafa838){_0x38170c['push'](_0x38170c['shift']());}};_0x95db16(++_0x1bed4);}(_0xeac9,0x1bf));var _0x9eac=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xeac9[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x9eac('0x0'));var util=require('util');var zendesk=require(_0x9eac('0x1'));var salesforce=require(_0x9eac('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x9eac('0x3'));var zoho=require('./zoho');var desk=require(_0x9eac('0x4'));var vtiger=require(_0x9eac('0x5'));var servicenow=require(_0x9eac('0x6'));var dynamics365=require(_0x9eac('0x7'));var freshsales=require('./freshsales');var integrations=[_0x9eac('0x8'),_0x9eac('0x9'),_0x9eac('0xa'),_0x9eac('0xb'),_0x9eac('0xc'),'desk',_0x9eac('0xd'),_0x9eac('0xe'),'freshsales',_0x9eac('0xf')];exports[_0x9eac('0x10')]=function(_0x48fa9b,_0x552c0b,_0x101b67,_0x36a2b6,_0x295825,_0x97328d){if(_0x101b67){if(_['includes'](integrations,_0x48fa9b[_0x9eac('0x11')][_0x9eac('0x12')]())){try{var _0x5b0da6=null;var _0x2e29f4='';var _0x5777da=_0x101b67[_0x48fa9b[_0x9eac('0x11')][_0x9eac('0x12')]()];if(_0x5777da){var _0x1172de=_0x5777da[_0x48fa9b['data2']];if(_0x1172de){var _0xa2a10c=_[_0x9eac('0x13')](_0x1172de[_0x9eac('0x14')],{'id':parseInt(_0x48fa9b['data3'],0xa)});if(_0xa2a10c){if(_0x36a2b6){if(_0x295825&&_0x552c0b[_0x9eac('0x15')]){_0x2e29f4=_0x9eac('0x15');}else if(_0x552c0b[_0x9eac('0x16')]){_0x2e29f4=_0x9eac('0x17');}else{console[_0x9eac('0x18')](_0x9eac('0x19'),_0x552c0b);}}else{_0x2e29f4=_0x9eac('0x1a');}switch(_0x48fa9b[_0x9eac('0x11')]['toLowerCase']()){case _0x9eac('0x8'):zendesk[_0x2e29f4](_0x48fa9b,_0x552c0b,_0xa2a10c,_0x36a2b6,_0x295825,_0x1172de,_0x97328d);break;case _0x9eac('0x9'):salesforce[_0x2e29f4](_0x48fa9b,_0x552c0b,_0xa2a10c,_0x36a2b6,_0x295825,_0x1172de,_0x97328d);break;case _0x9eac('0xa'):sugarcrm[_0x2e29f4](_0x48fa9b,_0x552c0b,_0xa2a10c,_0x36a2b6,_0x295825,_0x1172de,_0x97328d);break;case _0x9eac('0xb'):freshdesk[_0x2e29f4](_0x48fa9b,_0x552c0b,_0xa2a10c,_0x36a2b6,_0x295825,_0x1172de,_0x97328d);break;case'zoho':zoho[_0x2e29f4](_0x48fa9b,_0x552c0b,_0xa2a10c,_0x36a2b6,_0x295825,_0x1172de,_0x97328d);break;case _0x9eac('0x1b'):desk[_0x2e29f4](_0x48fa9b,_0x552c0b,_0xa2a10c,_0x36a2b6,_0x295825,_0x1172de,_0x97328d);break;case'vtiger':vtiger[_0x2e29f4](_0x48fa9b,_0x552c0b,_0xa2a10c,_0x36a2b6,_0x295825,_0x1172de,_0x97328d);break;case _0x9eac('0x1c'):freshsales['cs'](_0x48fa9b,_0x552c0b,_0xa2a10c,_0x36a2b6,_0x295825,_0x1172de,_0x97328d,_0x2e29f4);break;case _0x9eac('0xf'):servicenow['cs'](_0x48fa9b,_0x552c0b,_0xa2a10c,_0x36a2b6,_0x295825,_0x1172de,_0x97328d,_0x2e29f4);break;case _0x9eac('0xe'):dynamics365['cs'](_0x48fa9b,_0x552c0b,_0xa2a10c,_0x36a2b6,_0x295825,_0x1172de,_0x97328d,_0x2e29f4);break;default:console['log'](_0x9eac('0x1d'));}}else{_0x5b0da6=require(_0x9eac('0x1e'))(_0x48fa9b['data1'][_0x9eac('0x12')]());_0x5b0da6['error'](_0x9eac('0x1f'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x48fa9b[_0x9eac('0x11')][_0x9eac('0x12')](),_0x48fa9b[_0x9eac('0x20')]));}}else{_0x5b0da6=require(_0x9eac('0x1e'))(_0x48fa9b[_0x9eac('0x11')][_0x9eac('0x12')]());_0x5b0da6[_0x9eac('0x21')](_0x9eac('0x1f'),util[_0x9eac('0x22')](_0x9eac('0x23'),_0x48fa9b[_0x9eac('0x11')][_0x9eac('0x12')](),_0x48fa9b[_0x9eac('0x24')]));}}else{}}catch(_0x302d27){console[_0x9eac('0x21')](_0x302d27);}}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/salesforce.js b/server/services/ami/trigger/integration/salesforce.js index b707783..1a87f6e 100644 --- a/server/services/ami/trigger/integration/salesforce.js +++ b/server/services/ami/trigger/integration/salesforce.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb5c1=['getString','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','WhatId','Case','ContactId','AccountId','leadId','info','sobject','create','validateEmail','User','find','then','length','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','merge','$or','Contact','execute','additionalSearchLead','Lead','account_contact_lead','Account','additionalSearchContact','account','additionalSearchAccount','Phone','attributes','type','moduleCreate','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','concat','securityToken','Connection','remoteUri','clientId','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','uniqueid','recordingURL','email','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','Fields','[OUTBOUND]','lastevent','toUpperCase','isNil','calleridname',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','jsforce','util','ioredis','../../../../config/logger','salesforce','redis','defaults','localhost','emit','assign','Subjects'];(function(_0x2521f2,_0x1346fa){var _0x106409=function(_0x230c91){while(--_0x230c91){_0x2521f2['push'](_0x2521f2['shift']());}};_0x106409(++_0x1346fa);}(_0xb5c1,0x1ee));var _0x1b5c=function(_0x52db09,_0x4313c8){_0x52db09=_0x52db09-0x0;var _0x175dbb=_0xb5c1[_0x52db09];return _0x175dbb;};'use strict';var _=require('lodash');var rp=require(_0x1b5c('0x0'));var moment=require(_0x1b5c('0x1'));var BPromise=require(_0x1b5c('0x2'));var md5=require('md5');var jsforce=require(_0x1b5c('0x3'));var util=require(_0x1b5c('0x4'));var Redis=require(_0x1b5c('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x1b5c('0x6'))(_0x1b5c('0x7'));config[_0x1b5c('0x8')]=_[_0x1b5c('0x9')](config[_0x1b5c('0x8')],{'host':_0x1b5c('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1b5c('0x8')]));function emit(_0x5dbdab,_0x55f4a5,_0x1ea2bd){io['to'](_0x5dbdab)[_0x1b5c('0xb')](_0x55f4a5,_0x1ea2bd);}function getTicket(_0x4e3a0c,_0xdbaae,_0x197ecd,_0x332294,_0x2f125a,_0x3e07b4,_0x1de46b,_0x53d970){var _0x47a03f=Object[_0x1b5c('0xc')]({},{'OwnerId':_0xdbaae['id'],'Subject':intUtil['getString'](_0x332294[_0x1b5c('0xd')],_0x2f125a,'\x20'),'Description':intUtil[_0x1b5c('0xe')](_0x332294[_0x1b5c('0xf')],_0x2f125a,'\x0a')},getCustomFields(_0x3e07b4,_0x2f125a));if(_0x197ecd){if(_0x332294[_0x1b5c('0x10')]===_0x1b5c('0x11')){_0x47a03f[_0x1b5c('0x12')]=moment[_0x1b5c('0x13')]();_0x47a03f[_0x1b5c('0x14')]=![];_0x47a03f[_0x1b5c('0x15')]=![];if(_0x197ecd[_0x1b5c('0x16')]===_0x1b5c('0x17')||_0x197ecd[_0x1b5c('0x16')]===_0x1b5c('0x18')){_0x47a03f[_0x1b5c('0x19')]=_0x197ecd['id'];}else if(_0x197ecd[_0x1b5c('0x16')]==='account'){_0x47a03f[_0x1b5c('0x1a')]=_0x197ecd['id'];}}else if(_0x332294[_0x1b5c('0x10')]===_0x1b5c('0x1b')){if(_0x197ecd[_0x1b5c('0x16')]===_0x1b5c('0x17')){_0x47a03f[_0x1b5c('0x1c')]=_0x197ecd['id'];}else if(_0x197ecd[_0x1b5c('0x16')]==='account'){_0x47a03f[_0x1b5c('0x1d')]=_0x197ecd['id'];}else if(_0x197ecd[_0x1b5c('0x16')]==='lead'&&_0x332294[_0x1b5c('0x1e')]){_0x47a03f[_0x332294['leadId']]=_0x197ecd['id'];}else{logger[_0x1b5c('0x1f')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x1de46b[_0x1b5c('0x20')](_0x332294[_0x1b5c('0x10')])[_0x1b5c('0x21')](_0x47a03f);}function getUser(_0x20a15c,_0x323985,_0x33fbad){if(!_['isNil'](_0x323985)&&intUtil[_0x1b5c('0x22')](_0x323985)){var _0x771231={'Email':_0x323985};var _0x3c4fb6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x33fbad['sobject'](_0x1b5c('0x23'))[_0x1b5c('0x24')](_0x771231,_0x3c4fb6)['execute']()[_0x1b5c('0x25')](function(_0xdbb868){if(_0xdbb868[_0x1b5c('0x26')]){var _0x34153a=_['find'](_0xdbb868,function(_0x4dd273){return _0x4dd273['Email']===_0x323985;});if(_0x34153a){logger[_0x1b5c('0x1f')](_0x1b5c('0x27'),_0x323985);return BPromise['resolve']({'id':_0x34153a['Id'],'name':_0x34153a[_0x1b5c('0x28')]});}}else{logger[_0x1b5c('0x1f')](_0x1b5c('0x29'),_0x323985);return _0x33fbad[_0x1b5c('0x2a')]()['then'](function(_0x387c45){return BPromise[_0x1b5c('0x2b')]({'id':_0x387c45[_0x1b5c('0x2c')],'name':_0x387c45[_0x1b5c('0x2d')]});});}});}else{logger[_0x1b5c('0x1f')](_0x1b5c('0x29'),_0x323985);return _0x33fbad[_0x1b5c('0x2a')]()[_0x1b5c('0x25')](function(_0x2a39d2){return BPromise['resolve']({'id':_0x2a39d2[_0x1b5c('0x2c')],'name':_0x2a39d2[_0x1b5c('0x2d')]});});}}function getEndUser(_0xa84687,_0x36e0bd,_0x4e491c,_0x28814d,_0x89b850){var _0x1bda95={'$or':{'Phone':_0x28814d}};var _0x2602d0={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1b5c('0x2b')]()[_0x1b5c('0x25')](function(){logger['info'](_0x1b5c('0x2e'),_0x28814d,_0x36e0bd[_0x1b5c('0x2f')]);switch(_0x36e0bd[_0x1b5c('0x2f')]){case _0x1b5c('0x30'):var _0x53495f=_[_0x1b5c('0x31')](_0x1bda95);if(_0x36e0bd['additionalSearchContact']){var _0x40a064={};_0x40a064[_0x36e0bd['additionalSearchContact']]=_0x28814d;_[_0x1b5c('0x32')](_0x53495f[_0x1b5c('0x33')],_0x40a064);}return _0x89b850[_0x1b5c('0x20')](_0x1b5c('0x34'))[_0x1b5c('0x24')](_0x53495f,_0x2602d0)[_0x1b5c('0x35')]()[_0x1b5c('0x25')](function(_0x329c30){if(_0x329c30&&_0x329c30['length']){return _0x329c30;}else{var _0x456872=_['cloneDeep'](_0x1bda95);if(_0x36e0bd[_0x1b5c('0x36')]){var _0x5c664d={};_0x5c664d[_0x36e0bd[_0x1b5c('0x36')]]=_0x28814d;_[_0x1b5c('0x32')](_0x456872[_0x1b5c('0x33')],_0x5c664d);}return _0x89b850[_0x1b5c('0x20')](_0x1b5c('0x37'))[_0x1b5c('0x24')](_0x456872,_0x2602d0);}});case _0x1b5c('0x38'):var _0x18f72e=_['cloneDeep'](_0x1bda95);if(_0x36e0bd['additionalSearchAccount']){var _0x40a064={};_0x40a064[_0x36e0bd['additionalSearchAccount']]=_0x28814d;_['merge'](_0x18f72e['$or'],_0x40a064);}return _0x89b850[_0x1b5c('0x20')](_0x1b5c('0x39'))[_0x1b5c('0x24')](_0x18f72e,_0x2602d0)['execute']()[_0x1b5c('0x25')](function(_0x247638){if(_0x247638&&_0x247638['length']){return _0x247638;}else{var _0x53c4ce=_[_0x1b5c('0x31')](_0x1bda95);if(_0x36e0bd[_0x1b5c('0x3a')]){var _0x359baf={};_0x359baf[_0x36e0bd['additionalSearchContact']]=_0x28814d;_[_0x1b5c('0x32')](_0x53c4ce['$or'],_0x359baf);}return _0x89b850['sobject'](_0x1b5c('0x34'))['find'](_0x53c4ce,_0x2602d0)['then'](function(_0x1348e7){if(_0x1348e7&&_0x1348e7[_0x1b5c('0x26')]){return _0x1348e7;}else{var _0x2eb24f=_[_0x1b5c('0x31')](_0x1bda95);if(_0x36e0bd[_0x1b5c('0x36')]){var _0x28ae67={};_0x28ae67[_0x36e0bd[_0x1b5c('0x36')]]=_0x28814d;_[_0x1b5c('0x32')](_0x2eb24f[_0x1b5c('0x33')],_0x28ae67);}return _0x89b850[_0x1b5c('0x20')]('Lead')[_0x1b5c('0x24')](_0x2eb24f,_0x2602d0);}});}});case _0x1b5c('0x17'):var _0x53495f=_[_0x1b5c('0x31')](_0x1bda95);if(_0x36e0bd[_0x1b5c('0x3a')]){var _0x40a064={};_0x40a064[_0x36e0bd[_0x1b5c('0x3a')]]=_0x28814d;_[_0x1b5c('0x32')](_0x53495f['$or'],_0x40a064);}return _0x89b850[_0x1b5c('0x20')](_0x1b5c('0x34'))[_0x1b5c('0x24')](_0x53495f,_0x2602d0)['execute']();case _0x1b5c('0x18'):var _0x3720d5=_[_0x1b5c('0x31')](_0x1bda95);if(_0x36e0bd[_0x1b5c('0x36')]){var _0x40a064={};_0x40a064[_0x36e0bd[_0x1b5c('0x36')]]=_0x28814d;_['merge'](_0x3720d5[_0x1b5c('0x33')],_0x40a064);}return _0x89b850[_0x1b5c('0x20')](_0x1b5c('0x37'))[_0x1b5c('0x24')](_0x3720d5,_0x2602d0);case _0x1b5c('0x3b'):var _0x18f72e=_[_0x1b5c('0x31')](_0x1bda95);if(_0x36e0bd[_0x1b5c('0x3c')]){var _0x40a064={};_0x40a064[_0x36e0bd[_0x1b5c('0x3c')]]=_0x28814d;_[_0x1b5c('0x32')](_0x18f72e[_0x1b5c('0x33')],_0x40a064);}return _0x89b850[_0x1b5c('0x20')](_0x1b5c('0x39'))[_0x1b5c('0x24')](_0x18f72e,_0x2602d0);default:return null;}})['then'](function(_0x22e692){if(_0x22e692&&_0x22e692[_0x1b5c('0x26')]){var _0x2a7f22=_['first'](_0x22e692);if(_0x2a7f22){return BPromise[_0x1b5c('0x2b')]({'id':_0x2a7f22['Id'],'name':_0x2a7f22[_0x1b5c('0x28')],'phone':_0x2a7f22[_0x1b5c('0x3d')],'endUserType':_0x2a7f22[_0x1b5c('0x3e')][_0x1b5c('0x3f')]['toLowerCase']()});}}})['then'](function(_0x5eb44d){if(_0x5eb44d){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x5eb44d[_0x1b5c('0x16')],_0x28814d);return BPromise[_0x1b5c('0x2b')](_0x5eb44d);}else{logger[_0x1b5c('0x1f')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x28814d);var _0x303976={'Phone':_0x28814d};if(_0x36e0bd[_0x1b5c('0x40')]){if(_0x36e0bd[_0x1b5c('0x40')]===_0x1b5c('0x17')){logger[_0x1b5c('0x1f')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x28814d,_0x36e0bd[_0x1b5c('0x40')]);_0x303976[_0x1b5c('0x41')]=_0x4e491c!==_0x1b5c('0x42')?_0x4e491c:util[_0x1b5c('0x43')](_0x1b5c('0x44'),_0x28814d);}else if(_0x36e0bd[_0x1b5c('0x40')]===_0x1b5c('0x18')){logger[_0x1b5c('0x1f')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x28814d,_0x36e0bd['moduleCreate']);_0x303976[_0x1b5c('0x41')]=_0x4e491c!==_0x1b5c('0x42')?_0x4e491c:util['format'](_0x1b5c('0x44'),_0x28814d);_0x303976[_0x1b5c('0x45')]=_0x1b5c('0x46');}else if(_0x36e0bd[_0x1b5c('0x40')]===_0x1b5c('0x3b')){logger[_0x1b5c('0x1f')](_0x1b5c('0x47'),_0x28814d,_0x36e0bd[_0x1b5c('0x40')]);_0x303976[_0x1b5c('0x28')]=_0x4e491c!==_0x1b5c('0x42')?_0x4e491c:util[_0x1b5c('0x43')](_0x1b5c('0x44'),_0x28814d);}else{return null;}}return _0x89b850[_0x1b5c('0x20')](_[_0x1b5c('0x48')](_0x36e0bd[_0x1b5c('0x40')]))[_0x1b5c('0x21')](_0x303976)['then'](function(_0x51bc1f){return BPromise[_0x1b5c('0x2b')]({'id':_0x51bc1f['id'],'endUserType':_0x36e0bd[_0x1b5c('0x40')]});});}});}function getCustomFields(_0x5c7a67,_0x3ac6e0){var _0x4ddc95={};if(_0x5c7a67[_0x1b5c('0x26')]>0x0){_[_0x1b5c('0x49')](_0x5c7a67,function(_0x1243f0){if(_[_0x1b5c('0x4a')]([_0x1b5c('0x4b'),_0x1b5c('0x4c')],_0x1243f0['type'])&&_0x1243f0[_0x1b5c('0x4d')]){_0x4ddc95[_0x1243f0[_0x1b5c('0x4d')]]=_0x1243f0[_0x1b5c('0x4e')][_0x1b5c('0x4f')]();}else if(_0x1243f0['type']===_0x1b5c('0x50')&&_0x1243f0[_0x1b5c('0x51')]&&_0x1243f0[_0x1b5c('0x4d')]){_0x3ac6e0[_0x1243f0[_0x1b5c('0x51')]]&&(_0x4ddc95[_0x1243f0[_0x1b5c('0x4d')]]=_0x3ac6e0[_0x1243f0[_0x1b5c('0x51')]][_0x1b5c('0x4f')]());}else if(_0x1243f0[_0x1b5c('0x3f')]===_0x1b5c('0x52')&&_0x1243f0[_0x1b5c('0x53')]&&_0x1243f0[_0x1b5c('0x53')][_0x1b5c('0x54')]&&_0x1243f0['idField']){_0x3ac6e0[_0x1243f0['Variable']['name'][_0x1b5c('0x55')]()]&&(_0x4ddc95[_0x1243f0[_0x1b5c('0x4d')]]=_0x3ac6e0[_0x1243f0[_0x1b5c('0x53')][_0x1b5c('0x54')][_0x1b5c('0x55')]()][_0x1b5c('0x4f')]());}});}return _0x4ddc95;}function getConnection(_0x2c2f9e){var _0x1c1ca7=_0x2c2f9e['password'][_0x1b5c('0x56')](_0x2c2f9e[_0x1b5c('0x57')]);var _0x583666=new jsforce[(_0x1b5c('0x58'))]({'oauth2':{'loginUrl':_0x2c2f9e[_0x1b5c('0x59')]||'https://login.salesforce.com','clientId':_0x2c2f9e[_0x1b5c('0x5a')],'clientSecret':_0x2c2f9e['clientSecret']}});return _0x583666[_0x1b5c('0x5b')](_0x2c2f9e[_0x1b5c('0x5c')],_0x1c1ca7)[_0x1b5c('0x25')](function(){logger['info']('Connection\x20established.');return _0x583666;});}exports[_0x1b5c('0x5d')]=function(_0x268cbe,_0x5a8e61,_0x3f4270,_0x118620,_0x576099,_0x38ce45){var _0x3bf67a,_0x3416cb,_0x58191f,_0x364dd3;_0x38ce45[_0x1b5c('0x5e')]=intUtil[_0x1b5c('0x5f')](_0x38ce45['serverUrl']);_0x38ce45[_0x1b5c('0x59')]=intUtil[_0x1b5c('0x5f')](_0x38ce45[_0x1b5c('0x59')]);if(_0x576099&&_0x576099[_0x1b5c('0x60')]){logger[_0x1b5c('0x1f')](_0x1b5c('0x61'),'Recording\x20is\x20enabled!');_0x5a8e61['recordingURL']=util[_0x1b5c('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x38ce45[_0x1b5c('0x5e')],_0x5a8e61['uniqueid'],md5(_0x5a8e61[_0x1b5c('0x62')]));}else{_0x5a8e61[_0x1b5c('0x63')]='';}return getConnection(_0x38ce45)[_0x1b5c('0x25')](function(_0xc0ecf){_0x364dd3=_0xc0ecf;return getUser(_0x38ce45,_0x118620[_0x1b5c('0x64')],_0x364dd3);})[_0x1b5c('0x25')](function(_0x4a0510){_0x3bf67a=_0x4a0510;return getEndUser(_0x38ce45,_0x3f4270,_0x5a8e61['calleridname'],_0x5a8e61[_0x1b5c('0x65')],_0x364dd3);})[_0x1b5c('0x25')](function(_0x2301ef){_0x3416cb=_0x2301ef;return getTicket(_0x38ce45,_0x3bf67a,_0x3416cb,_0x3f4270,_0x5a8e61,_0x3f4270['Fields'],_0x364dd3,_0x1b5c('0x5d'));})[_0x1b5c('0x25')](function(_0x13e1c9){_0x58191f=_0x13e1c9;logger['info'](_0x1b5c('0x66'),_0x58191f['id']);logger[_0x1b5c('0x1f')](_0x1b5c('0x67'),_0x58191f['id'],_0x118620[_0x1b5c('0x54')],_0x38ce45[_0x1b5c('0x3f')]);switch(_0x38ce45[_0x1b5c('0x3f')]){case _0x1b5c('0x68'):emit(util[_0x1b5c('0x43')](_0x1b5c('0x69'),_0x118620[_0x1b5c('0x54')]),_0x1b5c('0x6a'),{'recordId':_0x58191f['id']});break;case _0x1b5c('0x6b'):emit(util['format'](_0x1b5c('0x69'),_0x118620[_0x1b5c('0x54')]),_0x1b5c('0x6c'),{'uri':util['format'](_0x1b5c('0x6d'),_0x364dd3[_0x1b5c('0x6e')],_0x58191f['id'])});break;default:logger[_0x1b5c('0x6f')](_0x1b5c('0x70'));}})[_0x1b5c('0x71')](function(_0x1d460d){logger[_0x1b5c('0x6f')](_0x1b5c('0x61'),_0x1d460d);});};exports[_0x1b5c('0x72')]=function(_0x27a435,_0x2c134e,_0x5c756f,_0x532d2e,_0x450840,_0x523275,_0x18e595){var _0x4a63e7,_0x5f3377,_0x8e9261,_0x3fd93e;_0x523275[_0x1b5c('0x5e')]=intUtil[_0x1b5c('0x5f')](_0x523275[_0x1b5c('0x5e')]);_0x523275[_0x1b5c('0x59')]=intUtil['stripTrailingSlash'](_0x523275[_0x1b5c('0x59')]);if(_0x18e595&&_0x18e595[_0x1b5c('0x73')]&&_0x18e595['recordingFormat']!==_0x1b5c('0x74')){logger[_0x1b5c('0x1f')]('[OUTBOUND]',_0x1b5c('0x75'));_0x2c134e['recordingURL']=util[_0x1b5c('0x43')](_0x1b5c('0x76'),_0x523275[_0x1b5c('0x5e')],_0x2c134e[_0x1b5c('0x62')],md5(_0x2c134e['uniqueid']));}return getConnection(_0x523275)['then'](function(_0x519af1){_0x3fd93e=_0x519af1;return getUser(_0x523275,_0x532d2e['email'],_0x3fd93e);})[_0x1b5c('0x25')](function(_0x14d6cd){_0x4a63e7=_0x14d6cd;return getEndUser(_0x523275,_0x5c756f,_0x2c134e[_0x1b5c('0x77')],_0x2c134e['destcalleridnum'],_0x3fd93e);})[_0x1b5c('0x25')](function(_0x1720f8){_0x5f3377=_0x1720f8;return getTicket(_0x523275,_0x4a63e7,_0x5f3377,_0x5c756f,_0x2c134e,_0x5c756f[_0x1b5c('0x78')],_0x3fd93e,_0x1b5c('0x72'));})['then'](function(_0x2f0a00){_0x8e9261=_0x2f0a00;logger[_0x1b5c('0x1f')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x8e9261['id']);logger[_0x1b5c('0x1f')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x8e9261['id'],_0x532d2e[_0x1b5c('0x54')],_0x523275[_0x1b5c('0x3f')]);switch(_0x523275[_0x1b5c('0x3f')]){case'integrationTab':emit(util[_0x1b5c('0x43')](_0x1b5c('0x69'),_0x532d2e['name']),'trigger:salesforce:display',{'recordId':_0x8e9261['id']});break;case'newTab':emit(util['format'](_0x1b5c('0x69'),_0x532d2e[_0x1b5c('0x54')]),_0x1b5c('0x6c'),{'uri':util[_0x1b5c('0x43')](_0x1b5c('0x6d'),_0x3fd93e['instanceUrl'],_0x8e9261['id'])});break;default:logger[_0x1b5c('0x6f')](_0x1b5c('0x79'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x1b5c('0x71')](function(_0x3f2e6c){logger[_0x1b5c('0x6f')](_0x1b5c('0x79'),_0x3f2e6c);});};exports['unmanaged']=function(_0x25d983,_0x9d448a,_0x5e7d16,_0x2e4a8d,_0x33e954,_0x1a8359){var _0x293ed3,_0x4d5b93,_0x5782a6,_0x2c14bf;_0x1a8359[_0x1b5c('0x5e')]=intUtil[_0x1b5c('0x5f')](_0x1a8359[_0x1b5c('0x5e')]);_0x1a8359[_0x1b5c('0x59')]=intUtil['stripTrailingSlash'](_0x1a8359[_0x1b5c('0x59')]);if(_0x33e954&&_0x33e954[_0x1b5c('0x60')]){logger[_0x1b5c('0x1f')]('['+_0x9d448a[_0x1b5c('0x7a')][_0x1b5c('0x7b')]()+']',_0x1b5c('0x75'));_0x9d448a['recordingURL']=util[_0x1b5c('0x43')](_0x1b5c('0x76'),_0x1a8359[_0x1b5c('0x5e')],_0x9d448a['uniqueid'],md5(_0x9d448a[_0x1b5c('0x62')]));}else{_0x9d448a[_0x1b5c('0x63')]='';}return getConnection(_0x1a8359)[_0x1b5c('0x25')](function(_0x13a744){_0x2c14bf=_0x13a744;if(!_[_0x1b5c('0x7c')](_0x2e4a8d)){return getUser(_0x1a8359,_0x2e4a8d[_0x1b5c('0x54')],_0x2c14bf);}else{return getUser(_0x1a8359,null,_0x2c14bf);}})[_0x1b5c('0x25')](function(_0xcd1039){_0x293ed3=_0xcd1039;return getEndUser(_0x1a8359,_0x5e7d16,_0x9d448a[_0x1b5c('0x7d')],_0x9d448a[_0x1b5c('0x65')],_0x2c14bf);})['then'](function(_0x4f5f1b){_0x4d5b93=_0x4f5f1b;return getTicket(_0x1a8359,_0x293ed3,_0x4d5b93,_0x5e7d16,_0x9d448a,_0x5e7d16[_0x1b5c('0x78')],_0x2c14bf);})[_0x1b5c('0x25')](function(_0xbcbdb5){_0x5782a6=_0xbcbdb5;logger[_0x1b5c('0x1f')]('['+_0x9d448a[_0x1b5c('0x7a')][_0x1b5c('0x7b')]()+']\x20Ticket\x20%s\x20created.',_0x5782a6['id']);logger[_0x1b5c('0x1f')]('['+_0x9d448a[_0x1b5c('0x7a')][_0x1b5c('0x7b')]()+_0x1b5c('0x7e'),_0x1a8359['type']);})[_0x1b5c('0x71')](function(_0x2f320c){logger[_0x1b5c('0x6f')]('['+_0x9d448a['lastevent'][_0x1b5c('0x7b')]()+']',_0x2f320c);});}; \ No newline at end of file +var _0x3b00=['[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','isNil','Fields','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','localhost','socket.io-emitter','assign','getString','Subjects','Descriptions','ticketType','ActivityDate','utc','endUserType','contact','lead','WhoId','account','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','validateEmail','find','execute','length','Agent\x20%s\x20found.','Name','resolve','user_id','display_name','identity','then','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','first','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Caller\x20-\x20%s','No\x20Company','upperFirst','includes','picklist','type','idField','content','variable','variableName','toString','Variable','name','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','remoteUri','recordingFormat','none'];(function(_0x324dc5,_0x4bb728){var _0x302b9f=function(_0x594edd){while(--_0x594edd){_0x324dc5['push'](_0x324dc5['shift']());}};_0x302b9f(++_0x4bb728);}(_0x3b00,0x179));var _0x03b0=function(_0x355c98,_0x3d2d54){_0x355c98=_0x355c98-0x0;var _0x2b369c=_0x3b00[_0x355c98];return _0x2b369c;};'use strict';var _=require(_0x03b0('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x03b0('0x1'));var md5=require(_0x03b0('0x2'));var jsforce=require('jsforce');var util=require(_0x03b0('0x3'));var Redis=require('ioredis');var intUtil=require(_0x03b0('0x4'));var config=require(_0x03b0('0x5'));var logger=require(_0x03b0('0x6'))(_0x03b0('0x7'));config['redis']=_[_0x03b0('0x8')](config[_0x03b0('0x9')],{'host':_0x03b0('0xa'),'port':0x18eb});var io=require(_0x03b0('0xb'))(new Redis(config[_0x03b0('0x9')]));function emit(_0x220b46,_0x34afa0,_0x13fc21){io['to'](_0x220b46)['emit'](_0x34afa0,_0x13fc21);}function getTicket(_0x126511,_0x3b76e8,_0xbf6335,_0x5c51e4,_0x20cb0c,_0x58857d,_0xd793e6,_0x5b9a19){var _0x11230b=Object[_0x03b0('0xc')]({},{'OwnerId':_0x3b76e8['id'],'Subject':intUtil[_0x03b0('0xd')](_0x5c51e4[_0x03b0('0xe')],_0x20cb0c,'\x20'),'Description':intUtil[_0x03b0('0xd')](_0x5c51e4[_0x03b0('0xf')],_0x20cb0c,'\x0a')},getCustomFields(_0x58857d,_0x20cb0c));if(_0xbf6335){if(_0x5c51e4[_0x03b0('0x10')]==='Task'){_0x11230b[_0x03b0('0x11')]=moment[_0x03b0('0x12')]();_0x11230b['IsReminderSet']=![];_0x11230b['IsRecurrence']=![];if(_0xbf6335[_0x03b0('0x13')]===_0x03b0('0x14')||_0xbf6335[_0x03b0('0x13')]===_0x03b0('0x15')){_0x11230b[_0x03b0('0x16')]=_0xbf6335['id'];}else if(_0xbf6335[_0x03b0('0x13')]===_0x03b0('0x17')){_0x11230b['WhatId']=_0xbf6335['id'];}}else if(_0x5c51e4[_0x03b0('0x10')]===_0x03b0('0x18')){if(_0xbf6335[_0x03b0('0x13')]===_0x03b0('0x14')){_0x11230b[_0x03b0('0x19')]=_0xbf6335['id'];}else if(_0xbf6335['endUserType']===_0x03b0('0x17')){_0x11230b[_0x03b0('0x1a')]=_0xbf6335['id'];}else if(_0xbf6335[_0x03b0('0x13')]===_0x03b0('0x15')&&_0x5c51e4['leadId']){_0x11230b[_0x5c51e4[_0x03b0('0x1b')]]=_0xbf6335['id'];}else{logger[_0x03b0('0x1c')](_0x03b0('0x1d'));}}}return _0xd793e6[_0x03b0('0x1e')](_0x5c51e4[_0x03b0('0x10')])['create'](_0x11230b);}function getUser(_0xa890de,_0x5a3ea4,_0x4e489c){if(!_['isNil'](_0x5a3ea4)&&intUtil[_0x03b0('0x1f')](_0x5a3ea4)){var _0x3bdc51={'Email':_0x5a3ea4};var _0x17ffd3={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4e489c[_0x03b0('0x1e')]('User')[_0x03b0('0x20')](_0x3bdc51,_0x17ffd3)[_0x03b0('0x21')]()['then'](function(_0x1beedb){if(_0x1beedb[_0x03b0('0x22')]){var _0x3c89d6=_[_0x03b0('0x20')](_0x1beedb,function(_0x2ce395){return _0x2ce395['Email']===_0x5a3ea4;});if(_0x3c89d6){logger[_0x03b0('0x1c')](_0x03b0('0x23'),_0x5a3ea4);return BPromise['resolve']({'id':_0x3c89d6['Id'],'name':_0x3c89d6[_0x03b0('0x24')]});}}else{logger[_0x03b0('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5a3ea4);return _0x4e489c['identity']()['then'](function(_0x344678){return BPromise[_0x03b0('0x25')]({'id':_0x344678[_0x03b0('0x26')],'name':_0x344678[_0x03b0('0x27')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5a3ea4);return _0x4e489c[_0x03b0('0x28')]()[_0x03b0('0x29')](function(_0x781328){return BPromise[_0x03b0('0x25')]({'id':_0x781328['user_id'],'name':_0x781328[_0x03b0('0x27')]});});}}function getEndUser(_0x10940a,_0x2017fe,_0x29e2b8,_0x2ece90,_0x5f1a8e){var _0x1782b2={'$or':{'Phone':_0x2ece90}};var _0x2e8e40={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x03b0('0x25')]()[_0x03b0('0x29')](function(){logger[_0x03b0('0x1c')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x2ece90,_0x2017fe[_0x03b0('0x2a')]);switch(_0x2017fe[_0x03b0('0x2a')]){case _0x03b0('0x2b'):var _0x4f81c3=_[_0x03b0('0x2c')](_0x1782b2);if(_0x2017fe[_0x03b0('0x2d')]){var _0x2c2ff9={};_0x2c2ff9[_0x2017fe['additionalSearchContact']]=_0x2ece90;_[_0x03b0('0x2e')](_0x4f81c3[_0x03b0('0x2f')],_0x2c2ff9);}return _0x5f1a8e[_0x03b0('0x1e')]('Contact')[_0x03b0('0x20')](_0x4f81c3,_0x2e8e40)['execute']()[_0x03b0('0x29')](function(_0xe836f6){if(_0xe836f6&&_0xe836f6[_0x03b0('0x22')]){return _0xe836f6;}else{var _0x5644c9=_['cloneDeep'](_0x1782b2);if(_0x2017fe[_0x03b0('0x30')]){var _0x1c797c={};_0x1c797c[_0x2017fe[_0x03b0('0x30')]]=_0x2ece90;_[_0x03b0('0x2e')](_0x5644c9[_0x03b0('0x2f')],_0x1c797c);}return _0x5f1a8e[_0x03b0('0x1e')](_0x03b0('0x31'))[_0x03b0('0x20')](_0x5644c9,_0x2e8e40);}});case _0x03b0('0x32'):var _0x2b319b=_[_0x03b0('0x2c')](_0x1782b2);if(_0x2017fe[_0x03b0('0x33')]){var _0x2c2ff9={};_0x2c2ff9[_0x2017fe[_0x03b0('0x33')]]=_0x2ece90;_[_0x03b0('0x2e')](_0x2b319b[_0x03b0('0x2f')],_0x2c2ff9);}return _0x5f1a8e[_0x03b0('0x1e')](_0x03b0('0x34'))[_0x03b0('0x20')](_0x2b319b,_0x2e8e40)[_0x03b0('0x21')]()['then'](function(_0x289892){if(_0x289892&&_0x289892[_0x03b0('0x22')]){return _0x289892;}else{var _0x11458c=_['cloneDeep'](_0x1782b2);if(_0x2017fe[_0x03b0('0x2d')]){var _0x563e57={};_0x563e57[_0x2017fe[_0x03b0('0x2d')]]=_0x2ece90;_['merge'](_0x11458c[_0x03b0('0x2f')],_0x563e57);}return _0x5f1a8e[_0x03b0('0x1e')](_0x03b0('0x35'))[_0x03b0('0x20')](_0x11458c,_0x2e8e40)['then'](function(_0xd436b3){if(_0xd436b3&&_0xd436b3[_0x03b0('0x22')]){return _0xd436b3;}else{var _0xedbe3f=_[_0x03b0('0x2c')](_0x1782b2);if(_0x2017fe[_0x03b0('0x30')]){var _0x324f91={};_0x324f91[_0x2017fe['additionalSearchLead']]=_0x2ece90;_[_0x03b0('0x2e')](_0xedbe3f[_0x03b0('0x2f')],_0x324f91);}return _0x5f1a8e['sobject'](_0x03b0('0x31'))[_0x03b0('0x20')](_0xedbe3f,_0x2e8e40);}});}});case _0x03b0('0x14'):var _0x4f81c3=_[_0x03b0('0x2c')](_0x1782b2);if(_0x2017fe[_0x03b0('0x2d')]){var _0x2c2ff9={};_0x2c2ff9[_0x2017fe[_0x03b0('0x2d')]]=_0x2ece90;_['merge'](_0x4f81c3[_0x03b0('0x2f')],_0x2c2ff9);}return _0x5f1a8e['sobject'](_0x03b0('0x35'))['find'](_0x4f81c3,_0x2e8e40)[_0x03b0('0x21')]();case _0x03b0('0x15'):var _0x8aff26=_[_0x03b0('0x2c')](_0x1782b2);if(_0x2017fe['additionalSearchLead']){var _0x2c2ff9={};_0x2c2ff9[_0x2017fe[_0x03b0('0x30')]]=_0x2ece90;_[_0x03b0('0x2e')](_0x8aff26['$or'],_0x2c2ff9);}return _0x5f1a8e['sobject']('Lead')[_0x03b0('0x20')](_0x8aff26,_0x2e8e40);case'account':var _0x2b319b=_[_0x03b0('0x2c')](_0x1782b2);if(_0x2017fe['additionalSearchAccount']){var _0x2c2ff9={};_0x2c2ff9[_0x2017fe[_0x03b0('0x33')]]=_0x2ece90;_[_0x03b0('0x2e')](_0x2b319b[_0x03b0('0x2f')],_0x2c2ff9);}return _0x5f1a8e[_0x03b0('0x1e')](_0x03b0('0x34'))['find'](_0x2b319b,_0x2e8e40);default:return null;}})[_0x03b0('0x29')](function(_0x4b0187){if(_0x4b0187&&_0x4b0187[_0x03b0('0x22')]){var _0xd5549e=_[_0x03b0('0x36')](_0x4b0187);if(_0xd5549e){return BPromise[_0x03b0('0x25')]({'id':_0xd5549e['Id'],'name':_0xd5549e[_0x03b0('0x24')],'phone':_0xd5549e['Phone'],'endUserType':_0xd5549e[_0x03b0('0x37')]['type'][_0x03b0('0x38')]()});}}})['then'](function(_0x30769d){if(_0x30769d){logger[_0x03b0('0x1c')](_0x03b0('0x39'),_0x30769d[_0x03b0('0x13')],_0x2ece90);return BPromise[_0x03b0('0x25')](_0x30769d);}else{logger[_0x03b0('0x1c')](_0x03b0('0x3a'),_0x2ece90);var _0x233148={'Phone':_0x2ece90};if(_0x2017fe[_0x03b0('0x3b')]){if(_0x2017fe[_0x03b0('0x3b')]===_0x03b0('0x14')){logger[_0x03b0('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x2ece90,_0x2017fe[_0x03b0('0x3b')]);_0x233148[_0x03b0('0x3c')]=_0x29e2b8!==_0x03b0('0x3d')?_0x29e2b8:util[_0x03b0('0x3e')]('Caller\x20-\x20%s',_0x2ece90);}else if(_0x2017fe['moduleCreate']===_0x03b0('0x15')){logger[_0x03b0('0x1c')](_0x03b0('0x3f'),_0x2ece90,_0x2017fe[_0x03b0('0x3b')]);_0x233148[_0x03b0('0x3c')]=_0x29e2b8!==_0x03b0('0x3d')?_0x29e2b8:util['format'](_0x03b0('0x40'),_0x2ece90);_0x233148['Company']=_0x03b0('0x41');}else if(_0x2017fe[_0x03b0('0x3b')]===_0x03b0('0x17')){logger[_0x03b0('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x2ece90,_0x2017fe['moduleCreate']);_0x233148[_0x03b0('0x24')]=_0x29e2b8!==_0x03b0('0x3d')?_0x29e2b8:util[_0x03b0('0x3e')](_0x03b0('0x40'),_0x2ece90);}else{return null;}}return _0x5f1a8e['sobject'](_[_0x03b0('0x42')](_0x2017fe['moduleCreate']))['create'](_0x233148)[_0x03b0('0x29')](function(_0x1f1dd3){return BPromise[_0x03b0('0x25')]({'id':_0x1f1dd3['id'],'endUserType':_0x2017fe[_0x03b0('0x3b')]});});}});}function getCustomFields(_0x28fd5e,_0x2c1b13){var _0x36d477={};if(_0x28fd5e[_0x03b0('0x22')]>0x0){_['forEach'](_0x28fd5e,function(_0x158f04){if(_[_0x03b0('0x43')](['string',_0x03b0('0x44')],_0x158f04[_0x03b0('0x45')])&&_0x158f04[_0x03b0('0x46')]){_0x36d477[_0x158f04['idField']]=_0x158f04[_0x03b0('0x47')]['toString']();}else if(_0x158f04[_0x03b0('0x45')]===_0x03b0('0x48')&&_0x158f04[_0x03b0('0x49')]&&_0x158f04[_0x03b0('0x46')]){_0x2c1b13[_0x158f04[_0x03b0('0x49')]]&&(_0x36d477[_0x158f04[_0x03b0('0x46')]]=_0x2c1b13[_0x158f04[_0x03b0('0x49')]][_0x03b0('0x4a')]());}else if(_0x158f04[_0x03b0('0x45')]==='customVariable'&&_0x158f04[_0x03b0('0x4b')]&&_0x158f04[_0x03b0('0x4b')]['name']&&_0x158f04[_0x03b0('0x46')]){_0x2c1b13[_0x158f04[_0x03b0('0x4b')]['name'][_0x03b0('0x38')]()]&&(_0x36d477[_0x158f04['idField']]=_0x2c1b13[_0x158f04['Variable'][_0x03b0('0x4c')][_0x03b0('0x38')]()]['toString']());}});}return _0x36d477;}function getConnection(_0x348f31){var _0x5a5849=_0x348f31['password']['concat'](_0x348f31[_0x03b0('0x4d')]);var _0x18f282=new jsforce[(_0x03b0('0x4e'))]({'oauth2':{'loginUrl':_0x348f31['remoteUri']||_0x03b0('0x4f'),'clientId':_0x348f31[_0x03b0('0x50')],'clientSecret':_0x348f31[_0x03b0('0x51')]}});return _0x18f282[_0x03b0('0x52')](_0x348f31[_0x03b0('0x53')],_0x5a5849)[_0x03b0('0x29')](function(){logger['info'](_0x03b0('0x54'));return _0x18f282;});}exports[_0x03b0('0x55')]=function(_0x5d6000,_0x2a45e5,_0x1c2d5f,_0x231f90,_0x58ea99,_0x1fb250){var _0xaf9e6f,_0x32addf,_0x3552a7,_0x277055;_0x1fb250[_0x03b0('0x56')]=intUtil[_0x03b0('0x57')](_0x1fb250[_0x03b0('0x56')]);_0x1fb250['remoteUri']=intUtil[_0x03b0('0x57')](_0x1fb250['remoteUri']);if(_0x58ea99&&_0x58ea99[_0x03b0('0x58')]){logger[_0x03b0('0x1c')](_0x03b0('0x59'),_0x03b0('0x5a'));_0x2a45e5[_0x03b0('0x5b')]=util['format'](_0x03b0('0x5c'),_0x1fb250['serverUrl'],_0x2a45e5[_0x03b0('0x5d')],md5(_0x2a45e5[_0x03b0('0x5d')]));}else{_0x2a45e5[_0x03b0('0x5b')]='';}return getConnection(_0x1fb250)['then'](function(_0x51c56b){_0x277055=_0x51c56b;return getUser(_0x1fb250,_0x231f90[_0x03b0('0x5e')],_0x277055);})['then'](function(_0x4b5b4f){_0xaf9e6f=_0x4b5b4f;return getEndUser(_0x1fb250,_0x1c2d5f,_0x2a45e5['calleridname'],_0x2a45e5[_0x03b0('0x5f')],_0x277055);})[_0x03b0('0x29')](function(_0x37455d){_0x32addf=_0x37455d;return getTicket(_0x1fb250,_0xaf9e6f,_0x32addf,_0x1c2d5f,_0x2a45e5,_0x1c2d5f['Fields'],_0x277055,'queue');})[_0x03b0('0x29')](function(_0x479fd3){_0x3552a7=_0x479fd3;logger[_0x03b0('0x1c')](_0x03b0('0x60'),_0x3552a7['id']);logger[_0x03b0('0x1c')](_0x03b0('0x61'),_0x3552a7['id'],_0x231f90[_0x03b0('0x4c')],_0x1fb250[_0x03b0('0x45')]);switch(_0x1fb250['type']){case _0x03b0('0x62'):emit(util[_0x03b0('0x3e')](_0x03b0('0x63'),_0x231f90[_0x03b0('0x4c')]),_0x03b0('0x64'),{'recordId':_0x3552a7['id']});break;case _0x03b0('0x65'):emit(util['format'](_0x03b0('0x63'),_0x231f90[_0x03b0('0x4c')]),_0x03b0('0x66'),{'uri':util[_0x03b0('0x3e')](_0x03b0('0x67'),_0x277055[_0x03b0('0x68')],_0x3552a7['id'])});break;default:logger[_0x03b0('0x69')](_0x03b0('0x6a'));}})[_0x03b0('0x6b')](function(_0x38c17f){logger[_0x03b0('0x69')](_0x03b0('0x59'),_0x38c17f);});};exports['outbound']=function(_0x39dd37,_0x1fa5b1,_0x2151ca,_0x213e3c,_0xb96d5d,_0x469965,_0x550c50){var _0x3976e9,_0x3d3d74,_0x348c1a,_0x374399;_0x469965[_0x03b0('0x56')]=intUtil[_0x03b0('0x57')](_0x469965['serverUrl']);_0x469965['remoteUri']=intUtil[_0x03b0('0x57')](_0x469965[_0x03b0('0x6c')]);if(_0x550c50&&_0x550c50[_0x03b0('0x6d')]&&_0x550c50[_0x03b0('0x6d')]!==_0x03b0('0x6e')){logger[_0x03b0('0x1c')](_0x03b0('0x6f'),_0x03b0('0x5a'));_0x1fa5b1[_0x03b0('0x5b')]=util[_0x03b0('0x3e')](_0x03b0('0x5c'),_0x469965[_0x03b0('0x56')],_0x1fa5b1[_0x03b0('0x5d')],md5(_0x1fa5b1['uniqueid']));}return getConnection(_0x469965)[_0x03b0('0x29')](function(_0xe352e){_0x374399=_0xe352e;return getUser(_0x469965,_0x213e3c[_0x03b0('0x5e')],_0x374399);})[_0x03b0('0x29')](function(_0x1a7356){_0x3976e9=_0x1a7356;return getEndUser(_0x469965,_0x2151ca,_0x1fa5b1[_0x03b0('0x70')],_0x1fa5b1[_0x03b0('0x71')],_0x374399);})[_0x03b0('0x29')](function(_0x2ad97b){_0x3d3d74=_0x2ad97b;return getTicket(_0x469965,_0x3976e9,_0x3d3d74,_0x2151ca,_0x1fa5b1,_0x2151ca['Fields'],_0x374399,'outbound');})[_0x03b0('0x29')](function(_0x169d81){_0x348c1a=_0x169d81;logger[_0x03b0('0x1c')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x348c1a['id']);logger[_0x03b0('0x1c')](_0x03b0('0x72'),_0x348c1a['id'],_0x213e3c[_0x03b0('0x4c')],_0x469965['type']);switch(_0x469965[_0x03b0('0x45')]){case _0x03b0('0x62'):emit(util[_0x03b0('0x3e')](_0x03b0('0x63'),_0x213e3c[_0x03b0('0x4c')]),_0x03b0('0x64'),{'recordId':_0x348c1a['id']});break;case _0x03b0('0x65'):emit(util['format']('user:%s',_0x213e3c[_0x03b0('0x4c')]),'trigger:browser:url',{'uri':util['format'](_0x03b0('0x67'),_0x374399[_0x03b0('0x68')],_0x348c1a['id'])});break;default:logger[_0x03b0('0x69')](_0x03b0('0x6f'),_0x03b0('0x73'));}})[_0x03b0('0x6b')](function(_0x240d07){logger[_0x03b0('0x69')](_0x03b0('0x6f'),_0x240d07);});};exports[_0x03b0('0x74')]=function(_0x580ce2,_0x13a11b,_0x117954,_0x5bed60,_0x50afc7,_0x474bd6){var _0x144562,_0x4ed236,_0xeadd9f,_0x4ec6d2;_0x474bd6[_0x03b0('0x56')]=intUtil[_0x03b0('0x57')](_0x474bd6[_0x03b0('0x56')]);_0x474bd6[_0x03b0('0x6c')]=intUtil[_0x03b0('0x57')](_0x474bd6['remoteUri']);if(_0x50afc7&&_0x50afc7[_0x03b0('0x58')]){logger[_0x03b0('0x1c')]('['+_0x13a11b[_0x03b0('0x75')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x13a11b['recordingURL']=util[_0x03b0('0x3e')](_0x03b0('0x5c'),_0x474bd6[_0x03b0('0x56')],_0x13a11b['uniqueid'],md5(_0x13a11b[_0x03b0('0x5d')]));}else{_0x13a11b[_0x03b0('0x5b')]='';}return getConnection(_0x474bd6)[_0x03b0('0x29')](function(_0xf94c89){_0x4ec6d2=_0xf94c89;if(!_[_0x03b0('0x76')](_0x5bed60)){return getUser(_0x474bd6,_0x5bed60[_0x03b0('0x4c')],_0x4ec6d2);}else{return getUser(_0x474bd6,null,_0x4ec6d2);}})[_0x03b0('0x29')](function(_0x3aed99){_0x144562=_0x3aed99;return getEndUser(_0x474bd6,_0x117954,_0x13a11b['calleridname'],_0x13a11b[_0x03b0('0x5f')],_0x4ec6d2);})[_0x03b0('0x29')](function(_0x477c38){_0x4ed236=_0x477c38;return getTicket(_0x474bd6,_0x144562,_0x4ed236,_0x117954,_0x13a11b,_0x117954[_0x03b0('0x77')],_0x4ec6d2);})[_0x03b0('0x29')](function(_0x390ddd){_0xeadd9f=_0x390ddd;logger[_0x03b0('0x1c')]('['+_0x13a11b[_0x03b0('0x75')][_0x03b0('0x78')]()+_0x03b0('0x79'),_0xeadd9f['id']);logger[_0x03b0('0x1c')]('['+_0x13a11b['lastevent'][_0x03b0('0x78')]()+']\x20Integration\x20account\x20type\x20%s.',_0x474bd6['type']);})[_0x03b0('0x6b')](function(_0x145c53){logger[_0x03b0('0x69')]('['+_0x13a11b[_0x03b0('0x75')][_0x03b0('0x78')]()+']',_0x145c53);});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/servicenow.js b/server/services/ami/trigger/integration/servicenow.js index 0c28c5e..ae36615 100644 --- a/server/services/ami/trigger/integration/servicenow.js +++ b/server/services/ami/trigger/integration/servicenow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb299=['],\x20getUser\x20input\x20crm','validateEmail','userEmail','active','true','userId','adminId','adminEmail','],\x20getUser\x20crm','message',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','System','sys_user?sysparm_query=phone%3D','endUserId','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','toString','variable','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','POST','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','label','label_entry','incident','Incident','ticketId','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','email','outbound','destcalleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','md5','ioredis','./util','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','then','result','length','sys_id','info','toUpperCase','catch','error'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb299,0x1e9));var _0x9b29=function(_0x3dfbd0,_0x173696){_0x3dfbd0=_0x3dfbd0-0x0;var _0x24d728=_0xb299[_0x3dfbd0];return _0x24d728;};'use strict';var _=require(_0x9b29('0x0'));var Promise=require(_0x9b29('0x1'));var rp=require('request-promise');var util=require(_0x9b29('0x2'));var md5=require(_0x9b29('0x3'));var Redis=require(_0x9b29('0x4'));var intUtil=require(_0x9b29('0x5'));var config=require('../../../../config/environment');var logger=require(_0x9b29('0x6'))(_0x9b29('0x7'));config[_0x9b29('0x8')]=_[_0x9b29('0x9')](config[_0x9b29('0x8')],{'host':_0x9b29('0xa'),'port':0x18eb});var io=require(_0x9b29('0xb'))(new Redis(config[_0x9b29('0x8')]));function getAdminUser(_0x12ee67,_0x41bb7f,_0x15defd,_0x195a4a,_0x3a4e68,_0x5ddd9d){return new Promise(function(_0x1d1163,_0x29716d){var _0x492c4f={'method':_0x9b29('0xc'),'uri':_0x195a4a+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x3a4e68+'&'+_0x5ddd9d,'auth':_0x41bb7f,'json':!![]};return rp(_0x492c4f)[_0x9b29('0xd')](function(_0x41856e){if(_0x41856e[_0x9b29('0xe')][_0x9b29('0xf')]>0x0){_0x15defd['adminId']=_0x41856e[_0x9b29('0xe')][0x0][_0x9b29('0x10')];}logger[_0x9b29('0x11')]('['+[_0x12ee67[_0x9b29('0x12')]()]+'],\x20getAdminUser\x20crm',_0x15defd);_0x1d1163(_0x15defd);})[_0x9b29('0x13')](function(_0x28a342){logger[_0x9b29('0x14')]('['+[_0x12ee67['toUpperCase']()]+']',_0x28a342['message']);_0x29716d(_0x28a342['message']);});});}function getUser(_0x54fc94,_0x7e6e84,_0x50065d,_0x5e0c0e,_0x466587){return function(_0x1fd956){logger[_0x9b29('0x11')]('['+[_0x54fc94[_0x9b29('0x12')]()]+_0x9b29('0x15'),_0x1fd956);return new Promise(function(_0x10b120,_0x5ee2c6){if(intUtil[_0x9b29('0x16')](_0x1fd956[_0x9b29('0x17')])){var _0x1c80de={'method':_0x9b29('0xc'),'uri':_0x50065d+'sys_user?sysparm_query=email%3D'+_0x1fd956[_0x9b29('0x17')]+'&'+_0x5e0c0e+'&'+_0x466587,'auth':_0x7e6e84,'json':!![]};logger[_0x9b29('0x11')]('['+[_0x54fc94[_0x9b29('0x12')]()]+'],\x20getUser\x20rp\x20obj',_0x1c80de);return rp(_0x1c80de)[_0x9b29('0xd')](function(_0x38fa07){logger[_0x9b29('0x11')]('['+[_0x54fc94[_0x9b29('0x12')]()]+'],\x20getUser\x20entity',_0x38fa07);if(_0x38fa07[_0x9b29('0xe')]['length']>0x0&&String(_0x38fa07[_0x9b29('0xe')][0x0][_0x9b29('0x18')])===_0x9b29('0x19')){_0x1fd956['userId']=_0x38fa07[_0x9b29('0xe')][0x0][_0x9b29('0x10')];}else{_0x1fd956[_0x9b29('0x1a')]=_0x1fd956[_0x9b29('0x1b')];_0x1fd956[_0x9b29('0x17')]=_0x1fd956[_0x9b29('0x1c')];}logger[_0x9b29('0x11')]('['+[_0x54fc94['toUpperCase']()]+_0x9b29('0x1d'),_0x1fd956);_0x10b120(_0x1fd956);})[_0x9b29('0x13')](function(_0x27c58d){logger[_0x9b29('0x14')]('['+[_0x54fc94[_0x9b29('0x12')]()]+']',_0x27c58d['message']);_0x5ee2c6(_0x27c58d[_0x9b29('0x1e')]);});}else{logger['info']('['+[_0x54fc94[_0x9b29('0x12')]()]+_0x9b29('0x1f'));_0x1fd956['userId']=_0x1fd956[_0x9b29('0x1b')];_0x1fd956['userEmail']=_0x1fd956[_0x9b29('0x1c')];_0x10b120(_0x1fd956);}});};}function createEndUser(_0x3b6ccb,_0x206f3f,_0x4e9832,_0x2e86a3,_0x39e371){logger[_0x9b29('0x11')]('['+[_0x3b6ccb[_0x9b29('0x12')]()]+_0x9b29('0x20'),_0x4e9832);return new Promise(function(_0x3956f9,_0x7decff){var _0xa06c71={'method':'POST','uri':_0x2e86a3+_0x9b29('0x21')+_0x39e371,'body':{'user_name':_0x4e9832[_0x9b29('0x22')],'roles':'user','first_name':_0x4e9832['endUserNumber'],'active':_0x9b29('0x19'),'date_format':_0x9b29('0x23'),'phone':_0x4e9832[_0x9b29('0x22')]},'auth':_0x206f3f,'json':!![]};return rp(_0xa06c71)[_0x9b29('0xd')](function(_0x586404){logger[_0x9b29('0x11')]('['+[_0x3b6ccb['toUpperCase']()]+'],\x20EndUser\x20schema',_0x586404[_0x9b29('0xe')]);_0x4e9832['endUserId']=_0x586404[_0x9b29('0xe')][_0x9b29('0x10')];_0x3956f9(_0x4e9832);})[_0x9b29('0x13')](function(_0x2f3805){logger[_0x9b29('0x14')]('['+[_0x3b6ccb[_0x9b29('0x12')]()]+']',_0x2f3805[_0x9b29('0x1e')]);_0x7decff(_0x2f3805[_0x9b29('0x1e')]);});});}function getEndUser(_0x5992d3,_0x43caa8,_0x41f851,_0x83d9e7,_0x3aa1e9){return function(_0x240062){logger[_0x9b29('0x11')]('['+[_0x5992d3[_0x9b29('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0x240062);return new Promise(function(_0x20ea17,_0x2e9374){var _0x5d62da={'method':'GET','uri':_0x41f851+_0x9b29('0x24')+_0x240062[_0x9b29('0x22')]+'&'+_0x83d9e7+'&'+_0x3aa1e9,'auth':_0x43caa8,'json':!![]};return rp(_0x5d62da)[_0x9b29('0xd')](function(_0x228c75){if(_0x228c75[_0x9b29('0xe')]['length']>0x0){_0x240062[_0x9b29('0x25')]=_0x228c75[_0x9b29('0xe')][0x0][_0x9b29('0x10')];logger['info']('['+[_0x5992d3[_0x9b29('0x12')]()]+'],\x20getEndUser\x20crm',_0x240062);_0x20ea17(_0x240062);}else{return createEndUser(_0x5992d3,_0x43caa8,_0x240062,_0x41f851,_0x83d9e7)['then'](function(_0x10ef0a){logger['info']('['+[_0x5992d3[_0x9b29('0x12')]()]+_0x9b29('0x26'),_0x10ef0a);_0x20ea17(_0x10ef0a);});}})[_0x9b29('0x13')](function(_0x1dd9c8){logger[_0x9b29('0x14')]('['+[_0x5992d3['toUpperCase']()]+']',_0x1dd9c8[_0x9b29('0x1e')]);_0x2e9374(_0x1dd9c8[_0x9b29('0x1e')]);});});};}function getCustomFields(_0x2aeb82,_0x22179c){var _0x35a226={};if(_0x2aeb82[_0x9b29('0xf')]>0x0){_[_0x9b29('0x27')](_0x2aeb82,function(_0x5a1f03){if(_[_0x9b29('0x28')]([_0x9b29('0x29'),_0x9b29('0x2a')],_0x5a1f03[_0x9b29('0x2b')])&&_0x5a1f03[_0x9b29('0x2c')]&&!_0x5a1f03[_0x9b29('0x2d')]){_0x35a226[_0x5a1f03[_0x9b29('0x2c')][_0x9b29('0x2e')]()]=_0x5a1f03[_0x9b29('0x2f')]['toString']();}else if(_[_0x9b29('0x28')]([_0x9b29('0x29'),_0x9b29('0x2a')],_0x5a1f03[_0x9b29('0x2b')])&&_0x5a1f03[_0x9b29('0x30')]&&_0x5a1f03[_0x9b29('0x2d')]){_0x35a226[_0x5a1f03[_0x9b29('0x30')][_0x9b29('0x2e')]()]=_0x5a1f03['content'][_0x9b29('0x31')]();}else if(_0x5a1f03[_0x9b29('0x2b')]===_0x9b29('0x32')&&_0x5a1f03['variableName']&&_0x5a1f03[_0x9b29('0x30')]&&_0x5a1f03[_0x9b29('0x2d')]){_0x35a226[_0x5a1f03[_0x9b29('0x30')][_0x9b29('0x2e')]()]=_0x22179c[_0x5a1f03['variableName']][_0x9b29('0x31')]();}else if(_0x5a1f03['type']===_0x9b29('0x33')&&_0x5a1f03[_0x9b29('0x34')]&&_0x5a1f03[_0x9b29('0x34')][_0x9b29('0x35')]&&_0x5a1f03[_0x9b29('0x30')]&&_0x5a1f03[_0x9b29('0x2d')]){_0x35a226[_0x5a1f03[_0x9b29('0x30')][_0x9b29('0x2e')]()]=_0x22179c[_0x5a1f03[_0x9b29('0x34')][_0x9b29('0x35')][_0x9b29('0x2e')]()][_0x9b29('0x31')]();}});}return _0x35a226;}function getTicket(_0x660c43,_0x4ed5c3,_0x9a6bbb,_0x233cbe,_0x2f0480,_0x52a64f){return function(_0x5f5477){logger[_0x9b29('0x11')]('['+[_0x660c43[_0x9b29('0x12')]()]+_0x9b29('0x36'),_0x5f5477);return new Promise(function(_0x2b0993,_0x192689){var _0x5e135c=_0x660c43['toLowerCase']()==='outbound'?_0x5f5477[_0x9b29('0x1a')]:_0x5f5477[_0x9b29('0x25')];var _0x1de0b3={'method':_0x9b29('0x37'),'uri':_0x9a6bbb+'incident'+'?'+_0x52a64f,'body':Object[_0x9b29('0x38')]({},{'active':'true','caller_id':_0x5e135c,'assigned_to':_0x5f5477['userId'],'short_description':intUtil[_0x9b29('0x39')](_0x233cbe['Subjects'],_0x2f0480,'\x20'),'description':intUtil[_0x9b29('0x39')](_0x233cbe[_0x9b29('0x3a')],_0x2f0480,'\x0a')},getCustomFields(_0x233cbe[_0x9b29('0x3b')],_0x2f0480)),'auth':_0x4ed5c3,'json':!![]};return rp(_0x1de0b3)[_0x9b29('0xd')](function(_0x3427bd){logger['info']('['+[_0x660c43['toUpperCase']()]+_0x9b29('0x3c'),_0x3427bd[_0x9b29('0xe')]);_0x5f5477['ticketId']=_0x3427bd[_0x9b29('0xe')][_0x9b29('0x10')];_0x5f5477[_0x9b29('0x3d')]=_0x3427bd['result']['number'];logger['info']('['+[_0x660c43['toUpperCase']()]+']\x20getTicket\x20crm',_0x5f5477);_0x2b0993(_0x5f5477);})['catch'](function(_0x16d240){logger[_0x9b29('0x14')]('['+[_0x660c43[_0x9b29('0x12')]()]+']',_0x16d240[_0x9b29('0x1e')]);_0x192689(_0x16d240[_0x9b29('0x1e')]);});});};}function createRemoteTag(_0x11bac8,_0x370d29,_0x2a1751,_0x21710e){return new Promise(function(_0x35b5ce,_0x56a05d){var _0x289df4={'method':_0x9b29('0x37'),'uri':_0x2a1751+_0x9b29('0x3e')+'?'+_0x21710e,'body':{'short_description':_0x11bac8,'global':!![],'active':!![],'name':_0x11bac8},'auth':_0x370d29,'json':!![]};return rp(_0x289df4)[_0x9b29('0xd')](function(_0x511a7d){var _0x49250e=_0x511a7d[_0x9b29('0xe')][_0x9b29('0x10')];_0x35b5ce(_0x49250e);});});}function getRemoteTag(_0x27b64d,_0x2c3089,_0x235ddb,_0x11b848,_0x429147){return new Promise(function(_0x408ccd,_0x2066fc){var _0x4403bb={'method':_0x9b29('0xc'),'uri':_0x235ddb+_0x9b29('0x3e')+'?sysparm_query=name%3D'+_0x27b64d+'&'+_0x11b848,'auth':_0x2c3089,'json':!![]};return rp(_0x4403bb)['then'](function(_0x3bf680){if(_0x3bf680[_0x9b29('0xe')][_0x9b29('0xf')]>0x0){var _0x329bb5=_0x3bf680['result'][0x0][_0x9b29('0x10')];_0x408ccd(_0x329bb5);}else{return createRemoteTag(_0x27b64d,_0x2c3089,_0x235ddb,_0x11b848)[_0x9b29('0xd')](function(_0x4b4ec0){_0x408ccd(_0x4b4ec0);});}});});}function assignTagToIncident(_0x521148,_0x58005a,_0x13c9ad,_0x5ebd7a,_0x586569){return new Promise(function(_0x13f214,_0x87425){var _0x10e821={'method':_0x9b29('0x37'),'uri':_0x13c9ad+_0x9b29('0x3f')+'?'+_0x586569,'body':{'label':_0x521148,'table':_0x9b29('0x40'),'id_type':_0x9b29('0x41'),'table_key':_0x5ebd7a[_0x9b29('0x42')],'title':_0x9b29('0x43')+_0x5ebd7a['ticketNumber'],'id_display':_0x5ebd7a[_0x9b29('0x3d')]},'auth':_0x58005a,'json':!![]};return rp(_0x10e821)['then'](function(_0x3129f9){_0x13f214();})[_0x9b29('0x13')](function(){_0x13f214();});});}function manageTags(_0x44b41b,_0x5f19f,_0x37edbd,_0x147dc9,_0x3e85ed,_0x2f7dd6,_0x955574){return new Promise(function(_0x49d04a,_0x1aa04e){var _0x27715b=[];_0x5f19f['forEach'](function(_0x1554fc){_0x27715b[_0x9b29('0x44')](getRemoteTag(_0x1554fc,_0x37edbd,_0x147dc9,_0x2f7dd6,_0x955574));});return Promise[_0x9b29('0x45')](_0x27715b)[_0x9b29('0xd')](function(_0x4577f8){if(_0x4577f8[_0x9b29('0xf')]){logger[_0x9b29('0x11')]('['+[_0x44b41b[_0x9b29('0x12')]()]+_0x9b29('0x46'),_0x4577f8);var _0x21facf=[];_0x4577f8[_0x9b29('0x27')](function(_0x12e247){_0x21facf[_0x9b29('0x44')](assignTagToIncident(_0x12e247,_0x37edbd,_0x147dc9,_0x3e85ed,_0x2f7dd6));});return Promise['all'](_0x21facf)[_0x9b29('0xd')](function(){_0x49d04a();})[_0x9b29('0x13')](function(){_0x49d04a();});}else{_0x49d04a();}});});}function getTags(_0x5185bb,_0xd14bd2,_0x552d2b,_0x2eca1b,_0x52d95f,_0x2d2a95){return function(_0x3a585e){return new Promise(function(_0x1262a9,_0x3b4193){var _0x341c61=[];var _0x6fa1c6=_0x2eca1b[_0x9b29('0x47')];if(_0x6fa1c6&&_0x6fa1c6['length']>0x0){_0x341c61=_['map'](_0x6fa1c6,_0x9b29('0x35'));}if(_0x341c61[_0x9b29('0xf')]>0x0){return manageTags(_0x5185bb,_0x341c61,_0xd14bd2,_0x552d2b,_0x3a585e,_0x52d95f,_0x2d2a95)[_0x9b29('0xd')](function(){_0x1262a9(_0x3a585e);});}else{_0x1262a9(_0x3a585e);}});};}function emit(_0x51a56c,_0x3b880f,_0x56bbe5){var _0x67d3c1='%26sysparm_record_target%3Dincident'+_0x9b29('0x48')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x9b29('0x49');var _0x3c303d={'uri':_0x51a56c+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x56bbe5+_0x67d3c1};io['to'](util[_0x9b29('0x4a')](_0x9b29('0x4b'),_0x3b880f))[_0x9b29('0x4c')](_0x9b29('0x4d'),_0x3c303d);}exports['cs']=function(_0x4896d7,_0x4e8d08,_0x4afb39,_0x53b1e1,_0x14512e,_0x19b369,_0x42955e,_0x4cd41b){var _0x42355d={};var _0x35ea7c={'user':_0x19b369[_0x9b29('0x4e')],'pass':_0x19b369['password']};var _0x30af76=_0x9b29('0x4f');var _0x22490b=_0x9b29('0x50');_0x19b369['remoteUri']=intUtil[_0x9b29('0x51')](_0x19b369[_0x9b29('0x52')]);_0x19b369[_0x9b29('0x53')]=intUtil['stripTrailingSlash'](_0x19b369['serverUrl']);var _0x5a0ec5=util[_0x9b29('0x4a')](_0x9b29('0x54'),_0x19b369[_0x9b29('0x52')]);_0x42355d['userEmail']=!_['isNil'](_0x53b1e1)?_0x53b1e1[_0x9b29('0x55')]:null;_0x42355d['adminEmail']=_0x19b369['email'];_0x42355d['endUserNumber']=_0x4cd41b['toLowerCase']()===_0x9b29('0x56')?_0x4e8d08[_0x9b29('0x57')]:_0x4e8d08['calleridnum'];_0x42355d['callDirection']=_0x4cd41b===_0x9b29('0x58')||_0x4cd41b===_0x9b29('0x59')?_0x9b29('0x58'):_0x9b29('0x56');var _0xdad636=util[_0x9b29('0x4a')](_0x9b29('0x5a'),_0x19b369[_0x9b29('0x53')],_0x4e8d08[_0x9b29('0x5b')],md5(_0x4e8d08['uniqueid']));if(_0x14512e&&_0x14512e[_0x9b29('0x5c')]){logger['info']('[QUEUE]',_0x9b29('0x5d'));_0x4e8d08['recordingURL']=_0xdad636;}else if(_0x42955e&&_0x42955e['recordingFormat']&&_0x42955e[_0x9b29('0x5e')]!==_0x9b29('0x5f')){logger[_0x9b29('0x11')](_0x9b29('0x60'),_0x9b29('0x5d'));_0x4e8d08['recordingURL']=_0xdad636;}else{_0x4e8d08[_0x9b29('0x61')]='';}return getAdminUser(_0x4cd41b,_0x35ea7c,_0x42355d,_0x5a0ec5,_0x22490b,_0x30af76)[_0x9b29('0xd')](getUser(_0x4cd41b,_0x35ea7c,_0x5a0ec5,_0x22490b,_0x30af76))[_0x9b29('0xd')](getEndUser(_0x4cd41b,_0x35ea7c,_0x5a0ec5,_0x22490b,_0x30af76))[_0x9b29('0xd')](getTicket(_0x4cd41b,_0x35ea7c,_0x5a0ec5,_0x4afb39,_0x4e8d08,_0x22490b))[_0x9b29('0xd')](function(_0x100b00){logger[_0x9b29('0x11')](util[_0x9b29('0x4a')]('The\x20ticket\x20ID\x20is:\x20%s',_0x100b00[_0x9b29('0x42')]));logger[_0x9b29('0x11')](util[_0x9b29('0x4a')](_0x9b29('0x62'),_0x4cd41b));if(_0x4cd41b!=='unmanaged'){logger[_0x9b29('0x11')]('['+[_0x4cd41b[_0x9b29('0x12')]()]+']',_0x9b29('0x63'));emit(_0x19b369[_0x9b29('0x52')],_0x53b1e1['name'],_0x100b00[_0x9b29('0x42')]);}})[_0x9b29('0x13')](function(_0x1765fe){logger[_0x9b29('0x14')]('['+[_0x4cd41b[_0x9b29('0x12')]()]+_0x9b29('0x64'),util[_0x9b29('0x65')](_0x1765fe,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc748=['../../../../config/logger','servicenow','redis','defaults','localhost','GET','result','length','adminId','info','toUpperCase','catch','error','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','active','true','userId','sys_id',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','string','picklist','type','nameField','customField','toString','idField','toLowerCase','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','label','?sysparm_query=name%3D','label_entry','incident','Incident','Incident\x20-\x20','ticketNumber','forEach','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment'];(function(_0x32e649,_0x228649){var _0x14d386=function(_0x3fb3ed){while(--_0x3fb3ed){_0x32e649['push'](_0x32e649['shift']());}};_0x14d386(++_0x228649);}(_0xc748,0xce));var _0x8c74=function(_0x3f94f9,_0x42774b){_0x3f94f9=_0x3f94f9-0x0;var _0x46f84f=_0xc748[_0x3f94f9];return _0x46f84f;};'use strict';var _=require(_0x8c74('0x0'));var Promise=require(_0x8c74('0x1'));var rp=require(_0x8c74('0x2'));var util=require(_0x8c74('0x3'));var md5=require(_0x8c74('0x4'));var Redis=require(_0x8c74('0x5'));var intUtil=require(_0x8c74('0x6'));var config=require(_0x8c74('0x7'));var logger=require(_0x8c74('0x8'))(_0x8c74('0x9'));config[_0x8c74('0xa')]=_[_0x8c74('0xb')](config['redis'],{'host':_0x8c74('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8c74('0xa')]));function getAdminUser(_0x4a67ed,_0x2a84ac,_0x5be572,_0x1a839a,_0xaa809c,_0x167a38){return new Promise(function(_0x58d5b0,_0x174b43){var _0x17a312={'method':_0x8c74('0xd'),'uri':_0x1a839a+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0xaa809c+'&'+_0x167a38,'auth':_0x2a84ac,'json':!![]};return rp(_0x17a312)['then'](function(_0x353eb7){if(_0x353eb7[_0x8c74('0xe')][_0x8c74('0xf')]>0x0){_0x5be572[_0x8c74('0x10')]=_0x353eb7[_0x8c74('0xe')][0x0]['sys_id'];}logger[_0x8c74('0x11')]('['+[_0x4a67ed[_0x8c74('0x12')]()]+'],\x20getAdminUser\x20crm',_0x5be572);_0x58d5b0(_0x5be572);})[_0x8c74('0x13')](function(_0xcebf71){logger[_0x8c74('0x14')]('['+[_0x4a67ed['toUpperCase']()]+']',_0xcebf71['message']);_0x174b43(_0xcebf71[_0x8c74('0x15')]);});});}function getUser(_0x137ce9,_0x3ae247,_0x156fa6,_0x4238ff,_0x3ec261){return function(_0x2caa9f){logger['info']('['+[_0x137ce9[_0x8c74('0x12')]()]+'],\x20getUser\x20input\x20crm',_0x2caa9f);return new Promise(function(_0x5d3fea,_0x527c87){if(intUtil[_0x8c74('0x16')](_0x2caa9f[_0x8c74('0x17')])){var _0x2fa748={'method':_0x8c74('0xd'),'uri':_0x156fa6+_0x8c74('0x18')+_0x2caa9f[_0x8c74('0x17')]+'&'+_0x4238ff+'&'+_0x3ec261,'auth':_0x3ae247,'json':!![]};logger[_0x8c74('0x11')]('['+[_0x137ce9[_0x8c74('0x12')]()]+_0x8c74('0x19'),_0x2fa748);return rp(_0x2fa748)[_0x8c74('0x1a')](function(_0x35f333){logger[_0x8c74('0x11')]('['+[_0x137ce9[_0x8c74('0x12')]()]+'],\x20getUser\x20entity',_0x35f333);if(_0x35f333[_0x8c74('0xe')][_0x8c74('0xf')]>0x0&&String(_0x35f333['result'][0x0][_0x8c74('0x1b')])===_0x8c74('0x1c')){_0x2caa9f[_0x8c74('0x1d')]=_0x35f333['result'][0x0][_0x8c74('0x1e')];}else{_0x2caa9f[_0x8c74('0x1d')]=_0x2caa9f['adminId'];_0x2caa9f['userEmail']=_0x2caa9f['adminEmail'];}logger[_0x8c74('0x11')]('['+[_0x137ce9[_0x8c74('0x12')]()]+'],\x20getUser\x20crm',_0x2caa9f);_0x5d3fea(_0x2caa9f);})[_0x8c74('0x13')](function(_0x1407d0){logger['error']('['+[_0x137ce9['toUpperCase']()]+']',_0x1407d0[_0x8c74('0x15')]);_0x527c87(_0x1407d0[_0x8c74('0x15')]);});}else{logger[_0x8c74('0x11')]('['+[_0x137ce9[_0x8c74('0x12')]()]+_0x8c74('0x1f'));_0x2caa9f[_0x8c74('0x1d')]=_0x2caa9f[_0x8c74('0x10')];_0x2caa9f[_0x8c74('0x17')]=_0x2caa9f[_0x8c74('0x20')];_0x5d3fea(_0x2caa9f);}});};}function createEndUser(_0x3a70ae,_0x25731d,_0x309830,_0x411539,_0x3aad00){logger[_0x8c74('0x11')]('['+[_0x3a70ae[_0x8c74('0x12')]()]+_0x8c74('0x21'),_0x309830);return new Promise(function(_0x1818ab,_0x29dfd5){var _0x4aa692={'method':_0x8c74('0x22'),'uri':_0x411539+_0x8c74('0x23')+_0x3aad00,'body':{'user_name':_0x309830[_0x8c74('0x24')],'roles':_0x8c74('0x25'),'first_name':_0x309830[_0x8c74('0x24')],'active':_0x8c74('0x1c'),'date_format':'System','phone':_0x309830['endUserNumber']},'auth':_0x25731d,'json':!![]};return rp(_0x4aa692)[_0x8c74('0x1a')](function(_0x350e60){logger[_0x8c74('0x11')]('['+[_0x3a70ae['toUpperCase']()]+_0x8c74('0x26'),_0x350e60['result']);_0x309830[_0x8c74('0x27')]=_0x350e60[_0x8c74('0xe')][_0x8c74('0x1e')];_0x1818ab(_0x309830);})[_0x8c74('0x13')](function(_0x4a9e5b){logger['error']('['+[_0x3a70ae['toUpperCase']()]+']',_0x4a9e5b[_0x8c74('0x15')]);_0x29dfd5(_0x4a9e5b[_0x8c74('0x15')]);});});}function getEndUser(_0x2aa29a,_0x2a29a0,_0x529281,_0x2a724a,_0x35f8a3){return function(_0x383273){logger[_0x8c74('0x11')]('['+[_0x2aa29a[_0x8c74('0x12')]()]+_0x8c74('0x28'),_0x383273);return new Promise(function(_0xe3841f,_0x267147){var _0x34f895={'method':_0x8c74('0xd'),'uri':_0x529281+_0x8c74('0x29')+_0x383273[_0x8c74('0x24')]+'&'+_0x2a724a+'&'+_0x35f8a3,'auth':_0x2a29a0,'json':!![]};return rp(_0x34f895)['then'](function(_0x1a960e){if(_0x1a960e[_0x8c74('0xe')][_0x8c74('0xf')]>0x0){_0x383273['endUserId']=_0x1a960e[_0x8c74('0xe')][0x0][_0x8c74('0x1e')];logger[_0x8c74('0x11')]('['+[_0x2aa29a['toUpperCase']()]+_0x8c74('0x2a'),_0x383273);_0xe3841f(_0x383273);}else{return createEndUser(_0x2aa29a,_0x2a29a0,_0x383273,_0x529281,_0x2a724a)[_0x8c74('0x1a')](function(_0x22a5bc){logger[_0x8c74('0x11')]('['+[_0x2aa29a['toUpperCase']()]+_0x8c74('0x2b'),_0x22a5bc);_0xe3841f(_0x22a5bc);});}})['catch'](function(_0x3c3fdc){logger[_0x8c74('0x14')]('['+[_0x2aa29a[_0x8c74('0x12')]()]+']',_0x3c3fdc[_0x8c74('0x15')]);_0x267147(_0x3c3fdc[_0x8c74('0x15')]);});});};}function getCustomFields(_0x499126,_0x468730){var _0x41fe5a={};if(_0x499126[_0x8c74('0xf')]>0x0){_['forEach'](_0x499126,function(_0x49ffe2){if(_['includes']([_0x8c74('0x2c'),_0x8c74('0x2d')],_0x49ffe2[_0x8c74('0x2e')])&&_0x49ffe2[_0x8c74('0x2f')]&&!_0x49ffe2[_0x8c74('0x30')]){_0x41fe5a[_0x49ffe2[_0x8c74('0x2f')]['toLowerCase']()]=_0x49ffe2['content'][_0x8c74('0x31')]();}else if(_['includes']([_0x8c74('0x2c'),'picklist'],_0x49ffe2[_0x8c74('0x2e')])&&_0x49ffe2[_0x8c74('0x32')]&&_0x49ffe2[_0x8c74('0x30')]){_0x41fe5a[_0x49ffe2[_0x8c74('0x32')][_0x8c74('0x33')]()]=_0x49ffe2['content'][_0x8c74('0x31')]();}else if(_0x49ffe2[_0x8c74('0x2e')]===_0x8c74('0x34')&&_0x49ffe2[_0x8c74('0x35')]&&_0x49ffe2['idField']&&_0x49ffe2[_0x8c74('0x30')]){_0x41fe5a[_0x49ffe2[_0x8c74('0x32')][_0x8c74('0x33')]()]=_0x468730[_0x49ffe2[_0x8c74('0x35')]][_0x8c74('0x31')]();}else if(_0x49ffe2[_0x8c74('0x2e')]===_0x8c74('0x36')&&_0x49ffe2[_0x8c74('0x37')]&&_0x49ffe2[_0x8c74('0x37')][_0x8c74('0x38')]&&_0x49ffe2[_0x8c74('0x32')]&&_0x49ffe2[_0x8c74('0x30')]){_0x41fe5a[_0x49ffe2[_0x8c74('0x32')][_0x8c74('0x33')]()]=_0x468730[_0x49ffe2[_0x8c74('0x37')][_0x8c74('0x38')][_0x8c74('0x33')]()]['toString']();}});}return _0x41fe5a;}function getTicket(_0x5a4c84,_0x40268e,_0x2eff3e,_0x4f08df,_0x21c50a,_0x579b7b){return function(_0x269818){logger[_0x8c74('0x11')]('['+[_0x5a4c84['toUpperCase']()]+_0x8c74('0x39'),_0x269818);return new Promise(function(_0x1a352d,_0x52d305){var _0x5234bf=_0x5a4c84[_0x8c74('0x33')]()===_0x8c74('0x3a')?_0x269818[_0x8c74('0x1d')]:_0x269818[_0x8c74('0x27')];var _0xe03740={'method':'POST','uri':_0x2eff3e+'incident'+'?'+_0x579b7b,'body':Object[_0x8c74('0x3b')]({},{'active':_0x8c74('0x1c'),'caller_id':_0x5234bf,'assigned_to':_0x269818[_0x8c74('0x1d')],'short_description':intUtil[_0x8c74('0x3c')](_0x4f08df[_0x8c74('0x3d')],_0x21c50a,'\x20'),'description':intUtil[_0x8c74('0x3c')](_0x4f08df['Descriptions'],_0x21c50a,'\x0a')},getCustomFields(_0x4f08df[_0x8c74('0x3e')],_0x21c50a)),'auth':_0x40268e,'json':!![]};return rp(_0xe03740)['then'](function(_0x2f19ff){logger['info']('['+[_0x5a4c84[_0x8c74('0x12')]()]+_0x8c74('0x3f'),_0x2f19ff[_0x8c74('0xe')]);_0x269818[_0x8c74('0x40')]=_0x2f19ff[_0x8c74('0xe')][_0x8c74('0x1e')];_0x269818['ticketNumber']=_0x2f19ff[_0x8c74('0xe')]['number'];logger[_0x8c74('0x11')]('['+[_0x5a4c84[_0x8c74('0x12')]()]+']\x20getTicket\x20crm',_0x269818);_0x1a352d(_0x269818);})['catch'](function(_0x39fae2){logger[_0x8c74('0x14')]('['+[_0x5a4c84[_0x8c74('0x12')]()]+']',_0x39fae2[_0x8c74('0x15')]);_0x52d305(_0x39fae2[_0x8c74('0x15')]);});});};}function createRemoteTag(_0x9ec34,_0xa527e3,_0x336486,_0x4a9fe0){return new Promise(function(_0x10a2c1,_0x272de1){var _0x14ef3f={'method':_0x8c74('0x22'),'uri':_0x336486+_0x8c74('0x41')+'?'+_0x4a9fe0,'body':{'short_description':_0x9ec34,'global':!![],'active':!![],'name':_0x9ec34},'auth':_0xa527e3,'json':!![]};return rp(_0x14ef3f)['then'](function(_0x1ba74f){var _0xfe18d4=_0x1ba74f[_0x8c74('0xe')][_0x8c74('0x1e')];_0x10a2c1(_0xfe18d4);});});}function getRemoteTag(_0x2b3a83,_0x5a7883,_0x435b76,_0x236a16,_0x6ba0a0){return new Promise(function(_0x22bf1e,_0x233143){var _0x5065c6={'method':_0x8c74('0xd'),'uri':_0x435b76+'label'+_0x8c74('0x42')+_0x2b3a83+'&'+_0x236a16,'auth':_0x5a7883,'json':!![]};return rp(_0x5065c6)['then'](function(_0x48d345){if(_0x48d345[_0x8c74('0xe')]['length']>0x0){var _0x3b873a=_0x48d345['result'][0x0][_0x8c74('0x1e')];_0x22bf1e(_0x3b873a);}else{return createRemoteTag(_0x2b3a83,_0x5a7883,_0x435b76,_0x236a16)[_0x8c74('0x1a')](function(_0x97c682){_0x22bf1e(_0x97c682);});}});});}function assignTagToIncident(_0x355aa4,_0x15456e,_0x3e19b1,_0x5721cf,_0x43e4d8){return new Promise(function(_0x57d0b4,_0x25a3c5){var _0x344b72={'method':_0x8c74('0x22'),'uri':_0x3e19b1+_0x8c74('0x43')+'?'+_0x43e4d8,'body':{'label':_0x355aa4,'table':_0x8c74('0x44'),'id_type':_0x8c74('0x45'),'table_key':_0x5721cf[_0x8c74('0x40')],'title':_0x8c74('0x46')+_0x5721cf[_0x8c74('0x47')],'id_display':_0x5721cf[_0x8c74('0x47')]},'auth':_0x15456e,'json':!![]};return rp(_0x344b72)['then'](function(_0x388d7c){_0x57d0b4();})['catch'](function(){_0x57d0b4();});});}function manageTags(_0x4110a9,_0x7ac2e7,_0x319e4e,_0x644b83,_0x113952,_0xf52013,_0x157246){return new Promise(function(_0x52f8ce,_0x2faedd){var _0x16cc89=[];_0x7ac2e7[_0x8c74('0x48')](function(_0x2adfb0){_0x16cc89[_0x8c74('0x49')](getRemoteTag(_0x2adfb0,_0x319e4e,_0x644b83,_0xf52013,_0x157246));});return Promise[_0x8c74('0x4a')](_0x16cc89)['then'](function(_0x35beff){if(_0x35beff[_0x8c74('0xf')]){logger[_0x8c74('0x11')]('['+[_0x4110a9[_0x8c74('0x12')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x35beff);var _0x54bbb9=[];_0x35beff['forEach'](function(_0x35fac7){_0x54bbb9['push'](assignTagToIncident(_0x35fac7,_0x319e4e,_0x644b83,_0x113952,_0xf52013));});return Promise[_0x8c74('0x4a')](_0x54bbb9)[_0x8c74('0x1a')](function(){_0x52f8ce();})[_0x8c74('0x13')](function(){_0x52f8ce();});}else{_0x52f8ce();}});});}function getTags(_0x444405,_0x57b6dd,_0x1e7871,_0x16715f,_0x18bed7,_0x10fa21){return function(_0xa95a8d){return new Promise(function(_0x1673e0,_0x507273){var _0x4feb10=[];var _0x457355=_0x16715f[_0x8c74('0x4b')];if(_0x457355&&_0x457355[_0x8c74('0xf')]>0x0){_0x4feb10=_[_0x8c74('0x4c')](_0x457355,_0x8c74('0x38'));}if(_0x4feb10[_0x8c74('0xf')]>0x0){return manageTags(_0x444405,_0x4feb10,_0x57b6dd,_0x1e7871,_0xa95a8d,_0x18bed7,_0x10fa21)[_0x8c74('0x1a')](function(){_0x1673e0(_0xa95a8d);});}else{_0x1673e0(_0xa95a8d);}});};}function emit(_0x2bab09,_0x4e4258,_0xbb877d){var _0x206333=_0x8c74('0x4d')+_0x8c74('0x4e')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x4643fa={'uri':_0x2bab09+_0x8c74('0x4f')+_0xbb877d+_0x206333};io['to'](util[_0x8c74('0x50')](_0x8c74('0x51'),_0x4e4258))[_0x8c74('0x52')]('trigger:browser:url',_0x4643fa);}exports['cs']=function(_0x1e95a8,_0x41d9ad,_0x168652,_0x19ef3,_0x369632,_0xd52395,_0xc47569,_0x213123){var _0x3087fa={};var _0x2df5b7={'user':_0xd52395[_0x8c74('0x53')],'pass':_0xd52395['password']};var _0x4a6e54=_0x8c74('0x54');var _0x36bc64=_0x8c74('0x55');_0xd52395['remoteUri']=intUtil['stripTrailingSlash'](_0xd52395[_0x8c74('0x56')]);_0xd52395[_0x8c74('0x57')]=intUtil[_0x8c74('0x58')](_0xd52395[_0x8c74('0x57')]);var _0x516045=util[_0x8c74('0x50')](_0x8c74('0x59'),_0xd52395[_0x8c74('0x56')]);_0x3087fa[_0x8c74('0x17')]=!_[_0x8c74('0x5a')](_0x19ef3)?_0x19ef3[_0x8c74('0x5b')]:null;_0x3087fa[_0x8c74('0x20')]=_0xd52395['email'];_0x3087fa[_0x8c74('0x24')]=_0x213123['toLowerCase']()==='outbound'?_0x41d9ad[_0x8c74('0x5c')]:_0x41d9ad[_0x8c74('0x5d')];_0x3087fa['callDirection']=_0x213123===_0x8c74('0x5e')||_0x213123===_0x8c74('0x5f')?'queue':_0x8c74('0x3a');var _0x5bbcd2=util[_0x8c74('0x50')](_0x8c74('0x60'),_0xd52395[_0x8c74('0x57')],_0x41d9ad[_0x8c74('0x61')],md5(_0x41d9ad[_0x8c74('0x61')]));if(_0x369632&&_0x369632['monitor_format']){logger[_0x8c74('0x11')](_0x8c74('0x62'),_0x8c74('0x63'));_0x41d9ad[_0x8c74('0x64')]=_0x5bbcd2;}else if(_0xc47569&&_0xc47569[_0x8c74('0x65')]&&_0xc47569['recordingFormat']!==_0x8c74('0x66')){logger[_0x8c74('0x11')]('[OUTBOUND]',_0x8c74('0x63'));_0x41d9ad[_0x8c74('0x64')]=_0x5bbcd2;}else{_0x41d9ad[_0x8c74('0x64')]='';}return getAdminUser(_0x213123,_0x2df5b7,_0x3087fa,_0x516045,_0x36bc64,_0x4a6e54)[_0x8c74('0x1a')](getUser(_0x213123,_0x2df5b7,_0x516045,_0x36bc64,_0x4a6e54))[_0x8c74('0x1a')](getEndUser(_0x213123,_0x2df5b7,_0x516045,_0x36bc64,_0x4a6e54))[_0x8c74('0x1a')](getTicket(_0x213123,_0x2df5b7,_0x516045,_0x168652,_0x41d9ad,_0x36bc64))['then'](function(_0x23498c){logger[_0x8c74('0x11')](util[_0x8c74('0x50')](_0x8c74('0x67'),_0x23498c[_0x8c74('0x40')]));logger[_0x8c74('0x11')](util[_0x8c74('0x50')](_0x8c74('0x68'),_0x213123));if(_0x213123!==_0x8c74('0x5f')){logger['info']('['+[_0x213123[_0x8c74('0x12')]()]+']',_0x8c74('0x69'));emit(_0xd52395[_0x8c74('0x56')],_0x19ef3['name'],_0x23498c[_0x8c74('0x40')]);}})[_0x8c74('0x13')](function(_0x21af06){logger[_0x8c74('0x14')]('['+[_0x213123[_0x8c74('0x12')]()]+_0x8c74('0x6a'),util['inspect'](_0x21af06,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js index 60dc8d6..63b04ea 100644 --- a/server/services/ami/trigger/integration/sugarcrm.js +++ b/server/services/ami/trigger/integration/sugarcrm.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb2b=['util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_name','direction','length','forEach','variableName','idField','set_entry','JSON','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','value','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','phone_home','then','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','map','type','string','customField','toLowerCase','content','custom_fields','variable','push','customVariable','Variable','POST','login','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','Fields','Outbound','contacts','error','unmanaged','lastevent','toUpperCase','users','bluebird'];(function(_0x37980a,_0x3425e7){var _0x4f9131=function(_0x483246){while(--_0x483246){_0x37980a['push'](_0x37980a['shift']());}};_0x4f9131(++_0x3425e7);}(_0xdb2b,0x7b));var _0xbdb2=function(_0x495c18,_0xae1131){_0x495c18=_0x495c18-0x0;var _0x27b50d=_0xdb2b[_0x495c18];return _0x27b50d;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0xbdb2('0x0'));var md5=require('md5');var util=require(_0xbdb2('0x1'));var Redis=require(_0xbdb2('0x2'));var intUtil=require(_0xbdb2('0x3'));var config=require(_0xbdb2('0x4'));var logger=require(_0xbdb2('0x5'))(_0xbdb2('0x6'));config[_0xbdb2('0x7')]=_[_0xbdb2('0x8')](config[_0xbdb2('0x7')],{'host':_0xbdb2('0x9'),'port':0x18eb});var io=require(_0xbdb2('0xa'))(new Redis(config[_0xbdb2('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x49e0d0,_0x239a3c,_0x2ea18a){io['to'](_0x49e0d0)[_0xbdb2('0xb')](_0x239a3c,_0x2ea18a);}function getTicket(_0x3638c4,_0x3ace60,_0x540597,_0x17b46d,_0xae0e0e,_0x4337e3,_0x34642e,_0x395e9e){logger[_0xbdb2('0xc')](_0xbdb2('0xd'));var _0x26b083=new Date();var _0x3f9afc=[{'name':_0xbdb2('0xe'),'value':intUtil[_0xbdb2('0xf')](_0x17b46d[_0xbdb2('0x10')],_0xae0e0e,'\x20')},{'name':_0xbdb2('0x11'),'value':_0x3ace60['id']},{'name':_0xbdb2('0x12'),'value':_0x3ace60['id']},{'name':'description','value':intUtil[_0xbdb2('0xf')](_0x17b46d[_0xbdb2('0x13')],_0xae0e0e,'\x0a')},{'name':_0xbdb2('0x14'),'value':_0x26b083[_0xbdb2('0x15')]()[_0xbdb2('0x16')](0x0,0x13)[_0xbdb2('0x17')]('T','\x20')},{'name':_0xbdb2('0x18'),'value':'0'},{'name':_0xbdb2('0x19'),'value':'15'},{'name':'parent_id','value':_0x540597['id']},{'name':'parent_type','value':'Contacts'},{'name':_0xbdb2('0x1a'),'value':_0x540597['name']},{'name':_0xbdb2('0x1b'),'value':_0x395e9e}];if(_0x4337e3[_0xbdb2('0x1c')]){_[_0xbdb2('0x1d')](_0x4337e3,function(_0x95c82c){if(_0xae0e0e[_0x95c82c[_0xbdb2('0x1e')]]){_0x3f9afc['push']({'name':_0x95c82c[_0xbdb2('0x1f')],'value':_0xae0e0e[_0x95c82c[_0xbdb2('0x1e')]]});}});}return request({'form':{'method':_0xbdb2('0x20'),'input_type':_0xbdb2('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x34642e['id'],'module_name':_0xbdb2('0x22'),'name_value_list':_0x3f9afc})}});}function getAuth(_0x58a6c9){return util['format'](_0xbdb2('0x23'),new Buffer(_0x58a6c9[_0xbdb2('0x24')]+':X')[_0xbdb2('0x25')](_0xbdb2('0x26')));}function getServerInfo(_0x46d60f){return request({'form':{'method':_0xbdb2('0x27'),'input_type':_0xbdb2('0x21'),'response_type':_0xbdb2('0x21'),'rest_data':JSON[_0xbdb2('0x28')]({'session':_0x46d60f['id']})}});}function getUser(_0x1faf7a,_0x52c887,_0x359028){if(!_[_0xbdb2('0x29')](_0x52c887)){logger[_0xbdb2('0xc')](_0xbdb2('0x2a'),_0x52c887);return request({'form':{'method':_0xbdb2('0x2b'),'input_type':_0xbdb2('0x21'),'response_type':'JSON','rest_data':JSON[_0xbdb2('0x28')]({'session':_0x359028['id'],'module_name':_0xbdb2('0x2c'),'query':util[_0xbdb2('0x2d')](_0xbdb2('0x2e'),_0x52c887),'order_by':'','offset':'0','select_fields':['id','name',_0xbdb2('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3ea6cb){if(_0x3ea6cb[_0xbdb2('0x30')][_0xbdb2('0x1c')]){var _0x5db916=_[_0xbdb2('0x31')](_0x3ea6cb[_0xbdb2('0x30')],function(_0x27c0d4){return _0x27c0d4['name_value_list'][_0xbdb2('0x2f')][_0xbdb2('0x32')]===_0x52c887;});if(_0x5db916){logger[_0xbdb2('0xc')]('Agent\x20found!');return BPromise[_0xbdb2('0x33')]({'id':_0x5db916[_0xbdb2('0x34')]['id'][_0xbdb2('0x32')],'name':_0x5db916[_0xbdb2('0x34')]['name'][_0xbdb2('0x32')]});}}logger[_0xbdb2('0xc')](_0xbdb2('0x35'));return BPromise['resolve']({'id':_0x359028[_0xbdb2('0x34')][_0xbdb2('0x36')]['value'],'name':_0x359028['name_value_list'][_0xbdb2('0x2f')][_0xbdb2('0x32')]});});}else{logger[_0xbdb2('0xc')](_0xbdb2('0x37'));return BPromise[_0xbdb2('0x33')]({'id':_0x359028[_0xbdb2('0x34')][_0xbdb2('0x36')][_0xbdb2('0x32')],'name':_0x359028[_0xbdb2('0x34')][_0xbdb2('0x2f')][_0xbdb2('0x32')]});}}function getEndUser(_0x5e942a,_0x5dc940,_0x2897a9,_0x1527a3){logger[_0xbdb2('0xc')](_0xbdb2('0x38'),_0x2897a9);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0xbdb2('0x21'),'rest_data':JSON[_0xbdb2('0x28')]({'session':_0x1527a3['id'],'module_name':_0xbdb2('0x39'),'query':util[_0xbdb2('0x2d')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x2897a9),'order_by':'','offset':'0','select_fields':['id',_0xbdb2('0xe'),_0xbdb2('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xbdb2('0x3b')](function(_0x2b99a4){if(_0x2b99a4['entry_list'][_0xbdb2('0x1c')]){var _0x2cbcdb=_[_0xbdb2('0x31')](_0x2b99a4[_0xbdb2('0x30')],function(_0x47e32a){return _0x47e32a[_0xbdb2('0x34')][_0xbdb2('0x3a')]['value']===_0x2897a9;});if(_0x2cbcdb){logger[_0xbdb2('0xc')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x2cbcdb[_0xbdb2('0x34')]['id'][_0xbdb2('0x32')],'name':_0x2cbcdb[_0xbdb2('0x34')][_0xbdb2('0xe')]['value'],'phone':_0x2cbcdb['name_value_list'][_0xbdb2('0x3a')][_0xbdb2('0x32')]});}}else{logger['info'](_0xbdb2('0x3c'));return request({'form':{'method':_0xbdb2('0x20'),'input_type':_0xbdb2('0x21'),'response_type':_0xbdb2('0x21'),'rest_data':JSON[_0xbdb2('0x28')]({'session':_0x1527a3['id'],'module_name':_0xbdb2('0x39'),'name_value_list':[{'name':_0xbdb2('0x3d'),'value':_0x5dc940!==_0xbdb2('0x3e')?_0x5dc940:util['format'](_0xbdb2('0x3f'),_0x2897a9)},{'name':_0xbdb2('0x3a'),'value':_0x2897a9}]})}})[_0xbdb2('0x3b')](function(_0x734a1e){logger['info'](_0xbdb2('0x40'));return BPromise[_0xbdb2('0x33')]({'id':_0x734a1e['id'],'name':_0x734a1e[_0xbdb2('0x30')]['first_name']['value'],'phone':_0x734a1e['entry_list'][_0xbdb2('0x3a')][_0xbdb2('0x32')]});});}});}function request(_0x3c8da9){logger['debug'](_0xbdb2('0x41'),JSON['stringify'](_0x3c8da9));return rp(_[_0xbdb2('0x42')](def,_0x3c8da9));}function getTags(_0x265b18,_0x50aac3){var _0x2a398f=[];if(_0x265b18&&_0x265b18['length']>0x0){_0x2a398f=_[_0xbdb2('0x43')](_0x265b18,_0x50aac3);}return _0x2a398f;}function getCustomFields(_0x5180d8,_0x33c885){var _0x463633=[];var _0x1a082b={'custom_fields':[]};if(_0x5180d8['length']>0x0){_[_0xbdb2('0x1d')](_0x5180d8,function(_0x4a8fa1){if(_0x4a8fa1[_0xbdb2('0x44')]===_0xbdb2('0x45')&&_0x4a8fa1['nameField']&&!_0x4a8fa1[_0xbdb2('0x46')]){_0x1a082b[_0x4a8fa1['nameField'][_0xbdb2('0x47')]()]=_0x4a8fa1[_0xbdb2('0x48')][_0xbdb2('0x25')]();}else if(_0x4a8fa1['type']===_0xbdb2('0x45')&&_0x4a8fa1[_0xbdb2('0x1f')]&&_0x4a8fa1['customField']){_0x1a082b[_0xbdb2('0x49')]['push']({'id':_0x4a8fa1[_0xbdb2('0x1f')],'value':_0x4a8fa1[_0xbdb2('0x48')][_0xbdb2('0x25')]()});}else if(_0x4a8fa1[_0xbdb2('0x44')]===_0xbdb2('0x4a')&&_0x4a8fa1['variableName']&&_0x4a8fa1['idField']&&_0x4a8fa1[_0xbdb2('0x46')]){_0x33c885[_0x4a8fa1['variableName']]&&_0x1a082b[_0xbdb2('0x49')][_0xbdb2('0x4b')]({'id':_0x4a8fa1[_0xbdb2('0x1f')],'value':_0x33c885[_0x4a8fa1[_0xbdb2('0x1e')]][_0xbdb2('0x25')]()});}else if(_0x4a8fa1[_0xbdb2('0x44')]===_0xbdb2('0x4c')&&_0x4a8fa1[_0xbdb2('0x4d')]&&_0x4a8fa1[_0xbdb2('0x4d')][_0xbdb2('0xe')]&&_0x4a8fa1[_0xbdb2('0x1f')]&&_0x4a8fa1['customField']){_0x33c885[_0x4a8fa1[_0xbdb2('0x4d')][_0xbdb2('0xe')][_0xbdb2('0x47')]()]&&_0x1a082b[_0xbdb2('0x49')][_0xbdb2('0x4b')]({'id':_0x4a8fa1[_0xbdb2('0x1f')],'value':_0x33c885[_0x4a8fa1['Variable']['name'][_0xbdb2('0x47')]()]['toString']()});}});}return _0x1a082b;}function getConnection(_0x1e4874){return request({'method':_0xbdb2('0x4e'),'form':{'method':_0xbdb2('0x4f'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xbdb2('0x28')]({'user_auth':{'user_name':_0x1e4874['username'],'password':_0x1e4874[_0xbdb2('0x50')],'encryption':_0xbdb2('0x51')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xbdb2('0x3b')](function(_0x1b76fb){var _0xcb94f8=_0x1b76fb;if(_0xcb94f8['id']){def[_0xbdb2('0x52')]=_0xcb94f8['id'];return BPromise[_0xbdb2('0x33')](_0xcb94f8);}else{throw new Error(util[_0xbdb2('0x2d')](_0xbdb2('0x53'),_0x1e4874['id']));}});}function setRelationship(_0x5cfb7d,_0x5e2603,_0x1a79ad,_0xb823d5){return request({'form':{'method':_0xbdb2('0x54'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xbdb2('0x28')]({'session':_0x5cfb7d['id'],'module_name':_0xbdb2('0x22'),'module_id':_0x1a79ad['id'],'link_field_name':_0xb823d5,'related_ids':[_0x5e2603['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xbdb2('0x55')]=function(_0x3b39a6,_0x1e0e81,_0x35fc97,_0x431e82,_0xbf21fe,_0x24f120){var _0x5093fe,_0x31d832,_0x873fde,_0x37436b;_0x24f120[_0xbdb2('0x56')]=intUtil[_0xbdb2('0x57')](_0x24f120[_0xbdb2('0x56')]);_0x24f120[_0xbdb2('0x58')]=intUtil['stripTrailingSlash'](_0x24f120['serverUrl']);def[_0xbdb2('0x59')]=util['format'](_0xbdb2('0x5a'),_0x24f120[_0xbdb2('0x56')]);if(_0xbf21fe&&_0xbf21fe['monitor_format']){logger[_0xbdb2('0xc')]('[QUEUE]',_0xbdb2('0x5b'));_0x1e0e81[_0xbdb2('0x5c')]=util[_0xbdb2('0x2d')](_0xbdb2('0x5d'),_0x24f120['serverUrl'],_0x1e0e81['uniqueid'],md5(_0x1e0e81['uniqueid']));}else{_0x1e0e81[_0xbdb2('0x5c')]='';}return getConnection(_0x24f120)[_0xbdb2('0x3b')](function(_0x2c6a51){_0x37436b=_0x2c6a51;return getUser(_0x24f120,_0x431e82[_0xbdb2('0xe')],_0x37436b);})[_0xbdb2('0x3b')](function(_0x45e919){_0x5093fe=_0x45e919;logger[_0xbdb2('0xc')](_0xbdb2('0x5e'),_0x5093fe['id']);return getEndUser(_0x24f120,_0x1e0e81[_0xbdb2('0x5f')],_0x1e0e81[_0xbdb2('0x60')],_0x37436b);})[_0xbdb2('0x3b')](function(_0x5d3d39){_0x31d832=_0x5d3d39;logger[_0xbdb2('0xc')](_0xbdb2('0x61'),_0x31d832['id']);return getTicket(_0x24f120,_0x5093fe,_0x31d832,_0x35fc97,_0x1e0e81,_0x35fc97['Fields'],_0x37436b,_0xbdb2('0x62'));})[_0xbdb2('0x3b')](function(_0x495b15){_0x873fde=_0x495b15;logger[_0xbdb2('0xc')](_0xbdb2('0x63'));logger[_0xbdb2('0xc')](_0xbdb2('0x64'),_0x873fde['id']);return setRelationship(_0x37436b,_0x5093fe,_0x873fde,'users');})[_0xbdb2('0x3b')](function(){return setRelationship(_0x37436b,_0x31d832,_0x873fde,'contacts');})['then'](function(){return getServerInfo(_0x37436b);})[_0xbdb2('0x3b')](function(_0x1d0194){var _0x7f2de=parseInt(_0x1d0194[_0xbdb2('0x65')][_0xbdb2('0x66')](0x0));var _0x4745f4=util[_0xbdb2('0x2d')](_0xbdb2('0x67'),_0x24f120['remoteUri'],_0x873fde['id']);if(_0x7f2de>0x6){_0x4745f4=util['format'](_0xbdb2('0x68'),_0x24f120['remoteUri'],_0x873fde['id']);}logger['info'](_0xbdb2('0x69'),_0xbdb2('0x6a'));emit(util[_0xbdb2('0x2d')](_0xbdb2('0x6b'),_0x431e82[_0xbdb2('0xe')]),_0xbdb2('0x6c'),{'uri':_0x4745f4});})['catch'](function(_0x5413c3){logger['error'](_0xbdb2('0x69'),JSON[_0xbdb2('0x28')](_0x5413c3));});};exports[_0xbdb2('0x6d')]=function(_0x5bbfe0,_0x2d3731,_0x1ae667,_0x182bd4,_0x35c811,_0x5a8608,_0x205d6b){var _0x239b0d,_0x1747e7,_0x4b115b,_0x6470db;_0x5a8608[_0xbdb2('0x56')]=intUtil[_0xbdb2('0x57')](_0x5a8608[_0xbdb2('0x56')]);_0x5a8608[_0xbdb2('0x58')]=intUtil[_0xbdb2('0x57')](_0x5a8608[_0xbdb2('0x58')]);def[_0xbdb2('0x59')]=util['format'](_0xbdb2('0x5a'),_0x5a8608[_0xbdb2('0x56')]);if(_0x205d6b&&_0x205d6b[_0xbdb2('0x6e')]&&_0x205d6b[_0xbdb2('0x6e')]!==_0xbdb2('0x6f')){logger['info'](_0xbdb2('0x70'),_0xbdb2('0x5b'));_0x2d3731['recordingURL']=util[_0xbdb2('0x2d')](_0xbdb2('0x5d'),_0x5a8608['serverUrl'],_0x2d3731[_0xbdb2('0x71')],md5(_0x2d3731[_0xbdb2('0x71')]));}return getConnection(_0x5a8608)[_0xbdb2('0x3b')](function(_0x5ac9fe){_0x6470db=_0x5ac9fe;return getUser(_0x5a8608,_0x182bd4[_0xbdb2('0xe')],_0x6470db);})[_0xbdb2('0x3b')](function(_0x4e1a9f){_0x239b0d=_0x4e1a9f;logger[_0xbdb2('0xc')](_0xbdb2('0x5e'),_0x239b0d['id']);return getEndUser(_0x5a8608,_0x2d3731[_0xbdb2('0x72')],_0x2d3731[_0xbdb2('0x73')],_0x6470db);})[_0xbdb2('0x3b')](function(_0x5d3a87){_0x1747e7=_0x5d3a87;logger[_0xbdb2('0xc')]('The\x20Enduser\x20ID\x20is:',_0x1747e7['id']);return getTicket(_0x5a8608,_0x239b0d,_0x1747e7,_0x1ae667,_0x2d3731,_0x1ae667[_0xbdb2('0x74')],_0x6470db,_0xbdb2('0x75'));})[_0xbdb2('0x3b')](function(_0xbc064c){_0x4b115b=_0xbc064c;logger[_0xbdb2('0xc')](_0xbdb2('0x63'));logger[_0xbdb2('0xc')](_0xbdb2('0x64'),_0x4b115b['id']);return setRelationship(_0x6470db,_0x239b0d,_0x4b115b,'users');})[_0xbdb2('0x3b')](function(){return setRelationship(_0x6470db,_0x1747e7,_0x4b115b,_0xbdb2('0x76'));})[_0xbdb2('0x3b')](function(){return getServerInfo(_0x6470db);})['then'](function(_0x488673){var _0x4c233c=parseInt(_0x488673[_0xbdb2('0x65')][_0xbdb2('0x66')](0x0));var _0x4373e0=util[_0xbdb2('0x2d')](_0xbdb2('0x67'),_0x5a8608[_0xbdb2('0x56')],_0x4b115b['id']);if(_0x4c233c>0x6){_0x4373e0=util[_0xbdb2('0x2d')](_0xbdb2('0x68'),_0x5a8608[_0xbdb2('0x56')],_0x4b115b['id']);}logger[_0xbdb2('0xc')](_0xbdb2('0x70'),_0xbdb2('0x6a'));emit(util['format']('user:%s',_0x182bd4[_0xbdb2('0xe')]),_0xbdb2('0x6c'),{'uri':_0x4373e0});})['catch'](function(_0x2e2260){logger[_0xbdb2('0x77')](_0xbdb2('0x70'),JSON[_0xbdb2('0x28')](_0x2e2260));});};exports[_0xbdb2('0x78')]=function(_0x37da92,_0xcc2abd,_0x5d07e1,_0x37974e,_0xabfc28,_0x126e48){var _0x10b9a5,_0x18920,_0x4c7d7d,_0x4bc3c9;_0x126e48[_0xbdb2('0x56')]=intUtil[_0xbdb2('0x57')](_0x126e48['remoteUri']);_0x126e48[_0xbdb2('0x58')]=intUtil[_0xbdb2('0x57')](_0x126e48[_0xbdb2('0x58')]);def[_0xbdb2('0x59')]=util[_0xbdb2('0x2d')](_0xbdb2('0x5a'),_0x126e48[_0xbdb2('0x56')]);if(_0xabfc28&&_0xabfc28['monitor_format']){logger[_0xbdb2('0xc')]('['+_0xcc2abd[_0xbdb2('0x79')][_0xbdb2('0x7a')]()+']',_0xbdb2('0x5b'));_0xcc2abd[_0xbdb2('0x5c')]=util['format'](_0xbdb2('0x5d'),_0x126e48[_0xbdb2('0x58')],_0xcc2abd[_0xbdb2('0x71')],md5(_0xcc2abd[_0xbdb2('0x71')]));}else{_0xcc2abd['recordingURL']='';}return getConnection(_0x126e48)[_0xbdb2('0x3b')](function(_0x51590f){_0x4bc3c9=_0x51590f;if(!_[_0xbdb2('0x29')](_0x37974e)){return getUser(_0x126e48,_0x37974e['name'],_0x4bc3c9);}else{return getUser(_0x126e48,null,_0x4bc3c9);}})[_0xbdb2('0x3b')](function(_0x3222b7){_0x10b9a5=_0x3222b7;logger[_0xbdb2('0xc')](_0xbdb2('0x5e'),_0x10b9a5['id']);return getEndUser(_0x126e48,_0xcc2abd['calleridname'],_0xcc2abd[_0xbdb2('0x60')],_0x4bc3c9);})[_0xbdb2('0x3b')](function(_0x4911d7){_0x18920=_0x4911d7;logger[_0xbdb2('0xc')]('The\x20Enduser\x20ID\x20is:',_0x18920['id']);return getTicket(_0x126e48,_0x10b9a5,_0x18920,_0x5d07e1,_0xcc2abd,_0x5d07e1['Fields'],_0x4bc3c9,'Inbound');})['then'](function(_0x1eed42){_0x4c7d7d=_0x1eed42;logger[_0xbdb2('0xc')](_0xbdb2('0x63'));logger[_0xbdb2('0xc')](_0xbdb2('0x64'),_0x4c7d7d['id']);return setRelationship(_0x4bc3c9,_0x10b9a5,_0x4c7d7d,_0xbdb2('0x7b'));})[_0xbdb2('0x3b')](function(){return setRelationship(_0x4bc3c9,_0x18920,_0x4c7d7d,_0xbdb2('0x76'));})[_0xbdb2('0x3b')](function(){return getServerInfo(_0x4bc3c9);})['catch'](function(_0x2d876c){logger[_0xbdb2('0x77')]('['+_0xcc2abd[_0xbdb2('0x79')]['toUpperCase']()+']',JSON[_0xbdb2('0x28')](_0x2d876c));});}; \ No newline at end of file +var _0x58c9=['The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','uri','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Fields','The\x20Ticket\x20ID\x20is:','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','error','unmanaged','toUpperCase','lastevent','lodash','request-promise','bluebird','md5','util','ioredis','../../../../config/logger','redis','socket.io-emitter','POST','emit','info','name','getString','Subjects','assigned_user_id','created_by','Descriptions','toISOString','duration_hours','duration_minutes','parent_id','parent_type','Contacts','direction','forEach','variableName','push','idField','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','toString','base64','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','length','find','entry_list','name_value_list','value','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','stringify','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','variable','custom_fields','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','stripTrailingSlash','remoteUri','serverUrl','%s/service/v4_1/rest.php','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x3ebd50,_0x20c8e3){var _0x3f57f2=function(_0x1ec80a){while(--_0x1ec80a){_0x3ebd50['push'](_0x3ebd50['shift']());}};_0x3f57f2(++_0x20c8e3);}(_0x58c9,0x103));var _0x958c=function(_0x193644,_0x4ae890){_0x193644=_0x193644-0x0;var _0x299846=_0x58c9[_0x193644];return _0x299846;};'use strict';var _=require(_0x958c('0x0'));var rp=require(_0x958c('0x1'));var BPromise=require(_0x958c('0x2'));var md5=require(_0x958c('0x3'));var util=require(_0x958c('0x4'));var Redis=require(_0x958c('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x958c('0x6'))('sugarcrm');config[_0x958c('0x7')]=_['defaults'](config[_0x958c('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x958c('0x8'))(new Redis(config[_0x958c('0x7')]));var def={'method':_0x958c('0x9'),'json':!![]};function emit(_0x1c1165,_0x34c34a,_0x29b334){io['to'](_0x1c1165)[_0x958c('0xa')](_0x34c34a,_0x29b334);}function getTicket(_0x3415af,_0x50e813,_0x5f55d0,_0xb64b24,_0x1f4365,_0x3867f7,_0x4d7a90,_0x29997d){logger[_0x958c('0xb')]('Creating\x20new\x20ticket...');var _0x250267=new Date();var _0x464b7f=[{'name':_0x958c('0xc'),'value':intUtil[_0x958c('0xd')](_0xb64b24[_0x958c('0xe')],_0x1f4365,'\x20')},{'name':_0x958c('0xf'),'value':_0x50e813['id']},{'name':_0x958c('0x10'),'value':_0x50e813['id']},{'name':'description','value':intUtil['getString'](_0xb64b24[_0x958c('0x11')],_0x1f4365,'\x0a')},{'name':'date_start','value':_0x250267[_0x958c('0x12')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x958c('0x13'),'value':'0'},{'name':_0x958c('0x14'),'value':'15'},{'name':_0x958c('0x15'),'value':_0x5f55d0['id']},{'name':_0x958c('0x16'),'value':_0x958c('0x17')},{'name':'parent_name','value':_0x5f55d0[_0x958c('0xc')]},{'name':_0x958c('0x18'),'value':_0x29997d}];if(_0x3867f7['length']){_[_0x958c('0x19')](_0x3867f7,function(_0x49cac7){if(_0x1f4365[_0x49cac7[_0x958c('0x1a')]]){_0x464b7f[_0x958c('0x1b')]({'name':_0x49cac7[_0x958c('0x1c')],'value':_0x1f4365[_0x49cac7['variableName']]});}});}return request({'form':{'method':_0x958c('0x1d'),'input_type':_0x958c('0x1e'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x4d7a90['id'],'module_name':_0x958c('0x1f'),'name_value_list':_0x464b7f})}});}function getAuth(_0xe2ae6e){return util[_0x958c('0x20')](_0x958c('0x21'),new Buffer(_0xe2ae6e[_0x958c('0x22')]+':X')[_0x958c('0x23')](_0x958c('0x24')));}function getServerInfo(_0x46c1f7){return request({'form':{'method':'get_server_info','input_type':_0x958c('0x1e'),'response_type':_0x958c('0x1e'),'rest_data':JSON['stringify']({'session':_0x46c1f7['id']})}});}function getUser(_0x225a05,_0x164df1,_0x109bc9){if(!_[_0x958c('0x25')](_0x164df1)){logger[_0x958c('0xb')](_0x958c('0x26'),_0x164df1);return request({'form':{'method':_0x958c('0x27'),'input_type':'JSON','response_type':_0x958c('0x1e'),'rest_data':JSON['stringify']({'session':_0x109bc9['id'],'module_name':_0x958c('0x28'),'query':util[_0x958c('0x20')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x164df1),'order_by':'','offset':'0','select_fields':['id',_0x958c('0xc'),_0x958c('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x958c('0x2a')](function(_0xdfc84f){if(_0xdfc84f['entry_list'][_0x958c('0x2b')]){var _0x10d25f=_[_0x958c('0x2c')](_0xdfc84f[_0x958c('0x2d')],function(_0x417edc){return _0x417edc[_0x958c('0x2e')][_0x958c('0x29')][_0x958c('0x2f')]===_0x164df1;});if(_0x10d25f){logger[_0x958c('0xb')]('Agent\x20found!');return BPromise[_0x958c('0x30')]({'id':_0x10d25f[_0x958c('0x2e')]['id']['value'],'name':_0x10d25f['name_value_list'][_0x958c('0xc')]['value']});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x958c('0x30')]({'id':_0x109bc9[_0x958c('0x2e')][_0x958c('0x31')]['value'],'name':_0x109bc9['name_value_list'][_0x958c('0x29')][_0x958c('0x2f')]});});}else{logger[_0x958c('0xb')](_0x958c('0x32'));return BPromise[_0x958c('0x30')]({'id':_0x109bc9[_0x958c('0x2e')][_0x958c('0x31')]['value'],'name':_0x109bc9[_0x958c('0x2e')][_0x958c('0x29')]['value']});}}function getEndUser(_0x2308f0,_0x1a9fc6,_0x4ce824,_0xfea4f1){logger['info'](_0x958c('0x33'),_0x4ce824);return request({'form':{'method':_0x958c('0x27'),'input_type':_0x958c('0x1e'),'response_type':_0x958c('0x1e'),'rest_data':JSON[_0x958c('0x34')]({'session':_0xfea4f1['id'],'module_name':_0x958c('0x17'),'query':util[_0x958c('0x20')](_0x958c('0x35'),_0x4ce824),'order_by':'','offset':'0','select_fields':['id',_0x958c('0xc'),_0x958c('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4de498){if(_0x4de498[_0x958c('0x2d')][_0x958c('0x2b')]){var _0x251801=_[_0x958c('0x2c')](_0x4de498[_0x958c('0x2d')],function(_0x478537){return _0x478537[_0x958c('0x2e')]['phone_home'][_0x958c('0x2f')]===_0x4ce824;});if(_0x251801){logger['info'](_0x958c('0x37'));return BPromise[_0x958c('0x30')]({'id':_0x251801[_0x958c('0x2e')]['id'][_0x958c('0x2f')],'name':_0x251801[_0x958c('0x2e')][_0x958c('0xc')][_0x958c('0x2f')],'phone':_0x251801[_0x958c('0x2e')][_0x958c('0x36')][_0x958c('0x2f')]});}}else{logger[_0x958c('0xb')](_0x958c('0x38'));return request({'form':{'method':_0x958c('0x1d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0xfea4f1['id'],'module_name':_0x958c('0x17'),'name_value_list':[{'name':_0x958c('0x39'),'value':_0x1a9fc6!==_0x958c('0x3a')?_0x1a9fc6:util[_0x958c('0x20')]('Caller\x20-\x20%s',_0x4ce824)},{'name':_0x958c('0x36'),'value':_0x4ce824}]})}})[_0x958c('0x2a')](function(_0x69604c){logger['info']('Enduser\x20created.');return BPromise[_0x958c('0x30')]({'id':_0x69604c['id'],'name':_0x69604c[_0x958c('0x2d')][_0x958c('0x39')][_0x958c('0x2f')],'phone':_0x69604c[_0x958c('0x2d')][_0x958c('0x36')][_0x958c('0x2f')]});});}});}function request(_0x44cfd5){logger[_0x958c('0x3b')](_0x958c('0x3c'),JSON[_0x958c('0x34')](_0x44cfd5));return rp(_[_0x958c('0x3d')](def,_0x44cfd5));}function getTags(_0x28354d,_0x49f75f){var _0x152bed=[];if(_0x28354d&&_0x28354d['length']>0x0){_0x152bed=_[_0x958c('0x3e')](_0x28354d,_0x49f75f);}return _0x152bed;}function getCustomFields(_0x254ec7,_0x1a6bfa){var _0x464d73=[];var _0x39fd09={'custom_fields':[]};if(_0x254ec7[_0x958c('0x2b')]>0x0){_['forEach'](_0x254ec7,function(_0x1ea7b2){if(_0x1ea7b2[_0x958c('0x3f')]===_0x958c('0x40')&&_0x1ea7b2[_0x958c('0x41')]&&!_0x1ea7b2[_0x958c('0x42')]){_0x39fd09[_0x1ea7b2[_0x958c('0x41')][_0x958c('0x43')]()]=_0x1ea7b2[_0x958c('0x44')][_0x958c('0x23')]();}else if(_0x1ea7b2[_0x958c('0x3f')]===_0x958c('0x40')&&_0x1ea7b2[_0x958c('0x1c')]&&_0x1ea7b2[_0x958c('0x42')]){_0x39fd09['custom_fields'][_0x958c('0x1b')]({'id':_0x1ea7b2[_0x958c('0x1c')],'value':_0x1ea7b2[_0x958c('0x44')][_0x958c('0x23')]()});}else if(_0x1ea7b2[_0x958c('0x3f')]===_0x958c('0x45')&&_0x1ea7b2[_0x958c('0x1a')]&&_0x1ea7b2[_0x958c('0x1c')]&&_0x1ea7b2['customField']){_0x1a6bfa[_0x1ea7b2[_0x958c('0x1a')]]&&_0x39fd09[_0x958c('0x46')]['push']({'id':_0x1ea7b2['idField'],'value':_0x1a6bfa[_0x1ea7b2['variableName']][_0x958c('0x23')]()});}else if(_0x1ea7b2[_0x958c('0x3f')]==='customVariable'&&_0x1ea7b2[_0x958c('0x47')]&&_0x1ea7b2[_0x958c('0x47')][_0x958c('0xc')]&&_0x1ea7b2['idField']&&_0x1ea7b2['customField']){_0x1a6bfa[_0x1ea7b2['Variable'][_0x958c('0xc')][_0x958c('0x43')]()]&&_0x39fd09['custom_fields'][_0x958c('0x1b')]({'id':_0x1ea7b2['idField'],'value':_0x1a6bfa[_0x1ea7b2['Variable'][_0x958c('0xc')][_0x958c('0x43')]()][_0x958c('0x23')]()});}});}return _0x39fd09;}function getConnection(_0x2b0577){return request({'method':_0x958c('0x9'),'form':{'method':_0x958c('0x48'),'input_type':_0x958c('0x1e'),'response_type':_0x958c('0x1e'),'rest_data':JSON[_0x958c('0x34')]({'user_auth':{'user_name':_0x2b0577[_0x958c('0x49')],'password':_0x2b0577['password'],'encryption':_0x958c('0x4a')},'application':_0x958c('0x4b')})}})['then'](function(_0x440d85){var _0x23e1e6=_0x440d85;if(_0x23e1e6['id']){def[_0x958c('0x4c')]=_0x23e1e6['id'];return BPromise[_0x958c('0x30')](_0x23e1e6);}else{throw new Error(util[_0x958c('0x20')](_0x958c('0x4d'),_0x2b0577['id']));}});}function setRelationship(_0x11a930,_0x6e1cff,_0x4ba107,_0x586776){return request({'form':{'method':_0x958c('0x4e'),'input_type':_0x958c('0x1e'),'response_type':_0x958c('0x1e'),'rest_data':JSON['stringify']({'session':_0x11a930['id'],'module_name':_0x958c('0x1f'),'module_id':_0x4ba107['id'],'link_field_name':_0x586776,'related_ids':[_0x6e1cff['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x41e550,_0x3b4009,_0x4da6eb,_0x4bee95,_0xb10796,_0x4bbfeb){var _0x1047b8,_0xf01fc9,_0x49c65b,_0xc396f4;_0x4bbfeb['remoteUri']=intUtil[_0x958c('0x4f')](_0x4bbfeb[_0x958c('0x50')]);_0x4bbfeb[_0x958c('0x51')]=intUtil[_0x958c('0x4f')](_0x4bbfeb[_0x958c('0x51')]);def['uri']=util[_0x958c('0x20')](_0x958c('0x52'),_0x4bbfeb['remoteUri']);if(_0xb10796&&_0xb10796['monitor_format']){logger[_0x958c('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4009[_0x958c('0x53')]=util[_0x958c('0x20')](_0x958c('0x54'),_0x4bbfeb[_0x958c('0x51')],_0x3b4009[_0x958c('0x55')],md5(_0x3b4009[_0x958c('0x55')]));}else{_0x3b4009[_0x958c('0x53')]='';}return getConnection(_0x4bbfeb)[_0x958c('0x2a')](function(_0x3f4113){_0xc396f4=_0x3f4113;return getUser(_0x4bbfeb,_0x4bee95[_0x958c('0xc')],_0xc396f4);})[_0x958c('0x2a')](function(_0x2e957f){_0x1047b8=_0x2e957f;logger[_0x958c('0xb')](_0x958c('0x56'),_0x1047b8['id']);return getEndUser(_0x4bbfeb,_0x3b4009[_0x958c('0x57')],_0x3b4009[_0x958c('0x58')],_0xc396f4);})[_0x958c('0x2a')](function(_0x282466){_0xf01fc9=_0x282466;logger[_0x958c('0xb')](_0x958c('0x59'),_0xf01fc9['id']);return getTicket(_0x4bbfeb,_0x1047b8,_0xf01fc9,_0x4da6eb,_0x3b4009,_0x4da6eb['Fields'],_0xc396f4,_0x958c('0x5a'));})['then'](function(_0x402ee9){_0x49c65b=_0x402ee9;logger[_0x958c('0xb')](_0x958c('0x5b'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x49c65b['id']);return setRelationship(_0xc396f4,_0x1047b8,_0x49c65b,_0x958c('0x5c'));})[_0x958c('0x2a')](function(){return setRelationship(_0xc396f4,_0xf01fc9,_0x49c65b,_0x958c('0x5d'));})[_0x958c('0x2a')](function(){return getServerInfo(_0xc396f4);})[_0x958c('0x2a')](function(_0x4c2fab){var _0x4fda66=parseInt(_0x4c2fab[_0x958c('0x5e')][_0x958c('0x5f')](0x0));var _0x172887=util[_0x958c('0x20')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x4bbfeb[_0x958c('0x50')],_0x49c65b['id']);if(_0x4fda66>0x6){_0x172887=util[_0x958c('0x20')](_0x958c('0x60'),_0x4bbfeb[_0x958c('0x50')],_0x49c65b['id']);}logger[_0x958c('0xb')](_0x958c('0x61'),_0x958c('0x62'));emit(util[_0x958c('0x20')](_0x958c('0x63'),_0x4bee95[_0x958c('0xc')]),'trigger:browser:url',{'uri':_0x172887});})[_0x958c('0x64')](function(_0xf5a39c){logger['error'](_0x958c('0x61'),JSON[_0x958c('0x34')](_0xf5a39c));});};exports['outbound']=function(_0x46a49a,_0x5cf230,_0x261ebb,_0x4fdaff,_0x129bf1,_0x5cca94,_0x5269da){var _0x2eb58e,_0x25173c,_0x51c3b0,_0x4421ec;_0x5cca94[_0x958c('0x50')]=intUtil['stripTrailingSlash'](_0x5cca94['remoteUri']);_0x5cca94[_0x958c('0x51')]=intUtil[_0x958c('0x4f')](_0x5cca94[_0x958c('0x51')]);def[_0x958c('0x65')]=util[_0x958c('0x20')](_0x958c('0x52'),_0x5cca94['remoteUri']);if(_0x5269da&&_0x5269da['recordingFormat']&&_0x5269da[_0x958c('0x66')]!==_0x958c('0x67')){logger[_0x958c('0xb')](_0x958c('0x68'),_0x958c('0x69'));_0x5cf230[_0x958c('0x53')]=util[_0x958c('0x20')](_0x958c('0x54'),_0x5cca94[_0x958c('0x51')],_0x5cf230[_0x958c('0x55')],md5(_0x5cf230[_0x958c('0x55')]));}return getConnection(_0x5cca94)[_0x958c('0x2a')](function(_0xecab3){_0x4421ec=_0xecab3;return getUser(_0x5cca94,_0x4fdaff['name'],_0x4421ec);})[_0x958c('0x2a')](function(_0x3da465){_0x2eb58e=_0x3da465;logger[_0x958c('0xb')](_0x958c('0x56'),_0x2eb58e['id']);return getEndUser(_0x5cca94,_0x5cf230[_0x958c('0x6a')],_0x5cf230[_0x958c('0x6b')],_0x4421ec);})['then'](function(_0x4f0a0c){_0x25173c=_0x4f0a0c;logger[_0x958c('0xb')](_0x958c('0x59'),_0x25173c['id']);return getTicket(_0x5cca94,_0x2eb58e,_0x25173c,_0x261ebb,_0x5cf230,_0x261ebb[_0x958c('0x6c')],_0x4421ec,'Outbound');})[_0x958c('0x2a')](function(_0x37f6fa){_0x51c3b0=_0x37f6fa;logger['info'](_0x958c('0x5b'));logger[_0x958c('0xb')](_0x958c('0x6d'),_0x51c3b0['id']);return setRelationship(_0x4421ec,_0x2eb58e,_0x51c3b0,_0x958c('0x5c'));})[_0x958c('0x2a')](function(){return setRelationship(_0x4421ec,_0x25173c,_0x51c3b0,_0x958c('0x5d'));})[_0x958c('0x2a')](function(){return getServerInfo(_0x4421ec);})[_0x958c('0x2a')](function(_0x498e9e){var _0x500ae2=parseInt(_0x498e9e[_0x958c('0x5e')][_0x958c('0x5f')](0x0));var _0x5f3ba0=util[_0x958c('0x20')](_0x958c('0x6e'),_0x5cca94[_0x958c('0x50')],_0x51c3b0['id']);if(_0x500ae2>0x6){_0x5f3ba0=util[_0x958c('0x20')](_0x958c('0x60'),_0x5cca94[_0x958c('0x50')],_0x51c3b0['id']);}logger[_0x958c('0xb')](_0x958c('0x68'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x958c('0x20')](_0x958c('0x63'),_0x4fdaff['name']),'trigger:browser:url',{'uri':_0x5f3ba0});})[_0x958c('0x64')](function(_0x48a651){logger[_0x958c('0x6f')](_0x958c('0x68'),JSON[_0x958c('0x34')](_0x48a651));});};exports[_0x958c('0x70')]=function(_0x16ee16,_0x48bc55,_0x4916d2,_0x1d59d0,_0x5e9098,_0x3f0bed){var _0x5b0a9e,_0x235cee,_0xdd4db8,_0xe197bd;_0x3f0bed[_0x958c('0x50')]=intUtil[_0x958c('0x4f')](_0x3f0bed[_0x958c('0x50')]);_0x3f0bed['serverUrl']=intUtil[_0x958c('0x4f')](_0x3f0bed[_0x958c('0x51')]);def['uri']=util[_0x958c('0x20')]('%s/service/v4_1/rest.php',_0x3f0bed[_0x958c('0x50')]);if(_0x5e9098&&_0x5e9098['monitor_format']){logger[_0x958c('0xb')]('['+_0x48bc55['lastevent'][_0x958c('0x71')]()+']',_0x958c('0x69'));_0x48bc55[_0x958c('0x53')]=util[_0x958c('0x20')](_0x958c('0x54'),_0x3f0bed[_0x958c('0x51')],_0x48bc55[_0x958c('0x55')],md5(_0x48bc55[_0x958c('0x55')]));}else{_0x48bc55[_0x958c('0x53')]='';}return getConnection(_0x3f0bed)[_0x958c('0x2a')](function(_0x36eddd){_0xe197bd=_0x36eddd;if(!_['isNil'](_0x1d59d0)){return getUser(_0x3f0bed,_0x1d59d0[_0x958c('0xc')],_0xe197bd);}else{return getUser(_0x3f0bed,null,_0xe197bd);}})['then'](function(_0x377439){_0x5b0a9e=_0x377439;logger[_0x958c('0xb')](_0x958c('0x56'),_0x5b0a9e['id']);return getEndUser(_0x3f0bed,_0x48bc55[_0x958c('0x57')],_0x48bc55[_0x958c('0x58')],_0xe197bd);})[_0x958c('0x2a')](function(_0x374095){_0x235cee=_0x374095;logger[_0x958c('0xb')](_0x958c('0x59'),_0x235cee['id']);return getTicket(_0x3f0bed,_0x5b0a9e,_0x235cee,_0x4916d2,_0x48bc55,_0x4916d2[_0x958c('0x6c')],_0xe197bd,_0x958c('0x5a'));})[_0x958c('0x2a')](function(_0x2d83ea){_0xdd4db8=_0x2d83ea;logger[_0x958c('0xb')](_0x958c('0x5b'));logger['info']('The\x20Ticket\x20ID\x20is:',_0xdd4db8['id']);return setRelationship(_0xe197bd,_0x5b0a9e,_0xdd4db8,_0x958c('0x5c'));})[_0x958c('0x2a')](function(){return setRelationship(_0xe197bd,_0x235cee,_0xdd4db8,_0x958c('0x5d'));})[_0x958c('0x2a')](function(){return getServerInfo(_0xe197bd);})[_0x958c('0x64')](function(_0x1fec10){logger[_0x958c('0x6f')]('['+_0x48bc55[_0x958c('0x72')][_0x958c('0x71')]()+']',JSON[_0x958c('0x34')](_0x1fec10));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/util.js b/server/services/ami/trigger/integration/util.js index a98a651..e7ac834 100644 --- a/server/services/ami/trigger/integration/util.js +++ b/server/services/ami/trigger/integration/util.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x401c=['test','toLowerCase','lodash','util','getString','length','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','keyValue','keyType','key','format','%s:\x20%s','join','stripTrailingSlash','slice','validateEmail','isNil'];(function(_0x557a27,_0x415cff){var _0x4a354e=function(_0x5eaead){while(--_0x5eaead){_0x557a27['push'](_0x557a27['shift']());}};_0x4a354e(++_0x415cff);}(_0x401c,0x13a));var _0xc401=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0x401c[_0x111e94];return _0x3de107;};'use strict';var _=require(_0xc401('0x0'));var util=require(_0xc401('0x1'));exports[_0xc401('0x2')]=function(_0x40e1c3,_0x431866,_0x23cc52){var _0x9cc51d=[];if(_0x40e1c3['length']>0x0){var _0x293200=_['sortBy'](_0x40e1c3,['id']);for(var _0x35292f=0x0;_0x35292f<_0x293200[_0xc401('0x3')];_0x35292f++){var _0x1dbb94=_0x293200[_0x35292f];if(_0x1dbb94[_0xc401('0x4')]===_0xc401('0x5')){_0x9cc51d[_0xc401('0x6')](_0x1dbb94[_0xc401('0x7')]);}else if(_0x1dbb94[_0xc401('0x4')]===_0xc401('0x8')&&_0x1dbb94['variableName']){_0x431866[_0x1dbb94[_0xc401('0x9')]]&&_0x9cc51d['push'](_0x431866[_0x1dbb94['variableName']][_0xc401('0xa')]());}else if(_0x1dbb94[_0xc401('0x4')]===_0xc401('0xb')&&_0x1dbb94['Variable']&&_0x1dbb94[_0xc401('0xc')][_0xc401('0xd')]){_0x431866[_0x1dbb94[_0xc401('0xc')][_0xc401('0xd')]['toLowerCase']()]&&_0x9cc51d[_0xc401('0x6')](_0x431866[_0x1dbb94[_0xc401('0xc')]['name']['toLowerCase']()][_0xc401('0xa')]());}else if(_0x1dbb94[_0xc401('0x4')]===_0xc401('0xe')){if(_0x1dbb94[_0xc401('0xf')]==='string'&&_0x1dbb94[_0xc401('0x10')]){_0x9cc51d[_0xc401('0x6')](util[_0xc401('0x11')](_0xc401('0x12'),_0x1dbb94[_0xc401('0x10')],_0x1dbb94['keyContent']));}else if(_0x1dbb94[_0xc401('0xf')]===_0xc401('0x8')&&_0x1dbb94[_0xc401('0x9')]&&_0x1dbb94[_0xc401('0x10')]){_0x431866[_0x1dbb94[_0xc401('0x9')]]&&_0x9cc51d[_0xc401('0x6')](util[_0xc401('0x11')](_0xc401('0x12'),_0x1dbb94[_0xc401('0x10')],_0x431866[_0x1dbb94[_0xc401('0x9')]]));}else if(_0x1dbb94[_0xc401('0xf')]===_0xc401('0xb')&&_0x1dbb94[_0xc401('0xc')]&&_0x1dbb94[_0xc401('0xc')][_0xc401('0xd')]&&_0x1dbb94['key']){_0x431866[_0x1dbb94[_0xc401('0xc')][_0xc401('0xd')]['toLowerCase']()]&&_0x9cc51d[_0xc401('0x6')](util['format'](_0xc401('0x12'),_0x1dbb94[_0xc401('0x10')],_0x431866[_0x1dbb94['Variable'][_0xc401('0xd')]['toLowerCase']()]));}}}}return _0x9cc51d[_0xc401('0x13')](_0x23cc52);};exports[_0xc401('0x14')]=function(_0x37b03f){var _0x4ca0c9=_0x37b03f[_0xc401('0x15')](-0x1);if(_0x4ca0c9==='/'){_0x37b03f=_0x37b03f['substring'](0x0,_0x37b03f['lastIndexOf'](_0x4ca0c9));}return _0x37b03f;};exports[_0xc401('0x16')]=function(_0x4c013b){if(!_[_0xc401('0x17')](_0x4c013b)&&_0x4c013b!==''){var _0x566b94=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x566b94[_0xc401('0x18')](String(_0x4c013b)[_0xc401('0x19')]());}else{return![];}}; \ No newline at end of file +var _0xfe98=['getString','length','sortBy','type','string','push','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','format','%s:\x20%s','key','join','stripTrailingSlash','slice','lastIndexOf','test','lodash','util'];(function(_0x1cfc39,_0x1d3913){var _0x957a28=function(_0x2be930){while(--_0x2be930){_0x1cfc39['push'](_0x1cfc39['shift']());}};_0x957a28(++_0x1d3913);}(_0xfe98,0x143));var _0x8fe9=function(_0xf34895,_0x21fb70){_0xf34895=_0xf34895-0x0;var _0x143f44=_0xfe98[_0xf34895];return _0x143f44;};'use strict';var _=require(_0x8fe9('0x0'));var util=require(_0x8fe9('0x1'));exports[_0x8fe9('0x2')]=function(_0x117a7f,_0x219bbf,_0x1a1920){var _0x4f828c=[];if(_0x117a7f[_0x8fe9('0x3')]>0x0){var _0x1ab06e=_[_0x8fe9('0x4')](_0x117a7f,['id']);for(var _0x366c12=0x0;_0x366c12<_0x1ab06e[_0x8fe9('0x3')];_0x366c12++){var _0x104b6b=_0x1ab06e[_0x366c12];if(_0x104b6b[_0x8fe9('0x5')]===_0x8fe9('0x6')){_0x4f828c[_0x8fe9('0x7')](_0x104b6b['content']);}else if(_0x104b6b[_0x8fe9('0x5')]===_0x8fe9('0x8')&&_0x104b6b['variableName']){_0x219bbf[_0x104b6b[_0x8fe9('0x9')]]&&_0x4f828c[_0x8fe9('0x7')](_0x219bbf[_0x104b6b[_0x8fe9('0x9')]][_0x8fe9('0xa')]());}else if(_0x104b6b[_0x8fe9('0x5')]===_0x8fe9('0xb')&&_0x104b6b['Variable']&&_0x104b6b[_0x8fe9('0xc')][_0x8fe9('0xd')]){_0x219bbf[_0x104b6b[_0x8fe9('0xc')][_0x8fe9('0xd')][_0x8fe9('0xe')]()]&&_0x4f828c[_0x8fe9('0x7')](_0x219bbf[_0x104b6b[_0x8fe9('0xc')][_0x8fe9('0xd')][_0x8fe9('0xe')]()]['toString']());}else if(_0x104b6b[_0x8fe9('0x5')]===_0x8fe9('0xf')){if(_0x104b6b[_0x8fe9('0x10')]===_0x8fe9('0x6')&&_0x104b6b['key']){_0x4f828c['push'](util[_0x8fe9('0x11')](_0x8fe9('0x12'),_0x104b6b[_0x8fe9('0x13')],_0x104b6b['keyContent']));}else if(_0x104b6b[_0x8fe9('0x10')]===_0x8fe9('0x8')&&_0x104b6b[_0x8fe9('0x9')]&&_0x104b6b['key']){_0x219bbf[_0x104b6b['variableName']]&&_0x4f828c['push'](util['format'](_0x8fe9('0x12'),_0x104b6b[_0x8fe9('0x13')],_0x219bbf[_0x104b6b[_0x8fe9('0x9')]]));}else if(_0x104b6b[_0x8fe9('0x10')]===_0x8fe9('0xb')&&_0x104b6b['Variable']&&_0x104b6b['Variable'][_0x8fe9('0xd')]&&_0x104b6b[_0x8fe9('0x13')]){_0x219bbf[_0x104b6b['Variable']['name'][_0x8fe9('0xe')]()]&&_0x4f828c[_0x8fe9('0x7')](util[_0x8fe9('0x11')](_0x8fe9('0x12'),_0x104b6b[_0x8fe9('0x13')],_0x219bbf[_0x104b6b[_0x8fe9('0xc')][_0x8fe9('0xd')]['toLowerCase']()]));}}}}return _0x4f828c[_0x8fe9('0x14')](_0x1a1920);};exports[_0x8fe9('0x15')]=function(_0x4ababd){var _0x18e758=_0x4ababd[_0x8fe9('0x16')](-0x1);if(_0x18e758==='/'){_0x4ababd=_0x4ababd['substring'](0x0,_0x4ababd[_0x8fe9('0x17')](_0x18e758));}return _0x4ababd;};exports['validateEmail']=function(_0x27c64a){if(!_['isNil'](_0x27c64a)&&_0x27c64a!==''){var _0xd30ea0=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0xd30ea0[_0x8fe9('0x18')](String(_0x27c64a)[_0x8fe9('0xe')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index da30def..e709f76 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x493169,_0x5a53c3){var _0x15307c=function(_0x14bfac){while(--_0x14bfac){_0x493169['push'](_0x493169['shift']());}};_0x15307c(++_0x5a53c3);}(_0x34e8,0x12c));var _0x834e=function(_0xbbcb8f,_0x2a564c){_0xbbcb8f=_0xbbcb8f-0x0;var _0x132b36=_0x34e8[_0xbbcb8f];return _0x132b36;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 7c50734..b286975 100644 --- a/server/services/ami/trigger/integration/zendesk.js +++ b/server/services/ami/trigger/integration/zendesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde42=['defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','merge','Tags','name','Subjects','Descriptions','getString','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','count','Agent\x20found!','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','first','Enduser\x20found!','%s/users.json','POST','end-user','Caller\x20-\x20%s','user','authType','password','%s:%s','username','%s/token:%s','toString','base64','debug','[HTTP]','stringify','GET','map','includes','string','type','nameField','customField','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','toLowerCase','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis'];(function(_0x11b7bd,_0x3923ba){var _0x29a90b=function(_0x3a74a3){while(--_0x3a74a3){_0x11b7bd['push'](_0x11b7bd['shift']());}};_0x29a90b(++_0x3923ba);}(_0xde42,0x1be));var _0x2de4=function(_0x5b3a35,_0x312e9b){_0x5b3a35=_0x5b3a35-0x0;var _0x4383df=_0xde42[_0x5b3a35];return _0x4383df;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x2de4('0x0'));var Redis=require(_0x2de4('0x1'));var intUtil=require('./util');var config=require(_0x2de4('0x2'));var logger=require(_0x2de4('0x3'))(_0x2de4('0x4'));config[_0x2de4('0x5')]=_[_0x2de4('0x6')](config[_0x2de4('0x5')],{'host':_0x2de4('0x7'),'port':0x18eb});var io=require(_0x2de4('0x8'))(new Redis(config[_0x2de4('0x5')]));function emit(_0x5ecc3d,_0x543284,_0x1b9e4d){io['to'](_0x5ecc3d)[_0x2de4('0x9')](_0x543284,_0x1b9e4d);}var headers={'Content-Type':_0x2de4('0xa'),'Accept':'application/json'};function getTicket(_0x2dbd7b,_0x23cb1b,_0x58b345,_0x249dc5,_0x262885){logger[_0x2de4('0xb')](_0x2de4('0xc'));return request({'uri':util[_0x2de4('0xd')](_0x2de4('0xe'),_0x2dbd7b['remoteUri']),'method':'POST','body':{'ticket':_[_0x2de4('0xf')]({'requester_id':_0x58b345['id'],'submitter_id':_0x23cb1b?_0x23cb1b['id']:undefined,'assignee_id':_0x23cb1b?_0x23cb1b['id']:undefined,'tags':getTags(_0x249dc5[_0x2de4('0x10')],_0x2de4('0x11')),'subject':intUtil['getString'](_0x249dc5[_0x2de4('0x12')],_0x262885,'\x20'),'description':intUtil['getString'](_0x249dc5[_0x2de4('0x13')],_0x262885,'\x0a'),'comment':{'public':![],'body':intUtil[_0x2de4('0x14')](_0x249dc5['Descriptions'],_0x262885,'\x0a')}},getCustomFields(_0x249dc5[_0x2de4('0x15')],_0x262885))}})[_0x2de4('0x16')](function(_0x50d4b0){logger[_0x2de4('0xb')](_0x2de4('0x17'));return _0x50d4b0[_0x2de4('0x18')];});}function getUser(_0x4db54e,_0x5cba65){if(intUtil[_0x2de4('0x19')](_0x5cba65)){logger[_0x2de4('0xb')](_0x2de4('0x1a'),_0x5cba65);return request({'uri':util[_0x2de4('0xd')](_0x2de4('0x1b'),_0x4db54e[_0x2de4('0x1c')]),'qs':{'query':util[_0x2de4('0xd')]('type:user\x20role:agent\x20email:%s',_0x5cba65)}})[_0x2de4('0x16')](function(_0x1591cb){if(_0x1591cb[_0x2de4('0x1d')]){logger['info'](_0x2de4('0x1e'));return _['find'](_0x1591cb['results'],{'email':_0x5cba65,'role':_0x2de4('0x1f')});}else{logger[_0x2de4('0xb')](_0x2de4('0x20'));return request({'uri':util[_0x2de4('0xd')](_0x2de4('0x21'),_0x4db54e['remoteUri'])})[_0x2de4('0x16')](function(_0x384103){logger['info'](_0x2de4('0x22'));return _0x384103['user'];});}});}else{logger['info'](_0x2de4('0x20'));return request({'uri':util[_0x2de4('0xd')](_0x2de4('0x21'),_0x4db54e[_0x2de4('0x1c')])})['then'](function(_0x1ef31f){logger[_0x2de4('0xb')](_0x2de4('0x22'));return _0x1ef31f['user'];});}}function getEndUser(_0x11fa30,_0x26563b,_0x11de62){logger['info'](_0x2de4('0x23'),_0x11de62);return request({'uri':util[_0x2de4('0xd')]('%s/search.json',_0x11fa30['remoteUri']),'qs':{'query':util[_0x2de4('0xd')](_0x2de4('0x24'),_0x11de62)}})['then'](function(_0x1ba2d9){var _0x4e4540;if(_0x1ba2d9[_0x2de4('0x25')][_0x2de4('0x26')]){_0x1ba2d9[_0x2de4('0x25')]=_[_0x2de4('0x27')](_0x1ba2d9[_0x2de4('0x25')],{'suspended':![],'role':'end-user'});if(_0x1ba2d9[_0x2de4('0x25')][_0x2de4('0x26')]){_0x4e4540=_[_0x2de4('0x28')](_0x1ba2d9['results']);}}if(_0x4e4540){logger[_0x2de4('0xb')](_0x2de4('0x29'));return _0x4e4540;}else{logger[_0x2de4('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x2de4('0x2a'),_0x11fa30[_0x2de4('0x1c')]),'method':_0x2de4('0x2b'),'body':{'user':{'role':_0x2de4('0x2c'),'name':util[_0x2de4('0xd')](_0x2de4('0x2d'),_0x26563b||_0x11de62),'phone':_0x11de62}}})['then'](function(_0x31b3bc){logger[_0x2de4('0xb')]('Enduser\x20created.');return _0x31b3bc[_0x2de4('0x2e')];});}});}function getAuth(_0x480a96){var _0x590e59;if(_0x480a96[_0x2de4('0x2f')]===_0x2de4('0x30')){_0x590e59=util['format'](_0x2de4('0x31'),_0x480a96[_0x2de4('0x32')],_0x480a96[_0x2de4('0x30')]);}else if(_0x480a96[_0x2de4('0x2f')]==='token'){_0x590e59=util[_0x2de4('0xd')](_0x2de4('0x33'),_0x480a96[_0x2de4('0x32')],_0x480a96['token']);}return util[_0x2de4('0xd')]('Basic\x20%s',new Buffer(_0x590e59)[_0x2de4('0x34')](_0x2de4('0x35')));}function request(_0x10d3a1){logger[_0x2de4('0x36')](_0x2de4('0x37'),JSON[_0x2de4('0x38')](_0x10d3a1));return rp(_[_0x2de4('0x6')](_0x10d3a1,{'method':_0x2de4('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x389f12,_0x2e35ea){var _0x37dbcd=[];if(_0x389f12&&_0x389f12['length']>0x0){_0x37dbcd=_[_0x2de4('0x3a')](_0x389f12,_0x2e35ea);}return _0x37dbcd;}function getCustomFields(_0x519260,_0x330a2a){var _0x5d8b58=[];var _0x24eecc={'custom_fields':[]};if(_0x519260[_0x2de4('0x26')]>0x0){_['forEach'](_0x519260,function(_0x343760){if(_[_0x2de4('0x3b')]([_0x2de4('0x3c'),'picklist'],_0x343760[_0x2de4('0x3d')])&&_0x343760[_0x2de4('0x3e')]&&!_0x343760[_0x2de4('0x3f')]){_0x24eecc[_0x343760[_0x2de4('0x3e')]['toLowerCase']()]=_0x343760[_0x2de4('0x40')][_0x2de4('0x34')]();}else if(_[_0x2de4('0x3b')]([_0x2de4('0x3c'),'picklist'],_0x343760[_0x2de4('0x3d')])&&_0x343760[_0x2de4('0x41')]&&_0x343760['customField']){_0x24eecc[_0x2de4('0x42')][_0x2de4('0x43')]({'id':_0x343760[_0x2de4('0x41')],'value':_0x343760[_0x2de4('0x40')][_0x2de4('0x34')]()});}else if(_0x343760[_0x2de4('0x3d')]===_0x2de4('0x44')&&_0x343760['variableName']&&_0x343760[_0x2de4('0x41')]&&_0x343760[_0x2de4('0x3f')]){_0x330a2a[_0x343760[_0x2de4('0x45')]]&&_0x24eecc[_0x2de4('0x42')][_0x2de4('0x43')]({'id':_0x343760['idField'],'value':_0x330a2a[_0x343760[_0x2de4('0x45')]]['toString']()});}else if(_0x343760[_0x2de4('0x3d')]===_0x2de4('0x46')&&_0x343760[_0x2de4('0x47')]&&_0x343760[_0x2de4('0x47')][_0x2de4('0x11')]&&_0x343760[_0x2de4('0x41')]&&_0x343760['customField']){_0x330a2a[_0x343760[_0x2de4('0x47')][_0x2de4('0x11')][_0x2de4('0x48')]()]&&_0x24eecc[_0x2de4('0x42')][_0x2de4('0x43')]({'id':_0x343760[_0x2de4('0x41')],'value':_0x330a2a[_0x343760[_0x2de4('0x47')][_0x2de4('0x11')][_0x2de4('0x48')]()]['toString']()});}});}return _0x24eecc;}exports['queue']=function(_0x2748bf,_0x18a703,_0x1b70a7,_0xccf890,_0x52b9ca,_0x2cb17c){var _0x2ca23e,_0x111366;_0x2cb17c[_0x2de4('0x1c')]=intUtil[_0x2de4('0x49')](_0x2cb17c[_0x2de4('0x1c')]);_0x2cb17c[_0x2de4('0x4a')]=intUtil[_0x2de4('0x49')](_0x2cb17c[_0x2de4('0x4a')]);if(_0x52b9ca&&_0x52b9ca['monitor_format']){logger[_0x2de4('0xb')](_0x2de4('0x4b'),_0x2de4('0x4c'));_0x18a703[_0x2de4('0x4d')]=util['format'](_0x2de4('0x4e'),_0x2cb17c[_0x2de4('0x4a')],_0x18a703[_0x2de4('0x4f')],md5(_0x18a703[_0x2de4('0x4f')]));}else{_0x18a703[_0x2de4('0x4d')]='';}headers[_0x2de4('0x50')]=getAuth(_0x2cb17c);return getUser(_0x2cb17c,_0xccf890[_0x2de4('0x51')])[_0x2de4('0x16')](function(_0x274a7a){_0x2ca23e=_0x274a7a;logger[_0x2de4('0xb')](_0x2de4('0x52'),_0x2ca23e['id']);return getEndUser(_0x2cb17c,_0x18a703[_0x2de4('0x53')],_0x18a703[_0x2de4('0x54')]);})[_0x2de4('0x16')](function(_0x46f925){_0x111366=_0x46f925;logger[_0x2de4('0xb')](_0x2de4('0x55'),_0x111366['id']);return getTicket(_0x2cb17c,_0x2ca23e,_0x111366,_0x1b70a7,_0x18a703);})[_0x2de4('0x16')](function(_0x42d2f1){if(_0x42d2f1){logger[_0x2de4('0xb')]('The\x20Ticket\x20ID\x20is:',_0x42d2f1['id']);switch(_0x2cb17c[_0x2de4('0x3d')]){case _0x2de4('0x56'):logger['info']('[QUEUE]',_0x2de4('0x57'));return request({'uri':util[_0x2de4('0xd')](_0x2de4('0x58'),_0x2cb17c['remoteUri'],_0x2ca23e['id'],_0x42d2f1['id']),'method':_0x2de4('0x2b')});case _0x2de4('0x59'):logger['info']('[QUEUE]',_0x2de4('0x5a'));emit(util[_0x2de4('0xd')](_0x2de4('0x5b'),_0xccf890[_0x2de4('0x11')]),_0x2de4('0x5c'),{'uri':util[_0x2de4('0xd')](_0x2de4('0x5d'),_0x2cb17c['remoteUri'][_0x2de4('0x5e')](_0x2de4('0x5f'),''),_0x42d2f1['id'])});break;default:logger[_0x2de4('0x60')](_0x2de4('0x4b'),_0x2de4('0x61'));}}})[_0x2de4('0x62')](function(_0x26bbd3){logger[_0x2de4('0x60')](_0x2de4('0x63'),util[_0x2de4('0x64')](_0x26bbd3,{'showHidden':!![],'depth':null}));});};exports[_0x2de4('0x65')]=function(_0x242907,_0x386020,_0x49ca56,_0x258c65,_0x3fea42,_0x101c5e,_0x477db8){var _0x51c5d5,_0x16520a;_0x101c5e['remoteUri']=intUtil['stripTrailingSlash'](_0x101c5e[_0x2de4('0x1c')]);_0x101c5e[_0x2de4('0x4a')]=intUtil[_0x2de4('0x49')](_0x101c5e[_0x2de4('0x4a')]);if(_0x477db8&&_0x477db8[_0x2de4('0x66')]&&_0x477db8[_0x2de4('0x66')]!=='none'){logger[_0x2de4('0xb')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x386020['recordingURL']=util[_0x2de4('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x101c5e[_0x2de4('0x4a')],_0x386020[_0x2de4('0x4f')],md5(_0x386020[_0x2de4('0x4f')]));}headers['Authorization']=getAuth(_0x101c5e);return getUser(_0x101c5e,_0x258c65[_0x2de4('0x51')])['then'](function(_0x214581){_0x51c5d5=_0x214581;logger[_0x2de4('0xb')]('The\x20User\x20ID\x20is:',_0x51c5d5['id']);return getEndUser(_0x101c5e,_0x386020[_0x2de4('0x67')],_0x386020[_0x2de4('0x68')]);})['then'](function(_0x5ec6ba){_0x16520a=_0x5ec6ba;logger[_0x2de4('0xb')](_0x2de4('0x55'),_0x16520a['id']);return getTicket(_0x101c5e,_0x51c5d5,_0x16520a,_0x49ca56,_0x386020);})['then'](function(_0xd944dc){if(_0xd944dc){logger[_0x2de4('0xb')](_0x2de4('0x69'),_0xd944dc['id']);switch(_0x101c5e[_0x2de4('0x3d')]){case _0x2de4('0x56'):logger[_0x2de4('0xb')](_0x2de4('0x6a'),_0x2de4('0x57'));return request({'uri':util[_0x2de4('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x101c5e[_0x2de4('0x1c')],_0x51c5d5['id'],_0xd944dc['id']),'method':_0x2de4('0x2b')});case _0x2de4('0x59'):logger['info'](_0x2de4('0x6a'),_0x2de4('0x5a'));emit(util['format'](_0x2de4('0x5b'),_0x258c65[_0x2de4('0x11')]),_0x2de4('0x5c'),{'uri':util['format']('%s/agent/tickets/%s',_0x101c5e[_0x2de4('0x1c')][_0x2de4('0x5e')]('/api/v2',''),_0xd944dc['id'])});break;default:logger[_0x2de4('0x60')](_0x2de4('0x6a'),_0x2de4('0x61'));}}})[_0x2de4('0x62')](function(_0x156748){logger[_0x2de4('0x60')](_0x2de4('0x6b'),util['inspect'](_0x156748,{'showHidden':!![],'depth':null}));});};exports[_0x2de4('0x6c')]=function(_0x13ef3b,_0x50dc27,_0x2ced87,_0x46c3cb,_0x4cb4ea,_0x1958c1){var _0x13db91,_0x33cb88;_0x1958c1['remoteUri']=intUtil['stripTrailingSlash'](_0x1958c1[_0x2de4('0x1c')]);_0x1958c1[_0x2de4('0x4a')]=intUtil[_0x2de4('0x49')](_0x1958c1[_0x2de4('0x4a')]);if(_0x4cb4ea&&_0x4cb4ea[_0x2de4('0x6d')]){logger['info']('['+_0x50dc27[_0x2de4('0x6e')][_0x2de4('0x6f')]()+']',_0x2de4('0x4c'));_0x50dc27['recordingURL']=util[_0x2de4('0xd')](_0x2de4('0x4e'),_0x1958c1['serverUrl'],_0x50dc27[_0x2de4('0x4f')],md5(_0x50dc27[_0x2de4('0x4f')]));}else{_0x50dc27[_0x2de4('0x4d')]='';}headers['Authorization']=getAuth(_0x1958c1);return getUser(_0x1958c1)[_0x2de4('0x16')](function(_0x1cae5b){_0x13db91=_0x1cae5b;logger[_0x2de4('0xb')](_0x2de4('0x52'),_0x13db91['id']);return getEndUser(_0x1958c1,_0x50dc27[_0x2de4('0x53')],_0x50dc27[_0x2de4('0x54')]);})['then'](function(_0x518793){_0x33cb88=_0x518793;logger[_0x2de4('0xb')](_0x2de4('0x55'),_0x33cb88['id']);return getTicket(_0x1958c1,_0x13db91,_0x33cb88,_0x2ced87,_0x50dc27);})['then'](function(_0x5d23b7){if(_0x5d23b7){logger[_0x2de4('0xb')](_0x2de4('0x69'),_0x5d23b7['id']);}})[_0x2de4('0x62')](function(_0x2c7188){logger[_0x2de4('0x60')]('['+_0x50dc27[_0x2de4('0x6e')][_0x2de4('0x6f')]()+']'+_0x2de4('0x70'),util['inspect'](_0x2c7188,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x862e=['trigger:browser:url','%s/agent/tickets/%s','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','zendesk','defaults','socket.io-emitter','redis','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','end-user','Caller\x20-\x20%s','authType','password','username','token','Basic\x20%s','base64','debug','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','toString','idField','custom_fields','push','content','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s'];(function(_0x5cd8a2,_0x24504b){var _0x79d672=function(_0x5d932b){while(--_0x5d932b){_0x5cd8a2['push'](_0x5cd8a2['shift']());}};_0x79d672(++_0x24504b);}(_0x862e,0xf0));var _0xe862=function(_0x2d06bf,_0x114b2d){_0x2d06bf=_0x2d06bf-0x0;var _0x3fa0c7=_0x862e[_0x2d06bf];return _0x3fa0c7;};'use strict';var _=require(_0xe862('0x0'));var rp=require(_0xe862('0x1'));var md5=require(_0xe862('0x2'));var util=require(_0xe862('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xe862('0x4'));config['redis']=_[_0xe862('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xe862('0x6'))(new Redis(config[_0xe862('0x7')]));function emit(_0x10dfab,_0x4fb879,_0x2c64a9){io['to'](_0x10dfab)[_0xe862('0x8')](_0x4fb879,_0x2c64a9);}var headers={'Content-Type':_0xe862('0x9'),'Accept':_0xe862('0x9')};function getTicket(_0x393dc7,_0x4e68c4,_0x1b8d5a,_0x318a45,_0x16a358){logger[_0xe862('0xa')](_0xe862('0xb'));return request({'uri':util[_0xe862('0xc')](_0xe862('0xd'),_0x393dc7[_0xe862('0xe')]),'method':_0xe862('0xf'),'body':{'ticket':_[_0xe862('0x10')]({'requester_id':_0x1b8d5a['id'],'submitter_id':_0x4e68c4?_0x4e68c4['id']:undefined,'assignee_id':_0x4e68c4?_0x4e68c4['id']:undefined,'tags':getTags(_0x318a45[_0xe862('0x11')],_0xe862('0x12')),'subject':intUtil[_0xe862('0x13')](_0x318a45[_0xe862('0x14')],_0x16a358,'\x20'),'description':intUtil[_0xe862('0x13')](_0x318a45['Descriptions'],_0x16a358,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x318a45[_0xe862('0x15')],_0x16a358,'\x0a')}},getCustomFields(_0x318a45[_0xe862('0x16')],_0x16a358))}})[_0xe862('0x17')](function(_0x1bec1b){logger[_0xe862('0xa')](_0xe862('0x18'));return _0x1bec1b[_0xe862('0x19')];});}function getUser(_0x30a064,_0x351e35){if(intUtil[_0xe862('0x1a')](_0x351e35)){logger[_0xe862('0xa')](_0xe862('0x1b'),_0x351e35);return request({'uri':util[_0xe862('0xc')](_0xe862('0x1c'),_0x30a064[_0xe862('0xe')]),'qs':{'query':util['format'](_0xe862('0x1d'),_0x351e35)}})[_0xe862('0x17')](function(_0x69ed92){if(_0x69ed92['count']){logger[_0xe862('0xa')]('Agent\x20found!');return _[_0xe862('0x1e')](_0x69ed92[_0xe862('0x1f')],{'email':_0x351e35,'role':'agent'});}else{logger['info'](_0xe862('0x20'));return request({'uri':util[_0xe862('0xc')]('%s/users/me.json',_0x30a064[_0xe862('0xe')])})[_0xe862('0x17')](function(_0x5b70d2){logger[_0xe862('0xa')](_0xe862('0x21'));return _0x5b70d2[_0xe862('0x22')];});}});}else{logger[_0xe862('0xa')](_0xe862('0x20'));return request({'uri':util[_0xe862('0xc')](_0xe862('0x23'),_0x30a064['remoteUri'])})['then'](function(_0x6a2c58){logger[_0xe862('0xa')](_0xe862('0x21'));return _0x6a2c58[_0xe862('0x22')];});}}function getEndUser(_0x5e0eef,_0x377114,_0x1e82ef){logger[_0xe862('0xa')](_0xe862('0x24'),_0x1e82ef);return request({'uri':util['format'](_0xe862('0x1c'),_0x5e0eef['remoteUri']),'qs':{'query':util[_0xe862('0xc')](_0xe862('0x25'),_0x1e82ef)}})[_0xe862('0x17')](function(_0xf09ecd){var _0x5e89b8;if(_0xf09ecd[_0xe862('0x1f')][_0xe862('0x26')]){_0xf09ecd[_0xe862('0x1f')]=_['filter'](_0xf09ecd['results'],{'suspended':![],'role':'end-user'});if(_0xf09ecd[_0xe862('0x1f')]['length']){_0x5e89b8=_[_0xe862('0x27')](_0xf09ecd[_0xe862('0x1f')]);}}if(_0x5e89b8){logger[_0xe862('0xa')](_0xe862('0x28'));return _0x5e89b8;}else{logger[_0xe862('0xa')](_0xe862('0x29'));return request({'uri':util[_0xe862('0xc')]('%s/users.json',_0x5e0eef['remoteUri']),'method':'POST','body':{'user':{'role':_0xe862('0x2a'),'name':util['format'](_0xe862('0x2b'),_0x377114||_0x1e82ef),'phone':_0x1e82ef}}})[_0xe862('0x17')](function(_0x4f2fcd){logger[_0xe862('0xa')]('Enduser\x20created.');return _0x4f2fcd[_0xe862('0x22')];});}});}function getAuth(_0x3e74b4){var _0x4c06e1;if(_0x3e74b4[_0xe862('0x2c')]===_0xe862('0x2d')){_0x4c06e1=util[_0xe862('0xc')]('%s:%s',_0x3e74b4[_0xe862('0x2e')],_0x3e74b4[_0xe862('0x2d')]);}else if(_0x3e74b4[_0xe862('0x2c')]===_0xe862('0x2f')){_0x4c06e1=util[_0xe862('0xc')]('%s/token:%s',_0x3e74b4['username'],_0x3e74b4['token']);}return util[_0xe862('0xc')](_0xe862('0x30'),new Buffer(_0x4c06e1)['toString'](_0xe862('0x31')));}function request(_0x476fca){logger[_0xe862('0x32')]('[HTTP]',JSON[_0xe862('0x33')](_0x476fca));return rp(_['defaults'](_0x476fca,{'method':_0xe862('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x1eb96b,_0x5f2604){var _0x1654cd=[];if(_0x1eb96b&&_0x1eb96b[_0xe862('0x26')]>0x0){_0x1654cd=_[_0xe862('0x35')](_0x1eb96b,_0x5f2604);}return _0x1654cd;}function getCustomFields(_0x5aaa22,_0x45ea84){var _0x461972=[];var _0x1ad2d0={'custom_fields':[]};if(_0x5aaa22[_0xe862('0x26')]>0x0){_[_0xe862('0x36')](_0x5aaa22,function(_0x2619c0){if(_[_0xe862('0x37')]([_0xe862('0x38'),_0xe862('0x39')],_0x2619c0[_0xe862('0x3a')])&&_0x2619c0[_0xe862('0x3b')]&&!_0x2619c0[_0xe862('0x3c')]){_0x1ad2d0[_0x2619c0[_0xe862('0x3b')][_0xe862('0x3d')]()]=_0x2619c0['content'][_0xe862('0x3e')]();}else if(_[_0xe862('0x37')](['string',_0xe862('0x39')],_0x2619c0[_0xe862('0x3a')])&&_0x2619c0[_0xe862('0x3f')]&&_0x2619c0['customField']){_0x1ad2d0[_0xe862('0x40')][_0xe862('0x41')]({'id':_0x2619c0[_0xe862('0x3f')],'value':_0x2619c0[_0xe862('0x42')][_0xe862('0x3e')]()});}else if(_0x2619c0[_0xe862('0x3a')]===_0xe862('0x43')&&_0x2619c0[_0xe862('0x44')]&&_0x2619c0['idField']&&_0x2619c0[_0xe862('0x3c')]){_0x45ea84[_0x2619c0[_0xe862('0x44')]]&&_0x1ad2d0[_0xe862('0x40')][_0xe862('0x41')]({'id':_0x2619c0[_0xe862('0x3f')],'value':_0x45ea84[_0x2619c0['variableName']]['toString']()});}else if(_0x2619c0['type']===_0xe862('0x45')&&_0x2619c0[_0xe862('0x46')]&&_0x2619c0[_0xe862('0x46')]['name']&&_0x2619c0[_0xe862('0x3f')]&&_0x2619c0[_0xe862('0x3c')]){_0x45ea84[_0x2619c0['Variable'][_0xe862('0x12')][_0xe862('0x3d')]()]&&_0x1ad2d0['custom_fields']['push']({'id':_0x2619c0[_0xe862('0x3f')],'value':_0x45ea84[_0x2619c0[_0xe862('0x46')]['name']['toLowerCase']()][_0xe862('0x3e')]()});}});}return _0x1ad2d0;}exports[_0xe862('0x47')]=function(_0x4b6e59,_0x3dfe93,_0x2a1f1d,_0x1c4526,_0x44437c,_0xf7126e){var _0x3ecb82,_0x2ea125;_0xf7126e[_0xe862('0xe')]=intUtil[_0xe862('0x48')](_0xf7126e['remoteUri']);_0xf7126e[_0xe862('0x49')]=intUtil['stripTrailingSlash'](_0xf7126e[_0xe862('0x49')]);if(_0x44437c&&_0x44437c[_0xe862('0x4a')]){logger[_0xe862('0xa')]('[QUEUE]',_0xe862('0x4b'));_0x3dfe93['recordingURL']=util[_0xe862('0xc')](_0xe862('0x4c'),_0xf7126e['serverUrl'],_0x3dfe93['uniqueid'],md5(_0x3dfe93[_0xe862('0x4d')]));}else{_0x3dfe93[_0xe862('0x4e')]='';}headers[_0xe862('0x4f')]=getAuth(_0xf7126e);return getUser(_0xf7126e,_0x1c4526[_0xe862('0x50')])[_0xe862('0x17')](function(_0x27da87){_0x3ecb82=_0x27da87;logger['info'](_0xe862('0x51'),_0x3ecb82['id']);return getEndUser(_0xf7126e,_0x3dfe93['calleridname'],_0x3dfe93[_0xe862('0x52')]);})[_0xe862('0x17')](function(_0x306239){_0x2ea125=_0x306239;logger[_0xe862('0xa')](_0xe862('0x53'),_0x2ea125['id']);return getTicket(_0xf7126e,_0x3ecb82,_0x2ea125,_0x2a1f1d,_0x3dfe93);})[_0xe862('0x17')](function(_0x3403aa){if(_0x3403aa){logger['info'](_0xe862('0x54'),_0x3403aa['id']);switch(_0xf7126e[_0xe862('0x3a')]){case _0xe862('0x55'):logger[_0xe862('0xa')](_0xe862('0x56'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xe862('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0xf7126e[_0xe862('0xe')],_0x3ecb82['id'],_0x3403aa['id']),'method':'POST'});case _0xe862('0x57'):logger[_0xe862('0xa')](_0xe862('0x56'),_0xe862('0x58'));emit(util[_0xe862('0xc')](_0xe862('0x59'),_0x1c4526[_0xe862('0x12')]),_0xe862('0x5a'),{'uri':util['format'](_0xe862('0x5b'),_0xf7126e[_0xe862('0xe')]['replace'](_0xe862('0x5c'),''),_0x3403aa['id'])});break;default:logger['error'](_0xe862('0x56'),_0xe862('0x5d'));}}})[_0xe862('0x5e')](function(_0x3bcda5){logger[_0xe862('0x5f')](_0xe862('0x60'),util['inspect'](_0x3bcda5,{'showHidden':!![],'depth':null}));});};exports[_0xe862('0x61')]=function(_0x6aefbc,_0x1aaac4,_0x5e25ce,_0x360164,_0x5cddae,_0x3a76ab,_0x26d6b9){var _0x496238,_0x54adf0;_0x3a76ab[_0xe862('0xe')]=intUtil['stripTrailingSlash'](_0x3a76ab[_0xe862('0xe')]);_0x3a76ab[_0xe862('0x49')]=intUtil[_0xe862('0x48')](_0x3a76ab[_0xe862('0x49')]);if(_0x26d6b9&&_0x26d6b9[_0xe862('0x62')]&&_0x26d6b9[_0xe862('0x62')]!=='none'){logger[_0xe862('0xa')](_0xe862('0x63'),_0xe862('0x4b'));_0x1aaac4[_0xe862('0x4e')]=util[_0xe862('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3a76ab[_0xe862('0x49')],_0x1aaac4[_0xe862('0x4d')],md5(_0x1aaac4['uniqueid']));}headers[_0xe862('0x4f')]=getAuth(_0x3a76ab);return getUser(_0x3a76ab,_0x360164[_0xe862('0x50')])[_0xe862('0x17')](function(_0x294fc6){_0x496238=_0x294fc6;logger['info']('The\x20User\x20ID\x20is:',_0x496238['id']);return getEndUser(_0x3a76ab,_0x1aaac4[_0xe862('0x64')],_0x1aaac4[_0xe862('0x65')]);})[_0xe862('0x17')](function(_0x484647){_0x54adf0=_0x484647;logger[_0xe862('0xa')]('The\x20Enduser\x20ID\x20is:',_0x54adf0['id']);return getTicket(_0x3a76ab,_0x496238,_0x54adf0,_0x5e25ce,_0x1aaac4);})[_0xe862('0x17')](function(_0xee06ad){if(_0xee06ad){logger[_0xe862('0xa')](_0xe862('0x54'),_0xee06ad['id']);switch(_0x3a76ab[_0xe862('0x3a')]){case'integrationTab':logger[_0xe862('0xa')](_0xe862('0x63'),_0xe862('0x66'));return request({'uri':util[_0xe862('0xc')](_0xe862('0x67'),_0x3a76ab[_0xe862('0xe')],_0x496238['id'],_0xee06ad['id']),'method':_0xe862('0xf')});case'newTab':logger[_0xe862('0xa')]('[OUTBOUND]',_0xe862('0x58'));emit(util['format'](_0xe862('0x59'),_0x360164[_0xe862('0x12')]),'trigger:browser:url',{'uri':util['format'](_0xe862('0x5b'),_0x3a76ab[_0xe862('0xe')][_0xe862('0x68')](_0xe862('0x5c'),''),_0xee06ad['id'])});break;default:logger['error'](_0xe862('0x63'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xe862('0x5e')](function(_0x4243d8){logger[_0xe862('0x5f')](_0xe862('0x69'),util['inspect'](_0x4243d8,{'showHidden':!![],'depth':null}));});};exports[_0xe862('0x6a')]=function(_0x30d7c4,_0x1f3f26,_0x8a36f1,_0x5d2d3b,_0xce23f,_0x3d88e8){var _0x308418,_0x1f589d;_0x3d88e8[_0xe862('0xe')]=intUtil[_0xe862('0x48')](_0x3d88e8[_0xe862('0xe')]);_0x3d88e8[_0xe862('0x49')]=intUtil[_0xe862('0x48')](_0x3d88e8[_0xe862('0x49')]);if(_0xce23f&&_0xce23f['monitor_format']){logger[_0xe862('0xa')]('['+_0x1f3f26[_0xe862('0x6b')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1f3f26['recordingURL']=util[_0xe862('0xc')](_0xe862('0x4c'),_0x3d88e8[_0xe862('0x49')],_0x1f3f26['uniqueid'],md5(_0x1f3f26[_0xe862('0x4d')]));}else{_0x1f3f26['recordingURL']='';}headers[_0xe862('0x4f')]=getAuth(_0x3d88e8);return getUser(_0x3d88e8)['then'](function(_0x5024c9){_0x308418=_0x5024c9;logger[_0xe862('0xa')](_0xe862('0x51'),_0x308418['id']);return getEndUser(_0x3d88e8,_0x1f3f26['calleridname'],_0x1f3f26[_0xe862('0x52')]);})[_0xe862('0x17')](function(_0x39b291){_0x1f589d=_0x39b291;logger[_0xe862('0xa')](_0xe862('0x53'),_0x1f589d['id']);return getTicket(_0x3d88e8,_0x308418,_0x1f589d,_0x8a36f1,_0x1f3f26);})[_0xe862('0x17')](function(_0x458493){if(_0x458493){logger[_0xe862('0xa')](_0xe862('0x54'),_0x458493['id']);}})[_0xe862('0x5e')](function(_0x56b609){logger[_0xe862('0x5f')]('['+_0x1f3f26['lastevent'][_0xe862('0x6c')]()+']'+_0xe862('0x6d'),util['inspect'](_0x56b609,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zoho.js b/server/services/ami/trigger/integration/zoho.js index 32bdd10..2a905c8 100644 --- a/server/services/ami/trigger/integration/zoho.js +++ b/server/services/ami/trigger/integration/zoho.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x887e=['Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','merge','Fields','err','queue','host','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','zoho.eu','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','[OUTBOUND]','monitor_format','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','../../../../config/environment','zoho','redis','localhost','debug','[HTTP]','stringify','length','includes','type','idField','toString','variableName','Variable','name','toLowerCase','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','code','SUCCESS','details','moduleCreate','catch','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','nothing','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description','Who_Id','Full_Name','First_Name','Last_Name','talktime','Call_Duration','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','abandoned','Abandoned','timeout'];(function(_0x3fad5a,_0x2d3b02){var _0x4ca713=function(_0x2abe58){while(--_0x2abe58){_0x3fad5a['push'](_0x3fad5a['shift']());}};_0x4ca713(++_0x2d3b02);}(_0x887e,0x14d));var _0xe887=function(_0x246275,_0x21f41e){_0x246275=_0x246275-0x0;var _0x1fb1d5=_0x887e[_0x246275];return _0x1fb1d5;};'use strict';var _=require(_0xe887('0x0'));var rp=require(_0xe887('0x1'));var md5=require(_0xe887('0x2'));var util=require(_0xe887('0x3'));var intUtil=require(_0xe887('0x4'));var moment=require(_0xe887('0x5'));var Redis=require(_0xe887('0x6'));var BPromise=require('bluebird');var config=require(_0xe887('0x7'));var logger=require('../../../../config/logger')(_0xe887('0x8'));config['redis']=_['defaults'](config[_0xe887('0x9')],{'host':_0xe887('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0xc48ea1,_0xf8e18d,_0x232dd1){io['to'](_0xc48ea1)['emit'](_0xf8e18d,_0x232dd1);}function request(_0x4beea3){logger[_0xe887('0xb')](_0xe887('0xc'),JSON[_0xe887('0xd')](_0x4beea3));return rp(_0x4beea3);}function getCustomFields(_0x5638c8,_0x1af736){var _0x309639={};if(_0x5638c8[_0xe887('0xe')]>0x0){_['forEach'](_0x5638c8,function(_0x3b16f3){if(_[_0xe887('0xf')](['string','picklist'],_0x3b16f3[_0xe887('0x10')])&&_0x3b16f3[_0xe887('0x11')]){_0x309639[_0x3b16f3[_0xe887('0x11')]]=_0x3b16f3['content'][_0xe887('0x12')]();}else if(_0x3b16f3['type']==='variable'&&_0x3b16f3[_0xe887('0x13')]&&_0x3b16f3[_0xe887('0x11')]&&_0x1af736[_0x3b16f3['variableName']]){_0x309639[_0x3b16f3[_0xe887('0x11')]]=_0x1af736[_0x3b16f3['variableName']][_0xe887('0x12')]();}else if(_0x3b16f3['type']==='customVariable'&&_0x3b16f3[_0xe887('0x14')]&&_0x3b16f3[_0xe887('0x14')][_0xe887('0x15')]&&_0x3b16f3[_0xe887('0x11')]&&_0x1af736[_0x3b16f3[_0xe887('0x14')]['name'][_0xe887('0x16')]()]){_0x309639[_0x3b16f3[_0xe887('0x11')]]=_0x1af736[_0x3b16f3[_0xe887('0x14')][_0xe887('0x15')]['toLowerCase']()][_0xe887('0x12')]();}});}return _0x309639;}function getName(_0x28380d){if(_0x28380d['indexOf']('\x20')>0x0){var _0x4ff710=_0x28380d[_0xe887('0x17')](/ (.+)/);if(_0x4ff710[0x1]){return _0x4ff710;}}return[_0x28380d,_0x28380d];}var accountsTokens={};function getAccessToken(_0x36b892){return new Promise(function(_0x2f6972,_0xfb12d6){if(!_[_0xe887('0x18')](accountsTokens[_0x36b892['id']])&&!_['isNil'](accountsTokens[_0x36b892['id']][_0xe887('0x19')])){if(moment()[_0xe887('0x1a')](accountsTokens[_0x36b892['id']]['expires_in'])){_0x2f6972(accountsTokens[_0x36b892['id']][_0xe887('0x19')]);}}var _0x271258;switch(_0x36b892[_0xe887('0x1b')]){case'US':_0x271258='https://accounts.zoho.com';break;case'AU':_0x271258=_0xe887('0x1c');break;case'EU':_0x271258=_0xe887('0x1d');break;case'IN':_0x271258=_0xe887('0x1e');break;case'CN':_0x271258=_0xe887('0x1f');break;default:_0x271258=_0xe887('0x1d');break;}var _0x2deba8={'method':_0xe887('0x20'),'uri':_0x271258+'/oauth/v2/token','qs':{'refresh_token':_0x36b892[_0xe887('0x21')],'client_id':_0x36b892[_0xe887('0x22')],'client_secret':_0x36b892[_0xe887('0x23')],'grant_type':_0xe887('0x24')},'json':!![]};return rp(_0x2deba8)[_0xe887('0x25')](function(_0x2f4e77){accountsTokens[_0x36b892['id']]={'access_token':_0x2f4e77[_0xe887('0x19')],'expires_in':moment()[_0xe887('0x26')](_0x2f4e77['expires_in'],_0xe887('0x27'))};_0x2f6972(_0x2f4e77[_0xe887('0x19')]);})['catch'](function(_0x447585){logger['error'](_0xe887('0x28'),_0x447585['stack']);_0xfb12d6(_0x447585);});});}function getUser(_0x44ca6a,_0x537b3a,_0x1b660e,_0x152df7){logger[_0xe887('0x29')](_0xe887('0x2a'));return request({'method':_0xe887('0x2b'),'uri':util[_0xe887('0x2c')](_0xe887('0x2d'),_0x537b3a),'qs':{'type':_0xe887('0x2e')},'headers':{'Authorization':_0xe887('0x2f')+_0x44ca6a},'json':!![]})['then'](function(_0x420ae7){if(_0x420ae7[_0xe887('0x30')]){var _0x1afcd0=-0x1;if(_[_0xe887('0x31')](_0x420ae7[_0xe887('0x30')])){if(!_['isNil'](_0x152df7)){_0x1afcd0=_[_0xe887('0x32')](_0x420ae7[_0xe887('0x30')],function(_0x493729){return _0x493729[_0xe887('0x33')]===_0x152df7;});}if(_0x1afcd0>=0x0){logger[_0xe887('0x29')](_0xe887('0x34'));}else{logger[_0xe887('0x29')](_0xe887('0x35'));_0x1afcd0=_[_0xe887('0x32')](_0x420ae7['users'],function(_0x5dbbc9){return _0x5dbbc9[_0xe887('0x36')][_0xe887('0x15')]===_0xe887('0x37');});}return _0x420ae7[_0xe887('0x30')][_0x1afcd0];}else{if(_0x420ae7[_0xe887('0x38')][_0xe887('0x36')][_0xe887('0x15')]==='Administrator'){logger[_0xe887('0x29')](_0xe887('0x35'));user=_0x420ae7[_0xe887('0x38')];return user;}else{logger[_0xe887('0x39')](_0xe887('0x3a'),JSON['stringify'](_0x420ae7));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xe887('0xd')](_0x420ae7));}}}else{logger[_0xe887('0x39')](_0xe887('0x3a'),JSON[_0xe887('0xd')](_0x420ae7));throw new Error(_0xe887('0x3b')+JSON[_0xe887('0xd')](_0x420ae7));}})['catch'](function(_0x268d04){console[_0xe887('0x39')](_0x268d04);});}function getZohoUser(_0x32db33,_0x152648){return new BPromise(function(_0x3f33fc,_0xfd588e){request(_0x32db33)['then'](function(_0x107a9f){var _0x524b7c=null;if(_0x107a9f){_0x524b7c=_0x107a9f[_0xe887('0x3c')][0x0];_0x524b7c[_0xe887('0x3d')]=_0x152648;}_0x3f33fc(_0x524b7c);})['catch'](function(_0x5bd8e4){_0xfd588e(_0x5bd8e4);});});}function createEndUser(_0xa7e094,_0x3d7a37,_0x1c5bd6,_0x3024d3,_0xff76e6,_0x34e753){var _0x1c5bd6=getName(_0x1c5bd6);return request({'method':_0xe887('0x20'),'uri':_0xe887('0x3e')+_0x3d7a37+_0xe887('0x3f')+_[_0xe887('0x40')](_0x34e753['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x1c5bd6[0x1],'First_Name':_0x1c5bd6[0x0],'Phone':_0x3024d3,'Owner':{'name':!_[_0xe887('0x18')](_0xff76e6[_0xe887('0x41')][_0xe887('0x15')])?_0xff76e6['role']['name']:!_[_0xe887('0x18')](_0xff76e6[_0xe887('0x42')])?_0xff76e6[_0xe887('0x42')]+'\x20'+_0xff76e6[_0xe887('0x43')]:_0xff76e6[_0xe887('0x43')],'id':_0xff76e6['id']}}]},'headers':{'Authorization':_0xe887('0x2f')+_0xa7e094},'json':!![]})[_0xe887('0x25')](function(_0x52a8c2){if(_0x52a8c2&&_0x52a8c2[_0xe887('0x3c')][0x0][_0xe887('0x44')]===_0xe887('0x45')){var _0x402db6=_0x52a8c2[_0xe887('0x3c')][0x0][_0xe887('0x46')];_0x402db6[_0xe887('0x3d')]=_[_0xe887('0x40')](_0x34e753[_0xe887('0x47')])+'s';return _0x402db6;}logger[_0xe887('0x39')]('The\x20failing\x20result\x20is',JSON[_0xe887('0xd')](data));throw new Error('Error:\x20'+JSON[_0xe887('0xd')](data));})[_0xe887('0x48')](function(_0x40263f){console[_0xe887('0x49')](_0xe887('0x4a'),_0x40263f);});}function getEndUser(_0x4bd8a5,_0x10d43c,_0x5eaae1,_0x39bcda,_0x229c61,_0x514bc6,_0x2f2248){var _0x45e066={'method':_0xe887('0x2b'),'uri':'','headers':{'Authorization':_0xe887('0x2f')+_0x4bd8a5},'json':!![]};switch(_0x2f2248[_0xe887('0x4b')]){case _0xe887('0x4c'):_0x45e066[_0xe887('0x4d')]=_0xe887('0x3e')+_0x10d43c+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x229c61+'))';return getZohoUser(_0x45e066,_0xe887('0x4e'))[_0xe887('0x25')](function(_0xf0c438){if(_0xf0c438)return _0xf0c438;_0x45e066[_0xe887('0x4d')]='https://www.zohoapis.'+_0x10d43c+_0xe887('0x4f')+_0x229c61+'))';return getZohoUser(_0x45e066,_0xe887('0x50'))['then'](function(_0x2e3dd4){if(_0x2e3dd4)return _0x2e3dd4;if(_0x2f2248['moduleCreate']!='nothing'){return createEndUser(_0x4bd8a5,_0x10d43c,_0x39bcda,_0x229c61,_0x514bc6,_0x2f2248);}else{return{};}});});break;case _0xe887('0x51'):_0x45e066[_0xe887('0x4d')]=_0xe887('0x3e')+_0x10d43c+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x229c61+'))';return getZohoUser(_0x45e066,_0xe887('0x4e'))[_0xe887('0x25')](function(_0x3c2807){if(_0x3c2807)return _0x3c2807;if(_0x2f2248[_0xe887('0x47')]!=_0xe887('0x52')){return createEndUser(_0x4bd8a5,_0x10d43c,_0x39bcda,_0x229c61,_0x514bc6,_0x2f2248);}else{return{};}});break;case'lead':_0x45e066[_0xe887('0x4d')]=_0xe887('0x3e')+_0x10d43c+_0xe887('0x4f')+_0x229c61+'))';return getZohoUser(_0x45e066,_0xe887('0x50'))[_0xe887('0x25')](function(_0x2e9fab){if(_0x2e9fab)return _0x2e9fab;if(_0x2f2248[_0xe887('0x47')]!='nothing'){return createEndUser(_0x4bd8a5,_0x10d43c,_0x39bcda,_0x229c61,_0x514bc6,_0x2f2248);}else{return{};}});break;}}function getCall(_0x424d2d,_0x1003ea,_0x1a479f,_0x4ce473,_0x98ad7d,_0xc15c25,_0x28dabc,_0x28bc7b){logger['info'](_0xe887('0x53'));var _0x2e657b={};_0x2e657b[_0xe887('0x54')]={'name':!_[_0xe887('0x18')](_0x4ce473[_0xe887('0x41')][_0xe887('0x15')])&&!_[_0xe887('0x18')](_0x4ce473[_0xe887('0x36')]['name'])&&_0x4ce473[_0xe887('0x36')][_0xe887('0x15')]===_0xe887('0x55')?_0x4ce473[_0xe887('0x41')][_0xe887('0x15')]:!_[_0xe887('0x18')](_0x4ce473[_0xe887('0x42')])?_0x4ce473[_0xe887('0x42')]+'\x20'+_0x4ce473['last_name']:_0x4ce473[_0xe887('0x43')],'id':_0x4ce473['id']};_0x2e657b[_0xe887('0x56')]=intUtil[_0xe887('0x57')](_0xc15c25['Subjects'],_0x28dabc,'\x20');_0x2e657b[_0xe887('0x58')]=intUtil[_0xe887('0x57')](_0xc15c25['Descriptions'],_0x28dabc,'\x0a');if(_0x98ad7d[_0xe887('0x3d')]===_0xe887('0x4e')){_0x2e657b[_0xe887('0x59')]={'name':!_[_0xe887('0x18')](_0x98ad7d[_0xe887('0x5a')])?_0x98ad7d['Full_Name']:!_[_0xe887('0x18')](_0x98ad7d['First_Name'])?_0x98ad7d[_0xe887('0x5b')]+'\x20'+_0x98ad7d[_0xe887('0x5c')]:_0x98ad7d[_0xe887('0x5c')],'id':_0x98ad7d['id']};}if(_0x98ad7d[_0xe887('0x3d')]==='Leads'){_0x2e657b['What_Id']={'name':!_[_0xe887('0x18')](_0x98ad7d[_0xe887('0x5a')])?_0x98ad7d[_0xe887('0x5a')]:!_[_0xe887('0x18')](_0x98ad7d['First_Name'])?_0x98ad7d[_0xe887('0x5b')]+'\x20'+_0x98ad7d[_0xe887('0x5c')]:_0x98ad7d[_0xe887('0x5c')],'id':_0x98ad7d['id']};_0x2e657b['$se_module']=_[_0xe887('0x40')](_0x98ad7d[_0xe887('0x3d')]);}if(_0x28dabc[_0xe887('0x5d')]){_0x2e657b[_0xe887('0x5e')]=moment['utc'](parseInt(_0x28dabc[_0xe887('0x5d')])*0x3e8)[_0xe887('0x2c')]('mm:ss');}else if(_0x28dabc['answertime']&&_0x28dabc[_0xe887('0x5f')]){_0x2e657b['Call_Duration']=moment[_0xe887('0x60')](moment(_0x28dabc['endtime'],_0xe887('0x61'))[_0xe887('0x62')](moment(_0x28dabc[_0xe887('0x63')],'YYYY-MM-DDTHH:mm:ss')))[_0xe887('0x2c')](_0xe887('0x64'));}switch(_0x28dabc[_0xe887('0x65')]){case _0xe887('0x66'):_0x2e657b[_0xe887('0x67')]=_0xe887('0x68');break;case _0xe887('0x69'):case _0xe887('0x6a'):_0x2e657b[_0xe887('0x67')]=_0xe887('0x6b');break;case'rejected':_0x2e657b[_0xe887('0x67')]='Rejected';break;case _0xe887('0x6c'):_0x2e657b[_0xe887('0x67')]=_0xe887('0x6d');break;case _0xe887('0x6e'):_0x2e657b[_0xe887('0x67')]=_0xe887('0x6f');default:}_0x2e657b[_0xe887('0x70')]=(_0x28bc7b===_0xe887('0x71')?moment(_0x28dabc[_0xe887('0x63')])[_0xe887('0x2c')](_0xe887('0x61')):moment(_0x28dabc[_0xe887('0x72')])[_0xe887('0x2c')](_0xe887('0x61')))||moment()['format'](_0xe887('0x61'));_0x2e657b[_0xe887('0x73')]=_0x28bc7b||'Inbound';_0x2e657b=_[_0xe887('0x74')](_0x2e657b,getCustomFields(_0xc15c25[_0xe887('0x75')],_0x28dabc));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x1003ea+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x424d2d},'body':{'data':[_0x2e657b]},'json':!![]})['then'](function(_0x4875e7){if(_0x4875e7&&_0x4875e7[_0xe887('0x3c')][0x0][_0xe887('0x44')]===_0xe887('0x45')){logger[_0xe887('0x29')]('Call\x20created!');return{'id':_0x4875e7[_0xe887('0x3c')][0x0][_0xe887('0x46')]['id']};}})[_0xe887('0x48')](function(_0x25e47a){logger[_0xe887('0x29')](_0xe887('0x76'),_0x25e47a['stack']);console[_0xe887('0x49')](_0xe887('0x76'),_0x25e47a);});}exports[_0xe887('0x77')]=function(_0x337f00,_0x4ed9c4,_0x4d79b9,_0x579fd5,_0x555415,_0xff495e){var _0x7b8534,_0x331a53,_0x50741d;_0xff495e[_0xe887('0x78')]=intUtil['stripTrailingSlash'](_0xff495e[_0xe887('0x78')]);_0xff495e['serverUrl']=intUtil[_0xe887('0x79')](_0xff495e['serverUrl']);if(_0x555415&&_0x555415['monitor_format']){logger['info'](_0xe887('0x7a'),_0xe887('0x7b'));_0x4ed9c4[_0xe887('0x7c')]=_0xff495e[_0xe887('0x7d')]+_0xe887('0x7e')+_0x4ed9c4['uniqueid']+_0xe887('0x7f')+md5(_0x4ed9c4[_0xe887('0x80')]);}else{_0x4ed9c4[_0xe887('0x7c')]='';}var _0x1e703e=_0xff495e['host']==='zoho.eu'?'eu':_0xe887('0x81');return getAccessToken(_0xff495e)[_0xe887('0x25')](function(_0x4336e5){_0x50741d=_0x4336e5;return getUser(_0x50741d,_0x1e703e,_0xff495e,_0x579fd5[_0xe887('0x33')]);})[_0xe887('0x25')](function(_0x5255ac){_0x7b8534=_0x5255ac;logger['info'](_0xe887('0x82'),_0x7b8534['id']);return getEndUser(_0x50741d,_0x1e703e,_0xff495e,_0x4ed9c4[_0xe887('0x83')],_0x4ed9c4[_0xe887('0x84')],_0x7b8534,_0x4d79b9);})[_0xe887('0x25')](function(_0x23898a){_0x331a53=_0x23898a;return getCall(_0x50741d,_0x1e703e,_0xff495e,_0x7b8534,_0x331a53,_0x4d79b9,_0x4ed9c4,_0xe887('0x85'));})[_0xe887('0x25')](function(_0x344a25){if(_0x344a25){logger['info']('The\x20Call\x20ID\x20is:',_0x344a25['id']);logger[_0xe887('0x29')](_0xe887('0x7a'),_0xe887('0x86'));emit(util[_0xe887('0x2c')](_0xe887('0x87'),_0x579fd5[_0xe887('0x15')]),_0xe887('0x88'),{'uri':'https://crm.'+_0xff495e[_0xe887('0x78')]+_0xe887('0x89')+_0x344a25['id']});}})[_0xe887('0x48')](function(_0x3f7018){logger[_0xe887('0x39')](_0xe887('0x7a'),JSON[_0xe887('0xd')](_0x3f7018));});};exports[_0xe887('0x71')]=function(_0x391816,_0x5e790e,_0x482b10,_0x568be5,_0x48afb7,_0x430251,_0x280b31){var _0x4a8db9,_0x5383b4,_0x36b823;_0x430251[_0xe887('0x78')]=intUtil[_0xe887('0x79')](_0x430251[_0xe887('0x78')]);_0x430251[_0xe887('0x7d')]=intUtil[_0xe887('0x79')](_0x430251[_0xe887('0x7d')]);if(_0x280b31&&_0x280b31[_0xe887('0x8a')]&&_0x280b31[_0xe887('0x8a')]!==_0xe887('0x8b')){logger['info']('[OUTBOUND]',_0xe887('0x7b'));_0x5e790e['recordingURL']=_0x430251[_0xe887('0x7d')]+'/api/voice/recordings/'+_0x5e790e[_0xe887('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x5e790e[_0xe887('0x80')]);}var _0x1a2d3b=_0x430251[_0xe887('0x78')]===_0xe887('0x8c')?'eu':'com';return getAccessToken(_0x430251)[_0xe887('0x25')](function(_0x5f30dc){_0x36b823=_0x5f30dc;return getUser(_0x36b823,_0x1a2d3b,_0x430251,_0x568be5[_0xe887('0x33')]);})[_0xe887('0x25')](function(_0x3b56e5){_0x4a8db9=_0x3b56e5;logger[_0xe887('0x29')](_0xe887('0x82'),_0x4a8db9['id']);return getEndUser(_0x36b823,_0x1a2d3b,_0x430251,_0x5e790e[_0xe887('0x8d')],_0x5e790e[_0xe887('0x8e')],_0x4a8db9,_0x482b10);})[_0xe887('0x25')](function(_0x2a34e3){_0x5383b4=_0x2a34e3;return getCall(_0x36b823,_0x1a2d3b,_0x430251,_0x4a8db9,_0x5383b4,_0x482b10,_0x5e790e,_0xe887('0x8f'));})[_0xe887('0x25')](function(_0x2bf593){if(_0x2bf593){logger[_0xe887('0x29')](_0xe887('0x90'),_0x2bf593['id']);logger[_0xe887('0x29')]('[OUTBOUND]',_0xe887('0x86'));emit(util[_0xe887('0x2c')](_0xe887('0x87'),_0x568be5[_0xe887('0x15')]),_0xe887('0x88'),{'uri':'https://crm.'+_0x430251['host']+_0xe887('0x89')+_0x2bf593['id']});}})[_0xe887('0x48')](function(_0x4b4939){logger[_0xe887('0x39')](_0xe887('0x91'),JSON[_0xe887('0xd')](_0x4b4939));});};exports['unmanaged']=function(_0x289e49,_0x2123fd,_0x46aa41,_0x2ffb12,_0x596742,_0x9a837c){var _0x3fe8d9,_0x3dc4eb,_0x4ae6ac;_0x9a837c[_0xe887('0x78')]=intUtil['stripTrailingSlash'](_0x9a837c[_0xe887('0x78')]);_0x9a837c[_0xe887('0x7d')]=intUtil[_0xe887('0x79')](_0x9a837c[_0xe887('0x7d')]);if(_0x596742&&_0x596742[_0xe887('0x92')]){logger[_0xe887('0x29')]('['+_0x2123fd[_0xe887('0x65')][_0xe887('0x93')]()+']',_0xe887('0x7b'));_0x2123fd[_0xe887('0x7c')]=_0x9a837c['serverUrl']+_0xe887('0x7e')+_0x2123fd[_0xe887('0x80')]+_0xe887('0x7f')+md5(_0x2123fd[_0xe887('0x80')]);}else{_0x2123fd[_0xe887('0x7c')]='';}var _0x454468=_0x9a837c[_0xe887('0x78')]==='zoho.eu'?'eu':_0xe887('0x81');return getAccessToken(_0x9a837c)[_0xe887('0x25')](function(_0x2f9c0c){_0x4ae6ac=_0x2f9c0c;return getUser(_0x4ae6ac,_0x454468,_0x9a837c);})[_0xe887('0x25')](function(_0x2da575){_0x3fe8d9=_0x2da575;logger[_0xe887('0x29')](_0xe887('0x82'),_0x3fe8d9['id']);return getEndUser(_0x4ae6ac,_0x454468,_0x9a837c,_0x2123fd[_0xe887('0x83')],_0x2123fd[_0xe887('0x84')],_0x3fe8d9,_0x46aa41);})[_0xe887('0x25')](function(_0x5823c8){_0x3dc4eb=_0x5823c8;return getCall(_0x4ae6ac,_0x454468,_0x9a837c,_0x3fe8d9,_0x3dc4eb,_0x46aa41,_0x2123fd,_0xe887('0x85'));})[_0xe887('0x25')](function(_0xf2fde5){if(_0xf2fde5){logger[_0xe887('0x29')](_0xe887('0x90'),_0xf2fde5['id']);}})[_0xe887('0x48')](function(_0x11bfb7){logger[_0xe887('0x39')]('['+_0x2123fd['lastevent']['toUpperCase']()+']',JSON[_0xe887('0xd')](_0x11bfb7));});}; \ No newline at end of file +var _0xb0d9=['isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','seconds','catch','error','stack','info','GET','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','enduserType','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','Subjects','Description','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','format','mm:ss','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','called','Call_Result','Called','complete','connect','Rejected','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','Fields','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','calleridname','calleridnum','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingURL','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','[OUTBOUND]','https://crm.','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','moment','bluebird','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','length','forEach','includes','picklist','type','idField','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','split','isNil','access_token'];(function(_0x56fb3c,_0x3474f2){var _0x2261f8=function(_0x382b0e){while(--_0x382b0e){_0x56fb3c['push'](_0x56fb3c['shift']());}};_0x2261f8(++_0x3474f2);}(_0xb0d9,0x10c));var _0x9b0d=function(_0x13771f,_0x27ef09){_0x13771f=_0x13771f-0x0;var _0x48ca25=_0xb0d9[_0x13771f];return _0x48ca25;};'use strict';var _=require(_0x9b0d('0x0'));var rp=require(_0x9b0d('0x1'));var md5=require(_0x9b0d('0x2'));var util=require(_0x9b0d('0x3'));var intUtil=require(_0x9b0d('0x4'));var moment=require(_0x9b0d('0x5'));var Redis=require('ioredis');var BPromise=require(_0x9b0d('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('zoho');config[_0x9b0d('0x7')]=_[_0x9b0d('0x8')](config[_0x9b0d('0x7')],{'host':_0x9b0d('0x9'),'port':0x18eb});var io=require(_0x9b0d('0xa'))(new Redis(config[_0x9b0d('0x7')]));function emit(_0x32ee67,_0x30cd11,_0x3152da){io['to'](_0x32ee67)['emit'](_0x30cd11,_0x3152da);}function request(_0x479a06){logger[_0x9b0d('0xb')](_0x9b0d('0xc'),JSON['stringify'](_0x479a06));return rp(_0x479a06);}function getCustomFields(_0x382196,_0x118863){var _0x506ef2={};if(_0x382196[_0x9b0d('0xd')]>0x0){_[_0x9b0d('0xe')](_0x382196,function(_0x59cd9f){if(_[_0x9b0d('0xf')](['string',_0x9b0d('0x10')],_0x59cd9f[_0x9b0d('0x11')])&&_0x59cd9f[_0x9b0d('0x12')]){_0x506ef2[_0x59cd9f['idField']]=_0x59cd9f[_0x9b0d('0x13')]['toString']();}else if(_0x59cd9f[_0x9b0d('0x11')]===_0x9b0d('0x14')&&_0x59cd9f['variableName']&&_0x59cd9f[_0x9b0d('0x12')]&&_0x118863[_0x59cd9f['variableName']]){_0x506ef2[_0x59cd9f[_0x9b0d('0x12')]]=_0x118863[_0x59cd9f[_0x9b0d('0x15')]][_0x9b0d('0x16')]();}else if(_0x59cd9f['type']===_0x9b0d('0x17')&&_0x59cd9f[_0x9b0d('0x18')]&&_0x59cd9f['Variable']['name']&&_0x59cd9f['idField']&&_0x118863[_0x59cd9f[_0x9b0d('0x18')][_0x9b0d('0x19')][_0x9b0d('0x1a')]()]){_0x506ef2[_0x59cd9f[_0x9b0d('0x12')]]=_0x118863[_0x59cd9f['Variable'][_0x9b0d('0x19')][_0x9b0d('0x1a')]()][_0x9b0d('0x16')]();}});}return _0x506ef2;}function getName(_0x3eb14a){if(_0x3eb14a['indexOf']('\x20')>0x0){var _0x331c03=_0x3eb14a[_0x9b0d('0x1b')](/ (.+)/);if(_0x331c03[0x1]){return _0x331c03;}}return[_0x3eb14a,_0x3eb14a];}var accountsTokens={};function getAccessToken(_0xe5fb08){return new Promise(function(_0x996b49,_0xec4791){if(!_['isNil'](accountsTokens[_0xe5fb08['id']])&&!_[_0x9b0d('0x1c')](accountsTokens[_0xe5fb08['id']][_0x9b0d('0x1d')])){if(moment()[_0x9b0d('0x1e')](accountsTokens[_0xe5fb08['id']][_0x9b0d('0x1f')])){_0x996b49(accountsTokens[_0xe5fb08['id']][_0x9b0d('0x1d')]);}}var _0x284554;switch(_0xe5fb08[_0x9b0d('0x20')]){case'US':_0x284554=_0x9b0d('0x21');break;case'AU':_0x284554=_0x9b0d('0x22');break;case'EU':_0x284554=_0x9b0d('0x23');break;case'IN':_0x284554=_0x9b0d('0x24');break;case'CN':_0x284554='https://accounts.zoho.com.cn';break;default:_0x284554=_0x9b0d('0x23');break;}var _0x4f774c={'method':_0x9b0d('0x25'),'uri':_0x284554+_0x9b0d('0x26'),'qs':{'refresh_token':_0xe5fb08[_0x9b0d('0x27')],'client_id':_0xe5fb08[_0x9b0d('0x28')],'client_secret':_0xe5fb08[_0x9b0d('0x29')],'grant_type':_0x9b0d('0x2a')},'json':!![]};return rp(_0x4f774c)[_0x9b0d('0x2b')](function(_0x1cac5a){accountsTokens[_0xe5fb08['id']]={'access_token':_0x1cac5a[_0x9b0d('0x1d')],'expires_in':moment()['add'](_0x1cac5a[_0x9b0d('0x1f')],_0x9b0d('0x2c'))};_0x996b49(_0x1cac5a[_0x9b0d('0x1d')]);})[_0x9b0d('0x2d')](function(_0x2caed3){logger[_0x9b0d('0x2e')]('Failing\x20creating\x20the\x20access_token',_0x2caed3[_0x9b0d('0x2f')]);_0xec4791(_0x2caed3);});});}function getUser(_0xee0911,_0x434a20,_0x268e8f,_0x51b545){logger[_0x9b0d('0x30')]('Search\x20user');return request({'method':_0x9b0d('0x31'),'uri':util['format'](_0x9b0d('0x32'),_0x434a20),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x9b0d('0x33')+_0xee0911},'json':!![]})[_0x9b0d('0x2b')](function(_0x5d9b7c){if(_0x5d9b7c[_0x9b0d('0x34')]){var _0x5366fd=-0x1;if(_['isArrayLikeObject'](_0x5d9b7c[_0x9b0d('0x34')])){if(!_[_0x9b0d('0x1c')](_0x51b545)){_0x5366fd=_[_0x9b0d('0x35')](_0x5d9b7c[_0x9b0d('0x34')],function(_0x1a0d61){return _0x1a0d61['email']===_0x51b545;});}if(_0x5366fd>=0x0){logger[_0x9b0d('0x30')](_0x9b0d('0x36'));}else{logger[_0x9b0d('0x30')](_0x9b0d('0x37'));_0x5366fd=_[_0x9b0d('0x35')](_0x5d9b7c[_0x9b0d('0x34')],function(_0x7e6192){return _0x7e6192[_0x9b0d('0x38')][_0x9b0d('0x19')]===_0x9b0d('0x39');});}return _0x5d9b7c['users'][_0x5366fd];}else{if(_0x5d9b7c[_0x9b0d('0x3a')][_0x9b0d('0x38')][_0x9b0d('0x19')]==='Administrator'){logger['info'](_0x9b0d('0x37'));user=_0x5d9b7c['user'];return user;}else{logger['error'](_0x9b0d('0x3b'),JSON[_0x9b0d('0x3c')](_0x5d9b7c));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x9b0d('0x3c')](_0x5d9b7c));}}}else{logger[_0x9b0d('0x2e')]('The\x20failing\x20result\x20is',JSON[_0x9b0d('0x3c')](_0x5d9b7c));throw new Error(_0x9b0d('0x3d')+JSON[_0x9b0d('0x3c')](_0x5d9b7c));}})[_0x9b0d('0x2d')](function(_0x2907d2){console[_0x9b0d('0x2e')](_0x2907d2);});}function getZohoUser(_0x2cee01,_0x48d9ad){return new BPromise(function(_0x556d91,_0x9328f3){request(_0x2cee01)[_0x9b0d('0x2b')](function(_0x16ff21){var _0x107e1a=null;if(_0x16ff21){_0x107e1a=_0x16ff21[_0x9b0d('0x3e')][0x0];_0x107e1a['enduserType']=_0x48d9ad;}_0x556d91(_0x107e1a);})[_0x9b0d('0x2d')](function(_0x246b17){_0x9328f3(_0x246b17);});});}function createEndUser(_0x3f5c1b,_0x30dda8,_0x5ad88c,_0x351bfa,_0x546b40,_0x4c3290){var _0x5ad88c=getName(_0x5ad88c);return request({'method':_0x9b0d('0x25'),'uri':_0x9b0d('0x3f')+_0x30dda8+_0x9b0d('0x40')+_[_0x9b0d('0x41')](_0x4c3290[_0x9b0d('0x42')])+'s','body':{'data':[{'Last_Name':_0x5ad88c[0x1],'First_Name':_0x5ad88c[0x0],'Phone':_0x351bfa,'Owner':{'name':!_[_0x9b0d('0x1c')](_0x546b40['role'][_0x9b0d('0x19')])?_0x546b40[_0x9b0d('0x43')][_0x9b0d('0x19')]:!_[_0x9b0d('0x1c')](_0x546b40[_0x9b0d('0x44')])?_0x546b40[_0x9b0d('0x44')]+'\x20'+_0x546b40[_0x9b0d('0x45')]:_0x546b40[_0x9b0d('0x45')],'id':_0x546b40['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3f5c1b},'json':!![]})['then'](function(_0x2ae030){if(_0x2ae030&&_0x2ae030[_0x9b0d('0x3e')][0x0][_0x9b0d('0x46')]===_0x9b0d('0x47')){var _0x129185=_0x2ae030['data'][0x0][_0x9b0d('0x48')];_0x129185[_0x9b0d('0x49')]=_[_0x9b0d('0x41')](_0x4c3290['moduleCreate'])+'s';return _0x129185;}logger[_0x9b0d('0x2e')]('The\x20failing\x20result\x20is',JSON[_0x9b0d('0x3c')](data));throw new Error(_0x9b0d('0x4a')+JSON[_0x9b0d('0x3c')](data));})[_0x9b0d('0x2d')](function(_0x1c8636){console[_0x9b0d('0x4b')](_0x9b0d('0x4c'),_0x1c8636);});}function getEndUser(_0x39493a,_0x5cd1df,_0x41ea27,_0x14941d,_0x3cecde,_0x35a09d,_0x2be474){var _0x243021={'method':_0x9b0d('0x31'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x39493a},'json':!![]};switch(_0x2be474[_0x9b0d('0x4d')]){case _0x9b0d('0x4e'):_0x243021['uri']=_0x9b0d('0x3f')+_0x5cd1df+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3cecde+'))';return getZohoUser(_0x243021,'Contacts')[_0x9b0d('0x2b')](function(_0x268194){if(_0x268194)return _0x268194;_0x243021[_0x9b0d('0x4f')]=_0x9b0d('0x3f')+_0x5cd1df+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x3cecde+'))';return getZohoUser(_0x243021,'Leads')[_0x9b0d('0x2b')](function(_0x190a5c){if(_0x190a5c)return _0x190a5c;if(_0x2be474[_0x9b0d('0x42')]!=_0x9b0d('0x50')){return createEndUser(_0x39493a,_0x5cd1df,_0x14941d,_0x3cecde,_0x35a09d,_0x2be474);}else{return{};}});});break;case _0x9b0d('0x51'):_0x243021[_0x9b0d('0x4f')]=_0x9b0d('0x3f')+_0x5cd1df+_0x9b0d('0x52')+_0x3cecde+'))';return getZohoUser(_0x243021,_0x9b0d('0x53'))[_0x9b0d('0x2b')](function(_0x5b5cd6){if(_0x5b5cd6)return _0x5b5cd6;if(_0x2be474[_0x9b0d('0x42')]!='nothing'){return createEndUser(_0x39493a,_0x5cd1df,_0x14941d,_0x3cecde,_0x35a09d,_0x2be474);}else{return{};}});break;case'lead':_0x243021[_0x9b0d('0x4f')]=_0x9b0d('0x3f')+_0x5cd1df+_0x9b0d('0x54')+_0x3cecde+'))';return getZohoUser(_0x243021,_0x9b0d('0x55'))[_0x9b0d('0x2b')](function(_0x19acca){if(_0x19acca)return _0x19acca;if(_0x2be474[_0x9b0d('0x42')]!='nothing'){return createEndUser(_0x39493a,_0x5cd1df,_0x14941d,_0x3cecde,_0x35a09d,_0x2be474);}else{return{};}});break;}}function getCall(_0x20c792,_0x5a61d3,_0x293967,_0x51de08,_0x57361d,_0x399596,_0x5352fe,_0x192445){logger[_0x9b0d('0x30')](_0x9b0d('0x56'));var _0x5338c3={};_0x5338c3[_0x9b0d('0x57')]={'name':!_[_0x9b0d('0x1c')](_0x51de08[_0x9b0d('0x43')]['name'])&&!_[_0x9b0d('0x1c')](_0x51de08[_0x9b0d('0x38')][_0x9b0d('0x19')])&&_0x51de08[_0x9b0d('0x38')][_0x9b0d('0x19')]===_0x9b0d('0x58')?_0x51de08[_0x9b0d('0x43')]['name']:!_[_0x9b0d('0x1c')](_0x51de08[_0x9b0d('0x44')])?_0x51de08[_0x9b0d('0x44')]+'\x20'+_0x51de08[_0x9b0d('0x45')]:_0x51de08[_0x9b0d('0x45')],'id':_0x51de08['id']};_0x5338c3[_0x9b0d('0x59')]=intUtil['getString'](_0x399596[_0x9b0d('0x5a')],_0x5352fe,'\x20');_0x5338c3[_0x9b0d('0x5b')]=intUtil['getString'](_0x399596['Descriptions'],_0x5352fe,'\x0a');if(_0x57361d['enduserType']===_0x9b0d('0x53')){_0x5338c3['Who_Id']={'name':!_[_0x9b0d('0x1c')](_0x57361d[_0x9b0d('0x5c')])?_0x57361d[_0x9b0d('0x5c')]:!_[_0x9b0d('0x1c')](_0x57361d[_0x9b0d('0x5d')])?_0x57361d[_0x9b0d('0x5d')]+'\x20'+_0x57361d[_0x9b0d('0x5e')]:_0x57361d[_0x9b0d('0x5e')],'id':_0x57361d['id']};}if(_0x57361d[_0x9b0d('0x49')]===_0x9b0d('0x55')){_0x5338c3[_0x9b0d('0x5f')]={'name':!_[_0x9b0d('0x1c')](_0x57361d[_0x9b0d('0x5c')])?_0x57361d[_0x9b0d('0x5c')]:!_[_0x9b0d('0x1c')](_0x57361d[_0x9b0d('0x5d')])?_0x57361d[_0x9b0d('0x5d')]+'\x20'+_0x57361d[_0x9b0d('0x5e')]:_0x57361d[_0x9b0d('0x5e')],'id':_0x57361d['id']};_0x5338c3[_0x9b0d('0x60')]=_['startCase'](_0x57361d['enduserType']);}if(_0x5352fe[_0x9b0d('0x61')]){_0x5338c3[_0x9b0d('0x62')]=moment[_0x9b0d('0x63')](parseInt(_0x5352fe[_0x9b0d('0x61')])*0x3e8)[_0x9b0d('0x64')](_0x9b0d('0x65'));}else if(_0x5352fe[_0x9b0d('0x66')]&&_0x5352fe[_0x9b0d('0x67')]){_0x5338c3[_0x9b0d('0x62')]=moment[_0x9b0d('0x63')](moment(_0x5352fe[_0x9b0d('0x67')],'YYYY-MM-DDTHH:mm:ss')[_0x9b0d('0x68')](moment(_0x5352fe[_0x9b0d('0x69')],_0x9b0d('0x6a'))))[_0x9b0d('0x64')](_0x9b0d('0x65'));}switch(_0x5352fe['lastevent']){case _0x9b0d('0x6b'):_0x5338c3[_0x9b0d('0x6c')]=_0x9b0d('0x6d');break;case _0x9b0d('0x6e'):case _0x9b0d('0x6f'):_0x5338c3[_0x9b0d('0x6c')]='Answered';break;case'rejected':_0x5338c3[_0x9b0d('0x6c')]=_0x9b0d('0x70');break;case'abandoned':_0x5338c3[_0x9b0d('0x6c')]='Abandoned';break;case _0x9b0d('0x71'):_0x5338c3[_0x9b0d('0x6c')]=_0x9b0d('0x72');default:}_0x5338c3[_0x9b0d('0x73')]=(_0x192445===_0x9b0d('0x74')?moment(_0x5352fe['starttime'])[_0x9b0d('0x64')](_0x9b0d('0x6a')):moment(_0x5352fe[_0x9b0d('0x75')])[_0x9b0d('0x64')](_0x9b0d('0x6a')))||moment()[_0x9b0d('0x64')](_0x9b0d('0x6a'));_0x5338c3['Call_Type']=_0x192445||_0x9b0d('0x76');_0x5338c3=_[_0x9b0d('0x77')](_0x5338c3,getCustomFields(_0x399596[_0x9b0d('0x78')],_0x5352fe));return request({'method':_0x9b0d('0x25'),'uri':_0x9b0d('0x3f')+_0x5a61d3+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x20c792},'body':{'data':[_0x5338c3]},'json':!![]})[_0x9b0d('0x2b')](function(_0x5c82f2){if(_0x5c82f2&&_0x5c82f2[_0x9b0d('0x3e')][0x0]['code']==='SUCCESS'){logger[_0x9b0d('0x30')](_0x9b0d('0x79'));return{'id':_0x5c82f2[_0x9b0d('0x3e')][0x0][_0x9b0d('0x48')]['id']};}})['catch'](function(_0x1523d4){logger[_0x9b0d('0x30')](_0x9b0d('0x7a'),_0x1523d4[_0x9b0d('0x2f')]);console[_0x9b0d('0x4b')]('err',_0x1523d4);});}exports[_0x9b0d('0x7b')]=function(_0x3ae622,_0x90fe82,_0x43c5db,_0x3004ca,_0x3fdf30,_0x43854e){var _0x41c5f6,_0x35d6e6,_0x4fa65f;_0x43854e[_0x9b0d('0x7c')]=intUtil[_0x9b0d('0x7d')](_0x43854e[_0x9b0d('0x7c')]);_0x43854e[_0x9b0d('0x7e')]=intUtil[_0x9b0d('0x7d')](_0x43854e[_0x9b0d('0x7e')]);if(_0x3fdf30&&_0x3fdf30[_0x9b0d('0x7f')]){logger['info'](_0x9b0d('0x80'),_0x9b0d('0x81'));_0x90fe82['recordingURL']=_0x43854e['serverUrl']+_0x9b0d('0x82')+_0x90fe82[_0x9b0d('0x83')]+_0x9b0d('0x84')+md5(_0x90fe82[_0x9b0d('0x83')]);}else{_0x90fe82['recordingURL']='';}var _0xe05882=_0x43854e['host']===_0x9b0d('0x85')?'eu':_0x9b0d('0x86');return getAccessToken(_0x43854e)[_0x9b0d('0x2b')](function(_0x1502b7){_0x4fa65f=_0x1502b7;return getUser(_0x4fa65f,_0xe05882,_0x43854e,_0x3004ca[_0x9b0d('0x87')]);})[_0x9b0d('0x2b')](function(_0x1c9dc9){_0x41c5f6=_0x1c9dc9;logger['info']('The\x20User\x20ID\x20is:',_0x41c5f6['id']);return getEndUser(_0x4fa65f,_0xe05882,_0x43854e,_0x90fe82[_0x9b0d('0x88')],_0x90fe82[_0x9b0d('0x89')],_0x41c5f6,_0x43c5db);})[_0x9b0d('0x2b')](function(_0xfb93e0){_0x35d6e6=_0xfb93e0;return getCall(_0x4fa65f,_0xe05882,_0x43854e,_0x41c5f6,_0x35d6e6,_0x43c5db,_0x90fe82,_0x9b0d('0x76'));})['then'](function(_0x4d7c43){if(_0x4d7c43){logger['info']('The\x20Call\x20ID\x20is:',_0x4d7c43['id']);logger[_0x9b0d('0x30')](_0x9b0d('0x80'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9b0d('0x64')]('user:%s',_0x3004ca[_0x9b0d('0x19')]),_0x9b0d('0x8a'),{'uri':'https://crm.'+_0x43854e[_0x9b0d('0x7c')]+_0x9b0d('0x8b')+_0x4d7c43['id']});}})[_0x9b0d('0x2d')](function(_0x1025cd){logger[_0x9b0d('0x2e')](_0x9b0d('0x80'),JSON[_0x9b0d('0x3c')](_0x1025cd));});};exports[_0x9b0d('0x74')]=function(_0x277c95,_0x32c7d7,_0x5ebfc1,_0x54df04,_0x367dc7,_0x29003e,_0x4208d4){var _0x413a7e,_0xfbe3e0,_0x4c3ff6;_0x29003e[_0x9b0d('0x7c')]=intUtil['stripTrailingSlash'](_0x29003e[_0x9b0d('0x7c')]);_0x29003e[_0x9b0d('0x7e')]=intUtil[_0x9b0d('0x7d')](_0x29003e[_0x9b0d('0x7e')]);if(_0x4208d4&&_0x4208d4['recordingFormat']&&_0x4208d4['recordingFormat']!=='none'){logger[_0x9b0d('0x30')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x32c7d7[_0x9b0d('0x8c')]=_0x29003e[_0x9b0d('0x7e')]+_0x9b0d('0x82')+_0x32c7d7[_0x9b0d('0x83')]+_0x9b0d('0x84')+md5(_0x32c7d7[_0x9b0d('0x83')]);}var _0xfd02c6=_0x29003e['host']===_0x9b0d('0x85')?'eu':_0x9b0d('0x86');return getAccessToken(_0x29003e)['then'](function(_0x4d5068){_0x4c3ff6=_0x4d5068;return getUser(_0x4c3ff6,_0xfd02c6,_0x29003e,_0x54df04['email']);})[_0x9b0d('0x2b')](function(_0x4fc56c){_0x413a7e=_0x4fc56c;logger['info']('The\x20User\x20ID\x20is:',_0x413a7e['id']);return getEndUser(_0x4c3ff6,_0xfd02c6,_0x29003e,_0x32c7d7[_0x9b0d('0x8d')],_0x32c7d7[_0x9b0d('0x8e')],_0x413a7e,_0x5ebfc1);})[_0x9b0d('0x2b')](function(_0x4170fa){_0xfbe3e0=_0x4170fa;return getCall(_0x4c3ff6,_0xfd02c6,_0x29003e,_0x413a7e,_0xfbe3e0,_0x5ebfc1,_0x32c7d7,_0x9b0d('0x8f'));})[_0x9b0d('0x2b')](function(_0x396013){if(_0x396013){logger[_0x9b0d('0x30')](_0x9b0d('0x90'),_0x396013['id']);logger[_0x9b0d('0x30')](_0x9b0d('0x91'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x54df04[_0x9b0d('0x19')]),_0x9b0d('0x8a'),{'uri':_0x9b0d('0x92')+_0x29003e[_0x9b0d('0x7c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x396013['id']});}})['catch'](function(_0x314af6){logger[_0x9b0d('0x2e')](_0x9b0d('0x91'),JSON[_0x9b0d('0x3c')](_0x314af6));});};exports['unmanaged']=function(_0x2b7b78,_0x2883bc,_0x2d7cdf,_0x46e832,_0x2e2c06,_0x40df70){var _0x4b83ed,_0x15a239,_0x524cd7;_0x40df70[_0x9b0d('0x7c')]=intUtil[_0x9b0d('0x7d')](_0x40df70['host']);_0x40df70[_0x9b0d('0x7e')]=intUtil[_0x9b0d('0x7d')](_0x40df70[_0x9b0d('0x7e')]);if(_0x2e2c06&&_0x2e2c06[_0x9b0d('0x7f')]){logger[_0x9b0d('0x30')]('['+_0x2883bc[_0x9b0d('0x93')][_0x9b0d('0x94')]()+']',_0x9b0d('0x81'));_0x2883bc['recordingURL']=_0x40df70[_0x9b0d('0x7e')]+_0x9b0d('0x82')+_0x2883bc[_0x9b0d('0x83')]+_0x9b0d('0x84')+md5(_0x2883bc[_0x9b0d('0x83')]);}else{_0x2883bc[_0x9b0d('0x8c')]='';}var _0x4fe018=_0x40df70['host']===_0x9b0d('0x85')?'eu':'com';return getAccessToken(_0x40df70)[_0x9b0d('0x2b')](function(_0x3547c9){_0x524cd7=_0x3547c9;return getUser(_0x524cd7,_0x4fe018,_0x40df70);})[_0x9b0d('0x2b')](function(_0x36bf27){_0x4b83ed=_0x36bf27;logger['info']('The\x20User\x20ID\x20is:',_0x4b83ed['id']);return getEndUser(_0x524cd7,_0x4fe018,_0x40df70,_0x2883bc[_0x9b0d('0x88')],_0x2883bc[_0x9b0d('0x89')],_0x4b83ed,_0x2d7cdf);})[_0x9b0d('0x2b')](function(_0x4961bd){_0x15a239=_0x4961bd;return getCall(_0x524cd7,_0x4fe018,_0x40df70,_0x4b83ed,_0x15a239,_0x2d7cdf,_0x2883bc,'Inbound');})[_0x9b0d('0x2b')](function(_0x4e9bc9){if(_0x4e9bc9){logger['info'](_0x9b0d('0x90'),_0x4e9bc9['id']);}})[_0x9b0d('0x2d')](function(_0x270cb){logger[_0x9b0d('0x2e')]('['+_0x2883bc[_0x9b0d('0x93')][_0x9b0d('0x94')]()+']',JSON['stringify'](_0x270cb));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/script/index.js b/server/services/ami/trigger/script/index.js index 45deac6..c255423 100644 --- a/server/services/ami/trigger/script/index.js +++ b/server/services/ami/trigger/script/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x74c7=['format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec','data2','data3','render','error'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x74c7,0x16f));var _0x774c=function(_0x4b10cf,_0x46cb9e){_0x4b10cf=_0x4b10cf-0x0;var _0x38c3a2=_0x74c7[_0x4b10cf];return _0x38c3a2;};'use strict';var util=require(_0x774c('0x0'));var sh=require(_0x774c('0x1'));var Mustache=require(_0x774c('0x2'));var logger=require(_0x774c('0x3'))(_0x774c('0x4'));exports[_0x774c('0x5')]=function(_0x4a4aac,_0x3a41ac){var _0x370d1a=_0x4a4aac[_0x774c('0x6')]?_0x4a4aac[_0x774c('0x6')]:'Script';var _0x10cb4f=_0x4a4aac[_0x774c('0x7')]?Mustache[_0x774c('0x8')](_0x4a4aac[_0x774c('0x7')],_0x3a41ac):_0x3a41ac;sh[_0x774c('0x5')](_0x10cb4f,function(_0x45af1c,_0x1c8cbb,_0x1ba991){if(_0x45af1c!==0x0){logger[_0x774c('0x9')](util[_0x774c('0xa')](_0x774c('0xb'),_0x370d1a,_0x10cb4f,_0x45af1c,_0x1ba991));}else{logger['info'](util[_0x774c('0xa')](_0x774c('0xc'),_0x370d1a,_0x10cb4f,_0x1c8cbb));}});}; \ No newline at end of file +var _0x22bd=['exec','data2','Script','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','mustache','../../../../config/logger','trigger'];(function(_0x3ed415,_0x37d4d0){var _0x53de99=function(_0x45a6cb){while(--_0x45a6cb){_0x3ed415['push'](_0x3ed415['shift']());}};_0x53de99(++_0x37d4d0);}(_0x22bd,0x129));var _0xd22b=function(_0x195d84,_0x4ab69a){_0x195d84=_0x195d84-0x0;var _0x1dd33b=_0x22bd[_0x195d84];return _0x1dd33b;};'use strict';var util=require('util');var sh=require('shelljs');var Mustache=require(_0xd22b('0x0'));var logger=require(_0xd22b('0x1'))(_0xd22b('0x2'));exports[_0xd22b('0x3')]=function(_0x25f9f7,_0x1d3f1b){var _0x47d567=_0x25f9f7[_0xd22b('0x4')]?_0x25f9f7[_0xd22b('0x4')]:_0xd22b('0x5');var _0x2e9e48=_0x25f9f7[_0xd22b('0x6')]?Mustache['render'](_0x25f9f7['data3'],_0x1d3f1b):_0x1d3f1b;sh[_0xd22b('0x3')](_0x2e9e48,function(_0x573963,_0x473fd2,_0x3b36b0){if(_0x573963!==0x0){logger[_0xd22b('0x7')](util[_0xd22b('0x8')](_0xd22b('0x9'),_0x47d567,_0x2e9e48,_0x573963,_0x3b36b0));}else{logger[_0xd22b('0xa')](util[_0xd22b('0x8')](_0xd22b('0xb'),_0x47d567,_0x2e9e48,_0x473fd2));}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js index 4756562..37838d6 100644 --- a/server/services/ami/trigger/urlforward/index.js +++ b/server/services/ami/trigger/urlforward/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x710e=['error','stack','GET','DELETE','POST','PUT','data7','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','body','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','util','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','number','headers','parse','data6'];(function(_0x14a513,_0x3239f){var _0x47236c=function(_0x394191){while(--_0x394191){_0x14a513['push'](_0x14a513['shift']());}};_0x47236c(++_0x3239f);}(_0x710e,0x7d));var _0xe710=function(_0x57d84c,_0x3a70ee){_0x57d84c=_0x57d84c-0x0;var _0x507078=_0x710e[_0x57d84c];return _0x507078;};'use strict';var rp=require(_0xe710('0x0'));var util=require(_0xe710('0x1'));var _=require('lodash');var Mustache=require(_0xe710('0x2'));var logger=require(_0xe710('0x3'))(_0xe710('0x4'));exports[_0xe710('0x5')]=function(_0x2f1ada,_0x5a7349){var _0x2a7aaf,_0x4af90b;var _0x35f1b3={'method':_0x2f1ada[_0xe710('0x6')][_0xe710('0x7')](),'uri':Mustache[_0xe710('0x8')](_0x2f1ada[_0xe710('0x9')],_0x5a7349),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2f1ada[_0xe710('0xa')])===_0xe710('0xb')&&parseInt(_0x2f1ada[_0xe710('0xa')])>=0x1&&parseInt(_0x2f1ada['data5'])<=0xa?parseInt(_0x2f1ada[_0xe710('0xa')])*0x3e8:0x5*0x3e8};try{_0x35f1b3[_0xe710('0xc')]=_0x2f1ada['data6']?JSON[_0xe710('0xd')](Mustache[_0xe710('0x8')](_0x2f1ada[_0xe710('0xe')],_0x5a7349)):{};}catch(_0x21edfd){logger[_0xe710('0xf')](_0x21edfd[_0xe710('0x10')]);}switch(_0x2f1ada[_0xe710('0x6')]['toUpperCase']()){case _0xe710('0x11'):case _0xe710('0x12'):_0x2a7aaf=null;_0x35f1b3['qs']=_0x5a7349;break;case _0xe710('0x13'):case _0xe710('0x14'):if(_0x2f1ada[_0xe710('0x15')]){try{_0x2a7aaf=JSON['parse'](Mustache[_0xe710('0x8')](_0x2f1ada[_0xe710('0x15')],_0x5a7349));_0x35f1b3['body']=_0x2a7aaf;}catch(_0x2ddc76){logger[_0xe710('0xf')](_0x2ddc76[_0xe710('0x10')]);logger[_0xe710('0xf')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2a7aaf=_0x5a7349;_0x35f1b3['body']=_0x2a7aaf;}break;}logger[_0xe710('0x16')](util[_0xe710('0x17')](_0xe710('0x18'),_0x2f1ada[_0xe710('0x6')],_0x2f1ada['data2'],JSON[_0xe710('0x19')](_0x35f1b3)));rp(_0x35f1b3)[_0xe710('0x1a')](function(_0x5f4606){_0x2a7aaf=!_[_0xe710('0x1b')](_0x2a7aaf)?_0xe710('0x1c')+_0x2a7aaf:'';_0x4af90b=typeof _0x5f4606['body']===_0xe710('0x1d')?JSON[_0xe710('0x19')](_0x5f4606['body']):_0x5f4606[_0xe710('0x1e')];logger[_0xe710('0x16')](util[_0xe710('0x17')](_0xe710('0x1f'),_0x2f1ada['data1'],_0x2f1ada[_0xe710('0x9')],_0x5f4606[_0xe710('0x20')],_0x4af90b));})['catch'](function(_0x4c6c84){logger[_0xe710('0xf')](util[_0xe710('0x17')](_0xe710('0x21'),_0x2f1ada[_0xe710('0x6')],_0x2f1ada[_0xe710('0x9')],_0x4c6c84[_0xe710('0x20')],_0x4c6c84['name'],_0x4c6c84[_0xe710('0x22')]));});}; \ No newline at end of file +var _0x5017=['%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','isNil','object','stringify','format','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','mustache','../../../../config/logger','trigger','exec','toUpperCase','data5','number','headers','error','data1','POST','PUT','data7','parse','render','body','info'];(function(_0x5dbf1c,_0x89c6c2){var _0x1718e5=function(_0x5f0777){while(--_0x5f0777){_0x5dbf1c['push'](_0x5dbf1c['shift']());}};_0x1718e5(++_0x89c6c2);}(_0x5017,0x1bd));var _0x7501=function(_0x2ecdfc,_0x136449){_0x2ecdfc=_0x2ecdfc-0x0;var _0x4ec550=_0x5017[_0x2ecdfc];return _0x4ec550;};'use strict';var rp=require(_0x7501('0x0'));var util=require(_0x7501('0x1'));var _=require('lodash');var Mustache=require(_0x7501('0x2'));var logger=require(_0x7501('0x3'))(_0x7501('0x4'));exports[_0x7501('0x5')]=function(_0x2552c9,_0x2b3513){var _0x66c592,_0x1340f5;var _0x510fd8={'method':_0x2552c9['data1'][_0x7501('0x6')](),'uri':Mustache['render'](_0x2552c9['data2'],_0x2b3513),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2552c9[_0x7501('0x7')])===_0x7501('0x8')&&parseInt(_0x2552c9['data5'])>=0x1&&parseInt(_0x2552c9[_0x7501('0x7')])<=0xa?parseInt(_0x2552c9['data5'])*0x3e8:0x5*0x3e8};try{_0x510fd8[_0x7501('0x9')]=_0x2552c9['data6']?JSON['parse'](Mustache['render'](_0x2552c9['data6'],_0x2b3513)):{};}catch(_0x3a570d){logger[_0x7501('0xa')](_0x3a570d['stack']);}switch(_0x2552c9[_0x7501('0xb')][_0x7501('0x6')]()){case'GET':case'DELETE':_0x66c592=null;_0x510fd8['qs']=_0x2b3513;break;case _0x7501('0xc'):case _0x7501('0xd'):if(_0x2552c9[_0x7501('0xe')]){try{_0x66c592=JSON[_0x7501('0xf')](Mustache[_0x7501('0x10')](_0x2552c9[_0x7501('0xe')],_0x2b3513));_0x510fd8[_0x7501('0x11')]=_0x66c592;}catch(_0x25564b){logger[_0x7501('0xa')](_0x25564b['stack']);logger[_0x7501('0xa')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x66c592=_0x2b3513;_0x510fd8[_0x7501('0x11')]=_0x66c592;}break;}logger[_0x7501('0x12')](util['format'](_0x7501('0x13'),_0x2552c9['data1'],_0x2552c9[_0x7501('0x14')],JSON['stringify'](_0x510fd8)));rp(_0x510fd8)['then'](function(_0x23a7b4){_0x66c592=!_[_0x7501('0x15')](_0x66c592)?',\x20request\x20body:\x20'+_0x66c592:'';_0x1340f5=typeof _0x23a7b4[_0x7501('0x11')]===_0x7501('0x16')?JSON[_0x7501('0x17')](_0x23a7b4['body']):_0x23a7b4['body'];logger[_0x7501('0x12')](util[_0x7501('0x18')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x2552c9['data1'],_0x2552c9[_0x7501('0x14')],_0x23a7b4[_0x7501('0x19')],_0x1340f5));})[_0x7501('0x1a')](function(_0x162188){logger[_0x7501('0xa')](util['format'](_0x7501('0x1b'),_0x2552c9[_0x7501('0xb')],_0x2552c9[_0x7501('0x14')],_0x162188[_0x7501('0x19')],_0x162188[_0x7501('0x1c')],_0x162188['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 8265af2..a35b346 100644 --- a/server/services/email/client.js +++ b/server/services/email/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9db3=['../../config/logger','routing','Request','debug','error','message','result','catch','rpc','exports','bluebird'];(function(_0x3439ea,_0x3c68ba){var _0x3900a3=function(_0x38f9a5){while(--_0x38f9a5){_0x3439ea['push'](_0x3439ea['shift']());}};_0x3900a3(++_0x3c68ba);}(_0x9db3,0x99));var _0x39db=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x9db3[_0x5c2e3e];return _0x53f64a;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x39db('0x0'));var logger=require(_0x39db('0x1'))(_0x39db('0x2'));var client=jayson['client']['http']({'port':0x2329});client[_0x39db('0x3')]=function(_0x126c43,_0x5f46cd){return new BPromise(function(_0x70caea,_0xe8c329){return client['request'](_0x126c43,_0x5f46cd)['then'](function(_0x338cd3){logger[_0x39db('0x4')]('rpc',_0x39db('0x2'),_0x126c43,_0x5f46cd,_0x338cd3);if(_0x338cd3[_0x39db('0x5')]){logger[_0x39db('0x5')]('rpc',_0x39db('0x2'),_0x126c43,_0x338cd3['error'][_0x39db('0x6')],_0x5f46cd);return _0xe8c329(_0x338cd3['error'][_0x39db('0x6')]);}else{return _0x70caea(_0x338cd3[_0x39db('0x7')]);}})[_0x39db('0x8')](function(_0x167376){logger['error'](_0x39db('0x9'),'routing',_0x126c43,_0x167376,_0x5f46cd);return _0xe8c329(_0x167376);});});};module[_0x39db('0xa')]=client; \ No newline at end of file +var _0x5908=['client','http','Request','request','then','debug','rpc','error','message','catch','exports','jayson/promise','bluebird','routing'];(function(_0x34cc16,_0x48fa7d){var _0x19f96b=function(_0x51413c){while(--_0x51413c){_0x34cc16['push'](_0x34cc16['shift']());}};_0x19f96b(++_0x48fa7d);}(_0x5908,0x1d9));var _0x8590=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x5908[_0x13b02f];return _0x12e9a6;};'use strict';var jayson=require(_0x8590('0x0'));var BPromise=require(_0x8590('0x1'));var logger=require('../../config/logger')(_0x8590('0x2'));var client=jayson[_0x8590('0x3')][_0x8590('0x4')]({'port':0x2329});client[_0x8590('0x5')]=function(_0x44580a,_0x1581e4){return new BPromise(function(_0x2fd163,_0x21a86b){return client[_0x8590('0x6')](_0x44580a,_0x1581e4)[_0x8590('0x7')](function(_0x39d37d){logger[_0x8590('0x8')](_0x8590('0x9'),_0x8590('0x2'),_0x44580a,_0x1581e4,_0x39d37d);if(_0x39d37d[_0x8590('0xa')]){logger[_0x8590('0xa')](_0x8590('0x9'),'routing',_0x44580a,_0x39d37d[_0x8590('0xa')]['message'],_0x1581e4);return _0x21a86b(_0x39d37d[_0x8590('0xa')][_0x8590('0xb')]);}else{return _0x2fd163(_0x39d37d['result']);}})[_0x8590('0xc')](function(_0x5da434){logger[_0x8590('0xa')](_0x8590('0x9'),_0x8590('0x2'),_0x44580a,_0x5da434,_0x1581e4);return _0x21a86b(_0x5da434);});});};module[_0x8590('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 9625560..15633db 100644 --- a/server/services/email/index.js +++ b/server/services/email/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x271b=['getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch','./server','./realtime','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then'];(function(_0x3467e8,_0x3f18c1){var _0xed766a=function(_0x36ead1){while(--_0x36ead1){_0x3467e8['push'](_0x3467e8['shift']());}};_0xed766a(++_0x3f18c1);}(_0x271b,0x16f));var _0xb271=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x271b[_0x411add];return _0x238242;};'use strict';var server=require(_0xb271('0x0'));var Realtime=require(_0xb271('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xb271('0x2'));var setting=require(_0xb271('0x3'));var logger=require(_0xb271('0x4'))(_0xb271('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xb271('0x6')]()[_0xb271('0x7')](mailAccount[_0xb271('0x8')]())[_0xb271('0x7')](realtime[_0xb271('0x9')]())['then'](function(){email['refresh'](realtime[_0xb271('0xa')]);return realtime;});}function main(){return server[_0xb271('0xb')](realtime,email)['then'](function(){return initRealtime();})[_0xb271('0x7')](function(){return setting[_0xb271('0xc')]();})['then'](function(_0x100a93){return setInterval(initRealtime,_0x100a93[_0xb271('0xd')]*0x3e8);})[_0xb271('0xe')](function(_0x3d03c5){logger['error']('Email\x20service\x20initialization',_0x3d03c5);});}main(); \ No newline at end of file +var _0xef89=['./rpc/setting','../../config/logger','then','initMailAccounts','refresh','getSettings','loginMailFrequency','catch','error','./server','./realtime','./lib/email','./rpc/mailAccount'];(function(_0x5b2529,_0x40015f){var _0x37538c=function(_0x592a94){while(--_0x592a94){_0x5b2529['push'](_0x5b2529['shift']());}};_0x37538c(++_0x40015f);}(_0xef89,0xf3));var _0x9ef8=function(_0x40aaea,_0x3f4db7){_0x40aaea=_0x40aaea-0x0;var _0x3bac0f=_0xef89[_0x40aaea];return _0x3bac0f;};'use strict';var server=require(_0x9ef8('0x0'));var Realtime=require(_0x9ef8('0x1'));var EmailChannel=require(_0x9ef8('0x2'));var mailAccount=require(_0x9ef8('0x3'));var setting=require(_0x9ef8('0x4'));var logger=require(_0x9ef8('0x5'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x9ef8('0x6')](mailAccount['getMailAccounts']())[_0x9ef8('0x6')](realtime[_0x9ef8('0x7')]())[_0x9ef8('0x6')](function(){email[_0x9ef8('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})[_0x9ef8('0x6')](function(){return setting[_0x9ef8('0x9')]();})[_0x9ef8('0x6')](function(_0x409e9a){return setInterval(initRealtime,_0x409e9a[_0x9ef8('0xa')]*0x3e8);})[_0x9ef8('0xb')](function(_0x2a75d9){logger[_0x9ef8('0xc')]('Email\x20service\x20initialization',_0x2a75d9);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 69552a1..7435998 100644 --- a/server/services/email/lib/email.js +++ b/server/services/email/lib/email.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa701=['../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','service','custom','provider','box','handleImapBox','handleImapEmail','bind','handleImapEnd','error','disabled','messageStatus','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','verifySmtp','Smtp','lastSync','verify','verified','exports','moment','md5'];(function(_0x122382,_0x50a7db){var _0x4789f0=function(_0x257423){while(--_0x257423){_0x122382['push'](_0x122382['shift']());}};_0x4789f0(++_0x50a7db);}(_0xa701,0x17f));var _0x1a70=function(_0x1bc08e,_0x20e0d7){_0x1bc08e=_0x1bc08e-0x0;var _0x19e73f=_0xa701[_0x1bc08e];return _0x19e73f;};'use strict';var _=require('lodash');var moment=require(_0x1a70('0x0'));var BPromise=require('bluebird');var md5=require(_0x1a70('0x1'));var Redis=require('ioredis');var config=require(_0x1a70('0x2'));var logger=require(_0x1a70('0x3'))(_0x1a70('0x4'));config[_0x1a70('0x5')]=_[_0x1a70('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1a70('0x7'))(new Redis(config[_0x1a70('0x5')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x1a70('0x8'));var mailAccount=require(_0x1a70('0x9'));var md5Accounts={};function EmailChannel(_0x4aa460){logger[_0x1a70('0xa')]('start\x20email\x20channel');this[_0x1a70('0xb')]=_0x4aa460[_0x1a70('0xb')];this[_0x1a70('0xc')]={};this[_0x1a70('0xd')]=new EmailSmtp();}EmailChannel[_0x1a70('0xe')][_0x1a70('0xf')]=function(_0x1f9bf9){var _0x24dd57=this[_0x1a70('0xb')][_0x1f9bf9];var _0x1eba39={'id':_0x24dd57['id'],'name':_0x24dd57[_0x1a70('0x10')],'key':_0x24dd57[_0x1a70('0x11')],'active':_0x24dd57[_0x1a70('0x12')],'Imap':{'status':_0x24dd57[_0x1a70('0x13')][_0x1a70('0x14')],'messageStatus':_0x24dd57[_0x1a70('0x13')]['messageStatus'],'total':_0x24dd57[_0x1a70('0x13')][_0x1a70('0x15')]}};if(_[_0x1a70('0x16')](md5Accounts[_0x1f9bf9])){md5Accounts[_0x1f9bf9]={};}var _0x16d2ff=md5(JSON[_0x1a70('0x17')](_0x1eba39));if(md5Accounts[_0x1f9bf9][_0x1a70('0x1')]!==_0x16d2ff){md5Accounts[_0x1f9bf9][_0x1a70('0x1')]=_0x16d2ff;io[_0x1a70('0xf')](_0x1a70('0x18'),_0x1eba39);}};EmailChannel['prototype'][_0x1a70('0x19')]=function(_0x560dba){for(var _0x2d09d8 in _0x560dba){if(_0x560dba[_0x1a70('0x1a')](_0x2d09d8)){if(_0x560dba[_0x2d09d8][_0x1a70('0x13')]&&_0x560dba[_0x2d09d8]['active']){var _0x47d147=_0x560dba[_0x2d09d8][_0x1a70('0x13')];if(!_0x47d147[_0x1a70('0x1b')]&&_0x560dba[_0x2d09d8]['provider']!==_0x1a70('0x1c'))_0x47d147[_0x1a70('0x1b')]=_0x560dba[_0x2d09d8][_0x1a70('0x1d')];if(!this[_0x1a70('0xc')][_0x1a70('0x1a')](_0x47d147['id'])){this[_0x1a70('0xc')][_0x47d147['id']]=new EmailImap(_0x47d147,_0x560dba[_0x2d09d8]['email']);this['imapAccounts'][_0x47d147['id']]['on'](_0x1a70('0x1e'),this[_0x1a70('0x1f')]['bind'](this,_0x2d09d8));this[_0x1a70('0xc')][_0x47d147['id']]['on'](_0x1a70('0x4'),this[_0x1a70('0x20')][_0x1a70('0x21')](this,_0x2d09d8));this['imapAccounts'][_0x47d147['id']]['on']('end',this[_0x1a70('0x22')][_0x1a70('0x21')](this,_0x2d09d8));this[_0x1a70('0xc')][_0x47d147['id']]['on'](_0x1a70('0x23'),this['handleImapError'][_0x1a70('0x21')](this,_0x2d09d8));}}else{if(_[_0x1a70('0x16')](this[_0x1a70('0xb')][_0x2d09d8][_0x1a70('0x13')])){this[_0x1a70('0xb')][_0x2d09d8]['Imap']={};}this[_0x1a70('0xb')][_0x2d09d8][_0x1a70('0x13')][_0x1a70('0x14')]=_0x1a70('0x24');this[_0x1a70('0xb')][_0x2d09d8][_0x1a70('0x13')][_0x1a70('0x25')]='';this['emit'](_0x2d09d8);}}}};EmailChannel[_0x1a70('0xe')][_0x1a70('0x1f')]=function(_0x56c693,_0x3a72e7){if(this['mailAccounts'][_0x56c693]){this[_0x1a70('0xb')][_0x56c693][_0x1a70('0x13')]['status']=_0x1a70('0x26');this[_0x1a70('0xb')][_0x56c693][_0x1a70('0x13')]['messageStatus']=_0x3a72e7[_0x1a70('0x10')];if(_0x3a72e7[_0x1a70('0x27')]){this[_0x1a70('0xb')][_0x56c693][_0x1a70('0x13')]['total']=_0x3a72e7[_0x1a70('0x27')][_0x1a70('0x15')];}return this[_0x1a70('0xf')](_0x56c693);}};EmailChannel[_0x1a70('0xe')][_0x1a70('0x20')]=function(_0x41e523,_0x55110d){logger[_0x1a70('0xa')](_0x1a70('0x28'),_0x55110d['firstName'],_0x55110d[_0x1a70('0x29')],_0x55110d['from'],_0x41e523);if(this[_0x1a70('0xb')][_0x41e523]){return mailAccount[_0x1a70('0x2a')](_0x41e523,_0x55110d)[_0x1a70('0x2b')](function(_0x4cccf0){if(_0x4cccf0){logger['info'](_0x1a70('0x2c'));}})[_0x1a70('0x2d')](function(_0x248714){logger[_0x1a70('0x23')](_0x1a70('0x2e'),JSON['stringify'](_0x248714));});}};EmailChannel['prototype'][_0x1a70('0x22')]=function(_0x24124b){if(this[_0x1a70('0xb')][_0x24124b]&&this[_0x1a70('0xb')][_0x24124b][_0x1a70('0x13')]){if(this[_0x1a70('0xc')][this[_0x1a70('0xb')][_0x24124b][_0x1a70('0x13')]['id']]){delete this[_0x1a70('0xc')][this[_0x1a70('0xb')][_0x24124b]['Imap']['id']];}this[_0x1a70('0xb')][_0x24124b]['Imap']['lastSync']=moment();this[_0x1a70('0xf')](_0x24124b);}};EmailChannel['prototype']['handleImapError']=function(_0x592a1f,_0xbece7f){if(this[_0x1a70('0xb')][_0x592a1f]){this['mailAccounts'][_0x592a1f][_0x1a70('0x13')]['status']='error';this['mailAccounts'][_0x592a1f][_0x1a70('0x13')][_0x1a70('0x25')]=_0xbece7f;return this[_0x1a70('0xf')](_0x592a1f);}};EmailChannel[_0x1a70('0xe')][_0x1a70('0x2f')]=function(_0x3019e1,_0x485de1){return this[_0x1a70('0xd')][_0x1a70('0x30')](_0x3019e1,_0x485de1);};EmailChannel[_0x1a70('0xe')][_0x1a70('0x31')]=function(_0xc99430){var _0x559501=this;if(this[_0x1a70('0xb')][_0xc99430['id']]){if(_[_0x1a70('0x16')](this['mailAccounts'][_0xc99430['id']]['Smtp'])){this[_0x1a70('0xb')][_0xc99430['id']][_0x1a70('0x32')]={};}this[_0x1a70('0xb')][_0xc99430['id']][_0x1a70('0x32')][_0x1a70('0x33')]=moment();return new BPromise(function(_0x2f8aea,_0x1ccebc){return _0x559501[_0x1a70('0xd')][_0x1a70('0x34')](_0xc99430)[_0x1a70('0x2b')](function(_0x1845b9){_0x559501['mailAccounts'][_0xc99430['id']][_0x1a70('0x32')][_0x1a70('0x14')]=_0x1a70('0x35');_0x559501['mailAccounts'][_0xc99430['id']][_0x1a70('0x32')][_0x1a70('0x25')]='';_0x559501[_0x1a70('0xf')](_0xc99430['id']);_0x2f8aea(_0x1845b9);})[_0x1a70('0x2d')](function(_0x46b33a){_0x559501[_0x1a70('0xb')][_0xc99430['id']]['Smtp']['status']=_0x1a70('0x23');_0x559501[_0x1a70('0xb')][_0xc99430['id']][_0x1a70('0x32')][_0x1a70('0x25')]=_0x46b33a;_0x559501[_0x1a70('0xf')](_0xc99430['id']);_0x1ccebc(_0x46b33a);});});}return this['smtp'][_0x1a70('0x34')](_0xc99430);};module[_0x1a70('0x36')]=EmailChannel; \ No newline at end of file +var _0xf8fa=['lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','verify','then','verified','exports','lodash','moment','bluebird','md5','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','status','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','service','provider','custom','hasOwnProperty','box','handleImapBox','bind','end','handleImapEnd','error','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','Mail\x20accepted\x20from\x20routing','catch'];(function(_0x4c6b65,_0xb9e04b){var _0x4eb7ba=function(_0x1b219d){while(--_0x1b219d){_0x4c6b65['push'](_0x4c6b65['shift']());}};_0x4eb7ba(++_0xb9e04b);}(_0xf8fa,0x7c));var _0xaf8f=function(_0x59eb67,_0x556537){_0x59eb67=_0x59eb67-0x0;var _0x1f95f6=_0xf8fa[_0x59eb67];return _0x1f95f6;};'use strict';var _=require(_0xaf8f('0x0'));var moment=require(_0xaf8f('0x1'));var BPromise=require(_0xaf8f('0x2'));var md5=require(_0xaf8f('0x3'));var Redis=require('ioredis');var config=require(_0xaf8f('0x4'));var logger=require(_0xaf8f('0x5'))(_0xaf8f('0x6'));config[_0xaf8f('0x7')]=_[_0xaf8f('0x8')](config[_0xaf8f('0x7')],{'host':_0xaf8f('0x9'),'port':0x18eb});var io=require(_0xaf8f('0xa'))(new Redis(config[_0xaf8f('0x7')]));var EmailImap=require(_0xaf8f('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xaf8f('0xc'));var md5Accounts={};function EmailChannel(_0xe02257){logger[_0xaf8f('0xd')]('start\x20email\x20channel');this['mailAccounts']=_0xe02257[_0xaf8f('0xe')];this[_0xaf8f('0xf')]={};this[_0xaf8f('0x10')]=new EmailSmtp();}EmailChannel[_0xaf8f('0x11')][_0xaf8f('0x12')]=function(_0x43be19){var _0xd436be=this[_0xaf8f('0xe')][_0x43be19];var _0x4cad8e={'id':_0xd436be['id'],'name':_0xd436be[_0xaf8f('0x13')],'key':_0xd436be[_0xaf8f('0x14')],'active':_0xd436be[_0xaf8f('0x15')],'Imap':{'status':_0xd436be['Imap'][_0xaf8f('0x16')],'messageStatus':_0xd436be[_0xaf8f('0x17')][_0xaf8f('0x18')],'total':_0xd436be['Imap'][_0xaf8f('0x19')]}};if(_[_0xaf8f('0x1a')](md5Accounts[_0x43be19])){md5Accounts[_0x43be19]={};}var _0x121f56=md5(JSON[_0xaf8f('0x1b')](_0x4cad8e));if(md5Accounts[_0x43be19][_0xaf8f('0x3')]!==_0x121f56){md5Accounts[_0x43be19][_0xaf8f('0x3')]=_0x121f56;io[_0xaf8f('0x12')](_0xaf8f('0x1c'),_0x4cad8e);}};EmailChannel['prototype'][_0xaf8f('0x1d')]=function(_0x13d016){for(var _0x5a1fec in _0x13d016){if(_0x13d016['hasOwnProperty'](_0x5a1fec)){if(_0x13d016[_0x5a1fec][_0xaf8f('0x17')]&&_0x13d016[_0x5a1fec][_0xaf8f('0x15')]){var _0x48a593=_0x13d016[_0x5a1fec][_0xaf8f('0x17')];if(!_0x48a593[_0xaf8f('0x1e')]&&_0x13d016[_0x5a1fec][_0xaf8f('0x1f')]!==_0xaf8f('0x20'))_0x48a593['service']=_0x13d016[_0x5a1fec]['provider'];if(!this[_0xaf8f('0xf')][_0xaf8f('0x21')](_0x48a593['id'])){this[_0xaf8f('0xf')][_0x48a593['id']]=new EmailImap(_0x48a593,_0x13d016[_0x5a1fec]['email']);this['imapAccounts'][_0x48a593['id']]['on'](_0xaf8f('0x22'),this[_0xaf8f('0x23')][_0xaf8f('0x24')](this,_0x5a1fec));this[_0xaf8f('0xf')][_0x48a593['id']]['on'](_0xaf8f('0x6'),this['handleImapEmail']['bind'](this,_0x5a1fec));this[_0xaf8f('0xf')][_0x48a593['id']]['on'](_0xaf8f('0x25'),this[_0xaf8f('0x26')][_0xaf8f('0x24')](this,_0x5a1fec));this[_0xaf8f('0xf')][_0x48a593['id']]['on'](_0xaf8f('0x27'),this['handleImapError'][_0xaf8f('0x24')](this,_0x5a1fec));}}else{if(_[_0xaf8f('0x1a')](this[_0xaf8f('0xe')][_0x5a1fec]['Imap'])){this['mailAccounts'][_0x5a1fec][_0xaf8f('0x17')]={};}this['mailAccounts'][_0x5a1fec]['Imap'][_0xaf8f('0x16')]='disabled';this[_0xaf8f('0xe')][_0x5a1fec]['Imap'][_0xaf8f('0x18')]='';this['emit'](_0x5a1fec);}}}};EmailChannel[_0xaf8f('0x11')][_0xaf8f('0x23')]=function(_0x4b31c4,_0x4ff81a){if(this[_0xaf8f('0xe')][_0x4b31c4]){this[_0xaf8f('0xe')][_0x4b31c4]['Imap']['status']=_0xaf8f('0x28');this[_0xaf8f('0xe')][_0x4b31c4][_0xaf8f('0x17')][_0xaf8f('0x18')]=_0x4ff81a[_0xaf8f('0x13')];if(_0x4ff81a[_0xaf8f('0x29')]){this[_0xaf8f('0xe')][_0x4b31c4]['Imap'][_0xaf8f('0x19')]=_0x4ff81a['messages'][_0xaf8f('0x19')];}return this[_0xaf8f('0x12')](_0x4b31c4);}};EmailChannel[_0xaf8f('0x11')][_0xaf8f('0x2a')]=function(_0x320b5c,_0x368721){logger[_0xaf8f('0xd')](_0xaf8f('0x2b'),_0x368721[_0xaf8f('0x2c')],_0x368721['lastName'],_0x368721['from'],_0x320b5c);if(this['mailAccounts'][_0x320b5c]){return mailAccount['notify'](_0x320b5c,_0x368721)['then'](function(_0x515614){if(_0x515614){logger['info'](_0xaf8f('0x2d'));}})[_0xaf8f('0x2e')](function(_0x94c478){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xaf8f('0x1b')](_0x94c478));});}};EmailChannel[_0xaf8f('0x11')][_0xaf8f('0x26')]=function(_0x49fb6b){if(this[_0xaf8f('0xe')][_0x49fb6b]&&this['mailAccounts'][_0x49fb6b][_0xaf8f('0x17')]){if(this[_0xaf8f('0xf')][this[_0xaf8f('0xe')][_0x49fb6b]['Imap']['id']]){delete this[_0xaf8f('0xf')][this[_0xaf8f('0xe')][_0x49fb6b][_0xaf8f('0x17')]['id']];}this['mailAccounts'][_0x49fb6b]['Imap'][_0xaf8f('0x2f')]=moment();this[_0xaf8f('0x12')](_0x49fb6b);}};EmailChannel[_0xaf8f('0x11')][_0xaf8f('0x30')]=function(_0x5908ee,_0x1de974){if(this[_0xaf8f('0xe')][_0x5908ee]){this[_0xaf8f('0xe')][_0x5908ee][_0xaf8f('0x17')][_0xaf8f('0x16')]=_0xaf8f('0x27');this[_0xaf8f('0xe')][_0x5908ee][_0xaf8f('0x17')][_0xaf8f('0x18')]=_0x1de974;return this[_0xaf8f('0x12')](_0x5908ee);}};EmailChannel[_0xaf8f('0x11')][_0xaf8f('0x31')]=function(_0x215e06,_0x4c93e1){return this['smtp'][_0xaf8f('0x32')](_0x215e06,_0x4c93e1);};EmailChannel[_0xaf8f('0x11')][_0xaf8f('0x33')]=function(_0x145722){var _0x3cbddb=this;if(this[_0xaf8f('0xe')][_0x145722['id']]){if(_['isNil'](this[_0xaf8f('0xe')][_0x145722['id']][_0xaf8f('0x34')])){this['mailAccounts'][_0x145722['id']][_0xaf8f('0x34')]={};}this['mailAccounts'][_0x145722['id']][_0xaf8f('0x34')]['lastSync']=moment();return new BPromise(function(_0x5443e7,_0x115991){return _0x3cbddb[_0xaf8f('0x10')][_0xaf8f('0x35')](_0x145722)[_0xaf8f('0x36')](function(_0x23e119){_0x3cbddb['mailAccounts'][_0x145722['id']][_0xaf8f('0x34')][_0xaf8f('0x16')]=_0xaf8f('0x37');_0x3cbddb[_0xaf8f('0xe')][_0x145722['id']][_0xaf8f('0x34')][_0xaf8f('0x18')]='';_0x3cbddb[_0xaf8f('0x12')](_0x145722['id']);_0x5443e7(_0x23e119);})[_0xaf8f('0x2e')](function(_0x52cdca){_0x3cbddb[_0xaf8f('0xe')][_0x145722['id']][_0xaf8f('0x34')][_0xaf8f('0x16')]='error';_0x3cbddb[_0xaf8f('0xe')][_0x145722['id']][_0xaf8f('0x34')][_0xaf8f('0x18')]=_0x52cdca;_0x3cbddb[_0xaf8f('0x12')](_0x145722['id']);_0x115991(_0x52cdca);});});}return this[_0xaf8f('0x10')][_0xaf8f('0x35')](_0x145722);};module[_0xaf8f('0x38')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 96f6cd1..6305494 100644 --- a/server/services/email/lib/imap.js +++ b/server/services/email/lib/imap.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd12a=['fetch','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','handleEnd','stringify','textCode','upperFirst','exports','lodash','imap','mailparser','simpleParser','Iconv','events','email','mailbox','account','getAccount','once','ready','handleReady','end','handleError','bind','connect','inherits','prototype','connTimeout','authTimeout','service','user','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','required','handleOpenBox','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length'];(function(_0x1902c4,_0x46afd5){var _0x4cdaaa=function(_0x1a5f7d){while(--_0x1a5f7d){_0x1902c4['push'](_0x1902c4['shift']());}};_0x4cdaaa(++_0x46afd5);}(_0xd12a,0x14a));var _0xad12=function(_0x361ef5,_0x309214){_0x361ef5=_0x361ef5-0x0;var _0x271a93=_0xd12a[_0x361ef5];return _0x271a93;};'use strict';var _=require(_0xad12('0x0'));var util=require('util');var Imap=require(_0xad12('0x1'));var simpleParser=require(_0xad12('0x2'))[_0xad12('0x3')];var Iconv=require('iconv')[_0xad12('0x4')];var EventEmitter=require(_0xad12('0x5'))['EventEmitter'];var utils=require('./utils');var logger=require('../../../config/logger')(_0xad12('0x6'));function EmailImap(_0x5d6630,_0x37397e){this[_0xad12('0x7')]=_0x5d6630['mailbox'];this[_0xad12('0x8')]=this[_0xad12('0x9')](_0x5d6630,_0x37397e);this[_0xad12('0x1')]=new Imap(this['account']);this[_0xad12('0x1')][_0xad12('0xa')](_0xad12('0xb'),this[_0xad12('0xc')]['bind'](this));this['imap']['once'](_0xad12('0xd'),this['handleEnd']['bind'](this));this[_0xad12('0x1')]['on']('error',this[_0xad12('0xe')][_0xad12('0xf')](this));this[_0xad12('0x1')][_0xad12('0x10')]();}util[_0xad12('0x11')](EmailImap,EventEmitter);EmailImap[_0xad12('0x12')][_0xad12('0x9')]=function(_0x4498c2,_0x57e39b){var _0x3aed6f={'connTimeout':_0x4498c2[_0xad12('0x13')]?_0x4498c2['connTimeout']*0x3e8:0x2710,'authTimeout':_0x4498c2[_0xad12('0x14')]?_0x4498c2[_0xad12('0x14')]*0x3e8:0x1388};if(_0x4498c2[_0xad12('0x15')]){_0x3aed6f['user']=_0x4498c2[_0xad12('0x16')];if(_0x4498c2['modernAuthentication']){_0x3aed6f[_0xad12('0x17')]=utils[_0xad12('0x18')](_0x4498c2[_0xad12('0x19')][_0xad12('0x1a')],_0x4498c2[_0xad12('0x16')]);}else{_0x3aed6f[_0xad12('0x1b')]=_0x4498c2[_0xad12('0x1b')];}}else{if(_0x4498c2[_0xad12('0x1c')]){_0x3aed6f['user']=_0x4498c2[_0xad12('0x16')];_0x3aed6f[_0xad12('0x1b')]=_0x4498c2['password'];}}_0x3aed6f['email']=_0x57e39b||_0x4498c2[_0xad12('0x16')]||_0xad12('0x1d');_0x3aed6f[_0xad12('0x1e')]=_0x4498c2[_0xad12('0x1e')];_0x3aed6f[_0xad12('0x1f')]=_0x4498c2[_0xad12('0x1f')]||0x3e1;if(_0x4498c2[_0xad12('0x20')]){_0x3aed6f[_0xad12('0x20')]=!![];}else{_0x3aed6f[_0xad12('0x20')]=![];_0x3aed6f['autotls']=_0xad12('0x21');}return _0x3aed6f;};EmailImap[_0xad12('0x12')][_0xad12('0xc')]=function(){this[_0xad12('0x1')]['openBox'](this['mailbox'],![],this[_0xad12('0x22')]['bind'](this));};EmailImap[_0xad12('0x12')][_0xad12('0x22')]=function(_0x5e2d26,_0x58c900){if(_0x5e2d26){this[_0xad12('0xe')](_0x5e2d26,!![]);}else{this['emit'](_0xad12('0x23'),_0x58c900);this[_0xad12('0x24')]();}};EmailImap['prototype'][_0xad12('0x25')]=function(_0x35ab06){if(_0x35ab06){this[_0xad12('0xe')](_0x35ab06,!![]);}else{this[_0xad12('0x1')][_0xad12('0xd')]();}};EmailImap[_0xad12('0x12')][_0xad12('0x24')]=function(){this[_0xad12('0x1')][_0xad12('0x26')]([_0xad12('0x27')],this[_0xad12('0x28')][_0xad12('0xf')](this));};EmailImap[_0xad12('0x12')][_0xad12('0x28')]=function(_0x39dfe7,_0x414751){if(_0x39dfe7){this['handleError'](_0x39dfe7,!![]);}else{if(_0x414751[_0xad12('0x29')]){try{var _0x5eadec=this[_0xad12('0x1')][_0xad12('0x2a')](_0x414751,{'bodies':'','markSeen':!![]});_0x5eadec['on'](_0xad12('0x2b'),this[_0xad12('0x2c')][_0xad12('0xf')](this));_0x5eadec[_0xad12('0xa')](_0xad12('0x2d'),this[_0xad12('0x2e')][_0xad12('0xf')](this));_0x5eadec['once'](_0xad12('0xd'),this[_0xad12('0x2f')][_0xad12('0xf')](this));}catch(_0x15b7c9){logger[_0xad12('0x2d')](_0x15b7c9);}}else{this[_0xad12('0x1')][_0xad12('0x30')](!![],this['handleCloseBox'][_0xad12('0xf')](this));}}};EmailImap['prototype'][_0xad12('0x2c')]=function(_0x4567fd){_0x4567fd['on'](_0xad12('0x31'),this[_0xad12('0x32')][_0xad12('0xf')](this));_0x4567fd[_0xad12('0xa')](_0xad12('0x33'),this[_0xad12('0x34')][_0xad12('0xf')](this));_0x4567fd['once'](_0xad12('0xd'),this[_0xad12('0x35')][_0xad12('0xf')](this));};EmailImap[_0xad12('0x12')][_0xad12('0x32')]=function(_0x822a24){simpleParser(_0x822a24,{'Iconv':Iconv},this[_0xad12('0x36')][_0xad12('0xf')](this));};EmailImap[_0xad12('0x12')]['handleMessageAttributes']=function(){};EmailImap[_0xad12('0x12')][_0xad12('0x35')]=function(){};EmailImap[_0xad12('0x12')][_0xad12('0x36')]=function(_0x412d09,_0xffcbf){if(_0x412d09){logger[_0xad12('0x2d')](_0x412d09);}else{var _0x368723=this;utils[_0xad12('0x37')](this[_0xad12('0x8')],_0xffcbf,function(_0x1983fb){_0x368723[_0xad12('0x38')]('email',_0x1983fb);});}};EmailImap['prototype'][_0xad12('0x2f')]=function(){this[_0xad12('0x1')][_0xad12('0x30')](!![],this[_0xad12('0x25')][_0xad12('0xf')](this));};EmailImap[_0xad12('0x12')][_0xad12('0x2e')]=function(_0xd5079b){this[_0xad12('0xe')](_0xd5079b);this[_0xad12('0x1')][_0xad12('0x30')](!![],this[_0xad12('0x25')][_0xad12('0xf')](this));};EmailImap[_0xad12('0x12')][_0xad12('0x39')]=function(){this['emit']('end');};EmailImap['prototype'][_0xad12('0xe')]=function(_0x4c91a3,_0x1abe96){logger['error'](_0xad12('0xe'),this[_0xad12('0x8')][_0xad12('0x6')],JSON[_0xad12('0x3a')](_0x4c91a3));var _0x56f03e='';if(_0x4c91a3){if(_0x4c91a3[_0xad12('0x3b')]){_0x56f03e=_0x4c91a3[_0xad12('0x3b')];}else{for(var _0x22c315 in _0x4c91a3){if(_0x4c91a3['hasOwnProperty'](_0x22c315)){_0x56f03e+=_[_0xad12('0x3c')](_0x22c315)+':\x20'+_0x4c91a3[_0x22c315]+'\x0a';}}}}if(_0x1abe96){this[_0xad12('0x1')][_0xad12('0xd')]();}else{this[_0xad12('0x38')]('error',_0x56f03e);this['emit'](_0xad12('0xd'));}};module[_0xad12('0x3d')]=EmailImap; \ No newline at end of file +var _0x8039=['autotls','required','prototype','handleOpenBox','emit','box','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','parser','textCode','exports','util','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','getAccount','account','imap','once','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls'];(function(_0x3d24ca,_0x2110e1){var _0x3479cf=function(_0x433111){while(--_0x433111){_0x3d24ca['push'](_0x3d24ca['shift']());}};_0x3479cf(++_0x2110e1);}(_0x8039,0xcc));var _0x9803=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0x8039[_0x245afe];return _0x4eefde;};'use strict';var _=require('lodash');var util=require(_0x9803('0x0'));var Imap=require('imap');var simpleParser=require('mailparser')[_0x9803('0x1')];var Iconv=require(_0x9803('0x2'))[_0x9803('0x3')];var EventEmitter=require(_0x9803('0x4'))[_0x9803('0x5')];var utils=require(_0x9803('0x6'));var logger=require(_0x9803('0x7'))(_0x9803('0x8'));function EmailImap(_0x67173b,_0x1ec459){this[_0x9803('0x9')]=_0x67173b['mailbox'];this['account']=this[_0x9803('0xa')](_0x67173b,_0x1ec459);this['imap']=new Imap(this[_0x9803('0xb')]);this[_0x9803('0xc')][_0x9803('0xd')]('ready',this[_0x9803('0xe')][_0x9803('0xf')](this));this[_0x9803('0xc')][_0x9803('0xd')](_0x9803('0x10'),this[_0x9803('0x11')][_0x9803('0xf')](this));this[_0x9803('0xc')]['on'](_0x9803('0x12'),this[_0x9803('0x13')][_0x9803('0xf')](this));this[_0x9803('0xc')][_0x9803('0x14')]();}util[_0x9803('0x15')](EmailImap,EventEmitter);EmailImap['prototype'][_0x9803('0xa')]=function(_0x3e45f7,_0x17a9ff){var _0x15dd9e={'connTimeout':_0x3e45f7[_0x9803('0x16')]?_0x3e45f7[_0x9803('0x16')]*0x3e8:0x2710,'authTimeout':_0x3e45f7[_0x9803('0x17')]?_0x3e45f7[_0x9803('0x17')]*0x3e8:0x1388};if(_0x3e45f7[_0x9803('0x18')]){_0x15dd9e['user']=_0x3e45f7[_0x9803('0x19')];if(_0x3e45f7[_0x9803('0x1a')]){_0x15dd9e[_0x9803('0x1b')]=utils[_0x9803('0x1c')](_0x3e45f7[_0x9803('0x1d')][_0x9803('0x1e')],_0x3e45f7[_0x9803('0x19')]);}else{_0x15dd9e[_0x9803('0x1f')]=_0x3e45f7[_0x9803('0x1f')];}}else{if(_0x3e45f7[_0x9803('0x20')]){_0x15dd9e[_0x9803('0x19')]=_0x3e45f7[_0x9803('0x19')];_0x15dd9e[_0x9803('0x1f')]=_0x3e45f7['password'];}}_0x15dd9e[_0x9803('0x8')]=_0x17a9ff||_0x3e45f7[_0x9803('0x19')]||'anonymous@xcally.com';_0x15dd9e[_0x9803('0x21')]=_0x3e45f7[_0x9803('0x21')];_0x15dd9e[_0x9803('0x22')]=_0x3e45f7[_0x9803('0x22')]||0x3e1;if(_0x3e45f7[_0x9803('0x23')]){_0x15dd9e['tls']=!![];}else{_0x15dd9e[_0x9803('0x23')]=![];_0x15dd9e[_0x9803('0x24')]=_0x9803('0x25');}return _0x15dd9e;};EmailImap[_0x9803('0x26')][_0x9803('0xe')]=function(){this[_0x9803('0xc')]['openBox'](this[_0x9803('0x9')],![],this[_0x9803('0x27')][_0x9803('0xf')](this));};EmailImap[_0x9803('0x26')]['handleOpenBox']=function(_0x2db236,_0x36722e){if(_0x2db236){this['handleError'](_0x2db236,!![]);}else{this[_0x9803('0x28')](_0x9803('0x29'),_0x36722e);this['readUnseen']();}};EmailImap[_0x9803('0x26')][_0x9803('0x2a')]=function(_0x2b25dd){if(_0x2b25dd){this[_0x9803('0x13')](_0x2b25dd,!![]);}else{this[_0x9803('0xc')]['end']();}};EmailImap['prototype'][_0x9803('0x2b')]=function(){this['imap'][_0x9803('0x2c')]([_0x9803('0x2d')],this[_0x9803('0x2e')][_0x9803('0xf')](this));};EmailImap[_0x9803('0x26')][_0x9803('0x2e')]=function(_0x46603d,_0xe72083){if(_0x46603d){this[_0x9803('0x13')](_0x46603d,!![]);}else{if(_0xe72083['length']){try{var _0x256d21=this[_0x9803('0xc')][_0x9803('0x2f')](_0xe72083,{'bodies':'','markSeen':!![]});_0x256d21['on']('message',this[_0x9803('0x30')][_0x9803('0xf')](this));_0x256d21[_0x9803('0xd')]('error',this[_0x9803('0x31')]['bind'](this));_0x256d21['once'](_0x9803('0x10'),this[_0x9803('0x32')][_0x9803('0xf')](this));}catch(_0x1e0598){logger['error'](_0x1e0598);}}else{this['imap'][_0x9803('0x33')](!![],this[_0x9803('0x2a')][_0x9803('0xf')](this));}}};EmailImap[_0x9803('0x26')][_0x9803('0x30')]=function(_0x37be93){_0x37be93['on'](_0x9803('0x34'),this[_0x9803('0x35')][_0x9803('0xf')](this));_0x37be93[_0x9803('0xd')](_0x9803('0x36'),this[_0x9803('0x37')]['bind'](this));_0x37be93['once'](_0x9803('0x10'),this['handleMessageEnd'][_0x9803('0xf')](this));};EmailImap[_0x9803('0x26')][_0x9803('0x35')]=function(_0xbca156){simpleParser(_0xbca156,{'Iconv':Iconv},this[_0x9803('0x38')][_0x9803('0xf')](this));};EmailImap['prototype'][_0x9803('0x37')]=function(){};EmailImap[_0x9803('0x26')]['handleMessageEnd']=function(){};EmailImap['prototype'][_0x9803('0x38')]=function(_0x546629,_0x24f96a){if(_0x546629){logger[_0x9803('0x12')](_0x546629);}else{var _0x1c1944=this;utils[_0x9803('0x39')](this[_0x9803('0xb')],_0x24f96a,function(_0x5f09da){_0x1c1944[_0x9803('0x28')](_0x9803('0x8'),_0x5f09da);});}};EmailImap[_0x9803('0x26')][_0x9803('0x32')]=function(){this['imap']['closeBox'](!![],this[_0x9803('0x2a')]['bind'](this));};EmailImap[_0x9803('0x26')][_0x9803('0x31')]=function(_0x2f5863){this['handleError'](_0x2f5863);this[_0x9803('0xc')][_0x9803('0x33')](!![],this[_0x9803('0x2a')][_0x9803('0xf')](this));};EmailImap[_0x9803('0x26')][_0x9803('0x11')]=function(){this[_0x9803('0x28')](_0x9803('0x10'));};EmailImap[_0x9803('0x26')]['handleError']=function(_0x41f3c3,_0x5e0736){logger[_0x9803('0x12')]('handleError',this[_0x9803('0xb')][_0x9803('0x8')],JSON['stringify'](_0x41f3c3));var _0x936b77='';if(_0x41f3c3){if(_0x41f3c3[_0x9803('0x3a')]){_0x936b77=_0x41f3c3[_0x9803('0x3a')];}else{for(var _0x494ef3 in _0x41f3c3){if(_0x41f3c3['hasOwnProperty'](_0x494ef3)){_0x936b77+=_['upperFirst'](_0x494ef3)+':\x20'+_0x41f3c3[_0x494ef3]+'\x0a';}}}}if(_0x5e0736){this['imap']['end']();}else{this[_0x9803('0x28')]('error',_0x936b77);this[_0x9803('0x28')](_0x9803('0x10'));}};module[_0x9803('0x3b')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 08ed7bb..2f8368b 100644 --- a/server/services/email/lib/smtp.js +++ b/server/services/email/lib/smtp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9505=['sendMail','toString','createTransport','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','use','compile'];(function(_0x341efb,_0x4d8bab){var _0x196861=function(_0x648ea4){while(--_0x648ea4){_0x341efb['push'](_0x341efb['shift']());}};_0x196861(++_0x4d8bab);}(_0x9505,0xde));var _0x5950=function(_0x47f0d0,_0x3c98a9){_0x47f0d0=_0x47f0d0-0x0;var _0x526f0b=_0x9505[_0x47f0d0];return _0x526f0b;};'use strict';var nodemailer=require(_0x5950('0x0'));var inlineBase64=require(_0x5950('0x1'));function EmailSmtp(){}EmailSmtp[_0x5950('0x2')][_0x5950('0x3')]=function(_0x15fdf1,_0x369592){return new Promise(function(_0x321d2f,_0x18ed19){var _0x222ac2=nodemailer['createTransport'](_0x15fdf1);_0x222ac2[_0x5950('0x4')](_0x5950('0x5'),inlineBase64());_0x222ac2[_0x5950('0x6')](_0x369592,function(_0x11c889,_0x441d9a){if(_0x11c889){_0x18ed19(_0x11c889[_0x5950('0x7')]());}else{_0x321d2f(_0x441d9a);}});});};EmailSmtp[_0x5950('0x2')]['verify']=function(_0x5bb2bc){return new Promise(function(_0xa8723e,_0x9110af){var _0x3eaaf1=nodemailer[_0x5950('0x8')](_0x5bb2bc);_0x3eaaf1[_0x5950('0x9')](function(_0x4b2851,_0x180106){if(_0x4b2851){_0x9110af(_0x4b2851[_0x5950('0x7')]());}else{if(_0x180106){_0xa8723e(_0x180106);}else{_0x9110af(_0x5950('0xa'));}}});});};module[_0x5950('0xb')]=EmailSmtp; \ No newline at end of file +var _0x2456=['Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','send','use','compile','sendMail','verify','createTransport','toString'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x2456,0xb2));var _0x6245=function(_0x5ad59c,_0x1f7ad0){_0x5ad59c=_0x5ad59c-0x0;var _0x43ac2c=_0x2456[_0x5ad59c];return _0x43ac2c;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x6245('0x0'));function EmailSmtp(){}EmailSmtp[_0x6245('0x1')][_0x6245('0x2')]=function(_0x492143,_0x26676c){return new Promise(function(_0x477012,_0x2312bf){var _0x341d85=nodemailer['createTransport'](_0x492143);_0x341d85[_0x6245('0x3')](_0x6245('0x4'),inlineBase64());_0x341d85[_0x6245('0x5')](_0x26676c,function(_0x5cdff5,_0x33baf1){if(_0x5cdff5){_0x2312bf(_0x5cdff5['toString']());}else{_0x477012(_0x33baf1);}});});};EmailSmtp[_0x6245('0x1')][_0x6245('0x6')]=function(_0xbe5427){return new Promise(function(_0x3eff58,_0x466b75){var _0x36ce54=nodemailer[_0x6245('0x7')](_0xbe5427);_0x36ce54[_0x6245('0x6')](function(_0x6615f,_0x52e018){if(_0x6615f){_0x466b75(_0x6615f[_0x6245('0x8')]());}else{if(_0x52e018){_0x3eff58(_0x52e018);}else{_0x466b75(_0x6245('0x9'));}}});});};module[_0x6245('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 331bba1..7aaba56 100644 --- a/server/services/email/lib/utils.js +++ b/server/services/email/lib/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafa1=['Data','generateXOAuth2Token','user=','auth=Bearer\x20','base64','lodash','moment','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','generate','head','name','substring','indexOf','length','slice','join','Anonymous','split','isEmpty','anonymous','@xcally.com','html','includes','\x20[Attachment:\x20','body','textAsHtml','replace','Empty\x20message

','Attachments','Title'];(function(_0x5f5c61,_0x1efb7b){var _0x6b498=function(_0x32c92d){while(--_0x32c92d){_0x5f5c61['push'](_0x5f5c61['shift']());}};_0x6b498(++_0x1efb7b);}(_0xafa1,0x131));var _0x1afa=function(_0x3655e5,_0x469eae){_0x3655e5=_0x3655e5-0x0;var _0x37dfac=_0xafa1[_0x3655e5];return _0x37dfac;};'use strict';var _=require(_0x1afa('0x0'));var moment=require(_0x1afa('0x1'));var random=require(_0x1afa('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x1afa('0x3'));var tnef=require(_0x1afa('0x4'));var logger=require(_0x1afa('0x5'))(_0x1afa('0x6'));var config=require(_0x1afa('0x7'));function getAddress(_0x389538){var _0x35175a=_['head'](_0x389538[_0x1afa('0x8')]);return _0x35175a&&_0x35175a[_0x1afa('0x9')]?_0x35175a[_0x1afa('0x9')]:'anonymous'+random[_0x1afa('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x496723){var _0x490d46=_[_0x1afa('0xb')](_0x496723[_0x1afa('0x8')]);if(_0x490d46&&_0x490d46[_0x1afa('0xc')]){if(_0x490d46['name']==_0x490d46[_0x1afa('0x9')]){return _0x490d46[_0x1afa('0xc')][_0x1afa('0xd')](0x0,_0x490d46['name'][_0x1afa('0xe')]('@'));}var _0x7d0fb2=_0x490d46[_0x1afa('0xc')]['split'](/\s+/);return _0x7d0fb2[_0x1afa('0xf')]>0x1?_0x7d0fb2[_0x1afa('0x10')](0x0,-0x1)[_0x1afa('0x11')]('\x20'):_0x490d46[_0x1afa('0xc')];}return _0x1afa('0x12');}function getLastName(_0x4831ea){var _0x2d72b8=_[_0x1afa('0xb')](_0x4831ea['value']);if(_0x2d72b8&&_0x2d72b8['name']){var _0x13f8fa=_0x2d72b8[_0x1afa('0xc')][_0x1afa('0x13')](/\s+/);return _0x13f8fa['length']>0x1?_0x13f8fa['pop']():'';}return'';}function getMails(_0x1ba9ea,_0xffa56e){var _0x4cf5a2='';for(var _0x3474f7=0x0;_0x3474f7<_0xffa56e[_0x1afa('0x8')]['length'];_0x3474f7+=0x1){if(_0xffa56e[_0x1afa('0x8')][_0x3474f7][_0x1afa('0x9')]!==_0x1ba9ea){if(!_[_0x1afa('0x14')](_0x4cf5a2)){_0x4cf5a2+=',';}_0x4cf5a2+=_0xffa56e[_0x1afa('0x8')][_0x3474f7][_0x1afa('0xc')]||_0xffa56e[_0x1afa('0x8')][_0x3474f7][_0x1afa('0x9')]||'';_0x4cf5a2+='\x20<';_0x4cf5a2+=_0xffa56e[_0x1afa('0x8')][_0x3474f7][_0x1afa('0x9')]?_0xffa56e[_0x1afa('0x8')][_0x3474f7]['address']:_0x1afa('0x15')+random['generate'](0x6)+_0x1afa('0x16');_0x4cf5a2+='>';}}return _0x4cf5a2;}function parseEmail(_0x4f9b00,_0x25efe1,_0x2cf208){if(_0x25efe1[_0x1afa('0x17')]){var _0x334e88=/)<[^<]*)*<\/script>/gi;while(_0x334e88['test'](_0x25efe1['html'])){_0x25efe1[_0x1afa('0x17')]=_0x25efe1['html']['replace'](_0x334e88,'');}if(_0x25efe1[_0x1afa('0x17')][_0x1afa('0x18')](_0x1afa('0x19'))){var _0x3a30f1=[];_0x25efe1[_0x1afa('0x1a')][_0x1afa('0x1b')](_0x2b84fc=>{_0x3a30f1[_0x1afa('0x1c')](_0x2b84fc[_0x1afa('0x1d')]);});var _0x2aa178=/]+>/g;var _0x4bdd16=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x160969=_0x25efe1[_0x1afa('0x17')]['replace'](_0x4bdd16,_0x1afa('0x1e'));var _0x3906d3=_0x160969['replace'](_0x2aa178,_0x1afa('0x1f'));for(let _0x5e9a12=0x0;_0x5e9a12<_0x3a30f1[_0x1afa('0xf')];_0x5e9a12++){var _0x2b0ebc=_0x3906d3['replace']('_IMG',_0x1afa('0x20')+_0x3a30f1[_0x5e9a12]+'\x20]');_0x3906d3=_0x2b0ebc;}_0x25efe1[_0x1afa('0x17')]=_0x3906d3;}_0x2cf208[_0x1afa('0x21')]=_0x25efe1['html'];}else{_0x2cf208[_0x1afa('0x21')]=_0x25efe1[_0x1afa('0x22')];}if(_0x2cf208[_0x1afa('0x21')]){_0x2cf208[_0x1afa('0x21')]=_0x2cf208[_0x1afa('0x21')][_0x1afa('0x23')](/0x0){var _0x2f3f0f=[_0x1afa('0x32'),_0x1afa('0x33'),_0x1afa('0x34')];for(var _0xe3deef=0x0;_0xe3deef<_0x25efe1['headerLines'][_0x1afa('0xf')];_0xe3deef++){var _0x335132=_[_0x1afa('0xe')](_0x2f3f0f,_0x25efe1[_0x1afa('0x31')][_0xe3deef][_0x1afa('0x35')]);if(_0x335132>=0x0){_0x2cf208[_0x1afa('0x36')]=!![];}}}return _0x2cf208;}exports[_0x1afa('0x37')]=function(_0x111bd7,_0x14f5c6,_0x19ff33){var _0x19ec33={'from':getAddress(_0x14f5c6[_0x1afa('0x38')]),'firstName':getFirstName(_0x14f5c6[_0x1afa('0x38')]),'lastName':getLastName(_0x14f5c6[_0x1afa('0x38')]),'mapKey':_0x1afa('0x6'),'message':{'from':getMails(_0x111bd7['email'],_0x14f5c6[_0x1afa('0x38')]),'to':_0x111bd7['email'],'cc':'','subject':_0x14f5c6[_0x1afa('0x39')]||'','messageId':_0x14f5c6[_0x1afa('0x3a')],'inReplyTo':_0x14f5c6[_0x1afa('0x3b')],'sentAt':moment(_0x14f5c6[_0x1afa('0x3c')])[_0x1afa('0x2b')](_0x1afa('0x3d')),'attach':![],'attachments':[]}};if(!_0x14f5c6[_0x1afa('0x17')]&&!_0x14f5c6['textAsHtml']){var _0x4ad1e6=_[_0x1afa('0x3e')](_0x14f5c6['attachments'],{'contentType':'application/ms-tnef'});if(_0x4ad1e6[_0x1afa('0xf')]){logger[_0x1afa('0x3f')](util[_0x1afa('0x2b')](_0x1afa('0x40'),_0x14f5c6[_0x1afa('0x3a')]));tnef['parseBuffer'](_[_0x1afa('0x41')](_0x4ad1e6)[_0x1afa('0x2f')],function(_0xc48ba6,_0x563e6d){if(_0x563e6d){_0x14f5c6[_0x1afa('0x17')]=_0x563e6d[_0x1afa('0x42')]||_0x1afa('0x43');if(_0x563e6d[_0x1afa('0x44')]){for(var _0x299061=0x0;_0x299061<_0x563e6d[_0x1afa('0x44')][_0x1afa('0xf')];_0x299061++){var _0xc4bb8e=_0x563e6d['Attachments'][_0x299061];_0x19ec33[_0x1afa('0x25')]['attachments'][_0x1afa('0x1c')]({'filename':_0xc4bb8e[_0x1afa('0x45')],'content':Buffer[_0x1afa('0x38')](_0xc4bb8e[_0x1afa('0x46')])});}}}_0x19ff33(parseEmail(_0x111bd7,_0x14f5c6,_0x19ec33));});}else{_0x14f5c6[_0x1afa('0x17')]=_0x1afa('0x43');_0x19ff33(parseEmail(_0x111bd7,_0x14f5c6,_0x19ec33));}}else{_0x19ff33(parseEmail(_0x111bd7,_0x14f5c6,_0x19ec33));}};exports[_0x1afa('0x47')]=function(_0x4c4c4f,_0x1ce93){var _0xc50a21=[_0x1afa('0x48')+(_0x1ce93||''),_0x1afa('0x49')+_0x4c4c4f,'',''];return Buffer[_0x1afa('0x38')](_0xc50a21['join'](''),'utf-8')['toString'](_0x1afa('0x4a'));}; \ No newline at end of file +var _0x5bbf=['attachment-','format','%s-%s','now','root','writeFileSync','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','parser','from','subject','messageId','inReplyTo','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','content','BodyHTML','

Empty\x20message

','Attachments','Title','generateXOAuth2Token','utf-8','base64','lodash','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','split','length','slice','join','pop','isEmpty','html','test','replace','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originCc','includes','type','attachment'];(function(_0x362c1f,_0x4fccd9){var _0x32bd2a=function(_0xfe09e5){while(--_0xfe09e5){_0x362c1f['push'](_0x362c1f['shift']());}};_0x32bd2a(++_0x4fccd9);}(_0x5bbf,0xa7));var _0xf5bb=function(_0x1ec7aa,_0x2506df){_0x1ec7aa=_0x1ec7aa-0x0;var _0x4bafb7=_0x5bbf[_0x1ec7aa];return _0x4bafb7;};'use strict';var _=require(_0xf5bb('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0xf5bb('0x1'));var util=require(_0xf5bb('0x2'));var tnef=require(_0xf5bb('0x3'));var logger=require(_0xf5bb('0x4'))(_0xf5bb('0x5'));var config=require(_0xf5bb('0x6'));function getAddress(_0x5c5302){var _0x45a88e=_[_0xf5bb('0x7')](_0x5c5302[_0xf5bb('0x8')]);return _0x45a88e&&_0x45a88e['address']?_0x45a88e[_0xf5bb('0x9')]:_0xf5bb('0xa')+random[_0xf5bb('0xb')](0x6)+_0xf5bb('0xc');}function getFirstName(_0x4b2675){var _0x5a5db8=_[_0xf5bb('0x7')](_0x4b2675['value']);if(_0x5a5db8&&_0x5a5db8[_0xf5bb('0xd')]){if(_0x5a5db8[_0xf5bb('0xd')]==_0x5a5db8[_0xf5bb('0x9')]){return _0x5a5db8[_0xf5bb('0xd')]['substring'](0x0,_0x5a5db8[_0xf5bb('0xd')]['indexOf']('@'));}var _0x28d1ba=_0x5a5db8[_0xf5bb('0xd')][_0xf5bb('0xe')](/\s+/);return _0x28d1ba[_0xf5bb('0xf')]>0x1?_0x28d1ba[_0xf5bb('0x10')](0x0,-0x1)[_0xf5bb('0x11')]('\x20'):_0x5a5db8[_0xf5bb('0xd')];}return'Anonymous';}function getLastName(_0x3cbbf5){var _0xbd4900=_[_0xf5bb('0x7')](_0x3cbbf5[_0xf5bb('0x8')]);if(_0xbd4900&&_0xbd4900[_0xf5bb('0xd')]){var _0x1e8c15=_0xbd4900['name'][_0xf5bb('0xe')](/\s+/);return _0x1e8c15[_0xf5bb('0xf')]>0x1?_0x1e8c15[_0xf5bb('0x12')]():'';}return'';}function getMails(_0x6632d6,_0x303bb8){var _0x36162b='';for(var _0x29fe1c=0x0;_0x29fe1c<_0x303bb8['value']['length'];_0x29fe1c+=0x1){if(_0x303bb8[_0xf5bb('0x8')][_0x29fe1c][_0xf5bb('0x9')]!==_0x6632d6){if(!_[_0xf5bb('0x13')](_0x36162b)){_0x36162b+=',';}_0x36162b+=_0x303bb8['value'][_0x29fe1c][_0xf5bb('0xd')]||_0x303bb8[_0xf5bb('0x8')][_0x29fe1c][_0xf5bb('0x9')]||'';_0x36162b+='\x20<';_0x36162b+=_0x303bb8['value'][_0x29fe1c][_0xf5bb('0x9')]?_0x303bb8[_0xf5bb('0x8')][_0x29fe1c][_0xf5bb('0x9')]:'anonymous'+random[_0xf5bb('0xb')](0x6)+_0xf5bb('0xc');_0x36162b+='>';}}return _0x36162b;}function parseEmail(_0x3a09fb,_0x88237d,_0x3f260c){if(_0x88237d[_0xf5bb('0x14')]){var _0x24fff9=/)<[^<]*)*<\/script>/gi;while(_0x24fff9[_0xf5bb('0x15')](_0x88237d[_0xf5bb('0x14')])){_0x88237d['html']=_0x88237d['html'][_0xf5bb('0x16')](_0x24fff9,'');}if(_0x88237d[_0xf5bb('0x14')]['includes'](_0xf5bb('0x17'))){var _0x3bbc94=[];_0x88237d[_0xf5bb('0x18')][_0xf5bb('0x19')](_0x5567f1=>{_0x3bbc94['push'](_0x5567f1[_0xf5bb('0x1a')]);});var _0x34af04=/]+>/g;var _0x1b852d=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4acadd=_0x88237d[_0xf5bb('0x14')][_0xf5bb('0x16')](_0x1b852d,'_SRC');var _0x1131b4=_0x4acadd[_0xf5bb('0x16')](_0x34af04,_0xf5bb('0x1b'));for(let _0x37ecd5=0x0;_0x37ecd5<_0x3bbc94[_0xf5bb('0xf')];_0x37ecd5++){var _0x42dc6a=_0x1131b4[_0xf5bb('0x16')]('_IMG',_0xf5bb('0x1c')+_0x3bbc94[_0x37ecd5]+_0xf5bb('0x1d'));_0x1131b4=_0x42dc6a;}_0x88237d[_0xf5bb('0x14')]=_0x1131b4;}_0x3f260c[_0xf5bb('0x1e')]=_0x88237d['html'];}else{_0x3f260c['body']=_0x88237d[_0xf5bb('0x1f')];}if(_0x3f260c[_0xf5bb('0x1e')]){_0x3f260c[_0xf5bb('0x1e')]=_0x3f260c[_0xf5bb('0x1e')][_0xf5bb('0x16')](/0x0){var _0x2c5f23=[_0xf5bb('0x2e'),_0xf5bb('0x2f'),_0xf5bb('0x30')];for(var _0xec4ea3=0x0;_0xec4ea3<_0x88237d['headerLines'][_0xf5bb('0xf')];_0xec4ea3++){var _0x3c2c24=_['indexOf'](_0x2c5f23,_0x88237d[_0xf5bb('0x2d')][_0xec4ea3][_0xf5bb('0x31')]);if(_0x3c2c24>=0x0){_0x3f260c['isAutoreply']=!![];}}}return _0x3f260c;}exports[_0xf5bb('0x32')]=function(_0x5a7a67,_0x42f9c9,_0x140262){var _0x484cc={'from':getAddress(_0x42f9c9['from']),'firstName':getFirstName(_0x42f9c9['from']),'lastName':getLastName(_0x42f9c9['from']),'mapKey':_0xf5bb('0x5'),'message':{'from':getMails(_0x5a7a67['email'],_0x42f9c9[_0xf5bb('0x33')]),'to':_0x5a7a67[_0xf5bb('0x5')],'cc':'','subject':_0x42f9c9[_0xf5bb('0x34')]||'','messageId':_0x42f9c9[_0xf5bb('0x35')],'inReplyTo':_0x42f9c9[_0xf5bb('0x36')],'sentAt':moment(_0x42f9c9['date'])[_0xf5bb('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x42f9c9[_0xf5bb('0x14')]&&!_0x42f9c9[_0xf5bb('0x1f')]){var _0x3cae01=_[_0xf5bb('0x37')](_0x42f9c9[_0xf5bb('0x18')],{'contentType':_0xf5bb('0x38')});if(_0x3cae01[_0xf5bb('0xf')]){logger[_0xf5bb('0x39')](util['format'](_0xf5bb('0x3a'),_0x42f9c9[_0xf5bb('0x35')]));tnef[_0xf5bb('0x3b')](_['first'](_0x3cae01)[_0xf5bb('0x3c')],function(_0xa4531c,_0xb6e342){if(_0xb6e342){_0x42f9c9['html']=_0xb6e342[_0xf5bb('0x3d')]||_0xf5bb('0x3e');if(_0xb6e342[_0xf5bb('0x3f')]){for(var _0x300ee0=0x0;_0x300ee0<_0xb6e342[_0xf5bb('0x3f')][_0xf5bb('0xf')];_0x300ee0++){var _0x19353a=_0xb6e342[_0xf5bb('0x3f')][_0x300ee0];_0x484cc['message']['attachments'][_0xf5bb('0x2b')]({'filename':_0x19353a[_0xf5bb('0x40')],'content':Buffer['from'](_0x19353a['Data'])});}}}_0x140262(parseEmail(_0x5a7a67,_0x42f9c9,_0x484cc));});}else{_0x42f9c9[_0xf5bb('0x14')]=_0xf5bb('0x3e');_0x140262(parseEmail(_0x5a7a67,_0x42f9c9,_0x484cc));}}else{_0x140262(parseEmail(_0x5a7a67,_0x42f9c9,_0x484cc));}};exports[_0xf5bb('0x41')]=function(_0x3066c1,_0x23e2dd){var _0x29499f=['user='+(_0x23e2dd||''),'auth=Bearer\x20'+_0x3066c1,'',''];return Buffer['from'](_0x29499f[_0xf5bb('0x11')](''),_0xf5bb('0x42'))['toString'](_0xf5bb('0x43'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index d6f83d1..6a51678 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2394=['Smtp','exports','lodash','name','Service','key','SERV','active','Imap'];(function(_0x5de8bf,_0x24e115){var _0x2be3e3=function(_0x385e2c){while(--_0x385e2c){_0x5de8bf['push'](_0x5de8bf['shift']());}};_0x2be3e3(++_0x24e115);}(_0x2394,0x9b));var _0x4239=function(_0x247d12,_0x3fab40){_0x247d12=_0x247d12-0x0;var _0x58ba8b=_0x2394[_0x247d12];return _0x58ba8b;};'use strict';var _=require(_0x4239('0x0'));function MailAccount(_0x18d42b){this['id']=_0x18d42b['id']||0x0;this[_0x4239('0x1')]=_0x18d42b[_0x4239('0x1')]||_0x4239('0x2');this[_0x4239('0x3')]=_0x18d42b[_0x4239('0x3')]||_0x4239('0x4');this[_0x4239('0x5')]=_0x18d42b[_0x4239('0x5')]||![];this[_0x4239('0x6')]=_0x18d42b[_0x4239('0x6')]||[];this[_0x4239('0x7')]=_0x18d42b[_0x4239('0x7')]||[];}module[_0x4239('0x8')]=MailAccount; \ No newline at end of file +var _0x533f=['exports','lodash','name','Service','key','active','Imap','Smtp'];(function(_0x3308bf,_0x38bd97){var _0x440f39=function(_0x5d7597){while(--_0x5d7597){_0x3308bf['push'](_0x3308bf['shift']());}};_0x440f39(++_0x38bd97);}(_0x533f,0xb9));var _0xf533=function(_0x77773a,_0x5a7026){_0x77773a=_0x77773a-0x0;var _0x1091a2=_0x533f[_0x77773a];return _0x1091a2;};'use strict';var _=require(_0xf533('0x0'));function MailAccount(_0x54a865){this['id']=_0x54a865['id']||0x0;this[_0xf533('0x1')]=_0x54a865['name']||_0xf533('0x2');this[_0xf533('0x3')]=_0x54a865[_0xf533('0x3')]||'SERV';this[_0xf533('0x4')]=_0x54a865[_0xf533('0x4')]||![];this[_0xf533('0x5')]=_0x54a865[_0xf533('0x5')]||[];this[_0xf533('0x6')]=_0x54a865[_0xf533('0x6')]||[];}module[_0xf533('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index cfbeef2..eddf524 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa0d7=['mergeFromDatabase','hasOwnProperty','prototype','initMailAccounts','mailAccounts','length','isUndefined','merge','exports','../model/mailAccount','mapKeys'];(function(_0x5da21e,_0x1232cd){var _0x4cb5a4=function(_0x1775d6){while(--_0x1775d6){_0x5da21e['push'](_0x5da21e['shift']());}};_0x4cb5a4(++_0x1232cd);}(_0xa0d7,0x132));var _0x7a0d=function(_0x460249,_0x3bde68){_0x460249=_0x460249-0x0;var _0x3c5ca2=_0xa0d7[_0x460249];return _0x3c5ca2;};'use strict';var _=require('lodash');var MailAccount=require(_0x7a0d('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0xde73fa,_0x35f19d,_0x3e6a33){var _0x3b9d7b=_[_0x7a0d('0x1')](_0xde73fa,function(_0x7237a2,_0x1644e7){return _0x7237a2[_0x3e6a33];});for(var _0x3f4331 in _0x35f19d){if(_0x35f19d['hasOwnProperty'](_0x3f4331)){if(!_0x3b9d7b[_0x3f4331]){delete _0x35f19d[_0x3f4331];}}}}Realtime['prototype'][_0x7a0d('0x2')]=function(_0x42966d,_0x306220){for(var _0x54a3b0 in _0x306220){if(_0x42966d[_0x7a0d('0x3')](_0x54a3b0)){_0x42966d[_0x54a3b0]=_0x306220[_0x54a3b0];}}};Realtime[_0x7a0d('0x4')][_0x7a0d('0x5')]=function(){var _0xc6a8db=this;return function(_0x215070){if(_0x215070){freeIsNotKey(_0x215070,_0xc6a8db[_0x7a0d('0x6')],'id');for(var _0x2aa1be=0x0,_0xaed9ba={},_0x2bb7e8={};_0x2aa1be<_0x215070[_0x7a0d('0x7')];_0x2aa1be+=0x1){_0xaed9ba=_0x215070[_0x2aa1be];if(_[_0x7a0d('0x8')](_0xc6a8db['mailAccounts'][_0xaed9ba['id']])){_0xc6a8db[_0x7a0d('0x6')][_0xaed9ba['id']]=new MailAccount(_0xaed9ba);}else{_[_0x7a0d('0x9')](_0xc6a8db['mailAccounts'][_0xaed9ba['id']],_0xaed9ba);}}}return _0xc6a8db['mailAccounts'];};};module[_0x7a0d('0xa')]=Realtime; \ No newline at end of file +var _0xcbb9=['exports','lodash','../model/mailAccount','mailAccounts','hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts','length','isUndefined','merge'];(function(_0x35c150,_0x4c91fa){var _0x1d1012=function(_0x3aeb02){while(--_0x3aeb02){_0x35c150['push'](_0x35c150['shift']());}};_0x1d1012(++_0x4c91fa);}(_0xcbb9,0xb1));var _0x9cbb=function(_0x488bb5,_0x54ad83){_0x488bb5=_0x488bb5-0x0;var _0x9ab55=_0xcbb9[_0x488bb5];return _0x9ab55;};'use strict';var _=require(_0x9cbb('0x0'));var MailAccount=require(_0x9cbb('0x1'));var Realtime=function(){this[_0x9cbb('0x2')]={};};function freeIsNotKey(_0x21591f,_0x44d760,_0x757168){var _0x183a08=_['mapKeys'](_0x21591f,function(_0x4df319,_0x4cbcdb){return _0x4df319[_0x757168];});for(var _0x5c4bf5 in _0x44d760){if(_0x44d760[_0x9cbb('0x3')](_0x5c4bf5)){if(!_0x183a08[_0x5c4bf5]){delete _0x44d760[_0x5c4bf5];}}}}Realtime['prototype'][_0x9cbb('0x4')]=function(_0x19ece8,_0x30b838){for(var _0x1e629e in _0x30b838){if(_0x19ece8['hasOwnProperty'](_0x1e629e)){_0x19ece8[_0x1e629e]=_0x30b838[_0x1e629e];}}};Realtime[_0x9cbb('0x5')][_0x9cbb('0x6')]=function(){var _0x487de8=this;return function(_0x4e64df){if(_0x4e64df){freeIsNotKey(_0x4e64df,_0x487de8[_0x9cbb('0x2')],'id');for(var _0x5df4a4=0x0,_0x45396b={},_0x296b51={};_0x5df4a4<_0x4e64df[_0x9cbb('0x7')];_0x5df4a4+=0x1){_0x45396b=_0x4e64df[_0x5df4a4];if(_[_0x9cbb('0x8')](_0x487de8[_0x9cbb('0x2')][_0x45396b['id']])){_0x487de8[_0x9cbb('0x2')][_0x45396b['id']]=new MailAccount(_0x45396b);}else{_[_0x9cbb('0x9')](_0x487de8['mailAccounts'][_0x45396b['id']],_0x45396b);}}}return _0x487de8['mailAccounts'];};};module[_0x9cbb('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 7b010c8..e2df5af 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcddb=['data5','Smtp','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','provider','email','active','key','ListId','MailServerIn','CloudProvider','name','type'];(function(_0x3f5f3f,_0x42ef6e){var _0x281375=function(_0xa2bb4b){while(--_0xa2bb4b){_0x3f5f3f['push'](_0x3f5f3f['shift']());}};_0x281375(++_0x42ef6e);}(_0xcddb,0x1c4));var _0xbcdd=function(_0x16d2ae,_0x51822d){_0x16d2ae=_0x16d2ae-0x0;var _0x36be4b=_0xcddb[_0x16d2ae];return _0x36be4b;};'use strict';var client=require(_0xbcdd('0x0'));exports[_0xbcdd('0x1')]=function(){return function(){return client[_0xbcdd('0x2')]('GetMailAccount',{'options':{'attributes':['id','name',_0xbcdd('0x3'),'service',_0xbcdd('0x4'),_0xbcdd('0x5'),_0xbcdd('0x6'),_0xbcdd('0x7'),'TemplateId'],'raw':![],'include':[{'model':_0xbcdd('0x8'),'as':'Imap','include':[{'model':_0xbcdd('0x9'),'attributes':['id',_0xbcdd('0xa'),'service',_0xbcdd('0xb'),_0xbcdd('0xc')],'as':'CloudProvider'}]},{'model':'MailServerOut','as':_0xbcdd('0xd'),'include':[{'model':_0xbcdd('0x9'),'attributes':['id',_0xbcdd('0xa'),'service',_0xbcdd('0xb'),_0xbcdd('0xc')],'as':_0xbcdd('0x9')}]}]},'log':_0xbcdd('0xe')});};};exports['notify']=function(_0x322402,_0x18673c){return client['Request'](_0xbcdd('0xf'),{'account':{'id':_0x322402},'body':_0x18673c,'log':_0xbcdd('0xf')});}; \ No newline at end of file +var _0x5902=['../client','Request','GetMailAccount','provider','service','active','key','ListId','TemplateId','Imap','CloudProvider','name','type','data5','MailServerOut','getMailAccount','NotifyMailAccount'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x5902,0x187));var _0x2590=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5902[_0x19950b];return _0x3c6b41;};'use strict';var client=require(_0x2590('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x2590('0x1')](_0x2590('0x2'),{'options':{'attributes':['id','name',_0x2590('0x3'),_0x2590('0x4'),'email',_0x2590('0x5'),_0x2590('0x6'),_0x2590('0x7'),_0x2590('0x8')],'raw':![],'include':[{'model':'MailServerIn','as':_0x2590('0x9'),'include':[{'model':_0x2590('0xa'),'attributes':['id',_0x2590('0xb'),_0x2590('0x4'),_0x2590('0xc'),_0x2590('0xd')],'as':_0x2590('0xa')}]},{'model':_0x2590('0xe'),'as':'Smtp','include':[{'model':_0x2590('0xa'),'attributes':['id',_0x2590('0xb'),_0x2590('0x4'),_0x2590('0xc'),_0x2590('0xd')],'as':_0x2590('0xa')}]}]},'log':_0x2590('0xf')});};};exports['notify']=function(_0x5d271c,_0x4d7eea){return client[_0x2590('0x1')]('NotifyMailAccount',{'account':{'id':_0x5d271c},'body':_0x4d7eea,'log':_0x2590('0x10')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index e46caf0..8ae12b5 100644 --- a/server/services/email/rpc/setting.js +++ b/server/services/email/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd319=['GetSettings','../client','getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x43952a,_0x5545a1){var _0x1aba6d=function(_0x36f35c){while(--_0x36f35c){_0x43952a['push'](_0x43952a['shift']());}};_0x1aba6d(++_0x5545a1);}(_0xd319,0x9d));var _0x9d31=function(_0x434cfb,_0x5e5296){_0x434cfb=_0x434cfb-0x0;var _0x1195ba=_0xd319[_0x434cfb];return _0x1195ba;};'use strict';var client=require(_0x9d31('0x0'));exports[_0x9d31('0x1')]=function(){return client[_0x9d31('0x2')](_0x9d31('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9d31('0x4')]},'log':_0x9d31('0x5')});}; \ No newline at end of file +var _0xdb95=['loginMailFrequency','../client','getSettings','Request','ShowSetting'];(function(_0xdd17cc,_0x1f1938){var _0x5d19aa=function(_0x450e18){while(--_0x450e18){_0xdd17cc['push'](_0xdd17cc['shift']());}};_0x5d19aa(++_0x1f1938);}(_0xdb95,0x8d));var _0x5db9=function(_0x161bb1,_0x2504ba){_0x161bb1=_0x161bb1-0x0;var _0xac3af0=_0xdb95[_0x161bb1];return _0xac3af0;};'use strict';var client=require(_0x5db9('0x0'));exports[_0x5db9('0x1')]=function(){return client[_0x5db9('0x2')](_0x5db9('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5db9('0x4')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 8d091a4..8ef85a8 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 644236a..00dfef3 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb3f9=['port','socket.io','defaults','redis','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','log','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','timeout'];(function(_0x9e5a50,_0x5616a1){var _0x34dc04=function(_0x1cc3f4){while(--_0x1cc3f4){_0x9e5a50['push'](_0x9e5a50['shift']());}};_0x34dc04(++_0x5616a1);}(_0xb3f9,0xcb));var _0x9b3f=function(_0x5104a9,_0x37a551){_0x5104a9=_0x5104a9-0x0;var _0x221781=_0xb3f9[_0x5104a9];return _0x221781;};'use strict';var _=require(_0x9b3f('0x0'));var http=require(_0x9b3f('0x1'));var express=require(_0x9b3f('0x2'));var sticky=require(_0x9b3f('0x3'));var Redis=require(_0x9b3f('0x4'));var config=require(_0x9b3f('0x5'));var app=express();var server=http['createServer'](app);server[_0x9b3f('0x6')]=0xdbba0;if(sticky['listen'](server,config[_0x9b3f('0x7')])){var socketio=require(_0x9b3f('0x8'))(server,{'transports':['websocket','polling']});config['redis']=_[_0x9b3f('0x9')](config[_0x9b3f('0xa')],{'host':'localhost','port':0x18eb});socketio[_0x9b3f('0xb')](require(_0x9b3f('0xc'))({'pubClient':new Redis(config[_0x9b3f('0xa')]),'subClient':new Redis(config['redis'])}));require(_0x9b3f('0xd'))[_0x9b3f('0xe')]();require(_0x9b3f('0xf'))['default'](socketio);require(_0x9b3f('0x10'))['default'](app);require(_0x9b3f('0x11'))[_0x9b3f('0xe')](app);}else{server[_0x9b3f('0x12')]('listening',function(){console[_0x9b3f('0x13')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x9b3f('0x7')]);});}exports=module[_0x9b3f('0x14')]=app; \ No newline at end of file +var _0x8fe0=['adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','websocket','redis','defaults','localhost'];(function(_0x411f48,_0x585478){var _0x178024=function(_0x42efdc){while(--_0x42efdc){_0x411f48['push'](_0x411f48['shift']());}};_0x178024(++_0x585478);}(_0x8fe0,0x12a));var _0x08fe=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8fe0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x08fe('0x0'));var http=require(_0x08fe('0x1'));var express=require(_0x08fe('0x2'));var sticky=require(_0x08fe('0x3'));var Redis=require(_0x08fe('0x4'));var config=require(_0x08fe('0x5'));var app=express();var server=http[_0x08fe('0x6')](app);server[_0x08fe('0x7')]=0xdbba0;if(sticky[_0x08fe('0x8')](server,config[_0x08fe('0x9')])){var socketio=require('socket.io')(server,{'transports':[_0x08fe('0xa'),'polling']});config[_0x08fe('0xb')]=_[_0x08fe('0xc')](config['redis'],{'host':_0x08fe('0xd'),'port':0x18eb});socketio[_0x08fe('0xe')](require(_0x08fe('0xf'))({'pubClient':new Redis(config[_0x08fe('0xb')]),'subClient':new Redis(config[_0x08fe('0xb')])}));require(_0x08fe('0x10'))[_0x08fe('0x11')]();require(_0x08fe('0x12'))[_0x08fe('0x11')](socketio);require(_0x08fe('0x13'))['default'](app);require(_0x08fe('0x14'))[_0x08fe('0x11')](app);}else{server[_0x08fe('0x15')](_0x08fe('0x16'),function(){console[_0x08fe('0x17')](_0x08fe('0x18'),config[_0x08fe('0x9')]);});}exports=module[_0x08fe('0x19')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 86c374c..91783e4 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10b7=['jayson/promise','bluebird','../../config/logger','client','http','Request','then','routing','error','rpc','message','catch','exports'];(function(_0x1c0a54,_0xea4f1a){var _0x196a31=function(_0x44ca5a){while(--_0x44ca5a){_0x1c0a54['push'](_0x1c0a54['shift']());}};_0x196a31(++_0xea4f1a);}(_0x10b7,0x145));var _0x710b=function(_0x2ec0f6,_0x42e247){_0x2ec0f6=_0x2ec0f6-0x0;var _0x11e9c9=_0x10b7[_0x2ec0f6];return _0x11e9c9;};'use strict';var jayson=require(_0x710b('0x0'));var BPromise=require(_0x710b('0x1'));var logger=require(_0x710b('0x2'))('routing');var client=jayson[_0x710b('0x3')][_0x710b('0x4')]({'port':0x2329});client[_0x710b('0x5')]=function(_0x1a6981,_0x4fa8ab){return new BPromise(function(_0x3bce20,_0x2d1749){return client['request'](_0x1a6981,_0x4fa8ab)[_0x710b('0x6')](function(_0x53ee4f){logger['debug']('rpc',_0x710b('0x7'),_0x1a6981,_0x4fa8ab,_0x53ee4f);if(_0x53ee4f[_0x710b('0x8')]){logger['error'](_0x710b('0x9'),'routing',_0x1a6981,_0x53ee4f[_0x710b('0x8')][_0x710b('0xa')],_0x4fa8ab);return _0x2d1749(_0x53ee4f['error']['message']);}else{return _0x3bce20(_0x53ee4f['result']);}})[_0x710b('0xb')](function(_0x582590){logger[_0x710b('0x8')]('rpc',_0x710b('0x7'),_0x1a6981,_0x582590,_0x4fa8ab);return _0x2d1749(_0x582590);});});};module[_0x710b('0xc')]=client; \ No newline at end of file +var _0x1062=['../../config/logger','routing','client','http','Request','then','debug','error','rpc','message','catch','exports','jayson/promise'];(function(_0x13e298,_0x593c98){var _0x57ed4a=function(_0x516c21){while(--_0x516c21){_0x13e298['push'](_0x13e298['shift']());}};_0x57ed4a(++_0x593c98);}(_0x1062,0x1ac));var _0x2106=function(_0x3eecc0,_0x14fa1a){_0x3eecc0=_0x3eecc0-0x0;var _0x92d7b2=_0x1062[_0x3eecc0];return _0x92d7b2;};'use strict';var jayson=require(_0x2106('0x0'));var BPromise=require('bluebird');var logger=require(_0x2106('0x1'))(_0x2106('0x2'));var client=jayson[_0x2106('0x3')][_0x2106('0x4')]({'port':0x2329});client[_0x2106('0x5')]=function(_0x152634,_0x10c2d4){return new BPromise(function(_0xbd2a22,_0x103e31){return client['request'](_0x152634,_0x10c2d4)[_0x2106('0x6')](function(_0x143b4d){logger[_0x2106('0x7')]('rpc',_0x2106('0x2'),_0x152634,_0x10c2d4,_0x143b4d);if(_0x143b4d['error']){logger[_0x2106('0x8')](_0x2106('0x9'),_0x2106('0x2'),_0x152634,_0x143b4d[_0x2106('0x8')][_0x2106('0xa')],_0x10c2d4);return _0x103e31(_0x143b4d[_0x2106('0x8')][_0x2106('0xa')]);}else{return _0xbd2a22(_0x143b4d['result']);}})[_0x2106('0xb')](function(_0x22ad6c){logger[_0x2106('0x8')](_0x2106('0x9'),_0x2106('0x2'),_0x152634,_0x22ad6c,_0x10c2d4);return _0x103e31(_0x22ad6c);});});};module[_0x2106('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 3765f77..c775a60 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5297=['./realtime','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','getAgents','initAgents','then','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','log','bluebird','./server'];(function(_0x4177,_0x175496){var _0x3a8b47=function(_0x1c11d6){while(--_0x1c11d6){_0x4177['push'](_0x4177['shift']());}};_0x3a8b47(++_0x175496);}(_0x5297,0x136));var _0x7529=function(_0x13a700,_0x88c174){_0x13a700=_0x13a700-0x0;var _0x3f0dc7=_0x5297[_0x13a700];return _0x3f0dc7;};'use strict';var BPromise=require(_0x7529('0x0'));var server=require(_0x7529('0x1'));var Realtime=require(_0x7529('0x2'));var user=require('./rpc/user');var interval=require('./rpc/interval');var openchannelQueue=require(_0x7529('0x3'));var chatQueue=require(_0x7529('0x4'));var smsQueue=require(_0x7529('0x5'));var mailQueue=require(_0x7529('0x6'));var faxQueue=require(_0x7529('0x7'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x7529('0x8')]()['then'](user[_0x7529('0x9')]())['then'](realtime[_0x7529('0xa')]())[_0x7529('0xb')](interval[_0x7529('0xc')]())[_0x7529('0xb')](realtime[_0x7529('0xd')]())[_0x7529('0xb')](openchannelQueue[_0x7529('0xe')]())[_0x7529('0xb')](realtime['initOpenchannelQueues']())[_0x7529('0xb')](chatQueue[_0x7529('0xf')]())[_0x7529('0xb')](realtime[_0x7529('0x10')]())[_0x7529('0xb')](smsQueue[_0x7529('0x11')]())[_0x7529('0xb')](realtime[_0x7529('0x12')]())[_0x7529('0xb')](mailQueue['getMailQueues']())[_0x7529('0xb')](realtime[_0x7529('0x13')]())[_0x7529('0xb')](faxQueue[_0x7529('0x14')]())[_0x7529('0xb')](realtime[_0x7529('0x15')]())['then'](whatsappQueue[_0x7529('0x16')]())[_0x7529('0xb')](realtime[_0x7529('0x17')]())[_0x7529('0xb')](function(){return realtime;});}function main(){return server[_0x7529('0x18')](realtime)[_0x7529('0xb')](function(_0x5e0f13){return initRealtime();})[_0x7529('0xb')](function(_0x35d81c){return setInterval(initRealtime,0x1388);})['catch'](function(_0x3cd06c){console[_0x7529('0x19')](_0x3cd06c);});}main(); \ No newline at end of file +var _0x60bf=['./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','getFaxQueues','log','bluebird','./server'];(function(_0x255a60,_0x249d07){var _0x4ec257=function(_0x100c74){while(--_0x100c74){_0x255a60['push'](_0x255a60['shift']());}};_0x4ec257(++_0x249d07);}(_0x60bf,0x19c));var _0xf60b=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x60bf[_0x187ee1];return _0x388160;};'use strict';var BPromise=require(_0xf60b('0x0'));var server=require(_0xf60b('0x1'));var Realtime=require(_0xf60b('0x2'));var user=require('./rpc/user');var interval=require(_0xf60b('0x3'));var openchannelQueue=require(_0xf60b('0x4'));var chatQueue=require(_0xf60b('0x5'));var smsQueue=require(_0xf60b('0x6'));var mailQueue=require(_0xf60b('0x7'));var faxQueue=require(_0xf60b('0x8'));var whatsappQueue=require(_0xf60b('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xf60b('0xa')]()[_0xf60b('0xb')](user[_0xf60b('0xc')]())[_0xf60b('0xb')](realtime[_0xf60b('0xd')]())['then'](interval[_0xf60b('0xe')]())['then'](realtime[_0xf60b('0xf')]())[_0xf60b('0xb')](openchannelQueue[_0xf60b('0x10')]())[_0xf60b('0xb')](realtime['initOpenchannelQueues']())[_0xf60b('0xb')](chatQueue[_0xf60b('0x11')]())[_0xf60b('0xb')](realtime[_0xf60b('0x12')]())[_0xf60b('0xb')](smsQueue[_0xf60b('0x13')]())[_0xf60b('0xb')](realtime['initSmsQueues']())[_0xf60b('0xb')](mailQueue[_0xf60b('0x14')]())[_0xf60b('0xb')](realtime['initMailQueues']())['then'](faxQueue[_0xf60b('0x15')]())['then'](realtime['initFaxQueues']())[_0xf60b('0xb')](whatsappQueue['getWhatsappQueues']())['then'](realtime['initWhatsappQueues']())[_0xf60b('0xb')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0xf60b('0xb')](function(_0x19d510){return initRealtime();})[_0xf60b('0xb')](function(_0x5c09cb){return setInterval(initRealtime,0x1388);})['catch'](function(_0x1577f1){console[_0xf60b('0x16')](_0x1577f1);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index a886a3f..702f419 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x454892,_0x3343c1){var _0x100541=function(_0x1591fa){while(--_0x1591fa){_0x454892['push'](_0x454892['shift']());}};_0x100541(++_0x3343c1);}(_0x2ef3,0xba));var _0x32ef=function(_0x472aed,_0x641cbb){_0x472aed=_0x472aed-0x0;var _0x3514bd=_0x2ef3[_0x472aed];return _0x3514bd;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine; \ No newline at end of file +var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x5b1bec,_0x4b6efc){var _0x503e12=function(_0x436d52){while(--_0x436d52){_0x5b1bec['push'](_0x5b1bec['shift']());}};_0x503e12(++_0x4b6efc);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc4aa[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 1ea5c8e..eaba157 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0834=['then','error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','http','request'];(function(_0x407d81,_0x2a45ca){var _0x8ceae2=function(_0x254878){while(--_0x254878){_0x407d81['push'](_0x407d81['shift']());}};_0x8ceae2(++_0x2a45ca);}(_0x0834,0xee));var _0x4083=function(_0x503074,_0x36497f){_0x503074=_0x503074-0x0;var _0x1a292c=_0x0834[_0x503074];return _0x1a292c;};'use strict';var BPromise=require(_0x4083('0x0'));var jayson=require(_0x4083('0x1'));var client=jayson['client'][_0x4083('0x2')]({'port':0x232b});function request(_0x2dbfda,_0x42f15d){return new BPromise(function(_0x2f2401,_0x38b4e3){return client[_0x4083('0x3')](_0x2dbfda,_0x42f15d)[_0x4083('0x4')](function(_0x3dbb90){if(_0x3dbb90[_0x4083('0x5')]){return _0x38b4e3(_0x3dbb90[_0x4083('0x5')][_0x4083('0x6')]);}else{return _0x2f2401(_0x3dbb90[_0x4083('0x7')]);}})[_0x4083('0x8')](function(_0x78f4e){return _0x38b4e3(_0x78f4e);});});}exports[_0x4083('0x9')]=function(_0x1bce09,_0xc565c3){return request(_0x4083('0xa'),{'account':_0x1bce09,'message':_0xc565c3});}; \ No newline at end of file +var _0x0212=['request','then','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http'];(function(_0x49c68e,_0x1c1673){var _0x33032b=function(_0x42ac31){while(--_0x42ac31){_0x49c68e['push'](_0x49c68e['shift']());}};_0x33032b(++_0x1c1673);}(_0x0212,0x1b4));var _0x2021=function(_0x2641a8,_0x314bac){_0x2641a8=_0x2641a8-0x0;var _0x1f1ad3=_0x0212[_0x2641a8];return _0x1f1ad3;};'use strict';var BPromise=require(_0x2021('0x0'));var jayson=require(_0x2021('0x1'));var client=jayson[_0x2021('0x2')][_0x2021('0x3')]({'port':0x232b});function request(_0xf93f84,_0x2341f6){return new BPromise(function(_0x38d2f4,_0x709169){return client[_0x2021('0x4')](_0xf93f84,_0x2341f6)[_0x2021('0x5')](function(_0x366a96){if(_0x366a96['error']){return _0x709169(_0x366a96['error'][_0x2021('0x6')]);}else{return _0x38d2f4(_0x366a96[_0x2021('0x7')]);}})[_0x2021('0x8')](function(_0x138b80){return _0x709169(_0x138b80);});});}exports[_0x2021('0x9')]=function(_0x228195,_0x5d5a7b){return request(_0x2021('0xa'),{'account':_0x228195,'message':_0x5d5a7b});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index ac0ae66..9213e1f 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d95=['chatWaitingInteractions','faxWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','idle','mail','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','format','online','chatCurrentCapacity','mailStatusTime','whatsappStatusTime','whatsappCurrentCapacity','mailWaitingInteractions','stringify','emit','user:routing:update','omit','exports','md5','moment','ioredis','../../../config/environment','redis','defaults','localhost','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue'];(function(_0x589ac8,_0x10ac6e){var _0x1bb5dc=function(_0x7a6239){while(--_0x7a6239){_0x589ac8['push'](_0x589ac8['shift']());}};_0x1bb5dc(++_0x10ac6e);}(_0x0d95,0x16e));var _0x50d9=function(_0x300c0c,_0x205329){_0x300c0c=_0x300c0c-0x0;var _0x293af0=_0x0d95[_0x300c0c];return _0x293af0;};'use strict';var _=require('lodash');var md5=require(_0x50d9('0x0'));var moment=require(_0x50d9('0x1'));var Redis=require(_0x50d9('0x2'));var config=require(_0x50d9('0x3'));config[_0x50d9('0x4')]=_[_0x50d9('0x5')](config['redis'],{'host':_0x50d9('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x50d9('0x4')]));function Agent(_0x3d97ee){this['id']=_0x3d97ee['id']||0x0;this[_0x50d9('0x7')]=_0x3d97ee[_0x50d9('0x7')]||'';this[_0x50d9('0x8')]=_0x3d97ee[_0x50d9('0x8')]||![];this[_0x50d9('0x9')]=_0x3d97ee[_0x50d9('0x9')]||![];this[_0x50d9('0xa')]=_0x3d97ee[_0x50d9('0xa')]||![];this[_0x50d9('0xb')]=_0x3d97ee[_0x50d9('0xb')]||![];this[_0x50d9('0xc')]=_0x3d97ee['smsPause']||![];this[_0x50d9('0xd')]=_0x3d97ee[_0x50d9('0xd')]||![];this[_0x50d9('0xe')]=_0x50d9('0xf');this['chatStatusTime']=0x0;this['chatCapacity']=_0x3d97ee[_0x50d9('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x50d9('0x11')]=_0x50d9('0xf');this['mailStatusTime']=0x0;this[_0x50d9('0x12')]=_0x3d97ee['mailCapacity']||0x0;this[_0x50d9('0x13')]=0x0;this[_0x50d9('0x14')]=_0x50d9('0xf');this[_0x50d9('0x15')]=0x0;this['faxCapacity']=_0x3d97ee[_0x50d9('0x16')]||0x0;this[_0x50d9('0x17')]=0x0;this[_0x50d9('0x18')]=_0x50d9('0xf');this[_0x50d9('0x19')]=0x0;this[_0x50d9('0x1a')]=_0x3d97ee[_0x50d9('0x1a')]||0x0;this[_0x50d9('0x1b')]=0x0;this[_0x50d9('0x1c')]='unknown';this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x3d97ee[_0x50d9('0x1d')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x50d9('0x1e')]='unknown';this[_0x50d9('0x1f')]=0x0;this[_0x50d9('0x20')]=_0x3d97ee[_0x50d9('0x20')]||0x0;this[_0x50d9('0x21')]=0x0;this[_0x50d9('0x22')]=![];this[_0x50d9('0x23')]=undefined;this[_0x50d9('0x0')]='';this[_0x50d9('0x24')]={};this[_0x50d9('0x25')]={};this['mailWaitingInteractions']={};this['openchannelWaitingInteractions']={};this[_0x50d9('0x26')]={};this[_0x50d9('0x27')]={};this[_0x50d9('0x28')]();}Agent[_0x50d9('0x29')][_0x50d9('0x2a')]=function(_0x49d766){if(this[_0x49d766+_0x50d9('0x2b')]>0x0){if(this[_0x49d766+_0x50d9('0x2c')]>0x0&&this[_0x49d766+_0x50d9('0x2b')]>=this[_0x49d766+_0x50d9('0x2c')]){return'maxcapacity';}else{return'working';}}else{return _0x50d9('0x2d');}};Agent[_0x50d9('0x29')][_0x50d9('0x28')]=function(){var _0x1d0362=[_0x50d9('0x2e'),_0x50d9('0x2f'),_0x50d9('0x30'),_0x50d9('0x31'),_0x50d9('0x32'),_0x50d9('0x33')];for(var _0x300a17=0x0;_0x300a17<_0x1d0362[_0x50d9('0x34')];_0x300a17+=0x1){var _0x14e9fe=this[_0x50d9('0x2a')](_0x1d0362[_0x300a17]);if(this[_0x1d0362[_0x300a17]+_0x50d9('0x35')]!==_0x14e9fe){this[_0x1d0362[_0x300a17]+_0x50d9('0x36')]=_['toNumber'](moment()[_0x50d9('0x37')]('x'));}this[_0x1d0362[_0x300a17]+_0x50d9('0x35')]=_0x14e9fe;}var _0x529a35={'id':this['id'],'name':this[_0x50d9('0x7')],'online':this[_0x50d9('0x38')],'voicePause':this[_0x50d9('0x8')],'chatPause':this[_0x50d9('0x9')],'mailPause':this[_0x50d9('0xa')],'smsPause':this[_0x50d9('0xc')],'faxPause':this[_0x50d9('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x50d9('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x50d9('0x39')],'mailStatus':this[_0x50d9('0x11')],'mailStatusTime':this[_0x50d9('0x3a')],'mailCapacity':this[_0x50d9('0x12')],'mailCurrentCapacity':this[_0x50d9('0x13')],'faxStatus':this[_0x50d9('0x14')],'faxStatusTime':this[_0x50d9('0x15')],'faxCapacity':this[_0x50d9('0x16')],'faxCurrentCapacity':this[_0x50d9('0x17')],'smsStatus':this[_0x50d9('0x18')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x50d9('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x50d9('0x1c')],'whatsappStatusTime':this[_0x50d9('0x3b')],'whatsappCapacity':this[_0x50d9('0x1d')],'whatsappCurrentCapacity':this[_0x50d9('0x3c')],'openchannelStatus':this[_0x50d9('0x1e')],'openchannelStatusTime':this[_0x50d9('0x1f')],'openchannelCapacity':this[_0x50d9('0x20')],'openchannelCurrentCapacity':this[_0x50d9('0x21')],'busy':this[_0x50d9('0x22')],'busyQueue':this[_0x50d9('0x23')],'chatWaitingInteractions':this[_0x50d9('0x24')],'faxWaitingInteractions':this[_0x50d9('0x25')],'mailWaitingInteractions':this[_0x50d9('0x3d')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x50d9('0x26')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x18cdd9=md5(JSON[_0x50d9('0x3e')](_0x529a35));if(this['md5']!==_0x18cdd9){this['md5']=_0x18cdd9;io[_0x50d9('0x3f')](_0x50d9('0x40'),_[_0x50d9('0x41')](_0x529a35,[_0x50d9('0x38')]));}};module[_0x50d9('0x42')]=Agent; \ No newline at end of file +var _0xacf4=['openchannelCurrentCapacity','busy','busyQueue','md5','faxWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','updateRealtime','mail','chat','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatPause','chatStatus','smsStatus','smsCurrentCapacity','stringify','emit','user:routing:update','omit','exports','moment','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','mailPause','faxPause','smsPause','openchannelPause','chatStatusTime','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity'];(function(_0x4b35ce,_0x4f1e65){var _0x5e5879=function(_0x9ef94){while(--_0x9ef94){_0x4b35ce['push'](_0x4b35ce['shift']());}};_0x5e5879(++_0x4f1e65);}(_0xacf4,0xe7));var _0x4acf=function(_0x20b47d,_0x2b5e1f){_0x20b47d=_0x20b47d-0x0;var _0x58df38=_0xacf4[_0x20b47d];return _0x58df38;};'use strict';var _=require('lodash');var md5=require('md5');var moment=require(_0x4acf('0x0'));var Redis=require(_0x4acf('0x1'));var config=require(_0x4acf('0x2'));config[_0x4acf('0x3')]=_[_0x4acf('0x4')](config[_0x4acf('0x3')],{'host':_0x4acf('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4acf('0x3')]));function Agent(_0x2124c8){this['id']=_0x2124c8['id']||0x0;this['name']=_0x2124c8[_0x4acf('0x6')]||'';this[_0x4acf('0x7')]=_0x2124c8[_0x4acf('0x7')]||!![];this[_0x4acf('0x8')]=_0x2124c8[_0x4acf('0x8')]||![];this['chatPause']=_0x2124c8['chatPause']||![];this[_0x4acf('0x9')]=_0x2124c8['mailPause']||![];this[_0x4acf('0xa')]=_0x2124c8[_0x4acf('0xa')]||![];this[_0x4acf('0xb')]=_0x2124c8['smsPause']||![];this[_0x4acf('0xc')]=_0x2124c8[_0x4acf('0xc')]||![];this['chatStatus']='unknown';this[_0x4acf('0xd')]=0x0;this['chatCapacity']=_0x2124c8['chatCapacity']||0x0;this[_0x4acf('0xe')]=0x0;this[_0x4acf('0xf')]=_0x4acf('0x10');this[_0x4acf('0x11')]=0x0;this[_0x4acf('0x12')]=_0x2124c8[_0x4acf('0x12')]||0x0;this[_0x4acf('0x13')]=0x0;this[_0x4acf('0x14')]=_0x4acf('0x10');this[_0x4acf('0x15')]=0x0;this[_0x4acf('0x16')]=_0x2124c8['faxCapacity']||0x0;this[_0x4acf('0x17')]=0x0;this['smsStatus']=_0x4acf('0x10');this[_0x4acf('0x18')]=0x0;this[_0x4acf('0x19')]=_0x2124c8['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0x4acf('0x1a')]=_0x4acf('0x10');this[_0x4acf('0x1b')]=0x0;this['whatsappCapacity']=_0x2124c8[_0x4acf('0x1c')]||0x0;this[_0x4acf('0x1d')]=0x0;this[_0x4acf('0x1e')]=_0x4acf('0x10');this[_0x4acf('0x1f')]=0x0;this[_0x4acf('0x20')]=_0x2124c8[_0x4acf('0x20')]||0x0;this[_0x4acf('0x21')]=0x0;this[_0x4acf('0x22')]=![];this[_0x4acf('0x23')]=undefined;this[_0x4acf('0x24')]='';this['chatWaitingInteractions']={};this[_0x4acf('0x25')]={};this[_0x4acf('0x26')]={};this['openchannelWaitingInteractions']={};this[_0x4acf('0x27')]={};this[_0x4acf('0x28')]={};this['updateRealtime']();}Agent[_0x4acf('0x29')][_0x4acf('0x2a')]=function(_0x433b7a){if(this[_0x433b7a+_0x4acf('0x2b')]>0x0){if(this[_0x433b7a+'Capacity']>0x0&&this[_0x433b7a+_0x4acf('0x2b')]>=this[_0x433b7a+_0x4acf('0x2c')]){return'maxcapacity';}else{return _0x4acf('0x2d');}}else{return _0x4acf('0x2e');}};Agent['prototype'][_0x4acf('0x2f')]=function(){var _0x7ebb=[_0x4acf('0x30'),_0x4acf('0x31'),'openchannel','fax',_0x4acf('0x32'),_0x4acf('0x33')];for(var _0x355799=0x0;_0x355799<_0x7ebb[_0x4acf('0x34')];_0x355799+=0x1){var _0x14086c=this[_0x4acf('0x2a')](_0x7ebb[_0x355799]);if(this[_0x7ebb[_0x355799]+_0x4acf('0x35')]!==_0x14086c){this[_0x7ebb[_0x355799]+_0x4acf('0x36')]=_[_0x4acf('0x37')](moment()[_0x4acf('0x38')]('x'));}this[_0x7ebb[_0x355799]+'Status']=_0x14086c;}var _0x3521c2={'id':this['id'],'name':this[_0x4acf('0x6')],'online':this[_0x4acf('0x7')],'voicePause':this[_0x4acf('0x8')],'chatPause':this[_0x4acf('0x39')],'mailPause':this[_0x4acf('0x9')],'smsPause':this[_0x4acf('0xb')],'faxPause':this['faxPause'],'openchannelPause':this[_0x4acf('0xc')],'chatStatus':this[_0x4acf('0x3a')],'chatStatusTime':this[_0x4acf('0xd')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x4acf('0xe')],'mailStatus':this[_0x4acf('0xf')],'mailStatusTime':this[_0x4acf('0x11')],'mailCapacity':this[_0x4acf('0x12')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x4acf('0x14')],'faxStatusTime':this[_0x4acf('0x15')],'faxCapacity':this[_0x4acf('0x16')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x4acf('0x3b')],'smsStatusTime':this[_0x4acf('0x18')],'smsCapacity':this[_0x4acf('0x19')],'smsCurrentCapacity':this[_0x4acf('0x3c')],'whatsappStatus':this[_0x4acf('0x1a')],'whatsappStatusTime':this[_0x4acf('0x1b')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x4acf('0x1d')],'openchannelStatus':this[_0x4acf('0x1e')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x4acf('0x20')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x4acf('0x27')],'whatsappWaitingInteractions':this[_0x4acf('0x28')]};var _0x5d6741=md5(JSON[_0x4acf('0x3d')](_0x3521c2));if(this[_0x4acf('0x24')]!==_0x5d6741){this[_0x4acf('0x24')]=_0x5d6741;io[_0x4acf('0x3e')](_0x4acf('0x3f'),_[_0x4acf('0x40')](_0x3521c2,[_0x4acf('0x7')]));}};module[_0x4acf('0x41')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 5e254a8..4ec9a50 100644 --- a/server/services/routing/model/chatQueue.js +++ b/server/services/routing/model/chatQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbba3=['available','name','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','loggedIn','paused','length','online','chatPause'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xbba3,0x1e8));var _0x3bba=function(_0xb05c4a,_0x1c7516){_0xb05c4a=_0xb05c4a-0x0;var _0x5ad6de=_0xbba3[_0xb05c4a];return _0x5ad6de;};'use strict';var _=require(_0x3bba('0x0'));var md5=require(_0x3bba('0x1'));var util=require('util');var Redis=require(_0x3bba('0x2'));var config=require(_0x3bba('0x3'));config[_0x3bba('0x4')]=_[_0x3bba('0x5')](config[_0x3bba('0x4')],{'host':_0x3bba('0x6'),'port':0x18eb});var io=require(_0x3bba('0x7'))(new Redis(config[_0x3bba('0x4')]));function ChatQueue(_0x323abe){this['id']=_0x323abe['id']||0x0;this['name']=_0x323abe['name']||'';this[_0x3bba('0x8')]=_0x323abe[_0x3bba('0x8')]||0xa;this[_0x3bba('0x9')]=_0x323abe['strategy']||_0x3bba('0xa');this[_0x3bba('0xb')]=_0x323abe[_0x3bba('0xb')];this[_0x3bba('0xc')]={};this[_0x3bba('0xd')]=0x0;this[_0x3bba('0x1')]='';this['updateRouting']();this['updateRealtime']();}ChatQueue[_0x3bba('0xe')][_0x3bba('0xf')]=function(){var _0x2e1893=this[_0x3bba('0xc')][_0x3bba('0x10')];this[_0x3bba('0xc')]=_['map'](this['Agents'],'id');this[_0x3bba('0xc')][_0x3bba('0x10')]=_0x2e1893;};ChatQueue[_0x3bba('0xe')]['updateRealtime']=function(){this[_0x3bba('0x11')]=0x0;this[_0x3bba('0x12')]=0x0;for(var _0x75b0c3=0x0;_0x75b0c3=0x0?this[_0x3bba('0x16')]:0x0;var _0x556038={'id':this['id'],'available':this[_0x3bba('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x3bba('0x17')],'paused':this[_0x3bba('0x12')],'waiting':this['waiting']};var _0x51f430=md5(JSON[_0x3bba('0x18')](_0x556038));if(this['md5']!==_0x51f430){this[_0x3bba('0x1')]=_0x51f430;io['to'](util[_0x3bba('0x19')](_0x3bba('0x1a'),_0x556038[_0x3bba('0x17')]))[_0x3bba('0x1b')](_0x3bba('0x1c'),_0x556038);}};module[_0x3bba('0x1d')]=ChatQueue; \ No newline at end of file +var _0xfd85=['updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','chat:queue:%s','emit','chat_queue:save','exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5'];(function(_0x4102bc,_0x3900d8){var _0x4b7e6c=function(_0x17f69a){while(--_0x17f69a){_0x4102bc['push'](_0x4102bc['shift']());}};_0x4b7e6c(++_0x3900d8);}(_0xfd85,0x82));var _0x5fd8=function(_0x128a34,_0x290ddd){_0x128a34=_0x128a34-0x0;var _0x1e7fd0=_0xfd85[_0x128a34];return _0x1e7fd0;};'use strict';var _=require(_0x5fd8('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x5fd8('0x1'));var config=require(_0x5fd8('0x2'));config[_0x5fd8('0x3')]=_[_0x5fd8('0x4')](config[_0x5fd8('0x3')],{'host':_0x5fd8('0x5'),'port':0x18eb});var io=require(_0x5fd8('0x6'))(new Redis(config['redis']));function ChatQueue(_0x149e3f){this['id']=_0x149e3f['id']||0x0;this[_0x5fd8('0x7')]=_0x149e3f[_0x5fd8('0x7')]||'';this[_0x5fd8('0x8')]=_0x149e3f[_0x5fd8('0x8')]||0xa;this['strategy']=_0x149e3f[_0x5fd8('0x9')]||_0x5fd8('0xa');this[_0x5fd8('0xb')]=_0x149e3f[_0x5fd8('0xb')];this[_0x5fd8('0xc')]={};this[_0x5fd8('0xd')]=0x0;this[_0x5fd8('0xe')]='';this['updateRouting']();this[_0x5fd8('0xf')]();}ChatQueue[_0x5fd8('0x10')]['updateRouting']=function(){var _0x4defa6=this[_0x5fd8('0xc')][_0x5fd8('0x11')];this[_0x5fd8('0xc')]=_[_0x5fd8('0x12')](this['Agents'],'id');this[_0x5fd8('0xc')]['_rr']=_0x4defa6;};ChatQueue[_0x5fd8('0x10')]['updateRealtime']=function(){this[_0x5fd8('0x13')]=0x0;this[_0x5fd8('0x14')]=0x0;for(var _0x220fb3=0x0;_0x220fb3=0x0?this[_0x5fd8('0x17')]:0x0;var _0x136239={'id':this['id'],'available':this[_0x5fd8('0x17')],'loggedIn':this[_0x5fd8('0x13')],'name':this[_0x5fd8('0x7')],'paused':this['paused'],'waiting':this[_0x5fd8('0xd')]};var _0x31df24=md5(JSON[_0x5fd8('0x18')](_0x136239));if(this[_0x5fd8('0xe')]!==_0x31df24){this['md5']=_0x31df24;io['to'](util['format'](_0x5fd8('0x19'),_0x136239['name']))[_0x5fd8('0x1a')](_0x5fd8('0x1b'),_0x136239);}};module[_0x5fd8('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 374099d..a7fe54f 100644 --- a/server/services/routing/model/faxQueue.js +++ b/server/services/routing/model/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd253=['lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','loggedIn','paused','online','faxPause','available','stringify','fax:queue:%s','emit','fax_queue:save','exports'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xd253,0xe0));var _0x3d25=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xd253[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x3d25('0x0'));var md5=require(_0x3d25('0x1'));var util=require(_0x3d25('0x2'));var Redis=require(_0x3d25('0x3'));var config=require('../../../config/environment');config[_0x3d25('0x4')]=_[_0x3d25('0x5')](config[_0x3d25('0x4')],{'host':_0x3d25('0x6'),'port':0x18eb});var io=require(_0x3d25('0x7'))(new Redis(config[_0x3d25('0x4')]));function FaxQueue(_0x151d4e){this['id']=_0x151d4e['id']||0x0;this[_0x3d25('0x8')]=_0x151d4e['name']||'';this['timeout']=_0x151d4e[_0x3d25('0x9')]||0xa;this[_0x3d25('0xa')]=_0x151d4e[_0x3d25('0xa')]||_0x3d25('0xb');this[_0x3d25('0xc')]=_0x151d4e[_0x3d25('0xc')];this[_0x3d25('0xd')]={};this[_0x3d25('0xe')]=0x0;this[_0x3d25('0x1')]='';this['updateRouting']();this[_0x3d25('0xf')]();}FaxQueue[_0x3d25('0x10')]['updateRouting']=function(){var _0x35d3a0=this[_0x3d25('0xd')][_0x3d25('0x11')];this[_0x3d25('0xd')]=_['map'](this['Agents'],'id');this[_0x3d25('0xd')]['_rr']=_0x35d3a0;};FaxQueue['prototype'][_0x3d25('0xf')]=function(){this[_0x3d25('0x12')]=0x0;this[_0x3d25('0x13')]=0x0;for(var _0x152368=0x0;_0x152368=0x0?this[_0x3d25('0x16')]:0x0;var _0x3b83b1={'id':this['id'],'available':this[_0x3d25('0x16')],'loggedIn':this[_0x3d25('0x12')],'name':this[_0x3d25('0x8')],'paused':this[_0x3d25('0x13')],'waiting':this['waiting']};var _0x573743=md5(JSON[_0x3d25('0x17')](_0x3b83b1));if(this[_0x3d25('0x1')]!==_0x573743){this[_0x3d25('0x1')]=_0x573743;io['to'](util['format'](_0x3d25('0x18'),_0x3b83b1['name']))[_0x3d25('0x19')](_0x3d25('0x1a'),_0x3b83b1);}};module[_0x3d25('0x1b')]=FaxQueue; \ No newline at end of file +var _0x4f00=['strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','_rr','updateRealtime','loggedIn','online','faxPause','paused','available','stringify','format','emit','exports','lodash','ioredis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x191483,_0x3303fa){var _0x5763c8=function(_0xfd7dc4){while(--_0xfd7dc4){_0x191483['push'](_0x191483['shift']());}};_0x5763c8(++_0x3303fa);}(_0x4f00,0x8f));var _0x04f0=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4f00[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x04f0('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x04f0('0x1'));var config=require('../../../config/environment');config['redis']=_[_0x04f0('0x2')](config['redis'],{'host':_0x04f0('0x3'),'port':0x18eb});var io=require(_0x04f0('0x4'))(new Redis(config['redis']));function FaxQueue(_0xa498c6){this['id']=_0xa498c6['id']||0x0;this[_0x04f0('0x5')]=_0xa498c6['name']||'';this[_0x04f0('0x6')]=_0xa498c6['timeout']||0xa;this[_0x04f0('0x7')]=_0xa498c6['strategy']||_0x04f0('0x8');this[_0x04f0('0x9')]=_0xa498c6['Agents'];this[_0x04f0('0xa')]={};this[_0x04f0('0xb')]=0x0;this[_0x04f0('0xc')]='';this[_0x04f0('0xd')]();this['updateRealtime']();}FaxQueue['prototype'][_0x04f0('0xd')]=function(){var _0x41bf5a=this['mapAgentsId']['_rr'];this[_0x04f0('0xa')]=_['map'](this[_0x04f0('0x9')],'id');this[_0x04f0('0xa')][_0x04f0('0xe')]=_0x41bf5a;};FaxQueue['prototype'][_0x04f0('0xf')]=function(){this[_0x04f0('0x10')]=0x0;this['paused']=0x0;for(var _0x3d15b9=0x0;_0x3d15b9=0x0?this[_0x04f0('0x14')]:0x0;var _0x343012={'id':this['id'],'available':this[_0x04f0('0x14')],'loggedIn':this[_0x04f0('0x10')],'name':this[_0x04f0('0x5')],'paused':this[_0x04f0('0x13')],'waiting':this['waiting']};var _0x38b1f1=md5(JSON[_0x04f0('0x15')](_0x343012));if(this[_0x04f0('0xc')]!==_0x38b1f1){this[_0x04f0('0xc')]=_0x38b1f1;io['to'](util[_0x04f0('0x16')]('fax:queue:%s',_0x343012[_0x04f0('0x5')]))[_0x04f0('0x17')]('fax_queue:save',_0x343012);}};module[_0x04f0('0x18')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 8c9e8c6..5215151 100644 --- a/server/services/routing/model/interval.js +++ b/server/services/routing/model/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x051b=['exports','name','Intervals'];(function(_0x3dc25a,_0x14febd){var _0x11b065=function(_0x5aeeec){while(--_0x5aeeec){_0x3dc25a['push'](_0x3dc25a['shift']());}};_0x11b065(++_0x14febd);}(_0x051b,0x94));var _0xb051=function(_0x52488b,_0x3c05a6){_0x52488b=_0x52488b-0x0;var _0x345dc0=_0x051b[_0x52488b];return _0x345dc0;};'use strict';function Interval(_0x289c03){this['id']=_0x289c03['id']||0x0;this[_0xb051('0x0')]=_0x289c03[_0xb051('0x0')]||'';this[_0xb051('0x1')]=_0x289c03[_0xb051('0x1')]||{};}module[_0xb051('0x2')]=Interval; \ No newline at end of file +var _0xedab=['exports','name','Intervals'];(function(_0x53ae70,_0x14bd59){var _0x3247da=function(_0x46d38e){while(--_0x46d38e){_0x53ae70['push'](_0x53ae70['shift']());}};_0x3247da(++_0x14bd59);}(_0xedab,0xa3));var _0xbeda=function(_0x142020,_0x1f7233){_0x142020=_0x142020-0x0;var _0x40da8f=_0xedab[_0x142020];return _0x40da8f;};'use strict';function Interval(_0x1a788e){this['id']=_0x1a788e['id']||0x0;this[_0xbeda('0x0')]=_0x1a788e[_0xbeda('0x0')]||'';this['Intervals']=_0x1a788e[_0xbeda('0x1')]||{};}module[_0xbeda('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index fbc6e5e..ee6c98d 100644 --- a/server/services/routing/model/mailQueue.js +++ b/server/services/routing/model/mailQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c57=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','mapAgentsId','_rr','prototype','loggedIn','length','mailPause','paused','available','stringify','format','mail:queue:%s','emit','exports','md5','util','ioredis','../../../config/environment','redis'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0x0c57,0x190));var _0x70c5=function(_0x2a9b35,_0x27e2cd){_0x2a9b35=_0x2a9b35-0x0;var _0x1253ec=_0x0c57[_0x2a9b35];return _0x1253ec;};'use strict';var _=require('lodash');var md5=require(_0x70c5('0x0'));var util=require(_0x70c5('0x1'));var Redis=require(_0x70c5('0x2'));var config=require(_0x70c5('0x3'));config[_0x70c5('0x4')]=_['defaults'](config[_0x70c5('0x4')],{'host':_0x70c5('0x5'),'port':0x18eb});var io=require(_0x70c5('0x6'))(new Redis(config[_0x70c5('0x4')]));function MailQueue(_0x4ad029){this['id']=_0x4ad029['id']||0x0;this[_0x70c5('0x7')]=_0x4ad029[_0x70c5('0x7')]||'';this[_0x70c5('0x8')]=_0x4ad029[_0x70c5('0x8')]||0xa;this[_0x70c5('0x9')]=_0x4ad029['strategy']||_0x70c5('0xa');this[_0x70c5('0xb')]=_0x4ad029['Agents'];this['mapAgentsId']={};this[_0x70c5('0xc')]=0x0;this[_0x70c5('0x0')]='';this['updateRouting']();this[_0x70c5('0xd')]();}MailQueue['prototype']['updateRouting']=function(){var _0x381513=this[_0x70c5('0xe')][_0x70c5('0xf')];this['mapAgentsId']=_['map'](this[_0x70c5('0xb')],'id');this['mapAgentsId']['_rr']=_0x381513;};MailQueue[_0x70c5('0x10')][_0x70c5('0xd')]=function(){this[_0x70c5('0x11')]=0x0;this['paused']=0x0;for(var _0xed0f69=0x0;_0xed0f69=0x0?this[_0x70c5('0x15')]:0x0;var _0xfd28fe={'id':this['id'],'available':this['available'],'loggedIn':this[_0x70c5('0x11')],'name':this[_0x70c5('0x7')],'paused':this[_0x70c5('0x14')],'waiting':this[_0x70c5('0xc')]};var _0x21ccfe=md5(JSON[_0x70c5('0x16')](_0xfd28fe));if(this[_0x70c5('0x0')]!==_0x21ccfe){this[_0x70c5('0x0')]=_0x21ccfe;io['to'](util[_0x70c5('0x17')](_0x70c5('0x18'),_0xfd28fe[_0x70c5('0x7')]))[_0x70c5('0x19')]('mail_queue:save',_0xfd28fe);}};module[_0x70c5('0x1a')]=MailQueue; \ No newline at end of file +var _0xa805=['updateRealtime','prototype','_rr','map','loggedIn','paused','available','md5','format','mail:queue:%s','mail_queue:save','exports','lodash','defaults','localhost','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting'];(function(_0x4c946a,_0x18ba2b){var _0x1ffc7f=function(_0x22cc72){while(--_0x22cc72){_0x4c946a['push'](_0x4c946a['shift']());}};_0x1ffc7f(++_0x18ba2b);}(_0xa805,0x114));var _0x5a80=function(_0x41064a,_0x51e89a){_0x41064a=_0x41064a-0x0;var _0x11a94f=_0xa805[_0x41064a];return _0x11a94f;};'use strict';var _=require(_0x5a80('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x5a80('0x1')](config['redis'],{'host':_0x5a80('0x2'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5a80('0x3')]));function MailQueue(_0x31bac2){this['id']=_0x31bac2['id']||0x0;this['name']=_0x31bac2[_0x5a80('0x4')]||'';this[_0x5a80('0x5')]=_0x31bac2[_0x5a80('0x5')]||0xa;this[_0x5a80('0x6')]=_0x31bac2[_0x5a80('0x6')]||_0x5a80('0x7');this[_0x5a80('0x8')]=_0x31bac2['Agents'];this[_0x5a80('0x9')]={};this[_0x5a80('0xa')]=0x0;this['md5']='';this[_0x5a80('0xb')]();this[_0x5a80('0xc')]();}MailQueue[_0x5a80('0xd')][_0x5a80('0xb')]=function(){var _0x462d74=this['mapAgentsId'][_0x5a80('0xe')];this[_0x5a80('0x9')]=_[_0x5a80('0xf')](this[_0x5a80('0x8')],'id');this[_0x5a80('0x9')][_0x5a80('0xe')]=_0x462d74;};MailQueue[_0x5a80('0xd')]['updateRealtime']=function(){this[_0x5a80('0x10')]=0x0;this['paused']=0x0;for(var _0x359167=0x0;_0x359167=0x0?this['available']:0x0;var _0x303223={'id':this['id'],'available':this[_0x5a80('0x12')],'loggedIn':this[_0x5a80('0x10')],'name':this[_0x5a80('0x4')],'paused':this[_0x5a80('0x11')],'waiting':this['waiting']};var _0x210f2d=md5(JSON['stringify'](_0x303223));if(this[_0x5a80('0x13')]!==_0x210f2d){this['md5']=_0x210f2d;io['to'](util[_0x5a80('0x14')](_0x5a80('0x15'),_0x303223[_0x5a80('0x4')]))['emit'](_0x5a80('0x16'),_0x303223);}};module[_0x5a80('0x17')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index ec10bd9..abdaa17 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x326f,0xd1));var _0xf326=function(_0x2e6e35,_0x44b15b){_0x2e6e35=_0x2e6e35-0x0;var _0x50ddd4=_0x326f[_0x2e6e35];return _0x50ddd4;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 20a57e4..c4bf8e9 100644 --- a/server/services/routing/model/smsQueue.js +++ b/server/services/routing/model/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa2f=['loggedIn','smsPause','paused','available','stringify','format','sms:queue:%s','sms_queue:save','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','_rr','map','prototype','length','online'];(function(_0x50c211,_0x50933a){var _0x5408a3=function(_0x10e425){while(--_0x10e425){_0x50c211['push'](_0x50c211['shift']());}};_0x5408a3(++_0x50933a);}(_0xfa2f,0xe8));var _0xffa2=function(_0x348db8,_0x2a84a6){_0x348db8=_0x348db8-0x0;var _0x14bec4=_0xfa2f[_0x348db8];return _0x14bec4;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xffa2('0x0'));var Redis=require('ioredis');var config=require(_0xffa2('0x1'));config[_0xffa2('0x2')]=_[_0xffa2('0x3')](config['redis'],{'host':_0xffa2('0x4'),'port':0x18eb});var io=require(_0xffa2('0x5'))(new Redis(config[_0xffa2('0x2')]));function SmsQueue(_0x14787c){this['id']=_0x14787c['id']||0x0;this[_0xffa2('0x6')]=_0x14787c[_0xffa2('0x6')]||'';this[_0xffa2('0x7')]=_0x14787c['timeout']||0xa;this['strategy']=_0x14787c[_0xffa2('0x8')]||_0xffa2('0x9');this[_0xffa2('0xa')]=_0x14787c[_0xffa2('0xa')];this[_0xffa2('0xb')]={};this[_0xffa2('0xc')]=0x0;this[_0xffa2('0xd')]='';this['updateRouting']();this[_0xffa2('0xe')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x2eb5bb=this[_0xffa2('0xb')][_0xffa2('0xf')];this[_0xffa2('0xb')]=_[_0xffa2('0x10')](this['Agents'],'id');this[_0xffa2('0xb')][_0xffa2('0xf')]=_0x2eb5bb;};SmsQueue[_0xffa2('0x11')][_0xffa2('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x32e54e=0x0;_0x32e54e=0x0?this[_0xffa2('0x17')]:0x0;var _0x2ae03f={'id':this['id'],'available':this[_0xffa2('0x17')],'loggedIn':this[_0xffa2('0x14')],'name':this[_0xffa2('0x6')],'paused':this[_0xffa2('0x16')],'waiting':this[_0xffa2('0xc')]};var _0xc10cfb=md5(JSON[_0xffa2('0x18')](_0x2ae03f));if(this[_0xffa2('0xd')]!==_0xc10cfb){this['md5']=_0xc10cfb;io['to'](util[_0xffa2('0x19')](_0xffa2('0x1a'),_0x2ae03f[_0xffa2('0x6')]))['emit'](_0xffa2('0x1b'),_0x2ae03f);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x4876=['Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','_rr','map','paused','length','loggedIn','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','util','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x3d1cae,_0x37e176){var _0x49b5f7=function(_0x46332a){while(--_0x46332a){_0x3d1cae['push'](_0x3d1cae['shift']());}};_0x49b5f7(++_0x37e176);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x6487('0x0'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x6487('0x1')]=_['defaults'](config[_0x6487('0x1')],{'host':_0x6487('0x2'),'port':0x18eb});var io=require(_0x6487('0x3'))(new Redis(config[_0x6487('0x1')]));function SmsQueue(_0x57d99d){this['id']=_0x57d99d['id']||0x0;this[_0x6487('0x4')]=_0x57d99d[_0x6487('0x4')]||'';this['timeout']=_0x57d99d[_0x6487('0x5')]||0xa;this[_0x6487('0x6')]=_0x57d99d[_0x6487('0x6')]||_0x6487('0x7');this[_0x6487('0x8')]=_0x57d99d[_0x6487('0x8')];this[_0x6487('0x9')]={};this[_0x6487('0xa')]=0x0;this[_0x6487('0xb')]='';this['updateRouting']();this[_0x6487('0xc')]();}SmsQueue[_0x6487('0xd')][_0x6487('0xe')]=function(){var _0x2ba8ce=this[_0x6487('0x9')][_0x6487('0xf')];this[_0x6487('0x9')]=_[_0x6487('0x10')](this['Agents'],'id');this[_0x6487('0x9')][_0x6487('0xf')]=_0x2ba8ce;};SmsQueue[_0x6487('0xd')][_0x6487('0xc')]=function(){this['loggedIn']=0x0;this[_0x6487('0x11')]=0x0;for(var _0x10f2e1=0x0;_0x10f2e1=0x0?this['available']:0x0;var _0x4cedf9={'id':this['id'],'available':this['available'],'loggedIn':this[_0x6487('0x13')],'name':this[_0x6487('0x4')],'paused':this[_0x6487('0x11')],'waiting':this[_0x6487('0xa')]};var _0x30abdc=md5(JSON[_0x6487('0x16')](_0x4cedf9));if(this[_0x6487('0xb')]!==_0x30abdc){this[_0x6487('0xb')]=_0x30abdc;io['to'](util[_0x6487('0x17')](_0x6487('0x18'),_0x4cedf9[_0x6487('0x4')]))[_0x6487('0x19')](_0x6487('0x1a'),_0x4cedf9);}};module[_0x6487('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 0f8cb0d..8b386ad 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x397b=['_rr','prototype','loggedIn','paused','length','online','whatsappPause','available','format','whatsapp:queue:%s','exports','lodash','md5','ioredis','../../../config/environment','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId'];(function(_0x383338,_0x5c98a3){var _0x1a9dac=function(_0x5c885b){while(--_0x5c885b){_0x383338['push'](_0x383338['shift']());}};_0x1a9dac(++_0x5c98a3);}(_0x397b,0x92));var _0xb397=function(_0x1de369,_0x4fda36){_0x1de369=_0x1de369-0x0;var _0x41ac09=_0x397b[_0x1de369];return _0x41ac09;};'use strict';var _=require(_0xb397('0x0'));var md5=require(_0xb397('0x1'));var util=require('util');var Redis=require(_0xb397('0x2'));var config=require(_0xb397('0x3'));config['redis']=_['defaults'](config['redis'],{'host':_0xb397('0x4'),'port':0x18eb});var io=require(_0xb397('0x5'))(new Redis(config[_0xb397('0x6')]));function WhatsappQueue(_0x407393){this['id']=_0x407393['id']||0x0;this[_0xb397('0x7')]=_0x407393[_0xb397('0x7')]||'';this['timeout']=_0x407393[_0xb397('0x8')]||0xa;this['strategy']=_0x407393[_0xb397('0x9')]||_0xb397('0xa');this[_0xb397('0xb')]=_0x407393[_0xb397('0xb')];this['mapAgentsId']={};this[_0xb397('0xc')]=0x0;this['md5']='';this[_0xb397('0xd')]();this[_0xb397('0xe')]();}WhatsappQueue['prototype'][_0xb397('0xd')]=function(){var _0x351e24=this[_0xb397('0xf')]['_rr'];this['mapAgentsId']=_['map'](this[_0xb397('0xb')],'id');this[_0xb397('0xf')][_0xb397('0x10')]=_0x351e24;};WhatsappQueue[_0xb397('0x11')][_0xb397('0xe')]=function(){this[_0xb397('0x12')]=0x0;this[_0xb397('0x13')]=0x0;for(var _0x50dfb1=0x0;_0x50dfb1=0x0?this['available']:0x0;var _0x4a016a={'id':this['id'],'available':this[_0xb397('0x17')],'loggedIn':this[_0xb397('0x12')],'name':this[_0xb397('0x7')],'paused':this[_0xb397('0x13')],'waiting':this[_0xb397('0xc')]};var _0x4f5313=md5(JSON['stringify'](_0x4a016a));if(this[_0xb397('0x1')]!==_0x4f5313){this[_0xb397('0x1')]=_0x4f5313;io['to'](util[_0xb397('0x18')](_0xb397('0x19'),_0x4a016a['name']))['emit']('whatsapp_queue:save',_0x4a016a);}};module[_0xb397('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x299b=['map','paused','online','loggedIn','whatsappPause','available','stringify','format','emit','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','updateRouting'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x299b,0x1c3));var _0xb299=function(_0x58ae8a,_0x3c619e){_0x58ae8a=_0x58ae8a-0x0;var _0x2f0b6b=_0x299b[_0x58ae8a];return _0x2f0b6b;};'use strict';var _=require(_0xb299('0x0'));var md5=require(_0xb299('0x1'));var util=require(_0xb299('0x2'));var Redis=require(_0xb299('0x3'));var config=require('../../../config/environment');config[_0xb299('0x4')]=_[_0xb299('0x5')](config[_0xb299('0x4')],{'host':_0xb299('0x6'),'port':0x18eb});var io=require(_0xb299('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x526656){this['id']=_0x526656['id']||0x0;this[_0xb299('0x8')]=_0x526656['name']||'';this[_0xb299('0x9')]=_0x526656[_0xb299('0x9')]||0xa;this['strategy']=_0x526656[_0xb299('0xa')]||_0xb299('0xb');this['Agents']=_0x526656[_0xb299('0xc')];this[_0xb299('0xd')]={};this['waiting']=0x0;this[_0xb299('0x1')]='';this['updateRouting']();this[_0xb299('0xe')]();}WhatsappQueue[_0xb299('0xf')][_0xb299('0x10')]=function(){var _0x244a30=this['mapAgentsId']['_rr'];this[_0xb299('0xd')]=_[_0xb299('0x11')](this[_0xb299('0xc')],'id');this[_0xb299('0xd')]['_rr']=_0x244a30;};WhatsappQueue[_0xb299('0xf')][_0xb299('0xe')]=function(){this['loggedIn']=0x0;this[_0xb299('0x12')]=0x0;for(var _0x43747a=0x0;_0x43747a=0x0?this['available']:0x0;var _0x439a20={'id':this['id'],'available':this['available'],'loggedIn':this[_0xb299('0x14')],'name':this[_0xb299('0x8')],'paused':this[_0xb299('0x12')],'waiting':this['waiting']};var _0x14d8a8=md5(JSON[_0xb299('0x17')](_0x439a20));if(this['md5']!==_0x14d8a8){this['md5']=_0x14d8a8;io['to'](util[_0xb299('0x18')]('whatsapp:queue:%s',_0x439a20[_0xb299('0x8')]))[_0xb299('0x19')]('whatsapp_queue:save',_0x439a20);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index cc4538f..c7e73bb 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 5de0ae5..f1a8c7b 100644 --- a/server/services/routing/rpc/chatInteraction.js +++ b/server/services/routing/rpc/chatInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc910=['addTags','AddTagsToChatInteraction','addTagsToChatInteraction','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x4b734b,_0x3c4fe1){var _0xd214cf=function(_0x5ed192){while(--_0x5ed192){_0x4b734b['push'](_0x4b734b['shift']());}};_0xd214cf(++_0x3c4fe1);}(_0xc910,0x137));var _0x0c91=function(_0x185b45,_0x3f033d){_0x185b45=_0x185b45-0x0;var _0x53026e=_0xc910[_0x185b45];return _0x53026e;};'use strict';var client=require('../client');exports[_0x0c91('0x0')]=function(_0x54280c,_0x1643ca){return client[_0x0c91('0x1')](_0x0c91('0x2'),{'body':_0x1643ca,'options':{'where':{'id':_0x54280c}},'log':_0x0c91('0x3')});};exports[_0x0c91('0x4')]=function(_0x2ee60c,_0x2cf210){return client[_0x0c91('0x1')](_0x0c91('0x5'),{'body':_0x2cf210,'options':{'where':{'id':_0x2ee60c}},'log':_0x0c91('0x6')});}; \ No newline at end of file +var _0x68b8=['updateChatInteraction','addTags','addTagsToChatInteraction','update','Request','UpdateChatInteraction'];(function(_0xf4d05,_0x5e601f){var _0x47c971=function(_0x17aae3){while(--_0x17aae3){_0xf4d05['push'](_0xf4d05['shift']());}};_0x47c971(++_0x5e601f);}(_0x68b8,0xe1));var _0x868b=function(_0x86337d,_0x2b57c3){_0x86337d=_0x86337d-0x0;var _0x22b2c6=_0x68b8[_0x86337d];return _0x22b2c6;};'use strict';var client=require('../client');exports[_0x868b('0x0')]=function(_0x44b302,_0x437296){return client[_0x868b('0x1')](_0x868b('0x2'),{'body':_0x437296,'options':{'where':{'id':_0x44b302}},'log':_0x868b('0x3')});};exports[_0x868b('0x4')]=function(_0x13b34d,_0x35c0a6){return client[_0x868b('0x1')]('AddTagsToChatInteraction',{'body':_0x35c0a6,'options':{'where':{'id':_0x13b34d}},'log':_0x868b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 006c4e3..f445bff 100644 --- a/server/services/routing/rpc/chatMessage.js +++ b/server/services/routing/rpc/chatMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2ab=['Request','CreateChatMessage','create'];(function(_0x33bdf3,_0x7b3060){var _0x3ba5a2=function(_0x3872ed){while(--_0x3872ed){_0x33bdf3['push'](_0x33bdf3['shift']());}};_0x3ba5a2(++_0x7b3060);}(_0xf2ab,0x122));var _0xbf2a=function(_0x46002e,_0x905224){_0x46002e=_0x46002e-0x0;var _0x581cea=_0xf2ab[_0x46002e];return _0x581cea;};'use strict';var client=require('../client');exports[_0xbf2a('0x0')]=function(_0x156ae0){return client[_0xbf2a('0x1')](_0xbf2a('0x2'),{'body':_0x156ae0,'log':'createChatMessage'});}; \ No newline at end of file +var _0x22b4=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x3dc520,_0xb5e418){var _0x52b32d=function(_0x4205a2){while(--_0x4205a2){_0x3dc520['push'](_0x3dc520['shift']());}};_0x52b32d(++_0xb5e418);}(_0x22b4,0x1d2));var _0x422b=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x22b4[_0x2c7618];return _0x5ce3f0;};'use strict';var client=require(_0x422b('0x0'));exports[_0x422b('0x1')]=function(_0x6f6cd4){return client[_0x422b('0x2')](_0x422b('0x3'),{'body':_0x6f6cd4,'log':_0x422b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 2890488..c55dc23 100644 --- a/server/services/routing/rpc/chatQueue.js +++ b/server/services/routing/rpc/chatQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b47=['strategy','User','online','chatPause','../client','Request','GetChatQueue','name','timeout'];(function(_0x29e78e,_0x49cd8a){var _0x3162c3=function(_0x45dc9c){while(--_0x45dc9c){_0x29e78e['push'](_0x29e78e['shift']());}};_0x3162c3(++_0x49cd8a);}(_0x4b47,0x1b4));var _0x74b4=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x4b47[_0x2faddb];return _0x273c05;};'use strict';var client=require(_0x74b4('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x74b4('0x1')](_0x74b4('0x2'),{'options':{'raw':![],'attributes':['id',_0x74b4('0x3'),_0x74b4('0x4'),_0x74b4('0x5')],'include':[{'model':_0x74b4('0x6'),'as':'Agents','attributes':['id','name',_0x74b4('0x7'),_0x74b4('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xc492=['Request','timeout','Agents','name','chatPause','../client','getChatQueues'];(function(_0x9b2aed,_0x5a67b9){var _0x50a80c=function(_0x3c0601){while(--_0x3c0601){_0x9b2aed['push'](_0x9b2aed['shift']());}};_0x50a80c(++_0x5a67b9);}(_0xc492,0xd7));var _0x2c49=function(_0x223ea0,_0x302179){_0x223ea0=_0x223ea0-0x0;var _0x2e18b8=_0xc492[_0x223ea0];return _0x2e18b8;};'use strict';var client=require(_0x2c49('0x0'));exports[_0x2c49('0x1')]=function(){return function(){return client[_0x2c49('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id','name',_0x2c49('0x3'),'strategy'],'include':[{'model':'User','as':_0x2c49('0x4'),'attributes':['id',_0x2c49('0x5'),'online',_0x2c49('0x6')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 6c58e60..8d491e9 100644 --- a/server/services/routing/rpc/chatQueueReport.js +++ b/server/services/routing/rpc/chatQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3df4=['update','DESC','UpdateChatQueueReport','Request','CreateChatQueueReport'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x3df4,0x102));var _0x43df=function(_0x25e634,_0x214a83){_0x25e634=_0x25e634-0x0;var _0x1949a4=_0x3df4[_0x25e634];return _0x1949a4;};'use strict';var client=require('../client');exports['create']=function(_0x2495e3){return client[_0x43df('0x0')](_0x43df('0x1'),{'body':_0x2495e3,'log':_0x43df('0x1')});};exports[_0x43df('0x2')]=function(_0x2985bf,_0x4297f4){return client['Request']('UpdateChatQueueReport',{'body':_0x4297f4,'options':{'where':{'uniqueid':_0x2985bf},'order':[['id',_0x43df('0x3')]],'limit':0x1},'log':_0x43df('0x4')});}; \ No newline at end of file +var _0xc718=['CreateChatQueueReport','update','../client','Request'];(function(_0x456cbb,_0x547275){var _0x9c3a70=function(_0x1c8686){while(--_0x1c8686){_0x456cbb['push'](_0x456cbb['shift']());}};_0x9c3a70(++_0x547275);}(_0xc718,0xb6));var _0x8c71=function(_0x8a00d,_0x2c4f63){_0x8a00d=_0x8a00d-0x0;var _0x1c52c6=_0xc718[_0x8a00d];return _0x1c52c6;};'use strict';var client=require(_0x8c71('0x0'));exports['create']=function(_0x45e5c8){return client[_0x8c71('0x1')]('CreateChatQueueReport',{'body':_0x45e5c8,'log':_0x8c71('0x2')});};exports[_0x8c71('0x3')]=function(_0x5402e6,_0x4fa6dc){return client[_0x8c71('0x1')]('UpdateChatQueueReport',{'body':_0x4fa6dc,'options':{'where':{'uniqueid':_0x5402e6},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index e5ea405..3e0d577 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x2e3dfc,_0x454d6c){var _0x4b1245=function(_0x5e9faa){while(--_0x5e9faa){_0x2e3dfc['push'](_0x2e3dfc['shift']());}};_0x4b1245(++_0x454d6c);}(_0x7a54,0x106));var _0x47a5=function(_0x33d0c1,_0x2dde2e){_0x33d0c1=_0x33d0c1-0x0;var _0x2a1817=_0x7a54[_0x33d0c1];return _0x2a1817;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0xbcf372,_0x51df05){var _0x343b43=function(_0x2bd191){while(--_0x2bd191){_0xbcf372['push'](_0xbcf372['shift']());}};_0x343b43(++_0x51df05);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index f69167e..a7196e4 100644 --- a/server/services/routing/rpc/faxMessage.js +++ b/server/services/routing/rpc/faxMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x206e=['createFaxMessage','../client','CreateFaxMessage'];(function(_0x2c11ad,_0x184233){var _0xdb08a4=function(_0x2eef91){while(--_0x2eef91){_0x2c11ad['push'](_0x2c11ad['shift']());}};_0xdb08a4(++_0x184233);}(_0x206e,0x13c));var _0xe206=function(_0x1bc6af,_0x4fbcc4){_0x1bc6af=_0x1bc6af-0x0;var _0x35e765=_0x206e[_0x1bc6af];return _0x35e765;};'use strict';var client=require(_0xe206('0x0'));exports['create']=function(_0x3332ff){return client['Request'](_0xe206('0x1'),{'body':_0x3332ff,'log':_0xe206('0x2')});}; \ No newline at end of file +var _0x7cfa=['Request','CreateFaxMessage','../client','create'];(function(_0xdeac17,_0x19ad66){var _0x33aabd=function(_0x558a9e){while(--_0x558a9e){_0xdeac17['push'](_0xdeac17['shift']());}};_0x33aabd(++_0x19ad66);}(_0x7cfa,0x176));var _0xa7cf=function(_0x3d30b3,_0x303c4d){_0x3d30b3=_0x3d30b3-0x0;var _0x6329f0=_0x7cfa[_0x3d30b3];return _0x6329f0;};'use strict';var client=require(_0xa7cf('0x0'));exports[_0xa7cf('0x1')]=function(_0x5a4f3b){return client[_0xa7cf('0x2')](_0xa7cf('0x3'),{'body':_0x5a4f3b,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index d1a5b01..65a02e6 100644 --- a/server/services/routing/rpc/faxQueue.js +++ b/server/services/routing/rpc/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf111=['online','faxPause','getFaxQueues','GetFaxQueue','name','strategy','User'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0xf111,0x1b5));var _0x1f11=function(_0x5ec454,_0xfcd77e){_0x5ec454=_0x5ec454-0x0;var _0x5ebf50=_0xf111[_0x5ec454];return _0x5ebf50;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client['Request'](_0x1f11('0x0'),{'options':{'raw':![],'attributes':['id',_0x1f11('0x1'),'timeout',_0x1f11('0x2')],'include':[{'model':_0x1f11('0x3'),'as':'Agents','attributes':['id','name',_0x1f11('0x4'),_0x1f11('0x5')]}]},'log':_0x1f11('0x6')});};}; \ No newline at end of file +var _0x644f=['online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','User','Agents'];(function(_0xe7d24e,_0x235022){var _0x42c6e3=function(_0x7fe642){while(--_0x7fe642){_0xe7d24e['push'](_0xe7d24e['shift']());}};_0x42c6e3(++_0x235022);}(_0x644f,0x65));var _0xf644=function(_0x5d30b4,_0x199248){_0x5d30b4=_0x5d30b4-0x0;var _0x1acfb8=_0x644f[_0x5d30b4];return _0x1acfb8;};'use strict';var client=require(_0xf644('0x0'));exports[_0xf644('0x1')]=function(){return function(){return client[_0xf644('0x2')](_0xf644('0x3'),{'options':{'raw':![],'attributes':['id',_0xf644('0x4'),_0xf644('0x5'),_0xf644('0x6')],'include':[{'model':_0xf644('0x7'),'as':_0xf644('0x8'),'attributes':['id',_0xf644('0x4'),_0xf644('0x9'),_0xf644('0xa')]}]},'log':_0xf644('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index beb7d81..7e8faaf 100644 --- a/server/services/routing/rpc/faxQueueReport.js +++ b/server/services/routing/rpc/faxQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x643d=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','create'];(function(_0x577f08,_0xbe8cae){var _0x362024=function(_0xadb87b){while(--_0xadb87b){_0x577f08['push'](_0x577f08['shift']());}};_0x362024(++_0xbe8cae);}(_0x643d,0x1df));var _0xd643=function(_0x3020e2,_0x310f30){_0x3020e2=_0x3020e2-0x0;var _0x425ef8=_0x643d[_0x3020e2];return _0x425ef8;};'use strict';var client=require('../client');exports[_0xd643('0x0')]=function(_0x110f35){return client['Request']('CreateFaxQueueReport',{'body':_0x110f35,'log':_0xd643('0x1')});};exports[_0xd643('0x2')]=function(_0x1aef18,_0x325f6c){return client['Request'](_0xd643('0x3'),{'body':_0x325f6c,'options':{'where':{'uniqueid':_0x1aef18},'order':[['id',_0xd643('0x4')]],'limit':0x1},'log':_0xd643('0x3')});}; \ No newline at end of file +var _0x78d8=['update','DESC','../client','create','CreateFaxQueueReport'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0x78d8,0xf2));var _0x878d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x78d8[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x878d('0x0'));exports[_0x878d('0x1')]=function(_0x1b215e){return client['Request'](_0x878d('0x2'),{'body':_0x1b215e,'log':_0x878d('0x2')});};exports[_0x878d('0x3')]=function(_0x5a7d1f,_0x203f10){return client['Request']('UpdateFaxQueueReport',{'body':_0x203f10,'options':{'where':{'uniqueid':_0x5a7d1f},'order':[['id',_0x878d('0x4')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index ce91ab8..a9cc858 100644 --- a/server/services/routing/rpc/interval.js +++ b/server/services/routing/rpc/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd052=['getIntervals','Request','GetInterval','name','Interval','Intervals','interval','../client'];(function(_0x2774e2,_0x193d57){var _0xdfe875=function(_0x23e761){while(--_0x23e761){_0x2774e2['push'](_0x2774e2['shift']());}};_0xdfe875(++_0x193d57);}(_0xd052,0xef));var _0x2d05=function(_0x1dd693,_0x1b4ddf){_0x1dd693=_0x1dd693-0x0;var _0x4de3bc=_0xd052[_0x1dd693];return _0x4de3bc;};'use strict';var client=require(_0x2d05('0x0'));exports[_0x2d05('0x1')]=function(){return function(){return client[_0x2d05('0x2')](_0x2d05('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2d05('0x4')],'include':[{'model':_0x2d05('0x5'),'as':_0x2d05('0x6'),'attributes':['id',_0x2d05('0x4'),_0x2d05('0x7')]}]},'log':_0x2d05('0x1')});};}; \ No newline at end of file +var _0x8aaa=['getIntervals','../client','Request','GetInterval','name','interval'];(function(_0xd8c725,_0x28114d){var _0x366801=function(_0x2cce63){while(--_0x2cce63){_0xd8c725['push'](_0xd8c725['shift']());}};_0x366801(++_0x28114d);}(_0x8aaa,0x163));var _0xa8aa=function(_0xee122e,_0x58ef2e){_0xee122e=_0xee122e-0x0;var _0x34f98a=_0x8aaa[_0xee122e];return _0x34f98a;};'use strict';var client=require(_0xa8aa('0x0'));exports['getIntervals']=function(){return function(){return client[_0xa8aa('0x1')](_0xa8aa('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xa8aa('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id','name',_0xa8aa('0x4')]}]},'log':_0xa8aa('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 38aebf1..60c2040 100644 --- a/server/services/routing/rpc/mailInteraction.js +++ b/server/services/routing/rpc/mailInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66fa=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','addTagsToChatInteraction','../client'];(function(_0x20ce8d,_0x2945d7){var _0x196d0c=function(_0x118021){while(--_0x118021){_0x20ce8d['push'](_0x20ce8d['shift']());}};_0x196d0c(++_0x2945d7);}(_0x66fa,0x117));var _0xa66f=function(_0x73f3cf,_0x9ccdd2){_0x73f3cf=_0x73f3cf-0x0;var _0x5a181e=_0x66fa[_0x73f3cf];return _0x5a181e;};'use strict';var client=require(_0xa66f('0x0'));exports[_0xa66f('0x1')]=function(_0x52947a,_0x1fc161){return client[_0xa66f('0x2')](_0xa66f('0x3'),{'body':_0x1fc161,'options':{'where':{'id':_0x52947a}},'log':_0xa66f('0x4')});};exports[_0xa66f('0x5')]=function(_0x2a2abf,_0x3f4904){return client['Request']('AddTagsToMailInteraction',{'body':_0x3f4904,'options':{'where':{'id':_0x2a2abf}},'log':_0xa66f('0x6')});}; \ No newline at end of file +var _0xeb3b=['../client','update','Request','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x7f73f6,_0x493b19){var _0x261338=function(_0x1d590b){while(--_0x1d590b){_0x7f73f6['push'](_0x7f73f6['shift']());}};_0x261338(++_0x493b19);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x22f5ea,_0x3a6a30){_0x22f5ea=_0x22f5ea-0x0;var _0xe5955=_0xeb3b[_0x22f5ea];return _0xe5955;};'use strict';var client=require(_0xbeb3('0x0'));exports[_0xbeb3('0x1')]=function(_0xc5aaa3,_0x33e049){return client[_0xbeb3('0x2')]('UpdateMailInteraction',{'body':_0x33e049,'options':{'where':{'id':_0xc5aaa3}},'log':'updateMailInteraction'});};exports[_0xbeb3('0x3')]=function(_0x5b0e3b,_0x2e8ce3){return client['Request'](_0xbeb3('0x4'),{'body':_0x2e8ce3,'options':{'where':{'id':_0x5b0e3b}},'log':_0xbeb3('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 222bfd1..75cf408 100644 --- a/server/services/routing/rpc/mailMessage.js +++ b/server/services/routing/rpc/mailMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19d8=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x519d16,_0x5eb278){var _0x2e56a5=function(_0x1e01b3){while(--_0x1e01b3){_0x519d16['push'](_0x519d16['shift']());}};_0x2e56a5(++_0x5eb278);}(_0x19d8,0x102));var _0x819d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x19d8[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x819d('0x0'));exports[_0x819d('0x1')]=function(_0x4c6bf7){return client[_0x819d('0x2')](_0x819d('0x3'),{'body':_0x4c6bf7,'log':_0x819d('0x4')});}; \ No newline at end of file +var _0x90f5=['CreateMailMessage','create'];(function(_0x25e211,_0x2778fd){var _0x4e3f93=function(_0x22981c){while(--_0x22981c){_0x25e211['push'](_0x25e211['shift']());}};_0x4e3f93(++_0x2778fd);}(_0x90f5,0xcf));var _0x590f=function(_0x130457,_0xdb6b2a){_0x130457=_0x130457-0x0;var _0x358070=_0x90f5[_0x130457];return _0x358070;};'use strict';var client=require('../client');exports[_0x590f('0x0')]=function(_0x440975){return client['Request'](_0x590f('0x1'),{'body':_0x440975,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 075f22e..a361016 100644 --- a/server/services/routing/rpc/mailQueue.js +++ b/server/services/routing/rpc/mailQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4012=['User','name','mailPause','../client','getMailQueues','Request','GetMailQueue','timeout','strategy'];(function(_0x4aab29,_0xe600b8){var _0x521231=function(_0x310a4b){while(--_0x310a4b){_0x4aab29['push'](_0x4aab29['shift']());}};_0x521231(++_0xe600b8);}(_0x4012,0x1aa));var _0x2401=function(_0x223845,_0xff4d8c){_0x223845=_0x223845-0x0;var _0xcb70d6=_0x4012[_0x223845];return _0xcb70d6;};'use strict';var client=require(_0x2401('0x0'));exports[_0x2401('0x1')]=function(){return function(){return client[_0x2401('0x2')](_0x2401('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x2401('0x4'),_0x2401('0x5')],'include':[{'model':_0x2401('0x6'),'as':'Agents','attributes':['id',_0x2401('0x7'),'online',_0x2401('0x8')]}]},'log':_0x2401('0x1')});};}; \ No newline at end of file +var _0xe47c=['timeout','strategy','User','Agents','online','mailPause','../client','getMailQueues','Request','GetMailQueue','name'];(function(_0x321c98,_0x1dbf8b){var _0x3092f1=function(_0x53af3b){while(--_0x53af3b){_0x321c98['push'](_0x321c98['shift']());}};_0x3092f1(++_0x1dbf8b);}(_0xe47c,0xa0));var _0xce47=function(_0x1087b4,_0x4dc1b8){_0x1087b4=_0x1087b4-0x0;var _0x46c660=_0xe47c[_0x1087b4];return _0x46c660;};'use strict';var client=require(_0xce47('0x0'));exports[_0xce47('0x1')]=function(){return function(){return client[_0xce47('0x2')](_0xce47('0x3'),{'options':{'raw':![],'attributes':['id',_0xce47('0x4'),_0xce47('0x5'),_0xce47('0x6')],'include':[{'model':_0xce47('0x7'),'as':_0xce47('0x8'),'attributes':['id','name',_0xce47('0x9'),_0xce47('0xa')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index db49ceb..db17cc5 100644 --- a/server/services/routing/rpc/mailQueueReport.js +++ b/server/services/routing/rpc/mailQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc72=['../client','Request','CreateMailQueueReport','update','DESC'];(function(_0x2f824e,_0xcb6123){var _0x5b691f=function(_0x1775a5){while(--_0x1775a5){_0x2f824e['push'](_0x2f824e['shift']());}};_0x5b691f(++_0xcb6123);}(_0xcc72,0x1bd));var _0x2cc7=function(_0x1bb4b2,_0x4b124a){_0x1bb4b2=_0x1bb4b2-0x0;var _0x174b80=_0xcc72[_0x1bb4b2];return _0x174b80;};'use strict';var client=require(_0x2cc7('0x0'));exports['create']=function(_0x4d8e59){return client[_0x2cc7('0x1')](_0x2cc7('0x2'),{'body':_0x4d8e59,'log':_0x2cc7('0x2')});};exports[_0x2cc7('0x3')]=function(_0x23c554,_0xf6605d){return client[_0x2cc7('0x1')]('UpdateMailQueueReport',{'body':_0xf6605d,'options':{'where':{'uniqueid':_0x23c554},'order':[['id',_0x2cc7('0x4')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x8253=['UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport'];(function(_0x4ac014,_0x42bc05){var _0x3a9c56=function(_0xc25f9a){while(--_0xc25f9a){_0x4ac014['push'](_0x4ac014['shift']());}};_0x3a9c56(++_0x42bc05);}(_0x8253,0x1cd));var _0x3825=function(_0x1113d9,_0x52cd99){_0x1113d9=_0x1113d9-0x0;var _0x4a5aa2=_0x8253[_0x1113d9];return _0x4a5aa2;};'use strict';var client=require(_0x3825('0x0'));exports[_0x3825('0x1')]=function(_0x2baed4){return client[_0x3825('0x2')](_0x3825('0x3'),{'body':_0x2baed4,'log':_0x3825('0x3')});};exports['update']=function(_0x51db9b,_0xd6a14e){return client[_0x3825('0x2')]('UpdateMailQueueReport',{'body':_0xd6a14e,'options':{'where':{'uniqueid':_0x51db9b},'order':[['id','DESC']],'limit':0x1},'log':_0x3825('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 0d60978..92ba9f9 100644 --- a/server/services/routing/rpc/openchannelInteraction.js +++ b/server/services/routing/rpc/openchannelInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4dd5=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x12bca1,_0x4ee062){var _0x2e0771=function(_0x18c1d3){while(--_0x18c1d3){_0x12bca1['push'](_0x12bca1['shift']());}};_0x2e0771(++_0x4ee062);}(_0x4dd5,0xf2));var _0x54dd=function(_0x55b944,_0x1f4d02){_0x55b944=_0x55b944-0x0;var _0x36fb7a=_0x4dd5[_0x55b944];return _0x36fb7a;};'use strict';var client=require(_0x54dd('0x0'));exports[_0x54dd('0x1')]=function(_0x1795f4,_0x1b2fdf){return client[_0x54dd('0x2')](_0x54dd('0x3'),{'body':_0x1b2fdf,'options':{'where':{'id':_0x1795f4}},'log':_0x54dd('0x4')});};exports[_0x54dd('0x5')]=function(_0x4a98a4,_0x26e5a2){return client[_0x54dd('0x2')](_0x54dd('0x6'),{'body':_0x26e5a2,'options':{'where':{'id':_0x4a98a4}},'log':_0x54dd('0x7')});}; \ No newline at end of file +var _0xa837=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction'];(function(_0x209c5b,_0x160488){var _0x977ce7=function(_0x3e0e16){while(--_0x3e0e16){_0x209c5b['push'](_0x209c5b['shift']());}};_0x977ce7(++_0x160488);}(_0xa837,0x17c));var _0x7a83=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa837[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x7a83('0x0'));exports[_0x7a83('0x1')]=function(_0x50bf1c,_0xf075fa){return client[_0x7a83('0x2')](_0x7a83('0x3'),{'body':_0xf075fa,'options':{'where':{'id':_0x50bf1c}},'log':_0x7a83('0x4')});};exports[_0x7a83('0x5')]=function(_0x4b3d32,_0x3fc092){return client['Request'](_0x7a83('0x6'),{'body':_0x3fc092,'options':{'where':{'id':_0x4b3d32}},'log':_0x7a83('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 9c4362a..a108fc5 100644 --- a/server/services/routing/rpc/openchannelMessage.js +++ b/server/services/routing/rpc/openchannelMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc76=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0xcc76,0x130));var _0x6cc7=function(_0x1b41b7,_0x368b9d){_0x1b41b7=_0x1b41b7-0x0;var _0x40a0b5=_0xcc76[_0x1b41b7];return _0x40a0b5;};'use strict';var client=require('../client');exports[_0x6cc7('0x0')]=function(_0x3e5b16){return client[_0x6cc7('0x1')](_0x6cc7('0x2'),{'body':_0x3e5b16,'log':_0x6cc7('0x3')});}; \ No newline at end of file +var _0x4be6=['CreateOpenchannelMessage','../client','create'];(function(_0x1c6feb,_0x331990){var _0x35691d=function(_0x3635e3){while(--_0x3635e3){_0x1c6feb['push'](_0x1c6feb['shift']());}};_0x35691d(++_0x331990);}(_0x4be6,0xaf));var _0x64be=function(_0x33b110,_0x877e4e){_0x33b110=_0x33b110-0x0;var _0x55f99f=_0x4be6[_0x33b110];return _0x55f99f;};'use strict';var client=require(_0x64be('0x0'));exports[_0x64be('0x1')]=function(_0x579297){return client['Request'](_0x64be('0x2'),{'body':_0x579297,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index af11761..ebb4fb3 100644 --- a/server/services/routing/rpc/openchannelQueue.js +++ b/server/services/routing/rpc/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff1e=['Agents','name','online','openchannelPause','getOpenchannelQueues','Request','timeout','strategy','User'];(function(_0xd5481b,_0x2b8c2f){var _0x20ca7c=function(_0xb50fb0){while(--_0xb50fb0){_0xd5481b['push'](_0xd5481b['shift']());}};_0x20ca7c(++_0x2b8c2f);}(_0xff1e,0x1c6));var _0xeff1=function(_0x48999d,_0x1e02cb){_0x48999d=_0x48999d-0x0;var _0x1ad0d1=_0xff1e[_0x48999d];return _0x1ad0d1;};'use strict';var client=require('../client');exports[_0xeff1('0x0')]=function(){return function(){return client[_0xeff1('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0xeff1('0x2'),_0xeff1('0x3')],'include':[{'model':_0xeff1('0x4'),'as':_0xeff1('0x5'),'attributes':['id',_0xeff1('0x6'),_0xeff1('0x7'),_0xeff1('0x8')]}]},'log':_0xeff1('0x0')});};}; \ No newline at end of file +var _0xfbd5=['getOpenchannelQueues','GetOpenchannelQueue','timeout','strategy','User','Agents','name','online','openchannelPause'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xfbd5,0x7e));var _0x5fbd=function(_0x5483c3,_0x418d8d){_0x5483c3=_0x5483c3-0x0;var _0x19ef72=_0xfbd5[_0x5483c3];return _0x19ef72;};'use strict';var client=require('../client');exports[_0x5fbd('0x0')]=function(){return function(){return client['Request'](_0x5fbd('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x5fbd('0x2'),_0x5fbd('0x3')],'include':[{'model':_0x5fbd('0x4'),'as':_0x5fbd('0x5'),'attributes':['id',_0x5fbd('0x6'),_0x5fbd('0x7'),_0x5fbd('0x8')]}]},'log':_0x5fbd('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 27e8703..1177fc6 100644 --- a/server/services/routing/rpc/openchannelQueueReport.js +++ b/server/services/routing/rpc/openchannelQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5464=['CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','../client','Request'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x5464,0xb2));var _0x4546=function(_0x3cbd36,_0x1cbab7){_0x3cbd36=_0x3cbd36-0x0;var _0x462082=_0x5464[_0x3cbd36];return _0x462082;};'use strict';var client=require(_0x4546('0x0'));exports['create']=function(_0x40a817){return client[_0x4546('0x1')]('CreateOpenchannelQueueReport',{'body':_0x40a817,'log':_0x4546('0x2')});};exports[_0x4546('0x3')]=function(_0x493d6b,_0x497a18){return client[_0x4546('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x497a18,'options':{'where':{'uniqueid':_0x493d6b},'order':[['id',_0x4546('0x4')]],'limit':0x1},'log':_0x4546('0x5')});}; \ No newline at end of file +var _0xbc9d=['../client','create','Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC'];(function(_0x46ce9d,_0xa564b0){var _0x1639c4=function(_0x1f59a2){while(--_0x1f59a2){_0x46ce9d['push'](_0x46ce9d['shift']());}};_0x1639c4(++_0xa564b0);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x54b662,_0x1738b6){_0x54b662=_0x54b662-0x0;var _0x1b74da=_0xbc9d[_0x54b662];return _0x1b74da;};'use strict';var client=require(_0xdbc9('0x0'));exports[_0xdbc9('0x1')]=function(_0x8aa82b){return client[_0xdbc9('0x2')](_0xdbc9('0x3'),{'body':_0x8aa82b,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x4fab6e,_0x2aba48){return client[_0xdbc9('0x2')](_0xdbc9('0x4'),{'body':_0x2aba48,'options':{'where':{'uniqueid':_0x4fab6e},'order':[['id',_0xdbc9('0x5')]],'limit':0x1},'log':_0xdbc9('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index c50d39a..fbfcc42 100644 --- a/server/services/routing/rpc/smsInteraction.js +++ b/server/services/routing/rpc/smsInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe799=['UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','../client','Request'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe799,0x170));var _0x9e79=function(_0x40a9aa,_0x42f92c){_0x40a9aa=_0x40a9aa-0x0;var _0x4e974c=_0xe799[_0x40a9aa];return _0x4e974c;};'use strict';var client=require(_0x9e79('0x0'));exports['update']=function(_0x3308ba,_0x59bc90){return client[_0x9e79('0x1')](_0x9e79('0x2'),{'body':_0x59bc90,'options':{'where':{'id':_0x3308ba}},'log':'updateSmsInteraction'});};exports[_0x9e79('0x3')]=function(_0x3f0a4f,_0x809ffd){return client['Request'](_0x9e79('0x4'),{'body':_0x809ffd,'options':{'where':{'id':_0x3f0a4f}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x5292=['Request','../client','update','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x2f3218,_0x57b213){var _0x4b42f1=function(_0x5ab738){while(--_0x5ab738){_0x2f3218['push'](_0x2f3218['shift']());}};_0x4b42f1(++_0x57b213);}(_0x5292,0xf7));var _0x2529=function(_0x2b305c,_0x5ae303){_0x2b305c=_0x2b305c-0x0;var _0x5d8c85=_0x5292[_0x2b305c];return _0x5d8c85;};'use strict';var client=require(_0x2529('0x0'));exports[_0x2529('0x1')]=function(_0x5d674c,_0x2ec817){return client['Request'](_0x2529('0x2'),{'body':_0x2ec817,'options':{'where':{'id':_0x5d674c}},'log':_0x2529('0x3')});};exports[_0x2529('0x4')]=function(_0x228165,_0x5d25dc){return client[_0x2529('0x5')]('AddTagsToSmsInteraction',{'body':_0x5d25dc,'options':{'where':{'id':_0x228165}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 585fbe6..b6ec336 100644 --- a/server/services/routing/rpc/smsMessage.js +++ b/server/services/routing/rpc/smsMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac1d=['Request','CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0xac1d,0x1bb));var _0xdac1=function(_0x57cfd6,_0x33d669){_0x57cfd6=_0x57cfd6-0x0;var _0x4f30b3=_0xac1d[_0x57cfd6];return _0x4f30b3;};'use strict';var client=require(_0xdac1('0x0'));exports[_0xdac1('0x1')]=function(_0x134739){return client[_0xdac1('0x2')](_0xdac1('0x3'),{'body':_0x134739,'log':_0xdac1('0x4')});}; \ No newline at end of file +var _0x84d7=['Request','CreateSmsMessage','create'];(function(_0x966478,_0x5b7b09){var _0x5ec091=function(_0x2fa540){while(--_0x2fa540){_0x966478['push'](_0x966478['shift']());}};_0x5ec091(++_0x5b7b09);}(_0x84d7,0x10d));var _0x784d=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x84d7[_0x2dadb9];return _0x2f0097;};'use strict';var client=require('../client');exports[_0x784d('0x0')]=function(_0x368659){return client[_0x784d('0x1')](_0x784d('0x2'),{'body':_0x368659,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 10ee12a..6416721 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x208f0e,_0x13cb05){var _0x526c9f=function(_0x37b74d){while(--_0x37b74d){_0x208f0e['push'](_0x208f0e['shift']());}};_0x526c9f(++_0x13cb05);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x18b5d2,_0x66d89e){var _0x41c69d=function(_0x3601a1){while(--_0x3601a1){_0x18b5d2['push'](_0x18b5d2['shift']());}};_0x41c69d(++_0x66d89e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0xcb91[_0x57add2];return _0x4e3670;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 2004aa0..fe21ce6 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x4b82a9,_0x13626b){var _0x418eea=function(_0x33f6dd){while(--_0x33f6dd){_0x4b82a9['push'](_0x4b82a9['shift']());}};_0x418eea(++_0x13626b);}(_0x70e0,0x17b));var _0x070e=function(_0x32e86b,_0x5322f6){_0x32e86b=_0x32e86b-0x0;var _0x406098=_0x70e0[_0x32e86b];return _0x406098;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file +var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x28f90c,_0x4bb6d1){var _0x2f4a33=function(_0x2b4351){while(--_0x2b4351){_0x28f90c['push'](_0x28f90c['shift']());}};_0x2f4a33(++_0x4bb6d1);}(_0x55ca,0x126));var _0xa55c=function(_0x51a1e7,_0x54cc87){_0x51a1e7=_0x51a1e7-0x0;var _0x4980d2=_0x55ca[_0x51a1e7];return _0x4980d2;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 2c98324..6e48525 100644 --- a/server/services/routing/rpc/user.js +++ b/server/services/routing/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x4235e5,_0x55f6a2){var _0x25823f=function(_0x3ebf8f){while(--_0x3ebf8f){_0x4235e5['push'](_0x4235e5['shift']());}};_0x25823f(++_0x55f6a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x21fb89,_0x3e0438){var _0x24da0e=function(_0x56e933){while(--_0x56e933){_0x21fb89['push'](_0x21fb89['shift']());}};_0x24da0e(++_0x3e0438);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 54a948b..9c18429 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x277c=['updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','../client','Request','UpdateWhatsappInteraction'];(function(_0x1ce8cf,_0x38f192){var _0x5b0a5d=function(_0x47e3a9){while(--_0x47e3a9){_0x1ce8cf['push'](_0x1ce8cf['shift']());}};_0x5b0a5d(++_0x38f192);}(_0x277c,0x153));var _0xc277=function(_0x2c7bf4,_0x1eaf6f){_0x2c7bf4=_0x2c7bf4-0x0;var _0x2dc505=_0x277c[_0x2c7bf4];return _0x2dc505;};'use strict';var client=require(_0xc277('0x0'));exports['update']=function(_0x2bb260,_0x3420cf){return client[_0xc277('0x1')](_0xc277('0x2'),{'body':_0x3420cf,'options':{'where':{'id':_0x2bb260}},'log':_0xc277('0x3')});};exports[_0xc277('0x4')]=function(_0x72f952,_0x29f81d){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0x29f81d,'options':{'where':{'id':_0x72f952}},'log':_0xc277('0x5')});}; \ No newline at end of file +var _0x9bd9=['../client','update','Request','UpdateWhatsappInteraction','addTags','addTagsToWhatsappInteraction'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x50e67a,_0x1784b8){_0x50e67a=_0x50e67a-0x0;var _0x34ff8d=_0x9bd9[_0x50e67a];return _0x34ff8d;};'use strict';var client=require(_0x99bd('0x0'));exports[_0x99bd('0x1')]=function(_0x2a3101,_0x3ed553){return client[_0x99bd('0x2')](_0x99bd('0x3'),{'body':_0x3ed553,'options':{'where':{'id':_0x2a3101}},'log':'updateWhatsappInteraction'});};exports[_0x99bd('0x4')]=function(_0x4a0491,_0x204fbb){return client[_0x99bd('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x204fbb,'options':{'where':{'id':_0x4a0491}},'log':_0x99bd('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 6b8724b..24443ed 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ec6=['CreateWhatsappMessage','Request'];(function(_0xfe61be,_0xfd4ba3){var _0x1cd97f=function(_0x448d6c){while(--_0x448d6c){_0xfe61be['push'](_0xfe61be['shift']());}};_0x1cd97f(++_0xfd4ba3);}(_0x0ec6,0x1bb));var _0x60ec=function(_0x51a42f,_0x214baa){_0x51a42f=_0x51a42f-0x0;var _0x4a354a=_0x0ec6[_0x51a42f];return _0x4a354a;};'use strict';var client=require('../client');exports['create']=function(_0x935224){return client[_0x60ec('0x0')](_0x60ec('0x1'),{'body':_0x935224,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xfa5a=['CreateWhatsappMessage','createWhatsappMessage'];(function(_0x3531d0,_0x2d7fa6){var _0x5edec8=function(_0xb8f213){while(--_0xb8f213){_0x3531d0['push'](_0x3531d0['shift']());}};_0x5edec8(++_0x2d7fa6);}(_0xfa5a,0xfc));var _0xafa5=function(_0x34a3ff,_0x53e500){_0x34a3ff=_0x34a3ff-0x0;var _0x1672d8=_0xfa5a[_0x34a3ff];return _0x1672d8;};'use strict';var client=require('../client');exports['create']=function(_0x128b46){return client['Request'](_0xafa5('0x0'),{'body':_0x128b46,'log':_0xafa5('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 813657e..d9c0102 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0428=['online','../client','getWhatsappQueues','name','timeout','strategy','User'];(function(_0x2e0e37,_0x83de4b){var _0x468443=function(_0x5379c8){while(--_0x5379c8){_0x2e0e37['push'](_0x2e0e37['shift']());}};_0x468443(++_0x83de4b);}(_0x0428,0x13c));var _0x8042=function(_0x3ad23d,_0x1c5fd3){_0x3ad23d=_0x3ad23d-0x0;var _0x5aeda0=_0x0428[_0x3ad23d];return _0x5aeda0;};'use strict';var client=require(_0x8042('0x0'));exports[_0x8042('0x1')]=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x8042('0x2'),_0x8042('0x3'),_0x8042('0x4')],'include':[{'model':_0x8042('0x5'),'as':'Agents','attributes':['id',_0x8042('0x2'),_0x8042('0x6'),'whatsappPause']}]},'log':_0x8042('0x1')});};}; \ No newline at end of file +var _0x3207=['User','online','../client','getWhatsappQueues','Request','name','timeout'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x3207,0x95));var _0x7320=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x3207[_0x525af9];return _0x129fbf;};'use strict';var client=require(_0x7320('0x0'));exports[_0x7320('0x1')]=function(){return function(){return client[_0x7320('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x7320('0x3'),_0x7320('0x4'),'strategy'],'include':[{'model':_0x7320('0x5'),'as':'Agents','attributes':['id',_0x7320('0x3'),_0x7320('0x6'),'whatsappPause']}]},'log':_0x7320('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index fc6601d..4d94b6f 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a3e=['update','DESC','UpdateWhatsappQueueReport','create','Request','CreateWhatsappQueueReport'];(function(_0x1243c2,_0x16fec4){var _0x4dfe48=function(_0x535892){while(--_0x535892){_0x1243c2['push'](_0x1243c2['shift']());}};_0x4dfe48(++_0x16fec4);}(_0x2a3e,0x1bf));var _0xe2a3=function(_0x1e61fa,_0x20207e){_0x1e61fa=_0x1e61fa-0x0;var _0x214ffa=_0x2a3e[_0x1e61fa];return _0x214ffa;};'use strict';var client=require('../client');exports[_0xe2a3('0x0')]=function(_0x4e42d0){return client[_0xe2a3('0x1')](_0xe2a3('0x2'),{'body':_0x4e42d0,'log':_0xe2a3('0x2')});};exports[_0xe2a3('0x3')]=function(_0x2a1ca4,_0x438862){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x438862,'options':{'where':{'uniqueid':_0x2a1ca4},'order':[['id',_0xe2a3('0x4')]],'limit':0x1},'log':_0xe2a3('0x5')});}; \ No newline at end of file +var _0xae9b=['update','Request','UpdateWhatsappQueueReport','DESC','../client','create','CreateWhatsappQueueReport'];(function(_0x2ffcb1,_0x559b0d){var _0x333da2=function(_0x1430e2){while(--_0x1430e2){_0x2ffcb1['push'](_0x2ffcb1['shift']());}};_0x333da2(++_0x559b0d);}(_0xae9b,0x1a1));var _0xbae9=function(_0x2f86bd,_0x24e6f4){_0x2f86bd=_0x2f86bd-0x0;var _0x7d42e6=_0xae9b[_0x2f86bd];return _0x7d42e6;};'use strict';var client=require(_0xbae9('0x0'));exports[_0xbae9('0x1')]=function(_0x452713){return client['Request']('CreateWhatsappQueueReport',{'body':_0x452713,'log':_0xbae9('0x2')});};exports[_0xbae9('0x3')]=function(_0x41504e,_0x3894ea){return client[_0xbae9('0x4')](_0xbae9('0x5'),{'body':_0x3894ea,'options':{'where':{'uniqueid':_0x41504e},'order':[['id',_0xbae9('0x6')]],'limit':0x1},'log':_0xbae9('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 4d71596..13214c8 100644 --- a/server/services/routing/server/applications/agent.js +++ b/server/services/routing/server/applications/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b16=['rules','end','close','next','agent','log','[%s][QUEUE]\x20%s','validate','util','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','error','[%s][AGENT]\x20%s','map','join','stop','agents','timeout','channel','START:%s'];(function(_0x2e9301,_0x375e89){var _0xe1dead=function(_0x1920cc){while(--_0x1920cc){_0x2e9301['push'](_0x2e9301['shift']());}};_0xe1dead(++_0x375e89);}(_0x5b16,0x180));var _0x65b1=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x5b16[_0x257642];return _0x3d813b;};'use strict';var schema=require(_0x65b1('0x0'));var _=require('lodash');var util=require(_0x65b1('0x1'));var seqqueue=require('seq-queue');var logger=require(_0x65b1('0x2'))(_0x65b1('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x65b1('0x4'),'required':!![],'message':_0x65b1('0x5')},'timeout':{'type':_0x65b1('0x6'),'message':_0x65b1('0x7')}});function writeLog(_0x48c4dc,_0x28ea21,_0x4e4c9a){return logger[_0x65b1('0x8')](util[_0x65b1('0x9')](_0x65b1('0xa'),_0x48c4dc,_0x28ea21[_0x65b1('0xb')],_0x4e4c9a));}function handleFindAgent(_0x59151a){return function(_0x4837bd){return _0x4837bd[_0x65b1('0xb')]['toLowerCase']()===_0x59151a[_0x65b1('0xc')]();};}exports['consequence']=function(_0x5ef189,_0x48bb0e,_0x54388c,_0x4c369a){return function(_0xb23162){try{var _0x5a9283={'name':_0x48bb0e[0x0],'timeout':_0x48bb0e[0x1]};var _0xfd1fa1=queue[_0x65b1('0x0')](_0x5a9283,{'typecast':!![]});if(_0xfd1fa1['length']){logger[_0x65b1('0xd')](_0x65b1('0xe'),_0x5ef189,_[_0x65b1('0xf')](_0xfd1fa1,'message')[_0x65b1('0x10')](',\x20'));_0xb23162[_0x65b1('0x11')]();}else{var _0x2202f7=_['find'](_0x54388c[_0x65b1('0x12')],handleFindAgent(_0x5a9283[_0x65b1('0xb')]));if(_0x2202f7){var _0x4ede9f=(_0x5a9283[_0x65b1('0x13')]||0xa)*0x3e8;var _0x3c5382,_0x5896e9;var _0x52f74d=seqqueue['createQueue'](_0x4ede9f);_0x52f74d['id']=_0x5ef189;_0x52f74d['atimeout']=_0x4ede9f;_0x52f74d[_0x65b1('0x14')]=_0x4c369a[_0x65b1('0x14')];writeLog(_0x5ef189,_0x2202f7,util[_0x65b1('0x9')](_0x65b1('0x15'),_0x4ede9f));_0x54388c[_0x65b1('0x16')][_0x5ef189]['on'](_0x65b1('0x17'),function(){logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x5ef189);clearTimeout(_0x5896e9);_0x5896e9=undefined;_0x52f74d[_0x65b1('0x18')]();if(_0x54388c[_0x65b1('0x16')][_0x5ef189]){delete _0x54388c[_0x65b1('0x16')][_0x5ef189];}_0xb23162[_0x65b1('0x11')]();});_0x54388c[_0x65b1('0x16')][_0x5ef189]['on']('complete',function(){if(_0x54388c[_0x65b1('0x16')][_0x5ef189]){delete _0x54388c[_0x65b1('0x16')][_0x5ef189];}});_0x5896e9=setTimeout(function(){logger[_0x65b1('0x8')]('[%s][AGENT]\x20ROUTING\x20END',_0x5ef189);clearTimeout(_0x5896e9);_0x52f74d[_0x65b1('0x18')]();_0xb23162[_0x65b1('0x19')]();},_0x4ede9f);strategy[_0x65b1('0x1a')](_0x52f74d,_0x2202f7,_0x54388c,_0x4c369a);}else{logger[_0x65b1('0xd')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x5ef189,_0x5a9283[_0x65b1('0xb')]);_0xb23162[_0x65b1('0x11')]();}}}catch(_0x5b4f4c){console[_0x65b1('0x1b')](_0x5b4f4c);logger['error'](_0x65b1('0x1c'),_0x5ef189,_0x5b4f4c['stack']);_0xb23162[_0x65b1('0x11')]();}};}; \ No newline at end of file +var _0x0e15=['../../../../config/logger','routing','./strategy','number','timeout\x20is\x20a\x20number','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','join','stop','timeout','createQueue','atimeout','channel','format','rules','end','info','close','complete','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue'];(function(_0x5ac0f0,_0xee4d98){var _0x4aceec=function(_0x3a9044){while(--_0x3a9044){_0x5ac0f0['push'](_0x5ac0f0['shift']());}};_0x4aceec(++_0xee4d98);}(_0x0e15,0x1bc));var _0x50e1=function(_0x31e4a8,_0x3af27e){_0x31e4a8=_0x31e4a8-0x0;var _0x1d8859=_0x0e15[_0x31e4a8];return _0x1d8859;};'use strict';var schema=require(_0x50e1('0x0'));var _=require(_0x50e1('0x1'));var util=require(_0x50e1('0x2'));var seqqueue=require(_0x50e1('0x3'));var logger=require(_0x50e1('0x4'))(_0x50e1('0x5'));var strategy=require(_0x50e1('0x6'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x50e1('0x7'),'message':_0x50e1('0x8')}});function writeLog(_0x5cf18a,_0x2ba564,_0x139f85){return logger['info'](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x5cf18a,_0x2ba564['name'],_0x139f85));}function handleFindAgent(_0x171aa3){return function(_0x529223){return _0x529223[_0x50e1('0x9')][_0x50e1('0xa')]()===_0x171aa3[_0x50e1('0xa')]();};}exports[_0x50e1('0xb')]=function(_0x1504c3,_0xbfbf32,_0x239feb,_0x25f1de){return function(_0x1badcf){try{var _0x3d712d={'name':_0xbfbf32[0x0],'timeout':_0xbfbf32[0x1]};var _0x198071=queue[_0x50e1('0x0')](_0x3d712d,{'typecast':!![]});if(_0x198071[_0x50e1('0xc')]){logger[_0x50e1('0xd')](_0x50e1('0xe'),_0x1504c3,_[_0x50e1('0xf')](_0x198071,'message')[_0x50e1('0x10')](',\x20'));_0x1badcf[_0x50e1('0x11')]();}else{var _0x497860=_['find'](_0x239feb['agents'],handleFindAgent(_0x3d712d['name']));if(_0x497860){var _0x4b97e9=(_0x3d712d[_0x50e1('0x12')]||0xa)*0x3e8;var _0x294ad0,_0x511d9c;var _0x3d4eeb=seqqueue[_0x50e1('0x13')](_0x4b97e9);_0x3d4eeb['id']=_0x1504c3;_0x3d4eeb[_0x50e1('0x14')]=_0x4b97e9;_0x3d4eeb[_0x50e1('0x15')]=_0x25f1de[_0x50e1('0x15')];writeLog(_0x1504c3,_0x497860,util[_0x50e1('0x16')]('START:%s',_0x4b97e9));_0x239feb[_0x50e1('0x17')][_0x1504c3]['on'](_0x50e1('0x18'),function(){logger[_0x50e1('0x19')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x1504c3);clearTimeout(_0x511d9c);_0x511d9c=undefined;_0x3d4eeb[_0x50e1('0x1a')]();if(_0x239feb[_0x50e1('0x17')][_0x1504c3]){delete _0x239feb[_0x50e1('0x17')][_0x1504c3];}_0x1badcf['stop']();});_0x239feb['rules'][_0x1504c3]['on'](_0x50e1('0x1b'),function(){if(_0x239feb[_0x50e1('0x17')][_0x1504c3]){delete _0x239feb['rules'][_0x1504c3];}});_0x511d9c=setTimeout(function(){logger[_0x50e1('0x19')]('[%s][AGENT]\x20ROUTING\x20END',_0x1504c3);clearTimeout(_0x511d9c);_0x3d4eeb[_0x50e1('0x1a')]();_0x1badcf[_0x50e1('0x1c')]();},_0x4b97e9);strategy['agent'](_0x3d4eeb,_0x497860,_0x239feb,_0x25f1de);}else{logger[_0x50e1('0xd')](_0x50e1('0x1d'),_0x1504c3,_0x3d712d['name']);_0x1badcf[_0x50e1('0x11')]();}}}catch(_0x22f1e0){console['log'](_0x22f1e0);logger[_0x50e1('0xd')](_0x50e1('0x1e'),_0x1504c3,_0x22f1e0[_0x50e1('0x1f')]);_0x1badcf[_0x50e1('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 8f85900..f340668 100644 --- a/server/services/routing/server/applications/amazonlex.js +++ b/server/services/routing/server/applications/amazonlex.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47af=['info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','Message','then','catch','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','toString','postText','error','message','amazonlex','providerName','providerResponse','lodash','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','UserId'];(function(_0x388b47,_0x5cdac5){var _0x4859df=function(_0x466a16){while(--_0x466a16){_0x388b47['push'](_0x388b47['shift']());}};_0x4859df(++_0x5cdac5);}(_0x47af,0xfa));var _0xf47a=function(_0x92e7c8,_0x50ddd9){_0x92e7c8=_0x92e7c8-0x0;var _0x3d65c2=_0x47af[_0x92e7c8];return _0x3d65c2;};'use strict';var _=require(_0xf47a('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0xf47a('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xf47a('0x2')),'openchannelMessage':require(_0xf47a('0x3')),'mailMessage':require(_0xf47a('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf47a('0x5')),'whatsappMessage':require(_0xf47a('0x6'))};exports['consequence']=function(_0x59fbf9,_0x39f566){return function(_0x554689){try{if(!_['isNil'](this['interaction'][_0xf47a('0x7')])){logger[_0xf47a('0x8')](_0xf47a('0x9'),_0x59fbf9,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x554689[_0xf47a('0xa')]();}var _0x3b6915={'ContactId':this[_0xf47a('0xb')]['id'],'sentAt':moment()[_0xf47a('0xc')](_0xf47a('0xd')),'direction':_0xf47a('0xe')};if(this[_0xf47a('0xf')]==='sms'||this[_0xf47a('0xf')]===_0xf47a('0x10')){_0x3b6915[_0xf47a('0x11')]=this[_0xf47a('0x12')][_0xf47a('0x11')];}var _0x3332ca=this[_0xf47a('0xf')];if(_0x3332ca===_0xf47a('0x13')){_0x3b6915[_0xf47a('0x14')]=this[_0xf47a('0x15')]['id'];}else{_0x3b6915[_[_0xf47a('0x16')](_0x3332ca)+_0xf47a('0x17')]=this['account']['id'];}_0x3b6915[_['upperFirst'](_0x3332ca)+_0xf47a('0x18')]=this['interaction']['id'];if(this[_0xf47a('0x12')][_0xf47a('0x19')]){var _0x3b803f=_0x39f566[0x4];if(!_[_0xf47a('0x1a')](_0x3b803f)){_0x3b6915[_0xf47a('0x1b')]=utils['getMustacheRender'](_0x3b803f,this);return rpc[_0x3332ca+_0xf47a('0x1c')]['create'](_0x3b6915)[_0xf47a('0x1d')](function(_0xf5281){logger[_0xf47a('0x8')]('[%s][AMAZONLEX]\x20%s',_0x59fbf9,_0x3b6915[_0xf47a('0x1b')]);})[_0xf47a('0x1e')](function(_0x59f5a1){logger['error'](_0xf47a('0x9'),_0x59fbf9,JSON[_0xf47a('0x1f')](_0x59f5a1));})['finally'](function(){logger[_0xf47a('0x8')](_0xf47a('0x20'),_0x59fbf9);_0x554689[_0xf47a('0x21')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x59fbf9);_0x554689['stop']();}}else{var _0x1117cf=this;var _0x33ec7c=new AWS[(_0xf47a('0x22'))]({'accessKeyId':_0x39f566[0x0],'secretAccessKey':_0x39f566[0x1],'region':_0x39f566[0x2]});var _0x504de8={'botAlias':_0xf47a('0x23'),'botName':_0x39f566[0x3],'inputText':this['message'][_0xf47a('0x1b')],'userId':this[_0xf47a('0xf')]+':'+this[_0xf47a('0x12')]['id'][_0xf47a('0x24')]()};_0x33ec7c[_0xf47a('0x25')](_0x504de8,function(_0x417cb0,_0x4b3ed8){if(_0x417cb0){logger[_0xf47a('0x26')]('[%s][AMAZONLEX]\x20%s',_0x59fbf9,_0x417cb0['message']);_0x554689[_0xf47a('0xa')]();}else if(_0x4b3ed8&&_0x4b3ed8[_0xf47a('0x27')]){_0x1117cf[_0xf47a('0x1b')][_0xf47a('0x28')]=_0x4b3ed8;_0x3b6915[_0xf47a('0x1b')]=_0x4b3ed8['message'];_0x3b6915[_0xf47a('0x29')]=_0xf47a('0x28');_0x3b6915[_0xf47a('0x2a')]=JSON[_0xf47a('0x1f')](_0x4b3ed8);return rpc[_0x3332ca+_0xf47a('0x1c')]['create'](_0x3b6915)[_0xf47a('0x1d')](function(_0x3ddcbd){logger[_0xf47a('0x8')](_0xf47a('0x9'),_0x59fbf9,_0x3b6915[_0xf47a('0x1b')]);if(_0x4b3ed8['dialogState']=='Failed'){_0x554689['next']();}else{_0x554689['stop']();}})['catch'](function(_0xdf7387){logger[_0xf47a('0x26')](_0xf47a('0x9'),_0x59fbf9,JSON['stringify'](_0xdf7387));_0x554689[_0xf47a('0xa')]();});}else{_0x554689[_0xf47a('0xa')]();}});}}catch(_0x2cef50){logger['error'](_0xf47a('0x9'),_0x59fbf9,JSON[_0xf47a('0x1f')](_0x2cef50));_0x554689[_0xf47a('0x21')]();}};}; \ No newline at end of file +var _0xb3e3=['Message','create','dialogState','stringify','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','then','body','catch','error','finally','stop','LexRuntime','$LATEST','message','toString','postText','amazonlex'];(function(_0x250077,_0x25bbf3){var _0x5105c8=function(_0x1bf393){while(--_0x1bf393){_0x250077['push'](_0x250077['shift']());}};_0x5105c8(++_0x25bbf3);}(_0xb3e3,0x194));var _0x3b3e=function(_0x29e801,_0x4a3ac6){_0x29e801=_0x29e801-0x0;var _0x417748=_0xb3e3[_0x29e801];return _0x417748;};'use strict';var _=require(_0x3b3e('0x0'));var moment=require(_0x3b3e('0x1'));var AWS=require(_0x3b3e('0x2'));var utils=require(_0x3b3e('0x3'));var logger=require(_0x3b3e('0x4'))(_0x3b3e('0x5'));var rpc={'chatMessage':require(_0x3b3e('0x6')),'openchannelMessage':require(_0x3b3e('0x7')),'mailMessage':require(_0x3b3e('0x8')),'smsMessage':require(_0x3b3e('0x9')),'faxMessage':require(_0x3b3e('0xa')),'whatsappMessage':require(_0x3b3e('0xb'))};exports['consequence']=function(_0x42e707,_0x5ba6ec){return function(_0x2b4623){try{if(!_[_0x3b3e('0xc')](this[_0x3b3e('0xd')][_0x3b3e('0xe')])){logger[_0x3b3e('0xf')](_0x3b3e('0x10'),_0x42e707,_0x3b3e('0x11'));return _0x2b4623[_0x3b3e('0x12')]();}var _0x43b5ab={'ContactId':this[_0x3b3e('0x13')]['id'],'sentAt':moment()[_0x3b3e('0x14')](_0x3b3e('0x15')),'direction':'out'};if(this[_0x3b3e('0x16')]===_0x3b3e('0x17')||this['channel']===_0x3b3e('0x18')){_0x43b5ab['phone']=this[_0x3b3e('0xd')][_0x3b3e('0x19')];}var _0x31f017=this[_0x3b3e('0x16')];if(_0x31f017===_0x3b3e('0x1a')){_0x43b5ab[_0x3b3e('0x1b')]=this['account']['id'];}else{_0x43b5ab[_[_0x3b3e('0x1c')](_0x31f017)+_0x3b3e('0x1d')]=this[_0x3b3e('0x1e')]['id'];}_0x43b5ab[_[_0x3b3e('0x1c')](_0x31f017)+_0x3b3e('0x1f')]=this[_0x3b3e('0xd')]['id'];if(this[_0x3b3e('0xd')][_0x3b3e('0x20')]){var _0x38b37e=_0x5ba6ec[0x4];if(!_[_0x3b3e('0x21')](_0x38b37e)){_0x43b5ab['body']=utils['getMustacheRender'](_0x38b37e,this);return rpc[_0x31f017+'Message']['create'](_0x43b5ab)[_0x3b3e('0x22')](function(_0x2fb993){logger['info'](_0x3b3e('0x10'),_0x42e707,_0x43b5ab[_0x3b3e('0x23')]);})[_0x3b3e('0x24')](function(_0x2ab8fd){logger[_0x3b3e('0x25')](_0x3b3e('0x10'),_0x42e707,JSON['stringify'](_0x2ab8fd));})[_0x3b3e('0x26')](function(){logger[_0x3b3e('0xf')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x42e707);_0x2b4623[_0x3b3e('0x27')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x42e707);_0x2b4623[_0x3b3e('0x27')]();}}else{var _0x28c441=this;var _0x502a21=new AWS[(_0x3b3e('0x28'))]({'accessKeyId':_0x5ba6ec[0x0],'secretAccessKey':_0x5ba6ec[0x1],'region':_0x5ba6ec[0x2]});var _0x5c7534={'botAlias':_0x3b3e('0x29'),'botName':_0x5ba6ec[0x3],'inputText':this[_0x3b3e('0x2a')][_0x3b3e('0x23')],'userId':this[_0x3b3e('0x16')]+':'+this[_0x3b3e('0xd')]['id'][_0x3b3e('0x2b')]()};_0x502a21[_0x3b3e('0x2c')](_0x5c7534,function(_0x4846a1,_0x3abb07){if(_0x4846a1){logger[_0x3b3e('0x25')](_0x3b3e('0x10'),_0x42e707,_0x4846a1[_0x3b3e('0x2a')]);_0x2b4623[_0x3b3e('0x12')]();}else if(_0x3abb07&&_0x3abb07[_0x3b3e('0x2a')]){_0x28c441[_0x3b3e('0x23')]['amazonlex']=_0x3abb07;_0x43b5ab[_0x3b3e('0x23')]=_0x3abb07[_0x3b3e('0x2a')];_0x43b5ab['providerName']=_0x3b3e('0x2d');_0x43b5ab['providerResponse']=JSON['stringify'](_0x3abb07);return rpc[_0x31f017+_0x3b3e('0x2e')][_0x3b3e('0x2f')](_0x43b5ab)['then'](function(_0x12d07a){logger[_0x3b3e('0xf')]('[%s][AMAZONLEX]\x20%s',_0x42e707,_0x43b5ab[_0x3b3e('0x23')]);if(_0x3abb07[_0x3b3e('0x30')]=='Failed'){_0x2b4623[_0x3b3e('0x12')]();}else{_0x2b4623[_0x3b3e('0x27')]();}})['catch'](function(_0x3eb42a){logger[_0x3b3e('0x25')](_0x3b3e('0x10'),_0x42e707,JSON['stringify'](_0x3eb42a));_0x2b4623[_0x3b3e('0x12')]();});}else{_0x2b4623['next']();}});}}catch(_0x23d78a){logger['error']('[%s][AMAZONLEX]\x20%s',_0x42e707,JSON[_0x3b3e('0x31')](_0x23d78a));_0x2b4623[_0x3b3e('0x27')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 414fd63..5a7a6b3 100644 --- a/server/services/routing/server/applications/autoreply.js +++ b/server/services/routing/server/applications/autoreply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1913=['../../mailRpc','consequence','channel','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','created','interaction','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','out','mail','getMustacheRender','message','from','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','html','','replace','';_0x5f4a6c['headers']={'Auto-Submitted':_0x3191('0x31'),'X-Auto-Response-Suppress':_0x3191('0x32'),'Precedence':_0x3191('0x33')};return mailRpc[_0x3191('0x34')](this['account']['smtpOptions'],_0x5f4a6c)[_0x3191('0x35')](function(_0x300abc){logger[_0x3191('0x10')](_0x3191('0x36'),_0x34b937);_0x5f4a6c[_0x3191('0x37')]=_0x300abc[_0x3191('0x1e')][_0x3191('0x37')];return rpc[_0x318763+_0x3191('0x2a')][_0x3191('0x38')](_0x5f4a6c);})[_0x3191('0x35')](function(_0x342823){logger['info'](_0x3191('0x11'),_0x34b937,JSON[_0x3191('0x39')](_0x342823));})[_0x3191('0x3a')](function(_0x18a9a6){logger[_0x3191('0x3b')](_0x3191('0x3c'),_0x34b937,JSON[_0x3191('0x39')](_0x18a9a6));})['finally'](function(){Promise['resolve']()['then'](function(){if(_0x18c010[0x0]!=='2'||_0xa892e8[_0x3191('0x17')])return;return rpc[_0x318763+'Interaction'][_0x3191('0x3d')](_0xa892e8['id'],{'autoreplyExecuted':!![]})['then'](function(_0x3d4fe8){logger[_0x3191('0x10')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x34b937,JSON[_0x3191('0x39')](_0x3d4fe8));})[_0x3191('0x3a')](function(_0x2c7086){logger[_0x3191('0x3b')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x34b937,JSON[_0x3191('0x39')](_0x2c7086));});})['then'](function(){_0x3d00f9['next']();});});}else{return rpc[this[_0x3191('0xd')]+'Message'][_0x3191('0x38')](_0x5f4a6c)['then'](function(){logger[_0x3191('0x10')](_0x3191('0x11'),_0x34b937,_0x5f4a6c[_0x3191('0xe')]);})[_0x3191('0x3a')](function(_0xa740e){logger[_0x3191('0x3b')](_0x3191('0x11'),_0x34b937,JSON[_0x3191('0x39')](_0xa740e));})[_0x3191('0x3e')](function(){Promise[_0x3191('0x3f')]()[_0x3191('0x35')](function(){if(_0x18c010[0x0]!=='2'||_0xa892e8[_0x3191('0x17')])return;return rpc[_0x318763+_0x3191('0x40')]['update'](_0xa892e8['id'],{'autoreplyExecuted':!![]})[_0x3191('0x35')](function(_0x27d758){logger[_0x3191('0x10')](_0x3191('0x18'),_0x34b937,JSON['stringify'](_0x27d758));})[_0x3191('0x3a')](function(_0x131ded){logger[_0x3191('0x3b')](_0x3191('0x41'),_0x34b937,JSON[_0x3191('0x39')](_0x131ded));});})[_0x3191('0x35')](function(){_0x3d00f9[_0x3191('0x16')]();});});}}}catch(_0x3e86c3){logger[_0x3191('0x3b')](_0x3191('0x11'),_0x34b937,JSON[_0x3191('0x39')](_0x3e86c3));_0x3d00f9[_0x3191('0x42')]();}};}; \ No newline at end of file +var _0x771c=['isNil','interaction','created','[%s][AUTOREPLY]\x20%s','autoreplyExecuted','One\x20Time\x20already\x20sent','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info'];(function(_0x32a767,_0x4e3e76){var _0x2b4e6d=function(_0x5e0702){while(--_0x5e0702){_0x32a767['push'](_0x32a767['shift']());}};_0x2b4e6d(++_0x4e3e76);}(_0x771c,0x189));var _0xc771=function(_0x4b3f84,_0x4aed97){_0x4b3f84=_0x4b3f84-0x0;var _0x21b380=_0x771c[_0x4b3f84];return _0x21b380;};'use strict';var _=require(_0xc771('0x0'));var moment=require(_0xc771('0x1'));var utils=require(_0xc771('0x2'));var logger=require(_0xc771('0x3'))(_0xc771('0x4'));var rpc={'chatMessage':require(_0xc771('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xc771('0x6')),'faxMessage':require(_0xc771('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xc771('0x8')),'openchannelInteraction':require(_0xc771('0x9')),'mailInteraction':require(_0xc771('0xa')),'smsInteraction':require(_0xc771('0xb')),'faxInteraction':require(_0xc771('0xc')),'whatsappInteraction':require(_0xc771('0xd'))};var mailRpc=require(_0xc771('0xe'));exports[_0xc771('0xf')]=function(_0x5aba07,_0x198c4c,_0x7bcd33,_0x1634bc){return function(_0x4d6475){try{var _0x29b83c=this[_0xc771('0x10')];if(_0x29b83c===_0xc771('0x11')&&_0x1634bc[_0xc771('0x12')][_0xc771('0x13')]){logger[_0xc771('0x14')]('[%s][AUTOREPLY]\x20%s',_0x5aba07,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x4d6475['next']();}if(_0x198c4c[0x0]==='1'&&(_[_0xc771('0x15')](this['interaction']['created'])||!this[_0xc771('0x16')][_0xc771('0x17')])){logger[_0xc771('0x14')](_0xc771('0x18'),_0x5aba07,'Autoreply\x20already\x20sent');return _0x4d6475['next']();}if(_0x198c4c[0x0]==='2'&&this['interaction'][_0xc771('0x19')]){logger[_0xc771('0x14')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5aba07,_0xc771('0x1a'));return _0x4d6475[_0xc771('0x1b')]();}var _0x1a6caf={'ContactId':this[_0xc771('0x1c')]['id'],'sentAt':moment()['format'](_0xc771('0x1d')),'direction':_0xc771('0x1e')};if(this[_0xc771('0x10')]==='mail'){_0x1a6caf['body']=utils[_0xc771('0x1f')](_0x198c4c[0x2],this);}else{_0x1a6caf['body']=utils[_0xc771('0x1f')](_0x198c4c[0x1],this);}if(this[_0xc771('0x20')]){_0x1a6caf['to']=this[_0xc771('0x20')][_0xc771('0x21')]||'';if(this[_0xc771('0x10')]===_0xc771('0x11')&&_0x198c4c[0x1]==='1'){_0x1a6caf['cc']=this[_0xc771('0x20')]['cc']||'';}_0x1a6caf[_0xc771('0x21')]=this[_0xc771('0x20')]['to']||'';_0x1a6caf[_0xc771('0x22')]=this[_0xc771('0x20')][_0xc771('0x22')]||'';_0x1a6caf[_0xc771('0x23')]=!![];if(this[_0xc771('0x20')][_0xc771('0x24')]){_0x1a6caf[_0xc771('0x24')]='';_0x1a6caf[_0xc771('0x24')]+=_[_0xc771('0x25')](this[_0xc771('0x20')][_0xc771('0x24')],_0xc771('0x26'))?'':_0xc771('0x27');_0x1a6caf[_0xc771('0x24')]+=this['message'][_0xc771('0x24')];}}if(this[_0xc771('0x10')]==='chat'){_0x1a6caf[_0xc771('0x28')]=this['account']['id'];}else{_0x1a6caf[_['upperFirst'](this[_0xc771('0x10')])+'AccountId']=this[_0xc771('0x29')]['id'];}_0x1a6caf[_[_0xc771('0x2a')](this[_0xc771('0x10')])+'InteractionId']=this['interaction']['id'];var _0x2da424=this['interaction'];if(rpc[this[_0xc771('0x10')]+_0xc771('0x2b')]){if(this['channel']==='mail'){_0x1a6caf[_0xc771('0x2c')]=this[_0xc771('0x20')][_0xc771('0x2d')];_0x1a6caf[_0xc771('0x2e')]=_0xc771('0x2f')+_[_0xc771('0x30')](_0x1a6caf[_0xc771('0x12')],_0xc771('0x31'),_0xc771('0x32'))+_0xc771('0x33');_0x1a6caf[_0xc771('0x34')]={'Auto-Submitted':_0xc771('0x35'),'X-Auto-Response-Suppress':'All','Precedence':'auto_reply'};return mailRpc['sendMailMessage'](this[_0xc771('0x29')][_0xc771('0x36')],_0x1a6caf)['then'](function(_0x2c1b79){logger['info'](_0xc771('0x37'),_0x5aba07);_0x1a6caf['messageId']=_0x2c1b79['message'][_0xc771('0x2d')];return rpc[_0x29b83c+_0xc771('0x2b')][_0xc771('0x38')](_0x1a6caf);})[_0xc771('0x39')](function(_0x382249){logger[_0xc771('0x14')](_0xc771('0x18'),_0x5aba07,JSON[_0xc771('0x3a')](_0x382249));})[_0xc771('0x3b')](function(_0x3019d3){logger[_0xc771('0x3c')](_0xc771('0x3d'),_0x5aba07,JSON[_0xc771('0x3a')](_0x3019d3));})[_0xc771('0x3e')](function(){Promise[_0xc771('0x3f')]()[_0xc771('0x39')](function(){if(_0x198c4c[0x0]!=='2'||_0x2da424[_0xc771('0x19')])return;return rpc[_0x29b83c+_0xc771('0x40')][_0xc771('0x41')](_0x2da424['id'],{'autoreplyExecuted':!![]})[_0xc771('0x39')](function(_0xfb0edf){logger[_0xc771('0x14')](_0xc771('0x42'),_0x5aba07,JSON[_0xc771('0x3a')](_0xfb0edf));})[_0xc771('0x3b')](function(_0x2db3b5){logger['error'](_0xc771('0x43'),_0x5aba07,JSON[_0xc771('0x3a')](_0x2db3b5));});})[_0xc771('0x39')](function(){_0x4d6475[_0xc771('0x1b')]();});});}else{return rpc[this[_0xc771('0x10')]+_0xc771('0x2b')][_0xc771('0x38')](_0x1a6caf)['then'](function(){logger[_0xc771('0x14')]('[%s][AUTOREPLY]\x20%s',_0x5aba07,_0x1a6caf[_0xc771('0x12')]);})[_0xc771('0x3b')](function(_0x5bb2de){logger[_0xc771('0x3c')](_0xc771('0x18'),_0x5aba07,JSON[_0xc771('0x3a')](_0x5bb2de));})['finally'](function(){Promise[_0xc771('0x3f')]()[_0xc771('0x39')](function(){if(_0x198c4c[0x0]!=='2'||_0x2da424[_0xc771('0x19')])return;return rpc[_0x29b83c+_0xc771('0x40')][_0xc771('0x41')](_0x2da424['id'],{'autoreplyExecuted':!![]})[_0xc771('0x39')](function(_0x4ec5e4){logger[_0xc771('0x14')](_0xc771('0x42'),_0x5aba07,JSON[_0xc771('0x3a')](_0x4ec5e4));})[_0xc771('0x3b')](function(_0x187870){logger[_0xc771('0x3c')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5aba07,JSON['stringify'](_0x187870));});})[_0xc771('0x39')](function(){_0x4d6475['next']();});});}}}catch(_0x3a3de1){logger[_0xc771('0x3c')]('[%s][AUTOREPLY]\x20%s',_0x5aba07,JSON[_0xc771('0x3a')](_0x3a3de1));_0x4d6475[_0xc771('0x44')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index af9b059..80642ab 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ac6=['[%s][CLOSE]\x20%s','stringify','finally','stop','error','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','channel','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch'];(function(_0x46c143,_0x1862bc){var _0x36d43b=function(_0x2c34f1){while(--_0x2c34f1){_0x46c143['push'](_0x46c143['shift']());}};_0x36d43b(++_0x1862bc);}(_0x9ac6,0x10d));var _0x69ac=function(_0x4edb84,_0x4c412f){_0x4edb84=_0x4edb84-0x0;var _0x57d78a=_0x9ac6[_0x4edb84];return _0x57d78a;};'use strict';var moment=require('moment');var logger=require(_0x69ac('0x0'))(_0x69ac('0x1'));var rpc={'chatInteraction':require(_0x69ac('0x2')),'openchannelInteraction':require(_0x69ac('0x3')),'smsInteraction':require(_0x69ac('0x4')),'mailInteraction':require(_0x69ac('0x5')),'faxInteraction':require(_0x69ac('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x69ac('0x7')]=function(_0x2cb996,_0x566b56,_0x5defc5,_0x5e1a74){return function(_0x1bbef4){try{logger[_0x69ac('0x8')](_0x69ac('0x9'),_0x2cb996,_0x566b56[0x0]);var _0x14dbb5={'closed':0x1,'closedAt':moment()[_0x69ac('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x566b56[0x0]};if(rpc[_0x5e1a74[_0x69ac('0xb')]+_0x69ac('0xc')]){rpc[_0x5e1a74['channel']+_0x69ac('0xc')]['update'](_0x5e1a74[_0x69ac('0xd')]['id'],_0x14dbb5)[_0x69ac('0xe')](function(_0x25b455){logger[_0x69ac('0x8')](_0x69ac('0xf'),_0x2cb996,_0x5e1a74[_0x69ac('0xd')]['id']);})[_0x69ac('0x10')](function(_0x72b782){logger['error'](_0x69ac('0x11'),_0x2cb996,JSON[_0x69ac('0x12')](_0x72b782));})[_0x69ac('0x13')](function(){_0x1bbef4[_0x69ac('0x14')]();});}}catch(_0x4f63f8){logger[_0x69ac('0x15')]('[%s][CLOSE]\x20%s',_0x2cb996,JSON[_0x69ac('0x12')](_0x4f63f8));_0x1bbef4[_0x69ac('0x14')]();}};}; \ No newline at end of file +var _0xe6da=['../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify','finally','stop','error'];(function(_0x47a0c0,_0x4d132e){var _0x1324f8=function(_0x5955f1){while(--_0x5955f1){_0x47a0c0['push'](_0x47a0c0['shift']());}};_0x1324f8(++_0x4d132e);}(_0xe6da,0x73));var _0xae6d=function(_0x430a84,_0x9b2ae){_0x430a84=_0x430a84-0x0;var _0x454377=_0xe6da[_0x430a84];return _0x454377;};'use strict';var moment=require('moment');var logger=require(_0xae6d('0x0'))(_0xae6d('0x1'));var rpc={'chatInteraction':require(_0xae6d('0x2')),'openchannelInteraction':require(_0xae6d('0x3')),'smsInteraction':require(_0xae6d('0x4')),'mailInteraction':require(_0xae6d('0x5')),'faxInteraction':require(_0xae6d('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0xae6d('0x7')]=function(_0x2fd081,_0x44463d,_0x4b15ff,_0x4ff014){return function(_0x9aa339){try{logger[_0xae6d('0x8')](_0xae6d('0x9'),_0x2fd081,_0x44463d[0x0]);var _0x405c77={'closed':0x1,'closedAt':moment()[_0xae6d('0xa')](_0xae6d('0xb')),'closeReason':_0xae6d('0xc'),'disposition':_0x44463d[0x0]};if(rpc[_0x4ff014[_0xae6d('0xd')]+_0xae6d('0xe')]){rpc[_0x4ff014[_0xae6d('0xd')]+_0xae6d('0xe')][_0xae6d('0xf')](_0x4ff014['interaction']['id'],_0x405c77)['then'](function(_0xc9168b){logger['info'](_0xae6d('0x10'),_0x2fd081,_0x4ff014['interaction']['id']);})[_0xae6d('0x11')](function(_0x5474ca){logger['error'](_0xae6d('0x12'),_0x2fd081,JSON[_0xae6d('0x13')](_0x5474ca));})[_0xae6d('0x14')](function(){_0x9aa339[_0xae6d('0x15')]();});}}catch(_0x5d71a9){logger[_0xae6d('0x16')](_0xae6d('0x12'),_0x2fd081,JSON[_0xae6d('0x13')](_0x5d71a9));_0x9aa339[_0xae6d('0x15')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 4087d62..8e15ceb 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39e6=['catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','dialogflow','result','fulfillment','speech','providerResponse','metadata','stop','error','lodash','apiai-promise','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','body','getMustacheRender','Message','create','then'];(function(_0x5cab72,_0xd40b03){var _0x119721=function(_0x5e437a){while(--_0x5e437a){_0x5cab72['push'](_0x5cab72['shift']());}};_0x119721(++_0xd40b03);}(_0x39e6,0x9e));var _0x639e=function(_0x35ca51,_0xfa4b9){_0x35ca51=_0x35ca51-0x0;var _0x22fa14=_0x39e6[_0x35ca51];return _0x22fa14;};'use strict';var _=require(_0x639e('0x0'));var moment=require('moment');var apiai=require(_0x639e('0x1'));var md5=require('md5');var utils=require('./utils');var logger=require(_0x639e('0x2'))(_0x639e('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x639e('0x4')),'mailMessage':require(_0x639e('0x5')),'smsMessage':require(_0x639e('0x6')),'faxMessage':require(_0x639e('0x7')),'whatsappMessage':require(_0x639e('0x8'))};exports[_0x639e('0x9')]=function(_0x3812c0,_0x21db36){return function(_0x36b11f){try{if(!_[_0x639e('0xa')](this[_0x639e('0xb')][_0x639e('0xc')])){logger[_0x639e('0xd')](_0x639e('0xe'),_0x3812c0,_0x639e('0xf'));return _0x36b11f[_0x639e('0x10')]();}var _0x46cfb6={'ContactId':this[_0x639e('0x11')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x639e('0x12')};if(this[_0x639e('0x13')]===_0x639e('0x14')||this[_0x639e('0x13')]===_0x639e('0x15')){_0x46cfb6[_0x639e('0x16')]=this[_0x639e('0xb')]['phone'];}var _0x56d9bb=this[_0x639e('0x13')];if(_0x56d9bb===_0x639e('0x17')){_0x46cfb6[_0x639e('0x18')]=this[_0x639e('0x19')]['id'];}else{_0x46cfb6[_[_0x639e('0x1a')](_0x56d9bb)+_0x639e('0x1b')]=this['account']['id'];}_0x46cfb6[_[_0x639e('0x1a')](_0x56d9bb)+_0x639e('0x1c')]=this[_0x639e('0xb')]['id'];if(this[_0x639e('0xb')]['created']){var _0x6dd912=_0x21db36[0x2];if(!_['isEmpty'](_0x6dd912)){_0x46cfb6[_0x639e('0x1d')]=utils[_0x639e('0x1e')](_0x6dd912,this);return rpc[_0x56d9bb+_0x639e('0x1f')][_0x639e('0x20')](_0x46cfb6)[_0x639e('0x21')](function(_0x1c023e){logger['info'](_0x639e('0xe'),_0x3812c0,_0x46cfb6[_0x639e('0x1d')]);})[_0x639e('0x22')](function(_0x1da55e){logger['error'](_0x639e('0xe'),_0x3812c0,JSON[_0x639e('0x23')](_0x1da55e));})[_0x639e('0x24')](function(){logger[_0x639e('0xd')](_0x639e('0x25'),_0x3812c0);_0x36b11f['stop']();});}else{logger[_0x639e('0xd')](_0x639e('0x26'),_0x3812c0);_0x36b11f['stop']();}}else{var _0x25ead8=this;var _0x48dce7=apiai(_0x21db36[0x0],{'language':_0x21db36[0x1]||'en'});return _0x48dce7['textRequest'](this[_0x639e('0x27')][_0x639e('0x1d')],{'sessionId':md5(this[_0x639e('0xb')]['id'])})[_0x639e('0x21')](function(_0x211fcb){_0x25ead8['body'][_0x639e('0x28')]=_0x211fcb;_0x46cfb6[_0x639e('0x1d')]=_0x211fcb[_0x639e('0x29')][_0x639e('0x2a')][_0x639e('0x2b')];_0x46cfb6['providerName']=_0x639e('0x28');_0x46cfb6[_0x639e('0x2c')]=JSON[_0x639e('0x23')](_0x211fcb);return rpc[_0x56d9bb+_0x639e('0x1f')]['create'](_0x46cfb6)[_0x639e('0x21')](function(_0x282d87){logger[_0x639e('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x3812c0,_0x46cfb6[_0x639e('0x1d')]);if(_0x211fcb['result'][_0x639e('0x2d')]['endConversation']){_0x36b11f['next']();}else{_0x36b11f[_0x639e('0x2e')]();}})[_0x639e('0x22')](function(_0x3f7b0f){logger[_0x639e('0x2f')](_0x639e('0xe'),_0x3812c0,JSON[_0x639e('0x23')](_0x3f7b0f));_0x36b11f['next']();});})[_0x639e('0x22')](function(_0x2bfb5e){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x3812c0,_0x2bfb5e[_0x639e('0x27')]);_0x36b11f[_0x639e('0x10')]();});}}catch(_0x3b47e7){logger['error'](_0x639e('0xe'),_0x3812c0,JSON['stringify'](_0x3b47e7));_0x36b11f[_0x639e('0x2e')]();}};}; \ No newline at end of file +var _0x3dba=['catch','error','stringify','finally','info','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','providerResponse','metadata','endConversation','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','interaction','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','Message','create','then','body'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3dba,0x73));var _0xa3db=function(_0x9d2bdc,_0x4f2b6a){_0x9d2bdc=_0x9d2bdc-0x0;var _0x410615=_0x3dba[_0x9d2bdc];return _0x410615;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0xa3db('0x0'));var utils=require(_0xa3db('0x1'));var logger=require('../../../../config/logger')(_0xa3db('0x2'));var rpc={'chatMessage':require(_0xa3db('0x3')),'openchannelMessage':require(_0xa3db('0x4')),'mailMessage':require(_0xa3db('0x5')),'smsMessage':require(_0xa3db('0x6')),'faxMessage':require(_0xa3db('0x7')),'whatsappMessage':require(_0xa3db('0x8'))};exports['consequence']=function(_0x5807bb,_0x56b483){return function(_0x4f77df){try{if(!_[_0xa3db('0x9')](this['interaction']['UserId'])){logger['info'](_0xa3db('0xa'),_0x5807bb,_0xa3db('0xb'));return _0x4f77df[_0xa3db('0xc')]();}var _0x18813f={'ContactId':this[_0xa3db('0xd')]['id'],'sentAt':moment()[_0xa3db('0xe')](_0xa3db('0xf')),'direction':_0xa3db('0x10')};if(this[_0xa3db('0x11')]==='sms'||this[_0xa3db('0x11')]===_0xa3db('0x12')){_0x18813f[_0xa3db('0x13')]=this[_0xa3db('0x14')][_0xa3db('0x13')];}var _0x38edf7=this['channel'];if(_0x38edf7==='chat'){_0x18813f[_0xa3db('0x15')]=this[_0xa3db('0x16')]['id'];}else{_0x18813f[_['upperFirst'](_0x38edf7)+_0xa3db('0x17')]=this[_0xa3db('0x16')]['id'];}_0x18813f[_[_0xa3db('0x18')](_0x38edf7)+_0xa3db('0x19')]=this[_0xa3db('0x14')]['id'];if(this[_0xa3db('0x14')][_0xa3db('0x1a')]){var _0x119589=_0x56b483[0x2];if(!_[_0xa3db('0x1b')](_0x119589)){_0x18813f['body']=utils['getMustacheRender'](_0x119589,this);return rpc[_0x38edf7+_0xa3db('0x1c')][_0xa3db('0x1d')](_0x18813f)[_0xa3db('0x1e')](function(_0x3f5e3e){logger['info'](_0xa3db('0xa'),_0x5807bb,_0x18813f[_0xa3db('0x1f')]);})[_0xa3db('0x20')](function(_0x813cda){logger[_0xa3db('0x21')](_0xa3db('0xa'),_0x5807bb,JSON[_0xa3db('0x22')](_0x813cda));})[_0xa3db('0x23')](function(){logger[_0xa3db('0x24')](_0xa3db('0x25'),_0x5807bb);_0x4f77df[_0xa3db('0x26')]();});}else{logger[_0xa3db('0x24')](_0xa3db('0x27'),_0x5807bb);_0x4f77df[_0xa3db('0x26')]();}}else{var _0x195f57=this;var _0x16bc03=apiai(_0x56b483[0x0],{'language':_0x56b483[0x1]||'en'});return _0x16bc03[_0xa3db('0x28')](this[_0xa3db('0x29')][_0xa3db('0x1f')],{'sessionId':md5(this['interaction']['id'])})[_0xa3db('0x1e')](function(_0x49bc1b){_0x195f57[_0xa3db('0x1f')][_0xa3db('0x2a')]=_0x49bc1b;_0x18813f['body']=_0x49bc1b[_0xa3db('0x2b')][_0xa3db('0x2c')][_0xa3db('0x2d')];_0x18813f['providerName']=_0xa3db('0x2a');_0x18813f[_0xa3db('0x2e')]=JSON[_0xa3db('0x22')](_0x49bc1b);return rpc[_0x38edf7+_0xa3db('0x1c')][_0xa3db('0x1d')](_0x18813f)['then'](function(_0x1d050b){logger[_0xa3db('0x24')](_0xa3db('0xa'),_0x5807bb,_0x18813f[_0xa3db('0x1f')]);if(_0x49bc1b[_0xa3db('0x2b')][_0xa3db('0x2f')][_0xa3db('0x30')]){_0x4f77df[_0xa3db('0xc')]();}else{_0x4f77df[_0xa3db('0x26')]();}})[_0xa3db('0x20')](function(_0x52578a){logger[_0xa3db('0x21')](_0xa3db('0xa'),_0x5807bb,JSON[_0xa3db('0x22')](_0x52578a));_0x4f77df['next']();});})[_0xa3db('0x20')](function(_0x3b3436){logger['error'](_0xa3db('0xa'),_0x5807bb,_0x3b3436[_0xa3db('0x29')]);_0x4f77df[_0xa3db('0xc')]();});}}catch(_0x56bef9){logger[_0xa3db('0x21')](_0xa3db('0xa'),_0x5807bb,JSON['stringify'](_0x56bef9));_0x4f77df['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index b3cb1cc..48fa37e 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38a7=['whatsapp','phone','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','getMustacheRender','Message','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','message','detectIntent','length','dialogflowV2','diagnosticInfo','queryResult','fields','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','fulfillmentText','error','stack','lodash','dialogflow','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','clone','body','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','sms','channel'];(function(_0x61333f,_0x3be353){var _0x1a7ae2=function(_0x1f4e32){while(--_0x1f4e32){_0x61333f['push'](_0x61333f['shift']());}};_0x1a7ae2(++_0x3be353);}(_0x38a7,0x174));var _0x738a=function(_0x1dfdec,_0x2f6b97){_0x1dfdec=_0x1dfdec-0x0;var _0x56c86c=_0x38a7[_0x1dfdec];return _0x56c86c;};'use strict';var _=require(_0x738a('0x0'));var dialogflow=require(_0x738a('0x1'));var md5=require('md5');var moment=require('moment');var Promise=require('bluebird');var logger=require(_0x738a('0x2'))(_0x738a('0x3'));var utils=require(_0x738a('0x4'));var rpc={'chatMessage':require(_0x738a('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x738a('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x738a('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x249eb1,_0x233697,_0x507aec,_0x28f981){return new Promise(function(_0x51d7ec,_0x3b4573){var _0x15d4bb=_[_0x738a('0x8')](_0x507aec);_0x15d4bb[_0x738a('0x9')]=_0x28f981;return rpc[_0x233697+'Message'][_0x738a('0xa')](_0x15d4bb)[_0x738a('0xb')](function(){logger[_0x738a('0xc')](_0x738a('0xd'),_0x249eb1,_0x15d4bb[_0x738a('0x9')]);_0x51d7ec();})[_0x738a('0xe')](function(_0x5d6c85){logger['error'](_0x738a('0xd'),_0x249eb1,JSON[_0x738a('0xf')](_0x5d6c85));_0x3b4573(_0x5d6c85);});});}exports[_0x738a('0x10')]=function(_0x51699b,_0x23aa2c){return function(_0x5109ed){try{if(!_[_0x738a('0x11')](this[_0x738a('0x12')][_0x738a('0x13')])){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x51699b,_0x738a('0x14'));return _0x5109ed[_0x738a('0x15')]();}var _0x288500={'ContactId':this['contact']['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this['channel']===_0x738a('0x16')||this[_0x738a('0x17')]===_0x738a('0x18')){_0x288500[_0x738a('0x19')]=this[_0x738a('0x12')][_0x738a('0x19')];}var _0x115f4c=this[_0x738a('0x17')];if(_0x115f4c==='chat'){_0x288500[_0x738a('0x1a')]=this['account']['id'];}else{_0x288500[_[_0x738a('0x1b')](_0x115f4c)+_0x738a('0x1c')]=this[_0x738a('0x1d')]['id'];}_0x288500[_[_0x738a('0x1b')](_0x115f4c)+_0x738a('0x1e')]=this[_0x738a('0x12')]['id'];if(this['interaction'][_0x738a('0x1f')]){var _0x43ec45=_0x23aa2c[0x4];if(!_['isEmpty'](_0x43ec45)){_0x288500[_0x738a('0x9')]=utils[_0x738a('0x20')](_0x43ec45,this);return rpc[_0x115f4c+_0x738a('0x21')][_0x738a('0xa')](_0x288500)[_0x738a('0xb')](function(_0x23327a){logger[_0x738a('0xc')]('[%s][DIALOGFLOWV2]\x20%s',_0x51699b,_0x288500['body']);})[_0x738a('0xe')](function(_0x43acc3){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x51699b,JSON[_0x738a('0xf')](_0x43acc3));})['finally'](function(){logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x51699b);_0x5109ed[_0x738a('0x22')]();});}else{logger[_0x738a('0xc')](_0x738a('0x23'),_0x51699b);_0x5109ed[_0x738a('0x22')]();}}else{var _0x536361=this;var _0x54d056=_0x23aa2c[0x2][_0x738a('0x24')](/\\n/g,'\x0a');var _0x3949d7={'credentials':{'private_key':_0x54d056,'client_email':_0x23aa2c[0x1]}};var _0x2544cf=new dialogflow[(_0x738a('0x25'))](_0x3949d7);var _0x2664a8=_0x2544cf['sessionPath'](_0x23aa2c[0x0],md5(_0x536361['interaction']['id']));var _0x57e5ef={'session':_0x2664a8,'queryInput':{'text':{'text':_0x536361[_0x738a('0x26')][_0x738a('0x9')],'languageCode':_0x23aa2c[0x3]||'en'}}};return _0x2544cf[_0x738a('0x27')](_0x57e5ef)['then'](function(_0x47e5aa){if(_0x47e5aa&&_0x47e5aa[_0x738a('0x28')]){_0x536361['body'][_0x738a('0x29')]=_0x47e5aa;var _0x1cf83f=_0x47e5aa[0x0];var _0x3a1d89=_0x1cf83f['queryResult'][_0x738a('0x2a')]&&_0x1cf83f[_0x738a('0x2b')][_0x738a('0x2a')][_0x738a('0x2c')]?_0x1cf83f[_0x738a('0x2b')]['diagnosticInfo'][_0x738a('0x2c')]['end_conversation'][_0x738a('0x2d')]:![];_0x536361['body'][_0x738a('0x2e')]=_0x1cf83f['queryResult']['action'];_0x536361[_0x738a('0x9')][_0x738a('0x2f')]=_0x1cf83f[_0x738a('0x2b')]['allRequiredParamsPresent'];_0x536361['body'][_0x738a('0x30')]=_0x1cf83f[_0x738a('0x2b')]['diagnosticInfo']&&_0x1cf83f['queryResult']['diagnosticInfo'][_0x738a('0x2c')]?_0x1cf83f[_0x738a('0x2b')]['diagnosticInfo'][_0x738a('0x2c')][_0x738a('0x31')][_0x738a('0x2d')]:![];_0x536361[_0x738a('0x9')][_0x738a('0x32')]=_0x1cf83f[_0x738a('0x2b')][_0x738a('0x33')][_0x738a('0x34')];_0x536361[_0x738a('0x9')][_0x738a('0x35')]=_0x1cf83f[_0x738a('0x2b')][_0x738a('0x33')][_0x738a('0x36')];_0x536361['body'][_0x738a('0x37')]=_0x1cf83f[_0x738a('0x2b')][_0x738a('0x33')][_0x738a('0x38')];_0x536361[_0x738a('0x9')][_0x738a('0x39')]=_0x1cf83f[_0x738a('0x2b')][_0x738a('0x3a')];_0x536361['body']['DIALOGFLOWV2_QUERYTEXT']=_0x1cf83f['queryResult'][_0x738a('0x3b')];_0x536361['body'][_0x738a('0x3c')]=_0x1cf83f[_0x738a('0x2b')][_0x738a('0x3d')];_0x288500[_0x738a('0x3e')]='dialogflowV2';_0x288500['providerResponse']=JSON[_0x738a('0xf')](_0x47e5aa);var _0x416b18=[];for(var _0x53ca02=0x0;_0x53ca02<_0x47e5aa[_0x738a('0x28')];_0x53ca02++){var _0x42f8e1=_0x47e5aa[_0x53ca02];if(_0x42f8e1&&_0x42f8e1[_0x738a('0x2b')]&&_0x42f8e1[_0x738a('0x2b')][_0x738a('0x3f')]){_0x416b18['push'](createMessage(_0x51699b,_0x115f4c,_0x288500,_0x42f8e1[_0x738a('0x2b')][_0x738a('0x3f')]));}}return Promise['all'](_0x416b18)['then'](function(){if(_0x3a1d89){_0x5109ed['next']();}else{_0x5109ed['stop']();}})[_0x738a('0xe')](function(_0x1ab35a){logger[_0x738a('0x40')](_0x738a('0xd'),_0x51699b,JSON[_0x738a('0xf')](_0x1ab35a));_0x5109ed[_0x738a('0x15')]();});}})[_0x738a('0xe')](function(_0x4eb805){logger[_0x738a('0x40')](_0x738a('0xd'),_0x51699b,_0x4eb805[_0x738a('0x26')],_0x4eb805[_0x738a('0x41')]);_0x5109ed[_0x738a('0x15')]();});}}catch(_0xa5ee5c){logger[_0x738a('0x40')](_0x738a('0xd'),_0x51699b,JSON['stringify'](_0xa5ee5c));_0x5109ed[_0x738a('0x22')]();}};}; \ No newline at end of file +var _0xe511=['allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','lodash','dialogflow','md5','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','account','upperFirst','AccountId','InteractionId','isEmpty','getMustacheRender','then','error','stringify','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action'];(function(_0x30b7c6,_0x45e94f){var _0x1a7349=function(_0x3b8faa){while(--_0x3b8faa){_0x30b7c6['push'](_0x30b7c6['shift']());}};_0x1a7349(++_0x45e94f);}(_0xe511,0x182));var _0x1e51=function(_0x514b64,_0x54ab07){_0x514b64=_0x514b64-0x0;var _0x1926fc=_0xe511[_0x514b64];return _0x1926fc;};'use strict';var _=require(_0x1e51('0x0'));var dialogflow=require(_0x1e51('0x1'));var md5=require(_0x1e51('0x2'));var moment=require('moment');var Promise=require(_0x1e51('0x3'));var logger=require(_0x1e51('0x4'))(_0x1e51('0x5'));var utils=require('./utils');var rpc={'chatMessage':require(_0x1e51('0x6')),'openchannelMessage':require(_0x1e51('0x7')),'mailMessage':require(_0x1e51('0x8')),'smsMessage':require(_0x1e51('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x1e51('0xa'))};function createMessage(_0x4bb6d3,_0x2ee317,_0x28b7d9,_0x4d876d){return new Promise(function(_0xcff0bf,_0x2616b3){var _0x546e59=_[_0x1e51('0xb')](_0x28b7d9);_0x546e59['body']=_0x4d876d;return rpc[_0x2ee317+_0x1e51('0xc')][_0x1e51('0xd')](_0x546e59)['then'](function(){logger[_0x1e51('0xe')](_0x1e51('0xf'),_0x4bb6d3,_0x546e59[_0x1e51('0x10')]);_0xcff0bf();})[_0x1e51('0x11')](function(_0x3d2d73){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x4bb6d3,JSON['stringify'](_0x3d2d73));_0x2616b3(_0x3d2d73);});});}exports[_0x1e51('0x12')]=function(_0x229a8c,_0x4ed4d1){return function(_0x5f3af8){try{if(!_[_0x1e51('0x13')](this[_0x1e51('0x14')][_0x1e51('0x15')])){logger[_0x1e51('0xe')](_0x1e51('0xf'),_0x229a8c,_0x1e51('0x16'));return _0x5f3af8[_0x1e51('0x17')]();}var _0x1bba55={'ContactId':this[_0x1e51('0x18')]['id'],'sentAt':moment()[_0x1e51('0x19')](_0x1e51('0x1a')),'direction':_0x1e51('0x1b')};if(this[_0x1e51('0x1c')]===_0x1e51('0x1d')||this[_0x1e51('0x1c')]==='whatsapp'){_0x1bba55['phone']=this['interaction'][_0x1e51('0x1e')];}var _0x927482=this['channel'];if(_0x927482==='chat'){_0x1bba55['ChatWebsiteId']=this[_0x1e51('0x1f')]['id'];}else{_0x1bba55[_[_0x1e51('0x20')](_0x927482)+_0x1e51('0x21')]=this[_0x1e51('0x1f')]['id'];}_0x1bba55[_[_0x1e51('0x20')](_0x927482)+_0x1e51('0x22')]=this['interaction']['id'];if(this['interaction']['created']){var _0x477016=_0x4ed4d1[0x4];if(!_[_0x1e51('0x23')](_0x477016)){_0x1bba55[_0x1e51('0x10')]=utils[_0x1e51('0x24')](_0x477016,this);return rpc[_0x927482+_0x1e51('0xc')][_0x1e51('0xd')](_0x1bba55)[_0x1e51('0x25')](function(_0x426a68){logger['info'](_0x1e51('0xf'),_0x229a8c,_0x1bba55[_0x1e51('0x10')]);})[_0x1e51('0x11')](function(_0x16edc5){logger[_0x1e51('0x26')](_0x1e51('0xf'),_0x229a8c,JSON[_0x1e51('0x27')](_0x16edc5));})[_0x1e51('0x28')](function(){logger['info'](_0x1e51('0x29'),_0x229a8c);_0x5f3af8['stop']();});}else{logger['info'](_0x1e51('0x2a'),_0x229a8c);_0x5f3af8[_0x1e51('0x2b')]();}}else{var _0x550b4b=this;var _0x1eedbe=_0x4ed4d1[0x2][_0x1e51('0x2c')](/\\n/g,'\x0a');var _0x53232f={'credentials':{'private_key':_0x1eedbe,'client_email':_0x4ed4d1[0x1]}};var _0x220353=new dialogflow[(_0x1e51('0x2d'))](_0x53232f);var _0x531af7=_0x220353[_0x1e51('0x2e')](_0x4ed4d1[0x0],md5(_0x550b4b['interaction']['id']));var _0x3e0547={'session':_0x531af7,'queryInput':{'text':{'text':_0x550b4b[_0x1e51('0x2f')][_0x1e51('0x10')],'languageCode':_0x4ed4d1[0x3]||'en'}}};return _0x220353[_0x1e51('0x30')](_0x3e0547)[_0x1e51('0x25')](function(_0x3d502f){if(_0x3d502f&&_0x3d502f[_0x1e51('0x31')]){_0x550b4b[_0x1e51('0x10')][_0x1e51('0x32')]=_0x3d502f;var _0x47673c=_0x3d502f[0x0];var _0x559e2a=_0x47673c[_0x1e51('0x33')][_0x1e51('0x34')]&&_0x47673c[_0x1e51('0x33')]['diagnosticInfo']['fields']?_0x47673c['queryResult'][_0x1e51('0x34')][_0x1e51('0x35')][_0x1e51('0x36')][_0x1e51('0x37')]:![];_0x550b4b[_0x1e51('0x10')][_0x1e51('0x38')]=_0x47673c[_0x1e51('0x33')][_0x1e51('0x39')];_0x550b4b[_0x1e51('0x10')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x47673c['queryResult'][_0x1e51('0x3a')];_0x550b4b[_0x1e51('0x10')][_0x1e51('0x3b')]=_0x47673c[_0x1e51('0x33')][_0x1e51('0x34')]&&_0x47673c[_0x1e51('0x33')][_0x1e51('0x34')][_0x1e51('0x35')]?_0x47673c[_0x1e51('0x33')]['diagnosticInfo'][_0x1e51('0x35')]['end_conversation'][_0x1e51('0x37')]:![];_0x550b4b['body']['DIALOGFLOWV2_INTENTNAME']=_0x47673c['queryResult'][_0x1e51('0x3c')][_0x1e51('0x3d')];_0x550b4b['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x47673c[_0x1e51('0x33')][_0x1e51('0x3c')][_0x1e51('0x3e')];_0x550b4b['body'][_0x1e51('0x3f')]=_0x47673c[_0x1e51('0x33')][_0x1e51('0x3c')][_0x1e51('0x40')];_0x550b4b[_0x1e51('0x10')]['DIALOGFLOWV2_LANGUAGECODE']=_0x47673c['queryResult']['languageCode'];_0x550b4b[_0x1e51('0x10')][_0x1e51('0x41')]=_0x47673c[_0x1e51('0x33')][_0x1e51('0x42')];_0x550b4b[_0x1e51('0x10')][_0x1e51('0x43')]=_0x47673c[_0x1e51('0x33')][_0x1e51('0x44')];_0x1bba55[_0x1e51('0x45')]=_0x1e51('0x32');_0x1bba55[_0x1e51('0x46')]=JSON[_0x1e51('0x27')](_0x3d502f);var _0x40fb25=[];for(var _0x213eaf=0x0;_0x213eaf<_0x3d502f[_0x1e51('0x31')];_0x213eaf++){var _0x2982b8=_0x3d502f[_0x213eaf];if(_0x2982b8&&_0x2982b8[_0x1e51('0x33')]&&_0x2982b8['queryResult'][_0x1e51('0x47')]){_0x40fb25[_0x1e51('0x48')](createMessage(_0x229a8c,_0x927482,_0x1bba55,_0x2982b8[_0x1e51('0x33')][_0x1e51('0x47')]));}}return Promise[_0x1e51('0x49')](_0x40fb25)[_0x1e51('0x25')](function(){if(_0x559e2a){_0x5f3af8['next']();}else{_0x5f3af8[_0x1e51('0x2b')]();}})['catch'](function(_0x519cf8){logger[_0x1e51('0x26')]('[%s][DIALOGFLOWV2]\x20%s',_0x229a8c,JSON['stringify'](_0x519cf8));_0x5f3af8[_0x1e51('0x17')]();});}})[_0x1e51('0x11')](function(_0x4ee45e){logger[_0x1e51('0x26')](_0x1e51('0xf'),_0x229a8c,_0x4ee45e[_0x1e51('0x2f')],_0x4ee45e['stack']);_0x5f3af8[_0x1e51('0x17')]();});}}catch(_0x4e7986){logger[_0x1e51('0x26')](_0x1e51('0xf'),_0x229a8c,JSON[_0x1e51('0x27')](_0x4e7986));_0x5f3af8['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 4a3f470..5b9e2d2 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf408=['validate','length','error','[%s][GOTOIF]\x20%s','map','message','condition','info','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stop','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace'];(function(_0x150fa2,_0x156632){var _0x88e6ba=function(_0x23536e){while(--_0x23536e){_0x150fa2['push'](_0x150fa2['shift']());}};_0x88e6ba(++_0x156632);}(_0xf408,0x90));var _0x8f40=function(_0x14490c,_0x50e8ab){_0x14490c=_0x14490c-0x0;var _0x2f6825=_0xf408[_0x14490c];return _0x2f6825;};'use strict';var schema=require('validate');var _=require(_0x8f40('0x0'));var htmlToText=require(_0x8f40('0x1'));var utils=require(_0x8f40('0x2'));var logger=require(_0x8f40('0x3'))(_0x8f40('0x4'));var gotoif=schema({'condition':{'type':_0x8f40('0x5'),'required':!![],'message':_0x8f40('0x6')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x8f40('0x7'),'message':_0x8f40('0x8')}});exports['consequence']=function(_0x1296eb,_0x425413){return function(_0x304c5a){try{var _0x4b3fe8={'condition':htmlToText[_0x8f40('0x9')](utils[_0x8f40('0xa')](_0x425413[0x0],this),{'wordwrap':![]})[_0x8f40('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x425413[0x1],'priorityFalse':_0x425413[0x2]};var _0xa68727=gotoif[_0x8f40('0xc')](_0x4b3fe8,{'typecast':!![]});if(_0xa68727[_0x8f40('0xd')]){logger[_0x8f40('0xe')](_0x8f40('0xf'),_0x1296eb,_[_0x8f40('0x10')](_0xa68727,_0x8f40('0x11'))['join'](',\x20'));_0x304c5a['stop']();}else{try{var _0x392e5c=eval('('+_0x4b3fe8[_0x8f40('0x12')]+')');var _0x387ff4=_0x392e5c?_0x4b3fe8['priorityTrue']:_0x4b3fe8['priorityFalse'];logger[_0x8f40('0x13')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x1296eb,_0x4b3fe8['condition'],_0x392e5c,_0x387ff4||_0x8f40('0x14'));if(_0x387ff4){var _0x259586=_[_0x8f40('0x15')](_0x304c5a[_0x8f40('0x16')](),{'p':_0x387ff4});if(_0x259586>=0x0){logger[_0x8f40('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1296eb,_0x387ff4||_0x8f40('0x14'),_0x259586);_0x304c5a[_0x8f40('0x14')](_0x259586);}else{logger[_0x8f40('0x13')](_0x8f40('0x17'),_0x1296eb,_0x387ff4||'next');_0x304c5a['stop']();}}else{_0x304c5a[_0x8f40('0x14')]();}}catch(_0x138610){logger[_0x8f40('0xe')](_0x8f40('0x18'),_0x1296eb,_0x138610[_0x8f40('0x11')]);_0x304c5a[_0x8f40('0x19')]();}}}catch(_0x4df99c){logger[_0x8f40('0xe')](_0x8f40('0xf'),_0x1296eb,JSON['stringify'](_0x4df99c));_0x304c5a[_0x8f40('0x19')]();}};}; \ No newline at end of file +var _0x7928=['stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','number','replace','length','[%s][GOTOIF]\x20%s','map','message','join'];(function(_0x2a8b13,_0x27c36d){var _0x5d1a42=function(_0x91299c){while(--_0x91299c){_0x2a8b13['push'](_0x2a8b13['shift']());}};_0x5d1a42(++_0x27c36d);}(_0x7928,0x94));var _0x8792=function(_0x5e6c9d,_0x37a02c){_0x5e6c9d=_0x5e6c9d-0x0;var _0x3e5f5a=_0x7928[_0x5e6c9d];return _0x3e5f5a;};'use strict';var schema=require(_0x8792('0x0'));var _=require(_0x8792('0x1'));var htmlToText=require(_0x8792('0x2'));var utils=require(_0x8792('0x3'));var logger=require(_0x8792('0x4'))(_0x8792('0x5'));var gotoif=schema({'condition':{'type':_0x8792('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x8792('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0x14339e,_0x2ad951){return function(_0x2f3d46){try{var _0x2bf9fa={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x2ad951[0x0],this),{'wordwrap':![]})[_0x8792('0x8')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2ad951[0x1],'priorityFalse':_0x2ad951[0x2]};var _0x20a8c6=gotoif[_0x8792('0x0')](_0x2bf9fa,{'typecast':!![]});if(_0x20a8c6[_0x8792('0x9')]){logger['error'](_0x8792('0xa'),_0x14339e,_[_0x8792('0xb')](_0x20a8c6,_0x8792('0xc'))[_0x8792('0xd')](',\x20'));_0x2f3d46[_0x8792('0xe')]();}else{try{var _0x1d4584=eval('('+_0x2bf9fa[_0x8792('0xf')]+')');var _0x583f2d=_0x1d4584?_0x2bf9fa[_0x8792('0x10')]:_0x2bf9fa[_0x8792('0x11')];logger[_0x8792('0x12')](_0x8792('0x13'),_0x14339e,_0x2bf9fa[_0x8792('0xf')],_0x1d4584,_0x583f2d||_0x8792('0x14'));if(_0x583f2d){var _0x27a8f8=_[_0x8792('0x15')](_0x2f3d46[_0x8792('0x16')](),{'p':_0x583f2d});if(_0x27a8f8>=0x0){logger['info'](_0x8792('0x17'),_0x14339e,_0x583f2d||_0x8792('0x14'),_0x27a8f8);_0x2f3d46[_0x8792('0x14')](_0x27a8f8);}else{logger[_0x8792('0x12')](_0x8792('0x18'),_0x14339e,_0x583f2d||_0x8792('0x14'));_0x2f3d46[_0x8792('0xe')]();}}else{_0x2f3d46[_0x8792('0x14')]();}}catch(_0x15483d){logger[_0x8792('0x19')](_0x8792('0x1a'),_0x14339e,_0x15483d[_0x8792('0xc')]);_0x2f3d46[_0x8792('0xe')]();}}}catch(_0xf5374e){logger['error'](_0x8792('0xa'),_0x14339e,JSON['stringify'](_0xf5374e));_0x2f3d46[_0x8792('0xe')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index ea3962d..284c104 100644 --- a/server/services/routing/server/applications/gotop.js +++ b/server/services/routing/server/applications/gotop.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3506=['consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','next','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'];(function(_0x15f475,_0x50b0ee){var _0x5276f0=function(_0x1af4c2){while(--_0x1af4c2){_0x15f475['push'](_0x15f475['shift']());}};_0x5276f0(++_0x50b0ee);}(_0x3506,0x1f2));var _0x6350=function(_0x171cf7,_0x15e48f){_0x171cf7=_0x171cf7-0x0;var _0x6732af=_0x3506[_0x171cf7];return _0x6732af;};'use strict';var schema=require(_0x6350('0x0'));var _=require(_0x6350('0x1'));var logger=require(_0x6350('0x2'))(_0x6350('0x3'));var gotop=schema({'priority':{'type':_0x6350('0x4'),'required':!![],'message':_0x6350('0x5')}});exports[_0x6350('0x6')]=function(_0x5d9ba4,_0x5f3f1d){return function(_0x4cbcdc){try{var _0x840563={'priority':_0x5f3f1d[0x0]};var _0x45ddc1=gotop[_0x6350('0x0')](_0x840563,{'typecast':!![]});if(_0x45ddc1[_0x6350('0x7')]){logger[_0x6350('0x8')](_0x6350('0x9'),_0x5d9ba4,_[_0x6350('0xa')](_0x45ddc1,_0x6350('0xb'))[_0x6350('0xc')](',\x20'));_0x4cbcdc[_0x6350('0xd')]();}else{logger[_0x6350('0xe')](_0x6350('0xf'),_0x5d9ba4,_0x840563[_0x6350('0x10')]);if(_0x840563[_0x6350('0x10')]){var _0x17a528=_['findIndex'](_0x4cbcdc['rules'](),{'p':_0x840563[_0x6350('0x10')]});if(_0x17a528>=0x0){logger[_0x6350('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x5d9ba4,_0x840563[_0x6350('0x10')]||'next',_0x17a528);_0x4cbcdc[_0x6350('0x11')](_0x17a528);}else{logger[_0x6350('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x5d9ba4,_0x840563['priority']||_0x6350('0x11'));_0x4cbcdc['stop']();}}else{_0x4cbcdc['next']();}}}catch(_0xe4fd4a){logger[_0x6350('0x8')](_0x6350('0x9'),_0x5d9ba4,JSON['stringify'](_0xe4fd4a));_0x4cbcdc[_0x6350('0xd')]();}};}; \ No newline at end of file +var _0xba8e=['stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','next'];(function(_0x4fc289,_0x9db4c4){var _0x3df5db=function(_0x30a1a3){while(--_0x30a1a3){_0x4fc289['push'](_0x4fc289['shift']());}};_0x3df5db(++_0x9db4c4);}(_0xba8e,0x99));var _0xeba8=function(_0x114c53,_0x2249c6){_0x114c53=_0x114c53-0x0;var _0x4e0c14=_0xba8e[_0x114c53];return _0x4e0c14;};'use strict';var schema=require(_0xeba8('0x0'));var _=require(_0xeba8('0x1'));var logger=require(_0xeba8('0x2'))(_0xeba8('0x3'));var gotop=schema({'priority':{'type':_0xeba8('0x4'),'required':!![],'message':_0xeba8('0x5')}});exports[_0xeba8('0x6')]=function(_0x52fe93,_0x4d0696){return function(_0x27510f){try{var _0x55ae79={'priority':_0x4d0696[0x0]};var _0x1678db=gotop[_0xeba8('0x0')](_0x55ae79,{'typecast':!![]});if(_0x1678db['length']){logger[_0xeba8('0x7')](_0xeba8('0x8'),_0x52fe93,_['map'](_0x1678db,_0xeba8('0x9'))[_0xeba8('0xa')](',\x20'));_0x27510f[_0xeba8('0xb')]();}else{logger[_0xeba8('0xc')](_0xeba8('0xd'),_0x52fe93,_0x55ae79[_0xeba8('0xe')]);if(_0x55ae79[_0xeba8('0xe')]){var _0x37f7e2=_['findIndex'](_0x27510f[_0xeba8('0xf')](),{'p':_0x55ae79['priority']});if(_0x37f7e2>=0x0){logger[_0xeba8('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x52fe93,_0x55ae79['priority']||'next',_0x37f7e2);_0x27510f['next'](_0x37f7e2);}else{logger[_0xeba8('0xc')](_0xeba8('0x10'),_0x52fe93,_0x55ae79['priority']||'next');_0x27510f[_0xeba8('0xb')]();}}else{_0x27510f[_0xeba8('0x11')]();}}}catch(_0x42f791){logger[_0xeba8('0x7')](_0xeba8('0x8'),_0x52fe93,JSON[_0xeba8('0x12')](_0x42f791));_0x27510f['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index a46afcb..0f1f0aa 100644 --- a/server/services/routing/server/applications/message.js +++ b/server/services/routing/server/applications/message.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d08=['[%s][MESSAGE]\x20%s','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','chat','account','upperFirst','channel','InteractionId','Message','info'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0x8d08,0x118));var _0x88d0=function(_0x114c53,_0x2249c6){_0x114c53=_0x114c53-0x0;var _0x4e0c14=_0x8d08[_0x114c53];return _0x4e0c14;};'use strict';var _=require(_0x88d0('0x0'));var utils=require(_0x88d0('0x1'));var logger=require(_0x88d0('0x2'))(_0x88d0('0x3'));var rpc={'chatMessage':require(_0x88d0('0x4')),'openchannelMessage':require(_0x88d0('0x5')),'mailMessage':require(_0x88d0('0x6')),'smsMessage':require(_0x88d0('0x7')),'faxMessage':require(_0x88d0('0x8')),'whatsappMessage':require(_0x88d0('0x9'))};exports[_0x88d0('0xa')]=function(_0x47341c,_0x560c5b){return function(_0x9897ca){try{var _0x14eafb={'body':utils['getMustacheRender'](_0x560c5b[0x0],this),'ContactId':this[_0x88d0('0xb')]['id']};if(this['channel']===_0x88d0('0xc')){_0x14eafb['ChatWebsiteId']=this[_0x88d0('0xd')]['id'];}else{_0x14eafb[_[_0x88d0('0xe')](this[_0x88d0('0xf')])+'AccountId']=this[_0x88d0('0xd')]['id'];}_0x14eafb[_[_0x88d0('0xe')](this['channel'])+_0x88d0('0x10')]=this['interaction']['id'];if(rpc[this[_0x88d0('0xf')]+_0x88d0('0x11')]){return rpc[this[_0x88d0('0xf')]+'Message']['create'](_0x14eafb)['then'](function(_0x2854a5){logger[_0x88d0('0x12')](_0x88d0('0x13'),_0x47341c,_0x14eafb['body']);_0x9897ca['next']();})['catch'](function(_0x461ae6){logger[_0x88d0('0x14')]('[%s][MESSAGE]\x20%s',_0x47341c,JSON[_0x88d0('0x15')](_0x461ae6));_0x9897ca[_0x88d0('0x16')]();});}}catch(_0x2b3ebd){logger[_0x88d0('0x14')]('[%s][MESSAGE]\x20%s',_0x47341c,JSON[_0x88d0('0x15')](_0x2b3ebd));_0x9897ca[_0x88d0('0x16')]();}};}; \ No newline at end of file +var _0x3ebb=['[%s][MESSAGE]\x20%s','next','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','Message','create','then','info'];(function(_0x352faa,_0x108b4a){var _0x1b1be4=function(_0x44622b){while(--_0x44622b){_0x352faa['push'](_0x352faa['shift']());}};_0x1b1be4(++_0x108b4a);}(_0x3ebb,0xcd));var _0xb3eb=function(_0x549dac,_0x52e0b2){_0x549dac=_0x549dac-0x0;var _0x43785f=_0x3ebb[_0x549dac];return _0x43785f;};'use strict';var _=require(_0xb3eb('0x0'));var utils=require(_0xb3eb('0x1'));var logger=require(_0xb3eb('0x2'))('routing');var rpc={'chatMessage':require(_0xb3eb('0x3')),'openchannelMessage':require(_0xb3eb('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xb3eb('0x5')),'faxMessage':require(_0xb3eb('0x6')),'whatsappMessage':require(_0xb3eb('0x7'))};exports[_0xb3eb('0x8')]=function(_0x512baf,_0x53c060){return function(_0x1a7853){try{var _0x319efb={'body':utils[_0xb3eb('0x9')](_0x53c060[0x0],this),'ContactId':this['contact']['id']};if(this[_0xb3eb('0xa')]===_0xb3eb('0xb')){_0x319efb[_0xb3eb('0xc')]=this[_0xb3eb('0xd')]['id'];}else{_0x319efb[_[_0xb3eb('0xe')](this['channel'])+'AccountId']=this[_0xb3eb('0xd')]['id'];}_0x319efb[_['upperFirst'](this[_0xb3eb('0xa')])+_0xb3eb('0xf')]=this['interaction']['id'];if(rpc[this['channel']+_0xb3eb('0x10')]){return rpc[this[_0xb3eb('0xa')]+_0xb3eb('0x10')][_0xb3eb('0x11')](_0x319efb)[_0xb3eb('0x12')](function(_0x36ca8d){logger[_0xb3eb('0x13')](_0xb3eb('0x14'),_0x512baf,_0x319efb['body']);_0x1a7853[_0xb3eb('0x15')]();})['catch'](function(_0x41d6be){logger[_0xb3eb('0x16')](_0xb3eb('0x14'),_0x512baf,JSON[_0xb3eb('0x17')](_0x41d6be));_0x1a7853[_0xb3eb('0x18')]();});}}catch(_0x462c7e){logger[_0xb3eb('0x16')](_0xb3eb('0x14'),_0x512baf,JSON[_0xb3eb('0x17')](_0x462c7e));_0x1a7853['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 6d50977..855bcd4 100644 --- a/server/services/routing/server/applications/noop.js +++ b/server/services/routing/server/applications/noop.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x37a7=['error','[%s][NOOP]\x20%s','stringify','./utils','../../../../config/logger','next'];(function(_0x558208,_0x3b1455){var _0x36b25f=function(_0xba9981){while(--_0xba9981){_0x558208['push'](_0x558208['shift']());}};_0x36b25f(++_0x3b1455);}(_0x37a7,0x6f));var _0x737a=function(_0x46a9e6,_0x274cd1){_0x46a9e6=_0x46a9e6-0x0;var _0x2a64e7=_0x37a7[_0x46a9e6];return _0x2a64e7;};'use strict';var utils=require(_0x737a('0x0'));var logger=require(_0x737a('0x1'))('routing');exports['consequence']=function(_0x5a259b,_0x2d4b54){return function(_0xc5eaef){try{logger['info']('[%s][NOOP]\x20%s',_0x5a259b,utils['getMustacheRender'](_0x2d4b54[0x0],this));_0xc5eaef[_0x737a('0x2')]();}catch(_0x477f2f){logger[_0x737a('0x3')](_0x737a('0x4'),_0x5a259b,JSON[_0x737a('0x5')](_0x477f2f));_0xc5eaef['stop']();}};}; \ No newline at end of file +var _0x3b3f=['consequence','info','getMustacheRender','next','error','[%s][NOOP]\x20%s','stringify','stop','../../../../config/logger','routing'];(function(_0x4c00af,_0x3288e9){var _0x36feb5=function(_0x24a661){while(--_0x24a661){_0x4c00af['push'](_0x4c00af['shift']());}};_0x36feb5(++_0x3288e9);}(_0x3b3f,0x102));var _0xf3b3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3b3f[_0x14add3];return _0x4a174f;};'use strict';var utils=require('./utils');var logger=require(_0xf3b3('0x0'))(_0xf3b3('0x1'));exports[_0xf3b3('0x2')]=function(_0x1e0637,_0x2a1d88){return function(_0x46835c){try{logger[_0xf3b3('0x3')]('[%s][NOOP]\x20%s',_0x1e0637,utils[_0xf3b3('0x4')](_0x2a1d88[0x0],this));_0x46835c[_0xf3b3('0x5')]();}catch(_0x3d8389){logger[_0xf3b3('0x6')](_0xf3b3('0x7'),_0x1e0637,JSON[_0xf3b3('0x8')](_0x3d8389));_0x46835c[_0xf3b3('0x9')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 7985bcf..3ff3b39 100644 --- a/server/services/routing/server/applications/queue.js +++ b/server/services/routing/server/applications/queue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e7f=['./strategy','redis','defaults','localhost','socket.io-emitter','account','queue','from','emit','clone','queue_id','push','InteractionId','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','accepted','Interaction','update','then','error','timeout','info','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing'];(function(_0x48deaf,_0x91fc6a){var _0x35ba9b=function(_0x66a1ca){while(--_0x66a1ca){_0x48deaf['push'](_0x48deaf['shift']());}};_0x35ba9b(++_0x91fc6a);}(_0x5e7f,0xff));var _0xf5e7=function(_0x37d34c,_0x501153){_0x37d34c=_0x37d34c-0x0;var _0x11a0ba=_0x5e7f[_0x37d34c];return _0x11a0ba;};'use strict';var schema=require(_0xf5e7('0x0'));var _=require(_0xf5e7('0x1'));var util=require(_0xf5e7('0x2'));var seqqueue=require(_0xf5e7('0x3'));var moment=require(_0xf5e7('0x4'));var Redis=require(_0xf5e7('0x5'));var config=require(_0xf5e7('0x6'));var logger=require(_0xf5e7('0x7'))(_0xf5e7('0x8'));var strategy=require(_0xf5e7('0x9'));config[_0xf5e7('0xa')]=_[_0xf5e7('0xb')](config[_0xf5e7('0xa')],{'host':_0xf5e7('0xc'),'port':0x18eb});var io=require(_0xf5e7('0xd'))(new Redis(config[_0xf5e7('0xa')]));var attributes=['id','queue_id',_0xf5e7('0xe'),_0xf5e7('0xf'),_0xf5e7('0x10'),'joinAt'];function emit(_0x210b3b,_0x774f2a,_0x194e65){io['to'](_0x210b3b)[_0xf5e7('0x11')](_0x774f2a,_0x194e65);}function emitChannelQueueInteraction(_0x139f86,_0x4672a9,_0x3115eb,_0xbb55e6,_0x5c399d,_0x14c72,_0x42f970,_0x5151a1){var _0x5e5514=_[_0xf5e7('0x12')](_0x3115eb);_0x5e5514[_0xf5e7('0x13')]=_0x5151a1;_0x5e5514['queue']=_0x4672a9;_0x5e5514[_0xf5e7('0xe')]=_0xbb55e6;_0x5e5514['id']=_0x5c399d;if(_0x14c72){attributes[_0xf5e7('0x14')](_['capitalize'](_0x139f86)+_0xf5e7('0x15'));_0x42f970[util[_0xf5e7('0x16')]('%sQueuesWaitingInteractions',_0x139f86)][_0x5c399d]=_['pick'](_0x5e5514,attributes);}else{delete _0x42f970[util['format'](_0xf5e7('0x17'),_0x139f86)][_0x5c399d];}emit(util[_0xf5e7('0x16')](_0xf5e7('0x18'),_0x139f86,_0x4672a9),util[_0xf5e7('0x16')](_0xf5e7('0x19'),_0x139f86,_0x14c72?'save':_0xf5e7('0x1a')),_[_0xf5e7('0x1b')](_0x5e5514,attributes));}var rpc={'openchannelQueueReport':require(_0xf5e7('0x1c')),'mailQueueReport':require(_0xf5e7('0x1d')),'chatQueueReport':require(_0xf5e7('0x1e')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xf5e7('0x1f')),'whatsappQueueReport':require(_0xf5e7('0x20')),'chatInteraction':require('../../rpc/chatInteraction'),'faxInteraction':require(_0xf5e7('0x21')),'mailInteraction':require(_0xf5e7('0x22')),'openchannelInteraction':require(_0xf5e7('0x23')),'smsInteraction':require(_0xf5e7('0x24')),'whatsappInteraction':require(_0xf5e7('0x25'))};var queue=schema({'name':{'type':_0xf5e7('0x26'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xf5e7('0x27'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x4ef266,_0x131a6b,_0x4876e3,_0x3a5f5f){if(_0x4ef266&&_0x131a6b&&_0x4876e3){_0x131a6b[_0xf5e7('0x28')]+=0x1;var _0x196772={'uniqueid':_0x4ef266,'from':_0x4876e3[_0xf5e7('0x29')]?_0x4876e3[_0xf5e7('0x29')][_0xf5e7('0x10')]:'','joinAt':moment()['format'](_0xf5e7('0x2a')),'ContactId':_0x4876e3[_0xf5e7('0x2b')]?_0x4876e3[_0xf5e7('0x2b')]['id']:null,'ListId':_0x4876e3[_0xf5e7('0x2c')]?_0x4876e3['list']['id']:null};_0x196772[_[_0xf5e7('0x2d')](_0x4876e3[_0xf5e7('0x2e')])+_0xf5e7('0x2f')]=_0x131a6b['id']||null;_0x196772[_[_0xf5e7('0x2d')](_0x4876e3['channel'])+_0xf5e7('0x15')]=_0x4876e3[_0xf5e7('0x30')]?_0x4876e3[_0xf5e7('0x30')]['id']:null;_0x196772[_['upperFirst'](_0x4876e3[_0xf5e7('0x2e')])+_0xf5e7('0x31')]=_0x4876e3[_0xf5e7('0x32')]?_0x4876e3[_0xf5e7('0x32')]['id']:null;_0x196772[_[_0xf5e7('0x2d')](_0x4876e3[_0xf5e7('0x2e')])+(_0x4876e3[_0xf5e7('0x2e')]!==_0xf5e7('0x33')?_0xf5e7('0x34'):'WebsiteId')]=_0x4876e3['account']?_0x4876e3[_0xf5e7('0xe')]['id']:null;logger['info'](util['format'](_0xf5e7('0x35'),_0x4ef266,_0x131a6b[_0xf5e7('0x36')]));emitChannelQueueInteraction(_0x4876e3[_0xf5e7('0x2e')],_0x131a6b['name'],_0x196772,_0x4876e3[_0xf5e7('0xe')][_0xf5e7('0x36')],_0x4876e3['message']['id'],!![],_0x3a5f5f,_0x131a6b['id']);if(rpc[_0x4876e3[_0xf5e7('0x2e')]+_0xf5e7('0x37')]){return rpc[_0x4876e3[_0xf5e7('0x2e')]+'QueueReport'][_0xf5e7('0x38')](_0x196772)[_0xf5e7('0x39')](function(_0x4e9eb1){logger['error']('create\x20queue\x20report',_0x4e9eb1);});}}}function stopRouting(_0xf446d,_0x1b22f8,_0x2df34c,_0x2bd551){if(_0xf446d&&_0x1b22f8){_0x1b22f8['waiting']-=0x1;var _0x25123d={'leaveAt':moment()['format'](_0xf5e7('0x2a')),'acceptAt':moment()[_0xf5e7('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xf5e7('0x3a')};logger['info'](util[_0xf5e7('0x16')]('[%s][STOP:QUEUE][NAME:%s]',_0xf446d,_0x1b22f8[_0xf5e7('0x36')]));emitChannelQueueInteraction(_0x2df34c[_0xf5e7('0x2e')],_0x1b22f8[_0xf5e7('0x36')],_0x2df34c['body'],_0x2df34c[_0xf5e7('0xe')][_0xf5e7('0x36')],_0x2df34c[_0xf5e7('0x32')]['id'],![],_0x2bd551,_0x1b22f8['id']);return rpc[_0x2df34c[_0xf5e7('0x2e')]+_0xf5e7('0x3b')][_0xf5e7('0x3c')](_0x2df34c[_0xf5e7('0x30')]['id'],{'queueId':_0x1b22f8['id']})[_0xf5e7('0x3d')](function(){if(rpc[_0x2df34c[_0xf5e7('0x2e')]+_0xf5e7('0x37')]){return rpc[_0x2df34c[_0xf5e7('0x2e')]+'QueueReport'][_0xf5e7('0x3c')](_0xf446d,_0x25123d)[_0xf5e7('0x39')](function(_0x487fa8){logger[_0xf5e7('0x3e')]('update\x20queue\x20report',_0x487fa8);});}});}}function endRouting(_0x1bb628,_0x4dd40f,_0x13e49d,_0x157f41){if(_0x1bb628&&_0x4dd40f){_0x4dd40f[_0xf5e7('0x28')]-=0x1;var _0x19c1be={'leaveAt':moment()[_0xf5e7('0x16')](_0xf5e7('0x2a')),'exitAt':moment()['format'](_0xf5e7('0x2a')),'reason':_0xf5e7('0x3f')};logger[_0xf5e7('0x40')](util['format'](_0xf5e7('0x41'),_0x1bb628,_0x4dd40f[_0xf5e7('0x36')]));emitChannelQueueInteraction(_0x13e49d[_0xf5e7('0x2e')],_0x4dd40f[_0xf5e7('0x36')],_0x13e49d[_0xf5e7('0x29')],_0x13e49d[_0xf5e7('0xe')][_0xf5e7('0x36')],_0x13e49d[_0xf5e7('0x32')]['id'],![],_0x157f41);if(rpc[_0x13e49d[_0xf5e7('0x2e')]+_0xf5e7('0x37')]){return rpc[_0x13e49d[_0xf5e7('0x2e')]+'QueueReport'][_0xf5e7('0x3c')](_0x1bb628,_0x19c1be)[_0xf5e7('0x39')](function(_0x14a699){logger[_0xf5e7('0x3e')](_0xf5e7('0x42'),_0x14a699);});}}}function handleFindQueue(_0xba1bd0){return function(_0x3aa355){return _0x3aa355[_0xf5e7('0x36')][_0xf5e7('0x43')]()===_0xba1bd0[_0xf5e7('0x43')]();};}exports[_0xf5e7('0x44')]=function(_0x135f1b,_0x2036d3,_0x1317f8,_0x3ca53f){return function(_0x5894c2){try{var _0x1dd4f3={'name':_0x2036d3[0x0],'timeout':_0x2036d3[0x1]};var _0x41a85f=queue[_0xf5e7('0x0')](_0x1dd4f3,{'typecast':!![]});if(_0x41a85f[_0xf5e7('0x45')]){logger[_0xf5e7('0x3e')](_0xf5e7('0x46'),_0x135f1b,_[_0xf5e7('0x47')](_0x41a85f,_0xf5e7('0x32'))[_0xf5e7('0x48')](',\x20'));_0x5894c2[_0xf5e7('0x49')]();}else{var _0x49d70f=_[_0xf5e7('0x4a')](_0x1317f8[_0x3ca53f[_0xf5e7('0x2e')]+'Queues'],handleFindQueue(_0x1dd4f3['name']));if(_0x49d70f){startRouting(_0x135f1b,_0x49d70f,_0x3ca53f,_0x1317f8);var _0x5df3d5=(_0x49d70f['timeout']||0xa)*0x3e8;var _0x326082=(_0x1dd4f3[_0xf5e7('0x3f')]||0x14)*0x3e8;var _0x3e90be;if(_0x5df3d5>_0x326082){_0x326082=_0x5df3d5;}var _0x2be198=seqqueue['createQueue'](_0x5df3d5);_0x2be198['id']=_0x135f1b;_0x2be198[_0xf5e7('0x4b')]=_0x5df3d5;_0x2be198[_0xf5e7('0x4c')]=_0x326082;_0x2be198[_0xf5e7('0x2e')]=_0x3ca53f[_0xf5e7('0x2e')];_0x1317f8[_0xf5e7('0x4d')][_0x135f1b]['on'](_0xf5e7('0x4e'),function(){logger['info'](_0xf5e7('0x4f'),_0x135f1b);stopRouting(_0x135f1b,_0x49d70f,_0x3ca53f,_0x1317f8);clearTimeout(_0x3e90be);_0x3e90be=undefined;_0x2be198[_0xf5e7('0x50')](!![]);if(_0x1317f8[_0xf5e7('0x4d')][_0x135f1b]){delete _0x1317f8[_0xf5e7('0x4d')][_0x135f1b];}_0x5894c2['stop']();});_0x1317f8[_0xf5e7('0x4d')][_0x135f1b]['on'](_0xf5e7('0x51'),function(){if(_0x1317f8[_0xf5e7('0x4d')][_0x135f1b]){delete _0x1317f8[_0xf5e7('0x4d')][_0x135f1b];}});_0x3e90be=setTimeout(function(){logger[_0xf5e7('0x40')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x135f1b);endRouting(_0x135f1b,_0x49d70f,_0x3ca53f,_0x1317f8);clearTimeout(_0x3e90be);_0x2be198['close'](!![]);_0x5894c2[_0xf5e7('0x52')]();},_0x326082);switch(_0x49d70f[_0xf5e7('0x53')]){case'rrmemory':strategy[_0xf5e7('0x54')](_0x2be198,_0x49d70f,_0x1317f8,_0x3ca53f);break;default:strategy[_0xf5e7('0x55')](_0x2be198,_0x49d70f,_0x1317f8,_0x3ca53f);}}else{logger[_0xf5e7('0x3e')](_0xf5e7('0x56'),_0x135f1b,_0x1dd4f3[_0xf5e7('0x36')]);_0x5894c2['stop']();}}}catch(_0x5810f3){logger[_0xf5e7('0x3e')]('[%s][QUEUE]\x20%s',_0x135f1b,_0x5810f3[_0xf5e7('0x57')]);_0x5894c2['stop']();}};}; \ No newline at end of file +var _0x40b6=['stack','validate','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','queue_id','account','from','joinAt','emit','clone','queue','push','capitalize','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','Queues','timeout','createQueue','atimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s'];(function(_0x3af384,_0x2b2160){var _0x194aad=function(_0x39c9e4){while(--_0x39c9e4){_0x3af384['push'](_0x3af384['shift']());}};_0x194aad(++_0x2b2160);}(_0x40b6,0xf7));var _0x640b=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x40b6[_0x397cfb];return _0x15fed9;};'use strict';var schema=require(_0x640b('0x0'));var _=require('lodash');var util=require(_0x640b('0x1'));var seqqueue=require(_0x640b('0x2'));var moment=require(_0x640b('0x3'));var Redis=require(_0x640b('0x4'));var config=require(_0x640b('0x5'));var logger=require(_0x640b('0x6'))(_0x640b('0x7'));var strategy=require(_0x640b('0x8'));config[_0x640b('0x9')]=_[_0x640b('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x640b('0x9')]));var attributes=['id',_0x640b('0xb'),_0x640b('0xc'),'queue',_0x640b('0xd'),_0x640b('0xe')];function emit(_0x360ebf,_0x5676fa,_0x44d587){io['to'](_0x360ebf)[_0x640b('0xf')](_0x5676fa,_0x44d587);}function emitChannelQueueInteraction(_0xe0bce5,_0x36574a,_0x58beec,_0x176fd1,_0x24d939,_0x9b2b6d,_0x18b3d2,_0x5d04a9){var _0x666b54=_[_0x640b('0x10')](_0x58beec);_0x666b54['queue_id']=_0x5d04a9;_0x666b54[_0x640b('0x11')]=_0x36574a;_0x666b54[_0x640b('0xc')]=_0x176fd1;_0x666b54['id']=_0x24d939;if(_0x9b2b6d){attributes[_0x640b('0x12')](_[_0x640b('0x13')](_0xe0bce5)+'InteractionId');_0x18b3d2[util[_0x640b('0x14')](_0x640b('0x15'),_0xe0bce5)][_0x24d939]=_[_0x640b('0x16')](_0x666b54,attributes);}else{delete _0x18b3d2[util[_0x640b('0x14')](_0x640b('0x15'),_0xe0bce5)][_0x24d939];}emit(util[_0x640b('0x14')](_0x640b('0x17'),_0xe0bce5,_0x36574a),util[_0x640b('0x14')](_0x640b('0x18'),_0xe0bce5,_0x9b2b6d?_0x640b('0x19'):'remove'),_[_0x640b('0x16')](_0x666b54,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x640b('0x1a')),'smsQueueReport':require(_0x640b('0x1b')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport'),'chatInteraction':require('../../rpc/chatInteraction'),'faxInteraction':require(_0x640b('0x1c')),'mailInteraction':require(_0x640b('0x1d')),'openchannelInteraction':require(_0x640b('0x1e')),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require(_0x640b('0x1f'))};var queue=schema({'name':{'type':_0x640b('0x20'),'required':!![],'message':_0x640b('0x21')},'timeout':{'type':_0x640b('0x22'),'message':_0x640b('0x23')}});function startRouting(_0x20d150,_0x1f0663,_0x6991ed,_0x17717e){if(_0x20d150&&_0x1f0663&&_0x6991ed){_0x1f0663[_0x640b('0x24')]+=0x1;var _0x2439a7={'uniqueid':_0x20d150,'from':_0x6991ed[_0x640b('0x25')]?_0x6991ed['body'][_0x640b('0xd')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x6991ed[_0x640b('0x26')]?_0x6991ed[_0x640b('0x26')]['id']:null,'ListId':_0x6991ed[_0x640b('0x27')]?_0x6991ed[_0x640b('0x27')]['id']:null};_0x2439a7[_[_0x640b('0x28')](_0x6991ed[_0x640b('0x29')])+_0x640b('0x2a')]=_0x1f0663['id']||null;_0x2439a7[_['upperFirst'](_0x6991ed[_0x640b('0x29')])+_0x640b('0x2b')]=_0x6991ed[_0x640b('0x2c')]?_0x6991ed[_0x640b('0x2c')]['id']:null;_0x2439a7[_[_0x640b('0x28')](_0x6991ed[_0x640b('0x29')])+_0x640b('0x2d')]=_0x6991ed[_0x640b('0x2e')]?_0x6991ed[_0x640b('0x2e')]['id']:null;_0x2439a7[_[_0x640b('0x28')](_0x6991ed[_0x640b('0x29')])+(_0x6991ed[_0x640b('0x29')]!==_0x640b('0x2f')?'AccountId':_0x640b('0x30'))]=_0x6991ed['account']?_0x6991ed['account']['id']:null;logger[_0x640b('0x31')](util[_0x640b('0x14')](_0x640b('0x32'),_0x20d150,_0x1f0663['name']));emitChannelQueueInteraction(_0x6991ed[_0x640b('0x29')],_0x1f0663[_0x640b('0x33')],_0x2439a7,_0x6991ed[_0x640b('0xc')]['name'],_0x6991ed[_0x640b('0x2e')]['id'],!![],_0x17717e,_0x1f0663['id']);if(rpc[_0x6991ed[_0x640b('0x29')]+_0x640b('0x34')]){return rpc[_0x6991ed[_0x640b('0x29')]+_0x640b('0x34')][_0x640b('0x35')](_0x2439a7)[_0x640b('0x36')](function(_0x313c6a){logger[_0x640b('0x37')]('create\x20queue\x20report',_0x313c6a);});}}}function stopRouting(_0x22b16e,_0x24e7cf,_0x39e17d,_0x14df43){if(_0x22b16e&&_0x24e7cf){_0x24e7cf[_0x640b('0x24')]-=0x1;var _0x4cfb7c={'leaveAt':moment()[_0x640b('0x14')](_0x640b('0x38')),'acceptAt':moment()[_0x640b('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger['info'](util['format'](_0x640b('0x39'),_0x22b16e,_0x24e7cf[_0x640b('0x33')]));emitChannelQueueInteraction(_0x39e17d['channel'],_0x24e7cf[_0x640b('0x33')],_0x39e17d[_0x640b('0x25')],_0x39e17d['account'][_0x640b('0x33')],_0x39e17d[_0x640b('0x2e')]['id'],![],_0x14df43,_0x24e7cf['id']);return rpc[_0x39e17d[_0x640b('0x29')]+_0x640b('0x3a')]['update'](_0x39e17d['interaction']['id'],{'queueId':_0x24e7cf['id']})['then'](function(){if(rpc[_0x39e17d['channel']+_0x640b('0x34')]){return rpc[_0x39e17d[_0x640b('0x29')]+_0x640b('0x34')][_0x640b('0x3b')](_0x22b16e,_0x4cfb7c)[_0x640b('0x36')](function(_0x233885){logger['error']('update\x20queue\x20report',_0x233885);});}});}}function endRouting(_0x20d3c7,_0x147de9,_0x130936,_0x3a166e){if(_0x20d3c7&&_0x147de9){_0x147de9[_0x640b('0x24')]-=0x1;var _0x41f4e7={'leaveAt':moment()[_0x640b('0x14')](_0x640b('0x38')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0x640b('0x31')](util[_0x640b('0x14')]('[%s][END:QUEUE][NAME:%s]',_0x20d3c7,_0x147de9[_0x640b('0x33')]));emitChannelQueueInteraction(_0x130936[_0x640b('0x29')],_0x147de9['name'],_0x130936[_0x640b('0x25')],_0x130936[_0x640b('0xc')][_0x640b('0x33')],_0x130936['message']['id'],![],_0x3a166e);if(rpc[_0x130936['channel']+'QueueReport']){return rpc[_0x130936['channel']+_0x640b('0x34')][_0x640b('0x3b')](_0x20d3c7,_0x41f4e7)[_0x640b('0x36')](function(_0x5dfe23){logger[_0x640b('0x37')]('update\x20queue\x20report',_0x5dfe23);});}}}function handleFindQueue(_0x36d840){return function(_0x677eab){return _0x677eab['name'][_0x640b('0x3c')]()===_0x36d840[_0x640b('0x3c')]();};}exports[_0x640b('0x3d')]=function(_0x1981fd,_0x54c354,_0x16a866,_0x5337d0){return function(_0x26e6f1){try{var _0x5a0ca0={'name':_0x54c354[0x0],'timeout':_0x54c354[0x1]};var _0x4d7232=queue['validate'](_0x5a0ca0,{'typecast':!![]});if(_0x4d7232[_0x640b('0x3e')]){logger[_0x640b('0x37')](_0x640b('0x3f'),_0x1981fd,_[_0x640b('0x40')](_0x4d7232,_0x640b('0x2e'))[_0x640b('0x41')](',\x20'));_0x26e6f1[_0x640b('0x42')]();}else{var _0x4a178d=_['find'](_0x16a866[_0x5337d0['channel']+_0x640b('0x43')],handleFindQueue(_0x5a0ca0['name']));if(_0x4a178d){startRouting(_0x1981fd,_0x4a178d,_0x5337d0,_0x16a866);var _0x4124f9=(_0x4a178d[_0x640b('0x44')]||0xa)*0x3e8;var _0x36c02e=(_0x5a0ca0['timeout']||0x14)*0x3e8;var _0x574fed;if(_0x4124f9>_0x36c02e){_0x36c02e=_0x4124f9;}var _0x201007=seqqueue[_0x640b('0x45')](_0x4124f9);_0x201007['id']=_0x1981fd;_0x201007[_0x640b('0x46')]=_0x4124f9;_0x201007['qtimeout']=_0x36c02e;_0x201007[_0x640b('0x29')]=_0x5337d0[_0x640b('0x29')];_0x16a866['rules'][_0x1981fd]['on'](_0x640b('0x47'),function(){logger[_0x640b('0x31')](_0x640b('0x48'),_0x1981fd);stopRouting(_0x1981fd,_0x4a178d,_0x5337d0,_0x16a866);clearTimeout(_0x574fed);_0x574fed=undefined;_0x201007[_0x640b('0x49')](!![]);if(_0x16a866[_0x640b('0x4a')][_0x1981fd]){delete _0x16a866[_0x640b('0x4a')][_0x1981fd];}_0x26e6f1['stop']();});_0x16a866['rules'][_0x1981fd]['on'](_0x640b('0x4b'),function(){if(_0x16a866[_0x640b('0x4a')][_0x1981fd]){delete _0x16a866[_0x640b('0x4a')][_0x1981fd];}});_0x574fed=setTimeout(function(){logger[_0x640b('0x31')](_0x640b('0x4c'),_0x1981fd);endRouting(_0x1981fd,_0x4a178d,_0x5337d0,_0x16a866);clearTimeout(_0x574fed);_0x201007['close'](!![]);_0x26e6f1[_0x640b('0x4d')]();},_0x36c02e);switch(_0x4a178d['strategy']){case _0x640b('0x4e'):strategy[_0x640b('0x4e')](_0x201007,_0x4a178d,_0x16a866,_0x5337d0);break;default:strategy[_0x640b('0x4f')](_0x201007,_0x4a178d,_0x16a866,_0x5337d0);}}else{logger[_0x640b('0x37')](_0x640b('0x50'),_0x1981fd,_0x5a0ca0[_0x640b('0x33')]);_0x26e6f1['stop']();}}}catch(_0x2fe464){logger['error'](_0x640b('0x3f'),_0x1981fd,_0x2fe464[_0x640b('0x51')]);_0x26e6f1[_0x640b('0x42')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index d6c8ace..d0dce39 100644 --- a/server/services/routing/server/applications/strategy/agent.js +++ b/server/services/routing/server/applications/strategy/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bde=['handleTimeout','timeout','prototype','handleRun','handleDrained','debug','[%s][AGENT]\x20try\x20with\x20%s','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','hideNotification','removeWaitingNotification','uuid','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','bind'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var uuid=require(_0xe0bd('0x0'));var util=require('./util');var logger=require(_0xe0bd('0x1'))(_0xe0bd('0x2'));var Agent=function(_0x1d8922,_0x1e198a,_0x2da4bd,_0x5541b9){this[_0xe0bd('0x3')]=uuid['v4']();this[_0xe0bd('0x4')]=_0x1d8922;this[_0xe0bd('0x5')]=_0x1e198a;this[_0xe0bd('0x6')]=_0x2da4bd;this[_0xe0bd('0x2')]=_0x5541b9;this[_0xe0bd('0x4')][_0xe0bd('0x7')](this['handleRun'][_0xe0bd('0x8')](this),this[_0xe0bd('0x9')][_0xe0bd('0x8')](this));this[_0xe0bd('0x4')]['on'](_0xe0bd('0xa'),this[_0xe0bd('0x9')][_0xe0bd('0x8')](this));this[_0xe0bd('0x4')]['on']('drained',this['handleDrained']['bind'](this));};Agent[_0xe0bd('0xb')]['push']=function(){this['squeue'][_0xe0bd('0x7')](this[_0xe0bd('0xc')]['bind'](this),this[_0xe0bd('0x9')]['bind'](this));};Agent[_0xe0bd('0xb')][_0xe0bd('0xd')]=function(){this[_0xe0bd('0x9')](!![]);};Agent[_0xe0bd('0xb')][_0xe0bd('0xc')]=function(){logger[_0xe0bd('0xe')](_0xe0bd('0xf'),this[_0xe0bd('0x4')]['id'],this['agent']['id']);if(_['isNil'](this['realtime'][_0xe0bd('0x10')][this[_0xe0bd('0x5')]['id']])){logger[_0xe0bd('0xe')](_0xe0bd('0x11'),this[_0xe0bd('0x4')]['id'],this['agent']['id']);setTimeout(this['push'][_0xe0bd('0x8')](this),0x3e8);}else{if(this['routing'][_0xe0bd('0x12')]||util[_0xe0bd('0x13')](this[_0xe0bd('0x4')]['id'],this[_0xe0bd('0x6')]['agents'][this[_0xe0bd('0x5')]['id']],this[_0xe0bd('0x4')][_0xe0bd('0x14')],![])){this['realtime'][_0xe0bd('0x10')][this[_0xe0bd('0x5')]['id']][_0xe0bd('0x15')]=!![];this['realtime'][_0xe0bd('0x10')][this[_0xe0bd('0x5')]['id']][_0xe0bd('0x16')]=undefined;util['saveWaitingNotification'](this[_0xe0bd('0x6')],this['routing'],this[_0xe0bd('0x5')],this[_0xe0bd('0x4')]['channel']);util[_0xe0bd('0x17')](this[_0xe0bd('0x3')],this[_0xe0bd('0x4')]['id'],this[_0xe0bd('0x6')][_0xe0bd('0x10')][this[_0xe0bd('0x5')]['id']],null,this[_0xe0bd('0x2')]);util[_0xe0bd('0x18')](this['squeue']['id'],this['realtime'][_0xe0bd('0x10')][this[_0xe0bd('0x5')]['id']],'RINGING'+(this['routing'][_0xe0bd('0x12')]?_0xe0bd('0x19'):''));}else{logger[_0xe0bd('0xe')](_0xe0bd('0x1a'),this['squeue']['id'],this[_0xe0bd('0x5')]['id']);setTimeout(this['push'][_0xe0bd('0x8')](this),0x3e8);}}};Agent[_0xe0bd('0xb')][_0xe0bd('0x9')]=function(_0x1b857c){if(_[_0xe0bd('0x1b')](this[_0xe0bd('0x6')][_0xe0bd('0x10')][this[_0xe0bd('0x5')]['id']])){return logger[_0xe0bd('0xe')](_0xe0bd('0x11'),this[_0xe0bd('0x4')]['id'],this[_0xe0bd('0x5')]['id']);}else{logger[_0xe0bd('0xe')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xe0bd('0x4')]['id'],this[_0xe0bd('0x5')]['id']);util[_0xe0bd('0x1c')](this[_0xe0bd('0x3')],this[_0xe0bd('0x4')]['id'],this[_0xe0bd('0x6')]['agents'][this['agent']['id']],null,this[_0xe0bd('0x2')]);this[_0xe0bd('0x6')][_0xe0bd('0x10')][this[_0xe0bd('0x5')]['id']][_0xe0bd('0x15')]=![];this[_0xe0bd('0x6')][_0xe0bd('0x10')][this['agent']['id']][_0xe0bd('0x16')]=undefined;util[_0xe0bd('0x1d')](this[_0xe0bd('0x6')],this[_0xe0bd('0x2')],this[_0xe0bd('0x5')],this[_0xe0bd('0x4')]['channel']);util[_0xe0bd('0x18')](this[_0xe0bd('0x4')]['id'],this[_0xe0bd('0x6')][_0xe0bd('0x10')][this[_0xe0bd('0x5')]['id']],_0x1b857c?'STOP':'TIMEOUT');}if(!_0x1b857c){setTimeout(this[_0xe0bd('0x7')][_0xe0bd('0x8')](this),0x3e8);}};function agent(_0x5a534,_0x568e46,_0x8a331,_0x4eefae){return new Agent(_0x5a534,_0x568e46,_0x8a331,_0x4eefae);}module['exports']=agent; \ No newline at end of file +var _0xb7c8=['showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','removeWaitingNotification','STOP','TIMEOUT','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','handleTimeout','drained','prototype','handleDrained','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','saveWaitingNotification'];(function(_0x21a564,_0x4a0ddc){var _0x361aa9=function(_0x140771){while(--_0x140771){_0x21a564['push'](_0x21a564['shift']());}};_0x361aa9(++_0x4a0ddc);}(_0xb7c8,0x119));var _0x8b7c=function(_0x48fc8b,_0x55d082){_0x48fc8b=_0x48fc8b-0x0;var _0x2923a6=_0xb7c8[_0x48fc8b];return _0x2923a6;};'use strict';var _=require('lodash');var uuid=require(_0x8b7c('0x0'));var util=require(_0x8b7c('0x1'));var logger=require(_0x8b7c('0x2'))(_0x8b7c('0x3'));var Agent=function(_0x1dceff,_0x31ad24,_0x396b64,_0x50113e){this[_0x8b7c('0x4')]=uuid['v4']();this[_0x8b7c('0x5')]=_0x1dceff;this[_0x8b7c('0x6')]=_0x31ad24;this[_0x8b7c('0x7')]=_0x396b64;this[_0x8b7c('0x3')]=_0x50113e;this[_0x8b7c('0x5')][_0x8b7c('0x8')](this[_0x8b7c('0x9')][_0x8b7c('0xa')](this),this[_0x8b7c('0xb')][_0x8b7c('0xa')](this));this[_0x8b7c('0x5')]['on']('timeout',this[_0x8b7c('0xb')]['bind'](this));this[_0x8b7c('0x5')]['on'](_0x8b7c('0xc'),this['handleDrained'][_0x8b7c('0xa')](this));};Agent[_0x8b7c('0xd')][_0x8b7c('0x8')]=function(){this['squeue']['push'](this[_0x8b7c('0x9')][_0x8b7c('0xa')](this),this[_0x8b7c('0xb')][_0x8b7c('0xa')](this));};Agent[_0x8b7c('0xd')][_0x8b7c('0xe')]=function(){this[_0x8b7c('0xb')](!![]);};Agent['prototype'][_0x8b7c('0x9')]=function(){logger[_0x8b7c('0xf')](_0x8b7c('0x10'),this['squeue']['id'],this[_0x8b7c('0x6')]['id']);if(_[_0x8b7c('0x11')](this['realtime'][_0x8b7c('0x12')][this[_0x8b7c('0x6')]['id']])){logger[_0x8b7c('0xf')](_0x8b7c('0x13'),this[_0x8b7c('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x8b7c('0x8')][_0x8b7c('0xa')](this),0x3e8);}else{if(this[_0x8b7c('0x3')][_0x8b7c('0x14')]||util[_0x8b7c('0x15')](this['squeue']['id'],this[_0x8b7c('0x7')][_0x8b7c('0x12')][this[_0x8b7c('0x6')]['id']],this[_0x8b7c('0x5')][_0x8b7c('0x16')],![])){this[_0x8b7c('0x7')][_0x8b7c('0x12')][this[_0x8b7c('0x6')]['id']][_0x8b7c('0x17')]=!![];this[_0x8b7c('0x7')][_0x8b7c('0x12')][this[_0x8b7c('0x6')]['id']]['busyQueue']=undefined;util[_0x8b7c('0x18')](this[_0x8b7c('0x7')],this[_0x8b7c('0x3')],this[_0x8b7c('0x6')],this[_0x8b7c('0x5')][_0x8b7c('0x16')]);util[_0x8b7c('0x19')](this[_0x8b7c('0x4')],this[_0x8b7c('0x5')]['id'],this[_0x8b7c('0x7')]['agents'][this['agent']['id']],null,this[_0x8b7c('0x3')]);util['writeLog'](this[_0x8b7c('0x5')]['id'],this[_0x8b7c('0x7')][_0x8b7c('0x12')][this[_0x8b7c('0x6')]['id']],_0x8b7c('0x1a')+(this[_0x8b7c('0x3')]['forcedOwnership']?_0x8b7c('0x1b'):''));}else{logger[_0x8b7c('0xf')](_0x8b7c('0x1c'),this[_0x8b7c('0x5')]['id'],this[_0x8b7c('0x6')]['id']);setTimeout(this[_0x8b7c('0x8')][_0x8b7c('0xa')](this),0x3e8);}}};Agent[_0x8b7c('0xd')][_0x8b7c('0xb')]=function(_0x148d1f){if(_['isNil'](this['realtime'][_0x8b7c('0x12')][this[_0x8b7c('0x6')]['id']])){return logger[_0x8b7c('0xf')](_0x8b7c('0x13'),this[_0x8b7c('0x5')]['id'],this[_0x8b7c('0x6')]['id']);}else{logger[_0x8b7c('0xf')](_0x8b7c('0x1d'),this[_0x8b7c('0x5')]['id'],this[_0x8b7c('0x6')]['id']);util['hideNotification'](this[_0x8b7c('0x4')],this['squeue']['id'],this[_0x8b7c('0x7')][_0x8b7c('0x12')][this['agent']['id']],null,this[_0x8b7c('0x3')]);this['realtime'][_0x8b7c('0x12')][this[_0x8b7c('0x6')]['id']][_0x8b7c('0x17')]=![];this[_0x8b7c('0x7')][_0x8b7c('0x12')][this[_0x8b7c('0x6')]['id']][_0x8b7c('0x1e')]=undefined;util[_0x8b7c('0x1f')](this[_0x8b7c('0x7')],this['routing'],this[_0x8b7c('0x6')],this[_0x8b7c('0x5')]['channel']);util['writeLog'](this['squeue']['id'],this[_0x8b7c('0x7')][_0x8b7c('0x12')][this['agent']['id']],_0x148d1f?_0x8b7c('0x20'):_0x8b7c('0x21'));}if(!_0x148d1f){setTimeout(this[_0x8b7c('0x8')][_0x8b7c('0xa')](this),0x3e8);}};function agent(_0x57715c,_0x22d231,_0x243588,_0x2c674a){return new Agent(_0x57715c,_0x22d231,_0x243588,_0x2c674a);}module['exports']=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 93d4acd..f788c78 100644 --- a/server/services/routing/server/applications/strategy/beepall.js +++ b/server/services/routing/server/applications/strategy/beepall.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac62=['bind','timeout','drained','prototype','handleDrained','isNil','queue','Agents','length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busyQueue','name','saveWaitingNotification','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','removeWaitingNotification','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','handleTimeout'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xac62,0x65));var _0x2ac6=function(_0x44731a,_0x3417bb){_0x44731a=_0x44731a-0x0;var _0x5541bd=_0xac62[_0x44731a];return _0x5541bd;};'use strict';var _=require(_0x2ac6('0x0'));var uuid=require('uuid');var util=require(_0x2ac6('0x1'));var logger=require(_0x2ac6('0x2'))(_0x2ac6('0x3'));var Beepall=function(_0x22d0f6,_0x57c522,_0x486b32,_0x1e0057){this[_0x2ac6('0x4')]=uuid['v4']();this[_0x2ac6('0x5')]=_0x22d0f6;this['queue']=_0x57c522;this[_0x2ac6('0x6')]=_0x486b32;this['routing']=_0x1e0057;this[_0x2ac6('0x5')][_0x2ac6('0x7')](this[_0x2ac6('0x8')]['bind'](this),this[_0x2ac6('0x9')][_0x2ac6('0xa')](this));this['squeue']['on'](_0x2ac6('0xb'),this[_0x2ac6('0x9')][_0x2ac6('0xa')](this));this['squeue']['on'](_0x2ac6('0xc'),this['handleDrained'][_0x2ac6('0xa')](this));};Beepall[_0x2ac6('0xd')]['push']=function(){this[_0x2ac6('0x5')][_0x2ac6('0x7')](this[_0x2ac6('0x8')][_0x2ac6('0xa')](this),this[_0x2ac6('0x9')]['bind'](this));};Beepall[_0x2ac6('0xd')][_0x2ac6('0xe')]=function(){this[_0x2ac6('0x9')](!![]);};Beepall['prototype'][_0x2ac6('0x8')]=function(){var _0x29f807=!![];if(!_[_0x2ac6('0xf')](this[_0x2ac6('0x10')])&&!_['isNil'](this['queue'][_0x2ac6('0x11')])&&this[_0x2ac6('0x10')][_0x2ac6('0x11')][_0x2ac6('0x12')]>0x0){for(var _0x77683f=0x0,_0x4e7bd0;_0x77683f0x0){for(var _0x4be642=0x0,_0x198552;_0x4be6420x0&&_0x383609[_0x8e1748+_0xe841('0x23')]>=_0x383609[_0x8e1748+_0xe841('0x22')]){writeLog(_0xce9fcf,_0x383609,_0x8e1748['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0x42a9af,_0x56c7a5,_0x21f392,_0x58a7b0,_0x2c5fc1){return sendNotification(!![],_0x42a9af,_0x56c7a5,_0x21f392,_0x58a7b0,_0x2c5fc1);};exports[_0xe841('0x24')]=function(_0x5bdba6,_0xbb5458,_0x4c0c06,_0x12109d,_0x1dda27){return sendNotification(![],_0x5bdba6,_0xbb5458,_0x4c0c06,_0x12109d,_0x1dda27);};exports[_0xe841('0x25')]=function(_0x5cfb06,_0x3a8d2b,_0x406d88){var _0x5da558=_0x3a8d2b[_0xe841('0x26')][_0xe841('0x27')];if(!_0x5da558&&_0x406d88){_0x5da558=_0x406d88['id'];}var _0x1f25c4=_['some'](_0x5cfb06[_0x3a8d2b['channel']+_0xe841('0x28')],function(_0x17c9c4){var _0x3dcc24=_['capitalize'](_0x3a8d2b[_0xe841('0x29')])+_0xe841('0x2a');return _0x17c9c4[_0x3dcc24]===_0x3a8d2b['interaction']['id'];});if(!_0x1f25c4&&_0x5da558&&_0x5cfb06['agents'][_0x5da558]){_0x1f25c4=_[_0xe841('0x2b')](_0x5cfb06[_0xe841('0x2c')][_0x5da558][_0x3a8d2b['channel']+_0xe841('0x2d')],function(_0x4fd3d5){return _0x4fd3d5['id']===_0x3a8d2b[_0xe841('0x26')]['id'];});}return _0x1f25c4;};exports[_0xe841('0x2e')]=function(_0x52d25b,_0x22eb1d,_0x1d10c,_0x273db0){if(_0x1d10c&&_0x1d10c['id']&&_0x52d25b['agents']&&_0x52d25b['agents'][_0x1d10c['id']]){_0x52d25b['agents'][_0x1d10c['id']][_0x273db0+_0xe841('0x2d')][_0x22eb1d[_0xe841('0x14')]['id']]={'id':_0x22eb1d[_0xe841('0x26')]['id']};}};exports[_0xe841('0x2f')]=function(_0x3771d4,_0x553687,_0x3219c4,_0x186d9c){if(_0x3219c4&&_0x3219c4['id']&&_0x3771d4[_0xe841('0x2c')]&&_0x3771d4['agents'][_0x3219c4['id']]){delete _0x3771d4['agents'][_0x3219c4['id']][_0x186d9c+_0xe841('0x2d')][_0x553687['message']['id']];}};exports[_0xe841('0x30')]=writeLog; \ No newline at end of file +var _0x9672=['notificationSound','body','queue','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','user:%s','emit','notification:%s','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','checkWaitingNotifications','interaction','UserId','some','channel','capitalize','InteractionId','agents','WaitingInteractions','saveWaitingNotification','message','writeLog','lodash','util','ioredis','../../../../../config/environment','../../../../../config/logger','routing','defaults','redis','localhost','\x20interaction','name','account'];(function(_0x92b3c2,_0x14a2b1){var _0x5227c3=function(_0x35d374){while(--_0x35d374){_0x92b3c2['push'](_0x92b3c2['shift']());}};_0x5227c3(++_0x14a2b1);}(_0x9672,0xee));var _0x2967=function(_0x408c72,_0x130bee){_0x408c72=_0x408c72-0x0;var _0x30d195=_0x9672[_0x408c72];return _0x30d195;};'use strict';var _=require(_0x2967('0x0'));var util=require(_0x2967('0x1'));var utils=require('../utils');var Redis=require(_0x2967('0x2'));var config=require(_0x2967('0x3'));var logger=require(_0x2967('0x4'))(_0x2967('0x5'));config['redis']=_[_0x2967('0x6')](config[_0x2967('0x7')],{'host':_0x2967('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function sendNotification(_0x24424d,_0x355e82,_0x1aa9a5,_0x77f846,_0x3bcd7e,_0xf353b6){var _0x45ebae=_0xf353b6||{};var _0x30e72f=_0x1aa9a5['split']('.');var _0x398041={'uniqueid':_0x355e82,'channel':_0x30e72f[0x0],'id':_0x30e72f[0x1],'title':_0x30e72f[0x0]+_0x2967('0x9'),'interactionId':_0x30e72f[0x2],'queue':_0x3bcd7e?_0x3bcd7e[_0x2967('0xa')]:null,'sound':_0x45ebae[_0x2967('0xb')][_0x2967('0xc')],'shake':_0x45ebae[_0x2967('0xb')]['notificationShake']};try{if(!_0x45ebae[_0x2967('0xd')]){_0x45ebae['body']={};}if(_0x3bcd7e){_0x45ebae[_0x2967('0xd')]['queue']=_0x3bcd7e;}else if(_0x45ebae[_0x2967('0xd')][_0x2967('0xe')]){delete _0x45ebae['body'][_0x2967('0xe')];}_0x398041['msg']=utils[_0x2967('0xf')](_0x45ebae[_0x2967('0xb')][_0x2967('0x10')],_0x45ebae);}catch(_0x52d5c0){_0x398041['msg']=_0x2967('0x11');logger[_0x2967('0x12')](util[_0x2967('0x13')]('[%s][QUEUE]\x20%s',_0x355e82,_0x52d5c0['message']));}io['to'](util[_0x2967('0x13')](_0x2967('0x14'),_0x77f846[_0x2967('0xa')]))[_0x2967('0x15')](util[_0x2967('0x13')](_0x2967('0x16'),_0x24424d?_0x2967('0x17'):_0x2967('0x18')),_0x398041);}function writeLog(_0x209f45,_0xc9162a,_0x57bf2c){return logger[_0x2967('0x19')](util[_0x2967('0x13')](_0x2967('0x1a'),_0x209f45,_0xc9162a[_0x2967('0xa')],_0x57bf2c));}exports['isAgentAvailable']=function(_0x321e36,_0x1cb5e4,_0x33bb91,_0x56a840){if(_0x1cb5e4['busy']){writeLog(_0x321e36,_0x1cb5e4,_0x2967('0x1b'));return![];}if(!_0x1cb5e4[_0x2967('0x1c')]){writeLog(_0x321e36,_0x1cb5e4,_0x2967('0x1d'));return![];}if(_0x1cb5e4[_0x33bb91+_0x2967('0x1e')]){writeLog(_0x321e36,_0x1cb5e4,_0x2967('0x1f'));return![];}if(_0x56a840&&_0x1cb5e4[_0x2967('0x20')](_0x33bb91+_0x2967('0x21'))&&_0x1cb5e4[_0x2967('0x20')](_0x33bb91+_0x2967('0x22'))){if(_0x1cb5e4[_0x33bb91+'Capacity']>0x0&&_0x1cb5e4[_0x33bb91+_0x2967('0x22')]>=_0x1cb5e4[_0x33bb91+_0x2967('0x21')]){writeLog(_0x321e36,_0x1cb5e4,_0x33bb91[_0x2967('0x23')]()+_0x2967('0x24'));return![];}}return!![];};exports['showNotification']=function(_0x42acb3,_0x4327a5,_0x524ab1,_0x153d63,_0x2f9d9f){return sendNotification(!![],_0x42acb3,_0x4327a5,_0x524ab1,_0x153d63,_0x2f9d9f);};exports[_0x2967('0x25')]=function(_0xef5d7f,_0x2355f2,_0x36c1d9,_0x1a3d42,_0x4e0603){return sendNotification(![],_0xef5d7f,_0x2355f2,_0x36c1d9,_0x1a3d42,_0x4e0603);};exports[_0x2967('0x26')]=function(_0x2a0ad8,_0x1eefcb,_0x57cee6){var _0x2a04e6=_0x1eefcb[_0x2967('0x27')][_0x2967('0x28')];if(!_0x2a04e6&&_0x57cee6){_0x2a04e6=_0x57cee6['id'];}var _0x48a49b=_[_0x2967('0x29')](_0x2a0ad8[_0x1eefcb[_0x2967('0x2a')]+'QueuesWaitingInteractions'],function(_0x1ee7cb){var _0x45c7fd=_[_0x2967('0x2b')](_0x1eefcb['channel'])+_0x2967('0x2c');return _0x1ee7cb[_0x45c7fd]===_0x1eefcb[_0x2967('0x27')]['id'];});if(!_0x48a49b&&_0x2a04e6&&_0x2a0ad8[_0x2967('0x2d')][_0x2a04e6]){_0x48a49b=_['some'](_0x2a0ad8[_0x2967('0x2d')][_0x2a04e6][_0x1eefcb[_0x2967('0x2a')]+_0x2967('0x2e')],function(_0x163786){return _0x163786['id']===_0x1eefcb[_0x2967('0x27')]['id'];});}return _0x48a49b;};exports[_0x2967('0x2f')]=function(_0x50bd99,_0xb19220,_0x3bcc08,_0x390a62){if(_0x3bcc08&&_0x3bcc08['id']&&_0x50bd99[_0x2967('0x2d')]&&_0x50bd99[_0x2967('0x2d')][_0x3bcc08['id']]){_0x50bd99[_0x2967('0x2d')][_0x3bcc08['id']][_0x390a62+_0x2967('0x2e')][_0xb19220[_0x2967('0x30')]['id']]={'id':_0xb19220[_0x2967('0x27')]['id']};}};exports['removeWaitingNotification']=function(_0x4e9a73,_0x15b04b,_0x421ee8,_0x32cd36){if(_0x421ee8&&_0x421ee8['id']&&_0x4e9a73[_0x2967('0x2d')]&&_0x4e9a73['agents'][_0x421ee8['id']]){delete _0x4e9a73[_0x2967('0x2d')][_0x421ee8['id']][_0x32cd36+'WaitingInteractions'][_0x15b04b[_0x2967('0x30')]['id']];}};exports[_0x2967('0x31')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index a57f228..e360f0c 100644 --- a/server/services/routing/server/applications/system.js +++ b/server/services/routing/server/applications/system.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf13e=['isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','validate','shelljs','lodash','./utils','../../../../config/logger','routing','consequence','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace'];(function(_0x4b7067,_0x365795){var _0x2c93be=function(_0x4f21af){while(--_0x4f21af){_0x4b7067['push'](_0x4b7067['shift']());}};_0x2c93be(++_0x365795);}(_0xf13e,0x6a));var _0xef13=function(_0x572dd8,_0x227286){_0x572dd8=_0x572dd8-0x0;var _0x4e3e5a=_0xf13e[_0x572dd8];return _0x4e3e5a;};'use strict';var schema=require(_0xef13('0x0'));var sh=require(_0xef13('0x1'));var _=require(_0xef13('0x2'));var utils=require(_0xef13('0x3'));var logger=require(_0xef13('0x4'))(_0xef13('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xef13('0x6')]=function(_0x1c51d0,_0x287fb8){return function(_0x2e2545){try{var _0x570bd5={'command':_0x287fb8[0x0]};var _0x41da9c=system[_0xef13('0x0')](_0x570bd5,{'typecast':!![]});if(_0x41da9c['length']){logger['error'](_0xef13('0x7'),_0x1c51d0,_['map'](_0x41da9c,_0xef13('0x8'))[_0xef13('0x9')](',\x20'));logger[_0xef13('0xa')](_0xef13('0xb'),_0x1c51d0);_0x2e2545[_0xef13('0xc')]();}else{var _0x1ceeac=this;var _0x57e95c=utils[_0xef13('0xd')](_0x287fb8[0x0],this);logger[_0xef13('0xa')](_0xef13('0xe'),_0x1c51d0,_0x57e95c);sh[_0xef13('0xf')](_[_0xef13('0x10')](_0x57e95c),function(_0x1a3ef1,_0x1f6287){logger['info'](_0xef13('0x11'),_0x1c51d0,_0x1a3ef1);if(_0x1a3ef1==0x0){var _0x44d8bf=_0x1f6287[_0xef13('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x287fb8[0x1])||_[_0xef13('0x13')](_0x287fb8[0x1])){logger['info'](_0xef13('0x14'),_0x1c51d0);_0x1ceeac[_0xef13('0x15')][_0x287fb8[0x1]]=_0x44d8bf;}else{logger[_0xef13('0xa')](_0xef13('0x16'),_0x1c51d0,_0x287fb8[0x1],_0x44d8bf);_0x1ceeac[_0xef13('0x15')][_0x287fb8[0x1]]=_0x44d8bf;}}_0x2e2545[_0xef13('0xc')]();});}}catch(_0x2dcbdf){logger[_0xef13('0x17')](_0xef13('0x7'),_0x1c51d0,_[_0xef13('0x18')](_0x2dcbdf)?JSON['stringify'](_0x2dcbdf):_0x2dcbdf);logger[_0xef13('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x1c51d0);_0x2e2545[_0xef13('0xc')]();}};}; \ No newline at end of file +var _0x1360=['trim','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','lodash','./utils','../../../../config/logger','routing','string','consequence','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec'];(function(_0x2d7484,_0x1b8083){var _0x8d13bc=function(_0x3d76b2){while(--_0x3d76b2){_0x2d7484['push'](_0x2d7484['shift']());}};_0x8d13bc(++_0x1b8083);}(_0x1360,0xd6));var _0x0136=function(_0x411069,_0x16ae05){_0x411069=_0x411069-0x0;var _0x68c645=_0x1360[_0x411069];return _0x68c645;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0x0136('0x0'));var utils=require(_0x0136('0x1'));var logger=require(_0x0136('0x2'))(_0x0136('0x3'));var system=schema({'command':{'type':_0x0136('0x4'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x0136('0x5')]=function(_0x27923d,_0x22fb09){return function(_0x3f018a){try{var _0x3568b0={'command':_0x22fb09[0x0]};var _0x423a6e=system['validate'](_0x3568b0,{'typecast':!![]});if(_0x423a6e['length']){logger[_0x0136('0x6')](_0x0136('0x7'),_0x27923d,_[_0x0136('0x8')](_0x423a6e,_0x0136('0x9'))[_0x0136('0xa')](',\x20'));logger[_0x0136('0xb')](_0x0136('0xc'),_0x27923d);_0x3f018a[_0x0136('0xd')]();}else{var _0x23bb49=this;var _0x1453f3=utils['getMustacheRender'](_0x22fb09[0x0],this);logger[_0x0136('0xb')](_0x0136('0xe'),_0x27923d,_0x1453f3);sh[_0x0136('0xf')](_[_0x0136('0x10')](_0x1453f3),function(_0x234600,_0x3f9ce0){logger[_0x0136('0xb')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x27923d,_0x234600);if(_0x234600==0x0){var _0x485ed7=_0x3f9ce0['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x0136('0x11')](_0x22fb09[0x1])||_[_0x0136('0x12')](_0x22fb09[0x1])){logger[_0x0136('0xb')](_0x0136('0x13'),_0x27923d);_0x23bb49[_0x0136('0x14')][_0x22fb09[0x1]]=_0x485ed7;}else{logger[_0x0136('0xb')](_0x0136('0x15'),_0x27923d,_0x22fb09[0x1],_0x485ed7);_0x23bb49[_0x0136('0x14')][_0x22fb09[0x1]]=_0x485ed7;}}_0x3f018a[_0x0136('0xd')]();});}}catch(_0x6af95c){logger['error'](_0x0136('0x7'),_0x27923d,_[_0x0136('0x16')](_0x6af95c)?JSON['stringify'](_0x6af95c):_0x6af95c);logger[_0x0136('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x27923d);_0x3f018a['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index d160413..6022bc5 100644 --- a/server/services/routing/server/applications/tag.js +++ b/server/services/routing/server/applications/tag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ddb=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','info','catch','stringify','finally','next','[%s][TAG]\x20%s','isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x4df7dc,_0x536f31){var _0x45230f=function(_0xeae735){while(--_0xeae735){_0x4df7dc['push'](_0x4df7dc['shift']());}};_0x45230f(++_0x536f31);}(_0x6ddb,0x110));var _0xb6dd=function(_0x3937c8,_0x8a4a3f){_0x3937c8=_0x3937c8-0x0;var _0x2b98e2=_0x6ddb[_0x3937c8];return _0x2b98e2;};'use strict';var schema=require(_0xb6dd('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xb6dd('0x1')),'openchannelInteraction':require(_0xb6dd('0x2')),'smsInteraction':require(_0xb6dd('0x3')),'mailInteraction':require(_0xb6dd('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xb6dd('0x5'))};var logger=require('../../../../config/logger')(_0xb6dd('0x6'));var tag=schema({'tag':{'type':_0xb6dd('0x7'),'required':!![],'message':_0xb6dd('0x8')}});exports['consequence']=function(_0x4f2a29,_0x245b30,_0x163b59,_0x1b237a){return function(_0x33a13f){try{var _0x5cc2c0={'tag':_0x245b30[0x0]};var _0x52bc64=tag[_0xb6dd('0x0')](_0x5cc2c0,{'typecast':!![]});if(_0x52bc64[_0xb6dd('0x9')]){logger[_0xb6dd('0xa')]('[%s][TAG]\x20%s',_0x4f2a29,_['map'](_0x52bc64,_0xb6dd('0xb'))[_0xb6dd('0xc')](',\x20'));logger['info'](_0xb6dd('0xd'),_0x4f2a29);_0x33a13f['next']();}else{var _0x367382={'ids':[_0x245b30[0x0]]};if(rpc[_0x1b237a[_0xb6dd('0xe')]+_0xb6dd('0xf')]){rpc[_0x1b237a[_0xb6dd('0xe')]+'Interaction'][_0xb6dd('0x10')](_0x1b237a[_0xb6dd('0x11')]['id'],_0x367382)['then'](function(_0x16885a){logger[_0xb6dd('0x12')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x4f2a29,_0x245b30[0x1],_0x1b237a['channel'],_0x1b237a['interaction']['id']);})[_0xb6dd('0x13')](function(_0x2e3646){logger[_0xb6dd('0xa')]('[%s][TAG]\x20%s',_0x4f2a29,JSON[_0xb6dd('0x14')](_0x2e3646));logger[_0xb6dd('0x12')](_0xb6dd('0xd'),_0x4f2a29);})[_0xb6dd('0x15')](function(){_0x33a13f[_0xb6dd('0x16')]();});}}}catch(_0x120ffd){logger[_0xb6dd('0xa')](_0xb6dd('0x17'),_0x4f2a29,_[_0xb6dd('0x18')](_0x120ffd)?JSON[_0xb6dd('0x14')](_0x120ffd):_0x120ffd);logger[_0xb6dd('0x12')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x4f2a29);_0x33a13f[_0xb6dd('0x16')]();}};}; \ No newline at end of file +var _0x784c=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','number','validate','length','error','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','lodash','../../rpc/chatInteraction'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x784c,0x11e));var _0xc784=function(_0x248536,_0x5a3e53){_0x248536=_0x248536-0x0;var _0x5afdaa=_0x784c[_0x248536];return _0x5afdaa;};'use strict';var schema=require('validate');var _=require(_0xc784('0x0'));var rpc={'chatInteraction':require(_0xc784('0x1')),'openchannelInteraction':require(_0xc784('0x2')),'smsInteraction':require(_0xc784('0x3')),'mailInteraction':require(_0xc784('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0xc784('0x5'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0xba317d,_0x54e1de,_0x1ad4da,_0x26600d){return function(_0x5cc507){try{var _0x3209b9={'tag':_0x54e1de[0x0]};var _0x18959c=tag[_0xc784('0x6')](_0x3209b9,{'typecast':!![]});if(_0x18959c[_0xc784('0x7')]){logger[_0xc784('0x8')](_0xc784('0x9'),_0xba317d,_[_0xc784('0xa')](_0x18959c,'message')[_0xc784('0xb')](',\x20'));logger[_0xc784('0xc')](_0xc784('0xd'),_0xba317d);_0x5cc507[_0xc784('0xe')]();}else{var _0xb08ea7={'ids':[_0x54e1de[0x0]]};if(rpc[_0x26600d[_0xc784('0xf')]+_0xc784('0x10')]){rpc[_0x26600d[_0xc784('0xf')]+_0xc784('0x10')][_0xc784('0x11')](_0x26600d[_0xc784('0x12')]['id'],_0xb08ea7)['then'](function(_0x21a8ae){logger[_0xc784('0xc')](_0xc784('0x13'),_0xba317d,_0x54e1de[0x1],_0x26600d[_0xc784('0xf')],_0x26600d['interaction']['id']);})[_0xc784('0x14')](function(_0x938749){logger[_0xc784('0x8')](_0xc784('0x9'),_0xba317d,JSON[_0xc784('0x15')](_0x938749));logger[_0xc784('0xc')](_0xc784('0xd'),_0xba317d);})[_0xc784('0x16')](function(){_0x5cc507[_0xc784('0xe')]();});}}}catch(_0x54695d){logger[_0xc784('0x8')](_0xc784('0x9'),_0xba317d,_[_0xc784('0x17')](_0x54695d)?JSON[_0xc784('0x15')](_0x54695d):_0x54695d);logger['info'](_0xc784('0xd'),_0xba317d);_0x5cc507[_0xc784('0xe')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 1321953..b7ef4ac 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdcf6=['[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','error','isObject','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','params','stringify','utf8','POST','application/json-rpc','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','then','info'];(function(_0xf1954e,_0x385551){var _0x27b170=function(_0x1a76fe){while(--_0x1a76fe){_0xf1954e['push'](_0xf1954e['shift']());}};_0x27b170(++_0x385551);}(_0xdcf6,0x163));var _0x6dcf=function(_0x508d16,_0x3e5c76){_0x508d16=_0x508d16-0x0;var _0x169e38=_0xdcf6[_0x508d16];return _0x169e38;};'use strict';var rp=require(_0x6dcf('0x0'));var logger=require(_0x6dcf('0x1'))(_0x6dcf('0x2'));var _=require(_0x6dcf('0x3'));var arr=[];exports[_0x6dcf('0x4')]=function(_0x3f2d3d,_0x408485){return function(_0x5b5fc3){var _0x2a3357=_0x408485[0xa];var _0x1d0a71=_0x408485[0xb];var _0x366449=_0x408485[0xc];var _0x3142ef=_0x408485[0xd];var _0x3c669a=_0x408485[0xe];var _0x3bd8b8=_0x408485[0xf][_0x6dcf('0x5')](/\n/g,_0x6dcf('0x6'));var _0x151a4c=_0x408485[0x10][_0x6dcf('0x5')](/\n/g,'\x20');if(!arr[_0x6dcf('0x7')](_0x1d0a71)){arr[_0x6dcf('0x8')](_0x1d0a71);var _0x18f9a4=_0x408485[0x3];var _0x10ec7b=_0x408485[0x4];var _0x331eb5=_0x408485[0x1];var _0xe4b20f=_0x408485[0x0];var _0x42642c={};_0x42642c[_0x6dcf('0x9')]=_0x408485[0x8]+_0x6dcf('0xa')+_0x366449+'|'+_0x2a3357+'|'+_0x3142ef+'|'+_0x1d0a71+'|'+_0x3c669a;_0x42642c[_0x6dcf('0xb')]=_0x408485[0x7]+_0x6dcf('0xa')+_0x366449+'|'+_0x2a3357+'|'+_0x3142ef+'|'+_0x1d0a71+'|'+_0x3c669a+'|'+_0x3bd8b8+'|'+_0x151a4c;_0x42642c[_0x6dcf('0xc')]=_0x408485[0x9];var _0x3f25ed={};_0x3f25ed[_0x6dcf('0xd')]=_0x6dcf('0xe');_0x3f25ed[_0x6dcf('0xf')]='login';var _0x2edb94=[];_0x2edb94['push'](_0x408485[0x2]);_0x2edb94[_0x6dcf('0x8')](_0x408485[0x5]);_0x2edb94[_0x6dcf('0x8')](_0x408485[0x6]);_0x3f25ed[_0x6dcf('0x10')]=_0x2edb94;_0x3f25ed['id']=0x1;var _0x536f6b=JSON[_0x6dcf('0x11')](_0x3f25ed);var _0x1047e5={'encoding':_0x6dcf('0x12'),'method':_0x6dcf('0x13'),'timeout':0x2710,'url':_0x18f9a4,'headers':{'Content-Type':_0x6dcf('0x14')},'body':_0x536f6b};return rp(_0x1047e5)['then'](function(_0x2e6876){const _0x188a8d=JSON[_0x6dcf('0x15')](_0x2e6876);if(!_0x188a8d['result'][_0x6dcf('0x16')]){throw new Error(_0x6dcf('0x17'));}var _0x278e18=_0x1d0a71;var _0x7318f1=_0x6dcf('0x18')+_0x331eb5+_0x6dcf('0x19')+_0xe4b20f+_0x6dcf('0x1a')+_0x278e18+_0x6dcf('0x1b')+JSON[_0x6dcf('0x11')](_0x42642c);var _0x3718e2=_0x10ec7b+'?'+_0x7318f1;return rp(_0x3718e2);})[_0x6dcf('0x1c')](function(_0x1a4ade){logger[_0x6dcf('0x1d')](_0x6dcf('0x1e'),_0x3f2d3d,_0x1a4ade);_0x5b5fc3['stop']();})['catch'](function(_0x9fc581){logger[_0x6dcf('0x1f')]('[%s][TVOX]\x20%s',_0x3f2d3d,_[_0x6dcf('0x20')](_0x9fc581)?JSON[_0x6dcf('0x11')](_0x9fc581):_0x9fc581);_0x5b5fc3[_0x6dcf('0x21')]();});}else{logger['info'](_0x6dcf('0x22'),_0x3f2d3d);_0x5b5fc3['next']();}};}; \ No newline at end of file +var _0xc3d6=['../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','urlOnAnswer','?params=','jsonrpc','method','login','push','params','stringify','utf8','POST','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise'];(function(_0x512075,_0x1aff90){var _0x4bd911=function(_0x582d){while(--_0x582d){_0x512075['push'](_0x512075['shift']());}};_0x4bd911(++_0x1aff90);}(_0xc3d6,0x65));var _0x6c3d=function(_0x51b654,_0x1d2c55){_0x51b654=_0x51b654-0x0;var _0x5e87e5=_0xc3d6[_0x51b654];return _0x5e87e5;};'use strict';var rp=require(_0x6c3d('0x0'));var logger=require(_0x6c3d('0x1'))(_0x6c3d('0x2'));var _=require(_0x6c3d('0x3'));var arr=[];exports[_0x6c3d('0x4')]=function(_0x4ec42d,_0x56353b){return function(_0x3bc7bb){var _0x203856=_0x56353b[0xa];var _0x136d80=_0x56353b[0xb];var _0x3c1ae3=_0x56353b[0xc];var _0x5be4a5=_0x56353b[0xd];var _0x4738d9=_0x56353b[0xe];var _0x456da6=_0x56353b[0xf][_0x6c3d('0x5')](/\n/g,_0x6c3d('0x6'));var _0x138f69=_0x56353b[0x10][_0x6c3d('0x5')](/\n/g,'\x20');if(!arr[_0x6c3d('0x7')](_0x136d80)){arr['push'](_0x136d80);var _0x444a0f=_0x56353b[0x3];var _0x5eb373=_0x56353b[0x4];var _0x37ad4c=_0x56353b[0x1];var _0x480063=_0x56353b[0x0];var _0x3c0072={};_0x3c0072[_0x6c3d('0x8')]=_0x56353b[0x8]+_0x6c3d('0x9')+_0x3c1ae3+'|'+_0x203856+'|'+_0x5be4a5+'|'+_0x136d80+'|'+_0x4738d9;_0x3c0072['urlOnRing']=_0x56353b[0x7]+_0x6c3d('0x9')+_0x3c1ae3+'|'+_0x203856+'|'+_0x5be4a5+'|'+_0x136d80+'|'+_0x4738d9+'|'+_0x456da6+'|'+_0x138f69;_0x3c0072['title']=_0x56353b[0x9];var _0x2fe275={};_0x2fe275[_0x6c3d('0xa')]='2.0';_0x2fe275[_0x6c3d('0xb')]=_0x6c3d('0xc');var _0x541816=[];_0x541816['push'](_0x56353b[0x2]);_0x541816[_0x6c3d('0xd')](_0x56353b[0x5]);_0x541816[_0x6c3d('0xd')](_0x56353b[0x6]);_0x2fe275[_0x6c3d('0xe')]=_0x541816;_0x2fe275['id']=0x1;var _0x56ae26=JSON[_0x6c3d('0xf')](_0x2fe275);var _0x45dc08={'encoding':_0x6c3d('0x10'),'method':_0x6c3d('0x11'),'timeout':0x2710,'url':_0x444a0f,'headers':{'Content-Type':'application/json-rpc'},'body':_0x56ae26};return rp(_0x45dc08)[_0x6c3d('0x12')](function(_0x91acc3){const _0x161182=JSON[_0x6c3d('0x13')](_0x91acc3);if(!_0x161182[_0x6c3d('0x14')][_0x6c3d('0x15')]){throw new Error(_0x6c3d('0x16'));}var _0x1d49a5=_0x136d80;var _0x3add15=_0x6c3d('0x17')+_0x37ad4c+_0x6c3d('0x18')+_0x480063+_0x6c3d('0x19')+_0x1d49a5+_0x6c3d('0x1a')+JSON[_0x6c3d('0xf')](_0x3c0072);var _0x538902=_0x5eb373+'?'+_0x3add15;return rp(_0x538902);})[_0x6c3d('0x12')](function(_0x1ace98){logger['info'](_0x6c3d('0x1b'),_0x4ec42d,_0x1ace98);_0x3bc7bb[_0x6c3d('0x1c')]();})[_0x6c3d('0x1d')](function(_0x55068a){logger['error'](_0x6c3d('0x1e'),_0x4ec42d,_[_0x6c3d('0x1f')](_0x55068a)?JSON['stringify'](_0x55068a):_0x55068a);_0x3bc7bb[_0x6c3d('0x1c')]();});}else{logger[_0x6c3d('0x20')](_0x6c3d('0x21'),_0x4ec42d);_0x3bc7bb['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 58983e3..09695d7 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x376d13,_0x3cf31e){var _0x1b657d=function(_0x363821){while(--_0x363821){_0x376d13['push'](_0x376d13['shift']());}};_0x1b657d(++_0x3cf31e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x43328e,_0xb9da9e){var _0x2b6ef7=function(_0x2eabf4){while(--_0x2eabf4){_0x43328e['push'](_0x43328e['shift']());}};_0x2b6ef7(++_0xb9da9e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index d4a6535..c8e9ee9 100644 --- a/server/services/routing/server/index.js +++ b/server/services/routing/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ad6=['message','interaction','checkWaitingNotifications','transfer','applications','length','existsSync','join','app','autoreply','appdata','split','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','body','%s:%s:%s','./interval','condition','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','.js','rules','execute','stringify','matchPath','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','find','chatQueues','name','paused','waiting','mailQueues','available','openchannelQueues','loggedIn','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','channel'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8ad6,0x123));var _0x68ad=function(_0x3e68b1,_0xae4439){_0x3e68b1=_0x3e68b1-0x0;var _0x174ae9=_0x8ad6[_0x3e68b1];return _0x174ae9;};'use strict';var _=require(_0x68ad('0x0'));var util=require(_0x68ad('0x1'));var path=require(_0x68ad('0x2'));var fs=require('fs');var jayson=require(_0x68ad('0x3'));var BPromise=require(_0x68ad('0x4'));var utils=require(_0x68ad('0x5'));var sUtils=require(_0x68ad('0x6'));var logger=require('../../../config/logger')(_0x68ad('0x7'));var rpc={'openchannelQueueReport':require(_0x68ad('0x8')),'mailQueueReport':require(_0x68ad('0x9')),'chatQueueReport':require(_0x68ad('0xa')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x68ad('0xb'))};var RuleEngine=require(_0x68ad('0xc'));function getId(_0x11a465,_0x4a57b1,_0x5de7d6){return util[_0x68ad('0xd')](_0x68ad('0xe'),_0x11a465,_0x4a57b1||0x0,_0x5de7d6||0x0);}function getIntervals(_0x2fd475,_0xc1612){var _0x3243fa=[];if(!_[_0x68ad('0xf')](_0xc1612['IntervalId'])&&!_[_0x68ad('0xf')](_0x2fd475[_0xc1612[_0x68ad('0x10')]])&&!_[_0x68ad('0xf')](_0x2fd475[_0xc1612[_0x68ad('0x10')]][_0x68ad('0x11')])){_0x3243fa=_[_0x68ad('0x12')](_0x2fd475[_0xc1612['IntervalId']][_0x68ad('0x11')],_0x68ad('0x13'));}else if(!_[_0x68ad('0xf')](_0xc1612[_0x68ad('0x13')])){_0x3243fa=[_0xc1612['interval']];}return _0x3243fa;}exports['listen']=function(_0x9061cf){_0x9061cf['rules']={};return new BPromise(function(_0x363dd7,_0x2fe7c4){var _0x2f6627={'Start':function(_0x319a1f){var _0x4fc1d9=this;return new Promise(function(_0x4c6f8e,_0x141790){if(_0x319a1f){try{var _0x478f31=[];var _0x348c78=getId(_0x319a1f[_0x68ad('0x14')],_0x319a1f[_0x68ad('0x15')]?_0x319a1f[_0x68ad('0x15')]['id']:0x0,_0x319a1f[_0x68ad('0x16')]?_0x319a1f[_0x68ad('0x16')]['id']:0x0);var _0x31ead4=sUtils[_0x68ad('0x17')](_0x9061cf,_0x319a1f);if(_0x319a1f[_0x68ad('0x18')]||!_0x31ead4&&_0x319a1f[_0x68ad('0x19')]&&_['isArray'](_0x319a1f[_0x68ad('0x19')])&&_0x319a1f['applications'][_0x68ad('0x1a')]){for(var _0xe62add=0x0;_0xe62add<_0x319a1f[_0x68ad('0x19')][_0x68ad('0x1a')];_0xe62add+=0x1){var _0xb8ec67=_0x319a1f[_0x68ad('0x19')][_0xe62add];if(fs[_0x68ad('0x1b')](path[_0x68ad('0x1c')](__dirname,_0x68ad('0x19'),_0xb8ec67[_0x68ad('0x1d')]+'.js'))){var _0x559f85=[];switch(_0xb8ec67[_0x68ad('0x1d')]['toLowerCase']()){case _0x68ad('0x1e'):var _0x22d84c=_0xb8ec67[_0x68ad('0x1f')][_0x68ad('0x20')](',');if(_0x319a1f[_0x68ad('0x14')]==='mail'){_0x559f85[_0x68ad('0x21')](_0x22d84c[0x0]);_0x559f85[_0x68ad('0x21')](_0x22d84c[0x1]);_0x559f85['push'](_0x22d84c[_0x68ad('0x22')](0x2,_0x22d84c[_0x68ad('0x1a')])['join'](','));}else{_0x559f85['push'](_0x22d84c[0x0]);_0x559f85['push'](_0x22d84c['slice'](0x1,_0x22d84c[_0x68ad('0x1a')])[_0x68ad('0x1c')](','));}break;case _0x68ad('0x23'):var _0x1ec695=_0xb8ec67[_0x68ad('0x1f')][_0x68ad('0x20')](',');_0x559f85[_0x68ad('0x21')](_0x1ec695[0x0]);_0x559f85['push'](_0x1ec695[0x1]);_0x559f85['push'](_0x1ec695[_0x68ad('0x22')](0x2,_0x1ec695[_0x68ad('0x1a')])[_0x68ad('0x1c')](','));break;case _0x68ad('0x24'):var _0x20b165=_0xb8ec67[_0x68ad('0x1f')][_0x68ad('0x20')](',');_0x559f85[_0x68ad('0x21')](_0x20b165[0x0]);_0x559f85[_0x68ad('0x21')](_0x20b165[0x1]);_0x559f85[_0x68ad('0x21')](_0x20b165[0x2]);_0x559f85[_0x68ad('0x21')](_0x20b165[0x3]);_0x559f85['push'](_0x20b165[_0x68ad('0x22')](0x4,_0x20b165[_0x68ad('0x1a')])[_0x68ad('0x1c')](','));break;case _0x68ad('0x25'):var _0x11b669=_0xb8ec67['appdata']['split'](',');_0x559f85['push'](_0x11b669[0x0]);_0x559f85[_0x68ad('0x21')](_0x11b669[0x1]);_0x559f85[_0x68ad('0x21')](_0x11b669[0x2]);_0x559f85['push'](_0x11b669[0x3]);_0x559f85[_0x68ad('0x21')](_0x11b669['slice'](0x4,_0x11b669[_0x68ad('0x1a')])[_0x68ad('0x1c')](','));break;case _0x68ad('0x15'):_0x559f85[_0x68ad('0x21')](_0xb8ec67['appdata']);break;case _0x68ad('0x26'):_0x559f85[_0x68ad('0x21')](_0xb8ec67[_0x68ad('0x27')]);_0x559f85[_0x68ad('0x21')](_0xb8ec67[_0x68ad('0x1f')]);break;case _0x68ad('0x28'):var _0x52ad05=utils[_0x68ad('0x29')](_0x319a1f[_0x68ad('0x2a')][_0x68ad('0x2b')],_0x319a1f);var _0x3d796f=_0xb8ec67['appdata'][_0x68ad('0x20')](',');_0x559f85[_0x68ad('0x21')](_0x3d796f[0x0]);_0x559f85[_0x68ad('0x21')](_0x3d796f[0x1]);_0x559f85[_0x68ad('0x21')](_0x3d796f[0x2]);_0x559f85[_0x68ad('0x21')](_0x3d796f[0x3]);_0x559f85[_0x68ad('0x21')](_0x3d796f[0x4]);_0x559f85[_0x68ad('0x21')](_0x3d796f[0x5]);_0x559f85[_0x68ad('0x21')](_0x3d796f[0x6]);_0x559f85[_0x68ad('0x21')](_0x3d796f[0x7]);_0x559f85[_0x68ad('0x21')](_0x3d796f[0x8]);_0x559f85[_0x68ad('0x21')](_0x3d796f[0x9]);_0x559f85[_0x68ad('0x21')](_0x3d796f[0xa]);_0x559f85[_0x68ad('0x21')](_0x319a1f[_0x68ad('0x16')]['id']);_0x559f85[_0x68ad('0x21')](_0x319a1f[_0x68ad('0x15')]['id']);_0x559f85[_0x68ad('0x21')](_0xb8ec67[_0x68ad('0x2c')]);_0x559f85[_0x68ad('0x21')](_0x319a1f[_0x68ad('0x16')]['ContactId']);_0x559f85[_0x68ad('0x21')](_0x319a1f[_0x68ad('0x2d')][_0x68ad('0x2d')]);_0x559f85[_0x68ad('0x21')](_0x52ad05);break;default:_0x559f85=_[_0x68ad('0xf')](_0xb8ec67[_0x68ad('0x1f')])?[]:_0xb8ec67[_0x68ad('0x1f')]['split'](',');}var _0x22b1e6={'id':util[_0x68ad('0xd')](_0x68ad('0x2e'),_0x348c78,_0xb8ec67['id'],_0xb8ec67[_0x68ad('0x1d')]),'condition':require(_0x68ad('0x2f'))[_0x68ad('0x30')](_0x348c78,getIntervals(_0x9061cf['intervals'],_0xb8ec67),_0x9061cf),'consequence':require(_0x68ad('0x31')+_0xb8ec67['app'])[_0x68ad('0x32')](_0x348c78,_0x559f85,_0x9061cf,_0x319a1f),'p':_0xb8ec67[_0x68ad('0x33')]||0x0};logger[_0x68ad('0x34')](_0x68ad('0x35'),_0x22b1e6['id'],_0x68ad('0x36'),getIntervals(_0x9061cf['intervals'],_0xb8ec67)['join'](_0x68ad('0x37')));_0x478f31[_0x68ad('0x21')](_0x22b1e6);}else{logger[_0x68ad('0x38')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x68ad('0x1c')](__dirname,'applications',_0xb8ec67['app']+_0x68ad('0x39')));}}_0x9061cf[_0x68ad('0x3a')][_0x348c78]=new RuleEngine(_0x478f31);_0x9061cf[_0x68ad('0x3a')][_0x348c78][_0x68ad('0x3b')](_0x319a1f,function(_0x251110){logger[_0x68ad('0x34')]('Applications\x20executed',JSON[_0x68ad('0x3c')](_0x251110[_0x68ad('0x3d')]));if(_0x9061cf[_0x68ad('0x3a')][_0x348c78]){_0x9061cf[_0x68ad('0x3a')][_0x348c78]['emit'](_0x68ad('0x3e'));}});return _0x4c6f8e({'code':0xc8,'message':_0x319a1f});}else{if(_0x31ead4){logger['info'](util[_0x68ad('0xd')](_0x68ad('0x3f'),_0x348c78));}else{logger[_0x68ad('0x34')](_0x68ad('0x40'));}return _0x4c6f8e({'code':0xc8,'message':_0x319a1f});}}catch(_0x33275a){logger[_0x68ad('0x38')](_0x33275a['stack']);return _0x141790(_0x4fc1d9['error'](0x1f4,_0x33275a));}}return _0x141790(_0x68ad('0x41'));});},'AcceptMessage':function(_0x101991){var _0x322129=this;return new Promise(function(_0x18d05c,_0x37c6c4){if(_0x101991[_0x68ad('0x42')]&&_0x101991[_0x68ad('0x42')]['id']){if(_0x9061cf[_0x68ad('0x43')][_0x101991[_0x68ad('0x42')]['id']]){_0x9061cf[_0x68ad('0x43')][_0x101991[_0x68ad('0x42')]['id']][_0x68ad('0x44')]=![];_0x9061cf['agents'][_0x101991[_0x68ad('0x42')]['id']][_0x68ad('0x45')]=undefined;}}if(_0x101991[_0x68ad('0x15')]&&_0x101991[_0x68ad('0x15')]['id']){try{var _0x2b1b99=getId(_0x101991[_0x68ad('0x14')],_0x101991[_0x68ad('0x15')]?_0x101991['message']['id']:0x0,_0x101991[_0x68ad('0x16')]?_0x101991['interaction']['id']:0x0);if(_0x9061cf['rules'][_0x2b1b99]){_0x9061cf[_0x68ad('0x3a')][_0x2b1b99][_0x68ad('0x46')](_0x68ad('0x47'));if(rpc[_0x101991[_0x68ad('0x14')]+_0x68ad('0x48')]){rpc[_0x101991['channel']+'QueueReport']['update'](_0x2b1b99,{'UserId':_0x101991['message'][_0x68ad('0x49')]})[_0x68ad('0x4a')](function(){logger[_0x68ad('0x38')](_0x68ad('0x4b'));});}}return _0x18d05c({'code':0xc8,'message':_0x101991});}catch(_0x8150fd){logger[_0x68ad('0x38')](_0x8150fd[_0x68ad('0x4c')]);return _0x37c6c4(_0x322129[_0x68ad('0x38')](0x1f4,_0x8150fd));}}logger[_0x68ad('0x38')](_0x68ad('0x4d'));return _0x37c6c4(_0x322129[_0x68ad('0x38')](0x1f4,_0x68ad('0x4d')));});},'RejectMessage':function(_0x2df888){var _0x35a7a6=this;return new Promise(function(_0x5f0c45,_0x319b18){if(_0x2df888[_0x68ad('0x42')]&&_0x2df888[_0x68ad('0x42')]['id']){try{if(_0x9061cf['agents'][_0x2df888[_0x68ad('0x42')]['id']]){_0x9061cf[_0x68ad('0x43')][_0x2df888[_0x68ad('0x42')]['id']][_0x68ad('0x44')]=![];_0x9061cf['agents'][_0x2df888['agent']['id']]['busyQueue']=undefined;}return _0x5f0c45({'code':0xc8,'message':_0x2df888});}catch(_0x5b62b5){logger[_0x68ad('0x38')](_0x5b62b5[_0x68ad('0x4c')]);return _0x319b18(_0x35a7a6['error'](0x1f4,_0x5b62b5));}}logger[_0x68ad('0x38')]('message\x20is\x20empty');return _0x319b18(_0x35a7a6[_0x68ad('0x38')](0x1f4,_0x68ad('0x4d')));});},'AbandonInteraction':function(_0xcc3801){var _0xd0858e=this;return new Promise(function(_0x4699f1,_0x2dd017){if(_0xcc3801[_0x68ad('0x14')]&&_0xcc3801[_0x68ad('0x16')]&&_0xcc3801['interaction']['id']){try{var _0x1cbd0a=getId(_0xcc3801[_0x68ad('0x14')],_0xcc3801[_0x68ad('0x15')]?_0xcc3801[_0x68ad('0x15')]['id']:0x0,_0xcc3801['interaction']?_0xcc3801[_0x68ad('0x16')]['id']:0x0);if(_0x9061cf[_0x68ad('0x3a')][_0x1cbd0a]){_0x9061cf[_0x68ad('0x3a')][_0x1cbd0a][_0x68ad('0x46')](_0x68ad('0x47'));}return _0x4699f1({'code':0xc8,'message':_0xcc3801});}catch(_0x9ae26){logger[_0x68ad('0x38')](_0x9ae26['stack']);return _0x2dd017(_0xd0858e[_0x68ad('0x38')](0x1f4,_0x9ae26));}}logger[_0x68ad('0x38')]('message\x20is\x20empty');return _0x2dd017(_0xd0858e[_0x68ad('0x38')](0x1f4,_0x68ad('0x4d')));});},'AgentCapacity':function(_0x34fc0e){var _0x3b8ae1=this;return new Promise(function(_0xd5232a,_0x2af0c2){if(_0x9061cf[_0x68ad('0x43')][_0x68ad('0x4e')](_0x34fc0e['id'])){for(var _0x9df9f1 in _0x34fc0e[_0x68ad('0x4f')]){if(_0x34fc0e['capacity'][_0x68ad('0x4e')](_0x9df9f1)){if(_0x9061cf[_0x68ad('0x43')][_0x34fc0e['id']]['hasOwnProperty'](_0x9df9f1+_0x68ad('0x50'))){_0x9061cf['agents'][_0x34fc0e['id']][_0x9df9f1+_0x68ad('0x50')]=parseInt(_0x34fc0e['capacity'][_0x9df9f1],0xa);}}}_0x9061cf[_0x68ad('0x43')][_0x34fc0e['id']][_0x68ad('0x51')]();return _0xd5232a({'code':0xc8,'message':_0x9061cf[_0x68ad('0x43')][_0x34fc0e['id']]});}else{return _0x2af0c2(_0x3b8ae1[_0x68ad('0x38')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x2798fd){return new Promise(function(_0x48bc6c){var _0x2e18dd=_['values'](_0x9061cf[_0x68ad('0x43')]);if(_0x2798fd&&_0x2798fd['id']){var _0x5c3e3c=_[_0x68ad('0x52')](_0x2e18dd,function(_0x1d8369){return _0x1d8369['id']===_0x2798fd['id'];});_0x48bc6c(_0x5c3e3c);}else{_0x48bc6c({'count':_0x2e18dd[_0x68ad('0x1a')],'rows':_0x2e18dd});}});},'ChatQueues':function(){return new Promise(function(_0x511fcd){var _0xdcb78a=[];for(var _0x370522 in _0x9061cf['chatQueues']){if(_0x9061cf[_0x68ad('0x53')]['hasOwnProperty'](_0x370522)){var _0x4fc60c=_0x9061cf[_0x68ad('0x53')][_0x370522];var _0x59dc8c={'id':_0x4fc60c['id'],'available':_0x4fc60c['available'],'loggedIn':_0x4fc60c['loggedIn'],'name':_0x4fc60c[_0x68ad('0x54')],'paused':_0x4fc60c[_0x68ad('0x55')],'waiting':_0x4fc60c[_0x68ad('0x56')]};_0xdcb78a[_0x68ad('0x21')](_0x59dc8c);}}_0x511fcd({'count':_0xdcb78a[_0x68ad('0x1a')],'rows':_0xdcb78a});});},'MailQueues':function(){return new Promise(function(_0x4f8d29){var _0x2fdd2f=[];for(var _0x44c627 in _0x9061cf[_0x68ad('0x57')]){if(_0x9061cf[_0x68ad('0x57')][_0x68ad('0x4e')](_0x44c627)){var _0x281df5=_0x9061cf[_0x68ad('0x57')][_0x44c627];var _0x554444={'id':_0x281df5['id'],'available':_0x281df5[_0x68ad('0x58')],'loggedIn':_0x281df5['loggedIn'],'name':_0x281df5[_0x68ad('0x54')],'paused':_0x281df5[_0x68ad('0x55')],'waiting':_0x281df5[_0x68ad('0x56')]};_0x2fdd2f['push'](_0x554444);}}_0x4f8d29({'count':_0x2fdd2f[_0x68ad('0x1a')],'rows':_0x2fdd2f});});},'OpenchannelQueues':function(){return new Promise(function(_0x1bde13){var _0x1a72fd=[];for(var _0x133eed in _0x9061cf[_0x68ad('0x59')]){if(_0x9061cf['openchannelQueues']['hasOwnProperty'](_0x133eed)){var _0x4c7c90=_0x9061cf['openchannelQueues'][_0x133eed];var _0x256156={'id':_0x4c7c90['id'],'available':_0x4c7c90[_0x68ad('0x58')],'loggedIn':_0x4c7c90[_0x68ad('0x5a')],'name':_0x4c7c90[_0x68ad('0x54')],'paused':_0x4c7c90[_0x68ad('0x55')],'waiting':_0x4c7c90[_0x68ad('0x56')]};_0x1a72fd[_0x68ad('0x21')](_0x256156);}}_0x1bde13({'count':_0x1a72fd['length'],'rows':_0x1a72fd});});},'SmsQueues':function(){return new Promise(function(_0x4f3ed7){var _0x52de1d=[];for(var _0x67d518 in _0x9061cf[_0x68ad('0x5b')]){if(_0x9061cf[_0x68ad('0x5b')][_0x68ad('0x4e')](_0x67d518)){var _0x4f88d3=_0x9061cf['smsQueues'][_0x67d518];var _0x3c7c51={'id':_0x4f88d3['id'],'available':_0x4f88d3[_0x68ad('0x58')],'loggedIn':_0x4f88d3[_0x68ad('0x5a')],'name':_0x4f88d3[_0x68ad('0x54')],'paused':_0x4f88d3[_0x68ad('0x55')],'waiting':_0x4f88d3[_0x68ad('0x56')]};_0x52de1d[_0x68ad('0x21')](_0x3c7c51);}}_0x4f3ed7({'count':_0x52de1d[_0x68ad('0x1a')],'rows':_0x52de1d});});},'FaxQueues':function(){return new Promise(function(_0x13ebdf){var _0x1ce2e2=[];for(var _0x100a2f in _0x9061cf[_0x68ad('0x5c')]){if(_0x9061cf[_0x68ad('0x5c')]['hasOwnProperty'](_0x100a2f)){var _0x169523=_0x9061cf[_0x68ad('0x5c')][_0x100a2f];var _0x292fb8={'id':_0x169523['id'],'available':_0x169523[_0x68ad('0x58')],'loggedIn':_0x169523[_0x68ad('0x5a')],'name':_0x169523['name'],'paused':_0x169523[_0x68ad('0x55')],'waiting':_0x169523[_0x68ad('0x56')]};_0x1ce2e2['push'](_0x292fb8);}}_0x13ebdf({'count':_0x1ce2e2[_0x68ad('0x1a')],'rows':_0x1ce2e2});});},'WhatsappQueues':function(){return new Promise(function(_0x3724b7){var _0x54f230=[];for(var _0x16af6a in _0x9061cf[_0x68ad('0x5d')]){if(_0x9061cf['whatsappQueues'][_0x68ad('0x4e')](_0x16af6a)){var _0x3c0c11=_0x9061cf[_0x68ad('0x5d')][_0x16af6a];var _0x40235a={'id':_0x3c0c11['id'],'available':_0x3c0c11[_0x68ad('0x58')],'loggedIn':_0x3c0c11[_0x68ad('0x5a')],'name':_0x3c0c11[_0x68ad('0x54')],'paused':_0x3c0c11[_0x68ad('0x55')],'waiting':_0x3c0c11[_0x68ad('0x56')]};_0x54f230[_0x68ad('0x21')](_0x40235a);}}_0x3724b7({'count':_0x54f230[_0x68ad('0x1a')],'rows':_0x54f230});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x27e3c1){var _0x5c9db3=_[_0x68ad('0x5e')](_0x9061cf[_0x68ad('0x5f')]);_0x27e3c1({'count':_0x5c9db3[_0x68ad('0x1a')],'rows':_0x5c9db3});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x2a06c4){var _0x48872d=_[_0x68ad('0x5e')](_0x9061cf[_0x68ad('0x60')]);_0x2a06c4({'count':_0x48872d[_0x68ad('0x1a')],'rows':_0x48872d});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x468e77){var _0x216e13=_['values'](_0x9061cf[_0x68ad('0x61')]);_0x468e77({'count':_0x216e13[_0x68ad('0x1a')],'rows':_0x216e13});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x1ecab6){var _0xbf3ced=_[_0x68ad('0x5e')](_0x9061cf[_0x68ad('0x62')]);_0x1ecab6({'count':_0xbf3ced['length'],'rows':_0xbf3ced});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x443d8a){var _0x58268a=_[_0x68ad('0x5e')](_0x9061cf['faxQueuesWaitingInteractions']);_0x443d8a({'count':_0x58268a[_0x68ad('0x1a')],'rows':_0x58268a});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x50fde6){var _0x5c0ec4=_['values'](_0x9061cf[_0x68ad('0x63')]);_0x50fde6({'count':_0x5c0ec4[_0x68ad('0x1a')],'rows':_0x5c0ec4});});}};var _0x253933=jayson[_0x68ad('0x64')](_0x2f6627)[_0x68ad('0x65')]();_0x253933['on'](_0x68ad('0x38'),function(_0x1f892e){logger['error'](JSON[_0x68ad('0x3c')](_0x1f892e));return _0x2fe7c4(_0x1f892e);});_0x253933['listen'](0x232c,_0x68ad('0x66'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x363dd7(_0x68ad('0x67')+0x232c);});});}; \ No newline at end of file +var _0x032e=['Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','update','catch','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','available','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','path','jayson/promise','bluebird','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','Intervals','IntervalId','interval','listen','rules','message','interaction','checkWaitingNotifications','transfer','applications','isArray','length','existsSync','join','app','.js','autoreply','appdata','split','channel','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','tvox','account','notificationTemplate','ChatWebsiteId','ContactId','body','condition','consequence','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under'];(function(_0x50906,_0x42f1a4){var _0x31ca7c=function(_0x134869){while(--_0x134869){_0x50906['push'](_0x50906['shift']());}};_0x31ca7c(++_0x42f1a4);}(_0x032e,0x1cc));var _0xe032=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x032e[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0xe032('0x0'));var path=require(_0xe032('0x1'));var fs=require('fs');var jayson=require(_0xe032('0x2'));var BPromise=require(_0xe032('0x3'));var utils=require(_0xe032('0x4'));var sUtils=require('./applications/strategy/util');var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var rpc={'openchannelQueueReport':require(_0xe032('0x7')),'mailQueueReport':require(_0xe032('0x8')),'chatQueueReport':require(_0xe032('0x9')),'smsQueueReport':require(_0xe032('0xa')),'faxQueueReport':require(_0xe032('0xb')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0xe032('0xc'));function getId(_0x104936,_0x265677,_0xa36fe0){return util[_0xe032('0xd')](_0xe032('0xe'),_0x104936,_0x265677||0x0,_0xa36fe0||0x0);}function getIntervals(_0x565295,_0x359454){var _0xfcdc67=[];if(!_[_0xe032('0xf')](_0x359454['IntervalId'])&&!_[_0xe032('0xf')](_0x565295[_0x359454['IntervalId']])&&!_['isNil'](_0x565295[_0x359454['IntervalId']][_0xe032('0x10')])){_0xfcdc67=_['map'](_0x565295[_0x359454[_0xe032('0x11')]]['Intervals'],_0xe032('0x12'));}else if(!_[_0xe032('0xf')](_0x359454[_0xe032('0x12')])){_0xfcdc67=[_0x359454[_0xe032('0x12')]];}return _0xfcdc67;}exports[_0xe032('0x13')]=function(_0x140e56){_0x140e56[_0xe032('0x14')]={};return new BPromise(function(_0x1cc0bb,_0x1bf9e3){var _0xec005={'Start':function(_0x23883c){var _0x16a36e=this;return new Promise(function(_0x3f3010,_0x40a175){if(_0x23883c){try{var _0x2dc16f=[];var _0x2e868b=getId(_0x23883c['channel'],_0x23883c['message']?_0x23883c[_0xe032('0x15')]['id']:0x0,_0x23883c['interaction']?_0x23883c[_0xe032('0x16')]['id']:0x0);var _0x3e0d8c=sUtils[_0xe032('0x17')](_0x140e56,_0x23883c);if(_0x23883c[_0xe032('0x18')]||!_0x3e0d8c&&_0x23883c[_0xe032('0x19')]&&_[_0xe032('0x1a')](_0x23883c[_0xe032('0x19')])&&_0x23883c[_0xe032('0x19')][_0xe032('0x1b')]){for(var _0x4db18c=0x0;_0x4db18c<_0x23883c[_0xe032('0x19')][_0xe032('0x1b')];_0x4db18c+=0x1){var _0x35093e=_0x23883c[_0xe032('0x19')][_0x4db18c];if(fs[_0xe032('0x1c')](path[_0xe032('0x1d')](__dirname,_0xe032('0x19'),_0x35093e[_0xe032('0x1e')]+_0xe032('0x1f')))){var _0x5e37f9=[];switch(_0x35093e[_0xe032('0x1e')]['toLowerCase']()){case _0xe032('0x20'):var _0x2b3544=_0x35093e[_0xe032('0x21')][_0xe032('0x22')](',');if(_0x23883c[_0xe032('0x23')]===_0xe032('0x24')){_0x5e37f9[_0xe032('0x25')](_0x2b3544[0x0]);_0x5e37f9[_0xe032('0x25')](_0x2b3544[0x1]);_0x5e37f9['push'](_0x2b3544['slice'](0x2,_0x2b3544[_0xe032('0x1b')])[_0xe032('0x1d')](','));}else{_0x5e37f9[_0xe032('0x25')](_0x2b3544[0x0]);_0x5e37f9[_0xe032('0x25')](_0x2b3544[_0xe032('0x26')](0x1,_0x2b3544['length'])[_0xe032('0x1d')](','));}break;case _0xe032('0x27'):var _0x282ec0=_0x35093e['appdata'][_0xe032('0x22')](',');_0x5e37f9['push'](_0x282ec0[0x0]);_0x5e37f9[_0xe032('0x25')](_0x282ec0[0x1]);_0x5e37f9[_0xe032('0x25')](_0x282ec0[_0xe032('0x26')](0x2,_0x282ec0[_0xe032('0x1b')])['join'](','));break;case _0xe032('0x28'):var _0x4bdaad=_0x35093e['appdata']['split'](',');_0x5e37f9['push'](_0x4bdaad[0x0]);_0x5e37f9['push'](_0x4bdaad[0x1]);_0x5e37f9[_0xe032('0x25')](_0x4bdaad[0x2]);_0x5e37f9[_0xe032('0x25')](_0x4bdaad[0x3]);_0x5e37f9[_0xe032('0x25')](_0x4bdaad['slice'](0x4,_0x4bdaad['length'])[_0xe032('0x1d')](','));break;case _0xe032('0x29'):var _0x2f237e=_0x35093e[_0xe032('0x21')][_0xe032('0x22')](',');_0x5e37f9[_0xe032('0x25')](_0x2f237e[0x0]);_0x5e37f9[_0xe032('0x25')](_0x2f237e[0x1]);_0x5e37f9[_0xe032('0x25')](_0x2f237e[0x2]);_0x5e37f9[_0xe032('0x25')](_0x2f237e[0x3]);_0x5e37f9['push'](_0x2f237e['slice'](0x4,_0x2f237e[_0xe032('0x1b')])[_0xe032('0x1d')](','));break;case'message':_0x5e37f9[_0xe032('0x25')](_0x35093e[_0xe032('0x21')]);break;case _0xe032('0x2a'):_0x5e37f9[_0xe032('0x25')](_0x35093e[_0xe032('0x2b')]);_0x5e37f9[_0xe032('0x25')](_0x35093e[_0xe032('0x21')]);break;case _0xe032('0x2c'):var _0x261c78=utils['getMustacheRender'](_0x23883c[_0xe032('0x2d')][_0xe032('0x2e')],_0x23883c);var _0x3cd5a0=_0x35093e[_0xe032('0x21')][_0xe032('0x22')](',');_0x5e37f9[_0xe032('0x25')](_0x3cd5a0[0x0]);_0x5e37f9[_0xe032('0x25')](_0x3cd5a0[0x1]);_0x5e37f9[_0xe032('0x25')](_0x3cd5a0[0x2]);_0x5e37f9['push'](_0x3cd5a0[0x3]);_0x5e37f9['push'](_0x3cd5a0[0x4]);_0x5e37f9[_0xe032('0x25')](_0x3cd5a0[0x5]);_0x5e37f9[_0xe032('0x25')](_0x3cd5a0[0x6]);_0x5e37f9[_0xe032('0x25')](_0x3cd5a0[0x7]);_0x5e37f9[_0xe032('0x25')](_0x3cd5a0[0x8]);_0x5e37f9['push'](_0x3cd5a0[0x9]);_0x5e37f9[_0xe032('0x25')](_0x3cd5a0[0xa]);_0x5e37f9[_0xe032('0x25')](_0x23883c[_0xe032('0x16')]['id']);_0x5e37f9[_0xe032('0x25')](_0x23883c[_0xe032('0x15')]['id']);_0x5e37f9[_0xe032('0x25')](_0x35093e[_0xe032('0x2f')]);_0x5e37f9[_0xe032('0x25')](_0x23883c['interaction'][_0xe032('0x30')]);_0x5e37f9['push'](_0x23883c[_0xe032('0x31')][_0xe032('0x31')]);_0x5e37f9[_0xe032('0x25')](_0x261c78);break;default:_0x5e37f9=_[_0xe032('0xf')](_0x35093e[_0xe032('0x21')])?[]:_0x35093e[_0xe032('0x21')]['split'](',');}var _0x3e50bf={'id':util['format']('%s:%s:%s',_0x2e868b,_0x35093e['id'],_0x35093e[_0xe032('0x1e')]),'condition':require('./interval')[_0xe032('0x32')](_0x2e868b,getIntervals(_0x140e56['intervals'],_0x35093e),_0x140e56),'consequence':require('./applications/'+_0x35093e['app'])[_0xe032('0x33')](_0x2e868b,_0x5e37f9,_0x140e56,_0x23883c),'p':_0x35093e[_0xe032('0x34')]||0x0};logger[_0xe032('0x35')](_0xe032('0x36'),_0x3e50bf['id'],_0xe032('0x37'),getIntervals(_0x140e56[_0xe032('0x38')],_0x35093e)[_0xe032('0x1d')](_0xe032('0x39')));_0x2dc16f[_0xe032('0x25')](_0x3e50bf);}else{logger[_0xe032('0x3a')](_0xe032('0x3b'),path[_0xe032('0x1d')](__dirname,_0xe032('0x19'),_0x35093e[_0xe032('0x1e')]+_0xe032('0x1f')));}}_0x140e56[_0xe032('0x14')][_0x2e868b]=new RuleEngine(_0x2dc16f);_0x140e56['rules'][_0x2e868b]['execute'](_0x23883c,function(_0x311647){logger[_0xe032('0x35')](_0xe032('0x3c'),JSON[_0xe032('0x3d')](_0x311647[_0xe032('0x3e')]));if(_0x140e56[_0xe032('0x14')][_0x2e868b]){_0x140e56['rules'][_0x2e868b][_0xe032('0x3f')](_0xe032('0x40'));}});return _0x3f3010({'code':0xc8,'message':_0x23883c});}else{if(_0x3e0d8c){logger[_0xe032('0x35')](util[_0xe032('0xd')](_0xe032('0x41'),_0x2e868b));}else{logger[_0xe032('0x35')](_0xe032('0x42'));}return _0x3f3010({'code':0xc8,'message':_0x23883c});}}catch(_0x67f1d7){logger['error'](_0x67f1d7['stack']);return _0x40a175(_0x16a36e['error'](0x1f4,_0x67f1d7));}}return _0x40a175(_0xe032('0x43'));});},'AcceptMessage':function(_0x56015b){var _0x1f3ad4=this;return new Promise(function(_0x43972a,_0x44a23d){if(_0x56015b[_0xe032('0x44')]&&_0x56015b[_0xe032('0x44')]['id']){if(_0x140e56[_0xe032('0x45')][_0x56015b['agent']['id']]){_0x140e56[_0xe032('0x45')][_0x56015b[_0xe032('0x44')]['id']][_0xe032('0x46')]=![];_0x140e56[_0xe032('0x45')][_0x56015b[_0xe032('0x44')]['id']]['busyQueue']=undefined;}}if(_0x56015b['message']&&_0x56015b[_0xe032('0x15')]['id']){try{var _0x28e919=getId(_0x56015b[_0xe032('0x23')],_0x56015b[_0xe032('0x15')]?_0x56015b[_0xe032('0x15')]['id']:0x0,_0x56015b[_0xe032('0x16')]?_0x56015b[_0xe032('0x16')]['id']:0x0);if(_0x140e56[_0xe032('0x14')][_0x28e919]){_0x140e56[_0xe032('0x14')][_0x28e919]['emit'](_0xe032('0x47'));if(rpc[_0x56015b['channel']+'QueueReport']){rpc[_0x56015b['channel']+_0xe032('0x48')][_0xe032('0x49')](_0x28e919,{'UserId':_0x56015b[_0xe032('0x15')]['UserId']})[_0xe032('0x4a')](function(){logger['error']('error\x20update\x20queue\x20report');});}}return _0x43972a({'code':0xc8,'message':_0x56015b});}catch(_0x5e1052){logger['error'](_0x5e1052[_0xe032('0x4b')]);return _0x44a23d(_0x1f3ad4[_0xe032('0x3a')](0x1f4,_0x5e1052));}}logger[_0xe032('0x3a')]('message\x20is\x20empty');return _0x44a23d(_0x1f3ad4[_0xe032('0x3a')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x2701f2){var _0x3b5945=this;return new Promise(function(_0x56edac,_0x4de127){if(_0x2701f2[_0xe032('0x44')]&&_0x2701f2[_0xe032('0x44')]['id']){try{if(_0x140e56[_0xe032('0x45')][_0x2701f2[_0xe032('0x44')]['id']]){_0x140e56['agents'][_0x2701f2[_0xe032('0x44')]['id']][_0xe032('0x46')]=![];_0x140e56[_0xe032('0x45')][_0x2701f2[_0xe032('0x44')]['id']]['busyQueue']=undefined;}return _0x56edac({'code':0xc8,'message':_0x2701f2});}catch(_0x9d3299){logger[_0xe032('0x3a')](_0x9d3299[_0xe032('0x4b')]);return _0x4de127(_0x3b5945[_0xe032('0x3a')](0x1f4,_0x9d3299));}}logger['error']('message\x20is\x20empty');return _0x4de127(_0x3b5945['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x17df9b){var _0x1b0e08=this;return new Promise(function(_0x4debdf,_0xc391d1){if(_0x17df9b['channel']&&_0x17df9b[_0xe032('0x16')]&&_0x17df9b[_0xe032('0x16')]['id']){try{var _0x378ca8=getId(_0x17df9b[_0xe032('0x23')],_0x17df9b[_0xe032('0x15')]?_0x17df9b['message']['id']:0x0,_0x17df9b[_0xe032('0x16')]?_0x17df9b[_0xe032('0x16')]['id']:0x0);if(_0x140e56[_0xe032('0x14')][_0x378ca8]){_0x140e56[_0xe032('0x14')][_0x378ca8][_0xe032('0x3f')](_0xe032('0x47'));}return _0x4debdf({'code':0xc8,'message':_0x17df9b});}catch(_0x12f844){logger[_0xe032('0x3a')](_0x12f844[_0xe032('0x4b')]);return _0xc391d1(_0x1b0e08[_0xe032('0x3a')](0x1f4,_0x12f844));}}logger[_0xe032('0x3a')](_0xe032('0x4c'));return _0xc391d1(_0x1b0e08['error'](0x1f4,_0xe032('0x4c')));});},'AgentCapacity':function(_0x36deae){var _0x434c8c=this;return new Promise(function(_0x6a0171,_0x9fae21){if(_0x140e56[_0xe032('0x45')][_0xe032('0x4d')](_0x36deae['id'])){for(var _0x527d93 in _0x36deae['capacity']){if(_0x36deae[_0xe032('0x4e')][_0xe032('0x4d')](_0x527d93)){if(_0x140e56[_0xe032('0x45')][_0x36deae['id']]['hasOwnProperty'](_0x527d93+_0xe032('0x4f'))){_0x140e56[_0xe032('0x45')][_0x36deae['id']][_0x527d93+_0xe032('0x4f')]=parseInt(_0x36deae['capacity'][_0x527d93],0xa);}}}_0x140e56[_0xe032('0x45')][_0x36deae['id']][_0xe032('0x50')]();return _0x6a0171({'code':0xc8,'message':_0x140e56['agents'][_0x36deae['id']]});}else{return _0x9fae21(_0x434c8c['error'](0x1f4,_0xe032('0x51')));}});},'Agents':function(_0x498642){return new Promise(function(_0x516e66){var _0x459f07=_['values'](_0x140e56['agents']);if(_0x498642&&_0x498642['id']){var _0x21d431=_[_0xe032('0x52')](_0x459f07,function(_0x4a8bcc){return _0x4a8bcc['id']===_0x498642['id'];});_0x516e66(_0x21d431);}else{_0x516e66({'count':_0x459f07['length'],'rows':_0x459f07});}});},'ChatQueues':function(){return new Promise(function(_0x1a22d4){var _0x2ce058=[];for(var _0x41227a in _0x140e56[_0xe032('0x53')]){if(_0x140e56['chatQueues']['hasOwnProperty'](_0x41227a)){var _0x197e5a=_0x140e56[_0xe032('0x53')][_0x41227a];var _0x2184b9={'id':_0x197e5a['id'],'available':_0x197e5a['available'],'loggedIn':_0x197e5a[_0xe032('0x54')],'name':_0x197e5a[_0xe032('0x55')],'paused':_0x197e5a[_0xe032('0x56')],'waiting':_0x197e5a[_0xe032('0x57')]};_0x2ce058['push'](_0x2184b9);}}_0x1a22d4({'count':_0x2ce058[_0xe032('0x1b')],'rows':_0x2ce058});});},'MailQueues':function(){return new Promise(function(_0x13ec26){var _0x2a737d=[];for(var _0x33d606 in _0x140e56[_0xe032('0x58')]){if(_0x140e56[_0xe032('0x58')][_0xe032('0x4d')](_0x33d606)){var _0x13ba81=_0x140e56['mailQueues'][_0x33d606];var _0x635978={'id':_0x13ba81['id'],'available':_0x13ba81['available'],'loggedIn':_0x13ba81[_0xe032('0x54')],'name':_0x13ba81[_0xe032('0x55')],'paused':_0x13ba81[_0xe032('0x56')],'waiting':_0x13ba81[_0xe032('0x57')]};_0x2a737d[_0xe032('0x25')](_0x635978);}}_0x13ec26({'count':_0x2a737d['length'],'rows':_0x2a737d});});},'OpenchannelQueues':function(){return new Promise(function(_0x3f5b11){var _0xb3d8d2=[];for(var _0x110e5e in _0x140e56[_0xe032('0x59')]){if(_0x140e56[_0xe032('0x59')][_0xe032('0x4d')](_0x110e5e)){var _0x140d43=_0x140e56[_0xe032('0x59')][_0x110e5e];var _0x39aa1a={'id':_0x140d43['id'],'available':_0x140d43['available'],'loggedIn':_0x140d43[_0xe032('0x54')],'name':_0x140d43[_0xe032('0x55')],'paused':_0x140d43[_0xe032('0x56')],'waiting':_0x140d43[_0xe032('0x57')]};_0xb3d8d2['push'](_0x39aa1a);}}_0x3f5b11({'count':_0xb3d8d2['length'],'rows':_0xb3d8d2});});},'SmsQueues':function(){return new Promise(function(_0xc94fab){var _0x49cfa8=[];for(var _0x8ede61 in _0x140e56[_0xe032('0x5a')]){if(_0x140e56[_0xe032('0x5a')][_0xe032('0x4d')](_0x8ede61)){var _0x44c82f=_0x140e56[_0xe032('0x5a')][_0x8ede61];var _0xcb80c={'id':_0x44c82f['id'],'available':_0x44c82f[_0xe032('0x5b')],'loggedIn':_0x44c82f[_0xe032('0x54')],'name':_0x44c82f[_0xe032('0x55')],'paused':_0x44c82f['paused'],'waiting':_0x44c82f[_0xe032('0x57')]};_0x49cfa8[_0xe032('0x25')](_0xcb80c);}}_0xc94fab({'count':_0x49cfa8['length'],'rows':_0x49cfa8});});},'FaxQueues':function(){return new Promise(function(_0x2cb105){var _0x11498d=[];for(var _0x380999 in _0x140e56[_0xe032('0x5c')]){if(_0x140e56['faxQueues'][_0xe032('0x4d')](_0x380999)){var _0x3cb1d9=_0x140e56[_0xe032('0x5c')][_0x380999];var _0x24cbeb={'id':_0x3cb1d9['id'],'available':_0x3cb1d9[_0xe032('0x5b')],'loggedIn':_0x3cb1d9['loggedIn'],'name':_0x3cb1d9[_0xe032('0x55')],'paused':_0x3cb1d9[_0xe032('0x56')],'waiting':_0x3cb1d9[_0xe032('0x57')]};_0x11498d['push'](_0x24cbeb);}}_0x2cb105({'count':_0x11498d[_0xe032('0x1b')],'rows':_0x11498d});});},'WhatsappQueues':function(){return new Promise(function(_0x16a342){var _0x1f6550=[];for(var _0x4eb288 in _0x140e56[_0xe032('0x5d')]){if(_0x140e56[_0xe032('0x5d')][_0xe032('0x4d')](_0x4eb288)){var _0x543cd1=_0x140e56['whatsappQueues'][_0x4eb288];var _0x46563e={'id':_0x543cd1['id'],'available':_0x543cd1[_0xe032('0x5b')],'loggedIn':_0x543cd1['loggedIn'],'name':_0x543cd1[_0xe032('0x55')],'paused':_0x543cd1[_0xe032('0x56')],'waiting':_0x543cd1[_0xe032('0x57')]};_0x1f6550[_0xe032('0x25')](_0x46563e);}}_0x16a342({'count':_0x1f6550['length'],'rows':_0x1f6550});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x301b88){var _0x5aa80b=_[_0xe032('0x5e')](_0x140e56[_0xe032('0x5f')]);_0x301b88({'count':_0x5aa80b[_0xe032('0x1b')],'rows':_0x5aa80b});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x3f5846){var _0x325df9=_[_0xe032('0x5e')](_0x140e56[_0xe032('0x60')]);_0x3f5846({'count':_0x325df9[_0xe032('0x1b')],'rows':_0x325df9});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xda7f8c){var _0x13c282=_[_0xe032('0x5e')](_0x140e56['openchannelQueuesWaitingInteractions']);_0xda7f8c({'count':_0x13c282[_0xe032('0x1b')],'rows':_0x13c282});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x89d2f1){var _0x117323=_[_0xe032('0x5e')](_0x140e56[_0xe032('0x61')]);_0x89d2f1({'count':_0x117323[_0xe032('0x1b')],'rows':_0x117323});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x47e2cb){var _0x430df0=_[_0xe032('0x5e')](_0x140e56[_0xe032('0x62')]);_0x47e2cb({'count':_0x430df0[_0xe032('0x1b')],'rows':_0x430df0});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x18b762){var _0x2a0019=_['values'](_0x140e56[_0xe032('0x63')]);_0x18b762({'count':_0x2a0019['length'],'rows':_0x2a0019});});}};var _0x1076b9=jayson[_0xe032('0x64')](_0xec005)[_0xe032('0x65')]();_0x1076b9['on'](_0xe032('0x3a'),function(_0x4e44c7){logger[_0xe032('0x3a')](JSON[_0xe032('0x3d')](_0x4e44c7));return _0x1bf9e3(_0x4e44c7);});_0x1076b9[_0xe032('0x13')](0x232c,_0xe032('0x66'),function(){console['log'](_0xe032('0x67'),0x232c);return _0x1cc0bb('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index c1d0b9e..5e85688 100644 --- a/server/services/routing/server/interval.js +++ b/server/services/routing/server/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39cc=['some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','../../../utils/iftime','routing','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','map'];(function(_0x2e2670,_0x1a1067){var _0x4416dc=function(_0x4e7e5e){while(--_0x4e7e5e){_0x2e2670['push'](_0x2e2670['shift']());}};_0x4416dc(++_0x1a1067);}(_0x39cc,0x156));var _0xc39c=function(_0x4b6106,_0x548c95){_0x4b6106=_0x4b6106-0x0;var _0x193c69=_0x39cc[_0x4b6106];return _0x193c69;};'use strict';var _=require('lodash');var iftime=require(_0xc39c('0x0'))['iftime'];var logger=require('../../../config/logger')(_0xc39c('0x1'));exports[_0xc39c('0x2')]=function(_0x29078b,_0x46cffa,_0x4e76d7){return function(_0x588bb9){if(_0x4e76d7[_0xc39c('0x3')]&&!_0x4e76d7[_0xc39c('0x3')][_0x29078b]){logger[_0xc39c('0x4')](_0xc39c('0x5'),_0x29078b);return _0x588bb9[_0xc39c('0x6')]();}var _0x58aaf5=_0x46cffa[_0xc39c('0x7')](function(_0x28c13b){return iftime(_0x28c13b);});var _0x458ba8=_[_0xc39c('0x8')](_0x58aaf5);if(_0x458ba8){logger[_0xc39c('0x4')](_0xc39c('0x9'),_0x29078b,_0x46cffa[_0xc39c('0xa')](_0xc39c('0xb')),_0x458ba8);_0x588bb9[_0xc39c('0xc')](_0x458ba8);}else{logger['info'](_0xc39c('0xd'),_0x29078b,_0x46cffa[_0xc39c('0xa')](_0xc39c('0xb')));_0x588bb9[_0xc39c('0x6')]();}};}; \ No newline at end of file +var _0xc311=['[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','when','\x20|\x20','stack','bluebird','jayson/promise','../../../config/logger','routing','client','http','request','error','result','catch','rules','info','stop','push','format','iftime\x20%s','then','message','true'];(function(_0x3efe3f,_0x53804c){var _0x476942=function(_0x238b64){while(--_0x238b64){_0x3efe3f['push'](_0x3efe3f['shift']());}};_0x476942(++_0x53804c);}(_0xc311,0xe0));var _0x1c31=function(_0x8be0a2,_0x512357){_0x8be0a2=_0x8be0a2-0x0;var _0x1c4eff=_0xc311[_0x8be0a2];return _0x1c4eff;};'use strict';var util=require('util');var BPromise=require(_0x1c31('0x0'));var jayson=require(_0x1c31('0x1'));var _=require('lodash');var logger=require(_0x1c31('0x2'))(_0x1c31('0x3'));var client=jayson[_0x1c31('0x4')][_0x1c31('0x5')]({'port':0x232a});function request(_0x222ade,_0x5dc1b8){return new BPromise(function(_0x5cc51e,_0x5df405){return client[_0x1c31('0x6')](_0x222ade,_0x5dc1b8)['then'](function(_0x33ac62){if(_0x33ac62[_0x1c31('0x7')]){return _0x5df405(_0x33ac62[_0x1c31('0x7')]['message']);}else{return _0x5cc51e(_0x33ac62[_0x1c31('0x8')]);}})[_0x1c31('0x9')](function(_0x4a87ea){return _0x5df405(_0x4a87ea);});});}exports['condition']=function(_0x531ee0,_0x368911,_0x241509){return function(_0x5220c8){if(_0x241509[_0x1c31('0xa')]&&!_0x241509['rules'][_0x531ee0]){logger[_0x1c31('0xb')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x531ee0);return _0x5220c8[_0x1c31('0xc')]();}var _0x2ec945=[];for(var _0xf0ea51=0x0;_0xf0ea51<_0x368911['length'];_0xf0ea51+=0x1){_0x2ec945[_0x1c31('0xd')](request('Command',{'command':util[_0x1c31('0xe')](_0x1c31('0xf'),_0x368911[_0xf0ea51])})[_0x1c31('0x10')](function(_0x475763){return _0x475763&&_0x475763[_0x1c31('0x11')]&&_0x475763[_0x1c31('0x11')]['indexOf'](_0x1c31('0x12'))>=0x0?!![]:![];})[_0x1c31('0x9')](function(){logger[_0x1c31('0x7')](_0x1c31('0x13'),_0x531ee0,_0x368911[_0xf0ea51]);}));}BPromise[_0x1c31('0x14')](_0x2ec945)[_0x1c31('0x10')](function(_0x3ad4ed){var _0x2c39de=_[_0x1c31('0x15')](_0x3ad4ed);logger[_0x1c31('0xb')](_0x1c31('0x16'),_0x531ee0,_0x368911[_0x1c31('0x17')]('\x20|\x20'),_0x2c39de);_0x5220c8[_0x1c31('0x18')](_0x2c39de);})[_0x1c31('0x9')](function(_0x18397e){logger[_0x1c31('0x7')](_0x1c31('0x16'),_0x531ee0,_0x368911[_0x1c31('0x17')](_0x1c31('0x19')),_0x18397e[_0x1c31('0x1a')]);_0x5220c8[_0x1c31('0xc')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index c0993bf..676dde5 100644 --- a/server/services/xdr/agents.controller.js +++ b/server/services/xdr/agents.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbee3=['answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transferexten','transfereeuniqueid','agententerreason','clone','calleridnum','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','calleridname','agentconnectAt','hangup','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agentcompleteAt','agent','util','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','format','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','now','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid'];(function(_0x3e49a9,_0x546555){var _0x5324f9=function(_0x250bc6){while(--_0x250bc6){_0x3e49a9['push'](_0x3e49a9['shift']());}};_0x5324f9(++_0x546555);}(_0xbee3,0xd5));var _0x3bee=function(_0x447eef,_0x2666c3){_0x447eef=_0x447eef-0x0;var _0x23c503=_0xbee3[_0x447eef];return _0x23c503;};'use strict';var _=require('lodash');var util=require(_0x3bee('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x56a879,_0x45a1bf){utils[_0x3bee('0x1')](util['format'](_0x3bee('0x2'),_0x56a879[_0x3bee('0x3')],_0x56a879[_0x3bee('0x4')],_0x56a879['queue'],_0x56a879[_0x3bee('0x5')],_0x56a879[_0x3bee('0x6')],_0x56a879['calleridnum'],_0x56a879[_0x3bee('0x7')],_0x56a879[_0x3bee('0x8')]));if(_0x56a879[_0x3bee('0x9')]){utils[_0x3bee('0xa')](_0x56a879[_0x3bee('0x9')])[_0x3bee('0xb')](function(_0x3485b8){if(_0x3485b8){_0x56a879['type']=_0x3485b8[_0x3bee('0xc')];_0x56a879[_0x3bee('0xd')]=_0x56a879[_0x3bee('0xe')]?_0x3485b8[_0x3bee('0xf')]:![];_0x56a879[_0x3bee('0x10')]=_0x56a879[_0x3bee('0xd')]?_0x3485b8['acwTimeout']:0x0;}utils[_0x3bee('0x11')]('CreateVoiceAgentReport',_0x56a879);});}else{utils[_0x3bee('0x11')](_0x3bee('0x12'),_0x56a879);}if(_0x45a1bf){delete transfers[_0x56a879[_0x3bee('0x3')]];}else{delete agents[_0x56a879[_0x3bee('0x13')]];}}exports[_0x3bee('0x14')]=function(_0x459129){try{utils[_0x3bee('0x15')](util['format'](_0x3bee('0x16'),_0x459129[_0x3bee('0x3')]),_0x459129);agents[_0x459129[_0x3bee('0x13')]]=_0x459129;agents[_0x459129[_0x3bee('0x13')]][_0x3bee('0x17')]=utils['now']();agents[_0x459129['destuniqueid']][_0x3bee('0x8')]='called';agents[_0x459129[_0x3bee('0x13')]][_0x3bee('0x7')]=null;agents[_0x459129['destuniqueid']]['connectedlinename']=null;utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x19'),_0x459129[_0x3bee('0x3')],agents[_0x459129['destuniqueid']][_0x3bee('0x5')],_0x459129[_0x3bee('0x13')]));}catch(_0x440644){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')](_0x3bee('0x16'),_0x459129[_0x3bee('0x3')]),_0x440644);}};exports['agentringnoanswer']=function(_0x4f36af){try{if(!_[_0x3bee('0x1b')](agents[_0x4f36af[_0x3bee('0x13')]])){utils['debug'](util[_0x3bee('0x18')](_0x3bee('0x1c'),_0x4f36af[_0x3bee('0x3')]),_0x4f36af);utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x1d'),_0x4f36af[_0x3bee('0x3')],agents[_0x4f36af['destuniqueid']][_0x3bee('0x5')],_0x4f36af[_0x3bee('0x13')]));agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x1e')]=!![];agents[_0x4f36af['destuniqueid']][_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();agents[_0x4f36af[_0x3bee('0x13')]]['lastevent']='timeout';agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x21')]='timeout';agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x22')]=_0x4f36af[_0x3bee('0x23')]?parseInt(_0x4f36af['ringtime'])/0x3e8:0x0;agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x24')]=0x0;unanswered[_0x3bee('0x25')](_0x4f36af['destuniqueid']);}}catch(_0x239fa4){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')]('[%s][agents][agentringnoanswer]',_0x4f36af[_0x3bee('0x3')]),_0x239fa4);}};exports[_0x3bee('0x26')]=function(_0x27ed99){try{_[_0x3bee('0x27')](agents,function(_0x3433aa,_0x559c2b){if(_0x3433aa['uniqueid']==_0x27ed99[_0x3bee('0x3')]&&!_[_0x3bee('0x28')](unanswered,_0x3433aa[_0x3bee('0x13')])){utils[_0x3bee('0x15')](util['format']('[%s][agents][queuecallerabandon]',_0x27ed99[_0x3bee('0x3')]),_0x27ed99);utils[_0x3bee('0x1')](util['format']('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x27ed99[_0x3bee('0x3')],_0x3433aa[_0x3bee('0x5')],_0x3433aa[_0x3bee('0x13')]));_0x3433aa[_0x3bee('0x1e')]=!![];_0x3433aa[_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();_0x3433aa[_0x3bee('0x8')]=_0x3bee('0x29');_0x3433aa[_0x3bee('0x21')]=_0x3bee('0x29');_0x3433aa['holdtime']=_0x27ed99['holdtime'];_0x3433aa[_0x3bee('0x24')]=0x0;writeDB(_0x3433aa);}});}catch(_0x4a4706){utils['error'](util[_0x3bee('0x18')](_0x3bee('0x2a'),_0x27ed99[_0x3bee('0x3')]),_0x4a4706);}};exports[_0x3bee('0x2b')]=function(_0xd926f8){try{if(agents[_0xd926f8[_0x3bee('0x13')]]){utils[_0x3bee('0x15')](util[_0x3bee('0x18')]('[%s][agents][agentconnect]',_0xd926f8[_0x3bee('0x3')]),_0xd926f8);utils[_0x3bee('0x1')](util['format'](_0x3bee('0x2c'),_0xd926f8[_0x3bee('0x3')],agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x5')],_0xd926f8[_0x3bee('0x13')]));agents[_0xd926f8['destuniqueid']]['agentconnectAt']=utils[_0x3bee('0x20')]();agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x7')]=_0xd926f8[_0x3bee('0x7')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x2d')]=_0xd926f8[_0x3bee('0x2d')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x22')]=_0xd926f8[_0x3bee('0x23')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x8')]='connect';_[_0x3bee('0x27')](agents,function(_0x1b5eca,_0x25158b){if(_0x1b5eca[_0x3bee('0x13')]!=_0xd926f8[_0x3bee('0x13')]&&_0x1b5eca[_0x3bee('0x3')]==_0xd926f8[_0x3bee('0x3')]){_0x1b5eca[_0x3bee('0x24')]=0x0;_0x1b5eca[_0x3bee('0x22')]=_0xd926f8[_0x3bee('0x23')];_0x1b5eca[_0x3bee('0x1e')]=!![];_0x1b5eca[_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();_0x1b5eca['lastevent']=_0x3bee('0x2e');_0x1b5eca[_0x3bee('0x21')]=_0x3bee('0x2e');_0x1b5eca[_0x3bee('0x2f')]=_0xd926f8[_0x3bee('0x13')];_0x1b5eca[_0x3bee('0x30')]=_0xd926f8[_0x3bee('0x5')];writeDB(_0x1b5eca);}});}}catch(_0xd1140d){utils['error'](util[_0x3bee('0x18')](_0x3bee('0x31'),_0xd926f8[_0x3bee('0x3')]),_0xd1140d);}};exports['agentcomplete']=function(_0x4567f2){try{if(!_['isNil'](agents[_0x4567f2[_0x3bee('0x13')]])){utils['debug'](util['format'](_0x3bee('0x32'),_0x4567f2[_0x3bee('0x3')]),_0x4567f2);utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x33'),_0x4567f2['uniqueid'],agents[_0x4567f2['destuniqueid']][_0x3bee('0x5')],_0x4567f2['destuniqueid']));agents[_0x4567f2[_0x3bee('0x13')]]['agentcomplete']=!![];agents[_0x4567f2[_0x3bee('0x13')]]['agentcompleteAt']=utils[_0x3bee('0x20')]();agents[_0x4567f2[_0x3bee('0x13')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](agents[_0x4567f2['destuniqueid']]['agentcompleteAt'],agents[_0x4567f2[_0x3bee('0x13')]]['agentconnectAt']);agents[_0x4567f2['destuniqueid']]['reason']=_0x4567f2[_0x3bee('0x21')];agents[_0x4567f2['destuniqueid']][_0x3bee('0x8')]=_0x3bee('0x35');writeDB(agents[_0x4567f2[_0x3bee('0x13')]]);}}catch(_0x593427){utils[_0x3bee('0x1a')](util['format'](_0x3bee('0x32'),_0x4567f2['uniqueid']),_0x593427);}};exports[_0x3bee('0x36')]=function(_0x16b096){try{if(!_[_0x3bee('0x1b')](agents[_0x16b096['transfereruniqueid']])){utils[_0x3bee('0x15')](util[_0x3bee('0x18')](_0x3bee('0x37'),_0x16b096['uniqueid']),_0x16b096);utils['info'](util[_0x3bee('0x18')](_0x3bee('0x38'),_0x16b096[_0x3bee('0x3')],agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x5')],agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x3')]));agents[_0x16b096['transfereruniqueid']][_0x3bee('0x3a')]=!![];agents[_0x16b096[_0x3bee('0x39')]]['transfertype']='blind';agents[_0x16b096[_0x3bee('0x39')]]['transferexten']=_0x16b096[_0x3bee('0x3b')];agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x3c')]=agents[_0x16b096['transfereruniqueid']][_0x3bee('0x3')];}}catch(_0x3beac9){utils[_0x3bee('0x1a')](util['format'](_0x3bee('0x37'),_0x16b096[_0x3bee('0x3')]),_0x3beac9);}};exports['attendedtransfer']=function(_0x7e37ed){try{utils[_0x3bee('0x15')](util['format'](_0x3bee('0x3d'),_0x7e37ed[_0x3bee('0x3e')]),_0x7e37ed);if(_0x7e37ed[_0x3bee('0x3e')]==_0x7e37ed[_0x3bee('0x3f')]){if(!_[_0x3bee('0x1b')](agents[_0x7e37ed[_0x3bee('0x40')]])){utils[_0x3bee('0x1')](util[_0x3bee('0x18')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x7e37ed['origtransfereruniqueid'],agents[_0x7e37ed[_0x3bee('0x40')]]['membername']));agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x3a')]=!![];agents[_0x7e37ed[_0x3bee('0x40')]]['transfertype']=_0x3bee('0x41');agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x42')]=_0x7e37ed['origtransfererexten'];agents[_0x7e37ed[_0x3bee('0x40')]]['transferuniqueid']=_0x7e37ed[_0x3bee('0x3e')];}if(_0x7e37ed[_0x3bee('0x43')]&&agents[_0x7e37ed[_0x3bee('0x43')]]){agents[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x44')]=0x1;transfers[_0x7e37ed[_0x3bee('0x43')]]=_[_0x3bee('0x45')](agents[_0x7e37ed['transfereeuniqueid']]);transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x46')]=agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x46')];transfers[_0x7e37ed['transfereeuniqueid']]['calleridname']=agents[_0x7e37ed[_0x3bee('0x40')]]['calleridname'];transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x17')]=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x43')]]['agentconnectAt']=utils['now']();transfers[_0x7e37ed[_0x3bee('0x43')]][_0x3bee('0x22')]=0x0;transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x44')]=0x2;}}else if(_0x7e37ed['secondtransfereruniqueid']==_0x7e37ed[_0x3bee('0x47')]){if(!_[_0x3bee('0x1b')](agents[_0x7e37ed[_0x3bee('0x3e')]])){utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x48'),_0x7e37ed[_0x3bee('0x3e')],agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x5')]));agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x3a')]=!![];agents[_0x7e37ed['origtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x42')]=_0x7e37ed[_0x3bee('0x49')];agents[_0x7e37ed[_0x3bee('0x3e')]]['transferuniqueid']=_0x7e37ed[_0x3bee('0x40')];}if(_0x7e37ed[_0x3bee('0x4a')]&&agents[_0x7e37ed['transfertargetuniqueid']]){agents[_0x7e37ed['transfertargetuniqueid']][_0x3bee('0x44')]=0x1;transfers[_0x7e37ed[_0x3bee('0x4a')]]=_[_0x3bee('0x45')](agents[_0x7e37ed['transfertargetuniqueid']]);transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x46')]=agents[_0x7e37ed[_0x3bee('0x3e')]]['calleridnum'];transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x4b')]=agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x4b')];transfers[_0x7e37ed['transfertargetuniqueid']]['agentcalledAt']=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x4c')]=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x4a')]]['holdtime']=0x0;transfers[_0x7e37ed[_0x3bee('0x4a')]]['agententerreason']=0x2;}}}catch(_0xddc56b){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')](_0x3bee('0x3d'),_0x7e37ed[_0x3bee('0x3e')]),_0xddc56b);}};exports[_0x3bee('0x4d')]=function(_0x3f7dad){try{utils['debug'](util[_0x3bee('0x18')](_0x3bee('0x4e'),_0x3f7dad[_0x3bee('0x3')]),_0x3f7dad);if(agents[_0x3f7dad[_0x3bee('0x3')]]&&agents[_0x3f7dad['uniqueid']][_0x3bee('0x21')]===_0x3bee('0x4f')){if(_0x3f7dad[_0x3bee('0x50')]==='21'){agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')]=_0x3bee('0x51');agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]='rejected';}utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad['uniqueid'],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x5')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]));writeDB(agents[_0x3f7dad[_0x3bee('0x3')]]);var _0x204843=unanswered[_0x3bee('0x53')](_0x3f7dad[_0x3bee('0x3')]);if(_0x204843>-0x1){unanswered[_0x3bee('0x54')](_0x204843,0x1);}}if(transfers[_0x3f7dad[_0x3bee('0x3')]]){transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0xe')]=!![];transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')]=utils[_0x3bee('0x20')]();transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')],transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x4c')]);transfers[_0x3f7dad[_0x3bee('0x3')]]['reason']=_0x3bee('0x56');transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]=_0x3bee('0x35');utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad[_0x3bee('0x3')],transfers[_0x3f7dad[_0x3bee('0x3')]]['membername'],transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],transfers[_0x3f7dad['uniqueid']][_0x3bee('0x8')]));writeDB(transfers[_0x3f7dad['uniqueid']],!![]);}if(agents[_0x3f7dad[_0x3bee('0x3')]]&&agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x4c')]){agents[_0x3f7dad['uniqueid']]['agentcomplete']=!![];agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')]=utils[_0x3bee('0x20')]();agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')],agents[_0x3f7dad['uniqueid']][_0x3bee('0x4c')]);agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')]=agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x3a')]?_0x3bee('0x3a'):_0x3bee('0x56');agents[_0x3f7dad['uniqueid']][_0x3bee('0x8')]=_0x3bee('0x35');utils['info'](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad['uniqueid'],agents[_0x3f7dad[_0x3bee('0x3')]]['membername'],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]));writeDB(agents[_0x3f7dad['uniqueid']]);}}catch(_0x62900b){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')]('[%s][agents][hangup]',_0x3f7dad[_0x3bee('0x3')]),_0x62900b);}}; \ No newline at end of file +var _0x373d=['transfereruniqueid','transfer','blind','extension','transferuniqueid','[%s][agents][blindtransfer]','attendedtransfer','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','secondtransfereruniqueid','transfertype','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','lodash','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentcomplete','acw','acwTimeout','request','CreateVoiceAgentReport','agentcalled','format','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connect','answered_elsewhere','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s'];(function(_0x373b4d,_0x3c0a31){var _0x1f4ed7=function(_0x4d3ed8){while(--_0x4d3ed8){_0x373b4d['push'](_0x373b4d['shift']());}};_0x1f4ed7(++_0x3c0a31);}(_0x373d,0x1e2));var _0xd373=function(_0x47c0a5,_0x21fb53){_0x47c0a5=_0x47c0a5-0x0;var _0x50878c=_0x373d[_0x47c0a5];return _0x50878c;};'use strict';var _=require(_0xd373('0x0'));var util=require('util');var utils=require(_0xd373('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x53f3b7,_0x30e9ce){utils[_0xd373('0x2')](util['format'](_0xd373('0x3'),_0x53f3b7[_0xd373('0x4')],_0x53f3b7[_0xd373('0x5')],_0x53f3b7['queue'],_0x53f3b7['membername'],_0x53f3b7[_0xd373('0x6')],_0x53f3b7[_0xd373('0x7')],_0x53f3b7[_0xd373('0x8')],_0x53f3b7[_0xd373('0x9')]));if(_0x53f3b7['queue']){utils[_0xd373('0xa')](_0x53f3b7['queue'])['then'](function(_0x59ed5e){if(_0x59ed5e){_0x53f3b7[_0xd373('0xb')]=_0x59ed5e[_0xd373('0xb')];_0x53f3b7['agentacw']=_0x53f3b7[_0xd373('0xc')]?_0x59ed5e[_0xd373('0xd')]:![];_0x53f3b7['acwtime']=_0x53f3b7['agentacw']?_0x59ed5e[_0xd373('0xe')]:0x0;}utils[_0xd373('0xf')](_0xd373('0x10'),_0x53f3b7);});}else{utils[_0xd373('0xf')]('CreateVoiceAgentReport',_0x53f3b7);}if(_0x30e9ce){delete transfers[_0x53f3b7['uniqueid']];}else{delete agents[_0x53f3b7['destuniqueid']];}}exports[_0xd373('0x11')]=function(_0x14a0ee){try{utils['debug'](util[_0xd373('0x12')](_0xd373('0x13'),_0x14a0ee[_0xd373('0x4')]),_0x14a0ee);agents[_0x14a0ee[_0xd373('0x14')]]=_0x14a0ee;agents[_0x14a0ee[_0xd373('0x14')]][_0xd373('0x15')]=utils[_0xd373('0x16')]();agents[_0x14a0ee[_0xd373('0x14')]][_0xd373('0x9')]=_0xd373('0x17');agents[_0x14a0ee[_0xd373('0x14')]][_0xd373('0x8')]=null;agents[_0x14a0ee[_0xd373('0x14')]]['connectedlinename']=null;utils[_0xd373('0x2')](util['format'](_0xd373('0x18'),_0x14a0ee[_0xd373('0x4')],agents[_0x14a0ee['destuniqueid']][_0xd373('0x19')],_0x14a0ee['destuniqueid']));}catch(_0x4d7d72){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x13'),_0x14a0ee[_0xd373('0x4')]),_0x4d7d72);}};exports[_0xd373('0x1b')]=function(_0x181eb2){try{if(!_['isNil'](agents[_0x181eb2[_0xd373('0x14')]])){utils[_0xd373('0x1c')](util[_0xd373('0x12')](_0xd373('0x1d'),_0x181eb2[_0xd373('0x4')]),_0x181eb2);utils[_0xd373('0x2')](util['format'](_0xd373('0x1e'),_0x181eb2[_0xd373('0x4')],agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x19')],_0x181eb2[_0xd373('0x14')]));agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x1b')]=!![];agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x1f')]=utils[_0xd373('0x16')]();agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x9')]=_0xd373('0x20');agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x21')]=_0xd373('0x20');agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x22')]=_0x181eb2[_0xd373('0x23')]?parseInt(_0x181eb2[_0xd373('0x23')])/0x3e8:0x0;agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x24')]=0x0;unanswered[_0xd373('0x25')](_0x181eb2[_0xd373('0x14')]);}}catch(_0xf85ca8){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x1d'),_0x181eb2[_0xd373('0x4')]),_0xf85ca8);}};exports[_0xd373('0x26')]=function(_0x5287e7){try{_[_0xd373('0x27')](agents,function(_0x490842,_0x498aaa){if(_0x490842[_0xd373('0x4')]==_0x5287e7[_0xd373('0x4')]&&!_[_0xd373('0x28')](unanswered,_0x490842[_0xd373('0x14')])){utils[_0xd373('0x1c')](util['format'](_0xd373('0x29'),_0x5287e7[_0xd373('0x4')]),_0x5287e7);utils['info'](util[_0xd373('0x12')](_0xd373('0x2a'),_0x5287e7[_0xd373('0x4')],_0x490842[_0xd373('0x19')],_0x490842[_0xd373('0x14')]));_0x490842[_0xd373('0x1b')]=!![];_0x490842[_0xd373('0x1f')]=utils[_0xd373('0x16')]();_0x490842[_0xd373('0x9')]='abandoned';_0x490842[_0xd373('0x21')]=_0xd373('0x2b');_0x490842[_0xd373('0x22')]=_0x5287e7[_0xd373('0x22')];_0x490842[_0xd373('0x24')]=0x0;writeDB(_0x490842);}});}catch(_0x28da03){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x29'),_0x5287e7[_0xd373('0x4')]),_0x28da03);}};exports[_0xd373('0x2c')]=function(_0x13a1cd){try{if(agents[_0x13a1cd[_0xd373('0x14')]]){utils[_0xd373('0x1c')](util[_0xd373('0x12')]('[%s][agents][agentconnect]',_0x13a1cd[_0xd373('0x4')]),_0x13a1cd);utils[_0xd373('0x2')](util[_0xd373('0x12')](_0xd373('0x2d'),_0x13a1cd['uniqueid'],agents[_0x13a1cd[_0xd373('0x14')]][_0xd373('0x19')],_0x13a1cd[_0xd373('0x14')]));agents[_0x13a1cd[_0xd373('0x14')]][_0xd373('0x2e')]=utils[_0xd373('0x16')]();agents[_0x13a1cd['destuniqueid']]['connectedlinenum']=_0x13a1cd[_0xd373('0x8')];agents[_0x13a1cd['destuniqueid']][_0xd373('0x2f')]=_0x13a1cd[_0xd373('0x2f')];agents[_0x13a1cd[_0xd373('0x14')]]['holdtime']=_0x13a1cd[_0xd373('0x23')];agents[_0x13a1cd[_0xd373('0x14')]][_0xd373('0x9')]=_0xd373('0x30');_['forIn'](agents,function(_0x513038,_0x5de74e){if(_0x513038[_0xd373('0x14')]!=_0x13a1cd['destuniqueid']&&_0x513038[_0xd373('0x4')]==_0x13a1cd[_0xd373('0x4')]){_0x513038['talktime']=0x0;_0x513038['holdtime']=_0x13a1cd['ringtime'];_0x513038[_0xd373('0x1b')]=!![];_0x513038[_0xd373('0x1f')]=utils[_0xd373('0x16')]();_0x513038['lastevent']='answered_elsewhere';_0x513038[_0xd373('0x21')]=_0xd373('0x31');_0x513038['answeredelsewheredestinationuniqueid']=_0x13a1cd[_0xd373('0x14')];_0x513038[_0xd373('0x32')]=_0x13a1cd[_0xd373('0x19')];writeDB(_0x513038);}});}}catch(_0x9989e4){utils[_0xd373('0x1a')](util['format']('[%s][agents][agentconnect]',_0x13a1cd[_0xd373('0x4')]),_0x9989e4);}};exports[_0xd373('0xc')]=function(_0x30b423){try{if(!_[_0xd373('0x33')](agents[_0x30b423['destuniqueid']])){utils[_0xd373('0x1c')](util['format'](_0xd373('0x34'),_0x30b423[_0xd373('0x4')]),_0x30b423);utils[_0xd373('0x2')](util[_0xd373('0x12')](_0xd373('0x35'),_0x30b423['uniqueid'],agents[_0x30b423[_0xd373('0x14')]][_0xd373('0x19')],_0x30b423['destuniqueid']));agents[_0x30b423[_0xd373('0x14')]][_0xd373('0xc')]=!![];agents[_0x30b423[_0xd373('0x14')]][_0xd373('0x36')]=utils[_0xd373('0x16')]();agents[_0x30b423[_0xd373('0x14')]][_0xd373('0x24')]=utils[_0xd373('0x37')](agents[_0x30b423[_0xd373('0x14')]][_0xd373('0x36')],agents[_0x30b423['destuniqueid']]['agentconnectAt']);agents[_0x30b423[_0xd373('0x14')]]['reason']=_0x30b423[_0xd373('0x21')];agents[_0x30b423['destuniqueid']]['lastevent']='complete';writeDB(agents[_0x30b423[_0xd373('0x14')]]);}}catch(_0x39d995){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x34'),_0x30b423[_0xd373('0x4')]),_0x39d995);}};exports[_0xd373('0x38')]=function(_0x4d1088){try{if(!_[_0xd373('0x33')](agents[_0x4d1088['transfereruniqueid']])){utils[_0xd373('0x1c')](util[_0xd373('0x12')]('[%s][agents][blindtransfer]',_0x4d1088[_0xd373('0x4')]),_0x4d1088);utils['info'](util[_0xd373('0x12')](_0xd373('0x39'),_0x4d1088[_0xd373('0x4')],agents[_0x4d1088[_0xd373('0x3a')]][_0xd373('0x19')],agents[_0x4d1088['transfereruniqueid']]['uniqueid']));agents[_0x4d1088['transfereruniqueid']][_0xd373('0x3b')]=!![];agents[_0x4d1088[_0xd373('0x3a')]]['transfertype']=_0xd373('0x3c');agents[_0x4d1088[_0xd373('0x3a')]]['transferexten']=_0x4d1088[_0xd373('0x3d')];agents[_0x4d1088[_0xd373('0x3a')]][_0xd373('0x3e')]=agents[_0x4d1088[_0xd373('0x3a')]][_0xd373('0x4')];}}catch(_0xa2758){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x3f'),_0x4d1088[_0xd373('0x4')]),_0xa2758);}};exports[_0xd373('0x40')]=function(_0x5b88ea){try{utils['debug'](util['format']('[%s][agents][attendedtransfer]',_0x5b88ea['origtransfereruniqueid']),_0x5b88ea);if(_0x5b88ea['origtransfereruniqueid']==_0x5b88ea[_0xd373('0x41')]){if(!_[_0xd373('0x33')](agents[_0x5b88ea['secondtransfereruniqueid']])){utils['info'](util['format'](_0xd373('0x42'),_0x5b88ea[_0xd373('0x43')],agents[_0x5b88ea['secondtransfereruniqueid']]['membername']));agents[_0x5b88ea[_0xd373('0x44')]][_0xd373('0x3b')]=!![];agents[_0x5b88ea[_0xd373('0x44')]][_0xd373('0x45')]=_0xd373('0x46');agents[_0x5b88ea['secondtransfereruniqueid']][_0xd373('0x47')]=_0x5b88ea[_0xd373('0x48')];agents[_0x5b88ea[_0xd373('0x44')]][_0xd373('0x3e')]=_0x5b88ea[_0xd373('0x43')];}if(_0x5b88ea[_0xd373('0x49')]&&agents[_0x5b88ea[_0xd373('0x49')]]){agents[_0x5b88ea[_0xd373('0x49')]][_0xd373('0x4a')]=0x1;transfers[_0x5b88ea[_0xd373('0x49')]]=_[_0xd373('0x4b')](agents[_0x5b88ea[_0xd373('0x49')]]);transfers[_0x5b88ea[_0xd373('0x49')]][_0xd373('0x7')]=agents[_0x5b88ea[_0xd373('0x44')]]['calleridnum'];transfers[_0x5b88ea[_0xd373('0x49')]][_0xd373('0x4c')]=agents[_0x5b88ea[_0xd373('0x44')]]['calleridname'];transfers[_0x5b88ea[_0xd373('0x49')]]['agentcalledAt']=utils[_0xd373('0x16')]();transfers[_0x5b88ea['transfereeuniqueid']][_0xd373('0x2e')]=utils[_0xd373('0x16')]();transfers[_0x5b88ea[_0xd373('0x49')]][_0xd373('0x22')]=0x0;transfers[_0x5b88ea[_0xd373('0x49')]][_0xd373('0x4a')]=0x2;}}else if(_0x5b88ea[_0xd373('0x44')]==_0x5b88ea[_0xd373('0x4d')]){if(!_[_0xd373('0x33')](agents[_0x5b88ea[_0xd373('0x43')]])){utils[_0xd373('0x2')](util[_0xd373('0x12')](_0xd373('0x42'),_0x5b88ea[_0xd373('0x43')],agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x19')]));agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x3b')]=!![];agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x45')]=_0xd373('0x46');agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x47')]=_0x5b88ea[_0xd373('0x4e')];agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x3e')]=_0x5b88ea['secondtransfereruniqueid'];}if(_0x5b88ea[_0xd373('0x4f')]&&agents[_0x5b88ea[_0xd373('0x4f')]]){agents[_0x5b88ea[_0xd373('0x4f')]]['agententerreason']=0x1;transfers[_0x5b88ea[_0xd373('0x4f')]]=_[_0xd373('0x4b')](agents[_0x5b88ea[_0xd373('0x4f')]]);transfers[_0x5b88ea[_0xd373('0x4f')]][_0xd373('0x7')]=agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x7')];transfers[_0x5b88ea['transfertargetuniqueid']][_0xd373('0x4c')]=agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x4c')];transfers[_0x5b88ea[_0xd373('0x4f')]][_0xd373('0x15')]=utils[_0xd373('0x16')]();transfers[_0x5b88ea[_0xd373('0x4f')]][_0xd373('0x2e')]=utils['now']();transfers[_0x5b88ea[_0xd373('0x4f')]]['holdtime']=0x0;transfers[_0x5b88ea[_0xd373('0x4f')]][_0xd373('0x4a')]=0x2;}}}catch(_0x1337c4){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x50'),_0x5b88ea[_0xd373('0x43')]),_0x1337c4);}};exports[_0xd373('0x51')]=function(_0x5f1bfd){try{utils[_0xd373('0x1c')](util['format'](_0xd373('0x52'),_0x5f1bfd[_0xd373('0x4')]),_0x5f1bfd);if(agents[_0x5f1bfd[_0xd373('0x4')]]&&agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x21')]===_0xd373('0x20')){if(_0x5f1bfd[_0xd373('0x53')]==='21'){agents[_0x5f1bfd['uniqueid']][_0xd373('0x21')]=_0xd373('0x54');agents[_0x5f1bfd[_0xd373('0x4')]]['lastevent']=_0xd373('0x54');}utils[_0xd373('0x2')](util[_0xd373('0x12')](_0xd373('0x55'),_0x5f1bfd[_0xd373('0x4')],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x19')],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x21')],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x9')]));writeDB(agents[_0x5f1bfd[_0xd373('0x4')]]);var _0x5bbea5=unanswered[_0xd373('0x56')](_0x5f1bfd[_0xd373('0x4')]);if(_0x5bbea5>-0x1){unanswered[_0xd373('0x57')](_0x5bbea5,0x1);}}if(transfers[_0x5f1bfd['uniqueid']]){transfers[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0xc')]=!![];transfers[_0x5f1bfd[_0xd373('0x4')]]['agentcompleteAt']=utils[_0xd373('0x16')]();transfers[_0x5f1bfd['uniqueid']][_0xd373('0x24')]=utils[_0xd373('0x37')](transfers[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x36')],transfers[_0x5f1bfd['uniqueid']][_0xd373('0x2e')]);transfers[_0x5f1bfd['uniqueid']][_0xd373('0x21')]=_0xd373('0x58');transfers[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x9')]=_0xd373('0x59');utils[_0xd373('0x2')](util['format'](_0xd373('0x55'),_0x5f1bfd['uniqueid'],transfers[_0x5f1bfd[_0xd373('0x4')]]['membername'],transfers[_0x5f1bfd['uniqueid']][_0xd373('0x21')],transfers[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x9')]));writeDB(transfers[_0x5f1bfd[_0xd373('0x4')]],!![]);}if(agents[_0x5f1bfd['uniqueid']]&&agents[_0x5f1bfd['uniqueid']][_0xd373('0x2e')]){agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0xc')]=!![];agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x36')]=utils[_0xd373('0x16')]();agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x24')]=utils[_0xd373('0x37')](agents[_0x5f1bfd[_0xd373('0x4')]]['agentcompleteAt'],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x2e')]);agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x21')]=agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x3b')]?_0xd373('0x3b'):'agent';agents[_0x5f1bfd[_0xd373('0x4')]]['lastevent']='complete';utils[_0xd373('0x2')](util[_0xd373('0x12')](_0xd373('0x55'),_0x5f1bfd[_0xd373('0x4')],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x19')],agents[_0x5f1bfd['uniqueid']][_0xd373('0x21')],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x9')]));writeDB(agents[_0x5f1bfd['uniqueid']]);}}catch(_0x467ac8){utils[_0xd373('0x1a')](util[_0xd373('0x12')]('[%s][agents][hangup]',_0x5f1bfd[_0xd373('0x4')]),_0x467ac8);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index c479d09..daf8e03 100644 --- a/server/services/xdr/calls.controller.js +++ b/server/services/xdr/calls.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa589=['NO\x20ANSWER','FAILED','ANSWERED','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','connectedlinenum','lastevent','accountcode','then','UserId','CreateVoiceCallReport','request','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','linkedid','transfer','destinationchannel','answertime','disposition','toNumber','hangup','callerid','cause-txt','endtime','diffTime','billableseconds','[%s][calls][hangup]','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','split','lastIndexOf','includes','noop','execif','lodash','util','./utils'];(function(_0x2c5340,_0x5c86e5){var _0x3c505e=function(_0x1089d9){while(--_0x1089d9){_0x2c5340['push'](_0x2c5340['shift']());}};_0x3c505e(++_0x5c86e5);}(_0xa589,0x19d));var _0x9a58=function(_0x2e49cc,_0x1f72a7){_0x2e49cc=_0x2e49cc-0x0;var _0xa0c6c1=_0xa589[_0x2e49cc];return _0xa0c6c1;};'use strict';var _=require(_0x9a58('0x0'));var util=require(_0x9a58('0x1'));var utils=require(_0x9a58('0x2'));var dispositions=[_0x9a58('0x3'),_0x9a58('0x4'),_0x9a58('0x4'),_0x9a58('0x3'),_0x9a58('0x3'),_0x9a58('0x3'),_0x9a58('0x5'),'BUSY',_0x9a58('0x4'),_0x9a58('0x4'),_0x9a58('0x4')];var channels={};function writeDB(_0x4c63c4){utils['info'](util[_0x9a58('0x6')](_0x9a58('0x7'),_0x4c63c4[_0x9a58('0x8')],_0x4c63c4[_0x9a58('0x9')],_0x4c63c4['queue'],_0x4c63c4[_0x9a58('0xa')],_0x4c63c4[_0x9a58('0xb')],_0x4c63c4['calleridnum'],_0x4c63c4[_0x9a58('0xc')],_0x4c63c4[_0x9a58('0xd')]));if(_0x4c63c4['accountcode']){utils['getUserByInternal'](_0x4c63c4[_0x9a58('0xe')])[_0x9a58('0xf')](function(_0x3b5425){if(_0x3b5425){_0x4c63c4[_0x9a58('0x10')]=_0x3b5425['id'];}utils['request'](_0x9a58('0x11'),_0x4c63c4);});}else{utils[_0x9a58('0x12')](_0x9a58('0x11'),_0x4c63c4);}if(channels[_0x4c63c4[_0x9a58('0x8')]]){delete channels[_0x4c63c4[_0x9a58('0x8')]];}}exports[_0x9a58('0x13')]=function(_0xcc06cb){try{utils[_0x9a58('0x14')](util[_0x9a58('0x6')](_0x9a58('0x15'),_0xcc06cb[_0x9a58('0x8')]),_0xcc06cb);if(_0xcc06cb[_0x9a58('0x8')]==_0xcc06cb['linkedid']&&_0xcc06cb[_0x9a58('0x9')]!=_0x9a58('0x16')){utils[_0x9a58('0x17')](util[_0x9a58('0x6')](_0x9a58('0x18'),_0xcc06cb[_0x9a58('0x8')],_0xcc06cb[_0x9a58('0x19')],_0xcc06cb[_0x9a58('0x1a')]));channels[_0xcc06cb[_0x9a58('0x8')]]={'uniqueid':_0xcc06cb[_0x9a58('0x8')],'accountcode':_0xcc06cb[_0x9a58('0xe')],'source':_0xcc06cb[_0x9a58('0x1b')],'destination':_0xcc06cb[_0x9a58('0x1a')],'destinationcontext':_0xcc06cb[_0x9a58('0x19')],'channel':_0xcc06cb[_0x9a58('0x9')],'starttime':utils[_0x9a58('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9a58('0x3'),'amaflags':_0x9a58('0x1d')};}}catch(_0x22e1c3){utils[_0x9a58('0x1e')](util[_0x9a58('0x6')]('[%s][calls][newchannel]',_0xcc06cb[_0x9a58('0x8')]),_0x22e1c3);}};exports[_0x9a58('0x1f')]=function(_0x31a2b6){try{utils[_0x9a58('0x14')](util[_0x9a58('0x6')](_0x9a58('0x20'),_0x31a2b6[_0x9a58('0x8')]),_0x31a2b6);if(!_[_0x9a58('0x21')](channels[_0x31a2b6[_0x9a58('0x8')]])&&_0x31a2b6[_0x9a58('0x22')]==0x6){utils['info'](util[_0x9a58('0x6')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x31a2b6['uniqueid'],_0x31a2b6[_0x9a58('0x19')],_0x31a2b6[_0x9a58('0x9')]));if(_[_0x9a58('0x21')](channels[_0x31a2b6[_0x9a58('0x8')]][_0x9a58('0x23')])){channels[_0x31a2b6[_0x9a58('0x8')]][_0x9a58('0x23')]=utils[_0x9a58('0x1c')]();}}else if(!_[_0x9a58('0x21')](channels[_0x31a2b6[_0x9a58('0x24')]])&&_0x31a2b6['channelstate']==0x6&&_0x31a2b6[_0x9a58('0x19')]!=_0x9a58('0x25')){utils[_0x9a58('0x17')](util['format']('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x31a2b6[_0x9a58('0x8')],_0x31a2b6[_0x9a58('0x24')],_0x31a2b6[_0x9a58('0x19')],_0x31a2b6[_0x9a58('0x9')]));channels[_0x31a2b6[_0x9a58('0x24')]][_0x9a58('0xe')]=_0x31a2b6['accountcode'];channels[_0x31a2b6[_0x9a58('0x24')]][_0x9a58('0x26')]=_0x31a2b6[_0x9a58('0x9')];if(_[_0x9a58('0x21')](channels[_0x31a2b6[_0x9a58('0x24')]][_0x9a58('0x27')])){channels[_0x31a2b6['linkedid']][_0x9a58('0x27')]=utils[_0x9a58('0x1c')]();}channels[_0x31a2b6['linkedid']][_0x9a58('0x28')]=dispositions[_[_0x9a58('0x29')](_0x31a2b6[_0x9a58('0x22')])]||'ANSWERED';}}catch(_0x3ce939){utils['error'](util[_0x9a58('0x6')](_0x9a58('0x20'),_0x31a2b6[_0x9a58('0x8')]),_0x3ce939);}};exports[_0x9a58('0x2a')]=function(_0x238155){try{if(!_['isNil'](channels[_0x238155[_0x9a58('0x8')]])){utils[_0x9a58('0x14')](util[_0x9a58('0x6')]('[%s][calls][hangup]',_0x238155[_0x9a58('0x8')]),_0x238155);if(_[_0x9a58('0x21')](channels[_0x238155[_0x9a58('0x8')]]['callerid'])){channels[_0x238155[_0x9a58('0x8')]]['callerid']=_0x238155['calleridname']+'\x20<'+_0x238155[_0x9a58('0x1b')]+'>';}utils[_0x9a58('0x17')](util[_0x9a58('0x6')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x238155[_0x9a58('0x8')],channels[_0x238155[_0x9a58('0x8')]][_0x9a58('0x2b')],_0x238155[_0x9a58('0x2c')]));channels[_0x238155[_0x9a58('0x8')]][_0x9a58('0x2d')]=utils[_0x9a58('0x1c')]();channels[_0x238155['uniqueid']]['duration']=utils[_0x9a58('0x2e')](channels[_0x238155['uniqueid']][_0x9a58('0x2d')],channels[_0x238155[_0x9a58('0x8')]]['starttime']);channels[_0x238155[_0x9a58('0x8')]][_0x9a58('0x2f')]=channels[_0x238155['uniqueid']][_0x9a58('0x27')]?utils['diffTime'](channels[_0x238155[_0x9a58('0x8')]][_0x9a58('0x2d')],channels[_0x238155[_0x9a58('0x8')]][_0x9a58('0x27')]):0x0;writeDB(channels[_0x238155[_0x9a58('0x8')]]);}}catch(_0x4e9c11){utils[_0x9a58('0x1e')](util[_0x9a58('0x6')](_0x9a58('0x30'),_0x238155[_0x9a58('0x8')]),_0x4e9c11);}};exports[_0x9a58('0x31')]=function(_0x302b7b){try{if(!_['isNil'](channels[_0x302b7b['localtwolinkedid']])){utils[_0x9a58('0x14')](util['format'](_0x9a58('0x32'),_0x302b7b[_0x9a58('0x33')]),_0x302b7b);if(channels[_0x302b7b[_0x9a58('0x34')]][_0x9a58('0x9')]==_0x302b7b['transfereechannel']){utils[_0x9a58('0x17')](util['format'](_0x9a58('0x35'),_0x302b7b[_0x9a58('0x33')],_0x302b7b[_0x9a58('0x34')],_0x302b7b[_0x9a58('0x36')]));channels[_0x302b7b['localtwolinkedid']][_0x9a58('0x26')]=_0x302b7b[_0x9a58('0x36')];channels[_0x302b7b['localtwolinkedid']][_0x9a58('0x37')]=_0x9a58('0x38');}else if(channels[_0x302b7b['localtwolinkedid']][_0x9a58('0x9')]=_0x302b7b[_0x9a58('0x39')]){utils[_0x9a58('0x17')](util['format'](_0x9a58('0x35'),_0x302b7b['origtransfereruniqueid'],_0x302b7b[_0x9a58('0x34')],_0x302b7b['origtransfererchannel']));channels[_0x302b7b[_0x9a58('0x34')]]['destinationchannel']=_0x302b7b[_0x9a58('0x3a')];channels[_0x302b7b[_0x9a58('0x34')]][_0x9a58('0x37')]=_0x9a58('0x38');}}}catch(_0x569a8f){utils[_0x9a58('0x1e')](util[_0x9a58('0x6')]('[%s][calls][attendedtransfer]',_0x302b7b[_0x9a58('0x33')]),_0x569a8f);}};exports['musiconholdstart']=function(_0x3953c9){try{if(!_[_0x9a58('0x21')](channels[_0x3953c9['uniqueid']])){utils[_0x9a58('0x14')](util['format'](_0x9a58('0x3b'),_0x3953c9[_0x9a58('0x8')]),_0x3953c9);channels[_0x3953c9['uniqueid']][_0x9a58('0x3c')]=utils[_0x9a58('0x1c')]();utils[_0x9a58('0x17')](util[_0x9a58('0x6')](_0x9a58('0x3d'),_0x3953c9['uniqueid'],channels[_0x3953c9['uniqueid']][_0x9a58('0x3c')]));}}catch(_0x4433d7){utils['error'](util[_0x9a58('0x6')](_0x9a58('0x3b'),_0x3953c9[_0x9a58('0x8')]),_0x4433d7);}};exports['musiconholdstop']=function(_0x82c7e6){try{if(!_[_0x9a58('0x21')](channels[_0x82c7e6['uniqueid']])){utils[_0x9a58('0x14')](util['format'](_0x9a58('0x3e'),_0x82c7e6['uniqueid']),_0x82c7e6);if(!_['isNil'](channels[_0x82c7e6[_0x9a58('0x8')]][_0x9a58('0x3c')])){channels[_0x82c7e6[_0x9a58('0x8')]][_0x9a58('0x3f')]+=utils['diffTime'](utils[_0x9a58('0x1c')](),channels[_0x82c7e6[_0x9a58('0x8')]]['musiconholdstartAt']);utils[_0x9a58('0x17')](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x82c7e6['uniqueid'],channels[_0x82c7e6[_0x9a58('0x8')]]['mohtime']));delete channels[_0x82c7e6[_0x9a58('0x8')]][_0x9a58('0x3c')];}}}catch(_0x143194){utils[_0x9a58('0x1e')](util[_0x9a58('0x6')](_0x9a58('0x3e'),_0x82c7e6[_0x9a58('0x8')]),_0x143194);}};exports[_0x9a58('0x40')]=function(_0x17ead6){try{if(!_[_0x9a58('0x21')](channels[_0x17ead6['uniqueid']])){utils['debug'](util[_0x9a58('0x6')](_0x9a58('0x41'),_0x17ead6[_0x9a58('0x8')]),_0x17ead6);if(!_[_0x9a58('0x21')](_0x17ead6[_0x9a58('0x42')][_0x9a58('0x43')])){utils['info'](util[_0x9a58('0x6')](_0x9a58('0x44'),_0x17ead6['uniqueid'],_0x17ead6['value']));channels[_0x17ead6[_0x9a58('0x8')]]['source']=_0x17ead6[_0x9a58('0x45')];}if(!_[_0x9a58('0x21')](_0x17ead6[_0x9a58('0x42')][_0x9a58('0x46')])){utils[_0x9a58('0x17')](util[_0x9a58('0x6')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x17ead6[_0x9a58('0x8')],_0x17ead6['value']));channels[_0x17ead6[_0x9a58('0x8')]]['destination']=_0x17ead6[_0x9a58('0x45')];channels[_0x17ead6[_0x9a58('0x8')]]['callerid']='\x22'+_0x17ead6[_0x9a58('0x45')]+'\x22\x20<'+_0x17ead6[_0x9a58('0x45')]+'>';}if(!_[_0x9a58('0x21')](_0x17ead6['variable'][_0x9a58('0x47')])||!_[_0x9a58('0x21')](_0x17ead6[_0x9a58('0x42')]['xmd-callerid'])){utils[_0x9a58('0x17')](util[_0x9a58('0x6')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x17ead6[_0x9a58('0x8')],!_[_0x9a58('0x21')](_0x17ead6[_0x9a58('0x42')]['xmd-callerid-preview'])?_0x9a58('0x47'):_0x9a58('0x48'),_0x17ead6['value']));channels[_0x17ead6[_0x9a58('0x8')]]['callerid']=_0x17ead6[_0x9a58('0x45')];}if(!_[_0x9a58('0x21')](_0x17ead6[_0x9a58('0x42')][_0x9a58('0x49')])||!_[_0x9a58('0x21')](_0x17ead6[_0x9a58('0x42')][_0x9a58('0x4a')])){utils['info'](util[_0x9a58('0x6')](_0x9a58('0x4b'),_0x17ead6['uniqueid'],!_[_0x9a58('0x21')](_0x17ead6[_0x9a58('0x42')]['xmd-queue'])?_0x9a58('0x49'):_0x9a58('0x4a'),_0x17ead6[_0x9a58('0x45')]));channels[_0x17ead6[_0x9a58('0x8')]][_0x9a58('0x4c')]=_0x9a58('0x4d');channels[_0x17ead6['uniqueid']][_0x9a58('0x4e')]=_0x17ead6[_0x9a58('0x45')];channels[_0x17ead6[_0x9a58('0x8')]][_0x9a58('0x4f')]=!![];}if(!_['isNil'](_0x17ead6[_0x9a58('0x42')][_0x9a58('0x50')])){utils[_0x9a58('0x17')](util['format'](_0x9a58('0x51'),_0x17ead6[_0x9a58('0x8')],_0x17ead6[_0x9a58('0x45')]));channels[_0x17ead6['uniqueid']][_0x9a58('0x52')]=_0x17ead6[_0x9a58('0x45')];}if(!_[_0x9a58('0x21')](_0x17ead6[_0x9a58('0x42')]['xmd-cdrtype'])){utils[_0x9a58('0x17')](util['format'](_0x9a58('0x53'),_0x17ead6[_0x9a58('0x8')],_0x17ead6[_0x9a58('0x45')]));channels[_0x17ead6[_0x9a58('0x8')]][_0x9a58('0x54')]=_0x17ead6[_0x9a58('0x45')];}if(!_[_0x9a58('0x21')](_0x17ead6[_0x9a58('0x42')][_0x9a58('0x55')])){utils[_0x9a58('0x17')](util[_0x9a58('0x6')](_0x9a58('0x56'),_0x17ead6[_0x9a58('0x8')],_0x17ead6[_0x9a58('0x45')]));channels[_0x17ead6[_0x9a58('0x8')]][_0x9a58('0x57')]=_0x17ead6[_0x9a58('0x45')];}if(!_[_0x9a58('0x21')](_0x17ead6['variable'][_0x9a58('0x58')])){utils[_0x9a58('0x17')](util['format'](_0x9a58('0x59'),_0x17ead6['uniqueid'],_0x17ead6[_0x9a58('0x45')]));channels[_0x17ead6[_0x9a58('0x8')]][_0x9a58('0x58')]=_0x17ead6[_0x9a58('0x45')];}}}catch(_0x409ed0){utils[_0x9a58('0x1e')](util[_0x9a58('0x6')]('[%s][calls][varset]',_0x17ead6[_0x9a58('0x8')]),_0x409ed0);}};exports[_0x9a58('0x5a')]=function(_0xdbdd6b){try{if(!_[_0x9a58('0x21')](channels[_0xdbdd6b['uniqueid']])){utils['debug'](util[_0x9a58('0x6')](_0x9a58('0x5b'),_0xdbdd6b['uniqueid']),_0xdbdd6b);utils['info'](util[_0x9a58('0x6')](_0x9a58('0x5c'),_0xdbdd6b[_0x9a58('0x8')],_0xdbdd6b['application'],_0xdbdd6b['appdata']));if(_0xdbdd6b[_0x9a58('0x5d')][_0x9a58('0x5e')]()==_0x9a58('0x5f')&&_[_0x9a58('0x60')](_0xdbdd6b[_0x9a58('0x61')][_0x9a58('0x5e')](),_0x9a58('0x62'))){var _0x315d32=_0xdbdd6b[_0x9a58('0x61')][_0x9a58('0x63')]('=');var _0xf03a11=_0x315d32[0x0]['substring'](_0x315d32[0x0][_0x9a58('0x64')]('(')+0x1,_0x315d32[0x0][_0x9a58('0x64')](')'));var _0x59f0de=_0x315d32[0x1];channels[_0xdbdd6b[_0x9a58('0x8')]][_0xf03a11]=_0x59f0de;}if(!_[_0x9a58('0x65')]([_0x9a58('0x2a'),_0x9a58('0x66'),_0x9a58('0x67'),_0x9a58('0x5f'),'gotoif'],_0xdbdd6b['application']['toLowerCase']())){channels[_0xdbdd6b[_0x9a58('0x8')]][_0x9a58('0x4c')]=_0xdbdd6b['application'];channels[_0xdbdd6b[_0x9a58('0x8')]]['lastdata']=_0xdbdd6b['appdata'];}}}catch(_0x5c9c17){utils['error'](util[_0x9a58('0x6')](_0x9a58('0x5b'),_0xdbdd6b[_0x9a58('0x8')]),_0x5c9c17);}}; \ No newline at end of file +var _0xd9ed=['includes','noop','execif','gotoif','application','lodash','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','interface','calleridnum','connectedlinenum','accountcode','then','UserId','request','CreateVoiceCallReport','debug','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','now','DOCUMENTATION','error','[%s][calls][newchannel]','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','context','isNil','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastapplication','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','newexten','appdata','toLowerCase','set','substring','lastIndexOf'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xd9ed,0x70));var _0xdd9e=function(_0x1a800e,_0x3bfb01){_0x1a800e=_0x1a800e-0x0;var _0x4eb91e=_0xd9ed[_0x1a800e];return _0x4eb91e;};'use strict';var _=require(_0xdd9e('0x0'));var util=require(_0xdd9e('0x1'));var utils=require(_0xdd9e('0x2'));var dispositions=['NO\x20ANSWER',_0xdd9e('0x3'),_0xdd9e('0x3'),_0xdd9e('0x4'),_0xdd9e('0x4'),_0xdd9e('0x4'),_0xdd9e('0x5'),_0xdd9e('0x6'),_0xdd9e('0x3'),_0xdd9e('0x3'),_0xdd9e('0x3')];var channels={};function writeDB(_0x1e1601){utils[_0xdd9e('0x7')](util[_0xdd9e('0x8')](_0xdd9e('0x9'),_0x1e1601[_0xdd9e('0xa')],_0x1e1601[_0xdd9e('0xb')],_0x1e1601[_0xdd9e('0xc')],_0x1e1601['membername'],_0x1e1601[_0xdd9e('0xd')],_0x1e1601[_0xdd9e('0xe')],_0x1e1601[_0xdd9e('0xf')],_0x1e1601['lastevent']));if(_0x1e1601[_0xdd9e('0x10')]){utils['getUserByInternal'](_0x1e1601['accountcode'])[_0xdd9e('0x11')](function(_0x2daa25){if(_0x2daa25){_0x1e1601[_0xdd9e('0x12')]=_0x2daa25['id'];}utils[_0xdd9e('0x13')]('CreateVoiceCallReport',_0x1e1601);});}else{utils[_0xdd9e('0x13')](_0xdd9e('0x14'),_0x1e1601);}if(channels[_0x1e1601[_0xdd9e('0xa')]]){delete channels[_0x1e1601[_0xdd9e('0xa')]];}}exports['newchannel']=function(_0x2f2250){try{utils[_0xdd9e('0x15')](util[_0xdd9e('0x8')]('[%s][calls][newchannel]',_0x2f2250['uniqueid']),_0x2f2250);if(_0x2f2250[_0xdd9e('0xa')]==_0x2f2250[_0xdd9e('0x16')]&&_0x2f2250['channel']!='OutgoingSpoolFailed'){utils[_0xdd9e('0x7')](util[_0xdd9e('0x8')](_0xdd9e('0x17'),_0x2f2250[_0xdd9e('0xa')],_0x2f2250['context'],_0x2f2250[_0xdd9e('0x18')]));channels[_0x2f2250['uniqueid']]={'uniqueid':_0x2f2250[_0xdd9e('0xa')],'accountcode':_0x2f2250[_0xdd9e('0x10')],'source':_0x2f2250[_0xdd9e('0xe')],'destination':_0x2f2250['exten'],'destinationcontext':_0x2f2250['context'],'channel':_0x2f2250[_0xdd9e('0xb')],'starttime':utils[_0xdd9e('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xdd9e('0x4'),'amaflags':_0xdd9e('0x1a')};}}catch(_0x4fd2e2){utils[_0xdd9e('0x1b')](util[_0xdd9e('0x8')](_0xdd9e('0x1c'),_0x2f2250[_0xdd9e('0xa')]),_0x4fd2e2);}};exports['newstate']=function(_0x23c698){try{utils[_0xdd9e('0x15')](util[_0xdd9e('0x8')](_0xdd9e('0x1d'),_0x23c698[_0xdd9e('0xa')]),_0x23c698);if(!_['isNil'](channels[_0x23c698[_0xdd9e('0xa')]])&&_0x23c698[_0xdd9e('0x1e')]==0x6){utils[_0xdd9e('0x7')](util[_0xdd9e('0x8')](_0xdd9e('0x1f'),_0x23c698[_0xdd9e('0xa')],_0x23c698[_0xdd9e('0x20')],_0x23c698[_0xdd9e('0xb')]));if(_[_0xdd9e('0x21')](channels[_0x23c698[_0xdd9e('0xa')]]['systemanswertime'])){channels[_0x23c698[_0xdd9e('0xa')]][_0xdd9e('0x22')]=utils[_0xdd9e('0x19')]();}}else if(!_['isNil'](channels[_0x23c698['linkedid']])&&_0x23c698[_0xdd9e('0x1e')]==0x6&&_0x23c698['context']!='transfer'){utils['info'](util[_0xdd9e('0x8')](_0xdd9e('0x23'),_0x23c698[_0xdd9e('0xa')],_0x23c698[_0xdd9e('0x16')],_0x23c698[_0xdd9e('0x20')],_0x23c698['channel']));channels[_0x23c698[_0xdd9e('0x16')]][_0xdd9e('0x10')]=_0x23c698[_0xdd9e('0x10')];channels[_0x23c698['linkedid']][_0xdd9e('0x24')]=_0x23c698[_0xdd9e('0xb')];if(_[_0xdd9e('0x21')](channels[_0x23c698[_0xdd9e('0x16')]][_0xdd9e('0x25')])){channels[_0x23c698['linkedid']][_0xdd9e('0x25')]=utils[_0xdd9e('0x19')]();}channels[_0x23c698[_0xdd9e('0x16')]][_0xdd9e('0x26')]=dispositions[_[_0xdd9e('0x27')](_0x23c698[_0xdd9e('0x1e')])]||_0xdd9e('0x5');}}catch(_0x578c3c){utils['error'](util[_0xdd9e('0x8')](_0xdd9e('0x1d'),_0x23c698[_0xdd9e('0xa')]),_0x578c3c);}};exports[_0xdd9e('0x28')]=function(_0x3e0655){try{if(!_[_0xdd9e('0x21')](channels[_0x3e0655['uniqueid']])){utils['debug'](util[_0xdd9e('0x8')](_0xdd9e('0x29'),_0x3e0655[_0xdd9e('0xa')]),_0x3e0655);if(_[_0xdd9e('0x21')](channels[_0x3e0655[_0xdd9e('0xa')]]['callerid'])){channels[_0x3e0655[_0xdd9e('0xa')]][_0xdd9e('0x2a')]=_0x3e0655[_0xdd9e('0x2b')]+'\x20<'+_0x3e0655[_0xdd9e('0xe')]+'>';}utils[_0xdd9e('0x7')](util[_0xdd9e('0x8')](_0xdd9e('0x2c'),_0x3e0655[_0xdd9e('0xa')],channels[_0x3e0655['uniqueid']][_0xdd9e('0x2a')],_0x3e0655[_0xdd9e('0x2d')]));channels[_0x3e0655[_0xdd9e('0xa')]][_0xdd9e('0x2e')]=utils[_0xdd9e('0x19')]();channels[_0x3e0655['uniqueid']][_0xdd9e('0x2f')]=utils['diffTime'](channels[_0x3e0655['uniqueid']][_0xdd9e('0x2e')],channels[_0x3e0655[_0xdd9e('0xa')]][_0xdd9e('0x30')]);channels[_0x3e0655[_0xdd9e('0xa')]][_0xdd9e('0x31')]=channels[_0x3e0655[_0xdd9e('0xa')]]['answertime']?utils[_0xdd9e('0x32')](channels[_0x3e0655[_0xdd9e('0xa')]][_0xdd9e('0x2e')],channels[_0x3e0655[_0xdd9e('0xa')]]['answertime']):0x0;writeDB(channels[_0x3e0655[_0xdd9e('0xa')]]);}}catch(_0x4129cc){utils[_0xdd9e('0x1b')](util[_0xdd9e('0x8')]('[%s][calls][hangup]',_0x3e0655[_0xdd9e('0xa')]),_0x4129cc);}};exports[_0xdd9e('0x33')]=function(_0x569c1c){try{if(!_[_0xdd9e('0x21')](channels[_0x569c1c[_0xdd9e('0x34')]])){utils[_0xdd9e('0x15')](util[_0xdd9e('0x8')](_0xdd9e('0x35'),_0x569c1c[_0xdd9e('0x36')]),_0x569c1c);if(channels[_0x569c1c['localtwolinkedid']][_0xdd9e('0xb')]==_0x569c1c[_0xdd9e('0x37')]){utils['info'](util[_0xdd9e('0x8')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x569c1c[_0xdd9e('0x36')],_0x569c1c[_0xdd9e('0x34')],_0x569c1c['secondtransfererchannel']));channels[_0x569c1c[_0xdd9e('0x34')]][_0xdd9e('0x24')]=_0x569c1c[_0xdd9e('0x38')];channels[_0x569c1c[_0xdd9e('0x34')]]['userfield']=_0xdd9e('0x39');}else if(channels[_0x569c1c['localtwolinkedid']][_0xdd9e('0xb')]=_0x569c1c[_0xdd9e('0x3a')]){utils[_0xdd9e('0x7')](util[_0xdd9e('0x8')](_0xdd9e('0x3b'),_0x569c1c[_0xdd9e('0x36')],_0x569c1c[_0xdd9e('0x34')],_0x569c1c[_0xdd9e('0x3c')]));channels[_0x569c1c[_0xdd9e('0x34')]][_0xdd9e('0x24')]=_0x569c1c[_0xdd9e('0x3c')];channels[_0x569c1c['localtwolinkedid']][_0xdd9e('0x3d')]=_0xdd9e('0x39');}}}catch(_0x107eca){utils['error'](util[_0xdd9e('0x8')]('[%s][calls][attendedtransfer]',_0x569c1c[_0xdd9e('0x36')]),_0x107eca);}};exports[_0xdd9e('0x3e')]=function(_0x145223){try{if(!_[_0xdd9e('0x21')](channels[_0x145223[_0xdd9e('0xa')]])){utils[_0xdd9e('0x15')](util['format'](_0xdd9e('0x3f'),_0x145223[_0xdd9e('0xa')]),_0x145223);channels[_0x145223['uniqueid']][_0xdd9e('0x40')]=utils['now']();utils[_0xdd9e('0x7')](util['format'](_0xdd9e('0x41'),_0x145223['uniqueid'],channels[_0x145223[_0xdd9e('0xa')]][_0xdd9e('0x40')]));}}catch(_0x5cc8c8){utils['error'](util[_0xdd9e('0x8')](_0xdd9e('0x3f'),_0x145223[_0xdd9e('0xa')]),_0x5cc8c8);}};exports[_0xdd9e('0x42')]=function(_0x229b72){try{if(!_[_0xdd9e('0x21')](channels[_0x229b72[_0xdd9e('0xa')]])){utils[_0xdd9e('0x15')](util['format'](_0xdd9e('0x43'),_0x229b72['uniqueid']),_0x229b72);if(!_[_0xdd9e('0x21')](channels[_0x229b72['uniqueid']][_0xdd9e('0x40')])){channels[_0x229b72[_0xdd9e('0xa')]][_0xdd9e('0x44')]+=utils['diffTime'](utils[_0xdd9e('0x19')](),channels[_0x229b72[_0xdd9e('0xa')]][_0xdd9e('0x40')]);utils[_0xdd9e('0x7')](util[_0xdd9e('0x8')](_0xdd9e('0x45'),_0x229b72[_0xdd9e('0xa')],channels[_0x229b72[_0xdd9e('0xa')]][_0xdd9e('0x44')]));delete channels[_0x229b72[_0xdd9e('0xa')]][_0xdd9e('0x40')];}}}catch(_0x146f72){utils[_0xdd9e('0x1b')](util[_0xdd9e('0x8')](_0xdd9e('0x43'),_0x229b72[_0xdd9e('0xa')]),_0x146f72);}};exports[_0xdd9e('0x46')]=function(_0x4584f7){try{if(!_[_0xdd9e('0x21')](channels[_0x4584f7['uniqueid']])){utils[_0xdd9e('0x15')](util[_0xdd9e('0x8')]('[%s][calls][varset]',_0x4584f7[_0xdd9e('0xa')]),_0x4584f7);if(!_[_0xdd9e('0x21')](_0x4584f7[_0xdd9e('0x47')][_0xdd9e('0x48')])){utils['info'](util[_0xdd9e('0x8')](_0xdd9e('0x49'),_0x4584f7[_0xdd9e('0xa')],_0x4584f7['value']));channels[_0x4584f7['uniqueid']][_0xdd9e('0x4a')]=_0x4584f7[_0xdd9e('0x4b')];}if(!_[_0xdd9e('0x21')](_0x4584f7[_0xdd9e('0x47')][_0xdd9e('0x4c')])){utils[_0xdd9e('0x7')](util[_0xdd9e('0x8')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x4584f7[_0xdd9e('0xa')],_0x4584f7[_0xdd9e('0x4b')]));channels[_0x4584f7['uniqueid']][_0xdd9e('0x4d')]=_0x4584f7[_0xdd9e('0x4b')];channels[_0x4584f7[_0xdd9e('0xa')]][_0xdd9e('0x2a')]='\x22'+_0x4584f7['value']+_0xdd9e('0x4e')+_0x4584f7[_0xdd9e('0x4b')]+'>';}if(!_[_0xdd9e('0x21')](_0x4584f7[_0xdd9e('0x47')][_0xdd9e('0x4f')])||!_[_0xdd9e('0x21')](_0x4584f7['variable']['xmd-callerid'])){utils[_0xdd9e('0x7')](util[_0xdd9e('0x8')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4584f7[_0xdd9e('0xa')],!_['isNil'](_0x4584f7['variable']['xmd-callerid-preview'])?_0xdd9e('0x4f'):_0xdd9e('0x50'),_0x4584f7[_0xdd9e('0x4b')]));channels[_0x4584f7[_0xdd9e('0xa')]][_0xdd9e('0x2a')]=_0x4584f7[_0xdd9e('0x4b')];}if(!_['isNil'](_0x4584f7[_0xdd9e('0x47')]['xmd-queue'])||!_[_0xdd9e('0x21')](_0x4584f7['variable'][_0xdd9e('0x51')])){utils[_0xdd9e('0x7')](util[_0xdd9e('0x8')](_0xdd9e('0x52'),_0x4584f7[_0xdd9e('0xa')],!_[_0xdd9e('0x21')](_0x4584f7['variable']['xmd-queue'])?_0xdd9e('0x53'):_0xdd9e('0x51'),_0x4584f7[_0xdd9e('0x4b')]));channels[_0x4584f7[_0xdd9e('0xa')]][_0xdd9e('0x54')]='Queue';channels[_0x4584f7[_0xdd9e('0xa')]][_0xdd9e('0x55')]=_0x4584f7[_0xdd9e('0x4b')];channels[_0x4584f7[_0xdd9e('0xa')]]['queue']=!![];}if(!_[_0xdd9e('0x21')](_0x4584f7['variable']['xmd-contactid'])){utils[_0xdd9e('0x7')](util[_0xdd9e('0x8')](_0xdd9e('0x56'),_0x4584f7[_0xdd9e('0xa')],_0x4584f7[_0xdd9e('0x4b')]));channels[_0x4584f7['uniqueid']][_0xdd9e('0x57')]=_0x4584f7['value'];}if(!_['isNil'](_0x4584f7[_0xdd9e('0x47')][_0xdd9e('0x58')])){utils[_0xdd9e('0x7')](util[_0xdd9e('0x8')](_0xdd9e('0x59'),_0x4584f7['uniqueid'],_0x4584f7[_0xdd9e('0x4b')]));channels[_0x4584f7['uniqueid']][_0xdd9e('0x5a')]=_0x4584f7['value'];}if(!_[_0xdd9e('0x21')](_0x4584f7['variable'][_0xdd9e('0x5b')])){utils[_0xdd9e('0x7')](util[_0xdd9e('0x8')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x4584f7['uniqueid'],_0x4584f7[_0xdd9e('0x4b')]));channels[_0x4584f7[_0xdd9e('0xa')]][_0xdd9e('0x5c')]=_0x4584f7[_0xdd9e('0x4b')];}if(!_[_0xdd9e('0x21')](_0x4584f7[_0xdd9e('0x47')][_0xdd9e('0x5d')])){utils[_0xdd9e('0x7')](util[_0xdd9e('0x8')](_0xdd9e('0x5e'),_0x4584f7[_0xdd9e('0xa')],_0x4584f7['value']));channels[_0x4584f7[_0xdd9e('0xa')]]['sipcallid']=_0x4584f7['value'];}}}catch(_0x116e52){utils[_0xdd9e('0x1b')](util[_0xdd9e('0x8')](_0xdd9e('0x5f'),_0x4584f7[_0xdd9e('0xa')]),_0x116e52);}};exports[_0xdd9e('0x60')]=function(_0x26e4e5){try{if(!_[_0xdd9e('0x21')](channels[_0x26e4e5[_0xdd9e('0xa')]])){utils['debug'](util[_0xdd9e('0x8')]('[%s][calls][newexten]',_0x26e4e5['uniqueid']),_0x26e4e5);utils[_0xdd9e('0x7')](util[_0xdd9e('0x8')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x26e4e5[_0xdd9e('0xa')],_0x26e4e5['application'],_0x26e4e5[_0xdd9e('0x61')]));if(_0x26e4e5['application'][_0xdd9e('0x62')]()==_0xdd9e('0x63')&&_['startsWith'](_0x26e4e5[_0xdd9e('0x61')][_0xdd9e('0x62')](),'cdr')){var _0x2cbde9=_0x26e4e5[_0xdd9e('0x61')]['split']('=');var _0xd0ee9d=_0x2cbde9[0x0][_0xdd9e('0x64')](_0x2cbde9[0x0][_0xdd9e('0x65')]('(')+0x1,_0x2cbde9[0x0][_0xdd9e('0x65')](')'));var _0x4df1c8=_0x2cbde9[0x1];channels[_0x26e4e5['uniqueid']][_0xd0ee9d]=_0x4df1c8;}if(!_[_0xdd9e('0x66')]([_0xdd9e('0x28'),_0xdd9e('0x67'),_0xdd9e('0x68'),_0xdd9e('0x63'),_0xdd9e('0x69')],_0x26e4e5[_0xdd9e('0x6a')][_0xdd9e('0x62')]())){channels[_0x26e4e5[_0xdd9e('0xa')]][_0xdd9e('0x54')]=_0x26e4e5[_0xdd9e('0x6a')];channels[_0x26e4e5[_0xdd9e('0xa')]][_0xdd9e('0x55')]=_0x26e4e5[_0xdd9e('0x61')];}}}catch(_0x1c1429){utils[_0xdd9e('0x1b')](util['format']('[%s][calls][newexten]',_0x26e4e5[_0xdd9e('0xa')]),_0x1c1429);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 80115f3..8e67531 100644 --- a/server/services/xdr/core.controller.js +++ b/server/services/xdr/core.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9b9=['[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','./utils','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted'];(function(_0x21e422,_0x40e95e){var _0x29faac=function(_0x4cb11e){while(--_0x4cb11e){_0x21e422['push'](_0x21e422['shift']());}};_0x29faac(++_0x40e95e);}(_0xd9b9,0x118));var _0x9d9b=function(_0x246def,_0x8fa95){_0x246def=_0x246def-0x0;var _0x567b57=_0xd9b9[_0x246def];return _0x567b57;};'use strict';var utils=require(_0x9d9b('0x0'));exports['connect']=function(){utils[_0x9d9b('0x1')](_0x9d9b('0x2'));};exports[_0x9d9b('0x3')]=function(){utils[_0x9d9b('0x1')](_0x9d9b('0x4'));};exports[_0x9d9b('0x5')]=function(){utils['info'](_0x9d9b('0x6'));};exports[_0x9d9b('0x7')]=function(_0x5df1ea){utils['error'](_0x9d9b('0x8'),_0x5df1ea);};exports[_0x9d9b('0x9')]=function(){utils['info'](_0x9d9b('0xa'));};exports['managerevent']=function(_0x47fdce){}; \ No newline at end of file +var _0x0c94=['[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','error','[core]\x20error','close'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0x0c94,0x7a));var _0x40c9=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x0c94[_0x278e3c];return _0x3e2d9b;};'use strict';var utils=require(_0x40c9('0x0'));exports[_0x40c9('0x1')]=function(){utils[_0x40c9('0x2')](_0x40c9('0x3'));};exports[_0x40c9('0x4')]=function(){utils[_0x40c9('0x2')](_0x40c9('0x5'));};exports[_0x40c9('0x6')]=function(){utils[_0x40c9('0x2')]('[core]\x20fullybooted');};exports[_0x40c9('0x7')]=function(_0x11f147){utils['error'](_0x40c9('0x8'),_0x11f147);};exports[_0x40c9('0x9')]=function(){utils[_0x40c9('0x2')](_0x40c9('0xa'));};exports[_0x40c9('0xb')]=function(_0x38327f){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index e68584f..c31019f 100644 --- a/server/services/xdr/dials.controller.js +++ b/server/services/xdr/dials.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98ac=['debug','uniqueid','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','cdr(routeid)','error','[%s][dials][newexten]','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','dialend','[%s][dials][dialend]','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','holdtime','billableseconds','endtime','lodash','util','info','format','calleridnum','dialstatus','request','CreateVoiceDialReport','newexten'];(function(_0x4f1e23,_0x166b91){var _0x4354b1=function(_0x1a3b71){while(--_0x1a3b71){_0x4f1e23['push'](_0x4f1e23['shift']());}};_0x4354b1(++_0x166b91);}(_0x98ac,0x81));var _0xc98a=function(_0x162fff,_0x4f6bb2){_0x162fff=_0x162fff-0x0;var _0x4f7aa9=_0x98ac[_0x162fff];return _0x4f7aa9;};'use strict';var _=require(_0xc98a('0x0'));var util=require(_0xc98a('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x219949){utils[_0xc98a('0x2')](util[_0xc98a('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x219949['uniqueid'],_0x219949['channel'],_0x219949['dialstring'],_0x219949[_0xc98a('0x4')],_0x219949['connectedlinenum'],_0x219949[_0xc98a('0x5')]));utils[_0xc98a('0x6')](_0xc98a('0x7'),_0x219949);delete dials[_0x219949['uniqueid']];}exports[_0xc98a('0x8')]=function(_0x2da476){try{utils[_0xc98a('0x9')](util[_0xc98a('0x3')]('[%s][dials][newexten]',_0x2da476[_0xc98a('0xa')]),_0x2da476);utils[_0xc98a('0x2')](util['format'](_0xc98a('0xb'),_0x2da476['uniqueid'],_0x2da476[_0xc98a('0xc')],_0x2da476[_0xc98a('0xd')]));if(_0x2da476[_0xc98a('0xc')]['toLowerCase']()==_0xc98a('0xe')&&_[_0xc98a('0xf')](_0x2da476[_0xc98a('0xd')]['toLowerCase'](),_0xc98a('0x10'))){var _0x10b648=_0x2da476[_0xc98a('0xd')]['split']('=');dials[_0x2da476[_0xc98a('0xa')]]={'routeId':_0x10b648[0x1]};}}catch(_0x19ea48){utils[_0xc98a('0x11')](util[_0xc98a('0x3')](_0xc98a('0x12'),_0x2da476[_0xc98a('0xa')]),_0x19ea48);}};exports[_0xc98a('0x13')]=function(_0x3bdb21){try{utils[_0xc98a('0x9')](util[_0xc98a('0x3')](_0xc98a('0x14'),_0x3bdb21[_0xc98a('0xa')]),_0x3bdb21);if(!_[_0xc98a('0x15')](_0x3bdb21['variable'][_0xc98a('0x16')])){utils[_0xc98a('0x2')](util[_0xc98a('0x3')](_0xc98a('0x17'),_0x3bdb21[_0xc98a('0xa')],_0x3bdb21[_0xc98a('0x18')]));dials[_0x3bdb21[_0xc98a('0xa')]]={'routeId':_0x3bdb21[_0xc98a('0x18')]};}}catch(_0x525ae4){utils[_0xc98a('0x11')](util[_0xc98a('0x3')](_0xc98a('0x14'),_0x3bdb21[_0xc98a('0xa')]),_0x525ae4);}};exports['dialbegin']=function(_0x1a3acd){try{if(!_[_0xc98a('0x15')](dials[_0x1a3acd[_0xc98a('0xa')]])){utils[_0xc98a('0x9')](util['format'](_0xc98a('0x19'),_0x1a3acd['uniqueid']),_0x1a3acd);dials[_0x1a3acd[_0xc98a('0xa')]]=_[_0xc98a('0x1a')](dials[_0x1a3acd['uniqueid']],_0x1a3acd);dials[_0x1a3acd[_0xc98a('0xa')]][_0xc98a('0x1b')]=utils[_0xc98a('0x1c')]();dials[_0x1a3acd[_0xc98a('0xa')]][_0xc98a('0x1d')]=_0xc98a('0x1e');utils[_0xc98a('0x2')](util[_0xc98a('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x1a3acd[_0xc98a('0xa')],dials[_0x1a3acd[_0xc98a('0xa')]][_0xc98a('0x1b')]));}}catch(_0x3d70d7){utils['error'](util[_0xc98a('0x3')](_0xc98a('0x19'),_0x1a3acd['uniqueid']),_0x3d70d7);}};exports[_0xc98a('0x1f')]=function(_0x5774ff){try{if(!_['isNil'](dials[_0x5774ff[_0xc98a('0xa')]])){utils[_0xc98a('0x9')](util[_0xc98a('0x3')](_0xc98a('0x20'),_0x5774ff[_0xc98a('0xa')]),_0x5774ff);dials[_0x5774ff[_0xc98a('0xa')]][_0xc98a('0x5')]=_0x5774ff[_0xc98a('0x5')];if(_0x5774ff[_0xc98a('0x5')]=='ANSWER'){dials[_0x5774ff[_0xc98a('0xa')]]=_[_0xc98a('0x1a')](dials[_0x5774ff[_0xc98a('0xa')]],_0x5774ff);dials[_0x5774ff[_0xc98a('0xa')]]['answertime']=utils['now']();dials[_0x5774ff[_0xc98a('0xa')]]['lastevent']=_0xc98a('0x21');utils[_0xc98a('0x2')](util['format'](_0xc98a('0x22'),_0x5774ff[_0xc98a('0xa')],_0x5774ff[_0xc98a('0x5')],dials[_0x5774ff[_0xc98a('0xa')]][_0xc98a('0x23')]));}else{utils[_0xc98a('0x2')](util[_0xc98a('0x3')](_0xc98a('0x24'),_0x5774ff[_0xc98a('0xa')],_0x5774ff[_0xc98a('0x5')]));}}}catch(_0x12fb0b){utils['error'](util[_0xc98a('0x3')](_0xc98a('0x20'),_0x5774ff[_0xc98a('0xa')]),_0x12fb0b);}};exports['hangup']=function(_0x539013){try{if(!_[_0xc98a('0x15')](dials[_0x539013[_0xc98a('0xa')]])){utils[_0xc98a('0x9')](util[_0xc98a('0x3')](_0xc98a('0x25'),_0x539013[_0xc98a('0xa')]),_0x539013);utils[_0xc98a('0x2')](util[_0xc98a('0x3')](_0xc98a('0x26'),_0x539013[_0xc98a('0xa')],_0x539013[_0xc98a('0x4')],_0x539013['calleridname'],_0x539013[_0xc98a('0x27')]));dials[_0x539013['uniqueid']]=_[_0xc98a('0x1a')](dials[_0x539013[_0xc98a('0xa')]],{'endtime':utils[_0xc98a('0x1c')](),'lastevent':_0xc98a('0x28')});dials[_0x539013[_0xc98a('0xa')]][_0xc98a('0x29')]=utils[_0xc98a('0x2a')](dials[_0x539013[_0xc98a('0xa')]]['endtime'],dials[_0x539013[_0xc98a('0xa')]][_0xc98a('0x1b')]);dials[_0x539013['uniqueid']][_0xc98a('0x2b')]=utils[_0xc98a('0x2a')](dials[_0x539013['uniqueid']][_0xc98a('0x23')]||dials[_0x539013[_0xc98a('0xa')]]['endtime'],dials[_0x539013[_0xc98a('0xa')]][_0xc98a('0x1b')]);dials[_0x539013[_0xc98a('0xa')]][_0xc98a('0x2c')]=dials[_0x539013[_0xc98a('0xa')]]['answertime']?utils[_0xc98a('0x2a')](dials[_0x539013[_0xc98a('0xa')]][_0xc98a('0x2d')],dials[_0x539013[_0xc98a('0xa')]][_0xc98a('0x23')]):0x0;writeDB(dials[_0x539013[_0xc98a('0xa')]]);}}catch(_0xc0a34f){utils[_0xc98a('0x11')](util['format'](_0xc98a('0x25'),_0x539013[_0xc98a('0xa')]),_0xc0a34f);}}; \ No newline at end of file +var _0xab3e=['variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','now','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','format','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','request','newexten','debug','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','toLowerCase','split','error','varset','[%s][dials][varset]'];(function(_0x2eb161,_0x3a845a){var _0x6f28e8=function(_0xac9f00){while(--_0xac9f00){_0x2eb161['push'](_0x2eb161['shift']());}};_0x6f28e8(++_0x3a845a);}(_0xab3e,0xb6));var _0xeab3=function(_0xb09173,_0x4878d9){_0xb09173=_0xb09173-0x0;var _0x110122=_0xab3e[_0xb09173];return _0x110122;};'use strict';var _=require(_0xeab3('0x0'));var util=require(_0xeab3('0x1'));var utils=require(_0xeab3('0x2'));var dials={};function writeDB(_0x4509f9){utils[_0xeab3('0x3')](util[_0xeab3('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x4509f9[_0xeab3('0x5')],_0x4509f9[_0xeab3('0x6')],_0x4509f9['dialstring'],_0x4509f9[_0xeab3('0x7')],_0x4509f9[_0xeab3('0x8')],_0x4509f9[_0xeab3('0x9')]));utils[_0xeab3('0xa')]('CreateVoiceDialReport',_0x4509f9);delete dials[_0x4509f9[_0xeab3('0x5')]];}exports[_0xeab3('0xb')]=function(_0x1e319c){try{utils[_0xeab3('0xc')](util[_0xeab3('0x4')]('[%s][dials][newexten]',_0x1e319c[_0xeab3('0x5')]),_0x1e319c);utils['info'](util[_0xeab3('0x4')](_0xeab3('0xd'),_0x1e319c[_0xeab3('0x5')],_0x1e319c['application'],_0x1e319c[_0xeab3('0xe')]));if(_0x1e319c[_0xeab3('0xf')]['toLowerCase']()==_0xeab3('0x10')&&_['startsWith'](_0x1e319c['appdata'][_0xeab3('0x11')](),'cdr(routeid)')){var _0x1306a4=_0x1e319c['appdata'][_0xeab3('0x12')]('=');dials[_0x1e319c['uniqueid']]={'routeId':_0x1306a4[0x1]};}}catch(_0x15a317){utils[_0xeab3('0x13')](util[_0xeab3('0x4')]('[%s][dials][newexten]',_0x1e319c[_0xeab3('0x5')]),_0x15a317);}};exports[_0xeab3('0x14')]=function(_0x9a140b){try{utils[_0xeab3('0xc')](util[_0xeab3('0x4')](_0xeab3('0x15'),_0x9a140b['uniqueid']),_0x9a140b);if(!_['isNil'](_0x9a140b[_0xeab3('0x16')][_0xeab3('0x17')])){utils['info'](util[_0xeab3('0x4')](_0xeab3('0x18'),_0x9a140b[_0xeab3('0x5')],_0x9a140b[_0xeab3('0x19')]));dials[_0x9a140b['uniqueid']]={'routeId':_0x9a140b['value']};}}catch(_0x5b2135){utils['error'](util['format'](_0xeab3('0x15'),_0x9a140b[_0xeab3('0x5')]),_0x5b2135);}};exports[_0xeab3('0x1a')]=function(_0x1871ff){try{if(!_[_0xeab3('0x1b')](dials[_0x1871ff[_0xeab3('0x5')]])){utils[_0xeab3('0xc')](util[_0xeab3('0x4')](_0xeab3('0x1c'),_0x1871ff[_0xeab3('0x5')]),_0x1871ff);dials[_0x1871ff[_0xeab3('0x5')]]=_[_0xeab3('0x1d')](dials[_0x1871ff['uniqueid']],_0x1871ff);dials[_0x1871ff[_0xeab3('0x5')]][_0xeab3('0x1e')]=utils['now']();dials[_0x1871ff[_0xeab3('0x5')]][_0xeab3('0x1f')]='called';utils[_0xeab3('0x3')](util[_0xeab3('0x4')](_0xeab3('0x20'),_0x1871ff[_0xeab3('0x5')],dials[_0x1871ff[_0xeab3('0x5')]][_0xeab3('0x1e')]));}}catch(_0x321183){utils['error'](util[_0xeab3('0x4')](_0xeab3('0x1c'),_0x1871ff[_0xeab3('0x5')]),_0x321183);}};exports[_0xeab3('0x21')]=function(_0x16d323){try{if(!_[_0xeab3('0x1b')](dials[_0x16d323['uniqueid']])){utils[_0xeab3('0xc')](util[_0xeab3('0x4')](_0xeab3('0x22'),_0x16d323[_0xeab3('0x5')]),_0x16d323);dials[_0x16d323[_0xeab3('0x5')]][_0xeab3('0x9')]=_0x16d323[_0xeab3('0x9')];if(_0x16d323[_0xeab3('0x9')]=='ANSWER'){dials[_0x16d323[_0xeab3('0x5')]]=_[_0xeab3('0x1d')](dials[_0x16d323[_0xeab3('0x5')]],_0x16d323);dials[_0x16d323[_0xeab3('0x5')]]['answertime']=utils['now']();dials[_0x16d323[_0xeab3('0x5')]][_0xeab3('0x1f')]=_0xeab3('0x23');utils[_0xeab3('0x3')](util['format'](_0xeab3('0x24'),_0x16d323['uniqueid'],_0x16d323[_0xeab3('0x9')],dials[_0x16d323[_0xeab3('0x5')]][_0xeab3('0x25')]));}else{utils['info'](util[_0xeab3('0x4')](_0xeab3('0x26'),_0x16d323['uniqueid'],_0x16d323[_0xeab3('0x9')]));}}}catch(_0x1d9537){utils[_0xeab3('0x13')](util['format'](_0xeab3('0x22'),_0x16d323[_0xeab3('0x5')]),_0x1d9537);}};exports[_0xeab3('0x27')]=function(_0x45f5de){try{if(!_[_0xeab3('0x1b')](dials[_0x45f5de[_0xeab3('0x5')]])){utils[_0xeab3('0xc')](util[_0xeab3('0x4')](_0xeab3('0x28'),_0x45f5de['uniqueid']),_0x45f5de);utils[_0xeab3('0x3')](util[_0xeab3('0x4')](_0xeab3('0x29'),_0x45f5de[_0xeab3('0x5')],_0x45f5de['calleridnum'],_0x45f5de[_0xeab3('0x2a')],_0x45f5de[_0xeab3('0x2b')]));dials[_0x45f5de[_0xeab3('0x5')]]=_[_0xeab3('0x1d')](dials[_0x45f5de[_0xeab3('0x5')]],{'endtime':utils[_0xeab3('0x2c')](),'lastevent':_0xeab3('0x2d')});dials[_0x45f5de[_0xeab3('0x5')]][_0xeab3('0x2e')]=utils[_0xeab3('0x2f')](dials[_0x45f5de[_0xeab3('0x5')]][_0xeab3('0x30')],dials[_0x45f5de['uniqueid']][_0xeab3('0x1e')]);dials[_0x45f5de[_0xeab3('0x5')]][_0xeab3('0x31')]=utils[_0xeab3('0x2f')](dials[_0x45f5de['uniqueid']][_0xeab3('0x25')]||dials[_0x45f5de[_0xeab3('0x5')]]['endtime'],dials[_0x45f5de[_0xeab3('0x5')]][_0xeab3('0x1e')]);dials[_0x45f5de[_0xeab3('0x5')]][_0xeab3('0x32')]=dials[_0x45f5de[_0xeab3('0x5')]]['answertime']?utils['diffTime'](dials[_0x45f5de[_0xeab3('0x5')]]['endtime'],dials[_0x45f5de[_0xeab3('0x5')]][_0xeab3('0x25')]):0x0;writeDB(dials[_0x45f5de['uniqueid']]);}}catch(_0x117bf3){utils[_0xeab3('0x13')](util[_0xeab3('0x4')](_0xeab3('0x28'),_0x45f5de['uniqueid']),_0x117bf3);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index bcda2b3..a5b00db 100644 --- a/server/services/xdr/index.js +++ b/server/services/xdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x989a=['device','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','production','local','asterisk','port','username','keepConnected','info','XDR\x20DISABLED','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','devicestatechange'];(function(_0x314085,_0x4235c6){var _0x26190a=function(_0x2314a2){while(--_0x2314a2){_0x314085['push'](_0x314085['shift']());}};_0x26190a(++_0x4235c6);}(_0x989a,0x1be));var _0xa989=function(_0x28c261,_0x3e5f91){_0x28c261=_0x28c261-0x0;var _0x340dbb=_0x989a[_0x28c261];return _0x340dbb;};var AsteriskManager=require(_0xa989('0x0'));var config=require(_0xa989('0x1'));var utils=require(_0xa989('0x2'));var util=require(_0xa989('0x3'));var isXDREnabled=config[_0xa989('0x4')]&&config[_0xa989('0x4')][_0xa989('0x5')]?!config[_0xa989('0x4')][_0xa989('0x5')]:!![];var isProduction=config[_0xa989('0x6')]===_0xa989('0x7')||![];var isLocalAsterisk=config[_0xa989('0x4')]&&config[_0xa989('0x4')][_0xa989('0x8')]===!![]||![];var ami=new AsteriskManager(config[_0xa989('0x9')][_0xa989('0xa')],config[_0xa989('0x9')]['ip'],config['asterisk'][_0xa989('0xb')],config[_0xa989('0x9')]['password'],!![]);ami[_0xa989('0xc')]();if(!isXDREnabled){utils[_0xa989('0xd')](_0xa989('0xe'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xa989('0xd')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require(_0xa989('0xf'));var recordings=require(_0xa989('0x10'));var members=require(_0xa989('0x11'));var dials=require('./dials.controller');var transfers=require(_0xa989('0x12'));var core=require(_0xa989('0x13'));ami['on'](_0xa989('0x14'),core[_0xa989('0x14')]);ami['on'](_0xa989('0x15'),core[_0xa989('0x15')]);ami['on']('fullybooted',core[_0xa989('0x16')]);ami['on']('error',core[_0xa989('0x17')]);ami['on'](_0xa989('0x18'),core[_0xa989('0x18')]);ami['on']('managerevent',core[_0xa989('0x19')]);ami['on']('devicestatechange',function(_0x5ad4aa){try{utils[_0xa989('0x1a')](util[_0xa989('0x1b')](_0xa989('0x1c'),_0x5ad4aa['device']),_0x5ad4aa);members[_0xa989('0x1d')](_0x5ad4aa);}catch(_0x54735a){utils[_0xa989('0x17')](util[_0xa989('0x1b')](_0xa989('0x1c'),_0x5ad4aa[_0xa989('0x1e')]),_0x54735a);}});ami['on'](_0xa989('0x1f'),function(_0x5ee506){try{utils['debug'](util[_0xa989('0x1b')](_0xa989('0x20'),_0x5ee506['uniqueid']),_0x5ee506);agents[_0xa989('0x1f')](_0x5ee506);}catch(_0x4465a7){utils['error'](util[_0xa989('0x1b')](_0xa989('0x20'),_0x5ee506[_0xa989('0x21')]),_0x4465a7);}});ami['on']('agentringnoanswer',function(_0x152938){try{utils['debug'](util['format'](_0xa989('0x22'),_0x152938['uniqueid']),_0x152938);agents[_0xa989('0x23')](_0x152938);}catch(_0x3186ae){utils[_0xa989('0x17')](util[_0xa989('0x1b')]('[%s][index][agentringnoanswer]',_0x152938[_0xa989('0x21')]),_0x3186ae);}});ami['on'](_0xa989('0x24'),function(_0x4ce2de){try{utils['debug'](util[_0xa989('0x1b')]('[%s][index][agentconnect]',_0x4ce2de[_0xa989('0x21')]),_0x4ce2de);agents[_0xa989('0x24')](_0x4ce2de);queues['agentconnect'](_0x4ce2de);}catch(_0x41a90c){utils[_0xa989('0x17')](util['format']('[%s][index][agentconnect]',_0x4ce2de[_0xa989('0x21')]),_0x41a90c);}});ami['on'](_0xa989('0x25'),function(_0x5640e4){try{utils[_0xa989('0x1a')](util[_0xa989('0x1b')]('[%s][index][agentcomplete]',_0x5640e4[_0xa989('0x21')]),_0x5640e4);agents[_0xa989('0x25')](_0x5640e4);queues[_0xa989('0x25')](_0x5640e4);members['agentcomplete'](_0x5640e4);}catch(_0x535b33){utils[_0xa989('0x17')](util['format'](_0xa989('0x26'),_0x5640e4[_0xa989('0x21')]),_0x535b33);}});ami['on']('queuecallerabandon',function(_0x565f0e){try{utils[_0xa989('0x1a')](util[_0xa989('0x1b')](_0xa989('0x27'),_0x565f0e[_0xa989('0x21')]),_0x565f0e);agents[_0xa989('0x28')](_0x565f0e);queues[_0xa989('0x28')](_0x565f0e);}catch(_0x18223f){utils[_0xa989('0x17')](util[_0xa989('0x1b')](_0xa989('0x27'),_0x565f0e[_0xa989('0x21')]),_0x18223f);}});ami['on'](_0xa989('0x29'),function(_0x43f049){try{utils[_0xa989('0x1a')](util[_0xa989('0x1b')](_0xa989('0x2a'),_0x43f049[_0xa989('0x21')]),_0x43f049);queues['queuecallerjoin'](_0x43f049);recordings[_0xa989('0x29')](_0x43f049);}catch(_0x20a74c){utils[_0xa989('0x17')](util['format']('[%s][index][queuecallerjoin]',_0x43f049['uniqueid']),_0x20a74c);}});ami['on'](_0xa989('0x2b'),function(_0x104b26){try{utils[_0xa989('0x1a')](util[_0xa989('0x1b')]('[%s][index][queuecallerleave]',_0x104b26[_0xa989('0x21')]),_0x104b26);queues[_0xa989('0x2b')](_0x104b26);}catch(_0x10862){utils[_0xa989('0x17')](util[_0xa989('0x1b')]('[%s][index][queuecallerleave]',_0x104b26[_0xa989('0x21')]),_0x10862);}});ami['on'](_0xa989('0x2c'),function(_0x5eaad7){try{utils[_0xa989('0x1a')](util['format']('[%s][index][musiconholdstart]',_0x5eaad7[_0xa989('0x21')]),_0x5eaad7);queues[_0xa989('0x2c')](_0x5eaad7);calls[_0xa989('0x2c')](_0x5eaad7);}catch(_0x5ee5f7){utils[_0xa989('0x17')](util[_0xa989('0x1b')](_0xa989('0x2d'),_0x5eaad7['uniqueid']),_0x5ee5f7);}});ami['on'](_0xa989('0x2e'),function(_0x303eb2){try{utils['debug'](util['format'](_0xa989('0x2f'),_0x303eb2[_0xa989('0x21')]),_0x303eb2);queues[_0xa989('0x2e')](_0x303eb2);calls['musiconholdstop'](_0x303eb2);}catch(_0x4d811a){utils[_0xa989('0x17')](util[_0xa989('0x1b')](_0xa989('0x2f'),_0x303eb2[_0xa989('0x21')]),_0x4d811a);}});ami['on'](_0xa989('0x30'),function(_0x56fd09){try{utils['debug'](util[_0xa989('0x1b')]('[%s][index][newstate]',_0x56fd09[_0xa989('0x21')]),_0x56fd09);calls['newstate'](_0x56fd09);recordings[_0xa989('0x30')](_0x56fd09);}catch(_0x788c6e){utils['error'](util['format']('[%s][index][newstate]',_0x56fd09[_0xa989('0x21')]),_0x788c6e);}});ami['on'](_0xa989('0x31'),function(_0xf3b601){try{utils[_0xa989('0x1a')](util[_0xa989('0x1b')](_0xa989('0x32'),_0xf3b601[_0xa989('0x21')]),_0xf3b601);calls[_0xa989('0x31')](_0xf3b601);recordings[_0xa989('0x31')](_0xf3b601);dials[_0xa989('0x31')](_0xf3b601);agents[_0xa989('0x31')](_0xf3b601);queues[_0xa989('0x31')](_0xf3b601);}catch(_0x9c75ec){utils[_0xa989('0x17')](util['format'](_0xa989('0x32'),_0xf3b601['uniqueid']),_0x9c75ec);}});ami['on'](_0xa989('0x33'),function(_0x2246a7){try{utils['debug'](util[_0xa989('0x1b')]('[%s][index][cdr]',_0x2246a7[_0xa989('0x21')]),_0x2246a7);members[_0xa989('0x33')](_0x2246a7);}catch(_0x5b214c){utils[_0xa989('0x17')](util['format'](_0xa989('0x34'),_0x2246a7[_0xa989('0x21')]),_0x5b214c);}});ami['on'](_0xa989('0x35'),function(_0x4e4e6b){try{utils[_0xa989('0x1a')](util[_0xa989('0x1b')]('[%s][index][blindtransfer]',_0x4e4e6b[_0xa989('0x21')]),_0x4e4e6b);queues['blindtransfer'](_0x4e4e6b);agents[_0xa989('0x35')](_0x4e4e6b);transfers[_0xa989('0x35')](_0x4e4e6b);}catch(_0x2c7df6){utils[_0xa989('0x17')](util['format'](_0xa989('0x36'),_0x4e4e6b[_0xa989('0x21')]),_0x2c7df6);}});ami['on'](_0xa989('0x37'),function(_0x2efe8e){try{utils['debug'](util['format']('[%s][index][attendedtransfer]',_0x2efe8e[_0xa989('0x38')]),_0x2efe8e);queues[_0xa989('0x37')](_0x2efe8e);transfers[_0xa989('0x37')](_0x2efe8e);agents[_0xa989('0x37')](_0x2efe8e);calls[_0xa989('0x37')](_0x2efe8e);}catch(_0x575cf7){utils[_0xa989('0x17')](util[_0xa989('0x1b')](_0xa989('0x39'),_0x2efe8e[_0xa989('0x38')]),_0x575cf7);}});ami['on']('varset',function(_0x381b07){try{utils[_0xa989('0x1a')](util[_0xa989('0x1b')](_0xa989('0x3a'),_0x381b07[_0xa989('0x21')]),_0x381b07);queues[_0xa989('0x3b')](_0x381b07);recordings[_0xa989('0x3b')](_0x381b07);calls[_0xa989('0x3b')](_0x381b07);dials[_0xa989('0x3b')](_0x381b07);}catch(_0x182185){utils[_0xa989('0x17')](util[_0xa989('0x1b')](_0xa989('0x3a'),_0x381b07[_0xa989('0x21')]),_0x182185);}});ami['on'](_0xa989('0x3c'),function(_0x172548){try{utils[_0xa989('0x1a')](util[_0xa989('0x1b')]('[%s][index][newexten]',_0x172548[_0xa989('0x21')]),_0x172548);calls[_0xa989('0x3c')](_0x172548);recordings[_0xa989('0x3c')](_0x172548);dials[_0xa989('0x3c')](_0x172548);}catch(_0x5daf56){utils[_0xa989('0x17')](util['format'](_0xa989('0x3d'),_0x172548[_0xa989('0x21')]),_0x5daf56);}});ami['on']('newchannel',function(_0x3f58b4){try{utils[_0xa989('0x1a')](util[_0xa989('0x1b')]('[%s][index][newchannel]',_0x3f58b4[_0xa989('0x21')]),_0x3f58b4);calls[_0xa989('0x3e')](_0x3f58b4);recordings['newchannel'](_0x3f58b4);}catch(_0x2a4f86){utils[_0xa989('0x17')](util[_0xa989('0x1b')](_0xa989('0x3f'),_0x3f58b4['uniqueid']),_0x2a4f86);}});ami['on'](_0xa989('0x40'),function(_0x544813){try{utils[_0xa989('0x1a')](util[_0xa989('0x1b')]('[%s][index][dialbegin]',_0x544813[_0xa989('0x21')]),_0x544813);dials['dialbegin'](_0x544813);}catch(_0x38eca7){utils[_0xa989('0x17')](util[_0xa989('0x1b')](_0xa989('0x41'),_0x544813['uniqueid']),_0x38eca7);}});ami['on'](_0xa989('0x42'),function(_0x4810d1){try{utils['debug'](util['format']('[%s][index][dialend]',_0x4810d1['uniqueid']),_0x4810d1);dials['dialend'](_0x4810d1);}catch(_0x40032e){utils['error'](util[_0xa989('0x1b')](_0xa989('0x43'),_0x4810d1[_0xa989('0x21')]),_0x40032e);}});} \ No newline at end of file +var _0x4ee1=['shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','production','local','port','asterisk','username','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect'];(function(_0x836465,_0x5442ae){var _0x2150ea=function(_0x4f4bc2){while(--_0x4f4bc2){_0x836465['push'](_0x836465['shift']());}};_0x2150ea(++_0x5442ae);}(_0x4ee1,0x108));var _0x14ee=function(_0x484097,_0x7a9ba5){_0x484097=_0x484097-0x0;var _0x106b27=_0x4ee1[_0x484097];return _0x106b27;};var AsteriskManager=require(_0x14ee('0x0'));var config=require(_0x14ee('0x1'));var utils=require(_0x14ee('0x2'));var util=require(_0x14ee('0x3'));var isXDREnabled=config['xdr']&&config[_0x14ee('0x4')][_0x14ee('0x5')]?!config[_0x14ee('0x4')][_0x14ee('0x5')]:!![];var isProduction=config[_0x14ee('0x6')]===_0x14ee('0x7')||![];var isLocalAsterisk=config['xdr']&&config['xdr'][_0x14ee('0x8')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x14ee('0x9')],config[_0x14ee('0xa')]['ip'],config[_0x14ee('0xa')][_0x14ee('0xb')],config[_0x14ee('0xa')]['password'],!![]);ami[_0x14ee('0xc')]();if(!isXDREnabled){utils[_0x14ee('0xd')](_0x14ee('0xe'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x14ee('0xd')](_0x14ee('0xf'));}else{var agents=require(_0x14ee('0x10'));var calls=require(_0x14ee('0x11'));var queues=require(_0x14ee('0x12'));var recordings=require('./recordings.controller');var members=require(_0x14ee('0x13'));var dials=require(_0x14ee('0x14'));var transfers=require(_0x14ee('0x15'));var core=require(_0x14ee('0x16'));ami['on']('connect',core[_0x14ee('0x17')]);ami['on'](_0x14ee('0x18'),core[_0x14ee('0x18')]);ami['on']('fullybooted',core[_0x14ee('0x19')]);ami['on'](_0x14ee('0x1a'),core[_0x14ee('0x1a')]);ami['on'](_0x14ee('0x1b'),core[_0x14ee('0x1b')]);ami['on'](_0x14ee('0x1c'),core['managerevent']);ami['on'](_0x14ee('0x1d'),function(_0x9f10ba){try{utils[_0x14ee('0x1e')](util[_0x14ee('0x1f')](_0x14ee('0x20'),_0x9f10ba[_0x14ee('0x21')]),_0x9f10ba);members[_0x14ee('0x1d')](_0x9f10ba);}catch(_0x1df49c){utils[_0x14ee('0x1a')](util[_0x14ee('0x1f')](_0x14ee('0x20'),_0x9f10ba[_0x14ee('0x21')]),_0x1df49c);}});ami['on'](_0x14ee('0x22'),function(_0x39b0ad){try{utils[_0x14ee('0x1e')](util['format'](_0x14ee('0x23'),_0x39b0ad[_0x14ee('0x24')]),_0x39b0ad);agents['agentcalled'](_0x39b0ad);}catch(_0x3a4ecf){utils['error'](util[_0x14ee('0x1f')](_0x14ee('0x23'),_0x39b0ad[_0x14ee('0x24')]),_0x3a4ecf);}});ami['on']('agentringnoanswer',function(_0x7cd3f4){try{utils[_0x14ee('0x1e')](util[_0x14ee('0x1f')](_0x14ee('0x25'),_0x7cd3f4[_0x14ee('0x24')]),_0x7cd3f4);agents[_0x14ee('0x26')](_0x7cd3f4);}catch(_0x4a86b5){utils[_0x14ee('0x1a')](util['format'](_0x14ee('0x25'),_0x7cd3f4['uniqueid']),_0x4a86b5);}});ami['on'](_0x14ee('0x27'),function(_0x193eba){try{utils[_0x14ee('0x1e')](util[_0x14ee('0x1f')](_0x14ee('0x28'),_0x193eba[_0x14ee('0x24')]),_0x193eba);agents[_0x14ee('0x27')](_0x193eba);queues[_0x14ee('0x27')](_0x193eba);}catch(_0x2113a4){utils['error'](util[_0x14ee('0x1f')](_0x14ee('0x28'),_0x193eba[_0x14ee('0x24')]),_0x2113a4);}});ami['on']('agentcomplete',function(_0x9e62e2){try{utils[_0x14ee('0x1e')](util['format']('[%s][index][agentcomplete]',_0x9e62e2['uniqueid']),_0x9e62e2);agents['agentcomplete'](_0x9e62e2);queues[_0x14ee('0x29')](_0x9e62e2);members[_0x14ee('0x29')](_0x9e62e2);}catch(_0x3dcdb5){utils[_0x14ee('0x1a')](util[_0x14ee('0x1f')]('[%s][index][agentcomplete]',_0x9e62e2[_0x14ee('0x24')]),_0x3dcdb5);}});ami['on'](_0x14ee('0x2a'),function(_0x38c453){try{utils[_0x14ee('0x1e')](util[_0x14ee('0x1f')]('[%s][index][queuecallerabandon]',_0x38c453[_0x14ee('0x24')]),_0x38c453);agents[_0x14ee('0x2a')](_0x38c453);queues[_0x14ee('0x2a')](_0x38c453);}catch(_0x3bca7a){utils[_0x14ee('0x1a')](util[_0x14ee('0x1f')]('[%s][index][queuecallerabandon]',_0x38c453[_0x14ee('0x24')]),_0x3bca7a);}});ami['on'](_0x14ee('0x2b'),function(_0x2157a4){try{utils[_0x14ee('0x1e')](util[_0x14ee('0x1f')](_0x14ee('0x2c'),_0x2157a4[_0x14ee('0x24')]),_0x2157a4);queues['queuecallerjoin'](_0x2157a4);recordings['queuecallerjoin'](_0x2157a4);}catch(_0x22e5a6){utils[_0x14ee('0x1a')](util['format'](_0x14ee('0x2c'),_0x2157a4['uniqueid']),_0x22e5a6);}});ami['on']('queuecallerleave',function(_0x5869bc){try{utils[_0x14ee('0x1e')](util['format'](_0x14ee('0x2d'),_0x5869bc[_0x14ee('0x24')]),_0x5869bc);queues[_0x14ee('0x2e')](_0x5869bc);}catch(_0x4d2e14){utils[_0x14ee('0x1a')](util[_0x14ee('0x1f')](_0x14ee('0x2d'),_0x5869bc[_0x14ee('0x24')]),_0x4d2e14);}});ami['on'](_0x14ee('0x2f'),function(_0x1fce12){try{utils[_0x14ee('0x1e')](util[_0x14ee('0x1f')](_0x14ee('0x30'),_0x1fce12[_0x14ee('0x24')]),_0x1fce12);queues['musiconholdstart'](_0x1fce12);calls[_0x14ee('0x2f')](_0x1fce12);}catch(_0x156e60){utils[_0x14ee('0x1a')](util['format'](_0x14ee('0x30'),_0x1fce12[_0x14ee('0x24')]),_0x156e60);}});ami['on'](_0x14ee('0x31'),function(_0x4956a0){try{utils[_0x14ee('0x1e')](util[_0x14ee('0x1f')]('[%s][index][musiconholdstop]',_0x4956a0[_0x14ee('0x24')]),_0x4956a0);queues[_0x14ee('0x31')](_0x4956a0);calls[_0x14ee('0x31')](_0x4956a0);}catch(_0xa459e2){utils['error'](util['format'](_0x14ee('0x32'),_0x4956a0[_0x14ee('0x24')]),_0xa459e2);}});ami['on'](_0x14ee('0x33'),function(_0x1db4cd){try{utils[_0x14ee('0x1e')](util['format']('[%s][index][newstate]',_0x1db4cd['uniqueid']),_0x1db4cd);calls[_0x14ee('0x33')](_0x1db4cd);recordings['newstate'](_0x1db4cd);}catch(_0x4f432f){utils['error'](util[_0x14ee('0x1f')](_0x14ee('0x34'),_0x1db4cd[_0x14ee('0x24')]),_0x4f432f);}});ami['on']('hangup',function(_0x28920d){try{utils['debug'](util[_0x14ee('0x1f')](_0x14ee('0x35'),_0x28920d[_0x14ee('0x24')]),_0x28920d);calls[_0x14ee('0x36')](_0x28920d);recordings['hangup'](_0x28920d);dials['hangup'](_0x28920d);agents['hangup'](_0x28920d);queues['hangup'](_0x28920d);}catch(_0x42a639){utils[_0x14ee('0x1a')](util[_0x14ee('0x1f')](_0x14ee('0x35'),_0x28920d[_0x14ee('0x24')]),_0x42a639);}});ami['on'](_0x14ee('0x37'),function(_0x55d815){try{utils[_0x14ee('0x1e')](util[_0x14ee('0x1f')](_0x14ee('0x38'),_0x55d815[_0x14ee('0x24')]),_0x55d815);members['cdr'](_0x55d815);}catch(_0x45e6b5){utils[_0x14ee('0x1a')](util[_0x14ee('0x1f')](_0x14ee('0x38'),_0x55d815[_0x14ee('0x24')]),_0x45e6b5);}});ami['on'](_0x14ee('0x39'),function(_0x146d9e){try{utils[_0x14ee('0x1e')](util['format'](_0x14ee('0x3a'),_0x146d9e[_0x14ee('0x24')]),_0x146d9e);queues['blindtransfer'](_0x146d9e);agents[_0x14ee('0x39')](_0x146d9e);transfers[_0x14ee('0x39')](_0x146d9e);}catch(_0x197d5f){utils[_0x14ee('0x1a')](util[_0x14ee('0x1f')](_0x14ee('0x3a'),_0x146d9e['uniqueid']),_0x197d5f);}});ami['on'](_0x14ee('0x3b'),function(_0x1ea408){try{utils['debug'](util[_0x14ee('0x1f')](_0x14ee('0x3c'),_0x1ea408[_0x14ee('0x3d')]),_0x1ea408);queues['attendedtransfer'](_0x1ea408);transfers[_0x14ee('0x3b')](_0x1ea408);agents[_0x14ee('0x3b')](_0x1ea408);calls[_0x14ee('0x3b')](_0x1ea408);}catch(_0x142b7a){utils[_0x14ee('0x1a')](util[_0x14ee('0x1f')](_0x14ee('0x3c'),_0x1ea408['origtransfereruniqueid']),_0x142b7a);}});ami['on'](_0x14ee('0x3e'),function(_0xf72747){try{utils[_0x14ee('0x1e')](util[_0x14ee('0x1f')]('[%s][index][varset]',_0xf72747[_0x14ee('0x24')]),_0xf72747);queues['varset'](_0xf72747);recordings[_0x14ee('0x3e')](_0xf72747);calls['varset'](_0xf72747);dials['varset'](_0xf72747);}catch(_0x13c9b7){utils[_0x14ee('0x1a')](util[_0x14ee('0x1f')](_0x14ee('0x3f'),_0xf72747['uniqueid']),_0x13c9b7);}});ami['on'](_0x14ee('0x40'),function(_0x11ac46){try{utils[_0x14ee('0x1e')](util['format']('[%s][index][newexten]',_0x11ac46['uniqueid']),_0x11ac46);calls['newexten'](_0x11ac46);recordings['newexten'](_0x11ac46);dials['newexten'](_0x11ac46);}catch(_0x26793c){utils[_0x14ee('0x1a')](util['format'](_0x14ee('0x41'),_0x11ac46[_0x14ee('0x24')]),_0x26793c);}});ami['on'](_0x14ee('0x42'),function(_0x5e73da){try{utils[_0x14ee('0x1e')](util[_0x14ee('0x1f')](_0x14ee('0x43'),_0x5e73da[_0x14ee('0x24')]),_0x5e73da);calls[_0x14ee('0x42')](_0x5e73da);recordings[_0x14ee('0x42')](_0x5e73da);}catch(_0x38a45f){utils['error'](util[_0x14ee('0x1f')](_0x14ee('0x43'),_0x5e73da[_0x14ee('0x24')]),_0x38a45f);}});ami['on']('dialbegin',function(_0xf9b33b){try{utils[_0x14ee('0x1e')](util[_0x14ee('0x1f')]('[%s][index][dialbegin]',_0xf9b33b[_0x14ee('0x24')]),_0xf9b33b);dials[_0x14ee('0x44')](_0xf9b33b);}catch(_0x118e66){utils[_0x14ee('0x1a')](util['format'](_0x14ee('0x45'),_0xf9b33b[_0x14ee('0x24')]),_0x118e66);}});ami['on'](_0x14ee('0x46'),function(_0x1090a0){try{utils['debug'](util[_0x14ee('0x1f')]('[%s][index][dialend]',_0x1090a0[_0x14ee('0x24')]),_0x1090a0);dials['dialend'](_0x1090a0);}catch(_0x174b19){utils[_0x14ee('0x1a')](util['format'](_0x14ee('0x47'),_0x1090a0[_0x14ee('0x24')]),_0x174b19);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index fff0663..cd9626d 100644 --- a/server/services/xdr/members.controller.js +++ b/server/services/xdr/members.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61ee=['device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','TALKING','now','NOT_INUSE','isNil','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','queue','cdr','channel','split','data1','source','data3','exitAt','destinationchannel','assign','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','./utils','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','data2','membername','type','getUserByInterface','interface','internal','CreateMemberReport','getUserByName','then','name','request','catch','error','format','uniqueid','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]'];(function(_0x586c6c,_0x52d41b){var _0x1f70c6=function(_0x3fcb94){while(--_0x3fcb94){_0x586c6c['push'](_0x586c6c['shift']());}};_0x1f70c6(++_0x52d41b);}(_0x61ee,0x1ba));var _0xe61e=function(_0x2298f0,_0x3bbf4f){_0x2298f0=_0x2298f0-0x0;var _0x39b136=_0x61ee[_0x2298f0];return _0x39b136;};'use strict';var _=require(_0xe61e('0x0'));var util=require('util');var utils=require(_0xe61e('0x1'));var members={};var exclude=[_0xe61e('0x2'),_0xe61e('0x3')];function writeDB(_0x15595a){utils[_0xe61e('0x4')](util['format'](_0xe61e('0x5'),_0x15595a['uniqueid'],_0x15595a['interface'],_0x15595a['channel'],_0x15595a[_0xe61e('0x6')],_0x15595a[_0xe61e('0x7')],_0x15595a[_0xe61e('0x8')]));if(_0x15595a['interface']){utils[_0xe61e('0x9')](_0x15595a[_0xe61e('0xa')])['then'](function(_0xe807f3){if(_0xe807f3){_0x15595a[_0xe61e('0x7')]=_0xe807f3['name'];_0x15595a[_0xe61e('0xb')]=_0xe807f3[_0xe61e('0xb')];utils['request'](_0xe61e('0xc'),_0x15595a);}else{utils[_0xe61e('0xd')](_0x15595a[_0xe61e('0xa')]['split']('/')[0x1])[_0xe61e('0xe')](function(_0x357e4f){if(_0x357e4f){_0x15595a[_0xe61e('0x7')]=_0x357e4f[_0xe61e('0xf')];_0x15595a[_0xe61e('0xb')]=_0x357e4f[_0xe61e('0xb')];utils[_0xe61e('0x10')](_0xe61e('0xc'),_0x15595a);}});}})[_0xe61e('0x11')](function(_0x4a18ca){utils[_0xe61e('0x12')](util[_0xe61e('0x13')]('[%s][members][writeDB]',_0x15595a[_0xe61e('0x14')]),_0x4a18ca);});}delete members[_0x15595a[_0xe61e('0xa')]];}function startsWith(_0x13a8f5,_0x45b8d4){return _[_0xe61e('0x15')](_0x13a8f5,function(_0x218ce4){return _[_0xe61e('0x16')](_0x45b8d4,_0x218ce4);});}exports[_0xe61e('0x17')]=function(_0x493620){try{utils[_0xe61e('0x18')](util['format'](_0xe61e('0x19'),members[_0x493620[_0xe61e('0x1a')]]?members[_0x493620['device']]['uniqueid']:_0x493620[_0xe61e('0x1a')]),_0x493620);utils['info'](util['format'](_0xe61e('0x1b'),members[_0x493620[_0xe61e('0x1a')]]?members[_0x493620['device']]['uniqueid']:_0x493620[_0xe61e('0x1a')],_0x493620['state'],_0x493620[_0xe61e('0x1a')]));switch(_0x493620[_0xe61e('0x1c')]){case'INUSE':case _0xe61e('0x1d'):if(!startsWith(exclude,_0x493620[_0xe61e('0x1a')])){members[_0x493620[_0xe61e('0x1a')]]={'channel':_0xe61e('0x1e'),'interface':_0x493620[_0xe61e('0x1a')],'type':_0xe61e('0x1f'),'enterAt':utils[_0xe61e('0x20')](),'role':'agent'};}break;case _0xe61e('0x21'):if(!_[_0xe61e('0x22')](members[_0x493620[_0xe61e('0x1a')]])){members[_0x493620[_0xe61e('0x1a')]]['exitAt']=utils[_0xe61e('0x20')]();members[_0x493620['device']][_0xe61e('0x23')]=utils[_0xe61e('0x24')](members[_0x493620[_0xe61e('0x1a')]]['exitAt'],members[_0x493620[_0xe61e('0x1a')]][_0xe61e('0x25')]);if(members[_0x493620[_0xe61e('0x1a')]][_0xe61e('0x14')]){writeDB(members[_0x493620[_0xe61e('0x1a')]]);}}break;default:break;}}catch(_0x1dc2e0){utils[_0xe61e('0x12')](util['format'](_0xe61e('0x19'),members[_0x493620[_0xe61e('0x1a')]]?members[_0x493620[_0xe61e('0x1a')]]['uniqueid']:_0x493620[_0xe61e('0x1a')]),_0x1dc2e0);}};exports[_0xe61e('0x26')]=function(_0x2c8bd1){try{if(!_[_0xe61e('0x22')](members[_0x2c8bd1[_0xe61e('0xa')]])){utils[_0xe61e('0x18')](util[_0xe61e('0x13')](_0xe61e('0x27'),_0x2c8bd1[_0xe61e('0x14')]),_0x2c8bd1);utils[_0xe61e('0x4')](util[_0xe61e('0x13')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x2c8bd1[_0xe61e('0x14')],_0x2c8bd1[_0xe61e('0xa')],_0x2c8bd1[_0xe61e('0x28')]));members[_0x2c8bd1['interface']]=_['assign'](members[_0x2c8bd1[_0xe61e('0xa')]],{'data4':_0x2c8bd1[_0xe61e('0x28')],'uniqueid':_0x2c8bd1[_0xe61e('0x14')]});}}catch(_0x4b18eb){utils[_0xe61e('0x12')](util[_0xe61e('0x13')]('[%s][members][agentcomplete]',_0x2c8bd1[_0xe61e('0x14')]),_0x4b18eb);}};exports[_0xe61e('0x29')]=function(_0x2fb563){try{utils[_0xe61e('0x18')](util[_0xe61e('0x13')]('[%s][members][cdr]',_0x2fb563[_0xe61e('0x14')]),_0x2fb563);if(_0x2fb563[_0xe61e('0x2a')]){var _0x27aace=_0x2fb563['channel'][_0xe61e('0x2b')]('-')[0x0];if(!_[_0xe61e('0x22')](members[_0x27aace])){members[_0x27aace]=_['assign'](members[_0x27aace],{'data1':members[_0x27aace][_0xe61e('0x2c')]||_0x2fb563[_0xe61e('0x8')],'data2':members[_0x27aace][_0xe61e('0x6')]||_0x2fb563[_0xe61e('0x2d')],'data3':members[_0x27aace][_0xe61e('0x2e')]||_0x2fb563['destination'],'uniqueid':members[_0x27aace]['uniqueid']||_0x2fb563['uniqueid']});utils['info'](util[_0xe61e('0x13')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x2fb563[_0xe61e('0x14')],members[_0x27aace]['data1'],members[_0x27aace][_0xe61e('0x6')],members[_0x27aace][_0xe61e('0x2e')]));if(members[_0x27aace][_0xe61e('0x2f')]){writeDB(members[_0x27aace]);}}}if(_0x2fb563[_0xe61e('0x30')]){var _0x3a4ac3=_0x2fb563[_0xe61e('0x30')][_0xe61e('0x2b')]('-')[0x0];if(!_[_0xe61e('0x22')](members[_0x3a4ac3])){members[_0x3a4ac3]=_[_0xe61e('0x31')](members[_0x3a4ac3],{'data1':members[_0x3a4ac3][_0xe61e('0x2c')]||_0x2fb563['type'],'data2':members[_0x3a4ac3]['data2']||_0x2fb563[_0xe61e('0x2d')],'data3':members[_0x3a4ac3]['data3']||_0x2fb563[_0xe61e('0x32')],'uniqueid':members[_0x3a4ac3]['uniqueid']||_0x2fb563[_0xe61e('0x14')]});utils['info'](util['format'](_0xe61e('0x33'),_0x2fb563['uniqueid'],members[_0x3a4ac3][_0xe61e('0x2c')],members[_0x3a4ac3][_0xe61e('0x6')],members[_0x3a4ac3][_0xe61e('0x2e')]));if(members[_0x3a4ac3][_0xe61e('0x2f')]){writeDB(members[_0x3a4ac3]);}}}}catch(_0xcf1fb4){utils['error'](util[_0xe61e('0x13')]('[%s][members][cdr]',_0x2fb563[_0xe61e('0x14')]),_0xcf1fb4);}}; \ No newline at end of file +var _0xd433=['Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','type','getUserByInterface','membername','name','internal','request','CreateMemberReport','then','catch','error','[%s][members][writeDB]','some','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','diffTime','exitAt','enterAt','agentcomplete','[%s][members][agentcomplete]','assign','queue','cdr','split','data1','source','data3','destination','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','[%s][members][cdr]','lodash','util','Local/_attended@transfer'];(function(_0x4ca160,_0x14886c){var _0x303ae9=function(_0xa1d94c){while(--_0xa1d94c){_0x4ca160['push'](_0x4ca160['shift']());}};_0x303ae9(++_0x14886c);}(_0xd433,0x1c8));var _0x3d43=function(_0x63c9d4,_0x24cf44){_0x63c9d4=_0x63c9d4-0x0;var _0xc367cc=_0xd433[_0x63c9d4];return _0xc367cc;};'use strict';var _=require(_0x3d43('0x0'));var util=require(_0x3d43('0x1'));var utils=require('./utils');var members={};var exclude=[_0x3d43('0x2'),_0x3d43('0x3')];function writeDB(_0x9c4670){utils[_0x3d43('0x4')](util[_0x3d43('0x5')](_0x3d43('0x6'),_0x9c4670[_0x3d43('0x7')],_0x9c4670[_0x3d43('0x8')],_0x9c4670[_0x3d43('0x9')],_0x9c4670[_0x3d43('0xa')],_0x9c4670['membername'],_0x9c4670[_0x3d43('0xb')]));if(_0x9c4670[_0x3d43('0x8')]){utils[_0x3d43('0xc')](_0x9c4670[_0x3d43('0x8')])['then'](function(_0x16f08d){if(_0x16f08d){_0x9c4670[_0x3d43('0xd')]=_0x16f08d[_0x3d43('0xe')];_0x9c4670[_0x3d43('0xf')]=_0x16f08d[_0x3d43('0xf')];utils[_0x3d43('0x10')](_0x3d43('0x11'),_0x9c4670);}else{utils['getUserByName'](_0x9c4670['interface']['split']('/')[0x1])[_0x3d43('0x12')](function(_0x12fc91){if(_0x12fc91){_0x9c4670[_0x3d43('0xd')]=_0x12fc91['name'];_0x9c4670[_0x3d43('0xf')]=_0x12fc91[_0x3d43('0xf')];utils[_0x3d43('0x10')](_0x3d43('0x11'),_0x9c4670);}});}})[_0x3d43('0x13')](function(_0x24ade1){utils[_0x3d43('0x14')](util[_0x3d43('0x5')](_0x3d43('0x15'),_0x9c4670['uniqueid']),_0x24ade1);});}delete members[_0x9c4670[_0x3d43('0x8')]];}function startsWith(_0x112c27,_0x3c15ab){return _[_0x3d43('0x16')](_0x112c27,function(_0x478ce0){return _['startsWith'](_0x3c15ab,_0x478ce0);});}exports['devicestatechange']=function(_0x429478){try{utils[_0x3d43('0x17')](util[_0x3d43('0x5')](_0x3d43('0x18'),members[_0x429478[_0x3d43('0x19')]]?members[_0x429478['device']][_0x3d43('0x7')]:_0x429478[_0x3d43('0x19')]),_0x429478);utils['info'](util[_0x3d43('0x5')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x429478[_0x3d43('0x19')]]?members[_0x429478['device']]['uniqueid']:_0x429478[_0x3d43('0x19')],_0x429478['state'],_0x429478[_0x3d43('0x19')]));switch(_0x429478[_0x3d43('0x1a')]){case _0x3d43('0x1b'):case _0x3d43('0x1c'):if(!startsWith(exclude,_0x429478[_0x3d43('0x19')])){members[_0x429478[_0x3d43('0x19')]]={'channel':_0x3d43('0x1d'),'interface':_0x429478[_0x3d43('0x19')],'type':_0x3d43('0x1e'),'enterAt':utils[_0x3d43('0x1f')](),'role':_0x3d43('0x20')};}break;case _0x3d43('0x21'):if(!_[_0x3d43('0x22')](members[_0x429478[_0x3d43('0x19')]])){members[_0x429478['device']]['exitAt']=utils['now']();members[_0x429478[_0x3d43('0x19')]]['duration']=utils[_0x3d43('0x23')](members[_0x429478[_0x3d43('0x19')]][_0x3d43('0x24')],members[_0x429478[_0x3d43('0x19')]][_0x3d43('0x25')]);if(members[_0x429478[_0x3d43('0x19')]][_0x3d43('0x7')]){writeDB(members[_0x429478[_0x3d43('0x19')]]);}}break;default:break;}}catch(_0x4616cf){utils['error'](util[_0x3d43('0x5')](_0x3d43('0x18'),members[_0x429478['device']]?members[_0x429478['device']][_0x3d43('0x7')]:_0x429478['device']),_0x4616cf);}};exports[_0x3d43('0x26')]=function(_0x1a5093){try{if(!_['isNil'](members[_0x1a5093['interface']])){utils['debug'](util['format'](_0x3d43('0x27'),_0x1a5093[_0x3d43('0x7')]),_0x1a5093);utils[_0x3d43('0x4')](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x1a5093[_0x3d43('0x7')],_0x1a5093['interface'],_0x1a5093['queue']));members[_0x1a5093[_0x3d43('0x8')]]=_[_0x3d43('0x28')](members[_0x1a5093[_0x3d43('0x8')]],{'data4':_0x1a5093[_0x3d43('0x29')],'uniqueid':_0x1a5093[_0x3d43('0x7')]});}}catch(_0x2bcabc){utils['error'](util[_0x3d43('0x5')](_0x3d43('0x27'),_0x1a5093[_0x3d43('0x7')]),_0x2bcabc);}};exports[_0x3d43('0x2a')]=function(_0x30c8a1){try{utils['debug'](util[_0x3d43('0x5')]('[%s][members][cdr]',_0x30c8a1['uniqueid']),_0x30c8a1);if(_0x30c8a1[_0x3d43('0x9')]){var _0x1a7047=_0x30c8a1[_0x3d43('0x9')][_0x3d43('0x2b')]('-')[0x0];if(!_[_0x3d43('0x22')](members[_0x1a7047])){members[_0x1a7047]=_[_0x3d43('0x28')](members[_0x1a7047],{'data1':members[_0x1a7047][_0x3d43('0x2c')]||_0x30c8a1['type'],'data2':members[_0x1a7047][_0x3d43('0xa')]||_0x30c8a1[_0x3d43('0x2d')],'data3':members[_0x1a7047][_0x3d43('0x2e')]||_0x30c8a1[_0x3d43('0x2f')],'uniqueid':members[_0x1a7047][_0x3d43('0x7')]||_0x30c8a1[_0x3d43('0x7')]});utils['info'](util[_0x3d43('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x30c8a1[_0x3d43('0x7')],members[_0x1a7047]['data1'],members[_0x1a7047][_0x3d43('0xa')],members[_0x1a7047][_0x3d43('0x2e')]));if(members[_0x1a7047][_0x3d43('0x24')]){writeDB(members[_0x1a7047]);}}}if(_0x30c8a1[_0x3d43('0x30')]){var _0x4aa6c2=_0x30c8a1[_0x3d43('0x30')]['split']('-')[0x0];if(!_[_0x3d43('0x22')](members[_0x4aa6c2])){members[_0x4aa6c2]=_[_0x3d43('0x28')](members[_0x4aa6c2],{'data1':members[_0x4aa6c2]['data1']||_0x30c8a1[_0x3d43('0xb')],'data2':members[_0x4aa6c2]['data2']||_0x30c8a1[_0x3d43('0x2d')],'data3':members[_0x4aa6c2][_0x3d43('0x2e')]||_0x30c8a1[_0x3d43('0x2f')],'uniqueid':members[_0x4aa6c2][_0x3d43('0x7')]||_0x30c8a1['uniqueid']});utils[_0x3d43('0x4')](util[_0x3d43('0x5')](_0x3d43('0x31'),_0x30c8a1[_0x3d43('0x7')],members[_0x4aa6c2]['data1'],members[_0x4aa6c2][_0x3d43('0xa')],members[_0x4aa6c2][_0x3d43('0x2e')]));if(members[_0x4aa6c2]['exitAt']){writeDB(members[_0x4aa6c2]);}}}}catch(_0x3e14f5){utils[_0x3d43('0x14')](util[_0x3d43('0x5')](_0x3d43('0x32'),_0x30c8a1[_0x3d43('0x7')]),_0x3e14f5);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 6a42b94..66684a5 100644 --- a/server/services/xdr/queues.controller.js +++ b/server/services/xdr/queues.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d65=['ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridnum','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','musiconholdstartAt','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','name','debug','[%s][queues][varset]','variable','queuestatus','toUpperCase','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','error','agentconnect','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x9d65,0x14a));var _0x59d6=function(_0x5ef861,_0x9af9ab){_0x5ef861=_0x5ef861-0x0;var _0x575e0e=_0x9d65[_0x5ef861];return _0x575e0e;};'use strict';var _=require(_0x59d6('0x0'));var util=require(_0x59d6('0x1'));var utils=require(_0x59d6('0x2'));var queues={};function writeDB(_0x577abb){utils[_0x59d6('0x3')](util[_0x59d6('0x4')](_0x59d6('0x5'),_0x577abb[_0x59d6('0x6')],_0x577abb[_0x59d6('0x7')],_0x577abb[_0x59d6('0x8')],_0x577abb[_0x59d6('0x9')],_0x577abb['calleridnum'],_0x577abb[_0x59d6('0xa')],_0x577abb[_0x59d6('0xb')]));if(_0x577abb[_0x59d6('0x8')]){utils[_0x59d6('0xc')](_0x577abb[_0x59d6('0x8')])[_0x59d6('0xd')](function(_0x4733bd){if(_0x4733bd){_0x577abb['type']=_0x4733bd[_0x59d6('0xe')];}utils[_0x59d6('0xf')]('CreateVoiceQueueReport',_0x577abb);});}else{utils[_0x59d6('0xf')](_0x59d6('0x10'),_0x577abb);}if(_0x577abb['transfereduniqueid']){delete queues[_0x577abb[_0x59d6('0x11')]];}else{delete queues[_0x577abb[_0x59d6('0x6')]];}}exports['queuecallerjoin']=function(_0x4c79b4){try{utils['debug'](util[_0x59d6('0x4')](_0x59d6('0x12'),_0x4c79b4[_0x59d6('0x6')]),_0x4c79b4);utils[_0x59d6('0x3')](util[_0x59d6('0x4')](_0x59d6('0x13'),_0x4c79b4[_0x59d6('0x6')],_0x4c79b4[_0x59d6('0x8')],_0x4c79b4[_0x59d6('0x14')]));queues[_0x4c79b4[_0x59d6('0x6')]]=_[_0x59d6('0x15')](_0x4c79b4,{'originalposition':_0x4c79b4[_0x59d6('0x14')],'queuecallerjoinAt':utils[_0x59d6('0x16')](),'mohtime':0x0});}catch(_0x378e5b){utils['error'](util[_0x59d6('0x4')]('[%s][queues][queuecallerjoin]',_0x4c79b4[_0x59d6('0x6')]),_0x378e5b);}};exports[_0x59d6('0x17')]=function(_0x3e385f){try{if(!_[_0x59d6('0x18')](queues[_0x3e385f['uniqueid']])){utils['debug'](util[_0x59d6('0x4')](_0x59d6('0x19'),_0x3e385f['uniqueid']),_0x3e385f);if(queues[_0x3e385f[_0x59d6('0x6')]][_0x59d6('0x1a')]){if(!queues[_0x3e385f[_0x59d6('0x6')]][_0x59d6('0x1b')]&&!queues[_0x3e385f['uniqueid']]['queuecallerexit']){queues[_0x3e385f[_0x59d6('0x6')]]['queuecallercomplete']=!![];queues[_0x3e385f['uniqueid']]['queuecallercompleteAt']=utils[_0x59d6('0x16')]();queues[_0x3e385f[_0x59d6('0x6')]][_0x59d6('0xb')]='COMPLETEDBYAGENT';}utils[_0x59d6('0x3')](util[_0x59d6('0x4')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x3e385f['uniqueid'],queues[_0x3e385f['uniqueid']][_0x59d6('0x1c')],queues[_0x3e385f['uniqueid']][_0x59d6('0xb')]));writeDB(queues[_0x3e385f[_0x59d6('0x6')]]);}else if(queues[_0x3e385f[_0x59d6('0x6')]][_0x59d6('0x11')]){utils[_0x59d6('0x3')](util[_0x59d6('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x3e385f['uniqueid'],queues[_0x3e385f[_0x59d6('0x6')]][_0x59d6('0x1c')],queues[_0x3e385f[_0x59d6('0x6')]][_0x59d6('0x11')]));queues[queues[_0x3e385f[_0x59d6('0x6')]][_0x59d6('0x11')]]=queues[_0x3e385f[_0x59d6('0x6')]];queues[queues[_0x3e385f[_0x59d6('0x6')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x3e385f[_0x59d6('0x6')]];}}}catch(_0x24da47){utils['error'](util[_0x59d6('0x4')](_0x59d6('0x19'),_0x3e385f['uniqueid']),_0x24da47);}};exports['varset']=function(_0x4720ff){try{utils[_0x59d6('0x1d')](util[_0x59d6('0x4')](_0x59d6('0x1e'),_0x4720ff[_0x59d6('0x6')]),_0x4720ff);if(!_['isNil'](_0x4720ff[_0x59d6('0x1f')][_0x59d6('0x20')])&&_0x4720ff['value'][_0x59d6('0x21')]()!=='CONTINUE'){if(!_[_0x59d6('0x18')](queues[_0x4720ff[_0x59d6('0x6')]])){queues[_0x4720ff['uniqueid']][_0x59d6('0x1b')]=![];queues[_0x4720ff[_0x59d6('0x6')]][_0x59d6('0x22')]=null;queues[_0x4720ff[_0x59d6('0x6')]][_0x59d6('0x23')]=!![];queues[_0x4720ff[_0x59d6('0x6')]][_0x59d6('0x24')]=utils[_0x59d6('0x16')]();queues[_0x4720ff[_0x59d6('0x6')]][_0x59d6('0xb')]=_0x4720ff[_0x59d6('0x25')]['toUpperCase']();utils['info'](util['format'](_0x59d6('0x26'),_0x4720ff[_0x59d6('0x6')],queues[_0x4720ff[_0x59d6('0x6')]][_0x59d6('0x1c')],_0x4720ff['value'],queues[_0x4720ff[_0x59d6('0x6')]][_0x59d6('0xb')]));writeDB(queues[_0x4720ff[_0x59d6('0x6')]]);}}else if(!_[_0x59d6('0x18')](_0x4720ff[_0x59d6('0x1f')][_0x59d6('0x27')])){if(!_[_0x59d6('0x18')](queues[_0x4720ff[_0x59d6('0x6')]])&&!queues[_0x4720ff[_0x59d6('0x6')]][_0x59d6('0x1b')]){queues[_0x4720ff[_0x59d6('0x6')]][_0x59d6('0x1b')]=![];queues[_0x4720ff[_0x59d6('0x6')]][_0x59d6('0x22')]=null;queues[_0x4720ff[_0x59d6('0x6')]]['queuecallerexit']=!![];queues[_0x4720ff[_0x59d6('0x6')]][_0x59d6('0x24')]=utils[_0x59d6('0x16')]();queues[_0x4720ff['uniqueid']][_0x59d6('0xb')]='EXITWITHKEY';utils[_0x59d6('0x3')](util[_0x59d6('0x4')](_0x59d6('0x28'),_0x4720ff[_0x59d6('0x6')],queues[_0x4720ff[_0x59d6('0x6')]][_0x59d6('0x1c')],_0x4720ff[_0x59d6('0x25')],queues[_0x4720ff[_0x59d6('0x6')]][_0x59d6('0xb')]));}}}catch(_0x5985f1){utils['error'](util[_0x59d6('0x4')](_0x59d6('0x1e'),_0x4720ff[_0x59d6('0x6')]),_0x5985f1);}};exports[_0x59d6('0x1b')]=function(_0x171e59){try{if(!_['isNil'](queues[_0x171e59[_0x59d6('0x6')]])){utils[_0x59d6('0x1d')](util[_0x59d6('0x4')](_0x59d6('0x29'),_0x171e59[_0x59d6('0x6')]),_0x171e59);queues[_0x171e59[_0x59d6('0x6')]][_0x59d6('0x23')]=![];queues[_0x171e59[_0x59d6('0x6')]][_0x59d6('0x24')]=null;queues[_0x171e59['uniqueid']][_0x59d6('0x1b')]=!![];queues[_0x171e59[_0x59d6('0x6')]][_0x59d6('0x22')]=utils['now']();queues[_0x171e59[_0x59d6('0x6')]][_0x59d6('0xb')]=_0x59d6('0x2a');utils[_0x59d6('0x3')](util[_0x59d6('0x4')](_0x59d6('0x2b'),_0x171e59[_0x59d6('0x6')],queues[_0x171e59[_0x59d6('0x6')]][_0x59d6('0x1c')],queues[_0x171e59[_0x59d6('0x6')]][_0x59d6('0xb')]));}}catch(_0x15a730){utils['error'](util['format'](_0x59d6('0x29'),_0x171e59[_0x59d6('0x6')]),_0x15a730);}};exports['queuecallerleave']=function(_0x21589b){try{if(!_[_0x59d6('0x18')](queues[_0x21589b[_0x59d6('0x6')]])){utils[_0x59d6('0x1d')](util['format'](_0x59d6('0x2c'),_0x21589b[_0x59d6('0x6')]),_0x21589b);utils[_0x59d6('0x3')](util[_0x59d6('0x4')](_0x59d6('0x2d'),_0x21589b[_0x59d6('0x6')],queues[_0x21589b['uniqueid']][_0x59d6('0x1c')],_0x21589b[_0x59d6('0x2e')],_0x21589b[_0x59d6('0x2f')]));queues[_0x21589b[_0x59d6('0x6')]]['queuecallerleave']=!![];queues[_0x21589b[_0x59d6('0x6')]][_0x59d6('0x1a')]=utils[_0x59d6('0x16')]();queues[_0x21589b[_0x59d6('0x6')]][_0x59d6('0x30')]=utils[_0x59d6('0x31')](queues[_0x21589b['uniqueid']][_0x59d6('0x1a')],queues[_0x21589b[_0x59d6('0x6')]][_0x59d6('0x32')]);queues[_0x21589b[_0x59d6('0x6')]][_0x59d6('0x14')]=_0x21589b[_0x59d6('0x14')];queues[_0x21589b[_0x59d6('0x6')]][_0x59d6('0x33')]=_0x21589b[_0x59d6('0x33')];queues[_0x21589b['uniqueid']][_0x59d6('0x2e')]=_0x21589b[_0x59d6('0x2e')];queues[_0x21589b[_0x59d6('0x6')]][_0x59d6('0x2f')]=_0x21589b[_0x59d6('0x2f')];}}catch(_0x5741a3){utils[_0x59d6('0x34')](util[_0x59d6('0x4')](_0x59d6('0x2c'),_0x21589b[_0x59d6('0x6')]),_0x5741a3);}};exports[_0x59d6('0x35')]=function(_0x51a417){try{if(!_['isNil'](queues[_0x51a417[_0x59d6('0x6')]])){utils[_0x59d6('0x1d')](util[_0x59d6('0x4')]('[%s][queues][agentconnect]',_0x51a417[_0x59d6('0x6')]),_0x51a417);utils[_0x59d6('0x3')](util[_0x59d6('0x4')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x51a417[_0x59d6('0x6')],queues[_0x51a417[_0x59d6('0x6')]][_0x59d6('0x1c')],_0x51a417[_0x59d6('0x36')],_0x51a417[_0x59d6('0x37')]));queues[_0x51a417[_0x59d6('0x6')]]['queuecallerabandon']=![];queues[_0x51a417[_0x59d6('0x6')]][_0x59d6('0x1b')]=![];queues[_0x51a417['uniqueid']][_0x59d6('0x22')]=null;queues[_0x51a417[_0x59d6('0x6')]][_0x59d6('0x23')]=![];queues[_0x51a417['uniqueid']][_0x59d6('0xb')]=null;queues[_0x51a417[_0x59d6('0x6')]][_0x59d6('0x24')]=null;queues[_0x51a417[_0x59d6('0x6')]][_0x59d6('0x38')]=!![];queues[_0x51a417[_0x59d6('0x6')]][_0x59d6('0xa')]=_0x51a417[_0x59d6('0x37')];queues[_0x51a417['uniqueid']][_0x59d6('0x9')]=_0x51a417['membername'];}}catch(_0x2bfc79){utils[_0x59d6('0x34')](util[_0x59d6('0x4')]('[%s][queues][agentconnect]',_0x51a417[_0x59d6('0x6')]),_0x2bfc79);}};exports[_0x59d6('0x39')]=function(_0x598450){try{if(!_['isNil'](queues[_0x598450['uniqueid']])){if(queues[_0x598450['uniqueid']]['queuecallerleaveAt']){utils['debug'](util[_0x59d6('0x4')](_0x59d6('0x3a'),_0x598450[_0x59d6('0x6')]),_0x598450);queues[_0x598450[_0x59d6('0x6')]]['queuecallerabandon']=![];queues[_0x598450[_0x59d6('0x6')]][_0x59d6('0x1b')]=![];queues[_0x598450[_0x59d6('0x6')]]['queuecallerabandonAt']=null;queues[_0x598450['uniqueid']][_0x59d6('0x23')]=![];queues[_0x598450['uniqueid']][_0x59d6('0x24')]=null;queues[_0x598450[_0x59d6('0x6')]][_0x59d6('0x38')]=!![];queues[_0x598450[_0x59d6('0x6')]][_0x59d6('0x9')]=_0x598450[_0x59d6('0x36')];queues[_0x598450['uniqueid']][_0x59d6('0x3b')]=!![];queues[_0x598450[_0x59d6('0x6')]][_0x59d6('0x3c')]=utils[_0x59d6('0x16')]();if(_0x598450[_0x59d6('0x3d')]==_0x59d6('0x3e')){if(!queues[_0x598450[_0x59d6('0x6')]][_0x59d6('0x3e')]){queues[_0x598450[_0x59d6('0x6')]][_0x59d6('0xb')]=_0x59d6('0x3f');}}else{queues[_0x598450['uniqueid']][_0x59d6('0xb')]=_0x59d6('0x40')+_0x598450[_0x59d6('0x3d')][_0x59d6('0x21')]();}utils['info'](util[_0x59d6('0x4')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x598450[_0x59d6('0x6')],queues[_0x598450['uniqueid']][_0x59d6('0x1c')],_0x598450[_0x59d6('0x36')],queues[_0x598450[_0x59d6('0x6')]][_0x59d6('0xb')]));writeDB(queues[_0x598450['uniqueid']]);}}}catch(_0x33a3ed){utils[_0x59d6('0x34')](util[_0x59d6('0x4')](_0x59d6('0x3a'),_0x598450[_0x59d6('0x6')]),_0x33a3ed);}};exports[_0x59d6('0x41')]=function(_0x17540d){try{if(!_[_0x59d6('0x18')](queues[_0x17540d[_0x59d6('0x42')]])){utils[_0x59d6('0x1d')](util['format'](_0x59d6('0x43'),_0x17540d['uniqueid']),_0x17540d);queues[_0x17540d[_0x59d6('0x42')]][_0x59d6('0x3e')]=!![];queues[_0x17540d[_0x59d6('0x42')]][_0x59d6('0x44')]=_0x59d6('0x45');queues[_0x17540d[_0x59d6('0x42')]][_0x59d6('0x46')]=_0x17540d[_0x59d6('0x47')];queues[_0x17540d[_0x59d6('0x42')]][_0x59d6('0x48')]=_0x17540d['transfereeuniqueid'];queues[_0x17540d[_0x59d6('0x42')]]['queuecallerexitreason']=_0x59d6('0x49');utils[_0x59d6('0x3')](util[_0x59d6('0x4')](_0x59d6('0x4a'),_0x17540d[_0x59d6('0x6')],queues[_0x17540d[_0x59d6('0x42')]][_0x59d6('0x1c')],_0x17540d[_0x59d6('0x42')],_0x17540d[_0x59d6('0x47')]));}}catch(_0x200da7){utils[_0x59d6('0x34')](util['format'](_0x59d6('0x43'),_0x17540d[_0x59d6('0x6')]),_0x200da7);}};exports[_0x59d6('0x4b')]=function(_0x6738fe){try{utils[_0x59d6('0x1d')](util['format'](_0x59d6('0x4c'),_0x6738fe[_0x59d6('0x4d')]),_0x6738fe);if(_0x6738fe[_0x59d6('0x4d')]==_0x6738fe[_0x59d6('0x4e')]){if(!_[_0x59d6('0x18')](queues[_0x6738fe['secondtransfererlinkedid']])){utils['info'](util['format'](_0x59d6('0x4f'),_0x6738fe['origtransfereruniqueid'],queues[_0x6738fe[_0x59d6('0x50')]]['name'],_0x6738fe[_0x59d6('0x51')]));queues[_0x6738fe[_0x59d6('0x50')]][_0x59d6('0x3e')]=!![];queues[_0x6738fe[_0x59d6('0x50')]][_0x59d6('0x44')]=_0x59d6('0x52');queues[_0x6738fe[_0x59d6('0x50')]][_0x59d6('0x46')]=_0x6738fe[_0x59d6('0x51')];queues[_0x6738fe[_0x59d6('0x50')]]['transferuniqueid']=_0x6738fe['origtransfereruniqueid'];queues[_0x6738fe['secondtransfererlinkedid']][_0x59d6('0xb')]=_0x59d6('0x53');}if(!_[_0x59d6('0x18')](queues[_0x6738fe[_0x59d6('0x4e')]])){if(_0x6738fe[_0x59d6('0x54')]&&queues[_0x6738fe[_0x59d6('0x54')]]){queues[_0x6738fe[_0x59d6('0x54')]][_0x59d6('0x55')]=0x1;queues[_0x6738fe['transfereeuniqueid']]=_[_0x59d6('0x56')](queues[_0x6738fe['transfereelinkedid']]);queues[_0x6738fe['transfereeuniqueid']][_0x59d6('0x11')]=_0x6738fe[_0x59d6('0x57')];queues[_0x6738fe[_0x59d6('0x42')]]['queuecallerenterreason']=0x2;queues[_0x6738fe[_0x59d6('0x42')]][_0x59d6('0x58')]=queues[_0x6738fe['secondtransfererlinkedid']]['calleridnum'];queues[_0x6738fe['transfereeuniqueid']]['calleridname']=queues[_0x6738fe[_0x59d6('0x50')]]['calleridname'];queues[_0x6738fe['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0x59d6('0x16')]();queues[_0x6738fe[_0x59d6('0x42')]]['queuecallerleaveAt']=utils[_0x59d6('0x16')]();queues[_0x6738fe['transfereeuniqueid']]['holdtime']=0x0;queues[_0x6738fe[_0x59d6('0x42')]]['mohtime']=0x0;utils[_0x59d6('0x3')](util['format'](_0x59d6('0x59'),_0x6738fe['origtransfereruniqueid'],queues[_0x6738fe[_0x59d6('0x42')]][_0x59d6('0x1c')],queues[_0x6738fe[_0x59d6('0x42')]][_0x59d6('0x58')],queues[_0x6738fe[_0x59d6('0x42')]][_0x59d6('0x5a')]));}else{utils[_0x59d6('0x3')](util[_0x59d6('0x4')](_0x59d6('0x5b'),_0x6738fe[_0x59d6('0x4d')],queues[_0x6738fe[_0x59d6('0x4e')]][_0x59d6('0x1c')],_0x6738fe[_0x59d6('0x50')]));queues[_0x6738fe[_0x59d6('0x4e')]]['transfereduniqueid']=_0x6738fe[_0x59d6('0x50')];}}}else if(_0x6738fe[_0x59d6('0x5c')]==_0x6738fe[_0x59d6('0x50')]){if(!_[_0x59d6('0x18')](queues[_0x6738fe['origtransfererlinkedid']])){utils[_0x59d6('0x3')](util[_0x59d6('0x4')](_0x59d6('0x5d'),_0x6738fe['origtransfereruniqueid'],queues[_0x6738fe[_0x59d6('0x4e')]][_0x59d6('0x1c')],_0x6738fe[_0x59d6('0x5c')],_0x6738fe['secondtransfererexten']));queues[_0x6738fe[_0x59d6('0x4e')]][_0x59d6('0x3e')]=!![];queues[_0x6738fe['origtransfererlinkedid']]['transfertype']=_0x59d6('0x52');queues[_0x6738fe[_0x59d6('0x4e')]][_0x59d6('0x46')]=_0x6738fe[_0x59d6('0x5e')];queues[_0x6738fe['origtransfererlinkedid']][_0x59d6('0x48')]=_0x6738fe['secondtransfereruniqueid'];queues[_0x6738fe[_0x59d6('0x4e')]][_0x59d6('0xb')]=_0x59d6('0x53');}if(!_['isNil'](queues[_0x6738fe[_0x59d6('0x50')]])){if(_0x6738fe[_0x59d6('0x5f')]&&queues[_0x6738fe[_0x59d6('0x5f')]]){queues[_0x6738fe[_0x59d6('0x5f')]][_0x59d6('0x55')]=0x1;queues[_0x6738fe[_0x59d6('0x57')]]=_[_0x59d6('0x56')](queues[_0x6738fe['transfertargetlinkedid']]);queues[_0x6738fe[_0x59d6('0x57')]][_0x59d6('0x11')]=_0x6738fe[_0x59d6('0x57')];queues[_0x6738fe['transfertargetuniqueid']][_0x59d6('0x55')]=0x2;queues[_0x6738fe[_0x59d6('0x57')]][_0x59d6('0x58')]=queues[_0x6738fe['origtransfererlinkedid']][_0x59d6('0x58')];queues[_0x6738fe[_0x59d6('0x57')]][_0x59d6('0x5a')]=queues[_0x6738fe[_0x59d6('0x4e')]]['calleridname'];queues[_0x6738fe[_0x59d6('0x57')]][_0x59d6('0x32')]=utils[_0x59d6('0x16')]();queues[_0x6738fe[_0x59d6('0x57')]]['queuecallerleaveAt']=utils['now']();queues[_0x6738fe[_0x59d6('0x57')]][_0x59d6('0x30')]=0x0;queues[_0x6738fe[_0x59d6('0x57')]][_0x59d6('0x60')]=0x0;utils[_0x59d6('0x3')](util[_0x59d6('0x4')](_0x59d6('0x61'),_0x6738fe[_0x59d6('0x4d')],queues[_0x6738fe[_0x59d6('0x57')]][_0x59d6('0x1c')],queues[_0x6738fe[_0x59d6('0x57')]][_0x59d6('0x11')],queues[_0x6738fe[_0x59d6('0x57')]][_0x59d6('0x58')],queues[_0x6738fe[_0x59d6('0x57')]][_0x59d6('0x5a')]));}else{utils[_0x59d6('0x3')](util['format'](_0x59d6('0x5b'),_0x6738fe[_0x59d6('0x4d')],queues[_0x6738fe[_0x59d6('0x50')]]['name'],_0x6738fe[_0x59d6('0x4e')]));queues[_0x6738fe['secondtransfererlinkedid']][_0x59d6('0x11')]=_0x6738fe[_0x59d6('0x4e')];}}}}catch(_0x5d4151){utils[_0x59d6('0x34')](util[_0x59d6('0x4')]('[%s][queues][attendedtransfer]',_0x6738fe[_0x59d6('0x4d')]),_0x5d4151);}};exports[_0x59d6('0x62')]=function(_0x10adaa){try{if(!_[_0x59d6('0x18')](queues[_0x10adaa[_0x59d6('0x6')]])){utils[_0x59d6('0x1d')](util[_0x59d6('0x4')](_0x59d6('0x63'),_0x10adaa[_0x59d6('0x6')]),_0x10adaa);queues[_0x10adaa[_0x59d6('0x6')]]['musiconholdstartAt']=utils[_0x59d6('0x16')]();utils['info'](util[_0x59d6('0x4')](_0x59d6('0x64'),_0x10adaa[_0x59d6('0x6')],queues[_0x10adaa['uniqueid']][_0x59d6('0x1c')],queues[_0x10adaa[_0x59d6('0x6')]]['musiconholdstartAt']));}}catch(_0x5e6e5c){utils[_0x59d6('0x34')](util[_0x59d6('0x4')]('[%s][queues][musiconholdstart]',_0x10adaa['uniqueid']),_0x5e6e5c);}};exports[_0x59d6('0x65')]=function(_0x4bc5a1){try{if(!_['isNil'](queues[_0x4bc5a1['uniqueid']])){if(!_['isNil'](queues[_0x4bc5a1[_0x59d6('0x6')]][_0x59d6('0x66')])){utils[_0x59d6('0x1d')](util[_0x59d6('0x4')]('[%s][queues][musiconholdstop]',_0x4bc5a1[_0x59d6('0x6')]),_0x4bc5a1);queues[_0x4bc5a1[_0x59d6('0x6')]][_0x59d6('0x60')]+=utils[_0x59d6('0x31')](utils[_0x59d6('0x16')](),queues[_0x4bc5a1[_0x59d6('0x6')]][_0x59d6('0x66')]);utils[_0x59d6('0x3')](util[_0x59d6('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x4bc5a1[_0x59d6('0x6')],queues[_0x4bc5a1[_0x59d6('0x6')]][_0x59d6('0x1c')],queues[_0x4bc5a1['uniqueid']]['mohtime']));delete queues[_0x4bc5a1['uniqueid']][_0x59d6('0x66')];}}}catch(_0xbb25d7){utils[_0x59d6('0x34')](util[_0x59d6('0x4')]('[%s][queues][musiconholdstop]',_0x4bc5a1[_0x59d6('0x6')]),_0xbb25d7);}}; \ No newline at end of file +var _0x702a=['transfertargetuniqueid','calleridnum','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','mohtime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','uniqueid','channel','lastAssignedTo','accountcode','queue','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','error','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfererlinkedid','secondtransfererlinkedid','origtransfereruniqueid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid'];(function(_0x267bcd,_0x39bc64){var _0x19dfd1=function(_0x4cedd9){while(--_0x4cedd9){_0x267bcd['push'](_0x267bcd['shift']());}};_0x19dfd1(++_0x39bc64);}(_0x702a,0xe4));var _0xa702=function(_0x187380,_0x256969){_0x187380=_0x187380-0x0;var _0x1b4104=_0x702a[_0x187380];return _0x1b4104;};'use strict';var _=require(_0xa702('0x0'));var util=require(_0xa702('0x1'));var utils=require(_0xa702('0x2'));var queues={};function writeDB(_0x380cc9){utils[_0xa702('0x3')](util[_0xa702('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x380cc9[_0xa702('0x5')],_0x380cc9[_0xa702('0x6')],_0x380cc9['queue'],_0x380cc9[_0xa702('0x7')],_0x380cc9['calleridnum'],_0x380cc9[_0xa702('0x8')],_0x380cc9['queuecallerexitreason']));if(_0x380cc9[_0xa702('0x9')]){utils['getVoiceQueueByName'](_0x380cc9[_0xa702('0x9')])[_0xa702('0xa')](function(_0xfa50cb){if(_0xfa50cb){_0x380cc9[_0xa702('0xb')]=_0xfa50cb[_0xa702('0xb')];}utils[_0xa702('0xc')](_0xa702('0xd'),_0x380cc9);});}else{utils[_0xa702('0xc')](_0xa702('0xd'),_0x380cc9);}if(_0x380cc9[_0xa702('0xe')]){delete queues[_0x380cc9['transfereduniqueid']];}else{delete queues[_0x380cc9['uniqueid']];}}exports[_0xa702('0xf')]=function(_0x4ee7fc){try{utils[_0xa702('0x10')](util['format'](_0xa702('0x11'),_0x4ee7fc[_0xa702('0x5')]),_0x4ee7fc);utils[_0xa702('0x3')](util[_0xa702('0x4')](_0xa702('0x12'),_0x4ee7fc[_0xa702('0x5')],_0x4ee7fc[_0xa702('0x9')],_0x4ee7fc['position']));queues[_0x4ee7fc[_0xa702('0x5')]]=_[_0xa702('0x13')](_0x4ee7fc,{'originalposition':_0x4ee7fc[_0xa702('0x14')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x3965aa){utils[_0xa702('0x15')](util[_0xa702('0x4')](_0xa702('0x11'),_0x4ee7fc[_0xa702('0x5')]),_0x3965aa);}};exports['hangup']=function(_0x4aedfa){try{if(!_[_0xa702('0x16')](queues[_0x4aedfa[_0xa702('0x5')]])){utils[_0xa702('0x10')](util['format'](_0xa702('0x17'),_0x4aedfa[_0xa702('0x5')]),_0x4aedfa);if(queues[_0x4aedfa[_0xa702('0x5')]][_0xa702('0x18')]){if(!queues[_0x4aedfa['uniqueid']][_0xa702('0x19')]&&!queues[_0x4aedfa['uniqueid']][_0xa702('0x1a')]){queues[_0x4aedfa[_0xa702('0x5')]][_0xa702('0x1b')]=!![];queues[_0x4aedfa[_0xa702('0x5')]][_0xa702('0x1c')]=utils[_0xa702('0x1d')]();queues[_0x4aedfa[_0xa702('0x5')]][_0xa702('0x1e')]=_0xa702('0x1f');}utils[_0xa702('0x3')](util[_0xa702('0x4')](_0xa702('0x20'),_0x4aedfa[_0xa702('0x5')],queues[_0x4aedfa[_0xa702('0x5')]]['name'],queues[_0x4aedfa['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x4aedfa[_0xa702('0x5')]]);}else if(queues[_0x4aedfa['uniqueid']]['transfereduniqueid']){utils[_0xa702('0x3')](util[_0xa702('0x4')](_0xa702('0x21'),_0x4aedfa[_0xa702('0x5')],queues[_0x4aedfa[_0xa702('0x5')]][_0xa702('0x22')],queues[_0x4aedfa[_0xa702('0x5')]][_0xa702('0xe')]));queues[queues[_0x4aedfa['uniqueid']][_0xa702('0xe')]]=queues[_0x4aedfa[_0xa702('0x5')]];queues[queues[_0x4aedfa[_0xa702('0x5')]][_0xa702('0xe')]][_0xa702('0x23')]=0x2;delete queues[_0x4aedfa[_0xa702('0x5')]];}}}catch(_0x92cf1d){utils['error'](util[_0xa702('0x4')](_0xa702('0x17'),_0x4aedfa[_0xa702('0x5')]),_0x92cf1d);}};exports[_0xa702('0x24')]=function(_0x2bbfa7){try{utils['debug'](util[_0xa702('0x4')](_0xa702('0x25'),_0x2bbfa7[_0xa702('0x5')]),_0x2bbfa7);if(!_[_0xa702('0x16')](_0x2bbfa7[_0xa702('0x26')]['queuestatus'])&&_0x2bbfa7[_0xa702('0x27')][_0xa702('0x28')]()!==_0xa702('0x29')){if(!_['isNil'](queues[_0x2bbfa7[_0xa702('0x5')]])){queues[_0x2bbfa7[_0xa702('0x5')]][_0xa702('0x19')]=![];queues[_0x2bbfa7[_0xa702('0x5')]][_0xa702('0x2a')]=null;queues[_0x2bbfa7[_0xa702('0x5')]]['queuecallerexit']=!![];queues[_0x2bbfa7['uniqueid']][_0xa702('0x2b')]=utils[_0xa702('0x1d')]();queues[_0x2bbfa7[_0xa702('0x5')]][_0xa702('0x1e')]=_0x2bbfa7[_0xa702('0x27')][_0xa702('0x28')]();utils['info'](util[_0xa702('0x4')](_0xa702('0x2c'),_0x2bbfa7[_0xa702('0x5')],queues[_0x2bbfa7['uniqueid']]['name'],_0x2bbfa7[_0xa702('0x27')],queues[_0x2bbfa7[_0xa702('0x5')]][_0xa702('0x1e')]));writeDB(queues[_0x2bbfa7[_0xa702('0x5')]]);}}else if(!_[_0xa702('0x16')](_0x2bbfa7[_0xa702('0x26')][_0xa702('0x2d')])){if(!_['isNil'](queues[_0x2bbfa7['uniqueid']])&&!queues[_0x2bbfa7[_0xa702('0x5')]][_0xa702('0x19')]){queues[_0x2bbfa7['uniqueid']][_0xa702('0x19')]=![];queues[_0x2bbfa7[_0xa702('0x5')]][_0xa702('0x2a')]=null;queues[_0x2bbfa7[_0xa702('0x5')]][_0xa702('0x1a')]=!![];queues[_0x2bbfa7['uniqueid']][_0xa702('0x2b')]=utils[_0xa702('0x1d')]();queues[_0x2bbfa7[_0xa702('0x5')]][_0xa702('0x1e')]='EXITWITHKEY';utils['info'](util[_0xa702('0x4')](_0xa702('0x2e'),_0x2bbfa7[_0xa702('0x5')],queues[_0x2bbfa7[_0xa702('0x5')]][_0xa702('0x22')],_0x2bbfa7[_0xa702('0x27')],queues[_0x2bbfa7[_0xa702('0x5')]][_0xa702('0x1e')]));}}}catch(_0x17cd21){utils[_0xa702('0x15')](util[_0xa702('0x4')](_0xa702('0x25'),_0x2bbfa7[_0xa702('0x5')]),_0x17cd21);}};exports[_0xa702('0x19')]=function(_0x907599){try{if(!_[_0xa702('0x16')](queues[_0x907599[_0xa702('0x5')]])){utils[_0xa702('0x10')](util['format'](_0xa702('0x2f'),_0x907599[_0xa702('0x5')]),_0x907599);queues[_0x907599[_0xa702('0x5')]][_0xa702('0x1a')]=![];queues[_0x907599['uniqueid']][_0xa702('0x2b')]=null;queues[_0x907599['uniqueid']][_0xa702('0x19')]=!![];queues[_0x907599[_0xa702('0x5')]][_0xa702('0x2a')]=utils[_0xa702('0x1d')]();queues[_0x907599['uniqueid']][_0xa702('0x1e')]=_0xa702('0x30');utils[_0xa702('0x3')](util[_0xa702('0x4')](_0xa702('0x31'),_0x907599['uniqueid'],queues[_0x907599[_0xa702('0x5')]][_0xa702('0x22')],queues[_0x907599[_0xa702('0x5')]]['queuecallerexitreason']));}}catch(_0x1c1b40){utils['error'](util[_0xa702('0x4')]('[%s][queues][queuecallerabandon]',_0x907599['uniqueid']),_0x1c1b40);}};exports[_0xa702('0x32')]=function(_0x39ca59){try{if(!_[_0xa702('0x16')](queues[_0x39ca59[_0xa702('0x5')]])){utils[_0xa702('0x10')](util['format'](_0xa702('0x33'),_0x39ca59[_0xa702('0x5')]),_0x39ca59);utils['info'](util['format'](_0xa702('0x34'),_0x39ca59['uniqueid'],queues[_0x39ca59[_0xa702('0x5')]][_0xa702('0x22')],_0x39ca59[_0xa702('0x35')],_0x39ca59[_0xa702('0x36')]));queues[_0x39ca59[_0xa702('0x5')]][_0xa702('0x32')]=!![];queues[_0x39ca59['uniqueid']][_0xa702('0x18')]=utils['now']();queues[_0x39ca59[_0xa702('0x5')]][_0xa702('0x37')]=utils[_0xa702('0x38')](queues[_0x39ca59[_0xa702('0x5')]]['queuecallerleaveAt'],queues[_0x39ca59[_0xa702('0x5')]][_0xa702('0x39')]);queues[_0x39ca59[_0xa702('0x5')]][_0xa702('0x14')]=_0x39ca59[_0xa702('0x14')];queues[_0x39ca59[_0xa702('0x5')]][_0xa702('0x3a')]=_0x39ca59[_0xa702('0x3a')];queues[_0x39ca59[_0xa702('0x5')]]['connectedlinenum']=_0x39ca59['connectedlinenum'];queues[_0x39ca59['uniqueid']][_0xa702('0x36')]=_0x39ca59[_0xa702('0x36')];}}catch(_0x25b41a){utils[_0xa702('0x15')](util[_0xa702('0x4')](_0xa702('0x33'),_0x39ca59[_0xa702('0x5')]),_0x25b41a);}};exports[_0xa702('0x3b')]=function(_0x185aa6){try{if(!_[_0xa702('0x16')](queues[_0x185aa6[_0xa702('0x5')]])){utils[_0xa702('0x10')](util[_0xa702('0x4')](_0xa702('0x3c'),_0x185aa6[_0xa702('0x5')]),_0x185aa6);utils[_0xa702('0x3')](util[_0xa702('0x4')](_0xa702('0x3d'),_0x185aa6['uniqueid'],queues[_0x185aa6[_0xa702('0x5')]][_0xa702('0x22')],_0x185aa6[_0xa702('0x3e')],_0x185aa6['destaccountcode']));queues[_0x185aa6['uniqueid']]['queuecallerabandon']=![];queues[_0x185aa6['uniqueid']][_0xa702('0x19')]=![];queues[_0x185aa6[_0xa702('0x5')]]['queuecallerabandonAt']=null;queues[_0x185aa6['uniqueid']][_0xa702('0x1a')]=![];queues[_0x185aa6['uniqueid']][_0xa702('0x1e')]=null;queues[_0x185aa6[_0xa702('0x5')]][_0xa702('0x2b')]=null;queues[_0x185aa6[_0xa702('0x5')]][_0xa702('0x3f')]=!![];queues[_0x185aa6[_0xa702('0x5')]][_0xa702('0x8')]=_0x185aa6['destaccountcode'];queues[_0x185aa6['uniqueid']]['lastAssignedTo']=_0x185aa6['membername'];}}catch(_0x9778e5){utils[_0xa702('0x15')](util[_0xa702('0x4')](_0xa702('0x3c'),_0x185aa6[_0xa702('0x5')]),_0x9778e5);}};exports['agentcomplete']=function(_0x537378){try{if(!_['isNil'](queues[_0x537378[_0xa702('0x5')]])){if(queues[_0x537378[_0xa702('0x5')]][_0xa702('0x18')]){utils['debug'](util['format']('[%s][queues][agentcomplete]',_0x537378['uniqueid']),_0x537378);queues[_0x537378[_0xa702('0x5')]][_0xa702('0x19')]=![];queues[_0x537378[_0xa702('0x5')]][_0xa702('0x19')]=![];queues[_0x537378[_0xa702('0x5')]][_0xa702('0x2a')]=null;queues[_0x537378['uniqueid']]['queuecallerexit']=![];queues[_0x537378[_0xa702('0x5')]][_0xa702('0x2b')]=null;queues[_0x537378['uniqueid']]['assigned']=!![];queues[_0x537378[_0xa702('0x5')]][_0xa702('0x7')]=_0x537378[_0xa702('0x3e')];queues[_0x537378[_0xa702('0x5')]][_0xa702('0x1b')]=!![];queues[_0x537378[_0xa702('0x5')]][_0xa702('0x1c')]=utils['now']();if(_0x537378['reason']==_0xa702('0x40')){if(!queues[_0x537378[_0xa702('0x5')]][_0xa702('0x40')]){queues[_0x537378[_0xa702('0x5')]][_0xa702('0x1e')]=_0xa702('0x41');}}else{queues[_0x537378[_0xa702('0x5')]][_0xa702('0x1e')]=_0xa702('0x42')+_0x537378[_0xa702('0x43')][_0xa702('0x28')]();}utils['info'](util[_0xa702('0x4')](_0xa702('0x44'),_0x537378[_0xa702('0x5')],queues[_0x537378['uniqueid']][_0xa702('0x22')],_0x537378[_0xa702('0x3e')],queues[_0x537378['uniqueid']][_0xa702('0x1e')]));writeDB(queues[_0x537378[_0xa702('0x5')]]);}}}catch(_0xfd51df){utils[_0xa702('0x15')](util[_0xa702('0x4')]('[%s][queues][agentcomplete]',_0x537378[_0xa702('0x5')]),_0xfd51df);}};exports[_0xa702('0x45')]=function(_0x455bff){try{if(!_[_0xa702('0x16')](queues[_0x455bff[_0xa702('0x46')]])){utils[_0xa702('0x10')](util[_0xa702('0x4')](_0xa702('0x47'),_0x455bff['uniqueid']),_0x455bff);queues[_0x455bff['transfereeuniqueid']]['transfer']=!![];queues[_0x455bff[_0xa702('0x46')]][_0xa702('0x48')]='BLIND';queues[_0x455bff[_0xa702('0x46')]][_0xa702('0x49')]=_0x455bff[_0xa702('0x4a')];queues[_0x455bff[_0xa702('0x46')]][_0xa702('0x4b')]=_0x455bff[_0xa702('0x46')];queues[_0x455bff['transfereeuniqueid']][_0xa702('0x1e')]=_0xa702('0x4c');utils[_0xa702('0x3')](util[_0xa702('0x4')](_0xa702('0x4d'),_0x455bff[_0xa702('0x5')],queues[_0x455bff[_0xa702('0x46')]][_0xa702('0x22')],_0x455bff[_0xa702('0x46')],_0x455bff[_0xa702('0x4a')]));}}catch(_0xe58b69){utils[_0xa702('0x15')](util[_0xa702('0x4')](_0xa702('0x47'),_0x455bff[_0xa702('0x5')]),_0xe58b69);}};exports[_0xa702('0x4e')]=function(_0x5d4358){try{utils[_0xa702('0x10')](util[_0xa702('0x4')](_0xa702('0x4f'),_0x5d4358['origtransfereruniqueid']),_0x5d4358);if(_0x5d4358['origtransfereruniqueid']==_0x5d4358[_0xa702('0x50')]){if(!_[_0xa702('0x16')](queues[_0x5d4358[_0xa702('0x51')]])){utils[_0xa702('0x3')](util[_0xa702('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5d4358[_0xa702('0x52')],queues[_0x5d4358[_0xa702('0x51')]]['name'],_0x5d4358[_0xa702('0x53')]));queues[_0x5d4358[_0xa702('0x51')]]['transfer']=!![];queues[_0x5d4358[_0xa702('0x51')]][_0xa702('0x48')]=_0xa702('0x54');queues[_0x5d4358[_0xa702('0x51')]][_0xa702('0x49')]=_0x5d4358['origtransfererexten'];queues[_0x5d4358['secondtransfererlinkedid']]['transferuniqueid']=_0x5d4358[_0xa702('0x52')];queues[_0x5d4358[_0xa702('0x51')]]['queuecallerexitreason']=_0xa702('0x55');}if(!_[_0xa702('0x16')](queues[_0x5d4358['origtransfererlinkedid']])){if(_0x5d4358['transfereelinkedid']&&queues[_0x5d4358[_0xa702('0x56')]]){queues[_0x5d4358['transfereelinkedid']][_0xa702('0x23')]=0x1;queues[_0x5d4358[_0xa702('0x46')]]=_['clone'](queues[_0x5d4358[_0xa702('0x56')]]);queues[_0x5d4358['transfereeuniqueid']][_0xa702('0xe')]=_0x5d4358[_0xa702('0x57')];queues[_0x5d4358[_0xa702('0x46')]][_0xa702('0x23')]=0x2;queues[_0x5d4358[_0xa702('0x46')]][_0xa702('0x58')]=queues[_0x5d4358['secondtransfererlinkedid']][_0xa702('0x58')];queues[_0x5d4358[_0xa702('0x46')]][_0xa702('0x59')]=queues[_0x5d4358[_0xa702('0x51')]][_0xa702('0x59')];queues[_0x5d4358[_0xa702('0x46')]]['queuecallerjoinAt']=utils[_0xa702('0x1d')]();queues[_0x5d4358[_0xa702('0x46')]]['queuecallerleaveAt']=utils[_0xa702('0x1d')]();queues[_0x5d4358[_0xa702('0x46')]][_0xa702('0x37')]=0x0;queues[_0x5d4358['transfereeuniqueid']]['mohtime']=0x0;utils[_0xa702('0x3')](util[_0xa702('0x4')](_0xa702('0x5a'),_0x5d4358[_0xa702('0x52')],queues[_0x5d4358['transfereeuniqueid']][_0xa702('0x22')],queues[_0x5d4358[_0xa702('0x46')]][_0xa702('0x58')],queues[_0x5d4358[_0xa702('0x46')]][_0xa702('0x59')]));}else{utils[_0xa702('0x3')](util[_0xa702('0x4')](_0xa702('0x5b'),_0x5d4358[_0xa702('0x52')],queues[_0x5d4358[_0xa702('0x50')]][_0xa702('0x22')],_0x5d4358[_0xa702('0x51')]));queues[_0x5d4358['origtransfererlinkedid']][_0xa702('0xe')]=_0x5d4358[_0xa702('0x51')];}}}else if(_0x5d4358['secondtransfereruniqueid']==_0x5d4358[_0xa702('0x51')]){if(!_['isNil'](queues[_0x5d4358['origtransfererlinkedid']])){utils[_0xa702('0x3')](util['format'](_0xa702('0x5c'),_0x5d4358['origtransfereruniqueid'],queues[_0x5d4358[_0xa702('0x50')]][_0xa702('0x22')],_0x5d4358[_0xa702('0x5d')],_0x5d4358['secondtransfererexten']));queues[_0x5d4358[_0xa702('0x50')]][_0xa702('0x40')]=!![];queues[_0x5d4358[_0xa702('0x50')]][_0xa702('0x48')]=_0xa702('0x54');queues[_0x5d4358['origtransfererlinkedid']][_0xa702('0x49')]=_0x5d4358[_0xa702('0x5e')];queues[_0x5d4358['origtransfererlinkedid']][_0xa702('0x4b')]=_0x5d4358['secondtransfereruniqueid'];queues[_0x5d4358['origtransfererlinkedid']][_0xa702('0x1e')]=_0xa702('0x55');}if(!_[_0xa702('0x16')](queues[_0x5d4358[_0xa702('0x51')]])){if(_0x5d4358[_0xa702('0x5f')]&&queues[_0x5d4358[_0xa702('0x5f')]]){queues[_0x5d4358[_0xa702('0x5f')]]['queuecallerenterreason']=0x1;queues[_0x5d4358[_0xa702('0x57')]]=_[_0xa702('0x60')](queues[_0x5d4358[_0xa702('0x5f')]]);queues[_0x5d4358[_0xa702('0x57')]][_0xa702('0xe')]=_0x5d4358[_0xa702('0x57')];queues[_0x5d4358[_0xa702('0x57')]][_0xa702('0x23')]=0x2;queues[_0x5d4358[_0xa702('0x57')]][_0xa702('0x58')]=queues[_0x5d4358[_0xa702('0x50')]][_0xa702('0x58')];queues[_0x5d4358[_0xa702('0x57')]]['calleridname']=queues[_0x5d4358[_0xa702('0x50')]][_0xa702('0x59')];queues[_0x5d4358['transfertargetuniqueid']][_0xa702('0x39')]=utils['now']();queues[_0x5d4358[_0xa702('0x57')]]['queuecallerleaveAt']=utils[_0xa702('0x1d')]();queues[_0x5d4358[_0xa702('0x57')]]['holdtime']=0x0;queues[_0x5d4358[_0xa702('0x57')]]['mohtime']=0x0;utils['info'](util[_0xa702('0x4')](_0xa702('0x61'),_0x5d4358[_0xa702('0x52')],queues[_0x5d4358[_0xa702('0x57')]]['name'],queues[_0x5d4358[_0xa702('0x57')]][_0xa702('0xe')],queues[_0x5d4358[_0xa702('0x57')]][_0xa702('0x58')],queues[_0x5d4358['transfertargetuniqueid']][_0xa702('0x59')]));}else{utils[_0xa702('0x3')](util[_0xa702('0x4')](_0xa702('0x5b'),_0x5d4358[_0xa702('0x52')],queues[_0x5d4358['secondtransfererlinkedid']][_0xa702('0x22')],_0x5d4358[_0xa702('0x50')]));queues[_0x5d4358['secondtransfererlinkedid']][_0xa702('0xe')]=_0x5d4358[_0xa702('0x50')];}}}}catch(_0x41f8ad){utils[_0xa702('0x15')](util[_0xa702('0x4')]('[%s][queues][attendedtransfer]',_0x5d4358[_0xa702('0x52')]),_0x41f8ad);}};exports['musiconholdstart']=function(_0xd1951e){try{if(!_[_0xa702('0x16')](queues[_0xd1951e[_0xa702('0x5')]])){utils[_0xa702('0x10')](util[_0xa702('0x4')](_0xa702('0x62'),_0xd1951e[_0xa702('0x5')]),_0xd1951e);queues[_0xd1951e[_0xa702('0x5')]]['musiconholdstartAt']=utils['now']();utils[_0xa702('0x3')](util[_0xa702('0x4')](_0xa702('0x63'),_0xd1951e[_0xa702('0x5')],queues[_0xd1951e['uniqueid']][_0xa702('0x22')],queues[_0xd1951e[_0xa702('0x5')]][_0xa702('0x64')]));}}catch(_0xe4777a){utils['error'](util['format'](_0xa702('0x62'),_0xd1951e[_0xa702('0x5')]),_0xe4777a);}};exports[_0xa702('0x65')]=function(_0x1d680a){try{if(!_[_0xa702('0x16')](queues[_0x1d680a['uniqueid']])){if(!_[_0xa702('0x16')](queues[_0x1d680a[_0xa702('0x5')]][_0xa702('0x64')])){utils[_0xa702('0x10')](util[_0xa702('0x4')](_0xa702('0x66'),_0x1d680a['uniqueid']),_0x1d680a);queues[_0x1d680a[_0xa702('0x5')]][_0xa702('0x67')]+=utils[_0xa702('0x38')](utils[_0xa702('0x1d')](),queues[_0x1d680a[_0xa702('0x5')]][_0xa702('0x64')]);utils[_0xa702('0x3')](util['format'](_0xa702('0x68'),_0x1d680a['uniqueid'],queues[_0x1d680a['uniqueid']][_0xa702('0x22')],queues[_0x1d680a[_0xa702('0x5')]]['mohtime']));delete queues[_0x1d680a[_0xa702('0x5')]][_0xa702('0x64')];}}}catch(_0x2b353f){utils[_0xa702('0x15')](util[_0xa702('0x4')](_0xa702('0x66'),_0x1d680a[_0xa702('0x5')]),_0x2b353f);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 8eac415..2664e2d 100644 --- a/server/services/xdr/recordings.controller.js +++ b/server/services/xdr/recordings.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d45=['queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','[%s][recordings][writeDB]','uniqueid','getUserByInternal','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','format','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','accountcode','channel','error','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','replace','.wav49','.WAV','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','application','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf'];(function(_0x2ed31f,_0x505a7a){var _0x10f7b8=function(_0x2d6d82){while(--_0x2d6d82){_0x2ed31f['push'](_0x2ed31f['shift']());}};_0x10f7b8(++_0x505a7a);}(_0x3d45,0x1d2));var _0x53d4=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x3d45[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x53d4('0x0'));var util=require(_0x53d4('0x1'));var utils=require(_0x53d4('0x2'));var recordings={};function writeDB(_0x49a2a0){utils[_0x53d4('0x3')](util['format'](_0x53d4('0x4'),_0x49a2a0[_0x53d4('0x5')]));if(_0x49a2a0['accountcode']){utils[_0x53d4('0x6')](_0x49a2a0['accountcode'])['then'](function(_0x4cfea8){if(_0x4cfea8){_0x49a2a0['membername']=_0x4cfea8[_0x53d4('0x7')];_0x49a2a0[_0x53d4('0x8')]=_0x4cfea8['id'];}utils[_0x53d4('0x9')](_0x53d4('0xa'),_0x49a2a0);});}else{utils[_0x53d4('0x9')]('CreateVoiceRecording',_0x49a2a0);}}exports[_0x53d4('0xb')]=function(_0x20b209){try{utils[_0x53d4('0xc')](util['format'](_0x53d4('0xd'),_0x20b209['uniqueid']),_0x20b209);if(_0x20b209[_0x53d4('0x5')]==_0x20b209[_0x53d4('0xe')]){utils[_0x53d4('0x3')](util[_0x53d4('0xf')](_0x53d4('0x10'),_0x20b209['uniqueid'],_0x20b209[_0x53d4('0x11')],_0x20b209[_0x53d4('0x12')]));recordings[_0x20b209[_0x53d4('0x5')]]={'uniqueid':_0x20b209['uniqueid'],'accountcode':_0x20b209[_0x53d4('0x13')],'exten':_0x20b209[_0x53d4('0x12')],'context':_0x20b209['context'],'channel':_0x20b209[_0x53d4('0x14')],'monitors':[]};}}catch(_0x4999ac){utils[_0x53d4('0x15')](util[_0x53d4('0xf')](_0x53d4('0xd'),_0x20b209['uniqueid']),_0x4999ac);}};exports[_0x53d4('0x16')]=function(_0x121bcb){try{utils[_0x53d4('0xc')](util[_0x53d4('0xf')](_0x53d4('0x17'),_0x121bcb['uniqueid']),_0x121bcb);if(!_[_0x53d4('0x18')](recordings[_0x121bcb[_0x53d4('0x5')]])&&_0x121bcb['channelstate']==0x6){utils['info'](util[_0x53d4('0xf')](_0x53d4('0x19'),_0x121bcb[_0x53d4('0x5')],_0x121bcb['context'],_0x121bcb[_0x53d4('0x14')]));}else if(!_[_0x53d4('0x18')](recordings[_0x121bcb[_0x53d4('0xe')]])&&_0x121bcb[_0x53d4('0x1a')]==0x6&&_0x121bcb[_0x53d4('0x11')]!=_0x53d4('0x1b')){utils[_0x53d4('0x3')](util[_0x53d4('0xf')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x121bcb['uniqueid'],_0x121bcb['linkedid'],_0x121bcb[_0x53d4('0x11')],_0x121bcb['channel']));recordings[_0x121bcb[_0x53d4('0xe')]][_0x53d4('0x13')]=_0x121bcb[_0x53d4('0x13')];}}catch(_0x17917a){utils[_0x53d4('0x15')](util[_0x53d4('0xf')](_0x53d4('0x17'),_0x121bcb[_0x53d4('0x5')]),_0x17917a);}};exports[_0x53d4('0x1c')]=function(_0x62219c){try{if(!_[_0x53d4('0x18')](_0x62219c[_0x53d4('0x1d')])&&!_[_0x53d4('0x18')](_0x62219c[_0x53d4('0x1d')][_0x53d4('0x1e')])){utils[_0x53d4('0xc')](util[_0x53d4('0xf')](_0x53d4('0x1f'),_0x62219c[_0x53d4('0x5')]),_0x62219c);utils['info'](util[_0x53d4('0xf')](_0x53d4('0x20'),_0x62219c[_0x53d4('0x5')],_0x62219c[_0x53d4('0x1d')],_0x62219c['value']));if(_[_0x53d4('0x21')](_0x62219c[_0x53d4('0x22')],'.wav49')){_0x62219c['value']=_0x62219c['value'][_0x53d4('0x23')](_0x53d4('0x24'),_0x53d4('0x25'));}if(recordings[_0x62219c[_0x53d4('0xe')]]){var _0x26e9f9=_['find'](recordings[_0x62219c[_0x53d4('0xe')]]['monitors'],{'value':_0x62219c[_0x53d4('0x22')]});if(_[_0x53d4('0x18')](_0x26e9f9)){recordings[_0x62219c[_0x53d4('0xe')]][_0x53d4('0x26')][_0x53d4('0x27')]({'value':_0x62219c[_0x53d4('0x22')]});}}}}catch(_0x5b3c3d){utils['error'](util[_0x53d4('0xf')]('[%s][recordings][varset]',_0x62219c['uniqueid']),_0x5b3c3d);}};exports[_0x53d4('0x28')]=function(_0x382b22){try{if(!_[_0x53d4('0x18')](recordings[_0x382b22[_0x53d4('0x5')]])){utils['debug'](util['format'](_0x53d4('0x29'),_0x382b22[_0x53d4('0x5')]),_0x382b22);utils[_0x53d4('0x3')](util[_0x53d4('0xf')](_0x53d4('0x2a'),_0x382b22[_0x53d4('0x5')],_0x382b22[_0x53d4('0x2b')],_0x382b22[_0x53d4('0x2c')],_0x382b22[_0x53d4('0x2d')]));recordings[_0x382b22[_0x53d4('0x5')]][_0x53d4('0x2b')]=_0x382b22[_0x53d4('0x2b')];recordings[_0x382b22[_0x53d4('0x5')]]['calleridname']=_0x382b22[_0x53d4('0x2c')];recordings[_0x382b22[_0x53d4('0x5')]][_0x53d4('0x2e')]=_0x382b22[_0x53d4('0x2e')];recordings[_0x382b22[_0x53d4('0x5')]][_0x53d4('0x2f')]=_0x382b22[_0x53d4('0x2f')];if(recordings[_0x382b22[_0x53d4('0x5')]][_0x53d4('0x30')]==_0x53d4('0x31')&&recordings[_0x382b22['uniqueid']]['accountcode']){recordings[_0x382b22[_0x53d4('0x5')]][_0x53d4('0x2e')]=recordings[_0x382b22['uniqueid']][_0x53d4('0x13')];recordings[_0x382b22['uniqueid']][_0x53d4('0x2f')]='';}recordings[_0x382b22['uniqueid']][_0x53d4('0x26')][_0x53d4('0x32')](function(_0x2c5e16){var _0x286962=_[_0x53d4('0x33')](recordings[_0x382b22['uniqueid']]);_0x286962[_0x53d4('0x22')]=_0x2c5e16[_0x53d4('0x22')];writeDB(_0x286962);});delete recordings[_0x382b22[_0x53d4('0x5')]];}}catch(_0x5d14a3){utils[_0x53d4('0x15')](util[_0x53d4('0xf')](_0x53d4('0x29'),_0x382b22['uniqueid']),_0x5d14a3);}};exports[_0x53d4('0x34')]=function(_0x7aacb2){try{if(!_[_0x53d4('0x18')](recordings[_0x7aacb2['uniqueid']])){utils['debug'](util[_0x53d4('0xf')](_0x53d4('0x35'),_0x7aacb2[_0x53d4('0x5')]),_0x7aacb2);utils[_0x53d4('0x3')](util[_0x53d4('0xf')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x7aacb2['uniqueid'],_0x7aacb2[_0x53d4('0x36')],_0x7aacb2[_0x53d4('0x37')]));if(_0x7aacb2[_0x53d4('0x36')][_0x53d4('0x38')]()==_0x53d4('0x39')&&_['startsWith'](_0x7aacb2[_0x53d4('0x37')][_0x53d4('0x38')](),_0x53d4('0x3a'))){var _0x260b84=_0x7aacb2['appdata'][_0x53d4('0x3b')]('=');var _0x2cc380=_0x260b84[0x0][_0x53d4('0x3c')](_0x260b84[0x0]['lastIndexOf']('(')+0x1,_0x260b84[0x0][_0x53d4('0x3d')](')'));var _0x243f1b=_0x260b84[0x1];recordings[_0x7aacb2[_0x53d4('0x5')]][_0x2cc380]=_0x243f1b;}}}catch(_0xd5f813){utils[_0x53d4('0x15')](util[_0x53d4('0xf')](_0x53d4('0x35'),_0x7aacb2[_0x53d4('0x5')]),_0xd5f813);}};exports[_0x53d4('0x3e')]=function(_0x23c339){try{if(!_[_0x53d4('0x18')](recordings[_0x23c339[_0x53d4('0x5')]])){utils['debug'](util[_0x53d4('0xf')](_0x53d4('0x3f'),_0x23c339['uniqueid']),_0x23c339);utils[_0x53d4('0x3')](util[_0x53d4('0xf')](_0x53d4('0x40'),_0x23c339['uniqueid'],_0x23c339[_0x53d4('0x41')]));recordings[_0x23c339[_0x53d4('0x5')]][_0x53d4('0x41')]=_0x23c339[_0x53d4('0x41')];}}catch(_0x2cdb45){utils[_0x53d4('0x15')](util['format'](_0x53d4('0x3f'),_0x23c339[_0x53d4('0x5')]),_0x2cdb45);}}; \ No newline at end of file +var _0x95fd=['name','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','uniqueid','linkedid','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','info','format','[%s][recordings][writeDB]','accountcode','getUserByInternal','then','membername'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0x95fd,0x17d));var _0xd95f=function(_0x430104,_0x3c4777){_0x430104=_0x430104-0x0;var _0x14d0b9=_0x95fd[_0x430104];return _0x14d0b9;};'use strict';var _=require(_0xd95f('0x0'));var util=require(_0xd95f('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x2fed87){utils[_0xd95f('0x2')](util[_0xd95f('0x3')](_0xd95f('0x4'),_0x2fed87['uniqueid']));if(_0x2fed87[_0xd95f('0x5')]){utils[_0xd95f('0x6')](_0x2fed87[_0xd95f('0x5')])[_0xd95f('0x7')](function(_0x493d40){if(_0x493d40){_0x2fed87[_0xd95f('0x8')]=_0x493d40[_0xd95f('0x9')];_0x2fed87['UserId']=_0x493d40['id'];}utils[_0xd95f('0xa')]('CreateVoiceRecording',_0x2fed87);});}else{utils[_0xd95f('0xa')](_0xd95f('0xb'),_0x2fed87);}}exports['newchannel']=function(_0x35c6c0){try{utils[_0xd95f('0xc')](util['format'](_0xd95f('0xd'),_0x35c6c0[_0xd95f('0xe')]),_0x35c6c0);if(_0x35c6c0[_0xd95f('0xe')]==_0x35c6c0[_0xd95f('0xf')]){utils['info'](util[_0xd95f('0x3')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x35c6c0[_0xd95f('0xe')],_0x35c6c0[_0xd95f('0x10')],_0x35c6c0['exten']));recordings[_0x35c6c0['uniqueid']]={'uniqueid':_0x35c6c0[_0xd95f('0xe')],'accountcode':_0x35c6c0[_0xd95f('0x5')],'exten':_0x35c6c0[_0xd95f('0x11')],'context':_0x35c6c0[_0xd95f('0x10')],'channel':_0x35c6c0[_0xd95f('0x12')],'monitors':[]};}}catch(_0x159aaf){utils[_0xd95f('0x13')](util[_0xd95f('0x3')](_0xd95f('0xd'),_0x35c6c0[_0xd95f('0xe')]),_0x159aaf);}};exports[_0xd95f('0x14')]=function(_0xbaf36d){try{utils[_0xd95f('0xc')](util['format'](_0xd95f('0x15'),_0xbaf36d[_0xd95f('0xe')]),_0xbaf36d);if(!_[_0xd95f('0x16')](recordings[_0xbaf36d[_0xd95f('0xe')]])&&_0xbaf36d[_0xd95f('0x17')]==0x6){utils[_0xd95f('0x2')](util[_0xd95f('0x3')](_0xd95f('0x18'),_0xbaf36d[_0xd95f('0xe')],_0xbaf36d[_0xd95f('0x10')],_0xbaf36d[_0xd95f('0x12')]));}else if(!_[_0xd95f('0x16')](recordings[_0xbaf36d[_0xd95f('0xf')]])&&_0xbaf36d['channelstate']==0x6&&_0xbaf36d[_0xd95f('0x10')]!=_0xd95f('0x19')){utils[_0xd95f('0x2')](util[_0xd95f('0x3')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0xbaf36d[_0xd95f('0xe')],_0xbaf36d[_0xd95f('0xf')],_0xbaf36d[_0xd95f('0x10')],_0xbaf36d[_0xd95f('0x12')]));recordings[_0xbaf36d[_0xd95f('0xf')]][_0xd95f('0x5')]=_0xbaf36d[_0xd95f('0x5')];}}catch(_0x5ae944){utils[_0xd95f('0x13')](util[_0xd95f('0x3')](_0xd95f('0x15'),_0xbaf36d[_0xd95f('0xe')]),_0x5ae944);}};exports[_0xd95f('0x1a')]=function(_0xbdae1){try{if(!_[_0xd95f('0x16')](_0xbdae1[_0xd95f('0x1b')])&&!_[_0xd95f('0x16')](_0xbdae1[_0xd95f('0x1b')][_0xd95f('0x1c')])){utils[_0xd95f('0xc')](util[_0xd95f('0x3')](_0xd95f('0x1d'),_0xbdae1[_0xd95f('0xe')]),_0xbdae1);utils[_0xd95f('0x2')](util[_0xd95f('0x3')](_0xd95f('0x1e'),_0xbdae1[_0xd95f('0xe')],_0xbdae1[_0xd95f('0x1b')],_0xbdae1[_0xd95f('0x1f')]));if(_[_0xd95f('0x20')](_0xbdae1[_0xd95f('0x1f')],_0xd95f('0x21'))){_0xbdae1[_0xd95f('0x1f')]=_0xbdae1[_0xd95f('0x1f')][_0xd95f('0x22')](_0xd95f('0x21'),_0xd95f('0x23'));}if(recordings[_0xbdae1['linkedid']]){var _0x11c675=_[_0xd95f('0x24')](recordings[_0xbdae1[_0xd95f('0xf')]][_0xd95f('0x25')],{'value':_0xbdae1[_0xd95f('0x1f')]});if(_[_0xd95f('0x16')](_0x11c675)){recordings[_0xbdae1[_0xd95f('0xf')]][_0xd95f('0x25')][_0xd95f('0x26')]({'value':_0xbdae1[_0xd95f('0x1f')]});}}}}catch(_0x909f5f){utils[_0xd95f('0x13')](util[_0xd95f('0x3')]('[%s][recordings][varset]',_0xbdae1[_0xd95f('0xe')]),_0x909f5f);}};exports[_0xd95f('0x27')]=function(_0x9a7076){try{if(!_['isNil'](recordings[_0x9a7076[_0xd95f('0xe')]])){utils[_0xd95f('0xc')](util[_0xd95f('0x3')](_0xd95f('0x28'),_0x9a7076[_0xd95f('0xe')]),_0x9a7076);utils['info'](util['format'](_0xd95f('0x29'),_0x9a7076['uniqueid'],_0x9a7076['calleridnum'],_0x9a7076[_0xd95f('0x2a')],_0x9a7076[_0xd95f('0x2b')]));recordings[_0x9a7076[_0xd95f('0xe')]]['calleridnum']=_0x9a7076[_0xd95f('0x2c')];recordings[_0x9a7076['uniqueid']][_0xd95f('0x2a')]=_0x9a7076[_0xd95f('0x2a')];recordings[_0x9a7076[_0xd95f('0xe')]][_0xd95f('0x2d')]=_0x9a7076['connectedlinenum'];recordings[_0x9a7076[_0xd95f('0xe')]][_0xd95f('0x2e')]=_0x9a7076['connectedlinename'];if(recordings[_0x9a7076['uniqueid']][_0xd95f('0x2f')]==_0xd95f('0x30')&&recordings[_0x9a7076['uniqueid']][_0xd95f('0x5')]){recordings[_0x9a7076[_0xd95f('0xe')]]['connectedlinenum']=recordings[_0x9a7076[_0xd95f('0xe')]][_0xd95f('0x5')];recordings[_0x9a7076[_0xd95f('0xe')]][_0xd95f('0x2e')]='';}recordings[_0x9a7076[_0xd95f('0xe')]]['monitors'][_0xd95f('0x31')](function(_0x4c6d49){var _0xa295f1=_[_0xd95f('0x32')](recordings[_0x9a7076[_0xd95f('0xe')]]);_0xa295f1[_0xd95f('0x1f')]=_0x4c6d49['value'];writeDB(_0xa295f1);});delete recordings[_0x9a7076[_0xd95f('0xe')]];}}catch(_0x3b557c){utils['error'](util['format'](_0xd95f('0x28'),_0x9a7076[_0xd95f('0xe')]),_0x3b557c);}};exports['newexten']=function(_0x4e8742){try{if(!_[_0xd95f('0x16')](recordings[_0x4e8742[_0xd95f('0xe')]])){utils['debug'](util[_0xd95f('0x3')](_0xd95f('0x33'),_0x4e8742[_0xd95f('0xe')]),_0x4e8742);utils[_0xd95f('0x2')](util[_0xd95f('0x3')](_0xd95f('0x34'),_0x4e8742[_0xd95f('0xe')],_0x4e8742[_0xd95f('0x35')],_0x4e8742[_0xd95f('0x36')]));if(_0x4e8742['application']['toLowerCase']()==_0xd95f('0x37')&&_[_0xd95f('0x38')](_0x4e8742['appdata']['toLowerCase'](),_0xd95f('0x39'))){var _0x2b8047=_0x4e8742['appdata'][_0xd95f('0x3a')]('=');var _0x4b1c6c=_0x2b8047[0x0][_0xd95f('0x3b')](_0x2b8047[0x0][_0xd95f('0x3c')]('(')+0x1,_0x2b8047[0x0][_0xd95f('0x3c')](')'));var _0x1b7236=_0x2b8047[0x1];recordings[_0x4e8742[_0xd95f('0xe')]][_0x4b1c6c]=_0x1b7236;}}}catch(_0x2c4f85){utils[_0xd95f('0x13')](util[_0xd95f('0x3')](_0xd95f('0x33'),_0x4e8742[_0xd95f('0xe')]),_0x2c4f85);}};exports[_0xd95f('0x3d')]=function(_0x5ef0d8){try{if(!_[_0xd95f('0x16')](recordings[_0x5ef0d8[_0xd95f('0xe')]])){utils[_0xd95f('0xc')](util['format'](_0xd95f('0x3e'),_0x5ef0d8[_0xd95f('0xe')]),_0x5ef0d8);utils[_0xd95f('0x2')](util[_0xd95f('0x3')](_0xd95f('0x3f'),_0x5ef0d8[_0xd95f('0xe')],_0x5ef0d8[_0xd95f('0x40')]));recordings[_0x5ef0d8[_0xd95f('0xe')]]['queue']=_0x5ef0d8[_0xd95f('0x40')];}}catch(_0x53024a){utils['error'](util[_0xd95f('0x3')](_0xd95f('0x3e'),_0x5ef0d8['uniqueid']),_0x53024a);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 247a133..8e53d97 100644 --- a/server/services/xdr/transfers.controller.js +++ b/server/services/xdr/transfers.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5af4=['util','info','format','[%s][transfers][writeDB]\x20type:%s','attended','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','transfereecalleridname','type','blind','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0x5af4,0x110));var _0x45af=function(_0x45e4ba,_0x1d4c91){_0x45e4ba=_0x45e4ba-0x0;var _0x3cb4d0=_0x5af4[_0x45e4ba];return _0x3cb4d0;};'use strict';var _=require(_0x45af('0x0'));var util=require(_0x45af('0x1'));var utils=require('./utils');function writeDB(_0xec7cb1){utils[_0x45af('0x2')](util[_0x45af('0x3')](_0x45af('0x4'),_0xec7cb1['type']===_0x45af('0x5')?_0xec7cb1['origtransfereruniqueid']:_0xec7cb1[_0x45af('0x6')],_0xec7cb1['type']));utils[_0x45af('0x7')](_0x45af('0x8'),_0xec7cb1);}exports[_0x45af('0x9')]=function(_0x256fe8){try{utils[_0x45af('0xa')](util[_0x45af('0x3')](_0x45af('0xb'),_0x256fe8[_0x45af('0x6')]),_0x256fe8);utils[_0x45af('0x2')](util[_0x45af('0x3')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x256fe8[_0x45af('0x6')],_0x256fe8['transferercalleridnum'],_0x256fe8['transferercalleridname'],_0x256fe8['transfereecalleridnum'],_0x256fe8[_0x45af('0xc')]));_0x256fe8[_0x45af('0xd')]=_0x45af('0xe');writeDB(_0x256fe8);}catch(_0xd4597a){utils['error'](util['format'](_0x45af('0xb'),_0x256fe8[_0x45af('0x6')]),_0xd4597a);}};exports['attendedtransfer']=function(_0x386ff8){try{utils['debug'](util['format'](_0x45af('0xf'),_0x386ff8[_0x45af('0x10')]),_0x386ff8);utils[_0x45af('0x2')](util[_0x45af('0x3')](_0x45af('0x11'),_0x386ff8['origtransfereruniqueid'],_0x386ff8[_0x45af('0x12')],_0x386ff8[_0x45af('0x13')],_0x386ff8[_0x45af('0x14')],_0x386ff8[_0x45af('0x15')]));_0x386ff8=_[_0x45af('0x16')](_0x386ff8,{'transfererchannel':_0x386ff8[_0x45af('0x17')],'transferercalleridnum':_0x386ff8[_0x45af('0x12')],'transferercalleridname':_0x386ff8[_0x45af('0x13')],'transfererconnectedlinenum':_0x386ff8[_0x45af('0x18')],'transfererconnectedlinename':_0x386ff8[_0x45af('0x19')],'transfereraccountcode':_0x386ff8['origtransfereraccountcode'],'transferercontext':_0x386ff8[_0x45af('0x1a')],'transfererexten':_0x386ff8[_0x45af('0x1b')],'transfererlinkedid':_0x386ff8['origtransfererlinkedid'],'context':_0x386ff8[_0x45af('0x1c')],'extension':_0x386ff8[_0x45af('0x1d')],'type':'attended'});if(_[_0x45af('0x1e')](_0x386ff8['transfereechannel'])){_0x386ff8=_[_0x45af('0x16')](_0x386ff8,{'transfereechannel':_0x386ff8[_0x45af('0x1f')],'transfereecalleridnum':_0x386ff8[_0x45af('0x14')],'transfereecalleridname':_0x386ff8['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x386ff8[_0x45af('0x20')],'transfereeconnectedlinename':_0x386ff8[_0x45af('0x21')],'transfereeaccountcode':_0x386ff8[_0x45af('0x22')],'transfereecontext':_0x386ff8[_0x45af('0x23')],'transfereeexten':_0x386ff8[_0x45af('0x24')],'transfereelinkedid':_0x386ff8[_0x45af('0x25')]});}writeDB(_0x386ff8);}catch(_0x3494e1){utils[_0x45af('0x26')](util['format'](_0x45af('0xf'),_0x386ff8[_0x45af('0x10')]),_0x3494e1);}}; \ No newline at end of file +var _0x2035=['transfereecalleridnum','transfereecalleridname','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','origtransferercalleridnum','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname'];(function(_0x551cb6,_0x4615fb){var _0x418004=function(_0x599124){while(--_0x599124){_0x551cb6['push'](_0x551cb6['shift']());}};_0x418004(++_0x4615fb);}(_0x2035,0x162));var _0x5203=function(_0x28a8b0,_0x37cb89){_0x28a8b0=_0x28a8b0-0x0;var _0x3c628d=_0x2035[_0x28a8b0];return _0x3c628d;};'use strict';var _=require(_0x5203('0x0'));var util=require(_0x5203('0x1'));var utils=require(_0x5203('0x2'));function writeDB(_0x1282b0){utils[_0x5203('0x3')](util[_0x5203('0x4')](_0x5203('0x5'),_0x1282b0[_0x5203('0x6')]===_0x5203('0x7')?_0x1282b0[_0x5203('0x8')]:_0x1282b0[_0x5203('0x9')],_0x1282b0[_0x5203('0x6')]));utils[_0x5203('0xa')]('CreateVoiceTransferReport',_0x1282b0);}exports[_0x5203('0xb')]=function(_0x429306){try{utils['debug'](util['format'](_0x5203('0xc'),_0x429306['uniqueid']),_0x429306);utils[_0x5203('0x3')](util['format'](_0x5203('0xd'),_0x429306[_0x5203('0x9')],_0x429306['transferercalleridnum'],_0x429306[_0x5203('0xe')],_0x429306[_0x5203('0xf')],_0x429306[_0x5203('0x10')]));_0x429306['type']='blind';writeDB(_0x429306);}catch(_0x19da77){utils[_0x5203('0x11')](util['format'](_0x5203('0xc'),_0x429306[_0x5203('0x9')]),_0x19da77);}};exports[_0x5203('0x12')]=function(_0x7efb70){try{utils[_0x5203('0x13')](util[_0x5203('0x4')](_0x5203('0x14'),_0x7efb70[_0x5203('0x8')]),_0x7efb70);utils[_0x5203('0x3')](util[_0x5203('0x4')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x7efb70['origtransfereruniqueid'],_0x7efb70[_0x5203('0x15')],_0x7efb70['origtransferercalleridname'],_0x7efb70['transfertargetcalleridnum'],_0x7efb70['transfertargetcalleridname']));_0x7efb70=_[_0x5203('0x16')](_0x7efb70,{'transfererchannel':_0x7efb70[_0x5203('0x17')],'transferercalleridnum':_0x7efb70[_0x5203('0x15')],'transferercalleridname':_0x7efb70[_0x5203('0x18')],'transfererconnectedlinenum':_0x7efb70['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x7efb70[_0x5203('0x19')],'transfereraccountcode':_0x7efb70[_0x5203('0x1a')],'transferercontext':_0x7efb70[_0x5203('0x1b')],'transfererexten':_0x7efb70[_0x5203('0x1c')],'transfererlinkedid':_0x7efb70[_0x5203('0x1d')],'context':_0x7efb70[_0x5203('0x1e')],'extension':_0x7efb70[_0x5203('0x1f')],'type':'attended'});if(_[_0x5203('0x20')](_0x7efb70[_0x5203('0x21')])){_0x7efb70=_[_0x5203('0x16')](_0x7efb70,{'transfereechannel':_0x7efb70[_0x5203('0x22')],'transfereecalleridnum':_0x7efb70['transfertargetcalleridnum'],'transfereecalleridname':_0x7efb70[_0x5203('0x23')],'transfereeconnectedlinenum':_0x7efb70[_0x5203('0x24')],'transfereeconnectedlinename':_0x7efb70[_0x5203('0x25')],'transfereeaccountcode':_0x7efb70[_0x5203('0x26')],'transfereecontext':_0x7efb70['transfertargetcontext'],'transfereeexten':_0x7efb70[_0x5203('0x27')],'transfereelinkedid':_0x7efb70[_0x5203('0x28')]});}writeDB(_0x7efb70);}catch(_0x2f22a2){utils[_0x5203('0x11')](util['format']('[%s][transfers][attendedtransfer]',_0x7efb70['origtransfereruniqueid']),_0x2f22a2);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 7a97f1a..ed42b8f 100644 --- a/server/services/xdr/utils.js +++ b/server/services/xdr/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9613=['found','notfound','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','request','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','diff','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','../../config/logger','xdr','info','debug','inspect','error','then','[utils][request]\x20name:%s','catch','GetUser','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s'];(function(_0x1b8bd2,_0x5cfee5){var _0x30be3d=function(_0x4f909a){while(--_0x4f909a){_0x1b8bd2['push'](_0x1b8bd2['shift']());}};_0x30be3d(++_0x5cfee5);}(_0x9613,0x1c9));var _0x3961=function(_0x327f49,_0x18eb4a){_0x327f49=_0x327f49-0x0;var _0x412971=_0x9613[_0x327f49];return _0x412971;};'use strict';var BPromise=require(_0x3961('0x0'));var jayson=require(_0x3961('0x1'));var moment=require(_0x3961('0x2'));var util=require(_0x3961('0x3'));var client=jayson['client'][_0x3961('0x4')]({'port':0x2329});var logger=require(_0x3961('0x5'))(_0x3961('0x6'));exports[_0x3961('0x7')]=function(_0x5f567d,_0x26b49c){logger['info'](_0x5f567d,_0x26b49c?util['inspect'](_0x26b49c,{'showHidden':![],'depth':null}):'');};exports[_0x3961('0x8')]=function(_0x2961c5,_0x263945){logger['debug'](_0x2961c5,_0x263945?util[_0x3961('0x9')](_0x263945,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x1a5b9c,_0x90f92d){logger[_0x3961('0xa')](_0x1a5b9c,_0x90f92d?util[_0x3961('0x9')](_0x90f92d,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x28d010,_0x35d560){return client['request'](_0x28d010,{'body':_0x35d560})[_0x3961('0xb')](function(_0x8994f6){logger[_0x3961('0x8')](_0x3961('0xc'),_0x28d010,_0x8994f6?util[_0x3961('0x9')](_0x8994f6,{'showHidden':![],'depth':null}):'');})[_0x3961('0xd')](function(_0x5558af){logger[_0x3961('0xa')]('[utils][request]\x20name:%s',_0x28d010,_0x5558af?util[_0x3961('0x9')](_0x5558af,{'showHidden':![],'depth':null}):'');});};function getUser(_0x55e0b0){return client['request'](_0x3961('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0x3961('0xf'),_0x3961('0x10')],'where':_0x55e0b0,'limit':0x1}})[_0x3961('0xb')](function(_0x348c1b){logger[_0x3961('0x8')](_0x3961('0x11'),JSON[_0x3961('0x12')](_0x55e0b0),_0x348c1b?util[_0x3961('0x9')](_0x348c1b,{'showHidden':![],'depth':null}):'');return _0x348c1b[_0x3961('0x13')][_0x3961('0x14')]?_0x348c1b[_0x3961('0x13')][0x0]:null;});}exports[_0x3961('0x15')]=function(_0x147a5a){return new BPromise(function(_0x4fce93,_0x9f301d){if(_0x147a5a){return getUser({'internal':_0x147a5a})[_0x3961('0xb')](function(_0x59f928){logger[_0x3961('0x7')](_0x3961('0x16'),_0x147a5a,_0x59f928?_0x3961('0x17'):_0x3961('0x18'));return _0x4fce93(_0x59f928);})[_0x3961('0xd')](function(_0x26e63d){logger[_0x3961('0xa')]('[utils][getUserByInternal]',_0x26e63d?util['inspect'](_0x26e63d,{'showHidden':![],'depth':null}):'');return _0x4fce93(null);});}return _0x4fce93(null);});};exports['getUserByInterface']=function(_0x59e022){return new BPromise(function(_0x2744fd,_0x1b9219){if(_0x59e022){return getUser({'interface':_0x59e022})[_0x3961('0xb')](function(_0x273279){logger[_0x3961('0x7')](_0x3961('0x19'),_0x59e022,_0x273279?_0x3961('0x17'):_0x3961('0x18'));return _0x2744fd(_0x273279);})[_0x3961('0xd')](function(_0x255608){logger['error'](_0x3961('0x1a'),_0x255608?util[_0x3961('0x9')](_0x255608,{'showHidden':![],'depth':null}):'');return _0x2744fd(null);});}return _0x2744fd(null);});};exports[_0x3961('0x1b')]=function(_0x158f5a){return new BPromise(function(_0x5c06f3,_0x3e366c){if(_0x158f5a){return getUser({'name':_0x158f5a})[_0x3961('0xb')](function(_0x12b628){logger[_0x3961('0x7')](_0x3961('0x1c'),_0x158f5a,_0x12b628?_0x3961('0x17'):'notfound');return _0x5c06f3(_0x12b628);})[_0x3961('0xd')](function(_0x4110c4){logger['error'](_0x3961('0x1d'),_0x4110c4?util['inspect'](_0x4110c4,{'showHidden':![],'depth':null}):'');return _0x5c06f3(null);});}return _0x5c06f3(null);});};exports[_0x3961('0x1e')]=function(_0x526e4a){return new BPromise(function(_0x5d3405,_0x1ca41d){if(_0x526e4a){return client[_0x3961('0x1f')](_0x3961('0x20'),{'options':{'raw':!![],'attributes':['id','name','type',_0x3961('0x21'),_0x3961('0x22')],'where':{'name':_0x526e4a},'limit':0x1}})['then'](function(_0x191b7d){logger['debug'](_0x3961('0x23'),_0x526e4a,_0x191b7d?util[_0x3961('0x9')](_0x191b7d,{'showHidden':![],'depth':null}):'');logger[_0x3961('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x526e4a,_0x191b7d?_0x3961('0x17'):'notfound');return _0x5d3405(_0x191b7d['result']['length']?_0x191b7d[_0x3961('0x13')][0x0]:null);})[_0x3961('0xd')](function(_0x3d496d){logger[_0x3961('0xa')](_0x3961('0x24'),_0x3d496d?util[_0x3961('0x9')](_0x3d496d,{'showHidden':![],'depth':null}):'');return _0x5d3405(null);});}return _0x5d3405(null);});};exports[_0x3961('0x25')]=function(_0x4734cb,_0x55e1be){return moment(_0x4734cb)[_0x3961('0x26')](_0x55e1be,_0x3961('0x27'))['format'](_0x3961('0x28'));};exports[_0x3961('0x29')]=function(_0x1e9385,_0x426d64){return moment(_0x1e9385)[_0x3961('0x2a')](_0x426d64,_0x3961('0x27'))[_0x3961('0x2b')](_0x3961('0x28'));};exports['diffTime']=function(_0x46ba97,_0xe3ace7){return moment(_0x46ba97)[_0x3961('0x2c')](moment(_0xe3ace7),_0x3961('0x27'));};exports[_0x3961('0x2d')]=function(_0x3015ec,_0x5b1b5a){return parseInt(_0x3015ec,0xa)+parseInt(_0x5b1b5a,0xa);};exports['now']=function(){return moment()[_0x3961('0x2b')](_0x3961('0x28'));};exports[_0x3961('0x2e')]=function(_0x5a4812,_0x2c4b29){if(_0x2c4b29){return moment(_0x5a4812)[_0x3961('0x2e')](_0x2c4b29);}return!![];};exports['isBefore']=function(_0x345c83,_0x50652a){if(_0x50652a){return moment(_0x345c83)[_0x3961('0x2f')](_0x50652a);}else if(_0x345c83){return!![];}return![];}; \ No newline at end of file +var _0x60b0=['getUserByInternal','then','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','seconds','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','../../config/logger','xdr','info','debug','inspect','error','request','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','length','result'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x60b0,0x77));var _0x060b=function(_0x4de877,_0x340170){_0x4de877=_0x4de877-0x0;var _0xb2cfeb=_0x60b0[_0x4de877];return _0xb2cfeb;};'use strict';var BPromise=require(_0x060b('0x0'));var jayson=require(_0x060b('0x1'));var moment=require(_0x060b('0x2'));var util=require(_0x060b('0x3'));var client=jayson[_0x060b('0x4')]['http']({'port':0x2329});var logger=require(_0x060b('0x5'))(_0x060b('0x6'));exports['info']=function(_0x527216,_0x4fa7d3){logger[_0x060b('0x7')](_0x527216,_0x4fa7d3?util['inspect'](_0x4fa7d3,{'showHidden':![],'depth':null}):'');};exports[_0x060b('0x8')]=function(_0x443c79,_0x222945){logger['debug'](_0x443c79,_0x222945?util[_0x060b('0x9')](_0x222945,{'showHidden':![],'depth':null}):'');};exports[_0x060b('0xa')]=function(_0x8cc615,_0xa6ac17){logger[_0x060b('0xa')](_0x8cc615,_0xa6ac17?util['inspect'](_0xa6ac17,{'showHidden':![],'depth':null}):'');};exports[_0x060b('0xb')]=function(_0x1bbc0f,_0x160fed){return client[_0x060b('0xb')](_0x1bbc0f,{'body':_0x160fed})['then'](function(_0x451ffd){logger[_0x060b('0x8')](_0x060b('0xc'),_0x1bbc0f,_0x451ffd?util[_0x060b('0x9')](_0x451ffd,{'showHidden':![],'depth':null}):'');})[_0x060b('0xd')](function(_0x570065){logger['error']('[utils][request]\x20name:%s',_0x1bbc0f,_0x570065?util[_0x060b('0x9')](_0x570065,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1c3796){return client[_0x060b('0xb')](_0x060b('0xe'),{'options':{'raw':!![],'attributes':['id',_0x060b('0xf'),_0x060b('0x10'),_0x060b('0x11')],'where':_0x1c3796,'limit':0x1}})['then'](function(_0x4190b5){logger[_0x060b('0x8')](_0x060b('0x12'),JSON[_0x060b('0x13')](_0x1c3796),_0x4190b5?util[_0x060b('0x9')](_0x4190b5,{'showHidden':![],'depth':null}):'');return _0x4190b5['result'][_0x060b('0x14')]?_0x4190b5[_0x060b('0x15')][0x0]:null;});}exports[_0x060b('0x16')]=function(_0x4194c9){return new BPromise(function(_0x3cce9c,_0x2f9beb){if(_0x4194c9){return getUser({'internal':_0x4194c9})[_0x060b('0x17')](function(_0x61bb65){logger['info'](_0x060b('0x18'),_0x4194c9,_0x61bb65?_0x060b('0x19'):_0x060b('0x1a'));return _0x3cce9c(_0x61bb65);})[_0x060b('0xd')](function(_0x3ef756){logger[_0x060b('0xa')]('[utils][getUserByInternal]',_0x3ef756?util[_0x060b('0x9')](_0x3ef756,{'showHidden':![],'depth':null}):'');return _0x3cce9c(null);});}return _0x3cce9c(null);});};exports[_0x060b('0x1b')]=function(_0x31d8b6){return new BPromise(function(_0x2572bb,_0x26215f){if(_0x31d8b6){return getUser({'interface':_0x31d8b6})[_0x060b('0x17')](function(_0x94d29e){logger[_0x060b('0x7')](_0x060b('0x1c'),_0x31d8b6,_0x94d29e?_0x060b('0x19'):_0x060b('0x1a'));return _0x2572bb(_0x94d29e);})[_0x060b('0xd')](function(_0x340b73){logger[_0x060b('0xa')]('[utils][getUserByInterface]',_0x340b73?util[_0x060b('0x9')](_0x340b73,{'showHidden':![],'depth':null}):'');return _0x2572bb(null);});}return _0x2572bb(null);});};exports[_0x060b('0x1d')]=function(_0x16aa9a){return new BPromise(function(_0x28b4f9,_0x5d129b){if(_0x16aa9a){return getUser({'name':_0x16aa9a})[_0x060b('0x17')](function(_0x2dbff7){logger[_0x060b('0x7')](_0x060b('0x1e'),_0x16aa9a,_0x2dbff7?'found':_0x060b('0x1a'));return _0x28b4f9(_0x2dbff7);})['catch'](function(_0xea3717){logger[_0x060b('0xa')](_0x060b('0x1f'),_0xea3717?util[_0x060b('0x9')](_0xea3717,{'showHidden':![],'depth':null}):'');return _0x28b4f9(null);});}return _0x28b4f9(null);});};exports[_0x060b('0x20')]=function(_0x5b3c8b){return new BPromise(function(_0x524293,_0x2a3523){if(_0x5b3c8b){return client[_0x060b('0xb')](_0x060b('0x21'),{'options':{'raw':!![],'attributes':['id',_0x060b('0x10'),_0x060b('0x22'),'acw',_0x060b('0x23')],'where':{'name':_0x5b3c8b},'limit':0x1}})[_0x060b('0x17')](function(_0x39536d){logger[_0x060b('0x8')](_0x060b('0x24'),_0x5b3c8b,_0x39536d?util[_0x060b('0x9')](_0x39536d,{'showHidden':![],'depth':null}):'');logger[_0x060b('0x7')](_0x060b('0x25'),_0x5b3c8b,_0x39536d?_0x060b('0x19'):_0x060b('0x1a'));return _0x524293(_0x39536d['result'][_0x060b('0x14')]?_0x39536d['result'][0x0]:null);})[_0x060b('0xd')](function(_0x110d05){logger['error']('[utils][getVoiceQueueByName]',_0x110d05?util['inspect'](_0x110d05,{'showHidden':![],'depth':null}):'');return _0x524293(null);});}return _0x524293(null);});};exports['addTime']=function(_0x435078,_0x19edbf){return moment(_0x435078)['add'](_0x19edbf,'seconds')[_0x060b('0x26')](_0x060b('0x27'));};exports[_0x060b('0x28')]=function(_0xaadc9a,_0x51903c){return moment(_0xaadc9a)['subtract'](_0x51903c,_0x060b('0x29'))[_0x060b('0x26')](_0x060b('0x27'));};exports['diffTime']=function(_0x349f81,_0x3241e9){return moment(_0x349f81)[_0x060b('0x2a')](moment(_0x3241e9),_0x060b('0x29'));};exports[_0x060b('0x2b')]=function(_0x4d25aa,_0x541fd6){return parseInt(_0x4d25aa,0xa)+parseInt(_0x541fd6,0xa);};exports[_0x060b('0x2c')]=function(){return moment()['format'](_0x060b('0x27'));};exports['isAfter']=function(_0x2125a2,_0x34491d){if(_0x34491d){return moment(_0x2125a2)[_0x060b('0x2d')](_0x34491d);}return!![];};exports[_0x060b('0x2e')]=function(_0x286706,_0x5e4240){if(_0x5e4240){return moment(_0x286706)['isBefore'](_0x5e4240);}else if(_0x286706){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 5ab2a25..1b3c599 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x169c=['%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','url','device','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','xcally','join','client','ensureDir','catch','log','user','then','data','timestamp','error','api','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','name','role','agent_id'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x169c,0xe8));var _0xc169=function(_0x22ee0f,_0x22e6d2){_0x22ee0f=_0x22ee0f-0x0;var _0x204696=_0x169c[_0x22ee0f];return _0x204696;};var fs=require(_0xc169('0x0'));var _=require(_0xc169('0x1'));var ewinston=require(_0xc169('0x2'));var path=require(_0xc169('0x3'));var util=require(_0xc169('0x4'));var fileLogger=require(_0xc169('0x5'))[_0xc169('0x6')];var safeTemplate=require(_0xc169('0x7'))['safeTemplate'];var maskSensitiveData=require('./mask-sensitive-data')['maskSensitiveData'];function ClientSideLogger(){function _0x226753(_0x155648){var _0x1f5871=path['join']('/var','log',_0xc169('0x8'));var _0x4d7691=path[_0xc169('0x9')](_0xc169('0xa'),_0x155648['role']+'-'+_0x155648['name']);return fs[_0xc169('0xb')](path['join'](_0x1f5871,_0x4d7691))['then'](function(){var _0x4e5f28=fileLogger('client',path[_0xc169('0x9')](_0x1f5871,_0x4d7691));return _0x4e5f28;})[_0xc169('0xc')](function(_0x1db39f){throw _0x1db39f;});}this[_0xc169('0xd')]=function(_0x43cf89,_0x2ff8fa,_0x5985fa,_0x2dd0bf){return _0x226753(_0x43cf89[_0xc169('0xe')])[_0xc169('0xf')](function(_0xef0a2b){var _0x51f61c=_0xef0a2b[_0x2ff8fa];return _0x51f61c;})[_0xc169('0xf')](function(_0x11ecb8){var _0x4c80e2=_0x43cf89[_0xc169('0xe')]?_0x43cf89[_0xc169('0xe')]['id']:'no-user';var _0x8564b2=_0x2dd0bf[_0xc169('0x10')];var _0x2c302b=_0x2dd0bf[_0xc169('0x11')];var _0x209325=new Date(Number(_0x2c302b));return _0x11ecb8(_0x4c80e2,_0x209325,_0x5985fa,_0x8564b2);})[_0xc169('0xc')](function(_0x13735b){fileLogger(_0xc169('0xa'))[_0xc169('0x12')](_0x13735b);});};}function setupLoggers(_0xe254f1){return new Promise(function(_0x4be756){var _0xd9a4aa=new ClientSideLogger();var _0x4c6330=fileLogger(_0xc169('0x13'));var _0x51a1bf=fileLogger('auth');_0xe254f1[_0xc169('0x14')](_0xc169('0x15'),_0xd9a4aa);_0xe254f1[_0xc169('0x16')](ewinston[_0xc169('0x17')]({'winstonInstance':_0x4c6330,'meta':![],'statusLevels':!![],'msg':function(_0x2debb7,_0x4a45e0){var _0x305848=_0xc169('0x18');if(!_['isEmpty'](_0x2debb7[_0xc169('0x19')])){_0x305848+=_0xc169('0x1a');var _0x4ed00a=_0x2debb7[_0xc169('0x19')];maskSensitiveData(_0x4ed00a);}return safeTemplate(util[_0xc169('0x1b')](_0x305848,_0x2debb7[_0xc169('0x1c')],_0x2debb7[_0xc169('0x1d')][_0xc169('0x1e')]?_0x2debb7['headers'][_0xc169('0x1e')]:_0x2debb7[_0xc169('0x1f')][_0xc169('0x20')]||_0x2debb7['ip'],_0x2debb7['url'],_0x4a45e0[_0xc169('0x21')],_0x4a45e0[_0xc169('0x22')],_0x2debb7[_0xc169('0xe')]?_0x2debb7[_0xc169('0xe')]['id']:null,_0x2debb7['user']?_0x2debb7['user'][_0xc169('0x23')]:null,_0x2debb7['user']?_0x2debb7[_0xc169('0xe')][_0xc169('0x24')]:null,_0x4ed00a?util['inspect'](_0x4ed00a,![],null):''));}}));_0xe254f1[_0xc169('0x16')](ewinston['logger']({'winstonInstance':_0x51a1bf,'meta':![],'statusLevels':!![],'msg':function(_0x1a0bed,_0x4cb875){var _0x5bdf24='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x1a0bed[_0xc169('0x19')]&&_0x1a0bed[_0xc169('0x19')]['device']&&_0x1a0bed[_0xc169('0x19')][_0xc169('0x25')]){_0x5bdf24=_0xc169('0x26');}return util['format'](_0x5bdf24,_0x1a0bed[_0xc169('0x1c')],_0x1a0bed[_0xc169('0x1d')][_0xc169('0x1e')]?_0x1a0bed[_0xc169('0x1d')]['x-forwarded-for']:_0x1a0bed[_0xc169('0x1f')][_0xc169('0x20')]||_0x1a0bed['ip'],_0x1a0bed[_0xc169('0x27')],_0x4cb875[_0xc169('0x21')],_0x4cb875[_0xc169('0x22')],_0x1a0bed[_0xc169('0xe')]?_0x1a0bed[_0xc169('0xe')]['id']:null,_0x1a0bed[_0xc169('0xe')]?_0x1a0bed[_0xc169('0xe')][_0xc169('0x23')]:null,_0x1a0bed[_0xc169('0xe')]?_0x1a0bed[_0xc169('0xe')][_0xc169('0x24')]:null,_0x1a0bed[_0xc169('0x19')]&&_0x1a0bed['body'][_0xc169('0x28')]?_0x1a0bed[_0xc169('0x19')][_0xc169('0x28')]:_0xc169('0x29'),_0x1a0bed[_0xc169('0x19')]&&_0x1a0bed[_0xc169('0x19')][_0xc169('0x25')]?_0x1a0bed['body']['agent_id']:'',_0x1a0bed[_0xc169('0x19')]&&_0x1a0bed[_0xc169('0x19')][_0xc169('0x2a')]?_0x1a0bed['body'][_0xc169('0x2a')]:'');},'ignoreRoute':function(_0xff971f){var _0xd427bd=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xd427bd[_0xc169('0x2b')](_0xff971f[_0xc169('0x27')]);}}));return _0x4be756();});}exports[_0xc169('0x2c')]=setupLoggers; \ No newline at end of file +var _0x1fbc=['%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','headers','other','agent_name','test','fs-extra','express-winston','path','util','fileLogger','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','name','ensureDir','then','catch','user','no-user','data','timestamp','error','api','auth','set','client-side-logger','use','logger','isEmpty','body','\x20body=%s','format','method','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime'];(function(_0x73ba5,_0x2c2ae7){var _0x5ab252=function(_0x48d75f){while(--_0x48d75f){_0x73ba5['push'](_0x73ba5['shift']());}};_0x5ab252(++_0x2c2ae7);}(_0x1fbc,0x11b));var _0xc1fb=function(_0x5ecc12,_0x586122){_0x5ecc12=_0x5ecc12-0x0;var _0x45f35a=_0x1fbc[_0x5ecc12];return _0x45f35a;};var fs=require(_0xc1fb('0x0'));var _=require('lodash');var ewinston=require(_0xc1fb('0x1'));var path=require(_0xc1fb('0x2'));var util=require(_0xc1fb('0x3'));var fileLogger=require('./loggers')[_0xc1fb('0x4')];var safeTemplate=require('./safe-template')[_0xc1fb('0x5')];var maskSensitiveData=require(_0xc1fb('0x6'))[_0xc1fb('0x7')];function ClientSideLogger(){function _0x463c95(_0x4e3d82){var _0x42fbc7=path[_0xc1fb('0x8')](_0xc1fb('0x9'),_0xc1fb('0xa'),_0xc1fb('0xb'));var _0x8b1bab=path['join'](_0xc1fb('0xc'),_0x4e3d82['role']+'-'+_0x4e3d82[_0xc1fb('0xd')]);return fs[_0xc1fb('0xe')](path['join'](_0x42fbc7,_0x8b1bab))[_0xc1fb('0xf')](function(){var _0x566d16=fileLogger(_0xc1fb('0xc'),path[_0xc1fb('0x8')](_0x42fbc7,_0x8b1bab));return _0x566d16;})[_0xc1fb('0x10')](function(_0x29bef7){throw _0x29bef7;});}this['log']=function(_0x475abc,_0x1cf7ef,_0x4f1de5,_0x523aff){return _0x463c95(_0x475abc[_0xc1fb('0x11')])[_0xc1fb('0xf')](function(_0x539ed5){var _0x194b8a=_0x539ed5[_0x1cf7ef];return _0x194b8a;})[_0xc1fb('0xf')](function(_0x16b4bb){var _0x15e9c0=_0x475abc[_0xc1fb('0x11')]?_0x475abc[_0xc1fb('0x11')]['id']:_0xc1fb('0x12');var _0xd07036=_0x523aff[_0xc1fb('0x13')];var _0x1437a7=_0x523aff[_0xc1fb('0x14')];var _0x169ccf=new Date(Number(_0x1437a7));return _0x16b4bb(_0x15e9c0,_0x169ccf,_0x4f1de5,_0xd07036);})[_0xc1fb('0x10')](function(_0x2f1139){fileLogger(_0xc1fb('0xc'))[_0xc1fb('0x15')](_0x2f1139);});};}function setupLoggers(_0x344865){return new Promise(function(_0x49d199){var _0xd36626=new ClientSideLogger();var _0xd688af=fileLogger(_0xc1fb('0x16'));var _0x38beeb=fileLogger(_0xc1fb('0x17'));_0x344865[_0xc1fb('0x18')](_0xc1fb('0x19'),_0xd36626);_0x344865[_0xc1fb('0x1a')](ewinston[_0xc1fb('0x1b')]({'winstonInstance':_0xd688af,'meta':![],'statusLevels':!![],'msg':function(_0x239865,_0x1d9586){var _0x1f351e='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0xc1fb('0x1c')](_0x239865[_0xc1fb('0x1d')])){_0x1f351e+=_0xc1fb('0x1e');var _0x4788c4=_0x239865[_0xc1fb('0x1d')];maskSensitiveData(_0x4788c4);}return safeTemplate(util[_0xc1fb('0x1f')](_0x1f351e,_0x239865[_0xc1fb('0x20')],_0x239865['headers'][_0xc1fb('0x21')]?_0x239865['headers']['x-forwarded-for']:_0x239865[_0xc1fb('0x22')][_0xc1fb('0x23')]||_0x239865['ip'],_0x239865[_0xc1fb('0x24')],_0x1d9586[_0xc1fb('0x25')],_0x1d9586[_0xc1fb('0x26')],_0x239865[_0xc1fb('0x11')]?_0x239865[_0xc1fb('0x11')]['id']:null,_0x239865[_0xc1fb('0x11')]?_0x239865[_0xc1fb('0x11')][_0xc1fb('0xd')]:null,_0x239865[_0xc1fb('0x11')]?_0x239865[_0xc1fb('0x11')]['role']:null,_0x4788c4?util['inspect'](_0x4788c4,![],null):''));}}));_0x344865[_0xc1fb('0x1a')](ewinston[_0xc1fb('0x1b')]({'winstonInstance':_0x38beeb,'meta':![],'statusLevels':!![],'msg':function(_0x2ba7cc,_0x8fb284){var _0x10a898=_0xc1fb('0x27');if(_0x2ba7cc[_0xc1fb('0x1d')]&&_0x2ba7cc[_0xc1fb('0x1d')][_0xc1fb('0x28')]&&_0x2ba7cc[_0xc1fb('0x1d')][_0xc1fb('0x29')]){_0x10a898='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x10a898,_0x2ba7cc['method'],_0x2ba7cc[_0xc1fb('0x2a')]['x-forwarded-for']?_0x2ba7cc[_0xc1fb('0x2a')]['x-forwarded-for']:_0x2ba7cc['connection'][_0xc1fb('0x23')]||_0x2ba7cc['ip'],_0x2ba7cc['url'],_0x8fb284[_0xc1fb('0x25')],_0x8fb284[_0xc1fb('0x26')],_0x2ba7cc['user']?_0x2ba7cc[_0xc1fb('0x11')]['id']:null,_0x2ba7cc[_0xc1fb('0x11')]?_0x2ba7cc['user'][_0xc1fb('0xd')]:null,_0x2ba7cc[_0xc1fb('0x11')]?_0x2ba7cc['user']['role']:null,_0x2ba7cc[_0xc1fb('0x1d')]&&_0x2ba7cc[_0xc1fb('0x1d')]['device']?_0x2ba7cc[_0xc1fb('0x1d')]['device']:_0xc1fb('0x2b'),_0x2ba7cc[_0xc1fb('0x1d')]&&_0x2ba7cc[_0xc1fb('0x1d')]['agent_id']?_0x2ba7cc[_0xc1fb('0x1d')]['agent_id']:'',_0x2ba7cc[_0xc1fb('0x1d')]&&_0x2ba7cc[_0xc1fb('0x1d')][_0xc1fb('0x2c')]?_0x2ba7cc[_0xc1fb('0x1d')][_0xc1fb('0x2c')]:'');},'ignoreRoute':function(_0x957c31){var _0x1b8fc0=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1b8fc0[_0xc1fb('0x2d')](_0x957c31[_0xc1fb('0x24')]);}}));return _0x49d199();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 8e3dc70..1cb01da 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0f7=['lodash','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','isValid','split','locale','toLowerCase','indexOf','slice','concat','circularDoWInterval','monthsShort','exports','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','format','ddd','dowCompare','date','daysInMonth','min','domCompare','includes','monthCompare','guess','test','padStart','length','iftime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb0f7,0xea));var _0x7b0f=function(_0x4bcbfc,_0x312cea){_0x4bcbfc=_0x4bcbfc-0x0;var _0x520817=_0xb0f7[_0x4bcbfc];return _0x520817;};var _=require(_0x7b0f('0x0'));var moment=require(_0x7b0f('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x7b0f('0x2')](function(_0x1afd16){return _0x1afd16[_0x7b0f('0x3')];})[_0x7b0f('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x7b0f('0x5');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0xc52240){if(!_0xc52240[_0x7b0f('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x5a84d8){var _0x264031=_0x5a84d8[_0x7b0f('0x7')](':')[_0x7b0f('0x2')](function(_0x15a7f1){return parseInt(_0x15a7f1,0xa);});var _0x35377b=_0x264031[0x0];var _0x2dbe14=_0x264031[0x1];if(_0x35377b<0x0||_0x35377b>0x17||_0x2dbe14<0x0||_0x2dbe14>0x3b){throw new Error(EINVALID_DATE);}return[_0x35377b,_0x2dbe14];}function circularDoWInterval(_0x163d9d,_0x17cff9){if(_0x163d9d===_0x17cff9){return[_0x163d9d];}else{var _0xc883de=moment[_0x7b0f('0x8')]();moment['locale']('en');var _0x28b3f6=moment['weekdaysShort']()['map'](function(_0x538084){return _0x538084[_0x7b0f('0x9')]();});moment[_0x7b0f('0x8')](_0xc883de);var _0x1e807e=_0x28b3f6['indexOf'](_0x163d9d);var _0x32f3d1=_0x28b3f6[_0x7b0f('0xa')](_0x17cff9);if(_0x32f3d1>_0x1e807e){return _0x28b3f6[_0x7b0f('0xb')](_0x1e807e,_0x32f3d1+0x1);}else{var _0x4878d0=_0x28b3f6['slice'](0x0,_0x32f3d1+0x1);var _0x32cf01=_0x28b3f6['slice'](_0x1e807e);return _0x32cf01[_0x7b0f('0xc')](_0x4878d0);}}}module['exports'][_0x7b0f('0xd')]=circularDoWInterval;function circularMonthInterval(_0x4853e2,_0x5ee29c){if(_0x4853e2===_0x5ee29c){return[_0x4853e2];}else{var _0x37c393=moment[_0x7b0f('0x8')]();moment[_0x7b0f('0x8')]('en');var _0x4518ee=moment[_0x7b0f('0xe')]()[_0x7b0f('0x2')](function(_0x2ea17e){return _0x2ea17e['toLowerCase']();});moment[_0x7b0f('0x8')](_0x37c393);var _0x2d088d=_0x4518ee[_0x7b0f('0xa')](_0x4853e2);var _0x1fa195=_0x4518ee[_0x7b0f('0xa')](_0x5ee29c);if(_0x1fa195>_0x2d088d){return _0x4518ee[_0x7b0f('0xb')](_0x2d088d,_0x1fa195+0x1);}else{var _0x3cd01d=_0x4518ee[_0x7b0f('0xb')](0x0,_0x1fa195+0x1);var _0x2af50c=_0x4518ee[_0x7b0f('0xb')](_0x2d088d);return _0x2af50c[_0x7b0f('0xc')](_0x3cd01d);}}}module[_0x7b0f('0xf')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x25818d){var _0x171b57=parseInt(_0x25818d,0xa);if(_0x171b57<0x1||_0x171b57>0x1f){throw new Error(EINVALID_DATE);}return _0x171b57;}function timeCompare(_0x3e8661,_0x27e9c6,_0x4cb5aa){var _0x3242a0=_0x3e8661['clone']();var _0xbe17a4=extractTime(_0x27e9c6);var _0x2afc89=_0xbe17a4[0x0];var _0x445a6a=_0xbe17a4[0x1];var _0x2a7059=_0x3e8661[_0x7b0f('0x10')]()[_0x7b0f('0x11')](_0x2afc89)[_0x7b0f('0x12')](_0x445a6a);throwIfDateNotValid(_0x2a7059);var _0x7d50b8=extractTime(_0x4cb5aa);var _0x41fb93=_0x7d50b8[0x0];var _0x150dc9=_0x7d50b8[0x1];var _0x47c8e6=_0x3e8661['clone']()[_0x7b0f('0x11')](_0x41fb93)[_0x7b0f('0x12')](_0x150dc9);throwIfDateNotValid(_0x47c8e6);if(_0x47c8e6[_0x7b0f('0x13')](_0x2a7059)){var _0x326338=_0x3242a0[_0x7b0f('0x10')]()[_0x7b0f('0x14')](_0x7b0f('0x15'));var _0x59ab95=_0x3242a0[_0x7b0f('0x10')]()[_0x7b0f('0x16')](_0x7b0f('0x15'));return _0x3242a0[_0x7b0f('0x17')](_0x2a7059,_0x59ab95,undefined,'[]')||_0x3242a0[_0x7b0f('0x17')](_0x326338,_0x47c8e6,undefined,'[]');}else{return _0x3242a0[_0x7b0f('0x17')](_0x2a7059,_0x47c8e6,undefined,'[]');}}module[_0x7b0f('0xf')][_0x7b0f('0x18')]=timeCompare;function dowCompare(_0x5cc18f,_0x5c4222,_0x12e26f){var _0x11050f=_0x5cc18f[_0x7b0f('0x8')]('en')[_0x7b0f('0x19')](_0x7b0f('0x1a'))[_0x7b0f('0x9')]();return circularDoWInterval(_0x5c4222,_0x12e26f)['includes'](_0x11050f);}module[_0x7b0f('0xf')][_0x7b0f('0x1b')]=dowCompare;function domCompare(_0x24e177,_0x29b50e,_0x492412){var _0x1cd6ee=_0x24e177[_0x7b0f('0x1c')]();if(_0x29b50e===_0x492412){return _0x1cd6ee===_0x29b50e;}else{var _0x5aedea=_0x24e177[_0x7b0f('0x1d')]();var _0x29698e=_0x29b50e<_0x492412;let _0x2cce96=![];var _0x4d0a02=0x0;var _0x274377=0x0;if(_0x29698e){_0x4d0a02=Math['max'](0x1,_0x29b50e);_0x274377=Math[_0x7b0f('0x1e')](_0x492412,_0x5aedea);_0x2cce96=_0x1cd6ee>=_0x4d0a02&&_0x1cd6ee<=_0x274377;}else{_0x4d0a02=Math[_0x7b0f('0x1e')](_0x29b50e,_0x5aedea);_0x274377=Math['max'](0x1,_0x492412);_0x2cce96=_0x1cd6ee>=_0x4d0a02||_0x1cd6ee<=_0x274377;}return _0x2cce96;}}module['exports'][_0x7b0f('0x1f')]=domCompare;function monthCompare(_0x46a8d7,_0x5c5d5a,_0x1949c1){var _0x59c64e=_0x46a8d7[_0x7b0f('0x8')]('en')[_0x7b0f('0x19')]('MMM')[_0x7b0f('0x9')]();return circularMonthInterval(_0x5c5d5a,_0x1949c1)[_0x7b0f('0x20')](_0x59c64e);}module[_0x7b0f('0xf')][_0x7b0f('0x21')]=monthCompare;function iftime(_0x11e3a4,_0xd2ad2c=moment['tz'][_0x7b0f('0x22')](),_0x147e99=moment()){if(!validateRx[_0x7b0f('0x23')](_0x11e3a4)){throw new Error(EINVALID_STRING);}else{var _0xb39162=(moment['isMoment'](_0x147e99)?_0x147e99[_0x7b0f('0x10')]():moment(_0x147e99))['tz'](_0xd2ad2c)[_0x7b0f('0x8')]('en');throwIfDateNotValid(_0xb39162);var _0x541e79=_0x11e3a4[_0x7b0f('0x7')](',');var _0x541f3a=_0x541e79[0x0];var _0x25d0d5=_0x541e79[0x1];var _0x40a9b7=_0x541e79[0x2];var _0x448a2b=_0x541e79[0x3];let _0x24144d=!![];if(_0x541f3a!=='*'){var _0x25a706=_0x541f3a['split']('-');var _0x5b5ed3=_[_0x7b0f('0x24')](_0x25a706[0x0],0x5,'0');var _0x4924a3=_0x25a706[_0x7b0f('0x25')]===0x2?_[_0x7b0f('0x24')](_0x25a706[0x1],0x5,'0'):_0x5b5ed3;_0x24144d=timeCompare(_0xb39162,_0x5b5ed3,_0x4924a3);}let _0x3cc895=!![];if(_0x25d0d5!=='*'){var _0x41afb6=_0x25d0d5['split']('-');var _0x10eb43=_0x41afb6[0x0];var _0x26d9e1=_0x41afb6[_0x7b0f('0x25')]===0x2?_0x41afb6[0x1]:_0x10eb43;_0x3cc895=dowCompare(_0xb39162,_0x10eb43,_0x26d9e1);}let _0x27bfeb=!![];if(_0x40a9b7!=='*'){var _0x5edeaa=_0x40a9b7[_0x7b0f('0x7')]('-');var _0x15574d=parseDom(_0x5edeaa[0x0]);var _0x543e78=_0x5edeaa[_0x7b0f('0x25')]===0x2?parseDom(_0x5edeaa[0x1]):_0x15574d;_0x27bfeb=domCompare(_0xb39162,_0x15574d,_0x543e78);}let _0x18717a=!![];if(_0x448a2b!=='*'){var _0x358e82=_0x448a2b[_0x7b0f('0x7')]('-');var _0x28b896=_0x358e82[0x0];var _0x2edb28=_0x358e82[_0x7b0f('0x25')]===0x2?_0x358e82[0x1]:_0x358e82[0x0];_0x18717a=monthCompare(_0xb39162,_0x28b896,_0x2edb28);}return _0x24144d&&_0x3cc895&&_0x27bfeb&&_0x18717a;}}module[_0x7b0f('0xf')][_0x7b0f('0x26')]=iftime; \ No newline at end of file +var _0x740c=['moment-timezone','source','join','Interval\x20string\x20not\x20valid','split','locale','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','map','circularMonthInterval','clone','hours','isBefore','day','isBetween','timeCompare','ddd','includes','dowCompare','date','daysInMonth','min','max','format','MMM','monthCompare','guess','test','isMoment','length','padStart','iftime','lodash'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x740c,0x97));var _0xc740=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x740c[_0x20a584];return _0x4b41a8;};var _=require(_0xc740('0x0'));var moment=require(_0xc740('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x2167b0){return _0x2167b0[_0xc740('0x2')];})[_0xc740('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xc740('0x4');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x48599f){if(!_0x48599f['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x50f67a){var _0x2df3cb=_0x50f67a[_0xc740('0x5')](':')['map'](function(_0x55cf5d){return parseInt(_0x55cf5d,0xa);});var _0x5995d7=_0x2df3cb[0x0];var _0x23f4a5=_0x2df3cb[0x1];if(_0x5995d7<0x0||_0x5995d7>0x17||_0x23f4a5<0x0||_0x23f4a5>0x3b){throw new Error(EINVALID_DATE);}return[_0x5995d7,_0x23f4a5];}function circularDoWInterval(_0x1771ea,_0x16659d){if(_0x1771ea===_0x16659d){return[_0x1771ea];}else{var _0x4171fb=moment[_0xc740('0x6')]();moment[_0xc740('0x6')]('en');var _0x5d0ff2=moment['weekdaysShort']()['map'](function(_0x363f06){return _0x363f06[_0xc740('0x7')]();});moment['locale'](_0x4171fb);var _0x24b8ad=_0x5d0ff2[_0xc740('0x8')](_0x1771ea);var _0x54a9c9=_0x5d0ff2[_0xc740('0x8')](_0x16659d);if(_0x54a9c9>_0x24b8ad){return _0x5d0ff2[_0xc740('0x9')](_0x24b8ad,_0x54a9c9+0x1);}else{var _0x26b2d4=_0x5d0ff2['slice'](0x0,_0x54a9c9+0x1);var _0x579224=_0x5d0ff2[_0xc740('0x9')](_0x24b8ad);return _0x579224[_0xc740('0xa')](_0x26b2d4);}}}module[_0xc740('0xb')][_0xc740('0xc')]=circularDoWInterval;function circularMonthInterval(_0x234426,_0x361fd7){if(_0x234426===_0x361fd7){return[_0x234426];}else{var _0x1c9525=moment['locale']();moment[_0xc740('0x6')]('en');var _0x3b9cf0=moment[_0xc740('0xd')]()[_0xc740('0xe')](function(_0xd93bf4){return _0xd93bf4[_0xc740('0x7')]();});moment[_0xc740('0x6')](_0x1c9525);var _0x1e1581=_0x3b9cf0[_0xc740('0x8')](_0x234426);var _0x57bfd6=_0x3b9cf0[_0xc740('0x8')](_0x361fd7);if(_0x57bfd6>_0x1e1581){return _0x3b9cf0[_0xc740('0x9')](_0x1e1581,_0x57bfd6+0x1);}else{var _0x3cd3f4=_0x3b9cf0[_0xc740('0x9')](0x0,_0x57bfd6+0x1);var _0x492541=_0x3b9cf0[_0xc740('0x9')](_0x1e1581);return _0x492541['concat'](_0x3cd3f4);}}}module[_0xc740('0xb')][_0xc740('0xf')]=circularMonthInterval;function parseDom(_0x2afe6b){var _0x142454=parseInt(_0x2afe6b,0xa);if(_0x142454<0x1||_0x142454>0x1f){throw new Error(EINVALID_DATE);}return _0x142454;}function timeCompare(_0x4f1c19,_0x13fc6d,_0x1fc4e8){var _0x549d33=_0x4f1c19['clone']();var _0x30c38b=extractTime(_0x13fc6d);var _0x4276bf=_0x30c38b[0x0];var _0x594018=_0x30c38b[0x1];var _0x472cf5=_0x4f1c19[_0xc740('0x10')]()['hours'](_0x4276bf)['minutes'](_0x594018);throwIfDateNotValid(_0x472cf5);var _0x2a3f0b=extractTime(_0x1fc4e8);var _0x276252=_0x2a3f0b[0x0];var _0x4b930c=_0x2a3f0b[0x1];var _0x2736b1=_0x4f1c19[_0xc740('0x10')]()[_0xc740('0x11')](_0x276252)['minutes'](_0x4b930c);throwIfDateNotValid(_0x2736b1);if(_0x2736b1[_0xc740('0x12')](_0x472cf5)){var _0x3c08c1=_0x549d33['clone']()['startOf'](_0xc740('0x13'));var _0xcd347d=_0x549d33[_0xc740('0x10')]()['endOf'](_0xc740('0x13'));return _0x549d33['isBetween'](_0x472cf5,_0xcd347d,undefined,'[]')||_0x549d33[_0xc740('0x14')](_0x3c08c1,_0x2736b1,undefined,'[]');}else{return _0x549d33[_0xc740('0x14')](_0x472cf5,_0x2736b1,undefined,'[]');}}module[_0xc740('0xb')][_0xc740('0x15')]=timeCompare;function dowCompare(_0x398817,_0x26a135,_0x4c1365){var _0x2e26a8=_0x398817[_0xc740('0x6')]('en')['format'](_0xc740('0x16'))[_0xc740('0x7')]();return circularDoWInterval(_0x26a135,_0x4c1365)[_0xc740('0x17')](_0x2e26a8);}module[_0xc740('0xb')][_0xc740('0x18')]=dowCompare;function domCompare(_0xc488d,_0x38d8d6,_0x2c92ab){var _0x3aa47e=_0xc488d[_0xc740('0x19')]();if(_0x38d8d6===_0x2c92ab){return _0x3aa47e===_0x38d8d6;}else{var _0x3863ab=_0xc488d[_0xc740('0x1a')]();var _0x4a4758=_0x38d8d6<_0x2c92ab;let _0x39cf13=![];var _0x34cf0c=0x0;var _0x49ca77=0x0;if(_0x4a4758){_0x34cf0c=Math['max'](0x1,_0x38d8d6);_0x49ca77=Math[_0xc740('0x1b')](_0x2c92ab,_0x3863ab);_0x39cf13=_0x3aa47e>=_0x34cf0c&&_0x3aa47e<=_0x49ca77;}else{_0x34cf0c=Math[_0xc740('0x1b')](_0x38d8d6,_0x3863ab);_0x49ca77=Math[_0xc740('0x1c')](0x1,_0x2c92ab);_0x39cf13=_0x3aa47e>=_0x34cf0c||_0x3aa47e<=_0x49ca77;}return _0x39cf13;}}module['exports']['domCompare']=domCompare;function monthCompare(_0x58a71c,_0x3ff02e,_0x1493d6){var _0x3fe13f=_0x58a71c[_0xc740('0x6')]('en')[_0xc740('0x1d')](_0xc740('0x1e'))['toLowerCase']();return circularMonthInterval(_0x3ff02e,_0x1493d6)[_0xc740('0x17')](_0x3fe13f);}module[_0xc740('0xb')][_0xc740('0x1f')]=monthCompare;function iftime(_0x3fad58,_0x1d374d=moment['tz'][_0xc740('0x20')](),_0x336061=moment()){if(!validateRx[_0xc740('0x21')](_0x3fad58)){throw new Error(EINVALID_STRING);}else{var _0x58e891=(moment[_0xc740('0x22')](_0x336061)?_0x336061[_0xc740('0x10')]():moment(_0x336061))['tz'](_0x1d374d)[_0xc740('0x6')]('en');throwIfDateNotValid(_0x58e891);var _0x1e32b7=_0x3fad58[_0xc740('0x5')](',');var _0xe7a3d5=_0x1e32b7[0x0];var _0x115d90=_0x1e32b7[0x1];var _0x1a78da=_0x1e32b7[0x2];var _0x1442ae=_0x1e32b7[0x3];let _0x459298=!![];if(_0xe7a3d5!=='*'){var _0x13a265=_0xe7a3d5[_0xc740('0x5')]('-');var _0x498b0d=_['padStart'](_0x13a265[0x0],0x5,'0');var _0x3b923f=_0x13a265[_0xc740('0x23')]===0x2?_[_0xc740('0x24')](_0x13a265[0x1],0x5,'0'):_0x498b0d;_0x459298=timeCompare(_0x58e891,_0x498b0d,_0x3b923f);}let _0x4aa807=!![];if(_0x115d90!=='*'){var _0x498b03=_0x115d90[_0xc740('0x5')]('-');var _0x164499=_0x498b03[0x0];var _0x3ec73d=_0x498b03[_0xc740('0x23')]===0x2?_0x498b03[0x1]:_0x164499;_0x4aa807=dowCompare(_0x58e891,_0x164499,_0x3ec73d);}let _0x57632a=!![];if(_0x1a78da!=='*'){var _0x471548=_0x1a78da['split']('-');var _0x483ce8=parseDom(_0x471548[0x0]);var _0x46ecba=_0x471548[_0xc740('0x23')]===0x2?parseDom(_0x471548[0x1]):_0x483ce8;_0x57632a=domCompare(_0x58e891,_0x483ce8,_0x46ecba);}let _0x834837=!![];if(_0x1442ae!=='*'){var _0x107206=_0x1442ae[_0xc740('0x5')]('-');var _0x52af25=_0x107206[0x0];var _0x3791d=_0x107206[_0xc740('0x23')]===0x2?_0x107206[0x1]:_0x107206[0x0];_0x834837=monthCompare(_0x58e891,_0x52af25,_0x3791d);}return _0x459298&&_0x4aa807&&_0x57632a&&_0x834837;}}module[_0xc740('0xb')][_0xc740('0x25')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index b89c568..43a067e 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa581=['level','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','fileLogger','path','winston','../config/environment','debugLevel','info','redBG\x20white','white','bold\x20white','gray','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','%s-%s.log','message','replace','{{{','}}}','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xa581,0xee));var _0x1a58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa581[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x1a58('0x0'));var util=require('util');var moment=require('moment');var winston=require(_0x1a58('0x1'));var config=require(_0x1a58('0x2'));var debugLevel=config[_0x1a58('0x3')]?config[_0x1a58('0x3')]['toLowerCase']():_0x1a58('0x4');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x1a58('0x5'),'error':'red','warn':'bold\x20yellow','info':_0x1a58('0x6'),'print':_0x1a58('0x7'),'success':'bold\x20green','http':_0x1a58('0x8'),'verbose':'bold\x20magenta','debug':_0x1a58('0x9'),'silly':_0x1a58('0xa')};winston[_0x1a58('0xb')](XC_LOG_COLORS);function getLogFileName(_0x4a7bbe,_0x2b2b39,_0x2bd8b5){var _0x221df7=_0x4a7bbe||_0x1a58('0xc');return path[_0x1a58('0xd')](_0x221df7,util['format'](_0x1a58('0xe'),_0x2b2b39,_0x2bd8b5));}function formatter(_0x3acaab,_0x226518){_0x226518[_0x1a58('0xf')]=_0x226518['message'][_0x1a58('0x10')](/@@{/g,_0x1a58('0x11'))[_0x1a58('0x10')](/}@@/g,_0x1a58('0x12'))[_0x1a58('0x10')](/@{/g,'{{')[_0x1a58('0x10')](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x1a58('0x13')](_0x1a58('0x14')),_0x226518[_0x1a58('0x15')][_0x1a58('0x16')](),_0x3acaab,_0x226518['message']);}function fileFormat(_0x16d754,_0x2c3abb){_0x2c3abb['message']=_0x2c3abb[_0x1a58('0xf')]['replace'](/@@{/g,_0x1a58('0x11'))['replace'](/}@@/g,_0x1a58('0x12'))[_0x1a58('0x10')](/@{/g,'{{')[_0x1a58('0x10')](/}@/g,'}}');var _0x112442=_0x2c3abb[_0x1a58('0x17')]&&Object[_0x1a58('0x18')](_0x2c3abb[_0x1a58('0x17')])[_0x1a58('0x19')]?'\x0a\x09'+JSON[_0x1a58('0x1a')](_0x2c3abb[_0x1a58('0x17')]):'';return util[_0x1a58('0x13')](_0x1a58('0x1b'),moment()[_0x1a58('0x13')](_0x1a58('0x14')),_0x2c3abb[_0x1a58('0x15')][_0x1a58('0x16')](),_0x16d754,_0x2c3abb[_0x1a58('0xf')],_0x112442);}function consoleLogger(){var _0x38ff77=new winston[(_0x1a58('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x1a58('0x1d'))][(_0x1a58('0x1e'))]({'level':_0x1a58('0x1f'),'json':![],'formatter':function(_0x3a7247){return formatter('',_0x3a7247);}})]});return _0x38ff77;}function fileLogger(_0x36bc0e,_0x5546db){var _0x2c74b5=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x1a58('0x1d'))][(_0x1a58('0x20'))]({'name':util[_0x1a58('0x13')](_0x1a58('0x21'),_0x36bc0e,_0x1a58('0x22')),'filename':getLogFileName(_0x5546db,_0x36bc0e,_0x1a58('0x22')),'level':_0x1a58('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x414e4e){return fileFormat(_0x36bc0e,_0x414e4e);}}),new winston['transports'][(_0x1a58('0x20'))]({'name':util[_0x1a58('0x13')](_0x1a58('0x21'),_0x36bc0e,debugLevel),'filename':getLogFileName(_0x5546db,_0x36bc0e,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x408c34){return fileFormat(_0x36bc0e,_0x408c34);}}),new winston[(_0x1a58('0x1d'))]['Console']({'level':'warn','json':![],'formatter':function(_0x3743ac){return fileFormat(_0x36bc0e,_0x3743ac);}})]});return _0x2c74b5;}exports[_0x1a58('0x23')]=consoleLogger;exports[_0x1a58('0x24')]=fileLogger; \ No newline at end of file +var _0x48b0=['meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Console','warn','Logger','transports','error','File','fileLogger','path','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x48b0,0xf0));var _0x048b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x48b0[_0x321bb2];return _0x9c12ed;};'use strict';var path=require(_0x048b('0x0'));var util=require('util');var moment=require('moment');var winston=require('winston');var config=require(_0x048b('0x1'));var debugLevel=config[_0x048b('0x2')]?config[_0x048b('0x2')][_0x048b('0x3')]():_0x048b('0x4');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x048b('0x5'),'error':'red','warn':'bold\x20yellow','info':_0x048b('0x6'),'print':_0x048b('0x7'),'success':_0x048b('0x8'),'http':_0x048b('0x9'),'verbose':_0x048b('0xa'),'debug':_0x048b('0xb'),'silly':_0x048b('0xc')};winston[_0x048b('0xd')](XC_LOG_COLORS);function getLogFileName(_0xac94b9,_0x19c48e,_0x4fb453){var _0xbfef47=_0xac94b9||_0x048b('0xe');return path[_0x048b('0xf')](_0xbfef47,util[_0x048b('0x10')](_0x048b('0x11'),_0x19c48e,_0x4fb453));}function formatter(_0x7ff51e,_0x154084){_0x154084[_0x048b('0x12')]=_0x154084[_0x048b('0x12')][_0x048b('0x13')](/@@{/g,_0x048b('0x14'))['replace'](/}@@/g,_0x048b('0x15'))[_0x048b('0x13')](/@{/g,'{{')[_0x048b('0x13')](/}@/g,'}}');return util[_0x048b('0x10')](_0x048b('0x16'),moment()[_0x048b('0x10')](_0x048b('0x17')),_0x154084[_0x048b('0x18')][_0x048b('0x19')](),_0x7ff51e,_0x154084[_0x048b('0x12')]);}function fileFormat(_0x3c5a66,_0x347b75){_0x347b75[_0x048b('0x12')]=_0x347b75['message']['replace'](/@@{/g,_0x048b('0x14'))[_0x048b('0x13')](/}@@/g,_0x048b('0x15'))[_0x048b('0x13')](/@{/g,'{{')[_0x048b('0x13')](/}@/g,'}}');var _0x471107=_0x347b75[_0x048b('0x1a')]&&Object[_0x048b('0x1b')](_0x347b75['meta'])[_0x048b('0x1c')]?'\x0a\x09'+JSON[_0x048b('0x1d')](_0x347b75[_0x048b('0x1a')]):'';return util['format'](_0x048b('0x1e'),moment()[_0x048b('0x10')](_0x048b('0x17')),_0x347b75[_0x048b('0x18')][_0x048b('0x19')](),_0x3c5a66,_0x347b75[_0x048b('0x12')],_0x471107);}function consoleLogger(){var _0x1dbee0=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x048b('0x1f'))]({'level':_0x048b('0x20'),'json':![],'formatter':function(_0x454421){return formatter('',_0x454421);}})]});return _0x1dbee0;}function fileLogger(_0x17f27f,_0x2aa73f){var _0x437d0c=new winston[(_0x048b('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x048b('0x22'))]['File']({'name':util[_0x048b('0x10')]('%s-%s',_0x17f27f,_0x048b('0x23')),'filename':getLogFileName(_0x2aa73f,_0x17f27f,_0x048b('0x23')),'level':_0x048b('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1a2e5c){return fileFormat(_0x17f27f,_0x1a2e5c);}}),new winston[(_0x048b('0x22'))][(_0x048b('0x24'))]({'name':util[_0x048b('0x10')]('%s-%s',_0x17f27f,debugLevel),'filename':getLogFileName(_0x2aa73f,_0x17f27f,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3a0f20){return fileFormat(_0x17f27f,_0x3a0f20);}}),new winston['transports'][(_0x048b('0x1f'))]({'level':_0x048b('0x20'),'json':![],'formatter':function(_0xc55fcd){return fileFormat(_0x17f27f,_0xc55fcd);}})]});return _0x437d0c;}exports['consoleLogger']=consoleLogger;exports[_0x048b('0x25')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 8282ed4..6bcb935 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x1967,0x173));var _0x7196=function(_0x20db18,_0x1200a6){_0x20db18=_0x20db18-0x0;var _0x31de9d=_0x1967[_0x20db18];return _0x31de9d;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x57ca=['accesskeyid','secretaccesskey','key','user','accountSid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','@@{','replace','}@@','includes','exports','username','password','apiKey','firstName','lastName','street','phone','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerSecret','calleridname','calleridnum','vidaooApiKey','privateKey'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x57ca,0x108));var _0xa57c=function(_0x559c7a,_0x1544e7){_0x559c7a=_0x559c7a-0x0;var _0x319cd0=_0x57ca[_0x559c7a];return _0x319cd0;};var _=require('lodash');var sensitiveFields=[_0xa57c('0x0'),_0xa57c('0x1'),'newPassword',_0xa57c('0x2'),_0xa57c('0x3'),_0xa57c('0x4'),_0xa57c('0x5'),_0xa57c('0x6'),'mobile',_0xa57c('0x7'),_0xa57c('0x8'),_0xa57c('0x9'),_0xa57c('0xa'),_0xa57c('0xb'),_0xa57c('0xc'),_0xa57c('0xd'),_0xa57c('0xe'),'token',_0xa57c('0xf'),'accessToken',_0xa57c('0x10'),_0xa57c('0x11'),'consumerKey',_0xa57c('0x12'),'membername',_0xa57c('0x13'),_0xa57c('0x14'),'exten',_0xa57c('0x15'),'clientEmail',_0xa57c('0x16'),_0xa57c('0x17'),_0xa57c('0x18'),_0xa57c('0x19'),_0xa57c('0x1a'),'pass',_0xa57c('0x1b'),'localstationid',_0xa57c('0x1c'),_0xa57c('0x1d'),_0xa57c('0x1e'),_0xa57c('0x1f')];function maskSensitiveData(_0x3238ff){const _0x37a323=/(?!^)[\s\S](?!$)/g;if(_[_0xa57c('0x20')](_0x3238ff)){for(const _0x4b4bdb in _0x3238ff){if(_[_0xa57c('0x21')](_0x3238ff[_0x4b4bdb])){for(let _0xdf7ff6=0x0;_0xdf7ff6<_0x3238ff[_0x4b4bdb][_0xa57c('0x22')];_0xdf7ff6++){maskSensitiveData(_0x3238ff[_0x4b4bdb][_0xdf7ff6]);}}else if(_['isPlainObject'](_0x3238ff[_0x4b4bdb])){maskSensitiveData(_0x3238ff[_0x4b4bdb]);}else if(_[_0xa57c('0x23')](_0x3238ff[_0x4b4bdb])){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb]['replace'](/{{{/g,_0xa57c('0x24'))[_0xa57c('0x25')](/}}}/g,_0xa57c('0x26'))[_0xa57c('0x25')](/{{/g,'@{')[_0xa57c('0x25')](/}}/g,'}@');if(_[_0xa57c('0x27')](sensitiveFields,_0x4b4bdb)){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb][_0xa57c('0x25')](_0x37a323,'*');}}}}}module[_0xa57c('0x28')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/misc.js b/server/utils/misc.js index add7b01..40b3ce4 100644 --- a/server/utils/misc.js +++ b/server/utils/misc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53ec=['exports','replace','\x5c$&'];(function(_0x10f53c,_0x1de4bb){var _0x55e681=function(_0x319cdc){while(--_0x319cdc){_0x10f53c['push'](_0x10f53c['shift']());}};_0x55e681(++_0x1de4bb);}(_0x53ec,0x192));var _0xc53e=function(_0x584e52,_0x5443dc){_0x584e52=_0x584e52-0x0;var _0x5cf710=_0x53ec[_0x584e52];return _0x5cf710;};module[_0xc53e('0x0')]={'escapeRegExp'(_0x173f4d,_0x2d5f51=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x173f4d[_0xc53e('0x1')](_0x2d5f51,_0xc53e('0x2'));}}; \ No newline at end of file +var _0xf494=['exports','\x5c$&'];(function(_0x4abda8,_0x1ef893){var _0x36a692=function(_0xa6621d){while(--_0xa6621d){_0x4abda8['push'](_0x4abda8['shift']());}};_0x36a692(++_0x1ef893);}(_0xf494,0x1c6));var _0x4f49=function(_0x1c30e9,_0x103a59){_0x1c30e9=_0x1c30e9-0x0;var _0xb01c02=_0xf494[_0x1c30e9];return _0xb01c02;};module[_0x4f49('0x0')]={'escapeRegExp'(_0x32e808,_0x3063f3=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x32e808['replace'](_0x3063f3,_0x4f49('0x1'));}}; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 0d97456..1739994 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1775=['exports','safeTemplate','{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','keys','reduce'];(function(_0x3ec74e,_0x2f6536){var _0x5a53f9=function(_0x461459){while(--_0x461459){_0x3ec74e['push'](_0x3ec74e['shift']());}};_0x5a53f9(++_0x2f6536);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0xb5c9b1){return _0xb5c9b1==='{{'?_0x5177('0x0'):_0x5177('0x1');}function safeTemplate(_0x2ca33b){var _0xaad33e=_0x2ca33b;if(typeof _0x2ca33b===_0x5177('0x2')){_0xaad33e=_0x2ca33b[_0x5177('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x5177('0x4')](_0x2ca33b)){_0xaad33e=_0x2ca33b[_0x5177('0x5')](function(_0x51275f){return safeTemplate(_0x51275f);});}else if(_[_0x5177('0x6')](_0x2ca33b)){_0xaad33e=Object[_0x5177('0x7')](_0x2ca33b)[_0x5177('0x8')](function(_0x2ac1c6,_0x300b43){_0x2ac1c6[_0x300b43]=safeTemplate(_0x2ca33b[_0x300b43]);return _0x2ac1c6;},{});}return _0xaad33e;}module[_0x5177('0x9')][_0x5177('0xa')]=safeTemplate; \ No newline at end of file +var _0x3266=['\x20}\x20}','string','replace','isArray','keys','reduce','exports','lodash','{\x20{\x20'];(function(_0x585d75,_0xbc708c){var _0x3884ec=function(_0x3bc48e){while(--_0x3bc48e){_0x585d75['push'](_0x585d75['shift']());}};_0x3884ec(++_0xbc708c);}(_0x3266,0x6a));var _0x6326=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0x3266[_0x1793de];return _0x4f0309;};var _=require(_0x6326('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2b328d){return _0x2b328d==='{{'?_0x6326('0x1'):_0x6326('0x2');}function safeTemplate(_0x545df7){var _0x6b67c0=_0x545df7;if(typeof _0x545df7===_0x6326('0x3')){_0x6b67c0=_0x545df7[_0x6326('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x6326('0x5')](_0x545df7)){_0x6b67c0=_0x545df7['map'](function(_0x30b22e){return safeTemplate(_0x30b22e);});}else if(_['isPlainObject'](_0x545df7)){_0x6b67c0=Object[_0x6326('0x6')](_0x545df7)[_0x6326('0x7')](function(_0x14208e,_0x5402e5){_0x14208e[_0x5402e5]=safeTemplate(_0x545df7[_0x5402e5]);return _0x14208e;},{});}return _0x6b67c0;}module[_0x6326('0x8')]['safeTemplate']=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 2dc5438..e420374 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf80f=['fs-extra','root','resolve','server/app.json','isArray','apps','findIndex','name','motion2','NODE_PATH','string','env','then','readJSON','updated','info','Updating\x20app.json','writeJSON','exports'];(function(_0x1ce2bd,_0x222e48){var _0x53d1e7=function(_0x5f3db2){while(--_0x5f3db2){_0x1ce2bd['push'](_0x1ce2bd['shift']());}};_0x53d1e7(++_0x222e48);}(_0xf80f,0x169));var _0xff80=function(_0x5a2575,_0x5cdfff){_0x5a2575=_0x5a2575-0x0;var _0x567ed3=_0xf80f[_0x5a2575];return _0x567ed3;};var fs=require(_0xff80('0x0'));var path=require('path');var config=require('../config/environment');var root=config[_0xff80('0x1')];var APP_JSON_PATH=path[_0xff80('0x2')](root,_0xff80('0x3'));var NODEPATH=path[_0xff80('0x2')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x350f75){let _0x43bec0=![];if(Array[_0xff80('0x4')](_0x350f75[_0xff80('0x5')])){var _0x12ade3=_0x350f75[_0xff80('0x5')][_0xff80('0x6')](function(_0x4476a2){return _0x4476a2[_0xff80('0x7')]===_0xff80('0x8');});if(_0x12ade3>-0x1){var _0x164179=_0x350f75[_0xff80('0x5')][_0x12ade3];if(typeof _0x164179['env'][_0xff80('0x9')]!==_0xff80('0xa')){_0x164179[_0xff80('0xb')][_0xff80('0x9')]=NODEPATH;_0x43bec0=!![];}}return{'appConfig':_0x350f75,'updated':_0x43bec0};}}function updateAppConfig(_0x5d2bd0){return fs['pathExists'](APP_JSON_PATH)[_0xff80('0xc')](function(_0x18e358){if(_0x18e358){return fs[_0xff80('0xd')](APP_JSON_PATH)[_0xff80('0xc')](function(_0xb50493){var _0xb59d89=setLegacyLibsNodeEnvPath(_0xb50493);if(_0xb59d89[_0xff80('0xe')]){_0x5d2bd0[_0xff80('0xf')](_0xff80('0x10'));return fs[_0xff80('0x11')](APP_JSON_PATH,_0xb50493,{'spaces':0x2});}else{return Promise[_0xff80('0x2')]();}});}else{return Promise[_0xff80('0x2')]();}});}module[_0xff80('0x12')]=updateAppConfig; \ No newline at end of file +var _0x35c7=['apps','findIndex','name','motion2','NODE_PATH','env','then','readJSON','updated','info','Updating\x20app.json','exports','path','../config/environment','root','resolve','server/app.json'];(function(_0x4d3924,_0x58f044){var _0x38f8d4=function(_0x5c42cf){while(--_0x5c42cf){_0x4d3924['push'](_0x4d3924['shift']());}};_0x38f8d4(++_0x58f044);}(_0x35c7,0xb6));var _0x735c=function(_0x51ccd1,_0x4db52d){_0x51ccd1=_0x51ccd1-0x0;var _0x327b4e=_0x35c7[_0x51ccd1];return _0x327b4e;};var fs=require('fs-extra');var path=require(_0x735c('0x0'));var config=require(_0x735c('0x1'));var root=config[_0x735c('0x2')];var APP_JSON_PATH=path[_0x735c('0x3')](root,_0x735c('0x4'));var NODEPATH=path[_0x735c('0x3')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x4ebd37){let _0x2804e9=![];if(Array['isArray'](_0x4ebd37[_0x735c('0x5')])){var _0x43f9c9=_0x4ebd37['apps'][_0x735c('0x6')](function(_0x3ac7e0){return _0x3ac7e0[_0x735c('0x7')]===_0x735c('0x8');});if(_0x43f9c9>-0x1){var _0x33bc38=_0x4ebd37[_0x735c('0x5')][_0x43f9c9];if(typeof _0x33bc38['env'][_0x735c('0x9')]!=='string'){_0x33bc38[_0x735c('0xa')]['NODE_PATH']=NODEPATH;_0x2804e9=!![];}}return{'appConfig':_0x4ebd37,'updated':_0x2804e9};}}function updateAppConfig(_0x23957e){return fs['pathExists'](APP_JSON_PATH)[_0x735c('0xb')](function(_0x55f923){if(_0x55f923){return fs[_0x735c('0xc')](APP_JSON_PATH)['then'](function(_0x48ee70){var _0x15dc38=setLegacyLibsNodeEnvPath(_0x48ee70);if(_0x15dc38[_0x735c('0xd')]){_0x23957e[_0x735c('0xe')](_0x735c('0xf'));return fs['writeJSON'](APP_JSON_PATH,_0x48ee70,{'spaces':0x2});}else{return Promise[_0x735c('0x3')]();}});}else{return Promise[_0x735c('0x3')]();}});}module[_0x735c('0x10')]=updateAppConfig; \ No newline at end of file